react-code-locator 0.2.7 → 0.2.9
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.
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +21 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -21
- package/dist/index.js.map +1 -1
- package/dist/unplugin.cjs +3 -3
- package/dist/unplugin.cjs.map +1 -1
- package/dist/unplugin.js +3 -3
- package/dist/unplugin.js.map +1 -1
- package/dist/webpack.cjs.map +1 -1
- package/dist/webpack.js.map +1 -1
- package/package.json +1 -1
package/dist/unplugin.cjs
CHANGED
|
@@ -26,9 +26,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
26
26
|
`:`\r
|
|
27
27
|
`):L=String.fromCharCode(N),this.options.locations&&(++this.curLine,this.lineStart=this.pos),L},A.jsx_readString=function(w){for(var L="",N=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var G=this.input.charCodeAt(this.pos);if(G===w)break;G===38?(L+=this.input.slice(N,this.pos),L+=this.jsx_readEntity(),N=this.pos):r(G)?(L+=this.input.slice(N,this.pos),L+=this.jsx_readNewLine(!1),N=this.pos):++this.pos}return L+=this.input.slice(N,this.pos++),this.finishToken(P.string,L)},A.jsx_readEntity=function(){var w,L="",N=0,G=this.input[this.pos];G!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");for(var Q=++this.pos;this.pos<this.input.length&&N++<10;){if((G=this.input[this.pos++])===";"){L[0]==="#"?L[1]==="x"?(L=L.substr(2),Xc.test(L)&&(w=String.fromCharCode(parseInt(L,16)))):(L=L.substr(1),Jc.test(L)&&(w=String.fromCharCode(parseInt(L,10)))):w=Kc[L];break}L+=G}return w||(this.pos=Q,"&")},A.jsx_readWord=function(){var w,L=this.pos;do w=this.input.charCodeAt(++this.pos);while(o(w)||w===45);return this.finishToken(b.jsxName,this.input.slice(L,this.pos))},A.jsx_parseIdentifier=function(){var w=this.startNode();return this.type===b.jsxName?w.name=this.value:this.type.keyword?w.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(w,"JSXIdentifier")},A.jsx_parseNamespacedName=function(){var w=this.start,L=this.startLoc,N=this.jsx_parseIdentifier();if(!f.allowNamespaces||!this.eat(P.colon))return N;var G=this.startNodeAt(w,L);return G.namespace=N,G.name=this.jsx_parseIdentifier(),this.finishNode(G,"JSXNamespacedName")},A.jsx_parseElementName=function(){if(this.type===b.jsxTagEnd)return"";var w=this.start,L=this.startLoc,N=this.jsx_parseNamespacedName();for(this.type!==P.dot||N.type!=="JSXNamespacedName"||f.allowNamespacedObjects||this.unexpected();this.eat(P.dot);){var G=this.startNodeAt(w,L);G.object=N,G.property=this.jsx_parseIdentifier(),N=this.finishNode(G,"JSXMemberExpression")}return N},A.jsx_parseAttributeValue=function(){switch(this.type){case P.braceL:var w=this.jsx_parseExpressionContainer();return w.expression.type==="JSXEmptyExpression"&&this.raise(w.start,"JSX attributes must only be assigned a non-empty expression"),w;case b.jsxTagStart:case P.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}},A.jsx_parseEmptyExpression=function(){var w=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(w,"JSXEmptyExpression",this.start,this.startLoc)},A.jsx_parseExpressionContainer=function(){var w=this.startNode();return this.next(),w.expression=this.type===P.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(P.braceR),this.finishNode(w,"JSXExpressionContainer")},A.jsx_parseAttribute=function(){var w=this.startNode();return this.eat(P.braceL)?(this.expect(P.ellipsis),w.argument=this.parseMaybeAssign(),this.expect(P.braceR),this.finishNode(w,"JSXSpreadAttribute")):(w.name=this.jsx_parseNamespacedName(),w.value=this.eat(P.eq)?this.jsx_parseAttributeValue():null,this.finishNode(w,"JSXAttribute"))},A.jsx_parseOpeningElementAt=function(w,L){var N=this.startNodeAt(w,L);N.attributes=[];var G=this.jsx_parseElementName();for(G&&(N.name=G);this.type!==P.slash&&this.type!==b.jsxTagEnd;)N.attributes.push(this.jsx_parseAttribute());return N.selfClosing=this.eat(P.slash),this.expect(b.jsxTagEnd),this.finishNode(N,G?"JSXOpeningElement":"JSXOpeningFragment")},A.jsx_parseClosingElementAt=function(w,L){var N=this.startNodeAt(w,L),G=this.jsx_parseElementName();return G&&(N.name=G),this.expect(b.jsxTagEnd),this.finishNode(N,G?"JSXClosingElement":"JSXClosingFragment")},A.jsx_parseElementAt=function(w,L){var N=this.startNodeAt(w,L),G=[],Q=this.jsx_parseOpeningElementAt(w,L),B=null;if(!Q.selfClosing){e:for(;;)switch(this.type){case b.jsxTagStart:if(w=this.start,L=this.startLoc,this.next(),this.eat(P.slash)){B=this.jsx_parseClosingElementAt(w,L);break e}G.push(this.jsx_parseElementAt(w,L));break;case b.jsxText:G.push(this.parseExprAtom());break;case P.braceL:G.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}ni(B.name)!==ni(Q.name)&&this.raise(B.start,"Expected corresponding JSX closing tag for <"+ni(Q.name)+">")}var W=Q.name?"Element":"Fragment";return N["opening"+W]=Q,N["closing"+W]=B,N.children=G,this.type===P.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(N,"JSX"+W)},A.jsx_parseText=function(){var w=this.parseLiteral(this.value);return w.type="JSXText",w},A.jsx_parseElement=function(){var w=this.start,L=this.startLoc;return this.next(),this.jsx_parseElementAt(w,L)},C})(ue)})(v,S,m,e?.jsx),m=(function(j,he,ue){var M=he.tokTypes,P=ue.tokTypes;return(function(b){function r(){return b.apply(this,arguments)||this}Ui(r,b);var o=r.prototype;return o.parseMaybeImportAttributes=function(f){if(this.type===P._with||this.type===M.assert){this.next();var y=this.parseImportAttributes();y&&(f.attributes=y)}},o.parseImportAttributes=function(){this.expect(P.braceL);var f=this.parseWithEntries();return this.expect(P.braceR),f},o.parseWithEntries=function(){var f=[],y=new Set;do{if(this.type===P.braceR)break;var C,A=this.startNode();C=this.type===P.string?this.parseLiteral(this.value):this.parseIdent(!0),this.next(),A.key=C,y.has(A.key.name)&&this.raise(this.pos,"Duplicated key in attributes"),y.add(A.key.name),this.type!==P.string&&this.raise(this.pos,"Only string is supported as an attribute value"),A.value=this.parseLiteral(this.value),f.push(this.finishNode(A,"ImportAttribute"))}while(this.eat(P.comma));return f},r})(j)})(m,S,v);var V=(function(j){function he(r,o,f){var y;return(y=j.call(this,r,o,f)||this).preValue=null,y.preToken=null,y.isLookahead=!1,y.isAmbientContext=!1,y.inAbstractClass=!1,y.inType=!1,y.inDisallowConditionalTypesContext=!1,y.maybeInArrowParameters=!1,y.shouldParseArrowReturnType=void 0,y.shouldParseAsyncArrowReturnType=void 0,y.decoratorStack=[[]],y.importsStack=[[]],y.importOrExportOuterKind=void 0,y.tsParseConstModifier=y.tsParseModifiers.bind((function(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C})(y),{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:ae.InvalidModifierOnTypeParameterPositions}),y}Ui(he,j);var ue,M,P,b=he.prototype;return b.getTokenFromCodeInType=function(r){return r===62||r===60?this.finishOp(c.relational,1):j.prototype.getTokenFromCode.call(this,r)},b.readToken=function(r){if(!this.inType){var o=this.curContext();if(o===H.tc_expr)return this.jsx_readToken();if(o===H.tc_oTag||o===H.tc_cTag){if(k(r))return this.jsx_readWord();if(r==62)return++this.pos,this.finishToken(O.jsxTagEnd);if((r===34||r===39)&&o==H.tc_oTag)return this.jsx_readString(r)}if(r===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)return++this.pos,this.finishToken(O.jsxTagStart)}return j.prototype.readToken.call(this,r)},b.getTokenFromCode=function(r){return this.inType?this.getTokenFromCodeInType(r):r===64?(++this.pos,this.finishToken(O.at)):j.prototype.getTokenFromCode.call(this,r)},b.isAbstractClass=function(){return this.ts_isContextual(O.abstract)&&this.lookahead().type===c._class},b.finishNode=function(r,o){return r.type!==""&&r.end!==0?r:j.prototype.finishNode.call(this,r,o)},b.tryParse=function(r,o){o===void 0&&(o=this.cloneCurLookaheadState());var f={node:null};try{return{node:r(function(C){throw C===void 0&&(C=null),f.node=C,f}),error:null,thrown:!1,aborted:!1,failState:null}}catch(C){var y=this.getCurLookaheadState();if(this.setLookaheadState(o),C instanceof SyntaxError)return{node:null,error:C,thrown:!0,aborted:!1,failState:y};if(C===f)return{node:f.node,error:null,thrown:!1,aborted:!0,failState:y};throw C}},b.setOptionalParametersError=function(r,o){var f;r.optionalParametersLoc=(f=o?.loc)!=null?f:this.startLoc},b.reScan_lt_gt=function(){this.type===c.relational&&(this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos()))},b.reScan_lt=function(){var r=this.type;return r===c.bitShift?(this.pos-=2,this.finishOp(c.relational,1),c.relational):r},b.resetEndLocation=function(r,o){o===void 0&&(o=this.lastTokEndLoc),r.end=o.column,r.loc.end=o,this.options.ranges&&(r.range[1]=o.column)},b.startNodeAtNode=function(r){return j.prototype.startNodeAt.call(this,r.start,r.loc.start)},b.nextTokenStart=function(){return this.nextTokenStartSince(this.pos)},b.tsHasSomeModifiers=function(r,o){return o.some(function(f){return Jn(f)?r.accessibility===f:!!r[f]})},b.tsIsStartOfStaticBlocks=function(){return this.isContextual("static")&&this.lookaheadCharCode()===123},b.tsCheckForInvalidTypeCasts=function(r){var o=this;r.forEach(function(f){f?.type==="TSTypeCastExpression"&&o.raise(f.typeAnnotation.start,ae.UnexpectedTypeAnnotation)})},b.atPossibleAsyncArrow=function(r){return r.type==="Identifier"&&r.name==="async"&&this.lastTokEndLoc.column===r.end&&!this.canInsertSemicolon()&&r.end-r.start==5&&r.start===this.potentialArrowAt},b.tsIsIdentifier=function(){return X(this.type)},b.tsTryParseTypeOrTypePredicateAnnotation=function(){return this.match(c.colon)?this.tsParseTypeOrTypePredicateAnnotation(c.colon):void 0},b.tsTryParseGenericAsyncArrowFunction=function(r,o,f){var y=this;if(this.tsMatchLeftRelational()){var C=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;var A=this.tsTryParseAndCatch(function(){var w=y.startNodeAt(r,o);return w.typeParameters=y.tsParseTypeParameters(),j.prototype.parseFunctionParams.call(y,w),w.returnType=y.tsTryParseTypeOrTypePredicateAnnotation(),y.expect(c.arrow),w});if(this.maybeInArrowParameters=C,A)return j.prototype.parseArrowExpression.call(this,A,null,!0,f)}},b.tsParseTypeArgumentsInExpression=function(){if(this.reScan_lt()===c.relational)return this.tsParseTypeArguments()},b.tsInNoContext=function(r){var o=this.context;this.context=[o[0]];try{return r()}finally{this.context=o}},b.tsTryParseTypeAnnotation=function(){return this.match(c.colon)?this.tsParseTypeAnnotation():void 0},b.isUnparsedContextual=function(r,o){var f=r+o.length;if(this.input.slice(r,f)===o){var y=this.input.charCodeAt(f);return!(D(y)||(64512&y)==55296)}return!1},b.isAbstractConstructorSignature=function(){return this.ts_isContextual(O.abstract)&&this.lookahead().type===c._new},b.nextTokenStartSince=function(r){return Ls.lastIndex=r,Ls.test(this.input)?Ls.lastIndex:r},b.lookaheadCharCode=function(){return this.input.charCodeAt(this.nextTokenStart())},b.compareLookaheadState=function(r,o){for(var f=0,y=Object.keys(r);f<y.length;f++){var C=y[f];if(r[C]!==o[C])return!1}return!0},b.createLookaheadState=function(){this.value=null,this.context=[this.curContext()]},b.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}},b.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}},b.setLookaheadState=function(r){this.pos=r.pos,this.value=r.value,this.endLoc=r.endLoc,this.lastTokEnd=r.lastTokEnd,this.lastTokStart=r.lastTokStart,this.lastTokStartLoc=r.lastTokStartLoc,this.type=r.type,this.start=r.start,this.end=r.end,this.context=r.context,this.startLoc=r.startLoc,this.lastTokEndLoc=r.lastTokEndLoc,this.curLine=r.curLine,this.lineStart=r.lineStart,this.curPosition=r.curPosition,this.containsEsc=r.containsEsc},b.tsLookAhead=function(r){var o=this.getCurLookaheadState(),f=r();return this.setLookaheadState(o),f},b.lookahead=function(r){var o=this.getCurLookaheadState();if(this.createLookaheadState(),this.isLookahead=!0,r!==void 0)for(var f=0;f<r;f++)this.nextToken();else this.nextToken();this.isLookahead=!1;var y=this.getCurLookaheadState();return this.setLookaheadState(o),y},b.readWord=function(){var r=this.readWord1(),o=c.name;return this.keywords.test(r)?o=I[r]:new RegExp(K).test(r)&&(o=O[r]),this.finishToken(o,r)},b.skipBlockComment=function(){var r;this.isLookahead||(r=this.options.onComment&&this.curPosition());var o=this.pos,f=this.input.indexOf("*/",this.pos+=2);if(f===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=f+2,this.options.locations)for(var y,C=o;(y=Z(this.input,C,this.pos))>-1;)++this.curLine,C=this.lineStart=y;this.isLookahead||this.options.onComment&&this.options.onComment(!0,this.input.slice(o+2,f),o,this.pos,r,this.curPosition())},b.skipLineComment=function(r){var o,f=this.pos;this.isLookahead||(o=this.options.onComment&&this.curPosition());for(var y=this.input.charCodeAt(this.pos+=r);this.pos<this.input.length&&!_(y);)y=this.input.charCodeAt(++this.pos);this.isLookahead||this.options.onComment&&this.options.onComment(!1,this.input.slice(f+r,this.pos),f,this.pos,o,this.curPosition())},b.finishToken=function(r,o){this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var f=this.type;this.type=r,this.value=o,this.isLookahead||this.updateContext(f)},b.resetStartLocation=function(r,o,f){r.start=o,r.loc.start=f,this.options.ranges&&(r.range[0]=o)},b.isLineTerminator=function(){return this.eat(c.semi)||j.prototype.canInsertSemicolon.call(this)},b.hasFollowingLineBreak=function(){return zn.lastIndex=this.end,zn.test(this.input)},b.addExtra=function(r,o,f,y){if(y===void 0&&(y=!0),r){var C=r.extra=r.extra||{};y?C[o]=f:Object.defineProperty(C,o,{enumerable:y,value:f})}},b.isLiteralPropertyName=function(){return $(this.type)},b.hasPrecedingLineBreak=function(){return F.test(this.input.slice(this.lastTokEndLoc.index,this.start))},b.createIdentifier=function(r,o){return r.name=o,this.finishNode(r,"Identifier")},b.resetStartLocationFromNode=function(r,o){this.resetStartLocation(r,o.start,o.loc.start)},b.isThisParam=function(r){return r.type==="Identifier"&&r.name==="this"},b.isLookaheadContextual=function(r){var o=this.nextTokenStart();return this.isUnparsedContextual(o,r)},b.ts_type_isContextual=function(r,o){return r===o&&!this.containsEsc},b.ts_isContextual=function(r){return this.type===r&&!this.containsEsc},b.ts_isContextualWithState=function(r,o){return r.type===o&&!r.containsEsc},b.isContextualWithState=function(r,o){return o.type===c.name&&o.value===r&&!o.containsEsc},b.tsIsStartOfMappedType=function(){return this.next(),this.eat(c.plusMin)?this.ts_isContextual(O.readonly):(this.ts_isContextual(O.readonly)&&this.next(),!!this.match(c.bracketL)&&(this.next(),!!this.tsIsIdentifier()&&(this.next(),this.match(c._in))))},b.tsInDisallowConditionalTypesContext=function(r){var o=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return r()}finally{this.inDisallowConditionalTypesContext=o}},b.tsTryParseType=function(){return this.tsEatThenParseType(c.colon)},b.match=function(r){return this.type===r},b.matchJsx=function(r){return this.type===S.tokTypes[r]},b.ts_eatWithState=function(r,o,f){if(r===f.type){for(var y=0;y<o;y++)this.next();return!0}return!1},b.ts_eatContextualWithState=function(r,o,f){if(K.test(r)){if(this.ts_isContextualWithState(f,O[r])){for(var y=0;y<o;y++)this.next();return!0}return!1}if(!this.isContextualWithState(r,f))return!1;for(var C=0;C<o;C++)this.next();return!0},b.canHaveLeadingDecorator=function(){return this.match(c._class)},b.eatContextual=function(r){return K.test(r)?!!this.ts_isContextual(O[r])&&(this.next(),!0):j.prototype.eatContextual.call(this,r)},b.tsIsExternalModuleReference=function(){return this.isContextual("require")&&this.lookaheadCharCode()===40},b.tsParseExternalModuleReference=function(){var r=this.startNode();return this.expectContextual("require"),this.expect(c.parenL),this.match(c.string)||this.unexpected(),r.expression=this.parseExprAtom(),this.expect(c.parenR),this.finishNode(r,"TSExternalModuleReference")},b.tsParseEntityName=function(r){r===void 0&&(r=!0);for(var o=this.parseIdent(r);this.eat(c.dot);){var f=this.startNodeAtNode(o);f.left=o,f.right=this.parseIdent(r),o=this.finishNode(f,"TSQualifiedName")}return o},b.tsParseEnumMember=function(){var r=this.startNode();return r.id=this.match(c.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(c.eq)&&(r.initializer=this.parseMaybeAssign()),this.finishNode(r,"TSEnumMember")},b.tsParseEnumDeclaration=function(r,o){return o===void 0&&(o={}),o.const&&(r.const=!0),o.declare&&(r.declare=!0),this.expectContextual("enum"),r.id=this.parseIdent(),this.checkLValSimple(r.id),this.expect(c.braceL),r.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(c.braceR),this.finishNode(r,"TSEnumDeclaration")},b.tsParseModuleBlock=function(){var r=this.startNode();for(j.prototype.enterScope.call(this,512),this.expect(c.braceL),r.body=[];this.type!==c.braceR;){var o=this.parseStatement(null,!0);r.body.push(o)}return this.next(),j.prototype.exitScope.call(this),this.finishNode(r,"TSModuleBlock")},b.tsParseAmbientExternalModuleDeclaration=function(r){return this.ts_isContextual(O.global)?(r.global=!0,r.id=this.parseIdent()):this.match(c.string)?r.id=this.parseLiteral(this.value):this.unexpected(),this.match(c.braceL)?(j.prototype.enterScope.call(this,ri),r.body=this.tsParseModuleBlock(),j.prototype.exitScope.call(this)):j.prototype.semicolon.call(this),this.finishNode(r,"TSModuleDeclaration")},b.tsTryParseDeclare=function(r){var o=this;if(!this.isLineTerminator()){var f,y=this.type;return this.isContextual("let")&&(y=c._var,f="let"),this.tsInAmbientContext(function(){if(y===c._function)return r.declare=!0,o.parseFunctionStatement(r,!1,!0);if(y===c._class)return r.declare=!0,o.parseClass(r,!0);if(y===O.enum)return o.tsParseEnumDeclaration(r,{declare:!0});if(y===O.global)return o.tsParseAmbientExternalModuleDeclaration(r);if(y===c._const||y===c._var)return o.match(c._const)&&o.isLookaheadContextual("enum")?(o.expect(c._const),o.tsParseEnumDeclaration(r,{const:!0,declare:!0})):(r.declare=!0,o.parseVarStatement(r,f||o.value,!0));if(y===O.interface){var C=o.tsParseInterfaceDeclaration(r,{declare:!0});if(C)return C}return X(y)?o.tsParseDeclaration(r,o.value,!0):void 0})}},b.tsIsListTerminator=function(r){switch(r){case"EnumMembers":case"TypeMembers":return this.match(c.braceR);case"HeritageClauseElement":return this.match(c.braceL);case"TupleElementTypes":return this.match(c.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}},b.tsParseDelimitedListWorker=function(r,o,f,y){for(var C=[],A=-1;!this.tsIsListTerminator(r);){A=-1;var w=o();if(w==null)return;if(C.push(w),!this.eat(c.comma)){if(this.tsIsListTerminator(r))break;return void(f&&this.expect(c.comma))}A=this.lastTokStart}return y&&(y.value=A),C},b.tsParseDelimitedList=function(r,o,f){return(function(y){if(y==null)throw new Error("Unexpected "+y+" value.");return y})(this.tsParseDelimitedListWorker(r,o,!0,f))},b.tsParseBracketedList=function(r,o,f,y,C){y||this.expect(f?c.bracketL:c.relational);var A=this.tsParseDelimitedList(r,o,C);return this.expect(f?c.bracketR:c.relational),A},b.tsParseTypeParameterName=function(){return this.parseIdent().name},b.tsEatThenParseType=function(r){return this.match(r)?this.tsNextThenParseType():void 0},b.tsExpectThenParseType=function(r){var o=this;return this.tsDoThenParseType(function(){return o.expect(r)})},b.tsNextThenParseType=function(){var r=this;return this.tsDoThenParseType(function(){return r.next()})},b.tsDoThenParseType=function(r){var o=this;return this.tsInType(function(){return r(),o.tsParseType()})},b.tsSkipParameterStart=function(){if(X(this.type)||this.match(c._this))return this.next(),!0;if(this.match(c.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(c.bracketL)){this.next();try{return this.parseBindingList(c.bracketR,!0,!0),!0}catch{return!1}}return!1},b.tsIsUnambiguouslyStartOfFunctionType=function(){return this.next(),!!(this.match(c.parenR)||this.match(c.ellipsis)||this.tsSkipParameterStart()&&(this.match(c.colon)||this.match(c.comma)||this.match(c.question)||this.match(c.eq)||this.match(c.parenR)&&(this.next(),this.match(c.arrow))))},b.tsIsStartOfFunctionType=function(){return!!this.tsMatchLeftRelational()||this.match(c.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))},b.tsInAllowConditionalTypesContext=function(r){var o=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return r()}finally{this.inDisallowConditionalTypesContext=o}},b.tsParseBindingListForSignature=function(){var r=this;return j.prototype.parseBindingList.call(this,c.parenR,!0,!0).map(function(o){return o.type!=="Identifier"&&o.type!=="RestElement"&&o.type!=="ObjectPattern"&&o.type!=="ArrayPattern"&&r.raise(o.start,ae.UnsupportedSignatureParameterKind(o.type)),o})},b.tsParseTypePredicateAsserts=function(){if(this.type!==O.asserts)return!1;var r=this.containsEsc;return this.next(),!(!X(this.type)&&!this.match(c._this)||(r&&this.raise(this.lastTokStart,"Escape sequence in keyword asserts"),0))},b.tsParseThisTypeNode=function(){var r=this.startNode();return this.next(),this.finishNode(r,"TSThisType")},b.tsParseTypeAnnotation=function(r,o){var f=this;return r===void 0&&(r=!0),o===void 0&&(o=this.startNode()),this.tsInType(function(){r&&f.expect(c.colon),o.typeAnnotation=f.tsParseType()}),this.finishNode(o,"TSTypeAnnotation")},b.tsParseThisTypePredicate=function(r){this.next();var o=this.startNodeAtNode(r);return o.parameterName=r,o.typeAnnotation=this.tsParseTypeAnnotation(!1),o.asserts=!1,this.finishNode(o,"TSTypePredicate")},b.tsParseThisTypeOrThisTypePredicate=function(){var r=this.tsParseThisTypeNode();return this.isContextual("is")&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(r):r},b.tsParseTypePredicatePrefix=function(){var r=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),r},b.tsParseTypeOrTypePredicateAnnotation=function(r){var o=this;return this.tsInType(function(){var f=o.startNode();o.expect(r);var y=o.startNode(),C=!!o.tsTryParse(o.tsParseTypePredicateAsserts.bind(o));if(C&&o.match(c._this)){var A=o.tsParseThisTypeOrThisTypePredicate();return A.type==="TSThisType"?(y.parameterName=A,y.asserts=!0,y.typeAnnotation=null,A=o.finishNode(y,"TSTypePredicate")):(o.resetStartLocationFromNode(A,y),A.asserts=!0),f.typeAnnotation=A,o.finishNode(f,"TSTypeAnnotation")}var w=o.tsIsIdentifier()&&o.tsTryParse(o.tsParseTypePredicatePrefix.bind(o));if(!w)return C?(y.parameterName=o.parseIdent(),y.asserts=C,y.typeAnnotation=null,f.typeAnnotation=o.finishNode(y,"TSTypePredicate"),o.finishNode(f,"TSTypeAnnotation")):o.tsParseTypeAnnotation(!1,f);var L=o.tsParseTypeAnnotation(!1);return y.parameterName=w,y.typeAnnotation=L,y.asserts=C,f.typeAnnotation=o.finishNode(y,"TSTypePredicate"),o.finishNode(f,"TSTypeAnnotation")})},b.tsFillSignature=function(r,o){var f=r===c.arrow;o.typeParameters=this.tsTryParseTypeParameters(),this.expect(c.parenL),o.parameters=this.tsParseBindingListForSignature(),(f||this.match(r))&&(o.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(r))},b.tsTryNextParseConstantContext=function(){if(this.lookahead().type!==c._const)return null;this.next();var r=this.tsParseTypeReference();return r.typeParameters&&this.raise(r.typeName.start,ae.CannotFindName({name:"const"})),r},b.tsParseFunctionOrConstructorType=function(r,o){var f=this,y=this.startNode();return r==="TSConstructorType"&&(y.abstract=!!o,o&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(function(){return f.tsFillSignature(c.arrow,y)}),this.finishNode(y,r)},b.tsParseUnionOrIntersectionType=function(r,o,f){var y=this.startNode(),C=this.eat(f),A=[];do A.push(o());while(this.eat(f));return A.length!==1||C?(y.types=A,this.finishNode(y,r)):A[0]},b.tsCheckTypeAnnotationForReadOnly=function(r){switch(r.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(r.start,ae.UnexpectedReadonly)}},b.tsParseTypeOperator=function(){var r=this.startNode(),o=this.value;return this.next(),r.operator=o,r.typeAnnotation=this.tsParseTypeOperatorOrHigher(),o==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(r),this.finishNode(r,"TSTypeOperator")},b.tsParseConstraintForInferType=function(){var r=this;if(this.eat(c._extends)){var o=this.tsInDisallowConditionalTypesContext(function(){return r.tsParseType()});if(this.inDisallowConditionalTypesContext||!this.match(c.question))return o}},b.tsParseInferType=function(){var r=this,o=this.startNode();this.expectContextual("infer");var f=this.startNode();return f.name=this.tsParseTypeParameterName(),f.constraint=this.tsTryParse(function(){return r.tsParseConstraintForInferType()}),o.typeParameter=this.finishNode(f,"TSTypeParameter"),this.finishNode(o,"TSInferType")},b.tsParseLiteralTypeNode=function(){var r=this,o=this.startNode();return o.literal=(function(){switch(r.type){case c.num:case c.string:case c._true:case c._false:return r.parseExprAtom();default:r.unexpected()}})(),this.finishNode(o,"TSLiteralType")},b.tsParseImportType=function(){var r=this.startNode();return this.expect(c._import),this.expect(c.parenL),this.match(c.string)||this.raise(this.start,ae.UnsupportedImportTypeArgument),r.argument=this.parseExprAtom(),this.expect(c.parenR),this.eat(c.dot)&&(r.qualifier=this.tsParseEntityName()),this.tsMatchLeftRelational()&&(r.typeParameters=this.tsParseTypeArguments()),this.finishNode(r,"TSImportType")},b.tsParseTypeQuery=function(){var r=this.startNode();return this.expect(c._typeof),r.exprName=this.match(c._import)?this.tsParseImportType():this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational()&&(r.typeParameters=this.tsParseTypeArguments()),this.finishNode(r,"TSTypeQuery")},b.tsParseMappedTypeParameter=function(){var r=this.startNode();return r.name=this.tsParseTypeParameterName(),r.constraint=this.tsExpectThenParseType(c._in),this.finishNode(r,"TSTypeParameter")},b.tsParseMappedType=function(){var r=this.startNode();return this.expect(c.braceL),this.match(c.plusMin)?(r.readonly=this.value,this.next(),this.expectContextual("readonly")):this.eatContextual("readonly")&&(r.readonly=!0),this.expect(c.bracketL),r.typeParameter=this.tsParseMappedTypeParameter(),r.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(c.bracketR),this.match(c.plusMin)?(r.optional=this.value,this.next(),this.expect(c.question)):this.eat(c.question)&&(r.optional=!0),r.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(c.braceR),this.finishNode(r,"TSMappedType")},b.tsParseTypeLiteral=function(){var r=this.startNode();return r.members=this.tsParseObjectTypeMembers(),this.finishNode(r,"TSTypeLiteral")},b.tsParseTupleElementType=function(){var r=this.startLoc,o=this.start,f=this.eat(c.ellipsis),y=this.tsParseType(),C=this.eat(c.question);if(this.eat(c.colon)){var A=this.startNodeAtNode(y);A.optional=C,y.type!=="TSTypeReference"||y.typeParameters||y.typeName.type!=="Identifier"?(this.raise(y.start,ae.InvalidTupleMemberLabel),A.label=y):A.label=y.typeName,A.elementType=this.tsParseType(),y=this.finishNode(A,"TSNamedTupleMember")}else if(C){var w=this.startNodeAtNode(y);w.typeAnnotation=y,y=this.finishNode(w,"TSOptionalType")}if(f){var L=this.startNodeAt(o,r);L.typeAnnotation=y,y=this.finishNode(L,"TSRestType")}return y},b.tsParseTupleType=function(){var r=this,o=this.startNode();o.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);var f=!1,y=null;return o.elementTypes.forEach(function(C){var A=C.type;!f||A==="TSRestType"||A==="TSOptionalType"||A==="TSNamedTupleMember"&&C.optional||r.raise(C.start,ae.OptionalTypeBeforeRequired),f||(f=A==="TSNamedTupleMember"&&C.optional||A==="TSOptionalType");var w=A;A==="TSRestType"&&(w=(C=C.typeAnnotation).type);var L=w==="TSNamedTupleMember";y!=null||(y=L),y!==L&&r.raise(C.start,ae.MixedLabeledAndUnlabeledElements)}),this.finishNode(o,"TSTupleType")},b.tsParseTemplateLiteralType=function(){var r=this.startNode();return r.literal=this.parseTemplate({isTagged:!1}),this.finishNode(r,"TSLiteralType")},b.tsParseTypeReference=function(){var r=this.startNode();return r.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational()&&(r.typeParameters=this.tsParseTypeArguments()),this.finishNode(r,"TSTypeReference")},b.tsMatchLeftRelational=function(){return this.match(c.relational)&&this.value==="<"},b.tsMatchRightRelational=function(){return this.match(c.relational)&&this.value===">"},b.tsParseParenthesizedType=function(){var r=this.startNode();return this.expect(c.parenL),r.typeAnnotation=this.tsParseType(),this.expect(c.parenR),this.finishNode(r,"TSParenthesizedType")},b.tsParseNonArrayType=function(){switch(this.type){case c.string:case c.num:case c._true:case c._false:return this.tsParseLiteralTypeNode();case c.plusMin:if(this.value==="-"){var r=this.startNode();return this.lookahead().type!==c.num&&this.unexpected(),r.literal=this.parseMaybeUnary(),this.finishNode(r,"TSLiteralType")}break;case c._this:return this.tsParseThisTypeOrThisTypePredicate();case c._typeof:return this.tsParseTypeQuery();case c._import:return this.tsParseImportType();case c.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case c.bracketL:return this.tsParseTupleType();case c.parenL:return this.tsParseParenthesizedType();case c.backQuote:case c.dollarBraceL:return this.tsParseTemplateLiteralType();default:var o=this.type;if(X(o)||o===c._void||o===c._null){var f=o===c._void?"TSVoidKeyword":o===c._null?"TSNullKeyword":(function(C){switch(C){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(f!==void 0&&this.lookaheadCharCode()!==46){var y=this.startNode();return this.next(),this.finishNode(y,f)}return this.tsParseTypeReference()}}this.unexpected()},b.tsParseArrayTypeOrHigher=function(){for(var r=this.tsParseNonArrayType();!this.hasPrecedingLineBreak()&&this.eat(c.bracketL);)if(this.match(c.bracketR)){var o=this.startNodeAtNode(r);o.elementType=r,this.expect(c.bracketR),r=this.finishNode(o,"TSArrayType")}else{var f=this.startNodeAtNode(r);f.objectType=r,f.indexType=this.tsParseType(),this.expect(c.bracketR),r=this.finishNode(f,"TSIndexedAccessType")}return r},b.tsParseTypeOperatorOrHigher=function(){var r=this;return J(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(function(){return r.tsParseArrayTypeOrHigher()})},b.tsParseIntersectionTypeOrHigher=function(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),c.bitwiseAND)},b.tsParseUnionTypeOrHigher=function(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),c.bitwiseOR)},b.tsParseNonConditionalType=function(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(c._new)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()},b.tsParseType=function(){var r=this;Xn(this.inType);var o=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(c._extends))return o;var f=this.startNodeAtNode(o);return f.checkType=o,f.extendsType=this.tsInDisallowConditionalTypesContext(function(){return r.tsParseNonConditionalType()}),this.expect(c.question),f.trueType=this.tsInAllowConditionalTypesContext(function(){return r.tsParseType()}),this.expect(c.colon),f.falseType=this.tsInAllowConditionalTypesContext(function(){return r.tsParseType()}),this.finishNode(f,"TSConditionalType")},b.tsIsUnambiguouslyIndexSignature=function(){return this.next(),!!X(this.type)&&(this.next(),this.match(c.colon))},b.tsInType=function(r){var o=this.inType;this.inType=!0;try{return r()}finally{this.inType=o}},b.tsTryParseIndexSignature=function(r){if(this.match(c.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))){this.expect(c.bracketL);var o=this.parseIdent();o.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(o),this.expect(c.bracketR),r.parameters=[o];var f=this.tsTryParseTypeAnnotation();return f&&(r.typeAnnotation=f),this.tsParseTypeMemberSemicolon(),this.finishNode(r,"TSIndexSignature")}},b.tsParseNoneModifiers=function(r){this.tsParseModifiers({modified:r,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:ae.InvalidModifierOnTypeParameterPositions})},b.tsParseTypeParameter=function(r){r===void 0&&(r=this.tsParseNoneModifiers.bind(this));var o=this.startNode();return r(o),o.name=this.tsParseTypeParameterName(),o.constraint=this.tsEatThenParseType(c._extends),o.default=this.tsEatThenParseType(c.eq),this.finishNode(o,"TSTypeParameter")},b.tsParseTypeParameters=function(r){var o=this.startNode();this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart")?this.next():this.unexpected();var f={value:-1};return o.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,r),!1,!0,f),o.params.length===0&&this.raise(this.start,ae.EmptyTypeParameters),f.value!==-1&&this.addExtra(o,"trailingComma",f.value),this.finishNode(o,"TSTypeParameterDeclaration")},b.tsTryParseTypeParameters=function(r){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(r)},b.tsTryParse=function(r){var o=this.getCurLookaheadState(),f=r();return f!==void 0&&f!==!1?f:void this.setLookaheadState(o)},b.tsTokenCanFollowModifier=function(){return(this.match(c.bracketL)||this.match(c.braceL)||this.match(c.star)||this.match(c.ellipsis)||this.match(c.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()},b.tsNextTokenCanFollowModifier=function(){return this.next(!0),this.tsTokenCanFollowModifier()},b.tsParseModifier=function(r,o){if(X(this.type)||this.type===c._in){var f=this.value;if(r.indexOf(f)!==-1&&!this.containsEsc){if(o&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return f}}},b.tsParseModifiersByMap=function(r){for(var o=r.modified,f=r.map,y=0,C=Object.keys(f);y<C.length;y++){var A=C[y];o[A]=f[A]}},b.tsParseModifiers=function(r){for(var o=this,f=r.modified,y=r.allowedModifiers,C=r.disallowedModifiers,A=r.stopOnStartOfClassStaticBlock,w=r.errorTemplate,L=w===void 0?ae.InvalidModifierOnTypeMember:w,N={},G=function(U,Y,oe,de){Y===oe&&f[de]&&o.raise(U.column,ae.InvalidModifiersOrder({orderedModifiers:[oe,de]}))},Q=function(U,Y,oe,de){(f[oe]&&Y===de||f[de]&&Y===oe)&&o.raise(U.column,ae.IncompatibleModifiers({modifiers:[oe,de]}))};;){var B=this.startLoc,W=this.tsParseModifier(y.concat(C??[]),A);if(!W)break;Jn(W)?f.accessibility?this.raise(this.start,ae.DuplicateAccessibilityModifier()):(G(B,W,W,"override"),G(B,W,W,"static"),G(B,W,W,"readonly"),G(B,W,W,"accessor"),N.accessibility=W,f.accessibility=W):Yc(W)?f[W]?this.raise(this.start,ae.DuplicateModifier({modifier:W})):(G(B,W,"in","out"),N[W]=W,f[W]=!0):Qc(W)?f[W]?this.raise(this.start,ae.DuplicateModifier({modifier:W})):(Q(B,W,"accessor","readonly"),Q(B,W,"accessor","static"),Q(B,W,"accessor","override"),N[W]=W,f[W]=!0):Object.hasOwnProperty.call(f,W)?this.raise(this.start,ae.DuplicateModifier({modifier:W})):(G(B,W,"static","readonly"),G(B,W,"static","override"),G(B,W,"override","readonly"),G(B,W,"abstract","override"),Q(B,W,"declare","override"),Q(B,W,"static","abstract"),N[W]=W,f[W]=!0),C!=null&&C.includes(W)&&this.raise(this.start,L)}return N},b.tsParseInOutModifiers=function(r){this.tsParseModifiers({modified:r,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:ae.InvalidModifierOnTypeParameter})},b.tsParseTypeArguments=function(){var r=this,o=this.startNode();return o.params=this.tsInType(function(){return r.tsInNoContext(function(){return r.expect(c.relational),r.tsParseDelimitedList("TypeParametersOrArguments",r.tsParseType.bind(r))})}),o.params.length===0&&this.raise(this.start,ae.EmptyTypeArguments),this.exprAllowed=!1,this.expect(c.relational),this.finishNode(o,"TSTypeParameterInstantiation")},b.tsParseHeritageClause=function(r){var o=this,f=this.start,y=this.tsParseDelimitedList("HeritageClauseElement",function(){var C=o.startNode();return C.expression=o.tsParseEntityName(),o.tsMatchLeftRelational()&&(C.typeParameters=o.tsParseTypeArguments()),o.finishNode(C,"TSExpressionWithTypeArguments")});return y.length||this.raise(f,ae.EmptyHeritageClauseType({token:r})),y},b.tsParseTypeMemberSemicolon=function(){this.eat(c.comma)||this.isLineTerminator()||this.expect(c.semi)},b.tsTryParseAndCatch=function(r){var o=this.tryParse(function(f){return r()||f()});if(!o.aborted&&o.node)return o.error&&this.setLookaheadState(o.failState),o.node},b.tsParseSignatureMember=function(r,o){return this.tsFillSignature(c.colon,o),this.tsParseTypeMemberSemicolon(),this.finishNode(o,r)},b.tsParsePropertyOrMethodSignature=function(r,o){this.eat(c.question)&&(r.optional=!0);var f=r;if(this.match(c.parenL)||this.tsMatchLeftRelational()){o&&this.raise(r.start,ae.ReadonlyForMethodSignature);var y=f;y.kind&&this.tsMatchLeftRelational()&&this.raise(this.start,ae.AccesorCannotHaveTypeParameters),this.tsFillSignature(c.colon,y),this.tsParseTypeMemberSemicolon();var C="parameters",A="typeAnnotation";if(y.kind==="get")y[C].length>0&&(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(y[C][0])&&this.raise(this.start,ae.AccesorCannotDeclareThisParameter));else if(y.kind==="set"){if(y[C].length!==1)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{var w=y[C][0];this.isThisParam(w)&&this.raise(this.start,ae.AccesorCannotDeclareThisParameter),w.type==="Identifier"&&w.optional&&this.raise(this.start,ae.SetAccesorCannotHaveOptionalParameter),w.type==="RestElement"&&this.raise(this.start,ae.SetAccesorCannotHaveRestParameter)}y[A]&&this.raise(y[A].start,ae.SetAccesorCannotHaveReturnType)}else y.kind="method";return this.finishNode(y,"TSMethodSignature")}var L=f;o&&(L.readonly=!0);var N=this.tsTryParseTypeAnnotation();return N&&(L.typeAnnotation=N),this.tsParseTypeMemberSemicolon(),this.finishNode(L,"TSPropertySignature")},b.tsParseTypeMember=function(){var r=this.startNode();if(this.match(c.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",r);if(this.match(c._new)){var o=this.startNode();return this.next(),this.match(c.parenL)||this.tsMatchLeftRelational()?this.tsParseSignatureMember("TSConstructSignatureDeclaration",r):(r.key=this.createIdentifier(o,"new"),this.tsParsePropertyOrMethodSignature(r,!1))}return this.tsParseModifiers({modified:r,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]}),this.tsTryParseIndexSignature(r)||(this.parsePropertyName(r),r.computed||r.key.type!=="Identifier"||r.key.name!=="get"&&r.key.name!=="set"||!this.tsTokenCanFollowModifier()||(r.kind=r.key.name,this.parsePropertyName(r)),this.tsParsePropertyOrMethodSignature(r,!!r.readonly))},b.tsParseList=function(r,o){for(var f=[];!this.tsIsListTerminator(r);)f.push(o());return f},b.tsParseObjectTypeMembers=function(){this.expect(c.braceL);var r=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(c.braceR),r},b.tsParseInterfaceDeclaration=function(r,o){if(o===void 0&&(o={}),this.hasFollowingLineBreak())return null;this.expectContextual("interface"),o.declare&&(r.declare=!0),X(this.type)?(r.id=this.parseIdent(),this.checkLValSimple(r.id,7)):(r.id=null,this.raise(this.start,ae.MissingInterfaceName)),r.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(c._extends)&&(r.extends=this.tsParseHeritageClause("extends"));var f=this.startNode();return f.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),r.body=this.finishNode(f,"TSInterfaceBody"),this.finishNode(r,"TSInterfaceDeclaration")},b.tsParseAbstractDeclaration=function(r){if(this.match(c._class))return r.abstract=!0,this.parseClass(r,!0);if(this.ts_isContextual(O.interface)){if(!this.hasFollowingLineBreak())return r.abstract=!0,this.tsParseInterfaceDeclaration(r)}else this.unexpected(r.start)},b.tsIsDeclarationStart=function(){return re(this.type)},b.tsParseExpressionStatement=function(r,o){switch(o.name){case"declare":var f=this.tsTryParseDeclare(r);if(f)return f.declare=!0,f;break;case"global":if(this.match(c.braceL)){j.prototype.enterScope.call(this,ri);var y=r;return y.global=!0,y.id=o,y.body=this.tsParseModuleBlock(),j.prototype.exitScope.call(this),this.finishNode(y,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(r,o.name,!1)}},b.tsParseModuleReference=function(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)},b.tsIsExportDefaultSpecifier=function(){var r=this.type,o=this.isAsyncFunction(),f=this.isLet();if(X(r)){if(o&&!this.containsEsc||f)return!1;if((r===O.type||r===O.interface)&&!this.containsEsc){var y=this.lookahead();if(X(y.type)&&!this.isContextualWithState("from",y)||y.type===c.braceL)return!1}}else if(!this.match(c._default))return!1;var C=this.nextTokenStart(),A=this.isUnparsedContextual(C,"from");if(this.input.charCodeAt(C)===44||X(this.type)&&A)return!0;if(this.match(c._default)&&A){var w=this.input.charCodeAt(this.nextTokenStartSince(C+4));return w===34||w===39}return!1},b.tsInAmbientContext=function(r){var o=this.isAmbientContext;this.isAmbientContext=!0;try{return r()}finally{this.isAmbientContext=o}},b.tsCheckLineTerminator=function(r){return r?!this.hasFollowingLineBreak()&&(this.next(),!0):!this.isLineTerminator()},b.tsParseModuleOrNamespaceDeclaration=function(r,o){if(o===void 0&&(o=!1),r.id=this.parseIdent(),o||this.checkLValSimple(r.id,8),this.eat(c.dot)){var f=this.startNode();this.tsParseModuleOrNamespaceDeclaration(f,!0),r.body=f}else j.prototype.enterScope.call(this,ri),r.body=this.tsParseModuleBlock(),j.prototype.exitScope.call(this);return this.finishNode(r,"TSModuleDeclaration")},b.checkLValSimple=function(r,o,f){return o===void 0&&(o=0),j.prototype.checkLValSimple.call(this,r,o,f)},b.tsParseTypeAliasDeclaration=function(r){var o=this;return r.id=this.parseIdent(),this.checkLValSimple(r.id,6),r.typeAnnotation=this.tsInType(function(){if(r.typeParameters=o.tsTryParseTypeParameters(o.tsParseInOutModifiers.bind(o)),o.expect(c.eq),o.ts_isContextual(O.interface)&&o.lookahead().type!==c.dot){var f=o.startNode();return o.next(),o.finishNode(f,"TSIntrinsicKeyword")}return o.tsParseType()}),this.semicolon(),this.finishNode(r,"TSTypeAliasDeclaration")},b.tsParseDeclaration=function(r,o,f){switch(o){case"abstract":if(this.tsCheckLineTerminator(f)&&(this.match(c._class)||X(this.type)))return this.tsParseAbstractDeclaration(r);break;case"module":if(this.tsCheckLineTerminator(f)){if(this.match(c.string))return this.tsParseAmbientExternalModuleDeclaration(r);if(X(this.type))return this.tsParseModuleOrNamespaceDeclaration(r)}break;case"namespace":if(this.tsCheckLineTerminator(f)&&X(this.type))return this.tsParseModuleOrNamespaceDeclaration(r);break;case"type":if(this.tsCheckLineTerminator(f)&&X(this.type))return this.tsParseTypeAliasDeclaration(r)}},b.tsTryParseExportDeclaration=function(){return this.tsParseDeclaration(this.startNode(),this.value,!0)},b.tsParseImportEqualsDeclaration=function(r,o){r.isExport=o||!1,r.id=this.parseIdent(),this.checkLValSimple(r.id,2),j.prototype.expect.call(this,c.eq);var f=this.tsParseModuleReference();return r.importKind==="type"&&f.type!=="TSExternalModuleReference"&&this.raise(f.start,ae.ImportAliasHasImportType),r.moduleReference=f,j.prototype.semicolon.call(this),this.finishNode(r,"TSImportEqualsDeclaration")},b.isExportDefaultSpecifier=function(){if(this.tsIsDeclarationStart())return!1;var r=this.type;if(X(r)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((r===O.type||r===O.interface)&&!this.containsEsc){var o=this.lookahead();if(X(o.type)&&!this.isContextualWithState("from",o)||o.type===c.braceL)return!1}}else if(!this.match(c._default))return!1;var f=this.nextTokenStart(),y=this.isUnparsedContextual(f,"from");if(this.input.charCodeAt(f)===44||X(this.type)&&y)return!0;if(this.match(c._default)&&y){var C=this.input.charCodeAt(this.nextTokenStartSince(f+4));return C===34||C===39}return!1},b.parseTemplate=function(r){var o=(r===void 0?{}:r).isTagged,f=o!==void 0&&o,y=this.startNode();this.next(),y.expressions=[];var C=this.parseTemplateElement({isTagged:f});for(y.quasis=[C];!C.tail;)this.type===c.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(c.dollarBraceL),y.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(c.braceR),y.quasis.push(C=this.parseTemplateElement({isTagged:f}));return this.next(),this.finishNode(y,"TemplateLiteral")},b.parseFunction=function(r,o,f,y,C){this.initFunction(r),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!y)&&(this.type===c.star&&2&o&&this.unexpected(),r.generator=this.eat(c.star)),this.options.ecmaVersion>=8&&(r.async=!!y),1&o&&(r.id=4&o&&this.type!==c.name?null:this.parseIdent());var A=this.yieldPos,w=this.awaitPos,L=this.awaitIdentPos,N=this.maybeInArrowParameters;this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Rs(r.async,r.generator)),1&o||(r.id=this.type===c.name?this.parseIdent():null),this.parseFunctionParams(r);var G=1&o;return this.parseFunctionBody(r,f,!1,C,{isFunctionDeclaration:G}),this.yieldPos=A,this.awaitPos=w,this.awaitIdentPos=L,1&o&&r.id&&!(2&o)&&this.checkLValSimple(r.id,r.body?this.strict||r.generator||r.async?this.treatFunctionsAsVar?1:2:3:0),this.maybeInArrowParameters=N,this.finishNode(r,G?"FunctionDeclaration":"FunctionExpression")},b.parseFunctionBody=function(r,o,f,y,C){o===void 0&&(o=!1),f===void 0&&(f=!1),y===void 0&&(y=!1),this.match(c.colon)&&(r.returnType=this.tsParseTypeOrTypePredicateAnnotation(c.colon));var A=C!=null&&C.isFunctionDeclaration?"TSDeclareFunction":C!=null&&C.isClassMethod?"TSDeclareMethod":void 0;return A&&!this.match(c.braceL)&&this.isLineTerminator()?this.finishNode(r,A):A==="TSDeclareFunction"&&this.isAmbientContext&&(this.raise(r.start,ae.DeclareFunctionHasImplementation),r.declare)?(j.prototype.parseFunctionBody.call(this,r,o,f,!1),this.finishNode(r,A)):(j.prototype.parseFunctionBody.call(this,r,o,f,y),r)},b.parseNew=function(){var r;this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var o=this.startNode(),f=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(c.dot)){o.meta=f;var y=this.containsEsc;return o.property=this.parseIdent(!0),o.property.name!=="target"&&this.raiseRecoverable(o.property.start,"The only valid meta property for new is 'new.target'"),y&&this.raiseRecoverable(o.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(o.start,"'new.target' can only be used in functions and class static block"),this.finishNode(o,"MetaProperty")}var C=this.start,A=this.startLoc,w=this.type===c._import;o.callee=this.parseSubscripts(this.parseExprAtom(),C,A,!0,!1),w&&o.callee.type==="ImportExpression"&&this.raise(C,"Cannot use new with import()");var L=o.callee;return L.type!=="TSInstantiationExpression"||(r=L.extra)!=null&&r.parenthesized||(o.typeParameters=L.typeParameters,o.callee=L.expression),o.arguments=this.eat(c.parenL)?this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1):[],this.finishNode(o,"NewExpression")},b.parseExprOp=function(r,o,f,y,C){var A;if(c._in.binop>y&&!this.hasPrecedingLineBreak()&&(this.isContextual("as")&&(A="TSAsExpression"),l&&this.isContextual("satisfies")&&(A="TSSatisfiesExpression"),A)){var w=this.startNodeAt(o,f);w.expression=r;var L=this.tsTryNextParseConstantContext();return w.typeAnnotation=L||this.tsNextThenParseType(),this.finishNode(w,A),this.reScan_lt_gt(),this.parseExprOp(w,o,f,y,C)}return j.prototype.parseExprOp.call(this,r,o,f,y,C)},b.parseImportSpecifiers=function(){var r=[],o=!0;if(S.tokenIsIdentifier(this.type)&&(r.push(this.parseImportDefaultSpecifier()),!this.eat(c.comma)))return r;if(this.type===c.star)return r.push(this.parseImportNamespaceSpecifier()),r;for(this.expect(c.braceL);!this.eat(c.braceR);){if(o)o=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;r.push(this.parseImportSpecifier())}return r},b.parseImport=function(r){var o=this.lookahead();if(r.importKind="value",this.importOrExportOuterKind="value",X(o.type)||this.match(c.star)||this.match(c.braceL)){var f=this.lookahead(2);if(f.type!==c.comma&&!this.isContextualWithState("from",f)&&f.type!==c.eq&&this.ts_eatContextualWithState("type",1,o)&&(this.importOrExportOuterKind="type",r.importKind="type",o=this.lookahead(),f=this.lookahead(2)),X(o.type)&&f.type===c.eq){this.next();var y=this.tsParseImportEqualsDeclaration(r);return this.importOrExportOuterKind="value",y}}return this.next(),this.type===c.string?(r.specifiers=[],r.source=this.parseExprAtom()):(r.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),r.source=this.type===c.string?this.parseExprAtom():this.unexpected()),this.parseMaybeImportAttributes(r),this.semicolon(),this.finishNode(r,"ImportDeclaration"),this.importOrExportOuterKind="value",r.importKind==="type"&&r.specifiers.length>1&&r.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(r.start,ae.TypeImportCannotSpecifyDefaultAndNamed),r},b.parseExportDefaultDeclaration=function(){if(this.isAbstractClass()){var r=this.startNode();return this.next(),r.abstract=!0,this.parseClass(r,!0)}if(this.match(O.interface)){var o=this.tsParseInterfaceDeclaration(this.startNode());if(o)return o}return j.prototype.parseExportDefaultDeclaration.call(this)},b.parseExportAllDeclaration=function(r,o){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(r.exported=this.parseModuleExportName(),this.checkExport(o,r.exported,this.lastTokStart)):r.exported=null),this.expectContextual("from"),this.type!==c.string&&this.unexpected(),r.source=this.parseExprAtom(),this.parseMaybeImportAttributes(r),this.semicolon(),this.finishNode(r,"ExportAllDeclaration")},b.parseDynamicImport=function(r){if(this.next(),r.source=this.parseMaybeAssign(),this.eat(c.comma)){var o=this.parseExpression();r.arguments=[o]}if(!this.eat(c.parenR)){var f=this.start;this.eat(c.comma)&&this.eat(c.parenR)?this.raiseRecoverable(f,"Trailing comma is not allowed in import()"):this.unexpected(f)}return this.finishNode(r,"ImportExpression")},b.parseExport=function(r,o){var f=this.lookahead();if(this.ts_eatWithState(c._import,2,f)){this.ts_isContextual(O.type)&&this.lookaheadCharCode()!==61?(r.importKind="type",this.importOrExportOuterKind="type",this.next()):(r.importKind="value",this.importOrExportOuterKind="value");var y=this.tsParseImportEqualsDeclaration(r,!0);return this.importOrExportOuterKind=void 0,y}if(this.ts_eatWithState(c.eq,2,f)){var C=r;return C.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(C,"TSExportAssignment")}if(this.ts_eatContextualWithState("as",2,f)){var A=r;return this.expectContextual("namespace"),A.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(A,"TSNamespaceExportDeclaration")}if(this.ts_isContextualWithState(f,O.type)&&this.lookahead(2).type===c.braceL?(this.next(),this.importOrExportOuterKind="type",r.exportKind="type"):(this.importOrExportOuterKind="value",r.exportKind="value"),this.next(),this.eat(c.star))return this.parseExportAllDeclaration(r,o);if(this.eat(c._default))return this.checkExport(o,"default",this.lastTokStart),r.declaration=this.parseExportDefaultDeclaration(),this.finishNode(r,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())r.declaration=this.parseExportDeclaration(r),r.declaration.type==="VariableDeclaration"?this.checkVariableExport(o,r.declaration.declarations):this.checkExport(o,r.declaration.id,r.declaration.id.start),r.specifiers=[],r.source=null;else{if(r.declaration=null,r.specifiers=this.parseExportSpecifiers(o),this.eatContextual("from"))this.type!==c.string&&this.unexpected(),r.source=this.parseExprAtom(),this.parseMaybeImportAttributes(r);else{for(var w,L=$n(r.specifiers);!(w=L()).done;){var N=w.value;this.checkUnreserved(N.local),this.checkLocalExport(N.local),N.local.type==="Literal"&&this.raise(N.local.start,"A string literal cannot be used as an exported binding without `from`.")}r.source=null}this.semicolon()}return this.finishNode(r,"ExportNamedDeclaration")},b.checkExport=function(r,o,f){r&&(typeof o!="string"&&(o=o.type==="Identifier"?o.name:o.value),r[o]=!0)},b.parseMaybeDefault=function(r,o,f){var y=j.prototype.parseMaybeDefault.call(this,r,o,f);return y.type==="AssignmentPattern"&&y.typeAnnotation&&y.right.start<y.typeAnnotation.start&&this.raise(y.typeAnnotation.start,ae.TypeAnnotationAfterAssign),y},b.typeCastToParameter=function(r){return r.expression.typeAnnotation=r.typeAnnotation,this.resetEndLocation(r.expression,r.typeAnnotation.end),r.expression},b.toAssignableList=function(r,o){for(var f=0;f<r.length;f++){var y=r[f];y?.type==="TSTypeCastExpression"&&(r[f]=this.typeCastToParameter(y))}return j.prototype.toAssignableList.call(this,r,o)},b.reportReservedArrowTypeParam=function(r){},b.parseExprAtom=function(r,o,f){if(this.type===O.jsxText)return this.jsx_parseText();if(this.type===O.jsxTagStart)return this.jsx_parseElement();if(this.type===O.at)return this.parseDecorators(),this.parseExprAtom();if(X(this.type)){var y=this.potentialArrowAt===this.start,C=this.start,A=this.startLoc,w=this.containsEsc,L=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!w&&L.name==="async"&&!this.canInsertSemicolon()&&this.eat(c._function))return this.overrideContext(E.f_expr),this.parseFunction(this.startNodeAt(C,A),0,!1,!0,o);if(y&&!this.canInsertSemicolon()){if(this.eat(c.arrow))return this.parseArrowExpression(this.startNodeAt(C,A),[L],!1,o);if(this.options.ecmaVersion>=8&&L.name==="async"&&this.type===c.name&&!w&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return L=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(c.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(C,A),[L],!0,o)}return L}return j.prototype.parseExprAtom.call(this,r,o,f)},b.parseExprAtomDefault=function(){if(X(this.type)){var r=this.potentialArrowAt===this.start,o=this.containsEsc,f=this.parseIdent();if(!o&&f.name==="async"&&!this.canInsertSemicolon()){var y=this.type;if(y===c._function)return this.next(),this.parseFunction(this.startNodeAtNode(f),void 0,!0,!0);if(X(y)){if(this.lookaheadCharCode()===61){var C=this.parseIdent(!1);return!this.canInsertSemicolon()&&this.eat(c.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAtNode(f),[C],!0)}return f}}return r&&this.match(c.arrow)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(f),[f],!1)):f}this.unexpected()},b.parseIdentNode=function(){var r=this.startNode();return ne(this.type)?(r.name=this.value,r):j.prototype.parseIdentNode.call(this)},b.parseVarStatement=function(r,o,f){f===void 0&&(f=!1);var y=this.isAmbientContext;this.next(),j.prototype.parseVar.call(this,r,!1,o,f||y),this.semicolon();var C=this.finishNode(r,"VariableDeclaration");if(!y)return C;for(var A,w=$n(C.declarations);!(A=w()).done;){var L=A.value,N=L.init;N&&(o!=="const"||L.id.typeAnnotation?this.raise(N.start,ae.InitializerNotAllowedInAmbientContext):N.type!=="StringLiteral"&&N.type!=="BooleanLiteral"&&N.type!=="NumericLiteral"&&N.type!=="BigIntLiteral"&&(N.type!=="TemplateLiteral"||N.expressions.length>0)&&!Zc(N)&&this.raise(N.start,ae.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference))}return C},b.parseStatement=function(r,o,f){if(this.match(O.at)&&this.parseDecorators(!0),this.match(c._const)&&this.isLookaheadContextual("enum")){var y=this.startNode();return this.expect(c._const),this.tsParseEnumDeclaration(y,{const:!0})}if(this.ts_isContextual(O.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(O.interface)){var C=this.tsParseInterfaceDeclaration(this.startNode());if(C)return C}return j.prototype.parseStatement.call(this,r,o,f)},b.parseAccessModifier=function(){return this.tsParseModifier(["public","protected","private"])},b.parsePostMemberNameModifiers=function(r){this.eat(c.question)&&(r.optional=!0),r.readonly&&this.match(c.parenL)&&this.raise(r.start,ae.ClassMethodHasReadonly),r.declare&&this.match(c.parenL)&&this.raise(r.start,ae.ClassMethodHasDeclare)},b.parseExpressionStatement=function(r,o){return(o.type==="Identifier"?this.tsParseExpressionStatement(r,o):void 0)||j.prototype.parseExpressionStatement.call(this,r,o)},b.shouldParseExportStatement=function(){return!!this.tsIsDeclarationStart()||!!this.match(O.at)||j.prototype.shouldParseExportStatement.call(this)},b.parseConditional=function(r,o,f,y,C){if(this.eat(c.question)){var A=this.startNodeAt(o,f);return A.test=r,A.consequent=this.parseMaybeAssign(),this.expect(c.colon),A.alternate=this.parseMaybeAssign(y),this.finishNode(A,"ConditionalExpression")}return r},b.parseMaybeConditional=function(r,o){var f=this,y=this.start,C=this.startLoc,A=this.parseExprOps(r,o);if(this.checkExpressionErrors(o))return A;if(!this.maybeInArrowParameters||!this.match(c.question))return this.parseConditional(A,y,C,r,o);var w=this.tryParse(function(){return f.parseConditional(A,y,C,r,o)});return w.node?(w.error&&this.setLookaheadState(w.failState),w.node):(w.error&&this.setOptionalParametersError(o,w.error),A)},b.parseParenItem=function(r){var o=this.start,f=this.startLoc;if(r=j.prototype.parseParenItem.call(this,r),this.eat(c.question)&&(r.optional=!0,this.resetEndLocation(r)),this.match(c.colon)){var y=this.startNodeAt(o,f);return y.expression=r,y.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(y,"TSTypeCastExpression")}return r},b.parseExportDeclaration=function(r){var o=this;if(!this.isAmbientContext&&this.ts_isContextual(O.declare))return this.tsInAmbientContext(function(){return o.parseExportDeclaration(r)});var f=this.start,y=this.startLoc,C=this.eatContextual("declare");!C||!this.ts_isContextual(O.declare)&&this.shouldParseExportStatement()||this.raise(this.start,ae.ExpectedAmbientAfterExportDeclare);var A=X(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);return A?((A.type==="TSInterfaceDeclaration"||A.type==="TSTypeAliasDeclaration"||C)&&(r.exportKind="type"),C&&(this.resetStartLocation(A,f,y),A.declare=!0),A):null},b.parseClassId=function(r,o){if(o||!this.isContextual("implements")){j.prototype.parseClassId.call(this,r,o);var f=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));f&&(r.typeParameters=f)}},b.parseClassPropertyAnnotation=function(r){r.optional||(this.value==="!"&&this.eat(c.prefix)?r.definite=!0:this.eat(c.question)&&(r.optional=!0));var o=this.tsTryParseTypeAnnotation();o&&(r.typeAnnotation=o)},b.parseClassField=function(r){if(r.key.type==="PrivateIdentifier")r.abstract&&this.raise(r.start,ae.PrivateElementHasAbstract),r.accessibility&&this.raise(r.start,ae.PrivateElementHasAccessibility({modifier:r.accessibility})),this.parseClassPropertyAnnotation(r);else if(this.parseClassPropertyAnnotation(r),this.isAmbientContext&&(!r.readonly||r.typeAnnotation)&&this.match(c.eq)&&this.raise(this.start,ae.DeclareClassFieldHasInitializer),r.abstract&&this.match(c.eq)){var o=r.key;this.raise(this.start,ae.AbstractPropertyHasInitializer({propertyName:o.type!=="Identifier"||r.computed?"["+this.input.slice(o.start,o.end)+"]":o.name}))}return j.prototype.parseClassField.call(this,r)},b.parseClassMethod=function(r,o,f,y){var C=r.kind==="constructor",A=r.key.type==="PrivateIdentifier",w=this.tsTryParseTypeParameters();A?(w&&(r.typeParameters=w),r.accessibility&&this.raise(r.start,ae.PrivateMethodsHasAccessibility({modifier:r.accessibility}))):w&&C&&this.raise(w.start,ae.ConstructorHasTypeParameters);var L=r.declare,N=r.kind;!(L!==void 0&&L)||N!=="get"&&N!=="set"||this.raise(r.start,ae.DeclareAccessor({kind:N})),w&&(r.typeParameters=w);var G=r.key;r.kind==="constructor"?(o&&this.raise(G.start,"Constructor can't be a generator"),f&&this.raise(G.start,"Constructor can't be an async method")):r.static&&Kn(r,"prototype")&&this.raise(G.start,"Classes may not have a static property named prototype");var Q=r.value=this.parseMethod(o,f,y,!0,r);return r.kind==="get"&&Q.params.length!==0&&this.raiseRecoverable(Q.start,"getter should have no params"),r.kind==="set"&&Q.params.length!==1&&this.raiseRecoverable(Q.start,"setter should have exactly one param"),r.kind==="set"&&Q.params[0].type==="RestElement"&&this.raiseRecoverable(Q.params[0].start,"Setter cannot use rest params"),this.finishNode(r,"MethodDefinition")},b.isClassMethod=function(){return this.match(c.relational)},b.parseClassElement=function(r){var o=this;if(this.eat(c.semi))return null;var f,y=this.options.ecmaVersion,C=this.startNode(),A="",w=!1,L=!1,N="method",G=["declare","private","public","protected","accessor","override","abstract","readonly","static"],Q=this.tsParseModifiers({modified:C,allowedModifiers:G,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:ae.InvalidModifierOnTypeParameterPositions});f=!!Q.static;var B=function(){if(!o.tsIsStartOfStaticBlocks()){var W=o.tsTryParseIndexSignature(C);if(W)return C.abstract&&o.raise(C.start,ae.IndexSignatureHasAbstract),C.accessibility&&o.raise(C.start,ae.IndexSignatureHasAccessibility({modifier:C.accessibility})),C.declare&&o.raise(C.start,ae.IndexSignatureHasDeclare),C.override&&o.raise(C.start,ae.IndexSignatureHasOverride),W;if(!o.inAbstractClass&&C.abstract&&o.raise(C.start,ae.NonAbstractClassHasAbstractMethod),C.override&&r&&o.raise(C.start,ae.OverrideNotInSubClass),C.static=f,f&&(o.isClassElementNameStart()||o.type===c.star||(A="static")),!A&&y>=8&&o.eatContextual("async")&&(!o.isClassElementNameStart()&&o.type!==c.star||o.canInsertSemicolon()?A="async":L=!0),!A&&(y>=9||!L)&&o.eat(c.star)&&(w=!0),!A&&!L&&!w){var U=o.value;(o.eatContextual("get")||o.eatContextual("set"))&&(o.isClassElementNameStart()?N=U:A=U)}if(A?(C.computed=!1,C.key=o.startNodeAt(o.lastTokStart,o.lastTokStartLoc),C.key.name=A,o.finishNode(C.key,"Identifier")):o.parseClassElementName(C),o.parsePostMemberNameModifiers(C),o.isClassMethod()||y<13||o.type===c.parenL||N!=="method"||w||L){var Y=!C.static&&Kn(C,"constructor"),oe=Y&&r;Y&&N!=="method"&&o.raise(C.key.start,"Constructor can't have get/set modifier"),C.kind=Y?"constructor":N,o.parseClassMethod(C,w,L,oe)}else o.parseClassField(C);return C}if(o.next(),o.next(),o.tsHasSomeModifiers(C,G)&&o.raise(o.start,ae.StaticBlockCannotHaveModifier),y>=13)return j.prototype.parseClassStaticBlock.call(o,C),C};return C.declare?this.tsInAmbientContext(B):B(),C},b.isClassElementNameStart=function(){return!!this.tsIsIdentifier()||j.prototype.isClassElementNameStart.call(this)},b.parseClassSuper=function(r){j.prototype.parseClassSuper.call(this,r),r.superClass&&(this.tsMatchLeftRelational()||this.match(c.bitShift))&&(r.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual("implements")&&(r.implements=this.tsParseHeritageClause("implements"))},b.parseFunctionParams=function(r){var o=this.tsTryParseTypeParameters();o&&(r.typeParameters=o),j.prototype.parseFunctionParams.call(this,r)},b.parseVarId=function(r,o){j.prototype.parseVarId.call(this,r,o),r.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.value==="!"&&this.eat(c.prefix)&&(r.definite=!0);var f=this.tsTryParseTypeAnnotation();f&&(r.id.typeAnnotation=f,this.resetEndLocation(r.id))},b.parseArrowExpression=function(r,o,f,y){this.match(c.colon)&&(r.returnType=this.tsParseTypeAnnotation());var C=this.yieldPos,A=this.awaitPos,w=this.awaitIdentPos;this.enterScope(16|Rs(f,!1)),this.initFunction(r);var L=this.maybeInArrowParameters;return this.options.ecmaVersion>=8&&(r.async=!!f),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,r.params=this.toAssignableList(o,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(r,!0,!1,y),this.yieldPos=C,this.awaitPos=A,this.awaitIdentPos=w,this.maybeInArrowParameters=L,this.finishNode(r,"ArrowFunctionExpression")},b.parseMaybeAssignOrigin=function(r,o,f){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(r);this.exprAllowed=!1}var y=!1,C=-1,A=-1,w=-1;o?(C=o.parenthesizedAssign,A=o.trailingComma,w=o.doubleProto,o.parenthesizedAssign=o.trailingComma=-1):(o=new ai,y=!0);var L=this.start,N=this.startLoc;(this.type===c.parenL||X(this.type))&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=r==="await");var G=this.parseMaybeConditional(r,o);if(f&&(G=f.call(this,G,L,N)),this.type.isAssign){var Q=this.startNodeAt(L,N);return Q.operator=this.value,this.type===c.eq&&(G=this.toAssignable(G,!0,o)),y||(o.parenthesizedAssign=o.trailingComma=o.doubleProto=-1),o.shorthandAssign>=G.start&&(o.shorthandAssign=-1),this.type===c.eq?this.checkLValPattern(G):this.checkLValSimple(G),Q.left=G,this.next(),Q.right=this.parseMaybeAssign(r),w>-1&&(o.doubleProto=w),this.finishNode(Q,"AssignmentExpression")}return y&&this.checkExpressionErrors(o,!0),C>-1&&(o.parenthesizedAssign=C),A>-1&&(o.trailingComma=A),G},b.parseMaybeAssign=function(r,o,f){var y,C,A,w,L,N,G,Q,B,W,U,Y=this;if(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational()){if(Q=this.cloneCurLookaheadState(),!(B=this.tryParse(function(){return Y.parseMaybeAssignOrigin(r,o,f)},Q)).error)return B.node;var oe=this.context,de=oe[oe.length-1];de===S.tokContexts.tc_oTag&&oe[oe.length-2]===S.tokContexts.tc_expr?(oe.pop(),oe.pop()):de!==S.tokContexts.tc_oTag&&de!==S.tokContexts.tc_expr||oe.pop()}if(!((y=B)!=null&&y.error||this.tsMatchLeftRelational()))return this.parseMaybeAssignOrigin(r,o,f);Q&&!this.compareLookaheadState(Q,this.getCurLookaheadState())||(Q=this.cloneCurLookaheadState());var ge=this.tryParse(function(we){var Ie,lt;U=Y.tsParseTypeParameters();var Fe=Y.parseMaybeAssignOrigin(r,o,f);return(Fe.type!=="ArrowFunctionExpression"||(Ie=Fe.extra)!=null&&Ie.parenthesized)&&we(),((lt=U)==null?void 0:lt.params.length)!==0&&Y.resetStartLocationFromNode(Fe,U),Fe.typeParameters=U,Fe},Q);if(!ge.error&&!ge.aborted)return U&&this.reportReservedArrowTypeParam(U),ge.node;if(!B&&(Xn(!0),!(W=this.tryParse(function(){return Y.parseMaybeAssignOrigin(r,o,f)},Q)).error))return W.node;if((C=B)!=null&&C.node)return this.setLookaheadState(B.failState),B.node;if(ge.node)return this.setLookaheadState(ge.failState),U&&this.reportReservedArrowTypeParam(U),ge.node;if((A=W)!=null&&A.node)return this.setLookaheadState(W.failState),W.node;throw(w=B)!=null&&w.thrown?B.error:ge.thrown?ge.error:(L=W)!=null&&L.thrown?W.error:((N=B)==null?void 0:N.error)||ge.error||((G=W)==null?void 0:G.error)},b.parseAssignableListItem=function(r){for(var o=[];this.match(O.at);)o.push(this.parseDecorator());var f,y=this.start,C=this.startLoc,A=!1,w=!1;if(r!==void 0){var L={};this.tsParseModifiers({modified:L,allowedModifiers:["public","private","protected","override","readonly"]}),f=L.accessibility,w=L.override,A=L.readonly,r===!1&&(f||A||w)&&this.raise(C.start,ae.UnexpectedParameterModifier)}var N=this.parseMaybeDefault(y,C);this.parseBindingListItem(N);var G=this.parseMaybeDefault(N.start,N.loc,N);if(o.length&&(G.decorators=o),f||A||w){var Q=this.startNodeAt(y,C);return f&&(Q.accessibility=f),A&&(Q.readonly=A),w&&(Q.override=w),G.type!=="Identifier"&&G.type!=="AssignmentPattern"&&this.raise(Q.start,ae.UnsupportedParameterPropertyKind),Q.parameter=G,this.finishNode(Q,"TSParameterProperty")}return G},b.checkLValInnerPattern=function(r,o,f){o===void 0&&(o=0),r.type==="TSParameterProperty"?this.checkLValInnerPattern(r.parameter,o,f):j.prototype.checkLValInnerPattern.call(this,r,o,f)},b.parseBindingListItem=function(r){this.eat(c.question)&&(r.type==="Identifier"||this.isAmbientContext||this.inType||this.raise(r.start,ae.PatternIsOptional),r.optional=!0);var o=this.tsTryParseTypeAnnotation();return o&&(r.typeAnnotation=o),this.resetEndLocation(r),r},b.isAssignable=function(r,o){var f=this;switch(r.type){case"TSTypeCastExpression":return this.isAssignable(r.expression,o);case"TSParameterProperty":case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":var y=r.properties.length-1;return r.properties.every(function(C,A){return C.type!=="ObjectMethod"&&(A===y||C.type!=="SpreadElement")&&f.isAssignable(C)});case"Property":case"ObjectProperty":return this.isAssignable(r.value);case"SpreadElement":return this.isAssignable(r.argument);case"ArrayExpression":return r.elements.every(function(C){return C===null||f.isAssignable(C)});case"AssignmentExpression":return r.operator==="=";case"ParenthesizedExpression":return this.isAssignable(r.expression);case"MemberExpression":case"OptionalMemberExpression":return!o;default:return!1}},b.toAssignable=function(r,o,f){switch(o===void 0&&(o=!1),f===void 0&&(f=new ai),r.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(r,o,f);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":return o||this.raise(r.start,ae.UnexpectedTypeCastInParameter),this.toAssignable(r.expression,o,f);case"MemberExpression":break;case"AssignmentExpression":return o||r.left.type!=="TSTypeCastExpression"||(r.left=this.typeCastToParameter(r.left)),j.prototype.toAssignable.call(this,r,o,f);case"TSTypeCastExpression":return this.typeCastToParameter(r);default:return j.prototype.toAssignable.call(this,r,o,f)}return r},b.toAssignableParenthesizedExpression=function(r,o,f){switch(r.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":return this.toAssignable(r.expression,o,f);default:return j.prototype.toAssignable.call(this,r,o,f)}},b.curPosition=function(){if(this.options.locations){var r=j.prototype.curPosition.call(this);return Object.defineProperty(r,"offset",{get:function(){return function(o){var f=new v.Position(this.line,this.column+o);return f.index=this.index+o,f}}}),r.index=this.pos,r}},b.parseBindingAtom=function(){return this.type===c._this?this.parseIdent(!0):j.prototype.parseBindingAtom.call(this)},b.shouldParseArrow=function(r){var o,f=this;if(o=this.match(c.colon)?r.every(function(C){return f.isAssignable(C,!0)}):!this.canInsertSemicolon()){if(this.match(c.colon)){var y=this.tryParse(function(C){var A=f.tsParseTypeOrTypePredicateAnnotation(c.colon);return!f.canInsertSemicolon()&&f.match(c.arrow)||C(),A});if(y.aborted)return this.shouldParseArrowReturnType=void 0,!1;y.thrown||(y.error&&this.setLookaheadState(y.failState),this.shouldParseArrowReturnType=y.node)}return!!this.match(c.arrow)||(this.shouldParseArrowReturnType=void 0,!1)}return this.shouldParseArrowReturnType=void 0,o},b.parseParenArrowList=function(r,o,f,y){var C=this.startNodeAt(r,o);return C.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(C,f,!1,y)},b.parseParenAndDistinguishExpression=function(r,o){var f,y=this.start,C=this.startLoc,A=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){var w=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();var L,N=this.start,G=this.startLoc,Q=[],B=!0,W=!1,U=new ai,Y=this.yieldPos,oe=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==c.parenR;){if(B?B=!1:this.expect(c.comma),A&&this.afterTrailingComma(c.parenR,!0)){W=!0;break}if(this.type===c.ellipsis){L=this.start,Q.push(this.parseParenItem(this.parseRestBinding())),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}Q.push(this.parseMaybeAssign(o,U,this.parseParenItem))}var de=this.lastTokEnd,ge=this.lastTokEndLoc;if(this.expect(c.parenR),this.maybeInArrowParameters=w,r&&this.shouldParseArrow(Q)&&this.eat(c.arrow))return this.checkPatternErrors(U,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Y,this.awaitPos=oe,this.parseParenArrowList(y,C,Q,o);Q.length&&!W||this.unexpected(this.lastTokStart),L&&this.unexpected(L),this.checkExpressionErrors(U,!0),this.yieldPos=Y||this.yieldPos,this.awaitPos=oe||this.awaitPos,Q.length>1?((f=this.startNodeAt(N,G)).expressions=Q,this.finishNodeAt(f,"SequenceExpression",de,ge)):f=Q[0]}else f=this.parseParenExpression();if(this.options.preserveParens){var we=this.startNodeAt(y,C);return we.expression=f,this.finishNode(we,"ParenthesizedExpression")}return f},b.parseTaggedTemplateExpression=function(r,o,f,y){var C=this.startNodeAt(o,f);return C.tag=r,C.quasi=this.parseTemplate({isTagged:!0}),y&&this.raise(o,"Tagged Template Literals are not allowed in optionalChain."),this.finishNode(C,"TaggedTemplateExpression")},b.shouldParseAsyncArrow=function(){var r=this;if(!this.match(c.colon))return!this.canInsertSemicolon()&&this.eat(c.arrow);var o=this.tryParse(function(f){var y=r.tsParseTypeOrTypePredicateAnnotation(c.colon);return!r.canInsertSemicolon()&&r.match(c.arrow)||f(),y});return o.aborted?(this.shouldParseAsyncArrowReturnType=void 0,!1):o.thrown?void 0:(o.error&&this.setLookaheadState(o.failState),this.shouldParseAsyncArrowReturnType=o.node,!this.canInsertSemicolon()&&this.eat(c.arrow))},b.parseSubscriptAsyncArrow=function(r,o,f,y){var C=this.startNodeAt(r,o);return C.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(C,f,!0,y)},b.parseExprList=function(r,o,f,y){for(var C=[],A=!0;!this.eat(r);){if(A)A=!1;else if(this.expect(c.comma),o&&this.afterTrailingComma(r))break;var w=void 0;f&&this.type===c.comma?w=null:this.type===c.ellipsis?(w=this.parseSpread(y),y&&this.type===c.comma&&y.trailingComma<0&&(y.trailingComma=this.start)):w=this.parseMaybeAssign(!1,y,this.parseParenItem),C.push(w)}return C},b.parseSubscript=function(r,o,f,y,C,A,w){var L=this,N=A;if(!this.hasPrecedingLineBreak()&&this.value==="!"&&this.match(c.prefix)){this.exprAllowed=!1,this.next();var G=this.startNodeAt(o,f);return G.expression=r,r=this.finishNode(G,"TSNonNullExpression")}var Q=!1;if(this.match(c.questionDot)&&this.lookaheadCharCode()===60){if(y)return r;r.optional=!0,N=Q=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(c.bitShift)){var B,W=this.tsTryParseAndCatch(function(){if(!y&&L.atPossibleAsyncArrow(r)){var He=L.tsTryParseGenericAsyncArrowFunction(o,f,w);if(He)return r=He}var vt=L.tsParseTypeArgumentsInExpression();if(!vt)return r;if(Q&&!L.match(c.parenL))return B=L.curPosition(),r;if(d(L.type)||L.type===c.backQuote){var Bt=L.parseTaggedTemplateExpression(r,o,f,N);return Bt.typeParameters=vt,Bt}if(!y&&L.eat(c.parenL)){var Ft=new ai,be=L.startNodeAt(o,f);return be.callee=r,be.arguments=L.parseExprList(c.parenR,L.options.ecmaVersion>=8,!1,Ft),L.tsCheckForInvalidTypeCasts(be.arguments),be.typeParameters=vt,N&&(be.optional=Q),L.checkExpressionErrors(Ft,!0),r=L.finishNode(be,"CallExpression")}var Ne=L.type;if(!(L.tsMatchRightRelational()||Ne===c.bitShift||Ne!==c.parenL&&(Pe=Ne,!!Pe.startsExpr)&&!L.hasPrecedingLineBreak())){var Pe,jt=L.startNodeAt(o,f);return jt.expression=r,jt.typeParameters=vt,L.finishNode(jt,"TSInstantiationExpression")}});if(B&&this.unexpected(B),W)return W.type==="TSInstantiationExpression"&&(this.match(c.dot)||this.match(c.questionDot)&&this.lookaheadCharCode()!==40)&&this.raise(this.start,ae.InvalidPropertyAccessAfterInstantiationExpression),r=W}var U=this.options.ecmaVersion>=11,Y=U&&this.eat(c.questionDot);y&&Y&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var oe=this.eat(c.bracketL);if(oe||Y&&this.type!==c.parenL&&this.type!==c.backQuote||this.eat(c.dot)){var de=this.startNodeAt(o,f);de.object=r,oe?(de.property=this.parseExpression(),this.expect(c.bracketR)):de.property=this.type===c.privateId&&r.type!=="Super"?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!=="never"),de.computed=!!oe,U&&(de.optional=Y),r=this.finishNode(de,"MemberExpression")}else if(!y&&this.eat(c.parenL)){var ge=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;var we=new ai,Ie=this.yieldPos,lt=this.awaitPos,Fe=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var kt=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1,we);if(C&&!Y&&this.shouldParseAsyncArrow())this.checkPatternErrors(we,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=Ie,this.awaitPos=lt,this.awaitIdentPos=Fe,r=this.parseSubscriptAsyncArrow(o,f,kt,w);else{this.checkExpressionErrors(we,!0),this.yieldPos=Ie||this.yieldPos,this.awaitPos=lt||this.awaitPos,this.awaitIdentPos=Fe||this.awaitIdentPos;var st=this.startNodeAt(o,f);st.callee=r,st.arguments=kt,U&&(st.optional=Y),r=this.finishNode(st,"CallExpression")}this.maybeInArrowParameters=ge}else if(this.type===c.backQuote){(Y||N)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var gt=this.startNodeAt(o,f);gt.tag=r,gt.quasi=this.parseTemplate({isTagged:!0}),r=this.finishNode(gt,"TaggedTemplateExpression")}return r},b.parseGetterSetter=function(r){r.kind=r.key.name,this.parsePropertyName(r),r.value=this.parseMethod(!1);var o=r.kind==="get"?0:1,f=r.value.params[0],y=f&&this.isThisParam(f);r.value.params.length!==(o=y?o+1:o)?this.raiseRecoverable(r.value.start,r.kind==="get"?"getter should have no params":"setter should have exactly one param"):r.kind==="set"&&r.value.params[0].type==="RestElement"&&this.raiseRecoverable(r.value.params[0].start,"Setter cannot use rest params")},b.parseProperty=function(r,o){if(!r){var f=[];if(this.match(O.at))for(;this.match(O.at);)f.push(this.parseDecorator());var y=j.prototype.parseProperty.call(this,r,o);return y.type==="SpreadElement"&&f.length&&this.raise(y.start,"Decorators can't be used with SpreadElement"),f.length&&(y.decorators=f,f=[]),y}return j.prototype.parseProperty.call(this,r,o)},b.parseCatchClauseParam=function(){var r=this.parseBindingAtom(),o=r.type==="Identifier";this.enterScope(o?32:0),this.checkLValPattern(r,o?4:2);var f=this.tsTryParseTypeAnnotation();return f&&(r.typeAnnotation=f,this.resetEndLocation(r)),this.expect(c.parenR),r},b.parseClass=function(r,o){var f=this.inAbstractClass;this.inAbstractClass=!!r.abstract;try{this.next(),this.takeDecorators(r);var y=this.strict;this.strict=!0,this.parseClassId(r,o),this.parseClassSuper(r);var C=this.enterClassBody(),A=this.startNode(),w=!1;A.body=[];var L=[];for(this.expect(c.braceL);this.type!==c.braceR;)if(this.match(O.at))L.push(this.parseDecorator());else{var N=this.parseClassElement(r.superClass!==null);L.length&&(N.decorators=L,this.resetStartLocationFromNode(N,L[0]),L=[]),N&&(A.body.push(N),N.type==="MethodDefinition"&&N.kind==="constructor"&&N.value.type==="FunctionExpression"?(w&&this.raiseRecoverable(N.start,"Duplicate constructor in the same class"),w=!0,N.decorators&&N.decorators.length>0&&this.raise(N.start,"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")):N.key&&N.key.type==="PrivateIdentifier"&&zc(C,N)&&this.raiseRecoverable(N.key.start,"Identifier '#"+N.key.name+"' has already been declared"))}return this.strict=y,this.next(),L.length&&this.raise(this.start,"Decorators must be attached to a class element."),r.body=this.finishNode(A,"ClassBody"),this.exitClassBody(),this.finishNode(r,o?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=f}},b.parseClassFunctionParams=function(){var r=this.tsTryParseTypeParameters(this.tsParseConstModifier),o=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8,!0);return r&&(o.typeParameters=r),o},b.parseMethod=function(r,o,f,y,C){var A=this.startNode(),w=this.yieldPos,L=this.awaitPos,N=this.awaitIdentPos;if(this.initFunction(A),this.options.ecmaVersion>=6&&(A.generator=r),this.options.ecmaVersion>=8&&(A.async=!!o),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|Rs(o,A.generator)|(f?128:0)),this.expect(c.parenL),A.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(A,!1,!0,!1,{isClassMethod:y}),this.yieldPos=w,this.awaitPos=L,this.awaitIdentPos=N,C&&C.abstract&&A.body){var G=C.key;this.raise(C.start,ae.AbstractMethodHasImplementation({methodName:G.type!=="Identifier"||C.computed?"["+this.input.slice(G.start,G.end)+"]":G.name}))}return this.finishNode(A,"FunctionExpression")},he.parse=function(r,o){if(o.locations===!1)throw new Error("You have to enable options.locations while using acorn-typescript");o.locations=!0;var f=new this(o,r);return n&&(f.isAmbientContext=!0),f.parse()},he.parseExpressionAt=function(r,o,f){if(f.locations===!1)throw new Error("You have to enable options.locations while using acorn-typescript");f.locations=!0;var y=new this(f,r,o);return n&&(y.isAmbientContext=!0),y.nextToken(),y.parseExpression()},b.parseImportSpecifier=function(){if(this.ts_isContextual(O.type)){var r=this.startNode();return r.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(r,!0,this.importOrExportOuterKind==="type"),this.finishNode(r,"ImportSpecifier")}var o=j.prototype.parseImportSpecifier.call(this);return o.importKind="value",o},b.parseExportSpecifier=function(r){var o=this.ts_isContextual(O.type);if(!this.match(c.string)&&o){var f=this.startNode();return f.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(f,!1,this.importOrExportOuterKind==="type"),this.finishNode(f,"ExportSpecifier"),this.checkExport(r,f.exported,f.exported.start),f}var y=j.prototype.parseExportSpecifier.call(this,r);return y.exportKind="value",y},b.parseTypeOnlyImportExportSpecifier=function(r,o,f){var y,C=o?"imported":"local",A=o?"local":"exported",w=r[C],L=!1,N=!0,G=w.start;if(this.isContextual("as")){var Q=this.parseIdent();if(this.isContextual("as")){var B=this.parseIdent();ne(this.type)?(L=!0,w=Q,y=o?this.parseIdent():this.parseModuleExportName(),N=!1):(y=B,N=!1)}else ne(this.type)?(N=!1,y=o?this.parseIdent():this.parseModuleExportName()):(L=!0,w=Q)}else ne(this.type)&&(L=!0,o?(w=j.prototype.parseIdent.call(this,!0),this.isContextual("as")||this.checkUnreserved(w)):w=this.parseModuleExportName());L&&f&&this.raise(G,o?ae.TypeModifierIsUsedInTypeImports:ae.TypeModifierIsUsedInTypeExports),r[C]=w,r[A]=y,r[o?"importKind":"exportKind"]=L?"type":"value",N&&this.eatContextual("as")&&(r[A]=o?this.parseIdent():this.parseModuleExportName()),r[A]||(r[A]=this.copyNode(r[C])),o&&this.checkLValSimple(r[A],2)},b.raiseCommonCheck=function(r,o,f){return o==="Comma is not permitted after the rest element"?this.isAmbientContext&&this.match(c.comma)&&this.lookaheadCharCode()===41?void this.next():j.prototype.raise.call(this,r,o):f?j.prototype.raiseRecoverable.call(this,r,o):j.prototype.raise.call(this,r,o)},b.raiseRecoverable=function(r,o){return this.raiseCommonCheck(r,o,!0)},b.raise=function(r,o){return this.raiseCommonCheck(r,o,!0)},b.updateContext=function(r){var o=this.type;if(o==c.braceL){var f=this.curContext();f==H.tc_oTag?this.context.push(E.b_expr):f==H.tc_expr?this.context.push(E.b_tmpl):j.prototype.updateContext.call(this,r),this.exprAllowed=!0}else{if(o!==c.slash||r!==O.jsxTagStart)return j.prototype.updateContext.call(this,r);this.context.length-=2,this.context.push(H.tc_cTag),this.exprAllowed=!1}},b.jsx_parseOpeningElementAt=function(r,o){var f=this,y=this.startNodeAt(r,o),C=this.jsx_parseElementName();if(C&&(y.name=C),this.match(c.relational)||this.match(c.bitShift)){var A=this.tsTryParseAndCatch(function(){return f.tsParseTypeArgumentsInExpression()});A&&(y.typeParameters=A)}for(y.attributes=[];this.type!==c.slash&&this.type!==O.jsxTagEnd;)y.attributes.push(this.jsx_parseAttribute());return y.selfClosing=this.eat(c.slash),this.expect(O.jsxTagEnd),this.finishNode(y,C?"JSXOpeningElement":"JSXOpeningFragment")},b.enterScope=function(r){r===ri&&this.importsStack.push([]),j.prototype.enterScope.call(this,r);var o=j.prototype.currentScope.call(this);o.types=[],o.enums=[],o.constEnums=[],o.classes=[],o.exportOnlyBindings=[]},b.exitScope=function(){j.prototype.currentScope.call(this).flags===ri&&this.importsStack.pop(),j.prototype.exitScope.call(this)},b.hasImport=function(r,o){var f=this.importsStack.length;if(this.importsStack[f-1].indexOf(r)>-1)return!0;if(!o&&f>1){for(var y=0;y<f-1;y++)if(this.importsStack[y].indexOf(r)>-1)return!0}return!1},b.maybeExportDefined=function(r,o){this.inModule&&1&r.flags&&this.undefinedExports.delete(o)},b.isRedeclaredInScope=function(r,o,f){return!!(0&f)&&(2&f?r.lexical.indexOf(o)>-1||r.functions.indexOf(o)>-1||r.var.indexOf(o)>-1:3&f?r.lexical.indexOf(o)>-1||!j.prototype.treatFunctionsAsVarInScope.call(this,r)&&r.var.indexOf(o)>-1:r.lexical.indexOf(o)>-1&&!(32&r.flags&&r.lexical[0]===o)||!this.treatFunctionsAsVarInScope(r)&&r.functions.indexOf(o)>-1)},b.checkRedeclarationInScope=function(r,o,f,y){this.isRedeclaredInScope(r,o,f)&&this.raise(y,"Identifier '"+o+"' has already been declared.")},b.declareName=function(r,o,f){if(4096&o)return this.hasImport(r,!0)&&this.raise(f,"Identifier '"+r+"' has already been declared."),void this.importsStack[this.importsStack.length-1].push(r);var y=this.currentScope();if(1024&o)return this.maybeExportDefined(y,r),void y.exportOnlyBindings.push(r);j.prototype.declareName.call(this,r,o,f),0&o&&(0&o||(this.checkRedeclarationInScope(y,r,o,f),this.maybeExportDefined(y,r)),y.types.push(r)),256&o&&y.enums.push(r),512&o&&y.constEnums.push(r),128&o&&y.classes.push(r)},b.checkLocalExport=function(r){var o=r.name;if(!this.hasImport(o)){for(var f=this.scopeStack.length-1;f>=0;f--){var y=this.scopeStack[f];if(y.types.indexOf(o)>-1||y.exportOnlyBindings.indexOf(o)>-1)return}j.prototype.checkLocalExport.call(this,r)}},ue=he,P=[{key:"acornTypeScript",get:function(){return S}}],(M=[{key:"acornTypeScript",get:function(){return S}}])&&Wn(ue.prototype,M),P&&Wn(ue,P),Object.defineProperty(ue,"prototype",{writable:!1}),he})(m);return V}}var oi=class{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:i=>this.replacement=i}}replace(i,s,n,u){i&&s&&(n!=null?i[s][n]=u:i[s]=u)}remove(i,s,n){i&&s&&(n!=null?i[s].splice(n,1):delete i[s])}};var qi=class extends oi{constructor(i,s){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:n=>this.replacement=n},this.enter=i,this.leave=s}visit(i,s,n,u){if(i){if(this.enter){let m=this.should_skip,v=this.should_remove,S=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,i,s,n,u),this.replacement&&(i=this.replacement,this.replace(s,n,u,i)),this.should_remove&&this.remove(s,n,u);let c=this.should_skip,I=this.should_remove;if(this.should_skip=m,this.should_remove=v,this.replacement=S,c)return i;if(I)return null}let l;for(l in i){let m=i[l];if(m&&typeof m=="object")if(Array.isArray(m)){let v=m;for(let S=0;S<v.length;S+=1){let c=v[S];Yn(c)&&(this.visit(c,i,l,S)||S--)}}else Yn(m)&&this.visit(m,i,l,null)}if(this.leave){let m=this.replacement,v=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,i,s,n,u),this.replacement&&(i=this.replacement,this.replace(s,n,u,i)),this.should_remove&&this.remove(s,n,u);let S=this.should_remove;if(this.replacement=m,this.should_remove=v,S)return null}}return i}};function Yn(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}function Zn(e,{enter:i,leave:s}){return new qi(i,s).visit(e,null)}var Vs="__componentSourceLoc",Ds="$componentSourceLoc";var el=ke.extend(Ms(),(0,eo.default)()),tl=ke.extend(Ms());function il(e){return/\.[jt]sx$/.test(e)?el:tl}function Bs(e,i,s){let n=s||process.cwd();return`${e.startsWith(n)?e.slice(n.length+1):e}:${i.line}:${i.column+1}`}function Fs(e){return/^[A-Z]/.test(e)}function sl(e){if(!e)return!1;if(e.type==="ArrowFunctionExpression"||e.type==="FunctionExpression")return!0;if(e.type!=="CallExpression")return!1;let i=e.callee;if(i.type==="Identifier")return["memo","forwardRef"].includes(i.name);if(i.type==="MemberExpression"){let s=i.object,n=i.property;if(s.type==="Identifier"&&s.name==="React"&&n.type==="Identifier")return["memo","forwardRef"].includes(n.name)}return!1}function js(e,i){let{filename:s,projectRoot:n=process.cwd(),injectJsxSource:u=!0,injectComponentSource:l=!0}=i,m=/\.[jt]sx$/.test(s),v;try{v=il(s).parse(e,{ecmaVersion:"latest",sourceType:"module",locations:!0})}catch{return null}let S=[],c=[],I=new Set,k=[];if(Zn(v,{enter(_){let E=k[k.length-1]??null,D=k[k.length-2]??null;if(u&&m&&_.type==="JSXElement"){let O=_.openingElement,H=O.name,K=!1;if(H.type==="JSXIdentifier"?K=Fs(H.name):H.type==="JSXMemberExpression"&&(K=!0),K&&_.loc&&H.end!==void 0&&!O.attributes.some(d=>d.type==="JSXAttribute"&&d.name?.name===Ds)){let d=Bs(s,_.loc.start,n);S.push({at:H.end,text:` ${Ds}="${d}"`})}}if(l&&_.type==="FunctionDeclaration"){let O=_.id?.name,H=E?.type==="Program"||E?.type==="ExportNamedDeclaration"||E?.type==="ExportDefaultDeclaration";if(O&&Fs(O)&&H&&!I.has(O)&&_.loc){I.add(O);let K=Bs(s,_.loc.start,n),$=E?.type==="ExportNamedDeclaration"||E?.type==="ExportDefaultDeclaration"?E.end:_.end;$!==void 0&&S.push({at:$,text:`
|
|
28
28
|
${O}.${Vs} = "${K}";`})}}if(l&&_.type==="VariableDeclarator"){let O=_.id,H=E?.type==="VariableDeclaration"&&(D?.type==="Program"||D?.type==="ExportNamedDeclaration"||D?.type==="ExportDefaultDeclaration");if(O.type==="Identifier"&&Fs(O.name)&&H&&!I.has(O.name)){let K=_.init;if(K&&sl(K)){let $=_.loc||K.loc;if($){I.add(O.name);let d=Bs(s,$.start,n),re=D?.type==="ExportNamedDeclaration"||D?.type==="ExportDefaultDeclaration"?D.end:E?.end;re!==void 0&&S.push({at:re,text:`
|
|
29
|
-
${O.name}.${Vs} = "${d}";`})}}}}k.push(_)},leave(){k.pop()}}),S.length===0&&c.length===0)return null;S.sort((_,E)=>E.at-_.at);let F=e;for(let{at:_,text:E}of S)F=F.slice(0,_)+E+F.slice(_);return c.length>0&&(F+=c.join("")),{code:F}}var Us="virtual:react-code-locator/client",to=`\0${Us}`;function rl(e={}){let
|
|
29
|
+
${O.name}.${Vs} = "${d}";`})}}}}k.push(_)},leave(){k.pop()}}),S.length===0&&c.length===0)return null;S.sort((_,E)=>E.at-_.at);let F=e;for(let{at:_,text:E}of S)F=F.slice(0,_)+E+F.slice(_);return c.length>0&&(F+=c.join("")),{code:F}}var Us="virtual:react-code-locator/client",to=`\0${Us}`;function rl(e={},i){let s=JSON.stringify({...e,projectRoot:i});return{name:"react-code-locator-client-injector",apply:"serve",resolveId(n){return n===Us?to:null},load(n){return n!==to?null:`
|
|
30
30
|
import { enableReactComponentJump } from "react-code-locator/client";
|
|
31
31
|
|
|
32
|
-
enableReactComponentJump(${
|
|
33
|
-
`},transformIndexHtml(){return[{tag:"script",attrs:{type:"module",src:`/@id/__x00__${Us}`},injectTo:"head"}]}}}function io(e={}){let{command:i="serve",locator:s={},injectClient:n=!0}=e;return[i==="serve"&&n?rl(s):null].filter(Boolean)}var so=/\.([jt]sx)$/,ro=/node_modules/;function ao(e,i,s){let n=Array.isArray(i)?i:[i];return(Array.isArray(s)?s:[s]).some(l=>l.test(e))?!1:n.some(l=>l.test(e))}var ui=Ka((e={})=>{let{include:i=so,exclude:s=ro,projectRoot:n=process.cwd(),injectComponentSource:u=!0,injectJsxSource:l=!0}=e;return{name:"react-code-locator",enforce:"pre",transform(m,v){return process.env.NODE_ENV!=="development"||!ao(v,i,s)?null:js(m,{filename:v,projectRoot:n,injectComponentSource:u,injectJsxSource:l})}}}),no=ui;function al(e){let{injectClient:i=!0,locator:s,include:n=so,exclude:u=ro,projectRoot:l=process.cwd(),injectComponentSource:m=!0,injectJsxSource:v=!0}=e??{};return[{name:"react-code-locator",enforce:"pre",transform(c,I){return process.env.NODE_ENV!=="development"||!ao(I,n,u)?null:js(c,{filename:I,projectRoot:l,injectComponentSource:m,injectJsxSource:v})}},...io({injectClient:i,locator:s})].filter(Boolean)}var nl=ui.webpack,ol=ui.rollup,ul=ui.esbuild,hl=ui.rspack,cl=no;0&&(module.exports={esbuildPlugin,rollupPlugin,rspackPlugin,unplugin,vitePlugin,webpackPlugin});
|
|
32
|
+
enableReactComponentJump(${s});
|
|
33
|
+
`},transformIndexHtml(){return[{tag:"script",attrs:{type:"module",src:`/@id/__x00__${Us}`},injectTo:"head"}]}}}function io(e={}){let{command:i="serve",locator:s={},injectClient:n=!0,projectRoot:u}=e;return[i==="serve"&&n?rl(s,u):null].filter(Boolean)}var so=/\.([jt]sx)$/,ro=/node_modules/;function ao(e,i,s){let n=Array.isArray(i)?i:[i];return(Array.isArray(s)?s:[s]).some(l=>l.test(e))?!1:n.some(l=>l.test(e))}var ui=Ka((e={})=>{let{include:i=so,exclude:s=ro,projectRoot:n=process.cwd(),injectComponentSource:u=!0,injectJsxSource:l=!0}=e;return{name:"react-code-locator",enforce:"pre",transform(m,v){return process.env.NODE_ENV!=="development"||!ao(v,i,s)?null:js(m,{filename:v,projectRoot:n,injectComponentSource:u,injectJsxSource:l})}}}),no=ui;function al(e){let{injectClient:i=!0,locator:s,include:n=so,exclude:u=ro,projectRoot:l=process.cwd(),injectComponentSource:m=!0,injectJsxSource:v=!0}=e??{};return[{name:"react-code-locator",enforce:"pre",transform(c,I){return process.env.NODE_ENV!=="development"||!ao(I,n,u)?null:js(c,{filename:I,projectRoot:l,injectComponentSource:m,injectJsxSource:v})}},...io({injectClient:i,locator:s,projectRoot:l})].filter(Boolean)}var nl=ui.webpack,ol=ui.rollup,ul=ui.esbuild,hl=ui.rspack,cl=no;0&&(module.exports={esbuildPlugin,rollupPlugin,rspackPlugin,unplugin,vitePlugin,webpackPlugin});
|
|
34
34
|
//# sourceMappingURL=unplugin.cjs.map
|