Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 | 3146x | var t=require("acorn");function e(t){Eif(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:function(){return t[s]}})}}),e.default=t,e}var s=/*#__PURE__*/e(require("charcodes"));function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function r(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 a(t,e){var s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];Eif(s)return(s=s.call(t)).next.bind(s);if(Array.isArray(t)||(s=function(t,e){if(t){if("string"==typeof t)return r(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)?r(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 n=!0;function o(e,s){return void 0===s&&(s={}),new t.TokenType("name",s)}var p={as:o(0,{startsExpr:n}),assert:o(0,{startsExpr:n}),async:o(0,{startsExpr:n}),await:o(0,{startsExpr:n}),from:o(0,{startsExpr:n}),get:o(0,{startsExpr:n}),let:o(0,{startsExpr:n}),meta:o(0,{startsExpr:n}),of:o(0,{startsExpr:n}),sent:o(0,{startsExpr:n}),set:o(0,{startsExpr:n}),static:o(0,{startsExpr:n}),yield:o(0,{startsExpr:n}),asserts:o(0,{startsExpr:n}),checks:o(0,{startsExpr:n}),exports:o(0,{startsExpr:n}),global:o(0,{startsExpr:n}),implements:o(0,{startsExpr:n}),intrinsic:o(0,{startsExpr:n}),infer:o(0,{startsExpr:n}),is:o(0,{startsExpr:n}),mixins:o(0,{startsExpr:n}),proto:o(0,{startsExpr:n}),require:o(0,{startsExpr:n}),keyof:o(0,{startsExpr:n}),readonly:o(0,{startsExpr:n}),unique:o(0,{startsExpr:n}),abstract:o(0,{startsExpr:n}),declare:o(0,{startsExpr:n}),enum:o(0,{startsExpr:n}),module:o(0,{startsExpr:n}),namespace:o(0,{startsExpr:n}),interface:o(0,{startsExpr:n}),type:o(0,{startsExpr:n}),opaque:o(0,{startsExpr:n})},h={jsxTagStart:new t.TokenType("jsxTagStart",{startsExpr:n})},c=new RegExp("^(?:"+Object.keys(p).join("|")+")$"),l=new RegExp("(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*","y"),u=new RegExp("(?=("+l.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),d=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 y(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 m(t,e){var s=t.key;return!t.computed&&("Identifier"===s.type&&s.name===e||"Literal"===s.type&&s.value===e)}var T={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+"')."},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.",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."},f=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function k(t){Iif(!t)throw new Error("Assert fail")}function x(e,s,i){void 0===i&&(i=e.length);for(var r=s;r<i;r++){var a=e.charCodeAt(r);if(t.isNewLine(a))return r<i-1&&13===a&&10===e.charCodeAt(r+1)?r+2:r+1}return-1}function P(t){return"in"===t||"out"===t}function v(t,e){return 2|(t?4:0)|(e?8:0)}function b(t){if("MemberExpression"!==t.type)return!1;var e=t.property;return(!t.computed||!("TemplateLiteral"!==e.type||e.expressions.length>0))&&A(t.object)}function A(t){return"Identifier"===t.type||"MemberExpression"===t.type&&!t.computed&&A(t.object)}function S(t){return"private"===t||"public"===t||"protected"===t}function g(t){return Boolean(t.startsExpr)}function C(e){return[t.tokTypes.name].concat(Object.values(t.keywordTypes),Object.values(p)).includes(e)}function I(e){return[].concat(Object.values(p),[t.tokTypes.name]).includes(e)}function N(t){return[p.keyof,p.readonly,p.unique].includes(t)}function E(e){return e===t.tokTypes.invalidTemplate}exports.default=function(e){var r=e||{},n=r.dts,o=void 0!==n&&n,l=r.disallowAmbiguousJSXLike,A=void 0!==l&&l;return function(e){/*#__PURE__*/return function(e){var r,n;function l(t,s,i){var r;return(r=e.call(this,t,s,i)||this).isLookahead=!1,r.isAmbientContext=!1,r.inAbstractClass=!1,r.inType=!1,r.inDisallowConditionalTypesContext=!1,r.maybeInArrowParameters=!1,r.canStartJSXElement=!1,r}n=e,(r=l).prototype=Object.create(n.prototype),r.prototype.constructor=r,i(r,n);var L=l.prototype;return L.getTokenFromCode=function(i){if(this.inType){Iif(i===s.greaterThan)return this.finishOp(t.tokTypes.relational,1);Iif(i===s.lessThan)return this.finishOp(t.tokTypes.relational,1)}return e.prototype.getTokenFromCode.call(this,i)},L.isAbstractClass=function(){return this.ts_isContextual(p.abstract)&&this.lookahead().type===t.tokTypes._class},L.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}},L.setOptionalParametersError=function(t,e){var s;t.optionalParametersLoc=null!=(s=null==e?void 0:e.loc)?s:this.startLoc},L.reScan_lt_gt=function(){this.type===t.tokTypes.relational&&(this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos()))},L.reScan_lt=function(){var e=this.type;return e===t.tokTypes.bitShift?(this.pos-=2,this.finishOp(t.tokTypes.relational,1),t.tokTypes.relational):e},L.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)},L.startNodeAtNode=function(t){return e.prototype.startNodeAt.call(this,t.start,t.loc.start)},L.nextTokenStart=function(){return this.nextTokenStartSince(this.pos)},L.tsHasSomeModifiers=function(t,e){return e.some(function(e){return S(e)?t.accessibility===e:!!t[e]})},L.tsIsStartOfStaticBlocks=function(){return this.ts_isContextual(p.static)&&this.lookaheadCharCode()===s.leftCurlyBrace},L.tsCheckForInvalidTypeCasts=function(t){var e=this;t.forEach(function(t){"TSTypeCastExpression"===(null==t?void 0:t.type)&&e.raise(t.typeAnnotation.start,T.UnexpectedTypeAnnotation)})},L.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},L.tsIsIdentifier=function(){return I(this.type)},L.tsTryParseTypeOrTypePredicateAnnotation=function(){return this.match(t.tokTypes.colon)?this.tsParseTypeOrTypePredicateAnnotation(t.tokTypes.colon):void 0},L.tsTryParseGenericAsyncArrowFunction=function(s,i,r){var a=this;if(this.match(t.tokTypes.relational)){var n=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;var o=this.tsTryParseAndCatch(function(){var r=a.startNodeAt(s,i);return r.typeParameters=a.tsParseTypeParameters(),e.prototype.parseFunctionParams.call(a,r),r.returnType=a.tsTryParseTypeOrTypePredicateAnnotation(),a.expect(t.tokTypes.arrow),r});if(this.maybeInArrowParameters=n,o)return e.prototype.parseArrowExpression.call(this,o,null,!0,r)}},L.tsParseTypeArgumentsInExpression=function(){if(this.reScan_lt()===t.tokTypes.relational)return this.tsParseTypeArguments()},L.tsInNoContext=function(t){var e=this.context;this.context=[e[0]];try{return t()}finally{this.context=e}},L.tsTryParseTypeAnnotation=function(){return this.match(t.tokTypes.colon)?this.tsParseTypeAnnotation():void 0},L.isUnparsedContextual=function(e,s){var i=e+s.length;Iif(this.input.slice(e,i)===s){var r=this.input.charCodeAt(i);return!(t.isIdentifierChar(r)||55296==(64512&r))}return!1},L.isAbstractConstructorSignature=function(){return this.ts_isContextual(p.abstract)&&this.lookahead().type===t.tokTypes._new},L.nextTokenStartSince=function(t){return f.lastIndex=t,f.test(this.input)?f.lastIndex:t},L.lookaheadCharCode=function(){return this.input.charCodeAt(this.nextTokenStart())},L.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},L.createLookaheadState=function(){this.value=null,this.context=[this.curContext()]},L.getCurLookaheadState=function(){return{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}},L.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,curLine:this.curLine,lineStart:this.lineStart,curPosition:this.curPosition}},L.setLookaheadState=function(t){this.pos=t.pos,this.value=t.value,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},L.tsLookAhead=function(t){var e=this.getCurLookaheadState(),s=t();return this.setLookaheadState(e),s},L.lookahead=function(){var t=this.getCurLookaheadState();this.createLookaheadState(),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;var e=this.getCurLookaheadState();return this.setLookaheadState(t),e},L.readWord=function(){var e=this.readWord1(),s=t.tokTypes.name;return this.keywords.test(e)?s=t.keywordTypes[e]:new RegExp(c).test(e)&&(s=p[e]),this.finishToken(s,e)},L.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=x(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())},L.skipLineComment=function(e){var s,i=this.pos;this.isLookahead||(s=this.options.onComment&&this.curPosition());for(var r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!t.isNewLine(r);)r=this.input.charCodeAt(++this.pos);this.isLookahead||this.options.onComment&&this.options.onComment(!1,this.input.slice(i+e,this.pos),i,this.pos,s,this.curPosition())},L.finishToken=function(t,e){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)},L.resetStartLocation=function(t,e,s){t.start=e,t.loc.start=s,this.options.ranges&&(t.range[0]=e)},L.isLineTerminator=function(){return this.eat(t.tokTypes.semi)||e.prototype.canInsertSemicolon.call(this)},L.hasFollowingLineBreak=function(){return u.lastIndex=this.end,u.test(this.input)},L.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})}},L.isLiteralPropertyName=function(){return e=this.type,[t.tokTypes.name,t.tokTypes.string,t.tokTypes.num].concat(Object.values(t.keywordTypes),Object.values(p)).includes(e);var e},L.hasPrecedingLineBreak=function(){return t.lineBreak.test(this.input.slice(this.lastTokEndLoc.index,this.start))},L.createIdentifier=function(t,e){return t.name=e,this.finishNode(t,"Identifier")},L.resetStartLocationFromNode=function(t,e){this.resetStartLocation(t,e.start,e.loc.start)},L.isThisParam=function(t){return"Identifier"===t.type&&"this"===t.name},L.isLookaheadContextual=function(t){var e=this.nextTokenStart();return this.isUnparsedContextual(e,t)},L.ts_isContextual=function(t){return this.type===t&&!this.containsEsc},L.isContextual=function(t){return"let"===t?this.ts_isContextual(p.let):e.prototype.isContextual.call(this,t)},L.tsIsStartOfMappedType=function(){return this.next(),this.eat(t.tokTypes.plusMin)?this.ts_isContextual(p.readonly):(this.ts_isContextual(p.readonly)&&this.next(),!!this.match(t.tokTypes.bracketL)&&(this.next(),!!this.tsIsIdentifier()&&(this.next(),this.match(t.tokTypes._in))))},L.tsInDisallowConditionalTypesContext=function(t){var e=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return t()}finally{this.inDisallowConditionalTypesContext=e}},L.ts_type_isContextual=function(t,e){return t===e&&!this.containsEsc},L.tsTryParseType=function(){return this.tsEatThenParseType(t.tokTypes.colon)},L.match=function(t){return this.type===t},L.eatContextual=function(t){Eif(c.test(t))return!!this.ts_isContextual(p[t])&&(this.next(),!0);e.prototype.eatContextual.call(this,t)},L.tsIsExternalModuleReference=function(){return this.ts_isContextual(p.require)&&this.lookaheadCharCode()===s.leftParenthesis},L.tsParseExternalModuleReference=function(){var e=this.startNode();return this.expectContextual("require"),this.expect(t.tokTypes.parenL),this.match(t.tokTypes.string)||this.unexpected(),e.expression=this.parseExprAtom(),this.expect(t.tokTypes.parenR),this.finishNode(e,"TSExternalModuleReference")},L.tsParseEntityName=function(e){void 0===e&&(e=!0);for(var s=this.parseIdent(e);this.eat(t.tokTypes.dot);){var i=this.startNodeAtNode(s);i.left=s,i.right=this.parseIdent(e),s=this.finishNode(i,"TSQualifiedName")}return s},L.tsParseEnumMember=function(){var e=this.startNode();return e.id=this.match(t.tokTypes.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(t.tokTypes.eq)&&(e.initializer=this.parseMaybeAssign()),this.finishNode(e,"TSEnumMember")},L.tsParseEnumDeclaration=function(e,s){return void 0===s&&(s={}),s.const&&(e.const=!0),s.declare&&(e.declare=!0),this.expectContextual("enum"),e.id=this.parseIdent(),this.checkLValSimple(e.id),this.expect(t.tokTypes.braceL),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(t.tokTypes.braceR),this.finishNode(e,"TSEnumDeclaration")},L.tsParseModuleBlock=function(){var s=this.startNode();for(e.prototype.enterScope.call(this,0),this.expect(t.tokTypes.braceL),s.body=[];this.type!==t.tokTypes.braceR;){var i=this.parseStatement(null,!0);s.body.push(i)}return this.next(),e.prototype.exitScope.call(this),this.finishNode(s,"TSModuleBlock")},L.tsParseAmbientExternalModuleDeclaration=function(s){return this.ts_isContextual(p.global)?(s.global=!0,s.id=this.parseIdent()):this.match(t.tokTypes.string)?s.id=this.parseLiteral(this.value):this.unexpected(),this.match(t.tokTypes.braceL)?(e.prototype.enterScope.call(this,256),s.body=this.tsParseModuleBlock(),e.prototype.exitScope.call(this)):e.prototype.semicolon.call(this),this.finishNode(s,"TSModuleDeclaration")},L.tsTryParseDeclare=function(e){var s=this;Eif(!this.isLineTerminator()){var i,r=this.type;return this.ts_isContextual(p.let)&&(r=t.tokTypes._var,i="let"),this.tsInAmbientContext(function(){Iif(r===t.tokTypes._function)return e.declare=!0,s.parseFunctionStatement(e,!1,!0);Iif(r===t.tokTypes._class)return e.declare=!0,s.parseClass(e,!0);Iif(r===p.enum)return s.tsParseEnumDeclaration(e,{declare:!0});Iif(r===p.global)return s.tsParseAmbientExternalModuleDeclaration(e);Iif(r===t.tokTypes._const||r===t.tokTypes._var)return s.match(t.tokTypes._const)&&s.isLookaheadContextual("enum")?(s.expect(t.tokTypes._const),s.tsParseEnumDeclaration(e,{const:!0,declare:!0})):(e.declare=!0,s.parseVarStatement(e,i||s.value,!0));Iif(r===p.interface){var a=s.tsParseInterfaceDeclaration(e,{declare:!0});if(a)return a}return I(r)?s.tsParseDeclaration(e,s.value,!0):void 0})}},L.tsIsListTerminator=function(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(t.tokTypes.braceR);case"HeritageClauseElement":return this.match(t.tokTypes.braceL);case"TupleElementTypes":return this.match(t.tokTypes.bracketR);case"TypeParametersOrArguments":return this.match(t.tokTypes.relational)}throw new Error("Unreachable")},L.tsParseDelimitedListWorker=function(e,s,i,r){for(var a=[],n=-1;!this.tsIsListTerminator(e);){n=-1;var o=s();Iif(null==o)return;if(a.push(o),!this.eat(t.tokTypes.comma)){Eif(this.tsIsListTerminator(e))break;return void(i&&this.expect(t.tokTypes.comma))}n=this.lastTokStart}return r&&(r.value=n),a},L.tsParseDelimitedList=function(t,e,s){return function(t){Iif(null==t)throw new Error("Unexpected "+t+" value.");return t}(this.tsParseDelimitedListWorker(t,e,!0,s))},L.tsParseBracketedList=function(e,s,i,r,a){r||this.expect(i?t.tokTypes.bracketL:t.tokTypes.relational);var n=this.tsParseDelimitedList(e,s,a);return this.expect(i?t.tokTypes.bracketR:t.tokTypes.relational),n},L.tsParseTypeParameterName=function(){return this.parseIdent().name},L.tsEatThenParseType=function(t){return this.match(t)?this.tsNextThenParseType():void 0},L.tsExpectThenParseType=function(t){var e=this;return this.tsDoThenParseType(function(){return e.expect(t)})},L.tsNextThenParseType=function(){var t=this;return this.tsDoThenParseType(function(){return t.next()})},L.tsDoThenParseType=function(t){var e=this;return this.tsInType(function(){return t(),e.tsParseType()})},L.tsSkipParameterStart=function(){if(I(this.type)||this.match(t.tokTypes._this))return this.next(),!0;if(this.match(t.tokTypes.braceL))try{return this.parseObj(!0),!0}catch(t){return!1}if(this.match(t.tokTypes.bracketL)){this.next();try{return this.parseBindingList(t.tokTypes.bracketR,!0,!0),!0}catch(t){return!1}}return!1},L.tsIsUnambiguouslyStartOfFunctionType=function(){if(this.next(),this.match(t.tokTypes.parenR)||this.match(t.tokTypes.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(t.tokTypes.colon)||this.match(t.tokTypes.comma)||this.match(t.tokTypes.question)||this.match(t.tokTypes.eq))return!0;if(this.match(t.tokTypes.parenR)&&(this.next(),this.match(t.tokTypes.arrow)))return!0}return!1},L.tsIsStartOfFunctionType=function(){return!!this.match(t.tokTypes.relational)||this.match(t.tokTypes.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))},L.tsInAllowConditionalTypesContext=function(t){var e=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return t()}finally{this.inDisallowConditionalTypesContext=e}},L.tsParseBindingListForSignature=function(){var s=this;return e.prototype.parseBindingList.call(this,t.tokTypes.parenR,!0,!0).map(function(t){return"Identifier"!==t.type&&"RestElement"!==t.type&&"ObjectPattern"!==t.type&&"ArrayPattern"!==t.type&&s.raise(t.loc.start,T.UnsupportedSignatureParameterKind(t.type)),t})},L.tsParseTypePredicateAsserts=function(){Eif(this.type!==p.asserts)return!1;var e=this.containsEsc;return this.next(),!(!I(this.type)&&!this.match(t.tokTypes._this)||(e&&this.raise(this.lastTokStart,"Escape sequence in keyword asserts"),0))},L.tsParseThisTypeNode=function(){var t=this.startNode();return this.next(),this.finishNode(t,"TSThisType")},L.tsParseTypeAnnotation=function(e,s){var i=this;return void 0===e&&(e=!0),void 0===s&&(s=this.startNode()),this.tsInType(function(){e&&i.expect(t.tokTypes.colon),s.typeAnnotation=i.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")},L.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")},L.tsParseThisTypeOrThisTypePredicate=function(){var t=this.tsParseThisTypeNode();return this.ts_isContextual(p.is)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(t):t},L.tsParseTypePredicatePrefix=function(){var t=this.parseIdent();Iif(this.ts_isContextual(p.is)&&!this.hasPrecedingLineBreak())return this.next(),t},L.tsParseTypeOrTypePredicateAnnotation=function(e){var s=this;return this.tsInType(function(){var i=s.startNode();s.expect(e);var r=s.startNode(),a=!!s.tsTryParse(s.tsParseTypePredicateAsserts.bind(s));Iif(a&&s.match(t.tokTypes._this)){var n=s.tsParseThisTypeOrThisTypePredicate();return"TSThisType"===n.type?(r.parameterName=n,r.asserts=!0,r.typeAnnotation=null,n=s.finishNode(r,"TSTypePredicate")):(s.resetStartLocationFromNode(n,r),n.asserts=!0),i.typeAnnotation=n,s.finishNode(i,"TSTypeAnnotation")}var o=s.tsIsIdentifier()&&s.tsTryParse(s.tsParseTypePredicatePrefix.bind(s));Eif(!o)return a?(r.parameterName=s.parseIdent(),r.asserts=a,r.typeAnnotation=null,i.typeAnnotation=s.finishNode(r,"TSTypePredicate"),s.finishNode(i,"TSTypeAnnotation")):s.tsParseTypeAnnotation(!1,i);var p=s.tsParseTypeAnnotation(!1);return r.parameterName=o,r.typeAnnotation=p,r.asserts=a,i.typeAnnotation=s.finishNode(r,"TSTypePredicate"),s.finishNode(i,"TSTypeAnnotation")})},L.tsFillSignature=function(e,s){var i=e===t.tokTypes.arrow;s.typeParameters=this.tsTryParseTypeParameters(),this.expect(t.tokTypes.parenL),s.parameters=this.tsParseBindingListForSignature(),(i||this.match(e))&&(s.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(e))},L.tsTryNextParseConstantContext=function(){if(this.lookahead().type!==t.tokTypes._const)return null;this.next();var e=this.tsParseTypeReference();return e.typeParameters&&this.raise(e.typeName.start,T.CannotFindName({name:"const"})),e},L.tsParseFunctionOrConstructorType=function(e,s){var i=this,r=this.startNode();return"TSConstructorType"===e&&(r.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(function(){return i.tsFillSignature(t.tokTypes.arrow,r)}),this.finishNode(r,e)},L.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]},L.tsCheckTypeAnnotationForReadOnly=function(t){switch(t.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(t.start,T.UnexpectedReadonly)}},L.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")},L.tsParseConstraintForInferType=function(){var e=this;if(this.eat(t.tokTypes._extends)){var s=this.tsInDisallowConditionalTypesContext(function(){return e.tsParseType()});if(this.inDisallowConditionalTypesContext||!this.match(t.tokTypes.question))return s}},L.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")},L.tsParseLiteralTypeNode=function(){var e=this,s=this.startNode();return s.literal=function(){switch(e.type){case t.tokTypes.num:case t.tokTypes.string:case t.tokTypes._true:case t.tokTypes._false:return e.parseExprAtom();default:e.unexpected()}}(),this.finishNode(s,"TSLiteralType")},L.tsParseImportType=function(){var e=this.startNode();return this.expect(t.tokTypes._import),this.expect(t.tokTypes.parenL),this.match(t.tokTypes.string)||this.raise(this.start,T.UnsupportedImportTypeArgument),e.argument=this.parseExprAtom(),this.expect(t.tokTypes.parenR),this.eat(t.tokTypes.dot)&&(e.qualifier=this.tsParseEntityName()),this.match(t.tokTypes.relational)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")},L.tsParseTypeQuery=function(){var e=this.startNode();return this.expect(t.tokTypes._typeof),e.exprName=this.match(t.tokTypes._import)?this.tsParseImportType():this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(t.tokTypes.relational)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")},L.tsParseMappedTypeParameter=function(){var e=this.startNode();return e.name=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(t.tokTypes._in),this.finishNode(e,"TSTypeParameter")},L.tsParseMappedType=function(){var e=this.startNode();return this.expect(t.tokTypes.braceL),this.match(t.tokTypes.plusMin)?(e.readonly=this.value,this.next(),this.expectContextual("readonly")):this.eatContextual("readonly")&&(e.readonly=!0),this.expect(t.tokTypes.bracketL),e.typeParameter=this.tsParseMappedTypeParameter(),e.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(t.tokTypes.bracketR),this.match(t.tokTypes.plusMin)?(e.optional=this.value,this.next(),this.expect(t.tokTypes.question)):this.eat(t.tokTypes.question)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(t.tokTypes.braceR),this.finishNode(e,"TSMappedType")},L.tsParseTypeLiteral=function(){var t=this.startNode();return t.members=this.tsParseObjectTypeMembers(),this.finishNode(t,"TSTypeLiteral")},L.tsParseTupleElementType=function(){var e=this.startLoc,s=this.start,i=this.eat(t.tokTypes.ellipsis),r=this.tsParseType(),a=this.eat(t.tokTypes.question);if(this.eat(t.tokTypes.colon)){var n=this.startNodeAtNode(r);n.optional=a,"TSTypeReference"!==r.type||r.typeParameters||"Identifier"!==r.typeName.type?(this.raise(r.start,T.InvalidTupleMemberLabel),n.label=r):n.label=r.typeName,n.elementType=this.tsParseType(),r=this.finishNode(n,"TSNamedTupleMember")}else if(a){var o=this.startNodeAtNode(r);o.typeAnnotation=r,r=this.finishNode(o,"TSOptionalType")}if(i){var p=this.startNodeAt(s,e);p.typeAnnotation=r,r=this.finishNode(p,"TSRestType")}return r},L.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,T.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,T.MixedLabeledAndUnlabeledElements)}),this.finishNode(e,"TSTupleType")},L.tsParseTemplateLiteralType=function(){var t=this.startNode();return t.literal=this.parseTemplate({isTagged:!1}),this.finishNode(t,"TSLiteralType")},L.tsParseTypeReference=function(){var e=this.startNode();return e.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(t.tokTypes.relational)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")},L.tsParseParenthesizedType=function(){var e=this.startNode();return this.expect(t.tokTypes.parenL),e.typeAnnotation=this.tsParseType(),this.expect(t.tokTypes.parenR),this.finishNode(e,"TSParenthesizedType")},L.tsParseNonArrayType=function(){switch(this.type){case t.tokTypes.string:case t.tokTypes.num:case t.tokTypes._true:case t.tokTypes._false:return this.tsParseLiteralTypeNode();case t.tokTypes.plusMin:if("-"===this.value){var e=this.startNode();return this.lookahead().type!==t.tokTypes.num&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case t.tokTypes._this:return this.tsParseThisTypeOrThisTypePredicate();case t.tokTypes._typeof:return this.tsParseTypeQuery();case t.tokTypes._import:return this.tsParseImportType();case t.tokTypes.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case t.tokTypes.bracketL:return this.tsParseTupleType();case t.tokTypes.parenL:return this.tsParseParenthesizedType();case t.tokTypes.backQuote:case t.tokTypes.dollarBraceL:return this.tsParseTemplateLiteralType();default:var i=this.type;Eif(I(i)||i===t.tokTypes._void||i===t.tokTypes._null){var r=i===t.tokTypes._void?"TSVoidKeyword":i===t.tokTypes._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!==r&&this.lookaheadCharCode()!==s.dot){var a=this.startNode();return this.next(),this.finishNode(a,r)}return this.tsParseTypeReference()}}this.unexpected()},L.tsParseArrayTypeOrHigher=function(){for(var e=this.tsParseNonArrayType();!this.hasPrecedingLineBreak()&&this.eat(t.tokTypes.bracketL);)Eif(this.match(t.tokTypes.bracketR)){var s=this.startNodeAtNode(e);s.elementType=e,this.expect(t.tokTypes.bracketR),e=this.finishNode(s,"TSArrayType")}else{var i=this.startNodeAtNode(e);i.objectType=e,i.indexType=this.tsParseType(),this.expect(t.tokTypes.bracketR),e=this.finishNode(i,"TSIndexedAccessType")}return e},L.tsParseTypeOperatorOrHigher=function(){var t=this;return N(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.ts_isContextual(p.infer)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(function(){return t.tsParseArrayTypeOrHigher()})},L.tsParseIntersectionTypeOrHigher=function(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),t.tokTypes.bitwiseAND)},L.tsParseUnionTypeOrHigher=function(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),t.tokTypes.bitwiseOR)},L.tsParseNonConditionalType=function(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(t.tokTypes._new)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()},L.tsParseType=function(){var e=this;k(this.inType);var s=this.tsParseNonConditionalType();Eif(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(t.tokTypes._extends))return s;var i=this.startNodeAtNode(s);return i.checkType=s,i.extendsType=this.tsInDisallowConditionalTypesContext(function(){return e.tsParseNonConditionalType()}),this.expect(t.tokTypes.question),i.trueType=this.tsInAllowConditionalTypesContext(function(){return e.tsParseType()}),this.expect(t.tokTypes.colon),i.falseType=this.tsInAllowConditionalTypesContext(function(){return e.tsParseType()}),this.finishNode(i,"TSConditionalType")},L.tsIsUnambiguouslyIndexSignature=function(){return this.next(),!!I(this.type)&&(this.next(),this.match(t.tokTypes.colon))},L.tsInType=function(t){var e=this.inType;this.inType=!0;try{return t()}finally{this.inType=e}},L.tsTryParseIndexSignature=function(e){Iif(this.match(t.tokTypes.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))){this.expect(t.tokTypes.bracketL);var s=this.parseIdent();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(t.tokTypes.bracketR),e.parameters=[s];var i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}},L.tsParseNoneModifiers=function(t){this.tsParseModifiers({modified:t,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:T.InvalidModifierOnTypeParameterPositions})},L.tsParseTypeParameter=function(e){void 0===e&&(e=this.tsParseNoneModifiers.bind(this));var s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(t.tokTypes._extends),s.default=this.tsEatThenParseType(t.tokTypes.eq),this.finishNode(s,"TSTypeParameter")},L.tsParseTypeParameters=function(e){var s=this.startNode();this.match(t.tokTypes.relational)||this.match(h.jsxTagStart)?this.next():this.unexpected();var i={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,i),0===s.params.length&&this.raise(this.start,T.EmptyTypeParameters),-1!==i.value&&this.addExtra(s,"trailingComma",i.value),this.finishNode(s,"TSTypeParameterDeclaration")},L.tsTryParseTypeParameters=function(e){Iif(this.match(t.tokTypes.relational))return this.tsParseTypeParameters(e)},L.tsTryParse=function(t){var e=this.getCurLookaheadState(),s=t();return void 0!==s&&!1!==s?s:void this.setLookaheadState(e)},L.tsTokenCanFollowModifier=function(){return(this.match(t.tokTypes.bracketL)||this.match(t.tokTypes.braceL)||this.match(t.tokTypes.star)||this.match(t.tokTypes.ellipsis)||this.match(t.tokTypes.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()},L.tsNextTokenCanFollowModifier=function(){return this.next(),this.tsTokenCanFollowModifier()},L.tsParseModifier=function(e,s){Eif(I(this.type)||this.type===t.tokTypes._in){var i=this.value;if(-1!==e.indexOf(i)){Iif(s&&this.tsIsStartOfStaticBlocks())return;Eif(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return i}}},L.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?T.InvalidModifierOnTypeMember:n,p=function(t,i,r,a){i===r&&s[a]&&e.raise(t.column,T.InvalidModifiersOrder({orderedModifiers:[r,a]}))},h=function(t,i,r,a){(s[r]&&i===a||s[a]&&i===r)&&e.raise(t.column,T.IncompatibleModifiers({modifiers:[r,a]}))};;){var c=this.startLoc,l=this.tsParseModifier(i.concat(null!=r?r:[]),a);if(!l)break;S(l)?s.accessibility?this.raise(this.start,T.DuplicateAccessibilityModifier()):(p(c,l,l,"override"),p(c,l,l,"static"),p(c,l,l,"readonly"),s.accessibility=l):P(l)?(s[l]&&this.raise(this.start,T.DuplicateModifier({modifier:l})),s[l]=!0,p(c,l,"in","out")):(Object.hasOwnProperty.call(s,l)?this.raise(this.start,T.DuplicateModifier({modifier:l})):(p(c,l,"static","readonly"),p(c,l,"static","override"),p(c,l,"override","readonly"),p(c,l,"abstract","override"),h(c,l,"declare","override"),h(c,l,"static","abstract")),s[l]=!0),null!=r&&r.includes(l)&&this.raise(this.start,o)}},L.tsParseInOutModifiers=function(t){this.tsParseModifiers({modified:t,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:T.InvalidModifierOnTypeParameter})},L.tsParseTypeArguments=function(){var e=this,s=this.startNode();return s.params=this.tsInType(function(){return e.tsInNoContext(function(){return e.expect(t.tokTypes.relational),e.tsParseDelimitedList("TypeParametersOrArguments",e.tsParseType.bind(e))})}),0===s.params.length&&this.raise(this.start,T.EmptyTypeArguments),this.expect(t.tokTypes.relational),this.finishNode(s,"TSTypeParameterInstantiation")},L.tsParseHeritageClause=function(e){var s=this,i=this.start,r=this.tsParseDelimitedList("HeritageClauseElement",function(){var e=s.startNode();return e.expression=s.tsParseEntityName(),s.match(t.tokTypes.relational)&&(e.typeParameters=s.tsParseTypeArguments()),s.finishNode(e,"TSExpressionWithTypeArguments")});return r.length||this.raise(i,T.EmptyHeritageClauseType({token:e})),r},L.tsParseTypeMemberSemicolon=function(){this.eat(t.tokTypes.comma)||this.isLineTerminator()||this.expect(t.tokTypes.semi)},L.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},L.tsParseSignatureMember=function(e,s){return this.tsFillSignature(t.tokTypes.colon,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)},L.tsParsePropertyOrMethodSignature=function(e,s){this.eat(t.tokTypes.question)&&(e.optional=!0);var i=e;Iif(this.match(t.tokTypes.parenL)||this.match(t.tokTypes.relational)){s&&this.raise(e.start,T.ReadonlyForMethodSignature);var r=i;r.kind&&this.match(t.tokTypes.relational)&&this.raise(this.start,T.AccesorCannotHaveTypeParameters),this.tsFillSignature(t.tokTypes.colon,r),this.tsParseTypeMemberSemicolon();var a="parameters",n="typeAnnotation";if("get"===r.kind)r[a].length>0&&(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(r[a][0])&&this.raise(this.start,T.AccesorCannotDeclareThisParameter));else if("set"===r.kind){if(1!==r[a].length)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{var o=r[a][0];this.isThisParam(o)&&this.raise(this.start,T.AccesorCannotDeclareThisParameter),"Identifier"===o.type&&o.optional&&this.raise(this.start,T.SetAccesorCannotHaveOptionalParameter),"RestElement"===o.type&&this.raise(this.start,T.SetAccesorCannotHaveRestParameter)}r[n]&&this.raise(r[n].start,T.SetAccesorCannotHaveReturnType)}else r.kind="method";return this.finishNode(r,"TSMethodSignature")}var p=i;s&&(p.readonly=!0);var h=this.tsTryParseTypeAnnotation();return h&&(p.typeAnnotation=h),this.tsParseTypeMemberSemicolon(),this.finishNode(p,"TSPropertySignature")},L.tsParseTypeMember=function(){var e=this.startNode();Iif(this.match(t.tokTypes.parenL)||this.match(t.tokTypes.relational))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);Iif(this.match(t.tokTypes._new)){var s=this.startNode();return this.next(),this.match(t.tokTypes.parenL)||this.match(t.tokTypes.relational)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(s,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers({modified:e,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]}),this.tsTryParseIndexSignature(e)||(this.parsePropertyName(e),e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||!this.tsTokenCanFollowModifier()||(e.kind=e.key.name,this.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))},L.tsParseList=function(t,e){for(var s=[];!this.tsIsListTerminator(t);)s.push(e());return s},L.tsParseObjectTypeMembers=function(){this.expect(t.tokTypes.braceL);var e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(t.tokTypes.braceR),e},L.tsParseInterfaceDeclaration=function(e,s){Iif(void 0===s&&(s={}),this.hasFollowingLineBreak())return null;this.expectContextual("interface"),s.declare&&(e.declare=!0),I(this.type)?(e.id=this.parseIdent(),this.checkLValSimple(e.id,130)):(e.id=null,this.raise(this.start,T.MissingInterfaceName)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(t.tokTypes._extends)&&(e.extends=this.tsParseHeritageClause("extends"));var i=this.startNode();return i.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(i,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")},L.tsParseAbstractDeclaration=function(e){Eif(this.match(t.tokTypes._class))return e.abstract=!0,this.parseClass(e,!0);if(this.ts_isContextual(p.interface)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,t.tokTypes._class)},L.tsIsDeclarationStart=function(){return[p.abstract,p.declare,p.enum,p.module,p.namespace,p.interface,p.type].includes(this.type)},L.tsParseExpressionStatement=function(s,i){switch(i.name){case"declare":var r=this.tsTryParseDeclare(s);Eif(r)return r.declare=!0,r;break;case"global":if(this.match(t.tokTypes.braceL)){e.prototype.enterScope.call(this,256);var a=s;return a.global=!0,a.id=i,a.body=this.tsParseModuleBlock(),e.prototype.exitScope.call(this),this.finishNode(a,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(s,i.name,!1)}},L.tsParseModuleReference=function(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)},L.tsIsExportDefaultSpecifier=function(){var e=this.type,i=this.isAsyncFunction(),r=this.isLet();if(I(e)){if(i&&!this.containsEsc||r)return!1;if((e===p.type||e===p.interface)&&!this.containsEsc){var a=this.lookahead().type;if(I(a)&&a!==p.from||a===t.tokTypes.braceL)return!1}}else if(!this.match(t.tokTypes._default))return!1;var n=this.nextTokenStart(),o=this.isUnparsedContextual(n,"from");if(this.input.charCodeAt(n)===s.comma||I(this.type)&&o)return!0;if(this.match(t.tokTypes._default)&&o){var h=this.input.charCodeAt(this.nextTokenStartSince(n+4));return h===s.quotationMark||h===s.apostrophe}return!1},L.tsInAmbientContext=function(t){var e=this.isAmbientContext;this.isAmbientContext=!0;try{return t()}finally{this.isAmbientContext=e}},L.tsCheckLineTerminator=function(t){return t?!this.hasFollowingLineBreak()&&(this.next(),!0):!this.isLineTerminator()},L.tsParseModuleOrNamespaceDeclaration=function(s,i){Iif(void 0===i&&(i=!1),s.id=this.parseIdent(),i||this.checkLValSimple(s.id,1024),this.eat(t.tokTypes.dot)){var r=this.startNode();this.tsParseModuleOrNamespaceDeclaration(r,!0),s.body=r}else e.prototype.enterScope.call(this,256),s.body=this.tsParseModuleBlock(),e.prototype.exitScope.call(this);return this.finishNode(s,"TSModuleDeclaration")},L.tsParseTypeAliasDeclaration=function(e){var s=this;return e.id=this.parseIdent(),this.checkLValSimple(e.id,2),e.typeAnnotation=this.tsInType(function(){Iif(e.typeParameters=s.tsTryParseTypeParameters(s.tsParseInOutModifiers.bind(s)),s.expect(t.tokTypes.eq),s.ts_isContextual(p.interface)&&s.lookahead().type!==t.tokTypes.dot){var i=s.startNode();return s.next(),s.finishNode(i,"TSIntrinsicKeyword")}return s.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")},L.tsParseDeclaration=function(e,s,i){switch(s){case"abstract":Eif(this.tsCheckLineTerminator(i)&&(this.match(t.tokTypes._class)||I(this.type)))return this.tsParseAbstractDeclaration(e);break;case"module":Eif(this.tsCheckLineTerminator(i)){Eif(this.match(t.tokTypes.string))return this.tsParseAmbientExternalModuleDeclaration(e);if(I(this.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":Eif(this.tsCheckLineTerminator(i)&&I(this.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":Eif(this.tsCheckLineTerminator(i)&&I(this.type))return this.tsParseTypeAliasDeclaration(e)}},L.tsTryParseExportDeclaration=function(){return this.tsParseDeclaration(this.startNode(),this.value,!0)},L.tsParseImportEqualsDeclaration=function(s,i){s.isExport=i||!1,s.id=this.parseIdent(),this.checkLValSimple(s.id,9),e.prototype.expect.call(this,t.tokTypes.eq);var r=this.tsParseModuleReference();return"type"===s.importKind&&"TSExternalModuleReference"!==r.type&&this.raise(r.start,T.ImportAliasHasImportType),s.moduleReference=r,e.prototype.semicolon.call(this),this.finishNode(s,"TSImportEqualsDeclaration")},L.isExportDefaultSpecifier=function(){if(this.tsIsDeclarationStart())return!1;var e=this.type;if(I(e)){if(e===p.async&&!this.containsEsc||e===p.let)return!1;if((e===p.type||e===p.interface)&&!this.containsEsc){var i=this.lookahead().type;if(I(i)&&i!==p.from||i===t.tokTypes.braceL)return!1}}else if(!this.match(t.tokTypes._default))return!1;var r=this.nextTokenStart(),a=this.isUnparsedContextual(r,"from");if(this.input.charCodeAt(r)===s.comma||I(this.type)&&a)return!0;if(this.match(t.tokTypes._default)&&a){var n=this.input.charCodeAt(this.nextTokenStartSince(r+4));return n===s.quotationMark||n===s.apostrophe}return!1},L.parseTemplate=function(e){var s=(void 0===e?{}:e).isTagged,i=void 0!==s&&s,r=this.startNode();this.next(),r.expressions=[];var a=this.parseTemplateElement({isTagged:i});for(r.quasis=[a];!a.tail;)this.type===t.tokTypes.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(t.tokTypes.dollarBraceL),r.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(t.tokTypes.braceR),r.quasis.push(a=this.parseTemplateElement({isTagged:i}));return this.next(),this.finishNode(r,"TemplateLiteral")},L.parseFunction=function(e,s,i,r,a){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===t.tokTypes.star&&s&&this.unexpected(),e.generator=this.eat(t.tokTypes.star)),this.options.ecmaVersion>=8&&(e.async=!!r),s&&(e.id=s&&this.type!==t.tokTypes.name?null:this.parseIdent(),e.id&&!s&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var n=this.yieldPos,o=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(v(e.async,e.generator)),s||(e.id=this.type===t.tokTypes.name?this.parseIdent():null),this.parseFunctionParams(e);var h=this.parseFunctionBodyAndFinish(e,s?"FunctionDeclaration":"FunctionExpression",!1,a);return this.yieldPos=n,this.awaitPos=o,this.awaitIdentPos=p,h},L.parseFunctionBodyAndFinish=function(e,s,i,r){void 0===i&&(i=!1),void 0===r&&(r=!1),this.match(t.tokTypes.colon)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(t.tokTypes.colon));var a="FunctionDeclaration"===s?"TSDeclareFunction":"ClassMethod"===s||"ClassPrivateMethod"===s?"TSDeclareMethod":void 0;return a&&!this.match(t.tokTypes.braceL)&&this.isLineTerminator()?this.finishNode(e,a):"TSDeclareFunction"===a&&this.isAmbientContext&&(this.raise(e.start,T.DeclareFunctionHasImplementation),e.declare)?(this.parseFunctionBody(e,!1,i,!1),this.finishNode(e,a)):(this.parseFunctionBody(e,!1,i,r),this.finishNode(e,s))},L.parseNew=function(){var e;this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var s=this.startNode(),i=this.parseIdent(!0);Iif(this.options.ecmaVersion>=6&&this.eat(t.tokTypes.dot)){s.meta=i;var r=this.containsEsc;return s.property=this.parseIdent(!0),"target"!==s.property.name&&this.raiseRecoverable(s.property.start,"The only valid meta property for new is 'new.target'"),r&&this.raiseRecoverable(s.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(s.start,"'new.target' can only be used in functions and class static block"),this.finishNode(s,"MetaProperty")}var a=this.start,n=this.startLoc,o=this.type===t.tokTypes._import;s.callee=this.parseSubscripts(this.parseExprAtom(),a,n,!0,!1),o&&"ImportExpression"===s.callee.type&&this.raise(a,"Cannot use new with import()");var p=s.callee;return"TSInstantiationExpression"!==p.type||null!=(e=p.extra)&&e.parenthesized||(s.typeParameters=p.typeParameters,s.callee=p.expression),s.arguments=this.eat(t.tokTypes.parenL)?this.parseExprList(t.tokTypes.parenR,this.options.ecmaVersion>=8,!1):[],this.finishNode(s,"NewExpression")},L.parseExprOp=function(s,i,r,a,n){Iif(t.tokTypes._in.binop>a&&!this.hasPrecedingLineBreak()&&this.ts_isContextual(p.as)){var o=this.startNodeAt(i,r);o.expression=s;var h=this.tsTryNextParseConstantContext();return o.typeAnnotation=h||this.tsNextThenParseType(),this.finishNode(o,"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(o,i,r,a,n)}return e.prototype.parseExprOp.call(this,s,i,r,a)},L.parseImport=function(s){if(this.next(),s.importKind="value",I(this.type)||this.match(t.tokTypes.star)||this.match(t.tokTypes.braceL)){var i=this.lookahead();Iif(this.ts_type_isContextual(this.type,p.type)&&i.type!==t.tokTypes.comma&&i.type!==p.from&&i.type!==t.tokTypes.eq&&(s.importKind="type",this.next(),i=this.lookahead()),I(this.type)&&i.type===t.tokTypes.eq)return this.tsParseImportEqualsDeclaration(s)}this.type===t.tokTypes.string?(s.specifiers=[],s.source=this.parseExprAtom()):(s.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),s.source=this.type===t.tokTypes.string?this.parseExprAtom():this.unexpected()),e.prototype.semicolon.call(this);var r=this.finishNode(s,"ImportDeclaration");return"type"===r.importKind&&r.specifiers.length>1&&"ImportDefaultSpecifier"===r.specifiers[0].type&&this.raise(r.start,T.TypeImportCannotSpecifyDefaultAndNamed),r},L.parseExport=function(e,i){Iif(this.next(),this.match(t.tokTypes._import))return this.next(),this.ts_isContextual(p.type)&&this.lookaheadCharCode()!==s.equalsTo?(e.importKind="type",this.next()):e.importKind="value",this.tsParseImportEqualsDeclaration(e,!0);Iif(this.eat(t.tokTypes.eq)){var r=e;return r.expression=this.parseExpression(),this.semicolon(),this.finishNode(r,"TSExportAssignment")}Iif(this.eatContextual("as")){var n=e;return this.expectContextual(p.namespace),n.id=this.parseIdent(),this.semicolon(),this.finishNode(n,"TSNamespaceExportDeclaration")}Iif(this.ts_isContextual(p.type)&&this.lookahead().type===t.tokTypes.braceL?(this.next(),e.exportKind="type"):e.exportKind="value",this.eat(t.tokTypes.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(i,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==t.tokTypes.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(t.tokTypes._default)){Iif(this.isAbstractClass()){var o=this.startNode();return this.next(),o.abstract=!0,this.parseClass(o,!0)}Iif(this.match(p.interface)){var h=this.tsParseInterfaceDeclaration(this.startNode());if(h)return h}var c;if(this.checkExport(i,"default",this.lastTokStart),this.type===t.tokTypes._function||(c=this.isAsyncFunction())){var l=this.startNode();this.next(),c&&this.next(),e.declaration=this.parseFunction(l,5,!1,c)}else Iif(this.type===t.tokTypes._class){var u=this.startNode();e.declaration=this.parseClass(u,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(i,e.declaration.declarations):this.checkExport(i,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{Iif(e.declaration=null,e.specifiers=this.parseExportSpecifiers(i,"type"===e.exportKind),this.eatContextual("from"))this.type!==t.tokTypes.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var d,y=a(e.specifiers);!(d=y()).done;){var m=d.value;this.checkUnreserved(m.local),this.checkLocalExport(m.local),"Literal"===m.local.type&&this.raise(m.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},L.parseMaybeDefault=function(t,s,i){var r=e.prototype.parseMaybeDefault.call(this,t,s,i);return"AssignmentPattern"===r.type&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(r.typeAnnotation.loc.start,T.TypeAnnotationAfterAssign),r},L.typeCastToParameter=function(t){return t.expression.typeAnnotation=t.typeAnnotation,this.resetEndLocation(t.expression,t.typeAnnotation.end),t.expression},L.toAssignableList=function(t,s){for(var i=0;i<t.length;i++){var r=t[i];"TSTypeCastExpression"===(null==r?void 0:r.type)&&(t[i]=this.typeCastToParameter(r))}return e.prototype.toAssignableList.call(this,t,s)},L.reportReservedArrowTypeParam=function(t){var e;1!==t.params.length||null!=(e=t.extra)&&e.trailingComma||!A||this.raise(t.start,T.ReservedArrowTypeParam)},L.parseMaybeUnary=function(t,s){return e.prototype.parseMaybeUnary.call(this,t,s)},L.parseExprAtom=function(e,i){this.type===t.tokTypes.slash&&this.readRegexp();var r,a=this.potentialArrowAt===this.start;switch(this.type){case t.tokTypes._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type!==t.tokTypes.parenL||this.allowDirectSuper||this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==t.tokTypes.dot&&this.type!==t.tokTypes.bracketL&&this.type!==t.tokTypes.parenL&&this.unexpected(),this.finishNode(r,"Super");case t.tokTypes._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case t.tokTypes.name:var n=this.start,o=this.startLoc,p=this.containsEsc,h=this.parseIdent(!1);Iif(this.options.ecmaVersion>=8&&!p&&"async"===h.name&&!this.canInsertSemicolon()&&this.eat(t.tokTypes._function))return this.overrideContext(t.tokContexts.f_expr),this.parseFunction(this.startNodeAt(n,o),0,!1,!0,i);if(a&&!this.canInsertSemicolon()){Iif(this.eat(t.tokTypes.arrow))return this.parseArrowExpression(this.startNodeAt(n,o),[h],!1,i);Iif(this.options.ecmaVersion>=8&&"async"===h.name&&this.type===t.tokTypes.name&&!p&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return h=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(t.tokTypes.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,o),[h],!0,i)}return h;case t.tokTypes.regexp:var c=this.value;return(r=this.parseLiteral(c.value)).regex={pattern:c.pattern,flags:c.flags},r;case t.tokTypes.num:case t.tokTypes.string:return this.parseLiteral(this.value);case t.tokTypes._null:case t.tokTypes._true:case t.tokTypes._false:return(r=this.startNode()).value=this.type===t.tokTypes._null?null:this.type===t.tokTypes._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case t.tokTypes.parenL:var l=this.start,u=this.parseParenAndDistinguishExpression(a,i);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),u;case t.tokTypes.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(t.tokTypes.bracketR,!0,!0,e),this.tsCheckForInvalidTypeCasts(r.elements),this.finishNode(r,"ArrayExpression");case t.tokTypes.braceL:return this.overrideContext(t.tokContexts.b_expr),this.parseObj(!1,e);case t.tokTypes._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case t.tokTypes._class:return this.parseClass(this.startNode(),!1);case t.tokTypes._new:return this.parseNew();case t.tokTypes.backQuote:return this.parseTemplate();case t.tokTypes._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:Eif(I(this.type)){var d=this.potentialArrowAt===this.start,y=this.containsEsc,m=this.parseIdent();Iif(!y&&"async"===m.name&&!this.canInsertSemicolon()){var T=this.type;if(T===t.tokTypes._function)return this.next(),this.parseFunction(this.startNodeAtNode(m),void 0,!0,!0,i);if(I(T))return this.lookaheadCharCode()===s.equalsTo?(!this.canInsertSemicolon()&&this.eat(tt.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAtNode(m),[m],!0,i)):m}return d&&this.match(t.tokTypes.arrow)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(m),[m],!1,i)):m}this.unexpected()}},L.parseIdent=function(e,s){var i=this.startNode();return this.type===t.tokTypes.name||C(this.type)?i.name=this.value:this.type.keyword?(i.name=this.type.keyword,"class"!==i.name&&"function"!==i.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(i,"Identifier"),e||(this.checkUnreserved(i),"await"!==i.name||this.awaitIdentPos||(this.awaitIdentPos=i.start)),i},L.parseVar=function(e,s,i,r){for(void 0===r&&(r=!1),e.declarations=[],e.kind=i;;){var a=this.startNode();Eif(this.parseVarId(a,i),this.eat(t.tokTypes.eq)?a.init=this.parseMaybeAssign(s):r||"const"!==i||this.type===t.tokTypes._in||this.options.ecmaVersion>=6&&this.isContextual("of")?r||"Identifier"===a.id.type||s&&(this.type===t.tokTypes._in||this.isContextual("of"))?a.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(a,"VariableDeclarator")),!this.eat(t.tokTypes.comma))break}return e},L.parseVarStatement=function(t,e,s){void 0===s&&(s=!1);var i=this.isAmbientContext;this.next(),this.parseVar(t,!1,e,s||i),this.semicolon();var r=this.finishNode(t,"VariableDeclaration");if(!i)return r;for(var n,o=a(r.declarations);!(n=o()).done;){var p=n.value,h=p.init;h&&("const"!==e||p.id.typeAnnotation?this.raise(h.start,T.InitializerNotAllowedInAmbientContext):"StringLiteral"!==h.type&&"BooleanLiteral"!==h.type&&"NumericLiteral"!==h.type&&"BigIntLiteral"!==h.type&&("TemplateLiteral"!==h.type||h.expressions.length>0)&&!b(h)&&this.raise(h.start,T.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference))}return r},L.parseStatement=function(s,i,r){Iif(this.match(t.tokTypes._const)&&this.isLookaheadContextual("enum")){var a=this.startNode();return this.expect(t.tokTypes._const),this.tsParseEnumDeclaration(a,{const:!0})}if(this.ts_isContextual(p.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(p.interface)){var n=this.tsParseInterfaceDeclaration(this.startNode());Eif(n)return n}return e.prototype.parseStatement.call(this,s,i,r)},L.parseAccessModifier=function(){return this.tsParseModifier(["public","protected","private"])},L.parsePostMemberNameModifiers=function(e){this.eat(t.tokTypes.question)&&(e.optional=!0),e.readonly&&this.match(t.tokTypes.parenL)&&this.raise(e.start,T.ClassMethodHasReadonly),e.declare&&this.match(t.tokTypes.parenL)&&this.raise(e.start,T.ClassMethodHasDeclare)},L.parseExpressionStatement=function(t,s){return("Identifier"===s.type?this.tsParseExpressionStatement(t,s):void 0)||e.prototype.parseExpressionStatement.call(this,t,s)},L.shouldParseExportStatement=function(){return!!this.tsIsDeclarationStart()||e.prototype.shouldParseExportStatement.call(this)},L.parseConditional=function(e,s,i,r,a){Iif(this.eat(t.tokTypes.question)){var n=this.startNodeAt(s,i);return n.test=e,n.consequent=this.parseMaybeAssign(),this.expect(t.tokTypes.colon),n.alternate=this.parseMaybeAssign(r),this.finishNode(n,"ConditionalExpression")}return e},L.parseMaybeConditional=function(e,s){var i=this,r=this.start,a=this.startLoc,n=this.parseExprOps(e,s);Iif(this.checkExpressionErrors(s))return n;Eif(!this.maybeInArrowParameters||!this.match(t.tokTypes.question))return this.parseConditional(n,r,a,e,s);var o=this.tryParse(function(){return i.parseConditional(n,r,a,e,s)});return o.node?(o.error&&this.setLookaheadState(o.failState),o.node):(o.error&&this.setOptionalParametersError(s,o.error),n)},L.parseParenItem=function(s){var i=this.start,r=this.startLoc;if(s=e.prototype.parseParenItem.call(this,s),this.eat(t.tokTypes.question)&&(s.optional=!0,this.resetEndLocation(s)),this.match(t.tokTypes.colon)){var a=this.startNodeAt(i,r);return a.expression=s,a.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(a,"TSTypeCastExpression")}return s},L.parseExportDeclaration=function(t){var e=this;Iif(!this.isAmbientContext&&this.ts_isContextual(p.declare))return this.tsInAmbientContext(function(){return e.parseExportDeclaration(t)});var s=this.start,i=this.startLoc,r=this.eatContextual("declare");!r||!this.ts_isContextual(p.declare)&&this.shouldParseExportStatement()||this.raise(this.start,T.ExpectedAmbientAfterExportDeclare);var a=I(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},L.parseClassId=function(t,s){Eif(s||!this.ts_isContextual(p.implements)){e.prototype.parseClassId.call(this,t,s);var i=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));i&&(t.typeParameters=i)}},L.parseClassPropertyAnnotation=function(e){!e.optional&&this.eat(t.tokTypes.prefix)&&"!"===this.value&&(e.definite=!0);var s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)},L.parsePrivateClassField=function(t){return t.abstract&&this.raise(t.start,T.PrivateElementHasAbstract),t.accessibility&&this.raise(t.start,T.PrivateElementHasAccessibility({modifier:t.accessibility})),this.parseClassPropertyAnnotation(t),e.prototype.parseClassField.call(this,t)},L.parseClassField=function(s){Iif(this.parseClassPropertyAnnotation(s),this.isAmbientContext&&(!s.readonly||s.typeAnnotation)&&this.match(t.tokTypes.eq)&&this.raise(this.startLoc,T.DeclareClassFieldHasInitializer),s.abstract&&this.match(t.tokTypes.eq)){var i=s.key;this.raise(this.startLoc,T.AbstractPropertyHasInitializer({propertyName:"Identifier"!==i.type||s.computed?"["+this.input.slice(i.start,i.end)+"]":i.name}))}return e.prototype.parseClassField.call(this,s)},L.parsePrivateClassMethod=function(t,e,s,i){var r=this.tsTryParseTypeParameters();r&&(t.typeParameters=r),this.parseClassMethod(t,e,s,i,!0)},L.parseClassMethod=function(t,e,s,i,r){var a="constructor"===t.kind,n=this.tsTryParseTypeParameters();n&&a&&this.raise(n.start,T.ConstructorHasTypeParameters);var o=t.declare,p=t.kind;!(void 0!==o&&o)||"get"!==p&&"set"!==p||this.raise(t.start,T.DeclareAccessor({kind:p})),n&&(t.typeParameters=n);var h=t.key;"constructor"===t.kind?(e&&this.raise(h.start,"Constructor can't be a generator"),s&&this.raise(h.start,"Constructor can't be an async method")):t.static&&m(t,"prototype")&&this.raise(h.start,"Classes may not have a static property named prototype");var c=t.value=this.parseMethodForClass(e,s,i,r);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")},L.parseClassElementName=function(e){this.type===t.tokTypes.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},L.parseClassElement=function(s){var i=this;Iif(this.eat(t.tokTypes.semi))return null;var r=this.options.ecmaVersion,a=this.startNode(),n="",o=!1,p=!1,h="method",c=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({modified:a,allowedModifiers:c,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:T.InvalidModifierOnTypeParameterPositions});var l=!!a.static,u=function(){Eif(!i.tsIsStartOfStaticBlocks()){var u=i.tsTryParseIndexSignature(a);Iif(u)return a.abstract&&i.raise(a.start,T.IndexSignatureHasAbstract),a.accessibility&&i.raise(a.start,T.IndexSignatureHasAccessibility({modifier:a.accessibility})),a.declare&&i.raise(a.start,T.IndexSignatureHasDeclare),a.override&&i.raise(a.start,T.IndexSignatureHasOverride),u;Eif(!i.inAbstractClass&&a.abstract&&i.raise(a.start,T.NonAbstractClassHasAbstractMethod),a.override&&s&&i.raise(a.start,T.OverrideNotInSubClass),a.static=l,!n&&r>=8&&i.eatContextual("async")&&(!i.isClassElementNameStart()&&i.type!==t.tokTypes.star||i.canInsertSemicolon()?n="async":p=!0),!n&&(r>=9||!p)&&i.eat(t.tokTypes.star)&&(o=!0),!n&&!p&&!o){var d=i.value;(i.eatContextual("get")||i.eatContextual("set"))&&(i.isClassElementNameStart()?h=d:n=d)}var y=i.type===t.tokTypes.privateId;n?(a.computed=!1,a.key=i.startNodeAt(i.lastTokStart,i.lastTokStartLoc),a.key.name=n,i.finishNode(a.key,"Identifier")):i.parseClassElementName(a);var f=i.match(t.tokTypes.relational)||i.match(t.tokTypes.parenL);if(r<13||f||"method"!==h||o||p){var k=!a.static&&m(a,"constructor"),x=k&&s;k&&"method"!==h&&i.raise(a.key.start,"Constructor can't have get/set modifier"),a.kind=k?"constructor":h,i.parsePostMemberNameModifiers(a),y?i.parsePrivateClassMethod(a,o,p,x):i.parseClassMethod(a,o,p,x,!1)}else i.parsePostMemberNameModifiers(a),y?i.parsePrivateClassField(a):i.parseClassField(a);return a}if(i.next(),i.next(),i.tsHasSomeModifiers(a,c)&&i.raise(i.start,T.StaticBlockCannotHaveModifier),r>=13)return e.prototype.parseClassStaticBlock.call(i,a),a};return a.declare?this.tsInAmbientContext(u):u(),a},L.parseClassSuper=function(s){e.prototype.parseClassSuper.call(this,s),s.superClass&&(this.match(t.tokTypes.relational)||this.match(t.tokTypes.bitShift))&&(s.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual("implements")&&(s.implements=this.tsParseHeritageClause("implements"))},L.parseFunctionParams=function(t){var s=this.tsTryParseTypeParameters();s&&(t.typeParameters=s),e.prototype.parseFunctionParams.call(this,t)},L.parseVarId=function(s,i){e.prototype.parseVarId.call(this,s,i),"Identifier"===s.id.type&&!this.hasPrecedingLineBreak()&&this.eat(t.tokTypes.prefix)&&"!"===this.value&&(s.definite=!0);var r=this.tsTryParseTypeAnnotation();r&&(s.id.typeAnnotation=r,this.resetEndLocation(s.id))},L.parseArrowExpression=function(s,i,r,a){return this.match(t.tokTypes.colon)&&(s.returnType=this.tsParseTypeAnnotation()),e.prototype.parseArrowExpression.call(this,s,i,r,a)},L.parseMaybeAssign=function(s,i,r){var a,n,o,p,h,c,l=this;Eif(!this.match(t.tokTypes.relational))return e.prototype.parseMaybeAssign.call(this,s,i,r);p&&!this.compareLookaheadState(p,this.getCurLookaheadState())||(p=this.cloneCurLookaheadState());var u=this.tryParse(function(t){var a,n;c=l.tsParseTypeParameters();var o=e.prototype.parseMaybeAssign.call(l,s,i,r);return("ArrowFunctionExpression"!==o.type||null!=(a=o.extra)&&a.parenthesized)&&t(),0!==(null==(n=c)?void 0:n.params.length)&&l.resetStartLocationFromNode(o,c),o.typeParameters=c,o},p);if(!u.error&&!u.aborted)return c&&this.reportReservedArrowTypeParam(c),u.node;if(k(!0),!(h=this.tryParse(function(){return e.prototype.parseMaybeAssign.call(l,s,i,r)},p)).error)return h.node;if(u.node)return this.setLookaheadState(u.failState),c&&this.reportReservedArrowTypeParam(c),u.node;if(null!=(a=h)&&a.node)return this.setLookaheadState(h.failState),h.node;if(u.thrown)throw u.error;if(null!=(n=h)&&n.thrown)throw h.error;throw u.error||(null==(o=h)?void 0:o.error)},L.parseArrow=function(e){var s=this;Iif(this.match(t.tokTypes.colon)){var i=this.tryParse(function(e){var i=s.tsParseTypeOrTypePredicateAnnotation(t.tokTypes.colon);return!s.canInsertSemicolon()&&s.match(t.tokTypes.arrow)||e(),i});if(i.aborted)return;i.thrown||(i.error&&this.setLookaheadState(i.failState),e.returnType=i.node)}Eif(this.eat(t.tokTypes.arrow))return e},L.parseAssignableListItem=function(t){var e,s=this.start,i=this.startLoc,r=!1,a=!1;Eif(void 0!==t){var n={};this.tsParseModifiers({modified:n,allowedModifiers:["public","private","protected","override","readonly"]}),e=n.accessibility,a=n.override,r=n.readonly,!1===t&&(e||r||a)&&this.raise(i.start,T.UnexpectedParameterModifier)}var o=this.parseMaybeDefault(s,i);this.parseBindingListItem(o);var p=this.parseMaybeDefault(o.start,o.loc,o);Iif(e||r||a){var h=this.startNodeAt(s,i);return e&&(h.accessibility=e),r&&(h.readonly=r),a&&(h.override=a),"Identifier"!==p.type&&"AssignmentPattern"!==p.type&&this.raise(h.start,T.UnsupportedParameterPropertyKind),h.parameter=p,this.finishNode(h,"TSParameterProperty")}return p},L.parseBindingListItem=function(e){this.eat(t.tokTypes.question)&&("Identifier"===e.type||this.isAmbientContext||this.inType||this.raise(e.start,T.PatternIsOptional),e.optional=!0);var s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e},L.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"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}},L.toAssignable=function(t,s,i){switch(void 0===s&&(s=!1),void 0===i&&(i=new d),t.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(t,s,i);case"TSAsExpression":case"TSNonNullExpression":case"TSTypeAssertion":return s||this.raise(t.start,T.UnexpectedTypeCastInParameter),this.toAssignable(t.expression,s,i);case"AssignmentExpression":return s||"TSTypeCastExpression"!==t.left.type||(t.left=this.typeCastToParameter(t.left)),t;default:return e.prototype.toAssignable.call(this,t,s,i)}},L.toAssignableParenthesizedExpression=function(t,s,i){switch(t.expression.type){case"TSAsExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":return this.toAssignable(t.expression,s,i);default:return e.prototype.toAssignable.call(this,t,s,i)}},L.curPosition=function(){Eif(this.options.locations){var s=e.prototype.curPosition.call(this);return Object.defineProperty(s,"offset",{get:function(){return function(e){var s=new t.Parser.acorn.Position(this.line,this.column+e);return s.index=this.index+e,s}}}),s.index=this.pos,s}},L.parseBindingAtom=function(){return this.type===t.tokTypes._this?this.parseIdent(!0):e.prototype.parseBindingAtom.call(this)},L.parseParenAndDistinguishExpression=function(e,i){var r,a=this,n=this.start,o=this.startLoc,p=this.options.ecmaVersion>=8;Eif(this.options.ecmaVersion>=6){this.next();var h,c=this.start,l=this.startLoc,u=[],y=!0,m=!1,T=new d,f=this.yieldPos,k=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==t.tokTypes.parenR;){if(y?y=!1:this.expect(t.tokTypes.comma),p&&this.afterTrailingComma(t.tokTypes.parenR,!0)){m=!0;break}if(this.type===t.tokTypes.ellipsis){h=this.start,u.push(this.parseParenItem(this.parseRestBinding())),(a.isAmbientContext&&a.match(t.tokTypes.comma)&&a.lookaheadCharCode()===s.rightParenthesis?(a.next(),0):a.match(t.tokTypes.comma))&&this.raise(this.start,"Comma is not permitted after the rest element");break}u.push(this.parseMaybeAssign(!1,T,this.parseParenItem))}var x=this.lastTokEnd,P=this.lastTokEndLoc;this.expect(t.tokTypes.parenR);var v=a.match(t.tokTypes.colon)?u.every(function(t){return a.isAssignable(t,!0)}):!a.canInsertSemicolon(),b=this.startNodeAt(n,o);Eif(e&&v&&(b=this.parseArrow(b)))return this.checkPatternErrors(T,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=k,this.parseArrowExpression(b,u,!1,i);u.length&&!m||this.unexpected(this.lastTokStart),h&&this.unexpected(h),this.checkExpressionErrors(T,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=k||this.awaitPos,u.length>1?((r=this.startNodeAt(c,l)).expressions=u,this.finishNodeAt(r,"SequenceExpression",x,P)):r=u[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var A=this.startNodeAt(n,o);return A.expression=r,this.finishNode(A,"ParenthesizedExpression")}return r},L.parseTaggedTemplateExpression=function(t,e,s,i){var r=this.startNodeAt(e,s);return r.tag=t,r.quasi=this.parseTemplate(!0),i&&this.raise(s.start,"Tagged Template Literals are not allowed in optionalChain."),this.finishNode(r,"TaggedTemplateExpression")},L.parseSubscript=function(e,i,r,a,n,o,p){var h=this,c=o;Iif(!this.hasPrecedingLineBreak()&&this.match(t.tokTypes.prefix)&&"!"===this.value){this.canStartJSXElement=!1,this.next();var l=this.startNodeAt(i,r);return l.expression=e,e=this.finishNode(l,"TSNonNullExpression")}var u=!1;Iif(this.match(t.tokTypes.questionDot)&&this.lookaheadCharCode()===s.lessThan){if(a)return e;e.optional=!0,c=u=!0,this.next()}Iif(this.match(t.tokTypes.relational)||this.match(t.tokTypes.bitShift)){var y,m=this.tsTryParseAndCatch(function(){if(!a&&h.atPossibleAsyncArrow(e)){var s=h.tsTryParseGenericAsyncArrowFunction(i,r,p);if(s)return e=s}var n=h.tsParseTypeArgumentsInExpression();if(!n)return e;if(u&&!h.match(t.tokTypes.parenL))return y=h.curPosition(),e;if(E(h.type)){var o=h.parseTaggedTemplateExpression(e,i,r,c);return o.typeParameters=n,e=o}if(!a&&h.eat(t.tokTypes.parenL)){var l=new d,m=h.startNodeAt(i,r);return m.callee=e,m.arguments=h.parseExprList(t.tokTypes.parenR,h.options.ecmaVersion>=8,!1,l),h.tsCheckForInvalidTypeCasts(m.arguments),m.typeParameters=n,c&&(m.optional=u),h.checkExpressionErrors(l,!0),e=h.finishNode(m,"CallExpression")}var T=h.type;if(T===t.tokTypes.relational||T===t.tokTypes.bitShift||T!==t.tokTypes.parenL&&g(T)&&!h.hasPrecedingLineBreak())return e;var f=h.startNodeAt(i,r);return f.expression=e,f.typeParameters=n,e=h.finishNode(f,"TSInstantiationExpression")});if(y&&this.unexpected(y),m)return"TSInstantiationExpression"===m.type&&(this.match(t.tokTypes.dot)||this.match(t.tokTypes.questionDot)&&this.lookaheadCharCode()!==s.leftParenthesis)&&this.raise(this.startLoc.start,T.InvalidPropertyAccessAfterInstantiationExpression),e=m}var f=this.options.ecmaVersion>=11,k=f&&this.eat(t.tokTypes.questionDot);a&&k&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var x=this.eat(t.tokTypes.bracketL);if(x||k&&this.type!==t.tokTypes.parenL&&this.type!==t.tokTypes.backQuote||this.eat(t.tokTypes.dot)){var P=this.startNodeAt(i,r);P.object=e,x?(P.property=this.parseExpression(),this.expect(t.tokTypes.bracketR)):P.property=this.type===t.tokTypes.privateId&&"Super"!==e.type?this.parsePrivateIdent():this.parseIdent("never"!==this.options.allowReserved),P.computed=!!x,f&&(P.optional=k),e=this.finishNode(P,"MemberExpression")}else if(!a&&this.eat(t.tokTypes.parenL)){var v=new d,b=this.yieldPos,A=this.awaitPos,S=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var C=this.parseExprList(t.tokTypes.parenR,this.options.ecmaVersion>=8,!1,v),I=h.match(t.tokTypes.colon)||!h.canInsertSemicolon()&&h.eat(t.tokTypes.arrow);Iif(n&&!k&&I)return this.checkPatternErrors(v,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=b,this.awaitPos=A,this.awaitIdentPos=S,this.parseArrowExpression(this.startNodeAt(i,r),C,!0,p);this.checkExpressionErrors(v,!0),this.yieldPos=b||this.yieldPos,this.awaitPos=A||this.awaitPos,this.awaitIdentPos=S||this.awaitIdentPos;var N=this.startNodeAt(i,r);N.callee=e,N.arguments=C,f&&(N.optional=k),e=this.finishNode(N,"CallExpression")}else Iif(this.type===t.tokTypes.backQuote){(k||c)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var L=this.startNodeAt(i,r);L.tag=e,L.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(L,"TaggedTemplateExpression")}return e},L.parsePropertyValue=function(e,s,i,r,a,n,o,p){var h=this.tsTryParseTypeParameters();Eif(h&&(e.typeParameters=h),(i||r)&&this.type===t.tokTypes.colon&&this.unexpected(),this.eat(t.tokTypes.colon))e.value=s?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===t.tokTypes.parenL)s&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,r);else if(s||p||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===t.tokTypes.comma||this.type===t.tokTypes.braceR||this.type===t.tokTypes.eq)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=a),e.kind="init",s?e.value=this.parseMaybeDefault(a,n,this.copyNode(e.key)):this.type===t.tokTypes.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(a,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected();else{(i||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var c="get"===e.kind?0:1,l=e.value.params[0],u=l&&this.isThisParam(l);e.value.params.length!==(c=u?c+1:c)?this.raiseRecoverable(e.value.start,"get"===e.kind?"getter should have no params":"setter should have exactly one param"):"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},L.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===t.tokTypes._catch){var s=this.startNode();if(this.next(),this.eat(t.tokTypes.parenL)){var i=this.parseBindingAtom(),r="Identifier"===i.type;this.enterScope(r?8:0),this.checkLValPattern(i,r?4:2);var a=this.tsTryParseTypeAnnotation();a&&(i.typeAnnotation=a,this.resetEndLocation(i)),s.param=i,this.expect(t.tokTypes.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),s.param=null,this.enterScope(0);s.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(s,"CatchClause")}return e.finalizer=this.eat(t.tokTypes._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},L.parseClass=function(e,s){var i=this.inAbstractClass;this.inAbstractClass=!!e.abstract;try{this.next();var r=this.strict;this.strict=!0,this.parseClassId(e,s),this.parseClassSuper(e);var a=this.enterClassBody(),n=this.startNode();for(n.body=[],this.expect(t.tokTypes.braceL);this.type!==t.tokTypes.braceR;){var o=this.parseClassElement(null!==e.superClass);o&&(n.body.push(o),"MethodDefinition"===o.type&&"constructor"===o.kind||o.key&&"PrivateIdentifier"===o.key.type&&y(a,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=r,this.next(),e.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(e,s?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=i}},L.parseBindingList=function(e,s,i){for(var r=[],a=!0;!this.eat(e);)Iif(a?a=!1:this.expect(t.tokTypes.comma),s&&this.match(t.tokTypes.comma))r.push(null);else{Iif(i&&this.afterTrailingComma(e))break;Iif(this.match(t.tokTypes.ellipsis)){var n=this.parseRestBinding();this.parseBindingListItem(n),r.push(n),this.type===t.tokTypes.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}r.push(this.parseAssignableListItem(!1))}return r},L.parseMethod=function(e,s,i){var r=this.startNode(),a=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|v(s,r.generator)|(i?128:0)),this.expect(t.tokTypes.parenL),r.params=this.parseBindingList(t.tokTypes.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams();var p=this.parseFunctionBodyAndFinish(r,"FunctionExpression",!0);this.yieldPos=a,this.awaitPos=n,this.awaitIdentPos=o;var h=p;if(h.abstract&&h.body){var c=h.key;this.raise(h.start,T.AbstractMethodHasImplementation("Identifier"!==c.type||h.computed?"["+this.input.slice(c.start,c.end)+"]":c.name))}return h},L.parseMethodForClass=function(e,s,i,r){var a=this.startNode(),n=this.yieldPos,o=this.awaitPos,p=this.awaitIdentPos;this.initFunction(a),this.options.ecmaVersion>=6&&(a.generator=e),this.options.ecmaVersion>=8&&(a.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|v(s,a.generator)|(i?128:0)),this.expect(t.tokTypes.parenL),a.params=this.parseBindingList(t.tokTypes.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams();var h=this.parseFunctionBodyAndFinish(a,r?"ClassPrivateMethod":"ClassMethod",!0);this.yieldPos=n,this.awaitPos=o,this.awaitIdentPos=p;var c=h;Iif(c.abstract&&c.body){var l=c.key;this.raise(c.start,T.AbstractMethodHasImplementation("Identifier"!==l.type||c.computed?"["+this.input.slice(l.start,l.end)+"]":l.name))}return c},l.parse=function(t,e){var s=new this(e,t);return o&&(s.isAmbientContext=!0),s.parse()},l.parseExpressionAt=function(t,e,s){var i=new this(s,t,e);return o&&(i.isAmbientContext=!0),i.nextToken(),i.parseExpressionAt()},L.parseImportSpecifiers=function(){var s=[],i=!0;if(this.type===t.tokTypes.name){var r=this.startNode();if(r.local=this.parseIdent(),this.checkLValSimple(r.local,2),s.push(this.finishNode(r,"ImportDefaultSpecifier")),!e.prototype.eat.call(this,t.tokTypes.comma))return s}if(this.type===t.tokTypes.star){var a=this.startNode();return this.next(),this.expectContextual("as"),a.local=this.parseIdent(),this.checkLValSimple(a.local,2),s.push(this.finishNode(a,"ImportNamespaceSpecifier")),s}for(e.prototype.expect.call(this,t.tokTypes.braceL);!this.eat(t.tokTypes.braceR);){if(i)i=!1;else Iif(this.expect(t.tokTypes.comma),this.afterTrailingComma(t.tokTypes.braceR))break;var n=this.startNode(),o=this.ts_isContextual(p.type);n.imported=this.parseModuleExportName(),o?(this.parseTypeOnlyImportExportSpecifier(n,!0,"type"===n.importKind),s.push(this.finishNode(n,"ImportSpecifier"))):(n.importKind="value",this.eatContextual("as")?n.local=e.prototype.parseIdent.call(this):(this.checkUnreserved(n.imported),n.local=n.imported),this.checkLValSimple(n.local,2),s.push(this.finishNode(n,"ImportSpecifier")))}return s},L.parseExportSpecifiers=function(e,s){void 0===s&&(s=!1);var i=[],r=!0;for(this.expect(t.tokTypes.braceL);!this.eat(t.tokTypes.braceR);){if(r)r=!1;else Iif(this.expect(t.tokTypes.comma),this.afterTrailingComma(t.tokTypes.braceR))break;var a=this.ts_isContextual(p.type),n=this.match(t.tokTypes.string),o=this.startNode();o.local=this.parseModuleExportName(),!n&&a?(this.parseTypeOnlyImportExportSpecifier(o,!1,s),this.finishNode(o,"ExportSpecifier")):(o.exportKind="value",o.exported=this.eatContextual("as")?this.parseModuleExportName():this.copyNode(o.local),this.finishNode(o,"ExportSpecifier")),this.checkExport(e,o.exported,o.exported.start),i.push(o)}return i},L.parseTypeOnlyImportExportSpecifier=function(t,s,i){var r,a=s?"imported":"local",n=s?"local":"exported",o=t[a],h=!1,c=!0,l=o.loc.start;if(this.ts_isContextual(p.as)){var u=this.parseIdent();Iif(this.isContextual(p.as)){var d=this.parseIdent();C(this.type)?(h=!0,o=u,r=s?this.parseIdent():this.parseModuleExportName(),c=!1):(r=d,c=!1)}else C(this.type)?(c=!1,r=s?this.parseIdent():this.parseModuleExportName()):(h=!0,o=u)}else C(this.type)&&(h=!0,s?(o=e.prototype.parseIdent.call(this,!0),this.ts_isContextual(p.as)||this.checkUnreserved(o)):o=this.parseModuleExportName());h&&i&&this.raise(l,s?T.TypeModifierIsUsedInTypeImports:T.TypeModifierIsUsedInTypeExports),t[a]=o,t[n]=r,t[s?"importKind":"exportKind"]=h?"type":"value",c&&this.eatContextual("as")&&(t[n]=s?this.parseIdent():this.parseModuleExportName()),t[n]||(t[n]=this.copyNode(t[a])),s&&this.checkLValSimple(t[n],9)},l}(e)}},exports.skipWhiteSpace=f,exports.tokenCanStartExpression=g,exports.tokenIsTSTypeOperator=N,exports.tokenIsTemplate=E;
//# sourceMappingURL=index.js.map
|