webpackJsonp([13],{"/ZzT":function(e,t,s){"use strict";function i(e,t){if(null==e)return{};var s={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;s[i]=e[i]}return s}Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(e,t,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=t,this.index=s}}class a{constructor(e,t){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=t}}function n(e,t){const{line:s,column:i,index:a}=e;return new r(s,i+t,a+t)}const o="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";var l={ImportMetaOutsideModule:{message:"import.meta may appear only with 'sourceType: \"module\"'",code:o},ImportOutsideModule:{message:"'import' and 'export' may appear only with 'sourceType: \"module\"'",code:o}};const c={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},p=e=>"UpdateExpression"===e.type?c.UpdateExpression[`${e.prefix}`]:c[e.type];var h={AccessorIsGenerator:({kind:e})=>`A ${e}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:e})=>`Missing initializer in ${e} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:e})=>`\`${e}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:e})=>`'import.${e}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:e,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${e}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:e})=>`'${"ForInStatement"===e?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:e})=>`Unsyntactic ${"BreakStatement"===e?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:e})=>`A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${e}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${p(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${p(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${p(e)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map(e=>JSON.stringify(e)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map(e=>JSON.stringify(e)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:e,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${e?`, expected "${e}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:t})=>`The only valid meta property for ${e} is ${e}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."};const u=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]);var d=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${p({type:e})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'});const f=["message"];function m(e,t,s){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:s})}function y({toMessage:e,code:t,reasonCode:s,syntaxPlugin:i}){const a="MissingPlugin"===s||"MissingOneOfPlugins"===s;{const e={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};e[s]&&(s=e[s])}return function n(o,l){const c=new SyntaxError;return c.code=t,c.reasonCode=s,c.loc=o,c.pos=o.index,c.syntaxPlugin=i,a&&(c.missingPlugin=l.missingPlugin),m(c,"clone",function(e={}){var t;const{line:s,column:i,index:a}=null!=(t=e.loc)?t:o;return n(new r(s,i,a),Object.assign({},l,e.details))}),m(c,"details",l),Object.defineProperty(c,"message",{configurable:!0,get(){const t=`${e(l)} (${o.line}:${o.column})`;return this.message=t,t},set(e){Object.defineProperty(this,"message",{value:e,writable:!0})}}),c}}function g(e,t){if(Array.isArray(e))return t=>g(t,e[0]);const s={};for(const r of Object.keys(e)){const a=e[r],n="string"==typeof a?{message:()=>a}:"function"==typeof a?{message:a}:a,{message:o}=n,l=i(n,f),c="string"==typeof o?()=>o:o;s[r]=y(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:r,toMessage:c},t?{syntaxPlugin:t}:{},l))}return s}const v=Object.assign({},g(l),g(h),g({StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."}),g`pipelineOperator`(d));const{defineProperty:b}=Object,x=(e,t)=>{e&&b(e,t,{enumerable:!1,value:e[t]})};function _(e){return x(e.loc.start,"index"),x(e.loc.end,"index"),e}class P{constructor(e,t){this.token=void 0,this.preserveSpace=void 0,this.token=e,this.preserveSpace=!!t}}const T={brace:new P("{"),j_oTag:new P("...",!0)};T.template=new P("`",!0);const w=!0;class A{constructor(e,t={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=null!=t.binop?t.binop:null,this.updateContext=null}}const C=new Map;function E(e,t={}){t.keyword=e;const s=F(e,t);return C.set(e,s),s}function S(e,t){return F(e,{beforeExpr:w,binop:t})}let I=-1;const k=[],D=[],N=[],L=[],O=[],M=[];function F(e,t={}){var s,i,r,a;return++I,D.push(e),N.push(null!=(s=t.binop)?s:-1),L.push(null!=(i=t.beforeExpr)&&i),O.push(null!=(r=t.startsExpr)&&r),M.push(null!=(a=t.prefix)&&a),k.push(new A(e,t)),I}function j(e,t={}){var s,i,r,a;return++I,C.set(e,I),D.push(e),N.push(null!=(s=t.binop)?s:-1),L.push(null!=(i=t.beforeExpr)&&i),O.push(null!=(r=t.startsExpr)&&r),M.push(null!=(a=t.prefix)&&a),k.push(new A("name",t)),I}const B={bracketL:F("[",{beforeExpr:w,startsExpr:!0}),bracketHashL:F("#[",{beforeExpr:w,startsExpr:!0}),bracketBarL:F("[|",{beforeExpr:w,startsExpr:!0}),bracketR:F("]"),bracketBarR:F("|]"),braceL:F("{",{beforeExpr:w,startsExpr:!0}),braceBarL:F("{|",{beforeExpr:w,startsExpr:!0}),braceHashL:F("#{",{beforeExpr:w,startsExpr:!0}),braceR:F("}"),braceBarR:F("|}"),parenL:F("(",{beforeExpr:w,startsExpr:!0}),parenR:F(")"),comma:F(",",{beforeExpr:w}),semi:F(";",{beforeExpr:w}),colon:F(":",{beforeExpr:w}),doubleColon:F("::",{beforeExpr:w}),dot:F("."),question:F("?",{beforeExpr:w}),questionDot:F("?."),arrow:F("=>",{beforeExpr:w}),template:F("template"),ellipsis:F("...",{beforeExpr:w}),backQuote:F("`",{startsExpr:!0}),dollarBraceL:F("${",{beforeExpr:w,startsExpr:!0}),templateTail:F("...`",{startsExpr:!0}),templateNonTail:F("...${",{beforeExpr:w,startsExpr:!0}),at:F("@"),hash:F("#",{startsExpr:!0}),interpreterDirective:F("#!..."),eq:F("=",{beforeExpr:w,isAssign:!0}),assign:F("_=",{beforeExpr:w,isAssign:!0}),slashAssign:F("_=",{beforeExpr:w,isAssign:!0}),xorAssign:F("_=",{beforeExpr:w,isAssign:!0}),moduloAssign:F("_=",{beforeExpr:w,isAssign:!0}),incDec:F("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),bang:F("!",{beforeExpr:w,prefix:!0,startsExpr:!0}),tilde:F("~",{beforeExpr:w,prefix:!0,startsExpr:!0}),doubleCaret:F("^^",{startsExpr:!0}),doubleAt:F("@@",{startsExpr:!0}),pipeline:S("|>",0),nullishCoalescing:S("??",1),logicalOR:S("||",1),logicalAND:S("&&",2),bitwiseOR:S("|",3),bitwiseXOR:S("^",4),bitwiseAND:S("&",5),equality:S("==/!=/===/!==",6),lt:S(">/<=/>=",7),gt:S(">/<=/>=",7),relational:S(">/<=/>=",7),bitShift:S("<>>/>>>",8),bitShiftL:S("<>>/>>>",8),bitShiftR:S("<>>/>>>",8),plusMin:F("+/-",{beforeExpr:w,binop:9,prefix:!0,startsExpr:!0}),modulo:F("%",{binop:10,startsExpr:!0}),star:F("*",{binop:10}),slash:S("/",10),exponent:F("**",{beforeExpr:w,binop:11,rightAssociative:!0}),_in:E("in",{beforeExpr:w,binop:7}),_instanceof:E("instanceof",{beforeExpr:w,binop:7}),_break:E("break"),_case:E("case",{beforeExpr:w}),_catch:E("catch"),_continue:E("continue"),_debugger:E("debugger"),_default:E("default",{beforeExpr:w}),_else:E("else",{beforeExpr:w}),_finally:E("finally"),_function:E("function",{startsExpr:!0}),_if:E("if"),_return:E("return",{beforeExpr:w}),_switch:E("switch"),_throw:E("throw",{beforeExpr:w,prefix:!0,startsExpr:!0}),_try:E("try"),_var:E("var"),_const:E("const"),_with:E("with"),_new:E("new",{beforeExpr:w,startsExpr:!0}),_this:E("this",{startsExpr:!0}),_super:E("super",{startsExpr:!0}),_class:E("class",{startsExpr:!0}),_extends:E("extends",{beforeExpr:w}),_export:E("export"),_import:E("import",{startsExpr:!0}),_null:E("null",{startsExpr:!0}),_true:E("true",{startsExpr:!0}),_false:E("false",{startsExpr:!0}),_typeof:E("typeof",{beforeExpr:w,prefix:!0,startsExpr:!0}),_void:E("void",{beforeExpr:w,prefix:!0,startsExpr:!0}),_delete:E("delete",{beforeExpr:w,prefix:!0,startsExpr:!0}),_do:E("do",{isLoop:!0,beforeExpr:w}),_for:E("for",{isLoop:!0}),_while:E("while",{isLoop:!0}),_as:j("as",{startsExpr:!0}),_assert:j("assert",{startsExpr:!0}),_async:j("async",{startsExpr:!0}),_await:j("await",{startsExpr:!0}),_defer:j("defer",{startsExpr:!0}),_from:j("from",{startsExpr:!0}),_get:j("get",{startsExpr:!0}),_let:j("let",{startsExpr:!0}),_meta:j("meta",{startsExpr:!0}),_of:j("of",{startsExpr:!0}),_sent:j("sent",{startsExpr:!0}),_set:j("set",{startsExpr:!0}),_source:j("source",{startsExpr:!0}),_static:j("static",{startsExpr:!0}),_using:j("using",{startsExpr:!0}),_yield:j("yield",{startsExpr:!0}),_asserts:j("asserts",{startsExpr:!0}),_checks:j("checks",{startsExpr:!0}),_exports:j("exports",{startsExpr:!0}),_global:j("global",{startsExpr:!0}),_implements:j("implements",{startsExpr:!0}),_intrinsic:j("intrinsic",{startsExpr:!0}),_infer:j("infer",{startsExpr:!0}),_is:j("is",{startsExpr:!0}),_mixins:j("mixins",{startsExpr:!0}),_proto:j("proto",{startsExpr:!0}),_require:j("require",{startsExpr:!0}),_satisfies:j("satisfies",{startsExpr:!0}),_keyof:j("keyof",{startsExpr:!0}),_readonly:j("readonly",{startsExpr:!0}),_unique:j("unique",{startsExpr:!0}),_abstract:j("abstract",{startsExpr:!0}),_declare:j("declare",{startsExpr:!0}),_enum:j("enum",{startsExpr:!0}),_module:j("module",{startsExpr:!0}),_namespace:j("namespace",{startsExpr:!0}),_interface:j("interface",{startsExpr:!0}),_type:j("type",{startsExpr:!0}),_opaque:j("opaque",{startsExpr:!0}),name:F("name",{startsExpr:!0}),placeholder:F("%%",{startsExpr:!0}),string:F("string",{startsExpr:!0}),num:F("num",{startsExpr:!0}),bigint:F("bigint",{startsExpr:!0}),decimal:F("decimal",{startsExpr:!0}),regexp:F("regexp",{startsExpr:!0}),privateName:F("#name",{startsExpr:!0}),eof:F("eof"),jsxName:F("jsxName"),jsxText:F("jsxText",{beforeExpr:!0}),jsxTagStart:F("jsxTagStart",{startsExpr:!0}),jsxTagEnd:F("jsxTagEnd")};function R(e){return e>=93&&e<=133}function U(e){return e>=58&&e<=133}function $(e){return e>=58&&e<=137}function z(e){return O[e]}function V(e){return e>=129&&e<=131}function K(e){return e>=58&&e<=92}function q(e){return D[e]}function H(e){return N[e]}function W(e){return e>=24&&e<=25}function J(e){return k[e]}k[8].updateContext=(e=>{e.pop()}),k[5].updateContext=k[7].updateContext=k[23].updateContext=(e=>{e.push(T.brace)}),k[22].updateContext=(e=>{e[e.length-1]===T.template?e.pop():e.push(T.template)}),k[143].updateContext=(e=>{e.push(T.j_expr,T.j_oTag)});let G="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",X="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";const Y=new RegExp("["+G+"]"),Q=new RegExp("["+G+X+"]");G=X=null;const Z=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],ee=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function te(e,t){let s=65536;for(let i=0,r=t.length;ie)return!1;if((s+=t[i+1])>=e)return!0}return!1}function se(e){return e<65?36===e:e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&Y.test(String.fromCharCode(e)):te(e,Z)))}function ie(e){return e<48?36===e:e<58||!(e<65)&&(e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&Q.test(String.fromCharCode(e)):te(e,Z)||te(e,ee))))}const re=["implements","interface","let","package","private","protected","public","static","yield"],ae=["eval","arguments"],ne=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"]),oe=new Set(re),le=new Set(ae);function ce(e,t){return t&&"await"===e||"enum"===e}function pe(e,t){return ce(e,t)||oe.has(e)}function he(e){return le.has(e)}function ue(e,t){return pe(e,t)||he(e)}const de=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);class fe{constructor(e){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=e}}class me{constructor(e,t){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=e,this.inModule=t}get inTopLevel(){return(1&this.currentScope().flags)>0}get inFunction(){return(2&this.currentVarScopeFlags())>0}get allowSuper(){return(16&this.currentThisScopeFlags())>0}get allowDirectSuper(){return(32&this.currentThisScopeFlags())>0}get inClass(){return(64&this.currentThisScopeFlags())>0}get inClassAndNotInNonArrowFunction(){const e=this.currentThisScopeFlags();return(64&e)>0&&0==(2&e)}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){const{flags:t}=this.scopeStack[e];if(128&t)return!0;if(451&t)return!1}}get inNonArrowFunction(){return(2&this.currentThisScopeFlags())>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new fe(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return!!(130&e.flags||!this.parser.inModule&&1&e.flags)}declareName(e,t,s){let i=this.currentScope();if(8&t||16&t){this.checkRedeclarationInScope(i,e,t,s);let r=i.names.get(e)||0;16&t?r|=4:(i.firstLexicalName||(i.firstLexicalName=e),r|=2),i.names.set(e,r),8&t&&this.maybeExportDefined(i,e)}else if(4&t)for(let r=this.scopeStack.length-1;r>=0&&(i=this.scopeStack[r],this.checkRedeclarationInScope(i,e,t,s),i.names.set(e,1|(i.names.get(e)||0)),this.maybeExportDefined(i,e),!(387&i.flags));--r);this.parser.inModule&&1&i.flags&&this.undefinedExports.delete(e)}maybeExportDefined(e,t){this.parser.inModule&&1&e.flags&&this.undefinedExports.delete(t)}checkRedeclarationInScope(e,t,s,i){this.isRedeclaredInScope(e,t,s)&&this.parser.raise(v.VarRedeclaration,i,{identifierName:t})}isRedeclaredInScope(e,t,s){if(!(1&s))return!1;if(8&s)return e.names.has(t);const i=e.names.get(t);return 16&s?(2&i)>0||!this.treatFunctionsAsVarInScope(e)&&(1&i)>0:(2&i)>0&&!(8&e.flags&&e.firstLexicalName===t)||!this.treatFunctionsAsVarInScope(e)&&(4&i)>0}checkLocalExport(e){const{name:t}=e;this.scopeStack[0].names.has(t)||this.undefinedExports.set(t,e.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){const{flags:t}=this.scopeStack[e];if(387&t)return t}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){const{flags:t}=this.scopeStack[e];if(451&t&&!(4&t))return t}}}class ye extends fe{constructor(...e){super(...e),this.declareFunctions=new Set}}class ge extends me{createScope(e){return new ye(e)}declareName(e,t,s){const i=this.currentScope();if(2048&t)return this.checkRedeclarationInScope(i,e,t,s),this.maybeExportDefined(i,e),void i.declareFunctions.add(e);super.declareName(e,t,s)}isRedeclaredInScope(e,t,s){if(super.isRedeclaredInScope(e,t,s))return!0;if(2048&s&&!e.declareFunctions.has(t)){const s=e.names.get(t);return(4&s)>0||(2&s)>0}return!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e)}}class ve{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(e){return e+this.startIndex}offsetToSourcePos(e){return e-this.startIndex}hasPlugin(e){if("string"==typeof e)return this.plugins.has(e);{const[t,s]=e;if(!this.hasPlugin(t))return!1;const i=this.plugins.get(t);for(const e of Object.keys(s))if((null==i?void 0:i[e])!==s[e])return!1;return!0}}getPluginOption(e,t){var s;return null==(s=this.plugins.get(e))?void 0:s[t]}}function be(e,t){void 0===e.trailingComments?e.trailingComments=t:e.trailingComments.unshift(...t)}function xe(e,t){void 0===e.innerComments?e.innerComments=t:e.innerComments.unshift(...t)}function _e(e,t,s){let i=null,r=t.length;for(;null===i&&r>0;)i=t[--r];null===i||i.start>s.start?xe(e,s.comments):be(i,s.comments)}class Pe extends ve{addComment(e){this.filename&&(e.loc.filename=this.filename);const{commentsLen:t}=this.state;this.comments.length!==t&&(this.comments.length=t),this.comments.push(e),this.state.commentsLen++}processComment(e){const{commentStack:t}=this.state,s=t.length;if(0===s)return;let i=s-1;const r=t[i];r.start===e.end&&(r.leadingNode=e,i--);const{start:a}=e;for(;i>=0;i--){const s=t[i],r=s.end;if(!(r>a)){r===a&&(s.trailingNode=e);break}s.containingNode=e,this.finalizeComment(s),t.splice(i,1)}}finalizeComment(e){const{comments:t}=e;if(null!==e.leadingNode||null!==e.trailingNode)null!==e.leadingNode&&be(e.leadingNode,t),null!==e.trailingNode&&function(e,t){void 0===e.leadingComments?e.leadingComments=t:e.leadingComments.unshift(...t)}(e.trailingNode,t);else{const{containingNode:s,start:i}=e;if(44===this.input.charCodeAt(this.offsetToSourcePos(i)-1))switch(s.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":_e(s,s.properties,e);break;case"CallExpression":case"OptionalCallExpression":_e(s,s.arguments,e);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":_e(s,s.params,e);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":_e(s,s.elements,e);break;case"ExportNamedDeclaration":case"ImportDeclaration":_e(s,s.specifiers,e);break;case"TSEnumDeclaration":case"TSEnumBody":_e(s,s.members,e);break;default:xe(s,t)}else xe(s,t)}}finalizeRemainingComments(){const{commentStack:e}=this.state;for(let t=e.length-1;t>=0;t--)this.finalizeComment(e[t]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(e){const{commentStack:t}=this.state,{length:s}=t;if(0===s)return;const i=t[s-1];i.leadingNode===e&&(i.leadingNode=null)}resetPreviousIdentifierLeadingComments(e){const{commentStack:t}=this.state,{length:s}=t;0!==s&&(t[s-1].trailingNode===e?t[s-1].trailingNode=null:s>=2&&t[s-2].trailingNode===e&&(t[s-2].trailingNode=null))}takeSurroundingComments(e,t,s){const{commentStack:i}=this.state,r=i.length;if(0===r)return;let a=r-1;for(;a>=0;a--){const r=i[a],n=r.end;if(r.start===s)r.leadingNode=e;else if(n===t)r.trailingNode=e;else if(n0}set strict(e){e?this.flags|=1:this.flags&=-2}init({strictMode:e,sourceType:t,startIndex:s,startLine:i,startColumn:a}){this.strict=!1!==e&&(!0===e||"module"===t),this.startIndex=s,this.curLine=i,this.lineStart=-a,this.startLoc=this.endLoc=new r(i,a,s)}get maybeInArrowParameters(){return(2&this.flags)>0}set maybeInArrowParameters(e){e?this.flags|=2:this.flags&=-3}get inType(){return(4&this.flags)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(8&this.flags)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(16&this.flags)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(32&this.flags)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(64&this.flags)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(128&this.flags)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get soloAwait(){return(256&this.flags)>0}set soloAwait(e){e?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(512&this.flags)>0}set inFSharpPipelineDirectBody(e){e?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(1024&this.flags)>0}set canStartJSXElement(e){e?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(2048&this.flags)>0}set containsEsc(e){e?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(4096&this.flags)>0}set hasTopLevelAwait(e){e?this.flags|=4096:this.flags&=-4097}curPosition(){return new r(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){const e=new Ie;return e.flags=this.flags,e.startIndex=this.startIndex,e.curLine=this.curLine,e.lineStart=this.lineStart,e.startLoc=this.startLoc,e.endLoc=this.endLoc,e.errors=this.errors.slice(),e.potentialArrowAt=this.potentialArrowAt,e.noArrowAt=this.noArrowAt.slice(),e.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),e.topicContext=this.topicContext,e.labels=this.labels.slice(),e.commentsLen=this.commentsLen,e.commentStack=this.commentStack.slice(),e.pos=this.pos,e.type=this.type,e.value=this.value,e.start=this.start,e.end=this.end,e.lastTokEndLoc=this.lastTokEndLoc,e.lastTokStartLoc=this.lastTokStartLoc,e.context=this.context.slice(),e.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,e.strictErrors=this.strictErrors,e.tokensLength=this.tokensLength,e}}var ke=function(e){return e>=48&&e<=57};const De={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Ne={bin:e=>48===e||49===e,oct:e=>e>=48&&e<=55,dec:e=>e>=48&&e<=57,hex:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};function Le(e,t,s,i,r,a){const n=s,o=i,l=r;let c="",p=null,h=s;const{length:u}=t;for(;;){if(s>=u){a.unterminated(n,o,l),c+=t.slice(h,s);break}const d=t.charCodeAt(s);if(Oe(e,d,t,s)){c+=t.slice(h,s);break}if(92===d){c+=t.slice(h,s);const n=Me(t,s,i,r,"template"===e,a);null!==n.ch||p?c+=n.ch:p={pos:s,lineStart:i,curLine:r},({pos:s,lineStart:i,curLine:r}=n),h=s}else 8232===d||8233===d?(++r,i=++s):10===d||13===d?"template"===e?(c+=t.slice(h,s)+"\n",++s,13===d&&10===t.charCodeAt(s)&&++s,++r,h=i=s):a.unterminated(n,o,l):++s}return{pos:s,str:c,firstInvalidLoc:p,lineStart:i,curLine:r,containsInvalid:!!p}}function Oe(e,t,s,i){return"template"===e?96===t||36===t&&123===s.charCodeAt(i+1):t===("double"===e?34:39)}function Me(e,t,s,i,r,a){const n=!r;t++;const o=e=>({pos:t,ch:e,lineStart:s,curLine:i}),l=e.charCodeAt(t++);switch(l){case 110:return o("\n");case 114:return o("\r");case 120:{let r;return({code:r,pos:t}=Fe(e,t,s,i,2,!1,n,a)),o(null===r?null:String.fromCharCode(r))}case 117:{let r;return({code:r,pos:t}=Be(e,t,s,i,n,a)),o(null===r?null:String.fromCodePoint(r))}case 116:return o("\t");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:10===e.charCodeAt(t)&&++t;case 10:s=t,++i;case 8232:case 8233:return o("");case 56:case 57:if(r)return o(null);a.strictNumericEscape(t-1,s,i);default:if(l>=48&&l<=55){const n=t-1;let l=/^[0-7]+/.exec(e.slice(n,t+2))[0],c=parseInt(l,8);c>255&&(l=l.slice(0,-1),c=parseInt(l,8)),t+=l.length-1;const p=e.charCodeAt(t);if("0"!==l||56===p||57===p){if(r)return o(null);a.strictNumericEscape(n,s,i)}return o(String.fromCharCode(c))}return o(String.fromCharCode(l))}}function Fe(e,t,s,i,r,a,n,o){const l=t;let c;return({n:c,pos:t}=je(e,t,s,i,16,r,a,!1,o,!n)),null===c&&(n?o.invalidEscapeSequence(l,s,i):t=l-1),{code:c,pos:t}}function je(e,t,s,i,r,a,n,o,l,c){const p=t,h=16===r?De.hex:De.decBinOct,u=16===r?Ne.hex:10===r?Ne.dec:8===r?Ne.oct:Ne.bin;let d=!1,f=0;for(let p=0,m=null==a?1/0:a;p=97?a-97+10:a>=65?a-65+10:ke(a)?a-48:1/0)>=r){if(p<=9&&c)return{n:null,pos:t};if(p<=9&&l.invalidDigit(t,s,i,r))p=0;else{if(!n)break;p=0,d=!0}}++t,f=f*r+p}else{const r=e.charCodeAt(t-1),a=e.charCodeAt(t+1);if(o){if(Number.isNaN(a)||!u(a)||h.has(r)||h.has(a)){if(c)return{n:null,pos:t};l.unexpectedNumericSeparator(t,s,i)}}else{if(c)return{n:null,pos:t};l.numericSeparatorInEscapeSequence(t,s,i)}++t}}return t===p||null!=a&&t-p!==a||d?{n:null,pos:t}:{n:f,pos:t}}function Be(e,t,s,i,r,a){let n;if(123===e.charCodeAt(t)){if(++t,({code:n,pos:t}=Fe(e,t,s,i,e.indexOf("}",t)-t,!0,r,a)),++t,null!==n&&n>1114111){if(!r)return{code:null,pos:t};a.invalidCodePoint(t,s,i)}}else({code:n,pos:t}=Fe(e,t,s,i,4,!1,r,a));return{code:n,pos:t}}function Re(e,t,s){return new r(s,e-t,e)}const Ue=new Set([103,109,115,105,121,117,100,118]);class $e{constructor(e){const t=e.startIndex||0;this.type=e.type,this.value=e.value,this.start=t+e.start,this.end=t+e.end,this.loc=new a(e.startLoc,e.endLoc)}}class ze extends Pe{constructor(e,t){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(e,t,s,i)=>!!(2048&this.optionFlags)&&(this.raise(v.InvalidDigit,Re(e,t,s),{radix:i}),!0),numericSeparatorInEscapeSequence:this.errorBuilder(v.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(v.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(v.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(v.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(e,t,s)=>{this.recordStrictModeErrors(v.StrictNumericEscape,Re(e,t,s))},unterminated:(e,t,s)=>{throw this.raise(v.UnterminatedString,Re(e-1,t,s))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(v.StrictNumericEscape),unterminated:(e,t,s)=>{throw this.raise(v.UnterminatedTemplate,Re(e,t,s))}}),this.state=new Ie,this.state.init(e),this.input=t,this.length=t.length,this.comments=[],this.isLookahead=!1}pushToken(e){this.tokens.length=this.state.tokensLength,this.tokens.push(e),++this.state.tokensLength}next(){this.checkKeywordEscapes(),256&this.optionFlags&&this.pushToken(new $e(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(e){return!!this.match(e)&&(this.next(),!0)}match(e){return this.state.type===e}createLookaheadState(e){return{pos:e.pos,value:null,type:e.type,start:e.start,end:e.end,context:[this.curContext()],inType:e.inType,startLoc:e.startLoc,lastTokEndLoc:e.lastTokEndLoc,curLine:e.curLine,lineStart:e.lineStart,curPosition:e.curPosition}}lookahead(){const e=this.state;this.state=this.createLookaheadState(e),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;const t=this.state;return this.state=e,t}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(e){return Ce.lastIndex=e,Ce.test(this.input)?Ce.lastIndex:e}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(e){return Ee.lastIndex=e,Ee.test(this.input)?Ee.lastIndex:e}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(e){let t=this.input.charCodeAt(e);if(55296==(64512&t)&&++ethis.raise(e,t)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length?this.finishToken(140):this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(e){let t;this.isLookahead||(t=this.state.curPosition());const s=this.state.pos,i=this.input.indexOf(e,s+2);if(-1===i)throw this.raise(v.UnterminatedComment,this.state.curPosition());for(this.state.pos=i+e.length,Te.lastIndex=s+2;Te.test(this.input)&&Te.lastIndex<=i;)++this.state.curLine,this.state.lineStart=Te.lastIndex;if(this.isLookahead)return;const r={type:"CommentBlock",value:this.input.slice(s+2,i),start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(i+e.length),loc:new a(t,this.state.curPosition())};return 256&this.optionFlags&&this.pushToken(r),r}skipLineComment(e){const t=this.state.pos;let s;this.isLookahead||(s=this.state.curPosition());let i=this.input.charCodeAt(this.state.pos+=e);if(this.state.pose))break e;{const e=this.skipLineComment(3);void 0!==e&&(this.addComment(e),null==t||t.push(e))}}else{if(60!==s||this.inModule||!(8192&this.optionFlags))break e;{const e=this.state.pos;if(33!==this.input.charCodeAt(e+1)||45!==this.input.charCodeAt(e+2)||45!==this.input.charCodeAt(e+3))break e;{const e=this.skipLineComment(4);void 0!==e&&(this.addComment(e),null==t||t.push(e))}}}}}if((null==t?void 0:t.length)>0){const s=this.state.pos,i={start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(s),comments:t,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(i)}}finishToken(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();const s=this.state.type;this.state.type=e,this.state.value=t,this.isLookahead||this.updateContext(s)}replaceToken(e){this.state.type=e,this.updateContext()}readToken_numberSign(){if(0===this.state.pos&&this.readToken_interpreter())return;const e=this.state.pos+1,t=this.codePointAtPos(e);if(t>=48&&t<=57)throw this.raise(v.UnexpectedDigitAfterHash,this.state.curPosition());if(123===t||91===t&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),"bar"===this.getPluginOption("recordAndTuple","syntaxType"))throw this.raise(123===t?v.RecordExpressionHashIncorrectStartSyntaxType:v.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,123===t?this.finishToken(7):this.finishToken(1)}else se(t)?(++this.state.pos,this.finishToken(139,this.readWord1(t))):92===t?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){const e=this.input.charCodeAt(this.state.pos+1);e>=48&&e<=57?this.readNumber(!0):46===e&&46===this.input.charCodeAt(this.state.pos+2)?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){61===this.input.charCodeAt(this.state.pos+1)?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(0!==this.state.pos||this.length<2)return!1;let e=this.input.charCodeAt(this.state.pos+1);if(33!==e)return!1;const t=this.state.pos;for(this.state.pos+=1;!we(e)&&++this.state.pos=48&&t<=57?(++this.state.pos,this.finishToken(17)):(this.state.pos+=2,this.finishToken(18))}getTokenFromCode(e){switch(e){case 46:return void this.readToken_dot();case 40:return++this.state.pos,void this.finishToken(10);case 41:return++this.state.pos,void this.finishToken(11);case 59:return++this.state.pos,void this.finishToken(13);case 44:return++this.state.pos,void this.finishToken(12);case 91:if(this.hasPlugin("recordAndTuple")&&124===this.input.charCodeAt(this.state.pos+1)){if("bar"!==this.getPluginOption("recordAndTuple","syntaxType"))throw this.raise(v.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:return++this.state.pos,void this.finishToken(3);case 123:if(this.hasPlugin("recordAndTuple")&&124===this.input.charCodeAt(this.state.pos+1)){if("bar"!==this.getPluginOption("recordAndTuple","syntaxType"))throw this.raise(v.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:return++this.state.pos,void this.finishToken(8);case 58:return void(this.hasPlugin("functionBind")&&58===this.input.charCodeAt(this.state.pos+1)?this.finishOp(15,2):(++this.state.pos,this.finishToken(14)));case 63:return void this.readToken_question();case 96:return void this.readTemplateToken();case 48:{const e=this.input.charCodeAt(this.state.pos+1);if(120===e||88===e)return void this.readRadixNumber(16);if(111===e||79===e)return void this.readRadixNumber(8);if(98===e||66===e)return void this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return void this.readNumber(!1);case 34:case 39:return void this.readString(e);case 47:return void this.readToken_slash();case 37:case 42:return void this.readToken_mult_modulo(e);case 124:case 38:return void this.readToken_pipe_amp(e);case 94:return void this.readToken_caret();case 43:case 45:return void this.readToken_plus_min(e);case 60:return void this.readToken_lt();case 62:return void this.readToken_gt();case 61:case 33:return void this.readToken_eq_excl(e);case 126:return void this.finishOp(36,1);case 64:return void this.readToken_atSign();case 35:return void this.readToken_numberSign();case 92:return void this.readWord();default:if(se(e))return void this.readWord(e)}throw this.raise(v.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(e)})}finishOp(e,t){const s=this.input.slice(this.state.pos,this.state.pos+t);this.state.pos+=t,this.finishToken(e,s)}readRegexp(){const e=this.state.startLoc,t=this.state.start+1;let s,i,{pos:r}=this.state;for(;;++r){if(r>=this.length)throw this.raise(v.UnterminatedRegExp,n(e,1));const t=this.input.charCodeAt(r);if(we(t))throw this.raise(v.UnterminatedRegExp,n(e,1));if(s)s=!1;else{if(91===t)i=!0;else if(93===t&&i)i=!1;else if(47===t&&!i)break;s=92===t}}const a=this.input.slice(t,r);++r;let o="";const l=()=>n(e,r+2-t);for(;r=2&&48===this.input.charCodeAt(t);if(l){const e=this.input.slice(t,this.state.pos);if(this.recordStrictModeErrors(v.StrictOctalLiteral,s),!this.state.strict){const t=e.indexOf("_");t>0&&this.raise(v.ZeroDigitNumericSeparator,n(s,t))}o=l&&!/[89]/.test(e)}let c=this.input.charCodeAt(this.state.pos);if(46!==c||o||(++this.state.pos,this.readInt(10),i=!0,c=this.input.charCodeAt(this.state.pos)),69!==c&&101!==c||o||(43!==(c=this.input.charCodeAt(++this.state.pos))&&45!==c||++this.state.pos,null===this.readInt(10)&&this.raise(v.InvalidOrMissingExponent,s),i=!0,a=!0,c=this.input.charCodeAt(this.state.pos)),110===c&&((i||l)&&this.raise(v.InvalidBigIntLiteral,s),++this.state.pos,r=!0),109===c){this.expectPlugin("decimal",this.state.curPosition()),(a||l)&&this.raise(v.InvalidDecimal,s),++this.state.pos;var p=!0}if(se(this.codePointAtPos(this.state.pos)))throw this.raise(v.NumberIdentifier,this.state.curPosition());const h=this.input.slice(t,this.state.pos).replace(/[_mn]/g,"");if(r)return void this.finishToken(136,h);if(p)return void this.finishToken(137,h);const u=o?parseInt(h,8):parseFloat(h);this.finishToken(135,u)}readCodePoint(e){const{code:t,pos:s}=Be(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,this.errorHandlers_readCodePoint);return this.state.pos=s,t}readString(e){const{str:t,pos:s,curLine:i,lineStart:r}=Le(34===e?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=r,this.state.curLine=i,this.finishToken(134,t)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){const e=this.input[this.state.pos],{str:t,firstInvalidLoc:s,pos:i,curLine:a,lineStart:n}=Le("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=i+1,this.state.lineStart=n,this.state.curLine=a,s&&(this.state.firstInvalidTemplateEscapePos=new r(s.curLine,s.pos-s.lineStart,this.sourceToOffsetPos(s.pos))),96===this.input.codePointAt(i)?this.finishToken(24,s?null:e+t+"`"):(this.state.pos++,this.finishToken(25,s?null:e+t+"${"))}recordStrictModeErrors(e,t){const s=t.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(e,t):this.state.strictErrors.set(s,[e,t])}readWord1(e){this.state.containsEsc=!1;let t="";const s=this.state.pos;let i=this.state.pos;for(void 0!==e&&(this.state.pos+=e<=65535?1:2);this.state.pos=0;t--){const r=n[t];if(r.loc.index===a)return n[t]=e(i,s);if(r.loc.indexthis.hasPlugin(e)))throw this.raise(v.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:e})}errorBuilder(e){return(t,s,i)=>{this.raise(e,Re(t,s,i))}}}class Ve{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}}class Ke{constructor(e){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=e}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Ve)}exit(){const e=this.stack.pop(),t=this.current();for(const[s,i]of Array.from(e.undefinedPrivateNames))t?t.undefinedPrivateNames.has(s)||t.undefinedPrivateNames.set(s,i):this.parser.raise(v.InvalidPrivateFieldResolution,i,{identifierName:s})}declarePrivateName(e,t,s){const{privateNames:i,loneAccessors:r,undefinedPrivateNames:a}=this.current();let n=i.has(e);if(3&t){const s=n&&r.get(e);if(s){(n=(3&s)===(3&t)||(4&s)!==(4&t))||r.delete(e)}else n||r.set(e,t)}n&&this.parser.raise(v.PrivateNameRedeclaration,s,{identifierName:e}),i.add(e),a.delete(e)}usePrivateName(e,t){let s;for(s of this.stack)if(s.privateNames.has(e))return;s?s.undefinedPrivateNames.set(e,t):this.parser.raise(v.InvalidPrivateFieldResolution,t,{identifierName:e})}}class qe{constructor(e=0){this.type=e}canBeArrowParameterDeclaration(){return 2===this.type||1===this.type}isCertainlyParameterDeclaration(){return 3===this.type}}class He extends qe{constructor(e){super(e),this.declarationErrors=new Map}recordDeclarationError(e,t){const s=t.index;this.declarationErrors.set(s,[e,t])}clearDeclarationError(e){this.declarationErrors.delete(e)}iterateErrors(e){this.declarationErrors.forEach(e)}}class We{constructor(e){this.parser=void 0,this.stack=[new qe],this.parser=e}enter(e){this.stack.push(e)}exit(){this.stack.pop()}recordParameterInitializerError(e,t){const s=t.loc.start,{stack:i}=this;let r=i.length-1,a=i[r];for(;!a.isCertainlyParameterDeclaration();){if(!a.canBeArrowParameterDeclaration())return;a.recordDeclarationError(e,s),a=i[--r]}this.parser.raise(e,s)}recordArrowParameterBindingError(e,t){const{stack:s}=this,i=s[s.length-1],r=t.loc.start;if(i.isCertainlyParameterDeclaration())this.parser.raise(e,r);else{if(!i.canBeArrowParameterDeclaration())return;i.recordDeclarationError(e,r)}}recordAsyncArrowParametersError(e){const{stack:t}=this;let s=t.length-1,i=t[s];for(;i.canBeArrowParameterDeclaration();)2===i.type&&i.recordDeclarationError(v.AwaitBindingIdentifier,e),i=t[--s]}validateAsPattern(){const{stack:e}=this,t=e[e.length-1];t.canBeArrowParameterDeclaration()&&t.iterateErrors(([t,s])=>{this.parser.raise(t,s);let i=e.length-2,r=e[i];for(;r.canBeArrowParameterDeclaration();)r.clearDeclarationError(s.index),r=e[--i]})}}function Je(){return new qe}class Ge{constructor(){this.stacks=[]}enter(e){this.stacks.push(e)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(2&this.currentFlags())>0}get hasYield(){return(1&this.currentFlags())>0}get hasReturn(){return(4&this.currentFlags())>0}get hasIn(){return(8&this.currentFlags())>0}}function Xe(e,t){return(e?2:0)|(t?1:0)}class Ye extends ze{addExtra(e,t,s,i=!0){if(!e)return;let{extra:r}=e;null==r&&(r={},e.extra=r),i?r[t]=s:Object.defineProperty(r,t,{enumerable:i,value:s})}isContextual(e){return this.state.type===e&&!this.state.containsEsc}isUnparsedContextual(e,t){const s=e+t.length;if(this.input.slice(e,s)===t){const e=this.input.charCodeAt(s);return!(ie(e)||55296==(64512&e))}return!1}isLookaheadContextual(e){const t=this.nextTokenStart();return this.isUnparsedContextual(t,e)}eatContextual(e){return!!this.isContextual(e)&&(this.next(),!0)}expectContextual(e,t){if(!this.eatContextual(e)){if(null!=t)throw this.raise(t,this.state.startLoc);this.unexpected(null,e)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Ae(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return Ae(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(e=!0){(e?this.isLineTerminator():this.eat(13))||this.raise(v.MissingSemicolon,this.state.lastTokEndLoc)}expect(e,t){this.eat(e)||this.unexpected(t,e)}tryParse(e,t=this.state.clone()){const s={node:null};try{const i=e((e=null)=>{throw s.node=e,s});if(this.state.errors.length>t.errors.length){const e=this.state;return this.state=t,this.state.tokensLength=e.tokensLength,{node:i,error:e.errors[t.errors.length],thrown:!1,aborted:!1,failState:e}}return{node:i,error:null,thrown:!1,aborted:!1,failState:null}}catch(e){const i=this.state;if(this.state=t,e instanceof SyntaxError)return{node:null,error:e,thrown:!0,aborted:!1,failState:i};if(e===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:i};throw e}}checkExpressionErrors(e,t){if(!e)return!1;const{shorthandAssignLoc:s,doubleProtoLoc:i,privateKeyLoc:r,optionalParametersLoc:a}=e;if(!t)return!!(s||i||a||r);null!=s&&this.raise(v.InvalidCoverInitializedName,s),null!=i&&this.raise(v.DuplicateProto,i),null!=r&&this.raise(v.UnexpectedPrivateField,r),null!=a&&this.unexpected(a)}isLiteralPropertyName(){return $(this.state.type)}isPrivateName(e){return"PrivateName"===e.type}getPrivateNameSV(e){return e.id.name}hasPropertyAsPrivateName(e){return("MemberExpression"===e.type||"OptionalMemberExpression"===e.type)&&this.isPrivateName(e.property)}isObjectProperty(e){return"ObjectProperty"===e.type}isObjectMethod(e){return"ObjectMethod"===e.type}initializeScopes(e="module"===this.options.sourceType){const t=this.state.labels;this.state.labels=[];const s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;const i=this.inModule;this.inModule=e;const r=this.scope,a=this.getScopeHandler();this.scope=new a(this,e);const n=this.prodParam;this.prodParam=new Ge;const o=this.classScope;this.classScope=new Ke(this);const l=this.expressionScope;return this.expressionScope=new We(this),()=>{this.state.labels=t,this.exportedIdentifiers=s,this.inModule=i,this.scope=r,this.prodParam=n,this.classScope=o,this.expressionScope=l}}enterInitialScopes(){let e=0;this.inModule&&(e|=2),32&this.optionFlags&&(e|=1),this.scope.enter(1),this.prodParam.enter(e)}checkDestructuringPrivate(e){const{privateKeyLoc:t}=e;null!==t&&this.expectPlugin("destructuringPrivate",t)}}class Qe{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}}class Ze{constructor(e,t,s){this.type="",this.start=t,this.end=0,this.loc=new a(s),128&(null==e?void 0:e.optionFlags)&&(this.range=[t,0]),null!=e&&e.filename&&(this.loc.filename=e.filename)}}const et=Ze.prototype;function tt(e){const{type:t,start:s,end:i,loc:r,range:a,extra:n,name:o}=e,l=Object.create(et);return l.type=t,l.start=s,l.end=i,l.loc=r,l.range=a,l.extra=n,l.name=o,"Placeholder"===t&&(l.expectedNode=e.expectedNode),l}function st(e){const{type:t,start:s,end:i,loc:r,range:a,extra:n}=e;if("Placeholder"===t)return function(e){return tt(e)}(e);const o=Object.create(et);return o.type=t,o.start=s,o.end=i,o.loc=r,o.range=a,void 0!==e.raw?o.raw=e.raw:o.extra=n,o.value=e.value,o}et.__clone=function(){const e=new Ze(void 0,this.start,this.loc.start),t=Object.keys(this);for(let s=0,i=t.length;s`Cannot overwrite reserved type ${e}.`,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:e,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:e,enumName:t})=>`Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:e})=>`Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:e,enumName:t})=>`Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:e})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:e,memberName:t,explicitType:s})=>`Enum \`${e}\` has type \`${s}\`, so the initializer of \`${t}\` needs to be a ${s} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:e,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${e}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:e,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,EnumInvalidMemberName:({enumName:e,memberName:t,suggestion:s})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${s}\`, in enum \`${e}\`.`,EnumNumberMemberNotInitialized:({enumName:e,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${e}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:e})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,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:e})=>`Unexpected reserved type ${e}.`,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 ` async () => {}`, use `async () => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:e,suggestion:t})=>`\`declare export ${e}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function nt(e){return"type"===e.importKind||"typeof"===e.importKind}const ot={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};const lt=/\*?\s*@((?:no)?flow)\b/;const ct={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},pt=g`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:e})=>`Expected corresponding JSX closing tag for <${e}>.`,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:e,HTMLEntity:t})=>`Unexpected token \`${e}\`. Did you mean \`${t}\` or \`{'${e}'}\`?`,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 ht(e){return!!e&&("JSXOpeningFragment"===e.type||"JSXClosingFragment"===e.type)}function ut(e){if("JSXIdentifier"===e.type)return e.name;if("JSXNamespacedName"===e.type)return e.namespace.name+":"+e.name.name;if("JSXMemberExpression"===e.type)return ut(e.object)+"."+ut(e.property);throw new Error("Node had unexpected type: "+e.type)}class dt extends fe{constructor(...e){super(...e),this.tsNames=new Map}}class ft extends me{constructor(...e){super(...e),this.importsStack=[]}createScope(e){return this.importsStack.push(new Set),new dt(e)}enter(e){256===e&&this.importsStack.push(new Set),super.enter(e)}exit(){const e=super.exit();return 256===e&&this.importsStack.pop(),e}hasImport(e,t){const s=this.importsStack.length;if(this.importsStack[s-1].has(e))return!0;if(!t&&s>1)for(let t=0;t0){if(256&s){return!!(512&s)!==(4&i)>0}return!0}return 128&s&&(8&i)>0?!!(2&e.names.get(t))&&!!(1&s):!!(2&s&&(1&i)>0)||super.isRedeclaredInScope(e,t,s)}checkLocalExport(e){const{name:t}=e;if(!this.hasImport(t)){for(let e=this.scopeStack.length-1;e>=0;e--){const s=this.scopeStack[e].tsNames.get(t);if((1&s)>0||(16&s)>0)return}super.checkLocalExport(e)}}}const mt=e=>"ParenthesizedExpression"===e.type?mt(e.expression):e;class yt extends it{toAssignable(e,t=!1){var s,i;let r=void 0;switch(("ParenthesizedExpression"===e.type||null!=(s=e.extra)&&s.parenthesized)&&(r=mt(e),t?"Identifier"===r.type?this.expressionScope.recordArrowParameterBindingError(v.InvalidParenthesizedAssignment,e):"MemberExpression"===r.type||this.isOptionalMemberExpression(r)||this.raise(v.InvalidParenthesizedAssignment,e):this.raise(v.InvalidParenthesizedAssignment,e)),e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern";for(let s=0,i=e.properties.length,r=i-1;s"ObjectMethod"!==e.type&&(s===t||"SpreadElement"!==e.type)&&this.isAssignable(e))}case"ObjectProperty":return this.isAssignable(e.value);case"SpreadElement":return this.isAssignable(e.argument);case"ArrayExpression":return e.elements.every(e=>null===e||this.isAssignable(e));case"AssignmentExpression":return"="===e.operator;case"ParenthesizedExpression":return this.isAssignable(e.expression);case"MemberExpression":case"OptionalMemberExpression":return!t;default:return!1}}toReferencedList(e,t){return e}toReferencedListDeep(e,t){this.toReferencedList(e,t);for(const t of e)"ArrayExpression"===(null==t?void 0:t.type)&&this.toReferencedListDeep(t.elements)}parseSpread(e){const t=this.startNode();return this.next(),t.argument=this.parseMaybeAssignAllowIn(e,void 0),this.finishNode(t,"SpreadElement")}parseRestBinding(){const e=this.startNode();return this.next(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{const e=this.startNode();return this.next(),e.elements=this.parseBindingList(3,93,1),this.finishNode(e,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(e,t,s){const i=1&s,r=[];let a=!0;for(;!this.eat(e);)if(a?a=!1:this.expect(12),i&&this.match(12))r.push(null);else{if(this.eat(e))break;if(this.match(21)){let i=this.parseRestBinding();if((this.hasPlugin("flow")||2&s)&&(i=this.parseFunctionParamType(i)),r.push(i),!this.checkCommaAfterRest(t)){this.expect(e);break}}else{const e=[];if(2&s)for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(v.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());r.push(this.parseBindingElement(s,e))}}return r}parseBindingRestProperty(e){return this.next(),e.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(e,"RestElement")}parseBindingProperty(){const{type:e,startLoc:t}=this.state;if(21===e)return this.parseBindingRestProperty(this.startNode());const s=this.startNode();return 139===e?(this.expectPlugin("destructuringPrivate",t),this.classScope.usePrivateName(this.state.value,t),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,t,!1,!1,!0,!1)}parseBindingElement(e,t){const s=this.parseMaybeDefault();(this.hasPlugin("flow")||2&e)&&this.parseFunctionParamType(s);const i=this.parseMaybeDefault(s.loc.start,s);return t.length&&(s.decorators=t),i}parseFunctionParamType(e){return e}parseMaybeDefault(e,t){if(null!=e||(e=this.state.startLoc),t=null!=t?t:this.parseBindingAtom(),!this.eat(29))return t;const s=this.startNodeAt(e);return s.left=t,s.right=this.parseMaybeAssignAllowIn(),this.finishNode(s,"AssignmentPattern")}isValidLVal(e,t,s){switch(e){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(e){return"OptionalMemberExpression"===e.type}checkLVal(e,t,s=64,i=!1,r=!1,a=!1){var n;const o=e.type;if(this.isObjectMethod(e))return;const l=this.isOptionalMemberExpression(e);if(l||"MemberExpression"===o)return l&&(this.expectPlugin("optionalChainingAssign",e.loc.start),"AssignmentExpression"!==t.type&&this.raise(v.InvalidLhsOptionalChaining,e,{ancestor:t})),void(64!==s&&this.raise(v.InvalidPropertyBindingPattern,e));if("Identifier"===o){this.checkIdentifier(e,s,r);const{name:t}=e;return void(i&&(i.has(t)?this.raise(v.ParamDupe,e):i.add(t)))}const c=this.isValidLVal(o,!(a||null!=(n=e.extra)&&n.parenthesized)&&"AssignmentExpression"===t.type,s);if(!0===c)return;if(!1===c){const i=64===s?v.InvalidLhs:v.InvalidLhsBinding;return void this.raise(i,e,{ancestor:t})}let p,h;"string"==typeof c?(p=c,h="ParenthesizedExpression"===o):[p,h]=c;const u="ArrayPattern"===o||"ObjectPattern"===o?{type:o}:t,d=e[p];if(Array.isArray(d))for(const e of d)e&&this.checkLVal(e,u,s,i,r,h);else d&&this.checkLVal(d,u,s,i,r,h)}checkIdentifier(e,t,s=!1){this.state.strict&&(s?ue(e.name,this.inModule):he(e.name))&&(64===t?this.raise(v.StrictEvalArguments,e,{referenceName:e.name}):this.raise(v.StrictEvalArgumentsBinding,e,{bindingName:e.name})),8192&t&&"let"===e.name&&this.raise(v.LetInLexicalBinding,e),64&t||this.declareNameFromIdentifier(e,t)}declareNameFromIdentifier(e,t){this.scope.declareName(e.name,t,e.loc.start)}checkToRestConversion(e,t){switch(e.type){case"ParenthesizedExpression":this.checkToRestConversion(e.expression,t);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(t)break;default:this.raise(v.InvalidRestAssignmentPattern,e)}}checkCommaAfterRest(e){return!!this.match(12)&&(this.raise(this.lookaheadCharCode()===e?v.RestTrailingComma:v.ElementAfterRest,this.state.startLoc),!0)}}function gt(e){if(!e)throw new Error("Assert fail")}const vt=g`typescript`({AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' 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:e})=>`'declare' is not allowed in ${e}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:e})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' 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:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,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:e})=>`'${e}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnTypeMember:({modifier:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",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:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,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 `() => ...`.",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:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,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:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`});function bt(e){return"private"===e||"public"===e||"protected"===e}function xt(e){if("MemberExpression"!==e.type)return!1;const{computed:t,property:s}=e;return(!t||"StringLiteral"===s.type||!("TemplateLiteral"!==s.type||s.expressions.length>0))&&function e(t){if("Identifier"===t.type)return!0;if("MemberExpression"!==t.type||t.computed)return!1;return e(t.object)}(e.object)}function _t(e,t){var s;const{type:i}=e;if(null!=(s=e.extra)&&s.parenthesized)return!1;if(t){if("Literal"===i){const{value:t}=e;if("string"==typeof t||"boolean"==typeof t)return!0}}else if("StringLiteral"===i||"BooleanLiteral"===i)return!0;return!(!Pt(e,t)&&!function(e,t){if("UnaryExpression"===e.type){const{operator:s,argument:i}=e;if("-"===s&&Pt(i,t))return!0}return!1}(e,t))||("TemplateLiteral"===i&&0===e.expressions.length||!!xt(e))}function Pt(e,t){return t?"Literal"===e.type&&("number"==typeof e.value||"bigint"in e):"NumericLiteral"===e.type||"BigIntLiteral"===e.type}const Tt=g`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."});const wt=["minimal","fsharp","hack","smart"],At=["^^","@@","^","%","#"];const Ct={estree:e=>(class extends e{parse(){const e=_(super.parse());return 256&this.optionFlags&&(e.tokens=e.tokens.map(_)),e}parseRegExpLiteral({pattern:e,flags:t}){let s=null;try{s=new RegExp(e,t)}catch(e){}const i=this.estreeParseLiteral(s);return i.regex={pattern:e,flags:t},i}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch(e){t=null}const s=this.estreeParseLiteral(t);return s.bigint=String(s.value||e),s}parseDecimalLiteral(e){const t=this.estreeParseLiteral(null);return t.decimal=String(t.value||e),t}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}directiveToStmt(e){const t=e.value;delete e.value,t.type="Literal",t.raw=t.extra.raw,t.value=t.extra.expressionValue;const s=e;return s.type="ExpressionStatement",s.expression=t,s.directive=t.extra.rawValue,delete t.extra,s}initFunction(e,t){super.initFunction(e,t),e.expression=!1}checkDeclaration(e){null!=e&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var t;return"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&!(null!=(t=e.expression.extra)&&t.parenthesized)}parseBlockBody(e,t,s,i,r){super.parseBlockBody(e,t,s,i,r);const a=e.directives.map(e=>this.directiveToStmt(e));e.body=a.concat(e.body),delete e.directives}parsePrivateName(){const e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){const t=super.getPrivateNameSV(e);return delete(e=e).id,e.name=t,e.type="PrivateIdentifier",e}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?"PrivateIdentifier"===e.type:super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,t){const s=super.parseLiteral(e,t);return s.raw=s.extra.raw,delete s.extra,s}parseFunctionBody(e,t,s=!1){super.parseFunctionBody(e,t,s),e.expression="BlockStatement"!==e.body.type}parseMethod(e,t,s,i,r,a,n=!1){let o=this.startNode();o.kind=e.kind,(o=super.parseMethod(o,t,s,i,r,a,n)).type="FunctionExpression",delete o.kind,e.value=o;const{typeParameters:l}=e;return l&&(delete e.typeParameters,o.typeParameters=l,this.resetStartLocationFromNode(o,l)),"ClassPrivateMethod"===a&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return"Literal"===e.type?"constructor"===e.value:super.nameIsConstructor(e)}parseClassProperty(...e){const t=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")?(t.type="PropertyDefinition",t):t}parseClassPrivateProperty(...e){const t=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")?(t.type="PropertyDefinition",t.computed=!1,t):t}parseClassAccessorProperty(e){const t=super.parseClassAccessorProperty(e);return this.getPluginOption("estree","classFeatures")?(t.type="AccessorProperty",t):t}parseObjectMethod(e,t,s,i,r){const a=super.parseObjectMethod(e,t,s,i,r);return a&&(a.type="Property","method"===a.kind&&(a.kind="init"),a.shorthand=!1),a}parseObjectProperty(e,t,s,i){const r=super.parseObjectProperty(e,t,s,i);return r&&(r.kind="init",r.type="Property"),r}isValidLVal(e,t,s){return"Property"===e?"value":super.isValidLVal(e,t,s)}isAssignable(e,t){return null!=e&&this.isObjectProperty(e)?this.isAssignable(e.value,t):super.isAssignable(e,t)}toAssignable(e,t=!1){if(null!=e&&this.isObjectProperty(e)){const{key:s,value:i}=e;this.isPrivateName(s)&&this.classScope.usePrivateName(this.getPrivateNameSV(s),s.loc.start),this.toAssignable(i,t)}else super.toAssignable(e,t)}toAssignableObjectExpressionProp(e,t,s){"Property"!==e.type||"get"!==e.kind&&"set"!==e.kind?"Property"===e.type&&e.method?this.raise(v.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,t,s):this.raise(v.PatternHasAccessor,e.key)}finishCallExpression(e,t){const s=super.finishCallExpression(e,t);var i,r;return"Import"===s.callee.type&&(s.type="ImportExpression",s.source=s.arguments[0],s.options=null!=(i=s.arguments[1])?i:null,s.attributes=null!=(r=s.arguments[1])?r:null,delete s.arguments,delete s.callee),s}toReferencedArguments(e){"ImportExpression"!==e.type&&super.toReferencedArguments(e)}parseExport(e,t){const s=this.state.lastTokStartLoc,i=super.parseExport(e,t);switch(i.type){case"ExportAllDeclaration":i.exported=null;break;case"ExportNamedDeclaration":1===i.specifiers.length&&"ExportNamespaceSpecifier"===i.specifiers[0].type&&(i.type="ExportAllDeclaration",i.exported=i.specifiers[0].exported,delete i.specifiers);case"ExportDefaultDeclaration":{var r;const{declaration:e}=i;"ClassDeclaration"===(null==e?void 0:e.type)&&(null==(r=e.decorators)?void 0:r.length)>0&&e.start===i.start&&this.resetStartLocation(i,s)}}return i}parseSubscript(e,t,s,i){const r=super.parseSubscript(e,t,s,i);if(i.optionalChainMember){if("OptionalMemberExpression"!==r.type&&"OptionalCallExpression"!==r.type||(r.type=r.type.substring(8)),i.stop){const e=this.startNodeAtNode(r);return e.expression=r,this.finishNode(e,"ChainExpression")}}else"MemberExpression"!==r.type&&"CallExpression"!==r.type||(r.optional=!1);return r}isOptionalMemberExpression(e){return"ChainExpression"===e.type?"MemberExpression"===e.expression.type:super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return"ChainExpression"===e.type&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return"Property"===e.type&&"init"===e.kind&&!e.method}isObjectMethod(e){return"Property"===e.type&&(e.method||"get"===e.kind||"set"===e.kind)}finishNodeAt(e,t,s){return _(super.finishNodeAt(e,t,s))}resetStartLocation(e,t){super.resetStartLocation(e,t),_(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),_(e)}}),jsx:e=>(class extends e{jsxReadToken(){let e="",t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(pt.UnterminatedJsxContent,this.state.startLoc);const s=this.input.charCodeAt(this.state.pos);switch(s){case 60:case 123:return this.state.pos===this.state.start?void(60===s&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(s)):(e+=this.input.slice(t,this.state.pos),void this.finishToken(142,e));case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;case 62:case 125:default:we(s)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){const t=this.input.charCodeAt(this.state.pos);let s;return++this.state.pos,13===t&&10===this.input.charCodeAt(this.state.pos)?(++this.state.pos,s=e?"\n":"\r\n"):s=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,s}jsxReadString(e){let t="",s=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(v.UnterminatedString,this.state.startLoc);const i=this.input.charCodeAt(this.state.pos);if(i===e)break;38===i?(t+=this.input.slice(s,this.state.pos),t+=this.jsxReadEntity(),s=this.state.pos):we(i)?(t+=this.input.slice(s,this.state.pos),t+=this.jsxReadNewLine(!1),s=this.state.pos):++this.state.pos}t+=this.input.slice(s,this.state.pos++),this.finishToken(134,t)}jsxReadEntity(){const e=++this.state.pos;if(35===this.codePointAtPos(this.state.pos)){++this.state.pos;let e=10;120===this.codePointAtPos(this.state.pos)&&(e=16,++this.state.pos);const t=this.readInt(e,void 0,!1,"bail");if(null!==t&&59===this.codePointAtPos(this.state.pos))return++this.state.pos,String.fromCodePoint(t)}else{let t=0,s=!1;for(;t++<10&&this.state.pos(class extends e{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return ge}shouldParseTypes(){return this.getPluginOption("flow","all")||"flow"===this.flowPragma}finishToken(e,t){134!==e&&13!==e&&28!==e&&void 0===this.flowPragma&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(void 0===this.flowPragma){const t=lt.exec(e.value);if(t)if("flow"===t[1])this.flowPragma="flow";else{if("noflow"!==t[1])throw new Error("Unexpected flow pragma");this.flowPragma="noflow"}}super.addComment(e)}flowParseTypeInitialiser(e){const t=this.state.inType;this.state.inType=!0,this.expect(e||14);const s=this.flowParseType();return this.state.inType=t,s}flowParsePredicate(){const e=this.startNode(),t=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>t.index+1&&this.raise(at.UnexpectedSpaceBetweenModuloChecks,t),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){const e=this.state.inType;this.state.inType=!0,this.expect(14);let t=null,s=null;return this.match(54)?(this.state.inType=e,s=this.flowParsePredicate()):(t=this.flowParseType(),this.state.inType=e,this.match(54)&&(s=this.flowParsePredicate())),[t,s]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();const t=e.id=this.parseIdentifier(),s=this.startNode(),i=this.startNode();this.match(47)?s.typeParameters=this.flowParseTypeParameterDeclaration():s.typeParameters=null,this.expect(10);const r=this.flowParseFunctionTypeParams();return s.params=r.params,s.rest=r.rest,s.this=r._this,this.expect(11),[s.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),i.typeAnnotation=this.finishNode(s,"FunctionTypeAnnotation"),t.typeAnnotation=this.finishNode(i,"TypeAnnotation"),this.resetEndLocation(t),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,t){return this.match(80)?this.flowParseDeclareClass(e):this.match(68)?this.flowParseDeclareFunction(e):this.match(74)?this.flowParseDeclareVariable(e):this.eatContextual(127)?this.match(16)?this.flowParseDeclareModuleExports(e):(t&&this.raise(at.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e)):this.isContextual(130)?this.flowParseDeclareTypeAlias(e):this.isContextual(131)?this.flowParseDeclareOpaqueType(e):this.isContextual(129)?this.flowParseDeclareInterface(e):this.match(82)?this.flowParseDeclareExportDeclaration(e,t):void this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();const t=e.body=this.startNode(),s=t.body=[];for(this.expect(5);!this.match(8);){let e=this.startNode();this.match(83)?(this.next(),this.isContextual(130)||this.match(87)||this.raise(at.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(e)):(this.expectContextual(125,at.UnsupportedStatementInDeclareModule),e=this.flowParseDeclare(e,!0)),s.push(e)}this.scope.exit(),this.expect(8),this.finishNode(t,"BlockStatement");let i=null,r=!1;var a;return s.forEach(e=>{"DeclareExportAllDeclaration"===(e=e).type||"DeclareExportDeclaration"===e.type&&(!e.declaration||"TypeAlias"!==e.declaration.type&&"InterfaceDeclaration"!==e.declaration.type)?("CommonJS"===i&&this.raise(at.AmbiguousDeclareModuleKind,e),i="ES"):"DeclareModuleExports"===e.type&&(r&&this.raise(at.DuplicateDeclareModuleExports,e),"ES"===i&&this.raise(at.AmbiguousDeclareModuleKind,e),i="CommonJS",r=!0)}),e.kind=i||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,t){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!t){const e=this.state.value;throw this.raise(at.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:e,suggestion:ot[e]})}return this.match(74)||this.match(68)||this.match(80)||this.isContextual(131)?(e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration")):this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131)?("ExportNamedDeclaration"===(e=this.parseExport(e,null)).type&&(e.type="ExportDeclaration",e.default=!1,delete e.exportKind),e.type="Declare"+e.type,e):void this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();const t=this.flowParseTypeAlias(e);return t.type="DeclareTypeAlias",t}flowParseDeclareOpaqueType(e){this.next();const t=this.flowParseOpaqueType(e,!0);return t.type="DeclareOpaqueType",t}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,t){if(e.id=this.flowParseRestrictedIdentifier(!t,!0),this.scope.declareName(e.id.name,t?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do{e.extends.push(this.flowParseInterfaceExtends())}while(!t&&this.eat(12));if(t){if(e.implements=[],e.mixins=[],this.eatContextual(117))do{e.mixins.push(this.flowParseInterfaceExtends())}while(this.eat(12));if(this.eatContextual(113))do{e.implements.push(this.flowParseInterfaceExtends())}while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:t,allowExact:!1,allowSpread:!1,allowProto:t,allowInexact:!1})}flowParseInterfaceExtends(){const e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){"_"===e&&this.raise(at.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,t,s){rt.has(e)&&this.raise(s?at.AssignReservedType:at.UnexpectedReservedType,t,{reservedType:e})}flowParseRestrictedIdentifier(e,t){return this.checkReservedType(this.state.value,this.state.startLoc,t),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,t){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,t||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){const t=this.state.startLoc,s=this.startNode(),i=this.flowParseVariance(),r=this.flowParseTypeAnnotatableIdentifier();return s.name=r.name,s.variance=i,s.bound=r.typeAnnotation,this.match(29)?(this.eat(29),s.default=this.flowParseType()):e&&this.raise(at.MissingTypeParamDefault,t),this.finishNode(s,"TypeParameter")}flowParseTypeParameterDeclaration(){const e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let s=!1;do{const e=this.flowParseTypeParameter(s);t.params.push(e),e.default&&(s=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(t,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()===T.brace)return e();{const t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}}flowParseTypeParameterInstantiationInExpression(){if(47===this.reScan_lt())return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){const e=this.startNode(),t=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);const t=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=t}),this.state.inType=t,this.state.inType||this.curContext()!==T.brace||this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(47!==this.reScan_lt())return;const e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){const e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do{e.extends.push(this.flowParseInterfaceExtends())}while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,t,s){return e.static=t,14===this.lookahead().type?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=s,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,t){return e.static=t,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,t){const s=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(s),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:t,allowSpread:s,allowProto:i,allowInexact:r}){const a=this.state.inType;this.state.inType=!0;const n=this.startNode();let o,l;n.callProperties=[],n.properties=[],n.indexers=[],n.internalSlots=[];let c=!1;for(t&&this.match(6)?(this.expect(6),o=9,l=!0):(this.expect(5),o=8,l=!1),n.exact=l;!this.match(o);){let t=!1,a=null,o=null;const p=this.startNode();if(i&&this.isContextual(118)){const t=this.lookahead();14!==t.type&&17!==t.type&&(this.next(),a=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){const e=this.lookahead();14!==e.type&&17!==e.type&&(this.next(),t=!0)}const h=this.flowParseVariance();if(this.eat(0))null!=a&&this.unexpected(a),this.eat(0)?(h&&this.unexpected(h.loc.start),n.internalSlots.push(this.flowParseObjectTypeInternalSlot(p,t))):n.indexers.push(this.flowParseObjectTypeIndexer(p,t,h));else if(this.match(10)||this.match(47))null!=a&&this.unexpected(a),h&&this.unexpected(h.loc.start),n.callProperties.push(this.flowParseObjectTypeCallProperty(p,t));else{let e="init";(this.isContextual(99)||this.isContextual(104))&&$(this.lookahead().type)&&(e=this.state.value,this.next());const i=this.flowParseObjectTypeProperty(p,t,a,h,e,s,null!=r?r:!l);null===i?(c=!0,o=this.state.lastTokStartLoc):n.properties.push(i)}this.flowObjectTypeSemicolon(),!o||this.match(8)||this.match(9)||this.raise(at.UnexpectedExplicitInexactInObject,o)}this.expect(o),s&&(n.inexact=c);const p=this.finishNode(n,"ObjectTypeAnnotation");return this.state.inType=a,p}flowParseObjectTypeProperty(e,t,s,i,r,a,n){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(a?n||this.raise(at.InexactInsideExact,this.state.lastTokStartLoc):this.raise(at.InexactInsideNonObject,this.state.lastTokStartLoc),i&&this.raise(at.InexactVariance,i),null):(a||this.raise(at.UnexpectedSpreadType,this.state.lastTokStartLoc),null!=s&&this.unexpected(s),i&&this.raise(at.SpreadVariance,i),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=t,e.proto=null!=s,e.kind=r;let n=!1;return this.match(47)||this.match(10)?(e.method=!0,null!=s&&this.unexpected(s),i&&this.unexpected(i.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),"get"!==r&&"set"!==r||this.flowCheckGetterSetterParams(e),!a&&"constructor"===e.key.name&&e.value.this&&this.raise(at.ThisParamBannedInConstructor,e.value.this)):("init"!==r&&this.unexpected(),e.method=!1,this.eat(17)&&(n=!0),e.value=this.flowParseTypeInitialiser(),e.variance=i),e.optional=n,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){const t="get"===e.kind?0:1,s=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise("get"===e.kind?at.GetterMayNotHaveThisParam:at.SetterMayNotHaveThisParam,e.value.this),s!==t&&this.raise("get"===e.kind?v.BadGetterArity:v.BadSetterArity,e),"set"===e.kind&&e.value.rest&&this.raise(v.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){this.eat(13)||this.eat(12)||this.match(8)||this.match(9)||this.unexpected()}flowParseQualifiedTypeIdentifier(e,t){null!=e||(e=this.state.startLoc);let s=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){const t=this.startNodeAt(e);t.qualification=s,t.id=this.flowParseRestrictedIdentifier(!0),s=this.finishNode(t,"QualifiedTypeIdentifier")}return s}flowParseGenericType(e,t){const s=this.startNodeAt(e);return s.typeParameters=null,s.id=this.flowParseQualifiedTypeIdentifier(e,t),this.match(47)&&(s.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(s,"GenericTypeAnnotation")}flowParseTypeofType(){const e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){const e=this.startNode();for(e.types=[],this.expect(0);this.state.possuper.parseFunctionBody(e,!0,s)):super.parseFunctionBody(e,!1,s)}parseFunctionBodyAndFinish(e,t,s=!1){if(this.match(14)){const t=this.startNode();[t.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=t.typeAnnotation?this.finishNode(t,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,t,s)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){if(U(this.lookahead().type)){const e=this.startNode();return this.next(),this.flowParseInterface(e)}}else if(this.isContextual(126)){const e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}const t=super.parseStatementLike(e);return void 0!==this.flowPragma||this.isValidDirective(t)||(this.flowPragma=null),t}parseExpressionStatement(e,t,s){if("Identifier"===t.type)if("declare"===t.name){if(this.match(80)||R(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(R(this.state.type)){if("interface"===t.name)return this.flowParseInterface(e);if("type"===t.name)return this.flowParseTypeAlias(e);if("opaque"===t.name)return this.flowParseOpaqueType(e,!1)}return super.parseExpressionStatement(e,t,s)}shouldParseExportDeclaration(){const{type:e}=this.state;return 126===e||V(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){const{type:e}=this.state;return 126===e||V(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){const e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,t,s){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){const t=this.lookaheadCharCode();if(44===t||61===t||58===t||41===t)return this.setOptionalParametersError(s),e}this.expect(17);const i=this.state.clone(),r=this.state.noArrowAt,a=this.startNodeAt(t);let{consequent:n,failed:o}=this.tryParseConditionalConsequent(),[l,c]=this.getArrowLikeExpressions(n);if(o||c.length>0){const e=[...r];if(c.length>0){this.state=i,this.state.noArrowAt=e;for(let t=0;t1&&this.raise(at.AmbiguousConditionalArrow,i.startLoc),o&&1===l.length&&(this.state=i,e.push(l[0].start),this.state.noArrowAt=e,({consequent:n,failed:o}=this.tryParseConditionalConsequent()))}return this.getArrowLikeExpressions(n,!0),this.state.noArrowAt=r,this.expect(14),a.test=e,a.consequent=n,a.alternate=this.forwardNoArrowParamsConversionAt(a,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(a,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);const e=this.parseMaybeAssignAllowIn(),t=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:t}}getArrowLikeExpressions(e,t){const s=[e],i=[];for(;0!==s.length;){const e=s.pop();"ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type?(e.typeParameters||!e.returnType?this.finishArrowValidation(e):i.push(e),s.push(e.body)):"ConditionalExpression"===e.type&&(s.push(e.consequent),s.push(e.alternate))}return t?(i.forEach(e=>this.finishArrowValidation(e)),[i,[]]):function(e,t){const s=[],i=[];for(let r=0;re.params.every(e=>this.isAssignable(e,!0)))}finishArrowValidation(e){var t;this.toAssignableList(e.params,null==(t=e.extra)?void 0:t.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,t){let s;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),s=t(),this.state.noArrowParamsConversionAt.pop()):s=t(),s}parseParenItem(e,t){const s=super.parseParenItem(e,t);if(this.eat(17)&&(s.optional=!0,this.resetEndLocation(e)),this.match(14)){const e=this.startNodeAt(t);return e.expression=s,e.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(e,"TypeCastExpression")}return s}assertModuleNodeAllowed(e){"ImportDeclaration"===e.type&&("type"===e.importKind||"typeof"===e.importKind)||"ExportNamedDeclaration"===e.type&&"type"===e.exportKind||"ExportAllDeclaration"===e.type&&"type"===e.exportKind||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";const t=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(t)}if(this.isContextual(131)){e.exportKind="type";const t=this.startNode();return this.next(),this.flowParseOpaqueType(t,!1)}if(this.isContextual(129)){e.exportKind="type";const t=this.startNode();return this.next(),this.flowParseInterface(t)}if(this.isContextual(126)){e.exportKind="value";const t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}return super.parseExportDeclaration(e)}eatExportStar(e){return!!super.eatExportStar(e)||!(!this.isContextual(130)||55!==this.lookahead().type)&&(e.exportKind="type",this.next(),this.next(),!0)}maybeParseExportNamespaceSpecifier(e){const{startLoc:t}=this.state,s=super.maybeParseExportNamespaceSpecifier(e);return s&&"type"===e.exportKind&&this.unexpected(t),s}parseClassId(e,t,s){super.parseClassId(e,t,s),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,t,s){const{startLoc:i}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,t))return;t.declare=!0}super.parseClassMember(e,t,s),t.declare&&("ClassProperty"!==t.type&&"ClassPrivateProperty"!==t.type&&"PropertyDefinition"!==t.type?this.raise(at.DeclareClassElement,i):t.value&&this.raise(at.DeclareClassFieldInitializer,t.value))}isIterator(e){return"iterator"===e||"asyncIterator"===e}readIterator(){const e=super.readWord1(),t="@@"+e;this.isIterator(e)&&this.state.inType||this.raise(v.InvalidIdentifier,this.state.curPosition(),{identifierName:t}),this.finishToken(132,t)}getTokenFromCode(e){const t=this.input.charCodeAt(this.state.pos+1);123===e&&124===t?this.finishOp(6,2):!this.state.inType||62!==e&&60!==e?this.state.inType&&63===e?46===t?this.finishOp(18,2):this.finishOp(17,1):function(e,t,s){return 64===e&&64===t&&se(s)}(e,t,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e):this.finishOp(62===e?48:47,1)}isAssignable(e,t){return"TypeCastExpression"===e.type?this.isAssignable(e.expression,t):super.isAssignable(e,t)}toAssignable(e,t=!1){t||"AssignmentExpression"!==e.type||"TypeCastExpression"!==e.left.type||(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t)}toAssignableList(e,t,s){for(let t=0;t1)&&t||this.raise(at.TypeCastInPattern,r.typeAnnotation)}return e}parseArrayLike(e,t,s,i){const r=super.parseArrayLike(e,t,s,i);return t&&!this.state.maybeInArrowParameters&&this.toReferencedList(r.elements),r}isValidLVal(e,t,s){return"TypeCastExpression"===e||super.isValidLVal(e,t,s)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,t,s,i,r,a){if(t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,t,s,i,r,a),t.params&&r){const e=t.params;e.length>0&&this.isThisParam(e[0])&&this.raise(at.ThisParamBannedInConstructor,t)}else if("MethodDefinition"===t.type&&r&&t.value.params){const e=t.value.params;e.length>0&&this.isThisParam(e[0])&&this.raise(at.ThisParamBannedInConstructor,t)}}pushClassPrivateMethod(e,t,s,i){t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,s,i)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();const t=e.implements=[];do{const e=this.startNode();e.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,t.push(this.finishNode(e,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);const t=this.getObjectOrClassMethodParams(e);if(t.length>0){const s=t[0];this.isThisParam(s)&&"get"===e.kind?this.raise(at.GetterMayNotHaveThisParam,s):this.isThisParam(s)&&this.raise(at.SetterMayNotHaveThisParam,s)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,t,s,i,r,a,n){let o;e.variance&&this.unexpected(e.variance.loc.start),delete e.variance,this.match(47)&&!a&&(o=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());const l=super.parseObjPropValue(e,t,s,i,r,a,n);return o&&((l.value||l).typeParameters=o),l}parseFunctionParamType(e){return this.eat(17)&&("Identifier"!==e.type&&this.raise(at.PatternIsOptional,e),this.isThisParam(e)&&this.raise(at.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(at.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(at.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,t){const s=super.parseMaybeDefault(e,t);return"AssignmentPattern"===s.type&&s.typeAnnotation&&s.right.startsuper.parseMaybeAssign(e,t),r)).error)return i.node;const{context:s}=this.state,a=s[s.length-1];a!==T.j_oTag&&a!==T.j_expr||s.pop()}if(null!=(s=i)&&s.error||this.match(47)){var a,n;let s;r=r||this.state.clone();const o=this.tryParse(i=>{var r;s=this.flowParseTypeParameterDeclaration();const a=this.forwardNoArrowParamsConversionAt(s,()=>{const i=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(i,s),i});null!=(r=a.extra)&&r.parenthesized&&i();const n=this.maybeUnwrapTypeCastExpression(a);return"ArrowFunctionExpression"!==n.type&&i(),n.typeParameters=s,this.resetStartLocationFromNode(n,s),a},r);let l=null;if(o.node&&"ArrowFunctionExpression"===this.maybeUnwrapTypeCastExpression(o.node).type){if(!o.error&&!o.aborted)return o.node.async&&this.raise(at.UnexpectedTypeParameterBeforeAsyncArrowFunction,s),o.node;l=o.node}if(null!=(a=i)&&a.node)return this.state=i.failState,i.node;if(l)return this.state=o.failState,l;if(null!=(n=i)&&n.thrown)throw i.error;if(o.thrown)throw o.error;throw this.raise(at.UnexpectedTokenAfterTypeParameter,s)}return super.parseMaybeAssign(e,t)}parseArrow(e){if(this.match(14)){const t=this.tryParse(()=>{const t=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;const s=this.startNode();return[s.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=t,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),s});if(t.thrown)return null;t.error&&(this.state=t.failState),e.returnType=t.node.typeAnnotation?this.finishNode(t.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,t){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,s,i=!0){if(!s||!this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))){for(let t=0;t0&&this.raise(at.ThisParamMustBeFirst,e.params[t]);super.checkParams(e,t,s,i)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,t,s){if("Identifier"===e.type&&"async"===e.name&&this.state.noArrowAt.includes(t.index)){this.next();const s=this.startNodeAt(t);s.callee=e,s.arguments=super.parseCallExpressionArguments(11),e=this.finishNode(s,"CallExpression")}else if("Identifier"===e.type&&"async"===e.name&&this.match(47)){const i=this.state.clone(),r=this.tryParse(e=>this.parseAsyncArrowWithTypeParameters(t)||e(),i);if(!r.error&&!r.aborted)return r.node;const a=this.tryParse(()=>super.parseSubscripts(e,t,s),i);if(a.node&&!a.error)return a.node;if(r.node)return this.state=r.failState,r.node;if(a.node)return this.state=a.failState,a.node;throw r.error||a.error}return super.parseSubscripts(e,t,s)}parseSubscript(e,t,s,i){if(this.match(18)&&this.isLookaheadToken_lt()){if(i.optionalChainMember=!0,s)return i.stop=!0,e;this.next();const r=this.startNodeAt(t);return r.callee=e,r.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),r.arguments=this.parseCallExpressionArguments(11),r.optional=!0,this.finishCallExpression(r,!0)}if(!s&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){const s=this.startNodeAt(t);s.callee=e;const r=this.tryParse(()=>(s.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),s.arguments=super.parseCallExpressionArguments(11),i.optionalChainMember&&(s.optional=!1),this.finishCallExpression(s,i.optionalChainMember)));if(r.node)return r.error&&(this.state=r.failState),r.node}return super.parseSubscript(e,t,s,i)}parseNewCallee(e){super.parseNewCallee(e);let t=null;this.shouldParseTypes()&&this.match(47)&&(t=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=t}parseAsyncArrowWithTypeParameters(e){const t=this.startNodeAt(e);if(this.parseFunctionParams(t,!1),this.parseArrow(t))return super.parseArrowExpression(t,void 0,!0)}readToken_mult_modulo(e){const t=this.input.charCodeAt(this.state.pos+1);if(42===e&&47===t&&this.state.hasFlowComment)return this.state.hasFlowComment=!1,this.state.pos+=2,void this.nextToken();super.readToken_mult_modulo(e)}readToken_pipe_amp(e){const t=this.input.charCodeAt(this.state.pos+1);124!==e||125!==t?super.readToken_pipe_amp(e):this.finishOp(9,2)}parseTopLevel(e,t){const s=super.parseTopLevel(e,t);return this.state.hasFlowComment&&this.raise(at.UnterminatedFlowComment,this.state.curPosition()),s}skipBlockComment(){if(!this.hasPlugin("flowComments")||!this.skipFlowComment())return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/");{if(this.state.hasFlowComment)throw this.raise(at.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();const e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0)}}skipFlowComment(){const{pos:e}=this.state;let t=2;for(;[32,9].includes(this.input.charCodeAt(e+t));)t++;const s=this.input.charCodeAt(t+e),i=this.input.charCodeAt(t+e+1);return 58===s&&58===i?t+2:"flow-include"===this.input.slice(t+e,t+e+12)?t+12:58===s&&58!==i&&t}hasFlowCommentCompletion(){if(-1===this.input.indexOf("*/",this.state.pos))throw this.raise(v.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:t,memberName:s}){this.raise(at.EnumBooleanMemberNotInitialized,e,{memberName:s,enumName:t})}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?"symbol"===t.explicitType?at.EnumInvalidMemberInitializerSymbolType:at.EnumInvalidMemberInitializerPrimaryType:at.EnumInvalidMemberInitializerUnknownType,e,t)}flowEnumErrorNumberMemberNotInitialized(e,t){this.raise(at.EnumNumberMemberNotInitialized,e,t)}flowEnumErrorStringMemberInconsistentlyInitialized(e,t){this.raise(at.EnumStringMemberInconsistentlyInitialized,e,t)}flowEnumMemberInit(){const e=this.state.startLoc,t=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{const s=this.parseNumericLiteral(this.state.value);return t()?{type:"number",loc:s.loc.start,value:s}:{type:"invalid",loc:e}}case 134:{const s=this.parseStringLiteral(this.state.value);return t()?{type:"string",loc:s.loc.start,value:s}:{type:"invalid",loc:e}}case 85:case 86:{const s=this.parseBooleanLiteral(this.match(85));return t()?{type:"boolean",loc:s.loc.start,value:s}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){const e=this.state.startLoc;return{id:this.parseIdentifier(!0),init:this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e}}}flowEnumCheckExplicitTypeMismatch(e,t,s){const{explicitType:i}=t;null!==i&&i!==s&&this.flowEnumErrorInvalidMemberInitializer(e,t)}flowEnumMembers({enumName:e,explicitType:t}){const s=new Set,i={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]};let r=!1;for(;!this.match(8);){if(this.eat(21)){r=!0;break}const a=this.startNode(),{id:n,init:o}=this.flowEnumMemberRaw(),l=n.name;if(""===l)continue;/^[a-z]/.test(l)&&this.raise(at.EnumInvalidMemberName,n,{memberName:l,suggestion:l[0].toUpperCase()+l.slice(1),enumName:e}),s.has(l)&&this.raise(at.EnumDuplicateMemberName,n,{memberName:l,enumName:e}),s.add(l);const c={enumName:e,explicitType:t,memberName:l};switch(a.id=n,o.type){case"boolean":this.flowEnumCheckExplicitTypeMismatch(o.loc,c,"boolean"),a.init=o.value,i.booleanMembers.push(this.finishNode(a,"EnumBooleanMember"));break;case"number":this.flowEnumCheckExplicitTypeMismatch(o.loc,c,"number"),a.init=o.value,i.numberMembers.push(this.finishNode(a,"EnumNumberMember"));break;case"string":this.flowEnumCheckExplicitTypeMismatch(o.loc,c,"string"),a.init=o.value,i.stringMembers.push(this.finishNode(a,"EnumStringMember"));break;case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(o.loc,c);case"none":switch(t){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(o.loc,c);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(o.loc,c);break;default:i.defaultedMembers.push(this.finishNode(a,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:i,hasUnknownMembers:r}}flowEnumStringMembers(e,t,{enumName:s}){if(0===e.length)return t;if(0===t.length)return e;if(t.length>e.length){for(const t of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(t,{enumName:s});return t}for(const e of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(e,{enumName:s});return e}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!R(this.state.type))throw this.raise(at.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});const{value:t}=this.state;return this.next(),"boolean"!==t&&"number"!==t&&"string"!==t&&"symbol"!==t&&this.raise(at.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:t}),t}flowEnumBody(e,t){const s=t.name,i=t.loc.start,r=this.flowEnumParseExplicitType({enumName:s});this.expect(5);const{members:a,hasUnknownMembers:n}=this.flowEnumMembers({enumName:s,explicitType:r});switch(e.hasUnknownMembers=n,r){case"boolean":return e.explicitType=!0,e.members=a.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=a.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:s}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=a.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{const t=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;const r=a.booleanMembers.length,n=a.numberMembers.length,o=a.stringMembers.length,l=a.defaultedMembers.length;if(r||n||o||l){if(r||n){if(!n&&!o&&r>=l){for(const e of a.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(e.loc.start,{enumName:s,memberName:e.id.name});return e.members=a.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}if(!r&&!o&&n>=l){for(const e of a.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(e.loc.start,{enumName:s,memberName:e.id.name});return e.members=a.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}return this.raise(at.EnumInconsistentMemberValues,i,{enumName:s}),t()}return e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:s}),this.expect(8),this.finishNode(e,"EnumStringBody")}return t()}}}flowParseEnumDeclaration(e){const t=this.parseIdentifier();return e.id=t,e.body=this.flowEnumBody(this.startNode(),t),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){const e=this.nextTokenStart();if(60===this.input.charCodeAt(e)){const t=this.input.charCodeAt(e+1);return 60!==t&&61!==t}return!1}reScan_lt_gt(){const{type:e}=this.state;47===e?(this.state.pos-=1,this.readToken_lt()):48===e&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){const{type:e}=this.state;return 51===e?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return"TypeCastExpression"===e.type?e.expression:e}}),typescript:e=>(class extends e{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:vt.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:vt.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:vt.InvalidModifierOnTypeParameter})}getScopeHandler(){return ft}tsIsIdentifier(){return R(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),!this.hasPrecedingLineBreak()&&this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,t){if(!R(this.state.type)&&58!==this.state.type&&75!==this.state.type)return;const s=this.state.value;if(e.includes(s)){if(t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return s}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:t,stopOnStartOfClassStaticBlock:s,errorTemplate:i=vt.InvalidModifierOnTypeMember},r){const a=(e,t,s,i)=>{t===s&&r[i]&&this.raise(vt.InvalidModifiersOrder,e,{orderedModifiers:[s,i]})},n=(e,t,s,i)=>{(r[s]&&t===i||r[i]&&t===s)&&this.raise(vt.IncompatibleModifiers,e,{modifiers:[s,i]})};for(;;){const{startLoc:o}=this.state,l=this.tsParseModifier(e.concat(null!=t?t:[]),s);if(!l)break;bt(l)?r.accessibility?this.raise(vt.DuplicateAccessibilityModifier,o,{modifier:l}):(a(o,l,l,"override"),a(o,l,l,"static"),a(o,l,l,"readonly"),r.accessibility=l):"in"===(l=l)||"out"===l?(r[l]&&this.raise(vt.DuplicateModifier,o,{modifier:l}),r[l]=!0,a(o,l,"in","out")):(hasOwnProperty.call(r,l)?this.raise(vt.DuplicateModifier,o,{modifier:l}):(a(o,l,"static","readonly"),a(o,l,"static","override"),a(o,l,"override","readonly"),a(o,l,"abstract","override"),n(o,l,"declare","override"),n(o,l,"static","abstract")),r[l]=!0),null!=t&&t.includes(l)&&this.raise(i,o,{modifier:l})}var o}tsIsListTerminator(e){switch(e){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(e,t){const s=[];for(;!this.tsIsListTerminator(e);)s.push(t());return s}tsParseDelimitedList(e,t,s){return function(e){if(null==e)throw new Error(`Unexpected ${e} value.`);return e}(this.tsParseDelimitedListWorker(e,t,!0,s))}tsParseDelimitedListWorker(e,t,s,i){const r=[];let a=-1;for(;!this.tsIsListTerminator(e);){a=-1;const i=t();if(null==i)return;if(r.push(i),!this.eat(12)){if(this.tsIsListTerminator(e))break;return void(s&&this.expect(12))}a=this.state.lastTokStartLoc.index}return i&&(i.value=a),r}tsParseBracketedList(e,t,s,i,r){i||(s?this.expect(0):this.expect(47));const a=this.tsParseDelimitedList(e,t,r);return s?this.expect(3):this.expect(48),a}tsParseImportType(){const e=this.startNode();return this.expect(83),this.expect(10),this.match(134)?e.argument=this.parseStringLiteral(this.state.value):(this.raise(vt.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom()),this.eat(12)&&!this.match(11)?(e.options=super.parseMaybeAssignAllowIn(),this.eat(12)):e.options=null,this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName(3)),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e){let t;if(1&e&&this.match(78))if(2&e)t=this.parseIdentifier(!0);else{const e=this.startNode();this.next(),t=this.finishNode(e,"ThisExpression")}else t=this.parseIdentifier(!!(1&e));for(;this.eat(16);){const s=this.startNodeAtNode(t);s.left=t,s.right=this.parseIdentifier(!!(1&e)),t=this.finishNode(s,"TSQualifiedName")}return t}tsParseTypeReference(){const e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();const t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,"TSTypePredicate")}tsParseThisTypeNode(){const e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){const e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(3),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){const t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(81),t.default=this.tsEatThenParseType(29),this.finishNode(t,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){const t=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();const s={value:-1};return t.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,s),0===t.params.length&&this.raise(vt.EmptyTypeParameters,t),-1!==s.value&&this.addExtra(t,"trailingComma",s.value),this.finishNode(t,"TSTypeParameterDeclaration")}tsFillSignature(e,t){const s=19===e;t.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),t.parameters=this.tsParseBindingListForSignature(),s?t.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(t.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){const e=super.parseBindingList(11,41,2);for(const t of e){const{type:e}=t;"AssignmentPattern"!==e&&"TSParameterProperty"!==e||this.raise(vt.UnsupportedSignatureParameterKind,t,{type:e})}return e}tsParseTypeMemberSemicolon(){this.eat(12)||this.isLineTerminator()||this.expect(13)}tsParseSignatureMember(e,t){return this.tsFillSignature(14,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),!!R(this.state.type)&&(this.next(),this.match(14))}tsTryParseIndexSignature(e){if(!this.match(0)||!this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))return;this.expect(0);const t=this.parseIdentifier();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(3),e.parameters=[t];const s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,t){this.eat(17)&&(e.optional=!0);const s=e;if(this.match(10)||this.match(47)){t&&this.raise(vt.ReadonlyForMethodSignature,e);const i=s;i.kind&&this.match(47)&&this.raise(vt.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon();const r="parameters",a="typeAnnotation";if("get"===i.kind)i[r].length>0&&(this.raise(v.BadGetterArity,this.state.curPosition()),this.isThisParam(i[r][0])&&this.raise(vt.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if("set"===i.kind){if(1!==i[r].length)this.raise(v.BadSetterArity,this.state.curPosition());else{const e=i[r][0];this.isThisParam(e)&&this.raise(vt.AccessorCannotDeclareThisParameter,this.state.curPosition()),"Identifier"===e.type&&e.optional&&this.raise(vt.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),"RestElement"===e.type&&this.raise(vt.SetAccessorCannotHaveRestParameter,this.state.curPosition())}i[a]&&this.raise(vt.SetAccessorCannotHaveReturnType,i[a])}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}{const e=s;t&&(e.readonly=!0);const i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSPropertySignature")}}tsParseTypeMember(){const e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){const t=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(t,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);const t=this.tsTryParseIndexSignature(e);return t||(super.parsePropertyName(e),e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||!this.tsTokenCanFollowModifier()||(e.kind=e.key.name,super.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){const e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);const e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!!this.match(0)&&(this.next(),!!this.tsIsIdentifier()&&(this.next(),this.match(58))))}tsParseMappedType(){const e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);{const t=this.startNode();t.name=this.tsParseTypeParameterName(),t.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(t,"TSTypeParameter")}return e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){const e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let t=!1;return e.elementTypes.forEach(e=>{const{type:s}=e;!t||"TSRestType"===s||"TSOptionalType"===s||"TSNamedTupleMember"===s&&e.optional||this.raise(vt.OptionalTypeBeforeRequired,e),t||(t="TSNamedTupleMember"===s&&e.optional||"TSOptionalType"===s)}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){const e=this.state.startLoc,t=this.eat(21),{startLoc:s}=this.state;let i,r,a,n;const o=U(this.state.type)?this.lookaheadCharCode():null;if(58===o)i=!0,a=!1,r=this.parseIdentifier(!0),this.expect(14),n=this.tsParseType();else if(63===o){a=!0;const e=this.state.value,t=this.tsParseNonArrayType();58===this.lookaheadCharCode()?(i=!0,r=this.createIdentifier(this.startNodeAt(s),e),this.expect(17),this.expect(14),n=this.tsParseType()):(i=!1,n=t,this.expect(17))}else n=this.tsParseType(),a=this.eat(17),i=this.eat(14);if(i){let e;r?((e=this.startNodeAt(s)).optional=a,e.label=r,e.elementType=n,this.eat(17)&&(e.optional=!0,this.raise(vt.TupleOptionalAfterType,this.state.lastTokStartLoc))):((e=this.startNodeAt(s)).optional=a,this.raise(vt.InvalidTupleMemberLabel,n),e.label=n,e.elementType=this.tsParseType()),n=this.finishNode(e,"TSNamedTupleMember")}else if(a){const e=this.startNodeAt(s);e.typeAnnotation=n,n=this.finishNode(e,"TSOptionalType")}if(t){const t=this.startNodeAt(e);t.typeAnnotation=n,n=this.finishNode(t,"TSRestType")}return n}tsParseParenthesizedType(){const e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,t){const s=this.startNode();return"TSConstructorType"===e&&(s.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,s)),this.finishNode(s,e)}tsParseLiteralTypeNode(){const e=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){{const e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){const e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if("-"===this.state.value){const e=this.startNode(),t=this.lookahead();return 135!==t.type&&136!==t.type&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"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:{const{type:e}=this.state;if(R(e)||88===e||84===e){const t=88===e?"TSVoidKeyword":84===e?"TSNullKeyword":function(e){switch(e){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}(this.state.value);if(void 0!==t&&46!==this.lookaheadCharCode()){const e=this.startNode();return this.next(),this.finishNode(e,t)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){const{startLoc:e}=this.state;let t=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){const s=this.startNodeAt(e);s.elementType=t,this.expect(3),t=this.finishNode(s,"TSArrayType")}else{const s=this.startNodeAt(e);s.objectType=t,s.indexType=this.tsParseType(),this.expect(3),t=this.finishNode(s,"TSIndexedAccessType")}return t}tsParseTypeOperator(){const e=this.startNode(),t=this.state.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),"readonly"===t&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(vt.UnexpectedReadonly,e)}}tsParseInferType(){const e=this.startNode();this.expectContextual(115);const t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){const e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){var e;return(e=this.state.type)>=121&&e<=123&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,t,s){const i=this.startNode(),r=this.eat(s),a=[];do{a.push(t())}while(this.eat(s));return 1!==a.length||r?(i.types=a,this.finishNode(i,e)):a[0]}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return!!this.match(47)||this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(R(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){const{errors:e}=this.state,t=e.length;try{return this.parseObjectLike(8,!0),e.length===t}catch(e){return!1}}if(this.match(0)){this.next();const{errors:e}=this.state,t=e.length;try{return super.parseBindingList(3,93,1),e.length===t}catch(e){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)&&(this.next(),this.match(19)))return!0}return!1}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{const t=this.startNode();this.expect(e);const s=this.startNode(),i=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(i&&this.match(78)){let e=this.tsParseThisTypeOrThisTypePredicate();return"TSThisType"===e.type?(s.parameterName=e,s.asserts=!0,s.typeAnnotation=null,e=this.finishNode(s,"TSTypePredicate")):(this.resetStartLocationFromNode(e,s),e.asserts=!0),t.typeAnnotation=e,this.finishNode(t,"TSTypeAnnotation")}const r=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!r)return i?(s.parameterName=this.parseIdentifier(),s.asserts=i,s.typeAnnotation=null,t.typeAnnotation=this.finishNode(s,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,t);const a=this.tsParseTypeAnnotation(!1);return s.parameterName=r,s.typeAnnotation=a,s.asserts=i,t.typeAnnotation=this.finishNode(s,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){const e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(109!==this.state.type)return!1;const e=this.state.containsEsc;return this.next(),!(!R(this.state.type)&&!this.match(78)||(e&&this.raise(v.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),0))}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,"TSTypeAnnotation")}tsParseType(){gt(this.state.inType);const e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;const t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&77===this.lookahead().type}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(vt.ReservedTypeAssertion,this.state.startLoc);const e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){const t=this.state.startLoc,s=this.tsParseDelimitedList("HeritageClauseElement",()=>{{const e=this.startNode();return e.expression=this.tsParseEntityName(3),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSExpressionWithTypeArguments")}});return s.length||this.raise(vt.EmptyHeritageClauseType,t,{token:e}),s}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),t.declare&&(e.declare=!0),R(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(vt.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));const s=this.startNode();return s.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(s,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&16!==this.lookahead().type){const e=this.startNode();return this.next(),this.finishNode(e,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInTopLevelContext(e){if(this.curContext()===T.brace)return e();{const t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}}tsInType(e){const t=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=t}}tsInDisallowConditionalTypesContext(e){const t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsInAllowConditionalTypesContext(e){const t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){const e=this.startNode();return e.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,t={}){return t.const&&(e.const=!0),t.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseEnumBody(){const e=this.startNode();return this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumBody")}tsParseModuleBlock(){const e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,t=!1){if(e.id=this.parseIdentifier(),t||this.checkIdentifier(e.id,1024),this.eat(16)){const t=this.startNode();this.tsParseModuleOrNamespaceDeclaration(t,!0),e.body=t}else this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.kind="global",e.global=!0,e.id=this.parseIdentifier()):this.match(134)?(e.kind="module",e.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,t,s){e.isExport=s||!1,e.id=t||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);const i=this.tsParseModuleReference();return"type"===e.importKind&&"TSExternalModuleReference"!==i.type&&this.raise(vt.ImportAliasHasImportType,i),e.moduleReference=i,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&40===this.lookaheadCharCode()}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){const e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){const t=this.state.clone(),s=e();return this.state=t,s}tsTryParseAndCatch(e){const t=this.tryParse(t=>e()||t());if(!t.aborted&&t.node)return t.error&&(this.state=t.failState),t.node}tsTryParse(e){const t=this.state.clone(),s=e();if(void 0!==s&&!1!==s)return s;this.state=t}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t,s=this.state.type;return this.isContextual(100)&&(s=74,t="let"),this.tsInAmbientContext(()=>{switch(s){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return this.match(75)&&this.isLookaheadContextual("enum")?(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0})):(e.declare=!0,this.parseVarStatement(e,t||this.state.value,!0));case 129:{const t=this.tsParseInterfaceDeclaration(e,{declare:!0});if(t)return t}default:if(R(s))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,t,s){switch(t.name){case"declare":{const t=this.tsTryParseDeclare(e);return t&&(t.declare=!0),t}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);const s=e;return s.kind="global",e.global=!0,s.id=t,s.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(s,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,t.name,!1,s)}}tsParseDeclaration(e,t,s,i){switch(t){case"abstract":if(this.tsCheckLineTerminator(s)&&(this.match(80)||R(this.state.type)))return this.tsParseAbstractDeclaration(e,i);break;case"module":if(this.tsCheckLineTerminator(s)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(e);if(R(this.state.type))return e.kind="module",this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(s)&&R(this.state.type))return e.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(s)&&R(this.state.type))return this.tsParseTypeAliasDeclaration(e)}}tsCheckLineTerminator(e){return e?!this.hasFollowingLineBreak()&&(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;const t=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;const s=this.tsTryParseAndCatch(()=>{const t=this.startNodeAt(e);return t.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(t),t.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),t});return this.state.maybeInArrowParameters=t,s?super.parseArrowExpression(s,null,!0):void 0}tsParseTypeArgumentsInExpression(){if(47===this.reScan_lt())return this.tsParseTypeArguments()}tsParseTypeArguments(){const e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),0===e.params.length?this.raise(vt.EmptyTypeArguments,e):this.state.inType||this.curContext()!==T.brace||this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return(e=this.state.type)>=124&&e<=130;var e}isExportDefaultSpecifier(){return!this.tsIsDeclarationStart()&&super.isExportDefaultSpecifier()}parseBindingElement(e,t){const s=this.state.startLoc,i={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},i);const r=i.accessibility,a=i.override,n=i.readonly;4&e||!(r||n||a)||this.raise(vt.UnexpectedParameterModifier,s);const o=this.parseMaybeDefault();2&e&&this.parseFunctionParamType(o);const l=this.parseMaybeDefault(o.loc.start,o);if(r||n||a){const e=this.startNodeAt(s);return t.length&&(e.decorators=t),r&&(e.accessibility=r),n&&(e.readonly=n),a&&(e.override=a),"Identifier"!==l.type&&"AssignmentPattern"!==l.type&&this.raise(vt.UnsupportedParameterPropertyKind,e),e.parameter=l,this.finishNode(e,"TSParameterProperty")}return t.length&&(o.decorators=t),l}isSimpleParameter(e){return"TSParameterProperty"===e.type&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(const t of e.params)"Identifier"!==t.type&&t.optional&&!this.state.isAmbientContext&&this.raise(vt.PatternIsOptional,t)}setArrowFunctionParameters(e,t,s){super.setArrowFunctionParameters(e,t,s),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,t,s=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));const i="FunctionDeclaration"===t?"TSDeclareFunction":"ClassMethod"===t||"ClassPrivateMethod"===t?"TSDeclareMethod":void 0;return i&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,i):"TSDeclareFunction"===i&&this.state.isAmbientContext&&(this.raise(vt.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,i,s):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,t,s))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(e=>{"TSTypeCastExpression"===(null==e?void 0:e.type)&&this.raise(vt.UnexpectedTypeAnnotation,e.typeAnnotation)})}toReferencedList(e,t){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,t,s,i){const r=super.parseArrayLike(e,t,s,i);return"ArrayExpression"===r.type&&this.tsCheckForInvalidTypeCasts(r.elements),r}parseSubscript(e,t,s,i){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();const s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"TSNonNullExpression")}let r=!1;if(this.match(18)&&60===this.lookaheadCharCode()){if(s)return i.stop=!0,e;i.optionalChainMember=r=!0,this.next()}if(this.match(47)||this.match(51)){let a;const n=this.tsTryParseAndCatch(()=>{if(!s&&this.atPossibleAsyncArrow(e)){const e=this.tsTryParseGenericAsyncArrowFunction(t);if(e)return e}const n=this.tsParseTypeArgumentsInExpression();if(!n)return;if(r&&!this.match(10))return void(a=this.state.curPosition());if(W(this.state.type)){const s=super.parseTaggedTemplateExpression(e,t,i);return s.typeParameters=n,s}if(!s&&this.eat(10)){const s=this.startNodeAt(t);return s.callee=e,s.arguments=this.parseCallExpressionArguments(11),this.tsCheckForInvalidTypeCasts(s.arguments),s.typeParameters=n,i.optionalChainMember&&(s.optional=r),this.finishCallExpression(s,i.optionalChainMember)}const o=this.state.type;if(48===o||52===o||10!==o&&z(o)&&!this.hasPrecedingLineBreak())return;const l=this.startNodeAt(t);return l.expression=e,l.typeParameters=n,this.finishNode(l,"TSInstantiationExpression")});if(a&&this.unexpected(a,10),n)return"TSInstantiationExpression"===n.type&&(this.match(16)||this.match(18)&&40!==this.lookaheadCharCode())&&this.raise(vt.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),n}return super.parseSubscript(e,t,s,i)}parseNewCallee(e){var t;super.parseNewCallee(e);const{callee:s}=e;"TSInstantiationExpression"!==s.type||null!=(t=s.extra)&&t.parenthesized||(e.typeParameters=s.typeParameters,e.callee=s.expression)}parseExprOp(e,t,s){let i;if(H(58)>s&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(i=this.isContextual(120)))){const r=this.startNodeAt(t);return r.expression=e,r.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(i&&this.raise(v.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(r,i?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(r,t,s)}return super.parseExprOp(e,t,s)}checkReservedWord(e,t,s,i){this.state.isAmbientContext||super.checkReservedWord(e,t,s,i)}checkImportReflection(e){super.checkImportReflection(e),e.module&&"value"!==e.importKind&&this.raise(vt.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){const t=this.lookaheadCharCode();return e?123===t||42===t:61!==t}return!e&&this.isContextual(87)}applyImportPhase(e,t,s,i){super.applyImportPhase(e,t,s,i),t?e.exportKind="type"===s?"type":"value":e.importKind="type"===s||"typeof"===s?s:"value"}parseImport(e){if(this.match(134))return e.importKind="value",super.parseImport(e);let t;if(R(this.state.type)&&61===this.lookaheadCharCode())return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){const s=this.parseMaybeImportPhase(e,!1);if(61===this.lookaheadCharCode())return this.tsParseImportEqualsDeclaration(e,s);t=super.parseImportSpecifiersAndAfter(e,s)}else t=super.parseImport(e);return"type"===t.importKind&&t.specifiers.length>1&&"ImportDefaultSpecifier"===t.specifiers[0].type&&this.raise(vt.TypeImportCannotSpecifyDefaultAndNamed,t),t}parseExport(e,t){if(this.match(83)){const t=e;this.next();let s=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?s=this.parseMaybeImportPhase(t,!1):t.importKind="value",this.tsParseImportEqualsDeclaration(t,s,!0)}if(this.eat(29)){const t=e;return t.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(t,"TSExportAssignment")}if(this.eatContextual(93)){const t=e;return this.expectContextual(128),t.id=this.parseIdentifier(),this.semicolon(),this.finishNode(t,"TSNamespaceExportDeclaration")}return super.parseExport(e,t)}isAbstractClass(){return this.isContextual(124)&&80===this.lookahead().type}parseExportDefaultExpression(){if(this.isAbstractClass()){const e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){const e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,t,s=!1){const{isAmbientContext:i}=this.state,r=super.parseVarStatement(e,t,s||i);if(!i)return r;for(const{id:e,init:s}of r.declarations)s&&("const"!==t||e.typeAnnotation?this.raise(vt.InitializerNotAllowedInAmbientContext,s):_t(s,this.hasPlugin("estree"))||this.raise(vt.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,s));return r}parseStatementContent(e,t){if(this.match(75)&&this.isLookaheadContextual("enum")){const e=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(e,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){const e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,t){return t.some(t=>bt(t)?e.accessibility===t:!!e[t])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&123===this.lookaheadCharCode()}parseClassMember(e,t,s){const i=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:i,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:vt.InvalidModifierOnTypeParameterPositions},t);const r=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,i)&&this.raise(vt.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,t)):this.parseClassMemberWithIsStatic(e,t,s,!!t.static)};t.declare?this.tsInAmbientContext(r):r()}parseClassMemberWithIsStatic(e,t,s,i){const r=this.tsTryParseIndexSignature(t);if(r)return e.body.push(r),t.abstract&&this.raise(vt.IndexSignatureHasAbstract,t),t.accessibility&&this.raise(vt.IndexSignatureHasAccessibility,t,{modifier:t.accessibility}),t.declare&&this.raise(vt.IndexSignatureHasDeclare,t),void(t.override&&this.raise(vt.IndexSignatureHasOverride,t));!this.state.inAbstractClass&&t.abstract&&this.raise(vt.NonAbstractClassHasAbstractMethod,t),t.override&&(s.hadSuperClass||this.raise(vt.OverrideNotInSubClass,t)),super.parseClassMemberWithIsStatic(e,t,s,i)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(vt.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(vt.ClassMethodHasDeclare,e)}parseExpressionStatement(e,t,s){return("Identifier"===t.type?this.tsParseExpressionStatement(e,t,s):void 0)||super.parseExpressionStatement(e,t,s)}shouldParseExportDeclaration(){return!!this.tsIsDeclarationStart()||super.shouldParseExportDeclaration()}parseConditional(e,t,s){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){const t=this.lookaheadCharCode();if(44===t||61===t||58===t||41===t)return this.setOptionalParametersError(s),e}return super.parseConditional(e,t,s)}parseParenItem(e,t){const s=super.parseParenItem(e,t);if(this.eat(17)&&(s.optional=!0,this.resetEndLocation(e)),this.match(14)){const s=this.startNodeAt(t);return s.expression=e,s.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(s,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));const t=this.state.startLoc,s=this.eatContextual(125);if(s&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(vt.ExpectedAmbientAfterExportDeclare,this.state.startLoc);const i=R(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return i?(("TSInterfaceDeclaration"===i.type||"TSTypeAliasDeclaration"===i.type||s)&&(e.exportKind="type"),s&&"TSImportEqualsDeclaration"!==i.type&&(this.resetStartLocation(i,t),i.declare=!0),i):null}parseClassId(e,t,s,i){if((!t||s)&&this.isContextual(113))return;super.parseClassId(e,t,s,e.declare?1024:8331);const r=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);r&&(e.typeParameters=r)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));const t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&(!e.readonly||e.typeAnnotation)&&this.match(29)&&this.raise(vt.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){const{key:t}=e;this.raise(vt.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:"Identifier"!==t.type||e.computed?`[${this.input.slice(this.offsetToSourcePos(t.start),this.offsetToSourcePos(t.end))}]`:t.name})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(vt.PrivateElementHasAbstract,e),e.accessibility&&this.raise(vt.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(vt.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,s,i,r,a){const n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&r&&this.raise(vt.ConstructorHasTypeParameters,n);const{declare:o=!1,kind:l}=t;!o||"get"!==l&&"set"!==l||this.raise(vt.DeclareAccessor,t,{kind:l}),n&&(t.typeParameters=n),super.pushClassMethod(e,t,s,i,r,a)}pushClassPrivateMethod(e,t,s,i){const r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(t.typeParameters=r),super.pushClassPrivateMethod(e,t,s,i)}declareClassPrivateMethodInScope(e,t){"TSDeclareMethod"!==e.type&&("MethodDefinition"!==e.type||hasOwnProperty.call(e.value,"body"))&&super.declareClassPrivateMethodInScope(e,t)}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,t,s,i,r,a,n){const o=this.tsTryParseTypeParameters(this.tsParseConstModifier);return o&&(e.typeParameters=o),super.parseObjPropValue(e,t,s,i,r,a,n)}parseFunctionParams(e,t){const s=this.tsTryParseTypeParameters(this.tsParseConstModifier);s&&(e.typeParameters=s),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),"Identifier"===e.id.type&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);const s=this.tsTryParseTypeAnnotation();s&&(e.id.typeAnnotation=s,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,t)}parseMaybeAssign(e,t){var s,i,r,a,n;let o,l,c,p;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(o=this.state.clone(),!(l=this.tryParse(()=>super.parseMaybeAssign(e,t),o)).error)return l.node;const{context:s}=this.state,i=s[s.length-1];i!==T.j_oTag&&i!==T.j_expr||s.pop()}if(!(null!=(s=l)&&s.error||this.match(47)))return super.parseMaybeAssign(e,t);o&&o!==this.state||(o=this.state.clone());const h=this.tryParse(s=>{var i,r;p=this.tsParseTypeParameters(this.tsParseConstModifier);const a=super.parseMaybeAssign(e,t);return("ArrowFunctionExpression"!==a.type||null!=(i=a.extra)&&i.parenthesized)&&s(),0!==(null==(r=p)?void 0:r.params.length)&&this.resetStartLocationFromNode(a,p),a.typeParameters=p,a},o);if(!h.error&&!h.aborted)return p&&this.reportReservedArrowTypeParam(p),h.node;if(!l&&(gt(!this.hasPlugin("jsx")),!(c=this.tryParse(()=>super.parseMaybeAssign(e,t),o)).error))return c.node;if(null!=(i=l)&&i.node)return this.state=l.failState,l.node;if(h.node)return this.state=h.failState,p&&this.reportReservedArrowTypeParam(p),h.node;if(null!=(r=c)&&r.node)return this.state=c.failState,c.node;throw(null==(a=l)?void 0:a.error)||h.error||(null==(n=c)?void 0:n.error)}reportReservedArrowTypeParam(e){var t;1!==e.params.length||e.params[0].constraint||null!=(t=e.extra)&&t.trailingComma||!this.getPluginOption("typescript","disallowAmbiguousJSXLike")||this.raise(vt.ReservedArrowTypeParam,e)}parseMaybeUnary(e,t){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,t)}parseArrow(e){if(this.match(14)){const t=this.tryParse(e=>{const t=this.tsParseTypeOrTypePredicateAnnotation(14);return!this.canInsertSemicolon()&&this.match(19)||e(),t});if(t.aborted)return;t.thrown||(t.error&&(this.state=t.failState),e.returnType=t.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);const t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,t);case"TSParameterProperty":return!0;default:return super.isAssignable(e,t)}}toAssignable(e,t=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,t);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":t?this.expressionScope.recordArrowParameterBindingError(vt.UnexpectedTypeCastInParameter,e):this.raise(vt.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,t);break;case"AssignmentExpression":t||"TSTypeCastExpression"!==e.left.type||(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,t)}}toAssignableParenthesizedExpression(e,t){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,t);break;default:super.toAssignable(e,t)}}checkToRestConversion(e,t){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,t)}}isValidLVal(e,t,s){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(64!==s||!t)&&["expression",!0];default:return super.isValidLVal(e,t,s)}}parseBindingAtom(){return 78===this.state.type?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,t){if(this.match(47)||this.match(51)){const s=this.tsParseTypeArgumentsInExpression();if(this.match(10)){const i=super.parseMaybeDecoratorArguments(e,t);return i.typeParameters=s,i}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e,t)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,t){const s=super.parseMaybeDefault(e,t);return"AssignmentPattern"===s.type&&s.typeAnnotation&&s.right.startthis.isAssignable(e,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){const t=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());t&&(e.typeParameters=t)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){const t=super.getGetterSetterExpectedParamCount(e),s=this.getObjectOrClassMethodParams(e)[0];return s&&this.isThisParam(s)?t+1:t}parseCatchClauseParam(){const e=super.parseCatchClauseParam(),t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t,this.resetEndLocation(e)),e}tsInAmbientContext(e){const{isAmbientContext:t,strict:s}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=t,this.state.strict=s}}parseClass(e,t,s){const i=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,t,s)}finally{this.state.inAbstractClass=i}}tsParseAbstractDeclaration(e,t){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(t,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(vt.NonClassMethodPropertyHasAbstractModifer,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,t,s,i,r,a,n){const o=super.parseMethod(e,t,s,i,r,a,n);if(o.abstract&&(this.hasPlugin("estree")?o.value:o).body){const{key:e}=o;this.raise(vt.AbstractMethodHasImplementation,o,{methodName:"Identifier"!==e.type||o.computed?`[${this.input.slice(this.offsetToSourcePos(e.start),this.offsetToSourcePos(e.end))}]`:e.name})}return o}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,t,s,i){return!t&&i?(this.parseTypeOnlyImportExportSpecifier(e,!1,s),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,t,s,i))}parseImportSpecifier(e,t,s,i,r){return!t&&i?(this.parseTypeOnlyImportExportSpecifier(e,!0,s),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,t,s,i,s?4098:4096))}parseTypeOnlyImportExportSpecifier(e,t,s){const i=t?"imported":"local",r=t?"local":"exported";let a,n=e[i],o=!1,l=!0;const c=n.loc.start;if(this.isContextual(93)){const e=this.parseIdentifier();if(this.isContextual(93)){const s=this.parseIdentifier();U(this.state.type)?(o=!0,n=e,a=t?this.parseIdentifier():this.parseModuleExportName(),l=!1):(a=s,l=!1)}else U(this.state.type)?(l=!1,a=t?this.parseIdentifier():this.parseModuleExportName()):(o=!0,n=e)}else U(this.state.type)&&(o=!0,t?(n=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(n.name,n.loc.start,!0,!0)):n=this.parseModuleExportName());o&&s&&this.raise(t?vt.TypeModifierIsUsedInTypeImports:vt.TypeModifierIsUsedInTypeExports,c),e[i]=n,e[r]=a,e[t?"importKind":"exportKind"]=o?"type":"value",l&&this.eatContextual(93)&&(e[r]=t?this.parseIdentifier():this.parseModuleExportName()),e[r]||(e[r]=tt(e[i])),t&&this.checkIdentifier(e[r],o?4098:4096)}}),v8intrinsic:e=>(class extends e{parseV8Intrinsic(){if(this.match(54)){const e=this.state.startLoc,t=this.startNode();if(this.next(),R(this.state.type)){const e=this.parseIdentifierName(),s=this.createIdentifier(t,e);if(s.type="V8IntrinsicIdentifier",this.match(10))return s}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}}),placeholders:e=>(class extends e{parsePlaceholder(e){if(this.match(133)){const t=this.startNode();return this.next(),this.assertNoSpace(),t.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(t,e)}}finishPlaceholder(e,t){let s=e;return s.expectedNode&&s.type||(s=this.finishNode(s,"Placeholder")),s.expectedNode=t,s}getTokenFromCode(e){37===e&&37===this.input.charCodeAt(this.state.pos+1)?this.finishOp(133,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,t,s,i){void 0!==e&&super.checkReservedWord(e,t,s,i)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,t,s){return"Placeholder"===e||super.isValidLVal(e,t,s)}toAssignable(e,t){e&&"Placeholder"===e.type&&"Expression"===e.expectedNode?e.expectedNode="Pattern":super.toAssignable(e,t)}chStartsBindingIdentifier(e,t){return!!super.chStartsBindingIdentifier(e,t)||133===this.lookahead().type}verifyBreakContinue(e,t){e.label&&"Placeholder"===e.label.type||super.verifyBreakContinue(e,t)}parseExpressionStatement(e,t){var s;if("Placeholder"!==t.type||null!=(s=t.extra)&&s.parenthesized)return super.parseExpressionStatement(e,t);if(this.match(14)){const s=e;return s.label=this.finishPlaceholder(t,"Identifier"),this.next(),s.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(s,"LabeledStatement")}this.semicolon();const i=e;return i.name=t.name,this.finishPlaceholder(i,"Statement")}parseBlock(e,t,s){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,t,s)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,t,s){const i=t?"ClassDeclaration":"ClassExpression";this.next();const r=this.state.strict,a=this.parsePlaceholder("Identifier");if(a){if(!(this.match(81)||this.match(133)||this.match(5))){if(s||!t)return e.id=null,e.body=this.finishPlaceholder(a,"ClassBody"),this.finishNode(e,i);throw this.raise(Tt.ClassNameIsRequired,this.state.startLoc)}e.id=a}else this.parseClassId(e,t,s);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,r),this.finishNode(e,i)}parseExport(e,t){const s=this.parsePlaceholder("Identifier");if(!s)return super.parseExport(e,t);const i=e;if(!this.isContextual(98)&&!this.match(12))return i.specifiers=[],i.source=null,i.declaration=this.finishPlaceholder(s,"Declaration"),this.finishNode(i,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");const r=this.startNode();return r.exported=s,i.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],super.parseExport(i,t)}isExportDefaultSpecifier(){if(this.match(65)){const e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(q(133),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,t){var s;return!(null==(s=e.specifiers)||!s.length)||super.maybeParseExportDefaultSpecifier(e,t)}checkExport(e){const{specifiers:t}=e;null!=t&&t.length&&(e.specifiers=t.filter(e=>"Placeholder"===e.exported.type)),super.checkExport(e),e.specifiers=t}parseImport(e){const t=this.parsePlaceholder("Identifier");if(!t)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(t,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");const s=this.startNodeAtNode(t);return s.local=t,e.specifiers.push(this.finishNode(s,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(Tt.UnexpectedSpace,this.state.lastTokEndLoc)}})},Et=Object.keys(Ct);class St extends yt{checkProto(e,t,s,i){if("SpreadElement"===e.type||this.isObjectMethod(e)||e.computed||e.shorthand)return s;const r=e.key;return"__proto__"===("Identifier"===r.type?r.name:r.value)?t?(this.raise(v.RecordNoProto,r),!0):(s&&(i?null===i.doubleProtoLoc&&(i.doubleProtoLoc=r.loc.start):this.raise(v.DuplicateProto,r)),!0):s}shouldExitDescending(e,t){return"ArrowFunctionExpression"===e.type&&this.offsetToSourcePos(e.start)===t}getExpression(){this.enterInitialScopes(),this.nextToken();const e=this.parseExpression();return this.match(140)||this.unexpected(),this.finalizeRemainingComments(),e.comments=this.comments,e.errors=this.state.errors,256&this.optionFlags&&(e.tokens=this.tokens),e}parseExpression(e,t){return e?this.disallowInAnd(()=>this.parseExpressionBase(t)):this.allowInAnd(()=>this.parseExpressionBase(t))}parseExpressionBase(e){const t=this.state.startLoc,s=this.parseMaybeAssign(e);if(this.match(12)){const i=this.startNodeAt(t);for(i.expressions=[s];this.eat(12);)i.expressions.push(this.parseMaybeAssign(e));return this.toReferencedList(i.expressions),this.finishNode(i,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(e,t){return this.disallowInAnd(()=>this.parseMaybeAssign(e,t))}parseMaybeAssignAllowIn(e,t){return this.allowInAnd(()=>this.parseMaybeAssign(e,t))}setOptionalParametersError(e){e.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(e,t){const s=this.state.startLoc,i=this.isContextual(108);if(i&&this.prodParam.hasYield){this.next();let e=this.parseYield(s);return t&&(e=t.call(this,e,s)),e}let r;e?r=!1:(e=new Qe,r=!0);const{type:a}=this.state;(10===a||R(a))&&(this.state.potentialArrowAt=this.state.start);let n=this.parseMaybeConditional(e);if(t&&(n=t.call(this,n,s)),(o=this.state.type)>=29&&o<=33){const t=this.startNodeAt(s),i=this.state.value;if(t.operator=i,this.match(29)){this.toAssignable(n,!0),t.left=n;const i=s.index;null!=e.doubleProtoLoc&&e.doubleProtoLoc.index>=i&&(e.doubleProtoLoc=null),null!=e.shorthandAssignLoc&&e.shorthandAssignLoc.index>=i&&(e.shorthandAssignLoc=null),null!=e.privateKeyLoc&&e.privateKeyLoc.index>=i&&(this.checkDestructuringPrivate(e),e.privateKeyLoc=null)}else t.left=n;return this.next(),t.right=this.parseMaybeAssign(),this.checkLVal(n,this.finishNode(t,"AssignmentExpression")),t}var o;if(r&&this.checkExpressionErrors(e,!0),i){const{type:e}=this.state;if((this.hasPlugin("v8intrinsic")?z(e):z(e)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(v.YieldNotInGeneratorFunction,s),this.parseYield(s)}return n}parseMaybeConditional(e){const t=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprOps(e);return this.shouldExitDescending(i,s)?i:this.parseConditional(i,t,e)}parseConditional(e,t,s){if(this.eat(17)){const s=this.startNodeAt(t);return s.test=e,s.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),s.alternate=this.parseMaybeAssign(),this.finishNode(s,"ConditionalExpression")}return e}parseMaybeUnaryOrPrivate(e){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(e)}parseExprOps(e){const t=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseMaybeUnaryOrPrivate(e);return this.shouldExitDescending(i,s)?i:this.parseExprOp(i,t,-1)}parseExprOp(e,t,s){if(this.isPrivateName(e)){const t=this.getPrivateNameSV(e);(s>=H(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(v.PrivateInExpectedIn,e,{identifierName:t}),this.classScope.usePrivateName(t,e.loc.start)}const i=this.state.type;if((r=i)>=39&&r<=59&&(this.prodParam.hasIn||!this.match(58))){let r=H(i);if(r>s){if(39===i){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return e;this.checkPipelineAtInfixOperator(e,t)}const a=this.startNodeAt(t);a.left=e,a.operator=this.state.value;const n=41===i||42===i,o=40===i;if(o&&(r=H(42)),this.next(),39===i&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&96===this.state.type&&this.prodParam.hasAwait)throw this.raise(v.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);a.right=this.parseExprOpRightExpr(i,r);const l=this.finishNode(a,n||o?"LogicalExpression":"BinaryExpression"),c=this.state.type;if(o&&(41===c||42===c)||n&&40===c)throw this.raise(v.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(l,t,s)}}var r;return e}parseExprOpRightExpr(e,t){const s=this.state.startLoc;switch(e){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(t))}if("smart"===this.getPluginOption("pipelineOperator","proposal"))return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(v.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(e,t),s)});default:return this.parseExprOpBaseRightExpr(e,t)}}parseExprOpBaseRightExpr(e,t){const s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,57===e?t-1:t)}parseHackPipeBody(){var e;const{startLoc:t}=this.state,s=this.parseMaybeAssign();return!u.has(s.type)||null!=(e=s.extra)&&e.parenthesized||this.raise(v.PipeUnparenthesizedBody,t,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(v.PipeTopicUnused,t),s}checkExponentialAfterUnary(e){this.match(57)&&this.raise(v.UnexpectedTokenUnaryExponentiation,e.argument)}parseMaybeUnary(e,t){const s=this.state.startLoc,i=this.isContextual(96);if(i&&this.recordAwaitIfAllowed()){this.next();const e=this.parseAwait(s);return t||this.checkExponentialAfterUnary(e),e}const r=this.match(34),a=this.startNode();if(n=this.state.type,M[n]){a.operator=this.state.value,a.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");const s=this.match(89);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),this.state.strict&&s){const e=a.argument;"Identifier"===e.type?this.raise(v.StrictDelete,a):this.hasPropertyAsPrivateName(e)&&this.raise(v.DeletePrivateField,a)}if(!r)return t||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}var n;const o=this.parseUpdate(a,r,e);if(i){const{type:e}=this.state;if((this.hasPlugin("v8intrinsic")?z(e):z(e)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(v.AwaitNotInAsyncContext,s),this.parseAwait(s)}return o}parseUpdate(e,t,s){if(t){const t=e;return this.checkLVal(t.argument,this.finishNode(t,"UpdateExpression")),e}const i=this.state.startLoc;let r=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return r;for(;34===this.state.type&&!this.canInsertSemicolon();){const e=this.startNodeAt(i);e.operator=this.state.value,e.prefix=!1,e.argument=r,this.next(),this.checkLVal(r,r=this.finishNode(e,"UpdateExpression"))}return r}parseExprSubscripts(e){const t=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprAtom(e);return this.shouldExitDescending(i,s)?i:this.parseSubscripts(i,t)}parseSubscripts(e,t,s){const i={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(e),stop:!1};do{e=this.parseSubscript(e,t,s,i),i.maybeAsyncArrow=!1}while(!i.stop);return e}parseSubscript(e,t,s,i){const{type:r}=this.state;if(!s&&15===r)return this.parseBind(e,t,s,i);if(W(r))return this.parseTaggedTemplateExpression(e,t,i);let a=!1;if(18===r){if(s&&(this.raise(v.OptionalChainingNoNew,this.state.startLoc),40===this.lookaheadCharCode()))return i.stop=!0,e;i.optionalChainMember=a=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(e,t,i,a);{const s=this.eat(0);return s||a||this.eat(16)?this.parseMember(e,t,i,s,a):(i.stop=!0,e)}}parseMember(e,t,s,i,r){const a=this.startNodeAt(t);return a.object=e,a.computed=i,i?(a.property=this.parseExpression(),this.expect(3)):this.match(139)?("Super"===e.type&&this.raise(v.SuperPrivateField,t),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),s.optionalChainMember?(a.optional=r,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(e,t,s,i){const r=this.startNodeAt(t);return r.object=e,this.next(),r.callee=this.parseNoCallExpr(),i.stop=!0,this.parseSubscripts(this.finishNode(r,"BindExpression"),t,s)}parseCoverCallAndAsyncArrowHead(e,t,s,i){const r=this.state.maybeInArrowParameters;let a=null;this.state.maybeInArrowParameters=!0,this.next();const n=this.startNodeAt(t);n.callee=e;const{maybeAsyncArrow:o,optionalChainMember:l}=s;o&&(this.expressionScope.enter(new He(2)),a=new Qe),l&&(n.optional=i),n.arguments=i?this.parseCallExpressionArguments(11):this.parseCallExpressionArguments(11,"Super"!==e.type,n,a);let c=this.finishCallExpression(n,l);return o&&this.shouldParseAsyncArrow()&&!i?(s.stop=!0,this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(t),c)):(o&&(this.checkExpressionErrors(a,!0),this.expressionScope.exit()),this.toReferencedArguments(c)),this.state.maybeInArrowParameters=r,c}toReferencedArguments(e,t){this.toReferencedListDeep(e.arguments,t)}parseTaggedTemplateExpression(e,t,s){const i=this.startNodeAt(t);return i.tag=e,i.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(v.OptionalChainingNoTemplate,t),this.finishNode(i,"TaggedTemplateExpression")}atPossibleAsyncArrow(e){return"Identifier"===e.type&&"async"===e.name&&this.state.lastTokEndLoc.index===e.end&&!this.canInsertSemicolon()&&e.end-e.start==5&&this.offsetToSourcePos(e.start)===this.state.potentialArrowAt}finishCallExpression(e,t){if("Import"===e.callee.type)if(0===e.arguments.length||e.arguments.length>2)this.raise(v.ImportCallArity,e);else for(const t of e.arguments)"SpreadElement"===t.type&&this.raise(v.ImportCallSpreadArgument,t);return this.finishNode(e,t?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(e,t,s,i){const r=[];let a=!0;const n=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(e);){if(a)a=!1;else if(this.expect(12),this.match(e)){s&&this.addTrailingCommaExtraToNode(s),this.next();break}r.push(this.parseExprListItem(!1,i,t))}return this.state.inFSharpPipelineDirectBody=n,r}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(e,t){var s;return this.resetPreviousNodeTrailingComments(t),this.expect(19),this.parseArrowExpression(e,t.arguments,!0,null==(s=t.extra)?void 0:s.trailingCommaLoc),t.innerComments&&xe(e,t.innerComments),t.callee.trailingComments&&xe(e,t.callee.trailingComments),e}parseNoCallExpr(){const e=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,!0)}parseExprAtom(e){let t,s=null;const{type:i}=this.state;switch(i){case 79:return this.parseSuper();case 83:return t=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(t):this.match(10)?512&this.optionFlags?this.parseImportCall(t):this.finishNode(t,"Import"):(this.raise(v.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(t,"Import"));case 78:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{const e=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(e)}case 2:case 1:return this.parseArrayLike(2===this.state.type?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,e);case 6:case 7:return this.parseObjectLike(6===this.state.type?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,e);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{t=this.startNode(),this.next(),t.object=null;const e=t.callee=this.parseNoCallExpr();if("MemberExpression"===e.type)return this.finishNode(t,"BindExpression");throw this.raise(v.UnsupportedBind,e)}case 139:return this.raise(v.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:{const e=this.getPluginOption("pipelineOperator","proposal");if(e)return this.parseTopicReference(e);this.unexpected();break}case 47:{const e=this.input.codePointAt(this.nextTokenStart());se(e)||62===e?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(137===i)return this.parseDecimalLiteral(this.state.value);if(R(i)){if(this.isContextual(127)&&123===this.lookaheadInLineCharCode())return this.parseModuleExpression();const e=this.state.potentialArrowAt===this.state.start,t=this.state.containsEsc,s=this.parseIdentifier();if(!t&&"async"===s.name&&!this.canInsertSemicolon()){const{type:e}=this.state;if(68===e)return this.resetPreviousNodeTrailingComments(s),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(s));if(R(e))return 61===this.lookaheadCharCode()?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(s)):s;if(90===e)return this.resetPreviousNodeTrailingComments(s),this.parseDo(this.startNodeAtNode(s),!0)}return e&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(s),[s],!1)):s}this.unexpected()}}parseTopicReferenceThenEqualsSign(e,t){const s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=e,this.state.value=t,this.state.pos--,this.state.end--,this.state.endLoc=n(this.state.endLoc,-1),this.parseTopicReference(s);this.unexpected()}parseTopicReference(e){const t=this.startNode(),s=this.state.startLoc,i=this.state.type;return this.next(),this.finishTopicReference(t,s,e,i)}finishTopicReference(e,t,s,i){if(this.testTopicReferenceConfiguration(s,t,i))return"hack"===s?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(v.PipeTopicUnbound,t),this.registerTopicReference(),this.finishNode(e,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(v.PrimaryTopicNotAllowed,t),this.registerTopicReference(),this.finishNode(e,"PipelinePrimaryTopicReference"));throw this.raise(v.PipeTopicUnconfiguredToken,t,{token:q(i)})}testTopicReferenceConfiguration(e,t,s){switch(e){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:q(s)}]);case"smart":return 27===s;default:throw this.raise(v.PipeTopicRequiresHackPipes,t)}}parseAsyncArrowUnaryFunction(e){this.prodParam.enter(Xe(!0,this.prodParam.hasYield));const t=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(v.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(e,t,!0)}parseDo(e,t){this.expectPlugin("doExpressions"),t&&this.expectPlugin("asyncDoExpressions"),e.async=t,this.next();const s=this.state.labels;return this.state.labels=[],t?(this.prodParam.enter(2),e.body=this.parseBlock(),this.prodParam.exit()):e.body=this.parseBlock(),this.state.labels=s,this.finishNode(e,"DoExpression")}parseSuper(){const e=this.startNode();return this.next(),!this.match(10)||this.scope.allowDirectSuper||16&this.optionFlags?this.scope.allowSuper||16&this.optionFlags||this.raise(v.UnexpectedSuper,e):this.raise(v.SuperNotAllowed,e),this.match(10)||this.match(0)||this.match(16)||this.raise(v.UnsupportedSuper,e),this.finishNode(e,"Super")}parsePrivateName(){const e=this.startNode(),t=this.startNodeAt(n(this.state.startLoc,1)),s=this.state.value;return this.next(),e.id=this.createIdentifier(t,s),this.finishNode(e,"PrivateName")}parseFunctionOrFunctionSent(){const e=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){const t=this.createIdentifier(this.startNodeAtNode(e),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(e,t,"sent")}return this.parseFunction(e)}parseMetaProperty(e,t,s){e.meta=t;const i=this.state.containsEsc;return e.property=this.parseIdentifier(!0),(e.property.name!==s||i)&&this.raise(v.UnsupportedMetaProperty,e.property,{target:t.name,onlyValidPropertyName:s}),this.finishNode(e,"MetaProperty")}parseImportMetaProperty(e){const t=this.createIdentifier(this.startNodeAtNode(e),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(v.ImportMetaOutsideModule,t),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){const t=this.isContextual(105);if(this.expectPlugin(t?"sourcePhaseImports":"deferredImportEvaluation"),!(512&this.optionFlags))throw this.raise(v.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),e.phase=t?"source":"defer",this.parseImportCall(e)}return this.parseMetaProperty(e,t,"meta")}parseLiteralAtNode(e,t,s){return this.addExtra(s,"rawValue",e),this.addExtra(s,"raw",this.input.slice(this.offsetToSourcePos(s.start),this.state.end)),s.value=e,this.next(),this.finishNode(s,t)}parseLiteral(e,t){const s=this.startNode();return this.parseLiteralAtNode(e,t,s)}parseStringLiteral(e){return this.parseLiteral(e,"StringLiteral")}parseNumericLiteral(e){return this.parseLiteral(e,"NumericLiteral")}parseBigIntLiteral(e){return this.parseLiteral(e,"BigIntLiteral")}parseDecimalLiteral(e){return this.parseLiteral(e,"DecimalLiteral")}parseRegExpLiteral(e){const t=this.startNode();return this.addExtra(t,"raw",this.input.slice(this.offsetToSourcePos(t.start),this.state.end)),t.pattern=e.pattern,t.flags=e.flags,this.next(),this.finishNode(t,"RegExpLiteral")}parseBooleanLiteral(e){const t=this.startNode();return t.value=e,this.next(),this.finishNode(t,"BooleanLiteral")}parseNullLiteral(){const e=this.startNode();return this.next(),this.finishNode(e,"NullLiteral")}parseParenAndDistinguishExpression(e){const t=this.state.startLoc;let s;this.next(),this.expressionScope.enter(new He(1));const i=this.state.maybeInArrowParameters,r=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;const a=this.state.startLoc,n=[],o=new Qe;let l,c,p=!0;for(;!this.match(11);){if(p)p=!1;else if(this.expect(12,null===o.optionalParametersLoc?null:o.optionalParametersLoc),this.match(11)){c=this.state.startLoc;break}if(this.match(21)){const e=this.state.startLoc;if(l=this.state.startLoc,n.push(this.parseParenItem(this.parseRestBinding(),e)),!this.checkCommaAfterRest(41))break}else n.push(this.parseMaybeAssignAllowIn(o,this.parseParenItem))}const h=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=i,this.state.inFSharpPipelineDirectBody=r;let u=this.startNodeAt(t);return e&&this.shouldParseArrow(n)&&(u=this.parseArrow(u))?(this.checkDestructuringPrivate(o),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(u,n,!1),u):(this.expressionScope.exit(),n.length||this.unexpected(this.state.lastTokStartLoc),c&&this.unexpected(c),l&&this.unexpected(l),this.checkExpressionErrors(o,!0),this.toReferencedListDeep(n,!0),n.length>1?((s=this.startNodeAt(a)).expressions=n,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,h)):s=n[0],this.wrapParenthesis(t,s))}wrapParenthesis(e,t){if(!(1024&this.optionFlags))return this.addExtra(t,"parenthesized",!0),this.addExtra(t,"parenStart",e.index),this.takeSurroundingComments(t,e.index,this.state.lastTokEndLoc.index),t;const s=this.startNodeAt(e);return s.expression=t,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(e){return!this.canInsertSemicolon()}parseArrow(e){if(this.eat(19))return e}parseParenItem(e,t){return e}parseNewOrNewTarget(){const e=this.startNode();if(this.next(),this.match(16)){const t=this.createIdentifier(this.startNodeAtNode(e),"new");this.next();const s=this.parseMetaProperty(e,t,"target");return this.scope.inNonArrowFunction||this.scope.inClass||4&this.optionFlags||this.raise(v.UnexpectedNewTarget,s),s}return this.parseNew(e)}parseNew(e){if(this.parseNewCallee(e),this.eat(10)){const t=this.parseExprList(11);this.toReferencedList(t),e.arguments=t}else e.arguments=[];return this.finishNode(e,"NewExpression")}parseNewCallee(e){const t=this.match(83),s=this.parseNoCallExpr();e.callee=s,!t||"Import"!==s.type&&"ImportExpression"!==s.type||this.raise(v.ImportCallNotNewExpression,s)}parseTemplateElement(e){const{start:t,startLoc:s,end:i,value:r}=this.state,a=t+1,o=this.startNodeAt(n(s,1));null===r&&(e||this.raise(v.InvalidEscapeSequenceTemplate,n(this.state.firstInvalidTemplateEscapePos,1)));const l=this.match(24),c=l?-1:-2,p=i+c;o.value={raw:this.input.slice(a,p).replace(/\r\n?/g,"\n"),cooked:null===r?null:r.slice(1,c)},o.tail=l,this.next();const h=this.finishNode(o,"TemplateElement");return this.resetEndLocation(h,n(this.state.lastTokEndLoc,c)),h}parseTemplate(e){const t=this.startNode();let s=this.parseTemplateElement(e);const i=[s],r=[];for(;!s.tail;)r.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),i.push(s=this.parseTemplateElement(e));return t.expressions=r,t.quasis=i,this.finishNode(t,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(e,t,s,i){s&&this.expectPlugin("recordAndTuple");const r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=!1,n=!0;const o=this.startNode();for(o.properties=[],this.next();!this.match(e);){if(n)n=!1;else if(this.expect(12),this.match(e)){this.addTrailingCommaExtraToNode(o);break}let r;t?r=this.parseBindingProperty():(r=this.parsePropertyDefinition(i),a=this.checkProto(r,s,a,i)),s&&!this.isObjectProperty(r)&&"SpreadElement"!==r.type&&this.raise(v.InvalidRecordProperty,r),r.shorthand&&this.addExtra(r,"shorthand",!0),o.properties.push(r)}this.next(),this.state.inFSharpPipelineDirectBody=r;let l="ObjectExpression";return t?l="ObjectPattern":s&&(l="RecordExpression"),this.finishNode(o,l)}addTrailingCommaExtraToNode(e){this.addExtra(e,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(e,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(e){return!e.computed&&"Identifier"===e.key.type&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(e){let t=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(v.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)t.push(this.parseDecorator());const s=this.startNode();let i,r=!1,a=!1;if(this.match(21))return t.length&&this.unexpected(),this.parseSpread();t.length&&(s.decorators=t,t=[]),s.method=!1,e&&(i=this.state.startLoc);let n=this.eat(55);this.parsePropertyNamePrefixOperator(s);const o=this.state.containsEsc;if(this.parsePropertyName(s,e),!n&&!o&&this.maybeAsyncOrAccessorProp(s)){const{key:e}=s,t=e.name;"async"!==t||this.hasPrecedingLineBreak()||(r=!0,this.resetPreviousNodeTrailingComments(e),n=this.eat(55),this.parsePropertyName(s)),"get"!==t&&"set"!==t||(a=!0,this.resetPreviousNodeTrailingComments(e),s.kind=t,this.match(55)&&(n=!0,this.raise(v.AccessorIsGenerator,this.state.curPosition(),{kind:t}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,i,n,r,!1,a,e)}getGetterSetterExpectedParamCount(e){return"get"===e.kind?0:1}getObjectOrClassMethodParams(e){return e.params}checkGetterSetterParams(e){var t;const s=this.getGetterSetterExpectedParamCount(e),i=this.getObjectOrClassMethodParams(e);i.length!==s&&this.raise("get"===e.kind?v.BadGetterArity:v.BadSetterArity,e),"set"===e.kind&&"RestElement"===(null==(t=i[i.length-1])?void 0:t.type)&&this.raise(v.BadSetterRestParameter,e)}parseObjectMethod(e,t,s,i,r){if(r){const s=this.parseMethod(e,t,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(s),s}if(s||t||this.match(10))return i&&this.unexpected(),e.kind="method",e.method=!0,this.parseMethod(e,t,s,!1,!1,"ObjectMethod")}parseObjectProperty(e,t,s,i){if(e.shorthand=!1,this.eat(14))return e.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(i),this.finishNode(e,"ObjectProperty");if(!e.computed&&"Identifier"===e.key.type){if(this.checkReservedWord(e.key.name,e.key.loc.start,!0,!1),s)e.value=this.parseMaybeDefault(t,tt(e.key));else if(this.match(29)){const s=this.state.startLoc;null!=i?null===i.shorthandAssignLoc&&(i.shorthandAssignLoc=s):this.raise(v.InvalidCoverInitializedName,s),e.value=this.parseMaybeDefault(t,tt(e.key))}else e.value=tt(e.key);return e.shorthand=!0,this.finishNode(e,"ObjectProperty")}}parseObjPropValue(e,t,s,i,r,a,n){const o=this.parseObjectMethod(e,s,i,r,a)||this.parseObjectProperty(e,t,r,n);return o||this.unexpected(),o}parsePropertyName(e,t){if(this.eat(0))e.computed=!0,e.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{const{type:s,value:i}=this.state;let r;if(U(s))r=this.parseIdentifier(!0);else switch(s){case 135:r=this.parseNumericLiteral(i);break;case 134:r=this.parseStringLiteral(i);break;case 136:r=this.parseBigIntLiteral(i);break;case 139:{const e=this.state.startLoc;null!=t?null===t.privateKeyLoc&&(t.privateKeyLoc=e):this.raise(v.UnexpectedPrivateField,e),r=this.parsePrivateName();break}default:if(137===s){r=this.parseDecimalLiteral(i);break}this.unexpected()}e.key=r,139!==s&&(e.computed=!1)}}initFunction(e,t){e.id=null,e.generator=!1,e.async=t}parseMethod(e,t,s,i,r,a,n=!1){this.initFunction(e,s),e.generator=t,this.scope.enter(18|(n?64:0)|(r?32:0)),this.prodParam.enter(Xe(s,e.generator)),this.parseFunctionParams(e,i);const o=this.parseFunctionBodyAndFinish(e,a,!0);return this.prodParam.exit(),this.scope.exit(),o}parseArrayLike(e,t,s,i){s&&this.expectPlugin("recordAndTuple");const r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;const a=this.startNode();return this.next(),a.elements=this.parseExprList(e,!s,i,a),this.state.inFSharpPipelineDirectBody=r,this.finishNode(a,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(e,t,s,i){this.scope.enter(6);let r=Xe(s,!1);!this.match(5)&&this.prodParam.hasIn&&(r|=8),this.prodParam.enter(r),this.initFunction(e,s);const a=this.state.maybeInArrowParameters;return t&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(e,t,i)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(e,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(e,"ArrowFunctionExpression")}setArrowFunctionParameters(e,t,s){this.toAssignableList(t,s,!1),e.params=t}parseFunctionBodyAndFinish(e,t,s=!1){return this.parseFunctionBody(e,!1,s),this.finishNode(e,t)}parseFunctionBody(e,t,s=!1){const i=t&&!this.match(5);if(this.expressionScope.enter(Je()),i)e.body=this.parseMaybeAssign(),this.checkParams(e,!1,t,!1);else{const i=this.state.strict,r=this.state.labels;this.state.labels=[],this.prodParam.enter(4|this.prodParam.currentFlags()),e.body=this.parseBlock(!0,!1,r=>{const a=!this.isSimpleParamList(e.params);r&&a&&this.raise(v.IllegalLanguageModeDirective,"method"!==e.kind&&"constructor"!==e.kind||!e.key?e:e.key.loc.end);const n=!i&&this.state.strict;this.checkParams(e,!(this.state.strict||t||s||a),t,n),this.state.strict&&e.id&&this.checkIdentifier(e.id,65,n)}),this.prodParam.exit(),this.state.labels=r}this.expressionScope.exit()}isSimpleParameter(e){return"Identifier"===e.type}isSimpleParamList(e){for(let t=0,s=e.length;t10)return;if(!function(e){return de.has(e)}(e))return;if(s&&function(e){return ne.has(e)}(e))return void this.raise(v.UnexpectedKeyword,t,{keyword:e});if((this.state.strict?i?ue:pe:ce)(e,this.inModule))this.raise(v.UnexpectedReservedWord,t,{reservedWord:e});else if("yield"===e){if(this.prodParam.hasYield)return void this.raise(v.YieldBindingIdentifier,t)}else if("await"===e){if(this.prodParam.hasAwait)return void this.raise(v.AwaitBindingIdentifier,t);if(this.scope.inStaticBlock)return void this.raise(v.AwaitBindingIdentifierInStaticBlock,t);this.expressionScope.recordAsyncArrowParametersError(t)}else if("arguments"===e&&this.scope.inClassAndNotInNonArrowFunction)return void this.raise(v.ArgumentsInClass,t)}recordAwaitIfAllowed(){const e=this.prodParam.hasAwait||1&this.optionFlags&&!this.scope.inFunction;return e&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),e}parseAwait(e){const t=this.startNodeAt(e);return this.expressionScope.recordParameterInitializerError(v.AwaitExpressionFormalParameter,t),this.eat(55)&&this.raise(v.ObsoleteAwaitStar,t),this.scope.inFunction||1&this.optionFlags||(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(t.argument=this.parseMaybeUnary(null,!0)),this.finishNode(t,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;const{type:e}=this.state;return 53===e||10===e||0===e||W(e)||102===e&&!this.state.containsEsc||138===e||56===e||this.hasPlugin("v8intrinsic")&&54===e}parseYield(e){const t=this.startNodeAt(e);this.expressionScope.recordParameterInitializerError(v.YieldInParameter,t);let s=!1,i=null;if(!this.hasPrecedingLineBreak())switch(s=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!s)break;default:i=this.parseMaybeAssign()}return t.delegate=s,t.argument=i,this.finishNode(t,"YieldExpression")}parseImportCall(e){if(this.next(),e.source=this.parseMaybeAssignAllowIn(),e.options=null,this.eat(12)&&!this.match(11)&&(e.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&!this.match(11))){do{this.parseMaybeAssignAllowIn()}while(this.eat(12)&&!this.match(11));this.raise(v.ImportCallArity,e)}return this.expect(11),this.finishNode(e,"ImportExpression")}checkPipelineAtInfixOperator(e,t){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&"SequenceExpression"===e.type&&this.raise(v.PipelineHeadSequenceExpression,t)}parseSmartPipelineBodyInStyle(e,t){if(this.isSimpleReference(e)){const s=this.startNodeAt(t);return s.callee=e,this.finishNode(s,"PipelineBareFunction")}{const s=this.startNodeAt(t);return this.checkSmartPipeTopicBodyEarlyErrors(t),s.expression=e,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(e){switch(e.type){case"MemberExpression":return!e.computed&&this.isSimpleReference(e.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(e){if(this.match(19))throw this.raise(v.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(v.PipelineTopicUnused,e)}withTopicBindingContext(e){const t=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=t}}withSmartMixTopicForbiddingContext(e){if(!this.hasPlugin(["pipelineOperator",{proposal:"smart"}]))return e();{const t=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=t}}}withSoloAwaitPermittingContext(e){const t=this.state.soloAwait;this.state.soloAwait=!0;try{return e()}finally{this.state.soloAwait=t}}allowInAnd(e){const t=this.prodParam.currentFlags();if(8&~t){this.prodParam.enter(8|t);try{return e()}finally{this.prodParam.exit()}}return e()}disallowInAnd(e){const t=this.prodParam.currentFlags();if(8&t){this.prodParam.enter(-9&t);try{return e()}finally{this.prodParam.exit()}}return e()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return null!=this.state.topicContext.maxTopicIndex&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(e){const t=this.state.startLoc;this.state.potentialArrowAt=this.state.start;const s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;const i=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,e);return this.state.inFSharpPipelineDirectBody=s,i}parseModuleExpression(){this.expectPlugin("moduleBlocks");const e=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);const t=this.startNodeAt(this.state.endLoc);this.next();const s=this.initializeScopes(!0);this.enterInitialScopes();try{e.body=this.parseProgram(t,8,"module")}finally{s()}return this.finishNode(e,"ModuleExpression")}parsePropertyNamePrefixOperator(e){}}const It={kind:1},kt={kind:2},Dt=/[\uD800-\uDFFF]/u,Nt=/in(?:stanceof)?/y;class Lt extends St{parseTopLevel(e,t){return e.program=this.parseProgram(t),e.comments=this.comments,256&this.optionFlags&&(e.tokens=function(e,t,s){for(let i=0;i0)for(const[e,t]of Array.from(this.scope.undefinedExports))this.raise(v.ModuleExportUndefined,t,{localName:e});this.addExtra(e,"topLevelAwait",this.state.hasTopLevelAwait)}let i;return i=140===t?this.finishNode(e,"Program"):this.finishNodeAt(e,"Program",n(this.state.startLoc,-1))}stmtToDirective(e){const t=e;t.type="Directive",t.value=t.expression,delete t.expression;const s=t.value,i=s.value,r=this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end)),a=s.value=r.slice(1,-1);return this.addExtra(s,"raw",r),this.addExtra(s,"rawValue",a),this.addExtra(s,"expressionValue",i),s.type="DirectiveLiteral",t}parseInterpreterDirective(){if(!this.match(28))return null;const e=this.startNode();return e.value=this.state.value,this.next(),this.finishNode(e,"InterpreterDirective")}isLet(){return!!this.isContextual(100)&&this.hasFollowingBindingAtom()}chStartsBindingIdentifier(e,t){if(se(e)){if(Nt.lastIndex=t,Nt.test(this.input)){const e=this.codePointAtPos(Nt.lastIndex);if(!ie(e)&&92!==e)return!1}return!0}return 92===e}chStartsBindingPattern(e){return 91===e||123===e}hasFollowingBindingAtom(){const e=this.nextTokenStart(),t=this.codePointAtPos(e);return this.chStartsBindingPattern(t)||this.chStartsBindingIdentifier(t,e)}hasInLineFollowingBindingIdentifierOrBrace(){const e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return 123===t||this.chStartsBindingIdentifier(t,e)}startsUsingForOf(){const{type:e,containsEsc:t}=this.lookahead();return!(102===e&&!t)&&(R(e)&&!this.hasFollowingLineBreak()?(this.expectPlugin("explicitResourceManagement"),!0):void 0)}startsAwaitUsing(){let e=this.nextTokenInLineStart();if(this.isUnparsedContextual(e,"using")){e=this.nextTokenInLineStartSince(e+5);const t=this.codePointAtPos(e);if(this.chStartsBindingIdentifier(t,e))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(e=!1){let t=0;return this.options.annexB&&!this.state.strict&&(t|=4,e&&(t|=8)),this.parseStatementLike(t)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(e){let t=null;return this.match(26)&&(t=this.parseDecorators(!0)),this.parseStatementContent(e,t)}parseStatementContent(e,t){const s=this.state.type,i=this.startNode(),r=!!(2&e),a=!!(4&e),n=1&e;switch(s){case 60:return this.parseBreakContinueStatement(i,!0);case 63:return this.parseBreakContinueStatement(i,!1);case 64:return this.parseDebuggerStatement(i);case 90:return this.parseDoWhileStatement(i);case 91:return this.parseForStatement(i);case 68:if(46===this.lookaheadCharCode())break;return a||this.raise(this.state.strict?v.StrictFunction:this.options.annexB?v.SloppyFunctionAnnexB:v.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(i,!1,!r&&a);case 80:return r||this.unexpected(),this.parseClass(this.maybeTakeDecorators(t,i),!0);case 69:return this.parseIfStatement(i);case 70:return this.parseReturnStatement(i);case 71:return this.parseSwitchStatement(i);case 72:return this.parseThrowStatement(i);case 73:return this.parseTryStatement(i);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.recordAwaitIfAllowed()?r||this.raise(v.UnexpectedLexicalDeclaration,i):this.raise(v.AwaitUsingNotInAsyncContext,i),this.next(),this.parseVarStatement(i,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(v.UnexpectedUsingDeclaration,this.state.startLoc):r||this.raise(v.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(i,"using");case 100:{if(this.state.containsEsc)break;const e=this.nextTokenStart(),t=this.codePointAtPos(e);if(91!==t){if(!r&&this.hasFollowingLineBreak())break;if(!this.chStartsBindingIdentifier(t,e)&&123!==t)break}}case 75:r||this.raise(v.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{const e=this.state.value;return this.parseVarStatement(i,e)}case 92:return this.parseWhileStatement(i);case 76:return this.parseWithStatement(i);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(i);case 83:{const e=this.lookaheadCharCode();if(40===e||46===e)break}case 82:{let e;return 8&this.optionFlags||n||this.raise(v.UnexpectedImportExport,this.state.startLoc),this.next(),e=83===s?this.parseImport(i):this.parseExport(i,t),this.assertModuleNodeAllowed(e),e}default:if(this.isAsyncFunction())return r||this.raise(v.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(i,!0,!r&&a)}const o=this.state.value,l=this.parseExpression();return R(s)&&"Identifier"===l.type&&this.eat(14)?this.parseLabeledStatement(i,o,l,e):this.parseExpressionStatement(i,l,t)}assertModuleNodeAllowed(e){8&this.optionFlags||this.inModule||this.raise(v.ImportOutsideModule,e)}decoratorsEnabledBeforeExport(){return!!this.hasPlugin("decorators-legacy")||this.hasPlugin("decorators")&&!1!==this.getPluginOption("decorators","decoratorsBeforeExport")}maybeTakeDecorators(e,t,s){var i;e&&(null!=(i=t.decorators)&&i.length?("boolean"!=typeof this.getPluginOption("decorators","decoratorsBeforeExport")&&this.raise(v.DecoratorsBeforeAfterExport,t.decorators[0]),t.decorators.unshift(...e)):t.decorators=e,this.resetStartLocationFromNode(t,e[0]),s&&this.resetStartLocationFromNode(s,t));return t}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(e){const t=[];do{t.push(this.parseDecorator())}while(this.match(26));if(this.match(82))e||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(v.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(v.UnexpectedLeadingDecorator,this.state.startLoc);return t}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);const e=this.startNode();if(this.next(),this.hasPlugin("decorators")){const t=this.state.startLoc;let s;if(this.match(10)){const t=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(t,s);const i=this.state.startLoc;e.expression=this.parseMaybeDecoratorArguments(s,t),!1===this.getPluginOption("decorators","allowCallParenthesized")&&e.expression!==s&&this.raise(v.DecoratorArgumentsOutsideParentheses,i)}else{for(s=this.parseIdentifier(!1);this.eat(16);){const e=this.startNodeAt(t);e.object=s,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),e.property=this.parsePrivateName()):e.property=this.parseIdentifier(!0),e.computed=!1,s=this.finishNode(e,"MemberExpression")}e.expression=this.parseMaybeDecoratorArguments(s,t)}}else e.expression=this.parseExprSubscripts();return this.finishNode(e,"Decorator")}parseMaybeDecoratorArguments(e,t){if(this.eat(10)){const s=this.startNodeAt(t);return s.callee=e,s.arguments=this.parseCallExpressionArguments(11),this.toReferencedList(s.arguments),this.finishNode(s,"CallExpression")}return e}parseBreakContinueStatement(e,t){return this.next(),this.isLineTerminator()?e.label=null:(e.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(e,t),this.finishNode(e,t?"BreakStatement":"ContinueStatement")}verifyBreakContinue(e,t){let s;for(s=0;sthis.parseStatement()),this.state.labels.pop(),this.expect(92),e.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(e,"DoWhileStatement")}parseForStatement(e){this.next(),this.state.labels.push(It);let t=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(t=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return null!==t&&this.unexpected(t),this.parseFor(e,null);const s=this.isContextual(100);{const i=this.isContextual(96)&&this.startsAwaitUsing(),r=i||this.isContextual(107)&&this.startsUsingForOf(),a=s&&this.hasFollowingBindingAtom()||r;if(this.match(74)||this.match(75)||a){const s=this.startNode();let a;i?(a="await using",this.recordAwaitIfAllowed()||this.raise(v.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):a=this.state.value,this.next(),this.parseVar(s,!0,a);const n=this.finishNode(s,"VariableDeclaration"),o=this.match(58);return o&&r&&this.raise(v.ForInUsing,n),(o||this.isContextual(102))&&1===n.declarations.length?this.parseForIn(e,n,t):(null!==t&&this.unexpected(t),this.parseFor(e,n))}}const i=this.isContextual(95),r=new Qe,a=this.parseExpression(!0,r),n=this.isContextual(102);if(n&&(s&&this.raise(v.ForOfLet,a),null===t&&i&&"Identifier"===a.type&&this.raise(v.ForOfAsync,a)),n||this.match(58)){this.checkDestructuringPrivate(r),this.toAssignable(a,!0);const s=n?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{type:s}),this.parseForIn(e,a,t)}return this.checkExpressionErrors(r,!0),null!==t&&this.unexpected(t),this.parseFor(e,a)}parseFunctionStatement(e,t,s){return this.next(),this.parseFunction(e,1|(s?2:0)|(t?8:0))}parseIfStatement(e){return this.next(),e.test=this.parseHeaderExpression(),e.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),e.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(e,"IfStatement")}parseReturnStatement(e){return this.prodParam.hasReturn||2&this.optionFlags||this.raise(v.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")}parseSwitchStatement(e){this.next(),e.discriminant=this.parseHeaderExpression();const t=e.cases=[];let s,i;for(this.expect(5),this.state.labels.push(kt),this.scope.enter(0);!this.match(8);)if(this.match(61)||this.match(65)){const e=this.match(61);s&&this.finishNode(s,"SwitchCase"),t.push(s=this.startNode()),s.consequent=[],this.next(),e?s.test=this.parseExpression():(i&&this.raise(v.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),i=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(e,"SwitchStatement")}parseThrowStatement(e){return this.next(),this.hasPrecedingLineBreak()&&this.raise(v.NewlineAfterThrow,this.state.lastTokEndLoc),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")}parseCatchClauseParam(){const e=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&"Identifier"===e.type?8:0),this.checkLVal(e,{type:"CatchClause"},9),e}parseTryStatement(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(62)){const t=this.startNode();this.next(),this.match(10)?(this.expect(10),t.param=this.parseCatchClauseParam(),this.expect(11)):(t.param=null,this.scope.enter(0)),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(67)?this.parseBlock():null,e.handler||e.finalizer||this.raise(v.NoCatchOrFinally,e),this.finishNode(e,"TryStatement")}parseVarStatement(e,t,s=!1){return this.next(),this.parseVar(e,!1,t,s),this.semicolon(),this.finishNode(e,"VariableDeclaration")}parseWhileStatement(e){return this.next(),e.test=this.parseHeaderExpression(),this.state.labels.push(It),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(e,"WhileStatement")}parseWithStatement(e){return this.state.strict&&this.raise(v.StrictWith,this.state.startLoc),this.next(),e.object=this.parseHeaderExpression(),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(e,"WithStatement")}parseEmptyStatement(e){return this.next(),this.finishNode(e,"EmptyStatement")}parseLabeledStatement(e,t,s,i){for(const e of this.state.labels)e.name===t&&this.raise(v.LabelRedeclaration,s,{labelName:t});const r=(a=this.state.type)>=90&&a<=92?1:this.match(71)?2:null;var a;for(let t=this.state.labels.length-1;t>=0;t--){const s=this.state.labels[t];if(s.statementStart!==e.start)break;s.statementStart=this.sourceToOffsetPos(this.state.start),s.kind=r}return this.state.labels.push({name:t,kind:r,statementStart:this.sourceToOffsetPos(this.state.start)}),e.body=8&i?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")}parseExpressionStatement(e,t,s){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")}parseBlock(e=!1,t=!0,s){const i=this.startNode();return e&&this.state.strictErrors.clear(),this.expect(5),t&&this.scope.enter(0),this.parseBlockBody(i,e,!1,8,s),t&&this.scope.exit(),this.finishNode(i,"BlockStatement")}isValidDirective(e){return"ExpressionStatement"===e.type&&"StringLiteral"===e.expression.type&&!e.expression.extra.parenthesized}parseBlockBody(e,t,s,i,r){const a=e.body=[],n=e.directives=[];this.parseBlockOrModuleBlockBody(a,t?n:void 0,s,i,r)}parseBlockOrModuleBlockBody(e,t,s,i,r){const a=this.state.strict;let n=!1,o=!1;for(;!this.match(i);){const i=s?this.parseModuleItem():this.parseStatementListItem();if(t&&!o){if(this.isValidDirective(i)){const e=this.stmtToDirective(i);t.push(e),n||"use strict"!==e.value.value||(n=!0,this.setStrict(!0));continue}o=!0,this.state.strictErrors.clear()}e.push(i)}null==r||r.call(this,n),a||this.setStrict(!1),this.next()}parseFor(e,t){return e.init=t,this.semicolon(!1),e.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),e.update=this.match(11)?null:this.parseExpression(),this.expect(11),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,"ForStatement")}parseForIn(e,t,s){const i=this.match(58);return this.next(),i?null!==s&&this.unexpected(s):e.await=null!==s,"VariableDeclaration"!==t.type||null==t.declarations[0].init||i&&this.options.annexB&&!this.state.strict&&"var"===t.kind&&"Identifier"===t.declarations[0].id.type||this.raise(v.ForInOfLoopInitializer,t,{type:i?"ForInStatement":"ForOfStatement"}),"AssignmentPattern"===t.type&&this.raise(v.InvalidLhs,t,{ancestor:{type:"ForStatement"}}),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")}parseVar(e,t,s,i=!1){const r=e.declarations=[];for(e.kind=s;;){const e=this.startNode();if(this.parseVarId(e,s),e.init=this.eat(29)?t?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,null!==e.init||i||("Identifier"===e.id.type||t&&(this.match(58)||this.isContextual(102))?"const"!==s&&"using"!==s&&"await using"!==s||this.match(58)||this.isContextual(102)||this.raise(v.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s}):this.raise(v.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"})),r.push(this.finishNode(e,"VariableDeclarator")),!this.eat(12))break}return e}parseVarId(e,t){const s=this.parseBindingAtom();"using"!==t&&"await using"!==t||"ArrayPattern"!==s.type&&"ObjectPattern"!==s.type||this.raise(v.UsingDeclarationHasBindingPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},"var"===t?5:8201),e.id=s}parseAsyncFunctionExpression(e){return this.parseFunction(e,8)}parseFunction(e,t=0){const s=2&t,i=!!(1&t),r=i&&!(4&t),a=!!(8&t);this.initFunction(e,a),this.match(55)&&(s&&this.raise(v.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),e.generator=!0),i&&(e.id=this.parseFunctionId(r));const n=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(Xe(a,e.generator)),i||(e.id=this.parseFunctionId()),this.parseFunctionParams(e,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(e,i?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),i&&!s&&this.registerFunctionStatementId(e),this.state.maybeInArrowParameters=n,e}parseFunctionId(e){return e||R(this.state.type)?this.parseIdentifier():null}parseFunctionParams(e,t){this.expect(10),this.expressionScope.enter(new qe(3)),e.params=this.parseBindingList(11,41,2|(t?4:0)),this.expressionScope.exit()}registerFunctionStatementId(e){e.id&&this.scope.declareName(e.id.name,!this.options.annexB||this.state.strict||e.generator||e.async?this.scope.treatFunctionsAsVar?5:8201:17,e.id.loc.start)}parseClass(e,t,s){this.next();const i=this.state.strict;return this.state.strict=!0,this.parseClassId(e,t,s),this.parseClassSuper(e),e.body=this.parseClassBody(!!e.superClass,i),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(e){return"Identifier"===e.type&&"constructor"===e.name||"StringLiteral"===e.type&&"constructor"===e.value}isNonstaticConstructor(e){return!e.computed&&!e.static&&this.nameIsConstructor(e.key)}parseClassBody(e,t){this.classScope.enter();const s={hadConstructor:!1,hadSuperClass:e};let i=[];const r=this.startNode();if(r.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(i.length>0)throw this.raise(v.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){i.push(this.parseDecorator());continue}const e=this.startNode();i.length&&(e.decorators=i,this.resetStartLocationFromNode(e,i[0]),i=[]),this.parseClassMember(r,e,s),"constructor"===e.kind&&e.decorators&&e.decorators.length>0&&this.raise(v.DecoratorConstructor,e)}}),this.state.strict=t,this.next(),i.length)throw this.raise(v.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(r,"ClassBody")}parseClassMemberFromModifier(e,t){const s=this.parseIdentifier(!0);if(this.isClassMethod()){const i=t;return i.kind="method",i.computed=!1,i.key=s,i.static=!1,this.pushClassMethod(e,i,!1,!1,!1,!1),!0}if(this.isClassProperty()){const i=t;return i.computed=!1,i.key=s,i.static=!1,e.body.push(this.parseClassProperty(i)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(e,t,s){const i=this.isContextual(106);if(i){if(this.parseClassMemberFromModifier(e,t))return;if(this.eat(5))return void this.parseClassStaticBlock(e,t)}this.parseClassMemberWithIsStatic(e,t,s,i)}parseClassMemberWithIsStatic(e,t,s,i){const r=t,a=t,n=t,o=t,l=t,c=r,p=r;if(t.static=i,this.parsePropertyNamePrefixOperator(t),this.eat(55)){c.kind="method";const t=this.match(139);return this.parseClassElementName(c),t?void this.pushClassPrivateMethod(e,a,!0,!1):(this.isNonstaticConstructor(r)&&this.raise(v.ConstructorIsGenerator,r.key),void this.pushClassMethod(e,r,!0,!1,!1,!1))}const h=!this.state.containsEsc&&R(this.state.type),u=this.parseClassElementName(t),d=h?u.name:null,f=this.isPrivateName(u),m=this.state.startLoc;if(this.parsePostMemberNameModifiers(p),this.isClassMethod()){if(c.kind="method",f)return void this.pushClassPrivateMethod(e,a,!1,!1);const i=this.isNonstaticConstructor(r);let n=!1;i&&(r.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(v.DuplicateConstructor,u),i&&this.hasPlugin("typescript")&&t.override&&this.raise(v.OverrideOnConstructor,u),s.hadConstructor=!0,n=s.hadSuperClass),this.pushClassMethod(e,r,!1,!1,i,n)}else if(this.isClassProperty())f?this.pushClassPrivateProperty(e,o):this.pushClassProperty(e,n);else if("async"!==d||this.isLineTerminator())if("get"!==d&&"set"!==d||this.match(55)&&this.isLineTerminator())if("accessor"!==d||this.isLineTerminator())this.isLineTerminator()?f?this.pushClassPrivateProperty(e,o):this.pushClassProperty(e,n):this.unexpected();else{this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(u);const t=this.match(139);this.parseClassElementName(n),this.pushClassAccessorProperty(e,l,t)}else{this.resetPreviousNodeTrailingComments(u),c.kind=d;const t=this.match(139);this.parseClassElementName(r),t?this.pushClassPrivateMethod(e,a,!1,!1):(this.isNonstaticConstructor(r)&&this.raise(v.ConstructorIsAccessor,r.key),this.pushClassMethod(e,r,!1,!1,!1,!1)),this.checkGetterSetterParams(r)}else{this.resetPreviousNodeTrailingComments(u);const t=this.eat(55);p.optional&&this.unexpected(m),c.kind="method";const s=this.match(139);this.parseClassElementName(c),this.parsePostMemberNameModifiers(p),s?this.pushClassPrivateMethod(e,a,t,!0):(this.isNonstaticConstructor(r)&&this.raise(v.ConstructorIsAsync,r.key),this.pushClassMethod(e,r,t,!0,!1,!1))}}parseClassElementName(e){const{type:t,value:s}=this.state;if(132!==t&&134!==t||!e.static||"prototype"!==s||this.raise(v.StaticPrototype,this.state.startLoc),139===t){"constructor"===s&&this.raise(v.ConstructorClassPrivateField,this.state.startLoc);const t=this.parsePrivateName();return e.key=t,t}return this.parsePropertyName(e),e.key}parseClassStaticBlock(e,t){var s;this.scope.enter(208);const i=this.state.labels;this.state.labels=[],this.prodParam.enter(0);const r=t.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=i,e.body.push(this.finishNode(t,"StaticBlock")),null!=(s=t.decorators)&&s.length&&this.raise(v.DecoratorStaticBlock,t)}pushClassProperty(e,t){!t.computed&&this.nameIsConstructor(t.key)&&this.raise(v.ConstructorClassField,t.key),e.body.push(this.parseClassProperty(t))}pushClassPrivateProperty(e,t){const s=this.parseClassPrivateProperty(t);e.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(e,t,s){s||t.computed||!this.nameIsConstructor(t.key)||this.raise(v.ConstructorClassField,t.key);const i=this.parseClassAccessorProperty(t);e.body.push(i),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),0,i.key.loc.start)}pushClassMethod(e,t,s,i,r,a){e.body.push(this.parseMethod(t,s,i,r,a,"ClassMethod",!0))}pushClassPrivateMethod(e,t,s,i){const r=this.parseMethod(t,s,i,!1,!1,"ClassPrivateMethod",!0);e.body.push(r);const a="get"===r.kind?r.static?6:2:"set"===r.kind?r.static?5:1:0;this.declareClassPrivateMethodInScope(r,a)}declareClassPrivateMethodInScope(e,t){this.classScope.declarePrivateName(this.getPrivateNameSV(e.key),t,e.key.loc.start)}parsePostMemberNameModifiers(e){}parseClassPrivateProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassPrivateProperty")}parseClassProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassProperty")}parseClassAccessorProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassAccessorProperty")}parseInitializer(e){this.scope.enter(80),this.expressionScope.enter(Je()),this.prodParam.enter(0),e.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(e,t,s,i=8331){if(R(this.state.type))e.id=this.parseIdentifier(),t&&this.declareNameFromIdentifier(e.id,i);else{if(!s&&t)throw this.raise(v.MissingClassName,this.state.startLoc);e.id=null}}parseClassSuper(e){e.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(e,t){const s=this.parseMaybeImportPhase(e,!0),i=this.maybeParseExportDefaultSpecifier(e,s),r=!i||this.eat(12),a=r&&this.eatExportStar(e),n=a&&this.maybeParseExportNamespaceSpecifier(e),o=r&&(!n||this.eat(12)),l=i||a;if(a&&!n){if(i&&this.unexpected(),t)throw this.raise(v.UnsupportedDecoratorExport,e);return this.parseExportFrom(e,!0),this.sawUnambiguousESM=!0,this.finishNode(e,"ExportAllDeclaration")}const c=this.maybeParseExportNamedSpecifiers(e);let p;if(i&&r&&!a&&!c&&this.unexpected(null,5),n&&o&&this.unexpected(null,98),l||c){if(p=!1,t)throw this.raise(v.UnsupportedDecoratorExport,e);this.parseExportFrom(e,l)}else p=this.maybeParseExportDeclaration(e);if(l||c||p){var h;const s=e;if(this.checkExport(s,!0,!1,!!s.source),"ClassDeclaration"===(null==(h=s.declaration)?void 0:h.type))this.maybeTakeDecorators(t,s.declaration,s);else if(t)throw this.raise(v.UnsupportedDecoratorExport,e);return this.sawUnambiguousESM=!0,this.finishNode(s,"ExportNamedDeclaration")}if(this.eat(65)){const s=e,i=this.parseExportDefaultExpression();if(s.declaration=i,"ClassDeclaration"===i.type)this.maybeTakeDecorators(t,i,s);else if(t)throw this.raise(v.UnsupportedDecoratorExport,e);return this.checkExport(s,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(s,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(e){return this.eat(55)}maybeParseExportDefaultSpecifier(e,t){if(t||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",null==t?void 0:t.loc.start);const s=t||this.parseIdentifier(!0),i=this.startNodeAtNode(s);return i.exported=s,e.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(e){if(this.isContextual(93)){var t;null!=(t=e).specifiers||(t.specifiers=[]);const s=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),s.exported=this.parseModuleExportName(),e.specifiers.push(this.finishNode(s,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(e){if(this.match(5)){const t=e;t.specifiers||(t.specifiers=[]);const s="type"===t.exportKind;return t.specifiers.push(...this.parseExportSpecifiers(s)),t.source=null,this.hasPlugin("importAssertions")?t.assertions=[]:t.attributes=[],t.declaration=null,!0}return!1}maybeParseExportDeclaration(e){return!!this.shouldParseExportDeclaration()&&(e.specifiers=[],e.source=null,this.hasPlugin("importAssertions")?e.assertions=[]:e.attributes=[],e.declaration=this.parseExportDeclaration(e),!0)}isAsyncFunction(){if(!this.isContextual(95))return!1;const e=this.nextTokenInLineStart();return this.isUnparsedContextual(e,"function")}parseExportDefaultExpression(){const e=this.startNode();if(this.match(68))return this.next(),this.parseFunction(e,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(e,13);if(this.match(80))return this.parseClass(e,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&!0===this.getPluginOption("decorators","decoratorsBeforeExport")&&this.raise(v.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(v.UnsupportedDefaultExport,this.state.startLoc);const t=this.parseMaybeAssignAllowIn();return this.semicolon(),t}parseExportDeclaration(e){if(this.match(80)){return this.parseClass(this.startNode(),!0,!1)}return this.parseStatementListItem()}isExportDefaultSpecifier(){const{type:e}=this.state;if(R(e)){if(95===e&&!this.state.containsEsc||100===e)return!1;if((130===e||129===e)&&!this.state.containsEsc){const{type:e}=this.lookahead();if(R(e)&&98!==e||5===e)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;const t=this.nextTokenStart(),s=this.isUnparsedContextual(t,"from");if(44===this.input.charCodeAt(t)||R(this.state.type)&&s)return!0;if(this.match(65)&&s){const e=this.input.charCodeAt(this.nextTokenStartSince(t+4));return 34===e||39===e}return!1}parseExportFrom(e,t){this.eatContextual(98)?(e.source=this.parseImportSource(),this.checkExport(e),this.maybeParseImportAttributes(e),this.checkJSONModuleImport(e)):t&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){const{type:e}=this.state;return 26===e&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(!0===this.getPluginOption("decorators","decoratorsBeforeExport")&&this.raise(v.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(v.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(v.UsingDeclarationExport,this.state.startLoc),!0):74===e||75===e||68===e||80===e||this.isLet()||this.isAsyncFunction()}checkExport(e,t,s,i){var r;if(t)if(s){if(this.checkDuplicateExports(e,"default"),this.hasPlugin("exportDefaultFrom")){var a;const t=e.declaration;"Identifier"!==t.type||"from"!==t.name||t.end-t.start!=4||null!=(a=t.extra)&&a.parenthesized||this.raise(v.ExportDefaultFromAsIdentifier,t)}}else if(null!=(r=e.specifiers)&&r.length)for(const t of e.specifiers){const{exported:e}=t,s="Identifier"===e.type?e.name:e.value;if(this.checkDuplicateExports(t,s),!i&&t.local){const{local:e}=t;"Identifier"!==e.type?this.raise(v.ExportBindingIsString,t,{localName:e.value,exportName:s}):(this.checkReservedWord(e.name,e.loc.start,!0,!1),this.scope.checkLocalExport(e))}}else if(e.declaration){const t=e.declaration;if("FunctionDeclaration"===t.type||"ClassDeclaration"===t.type){const{id:s}=t;if(!s)throw new Error("Assertion failure");this.checkDuplicateExports(e,s.name)}else if("VariableDeclaration"===t.type)for(const e of t.declarations)this.checkDeclaration(e.id)}}checkDeclaration(e){if("Identifier"===e.type)this.checkDuplicateExports(e,e.name);else if("ObjectPattern"===e.type)for(const t of e.properties)this.checkDeclaration(t);else if("ArrayPattern"===e.type)for(const t of e.elements)t&&this.checkDeclaration(t);else"ObjectProperty"===e.type?this.checkDeclaration(e.value):"RestElement"===e.type?this.checkDeclaration(e.argument):"AssignmentPattern"===e.type&&this.checkDeclaration(e.left)}checkDuplicateExports(e,t){this.exportedIdentifiers.has(t)&&("default"===t?this.raise(v.DuplicateDefaultExport,e):this.raise(v.DuplicateExport,e,{exportName:t})),this.exportedIdentifiers.add(t)}parseExportSpecifiers(e){const t=[];let s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;const i=this.isContextual(130),r=this.match(134),a=this.startNode();a.local=this.parseModuleExportName(),t.push(this.parseExportSpecifier(a,r,e,i))}return t}parseExportSpecifier(e,t,s,i){return this.eatContextual(93)?e.exported=this.parseModuleExportName():t?e.exported=st(e.local):e.exported||(e.exported=tt(e.local)),this.finishNode(e,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){const e=this.parseStringLiteral(this.state.value),t=Dt.exec(e.value);return t&&this.raise(v.ModuleExportNameHasLoneSurrogate,e,{surrogateCharCode:t[0].charCodeAt(0)}),e}return this.parseIdentifier(!0)}isJSONModuleImport(e){return null!=e.assertions&&e.assertions.some(({key:e,value:t})=>"json"===t.value&&("Identifier"===e.type?"type"===e.name:"type"===e.value))}checkImportReflection(e){const{specifiers:t}=e,s=1===t.length?t[0].type:null;if("source"===e.phase)"ImportDefaultSpecifier"!==s&&this.raise(v.SourcePhaseImportRequiresDefault,t[0].loc.start);else if("defer"===e.phase)"ImportNamespaceSpecifier"!==s&&this.raise(v.DeferImportRequiresNamespace,t[0].loc.start);else if(e.module){var i;"ImportDefaultSpecifier"!==s&&this.raise(v.ImportReflectionNotBinding,t[0].loc.start),(null==(i=e.assertions)?void 0:i.length)>0&&this.raise(v.ImportReflectionHasAssertion,t[0].loc.start)}}checkJSONModuleImport(e){if(this.isJSONModuleImport(e)&&"ExportAllDeclaration"!==e.type){const{specifiers:t}=e;if(null!=t){const e=t.find(e=>{let t;if("ExportSpecifier"===e.type?t=e.local:"ImportSpecifier"===e.type&&(t=e.imported),void 0!==t)return"Identifier"===t.type?"default"!==t.name:"default"!==t.value});void 0!==e&&this.raise(v.ImportJSONBindingNotDefault,e.loc.start)}}}isPotentialImportPhase(e){return!e&&(this.isContextual(105)||this.isContextual(97)||this.isContextual(127))}applyImportPhase(e,t,s,i){t||("module"===s?(this.expectPlugin("importReflection",i),e.module=!0):this.hasPlugin("importReflection")&&(e.module=!1),"source"===s?(this.expectPlugin("sourcePhaseImports",i),e.phase="source"):"defer"===s?(this.expectPlugin("deferredImportEvaluation",i),e.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(e.phase=null))}parseMaybeImportPhase(e,t){if(!this.isPotentialImportPhase(t))return this.applyImportPhase(e,t,null),null;const s=this.parseIdentifier(!0),{type:i}=this.state;return(U(i)?98!==i||102===this.lookaheadCharCode():12!==i)?(this.resetPreviousIdentifierLeadingComments(s),this.applyImportPhase(e,t,s.name,s.loc.start),null):(this.applyImportPhase(e,t,null),s)}isPrecedingIdImportPhase(e){const{type:t}=this.state;return R(t)?98!==t||102===this.lookaheadCharCode():12!==t}parseImport(e){return this.match(134)?this.parseImportSourceAndAttributes(e):this.parseImportSpecifiersAndAfter(e,this.parseMaybeImportPhase(e,!1))}parseImportSpecifiersAndAfter(e,t){e.specifiers=[];const s=!this.maybeParseDefaultImportSpecifier(e,t)||this.eat(12),i=s&&this.maybeParseStarImportSpecifier(e);return s&&!i&&this.parseNamedImportSpecifiers(e),this.expectContextual(98),this.parseImportSourceAndAttributes(e)}parseImportSourceAndAttributes(e){return null!=e.specifiers||(e.specifiers=[]),e.source=this.parseImportSource(),this.maybeParseImportAttributes(e),this.checkImportReflection(e),this.checkJSONModuleImport(e),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(e,t,s){t.local=this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,s))}finishImportSpecifier(e,t,s=8201){return this.checkLVal(e.local,{type:t},s),this.finishNode(e,t)}parseImportAttributes(){this.expect(5);const e=[],t=new Set;do{if(this.match(8))break;const s=this.startNode(),i=this.state.value;if(t.has(i)&&this.raise(v.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:i}),t.add(i),this.match(134)?s.key=this.parseStringLiteral(i):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(v.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),e}parseModuleAttributes(){const e=[],t=new Set;do{const s=this.startNode();if(s.key=this.parseIdentifier(!0),"type"!==s.key.name&&this.raise(v.ModuleAttributeDifferentFromType,s.key),t.has(s.key.name)&&this.raise(v.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),t.add(s.key.name),this.expect(14),!this.match(134))throw this.raise(v.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return e}maybeParseImportAttributes(e){let t;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&40===this.lookaheadCharCode())return;this.next(),this.hasPlugin("moduleAttributes")?(t=this.parseModuleAttributes(),this.addExtra(e,"deprecatedWithLegacySyntax",!0)):t=this.parseImportAttributes(),s=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(this.hasPlugin("deprecatedImportAssert")||this.hasPlugin("importAssertions")||this.raise(v.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(e,"deprecatedAssertSyntax",!0),this.next(),t=this.parseImportAttributes()):t=[];!s&&this.hasPlugin("importAssertions")?e.assertions=t:e.attributes=t}maybeParseDefaultImportSpecifier(e,t){if(t){const s=this.startNodeAtNode(t);return s.local=t,e.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}return!!U(this.state.type)&&(this.parseImportSpecifierLocal(e,this.startNode(),"ImportDefaultSpecifier"),!0)}maybeParseStarImportSpecifier(e){if(this.match(55)){const t=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(e,t,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(e){let t=!0;for(this.expect(5);!this.eat(8);){if(t)t=!1;else{if(this.eat(14))throw this.raise(v.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}const s=this.startNode(),i=this.match(134),r=this.isContextual(130);s.imported=this.parseModuleExportName();const a=this.parseImportSpecifier(s,i,"type"===e.importKind||"typeof"===e.importKind,r,void 0);e.specifiers.push(a)}}parseImportSpecifier(e,t,s,i,r){if(this.eatContextual(93))e.local=this.parseIdentifier();else{const{imported:s}=e;if(t)throw this.raise(v.ImportBindingIsString,e,{importName:s.value});this.checkReservedWord(s.name,e.loc.start,!0,!0),e.local||(e.local=tt(s))}return this.finishImportSpecifier(e,"ImportSpecifier",r)}isThisParam(e){return"Identifier"===e.type&&"this"===e.name}}class Ot extends Lt{constructor(e,t,s){super(e=function(e){const t={sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0};if(null==e)return t;if(null!=e.annexB&&!1!==e.annexB)throw new Error("The `annexB` option can only be set to `false`.");for(const s of Object.keys(t))null!=e[s]&&(t[s]=e[s]);if(1===t.startLine)null==e.startIndex&&t.startColumn>0?t.startIndex=t.startColumn:null==e.startColumn&&t.startIndex>0&&(t.startColumn=t.startIndex);else if((null==e.startColumn||null==e.startIndex)&&null!=e.startIndex)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");return t}(e),t),this.options=e,this.initializeScopes(),this.plugins=s,this.filename=e.sourceFilename,this.startIndex=e.startIndex;let i=0;e.allowAwaitOutsideFunction&&(i|=1),e.allowReturnOutsideFunction&&(i|=2),e.allowImportExportEverywhere&&(i|=8),e.allowSuperOutsideMethod&&(i|=16),e.allowUndeclaredExports&&(i|=64),e.allowNewTargetOutsideFunction&&(i|=4),e.allowYieldOutsideFunction&&(i|=32),e.ranges&&(i|=128),e.tokens&&(i|=256),e.createImportExpressions&&(i|=512),e.createParenthesizedExpressions&&(i|=1024),e.errorRecovery&&(i|=2048),e.attachComment&&(i|=4096),e.annexB&&(i|=8192),this.optionFlags=i}getScopeHandler(){return me}parse(){this.enterInitialScopes();const e=this.startNode(),t=this.startNode();return this.nextToken(),e.errors=null,this.parseTopLevel(e,t),e.errors=this.state.errors,e.comments.length=this.state.commentsLen,e}}const Mt=function(e){const t={};for(const s of Object.keys(e))t[s]=J(e[s]);return t}(B);function Ft(e,t){let s=Ot;const i=new Map;if(null!=e&&e.plugins){for(const t of e.plugins){let e,s;"string"==typeof t?e=t:[e,s]=t,i.has(e)||i.set(e,s||{})}!function(e){if(e.has("decorators")){if(e.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");const t=e.get("decorators").decoratorsBeforeExport;if(null!=t&&"boolean"!=typeof t)throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");const s=e.get("decorators").allowCallParenthesized;if(null!=s&&"boolean"!=typeof s)throw new Error("'allowCallParenthesized' must be a boolean.")}if(e.has("flow")&&e.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(e.has("placeholders")&&e.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(e.has("pipelineOperator")){var t;const s=e.get("pipelineOperator").proposal;if(!wt.includes(s)){const e=wt.map(e=>`"${e}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`)}const i="hash"===(null==(t=e.get("recordAndTuple"))?void 0:t.syntaxType);if("hack"===s){if(e.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(e.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");const t=e.get("pipelineOperator").topicToken;if(!At.includes(t)){const e=At.map(e=>`"${e}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${e}.`)}if("#"===t&&i)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",e.get("recordAndTuple")])}\`.`)}else if("smart"===s&&i)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",e.get("recordAndTuple")])}\`.`)}if(e.has("moduleAttributes")){if(e.has("deprecatedImportAssert")||e.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if("may-2020"!==e.get("moduleAttributes").version)throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(e.has("importAssertions")&&e.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(!e.has("deprecatedImportAssert")&&e.has("importAttributes")&&e.get("importAttributes").deprecatedAssertSyntax&&e.set("deprecatedImportAssert",{}),e.has("recordAndTuple")){const t=e.get("recordAndTuple").syntaxType;if(null!=t){const e=["hash","bar"];if(!e.includes(t))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+e.map(e=>`'${e}'`).join(", "))}}if(e.has("asyncDoExpressions")&&!e.has("doExpressions")){const e=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw e.missingPlugins="doExpressions",e}if(e.has("optionalChainingAssign")&&"2023-07"!==e.get("optionalChainingAssign").version)throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}(i),s=function(e){const t=[];for(const s of Et)e.has(s)&&t.push(s);const s=t.join("|");let i=jt.get(s);if(!i){i=Ot;for(const e of t)i=Ct[e](i);jt.set(s,i)}return i}(i)}return new s(e,t,i)}const jt=new Map;t.parse=function(e,t){var s;if("unambiguous"!==(null==(s=t)?void 0:s.sourceType))return Ft(t,e).parse();t=Object.assign({},t);try{t.sourceType="module";const s=Ft(t,e),i=s.parse();if(s.sawUnambiguousESM)return i;if(s.ambiguousScriptDifferentAst)try{return t.sourceType="script",Ft(t,e).parse()}catch(e){}else i.program.sourceType="script";return i}catch(s){try{return t.sourceType="script",Ft(t,e).parse()}catch(e){}throw s}},t.parseExpression=function(e,t){const s=Ft(t,e);return s.options.strictMode&&(s.state.strict=!0),s.getExpression()},t.tokTypes=Mt},"0BPS":function(e,t){},"0xDb":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_exports__.f=titleCase,__webpack_exports__.d=isNumberStr,__webpack_require__.d(__webpack_exports__,"c",function(){return exportDefault}),__webpack_require__.d(__webpack_exports__,"a",function(){return beautifierConf}),__webpack_exports__.b=deepClone,__webpack_exports__.e=isObjectObject;var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof__=__webpack_require__("pFYg"),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof__),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify__=__webpack_require__("mvHQ"),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify__);function indent(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(0===t)return e;var i=t<0,r=[],a=void 0,n="";if(i)t*=-1,a=new RegExp("(^\\s{0,"+t*s+"})","g");else for(var o=0;o-1?eval("("+v+")"):v})}function jsonClone(e){return parse(stringify(e))}function deepClone(e){var t=Object.prototype.toString;if(!e||"object"!==(void 0===e?"undefined":__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(e)))return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if("[object Date]"===t.call(e))return new Date(e.getTime());if("[object RegExp]"===t.call(e)){var s=[];return e.global&&s.push("g"),e.multiline&&s.push("m"),e.ignoreCase&&s.push("i"),new RegExp(e.source,s.join(""))}var i=Array.isArray(e)?[]:e.constructor?new e.constructor:{};for(var r in e)i[r]=deepClone(e[r]);return i}var toStr=Function.prototype.call.bind(Object.prototype.toString);function isObjectObject(e){return"[object Object]"===toStr(e)}function isObjectArray(e){return"[object Array]"===toStr(e)}function isObjectNull(e){return"[object Null]"===toStr(e)}function isObjectUnde(e){return"[object Undefined]"===toStr(e)}},"2xlB":function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={options:function(e,t,s){var i=[];return t.__slot__.options.forEach(function(s){"button"===t.__config__.optionType?i.push(e("el-checkbox-button",{attrs:{label:s.value}},[s.label])):i.push(e("el-checkbox",{attrs:{label:s.value,border:t.border}},[s.label]))}),i}}},"3J0L":function(e,t){},"6Wf5":function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"list-type":function(e,t,s){var i=[],r=t.__config__;return"picture-card"===t["list-type"]?i.push(e("i",{class:"el-icon-plus"})):i.push(e("el-button",{attrs:{size:"small",type:"primary",icon:"el-icon-upload"}},[r.buttonText])),r.showTip&&i.push(e("div",{slot:"tip",class:"el-upload__tip"},["只能上传不超过 ",r.fileSize,r.sizeUnit," 的",t.accept,"文件"])),i}}},"6jw4":function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={default:function(e,t,s){return t.__slot__[s]}}},"9Xua":function(e,t){},CMu7:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={options:function(e,t,s){var i=[];return t.__slot__.options.forEach(function(s){"button"===t.__config__.optionType?i.push(e("el-radio-button",{attrs:{label:s.value}},[s.label])):i.push(e("el-radio",{attrs:{label:s.value,border:t.border}},[s.label]))}),i}}},"Es9+":function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={options:function(e,t,s){var i=[];return t.__slot__.options.forEach(function(s){"button"===t.__config__.optionType?i.push(e("el-radio-button",{attrs:{label:s.value}},[s.label])):i.push(e("el-radio",{attrs:{label:s.value,border:t.border}},[s.label]))}),i}}},Evca:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={options:function(e,t,s){var i=[];return t.__slot__.options.forEach(function(t){i.push(e("el-option",{attrs:{label:t.label,value:t.value,disabled:t.disabled}}))}),i}}},G6MI:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={options:function(e,t,s){var i=[];return t.__slot__.options.forEach(function(s){"button"===t.__config__.optionType?i.push(e("el-checkbox-button",{attrs:{label:s.value}},[s.label])):i.push(e("el-checkbox",{attrs:{label:s.value,border:t.border}},[s.label]))}),i}}},OMJi:function(e,t,s){(function(e){var i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),s={},i=0;i=a)return e;switch(e){case"%s":return String(i[s++]);case"%d":return Number(i[s++]);case"%j":try{return JSON.stringify(i[s++])}catch(e){return"[Circular]"}default:return e}}),l=i[s];s=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),f(s)?i.showHidden=s:s&&t._extend(i,s),v(i.showHidden)&&(i.showHidden=!1),v(i.depth)&&(i.depth=2),v(i.colors)&&(i.colors=!1),v(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=l),p(i,e,i.depth)}function l(e,t){var s=o.styles[t];return s?"["+o.colors[s][0]+"m"+e+"["+o.colors[s][1]+"m":e}function c(e,t){return e}function p(e,s,i){if(e.customInspect&&s&&T(s.inspect)&&s.inspect!==t.inspect&&(!s.constructor||s.constructor.prototype!==s)){var r=s.inspect(i,e);return g(r)||(r=p(e,r,i)),r}var a=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(g(t)){var s="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(s,"string")}if(y(t))return e.stylize(""+t,"number");if(f(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,s);if(a)return a;var n=Object.keys(s),o=function(e){var t={};return e.forEach(function(e,s){t[e]=!0}),t}(n);if(e.showHidden&&(n=Object.getOwnPropertyNames(s)),P(s)&&(n.indexOf("message")>=0||n.indexOf("description")>=0))return h(s);if(0===n.length){if(T(s)){var l=s.name?": "+s.name:"";return e.stylize("[Function"+l+"]","special")}if(b(s))return e.stylize(RegExp.prototype.toString.call(s),"regexp");if(_(s))return e.stylize(Date.prototype.toString.call(s),"date");if(P(s))return h(s)}var c,x="",w=!1,A=["{","}"];(d(s)&&(w=!0,A=["[","]"]),T(s))&&(x=" [Function"+(s.name?": "+s.name:"")+"]");return b(s)&&(x=" "+RegExp.prototype.toString.call(s)),_(s)&&(x=" "+Date.prototype.toUTCString.call(s)),P(s)&&(x=" "+h(s)),0!==n.length||w&&0!=s.length?i<0?b(s)?e.stylize(RegExp.prototype.toString.call(s),"regexp"):e.stylize("[Object]","special"):(e.seen.push(s),c=w?function(e,t,s,i,r){for(var a=[],n=0,o=t.length;n=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return s[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+s[1];return s[0]+t+" "+e.join(", ")+" "+s[1]}(c,x,A)):A[0]+x+A[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function u(e,t,s,i,r,a){var n,o,l;if((l=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}).get?o=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(o=e.stylize("[Setter]","special")),E(i,r)||(n="["+r+"]"),o||(e.seen.indexOf(l.value)<0?(o=m(s)?p(e,l.value,null):p(e,l.value,s-1)).indexOf("\n")>-1&&(o=a?o.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+o.split("\n").map(function(e){return" "+e}).join("\n")):o=e.stylize("[Circular]","special")),v(n)){if(a&&r.match(/^\d+$/))return o;(n=JSON.stringify(""+r)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(n=n.substr(1,n.length-2),n=e.stylize(n,"name")):(n=n.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),n=e.stylize(n,"string"))}return n+": "+o}function d(e){return Array.isArray(e)}function f(e){return"boolean"==typeof e}function m(e){return null===e}function y(e){return"number"==typeof e}function g(e){return"string"==typeof e}function v(e){return void 0===e}function b(e){return x(e)&&"[object RegExp]"===w(e)}function x(e){return"object"==typeof e&&null!==e}function _(e){return x(e)&&"[object Date]"===w(e)}function P(e){return x(e)&&("[object Error]"===w(e)||e instanceof Error)}function T(e){return"function"==typeof e}function w(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(s){if(v(a)&&(a=Object({NODE_ENV:"production"}).NODE_DEBUG||""),s=s.toUpperCase(),!n[s])if(new RegExp("\\b"+s+"\\b","i").test(a)){var i=e.pid;n[s]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",s,i,e)}}else n[s]=function(){};return n[s]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=f,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=b,t.isObject=x,t.isDate=_,t.isError=P,t.isFunction=T,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=s("fC4T");var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,s;console.log("%s - %s",(e=new Date,s=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":"),[e.getDate(),C[e.getMonth()],s].join(" ")),t.format.apply(t,arguments))},t.inherits=s("ONRY"),t._extend=function(e,t){if(!t||!x(t))return e;for(var s=Object.keys(t),i=s.length;i--;)e[s[i]]=t[s[i]];return e};var S="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(e,t){if(!e){var s=new Error("Promise was rejected with a falsy value");s.reason=e,e=s}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(S&&e[S]){var t;if("function"!=typeof(t=e[S]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,S,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,s,i=new Promise(function(e,i){t=e,s=i}),r=[],a=0;a1&&void 0!==arguments[1]?arguments[1]:{container:document.body},s="";return"string"==typeof e?s=h(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null===e||void 0===e?void 0:e.type)?s=h(e.value,t):(s=l()(e),c("copy")),s};function d(e){"@babel/helpers - typeof";return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,s=void 0===t?"copy":t,i=e.container,r=e.target,a=e.text;if("copy"!==s&&"cut"!==s)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==r){if(!r||"object"!==d(r)||1!==r.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===s&&r.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===s&&(r.hasAttribute("readonly")||r.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return a?u(a,{container:i}):r?"cut"===s?p(r):u(r,{container:i}):void 0};function m(e){"@babel/helpers - typeof";return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return u(e,t)}},{key:"cut",value:function(e){return p(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,s=!!document.queryCommandSupported;return t.forEach(function(e){s=s&&!!document.queryCommandSupported(e)}),s}}],(s=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===m(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=n()(e,"click",function(e){return t.onClick(e)})}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,s=this.action(t)||"copy",i=f({action:s,container:this.container,target:this.target(t),text:this.text(t)});this.emit(i?"success":"error",{action:s,text:i,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return x("action",e)}},{key:"defaultTarget",value:function(e){var t=x("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return x("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}])&&y(t.prototype,s),i&&y(t,i),o}()},828:function(e){var t=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var s=Element.prototype;s.matches=s.matchesSelector||s.mozMatchesSelector||s.msMatchesSelector||s.oMatchesSelector||s.webkitMatchesSelector}e.exports=function(e,s){for(;e&&e.nodeType!==t;){if("function"==typeof e.matches&&e.matches(s))return e;e=e.parentNode}}},438:function(e,t,s){var i=s(828);function r(e,t,s,r,a){var n=function(e,t,s,r){return function(s){s.delegateTarget=i(s.target,t),s.delegateTarget&&r.call(e,s)}}.apply(this,arguments);return e.addEventListener(s,n,a),{destroy:function(){e.removeEventListener(s,n,a)}}}e.exports=function(e,t,s,i,a){return"function"==typeof e.addEventListener?r.apply(null,arguments):"function"==typeof s?r.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(e){return r(e,t,s,i,a)}))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var s=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===s||"[object HTMLCollection]"===s)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,s){var i=s(879),r=s(438);e.exports=function(e,t,s){if(!e&&!t&&!s)throw new Error("Missing required arguments");if(!i.string(t))throw new TypeError("Second argument must be a String");if(!i.fn(s))throw new TypeError("Third argument must be a Function");if(i.node(e))return function(e,t,s){return e.addEventListener(t,s),{destroy:function(){e.removeEventListener(t,s)}}}(e,t,s);if(i.nodeList(e))return function(e,t,s){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,s)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,s)})}}}(e,t,s);if(i.string(e))return function(e,t,s){return r(document.body,e,t,s)}(e,t,s);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var s=e.hasAttribute("readonly");s||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),s||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var i=window.getSelection(),r=document.createRange();r.selectNodeContents(e),i.removeAllRanges(),i.addRange(r),t=i.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,s){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:s}),this},once:function(e,t,s){var i=this;function r(){i.off(e,r),t.apply(s,arguments)}return r._=t,this.on(e,r,s)},emit:function(e){for(var t=[].slice.call(arguments,1),s=((this.e||(this.e={}))[e]||[]).slice(),i=0,r=s.length;i\n \n "+e+"\n
\n "}function S(e){return"