@epxing/cli 0.5.0-beta.7 → 0.5.0-beta.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.
@@ -5,4 +5,4 @@ var os=Object.create;var gt=Object.defineProperty;var hs=Object.getOwnPropertyDe
5
5
  `):i=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,i}jsxReadString(t){let s="",i=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(u.UnterminatedString,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);if(r===t)break;r===38?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadEntity(),i=this.state.pos):X(r)?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadNewLine(!1),i=this.state.pos):++this.state.pos}s+=this.input.slice(i,this.state.pos++),this.finishToken(134,s)}jsxReadEntity(){let t=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);let i=this.readInt(s,void 0,!1,"bail");if(i!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(i)}else{let s=0,i=!1;for(;s++<10&&this.state.pos<this.length&&!(i=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(i){let r=this.input.slice(t,this.state.pos),n=ei[r];if(++this.state.pos,n)return n}}return this.state.pos=t,"&"}jsxReadWord(){let t,s=this.state.pos;do t=this.input.charCodeAt(++this.state.pos);while(W(t)||t===45);this.finishToken(141,this.input.slice(s,this.state.pos))}jsxParseIdentifier(){let t=this.startNode();return this.match(141)?t.name=this.state.value:Zt(this.state.type)?t.name=z(this.state.type):this.unexpected(),this.next(),this.finishNode(t,"JSXIdentifier")}jsxParseNamespacedName(){let t=this.state.startLoc,s=this.jsxParseIdentifier();if(!this.eat(14))return s;let i=this.startNodeAt(t);return i.namespace=s,i.name=this.jsxParseIdentifier(),this.finishNode(i,"JSXNamespacedName")}jsxParseElementName(){let t=this.state.startLoc,s=this.jsxParseNamespacedName();if(s.type==="JSXNamespacedName")return s;for(;this.eat(16);){let i=this.startNodeAt(t);i.object=s,i.property=this.jsxParseIdentifier(),s=this.finishNode(i,"JSXMemberExpression")}return s}jsxParseAttributeValue(){let t;switch(this.state.type){case 5:return t=this.startNode(),this.setContext(I.brace),this.next(),t=this.jsxParseExpressionContainer(t,I.j_oTag),t.expression.type==="JSXEmptyExpression"&&this.raise(H.AttributeIsEmpty,t),t;case 143:case 134:return this.parseExprAtom();default:throw this.raise(H.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let t=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(t,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(t){return this.next(),t.expression=this.parseExpression(),this.setContext(I.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(t,"JSXSpreadChild")}jsxParseExpressionContainer(t,s){if(this.match(8))t.expression=this.jsxParseEmptyExpression();else{let i=this.parseExpression();t.expression=i}return this.setContext(s),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(t,"JSXExpressionContainer")}jsxParseAttribute(){let t=this.startNode();return this.match(5)?(this.setContext(I.brace),this.next(),this.expect(21),t.argument=this.parseMaybeAssignAllowIn(),this.setContext(I.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(t,"JSXSpreadAttribute")):(t.name=this.jsxParseNamespacedName(),t.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(t,"JSXAttribute"))}jsxParseOpeningElementAt(t){let s=this.startNodeAt(t);return this.eat(144)?this.finishNode(s,"JSXOpeningFragment"):(s.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(s))}jsxParseOpeningElementAfterName(t){let s=[];for(;!this.match(56)&&!this.match(144);)s.push(this.jsxParseAttribute());return t.attributes=s,t.selfClosing=this.eat(56),this.expect(144),this.finishNode(t,"JSXOpeningElement")}jsxParseClosingElementAt(t){let s=this.startNodeAt(t);return this.eat(144)?this.finishNode(s,"JSXClosingFragment"):(s.name=this.jsxParseElementName(),this.expect(144),this.finishNode(s,"JSXClosingElement"))}jsxParseElementAt(t){let s=this.startNodeAt(t),i=[],r=this.jsxParseOpeningElementAt(t),n=null;if(!r.selfClosing){t:for(;;)switch(this.state.type){case 143:if(t=this.state.startLoc,this.next(),this.eat(56)){n=this.jsxParseClosingElementAt(t);break t}i.push(this.jsxParseElementAt(t));break;case 142:i.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let o=this.startNode();this.setContext(I.brace),this.next(),this.match(21)?i.push(this.jsxParseSpreadChild(o)):i.push(this.jsxParseExpressionContainer(o,I.j_expr));break}default:this.unexpected()}V(r)&&!V(n)&&n!==null?this.raise(H.MissingClosingTagFragment,n):!V(r)&&V(n)?this.raise(H.MissingClosingTagElement,n,{openingTagName:J(r.name)}):!V(r)&&!V(n)&&J(n.name)!==J(r.name)&&this.raise(H.MissingClosingTagElement,n,{openingTagName:J(r.name)})}if(V(r)?(s.openingFragment=r,s.closingFragment=n):(s.openingElement=r,s.closingElement=n),s.children=i,this.match(47))throw this.raise(H.UnwrappedAdjacentJSXElements,this.state.startLoc);return V(r)?this.finishNode(s,"JSXFragment"):this.finishNode(s,"JSXElement")}jsxParseElement(){let t=this.state.startLoc;return this.next(),this.jsxParseElementAt(t)}setContext(t){let{context:s}=this.state;s[s.length-1]=t}parseExprAtom(t){return this.match(143)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(143),this.jsxParseElement()):super.parseExprAtom(t)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(t){let s=this.curContext();if(s===I.j_expr){this.jsxReadToken();return}if(s===I.j_oTag||s===I.j_cTag){if(B(t)){this.jsxReadWord();return}if(t===62){++this.state.pos,this.finishToken(144);return}if((t===34||t===39)&&s===I.j_oTag){this.jsxReadString(t);return}}if(t===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(143);return}super.getTokenFromCode(t)}updateContext(t){let{context:s,type:i}=this.state;if(i===56&&t===143)s.splice(-2,2,I.j_cTag),this.state.canStartJSXElement=!1;else if(i===143)s.push(I.j_oTag);else if(i===144){let r=s[s.length-1];r===I.j_oTag&&t===56||r===I.j_cTag?(s.pop(),this.state.canStartJSXElement=s[s.length-1]===I.j_expr):(this.setContext(I.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=vs(i)}},"jsx"),kt=class extends nt{static{p(this,"TypeScriptScope")}constructor(...e){super(...e),this.tsNames=new Map}},vt=class extends ot{static{p(this,"TypeScriptScopeHandler")}constructor(...e){super(...e),this.importsStack=[]}createScope(e){return this.importsStack.push(new Set),new kt(e)}enter(e){e===1024&&this.importsStack.push(new Set),super.enter(e)}exit(){let e=super.exit();return e===1024&&this.importsStack.pop(),e}hasImport(e,t){let s=this.importsStack.length;if(this.importsStack[s-1].has(e))return!0;if(!t&&s>1){for(let i=0;i<s-1;i++)if(this.importsStack[i].has(e))return!0}return!1}declareName(e,t,s){if(t&4096){this.hasImport(e,!0)&&this.parser.raise(u.VarRedeclaration,s,{identifierName:e}),this.importsStack[this.importsStack.length-1].add(e);return}let i=this.currentScope(),r=i.tsNames.get(e)||0;if(t&1024){this.maybeExportDefined(i,e),i.tsNames.set(e,r|16);return}super.declareName(e,t,s),t&2&&(t&1||(this.checkRedeclarationInScope(i,e,t,s),this.maybeExportDefined(i,e)),r=r|1),t&256&&(r=r|2),t&512&&(r=r|4),t&128&&(r=r|8),r&&i.tsNames.set(e,r)}isRedeclaredInScope(e,t,s){let i=e.tsNames.get(t);if((i&2)>0){if(s&256){let r=!!(s&512),n=(i&4)>0;return r!==n}return!0}return s&128&&(i&8)>0?e.names.get(t)&2?!!(s&1):!1:s&2&&(i&1)>0?!0:super.isRedeclaredInScope(e,t,s)}checkLocalExport(e){let{name:t}=e;if(this.hasImport(t))return;let s=this.scopeStack.length;for(let i=s-1;i>=0;i--){let n=this.scopeStack[i].tsNames.get(t);if((n&1)>0||(n&16)>0)return}super.checkLocalExport(e)}},Lt=class{static{p(this,"ProductionParameterHandler")}constructor(){this.stacks=[]}enter(e){this.stacks.push(e)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function ft(a,e){return(a?2:0)|(e?1:0)}p(ft,"functionFlags");var Dt=class{static{p(this,"BaseParser")}constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(e){return e+this.startIndex}offsetToSourcePos(e){return e-this.startIndex}hasPlugin(e){if(typeof e=="string")return this.plugins.has(e);{let[t,s]=e;if(!this.hasPlugin(t))return!1;let i=this.plugins.get(t);for(let r of Object.keys(s))if(i?.[r]!==s[r])return!1;return!0}}getPluginOption(e,t){var s;return(s=this.plugins.get(e))==null?void 0:s[t]}};function ts(a,e){a.trailingComments===void 0?a.trailingComments=e:a.trailingComments.unshift(...e)}p(ts,"setTrailingComments");function ai(a,e){a.leadingComments===void 0?a.leadingComments=e:a.leadingComments.unshift(...e)}p(ai,"setLeadingComments");function ht(a,e){a.innerComments===void 0?a.innerComments=e:a.innerComments.unshift(...e)}p(ht,"setInnerComments");function D(a,e,t){let s=null,i=e.length;for(;s===null&&i>0;)s=e[--i];s===null||s.start>t.start?ht(a,t.comments):ts(s,t.comments)}p(D,"adjustInnerComments");var Ot=class extends Dt{static{p(this,"CommentsParser")}addComment(e){this.filename&&(e.loc.filename=this.filename);let{commentsLen:t}=this.state;this.comments.length!==t&&(this.comments.length=t),this.comments.push(e),this.state.commentsLen++}processComment(e){let{commentStack:t}=this.state,s=t.length;if(s===0)return;let i=s-1,r=t[i];r.start===e.end&&(r.leadingNode=e,i--);let{start:n}=e;for(;i>=0;i--){let o=t[i],h=o.end;if(h>n)o.containingNode=e,this.finalizeComment(o),t.splice(i,1);else{h===n&&(o.trailingNode=e);break}}}finalizeComment(e){var t;let{comments:s}=e;if(e.leadingNode!==null||e.trailingNode!==null)e.leadingNode!==null&&ts(e.leadingNode,s),e.trailingNode!==null&&ai(e.trailingNode,s);else{let i=e.containingNode,r=e.start;if(this.input.charCodeAt(this.offsetToSourcePos(r)-1)===44)switch(i.type){case"ObjectExpression":case"ObjectPattern":D(i,i.properties,e);break;case"CallExpression":case"NewExpression":case"OptionalCallExpression":D(i,i.arguments,e);break;case"ImportExpression":D(i,[i.source,(t=i.options)!=null?t:null],e);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":case"TSTypeParameterDeclaration":D(i,i.params,e);break;case"ArrayExpression":case"ArrayPattern":D(i,i.elements,e);break;case"ExportNamedDeclaration":case"ImportDeclaration":D(i,i.specifiers,e);break;case"TSEnumDeclaration":D(i,i.members,e);break;case"TSEnumBody":D(i,i.members,e);break;case"TSInterfaceBody":D(i,i.body,e);break;default:{if(i.type==="RecordExpression"){D(i,i.properties,e);break}if(i.type==="TupleExpression"){D(i,i.elements,e);break}ht(i,s)}}else ht(i,s)}}finalizeRemainingComments(){let{commentStack:e}=this.state;for(let t=e.length-1;t>=0;t--)this.finalizeComment(e[t]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(e){let{commentStack:t}=this.state,{length:s}=t;if(s===0)return;let i=t[s-1];i.leadingNode===e&&(i.leadingNode=null)}takeSurroundingComments(e,t,s){let{commentStack:i}=this.state,r=i.length;if(r===0)return;let n=r-1;for(;n>=0;n--){let o=i[n],h=o.end;if(o.start===s)o.leadingNode=e;else if(h===t)o.trailingNode=e;else if(h<t)break}}},Mt=class a{static{p(this,"State")}constructor(){this.flags=1024,this.startIndex=void 0,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=140,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[I.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(e){e?this.flags|=1:this.flags&=-2}init({strictMode:e,sourceType:t,startIndex:s,startLine:i,startColumn:r}){this.strict=e===!1?!1:e===!0?!0:t==="module",this.startIndex=s,this.curLine=i,this.lineStart=-r,this.startLoc=this.endLoc=new R(i,r,s)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(e){e?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(e){e?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(e){e?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(e){e?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(e){e?this.flags|=4096:this.flags&=-4097}curPosition(){return new R(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let e=new a;return e.flags=this.flags,e.startIndex=this.startIndex,e.curLine=this.curLine,e.lineStart=this.lineStart,e.startLoc=this.startLoc,e.endLoc=this.endLoc,e.errors=this.errors.slice(),e.potentialArrowAt=this.potentialArrowAt,e.noArrowAt=this.noArrowAt.slice(),e.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),e.topicContext=this.topicContext,e.labels=this.labels.slice(),e.commentsLen=this.commentsLen,e.commentStack=this.commentStack.slice(),e.pos=this.pos,e.type=this.type,e.value=this.value,e.start=this.start,e.end=this.end,e.lastTokEndLoc=this.lastTokEndLoc,e.lastTokStartLoc=this.lastTokStartLoc,e.context=this.context.slice(),e.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,e.strictErrors=this.strictErrors,e.tokensLength=this.tokensLength,e}},ni=p(function(e){return e>=48&&e<=57},"isDigit"),_e={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},ut={bin:p(a=>a===48||a===49,"bin"),oct:p(a=>a>=48&&a<=55,"oct"),dec:p(a=>a>=48&&a<=57,"dec"),hex:p(a=>a>=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102,"hex")};function je(a,e,t,s,i,r){let n=t,o=s,h=i,l="",c=null,d=t,{length:f}=e;for(;;){if(t>=f){r.unterminated(n,o,h),l+=e.slice(d,t);break}let m=e.charCodeAt(t);if(oi(a,m,e,t)){l+=e.slice(d,t);break}if(m===92){l+=e.slice(d,t);let P=hi(e,t,s,i,a==="template",r);P.ch===null&&!c?c={pos:t,lineStart:s,curLine:i}:l+=P.ch,{pos:t,lineStart:s,curLine:i}=P,d=t}else m===8232||m===8233?(++t,++i,s=t):m===10||m===13?a==="template"?(l+=e.slice(d,t)+`
6
6
  `,++t,m===13&&e.charCodeAt(t)===10&&++t,++i,d=s=t):r.unterminated(n,o,h):++t}return{pos:t,str:l,firstInvalidLoc:c,lineStart:s,curLine:i,containsInvalid:!!c}}p(je,"readStringContents");function oi(a,e,t,s){return a==="template"?e===96||e===36&&t.charCodeAt(s+1)===123:e===(a==="double"?34:39)}p(oi,"isStringEnd");function hi(a,e,t,s,i,r){let n=!i;e++;let o=p(l=>({pos:e,ch:l,lineStart:t,curLine:s}),"res"),h=a.charCodeAt(e++);switch(h){case 110:return o(`
