@danielblomma/cortex-mcp 1.3.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/README.md +62 -14
  2. package/package.json +2 -2
  3. package/scaffold/mcp/package-lock.json +3 -7
  4. package/scaffold/mcp/package.json +1 -1
  5. package/scaffold/scripts/dashboard.mjs +15 -1
  6. package/scaffold/scripts/ingest.mjs +323 -50
  7. package/scaffold/scripts/parsers/bash-treesitter.mjs +229 -0
  8. package/scaffold/scripts/parsers/cpp-dispatch.mjs +56 -0
  9. package/scaffold/scripts/parsers/cpp-treesitter.mjs +333 -0
  10. package/scaffold/scripts/parsers/csharp.mjs +197 -10
  11. package/scaffold/scripts/parsers/dotnet/CSharpParser/CSharpParser.csproj +1 -0
  12. package/scaffold/scripts/parsers/dotnet/CSharpParser/Program.cs +126 -21
  13. package/scaffold/scripts/parsers/go-treesitter.mjs +283 -0
  14. package/scaffold/scripts/parsers/java-treesitter.mjs +250 -0
  15. package/scaffold/scripts/parsers/javascript/ast.mjs +118 -12
  16. package/scaffold/scripts/parsers/javascript/chunks.mjs +4 -0
  17. package/scaffold/scripts/parsers/javascript/patterns.mjs +6 -0
  18. package/scaffold/scripts/parsers/javascript.mjs +4 -19
  19. package/scaffold/scripts/parsers/node_modules/.package-lock.json +57 -0
  20. package/scaffold/scripts/parsers/node_modules/acorn/CHANGELOG.md +972 -0
  21. package/scaffold/scripts/parsers/node_modules/acorn/LICENSE +21 -0
  22. package/scaffold/scripts/parsers/node_modules/acorn/README.md +301 -0
  23. package/scaffold/scripts/parsers/node_modules/acorn/bin/acorn +4 -0
  24. package/scaffold/scripts/parsers/node_modules/acorn/dist/acorn.d.mts +883 -0
  25. package/scaffold/scripts/parsers/node_modules/acorn/dist/acorn.d.ts +883 -0
  26. package/scaffold/scripts/parsers/node_modules/acorn/dist/acorn.js +6295 -0
  27. package/scaffold/scripts/parsers/node_modules/acorn/dist/acorn.mjs +6266 -0
  28. package/scaffold/scripts/parsers/node_modules/acorn/dist/bin.js +90 -0
  29. package/scaffold/scripts/parsers/node_modules/acorn/package.json +50 -0
  30. package/scaffold/scripts/parsers/node_modules/acorn-typescript/CHANGELOG.md +421 -0
  31. package/scaffold/scripts/parsers/node_modules/acorn-typescript/LICENSE +21 -0
  32. package/scaffold/scripts/parsers/node_modules/acorn-typescript/README.md +81 -0
  33. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/error.d.ts +103 -0
  34. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/error.js +78 -0
  35. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/error.js.map +1 -0
  36. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/decorators.d.ts +167 -0
  37. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/decorators.js +75 -0
  38. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/decorators.js.map +1 -0
  39. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/import-assertions.d.ts +177 -0
  40. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/import-assertions.js +56 -0
  41. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/import-assertions.js.map +1 -0
  42. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/jsx/index.d.ts +198 -0
  43. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/jsx/index.js +327 -0
  44. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/jsx/index.js.map +1 -0
  45. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/jsx/xhtml.d.ts +256 -0
  46. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/jsx/xhtml.js +256 -0
  47. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/jsx/xhtml.js.map +1 -0
  48. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/index.d.ts +472 -0
  49. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/index.js +1 -0
  50. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/index.js.map +1 -0
  51. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/index.mjs +1 -0
  52. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/middleware.d.ts +159 -0
  53. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/middleware.js +2 -0
  54. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/middleware.js.map +1 -0
  55. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/parseutil.d.ts +10 -0
  56. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/parseutil.js +38 -0
  57. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/parseutil.js.map +1 -0
  58. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/scopeflags.d.ts +12 -0
  59. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/scopeflags.js +29 -0
  60. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/scopeflags.js.map +1 -0
  61. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/tokenType.d.ts +2 -0
  62. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/tokenType.js +118 -0
  63. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/tokenType.js.map +1 -0
  64. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/types.d.ts +60 -0
  65. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/types.js +2 -0
  66. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/types.js.map +1 -0
  67. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/whitespace.d.ts +2 -0
  68. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/whitespace.js +19 -0
  69. package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/whitespace.js.map +1 -0
  70. package/scaffold/scripts/parsers/node_modules/acorn-typescript/package.json +53 -0
  71. package/scaffold/scripts/parsers/node_modules/acorn-typescript/tsconfig.json +19 -0
  72. package/scaffold/scripts/parsers/node_modules/acorn-walk/CHANGELOG.md +209 -0
  73. package/scaffold/scripts/parsers/node_modules/acorn-walk/LICENSE +21 -0
  74. package/scaffold/scripts/parsers/node_modules/acorn-walk/README.md +124 -0
  75. package/scaffold/scripts/parsers/node_modules/acorn-walk/dist/walk.d.mts +152 -0
  76. package/scaffold/scripts/parsers/node_modules/acorn-walk/dist/walk.d.ts +152 -0
  77. package/scaffold/scripts/parsers/node_modules/acorn-walk/dist/walk.js +485 -0
  78. package/scaffold/scripts/parsers/node_modules/acorn-walk/dist/walk.mjs +467 -0
  79. package/scaffold/scripts/parsers/node_modules/acorn-walk/package.json +50 -0
  80. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/LICENSE +24 -0
  81. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/README.md +23 -0
  82. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-bash.wasm +0 -0
  83. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-c.wasm +0 -0
  84. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-c_sharp.wasm +0 -0
  85. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-cpp.wasm +0 -0
  86. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-css.wasm +0 -0
  87. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-dart.wasm +0 -0
  88. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-elisp.wasm +0 -0
  89. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-elixir.wasm +0 -0
  90. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-elm.wasm +0 -0
  91. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-embedded_template.wasm +0 -0
  92. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-go.wasm +0 -0
  93. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-html.wasm +0 -0
  94. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-java.wasm +0 -0
  95. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-javascript.wasm +0 -0
  96. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-json.wasm +0 -0
  97. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-kotlin.wasm +0 -0
  98. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-lua.wasm +0 -0
  99. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-objc.wasm +0 -0
  100. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-ocaml.wasm +0 -0
  101. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-php.wasm +0 -0
  102. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-python.wasm +0 -0
  103. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-ql.wasm +0 -0
  104. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-rescript.wasm +0 -0
  105. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-ruby.wasm +0 -0
  106. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-rust.wasm +0 -0
  107. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-scala.wasm +0 -0
  108. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-solidity.wasm +0 -0
  109. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-swift.wasm +0 -0
  110. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-systemrdl.wasm +0 -0
  111. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-tlaplus.wasm +0 -0
  112. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-toml.wasm +0 -0
  113. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-tsx.wasm +0 -0
  114. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-typescript.wasm +0 -0
  115. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-vue.wasm +0 -0
  116. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-yaml.wasm +0 -0
  117. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-zig.wasm +0 -0
  118. package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/package.json +64 -0
  119. package/scaffold/scripts/parsers/node_modules/web-tree-sitter/LICENSE +21 -0
  120. package/scaffold/scripts/parsers/node_modules/web-tree-sitter/README.md +198 -0
  121. package/scaffold/scripts/parsers/node_modules/web-tree-sitter/package.json +37 -0
  122. package/scaffold/scripts/parsers/node_modules/web-tree-sitter/tree-sitter-web.d.ts +242 -0
  123. package/scaffold/scripts/parsers/node_modules/web-tree-sitter/tree-sitter.js +1 -0
  124. package/scaffold/scripts/parsers/node_modules/web-tree-sitter/tree-sitter.wasm +0 -0
  125. package/scaffold/scripts/parsers/package-lock.json +19 -1
  126. package/scaffold/scripts/parsers/package.json +3 -1
  127. package/scaffold/scripts/parsers/python-treesitter.mjs +271 -0
  128. package/scaffold/scripts/parsers/ruby-treesitter.mjs +271 -0
  129. package/scaffold/scripts/parsers/rust-dispatch.mjs +43 -0
  130. package/scaffold/scripts/parsers/rust-treesitter.mjs +291 -0
  131. package/scaffold/scripts/parsers/tree-sitter/base.mjs +163 -0
  132. package/scaffold/scripts/parsers/tree-sitter/queries/bash.calls.scm +7 -0
  133. package/scaffold/scripts/parsers/tree-sitter/queries/bash.chunks.scm +6 -0
  134. package/scaffold/scripts/parsers/tree-sitter/queries/bash.imports.scm +5 -0
  135. package/scaffold/scripts/parsers/tree-sitter/queries/cpp.calls.scm +17 -0
  136. package/scaffold/scripts/parsers/tree-sitter/queries/cpp.chunks.scm +30 -0
  137. package/scaffold/scripts/parsers/tree-sitter/queries/cpp.imports.scm +6 -0
  138. package/scaffold/scripts/parsers/tree-sitter/queries/go.calls.scm +11 -0
  139. package/scaffold/scripts/parsers/tree-sitter/queries/go.chunks.scm +19 -0
  140. package/scaffold/scripts/parsers/tree-sitter/queries/go.imports.scm +6 -0
  141. package/scaffold/scripts/parsers/tree-sitter/queries/java.calls.scm +6 -0
  142. package/scaffold/scripts/parsers/tree-sitter/queries/java.chunks.scm +23 -0
  143. package/scaffold/scripts/parsers/tree-sitter/queries/java.imports.scm +6 -0
  144. package/scaffold/scripts/parsers/tree-sitter/queries/python.calls.scm +11 -0
  145. package/scaffold/scripts/parsers/tree-sitter/queries/python.chunks.scm +11 -0
  146. package/scaffold/scripts/parsers/tree-sitter/queries/python.imports.scm +13 -0
  147. package/scaffold/scripts/parsers/tree-sitter/queries/ruby.calls.scm +6 -0
  148. package/scaffold/scripts/parsers/tree-sitter/queries/ruby.chunks.scm +16 -0
  149. package/scaffold/scripts/parsers/tree-sitter/queries/ruby.imports.scm +8 -0
  150. package/scaffold/scripts/parsers/tree-sitter/queries/rust.calls.scm +31 -0
  151. package/scaffold/scripts/parsers/tree-sitter/queries/rust.chunks.scm +29 -0
  152. package/scaffold/scripts/parsers/tree-sitter/queries/rust.imports.scm +5 -0
  153. package/scaffold/scripts/parsers/vb6.mjs +395 -0
