@stacksjs/build 0.70.10 → 0.70.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ ${" ".repeat(Q)}`)}}}else if(!X)U=`//${f.value}`;else U=`/*${f.value}*/`;if(this
|
|
|
20
20
|
`);case 114:return V("\r");case 120:{let Q;return{code:Q,pos:G}=jR(f,G,X,W,2,!1,U,J),V(Q===null?null:String.fromCharCode(Q))}case 117:{let Q;return{code:Q,pos:G}=m9(f,G,X,W,U,J),V(Q===null?null:String.fromCodePoint(Q))}case 116:return V("\t");case 98:return V("\b");case 118:return V("\v");case 102:return V("\f");case 13:if(f.charCodeAt(G)===10)++G;case 10:X=G,++W;case 8232:case 8233:return V("");case 56:case 57:if(R)return V(null);else J.strictNumericEscape(G-1,X,W);default:if(H>=48&&H<=55){let Q=G-1,F=/^[0-7]+/.exec(f.slice(Q,G+2))[0],q=parseInt(F,8);if(q>255)F=F.slice(0,-1),q=parseInt(F,8);G+=F.length-1;let A=f.charCodeAt(G);if(F!=="0"||A===56||A===57)if(R)return V(null);else J.strictNumericEscape(Q,X,W);return V(String.fromCharCode(q))}return V(String.fromCharCode(H))}}function jR(f,G,X,W,R,J,U,V){let H=G,Q;if({n:Q,pos:G}=x9(f,G,X,W,16,R,J,!1,V,!U),Q===null)if(U)V.invalidEscapeSequence(H,X,W);else G=H-1;return{code:Q,pos:G}}function x9(f,G,X,W,R,J,U,V,H,Q){let Y=G,F=R===16?C9.hex:C9.decBinOct,q=R===16?XW.hex:R===10?XW.dec:R===8?XW.oct:XW.bin,A=!1,j=0;for(let b=0,I=J==null?1/0:J;b<I;++b){let L=f.charCodeAt(G),E;if(L===95&&V!=="bail"){let Xf=f.charCodeAt(G-1),s=f.charCodeAt(G+1);if(!V){if(Q)return{n:null,pos:G};H.numericSeparatorInEscapeSequence(G,X,W)}else if(Number.isNaN(s)||!q(s)||F.has(Xf)||F.has(s)){if(Q)return{n:null,pos:G};H.unexpectedNumericSeparator(G,X,W)}++G;continue}if(L>=97)E=L-97+10;else if(L>=65)E=L-65+10;else if(fJf(L))E=L-48;else E=1/0;if(E>=R)if(E<=9&&Q)return{n:null,pos:G};else if(E<=9&&H.invalidDigit(G,X,W,R))E=0;else if(U)E=0,A=!0;else break;++G,j=j*R+E}if(G===Y||J!=null&&G-Y!==J||A)return{n:null,pos:G};return{n:j,pos:G}}function m9(f,G,X,W,R,J){let U=f.charCodeAt(G),V;if(U===123){if(++G,{code:V,pos:G}=jR(f,G,X,W,f.indexOf("}",G)-G,!0,R,J),++G,V!==null&&V>1114111)if(R)J.invalidCodePoint(G,X,W);else return{code:null,pos:G}}else({code:V,pos:G}=jR(f,G,X,W,4,!1,R,J));return{code:V,pos:G}}function fX(f,G,X){return new NG(X,f-G,f)}var WJf=new Set([103,109,115,105,121,117,100,118]);class PG{constructor(f){let G=f.startIndex||0;this.type=f.type,this.value=f.value,this.start=G+f.start,this.end=G+f.end,this.loc=new RX(f.startLoc,f.endLoc)}}class l9 extends y9{constructor(f,G){super();this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(X,W,R,J)=>{if(!(this.optionFlags&1024))return!1;return this.raise($.InvalidDigit,fX(X,W,R),{radix:J}),!0},numericSeparatorInEscapeSequence:this.errorBuilder($.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder($.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder($.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder($.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(X,W,R)=>{this.recordStrictModeErrors($.StrictNumericEscape,fX(X,W,R))},unterminated:(X,W,R)=>{throw this.raise($.UnterminatedString,fX(X-1,W,R))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder($.StrictNumericEscape),unterminated:(X,W,R)=>{throw this.raise($.UnterminatedTemplate,fX(X,W,R))}}),this.state=new vR,this.state.init(f),this.input=G,this.length=G.length,this.comments=[],this.isLookahead=!1}pushToken(f){this.tokens.length=this.state.tokensLength,this.tokens.push(f),++this.state.tokensLength}next(){if(this.checkKeywordEscapes(),this.optionFlags&128)this.pushToken(new PG(this.state));this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(f){if(this.match(f))return this.next(),!0;else return!1}match(f){return this.state.type===f}createLookaheadState(f){return{pos:f.pos,value:null,type:f.type,start:f.start,end:f.end,context:[this.curContext()],inType:f.inType,startLoc:f.startLoc,lastTokEndLoc:f.lastTokEndLoc,curLine:f.curLine,lineStart:f.lineStart,curPosition:f.curPosition}}lookahead(){let f=this.state;this.state=this.createLookaheadState(f),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let G=this.state;return this.state=f,G}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(f){return FR.lastIndex=f,FR.test(this.input)?FR.lastIndex:f}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(f){return $R.lastIndex=f,$R.test(this.input)?$R.lastIndex:f}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(f){let G=this.input.charCodeAt(f);if((G&64512)===55296&&++f<this.input.length){let X=this.input.charCodeAt(f);if((X&64512)===56320)G=65536+((G&1023)<<10)+(X&1023)}return G}setStrict(f){if(this.state.strict=f,f)this.state.strictErrors.forEach(([G,X])=>this.raise(G,X)),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();if(this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(f){let G;if(!this.isLookahead)G=this.state.curPosition();let X=this.state.pos,W=this.input.indexOf(f,X+2);if(W===-1)throw this.raise($.UnterminatedComment,this.state.curPosition());this.state.pos=W+f.length,GW.lastIndex=X+2;while(GW.test(this.input)&&GW.lastIndex<=W)++this.state.curLine,this.state.lineStart=GW.lastIndex;if(this.isLookahead)return;let R={type:"CommentBlock",value:this.input.slice(X+2,W),start:this.sourceToOffsetPos(X),end:this.sourceToOffsetPos(W+f.length),loc:new RX(G,this.state.curPosition())};if(this.optionFlags&128)this.pushToken(R);return R}skipLineComment(f){let G=this.state.pos,X;if(!this.isLookahead)X=this.state.curPosition();let W=this.input.charCodeAt(this.state.pos+=f);if(this.state.pos<this.length)while(!A1(W)&&++this.state.pos<this.length)W=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let R=this.state.pos,U={type:"CommentLine",value:this.input.slice(G+f,R),start:this.sourceToOffsetPos(G),end:this.sourceToOffsetPos(R),loc:new RX(X,this.state.curPosition())};if(this.optionFlags&128)this.pushToken(U);return U}skipSpace(){let f=this.state.pos,G=this.optionFlags&2048?[]:null;f:while(this.state.pos<this.length){let X=this.input.charCodeAt(this.state.pos);switch(X){case 32:case 160:case 9:++this.state.pos;break;case 13:if(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 W=this.skipBlockComment("*/");if(W!==void 0)this.addComment(W),G==null||G.push(W);break}case 47:{let W=this.skipLineComment(2);if(W!==void 0)this.addComment(W),G==null||G.push(W);break}default:break f}break;default:if(eRf(X))++this.state.pos;else if(X===45&&!this.inModule&&this.optionFlags&4096){let W=this.state.pos;if(this.input.charCodeAt(W+1)===45&&this.input.charCodeAt(W+2)===62&&(f===0||this.state.lineStart>f)){let R=this.skipLineComment(3);if(R!==void 0)this.addComment(R),G==null||G.push(R)}else break f}else if(X===60&&!this.inModule&&this.optionFlags&4096){let W=this.state.pos;if(this.input.charCodeAt(W+1)===33&&this.input.charCodeAt(W+2)===45&&this.input.charCodeAt(W+3)===45){let R=this.skipLineComment(4);if(R!==void 0)this.addComment(R),G==null||G.push(R)}else break f}else break f}}if((G==null?void 0:G.length)>0){let X=this.state.pos,W={start:this.sourceToOffsetPos(f),end:this.sourceToOffsetPos(X),comments:G,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(W)}}finishToken(f,G){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let X=this.state.type;if(this.state.type=f,this.state.value=G,!this.isLookahead)this.updateContext(X)}replaceToken(f){this.state.type=f,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let f=this.state.pos+1,G=this.codePointAtPos(f);if(G>=48&&G<=57)throw this.raise($.UnexpectedDigitAfterHash,this.state.curPosition());if(G===123||G===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(G===123?$.RecordExpressionHashIncorrectStartSyntaxType:$.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());if(this.state.pos+=2,G===123)this.finishToken(7);else this.finishToken(1)}else if(IG(G))++this.state.pos,this.finishToken(139,this.readWord1(G));else if(G===92)++this.state.pos,this.finishToken(139,this.readWord1());else this.finishOp(27,1)}readToken_dot(){let f=this.input.charCodeAt(this.state.pos+1);if(f>=48&&f<=57){this.readNumber(!0);return}if(f===46&&this.input.charCodeAt(this.state.pos+2)===46)this.state.pos+=3,this.finishToken(21);else++this.state.pos,this.finishToken(16)}readToken_slash(){if(this.input.charCodeAt(this.state.pos+1)===61)this.finishOp(31,2);else this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let f=this.input.charCodeAt(this.state.pos+1);if(f!==33)return!1;let G=this.state.pos;this.state.pos+=1;while(!A1(f)&&++this.state.pos<this.length)f=this.input.charCodeAt(this.state.pos);let X=this.input.slice(G+2,this.state.pos);return this.finishToken(28,X),!0}readToken_mult_modulo(f){let G=f===42?55:54,X=1,W=this.input.charCodeAt(this.state.pos+1);if(f===42&&W===42)X++,W=this.input.charCodeAt(this.state.pos+2),G=57;if(W===61&&!this.state.inType)X++,G=f===37?33:30;this.finishOp(G,X)}readToken_pipe_amp(f){let G=this.input.charCodeAt(this.state.pos+1);if(G===f){if(this.input.charCodeAt(this.state.pos+2)===61)this.finishOp(30,3);else this.finishOp(f===124?41:42,2);return}if(f===124){if(G===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&G===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise($.RecordExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&G===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise($.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(G===61){this.finishOp(30,2);return}this.finishOp(f===124?43:45,1)}readToken_caret(){let f=this.input.charCodeAt(this.state.pos+1);if(f===61&&!this.state.inType)this.finishOp(32,2);else if(f===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])){if(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94)this.unexpected()}else this.finishOp(44,1)}readToken_atSign(){if(this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}]))this.finishOp(38,2);else this.finishOp(26,1)}readToken_plus_min(f){let G=this.input.charCodeAt(this.state.pos+1);if(G===f){this.finishOp(34,2);return}if(G===61)this.finishOp(30,2);else this.finishOp(53,1)}readToken_lt(){let{pos:f}=this.state,G=this.input.charCodeAt(f+1);if(G===60){if(this.input.charCodeAt(f+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(G===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:f}=this.state,G=this.input.charCodeAt(f+1);if(G===62){let X=this.input.charCodeAt(f+2)===62?3:2;if(this.input.charCodeAt(f+X)===61){this.finishOp(30,X+1);return}this.finishOp(52,X);return}if(G===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(f){let G=this.input.charCodeAt(this.state.pos+1);if(G===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(f===61&&G===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(f===61?29:35,1)}readToken_question(){let f=this.input.charCodeAt(this.state.pos+1),G=this.input.charCodeAt(this.state.pos+2);if(f===63)if(G===61)this.finishOp(30,3);else this.finishOp(40,2);else if(f===46&&!(G>=48&&G<=57))this.state.pos+=2,this.finishToken(18);else++this.state.pos,this.finishToken(17)}getTokenFromCode(f){switch(f){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($.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($.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:if(this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58)this.finishOp(15,2);else++this.state.pos,this.finishToken(14);return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let G=this.input.charCodeAt(this.state.pos+1);if(G===120||G===88){this.readRadixNumber(16);return}if(G===111||G===79){this.readRadixNumber(8);return}if(G===98||G===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(f);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(f);return;case 124:case 38:this.readToken_pipe_amp(f);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(f);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(f);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(IG(f)){this.readWord(f);return}}throw this.raise($.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(f)})}finishOp(f,G){let X=this.input.slice(this.state.pos,this.state.pos+G);this.state.pos+=G,this.finishToken(f,X)}readRegexp(){let f=this.state.startLoc,G=this.state.start+1,X,W,{pos:R}=this.state;for(;;++R){if(R>=this.length)throw this.raise($.UnterminatedRegExp,xf(f,1));let H=this.input.charCodeAt(R);if(A1(H))throw this.raise($.UnterminatedRegExp,xf(f,1));if(X)X=!1;else{if(H===91)W=!0;else if(H===93&&W)W=!1;else if(H===47&&!W)break;X=H===92}}let J=this.input.slice(G,R);++R;let U="",V=()=>xf(f,R+2-G);while(R<this.length){let H=this.codePointAtPos(R),Q=String.fromCharCode(H);if(WJf.has(H)){if(H===118){if(U.includes("u"))this.raise($.IncompatibleRegExpUVFlags,V())}else if(H===117){if(U.includes("v"))this.raise($.IncompatibleRegExpUVFlags,V())}if(U.includes(Q))this.raise($.DuplicateRegExpFlags,V())}else if(q1(H)||H===92)this.raise($.MalformedRegExpFlags,V());else break;++R,U+=Q}this.state.pos=R,this.finishToken(138,{pattern:J,flags:U})}readInt(f,G,X=!1,W=!0){let{n:R,pos:J}=x9(this.input,this.state.pos,this.state.lineStart,this.state.curLine,f,G,X,W,this.errorHandlers_readInt,!1);return this.state.pos=J,R}readRadixNumber(f){let G=this.state.pos,X=this.state.curPosition(),W=!1;this.state.pos+=2;let R=this.readInt(f);if(R==null)this.raise($.InvalidDigit,xf(X,2),{radix:f});let J=this.input.charCodeAt(this.state.pos);if(J===110)++this.state.pos,W=!0;else if(J===109)throw this.raise($.InvalidDecimal,X);if(IG(this.codePointAtPos(this.state.pos)))throw this.raise($.NumberIdentifier,this.state.curPosition());if(W){let U=this.input.slice(G,this.state.pos).replace(/[_n]/g,"");this.finishToken(136,U);return}this.finishToken(135,R)}readNumber(f){let G=this.state.pos,X=this.state.curPosition(),W=!1,R=!1,J=!1,U=!1;if(!f&&this.readInt(10)===null)this.raise($.InvalidNumber,this.state.curPosition());let V=this.state.pos-G>=2&&this.input.charCodeAt(G)===48;if(V){let q=this.input.slice(G,this.state.pos);if(this.recordStrictModeErrors($.StrictOctalLiteral,X),!this.state.strict){let A=q.indexOf("_");if(A>0)this.raise($.ZeroDigitNumericSeparator,xf(X,A))}U=V&&!/[89]/.test(q)}let H=this.input.charCodeAt(this.state.pos);if(H===46&&!U)++this.state.pos,this.readInt(10),W=!0,H=this.input.charCodeAt(this.state.pos);if((H===69||H===101)&&!U){if(H=this.input.charCodeAt(++this.state.pos),H===43||H===45)++this.state.pos;if(this.readInt(10)===null)this.raise($.InvalidOrMissingExponent,X);W=!0,J=!0,H=this.input.charCodeAt(this.state.pos)}if(H===110){if(W||V)this.raise($.InvalidBigIntLiteral,X);++this.state.pos,R=!0}if(H===109){if(this.expectPlugin("decimal",this.state.curPosition()),J||V)this.raise($.InvalidDecimal,X);++this.state.pos;var Q=!0}if(IG(this.codePointAtPos(this.state.pos)))throw this.raise($.NumberIdentifier,this.state.curPosition());let Y=this.input.slice(G,this.state.pos).replace(/[_mn]/g,"");if(R){this.finishToken(136,Y);return}if(Q){this.finishToken(137,Y);return}let F=U?parseInt(Y,8):parseFloat(Y);this.finishToken(135,F)}readCodePoint(f){let{code:G,pos:X}=m9(this.input,this.state.pos,this.state.lineStart,this.state.curLine,f,this.errorHandlers_readCodePoint);return this.state.pos=X,G}readString(f){let{str:G,pos:X,curLine:W,lineStart:R}=q9(f===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=X+1,this.state.lineStart=R,this.state.curLine=W,this.finishToken(134,G)}readTemplateContinuation(){if(!this.match(8))this.unexpected(null,8);this.state.pos--,this.readTemplateToken()}readTemplateToken(){let f=this.input[this.state.pos],{str:G,firstInvalidLoc:X,pos:W,curLine:R,lineStart:J}=q9("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);if(this.state.pos=W+1,this.state.lineStart=J,this.state.curLine=R,X)this.state.firstInvalidTemplateEscapePos=new NG(X.curLine,X.pos-X.lineStart,this.sourceToOffsetPos(X.pos));if(this.input.codePointAt(W)===96)this.finishToken(24,X?null:f+G+"`");else this.state.pos++,this.finishToken(25,X?null:f+G+"${")}recordStrictModeErrors(f,G){let X=G.index;if(this.state.strict&&!this.state.strictErrors.has(X))this.raise(f,G);else this.state.strictErrors.set(X,[f,G])}readWord1(f){this.state.containsEsc=!1;let G="",X=this.state.pos,W=this.state.pos;if(f!==void 0)this.state.pos+=f<=65535?1:2;while(this.state.pos<this.length){let R=this.codePointAtPos(this.state.pos);if(q1(R))this.state.pos+=R<=65535?1:2;else if(R===92){this.state.containsEsc=!0,G+=this.input.slice(W,this.state.pos);let J=this.state.curPosition(),U=this.state.pos===X?IG:q1;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise($.MissingUnicodeEscape,this.state.curPosition()),W=this.state.pos-1;continue}++this.state.pos;let V=this.readCodePoint(!0);if(V!==null){if(!U(V))this.raise($.EscapedCharNotAnIdentifier,J);G+=String.fromCodePoint(V)}W=this.state.pos}else break}return G+this.input.slice(W,this.state.pos)}readWord(f){let G=this.readWord1(f),X=DR.get(G);if(X!==void 0)this.finishToken(X,xG(X));else this.finishToken(132,G)}checkKeywordEscapes(){let{type:f}=this.state;if(ER(f)&&this.state.containsEsc)this.raise($.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:xG(f)})}raise(f,G,X={}){let W=G instanceof NG?G:G.loc.start,R=f(W,X);if(!(this.optionFlags&1024))throw R;if(!this.isLookahead)this.state.errors.push(R);return R}raiseOverwrite(f,G,X={}){let W=G instanceof NG?G:G.loc.start,R=W.index,J=this.state.errors;for(let U=J.length-1;U>=0;U--){let V=J[U];if(V.loc.index===R)return J[U]=f(W,X);if(V.loc.index<R)break}return this.raise(f,G,X)}updateContext(f){}unexpected(f,G){throw this.raise($.UnexpectedToken,f!=null?f:this.state.startLoc,{expected:G?xG(G):null})}expectPlugin(f,G){if(this.hasPlugin(f))return!0;throw this.raise($.MissingPlugin,G!=null?G:this.state.startLoc,{missingPlugin:[f]})}expectOnePlugin(f){if(!f.some((G)=>this.hasPlugin(G)))throw this.raise($.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:f})}errorBuilder(f){return(G,X,W)=>{this.raise(f,fX(G,X,W))}}}class c9{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}}class a9{constructor(f){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=f}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new c9)}exit(){let f=this.stack.pop(),G=this.current();for(let[X,W]of Array.from(f.undefinedPrivateNames))if(G){if(!G.undefinedPrivateNames.has(X))G.undefinedPrivateNames.set(X,W)}else this.parser.raise($.InvalidPrivateFieldResolution,W,{identifierName:X})}declarePrivateName(f,G,X){let{privateNames:W,loneAccessors:R,undefinedPrivateNames:J}=this.current(),U=W.has(f);if(G&3){let V=U&&R.get(f);if(V){let H=V&4,Q=G&4,Y=V&3,F=G&3;if(U=Y===F||H!==Q,!U)R.delete(f)}else if(!U)R.set(f,G)}if(U)this.parser.raise($.PrivateNameRedeclaration,X,{identifierName:f});W.add(f),J.delete(f)}usePrivateName(f,G){let X;for(X of this.stack)if(X.privateNames.has(f))return;if(X)X.undefinedPrivateNames.set(f,G);else this.parser.raise($.InvalidPrivateFieldResolution,G,{identifierName:f})}}class VX{constructor(f=0){this.type=f}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}}class gR extends VX{constructor(f){super(f);this.declarationErrors=new Map}recordDeclarationError(f,G){let X=G.index;this.declarationErrors.set(X,[f,G])}clearDeclarationError(f){this.declarationErrors.delete(f)}iterateErrors(f){this.declarationErrors.forEach(f)}}class i9{constructor(f){this.parser=void 0,this.stack=[new VX],this.parser=f}enter(f){this.stack.push(f)}exit(){this.stack.pop()}recordParameterInitializerError(f,G){let X=G.loc.start,{stack:W}=this,R=W.length-1,J=W[R];while(!J.isCertainlyParameterDeclaration()){if(J.canBeArrowParameterDeclaration())J.recordDeclarationError(f,X);else return;J=W[--R]}this.parser.raise(f,X)}recordArrowParameterBindingError(f,G){let{stack:X}=this,W=X[X.length-1],R=G.loc.start;if(W.isCertainlyParameterDeclaration())this.parser.raise(f,R);else if(W.canBeArrowParameterDeclaration())W.recordDeclarationError(f,R);else return}recordAsyncArrowParametersError(f){let{stack:G}=this,X=G.length-1,W=G[X];while(W.canBeArrowParameterDeclaration()){if(W.type===2)W.recordDeclarationError($.AwaitBindingIdentifier,f);W=G[--X]}}validateAsPattern(){let{stack:f}=this,G=f[f.length-1];if(!G.canBeArrowParameterDeclaration())return;G.iterateErrors(([X,W])=>{this.parser.raise(X,W);let R=f.length-2,J=f[R];while(J.canBeArrowParameterDeclaration())J.clearDeclarationError(W.index),J=f[--R]})}}function RJf(){return new VX(3)}function JJf(){return new gR(1)}function UJf(){return new gR(2)}function r9(){return new VX}class s9{constructor(){this.stacks=[]}enter(f){this.stacks.push(f)}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 JW(f,G){return(f?2:0)|(G?1:0)}class p9 extends l9{addExtra(f,G,X,W=!0){if(!f)return;let{extra:R}=f;if(R==null)R={},f.extra=R;if(W)R[G]=X;else Object.defineProperty(R,G,{enumerable:W,value:X})}isContextual(f){return this.state.type===f&&!this.state.containsEsc}isUnparsedContextual(f,G){let X=f+G.length;if(this.input.slice(f,X)===G){let W=this.input.charCodeAt(X);return!(q1(W)||(W&64512)===55296)}return!1}isLookaheadContextual(f){let G=this.nextTokenStart();return this.isUnparsedContextual(G,f)}eatContextual(f){if(this.isContextual(f))return this.next(),!0;return!1}expectContextual(f,G){if(!this.eatContextual(f)){if(G!=null)throw this.raise(G,this.state.startLoc);this.unexpected(null,f)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return $9(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return $9(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(f=!0){if(f?this.isLineTerminator():this.eat(13))return;this.raise($.MissingSemicolon,this.state.lastTokEndLoc)}expect(f,G){if(!this.eat(f))this.unexpected(G,f)}tryParse(f,G=this.state.clone()){let X={node:null};try{let W=f((R=null)=>{throw X.node=R,X});if(this.state.errors.length>G.errors.length){let R=this.state;return this.state=G,this.state.tokensLength=R.tokensLength,{node:W,error:R.errors[G.errors.length],thrown:!1,aborted:!1,failState:R}}return{node:W,error:null,thrown:!1,aborted:!1,failState:null}}catch(W){let R=this.state;if(this.state=G,W instanceof SyntaxError)return{node:null,error:W,thrown:!0,aborted:!1,failState:R};if(W===X)return{node:X.node,error:null,thrown:!1,aborted:!0,failState:R};throw W}}checkExpressionErrors(f,G){if(!f)return!1;let{shorthandAssignLoc:X,doubleProtoLoc:W,privateKeyLoc:R,optionalParametersLoc:J}=f,U=!!X||!!W||!!J||!!R;if(!G)return U;if(X!=null)this.raise($.InvalidCoverInitializedName,X);if(W!=null)this.raise($.DuplicateProto,W);if(R!=null)this.raise($.UnexpectedPrivateField,R);if(J!=null)this.unexpected(J)}isLiteralPropertyName(){return N9(this.state.type)}isPrivateName(f){return f.type==="PrivateName"}getPrivateNameSV(f){return f.id.name}hasPropertyAsPrivateName(f){return(f.type==="MemberExpression"||f.type==="OptionalMemberExpression")&&this.isPrivateName(f.property)}isObjectProperty(f){return f.type==="ObjectProperty"}isObjectMethod(f){return f.type==="ObjectMethod"}initializeScopes(f=this.options.sourceType==="module"){let G=this.state.labels;this.state.labels=[];let X=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let W=this.inModule;this.inModule=f;let R=this.scope,J=this.getScopeHandler();this.scope=new J(this,f);let U=this.prodParam;this.prodParam=new s9;let V=this.classScope;this.classScope=new a9(this);let H=this.expressionScope;return this.expressionScope=new i9(this),()=>{this.state.labels=G,this.exportedIdentifiers=X,this.inModule=W,this.scope=R,this.prodParam=U,this.classScope=V,this.expressionScope=H}}enterInitialScopes(){let f=0;if(this.inModule)f|=2;this.scope.enter(1),this.prodParam.enter(f)}checkDestructuringPrivate(f){let{privateKeyLoc:G}=f;if(G!==null)this.expectPlugin("destructuringPrivate",G)}}class WX{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}}class UX{constructor(f,G,X){if(this.type="",this.start=G,this.end=0,this.loc=new RX(X),(f==null?void 0:f.optionFlags)&64)this.range=[G,0];if(f!=null&&f.filename)this.loc.filename=f.filename}}var _R=UX.prototype;_R.__clone=function(){let f=new UX(void 0,this.start,this.loc.start),G=Object.keys(this);for(let X=0,W=G.length;X<W;X++){let R=G[X];if(R!=="leadingComments"&&R!=="trailingComments"&&R!=="innerComments")f[R]=this[R]}return f};function VJf(f){return LG(f)}function LG(f){let{type:G,start:X,end:W,loc:R,range:J,extra:U,name:V}=f,H=Object.create(_R);if(H.type=G,H.start=X,H.end=W,H.loc=R,H.range=J,H.extra=U,H.name=V,G==="Placeholder")H.expectedNode=f.expectedNode;return H}function HJf(f){let{type:G,start:X,end:W,loc:R,range:J,extra:U}=f;if(G==="Placeholder")return VJf(f);let V=Object.create(_R);if(V.type=G,V.start=X,V.end=W,V.loc=R,V.range=J,f.raw!==void 0)V.raw=f.raw;else V.extra=U;return V.value=f.value,V}class d9 extends p9{startNode(){let f=this.state.startLoc;return new UX(this,f.index,f)}startNodeAt(f){return new UX(this,f.index,f)}startNodeAtNode(f){return this.startNodeAt(f.loc.start)}finishNode(f,G){return this.finishNodeAt(f,G,this.state.lastTokEndLoc)}finishNodeAt(f,G,X){if(f.type=G,f.end=X.index,f.loc.end=X,this.optionFlags&64)f.range[1]=X.index;if(this.optionFlags&2048)this.processComment(f);return f}resetStartLocation(f,G){if(f.start=G.index,f.loc.start=G,this.optionFlags&64)f.range[0]=G.index}resetEndLocation(f,G=this.state.lastTokEndLoc){if(f.end=G.index,f.loc.end=G,this.optionFlags&64)f.range[1]=G.index}resetStartLocationFromNode(f,G){this.resetStartLocation(f,G.loc.start)}}var QJf=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),n=TG`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:f})=>`Cannot overwrite reserved type ${f}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:f,enumName:G})=>`Boolean enum members need to be initialized. Use either \`${f} = true,\` or \`${f} = false,\` in enum \`${G}\`.`,EnumDuplicateMemberName:({memberName:f,enumName:G})=>`Enum member names need to be unique, but the name \`${f}\` has already been used before in enum \`${G}\`.`,EnumInconsistentMemberValues:({enumName:f})=>`Enum \`${f}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:f,enumName:G})=>`Enum type \`${f}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${G}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:f})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${f}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:f,memberName:G,explicitType:X})=>`Enum \`${f}\` has type \`${X}\`, so the initializer of \`${G}\` needs to be a ${X} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:f,memberName:G})=>`Symbol enum members cannot be initialized. Use \`${G},\` in enum \`${f}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:f,memberName:G})=>`The enum member initializer for \`${G}\` needs to be a literal (either a boolean, number, or string) in enum \`${f}\`.`,EnumInvalidMemberName:({enumName:f,memberName:G,suggestion:X})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${G}\`, consider using \`${X}\`, in enum \`${f}\`.`,EnumNumberMemberNotInitialized:({enumName:f,memberName:G})=>`Number enum members need to be initialized, e.g. \`${G} = 1\` in enum \`${f}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:f})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${f}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:f})=>`Unexpected reserved type ${f}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:f,suggestion:G})=>`\`declare export ${f}\` is not supported. Use \`${G}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function ZJf(f){return f.type==="DeclareExportAllDeclaration"||f.type==="DeclareExportDeclaration"&&(!f.declaration||f.declaration.type!=="TypeAlias"&&f.declaration.type!=="InterfaceDeclaration")}function A9(f){return f.importKind==="type"||f.importKind==="typeof"}var YJf={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function zJf(f,G){let X=[],W=[];for(let R=0;R<f.length;R++)(G(f[R],R,f)?X:W).push(f[R]);return[X,W]}var BJf=/\*?\s*@((?:no)?flow)\b/,MJf=(f)=>class G extends f{constructor(...X){super(...X);this.flowPragma=void 0}getScopeHandler(){return _9}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(X,W){if(X!==134&&X!==13&&X!==28){if(this.flowPragma===void 0)this.flowPragma=null}super.finishToken(X,W)}addComment(X){if(this.flowPragma===void 0){let W=BJf.exec(X.value);if(!W);else if(W[1]==="flow")this.flowPragma="flow";else if(W[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(X)}flowParseTypeInitialiser(X){let W=this.state.inType;this.state.inType=!0,this.expect(X||14);let R=this.flowParseType();return this.state.inType=W,R}flowParsePredicate(){let X=this.startNode(),W=this.state.startLoc;if(this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>W.index+1)this.raise(n.UnexpectedSpaceBetweenModuloChecks,W);if(this.eat(10))return X.value=super.parseExpression(),this.expect(11),this.finishNode(X,"DeclaredPredicate");else return this.finishNode(X,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let X=this.state.inType;this.state.inType=!0,this.expect(14);let W=null,R=null;if(this.match(54))this.state.inType=X,R=this.flowParsePredicate();else if(W=this.flowParseType(),this.state.inType=X,this.match(54))R=this.flowParsePredicate();return[W,R]}flowParseDeclareClass(X){return this.next(),this.flowParseInterfaceish(X,!0),this.finishNode(X,"DeclareClass")}flowParseDeclareFunction(X){this.next();let W=X.id=this.parseIdentifier(),R=this.startNode(),J=this.startNode();if(this.match(47))R.typeParameters=this.flowParseTypeParameterDeclaration();else R.typeParameters=null;this.expect(10);let U=this.flowParseFunctionTypeParams();return R.params=U.params,R.rest=U.rest,R.this=U._this,this.expect(11),[R.returnType,X.predicate]=this.flowParseTypeAndPredicateInitialiser(),J.typeAnnotation=this.finishNode(R,"FunctionTypeAnnotation"),W.typeAnnotation=this.finishNode(J,"TypeAnnotation"),this.resetEndLocation(W),this.semicolon(),this.scope.declareName(X.id.name,2048,X.id.loc.start),this.finishNode(X,"DeclareFunction")}flowParseDeclare(X,W){if(this.match(80))return this.flowParseDeclareClass(X);else if(this.match(68))return this.flowParseDeclareFunction(X);else if(this.match(74))return this.flowParseDeclareVariable(X);else if(this.eatContextual(127))if(this.match(16))return this.flowParseDeclareModuleExports(X);else{if(W)this.raise(n.NestedDeclareModule,this.state.lastTokStartLoc);return this.flowParseDeclareModule(X)}else if(this.isContextual(130))return this.flowParseDeclareTypeAlias(X);else if(this.isContextual(131))return this.flowParseDeclareOpaqueType(X);else if(this.isContextual(129))return this.flowParseDeclareInterface(X);else if(this.match(82))return this.flowParseDeclareExportDeclaration(X,W);else this.unexpected()}flowParseDeclareVariable(X){return this.next(),X.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(X.id.name,5,X.id.loc.start),this.semicolon(),this.finishNode(X,"DeclareVariable")}flowParseDeclareModule(X){if(this.scope.enter(0),this.match(134))X.id=super.parseExprAtom();else X.id=this.parseIdentifier();let W=X.body=this.startNode(),R=W.body=[];this.expect(5);while(!this.match(8)){let V=this.startNode();if(this.match(83)){if(this.next(),!this.isContextual(130)&&!this.match(87))this.raise(n.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc);super.parseImport(V)}else this.expectContextual(125,n.UnsupportedStatementInDeclareModule),V=this.flowParseDeclare(V,!0);R.push(V)}this.scope.exit(),this.expect(8),this.finishNode(W,"BlockStatement");let J=null,U=!1;return R.forEach((V)=>{if(ZJf(V)){if(J==="CommonJS")this.raise(n.AmbiguousDeclareModuleKind,V);J="ES"}else if(V.type==="DeclareModuleExports"){if(U)this.raise(n.DuplicateDeclareModuleExports,V);if(J==="ES")this.raise(n.AmbiguousDeclareModuleKind,V);J="CommonJS",U=!0}}),X.kind=J||"CommonJS",this.finishNode(X,"DeclareModule")}flowParseDeclareExportDeclaration(X,W){if(this.expect(82),this.eat(65)){if(this.match(68)||this.match(80))X.declaration=this.flowParseDeclare(this.startNode());else X.declaration=this.flowParseType(),this.semicolon();return X.default=!0,this.finishNode(X,"DeclareExportDeclaration")}else{if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!W){let R=this.state.value;throw this.raise(n.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:R,suggestion:YJf[R]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return X.declaration=this.flowParseDeclare(this.startNode()),X.default=!1,this.finishNode(X,"DeclareExportDeclaration");else if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131)){if(X=this.parseExport(X,null),X.type==="ExportNamedDeclaration")X.type="ExportDeclaration",X.default=!1,delete X.exportKind;return X.type="Declare"+X.type,X}}this.unexpected()}flowParseDeclareModuleExports(X){return this.next(),this.expectContextual(111),X.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(X,"DeclareModuleExports")}flowParseDeclareTypeAlias(X){this.next();let W=this.flowParseTypeAlias(X);return W.type="DeclareTypeAlias",W}flowParseDeclareOpaqueType(X){this.next();let W=this.flowParseOpaqueType(X,!0);return W.type="DeclareOpaqueType",W}flowParseDeclareInterface(X){return this.next(),this.flowParseInterfaceish(X,!1),this.finishNode(X,"DeclareInterface")}flowParseInterfaceish(X,W){if(X.id=this.flowParseRestrictedIdentifier(!W,!0),this.scope.declareName(X.id.name,W?17:8201,X.id.loc.start),this.match(47))X.typeParameters=this.flowParseTypeParameterDeclaration();else X.typeParameters=null;if(X.extends=[],this.eat(81))do X.extends.push(this.flowParseInterfaceExtends());while(!W&&this.eat(12));if(W){if(X.implements=[],X.mixins=[],this.eatContextual(117))do X.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do X.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}X.body=this.flowParseObjectType({allowStatic:W,allowExact:!1,allowSpread:!1,allowProto:W,allowInexact:!1})}flowParseInterfaceExtends(){let X=this.startNode();if(X.id=this.flowParseQualifiedTypeIdentifier(),this.match(47))X.typeParameters=this.flowParseTypeParameterInstantiation();else X.typeParameters=null;return this.finishNode(X,"InterfaceExtends")}flowParseInterface(X){return this.flowParseInterfaceish(X,!1),this.finishNode(X,"InterfaceDeclaration")}checkNotUnderscore(X){if(X==="_")this.raise(n.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(X,W,R){if(!QJf.has(X))return;this.raise(R?n.AssignReservedType:n.UnexpectedReservedType,W,{reservedType:X})}flowParseRestrictedIdentifier(X,W){return this.checkReservedType(this.state.value,this.state.startLoc,W),this.parseIdentifier(X)}flowParseTypeAlias(X){if(X.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(X.id.name,8201,X.id.loc.start),this.match(47))X.typeParameters=this.flowParseTypeParameterDeclaration();else X.typeParameters=null;return X.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(X,"TypeAlias")}flowParseOpaqueType(X,W){if(this.expectContextual(130),X.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(X.id.name,8201,X.id.loc.start),this.match(47))X.typeParameters=this.flowParseTypeParameterDeclaration();else X.typeParameters=null;if(X.supertype=null,this.match(14))X.supertype=this.flowParseTypeInitialiser(14);if(X.impltype=null,!W)X.impltype=this.flowParseTypeInitialiser(29);return this.semicolon(),this.finishNode(X,"OpaqueType")}flowParseTypeParameter(X=!1){let W=this.state.startLoc,R=this.startNode(),J=this.flowParseVariance(),U=this.flowParseTypeAnnotatableIdentifier();if(R.name=U.name,R.variance=J,R.bound=U.typeAnnotation,this.match(29))this.eat(29),R.default=this.flowParseType();else if(X)this.raise(n.MissingTypeParamDefault,W);return this.finishNode(R,"TypeParameter")}flowParseTypeParameterDeclaration(){let X=this.state.inType,W=this.startNode();if(W.params=[],this.state.inType=!0,this.match(47)||this.match(143))this.next();else this.unexpected();let R=!1;do{let J=this.flowParseTypeParameter(R);if(W.params.push(J),J.default)R=!0;if(!this.match(48))this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=X,this.finishNode(W,"TypeParameterDeclaration")}flowInTopLevelContext(X){if(this.curContext()!==Ff.brace){let W=this.state.context;this.state.context=[W[0]];try{return X()}finally{this.state.context=W}}else return X()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()!==47)return;return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let X=this.startNode(),W=this.state.inType;if(this.state.inType=!0,X.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let R=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!1;while(!this.match(48))if(X.params.push(this.flowParseType()),!this.match(48))this.expect(12);this.state.noAnonFunctionType=R}),this.state.inType=W,!this.state.inType&&this.curContext()===Ff.brace)this.reScan_lt_gt();return this.expect(48),this.finishNode(X,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return;let X=this.startNode(),W=this.state.inType;X.params=[],this.state.inType=!0,this.expect(47);while(!this.match(48))if(X.params.push(this.flowParseTypeOrImplicitInstantiation()),!this.match(48))this.expect(12);return this.expect(48),this.state.inType=W,this.finishNode(X,"TypeParameterInstantiation")}flowParseInterfaceType(){let X=this.startNode();if(this.expectContextual(129),X.extends=[],this.eat(81))do X.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return X.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(X,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(X,W,R){if(X.static=W,this.lookahead().type===14)X.id=this.flowParseObjectPropertyKey(),X.key=this.flowParseTypeInitialiser();else X.id=null,X.key=this.flowParseType();return this.expect(3),X.value=this.flowParseTypeInitialiser(),X.variance=R,this.finishNode(X,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(X,W){if(X.static=W,X.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10))X.method=!0,X.optional=!1,X.value=this.flowParseObjectTypeMethodish(this.startNodeAt(X.loc.start));else{if(X.method=!1,this.eat(17))X.optional=!0;X.value=this.flowParseTypeInitialiser()}return this.finishNode(X,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(X){if(X.params=[],X.rest=null,X.typeParameters=null,X.this=null,this.match(47))X.typeParameters=this.flowParseTypeParameterDeclaration();if(this.expect(10),this.match(78)){if(X.this=this.flowParseFunctionTypeParam(!0),X.this.name=null,!this.match(11))this.expect(12)}while(!this.match(11)&&!this.match(21))if(X.params.push(this.flowParseFunctionTypeParam(!1)),!this.match(11))this.expect(12);if(this.eat(21))X.rest=this.flowParseFunctionTypeParam(!1);return this.expect(11),X.returnType=this.flowParseTypeInitialiser(),this.finishNode(X,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(X,W){let R=this.startNode();return X.static=W,X.value=this.flowParseObjectTypeMethodish(R),this.finishNode(X,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:X,allowExact:W,allowSpread:R,allowProto:J,allowInexact:U}){let V=this.state.inType;this.state.inType=!0;let H=this.startNode();H.callProperties=[],H.properties=[],H.indexers=[],H.internalSlots=[];let Q,Y,F=!1;if(W&&this.match(6))this.expect(6),Q=9,Y=!0;else this.expect(5),Q=8,Y=!1;H.exact=Y;while(!this.match(Q)){let A=!1,j=null,b=null,I=this.startNode();if(J&&this.isContextual(118)){let E=this.lookahead();if(E.type!==14&&E.type!==17)this.next(),j=this.state.startLoc,X=!1}if(X&&this.isContextual(106)){let E=this.lookahead();if(E.type!==14&&E.type!==17)this.next(),A=!0}let L=this.flowParseVariance();if(this.eat(0)){if(j!=null)this.unexpected(j);if(this.eat(0)){if(L)this.unexpected(L.loc.start);H.internalSlots.push(this.flowParseObjectTypeInternalSlot(I,A))}else H.indexers.push(this.flowParseObjectTypeIndexer(I,A,L))}else if(this.match(10)||this.match(47)){if(j!=null)this.unexpected(j);if(L)this.unexpected(L.loc.start);H.callProperties.push(this.flowParseObjectTypeCallProperty(I,A))}else{let E="init";if(this.isContextual(99)||this.isContextual(104)){let s=this.lookahead();if(N9(s.type))E=this.state.value,this.next()}let Xf=this.flowParseObjectTypeProperty(I,A,j,L,E,R,U!=null?U:!Y);if(Xf===null)F=!0,b=this.state.lastTokStartLoc;else H.properties.push(Xf)}if(this.flowObjectTypeSemicolon(),b&&!this.match(8)&&!this.match(9))this.raise(n.UnexpectedExplicitInexactInObject,b)}if(this.expect(Q),R)H.inexact=F;let q=this.finishNode(H,"ObjectTypeAnnotation");return this.state.inType=V,q}flowParseObjectTypeProperty(X,W,R,J,U,V,H){if(this.eat(21)){if(this.match(12)||this.match(13)||this.match(8)||this.match(9)){if(!V)this.raise(n.InexactInsideNonObject,this.state.lastTokStartLoc);else if(!H)this.raise(n.InexactInsideExact,this.state.lastTokStartLoc);if(J)this.raise(n.InexactVariance,J);return null}if(!V)this.raise(n.UnexpectedSpreadType,this.state.lastTokStartLoc);if(R!=null)this.unexpected(R);if(J)this.raise(n.SpreadVariance,J);return X.argument=this.flowParseType(),this.finishNode(X,"ObjectTypeSpreadProperty")}else{X.key=this.flowParseObjectPropertyKey(),X.static=W,X.proto=R!=null,X.kind=U;let Q=!1;if(this.match(47)||this.match(10)){if(X.method=!0,R!=null)this.unexpected(R);if(J)this.unexpected(J.loc.start);if(X.value=this.flowParseObjectTypeMethodish(this.startNodeAt(X.loc.start)),U==="get"||U==="set")this.flowCheckGetterSetterParams(X);if(!V&&X.key.name==="constructor"&&X.value.this)this.raise(n.ThisParamBannedInConstructor,X.value.this)}else{if(U!=="init")this.unexpected();if(X.method=!1,this.eat(17))Q=!0;X.value=this.flowParseTypeInitialiser(),X.variance=J}return X.optional=Q,this.finishNode(X,"ObjectTypeProperty")}}flowCheckGetterSetterParams(X){let W=X.kind==="get"?0:1,R=X.value.params.length+(X.value.rest?1:0);if(X.value.this)this.raise(X.kind==="get"?n.GetterMayNotHaveThisParam:n.SetterMayNotHaveThisParam,X.value.this);if(R!==W)this.raise(X.kind==="get"?$.BadGetterArity:$.BadSetterArity,X);if(X.kind==="set"&&X.value.rest)this.raise($.BadSetterRestParameter,X)}flowObjectTypeSemicolon(){if(!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9))this.unexpected()}flowParseQualifiedTypeIdentifier(X,W){X!=null||(X=this.state.startLoc);let R=W||this.flowParseRestrictedIdentifier(!0);while(this.eat(16)){let J=this.startNodeAt(X);J.qualification=R,J.id=this.flowParseRestrictedIdentifier(!0),R=this.finishNode(J,"QualifiedTypeIdentifier")}return R}flowParseGenericType(X,W){let R=this.startNodeAt(X);if(R.typeParameters=null,R.id=this.flowParseQualifiedTypeIdentifier(X,W),this.match(47))R.typeParameters=this.flowParseTypeParameterInstantiation();return this.finishNode(R,"GenericTypeAnnotation")}flowParseTypeofType(){let X=this.startNode();return this.expect(87),X.argument=this.flowParsePrimaryType(),this.finishNode(X,"TypeofTypeAnnotation")}flowParseTupleType(){let X=this.startNode();X.types=[],this.expect(0);while(this.state.pos<this.length&&!this.match(3)){if(X.types.push(this.flowParseType()),this.match(3))break;this.expect(12)}return this.expect(3),this.finishNode(X,"TupleTypeAnnotation")}flowParseFunctionTypeParam(X){let W=null,R=!1,J=null,U=this.startNode(),V=this.lookahead(),H=this.state.type===78;if(V.type===14||V.type===17){if(H&&!X)this.raise(n.ThisParamMustBeFirst,U);if(W=this.parseIdentifier(H),this.eat(17)){if(R=!0,H)this.raise(n.ThisParamMayNotBeOptional,U)}J=this.flowParseTypeInitialiser()}else J=this.flowParseType();return U.name=W,U.optional=R,U.typeAnnotation=J,this.finishNode(U,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(X){let W=this.startNodeAt(X.loc.start);return W.name=null,W.optional=!1,W.typeAnnotation=X,this.finishNode(W,"FunctionTypeParam")}flowParseFunctionTypeParams(X=[]){let W=null,R=null;if(this.match(78)){if(R=this.flowParseFunctionTypeParam(!0),R.name=null,!this.match(11))this.expect(12)}while(!this.match(11)&&!this.match(21))if(X.push(this.flowParseFunctionTypeParam(!1)),!this.match(11))this.expect(12);if(this.eat(21))W=this.flowParseFunctionTypeParam(!1);return{params:X,rest:W,_this:R}}flowIdentToTypeAnnotation(X,W,R){switch(R.name){case"any":return this.finishNode(W,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(W,"BooleanTypeAnnotation");case"mixed":return this.finishNode(W,"MixedTypeAnnotation");case"empty":return this.finishNode(W,"EmptyTypeAnnotation");case"number":return this.finishNode(W,"NumberTypeAnnotation");case"string":return this.finishNode(W,"StringTypeAnnotation");case"symbol":return this.finishNode(W,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(R.name),this.flowParseGenericType(X,R)}}flowParsePrimaryType(){let X=this.state.startLoc,W=this.startNode(),R,J,U=!1,V=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,J=this.flowParseTupleType(),this.state.noAnonFunctionType=V,J;case 47:{let H=this.startNode();return H.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),R=this.flowParseFunctionTypeParams(),H.params=R.params,H.rest=R.rest,H.this=R._this,this.expect(11),this.expect(19),H.returnType=this.flowParseType(),this.finishNode(H,"FunctionTypeAnnotation")}case 10:{let H=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if($f(this.state.type)||this.match(78)){let Q=this.lookahead().type;U=Q!==17&&Q!==14}else U=!0;if(U)if(this.state.noAnonFunctionType=!1,J=this.flowParseType(),this.state.noAnonFunctionType=V,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),J;else this.eat(12);if(J)R=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(J)]);else R=this.flowParseFunctionTypeParams();return H.params=R.params,H.rest=R.rest,H.this=R._this,this.expect(11),this.expect(19),H.returnType=this.flowParseType(),H.typeParameters=null,this.finishNode(H,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return W.value=this.match(85),this.next(),this.finishNode(W,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",W);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",W);throw this.raise(n.UnexpectedSubtractionOperand,this.state.startLoc)}this.unexpected();return;case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(W,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(W,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(W,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(W,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(ER(this.state.type)){let H=xG(this.state.type);return this.next(),super.createIdentifier(W,H)}else if($f(this.state.type)){if(this.isContextual(129))return this.flowParseInterfaceType();return this.flowIdentToTypeAnnotation(X,W,this.parseIdentifier())}}this.unexpected()}flowParsePostfixType(){let X=this.state.startLoc,W=this.flowParsePrimaryType(),R=!1;while((this.match(0)||this.match(18))&&!this.canInsertSemicolon()){let J=this.startNodeAt(X),U=this.eat(18);if(R=R||U,this.expect(0),!U&&this.match(3))J.elementType=W,this.next(),W=this.finishNode(J,"ArrayTypeAnnotation");else if(J.objectType=W,J.indexType=this.flowParseType(),this.expect(3),R)J.optional=U,W=this.finishNode(J,"OptionalIndexedAccessType");else W=this.finishNode(J,"IndexedAccessType")}return W}flowParsePrefixType(){let X=this.startNode();if(this.eat(17))return X.typeAnnotation=this.flowParsePrefixType(),this.finishNode(X,"NullableTypeAnnotation");else return this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let X=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let W=this.startNodeAt(X.loc.start);return W.params=[this.reinterpretTypeAsFunctionTypeParam(X)],W.rest=null,W.this=null,W.returnType=this.flowParseType(),W.typeParameters=null,this.finishNode(W,"FunctionTypeAnnotation")}return X}flowParseIntersectionType(){let X=this.startNode();this.eat(45);let W=this.flowParseAnonFunctionWithoutParens();X.types=[W];while(this.eat(45))X.types.push(this.flowParseAnonFunctionWithoutParens());return X.types.length===1?W:this.finishNode(X,"IntersectionTypeAnnotation")}flowParseUnionType(){let X=this.startNode();this.eat(43);let W=this.flowParseIntersectionType();X.types=[W];while(this.eat(43))X.types.push(this.flowParseIntersectionType());return X.types.length===1?W:this.finishNode(X,"UnionTypeAnnotation")}flowParseType(){let X=this.state.inType;this.state.inType=!0;let W=this.flowParseUnionType();return this.state.inType=X,W}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let X=this.state.startLoc,W=this.parseIdentifier();return this.flowParseGenericType(X,W)}else return this.flowParseType()}flowParseTypeAnnotation(){let X=this.startNode();return X.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(X,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(X){let W=X?this.parseIdentifier():this.flowParseRestrictedIdentifier();if(this.match(14))W.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(W);return W}typeCastToParameter(X){return X.expression.typeAnnotation=X.typeAnnotation,this.resetEndLocation(X.expression,X.typeAnnotation.loc.end),X.expression}flowParseVariance(){let X=null;if(this.match(53)){if(X=this.startNode(),this.state.value==="+")X.kind="plus";else X.kind="minus";return this.next(),this.finishNode(X,"Variance")}return X}parseFunctionBody(X,W,R=!1){if(W){this.forwardNoArrowParamsConversionAt(X,()=>super.parseFunctionBody(X,!0,R));return}super.parseFunctionBody(X,!1,R)}parseFunctionBodyAndFinish(X,W,R=!1){if(this.match(14)){let J=this.startNode();[J.typeAnnotation,X.predicate]=this.flowParseTypeAndPredicateInitialiser(),X.returnType=J.typeAnnotation?this.finishNode(J,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(X,W,R)}parseStatementLike(X){if(this.state.strict&&this.isContextual(129)){let R=this.lookahead();if(HG(R.type)){let J=this.startNode();return this.next(),this.flowParseInterface(J)}}else if(this.isContextual(126)){let R=this.startNode();return this.next(),this.flowParseEnumDeclaration(R)}let W=super.parseStatementLike(X);if(this.flowPragma===void 0&&!this.isValidDirective(W))this.flowPragma=null;return W}parseExpressionStatement(X,W,R){if(W.type==="Identifier"){if(W.name==="declare"){if(this.match(80)||$f(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(X)}else if($f(this.state.type)){if(W.name==="interface")return this.flowParseInterface(X);else if(W.name==="type")return this.flowParseTypeAlias(X);else if(W.name==="opaque")return this.flowParseOpaqueType(X,!1)}}return super.parseExpressionStatement(X,W,R)}shouldParseExportDeclaration(){let{type:X}=this.state;if(X===126||F9(X))return!this.state.containsEsc;return super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:X}=this.state;if(X===126||F9(X))return this.state.containsEsc;return super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let X=this.startNode();return this.next(),this.flowParseEnumDeclaration(X)}return super.parseExportDefaultExpression()}parseConditional(X,W,R){if(!this.match(17))return X;if(this.state.maybeInArrowParameters){let q=this.lookaheadCharCode();if(q===44||q===61||q===58||q===41)return this.setOptionalParametersError(R),X}this.expect(17);let J=this.state.clone(),U=this.state.noArrowAt,V=this.startNodeAt(W),{consequent:H,failed:Q}=this.tryParseConditionalConsequent(),[Y,F]=this.getArrowLikeExpressions(H);if(Q||F.length>0){let q=[...U];if(F.length>0){this.state=J,this.state.noArrowAt=q;for(let A=0;A<F.length;A++)q.push(F[A].start);({consequent:H,failed:Q}=this.tryParseConditionalConsequent()),[Y,F]=this.getArrowLikeExpressions(H)}if(Q&&Y.length>1)this.raise(n.AmbiguousConditionalArrow,J.startLoc);if(Q&&Y.length===1)this.state=J,q.push(Y[0].start),this.state.noArrowAt=q,{consequent:H,failed:Q}=this.tryParseConditionalConsequent()}return this.getArrowLikeExpressions(H,!0),this.state.noArrowAt=U,this.expect(14),V.test=X,V.consequent=H,V.alternate=this.forwardNoArrowParamsConversionAt(V,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(V,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let X=this.parseMaybeAssignAllowIn(),W=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:X,failed:W}}getArrowLikeExpressions(X,W){let R=[X],J=[];while(R.length!==0){let U=R.pop();if(U.type==="ArrowFunctionExpression"&&U.body.type!=="BlockStatement"){if(U.typeParameters||!U.returnType)this.finishArrowValidation(U);else J.push(U);R.push(U.body)}else if(U.type==="ConditionalExpression")R.push(U.consequent),R.push(U.alternate)}if(W)return J.forEach((U)=>this.finishArrowValidation(U)),[J,[]];return zJf(J,(U)=>U.params.every((V)=>this.isAssignable(V,!0)))}finishArrowValidation(X){var W;this.toAssignableList(X.params,(W=X.extra)==null?void 0:W.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(X,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(X,W){let R;if(this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(X.start)))this.state.noArrowParamsConversionAt.push(this.state.start),R=W(),this.state.noArrowParamsConversionAt.pop();else R=W();return R}parseParenItem(X,W){let R=super.parseParenItem(X,W);if(this.eat(17))R.optional=!0,this.resetEndLocation(X);if(this.match(14)){let J=this.startNodeAt(W);return J.expression=R,J.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(J,"TypeCastExpression")}return R}assertModuleNodeAllowed(X){if(X.type==="ImportDeclaration"&&(X.importKind==="type"||X.importKind==="typeof")||X.type==="ExportNamedDeclaration"&&X.exportKind==="type"||X.type==="ExportAllDeclaration"&&X.exportKind==="type")return;super.assertModuleNodeAllowed(X)}parseExportDeclaration(X){if(this.isContextual(130)){X.exportKind="type";let W=this.startNode();if(this.next(),this.match(5))return X.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(X),null;else return this.flowParseTypeAlias(W)}else if(this.isContextual(131)){X.exportKind="type";let W=this.startNode();return this.next(),this.flowParseOpaqueType(W,!1)}else if(this.isContextual(129)){X.exportKind="type";let W=this.startNode();return this.next(),this.flowParseInterface(W)}else if(this.isContextual(126)){X.exportKind="value";let W=this.startNode();return this.next(),this.flowParseEnumDeclaration(W)}else return super.parseExportDeclaration(X)}eatExportStar(X){if(super.eatExportStar(X))return!0;if(this.isContextual(130)&&this.lookahead().type===55)return X.exportKind="type",this.next(),this.next(),!0;return!1}maybeParseExportNamespaceSpecifier(X){let{startLoc:W}=this.state,R=super.maybeParseExportNamespaceSpecifier(X);if(R&&X.exportKind==="type")this.unexpected(W);return R}parseClassId(X,W,R){if(super.parseClassId(X,W,R),this.match(47))X.typeParameters=this.flowParseTypeParameterDeclaration()}parseClassMember(X,W,R){let{startLoc:J}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(X,W))return;W.declare=!0}if(super.parseClassMember(X,W,R),W.declare){if(W.type!=="ClassProperty"&&W.type!=="ClassPrivateProperty"&&W.type!=="PropertyDefinition")this.raise(n.DeclareClassElement,J);else if(W.value)this.raise(n.DeclareClassFieldInitializer,W.value)}}isIterator(X){return X==="iterator"||X==="asyncIterator"}readIterator(){let X=super.readWord1(),W="@@"+X;if(!this.isIterator(X)||!this.state.inType)this.raise($.InvalidIdentifier,this.state.curPosition(),{identifierName:W});this.finishToken(132,W)}getTokenFromCode(X){let W=this.input.charCodeAt(this.state.pos+1);if(X===123&&W===124)this.finishOp(6,2);else if(this.state.inType&&(X===62||X===60))this.finishOp(X===62?48:47,1);else if(this.state.inType&&X===63)if(W===46)this.finishOp(18,2);else this.finishOp(17,1);else if(pRf(X,W,this.input.charCodeAt(this.state.pos+2)))this.state.pos+=2,this.readIterator();else super.getTokenFromCode(X)}isAssignable(X,W){if(X.type==="TypeCastExpression")return this.isAssignable(X.expression,W);else return super.isAssignable(X,W)}toAssignable(X,W=!1){if(!W&&X.type==="AssignmentExpression"&&X.left.type==="TypeCastExpression")X.left=this.typeCastToParameter(X.left);super.toAssignable(X,W)}toAssignableList(X,W,R){for(let J=0;J<X.length;J++){let U=X[J];if((U==null?void 0:U.type)==="TypeCastExpression")X[J]=this.typeCastToParameter(U)}super.toAssignableList(X,W,R)}toReferencedList(X,W){for(let J=0;J<X.length;J++){var R;let U=X[J];if(U&&U.type==="TypeCastExpression"&&!((R=U.extra)!=null&&R.parenthesized)&&(X.length>1||!W))this.raise(n.TypeCastInPattern,U.typeAnnotation)}return X}parseArrayLike(X,W,R,J){let U=super.parseArrayLike(X,W,R,J);if(W&&!this.state.maybeInArrowParameters)this.toReferencedList(U.elements);return U}isValidLVal(X,W,R){return X==="TypeCastExpression"||super.isValidLVal(X,W,R)}parseClassProperty(X){if(this.match(14))X.typeAnnotation=this.flowParseTypeAnnotation();return super.parseClassProperty(X)}parseClassPrivateProperty(X){if(this.match(14))X.typeAnnotation=this.flowParseTypeAnnotation();return super.parseClassPrivateProperty(X)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(X){return!this.match(14)&&super.isNonstaticConstructor(X)}pushClassMethod(X,W,R,J,U,V){if(W.variance)this.unexpected(W.variance.loc.start);if(delete W.variance,this.match(47))W.typeParameters=this.flowParseTypeParameterDeclaration();if(super.pushClassMethod(X,W,R,J,U,V),W.params&&U){let H=W.params;if(H.length>0&&this.isThisParam(H[0]))this.raise(n.ThisParamBannedInConstructor,W)}else if(W.type==="MethodDefinition"&&U&&W.value.params){let H=W.value.params;if(H.length>0&&this.isThisParam(H[0]))this.raise(n.ThisParamBannedInConstructor,W)}}pushClassPrivateMethod(X,W,R,J){if(W.variance)this.unexpected(W.variance.loc.start);if(delete W.variance,this.match(47))W.typeParameters=this.flowParseTypeParameterDeclaration();super.pushClassPrivateMethod(X,W,R,J)}parseClassSuper(X){if(super.parseClassSuper(X),X.superClass&&(this.match(47)||this.match(51)))X.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression();if(this.isContextual(113)){this.next();let W=X.implements=[];do{let R=this.startNode();if(R.id=this.flowParseRestrictedIdentifier(!0),this.match(47))R.typeParameters=this.flowParseTypeParameterInstantiation();else R.typeParameters=null;W.push(this.finishNode(R,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(X){super.checkGetterSetterParams(X);let W=this.getObjectOrClassMethodParams(X);if(W.length>0){let R=W[0];if(this.isThisParam(R)&&X.kind==="get")this.raise(n.GetterMayNotHaveThisParam,R);else if(this.isThisParam(R))this.raise(n.SetterMayNotHaveThisParam,R)}}parsePropertyNamePrefixOperator(X){X.variance=this.flowParseVariance()}parseObjPropValue(X,W,R,J,U,V,H){if(X.variance)this.unexpected(X.variance.loc.start);delete X.variance;let Q;if(this.match(47)&&!V){if(Q=this.flowParseTypeParameterDeclaration(),!this.match(10))this.unexpected()}let Y=super.parseObjPropValue(X,W,R,J,U,V,H);if(Q)(Y.value||Y).typeParameters=Q;return Y}parseFunctionParamType(X){if(this.eat(17)){if(X.type!=="Identifier")this.raise(n.PatternIsOptional,X);if(this.isThisParam(X))this.raise(n.ThisParamMayNotBeOptional,X);X.optional=!0}if(this.match(14))X.typeAnnotation=this.flowParseTypeAnnotation();else if(this.isThisParam(X))this.raise(n.ThisParamAnnotationRequired,X);if(this.match(29)&&this.isThisParam(X))this.raise(n.ThisParamNoDefault,X);return this.resetEndLocation(X),X}parseMaybeDefault(X,W){let R=super.parseMaybeDefault(X,W);if(R.type==="AssignmentPattern"&&R.typeAnnotation&&R.right.start<R.typeAnnotation.start)this.raise(n.TypeBeforeInitializer,R.typeAnnotation);return R}checkImportReflection(X){if(super.checkImportReflection(X),X.module&&X.importKind!=="value")this.raise(n.ImportReflectionHasImportType,X.specifiers[0].loc.start)}parseImportSpecifierLocal(X,W,R){W.local=A9(X)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),X.specifiers.push(this.finishImportSpecifier(W,R))}isPotentialImportPhase(X){if(super.isPotentialImportPhase(X))return!0;if(this.isContextual(130)){if(!X)return!0;let W=this.lookaheadCharCode();return W===123||W===42}return!X&&this.isContextual(87)}applyImportPhase(X,W,R,J){if(super.applyImportPhase(X,W,R,J),W){if(!R&&this.match(65))return;X.exportKind=R==="type"?R:"value"}else{if(R==="type"&&this.match(55))this.unexpected();X.importKind=R==="type"||R==="typeof"?R:"value"}}parseImportSpecifier(X,W,R,J,U){let V=X.imported,H=null;if(V.type==="Identifier"){if(V.name==="type")H="type";else if(V.name==="typeof")H="typeof"}let Q=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let F=this.parseIdentifier(!0);if(H!==null&&!HG(this.state.type))X.imported=F,X.importKind=H,X.local=LG(F);else X.imported=V,X.importKind=null,X.local=this.parseIdentifier()}else{if(H!==null&&HG(this.state.type))X.imported=this.parseIdentifier(!0),X.importKind=H;else{if(W)throw this.raise($.ImportBindingIsString,X,{importName:V.value});X.imported=V,X.importKind=null}if(this.eatContextual(93))X.local=this.parseIdentifier();else Q=!0,X.local=LG(X.imported)}let Y=A9(X);if(R&&Y)this.raise(n.ImportTypeShorthandOnlyInPureImport,X);if(R||Y)this.checkReservedType(X.local.name,X.local.loc.start,!0);if(Q&&!R&&!Y)this.checkReservedWord(X.local.name,X.loc.start,!0,!0);return this.finishImportSpecifier(X,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(X,W){let R=X.kind;if(R!=="get"&&R!=="set"&&this.match(47))X.typeParameters=this.flowParseTypeParameterDeclaration();super.parseFunctionParams(X,W)}parseVarId(X,W){if(super.parseVarId(X,W),this.match(14))X.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(X.id)}parseAsyncArrowFromCallExpression(X,W){if(this.match(14)){let R=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,X.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=R}return super.parseAsyncArrowFromCallExpression(X,W)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(X,W){var R;let J=null,U;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(J=this.state.clone(),U=this.tryParse(()=>super.parseMaybeAssign(X,W),J),!U.error)return U.node;let{context:Q}=this.state,Y=Q[Q.length-1];if(Y===Ff.j_oTag||Y===Ff.j_expr)Q.pop()}if((R=U)!=null&&R.error||this.match(47)){var V,H;J=J||this.state.clone();let Q,Y=this.tryParse((q)=>{var A;Q=this.flowParseTypeParameterDeclaration();let j=this.forwardNoArrowParamsConversionAt(Q,()=>{let I=super.parseMaybeAssign(X,W);return this.resetStartLocationFromNode(I,Q),I});if((A=j.extra)!=null&&A.parenthesized)q();let b=this.maybeUnwrapTypeCastExpression(j);if(b.type!=="ArrowFunctionExpression")q();return b.typeParameters=Q,this.resetStartLocationFromNode(b,Q),j},J),F=null;if(Y.node&&this.maybeUnwrapTypeCastExpression(Y.node).type==="ArrowFunctionExpression"){if(!Y.error&&!Y.aborted){if(Y.node.async)this.raise(n.UnexpectedTypeParameterBeforeAsyncArrowFunction,Q);return Y.node}F=Y.node}if((V=U)!=null&&V.node)return this.state=U.failState,U.node;if(F)return this.state=Y.failState,F;if((H=U)!=null&&H.thrown)throw U.error;if(Y.thrown)throw Y.error;throw this.raise(n.UnexpectedTokenAfterTypeParameter,Q)}return super.parseMaybeAssign(X,W)}parseArrow(X){if(this.match(14)){let W=this.tryParse(()=>{let R=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let J=this.startNode();if([J.typeAnnotation,X.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=R,this.canInsertSemicolon())this.unexpected();if(!this.match(19))this.unexpected();return J});if(W.thrown)return null;if(W.error)this.state=W.failState;X.returnType=W.node.typeAnnotation?this.finishNode(W.node,"TypeAnnotation"):null}return super.parseArrow(X)}shouldParseArrow(X){return this.match(14)||super.shouldParseArrow(X)}setArrowFunctionParameters(X,W){if(this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(X.start)))X.params=W;else super.setArrowFunctionParameters(X,W)}checkParams(X,W,R,J=!0){if(R&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(X.start)))return;for(let U=0;U<X.params.length;U++)if(this.isThisParam(X.params[U])&&U>0)this.raise(n.ThisParamMustBeFirst,X.params[U]);super.checkParams(X,W,R,J)}parseParenAndDistinguishExpression(X){return super.parseParenAndDistinguishExpression(X&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(X,W,R){if(X.type==="Identifier"&&X.name==="async"&&this.state.noArrowAt.includes(W.index)){this.next();let J=this.startNodeAt(W);J.callee=X,J.arguments=super.parseCallExpressionArguments(11),X=this.finishNode(J,"CallExpression")}else if(X.type==="Identifier"&&X.name==="async"&&this.match(47)){let J=this.state.clone(),U=this.tryParse((H)=>this.parseAsyncArrowWithTypeParameters(W)||H(),J);if(!U.error&&!U.aborted)return U.node;let V=this.tryParse(()=>super.parseSubscripts(X,W,R),J);if(V.node&&!V.error)return V.node;if(U.node)return this.state=U.failState,U.node;if(V.node)return this.state=V.failState,V.node;throw U.error||V.error}return super.parseSubscripts(X,W,R)}parseSubscript(X,W,R,J){if(this.match(18)&&this.isLookaheadToken_lt()){if(J.optionalChainMember=!0,R)return J.stop=!0,X;this.next();let U=this.startNodeAt(W);return U.callee=X,U.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),U.arguments=this.parseCallExpressionArguments(11),U.optional=!0,this.finishCallExpression(U,!0)}else if(!R&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let U=this.startNodeAt(W);U.callee=X;let V=this.tryParse(()=>{if(U.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),U.arguments=super.parseCallExpressionArguments(11),J.optionalChainMember)U.optional=!1;return this.finishCallExpression(U,J.optionalChainMember)});if(V.node){if(V.error)this.state=V.failState;return V.node}}return super.parseSubscript(X,W,R,J)}parseNewCallee(X){super.parseNewCallee(X);let W=null;if(this.shouldParseTypes()&&this.match(47))W=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node;X.typeArguments=W}parseAsyncArrowWithTypeParameters(X){let W=this.startNodeAt(X);if(this.parseFunctionParams(W,!1),!this.parseArrow(W))return;return super.parseArrowExpression(W,void 0,!0)}readToken_mult_modulo(X){let W=this.input.charCodeAt(this.state.pos+1);if(X===42&&W===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(X)}readToken_pipe_amp(X){let W=this.input.charCodeAt(this.state.pos+1);if(X===124&&W===125){this.finishOp(9,2);return}super.readToken_pipe_amp(X)}parseTopLevel(X,W){let R=super.parseTopLevel(X,W);if(this.state.hasFlowComment)this.raise(n.UnterminatedFlowComment,this.state.curPosition());return R}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(n.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let X=this.skipFlowComment();if(X)this.state.pos+=X,this.state.hasFlowComment=!0;return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:X}=this.state,W=2;while([32,9].includes(this.input.charCodeAt(X+W)))W++;let R=this.input.charCodeAt(W+X),J=this.input.charCodeAt(W+X+1);if(R===58&&J===58)return W+2;if(this.input.slice(W+X,W+X+12)==="flow-include")return W+12;if(R===58&&J!==58)return W;return!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise($.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(X,{enumName:W,memberName:R}){this.raise(n.EnumBooleanMemberNotInitialized,X,{memberName:R,enumName:W})}flowEnumErrorInvalidMemberInitializer(X,W){return this.raise(!W.explicitType?n.EnumInvalidMemberInitializerUnknownType:W.explicitType==="symbol"?n.EnumInvalidMemberInitializerSymbolType:n.EnumInvalidMemberInitializerPrimaryType,X,W)}flowEnumErrorNumberMemberNotInitialized(X,W){this.raise(n.EnumNumberMemberNotInitialized,X,W)}flowEnumErrorStringMemberInconsistentlyInitialized(X,W){this.raise(n.EnumStringMemberInconsistentlyInitialized,X,W)}flowEnumMemberInit(){let X=this.state.startLoc,W=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let R=this.parseNumericLiteral(this.state.value);if(W())return{type:"number",loc:R.loc.start,value:R};return{type:"invalid",loc:X}}case 134:{let R=this.parseStringLiteral(this.state.value);if(W())return{type:"string",loc:R.loc.start,value:R};return{type:"invalid",loc:X}}case 85:case 86:{let R=this.parseBooleanLiteral(this.match(85));if(W())return{type:"boolean",loc:R.loc.start,value:R};return{type:"invalid",loc:X}}default:return{type:"invalid",loc:X}}}flowEnumMemberRaw(){let X=this.state.startLoc,W=this.parseIdentifier(!0),R=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:X};return{id:W,init:R}}flowEnumCheckExplicitTypeMismatch(X,W,R){let{explicitType:J}=W;if(J===null)return;if(J!==R)this.flowEnumErrorInvalidMemberInitializer(X,W)}flowEnumMembers({enumName:X,explicitType:W}){let R=new Set,J={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},U=!1;while(!this.match(8)){if(this.eat(21)){U=!0;break}let V=this.startNode(),{id:H,init:Q}=this.flowEnumMemberRaw(),Y=H.name;if(Y==="")continue;if(/^[a-z]/.test(Y))this.raise(n.EnumInvalidMemberName,H,{memberName:Y,suggestion:Y[0].toUpperCase()+Y.slice(1),enumName:X});if(R.has(Y))this.raise(n.EnumDuplicateMemberName,H,{memberName:Y,enumName:X});R.add(Y);let F={enumName:X,explicitType:W,memberName:Y};switch(V.id=H,Q.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(Q.loc,F,"boolean"),V.init=Q.value,J.booleanMembers.push(this.finishNode(V,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(Q.loc,F,"number"),V.init=Q.value,J.numberMembers.push(this.finishNode(V,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(Q.loc,F,"string"),V.init=Q.value,J.stringMembers.push(this.finishNode(V,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(Q.loc,F);case"none":switch(W){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(Q.loc,F);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(Q.loc,F);break;default:J.defaultedMembers.push(this.finishNode(V,"EnumDefaultedMember"))}}if(!this.match(8))this.expect(12)}return{members:J,hasUnknownMembers:U}}flowEnumStringMembers(X,W,{enumName:R}){if(X.length===0)return W;else if(W.length===0)return X;else if(W.length>X.length){for(let J of X)this.flowEnumErrorStringMemberInconsistentlyInitialized(J,{enumName:R});return W}else{for(let J of W)this.flowEnumErrorStringMemberInconsistentlyInitialized(J,{enumName:R});return X}}flowEnumParseExplicitType({enumName:X}){if(!this.eatContextual(102))return null;if(!$f(this.state.type))throw this.raise(n.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:X});let{value:W}=this.state;if(this.next(),W!=="boolean"&&W!=="number"&&W!=="string"&&W!=="symbol")this.raise(n.EnumInvalidExplicitType,this.state.startLoc,{enumName:X,invalidEnumType:W});return W}flowEnumBody(X,W){let R=W.name,J=W.loc.start,U=this.flowEnumParseExplicitType({enumName:R});this.expect(5);let{members:V,hasUnknownMembers:H}=this.flowEnumMembers({enumName:R,explicitType:U});switch(X.hasUnknownMembers=H,U){case"boolean":return X.explicitType=!0,X.members=V.booleanMembers,this.expect(8),this.finishNode(X,"EnumBooleanBody");case"number":return X.explicitType=!0,X.members=V.numberMembers,this.expect(8),this.finishNode(X,"EnumNumberBody");case"string":return X.explicitType=!0,X.members=this.flowEnumStringMembers(V.stringMembers,V.defaultedMembers,{enumName:R}),this.expect(8),this.finishNode(X,"EnumStringBody");case"symbol":return X.members=V.defaultedMembers,this.expect(8),this.finishNode(X,"EnumSymbolBody");default:{let Q=()=>{return X.members=[],this.expect(8),this.finishNode(X,"EnumStringBody")};X.explicitType=!1;let Y=V.booleanMembers.length,F=V.numberMembers.length,q=V.stringMembers.length,A=V.defaultedMembers.length;if(!Y&&!F&&!q&&!A)return Q();else if(!Y&&!F)return X.members=this.flowEnumStringMembers(V.stringMembers,V.defaultedMembers,{enumName:R}),this.expect(8),this.finishNode(X,"EnumStringBody");else if(!F&&!q&&Y>=A){for(let j of V.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(j.loc.start,{enumName:R,memberName:j.id.name});return X.members=V.booleanMembers,this.expect(8),this.finishNode(X,"EnumBooleanBody")}else if(!Y&&!q&&F>=A){for(let j of V.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(j.loc.start,{enumName:R,memberName:j.id.name});return X.members=V.numberMembers,this.expect(8),this.finishNode(X,"EnumNumberBody")}else return this.raise(n.EnumInconsistentMemberValues,J,{enumName:R}),Q()}}}flowParseEnumDeclaration(X){let W=this.parseIdentifier();return X.id=W,X.body=this.flowEnumBody(this.startNode(),W),this.finishNode(X,"EnumDeclaration")}jsxParseOpeningElementAfterName(X){if(this.shouldParseTypes()){if(this.match(47)||this.match(51))X.typeArguments=this.flowParseTypeParameterInstantiationInExpression()}return super.jsxParseOpeningElementAfterName(X)}isLookaheadToken_lt(){let X=this.nextTokenStart();if(this.input.charCodeAt(X)===60){let W=this.input.charCodeAt(X+1);return W!==60&&W!==61}return!1}reScan_lt_gt(){let{type:X}=this.state;if(X===47)this.state.pos-=1,this.readToken_lt();else if(X===48)this.state.pos-=1,this.readToken_gt()}reScan_lt(){let{type:X}=this.state;if(X===51)return this.state.pos-=2,this.finishOp(47,1),47;return X}maybeUnwrapTypeCastExpression(X){return X.type==="TypeCastExpression"?X.expression:X}},KJf={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},oG=TG`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:f})=>`Expected corresponding JSX closing tag for <${f}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:f,HTMLEntity:G})=>`Unexpected token \`${f}\`. Did you mean \`${G}\` or \`{'${f}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function yG(f){return f?f.type==="JSXOpeningFragment"||f.type==="JSXClosingFragment":!1}function C1(f){if(f.type==="JSXIdentifier")return f.name;if(f.type==="JSXNamespacedName")return f.namespace.name+":"+f.name.name;if(f.type==="JSXMemberExpression")return C1(f.object)+"."+C1(f.property);throw new Error("Node had unexpected type: "+f.type)}var SJf=(f)=>class G extends f{jsxReadToken(){let X="",W=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(oG.UnterminatedJsxContent,this.state.startLoc);let R=this.input.charCodeAt(this.state.pos);switch(R){case 60:case 123:if(this.state.pos===this.state.start){if(R===60&&this.state.canStartJSXElement)++this.state.pos,this.finishToken(143);else super.getTokenFromCode(R);return}X+=this.input.slice(W,this.state.pos),this.finishToken(142,X);return;case 38:X+=this.input.slice(W,this.state.pos),X+=this.jsxReadEntity(),W=this.state.pos;break;case 62:case 125:default:if(A1(R))X+=this.input.slice(W,this.state.pos),X+=this.jsxReadNewLine(!0),W=this.state.pos;else++this.state.pos}}}jsxReadNewLine(X){let W=this.input.charCodeAt(this.state.pos),R;if(++this.state.pos,W===13&&this.input.charCodeAt(this.state.pos)===10)++this.state.pos,R=X?`
|
|
21
21
|
`:`\r
|
|
22
22
|
`;else R=String.fromCharCode(W);return++this.state.curLine,this.state.lineStart=this.state.pos,R}jsxReadString(X){let W="",R=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise($.UnterminatedString,this.state.startLoc);let J=this.input.charCodeAt(this.state.pos);if(J===X)break;if(J===38)W+=this.input.slice(R,this.state.pos),W+=this.jsxReadEntity(),R=this.state.pos;else if(A1(J))W+=this.input.slice(R,this.state.pos),W+=this.jsxReadNewLine(!1),R=this.state.pos;else++this.state.pos}W+=this.input.slice(R,this.state.pos++),this.finishToken(134,W)}jsxReadEntity(){let X=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let W=10;if(this.codePointAtPos(this.state.pos)===120)W=16,++this.state.pos;let R=this.readInt(W,void 0,!1,"bail");if(R!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(R)}else{let W=0,R=!1;while(W++<10&&this.state.pos<this.length&&!(R=this.codePointAtPos(this.state.pos)===59))++this.state.pos;if(R){let J=this.input.slice(X,this.state.pos),U=KJf[J];if(++this.state.pos,U)return U}}return this.state.pos=X,"&"}jsxReadWord(){let X,W=this.state.pos;do X=this.input.charCodeAt(++this.state.pos);while(q1(X)||X===45);this.finishToken(141,this.input.slice(W,this.state.pos))}jsxParseIdentifier(){let X=this.startNode();if(this.match(141))X.name=this.state.value;else if(ER(this.state.type))X.name=xG(this.state.type);else this.unexpected();return this.next(),this.finishNode(X,"JSXIdentifier")}jsxParseNamespacedName(){let X=this.state.startLoc,W=this.jsxParseIdentifier();if(!this.eat(14))return W;let R=this.startNodeAt(X);return R.namespace=W,R.name=this.jsxParseIdentifier(),this.finishNode(R,"JSXNamespacedName")}jsxParseElementName(){let X=this.state.startLoc,W=this.jsxParseNamespacedName();if(W.type==="JSXNamespacedName")return W;while(this.eat(16)){let R=this.startNodeAt(X);R.object=W,R.property=this.jsxParseIdentifier(),W=this.finishNode(R,"JSXMemberExpression")}return W}jsxParseAttributeValue(){let X;switch(this.state.type){case 5:if(X=this.startNode(),this.setContext(Ff.brace),this.next(),X=this.jsxParseExpressionContainer(X,Ff.j_oTag),X.expression.type==="JSXEmptyExpression")this.raise(oG.AttributeIsEmpty,X);return X;case 143:case 134:return this.parseExprAtom();default:throw this.raise(oG.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let X=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(X,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(X){return this.next(),X.expression=this.parseExpression(),this.setContext(Ff.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(X,"JSXSpreadChild")}jsxParseExpressionContainer(X,W){if(this.match(8))X.expression=this.jsxParseEmptyExpression();else{let R=this.parseExpression();X.expression=R}return this.setContext(W),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(X,"JSXExpressionContainer")}jsxParseAttribute(){let X=this.startNode();if(this.match(5))return this.setContext(Ff.brace),this.next(),this.expect(21),X.argument=this.parseMaybeAssignAllowIn(),this.setContext(Ff.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(X,"JSXSpreadAttribute");return X.name=this.jsxParseNamespacedName(),X.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(X,"JSXAttribute")}jsxParseOpeningElementAt(X){let W=this.startNodeAt(X);if(this.eat(144))return this.finishNode(W,"JSXOpeningFragment");return W.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(W)}jsxParseOpeningElementAfterName(X){let W=[];while(!this.match(56)&&!this.match(144))W.push(this.jsxParseAttribute());return X.attributes=W,X.selfClosing=this.eat(56),this.expect(144),this.finishNode(X,"JSXOpeningElement")}jsxParseClosingElementAt(X){let W=this.startNodeAt(X);if(this.eat(144))return this.finishNode(W,"JSXClosingFragment");return W.name=this.jsxParseElementName(),this.expect(144),this.finishNode(W,"JSXClosingElement")}jsxParseElementAt(X){let W=this.startNodeAt(X),R=[],J=this.jsxParseOpeningElementAt(X),U=null;if(!J.selfClosing){f:for(;;)switch(this.state.type){case 143:if(X=this.state.startLoc,this.next(),this.eat(56)){U=this.jsxParseClosingElementAt(X);break f}R.push(this.jsxParseElementAt(X));break;case 142:R.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let V=this.startNode();if(this.setContext(Ff.brace),this.next(),this.match(21))R.push(this.jsxParseSpreadChild(V));else R.push(this.jsxParseExpressionContainer(V,Ff.j_expr));break}default:this.unexpected()}if(yG(J)&&!yG(U)&&U!==null)this.raise(oG.MissingClosingTagFragment,U);else if(!yG(J)&&yG(U))this.raise(oG.MissingClosingTagElement,U,{openingTagName:C1(J.name)});else if(!yG(J)&&!yG(U)){if(C1(U.name)!==C1(J.name))this.raise(oG.MissingClosingTagElement,U,{openingTagName:C1(J.name)})}}if(yG(J))W.openingFragment=J,W.closingFragment=U;else W.openingElement=J,W.closingElement=U;if(W.children=R,this.match(47))throw this.raise(oG.UnwrappedAdjacentJSXElements,this.state.startLoc);return yG(J)?this.finishNode(W,"JSXFragment"):this.finishNode(W,"JSXElement")}jsxParseElement(){let X=this.state.startLoc;return this.next(),this.jsxParseElementAt(X)}setContext(X){let{context:W}=this.state;W[W.length-1]=X}parseExprAtom(X){if(this.match(143))return this.jsxParseElement();else if(this.match(47)&&this.input.charCodeAt(this.state.pos)!==33)return this.replaceToken(143),this.jsxParseElement();else return super.parseExprAtom(X)}skipSpace(){if(!this.curContext().preserveSpace)super.skipSpace()}getTokenFromCode(X){let W=this.curContext();if(W===Ff.j_expr){this.jsxReadToken();return}if(W===Ff.j_oTag||W===Ff.j_cTag){if(IG(X)){this.jsxReadWord();return}if(X===62){++this.state.pos,this.finishToken(144);return}if((X===34||X===39)&&W===Ff.j_oTag){this.jsxReadString(X);return}}if(X===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(143);return}super.getTokenFromCode(X)}updateContext(X){let{context:W,type:R}=this.state;if(R===56&&X===143)W.splice(-2,2,Ff.j_cTag),this.state.canStartJSXElement=!1;else if(R===143)W.push(Ff.j_oTag);else if(R===144){let J=W[W.length-1];if(J===Ff.j_oTag&&X===56||J===Ff.j_cTag)W.pop(),this.state.canStartJSXElement=W[W.length-1]===Ff.j_expr;else this.setContext(Ff.j_expr),this.state.canStartJSXElement=!0}else this.state.canStartJSXElement=wRf(R)}};class t9 extends VW{constructor(...f){super(...f);this.tsNames=new Map}}class n9 extends HW{constructor(...f){super(...f);this.importsStack=[]}createScope(f){return this.importsStack.push(new Set),new t9(f)}enter(f){if(f===256)this.importsStack.push(new Set);super.enter(f)}exit(){let f=super.exit();if(f===256)this.importsStack.pop();return f}hasImport(f,G){let X=this.importsStack.length;if(this.importsStack[X-1].has(f))return!0;if(!G&&X>1){for(let W=0;W<X-1;W++)if(this.importsStack[W].has(f))return!0}return!1}declareName(f,G,X){if(G&4096){if(this.hasImport(f,!0))this.parser.raise($.VarRedeclaration,X,{identifierName:f});this.importsStack[this.importsStack.length-1].add(f);return}let W=this.currentScope(),R=W.tsNames.get(f)||0;if(G&1024){this.maybeExportDefined(W,f),W.tsNames.set(f,R|16);return}if(super.declareName(f,G,X),G&2){if(!(G&1))this.checkRedeclarationInScope(W,f,G,X),this.maybeExportDefined(W,f);R=R|1}if(G&256)R=R|2;if(G&512)R=R|4;if(G&128)R=R|8;if(R)W.tsNames.set(f,R)}isRedeclaredInScope(f,G,X){let W=f.tsNames.get(G);if((W&2)>0){if(X&256){let R=!!(X&512),J=(W&4)>0;return R!==J}return!0}if(X&128&&(W&8)>0)if(f.names.get(G)&2)return!!(X&1);else return!1;if(X&2&&(W&1)>0)return!0;return super.isRedeclaredInScope(f,G,X)}checkLocalExport(f){let{name:G}=f;if(this.hasImport(G))return;let X=this.scopeStack.length;for(let W=X-1;W>=0;W--){let J=this.scopeStack[W].tsNames.get(G);if((J&1)>0||(J&16)>0)return}super.checkLocalExport(f)}}var o9=(f)=>{return f.type==="ParenthesizedExpression"?o9(f.expression):f};class e9 extends d9{toAssignable(f,G=!1){var X,W;let R=void 0;if(f.type==="ParenthesizedExpression"||(X=f.extra)!=null&&X.parenthesized)if(R=o9(f),G){if(R.type==="Identifier")this.expressionScope.recordArrowParameterBindingError($.InvalidParenthesizedAssignment,f);else if(R.type!=="MemberExpression"&&!this.isOptionalMemberExpression(R))this.raise($.InvalidParenthesizedAssignment,f)}else this.raise($.InvalidParenthesizedAssignment,f);switch(f.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":f.type="ObjectPattern";for(let U=0,V=f.properties.length,H=V-1;U<V;U++){var J;let Q=f.properties[U],Y=U===H;if(this.toAssignableObjectExpressionProp(Q,Y,G),Y&&Q.type==="RestElement"&&(J=f.extra)!=null&&J.trailingCommaLoc)this.raise($.RestTrailingComma,f.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:U,value:V}=f;if(this.isPrivateName(U))this.classScope.usePrivateName(this.getPrivateNameSV(U),U.loc.start);this.toAssignable(V,G);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":f.type="ArrayPattern",this.toAssignableList(f.elements,(W=f.extra)==null?void 0:W.trailingCommaLoc,G);break;case"AssignmentExpression":if(f.operator!=="=")this.raise($.MissingEqInAssignment,f.left.loc.end);f.type="AssignmentPattern",delete f.operator,this.toAssignable(f.left,G);break;case"ParenthesizedExpression":this.toAssignable(R,G);break}}toAssignableObjectExpressionProp(f,G,X){if(f.type==="ObjectMethod")this.raise(f.kind==="get"||f.kind==="set"?$.PatternHasAccessor:$.PatternHasMethod,f.key);else if(f.type==="SpreadElement"){f.type="RestElement";let W=f.argument;if(this.checkToRestConversion(W,!1),this.toAssignable(W,X),!G)this.raise($.RestTrailingComma,f)}else this.toAssignable(f,X)}toAssignableList(f,G,X){let W=f.length-1;for(let R=0;R<=W;R++){let J=f[R];if(!J)continue;if(this.toAssignableListItem(f,R,X),J.type==="RestElement"){if(R<W)this.raise($.RestTrailingComma,J);else if(G)this.raise($.RestTrailingComma,G)}}}toAssignableListItem(f,G,X){let W=f[G];if(W.type==="SpreadElement"){W.type="RestElement";let R=W.argument;this.checkToRestConversion(R,!0),this.toAssignable(R,X)}else this.toAssignable(W,X)}isAssignable(f,G){switch(f.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let X=f.properties.length-1;return f.properties.every((W,R)=>{return W.type!=="ObjectMethod"&&(R===X||W.type!=="SpreadElement")&&this.isAssignable(W)})}case"ObjectProperty":return this.isAssignable(f.value);case"SpreadElement":return this.isAssignable(f.argument);case"ArrayExpression":return f.elements.every((X)=>X===null||this.isAssignable(X));case"AssignmentExpression":return f.operator==="=";case"ParenthesizedExpression":return this.isAssignable(f.expression);case"MemberExpression":case"OptionalMemberExpression":return!G;default:return!1}}toReferencedList(f,G){return f}toReferencedListDeep(f,G){this.toReferencedList(f,G);for(let X of f)if((X==null?void 0:X.type)==="ArrayExpression")this.toReferencedListDeep(X.elements)}parseSpread(f){let G=this.startNode();return this.next(),G.argument=this.parseMaybeAssignAllowIn(f,void 0),this.finishNode(G,"SpreadElement")}parseRestBinding(){let f=this.startNode();return this.next(),f.argument=this.parseBindingAtom(),this.finishNode(f,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let f=this.startNode();return this.next(),f.elements=this.parseBindingList(3,93,1),this.finishNode(f,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(f,G,X){let W=X&1,R=[],J=!0;while(!this.eat(f)){if(J)J=!1;else this.expect(12);if(W&&this.match(12))R.push(null);else if(this.eat(f))break;else if(this.match(21)){let U=this.parseRestBinding();if(this.hasPlugin("flow")||X&2)U=this.parseFunctionParamType(U);if(R.push(U),!this.checkCommaAfterRest(G)){this.expect(f);break}}else{let U=[];if(X&2){if(this.match(26)&&this.hasPlugin("decorators"))this.raise($.UnsupportedParameterDecorator,this.state.startLoc);while(this.match(26))U.push(this.parseDecorator())}R.push(this.parseBindingElement(X,U))}}return R}parseBindingRestProperty(f){return this.next(),f.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(f,"RestElement")}parseBindingProperty(){let{type:f,startLoc:G}=this.state;if(f===21)return this.parseBindingRestProperty(this.startNode());let X=this.startNode();if(f===139)this.expectPlugin("destructuringPrivate",G),this.classScope.usePrivateName(this.state.value,G),X.key=this.parsePrivateName();else this.parsePropertyName(X);return X.method=!1,this.parseObjPropValue(X,G,!1,!1,!0,!1)}parseBindingElement(f,G){let X=this.parseMaybeDefault();if(this.hasPlugin("flow")||f&2)this.parseFunctionParamType(X);let W=this.parseMaybeDefault(X.loc.start,X);if(G.length)X.decorators=G;return W}parseFunctionParamType(f){return f}parseMaybeDefault(f,G){if(f!=null||(f=this.state.startLoc),G=G!=null?G:this.parseBindingAtom(),!this.eat(29))return G;let X=this.startNodeAt(f);return X.left=G,X.right=this.parseMaybeAssignAllowIn(),this.finishNode(X,"AssignmentPattern")}isValidLVal(f,G,X){switch(f){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(f){return f.type==="OptionalMemberExpression"}checkLVal(f,G,X=64,W=!1,R=!1,J=!1){var U;let V=f.type;if(this.isObjectMethod(f))return;let H=this.isOptionalMemberExpression(f);if(H||V==="MemberExpression"){if(H){if(this.expectPlugin("optionalChainingAssign",f.loc.start),G.type!=="AssignmentExpression")this.raise($.InvalidLhsOptionalChaining,f,{ancestor:G})}if(X!==64)this.raise($.InvalidPropertyBindingPattern,f);return}if(V==="Identifier"){this.checkIdentifier(f,X,R);let{name:j}=f;if(W)if(W.has(j))this.raise($.ParamDupe,f);else W.add(j);return}let Q=this.isValidLVal(V,!(J||(U=f.extra)!=null&&U.parenthesized)&&G.type==="AssignmentExpression",X);if(Q===!0)return;if(Q===!1){let j=X===64?$.InvalidLhs:$.InvalidLhsBinding;this.raise(j,f,{ancestor:G});return}let Y,F;if(typeof Q==="string")Y=Q,F=V==="ParenthesizedExpression";else[Y,F]=Q;let q=V==="ArrayPattern"||V==="ObjectPattern"?{type:V}:G,A=f[Y];if(Array.isArray(A)){for(let j of A)if(j)this.checkLVal(j,q,X,W,R,F)}else if(A)this.checkLVal(A,q,X,W,R,F)}checkIdentifier(f,G,X=!1){if(this.state.strict&&(X?v9(f.name,this.inModule):k9(f.name)))if(G===64)this.raise($.StrictEvalArguments,f,{referenceName:f.name});else this.raise($.StrictEvalArgumentsBinding,f,{bindingName:f.name});if(G&8192&&f.name==="let")this.raise($.LetInLexicalBinding,f);if(!(G&64))this.declareNameFromIdentifier(f,G)}declareNameFromIdentifier(f,G){this.scope.declareName(f.name,G,f.loc.start)}checkToRestConversion(f,G){switch(f.type){case"ParenthesizedExpression":this.checkToRestConversion(f.expression,G);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(G)break;default:this.raise($.InvalidRestAssignmentPattern,f)}}checkCommaAfterRest(f){if(!this.match(12))return!1;return this.raise(this.lookaheadCharCode()===f?$.RestTrailingComma:$.ElementAfterRest,this.state.startLoc),!0}}function FJf(f){if(f==null)throw new Error(`Unexpected ${f} value.`);return f}function O9(f){if(!f)throw new Error("Assert fail")}var i=TG`typescript`({AbstractMethodHasImplementation:({methodName:f})=>`Method '${f}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:f})=>`Property '${f}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:f})=>`'declare' is not allowed in ${f}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:f})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:f})=>`Duplicate modifier: '${f}'.`,EmptyHeritageClauseType:({token:f})=>`'${f}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:f})=>`'${f[0]}' modifier cannot be used with '${f[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:f})=>`Index signatures cannot have an accessibility modifier ('${f}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidHeritageClauseType:({token:f})=>`'${f}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnTypeMember:({modifier:f})=>`'${f}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:f})=>`'${f}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:f})=>`'${f}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:f})=>`'${f[0]}' modifier must precede '${f[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:f})=>`Private elements cannot have an accessibility modifier ('${f}').`,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:({typeParameterName:f})=>`Single type parameter ${f} should have a trailing comma. Example usage: <${f},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:f})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${f}.`});function $Jf(f){switch(f){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function j9(f){return f==="private"||f==="public"||f==="protected"}function CJf(f){return f==="in"||f==="out"}var qJf=(f)=>class G extends f{constructor(...X){super(...X);this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:i.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:i.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:i.InvalidModifierOnTypeParameter})}getScopeHandler(){return n9}tsIsIdentifier(){return $f(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){if(this.next(),this.hasPrecedingLineBreak())return!1;return this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){if(this.match(106))return this.next(),this.tsTokenCanFollowModifier();return this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(X,W){if(!$f(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let R=this.state.value;if(X.includes(R)){if(W&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return R}return}tsParseModifiers({allowedModifiers:X,disallowedModifiers:W,stopOnStartOfClassStaticBlock:R,errorTemplate:J=i.InvalidModifierOnTypeMember},U){let V=(Q,Y,F,q)=>{if(Y===F&&U[q])this.raise(i.InvalidModifiersOrder,Q,{orderedModifiers:[F,q]})},H=(Q,Y,F,q)=>{if(U[F]&&Y===q||U[q]&&Y===F)this.raise(i.IncompatibleModifiers,Q,{modifiers:[F,q]})};for(;;){let{startLoc:Q}=this.state,Y=this.tsParseModifier(X.concat(W!=null?W:[]),R);if(!Y)break;if(j9(Y))if(U.accessibility)this.raise(i.DuplicateAccessibilityModifier,Q,{modifier:Y});else V(Q,Y,Y,"override"),V(Q,Y,Y,"static"),V(Q,Y,Y,"readonly"),U.accessibility=Y;else if(CJf(Y)){if(U[Y])this.raise(i.DuplicateModifier,Q,{modifier:Y});U[Y]=!0,V(Q,Y,"in","out")}else{if(hasOwnProperty.call(U,Y))this.raise(i.DuplicateModifier,Q,{modifier:Y});else V(Q,Y,"static","readonly"),V(Q,Y,"static","override"),V(Q,Y,"override","readonly"),V(Q,Y,"abstract","override"),H(Q,Y,"declare","override"),H(Q,Y,"static","abstract");U[Y]=!0}if(W!=null&&W.includes(Y))this.raise(J,Q,{modifier:Y})}}tsIsListTerminator(X){switch(X){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(X,W){let R=[];while(!this.tsIsListTerminator(X))R.push(W());return R}tsParseDelimitedList(X,W,R){return FJf(this.tsParseDelimitedListWorker(X,W,!0,R))}tsParseDelimitedListWorker(X,W,R,J){let U=[],V=-1;for(;;){if(this.tsIsListTerminator(X))break;V=-1;let H=W();if(H==null)return;if(U.push(H),this.eat(12)){V=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(X))break;if(R)this.expect(12);return}if(J)J.value=V;return U}tsParseBracketedList(X,W,R,J,U){if(!J)if(R)this.expect(0);else this.expect(47);let V=this.tsParseDelimitedList(X,W,U);if(R)this.expect(3);else this.expect(48);return V}tsParseImportType(){let X=this.startNode();if(this.expect(83),this.expect(10),!this.match(134))this.raise(i.UnsupportedImportTypeArgument,this.state.startLoc),X.argument=super.parseExprAtom();else X.argument=this.parseStringLiteral(this.state.value);if(this.eat(12)&&!this.match(11))X.options=super.parseMaybeAssignAllowIn(),this.eat(12);else X.options=null;if(this.expect(11),this.eat(16))X.qualifier=this.tsParseEntityName(3);if(this.match(47))X.typeParameters=this.tsParseTypeArguments();return this.finishNode(X,"TSImportType")}tsParseEntityName(X){let W;if(X&1&&this.match(78))if(X&2)W=this.parseIdentifier(!0);else{let R=this.startNode();this.next(),W=this.finishNode(R,"ThisExpression")}else W=this.parseIdentifier(!!(X&1));while(this.eat(16)){let R=this.startNodeAtNode(W);R.left=W,R.right=this.parseIdentifier(!!(X&1)),W=this.finishNode(R,"TSQualifiedName")}return W}tsParseTypeReference(){let X=this.startNode();if(X.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47))X.typeParameters=this.tsParseTypeArguments();return this.finishNode(X,"TSTypeReference")}tsParseThisTypePredicate(X){this.next();let W=this.startNodeAtNode(X);return W.parameterName=X,W.typeAnnotation=this.tsParseTypeAnnotation(!1),W.asserts=!1,this.finishNode(W,"TSTypePredicate")}tsParseThisTypeNode(){let X=this.startNode();return this.next(),this.finishNode(X,"TSThisType")}tsParseTypeQuery(){let X=this.startNode();if(this.expect(87),this.match(83))X.exprName=this.tsParseImportType();else X.exprName=this.tsParseEntityName(3);if(!this.hasPrecedingLineBreak()&&this.match(47))X.typeParameters=this.tsParseTypeArguments();return this.finishNode(X,"TSTypeQuery")}tsParseTypeParameter(X){let W=this.startNode();return X(W),W.name=this.tsParseTypeParameterName(),W.constraint=this.tsEatThenParseType(81),W.default=this.tsEatThenParseType(29),this.finishNode(W,"TSTypeParameter")}tsTryParseTypeParameters(X){if(this.match(47))return this.tsParseTypeParameters(X)}tsParseTypeParameters(X){let W=this.startNode();if(this.match(47)||this.match(143))this.next();else this.unexpected();let R={value:-1};if(W.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,X),!1,!0,R),W.params.length===0)this.raise(i.EmptyTypeParameters,W);if(R.value!==-1)this.addExtra(W,"trailingComma",R.value);return this.finishNode(W,"TSTypeParameterDeclaration")}tsFillSignature(X,W){let R=X===19,J="parameters",U="typeAnnotation";if(W.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),W.parameters=this.tsParseBindingListForSignature(),R)W.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(X);else if(this.match(X))W.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(X)}tsParseBindingListForSignature(){let X=super.parseBindingList(11,41,2);for(let W of X){let{type:R}=W;if(R==="AssignmentPattern"||R==="TSParameterProperty")this.raise(i.UnsupportedSignatureParameterKind,W,{type:R})}return X}tsParseTypeMemberSemicolon(){if(!this.eat(12)&&!this.isLineTerminator())this.expect(13)}tsParseSignatureMember(X,W){return this.tsFillSignature(14,W),this.tsParseTypeMemberSemicolon(),this.finishNode(W,X)}tsIsUnambiguouslyIndexSignature(){if(this.next(),$f(this.state.type))return this.next(),this.match(14);return!1}tsTryParseIndexSignature(X){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let W=this.parseIdentifier();W.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(W),this.expect(3),X.parameters=[W];let R=this.tsTryParseTypeAnnotation();if(R)X.typeAnnotation=R;return this.tsParseTypeMemberSemicolon(),this.finishNode(X,"TSIndexSignature")}tsParsePropertyOrMethodSignature(X,W){if(this.eat(17))X.optional=!0;let R=X;if(this.match(10)||this.match(47)){if(W)this.raise(i.ReadonlyForMethodSignature,X);let J=R;if(J.kind&&this.match(47))this.raise(i.AccessorCannotHaveTypeParameters,this.state.curPosition());this.tsFillSignature(14,J),this.tsParseTypeMemberSemicolon();let U="parameters",V="typeAnnotation";if(J.kind==="get"){if(J[U].length>0){if(this.raise($.BadGetterArity,this.state.curPosition()),this.isThisParam(J[U][0]))this.raise(i.AccessorCannotDeclareThisParameter,this.state.curPosition())}}else if(J.kind==="set"){if(J[U].length!==1)this.raise($.BadSetterArity,this.state.curPosition());else{let H=J[U][0];if(this.isThisParam(H))this.raise(i.AccessorCannotDeclareThisParameter,this.state.curPosition());if(H.type==="Identifier"&&H.optional)this.raise(i.SetAccessorCannotHaveOptionalParameter,this.state.curPosition());if(H.type==="RestElement")this.raise(i.SetAccessorCannotHaveRestParameter,this.state.curPosition())}if(J[V])this.raise(i.SetAccessorCannotHaveReturnType,J[V])}else J.kind="method";return this.finishNode(J,"TSMethodSignature")}else{let J=R;if(W)J.readonly=!0;let U=this.tsTryParseTypeAnnotation();if(U)J.typeAnnotation=U;return this.tsParseTypeMemberSemicolon(),this.finishNode(J,"TSPropertySignature")}}tsParseTypeMember(){let X=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",X);if(this.match(77)){let R=this.startNode();if(this.next(),this.match(10)||this.match(47))return this.tsParseSignatureMember("TSConstructSignatureDeclaration",X);else return X.key=this.createIdentifier(R,"new"),this.tsParsePropertyOrMethodSignature(X,!1)}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},X);let W=this.tsTryParseIndexSignature(X);if(W)return W;if(super.parsePropertyName(X),!X.computed&&X.key.type==="Identifier"&&(X.key.name==="get"||X.key.name==="set")&&this.tsTokenCanFollowModifier())X.kind=X.key.name,super.parsePropertyName(X);return this.tsParsePropertyOrMethodSignature(X,!!X.readonly)}tsParseTypeLiteral(){let X=this.startNode();return X.members=this.tsParseObjectTypeMembers(),this.finishNode(X,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let X=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),X}tsIsStartOfMappedType(){if(this.next(),this.eat(53))return this.isContextual(122);if(this.isContextual(122))this.next();if(!this.match(0))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(58)}tsParseMappedType(){let X=this.startNode();if(this.expect(5),this.match(53))X.readonly=this.state.value,this.next(),this.expectContextual(122);else if(this.eatContextual(122))X.readonly=!0;this.expect(0);{let W=this.startNode();W.name=this.tsParseTypeParameterName(),W.constraint=this.tsExpectThenParseType(58),X.typeParameter=this.finishNode(W,"TSTypeParameter")}if(X.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53))X.optional=this.state.value,this.next(),this.expect(17);else if(this.eat(17))X.optional=!0;return X.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(X,"TSMappedType")}tsParseTupleType(){let X=this.startNode();X.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let W=!1;return X.elementTypes.forEach((R)=>{let{type:J}=R;if(W&&J!=="TSRestType"&&J!=="TSOptionalType"&&!(J==="TSNamedTupleMember"&&R.optional))this.raise(i.OptionalTypeBeforeRequired,R);W||(W=J==="TSNamedTupleMember"&&R.optional||J==="TSOptionalType")}),this.finishNode(X,"TSTupleType")}tsParseTupleElementType(){let X=this.state.startLoc,W=this.eat(21),{startLoc:R}=this.state,J,U,V,H,Y=HG(this.state.type)?this.lookaheadCharCode():null;if(Y===58)J=!0,V=!1,U=this.parseIdentifier(!0),this.expect(14),H=this.tsParseType();else if(Y===63){V=!0;let F=this.state.value,q=this.tsParseNonArrayType();if(this.lookaheadCharCode()===58)J=!0,U=this.createIdentifier(this.startNodeAt(R),F),this.expect(17),this.expect(14),H=this.tsParseType();else J=!1,H=q,this.expect(17)}else H=this.tsParseType(),V=this.eat(17),J=this.eat(14);if(J){let F;if(U){if(F=this.startNodeAt(R),F.optional=V,F.label=U,F.elementType=H,this.eat(17))F.optional=!0,this.raise(i.TupleOptionalAfterType,this.state.lastTokStartLoc)}else F=this.startNodeAt(R),F.optional=V,this.raise(i.InvalidTupleMemberLabel,H),F.label=H,F.elementType=this.tsParseType();H=this.finishNode(F,"TSNamedTupleMember")}else if(V){let F=this.startNodeAt(R);F.typeAnnotation=H,H=this.finishNode(F,"TSOptionalType")}if(W){let F=this.startNodeAt(X);F.typeAnnotation=H,H=this.finishNode(F,"TSRestType")}return H}tsParseParenthesizedType(){let X=this.startNode();return this.expect(10),X.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(X,"TSParenthesizedType")}tsParseFunctionOrConstructorType(X,W){let R=this.startNode();if(X==="TSConstructorType"){if(R.abstract=!!W,W)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,R)),this.finishNode(R,X)}tsParseLiteralTypeNode(){let X=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:X.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(X,"TSLiteralType")}tsParseTemplateLiteralType(){{let X=this.startNode();return X.literal=super.parseTemplate(!1),this.finishNode(X,"TSLiteralType")}}parseTemplateSubstitution(){if(this.state.inType)return this.tsParseType();return super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let X=this.tsParseThisTypeNode();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate(X);else return X}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 X=this.startNode(),W=this.lookahead();if(W.type!==135&&W.type!==136)this.unexpected();return X.literal=this.parseMaybeUnary(),this.finishNode(X,"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:X}=this.state;if($f(X)||X===88||X===84){let W=X===88?"TSVoidKeyword":X===84?"TSNullKeyword":$Jf(this.state.value);if(W!==void 0&&this.lookaheadCharCode()!==46){let R=this.startNode();return this.next(),this.finishNode(R,W)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:X}=this.state,W=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(0))if(this.match(3)){let R=this.startNodeAt(X);R.elementType=W,this.expect(3),W=this.finishNode(R,"TSArrayType")}else{let R=this.startNodeAt(X);R.objectType=W,R.indexType=this.tsParseType(),this.expect(3),W=this.finishNode(R,"TSIndexedAccessType")}return W}tsParseTypeOperator(){let X=this.startNode(),W=this.state.value;if(this.next(),X.operator=W,X.typeAnnotation=this.tsParseTypeOperatorOrHigher(),W==="readonly")this.tsCheckTypeAnnotationForReadOnly(X);return this.finishNode(X,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(X){switch(X.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(i.UnexpectedReadonly,X)}}tsParseInferType(){let X=this.startNode();this.expectContextual(115);let W=this.startNode();return W.name=this.tsParseTypeParameterName(),W.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),X.typeParameter=this.finishNode(W,"TSTypeParameter"),this.finishNode(X,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let X=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return X}}tsParseTypeOperatorOrHigher(){return hRf(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(X,W,R){let J=this.startNode(),U=this.eat(R),V=[];do V.push(W());while(this.eat(R));if(V.length===1&&!U)return V[0];return J.types=V,this.finishNode(J,X)}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){if(this.match(47))return!0;return this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if($f(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:X}=this.state,W=X.length;try{return this.parseObjectLike(8,!0),X.length===W}catch(R){return!1}}if(this.match(0)){this.next();let{errors:X}=this.state,W=X.length;try{return super.parseBindingList(3,93,1),X.length===W}catch(R){return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(11)||this.match(21))return!0;if(this.tsSkipParameterStart()){if(this.match(14)||this.match(12)||this.match(17)||this.match(29))return!0;if(this.match(11)){if(this.next(),this.match(19))return!0}}return!1}tsParseTypeOrTypePredicateAnnotation(X){return this.tsInType(()=>{let W=this.startNode();this.expect(X);let R=this.startNode(),J=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(J&&this.match(78)){let H=this.tsParseThisTypeOrThisTypePredicate();if(H.type==="TSThisType")R.parameterName=H,R.asserts=!0,R.typeAnnotation=null,H=this.finishNode(R,"TSTypePredicate");else this.resetStartLocationFromNode(H,R),H.asserts=!0;return W.typeAnnotation=H,this.finishNode(W,"TSTypeAnnotation")}let U=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!U){if(!J)return this.tsParseTypeAnnotation(!1,W);return R.parameterName=this.parseIdentifier(),R.asserts=J,R.typeAnnotation=null,W.typeAnnotation=this.finishNode(R,"TSTypePredicate"),this.finishNode(W,"TSTypeAnnotation")}let V=this.tsParseTypeAnnotation(!1);return R.parameterName=U,R.typeAnnotation=V,R.asserts=J,W.typeAnnotation=this.finishNode(R,"TSTypePredicate"),this.finishNode(W,"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 X=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),X}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let X=this.state.containsEsc;if(this.next(),!$f(this.state.type)&&!this.match(78))return!1;if(X)this.raise($.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"});return!0}tsParseTypeAnnotation(X=!0,W=this.startNode()){return this.tsInType(()=>{if(X)this.expect(14);W.typeAnnotation=this.tsParseType()}),this.finishNode(W,"TSTypeAnnotation")}tsParseType(){O9(this.state.inType);let X=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return X;let W=this.startNodeAtNode(X);return W.checkType=X,W.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),W.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),W.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(W,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.lookahead().type===77}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(77))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){if(this.getPluginOption("typescript","disallowAmbiguousJSXLike"))this.raise(i.ReservedTypeAssertion,this.state.startLoc);let X=this.startNode();return X.typeAnnotation=this.tsInType(()=>{return this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType()}),this.expect(48),X.expression=this.parseMaybeUnary(),this.finishNode(X,"TSTypeAssertion")}tsParseHeritageClause(X){let W=this.state.startLoc,R=this.tsParseDelimitedList("HeritageClauseElement",()=>{{let J=this.startNode();if(J.expression=this.tsParseEntityName(3),this.match(47))J.typeParameters=this.tsParseTypeArguments();return this.finishNode(J,"TSExpressionWithTypeArguments")}});if(!R.length)this.raise(i.EmptyHeritageClauseType,W,{token:X});return R}tsParseInterfaceDeclaration(X,W={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual(129),W.declare)X.declare=!0;if($f(this.state.type))X.id=this.parseIdentifier(),this.checkIdentifier(X.id,130);else X.id=null,this.raise(i.MissingInterfaceName,this.state.startLoc);if(X.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81))X.extends=this.tsParseHeritageClause("extends");let R=this.startNode();return R.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),X.body=this.finishNode(R,"TSInterfaceBody"),this.finishNode(X,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(X){return X.id=this.parseIdentifier(),this.checkIdentifier(X.id,2),X.typeAnnotation=this.tsInType(()=>{if(X.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookahead().type!==16){let W=this.startNode();return this.next(),this.finishNode(W,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(X,"TSTypeAliasDeclaration")}tsInTopLevelContext(X){if(this.curContext()!==Ff.brace){let W=this.state.context;this.state.context=[W[0]];try{return X()}finally{this.state.context=W}}else return X()}tsInType(X){let W=this.state.inType;this.state.inType=!0;try{return X()}finally{this.state.inType=W}}tsInDisallowConditionalTypesContext(X){let W=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return X()}finally{this.state.inDisallowConditionalTypesContext=W}}tsInAllowConditionalTypesContext(X){let W=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return X()}finally{this.state.inDisallowConditionalTypesContext=W}}tsEatThenParseType(X){if(this.match(X))return this.tsNextThenParseType()}tsExpectThenParseType(X){return this.tsInType(()=>{return this.expect(X),this.tsParseType()})}tsNextThenParseType(){return this.tsInType(()=>{return this.next(),this.tsParseType()})}tsParseEnumMember(){let X=this.startNode();if(X.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29))X.initializer=super.parseMaybeAssignAllowIn();return this.finishNode(X,"TSEnumMember")}tsParseEnumDeclaration(X,W={}){if(W.const)X.const=!0;if(W.declare)X.declare=!0;return this.expectContextual(126),X.id=this.parseIdentifier(),this.checkIdentifier(X.id,X.const?8971:8459),this.expect(5),X.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(X,"TSEnumDeclaration")}tsParseEnumBody(){let X=this.startNode();return this.expect(5),X.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(X,"TSEnumBody")}tsParseModuleBlock(){let X=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(X.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(X,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(X,W=!1){if(X.id=this.parseIdentifier(),!W)this.checkIdentifier(X.id,1024);if(this.eat(16)){let R=this.startNode();this.tsParseModuleOrNamespaceDeclaration(R,!0),X.body=R}else this.scope.enter(256),this.prodParam.enter(0),X.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(X,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(X){if(this.isContextual(112))X.kind="global",X.global=!0,X.id=this.parseIdentifier();else if(this.match(134))X.kind="module",X.id=super.parseStringLiteral(this.state.value);else this.unexpected();if(this.match(5))this.scope.enter(256),this.prodParam.enter(0),X.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();else this.semicolon();return this.finishNode(X,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(X,W,R){X.isExport=R||!1,X.id=W||this.parseIdentifier(),this.checkIdentifier(X.id,4096),this.expect(29);let J=this.tsParseModuleReference();if(X.importKind==="type"&&J.type!=="TSExternalModuleReference")this.raise(i.ImportAliasHasImportType,J);return X.moduleReference=J,this.semicolon(),this.finishNode(X,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let X=this.startNode();if(this.expectContextual(119),this.expect(10),!this.match(134))this.unexpected();return X.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(X,"TSExternalModuleReference")}tsLookAhead(X){let W=this.state.clone(),R=X();return this.state=W,R}tsTryParseAndCatch(X){let W=this.tryParse((R)=>X()||R());if(W.aborted||!W.node)return;if(W.error)this.state=W.failState;return W.node}tsTryParse(X){let W=this.state.clone(),R=X();if(R!==void 0&&R!==!1)return R;this.state=W}tsTryParseDeclare(X){if(this.isLineTerminator())return;let W=this.state.type,R;if(this.isContextual(100))W=74,R="let";return this.tsInAmbientContext(()=>{switch(W){case 68:return X.declare=!0,super.parseFunctionStatement(X,!1,!1);case 80:return X.declare=!0,this.parseClass(X,!0,!1);case 126:return this.tsParseEnumDeclaration(X,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(X);case 75:case 74:if(!this.match(75)||!this.isLookaheadContextual("enum"))return X.declare=!0,this.parseVarStatement(X,R||this.state.value,!0);return this.expect(75),this.tsParseEnumDeclaration(X,{const:!0,declare:!0});case 129:{let J=this.tsParseInterfaceDeclaration(X,{declare:!0});if(J)return J}default:if($f(W))return this.tsParseDeclaration(X,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(X,W,R){switch(W.name){case"declare":{let J=this.tsTryParseDeclare(X);if(J)J.declare=!0;return J}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);let J=X;return J.kind="global",X.global=!0,J.id=W,J.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(J,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(X,W.name,!1,R)}}tsParseDeclaration(X,W,R,J){switch(W){case"abstract":if(this.tsCheckLineTerminator(R)&&(this.match(80)||$f(this.state.type)))return this.tsParseAbstractDeclaration(X,J);break;case"module":if(this.tsCheckLineTerminator(R)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(X);else if($f(this.state.type))return X.kind="module",this.tsParseModuleOrNamespaceDeclaration(X)}break;case"namespace":if(this.tsCheckLineTerminator(R)&&$f(this.state.type))return X.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(X);break;case"type":if(this.tsCheckLineTerminator(R)&&$f(this.state.type))return this.tsParseTypeAliasDeclaration(X);break}}tsCheckLineTerminator(X){if(X){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(X){if(!this.match(47))return;let W=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let R=this.tsTryParseAndCatch(()=>{let J=this.startNodeAt(X);return J.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(J),J.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),J});if(this.state.maybeInArrowParameters=W,!R)return;return super.parseArrowExpression(R,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==47)return;return this.tsParseTypeArguments()}tsParseTypeArguments(){let X=this.startNode();if(X.params=this.tsInType(()=>this.tsInTopLevelContext(()=>{return this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))})),X.params.length===0)this.raise(i.EmptyTypeArguments,X);else if(!this.state.inType&&this.curContext()===Ff.brace)this.reScan_lt_gt();return this.expect(48),this.finishNode(X,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return yRf(this.state.type)}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;return super.isExportDefaultSpecifier()}parseBindingElement(X,W){let R=this.state.startLoc,J={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},J);let{accessibility:U,override:V,readonly:H}=J;if(!(X&4)&&(U||H||V))this.raise(i.UnexpectedParameterModifier,R);let Q=this.parseMaybeDefault();if(X&2)this.parseFunctionParamType(Q);let Y=this.parseMaybeDefault(Q.loc.start,Q);if(U||H||V){let F=this.startNodeAt(R);if(W.length)F.decorators=W;if(U)F.accessibility=U;if(H)F.readonly=H;if(V)F.override=V;if(Y.type!=="Identifier"&&Y.type!=="AssignmentPattern")this.raise(i.UnsupportedParameterPropertyKind,F);return F.parameter=Y,this.finishNode(F,"TSParameterProperty")}if(W.length)Q.decorators=W;return Y}isSimpleParameter(X){return X.type==="TSParameterProperty"&&super.isSimpleParameter(X.parameter)||super.isSimpleParameter(X)}tsDisallowOptionalPattern(X){for(let W of X.params)if(W.type!=="Identifier"&&W.optional&&!this.state.isAmbientContext)this.raise(i.PatternIsOptional,W)}setArrowFunctionParameters(X,W,R){super.setArrowFunctionParameters(X,W,R),this.tsDisallowOptionalPattern(X)}parseFunctionBodyAndFinish(X,W,R=!1){if(this.match(14))X.returnType=this.tsParseTypeOrTypePredicateAnnotation(14);let J=W==="FunctionDeclaration"?"TSDeclareFunction":W==="ClassMethod"||W==="ClassPrivateMethod"?"TSDeclareMethod":void 0;if(J&&!this.match(5)&&this.isLineTerminator())return this.finishNode(X,J);if(J==="TSDeclareFunction"&&this.state.isAmbientContext){if(this.raise(i.DeclareFunctionHasImplementation,X),X.declare)return super.parseFunctionBodyAndFinish(X,J,R)}return this.tsDisallowOptionalPattern(X),super.parseFunctionBodyAndFinish(X,W,R)}registerFunctionStatementId(X){if(!X.body&&X.id)this.checkIdentifier(X.id,1024);else super.registerFunctionStatementId(X)}tsCheckForInvalidTypeCasts(X){X.forEach((W)=>{if((W==null?void 0:W.type)==="TSTypeCastExpression")this.raise(i.UnexpectedTypeAnnotation,W.typeAnnotation)})}toReferencedList(X,W){return this.tsCheckForInvalidTypeCasts(X),X}parseArrayLike(X,W,R,J){let U=super.parseArrayLike(X,W,R,J);if(U.type==="ArrayExpression")this.tsCheckForInvalidTypeCasts(U.elements);return U}parseSubscript(X,W,R,J){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let V=this.startNodeAt(W);return V.expression=X,this.finishNode(V,"TSNonNullExpression")}let U=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(R)return J.stop=!0,X;J.optionalChainMember=U=!0,this.next()}if(this.match(47)||this.match(51)){let V,H=this.tsTryParseAndCatch(()=>{if(!R&&this.atPossibleAsyncArrow(X)){let q=this.tsTryParseGenericAsyncArrowFunction(W);if(q)return q}let Q=this.tsParseTypeArgumentsInExpression();if(!Q)return;if(U&&!this.match(10)){V=this.state.curPosition();return}if(UW(this.state.type)){let q=super.parseTaggedTemplateExpression(X,W,J);return q.typeParameters=Q,q}if(!R&&this.eat(10)){let q=this.startNodeAt(W);if(q.callee=X,q.arguments=this.parseCallExpressionArguments(11),this.tsCheckForInvalidTypeCasts(q.arguments),q.typeParameters=Q,J.optionalChainMember)q.optional=U;return this.finishCallExpression(q,J.optionalChainMember)}let Y=this.state.type;if(Y===48||Y===52||Y!==10&&AR(Y)&&!this.hasPrecedingLineBreak())return;let F=this.startNodeAt(W);return F.expression=X,F.typeParameters=Q,this.finishNode(F,"TSInstantiationExpression")});if(V)this.unexpected(V,10);if(H){if(H.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40))this.raise(i.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc);return H}}return super.parseSubscript(X,W,R,J)}parseNewCallee(X){var W;super.parseNewCallee(X);let{callee:R}=X;if(R.type==="TSInstantiationExpression"&&!((W=R.extra)!=null&&W.parenthesized))X.typeParameters=R.typeParameters,X.callee=R.expression}parseExprOp(X,W,R){let J;if(RW(58)>R&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(J=this.isContextual(120)))){let U=this.startNodeAt(W);return U.expression=X,U.typeAnnotation=this.tsInType(()=>{if(this.next(),this.match(75)){if(J)this.raise($.UnexpectedKeyword,this.state.startLoc,{keyword:"const"});return this.tsParseTypeReference()}return this.tsParseType()}),this.finishNode(U,J?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(U,W,R)}return super.parseExprOp(X,W,R)}checkReservedWord(X,W,R,J){if(!this.state.isAmbientContext)super.checkReservedWord(X,W,R,J)}checkImportReflection(X){if(super.checkImportReflection(X),X.module&&X.importKind!=="value")this.raise(i.ImportReflectionHasImportType,X.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(X){if(super.isPotentialImportPhase(X))return!0;if(this.isContextual(130)){let W=this.lookaheadCharCode();return X?W===123||W===42:W!==61}return!X&&this.isContextual(87)}applyImportPhase(X,W,R,J){if(super.applyImportPhase(X,W,R,J),W)X.exportKind=R==="type"?"type":"value";else X.importKind=R==="type"||R==="typeof"?R:"value"}parseImport(X){if(this.match(134))return X.importKind="value",super.parseImport(X);let W;if($f(this.state.type)&&this.lookaheadCharCode()===61)return X.importKind="value",this.tsParseImportEqualsDeclaration(X);else if(this.isContextual(130)){let R=this.parseMaybeImportPhase(X,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(X,R);else W=super.parseImportSpecifiersAndAfter(X,R)}else W=super.parseImport(X);if(W.importKind==="type"&&W.specifiers.length>1&&W.specifiers[0].type==="ImportDefaultSpecifier")this.raise(i.TypeImportCannotSpecifyDefaultAndNamed,W);return W}parseExport(X,W){if(this.match(83)){let R=X;this.next();let J=null;if(this.isContextual(130)&&this.isPotentialImportPhase(!1))J=this.parseMaybeImportPhase(R,!1);else R.importKind="value";return this.tsParseImportEqualsDeclaration(R,J,!0)}else if(this.eat(29)){let R=X;return R.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(R,"TSExportAssignment")}else if(this.eatContextual(93)){let R=X;return this.expectContextual(128),R.id=this.parseIdentifier(),this.semicolon(),this.finishNode(R,"TSNamespaceExportDeclaration")}else return super.parseExport(X,W)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let X=this.startNode();return this.next(),X.abstract=!0,this.parseClass(X,!0,!0)}if(this.match(129)){let X=this.tsParseInterfaceDeclaration(this.startNode());if(X)return X}return super.parseExportDefaultExpression()}parseVarStatement(X,W,R=!1){let{isAmbientContext:J}=this.state,U=super.parseVarStatement(X,W,R||J);if(!J)return U;for(let{id:V,init:H}of U.declarations){if(!H)continue;if(W!=="const"||!!V.typeAnnotation)this.raise(i.InitializerNotAllowedInAmbientContext,H);else if(!OJf(H,this.hasPlugin("estree")))this.raise(i.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,H)}return U}parseStatementContent(X,W){if(this.match(75)&&this.isLookaheadContextual("enum")){let R=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(R,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let R=this.tsParseInterfaceDeclaration(this.startNode());if(R)return R}return super.parseStatementContent(X,W)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(X,W){return W.some((R)=>{if(j9(R))return X.accessibility===R;return!!X[R]})}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(X,W,R){let J=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:J,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:i.InvalidModifierOnTypeParameterPositions},W);let U=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(W,J))this.raise(i.StaticBlockCannotHaveModifier,this.state.curPosition());super.parseClassStaticBlock(X,W)}else this.parseClassMemberWithIsStatic(X,W,R,!!W.static)};if(W.declare)this.tsInAmbientContext(U);else U()}parseClassMemberWithIsStatic(X,W,R,J){let U=this.tsTryParseIndexSignature(W);if(U){if(X.body.push(U),W.abstract)this.raise(i.IndexSignatureHasAbstract,W);if(W.accessibility)this.raise(i.IndexSignatureHasAccessibility,W,{modifier:W.accessibility});if(W.declare)this.raise(i.IndexSignatureHasDeclare,W);if(W.override)this.raise(i.IndexSignatureHasOverride,W);return}if(!this.state.inAbstractClass&&W.abstract)this.raise(i.NonAbstractClassHasAbstractMethod,W);if(W.override){if(!R.hadSuperClass)this.raise(i.OverrideNotInSubClass,W)}super.parseClassMemberWithIsStatic(X,W,R,J)}parsePostMemberNameModifiers(X){if(this.eat(17))X.optional=!0;if(X.readonly&&this.match(10))this.raise(i.ClassMethodHasReadonly,X);if(X.declare&&this.match(10))this.raise(i.ClassMethodHasDeclare,X)}parseExpressionStatement(X,W,R){return(W.type==="Identifier"?this.tsParseExpressionStatement(X,W,R):void 0)||super.parseExpressionStatement(X,W,R)}shouldParseExportDeclaration(){if(this.tsIsDeclarationStart())return!0;return super.shouldParseExportDeclaration()}parseConditional(X,W,R){if(!this.match(17))return X;if(this.state.maybeInArrowParameters){let J=this.lookaheadCharCode();if(J===44||J===61||J===58||J===41)return this.setOptionalParametersError(R),X}return super.parseConditional(X,W,R)}parseParenItem(X,W){let R=super.parseParenItem(X,W);if(this.eat(17))R.optional=!0,this.resetEndLocation(X);if(this.match(14)){let J=this.startNodeAt(W);return J.expression=X,J.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(J,"TSTypeCastExpression")}return X}parseExportDeclaration(X){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(X));let W=this.state.startLoc,R=this.eatContextual(125);if(R&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(i.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let U=$f(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(X);if(!U)return null;if(U.type==="TSInterfaceDeclaration"||U.type==="TSTypeAliasDeclaration"||R)X.exportKind="type";if(R&&U.type!=="TSImportEqualsDeclaration")this.resetStartLocation(U,W),U.declare=!0;return U}parseClassId(X,W,R,J){if((!W||R)&&this.isContextual(113))return;super.parseClassId(X,W,R,X.declare?1024:8331);let U=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);if(U)X.typeParameters=U}parseClassPropertyAnnotation(X){if(!X.optional){if(this.eat(35))X.definite=!0;else if(this.eat(17))X.optional=!0}let W=this.tsTryParseTypeAnnotation();if(W)X.typeAnnotation=W}parseClassProperty(X){if(this.parseClassPropertyAnnotation(X),this.state.isAmbientContext&&!(X.readonly&&!X.typeAnnotation)&&this.match(29))this.raise(i.DeclareClassFieldHasInitializer,this.state.startLoc);if(X.abstract&&this.match(29)){let{key:W}=X;this.raise(i.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:W.type==="Identifier"&&!X.computed?W.name:`[${this.input.slice(this.offsetToSourcePos(W.start),this.offsetToSourcePos(W.end))}]`})}return super.parseClassProperty(X)}parseClassPrivateProperty(X){if(X.abstract)this.raise(i.PrivateElementHasAbstract,X);if(X.accessibility)this.raise(i.PrivateElementHasAccessibility,X,{modifier:X.accessibility});return this.parseClassPropertyAnnotation(X),super.parseClassPrivateProperty(X)}parseClassAccessorProperty(X){if(this.parseClassPropertyAnnotation(X),X.optional)this.raise(i.AccessorCannotBeOptional,X);return super.parseClassAccessorProperty(X)}pushClassMethod(X,W,R,J,U,V){let H=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(H&&U)this.raise(i.ConstructorHasTypeParameters,H);let{declare:Q=!1,kind:Y}=W;if(Q&&(Y==="get"||Y==="set"))this.raise(i.DeclareAccessor,W,{kind:Y});if(H)W.typeParameters=H;super.pushClassMethod(X,W,R,J,U,V)}pushClassPrivateMethod(X,W,R,J){let U=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(U)W.typeParameters=U;super.pushClassPrivateMethod(X,W,R,J)}declareClassPrivateMethodInScope(X,W){if(X.type==="TSDeclareMethod")return;if(X.type==="MethodDefinition"&&!hasOwnProperty.call(X.value,"body"))return;super.declareClassPrivateMethodInScope(X,W)}parseClassSuper(X){if(super.parseClassSuper(X),X.superClass&&(this.match(47)||this.match(51)))X.superTypeParameters=this.tsParseTypeArgumentsInExpression();if(this.eatContextual(113))X.implements=this.tsParseHeritageClause("implements")}parseObjPropValue(X,W,R,J,U,V,H){let Q=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Q)X.typeParameters=Q;return super.parseObjPropValue(X,W,R,J,U,V,H)}parseFunctionParams(X,W){let R=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(R)X.typeParameters=R;super.parseFunctionParams(X,W)}parseVarId(X,W){if(super.parseVarId(X,W),X.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35))X.definite=!0;let R=this.tsTryParseTypeAnnotation();if(R)X.id.typeAnnotation=R,this.resetEndLocation(X.id)}parseAsyncArrowFromCallExpression(X,W){if(this.match(14))X.returnType=this.tsParseTypeAnnotation();return super.parseAsyncArrowFromCallExpression(X,W)}parseMaybeAssign(X,W){var R,J,U,V,H;let Q,Y,F;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(Q=this.state.clone(),Y=this.tryParse(()=>super.parseMaybeAssign(X,W),Q),!Y.error)return Y.node;let{context:j}=this.state,b=j[j.length-1];if(b===Ff.j_oTag||b===Ff.j_expr)j.pop()}if(!((R=Y)!=null&&R.error)&&!this.match(47))return super.parseMaybeAssign(X,W);if(!Q||Q===this.state)Q=this.state.clone();let q,A=this.tryParse((j)=>{var b,I;q=this.tsParseTypeParameters(this.tsParseConstModifier);let L=super.parseMaybeAssign(X,W);if(L.type!=="ArrowFunctionExpression"||(b=L.extra)!=null&&b.parenthesized)j();if(((I=q)==null?void 0:I.params.length)!==0)this.resetStartLocationFromNode(L,q);return L.typeParameters=q,L},Q);if(!A.error&&!A.aborted){if(q)this.reportReservedArrowTypeParam(q);return A.node}if(!Y){if(O9(!this.hasPlugin("jsx")),F=this.tryParse(()=>super.parseMaybeAssign(X,W),Q),!F.error)return F.node}if((J=Y)!=null&&J.node)return this.state=Y.failState,Y.node;if(A.node){if(this.state=A.failState,q)this.reportReservedArrowTypeParam(q);return A.node}if((U=F)!=null&&U.node)return this.state=F.failState,F.node;throw((V=Y)==null?void 0:V.error)||A.error||((H=F)==null?void 0:H.error)}reportReservedArrowTypeParam(X){var W;if(X.params.length===1&&!X.params[0].constraint&&!((W=X.extra)!=null&&W.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike"))this.raise(i.ReservedArrowTypeParam,X)}parseMaybeUnary(X,W){if(!this.hasPlugin("jsx")&&this.match(47))return this.tsParseTypeAssertion();return super.parseMaybeUnary(X,W)}parseArrow(X){if(this.match(14)){let W=this.tryParse((R)=>{let J=this.tsParseTypeOrTypePredicateAnnotation(14);if(this.canInsertSemicolon()||!this.match(19))R();return J});if(W.aborted)return;if(!W.thrown){if(W.error)this.state=W.failState;X.returnType=W.node}}return super.parseArrow(X)}parseFunctionParamType(X){if(this.eat(17))X.optional=!0;let W=this.tsTryParseTypeAnnotation();if(W)X.typeAnnotation=W;return this.resetEndLocation(X),X}isAssignable(X,W){switch(X.type){case"TSTypeCastExpression":return this.isAssignable(X.expression,W);case"TSParameterProperty":return!0;default:return super.isAssignable(X,W)}}toAssignable(X,W=!1){switch(X.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(X,W);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if(W)this.expressionScope.recordArrowParameterBindingError(i.UnexpectedTypeCastInParameter,X);else this.raise(i.UnexpectedTypeCastInParameter,X);this.toAssignable(X.expression,W);break;case"AssignmentExpression":if(!W&&X.left.type==="TSTypeCastExpression")X.left=this.typeCastToParameter(X.left);default:super.toAssignable(X,W)}}toAssignableParenthesizedExpression(X,W){switch(X.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(X.expression,W);break;default:super.toAssignable(X,W)}}checkToRestConversion(X,W){switch(X.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(X.expression,!1);break;default:super.checkToRestConversion(X,W)}}isValidLVal(X,W,R){switch(X){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(R!==64||!W)&&["expression",!0];default:return super.isValidLVal(X,W,R)}}parseBindingAtom(){if(this.state.type===78)return this.parseIdentifier(!0);return super.parseBindingAtom()}parseMaybeDecoratorArguments(X,W){if(this.match(47)||this.match(51)){let R=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let J=super.parseMaybeDecoratorArguments(X,W);return J.typeParameters=R,J}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(X,W)}checkCommaAfterRest(X){if(this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===X)return this.next(),!1;return super.checkCommaAfterRest(X)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(X,W){let R=super.parseMaybeDefault(X,W);if(R.type==="AssignmentPattern"&&R.typeAnnotation&&R.right.start<R.typeAnnotation.start)this.raise(i.TypeAnnotationAfterAssign,R.typeAnnotation);return R}getTokenFromCode(X){if(this.state.inType){if(X===62){this.finishOp(48,1);return}if(X===60){this.finishOp(47,1);return}}super.getTokenFromCode(X)}reScan_lt_gt(){let{type:X}=this.state;if(X===47)this.state.pos-=1,this.readToken_lt();else if(X===48)this.state.pos-=1,this.readToken_gt()}reScan_lt(){let{type:X}=this.state;if(X===51)return this.state.pos-=2,this.finishOp(47,1),47;return X}toAssignableListItem(X,W,R){let J=X[W];if(J.type==="TSTypeCastExpression")X[W]=this.typeCastToParameter(J);super.toAssignableListItem(X,W,R)}typeCastToParameter(X){return X.expression.typeAnnotation=X.typeAnnotation,this.resetEndLocation(X.expression,X.typeAnnotation.loc.end),X.expression}shouldParseArrow(X){if(this.match(14))return X.every((W)=>this.isAssignable(W,!0));return super.shouldParseArrow(X)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(X){if(this.match(47)||this.match(51)){let W=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(W)X.typeParameters=W}return super.jsxParseOpeningElementAfterName(X)}getGetterSetterExpectedParamCount(X){let W=super.getGetterSetterExpectedParamCount(X),J=this.getObjectOrClassMethodParams(X)[0];return J&&this.isThisParam(J)?W+1:W}parseCatchClauseParam(){let X=super.parseCatchClauseParam(),W=this.tsTryParseTypeAnnotation();if(W)X.typeAnnotation=W,this.resetEndLocation(X);return X}tsInAmbientContext(X){let{isAmbientContext:W,strict:R}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return X()}finally{this.state.isAmbientContext=W,this.state.strict=R}}parseClass(X,W,R){let J=this.state.inAbstractClass;this.state.inAbstractClass=!!X.abstract;try{return super.parseClass(X,W,R)}finally{this.state.inAbstractClass=J}}tsParseAbstractDeclaration(X,W){if(this.match(80))return X.abstract=!0,this.maybeTakeDecorators(W,this.parseClass(X,!0,!1));else if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return X.abstract=!0,this.raise(i.NonClassMethodPropertyHasAbstractModifer,X),this.tsParseInterfaceDeclaration(X)}else this.unexpected(null,80)}parseMethod(X,W,R,J,U,V,H){let Q=super.parseMethod(X,W,R,J,U,V,H);if(Q.abstract){if((this.hasPlugin("estree")?Q.value:Q).body){let{key:q}=Q;this.raise(i.AbstractMethodHasImplementation,Q,{methodName:q.type==="Identifier"&&!Q.computed?q.name:`[${this.input.slice(this.offsetToSourcePos(q.start),this.offsetToSourcePos(q.end))}]`})}}return Q}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){if(this.shouldParseAsAmbientContext())this.state.isAmbientContext=!0;return super.parse()}getExpression(){if(this.shouldParseAsAmbientContext())this.state.isAmbientContext=!0;return super.getExpression()}parseExportSpecifier(X,W,R,J){if(!W&&J)return this.parseTypeOnlyImportExportSpecifier(X,!1,R),this.finishNode(X,"ExportSpecifier");return X.exportKind="value",super.parseExportSpecifier(X,W,R,J)}parseImportSpecifier(X,W,R,J,U){if(!W&&J)return this.parseTypeOnlyImportExportSpecifier(X,!0,R),this.finishNode(X,"ImportSpecifier");return X.importKind="value",super.parseImportSpecifier(X,W,R,J,R?4098:4096)}parseTypeOnlyImportExportSpecifier(X,W,R){let J=W?"imported":"local",U=W?"local":"exported",V=X[J],H,Q=!1,Y=!0,F=V.loc.start;if(this.isContextual(93)){let A=this.parseIdentifier();if(this.isContextual(93)){let j=this.parseIdentifier();if(HG(this.state.type))Q=!0,V=A,H=W?this.parseIdentifier():this.parseModuleExportName(),Y=!1;else H=j,Y=!1}else if(HG(this.state.type))Y=!1,H=W?this.parseIdentifier():this.parseModuleExportName();else Q=!0,V=A}else if(HG(this.state.type))if(Q=!0,W){if(V=this.parseIdentifier(!0),!this.isContextual(93))this.checkReservedWord(V.name,V.loc.start,!0,!0)}else V=this.parseModuleExportName();if(Q&&R)this.raise(W?i.TypeModifierIsUsedInTypeImports:i.TypeModifierIsUsedInTypeExports,F);X[J]=V,X[U]=H;let q=W?"importKind":"exportKind";if(X[q]=Q?"type":"value",Y&&this.eatContextual(93))X[U]=W?this.parseIdentifier():this.parseModuleExportName();if(!X[U])X[U]=LG(X[J]);if(W)this.checkIdentifier(X[U],Q?4098:4096)}};function AJf(f){if(f.type!=="MemberExpression")return!1;let{computed:G,property:X}=f;if(G&&X.type!=="StringLiteral"&&(X.type!=="TemplateLiteral"||X.expressions.length>0))return!1;return G8(f.object)}function OJf(f,G){var X;let{type:W}=f;if((X=f.extra)!=null&&X.parenthesized)return!1;if(G){if(W==="Literal"){let{value:R}=f;if(typeof R==="string"||typeof R==="boolean")return!0}}else if(W==="StringLiteral"||W==="BooleanLiteral")return!0;if(f8(f,G)||jJf(f,G))return!0;if(W==="TemplateLiteral"&&f.expressions.length===0)return!0;if(AJf(f))return!0;return!1}function f8(f,G){if(G)return f.type==="Literal"&&(typeof f.value==="number"||("bigint"in f));return f.type==="NumericLiteral"||f.type==="BigIntLiteral"}function jJf(f,G){if(f.type==="UnaryExpression"){let{operator:X,argument:W}=f;if(X==="-"&&f8(W,G))return!0}return!1}function G8(f){if(f.type==="Identifier")return!0;if(f.type!=="MemberExpression"||f.computed)return!1;return G8(f.object)}var P9=TG`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),PJf=(f)=>class G extends f{parsePlaceholder(X){if(this.match(133)){let W=this.startNode();return this.next(),this.assertNoSpace(),W.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(W,X)}}finishPlaceholder(X,W){let R=X;if(!R.expectedNode||!R.type)R=this.finishNode(R,"Placeholder");return R.expectedNode=W,R}getTokenFromCode(X){if(X===37&&this.input.charCodeAt(this.state.pos+1)===37)this.finishOp(133,2);else super.getTokenFromCode(X)}parseExprAtom(X){return this.parsePlaceholder("Expression")||super.parseExprAtom(X)}parseIdentifier(X){return this.parsePlaceholder("Identifier")||super.parseIdentifier(X)}checkReservedWord(X,W,R,J){if(X!==void 0)super.checkReservedWord(X,W,R,J)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(X,W,R){return X==="Placeholder"||super.isValidLVal(X,W,R)}toAssignable(X,W){if(X&&X.type==="Placeholder"&&X.expectedNode==="Expression")X.expectedNode="Pattern";else super.toAssignable(X,W)}chStartsBindingIdentifier(X,W){if(super.chStartsBindingIdentifier(X,W))return!0;if(this.lookahead().type===133)return!0;return!1}verifyBreakContinue(X,W){if(X.label&&X.label.type==="Placeholder")return;super.verifyBreakContinue(X,W)}parseExpressionStatement(X,W){var R;if(W.type!=="Placeholder"||(R=W.extra)!=null&&R.parenthesized)return super.parseExpressionStatement(X,W);if(this.match(14)){let U=X;return U.label=this.finishPlaceholder(W,"Identifier"),this.next(),U.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(U,"LabeledStatement")}this.semicolon();let J=X;return J.name=W.name,this.finishPlaceholder(J,"Statement")}parseBlock(X,W,R){return this.parsePlaceholder("BlockStatement")||super.parseBlock(X,W,R)}parseFunctionId(X){return this.parsePlaceholder("Identifier")||super.parseFunctionId(X)}parseClass(X,W,R){let J=W?"ClassDeclaration":"ClassExpression";this.next();let U=this.state.strict,V=this.parsePlaceholder("Identifier");if(V)if(this.match(81)||this.match(133)||this.match(5))X.id=V;else if(R||!W)return X.id=null,X.body=this.finishPlaceholder(V,"ClassBody"),this.finishNode(X,J);else throw this.raise(P9.ClassNameIsRequired,this.state.startLoc);else this.parseClassId(X,W,R);return super.parseClassSuper(X),X.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!X.superClass,U),this.finishNode(X,J)}parseExport(X,W){let R=this.parsePlaceholder("Identifier");if(!R)return super.parseExport(X,W);let J=X;if(!this.isContextual(98)&&!this.match(12))return J.specifiers=[],J.source=null,J.declaration=this.finishPlaceholder(R,"Declaration"),this.finishNode(J,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let U=this.startNode();return U.exported=R,J.specifiers=[this.finishNode(U,"ExportDefaultSpecifier")],super.parseExport(J,W)}isExportDefaultSpecifier(){if(this.match(65)){let X=this.nextTokenStart();if(this.isUnparsedContextual(X,"from")){if(this.input.startsWith(xG(133),this.nextTokenStartSince(X+4)))return!0}}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(X,W){var R;if((R=X.specifiers)!=null&&R.length)return!0;return super.maybeParseExportDefaultSpecifier(X,W)}checkExport(X){let{specifiers:W}=X;if(W!=null&&W.length)X.specifiers=W.filter((R)=>R.exported.type==="Placeholder");super.checkExport(X),X.specifiers=W}parseImport(X){let W=this.parsePlaceholder("Identifier");if(!W)return super.parseImport(X);if(X.specifiers=[],!this.isContextual(98)&&!this.match(12))return X.source=this.finishPlaceholder(W,"StringLiteral"),this.semicolon(),this.finishNode(X,"ImportDeclaration");let R=this.startNodeAtNode(W);if(R.local=W,X.specifiers.push(this.finishNode(R,"ImportDefaultSpecifier")),this.eat(12)){if(!this.maybeParseStarImportSpecifier(X))this.parseNamedImportSpecifiers(X)}return this.expectContextual(98),X.source=this.parseImportSource(),this.semicolon(),this.finishNode(X,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){if(this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index))this.raise(P9.UnexpectedSpace,this.state.lastTokEndLoc)}},DJf=(f)=>class G extends f{parseV8Intrinsic(){if(this.match(54)){let X=this.state.startLoc,W=this.startNode();if(this.next(),$f(this.state.type)){let R=this.parseIdentifierName(),J=this.createIdentifier(W,R);if(J.type="V8IntrinsicIdentifier",this.match(10))return J}this.unexpected(X)}}parseExprAtom(X){return this.parseV8Intrinsic()||super.parseExprAtom(X)}},D9=["minimal","fsharp","hack","smart"],I9=["^^","@@","^","%","#"];function IJf(f){if(f.has("decorators")){if(f.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let X=f.get("decorators").decoratorsBeforeExport;if(X!=null&&typeof X!=="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let W=f.get("decorators").allowCallParenthesized;if(W!=null&&typeof W!=="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(f.has("flow")&&f.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(f.has("placeholders")&&f.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(f.has("pipelineOperator")){var G;let X=f.get("pipelineOperator").proposal;if(!D9.includes(X)){let R=D9.map((J)=>`"${J}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${R}.`)}let W=((G=f.get("recordAndTuple"))==null?void 0:G.syntaxType)==="hash";if(X==="hack"){if(f.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(f.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let R=f.get("pipelineOperator").topicToken;if(!I9.includes(R)){let J=I9.map((U)=>`"${U}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${J}.`)}if(R==="#"&&W)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",f.get("recordAndTuple")])}\`.`)}else if(X==="smart"&&W)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",f.get("recordAndTuple")])}\`.`)}if(f.has("moduleAttributes")){if(f.has("deprecatedImportAssert")||f.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(f.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(f.has("importAssertions")){if(f.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.")}if(!f.has("deprecatedImportAssert")&&f.has("importAttributes")&&f.get("importAttributes").deprecatedAssertSyntax)f.set("deprecatedImportAssert",{});if(f.has("recordAndTuple")){let X=f.get("recordAndTuple").syntaxType;if(X!=null){let W=["hash","bar"];if(!W.includes(X))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+W.map((R)=>`'${R}'`).join(", "))}}if(f.has("asyncDoExpressions")&&!f.has("doExpressions")){let X=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw X.missingPlugins="doExpressions",X}if(f.has("optionalChainingAssign")&&f.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}var X8={estree:NRf,jsx:SJf,flow:MJf,typescript:qJf,v8intrinsic:DJf,placeholders:PJf},TJf=Object.keys(X8);class W8 extends e9{checkProto(f,G,X,W){if(f.type==="SpreadElement"||this.isObjectMethod(f)||f.computed||f.shorthand)return X;let R=f.key;if((R.type==="Identifier"?R.name:R.value)==="__proto__"){if(G)return this.raise($.RecordNoProto,R),!0;if(X)if(W){if(W.doubleProtoLoc===null)W.doubleProtoLoc=R.loc.start}else this.raise($.DuplicateProto,R);return!0}return X}shouldExitDescending(f,G){return f.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(f.start)===G}getExpression(){this.enterInitialScopes(),this.nextToken();let f=this.parseExpression();if(!this.match(140))this.unexpected();if(this.finalizeRemainingComments(),f.comments=this.comments,f.errors=this.state.errors,this.optionFlags&128)f.tokens=this.tokens;return f}parseExpression(f,G){if(f)return this.disallowInAnd(()=>this.parseExpressionBase(G));return this.allowInAnd(()=>this.parseExpressionBase(G))}parseExpressionBase(f){let G=this.state.startLoc,X=this.parseMaybeAssign(f);if(this.match(12)){let W=this.startNodeAt(G);W.expressions=[X];while(this.eat(12))W.expressions.push(this.parseMaybeAssign(f));return this.toReferencedList(W.expressions),this.finishNode(W,"SequenceExpression")}return X}parseMaybeAssignDisallowIn(f,G){return this.disallowInAnd(()=>this.parseMaybeAssign(f,G))}parseMaybeAssignAllowIn(f,G){return this.allowInAnd(()=>this.parseMaybeAssign(f,G))}setOptionalParametersError(f){f.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(f,G){let X=this.state.startLoc;if(this.isContextual(108)){if(this.prodParam.hasYield){let U=this.parseYield();if(G)U=G.call(this,U,X);return U}}let W;if(f)W=!1;else f=new WX,W=!0;let{type:R}=this.state;if(R===10||$f(R))this.state.potentialArrowAt=this.state.start;let J=this.parseMaybeConditional(f);if(G)J=G.call(this,J,X);if(kRf(this.state.type)){let U=this.startNodeAt(X),V=this.state.value;if(U.operator=V,this.match(29)){this.toAssignable(J,!0),U.left=J;let H=X.index;if(f.doubleProtoLoc!=null&&f.doubleProtoLoc.index>=H)f.doubleProtoLoc=null;if(f.shorthandAssignLoc!=null&&f.shorthandAssignLoc.index>=H)f.shorthandAssignLoc=null;if(f.privateKeyLoc!=null&&f.privateKeyLoc.index>=H)this.checkDestructuringPrivate(f),f.privateKeyLoc=null}else U.left=J;return this.next(),U.right=this.parseMaybeAssign(),this.checkLVal(J,this.finishNode(U,"AssignmentExpression")),U}else if(W)this.checkExpressionErrors(f,!0);return J}parseMaybeConditional(f){let G=this.state.startLoc,X=this.state.potentialArrowAt,W=this.parseExprOps(f);if(this.shouldExitDescending(W,X))return W;return this.parseConditional(W,G,f)}parseConditional(f,G,X){if(this.eat(17)){let W=this.startNodeAt(G);return W.test=f,W.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),W.alternate=this.parseMaybeAssign(),this.finishNode(W,"ConditionalExpression")}return f}parseMaybeUnaryOrPrivate(f){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(f)}parseExprOps(f){let G=this.state.startLoc,X=this.state.potentialArrowAt,W=this.parseMaybeUnaryOrPrivate(f);if(this.shouldExitDescending(W,X))return W;return this.parseExprOp(W,G,-1)}parseExprOp(f,G,X){if(this.isPrivateName(f)){let R=this.getPrivateNameSV(f);if(X>=RW(58)||!this.prodParam.hasIn||!this.match(58))this.raise($.PrivateInExpectedIn,f,{identifierName:R});this.classScope.usePrivateName(R,f.loc.start)}let W=this.state.type;if(gRf(W)&&(this.prodParam.hasIn||!this.match(58))){let R=RW(W);if(R>X){if(W===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return f;this.checkPipelineAtInfixOperator(f,G)}let J=this.startNodeAt(G);J.left=f,J.operator=this.state.value;let U=W===41||W===42,V=W===40;if(V)R=RW(42);if(this.next(),W===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])){if(this.state.type===96&&this.prodParam.hasAwait)throw this.raise($.UnexpectedAwaitAfterPipelineBody,this.state.startLoc)}J.right=this.parseExprOpRightExpr(W,R);let H=this.finishNode(J,U||V?"LogicalExpression":"BinaryExpression"),Q=this.state.type;if(V&&(Q===41||Q===42)||U&&Q===40)throw this.raise($.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(H,G,X)}}return f}parseExprOpRightExpr(f,G){let X=this.state.startLoc;switch(f){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>{return this.parseHackPipeBody()});case"fsharp":return this.withSoloAwaitPermittingContext(()=>{return this.parseFSharpPipelineBody(G)})}if(this.getPluginOption("pipelineOperator","proposal")==="smart")return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise($.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(f,G),X)});default:return this.parseExprOpBaseRightExpr(f,G)}}parseExprOpBaseRightExpr(f,G){let X=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),X,xRf(f)?G-1:G)}parseHackPipeBody(){var f;let{startLoc:G}=this.state,X=this.parseMaybeAssign();if(ARf.has(X.type)&&!((f=X.extra)!=null&&f.parenthesized))this.raise($.PipeUnparenthesizedBody,G,{type:X.type});if(!this.topicReferenceWasUsedInCurrentContext())this.raise($.PipeTopicUnused,G);return X}checkExponentialAfterUnary(f){if(this.match(57))this.raise($.UnexpectedTokenUnaryExponentiation,f.argument)}parseMaybeUnary(f,G){let X=this.state.startLoc,W=this.isContextual(96);if(W&&this.recordAwaitIfAllowed()){this.next();let V=this.parseAwait(X);if(!G)this.checkExponentialAfterUnary(V);return V}let R=this.match(34),J=this.startNode();if(uRf(this.state.type)){if(J.operator=this.state.value,J.prefix=!0,this.match(72))this.expectPlugin("throwExpressions");let V=this.match(89);if(this.next(),J.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(f,!0),this.state.strict&&V){let H=J.argument;if(H.type==="Identifier")this.raise($.StrictDelete,J);else if(this.hasPropertyAsPrivateName(H))this.raise($.DeletePrivateField,J)}if(!R){if(!G)this.checkExponentialAfterUnary(J);return this.finishNode(J,"UnaryExpression")}}let U=this.parseUpdate(J,R,f);if(W){let{type:V}=this.state;if((this.hasPlugin("v8intrinsic")?AR(V):AR(V)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite($.AwaitNotInAsyncContext,X),this.parseAwait(X)}return U}parseUpdate(f,G,X){if(G){let J=f;return this.checkLVal(J.argument,this.finishNode(J,"UpdateExpression")),f}let W=this.state.startLoc,R=this.parseExprSubscripts(X);if(this.checkExpressionErrors(X,!1))return R;while(_Rf(this.state.type)&&!this.canInsertSemicolon()){let J=this.startNodeAt(W);J.operator=this.state.value,J.prefix=!1,J.argument=R,this.next(),this.checkLVal(R,R=this.finishNode(J,"UpdateExpression"))}return R}parseExprSubscripts(f){let G=this.state.startLoc,X=this.state.potentialArrowAt,W=this.parseExprAtom(f);if(this.shouldExitDescending(W,X))return W;return this.parseSubscripts(W,G)}parseSubscripts(f,G,X){let W={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(f),stop:!1};do f=this.parseSubscript(f,G,X,W),W.maybeAsyncArrow=!1;while(!W.stop);return f}parseSubscript(f,G,X,W){let{type:R}=this.state;if(!X&&R===15)return this.parseBind(f,G,X,W);else if(UW(R))return this.parseTaggedTemplateExpression(f,G,W);let J=!1;if(R===18){if(X){if(this.raise($.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40)return W.stop=!0,f}W.optionalChainMember=J=!0,this.next()}if(!X&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(f,G,W,J);else{let U=this.eat(0);if(U||J||this.eat(16))return this.parseMember(f,G,W,U,J);else return W.stop=!0,f}}parseMember(f,G,X,W,R){let J=this.startNodeAt(G);if(J.object=f,J.computed=W,W)J.property=this.parseExpression(),this.expect(3);else if(this.match(139)){if(f.type==="Super")this.raise($.SuperPrivateField,G);this.classScope.usePrivateName(this.state.value,this.state.startLoc),J.property=this.parsePrivateName()}else J.property=this.parseIdentifier(!0);if(X.optionalChainMember)return J.optional=R,this.finishNode(J,"OptionalMemberExpression");else return this.finishNode(J,"MemberExpression")}parseBind(f,G,X,W){let R=this.startNodeAt(G);return R.object=f,this.next(),R.callee=this.parseNoCallExpr(),W.stop=!0,this.parseSubscripts(this.finishNode(R,"BindExpression"),G,X)}parseCoverCallAndAsyncArrowHead(f,G,X,W){let R=this.state.maybeInArrowParameters,J=null;this.state.maybeInArrowParameters=!0,this.next();let U=this.startNodeAt(G);U.callee=f;let{maybeAsyncArrow:V,optionalChainMember:H}=X;if(V)this.expressionScope.enter(UJf()),J=new WX;if(H)U.optional=W;if(W)U.arguments=this.parseCallExpressionArguments(11);else U.arguments=this.parseCallExpressionArguments(11,f.type!=="Super",U,J);let Q=this.finishCallExpression(U,H);if(V&&this.shouldParseAsyncArrow()&&!W)X.stop=!0,this.checkDestructuringPrivate(J),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),Q=this.parseAsyncArrowFromCallExpression(this.startNodeAt(G),Q);else{if(V)this.checkExpressionErrors(J,!0),this.expressionScope.exit();this.toReferencedArguments(Q)}return this.state.maybeInArrowParameters=R,Q}toReferencedArguments(f,G){this.toReferencedListDeep(f.arguments,G)}parseTaggedTemplateExpression(f,G,X){let W=this.startNodeAt(G);if(W.tag=f,W.quasi=this.parseTemplate(!0),X.optionalChainMember)this.raise($.OptionalChainingNoTemplate,G);return this.finishNode(W,"TaggedTemplateExpression")}atPossibleAsyncArrow(f){return f.type==="Identifier"&&f.name==="async"&&this.state.lastTokEndLoc.index===f.end&&!this.canInsertSemicolon()&&f.end-f.start===5&&this.offsetToSourcePos(f.start)===this.state.potentialArrowAt}finishCallExpression(f,G){if(f.callee.type==="Import"){if(f.arguments.length===0||f.arguments.length>2)this.raise($.ImportCallArity,f);else for(let X of f.arguments)if(X.type==="SpreadElement")this.raise($.ImportCallSpreadArgument,X)}return this.finishNode(f,G?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(f,G,X,W){let R=[],J=!0,U=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;while(!this.eat(f)){if(J)J=!1;else if(this.expect(12),this.match(f)){if(X)this.addTrailingCommaExtraToNode(X);this.next();break}R.push(this.parseExprListItem(!1,W,G))}return this.state.inFSharpPipelineDirectBody=U,R}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(f,G){var X;if(this.resetPreviousNodeTrailingComments(G),this.expect(19),this.parseArrowExpression(f,G.arguments,!0,(X=G.extra)==null?void 0:X.trailingCommaLoc),G.innerComments)JX(f,G.innerComments);if(G.callee.trailingComments)JX(f,G.callee.trailingComments);return f}parseNoCallExpr(){let f=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),f,!0)}parseExprAtom(f){let G,X=null,{type:W}=this.state;switch(W){case 79:return this.parseSuper();case 83:if(G=this.startNode(),this.next(),this.match(16))return this.parseImportMetaProperty(G);if(this.match(10))if(this.optionFlags&256)return this.parseImportCall(G);else return this.finishNode(G,"Import");else return this.raise($.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(G,"Import");case 78:return G=this.startNode(),this.next(),this.finishNode(G,"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 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,f);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,f);case 68:return this.parseFunctionOrFunctionSent();case 26:X=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(X,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{G=this.startNode(),this.next(),G.object=null;let R=G.callee=this.parseNoCallExpr();if(R.type==="MemberExpression")return this.finishNode(G,"BindExpression");else throw this.raise($.UnsupportedBind,R)}case 139:return this.raise($.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let R=this.getPluginOption("pipelineOperator","proposal");if(R)return this.parseTopicReference(R);this.unexpected();break}case 47:{let R=this.input.codePointAt(this.nextTokenStart());if(IG(R)||R===62)this.expectOnePlugin(["jsx","flow","typescript"]);else this.unexpected();break}default:if(W===137)return this.parseDecimalLiteral(this.state.value);if($f(W)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let R=this.state.potentialArrowAt===this.state.start,J=this.state.containsEsc,U=this.parseIdentifier();if(!J&&U.name==="async"&&!this.canInsertSemicolon()){let{type:V}=this.state;if(V===68)return this.resetPreviousNodeTrailingComments(U),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(U));else if($f(V))if(this.lookaheadCharCode()===61)return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(U));else return U;else if(V===90)return this.resetPreviousNodeTrailingComments(U),this.parseDo(this.startNodeAtNode(U),!0)}if(R&&this.match(19)&&!this.canInsertSemicolon())return this.next(),this.parseArrowExpression(this.startNodeAtNode(U),[U],!1);return U}else this.unexpected()}}parseTopicReferenceThenEqualsSign(f,G){let X=this.getPluginOption("pipelineOperator","proposal");if(X)return this.state.type=f,this.state.value=G,this.state.pos--,this.state.end--,this.state.endLoc=xf(this.state.endLoc,-1),this.parseTopicReference(X);else this.unexpected()}parseTopicReference(f){let G=this.startNode(),X=this.state.startLoc,W=this.state.type;return this.next(),this.finishTopicReference(G,X,f,W)}finishTopicReference(f,G,X,W){if(this.testTopicReferenceConfiguration(X,G,W))if(X==="hack"){if(!this.topicReferenceIsAllowedInCurrentContext())this.raise($.PipeTopicUnbound,G);return this.registerTopicReference(),this.finishNode(f,"TopicReference")}else{if(!this.topicReferenceIsAllowedInCurrentContext())this.raise($.PrimaryTopicNotAllowed,G);return this.registerTopicReference(),this.finishNode(f,"PipelinePrimaryTopicReference")}else throw this.raise($.PipeTopicUnconfiguredToken,G,{token:xG(W)})}testTopicReferenceConfiguration(f,G,X){switch(f){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:xG(X)}]);case"smart":return X===27;default:throw this.raise($.PipeTopicRequiresHackPipes,G)}}parseAsyncArrowUnaryFunction(f){this.prodParam.enter(JW(!0,this.prodParam.hasYield));let G=[this.parseIdentifier()];if(this.prodParam.exit(),this.hasPrecedingLineBreak())this.raise($.LineTerminatorBeforeArrow,this.state.curPosition());return this.expect(19),this.parseArrowExpression(f,G,!0)}parseDo(f,G){if(this.expectPlugin("doExpressions"),G)this.expectPlugin("asyncDoExpressions");f.async=G,this.next();let X=this.state.labels;if(this.state.labels=[],G)this.prodParam.enter(2),f.body=this.parseBlock(),this.prodParam.exit();else f.body=this.parseBlock();return this.state.labels=X,this.finishNode(f,"DoExpression")}parseSuper(){let f=this.startNode();if(this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!(this.optionFlags&16))this.raise($.SuperNotAllowed,f);else if(!this.scope.allowSuper&&!(this.optionFlags&16))this.raise($.UnexpectedSuper,f);if(!this.match(10)&&!this.match(0)&&!this.match(16))this.raise($.UnsupportedSuper,f);return this.finishNode(f,"Super")}parsePrivateName(){let f=this.startNode(),G=this.startNodeAt(xf(this.state.startLoc,1)),X=this.state.value;return this.next(),f.id=this.createIdentifier(G,X),this.finishNode(f,"PrivateName")}parseFunctionOrFunctionSent(){let f=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let G=this.createIdentifier(this.startNodeAtNode(f),"function");if(this.next(),this.match(103))this.expectPlugin("functionSent");else if(!this.hasPlugin("functionSent"))this.unexpected();return this.parseMetaProperty(f,G,"sent")}return this.parseFunction(f)}parseMetaProperty(f,G,X){f.meta=G;let W=this.state.containsEsc;if(f.property=this.parseIdentifier(!0),f.property.name!==X||W)this.raise($.UnsupportedMetaProperty,f.property,{target:G.name,onlyValidPropertyName:X});return this.finishNode(f,"MetaProperty")}parseImportMetaProperty(f){let G=this.createIdentifier(this.startNodeAtNode(f),"import");if(this.next(),this.isContextual(101)){if(!this.inModule)this.raise($.ImportMetaOutsideModule,G);this.sawUnambiguousESM=!0}else if(this.isContextual(105)||this.isContextual(97)){let X=this.isContextual(105);if(this.expectPlugin(X?"sourcePhaseImports":"deferredImportEvaluation"),!(this.optionFlags&256))throw this.raise($.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),f.phase=X?"source":"defer",this.parseImportCall(f)}return this.parseMetaProperty(f,G,"meta")}parseLiteralAtNode(f,G,X){return this.addExtra(X,"rawValue",f),this.addExtra(X,"raw",this.input.slice(this.offsetToSourcePos(X.start),this.state.end)),X.value=f,this.next(),this.finishNode(X,G)}parseLiteral(f,G){let X=this.startNode();return this.parseLiteralAtNode(f,G,X)}parseStringLiteral(f){return this.parseLiteral(f,"StringLiteral")}parseNumericLiteral(f){return this.parseLiteral(f,"NumericLiteral")}parseBigIntLiteral(f){return this.parseLiteral(f,"BigIntLiteral")}parseDecimalLiteral(f){return this.parseLiteral(f,"DecimalLiteral")}parseRegExpLiteral(f){let G=this.startNode();return this.addExtra(G,"raw",this.input.slice(this.offsetToSourcePos(G.start),this.state.end)),G.pattern=f.pattern,G.flags=f.flags,this.next(),this.finishNode(G,"RegExpLiteral")}parseBooleanLiteral(f){let G=this.startNode();return G.value=f,this.next(),this.finishNode(G,"BooleanLiteral")}parseNullLiteral(){let f=this.startNode();return this.next(),this.finishNode(f,"NullLiteral")}parseParenAndDistinguishExpression(f){let G=this.state.startLoc,X;this.next(),this.expressionScope.enter(JJf());let W=this.state.maybeInArrowParameters,R=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let J=this.state.startLoc,U=[],V=new WX,H=!0,Q,Y;while(!this.match(11)){if(H)H=!1;else if(this.expect(12,V.optionalParametersLoc===null?null:V.optionalParametersLoc),this.match(11)){Y=this.state.startLoc;break}if(this.match(21)){let A=this.state.startLoc;if(Q=this.state.startLoc,U.push(this.parseParenItem(this.parseRestBinding(),A)),!this.checkCommaAfterRest(41))break}else U.push(this.parseMaybeAssignAllowIn(V,this.parseParenItem))}let F=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=W,this.state.inFSharpPipelineDirectBody=R;let q=this.startNodeAt(G);if(f&&this.shouldParseArrow(U)&&(q=this.parseArrow(q)))return this.checkDestructuringPrivate(V),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(q,U,!1),q;if(this.expressionScope.exit(),!U.length)this.unexpected(this.state.lastTokStartLoc);if(Y)this.unexpected(Y);if(Q)this.unexpected(Q);if(this.checkExpressionErrors(V,!0),this.toReferencedListDeep(U,!0),U.length>1)X=this.startNodeAt(J),X.expressions=U,this.finishNode(X,"SequenceExpression"),this.resetEndLocation(X,F);else X=U[0];return this.wrapParenthesis(G,X)}wrapParenthesis(f,G){if(!(this.optionFlags&512))return this.addExtra(G,"parenthesized",!0),this.addExtra(G,"parenStart",f.index),this.takeSurroundingComments(G,f.index,this.state.lastTokEndLoc.index),G;let X=this.startNodeAt(f);return X.expression=G,this.finishNode(X,"ParenthesizedExpression")}shouldParseArrow(f){return!this.canInsertSemicolon()}parseArrow(f){if(this.eat(19))return f}parseParenItem(f,G){return f}parseNewOrNewTarget(){let f=this.startNode();if(this.next(),this.match(16)){let G=this.createIdentifier(this.startNodeAtNode(f),"new");this.next();let X=this.parseMetaProperty(f,G,"target");if(!this.scope.inNonArrowFunction&&!this.scope.inClass&&!(this.optionFlags&4))this.raise($.UnexpectedNewTarget,X);return X}return this.parseNew(f)}parseNew(f){if(this.parseNewCallee(f),this.eat(10)){let G=this.parseExprList(11);this.toReferencedList(G),f.arguments=G}else f.arguments=[];return this.finishNode(f,"NewExpression")}parseNewCallee(f){let G=this.match(83),X=this.parseNoCallExpr();if(f.callee=X,G&&(X.type==="Import"||X.type==="ImportExpression"))this.raise($.ImportCallNotNewExpression,X)}parseTemplateElement(f){let{start:G,startLoc:X,end:W,value:R}=this.state,J=G+1,U=this.startNodeAt(xf(X,1));if(R===null){if(!f)this.raise($.InvalidEscapeSequenceTemplate,xf(this.state.firstInvalidTemplateEscapePos,1))}let V=this.match(24),H=V?-1:-2,Q=W+H;U.value={raw:this.input.slice(J,Q).replace(/\r\n?/g,`
|
|
23
|
-
`),cooked:R===null?null:R.slice(1,H)},U.tail=V,this.next();let Y=this.finishNode(U,"TemplateElement");return this.resetEndLocation(Y,xf(this.state.lastTokEndLoc,H)),Y}parseTemplate(f){let G=this.startNode(),X=this.parseTemplateElement(f),W=[X],R=[];while(!X.tail)R.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),W.push(X=this.parseTemplateElement(f));return G.expressions=R,G.quasis=W,this.finishNode(G,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(f,G,X,W){if(X)this.expectPlugin("recordAndTuple");let R=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let J=!1,U=!0,V=this.startNode();V.properties=[],this.next();while(!this.match(f)){if(U)U=!1;else if(this.expect(12),this.match(f)){this.addTrailingCommaExtraToNode(V);break}let Q;if(G)Q=this.parseBindingProperty();else Q=this.parsePropertyDefinition(W),J=this.checkProto(Q,X,J,W);if(X&&!this.isObjectProperty(Q)&&Q.type!=="SpreadElement")this.raise($.InvalidRecordProperty,Q);if(Q.shorthand)this.addExtra(Q,"shorthand",!0);V.properties.push(Q)}this.next(),this.state.inFSharpPipelineDirectBody=R;let H="ObjectExpression";if(G)H="ObjectPattern";else if(X)H="RecordExpression";return this.finishNode(V,H)}addTrailingCommaExtraToNode(f){this.addExtra(f,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(f,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(f){return!f.computed&&f.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(f){let G=[];if(this.match(26)){if(this.hasPlugin("decorators"))this.raise($.UnsupportedPropertyDecorator,this.state.startLoc);while(this.match(26))G.push(this.parseDecorator())}let X=this.startNode(),W=!1,R=!1,J;if(this.match(21)){if(G.length)this.unexpected();return this.parseSpread()}if(G.length)X.decorators=G,G=[];if(X.method=!1,f)J=this.state.startLoc;let U=this.eat(55);this.parsePropertyNamePrefixOperator(X);let V=this.state.containsEsc;if(this.parsePropertyName(X,f),!U&&!V&&this.maybeAsyncOrAccessorProp(X)){let{key:H}=X,Q=H.name;if(Q==="async"&&!this.hasPrecedingLineBreak())W=!0,this.resetPreviousNodeTrailingComments(H),U=this.eat(55),this.parsePropertyName(X);if(Q==="get"||Q==="set"){if(R=!0,this.resetPreviousNodeTrailingComments(H),X.kind=Q,this.match(55))U=!0,this.raise($.AccessorIsGenerator,this.state.curPosition(),{kind:Q}),this.next();this.parsePropertyName(X)}}return this.parseObjPropValue(X,J,U,W,!1,R,f)}getGetterSetterExpectedParamCount(f){return f.kind==="get"?0:1}getObjectOrClassMethodParams(f){return f.params}checkGetterSetterParams(f){var G;let X=this.getGetterSetterExpectedParamCount(f),W=this.getObjectOrClassMethodParams(f);if(W.length!==X)this.raise(f.kind==="get"?$.BadGetterArity:$.BadSetterArity,f);if(f.kind==="set"&&((G=W[W.length-1])==null?void 0:G.type)==="RestElement")this.raise($.BadSetterRestParameter,f)}parseObjectMethod(f,G,X,W,R){if(R){let J=this.parseMethod(f,G,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(J),J}if(X||G||this.match(10)){if(W)this.unexpected();return f.kind="method",f.method=!0,this.parseMethod(f,G,X,!1,!1,"ObjectMethod")}}parseObjectProperty(f,G,X,W){if(f.shorthand=!1,this.eat(14))return f.value=X?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(W),this.finishNode(f,"ObjectProperty");if(!f.computed&&f.key.type==="Identifier"){if(this.checkReservedWord(f.key.name,f.key.loc.start,!0,!1),X)f.value=this.parseMaybeDefault(G,LG(f.key));else if(this.match(29)){let R=this.state.startLoc;if(W!=null){if(W.shorthandAssignLoc===null)W.shorthandAssignLoc=R}else this.raise($.InvalidCoverInitializedName,R);f.value=this.parseMaybeDefault(G,LG(f.key))}else f.value=LG(f.key);return f.shorthand=!0,this.finishNode(f,"ObjectProperty")}}parseObjPropValue(f,G,X,W,R,J,U){let V=this.parseObjectMethod(f,X,W,R,J)||this.parseObjectProperty(f,G,R,U);if(!V)this.unexpected();return V}parsePropertyName(f,G){if(this.eat(0))f.computed=!0,f.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:X,value:W}=this.state,R;if(HG(X))R=this.parseIdentifier(!0);else switch(X){case 135:R=this.parseNumericLiteral(W);break;case 134:R=this.parseStringLiteral(W);break;case 136:R=this.parseBigIntLiteral(W);break;case 139:{let J=this.state.startLoc;if(G!=null){if(G.privateKeyLoc===null)G.privateKeyLoc=J}else this.raise($.UnexpectedPrivateField,J);R=this.parsePrivateName();break}default:if(X===137){R=this.parseDecimalLiteral(W);break}this.unexpected()}if(f.key=R,X!==139)f.computed=!1}}initFunction(f,G){f.id=null,f.generator=!1,f.async=G}parseMethod(f,G,X,W,R,J,U=!1){this.initFunction(f,X),f.generator=G,this.scope.enter(18|(U?64:0)|(R?32:0)),this.prodParam.enter(JW(X,f.generator)),this.parseFunctionParams(f,W);let V=this.parseFunctionBodyAndFinish(f,J,!0);return this.prodParam.exit(),this.scope.exit(),V}parseArrayLike(f,G,X,W){if(X)this.expectPlugin("recordAndTuple");let R=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let J=this.startNode();return this.next(),J.elements=this.parseExprList(f,!X,W,J),this.state.inFSharpPipelineDirectBody=R,this.finishNode(J,X?"TupleExpression":"ArrayExpression")}parseArrowExpression(f,G,X,W){this.scope.enter(6);let R=JW(X,!1);if(!this.match(5)&&this.prodParam.hasIn)R|=8;this.prodParam.enter(R),this.initFunction(f,X);let J=this.state.maybeInArrowParameters;if(G)this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(f,G,W);return this.state.maybeInArrowParameters=!1,this.parseFunctionBody(f,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=J,this.finishNode(f,"ArrowFunctionExpression")}setArrowFunctionParameters(f,G,X){this.toAssignableList(G,X,!1),f.params=G}parseFunctionBodyAndFinish(f,G,X=!1){return this.parseFunctionBody(f,!1,X),this.finishNode(f,G)}parseFunctionBody(f,G,X=!1){let W=G&&!this.match(5);if(this.expressionScope.enter(r9()),W)f.body=this.parseMaybeAssign(),this.checkParams(f,!1,G,!1);else{let R=this.state.strict,J=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),f.body=this.parseBlock(!0,!1,(U)=>{let V=!this.isSimpleParamList(f.params);if(U&&V)this.raise($.IllegalLanguageModeDirective,(f.kind==="method"||f.kind==="constructor")&&!!f.key?f.key.loc.end:f);let H=!R&&this.state.strict;if(this.checkParams(f,!this.state.strict&&!G&&!X&&!V,G,H),this.state.strict&&f.id)this.checkIdentifier(f.id,65,H)}),this.prodParam.exit(),this.state.labels=J}this.expressionScope.exit()}isSimpleParameter(f){return f.type==="Identifier"}isSimpleParamList(f){for(let G=0,X=f.length;G<X;G++)if(!this.isSimpleParameter(f[G]))return!1;return!0}checkParams(f,G,X,W=!0){let R=!G&&new Set,J={type:"FormalParameters"};for(let U of f.params)this.checkLVal(U,J,5,R,W)}parseExprList(f,G,X,W){let R=[],J=!0;while(!this.eat(f)){if(J)J=!1;else if(this.expect(12),this.match(f)){if(W)this.addTrailingCommaExtraToNode(W);this.next();break}R.push(this.parseExprListItem(G,X))}return R}parseExprListItem(f,G,X){let W;if(this.match(12)){if(!f)this.raise($.UnexpectedToken,this.state.curPosition(),{unexpected:","});W=null}else if(this.match(21)){let R=this.state.startLoc;W=this.parseParenItem(this.parseSpread(G),R)}else if(this.match(17)){if(this.expectPlugin("partialApplication"),!X)this.raise($.UnexpectedArgumentPlaceholder,this.state.startLoc);let R=this.startNode();this.next(),W=this.finishNode(R,"ArgumentPlaceholder")}else W=this.parseMaybeAssignAllowIn(G,this.parseParenItem);return W}parseIdentifier(f){let G=this.startNode(),X=this.parseIdentifierName(f);return this.createIdentifier(G,X)}createIdentifier(f,G){return f.name=G,f.loc.identifierName=G,this.finishNode(f,"Identifier")}parseIdentifierName(f){let G,{startLoc:X,type:W}=this.state;if(HG(W))G=this.state.value;else this.unexpected();let R=ERf(W);if(f){if(R)this.replaceToken(132)}else this.checkReservedWord(G,X,R,!1);return this.next(),G}checkReservedWord(f,G,X,W){if(f.length>10)return;if(!tRf(f))return;if(X&&sRf(f)){this.raise($.UnexpectedKeyword,G,{keyword:f});return}if((!this.state.strict?E9:W?v9:w9)(f,this.inModule)){this.raise($.UnexpectedReservedWord,G,{reservedWord:f});return}else if(f==="yield"){if(this.prodParam.hasYield){this.raise($.YieldBindingIdentifier,G);return}}else if(f==="await"){if(this.prodParam.hasAwait){this.raise($.AwaitBindingIdentifier,G);return}if(this.scope.inStaticBlock){this.raise($.AwaitBindingIdentifierInStaticBlock,G);return}this.expressionScope.recordAsyncArrowParametersError(G)}else if(f==="arguments"){if(this.scope.inClassAndNotInNonArrowFunction){this.raise($.ArgumentsInClass,G);return}}}recordAwaitIfAllowed(){let f=this.prodParam.hasAwait||this.optionFlags&1&&!this.scope.inFunction;if(f&&!this.scope.inFunction)this.state.hasTopLevelAwait=!0;return f}parseAwait(f){let G=this.startNodeAt(f);if(this.expressionScope.recordParameterInitializerError($.AwaitExpressionFormalParameter,G),this.eat(55))this.raise($.ObsoleteAwaitStar,G);if(!this.scope.inFunction&&!(this.optionFlags&1))if(this.isAmbiguousAwait())this.ambiguousScriptDifferentAst=!0;else this.sawUnambiguousESM=!0;if(!this.state.soloAwait)G.argument=this.parseMaybeUnary(null,!0);return this.finishNode(G,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:f}=this.state;return f===53||f===10||f===0||UW(f)||f===102&&!this.state.containsEsc||f===138||f===56||this.hasPlugin("v8intrinsic")&&f===54}parseYield(){let f=this.startNode();this.expressionScope.recordParameterInitializerError($.YieldInParameter,f),this.next();let G=!1,X=null;if(!this.hasPrecedingLineBreak())switch(G=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!G)break;default:X=this.parseMaybeAssign()}return f.delegate=G,f.argument=X,this.finishNode(f,"YieldExpression")}parseImportCall(f){if(this.next(),f.source=this.parseMaybeAssignAllowIn(),f.options=null,this.eat(12)){if(!this.match(11)){if(f.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&!this.match(11)){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise($.ImportCallArity,f)}}}return this.expect(11),this.finishNode(f,"ImportExpression")}checkPipelineAtInfixOperator(f,G){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){if(f.type==="SequenceExpression")this.raise($.PipelineHeadSequenceExpression,G)}}parseSmartPipelineBodyInStyle(f,G){if(this.isSimpleReference(f)){let X=this.startNodeAt(G);return X.callee=f,this.finishNode(X,"PipelineBareFunction")}else{let X=this.startNodeAt(G);return this.checkSmartPipeTopicBodyEarlyErrors(G),X.expression=f,this.finishNode(X,"PipelineTopicExpression")}}isSimpleReference(f){switch(f.type){case"MemberExpression":return!f.computed&&this.isSimpleReference(f.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(f){if(this.match(19))throw this.raise($.PipelineBodyNoArrow,this.state.startLoc);if(!this.topicReferenceWasUsedInCurrentContext())this.raise($.PipelineTopicUnused,f)}withTopicBindingContext(f){let G=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return f()}finally{this.state.topicContext=G}}withSmartMixTopicForbiddingContext(f){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let G=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return f()}finally{this.state.topicContext=G}}else return f()}withSoloAwaitPermittingContext(f){let G=this.state.soloAwait;this.state.soloAwait=!0;try{return f()}finally{this.state.soloAwait=G}}allowInAnd(f){let G=this.prodParam.currentFlags();if(8&~G){this.prodParam.enter(G|8);try{return f()}finally{this.prodParam.exit()}}return f()}disallowInAnd(f){let G=this.prodParam.currentFlags();if(8&G){this.prodParam.enter(G&-9);try{return f()}finally{this.prodParam.exit()}}return f()}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(f){let G=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let X=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let W=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),G,f);return this.state.inFSharpPipelineDirectBody=X,W}parseModuleExpression(){this.expectPlugin("moduleBlocks");let f=this.startNode();if(this.next(),!this.match(5))this.unexpected(null,5);let G=this.startNodeAt(this.state.endLoc);this.next();let X=this.initializeScopes(!0);this.enterInitialScopes();try{f.body=this.parseProgram(G,8,"module")}finally{X()}return this.finishNode(f,"ModuleExpression")}parsePropertyNamePrefixOperator(f){}}var CR={kind:1},NJf={kind:2},LJf=/[\uD800-\uDFFF]/u,qR=/in(?:stanceof)?/y;function bJf(f,G,X){for(let W=0;W<f.length;W++){let R=f[W],{type:J}=R;if(typeof J==="number"){{if(J===139){let{loc:U,start:V,value:H,end:Q}=R,Y=V+1,F=xf(U.start,1);f.splice(W,1,new PG({type:jG(27),value:"#",start:V,end:Y,startLoc:U.start,endLoc:F}),new PG({type:jG(132),value:H,start:Y,end:Q,startLoc:F,endLoc:U.end})),W++;continue}if(UW(J)){let{loc:U,start:V,value:H,end:Q}=R,Y=V+1,F=xf(U.start,1),q;if(G.charCodeAt(V-X)===96)q=new PG({type:jG(22),value:"`",start:V,end:Y,startLoc:U.start,endLoc:F});else q=new PG({type:jG(8),value:"}",start:V,end:Y,startLoc:U.start,endLoc:F});let A,j,b,I;if(J===24)j=Q-1,b=xf(U.end,-1),A=H===null?null:H.slice(1,-1),I=new PG({type:jG(22),value:"`",start:j,end:Q,startLoc:b,endLoc:U.end});else j=Q-2,b=xf(U.end,-2),A=H===null?null:H.slice(1,-2),I=new PG({type:jG(23),value:"${",start:j,end:Q,startLoc:b,endLoc:U.end});f.splice(W,1,q,new PG({type:jG(20),value:A,start:Y,end:j,startLoc:F,endLoc:b}),I),W+=2;continue}}R.type=jG(J)}}return f}class R8 extends W8{parseTopLevel(f,G){if(f.program=this.parseProgram(G),f.comments=this.comments,this.optionFlags&128)f.tokens=bJf(this.tokens,this.input,this.startIndex);return this.finishNode(f,"File")}parseProgram(f,G=140,X=this.options.sourceType){if(f.sourceType=X,f.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(f,!0,!0,G),this.inModule){if(!(this.optionFlags&32)&&this.scope.undefinedExports.size>0)for(let[R,J]of Array.from(this.scope.undefinedExports))this.raise($.ModuleExportUndefined,J,{localName:R});this.addExtra(f,"topLevelAwait",this.state.hasTopLevelAwait)}let W;if(G===140)W=this.finishNode(f,"Program");else W=this.finishNodeAt(f,"Program",xf(this.state.startLoc,-1));return W}stmtToDirective(f){let G=f;G.type="Directive",G.value=G.expression,delete G.expression;let X=G.value,W=X.value,R=this.input.slice(this.offsetToSourcePos(X.start),this.offsetToSourcePos(X.end)),J=X.value=R.slice(1,-1);return this.addExtra(X,"raw",R),this.addExtra(X,"rawValue",J),this.addExtra(X,"expressionValue",W),X.type="DirectiveLiteral",G}parseInterpreterDirective(){if(!this.match(28))return null;let f=this.startNode();return f.value=this.state.value,this.next(),this.finishNode(f,"InterpreterDirective")}isLet(){if(!this.isContextual(100))return!1;return this.hasFollowingBindingAtom()}chStartsBindingIdentifier(f,G){if(IG(f)){if(qR.lastIndex=G,qR.test(this.input)){let X=this.codePointAtPos(qR.lastIndex);if(!q1(X)&&X!==92)return!1}return!0}else if(f===92)return!0;else return!1}chStartsBindingPattern(f){return f===91||f===123}hasFollowingBindingAtom(){let f=this.nextTokenStart(),G=this.codePointAtPos(f);return this.chStartsBindingPattern(G)||this.chStartsBindingIdentifier(G,f)}hasInLineFollowingBindingIdentifierOrBrace(){let f=this.nextTokenInLineStart(),G=this.codePointAtPos(f);return G===123||this.chStartsBindingIdentifier(G,f)}startsUsingForOf(){let{type:f,containsEsc:G}=this.lookahead();if(f===102&&!G)return!1;else if($f(f)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let f=this.nextTokenInLineStart();if(this.isUnparsedContextual(f,"using")){f=this.nextTokenInLineStartSince(f+5);let G=this.codePointAtPos(f);if(this.chStartsBindingIdentifier(G,f))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(f=!1){let G=0;if(this.options.annexB&&!this.state.strict){if(G|=4,f)G|=8}return this.parseStatementLike(G)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(f){let G=null;if(this.match(26))G=this.parseDecorators(!0);return this.parseStatementContent(f,G)}parseStatementContent(f,G){let X=this.state.type,W=this.startNode(),R=!!(f&2),J=!!(f&4),U=f&1;switch(X){case 60:return this.parseBreakContinueStatement(W,!0);case 63:return this.parseBreakContinueStatement(W,!1);case 64:return this.parseDebuggerStatement(W);case 90:return this.parseDoWhileStatement(W);case 91:return this.parseForStatement(W);case 68:if(this.lookaheadCharCode()===46)break;if(!J)this.raise(this.state.strict?$.StrictFunction:this.options.annexB?$.SloppyFunctionAnnexB:$.SloppyFunction,this.state.startLoc);return this.parseFunctionStatement(W,!1,!R&&J);case 80:if(!R)this.unexpected();return this.parseClass(this.maybeTakeDecorators(G,W),!0);case 69:return this.parseIfStatement(W);case 70:return this.parseReturnStatement(W);case 71:return this.parseSwitchStatement(W);case 72:return this.parseThrowStatement(W);case 73:return this.parseTryStatement(W);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing()){if(!this.recordAwaitIfAllowed())this.raise($.AwaitUsingNotInAsyncContext,W);else if(!R)this.raise($.UnexpectedLexicalDeclaration,W);return this.next(),this.parseVarStatement(W,"await using")}break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;if(this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel)this.raise($.UnexpectedUsingDeclaration,this.state.startLoc);else if(!R)this.raise($.UnexpectedLexicalDeclaration,this.state.startLoc);return this.parseVarStatement(W,"using");case 100:{if(this.state.containsEsc)break;let Q=this.nextTokenStart(),Y=this.codePointAtPos(Q);if(Y!==91){if(!R&&this.hasFollowingLineBreak())break;if(!this.chStartsBindingIdentifier(Y,Q)&&Y!==123)break}}case 75:if(!R)this.raise($.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let Q=this.state.value;return this.parseVarStatement(W,Q)}case 92:return this.parseWhileStatement(W);case 76:return this.parseWithStatement(W);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(W);case 83:{let Q=this.lookaheadCharCode();if(Q===40||Q===46)break}case 82:{if(!(this.optionFlags&8)&&!U)this.raise($.UnexpectedImportExport,this.state.startLoc);this.next();let Q;if(X===83)Q=this.parseImport(W);else Q=this.parseExport(W,G);return this.assertModuleNodeAllowed(Q),Q}default:if(this.isAsyncFunction()){if(!R)this.raise($.AsyncFunctionInSingleStatementContext,this.state.startLoc);return this.next(),this.parseFunctionStatement(W,!0,!R&&J)}}let V=this.state.value,H=this.parseExpression();if($f(X)&&H.type==="Identifier"&&this.eat(14))return this.parseLabeledStatement(W,V,H,f);else return this.parseExpressionStatement(W,H,G)}assertModuleNodeAllowed(f){if(!(this.optionFlags&8)&&!this.inModule)this.raise($.ImportOutsideModule,f)}decoratorsEnabledBeforeExport(){if(this.hasPlugin("decorators-legacy"))return!0;return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(f,G,X){if(f){var W;if((W=G.decorators)!=null&&W.length){if(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!=="boolean")this.raise($.DecoratorsBeforeAfterExport,G.decorators[0]);G.decorators.unshift(...f)}else G.decorators=f;if(this.resetStartLocationFromNode(G,f[0]),X)this.resetStartLocationFromNode(X,G)}return G}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(f){let G=[];do G.push(this.parseDecorator());while(this.match(26));if(this.match(82)){if(!f)this.unexpected();if(!this.decoratorsEnabledBeforeExport())this.raise($.DecoratorExportClass,this.state.startLoc)}else if(!this.canHaveLeadingDecorator())throw this.raise($.UnexpectedLeadingDecorator,this.state.startLoc);return G}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let f=this.startNode();if(this.next(),this.hasPlugin("decorators")){let G=this.state.startLoc,X;if(this.match(10)){let W=this.state.startLoc;this.next(),X=this.parseExpression(),this.expect(11),X=this.wrapParenthesis(W,X);let R=this.state.startLoc;if(f.expression=this.parseMaybeDecoratorArguments(X,W),this.getPluginOption("decorators","allowCallParenthesized")===!1&&f.expression!==X)this.raise($.DecoratorArgumentsOutsideParentheses,R)}else{X=this.parseIdentifier(!1);while(this.eat(16)){let W=this.startNodeAt(G);if(W.object=X,this.match(139))this.classScope.usePrivateName(this.state.value,this.state.startLoc),W.property=this.parsePrivateName();else W.property=this.parseIdentifier(!0);W.computed=!1,X=this.finishNode(W,"MemberExpression")}f.expression=this.parseMaybeDecoratorArguments(X,G)}}else f.expression=this.parseExprSubscripts();return this.finishNode(f,"Decorator")}parseMaybeDecoratorArguments(f,G){if(this.eat(10)){let X=this.startNodeAt(G);return X.callee=f,X.arguments=this.parseCallExpressionArguments(11),this.toReferencedList(X.arguments),this.finishNode(X,"CallExpression")}return f}parseBreakContinueStatement(f,G){if(this.next(),this.isLineTerminator())f.label=null;else f.label=this.parseIdentifier(),this.semicolon();return this.verifyBreakContinue(f,G),this.finishNode(f,G?"BreakStatement":"ContinueStatement")}verifyBreakContinue(f,G){let X;for(X=0;X<this.state.labels.length;++X){let W=this.state.labels[X];if(f.label==null||W.name===f.label.name){if(W.kind!=null&&(G||W.kind===1))break;if(f.label&&G)break}}if(X===this.state.labels.length){let W=G?"BreakStatement":"ContinueStatement";this.raise($.IllegalBreakContinue,f,{type:W})}}parseDebuggerStatement(f){return this.next(),this.semicolon(),this.finishNode(f,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let f=this.parseExpression();return this.expect(11),f}parseDoWhileStatement(f){return this.next(),this.state.labels.push(CR),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),f.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(f,"DoWhileStatement")}parseForStatement(f){this.next(),this.state.labels.push(CR);let G=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed())G=this.state.startLoc,this.next();if(this.scope.enter(0),this.expect(10),this.match(13)){if(G!==null)this.unexpected(G);return this.parseFor(f,null)}let X=this.isContextual(100);{let V=this.isContextual(96)&&this.startsAwaitUsing(),H=V||this.isContextual(107)&&this.startsUsingForOf(),Q=X&&this.hasFollowingBindingAtom()||H;if(this.match(74)||this.match(75)||Q){let Y=this.startNode(),F;if(V){if(F="await using",!this.recordAwaitIfAllowed())this.raise($.AwaitUsingNotInAsyncContext,this.state.startLoc);this.next()}else F=this.state.value;this.next(),this.parseVar(Y,!0,F);let q=this.finishNode(Y,"VariableDeclaration"),A=this.match(58);if(A&&H)this.raise($.ForInUsing,q);if((A||this.isContextual(102))&&q.declarations.length===1)return this.parseForIn(f,q,G);if(G!==null)this.unexpected(G);return this.parseFor(f,q)}}let W=this.isContextual(95),R=new WX,J=this.parseExpression(!0,R),U=this.isContextual(102);if(U){if(X)this.raise($.ForOfLet,J);if(G===null&&W&&J.type==="Identifier")this.raise($.ForOfAsync,J)}if(U||this.match(58)){this.checkDestructuringPrivate(R),this.toAssignable(J,!0);let V=U?"ForOfStatement":"ForInStatement";return this.checkLVal(J,{type:V}),this.parseForIn(f,J,G)}else this.checkExpressionErrors(R,!0);if(G!==null)this.unexpected(G);return this.parseFor(f,J)}parseFunctionStatement(f,G,X){return this.next(),this.parseFunction(f,1|(X?2:0)|(G?8:0))}parseIfStatement(f){return this.next(),f.test=this.parseHeaderExpression(),f.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),f.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(f,"IfStatement")}parseReturnStatement(f){if(!this.prodParam.hasReturn&&!(this.optionFlags&2))this.raise($.IllegalReturn,this.state.startLoc);if(this.next(),this.isLineTerminator())f.argument=null;else f.argument=this.parseExpression(),this.semicolon();return this.finishNode(f,"ReturnStatement")}parseSwitchStatement(f){this.next(),f.discriminant=this.parseHeaderExpression();let G=f.cases=[];this.expect(5),this.state.labels.push(NJf),this.scope.enter(0);let X;for(let W;!this.match(8);)if(this.match(61)||this.match(65)){let R=this.match(61);if(X)this.finishNode(X,"SwitchCase");if(G.push(X=this.startNode()),X.consequent=[],this.next(),R)X.test=this.parseExpression();else{if(W)this.raise($.MultipleDefaultsInSwitch,this.state.lastTokStartLoc);W=!0,X.test=null}this.expect(14)}else if(X)X.consequent.push(this.parseStatementListItem());else this.unexpected();if(this.scope.exit(),X)this.finishNode(X,"SwitchCase");return this.next(),this.state.labels.pop(),this.finishNode(f,"SwitchStatement")}parseThrowStatement(f){if(this.next(),this.hasPrecedingLineBreak())this.raise($.NewlineAfterThrow,this.state.lastTokEndLoc);return f.argument=this.parseExpression(),this.semicolon(),this.finishNode(f,"ThrowStatement")}parseCatchClauseParam(){let f=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&f.type==="Identifier"?8:0),this.checkLVal(f,{type:"CatchClause"},9),f}parseTryStatement(f){if(this.next(),f.block=this.parseBlock(),f.handler=null,this.match(62)){let G=this.startNode();if(this.next(),this.match(10))this.expect(10),G.param=this.parseCatchClauseParam(),this.expect(11);else G.param=null,this.scope.enter(0);G.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),f.handler=this.finishNode(G,"CatchClause")}if(f.finalizer=this.eat(67)?this.parseBlock():null,!f.handler&&!f.finalizer)this.raise($.NoCatchOrFinally,f);return this.finishNode(f,"TryStatement")}parseVarStatement(f,G,X=!1){return this.next(),this.parseVar(f,!1,G,X),this.semicolon(),this.finishNode(f,"VariableDeclaration")}parseWhileStatement(f){return this.next(),f.test=this.parseHeaderExpression(),this.state.labels.push(CR),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(f,"WhileStatement")}parseWithStatement(f){if(this.state.strict)this.raise($.StrictWith,this.state.startLoc);return this.next(),f.object=this.parseHeaderExpression(),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(f,"WithStatement")}parseEmptyStatement(f){return this.next(),this.finishNode(f,"EmptyStatement")}parseLabeledStatement(f,G,X,W){for(let J of this.state.labels)if(J.name===G)this.raise($.LabelRedeclaration,X,{labelName:G});let R=vRf(this.state.type)?1:this.match(71)?2:null;for(let J=this.state.labels.length-1;J>=0;J--){let U=this.state.labels[J];if(U.statementStart===f.start)U.statementStart=this.sourceToOffsetPos(this.state.start),U.kind=R;else break}return this.state.labels.push({name:G,kind:R,statementStart:this.sourceToOffsetPos(this.state.start)}),f.body=W&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),f.label=X,this.finishNode(f,"LabeledStatement")}parseExpressionStatement(f,G,X){return f.expression=G,this.semicolon(),this.finishNode(f,"ExpressionStatement")}parseBlock(f=!1,G=!0,X){let W=this.startNode();if(f)this.state.strictErrors.clear();if(this.expect(5),G)this.scope.enter(0);if(this.parseBlockBody(W,f,!1,8,X),G)this.scope.exit();return this.finishNode(W,"BlockStatement")}isValidDirective(f){return f.type==="ExpressionStatement"&&f.expression.type==="StringLiteral"&&!f.expression.extra.parenthesized}parseBlockBody(f,G,X,W,R){let J=f.body=[],U=f.directives=[];this.parseBlockOrModuleBlockBody(J,G?U:void 0,X,W,R)}parseBlockOrModuleBlockBody(f,G,X,W,R){let J=this.state.strict,U=!1,V=!1;while(!this.match(W)){let H=X?this.parseModuleItem():this.parseStatementListItem();if(G&&!V){if(this.isValidDirective(H)){let Q=this.stmtToDirective(H);if(G.push(Q),!U&&Q.value.value==="use strict")U=!0,this.setStrict(!0);continue}V=!0,this.state.strictErrors.clear()}f.push(H)}if(R==null||R.call(this,U),!J)this.setStrict(!1);this.next()}parseFor(f,G){return f.init=G,this.semicolon(!1),f.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),f.update=this.match(11)?null:this.parseExpression(),this.expect(11),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(f,"ForStatement")}parseForIn(f,G,X){let W=this.match(58);if(this.next(),W){if(X!==null)this.unexpected(X)}else f.await=X!==null;if(G.type==="VariableDeclaration"&&G.declarations[0].init!=null&&(!W||!this.options.annexB||this.state.strict||G.kind!=="var"||G.declarations[0].id.type!=="Identifier"))this.raise($.ForInOfLoopInitializer,G,{type:W?"ForInStatement":"ForOfStatement"});if(G.type==="AssignmentPattern")this.raise($.InvalidLhs,G,{ancestor:{type:"ForStatement"}});return f.left=G,f.right=W?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(f,W?"ForInStatement":"ForOfStatement")}parseVar(f,G,X,W=!1){let R=f.declarations=[];f.kind=X;for(;;){let J=this.startNode();if(this.parseVarId(J,X),J.init=!this.eat(29)?null:G?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn(),J.init===null&&!W){if(J.id.type!=="Identifier"&&!(G&&(this.match(58)||this.isContextual(102))))this.raise($.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"});else if((X==="const"||X==="using"||X==="await using")&&!(this.match(58)||this.isContextual(102)))this.raise($.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:X})}if(R.push(this.finishNode(J,"VariableDeclarator")),!this.eat(12))break}return f}parseVarId(f,G){let X=this.parseBindingAtom();if(G==="using"||G==="await using"){if(X.type==="ArrayPattern"||X.type==="ObjectPattern")this.raise($.UsingDeclarationHasBindingPattern,X.loc.start)}this.checkLVal(X,{type:"VariableDeclarator"},G==="var"?5:8201),f.id=X}parseAsyncFunctionExpression(f){return this.parseFunction(f,8)}parseFunction(f,G=0){let X=G&2,W=!!(G&1),R=W&&!(G&4),J=!!(G&8);if(this.initFunction(f,J),this.match(55)){if(X)this.raise($.GeneratorInSingleStatementContext,this.state.startLoc);this.next(),f.generator=!0}if(W)f.id=this.parseFunctionId(R);let U=this.state.maybeInArrowParameters;if(this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(JW(J,f.generator)),!W)f.id=this.parseFunctionId();if(this.parseFunctionParams(f,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(f,W?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),W&&!X)this.registerFunctionStatementId(f);return this.state.maybeInArrowParameters=U,f}parseFunctionId(f){return f||$f(this.state.type)?this.parseIdentifier():null}parseFunctionParams(f,G){this.expect(10),this.expressionScope.enter(RJf()),f.params=this.parseBindingList(11,41,2|(G?4:0)),this.expressionScope.exit()}registerFunctionStatementId(f){if(!f.id)return;this.scope.declareName(f.id.name,!this.options.annexB||this.state.strict||f.generator||f.async?this.scope.treatFunctionsAsVar?5:8201:17,f.id.loc.start)}parseClass(f,G,X){this.next();let W=this.state.strict;return this.state.strict=!0,this.parseClassId(f,G,X),this.parseClassSuper(f),f.body=this.parseClassBody(!!f.superClass,W),this.finishNode(f,G?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(f){return f.type==="Identifier"&&f.name==="constructor"||f.type==="StringLiteral"&&f.value==="constructor"}isNonstaticConstructor(f){return!f.computed&&!f.static&&this.nameIsConstructor(f.key)}parseClassBody(f,G){this.classScope.enter();let X={hadConstructor:!1,hadSuperClass:f},W=[],R=this.startNode();if(R.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{while(!this.match(8)){if(this.eat(13)){if(W.length>0)throw this.raise($.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){W.push(this.parseDecorator());continue}let J=this.startNode();if(W.length)J.decorators=W,this.resetStartLocationFromNode(J,W[0]),W=[];if(this.parseClassMember(R,J,X),J.kind==="constructor"&&J.decorators&&J.decorators.length>0)this.raise($.DecoratorConstructor,J)}}),this.state.strict=G,this.next(),W.length)throw this.raise($.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(R,"ClassBody")}parseClassMemberFromModifier(f,G){let X=this.parseIdentifier(!0);if(this.isClassMethod()){let W=G;return W.kind="method",W.computed=!1,W.key=X,W.static=!1,this.pushClassMethod(f,W,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let W=G;return W.computed=!1,W.key=X,W.static=!1,f.body.push(this.parseClassProperty(W)),!0}return this.resetPreviousNodeTrailingComments(X),!1}parseClassMember(f,G,X){let W=this.isContextual(106);if(W){if(this.parseClassMemberFromModifier(f,G))return;if(this.eat(5)){this.parseClassStaticBlock(f,G);return}}this.parseClassMemberWithIsStatic(f,G,X,W)}parseClassMemberWithIsStatic(f,G,X,W){let R=G,J=G,U=G,V=G,H=G,Q=R,Y=R;if(G.static=W,this.parsePropertyNamePrefixOperator(G),this.eat(55)){Q.kind="method";let I=this.match(139);if(this.parseClassElementName(Q),I){this.pushClassPrivateMethod(f,J,!0,!1);return}if(this.isNonstaticConstructor(R))this.raise($.ConstructorIsGenerator,R.key);this.pushClassMethod(f,R,!0,!1,!1,!1);return}let F=!this.state.containsEsc&&$f(this.state.type),q=this.parseClassElementName(G),A=F?q.name:null,j=this.isPrivateName(q),b=this.state.startLoc;if(this.parsePostMemberNameModifiers(Y),this.isClassMethod()){if(Q.kind="method",j){this.pushClassPrivateMethod(f,J,!1,!1);return}let I=this.isNonstaticConstructor(R),L=!1;if(I){if(R.kind="constructor",X.hadConstructor&&!this.hasPlugin("typescript"))this.raise($.DuplicateConstructor,q);if(I&&this.hasPlugin("typescript")&&G.override)this.raise($.OverrideOnConstructor,q);X.hadConstructor=!0,L=X.hadSuperClass}this.pushClassMethod(f,R,!1,!1,I,L)}else if(this.isClassProperty())if(j)this.pushClassPrivateProperty(f,V);else this.pushClassProperty(f,U);else if(A==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(q);let I=this.eat(55);if(Y.optional)this.unexpected(b);Q.kind="method";let L=this.match(139);if(this.parseClassElementName(Q),this.parsePostMemberNameModifiers(Y),L)this.pushClassPrivateMethod(f,J,I,!0);else{if(this.isNonstaticConstructor(R))this.raise($.ConstructorIsAsync,R.key);this.pushClassMethod(f,R,I,!0,!1,!1)}}else if((A==="get"||A==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(q),Q.kind=A;let I=this.match(139);if(this.parseClassElementName(R),I)this.pushClassPrivateMethod(f,J,!1,!1);else{if(this.isNonstaticConstructor(R))this.raise($.ConstructorIsAccessor,R.key);this.pushClassMethod(f,R,!1,!1,!1,!1)}this.checkGetterSetterParams(R)}else if(A==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(q);let I=this.match(139);this.parseClassElementName(U),this.pushClassAccessorProperty(f,H,I)}else if(this.isLineTerminator())if(j)this.pushClassPrivateProperty(f,V);else this.pushClassProperty(f,U);else this.unexpected()}parseClassElementName(f){let{type:G,value:X}=this.state;if((G===132||G===134)&&f.static&&X==="prototype")this.raise($.StaticPrototype,this.state.startLoc);if(G===139){if(X==="constructor")this.raise($.ConstructorClassPrivateField,this.state.startLoc);let W=this.parsePrivateName();return f.key=W,W}return this.parsePropertyName(f),f.key}parseClassStaticBlock(f,G){var X;this.scope.enter(208);let W=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let R=G.body=[];if(this.parseBlockOrModuleBlockBody(R,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=W,f.body.push(this.finishNode(G,"StaticBlock")),(X=G.decorators)!=null&&X.length)this.raise($.DecoratorStaticBlock,G)}pushClassProperty(f,G){if(!G.computed&&this.nameIsConstructor(G.key))this.raise($.ConstructorClassField,G.key);f.body.push(this.parseClassProperty(G))}pushClassPrivateProperty(f,G){let X=this.parseClassPrivateProperty(G);f.body.push(X),this.classScope.declarePrivateName(this.getPrivateNameSV(X.key),0,X.key.loc.start)}pushClassAccessorProperty(f,G,X){if(!X&&!G.computed&&this.nameIsConstructor(G.key))this.raise($.ConstructorClassField,G.key);let W=this.parseClassAccessorProperty(G);if(f.body.push(W),X)this.classScope.declarePrivateName(this.getPrivateNameSV(W.key),0,W.key.loc.start)}pushClassMethod(f,G,X,W,R,J){f.body.push(this.parseMethod(G,X,W,R,J,"ClassMethod",!0))}pushClassPrivateMethod(f,G,X,W){let R=this.parseMethod(G,X,W,!1,!1,"ClassPrivateMethod",!0);f.body.push(R);let J=R.kind==="get"?R.static?6:2:R.kind==="set"?R.static?5:1:0;this.declareClassPrivateMethodInScope(R,J)}declareClassPrivateMethodInScope(f,G){this.classScope.declarePrivateName(this.getPrivateNameSV(f.key),G,f.key.loc.start)}parsePostMemberNameModifiers(f){}parseClassPrivateProperty(f){return this.parseInitializer(f),this.semicolon(),this.finishNode(f,"ClassPrivateProperty")}parseClassProperty(f){return this.parseInitializer(f),this.semicolon(),this.finishNode(f,"ClassProperty")}parseClassAccessorProperty(f){return this.parseInitializer(f),this.semicolon(),this.finishNode(f,"ClassAccessorProperty")}parseInitializer(f){this.scope.enter(80),this.expressionScope.enter(r9()),this.prodParam.enter(0),f.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(f,G,X,W=8331){if($f(this.state.type)){if(f.id=this.parseIdentifier(),G)this.declareNameFromIdentifier(f.id,W)}else if(X||!G)f.id=null;else throw this.raise($.MissingClassName,this.state.startLoc)}parseClassSuper(f){f.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(f,G){let X=this.parseMaybeImportPhase(f,!0),W=this.maybeParseExportDefaultSpecifier(f,X),R=!W||this.eat(12),J=R&&this.eatExportStar(f),U=J&&this.maybeParseExportNamespaceSpecifier(f),V=R&&(!U||this.eat(12)),H=W||J;if(J&&!U){if(W)this.unexpected();if(G)throw this.raise($.UnsupportedDecoratorExport,f);return this.parseExportFrom(f,!0),this.sawUnambiguousESM=!0,this.finishNode(f,"ExportAllDeclaration")}let Q=this.maybeParseExportNamedSpecifiers(f);if(W&&R&&!J&&!Q)this.unexpected(null,5);if(U&&V)this.unexpected(null,98);let Y;if(H||Q){if(Y=!1,G)throw this.raise($.UnsupportedDecoratorExport,f);this.parseExportFrom(f,H)}else Y=this.maybeParseExportDeclaration(f);if(H||Q||Y){var F;let q=f;if(this.checkExport(q,!0,!1,!!q.source),((F=q.declaration)==null?void 0:F.type)==="ClassDeclaration")this.maybeTakeDecorators(G,q.declaration,q);else if(G)throw this.raise($.UnsupportedDecoratorExport,f);return this.sawUnambiguousESM=!0,this.finishNode(q,"ExportNamedDeclaration")}if(this.eat(65)){let q=f,A=this.parseExportDefaultExpression();if(q.declaration=A,A.type==="ClassDeclaration")this.maybeTakeDecorators(G,A,q);else if(G)throw this.raise($.UnsupportedDecoratorExport,f);return this.checkExport(q,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(q,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(f){return this.eat(55)}maybeParseExportDefaultSpecifier(f,G){if(G||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",G==null?void 0:G.loc.start);let X=G||this.parseIdentifier(!0),W=this.startNodeAtNode(X);return W.exported=X,f.specifiers=[this.finishNode(W,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(f){if(this.isContextual(93)){var G,X;(X=(G=f).specifiers)!=null||(G.specifiers=[]);let W=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),W.exported=this.parseModuleExportName(),f.specifiers.push(this.finishNode(W,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(f){if(this.match(5)){let G=f;if(!G.specifiers)G.specifiers=[];let X=G.exportKind==="type";if(G.specifiers.push(...this.parseExportSpecifiers(X)),G.source=null,this.hasPlugin("importAssertions"))G.assertions=[];else G.attributes=[];return G.declaration=null,!0}return!1}maybeParseExportDeclaration(f){if(this.shouldParseExportDeclaration()){if(f.specifiers=[],f.source=null,this.hasPlugin("importAssertions"))f.assertions=[];else f.attributes=[];return f.declaration=this.parseExportDeclaration(f),!0}return!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let f=this.nextTokenInLineStart();return this.isUnparsedContextual(f,"function")}parseExportDefaultExpression(){let f=this.startNode();if(this.match(68))return this.next(),this.parseFunction(f,5);else if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(f,13);if(this.match(80))return this.parseClass(f,!0,!0);if(this.match(26)){if(this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0)this.raise($.DecoratorBeforeExport,this.state.startLoc);return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0)}if(this.match(75)||this.match(74)||this.isLet())throw this.raise($.UnsupportedDefaultExport,this.state.startLoc);let G=this.parseMaybeAssignAllowIn();return this.semicolon(),G}parseExportDeclaration(f){if(this.match(80))return this.parseClass(this.startNode(),!0,!1);return this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:f}=this.state;if($f(f)){if(f===95&&!this.state.containsEsc||f===100)return!1;if((f===130||f===129)&&!this.state.containsEsc){let{type:W}=this.lookahead();if($f(W)&&W!==98||W===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let G=this.nextTokenStart(),X=this.isUnparsedContextual(G,"from");if(this.input.charCodeAt(G)===44||$f(this.state.type)&&X)return!0;if(this.match(65)&&X){let W=this.input.charCodeAt(this.nextTokenStartSince(G+4));return W===34||W===39}return!1}parseExportFrom(f,G){if(this.eatContextual(98))f.source=this.parseImportSource(),this.checkExport(f),this.maybeParseImportAttributes(f),this.checkJSONModuleImport(f);else if(G)this.unexpected();this.semicolon()}shouldParseExportDeclaration(){let{type:f}=this.state;if(f===26){if(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators")){if(this.getPluginOption("decorators","decoratorsBeforeExport")===!0)this.raise($.DecoratorBeforeExport,this.state.startLoc);return!0}}if(this.isContextual(107))return this.raise($.UsingDeclarationExport,this.state.startLoc),!0;if(this.isContextual(96)&&this.startsAwaitUsing())return this.raise($.UsingDeclarationExport,this.state.startLoc),!0;return f===74||f===75||f===68||f===80||this.isLet()||this.isAsyncFunction()}checkExport(f,G,X,W){if(G){var R;if(X){if(this.checkDuplicateExports(f,"default"),this.hasPlugin("exportDefaultFrom")){var J;let U=f.declaration;if(U.type==="Identifier"&&U.name==="from"&&U.end-U.start===4&&!((J=U.extra)!=null&&J.parenthesized))this.raise($.ExportDefaultFromAsIdentifier,U)}}else if((R=f.specifiers)!=null&&R.length)for(let U of f.specifiers){let{exported:V}=U,H=V.type==="Identifier"?V.name:V.value;if(this.checkDuplicateExports(U,H),!W&&U.local){let{local:Q}=U;if(Q.type!=="Identifier")this.raise($.ExportBindingIsString,U,{localName:Q.value,exportName:H});else this.checkReservedWord(Q.name,Q.loc.start,!0,!1),this.scope.checkLocalExport(Q)}}else if(f.declaration){let U=f.declaration;if(U.type==="FunctionDeclaration"||U.type==="ClassDeclaration"){let{id:V}=U;if(!V)throw new Error("Assertion failure");this.checkDuplicateExports(f,V.name)}else if(U.type==="VariableDeclaration")for(let V of U.declarations)this.checkDeclaration(V.id)}}}checkDeclaration(f){if(f.type==="Identifier")this.checkDuplicateExports(f,f.name);else if(f.type==="ObjectPattern")for(let G of f.properties)this.checkDeclaration(G);else if(f.type==="ArrayPattern"){for(let G of f.elements)if(G)this.checkDeclaration(G)}else if(f.type==="ObjectProperty")this.checkDeclaration(f.value);else if(f.type==="RestElement")this.checkDeclaration(f.argument);else if(f.type==="AssignmentPattern")this.checkDeclaration(f.left)}checkDuplicateExports(f,G){if(this.exportedIdentifiers.has(G))if(G==="default")this.raise($.DuplicateDefaultExport,f);else this.raise($.DuplicateExport,f,{exportName:G});this.exportedIdentifiers.add(G)}parseExportSpecifiers(f){let G=[],X=!0;this.expect(5);while(!this.eat(8)){if(X)X=!1;else if(this.expect(12),this.eat(8))break;let W=this.isContextual(130),R=this.match(134),J=this.startNode();J.local=this.parseModuleExportName(),G.push(this.parseExportSpecifier(J,R,f,W))}return G}parseExportSpecifier(f,G,X,W){if(this.eatContextual(93))f.exported=this.parseModuleExportName();else if(G)f.exported=HJf(f.local);else if(!f.exported)f.exported=LG(f.local);return this.finishNode(f,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let f=this.parseStringLiteral(this.state.value),G=LJf.exec(f.value);if(G)this.raise($.ModuleExportNameHasLoneSurrogate,f,{surrogateCharCode:G[0].charCodeAt(0)});return f}return this.parseIdentifier(!0)}isJSONModuleImport(f){if(f.assertions!=null)return f.assertions.some(({key:G,value:X})=>{return X.value==="json"&&(G.type==="Identifier"?G.name==="type":G.value==="type")});return!1}checkImportReflection(f){let{specifiers:G}=f,X=G.length===1?G[0].type:null;if(f.phase==="source"){if(X!=="ImportDefaultSpecifier")this.raise($.SourcePhaseImportRequiresDefault,G[0].loc.start)}else if(f.phase==="defer"){if(X!=="ImportNamespaceSpecifier")this.raise($.DeferImportRequiresNamespace,G[0].loc.start)}else if(f.module){var W;if(X!=="ImportDefaultSpecifier")this.raise($.ImportReflectionNotBinding,G[0].loc.start);if(((W=f.assertions)==null?void 0:W.length)>0)this.raise($.ImportReflectionHasAssertion,G[0].loc.start)}}checkJSONModuleImport(f){if(this.isJSONModuleImport(f)&&f.type!=="ExportAllDeclaration"){let{specifiers:G}=f;if(G!=null){let X=G.find((W)=>{let R;if(W.type==="ExportSpecifier")R=W.local;else if(W.type==="ImportSpecifier")R=W.imported;if(R!==void 0)return R.type==="Identifier"?R.name!=="default":R.value!=="default"});if(X!==void 0)this.raise($.ImportJSONBindingNotDefault,X.loc.start)}}}isPotentialImportPhase(f){if(f)return!1;return this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(f,G,X,W){if(G)return;if(X==="module")this.expectPlugin("importReflection",W),f.module=!0;else if(this.hasPlugin("importReflection"))f.module=!1;if(X==="source")this.expectPlugin("sourcePhaseImports",W),f.phase="source";else if(X==="defer")this.expectPlugin("deferredImportEvaluation",W),f.phase="defer";else if(this.hasPlugin("sourcePhaseImports"))f.phase=null}parseMaybeImportPhase(f,G){if(!this.isPotentialImportPhase(G))return this.applyImportPhase(f,G,null),null;let X=this.parseIdentifier(!0),{type:W}=this.state;if(HG(W)?W!==98||this.lookaheadCharCode()===102:W!==12)return this.resetPreviousIdentifierLeadingComments(X),this.applyImportPhase(f,G,X.name,X.loc.start),null;else return this.applyImportPhase(f,G,null),X}isPrecedingIdImportPhase(f){let{type:G}=this.state;return $f(G)?G!==98||this.lookaheadCharCode()===102:G!==12}parseImport(f){if(this.match(134))return this.parseImportSourceAndAttributes(f);return this.parseImportSpecifiersAndAfter(f,this.parseMaybeImportPhase(f,!1))}parseImportSpecifiersAndAfter(f,G){f.specifiers=[];let W=!this.maybeParseDefaultImportSpecifier(f,G)||this.eat(12),R=W&&this.maybeParseStarImportSpecifier(f);if(W&&!R)this.parseNamedImportSpecifiers(f);return this.expectContextual(98),this.parseImportSourceAndAttributes(f)}parseImportSourceAndAttributes(f){var G;return(G=f.specifiers)!=null||(f.specifiers=[]),f.source=this.parseImportSource(),this.maybeParseImportAttributes(f),this.checkImportReflection(f),this.checkJSONModuleImport(f),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(f,"ImportDeclaration")}parseImportSource(){if(!this.match(134))this.unexpected();return this.parseExprAtom()}parseImportSpecifierLocal(f,G,X){G.local=this.parseIdentifier(),f.specifiers.push(this.finishImportSpecifier(G,X))}finishImportSpecifier(f,G,X=8201){return this.checkLVal(f.local,{type:G},X),this.finishNode(f,G)}parseImportAttributes(){this.expect(5);let f=[],G=new Set;do{if(this.match(8))break;let X=this.startNode(),W=this.state.value;if(G.has(W))this.raise($.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:W});if(G.add(W),this.match(134))X.key=this.parseStringLiteral(W);else X.key=this.parseIdentifier(!0);if(this.expect(14),!this.match(134))throw this.raise($.ModuleAttributeInvalidValue,this.state.startLoc);X.value=this.parseStringLiteral(this.state.value),f.push(this.finishNode(X,"ImportAttribute"))}while(this.eat(12));return this.expect(8),f}parseModuleAttributes(){let f=[],G=new Set;do{let X=this.startNode();if(X.key=this.parseIdentifier(!0),X.key.name!=="type")this.raise($.ModuleAttributeDifferentFromType,X.key);if(G.has(X.key.name))this.raise($.ModuleAttributesWithDuplicateKeys,X.key,{key:X.key.name});if(G.add(X.key.name),this.expect(14),!this.match(134))throw this.raise($.ModuleAttributeInvalidValue,this.state.startLoc);X.value=this.parseStringLiteral(this.state.value),f.push(this.finishNode(X,"ImportAttribute"))}while(this.eat(12));return f}maybeParseImportAttributes(f){let G;var X=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;if(this.next(),this.hasPlugin("moduleAttributes"))G=this.parseModuleAttributes();else G=this.parseImportAttributes();X=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak()){if(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions"))this.raise($.ImportAttributesUseAssert,this.state.startLoc);if(!this.hasPlugin("importAssertions"))this.addExtra(f,"deprecatedAssertSyntax",!0);this.next(),G=this.parseImportAttributes()}else G=[];if(!X&&this.hasPlugin("importAssertions"))f.assertions=G;else f.attributes=G}maybeParseDefaultImportSpecifier(f,G){if(G){let X=this.startNodeAtNode(G);return X.local=G,f.specifiers.push(this.finishImportSpecifier(X,"ImportDefaultSpecifier")),!0}else if(HG(this.state.type))return this.parseImportSpecifierLocal(f,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(f){if(this.match(55)){let G=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(f,G,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(f){let G=!0;this.expect(5);while(!this.eat(8)){if(G)G=!1;else{if(this.eat(14))throw this.raise($.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let X=this.startNode(),W=this.match(134),R=this.isContextual(130);X.imported=this.parseModuleExportName();let J=this.parseImportSpecifier(X,W,f.importKind==="type"||f.importKind==="typeof",R,void 0);f.specifiers.push(J)}}parseImportSpecifier(f,G,X,W,R){if(this.eatContextual(93))f.local=this.parseIdentifier();else{let{imported:J}=f;if(G)throw this.raise($.ImportBindingIsString,f,{importName:J.value});if(this.checkReservedWord(J.name,f.loc.start,!0,!0),!f.local)f.local=LG(J)}return this.finishImportSpecifier(f,"ImportSpecifier",R)}isThisParam(f){return f.type==="Identifier"&&f.name==="this"}}class uR extends R8{constructor(f,G,X){f=IRf(f);super(f,G);this.options=f,this.initializeScopes(),this.plugins=X,this.filename=f.sourceFilename,this.startIndex=f.startIndex;let W=0;if(f.allowAwaitOutsideFunction)W|=1;if(f.allowReturnOutsideFunction)W|=2;if(f.allowImportExportEverywhere)W|=8;if(f.allowSuperOutsideMethod)W|=16;if(f.allowUndeclaredExports)W|=32;if(f.allowNewTargetOutsideFunction)W|=4;if(f.ranges)W|=64;if(f.tokens)W|=128;if(f.createImportExpressions)W|=256;if(f.createParenthesizedExpressions)W|=512;if(f.errorRecovery)W|=1024;if(f.attachComment)W|=2048;if(f.annexB)W|=4096;this.optionFlags=W}getScopeHandler(){return HW}parse(){this.enterInitialScopes();let f=this.startNode(),G=this.startNode();return this.nextToken(),f.errors=null,this.parseTopLevel(f,G),f.errors=this.state.errors,f.comments.length=this.state.commentsLen,f}}function EJf(f,G){var X;if(((X=G)==null?void 0:X.sourceType)==="unambiguous"){G=Object.assign({},G);try{G.sourceType="module";let W=GX(G,f),R=W.parse();if(W.sawUnambiguousESM)return R;if(W.ambiguousScriptDifferentAst)try{return G.sourceType="script",GX(G,f).parse()}catch(J){}else R.program.sourceType="script";return R}catch(W){try{return G.sourceType="script",GX(G,f).parse()}catch(R){}throw W}}else return GX(G,f).parse()}function wJf(f,G){let X=GX(G,f);if(X.options.strictMode)X.state.strict=!0;return X.getExpression()}function kJf(f){let G={};for(let X of Object.keys(f))G[X]=jG(f[X]);return G}var vJf=kJf(bRf);function GX(f,G){let X=uR,W=new Map;if(f!=null&&f.plugins){for(let R of f.plugins){let J,U;if(typeof R==="string")J=R;else[J,U]=R;if(!W.has(J))W.set(J,U||{})}IJf(W),X=gJf(W)}return new X(f,G,W)}var T9=new Map;function gJf(f){let G=[];for(let R of TJf)if(f.has(R))G.push(R);let X=G.join("|"),W=T9.get(X);if(!W){W=uR;for(let R of G)W=X8[R](W);T9.set(X,W)}return W}J8.parse=EJf;J8.parseExpression=wJf;J8.tokTypes=vJf});var hR=P((U8)=>{Object.defineProperty(U8,"__esModule",{value:!0});U8.Var=U8.User=U8.Statement=U8.SpreadProperty=U8.Scope=U8.RestProperty=U8.ReferencedMemberExpression=U8.ReferencedIdentifier=U8.Referenced=U8.Pure=U8.NumericLiteralTypeAnnotation=U8.Generated=U8.ForAwaitStatement=U8.Flow=U8.Expression=U8.ExistentialTypeParam=U8.BlockScoped=U8.BindingIdentifier=void 0;var nKf=U8.ReferencedIdentifier=["Identifier","JSXIdentifier"],oKf=U8.ReferencedMemberExpression=["MemberExpression"],eKf=U8.BindingIdentifier=["Identifier"],fSf=U8.Statement=["Statement"],GSf=U8.Expression=["Expression"],XSf=U8.Scope=["Scopable","Pattern"],WSf=U8.Referenced=null,RSf=U8.BlockScoped=null,JSf=U8.Var=["VariableDeclaration"],USf=U8.User=null,VSf=U8.Generated=null,HSf=U8.Pure=null,QSf=U8.Flow=["Flow","ImportDeclaration","ExportDeclaration","ImportSpecifier"],ZSf=U8.RestProperty=["RestElement"],YSf=U8.SpreadProperty=["RestElement"],zSf=U8.ExistentialTypeParam=["ExistsTypeAnnotation"],BSf=U8.NumericLiteralTypeAnnotation=["NumberLiteralTypeAnnotation"],MSf=U8.ForAwaitStatement=["ForOfStatement"]});var Q8=P((SSf,H8)=>{var O1=1000,j1=O1*60,P1=j1*60,eG=P1*24,XUf=eG*7,WUf=eG*365.25;H8.exports=function(f,G){G=G||{};var X=typeof f;if(X==="string"&&f.length>0)return RUf(f);else if(X==="number"&&isFinite(f))return G.long?UUf(f):JUf(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function RUf(f){if(f=String(f),f.length>100)return;var G=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(f);if(!G)return;var X=parseFloat(G[1]),W=(G[2]||"ms").toLowerCase();switch(W){case"years":case"year":case"yrs":case"yr":case"y":return X*WUf;case"weeks":case"week":case"w":return X*XUf;case"days":case"day":case"d":return X*eG;case"hours":case"hour":case"hrs":case"hr":case"h":return X*P1;case"minutes":case"minute":case"mins":case"min":case"m":return X*j1;case"seconds":case"second":case"secs":case"sec":case"s":return X*O1;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return X;default:return}}function JUf(f){var G=Math.abs(f);if(G>=eG)return Math.round(f/eG)+"d";if(G>=P1)return Math.round(f/P1)+"h";if(G>=j1)return Math.round(f/j1)+"m";if(G>=O1)return Math.round(f/O1)+"s";return f+"ms"}function UUf(f){var G=Math.abs(f);if(G>=eG)return ZW(f,G,eG,"day");if(G>=P1)return ZW(f,G,P1,"hour");if(G>=j1)return ZW(f,G,j1,"minute");if(G>=O1)return ZW(f,G,O1,"second");return f+" ms"}function ZW(f,G,X,W){var R=G>=X*1.5;return Math.round(f/X)+" "+W+(R?"s":"")}});var yR=P((FSf,Z8)=>{function VUf(f){X.debug=X,X.default=X,X.coerce=H,X.disable=U,X.enable=R,X.enabled=V,X.humanize=Q8(),X.destroy=Q,Object.keys(f).forEach((Y)=>{X[Y]=f[Y]}),X.names=[],X.skips=[],X.formatters={};function G(Y){let F=0;for(let q=0;q<Y.length;q++)F=(F<<5)-F+Y.charCodeAt(q),F|=0;return X.colors[Math.abs(F)%X.colors.length]}X.selectColor=G;function X(Y){let F,q=null,A,j;function b(...I){if(!b.enabled)return;let L=b,E=Number(new Date),Xf=E-(F||E);if(L.diff=Xf,L.prev=F,L.curr=E,F=E,I[0]=X.coerce(I[0]),typeof I[0]!=="string")I.unshift("%O");let s=0;I[0]=I[0].replace(/%([a-zA-Z%])/g,(Kf,bf)=>{if(Kf==="%%")return"%";s++;let wf=X.formatters[bf];if(typeof wf==="function"){let y=I[s];Kf=wf.call(L,y),I.splice(s,1),s--}return Kf}),X.formatArgs.call(L,I),(L.log||X.log).apply(L,I)}if(b.namespace=Y,b.useColors=X.useColors(),b.color=X.selectColor(Y),b.extend=W,b.destroy=X.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(q!==null)return q;if(A!==X.namespaces)A=X.namespaces,j=X.enabled(Y);return j},set:(I)=>{q=I}}),typeof X.init==="function")X.init(b);return b}function W(Y,F){let q=X(this.namespace+(typeof F==="undefined"?":":F)+Y);return q.log=this.log,q}function R(Y){X.save(Y),X.namespaces=Y,X.names=[],X.skips=[];let F=(typeof Y==="string"?Y:"").trim().replace(" ",",").split(",").filter(Boolean);for(let q of F)if(q[0]==="-")X.skips.push(q.slice(1));else X.names.push(q)}function J(Y,F){let q=0,A=0,j=-1,b=0;while(q<Y.length)if(A<F.length&&(F[A]===Y[q]||F[A]==="*"))if(F[A]==="*")j=A,b=q,A++;else q++,A++;else if(j!==-1)A=j+1,b++,q=b;else return!1;while(A<F.length&&F[A]==="*")A++;return A===F.length}function U(){let Y=[...X.names,...X.skips.map((F)=>"-"+F)].join(",");return X.enable(""),Y}function V(Y){for(let F of X.skips)if(J(Y,F))return!1;for(let F of X.names)if(J(Y,F))return!0;return!1}function H(Y){if(Y instanceof Error)return Y.stack||Y.message;return Y}function Q(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return X.enable(X.load()),X}Z8.exports=VUf});var z8=P((Y8,zW)=>{Y8.formatArgs=QUf;Y8.save=ZUf;Y8.load=YUf;Y8.useColors=HUf;Y8.storage=zUf();Y8.destroy=(()=>{let f=!1;return()=>{if(!f)f=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();Y8.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function HUf(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let f;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(f=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(f[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function QUf(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+zW.exports.humanize(this.diff),!this.useColors)return;let G="color: "+this.color;f.splice(1,0,G,"color: inherit");let X=0,W=0;f[0].replace(/%[a-zA-Z%]/g,(R)=>{if(R==="%%")return;if(X++,R==="%c")W=X}),f.splice(W,0,G)}Y8.log=console.debug||console.log||(()=>{});function ZUf(f){try{if(f)Y8.storage.setItem("debug",f);else Y8.storage.removeItem("debug")}catch(G){}}function YUf(){let f;try{f=Y8.storage.getItem("debug")}catch(G){}if(!f&&typeof process!=="undefined"&&"env"in process)f=process.env.DEBUG;return f}function zUf(){try{return localStorage}catch(f){}}zW.exports=yR()(Y8);var{formatters:BUf}=zW.exports;BUf.j=function(f){try{return JSON.stringify(f)}catch(G){return"[UnexpectedJSONParseError]: "+G.message}}});var M8={};V5(M8,{default:()=>IUf,createSupportsColor:()=>xR});import mR from"process";import AUf from"os";import B8 from"tty";function XG(f,G=globalThis.Deno?globalThis.Deno.args:mR.argv){let X=f.startsWith("-")?"":f.length===1?"-":"--",W=G.indexOf(X+f),R=G.indexOf("--");return W!==-1&&(R===-1||W<R)}function OUf(){if("FORCE_COLOR"in If){if(If.FORCE_COLOR==="true")return 1;if(If.FORCE_COLOR==="false")return 0;return If.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(If.FORCE_COLOR,10),3)}}function jUf(f){if(f===0)return!1;return{level:f,hasBasic:!0,has256:f>=2,has16m:f>=3}}function PUf(f,{streamIsTTY:G,sniffFlags:X=!0}={}){let W=OUf();if(W!==void 0)BW=W;let R=X?BW:W;if(R===0)return 0;if(X){if(XG("color=16m")||XG("color=full")||XG("color=truecolor"))return 3;if(XG("color=256"))return 2}if("TF_BUILD"in If&&"AGENT_NAME"in If)return 1;if(f&&!G&&R===void 0)return 0;let J=R||0;if(If.TERM==="dumb")return J;if(mR.platform==="win32"){let U=AUf.release().split(".");if(Number(U[0])>=10&&Number(U[2])>=10586)return Number(U[2])>=14931?3:2;return 1}if("CI"in If){if("GITHUB_ACTIONS"in If||"GITEA_ACTIONS"in If)return 3;if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((U)=>(U in If))||If.CI_NAME==="codeship")return 1;return J}if("TEAMCITY_VERSION"in If)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(If.TEAMCITY_VERSION)?1:0;if(If.COLORTERM==="truecolor")return 3;if(If.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in If){let U=Number.parseInt((If.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(If.TERM_PROGRAM){case"iTerm.app":return U>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(If.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(If.TERM))return 1;if("COLORTERM"in If)return 1;return J}function xR(f,G={}){let X=PUf(f,{streamIsTTY:f&&f.isTTY,...G});return jUf(X)}var If,BW,DUf,IUf;var K8=H5(()=>{({env:If}=mR);if(XG("no-color")||XG("no-colors")||XG("color=false")||XG("color=never"))BW=0;else if(XG("color")||XG("colors")||XG("color=true")||XG("color=always"))BW=1;DUf={stdout:xR({isTTY:B8.isatty(1)}),stderr:xR({isTTY:B8.isatty(2)})},IUf=DUf});var C8=P((F8,KW)=>{var TUf=sJ("tty"),MW=sJ("util");F8.init=vUf;F8.log=EUf;F8.formatArgs=LUf;F8.save=wUf;F8.load=kUf;F8.useColors=NUf;F8.destroy=MW.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");F8.colors=[6,2,3,4,5,1];try{let f=(K8(),U5(M8));if(f&&(f.stderr||f).level>=2)F8.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(f){}F8.inspectOpts=Object.keys(process.env).filter((f)=>{return/^debug_/i.test(f)}).reduce((f,G)=>{let X=G.substring(6).toLowerCase().replace(/_([a-z])/g,(R,J)=>{return J.toUpperCase()}),W=process.env[G];if(/^(yes|on|true|enabled)$/i.test(W))W=!0;else if(/^(no|off|false|disabled)$/i.test(W))W=!1;else if(W==="null")W=null;else W=Number(W);return f[X]=W,f},{});function NUf(){return"colors"in F8.inspectOpts?Boolean(F8.inspectOpts.colors):TUf.isatty(process.stderr.fd)}function LUf(f){let{namespace:G,useColors:X}=this;if(X){let W=this.color,R="\x1B[3"+(W<8?W:"8;5;"+W),J=` ${R};1m${G} \x1B[0m`;f[0]=J+f[0].split(`
|
|
23
|
+
`),cooked:R===null?null:R.slice(1,H)},U.tail=V,this.next();let Y=this.finishNode(U,"TemplateElement");return this.resetEndLocation(Y,xf(this.state.lastTokEndLoc,H)),Y}parseTemplate(f){let G=this.startNode(),X=this.parseTemplateElement(f),W=[X],R=[];while(!X.tail)R.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),W.push(X=this.parseTemplateElement(f));return G.expressions=R,G.quasis=W,this.finishNode(G,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(f,G,X,W){if(X)this.expectPlugin("recordAndTuple");let R=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let J=!1,U=!0,V=this.startNode();V.properties=[],this.next();while(!this.match(f)){if(U)U=!1;else if(this.expect(12),this.match(f)){this.addTrailingCommaExtraToNode(V);break}let Q;if(G)Q=this.parseBindingProperty();else Q=this.parsePropertyDefinition(W),J=this.checkProto(Q,X,J,W);if(X&&!this.isObjectProperty(Q)&&Q.type!=="SpreadElement")this.raise($.InvalidRecordProperty,Q);if(Q.shorthand)this.addExtra(Q,"shorthand",!0);V.properties.push(Q)}this.next(),this.state.inFSharpPipelineDirectBody=R;let H="ObjectExpression";if(G)H="ObjectPattern";else if(X)H="RecordExpression";return this.finishNode(V,H)}addTrailingCommaExtraToNode(f){this.addExtra(f,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(f,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(f){return!f.computed&&f.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(f){let G=[];if(this.match(26)){if(this.hasPlugin("decorators"))this.raise($.UnsupportedPropertyDecorator,this.state.startLoc);while(this.match(26))G.push(this.parseDecorator())}let X=this.startNode(),W=!1,R=!1,J;if(this.match(21)){if(G.length)this.unexpected();return this.parseSpread()}if(G.length)X.decorators=G,G=[];if(X.method=!1,f)J=this.state.startLoc;let U=this.eat(55);this.parsePropertyNamePrefixOperator(X);let V=this.state.containsEsc;if(this.parsePropertyName(X,f),!U&&!V&&this.maybeAsyncOrAccessorProp(X)){let{key:H}=X,Q=H.name;if(Q==="async"&&!this.hasPrecedingLineBreak())W=!0,this.resetPreviousNodeTrailingComments(H),U=this.eat(55),this.parsePropertyName(X);if(Q==="get"||Q==="set"){if(R=!0,this.resetPreviousNodeTrailingComments(H),X.kind=Q,this.match(55))U=!0,this.raise($.AccessorIsGenerator,this.state.curPosition(),{kind:Q}),this.next();this.parsePropertyName(X)}}return this.parseObjPropValue(X,J,U,W,!1,R,f)}getGetterSetterExpectedParamCount(f){return f.kind==="get"?0:1}getObjectOrClassMethodParams(f){return f.params}checkGetterSetterParams(f){var G;let X=this.getGetterSetterExpectedParamCount(f),W=this.getObjectOrClassMethodParams(f);if(W.length!==X)this.raise(f.kind==="get"?$.BadGetterArity:$.BadSetterArity,f);if(f.kind==="set"&&((G=W[W.length-1])==null?void 0:G.type)==="RestElement")this.raise($.BadSetterRestParameter,f)}parseObjectMethod(f,G,X,W,R){if(R){let J=this.parseMethod(f,G,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(J),J}if(X||G||this.match(10)){if(W)this.unexpected();return f.kind="method",f.method=!0,this.parseMethod(f,G,X,!1,!1,"ObjectMethod")}}parseObjectProperty(f,G,X,W){if(f.shorthand=!1,this.eat(14))return f.value=X?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(W),this.finishNode(f,"ObjectProperty");if(!f.computed&&f.key.type==="Identifier"){if(this.checkReservedWord(f.key.name,f.key.loc.start,!0,!1),X)f.value=this.parseMaybeDefault(G,LG(f.key));else if(this.match(29)){let R=this.state.startLoc;if(W!=null){if(W.shorthandAssignLoc===null)W.shorthandAssignLoc=R}else this.raise($.InvalidCoverInitializedName,R);f.value=this.parseMaybeDefault(G,LG(f.key))}else f.value=LG(f.key);return f.shorthand=!0,this.finishNode(f,"ObjectProperty")}}parseObjPropValue(f,G,X,W,R,J,U){let V=this.parseObjectMethod(f,X,W,R,J)||this.parseObjectProperty(f,G,R,U);if(!V)this.unexpected();return V}parsePropertyName(f,G){if(this.eat(0))f.computed=!0,f.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:X,value:W}=this.state,R;if(HG(X))R=this.parseIdentifier(!0);else switch(X){case 135:R=this.parseNumericLiteral(W);break;case 134:R=this.parseStringLiteral(W);break;case 136:R=this.parseBigIntLiteral(W);break;case 139:{let J=this.state.startLoc;if(G!=null){if(G.privateKeyLoc===null)G.privateKeyLoc=J}else this.raise($.UnexpectedPrivateField,J);R=this.parsePrivateName();break}default:if(X===137){R=this.parseDecimalLiteral(W);break}this.unexpected()}if(f.key=R,X!==139)f.computed=!1}}initFunction(f,G){f.id=null,f.generator=!1,f.async=G}parseMethod(f,G,X,W,R,J,U=!1){this.initFunction(f,X),f.generator=G,this.scope.enter(18|(U?64:0)|(R?32:0)),this.prodParam.enter(JW(X,f.generator)),this.parseFunctionParams(f,W);let V=this.parseFunctionBodyAndFinish(f,J,!0);return this.prodParam.exit(),this.scope.exit(),V}parseArrayLike(f,G,X,W){if(X)this.expectPlugin("recordAndTuple");let R=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let J=this.startNode();return this.next(),J.elements=this.parseExprList(f,!X,W,J),this.state.inFSharpPipelineDirectBody=R,this.finishNode(J,X?"TupleExpression":"ArrayExpression")}parseArrowExpression(f,G,X,W){this.scope.enter(6);let R=JW(X,!1);if(!this.match(5)&&this.prodParam.hasIn)R|=8;this.prodParam.enter(R),this.initFunction(f,X);let J=this.state.maybeInArrowParameters;if(G)this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(f,G,W);return this.state.maybeInArrowParameters=!1,this.parseFunctionBody(f,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=J,this.finishNode(f,"ArrowFunctionExpression")}setArrowFunctionParameters(f,G,X){this.toAssignableList(G,X,!1),f.params=G}parseFunctionBodyAndFinish(f,G,X=!1){return this.parseFunctionBody(f,!1,X),this.finishNode(f,G)}parseFunctionBody(f,G,X=!1){let W=G&&!this.match(5);if(this.expressionScope.enter(r9()),W)f.body=this.parseMaybeAssign(),this.checkParams(f,!1,G,!1);else{let R=this.state.strict,J=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),f.body=this.parseBlock(!0,!1,(U)=>{let V=!this.isSimpleParamList(f.params);if(U&&V)this.raise($.IllegalLanguageModeDirective,(f.kind==="method"||f.kind==="constructor")&&!!f.key?f.key.loc.end:f);let H=!R&&this.state.strict;if(this.checkParams(f,!this.state.strict&&!G&&!X&&!V,G,H),this.state.strict&&f.id)this.checkIdentifier(f.id,65,H)}),this.prodParam.exit(),this.state.labels=J}this.expressionScope.exit()}isSimpleParameter(f){return f.type==="Identifier"}isSimpleParamList(f){for(let G=0,X=f.length;G<X;G++)if(!this.isSimpleParameter(f[G]))return!1;return!0}checkParams(f,G,X,W=!0){let R=!G&&new Set,J={type:"FormalParameters"};for(let U of f.params)this.checkLVal(U,J,5,R,W)}parseExprList(f,G,X,W){let R=[],J=!0;while(!this.eat(f)){if(J)J=!1;else if(this.expect(12),this.match(f)){if(W)this.addTrailingCommaExtraToNode(W);this.next();break}R.push(this.parseExprListItem(G,X))}return R}parseExprListItem(f,G,X){let W;if(this.match(12)){if(!f)this.raise($.UnexpectedToken,this.state.curPosition(),{unexpected:","});W=null}else if(this.match(21)){let R=this.state.startLoc;W=this.parseParenItem(this.parseSpread(G),R)}else if(this.match(17)){if(this.expectPlugin("partialApplication"),!X)this.raise($.UnexpectedArgumentPlaceholder,this.state.startLoc);let R=this.startNode();this.next(),W=this.finishNode(R,"ArgumentPlaceholder")}else W=this.parseMaybeAssignAllowIn(G,this.parseParenItem);return W}parseIdentifier(f){let G=this.startNode(),X=this.parseIdentifierName(f);return this.createIdentifier(G,X)}createIdentifier(f,G){return f.name=G,f.loc.identifierName=G,this.finishNode(f,"Identifier")}parseIdentifierName(f){let G,{startLoc:X,type:W}=this.state;if(HG(W))G=this.state.value;else this.unexpected();let R=ERf(W);if(f){if(R)this.replaceToken(132)}else this.checkReservedWord(G,X,R,!1);return this.next(),G}checkReservedWord(f,G,X,W){if(f.length>10)return;if(!tRf(f))return;if(X&&sRf(f)){this.raise($.UnexpectedKeyword,G,{keyword:f});return}if((!this.state.strict?E9:W?v9:w9)(f,this.inModule)){this.raise($.UnexpectedReservedWord,G,{reservedWord:f});return}else if(f==="yield"){if(this.prodParam.hasYield){this.raise($.YieldBindingIdentifier,G);return}}else if(f==="await"){if(this.prodParam.hasAwait){this.raise($.AwaitBindingIdentifier,G);return}if(this.scope.inStaticBlock){this.raise($.AwaitBindingIdentifierInStaticBlock,G);return}this.expressionScope.recordAsyncArrowParametersError(G)}else if(f==="arguments"){if(this.scope.inClassAndNotInNonArrowFunction){this.raise($.ArgumentsInClass,G);return}}}recordAwaitIfAllowed(){let f=this.prodParam.hasAwait||this.optionFlags&1&&!this.scope.inFunction;if(f&&!this.scope.inFunction)this.state.hasTopLevelAwait=!0;return f}parseAwait(f){let G=this.startNodeAt(f);if(this.expressionScope.recordParameterInitializerError($.AwaitExpressionFormalParameter,G),this.eat(55))this.raise($.ObsoleteAwaitStar,G);if(!this.scope.inFunction&&!(this.optionFlags&1))if(this.isAmbiguousAwait())this.ambiguousScriptDifferentAst=!0;else this.sawUnambiguousESM=!0;if(!this.state.soloAwait)G.argument=this.parseMaybeUnary(null,!0);return this.finishNode(G,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:f}=this.state;return f===53||f===10||f===0||UW(f)||f===102&&!this.state.containsEsc||f===138||f===56||this.hasPlugin("v8intrinsic")&&f===54}parseYield(){let f=this.startNode();this.expressionScope.recordParameterInitializerError($.YieldInParameter,f),this.next();let G=!1,X=null;if(!this.hasPrecedingLineBreak())switch(G=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!G)break;default:X=this.parseMaybeAssign()}return f.delegate=G,f.argument=X,this.finishNode(f,"YieldExpression")}parseImportCall(f){if(this.next(),f.source=this.parseMaybeAssignAllowIn(),f.options=null,this.eat(12)){if(!this.match(11)){if(f.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&!this.match(11)){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise($.ImportCallArity,f)}}}return this.expect(11),this.finishNode(f,"ImportExpression")}checkPipelineAtInfixOperator(f,G){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){if(f.type==="SequenceExpression")this.raise($.PipelineHeadSequenceExpression,G)}}parseSmartPipelineBodyInStyle(f,G){if(this.isSimpleReference(f)){let X=this.startNodeAt(G);return X.callee=f,this.finishNode(X,"PipelineBareFunction")}else{let X=this.startNodeAt(G);return this.checkSmartPipeTopicBodyEarlyErrors(G),X.expression=f,this.finishNode(X,"PipelineTopicExpression")}}isSimpleReference(f){switch(f.type){case"MemberExpression":return!f.computed&&this.isSimpleReference(f.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(f){if(this.match(19))throw this.raise($.PipelineBodyNoArrow,this.state.startLoc);if(!this.topicReferenceWasUsedInCurrentContext())this.raise($.PipelineTopicUnused,f)}withTopicBindingContext(f){let G=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return f()}finally{this.state.topicContext=G}}withSmartMixTopicForbiddingContext(f){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let G=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return f()}finally{this.state.topicContext=G}}else return f()}withSoloAwaitPermittingContext(f){let G=this.state.soloAwait;this.state.soloAwait=!0;try{return f()}finally{this.state.soloAwait=G}}allowInAnd(f){let G=this.prodParam.currentFlags();if(8&~G){this.prodParam.enter(G|8);try{return f()}finally{this.prodParam.exit()}}return f()}disallowInAnd(f){let G=this.prodParam.currentFlags();if(8&G){this.prodParam.enter(G&-9);try{return f()}finally{this.prodParam.exit()}}return f()}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(f){let G=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let X=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let W=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),G,f);return this.state.inFSharpPipelineDirectBody=X,W}parseModuleExpression(){this.expectPlugin("moduleBlocks");let f=this.startNode();if(this.next(),!this.match(5))this.unexpected(null,5);let G=this.startNodeAt(this.state.endLoc);this.next();let X=this.initializeScopes(!0);this.enterInitialScopes();try{f.body=this.parseProgram(G,8,"module")}finally{X()}return this.finishNode(f,"ModuleExpression")}parsePropertyNamePrefixOperator(f){}}var CR={kind:1},NJf={kind:2},LJf=/[\uD800-\uDFFF]/u,qR=/in(?:stanceof)?/y;function bJf(f,G,X){for(let W=0;W<f.length;W++){let R=f[W],{type:J}=R;if(typeof J==="number"){{if(J===139){let{loc:U,start:V,value:H,end:Q}=R,Y=V+1,F=xf(U.start,1);f.splice(W,1,new PG({type:jG(27),value:"#",start:V,end:Y,startLoc:U.start,endLoc:F}),new PG({type:jG(132),value:H,start:Y,end:Q,startLoc:F,endLoc:U.end})),W++;continue}if(UW(J)){let{loc:U,start:V,value:H,end:Q}=R,Y=V+1,F=xf(U.start,1),q;if(G.charCodeAt(V-X)===96)q=new PG({type:jG(22),value:"`",start:V,end:Y,startLoc:U.start,endLoc:F});else q=new PG({type:jG(8),value:"}",start:V,end:Y,startLoc:U.start,endLoc:F});let A,j,b,I;if(J===24)j=Q-1,b=xf(U.end,-1),A=H===null?null:H.slice(1,-1),I=new PG({type:jG(22),value:"`",start:j,end:Q,startLoc:b,endLoc:U.end});else j=Q-2,b=xf(U.end,-2),A=H===null?null:H.slice(1,-2),I=new PG({type:jG(23),value:"${",start:j,end:Q,startLoc:b,endLoc:U.end});f.splice(W,1,q,new PG({type:jG(20),value:A,start:Y,end:j,startLoc:F,endLoc:b}),I),W+=2;continue}}R.type=jG(J)}}return f}class R8 extends W8{parseTopLevel(f,G){if(f.program=this.parseProgram(G),f.comments=this.comments,this.optionFlags&128)f.tokens=bJf(this.tokens,this.input,this.startIndex);return this.finishNode(f,"File")}parseProgram(f,G=140,X=this.options.sourceType){if(f.sourceType=X,f.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(f,!0,!0,G),this.inModule){if(!(this.optionFlags&32)&&this.scope.undefinedExports.size>0)for(let[R,J]of Array.from(this.scope.undefinedExports))this.raise($.ModuleExportUndefined,J,{localName:R});this.addExtra(f,"topLevelAwait",this.state.hasTopLevelAwait)}let W;if(G===140)W=this.finishNode(f,"Program");else W=this.finishNodeAt(f,"Program",xf(this.state.startLoc,-1));return W}stmtToDirective(f){let G=f;G.type="Directive",G.value=G.expression,delete G.expression;let X=G.value,W=X.value,R=this.input.slice(this.offsetToSourcePos(X.start),this.offsetToSourcePos(X.end)),J=X.value=R.slice(1,-1);return this.addExtra(X,"raw",R),this.addExtra(X,"rawValue",J),this.addExtra(X,"expressionValue",W),X.type="DirectiveLiteral",G}parseInterpreterDirective(){if(!this.match(28))return null;let f=this.startNode();return f.value=this.state.value,this.next(),this.finishNode(f,"InterpreterDirective")}isLet(){if(!this.isContextual(100))return!1;return this.hasFollowingBindingAtom()}chStartsBindingIdentifier(f,G){if(IG(f)){if(qR.lastIndex=G,qR.test(this.input)){let X=this.codePointAtPos(qR.lastIndex);if(!q1(X)&&X!==92)return!1}return!0}else if(f===92)return!0;else return!1}chStartsBindingPattern(f){return f===91||f===123}hasFollowingBindingAtom(){let f=this.nextTokenStart(),G=this.codePointAtPos(f);return this.chStartsBindingPattern(G)||this.chStartsBindingIdentifier(G,f)}hasInLineFollowingBindingIdentifierOrBrace(){let f=this.nextTokenInLineStart(),G=this.codePointAtPos(f);return G===123||this.chStartsBindingIdentifier(G,f)}startsUsingForOf(){let{type:f,containsEsc:G}=this.lookahead();if(f===102&&!G)return!1;else if($f(f)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let f=this.nextTokenInLineStart();if(this.isUnparsedContextual(f,"using")){f=this.nextTokenInLineStartSince(f+5);let G=this.codePointAtPos(f);if(this.chStartsBindingIdentifier(G,f))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(f=!1){let G=0;if(this.options.annexB&&!this.state.strict){if(G|=4,f)G|=8}return this.parseStatementLike(G)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(f){let G=null;if(this.match(26))G=this.parseDecorators(!0);return this.parseStatementContent(f,G)}parseStatementContent(f,G){let X=this.state.type,W=this.startNode(),R=!!(f&2),J=!!(f&4),U=f&1;switch(X){case 60:return this.parseBreakContinueStatement(W,!0);case 63:return this.parseBreakContinueStatement(W,!1);case 64:return this.parseDebuggerStatement(W);case 90:return this.parseDoWhileStatement(W);case 91:return this.parseForStatement(W);case 68:if(this.lookaheadCharCode()===46)break;if(!J)this.raise(this.state.strict?$.StrictFunction:this.options.annexB?$.SloppyFunctionAnnexB:$.SloppyFunction,this.state.startLoc);return this.parseFunctionStatement(W,!1,!R&&J);case 80:if(!R)this.unexpected();return this.parseClass(this.maybeTakeDecorators(G,W),!0);case 69:return this.parseIfStatement(W);case 70:return this.parseReturnStatement(W);case 71:return this.parseSwitchStatement(W);case 72:return this.parseThrowStatement(W);case 73:return this.parseTryStatement(W);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing()){if(!this.recordAwaitIfAllowed())this.raise($.AwaitUsingNotInAsyncContext,W);else if(!R)this.raise($.UnexpectedLexicalDeclaration,W);return this.next(),this.parseVarStatement(W,"await using")}break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;if(this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel)this.raise($.UnexpectedUsingDeclaration,this.state.startLoc);else if(!R)this.raise($.UnexpectedLexicalDeclaration,this.state.startLoc);return this.parseVarStatement(W,"using");case 100:{if(this.state.containsEsc)break;let Q=this.nextTokenStart(),Y=this.codePointAtPos(Q);if(Y!==91){if(!R&&this.hasFollowingLineBreak())break;if(!this.chStartsBindingIdentifier(Y,Q)&&Y!==123)break}}case 75:if(!R)this.raise($.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let Q=this.state.value;return this.parseVarStatement(W,Q)}case 92:return this.parseWhileStatement(W);case 76:return this.parseWithStatement(W);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(W);case 83:{let Q=this.lookaheadCharCode();if(Q===40||Q===46)break}case 82:{if(!(this.optionFlags&8)&&!U)this.raise($.UnexpectedImportExport,this.state.startLoc);this.next();let Q;if(X===83)Q=this.parseImport(W);else Q=this.parseExport(W,G);return this.assertModuleNodeAllowed(Q),Q}default:if(this.isAsyncFunction()){if(!R)this.raise($.AsyncFunctionInSingleStatementContext,this.state.startLoc);return this.next(),this.parseFunctionStatement(W,!0,!R&&J)}}let V=this.state.value,H=this.parseExpression();if($f(X)&&H.type==="Identifier"&&this.eat(14))return this.parseLabeledStatement(W,V,H,f);else return this.parseExpressionStatement(W,H,G)}assertModuleNodeAllowed(f){if(!(this.optionFlags&8)&&!this.inModule)this.raise($.ImportOutsideModule,f)}decoratorsEnabledBeforeExport(){if(this.hasPlugin("decorators-legacy"))return!0;return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(f,G,X){if(f){var W;if((W=G.decorators)!=null&&W.length){if(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!=="boolean")this.raise($.DecoratorsBeforeAfterExport,G.decorators[0]);G.decorators.unshift(...f)}else G.decorators=f;if(this.resetStartLocationFromNode(G,f[0]),X)this.resetStartLocationFromNode(X,G)}return G}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(f){let G=[];do G.push(this.parseDecorator());while(this.match(26));if(this.match(82)){if(!f)this.unexpected();if(!this.decoratorsEnabledBeforeExport())this.raise($.DecoratorExportClass,this.state.startLoc)}else if(!this.canHaveLeadingDecorator())throw this.raise($.UnexpectedLeadingDecorator,this.state.startLoc);return G}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let f=this.startNode();if(this.next(),this.hasPlugin("decorators")){let G=this.state.startLoc,X;if(this.match(10)){let W=this.state.startLoc;this.next(),X=this.parseExpression(),this.expect(11),X=this.wrapParenthesis(W,X);let R=this.state.startLoc;if(f.expression=this.parseMaybeDecoratorArguments(X,W),this.getPluginOption("decorators","allowCallParenthesized")===!1&&f.expression!==X)this.raise($.DecoratorArgumentsOutsideParentheses,R)}else{X=this.parseIdentifier(!1);while(this.eat(16)){let W=this.startNodeAt(G);if(W.object=X,this.match(139))this.classScope.usePrivateName(this.state.value,this.state.startLoc),W.property=this.parsePrivateName();else W.property=this.parseIdentifier(!0);W.computed=!1,X=this.finishNode(W,"MemberExpression")}f.expression=this.parseMaybeDecoratorArguments(X,G)}}else f.expression=this.parseExprSubscripts();return this.finishNode(f,"Decorator")}parseMaybeDecoratorArguments(f,G){if(this.eat(10)){let X=this.startNodeAt(G);return X.callee=f,X.arguments=this.parseCallExpressionArguments(11),this.toReferencedList(X.arguments),this.finishNode(X,"CallExpression")}return f}parseBreakContinueStatement(f,G){if(this.next(),this.isLineTerminator())f.label=null;else f.label=this.parseIdentifier(),this.semicolon();return this.verifyBreakContinue(f,G),this.finishNode(f,G?"BreakStatement":"ContinueStatement")}verifyBreakContinue(f,G){let X;for(X=0;X<this.state.labels.length;++X){let W=this.state.labels[X];if(f.label==null||W.name===f.label.name){if(W.kind!=null&&(G||W.kind===1))break;if(f.label&&G)break}}if(X===this.state.labels.length){let W=G?"BreakStatement":"ContinueStatement";this.raise($.IllegalBreakContinue,f,{type:W})}}parseDebuggerStatement(f){return this.next(),this.semicolon(),this.finishNode(f,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let f=this.parseExpression();return this.expect(11),f}parseDoWhileStatement(f){return this.next(),this.state.labels.push(CR),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),f.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(f,"DoWhileStatement")}parseForStatement(f){this.next(),this.state.labels.push(CR);let G=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed())G=this.state.startLoc,this.next();if(this.scope.enter(0),this.expect(10),this.match(13)){if(G!==null)this.unexpected(G);return this.parseFor(f,null)}let X=this.isContextual(100);{let V=this.isContextual(96)&&this.startsAwaitUsing(),H=V||this.isContextual(107)&&this.startsUsingForOf(),Q=X&&this.hasFollowingBindingAtom()||H;if(this.match(74)||this.match(75)||Q){let Y=this.startNode(),F;if(V){if(F="await using",!this.recordAwaitIfAllowed())this.raise($.AwaitUsingNotInAsyncContext,this.state.startLoc);this.next()}else F=this.state.value;this.next(),this.parseVar(Y,!0,F);let q=this.finishNode(Y,"VariableDeclaration"),A=this.match(58);if(A&&H)this.raise($.ForInUsing,q);if((A||this.isContextual(102))&&q.declarations.length===1)return this.parseForIn(f,q,G);if(G!==null)this.unexpected(G);return this.parseFor(f,q)}}let W=this.isContextual(95),R=new WX,J=this.parseExpression(!0,R),U=this.isContextual(102);if(U){if(X)this.raise($.ForOfLet,J);if(G===null&&W&&J.type==="Identifier")this.raise($.ForOfAsync,J)}if(U||this.match(58)){this.checkDestructuringPrivate(R),this.toAssignable(J,!0);let V=U?"ForOfStatement":"ForInStatement";return this.checkLVal(J,{type:V}),this.parseForIn(f,J,G)}else this.checkExpressionErrors(R,!0);if(G!==null)this.unexpected(G);return this.parseFor(f,J)}parseFunctionStatement(f,G,X){return this.next(),this.parseFunction(f,1|(X?2:0)|(G?8:0))}parseIfStatement(f){return this.next(),f.test=this.parseHeaderExpression(),f.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),f.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(f,"IfStatement")}parseReturnStatement(f){if(!this.prodParam.hasReturn&&!(this.optionFlags&2))this.raise($.IllegalReturn,this.state.startLoc);if(this.next(),this.isLineTerminator())f.argument=null;else f.argument=this.parseExpression(),this.semicolon();return this.finishNode(f,"ReturnStatement")}parseSwitchStatement(f){this.next(),f.discriminant=this.parseHeaderExpression();let G=f.cases=[];this.expect(5),this.state.labels.push(NJf),this.scope.enter(0);let X;for(let W;!this.match(8);)if(this.match(61)||this.match(65)){let R=this.match(61);if(X)this.finishNode(X,"SwitchCase");if(G.push(X=this.startNode()),X.consequent=[],this.next(),R)X.test=this.parseExpression();else{if(W)this.raise($.MultipleDefaultsInSwitch,this.state.lastTokStartLoc);W=!0,X.test=null}this.expect(14)}else if(X)X.consequent.push(this.parseStatementListItem());else this.unexpected();if(this.scope.exit(),X)this.finishNode(X,"SwitchCase");return this.next(),this.state.labels.pop(),this.finishNode(f,"SwitchStatement")}parseThrowStatement(f){if(this.next(),this.hasPrecedingLineBreak())this.raise($.NewlineAfterThrow,this.state.lastTokEndLoc);return f.argument=this.parseExpression(),this.semicolon(),this.finishNode(f,"ThrowStatement")}parseCatchClauseParam(){let f=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&f.type==="Identifier"?8:0),this.checkLVal(f,{type:"CatchClause"},9),f}parseTryStatement(f){if(this.next(),f.block=this.parseBlock(),f.handler=null,this.match(62)){let G=this.startNode();if(this.next(),this.match(10))this.expect(10),G.param=this.parseCatchClauseParam(),this.expect(11);else G.param=null,this.scope.enter(0);G.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),f.handler=this.finishNode(G,"CatchClause")}if(f.finalizer=this.eat(67)?this.parseBlock():null,!f.handler&&!f.finalizer)this.raise($.NoCatchOrFinally,f);return this.finishNode(f,"TryStatement")}parseVarStatement(f,G,X=!1){return this.next(),this.parseVar(f,!1,G,X),this.semicolon(),this.finishNode(f,"VariableDeclaration")}parseWhileStatement(f){return this.next(),f.test=this.parseHeaderExpression(),this.state.labels.push(CR),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(f,"WhileStatement")}parseWithStatement(f){if(this.state.strict)this.raise($.StrictWith,this.state.startLoc);return this.next(),f.object=this.parseHeaderExpression(),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(f,"WithStatement")}parseEmptyStatement(f){return this.next(),this.finishNode(f,"EmptyStatement")}parseLabeledStatement(f,G,X,W){for(let J of this.state.labels)if(J.name===G)this.raise($.LabelRedeclaration,X,{labelName:G});let R=vRf(this.state.type)?1:this.match(71)?2:null;for(let J=this.state.labels.length-1;J>=0;J--){let U=this.state.labels[J];if(U.statementStart===f.start)U.statementStart=this.sourceToOffsetPos(this.state.start),U.kind=R;else break}return this.state.labels.push({name:G,kind:R,statementStart:this.sourceToOffsetPos(this.state.start)}),f.body=W&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),f.label=X,this.finishNode(f,"LabeledStatement")}parseExpressionStatement(f,G,X){return f.expression=G,this.semicolon(),this.finishNode(f,"ExpressionStatement")}parseBlock(f=!1,G=!0,X){let W=this.startNode();if(f)this.state.strictErrors.clear();if(this.expect(5),G)this.scope.enter(0);if(this.parseBlockBody(W,f,!1,8,X),G)this.scope.exit();return this.finishNode(W,"BlockStatement")}isValidDirective(f){return f.type==="ExpressionStatement"&&f.expression.type==="StringLiteral"&&!f.expression.extra.parenthesized}parseBlockBody(f,G,X,W,R){let J=f.body=[],U=f.directives=[];this.parseBlockOrModuleBlockBody(J,G?U:void 0,X,W,R)}parseBlockOrModuleBlockBody(f,G,X,W,R){let J=this.state.strict,U=!1,V=!1;while(!this.match(W)){let H=X?this.parseModuleItem():this.parseStatementListItem();if(G&&!V){if(this.isValidDirective(H)){let Q=this.stmtToDirective(H);if(G.push(Q),!U&&Q.value.value==="use strict")U=!0,this.setStrict(!0);continue}V=!0,this.state.strictErrors.clear()}f.push(H)}if(R==null||R.call(this,U),!J)this.setStrict(!1);this.next()}parseFor(f,G){return f.init=G,this.semicolon(!1),f.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),f.update=this.match(11)?null:this.parseExpression(),this.expect(11),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(f,"ForStatement")}parseForIn(f,G,X){let W=this.match(58);if(this.next(),W){if(X!==null)this.unexpected(X)}else f.await=X!==null;if(G.type==="VariableDeclaration"&&G.declarations[0].init!=null&&(!W||!this.options.annexB||this.state.strict||G.kind!=="var"||G.declarations[0].id.type!=="Identifier"))this.raise($.ForInOfLoopInitializer,G,{type:W?"ForInStatement":"ForOfStatement"});if(G.type==="AssignmentPattern")this.raise($.InvalidLhs,G,{ancestor:{type:"ForStatement"}});return f.left=G,f.right=W?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(f,W?"ForInStatement":"ForOfStatement")}parseVar(f,G,X,W=!1){let R=f.declarations=[];f.kind=X;for(;;){let J=this.startNode();if(this.parseVarId(J,X),J.init=!this.eat(29)?null:G?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn(),J.init===null&&!W){if(J.id.type!=="Identifier"&&!(G&&(this.match(58)||this.isContextual(102))))this.raise($.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"});else if((X==="const"||X==="using"||X==="await using")&&!(this.match(58)||this.isContextual(102)))this.raise($.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:X})}if(R.push(this.finishNode(J,"VariableDeclarator")),!this.eat(12))break}return f}parseVarId(f,G){let X=this.parseBindingAtom();if(G==="using"||G==="await using"){if(X.type==="ArrayPattern"||X.type==="ObjectPattern")this.raise($.UsingDeclarationHasBindingPattern,X.loc.start)}this.checkLVal(X,{type:"VariableDeclarator"},G==="var"?5:8201),f.id=X}parseAsyncFunctionExpression(f){return this.parseFunction(f,8)}parseFunction(f,G=0){let X=G&2,W=!!(G&1),R=W&&!(G&4),J=!!(G&8);if(this.initFunction(f,J),this.match(55)){if(X)this.raise($.GeneratorInSingleStatementContext,this.state.startLoc);this.next(),f.generator=!0}if(W)f.id=this.parseFunctionId(R);let U=this.state.maybeInArrowParameters;if(this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(JW(J,f.generator)),!W)f.id=this.parseFunctionId();if(this.parseFunctionParams(f,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(f,W?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),W&&!X)this.registerFunctionStatementId(f);return this.state.maybeInArrowParameters=U,f}parseFunctionId(f){return f||$f(this.state.type)?this.parseIdentifier():null}parseFunctionParams(f,G){this.expect(10),this.expressionScope.enter(RJf()),f.params=this.parseBindingList(11,41,2|(G?4:0)),this.expressionScope.exit()}registerFunctionStatementId(f){if(!f.id)return;this.scope.declareName(f.id.name,!this.options.annexB||this.state.strict||f.generator||f.async?this.scope.treatFunctionsAsVar?5:8201:17,f.id.loc.start)}parseClass(f,G,X){this.next();let W=this.state.strict;return this.state.strict=!0,this.parseClassId(f,G,X),this.parseClassSuper(f),f.body=this.parseClassBody(!!f.superClass,W),this.finishNode(f,G?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(f){return f.type==="Identifier"&&f.name==="constructor"||f.type==="StringLiteral"&&f.value==="constructor"}isNonstaticConstructor(f){return!f.computed&&!f.static&&this.nameIsConstructor(f.key)}parseClassBody(f,G){this.classScope.enter();let X={hadConstructor:!1,hadSuperClass:f},W=[],R=this.startNode();if(R.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{while(!this.match(8)){if(this.eat(13)){if(W.length>0)throw this.raise($.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){W.push(this.parseDecorator());continue}let J=this.startNode();if(W.length)J.decorators=W,this.resetStartLocationFromNode(J,W[0]),W=[];if(this.parseClassMember(R,J,X),J.kind==="constructor"&&J.decorators&&J.decorators.length>0)this.raise($.DecoratorConstructor,J)}}),this.state.strict=G,this.next(),W.length)throw this.raise($.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(R,"ClassBody")}parseClassMemberFromModifier(f,G){let X=this.parseIdentifier(!0);if(this.isClassMethod()){let W=G;return W.kind="method",W.computed=!1,W.key=X,W.static=!1,this.pushClassMethod(f,W,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let W=G;return W.computed=!1,W.key=X,W.static=!1,f.body.push(this.parseClassProperty(W)),!0}return this.resetPreviousNodeTrailingComments(X),!1}parseClassMember(f,G,X){let W=this.isContextual(106);if(W){if(this.parseClassMemberFromModifier(f,G))return;if(this.eat(5)){this.parseClassStaticBlock(f,G);return}}this.parseClassMemberWithIsStatic(f,G,X,W)}parseClassMemberWithIsStatic(f,G,X,W){let R=G,J=G,U=G,V=G,H=G,Q=R,Y=R;if(G.static=W,this.parsePropertyNamePrefixOperator(G),this.eat(55)){Q.kind="method";let I=this.match(139);if(this.parseClassElementName(Q),I){this.pushClassPrivateMethod(f,J,!0,!1);return}if(this.isNonstaticConstructor(R))this.raise($.ConstructorIsGenerator,R.key);this.pushClassMethod(f,R,!0,!1,!1,!1);return}let F=!this.state.containsEsc&&$f(this.state.type),q=this.parseClassElementName(G),A=F?q.name:null,j=this.isPrivateName(q),b=this.state.startLoc;if(this.parsePostMemberNameModifiers(Y),this.isClassMethod()){if(Q.kind="method",j){this.pushClassPrivateMethod(f,J,!1,!1);return}let I=this.isNonstaticConstructor(R),L=!1;if(I){if(R.kind="constructor",X.hadConstructor&&!this.hasPlugin("typescript"))this.raise($.DuplicateConstructor,q);if(I&&this.hasPlugin("typescript")&&G.override)this.raise($.OverrideOnConstructor,q);X.hadConstructor=!0,L=X.hadSuperClass}this.pushClassMethod(f,R,!1,!1,I,L)}else if(this.isClassProperty())if(j)this.pushClassPrivateProperty(f,V);else this.pushClassProperty(f,U);else if(A==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(q);let I=this.eat(55);if(Y.optional)this.unexpected(b);Q.kind="method";let L=this.match(139);if(this.parseClassElementName(Q),this.parsePostMemberNameModifiers(Y),L)this.pushClassPrivateMethod(f,J,I,!0);else{if(this.isNonstaticConstructor(R))this.raise($.ConstructorIsAsync,R.key);this.pushClassMethod(f,R,I,!0,!1,!1)}}else if((A==="get"||A==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(q),Q.kind=A;let I=this.match(139);if(this.parseClassElementName(R),I)this.pushClassPrivateMethod(f,J,!1,!1);else{if(this.isNonstaticConstructor(R))this.raise($.ConstructorIsAccessor,R.key);this.pushClassMethod(f,R,!1,!1,!1,!1)}this.checkGetterSetterParams(R)}else if(A==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(q);let I=this.match(139);this.parseClassElementName(U),this.pushClassAccessorProperty(f,H,I)}else if(this.isLineTerminator())if(j)this.pushClassPrivateProperty(f,V);else this.pushClassProperty(f,U);else this.unexpected()}parseClassElementName(f){let{type:G,value:X}=this.state;if((G===132||G===134)&&f.static&&X==="prototype")this.raise($.StaticPrototype,this.state.startLoc);if(G===139){if(X==="constructor")this.raise($.ConstructorClassPrivateField,this.state.startLoc);let W=this.parsePrivateName();return f.key=W,W}return this.parsePropertyName(f),f.key}parseClassStaticBlock(f,G){var X;this.scope.enter(208);let W=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let R=G.body=[];if(this.parseBlockOrModuleBlockBody(R,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=W,f.body.push(this.finishNode(G,"StaticBlock")),(X=G.decorators)!=null&&X.length)this.raise($.DecoratorStaticBlock,G)}pushClassProperty(f,G){if(!G.computed&&this.nameIsConstructor(G.key))this.raise($.ConstructorClassField,G.key);f.body.push(this.parseClassProperty(G))}pushClassPrivateProperty(f,G){let X=this.parseClassPrivateProperty(G);f.body.push(X),this.classScope.declarePrivateName(this.getPrivateNameSV(X.key),0,X.key.loc.start)}pushClassAccessorProperty(f,G,X){if(!X&&!G.computed&&this.nameIsConstructor(G.key))this.raise($.ConstructorClassField,G.key);let W=this.parseClassAccessorProperty(G);if(f.body.push(W),X)this.classScope.declarePrivateName(this.getPrivateNameSV(W.key),0,W.key.loc.start)}pushClassMethod(f,G,X,W,R,J){f.body.push(this.parseMethod(G,X,W,R,J,"ClassMethod",!0))}pushClassPrivateMethod(f,G,X,W){let R=this.parseMethod(G,X,W,!1,!1,"ClassPrivateMethod",!0);f.body.push(R);let J=R.kind==="get"?R.static?6:2:R.kind==="set"?R.static?5:1:0;this.declareClassPrivateMethodInScope(R,J)}declareClassPrivateMethodInScope(f,G){this.classScope.declarePrivateName(this.getPrivateNameSV(f.key),G,f.key.loc.start)}parsePostMemberNameModifiers(f){}parseClassPrivateProperty(f){return this.parseInitializer(f),this.semicolon(),this.finishNode(f,"ClassPrivateProperty")}parseClassProperty(f){return this.parseInitializer(f),this.semicolon(),this.finishNode(f,"ClassProperty")}parseClassAccessorProperty(f){return this.parseInitializer(f),this.semicolon(),this.finishNode(f,"ClassAccessorProperty")}parseInitializer(f){this.scope.enter(80),this.expressionScope.enter(r9()),this.prodParam.enter(0),f.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(f,G,X,W=8331){if($f(this.state.type)){if(f.id=this.parseIdentifier(),G)this.declareNameFromIdentifier(f.id,W)}else if(X||!G)f.id=null;else throw this.raise($.MissingClassName,this.state.startLoc)}parseClassSuper(f){f.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(f,G){let X=this.parseMaybeImportPhase(f,!0),W=this.maybeParseExportDefaultSpecifier(f,X),R=!W||this.eat(12),J=R&&this.eatExportStar(f),U=J&&this.maybeParseExportNamespaceSpecifier(f),V=R&&(!U||this.eat(12)),H=W||J;if(J&&!U){if(W)this.unexpected();if(G)throw this.raise($.UnsupportedDecoratorExport,f);return this.parseExportFrom(f,!0),this.sawUnambiguousESM=!0,this.finishNode(f,"ExportAllDeclaration")}let Q=this.maybeParseExportNamedSpecifiers(f);if(W&&R&&!J&&!Q)this.unexpected(null,5);if(U&&V)this.unexpected(null,98);let Y;if(H||Q){if(Y=!1,G)throw this.raise($.UnsupportedDecoratorExport,f);this.parseExportFrom(f,H)}else Y=this.maybeParseExportDeclaration(f);if(H||Q||Y){var F;let q=f;if(this.checkExport(q,!0,!1,!!q.source),((F=q.declaration)==null?void 0:F.type)==="ClassDeclaration")this.maybeTakeDecorators(G,q.declaration,q);else if(G)throw this.raise($.UnsupportedDecoratorExport,f);return this.sawUnambiguousESM=!0,this.finishNode(q,"ExportNamedDeclaration")}if(this.eat(65)){let q=f,A=this.parseExportDefaultExpression();if(q.declaration=A,A.type==="ClassDeclaration")this.maybeTakeDecorators(G,A,q);else if(G)throw this.raise($.UnsupportedDecoratorExport,f);return this.checkExport(q,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(q,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(f){return this.eat(55)}maybeParseExportDefaultSpecifier(f,G){if(G||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",G==null?void 0:G.loc.start);let X=G||this.parseIdentifier(!0),W=this.startNodeAtNode(X);return W.exported=X,f.specifiers=[this.finishNode(W,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(f){if(this.isContextual(93)){var G,X;(X=(G=f).specifiers)!=null||(G.specifiers=[]);let W=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),W.exported=this.parseModuleExportName(),f.specifiers.push(this.finishNode(W,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(f){if(this.match(5)){let G=f;if(!G.specifiers)G.specifiers=[];let X=G.exportKind==="type";if(G.specifiers.push(...this.parseExportSpecifiers(X)),G.source=null,this.hasPlugin("importAssertions"))G.assertions=[];else G.attributes=[];return G.declaration=null,!0}return!1}maybeParseExportDeclaration(f){if(this.shouldParseExportDeclaration()){if(f.specifiers=[],f.source=null,this.hasPlugin("importAssertions"))f.assertions=[];else f.attributes=[];return f.declaration=this.parseExportDeclaration(f),!0}return!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let f=this.nextTokenInLineStart();return this.isUnparsedContextual(f,"function")}parseExportDefaultExpression(){let f=this.startNode();if(this.match(68))return this.next(),this.parseFunction(f,5);else if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(f,13);if(this.match(80))return this.parseClass(f,!0,!0);if(this.match(26)){if(this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0)this.raise($.DecoratorBeforeExport,this.state.startLoc);return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0)}if(this.match(75)||this.match(74)||this.isLet())throw this.raise($.UnsupportedDefaultExport,this.state.startLoc);let G=this.parseMaybeAssignAllowIn();return this.semicolon(),G}parseExportDeclaration(f){if(this.match(80))return this.parseClass(this.startNode(),!0,!1);return this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:f}=this.state;if($f(f)){if(f===95&&!this.state.containsEsc||f===100)return!1;if((f===130||f===129)&&!this.state.containsEsc){let{type:W}=this.lookahead();if($f(W)&&W!==98||W===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let G=this.nextTokenStart(),X=this.isUnparsedContextual(G,"from");if(this.input.charCodeAt(G)===44||$f(this.state.type)&&X)return!0;if(this.match(65)&&X){let W=this.input.charCodeAt(this.nextTokenStartSince(G+4));return W===34||W===39}return!1}parseExportFrom(f,G){if(this.eatContextual(98))f.source=this.parseImportSource(),this.checkExport(f),this.maybeParseImportAttributes(f),this.checkJSONModuleImport(f);else if(G)this.unexpected();this.semicolon()}shouldParseExportDeclaration(){let{type:f}=this.state;if(f===26){if(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators")){if(this.getPluginOption("decorators","decoratorsBeforeExport")===!0)this.raise($.DecoratorBeforeExport,this.state.startLoc);return!0}}if(this.isContextual(107))return this.raise($.UsingDeclarationExport,this.state.startLoc),!0;if(this.isContextual(96)&&this.startsAwaitUsing())return this.raise($.UsingDeclarationExport,this.state.startLoc),!0;return f===74||f===75||f===68||f===80||this.isLet()||this.isAsyncFunction()}checkExport(f,G,X,W){if(G){var R;if(X){if(this.checkDuplicateExports(f,"default"),this.hasPlugin("exportDefaultFrom")){var J;let U=f.declaration;if(U.type==="Identifier"&&U.name==="from"&&U.end-U.start===4&&!((J=U.extra)!=null&&J.parenthesized))this.raise($.ExportDefaultFromAsIdentifier,U)}}else if((R=f.specifiers)!=null&&R.length)for(let U of f.specifiers){let{exported:V}=U,H=V.type==="Identifier"?V.name:V.value;if(this.checkDuplicateExports(U,H),!W&&U.local){let{local:Q}=U;if(Q.type!=="Identifier")this.raise($.ExportBindingIsString,U,{localName:Q.value,exportName:H});else this.checkReservedWord(Q.name,Q.loc.start,!0,!1),this.scope.checkLocalExport(Q)}}else if(f.declaration){let U=f.declaration;if(U.type==="FunctionDeclaration"||U.type==="ClassDeclaration"){let{id:V}=U;if(!V)throw new Error("Assertion failure");this.checkDuplicateExports(f,V.name)}else if(U.type==="VariableDeclaration")for(let V of U.declarations)this.checkDeclaration(V.id)}}}checkDeclaration(f){if(f.type==="Identifier")this.checkDuplicateExports(f,f.name);else if(f.type==="ObjectPattern")for(let G of f.properties)this.checkDeclaration(G);else if(f.type==="ArrayPattern"){for(let G of f.elements)if(G)this.checkDeclaration(G)}else if(f.type==="ObjectProperty")this.checkDeclaration(f.value);else if(f.type==="RestElement")this.checkDeclaration(f.argument);else if(f.type==="AssignmentPattern")this.checkDeclaration(f.left)}checkDuplicateExports(f,G){if(this.exportedIdentifiers.has(G))if(G==="default")this.raise($.DuplicateDefaultExport,f);else this.raise($.DuplicateExport,f,{exportName:G});this.exportedIdentifiers.add(G)}parseExportSpecifiers(f){let G=[],X=!0;this.expect(5);while(!this.eat(8)){if(X)X=!1;else if(this.expect(12),this.eat(8))break;let W=this.isContextual(130),R=this.match(134),J=this.startNode();J.local=this.parseModuleExportName(),G.push(this.parseExportSpecifier(J,R,f,W))}return G}parseExportSpecifier(f,G,X,W){if(this.eatContextual(93))f.exported=this.parseModuleExportName();else if(G)f.exported=HJf(f.local);else if(!f.exported)f.exported=LG(f.local);return this.finishNode(f,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let f=this.parseStringLiteral(this.state.value),G=LJf.exec(f.value);if(G)this.raise($.ModuleExportNameHasLoneSurrogate,f,{surrogateCharCode:G[0].charCodeAt(0)});return f}return this.parseIdentifier(!0)}isJSONModuleImport(f){if(f.assertions!=null)return f.assertions.some(({key:G,value:X})=>{return X.value==="json"&&(G.type==="Identifier"?G.name==="type":G.value==="type")});return!1}checkImportReflection(f){let{specifiers:G}=f,X=G.length===1?G[0].type:null;if(f.phase==="source"){if(X!=="ImportDefaultSpecifier")this.raise($.SourcePhaseImportRequiresDefault,G[0].loc.start)}else if(f.phase==="defer"){if(X!=="ImportNamespaceSpecifier")this.raise($.DeferImportRequiresNamespace,G[0].loc.start)}else if(f.module){var W;if(X!=="ImportDefaultSpecifier")this.raise($.ImportReflectionNotBinding,G[0].loc.start);if(((W=f.assertions)==null?void 0:W.length)>0)this.raise($.ImportReflectionHasAssertion,G[0].loc.start)}}checkJSONModuleImport(f){if(this.isJSONModuleImport(f)&&f.type!=="ExportAllDeclaration"){let{specifiers:G}=f;if(G!=null){let X=G.find((W)=>{let R;if(W.type==="ExportSpecifier")R=W.local;else if(W.type==="ImportSpecifier")R=W.imported;if(R!==void 0)return R.type==="Identifier"?R.name!=="default":R.value!=="default"});if(X!==void 0)this.raise($.ImportJSONBindingNotDefault,X.loc.start)}}}isPotentialImportPhase(f){if(f)return!1;return this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(f,G,X,W){if(G)return;if(X==="module")this.expectPlugin("importReflection",W),f.module=!0;else if(this.hasPlugin("importReflection"))f.module=!1;if(X==="source")this.expectPlugin("sourcePhaseImports",W),f.phase="source";else if(X==="defer")this.expectPlugin("deferredImportEvaluation",W),f.phase="defer";else if(this.hasPlugin("sourcePhaseImports"))f.phase=null}parseMaybeImportPhase(f,G){if(!this.isPotentialImportPhase(G))return this.applyImportPhase(f,G,null),null;let X=this.parseIdentifier(!0),{type:W}=this.state;if(HG(W)?W!==98||this.lookaheadCharCode()===102:W!==12)return this.resetPreviousIdentifierLeadingComments(X),this.applyImportPhase(f,G,X.name,X.loc.start),null;else return this.applyImportPhase(f,G,null),X}isPrecedingIdImportPhase(f){let{type:G}=this.state;return $f(G)?G!==98||this.lookaheadCharCode()===102:G!==12}parseImport(f){if(this.match(134))return this.parseImportSourceAndAttributes(f);return this.parseImportSpecifiersAndAfter(f,this.parseMaybeImportPhase(f,!1))}parseImportSpecifiersAndAfter(f,G){f.specifiers=[];let W=!this.maybeParseDefaultImportSpecifier(f,G)||this.eat(12),R=W&&this.maybeParseStarImportSpecifier(f);if(W&&!R)this.parseNamedImportSpecifiers(f);return this.expectContextual(98),this.parseImportSourceAndAttributes(f)}parseImportSourceAndAttributes(f){var G;return(G=f.specifiers)!=null||(f.specifiers=[]),f.source=this.parseImportSource(),this.maybeParseImportAttributes(f),this.checkImportReflection(f),this.checkJSONModuleImport(f),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(f,"ImportDeclaration")}parseImportSource(){if(!this.match(134))this.unexpected();return this.parseExprAtom()}parseImportSpecifierLocal(f,G,X){G.local=this.parseIdentifier(),f.specifiers.push(this.finishImportSpecifier(G,X))}finishImportSpecifier(f,G,X=8201){return this.checkLVal(f.local,{type:G},X),this.finishNode(f,G)}parseImportAttributes(){this.expect(5);let f=[],G=new Set;do{if(this.match(8))break;let X=this.startNode(),W=this.state.value;if(G.has(W))this.raise($.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:W});if(G.add(W),this.match(134))X.key=this.parseStringLiteral(W);else X.key=this.parseIdentifier(!0);if(this.expect(14),!this.match(134))throw this.raise($.ModuleAttributeInvalidValue,this.state.startLoc);X.value=this.parseStringLiteral(this.state.value),f.push(this.finishNode(X,"ImportAttribute"))}while(this.eat(12));return this.expect(8),f}parseModuleAttributes(){let f=[],G=new Set;do{let X=this.startNode();if(X.key=this.parseIdentifier(!0),X.key.name!=="type")this.raise($.ModuleAttributeDifferentFromType,X.key);if(G.has(X.key.name))this.raise($.ModuleAttributesWithDuplicateKeys,X.key,{key:X.key.name});if(G.add(X.key.name),this.expect(14),!this.match(134))throw this.raise($.ModuleAttributeInvalidValue,this.state.startLoc);X.value=this.parseStringLiteral(this.state.value),f.push(this.finishNode(X,"ImportAttribute"))}while(this.eat(12));return f}maybeParseImportAttributes(f){let G;var X=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;if(this.next(),this.hasPlugin("moduleAttributes"))G=this.parseModuleAttributes();else G=this.parseImportAttributes();X=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak()){if(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions"))this.raise($.ImportAttributesUseAssert,this.state.startLoc);if(!this.hasPlugin("importAssertions"))this.addExtra(f,"deprecatedAssertSyntax",!0);this.next(),G=this.parseImportAttributes()}else G=[];if(!X&&this.hasPlugin("importAssertions"))f.assertions=G;else f.attributes=G}maybeParseDefaultImportSpecifier(f,G){if(G){let X=this.startNodeAtNode(G);return X.local=G,f.specifiers.push(this.finishImportSpecifier(X,"ImportDefaultSpecifier")),!0}else if(HG(this.state.type))return this.parseImportSpecifierLocal(f,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(f){if(this.match(55)){let G=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(f,G,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(f){let G=!0;this.expect(5);while(!this.eat(8)){if(G)G=!1;else{if(this.eat(14))throw this.raise($.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let X=this.startNode(),W=this.match(134),R=this.isContextual(130);X.imported=this.parseModuleExportName();let J=this.parseImportSpecifier(X,W,f.importKind==="type"||f.importKind==="typeof",R,void 0);f.specifiers.push(J)}}parseImportSpecifier(f,G,X,W,R){if(this.eatContextual(93))f.local=this.parseIdentifier();else{let{imported:J}=f;if(G)throw this.raise($.ImportBindingIsString,f,{importName:J.value});if(this.checkReservedWord(J.name,f.loc.start,!0,!0),!f.local)f.local=LG(J)}return this.finishImportSpecifier(f,"ImportSpecifier",R)}isThisParam(f){return f.type==="Identifier"&&f.name==="this"}}class uR extends R8{constructor(f,G,X){f=IRf(f);super(f,G);this.options=f,this.initializeScopes(),this.plugins=X,this.filename=f.sourceFilename,this.startIndex=f.startIndex;let W=0;if(f.allowAwaitOutsideFunction)W|=1;if(f.allowReturnOutsideFunction)W|=2;if(f.allowImportExportEverywhere)W|=8;if(f.allowSuperOutsideMethod)W|=16;if(f.allowUndeclaredExports)W|=32;if(f.allowNewTargetOutsideFunction)W|=4;if(f.ranges)W|=64;if(f.tokens)W|=128;if(f.createImportExpressions)W|=256;if(f.createParenthesizedExpressions)W|=512;if(f.errorRecovery)W|=1024;if(f.attachComment)W|=2048;if(f.annexB)W|=4096;this.optionFlags=W}getScopeHandler(){return HW}parse(){this.enterInitialScopes();let f=this.startNode(),G=this.startNode();return this.nextToken(),f.errors=null,this.parseTopLevel(f,G),f.errors=this.state.errors,f.comments.length=this.state.commentsLen,f}}function EJf(f,G){var X;if(((X=G)==null?void 0:X.sourceType)==="unambiguous"){G=Object.assign({},G);try{G.sourceType="module";let W=GX(G,f),R=W.parse();if(W.sawUnambiguousESM)return R;if(W.ambiguousScriptDifferentAst)try{return G.sourceType="script",GX(G,f).parse()}catch(J){}else R.program.sourceType="script";return R}catch(W){try{return G.sourceType="script",GX(G,f).parse()}catch(R){}throw W}}else return GX(G,f).parse()}function wJf(f,G){let X=GX(G,f);if(X.options.strictMode)X.state.strict=!0;return X.getExpression()}function kJf(f){let G={};for(let X of Object.keys(f))G[X]=jG(f[X]);return G}var vJf=kJf(bRf);function GX(f,G){let X=uR,W=new Map;if(f!=null&&f.plugins){for(let R of f.plugins){let J,U;if(typeof R==="string")J=R;else[J,U]=R;if(!W.has(J))W.set(J,U||{})}IJf(W),X=gJf(W)}return new X(f,G,W)}var T9=new Map;function gJf(f){let G=[];for(let R of TJf)if(f.has(R))G.push(R);let X=G.join("|"),W=T9.get(X);if(!W){W=uR;for(let R of G)W=X8[R](W);T9.set(X,W)}return W}J8.parse=EJf;J8.parseExpression=wJf;J8.tokTypes=vJf});var hR=P((U8)=>{Object.defineProperty(U8,"__esModule",{value:!0});U8.Var=U8.User=U8.Statement=U8.SpreadProperty=U8.Scope=U8.RestProperty=U8.ReferencedMemberExpression=U8.ReferencedIdentifier=U8.Referenced=U8.Pure=U8.NumericLiteralTypeAnnotation=U8.Generated=U8.ForAwaitStatement=U8.Flow=U8.Expression=U8.ExistentialTypeParam=U8.BlockScoped=U8.BindingIdentifier=void 0;var nKf=U8.ReferencedIdentifier=["Identifier","JSXIdentifier"],oKf=U8.ReferencedMemberExpression=["MemberExpression"],eKf=U8.BindingIdentifier=["Identifier"],fSf=U8.Statement=["Statement"],GSf=U8.Expression=["Expression"],XSf=U8.Scope=["Scopable","Pattern"],WSf=U8.Referenced=null,RSf=U8.BlockScoped=null,JSf=U8.Var=["VariableDeclaration"],USf=U8.User=null,VSf=U8.Generated=null,HSf=U8.Pure=null,QSf=U8.Flow=["Flow","ImportDeclaration","ExportDeclaration","ImportSpecifier"],ZSf=U8.RestProperty=["RestElement"],YSf=U8.SpreadProperty=["RestElement"],zSf=U8.ExistentialTypeParam=["ExistsTypeAnnotation"],BSf=U8.NumericLiteralTypeAnnotation=["NumberLiteralTypeAnnotation"],MSf=U8.ForAwaitStatement=["ForOfStatement"]});var Q8=P((SSf,H8)=>{var O1=1000,j1=O1*60,P1=j1*60,eG=P1*24,XUf=eG*7,WUf=eG*365.25;H8.exports=function(f,G){G=G||{};var X=typeof f;if(X==="string"&&f.length>0)return RUf(f);else if(X==="number"&&isFinite(f))return G.long?UUf(f):JUf(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function RUf(f){if(f=String(f),f.length>100)return;var G=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(f);if(!G)return;var X=parseFloat(G[1]),W=(G[2]||"ms").toLowerCase();switch(W){case"years":case"year":case"yrs":case"yr":case"y":return X*WUf;case"weeks":case"week":case"w":return X*XUf;case"days":case"day":case"d":return X*eG;case"hours":case"hour":case"hrs":case"hr":case"h":return X*P1;case"minutes":case"minute":case"mins":case"min":case"m":return X*j1;case"seconds":case"second":case"secs":case"sec":case"s":return X*O1;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return X;default:return}}function JUf(f){var G=Math.abs(f);if(G>=eG)return Math.round(f/eG)+"d";if(G>=P1)return Math.round(f/P1)+"h";if(G>=j1)return Math.round(f/j1)+"m";if(G>=O1)return Math.round(f/O1)+"s";return f+"ms"}function UUf(f){var G=Math.abs(f);if(G>=eG)return ZW(f,G,eG,"day");if(G>=P1)return ZW(f,G,P1,"hour");if(G>=j1)return ZW(f,G,j1,"minute");if(G>=O1)return ZW(f,G,O1,"second");return f+" ms"}function ZW(f,G,X,W){var R=G>=X*1.5;return Math.round(f/X)+" "+W+(R?"s":"")}});var yR=P((FSf,Z8)=>{function VUf(f){X.debug=X,X.default=X,X.coerce=H,X.disable=U,X.enable=R,X.enabled=V,X.humanize=Q8(),X.destroy=Q,Object.keys(f).forEach((Y)=>{X[Y]=f[Y]}),X.names=[],X.skips=[],X.formatters={};function G(Y){let F=0;for(let q=0;q<Y.length;q++)F=(F<<5)-F+Y.charCodeAt(q),F|=0;return X.colors[Math.abs(F)%X.colors.length]}X.selectColor=G;function X(Y){let F,q=null,A,j;function b(...I){if(!b.enabled)return;let L=b,E=Number(new Date),Xf=E-(F||E);if(L.diff=Xf,L.prev=F,L.curr=E,F=E,I[0]=X.coerce(I[0]),typeof I[0]!=="string")I.unshift("%O");let s=0;I[0]=I[0].replace(/%([a-zA-Z%])/g,(Kf,bf)=>{if(Kf==="%%")return"%";s++;let wf=X.formatters[bf];if(typeof wf==="function"){let y=I[s];Kf=wf.call(L,y),I.splice(s,1),s--}return Kf}),X.formatArgs.call(L,I),(L.log||X.log).apply(L,I)}if(b.namespace=Y,b.useColors=X.useColors(),b.color=X.selectColor(Y),b.extend=W,b.destroy=X.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(q!==null)return q;if(A!==X.namespaces)A=X.namespaces,j=X.enabled(Y);return j},set:(I)=>{q=I}}),typeof X.init==="function")X.init(b);return b}function W(Y,F){let q=X(this.namespace+(typeof F==="undefined"?":":F)+Y);return q.log=this.log,q}function R(Y){X.save(Y),X.namespaces=Y,X.names=[],X.skips=[];let F=(typeof Y==="string"?Y:"").trim().replace(" ",",").split(",").filter(Boolean);for(let q of F)if(q[0]==="-")X.skips.push(q.slice(1));else X.names.push(q)}function J(Y,F){let q=0,A=0,j=-1,b=0;while(q<Y.length)if(A<F.length&&(F[A]===Y[q]||F[A]==="*"))if(F[A]==="*")j=A,b=q,A++;else q++,A++;else if(j!==-1)A=j+1,b++,q=b;else return!1;while(A<F.length&&F[A]==="*")A++;return A===F.length}function U(){let Y=[...X.names,...X.skips.map((F)=>"-"+F)].join(",");return X.enable(""),Y}function V(Y){for(let F of X.skips)if(J(Y,F))return!1;for(let F of X.names)if(J(Y,F))return!0;return!1}function H(Y){if(Y instanceof Error)return Y.stack||Y.message;return Y}function Q(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return X.enable(X.load()),X}Z8.exports=VUf});var z8=P((Y8,zW)=>{Y8.formatArgs=QUf;Y8.save=ZUf;Y8.load=YUf;Y8.useColors=HUf;Y8.storage=zUf();Y8.destroy=(()=>{let f=!1;return()=>{if(!f)f=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();Y8.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function HUf(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let f;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(f=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(f[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function QUf(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+zW.exports.humanize(this.diff),!this.useColors)return;let G="color: "+this.color;f.splice(1,0,G,"color: inherit");let X=0,W=0;f[0].replace(/%[a-zA-Z%]/g,(R)=>{if(R==="%%")return;if(X++,R==="%c")W=X}),f.splice(W,0,G)}Y8.log=console.debug||console.log||(()=>{});function ZUf(f){try{if(f)Y8.storage.setItem("debug",f);else Y8.storage.removeItem("debug")}catch(G){}}function YUf(){let f;try{f=Y8.storage.getItem("debug")}catch(G){}if(!f&&typeof process!=="undefined"&&"env"in process)f=process.env.DEBUG;return f}function zUf(){try{return localStorage}catch(f){}}zW.exports=yR()(Y8);var{formatters:BUf}=zW.exports;BUf.j=function(f){try{return JSON.stringify(f)}catch(G){return"[UnexpectedJSONParseError]: "+G.message}}});var M8={};V5(M8,{default:()=>IUf,createSupportsColor:()=>xR});import mR from"node:process";import AUf from"node:os";import B8 from"node:tty";function XG(f,G=globalThis.Deno?globalThis.Deno.args:mR.argv){let X=f.startsWith("-")?"":f.length===1?"-":"--",W=G.indexOf(X+f),R=G.indexOf("--");return W!==-1&&(R===-1||W<R)}function OUf(){if("FORCE_COLOR"in If){if(If.FORCE_COLOR==="true")return 1;if(If.FORCE_COLOR==="false")return 0;return If.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(If.FORCE_COLOR,10),3)}}function jUf(f){if(f===0)return!1;return{level:f,hasBasic:!0,has256:f>=2,has16m:f>=3}}function PUf(f,{streamIsTTY:G,sniffFlags:X=!0}={}){let W=OUf();if(W!==void 0)BW=W;let R=X?BW:W;if(R===0)return 0;if(X){if(XG("color=16m")||XG("color=full")||XG("color=truecolor"))return 3;if(XG("color=256"))return 2}if("TF_BUILD"in If&&"AGENT_NAME"in If)return 1;if(f&&!G&&R===void 0)return 0;let J=R||0;if(If.TERM==="dumb")return J;if(mR.platform==="win32"){let U=AUf.release().split(".");if(Number(U[0])>=10&&Number(U[2])>=10586)return Number(U[2])>=14931?3:2;return 1}if("CI"in If){if("GITHUB_ACTIONS"in If||"GITEA_ACTIONS"in If)return 3;if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((U)=>(U in If))||If.CI_NAME==="codeship")return 1;return J}if("TEAMCITY_VERSION"in If)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(If.TEAMCITY_VERSION)?1:0;if(If.COLORTERM==="truecolor")return 3;if(If.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in If){let U=Number.parseInt((If.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(If.TERM_PROGRAM){case"iTerm.app":return U>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(If.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(If.TERM))return 1;if("COLORTERM"in If)return 1;return J}function xR(f,G={}){let X=PUf(f,{streamIsTTY:f&&f.isTTY,...G});return jUf(X)}var If,BW,DUf,IUf;var K8=H5(()=>{({env:If}=mR);if(XG("no-color")||XG("no-colors")||XG("color=false")||XG("color=never"))BW=0;else if(XG("color")||XG("colors")||XG("color=true")||XG("color=always"))BW=1;DUf={stdout:xR({isTTY:B8.isatty(1)}),stderr:xR({isTTY:B8.isatty(2)})},IUf=DUf});var C8=P((F8,KW)=>{var TUf=sJ("node:tty"),MW=sJ("node:util");F8.init=vUf;F8.log=EUf;F8.formatArgs=LUf;F8.save=wUf;F8.load=kUf;F8.useColors=NUf;F8.destroy=MW.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");F8.colors=[6,2,3,4,5,1];try{let f=(K8(),U5(M8));if(f&&(f.stderr||f).level>=2)F8.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(f){}F8.inspectOpts=Object.keys(process.env).filter((f)=>{return/^debug_/i.test(f)}).reduce((f,G)=>{let X=G.substring(6).toLowerCase().replace(/_([a-z])/g,(R,J)=>{return J.toUpperCase()}),W=process.env[G];if(/^(yes|on|true|enabled)$/i.test(W))W=!0;else if(/^(no|off|false|disabled)$/i.test(W))W=!1;else if(W==="null")W=null;else W=Number(W);return f[X]=W,f},{});function NUf(){return"colors"in F8.inspectOpts?Boolean(F8.inspectOpts.colors):TUf.isatty(process.stderr.fd)}function LUf(f){let{namespace:G,useColors:X}=this;if(X){let W=this.color,R="\x1B[3"+(W<8?W:"8;5;"+W),J=` ${R};1m${G} \x1B[0m`;f[0]=J+f[0].split(`
|
|
24
24
|
`).join(`
|
|
25
25
|
`+J),f.push(R+"m+"+KW.exports.humanize(this.diff)+"\x1B[0m")}else f[0]=bUf()+G+" "+f[0]}function bUf(){if(F8.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function EUf(...f){return process.stderr.write(MW.formatWithOptions(F8.inspectOpts,...f)+`
|
|
26
26
|
`)}function wUf(f){if(f)process.env.DEBUG=f;else delete process.env.DEBUG}function kUf(){return process.env.DEBUG}function vUf(f){f.inspectOpts={};let G=Object.keys(F8.inspectOpts);for(let X=0;X<G.length;X++)f.inspectOpts[G[X]]=F8.inspectOpts[G[X]]}KW.exports=yR()(F8);var{formatters:S8}=KW.exports;S8.o=function(f){return this.inspectOpts.colors=this.useColors,MW.inspect(f,this.inspectOpts).split(`
|
|
@@ -52,4 +52,4 @@ ${G}`,W}}}});var X7=P((f7)=>{Object.defineProperty(f7,"__esModule",{value:!0});f
|
|
|
52
52
|
|
|
53
53
|
return ${H1(W)};
|
|
54
54
|
})(${V7(this.node)})
|
|
55
|
-
`;return this.replaceWith(Q)[0].get("arguments.0")}function q7f(f){let G=f.params.findIndex((X)=>nQf(X)||oQf(X));return G===-1?f.params.length:G}});var $7=P((F7)=>{Object.defineProperty(F7,"__esModule",{value:!0});F7._guessExecutionStatusRelativeTo=s7f;F7._resolve=S7;F7.canHaveVariableDeclarationOrExpression=y7f;F7.canSwapBetweenExpressionAndStatement=x7f;F7.getSource=a7f;F7.isCompletionRecord=m7f;F7.isConstantExpression=n7f;F7.isInStrictMode=o7f;F7.isNodeType=h7f;F7.isStatementOrBlock=l7f;F7.isStatic=u7f;F7.matchesPattern=_7f;F7.referencesImport=c7f;F7.resolve=t7f;F7.willIMaybeExecuteBefore=i7f;var T7f=Vf(),{STATEMENT_OR_BLOCK_KEYS:N7f,VISITOR_KEYS:L7f,isBlockStatement:K7,isExpression:b7f,isIdentifier:E7f,isLiteral:w7f,isStringLiteral:k7f,isType:v7f,matchesPattern:g7f}=T7f;function _7f(f,G){return g7f(this.node,f,G)}F7.has=function f(G){var X;let W=(X=this.node)==null?void 0:X[G];if(W&&Array.isArray(W))return!!W.length;else return!!W};function u7f(){return this.scope.isStatic(this.node)}F7.is=F7.has,F7.isnt=function f(G){return!this.has(G)},F7.equals=function f(G,X){return this.node[G]===X};function h7f(f){return v7f(this.type,f)}function y7f(){return(this.key==="init"||this.key==="left")&&this.parentPath.isFor()}function x7f(f){if(this.key!=="body"||!this.parentPath.isArrowFunctionExpression())return!1;if(this.isExpression())return K7(f);else if(this.isBlockStatement())return b7f(f);return!1}function m7f(f){let G=this,X=!0;do{let{type:W,container:R}=G;if(!X&&(G.isFunction()||W==="StaticBlock"))return!!f;if(X=!1,Array.isArray(R)&&G.key!==R.length-1)return!1}while((G=G.parentPath)&&!G.isProgram()&&!G.isDoExpression());return!0}function l7f(){if(this.parentPath.isLabeledStatement()||K7(this.container))return!1;else return N7f.includes(this.key)}function c7f(f,G){if(!this.isReferencedIdentifier()){if(this.isJSXMemberExpression()&&this.node.property.name===G||(this.isMemberExpression()||this.isOptionalMemberExpression())&&(this.node.computed?k7f(this.node.property,{value:G}):this.node.property.name===G)){let J=this.get("object");return J.isReferencedIdentifier()&&J.referencesImport(f,"*")}return!1}let X=this.scope.getBinding(this.node.name);if(!X||X.kind!=="module")return!1;let W=X.path,R=W.parentPath;if(!R.isImportDeclaration())return!1;if(R.node.source.value===f){if(!G)return!0}else return!1;if(W.isImportDefaultSpecifier()&&G==="default")return!0;if(W.isImportNamespaceSpecifier()&&G==="*")return!0;if(W.isImportSpecifier()&&E7f(W.node.imported,{name:G}))return!0;return!1}function a7f(){let f=this.node;if(f.end){let G=this.hub.getCode();if(G)return G.slice(f.start,f.end)}return""}function i7f(f){return this._guessExecutionStatusRelativeTo(f)!=="after"}function z7(f){return f.isProgram()?f:(f.parentPath.scope.getFunctionParent()||f.parentPath.scope.getProgramParent()).path}function r7f(f,G){switch(f){case"LogicalExpression":return G==="right";case"ConditionalExpression":case"IfStatement":return G==="consequent"||G==="alternate";case"WhileStatement":case"DoWhileStatement":case"ForInStatement":case"ForOfStatement":return G==="body";case"ForStatement":return G==="body"||G==="update";case"SwitchStatement":return G==="cases";case"TryStatement":return G==="handler";case"AssignmentPattern":return G==="right";case"OptionalMemberExpression":return G==="property";case"OptionalCallExpression":return G==="arguments";default:return!1}}function B7(f,G){for(let X=0;X<G;X++){let W=f[X];if(r7f(W.parent.type,W.parentKey))return!0}return!1}var M7=Symbol();function s7f(f){return NJ(this,f,new Map)}function NJ(f,G,X){let W={this:z7(f),target:z7(G)};if(W.target.node!==W.this.node)return d7f(f,W.target,X);let R={target:G.getAncestry(),this:f.getAncestry()};if(R.target.includes(f))return"after";if(R.this.includes(G))return"before";let J,U={target:0,this:0};while(!J&&U.this<R.this.length){let Y=R.this[U.this];if(U.target=R.target.indexOf(Y),U.target>=0)J=Y;else U.this++}if(!J)throw new Error("Internal Babel error - The two compared nodes don't appear to belong to the same program.");if(B7(R.this,U.this-1)||B7(R.target,U.target-1))return"unknown";let V={this:R.this[U.this-1],target:R.target[U.target-1]};if(V.target.listKey&&V.this.listKey&&V.target.container===V.this.container)return V.target.key>V.this.key?"before":"after";let H=L7f[J.type],Q={this:H.indexOf(V.this.parentKey),target:H.indexOf(V.target.parentKey)};return Q.target>Q.this?"before":"after"}function p7f(f,G,X){if(!G.isFunctionDeclaration()){if(NJ(f,G,X)==="before")return"before";return"unknown"}else if(G.parentPath.isExportDeclaration())return"unknown";let W=G.scope.getBinding(G.node.id.name);if(!W.references)return"before";let R=W.referencePaths,J;for(let U of R){if(!!U.find((Q)=>Q.node===G.node))continue;if(U.key!=="callee"||!U.parentPath.isCallExpression())return"unknown";let H=NJ(f,U,X);if(J&&J!==H)return"unknown";else J=H}return J}function d7f(f,G,X){let W=X.get(f.node),R;if(!W)X.set(f.node,W=new Map);else if(R=W.get(G.node)){if(R===M7)return"unknown";return R}W.set(G.node,M7);let J=p7f(f,G,X);return W.set(G.node,J),J}function t7f(f,G){return S7.call(this,f,G)||this}function S7(f,G){var X;if((X=G)!=null&&X.includes(this))return;if(G=G||[],G.push(this),this.isVariableDeclarator()){if(this.get("id").isIdentifier())return this.get("init").resolve(f,G)}else if(this.isReferencedIdentifier()){let W=this.scope.getBinding(this.node.name);if(!W)return;if(!W.constant)return;if(W.kind==="module")return;if(W.path!==this){let R=W.path.resolve(f,G);if(this.find((J)=>J.node===R.node))return;return R}}else if(this.isTypeCastExpression())return this.get("expression").resolve(f,G);else if(f&&this.isMemberExpression()){let W=this.toComputedKey();if(!w7f(W))return;let R=W.value,J=this.get("object").resolve(f,G);if(J.isObjectExpression()){let U=J.get("properties");for(let V of U){if(!V.isProperty())continue;let H=V.get("key"),Q=V.isnt("computed")&&H.isIdentifier({name:R});if(Q=Q||H.isLiteral({value:R}),Q)return V.get("value").resolve(f,G)}}else if(J.isArrayExpression()&&!isNaN(+R)){let V=J.get("elements")[R];if(V)return V.resolve(f,G)}}}function n7f(){if(this.isIdentifier()){let f=this.scope.getBinding(this.node.name);if(!f)return!1;return f.constant}if(this.isLiteral()){if(this.isRegExpLiteral())return!1;if(this.isTemplateLiteral())return this.get("expressions").every((f)=>f.isConstantExpression());return!0}if(this.isUnaryExpression()){if(this.node.operator!=="void")return!1;return this.get("argument").isConstantExpression()}if(this.isBinaryExpression()){let{operator:f}=this.node;return f!=="in"&&f!=="instanceof"&&this.get("left").isConstantExpression()&&this.get("right").isConstantExpression()}if(this.isMemberExpression())return!this.node.computed&&this.get("object").isIdentifier({name:"Symbol"})&&!this.scope.hasBinding("Symbol",{noGlobals:!0});if(this.isCallExpression())return this.node.arguments.length===1&&this.get("callee").matchesPattern("Symbol.for")&&!this.scope.hasBinding("Symbol",{noGlobals:!0})&&this.get("arguments")[0].isStringLiteral();return!1}function o7f(){return!!(this.isProgram()?this:this.parentPath).find((X)=>{if(X.isProgram({sourceType:"module"}))return!0;if(X.isClass())return!0;if(X.isArrowFunctionExpression()&&!X.get("body").isBlockStatement())return!1;let W;if(X.isFunction())W=X.node.body;else if(X.isProgram())W=X.node;else return!1;for(let R of W.directives)if(R.value.value==="use strict")return!0})}});var P7=P((j7)=>{Object.defineProperty(j7,"__esModule",{value:!0});j7._getKey=A7;j7._getPattern=O7;j7.get=E5f;j7.getAllNextSiblings=L5f;j7.getAllPrevSiblings=b5f;j7.getAssignmentIdentifiers=w5f;j7.getBindingIdentifierPaths=g5f;j7.getBindingIdentifiers=k5f;j7.getCompletionRecords=D5f;j7.getNextSibling=N5f;j7.getOpposite=O5f;j7.getOuterBindingIdentifierPaths=_5f;j7.getOuterBindingIdentifiers=v5f;j7.getPrevSibling=T5f;j7.getSibling=I5f;var bJ=lG(),K5f=Vf(),{getAssignmentIdentifiers:S5f,getBindingIdentifiers:q7,getOuterBindingIdentifiers:F5f,numericLiteral:$5f,unaryExpression:C5f}=K5f,EJ=0,SX=1;function q5f(f){return{type:EJ,path:f}}function A5f(f){return{type:SX,path:f}}function O5f(){if(this.key==="left")return this.getSibling("right");else if(this.key==="right")return this.getSibling("left");return null}function N1(f,G,X){if(f)G.push(...L1(f,X));return G}function j5f(f,G,X){let W=[];for(let R=0;R<f.length;R++){let J=f[R],U=L1(J,X),V=[],H=[];for(let Q of U){if(Q.type===EJ)V.push(Q);if(Q.type===SX)H.push(Q)}if(V.length)W=V;G.push(...H)}return G.push(...W),G}function P5f(f){f.forEach((G)=>{G.type=SX})}function LJ(f,G){f.forEach((X)=>{if(X.path.isBreakStatement({label:null}))if(G)X.path.replaceWith(C5f("void",$5f(0)));else X.path.remove()})}function C7(f,G){let X=[];if(G.canHaveBreak){let W=[];for(let R=0;R<f.length;R++){let J=f[R],U=Object.assign({},G,{inCaseClause:!1});if(J.isBlockStatement()&&(G.inCaseClause||G.shouldPopulateBreak))U.shouldPopulateBreak=!0;else U.shouldPopulateBreak=!1;let V=L1(J,U);if(V.length>0&&V.every((H)=>H.type===SX)){if(W.length>0&&V.every((H)=>H.path.isBreakStatement({label:null}))){if(P5f(W),X.push(...W),W.some((H)=>H.path.isDeclaration()))X.push(...V),LJ(V,!0);LJ(V,!1)}else if(X.push(...V),!G.shouldPopulateBreak)LJ(V,!0);break}if(R===f.length-1)X.push(...V);else{W=[];for(let H=0;H<V.length;H++){let Q=V[H];if(Q.type===SX)X.push(Q);if(Q.type===EJ)W.push(Q)}}}}else if(f.length)for(let W=f.length-1;W>=0;W--){let R=L1(f[W],G);if(R.length>1||R.length===1&&!R[0].path.isVariableDeclaration()){X.push(...R);break}}return X}function L1(f,G){let X=[];if(f.isIfStatement())X=N1(f.get("consequent"),X,G),X=N1(f.get("alternate"),X,G);else if(f.isDoExpression()||f.isFor()||f.isWhile()||f.isLabeledStatement())return N1(f.get("body"),X,G);else if(f.isProgram()||f.isBlockStatement())return C7(f.get("body"),G);else if(f.isFunction())return L1(f.get("body"),G);else if(f.isTryStatement())X=N1(f.get("block"),X,G),X=N1(f.get("handler"),X,G);else if(f.isCatchClause())return N1(f.get("body"),X,G);else if(f.isSwitchStatement())return j5f(f.get("cases"),X,G);else if(f.isSwitchCase())return C7(f.get("consequent"),{canHaveBreak:!0,shouldPopulateBreak:!1,inCaseClause:!0});else if(f.isBreakStatement())X.push(A5f(f));else X.push(q5f(f));return X}function D5f(){return L1(this,{canHaveBreak:!1,shouldPopulateBreak:!1,inCaseClause:!1}).map((G)=>G.path)}function I5f(f){return bJ.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:f}).setContext(this.context)}function T5f(){return this.getSibling(this.key-1)}function N5f(){return this.getSibling(this.key+1)}function L5f(){let f=this.key,G=this.getSibling(++f),X=[];while(G.node)X.push(G),G=this.getSibling(++f);return X}function b5f(){let f=this.key,G=this.getSibling(--f),X=[];while(G.node)X.push(G),G=this.getSibling(--f);return X}function E5f(f,G=!0){if(G===!0)G=this.context;let X=f.split(".");if(X.length===1)return A7.call(this,f,G);else return O7.call(this,X,G)}function A7(f,G){let X=this.node,W=X[f];if(Array.isArray(W))return W.map((R,J)=>{return bJ.default.get({listKey:f,parentPath:this,parent:X,container:W,key:J}).setContext(G)});else return bJ.default.get({parentPath:this,parent:X,container:X,key:f}).setContext(G)}function O7(f,G){let X=this;for(let W of f)if(W===".")X=X.parentPath;else if(Array.isArray(X))X=X[W];else X=X.get(W,G);return X}function w5f(){return S5f(this.node)}function k5f(f){return q7(this.node,f)}function v5f(f){return F5f(this.node,f)}function g5f(f=!1,G=!1){let W=[this],R=Object.create(null);while(W.length){let J=W.shift();if(!J)continue;if(!J.node)continue;let U=q7.keys[J.node.type];if(J.isIdentifier()){if(f)(R[J.node.name]=R[J.node.name]||[]).push(J);else R[J.node.name]=J;continue}if(J.isExportDeclaration()){let V=J.get("declaration");if(V.isDeclaration())W.push(V);continue}if(G){if(J.isFunctionDeclaration()){W.push(J.get("id"));continue}if(J.isFunctionExpression())continue}if(U)for(let V=0;V<U.length;V++){let H=U[V],Q=J.get(H);if(Array.isArray(Q))W.push(...Q);else if(Q.node)W.push(Q)}}return R}function _5f(f=!1){return this.getBindingIdentifierPaths(f,!0)}});var T7=P((I7)=>{Object.defineProperty(I7,"__esModule",{value:!0});I7.addComment=XZf;I7.addComments=WZf;I7.shareCommentsWithSiblings=GZf;var o5f=Vf(),{addComment:e5f,addComments:fZf}=o5f;function GZf(){if(typeof this.key==="string")return;let f=this.node;if(!f)return;let{trailingComments:G,leadingComments:X}=f;if(!G&&!X)return;let W=this.getSibling(this.key-1),R=this.getSibling(this.key+1),J=Boolean(W.node),U=Boolean(R.node);if(J){if(X)W.addComments("trailing",D7(X,W.node.trailingComments));if(G&&!U)W.addComments("trailing",G)}if(U){if(G)R.addComments("leading",D7(G,R.node.leadingComments));if(X&&!J)R.addComments("leading",X)}}function D7(f,G){if(!(G!=null&&G.length))return f;let X=new Set(G);return f.filter((W)=>{return!X.has(W)})}function XZf(f,G,X){e5f(this.node,f,G,X)}function WZf(f,G){fZf(this.node,f,G)}});var lG=P((w7)=>{Object.defineProperty(w7,"__esModule",{value:!0});w7.default=w7.SHOULD_STOP=w7.SHOULD_SKIP=w7.REMOVED=void 0;var VZf=hR(),HZf=q8(),QZf=ZX(),ZZf=tR(),b7=Vf(),wW=b7,YZf=X1(),zZf=KR(),$G=M4(),b1=u4(),E1=VJ(),N7=kQ(),Q1=Y7(),Lf=$7(),E7=KG(),Nf=E7,w1=DW(),CG=IW(),lf=P7(),wJ=T7(),BZf=aR(),{validate:MZf}=b7,L7=HZf("babel"),qFf=w7.REMOVED=1,AFf=w7.SHOULD_STOP=2,OFf=w7.SHOULD_SKIP=4,bG=w7.default=class f{constructor(G,X){this.contexts=[],this.state=null,this.opts=null,this._traverseFlags=0,this.skipKeys=null,this.parentPath=null,this.container=null,this.listKey=null,this.key=null,this.node=null,this.type=null,this.parent=X,this.hub=G,this.data=null,this.context=null,this.scope=null}get removed(){return(this._traverseFlags&1)>0}set removed(G){if(G)this._traverseFlags|=1;else this._traverseFlags&=-2}get shouldStop(){return(this._traverseFlags&2)>0}set shouldStop(G){if(G)this._traverseFlags|=2;else this._traverseFlags&=-3}get shouldSkip(){return(this._traverseFlags&4)>0}set shouldSkip(G){if(G)this._traverseFlags|=4;else this._traverseFlags&=-5}static get({hub:G,parentPath:X,parent:W,container:R,listKey:J,key:U}){if(!G&&X)G=X.hub;if(!W)throw new Error("To get a node path the parent needs to exist");let V=R[U],H=YZf.getOrCreateCachedPaths(G,W),Q=H.get(V);if(!Q){if(Q=new f(G,W),V)H.set(V,Q)}return E7.setup.call(Q,X,R,J,U),Q}getScope(G){return this.isScope()?new ZZf.default(this):G}setData(G,X){if(this.data==null)this.data=Object.create(null);return this.data[G]=X}getData(G,X){if(this.data==null)this.data=Object.create(null);let W=this.data[G];if(W===void 0&&X!==void 0)W=this.data[G]=X;return W}hasNode(){return this.node!=null}buildCodeFrameError(G,X=SyntaxError){return this.hub.buildError(this.node,G,X)}traverse(G,X){QZf.default(this.node,G,this.scope,X,this)}set(G,X){MZf(this.node,G,X),this.node[G]=X}getPathLocation(){let G=[],X=this;do{let W=X.key;if(X.inList)W=`${X.listKey}[${W}]`;G.unshift(W)}while(X=X.parentPath);return G.join(".")}debug(G){if(!L7.enabled)return;L7(`${this.getPathLocation()} ${this.type}: ${G}`)}toString(){return zZf.default(this.node).code}get inList(){return!!this.listKey}set inList(G){if(!G)this.listKey=null}get parentKey(){return this.listKey||this.key}},KZf={findParent:$G.findParent,find:$G.find,getFunctionParent:$G.getFunctionParent,getStatementParent:$G.getStatementParent,getEarliestCommonAncestorFrom:$G.getEarliestCommonAncestorFrom,getDeepestCommonAncestorFrom:$G.getDeepestCommonAncestorFrom,getAncestry:$G.getAncestry,isAncestor:$G.isAncestor,isDescendant:$G.isDescendant,inType:$G.inType,getTypeAnnotation:b1.getTypeAnnotation,isBaseType:b1.isBaseType,couldBeBaseType:b1.couldBeBaseType,baseTypeStrictlyMatches:b1.baseTypeStrictlyMatches,isGenericType:b1.isGenericType,replaceWithMultiple:E1.replaceWithMultiple,replaceWithSourceString:E1.replaceWithSourceString,replaceWith:E1.replaceWith,replaceExpressionWithStatements:E1.replaceExpressionWithStatements,replaceInline:E1.replaceInline,evaluateTruthy:N7.evaluateTruthy,evaluate:N7.evaluate,toComputedKey:Q1.toComputedKey,ensureBlock:Q1.ensureBlock,unwrapFunctionEnvironment:Q1.unwrapFunctionEnvironment,arrowFunctionToExpression:Q1.arrowFunctionToExpression,splitExportDeclaration:Q1.splitExportDeclaration,ensureFunctionName:Q1.ensureFunctionName,matchesPattern:Lf.matchesPattern,isStatic:Lf.isStatic,isNodeType:Lf.isNodeType,canHaveVariableDeclarationOrExpression:Lf.canHaveVariableDeclarationOrExpression,canSwapBetweenExpressionAndStatement:Lf.canSwapBetweenExpressionAndStatement,isCompletionRecord:Lf.isCompletionRecord,isStatementOrBlock:Lf.isStatementOrBlock,referencesImport:Lf.referencesImport,getSource:Lf.getSource,willIMaybeExecuteBefore:Lf.willIMaybeExecuteBefore,_guessExecutionStatusRelativeTo:Lf._guessExecutionStatusRelativeTo,resolve:Lf.resolve,isConstantExpression:Lf.isConstantExpression,isInStrictMode:Lf.isInStrictMode,isDenylisted:Nf.isDenylisted,visit:Nf.visit,skip:Nf.skip,skipKey:Nf.skipKey,stop:Nf.stop,setContext:Nf.setContext,requeue:Nf.requeue,requeueComputedKeyAndDecorators:Nf.requeueComputedKeyAndDecorators,remove:w1.remove,insertBefore:CG.insertBefore,insertAfter:CG.insertAfter,unshiftContainer:CG.unshiftContainer,pushContainer:CG.pushContainer,getOpposite:lf.getOpposite,getCompletionRecords:lf.getCompletionRecords,getSibling:lf.getSibling,getPrevSibling:lf.getPrevSibling,getNextSibling:lf.getNextSibling,getAllNextSiblings:lf.getAllNextSiblings,getAllPrevSiblings:lf.getAllPrevSiblings,get:lf.get,getAssignmentIdentifiers:lf.getAssignmentIdentifiers,getBindingIdentifiers:lf.getBindingIdentifiers,getOuterBindingIdentifiers:lf.getOuterBindingIdentifiers,getBindingIdentifierPaths:lf.getBindingIdentifierPaths,getOuterBindingIdentifierPaths:lf.getOuterBindingIdentifierPaths,shareCommentsWithSiblings:wJ.shareCommentsWithSiblings,addComment:wJ.addComment,addComments:wJ.addComments};Object.assign(bG.prototype,KZf);bG.prototype.arrowFunctionToShadowed=Q1[String("arrowFunctionToShadowed")],Object.assign(bG.prototype,{has:Lf[String("has")],is:Lf[String("is")],isnt:Lf[String("isnt")],equals:Lf[String("equals")],hoist:CG[String("hoist")],updateSiblingKeys:CG.updateSiblingKeys,call:Nf.call,isBlacklisted:Nf[String("isBlacklisted")],setScope:Nf.setScope,resync:Nf.resync,popContext:Nf.popContext,pushContext:Nf.pushContext,setup:Nf.setup,setKey:Nf.setKey});bG.prototype._guessExecutionStatusRelativeToDifferentFunctions=Lf._guessExecutionStatusRelativeTo,bG.prototype._guessExecutionStatusRelativeToDifferentFunctions=Lf._guessExecutionStatusRelativeTo,Object.assign(bG.prototype,{_getTypeAnnotation:b1._getTypeAnnotation,_replaceWith:E1._replaceWith,_resolve:Lf._resolve,_call:Nf._call,_resyncParent:Nf._resyncParent,_resyncKey:Nf._resyncKey,_resyncList:Nf._resyncList,_resyncRemoved:Nf._resyncRemoved,_getQueueContexts:Nf._getQueueContexts,_removeFromScope:w1._removeFromScope,_callRemovalHooks:w1._callRemovalHooks,_remove:w1._remove,_markRemoved:w1._markRemoved,_assertUnremoved:w1._assertUnremoved,_containerInsert:CG._containerInsert,_containerInsertBefore:CG._containerInsertBefore,_containerInsertAfter:CG._containerInsertAfter,_verifyNodeList:CG._verifyNodeList,_getKey:lf._getKey,_getPattern:lf._getPattern});for(let f of wW.TYPES){let G=`is${f}`,X=wW[G];bG.prototype[G]=function(W){return X(this.node,W)},bG.prototype[`assert${f}`]=function(W){if(!X(this.node,W))throw new TypeError(`Expected node path of type ${f}`)}}Object.assign(bG.prototype,BZf);for(let f of Object.keys(VZf)){if(f[0]==="_")continue;if(!wW.TYPES.includes(f))wW.TYPES.push(f)}});var u7=P((g7)=>{Object.defineProperty(g7,"__esModule",{value:!0});g7.default=void 0;var CZf=lG(),qZf=Vf(),kJ=KG(),{VISITOR_KEYS:AZf}=qZf;class v7{constructor(f,G,X,W){this.queue=null,this.priorityQueue=null,this.parentPath=W,this.scope=f,this.state=X,this.opts=G}shouldVisit(f){let G=this.opts;if(G.enter||G.exit)return!0;if(G[f.type])return!0;let X=AZf[f.type];if(!(X!=null&&X.length))return!1;for(let W of X)if(f[W])return!0;return!1}create(f,G,X,W){return CZf.default.get({parentPath:this.parentPath,parent:f,container:G,key:X,listKey:W})}maybeQueue(f,G){if(this.queue)if(G)this.queue.push(f);else this.priorityQueue.push(f)}visitMultiple(f,G,X){if(f.length===0)return!1;let W=[];for(let R=0;R<f.length;R++){let J=f[R];if(J&&this.shouldVisit(J))W.push(this.create(G,f,R,X))}return this.visitQueue(W)}visitSingle(f,G){if(this.shouldVisit(f[G]))return this.visitQueue([this.create(f,f,G)]);else return!1}visitQueue(f){this.queue=f,this.priorityQueue=[];let G=new WeakSet,X=!1,W=0;for(;W<f.length;){let R=f[W];if(W++,kJ.resync.call(R),R.contexts.length===0||R.contexts[R.contexts.length-1]!==this)kJ.pushContext.call(R,this);if(R.key===null)continue;let{node:J}=R;if(G.has(J))continue;if(J)G.add(J);if(R.visit()){X=!0;break}if(this.priorityQueue.length){if(X=this.visitQueue(this.priorityQueue),this.priorityQueue=[],this.queue=f,X)break}}for(let R=0;R<W;R++)kJ.popContext.call(f[R]);return this.queue=null,X}visit(f,G){let X=f[G];if(!X)return!1;if(Array.isArray(X))return this.visitMultiple(X,f,G);else return this.visitSingle(f,G)}}g7.default=v7});var FW=P((h7)=>{Object.defineProperty(h7,"__esModule",{value:!0});h7.traverseNode=DZf;var OZf=u7(),jZf=Vf(),{VISITOR_KEYS:PZf}=jZf;function DZf(f,G,X,W,R,J,U){let V=PZf[f.type];if(!V)return!1;let H=new OZf.default(X,G,W,R);if(U){if(J!=null&&J[R.parentKey])return!1;return H.visitQueue([R])}for(let Q of V){if(J!=null&&J[Q])continue;if(H.visit(f,Q))return!0}return!1}});var KG=P((r7)=>{Object.defineProperty(r7,"__esModule",{value:!0});r7._call=gJ;r7._getQueueContexts=lZf;r7._resyncKey=a7;r7._resyncList=i7;r7._resyncParent=c7;r7._resyncRemoved=_Zf;r7.call=vJ;r7.isDenylisted=m7;r7.popContext=uZf;r7.pushContext=hZf;r7.requeue=xZf;r7.requeueComputedKeyAndDecorators=mZf;r7.resync=gZf;r7.setContext=vZf;r7.setKey=kW;r7.setScope=l7;r7.setup=yZf;r7.skip=EZf;r7.skipKey=wZf;r7.stop=kZf;r7.visit=bZf;var TZf=FW(),y7=lG(),NZf=DW(),LZf=Vf();function vJ(f){let G=this.opts;if(this.debug(f),this.node){if(gJ.call(this,G[f]))return!0}if(this.node){var X;return gJ.call(this,(X=G[this.node.type])==null?void 0:X[f])}return!1}function gJ(f){if(!f)return!1;for(let G of f){if(!G)continue;let X=this.node;if(!X)return!0;let W=G.call(this.state,this,this.state);if(W&&typeof W==="object"&&typeof W.then==="function")throw new Error("You appear to be using a plugin with an async traversal visitor, which your current version of Babel does not support. If you're using a published plugin, you may need to upgrade your @babel/core version.");if(W)throw new Error(`Unexpected return value from visitor method ${G}`);if(this.node!==X)return!0;if(this._traverseFlags>0)return!0}return!1}function m7(){var f;let G=(f=this.opts.denylist)!=null?f:this.opts.blacklist;return G==null?void 0:G.includes(this.node.type)}r7.isBlacklisted=m7;function x7(f,G){if(f.context!==G)f.context=G,f.state=G.state,f.opts=G.opts}function bZf(){var f,G;if(!this.node)return!1;if(this.isDenylisted())return!1;if((f=(G=this.opts).shouldSkip)!=null&&f.call(G,this))return!1;let X=this.context;if(this.shouldSkip||vJ.call(this,"enter"))return this.debug("Skip..."),this.shouldStop;return x7(this,X),this.debug("Recursing into..."),this.shouldStop=TZf.traverseNode(this.node,this.opts,this.scope,this.state,this,this.skipKeys),x7(this,X),vJ.call(this,"exit"),this.shouldStop}function EZf(){this.shouldSkip=!0}function wZf(f){if(this.skipKeys==null)this.skipKeys={};this.skipKeys[f]=!0}function kZf(){this._traverseFlags|=y7.SHOULD_SKIP|y7.SHOULD_STOP}function l7(){var f,G;if((f=this.opts)!=null&&f.noScope)return;let X=this.parentPath;if((this.key==="key"||this.listKey==="decorators")&&X.isMethod()||this.key==="discriminant"&&X.isSwitchStatement())X=X.parentPath;let W;while(X&&!W){var R;if((R=X.opts)!=null&&R.noScope)return;W=X.scope,X=X.parentPath}this.scope=this.getScope(W),(G=this.scope)==null||G.init()}function vZf(f){if(this.skipKeys!=null)this.skipKeys={};if(this._traverseFlags=0,f)this.context=f,this.state=f.state,this.opts=f.opts;return l7.call(this),this}function gZf(){if(this.removed)return;c7.call(this),i7.call(this),a7.call(this)}function c7(){if(this.parentPath)this.parent=this.parentPath.node}function a7(){if(!this.container)return;if(this.node===this.container[this.key])return;if(Array.isArray(this.container)){for(let f=0;f<this.container.length;f++)if(this.container[f]===this.node){kW.call(this,f);return}}else for(let f of Object.keys(this.container))if(this.container[f]===this.node){kW.call(this,f);return}this.key=null}function i7(){if(!this.parent||!this.inList)return;let f=this.parent[this.listKey];if(this.container===f)return;this.container=f||null}function _Zf(){if(this.key==null||!this.container||this.container[this.key]!==this.node)NZf._markRemoved.call(this)}function uZf(){if(this.contexts.pop(),this.contexts.length>0)this.setContext(this.contexts[this.contexts.length-1]);else this.setContext(void 0)}function hZf(f){this.contexts.push(f),this.setContext(f)}function yZf(f,G,X,W){this.listKey=X,this.container=G,this.parentPath=f||this.parentPath,kW.call(this,W)}function kW(f){var G;this.key=f,this.node=this.container[this.key],this.type=(G=this.node)==null?void 0:G.type}function xZf(f=this){if(f.removed)return;let G=this.contexts;for(let X of G)X.maybeQueue(f)}function mZf(){let{context:f,node:G}=this;if(!LZf.isPrivate(G)&&G.computed)f.maybeQueue(this.get("key"));if(G.decorators)for(let X of this.get("decorators"))f.maybeQueue(X)}function lZf(){let f=this,G=this.contexts;while(!G.length){if(f=f.parentPath,!f)break;G=f.contexts}return G}});var t7=P((p7)=>{Object.defineProperty(p7,"__esModule",{value:!0});p7.default=void 0;class s7{getCode(){}getScope(){}addHelper(){throw new Error("Helpers are not supported by the default hub.")}buildError(f,G,X=TypeError){return new X(G)}}p7.default=s7});var ZX=P(($X)=>{Object.defineProperty($X,"__esModule",{value:!0});Object.defineProperty($X,"Hub",{enumerable:!0,get:function(){return MYf.default}});Object.defineProperty($X,"NodePath",{enumerable:!0,get:function(){return zYf.default}});Object.defineProperty($X,"Scope",{enumerable:!0,get:function(){return BYf.default}});$X.visitors=$X.default=void 0;KG();var FX=QX();$X.visitors=FX;var ZYf=Vf(),YYf=X1(),n7=FW(),zYf=lG(),BYf=tR(),MYf=t7(),{VISITOR_KEYS:KYf,removeProperties:SYf,traverseFast:o7}=ZYf;function RG(f,G={},X,W,R,J){if(!f)return;if(!G.noScope&&!X){if(f.type!=="Program"&&f.type!=="File")throw new Error(`You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a ${f.type} node without passing scope and parentPath.`)}if(!R&&J)throw new Error("visitSelf can only be used when providing a NodePath.");if(!KYf[f.type])return;FX.explode(G),n7.traverseNode(f,G,X,W,R,null,J)}var LFf=$X.default=RG;RG.visitors=FX;RG.verify=FX.verify;RG.explode=FX.explode;RG.cheap=function(f,G){o7(f,G);return};RG.node=function(f,G,X,W,R,J){n7.traverseNode(f,G,X,W,R,J)};RG.clearNode=function(f,G){SYf(f,G)};RG.removeProperties=function(f,G){return o7(f,RG.clearNode,G),f};function FYf(f,G){if(f.node.type===G.type)G.has=!0,f.stop()}RG.hasType=function(f,G,X){if(X!=null&&X.includes(f.type))return!1;if(f.type===G)return!0;let W={has:!1,type:G};return RG(f,{noScope:!0,denylist:X,enter:FYf},null,W),W.has};RG.cache=YYf});import OYf from"process";import{bold as _J,dim as uJ,green as jYf,italic as f5,log as PYf}from"@stacksjs/cli";import{path as vW}from"@stacksjs/path";import{fs as DYf,glob as IYf}from"@stacksjs/storage";var CYf=yW(KR(),1),qYf=yW(QW(),1),AYf=yW(ZX(),1);async function _Ff(f){let X=Date.now()-f.startTime,W=f.pkgName??`@stacksjs/${vW.basename(f.dir)}`;if(!f.result.success)console.log(f.result.logs[0]),OYf.exit(1);let R=await IYf([vW.resolve(f.dir,"dist","**/*")],{absolute:!0});for(let J of R){let U=await DYf.stat(J),V;if(U.size<1048576)V=`${(U.size/1024).toFixed(2)}kb`;else V=`${(U.size/1024/1024).toFixed(2)}mb`;let H=vW.relative(f.dir,J).replace("dist/","");console.log(`${_J(uJ(`[${V}]`))} ${uJ("dist/")}${H}`)}console.log(`${_J(uJ(`[${X}ms]`))} Built ${f5(_J(jYf(W)))}`)}async function uFf(f){let G=f.pkgName??`@stacksjs/${vW.basename(f.dir)}`;if(f.styled===!1)console.log(`Building ${G}...`);else PYf.info(`Building ${f5(G)}...`);return{startTime:Date.now()}}var export_traverse=AYf.default;var export_parser=qYf.default;var export_generator=CYf.default;export{export_traverse as traverse,export_parser as parser,_Ff as outro,uFf as intro,export_generator as generator};
|
|
55
|
+
`;return this.replaceWith(Q)[0].get("arguments.0")}function q7f(f){let G=f.params.findIndex((X)=>nQf(X)||oQf(X));return G===-1?f.params.length:G}});var $7=P((F7)=>{Object.defineProperty(F7,"__esModule",{value:!0});F7._guessExecutionStatusRelativeTo=s7f;F7._resolve=S7;F7.canHaveVariableDeclarationOrExpression=y7f;F7.canSwapBetweenExpressionAndStatement=x7f;F7.getSource=a7f;F7.isCompletionRecord=m7f;F7.isConstantExpression=n7f;F7.isInStrictMode=o7f;F7.isNodeType=h7f;F7.isStatementOrBlock=l7f;F7.isStatic=u7f;F7.matchesPattern=_7f;F7.referencesImport=c7f;F7.resolve=t7f;F7.willIMaybeExecuteBefore=i7f;var T7f=Vf(),{STATEMENT_OR_BLOCK_KEYS:N7f,VISITOR_KEYS:L7f,isBlockStatement:K7,isExpression:b7f,isIdentifier:E7f,isLiteral:w7f,isStringLiteral:k7f,isType:v7f,matchesPattern:g7f}=T7f;function _7f(f,G){return g7f(this.node,f,G)}F7.has=function f(G){var X;let W=(X=this.node)==null?void 0:X[G];if(W&&Array.isArray(W))return!!W.length;else return!!W};function u7f(){return this.scope.isStatic(this.node)}F7.is=F7.has,F7.isnt=function f(G){return!this.has(G)},F7.equals=function f(G,X){return this.node[G]===X};function h7f(f){return v7f(this.type,f)}function y7f(){return(this.key==="init"||this.key==="left")&&this.parentPath.isFor()}function x7f(f){if(this.key!=="body"||!this.parentPath.isArrowFunctionExpression())return!1;if(this.isExpression())return K7(f);else if(this.isBlockStatement())return b7f(f);return!1}function m7f(f){let G=this,X=!0;do{let{type:W,container:R}=G;if(!X&&(G.isFunction()||W==="StaticBlock"))return!!f;if(X=!1,Array.isArray(R)&&G.key!==R.length-1)return!1}while((G=G.parentPath)&&!G.isProgram()&&!G.isDoExpression());return!0}function l7f(){if(this.parentPath.isLabeledStatement()||K7(this.container))return!1;else return N7f.includes(this.key)}function c7f(f,G){if(!this.isReferencedIdentifier()){if(this.isJSXMemberExpression()&&this.node.property.name===G||(this.isMemberExpression()||this.isOptionalMemberExpression())&&(this.node.computed?k7f(this.node.property,{value:G}):this.node.property.name===G)){let J=this.get("object");return J.isReferencedIdentifier()&&J.referencesImport(f,"*")}return!1}let X=this.scope.getBinding(this.node.name);if(!X||X.kind!=="module")return!1;let W=X.path,R=W.parentPath;if(!R.isImportDeclaration())return!1;if(R.node.source.value===f){if(!G)return!0}else return!1;if(W.isImportDefaultSpecifier()&&G==="default")return!0;if(W.isImportNamespaceSpecifier()&&G==="*")return!0;if(W.isImportSpecifier()&&E7f(W.node.imported,{name:G}))return!0;return!1}function a7f(){let f=this.node;if(f.end){let G=this.hub.getCode();if(G)return G.slice(f.start,f.end)}return""}function i7f(f){return this._guessExecutionStatusRelativeTo(f)!=="after"}function z7(f){return f.isProgram()?f:(f.parentPath.scope.getFunctionParent()||f.parentPath.scope.getProgramParent()).path}function r7f(f,G){switch(f){case"LogicalExpression":return G==="right";case"ConditionalExpression":case"IfStatement":return G==="consequent"||G==="alternate";case"WhileStatement":case"DoWhileStatement":case"ForInStatement":case"ForOfStatement":return G==="body";case"ForStatement":return G==="body"||G==="update";case"SwitchStatement":return G==="cases";case"TryStatement":return G==="handler";case"AssignmentPattern":return G==="right";case"OptionalMemberExpression":return G==="property";case"OptionalCallExpression":return G==="arguments";default:return!1}}function B7(f,G){for(let X=0;X<G;X++){let W=f[X];if(r7f(W.parent.type,W.parentKey))return!0}return!1}var M7=Symbol();function s7f(f){return NJ(this,f,new Map)}function NJ(f,G,X){let W={this:z7(f),target:z7(G)};if(W.target.node!==W.this.node)return d7f(f,W.target,X);let R={target:G.getAncestry(),this:f.getAncestry()};if(R.target.includes(f))return"after";if(R.this.includes(G))return"before";let J,U={target:0,this:0};while(!J&&U.this<R.this.length){let Y=R.this[U.this];if(U.target=R.target.indexOf(Y),U.target>=0)J=Y;else U.this++}if(!J)throw new Error("Internal Babel error - The two compared nodes don't appear to belong to the same program.");if(B7(R.this,U.this-1)||B7(R.target,U.target-1))return"unknown";let V={this:R.this[U.this-1],target:R.target[U.target-1]};if(V.target.listKey&&V.this.listKey&&V.target.container===V.this.container)return V.target.key>V.this.key?"before":"after";let H=L7f[J.type],Q={this:H.indexOf(V.this.parentKey),target:H.indexOf(V.target.parentKey)};return Q.target>Q.this?"before":"after"}function p7f(f,G,X){if(!G.isFunctionDeclaration()){if(NJ(f,G,X)==="before")return"before";return"unknown"}else if(G.parentPath.isExportDeclaration())return"unknown";let W=G.scope.getBinding(G.node.id.name);if(!W.references)return"before";let R=W.referencePaths,J;for(let U of R){if(!!U.find((Q)=>Q.node===G.node))continue;if(U.key!=="callee"||!U.parentPath.isCallExpression())return"unknown";let H=NJ(f,U,X);if(J&&J!==H)return"unknown";else J=H}return J}function d7f(f,G,X){let W=X.get(f.node),R;if(!W)X.set(f.node,W=new Map);else if(R=W.get(G.node)){if(R===M7)return"unknown";return R}W.set(G.node,M7);let J=p7f(f,G,X);return W.set(G.node,J),J}function t7f(f,G){return S7.call(this,f,G)||this}function S7(f,G){var X;if((X=G)!=null&&X.includes(this))return;if(G=G||[],G.push(this),this.isVariableDeclarator()){if(this.get("id").isIdentifier())return this.get("init").resolve(f,G)}else if(this.isReferencedIdentifier()){let W=this.scope.getBinding(this.node.name);if(!W)return;if(!W.constant)return;if(W.kind==="module")return;if(W.path!==this){let R=W.path.resolve(f,G);if(this.find((J)=>J.node===R.node))return;return R}}else if(this.isTypeCastExpression())return this.get("expression").resolve(f,G);else if(f&&this.isMemberExpression()){let W=this.toComputedKey();if(!w7f(W))return;let R=W.value,J=this.get("object").resolve(f,G);if(J.isObjectExpression()){let U=J.get("properties");for(let V of U){if(!V.isProperty())continue;let H=V.get("key"),Q=V.isnt("computed")&&H.isIdentifier({name:R});if(Q=Q||H.isLiteral({value:R}),Q)return V.get("value").resolve(f,G)}}else if(J.isArrayExpression()&&!isNaN(+R)){let V=J.get("elements")[R];if(V)return V.resolve(f,G)}}}function n7f(){if(this.isIdentifier()){let f=this.scope.getBinding(this.node.name);if(!f)return!1;return f.constant}if(this.isLiteral()){if(this.isRegExpLiteral())return!1;if(this.isTemplateLiteral())return this.get("expressions").every((f)=>f.isConstantExpression());return!0}if(this.isUnaryExpression()){if(this.node.operator!=="void")return!1;return this.get("argument").isConstantExpression()}if(this.isBinaryExpression()){let{operator:f}=this.node;return f!=="in"&&f!=="instanceof"&&this.get("left").isConstantExpression()&&this.get("right").isConstantExpression()}if(this.isMemberExpression())return!this.node.computed&&this.get("object").isIdentifier({name:"Symbol"})&&!this.scope.hasBinding("Symbol",{noGlobals:!0});if(this.isCallExpression())return this.node.arguments.length===1&&this.get("callee").matchesPattern("Symbol.for")&&!this.scope.hasBinding("Symbol",{noGlobals:!0})&&this.get("arguments")[0].isStringLiteral();return!1}function o7f(){return!!(this.isProgram()?this:this.parentPath).find((X)=>{if(X.isProgram({sourceType:"module"}))return!0;if(X.isClass())return!0;if(X.isArrowFunctionExpression()&&!X.get("body").isBlockStatement())return!1;let W;if(X.isFunction())W=X.node.body;else if(X.isProgram())W=X.node;else return!1;for(let R of W.directives)if(R.value.value==="use strict")return!0})}});var P7=P((j7)=>{Object.defineProperty(j7,"__esModule",{value:!0});j7._getKey=A7;j7._getPattern=O7;j7.get=E5f;j7.getAllNextSiblings=L5f;j7.getAllPrevSiblings=b5f;j7.getAssignmentIdentifiers=w5f;j7.getBindingIdentifierPaths=g5f;j7.getBindingIdentifiers=k5f;j7.getCompletionRecords=D5f;j7.getNextSibling=N5f;j7.getOpposite=O5f;j7.getOuterBindingIdentifierPaths=_5f;j7.getOuterBindingIdentifiers=v5f;j7.getPrevSibling=T5f;j7.getSibling=I5f;var bJ=lG(),K5f=Vf(),{getAssignmentIdentifiers:S5f,getBindingIdentifiers:q7,getOuterBindingIdentifiers:F5f,numericLiteral:$5f,unaryExpression:C5f}=K5f,EJ=0,SX=1;function q5f(f){return{type:EJ,path:f}}function A5f(f){return{type:SX,path:f}}function O5f(){if(this.key==="left")return this.getSibling("right");else if(this.key==="right")return this.getSibling("left");return null}function N1(f,G,X){if(f)G.push(...L1(f,X));return G}function j5f(f,G,X){let W=[];for(let R=0;R<f.length;R++){let J=f[R],U=L1(J,X),V=[],H=[];for(let Q of U){if(Q.type===EJ)V.push(Q);if(Q.type===SX)H.push(Q)}if(V.length)W=V;G.push(...H)}return G.push(...W),G}function P5f(f){f.forEach((G)=>{G.type=SX})}function LJ(f,G){f.forEach((X)=>{if(X.path.isBreakStatement({label:null}))if(G)X.path.replaceWith(C5f("void",$5f(0)));else X.path.remove()})}function C7(f,G){let X=[];if(G.canHaveBreak){let W=[];for(let R=0;R<f.length;R++){let J=f[R],U=Object.assign({},G,{inCaseClause:!1});if(J.isBlockStatement()&&(G.inCaseClause||G.shouldPopulateBreak))U.shouldPopulateBreak=!0;else U.shouldPopulateBreak=!1;let V=L1(J,U);if(V.length>0&&V.every((H)=>H.type===SX)){if(W.length>0&&V.every((H)=>H.path.isBreakStatement({label:null}))){if(P5f(W),X.push(...W),W.some((H)=>H.path.isDeclaration()))X.push(...V),LJ(V,!0);LJ(V,!1)}else if(X.push(...V),!G.shouldPopulateBreak)LJ(V,!0);break}if(R===f.length-1)X.push(...V);else{W=[];for(let H=0;H<V.length;H++){let Q=V[H];if(Q.type===SX)X.push(Q);if(Q.type===EJ)W.push(Q)}}}}else if(f.length)for(let W=f.length-1;W>=0;W--){let R=L1(f[W],G);if(R.length>1||R.length===1&&!R[0].path.isVariableDeclaration()){X.push(...R);break}}return X}function L1(f,G){let X=[];if(f.isIfStatement())X=N1(f.get("consequent"),X,G),X=N1(f.get("alternate"),X,G);else if(f.isDoExpression()||f.isFor()||f.isWhile()||f.isLabeledStatement())return N1(f.get("body"),X,G);else if(f.isProgram()||f.isBlockStatement())return C7(f.get("body"),G);else if(f.isFunction())return L1(f.get("body"),G);else if(f.isTryStatement())X=N1(f.get("block"),X,G),X=N1(f.get("handler"),X,G);else if(f.isCatchClause())return N1(f.get("body"),X,G);else if(f.isSwitchStatement())return j5f(f.get("cases"),X,G);else if(f.isSwitchCase())return C7(f.get("consequent"),{canHaveBreak:!0,shouldPopulateBreak:!1,inCaseClause:!0});else if(f.isBreakStatement())X.push(A5f(f));else X.push(q5f(f));return X}function D5f(){return L1(this,{canHaveBreak:!1,shouldPopulateBreak:!1,inCaseClause:!1}).map((G)=>G.path)}function I5f(f){return bJ.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:f}).setContext(this.context)}function T5f(){return this.getSibling(this.key-1)}function N5f(){return this.getSibling(this.key+1)}function L5f(){let f=this.key,G=this.getSibling(++f),X=[];while(G.node)X.push(G),G=this.getSibling(++f);return X}function b5f(){let f=this.key,G=this.getSibling(--f),X=[];while(G.node)X.push(G),G=this.getSibling(--f);return X}function E5f(f,G=!0){if(G===!0)G=this.context;let X=f.split(".");if(X.length===1)return A7.call(this,f,G);else return O7.call(this,X,G)}function A7(f,G){let X=this.node,W=X[f];if(Array.isArray(W))return W.map((R,J)=>{return bJ.default.get({listKey:f,parentPath:this,parent:X,container:W,key:J}).setContext(G)});else return bJ.default.get({parentPath:this,parent:X,container:X,key:f}).setContext(G)}function O7(f,G){let X=this;for(let W of f)if(W===".")X=X.parentPath;else if(Array.isArray(X))X=X[W];else X=X.get(W,G);return X}function w5f(){return S5f(this.node)}function k5f(f){return q7(this.node,f)}function v5f(f){return F5f(this.node,f)}function g5f(f=!1,G=!1){let W=[this],R=Object.create(null);while(W.length){let J=W.shift();if(!J)continue;if(!J.node)continue;let U=q7.keys[J.node.type];if(J.isIdentifier()){if(f)(R[J.node.name]=R[J.node.name]||[]).push(J);else R[J.node.name]=J;continue}if(J.isExportDeclaration()){let V=J.get("declaration");if(V.isDeclaration())W.push(V);continue}if(G){if(J.isFunctionDeclaration()){W.push(J.get("id"));continue}if(J.isFunctionExpression())continue}if(U)for(let V=0;V<U.length;V++){let H=U[V],Q=J.get(H);if(Array.isArray(Q))W.push(...Q);else if(Q.node)W.push(Q)}}return R}function _5f(f=!1){return this.getBindingIdentifierPaths(f,!0)}});var T7=P((I7)=>{Object.defineProperty(I7,"__esModule",{value:!0});I7.addComment=XZf;I7.addComments=WZf;I7.shareCommentsWithSiblings=GZf;var o5f=Vf(),{addComment:e5f,addComments:fZf}=o5f;function GZf(){if(typeof this.key==="string")return;let f=this.node;if(!f)return;let{trailingComments:G,leadingComments:X}=f;if(!G&&!X)return;let W=this.getSibling(this.key-1),R=this.getSibling(this.key+1),J=Boolean(W.node),U=Boolean(R.node);if(J){if(X)W.addComments("trailing",D7(X,W.node.trailingComments));if(G&&!U)W.addComments("trailing",G)}if(U){if(G)R.addComments("leading",D7(G,R.node.leadingComments));if(X&&!J)R.addComments("leading",X)}}function D7(f,G){if(!(G!=null&&G.length))return f;let X=new Set(G);return f.filter((W)=>{return!X.has(W)})}function XZf(f,G,X){e5f(this.node,f,G,X)}function WZf(f,G){fZf(this.node,f,G)}});var lG=P((w7)=>{Object.defineProperty(w7,"__esModule",{value:!0});w7.default=w7.SHOULD_STOP=w7.SHOULD_SKIP=w7.REMOVED=void 0;var VZf=hR(),HZf=q8(),QZf=ZX(),ZZf=tR(),b7=Vf(),wW=b7,YZf=X1(),zZf=KR(),$G=M4(),b1=u4(),E1=VJ(),N7=kQ(),Q1=Y7(),Lf=$7(),E7=KG(),Nf=E7,w1=DW(),CG=IW(),lf=P7(),wJ=T7(),BZf=aR(),{validate:MZf}=b7,L7=HZf("babel"),qFf=w7.REMOVED=1,AFf=w7.SHOULD_STOP=2,OFf=w7.SHOULD_SKIP=4,bG=w7.default=class f{constructor(G,X){this.contexts=[],this.state=null,this.opts=null,this._traverseFlags=0,this.skipKeys=null,this.parentPath=null,this.container=null,this.listKey=null,this.key=null,this.node=null,this.type=null,this.parent=X,this.hub=G,this.data=null,this.context=null,this.scope=null}get removed(){return(this._traverseFlags&1)>0}set removed(G){if(G)this._traverseFlags|=1;else this._traverseFlags&=-2}get shouldStop(){return(this._traverseFlags&2)>0}set shouldStop(G){if(G)this._traverseFlags|=2;else this._traverseFlags&=-3}get shouldSkip(){return(this._traverseFlags&4)>0}set shouldSkip(G){if(G)this._traverseFlags|=4;else this._traverseFlags&=-5}static get({hub:G,parentPath:X,parent:W,container:R,listKey:J,key:U}){if(!G&&X)G=X.hub;if(!W)throw new Error("To get a node path the parent needs to exist");let V=R[U],H=YZf.getOrCreateCachedPaths(G,W),Q=H.get(V);if(!Q){if(Q=new f(G,W),V)H.set(V,Q)}return E7.setup.call(Q,X,R,J,U),Q}getScope(G){return this.isScope()?new ZZf.default(this):G}setData(G,X){if(this.data==null)this.data=Object.create(null);return this.data[G]=X}getData(G,X){if(this.data==null)this.data=Object.create(null);let W=this.data[G];if(W===void 0&&X!==void 0)W=this.data[G]=X;return W}hasNode(){return this.node!=null}buildCodeFrameError(G,X=SyntaxError){return this.hub.buildError(this.node,G,X)}traverse(G,X){QZf.default(this.node,G,this.scope,X,this)}set(G,X){MZf(this.node,G,X),this.node[G]=X}getPathLocation(){let G=[],X=this;do{let W=X.key;if(X.inList)W=`${X.listKey}[${W}]`;G.unshift(W)}while(X=X.parentPath);return G.join(".")}debug(G){if(!L7.enabled)return;L7(`${this.getPathLocation()} ${this.type}: ${G}`)}toString(){return zZf.default(this.node).code}get inList(){return!!this.listKey}set inList(G){if(!G)this.listKey=null}get parentKey(){return this.listKey||this.key}},KZf={findParent:$G.findParent,find:$G.find,getFunctionParent:$G.getFunctionParent,getStatementParent:$G.getStatementParent,getEarliestCommonAncestorFrom:$G.getEarliestCommonAncestorFrom,getDeepestCommonAncestorFrom:$G.getDeepestCommonAncestorFrom,getAncestry:$G.getAncestry,isAncestor:$G.isAncestor,isDescendant:$G.isDescendant,inType:$G.inType,getTypeAnnotation:b1.getTypeAnnotation,isBaseType:b1.isBaseType,couldBeBaseType:b1.couldBeBaseType,baseTypeStrictlyMatches:b1.baseTypeStrictlyMatches,isGenericType:b1.isGenericType,replaceWithMultiple:E1.replaceWithMultiple,replaceWithSourceString:E1.replaceWithSourceString,replaceWith:E1.replaceWith,replaceExpressionWithStatements:E1.replaceExpressionWithStatements,replaceInline:E1.replaceInline,evaluateTruthy:N7.evaluateTruthy,evaluate:N7.evaluate,toComputedKey:Q1.toComputedKey,ensureBlock:Q1.ensureBlock,unwrapFunctionEnvironment:Q1.unwrapFunctionEnvironment,arrowFunctionToExpression:Q1.arrowFunctionToExpression,splitExportDeclaration:Q1.splitExportDeclaration,ensureFunctionName:Q1.ensureFunctionName,matchesPattern:Lf.matchesPattern,isStatic:Lf.isStatic,isNodeType:Lf.isNodeType,canHaveVariableDeclarationOrExpression:Lf.canHaveVariableDeclarationOrExpression,canSwapBetweenExpressionAndStatement:Lf.canSwapBetweenExpressionAndStatement,isCompletionRecord:Lf.isCompletionRecord,isStatementOrBlock:Lf.isStatementOrBlock,referencesImport:Lf.referencesImport,getSource:Lf.getSource,willIMaybeExecuteBefore:Lf.willIMaybeExecuteBefore,_guessExecutionStatusRelativeTo:Lf._guessExecutionStatusRelativeTo,resolve:Lf.resolve,isConstantExpression:Lf.isConstantExpression,isInStrictMode:Lf.isInStrictMode,isDenylisted:Nf.isDenylisted,visit:Nf.visit,skip:Nf.skip,skipKey:Nf.skipKey,stop:Nf.stop,setContext:Nf.setContext,requeue:Nf.requeue,requeueComputedKeyAndDecorators:Nf.requeueComputedKeyAndDecorators,remove:w1.remove,insertBefore:CG.insertBefore,insertAfter:CG.insertAfter,unshiftContainer:CG.unshiftContainer,pushContainer:CG.pushContainer,getOpposite:lf.getOpposite,getCompletionRecords:lf.getCompletionRecords,getSibling:lf.getSibling,getPrevSibling:lf.getPrevSibling,getNextSibling:lf.getNextSibling,getAllNextSiblings:lf.getAllNextSiblings,getAllPrevSiblings:lf.getAllPrevSiblings,get:lf.get,getAssignmentIdentifiers:lf.getAssignmentIdentifiers,getBindingIdentifiers:lf.getBindingIdentifiers,getOuterBindingIdentifiers:lf.getOuterBindingIdentifiers,getBindingIdentifierPaths:lf.getBindingIdentifierPaths,getOuterBindingIdentifierPaths:lf.getOuterBindingIdentifierPaths,shareCommentsWithSiblings:wJ.shareCommentsWithSiblings,addComment:wJ.addComment,addComments:wJ.addComments};Object.assign(bG.prototype,KZf);bG.prototype.arrowFunctionToShadowed=Q1[String("arrowFunctionToShadowed")],Object.assign(bG.prototype,{has:Lf[String("has")],is:Lf[String("is")],isnt:Lf[String("isnt")],equals:Lf[String("equals")],hoist:CG[String("hoist")],updateSiblingKeys:CG.updateSiblingKeys,call:Nf.call,isBlacklisted:Nf[String("isBlacklisted")],setScope:Nf.setScope,resync:Nf.resync,popContext:Nf.popContext,pushContext:Nf.pushContext,setup:Nf.setup,setKey:Nf.setKey});bG.prototype._guessExecutionStatusRelativeToDifferentFunctions=Lf._guessExecutionStatusRelativeTo,bG.prototype._guessExecutionStatusRelativeToDifferentFunctions=Lf._guessExecutionStatusRelativeTo,Object.assign(bG.prototype,{_getTypeAnnotation:b1._getTypeAnnotation,_replaceWith:E1._replaceWith,_resolve:Lf._resolve,_call:Nf._call,_resyncParent:Nf._resyncParent,_resyncKey:Nf._resyncKey,_resyncList:Nf._resyncList,_resyncRemoved:Nf._resyncRemoved,_getQueueContexts:Nf._getQueueContexts,_removeFromScope:w1._removeFromScope,_callRemovalHooks:w1._callRemovalHooks,_remove:w1._remove,_markRemoved:w1._markRemoved,_assertUnremoved:w1._assertUnremoved,_containerInsert:CG._containerInsert,_containerInsertBefore:CG._containerInsertBefore,_containerInsertAfter:CG._containerInsertAfter,_verifyNodeList:CG._verifyNodeList,_getKey:lf._getKey,_getPattern:lf._getPattern});for(let f of wW.TYPES){let G=`is${f}`,X=wW[G];bG.prototype[G]=function(W){return X(this.node,W)},bG.prototype[`assert${f}`]=function(W){if(!X(this.node,W))throw new TypeError(`Expected node path of type ${f}`)}}Object.assign(bG.prototype,BZf);for(let f of Object.keys(VZf)){if(f[0]==="_")continue;if(!wW.TYPES.includes(f))wW.TYPES.push(f)}});var u7=P((g7)=>{Object.defineProperty(g7,"__esModule",{value:!0});g7.default=void 0;var CZf=lG(),qZf=Vf(),kJ=KG(),{VISITOR_KEYS:AZf}=qZf;class v7{constructor(f,G,X,W){this.queue=null,this.priorityQueue=null,this.parentPath=W,this.scope=f,this.state=X,this.opts=G}shouldVisit(f){let G=this.opts;if(G.enter||G.exit)return!0;if(G[f.type])return!0;let X=AZf[f.type];if(!(X!=null&&X.length))return!1;for(let W of X)if(f[W])return!0;return!1}create(f,G,X,W){return CZf.default.get({parentPath:this.parentPath,parent:f,container:G,key:X,listKey:W})}maybeQueue(f,G){if(this.queue)if(G)this.queue.push(f);else this.priorityQueue.push(f)}visitMultiple(f,G,X){if(f.length===0)return!1;let W=[];for(let R=0;R<f.length;R++){let J=f[R];if(J&&this.shouldVisit(J))W.push(this.create(G,f,R,X))}return this.visitQueue(W)}visitSingle(f,G){if(this.shouldVisit(f[G]))return this.visitQueue([this.create(f,f,G)]);else return!1}visitQueue(f){this.queue=f,this.priorityQueue=[];let G=new WeakSet,X=!1,W=0;for(;W<f.length;){let R=f[W];if(W++,kJ.resync.call(R),R.contexts.length===0||R.contexts[R.contexts.length-1]!==this)kJ.pushContext.call(R,this);if(R.key===null)continue;let{node:J}=R;if(G.has(J))continue;if(J)G.add(J);if(R.visit()){X=!0;break}if(this.priorityQueue.length){if(X=this.visitQueue(this.priorityQueue),this.priorityQueue=[],this.queue=f,X)break}}for(let R=0;R<W;R++)kJ.popContext.call(f[R]);return this.queue=null,X}visit(f,G){let X=f[G];if(!X)return!1;if(Array.isArray(X))return this.visitMultiple(X,f,G);else return this.visitSingle(f,G)}}g7.default=v7});var FW=P((h7)=>{Object.defineProperty(h7,"__esModule",{value:!0});h7.traverseNode=DZf;var OZf=u7(),jZf=Vf(),{VISITOR_KEYS:PZf}=jZf;function DZf(f,G,X,W,R,J,U){let V=PZf[f.type];if(!V)return!1;let H=new OZf.default(X,G,W,R);if(U){if(J!=null&&J[R.parentKey])return!1;return H.visitQueue([R])}for(let Q of V){if(J!=null&&J[Q])continue;if(H.visit(f,Q))return!0}return!1}});var KG=P((r7)=>{Object.defineProperty(r7,"__esModule",{value:!0});r7._call=gJ;r7._getQueueContexts=lZf;r7._resyncKey=a7;r7._resyncList=i7;r7._resyncParent=c7;r7._resyncRemoved=_Zf;r7.call=vJ;r7.isDenylisted=m7;r7.popContext=uZf;r7.pushContext=hZf;r7.requeue=xZf;r7.requeueComputedKeyAndDecorators=mZf;r7.resync=gZf;r7.setContext=vZf;r7.setKey=kW;r7.setScope=l7;r7.setup=yZf;r7.skip=EZf;r7.skipKey=wZf;r7.stop=kZf;r7.visit=bZf;var TZf=FW(),y7=lG(),NZf=DW(),LZf=Vf();function vJ(f){let G=this.opts;if(this.debug(f),this.node){if(gJ.call(this,G[f]))return!0}if(this.node){var X;return gJ.call(this,(X=G[this.node.type])==null?void 0:X[f])}return!1}function gJ(f){if(!f)return!1;for(let G of f){if(!G)continue;let X=this.node;if(!X)return!0;let W=G.call(this.state,this,this.state);if(W&&typeof W==="object"&&typeof W.then==="function")throw new Error("You appear to be using a plugin with an async traversal visitor, which your current version of Babel does not support. If you're using a published plugin, you may need to upgrade your @babel/core version.");if(W)throw new Error(`Unexpected return value from visitor method ${G}`);if(this.node!==X)return!0;if(this._traverseFlags>0)return!0}return!1}function m7(){var f;let G=(f=this.opts.denylist)!=null?f:this.opts.blacklist;return G==null?void 0:G.includes(this.node.type)}r7.isBlacklisted=m7;function x7(f,G){if(f.context!==G)f.context=G,f.state=G.state,f.opts=G.opts}function bZf(){var f,G;if(!this.node)return!1;if(this.isDenylisted())return!1;if((f=(G=this.opts).shouldSkip)!=null&&f.call(G,this))return!1;let X=this.context;if(this.shouldSkip||vJ.call(this,"enter"))return this.debug("Skip..."),this.shouldStop;return x7(this,X),this.debug("Recursing into..."),this.shouldStop=TZf.traverseNode(this.node,this.opts,this.scope,this.state,this,this.skipKeys),x7(this,X),vJ.call(this,"exit"),this.shouldStop}function EZf(){this.shouldSkip=!0}function wZf(f){if(this.skipKeys==null)this.skipKeys={};this.skipKeys[f]=!0}function kZf(){this._traverseFlags|=y7.SHOULD_SKIP|y7.SHOULD_STOP}function l7(){var f,G;if((f=this.opts)!=null&&f.noScope)return;let X=this.parentPath;if((this.key==="key"||this.listKey==="decorators")&&X.isMethod()||this.key==="discriminant"&&X.isSwitchStatement())X=X.parentPath;let W;while(X&&!W){var R;if((R=X.opts)!=null&&R.noScope)return;W=X.scope,X=X.parentPath}this.scope=this.getScope(W),(G=this.scope)==null||G.init()}function vZf(f){if(this.skipKeys!=null)this.skipKeys={};if(this._traverseFlags=0,f)this.context=f,this.state=f.state,this.opts=f.opts;return l7.call(this),this}function gZf(){if(this.removed)return;c7.call(this),i7.call(this),a7.call(this)}function c7(){if(this.parentPath)this.parent=this.parentPath.node}function a7(){if(!this.container)return;if(this.node===this.container[this.key])return;if(Array.isArray(this.container)){for(let f=0;f<this.container.length;f++)if(this.container[f]===this.node){kW.call(this,f);return}}else for(let f of Object.keys(this.container))if(this.container[f]===this.node){kW.call(this,f);return}this.key=null}function i7(){if(!this.parent||!this.inList)return;let f=this.parent[this.listKey];if(this.container===f)return;this.container=f||null}function _Zf(){if(this.key==null||!this.container||this.container[this.key]!==this.node)NZf._markRemoved.call(this)}function uZf(){if(this.contexts.pop(),this.contexts.length>0)this.setContext(this.contexts[this.contexts.length-1]);else this.setContext(void 0)}function hZf(f){this.contexts.push(f),this.setContext(f)}function yZf(f,G,X,W){this.listKey=X,this.container=G,this.parentPath=f||this.parentPath,kW.call(this,W)}function kW(f){var G;this.key=f,this.node=this.container[this.key],this.type=(G=this.node)==null?void 0:G.type}function xZf(f=this){if(f.removed)return;let G=this.contexts;for(let X of G)X.maybeQueue(f)}function mZf(){let{context:f,node:G}=this;if(!LZf.isPrivate(G)&&G.computed)f.maybeQueue(this.get("key"));if(G.decorators)for(let X of this.get("decorators"))f.maybeQueue(X)}function lZf(){let f=this,G=this.contexts;while(!G.length){if(f=f.parentPath,!f)break;G=f.contexts}return G}});var t7=P((p7)=>{Object.defineProperty(p7,"__esModule",{value:!0});p7.default=void 0;class s7{getCode(){}getScope(){}addHelper(){throw new Error("Helpers are not supported by the default hub.")}buildError(f,G,X=TypeError){return new X(G)}}p7.default=s7});var ZX=P(($X)=>{Object.defineProperty($X,"__esModule",{value:!0});Object.defineProperty($X,"Hub",{enumerable:!0,get:function(){return MYf.default}});Object.defineProperty($X,"NodePath",{enumerable:!0,get:function(){return zYf.default}});Object.defineProperty($X,"Scope",{enumerable:!0,get:function(){return BYf.default}});$X.visitors=$X.default=void 0;KG();var FX=QX();$X.visitors=FX;var ZYf=Vf(),YYf=X1(),n7=FW(),zYf=lG(),BYf=tR(),MYf=t7(),{VISITOR_KEYS:KYf,removeProperties:SYf,traverseFast:o7}=ZYf;function RG(f,G={},X,W,R,J){if(!f)return;if(!G.noScope&&!X){if(f.type!=="Program"&&f.type!=="File")throw new Error(`You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a ${f.type} node without passing scope and parentPath.`)}if(!R&&J)throw new Error("visitSelf can only be used when providing a NodePath.");if(!KYf[f.type])return;FX.explode(G),n7.traverseNode(f,G,X,W,R,null,J)}var LFf=$X.default=RG;RG.visitors=FX;RG.verify=FX.verify;RG.explode=FX.explode;RG.cheap=function(f,G){o7(f,G);return};RG.node=function(f,G,X,W,R,J){n7.traverseNode(f,G,X,W,R,J)};RG.clearNode=function(f,G){SYf(f,G)};RG.removeProperties=function(f,G){return o7(f,RG.clearNode,G),f};function FYf(f,G){if(f.node.type===G.type)G.has=!0,f.stop()}RG.hasType=function(f,G,X){if(X!=null&&X.includes(f.type))return!1;if(f.type===G)return!0;let W={has:!1,type:G};return RG(f,{noScope:!0,denylist:X,enter:FYf},null,W),W.has};RG.cache=YYf});import OYf from"node:process";import{bold as _J,dim as uJ,green as jYf,italic as f5,log as PYf}from"@stacksjs/cli";import{path as vW}from"@stacksjs/path";import{fs as DYf,glob as IYf}from"@stacksjs/storage";var CYf=yW(KR(),1),qYf=yW(QW(),1),AYf=yW(ZX(),1);async function _Ff(f){let X=Date.now()-f.startTime,W=f.pkgName??`@stacksjs/${vW.basename(f.dir)}`;if(!f.result.success)console.log(f.result.logs[0]),OYf.exit(1);let R=await IYf([vW.resolve(f.dir,"dist","**/*")],{absolute:!0});for(let J of R){let U=await DYf.stat(J),V;if(U.size<1048576)V=`${(U.size/1024).toFixed(2)}kb`;else V=`${(U.size/1024/1024).toFixed(2)}mb`;let H=vW.relative(f.dir,J).replace("dist/","");console.log(`${_J(uJ(`[${V}]`))} ${uJ("dist/")}${H}`)}console.log(`${_J(uJ(`[${X}ms]`))} Built ${f5(_J(jYf(W)))}`)}async function uFf(f){let G=f.pkgName??`@stacksjs/${vW.basename(f.dir)}`;if(f.styled===!1)console.log(`Building ${G}...`);else PYf.info(`Building ${f5(G)}...`);return{startTime:Date.now()}}var export_traverse=AYf.default;var export_parser=qYf.default;var export_generator=CYf.default;export{export_traverse as traverse,export_parser as parser,_Ff as outro,uFf as intro,export_generator as generator};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/build",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.70.
|
|
4
|
+
"version": "0.70.12",
|
|
5
5
|
"description": "The Stacks framework build tools and configurations.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"prepublishOnly": "bun run build"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@stacksjs/cli": "0.70.
|
|
47
|
-
"@stacksjs/development": "0.70.
|
|
48
|
-
"@stacksjs/path": "0.70.
|
|
49
|
-
"@stacksjs/storage": "0.70.
|
|
46
|
+
"@stacksjs/cli": "0.70.11",
|
|
47
|
+
"@stacksjs/development": "0.70.11",
|
|
48
|
+
"@stacksjs/path": "0.70.11",
|
|
49
|
+
"@stacksjs/storage": "0.70.11",
|
|
50
50
|
"@types/babel__generator": "^7.6.8",
|
|
51
|
-
"@types/babel__traverse": "^7.20.
|
|
51
|
+
"@types/babel__traverse": "^7.20.7",
|
|
52
52
|
"bun-plugin-dtsx": "^0.21.9",
|
|
53
53
|
"vue-docgen-web-types": "^0.1.8"
|
|
54
54
|
}
|