7
7
  `);case 114:return o("\r");case 120:{let l;return{code:l,pos:e}=Ft(a,e,t,s,2,!1,n,r),o(l===null?null:String.fromCharCode(l))}case 117:{let l;return{code:l,pos:e}=ss(a,e,t,s,n,r),o(l===null?null:String.fromCodePoint(l))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:a.charCodeAt(e)===10&&++e;case 10:t=e,++s;case 8232:case 8233:return o("");case 56:case 57:if(i)return o(null);r.strictNumericEscape(e-1,t,s);default:if(h>=48&&h<=55){let l=e-1,d=/^[0-7]+/.exec(a.slice(l,e+2))[0],f=parseInt(d,8);f>255&&(d=d.slice(0,-1),f=parseInt(d,8)),e+=d.length-1;let m=a.charCodeAt(e);if(d!=="0"||m===56||m===57){if(i)return o(null);r.strictNumericEscape(l,t,s)}return o(String.fromCharCode(f))}return o(String.fromCharCode(h))}}p(hi,"readEscapedChar");function Ft(a,e,t,s,i,r,n,o){let h=e,l;return{n:l,pos:e}=es(a,e,t,s,16,i,r,!1,o,!n),l===null&&(n?o.invalidEscapeSequence(h,t,s):e=h-1),{code:l,pos:e}}p(Ft,"readHexChar");function es(a,e,t,s,i,r,n,o,h,l){let c=e,d=i===16?_e.hex:_e.decBinOct,f=i===16?ut.hex:i===10?ut.dec:i===8?ut.oct:ut.bin,m=!1,P=0;for(let C=0,k=r??1/0;C<k;++C){let b=a.charCodeAt(e),N;if(b===95&&o!=="bail"){let q=a.charCodeAt(e-1),j=a.charCodeAt(e+1);if(o){if(Number.isNaN(j)||!f(j)||d.has(q)||d.has(j)){if(l)return{n:null,pos:e};h.unexpectedNumericSeparator(e,t,s)}}else{if(l)return{n:null,pos:e};h.numericSeparatorInEscapeSequence(e,t,s)}++e;continue}if(b>=97?N=b-97+10:b>=65?N=b-65+10:ni(b)?N=b-48:N=1/0,N>=i){if(N<=9&&l)return{n:null,pos:e};if(N<=9&&h.invalidDigit(e,t,s,i))N=0;else if(n)N=0,m=!0;else break}++e,P=P*i+N}return e===c||r!=null&&e-c!==r||m?{n:null,pos:e}:{n:P,pos:e}}p(es,"readInt");function ss(a,e,t,s,i,r){let n=a.charCodeAt(e),o;if(n===123){if(++e,{code:o,pos:e}=Ft(a,e,t,s,a.indexOf("}",e)-e,!0,i,r),++e,o!==null&&o>1114111)if(i)r.invalidCodePoint(e,t,s);else return{code:null,pos:e}}else({code:o,pos:e}=Ft(a,e,t,s,4,!1,i,r));return{code:o,pos:e}}p(ss,"readCodePoint");function st(a,e,t){return new R(t,a-e,a)}p(st,"buildPosition");var li=new Set([103,109,115,105,121,117,100,118]),M=class{static{p(this,"Token")}constructor(e){let t=e.startIndex||0;this.type=e.type,this.value=e.value,this.start=t+e.start,this.end=t+e.end,this.loc=new Y(e.startLoc,e.endLoc)}},Bt=class extends Ot{static{p(this,"Tokenizer")}constructor(e,t){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:p((s,i,r,n)=>this.optionFlags&2048?(this.raise(u.InvalidDigit,st(s,i,r),{radix:n}),!0):!1,"invalidDigit"),numericSeparatorInEscapeSequence:this.errorBuilder(u.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(u.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(u.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(u.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:p((s,i,r)=>{this.recordStrictModeErrors(u.StrictNumericEscape,st(s,i,r))},"strictNumericEscape"),unterminated:p((s,i,r)=>{throw this.raise(u.UnterminatedString,st(s-1,i,r))},"unterminated")}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(u.StrictNumericEscape),unterminated:p((s,i,r)=>{throw this.raise(u.UnterminatedTemplate,st(s,i,r))},"unterminated")}),this.state=new Mt,this.state.init(e),this.input=t,this.length=t.length,this.comments=[],this.isLookahead=!1}pushToken(e){this.tokens.length=this.state.tokensLength,this.tokens.push(e),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&256&&this.pushToken(new M(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(e){return this.match(e)?(this.next(),!0):!1}match(e){return this.state.type===e}createLookaheadState(e){return{pos:e.pos,value:null,type:e.type,start:e.start,end:e.end,context:[this.curContext()],inType:e.inType,startLoc:e.startLoc,lastTokEndLoc:e.lastTokEndLoc,curLine:e.curLine,lineStart:e.lineStart,curPosition:e.curPosition}}lookahead(){let e=this.state;this.state=this.createLookaheadState(e),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let t=this.state;return this.state=e,t}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(e){return bt.lastIndex=e,bt.test(this.input)?bt.lastIndex:e}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(e){return this.input.charCodeAt(this.nextTokenStartSince(e))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(e){return At.lastIndex=e,At.test(this.input)?At.lastIndex:e}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(e){let t=this.input.charCodeAt(e);if((t&64512)===55296&&++e<this.input.length){let s=this.input.charCodeAt(e);(s&64512)===56320&&(t=65536+((t&1023)<<10)+(s&1023))}return t}setStrict(e){this.state.strict=e,e&&(this.state.strictErrors.forEach(([t,s])=>this.raise(t,s)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(e){let t;this.isLookahead||(t=this.state.curPosition());let s=this.state.pos,i=this.input.indexOf(e,s+2);if(i===-1)throw this.raise(u.UnterminatedComment,this.state.curPosition());for(this.state.pos=i+e.length,ct.lastIndex=s+2;ct.test(this.input)&&ct.lastIndex<=i;)++this.state.curLine,this.state.lineStart=ct.lastIndex;if(this.isLookahead)return;let r={type:"CommentBlock",value:this.input.slice(s+2,i),start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(i+e.length),loc:new Y(t,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(r),r}skipLineComment(e){let t=this.state.pos,s;this.isLookahead||(s=this.state.curPosition());let i=this.input.charCodeAt(this.state.pos+=e);if(this.state.pos<this.length)for(;!X(i)&&++this.state.pos<this.length;)i=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let r=this.state.pos,o={type:"CommentLine",value:this.input.slice(t+e,r),start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(r),loc:new Y(s,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(o),o}skipSpace(){let e=this.state.pos,t=this.optionFlags&4096?[]:null;t:for(;this.state.pos<this.length;){let s=this.input.charCodeAt(this.state.pos);switch(s){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let i=this.skipBlockComment("*/");i!==void 0&&(this.addComment(i),t?.push(i));break}case 47:{let i=this.skipLineComment(2);i!==void 0&&(this.addComment(i),t?.push(i));break}default:break t}break;default:if(ii(s))++this.state.pos;else if(s===45&&!this.inModule&&this.optionFlags&8192){let i=this.state.pos;if(this.input.charCodeAt(i+1)===45&&this.input.charCodeAt(i+2)===62&&(e===0||this.state.lineStart>e)){let r=this.skipLineComment(3);r!==void 0&&(this.addComment(r),t?.push(r))}else break t}else if(s===60&&!this.inModule&&this.optionFlags&8192){let i=this.state.pos;if(this.input.charCodeAt(i+1)===33&&this.input.charCodeAt(i+2)===45&&this.input.charCodeAt(i+3)===45){let r=this.skipLineComment(4);r!==void 0&&(this.addComment(r),t?.push(r))}else break t}else break t}}if(t?.length>0){let s=this.state.pos,i={start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(s),comments:t,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(i)}}finishToken(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let s=this.state.type;this.state.type=e,this.state.value=t,this.isLookahead||this.updateContext(s)}replaceToken(e){this.state.type=e,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let e=this.state.pos+1,t=this.codePointAtPos(e);if(t>=48&&t<=57)throw this.raise(u.UnexpectedDigitAfterHash,this.state.curPosition());if(t===123||t===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(t===123?u.RecordExpressionHashIncorrectStartSyntaxType:u.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,t===123?this.finishToken(7):this.finishToken(1)}else B(t)?(++this.state.pos,this.finishToken(139,this.readWord1(t))):t===92?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57){this.readNumber(!0);return}e===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let e=this.input.charCodeAt(this.state.pos+1);if(e!==33)return!1;let t=this.state.pos;for(this.state.pos+=1;!X(e)&&++this.state.pos<this.length;)e=this.input.charCodeAt(this.state.pos);let s=this.input.slice(t+2,this.state.pos);return this.finishToken(28,s),!0}readToken_mult_modulo(e){let t=e===42?55:54,s=1,i=this.input.charCodeAt(this.state.pos+1);e===42&&i===42&&(s++,i=this.input.charCodeAt(this.state.pos+2),t=57),i===61&&!this.state.inType&&(s++,t=e===37?33:30),this.finishOp(t,s)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(e===124?41:42,2);return}if(e===124){if(t===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&t===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(u.RecordExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&t===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(u.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(t===61){this.finishOp(30,2);return}this.finishOp(e===124?43:45,1)}readToken_caret(){let e=this.input.charCodeAt(this.state.pos+1);e===61&&!this.state.inType?this.finishOp(32,2):e===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(44,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(38,2):this.finishOp(26,1)}readToken_plus_min(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.finishOp(34,2);return}t===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===60){if(this.input.charCodeAt(e+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(t===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===62){let s=this.input.charCodeAt(e+2)===62?3:2;if(this.input.charCodeAt(e+s)===61){this.finishOp(30,s+1);return}this.finishOp(52,s);return}if(t===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(e===61&&t===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(e===61?29:35,1)}readToken_question(){let e=this.input.charCodeAt(this.state.pos+1),t=this.input.charCodeAt(this.state.pos+2);e===63?t===61?this.finishOp(30,3):this.finishOp(40,2):e===46&&!(t>=48&&t<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(e){switch(e){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(u.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(u.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let t=this.input.charCodeAt(this.state.pos+1);if(t===120||t===88){this.readRadixNumber(16);return}if(t===111||t===79){this.readRadixNumber(8);return}if(t===98||t===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(e);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(e);return;case 124:case 38:this.readToken_pipe_amp(e);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(e);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(e);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(B(e)){this.readWord(e);return}}throw this.raise(u.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(e)})}finishOp(e,t){let s=this.input.slice(this.state.pos,this.state.pos+t);this.state.pos+=t,this.finishToken(e,s)}readRegexp(){let e=this.state.startLoc,t=this.state.start+1,s,i,{pos:r}=this.state;for(;;++r){if(r>=this.length)throw this.raise(u.UnterminatedRegExp,L(e,1));let l=this.input.charCodeAt(r);if(X(l))throw this.raise(u.UnterminatedRegExp,L(e,1));if(s)s=!1;else{if(l===91)i=!0;else if(l===93&&i)i=!1;else if(l===47&&!i)break;s=l===92}}let n=this.input.slice(t,r);++r;let o="",h=p(()=>L(e,r+2-t),"nextPos");for(;r<this.length;){let l=this.codePointAtPos(r),c=String.fromCharCode(l);if(li.has(l))l===118?o.includes("u")&&this.raise(u.IncompatibleRegExpUVFlags,h()):l===117&&o.includes("v")&&this.raise(u.IncompatibleRegExpUVFlags,h()),o.includes(c)&&this.raise(u.DuplicateRegExpFlags,h());else if(W(l)||l===92)this.raise(u.MalformedRegExpFlags,h());else break;++r,o+=c}this.state.pos=r,this.finishToken(138,{pattern:n,flags:o})}readInt(e,t,s=!1,i=!0){let{n:r,pos:n}=es(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,t,s,i,this.errorHandlers_readInt,!1);return this.state.pos=n,r}readRadixNumber(e){let t=this.state.pos,s=this.state.curPosition(),i=!1;this.state.pos+=2;let r=this.readInt(e);r==null&&this.raise(u.InvalidDigit,L(s,2),{radix:e});let n=this.input.charCodeAt(this.state.pos);if(n===110)++this.state.pos,i=!0;else if(n===109)throw this.raise(u.InvalidDecimal,s);if(B(this.codePointAtPos(this.state.pos)))throw this.raise(u.NumberIdentifier,this.state.curPosition());if(i){let o=this.input.slice(t,this.state.pos).replace(/[_n]/g,"");this.finishToken(136,o);return}this.finishToken(135,r)}readNumber(e){let t=this.state.pos,s=this.state.curPosition(),i=!1,r=!1,n=!1,o=!1;!e&&this.readInt(10)===null&&this.raise(u.InvalidNumber,this.state.curPosition());let h=this.state.pos-t>=2&&this.input.charCodeAt(t)===48;if(h){let m=this.input.slice(t,this.state.pos);if(this.recordStrictModeErrors(u.StrictOctalLiteral,s),!this.state.strict){let P=m.indexOf("_");P>0&&this.raise(u.ZeroDigitNumericSeparator,L(s,P))}o=h&&!/[89]/.test(m)}let l=this.input.charCodeAt(this.state.pos);if(l===46&&!o&&(++this.state.pos,this.readInt(10),i=!0,l=this.input.charCodeAt(this.state.pos)),(l===69||l===101)&&!o&&(l=this.input.charCodeAt(++this.state.pos),(l===43||l===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(u.InvalidOrMissingExponent,s),i=!0,n=!0,l=this.input.charCodeAt(this.state.pos)),l===110&&((i||h)&&this.raise(u.InvalidBigIntLiteral,s),++this.state.pos,r=!0),l===109){this.expectPlugin("decimal",this.state.curPosition()),(n||h)&&this.raise(u.InvalidDecimal,s),++this.state.pos;var c=!0}if(B(this.codePointAtPos(this.state.pos)))throw this.raise(u.NumberIdentifier,this.state.curPosition());let d=this.input.slice(t,this.state.pos).replace(/[_mn]/g,"");if(r){this.finishToken(136,d);return}if(c){this.finishToken(137,d);return}let f=o?parseInt(d,8):parseFloat(d);this.finishToken(135,f)}readCodePoint(e){let{code:t,pos:s}=ss(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,this.errorHandlers_readCodePoint);return this.state.pos=s,t}readString(e){let{str:t,pos:s,curLine:i,lineStart:r}=je(e===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=r,this.state.curLine=i,this.finishToken(134,t)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let e=this.input[this.state.pos],{str:t,firstInvalidLoc:s,pos:i,curLine:r,lineStart:n}=je("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=i+1,this.state.lineStart=n,this.state.curLine=r,s&&(this.state.firstInvalidTemplateEscapePos=new R(s.curLine,s.pos-s.lineStart,this.sourceToOffsetPos(s.pos))),this.input.codePointAt(i)===96?this.finishToken(24,s?null:e+t+"`"):(this.state.pos++,this.finishToken(25,s?null:e+t+"${"))}recordStrictModeErrors(e,t){let s=t.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(e,t):this.state.strictErrors.set(s,[e,t])}readWord1(e){this.state.containsEsc=!1;let t="",s=this.state.pos,i=this.state.pos;for(e!==void 0&&(this.state.pos+=e<=65535?1:2);this.state.pos<this.length;){let r=this.codePointAtPos(this.state.pos);if(W(r))this.state.pos+=r<=65535?1:2;else if(r===92){this.state.containsEsc=!0,t+=this.input.slice(i,this.state.pos);let n=this.state.curPosition(),o=this.state.pos===s?B:W;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(u.MissingUnicodeEscape,this.state.curPosition()),i=this.state.pos-1;continue}++this.state.pos;let h=this.readCodePoint(!0);h!==null&&(o(h)||this.raise(u.EscapedCharNotAnIdentifier,n),t+=String.fromCodePoint(h)),i=this.state.pos}else break}return t+this.input.slice(i,this.state.pos)}readWord(e){let t=this.readWord1(e),s=Wt.get(t);s!==void 0?this.finishToken(s,z(s)):this.finishToken(132,t)}checkKeywordEscapes(){let{type:e}=this.state;Zt(e)&&this.state.containsEsc&&this.raise(u.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:z(e)})}raise(e,t,s={}){let i=t instanceof R?t:t.loc.start,r=e(i,s);if(!(this.optionFlags&2048))throw r;return this.isLookahead||this.state.errors.push(r),r}raiseOverwrite(e,t,s={}){let i=t instanceof R?t:t.loc.start,r=i.index,n=this.state.errors;for(let o=n.length-1;o>=0;o--){let h=n[o];if(h.loc.index===r)return n[o]=e(i,s);if(h.loc.index<r)break}return this.raise(e,t,s)}updateContext(e){}unexpected(e,t){throw this.raise(u.UnexpectedToken,e??this.state.startLoc,{expected:t?z(t):null})}expectPlugin(e,t){if(this.hasPlugin(e))return!0;throw this.raise(u.MissingPlugin,t??this.state.startLoc,{missingPlugin:[e]})}expectOnePlugin(e){if(!e.some(t=>this.hasPlugin(t)))throw this.raise(u.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:e})}errorBuilder(e){return(t,s,i)=>{this.raise(e,st(t,s,i))}}},Rt=class{static{p(this,"ClassScope")}constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},Ut=class{static{p(this,"ClassScopeHandler")}constructor(e){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=e}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Rt)}exit(){let e=this.stack.pop(),t=this.current();for(let[s,i]of Array.from(e.undefinedPrivateNames))t?t.undefinedPrivateNames.has(s)||t.undefinedPrivateNames.set(s,i):this.parser.raise(u.InvalidPrivateFieldResolution,i,{identifierName:s})}declarePrivateName(e,t,s){let{privateNames:i,loneAccessors:r,undefinedPrivateNames:n}=this.current(),o=i.has(e);if(t&3){let h=o&&r.get(e);if(h){let l=h&4,c=t&4,d=h&3,f=t&3;o=d===f||l!==c,o||r.delete(e)}else o||r.set(e,t)}o&&this.parser.raise(u.PrivateNameRedeclaration,s,{identifierName:e}),i.add(e),n.delete(e)}usePrivateName(e,t){let s;for(s of this.stack)if(s.privateNames.has(e))return;s?s.undefinedPrivateNames.set(e,t):this.parser.raise(u.InvalidPrivateFieldResolution,t,{identifierName:e})}},Q=class{static{p(this,"ExpressionScope")}constructor(e=0){this.type=e}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},xt=class extends Q{static{p(this,"ArrowHeadParsingScope")}constructor(e){super(e),this.declarationErrors=new Map}recordDeclarationError(e,t){let s=t.index;this.declarationErrors.set(s,[e,t])}clearDeclarationError(e){this.declarationErrors.delete(e)}iterateErrors(e){this.declarationErrors.forEach(e)}},_t=class{static{p(this,"ExpressionScopeHandler")}constructor(e){this.parser=void 0,this.stack=[new Q],this.parser=e}enter(e){this.stack.push(e)}exit(){this.stack.pop()}recordParameterInitializerError(e,t){let s=t.loc.start,{stack:i}=this,r=i.length-1,n=i[r];for(;!n.isCertainlyParameterDeclaration();){if(n.canBeArrowParameterDeclaration())n.recordDeclarationError(e,s);else return;n=i[--r]}this.parser.raise(e,s)}recordArrowParameterBindingError(e,t){let{stack:s}=this,i=s[s.length-1],r=t.loc.start;if(i.isCertainlyParameterDeclaration())this.parser.raise(e,r);else if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(e,r);else return}recordAsyncArrowParametersError(e){let{stack:t}=this,s=t.length-1,i=t[s];for(;i.canBeArrowParameterDeclaration();)i.type===2&&i.recordDeclarationError(u.AwaitBindingIdentifier,e),i=t[--s]}validateAsPattern(){let{stack:e}=this,t=e[e.length-1];t.canBeArrowParameterDeclaration()&&t.iterateErrors(([s,i])=>{this.parser.raise(s,i);let r=e.length-2,n=e[r];for(;n.canBeArrowParameterDeclaration();)n.clearDeclarationError(i.index),n=e[--r]})}};function ci(){return new Q(3)}p(ci,"newParameterDeclarationScope");function ui(){return new xt(1)}p(ui,"newArrowHeadScope");function pi(){return new xt(2)}p(pi,"newAsyncArrowScope");function is(){return new Q}p(is,"newExpressionScope");var jt=class extends Bt{static{p(this,"UtilParser")}addExtra(e,t,s,i=!0){if(!e)return;let{extra:r}=e;r==null&&(r={},e.extra=r),i?r[t]=s:Object.defineProperty(r,t,{enumerable:i,value:s})}isContextual(e){return this.state.type===e&&!this.state.containsEsc}isUnparsedContextual(e,t){if(this.input.startsWith(t,e)){let s=this.input.charCodeAt(e+t.length);return!(W(s)||(s&64512)===55296)}return!1}isLookaheadContextual(e){let t=this.nextTokenStart();return this.isUnparsedContextual(t,e)}eatContextual(e){return this.isContextual(e)?(this.next(),!0):!1}expectContextual(e,t){if(!this.eatContextual(e)){if(t!=null)throw this.raise(t,this.state.startLoc);this.unexpected(null,e)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Ue(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return Ue(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(e=!0){(e?this.isLineTerminator():this.eat(13))||this.raise(u.MissingSemicolon,this.state.lastTokEndLoc)}expect(e,t){this.eat(e)||this.unexpected(t,e)}tryParse(e,t=this.state.clone()){let s={node:null};try{let i=e((r=null)=>{throw s.node=r,s});if(this.state.errors.length>t.errors.length){let r=this.state;return this.state=t,this.state.tokensLength=r.tokensLength,{node:i,error:r.errors[t.errors.length],thrown:!1,aborted:!1,failState:r}}return{node:i,error:null,thrown:!1,aborted:!1,failState:null}}catch(i){let r=this.state;if(this.state=t,i instanceof SyntaxError)return{node:null,error:i,thrown:!0,aborted:!1,failState:r};if(i===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:r};throw i}}checkExpressionErrors(e,t){if(!e)return!1;let{shorthandAssignLoc:s,doubleProtoLoc:i,privateKeyLoc:r,optionalParametersLoc:n,voidPatternLoc:o}=e,h=!!s||!!i||!!n||!!r||!!o;if(!t)return h;s!=null&&this.raise(u.InvalidCoverInitializedName,s),i!=null&&this.raise(u.DuplicateProto,i),r!=null&&this.raise(u.UnexpectedPrivateField,r),n!=null&&this.unexpected(n),o!=null&&this.raise(u.InvalidCoverDiscardElement,o)}isLiteralPropertyName(){return We(this.state.type)}isPrivateName(e){return e.type==="PrivateName"}getPrivateNameSV(e){return e.id.name}hasPropertyAsPrivateName(e){return(e.type==="MemberExpression"||e.type==="OptionalMemberExpression")&&this.isPrivateName(e.property)}isObjectProperty(e){return e.type==="ObjectProperty"}isObjectMethod(e){return e.type==="ObjectMethod"}initializeScopes(e=this.options.sourceType==="module"){let t=this.state.labels;this.state.labels=[];let s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let i=this.inModule;this.inModule=e;let r=this.scope,n=this.getScopeHandler();this.scope=new n(this,e);let o=this.prodParam;this.prodParam=new Lt;let h=this.classScope;this.classScope=new Ut(this);let l=this.expressionScope;return this.expressionScope=new _t(this),()=>{this.state.labels=t,this.exportedIdentifiers=s,this.inModule=i,this.scope=r,this.prodParam=o,this.classScope=h,this.expressionScope=l}}enterInitialScopes(){let e=0;(this.inModule||this.optionFlags&1)&&(e|=2),this.optionFlags&32&&(e|=1);let t=!this.inModule&&this.options.sourceType==="commonjs";(t||this.optionFlags&2)&&(e|=4),this.prodParam.enter(e);let s=t?514:1;this.optionFlags&4&&(s|=512),this.scope.enter(s)}checkDestructuringPrivate(e){let{privateKeyLoc:t}=e;t!==null&&this.expectPlugin("destructuringPrivate",t)}},G=class{static{p(this,"ExpressionErrors")}constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null,this.voidPatternLoc=null}},Z=class{static{p(this,"Node")}constructor(e,t,s){this.type="",this.start=t,this.end=0,this.loc=new Y(s),e?.optionFlags&128&&(this.range=[t,0]),e!=null&&e.filename&&(this.loc.filename=e.filename)}},$t=Z.prototype;$t.__clone=function(){let a=new Z(void 0,this.start,this.loc.start),e=Object.keys(this);for(let t=0,s=e.length;t<s;t++){let i=e[t];i!=="leadingComments"&&i!=="trailingComments"&&i!=="innerComments"&&(a[i]=this[i])}return a};var Vt=class extends jt{static{p(this,"NodeUtils")}startNode(){let e=this.state.startLoc;return new Z(this,e.index,e)}startNodeAt(e){return new Z(this,e.index,e)}startNodeAtNode(e){return this.startNodeAt(e.loc.start)}finishNode(e,t){return this.finishNodeAt(e,t,this.state.lastTokEndLoc)}finishNodeAt(e,t,s){return e.type=t,e.end=s.index,e.loc.end=s,this.optionFlags&128&&(e.range[1]=s.index),this.optionFlags&4096&&this.processComment(e),e}resetStartLocation(e,t){e.start=t.index,e.loc.start=t,this.optionFlags&128&&(e.range[0]=t.index)}resetEndLocation(e,t=this.state.lastTokEndLoc){e.end=t.index,e.loc.end=t,this.optionFlags&128&&(e.range[1]=t.index)}resetStartLocationFromNode(e,t){this.resetStartLocation(e,t.loc.start)}castNodeTo(e,t){return e.type=t,e}cloneIdentifier(e){let{type:t,start:s,end:i,loc:r,range:n,name:o}=e,h=Object.create($t);return h.type=t,h.start=s,h.end=i,h.loc=r,h.range=n,h.name=o,e.extra&&(h.extra=e.extra),h}cloneStringLiteral(e){let{type:t,start:s,end:i,loc:r,range:n,extra:o}=e,h=Object.create($t);return h.type=t,h.start=s,h.end=i,h.loc=r,h.range=n,h.extra=o,h.value=e.value,h}},zt=p(a=>a.type==="ParenthesizedExpression"?zt(a.expression):a,"unwrapParenthesizedExpression"),qt=class extends Vt{static{p(this,"LValParser")}toAssignable(e,t=!1){var s,i;let r;switch((e.type==="ParenthesizedExpression"||(s=e.extra)!=null&&s.parenthesized)&&(r=zt(e),t?r.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(u.InvalidParenthesizedAssignment,e):r.type!=="CallExpression"&&r.type!=="MemberExpression"&&!this.isOptionalMemberExpression(r)&&this.raise(u.InvalidParenthesizedAssignment,e):this.raise(u.InvalidParenthesizedAssignment,e)),e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":break;case"ObjectExpression":this.castNodeTo(e,"ObjectPattern");for(let o=0,h=e.properties.length,l=h-1;o<h;o++){var n;let c=e.properties[o],d=o===l;this.toAssignableObjectExpressionProp(c,d,t),d&&c.type==="RestElement"&&(n=e.extra)!=null&&n.trailingCommaLoc&&this.raise(u.RestTrailingComma,e.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:o,value:h}=e;this.isPrivateName(o)&&this.classScope.usePrivateName(this.getPrivateNameSV(o),o.loc.start),this.toAssignable(h,t);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":this.castNodeTo(e,"ArrayPattern"),this.toAssignableList(e.elements,(i=e.extra)==null?void 0:i.trailingCommaLoc,t);break;case"AssignmentExpression":e.operator!=="="&&this.raise(u.MissingEqInAssignment,e.left.loc.end),this.castNodeTo(e,"AssignmentPattern"),delete e.operator,e.left.type==="VoidPattern"&&this.raise(u.VoidPatternInitializer,e.left),this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(r,t);break}}toAssignableObjectExpressionProp(e,t,s){if(e.type==="ObjectMethod")this.raise(e.kind==="get"||e.kind==="set"?u.PatternHasAccessor:u.PatternHasMethod,e.key);else if(e.type==="SpreadElement"){this.castNodeTo(e,"RestElement");let i=e.argument;this.checkToRestConversion(i,!1),this.toAssignable(i,s),t||this.raise(u.RestTrailingComma,e)}else this.toAssignable(e,s)}toAssignableList(e,t,s){let i=e.length-1;for(let r=0;r<=i;r++){let n=e[r];n&&(this.toAssignableListItem(e,r,s),n.type==="RestElement"&&(r<i?this.raise(u.RestTrailingComma,n):t&&this.raise(u.RestTrailingComma,t)))}}toAssignableListItem(e,t,s){let i=e[t];if(i.type==="SpreadElement"){this.castNodeTo(i,"RestElement");let r=i.argument;this.checkToRestConversion(r,!0),this.toAssignable(r,s)}else this.toAssignable(i,s)}isAssignable(e,t){switch(e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":return!0;case"ObjectExpression":{let s=e.properties.length-1;return e.properties.every((i,r)=>i.type!=="ObjectMethod"&&(r===s||i.type!=="SpreadElement")&&this.isAssignable(i))}case"ObjectProperty":return this.isAssignable(e.value);case"SpreadElement":return this.isAssignable(e.argument);case"ArrayExpression":return e.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return e.operator==="=";case"ParenthesizedExpression":return this.isAssignable(e.expression);case"MemberExpression":case"OptionalMemberExpression":return!t;default:return!1}}toReferencedList(e,t){return e}toReferencedListDeep(e,t){this.toReferencedList(e,t);for(let s of e)s?.type==="ArrayExpression"&&this.toReferencedListDeep(s.elements)}parseSpread(e){let t=this.startNode();return this.next(),t.argument=this.parseMaybeAssignAllowIn(e,void 0),this.finishNode(t,"SpreadElement")}parseRestBinding(){let e=this.startNode();this.next();let t=this.parseBindingAtom();return t.type==="VoidPattern"&&this.raise(u.UnexpectedVoidPattern,t),e.argument=t,this.finishNode(e,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let e=this.startNode();return this.next(),e.elements=this.parseBindingList(3,93,1),this.finishNode(e,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0);case 88:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(e,t,s){let i=s&1,r=[],n=!0;for(;!this.eat(e);)if(n?n=!1:this.expect(12),i&&this.match(12))r.push(null);else{if(this.eat(e))break;if(this.match(21)){let o=this.parseRestBinding();if((this.hasPlugin("flow")||s&2)&&(o=this.parseFunctionParamType(o)),r.push(o),!this.checkCommaAfterRest(t)){this.expect(e);break}}else{let o=[];if(s&2)for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(u.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());r.push(this.parseBindingElement(s,o))}}return r}parseBindingRestProperty(e){return this.next(),this.hasPlugin("discardBinding")&&this.match(88)?(e.argument=this.parseVoidPattern(null),this.raise(u.UnexpectedVoidPattern,e.argument)):e.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(e,"RestElement")}parseBindingProperty(){let{type:e,startLoc:t}=this.state;if(e===21)return this.parseBindingRestProperty(this.startNode());let s=this.startNode();return e===139?(this.expectPlugin("destructuringPrivate",t),this.classScope.usePrivateName(this.state.value,t),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,t,!1,!1,!0,!1)}parseBindingElement(e,t){let s=this.parseMaybeDefault();return(this.hasPlugin("flow")||e&2)&&this.parseFunctionParamType(s),t.length&&(s.decorators=t,this.resetStartLocationFromNode(s,t[0])),this.parseMaybeDefault(s.loc.start,s)}parseFunctionParamType(e){return e}parseMaybeDefault(e,t){if(e??(e=this.state.startLoc),t=t??this.parseBindingAtom(),!this.eat(29))return t;let s=this.startNodeAt(e);return t.type==="VoidPattern"&&this.raise(u.VoidPatternInitializer,t),s.left=t,s.right=this.parseMaybeAssignAllowIn(),this.finishNode(s,"AssignmentPattern")}isValidLVal(e,t,s,i){switch(e){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties";case"VoidPattern":return!0;case"CallExpression":if(!t&&!this.state.strict&&this.optionFlags&8192)return!0}return!1}isOptionalMemberExpression(e){return e.type==="OptionalMemberExpression"}checkLVal(e,t,s=64,i=!1,r=!1,n=!1,o=!1){var h;let l=e.type;if(this.isObjectMethod(e))return;let c=this.isOptionalMemberExpression(e);if(c||l==="MemberExpression"){c&&(this.expectPlugin("optionalChainingAssign",e.loc.start),t.type!=="AssignmentExpression"&&this.raise(u.InvalidLhsOptionalChaining,e,{ancestor:t})),s!==64&&this.raise(u.InvalidPropertyBindingPattern,e);return}if(l==="Identifier"){this.checkIdentifier(e,s,r);let{name:b}=e;i&&(i.has(b)?this.raise(u.ParamDupe,e):i.add(b));return}else l==="VoidPattern"&&t.type==="CatchClause"&&this.raise(u.VoidPatternCatchClauseParam,e);let d=zt(e);o||(o=d.type==="CallExpression"&&(d.callee.type==="Import"||d.callee.type==="Super"));let f=this.isValidLVal(l,o,!(n||(h=e.extra)!=null&&h.parenthesized)&&t.type==="AssignmentExpression",s);if(f===!0)return;if(f===!1){let b=s===64?u.InvalidLhs:u.InvalidLhsBinding;this.raise(b,e,{ancestor:t});return}let m,P;typeof f=="string"?(m=f,P=l==="ParenthesizedExpression"):[m,P]=f;let C=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:t,k=e[m];if(Array.isArray(k))for(let b of k)b&&this.checkLVal(b,C,s,i,r,P,!0);else k&&this.checkLVal(k,C,s,i,r,P,o)}checkIdentifier(e,t,s=!1){this.state.strict&&(s?Ze(e.name,this.inModule):Qe(e.name))&&(t===64?this.raise(u.StrictEvalArguments,e,{referenceName:e.name}):this.raise(u.StrictEvalArgumentsBinding,e,{bindingName:e.name})),t&8192&&e.name==="let"&&this.raise(u.LetInLexicalBinding,e),t&64||this.declareNameFromIdentifier(e,t)}declareNameFromIdentifier(e,t){this.scope.declareName(e.name,t,e.loc.start)}checkToRestConversion(e,t){switch(e.type){case"ParenthesizedExpression":this.checkToRestConversion(e.expression,t);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(t)break;default:this.raise(u.InvalidRestAssignmentPattern,e)}}checkCommaAfterRest(e){return this.match(12)?(this.raise(this.lookaheadCharCode()===e?u.RestTrailingComma:u.ElementAfterRest,this.state.startLoc),!0):!1}},St=/in(?:stanceof)?|as|satisfies/y;function di(a){if(a==null)throw new Error(`Unexpected ${a} value.`);return a}p(di,"nonNull");function $e(a){if(!a)throw new Error("Assert fail")}p($e,"assert");var x=F`typescript`({AbstractMethodHasImplementation:p(({methodName:a})=>`Method '${a}' cannot have an implementation because it is marked abstract.`,"AbstractMethodHasImplementation"),AbstractPropertyHasInitializer:p(({propertyName:a})=>`Property '${a}' cannot have an initializer because it is marked abstract.`,"AbstractPropertyHasInitializer"),AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:p(({kind:a})=>`'declare' is not allowed in ${a}ters.`,"DeclareAccessor"),DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:p(({modifier:a})=>`Accessibility modifier already seen: '${a}'.`,"DuplicateAccessibilityModifier"),DuplicateModifier:p(({modifier:a})=>`Duplicate modifier: '${a}'.`,"DuplicateModifier"),EmptyHeritageClauseType:p(({token:a})=>`'${a}' list cannot be empty.`,"EmptyHeritageClauseType"),EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:p(({modifiers:a})=>`'${a[0]}' modifier cannot be used with '${a[1]}' modifier.`,"IncompatibleModifiers"),IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:p(({modifier:a})=>`Index signatures cannot have an accessibility modifier ('${a}').`,"IndexSignatureHasAccessibility"),IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidHeritageClauseType:p(({token:a})=>`'${a}' list can only include identifiers or qualified-names with optional type arguments.`,"InvalidHeritageClauseType"),InvalidModifierOnAwaitUsingDeclaration:p(a=>`'${a}' modifier cannot appear on an await using declaration.`,"InvalidModifierOnAwaitUsingDeclaration"),InvalidModifierOnTypeMember:p(({modifier:a})=>`'${a}' modifier cannot appear on a type member.`,"InvalidModifierOnTypeMember"),InvalidModifierOnTypeParameter:p(({modifier:a})=>`'${a}' modifier cannot appear on a type parameter.`,"InvalidModifierOnTypeParameter"),InvalidModifierOnTypeParameterPositions:p(({modifier:a})=>`'${a}' modifier can only appear on a type parameter of a class, interface or type alias.`,"InvalidModifierOnTypeParameterPositions"),InvalidModifierOnUsingDeclaration:p(a=>`'${a}' modifier cannot appear on a using declaration.`,"InvalidModifierOnUsingDeclaration"),InvalidModifiersOrder:p(({orderedModifiers:a})=>`'${a[0]}' modifier must precede '${a[1]}' modifier.`,"InvalidModifiersOrder"),InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:p(({modifier:a})=>`Private elements cannot have an accessibility modifier ('${a}').`,"PrivateElementHasAccessibility"),ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:p(({typeParameterName:a})=>`Single type parameter ${a} should have a trailing comma. Example usage: <${a},>.`,"SingleTypeParameterWithoutTrailingComma"),StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:p(({type:a})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${a}.`,"UnsupportedSignatureParameterKind"),UsingDeclarationInAmbientContext:p(a=>`'${a}' declarations are not allowed in ambient contexts.`,"UsingDeclarationInAmbientContext")});function fi(a){switch(a){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}p(fi,"keywordTypeFromName");function Ve(a){return a==="private"||a==="public"||a==="protected"}p(Ve,"tsIsAccessModifier");function mi(a){return a==="in"||a==="out"}p(mi,"tsIsVarianceAnnotations");var yi=p(a=>class extends a{static{p(this,"TypeScriptParserMixin")}constructor(...t){super(...t),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:x.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:x.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:x.InvalidModifierOnTypeParameter})}getScopeHandler(){return vt}tsIsIdentifier(){return E(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(t,s,i){if(!E(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let r=this.state.value;if(t.includes(r)){if(i&&this.match(106)||s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:t,disallowedModifiers:s,stopOnStartOfClassStaticBlock:i,errorTemplate:r=x.InvalidModifierOnTypeMember},n){let o=p((l,c,d,f)=>{c===d&&n[f]&&this.raise(x.InvalidModifiersOrder,l,{orderedModifiers:[d,f]})},"enforceOrder"),h=p((l,c,d,f)=>{(n[d]&&c===f||n[f]&&c===d)&&this.raise(x.IncompatibleModifiers,l,{modifiers:[d,f]})},"incompatible");for(;;){let{startLoc:l}=this.state,c=this.tsParseModifier(t.concat(s??[]),i,n.static);if(!c)break;Ve(c)?n.accessibility?this.raise(x.DuplicateAccessibilityModifier,l,{modifier:c}):(o(l,c,c,"override"),o(l,c,c,"static"),o(l,c,c,"readonly"),n.accessibility=c):mi(c)?(n[c]&&this.raise(x.DuplicateModifier,l,{modifier:c}),n[c]=!0,o(l,c,"in","out")):(hasOwnProperty.call(n,c)?this.raise(x.DuplicateModifier,l,{modifier:c}):(o(l,c,"static","readonly"),o(l,c,"static","override"),o(l,c,"override","readonly"),o(l,c,"abstract","override"),h(l,c,"declare","override"),h(l,c,"static","abstract")),n[c]=!0),s!=null&&s.includes(c)&&this.raise(r,l,{modifier:c})}}tsIsListTerminator(t){switch(t){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(t,s){let i=[];for(;!this.tsIsListTerminator(t);)i.push(s());return i}tsParseDelimitedList(t,s,i){return di(this.tsParseDelimitedListWorker(t,s,!0,i))}tsParseDelimitedListWorker(t,s,i,r){let n=[],o=-1;for(;!this.tsIsListTerminator(t);){o=-1;let h=s();if(h==null)return;if(n.push(h),this.eat(12)){o=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(t))break;i&&this.expect(12);return}return r&&(r.value=o),n}tsParseBracketedList(t,s,i,r,n){r||(i?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(t,s,n);return i?this.expect(3):this.expect(48),o}tsParseImportType(){let t=this.startNode();return this.expect(83),this.expect(10),this.match(134)?t.argument=this.parseStringLiteral(this.state.value):(this.raise(x.UnsupportedImportTypeArgument,this.state.startLoc),t.argument=super.parseExprAtom()),this.eat(12)?t.options=this.tsParseImportTypeOptions():t.options=null,this.expect(11),this.eat(16)&&(t.qualifier=this.tsParseEntityName(3)),this.match(47)&&(t.typeParameters=this.tsParseTypeArguments()),this.finishNode(t,"TSImportType")}tsParseImportTypeOptions(){let t=this.startNode();this.expect(5);let s=this.startNode();return this.isContextual(76)?(s.method=!1,s.key=this.parseIdentifier(!0),s.computed=!1,s.shorthand=!1):this.unexpected(null,76),this.expect(14),s.value=this.tsParseImportTypeWithPropertyValue(),t.properties=[this.finishObjectProperty(s)],this.eat(12),this.expect(8),this.finishNode(t,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let t=this.startNode(),s=[];for(this.expect(5);!this.match(8);){let i=this.state.type;E(i)||i===134?s.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(12)}return t.properties=s,this.next(),this.finishNode(t,"ObjectExpression")}tsParseEntityName(t){let s;if(t&1&&this.match(78))if(t&2)s=this.parseIdentifier(!0);else{let i=this.startNode();this.next(),s=this.finishNode(i,"ThisExpression")}else s=this.parseIdentifier(!!(t&1));for(;this.eat(16);){let i=this.startNodeAtNode(s);i.left=s,i.right=this.parseIdentifier(!!(t&1)),s=this.finishNode(i,"TSQualifiedName")}return s}tsParseTypeReference(){let t=this.startNode();return t.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(t.typeParameters=this.tsParseTypeArguments()),this.finishNode(t,"TSTypeReference")}tsParseThisTypePredicate(t){this.next();let s=this.startNodeAtNode(t);return s.parameterName=t,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"TSTypePredicate")}tsParseThisTypeNode(){let t=this.startNode();return this.next(),this.finishNode(t,"TSThisType")}tsParseTypeQuery(){let t=this.startNode();return this.expect(87),this.match(83)?t.exprName=this.tsParseImportType():t.exprName=this.tsParseEntityName(3),!this.hasPrecedingLineBreak()&&this.match(47)&&(t.typeParameters=this.tsParseTypeArguments()),this.finishNode(t,"TSTypeQuery")}tsParseTypeParameter(t){let s=this.startNode();return t(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(81),s.default=this.tsEatThenParseType(29),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(t){if(this.match(47))return this.tsParseTypeParameters(t)}tsParseTypeParameters(t){let s=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();let i={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,t),!1,!0,i),s.params.length===0&&this.raise(x.EmptyTypeParameters,s),i.value!==-1&&this.addExtra(s,"trailingComma",i.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(t,s){let i=t===19,r="parameters",n="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[r]=this.tsParseBindingListForSignature(),i?s[n]=this.tsParseTypeOrTypePredicateAnnotation(t):this.match(t)&&(s[n]=this.tsParseTypeOrTypePredicateAnnotation(t))}tsParseBindingListForSignature(){let t=super.parseBindingList(11,41,2);for(let s of t){let{type:i}=s;(i==="AssignmentPattern"||i==="TSParameterProperty")&&this.raise(x.UnsupportedSignatureParameterKind,s,{type:i})}return t}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(t,s){return this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,t)}tsIsUnambiguouslyIndexSignature(){return this.next(),E(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(t){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(3),t.parameters=[s];let i=this.tsTryParseTypeAnnotation();return i&&(t.typeAnnotation=i),this.tsParseTypeMemberSemicolon(),this.finishNode(t,"TSIndexSignature")}tsParsePropertyOrMethodSignature(t,s){if(this.eat(17)&&(t.optional=!0),this.match(10)||this.match(47)){s&&this.raise(x.ReadonlyForMethodSignature,t);let i=t;i.kind&&this.match(47)&&this.raise(x.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon();let r="parameters",n="typeAnnotation";if(i.kind==="get")i[r].length>0&&(this.raise(u.BadGetterArity,this.state.curPosition()),this.isThisParam(i[r][0])&&this.raise(x.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(i.kind==="set"){if(i[r].length!==1)this.raise(u.BadSetterArity,this.state.curPosition());else{let o=i[r][0];this.isThisParam(o)&&this.raise(x.AccessorCannotDeclareThisParameter,this.state.curPosition()),o.type==="Identifier"&&o.optional&&this.raise(x.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),o.type==="RestElement"&&this.raise(x.SetAccessorCannotHaveRestParameter,this.state.curPosition())}i[n]&&this.raise(x.SetAccessorCannotHaveReturnType,i[n])}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}else{let i=t;s&&(i.readonly=!0);let r=this.tsTryParseTypeAnnotation();return r&&(i.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(i,"TSPropertySignature")}}tsParseTypeMember(){let t=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",t);if(this.match(77)){let i=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",t):(t.key=this.createIdentifier(i,"new"),this.tsParsePropertyOrMethodSignature(t,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},t);let s=this.tsTryParseIndexSignature(t);return s||(super.parsePropertyName(t),!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.tsTokenCanFollowModifier()&&(t.kind=t.key.name,super.parsePropertyName(t),!this.match(10)&&!this.match(47)&&this.unexpected(null,10)),this.tsParsePropertyOrMethodSignature(t,!!t.readonly))}tsParseTypeLiteral(){let t=this.startNode();return t.members=this.tsParseObjectTypeMembers(),this.finishNode(t,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let t=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),t}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){let t=this.startNode();this.expect(5),this.match(53)?(t.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(t.readonly=!0),this.expect(0);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsExpectThenParseType(58),t.typeParameter=this.finishNode(s,"TSTypeParameter"),t.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(t.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(t.optional=!0),t.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(t,"TSMappedType")}tsParseTupleType(){let t=this.startNode();t.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1;return t.elementTypes.forEach(i=>{let{type:r}=i;s&&r!=="TSRestType"&&r!=="TSOptionalType"&&!(r==="TSNamedTupleMember"&&i.optional)&&this.raise(x.OptionalTypeBeforeRequired,i),s||(s=r==="TSNamedTupleMember"&&i.optional||r==="TSOptionalType")}),this.finishNode(t,"TSTupleType")}tsParseTupleElementType(){let t=this.state.startLoc,s=this.eat(21),{startLoc:i}=this.state,r,n,o,h,c=O(this.state.type)?this.lookaheadCharCode():null;if(c===58)r=!0,o=!1,n=this.parseIdentifier(!0),this.expect(14),h=this.tsParseType();else if(c===63){o=!0;let d=this.state.value,f=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,n=this.createIdentifier(this.startNodeAt(i),d),this.expect(17),this.expect(14),h=this.tsParseType()):(r=!1,h=f,this.expect(17))}else h=this.tsParseType(),o=this.eat(17),r=this.eat(14);if(r){let d;n?(d=this.startNodeAt(i),d.optional=o,d.label=n,d.elementType=h,this.eat(17)&&(d.optional=!0,this.raise(x.TupleOptionalAfterType,this.state.lastTokStartLoc))):(d=this.startNodeAt(i),d.optional=o,this.raise(x.InvalidTupleMemberLabel,h),d.label=h,d.elementType=this.tsParseType()),h=this.finishNode(d,"TSNamedTupleMember")}else if(o){let d=this.startNodeAt(i);d.typeAnnotation=h,h=this.finishNode(d,"TSOptionalType")}if(s){let d=this.startNodeAt(t);d.typeAnnotation=h,h=this.finishNode(d,"TSRestType")}return h}tsParseParenthesizedType(){let t=this.startNode();return this.expect(10),t.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(t,"TSParenthesizedType")}tsParseFunctionOrConstructorType(t,s){let i=this.startNode();return t==="TSConstructorType"&&(i.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,i)),this.finishNode(i,t)}tsParseLiteralTypeNode(){let t=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:t.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(t,"TSLiteralType")}tsParseTemplateLiteralType(){let t=this.startNode();return t.literal=super.parseTemplate(!1),this.finishNode(t,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let t=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(t):t}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let t=this.startNode(),s=this.lookahead();return s.type!==135&&s.type!==136&&this.unexpected(),t.literal=this.parseMaybeUnary(),this.finishNode(t,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:t}=this.state;if(E(t)||t===88||t===84){let s=t===88?"TSVoidKeyword":t===84?"TSNullKeyword":fi(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){let i=this.startNode();return this.next(),this.finishNode(i,s)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:t}=this.state,s=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let i=this.startNodeAt(t);i.elementType=s,this.expect(3),s=this.finishNode(i,"TSArrayType")}else{let i=this.startNodeAt(t);i.objectType=s,i.indexType=this.tsParseType(),this.expect(3),s=this.finishNode(i,"TSIndexedAccessType")}return s}tsParseTypeOperator(){let t=this.startNode(),s=this.state.value;return this.next(),t.operator=s,t.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(t),this.finishNode(t,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(t){switch(t.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(x.UnexpectedReadonly,t)}}tsParseInferType(){let t=this.startNode();this.expectContextual(115);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),t.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(t,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let t=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return t}}tsParseTypeOperatorOrHigher(){return Bs(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(t,s,i){let r=this.startNode(),n=this.eat(i),o=[];do o.push(s());while(this.eat(i));return o.length===1&&!n?o[0]:(r.types=o,this.finishNode(r,t))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(E(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:t}=this.state,s=t.length;try{return this.parseObjectLike(8,!0),t.length===s}catch{return!1}}if(this.match(0)){this.next();let{errors:t}=this.state,s=t.length;try{return super.parseBindingList(3,93,1),t.length===s}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(t){return this.tsInType(()=>{let s=this.startNode();this.expect(t);let i=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(78)){let h=this.tsParseThisTypeOrThisTypePredicate();return h.type==="TSThisType"?(i.parameterName=h,i.asserts=!0,i.typeAnnotation=null,h=this.finishNode(i,"TSTypePredicate")):(this.resetStartLocationFromNode(h,i),h.asserts=!0),s.typeAnnotation=h,this.finishNode(s,"TSTypeAnnotation")}let n=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!n)return r?(i.parameterName=this.parseIdentifier(),i.asserts=r,i.typeAnnotation=null,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);let o=this.tsParseTypeAnnotation(!1);return i.parameterName=n,i.typeAnnotation=o,i.asserts=r,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let t=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),t}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let t=this.state.containsEsc;return this.next(),!E(this.state.type)&&!this.match(78)?!1:(t&&this.raise(u.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(t=!0,s=this.startNode()){return this.tsInType(()=>{t&&this.expect(14),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){$e(this.state.inType);let t=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return t;let s=this.startNodeAtNode(t);return s.checkType=t,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.isLookaheadContextual("new")}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(x.ReservedTypeAssertion,this.state.startLoc);let t=this.startNode();return t.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),t.expression=this.parseMaybeUnary(),this.finishNode(t,"TSTypeAssertion")}tsParseHeritageClause(t){let s=this.state.startLoc,i=this.tsParseDelimitedList("HeritageClauseElement",()=>{let r=this.startNode();return r.expression=this.tsParseEntityName(3),this.match(47)&&(r.typeParameters=this.tsParseTypeArguments()),this.finishNode(r,"TSExpressionWithTypeArguments")});return i.length||this.raise(x.EmptyHeritageClauseType,s,{token:t}),i}tsParseInterfaceDeclaration(t,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),s.declare&&(t.declare=!0),E(this.state.type)?(t.id=this.parseIdentifier(),this.checkIdentifier(t.id,130)):(t.id=null,this.raise(x.MissingInterfaceName,this.state.startLoc)),t.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(t.extends=this.tsParseHeritageClause("extends"));let i=this.startNode();return i.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),t.body=this.finishNode(i,"TSInterfaceBody"),this.finishNode(t,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(t){return t.id=this.parseIdentifier(),this.checkIdentifier(t.id,2),t.typeAnnotation=this.tsInType(()=>{if(t.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookaheadCharCode()!==46){let s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(t,"TSTypeAliasDeclaration")}tsInTopLevelContext(t){if(this.curContext()!==I.brace){let s=this.state.context;this.state.context=[s[0]];try{return t()}finally{this.state.context=s}}else return t()}tsInType(t){let s=this.state.inType;this.state.inType=!0;try{return t()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(t){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return t()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(t){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return t()}finally{this.state.inDisallowConditionalTypesContext=s}}tsEatThenParseType(t){if(this.match(t))return this.tsNextThenParseType()}tsExpectThenParseType(t){return this.tsInType(()=>(this.expect(t),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let t=this.startNode();return t.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(t.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(t,"TSEnumMember")}tsParseEnumDeclaration(t,s={}){return s.const&&(t.const=!0),s.declare&&(t.declare=!0),this.expectContextual(126),t.id=this.parseIdentifier(),this.checkIdentifier(t.id,t.const?8971:8459),this.expect(5),t.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(t,"TSEnumDeclaration")}tsParseEnumBody(){let t=this.startNode();return this.expect(5),t.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(t,"TSEnumBody")}tsParseModuleBlock(){let t=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(t.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(t,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(t,s=!1){if(t.id=this.parseIdentifier(),s||this.checkIdentifier(t.id,1024),this.eat(16)){let i=this.startNode();this.tsParseModuleOrNamespaceDeclaration(i,!0),t.body=i}else this.scope.enter(1024),this.prodParam.enter(0),t.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(t,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(t){return this.isContextual(112)?(t.kind="global",t.global=!0,t.id=this.parseIdentifier()):this.match(134)?(t.kind="module",t.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(1024),this.prodParam.enter(0),t.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(t,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(t,s,i){t.isExport=i||!1,t.id=s||this.parseIdentifier(),this.checkIdentifier(t.id,4096),this.expect(29);let r=this.tsParseModuleReference();return t.importKind==="type"&&r.type!=="TSExternalModuleReference"&&this.raise(x.ImportAliasHasImportType,r),t.moduleReference=r,this.semicolon(),this.finishNode(t,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let t=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),t.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(t,"TSExternalModuleReference")}tsLookAhead(t){let s=this.state.clone(),i=t();return this.state=s,i}tsTryParseAndCatch(t){let s=this.tryParse(i=>t()||i());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(t){let s=this.state.clone(),i=t();if(i!==void 0&&i!==!1)return i;this.state=s}tsTryParseDeclare(t){if(this.isLineTerminator())return;let s=this.state.type;return this.tsInAmbientContext(()=>{switch(s){case 68:return t.declare=!0,super.parseFunctionStatement(t,!1,!1);case 80:return t.declare=!0,this.parseClass(t,!0,!1);case 126:return this.tsParseEnumDeclaration(t,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(t);case 100:if(this.state.containsEsc)return;case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(t.declare=!0,this.parseVarStatement(t,this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(t,{const:!0,declare:!0}));case 107:if(this.isUsing())return this.raise(x.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),t.declare=!0,this.parseVarStatement(t,"using",!0);break;case 96:if(this.isAwaitUsing())return this.raise(x.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),t.declare=!0,this.next(),this.parseVarStatement(t,"await using",!0);break;case 129:{let i=this.tsParseInterfaceDeclaration(t,{declare:!0});if(i)return i}default:if(E(s))return this.tsParseDeclaration(t,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(t,s,i,r){switch(s){case 124:if(this.tsCheckLineTerminator(i)&&(this.match(80)||E(this.state.type)))return this.tsParseAbstractDeclaration(t,r);break;case 127:if(this.tsCheckLineTerminator(i)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(t);if(E(this.state.type))return t.kind="module",this.tsParseModuleOrNamespaceDeclaration(t)}break;case 128:if(this.tsCheckLineTerminator(i)&&E(this.state.type))return t.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(t);break;case 130:if(this.tsCheckLineTerminator(i)&&E(this.state.type))return this.tsParseTypeAliasDeclaration(t);break}}tsCheckLineTerminator(t){return t?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(t){if(!this.match(47))return;let s=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let i=this.tsTryParseAndCatch(()=>{let r=this.startNodeAt(t);return r.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(r),r.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),r});if(this.state.maybeInArrowParameters=s,!!i)return super.parseArrowExpression(i,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let t=this.startNode();return t.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),t.params.length===0?this.raise(x.EmptyTypeArguments,t):!this.state.inType&&this.curContext()===I.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(t,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return Rs(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(t,s){let i=s.length?s[0].loc.start:this.state.startLoc,r={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},r);let n=r.accessibility,o=r.override,h=r.readonly;!(t&4)&&(n||h||o)&&this.raise(x.UnexpectedParameterModifier,i);let l=this.parseMaybeDefault();t&2&&this.parseFunctionParamType(l);let c=this.parseMaybeDefault(l.loc.start,l);if(n||h||o){let d=this.startNodeAt(i);return s.length&&(d.decorators=s),n&&(d.accessibility=n),h&&(d.readonly=h),o&&(d.override=o),c.type!=="Identifier"&&c.type!=="AssignmentPattern"&&this.raise(x.UnsupportedParameterPropertyKind,d),d.parameter=c,this.finishNode(d,"TSParameterProperty")}return s.length&&(l.decorators=s),c}isSimpleParameter(t){return t.type==="TSParameterProperty"&&super.isSimpleParameter(t.parameter)||super.isSimpleParameter(t)}tsDisallowOptionalPattern(t){for(let s of t.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(x.PatternIsOptional,s)}setArrowFunctionParameters(t,s,i){super.setArrowFunctionParameters(t,s,i),this.tsDisallowOptionalPattern(t)}parseFunctionBodyAndFinish(t,s,i=!1){this.match(14)&&(t.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let r=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return r&&!this.match(5)&&this.isLineTerminator()?this.finishNode(t,r):r==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(x.DeclareFunctionHasImplementation,t),t.declare)?super.parseFunctionBodyAndFinish(t,r,i):(this.tsDisallowOptionalPattern(t),super.parseFunctionBodyAndFinish(t,s,i))}registerFunctionStatementId(t){!t.body&&t.id?this.checkIdentifier(t.id,1024):super.registerFunctionStatementId(t)}tsCheckForInvalidTypeCasts(t){t.forEach(s=>{s?.type==="TSTypeCastExpression"&&this.raise(x.UnexpectedTypeAnnotation,s.typeAnnotation)})}toReferencedList(t,s){return this.tsCheckForInvalidTypeCasts(t),t}parseArrayLike(t,s,i){let r=super.parseArrayLike(t,s,i);return r.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(r.elements),r}parseSubscript(t,s,i,r){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(s);return o.expression=t,this.finishNode(o,"TSNonNullExpression")}let n=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(i)return r.stop=!0,t;r.optionalChainMember=n=!0,this.next()}if(this.match(47)||this.match(51)){let o,h=this.tsTryParseAndCatch(()=>{if(!i&&this.atPossibleAsyncArrow(t)){let f=this.tsTryParseGenericAsyncArrowFunction(s);if(f)return r.stop=!0,f}let l=this.tsParseTypeArgumentsInExpression();if(!l)return;if(n&&!this.match(10)){o=this.state.curPosition();return}if(yt(this.state.type)){let f=super.parseTaggedTemplateExpression(t,s,r);return f.typeParameters=l,f}if(!i&&this.eat(10)){let f=this.startNodeAt(s);return f.callee=t,f.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(f.arguments),f.typeParameters=l,r.optionalChainMember&&(f.optional=n),this.finishCallExpression(f,r.optionalChainMember)}let c=this.state.type;if(c===48||c===52||c!==10&&c!==93&&c!==120&&it(c)&&!this.hasPrecedingLineBreak())return;let d=this.startNodeAt(s);return d.expression=t,d.typeParameters=l,this.finishNode(d,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),h)return h.type==="TSInstantiationExpression"&&((this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(x.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(16)&&!this.match(18)&&(h.expression=super.stopParseSubscript(t,r))),h}return super.parseSubscript(t,s,i,r)}parseNewCallee(t){var s;super.parseNewCallee(t);let{callee:i}=t;i.type==="TSInstantiationExpression"&&!((s=i.extra)!=null&&s.parenthesized)&&(t.typeParameters=i.typeParameters,t.callee=i.expression)}parseExprOp(t,s,i){let r;if(dt(58)>i&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(r=this.isContextual(120)))){let n=this.startNodeAt(s);return n.expression=t,n.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(r&&this.raise(u.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(n,r?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(n,s,i)}return super.parseExprOp(t,s,i)}checkReservedWord(t,s,i,r){this.state.isAmbientContext||super.checkReservedWord(t,s,i,r)}checkImportReflection(t){super.checkImportReflection(t),t.module&&t.importKind!=="value"&&this.raise(x.ImportReflectionHasImportType,t.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(t){if(super.isPotentialImportPhase(t))return!0;if(this.isContextual(130)){let s=this.lookaheadCharCode();return t?s===123||s===42:s!==61}return!t&&this.isContextual(87)}applyImportPhase(t,s,i,r){super.applyImportPhase(t,s,i,r),s?t.exportKind=i==="type"?"type":"value":t.importKind=i==="type"||i==="typeof"?i:"value"}parseImport(t){if(this.match(134))return t.importKind="value",super.parseImport(t);let s;if(E(this.state.type)&&this.lookaheadCharCode()===61)return t.importKind="value",this.tsParseImportEqualsDeclaration(t);if(this.isContextual(130)){let i=this.parseMaybeImportPhase(t,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(t,i);s=super.parseImportSpecifiersAndAfter(t,i)}else s=super.parseImport(t);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(x.TypeImportCannotSpecifyDefaultAndNamed,s),s}parseExport(t,s){if(this.match(83)){let i=t;this.next();let r=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?r=this.parseMaybeImportPhase(i,!1):i.importKind="value",this.tsParseImportEqualsDeclaration(i,r,!0)}else if(this.eat(29)){let i=t;return i.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(i,"TSExportAssignment")}else if(this.eatContextual(93)){let i=t;return this.expectContextual(128),i.id=this.parseIdentifier(),this.semicolon(),this.finishNode(i,"TSNamespaceExportDeclaration")}else return super.parseExport(t,s)}isAbstractClass(){return this.isContextual(124)&&this.isLookaheadContextual("class")}parseExportDefaultExpression(){if(this.isAbstractClass()){let t=this.startNode();return this.next(),t.abstract=!0,this.parseClass(t,!0,!0)}if(this.match(129)){let t=this.tsParseInterfaceDeclaration(this.startNode());if(t)return t}return super.parseExportDefaultExpression()}parseVarStatement(t,s,i=!1){let{isAmbientContext:r}=this.state,n=super.parseVarStatement(t,s,i||r);if(!r)return n;if(!t.declare&&(s==="using"||s==="await using"))return this.raiseOverwrite(x.UsingDeclarationInAmbientContext,t,s),n;for(let{id:o,init:h}of n.declarations)h&&(s==="var"||s==="let"||o.typeAnnotation?this.raise(x.InitializerNotAllowedInAmbientContext,h):Pi(h,this.hasPlugin("estree"))||this.raise(x.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,h));return n}parseStatementContent(t,s){if(!this.state.containsEsc)switch(this.state.type){case 75:{if(this.isLookaheadContextual("enum")){let i=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(i,{const:!0})}break}case 124:case 125:{if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let i=this.state.type,r=this.startNode();this.next();let n=i===125?this.tsTryParseDeclare(r):this.tsParseAbstractDeclaration(r,s);return n?(i===125&&(n.declare=!0),n):(r.expression=this.createIdentifier(this.startNodeAt(r.loc.start),i===125?"declare":"abstract"),this.semicolon(!1),this.finishNode(r,"ExpressionStatement"))}break}case 126:return this.tsParseEnumDeclaration(this.startNode());case 112:{if(this.lookaheadCharCode()===123){let r=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(r)}break}case 129:{let i=this.tsParseInterfaceDeclaration(this.startNode());if(i)return i;break}case 127:{if(this.nextTokenIsIdentifierOrStringLiteralOnSameLine()){let i=this.startNode();return this.next(),this.tsParseDeclaration(i,127,!1,s)}break}case 128:{if(this.nextTokenIsIdentifierOnSameLine()){let i=this.startNode();return this.next(),this.tsParseDeclaration(i,128,!1,s)}break}case 130:{if(this.nextTokenIsIdentifierOnSameLine()){let i=this.startNode();return this.next(),this.tsParseTypeAliasDeclaration(i)}break}}return super.parseStatementContent(t,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(t,s){return s.some(i=>Ve(i)?t.accessibility===i:!!t[i])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(t,s,i){let r=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:r,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:x.InvalidModifierOnTypeParameterPositions},s);let n=p(()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,r)&&this.raise(x.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(t,s)):this.parseClassMemberWithIsStatic(t,s,i,!!s.static)},"callParseClassMemberWithIsStatic");s.declare?this.tsInAmbientContext(n):n()}parseClassMemberWithIsStatic(t,s,i,r){let n=this.tsTryParseIndexSignature(s);if(n){t.body.push(n),s.abstract&&this.raise(x.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(x.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(x.IndexSignatureHasDeclare,s),s.override&&this.raise(x.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(x.NonAbstractClassHasAbstractMethod,s),s.override&&(i.hadSuperClass||this.raise(x.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(t,s,i,r)}parsePostMemberNameModifiers(t){this.eat(17)&&(t.optional=!0),t.readonly&&this.match(10)&&this.raise(x.ClassMethodHasReadonly,t),t.declare&&this.match(10)&&this.raise(x.ClassMethodHasDeclare,t)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(t,s,i){if(!this.match(17))return t;if(this.state.maybeInArrowParameters){let r=this.lookaheadCharCode();if(r===44||r===61||r===58||r===41)return this.setOptionalParametersError(i),t}return super.parseConditional(t,s,i)}parseParenItem(t,s){let i=super.parseParenItem(t,s);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(t)),this.match(14)){let r=this.startNodeAt(s);return r.expression=t,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return t}parseExportDeclaration(t){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(t));let s=this.state.startLoc,i=this.eatContextual(125);if(i&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(x.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let n=E(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(t);return n?((n.type==="TSInterfaceDeclaration"||n.type==="TSTypeAliasDeclaration"||i)&&(t.exportKind="type"),i&&n.type!=="TSImportEqualsDeclaration"&&(this.resetStartLocation(n,s),n.declare=!0),n):null}parseClassId(t,s,i,r){if((!s||i)&&this.isContextual(113))return;super.parseClassId(t,s,i,t.declare?1024:8331);let n=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);n&&(t.typeParameters=n)}parseClassPropertyAnnotation(t){t.optional||(this.eat(35)?t.definite=!0:this.eat(17)&&(t.optional=!0));let s=this.tsTryParseTypeAnnotation();s&&(t.typeAnnotation=s)}parseClassProperty(t){if(this.parseClassPropertyAnnotation(t),this.state.isAmbientContext&&!(t.readonly&&!t.typeAnnotation)&&this.match(29)&&this.raise(x.DeclareClassFieldHasInitializer,this.state.startLoc),t.abstract&&this.match(29)){let{key:s}=t;this.raise(x.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:s.type==="Identifier"&&!t.computed?s.name:`[${this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end))}]`})}return super.parseClassProperty(t)}parseClassPrivateProperty(t){return t.abstract&&this.raise(x.PrivateElementHasAbstract,t),t.accessibility&&this.raise(x.PrivateElementHasAccessibility,t,{modifier:t.accessibility}),this.parseClassPropertyAnnotation(t),super.parseClassPrivateProperty(t)}parseClassAccessorProperty(t){return this.parseClassPropertyAnnotation(t),t.optional&&this.raise(x.AccessorCannotBeOptional,t),super.parseClassAccessorProperty(t)}pushClassMethod(t,s,i,r,n,o){let h=this.tsTryParseTypeParameters(this.tsParseConstModifier);h&&n&&this.raise(x.ConstructorHasTypeParameters,h);let{declare:l=!1,kind:c}=s;l&&(c==="get"||c==="set")&&this.raise(x.DeclareAccessor,s,{kind:c}),h&&(s.typeParameters=h),super.pushClassMethod(t,s,i,r,n,o)}pushClassPrivateMethod(t,s,i,r){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(s.typeParameters=n),super.pushClassPrivateMethod(t,s,i,r)}declareClassPrivateMethodInScope(t,s){t.type!=="TSDeclareMethod"&&(t.type==="MethodDefinition"&&t.value.body==null||super.declareClassPrivateMethodInScope(t,s))}parseClassSuper(t){if(super.parseClassSuper(t),t.superClass)if(t.superClass.type==="TSInstantiationExpression"){let s=t.superClass,i=s.expression;this.takeSurroundingComments(i,i.start,i.end);let r=s.typeParameters;this.takeSurroundingComments(r,r.start,r.end),t.superClass=i,t.superTypeParameters=r}else(this.match(47)||this.match(51))&&(t.superTypeParameters=this.tsParseTypeArgumentsInExpression());this.eatContextual(113)&&(t.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(t,s,i,r,n,o,h){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);return l&&(t.typeParameters=l),super.parseObjPropValue(t,s,i,r,n,o,h)}parseFunctionParams(t,s){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(t.typeParameters=i),super.parseFunctionParams(t,s)}parseVarId(t,s){super.parseVarId(t,s),t.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(t.definite=!0);let i=this.tsTryParseTypeAnnotation();i&&(t.id.typeAnnotation=i,this.resetEndLocation(t.id))}parseAsyncArrowFromCallExpression(t,s){return this.match(14)&&(t.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(t,s)}parseMaybeAssign(t,s){var i,r,n,o,h;let l,c,d;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(l=this.state.clone(),c=this.tryParse(()=>super.parseMaybeAssign(t,s),l),!c.error)return c.node;let{context:P}=this.state,C=P[P.length-1];(C===I.j_oTag||C===I.j_expr)&&P.pop()}if(!((i=c)!=null&&i.error)&&!this.match(47))return super.parseMaybeAssign(t,s);(!l||l===this.state)&&(l=this.state.clone());let f,m=this.tryParse(P=>{var C,k;f=this.tsParseTypeParameters(this.tsParseConstModifier);let b=super.parseMaybeAssign(t,s);return(b.type!=="ArrowFunctionExpression"||(C=b.extra)!=null&&C.parenthesized)&&P(),((k=f)==null?void 0:k.params.length)!==0&&this.resetStartLocationFromNode(b,f),b.typeParameters=f,b},l);if(!m.error&&!m.aborted)return f&&this.reportReservedArrowTypeParam(f),m.node;if(!c&&($e(!this.hasPlugin("jsx")),d=this.tryParse(()=>super.parseMaybeAssign(t,s),l),!d.error))return d.node;if((r=c)!=null&&r.node)return this.state=c.failState,c.node;if(m.node)return this.state=m.failState,f&&this.reportReservedArrowTypeParam(f),m.node;if((n=d)!=null&&n.node)return this.state=d.failState,d.node;throw((o=c)==null?void 0:o.error)||m.error||((h=d)==null?void 0:h.error)}reportReservedArrowTypeParam(t){var s;t.params.length===1&&!t.params[0].constraint&&!((s=t.extra)!=null&&s.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(x.ReservedArrowTypeParam,t)}parseMaybeUnary(t,s){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(t,s)}parseArrow(t){if(this.match(14)){let s=this.tryParse(i=>{let r=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&i(),r});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),t.returnType=s.node)}return super.parseArrow(t)}parseFunctionParamType(t){this.eat(17)&&(t.optional=!0);let s=this.tsTryParseTypeAnnotation();return s&&(t.typeAnnotation=s),this.resetEndLocation(t),t}isAssignable(t,s){switch(t.type){case"TSTypeCastExpression":return this.isAssignable(t.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(t,s)}}toAssignable(t,s=!1){switch(t.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(t,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(x.UnexpectedTypeCastInParameter,t):this.raise(x.UnexpectedTypeCastInParameter,t),this.toAssignable(t.expression,s);break;case"AssignmentExpression":!s&&t.left.type==="TSTypeCastExpression"&&(t.left=this.typeCastToParameter(t.left));default:super.toAssignable(t,s)}}toAssignableParenthesizedExpression(t,s){switch(t.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(t.expression,s);break;default:super.toAssignable(t,s)}}checkToRestConversion(t,s){switch(t.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(t.expression,!1);break;default:super.checkToRestConversion(t,s)}}isValidLVal(t,s,i,r){switch(t){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(r!==64||!i)&&["expression",!0];default:return super.isValidLVal(t,s,i,r)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(t,s){if(this.match(47)||this.match(51)){let i=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let r=super.parseMaybeDecoratorArguments(t,s);return r.typeParameters=i,r}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(t,s)}checkCommaAfterRest(t){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===t?(this.next(),!1):super.checkCommaAfterRest(t)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(t,s){let i=super.parseMaybeDefault(t,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.start<i.typeAnnotation.start&&this.raise(x.TypeAnnotationAfterAssign,i.typeAnnotation),i}getTokenFromCode(t){if(this.state.inType){if(t===62){this.finishOp(48,1);return}if(t===60){this.finishOp(47,1);return}}super.getTokenFromCode(t)}reScan_lt_gt(){let{type:t}=this.state;t===47?(this.state.pos-=1,this.readToken_lt()):t===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:t}=this.state;return t===51?(this.state.pos-=2,this.finishOp(47,1),47):t}toAssignableListItem(t,s,i){let r=t[s];r.type==="TSTypeCastExpression"&&(t[s]=this.typeCastToParameter(r)),super.toAssignableListItem(t,s,i)}typeCastToParameter(t){return t.expression.typeAnnotation=t.typeAnnotation,this.resetEndLocation(t.expression,t.typeAnnotation.loc.end),t.expression}shouldParseArrow(t){return this.match(14)?t.every(s=>this.isAssignable(s,!0)):super.shouldParseArrow(t)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(t){if(this.match(47)||this.match(51)){let s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(t.typeParameters=s)}return super.jsxParseOpeningElementAfterName(t)}getGetterSetterExpectedParamCount(t){let s=super.getGetterSetterExpectedParamCount(t),r=this.getObjectOrClassMethodParams(t)[0];return r&&this.isThisParam(r)?s+1:s}parseCatchClauseParam(){let t=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(t.typeAnnotation=s,this.resetEndLocation(t)),t}tsInAmbientContext(t){let{isAmbientContext:s,strict:i}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return t()}finally{this.state.isAmbientContext=s,this.state.strict=i}}parseClass(t,s,i){let r=this.state.inAbstractClass;this.state.inAbstractClass=!!t.abstract;try{return super.parseClass(t,s,i)}finally{this.state.inAbstractClass=r}}tsParseAbstractDeclaration(t,s){if(this.match(80))return t.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(t,!0,!1));if(this.isContextual(129))return this.hasFollowingLineBreak()?null:(t.abstract=!0,this.raise(x.NonClassMethodPropertyHasAbstractModifier,t),this.tsParseInterfaceDeclaration(t));throw this.unexpected(null,80)}parseMethod(t,s,i,r,n,o,h){let l=super.parseMethod(t,s,i,r,n,o,h);if((l.abstract||l.type==="TSAbstractMethodDefinition")&&(this.hasPlugin("estree")?l.value:l).body){let{key:f}=l;this.raise(x.AbstractMethodHasImplementation,l,{methodName:f.type==="Identifier"&&!l.computed?f.name:`[${this.input.slice(this.offsetToSourcePos(f.start),this.offsetToSourcePos(f.end))}]`})}return l}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(t,s,i,r){return!s&&r?(this.parseTypeOnlyImportExportSpecifier(t,!1,i),this.finishNode(t,"ExportSpecifier")):(t.exportKind="value",super.parseExportSpecifier(t,s,i,r))}parseImportSpecifier(t,s,i,r,n){return!s&&r?(this.parseTypeOnlyImportExportSpecifier(t,!0,i),this.finishNode(t,"ImportSpecifier")):(t.importKind="value",super.parseImportSpecifier(t,s,i,r,i?4098:4096))}parseTypeOnlyImportExportSpecifier(t,s,i){let r=s?"imported":"local",n=s?"local":"exported",o=t[r],h,l=!1,c=!0,d=o.loc.start;if(this.isContextual(93)){let m=this.parseIdentifier();if(this.isContextual(93)){let P=this.parseIdentifier();O(this.state.type)?(l=!0,o=m,h=s?this.parseIdentifier():this.parseModuleExportName(),c=!1):(h=P,c=!1)}else O(this.state.type)?(c=!1,h=s?this.parseIdentifier():this.parseModuleExportName()):(l=!0,o=m)}else O(this.state.type)&&(l=!0,s?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());l&&i&&this.raise(s?x.TypeModifierIsUsedInTypeImports:x.TypeModifierIsUsedInTypeExports,d),t[r]=o,t[n]=h;let f=s?"importKind":"exportKind";t[f]=l?"type":"value",c&&this.eatContextual(93)&&(t[n]=s?this.parseIdentifier():this.parseModuleExportName()),t[n]||(t[n]=this.cloneIdentifier(t[r])),s&&this.checkIdentifier(t[n],l?4098:4096)}fillOptionalPropertiesForTSESLint(t){var s,i,r,n,o,h,l,c,d,f,m,P,C,k,b,N,q,j,se,ie,re,ae,ne,oe,he,le,ce,ue,pe,de,fe,me,ye,xe,Pe,ge,Te,be,Ae,Se,we,Ce,Ie,Ee,Ne,ke,ve,Le;switch(t.type){case"ExpressionStatement":(s=t.directive)!=null||(t.directive=void 0);return;case"RestElement":t.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":(i=t.decorators)!=null||(t.decorators=[]),(r=t.optional)!=null||(t.optional=!1),(n=t.typeAnnotation)!=null||(t.typeAnnotation=void 0);return;case"TSParameterProperty":(o=t.accessibility)!=null||(t.accessibility=void 0),(h=t.decorators)!=null||(t.decorators=[]),(l=t.override)!=null||(t.override=!1),(c=t.readonly)!=null||(t.readonly=!1),(d=t.static)!=null||(t.static=!1);return;case"TSEmptyBodyFunctionExpression":t.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":(f=t.declare)!=null||(t.declare=!1),(m=t.returnType)!=null||(t.returnType=void 0),(P=t.typeParameters)!=null||(t.typeParameters=void 0);return;case"Property":(C=t.optional)!=null||(t.optional=!1);return;case"TSMethodSignature":case"TSPropertySignature":(k=t.optional)!=null||(t.optional=!1);case"TSIndexSignature":(b=t.accessibility)!=null||(t.accessibility=void 0),(N=t.readonly)!=null||(t.readonly=!1),(q=t.static)!=null||(t.static=!1);return;case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":(j=t.declare)!=null||(t.declare=!1),(se=t.definite)!=null||(t.definite=!1),(ie=t.readonly)!=null||(t.readonly=!1),(re=t.typeAnnotation)!=null||(t.typeAnnotation=void 0);case"TSAbstractMethodDefinition":case"MethodDefinition":(ae=t.accessibility)!=null||(t.accessibility=void 0),(ne=t.decorators)!=null||(t.decorators=[]),(oe=t.override)!=null||(t.override=!1),(he=t.optional)!=null||(t.optional=!1);return;case"ClassExpression":(le=t.id)!=null||(t.id=null);case"ClassDeclaration":(ce=t.abstract)!=null||(t.abstract=!1),(ue=t.declare)!=null||(t.declare=!1),(pe=t.decorators)!=null||(t.decorators=[]),(de=t.implements)!=null||(t.implements=[]),(fe=t.superTypeArguments)!=null||(t.superTypeArguments=void 0),(me=t.typeParameters)!=null||(t.typeParameters=void 0);return;case"TSTypeAliasDeclaration":case"VariableDeclaration":(ye=t.declare)!=null||(t.declare=!1);return;case"VariableDeclarator":(xe=t.definite)!=null||(t.definite=!1);return;case"TSEnumDeclaration":(Pe=t.const)!=null||(t.const=!1),(ge=t.declare)!=null||(t.declare=!1);return;case"TSEnumMember":(Te=t.computed)!=null||(t.computed=!1);return;case"TSImportType":(be=t.qualifier)!=null||(t.qualifier=null),(Ae=t.options)!=null||(t.options=null);return;case"TSInterfaceDeclaration":(Se=t.declare)!=null||(t.declare=!1),(we=t.extends)!=null||(t.extends=[]);return;case"TSMappedType":(Ce=t.optional)!=null||(t.optional=!1),(Ie=t.readonly)!=null||(t.readonly=void 0);return;case"TSModuleDeclaration":(Ee=t.declare)!=null||(t.declare=!1),(Ne=t.global)!=null||(t.global=t.kind==="global");return;case"TSTypeParameter":(ke=t.const)!=null||(t.const=!1),(ve=t.in)!=null||(t.in=!1),(Le=t.out)!=null||(t.out=!1);return}}chStartsBindingIdentifierAndNotRelationalOperator(t,s){if(B(t)){if(St.lastIndex=s,St.test(this.input)){let i=this.codePointAtPos(St.lastIndex);if(!W(i)&&i!==92)return!1}return!0}else return t===92}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let t=this.nextTokenInLineStart(),s=this.codePointAtPos(t);return this.chStartsBindingIdentifierAndNotRelationalOperator(s,t)}nextTokenIsIdentifierOrStringLiteralOnSameLine(){let t=this.nextTokenInLineStart(),s=this.codePointAtPos(t);return this.chStartsBindingIdentifier(s,t)||s===34||s===39}},"typescript");function xi(a){if(a.type!=="MemberExpression")return!1;let{computed:e,property:t}=a;return e&&t.type!=="StringLiteral"&&(t.type!=="TemplateLiteral"||t.expressions.length>0)?!1:as(a.object)}p(xi,"isPossiblyLiteralEnum");function Pi(a,e){var t;let{type:s}=a;if((t=a.extra)!=null&&t.parenthesized)return!1;if(e){if(s==="Literal"){let{value:i}=a;if(typeof i=="string"||typeof i=="boolean")return!0}}else if(s==="StringLiteral"||s==="BooleanLiteral")return!0;return!!(rs(a,e)||gi(a,e)||s==="TemplateLiteral"&&a.expressions.length===0||xi(a))}p(Pi,"isValidAmbientConstInitializer");function rs(a,e){return e?a.type==="Literal"&&(typeof a.value=="number"||"bigint"in a):a.type==="NumericLiteral"||a.type==="BigIntLiteral"}p(rs,"isNumber");function gi(a,e){if(a.type==="UnaryExpression"){let{operator:t,argument:s}=a;if(t==="-"&&rs(s,e))return!0}return!1}p(gi,"isNegativeNumber");function as(a){return a.type==="Identifier"?!0:a.type!=="MemberExpression"||a.computed?!1:as(a.object)}p(as,"isUncomputedMemberExpressionChain");var ze=F`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Ti=p(a=>class extends a{static{p(this,"PlaceholdersParserMixin")}parsePlaceholder(t){if(this.match(133)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(s,t)}}finishPlaceholder(t,s){let i=t;return(!i.expectedNode||!i.type)&&(i=this.finishNode(i,"Placeholder")),i.expectedNode=s,i}getTokenFromCode(t){t===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(133,2):super.getTokenFromCode(t)}parseExprAtom(t){return this.parsePlaceholder("Expression")||super.parseExprAtom(t)}parseIdentifier(t){return this.parsePlaceholder("Identifier")||super.parseIdentifier(t)}checkReservedWord(t,s,i,r){t!==void 0&&super.checkReservedWord(t,s,i,r)}cloneIdentifier(t){let s=super.cloneIdentifier(t);return s.type==="Placeholder"&&(s.expectedNode=t.expectedNode),s}cloneStringLiteral(t){return t.type==="Placeholder"?this.cloneIdentifier(t):super.cloneStringLiteral(t)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(t,s,i,r){return t==="Placeholder"||super.isValidLVal(t,s,i,r)}toAssignable(t,s){t&&t.type==="Placeholder"&&t.expectedNode==="Expression"?t.expectedNode="Pattern":super.toAssignable(t,s)}chStartsBindingIdentifier(t,s){if(super.chStartsBindingIdentifier(t,s))return!0;let i=this.nextTokenStart();return this.input.charCodeAt(i)===37&&this.input.charCodeAt(i+1)===37}verifyBreakContinue(t,s){var i;((i=t.label)==null?void 0:i.type)!=="Placeholder"&&super.verifyBreakContinue(t,s)}parseExpressionStatement(t,s){var i;if(s.type!=="Placeholder"||(i=s.extra)!=null&&i.parenthesized)return super.parseExpressionStatement(t,s);if(this.match(14)){let n=t;return n.label=this.finishPlaceholder(s,"Identifier"),this.next(),n.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(n,"LabeledStatement")}this.semicolon();let r=t;return r.name=s.name,this.finishPlaceholder(r,"Statement")}parseBlock(t,s,i){return this.parsePlaceholder("BlockStatement")||super.parseBlock(t,s,i)}parseFunctionId(t){return this.parsePlaceholder("Identifier")||super.parseFunctionId(t)}parseClass(t,s,i){let r=s?"ClassDeclaration":"ClassExpression";this.next();let n=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(133)||this.match(5))t.id=o;else{if(i||!s)return t.id=null,t.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(t,r);throw this.raise(ze.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(t,s,i);return super.parseClassSuper(t),t.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!t.superClass,n),this.finishNode(t,r)}parseExport(t,s){let i=this.parsePlaceholder("Identifier");if(!i)return super.parseExport(t,s);let r=t;if(!this.isContextual(98)&&!this.match(12))return r.specifiers=[],r.source=null,r.declaration=this.finishPlaceholder(i,"Declaration"),this.finishNode(r,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let n=this.startNode();return n.exported=i,r.specifiers=[this.finishNode(n,"ExportDefaultSpecifier")],super.parseExport(r,s)}isExportDefaultSpecifier(){if(this.match(65)){let t=this.nextTokenStart();if(this.isUnparsedContextual(t,"from")&&this.input.startsWith(z(133),this.nextTokenStartSince(t+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(t,s){var i;return(i=t.specifiers)!=null&&i.length?!0:super.maybeParseExportDefaultSpecifier(t,s)}checkExport(t){let{specifiers:s}=t;s!=null&&s.length&&(t.specifiers=s.filter(i=>i.exported.type==="Placeholder")),super.checkExport(t),t.specifiers=s}parseImport(t){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(t);if(t.specifiers=[],!this.isContextual(98)&&!this.match(12))return t.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(t,"ImportDeclaration");let i=this.startNodeAtNode(s);return i.local=s,t.specifiers.push(this.finishNode(i,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(t)||this.parseNamedImportSpecifiers(t)),this.expectContextual(98),t.source=this.parseImportSource(),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(ze.UnexpectedSpace,this.state.lastTokEndLoc)}},"placeholders"),bi=p(a=>class extends a{static{p(this,"V8IntrinsicMixin")}parseV8Intrinsic(){if(this.match(54)){let t=this.state.startLoc,s=this.startNode();if(this.next(),E(this.state.type)){let i=this.parseIdentifierName(),r=this.createIdentifier(s,i);if(this.castNodeTo(r,"V8IntrinsicIdentifier"),this.match(10))return r}this.unexpected(t)}}parseExprAtom(t){return this.parseV8Intrinsic()||super.parseExprAtom(t)}},"v8intrinsic"),qe=["minimal","fsharp","hack","smart"],He=["^^","@@","^","%","#"];function Ai(a){if(a.has("decorators")){if(a.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let s=a.get("decorators").decoratorsBeforeExport;if(s!=null&&typeof s!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let i=a.get("decorators").allowCallParenthesized;if(i!=null&&typeof i!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(a.has("flow")&&a.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(a.has("placeholders")&&a.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(a.has("pipelineOperator")){var e;let s=a.get("pipelineOperator").proposal;if(!qe.includes(s)){let i=qe.map(r=>`"${r}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${i}.`)}if(s==="hack"){var t;if(a.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(a.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let i=a.get("pipelineOperator").topicToken;if(!He.includes(i)){let r=He.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${r}.`)}if(i==="#"&&((t=a.get("recordAndTuple"))==null?void 0:t.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",a.get("recordAndTuple")])}\`.`)}else if(s==="smart"&&((e=a.get("recordAndTuple"))==null?void 0:e.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",a.get("recordAndTuple")])}\`.`)}if(a.has("moduleAttributes")){if(a.has("deprecatedImportAssert")||a.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(a.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(a.has("importAssertions")&&a.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(a.has("deprecatedImportAssert")||a.has("importAttributes")&&a.get("importAttributes").deprecatedAssertSyntax&&a.set("deprecatedImportAssert",{}),a.has("recordAndTuple")){let s=a.get("recordAndTuple").syntaxType;if(s!=null){let i=["hash","bar"];if(!i.includes(s))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+i.map(r=>`'${r}'`).join(", "))}}if(a.has("asyncDoExpressions")&&!a.has("doExpressions")){let s=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw s.missingPlugins="doExpressions",s}if(a.has("optionalChainingAssign")&&a.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.");if(a.has("discardBinding")&&a.get("discardBinding").syntaxType!=="void")throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.")}p(Ai,"validatePlugins");var ns={estree:Is,jsx:ri,flow:ti,typescript:yi,v8intrinsic:bi,placeholders:Ti},Si=Object.keys(ns),Ht=class extends qt{static{p(this,"ExpressionParser")}checkProto(e,t,s,i){if(e.type==="SpreadElement"||this.isObjectMethod(e)||e.computed||e.shorthand)return s;let r=e.key;return(r.type==="Identifier"?r.name:r.value)==="__proto__"?t?(this.raise(u.RecordNoProto,r),!0):(s&&(i?i.doubleProtoLoc===null&&(i.doubleProtoLoc=r.loc.start):this.raise(u.DuplicateProto,r)),!0):s}shouldExitDescending(e,t){return e.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(e.start)===t}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(140))throw this.raise(u.ParseExpressionEmptyInput,this.state.startLoc);let e=this.parseExpression();if(!this.match(140))throw this.raise(u.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),e.comments=this.comments,e.errors=this.state.errors,this.optionFlags&256&&(e.tokens=this.tokens),e}parseExpression(e,t){return e?this.disallowInAnd(()=>this.parseExpressionBase(t)):this.allowInAnd(()=>this.parseExpressionBase(t))}parseExpressionBase(e){let t=this.state.startLoc,s=this.parseMaybeAssign(e);if(this.match(12)){let i=this.startNodeAt(t);for(i.expressions=[s];this.eat(12);)i.expressions.push(this.parseMaybeAssign(e));return this.toReferencedList(i.expressions),this.finishNode(i,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(e,t){return this.disallowInAnd(()=>this.parseMaybeAssign(e,t))}parseMaybeAssignAllowIn(e,t){return this.allowInAnd(()=>this.parseMaybeAssign(e,t))}setOptionalParametersError(e){e.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(e,t){let s=this.state.startLoc,i=this.isContextual(108);if(i&&this.prodParam.hasYield){this.next();let h=this.parseYield(s);return t&&(h=t.call(this,h,s)),h}let r;e?r=!1:(e=new G,r=!0);let{type:n}=this.state;(n===10||E(n))&&(this.state.potentialArrowAt=this.state.start);let o=this.parseMaybeConditional(e);if(t&&(o=t.call(this,o,s)),Ls(this.state.type)){let h=this.startNodeAt(s),l=this.state.value;if(h.operator=l,this.match(29)){this.toAssignable(o,!0),h.left=o;let c=s.index;e.doubleProtoLoc!=null&&e.doubleProtoLoc.index>=c&&(e.doubleProtoLoc=null),e.shorthandAssignLoc!=null&&e.shorthandAssignLoc.index>=c&&(e.shorthandAssignLoc=null),e.privateKeyLoc!=null&&e.privateKeyLoc.index>=c&&(this.checkDestructuringPrivate(e),e.privateKeyLoc=null),e.voidPatternLoc!=null&&e.voidPatternLoc.index>=c&&(e.voidPatternLoc=null)}else h.left=o;return this.next(),h.right=this.parseMaybeAssign(),this.checkLVal(o,this.finishNode(h,"AssignmentExpression"),void 0,void 0,void 0,void 0,l==="||="||l==="&&="||l==="??="),h}else r&&this.checkExpressionErrors(e,!0);if(i){let{type:h}=this.state;if((this.hasPlugin("v8intrinsic")?it(h):it(h)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(u.YieldNotInGeneratorFunction,s),this.parseYield(s)}return o}parseMaybeConditional(e){let t=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprOps(e);return this.shouldExitDescending(i,s)?i:this.parseConditional(i,t,e)}parseConditional(e,t,s){if(this.eat(17)){let i=this.startNodeAt(t);return i.test=e,i.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),i.alternate=this.parseMaybeAssign(),this.finishNode(i,"ConditionalExpression")}return e}parseMaybeUnaryOrPrivate(e){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(e)}parseExprOps(e){let t=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseMaybeUnaryOrPrivate(e);return this.shouldExitDescending(i,s)?i:this.parseExprOp(i,t,-1)}parseExprOp(e,t,s){if(this.isPrivateName(e)){let r=this.getPrivateNameSV(e);(s>=dt(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(u.PrivateInExpectedIn,e,{identifierName:r}),this.classScope.usePrivateName(r,e.loc.start)}let i=this.state.type;if(Os(i)&&(this.prodParam.hasIn||!this.match(58))){let r=dt(i);if(r>s){if(i===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return e;this.checkPipelineAtInfixOperator(e,t)}let n=this.startNodeAt(t);n.left=e,n.operator=this.state.value;let o=i===41||i===42,h=i===40;if(h&&(r=dt(42)),this.next(),i===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(u.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);n.right=this.parseExprOpRightExpr(i,r);let l=this.finishNode(n,o||h?"LogicalExpression":"BinaryExpression"),c=this.state.type;if(h&&(c===41||c===42)||o&&c===40)throw this.raise(u.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(l,t,s)}}return e}parseExprOpRightExpr(e,t){let s=this.state.startLoc;switch(e){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(t))}if(this.getPluginOption("pipelineOperator","proposal")==="smart")return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(u.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(e,t),s)});default:return this.parseExprOpBaseRightExpr(e,t)}}parseExprOpBaseRightExpr(e,t){let s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,Us(e)?t-1:t)}parseHackPipeBody(){var e;let{startLoc:t}=this.state,s=this.parseMaybeAssign();return gs.has(s.type)&&!((e=s.extra)!=null&&e.parenthesized)&&this.raise(u.PipeUnparenthesizedBody,t,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(u.PipeTopicUnused,t),s}checkExponentialAfterUnary(e){this.match(57)&&this.raise(u.UnexpectedTokenUnaryExponentiation,e.argument)}parseMaybeUnary(e,t){let s=this.state.startLoc,i=this.isContextual(96);if(i&&this.recordAwaitIfAllowed()){this.next();let h=this.parseAwait(s);return t||this.checkExponentialAfterUnary(h),h}let r=this.match(34),n=this.startNode();if(Fs(this.state.type)){n.operator=this.state.value,n.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let h=this.match(89);if(this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),this.state.strict&&h){let l=n.argument;l.type==="Identifier"?this.raise(u.StrictDelete,n):this.hasPropertyAsPrivateName(l)&&this.raise(u.DeletePrivateField,n)}if(!r)return t||this.checkExponentialAfterUnary(n),this.finishNode(n,"UnaryExpression")}let o=this.parseUpdate(n,r,e);if(i){let{type:h}=this.state;if((this.hasPlugin("v8intrinsic")?it(h):it(h)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(u.AwaitNotInAsyncContext,s),this.parseAwait(s)}return o}parseUpdate(e,t,s){if(t){let n=e;return this.checkLVal(n.argument,this.finishNode(n,"UpdateExpression")),e}let i=this.state.startLoc,r=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return r;for(;Ms(this.state.type)&&!this.canInsertSemicolon();){let n=this.startNodeAt(i);n.operator=this.state.value,n.prefix=!1,n.argument=r,this.next(),this.checkLVal(r,r=this.finishNode(n,"UpdateExpression"))}return r}parseExprSubscripts(e){let t=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprAtom(e);return this.shouldExitDescending(i,s)?i:this.parseSubscripts(i,t)}parseSubscripts(e,t,s){let i={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(e),stop:!1};do e=this.parseSubscript(e,t,s,i),i.maybeAsyncArrow=!1;while(!i.stop);return e}parseSubscript(e,t,s,i){let{type:r}=this.state;if(!s&&r===15)return this.parseBind(e,t,s,i);if(yt(r))return this.parseTaggedTemplateExpression(e,t,i);let n=!1;if(r===18){if(s&&(this.raise(u.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(e,i);i.optionalChainMember=n=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(e,t,i,n);{let o=this.eat(0);return o||n||this.eat(16)?this.parseMember(e,t,i,o,n):this.stopParseSubscript(e,i)}}stopParseSubscript(e,t){return t.stop=!0,e}parseMember(e,t,s,i,r){let n=this.startNodeAt(t);return n.object=e,n.computed=i,i?(n.property=this.parseExpression(),this.expect(3)):this.match(139)?(e.type==="Super"&&this.raise(u.SuperPrivateField,t),this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),s.optionalChainMember?(n.optional=r,this.finishNode(n,"OptionalMemberExpression")):this.finishNode(n,"MemberExpression")}parseBind(e,t,s,i){let r=this.startNodeAt(t);return r.object=e,this.next(),r.callee=this.parseNoCallExpr(),i.stop=!0,this.parseSubscripts(this.finishNode(r,"BindExpression"),t,s)}parseCoverCallAndAsyncArrowHead(e,t,s,i){let r=this.state.maybeInArrowParameters,n=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(t);o.callee=e;let{maybeAsyncArrow:h,optionalChainMember:l}=s;h&&(this.expressionScope.enter(pi()),n=new G),l&&(o.optional=i),i?o.arguments=this.parseCallExpressionArguments():o.arguments=this.parseCallExpressionArguments(e.type!=="Super",o,n);let c=this.finishCallExpression(o,l);return h&&this.shouldParseAsyncArrow()&&!i?(s.stop=!0,this.checkDestructuringPrivate(n),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(t),c)):(h&&(this.checkExpressionErrors(n,!0),this.expressionScope.exit()),this.toReferencedArguments(c)),this.state.maybeInArrowParameters=r,c}toReferencedArguments(e,t){this.toReferencedListDeep(e.arguments,t)}parseTaggedTemplateExpression(e,t,s){let i=this.startNodeAt(t);return i.tag=e,i.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(u.OptionalChainingNoTemplate,t),this.finishNode(i,"TaggedTemplateExpression")}atPossibleAsyncArrow(e){return e.type==="Identifier"&&e.name==="async"&&this.state.lastTokEndLoc.index===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.offsetToSourcePos(e.start)===this.state.potentialArrowAt}finishCallExpression(e,t){if(e.callee.type==="Import")if(e.arguments.length===0||e.arguments.length>2)this.raise(u.ImportCallArity,e);else for(let s of e.arguments)s.type==="SpreadElement"&&this.raise(u.ImportCallSpreadArgument,s);return this.finishNode(e,t?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(e,t,s){let i=[],r=!0,n=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(11);){if(r)r=!1;else if(this.expect(12),this.match(11)){t&&this.addTrailingCommaExtraToNode(t),this.next();break}i.push(this.parseExprListItem(11,!1,s,e))}return this.state.inFSharpPipelineDirectBody=n,i}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(e,t){var s;return this.resetPreviousNodeTrailingComments(t),this.expect(19),this.parseArrowExpression(e,t.arguments,!0,(s=t.extra)==null?void 0:s.trailingCommaLoc),t.innerComments&&ht(e,t.innerComments),t.callee.trailingComments&&ht(e,t.callee.trailingComments),e}parseNoCallExpr(){let e=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,!0)}parseExprAtom(e){let t,s=null,{type:i}=this.state;switch(i){case 79:return this.parseSuper();case 83:return t=this.startNode(),this.next(),this.match(16)?this.parseImportMetaPropertyOrPhaseCall(t):this.match(10)?this.optionFlags&512?this.parseImportCall(t):this.finishNode(t,"Import"):(this.raise(u.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(t,"Import"));case 78:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let r=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(r)}case 0:return this.parseArrayLike(3,!1,e);case 5:return this.parseObjectLike(8,!1,!1,e);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{t=this.startNode(),this.next(),t.object=null;let r=t.callee=this.parseNoCallExpr();if(r.type==="MemberExpression")return this.finishNode(t,"BindExpression");throw this.raise(u.UnsupportedBind,r)}case 139:return this.raise(u.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let r=this.getPluginOption("pipelineOperator","proposal");if(r)return this.parseTopicReference(r);throw this.unexpected()}case 47:{let r=this.input.codePointAt(this.nextTokenStart());throw B(r)||r===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected()}default:if(i===137)return this.parseDecimalLiteral(this.state.value);if(i===2||i===1)return this.parseArrayLike(this.state.type===2?4:3,!0);if(i===6||i===7)return this.parseObjectLike(this.state.type===6?9:8,!1,!0);if(E(i)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let r=this.state.potentialArrowAt===this.state.start,n=this.state.containsEsc,o=this.parseIdentifier();if(!n&&o.name==="async"&&!this.canInsertSemicolon()){let{type:h}=this.state;if(h===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(E(h))return r&&this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(h===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return r&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else throw this.unexpected()}}parseTopicReferenceThenEqualsSign(e,t){let s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=e,this.state.value=t,this.state.pos--,this.state.end--,this.state.endLoc=L(this.state.endLoc,-1),this.parseTopicReference(s);throw this.unexpected()}parseTopicReference(e){let t=this.startNode(),s=this.state.startLoc,i=this.state.type;return this.next(),this.finishTopicReference(t,s,e,i)}finishTopicReference(e,t,s,i){if(this.testTopicReferenceConfiguration(s,t,i))return s==="hack"?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(u.PipeTopicUnbound,t),this.registerTopicReference(),this.finishNode(e,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(u.PrimaryTopicNotAllowed,t),this.registerTopicReference(),this.finishNode(e,"PipelinePrimaryTopicReference"));throw this.raise(u.PipeTopicUnconfiguredToken,t,{token:z(i)})}testTopicReferenceConfiguration(e,t,s){switch(e){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:z(s)}]);case"smart":return s===27;default:throw this.raise(u.PipeTopicRequiresHackPipes,t)}}parseAsyncArrowUnaryFunction(e){this.prodParam.enter(ft(!0,this.prodParam.hasYield));let t=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(u.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(e,t,!0)}parseDo(e,t){this.expectPlugin("doExpressions"),t&&this.expectPlugin("asyncDoExpressions"),e.async=t,this.next();let s=this.state.labels;return this.state.labels=[],t?(this.prodParam.enter(2),e.body=this.parseBlock(),this.prodParam.exit()):e.body=this.parseBlock(),this.state.labels=s,this.finishNode(e,"DoExpression")}parseSuper(){let e=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper?this.optionFlags&16||this.raise(u.SuperNotAllowed,e):this.scope.allowSuper||this.optionFlags&16||this.raise(u.UnexpectedSuper,e),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(u.UnsupportedSuper,e),this.finishNode(e,"Super")}parsePrivateName(){let e=this.startNode(),t=this.startNodeAt(L(this.state.startLoc,1)),s=this.state.value;return this.next(),e.id=this.createIdentifier(t,s),this.finishNode(e,"PrivateName")}parseFunctionOrFunctionSent(){let e=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let t=this.createIdentifier(this.startNodeAtNode(e),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(e,t,"sent")}return this.parseFunction(e)}parseMetaProperty(e,t,s){e.meta=t;let i=this.state.containsEsc;return e.property=this.parseIdentifier(!0),(e.property.name!==s||i)&&this.raise(u.UnsupportedMetaProperty,e.property,{target:t.name,onlyValidPropertyName:s}),this.finishNode(e,"MetaProperty")}parseImportMetaPropertyOrPhaseCall(e){if(this.next(),this.isContextual(105)||this.isContextual(97)){let t=this.isContextual(105);return this.expectPlugin(t?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),e.phase=t?"source":"defer",this.parseImportCall(e)}else{let t=this.createIdentifierAt(this.startNodeAtNode(e),"import",this.state.lastTokStartLoc);return this.isContextual(101)&&(this.inModule||this.raise(u.ImportMetaOutsideModule,t),this.sawUnambiguousESM=!0),this.parseMetaProperty(e,t,"meta")}}parseLiteralAtNode(e,t,s){return this.addExtra(s,"rawValue",e),this.addExtra(s,"raw",this.input.slice(this.offsetToSourcePos(s.start),this.state.end)),s.value=e,this.next(),this.finishNode(s,t)}parseLiteral(e,t){let s=this.startNode();return this.parseLiteralAtNode(e,t,s)}parseStringLiteral(e){return this.parseLiteral(e,"StringLiteral")}parseNumericLiteral(e){return this.parseLiteral(e,"NumericLiteral")}parseBigIntLiteral(e){return this.parseLiteral(e,"BigIntLiteral")}parseDecimalLiteral(e){return this.parseLiteral(e,"DecimalLiteral")}parseRegExpLiteral(e){let t=this.startNode();return this.addExtra(t,"raw",this.input.slice(this.offsetToSourcePos(t.start),this.state.end)),t.pattern=e.pattern,t.flags=e.flags,this.next(),this.finishNode(t,"RegExpLiteral")}parseBooleanLiteral(e){let t=this.startNode();return t.value=e,this.next(),this.finishNode(t,"BooleanLiteral")}parseNullLiteral(){let e=this.startNode();return this.next(),this.finishNode(e,"NullLiteral")}parseParenAndDistinguishExpression(e){let t=this.state.startLoc,s;this.next(),this.expressionScope.enter(ui());let i=this.state.maybeInArrowParameters,r=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let n=this.state.startLoc,o=[],h=new G,l=!0,c,d;for(;!this.match(11);){if(l)l=!1;else if(this.expect(12,h.optionalParametersLoc===null?null:h.optionalParametersLoc),this.match(11)){d=this.state.startLoc;break}if(this.match(21)){let P=this.state.startLoc;if(c=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),P)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowInOrVoidPattern(11,h,this.parseParenItem))}let f=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=i,this.state.inFSharpPipelineDirectBody=r;let m=this.startNodeAt(t);return e&&this.shouldParseArrow(o)&&(m=this.parseArrow(m))?(this.checkDestructuringPrivate(h),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(m,o,!1),m):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),d&&this.unexpected(d),c&&this.unexpected(c),this.checkExpressionErrors(h,!0),this.toReferencedListDeep(o,!0),o.length>1?(s=this.startNodeAt(n),s.expressions=o,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,f)):s=o[0],this.wrapParenthesis(t,s))}wrapParenthesis(e,t){if(!(this.optionFlags&1024))return this.addExtra(t,"parenthesized",!0),this.addExtra(t,"parenStart",e.index),this.takeSurroundingComments(t,e.index,this.state.lastTokEndLoc.index),t;let s=this.startNodeAt(e);return s.expression=t,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(e){return!this.canInsertSemicolon()}parseArrow(e){if(this.eat(19))return e}parseParenItem(e,t){return e}parseNewOrNewTarget(){let e=this.startNode();if(this.next(),this.match(16)){let t=this.createIdentifier(this.startNodeAtNode(e),"new");this.next();let s=this.parseMetaProperty(e,t,"target");return this.scope.allowNewTarget||this.raise(u.UnexpectedNewTarget,s),s}return this.parseNew(e)}parseNew(e){if(this.parseNewCallee(e),this.eat(10)){let t=this.parseExprList(11);this.toReferencedList(t),e.arguments=t}else e.arguments=[];return this.finishNode(e,"NewExpression")}parseNewCallee(e){let t=this.match(83),s=this.parseNoCallExpr();e.callee=s,t&&(s.type==="Import"||s.type==="ImportExpression")&&this.raise(u.ImportCallNotNewExpression,s)}parseTemplateElement(e){let{start:t,startLoc:s,end:i,value:r}=this.state,n=t+1,o=this.startNodeAt(L(s,1));r===null&&(e||this.raise(u.InvalidEscapeSequenceTemplate,L(this.state.firstInvalidTemplateEscapePos,1)));let h=this.match(24),l=h?-1:-2,c=i+l;o.value={raw:this.input.slice(n,c).replace(/\r\n?/g,`
8
- `),cooked:r===null?null:r.slice(1,l)},o.tail=h,this.next();let d=this.finishNode(o,"TemplateElement");return this.resetEndLocation(d,L(this.state.lastTokEndLoc,l)),d}parseTemplate(e){let t=this.startNode(),s=this.parseTemplateElement(e),i=[s],r=[];for(;!s.tail;)r.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),i.push(s=this.parseTemplateElement(e));return t.expressions=r,t.quasis=i,this.finishNode(t,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(e,t,s,i){s&&this.expectPlugin("recordAndTuple");let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=!1,o=!0,h=this.startNode();for(h.properties=[],this.next();!this.match(e);){if(o)o=!1;else if(this.expect(12),this.match(e)){this.addTrailingCommaExtraToNode(h);break}let c;t?c=this.parseBindingProperty():(c=this.parsePropertyDefinition(i),n=this.checkProto(c,s,n,i)),s&&!this.isObjectProperty(c)&&c.type!=="SpreadElement"&&this.raise(u.InvalidRecordProperty,c),c.shorthand&&this.addExtra(c,"shorthand",!0),h.properties.push(c)}this.next(),this.state.inFSharpPipelineDirectBody=r;let l="ObjectExpression";return t?l="ObjectPattern":s&&(l="RecordExpression"),this.finishNode(h,l)}addTrailingCommaExtraToNode(e){this.addExtra(e,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(e,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(e){return!e.computed&&e.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(e){let t=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(u.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)t.push(this.parseDecorator());let s=this.startNode(),i=!1,r=!1,n;if(this.match(21))return t.length&&this.unexpected(),this.parseSpread();t.length&&(s.decorators=t,t=[]),s.method=!1,e&&(n=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);let h=this.state.containsEsc;if(this.parsePropertyName(s,e),!o&&!h&&this.maybeAsyncOrAccessorProp(s)){let{key:l}=s,c=l.name;c==="async"&&!this.hasPrecedingLineBreak()&&(i=!0,this.resetPreviousNodeTrailingComments(l),o=this.eat(55),this.parsePropertyName(s)),(c==="get"||c==="set")&&(r=!0,this.resetPreviousNodeTrailingComments(l),s.kind=c,this.match(55)&&(o=!0,this.raise(u.AccessorIsGenerator,this.state.curPosition(),{kind:c}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,n,o,i,!1,r,e)}getGetterSetterExpectedParamCount(e){return e.kind==="get"?0:1}getObjectOrClassMethodParams(e){return e.params}checkGetterSetterParams(e){var t;let s=this.getGetterSetterExpectedParamCount(e),i=this.getObjectOrClassMethodParams(e);i.length!==s&&this.raise(e.kind==="get"?u.BadGetterArity:u.BadSetterArity,e),e.kind==="set"&&((t=i[i.length-1])==null?void 0:t.type)==="RestElement"&&this.raise(u.BadSetterRestParameter,e)}parseObjectMethod(e,t,s,i,r){if(r){let n=this.parseMethod(e,t,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(n),n}if(s||t||this.match(10))return i&&this.unexpected(),e.kind="method",e.method=!0,this.parseMethod(e,t,s,!1,!1,"ObjectMethod")}parseObjectProperty(e,t,s,i){if(e.shorthand=!1,this.eat(14))return e.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(8,i),this.finishObjectProperty(e);if(!e.computed&&e.key.type==="Identifier"){if(this.checkReservedWord(e.key.name,e.key.loc.start,!0,!1),s)e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key));else if(this.match(29)){let r=this.state.startLoc;i!=null?i.shorthandAssignLoc===null&&(i.shorthandAssignLoc=r):this.raise(u.InvalidCoverInitializedName,r),e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key))}else e.value=this.cloneIdentifier(e.key);return e.shorthand=!0,this.finishObjectProperty(e)}}finishObjectProperty(e){return this.finishNode(e,"ObjectProperty")}parseObjPropValue(e,t,s,i,r,n,o){let h=this.parseObjectMethod(e,s,i,r,n)||this.parseObjectProperty(e,t,r,o);return h||this.unexpected(),h}parsePropertyName(e,t){if(this.eat(0))e.computed=!0,e.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:s,value:i}=this.state,r;if(O(s))r=this.parseIdentifier(!0);else switch(s){case 135:r=this.parseNumericLiteral(i);break;case 134:r=this.parseStringLiteral(i);break;case 136:r=this.parseBigIntLiteral(i);break;case 139:{let n=this.state.startLoc;t!=null?t.privateKeyLoc===null&&(t.privateKeyLoc=n):this.raise(u.UnexpectedPrivateField,n),r=this.parsePrivateName();break}default:if(s===137){r=this.parseDecimalLiteral(i);break}this.unexpected()}e.key=r,s!==139&&(e.computed=!1)}}initFunction(e,t){e.id=null,e.generator=!1,e.async=t}parseMethod(e,t,s,i,r,n,o=!1){this.initFunction(e,s),e.generator=t,this.scope.enter(530|(o?576:0)|(r?32:0)),this.prodParam.enter(ft(s,e.generator)),this.parseFunctionParams(e,i);let h=this.parseFunctionBodyAndFinish(e,n,!0);return this.prodParam.exit(),this.scope.exit(),h}parseArrayLike(e,t,s){t&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let r=this.startNode();return this.next(),r.elements=this.parseExprList(e,!t,s,r),this.state.inFSharpPipelineDirectBody=i,this.finishNode(r,t?"TupleExpression":"ArrayExpression")}parseArrowExpression(e,t,s,i){this.scope.enter(518);let r=ft(s,!1);!this.match(5)&&this.prodParam.hasIn&&(r|=8),this.prodParam.enter(r),this.initFunction(e,s);let n=this.state.maybeInArrowParameters;return t&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(e,t,i)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(e,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=n,this.finishNode(e,"ArrowFunctionExpression")}setArrowFunctionParameters(e,t,s){this.toAssignableList(t,s,!1),e.params=t}parseFunctionBodyAndFinish(e,t,s=!1){return this.parseFunctionBody(e,!1,s),this.finishNode(e,t)}parseFunctionBody(e,t,s=!1){let i=t&&!this.match(5);if(this.expressionScope.enter(is()),i)e.body=this.parseMaybeAssign(),this.checkParams(e,!1,t,!1);else{let r=this.state.strict,n=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),e.body=this.parseBlock(!0,!1,o=>{let h=!this.isSimpleParamList(e.params);o&&h&&this.raise(u.IllegalLanguageModeDirective,(e.kind==="method"||e.kind==="constructor")&&e.key?e.key.loc.end:e);let l=!r&&this.state.strict;this.checkParams(e,!this.state.strict&&!t&&!s&&!h,t,l),this.state.strict&&e.id&&this.checkIdentifier(e.id,65,l)}),this.prodParam.exit(),this.state.labels=n}this.expressionScope.exit()}isSimpleParameter(e){return e.type==="Identifier"}isSimpleParamList(e){for(let t=0,s=e.length;t<s;t++)if(!this.isSimpleParameter(e[t]))return!1;return!0}checkParams(e,t,s,i=!0){let r=!t&&new Set,n={type:"FormalParameters"};for(let o of e.params)this.checkLVal(o,n,5,r,i)}parseExprList(e,t,s,i){let r=[],n=!0;for(;!this.eat(e);){if(n)n=!1;else if(this.expect(12),this.match(e)){i&&this.addTrailingCommaExtraToNode(i),this.next();break}r.push(this.parseExprListItem(e,t,s))}return r}parseExprListItem(e,t,s,i){let r;if(this.match(12))t||this.raise(u.UnexpectedToken,this.state.curPosition(),{unexpected:","}),r=null;else if(this.match(21)){let n=this.state.startLoc;r=this.parseParenItem(this.parseSpread(s),n)}else if(this.match(17)){this.expectPlugin("partialApplication"),i||this.raise(u.UnexpectedArgumentPlaceholder,this.state.startLoc);let n=this.startNode();this.next(),r=this.finishNode(n,"ArgumentPlaceholder")}else r=this.parseMaybeAssignAllowInOrVoidPattern(e,s,this.parseParenItem);return r}parseIdentifier(e){let t=this.startNode(),s=this.parseIdentifierName(e);return this.createIdentifier(t,s)}createIdentifier(e,t){return e.name=t,e.loc.identifierName=t,this.finishNode(e,"Identifier")}createIdentifierAt(e,t,s){return e.name=t,e.loc.identifierName=t,this.finishNodeAt(e,"Identifier",s)}parseIdentifierName(e){let t,{startLoc:s,type:i}=this.state;O(i)?t=this.state.value:this.unexpected();let r=ks(i);return e?r&&this.replaceToken(132):this.checkReservedWord(t,s,r,!1),this.next(),t}checkReservedWord(e,t,s,i){if(e.length>10||!Js(e))return;if(s&&Hs(e)){this.raise(u.UnexpectedKeyword,t,{keyword:e});return}if((this.state.strict?i?Ze:Ye:Ge)(e,this.inModule)){this.raise(u.UnexpectedReservedWord,t,{reservedWord:e});return}else if(e==="yield"){if(this.prodParam.hasYield){this.raise(u.YieldBindingIdentifier,t);return}}else if(e==="await"){if(this.prodParam.hasAwait){this.raise(u.AwaitBindingIdentifier,t);return}if(this.scope.inStaticBlock){this.raise(u.AwaitBindingIdentifierInStaticBlock,t);return}this.expressionScope.recordAsyncArrowParametersError(t)}else if(e==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(u.ArgumentsInClass,t);return}}recordAwaitIfAllowed(){let e=this.prodParam.hasAwait;return e&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),e}parseAwait(e){let t=this.startNodeAt(e);return this.expressionScope.recordParameterInitializerError(u.AwaitExpressionFormalParameter,t),this.eat(55)&&this.raise(u.ObsoleteAwaitStar,t),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(t.argument=this.parseMaybeUnary(null,!0)),this.finishNode(t,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:e}=this.state;return e===53||e===10||e===0||yt(e)||e===102&&!this.state.containsEsc||e===138||e===56||this.hasPlugin("v8intrinsic")&&e===54}parseYield(e){let t=this.startNodeAt(e);this.expressionScope.recordParameterInitializerError(u.YieldInParameter,t);let s=!1,i=null;if(!this.hasPrecedingLineBreak())switch(s=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!s)break;default:i=this.parseMaybeAssign()}return t.delegate=s,t.argument=i,this.finishNode(t,"YieldExpression")}parseImportCall(e){if(this.next(),e.source=this.parseMaybeAssignAllowIn(),e.options=null,this.eat(12)){if(this.match(11))this.addTrailingCommaExtraToNode(e.source);else if(e.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&(this.addTrailingCommaExtraToNode(e.options),!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(u.ImportCallArity,e)}}return this.expect(11),this.finishNode(e,"ImportExpression")}checkPipelineAtInfixOperator(e,t){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&e.type==="SequenceExpression"&&this.raise(u.PipelineHeadSequenceExpression,t)}parseSmartPipelineBodyInStyle(e,t){if(this.isSimpleReference(e)){let s=this.startNodeAt(t);return s.callee=e,this.finishNode(s,"PipelineBareFunction")}else{let s=this.startNodeAt(t);return this.checkSmartPipeTopicBodyEarlyErrors(t),s.expression=e,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(e){switch(e.type){case"MemberExpression":return!e.computed&&this.isSimpleReference(e.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(e){if(this.match(19))throw this.raise(u.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(u.PipelineTopicUnused,e)}withTopicBindingContext(e){let t=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=t}}withSmartMixTopicForbiddingContext(e){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let t=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=t}}else return e()}withSoloAwaitPermittingContext(e){let t=this.state.soloAwait;this.state.soloAwait=!0;try{return e()}finally{this.state.soloAwait=t}}allowInAnd(e){let t=this.prodParam.currentFlags();if(8&~t){this.prodParam.enter(t|8);try{return e()}finally{this.prodParam.exit()}}return e()}disallowInAnd(e){let t=this.prodParam.currentFlags();if(8&t){this.prodParam.enter(t&-9);try{return e()}finally{this.prodParam.exit()}}return e()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(e){let t=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let i=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,e);return this.state.inFSharpPipelineDirectBody=s,i}parseModuleExpression(){this.expectPlugin("moduleBlocks");let e=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let t=this.startNodeAt(this.state.endLoc);this.next();let s=this.initializeScopes(!0);this.enterInitialScopes();try{e.body=this.parseProgram(t,8,"module")}finally{s()}return this.finishNode(e,"ModuleExpression")}parseVoidPattern(e){this.expectPlugin("discardBinding");let t=this.startNode();return e!=null&&(e.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(t,"VoidPattern")}parseMaybeAssignAllowInOrVoidPattern(e,t,s){if(t!=null&&this.match(88)){let i=this.lookaheadCharCode();if(i===44||i===(e===3?93:e===8?125:41)||i===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(t))}return this.parseMaybeAssignAllowIn(t,s)}parsePropertyNamePrefixOperator(e){}},wt={kind:1},wi={kind:2},Ci=/[\uD800-\uDFFF]/u,Ct=/in(?:stanceof)?/y;function Ii(a,e,t){for(let s=0;s<a.length;s++){let i=a[s],{type:r}=i;if(typeof r=="number"){if(r===139){let{loc:n,start:o,value:h,end:l}=i,c=o+1,d=L(n.start,1);a.splice(s,1,new M({type:U(27),value:"#",start:o,end:c,startLoc:n.start,endLoc:d}),new M({type:U(132),value:h,start:c,end:l,startLoc:d,endLoc:n.end})),s++;continue}if(yt(r)){let{loc:n,start:o,value:h,end:l}=i,c=o+1,d=L(n.start,1),f;e.charCodeAt(o-t)===96?f=new M({type:U(22),value:"`",start:o,end:c,startLoc:n.start,endLoc:d}):f=new M({type:U(8),value:"}",start:o,end:c,startLoc:n.start,endLoc:d});let m,P,C,k;r===24?(P=l-1,C=L(n.end,-1),m=h===null?null:h.slice(1,-1),k=new M({type:U(22),value:"`",start:P,end:l,startLoc:C,endLoc:n.end})):(P=l-2,C=L(n.end,-2),m=h===null?null:h.slice(1,-2),k=new M({type:U(23),value:"${",start:P,end:l,startLoc:C,endLoc:n.end})),a.splice(s,1,f,new M({type:U(20),value:m,start:c,end:P,startLoc:d,endLoc:C}),k),s+=2;continue}i.type=U(r)}}return a}p(Ii,"babel7CompatTokens");var Kt=class extends Ht{static{p(this,"StatementParser")}parseTopLevel(e,t){return e.program=this.parseProgram(t,140,this.options.sourceType==="module"?"module":"script"),e.comments=this.comments,this.optionFlags&256&&(e.tokens=Ii(this.tokens,this.input,this.startIndex)),this.finishNode(e,"File")}parseProgram(e,t,s){if(e.sourceType=s,e.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(e,!0,!0,t),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[r,n]of Array.from(this.scope.undefinedExports))this.raise(u.ModuleExportUndefined,n,{localName:r});this.addExtra(e,"topLevelAwait",this.state.hasTopLevelAwait)}let i;return t===140?i=this.finishNode(e,"Program"):i=this.finishNodeAt(e,"Program",L(this.state.startLoc,-1)),i}stmtToDirective(e){let t=this.castNodeTo(e,"Directive"),s=this.castNodeTo(e.expression,"DirectiveLiteral"),i=s.value,r=this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end)),n=s.value=r.slice(1,-1);return this.addExtra(s,"raw",r),this.addExtra(s,"rawValue",n),this.addExtra(s,"expressionValue",i),t.value=s,delete e.expression,t}parseInterpreterDirective(){if(!this.match(28))return null;let e=this.startNode();return e.value=this.state.value,this.next(),this.finishNode(e,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(107)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(107))return!1;let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);if(this.isUnparsedContextual(e,"of")){let s=this.lookaheadCharCodeSince(e+2);if(s!==61&&s!==58&&s!==59)return!1}return!!(this.chStartsBindingIdentifier(t,e)||this.isUnparsedContextual(e,"void"))}nextTokenIsIdentifierOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifier(t,e)}isAwaitUsing(){if(!this.isContextual(96))return!1;let e=this.nextTokenInLineStart();if(this.isUnparsedContextual(e,"using")){e=this.nextTokenInLineStartSince(e+5);let t=this.codePointAtPos(e);if(this.chStartsBindingIdentifier(t,e))return!0}return!1}chStartsBindingIdentifier(e,t){if(B(e)){if(Ct.lastIndex=t,Ct.test(this.input)){let s=this.codePointAtPos(Ct.lastIndex);if(!W(s)&&s!==92)return!1}return!0}else return e===92}chStartsBindingPattern(e){return e===91||e===123}hasFollowingBindingAtom(){let e=this.nextTokenStart(),t=this.codePointAtPos(e);return this.chStartsBindingPattern(t)||this.chStartsBindingIdentifier(t,e)}hasInLineFollowingBindingIdentifierOrBrace(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===123||this.chStartsBindingIdentifier(t,e)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(e=!1){let t=0;return this.options.annexB&&!this.state.strict&&(t|=4,e&&(t|=8)),this.parseStatementLike(t)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(e){let t=null;return this.match(26)&&(t=this.parseDecorators(!0)),this.parseStatementContent(e,t)}parseStatementContent(e,t){let s=this.state.type,i=this.startNode(),r=!!(e&2),n=!!(e&4),o=e&1;switch(s){case 60:return this.parseBreakContinueStatement(i,!0);case 63:return this.parseBreakContinueStatement(i,!1);case 64:return this.parseDebuggerStatement(i);case 90:return this.parseDoWhileStatement(i);case 91:return this.parseForStatement(i);case 68:if(this.lookaheadCharCode()===46)break;return n||this.raise(this.state.strict?u.StrictFunction:this.options.annexB?u.SloppyFunctionAnnexB:u.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(i,!1,!r&&n);case 80:return r||this.unexpected(),this.parseClass(this.maybeTakeDecorators(t,i),!0);case 69:return this.parseIfStatement(i);case 70:return this.parseReturnStatement(i);case 71:return this.parseSwitchStatement(i);case 72:return this.parseThrowStatement(i);case 73:return this.parseTryStatement(i);case 96:if(this.isAwaitUsing())return this.allowsUsing()?r?this.recordAwaitIfAllowed()||this.raise(u.AwaitUsingNotInAsyncContext,i):this.raise(u.UnexpectedLexicalDeclaration,i):this.raise(u.UnexpectedUsingDeclaration,i),this.next(),this.parseVarStatement(i,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?r||this.raise(u.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(u.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(i,"using");case 100:{if(this.state.containsEsc)break;let c=this.nextTokenStart(),d=this.codePointAtPos(c);if(d!==91&&(!r&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(d,c)&&d!==123))break}case 75:r||this.raise(u.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let c=this.state.value;return this.parseVarStatement(i,c)}case 92:return this.parseWhileStatement(i);case 76:return this.parseWithStatement(i);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(i);case 83:{let c=this.lookaheadCharCode();if(c===40||c===46)break}case 82:{!(this.optionFlags&8)&&!o&&this.raise(u.UnexpectedImportExport,this.state.startLoc),this.next();let c;return s===83?c=this.parseImport(i):c=this.parseExport(i,t),this.assertModuleNodeAllowed(c),c}default:if(this.isAsyncFunction())return r||this.raise(u.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(i,!0,!r&&n)}let h=this.state.value,l=this.parseExpression();return E(s)&&l.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(i,h,l,e):this.parseExpressionStatement(i,l,t)}assertModuleNodeAllowed(e){!(this.optionFlags&8)&&!this.inModule&&this.raise(u.ImportOutsideModule,e)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(e,t,s){if(e){var i;(i=t.decorators)!=null&&i.length?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(u.DecoratorsBeforeAfterExport,t.decorators[0]),t.decorators.unshift(...e)):t.decorators=e,this.resetStartLocationFromNode(t,e[0]),s&&this.resetStartLocationFromNode(s,t)}return t}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(e){let t=[];do t.push(this.parseDecorator());while(this.match(26));if(this.match(82))e||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(u.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(u.UnexpectedLeadingDecorator,this.state.startLoc);return t}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let e=this.startNode();if(this.next(),this.hasPlugin("decorators")){let t=this.state.startLoc,s;if(this.match(10)){let i=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(i,s);let r=this.state.startLoc;e.expression=this.parseMaybeDecoratorArguments(s,i),this.getPluginOption("decorators","allowCallParenthesized")===!1&&e.expression!==s&&this.raise(u.DecoratorArgumentsOutsideParentheses,r)}else{for(s=this.parseIdentifier(!1);this.eat(16);){let i=this.startNodeAt(t);i.object=s,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),i.property=this.parsePrivateName()):i.property=this.parseIdentifier(!0),i.computed=!1,s=this.finishNode(i,"MemberExpression")}e.expression=this.parseMaybeDecoratorArguments(s,t)}}else e.expression=this.parseExprSubscripts();return this.finishNode(e,"Decorator")}parseMaybeDecoratorArguments(e,t){if(this.eat(10)){let s=this.startNodeAt(t);return s.callee=e,s.arguments=this.parseCallExpressionArguments(),this.toReferencedList(s.arguments),this.finishNode(s,"CallExpression")}return e}parseBreakContinueStatement(e,t){return this.next(),this.isLineTerminator()?e.label=null:(e.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(e,t),this.finishNode(e,t?"BreakStatement":"ContinueStatement")}verifyBreakContinue(e,t){let s;for(s=0;s<this.state.labels.length;++s){let i=this.state.labels[s];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(t||i.kind===1)||e.label&&t))break}if(s===this.state.labels.length){let i=t?"BreakStatement":"ContinueStatement";this.raise(u.IllegalBreakContinue,e,{type:i})}}parseDebuggerStatement(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let e=this.parseExpression();return this.expect(11),e}parseDoWhileStatement(e){return this.next(),this.state.labels.push(wt),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),e.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(e,"DoWhileStatement")}parseForStatement(e){this.next(),this.state.labels.push(wt);let t=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(t=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return t!==null&&this.unexpected(t),this.parseFor(e,null);let s=this.isContextual(100);{let h=this.isAwaitUsing(),l=h||this.isForUsing(),c=s&&this.hasFollowingBindingAtom()||l;if(this.match(74)||this.match(75)||c){let d=this.startNode(),f;h?(f="await using",this.recordAwaitIfAllowed()||this.raise(u.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):f=this.state.value,this.next(),this.parseVar(d,!0,f);let m=this.finishNode(d,"VariableDeclaration"),P=this.match(58);return P&&l&&this.raise(u.ForInUsing,m),(P||this.isContextual(102))&&m.declarations.length===1?this.parseForIn(e,m,t):(t!==null&&this.unexpected(t),this.parseFor(e,m))}}let i=this.isContextual(95),r=new G,n=this.parseExpression(!0,r),o=this.isContextual(102);if(o&&(s&&this.raise(u.ForOfLet,n),t===null&&i&&n.type==="Identifier"&&this.raise(u.ForOfAsync,n)),o||this.match(58)){this.checkDestructuringPrivate(r),this.toAssignable(n,!0);let h=o?"ForOfStatement":"ForInStatement";return this.checkLVal(n,{type:h}),this.parseForIn(e,n,t)}else this.checkExpressionErrors(r,!0);return t!==null&&this.unexpected(t),this.parseFor(e,n)}parseFunctionStatement(e,t,s){return this.next(),this.parseFunction(e,1|(s?2:0)|(t?8:0))}parseIfStatement(e){return this.next(),e.test=this.parseHeaderExpression(),e.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),e.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(e,"IfStatement")}parseReturnStatement(e){return this.prodParam.hasReturn||this.raise(u.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")}parseSwitchStatement(e){this.next(),e.discriminant=this.parseHeaderExpression();let t=e.cases=[];this.expect(5),this.state.labels.push(wi),this.scope.enter(256);let s;for(let i;!this.match(8);)if(this.match(61)||this.match(65)){let r=this.match(61);s&&this.finishNode(s,"SwitchCase"),t.push(s=this.startNode()),s.consequent=[],this.next(),r?s.test=this.parseExpression():(i&&this.raise(u.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),i=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(e,"SwitchStatement")}parseThrowStatement(e){return this.next(),this.hasPrecedingLineBreak()&&this.raise(u.NewlineAfterThrow,this.state.lastTokEndLoc),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")}parseCatchClauseParam(){let e=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&e.type==="Identifier"?8:0),this.checkLVal(e,{type:"CatchClause"},9),e}parseTryStatement(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(62)){let t=this.startNode();this.next(),this.match(10)?(this.expect(10),t.param=this.parseCatchClauseParam(),this.expect(11)):(t.param=null,this.scope.enter(0)),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(67)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(u.NoCatchOrFinally,e),this.finishNode(e,"TryStatement")}parseVarStatement(e,t,s=!1){return this.next(),this.parseVar(e,!1,t,s),this.semicolon(),this.finishNode(e,"VariableDeclaration")}parseWhileStatement(e){return this.next(),e.test=this.parseHeaderExpression(),this.state.labels.push(wt),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(e,"WhileStatement")}parseWithStatement(e){return this.state.strict&&this.raise(u.StrictWith,this.state.startLoc),this.next(),e.object=this.parseHeaderExpression(),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(e,"WithStatement")}parseEmptyStatement(e){return this.next(),this.finishNode(e,"EmptyStatement")}parseLabeledStatement(e,t,s,i){for(let n of this.state.labels)n.name===t&&this.raise(u.LabelRedeclaration,s,{labelName:t});let r=Ds(this.state.type)?1:this.match(71)?2:null;for(let n=this.state.labels.length-1;n>=0;n--){let o=this.state.labels[n];if(o.statementStart===e.start)o.statementStart=this.sourceToOffsetPos(this.state.start),o.kind=r;else break}return this.state.labels.push({name:t,kind:r,statementStart:this.sourceToOffsetPos(this.state.start)}),e.body=i&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")}parseExpressionStatement(e,t,s){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")}parseBlock(e=!1,t=!0,s){let i=this.startNode();return e&&this.state.strictErrors.clear(),this.expect(5),t&&this.scope.enter(0),this.parseBlockBody(i,e,!1,8,s),t&&this.scope.exit(),this.finishNode(i,"BlockStatement")}isValidDirective(e){return e.type==="ExpressionStatement"&&e.expression.type==="StringLiteral"&&!e.expression.extra.parenthesized}parseBlockBody(e,t,s,i,r){let n=e.body=[],o=e.directives=[];this.parseBlockOrModuleBlockBody(n,t?o:void 0,s,i,r)}parseBlockOrModuleBlockBody(e,t,s,i,r){let n=this.state.strict,o=!1,h=!1;for(;!this.match(i);){let l=s?this.parseModuleItem():this.parseStatementListItem();if(t&&!h){if(this.isValidDirective(l)){let c=this.stmtToDirective(l);t.push(c),!o&&c.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}h=!0,this.state.strictErrors.clear()}e.push(l)}r?.call(this,o),n||this.setStrict(!1),this.next()}parseFor(e,t){return e.init=t,this.semicolon(!1),e.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),e.update=this.match(11)?null:this.parseExpression(),this.expect(11),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,"ForStatement")}parseForIn(e,t,s){let i=this.match(58);return this.next(),i?s!==null&&this.unexpected(s):e.await=s!==null,t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||!this.options.annexB||this.state.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(u.ForInOfLoopInitializer,t,{type:i?"ForInStatement":"ForOfStatement"}),t.type==="AssignmentPattern"&&this.raise(u.InvalidLhs,t,{ancestor:{type:"ForStatement"}}),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")}parseVar(e,t,s,i=!1){let r=e.declarations=[];for(e.kind=s;;){let n=this.startNode();if(this.parseVarId(n,s),n.init=this.eat(29)?t?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,n.init===null&&!i&&(n.id.type!=="Identifier"&&!(t&&(this.match(58)||this.isContextual(102)))?this.raise(u.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(u.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),r.push(this.finishNode(n,"VariableDeclarator")),!this.eat(12))break}return e}parseVarId(e,t){let s=this.parseBindingAtom();t==="using"||t==="await using"?(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(u.UsingDeclarationHasBindingPattern,s.loc.start):s.type==="VoidPattern"&&this.raise(u.UnexpectedVoidPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},t==="var"?5:8201),e.id=s}parseAsyncFunctionExpression(e){return this.parseFunction(e,8)}parseFunction(e,t=0){let s=t&2,i=!!(t&1),r=i&&!(t&4),n=!!(t&8);this.initFunction(e,n),this.match(55)&&(s&&this.raise(u.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),e.generator=!0),i&&(e.id=this.parseFunctionId(r));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(514),this.prodParam.enter(ft(n,e.generator)),i||(e.id=this.parseFunctionId()),this.parseFunctionParams(e,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(e,i?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),i&&!s&&this.registerFunctionStatementId(e),this.state.maybeInArrowParameters=o,e}parseFunctionId(e){return e||E(this.state.type)?this.parseIdentifier():null}parseFunctionParams(e,t){this.expect(10),this.expressionScope.enter(ci()),e.params=this.parseBindingList(11,41,2|(t?4:0)),this.expressionScope.exit()}registerFunctionStatementId(e){e.id&&this.scope.declareName(e.id.name,!this.options.annexB||this.state.strict||e.generator||e.async?this.scope.treatFunctionsAsVar?5:8201:17,e.id.loc.start)}parseClass(e,t,s){this.next();let i=this.state.strict;return this.state.strict=!0,this.parseClassId(e,t,s),this.parseClassSuper(e),e.body=this.parseClassBody(!!e.superClass,i),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(e){return e.type==="Identifier"&&e.name==="constructor"||e.type==="StringLiteral"&&e.value==="constructor"}isNonstaticConstructor(e){return!e.computed&&!e.static&&this.nameIsConstructor(e.key)}parseClassBody(e,t){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:e},i=[],r=this.startNode();if(r.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(i.length>0)throw this.raise(u.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){i.push(this.parseDecorator());continue}let n=this.startNode();i.length&&(n.decorators=i,this.resetStartLocationFromNode(n,i[0]),i=[]),this.parseClassMember(r,n,s),n.kind==="constructor"&&n.decorators&&n.decorators.length>0&&this.raise(u.DecoratorConstructor,n)}}),this.state.strict=t,this.next(),i.length)throw this.raise(u.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(r,"ClassBody")}parseClassMemberFromModifier(e,t){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let i=t;return i.kind="method",i.computed=!1,i.key=s,i.static=!1,this.pushClassMethod(e,i,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let i=t;return i.computed=!1,i.key=s,i.static=!1,e.body.push(this.parseClassProperty(i)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(e,t,s){let i=this.isContextual(106);if(i){if(this.parseClassMemberFromModifier(e,t))return;if(this.eat(5)){this.parseClassStaticBlock(e,t);return}}this.parseClassMemberWithIsStatic(e,t,s,i)}parseClassMemberWithIsStatic(e,t,s,i){let r=t,n=t,o=t,h=t,l=t,c=r,d=r;if(t.static=i,this.parsePropertyNamePrefixOperator(t),this.eat(55)){c.kind="method";let b=this.match(139);if(this.parseClassElementName(c),this.parsePostMemberNameModifiers(c),b){this.pushClassPrivateMethod(e,n,!0,!1);return}this.isNonstaticConstructor(r)&&this.raise(u.ConstructorIsGenerator,r.key),this.pushClassMethod(e,r,!0,!1,!1,!1);return}let f=!this.state.containsEsc&&E(this.state.type),m=this.parseClassElementName(t),P=f?m.name:null,C=this.isPrivateName(m),k=this.state.startLoc;if(this.parsePostMemberNameModifiers(d),this.isClassMethod()){if(c.kind="method",C){this.pushClassPrivateMethod(e,n,!1,!1);return}let b=this.isNonstaticConstructor(r),N=!1;b&&(r.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(u.DuplicateConstructor,m),b&&this.hasPlugin("typescript")&&t.override&&this.raise(u.OverrideOnConstructor,m),s.hadConstructor=!0,N=s.hadSuperClass),this.pushClassMethod(e,r,!1,!1,b,N)}else if(this.isClassProperty())C?this.pushClassPrivateProperty(e,h):this.pushClassProperty(e,o);else if(P==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(m);let b=this.eat(55);d.optional&&this.unexpected(k),c.kind="method";let N=this.match(139);this.parseClassElementName(c),this.parsePostMemberNameModifiers(d),N?this.pushClassPrivateMethod(e,n,b,!0):(this.isNonstaticConstructor(r)&&this.raise(u.ConstructorIsAsync,r.key),this.pushClassMethod(e,r,b,!0,!1,!1))}else if((P==="get"||P==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(m),c.kind=P;let b=this.match(139);this.parseClassElementName(r),b?this.pushClassPrivateMethod(e,n,!1,!1):(this.isNonstaticConstructor(r)&&this.raise(u.ConstructorIsAccessor,r.key),this.pushClassMethod(e,r,!1,!1,!1,!1)),this.checkGetterSetterParams(r)}else if(P==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(m);let b=this.match(139);this.parseClassElementName(o),this.pushClassAccessorProperty(e,l,b)}else this.isLineTerminator()?C?this.pushClassPrivateProperty(e,h):this.pushClassProperty(e,o):this.unexpected()}parseClassElementName(e){let{type:t,value:s}=this.state;if((t===132||t===134)&&e.static&&s==="prototype"&&this.raise(u.StaticPrototype,this.state.startLoc),t===139){s==="constructor"&&this.raise(u.ConstructorClassPrivateField,this.state.startLoc);let i=this.parsePrivateName();return e.key=i,i}return this.parsePropertyName(e),e.key}parseClassStaticBlock(e,t){var s;this.scope.enter(720);let i=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let r=t.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=i,e.body.push(this.finishNode(t,"StaticBlock")),(s=t.decorators)!=null&&s.length&&this.raise(u.DecoratorStaticBlock,t)}pushClassProperty(e,t){!t.computed&&this.nameIsConstructor(t.key)&&this.raise(u.ConstructorClassField,t.key),e.body.push(this.parseClassProperty(t))}pushClassPrivateProperty(e,t){let s=this.parseClassPrivateProperty(t);e.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(e,t,s){!s&&!t.computed&&this.nameIsConstructor(t.key)&&this.raise(u.ConstructorClassField,t.key);let i=this.parseClassAccessorProperty(t);e.body.push(i),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),0,i.key.loc.start)}pushClassMethod(e,t,s,i,r,n){e.body.push(this.parseMethod(t,s,i,r,n,"ClassMethod",!0))}pushClassPrivateMethod(e,t,s,i){let r=this.parseMethod(t,s,i,!1,!1,"ClassPrivateMethod",!0);e.body.push(r);let n=r.kind==="get"?r.static?6:2:r.kind==="set"?r.static?5:1:0;this.declareClassPrivateMethodInScope(r,n)}declareClassPrivateMethodInScope(e,t){this.classScope.declarePrivateName(this.getPrivateNameSV(e.key),t,e.key.loc.start)}parsePostMemberNameModifiers(e){}parseClassPrivateProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassPrivateProperty")}parseClassProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassProperty")}parseClassAccessorProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassAccessorProperty")}parseInitializer(e){this.scope.enter(592),this.expressionScope.enter(is()),this.prodParam.enter(0),e.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(e,t,s,i=8331){if(E(this.state.type))e.id=this.parseIdentifier(),t&&this.declareNameFromIdentifier(e.id,i);else if(s||!t)e.id=null;else throw this.raise(u.MissingClassName,this.state.startLoc)}parseClassSuper(e){e.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(e,t){let s=this.parseMaybeImportPhase(e,!0),i=this.maybeParseExportDefaultSpecifier(e,s),r=!i||this.eat(12),n=r&&this.eatExportStar(e),o=n&&this.maybeParseExportNamespaceSpecifier(e),h=r&&(!o||this.eat(12)),l=i||n;if(n&&!o){if(i&&this.unexpected(),t)throw this.raise(u.UnsupportedDecoratorExport,e);return this.parseExportFrom(e,!0),this.sawUnambiguousESM=!0,this.finishNode(e,"ExportAllDeclaration")}let c=this.maybeParseExportNamedSpecifiers(e);i&&r&&!n&&!c&&this.unexpected(null,5),o&&h&&this.unexpected(null,98);let d;if(l||c){if(d=!1,t)throw this.raise(u.UnsupportedDecoratorExport,e);this.parseExportFrom(e,l)}else d=this.maybeParseExportDeclaration(e);if(l||c||d){var f;let m=e;if(this.checkExport(m,!0,!1,!!m.source),((f=m.declaration)==null?void 0:f.type)==="ClassDeclaration")this.maybeTakeDecorators(t,m.declaration,m);else if(t)throw this.raise(u.UnsupportedDecoratorExport,e);return this.sawUnambiguousESM=!0,this.finishNode(m,"ExportNamedDeclaration")}if(this.eat(65)){let m=e,P=this.parseExportDefaultExpression();if(m.declaration=P,P.type==="ClassDeclaration")this.maybeTakeDecorators(t,P,m);else if(t)throw this.raise(u.UnsupportedDecoratorExport,e);return this.checkExport(m,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(m,"ExportDefaultDeclaration")}throw this.unexpected(null,5)}eatExportStar(e){return this.eat(55)}maybeParseExportDefaultSpecifier(e,t){if(t||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",t?.loc.start);let s=t||this.parseIdentifier(!0),i=this.startNodeAtNode(s);return i.exported=s,e.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(e){if(this.isContextual(93)){var t,s;(s=(t=e).specifiers)!=null||(t.specifiers=[]);let i=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),i.exported=this.parseModuleExportName(),e.specifiers.push(this.finishNode(i,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(e){if(this.match(5)){let t=e;t.specifiers||(t.specifiers=[]);let s=t.exportKind==="type";return t.specifiers.push(...this.parseExportSpecifiers(s)),t.source=null,this.hasPlugin("importAssertions")?t.assertions=[]:t.attributes=[],t.declaration=null,!0}return!1}maybeParseExportDeclaration(e){return this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,this.hasPlugin("importAssertions")?e.assertions=[]:e.attributes=[],e.declaration=this.parseExportDeclaration(e),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let e=this.nextTokenInLineStart();return this.isUnparsedContextual(e,"function")}parseExportDefaultExpression(){let e=this.startNode();if(this.match(68))return this.next(),this.parseFunction(e,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(e,13);if(this.match(80))return this.parseClass(e,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(u.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(u.UnsupportedDefaultExport,this.state.startLoc);let t=this.parseMaybeAssignAllowIn();return this.semicolon(),t}parseExportDeclaration(e){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:e}=this.state;if(E(e)){if(e===95&&!this.state.containsEsc||e===100)return!1;if((e===130||e===129)&&!this.state.containsEsc){let i=this.nextTokenStart(),r=this.input.charCodeAt(i);if(r===123||this.chStartsBindingIdentifier(r,i)&&!this.input.startsWith("from",i))return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let t=this.nextTokenStart(),s=this.isUnparsedContextual(t,"from");if(this.input.charCodeAt(t)===44||E(this.state.type)&&s)return!0;if(this.match(65)&&s){let i=this.input.charCodeAt(this.nextTokenStartSince(t+4));return i===34||i===39}return!1}parseExportFrom(e,t){this.eatContextual(98)?(e.source=this.parseImportSource(),this.checkExport(e),this.maybeParseImportAttributes(e),this.checkJSONModuleImport(e)):t&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:e}=this.state;return e===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(u.DecoratorBeforeExport,this.state.startLoc),!0):this.isUsing()?(this.raise(u.UsingDeclarationExport,this.state.startLoc),!0):this.isAwaitUsing()?(this.raise(u.UsingDeclarationExport,this.state.startLoc),!0):e===74||e===75||e===68||e===80||this.isLet()||this.isAsyncFunction()}checkExport(e,t,s,i){if(t){var r;if(s){if(this.checkDuplicateExports(e,"default"),this.hasPlugin("exportDefaultFrom")){var n;let o=e.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((n=o.extra)!=null&&n.parenthesized)&&this.raise(u.ExportDefaultFromAsIdentifier,o)}}else if((r=e.specifiers)!=null&&r.length)for(let o of e.specifiers){let{exported:h}=o,l=h.type==="Identifier"?h.name:h.value;if(this.checkDuplicateExports(o,l),!i&&o.local){let{local:c}=o;c.type!=="Identifier"?this.raise(u.ExportBindingIsString,o,{localName:c.value,exportName:l}):(this.checkReservedWord(c.name,c.loc.start,!0,!1),this.scope.checkLocalExport(c))}}else if(e.declaration){let o=e.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){let{id:h}=o;if(!h)throw new Error("Assertion failure");this.checkDuplicateExports(e,h.name)}else if(o.type==="VariableDeclaration")for(let h of o.declarations)this.checkDeclaration(h.id)}}}checkDeclaration(e){if(e.type==="Identifier")this.checkDuplicateExports(e,e.name);else if(e.type==="ObjectPattern")for(let t of e.properties)this.checkDeclaration(t);else if(e.type==="ArrayPattern")for(let t of e.elements)t&&this.checkDeclaration(t);else e.type==="ObjectProperty"?this.checkDeclaration(e.value):e.type==="RestElement"?this.checkDeclaration(e.argument):e.type==="AssignmentPattern"&&this.checkDeclaration(e.left)}checkDuplicateExports(e,t){this.exportedIdentifiers.has(t)&&(t==="default"?this.raise(u.DuplicateDefaultExport,e):this.raise(u.DuplicateExport,e,{exportName:t})),this.exportedIdentifiers.add(t)}parseExportSpecifiers(e){let t=[],s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;let i=this.isContextual(130),r=this.match(134),n=this.startNode();n.local=this.parseModuleExportName(),t.push(this.parseExportSpecifier(n,r,e,i))}return t}parseExportSpecifier(e,t,s,i){return this.eatContextual(93)?e.exported=this.parseModuleExportName():t?e.exported=this.cloneStringLiteral(e.local):e.exported||(e.exported=this.cloneIdentifier(e.local)),this.finishNode(e,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let e=this.parseStringLiteral(this.state.value),t=Ci.exec(e.value);return t&&this.raise(u.ModuleExportNameHasLoneSurrogate,e,{surrogateCharCode:t[0].charCodeAt(0)}),e}return this.parseIdentifier(!0)}isJSONModuleImport(e){return e.assertions!=null?e.assertions.some(({key:t,value:s})=>s.value==="json"&&(t.type==="Identifier"?t.name==="type":t.value==="type")):!1}checkImportReflection(e){let{specifiers:t}=e,s=t.length===1?t[0].type:null;if(e.phase==="source")s!=="ImportDefaultSpecifier"&&this.raise(u.SourcePhaseImportRequiresDefault,t[0].loc.start);else if(e.phase==="defer")s!=="ImportNamespaceSpecifier"&&this.raise(u.DeferImportRequiresNamespace,t[0].loc.start);else if(e.module){var i;s!=="ImportDefaultSpecifier"&&this.raise(u.ImportReflectionNotBinding,t[0].loc.start),((i=e.assertions)==null?void 0:i.length)>0&&this.raise(u.ImportReflectionHasAssertion,t[0].loc.start)}}checkJSONModuleImport(e){if(this.isJSONModuleImport(e)&&e.type!=="ExportAllDeclaration"){let{specifiers:t}=e;if(t!=null){let s=t.find(i=>{let r;if(i.type==="ExportSpecifier"?r=i.local:i.type==="ImportSpecifier"&&(r=i.imported),r!==void 0)return r.type==="Identifier"?r.name!=="default":r.value!=="default"});s!==void 0&&this.raise(u.ImportJSONBindingNotDefault,s.loc.start)}}}isPotentialImportPhase(e){return e?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(e,t,s,i){t||(s==="module"?(this.expectPlugin("importReflection",i),e.module=!0):this.hasPlugin("importReflection")&&(e.module=!1),s==="source"?(this.expectPlugin("sourcePhaseImports",i),e.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",i),e.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(e.phase=null))}parseMaybeImportPhase(e,t){if(!this.isPotentialImportPhase(t))return this.applyImportPhase(e,t,null),null;let s=this.startNode(),i=this.parseIdentifierName(!0),{type:r}=this.state;return(O(r)?r!==98||this.lookaheadCharCode()===102:r!==12)?(this.applyImportPhase(e,t,i,s.loc.start),null):(this.applyImportPhase(e,t,null),this.createIdentifier(s,i))}isPrecedingIdImportPhase(e){let{type:t}=this.state;return E(t)?t!==98||this.lookaheadCharCode()===102:t!==12}parseImport(e){return this.match(134)?this.parseImportSourceAndAttributes(e):this.parseImportSpecifiersAndAfter(e,this.parseMaybeImportPhase(e,!1))}parseImportSpecifiersAndAfter(e,t){e.specifiers=[];let i=!this.maybeParseDefaultImportSpecifier(e,t)||this.eat(12),r=i&&this.maybeParseStarImportSpecifier(e);return i&&!r&&this.parseNamedImportSpecifiers(e),this.expectContextual(98),this.parseImportSourceAndAttributes(e)}parseImportSourceAndAttributes(e){var t;return(t=e.specifiers)!=null||(e.specifiers=[]),e.source=this.parseImportSource(),this.maybeParseImportAttributes(e),this.checkImportReflection(e),this.checkJSONModuleImport(e),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(e,t,s){t.local=this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,s))}finishImportSpecifier(e,t,s=8201){return this.checkLVal(e.local,{type:t},s),this.finishNode(e,t)}parseImportAttributes(){this.expect(5);let e=[],t=new Set;do{if(this.match(8))break;let s=this.startNode(),i=this.state.value;if(t.has(i)&&this.raise(u.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:i}),t.add(i),this.match(134)?s.key=this.parseStringLiteral(i):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(u.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),e}parseModuleAttributes(){let e=[],t=new Set;do{let s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(u.ModuleAttributeDifferentFromType,s.key),t.has(s.key.name)&&this.raise(u.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),t.add(s.key.name),this.expect(14),!this.match(134))throw this.raise(u.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return e}maybeParseImportAttributes(e){let t;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?(t=this.parseModuleAttributes(),this.addExtra(e,"deprecatedWithLegacySyntax",!0)):t=this.parseImportAttributes(),s=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(u.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(e,"deprecatedAssertSyntax",!0),this.next(),t=this.parseImportAttributes()):t=[];!s&&this.hasPlugin("importAssertions")?e.assertions=t:e.attributes=t}maybeParseDefaultImportSpecifier(e,t){if(t){let s=this.startNodeAtNode(t);return s.local=t,e.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(O(this.state.type))return this.parseImportSpecifierLocal(e,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(e){if(this.match(55)){let t=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(e,t,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(e){let t=!0;for(this.expect(5);!this.eat(8);){if(t)t=!1;else{if(this.eat(14))throw this.raise(u.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let s=this.startNode(),i=this.match(134),r=this.isContextual(130);s.imported=this.parseModuleExportName();let n=this.parseImportSpecifier(s,i,e.importKind==="type"||e.importKind==="typeof",r,void 0);e.specifiers.push(n)}}parseImportSpecifier(e,t,s,i,r){if(this.eatContextual(93))e.local=this.parseIdentifier();else{let{imported:n}=e;if(t)throw this.raise(u.ImportBindingIsString,e,{importName:n.value});this.checkReservedWord(n.name,e.loc.start,!0,!0),e.local||(e.local=this.cloneIdentifier(n))}return this.finishImportSpecifier(e,"ImportSpecifier",r)}isThisParam(e){return e.type==="Identifier"&&e.name==="this"}},Pt=class extends Kt{static{p(this,"Parser")}constructor(e,t,s){let i=ws(e);super(i,t),this.options=i,this.initializeScopes(),this.plugins=s,this.filename=i.sourceFilename,this.startIndex=i.startIndex;let r=0;i.allowAwaitOutsideFunction&&(r|=1),i.allowReturnOutsideFunction&&(r|=2),i.allowImportExportEverywhere&&(r|=8),i.allowSuperOutsideMethod&&(r|=16),i.allowUndeclaredExports&&(r|=64),i.allowNewTargetOutsideFunction&&(r|=4),i.allowYieldOutsideFunction&&(r|=32),i.ranges&&(r|=128),i.tokens&&(r|=256),i.createImportExpressions&&(r|=512),i.createParenthesizedExpressions&&(r|=1024),i.errorRecovery&&(r|=2048),i.attachComment&&(r|=4096),i.annexB&&(r|=8192),this.optionFlags=r}getScopeHandler(){return ot}parse(){this.enterInitialScopes();let e=this.startNode(),t=this.startNode();this.nextToken(),e.errors=null;let s=this.parseTopLevel(e,t);return s.errors=this.state.errors,s.comments.length=this.state.commentsLen,s}};function Ei(a,e){var t;if(((t=e)==null?void 0:t.sourceType)==="unambiguous"){e=Object.assign({},e);try{e.sourceType="module";let s=rt(e,a),i=s.parse();if(s.sawUnambiguousESM)return i;if(s.ambiguousScriptDifferentAst)try{return e.sourceType="script",rt(e,a).parse()}catch{}else i.program.sourceType="script";return i}catch(s){try{return e.sourceType="script",rt(e,a).parse()}catch{}throw s}}else return rt(e,a).parse()}p(Ei,"parse");function Ni(a,e){let t=rt(e,a);return t.options.strictMode&&(t.state.strict=!0),t.getExpression()}p(Ni,"parseExpression");function ki(a){let e={};for(let t of Object.keys(a))e[t]=U(a[t]);return e}p(ki,"generateExportedTokenTypes");var vi=ki(Ns);function rt(a,e){let t=Pt,s=new Map;if(a!=null&&a.plugins){for(let i of a.plugins){let r,n;typeof i=="string"?r=i:[r,n]=i,s.has(r)||s.set(r,n||{})}Ai(s),t=Li(s)}return new t(a,e,s)}p(rt,"getParser");var Ke=new Map;function Li(a){let e=[];for(let i of Si)a.has(i)&&e.push(i);let t=e.join("|"),s=Ke.get(t);if(!s){s=Pt;for(let i of e)s=ns[i](s);Ke.set(t,s)}return s}p(Li,"getParserClass");lt.parse=Ei;lt.parseExpression=Ni;lt.tokTypes=vi});export{p as a,Oi as b,Di as c};
8
+ `),cooked:r===null?null:r.slice(1,l)},o.tail=h,this.next();let d=this.finishNode(o,"TemplateElement");return this.resetEndLocation(d,L(this.state.lastTokEndLoc,l)),d}parseTemplate(e){let t=this.startNode(),s=this.parseTemplateElement(e),i=[s],r=[];for(;!s.tail;)r.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),i.push(s=this.parseTemplateElement(e));return t.expressions=r,t.quasis=i,this.finishNode(t,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(e,t,s,i){s&&this.expectPlugin("recordAndTuple");let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=!1,o=!0,h=this.startNode();for(h.properties=[],this.next();!this.match(e);){if(o)o=!1;else if(this.expect(12),this.match(e)){this.addTrailingCommaExtraToNode(h);break}let c;t?c=this.parseBindingProperty():(c=this.parsePropertyDefinition(i),n=this.checkProto(c,s,n,i)),s&&!this.isObjectProperty(c)&&c.type!=="SpreadElement"&&this.raise(u.InvalidRecordProperty,c),c.shorthand&&this.addExtra(c,"shorthand",!0),h.properties.push(c)}this.next(),this.state.inFSharpPipelineDirectBody=r;let l="ObjectExpression";return t?l="ObjectPattern":s&&(l="RecordExpression"),this.finishNode(h,l)}addTrailingCommaExtraToNode(e){this.addExtra(e,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(e,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(e){return!e.computed&&e.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(e){let t=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(u.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)t.push(this.parseDecorator());let s=this.startNode(),i=!1,r=!1,n;if(this.match(21))return t.length&&this.unexpected(),this.parseSpread();t.length&&(s.decorators=t,t=[]),s.method=!1,e&&(n=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);let h=this.state.containsEsc;if(this.parsePropertyName(s,e),!o&&!h&&this.maybeAsyncOrAccessorProp(s)){let{key:l}=s,c=l.name;c==="async"&&!this.hasPrecedingLineBreak()&&(i=!0,this.resetPreviousNodeTrailingComments(l),o=this.eat(55),this.parsePropertyName(s)),(c==="get"||c==="set")&&(r=!0,this.resetPreviousNodeTrailingComments(l),s.kind=c,this.match(55)&&(o=!0,this.raise(u.AccessorIsGenerator,this.state.curPosition(),{kind:c}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,n,o,i,!1,r,e)}getGetterSetterExpectedParamCount(e){return e.kind==="get"?0:1}getObjectOrClassMethodParams(e){return e.params}checkGetterSetterParams(e){var t;let s=this.getGetterSetterExpectedParamCount(e),i=this.getObjectOrClassMethodParams(e);i.length!==s&&this.raise(e.kind==="get"?u.BadGetterArity:u.BadSetterArity,e),e.kind==="set"&&((t=i[i.length-1])==null?void 0:t.type)==="RestElement"&&this.raise(u.BadSetterRestParameter,e)}parseObjectMethod(e,t,s,i,r){if(r){let n=this.parseMethod(e,t,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(n),n}if(s||t||this.match(10))return i&&this.unexpected(),e.kind="method",e.method=!0,this.parseMethod(e,t,s,!1,!1,"ObjectMethod")}parseObjectProperty(e,t,s,i){if(e.shorthand=!1,this.eat(14))return e.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(8,i),this.finishObjectProperty(e);if(!e.computed&&e.key.type==="Identifier"){if(this.checkReservedWord(e.key.name,e.key.loc.start,!0,!1),s)e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key));else if(this.match(29)){let r=this.state.startLoc;i!=null?i.shorthandAssignLoc===null&&(i.shorthandAssignLoc=r):this.raise(u.InvalidCoverInitializedName,r),e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key))}else e.value=this.cloneIdentifier(e.key);return e.shorthand=!0,this.finishObjectProperty(e)}}finishObjectProperty(e){return this.finishNode(e,"ObjectProperty")}parseObjPropValue(e,t,s,i,r,n,o){let h=this.parseObjectMethod(e,s,i,r,n)||this.parseObjectProperty(e,t,r,o);return h||this.unexpected(),h}parsePropertyName(e,t){if(this.eat(0))e.computed=!0,e.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:s,value:i}=this.state,r;if(O(s))r=this.parseIdentifier(!0);else switch(s){case 135:r=this.parseNumericLiteral(i);break;case 134:r=this.parseStringLiteral(i);break;case 136:r=this.parseBigIntLiteral(i);break;case 139:{let n=this.state.startLoc;t!=null?t.privateKeyLoc===null&&(t.privateKeyLoc=n):this.raise(u.UnexpectedPrivateField,n),r=this.parsePrivateName();break}default:if(s===137){r=this.parseDecimalLiteral(i);break}this.unexpected()}e.key=r,s!==139&&(e.computed=!1)}}initFunction(e,t){e.id=null,e.generator=!1,e.async=t}parseMethod(e,t,s,i,r,n,o=!1){this.initFunction(e,s),e.generator=t,this.scope.enter(530|(o?576:0)|(r?32:0)),this.prodParam.enter(ft(s,e.generator)),this.parseFunctionParams(e,i);let h=this.parseFunctionBodyAndFinish(e,n,!0);return this.prodParam.exit(),this.scope.exit(),h}parseArrayLike(e,t,s){t&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let r=this.startNode();return this.next(),r.elements=this.parseExprList(e,!t,s,r),this.state.inFSharpPipelineDirectBody=i,this.finishNode(r,t?"TupleExpression":"ArrayExpression")}parseArrowExpression(e,t,s,i){this.scope.enter(518);let r=ft(s,!1);!this.match(5)&&this.prodParam.hasIn&&(r|=8),this.prodParam.enter(r),this.initFunction(e,s);let n=this.state.maybeInArrowParameters;return t&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(e,t,i)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(e,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=n,this.finishNode(e,"ArrowFunctionExpression")}setArrowFunctionParameters(e,t,s){this.toAssignableList(t,s,!1),e.params=t}parseFunctionBodyAndFinish(e,t,s=!1){return this.parseFunctionBody(e,!1,s),this.finishNode(e,t)}parseFunctionBody(e,t,s=!1){let i=t&&!this.match(5);if(this.expressionScope.enter(is()),i)e.body=this.parseMaybeAssign(),this.checkParams(e,!1,t,!1);else{let r=this.state.strict,n=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),e.body=this.parseBlock(!0,!1,o=>{let h=!this.isSimpleParamList(e.params);o&&h&&this.raise(u.IllegalLanguageModeDirective,(e.kind==="method"||e.kind==="constructor")&&e.key?e.key.loc.end:e);let l=!r&&this.state.strict;this.checkParams(e,!this.state.strict&&!t&&!s&&!h,t,l),this.state.strict&&e.id&&this.checkIdentifier(e.id,65,l)}),this.prodParam.exit(),this.state.labels=n}this.expressionScope.exit()}isSimpleParameter(e){return e.type==="Identifier"}isSimpleParamList(e){for(let t=0,s=e.length;t<s;t++)if(!this.isSimpleParameter(e[t]))return!1;return!0}checkParams(e,t,s,i=!0){let r=!t&&new Set,n={type:"FormalParameters"};for(let o of e.params)this.checkLVal(o,n,5,r,i)}parseExprList(e,t,s,i){let r=[],n=!0;for(;!this.eat(e);){if(n)n=!1;else if(this.expect(12),this.match(e)){i&&this.addTrailingCommaExtraToNode(i),this.next();break}r.push(this.parseExprListItem(e,t,s))}return r}parseExprListItem(e,t,s,i){let r;if(this.match(12))t||this.raise(u.UnexpectedToken,this.state.curPosition(),{unexpected:","}),r=null;else if(this.match(21)){let n=this.state.startLoc;r=this.parseParenItem(this.parseSpread(s),n)}else if(this.match(17)){this.expectPlugin("partialApplication"),i||this.raise(u.UnexpectedArgumentPlaceholder,this.state.startLoc);let n=this.startNode();this.next(),r=this.finishNode(n,"ArgumentPlaceholder")}else r=this.parseMaybeAssignAllowInOrVoidPattern(e,s,this.parseParenItem);return r}parseIdentifier(e){let t=this.startNode(),s=this.parseIdentifierName(e);return this.createIdentifier(t,s)}createIdentifier(e,t){return e.name=t,e.loc.identifierName=t,this.finishNode(e,"Identifier")}createIdentifierAt(e,t,s){return e.name=t,e.loc.identifierName=t,this.finishNodeAt(e,"Identifier",s)}parseIdentifierName(e){let t,{startLoc:s,type:i}=this.state;O(i)?t=this.state.value:this.unexpected();let r=ks(i);return e?r&&this.replaceToken(132):this.checkReservedWord(t,s,r,!1),this.next(),t}checkReservedWord(e,t,s,i){if(e.length>10||!Js(e))return;if(s&&Hs(e)){this.raise(u.UnexpectedKeyword,t,{keyword:e});return}if((this.state.strict?i?Ze:Ye:Ge)(e,this.inModule)){this.raise(u.UnexpectedReservedWord,t,{reservedWord:e});return}else if(e==="yield"){if(this.prodParam.hasYield){this.raise(u.YieldBindingIdentifier,t);return}}else if(e==="await"){if(this.prodParam.hasAwait){this.raise(u.AwaitBindingIdentifier,t);return}if(this.scope.inStaticBlock){this.raise(u.AwaitBindingIdentifierInStaticBlock,t);return}this.expressionScope.recordAsyncArrowParametersError(t)}else if(e==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(u.ArgumentsInClass,t);return}}recordAwaitIfAllowed(){let e=this.prodParam.hasAwait;return e&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),e}parseAwait(e){let t=this.startNodeAt(e);return this.expressionScope.recordParameterInitializerError(u.AwaitExpressionFormalParameter,t),this.eat(55)&&this.raise(u.ObsoleteAwaitStar,t),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(t.argument=this.parseMaybeUnary(null,!0)),this.finishNode(t,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:e}=this.state;return e===53||e===10||e===0||yt(e)||e===102&&!this.state.containsEsc||e===138||e===56||this.hasPlugin("v8intrinsic")&&e===54}parseYield(e){let t=this.startNodeAt(e);this.expressionScope.recordParameterInitializerError(u.YieldInParameter,t);let s=!1,i=null;if(!this.hasPrecedingLineBreak())switch(s=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!s)break;default:i=this.parseMaybeAssign()}return t.delegate=s,t.argument=i,this.finishNode(t,"YieldExpression")}parseImportCall(e){if(this.next(),e.source=this.parseMaybeAssignAllowIn(),e.options=null,this.eat(12)){if(this.match(11))this.addTrailingCommaExtraToNode(e.source);else if(e.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&(this.addTrailingCommaExtraToNode(e.options),!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(u.ImportCallArity,e)}}return this.expect(11),this.finishNode(e,"ImportExpression")}checkPipelineAtInfixOperator(e,t){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&e.type==="SequenceExpression"&&this.raise(u.PipelineHeadSequenceExpression,t)}parseSmartPipelineBodyInStyle(e,t){if(this.isSimpleReference(e)){let s=this.startNodeAt(t);return s.callee=e,this.finishNode(s,"PipelineBareFunction")}else{let s=this.startNodeAt(t);return this.checkSmartPipeTopicBodyEarlyErrors(t),s.expression=e,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(e){switch(e.type){case"MemberExpression":return!e.computed&&this.isSimpleReference(e.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(e){if(this.match(19))throw this.raise(u.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(u.PipelineTopicUnused,e)}withTopicBindingContext(e){let t=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=t}}withSmartMixTopicForbiddingContext(e){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let t=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=t}}else return e()}withSoloAwaitPermittingContext(e){let t=this.state.soloAwait;this.state.soloAwait=!0;try{return e()}finally{this.state.soloAwait=t}}allowInAnd(e){let t=this.prodParam.currentFlags();if(8&~t){this.prodParam.enter(t|8);try{return e()}finally{this.prodParam.exit()}}return e()}disallowInAnd(e){let t=this.prodParam.currentFlags();if(8&t){this.prodParam.enter(t&-9);try{return e()}finally{this.prodParam.exit()}}return e()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(e){let t=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let i=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,e);return this.state.inFSharpPipelineDirectBody=s,i}parseModuleExpression(){this.expectPlugin("moduleBlocks");let e=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let t=this.startNodeAt(this.state.endLoc);this.next();let s=this.initializeScopes(!0);this.enterInitialScopes();try{e.body=this.parseProgram(t,8,"module")}finally{s()}return this.finishNode(e,"ModuleExpression")}parseVoidPattern(e){this.expectPlugin("discardBinding");let t=this.startNode();return e!=null&&(e.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(t,"VoidPattern")}parseMaybeAssignAllowInOrVoidPattern(e,t,s){if(t!=null&&this.match(88)){let i=this.lookaheadCharCode();if(i===44||i===(e===3?93:e===8?125:41)||i===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(t))}return this.parseMaybeAssignAllowIn(t,s)}parsePropertyNamePrefixOperator(e){}},wt={kind:1},wi={kind:2},Ci=/[\uD800-\uDFFF]/u,Ct=/in(?:stanceof)?/y;function Ii(a,e,t){for(let s=0;s<a.length;s++){let i=a[s],{type:r}=i;if(typeof r=="number"){if(r===139){let{loc:n,start:o,value:h,end:l}=i,c=o+1,d=L(n.start,1);a.splice(s,1,new M({type:U(27),value:"#",start:o,end:c,startLoc:n.start,endLoc:d}),new M({type:U(132),value:h,start:c,end:l,startLoc:d,endLoc:n.end})),s++;continue}if(yt(r)){let{loc:n,start:o,value:h,end:l}=i,c=o+1,d=L(n.start,1),f;e.charCodeAt(o-t)===96?f=new M({type:U(22),value:"`",start:o,end:c,startLoc:n.start,endLoc:d}):f=new M({type:U(8),value:"}",start:o,end:c,startLoc:n.start,endLoc:d});let m,P,C,k;r===24?(P=l-1,C=L(n.end,-1),m=h===null?null:h.slice(1,-1),k=new M({type:U(22),value:"`",start:P,end:l,startLoc:C,endLoc:n.end})):(P=l-2,C=L(n.end,-2),m=h===null?null:h.slice(1,-2),k=new M({type:U(23),value:"${",start:P,end:l,startLoc:C,endLoc:n.end})),a.splice(s,1,f,new M({type:U(20),value:m,start:c,end:P,startLoc:d,endLoc:C}),k),s+=2;continue}i.type=U(r)}}return a}p(Ii,"babel7CompatTokens");var Kt=class extends Ht{static{p(this,"StatementParser")}parseTopLevel(e,t){return e.program=this.parseProgram(t,140,this.options.sourceType==="module"?"module":"script"),e.comments=this.comments,this.optionFlags&256&&(e.tokens=Ii(this.tokens,this.input,this.startIndex)),this.finishNode(e,"File")}parseProgram(e,t,s){if(e.sourceType=s,e.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(e,!0,!0,t),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[r,n]of Array.from(this.scope.undefinedExports))this.raise(u.ModuleExportUndefined,n,{localName:r});this.addExtra(e,"topLevelAwait",this.state.hasTopLevelAwait)}let i;return t===140?i=this.finishNode(e,"Program"):i=this.finishNodeAt(e,"Program",L(this.state.startLoc,-1)),i}stmtToDirective(e){let t=this.castNodeTo(e,"Directive"),s=this.castNodeTo(e.expression,"DirectiveLiteral"),i=s.value,r=this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end)),n=s.value=r.slice(1,-1);return this.addExtra(s,"raw",r),this.addExtra(s,"rawValue",n),this.addExtra(s,"expressionValue",i),t.value=s,delete e.expression,t}parseInterpreterDirective(){if(!this.match(28))return null;let e=this.startNode();return e.value=this.state.value,this.next(),this.finishNode(e,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(107)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(107))return!1;let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);if(this.isUnparsedContextual(e,"of")){let s=this.lookaheadCharCodeSince(e+2);if(s!==61&&s!==58&&s!==59)return!1}return!!(this.chStartsBindingIdentifier(t,e)||this.isUnparsedContextual(e,"void"))}nextTokenIsIdentifierOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifier(t,e)}isAwaitUsing(){if(!this.isContextual(96))return!1;let e=this.nextTokenInLineStart();if(this.isUnparsedContextual(e,"using")){e=this.nextTokenInLineStartSince(e+5);let t=this.codePointAtPos(e);if(this.chStartsBindingIdentifier(t,e))return!0}return!1}chStartsBindingIdentifier(e,t){if(B(e)){if(Ct.lastIndex=t,Ct.test(this.input)){let s=this.codePointAtPos(Ct.lastIndex);if(!W(s)&&s!==92)return!1}return!0}else return e===92}chStartsBindingPattern(e){return e===91||e===123}hasFollowingBindingAtom(){let e=this.nextTokenStart(),t=this.codePointAtPos(e);return this.chStartsBindingPattern(t)||this.chStartsBindingIdentifier(t,e)}hasInLineFollowingBindingIdentifierOrBrace(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===123||this.chStartsBindingIdentifier(t,e)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(e=!1){let t=0;return this.options.annexB&&!this.state.strict&&(t|=4,e&&(t|=8)),this.parseStatementLike(t)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(e){let t=null;return this.match(26)&&(t=this.parseDecorators(!0)),this.parseStatementContent(e,t)}parseStatementContent(e,t){let s=this.state.type,i=this.startNode(),r=!!(e&2),n=!!(e&4),o=e&1;switch(s){case 60:return this.parseBreakContinueStatement(i,!0);case 63:return this.parseBreakContinueStatement(i,!1);case 64:return this.parseDebuggerStatement(i);case 90:return this.parseDoWhileStatement(i);case 91:return this.parseForStatement(i);case 68:if(this.lookaheadCharCode()===46)break;return n||this.raise(this.state.strict?u.StrictFunction:this.options.annexB?u.SloppyFunctionAnnexB:u.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(i,!1,!r&&n);case 80:return r||this.unexpected(),this.parseClass(this.maybeTakeDecorators(t,i),!0);case 69:return this.parseIfStatement(i);case 70:return this.parseReturnStatement(i);case 71:return this.parseSwitchStatement(i);case 72:return this.parseThrowStatement(i);case 73:return this.parseTryStatement(i);case 96:if(this.isAwaitUsing())return this.allowsUsing()?r?this.recordAwaitIfAllowed()||this.raise(u.AwaitUsingNotInAsyncContext,i):this.raise(u.UnexpectedLexicalDeclaration,i):this.raise(u.UnexpectedUsingDeclaration,i),this.next(),this.parseVarStatement(i,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?r||this.raise(u.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(u.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(i,"using");case 100:{if(this.state.containsEsc)break;let c=this.nextTokenStart(),d=this.codePointAtPos(c);if(d!==91&&(!r&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(d,c)&&d!==123))break}case 75:r||this.raise(u.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let c=this.state.value;return this.parseVarStatement(i,c)}case 92:return this.parseWhileStatement(i);case 76:return this.parseWithStatement(i);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(i);case 83:{let c=this.lookaheadCharCode();if(c===40||c===46)break}case 82:{!(this.optionFlags&8)&&!o&&this.raise(u.UnexpectedImportExport,this.state.startLoc),this.next();let c;return s===83?c=this.parseImport(i):c=this.parseExport(i,t),this.assertModuleNodeAllowed(c),c}default:if(this.isAsyncFunction())return r||this.raise(u.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(i,!0,!r&&n)}let h=this.state.value,l=this.parseExpression();return E(s)&&l.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(i,h,l,e):this.parseExpressionStatement(i,l,t)}assertModuleNodeAllowed(e){!(this.optionFlags&8)&&!this.inModule&&this.raise(u.ImportOutsideModule,e)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(e,t,s){if(e){var i;(i=t.decorators)!=null&&i.length?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(u.DecoratorsBeforeAfterExport,t.decorators[0]),t.decorators.unshift(...e)):t.decorators=e,this.resetStartLocationFromNode(t,e[0]),s&&this.resetStartLocationFromNode(s,t)}return t}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(e){let t=[];do t.push(this.parseDecorator());while(this.match(26));if(this.match(82))e||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(u.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(u.UnexpectedLeadingDecorator,this.state.startLoc);return t}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let e=this.startNode();if(this.next(),this.hasPlugin("decorators")){let t=this.state.startLoc,s;if(this.match(10)){let i=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(i,s);let r=this.state.startLoc;e.expression=this.parseMaybeDecoratorArguments(s,i),this.getPluginOption("decorators","allowCallParenthesized")===!1&&e.expression!==s&&this.raise(u.DecoratorArgumentsOutsideParentheses,r)}else{for(s=this.parseIdentifier(!1);this.eat(16);){let i=this.startNodeAt(t);i.object=s,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),i.property=this.parsePrivateName()):i.property=this.parseIdentifier(!0),i.computed=!1,s=this.finishNode(i,"MemberExpression")}e.expression=this.parseMaybeDecoratorArguments(s,t)}}else e.expression=this.parseExprSubscripts();return this.finishNode(e,"Decorator")}parseMaybeDecoratorArguments(e,t){if(this.eat(10)){let s=this.startNodeAt(t);return s.callee=e,s.arguments=this.parseCallExpressionArguments(),this.toReferencedList(s.arguments),this.finishNode(s,"CallExpression")}return e}parseBreakContinueStatement(e,t){return this.next(),this.isLineTerminator()?e.label=null:(e.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(e,t),this.finishNode(e,t?"BreakStatement":"ContinueStatement")}verifyBreakContinue(e,t){let s;for(s=0;s<this.state.labels.length;++s){let i=this.state.labels[s];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(t||i.kind===1)||e.label&&t))break}if(s===this.state.labels.length){let i=t?"BreakStatement":"ContinueStatement";this.raise(u.IllegalBreakContinue,e,{type:i})}}parseDebuggerStatement(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let e=this.parseExpression();return this.expect(11),e}parseDoWhileStatement(e){return this.next(),this.state.labels.push(wt),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),e.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(e,"DoWhileStatement")}parseForStatement(e){this.next(),this.state.labels.push(wt);let t=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(t=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return t!==null&&this.unexpected(t),this.parseFor(e,null);let s=this.isContextual(100);{let h=this.isAwaitUsing(),l=h||this.isForUsing(),c=s&&this.hasFollowingBindingAtom()||l;if(this.match(74)||this.match(75)||c){let d=this.startNode(),f;h?(f="await using",this.recordAwaitIfAllowed()||this.raise(u.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):f=this.state.value,this.next(),this.parseVar(d,!0,f);let m=this.finishNode(d,"VariableDeclaration"),P=this.match(58);return P&&l&&this.raise(u.ForInUsing,m),(P||this.isContextual(102))&&m.declarations.length===1?this.parseForIn(e,m,t):(t!==null&&this.unexpected(t),this.parseFor(e,m))}}let i=this.isContextual(95),r=new G,n=this.parseExpression(!0,r),o=this.isContextual(102);if(o&&(s&&this.raise(u.ForOfLet,n),t===null&&i&&n.type==="Identifier"&&this.raise(u.ForOfAsync,n)),o||this.match(58)){this.checkDestructuringPrivate(r),this.toAssignable(n,!0);let h=o?"ForOfStatement":"ForInStatement";return this.checkLVal(n,{type:h}),this.parseForIn(e,n,t)}else this.checkExpressionErrors(r,!0);return t!==null&&this.unexpected(t),this.parseFor(e,n)}parseFunctionStatement(e,t,s){return this.next(),this.parseFunction(e,1|(s?2:0)|(t?8:0))}parseIfStatement(e){return this.next(),e.test=this.parseHeaderExpression(),e.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),e.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(e,"IfStatement")}parseReturnStatement(e){return this.prodParam.hasReturn||this.raise(u.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")}parseSwitchStatement(e){this.next(),e.discriminant=this.parseHeaderExpression();let t=e.cases=[];this.expect(5),this.state.labels.push(wi),this.scope.enter(256);let s;for(let i;!this.match(8);)if(this.match(61)||this.match(65)){let r=this.match(61);s&&this.finishNode(s,"SwitchCase"),t.push(s=this.startNode()),s.consequent=[],this.next(),r?s.test=this.parseExpression():(i&&this.raise(u.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),i=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(e,"SwitchStatement")}parseThrowStatement(e){return this.next(),this.hasPrecedingLineBreak()&&this.raise(u.NewlineAfterThrow,this.state.lastTokEndLoc),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")}parseCatchClauseParam(){let e=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&e.type==="Identifier"?8:0),this.checkLVal(e,{type:"CatchClause"},9),e}parseTryStatement(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(62)){let t=this.startNode();this.next(),this.match(10)?(this.expect(10),t.param=this.parseCatchClauseParam(),this.expect(11)):(t.param=null,this.scope.enter(0)),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(67)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(u.NoCatchOrFinally,e),this.finishNode(e,"TryStatement")}parseVarStatement(e,t,s=!1){return this.next(),this.parseVar(e,!1,t,s),this.semicolon(),this.finishNode(e,"VariableDeclaration")}parseWhileStatement(e){return this.next(),e.test=this.parseHeaderExpression(),this.state.labels.push(wt),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(e,"WhileStatement")}parseWithStatement(e){return this.state.strict&&this.raise(u.StrictWith,this.state.startLoc),this.next(),e.object=this.parseHeaderExpression(),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(e,"WithStatement")}parseEmptyStatement(e){return this.next(),this.finishNode(e,"EmptyStatement")}parseLabeledStatement(e,t,s,i){for(let n of this.state.labels)n.name===t&&this.raise(u.LabelRedeclaration,s,{labelName:t});let r=Ds(this.state.type)?1:this.match(71)?2:null;for(let n=this.state.labels.length-1;n>=0;n--){let o=this.state.labels[n];if(o.statementStart===e.start)o.statementStart=this.sourceToOffsetPos(this.state.start),o.kind=r;else break}return this.state.labels.push({name:t,kind:r,statementStart:this.sourceToOffsetPos(this.state.start)}),e.body=i&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")}parseExpressionStatement(e,t,s){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")}parseBlock(e=!1,t=!0,s){let i=this.startNode();return e&&this.state.strictErrors.clear(),this.expect(5),t&&this.scope.enter(0),this.parseBlockBody(i,e,!1,8,s),t&&this.scope.exit(),this.finishNode(i,"BlockStatement")}isValidDirective(e){return e.type==="ExpressionStatement"&&e.expression.type==="StringLiteral"&&!e.expression.extra.parenthesized}parseBlockBody(e,t,s,i,r){let n=e.body=[],o=e.directives=[];this.parseBlockOrModuleBlockBody(n,t?o:void 0,s,i,r)}parseBlockOrModuleBlockBody(e,t,s,i,r){let n=this.state.strict,o=!1,h=!1;for(;!this.match(i);){let l=s?this.parseModuleItem():this.parseStatementListItem();if(t&&!h){if(this.isValidDirective(l)){let c=this.stmtToDirective(l);t.push(c),!o&&c.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}h=!0,this.state.strictErrors.clear()}e.push(l)}r?.call(this,o),n||this.setStrict(!1),this.next()}parseFor(e,t){return e.init=t,this.semicolon(!1),e.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),e.update=this.match(11)?null:this.parseExpression(),this.expect(11),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,"ForStatement")}parseForIn(e,t,s){let i=this.match(58);return this.next(),i?s!==null&&this.unexpected(s):e.await=s!==null,t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||!this.options.annexB||this.state.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(u.ForInOfLoopInitializer,t,{type:i?"ForInStatement":"ForOfStatement"}),t.type==="AssignmentPattern"&&this.raise(u.InvalidLhs,t,{ancestor:{type:"ForStatement"}}),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")}parseVar(e,t,s,i=!1){let r=e.declarations=[];for(e.kind=s;;){let n=this.startNode();if(this.parseVarId(n,s),n.init=this.eat(29)?t?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,n.init===null&&!i&&(n.id.type!=="Identifier"&&!(t&&(this.match(58)||this.isContextual(102)))?this.raise(u.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(u.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),r.push(this.finishNode(n,"VariableDeclarator")),!this.eat(12))break}return e}parseVarId(e,t){let s=this.parseBindingAtom();t==="using"||t==="await using"?(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(u.UsingDeclarationHasBindingPattern,s.loc.start):s.type==="VoidPattern"&&this.raise(u.UnexpectedVoidPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},t==="var"?5:8201),e.id=s}parseAsyncFunctionExpression(e){return this.parseFunction(e,8)}parseFunction(e,t=0){let s=t&2,i=!!(t&1),r=i&&!(t&4),n=!!(t&8);this.initFunction(e,n),this.match(55)&&(s&&this.raise(u.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),e.generator=!0),i&&(e.id=this.parseFunctionId(r));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(514),this.prodParam.enter(ft(n,e.generator)),i||(e.id=this.parseFunctionId()),this.parseFunctionParams(e,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(e,i?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),i&&!s&&this.registerFunctionStatementId(e),this.state.maybeInArrowParameters=o,e}parseFunctionId(e){return e||E(this.state.type)?this.parseIdentifier():null}parseFunctionParams(e,t){this.expect(10),this.expressionScope.enter(ci()),e.params=this.parseBindingList(11,41,2|(t?4:0)),this.expressionScope.exit()}registerFunctionStatementId(e){e.id&&this.scope.declareName(e.id.name,!this.options.annexB||this.state.strict||e.generator||e.async?this.scope.treatFunctionsAsVar?5:8201:17,e.id.loc.start)}parseClass(e,t,s){this.next();let i=this.state.strict;return this.state.strict=!0,this.parseClassId(e,t,s),this.parseClassSuper(e),e.body=this.parseClassBody(!!e.superClass,i),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(e){return e.type==="Identifier"&&e.name==="constructor"||e.type==="StringLiteral"&&e.value==="constructor"}isNonstaticConstructor(e){return!e.computed&&!e.static&&this.nameIsConstructor(e.key)}parseClassBody(e,t){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:e},i=[],r=this.startNode();if(r.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(i.length>0)throw this.raise(u.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){i.push(this.parseDecorator());continue}let n=this.startNode();i.length&&(n.decorators=i,this.resetStartLocationFromNode(n,i[0]),i=[]),this.parseClassMember(r,n,s),n.kind==="constructor"&&n.decorators&&n.decorators.length>0&&this.raise(u.DecoratorConstructor,n)}}),this.state.strict=t,this.next(),i.length)throw this.raise(u.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(r,"ClassBody")}parseClassMemberFromModifier(e,t){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let i=t;return i.kind="method",i.computed=!1,i.key=s,i.static=!1,this.pushClassMethod(e,i,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let i=t;return i.computed=!1,i.key=s,i.static=!1,e.body.push(this.parseClassProperty(i)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(e,t,s){let i=this.isContextual(106);if(i){if(this.parseClassMemberFromModifier(e,t))return;if(this.eat(5)){this.parseClassStaticBlock(e,t);return}}this.parseClassMemberWithIsStatic(e,t,s,i)}parseClassMemberWithIsStatic(e,t,s,i){let r=t,n=t,o=t,h=t,l=t,c=r,d=r;if(t.static=i,this.parsePropertyNamePrefixOperator(t),this.eat(55)){c.kind="method";let b=this.match(139);if(this.parseClassElementName(c),this.parsePostMemberNameModifiers(c),b){this.pushClassPrivateMethod(e,n,!0,!1);return}this.isNonstaticConstructor(r)&&this.raise(u.ConstructorIsGenerator,r.key),this.pushClassMethod(e,r,!0,!1,!1,!1);return}let f=!this.state.containsEsc&&E(this.state.type),m=this.parseClassElementName(t),P=f?m.name:null,C=this.isPrivateName(m),k=this.state.startLoc;if(this.parsePostMemberNameModifiers(d),this.isClassMethod()){if(c.kind="method",C){this.pushClassPrivateMethod(e,n,!1,!1);return}let b=this.isNonstaticConstructor(r),N=!1;b&&(r.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(u.DuplicateConstructor,m),b&&this.hasPlugin("typescript")&&t.override&&this.raise(u.OverrideOnConstructor,m),s.hadConstructor=!0,N=s.hadSuperClass),this.pushClassMethod(e,r,!1,!1,b,N)}else if(this.isClassProperty())C?this.pushClassPrivateProperty(e,h):this.pushClassProperty(e,o);else if(P==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(m);let b=this.eat(55);d.optional&&this.unexpected(k),c.kind="method";let N=this.match(139);this.parseClassElementName(c),this.parsePostMemberNameModifiers(d),N?this.pushClassPrivateMethod(e,n,b,!0):(this.isNonstaticConstructor(r)&&this.raise(u.ConstructorIsAsync,r.key),this.pushClassMethod(e,r,b,!0,!1,!1))}else if((P==="get"||P==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(m),c.kind=P;let b=this.match(139);this.parseClassElementName(r),b?this.pushClassPrivateMethod(e,n,!1,!1):(this.isNonstaticConstructor(r)&&this.raise(u.ConstructorIsAccessor,r.key),this.pushClassMethod(e,r,!1,!1,!1,!1)),this.checkGetterSetterParams(r)}else if(P==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(m);let b=this.match(139);this.parseClassElementName(o),this.pushClassAccessorProperty(e,l,b)}else this.isLineTerminator()?C?this.pushClassPrivateProperty(e,h):this.pushClassProperty(e,o):this.unexpected()}parseClassElementName(e){let{type:t,value:s}=this.state;if((t===132||t===134)&&e.static&&s==="prototype"&&this.raise(u.StaticPrototype,this.state.startLoc),t===139){s==="constructor"&&this.raise(u.ConstructorClassPrivateField,this.state.startLoc);let i=this.parsePrivateName();return e.key=i,i}return this.parsePropertyName(e),e.key}parseClassStaticBlock(e,t){var s;this.scope.enter(720);let i=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let r=t.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=i,e.body.push(this.finishNode(t,"StaticBlock")),(s=t.decorators)!=null&&s.length&&this.raise(u.DecoratorStaticBlock,t)}pushClassProperty(e,t){!t.computed&&this.nameIsConstructor(t.key)&&this.raise(u.ConstructorClassField,t.key),e.body.push(this.parseClassProperty(t))}pushClassPrivateProperty(e,t){let s=this.parseClassPrivateProperty(t);e.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(e,t,s){!s&&!t.computed&&this.nameIsConstructor(t.key)&&this.raise(u.ConstructorClassField,t.key);let i=this.parseClassAccessorProperty(t);e.body.push(i),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),0,i.key.loc.start)}pushClassMethod(e,t,s,i,r,n){e.body.push(this.parseMethod(t,s,i,r,n,"ClassMethod",!0))}pushClassPrivateMethod(e,t,s,i){let r=this.parseMethod(t,s,i,!1,!1,"ClassPrivateMethod",!0);e.body.push(r);let n=r.kind==="get"?r.static?6:2:r.kind==="set"?r.static?5:1:0;this.declareClassPrivateMethodInScope(r,n)}declareClassPrivateMethodInScope(e,t){this.classScope.declarePrivateName(this.getPrivateNameSV(e.key),t,e.key.loc.start)}parsePostMemberNameModifiers(e){}parseClassPrivateProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassPrivateProperty")}parseClassProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassProperty")}parseClassAccessorProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassAccessorProperty")}parseInitializer(e){this.scope.enter(592),this.expressionScope.enter(is()),this.prodParam.enter(0),e.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(e,t,s,i=8331){if(E(this.state.type))e.id=this.parseIdentifier(),t&&this.declareNameFromIdentifier(e.id,i);else if(s||!t)e.id=null;else throw this.raise(u.MissingClassName,this.state.startLoc)}parseClassSuper(e){e.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(e,t){let s=this.parseMaybeImportPhase(e,!0),i=this.maybeParseExportDefaultSpecifier(e,s),r=!i||this.eat(12),n=r&&this.eatExportStar(e),o=n&&this.maybeParseExportNamespaceSpecifier(e),h=r&&(!o||this.eat(12)),l=i||n;if(n&&!o){if(i&&this.unexpected(),t)throw this.raise(u.UnsupportedDecoratorExport,e);return this.parseExportFrom(e,!0),this.sawUnambiguousESM=!0,this.finishNode(e,"ExportAllDeclaration")}let c=this.maybeParseExportNamedSpecifiers(e);i&&r&&!n&&!c&&this.unexpected(null,5),o&&h&&this.unexpected(null,98);let d;if(l||c){if(d=!1,t)throw this.raise(u.UnsupportedDecoratorExport,e);this.parseExportFrom(e,l)}else d=this.maybeParseExportDeclaration(e);if(l||c||d){var f;let m=e;if(this.checkExport(m,!0,!1,!!m.source),((f=m.declaration)==null?void 0:f.type)==="ClassDeclaration")this.maybeTakeDecorators(t,m.declaration,m);else if(t)throw this.raise(u.UnsupportedDecoratorExport,e);return this.sawUnambiguousESM=!0,this.finishNode(m,"ExportNamedDeclaration")}if(this.eat(65)){let m=e,P=this.parseExportDefaultExpression();if(m.declaration=P,P.type==="ClassDeclaration")this.maybeTakeDecorators(t,P,m);else if(t)throw this.raise(u.UnsupportedDecoratorExport,e);return this.checkExport(m,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(m,"ExportDefaultDeclaration")}throw this.unexpected(null,5)}eatExportStar(e){return this.eat(55)}maybeParseExportDefaultSpecifier(e,t){if(t||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",t?.loc.start);let s=t||this.parseIdentifier(!0),i=this.startNodeAtNode(s);return i.exported=s,e.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(e){if(this.isContextual(93)){var t,s;(s=(t=e).specifiers)!=null||(t.specifiers=[]);let i=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),i.exported=this.parseModuleExportName(),e.specifiers.push(this.finishNode(i,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(e){if(this.match(5)){let t=e;t.specifiers||(t.specifiers=[]);let s=t.exportKind==="type";return t.specifiers.push(...this.parseExportSpecifiers(s)),t.source=null,this.hasPlugin("importAssertions")?t.assertions=[]:t.attributes=[],t.declaration=null,!0}return!1}maybeParseExportDeclaration(e){return this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,this.hasPlugin("importAssertions")?e.assertions=[]:e.attributes=[],e.declaration=this.parseExportDeclaration(e),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let e=this.nextTokenInLineStart();return this.isUnparsedContextual(e,"function")}parseExportDefaultExpression(){let e=this.startNode();if(this.match(68))return this.next(),this.parseFunction(e,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(e,13);if(this.match(80))return this.parseClass(e,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(u.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(u.UnsupportedDefaultExport,this.state.startLoc);let t=this.parseMaybeAssignAllowIn();return this.semicolon(),t}parseExportDeclaration(e){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:e}=this.state;if(E(e)){if(e===95&&!this.state.containsEsc||e===100)return!1;if((e===130||e===129)&&!this.state.containsEsc){let i=this.nextTokenStart(),r=this.input.charCodeAt(i);if(r===123||this.chStartsBindingIdentifier(r,i)&&!this.input.startsWith("from",i))return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let t=this.nextTokenStart(),s=this.isUnparsedContextual(t,"from");if(this.input.charCodeAt(t)===44||E(this.state.type)&&s)return!0;if(this.match(65)&&s){let i=this.input.charCodeAt(this.nextTokenStartSince(t+4));return i===34||i===39}return!1}parseExportFrom(e,t){this.eatContextual(98)?(e.source=this.parseImportSource(),this.checkExport(e),this.maybeParseImportAttributes(e),this.checkJSONModuleImport(e)):t&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:e}=this.state;return e===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(u.DecoratorBeforeExport,this.state.startLoc),!0):this.isUsing()?(this.raise(u.UsingDeclarationExport,this.state.startLoc),!0):this.isAwaitUsing()?(this.raise(u.UsingDeclarationExport,this.state.startLoc),!0):e===74||e===75||e===68||e===80||this.isLet()||this.isAsyncFunction()}checkExport(e,t,s,i){if(t){var r;if(s){if(this.checkDuplicateExports(e,"default"),this.hasPlugin("exportDefaultFrom")){var n;let o=e.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((n=o.extra)!=null&&n.parenthesized)&&this.raise(u.ExportDefaultFromAsIdentifier,o)}}else if((r=e.specifiers)!=null&&r.length)for(let o of e.specifiers){let{exported:h}=o,l=h.type==="Identifier"?h.name:h.value;if(this.checkDuplicateExports(o,l),!i&&o.local){let{local:c}=o;c.type!=="Identifier"?this.raise(u.ExportBindingIsString,o,{localName:c.value,exportName:l}):(this.checkReservedWord(c.name,c.loc.start,!0,!1),this.scope.checkLocalExport(c))}}else if(e.declaration){let o=e.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){let{id:h}=o;if(!h)throw new Error("Assertion failure");this.checkDuplicateExports(e,h.name)}else if(o.type==="VariableDeclaration")for(let h of o.declarations)this.checkDeclaration(h.id)}}}checkDeclaration(e){if(e.type==="Identifier")this.checkDuplicateExports(e,e.name);else if(e.type==="ObjectPattern")for(let t of e.properties)this.checkDeclaration(t);else if(e.type==="ArrayPattern")for(let t of e.elements)t&&this.checkDeclaration(t);else e.type==="ObjectProperty"?this.checkDeclaration(e.value):e.type==="RestElement"?this.checkDeclaration(e.argument):e.type==="AssignmentPattern"&&this.checkDeclaration(e.left)}checkDuplicateExports(e,t){this.exportedIdentifiers.has(t)&&(t==="default"?this.raise(u.DuplicateDefaultExport,e):this.raise(u.DuplicateExport,e,{exportName:t})),this.exportedIdentifiers.add(t)}parseExportSpecifiers(e){let t=[],s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;let i=this.isContextual(130),r=this.match(134),n=this.startNode();n.local=this.parseModuleExportName(),t.push(this.parseExportSpecifier(n,r,e,i))}return t}parseExportSpecifier(e,t,s,i){return this.eatContextual(93)?e.exported=this.parseModuleExportName():t?e.exported=this.cloneStringLiteral(e.local):e.exported||(e.exported=this.cloneIdentifier(e.local)),this.finishNode(e,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let e=this.parseStringLiteral(this.state.value),t=Ci.exec(e.value);return t&&this.raise(u.ModuleExportNameHasLoneSurrogate,e,{surrogateCharCode:t[0].charCodeAt(0)}),e}return this.parseIdentifier(!0)}isJSONModuleImport(e){return e.assertions!=null?e.assertions.some(({key:t,value:s})=>s.value==="json"&&(t.type==="Identifier"?t.name==="type":t.value==="type")):!1}checkImportReflection(e){let{specifiers:t}=e,s=t.length===1?t[0].type:null;if(e.phase==="source")s!=="ImportDefaultSpecifier"&&this.raise(u.SourcePhaseImportRequiresDefault,t[0].loc.start);else if(e.phase==="defer")s!=="ImportNamespaceSpecifier"&&this.raise(u.DeferImportRequiresNamespace,t[0].loc.start);else if(e.module){var i;s!=="ImportDefaultSpecifier"&&this.raise(u.ImportReflectionNotBinding,t[0].loc.start),((i=e.assertions)==null?void 0:i.length)>0&&this.raise(u.ImportReflectionHasAssertion,t[0].loc.start)}}checkJSONModuleImport(e){if(this.isJSONModuleImport(e)&&e.type!=="ExportAllDeclaration"){let{specifiers:t}=e;if(t!=null){let s=t.find(i=>{let r;if(i.type==="ExportSpecifier"?r=i.local:i.type==="ImportSpecifier"&&(r=i.imported),r!==void 0)return r.type==="Identifier"?r.name!=="default":r.value!=="default"});s!==void 0&&this.raise(u.ImportJSONBindingNotDefault,s.loc.start)}}}isPotentialImportPhase(e){return e?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(e,t,s,i){t||(s==="module"?(this.expectPlugin("importReflection",i),e.module=!0):this.hasPlugin("importReflection")&&(e.module=!1),s==="source"?(this.expectPlugin("sourcePhaseImports",i),e.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",i),e.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(e.phase=null))}parseMaybeImportPhase(e,t){if(!this.isPotentialImportPhase(t))return this.applyImportPhase(e,t,null),null;let s=this.startNode(),i=this.parseIdentifierName(!0),{type:r}=this.state;return(O(r)?r!==98||this.lookaheadCharCode()===102:r!==12)?(this.applyImportPhase(e,t,i,s.loc.start),null):(this.applyImportPhase(e,t,null),this.createIdentifier(s,i))}isPrecedingIdImportPhase(e){let{type:t}=this.state;return E(t)?t!==98||this.lookaheadCharCode()===102:t!==12}parseImport(e){return this.match(134)?this.parseImportSourceAndAttributes(e):this.parseImportSpecifiersAndAfter(e,this.parseMaybeImportPhase(e,!1))}parseImportSpecifiersAndAfter(e,t){e.specifiers=[];let i=!this.maybeParseDefaultImportSpecifier(e,t)||this.eat(12),r=i&&this.maybeParseStarImportSpecifier(e);return i&&!r&&this.parseNamedImportSpecifiers(e),this.expectContextual(98),this.parseImportSourceAndAttributes(e)}parseImportSourceAndAttributes(e){var t;return(t=e.specifiers)!=null||(e.specifiers=[]),e.source=this.parseImportSource(),this.maybeParseImportAttributes(e),this.checkImportReflection(e),this.checkJSONModuleImport(e),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(e,t,s){t.local=this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,s))}finishImportSpecifier(e,t,s=8201){return this.checkLVal(e.local,{type:t},s),this.finishNode(e,t)}parseImportAttributes(){this.expect(5);let e=[],t=new Set;do{if(this.match(8))break;let s=this.startNode(),i=this.state.value;if(t.has(i)&&this.raise(u.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:i}),t.add(i),this.match(134)?s.key=this.parseStringLiteral(i):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(u.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),e}parseModuleAttributes(){let e=[],t=new Set;do{let s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(u.ModuleAttributeDifferentFromType,s.key),t.has(s.key.name)&&this.raise(u.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),t.add(s.key.name),this.expect(14),!this.match(134))throw this.raise(u.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return e}maybeParseImportAttributes(e){let t;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?(t=this.parseModuleAttributes(),this.addExtra(e,"deprecatedWithLegacySyntax",!0)):t=this.parseImportAttributes(),s=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(u.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(e,"deprecatedAssertSyntax",!0),this.next(),t=this.parseImportAttributes()):t=[];!s&&this.hasPlugin("importAssertions")?e.assertions=t:e.attributes=t}maybeParseDefaultImportSpecifier(e,t){if(t){let s=this.startNodeAtNode(t);return s.local=t,e.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(O(this.state.type))return this.parseImportSpecifierLocal(e,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(e){if(this.match(55)){let t=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(e,t,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(e){let t=!0;for(this.expect(5);!this.eat(8);){if(t)t=!1;else{if(this.eat(14))throw this.raise(u.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let s=this.startNode(),i=this.match(134),r=this.isContextual(130);s.imported=this.parseModuleExportName();let n=this.parseImportSpecifier(s,i,e.importKind==="type"||e.importKind==="typeof",r,void 0);e.specifiers.push(n)}}parseImportSpecifier(e,t,s,i,r){if(this.eatContextual(93))e.local=this.parseIdentifier();else{let{imported:n}=e;if(t)throw this.raise(u.ImportBindingIsString,e,{importName:n.value});this.checkReservedWord(n.name,e.loc.start,!0,!0),e.local||(e.local=this.cloneIdentifier(n))}return this.finishImportSpecifier(e,"ImportSpecifier",r)}isThisParam(e){return e.type==="Identifier"&&e.name==="this"}},Pt=class extends Kt{static{p(this,"Parser")}constructor(e,t,s){let i=ws(e);super(i,t),this.options=i,this.initializeScopes(),this.plugins=s,this.filename=i.sourceFilename,this.startIndex=i.startIndex;let r=0;i.allowAwaitOutsideFunction&&(r|=1),i.allowReturnOutsideFunction&&(r|=2),i.allowImportExportEverywhere&&(r|=8),i.allowSuperOutsideMethod&&(r|=16),i.allowUndeclaredExports&&(r|=64),i.allowNewTargetOutsideFunction&&(r|=4),i.allowYieldOutsideFunction&&(r|=32),i.ranges&&(r|=128),i.tokens&&(r|=256),i.createImportExpressions&&(r|=512),i.createParenthesizedExpressions&&(r|=1024),i.errorRecovery&&(r|=2048),i.attachComment&&(r|=4096),i.annexB&&(r|=8192),this.optionFlags=r}getScopeHandler(){return ot}parse(){this.enterInitialScopes();let e=this.startNode(),t=this.startNode();this.nextToken(),e.errors=null;let s=this.parseTopLevel(e,t);return s.errors=this.state.errors,s.comments.length=this.state.commentsLen,s}};function Ei(a,e){var t;if(((t=e)==null?void 0:t.sourceType)==="unambiguous"){e=Object.assign({},e);try{e.sourceType="module";let s=rt(e,a),i=s.parse();if(s.sawUnambiguousESM)return i;if(s.ambiguousScriptDifferentAst)try{return e.sourceType="script",rt(e,a).parse()}catch{}else i.program.sourceType="script";return i}catch(s){try{return e.sourceType="script",rt(e,a).parse()}catch{}throw s}}else return rt(e,a).parse()}p(Ei,"parse");function Ni(a,e){let t=rt(e,a);return t.options.strictMode&&(t.state.strict=!0),t.getExpression()}p(Ni,"parseExpression");function ki(a){let e={};for(let t of Object.keys(a))e[t]=U(a[t]);return e}p(ki,"generateExportedTokenTypes");var vi=ki(Ns);function rt(a,e){let t=Pt,s=new Map;if(a!=null&&a.plugins){for(let i of a.plugins){let r,n;typeof i=="string"?r=i:[r,n]=i,s.has(r)||s.set(r,n||{})}Ai(s),t=Li(s)}return new t(a,e,s)}p(rt,"getParser");var Ke=new Map;function Li(a){let e=[];for(let i of Si)a.has(i)&&e.push(i);let t=e.join("|"),s=Ke.get(t);if(!s){s=Pt;for(let i of e)s=ns[i](s);Ke.set(t,s)}return s}p(Li,"getParserClass");lt.parse=Ei;lt.parseExpression=Ni;lt.tokTypes=vi});export{p as a,ps as b,Oi as c,Di as d};