@storybook/codemod 0.0.0-pr-28483-sha-b6e8d097 → 0.0.0-pr-28519-sha-c31b2497
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/transforms/add-component-parameters.js +1 -1
- package/dist/transforms/csf-2-to-3.js +1 -1
- package/dist/transforms/csf-hoist-story-annotations.js +1 -1
- package/dist/transforms/find-implicit-spies.js +1 -1
- package/dist/transforms/mdx-to-csf.js +1 -1
- package/dist/transforms/migrate-to-test-package.js +1 -1
- package/dist/transforms/move-builtin-addons.js +1 -1
- package/dist/transforms/storiesof-to-csf.js +1 -1
- package/dist/transforms/update-addon-info.js +1 -1
- package/dist/transforms/update-organisation-name.js +1 -1
- package/dist/transforms/upgrade-deprecated-types.js +1 -1
- package/dist/transforms/upgrade-hierarchy-separators.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{listCodemods:()=>listCodemods,packageNames:()=>packageNames,runCodemod:()=>runCodemod,updateAddonInfo:()=>transformer2,updateOrganisationName:()=>transformer});module.exports=__toCommonJS(src_exports);var import_fs=__toESM(require("fs")),import_path=__toESM(require("path")),import_util=require("util"),import_cross_spawn=require("cross-spawn");var import_camelCase=__toESM(require("lodash/camelCase.js")),import_upperFirst=__toESM(require("lodash/upperFirst.js"));function jscodeshiftToPrettierParser(parser){let parserMap={babylon:"babel",flow:"flow",ts:"typescript",tsx:"typescript"};return parser&&parserMap[parser]||"babel"}var packageNames={"@kadira/react-storybook-decorator-centered":"@storybook/addon-centered","@kadira/storybook-addons":"storybook/internal/preview-api","@kadira/storybook-addon-actions":"@storybook/addon-actions","@kadira/storybook-addon-comments":"@storybook/addon-comments","@kadira/storybook-addon-graphql":"@storybook/addon-graphql","@kadira/storybook-addon-info":"@storybook/addon-info","@kadira/storybook-addon-knobs":"@storybook/addon-knobs","@kadira/storybook-addon-links":"@storybook/addon-links","@kadira/storybook-addon-notes":"@storybook/addon-notes","@kadira/storybook-addon-options":"@storybook/addon-options","@kadira/storybook-channels":"storybook/internal/channels","@kadira/storybook-channel-postmsg":"@storybook/channel-postmessage","@kadira/storybook-channel-websocket":"@storybook/channel-websocket","@kadira/storybook-ui":"storybook/internal/manager","@kadira/react-native-storybook":"@storybook/react-native","@kadira/react-storybook":"@storybook/react","@kadira/getstorybook":"storybook","@kadira/storybook":"@storybook/react",storyshots:"@storybook/addon-storyshots",getstorybook:"storybook"};function transformer(file,api){let j=api.jscodeshift,packageNamesKeys=Object.keys(packageNames),getMatch=oldpart=>packageNamesKeys.find(newpart=>oldpart.match(newpart)),getNewPackageName=oldPackageName=>{let match=getMatch(oldPackageName);if(match){let replacement=packageNames[match];return oldPackageName.replace(match,replacement)}return oldPackageName},updatePackageName=declaration=>(declaration.node.source.value=getNewPackageName(declaration.node.source.value),declaration.node);return j(file.source).find(j.ImportDeclaration).replaceWith(updatePackageName).toSource({quote:"single"})}function transformer2(file,api){let j=api.jscodeshift,root=j(file.source),getOptions=args=>args[3]===void 0?args[2]===void 0?[args[0]]:[args[1]]:[j.objectExpression([j.property("init",j.identifier("text"),args[1]),...args[3].properties])],withInfo=addWithInfoExpression=>{let{node}=addWithInfoExpression,args=node.arguments,storyComponent=args[2]?args[2]:args[1];return node.callee.property.name="add",node.arguments=[args[0],j.callExpression(j.callExpression(j.identifier("withInfo"),getOptions(args)),[storyComponent])],node},checkWithInfoImport=()=>{root.find(j.ImportDeclaration).filter(imp=>imp.node.source.value==="@storybook/addon-info").size()||root.find(j.ImportDeclaration).at(-1).insertAfter(j.importDeclaration([j.importSpecifier(j.identifier("withInfo"))],j.literal("@storybook/addon-info")))},addWithInfoExpressions=root.find(j.CallExpression,{callee:{property:{name:"addWithInfo"}}});return addWithInfoExpressions.size()&&(checkWithInfoImport(),addWithInfoExpressions.replaceWith(withInfo)),root.toSource()}var TRANSFORM_DIR=`${__dirname}/transforms`;function listCodemods(){return import_fs.default.readdirSync(TRANSFORM_DIR).filter(fname=>fname.endsWith(".js")).map(fname=>fname.slice(0,-3))}var renameAsync=(0,import_util.promisify)(import_fs.default.rename);async function renameFile(file,from,to,{logger}){let newFile=file.replace(from,to);return logger.log(`Rename: ${file} ${newFile}`),renameAsync(file,newFile)}async function runCodemod(codemod,{glob,logger,dryRun,rename,parser}){if(!listCodemods().includes(codemod))throw new Error(`Unknown codemod ${codemod}. Run --list for options.`);let renameParts=null;if(rename&&(renameParts=rename.split(":"),renameParts.length!==2))throw new Error(`Codemod rename: expected format "from:to", got "${rename}"`);let inferredParser=parser;if(!parser){let extension=import_path.default.extname(glob).slice(1);jscodeshiftToPrettierParser(extension)!=="babel"&&(inferredParser=extension)}let{globby}=await import("globby"),files=await globby([glob,"!**/node_modules","!**/dist"]),extensions=new Set(files.map(file=>import_path.default.extname(file).slice(1))),commaSeparatedExtensions=Array.from(extensions).join(",");if(logger.log(`=> Applying ${codemod}: ${files.length} files`),files.length===0){logger.log(`=> No matching files for glob: ${glob}`);return}if(!dryRun&&files.length>0){let parserArgs=inferredParser?["--parser",inferredParser]:[],result=(0,import_cross_spawn.sync)("node",[require.resolve("jscodeshift/bin/jscodeshift"),"--no-babel",`--extensions=${commaSeparatedExtensions}`,"--fail-on-error","-t",`${TRANSFORM_DIR}/${codemod}.js`,...parserArgs,...files.map(file=>`"${file}"`)],{stdio:"inherit",shell:!0});if(codemod==="mdx-to-csf"&&result.status===1)logger.log("The codemod was not able to transform the files mentioned above. We have renamed the files to .mdx.broken. Please check the files and rename them back to .mdx after you have either manually transformed them to mdx + csf or fixed the issues so that the codemod can transform them.");else if(result.status===1){logger.log("Skipped renaming because of errors.");return}}if(renameParts){let[from,to]=renameParts;logger.log(`=> Renaming ${rename}: ${files.length} files`),await Promise.all(files.map(file=>renameFile(file,new RegExp(`${from}$`),to,{logger})))}}0&&(module.exports={listCodemods,packageNames,runCodemod,updateAddonInfo,updateOrganisationName});
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var add_component_parameters_exports={};__export(add_component_parameters_exports,{default:()=>transformer});module.exports=__toCommonJS(add_component_parameters_exports);function transformer(file,api){let j=api.jscodeshift,root=j(file.source),importMap={};root.find(j.ImportDeclaration).forEach(imp=>imp.node.specifiers.forEach(spec=>{importMap[spec.local.name]=!0}));function getLeafName(string){let parts=string.split(/\/|\.|\|/);return parts[parts.length-1]}function addComponentParameter(call){let{node}=call,leafName=getLeafName(node.arguments[0].value);return j.callExpression(j.memberExpression(node,j.identifier("addParameters")),[j.objectExpression([j.property("init",j.identifier("component"),j.identifier(leafName))])])}return root.find(j.CallExpression).filter(call=>call.node.callee.name==="storiesOf").filter(call=>call.node.arguments.length>0&&call.node.arguments[0].type==="Literal").filter(call=>{let leafName=getLeafName(call.node.arguments[0].value);return importMap[leafName]}).replaceWith(addComponentParameter),root.toSource()}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
|
1
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var csf_2_to_3_exports={};__export(csf_2_to_3_exports,{default:()=>transform,parser:()=>parser});module.exports=__toCommonJS(csf_2_to_3_exports);var import_prettier2=__toESM(require("prettier")),t2=__toESM(require("@babel/types")),import_types=require("@babel/types"),import_csf_tools2=require("@storybook/core/csf-tools"),babel2=__toESM(require("@babel/core")),import_tiny_invariant=__toESM(require("tiny-invariant"));var import_prettier=__toESM(require("prettier")),babel=__toESM(require("@babel/core")),import_csf_tools=require("@storybook/core/csf-tools"),t=__toESM(require("@babel/types"));var deprecatedTypes=["ComponentStory","ComponentStoryFn","ComponentStoryObj","ComponentMeta","Story"];function migrateType(oldType){return oldType==="Story"||oldType==="ComponentStory"?"StoryFn":oldType.replace("Component","")}function upgradeDeprecatedTypes(file){let importedNamespaces=new Set,typeReferencesToUpdate=new Set,existingImports=[];file.path.traverse({ImportDeclaration:path=>{existingImports.push(...path.get("specifiers").map(specifier=>({name:specifier.node.local.name,isAlias:!(specifier.isImportSpecifier()&&t.isIdentifier(specifier.node.imported)&&specifier.node.local.name===specifier.node.imported.name),path:specifier}))),path.node.source.value.startsWith("@storybook")&&path.get("specifiers").forEach(specifier=>{if(specifier.isImportNamespaceSpecifier()&&importedNamespaces.add(specifier.node.local.name),!specifier.isImportSpecifier())return;let imported=specifier.get("imported");if(imported.isIdentifier()&&deprecatedTypes.includes(imported.node.name)){imported.node.name===specifier.node.local.name&&typeReferencesToUpdate.add(specifier.node.local.name);let newType=migrateType(imported.node.name);if(!existingImports.some(it=>it.name===newType))imported.replaceWith(t.identifier(newType)),existingImports.push({name:newType,isAlias:!1,path:specifier});else{let existingImport=existingImports.find(it=>it.name===newType&&it.isAlias);if(existingImport)throw existingImport.path.buildCodeFrameError(`This codemod does not support local imports that are called the same as a storybook import.
|
2
2
|
Rename this local import and try again.`);specifier.remove()}}})}}),file.path.traverse({TSTypeReference:path=>{let typeName=path.get("typeName");if(typeName.isIdentifier())typeReferencesToUpdate.has(typeName.node.name)&&typeName.replaceWith(t.identifier(migrateType(typeName.node.name)));else if(typeName.isTSQualifiedName()){let namespace=typeName.get("left");if(namespace.isIdentifier()&&importedNamespaces.has(namespace.node.name)){let right=typeName.get("right");deprecatedTypes.includes(right.node.name)&&right.replaceWith(t.identifier(migrateType(right.node.name)))}}}})}var logger=console,renameAnnotation=annotation=>annotation==="storyName"?"name":annotation,getTemplateBindVariable=init=>t2.isCallExpression(init)&&t2.isMemberExpression(init.callee)&&t2.isIdentifier(init.callee.object)&&t2.isIdentifier(init.callee.property)&&init.callee.property.name==="bind"&&(init.arguments.length===0||init.arguments.length===1&&t2.isObjectExpression(init.arguments[0])&&init.arguments[0].properties.length===0)?init.callee.object.name:null,isStoryAnnotation=(stmt,objectExports)=>t2.isExpressionStatement(stmt)&&t2.isAssignmentExpression(stmt.expression)&&t2.isMemberExpression(stmt.expression.left)&&t2.isIdentifier(stmt.expression.left.object)&&objectExports[stmt.expression.left.object.name],getNewExport=(stmt,objectExports)=>{if(t2.isExportNamedDeclaration(stmt)&&t2.isVariableDeclaration(stmt.declaration)&&stmt.declaration.declarations.length===1){let decl=stmt.declaration.declarations[0];if(t2.isVariableDeclarator(decl)&&t2.isIdentifier(decl.id))return objectExports[decl.id.name]}return null},isReactGlobalRenderFn=(csf,storyFn)=>{if(csf._meta?.component&&t2.isArrowFunctionExpression(storyFn)&&storyFn.params.length===1&&t2.isJSXElement(storyFn.body)){let{openingElement}=storyFn.body;if(openingElement.selfClosing&&t2.isJSXIdentifier(openingElement.name)&&openingElement.attributes.length===1){let attr=openingElement.attributes[0],param=storyFn.params[0];if(t2.isJSXSpreadAttribute(attr)&&t2.isIdentifier(attr.argument)&&t2.isIdentifier(param)&¶m.name===attr.argument.name&&csf._meta.component===openingElement.name.name)return!0}}return!1},isSimpleCSFStory=(init,annotations)=>annotations.length===0&&t2.isArrowFunctionExpression(init)&&init.params.length===0;function removeUnusedTemplates(csf){Object.entries(csf._templates).forEach(([template,templateExpression])=>{let references=[];if(babel2.traverse(csf._ast,{Identifier:path=>{path.node.name===template&&references.push(path)}}),references.length===1){let reference=references[0];reference.parentPath?.isVariableDeclarator()&&reference.parentPath.node.init===templateExpression&&reference.parentPath.remove()}})}async function transform(info,api,options){let makeTitle=userTitle=>userTitle||"FIXME",csf=(0,import_csf_tools2.loadCsf)(info.source,{makeTitle});try{csf.parse()}catch(err){return logger.log(`Error ${err}, skipping`),info.source}let file=new babel2.File({filename:info.path},{code:info.source,ast:csf._ast}),importHelper=new StorybookImportHelper(file,info),objectExports={};Object.entries(csf._storyExports).forEach(([key,decl])=>{let annotations=Object.entries(csf._storyAnnotations[key]).map(([annotation,val])=>t2.objectProperty(t2.identifier(renameAnnotation(annotation)),val));if(t2.isVariableDeclarator(decl)){let{init,id}=decl;(0,import_tiny_invariant.default)(init,"Inital value should be declared");let template=getTemplateBindVariable(init);if(!t2.isArrowFunctionExpression(init)&&!template)return;if(isSimpleCSFStory(init,annotations)){objectExports[key]=t2.exportNamedDeclaration(t2.variableDeclaration("const",[t2.variableDeclarator(importHelper.updateTypeTo(id,"StoryFn"),init)]));return}let storyFn=template?t2.identifier(template):init,renderAnnotation=isReactGlobalRenderFn(csf,template?csf._templates[template]:storyFn)?[]:[t2.objectProperty(t2.identifier("render"),storyFn)];objectExports[key]=t2.exportNamedDeclaration(t2.variableDeclaration("const",[t2.variableDeclarator(importHelper.updateTypeTo(id,"StoryObj"),t2.objectExpression([...renderAnnotation,...annotations]))]))}}),csf._ast.program.body=csf._ast.program.body.reduce((acc,stmt)=>{let statement=stmt;if(isStoryAnnotation(statement,objectExports))return acc;let newExport=getNewExport(statement,objectExports);return newExport?(acc.push(newExport),acc):(acc.push(statement),acc)},[]),upgradeDeprecatedTypes(file),importHelper.removeDeprecatedStoryImport(),removeUnusedTemplates(csf);let output=(0,import_csf_tools2.printCsf)(csf).code;try{output=await import_prettier2.default.format(output,{...await import_prettier2.default.resolveConfig(info.path),filepath:info.path})}catch{logger.log(`Failed applying prettier to ${info.path}.`)}return output}var StorybookImportHelper=class{constructor(file,info){this.getAllSbImportDeclarations=file=>{let found=[];return file.path.traverse({ImportDeclaration:path=>{let source=path.node.source.value;if(source.startsWith("@storybook/csf")||!source.startsWith("@storybook"))return;path.get("specifiers").some(specifier=>{if(specifier.isImportNamespaceSpecifier())throw new Error(`This codemod does not support namespace imports for a ${path.node.source.value} package.
|
3
3
|
Replace the namespace import with named imports and try again.`);if(!specifier.isImportSpecifier())return!1;let imported=specifier.get("imported");return Array.isArray(imported)?imported.some(importedSpecifier=>importedSpecifier.isIdentifier()?["Story","StoryFn","StoryObj","Meta","ComponentStory","ComponentStoryFn","ComponentStoryObj","ComponentMeta"].includes(importedSpecifier.node.name):!1):imported.isIdentifier()?["Story","StoryFn","StoryObj","Meta","ComponentStory","ComponentStoryFn","ComponentStoryObj","ComponentMeta"].includes(imported.node.name):!1})&&found.push(path)}}),found};this.getOrAddImport=type=>{let sbImport=this.sbImportDeclarations.find(path=>path.node.importKind==="type")??this.sbImportDeclarations[0];if(sbImport==null)return;let specifiers=sbImport.get("specifiers"),importSpecifier2=specifiers.find(specifier=>{if(!specifier.isImportSpecifier())return!1;let imported=specifier.get("imported");return imported.isIdentifier()?imported.node.name===type:!1});return importSpecifier2?importSpecifier2.node.local.name:(specifiers[0].insertBefore(t2.importSpecifier(t2.identifier(type),t2.identifier(type))),type)};this.removeDeprecatedStoryImport=()=>{this.sbImportDeclarations.flatMap(it=>it.get("specifiers")).filter(specifier=>{if(!specifier.isImportSpecifier())return!1;let imported=specifier.get("imported");return imported.isIdentifier()?imported.node.name==="Story":!1}).forEach(path=>path.remove())};this.getAllLocalImports=()=>this.sbImportDeclarations.flatMap(it=>it.get("specifiers")).map(it=>it.node.local.name);this.updateTypeTo=(id,type)=>{if((0,import_types.isIdentifier)(id)&&(0,import_types.isTSTypeAnnotation)(id.typeAnnotation)&&(0,import_types.isTSTypeReference)(id.typeAnnotation.typeAnnotation)&&(0,import_types.isIdentifier)(id.typeAnnotation.typeAnnotation.typeName)){let{name}=id.typeAnnotation.typeAnnotation.typeName;if(this.getAllLocalImports().includes(name)){let localTypeImport=this.getOrAddImport(type);return{...id,typeAnnotation:t2.tsTypeAnnotation(t2.tsTypeReference(t2.identifier(localTypeImport??""),id.typeAnnotation.typeAnnotation.typeParameters))}}}return id};this.sbImportDeclarations=this.getAllSbImportDeclarations(file)}},parser="tsx";0&&(module.exports={parser});
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var csf_hoist_story_annotations_exports={};__export(csf_hoist_story_annotations_exports,{default:()=>transformer});module.exports=__toCommonJS(csf_hoist_story_annotations_exports);var getContainingStatement=n=>n.node.type.endsWith("Statement")?n:getContainingStatement(n.parent);function transformer(file,api){let j=api.jscodeshift,root=j(file.source),renameKey=exp=>exp.type==="Identifier"&&exp.name==="name"?j.identifier("storyName"):exp;if(root.find(j.ExportDefaultDeclaration).filter(def=>def.node.declaration.type==="ObjectExpression"&&def.node.declaration.properties.map(p=>p.key.name).includes("title")).size()===0)return root.toSource();let storyAssignments=root.find(j.AssignmentExpression).filter(exp=>{let{left,right}=exp.node;return left.type==="MemberExpression"&&left.object.type==="Identifier"&&left.property.type==="Identifier"&&left.property.name==="story"&&right.type==="ObjectExpression"});return storyAssignments.forEach(exp=>{let{left,right}=exp.node;right.properties.forEach(prop=>{getContainingStatement(exp).insertBefore(j.assignmentStatement("=",j.memberExpression(left.object,renameKey(prop.key)),prop.value))})}),storyAssignments.remove(),root.find(j.AssignmentExpression).filter(exp=>{let{left}=exp.node;return left.type==="MemberExpression"&&left.object.type==="MemberExpression"&&left.object.property.type==="Identifier"&&left.object.property.name==="story"&&left.property.type==="Identifier"}).replaceWith(exp=>{let{left,right}=exp.node;return j.assignmentExpression("=",j.memberExpression(left.object.object,renameKey(left.property)),right)}),root.toSource({quote:"single"})}
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var find_implicit_spies_exports={};__export(find_implicit_spies_exports,{default:()=>transform,parser:()=>parser});module.exports=__toCommonJS(find_implicit_spies_exports);var import_csf_tools=require("@storybook/core/csf-tools"),babel=__toESM(require("@babel/core")),import_types=require("@babel/types");function findImplicitSpies(path,file,keys){path.traverse({Identifier:identifier=>{!keys.includes(identifier.node.name)&&/^on[A-Z].*/.test(identifier.node.name)&&console.warn(identifier.buildCodeFrameError(`${file} Possible implicit spy found`).message)}})}function getAnnotationKeys(file,storyName,annotationName){let argKeys=[];return file.path.traverse({AssignmentExpression:path=>{let left=path.get("left");if(!left.isMemberExpression())return;let object=left.get("object");if(!(object.isIdentifier()&&object.node.name===storyName))return;let property=left.get("property"),right=path.get("right");property.isIdentifier()&&property.node.name===annotationName&&right.isObjectExpression()&&argKeys.push(...right.node.properties.flatMap(value=>(0,import_types.isObjectProperty)(value)&&(0,import_types.isIdentifier)(value.key)?[value.key.name]:[]))},VariableDeclarator:path=>{let id=path.get("id"),init=path.get("init");if(!(id.isIdentifier()&&id.node.name===storyName)||!init.isObjectExpression())return;let args=init.get("properties").flatMap(it=>it.isObjectProperty()?[it]:[]).find(it=>{let argKey=it.get("key");return argKey.isIdentifier()&&argKey.node.name===annotationName});if(!args)return;let argsValue=args.get("value");!argsValue||!argsValue.isObjectExpression()||argKeys.push(...argsValue.node.properties.flatMap(value=>(0,import_types.isObjectProperty)(value)&&(0,import_types.isIdentifier)(value.key)?[value.key.name]:[]))}}),argKeys}var getObjectExpressionKeys=node=>(0,import_types.isObjectExpression)(node)?node.properties.flatMap(value=>(0,import_types.isObjectProperty)(value)&&(0,import_types.isIdentifier)(value.key)?[value.key.name]:[]):[];async function transform(info){let csf=(0,import_csf_tools.loadCsf)(info.source,{makeTitle:title=>title}),fileNode=csf._ast,file=new babel.File({filename:info.path},{code:info.source,ast:fileNode});csf.parse();let metaKeys=[...getObjectExpressionKeys(csf._metaAnnotations.args),...getObjectExpressionKeys(csf._metaAnnotations.argTypes)];Object.entries(csf.stories).forEach(([key,{name}])=>{if(!name)return;let allKeys=[...metaKeys,...getAnnotationKeys(file,name,"args"),...getAnnotationKeys(file,name,"argTypes")];file.path.traverse({AssignmentExpression:path=>{let left=path.get("left");if(!left.isMemberExpression())return;let object=left.get("object");if(!(object.isIdentifier()&&object.node.name===name))return;let property=left.get("property");property.isIdentifier()&&property.node.name==="play"&&findImplicitSpies(path,info.path,allKeys)},VariableDeclarator:path=>{let id=path.get("id"),init=path.get("init");if(!(id.isIdentifier()&&id.node.name===name)||!init.isObjectExpression())return;let play=init.get("properties").flatMap(it=>it.isObjectProperty()?[it]:[]).find(it=>{let argKey=it.get("key");return argKey.isIdentifier()&&argKey.node.name==="play"});play&&findImplicitSpies(play,info.path,allKeys)}})})}var parser="tsx";0&&(module.exports={parser});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all3)=>{for(var name2 in all3)__defProp(target,name2,{get:all3[name2],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var require_extend=__commonJS({"../../node_modules/extend/index.js"(exports2,module2){"use strict";var hasOwn2=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,defineProperty=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor,isArray2=function(arr){return typeof Array.isArray=="function"?Array.isArray(arr):toStr.call(arr)==="[object Array]"},isPlainObject2=function(obj){if(!obj||toStr.call(obj)!=="[object Object]")return!1;var hasOwnConstructor=hasOwn2.call(obj,"constructor"),hasIsPrototypeOf=obj.constructor&&obj.constructor.prototype&&hasOwn2.call(obj.constructor.prototype,"isPrototypeOf");if(obj.constructor&&!hasOwnConstructor&&!hasIsPrototypeOf)return!1;var key;for(key in obj);return typeof key>"u"||hasOwn2.call(obj,key)},setProperty=function(target,options){defineProperty&&options.name==="__proto__"?defineProperty(target,options.name,{enumerable:!0,configurable:!0,value:options.newValue,writable:!0}):target[options.name]=options.newValue},getProperty=function(obj,name2){if(name2==="__proto__")if(hasOwn2.call(obj,name2)){if(gOPD)return gOPD(obj,name2).value}else return;return obj[name2]};module2.exports=function extend3(){var options,name2,src,copy,copyIsArray,clone,target=arguments[0],i=1,length=arguments.length,deep=!1;for(typeof target=="boolean"&&(deep=target,target=arguments[1]||{},i=2),(target==null||typeof target!="object"&&typeof target!="function")&&(target={});i<length;++i)if(options=arguments[i],options!=null)for(name2 in options)src=getProperty(target,name2),copy=getProperty(options,name2),target!==copy&&(deep&©&&(isPlainObject2(copy)||(copyIsArray=isArray2(copy)))?(copyIsArray?(copyIsArray=!1,clone=src&&isArray2(src)?src:[]):clone=src&&isPlainObject2(src)?src:{},setProperty(target,{name:name2,newValue:extend3(deep,clone,copy)})):typeof copy<"u"&&setProperty(target,{name:name2,newValue:copy}));return target}}});var require_xhtml=__commonJS({"../../node_modules/micromark-extension-mdxjs/node_modules/acorn-jsx/xhtml.js"(exports2,module2){"use strict";module2.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}}});var require_acorn=__commonJS({"../../node_modules/micromark-extension-mdxjs/node_modules/acorn/dist/acorn.js"(exports2,module2){"use strict";(function(global,factory){typeof exports2=="object"&&typeof module2<"u"?factory(exports2):typeof define=="function"&&define.amd?define(["exports"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global.acorn={}))})(exports2,function(exports3){"use strict";var astralIdentifierCodes2=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,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,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,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,406,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,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,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,983,6,110,6,6,9,4759,9,787719,239],astralIdentifierStartCodes2=[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,68,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,349,41,7,1,79,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,159,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,264,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,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,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,757,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],nonASCIIidentifierChars2="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",nonASCIIidentifierStartChars2="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",reservedWords2={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ecma5AndLessKeywords2="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",keywords$12={5:ecma5AndLessKeywords2,"5module":ecma5AndLessKeywords2+" export import",6:ecma5AndLessKeywords2+" const class extends export import super"},keywordRelationalOperator2=/^in(stanceof)?$/,nonASCIIidentifierStart2=new RegExp("["+nonASCIIidentifierStartChars2+"]"),nonASCIIidentifier2=new RegExp("["+nonASCIIidentifierStartChars2+nonASCIIidentifierChars2+"]");function isInAstralSet2(code2,set){for(var pos=65536,i2=0;i2<set.length;i2+=2){if(pos+=set[i2],pos>code2)return!1;if(pos+=set[i2+1],pos>=code2)return!0}return!1}function isIdentifierStart2(code2,astral){return code2<65?code2===36:code2<91?!0:code2<97?code2===95:code2<123?!0:code2<=65535?code2>=170&&nonASCIIidentifierStart2.test(String.fromCharCode(code2)):astral===!1?!1:isInAstralSet2(code2,astralIdentifierStartCodes2)}function isIdentifierChar2(code2,astral){return code2<48?code2===36:code2<58?!0:code2<65?!1:code2<91?!0:code2<97?code2===95:code2<123?!0:code2<=65535?code2>=170&&nonASCIIidentifier2.test(String.fromCharCode(code2)):astral===!1?!1:isInAstralSet2(code2,astralIdentifierStartCodes2)||isInAstralSet2(code2,astralIdentifierCodes2)}var TokenType3=function(label,conf){conf===void 0&&(conf={}),this.label=label,this.keyword=conf.keyword,this.beforeExpr=!!conf.beforeExpr,this.startsExpr=!!conf.startsExpr,this.isLoop=!!conf.isLoop,this.isAssign=!!conf.isAssign,this.prefix=!!conf.prefix,this.postfix=!!conf.postfix,this.binop=conf.binop||null,this.updateContext=null};function binop2(name2,prec){return new TokenType3(name2,{beforeExpr:!0,binop:prec})}var beforeExpr2={beforeExpr:!0},startsExpr2={startsExpr:!0},keywords2={};function kw2(name2,options){return options===void 0&&(options={}),options.keyword=name2,keywords2[name2]=new TokenType3(name2,options)}var types$12={num:new TokenType3("num",startsExpr2),regexp:new TokenType3("regexp",startsExpr2),string:new TokenType3("string",startsExpr2),name:new TokenType3("name",startsExpr2),privateId:new TokenType3("privateId",startsExpr2),eof:new TokenType3("eof"),bracketL:new TokenType3("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new TokenType3("]"),braceL:new TokenType3("{",{beforeExpr:!0,startsExpr:!0}),braceR:new TokenType3("}"),parenL:new TokenType3("(",{beforeExpr:!0,startsExpr:!0}),parenR:new TokenType3(")"),comma:new TokenType3(",",beforeExpr2),semi:new TokenType3(";",beforeExpr2),colon:new TokenType3(":",beforeExpr2),dot:new TokenType3("."),question:new TokenType3("?",beforeExpr2),questionDot:new TokenType3("?."),arrow:new TokenType3("=>",beforeExpr2),template:new TokenType3("template"),invalidTemplate:new TokenType3("invalidTemplate"),ellipsis:new TokenType3("...",beforeExpr2),backQuote:new TokenType3("`",startsExpr2),dollarBraceL:new TokenType3("${",{beforeExpr:!0,startsExpr:!0}),eq:new TokenType3("=",{beforeExpr:!0,isAssign:!0}),assign:new TokenType3("_=",{beforeExpr:!0,isAssign:!0}),incDec:new TokenType3("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new TokenType3("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop2("||",1),logicalAND:binop2("&&",2),bitwiseOR:binop2("|",3),bitwiseXOR:binop2("^",4),bitwiseAND:binop2("&",5),equality:binop2("==/!=/===/!==",6),relational:binop2("</>/<=/>=",7),bitShift:binop2("<</>>/>>>",8),plusMin:new TokenType3("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop2("%",10),star:binop2("*",10),slash:binop2("/",10),starstar:new TokenType3("**",{beforeExpr:!0}),coalesce:binop2("??",1),_break:kw2("break"),_case:kw2("case",beforeExpr2),_catch:kw2("catch"),_continue:kw2("continue"),_debugger:kw2("debugger"),_default:kw2("default",beforeExpr2),_do:kw2("do",{isLoop:!0,beforeExpr:!0}),_else:kw2("else",beforeExpr2),_finally:kw2("finally"),_for:kw2("for",{isLoop:!0}),_function:kw2("function",startsExpr2),_if:kw2("if"),_return:kw2("return",beforeExpr2),_switch:kw2("switch"),_throw:kw2("throw",beforeExpr2),_try:kw2("try"),_var:kw2("var"),_const:kw2("const"),_while:kw2("while",{isLoop:!0}),_with:kw2("with"),_new:kw2("new",{beforeExpr:!0,startsExpr:!0}),_this:kw2("this",startsExpr2),_super:kw2("super",startsExpr2),_class:kw2("class",startsExpr2),_extends:kw2("extends",beforeExpr2),_export:kw2("export"),_import:kw2("import",startsExpr2),_null:kw2("null",startsExpr2),_true:kw2("true",startsExpr2),_false:kw2("false",startsExpr2),_in:kw2("in",{beforeExpr:!0,binop:7}),_instanceof:kw2("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw2("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw2("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw2("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},lineBreak2=/\r\n?|\n|\u2028|\u2029/,lineBreakG2=new RegExp(lineBreak2.source,"g");function isNewLine2(code2){return code2===10||code2===13||code2===8232||code2===8233}function nextLineBreak2(code2,from,end){end===void 0&&(end=code2.length);for(var i2=from;i2<end;i2++){var next=code2.charCodeAt(i2);if(isNewLine2(next))return i2<end-1&&next===13&&code2.charCodeAt(i2+1)===10?i2+2:i2+1}return-1}var nonASCIIwhitespace2=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,skipWhiteSpace2=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ref2=Object.prototype,hasOwnProperty3=ref2.hasOwnProperty,toString4=ref2.toString,hasOwn2=Object.hasOwn||function(obj,propName){return hasOwnProperty3.call(obj,propName)},isArray2=Array.isArray||function(obj){return toString4.call(obj)==="[object Array]"},regexpCache2=Object.create(null);function wordsRegexp2(words){return regexpCache2[words]||(regexpCache2[words]=new RegExp("^(?:"+words.replace(/ /g,"|")+")$"))}function codePointToString2(code2){return code2<=65535?String.fromCharCode(code2):(code2-=65536,String.fromCharCode((code2>>10)+55296,(code2&1023)+56320))}var loneSurrogate2=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Position3=function(line,col){this.line=line,this.column=col};Position3.prototype.offset=function(n){return new Position3(this.line,this.column+n)};var SourceLocation3=function(p,start2,end){this.start=start2,this.end=end,p.sourceFile!==null&&(this.source=p.sourceFile)};function getLineInfo2(input,offset2){for(var line=1,cur=0;;){var nextBreak=nextLineBreak2(input,cur,offset2);if(nextBreak<0)return new Position3(line,offset2-cur);++line,cur=nextBreak}}var defaultOptions2={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},warnedAboutEcmaVersion2=!1;function getOptions2(opts){var options={};for(var opt in defaultOptions2)options[opt]=opts&&hasOwn2(opts,opt)?opts[opt]:defaultOptions2[opt];if(options.ecmaVersion==="latest"?options.ecmaVersion=1e8:options.ecmaVersion==null?(!warnedAboutEcmaVersion2&&typeof console=="object"&&console.warn&&(warnedAboutEcmaVersion2=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
1
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all3)=>{for(var name2 in all3)__defProp(target,name2,{get:all3[name2],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var require_extend=__commonJS({"../../node_modules/extend/index.js"(exports2,module2){"use strict";var hasOwn2=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,defineProperty=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor,isArray2=function(arr){return typeof Array.isArray=="function"?Array.isArray(arr):toStr.call(arr)==="[object Array]"},isPlainObject2=function(obj){if(!obj||toStr.call(obj)!=="[object Object]")return!1;var hasOwnConstructor=hasOwn2.call(obj,"constructor"),hasIsPrototypeOf=obj.constructor&&obj.constructor.prototype&&hasOwn2.call(obj.constructor.prototype,"isPrototypeOf");if(obj.constructor&&!hasOwnConstructor&&!hasIsPrototypeOf)return!1;var key;for(key in obj);return typeof key>"u"||hasOwn2.call(obj,key)},setProperty=function(target,options){defineProperty&&options.name==="__proto__"?defineProperty(target,options.name,{enumerable:!0,configurable:!0,value:options.newValue,writable:!0}):target[options.name]=options.newValue},getProperty=function(obj,name2){if(name2==="__proto__")if(hasOwn2.call(obj,name2)){if(gOPD)return gOPD(obj,name2).value}else return;return obj[name2]};module2.exports=function extend3(){var options,name2,src,copy,copyIsArray,clone,target=arguments[0],i=1,length=arguments.length,deep=!1;for(typeof target=="boolean"&&(deep=target,target=arguments[1]||{},i=2),(target==null||typeof target!="object"&&typeof target!="function")&&(target={});i<length;++i)if(options=arguments[i],options!=null)for(name2 in options)src=getProperty(target,name2),copy=getProperty(options,name2),target!==copy&&(deep&©&&(isPlainObject2(copy)||(copyIsArray=isArray2(copy)))?(copyIsArray?(copyIsArray=!1,clone=src&&isArray2(src)?src:[]):clone=src&&isPlainObject2(src)?src:{},setProperty(target,{name:name2,newValue:extend3(deep,clone,copy)})):typeof copy<"u"&&setProperty(target,{name:name2,newValue:copy}));return target}}});var require_xhtml=__commonJS({"../../node_modules/micromark-extension-mdxjs/node_modules/acorn-jsx/xhtml.js"(exports2,module2){module2.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}}});var require_acorn=__commonJS({"../../node_modules/micromark-extension-mdxjs/node_modules/acorn/dist/acorn.js"(exports2,module2){(function(global,factory){typeof exports2=="object"&&typeof module2<"u"?factory(exports2):typeof define=="function"&&define.amd?define(["exports"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global.acorn={}))})(exports2,function(exports3){"use strict";var astralIdentifierCodes2=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,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,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,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,406,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,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,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,983,6,110,6,6,9,4759,9,787719,239],astralIdentifierStartCodes2=[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,68,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,349,41,7,1,79,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,159,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,264,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,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,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,757,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],nonASCIIidentifierChars2="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",nonASCIIidentifierStartChars2="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",reservedWords2={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ecma5AndLessKeywords2="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",keywords$12={5:ecma5AndLessKeywords2,"5module":ecma5AndLessKeywords2+" export import",6:ecma5AndLessKeywords2+" const class extends export import super"},keywordRelationalOperator2=/^in(stanceof)?$/,nonASCIIidentifierStart2=new RegExp("["+nonASCIIidentifierStartChars2+"]"),nonASCIIidentifier2=new RegExp("["+nonASCIIidentifierStartChars2+nonASCIIidentifierChars2+"]");function isInAstralSet2(code2,set){for(var pos=65536,i2=0;i2<set.length;i2+=2){if(pos+=set[i2],pos>code2)return!1;if(pos+=set[i2+1],pos>=code2)return!0}return!1}function isIdentifierStart2(code2,astral){return code2<65?code2===36:code2<91?!0:code2<97?code2===95:code2<123?!0:code2<=65535?code2>=170&&nonASCIIidentifierStart2.test(String.fromCharCode(code2)):astral===!1?!1:isInAstralSet2(code2,astralIdentifierStartCodes2)}function isIdentifierChar2(code2,astral){return code2<48?code2===36:code2<58?!0:code2<65?!1:code2<91?!0:code2<97?code2===95:code2<123?!0:code2<=65535?code2>=170&&nonASCIIidentifier2.test(String.fromCharCode(code2)):astral===!1?!1:isInAstralSet2(code2,astralIdentifierStartCodes2)||isInAstralSet2(code2,astralIdentifierCodes2)}var TokenType3=function(label,conf){conf===void 0&&(conf={}),this.label=label,this.keyword=conf.keyword,this.beforeExpr=!!conf.beforeExpr,this.startsExpr=!!conf.startsExpr,this.isLoop=!!conf.isLoop,this.isAssign=!!conf.isAssign,this.prefix=!!conf.prefix,this.postfix=!!conf.postfix,this.binop=conf.binop||null,this.updateContext=null};function binop2(name2,prec){return new TokenType3(name2,{beforeExpr:!0,binop:prec})}var beforeExpr2={beforeExpr:!0},startsExpr2={startsExpr:!0},keywords2={};function kw2(name2,options){return options===void 0&&(options={}),options.keyword=name2,keywords2[name2]=new TokenType3(name2,options)}var types$12={num:new TokenType3("num",startsExpr2),regexp:new TokenType3("regexp",startsExpr2),string:new TokenType3("string",startsExpr2),name:new TokenType3("name",startsExpr2),privateId:new TokenType3("privateId",startsExpr2),eof:new TokenType3("eof"),bracketL:new TokenType3("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new TokenType3("]"),braceL:new TokenType3("{",{beforeExpr:!0,startsExpr:!0}),braceR:new TokenType3("}"),parenL:new TokenType3("(",{beforeExpr:!0,startsExpr:!0}),parenR:new TokenType3(")"),comma:new TokenType3(",",beforeExpr2),semi:new TokenType3(";",beforeExpr2),colon:new TokenType3(":",beforeExpr2),dot:new TokenType3("."),question:new TokenType3("?",beforeExpr2),questionDot:new TokenType3("?."),arrow:new TokenType3("=>",beforeExpr2),template:new TokenType3("template"),invalidTemplate:new TokenType3("invalidTemplate"),ellipsis:new TokenType3("...",beforeExpr2),backQuote:new TokenType3("`",startsExpr2),dollarBraceL:new TokenType3("${",{beforeExpr:!0,startsExpr:!0}),eq:new TokenType3("=",{beforeExpr:!0,isAssign:!0}),assign:new TokenType3("_=",{beforeExpr:!0,isAssign:!0}),incDec:new TokenType3("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new TokenType3("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop2("||",1),logicalAND:binop2("&&",2),bitwiseOR:binop2("|",3),bitwiseXOR:binop2("^",4),bitwiseAND:binop2("&",5),equality:binop2("==/!=/===/!==",6),relational:binop2("</>/<=/>=",7),bitShift:binop2("<</>>/>>>",8),plusMin:new TokenType3("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop2("%",10),star:binop2("*",10),slash:binop2("/",10),starstar:new TokenType3("**",{beforeExpr:!0}),coalesce:binop2("??",1),_break:kw2("break"),_case:kw2("case",beforeExpr2),_catch:kw2("catch"),_continue:kw2("continue"),_debugger:kw2("debugger"),_default:kw2("default",beforeExpr2),_do:kw2("do",{isLoop:!0,beforeExpr:!0}),_else:kw2("else",beforeExpr2),_finally:kw2("finally"),_for:kw2("for",{isLoop:!0}),_function:kw2("function",startsExpr2),_if:kw2("if"),_return:kw2("return",beforeExpr2),_switch:kw2("switch"),_throw:kw2("throw",beforeExpr2),_try:kw2("try"),_var:kw2("var"),_const:kw2("const"),_while:kw2("while",{isLoop:!0}),_with:kw2("with"),_new:kw2("new",{beforeExpr:!0,startsExpr:!0}),_this:kw2("this",startsExpr2),_super:kw2("super",startsExpr2),_class:kw2("class",startsExpr2),_extends:kw2("extends",beforeExpr2),_export:kw2("export"),_import:kw2("import",startsExpr2),_null:kw2("null",startsExpr2),_true:kw2("true",startsExpr2),_false:kw2("false",startsExpr2),_in:kw2("in",{beforeExpr:!0,binop:7}),_instanceof:kw2("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw2("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw2("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw2("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},lineBreak2=/\r\n?|\n|\u2028|\u2029/,lineBreakG2=new RegExp(lineBreak2.source,"g");function isNewLine2(code2){return code2===10||code2===13||code2===8232||code2===8233}function nextLineBreak2(code2,from,end){end===void 0&&(end=code2.length);for(var i2=from;i2<end;i2++){var next=code2.charCodeAt(i2);if(isNewLine2(next))return i2<end-1&&next===13&&code2.charCodeAt(i2+1)===10?i2+2:i2+1}return-1}var nonASCIIwhitespace2=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,skipWhiteSpace2=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ref2=Object.prototype,hasOwnProperty3=ref2.hasOwnProperty,toString4=ref2.toString,hasOwn2=Object.hasOwn||function(obj,propName){return hasOwnProperty3.call(obj,propName)},isArray2=Array.isArray||function(obj){return toString4.call(obj)==="[object Array]"},regexpCache2=Object.create(null);function wordsRegexp2(words){return regexpCache2[words]||(regexpCache2[words]=new RegExp("^(?:"+words.replace(/ /g,"|")+")$"))}function codePointToString2(code2){return code2<=65535?String.fromCharCode(code2):(code2-=65536,String.fromCharCode((code2>>10)+55296,(code2&1023)+56320))}var loneSurrogate2=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Position3=function(line,col){this.line=line,this.column=col};Position3.prototype.offset=function(n){return new Position3(this.line,this.column+n)};var SourceLocation3=function(p,start2,end){this.start=start2,this.end=end,p.sourceFile!==null&&(this.source=p.sourceFile)};function getLineInfo2(input,offset2){for(var line=1,cur=0;;){var nextBreak=nextLineBreak2(input,cur,offset2);if(nextBreak<0)return new Position3(line,offset2-cur);++line,cur=nextBreak}}var defaultOptions2={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},warnedAboutEcmaVersion2=!1;function getOptions2(opts){var options={};for(var opt in defaultOptions2)options[opt]=opts&&hasOwn2(opts,opt)?opts[opt]:defaultOptions2[opt];if(options.ecmaVersion==="latest"?options.ecmaVersion=1e8:options.ecmaVersion==null?(!warnedAboutEcmaVersion2&&typeof console=="object"&&console.warn&&(warnedAboutEcmaVersion2=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
2
2
|
Defaulting to 2020, but this will stop working in the future.`)),options.ecmaVersion=11):options.ecmaVersion>=2015&&(options.ecmaVersion-=2009),options.allowReserved==null&&(options.allowReserved=options.ecmaVersion<5),(!opts||opts.allowHashBang==null)&&(options.allowHashBang=options.ecmaVersion>=14),isArray2(options.onToken)){var tokens=options.onToken;options.onToken=function(token){return tokens.push(token)}}return isArray2(options.onComment)&&(options.onComment=pushComment2(options,options.onComment)),options}function pushComment2(options,array){return function(block,text4,start2,end,startLoc,endLoc){var comment={type:block?"Block":"Line",value:text4,start:start2,end};options.locations&&(comment.loc=new SourceLocation3(this,startLoc,endLoc)),options.ranges&&(comment.range=[start2,end]),array.push(comment)}}var SCOPE_TOP2=1,SCOPE_FUNCTION2=2,SCOPE_ASYNC2=4,SCOPE_GENERATOR2=8,SCOPE_ARROW2=16,SCOPE_SIMPLE_CATCH2=32,SCOPE_SUPER2=64,SCOPE_DIRECT_SUPER2=128,SCOPE_CLASS_STATIC_BLOCK2=256,SCOPE_VAR2=SCOPE_TOP2|SCOPE_FUNCTION2|SCOPE_CLASS_STATIC_BLOCK2;function functionFlags2(async,generator){return SCOPE_FUNCTION2|(async?SCOPE_ASYNC2:0)|(generator?SCOPE_GENERATOR2:0)}var BIND_NONE2=0,BIND_VAR2=1,BIND_LEXICAL2=2,BIND_FUNCTION2=3,BIND_SIMPLE_CATCH2=4,BIND_OUTSIDE2=5,Parser3=function(options,input,startPos){this.options=options=getOptions2(options),this.sourceFile=options.sourceFile,this.keywords=wordsRegexp2(keywords$12[options.ecmaVersion>=6?6:options.sourceType==="module"?"5module":5]);var reserved="";options.allowReserved!==!0&&(reserved=reservedWords2[options.ecmaVersion>=6?6:options.ecmaVersion===5?5:3],options.sourceType==="module"&&(reserved+=" await")),this.reservedWords=wordsRegexp2(reserved);var reservedStrict=(reserved?reserved+" ":"")+reservedWords2.strict;this.reservedWordsStrict=wordsRegexp2(reservedStrict),this.reservedWordsStrictBind=wordsRegexp2(reservedStrict+" "+reservedWords2.strictBind),this.input=String(input),this.containsEsc=!1,startPos?(this.pos=startPos,this.lineStart=this.input.lastIndexOf(`
|
3
3
|
`,startPos-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(lineBreak2).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=types$12.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=options.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&options.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(SCOPE_TOP2),this.regexpState=null,this.privateNameStack=[]},prototypeAccessors2={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Parser3.prototype.parse=function(){var node3=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(node3)},prototypeAccessors2.inFunction.get=function(){return(this.currentVarScope().flags&SCOPE_FUNCTION2)>0},prototypeAccessors2.inGenerator.get=function(){return(this.currentVarScope().flags&SCOPE_GENERATOR2)>0&&!this.currentVarScope().inClassFieldInit},prototypeAccessors2.inAsync.get=function(){return(this.currentVarScope().flags&SCOPE_ASYNC2)>0&&!this.currentVarScope().inClassFieldInit},prototypeAccessors2.canAwait.get=function(){for(var i2=this.scopeStack.length-1;i2>=0;i2--){var scope=this.scopeStack[i2];if(scope.inClassFieldInit||scope.flags&SCOPE_CLASS_STATIC_BLOCK2)return!1;if(scope.flags&SCOPE_FUNCTION2)return(scope.flags&SCOPE_ASYNC2)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},prototypeAccessors2.allowSuper.get=function(){var ref3=this.currentThisScope(),flags=ref3.flags,inClassFieldInit=ref3.inClassFieldInit;return(flags&SCOPE_SUPER2)>0||inClassFieldInit||this.options.allowSuperOutsideMethod},prototypeAccessors2.allowDirectSuper.get=function(){return(this.currentThisScope().flags&SCOPE_DIRECT_SUPER2)>0},prototypeAccessors2.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},prototypeAccessors2.allowNewDotTarget.get=function(){var ref3=this.currentThisScope(),flags=ref3.flags,inClassFieldInit=ref3.inClassFieldInit;return(flags&(SCOPE_FUNCTION2|SCOPE_CLASS_STATIC_BLOCK2))>0||inClassFieldInit},prototypeAccessors2.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&SCOPE_CLASS_STATIC_BLOCK2)>0},Parser3.extend=function(){for(var plugins=[],len=arguments.length;len--;)plugins[len]=arguments[len];for(var cls=this,i2=0;i2<plugins.length;i2++)cls=plugins[i2](cls);return cls},Parser3.parse=function(input,options){return new this(options,input).parse()},Parser3.parseExpressionAt=function(input,pos,options){var parser=new this(options,input,pos);return parser.nextToken(),parser.parseExpression()},Parser3.tokenizer=function(input,options){return new this(options,input)},Object.defineProperties(Parser3.prototype,prototypeAccessors2);var pp$92=Parser3.prototype,literal2=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;pp$92.strictDirective=function(start2){if(this.options.ecmaVersion<5)return!1;for(;;){skipWhiteSpace2.lastIndex=start2,start2+=skipWhiteSpace2.exec(this.input)[0].length;var match=literal2.exec(this.input.slice(start2));if(!match)return!1;if((match[1]||match[2])==="use strict"){skipWhiteSpace2.lastIndex=start2+match[0].length;var spaceAfter=skipWhiteSpace2.exec(this.input),end=spaceAfter.index+spaceAfter[0].length,next=this.input.charAt(end);return next===";"||next==="}"||lineBreak2.test(spaceAfter[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(next)||next==="!"&&this.input.charAt(end+1)==="=")}start2+=match[0].length,skipWhiteSpace2.lastIndex=start2,start2+=skipWhiteSpace2.exec(this.input)[0].length,this.input[start2]===";"&&start2++}},pp$92.eat=function(type){return this.type===type?(this.next(),!0):!1},pp$92.isContextual=function(name2){return this.type===types$12.name&&this.value===name2&&!this.containsEsc},pp$92.eatContextual=function(name2){return this.isContextual(name2)?(this.next(),!0):!1},pp$92.expectContextual=function(name2){this.eatContextual(name2)||this.unexpected()},pp$92.canInsertSemicolon=function(){return this.type===types$12.eof||this.type===types$12.braceR||lineBreak2.test(this.input.slice(this.lastTokEnd,this.start))},pp$92.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},pp$92.semicolon=function(){!this.eat(types$12.semi)&&!this.insertSemicolon()&&this.unexpected()},pp$92.afterTrailingComma=function(tokType,notNext){if(this.type===tokType)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),notNext||this.next(),!0},pp$92.expect=function(type){this.eat(type)||this.unexpected()},pp$92.unexpected=function(pos){this.raise(pos??this.start,"Unexpected token")};var DestructuringErrors3=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};pp$92.checkPatternErrors=function(refDestructuringErrors,isAssign){if(refDestructuringErrors){refDestructuringErrors.trailingComma>-1&&this.raiseRecoverable(refDestructuringErrors.trailingComma,"Comma is not permitted after the rest element");var parens=isAssign?refDestructuringErrors.parenthesizedAssign:refDestructuringErrors.parenthesizedBind;parens>-1&&this.raiseRecoverable(parens,isAssign?"Assigning to rvalue":"Parenthesized pattern")}},pp$92.checkExpressionErrors=function(refDestructuringErrors,andThrow){if(!refDestructuringErrors)return!1;var shorthandAssign=refDestructuringErrors.shorthandAssign,doubleProto=refDestructuringErrors.doubleProto;if(!andThrow)return shorthandAssign>=0||doubleProto>=0;shorthandAssign>=0&&this.raise(shorthandAssign,"Shorthand property assignments are valid only in destructuring patterns"),doubleProto>=0&&this.raiseRecoverable(doubleProto,"Redefinition of __proto__ property")},pp$92.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},pp$92.isSimpleAssignTarget=function(expr){return expr.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(expr.expression):expr.type==="Identifier"||expr.type==="MemberExpression"};var pp$82=Parser3.prototype;pp$82.parseTopLevel=function(node3){var exports4=Object.create(null);for(node3.body||(node3.body=[]);this.type!==types$12.eof;){var stmt=this.parseStatement(null,!0,exports4);node3.body.push(stmt)}if(this.inModule)for(var i2=0,list5=Object.keys(this.undefinedExports);i2<list5.length;i2+=1){var name2=list5[i2];this.raiseRecoverable(this.undefinedExports[name2].start,"Export '"+name2+"' is not defined")}return this.adaptDirectivePrologue(node3.body),this.next(),node3.sourceType=this.options.sourceType,this.finishNode(node3,"Program")};var loopLabel2={kind:"loop"},switchLabel2={kind:"switch"};pp$82.isLet=function(context){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;skipWhiteSpace2.lastIndex=this.pos;var skip=skipWhiteSpace2.exec(this.input),next=this.pos+skip[0].length,nextCh=this.input.charCodeAt(next);if(nextCh===91||nextCh===92)return!0;if(context)return!1;if(nextCh===123||nextCh>55295&&nextCh<56320)return!0;if(isIdentifierStart2(nextCh,!0)){for(var pos=next+1;isIdentifierChar2(nextCh=this.input.charCodeAt(pos),!0);)++pos;if(nextCh===92||nextCh>55295&&nextCh<56320)return!0;var ident=this.input.slice(next,pos);if(!keywordRelationalOperator2.test(ident))return!0}return!1},pp$82.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;skipWhiteSpace2.lastIndex=this.pos;var skip=skipWhiteSpace2.exec(this.input),next=this.pos+skip[0].length,after;return!lineBreak2.test(this.input.slice(this.pos,next))&&this.input.slice(next,next+8)==="function"&&(next+8===this.input.length||!(isIdentifierChar2(after=this.input.charCodeAt(next+8))||after>55295&&after<56320))},pp$82.parseStatement=function(context,topLevel,exports4){var starttype=this.type,node3=this.startNode(),kind;switch(this.isLet(context)&&(starttype=types$12._var,kind="let"),starttype){case types$12._break:case types$12._continue:return this.parseBreakContinueStatement(node3,starttype.keyword);case types$12._debugger:return this.parseDebuggerStatement(node3);case types$12._do:return this.parseDoStatement(node3);case types$12._for:return this.parseForStatement(node3);case types$12._function:return context&&(this.strict||context!=="if"&&context!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(node3,!1,!context);case types$12._class:return context&&this.unexpected(),this.parseClass(node3,!0);case types$12._if:return this.parseIfStatement(node3);case types$12._return:return this.parseReturnStatement(node3);case types$12._switch:return this.parseSwitchStatement(node3);case types$12._throw:return this.parseThrowStatement(node3);case types$12._try:return this.parseTryStatement(node3);case types$12._const:case types$12._var:return kind=kind||this.value,context&&kind!=="var"&&this.unexpected(),this.parseVarStatement(node3,kind);case types$12._while:return this.parseWhileStatement(node3);case types$12._with:return this.parseWithStatement(node3);case types$12.braceL:return this.parseBlock(!0,node3);case types$12.semi:return this.parseEmptyStatement(node3);case types$12._export:case types$12._import:if(this.options.ecmaVersion>10&&starttype===types$12._import){skipWhiteSpace2.lastIndex=this.pos;var skip=skipWhiteSpace2.exec(this.input),next=this.pos+skip[0].length,nextCh=this.input.charCodeAt(next);if(nextCh===40||nextCh===46)return this.parseExpressionStatement(node3,this.parseExpression())}return this.options.allowImportExportEverywhere||(topLevel||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),starttype===types$12._import?this.parseImport(node3):this.parseExport(node3,exports4);default:if(this.isAsyncFunction())return context&&this.unexpected(),this.next(),this.parseFunctionStatement(node3,!0,!context);var maybeName=this.value,expr=this.parseExpression();return starttype===types$12.name&&expr.type==="Identifier"&&this.eat(types$12.colon)?this.parseLabeledStatement(node3,maybeName,expr,context):this.parseExpressionStatement(node3,expr)}},pp$82.parseBreakContinueStatement=function(node3,keyword){var isBreak=keyword==="break";this.next(),this.eat(types$12.semi)||this.insertSemicolon()?node3.label=null:this.type!==types$12.name?this.unexpected():(node3.label=this.parseIdent(),this.semicolon());for(var i2=0;i2<this.labels.length;++i2){var lab=this.labels[i2];if((node3.label==null||lab.name===node3.label.name)&&(lab.kind!=null&&(isBreak||lab.kind==="loop")||node3.label&&isBreak))break}return i2===this.labels.length&&this.raise(node3.start,"Unsyntactic "+keyword),this.finishNode(node3,isBreak?"BreakStatement":"ContinueStatement")},pp$82.parseDebuggerStatement=function(node3){return this.next(),this.semicolon(),this.finishNode(node3,"DebuggerStatement")},pp$82.parseDoStatement=function(node3){return this.next(),this.labels.push(loopLabel2),node3.body=this.parseStatement("do"),this.labels.pop(),this.expect(types$12._while),node3.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(types$12.semi):this.semicolon(),this.finishNode(node3,"DoWhileStatement")},pp$82.parseForStatement=function(node3){this.next();var awaitAt=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(loopLabel2),this.enterScope(0),this.expect(types$12.parenL),this.type===types$12.semi)return awaitAt>-1&&this.unexpected(awaitAt),this.parseFor(node3,null);var isLet=this.isLet();if(this.type===types$12._var||this.type===types$12._const||isLet){var init$1=this.startNode(),kind=isLet?"let":this.value;return this.next(),this.parseVar(init$1,!0,kind),this.finishNode(init$1,"VariableDeclaration"),(this.type===types$12._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&init$1.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===types$12._in?awaitAt>-1&&this.unexpected(awaitAt):node3.await=awaitAt>-1),this.parseForIn(node3,init$1)):(awaitAt>-1&&this.unexpected(awaitAt),this.parseFor(node3,init$1))}var startsWithLet=this.isContextual("let"),isForOf=!1,refDestructuringErrors=new DestructuringErrors3,init=this.parseExpression(awaitAt>-1?"await":!0,refDestructuringErrors);return this.type===types$12._in||(isForOf=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===types$12._in?awaitAt>-1&&this.unexpected(awaitAt):node3.await=awaitAt>-1),startsWithLet&&isForOf&&this.raise(init.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(init,!1,refDestructuringErrors),this.checkLValPattern(init),this.parseForIn(node3,init)):(this.checkExpressionErrors(refDestructuringErrors,!0),awaitAt>-1&&this.unexpected(awaitAt),this.parseFor(node3,init))},pp$82.parseFunctionStatement=function(node3,isAsync,declarationPosition){return this.next(),this.parseFunction(node3,FUNC_STATEMENT2|(declarationPosition?0:FUNC_HANGING_STATEMENT2),!1,isAsync)},pp$82.parseIfStatement=function(node3){return this.next(),node3.test=this.parseParenExpression(),node3.consequent=this.parseStatement("if"),node3.alternate=this.eat(types$12._else)?this.parseStatement("if"):null,this.finishNode(node3,"IfStatement")},pp$82.parseReturnStatement=function(node3){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(types$12.semi)||this.insertSemicolon()?node3.argument=null:(node3.argument=this.parseExpression(),this.semicolon()),this.finishNode(node3,"ReturnStatement")},pp$82.parseSwitchStatement=function(node3){this.next(),node3.discriminant=this.parseParenExpression(),node3.cases=[],this.expect(types$12.braceL),this.labels.push(switchLabel2),this.enterScope(0);for(var cur,sawDefault=!1;this.type!==types$12.braceR;)if(this.type===types$12._case||this.type===types$12._default){var isCase=this.type===types$12._case;cur&&this.finishNode(cur,"SwitchCase"),node3.cases.push(cur=this.startNode()),cur.consequent=[],this.next(),isCase?cur.test=this.parseExpression():(sawDefault&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),sawDefault=!0,cur.test=null),this.expect(types$12.colon)}else cur||this.unexpected(),cur.consequent.push(this.parseStatement(null));return this.exitScope(),cur&&this.finishNode(cur,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(node3,"SwitchStatement")},pp$82.parseThrowStatement=function(node3){return this.next(),lineBreak2.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),node3.argument=this.parseExpression(),this.semicolon(),this.finishNode(node3,"ThrowStatement")};var empty$12=[];pp$82.parseCatchClauseParam=function(){var param=this.parseBindingAtom(),simple=param.type==="Identifier";return this.enterScope(simple?SCOPE_SIMPLE_CATCH2:0),this.checkLValPattern(param,simple?BIND_SIMPLE_CATCH2:BIND_LEXICAL2),this.expect(types$12.parenR),param},pp$82.parseTryStatement=function(node3){if(this.next(),node3.block=this.parseBlock(),node3.handler=null,this.type===types$12._catch){var clause=this.startNode();this.next(),this.eat(types$12.parenL)?clause.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),clause.param=null,this.enterScope(0)),clause.body=this.parseBlock(!1),this.exitScope(),node3.handler=this.finishNode(clause,"CatchClause")}return node3.finalizer=this.eat(types$12._finally)?this.parseBlock():null,!node3.handler&&!node3.finalizer&&this.raise(node3.start,"Missing catch or finally clause"),this.finishNode(node3,"TryStatement")},pp$82.parseVarStatement=function(node3,kind,allowMissingInitializer){return this.next(),this.parseVar(node3,!1,kind,allowMissingInitializer),this.semicolon(),this.finishNode(node3,"VariableDeclaration")},pp$82.parseWhileStatement=function(node3){return this.next(),node3.test=this.parseParenExpression(),this.labels.push(loopLabel2),node3.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(node3,"WhileStatement")},pp$82.parseWithStatement=function(node3){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),node3.object=this.parseParenExpression(),node3.body=this.parseStatement("with"),this.finishNode(node3,"WithStatement")},pp$82.parseEmptyStatement=function(node3){return this.next(),this.finishNode(node3,"EmptyStatement")},pp$82.parseLabeledStatement=function(node3,maybeName,expr,context){for(var i$1=0,list5=this.labels;i$1<list5.length;i$1+=1){var label=list5[i$1];label.name===maybeName&&this.raise(expr.start,"Label '"+maybeName+"' is already declared")}for(var kind=this.type.isLoop?"loop":this.type===types$12._switch?"switch":null,i2=this.labels.length-1;i2>=0;i2--){var label$1=this.labels[i2];if(label$1.statementStart===node3.start)label$1.statementStart=this.start,label$1.kind=kind;else break}return this.labels.push({name:maybeName,kind,statementStart:this.start}),node3.body=this.parseStatement(context?context.indexOf("label")===-1?context+"label":context:"label"),this.labels.pop(),node3.label=expr,this.finishNode(node3,"LabeledStatement")},pp$82.parseExpressionStatement=function(node3,expr){return node3.expression=expr,this.semicolon(),this.finishNode(node3,"ExpressionStatement")},pp$82.parseBlock=function(createNewLexicalScope,node3,exitStrict){for(createNewLexicalScope===void 0&&(createNewLexicalScope=!0),node3===void 0&&(node3=this.startNode()),node3.body=[],this.expect(types$12.braceL),createNewLexicalScope&&this.enterScope(0);this.type!==types$12.braceR;){var stmt=this.parseStatement(null);node3.body.push(stmt)}return exitStrict&&(this.strict=!1),this.next(),createNewLexicalScope&&this.exitScope(),this.finishNode(node3,"BlockStatement")},pp$82.parseFor=function(node3,init){return node3.init=init,this.expect(types$12.semi),node3.test=this.type===types$12.semi?null:this.parseExpression(),this.expect(types$12.semi),node3.update=this.type===types$12.parenR?null:this.parseExpression(),this.expect(types$12.parenR),node3.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(node3,"ForStatement")},pp$82.parseForIn=function(node3,init){var isForIn=this.type===types$12._in;return this.next(),init.type==="VariableDeclaration"&&init.declarations[0].init!=null&&(!isForIn||this.options.ecmaVersion<8||this.strict||init.kind!=="var"||init.declarations[0].id.type!=="Identifier")&&this.raise(init.start,(isForIn?"for-in":"for-of")+" loop variable declaration may not have an initializer"),node3.left=init,node3.right=isForIn?this.parseExpression():this.parseMaybeAssign(),this.expect(types$12.parenR),node3.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(node3,isForIn?"ForInStatement":"ForOfStatement")},pp$82.parseVar=function(node3,isFor,kind,allowMissingInitializer){for(node3.declarations=[],node3.kind=kind;;){var decl=this.startNode();if(this.parseVarId(decl,kind),this.eat(types$12.eq)?decl.init=this.parseMaybeAssign(isFor):!allowMissingInitializer&&kind==="const"&&!(this.type===types$12._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!allowMissingInitializer&&decl.id.type!=="Identifier"&&!(isFor&&(this.type===types$12._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):decl.init=null,node3.declarations.push(this.finishNode(decl,"VariableDeclarator")),!this.eat(types$12.comma))break}return node3},pp$82.parseVarId=function(decl,kind){decl.id=this.parseBindingAtom(),this.checkLValPattern(decl.id,kind==="var"?BIND_VAR2:BIND_LEXICAL2,!1)};var FUNC_STATEMENT2=1,FUNC_HANGING_STATEMENT2=2,FUNC_NULLABLE_ID2=4;pp$82.parseFunction=function(node3,statement,allowExpressionBody,isAsync,forInit){this.initFunction(node3),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!isAsync)&&(this.type===types$12.star&&statement&FUNC_HANGING_STATEMENT2&&this.unexpected(),node3.generator=this.eat(types$12.star)),this.options.ecmaVersion>=8&&(node3.async=!!isAsync),statement&FUNC_STATEMENT2&&(node3.id=statement&FUNC_NULLABLE_ID2&&this.type!==types$12.name?null:this.parseIdent(),node3.id&&!(statement&FUNC_HANGING_STATEMENT2)&&this.checkLValSimple(node3.id,this.strict||node3.generator||node3.async?this.treatFunctionsAsVar?BIND_VAR2:BIND_LEXICAL2:BIND_FUNCTION2));var oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,oldAwaitIdentPos=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags2(node3.async,node3.generator)),statement&FUNC_STATEMENT2||(node3.id=this.type===types$12.name?this.parseIdent():null),this.parseFunctionParams(node3),this.parseFunctionBody(node3,allowExpressionBody,!1,forInit),this.yieldPos=oldYieldPos,this.awaitPos=oldAwaitPos,this.awaitIdentPos=oldAwaitIdentPos,this.finishNode(node3,statement&FUNC_STATEMENT2?"FunctionDeclaration":"FunctionExpression")},pp$82.parseFunctionParams=function(node3){this.expect(types$12.parenL),node3.params=this.parseBindingList(types$12.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},pp$82.parseClass=function(node3,isStatement){this.next();var oldStrict=this.strict;this.strict=!0,this.parseClassId(node3,isStatement),this.parseClassSuper(node3);var privateNameMap=this.enterClassBody(),classBody=this.startNode(),hadConstructor=!1;for(classBody.body=[],this.expect(types$12.braceL);this.type!==types$12.braceR;){var element=this.parseClassElement(node3.superClass!==null);element&&(classBody.body.push(element),element.type==="MethodDefinition"&&element.kind==="constructor"?(hadConstructor&&this.raiseRecoverable(element.start,"Duplicate constructor in the same class"),hadConstructor=!0):element.key&&element.key.type==="PrivateIdentifier"&&isPrivateNameConflicted2(privateNameMap,element)&&this.raiseRecoverable(element.key.start,"Identifier '#"+element.key.name+"' has already been declared"))}return this.strict=oldStrict,this.next(),node3.body=this.finishNode(classBody,"ClassBody"),this.exitClassBody(),this.finishNode(node3,isStatement?"ClassDeclaration":"ClassExpression")},pp$82.parseClassElement=function(constructorAllowsSuper){if(this.eat(types$12.semi))return null;var ecmaVersion2=this.options.ecmaVersion,node3=this.startNode(),keyName="",isGenerator=!1,isAsync=!1,kind="method",isStatic=!1;if(this.eatContextual("static")){if(ecmaVersion2>=13&&this.eat(types$12.braceL))return this.parseClassStaticBlock(node3),node3;this.isClassElementNameStart()||this.type===types$12.star?isStatic=!0:keyName="static"}if(node3.static=isStatic,!keyName&&ecmaVersion2>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===types$12.star)&&!this.canInsertSemicolon()?isAsync=!0:keyName="async"),!keyName&&(ecmaVersion2>=9||!isAsync)&&this.eat(types$12.star)&&(isGenerator=!0),!keyName&&!isAsync&&!isGenerator){var lastValue=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?kind=lastValue:keyName=lastValue)}if(keyName?(node3.computed=!1,node3.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),node3.key.name=keyName,this.finishNode(node3.key,"Identifier")):this.parseClassElementName(node3),ecmaVersion2<13||this.type===types$12.parenL||kind!=="method"||isGenerator||isAsync){var isConstructor=!node3.static&&checkKeyName2(node3,"constructor"),allowsDirectSuper=isConstructor&&constructorAllowsSuper;isConstructor&&kind!=="method"&&this.raise(node3.key.start,"Constructor can't have get/set modifier"),node3.kind=isConstructor?"constructor":kind,this.parseClassMethod(node3,isGenerator,isAsync,allowsDirectSuper)}else this.parseClassField(node3);return node3},pp$82.isClassElementNameStart=function(){return this.type===types$12.name||this.type===types$12.privateId||this.type===types$12.num||this.type===types$12.string||this.type===types$12.bracketL||this.type.keyword},pp$82.parseClassElementName=function(element){this.type===types$12.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),element.computed=!1,element.key=this.parsePrivateIdent()):this.parsePropertyName(element)},pp$82.parseClassMethod=function(method,isGenerator,isAsync,allowsDirectSuper){var key=method.key;method.kind==="constructor"?(isGenerator&&this.raise(key.start,"Constructor can't be a generator"),isAsync&&this.raise(key.start,"Constructor can't be an async method")):method.static&&checkKeyName2(method,"prototype")&&this.raise(key.start,"Classes may not have a static property named prototype");var value=method.value=this.parseMethod(isGenerator,isAsync,allowsDirectSuper);return method.kind==="get"&&value.params.length!==0&&this.raiseRecoverable(value.start,"getter should have no params"),method.kind==="set"&&value.params.length!==1&&this.raiseRecoverable(value.start,"setter should have exactly one param"),method.kind==="set"&&value.params[0].type==="RestElement"&&this.raiseRecoverable(value.params[0].start,"Setter cannot use rest params"),this.finishNode(method,"MethodDefinition")},pp$82.parseClassField=function(field){if(checkKeyName2(field,"constructor")?this.raise(field.key.start,"Classes can't have a field named 'constructor'"):field.static&&checkKeyName2(field,"prototype")&&this.raise(field.key.start,"Classes can't have a static field named 'prototype'"),this.eat(types$12.eq)){var scope=this.currentThisScope(),inClassFieldInit=scope.inClassFieldInit;scope.inClassFieldInit=!0,field.value=this.parseMaybeAssign(),scope.inClassFieldInit=inClassFieldInit}else field.value=null;return this.semicolon(),this.finishNode(field,"PropertyDefinition")},pp$82.parseClassStaticBlock=function(node3){node3.body=[];var oldLabels=this.labels;for(this.labels=[],this.enterScope(SCOPE_CLASS_STATIC_BLOCK2|SCOPE_SUPER2);this.type!==types$12.braceR;){var stmt=this.parseStatement(null);node3.body.push(stmt)}return this.next(),this.exitScope(),this.labels=oldLabels,this.finishNode(node3,"StaticBlock")},pp$82.parseClassId=function(node3,isStatement){this.type===types$12.name?(node3.id=this.parseIdent(),isStatement&&this.checkLValSimple(node3.id,BIND_LEXICAL2,!1)):(isStatement===!0&&this.unexpected(),node3.id=null)},pp$82.parseClassSuper=function(node3){node3.superClass=this.eat(types$12._extends)?this.parseExprSubscripts(null,!1):null},pp$82.enterClassBody=function(){var element={declared:Object.create(null),used:[]};return this.privateNameStack.push(element),element.declared},pp$82.exitClassBody=function(){var ref3=this.privateNameStack.pop(),declared=ref3.declared,used=ref3.used;if(this.options.checkPrivateFields)for(var len=this.privateNameStack.length,parent=len===0?null:this.privateNameStack[len-1],i2=0;i2<used.length;++i2){var id=used[i2];hasOwn2(declared,id.name)||(parent?parent.used.push(id):this.raiseRecoverable(id.start,"Private field '#"+id.name+"' must be declared in an enclosing class"))}};function isPrivateNameConflicted2(privateNameMap,element){var name2=element.key.name,curr=privateNameMap[name2],next="true";return element.type==="MethodDefinition"&&(element.kind==="get"||element.kind==="set")&&(next=(element.static?"s":"i")+element.kind),curr==="iget"&&next==="iset"||curr==="iset"&&next==="iget"||curr==="sget"&&next==="sset"||curr==="sset"&&next==="sget"?(privateNameMap[name2]="true",!1):curr?!0:(privateNameMap[name2]=next,!1)}function checkKeyName2(node3,name2){var computed=node3.computed,key=node3.key;return!computed&&(key.type==="Identifier"&&key.name===name2||key.type==="Literal"&&key.value===name2)}pp$82.parseExportAllDeclaration=function(node3,exports4){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(node3.exported=this.parseModuleExportName(),this.checkExport(exports4,node3.exported,this.lastTokStart)):node3.exported=null),this.expectContextual("from"),this.type!==types$12.string&&this.unexpected(),node3.source=this.parseExprAtom(),this.semicolon(),this.finishNode(node3,"ExportAllDeclaration")},pp$82.parseExport=function(node3,exports4){if(this.next(),this.eat(types$12.star))return this.parseExportAllDeclaration(node3,exports4);if(this.eat(types$12._default))return this.checkExport(exports4,"default",this.lastTokStart),node3.declaration=this.parseExportDefaultDeclaration(),this.finishNode(node3,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())node3.declaration=this.parseExportDeclaration(node3),node3.declaration.type==="VariableDeclaration"?this.checkVariableExport(exports4,node3.declaration.declarations):this.checkExport(exports4,node3.declaration.id,node3.declaration.id.start),node3.specifiers=[],node3.source=null;else{if(node3.declaration=null,node3.specifiers=this.parseExportSpecifiers(exports4),this.eatContextual("from"))this.type!==types$12.string&&this.unexpected(),node3.source=this.parseExprAtom();else{for(var i2=0,list5=node3.specifiers;i2<list5.length;i2+=1){var spec=list5[i2];this.checkUnreserved(spec.local),this.checkLocalExport(spec.local),spec.local.type==="Literal"&&this.raise(spec.local.start,"A string literal cannot be used as an exported binding without `from`.")}node3.source=null}this.semicolon()}return this.finishNode(node3,"ExportNamedDeclaration")},pp$82.parseExportDeclaration=function(node3){return this.parseStatement(null)},pp$82.parseExportDefaultDeclaration=function(){var isAsync;if(this.type===types$12._function||(isAsync=this.isAsyncFunction())){var fNode=this.startNode();return this.next(),isAsync&&this.next(),this.parseFunction(fNode,FUNC_STATEMENT2|FUNC_NULLABLE_ID2,!1,isAsync)}else if(this.type===types$12._class){var cNode=this.startNode();return this.parseClass(cNode,"nullableID")}else{var declaration=this.parseMaybeAssign();return this.semicolon(),declaration}},pp$82.checkExport=function(exports4,name2,pos){exports4&&(typeof name2!="string"&&(name2=name2.type==="Identifier"?name2.name:name2.value),hasOwn2(exports4,name2)&&this.raiseRecoverable(pos,"Duplicate export '"+name2+"'"),exports4[name2]=!0)},pp$82.checkPatternExport=function(exports4,pat){var type=pat.type;if(type==="Identifier")this.checkExport(exports4,pat,pat.start);else if(type==="ObjectPattern")for(var i2=0,list5=pat.properties;i2<list5.length;i2+=1){var prop=list5[i2];this.checkPatternExport(exports4,prop)}else if(type==="ArrayPattern")for(var i$1=0,list$1=pat.elements;i$1<list$1.length;i$1+=1){var elt=list$1[i$1];elt&&this.checkPatternExport(exports4,elt)}else type==="Property"?this.checkPatternExport(exports4,pat.value):type==="AssignmentPattern"?this.checkPatternExport(exports4,pat.left):type==="RestElement"&&this.checkPatternExport(exports4,pat.argument)},pp$82.checkVariableExport=function(exports4,decls){if(exports4)for(var i2=0,list5=decls;i2<list5.length;i2+=1){var decl=list5[i2];this.checkPatternExport(exports4,decl.id)}},pp$82.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},pp$82.parseExportSpecifier=function(exports4){var node3=this.startNode();return node3.local=this.parseModuleExportName(),node3.exported=this.eatContextual("as")?this.parseModuleExportName():node3.local,this.checkExport(exports4,node3.exported,node3.exported.start),this.finishNode(node3,"ExportSpecifier")},pp$82.parseExportSpecifiers=function(exports4){var nodes=[],first=!0;for(this.expect(types$12.braceL);!this.eat(types$12.braceR);){if(first)first=!1;else if(this.expect(types$12.comma),this.afterTrailingComma(types$12.braceR))break;nodes.push(this.parseExportSpecifier(exports4))}return nodes},pp$82.parseImport=function(node3){return this.next(),this.type===types$12.string?(node3.specifiers=empty$12,node3.source=this.parseExprAtom()):(node3.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),node3.source=this.type===types$12.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(node3,"ImportDeclaration")},pp$82.parseImportSpecifier=function(){var node3=this.startNode();return node3.imported=this.parseModuleExportName(),this.eatContextual("as")?node3.local=this.parseIdent():(this.checkUnreserved(node3.imported),node3.local=node3.imported),this.checkLValSimple(node3.local,BIND_LEXICAL2),this.finishNode(node3,"ImportSpecifier")},pp$82.parseImportDefaultSpecifier=function(){var node3=this.startNode();return node3.local=this.parseIdent(),this.checkLValSimple(node3.local,BIND_LEXICAL2),this.finishNode(node3,"ImportDefaultSpecifier")},pp$82.parseImportNamespaceSpecifier=function(){var node3=this.startNode();return this.next(),this.expectContextual("as"),node3.local=this.parseIdent(),this.checkLValSimple(node3.local,BIND_LEXICAL2),this.finishNode(node3,"ImportNamespaceSpecifier")},pp$82.parseImportSpecifiers=function(){var nodes=[],first=!0;if(this.type===types$12.name&&(nodes.push(this.parseImportDefaultSpecifier()),!this.eat(types$12.comma)))return nodes;if(this.type===types$12.star)return nodes.push(this.parseImportNamespaceSpecifier()),nodes;for(this.expect(types$12.braceL);!this.eat(types$12.braceR);){if(first)first=!1;else if(this.expect(types$12.comma),this.afterTrailingComma(types$12.braceR))break;nodes.push(this.parseImportSpecifier())}return nodes},pp$82.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===types$12.string){var stringLiteral2=this.parseLiteral(this.value);return loneSurrogate2.test(stringLiteral2.value)&&this.raise(stringLiteral2.start,"An export name cannot include a lone surrogate."),stringLiteral2}return this.parseIdent(!0)},pp$82.adaptDirectivePrologue=function(statements){for(var i2=0;i2<statements.length&&this.isDirectiveCandidate(statements[i2]);++i2)statements[i2].directive=statements[i2].expression.raw.slice(1,-1)},pp$82.isDirectiveCandidate=function(statement){return this.options.ecmaVersion>=5&&statement.type==="ExpressionStatement"&&statement.expression.type==="Literal"&&typeof statement.expression.value=="string"&&(this.input[statement.start]==='"'||this.input[statement.start]==="'")};var pp$72=Parser3.prototype;pp$72.toAssignable=function(node3,isBinding,refDestructuringErrors){if(this.options.ecmaVersion>=6&&node3)switch(node3.type){case"Identifier":this.inAsync&&node3.name==="await"&&this.raise(node3.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":node3.type="ObjectPattern",refDestructuringErrors&&this.checkPatternErrors(refDestructuringErrors,!0);for(var i2=0,list5=node3.properties;i2<list5.length;i2+=1){var prop=list5[i2];this.toAssignable(prop,isBinding),prop.type==="RestElement"&&(prop.argument.type==="ArrayPattern"||prop.argument.type==="ObjectPattern")&&this.raise(prop.argument.start,"Unexpected token")}break;case"Property":node3.kind!=="init"&&this.raise(node3.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(node3.value,isBinding);break;case"ArrayExpression":node3.type="ArrayPattern",refDestructuringErrors&&this.checkPatternErrors(refDestructuringErrors,!0),this.toAssignableList(node3.elements,isBinding);break;case"SpreadElement":node3.type="RestElement",this.toAssignable(node3.argument,isBinding),node3.argument.type==="AssignmentPattern"&&this.raise(node3.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":node3.operator!=="="&&this.raise(node3.left.end,"Only '=' operator can be used for specifying default value."),node3.type="AssignmentPattern",delete node3.operator,this.toAssignable(node3.left,isBinding);break;case"ParenthesizedExpression":this.toAssignable(node3.expression,isBinding,refDestructuringErrors);break;case"ChainExpression":this.raiseRecoverable(node3.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!isBinding)break;default:this.raise(node3.start,"Assigning to rvalue")}else refDestructuringErrors&&this.checkPatternErrors(refDestructuringErrors,!0);return node3},pp$72.toAssignableList=function(exprList,isBinding){for(var end=exprList.length,i2=0;i2<end;i2++){var elt=exprList[i2];elt&&this.toAssignable(elt,isBinding)}if(end){var last=exprList[end-1];this.options.ecmaVersion===6&&isBinding&&last&&last.type==="RestElement"&&last.argument.type!=="Identifier"&&this.unexpected(last.argument.start)}return exprList},pp$72.parseSpread=function(refDestructuringErrors){var node3=this.startNode();return this.next(),node3.argument=this.parseMaybeAssign(!1,refDestructuringErrors),this.finishNode(node3,"SpreadElement")},pp$72.parseRestBinding=function(){var node3=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==types$12.name&&this.unexpected(),node3.argument=this.parseBindingAtom(),this.finishNode(node3,"RestElement")},pp$72.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case types$12.bracketL:var node3=this.startNode();return this.next(),node3.elements=this.parseBindingList(types$12.bracketR,!0,!0),this.finishNode(node3,"ArrayPattern");case types$12.braceL:return this.parseObj(!0)}return this.parseIdent()},pp$72.parseBindingList=function(close,allowEmpty,allowTrailingComma,allowModifiers){for(var elts=[],first=!0;!this.eat(close);)if(first?first=!1:this.expect(types$12.comma),allowEmpty&&this.type===types$12.comma)elts.push(null);else{if(allowTrailingComma&&this.afterTrailingComma(close))break;if(this.type===types$12.ellipsis){var rest=this.parseRestBinding();this.parseBindingListItem(rest),elts.push(rest),this.type===types$12.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(close);break}else elts.push(this.parseAssignableListItem(allowModifiers))}return elts},pp$72.parseAssignableListItem=function(allowModifiers){var elem=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(elem),elem},pp$72.parseBindingListItem=function(param){return param},pp$72.parseMaybeDefault=function(startPos,startLoc,left){if(left=left||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(types$12.eq))return left;var node3=this.startNodeAt(startPos,startLoc);return node3.left=left,node3.right=this.parseMaybeAssign(),this.finishNode(node3,"AssignmentPattern")},pp$72.checkLValSimple=function(expr,bindingType,checkClashes){bindingType===void 0&&(bindingType=BIND_NONE2);var isBind=bindingType!==BIND_NONE2;switch(expr.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(expr.name)&&this.raiseRecoverable(expr.start,(isBind?"Binding ":"Assigning to ")+expr.name+" in strict mode"),isBind&&(bindingType===BIND_LEXICAL2&&expr.name==="let"&&this.raiseRecoverable(expr.start,"let is disallowed as a lexically bound name"),checkClashes&&(hasOwn2(checkClashes,expr.name)&&this.raiseRecoverable(expr.start,"Argument name clash"),checkClashes[expr.name]=!0),bindingType!==BIND_OUTSIDE2&&this.declareName(expr.name,bindingType,expr.start));break;case"ChainExpression":this.raiseRecoverable(expr.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":isBind&&this.raiseRecoverable(expr.start,"Binding member expression");break;case"ParenthesizedExpression":return isBind&&this.raiseRecoverable(expr.start,"Binding parenthesized expression"),this.checkLValSimple(expr.expression,bindingType,checkClashes);default:this.raise(expr.start,(isBind?"Binding":"Assigning to")+" rvalue")}},pp$72.checkLValPattern=function(expr,bindingType,checkClashes){switch(bindingType===void 0&&(bindingType=BIND_NONE2),expr.type){case"ObjectPattern":for(var i2=0,list5=expr.properties;i2<list5.length;i2+=1){var prop=list5[i2];this.checkLValInnerPattern(prop,bindingType,checkClashes)}break;case"ArrayPattern":for(var i$1=0,list$1=expr.elements;i$1<list$1.length;i$1+=1){var elem=list$1[i$1];elem&&this.checkLValInnerPattern(elem,bindingType,checkClashes)}break;default:this.checkLValSimple(expr,bindingType,checkClashes)}},pp$72.checkLValInnerPattern=function(expr,bindingType,checkClashes){switch(bindingType===void 0&&(bindingType=BIND_NONE2),expr.type){case"Property":this.checkLValInnerPattern(expr.value,bindingType,checkClashes);break;case"AssignmentPattern":this.checkLValPattern(expr.left,bindingType,checkClashes);break;case"RestElement":this.checkLValPattern(expr.argument,bindingType,checkClashes);break;default:this.checkLValPattern(expr,bindingType,checkClashes)}};var TokContext3=function(token,isExpr,preserveSpace,override,generator){this.token=token,this.isExpr=!!isExpr,this.preserveSpace=!!preserveSpace,this.override=override,this.generator=!!generator},types2={b_stat:new TokContext3("{",!1),b_expr:new TokContext3("{",!0),b_tmpl:new TokContext3("${",!1),p_stat:new TokContext3("(",!1),p_expr:new TokContext3("(",!0),q_tmpl:new TokContext3("`",!0,!0,function(p){return p.tryReadTemplateToken()}),f_stat:new TokContext3("function",!1),f_expr:new TokContext3("function",!0),f_expr_gen:new TokContext3("function",!0,!1,null,!0),f_gen:new TokContext3("function",!1,!1,null,!0)},pp$62=Parser3.prototype;pp$62.initialContext=function(){return[types2.b_stat]},pp$62.curContext=function(){return this.context[this.context.length-1]},pp$62.braceIsBlock=function(prevType){var parent=this.curContext();return parent===types2.f_expr||parent===types2.f_stat?!0:prevType===types$12.colon&&(parent===types2.b_stat||parent===types2.b_expr)?!parent.isExpr:prevType===types$12._return||prevType===types$12.name&&this.exprAllowed?lineBreak2.test(this.input.slice(this.lastTokEnd,this.start)):prevType===types$12._else||prevType===types$12.semi||prevType===types$12.eof||prevType===types$12.parenR||prevType===types$12.arrow?!0:prevType===types$12.braceL?parent===types2.b_stat:prevType===types$12._var||prevType===types$12._const||prevType===types$12.name?!1:!this.exprAllowed},pp$62.inGeneratorContext=function(){for(var i2=this.context.length-1;i2>=1;i2--){var context=this.context[i2];if(context.token==="function")return context.generator}return!1},pp$62.updateContext=function(prevType){var update,type=this.type;type.keyword&&prevType===types$12.dot?this.exprAllowed=!1:(update=type.updateContext)?update.call(this,prevType):this.exprAllowed=type.beforeExpr},pp$62.overrideContext=function(tokenCtx){this.curContext()!==tokenCtx&&(this.context[this.context.length-1]=tokenCtx)},types$12.parenR.updateContext=types$12.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var out=this.context.pop();out===types2.b_stat&&this.curContext().token==="function"&&(out=this.context.pop()),this.exprAllowed=!out.isExpr},types$12.braceL.updateContext=function(prevType){this.context.push(this.braceIsBlock(prevType)?types2.b_stat:types2.b_expr),this.exprAllowed=!0},types$12.dollarBraceL.updateContext=function(){this.context.push(types2.b_tmpl),this.exprAllowed=!0},types$12.parenL.updateContext=function(prevType){var statementParens=prevType===types$12._if||prevType===types$12._for||prevType===types$12._with||prevType===types$12._while;this.context.push(statementParens?types2.p_stat:types2.p_expr),this.exprAllowed=!0},types$12.incDec.updateContext=function(){},types$12._function.updateContext=types$12._class.updateContext=function(prevType){prevType.beforeExpr&&prevType!==types$12._else&&!(prevType===types$12.semi&&this.curContext()!==types2.p_stat)&&!(prevType===types$12._return&&lineBreak2.test(this.input.slice(this.lastTokEnd,this.start)))&&!((prevType===types$12.colon||prevType===types$12.braceL)&&this.curContext()===types2.b_stat)?this.context.push(types2.f_expr):this.context.push(types2.f_stat),this.exprAllowed=!1},types$12.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},types$12.backQuote.updateContext=function(){this.curContext()===types2.q_tmpl?this.context.pop():this.context.push(types2.q_tmpl),this.exprAllowed=!1},types$12.star.updateContext=function(prevType){if(prevType===types$12._function){var index2=this.context.length-1;this.context[index2]===types2.f_expr?this.context[index2]=types2.f_expr_gen:this.context[index2]=types2.f_gen}this.exprAllowed=!0},types$12.name.updateContext=function(prevType){var allowed=!1;this.options.ecmaVersion>=6&&prevType!==types$12.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(allowed=!0),this.exprAllowed=allowed};var pp$52=Parser3.prototype;pp$52.checkPropClash=function(prop,propHash,refDestructuringErrors){if(!(this.options.ecmaVersion>=9&&prop.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(prop.computed||prop.method||prop.shorthand))){var key=prop.key,name2;switch(key.type){case"Identifier":name2=key.name;break;case"Literal":name2=String(key.value);break;default:return}var kind=prop.kind;if(this.options.ecmaVersion>=6){name2==="__proto__"&&kind==="init"&&(propHash.proto&&(refDestructuringErrors?refDestructuringErrors.doubleProto<0&&(refDestructuringErrors.doubleProto=key.start):this.raiseRecoverable(key.start,"Redefinition of __proto__ property")),propHash.proto=!0);return}name2="$"+name2;var other=propHash[name2];if(other){var redefinition;kind==="init"?redefinition=this.strict&&other.init||other.get||other.set:redefinition=other.init||other[kind],redefinition&&this.raiseRecoverable(key.start,"Redefinition of property")}else other=propHash[name2]={init:!1,get:!1,set:!1};other[kind]=!0}},pp$52.parseExpression=function(forInit,refDestructuringErrors){var startPos=this.start,startLoc=this.startLoc,expr=this.parseMaybeAssign(forInit,refDestructuringErrors);if(this.type===types$12.comma){var node3=this.startNodeAt(startPos,startLoc);for(node3.expressions=[expr];this.eat(types$12.comma);)node3.expressions.push(this.parseMaybeAssign(forInit,refDestructuringErrors));return this.finishNode(node3,"SequenceExpression")}return expr},pp$52.parseMaybeAssign=function(forInit,refDestructuringErrors,afterLeftParse){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(forInit);this.exprAllowed=!1}var ownDestructuringErrors=!1,oldParenAssign=-1,oldTrailingComma=-1,oldDoubleProto=-1;refDestructuringErrors?(oldParenAssign=refDestructuringErrors.parenthesizedAssign,oldTrailingComma=refDestructuringErrors.trailingComma,oldDoubleProto=refDestructuringErrors.doubleProto,refDestructuringErrors.parenthesizedAssign=refDestructuringErrors.trailingComma=-1):(refDestructuringErrors=new DestructuringErrors3,ownDestructuringErrors=!0);var startPos=this.start,startLoc=this.startLoc;(this.type===types$12.parenL||this.type===types$12.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=forInit==="await");var left=this.parseMaybeConditional(forInit,refDestructuringErrors);if(afterLeftParse&&(left=afterLeftParse.call(this,left,startPos,startLoc)),this.type.isAssign){var node3=this.startNodeAt(startPos,startLoc);return node3.operator=this.value,this.type===types$12.eq&&(left=this.toAssignable(left,!1,refDestructuringErrors)),ownDestructuringErrors||(refDestructuringErrors.parenthesizedAssign=refDestructuringErrors.trailingComma=refDestructuringErrors.doubleProto=-1),refDestructuringErrors.shorthandAssign>=left.start&&(refDestructuringErrors.shorthandAssign=-1),this.type===types$12.eq?this.checkLValPattern(left):this.checkLValSimple(left),node3.left=left,this.next(),node3.right=this.parseMaybeAssign(forInit),oldDoubleProto>-1&&(refDestructuringErrors.doubleProto=oldDoubleProto),this.finishNode(node3,"AssignmentExpression")}else ownDestructuringErrors&&this.checkExpressionErrors(refDestructuringErrors,!0);return oldParenAssign>-1&&(refDestructuringErrors.parenthesizedAssign=oldParenAssign),oldTrailingComma>-1&&(refDestructuringErrors.trailingComma=oldTrailingComma),left},pp$52.parseMaybeConditional=function(forInit,refDestructuringErrors){var startPos=this.start,startLoc=this.startLoc,expr=this.parseExprOps(forInit,refDestructuringErrors);if(this.checkExpressionErrors(refDestructuringErrors))return expr;if(this.eat(types$12.question)){var node3=this.startNodeAt(startPos,startLoc);return node3.test=expr,node3.consequent=this.parseMaybeAssign(),this.expect(types$12.colon),node3.alternate=this.parseMaybeAssign(forInit),this.finishNode(node3,"ConditionalExpression")}return expr},pp$52.parseExprOps=function(forInit,refDestructuringErrors){var startPos=this.start,startLoc=this.startLoc,expr=this.parseMaybeUnary(refDestructuringErrors,!1,!1,forInit);return this.checkExpressionErrors(refDestructuringErrors)||expr.start===startPos&&expr.type==="ArrowFunctionExpression"?expr:this.parseExprOp(expr,startPos,startLoc,-1,forInit)},pp$52.parseExprOp=function(left,leftStartPos,leftStartLoc,minPrec,forInit){var prec=this.type.binop;if(prec!=null&&(!forInit||this.type!==types$12._in)&&prec>minPrec){var logical=this.type===types$12.logicalOR||this.type===types$12.logicalAND,coalesce=this.type===types$12.coalesce;coalesce&&(prec=types$12.logicalAND.binop);var op=this.value;this.next();var startPos=this.start,startLoc=this.startLoc,right=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,forInit),startPos,startLoc,prec,forInit),node3=this.buildBinary(leftStartPos,leftStartLoc,left,right,op,logical||coalesce);return(logical&&this.type===types$12.coalesce||coalesce&&(this.type===types$12.logicalOR||this.type===types$12.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(node3,leftStartPos,leftStartLoc,minPrec,forInit)}return left},pp$52.buildBinary=function(startPos,startLoc,left,right,op,logical){right.type==="PrivateIdentifier"&&this.raise(right.start,"Private identifier can only be left side of binary expression");var node3=this.startNodeAt(startPos,startLoc);return node3.left=left,node3.operator=op,node3.right=right,this.finishNode(node3,logical?"LogicalExpression":"BinaryExpression")},pp$52.parseMaybeUnary=function(refDestructuringErrors,sawUnary,incDec,forInit){var startPos=this.start,startLoc=this.startLoc,expr;if(this.isContextual("await")&&this.canAwait)expr=this.parseAwait(forInit),sawUnary=!0;else if(this.type.prefix){var node3=this.startNode(),update=this.type===types$12.incDec;node3.operator=this.value,node3.prefix=!0,this.next(),node3.argument=this.parseMaybeUnary(null,!0,update,forInit),this.checkExpressionErrors(refDestructuringErrors,!0),update?this.checkLValSimple(node3.argument):this.strict&&node3.operator==="delete"&&node3.argument.type==="Identifier"?this.raiseRecoverable(node3.start,"Deleting local variable in strict mode"):node3.operator==="delete"&&isPrivateFieldAccess2(node3.argument)?this.raiseRecoverable(node3.start,"Private fields can not be deleted"):sawUnary=!0,expr=this.finishNode(node3,update?"UpdateExpression":"UnaryExpression")}else if(!sawUnary&&this.type===types$12.privateId)(forInit||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),expr=this.parsePrivateIdent(),this.type!==types$12._in&&this.unexpected();else{if(expr=this.parseExprSubscripts(refDestructuringErrors,forInit),this.checkExpressionErrors(refDestructuringErrors))return expr;for(;this.type.postfix&&!this.canInsertSemicolon();){var node$1=this.startNodeAt(startPos,startLoc);node$1.operator=this.value,node$1.prefix=!1,node$1.argument=expr,this.checkLValSimple(expr),this.next(),expr=this.finishNode(node$1,"UpdateExpression")}}if(!incDec&&this.eat(types$12.starstar))if(sawUnary)this.unexpected(this.lastTokStart);else return this.buildBinary(startPos,startLoc,expr,this.parseMaybeUnary(null,!1,!1,forInit),"**",!1);else return expr};function isPrivateFieldAccess2(node3){return node3.type==="MemberExpression"&&node3.property.type==="PrivateIdentifier"||node3.type==="ChainExpression"&&isPrivateFieldAccess2(node3.expression)}pp$52.parseExprSubscripts=function(refDestructuringErrors,forInit){var startPos=this.start,startLoc=this.startLoc,expr=this.parseExprAtom(refDestructuringErrors,forInit);if(expr.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return expr;var result=this.parseSubscripts(expr,startPos,startLoc,!1,forInit);return refDestructuringErrors&&result.type==="MemberExpression"&&(refDestructuringErrors.parenthesizedAssign>=result.start&&(refDestructuringErrors.parenthesizedAssign=-1),refDestructuringErrors.parenthesizedBind>=result.start&&(refDestructuringErrors.parenthesizedBind=-1),refDestructuringErrors.trailingComma>=result.start&&(refDestructuringErrors.trailingComma=-1)),result},pp$52.parseSubscripts=function(base,startPos,startLoc,noCalls,forInit){for(var maybeAsyncArrow=this.options.ecmaVersion>=8&&base.type==="Identifier"&&base.name==="async"&&this.lastTokEnd===base.end&&!this.canInsertSemicolon()&&base.end-base.start===5&&this.potentialArrowAt===base.start,optionalChained=!1;;){var element=this.parseSubscript(base,startPos,startLoc,noCalls,maybeAsyncArrow,optionalChained,forInit);if(element.optional&&(optionalChained=!0),element===base||element.type==="ArrowFunctionExpression"){if(optionalChained){var chainNode=this.startNodeAt(startPos,startLoc);chainNode.expression=element,element=this.finishNode(chainNode,"ChainExpression")}return element}base=element}},pp$52.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(types$12.arrow)},pp$52.parseSubscriptAsyncArrow=function(startPos,startLoc,exprList,forInit){return this.parseArrowExpression(this.startNodeAt(startPos,startLoc),exprList,!0,forInit)},pp$52.parseSubscript=function(base,startPos,startLoc,noCalls,maybeAsyncArrow,optionalChained,forInit){var optionalSupported=this.options.ecmaVersion>=11,optional=optionalSupported&&this.eat(types$12.questionDot);noCalls&&optional&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var computed=this.eat(types$12.bracketL);if(computed||optional&&this.type!==types$12.parenL&&this.type!==types$12.backQuote||this.eat(types$12.dot)){var node3=this.startNodeAt(startPos,startLoc);node3.object=base,computed?(node3.property=this.parseExpression(),this.expect(types$12.bracketR)):this.type===types$12.privateId&&base.type!=="Super"?node3.property=this.parsePrivateIdent():node3.property=this.parseIdent(this.options.allowReserved!=="never"),node3.computed=!!computed,optionalSupported&&(node3.optional=optional),base=this.finishNode(node3,"MemberExpression")}else if(!noCalls&&this.eat(types$12.parenL)){var refDestructuringErrors=new DestructuringErrors3,oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,oldAwaitIdentPos=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var exprList=this.parseExprList(types$12.parenR,this.options.ecmaVersion>=8,!1,refDestructuringErrors);if(maybeAsyncArrow&&!optional&&this.shouldParseAsyncArrow())return this.checkPatternErrors(refDestructuringErrors,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=oldYieldPos,this.awaitPos=oldAwaitPos,this.awaitIdentPos=oldAwaitIdentPos,this.parseSubscriptAsyncArrow(startPos,startLoc,exprList,forInit);this.checkExpressionErrors(refDestructuringErrors,!0),this.yieldPos=oldYieldPos||this.yieldPos,this.awaitPos=oldAwaitPos||this.awaitPos,this.awaitIdentPos=oldAwaitIdentPos||this.awaitIdentPos;var node$1=this.startNodeAt(startPos,startLoc);node$1.callee=base,node$1.arguments=exprList,optionalSupported&&(node$1.optional=optional),base=this.finishNode(node$1,"CallExpression")}else if(this.type===types$12.backQuote){(optional||optionalChained)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var node$2=this.startNodeAt(startPos,startLoc);node$2.tag=base,node$2.quasi=this.parseTemplate({isTagged:!0}),base=this.finishNode(node$2,"TaggedTemplateExpression")}return base},pp$52.parseExprAtom=function(refDestructuringErrors,forInit,forNew){this.type===types$12.slash&&this.readRegexp();var node3,canBeArrow=this.potentialArrowAt===this.start;switch(this.type){case types$12._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),node3=this.startNode(),this.next(),this.type===types$12.parenL&&!this.allowDirectSuper&&this.raise(node3.start,"super() call outside constructor of a subclass"),this.type!==types$12.dot&&this.type!==types$12.bracketL&&this.type!==types$12.parenL&&this.unexpected(),this.finishNode(node3,"Super");case types$12._this:return node3=this.startNode(),this.next(),this.finishNode(node3,"ThisExpression");case types$12.name:var startPos=this.start,startLoc=this.startLoc,containsEsc=this.containsEsc,id=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!containsEsc&&id.name==="async"&&!this.canInsertSemicolon()&&this.eat(types$12._function))return this.overrideContext(types2.f_expr),this.parseFunction(this.startNodeAt(startPos,startLoc),0,!1,!0,forInit);if(canBeArrow&&!this.canInsertSemicolon()){if(this.eat(types$12.arrow))return this.parseArrowExpression(this.startNodeAt(startPos,startLoc),[id],!1,forInit);if(this.options.ecmaVersion>=8&&id.name==="async"&&this.type===types$12.name&&!containsEsc&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return id=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(types$12.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(startPos,startLoc),[id],!0,forInit)}return id;case types$12.regexp:var value=this.value;return node3=this.parseLiteral(value.value),node3.regex={pattern:value.pattern,flags:value.flags},node3;case types$12.num:case types$12.string:return this.parseLiteral(this.value);case types$12._null:case types$12._true:case types$12._false:return node3=this.startNode(),node3.value=this.type===types$12._null?null:this.type===types$12._true,node3.raw=this.type.keyword,this.next(),this.finishNode(node3,"Literal");case types$12.parenL:var start2=this.start,expr=this.parseParenAndDistinguishExpression(canBeArrow,forInit);return refDestructuringErrors&&(refDestructuringErrors.parenthesizedAssign<0&&!this.isSimpleAssignTarget(expr)&&(refDestructuringErrors.parenthesizedAssign=start2),refDestructuringErrors.parenthesizedBind<0&&(refDestructuringErrors.parenthesizedBind=start2)),expr;case types$12.bracketL:return node3=this.startNode(),this.next(),node3.elements=this.parseExprList(types$12.bracketR,!0,!0,refDestructuringErrors),this.finishNode(node3,"ArrayExpression");case types$12.braceL:return this.overrideContext(types2.b_expr),this.parseObj(!1,refDestructuringErrors);case types$12._function:return node3=this.startNode(),this.next(),this.parseFunction(node3,0);case types$12._class:return this.parseClass(this.startNode(),!1);case types$12._new:return this.parseNew();case types$12.backQuote:return this.parseTemplate();case types$12._import:return this.options.ecmaVersion>=11?this.parseExprImport(forNew):this.unexpected();default:return this.parseExprAtomDefault()}},pp$52.parseExprAtomDefault=function(){this.unexpected()},pp$52.parseExprImport=function(forNew){var node3=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===types$12.parenL&&!forNew)return this.parseDynamicImport(node3);if(this.type===types$12.dot){var meta=this.startNodeAt(node3.start,node3.loc&&node3.loc.start);return meta.name="import",node3.meta=this.finishNode(meta,"Identifier"),this.parseImportMeta(node3)}else this.unexpected()},pp$52.parseDynamicImport=function(node3){if(this.next(),node3.source=this.parseMaybeAssign(),!this.eat(types$12.parenR)){var errorPos=this.start;this.eat(types$12.comma)&&this.eat(types$12.parenR)?this.raiseRecoverable(errorPos,"Trailing comma is not allowed in import()"):this.unexpected(errorPos)}return this.finishNode(node3,"ImportExpression")},pp$52.parseImportMeta=function(node3){this.next();var containsEsc=this.containsEsc;return node3.property=this.parseIdent(!0),node3.property.name!=="meta"&&this.raiseRecoverable(node3.property.start,"The only valid meta property for import is 'import.meta'"),containsEsc&&this.raiseRecoverable(node3.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(node3.start,"Cannot use 'import.meta' outside a module"),this.finishNode(node3,"MetaProperty")},pp$52.parseLiteral=function(value){var node3=this.startNode();return node3.value=value,node3.raw=this.input.slice(this.start,this.end),node3.raw.charCodeAt(node3.raw.length-1)===110&&(node3.bigint=node3.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(node3,"Literal")},pp$52.parseParenExpression=function(){this.expect(types$12.parenL);var val=this.parseExpression();return this.expect(types$12.parenR),val},pp$52.shouldParseArrow=function(exprList){return!this.canInsertSemicolon()},pp$52.parseParenAndDistinguishExpression=function(canBeArrow,forInit){var startPos=this.start,startLoc=this.startLoc,val,allowTrailingComma=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var innerStartPos=this.start,innerStartLoc=this.startLoc,exprList=[],first=!0,lastIsComma=!1,refDestructuringErrors=new DestructuringErrors3,oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,spreadStart;for(this.yieldPos=0,this.awaitPos=0;this.type!==types$12.parenR;)if(first?first=!1:this.expect(types$12.comma),allowTrailingComma&&this.afterTrailingComma(types$12.parenR,!0)){lastIsComma=!0;break}else if(this.type===types$12.ellipsis){spreadStart=this.start,exprList.push(this.parseParenItem(this.parseRestBinding())),this.type===types$12.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else exprList.push(this.parseMaybeAssign(!1,refDestructuringErrors,this.parseParenItem));var innerEndPos=this.lastTokEnd,innerEndLoc=this.lastTokEndLoc;if(this.expect(types$12.parenR),canBeArrow&&this.shouldParseArrow(exprList)&&this.eat(types$12.arrow))return this.checkPatternErrors(refDestructuringErrors,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=oldYieldPos,this.awaitPos=oldAwaitPos,this.parseParenArrowList(startPos,startLoc,exprList,forInit);(!exprList.length||lastIsComma)&&this.unexpected(this.lastTokStart),spreadStart&&this.unexpected(spreadStart),this.checkExpressionErrors(refDestructuringErrors,!0),this.yieldPos=oldYieldPos||this.yieldPos,this.awaitPos=oldAwaitPos||this.awaitPos,exprList.length>1?(val=this.startNodeAt(innerStartPos,innerStartLoc),val.expressions=exprList,this.finishNodeAt(val,"SequenceExpression",innerEndPos,innerEndLoc)):val=exprList[0]}else val=this.parseParenExpression();if(this.options.preserveParens){var par=this.startNodeAt(startPos,startLoc);return par.expression=val,this.finishNode(par,"ParenthesizedExpression")}else return val},pp$52.parseParenItem=function(item){return item},pp$52.parseParenArrowList=function(startPos,startLoc,exprList,forInit){return this.parseArrowExpression(this.startNodeAt(startPos,startLoc),exprList,!1,forInit)};var empty4=[];pp$52.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var node3=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===types$12.dot){var meta=this.startNodeAt(node3.start,node3.loc&&node3.loc.start);meta.name="new",node3.meta=this.finishNode(meta,"Identifier"),this.next();var containsEsc=this.containsEsc;return node3.property=this.parseIdent(!0),node3.property.name!=="target"&&this.raiseRecoverable(node3.property.start,"The only valid meta property for new is 'new.target'"),containsEsc&&this.raiseRecoverable(node3.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(node3.start,"'new.target' can only be used in functions and class static block"),this.finishNode(node3,"MetaProperty")}var startPos=this.start,startLoc=this.startLoc;return node3.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),startPos,startLoc,!0,!1),this.eat(types$12.parenL)?node3.arguments=this.parseExprList(types$12.parenR,this.options.ecmaVersion>=8,!1):node3.arguments=empty4,this.finishNode(node3,"NewExpression")},pp$52.parseTemplateElement=function(ref3){var isTagged=ref3.isTagged,elem=this.startNode();return this.type===types$12.invalidTemplate?(isTagged||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),elem.value={raw:this.value,cooked:null}):elem.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
4
4
|
`),cooked:this.value},this.next(),elem.tail=this.type===types$12.backQuote,this.finishNode(elem,"TemplateElement")},pp$52.parseTemplate=function(ref3){ref3===void 0&&(ref3={});var isTagged=ref3.isTagged;isTagged===void 0&&(isTagged=!1);var node3=this.startNode();this.next(),node3.expressions=[];var curElt=this.parseTemplateElement({isTagged});for(node3.quasis=[curElt];!curElt.tail;)this.type===types$12.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(types$12.dollarBraceL),node3.expressions.push(this.parseExpression()),this.expect(types$12.braceR),node3.quasis.push(curElt=this.parseTemplateElement({isTagged}));return this.next(),this.finishNode(node3,"TemplateLiteral")},pp$52.isAsyncProp=function(prop){return!prop.computed&&prop.key.type==="Identifier"&&prop.key.name==="async"&&(this.type===types$12.name||this.type===types$12.num||this.type===types$12.string||this.type===types$12.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===types$12.star)&&!lineBreak2.test(this.input.slice(this.lastTokEnd,this.start))},pp$52.parseObj=function(isPattern,refDestructuringErrors){var node3=this.startNode(),first=!0,propHash={};for(node3.properties=[],this.next();!this.eat(types$12.braceR);){if(first)first=!1;else if(this.expect(types$12.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(types$12.braceR))break;var prop=this.parseProperty(isPattern,refDestructuringErrors);isPattern||this.checkPropClash(prop,propHash,refDestructuringErrors),node3.properties.push(prop)}return this.finishNode(node3,isPattern?"ObjectPattern":"ObjectExpression")},pp$52.parseProperty=function(isPattern,refDestructuringErrors){var prop=this.startNode(),isGenerator,isAsync,startPos,startLoc;if(this.options.ecmaVersion>=9&&this.eat(types$12.ellipsis))return isPattern?(prop.argument=this.parseIdent(!1),this.type===types$12.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(prop,"RestElement")):(prop.argument=this.parseMaybeAssign(!1,refDestructuringErrors),this.type===types$12.comma&&refDestructuringErrors&&refDestructuringErrors.trailingComma<0&&(refDestructuringErrors.trailingComma=this.start),this.finishNode(prop,"SpreadElement"));this.options.ecmaVersion>=6&&(prop.method=!1,prop.shorthand=!1,(isPattern||refDestructuringErrors)&&(startPos=this.start,startLoc=this.startLoc),isPattern||(isGenerator=this.eat(types$12.star)));var containsEsc=this.containsEsc;return this.parsePropertyName(prop),!isPattern&&!containsEsc&&this.options.ecmaVersion>=8&&!isGenerator&&this.isAsyncProp(prop)?(isAsync=!0,isGenerator=this.options.ecmaVersion>=9&&this.eat(types$12.star),this.parsePropertyName(prop)):isAsync=!1,this.parsePropertyValue(prop,isPattern,isGenerator,isAsync,startPos,startLoc,refDestructuringErrors,containsEsc),this.finishNode(prop,"Property")},pp$52.parseGetterSetter=function(prop){prop.kind=prop.key.name,this.parsePropertyName(prop),prop.value=this.parseMethod(!1);var paramCount=prop.kind==="get"?0:1;if(prop.value.params.length!==paramCount){var start2=prop.value.start;prop.kind==="get"?this.raiseRecoverable(start2,"getter should have no params"):this.raiseRecoverable(start2,"setter should have exactly one param")}else prop.kind==="set"&&prop.value.params[0].type==="RestElement"&&this.raiseRecoverable(prop.value.params[0].start,"Setter cannot use rest params")},pp$52.parsePropertyValue=function(prop,isPattern,isGenerator,isAsync,startPos,startLoc,refDestructuringErrors,containsEsc){(isGenerator||isAsync)&&this.type===types$12.colon&&this.unexpected(),this.eat(types$12.colon)?(prop.value=isPattern?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,refDestructuringErrors),prop.kind="init"):this.options.ecmaVersion>=6&&this.type===types$12.parenL?(isPattern&&this.unexpected(),prop.kind="init",prop.method=!0,prop.value=this.parseMethod(isGenerator,isAsync)):!isPattern&&!containsEsc&&this.options.ecmaVersion>=5&&!prop.computed&&prop.key.type==="Identifier"&&(prop.key.name==="get"||prop.key.name==="set")&&this.type!==types$12.comma&&this.type!==types$12.braceR&&this.type!==types$12.eq?((isGenerator||isAsync)&&this.unexpected(),this.parseGetterSetter(prop)):this.options.ecmaVersion>=6&&!prop.computed&&prop.key.type==="Identifier"?((isGenerator||isAsync)&&this.unexpected(),this.checkUnreserved(prop.key),prop.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=startPos),prop.kind="init",isPattern?prop.value=this.parseMaybeDefault(startPos,startLoc,this.copyNode(prop.key)):this.type===types$12.eq&&refDestructuringErrors?(refDestructuringErrors.shorthandAssign<0&&(refDestructuringErrors.shorthandAssign=this.start),prop.value=this.parseMaybeDefault(startPos,startLoc,this.copyNode(prop.key))):prop.value=this.copyNode(prop.key),prop.shorthand=!0):this.unexpected()},pp$52.parsePropertyName=function(prop){if(this.options.ecmaVersion>=6){if(this.eat(types$12.bracketL))return prop.computed=!0,prop.key=this.parseMaybeAssign(),this.expect(types$12.bracketR),prop.key;prop.computed=!1}return prop.key=this.type===types$12.num||this.type===types$12.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},pp$52.initFunction=function(node3){node3.id=null,this.options.ecmaVersion>=6&&(node3.generator=node3.expression=!1),this.options.ecmaVersion>=8&&(node3.async=!1)},pp$52.parseMethod=function(isGenerator,isAsync,allowDirectSuper){var node3=this.startNode(),oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,oldAwaitIdentPos=this.awaitIdentPos;return this.initFunction(node3),this.options.ecmaVersion>=6&&(node3.generator=isGenerator),this.options.ecmaVersion>=8&&(node3.async=!!isAsync),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags2(isAsync,node3.generator)|SCOPE_SUPER2|(allowDirectSuper?SCOPE_DIRECT_SUPER2:0)),this.expect(types$12.parenL),node3.params=this.parseBindingList(types$12.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(node3,!1,!0,!1),this.yieldPos=oldYieldPos,this.awaitPos=oldAwaitPos,this.awaitIdentPos=oldAwaitIdentPos,this.finishNode(node3,"FunctionExpression")},pp$52.parseArrowExpression=function(node3,params,isAsync,forInit){var oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,oldAwaitIdentPos=this.awaitIdentPos;return this.enterScope(functionFlags2(isAsync,!1)|SCOPE_ARROW2),this.initFunction(node3),this.options.ecmaVersion>=8&&(node3.async=!!isAsync),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,node3.params=this.toAssignableList(params,!0),this.parseFunctionBody(node3,!0,!1,forInit),this.yieldPos=oldYieldPos,this.awaitPos=oldAwaitPos,this.awaitIdentPos=oldAwaitIdentPos,this.finishNode(node3,"ArrowFunctionExpression")},pp$52.parseFunctionBody=function(node3,isArrowFunction,isMethod,forInit){var isExpression=isArrowFunction&&this.type!==types$12.braceL,oldStrict=this.strict,useStrict=!1;if(isExpression)node3.body=this.parseMaybeAssign(forInit),node3.expression=!0,this.checkParams(node3,!1);else{var nonSimple=this.options.ecmaVersion>=7&&!this.isSimpleParamList(node3.params);(!oldStrict||nonSimple)&&(useStrict=this.strictDirective(this.end),useStrict&&nonSimple&&this.raiseRecoverable(node3.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var oldLabels=this.labels;this.labels=[],useStrict&&(this.strict=!0),this.checkParams(node3,!oldStrict&&!useStrict&&!isArrowFunction&&!isMethod&&this.isSimpleParamList(node3.params)),this.strict&&node3.id&&this.checkLValSimple(node3.id,BIND_OUTSIDE2),node3.body=this.parseBlock(!1,void 0,useStrict&&!oldStrict),node3.expression=!1,this.adaptDirectivePrologue(node3.body.body),this.labels=oldLabels}this.exitScope()},pp$52.isSimpleParamList=function(params){for(var i2=0,list5=params;i2<list5.length;i2+=1){var param=list5[i2];if(param.type!=="Identifier")return!1}return!0},pp$52.checkParams=function(node3,allowDuplicates){for(var nameHash=Object.create(null),i2=0,list5=node3.params;i2<list5.length;i2+=1){var param=list5[i2];this.checkLValInnerPattern(param,BIND_VAR2,allowDuplicates?null:nameHash)}},pp$52.parseExprList=function(close,allowTrailingComma,allowEmpty,refDestructuringErrors){for(var elts=[],first=!0;!this.eat(close);){if(first)first=!1;else if(this.expect(types$12.comma),allowTrailingComma&&this.afterTrailingComma(close))break;var elt=void 0;allowEmpty&&this.type===types$12.comma?elt=null:this.type===types$12.ellipsis?(elt=this.parseSpread(refDestructuringErrors),refDestructuringErrors&&this.type===types$12.comma&&refDestructuringErrors.trailingComma<0&&(refDestructuringErrors.trailingComma=this.start)):elt=this.parseMaybeAssign(!1,refDestructuringErrors),elts.push(elt)}return elts},pp$52.checkUnreserved=function(ref3){var start2=ref3.start,end=ref3.end,name2=ref3.name;if(this.inGenerator&&name2==="yield"&&this.raiseRecoverable(start2,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&name2==="await"&&this.raiseRecoverable(start2,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&name2==="arguments"&&this.raiseRecoverable(start2,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(name2==="arguments"||name2==="await")&&this.raise(start2,"Cannot use "+name2+" in class static initialization block"),this.keywords.test(name2)&&this.raise(start2,"Unexpected keyword '"+name2+"'"),!(this.options.ecmaVersion<6&&this.input.slice(start2,end).indexOf("\\")!==-1)){var re=this.strict?this.reservedWordsStrict:this.reservedWords;re.test(name2)&&(!this.inAsync&&name2==="await"&&this.raiseRecoverable(start2,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(start2,"The keyword '"+name2+"' is reserved"))}},pp$52.parseIdent=function(liberal){var node3=this.parseIdentNode();return this.next(!!liberal),this.finishNode(node3,"Identifier"),liberal||(this.checkUnreserved(node3),node3.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=node3.start)),node3},pp$52.parseIdentNode=function(){var node3=this.startNode();return this.type===types$12.name?node3.name=this.value:this.type.keyword?(node3.name=this.type.keyword,(node3.name==="class"||node3.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=types$12.name):this.unexpected(),node3},pp$52.parsePrivateIdent=function(){var node3=this.startNode();return this.type===types$12.privateId?node3.name=this.value:this.unexpected(),this.next(),this.finishNode(node3,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(node3.start,"Private field '#"+node3.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(node3)),node3},pp$52.parseYield=function(forInit){this.yieldPos||(this.yieldPos=this.start);var node3=this.startNode();return this.next(),this.type===types$12.semi||this.canInsertSemicolon()||this.type!==types$12.star&&!this.type.startsExpr?(node3.delegate=!1,node3.argument=null):(node3.delegate=this.eat(types$12.star),node3.argument=this.parseMaybeAssign(forInit)),this.finishNode(node3,"YieldExpression")},pp$52.parseAwait=function(forInit){this.awaitPos||(this.awaitPos=this.start);var node3=this.startNode();return this.next(),node3.argument=this.parseMaybeUnary(null,!0,!1,forInit),this.finishNode(node3,"AwaitExpression")};var pp$42=Parser3.prototype;pp$42.raise=function(pos,message){var loc=getLineInfo2(this.input,pos);message+=" ("+loc.line+":"+loc.column+")";var err=new SyntaxError(message);throw err.pos=pos,err.loc=loc,err.raisedAt=this.pos,err},pp$42.raiseRecoverable=pp$42.raise,pp$42.curPosition=function(){if(this.options.locations)return new Position3(this.curLine,this.pos-this.lineStart)};var pp$32=Parser3.prototype,Scope3=function(flags){this.flags=flags,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};pp$32.enterScope=function(flags){this.scopeStack.push(new Scope3(flags))},pp$32.exitScope=function(){this.scopeStack.pop()},pp$32.treatFunctionsAsVarInScope=function(scope){return scope.flags&SCOPE_FUNCTION2||!this.inModule&&scope.flags&SCOPE_TOP2},pp$32.declareName=function(name2,bindingType,pos){var redeclared=!1;if(bindingType===BIND_LEXICAL2){var scope=this.currentScope();redeclared=scope.lexical.indexOf(name2)>-1||scope.functions.indexOf(name2)>-1||scope.var.indexOf(name2)>-1,scope.lexical.push(name2),this.inModule&&scope.flags&SCOPE_TOP2&&delete this.undefinedExports[name2]}else if(bindingType===BIND_SIMPLE_CATCH2){var scope$1=this.currentScope();scope$1.lexical.push(name2)}else if(bindingType===BIND_FUNCTION2){var scope$2=this.currentScope();this.treatFunctionsAsVar?redeclared=scope$2.lexical.indexOf(name2)>-1:redeclared=scope$2.lexical.indexOf(name2)>-1||scope$2.var.indexOf(name2)>-1,scope$2.functions.push(name2)}else for(var i2=this.scopeStack.length-1;i2>=0;--i2){var scope$3=this.scopeStack[i2];if(scope$3.lexical.indexOf(name2)>-1&&!(scope$3.flags&SCOPE_SIMPLE_CATCH2&&scope$3.lexical[0]===name2)||!this.treatFunctionsAsVarInScope(scope$3)&&scope$3.functions.indexOf(name2)>-1){redeclared=!0;break}if(scope$3.var.push(name2),this.inModule&&scope$3.flags&SCOPE_TOP2&&delete this.undefinedExports[name2],scope$3.flags&SCOPE_VAR2)break}redeclared&&this.raiseRecoverable(pos,"Identifier '"+name2+"' has already been declared")},pp$32.checkLocalExport=function(id){this.scopeStack[0].lexical.indexOf(id.name)===-1&&this.scopeStack[0].var.indexOf(id.name)===-1&&(this.undefinedExports[id.name]=id)},pp$32.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},pp$32.currentVarScope=function(){for(var i2=this.scopeStack.length-1;;i2--){var scope=this.scopeStack[i2];if(scope.flags&SCOPE_VAR2)return scope}},pp$32.currentThisScope=function(){for(var i2=this.scopeStack.length-1;;i2--){var scope=this.scopeStack[i2];if(scope.flags&SCOPE_VAR2&&!(scope.flags&SCOPE_ARROW2))return scope}};var Node3=function(parser,pos,loc){this.type="",this.start=pos,this.end=0,parser.options.locations&&(this.loc=new SourceLocation3(parser,loc)),parser.options.directSourceFile&&(this.sourceFile=parser.options.directSourceFile),parser.options.ranges&&(this.range=[pos,0])},pp$22=Parser3.prototype;pp$22.startNode=function(){return new Node3(this,this.start,this.startLoc)},pp$22.startNodeAt=function(pos,loc){return new Node3(this,pos,loc)};function finishNodeAt2(node3,type,pos,loc){return node3.type=type,node3.end=pos,this.options.locations&&(node3.loc.end=loc),this.options.ranges&&(node3.range[1]=pos),node3}pp$22.finishNode=function(node3,type){return finishNodeAt2.call(this,node3,type,this.lastTokEnd,this.lastTokEndLoc)},pp$22.finishNodeAt=function(node3,type,pos,loc){return finishNodeAt2.call(this,node3,type,pos,loc)},pp$22.copyNode=function(node3){var newNode=new Node3(this,node3.start,this.startLoc);for(var prop in node3)newNode[prop]=node3[prop];return newNode};var ecma9BinaryProperties2="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",ecma10BinaryProperties2=ecma9BinaryProperties2+" Extended_Pictographic",ecma11BinaryProperties2=ecma10BinaryProperties2,ecma12BinaryProperties2=ecma11BinaryProperties2+" EBase EComp EMod EPres ExtPict",ecma13BinaryProperties2=ecma12BinaryProperties2,ecma14BinaryProperties2=ecma13BinaryProperties2,unicodeBinaryProperties2={9:ecma9BinaryProperties2,10:ecma10BinaryProperties2,11:ecma11BinaryProperties2,12:ecma12BinaryProperties2,13:ecma13BinaryProperties2,14:ecma14BinaryProperties2},ecma14BinaryPropertiesOfStrings2="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",unicodeBinaryPropertiesOfStrings2={9:"",10:"",11:"",12:"",13:"",14:ecma14BinaryPropertiesOfStrings2},unicodeGeneralCategoryValues2="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",ecma9ScriptValues2="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ecma10ScriptValues2=ecma9ScriptValues2+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ecma11ScriptValues2=ecma10ScriptValues2+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",ecma12ScriptValues2=ecma11ScriptValues2+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",ecma13ScriptValues2=ecma12ScriptValues2+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",ecma14ScriptValues2=ecma13ScriptValues2+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",unicodeScriptValues2={9:ecma9ScriptValues2,10:ecma10ScriptValues2,11:ecma11ScriptValues2,12:ecma12ScriptValues2,13:ecma13ScriptValues2,14:ecma14ScriptValues2},data2={};function buildUnicodeData2(ecmaVersion2){var d=data2[ecmaVersion2]={binary:wordsRegexp2(unicodeBinaryProperties2[ecmaVersion2]+" "+unicodeGeneralCategoryValues2),binaryOfStrings:wordsRegexp2(unicodeBinaryPropertiesOfStrings2[ecmaVersion2]),nonBinary:{General_Category:wordsRegexp2(unicodeGeneralCategoryValues2),Script:wordsRegexp2(unicodeScriptValues2[ecmaVersion2])}};d.nonBinary.Script_Extensions=d.nonBinary.Script,d.nonBinary.gc=d.nonBinary.General_Category,d.nonBinary.sc=d.nonBinary.Script,d.nonBinary.scx=d.nonBinary.Script_Extensions}for(var i=0,list4=[9,10,11,12,13,14];i<list4.length;i+=1){var ecmaVersion=list4[i];buildUnicodeData2(ecmaVersion)}var pp$12=Parser3.prototype,RegExpValidationState3=function(parser){this.parser=parser,this.validFlags="gim"+(parser.options.ecmaVersion>=6?"uy":"")+(parser.options.ecmaVersion>=9?"s":"")+(parser.options.ecmaVersion>=13?"d":"")+(parser.options.ecmaVersion>=15?"v":""),this.unicodeProperties=data2[parser.options.ecmaVersion>=14?14:parser.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};RegExpValidationState3.prototype.reset=function(start2,pattern,flags){var unicodeSets=flags.indexOf("v")!==-1,unicode=flags.indexOf("u")!==-1;this.start=start2|0,this.source=pattern+"",this.flags=flags,unicodeSets&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=unicode&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=unicode&&this.parser.options.ecmaVersion>=9)},RegExpValidationState3.prototype.raise=function(message){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+message)},RegExpValidationState3.prototype.at=function(i2,forceU){forceU===void 0&&(forceU=!1);var s=this.source,l=s.length;if(i2>=l)return-1;var c=s.charCodeAt(i2);if(!(forceU||this.switchU)||c<=55295||c>=57344||i2+1>=l)return c;var next=s.charCodeAt(i2+1);return next>=56320&&next<=57343?(c<<10)+next-56613888:c},RegExpValidationState3.prototype.nextIndex=function(i2,forceU){forceU===void 0&&(forceU=!1);var s=this.source,l=s.length;if(i2>=l)return l;var c=s.charCodeAt(i2),next;return!(forceU||this.switchU)||c<=55295||c>=57344||i2+1>=l||(next=s.charCodeAt(i2+1))<56320||next>57343?i2+1:i2+2},RegExpValidationState3.prototype.current=function(forceU){return forceU===void 0&&(forceU=!1),this.at(this.pos,forceU)},RegExpValidationState3.prototype.lookahead=function(forceU){return forceU===void 0&&(forceU=!1),this.at(this.nextIndex(this.pos,forceU),forceU)},RegExpValidationState3.prototype.advance=function(forceU){forceU===void 0&&(forceU=!1),this.pos=this.nextIndex(this.pos,forceU)},RegExpValidationState3.prototype.eat=function(ch,forceU){return forceU===void 0&&(forceU=!1),this.current(forceU)===ch?(this.advance(forceU),!0):!1},RegExpValidationState3.prototype.eatChars=function(chs,forceU){forceU===void 0&&(forceU=!1);for(var pos=this.pos,i2=0,list5=chs;i2<list5.length;i2+=1){var ch=list5[i2],current2=this.at(pos,forceU);if(current2===-1||current2!==ch)return!1;pos=this.nextIndex(pos,forceU)}return this.pos=pos,!0},pp$12.validateRegExpFlags=function(state){for(var validFlags=state.validFlags,flags=state.flags,u=!1,v=!1,i2=0;i2<flags.length;i2++){var flag=flags.charAt(i2);validFlags.indexOf(flag)===-1&&this.raise(state.start,"Invalid regular expression flag"),flags.indexOf(flag,i2+1)>-1&&this.raise(state.start,"Duplicate regular expression flag"),flag==="u"&&(u=!0),flag==="v"&&(v=!0)}this.options.ecmaVersion>=15&&u&&v&&this.raise(state.start,"Invalid regular expression flag")},pp$12.validateRegExpPattern=function(state){this.regexp_pattern(state),!state.switchN&&this.options.ecmaVersion>=9&&state.groupNames.length>0&&(state.switchN=!0,this.regexp_pattern(state))},pp$12.regexp_pattern=function(state){state.pos=0,state.lastIntValue=0,state.lastStringValue="",state.lastAssertionIsQuantifiable=!1,state.numCapturingParens=0,state.maxBackReference=0,state.groupNames.length=0,state.backReferenceNames.length=0,this.regexp_disjunction(state),state.pos!==state.source.length&&(state.eat(41)&&state.raise("Unmatched ')'"),(state.eat(93)||state.eat(125))&&state.raise("Lone quantifier brackets")),state.maxBackReference>state.numCapturingParens&&state.raise("Invalid escape");for(var i2=0,list5=state.backReferenceNames;i2<list5.length;i2+=1){var name2=list5[i2];state.groupNames.indexOf(name2)===-1&&state.raise("Invalid named capture referenced")}},pp$12.regexp_disjunction=function(state){for(this.regexp_alternative(state);state.eat(124);)this.regexp_alternative(state);this.regexp_eatQuantifier(state,!0)&&state.raise("Nothing to repeat"),state.eat(123)&&state.raise("Lone quantifier brackets")},pp$12.regexp_alternative=function(state){for(;state.pos<state.source.length&&this.regexp_eatTerm(state););},pp$12.regexp_eatTerm=function(state){return this.regexp_eatAssertion(state)?(state.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(state)&&state.switchU&&state.raise("Invalid quantifier"),!0):(state.switchU?this.regexp_eatAtom(state):this.regexp_eatExtendedAtom(state))?(this.regexp_eatQuantifier(state),!0):!1},pp$12.regexp_eatAssertion=function(state){var start2=state.pos;if(state.lastAssertionIsQuantifiable=!1,state.eat(94)||state.eat(36))return!0;if(state.eat(92)){if(state.eat(66)||state.eat(98))return!0;state.pos=start2}if(state.eat(40)&&state.eat(63)){var lookbehind=!1;if(this.options.ecmaVersion>=9&&(lookbehind=state.eat(60)),state.eat(61)||state.eat(33))return this.regexp_disjunction(state),state.eat(41)||state.raise("Unterminated group"),state.lastAssertionIsQuantifiable=!lookbehind,!0}return state.pos=start2,!1},pp$12.regexp_eatQuantifier=function(state,noError){return noError===void 0&&(noError=!1),this.regexp_eatQuantifierPrefix(state,noError)?(state.eat(63),!0):!1},pp$12.regexp_eatQuantifierPrefix=function(state,noError){return state.eat(42)||state.eat(43)||state.eat(63)||this.regexp_eatBracedQuantifier(state,noError)},pp$12.regexp_eatBracedQuantifier=function(state,noError){var start2=state.pos;if(state.eat(123)){var min=0,max=-1;if(this.regexp_eatDecimalDigits(state)&&(min=state.lastIntValue,state.eat(44)&&this.regexp_eatDecimalDigits(state)&&(max=state.lastIntValue),state.eat(125)))return max!==-1&&max<min&&!noError&&state.raise("numbers out of order in {} quantifier"),!0;state.switchU&&!noError&&state.raise("Incomplete quantifier"),state.pos=start2}return!1},pp$12.regexp_eatAtom=function(state){return this.regexp_eatPatternCharacters(state)||state.eat(46)||this.regexp_eatReverseSolidusAtomEscape(state)||this.regexp_eatCharacterClass(state)||this.regexp_eatUncapturingGroup(state)||this.regexp_eatCapturingGroup(state)},pp$12.regexp_eatReverseSolidusAtomEscape=function(state){var start2=state.pos;if(state.eat(92)){if(this.regexp_eatAtomEscape(state))return!0;state.pos=start2}return!1},pp$12.regexp_eatUncapturingGroup=function(state){var start2=state.pos;if(state.eat(40)){if(state.eat(63)&&state.eat(58)){if(this.regexp_disjunction(state),state.eat(41))return!0;state.raise("Unterminated group")}state.pos=start2}return!1},pp$12.regexp_eatCapturingGroup=function(state){if(state.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(state):state.current()===63&&state.raise("Invalid group"),this.regexp_disjunction(state),state.eat(41))return state.numCapturingParens+=1,!0;state.raise("Unterminated group")}return!1},pp$12.regexp_eatExtendedAtom=function(state){return state.eat(46)||this.regexp_eatReverseSolidusAtomEscape(state)||this.regexp_eatCharacterClass(state)||this.regexp_eatUncapturingGroup(state)||this.regexp_eatCapturingGroup(state)||this.regexp_eatInvalidBracedQuantifier(state)||this.regexp_eatExtendedPatternCharacter(state)},pp$12.regexp_eatInvalidBracedQuantifier=function(state){return this.regexp_eatBracedQuantifier(state,!0)&&state.raise("Nothing to repeat"),!1},pp$12.regexp_eatSyntaxCharacter=function(state){var ch=state.current();return isSyntaxCharacter2(ch)?(state.lastIntValue=ch,state.advance(),!0):!1};function isSyntaxCharacter2(ch){return ch===36||ch>=40&&ch<=43||ch===46||ch===63||ch>=91&&ch<=94||ch>=123&&ch<=125}pp$12.regexp_eatPatternCharacters=function(state){for(var start2=state.pos,ch=0;(ch=state.current())!==-1&&!isSyntaxCharacter2(ch);)state.advance();return state.pos!==start2},pp$12.regexp_eatExtendedPatternCharacter=function(state){var ch=state.current();return ch!==-1&&ch!==36&&!(ch>=40&&ch<=43)&&ch!==46&&ch!==63&&ch!==91&&ch!==94&&ch!==124?(state.advance(),!0):!1},pp$12.regexp_groupSpecifier=function(state){if(state.eat(63)){if(this.regexp_eatGroupName(state)){state.groupNames.indexOf(state.lastStringValue)!==-1&&state.raise("Duplicate capture group name"),state.groupNames.push(state.lastStringValue);return}state.raise("Invalid group")}},pp$12.regexp_eatGroupName=function(state){if(state.lastStringValue="",state.eat(60)){if(this.regexp_eatRegExpIdentifierName(state)&&state.eat(62))return!0;state.raise("Invalid capture group name")}return!1},pp$12.regexp_eatRegExpIdentifierName=function(state){if(state.lastStringValue="",this.regexp_eatRegExpIdentifierStart(state)){for(state.lastStringValue+=codePointToString2(state.lastIntValue);this.regexp_eatRegExpIdentifierPart(state);)state.lastStringValue+=codePointToString2(state.lastIntValue);return!0}return!1},pp$12.regexp_eatRegExpIdentifierStart=function(state){var start2=state.pos,forceU=this.options.ecmaVersion>=11,ch=state.current(forceU);return state.advance(forceU),ch===92&&this.regexp_eatRegExpUnicodeEscapeSequence(state,forceU)&&(ch=state.lastIntValue),isRegExpIdentifierStart2(ch)?(state.lastIntValue=ch,!0):(state.pos=start2,!1)};function isRegExpIdentifierStart2(ch){return isIdentifierStart2(ch,!0)||ch===36||ch===95}pp$12.regexp_eatRegExpIdentifierPart=function(state){var start2=state.pos,forceU=this.options.ecmaVersion>=11,ch=state.current(forceU);return state.advance(forceU),ch===92&&this.regexp_eatRegExpUnicodeEscapeSequence(state,forceU)&&(ch=state.lastIntValue),isRegExpIdentifierPart2(ch)?(state.lastIntValue=ch,!0):(state.pos=start2,!1)};function isRegExpIdentifierPart2(ch){return isIdentifierChar2(ch,!0)||ch===36||ch===95||ch===8204||ch===8205}pp$12.regexp_eatAtomEscape=function(state){return this.regexp_eatBackReference(state)||this.regexp_eatCharacterClassEscape(state)||this.regexp_eatCharacterEscape(state)||state.switchN&&this.regexp_eatKGroupName(state)?!0:(state.switchU&&(state.current()===99&&state.raise("Invalid unicode escape"),state.raise("Invalid escape")),!1)},pp$12.regexp_eatBackReference=function(state){var start2=state.pos;if(this.regexp_eatDecimalEscape(state)){var n=state.lastIntValue;if(state.switchU)return n>state.maxBackReference&&(state.maxBackReference=n),!0;if(n<=state.numCapturingParens)return!0;state.pos=start2}return!1},pp$12.regexp_eatKGroupName=function(state){if(state.eat(107)){if(this.regexp_eatGroupName(state))return state.backReferenceNames.push(state.lastStringValue),!0;state.raise("Invalid named reference")}return!1},pp$12.regexp_eatCharacterEscape=function(state){return this.regexp_eatControlEscape(state)||this.regexp_eatCControlLetter(state)||this.regexp_eatZero(state)||this.regexp_eatHexEscapeSequence(state)||this.regexp_eatRegExpUnicodeEscapeSequence(state,!1)||!state.switchU&&this.regexp_eatLegacyOctalEscapeSequence(state)||this.regexp_eatIdentityEscape(state)},pp$12.regexp_eatCControlLetter=function(state){var start2=state.pos;if(state.eat(99)){if(this.regexp_eatControlLetter(state))return!0;state.pos=start2}return!1},pp$12.regexp_eatZero=function(state){return state.current()===48&&!isDecimalDigit2(state.lookahead())?(state.lastIntValue=0,state.advance(),!0):!1},pp$12.regexp_eatControlEscape=function(state){var ch=state.current();return ch===116?(state.lastIntValue=9,state.advance(),!0):ch===110?(state.lastIntValue=10,state.advance(),!0):ch===118?(state.lastIntValue=11,state.advance(),!0):ch===102?(state.lastIntValue=12,state.advance(),!0):ch===114?(state.lastIntValue=13,state.advance(),!0):!1},pp$12.regexp_eatControlLetter=function(state){var ch=state.current();return isControlLetter2(ch)?(state.lastIntValue=ch%32,state.advance(),!0):!1};function isControlLetter2(ch){return ch>=65&&ch<=90||ch>=97&&ch<=122}pp$12.regexp_eatRegExpUnicodeEscapeSequence=function(state,forceU){forceU===void 0&&(forceU=!1);var start2=state.pos,switchU=forceU||state.switchU;if(state.eat(117)){if(this.regexp_eatFixedHexDigits(state,4)){var lead=state.lastIntValue;if(switchU&&lead>=55296&&lead<=56319){var leadSurrogateEnd=state.pos;if(state.eat(92)&&state.eat(117)&&this.regexp_eatFixedHexDigits(state,4)){var trail=state.lastIntValue;if(trail>=56320&&trail<=57343)return state.lastIntValue=(lead-55296)*1024+(trail-56320)+65536,!0}state.pos=leadSurrogateEnd,state.lastIntValue=lead}return!0}if(switchU&&state.eat(123)&&this.regexp_eatHexDigits(state)&&state.eat(125)&&isValidUnicode2(state.lastIntValue))return!0;switchU&&state.raise("Invalid unicode escape"),state.pos=start2}return!1};function isValidUnicode2(ch){return ch>=0&&ch<=1114111}pp$12.regexp_eatIdentityEscape=function(state){if(state.switchU)return this.regexp_eatSyntaxCharacter(state)?!0:state.eat(47)?(state.lastIntValue=47,!0):!1;var ch=state.current();return ch!==99&&(!state.switchN||ch!==107)?(state.lastIntValue=ch,state.advance(),!0):!1},pp$12.regexp_eatDecimalEscape=function(state){state.lastIntValue=0;var ch=state.current();if(ch>=49&&ch<=57){do state.lastIntValue=10*state.lastIntValue+(ch-48),state.advance();while((ch=state.current())>=48&&ch<=57);return!0}return!1};var CharSetNone2=0,CharSetOk2=1,CharSetString2=2;pp$12.regexp_eatCharacterClassEscape=function(state){var ch=state.current();if(isCharacterClassEscape2(ch))return state.lastIntValue=-1,state.advance(),CharSetOk2;var negate=!1;if(state.switchU&&this.options.ecmaVersion>=9&&((negate=ch===80)||ch===112)){state.lastIntValue=-1,state.advance();var result;if(state.eat(123)&&(result=this.regexp_eatUnicodePropertyValueExpression(state))&&state.eat(125))return negate&&result===CharSetString2&&state.raise("Invalid property name"),result;state.raise("Invalid property name")}return CharSetNone2};function isCharacterClassEscape2(ch){return ch===100||ch===68||ch===115||ch===83||ch===119||ch===87}pp$12.regexp_eatUnicodePropertyValueExpression=function(state){var start2=state.pos;if(this.regexp_eatUnicodePropertyName(state)&&state.eat(61)){var name2=state.lastStringValue;if(this.regexp_eatUnicodePropertyValue(state)){var value=state.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(state,name2,value),CharSetOk2}}if(state.pos=start2,this.regexp_eatLoneUnicodePropertyNameOrValue(state)){var nameOrValue=state.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(state,nameOrValue)}return CharSetNone2},pp$12.regexp_validateUnicodePropertyNameAndValue=function(state,name2,value){hasOwn2(state.unicodeProperties.nonBinary,name2)||state.raise("Invalid property name"),state.unicodeProperties.nonBinary[name2].test(value)||state.raise("Invalid property value")},pp$12.regexp_validateUnicodePropertyNameOrValue=function(state,nameOrValue){if(state.unicodeProperties.binary.test(nameOrValue))return CharSetOk2;if(state.switchV&&state.unicodeProperties.binaryOfStrings.test(nameOrValue))return CharSetString2;state.raise("Invalid property name")},pp$12.regexp_eatUnicodePropertyName=function(state){var ch=0;for(state.lastStringValue="";isUnicodePropertyNameCharacter2(ch=state.current());)state.lastStringValue+=codePointToString2(ch),state.advance();return state.lastStringValue!==""};function isUnicodePropertyNameCharacter2(ch){return isControlLetter2(ch)||ch===95}pp$12.regexp_eatUnicodePropertyValue=function(state){var ch=0;for(state.lastStringValue="";isUnicodePropertyValueCharacter2(ch=state.current());)state.lastStringValue+=codePointToString2(ch),state.advance();return state.lastStringValue!==""};function isUnicodePropertyValueCharacter2(ch){return isUnicodePropertyNameCharacter2(ch)||isDecimalDigit2(ch)}pp$12.regexp_eatLoneUnicodePropertyNameOrValue=function(state){return this.regexp_eatUnicodePropertyValue(state)},pp$12.regexp_eatCharacterClass=function(state){if(state.eat(91)){var negate=state.eat(94),result=this.regexp_classContents(state);return state.eat(93)||state.raise("Unterminated character class"),negate&&result===CharSetString2&&state.raise("Negated character class may contain strings"),!0}return!1},pp$12.regexp_classContents=function(state){return state.current()===93?CharSetOk2:state.switchV?this.regexp_classSetExpression(state):(this.regexp_nonEmptyClassRanges(state),CharSetOk2)},pp$12.regexp_nonEmptyClassRanges=function(state){for(;this.regexp_eatClassAtom(state);){var left=state.lastIntValue;if(state.eat(45)&&this.regexp_eatClassAtom(state)){var right=state.lastIntValue;state.switchU&&(left===-1||right===-1)&&state.raise("Invalid character class"),left!==-1&&right!==-1&&left>right&&state.raise("Range out of order in character class")}}},pp$12.regexp_eatClassAtom=function(state){var start2=state.pos;if(state.eat(92)){if(this.regexp_eatClassEscape(state))return!0;if(state.switchU){var ch$1=state.current();(ch$1===99||isOctalDigit2(ch$1))&&state.raise("Invalid class escape"),state.raise("Invalid escape")}state.pos=start2}var ch=state.current();return ch!==93?(state.lastIntValue=ch,state.advance(),!0):!1},pp$12.regexp_eatClassEscape=function(state){var start2=state.pos;if(state.eat(98))return state.lastIntValue=8,!0;if(state.switchU&&state.eat(45))return state.lastIntValue=45,!0;if(!state.switchU&&state.eat(99)){if(this.regexp_eatClassControlLetter(state))return!0;state.pos=start2}return this.regexp_eatCharacterClassEscape(state)||this.regexp_eatCharacterEscape(state)},pp$12.regexp_classSetExpression=function(state){var result=CharSetOk2,subResult;if(!this.regexp_eatClassSetRange(state))if(subResult=this.regexp_eatClassSetOperand(state)){subResult===CharSetString2&&(result=CharSetString2);for(var start2=state.pos;state.eatChars([38,38]);){if(state.current()!==38&&(subResult=this.regexp_eatClassSetOperand(state))){subResult!==CharSetString2&&(result=CharSetOk2);continue}state.raise("Invalid character in character class")}if(start2!==state.pos)return result;for(;state.eatChars([45,45]);)this.regexp_eatClassSetOperand(state)||state.raise("Invalid character in character class");if(start2!==state.pos)return result}else state.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(state)){if(subResult=this.regexp_eatClassSetOperand(state),!subResult)return result;subResult===CharSetString2&&(result=CharSetString2)}},pp$12.regexp_eatClassSetRange=function(state){var start2=state.pos;if(this.regexp_eatClassSetCharacter(state)){var left=state.lastIntValue;if(state.eat(45)&&this.regexp_eatClassSetCharacter(state)){var right=state.lastIntValue;return left!==-1&&right!==-1&&left>right&&state.raise("Range out of order in character class"),!0}state.pos=start2}return!1},pp$12.regexp_eatClassSetOperand=function(state){return this.regexp_eatClassSetCharacter(state)?CharSetOk2:this.regexp_eatClassStringDisjunction(state)||this.regexp_eatNestedClass(state)},pp$12.regexp_eatNestedClass=function(state){var start2=state.pos;if(state.eat(91)){var negate=state.eat(94),result=this.regexp_classContents(state);if(state.eat(93))return negate&&result===CharSetString2&&state.raise("Negated character class may contain strings"),result;state.pos=start2}if(state.eat(92)){var result$1=this.regexp_eatCharacterClassEscape(state);if(result$1)return result$1;state.pos=start2}return null},pp$12.regexp_eatClassStringDisjunction=function(state){var start2=state.pos;if(state.eatChars([92,113])){if(state.eat(123)){var result=this.regexp_classStringDisjunctionContents(state);if(state.eat(125))return result}else state.raise("Invalid escape");state.pos=start2}return null},pp$12.regexp_classStringDisjunctionContents=function(state){for(var result=this.regexp_classString(state);state.eat(124);)this.regexp_classString(state)===CharSetString2&&(result=CharSetString2);return result},pp$12.regexp_classString=function(state){for(var count=0;this.regexp_eatClassSetCharacter(state);)count++;return count===1?CharSetOk2:CharSetString2},pp$12.regexp_eatClassSetCharacter=function(state){var start2=state.pos;if(state.eat(92))return this.regexp_eatCharacterEscape(state)||this.regexp_eatClassSetReservedPunctuator(state)?!0:state.eat(98)?(state.lastIntValue=8,!0):(state.pos=start2,!1);var ch=state.current();return ch<0||ch===state.lookahead()&&isClassSetReservedDoublePunctuatorCharacter2(ch)||isClassSetSyntaxCharacter2(ch)?!1:(state.advance(),state.lastIntValue=ch,!0)};function isClassSetReservedDoublePunctuatorCharacter2(ch){return ch===33||ch>=35&&ch<=38||ch>=42&&ch<=44||ch===46||ch>=58&&ch<=64||ch===94||ch===96||ch===126}function isClassSetSyntaxCharacter2(ch){return ch===40||ch===41||ch===45||ch===47||ch>=91&&ch<=93||ch>=123&&ch<=125}pp$12.regexp_eatClassSetReservedPunctuator=function(state){var ch=state.current();return isClassSetReservedPunctuator2(ch)?(state.lastIntValue=ch,state.advance(),!0):!1};function isClassSetReservedPunctuator2(ch){return ch===33||ch===35||ch===37||ch===38||ch===44||ch===45||ch>=58&&ch<=62||ch===64||ch===96||ch===126}pp$12.regexp_eatClassControlLetter=function(state){var ch=state.current();return isDecimalDigit2(ch)||ch===95?(state.lastIntValue=ch%32,state.advance(),!0):!1},pp$12.regexp_eatHexEscapeSequence=function(state){var start2=state.pos;if(state.eat(120)){if(this.regexp_eatFixedHexDigits(state,2))return!0;state.switchU&&state.raise("Invalid escape"),state.pos=start2}return!1},pp$12.regexp_eatDecimalDigits=function(state){var start2=state.pos,ch=0;for(state.lastIntValue=0;isDecimalDigit2(ch=state.current());)state.lastIntValue=10*state.lastIntValue+(ch-48),state.advance();return state.pos!==start2};function isDecimalDigit2(ch){return ch>=48&&ch<=57}pp$12.regexp_eatHexDigits=function(state){var start2=state.pos,ch=0;for(state.lastIntValue=0;isHexDigit2(ch=state.current());)state.lastIntValue=16*state.lastIntValue+hexToInt2(ch),state.advance();return state.pos!==start2};function isHexDigit2(ch){return ch>=48&&ch<=57||ch>=65&&ch<=70||ch>=97&&ch<=102}function hexToInt2(ch){return ch>=65&&ch<=70?10+(ch-65):ch>=97&&ch<=102?10+(ch-97):ch-48}pp$12.regexp_eatLegacyOctalEscapeSequence=function(state){if(this.regexp_eatOctalDigit(state)){var n1=state.lastIntValue;if(this.regexp_eatOctalDigit(state)){var n2=state.lastIntValue;n1<=3&&this.regexp_eatOctalDigit(state)?state.lastIntValue=n1*64+n2*8+state.lastIntValue:state.lastIntValue=n1*8+n2}else state.lastIntValue=n1;return!0}return!1},pp$12.regexp_eatOctalDigit=function(state){var ch=state.current();return isOctalDigit2(ch)?(state.lastIntValue=ch-48,state.advance(),!0):(state.lastIntValue=0,!1)};function isOctalDigit2(ch){return ch>=48&&ch<=55}pp$12.regexp_eatFixedHexDigits=function(state,length){var start2=state.pos;state.lastIntValue=0;for(var i2=0;i2<length;++i2){var ch=state.current();if(!isHexDigit2(ch))return state.pos=start2,!1;state.lastIntValue=16*state.lastIntValue+hexToInt2(ch),state.advance()}return!0};var Token3=function(p){this.type=p.type,this.value=p.value,this.start=p.start,this.end=p.end,p.options.locations&&(this.loc=new SourceLocation3(p,p.startLoc,p.endLoc)),p.options.ranges&&(this.range=[p.start,p.end])},pp2=Parser3.prototype;pp2.next=function(ignoreEscapeSequenceInKeyword){!ignoreEscapeSequenceInKeyword&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Token3(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},pp2.getToken=function(){return this.next(),new Token3(this)},typeof Symbol<"u"&&(pp2[Symbol.iterator]=function(){var this$1$1=this;return{next:function(){var token=this$1$1.getToken();return{done:token.type===types$12.eof,value:token}}}}),pp2.nextToken=function(){var curContext=this.curContext();if((!curContext||!curContext.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(types$12.eof);if(curContext.override)return curContext.override(this);this.readToken(this.fullCharCodeAtPos())},pp2.readToken=function(code2){return isIdentifierStart2(code2,this.options.ecmaVersion>=6)||code2===92?this.readWord():this.getTokenFromCode(code2)},pp2.fullCharCodeAtPos=function(){var code2=this.input.charCodeAt(this.pos);if(code2<=55295||code2>=56320)return code2;var next=this.input.charCodeAt(this.pos+1);return next<=56319||next>=57344?code2:(code2<<10)+next-56613888},pp2.skipBlockComment=function(){var startLoc=this.options.onComment&&this.curPosition(),start2=this.pos,end=this.input.indexOf("*/",this.pos+=2);if(end===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=end+2,this.options.locations)for(var nextBreak=void 0,pos=start2;(nextBreak=nextLineBreak2(this.input,pos,this.pos))>-1;)++this.curLine,pos=this.lineStart=nextBreak;this.options.onComment&&this.options.onComment(!0,this.input.slice(start2+2,end),start2,this.pos,startLoc,this.curPosition())},pp2.skipLineComment=function(startSkip){for(var start2=this.pos,startLoc=this.options.onComment&&this.curPosition(),ch=this.input.charCodeAt(this.pos+=startSkip);this.pos<this.input.length&&!isNewLine2(ch);)ch=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(start2+startSkip,this.pos),start2,this.pos,startLoc,this.curPosition())},pp2.skipSpace=function(){loop:for(;this.pos<this.input.length;){var ch=this.input.charCodeAt(this.pos);switch(ch){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(ch>8&&ch<14||ch>=5760&&nonASCIIwhitespace2.test(String.fromCharCode(ch)))++this.pos;else break loop}}},pp2.finishToken=function(type,val){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var prevType=this.type;this.type=type,this.value=val,this.updateContext(prevType)},pp2.readToken_dot=function(){var next=this.input.charCodeAt(this.pos+1);if(next>=48&&next<=57)return this.readNumber(!0);var next2=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&next===46&&next2===46?(this.pos+=3,this.finishToken(types$12.ellipsis)):(++this.pos,this.finishToken(types$12.dot))},pp2.readToken_slash=function(){var next=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):next===61?this.finishOp(types$12.assign,2):this.finishOp(types$12.slash,1)},pp2.readToken_mult_modulo_exp=function(code2){var next=this.input.charCodeAt(this.pos+1),size=1,tokentype=code2===42?types$12.star:types$12.modulo;return this.options.ecmaVersion>=7&&code2===42&&next===42&&(++size,tokentype=types$12.starstar,next=this.input.charCodeAt(this.pos+2)),next===61?this.finishOp(types$12.assign,size+1):this.finishOp(tokentype,size)},pp2.readToken_pipe_amp=function(code2){var next=this.input.charCodeAt(this.pos+1);if(next===code2){if(this.options.ecmaVersion>=12){var next2=this.input.charCodeAt(this.pos+2);if(next2===61)return this.finishOp(types$12.assign,3)}return this.finishOp(code2===124?types$12.logicalOR:types$12.logicalAND,2)}return next===61?this.finishOp(types$12.assign,2):this.finishOp(code2===124?types$12.bitwiseOR:types$12.bitwiseAND,1)},pp2.readToken_caret=function(){var next=this.input.charCodeAt(this.pos+1);return next===61?this.finishOp(types$12.assign,2):this.finishOp(types$12.bitwiseXOR,1)},pp2.readToken_plus_min=function(code2){var next=this.input.charCodeAt(this.pos+1);return next===code2?next===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||lineBreak2.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(types$12.incDec,2):next===61?this.finishOp(types$12.assign,2):this.finishOp(types$12.plusMin,1)},pp2.readToken_lt_gt=function(code2){var next=this.input.charCodeAt(this.pos+1),size=1;return next===code2?(size=code2===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+size)===61?this.finishOp(types$12.assign,size+1):this.finishOp(types$12.bitShift,size)):next===33&&code2===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(next===61&&(size=2),this.finishOp(types$12.relational,size))},pp2.readToken_eq_excl=function(code2){var next=this.input.charCodeAt(this.pos+1);return next===61?this.finishOp(types$12.equality,this.input.charCodeAt(this.pos+2)===61?3:2):code2===61&&next===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(types$12.arrow)):this.finishOp(code2===61?types$12.eq:types$12.prefix,1)},pp2.readToken_question=function(){var ecmaVersion2=this.options.ecmaVersion;if(ecmaVersion2>=11){var next=this.input.charCodeAt(this.pos+1);if(next===46){var next2=this.input.charCodeAt(this.pos+2);if(next2<48||next2>57)return this.finishOp(types$12.questionDot,2)}if(next===63){if(ecmaVersion2>=12){var next2$1=this.input.charCodeAt(this.pos+2);if(next2$1===61)return this.finishOp(types$12.assign,3)}return this.finishOp(types$12.coalesce,2)}}return this.finishOp(types$12.question,1)},pp2.readToken_numberSign=function(){var ecmaVersion2=this.options.ecmaVersion,code2=35;if(ecmaVersion2>=13&&(++this.pos,code2=this.fullCharCodeAtPos(),isIdentifierStart2(code2,!0)||code2===92))return this.finishToken(types$12.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+codePointToString2(code2)+"'")},pp2.getTokenFromCode=function(code2){switch(code2){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(types$12.parenL);case 41:return++this.pos,this.finishToken(types$12.parenR);case 59:return++this.pos,this.finishToken(types$12.semi);case 44:return++this.pos,this.finishToken(types$12.comma);case 91:return++this.pos,this.finishToken(types$12.bracketL);case 93:return++this.pos,this.finishToken(types$12.bracketR);case 123:return++this.pos,this.finishToken(types$12.braceL);case 125:return++this.pos,this.finishToken(types$12.braceR);case 58:return++this.pos,this.finishToken(types$12.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(types$12.backQuote);case 48:var next=this.input.charCodeAt(this.pos+1);if(next===120||next===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(next===111||next===79)return this.readRadixNumber(8);if(next===98||next===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(code2);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(code2);case 124:case 38:return this.readToken_pipe_amp(code2);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(code2);case 60:case 62:return this.readToken_lt_gt(code2);case 61:case 33:return this.readToken_eq_excl(code2);case 63:return this.readToken_question();case 126:return this.finishOp(types$12.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+codePointToString2(code2)+"'")},pp2.finishOp=function(type,size){var str=this.input.slice(this.pos,this.pos+size);return this.pos+=size,this.finishToken(type,str)},pp2.readRegexp=function(){for(var escaped,inClass,start2=this.pos;;){this.pos>=this.input.length&&this.raise(start2,"Unterminated regular expression");var ch=this.input.charAt(this.pos);if(lineBreak2.test(ch)&&this.raise(start2,"Unterminated regular expression"),escaped)escaped=!1;else{if(ch==="[")inClass=!0;else if(ch==="]"&&inClass)inClass=!1;else if(ch==="/"&&!inClass)break;escaped=ch==="\\"}++this.pos}var pattern=this.input.slice(start2,this.pos);++this.pos;var flagsStart=this.pos,flags=this.readWord1();this.containsEsc&&this.unexpected(flagsStart);var state=this.regexpState||(this.regexpState=new RegExpValidationState3(this));state.reset(start2,pattern,flags),this.validateRegExpFlags(state),this.validateRegExpPattern(state);var value=null;try{value=new RegExp(pattern,flags)}catch{}return this.finishToken(types$12.regexp,{pattern,flags,value})},pp2.readInt=function(radix,len,maybeLegacyOctalNumericLiteral){for(var allowSeparators=this.options.ecmaVersion>=12&&len===void 0,isLegacyOctalNumericLiteral=maybeLegacyOctalNumericLiteral&&this.input.charCodeAt(this.pos)===48,start2=this.pos,total=0,lastCode=0,i2=0,e=len??1/0;i2<e;++i2,++this.pos){var code2=this.input.charCodeAt(this.pos),val=void 0;if(allowSeparators&&code2===95){isLegacyOctalNumericLiteral&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),lastCode===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),i2===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),lastCode=code2;continue}if(code2>=97?val=code2-97+10:code2>=65?val=code2-65+10:code2>=48&&code2<=57?val=code2-48:val=1/0,val>=radix)break;lastCode=code2,total=total*radix+val}return allowSeparators&&lastCode===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===start2||len!=null&&this.pos-start2!==len?null:total};function stringToNumber2(str,isLegacyOctalNumericLiteral){return isLegacyOctalNumericLiteral?parseInt(str,8):parseFloat(str.replace(/_/g,""))}function stringToBigInt2(str){return typeof BigInt!="function"?null:BigInt(str.replace(/_/g,""))}pp2.readRadixNumber=function(radix){var start2=this.pos;this.pos+=2;var val=this.readInt(radix);return val==null&&this.raise(this.start+2,"Expected number in radix "+radix),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(val=stringToBigInt2(this.input.slice(start2,this.pos)),++this.pos):isIdentifierStart2(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types$12.num,val)},pp2.readNumber=function(startsWithDot){var start2=this.pos;!startsWithDot&&this.readInt(10,void 0,!0)===null&&this.raise(start2,"Invalid number");var octal=this.pos-start2>=2&&this.input.charCodeAt(start2)===48;octal&&this.strict&&this.raise(start2,"Invalid number");var next=this.input.charCodeAt(this.pos);if(!octal&&!startsWithDot&&this.options.ecmaVersion>=11&&next===110){var val$1=stringToBigInt2(this.input.slice(start2,this.pos));return++this.pos,isIdentifierStart2(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types$12.num,val$1)}octal&&/[89]/.test(this.input.slice(start2,this.pos))&&(octal=!1),next===46&&!octal&&(++this.pos,this.readInt(10),next=this.input.charCodeAt(this.pos)),(next===69||next===101)&&!octal&&(next=this.input.charCodeAt(++this.pos),(next===43||next===45)&&++this.pos,this.readInt(10)===null&&this.raise(start2,"Invalid number")),isIdentifierStart2(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var val=stringToNumber2(this.input.slice(start2,this.pos),octal);return this.finishToken(types$12.num,val)},pp2.readCodePoint=function(){var ch=this.input.charCodeAt(this.pos),code2;if(ch===123){this.options.ecmaVersion<6&&this.unexpected();var codePos=++this.pos;code2=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,code2>1114111&&this.invalidStringToken(codePos,"Code point out of bounds")}else code2=this.readHexChar(4);return code2},pp2.readString=function(quote){for(var out="",chunkStart=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var ch=this.input.charCodeAt(this.pos);if(ch===quote)break;ch===92?(out+=this.input.slice(chunkStart,this.pos),out+=this.readEscapedChar(!1),chunkStart=this.pos):ch===8232||ch===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(isNewLine2(ch)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return out+=this.input.slice(chunkStart,this.pos++),this.finishToken(types$12.string,out)};var INVALID_TEMPLATE_ESCAPE_ERROR2={};pp2.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(err){if(err===INVALID_TEMPLATE_ESCAPE_ERROR2)this.readInvalidTemplateToken();else throw err}this.inTemplateElement=!1},pp2.invalidStringToken=function(position2,message){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw INVALID_TEMPLATE_ESCAPE_ERROR2;this.raise(position2,message)},pp2.readTmplToken=function(){for(var out="",chunkStart=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var ch=this.input.charCodeAt(this.pos);if(ch===96||ch===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===types$12.template||this.type===types$12.invalidTemplate)?ch===36?(this.pos+=2,this.finishToken(types$12.dollarBraceL)):(++this.pos,this.finishToken(types$12.backQuote)):(out+=this.input.slice(chunkStart,this.pos),this.finishToken(types$12.template,out));if(ch===92)out+=this.input.slice(chunkStart,this.pos),out+=this.readEscapedChar(!0),chunkStart=this.pos;else if(isNewLine2(ch)){switch(out+=this.input.slice(chunkStart,this.pos),++this.pos,ch){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:out+=`
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var migrate_to_test_package_exports={};__export(migrate_to_test_package_exports,{default:()=>transform,parser:()=>parser});module.exports=__toCommonJS(migrate_to_test_package_exports);var import_csf_tools=require("@storybook/core/csf-tools"),babel=__toESM(require("@babel/core")),t=__toESM(require("@babel/types")),import_prettier=__toESM(require("prettier"));async function transform(info){let csf=(0,import_csf_tools.loadCsf)(info.source,{makeTitle:title=>title}),fileNode=csf._ast;new babel.File({filename:info.path},{code:info.source,ast:fileNode}).path.traverse({ImportDeclaration:path=>{(path.node.source.value==="@storybook/jest"||path.node.source.value==="@storybook/testing-library")&&(path.node.source.value==="@storybook/jest"&&path.get("specifiers").forEach(specifier=>{if(specifier.isImportSpecifier()){let imported=specifier.get("imported");if(!imported.isIdentifier())return;imported.node.name==="jest"&&(specifier.remove(),path.insertAfter(t.importDeclaration([t.importNamespaceSpecifier(t.identifier("test"))],t.stringLiteral("@storybook/test"))))}}),path.get("source").replaceWith(t.stringLiteral("@storybook/test")))},Identifier:path=>{path.node.name==="jest"&&path.replaceWith(t.identifier("test"))}});let output=(0,import_csf_tools.printCsf)(csf).code;try{output=await import_prettier.default.format(output,{...await import_prettier.default.resolveConfig(info.path),filepath:info.path})}catch{console.warn(`Failed applying prettier to ${info.path}.`)}return output}var parser="tsx";0&&(module.exports={parser});
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var move_builtin_addons_exports={};__export(move_builtin_addons_exports,{default:()=>transformer});module.exports=__toCommonJS(move_builtin_addons_exports);function transformer(file,api){let j=api.jscodeshift,createImportDeclaration=(specifiers,source)=>j.importDeclaration(specifiers.map(s=>j.importSpecifier(j.identifier(s))),j.literal(source)),deprecates={action:[["action"],"@storybook/addon-actions"],linkTo:[["linkTo"],"@storybook/addon-links"]};return j(file.source).find(j.ImportDeclaration).filter(i=>i.value.source.value==="@storybook/react").forEach(i=>{let importStatement=i.value;importStatement.specifiers=importStatement.specifiers.filter(specifier=>{let item=deprecates[specifier.local.name];if(item){let[specifiers,moduleName]=item;return i.insertAfter(createImportDeclaration(specifiers,moduleName)),!1}return specifier})}).toSource({quote:"single"})}
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var storiesof_to_csf_exports={};__export(storiesof_to_csf_exports,{default:()=>transformer});module.exports=__toCommonJS(storiesof_to_csf_exports);var import_prettier=__toESM(require("prettier")),import_node_logger=require("@storybook/core/node-logger"),import_csf=require("@storybook/csf");var import_camelCase=__toESM(require("lodash/camelCase.js")),import_upperFirst=__toESM(require("lodash/upperFirst.js")),sanitizeName=name=>{let key=(0,import_upperFirst.default)((0,import_camelCase.default)(name));return/^\d/.test(key)&&(key=`_${key}`),/^\d/.test(key)&&(key=`_${key}`),key};function jscodeshiftToPrettierParser(parser){let parserMap={babylon:"babel",flow:"flow",ts:"typescript",tsx:"typescript"};return parser&&parserMap[parser]||"babel"}async function transformer(file,api,options){let LITERAL=["ts","tsx"].includes(options.parser)?"StringLiteral":"Literal",j=api.jscodeshift,root=j(file.source);function extractDecorators(parameters){if(!parameters)return{};if(!parameters.properties)return{storyParams:parameters};let storyDecorators=parameters.properties.find(p=>p.key.name==="decorators");if(!storyDecorators)return{storyParams:parameters};storyDecorators=storyDecorators.value;let storyParams={...parameters};return storyParams.properties=storyParams.properties.filter(p=>p.key.name!=="decorators"),storyParams.properties.length===0?{storyDecorators}:{storyParams,storyDecorators}}function convertToModuleExports(path,originalExports2){let base=j(path),statements=[],extraExports=[],decorators=[];base.find(j.CallExpression).filter(call=>call.node.callee.property&&call.node.callee.property.name==="addDecorator").forEach(add=>{let decorator=add.node.arguments[0];decorators.push(decorator)}),decorators.length>0&&(decorators.reverse(),extraExports.push(j.property("init",j.identifier("decorators"),j.arrayExpression(decorators))));let parameters=[];base.find(j.CallExpression).filter(call=>call.node.callee.property&&call.node.callee.property.name==="addParameters").forEach(add=>{let params=[...add.node.arguments[0].properties];params.reverse(),params.forEach(prop=>parameters.push(prop))}),parameters.length>0&&(parameters.reverse(),extraExports.push(j.property("init",j.identifier("parameters"),j.objectExpression(parameters)))),originalExports2.length>0&&extraExports.push(j.property("init",j.identifier("excludeStories"),j.arrayExpression(originalExports2.map(exp=>j.literal(exp))))),base.find(j.CallExpression).filter(call=>call.node.callee.name==="storiesOf").filter(call=>call.node.arguments.length>0&&call.node.arguments[0].type===LITERAL).forEach(storiesOf=>{let title=storiesOf.node.arguments[0].value;statements.push(j.exportDefaultDeclaration(j.objectExpression([j.property("init",j.identifier("title"),j.literal(title)),...extraExports])))});let adds=[];base.find(j.CallExpression).filter(add=>add.node.callee.property&&add.node.callee.property.name==="add").filter(add=>add.node.arguments.length>=2&&add.node.arguments[0].type===LITERAL).forEach(add=>adds.push(add)),adds.reverse(),adds.push(path);let identifiers=new Set;root.find(j.Identifier).forEach(({value})=>identifiers.add(value.name)),adds.forEach(add=>{let name=add.node.arguments[0].value,key=sanitizeName(name);for(;identifiers.has(key);)key=`_${key}`;identifiers.add(key),(0,import_csf.storyNameFromExport)(key)===name&&(name=null);let val=add.node.arguments[1];statements.push(j.exportDeclaration(!1,j.variableDeclaration("const",[j.variableDeclarator(j.identifier(key),val)])));let storyAnnotations=[];if(name&&storyAnnotations.push(j.property("init",j.identifier("name"),j.literal(name))),add.node.arguments.length>2){let originalStoryParams=add.node.arguments[2],{storyParams,storyDecorators}=extractDecorators(originalStoryParams);storyParams&&storyAnnotations.push(j.property("init",j.identifier("parameters"),storyParams)),storyDecorators&&storyAnnotations.push(j.property("init",j.identifier("decorators"),storyDecorators))}storyAnnotations.length>0&&statements.push(j.assignmentStatement("=",j.memberExpression(j.identifier(key),j.identifier("story")),j.objectExpression(storyAnnotations)))});let stmt=path.parent.node.type==="VariableDeclarator"?path.parent.parent:path.parent;statements.reverse(),statements.forEach(s=>stmt.insertAfter(s)),j(stmt).remove()}let initialStoriesOf=root.find(j.CallExpression).filter(call=>call.node.callee.name==="storiesOf");if(root.find(j.ExportDefaultDeclaration).size()>0)return initialStoriesOf.size()>0&&import_node_logger.logger.warn(`Found ${initialStoriesOf.size()} 'storiesOf' calls but existing default export, SKIPPING: '${file.path}'`),root.toSource();let originalExports=[];root.find(j.ExportNamedDeclaration).forEach(exp=>{let{declaration,specifiers}=exp.node;if(declaration){let{id,declarations}=declaration;declarations?declarations.forEach(decl=>{let{name,properties}=decl.id;name?originalExports.push(name):properties&&properties.forEach(prop=>originalExports.push(prop.key.name))}):id&&originalExports.push(id.name)}else specifiers&&specifiers.forEach(spec=>originalExports.push(spec.exported.name))}),root.find(j.CallExpression).filter(add=>add.node.callee.property&&add.node.callee.property.name==="add").filter(add=>add.node.arguments.length>=2&&add.node.arguments[0].type===LITERAL).filter(add=>["ExpressionStatement","VariableDeclarator"].includes(add.parentPath.node.type)).forEach(path=>convertToModuleExports(path,originalExports)),root.find(j.ImportSpecifier).filter(spec=>spec.node.imported.name==="storiesOf"&&spec.parent.node.source.value.startsWith("@storybook/")).forEach(spec=>{let toRemove=spec.parent.node.specifiers.length>1?spec:spec.parent;j(toRemove).remove()});let source=root.toSource({trailingComma:!0,quote:"single",tabWidth:2});if(initialStoriesOf.size()>1)return import_node_logger.logger.warn(`Found ${initialStoriesOf.size()} 'storiesOf' calls, PLEASE FIX BY HAND: '${file.path}'`),source;let output=source;try{let prettierConfig=await import_prettier.default.resolveConfig(file.path);output=import_prettier.default.format(source,{...prettierConfig,parser:jscodeshiftToPrettierParser(options.parser)})}catch{import_node_logger.logger.warn(`Failed to format ${file.path} with prettier`)}return output}
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var update_addon_info_exports={};__export(update_addon_info_exports,{default:()=>transformer});module.exports=__toCommonJS(update_addon_info_exports);function transformer(file,api){let j=api.jscodeshift,root=j(file.source),getOptions=args=>args[3]===void 0?args[2]===void 0?[args[0]]:[args[1]]:[j.objectExpression([j.property("init",j.identifier("text"),args[1]),...args[3].properties])],withInfo=addWithInfoExpression=>{let{node}=addWithInfoExpression,args=node.arguments,storyComponent=args[2]?args[2]:args[1];return node.callee.property.name="add",node.arguments=[args[0],j.callExpression(j.callExpression(j.identifier("withInfo"),getOptions(args)),[storyComponent])],node},checkWithInfoImport=()=>{root.find(j.ImportDeclaration).filter(imp=>imp.node.source.value==="@storybook/addon-info").size()||root.find(j.ImportDeclaration).at(-1).insertAfter(j.importDeclaration([j.importSpecifier(j.identifier("withInfo"))],j.literal("@storybook/addon-info")))},addWithInfoExpressions=root.find(j.CallExpression,{callee:{property:{name:"addWithInfo"}}});return addWithInfoExpressions.size()&&(checkWithInfoImport(),addWithInfoExpressions.replaceWith(withInfo)),root.toSource()}
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var update_organisation_name_exports={};__export(update_organisation_name_exports,{default:()=>transformer,packageNames:()=>packageNames});module.exports=__toCommonJS(update_organisation_name_exports);var packageNames={"@kadira/react-storybook-decorator-centered":"@storybook/addon-centered","@kadira/storybook-addons":"storybook/internal/preview-api","@kadira/storybook-addon-actions":"@storybook/addon-actions","@kadira/storybook-addon-comments":"@storybook/addon-comments","@kadira/storybook-addon-graphql":"@storybook/addon-graphql","@kadira/storybook-addon-info":"@storybook/addon-info","@kadira/storybook-addon-knobs":"@storybook/addon-knobs","@kadira/storybook-addon-links":"@storybook/addon-links","@kadira/storybook-addon-notes":"@storybook/addon-notes","@kadira/storybook-addon-options":"@storybook/addon-options","@kadira/storybook-channels":"storybook/internal/channels","@kadira/storybook-channel-postmsg":"@storybook/channel-postmessage","@kadira/storybook-channel-websocket":"@storybook/channel-websocket","@kadira/storybook-ui":"storybook/internal/manager","@kadira/react-native-storybook":"@storybook/react-native","@kadira/react-storybook":"@storybook/react","@kadira/getstorybook":"storybook","@kadira/storybook":"@storybook/react",storyshots:"@storybook/addon-storyshots",getstorybook:"storybook"};function transformer(file,api){let j=api.jscodeshift,packageNamesKeys=Object.keys(packageNames),getMatch=oldpart=>packageNamesKeys.find(newpart=>oldpart.match(newpart)),getNewPackageName=oldPackageName=>{let match=getMatch(oldPackageName);if(match){let replacement=packageNames[match];return oldPackageName.replace(match,replacement)}return oldPackageName},updatePackageName=declaration=>(declaration.node.source.value=getNewPackageName(declaration.node.source.value),declaration.node);return j(file.source).find(j.ImportDeclaration).replaceWith(updatePackageName).toSource({quote:"single"})}0&&(module.exports={packageNames});
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var upgrade_deprecated_types_exports={};__export(upgrade_deprecated_types_exports,{default:()=>transform,parser:()=>parser,upgradeDeprecatedTypes:()=>upgradeDeprecatedTypes});module.exports=__toCommonJS(upgrade_deprecated_types_exports);var import_prettier=__toESM(require("prettier")),babel=__toESM(require("@babel/core")),import_csf_tools=require("@storybook/core/csf-tools"),t=__toESM(require("@babel/types")),logger=console,deprecatedTypes=["ComponentStory","ComponentStoryFn","ComponentStoryObj","ComponentMeta","Story"];function migrateType(oldType){return oldType==="Story"||oldType==="ComponentStory"?"StoryFn":oldType.replace("Component","")}async function transform(info,api,options){let csf=(0,import_csf_tools.loadCsf)(info.source,{makeTitle:title=>title}),fileNode=csf._ast,file=new babel.File({filename:info.path},{code:info.source,ast:fileNode});upgradeDeprecatedTypes(file);let output=(0,import_csf_tools.printCsf)(csf).code;try{output=await import_prettier.default.format(output,{...await import_prettier.default.resolveConfig(info.path),filepath:info.path})}catch{logger.log(`Failed applying prettier to ${info.path}.`)}return output}var parser="tsx";function upgradeDeprecatedTypes(file){let importedNamespaces=new Set,typeReferencesToUpdate=new Set,existingImports=[];file.path.traverse({ImportDeclaration:path=>{existingImports.push(...path.get("specifiers").map(specifier=>({name:specifier.node.local.name,isAlias:!(specifier.isImportSpecifier()&&t.isIdentifier(specifier.node.imported)&&specifier.node.local.name===specifier.node.imported.name),path:specifier}))),path.node.source.value.startsWith("@storybook")&&path.get("specifiers").forEach(specifier=>{if(specifier.isImportNamespaceSpecifier()&&importedNamespaces.add(specifier.node.local.name),!specifier.isImportSpecifier())return;let imported=specifier.get("imported");if(imported.isIdentifier()&&deprecatedTypes.includes(imported.node.name)){imported.node.name===specifier.node.local.name&&typeReferencesToUpdate.add(specifier.node.local.name);let newType=migrateType(imported.node.name);if(!existingImports.some(it=>it.name===newType))imported.replaceWith(t.identifier(newType)),existingImports.push({name:newType,isAlias:!1,path:specifier});else{let existingImport=existingImports.find(it=>it.name===newType&&it.isAlias);if(existingImport)throw existingImport.path.buildCodeFrameError(`This codemod does not support local imports that are called the same as a storybook import.
|
2
2
|
Rename this local import and try again.`);specifier.remove()}}})}}),file.path.traverse({TSTypeReference:path=>{let typeName=path.get("typeName");if(typeName.isIdentifier())typeReferencesToUpdate.has(typeName.node.name)&&typeName.replaceWith(t.identifier(migrateType(typeName.node.name)));else if(typeName.isTSQualifiedName()){let namespace=typeName.get("left");if(namespace.isIdentifier()&&importedNamespaces.has(namespace.node.name)){let right=typeName.get("right");deprecatedTypes.includes(right.node.name)&&right.replaceWith(t.identifier(migrateType(right.node.name)))}}}})}0&&(module.exports={parser,upgradeDeprecatedTypes});
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var upgrade_hierarchy_separators_exports={};__export(upgrade_hierarchy_separators_exports,{default:()=>transformer});module.exports=__toCommonJS(upgrade_hierarchy_separators_exports);function upgradeSeparator(path){return path.replace(/[|.]/g,"/")}function transformer(file,api,options){let j=api.jscodeshift,root=j(file.source);return root.find(j.CallExpression).filter(call=>call.node.callee.name==="storiesOf").filter(call=>call.node.arguments.length>0&&["Literal","StringLiteral"].includes(call.node.arguments[0].type)).forEach(call=>{let arg0=call.node.arguments[0];arg0.value=upgradeSeparator(arg0.value)}),root.find(j.ExportDefaultDeclaration).filter(def=>def.node.declaration.properties.map(p=>p.key.name).includes("title")).forEach(def=>{def.node.declaration&&def.node.declaration.properties&&def.node.declaration.properties.forEach(p=>{p.key.name==="title"&&(p.value.value=upgradeSeparator(p.value.value))})}),root.toSource({quote:"single"})}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/codemod",
|
3
|
-
"version": "0.0.0-pr-
|
3
|
+
"version": "0.0.0-pr-28519-sha-c31b2497",
|
4
4
|
"description": "A collection of codemod scripts written with JSCodeshift",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -57,7 +57,7 @@
|
|
57
57
|
"@babel/core": "^7.24.4",
|
58
58
|
"@babel/preset-env": "^7.24.4",
|
59
59
|
"@babel/types": "^7.24.0",
|
60
|
-
"@storybook/core": "0.0.0-pr-
|
60
|
+
"@storybook/core": "0.0.0-pr-28519-sha-c31b2497",
|
61
61
|
"@storybook/csf": "0.1.11",
|
62
62
|
"@types/cross-spawn": "^6.0.2",
|
63
63
|
"cross-spawn": "^7.0.3",
|