@@ -0,0 +1 @@
1
+ import*as t from"acorn";import{tokTypes as e,TokContext as s,TokenType as i,keywordTypes as r}from"acorn";function a(t,e){for(var s=0;s<e.length;s++){var i=e[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,"symbol"==typeof(r=function(t,e){if("object"!=typeof t||null===t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var i=s.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key))?r:String(r),i)}var r}function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t},n.apply(this,arguments)}function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,h(t,e)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,i=new Array(e);s<e;s++)i[s]=t[s];return i}function c(t,e){var s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return(s=s.call(t)).next.bind(s);if(Array.isArray(t)||(s=function(t,e){if(t){if("string"==typeof t)return p(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);return"Object"===s&&t.constructor&&(s=t.constructor.name),"Map"===s||"Set"===s?Array.from(t):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?p(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){s&&(t=s);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[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 l=!0;function u(t,e){return void 0===e&&(e={}),new i("name",e)}var d=new WeakMap;function m(t){var a=d.get(t.Parser.acorn||t);if(!a){var o={assert:u(0,{startsExpr:l}),asserts:u(0,{startsExpr:l}),global:u(0,{startsExpr:l}),keyof:u(0,{startsExpr:l}),readonly:u(0,{startsExpr:l}),unique:u(0,{startsExpr:l}),abstract:u(0,{startsExpr:l}),declare:u(0,{startsExpr:l}),enum:u(0,{startsExpr:l}),module:u(0,{startsExpr:l}),namespace:u(0,{startsExpr:l}),interface:u(0,{startsExpr:l}),type:u(0,{startsExpr:l})},h={at:new i("@"),jsxName:new i("jsxName"),jsxText:new i("jsxText",{beforeExpr:!0}),jsxTagStart:new i("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new i("jsxTagEnd")},p={tc_oTag:new s("<tag",!1,!1),tc_cTag:new s("</tag",!1,!1),tc_expr:new s("<tag>...</tag>",!0,!0)},c=new RegExp("^(?:"+Object.keys(o).join("|")+")$");h.jsxTagStart.updateContext=function(){this.context.push(p.tc_expr),this.context.push(p.tc_oTag),this.exprAllowed=!1},h.jsxTagEnd.updateContext=function(t){var s=this.context.pop();s===p.tc_oTag&&t===e.slash||s===p.tc_cTag?(this.context.pop(),this.exprAllowed=this.curContext()===p.tc_expr):this.exprAllowed=!0},a={tokTypes:n({},o,h),tokContexts:n({},p),keywordsRegExp:c,tokenIsLiteralPropertyName:function(t){return[e.name,e.string,e.num].concat(Object.values(r),Object.values(o)).includes(t)},tokenIsKeywordOrIdentifier:function(t){return[e.name].concat(Object.values(r),Object.values(o)).includes(t)},tokenIsIdentifier:function(t){return[].concat(Object.values(o),[e.name]).includes(t)},tokenIsTSDeclarationStart:function(t){return[o.abstract,o.declare,o.enum,o.module,o.namespace,o.interface,o.type].includes(t)},tokenIsTSTypeOperator:function(t){return[o.keyof,o.readonly,o.unique].includes(t)},tokenIsTemplate:function(t){return t===e.invalidTemplate}}}return a}var f=1024,y=new RegExp("(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*","y"),x=new RegExp("(?=("+y.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),T=function(){this.shorthandAssign=void 0,this.trailingComma=void 0,this.parenthesizedAssign=void 0,this.parenthesizedBind=void 0,this.doubleProto=void 0,this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};function v(t,e){var s=e.key.name,i=t[s],r="true";return"MethodDefinition"!==e.type||"get"!==e.kind&&"set"!==e.kind||(r=(e.static?"s":"i")+e.kind),"iget"===i&&"iset"===r||"iset"===i&&"iget"===r||"sget"===i&&"sset"===r||"sset"===i&&"sget"===r?(t[s]="true",!1):!!i||(t[s]=r,!1)}function P(t,e){var s=t.key;return!t.computed&&("Identifier"===s.type&&s.name===e||"Literal"===s.type&&s.value===e)}var b={AbstractMethodHasImplementation:function(t){return"Method '"+t.methodName+"' cannot have an implementation because it is marked abstract."},AbstractPropertyHasInitializer:function(t){return"Property '"+t.propertyName+"' cannot have an initializer because it is marked abstract."},AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",CannotFindName:function(t){return"Cannot find name '"+t.name+"'."},ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"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:function(t){return"'declare' is not allowed in "+t.kind+"ters."},DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:function(){return"Accessibility modifier already seen."},DuplicateModifier:function(t){return"Duplicate modifier: '"+t.modifier+"'."},EmptyHeritageClauseType:function(t){return"'"+t.token+"' 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'.",IncompatibleModifiers:function(t){var e=t.modifiers;return"'"+e[0]+"' modifier cannot be used with '"+e[1]+"' modifier."},IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:function(t){return"Index signatures cannot have an accessibility modifier ('"+t.modifier+"')."},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.",InvalidModifierOnTypeMember:function(t){return"'"+t.modifier+"' modifier cannot appear on a type member."},InvalidModifierOnTypeParameter:function(t){return"'"+t.modifier+"' modifier cannot appear on a type parameter."},InvalidModifierOnTypeParameterPositions:function(t){return"'"+t.modifier+"' modifier can only appear on a type parameter of a class, interface or type alias."},InvalidModifiersOrder:function(t){var e=t.orderedModifiers;return"'"+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.",MixedLabeledAndUnlabeledElements:"Tuple members must all have names or all not have names.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",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:function(t){return"Private elements cannot have an accessibility modifier ('"+t.modifier+"')."},PrivateMethodsHasAccessibility:function(t){return"Private methods cannot have an accessibility modifier ('"+t.modifier+"')."},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 `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:function(t){var e=t.typeParameterName;return"Single type parameter "+e+" should have a trailing comma. Example usage: <"+e+",>."},StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",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.",GenericsEndWithComma:"Trailing comma is not allowed at the end of generics.",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:function(t){return"Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got "+t.type+"."},LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},g={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:"♦"},A=/^[\da-fA-F]+$/,S=/^\d+$/;function C(t){return t?"JSXIdentifier"===t.type?t.name:"JSXNamespacedName"===t.type?t.namespace.name+":"+t.name.name:"JSXMemberExpression"===t.type?C(t.object)+"."+C(t.property):void 0:t}var E=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function k(t){if(!t)throw new Error("Assert fail")}function I(t){return"accessor"===t}function N(t){return"in"===t||"out"===t}function w(t,e){return 2|(t?4:0)|(e?8:0)}function L(t){if("MemberExpression"!==t.type)return!1;var e=t.property;return(!t.computed||!("TemplateLiteral"!==e.type||e.expressions.length>0))&&M(t.object)}function M(t){return"Identifier"===t.type||"MemberExpression"===t.type&&!t.computed&&M(t.object)}function O(t){return"private"===t||"public"===t||"protected"===t}function D(e){var s=e||{},i=s.dts,r=void 0!==i&&i,n=s.allowSatisfies,h=void 0!==n&&n;return function(s){var i=s.acorn||t,n=m(i),p=i.tokTypes,l=i.keywordTypes,u=i.isIdentifierStart,d=i.lineBreak,y=i.isNewLine,M=i.tokContexts,D=i.isIdentifierChar,_=n.tokTypes,R=n.tokContexts,j=n.keywordsRegExp,F=n.tokenIsLiteralPropertyName,B=n.tokenIsTemplate,H=n.tokenIsTSDeclarationStart,q=n.tokenIsIdentifier,U=n.tokenIsKeywordOrIdentifier,V=n.tokenIsTSTypeOperator;function K(t,e,s){void 0===s&&(s=t.length);for(var i=e;i<s;i++){var r=t.charCodeAt(i);if(y(r))return i<s-1&&13===r&&10===t.charCodeAt(i+1)?i+2:i+1}return-1}s=function(t,e,s){var i=s.tokTypes,r=e.tokTypes;/*#__PURE__*/return function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var s=e.prototype;return s.takeDecorators=function(t){var e=this.decoratorStack[this.decoratorStack.length-1];e.length&&(t.decorators=e,this.resetStartLocationFromNode(t,e[0]),this.decoratorStack[this.decoratorStack.length-1]=[])},s.parseDecorators=function(t){for(var e=this.decoratorStack[this.decoratorStack.length-1];this.match(r.at);){var s=this.parseDecorator();e.push(s)}this.match(i._export)?t||this.unexpected():this.canHaveLeadingDecorator()||this.raise(this.start,"Leading decorators must be attached to a class declaration.")},s.parseDecorator=function(){var t=this.startNode();this.next(),this.decoratorStack.push([]);var e,s=this.start,r=this.startLoc;if(this.match(i.parenL)){var a=this.start,n=this.startLoc;if(this.next(),e=this.parseExpression(),this.expect(i.parenR),this.options.preserveParens){var o=this.startNodeAt(a,n);o.expression=e,e=this.finishNode(o,"ParenthesizedExpression")}}else for(e=this.parseIdent(!1);this.eat(i.dot);){var h=this.startNodeAt(s,r);h.object=e,h.property=this.parseIdent(!0),h.computed=!1,e=this.finishNode(h,"MemberExpression")}return t.expression=this.parseMaybeDecoratorArguments(e),this.decoratorStack.pop(),this.finishNode(t,"Decorator")},s.parseMaybeDecoratorArguments=function(t){if(this.eat(i.parenL)){var e=this.startNodeAtNode(t);return e.callee=t,e.arguments=this.parseExprList(i.parenR,!1),this.finishNode(e,"CallExpression")}return t},e}(t)}(s,n,i),s=function(t,e,s,i){var r=t.tokTypes,a=e.tokTypes,n=t.isNewLine,h=t.isIdentifierChar,p=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},i||{});/*#__PURE__*/return function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var s=e.prototype;return s.jsx_readToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");var s=this.input.charCodeAt(this.pos);switch(s){case 60:case 123:return this.pos===this.start?60===s&&this.exprAllowed?(++this.pos,this.finishToken(a.jsxTagStart)):this.getTokenFromCode(s):(t+=this.input.slice(e,this.pos),this.finishToken(a.jsxText,t));case 38:t+=this.input.slice(e,this.pos),t+=this.jsx_readEntity(),e=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(62===s?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:n(s)?(t+=this.input.slice(e,this.pos),t+=this.jsx_readNewLine(!0),e=this.pos):++this.pos}}},s.jsx_readNewLine=function(t){var e,s=this.input.charCodeAt(this.pos);return++this.pos,13===s&&10===this.input.charCodeAt(this.pos)?(++this.pos,e=t?"\n":"\r\n"):e=String.fromCharCode(s),this.options.locations&&(++this.curLine,this.lineStart=this.pos),e},s.jsx_readString=function(t){for(var e="",s=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===t)break;38===i?(e+=this.input.slice(s,this.pos),e+=this.jsx_readEntity(),s=this.pos):n(i)?(e+=this.input.slice(s,this.pos),e+=this.jsx_readNewLine(!1),s=this.pos):++this.pos}return e+=this.input.slice(s,this.pos++),this.finishToken(r.string,e)},s.jsx_readEntity=function(){var t,e="",s=0,i=this.input[this.pos];"&"!==i&&this.raise(this.pos,"Entity must start with an ampersand");for(var r=++this.pos;this.pos<this.input.length&&s++<10;){if(";"===(i=this.input[this.pos++])){"#"===e[0]?"x"===e[1]?(e=e.substr(2),A.test(e)&&(t=String.fromCharCode(parseInt(e,16)))):(e=e.substr(1),S.test(e)&&(t=String.fromCharCode(parseInt(e,10)))):t=g[e];break}e+=i}return t||(this.pos=r,"&")},s.jsx_readWord=function(){var t,e=this.pos;do{t=this.input.charCodeAt(++this.pos)}while(h(t)||45===t);return this.finishToken(a.jsxName,this.input.slice(e,this.pos))},s.jsx_parseIdentifier=function(){var t=this.startNode();return this.type===a.jsxName?t.name=this.value:this.type.keyword?t.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(t,"JSXIdentifier")},s.jsx_parseNamespacedName=function(){var t=this.start,e=this.startLoc,s=this.jsx_parseIdentifier();if(!p.allowNamespaces||!this.eat(r.colon))return s;var i=this.startNodeAt(t,e);return i.namespace=s,i.name=this.jsx_parseIdentifier(),this.finishNode(i,"JSXNamespacedName")},s.jsx_parseElementName=function(){if(this.type===a.jsxTagEnd)return"";var t=this.start,e=this.startLoc,s=this.jsx_parseNamespacedName();for(this.type!==r.dot||"JSXNamespacedName"!==s.type||p.allowNamespacedObjects||this.unexpected();this.eat(r.dot);){var i=this.startNodeAt(t,e);i.object=s,i.property=this.jsx_parseIdentifier(),s=this.finishNode(i,"JSXMemberExpression")}return s},s.jsx_parseAttributeValue=function(){switch(this.type){case r.braceL:var t=this.jsx_parseExpressionContainer();return"JSXEmptyExpression"===t.expression.type&&this.raise(t.start,"JSX attributes must only be assigned a non-empty expression"),t;case a.jsxTagStart:case r.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}},s.jsx_parseEmptyExpression=function(){var t=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(t,"JSXEmptyExpression",this.start,this.startLoc)},s.jsx_parseExpressionContainer=function(){var t=this.startNode();return this.next(),t.expression=this.type===r.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(r.braceR),this.finishNode(t,"JSXExpressionContainer")},s.jsx_parseAttribute=function(){var t=this.startNode();return this.eat(r.braceL)?(this.expect(r.ellipsis),t.argument=this.parseMaybeAssign(),this.expect(r.braceR),this.finishNode(t,"JSXSpreadAttribute")):(t.name=this.jsx_parseNamespacedName(),t.value=this.eat(r.eq)?this.jsx_parseAttributeValue():null,this.finishNode(t,"JSXAttribute"))},s.jsx_parseOpeningElementAt=function(t,e){var s=this.startNodeAt(t,e);s.attributes=[];var i=this.jsx_parseElementName();for(i&&(s.name=i);this.type!==r.slash&&this.type!==a.jsxTagEnd;)s.attributes.push(this.jsx_parseAttribute());return s.selfClosing=this.eat(r.slash),this.expect(a.jsxTagEnd),this.finishNode(s,i?"JSXOpeningElement":"JSXOpeningFragment")},s.jsx_parseClosingElementAt=function(t,e){var s=this.startNodeAt(t,e),i=this.jsx_parseElementName();return i&&(s.name=i),this.expect(a.jsxTagEnd),this.finishNode(s,i?"JSXClosingElement":"JSXClosingFragment")},s.jsx_parseElementAt=function(t,e){var s=this.startNodeAt(t,e),i=[],n=this.jsx_parseOpeningElementAt(t,e),o=null;if(!n.selfClosing){t:for(;;)switch(this.type){case a.jsxTagStart:if(t=this.start,e=this.startLoc,this.next(),this.eat(r.slash)){o=this.jsx_parseClosingElementAt(t,e);break t}i.push(this.jsx_parseElementAt(t,e));break;case a.jsxText:i.push(this.parseExprAtom());break;case r.braceL:i.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}C(o.name)!==C(n.name)&&this.raise(o.start,"Expected corresponding JSX closing tag for <"+C(n.name)+">")}var h=n.name?"Element":"Fragment";return s["opening"+h]=n,s["closing"+h]=o,s.children=i,this.type===r.relational&&"<"===this.value&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(s,"JSX"+h)},s.jsx_parseText=function(){var t=this.parseLiteral(this.value);return t.type="JSXText",t},s.jsx_parseElement=function(){var t=this.start,e=this.startLoc;return this.next(),this.jsx_parseElementAt(t,e)},e}(s)}(i,n,s,null==e?void 0:e.jsx),s=function(t,e,s){var i=e.tokTypes,r=s.tokTypes;/*#__PURE__*/return function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var s=e.prototype;return s.parseMaybeImportAttributes=function(t){if(this.type===r._with||this.type===i.assert){this.next();var e=this.parseImportAttributes();e&&(t.attributes=e)}},s.parseImportAttributes=function(){this.expect(r.braceL);var t=this.parseWithEntries();return this.expect(r.braceR),t},s.parseWithEntries=function(){var t=[],e=new Set;do{if(this.type===r.braceR)break;var s,i=this.startNode();s=this.type===r.string?this.parseLiteral(this.value):this.parseIdent(!0),this.next(),i.key=s,e.has(i.key.name)&&this.raise(this.pos,"Duplicated key in attributes"),e.add(i.key.name),this.type!==r.string&&this.raise(this.pos,"Only string is supported as an attribute value"),i.value=this.parseLiteral(this.value),t.push(this.finishNode(i,"ImportAttribute"))}while(this.eat(r.comma));return t},e}(t)}(s,n,i);var z=/*#__PURE__*/function(t){function e(e,s,i){var r;return(r=t.call(this,e,s,i)||this).preValue=null,r.preToken=null,r.isLookahead=!1,r.isAmbientContext=!1,r.inAbstractClass=!1,r.inType=!1,r.inDisallowConditionalTypesContext=!1,r.maybeInArrowParameters=!1,r.shouldParseArrowReturnType=void 0,r.shouldParseAsyncArrowReturnType=void 0,r.decoratorStack=[[]],r.importsStack=[[]],r.importOrExportOuterKind=void 0,r.tsParseConstModifier=r.tsParseModifiers.bind(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(r),{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:b.InvalidModifierOnTypeParameterPositions}),r}o(e,t);var s,m,g,A=e.prototype;return A.getTokenFromCodeInType=function(e){return 62===e||60===e?this.finishOp(p.relational,1):t.prototype.getTokenFromCode.call(this,e)},A.readToken=function(e){if(!this.inType){var s=this.curContext();if(s===R.tc_expr)return this.jsx_readToken();if(s===R.tc_oTag||s===R.tc_cTag){if(u(e))return this.jsx_readWord();if(62==e)return++this.pos,this.finishToken(_.jsxTagEnd);if((34===e||39===e)&&s==R.tc_oTag)return this.jsx_readString(e)}if(60===e&&this.exprAllowed&&33!==this.input.charCodeAt(this.pos+1))return++this.pos,this.finishToken(_.jsxTagStart)}return t.prototype.readToken.call(this,e)},A.getTokenFromCode=function(e){return this.inType?this.getTokenFromCodeInType(e):64===e?(++this.pos,this.finishToken(_.at)):t.prototype.getTokenFromCode.call(this,e)},A.isAbstractClass=function(){return this.ts_isContextual(_.abstract)&&this.lookahead().type===p._class},A.finishNode=function(e,s){return""!==e.type&&0!==e.end?e:t.prototype.finishNode.call(this,e,s)},A.tryParse=function(t,e){void 0===e&&(e=this.cloneCurLookaheadState());var s={node:null};try{return{node:t(function(t){throw void 0===t&&(t=null),s.node=t,s}),error:null,thrown:!1,aborted:!1,failState:null}}catch(t){var i=this.getCurLookaheadState();if(this.setLookaheadState(e),t instanceof SyntaxError)return{node:null,error:t,thrown:!0,aborted:!1,failState:i};if(t===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:i};throw t}},A.setOptionalParametersError=function(t,e){var s;t.optionalParametersLoc=null!=(s=null==e?void 0:e.loc)?s:this.startLoc},A.reScan_lt_gt=function(){this.type===p.relational&&(this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos()))},A.reScan_lt=function(){var t=this.type;return t===p.bitShift?(this.pos-=2,this.finishOp(p.relational,1),p.relational):t},A.resetEndLocation=function(t,e){void 0===e&&(e=this.lastTokEndLoc),t.end=e.column,t.loc.end=e,this.options.ranges&&(t.range[1]=e.column)},A.startNodeAtNode=function(e){return t.prototype.startNodeAt.call(this,e.start,e.loc.start)},A.nextTokenStart=function(){return this.nextTokenStartSince(this.pos)},A.tsHasSomeModifiers=function(t,e){return e.some(function(e){return O(e)?t.accessibility===e:!!t[e]})},A.tsIsStartOfStaticBlocks=function(){return this.isContextual("static")&&123===this.lookaheadCharCode()},A.tsCheckForInvalidTypeCasts=function(t){var e=this;t.forEach(function(t){"TSTypeCastExpression"===(null==t?void 0:t.type)&&e.raise(t.typeAnnotation.start,b.UnexpectedTypeAnnotation)})},A.atPossibleAsyncArrow=function(t){return"Identifier"===t.type&&"async"===t.name&&this.lastTokEndLoc.column===t.end&&!this.canInsertSemicolon()&&t.end-t.start==5&&t.start===this.potentialArrowAt},A.tsIsIdentifier=function(){return q(this.type)},A.tsTryParseTypeOrTypePredicateAnnotation=function(){return this.match(p.colon)?this.tsParseTypeOrTypePredicateAnnotation(p.colon):void 0},A.tsTryParseGenericAsyncArrowFunction=function(e,s,i){var r=this;if(this.tsMatchLeftRelational()){var a=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;var n=this.tsTryParseAndCatch(function(){var i=r.startNodeAt(e,s);return i.typeParameters=r.tsParseTypeParameters(),t.prototype.parseFunctionParams.call(r,i),i.returnType=r.tsTryParseTypeOrTypePredicateAnnotation(),r.expect(p.arrow),i});if(this.maybeInArrowParameters=a,n)return t.prototype.parseArrowExpression.call(this,n,null,!0,i)}},A.tsParseTypeArgumentsInExpression=function(){if(this.reScan_lt()===p.relational)return this.tsParseTypeArguments()},A.tsInNoContext=function(t){var e=this.context;this.context=[e[0]];try{return t()}finally{this.context=e}},A.tsTryParseTypeAnnotation=function(){return this.match(p.colon)?this.tsParseTypeAnnotation():void 0},A.isUnparsedContextual=function(t,e){var s=t+e.length;if(this.input.slice(t,s)===e){var i=this.input.charCodeAt(s);return!(D(i)||55296==(64512&i))}return!1},A.isAbstractConstructorSignature=function(){return this.ts_isContextual(_.abstract)&&this.lookahead().type===p._new},A.nextTokenStartSince=function(t){return E.lastIndex=t,E.test(this.input)?E.lastIndex:t},A.lookaheadCharCode=function(){return this.input.charCodeAt(this.nextTokenStart())},A.compareLookaheadState=function(t,e){for(var s=0,i=Object.keys(t);s<i.length;s++){var r=i[s];if(t[r]!==e[r])return!1}return!0},A.createLookaheadState=function(){this.value=null,this.context=[this.curContext()]},A.getCurLookaheadState=function(){return{endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,pos:this.pos,value:this.value,type:this.type,start:this.start,end:this.end,context:this.context,startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,curPosition:this.curPosition,containsEsc:this.containsEsc}},A.cloneCurLookaheadState=function(){return{pos:this.pos,value:this.value,type:this.type,start:this.start,end:this.end,context:this.context&&this.context.slice(),startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,curLine:this.curLine,lineStart:this.lineStart,curPosition:this.curPosition,containsEsc:this.containsEsc}},A.setLookaheadState=function(t){this.pos=t.pos,this.value=t.value,this.endLoc=t.endLoc,this.lastTokEnd=t.lastTokEnd,this.lastTokStart=t.lastTokStart,this.lastTokStartLoc=t.lastTokStartLoc,this.type=t.type,this.start=t.start,this.end=t.end,this.context=t.context,this.startLoc=t.startLoc,this.lastTokEndLoc=t.lastTokEndLoc,this.curLine=t.curLine,this.lineStart=t.lineStart,this.curPosition=t.curPosition,this.containsEsc=t.containsEsc},A.tsLookAhead=function(t){var e=this.getCurLookaheadState(),s=t();return this.setLookaheadState(e),s},A.lookahead=function(t){var e=this.getCurLookaheadState();if(this.createLookaheadState(),this.isLookahead=!0,void 0!==t)for(var s=0;s<t;s++)this.nextToken();else this.nextToken();this.isLookahead=!1;var i=this.getCurLookaheadState();return this.setLookaheadState(e),i},A.readWord=function(){var t=this.readWord1(),e=p.name;return this.keywords.test(t)?e=l[t]:new RegExp(j).test(t)&&(e=_[t]),this.finishToken(e,t)},A.skipBlockComment=function(){var t;this.isLookahead||(t=this.options.onComment&&this.curPosition());var e=this.pos,s=this.input.indexOf("*/",this.pos+=2);if(-1===s&&this.raise(this.pos-2,"Unterminated comment"),this.pos=s+2,this.options.locations)for(var i,r=e;(i=K(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=i;this.isLookahead||this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,s),e,this.pos,t,this.curPosition())},A.skipLineComment=function(t){var e,s=this.pos;this.isLookahead||(e=this.options.onComment&&this.curPosition());for(var i=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&!y(i);)i=this.input.charCodeAt(++this.pos);this.isLookahead||this.options.onComment&&this.options.onComment(!1,this.input.slice(s+t,this.pos),s,this.pos,e,this.curPosition())},A.finishToken=function(t,e){this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var s=this.type;this.type=t,this.value=e,this.isLookahead||this.updateContext(s)},A.resetStartLocation=function(t,e,s){t.start=e,t.loc.start=s,this.options.ranges&&(t.range[0]=e)},A.isLineTerminator=function(){return this.eat(p.semi)||t.prototype.canInsertSemicolon.call(this)},A.hasFollowingLineBreak=function(){return x.lastIndex=this.end,x.test(this.input)},A.addExtra=function(t,e,s,i){if(void 0===i&&(i=!0),t){var r=t.extra=t.extra||{};i?r[e]=s:Object.defineProperty(r,e,{enumerable:i,value:s})}},A.isLiteralPropertyName=function(){return F(this.type)},A.hasPrecedingLineBreak=function(){return d.test(this.input.slice(this.lastTokEndLoc.index,this.start))},A.createIdentifier=function(t,e){return t.name=e,this.finishNode(t,"Identifier")},A.resetStartLocationFromNode=function(t,e){this.resetStartLocation(t,e.start,e.loc.start)},A.isThisParam=function(t){return"Identifier"===t.type&&"this"===t.name},A.isLookaheadContextual=function(t){var e=this.nextTokenStart();return this.isUnparsedContextual(e,t)},A.ts_type_isContextual=function(t,e){return t===e&&!this.containsEsc},A.ts_isContextual=function(t){return this.type===t&&!this.containsEsc},A.ts_isContextualWithState=function(t,e){return t.type===e&&!t.containsEsc},A.isContextualWithState=function(t,e){return e.type===p.name&&e.value===t&&!e.containsEsc},A.tsIsStartOfMappedType=function(){return this.next(),this.eat(p.plusMin)?this.ts_isContextual(_.readonly):(this.ts_isContextual(_.readonly)&&this.next(),!!this.match(p.bracketL)&&(this.next(),!!this.tsIsIdentifier()&&(this.next(),this.match(p._in))))},A.tsInDisallowConditionalTypesContext=function(t){var e=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return t()}finally{this.inDisallowConditionalTypesContext=e}},A.tsTryParseType=function(){return this.tsEatThenParseType(p.colon)},A.match=function(t){return this.type===t},A.matchJsx=function(t){return this.type===n.tokTypes[t]},A.ts_eatWithState=function(t,e,s){if(t===s.type){for(var i=0;i<e;i++)this.next();return!0}return!1},A.ts_eatContextualWithState=function(t,e,s){if(j.test(t)){if(this.ts_isContextualWithState(s,_[t])){for(var i=0;i<e;i++)this.next();return!0}return!1}if(!this.isContextualWithState(t,s))return!1;for(var r=0;r<e;r++)this.next();return!0},A.canHaveLeadingDecorator=function(){return this.match(p._class)},A.eatContextual=function(e){return j.test(e)?!!this.ts_isContextual(_[e])&&(this.next(),!0):t.prototype.eatContextual.call(this,e)},A.tsIsExternalModuleReference=function(){return this.isContextual("require")&&40===this.lookaheadCharCode()},A.tsParseExternalModuleReference=function(){var t=this.startNode();return this.expectContextual("require"),this.expect(p.parenL),this.match(p.string)||this.unexpected(),t.expression=this.parseExprAtom(),this.expect(p.parenR),this.finishNode(t,"TSExternalModuleReference")},A.tsParseEntityName=function(t){void 0===t&&(t=!0);for(var e=this.parseIdent(t);this.eat(p.dot);){var s=this.startNodeAtNode(e);s.left=e,s.right=this.parseIdent(t),e=this.finishNode(s,"TSQualifiedName")}return e},A.tsParseEnumMember=function(){var t=this.startNode();return t.id=this.match(p.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(p.eq)&&(t.initializer=this.parseMaybeAssign()),this.finishNode(t,"TSEnumMember")},A.tsParseEnumDeclaration=function(t,e){return void 0===e&&(e={}),e.const&&(t.const=!0),e.declare&&(t.declare=!0),this.expectContextual("enum"),t.id=this.parseIdent(),this.checkLValSimple(t.id),this.expect(p.braceL),t.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(p.braceR),this.finishNode(t,"TSEnumDeclaration")},A.tsParseModuleBlock=function(){var e=this.startNode();for(t.prototype.enterScope.call(this,512),this.expect(p.braceL),e.body=[];this.type!==p.braceR;){var s=this.parseStatement(null,!0);e.body.push(s)}return this.next(),t.prototype.exitScope.call(this),this.finishNode(e,"TSModuleBlock")},A.tsParseAmbientExternalModuleDeclaration=function(e){return this.ts_isContextual(_.global)?(e.global=!0,e.id=this.parseIdent()):this.match(p.string)?e.id=this.parseLiteral(this.value):this.unexpected(),this.match(p.braceL)?(t.prototype.enterScope.call(this,f),e.body=this.tsParseModuleBlock(),t.prototype.exitScope.call(this)):t.prototype.semicolon.call(this),this.finishNode(e,"TSModuleDeclaration")},A.tsTryParseDeclare=function(t){var e=this;if(!this.isLineTerminator()){var s,i=this.type;return this.isContextual("let")&&(i=p._var,s="let"),this.tsInAmbientContext(function(){if(i===p._function)return t.declare=!0,e.parseFunctionStatement(t,!1,!0);if(i===p._class)return t.declare=!0,e.parseClass(t,!0);if(i===_.enum)return e.tsParseEnumDeclaration(t,{declare:!0});if(i===_.global)return e.tsParseAmbientExternalModuleDeclaration(t);if(i===p._const||i===p._var)return e.match(p._const)&&e.isLookaheadContextual("enum")?(e.expect(p._const),e.tsParseEnumDeclaration(t,{const:!0,declare:!0})):(t.declare=!0,e.parseVarStatement(t,s||e.value,!0));if(i===_.interface){var r=e.tsParseInterfaceDeclaration(t,{declare:!0});if(r)return r}return q(i)?e.tsParseDeclaration(t,e.value,!0):void 0})}},A.tsIsListTerminator=function(t){switch(t){case"EnumMembers":case"TypeMembers":return this.match(p.braceR);case"HeritageClauseElement":return this.match(p.braceL);case"TupleElementTypes":return this.match(p.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}},A.tsParseDelimitedListWorker=function(t,e,s,i){for(var r=[],a=-1;!this.tsIsListTerminator(t);){a=-1;var n=e();if(null==n)return;if(r.push(n),!this.eat(p.comma)){if(this.tsIsListTerminator(t))break;return void(s&&this.expect(p.comma))}a=this.lastTokStart}return i&&(i.value=a),r},A.tsParseDelimitedList=function(t,e,s){return function(t){if(null==t)throw new Error("Unexpected "+t+" value.");return t}(this.tsParseDelimitedListWorker(t,e,!0,s))},A.tsParseBracketedList=function(t,e,s,i,r){i||this.expect(s?p.bracketL:p.relational);var a=this.tsParseDelimitedList(t,e,r);return this.expect(s?p.bracketR:p.relational),a},A.tsParseTypeParameterName=function(){return this.parseIdent().name},A.tsEatThenParseType=function(t){return this.match(t)?this.tsNextThenParseType():void 0},A.tsExpectThenParseType=function(t){var e=this;return this.tsDoThenParseType(function(){return e.expect(t)})},A.tsNextThenParseType=function(){var t=this;return this.tsDoThenParseType(function(){return t.next()})},A.tsDoThenParseType=function(t){var e=this;return this.tsInType(function(){return t(),e.tsParseType()})},A.tsSkipParameterStart=function(){if(q(this.type)||this.match(p._this))return this.next(),!0;if(this.match(p.braceL))try{return this.parseObj(!0),!0}catch(t){return!1}if(this.match(p.bracketL)){this.next();try{return this.parseBindingList(p.bracketR,!0,!0),!0}catch(t){return!1}}return!1},A.tsIsUnambiguouslyStartOfFunctionType=function(){if(this.next(),this.match(p.parenR)||this.match(p.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(p.colon)||this.match(p.comma)||this.match(p.question)||this.match(p.eq))return!0;if(this.match(p.parenR)&&(this.next(),this.match(p.arrow)))return!0}return!1},A.tsIsStartOfFunctionType=function(){return!!this.tsMatchLeftRelational()||this.match(p.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))},A.tsInAllowConditionalTypesContext=function(t){var e=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return t()}finally{this.inDisallowConditionalTypesContext=e}},A.tsParseBindingListForSignature=function(){var e=this;return t.prototype.parseBindingList.call(this,p.parenR,!0,!0).map(function(t){return"Identifier"!==t.type&&"RestElement"!==t.type&&"ObjectPattern"!==t.type&&"ArrayPattern"!==t.type&&e.raise(t.start,b.UnsupportedSignatureParameterKind(t.type)),t})},A.tsParseTypePredicateAsserts=function(){if(this.type!==_.asserts)return!1;var t=this.containsEsc;return this.next(),!(!q(this.type)&&!this.match(p._this)||(t&&this.raise(this.lastTokStart,"Escape sequence in keyword asserts"),0))},A.tsParseThisTypeNode=function(){var t=this.startNode();return this.next(),this.finishNode(t,"TSThisType")},A.tsParseTypeAnnotation=function(t,e){var s=this;return void 0===t&&(t=!0),void 0===e&&(e=this.startNode()),this.tsInType(function(){t&&s.expect(p.colon),e.typeAnnotation=s.tsParseType()}),this.finishNode(e,"TSTypeAnnotation")},A.tsParseThisTypePredicate=function(t){this.next();var e=this.startNodeAtNode(t);return e.parameterName=t,e.typeAnnotation=this.tsParseTypeAnnotation(!1),e.asserts=!1,this.finishNode(e,"TSTypePredicate")},A.tsParseThisTypeOrThisTypePredicate=function(){var t=this.tsParseThisTypeNode();return this.isContextual("is")&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(t):t},A.tsParseTypePredicatePrefix=function(){var t=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),t},A.tsParseTypeOrTypePredicateAnnotation=function(t){var e=this;return this.tsInType(function(){var s=e.startNode();e.expect(t);var i=e.startNode(),r=!!e.tsTryParse(e.tsParseTypePredicateAsserts.bind(e));if(r&&e.match(p._this)){var a=e.tsParseThisTypeOrThisTypePredicate();return"TSThisType"===a.type?(i.parameterName=a,i.asserts=!0,i.typeAnnotation=null,a=e.finishNode(i,"TSTypePredicate")):(e.resetStartLocationFromNode(a,i),a.asserts=!0),s.typeAnnotation=a,e.finishNode(s,"TSTypeAnnotation")}var n=e.tsIsIdentifier()&&e.tsTryParse(e.tsParseTypePredicatePrefix.bind(e));if(!n)return r?(i.parameterName=e.parseIdent(),i.asserts=r,i.typeAnnotation=null,s.typeAnnotation=e.finishNode(i,"TSTypePredicate"),e.finishNode(s,"TSTypeAnnotation")):e.tsParseTypeAnnotation(!1,s);var o=e.tsParseTypeAnnotation(!1);return i.parameterName=n,i.typeAnnotation=o,i.asserts=r,s.typeAnnotation=e.finishNode(i,"TSTypePredicate"),e.finishNode(s,"TSTypeAnnotation")})},A.tsFillSignature=function(t,e){var s=t===p.arrow;e.typeParameters=this.tsTryParseTypeParameters(),this.expect(p.parenL),e.parameters=this.tsParseBindingListForSignature(),(s||this.match(t))&&(e.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(t))},A.tsTryNextParseConstantContext=function(){if(this.lookahead().type!==p._const)return null;this.next();var t=this.tsParseTypeReference();return t.typeParameters&&this.raise(t.typeName.start,b.CannotFindName({name:"const"})),t},A.tsParseFunctionOrConstructorType=function(t,e){var s=this,i=this.startNode();return"TSConstructorType"===t&&(i.abstract=!!e,e&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(function(){return s.tsFillSignature(p.arrow,i)}),this.finishNode(i,t)},A.tsParseUnionOrIntersectionType=function(t,e,s){var i=this.startNode(),r=this.eat(s),a=[];do{a.push(e())}while(this.eat(s));return 1!==a.length||r?(i.types=a,this.finishNode(i,t)):a[0]},A.tsCheckTypeAnnotationForReadOnly=function(t){switch(t.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(t.start,b.UnexpectedReadonly)}},A.tsParseTypeOperator=function(){var t=this.startNode(),e=this.value;return this.next(),t.operator=e,t.typeAnnotation=this.tsParseTypeOperatorOrHigher(),"readonly"===e&&this.tsCheckTypeAnnotationForReadOnly(t),this.finishNode(t,"TSTypeOperator")},A.tsParseConstraintForInferType=function(){var t=this;if(this.eat(p._extends)){var e=this.tsInDisallowConditionalTypesContext(function(){return t.tsParseType()});if(this.inDisallowConditionalTypesContext||!this.match(p.question))return e}},A.tsParseInferType=function(){var t=this,e=this.startNode();this.expectContextual("infer");var s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(function(){return t.tsParseConstraintForInferType()}),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")},A.tsParseLiteralTypeNode=function(){var t=this,e=this.startNode();return e.literal=function(){switch(t.type){case p.num:case p.string:case p._true:case p._false:return t.parseExprAtom();default:t.unexpected()}}(),this.finishNode(e,"TSLiteralType")},A.tsParseImportType=function(){var t=this.startNode();return this.expect(p._import),this.expect(p.parenL),this.match(p.string)||this.raise(this.start,b.UnsupportedImportTypeArgument),t.argument=this.parseExprAtom(),this.expect(p.parenR),this.eat(p.dot)&&(t.qualifier=this.tsParseEntityName()),this.tsMatchLeftRelational()&&(t.typeParameters=this.tsParseTypeArguments()),this.finishNode(t,"TSImportType")},A.tsParseTypeQuery=function(){var t=this.startNode();return this.expect(p._typeof),t.exprName=this.match(p._import)?this.tsParseImportType():this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational()&&(t.typeParameters=this.tsParseTypeArguments()),this.finishNode(t,"TSTypeQuery")},A.tsParseMappedTypeParameter=function(){var t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsExpectThenParseType(p._in),this.finishNode(t,"TSTypeParameter")},A.tsParseMappedType=function(){var t=this.startNode();return this.expect(p.braceL),this.match(p.plusMin)?(t.readonly=this.value,this.next(),this.expectContextual("readonly")):this.eatContextual("readonly")&&(t.readonly=!0),this.expect(p.bracketL),t.typeParameter=this.tsParseMappedTypeParameter(),t.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(p.bracketR),this.match(p.plusMin)?(t.optional=this.value,this.next(),this.expect(p.question)):this.eat(p.question)&&(t.optional=!0),t.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(p.braceR),this.finishNode(t,"TSMappedType")},A.tsParseTypeLiteral=function(){var t=this.startNode();return t.members=this.tsParseObjectTypeMembers(),this.finishNode(t,"TSTypeLiteral")},A.tsParseTupleElementType=function(){var t=this.startLoc,e=this.start,s=this.eat(p.ellipsis),i=this.tsParseType(),r=this.eat(p.question);if(this.eat(p.colon)){var a=this.startNodeAtNode(i);a.optional=r,"TSTypeReference"!==i.type||i.typeParameters||"Identifier"!==i.typeName.type?(this.raise(i.start,b.InvalidTupleMemberLabel),a.label=i):a.label=i.typeName,a.elementType=this.tsParseType(),i=this.finishNode(a,"TSNamedTupleMember")}else if(r){var n=this.startNodeAtNode(i);n.typeAnnotation=i,i=this.finishNode(n,"TSOptionalType")}if(s){var o=this.startNodeAt(e,t);o.typeAnnotation=i,i=this.finishNode(o,"TSRestType")}return i},A.tsParseTupleType=function(){var t=this,e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);var s=!1,i=null;return e.elementTypes.forEach(function(e){var r=e.type;!s||"TSRestType"===r||"TSOptionalType"===r||"TSNamedTupleMember"===r&&e.optional||t.raise(e.start,b.OptionalTypeBeforeRequired),s||(s="TSNamedTupleMember"===r&&e.optional||"TSOptionalType"===r);var a=r;"TSRestType"===r&&(a=(e=e.typeAnnotation).type);var n="TSNamedTupleMember"===a;null!=i||(i=n),i!==n&&t.raise(e.start,b.MixedLabeledAndUnlabeledElements)}),this.finishNode(e,"TSTupleType")},A.tsParseTemplateLiteralType=function(){var t=this.startNode();return t.literal=this.parseTemplate({isTagged:!1}),this.finishNode(t,"TSLiteralType")},A.tsParseTypeReference=function(){var t=this.startNode();return t.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational()&&(t.typeParameters=this.tsParseTypeArguments()),this.finishNode(t,"TSTypeReference")},A.tsMatchLeftRelational=function(){return this.match(p.relational)&&"<"===this.value},A.tsMatchRightRelational=function(){return this.match(p.relational)&&">"===this.value},A.tsParseParenthesizedType=function(){var t=this.startNode();return this.expect(p.parenL),t.typeAnnotation=this.tsParseType(),this.expect(p.parenR),this.finishNode(t,"TSParenthesizedType")},A.tsParseNonArrayType=function(){switch(this.type){case p.string:case p.num:case p._true:case p._false:return this.tsParseLiteralTypeNode();case p.plusMin:if("-"===this.value){var t=this.startNode();return this.lookahead().type!==p.num&&this.unexpected(),t.literal=this.parseMaybeUnary(),this.finishNode(t,"TSLiteralType")}break;case p._this:return this.tsParseThisTypeOrThisTypePredicate();case p._typeof:return this.tsParseTypeQuery();case p._import:return this.tsParseImportType();case p.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case p.bracketL:return this.tsParseTupleType();case p.parenL:return this.tsParseParenthesizedType();case p.backQuote:case p.dollarBraceL:return this.tsParseTemplateLiteralType();default:var e=this.type;if(q(e)||e===p._void||e===p._null){var s=e===p._void?"TSVoidKeyword":e===p._null?"TSNullKeyword":function(t){switch(t){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}}(this.value);if(void 0!==s&&46!==this.lookaheadCharCode()){var i=this.startNode();return this.next(),this.finishNode(i,s)}return this.tsParseTypeReference()}}this.unexpected()},A.tsParseArrayTypeOrHigher=function(){for(var t=this.tsParseNonArrayType();!this.hasPrecedingLineBreak()&&this.eat(p.bracketL);)if(this.match(p.bracketR)){var e=this.startNodeAtNode(t);e.elementType=t,this.expect(p.bracketR),t=this.finishNode(e,"TSArrayType")}else{var s=this.startNodeAtNode(t);s.objectType=t,s.indexType=this.tsParseType(),this.expect(p.bracketR),t=this.finishNode(s,"TSIndexedAccessType")}return t},A.tsParseTypeOperatorOrHigher=function(){var t=this;return V(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(function(){return t.tsParseArrayTypeOrHigher()})},A.tsParseIntersectionTypeOrHigher=function(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),p.bitwiseAND)},A.tsParseUnionTypeOrHigher=function(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),p.bitwiseOR)},A.tsParseNonConditionalType=function(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(p._new)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()},A.tsParseType=function(){var t=this;k(this.inType);var e=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(p._extends))return e;var s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(function(){return t.tsParseNonConditionalType()}),this.expect(p.question),s.trueType=this.tsInAllowConditionalTypesContext(function(){return t.tsParseType()}),this.expect(p.colon),s.falseType=this.tsInAllowConditionalTypesContext(function(){return t.tsParseType()}),this.finishNode(s,"TSConditionalType")},A.tsIsUnambiguouslyIndexSignature=function(){return this.next(),!!q(this.type)&&(this.next(),this.match(p.colon))},A.tsInType=function(t){var e=this.inType;this.inType=!0;try{return t()}finally{this.inType=e}},A.tsTryParseIndexSignature=function(t){if(this.match(p.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))){this.expect(p.bracketL);var e=this.parseIdent();e.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(e),this.expect(p.bracketR),t.parameters=[e];var s=this.tsTryParseTypeAnnotation();return s&&(t.typeAnnotation=s),this.tsParseTypeMemberSemicolon(),this.finishNode(t,"TSIndexSignature")}},A.tsParseNoneModifiers=function(t){this.tsParseModifiers({modified:t,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:b.InvalidModifierOnTypeParameterPositions})},A.tsParseTypeParameter=function(t){void 0===t&&(t=this.tsParseNoneModifiers.bind(this));var e=this.startNode();return t(e),e.name=this.tsParseTypeParameterName(),e.constraint=this.tsEatThenParseType(p._extends),e.default=this.tsEatThenParseType(p.eq),this.finishNode(e,"TSTypeParameter")},A.tsParseTypeParameters=function(t){var e=this.startNode();this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart")?this.next():this.unexpected();var s={value:-1};return e.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,t),!1,!0,s),0===e.params.length&&this.raise(this.start,b.EmptyTypeParameters),-1!==s.value&&this.addExtra(e,"trailingComma",s.value),this.finishNode(e,"TSTypeParameterDeclaration")},A.tsTryParseTypeParameters=function(t){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(t)},A.tsTryParse=function(t){var e=this.getCurLookaheadState(),s=t();return void 0!==s&&!1!==s?s:void this.setLookaheadState(e)},A.tsTokenCanFollowModifier=function(){return(this.match(p.bracketL)||this.match(p.braceL)||this.match(p.star)||this.match(p.ellipsis)||this.match(p.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()},A.tsNextTokenCanFollowModifier=function(){return this.next(!0),this.tsTokenCanFollowModifier()},A.tsParseModifier=function(t,e){if(q(this.type)||this.type===p._in){var s=this.value;if(-1!==t.indexOf(s)&&!this.containsEsc){if(e&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return s}}},A.tsParseModifiersByMap=function(t){for(var e=t.modified,s=t.map,i=0,r=Object.keys(s);i<r.length;i++){var a=r[i];e[a]=s[a]}},A.tsParseModifiers=function(t){for(var e=this,s=t.modified,i=t.allowedModifiers,r=t.disallowedModifiers,a=t.stopOnStartOfClassStaticBlock,n=t.errorTemplate,o=void 0===n?b.InvalidModifierOnTypeMember:n,h={},p=function(t,i,r,a){i===r&&s[a]&&e.raise(t.column,b.InvalidModifiersOrder({orderedModifiers:[r,a]}))},c=function(t,i,r,a){(s[r]&&i===a||s[a]&&i===r)&&e.raise(t.column,b.IncompatibleModifiers({modifiers:[r,a]}))};;){var l=this.startLoc,u=this.tsParseModifier(i.concat(null!=r?r:[]),a);if(!u)break;O(u)?s.accessibility?this.raise(this.start,b.DuplicateAccessibilityModifier()):(p(l,u,u,"override"),p(l,u,u,"static"),p(l,u,u,"readonly"),p(l,u,u,"accessor"),h.accessibility=u,s.accessibility=u):N(u)?s[u]?this.raise(this.start,b.DuplicateModifier({modifier:u})):(p(l,u,"in","out"),h[u]=u,s[u]=!0):I(u)?s[u]?this.raise(this.start,b.DuplicateModifier({modifier:u})):(c(l,u,"accessor","readonly"),c(l,u,"accessor","static"),c(l,u,"accessor","override"),h[u]=u,s[u]=!0):Object.hasOwnProperty.call(s,u)?this.raise(this.start,b.DuplicateModifier({modifier:u})):(p(l,u,"static","readonly"),p(l,u,"static","override"),p(l,u,"override","readonly"),p(l,u,"abstract","override"),c(l,u,"declare","override"),c(l,u,"static","abstract"),h[u]=u,s[u]=!0),null!=r&&r.includes(u)&&this.raise(this.start,o)}return h},A.tsParseInOutModifiers=function(t){this.tsParseModifiers({modified:t,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:b.InvalidModifierOnTypeParameter})},A.tsParseTypeArguments=function(){var t=this,e=this.startNode();return e.params=this.tsInType(function(){return t.tsInNoContext(function(){return t.expect(p.relational),t.tsParseDelimitedList("TypeParametersOrArguments",t.tsParseType.bind(t))})}),0===e.params.length&&this.raise(this.start,b.EmptyTypeArguments),this.exprAllowed=!1,this.expect(p.relational),this.finishNode(e,"TSTypeParameterInstantiation")},A.tsParseHeritageClause=function(t){var e=this,s=this.start,i=this.tsParseDelimitedList("HeritageClauseElement",function(){var t=e.startNode();return t.expression=e.tsParseEntityName(),e.tsMatchLeftRelational()&&(t.typeParameters=e.tsParseTypeArguments()),e.finishNode(t,"TSExpressionWithTypeArguments")});return i.length||this.raise(s,b.EmptyHeritageClauseType({token:t})),i},A.tsParseTypeMemberSemicolon=function(){this.eat(p.comma)||this.isLineTerminator()||this.expect(p.semi)},A.tsTryParseAndCatch=function(t){var e=this.tryParse(function(e){return t()||e()});if(!e.aborted&&e.node)return e.error&&this.setLookaheadState(e.failState),e.node},A.tsParseSignatureMember=function(t,e){return this.tsFillSignature(p.colon,e),this.tsParseTypeMemberSemicolon(),this.finishNode(e,t)},A.tsParsePropertyOrMethodSignature=function(t,e){this.eat(p.question)&&(t.optional=!0);var s=t;if(this.match(p.parenL)||this.tsMatchLeftRelational()){e&&this.raise(t.start,b.ReadonlyForMethodSignature);var i=s;i.kind&&this.tsMatchLeftRelational()&&this.raise(this.start,b.AccesorCannotHaveTypeParameters),this.tsFillSignature(p.colon,i),this.tsParseTypeMemberSemicolon();var r="parameters",a="typeAnnotation";if("get"===i.kind)i[r].length>0&&(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(i[r][0])&&this.raise(this.start,b.AccesorCannotDeclareThisParameter));else if("set"===i.kind){if(1!==i[r].length)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{var n=i[r][0];this.isThisParam(n)&&this.raise(this.start,b.AccesorCannotDeclareThisParameter),"Identifier"===n.type&&n.optional&&this.raise(this.start,b.SetAccesorCannotHaveOptionalParameter),"RestElement"===n.type&&this.raise(this.start,b.SetAccesorCannotHaveRestParameter)}i[a]&&this.raise(i[a].start,b.SetAccesorCannotHaveReturnType)}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}var o=s;e&&(o.readonly=!0);var h=this.tsTryParseTypeAnnotation();return h&&(o.typeAnnotation=h),this.tsParseTypeMemberSemicolon(),this.finishNode(o,"TSPropertySignature")},A.tsParseTypeMember=function(){var t=this.startNode();if(this.match(p.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",t);if(this.match(p._new)){var e=this.startNode();return this.next(),this.match(p.parenL)||this.tsMatchLeftRelational()?this.tsParseSignatureMember("TSConstructSignatureDeclaration",t):(t.key=this.createIdentifier(e,"new"),this.tsParsePropertyOrMethodSignature(t,!1))}return this.tsParseModifiers({modified:t,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]}),this.tsTryParseIndexSignature(t)||(this.parsePropertyName(t),t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||!this.tsTokenCanFollowModifier()||(t.kind=t.key.name,this.parsePropertyName(t)),this.tsParsePropertyOrMethodSignature(t,!!t.readonly))},A.tsParseList=function(t,e){for(var s=[];!this.tsIsListTerminator(t);)s.push(e());return s},A.tsParseObjectTypeMembers=function(){this.expect(p.braceL);var t=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(p.braceR),t},A.tsParseInterfaceDeclaration=function(t,e){if(void 0===e&&(e={}),this.hasFollowingLineBreak())return null;this.expectContextual("interface"),e.declare&&(t.declare=!0),q(this.type)?(t.id=this.parseIdent(),this.checkLValSimple(t.id,7)):(t.id=null,this.raise(this.start,b.MissingInterfaceName)),t.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(p._extends)&&(t.extends=this.tsParseHeritageClause("extends"));var s=this.startNode();return s.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),t.body=this.finishNode(s,"TSInterfaceBody"),this.finishNode(t,"TSInterfaceDeclaration")},A.tsParseAbstractDeclaration=function(t){if(this.match(p._class))return t.abstract=!0,this.parseClass(t,!0);if(this.ts_isContextual(_.interface)){if(!this.hasFollowingLineBreak())return t.abstract=!0,this.tsParseInterfaceDeclaration(t)}else this.unexpected(t.start)},A.tsIsDeclarationStart=function(){return H(this.type)},A.tsParseExpressionStatement=function(e,s){switch(s.name){case"declare":var i=this.tsTryParseDeclare(e);if(i)return i.declare=!0,i;break;case"global":if(this.match(p.braceL)){t.prototype.enterScope.call(this,f);var r=e;return r.global=!0,r.id=s,r.body=this.tsParseModuleBlock(),t.prototype.exitScope.call(this),this.finishNode(r,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1)}},A.tsParseModuleReference=function(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)},A.tsIsExportDefaultSpecifier=function(){var t=this.type,e=this.isAsyncFunction(),s=this.isLet();if(q(t)){if(e&&!this.containsEsc||s)return!1;if((t===_.type||t===_.interface)&&!this.containsEsc){var i=this.lookahead();if(q(i.type)&&!this.isContextualWithState("from",i)||i.type===p.braceL)return!1}}else if(!this.match(p._default))return!1;var r=this.nextTokenStart(),a=this.isUnparsedContextual(r,"from");if(44===this.input.charCodeAt(r)||q(this.type)&&a)return!0;if(this.match(p._default)&&a){var n=this.input.charCodeAt(this.nextTokenStartSince(r+4));return 34===n||39===n}return!1},A.tsInAmbientContext=function(t){var e=this.isAmbientContext;this.isAmbientContext=!0;try{return t()}finally{this.isAmbientContext=e}},A.tsCheckLineTerminator=function(t){return t?!this.hasFollowingLineBreak()&&(this.next(),!0):!this.isLineTerminator()},A.tsParseModuleOrNamespaceDeclaration=function(e,s){if(void 0===s&&(s=!1),e.id=this.parseIdent(),s||this.checkLValSimple(e.id,8),this.eat(p.dot)){var i=this.startNode();this.tsParseModuleOrNamespaceDeclaration(i,!0),e.body=i}else t.prototype.enterScope.call(this,f),e.body=this.tsParseModuleBlock(),t.prototype.exitScope.call(this);return this.finishNode(e,"TSModuleDeclaration")},A.checkLValSimple=function(e,s,i){return void 0===s&&(s=0),t.prototype.checkLValSimple.call(this,e,s,i)},A.tsParseTypeAliasDeclaration=function(t){var e=this;return t.id=this.parseIdent(),this.checkLValSimple(t.id,6),t.typeAnnotation=this.tsInType(function(){if(t.typeParameters=e.tsTryParseTypeParameters(e.tsParseInOutModifiers.bind(e)),e.expect(p.eq),e.ts_isContextual(_.interface)&&e.lookahead().type!==p.dot){var s=e.startNode();return e.next(),e.finishNode(s,"TSIntrinsicKeyword")}return e.tsParseType()}),this.semicolon(),this.finishNode(t,"TSTypeAliasDeclaration")},A.tsParseDeclaration=function(t,e,s){switch(e){case"abstract":if(this.tsCheckLineTerminator(s)&&(this.match(p._class)||q(this.type)))return this.tsParseAbstractDeclaration(t);break;case"module":if(this.tsCheckLineTerminator(s)){if(this.match(p.string))return this.tsParseAmbientExternalModuleDeclaration(t);if(q(this.type))return this.tsParseModuleOrNamespaceDeclaration(t)}break;case"namespace":if(this.tsCheckLineTerminator(s)&&q(this.type))return this.tsParseModuleOrNamespaceDeclaration(t);break;case"type":if(this.tsCheckLineTerminator(s)&&q(this.type))return this.tsParseTypeAliasDeclaration(t)}},A.tsTryParseExportDeclaration=function(){return this.tsParseDeclaration(this.startNode(),this.value,!0)},A.tsParseImportEqualsDeclaration=function(e,s){e.isExport=s||!1,e.id=this.parseIdent(),this.checkLValSimple(e.id,2),t.prototype.expect.call(this,p.eq);var i=this.tsParseModuleReference();return"type"===e.importKind&&"TSExternalModuleReference"!==i.type&&this.raise(i.start,b.ImportAliasHasImportType),e.moduleReference=i,t.prototype.semicolon.call(this),this.finishNode(e,"TSImportEqualsDeclaration")},A.isExportDefaultSpecifier=function(){if(this.tsIsDeclarationStart())return!1;var t=this.type;if(q(t)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((t===_.type||t===_.interface)&&!this.containsEsc){var e=this.lookahead();if(q(e.type)&&!this.isContextualWithState("from",e)||e.type===p.braceL)return!1}}else if(!this.match(p._default))return!1;var s=this.nextTokenStart(),i=this.isUnparsedContextual(s,"from");if(44===this.input.charCodeAt(s)||q(this.type)&&i)return!0;if(this.match(p._default)&&i){var r=this.input.charCodeAt(this.nextTokenStartSince(s+4));return 34===r||39===r}return!1},A.parseTemplate=function(t){var e=(void 0===t?{}:t).isTagged,s=void 0!==e&&e,i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:s});for(i.quasis=[r];!r.tail;)this.type===p.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(p.dollarBraceL),i.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(p.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:s}));return this.next(),this.finishNode(i,"TemplateLiteral")},A.parseFunction=function(t,e,s,i,r){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===p.star&&2&e&&this.unexpected(),t.generator=this.eat(p.star)),this.options.ecmaVersion>=8&&(t.async=!!i),1&e&&(t.id=4&e&&this.type!==p.name?null:this.parseIdent());var a=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos,h=this.maybeInArrowParameters;this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(w(t.async,t.generator)),1&e||(t.id=this.type===p.name?this.parseIdent():null),this.parseFunctionParams(t);var c=1&e;return this.parseFunctionBody(t,s,!1,r,{isFunctionDeclaration:c}),this.yieldPos=a,this.awaitPos=n,this.awaitIdentPos=o,1&e&&t.id&&!(2&e)&&this.checkLValSimple(t.id,t.body?this.strict||t.generator||t.async?this.treatFunctionsAsVar?1:2:3:0),this.maybeInArrowParameters=h,this.finishNode(t,c?"FunctionDeclaration":"FunctionExpression")},A.parseFunctionBody=function(e,s,i,r,a){void 0===s&&(s=!1),void 0===i&&(i=!1),void 0===r&&(r=!1),this.match(p.colon)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(p.colon));var n=null!=a&&a.isFunctionDeclaration?"TSDeclareFunction":null!=a&&a.isClassMethod?"TSDeclareMethod":void 0;return n&&!this.match(p.braceL)&&this.isLineTerminator()?this.finishNode(e,n):"TSDeclareFunction"===n&&this.isAmbientContext&&(this.raise(e.start,b.DeclareFunctionHasImplementation),e.declare)?(t.prototype.parseFunctionBody.call(this,e,s,i,!1),this.finishNode(e,n)):(t.prototype.parseFunctionBody.call(this,e,s,i,r),e)},A.parseNew=function(){var t;this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),s=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(p.dot)){e.meta=s;var i=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'"),i&&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 r=this.start,a=this.startLoc,n=this.type===p._import;e.callee=this.parseSubscripts(this.parseExprAtom(),r,a,!0,!1),n&&"ImportExpression"===e.callee.type&&this.raise(r,"Cannot use new with import()");var o=e.callee;return"TSInstantiationExpression"!==o.type||null!=(t=o.extra)&&t.parenthesized||(e.typeParameters=o.typeParameters,e.callee=o.expression),e.arguments=this.eat(p.parenL)?this.parseExprList(p.parenR,this.options.ecmaVersion>=8,!1):[],this.finishNode(e,"NewExpression")},A.parseExprOp=function(e,s,i,r,a){var n;if(p._in.binop>r&&!this.hasPrecedingLineBreak()&&(this.isContextual("as")&&(n="TSAsExpression"),h&&this.isContextual("satisfies")&&(n="TSSatisfiesExpression"),n)){var o=this.startNodeAt(s,i);o.expression=e;var c=this.tsTryNextParseConstantContext();return o.typeAnnotation=c||this.tsNextThenParseType(),this.finishNode(o,n),this.reScan_lt_gt(),this.parseExprOp(o,s,i,r,a)}return t.prototype.parseExprOp.call(this,e,s,i,r,a)},A.parseImportSpecifiers=function(){var t=[],e=!0;if(n.tokenIsIdentifier(this.type)&&(t.push(this.parseImportDefaultSpecifier()),!this.eat(p.comma)))return t;if(this.type===p.star)return t.push(this.parseImportNamespaceSpecifier()),t;for(this.expect(p.braceL);!this.eat(p.braceR);){if(e)e=!1;else if(this.expect(p.comma),this.afterTrailingComma(p.braceR))break;t.push(this.parseImportSpecifier())}return t},A.parseImport=function(t){var e=this.lookahead();if(t.importKind="value",this.importOrExportOuterKind="value",q(e.type)||this.match(p.star)||this.match(p.braceL)){var s=this.lookahead(2);if(s.type!==p.comma&&!this.isContextualWithState("from",s)&&s.type!==p.eq&&this.ts_eatContextualWithState("type",1,e)&&(this.importOrExportOuterKind="type",t.importKind="type",e=this.lookahead(),s=this.lookahead(2)),q(e.type)&&s.type===p.eq){this.next();var i=this.tsParseImportEqualsDeclaration(t);return this.importOrExportOuterKind="value",i}}return this.next(),this.type===p.string?(t.specifiers=[],t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===p.string?this.parseExprAtom():this.unexpected()),this.parseMaybeImportAttributes(t),this.semicolon(),this.finishNode(t,"ImportDeclaration"),this.importOrExportOuterKind="value","type"===t.importKind&&t.specifiers.length>1&&"ImportDefaultSpecifier"===t.specifiers[0].type&&this.raise(t.start,b.TypeImportCannotSpecifyDefaultAndNamed),t},A.parseExportDefaultDeclaration=function(){if(this.isAbstractClass()){var e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0)}if(this.match(_.interface)){var s=this.tsParseInterfaceDeclaration(this.startNode());if(s)return s}return t.prototype.parseExportDefaultDeclaration.call(this)},A.parseExportAllDeclaration=function(t,e){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==p.string&&this.unexpected(),t.source=this.parseExprAtom(),this.parseMaybeImportAttributes(t),this.semicolon(),this.finishNode(t,"ExportAllDeclaration")},A.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),this.eat(p.comma)){var e=this.parseExpression();t.arguments=[e]}if(!this.eat(p.parenR)){var s=this.start;this.eat(p.comma)&&this.eat(p.parenR)?this.raiseRecoverable(s,"Trailing comma is not allowed in import()"):this.unexpected(s)}return this.finishNode(t,"ImportExpression")},A.parseExport=function(t,e){var s=this.lookahead();if(this.ts_eatWithState(p._import,2,s)){this.ts_isContextual(_.type)&&61!==this.lookaheadCharCode()?(t.importKind="type",this.importOrExportOuterKind="type",this.next()):(t.importKind="value",this.importOrExportOuterKind="value");var i=this.tsParseImportEqualsDeclaration(t,!0);return this.importOrExportOuterKind=void 0,i}if(this.ts_eatWithState(p.eq,2,s)){var r=t;return r.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(r,"TSExportAssignment")}if(this.ts_eatContextualWithState("as",2,s)){var a=t;return this.expectContextual("namespace"),a.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(a,"TSNamespaceExportDeclaration")}if(this.ts_isContextualWithState(s,_.type)&&this.lookahead(2).type===p.braceL?(this.next(),this.importOrExportOuterKind="type",t.exportKind="type"):(this.importOrExportOuterKind="value",t.exportKind="value"),this.next(),this.eat(p.star))return this.parseExportAllDeclaration(t,e);if(this.eat(p._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseExportDeclaration(t),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==p.string&&this.unexpected(),t.source=this.parseExprAtom(),this.parseMaybeImportAttributes(t);else{for(var n,o=c(t.specifiers);!(n=o()).done;){var h=n.value;this.checkUnreserved(h.local),this.checkLocalExport(h.local),"Literal"===h.local.type&&this.raise(h.local.start,"A string literal cannot be used as an exported binding without `from`.")}t.source=null}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")},A.checkExport=function(t,e,s){t&&("string"!=typeof e&&(e="Identifier"===e.type?e.name:e.value),t[e]=!0)},A.parseMaybeDefault=function(e,s,i){var r=t.prototype.parseMaybeDefault.call(this,e,s,i);return"AssignmentPattern"===r.type&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(r.typeAnnotation.start,b.TypeAnnotationAfterAssign),r},A.typeCastToParameter=function(t){return t.expression.typeAnnotation=t.typeAnnotation,this.resetEndLocation(t.expression,t.typeAnnotation.end),t.expression},A.toAssignableList=function(e,s){for(var i=0;i<e.length;i++){var r=e[i];"TSTypeCastExpression"===(null==r?void 0:r.type)&&(e[i]=this.typeCastToParameter(r))}return t.prototype.toAssignableList.call(this,e,s)},A.reportReservedArrowTypeParam=function(t){},A.parseExprAtom=function(e,s,i){if(this.type===_.jsxText)return this.jsx_parseText();if(this.type===_.jsxTagStart)return this.jsx_parseElement();if(this.type===_.at)return this.parseDecorators(),this.parseExprAtom();if(q(this.type)){var r=this.potentialArrowAt===this.start,a=this.start,n=this.startLoc,o=this.containsEsc,h=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&"async"===h.name&&!this.canInsertSemicolon()&&this.eat(p._function))return this.overrideContext(M.f_expr),this.parseFunction(this.startNodeAt(a,n),0,!1,!0,s);if(r&&!this.canInsertSemicolon()){if(this.eat(p.arrow))return this.parseArrowExpression(this.startNodeAt(a,n),[h],!1,s);if(this.options.ecmaVersion>=8&&"async"===h.name&&this.type===p.name&&!o&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return h=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(p.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,n),[h],!0,s)}return h}return t.prototype.parseExprAtom.call(this,e,s,i)},A.parseExprAtomDefault=function(){if(q(this.type)){var t=this.potentialArrowAt===this.start,e=this.containsEsc,s=this.parseIdent();if(!e&&"async"===s.name&&!this.canInsertSemicolon()){var i=this.type;if(i===p._function)return this.next(),this.parseFunction(this.startNodeAtNode(s),void 0,!0,!0);if(q(i)){if(61===this.lookaheadCharCode()){var r=this.parseIdent(!1);return!this.canInsertSemicolon()&&this.eat(p.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAtNode(s),[r],!0)}return s}}return t&&this.match(p.arrow)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(s),[s],!1)):s}this.unexpected()},A.parseIdentNode=function(){var e=this.startNode();return U(this.type)?(e.name=this.value,e):t.prototype.parseIdentNode.call(this)},A.parseVarStatement=function(e,s,i){void 0===i&&(i=!1);var r=this.isAmbientContext;this.next(),t.prototype.parseVar.call(this,e,!1,s,i||r),this.semicolon();var a=this.finishNode(e,"VariableDeclaration");if(!r)return a;for(var n,o=c(a.declarations);!(n=o()).done;){var h=n.value,p=h.init;p&&("const"!==s||h.id.typeAnnotation?this.raise(p.start,b.InitializerNotAllowedInAmbientContext):"StringLiteral"!==p.type&&"BooleanLiteral"!==p.type&&"NumericLiteral"!==p.type&&"BigIntLiteral"!==p.type&&("TemplateLiteral"!==p.type||p.expressions.length>0)&&!L(p)&&this.raise(p.start,b.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference))}return a},A.parseStatement=function(e,s,i){if(this.match(_.at)&&this.parseDecorators(!0),this.match(p._const)&&this.isLookaheadContextual("enum")){var r=this.startNode();return this.expect(p._const),this.tsParseEnumDeclaration(r,{const:!0})}if(this.ts_isContextual(_.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(_.interface)){var a=this.tsParseInterfaceDeclaration(this.startNode());if(a)return a}return t.prototype.parseStatement.call(this,e,s,i)},A.parseAccessModifier=function(){return this.tsParseModifier(["public","protected","private"])},A.parsePostMemberNameModifiers=function(t){this.eat(p.question)&&(t.optional=!0),t.readonly&&this.match(p.parenL)&&this.raise(t.start,b.ClassMethodHasReadonly),t.declare&&this.match(p.parenL)&&this.raise(t.start,b.ClassMethodHasDeclare)},A.parseExpressionStatement=function(e,s){return("Identifier"===s.type?this.tsParseExpressionStatement(e,s):void 0)||t.prototype.parseExpressionStatement.call(this,e,s)},A.shouldParseExportStatement=function(){return!!this.tsIsDeclarationStart()||!!this.match(_.at)||t.prototype.shouldParseExportStatement.call(this)},A.parseConditional=function(t,e,s,i,r){if(this.eat(p.question)){var a=this.startNodeAt(e,s);return a.test=t,a.consequent=this.parseMaybeAssign(),this.expect(p.colon),a.alternate=this.parseMaybeAssign(i),this.finishNode(a,"ConditionalExpression")}return t},A.parseMaybeConditional=function(t,e){var s=this,i=this.start,r=this.startLoc,a=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return a;if(!this.maybeInArrowParameters||!this.match(p.question))return this.parseConditional(a,i,r,t,e);var n=this.tryParse(function(){return s.parseConditional(a,i,r,t,e)});return n.node?(n.error&&this.setLookaheadState(n.failState),n.node):(n.error&&this.setOptionalParametersError(e,n.error),a)},A.parseParenItem=function(e){var s=this.start,i=this.startLoc;if(e=t.prototype.parseParenItem.call(this,e),this.eat(p.question)&&(e.optional=!0,this.resetEndLocation(e)),this.match(p.colon)){var r=this.startNodeAt(s,i);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return e},A.parseExportDeclaration=function(t){var e=this;if(!this.isAmbientContext&&this.ts_isContextual(_.declare))return this.tsInAmbientContext(function(){return e.parseExportDeclaration(t)});var s=this.start,i=this.startLoc,r=this.eatContextual("declare");!r||!this.ts_isContextual(_.declare)&&this.shouldParseExportStatement()||this.raise(this.start,b.ExpectedAmbientAfterExportDeclare);var a=q(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);return a?(("TSInterfaceDeclaration"===a.type||"TSTypeAliasDeclaration"===a.type||r)&&(t.exportKind="type"),r&&(this.resetStartLocation(a,s,i),a.declare=!0),a):null},A.parseClassId=function(e,s){if(s||!this.isContextual("implements")){t.prototype.parseClassId.call(this,e,s);var i=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));i&&(e.typeParameters=i)}},A.parseClassPropertyAnnotation=function(t){t.optional||("!"===this.value&&this.eat(p.prefix)?t.definite=!0:this.eat(p.question)&&(t.optional=!0));var e=this.tsTryParseTypeAnnotation();e&&(t.typeAnnotation=e)},A.parseClassField=function(e){if("PrivateIdentifier"===e.key.type)e.abstract&&this.raise(e.start,b.PrivateElementHasAbstract),e.accessibility&&this.raise(e.start,b.PrivateElementHasAccessibility({modifier:e.accessibility})),this.parseClassPropertyAnnotation(e);else if(this.parseClassPropertyAnnotation(e),this.isAmbientContext&&(!e.readonly||e.typeAnnotation)&&this.match(p.eq)&&this.raise(this.start,b.DeclareClassFieldHasInitializer),e.abstract&&this.match(p.eq)){var s=e.key;this.raise(this.start,b.AbstractPropertyHasInitializer({propertyName:"Identifier"!==s.type||e.computed?"["+this.input.slice(s.start,s.end)+"]":s.name}))}return t.prototype.parseClassField.call(this,e)},A.parseClassMethod=function(t,e,s,i){var r="constructor"===t.kind,a="PrivateIdentifier"===t.key.type,n=this.tsTryParseTypeParameters();a?(n&&(t.typeParameters=n),t.accessibility&&this.raise(t.start,b.PrivateMethodsHasAccessibility({modifier:t.accessibility}))):n&&r&&this.raise(n.start,b.ConstructorHasTypeParameters);var o=t.declare,h=t.kind;!(void 0!==o&&o)||"get"!==h&&"set"!==h||this.raise(t.start,b.DeclareAccessor({kind:h})),n&&(t.typeParameters=n);var p=t.key;"constructor"===t.kind?(e&&this.raise(p.start,"Constructor can't be a generator"),s&&this.raise(p.start,"Constructor can't be an async method")):t.static&&P(t,"prototype")&&this.raise(p.start,"Classes may not have a static property named prototype");var c=t.value=this.parseMethod(e,s,i,!0,t);return"get"===t.kind&&0!==c.params.length&&this.raiseRecoverable(c.start,"getter should have no params"),"set"===t.kind&&1!==c.params.length&&this.raiseRecoverable(c.start,"setter should have exactly one param"),"set"===t.kind&&"RestElement"===c.params[0].type&&this.raiseRecoverable(c.params[0].start,"Setter cannot use rest params"),this.finishNode(t,"MethodDefinition")},A.isClassMethod=function(){return this.match(p.relational)},A.parseClassElement=function(e){var s=this;if(this.eat(p.semi))return null;var i,r=this.options.ecmaVersion,a=this.startNode(),n="",o=!1,h=!1,c="method",l=["declare","private","public","protected","accessor","override","abstract","readonly","static"],u=this.tsParseModifiers({modified:a,allowedModifiers:l,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:b.InvalidModifierOnTypeParameterPositions});i=Boolean(u.static);var d=function(){if(!s.tsIsStartOfStaticBlocks()){var u=s.tsTryParseIndexSignature(a);if(u)return a.abstract&&s.raise(a.start,b.IndexSignatureHasAbstract),a.accessibility&&s.raise(a.start,b.IndexSignatureHasAccessibility({modifier:a.accessibility})),a.declare&&s.raise(a.start,b.IndexSignatureHasDeclare),a.override&&s.raise(a.start,b.IndexSignatureHasOverride),u;if(!s.inAbstractClass&&a.abstract&&s.raise(a.start,b.NonAbstractClassHasAbstractMethod),a.override&&e&&s.raise(a.start,b.OverrideNotInSubClass),a.static=i,i&&(s.isClassElementNameStart()||s.type===p.star||(n="static")),!n&&r>=8&&s.eatContextual("async")&&(!s.isClassElementNameStart()&&s.type!==p.star||s.canInsertSemicolon()?n="async":h=!0),!n&&(r>=9||!h)&&s.eat(p.star)&&(o=!0),!n&&!h&&!o){var d=s.value;(s.eatContextual("get")||s.eatContextual("set"))&&(s.isClassElementNameStart()?c=d:n=d)}if(n?(a.computed=!1,a.key=s.startNodeAt(s.lastTokStart,s.lastTokStartLoc),a.key.name=n,s.finishNode(a.key,"Identifier")):s.parseClassElementName(a),s.parsePostMemberNameModifiers(a),s.isClassMethod()||r<13||s.type===p.parenL||"method"!==c||o||h){var m=!a.static&&P(a,"constructor"),f=m&&e;m&&"method"!==c&&s.raise(a.key.start,"Constructor can't have get/set modifier"),a.kind=m?"constructor":c,s.parseClassMethod(a,o,h,f)}else s.parseClassField(a);return a}if(s.next(),s.next(),s.tsHasSomeModifiers(a,l)&&s.raise(s.start,b.StaticBlockCannotHaveModifier),r>=13)return t.prototype.parseClassStaticBlock.call(s,a),a};return a.declare?this.tsInAmbientContext(d):d(),a},A.isClassElementNameStart=function(){return!!this.tsIsIdentifier()||t.prototype.isClassElementNameStart.call(this)},A.parseClassSuper=function(e){t.prototype.parseClassSuper.call(this,e),e.superClass&&(this.tsMatchLeftRelational()||this.match(p.bitShift))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual("implements")&&(e.implements=this.tsParseHeritageClause("implements"))},A.parseFunctionParams=function(e){var s=this.tsTryParseTypeParameters();s&&(e.typeParameters=s),t.prototype.parseFunctionParams.call(this,e)},A.parseVarId=function(e,s){t.prototype.parseVarId.call(this,e,s),"Identifier"===e.id.type&&!this.hasPrecedingLineBreak()&&"!"===this.value&&this.eat(p.prefix)&&(e.definite=!0);var i=this.tsTryParseTypeAnnotation();i&&(e.id.typeAnnotation=i,this.resetEndLocation(e.id))},A.parseArrowExpression=function(t,e,s,i){this.match(p.colon)&&(t.returnType=this.tsParseTypeAnnotation());var r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;this.enterScope(16|w(s,!1)),this.initFunction(t);var o=this.maybeInArrowParameters;return this.options.ecmaVersion>=8&&(t.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,t.params=this.toAssignableList(e,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0,!1,i),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.maybeInArrowParameters=o,this.finishNode(t,"ArrowFunctionExpression")},A.parseMaybeAssignOrigin=function(t,e,s){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}var i=!1,r=-1,a=-1,n=-1;e?(r=e.parenthesizedAssign,a=e.trailingComma,n=e.doubleProto,e.parenthesizedAssign=e.trailingComma=-1):(e=new T,i=!0);var o=this.start,h=this.startLoc;(this.type===p.parenL||q(this.type))&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===t);var c=this.parseMaybeConditional(t,e);if(s&&(c=s.call(this,c,o,h)),this.type.isAssign){var l=this.startNodeAt(o,h);return l.operator=this.value,this.type===p.eq&&(c=this.toAssignable(c,!0,e)),i||(e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1),e.shorthandAssign>=c.start&&(e.shorthandAssign=-1),this.type===p.eq?this.checkLValPattern(c):this.checkLValSimple(c),l.left=c,this.next(),l.right=this.parseMaybeAssign(t),n>-1&&(e.doubleProto=n),this.finishNode(l,"AssignmentExpression")}return i&&this.checkExpressionErrors(e,!0),r>-1&&(e.parenthesizedAssign=r),a>-1&&(e.trailingComma=a),c},A.parseMaybeAssign=function(t,e,s){var i,r,a,o,h,p,c,l,u,d,m,f=this;if(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational()){if(l=this.cloneCurLookaheadState(),!(u=this.tryParse(function(){return f.parseMaybeAssignOrigin(t,e,s)},l)).error)return u.node;var y=this.context,x=y[y.length-1];x===n.tokContexts.tc_oTag&&y[y.length-2]===n.tokContexts.tc_expr?(y.pop(),y.pop()):x!==n.tokContexts.tc_oTag&&x!==n.tokContexts.tc_expr||y.pop()}if(!(null!=(i=u)&&i.error||this.tsMatchLeftRelational()))return this.parseMaybeAssignOrigin(t,e,s);l&&!this.compareLookaheadState(l,this.getCurLookaheadState())||(l=this.cloneCurLookaheadState());var T=this.tryParse(function(i){var r,a;m=f.tsParseTypeParameters();var n=f.parseMaybeAssignOrigin(t,e,s);return("ArrowFunctionExpression"!==n.type||null!=(r=n.extra)&&r.parenthesized)&&i(),0!==(null==(a=m)?void 0:a.params.length)&&f.resetStartLocationFromNode(n,m),n.typeParameters=m,n},l);if(!T.error&&!T.aborted)return m&&this.reportReservedArrowTypeParam(m),T.node;if(!u&&(k(!0),!(d=this.tryParse(function(){return f.parseMaybeAssignOrigin(t,e,s)},l)).error))return d.node;if(null!=(r=u)&&r.node)return this.setLookaheadState(u.failState),u.node;if(T.node)return this.setLookaheadState(T.failState),m&&this.reportReservedArrowTypeParam(m),T.node;if(null!=(a=d)&&a.node)return this.setLookaheadState(d.failState),d.node;if(null!=(o=u)&&o.thrown)throw u.error;if(T.thrown)throw T.error;if(null!=(h=d)&&h.thrown)throw d.error;throw(null==(p=u)?void 0:p.error)||T.error||(null==(c=d)?void 0:c.error)},A.parseAssignableListItem=function(t){for(var e=[];this.match(_.at);)e.push(this.parseDecorator());var s,i=this.start,r=this.startLoc,a=!1,n=!1;if(void 0!==t){var o={};this.tsParseModifiers({modified:o,allowedModifiers:["public","private","protected","override","readonly"]}),s=o.accessibility,n=o.override,a=o.readonly,!1===t&&(s||a||n)&&this.raise(r.start,b.UnexpectedParameterModifier)}var h=this.parseMaybeDefault(i,r);this.parseBindingListItem(h);var p=this.parseMaybeDefault(h.start,h.loc,h);if(e.length&&(p.decorators=e),s||a||n){var c=this.startNodeAt(i,r);return s&&(c.accessibility=s),a&&(c.readonly=a),n&&(c.override=n),"Identifier"!==p.type&&"AssignmentPattern"!==p.type&&this.raise(c.start,b.UnsupportedParameterPropertyKind),c.parameter=p,this.finishNode(c,"TSParameterProperty")}return p},A.checkLValInnerPattern=function(e,s,i){void 0===s&&(s=0),"TSParameterProperty"===e.type?this.checkLValInnerPattern(e.parameter,s,i):t.prototype.checkLValInnerPattern.call(this,e,s,i)},A.parseBindingListItem=function(t){this.eat(p.question)&&("Identifier"===t.type||this.isAmbientContext||this.inType||this.raise(t.start,b.PatternIsOptional),t.optional=!0);var e=this.tsTryParseTypeAnnotation();return e&&(t.typeAnnotation=e),this.resetEndLocation(t),t},A.isAssignable=function(t,e){var s=this;switch(t.type){case"TSTypeCastExpression":return this.isAssignable(t.expression,e);case"TSParameterProperty":case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":var i=t.properties.length-1;return t.properties.every(function(t,e){return"ObjectMethod"!==t.type&&(e===i||"SpreadElement"!==t.type)&&s.isAssignable(t)});case"Property":case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(function(t){return null===t||s.isAssignable(t)});case"AssignmentExpression":return"="===t.operator;case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}},A.toAssignable=function(e,s,i){switch(void 0===s&&(s=!1),void 0===i&&(i=new T),e.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(e,s,i);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":return s||this.raise(e.start,b.UnexpectedTypeCastInParameter),this.toAssignable(e.expression,s,i);case"MemberExpression":break;case"AssignmentExpression":return s||"TSTypeCastExpression"!==e.left.type||(e.left=this.typeCastToParameter(e.left)),t.prototype.toAssignable.call(this,e,s,i);case"TSTypeCastExpression":return this.typeCastToParameter(e);default:return t.prototype.toAssignable.call(this,e,s,i)}return e},A.toAssignableParenthesizedExpression=function(e,s,i){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":return this.toAssignable(e.expression,s,i);default:return t.prototype.toAssignable.call(this,e,s,i)}},A.curPosition=function(){if(this.options.locations){var e=t.prototype.curPosition.call(this);return Object.defineProperty(e,"offset",{get:function(){return function(t){var e=new i.Position(this.line,this.column+t);return e.index=this.index+t,e}}}),e.index=this.pos,e}},A.parseBindingAtom=function(){return this.type===p._this?this.parseIdent(!0):t.prototype.parseBindingAtom.call(this)},A.shouldParseArrow=function(t){var e,s=this;if(e=this.match(p.colon)?t.every(function(t){return s.isAssignable(t,!0)}):!this.canInsertSemicolon()){if(this.match(p.colon)){var i=this.tryParse(function(t){var e=s.tsParseTypeOrTypePredicateAnnotation(p.colon);return!s.canInsertSemicolon()&&s.match(p.arrow)||t(),e});if(i.aborted)return this.shouldParseArrowReturnType=void 0,!1;i.thrown||(i.error&&this.setLookaheadState(i.failState),this.shouldParseArrowReturnType=i.node)}return!!this.match(p.arrow)||(this.shouldParseArrowReturnType=void 0,!1)}return this.shouldParseArrowReturnType=void 0,e},A.parseParenArrowList=function(t,e,s,i){var r=this.startNodeAt(t,e);return r.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(r,s,!1,i)},A.parseParenAndDistinguishExpression=function(t,e){var s,i=this.start,r=this.startLoc,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){var n=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();var o,h=this.start,c=this.startLoc,l=[],u=!0,d=!1,m=new T,f=this.yieldPos,y=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==p.parenR;){if(u?u=!1:this.expect(p.comma),a&&this.afterTrailingComma(p.parenR,!0)){d=!0;break}if(this.type===p.ellipsis){o=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===p.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}l.push(this.parseMaybeAssign(e,m,this.parseParenItem))}var x=this.lastTokEnd,v=this.lastTokEndLoc;if(this.expect(p.parenR),this.maybeInArrowParameters=n,t&&this.shouldParseArrow(l)&&this.eat(p.arrow))return this.checkPatternErrors(m,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=y,this.parseParenArrowList(i,r,l,e);l.length&&!d||this.unexpected(this.lastTokStart),o&&this.unexpected(o),this.checkExpressionErrors(m,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=y||this.awaitPos,l.length>1?((s=this.startNodeAt(h,c)).expressions=l,this.finishNodeAt(s,"SequenceExpression",x,v)):s=l[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var P=this.startNodeAt(i,r);return P.expression=s,this.finishNode(P,"ParenthesizedExpression")}return s},A.parseTaggedTemplateExpression=function(t,e,s,i){var r=this.startNodeAt(e,s);return r.tag=t,r.quasi=this.parseTemplate({isTagged:!0}),i&&this.raise(e,"Tagged Template Literals are not allowed in optionalChain."),this.finishNode(r,"TaggedTemplateExpression")},A.shouldParseAsyncArrow=function(){var t=this;if(!this.match(p.colon))return!this.canInsertSemicolon()&&this.eat(p.arrow);var e=this.tryParse(function(e){var s=t.tsParseTypeOrTypePredicateAnnotation(p.colon);return!t.canInsertSemicolon()&&t.match(p.arrow)||e(),s});return e.aborted?(this.shouldParseAsyncArrowReturnType=void 0,!1):e.thrown?void 0:(e.error&&this.setLookaheadState(e.failState),this.shouldParseAsyncArrowReturnType=e.node,!this.canInsertSemicolon()&&this.eat(p.arrow))},A.parseSubscriptAsyncArrow=function(t,e,s,i){var r=this.startNodeAt(t,e);return r.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(r,s,!0,i)},A.parseExprList=function(t,e,s,i){for(var r=[],a=!0;!this.eat(t);){if(a)a=!1;else if(this.expect(p.comma),e&&this.afterTrailingComma(t))break;var n=void 0;s&&this.type===p.comma?n=null:this.type===p.ellipsis?(n=this.parseSpread(i),i&&this.type===p.comma&&i.trailingComma<0&&(i.trailingComma=this.start)):n=this.parseMaybeAssign(!1,i,this.parseParenItem),r.push(n)}return r},A.parseSubscript=function(t,e,s,i,r,a,n){var o=this,h=a;if(!this.hasPrecedingLineBreak()&&"!"===this.value&&this.match(p.prefix)){this.exprAllowed=!1,this.next();var c=this.startNodeAt(e,s);return c.expression=t,t=this.finishNode(c,"TSNonNullExpression")}var l=!1;if(this.match(p.questionDot)&&60===this.lookaheadCharCode()){if(i)return t;t.optional=!0,h=l=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(p.bitShift)){var u,d=this.tsTryParseAndCatch(function(){if(!i&&o.atPossibleAsyncArrow(t)){var r=o.tsTryParseGenericAsyncArrowFunction(e,s,n);if(r)return t=r}var a=o.tsParseTypeArgumentsInExpression();if(!a)return t;if(l&&!o.match(p.parenL))return u=o.curPosition(),t;if(B(o.type)||o.type===p.backQuote){var c=o.parseTaggedTemplateExpression(t,e,s,h);return c.typeParameters=a,c}if(!i&&o.eat(p.parenL)){var d=new T,m=o.startNodeAt(e,s);return m.callee=t,m.arguments=o.parseExprList(p.parenR,o.options.ecmaVersion>=8,!1,d),o.tsCheckForInvalidTypeCasts(m.arguments),m.typeParameters=a,h&&(m.optional=l),o.checkExpressionErrors(d,!0),t=o.finishNode(m,"CallExpression")}var f=o.type;if(!(o.tsMatchRightRelational()||f===p.bitShift||f!==p.parenL&&(y=f,Boolean(y.startsExpr))&&!o.hasPrecedingLineBreak())){var y,x=o.startNodeAt(e,s);return x.expression=t,x.typeParameters=a,o.finishNode(x,"TSInstantiationExpression")}});if(u&&this.unexpected(u),d)return"TSInstantiationExpression"===d.type&&(this.match(p.dot)||this.match(p.questionDot)&&40!==this.lookaheadCharCode())&&this.raise(this.start,b.InvalidPropertyAccessAfterInstantiationExpression),t=d}var m=this.options.ecmaVersion>=11,f=m&&this.eat(p.questionDot);i&&f&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var y=this.eat(p.bracketL);if(y||f&&this.type!==p.parenL&&this.type!==p.backQuote||this.eat(p.dot)){var x=this.startNodeAt(e,s);x.object=t,y?(x.property=this.parseExpression(),this.expect(p.bracketR)):x.property=this.type===p.privateId&&"Super"!==t.type?this.parsePrivateIdent():this.parseIdent("never"!==this.options.allowReserved),x.computed=!!y,m&&(x.optional=f),t=this.finishNode(x,"MemberExpression")}else if(!i&&this.eat(p.parenL)){var v=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;var P=new T,g=this.yieldPos,A=this.awaitPos,S=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var C=this.parseExprList(p.parenR,this.options.ecmaVersion>=8,!1,P);if(r&&!f&&this.shouldParseAsyncArrow())this.checkPatternErrors(P,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=g,this.awaitPos=A,this.awaitIdentPos=S,t=this.parseSubscriptAsyncArrow(e,s,C,n);else{this.checkExpressionErrors(P,!0),this.yieldPos=g||this.yieldPos,this.awaitPos=A||this.awaitPos,this.awaitIdentPos=S||this.awaitIdentPos;var E=this.startNodeAt(e,s);E.callee=t,E.arguments=C,m&&(E.optional=f),t=this.finishNode(E,"CallExpression")}this.maybeInArrowParameters=v}else if(this.type===p.backQuote){(f||h)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var k=this.startNodeAt(e,s);k.tag=t,k.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(k,"TaggedTemplateExpression")}return t},A.parseGetterSetter=function(t){t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var e="get"===t.kind?0:1,s=t.value.params[0],i=s&&this.isThisParam(s);t.value.params.length!==(e=i?e+1:e)?this.raiseRecoverable(t.value.start,"get"===t.kind?"getter should have no params":"setter should have exactly one param"):"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")},A.parseProperty=function(e,s){if(!e){var i=[];if(this.match(_.at))for(;this.match(_.at);)i.push(this.parseDecorator());var r=t.prototype.parseProperty.call(this,e,s);return"SpreadElement"===r.type&&i.length&&this.raise(r.start,"Decorators can't be used with SpreadElement"),i.length&&(r.decorators=i,i=[]),r}return t.prototype.parseProperty.call(this,e,s)},A.parseCatchClauseParam=function(){var t=this.parseBindingAtom(),e="Identifier"===t.type;this.enterScope(e?32:0),this.checkLValPattern(t,e?4:2);var s=this.tsTryParseTypeAnnotation();return s&&(t.typeAnnotation=s,this.resetEndLocation(t)),this.expect(p.parenR),t},A.parseClass=function(t,e){var s=this.inAbstractClass;this.inAbstractClass=!!t.abstract;try{this.next(),this.takeDecorators(t);var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var r=this.enterClassBody(),a=this.startNode(),n=!1;a.body=[];var o=[];for(this.expect(p.braceL);this.type!==p.braceR;)if(this.match(_.at))o.push(this.parseDecorator());else{var h=this.parseClassElement(null!==t.superClass);o.length&&(h.decorators=o,this.resetStartLocationFromNode(h,o[0]),o=[]),h&&(a.body.push(h),"MethodDefinition"===h.type&&"constructor"===h.kind&&"FunctionExpression"===h.value.type?(n&&this.raiseRecoverable(h.start,"Duplicate constructor in the same class"),n=!0,h.decorators&&h.decorators.length>0&&this.raise(h.start,"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")):h.key&&"PrivateIdentifier"===h.key.type&&v(r,h)&&this.raiseRecoverable(h.key.start,"Identifier '#"+h.key.name+"' has already been declared"))}return this.strict=i,this.next(),o.length&&this.raise(this.start,"Decorators must be attached to a class element."),t.body=this.finishNode(a,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=s}},A.parseClassFunctionParams=function(){var t=this.tsTryParseTypeParameters(this.tsParseConstModifier),e=this.parseBindingList(p.parenR,!1,this.options.ecmaVersion>=8,!0);return t&&(e.typeParameters=t),e},A.parseMethod=function(t,e,s,i,r){var a=this.startNode(),n=this.yieldPos,o=this.awaitPos,h=this.awaitIdentPos;if(this.initFunction(a),this.options.ecmaVersion>=6&&(a.generator=t),this.options.ecmaVersion>=8&&(a.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|w(e,a.generator)|(s?128:0)),this.expect(p.parenL),a.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(a,!1,!0,!1,{isClassMethod:i}),this.yieldPos=n,this.awaitPos=o,this.awaitIdentPos=h,r&&r.abstract&&a.body){var c=r.key;this.raise(r.start,b.AbstractMethodHasImplementation({methodName:"Identifier"!==c.type||r.computed?"["+this.input.slice(c.start,c.end)+"]":c.name}))}return this.finishNode(a,"FunctionExpression")},e.parse=function(t,e){if(!1===e.locations)throw new Error("You have to enable options.locations while using acorn-typescript");e.locations=!0;var s=new this(e,t);return r&&(s.isAmbientContext=!0),s.parse()},e.parseExpressionAt=function(t,e,s){if(!1===s.locations)throw new Error("You have to enable options.locations while using acorn-typescript");s.locations=!0;var i=new this(s,t,e);return r&&(i.isAmbientContext=!0),i.nextToken(),i.parseExpression()},A.parseImportSpecifier=function(){if(this.ts_isContextual(_.type)){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(e,!0,"type"===this.importOrExportOuterKind),this.finishNode(e,"ImportSpecifier")}var s=t.prototype.parseImportSpecifier.call(this);return s.importKind="value",s},A.parseExportSpecifier=function(e){var s=this.ts_isContextual(_.type);if(!this.match(p.string)&&s){var i=this.startNode();return i.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(i,!1,"type"===this.importOrExportOuterKind),this.finishNode(i,"ExportSpecifier"),this.checkExport(e,i.exported,i.exported.start),i}var r=t.prototype.parseExportSpecifier.call(this,e);return r.exportKind="value",r},A.parseTypeOnlyImportExportSpecifier=function(e,s,i){var r,a=s?"imported":"local",n=s?"local":"exported",o=e[a],h=!1,p=!0,c=o.start;if(this.isContextual("as")){var l=this.parseIdent();if(this.isContextual("as")){var u=this.parseIdent();U(this.type)?(h=!0,o=l,r=s?this.parseIdent():this.parseModuleExportName(),p=!1):(r=u,p=!1)}else U(this.type)?(p=!1,r=s?this.parseIdent():this.parseModuleExportName()):(h=!0,o=l)}else U(this.type)&&(h=!0,s?(o=t.prototype.parseIdent.call(this,!0),this.isContextual("as")||this.checkUnreserved(o)):o=this.parseModuleExportName());h&&i&&this.raise(c,s?b.TypeModifierIsUsedInTypeImports:b.TypeModifierIsUsedInTypeExports),e[a]=o,e[n]=r,e[s?"importKind":"exportKind"]=h?"type":"value",p&&this.eatContextual("as")&&(e[n]=s?this.parseIdent():this.parseModuleExportName()),e[n]||(e[n]=this.copyNode(e[a])),s&&this.checkLValSimple(e[n],2)},A.raiseCommonCheck=function(e,s,i){return"Comma is not permitted after the rest element"===s?this.isAmbientContext&&this.match(p.comma)&&41===this.lookaheadCharCode()?void this.next():t.prototype.raise.call(this,e,s):i?t.prototype.raiseRecoverable.call(this,e,s):t.prototype.raise.call(this,e,s)},A.raiseRecoverable=function(t,e){return this.raiseCommonCheck(t,e,!0)},A.raise=function(t,e){return this.raiseCommonCheck(t,e,!0)},A.updateContext=function(e){var s=this.type;if(s==p.braceL){var i=this.curContext();i==R.tc_oTag?this.context.push(M.b_expr):i==R.tc_expr?this.context.push(M.b_tmpl):t.prototype.updateContext.call(this,e),this.exprAllowed=!0}else{if(s!==p.slash||e!==_.jsxTagStart)return t.prototype.updateContext.call(this,e);this.context.length-=2,this.context.push(R.tc_cTag),this.exprAllowed=!1}},A.jsx_parseOpeningElementAt=function(t,e){var s=this,i=this.startNodeAt(t,e),r=this.jsx_parseElementName();if(r&&(i.name=r),this.match(p.relational)||this.match(p.bitShift)){var a=this.tsTryParseAndCatch(function(){return s.tsParseTypeArgumentsInExpression()});a&&(i.typeParameters=a)}for(i.attributes=[];this.type!==p.slash&&this.type!==_.jsxTagEnd;)i.attributes.push(this.jsx_parseAttribute());return i.selfClosing=this.eat(p.slash),this.expect(_.jsxTagEnd),this.finishNode(i,r?"JSXOpeningElement":"JSXOpeningFragment")},A.enterScope=function(e){e===f&&this.importsStack.push([]),t.prototype.enterScope.call(this,e);var s=t.prototype.currentScope.call(this);s.types=[],s.enums=[],s.constEnums=[],s.classes=[],s.exportOnlyBindings=[]},A.exitScope=function(){t.prototype.currentScope.call(this).flags===f&&this.importsStack.pop(),t.prototype.exitScope.call(this)},A.hasImport=function(t,e){var s=this.importsStack.length;if(this.importsStack[s-1].indexOf(t)>-1)return!0;if(!e&&s>1)for(var i=0;i<s-1;i++)if(this.importsStack[i].indexOf(t)>-1)return!0;return!1},A.maybeExportDefined=function(t,e){this.inModule&&1&t.flags&&this.undefinedExports.delete(e)},A.isRedeclaredInScope=function(e,s,i){return!!(0&i)&&(2&i?e.lexical.indexOf(s)>-1||e.functions.indexOf(s)>-1||e.var.indexOf(s)>-1:3&i?e.lexical.indexOf(s)>-1||!t.prototype.treatFunctionsAsVarInScope.call(this,e)&&e.var.indexOf(s)>-1:e.lexical.indexOf(s)>-1&&!(32&e.flags&&e.lexical[0]===s)||!this.treatFunctionsAsVarInScope(e)&&e.functions.indexOf(s)>-1)},A.checkRedeclarationInScope=function(t,e,s,i){this.isRedeclaredInScope(t,e,s)&&this.raise(i,"Identifier '"+e+"' has already been declared.")},A.declareName=function(e,s,i){if(4096&s)return this.hasImport(e,!0)&&this.raise(i,"Identifier '"+e+"' has already been declared."),void this.importsStack[this.importsStack.length-1].push(e);var r=this.currentScope();if(1024&s)return this.maybeExportDefined(r,e),void r.exportOnlyBindings.push(e);t.prototype.declareName.call(this,e,s,i),0&s&&(0&s||(this.checkRedeclarationInScope(r,e,s,i),this.maybeExportDefined(r,e)),r.types.push(e)),256&s&&r.enums.push(e),512&s&&r.constEnums.push(e),128&s&&r.classes.push(e)},A.checkLocalExport=function(e){var s=e.name;if(!this.hasImport(s)){for(var i=this.scopeStack.length-1;i>=0;i--){var r=this.scopeStack[i];if(r.types.indexOf(s)>-1||r.exportOnlyBindings.indexOf(s)>-1)return}t.prototype.checkLocalExport.call(this,e)}},s=e,g=[{key:"acornTypeScript",get:function(){return n}}],(m=[{key:"acornTypeScript",get:function(){return n}}])&&a(s.prototype,m),g&&a(s,g),Object.defineProperty(s,"prototype",{writable:!1}),e}(s);return z}}export{D as default,D as tsPlugin};
@@ -0,0 +1,159 @@
1
+ import type { Parser, Node, TokenType, Position } from 'acorn';
2
+ import type { Options } from 'acorn';
3
+ export declare class AcornParseClass extends Parser {
4
+ options: Options & {
5
+ onComment: any;
6
+ };
7
+ pos: number;
8
+ potentialArrowAt: number;
9
+ yieldPos: number;
10
+ value: any;
11
+ containsEsc: boolean;
12
+ decoratorStack: any[];
13
+ awaitPos: number;
14
+ keywords: any;
15
+ awaitIdentPos: number;
16
+ strict: boolean;
17
+ lastTokStart: number;
18
+ lastTokEnd: number;
19
+ treatFunctionsAsVar: boolean;
20
+ inGenerator: any;
21
+ exprAllowed: boolean;
22
+ labels: any[];
23
+ scopeStack: any[];
24
+ inModule: any;
25
+ undefinedExports: any;
26
+ lastTokEndLoc: any;
27
+ lastTokStartLoc: any;
28
+ context: any[];
29
+ endLoc: any;
30
+ startLoc: any;
31
+ potentialArrowInForAwait: boolean;
32
+ constructor(options: Options, input: string, startPos?: number);
33
+ parseImport(node: Node): any;
34
+ currentScope(): any;
35
+ treatFunctionsAsVarInScope(scope: any): boolean;
36
+ declareName(name?: any, bindingType?: any, loc?: any): any;
37
+ parseImportSpecifier(): any;
38
+ parseExport(node: Node, exports: any): any;
39
+ parseExportDeclaration(node: Node): any;
40
+ parseExportSpecifiers(exports: any): any[];
41
+ parseModuleExportName(): any;
42
+ expectContextual(name: string): any;
43
+ semicolon(): any;
44
+ eat(type: TokenType): boolean;
45
+ checkExport(exports: any, name: any, pos: number): any;
46
+ unexpected(pos?: number): any;
47
+ startNode(): any;
48
+ startNodeAt(pos: number, loc: any): any;
49
+ isAsyncFunction(): boolean;
50
+ checkVariableExport(exports: any, decls: any): any;
51
+ checkUnreserved(options: {
52
+ start: number;
53
+ end: number;
54
+ name: string;
55
+ }): any;
56
+ checkLocalExport(id: any): any;
57
+ parseMaybeDefault(startPos: number, startLoc: any, left: any): any;
58
+ finishOp(type: TokenType, size: number): any;
59
+ getTokenFromCode(code: number): TokenType;
60
+ readToken_lt_gt(code: number): TokenType;
61
+ fullCharCodeAtPos(): number;
62
+ canInsertSemicolon(): boolean;
63
+ parseFunctionParams(node: any): void;
64
+ expect(type: TokenType): void;
65
+ readWord1(): string;
66
+ parseArrowExpression(node: any, param: any, isAsync?: boolean, forInit?: boolean): any;
67
+ curContext(): any;
68
+ updateContext(prevType: TokenType): any;
69
+ isContextual(name: string): boolean;
70
+ eatContextual(name: any): boolean;
71
+ parseLiteral(value: string): any;
72
+ checkLValSimple(expr: any, bindingType?: number, checkClashes?: any): any;
73
+ enterScope(flags: any): void;
74
+ exitScope(): void;
75
+ parseFunctionStatement(node: any, isAsync?: boolean, declarationPosition?: any): any;
76
+ parseObj(isPattern?: boolean, refDestructuringErrors?: any): any;
77
+ parseBindingList(close: TokenType, allowEmpty?: boolean, allowTrailingComma?: boolean, allowModifiers?: boolean): any;
78
+ parsePropertyName(prop: any): any;
79
+ isLet(context?: any): boolean;
80
+ parseTemplateElement({ isTagged }: {
81
+ isTagged: boolean;
82
+ }): any;
83
+ parseExpression(forInit?: boolean, refDestructuringErrors?: any): any;
84
+ initFunction(node: any): void;
85
+ parseFunctionBody(node: any, isArrowFunction?: boolean, isMethod?: boolean, forInit?: boolean): any;
86
+ parseSubscripts(base: any, startPos: number, startLoc: Position, noCalls?: any, forInit?: any): any;
87
+ parseSpread(refDestructuringErrors: any): any;
88
+ parseExprList(close: TokenType, allowTrailingComma?: any, allowEmpty?: any, refDestructuringErrors?: any): any;
89
+ parseExprOp(left: any, leftStartPos: number, leftStartLoc: Position, minPrec?: any, forInit?: any): any;
90
+ toAssignableList(exprList: any[], isBinding?: boolean): any;
91
+ parseMaybeUnary(refExpressionErrors?: any, sawUnary?: boolean, incDec?: boolean, forInit?: boolean): any;
92
+ readRegexp(): any;
93
+ overrideContext(ctx: any): any;
94
+ isSimpleAssignTarget(expr: any): boolean;
95
+ parseExprImport(forNew?: boolean): any;
96
+ next(ignoreEscapeSequenceInKeyword?: boolean): any;
97
+ parseStatement(context: any, topLevel?: boolean, exports?: any): any;
98
+ parseExpressionStatement(node: any, expre: any): any;
99
+ shouldParseExportStatement(): boolean;
100
+ parseExprOps(forInit?: boolean, refDestructuringErrors?: any): any;
101
+ checkExpressionErrors(refDestructuringErrors: any, andThrow?: boolean): any;
102
+ parseParenItem(item: any): any;
103
+ parseClassId(node: any, isStatement?: boolean | 'nullableID'): any;
104
+ parseClassField(field: any): any;
105
+ parseClassStaticBlock(node: any): any;
106
+ isClassElementNameStart(): boolean;
107
+ parseClassElementName(element: any): any;
108
+ parseClassSuper(node: any): any;
109
+ parseVarId(decl: any, kind: 'var' | 'let' | 'const'): any;
110
+ parseMaybeAssign(forInit?: boolean, refDestructuringErrors?: any, afterLeftParse?: any): any;
111
+ toAssignable(node: any, isBinding?: boolean, refDestructuringErrors?: any): any;
112
+ curPosition(): Position;
113
+ checkPatternErrors(refDestructuringErrors?: any, isAssign?: boolean): any;
114
+ parseExprSubscripts(refDestructuringErrors?: any, forInit?: boolean): any;
115
+ checkYieldAwaitInDefaultParams(): any;
116
+ parseParenExpression(): any;
117
+ parseBindingAtom(): any;
118
+ afterTrailingComma(tokType: TokenType, notNext?: boolean): any;
119
+ parsePrivateIdent(): any;
120
+ parseExportSpecifier(exports: any): any;
121
+ parseRestBinding(): any;
122
+ parseBlock(createNewLexicalScope?: boolean, node?: any, exitStrict?: boolean): any;
123
+ enterClassBody(): any;
124
+ exitClassBody(): any;
125
+ parseIdentNode(): any;
126
+ parseVar(node: any, isFor: any, kind: any, allowMissingInitializer: any): any;
127
+ parseExportDefaultDeclaration(): any;
128
+ parseIdent(liberal?: boolean): any;
129
+ copyNode(node: any): any;
130
+ checkLValPattern(expr: any, bindingType?: number, checkClashes?: any): any;
131
+ checkLValInnerPattern(expr: any, bindingType?: number, checkClashes?: any): any;
132
+ isAsyncProp(prop: any): boolean;
133
+ shouldParseArrow(): boolean;
134
+ parseYield(forInit?: any): any;
135
+ parseProperty(isPattern?: boolean, refDestructuringErrors?: any): any;
136
+ takeDecorators(node: any): void;
137
+ parseDecorators(allowExport?: boolean): void;
138
+ parseDecorator(): any;
139
+ parseMaybeDecoratorArguments(expr: any): any;
140
+ resetStartLocationFromNode(node: Node, locationNode: Node): void;
141
+ match(type: TokenType): boolean;
142
+ canHaveLeadingDecorator(): boolean;
143
+ startNodeAtNode(type: Node): any;
144
+ readToken(code: number): any;
145
+ jsx_readToken(): any;
146
+ jsx_readString(quote: any): any;
147
+ jsx_parseText(): any;
148
+ jsx_parseElement(): any;
149
+ jsx_readWord(): any;
150
+ jsx_parseElementName(): any;
151
+ jsx_parseAttribute(): any;
152
+ finishToken(token: TokenType, val?: string): any;
153
+ parseExprAtom(refDestructuringErrors?: any, forInit?: boolean, forNew?: boolean): any;
154
+ parseImportSpecifiers(): any;
155
+ parseImportDefaultSpecifier(): any;
156
+ parseImportNamespaceSpecifier(): any;
157
+ parseImportAttributes(): any;
158
+ parseMaybeImportAttributes(node: any): any;
159
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=middleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ export declare class DestructuringErrors {
2
+ shorthandAssign: number;
3
+ trailingComma: number;
4
+ parenthesizedAssign: number;
5
+ parenthesizedBind: number;
6
+ doubleProto: number;
7
+ constructor();
8
+ }
9
+ export declare function isPrivateNameConflicted(privateNameMap: any, element: any): boolean;
10
+ export declare function checkKeyName(node: any, name: any): boolean;
@@ -0,0 +1,38 @@
1
+ export class DestructuringErrors {
2
+ constructor() {
3
+ this.shorthandAssign =
4
+ this.trailingComma =
5
+ this.parenthesizedAssign =
6
+ this.parenthesizedBind =
7
+ this.doubleProto = -1;
8
+ }
9
+ }
10
+ export function isPrivateNameConflicted(privateNameMap, element) {
11
+ const name = element.key.name;
12
+ const curr = privateNameMap[name];
13
+ let next = "true";
14
+ if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) {
15
+ next = (element.static ? "s" : "i") + element.kind;
16
+ }
17
+ // `class { get #a(){}; static set #a(_){} }` is also conflict.
18
+ if (curr === "iget" && next === "iset" ||
19
+ curr === "iset" && next === "iget" ||
20
+ curr === "sget" && next === "sset" ||
21
+ curr === "sset" && next === "sget") {
22
+ privateNameMap[name] = "true";
23
+ return false;
24
+ }
25
+ else if (!curr) {
26
+ privateNameMap[name] = next;
27
+ return false;
28
+ }
29
+ else {
30
+ return true;
31
+ }
32
+ }
33
+ export function checkKeyName(node, name) {
34
+ const { computed, key } = node;
35
+ return !computed && (key.type === "Identifier" && key.name === name ||
36
+ key.type === "Literal" && key.value === name);
37
+ }
38
+ //# sourceMappingURL=parseutil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseutil.js","sourceRoot":"","sources":["../src/parseutil.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,mBAAmB;IAO9B;QACE,IAAI,CAAC,eAAe;YAClB,IAAI,CAAC,aAAa;gBAChB,IAAI,CAAC,mBAAmB;oBACtB,IAAI,CAAC,iBAAiB;wBACpB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAA;IAC/B,CAAC;CACF;AAED,MAAM,UAAU,uBAAuB,CAAC,cAAc,EAAE,OAAO;IAC7D,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA;IAC7B,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;IAEjC,IAAI,IAAI,GAAG,MAAM,CAAA;IACjB,IAAI,OAAO,CAAC,IAAI,KAAK,kBAAkB,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,KAAK,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,EAAE;QAC7F,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAA;KACnD;IAED,+DAA+D;IAC/D,IACE,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM;QAClC,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM;QAClC,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM;QAClC,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM,EAClC;QACA,cAAc,CAAC,IAAI,CAAC,GAAG,MAAM,CAAA;QAC7B,OAAO,KAAK,CAAA;KACb;SAAM,IAAI,CAAC,IAAI,EAAE;QAChB,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;QAC3B,OAAO,KAAK,CAAA;KACb;SAAM;QACL,OAAO,IAAI,CAAA;KACZ;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAI,EAAE,IAAI;IACrC,MAAM,EAAC,QAAQ,EAAE,GAAG,EAAC,GAAG,IAAI,CAAA;IAC5B,OAAO,CAAC,QAAQ,IAAI,CAClB,GAAG,CAAC,IAAI,KAAK,YAAY,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI;QAC9C,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,GAAG,CAAC,KAAK,KAAK,IAAI,CAC7C,CAAA;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const TS_SCOPE_OTHER = 512, TS_SCOPE_TS_MODULE = 1024;
2
+ export declare const BIND_KIND_VALUE = 1, BIND_KIND_TYPE = 2, BIND_SCOPE_VAR = 4, // Var-style binding
3
+ BIND_SCOPE_LEXICAL = 8, // Let- or const-style binding
4
+ BIND_SCOPE_FUNCTION = 16, // Function declaration
5
+ BIND_SCOPE_OUTSIDE = 32, // Special case for function names as
6
+ BIND_FLAGS_NONE = 64, BIND_FLAGS_CLASS = 128, BIND_FLAGS_TS_ENUM = 256, BIND_FLAGS_TS_CONST_ENUM = 512, BIND_FLAGS_TS_EXPORT_ONLY = 1024, BIND_FLAGS_FLOW_DECLARE_FN = 2048;
7
+ export declare const BIND_CLASS: number, BIND_LEXICAL: number, BIND_VAR: number, BIND_FUNCTION: number, BIND_TS_INTERFACE: number, BIND_TS_TYPE: number, BIND_TS_ENUM: number, BIND_TS_AMBIENT: number, BIND_NONE: number, BIND_OUTSIDE: number, BIND_TS_CONST_ENUM: number, BIND_TS_NAMESPACE: number, BIND_FLOW_DECLARE_FN = 2048;
8
+ export declare type BindingTypes = typeof BIND_NONE | typeof BIND_OUTSIDE | typeof BIND_VAR | typeof BIND_LEXICAL | typeof BIND_CLASS | typeof BIND_FUNCTION | typeof BIND_TS_INTERFACE | typeof BIND_TS_TYPE | typeof BIND_TS_ENUM | typeof BIND_TS_AMBIENT | typeof BIND_TS_NAMESPACE;
9
+ export declare const CLASS_ELEMENT_FLAG_STATIC = 4, CLASS_ELEMENT_KIND_GETTER = 2, CLASS_ELEMENT_KIND_SETTER = 1, CLASS_ELEMENT_KIND_ACCESSOR: number;
10
+ export declare const CLASS_ELEMENT_STATIC_GETTER: number, CLASS_ELEMENT_STATIC_SETTER: number, CLASS_ELEMENT_INSTANCE_GETTER = 2, CLASS_ELEMENT_INSTANCE_SETTER = 1, CLASS_ELEMENT_OTHER = 0;
11
+ export declare type ClassElementTypes = typeof CLASS_ELEMENT_STATIC_GETTER | typeof CLASS_ELEMENT_STATIC_SETTER | typeof CLASS_ELEMENT_INSTANCE_GETTER | typeof CLASS_ELEMENT_INSTANCE_SETTER | typeof CLASS_ELEMENT_OTHER;
12
+ export declare const SCOPE_ARROW = 16;
@@ -0,0 +1,29 @@
1
+ // Each scope gets a bitset that may contain these flags
2
+ // prettier-ignore
3
+ export const
4
+ // Up to 0b00100000000 is reserved in acorn.
5
+ TS_SCOPE_OTHER = 0b01000000000, TS_SCOPE_TS_MODULE = 0b10000000000;
6
+ // These flags are meant to be _only_ used inside the Scope class (or subclasses).
7
+ // prettier-ignore
8
+ export const BIND_KIND_VALUE = 1, BIND_KIND_TYPE = 2,
9
+ // Used in checkLVal and declareName to determine the type of a binding
10
+ BIND_SCOPE_VAR = 4, // Var-style binding
11
+ BIND_SCOPE_LEXICAL = 8, // Let- or const-style binding
12
+ BIND_SCOPE_FUNCTION = 16, // Function declaration
13
+ BIND_SCOPE_OUTSIDE = 32, // Special case for function names as
14
+ // bound inside the function
15
+ // Misc flags
16
+ BIND_FLAGS_NONE = 64, BIND_FLAGS_CLASS = 128, BIND_FLAGS_TS_ENUM = 256, BIND_FLAGS_TS_CONST_ENUM = 512, BIND_FLAGS_TS_EXPORT_ONLY = 1024, BIND_FLAGS_FLOW_DECLARE_FN = 2048;
17
+ // These flags are meant to be _only_ used by Scope consumers
18
+ // prettier-ignore
19
+ /* = is value? | is type? | scope | misc flags */
20
+ export const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS, BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0, BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0, BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0, BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS, BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0, BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM, BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,
21
+ // These bindings don't introduce anything in the scope. They are used for assignments and
22
+ // function expressions IDs.
23
+ BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE, BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE, BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM, BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN;
24
+ // prettier-ignore
25
+ export const CLASS_ELEMENT_FLAG_STATIC = 4, CLASS_ELEMENT_KIND_GETTER = 2, CLASS_ELEMENT_KIND_SETTER = 1, CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;
26
+ // prettier-ignore
27
+ export const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC, CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC, CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER, CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER, CLASS_ELEMENT_OTHER = 0;
28
+ export const SCOPE_ARROW = 16;
29
+ //# sourceMappingURL=scopeflags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopeflags.js","sourceRoot":"","sources":["../src/scopeflags.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,kBAAkB;AAClB,MAAM,CAAC;AACL,4CAA4C;AAC5C,cAAc,GAAU,aAAa,EACrC,kBAAkB,GAAM,aAAa,CAAC;AAExC,kFAAkF;AAClF,kBAAkB;AAClB,MAAM,CAAC,MAAM,eAAe,GAAc,CAAgB,EACxD,cAAc,GAAe,CAAgB;AAC7C,uEAAuE;AACvE,cAAc,GAAe,CAAgB,EAAE,oBAAoB;AACnE,kBAAkB,GAAW,CAAgB,EAAE,8BAA8B;AAC7E,mBAAmB,GAAU,EAAgB,EAAE,uBAAuB;AACtE,kBAAkB,GAAW,EAAgB,EAAE,qCAAqC;AACpF,4BAA4B;AAC5B,aAAa;AACb,eAAe,GAAc,EAAgB,EAC7C,gBAAgB,GAAa,GAAgB,EAC7C,kBAAkB,GAAW,GAAgB,EAC7C,wBAAwB,GAAK,GAAgB,EAC7C,yBAAyB,GAAI,IAAgB,EAC7C,0BAA0B,GAAG,IAAgB,CAAC;AAEhD,6DAA6D;AAC7D,kBAAkB;AAClB,8GAA8G;AAC9G,MAAM,CAAC,MAAM,UAAU,GAAW,eAAe,GAAG,cAAc,GAAG,kBAAkB,GAAI,gBAAgB,EACzG,YAAY,GAAS,eAAe,GAAG,CAAC,GAAgB,kBAAkB,GAAI,CAAC,EAC/E,QAAQ,GAAa,eAAe,GAAG,CAAC,GAAgB,cAAc,GAAQ,CAAC,EAC/E,aAAa,GAAQ,eAAe,GAAG,CAAC,GAAgB,mBAAmB,GAAG,CAAC,EAC/E,iBAAiB,GAAI,CAAC,GAAiB,cAAc,GAAG,CAAC,GAAqB,gBAAgB,EAC9F,YAAY,GAAS,CAAC,GAAiB,cAAc,GAAG,CAAC,GAAqB,CAAC,EAC/E,YAAY,GAAS,eAAe,GAAG,cAAc,GAAG,kBAAkB,GAAI,kBAAkB,EAChG,eAAe,GAAM,CAAC,GAAiB,CAAC,GAAgB,CAAC,GAAc,yBAAyB;AAChG,0FAA0F;AAC1F,4BAA4B;AAC5B,SAAS,GAAY,CAAC,GAAiB,CAAC,GAAgB,CAAC,GAAqB,eAAe,EAC7F,YAAY,GAAS,eAAe,GAAG,CAAC,GAAgB,CAAC,GAAqB,eAAe,EAE7F,kBAAkB,GAAG,YAAY,GAAG,wBAAwB,EAC5D,iBAAiB,GAAI,CAAC,GAAiB,CAAC,GAAgB,CAAC,GAAc,yBAAyB,EAEhG,oBAAoB,GAAG,0BAA0B,CAAC;AAepD,kBAAkB;AAClB,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAM,EAC7C,yBAAyB,GAAG,CAAM,EAClC,yBAAyB,GAAG,CAAM,EAClC,2BAA2B,GAAG,yBAAyB,GAAG,yBAAyB,CAAC;AAEtF,kBAAkB;AAClB,MAAM,CAAC,MAAM,2BAA2B,GAAK,yBAAyB,GAAG,yBAAyB,EAChG,2BAA2B,GAAK,yBAAyB,GAAG,yBAAyB,EACrF,6BAA6B,GAAG,yBAAyB,EACzD,6BAA6B,GAAG,yBAAyB,EACzD,mBAAmB,GAAa,CAAC,CAAC;AASpC,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { AcornTypeScript } from './types';
2
+ export declare function generateAcornTypeScript(_acorn: any): AcornTypeScript;