= `${Obj}.${Prop}`;\n\n// split \"body.body.1\" to [\"body\", \"body\", 1]\ntype Split =\n P extends Pattern\n ? [MaybeToIndex, ...Split]\n : [MaybeToIndex];\n\n// traverse the Node with tuple path [\"body\", \"body\", 1]\n// Path should be created with Split\ntype Trav<\n Node extends t.Node | t.Node[],\n Path extends unknown[],\n> = Path extends [infer K, ...infer R]\n ? K extends keyof Node\n ? Node[K] extends t.Node | t.Node[]\n ? R extends []\n ? Node[K]\n : Trav\n : never\n : never\n : never;\n\ntype ToNodePath =\n T extends Array\n ? Array>\n : T extends t.Node | null | undefined\n ? NodePath\n : never;\n\nfunction get(\n this: T,\n key: K,\n context?: boolean | TraversalContext,\n): T extends any\n ? T[\"node\"][K] extends Array\n ? Array>\n : T[\"node\"][K] extends t.Node | null | undefined\n ? NodePath\n : never\n : never;\n\nfunction get(\n this: T,\n key: K,\n context?: boolean | TraversalContext,\n): T extends any ? ToNodePath>> : never;\n\nfunction get(\n this: NodePath,\n key: string,\n context?: true | TraversalContext,\n): NodePath | NodePath[];\n\nfunction get(\n this: NodePath,\n key: string,\n context: true | TraversalContext = true,\n): NodePath | NodePath[] {\n if (context === true) context = this.context;\n const parts = key.split(\".\");\n if (parts.length === 1) {\n // \"foo\"\n // @ts-expect-error key may not index T\n return _getKey.call(this, key, context);\n } else {\n // \"foo.bar\"\n return _getPattern.call(this, parts, context);\n }\n}\n\nexport { get };\n\nexport function _getKey(\n this: NodePath,\n key: keyof T & string,\n context?: TraversalContext,\n): NodePath | NodePath[] {\n const node = this.node as T;\n const container = node[key];\n\n if (Array.isArray(container)) {\n // requested a container so give them all the paths\n return container.map((_, i) => {\n return NodePath.get({\n listKey: key,\n parentPath: this,\n parent: node,\n container: container,\n key: i,\n }).setContext(context);\n });\n } else {\n return NodePath.get({\n parentPath: this,\n parent: node,\n container: node,\n key: key,\n }).setContext(context);\n }\n}\n\nexport function _getPattern(\n this: NodePath,\n parts: string[],\n context?: TraversalContext,\n): NodePath | NodePath[] {\n let path: NodePath | NodePath[] = this;\n for (const part of parts) {\n if (part === \".\") {\n // @ts-expect-error todo(flow-ts): Can path be an array here?\n path = path.parentPath;\n } else {\n if (Array.isArray(path)) {\n // @ts-expect-error part may not index path\n path = path[part];\n } else {\n path = path.get(part, context);\n }\n }\n }\n return path;\n}\n\nexport function getAssignmentIdentifiers(this: NodePath) {\n return _getAssignmentIdentifiers(this.node);\n}\n\nfunction getBindingIdentifiers(\n duplicates: true,\n): Record;\nfunction getBindingIdentifiers(\n duplicates?: false,\n): Record;\nfunction getBindingIdentifiers(\n duplicates: boolean,\n): Record;\n\nfunction getBindingIdentifiers(\n this: NodePath,\n duplicates?: boolean,\n): Record {\n return _getBindingIdentifiers(this.node, duplicates);\n}\n\nexport { getBindingIdentifiers };\n\nfunction getOuterBindingIdentifiers(\n duplicates: true,\n): Record;\nfunction getOuterBindingIdentifiers(\n duplicates?: false,\n): Record;\nfunction getOuterBindingIdentifiers(\n duplicates: boolean,\n): Record;\n\nfunction getOuterBindingIdentifiers(\n this: NodePath,\n duplicates?: boolean,\n): Record {\n return _getOuterBindingIdentifiers(this.node, duplicates);\n}\n\nexport { getOuterBindingIdentifiers };\n\nfunction getBindingIdentifierPaths(\n duplicates: true,\n outerOnly?: boolean,\n): Record[]>;\nfunction getBindingIdentifierPaths(\n duplicates: false,\n outerOnly?: boolean,\n): Record>;\nfunction getBindingIdentifierPaths(\n duplicates?: boolean,\n outerOnly?: boolean,\n): Record | NodePath[]>;\n\n// original source - https://github.com/babel/babel/blob/main/packages/babel-types/src/retrievers/getBindingIdentifiers.js\n// path.getBindingIdentifiers returns nodes where the following re-implementation returns paths\nfunction getBindingIdentifierPaths(\n this: NodePath,\n duplicates: boolean = false,\n outerOnly: boolean = false,\n): Record | NodePath[]> {\n const path = this;\n const search = [path];\n const ids = Object.create(null);\n\n while (search.length) {\n const id = search.shift();\n if (!id) continue;\n if (!id.node) continue;\n\n const keys = _getBindingIdentifiers.keys[id.node.type];\n\n if (id.isIdentifier()) {\n if (duplicates) {\n const _ids = (ids[id.node.name] = ids[id.node.name] || []);\n _ids.push(id);\n } else {\n ids[id.node.name] = id;\n }\n continue;\n }\n\n if (id.isExportDeclaration()) {\n const declaration = id.get(\"declaration\");\n if (declaration.isDeclaration()) {\n search.push(declaration);\n }\n continue;\n }\n\n if (outerOnly) {\n if (id.isFunctionDeclaration()) {\n search.push(id.get(\"id\"));\n continue;\n }\n if (id.isFunctionExpression()) {\n continue;\n }\n }\n\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const child = id.get(key);\n if (Array.isArray(child)) {\n search.push(...child);\n } else if (child.node) {\n search.push(child);\n }\n }\n }\n }\n\n return ids;\n}\n\nexport { getBindingIdentifierPaths };\n\nfunction getOuterBindingIdentifierPaths(\n duplicates: true,\n): Record[]>;\nfunction getOuterBindingIdentifierPaths(\n duplicates?: false,\n): Record>;\nfunction getOuterBindingIdentifierPaths(\n duplicates?: boolean,\n): Record | NodePath[]>;\n\nfunction getOuterBindingIdentifierPaths(\n this: NodePath,\n duplicates: boolean = false,\n) {\n return this.getBindingIdentifierPaths(duplicates, true);\n}\n\nexport { getOuterBindingIdentifierPaths };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,EAAA,GAAAD,OAAA;AAMsB;EALpBE,wBAAwB,EAAIC,yBAAyB;EACrDC,qBAAqB,EAAIC,sBAAsB;EAC/CC,0BAA0B,EAAIC,2BAA2B;EACzDC,cAAc;EACdC;AAAe,IAAAR,EAAA;AAIjB,MAAMS,iBAAiB,GAAG,CAAC;AAC3B,MAAMC,gBAAgB,GAAG,CAAC;AAqB1B,SAASC,gBAAgBA,CAACC,IAAc,EAAc;EACpD,OAAO;IAAEC,IAAI,EAAEJ,iBAAiB;IAAEG;EAAK,CAAC;AAC1C;AAEA,SAASE,eAAeA,CAACF,IAAc,EAAc;EACnD,OAAO;IAAEC,IAAI,EAAEH,gBAAgB;IAAEE;EA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AAC;QACpB;MACF;IACF;EACF;EAEA,OAAOZ,GAAG;AACZ;AAcA,SAASa,8BAA8BA,CAErCjB,UAAmB,GAAG,KAAK,EAC3B;EACA,OAAO,IAAI,CAACC,yBAAyB,CAACD,UAAU,EAAE,IAAI,CAAC;AACzD","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/traverse/lib/path/index.js b/node_modules/@babel/traverse/lib/path/index.js
new file mode 100644
index 00000000..589805ef
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/index.js
@@ -0,0 +1,293 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = exports.SHOULD_STOP = exports.SHOULD_SKIP = exports.REMOVED = void 0;
+var virtualTypes = require("./lib/virtual-types.js");
+var _debug = require("debug");
+var _index = require("../index.js");
+var _index2 = require("../scope/index.js");
+var _t = require("@babel/types");
+var t = _t;
+var cache = require("../cache.js");
+var _generator = require("@babel/generator");
+var NodePath_ancestry = require("./ancestry.js");
+var NodePath_inference = require("./inference/index.js");
+var NodePath_replacement = require("./replacement.js");
+var NodePath_evaluation = require("./evaluation.js");
+var NodePath_conversion = require("./conversion.js");
+var NodePath_introspection = require("./introspection.js");
+var _context = require("./context.js");
+var NodePath_context = _context;
+var NodePath_removal = require("./removal.js");
+var NodePath_modification = require("./modification.js");
+var NodePath_family = require("./family.js");
+var NodePath_comments = require("./comments.js");
+var NodePath_virtual_types_validator = require("./lib/virtual-types-validator.js");
+const {
+ validate
+} = _t;
+const debug = _debug("babel");
+const REMOVED = exports.REMOVED = 1 << 0;
+const SHOULD_STOP = exports.SHOULD_STOP = 1 << 1;
+const SHOULD_SKIP = exports.SHOULD_SKIP = 1 << 2;
+const NodePath_Final = exports.default = class NodePath {
+ constructor(hub, parent) {
+ this.contexts = [];
+ this.state = null;
+ this.opts = null;
+ this._traverseFlags = 0;
+ this.skipKeys = null;
+ this.parentPath = null;
+ this.container = null;
+ this.listKey = null;
+ this.key = null;
+ this.node = null;
+ this.type = null;
+ this._store = null;
+ this.parent = parent;
+ this.hub = hub;
+ this.data = null;
+ this.context = null;
+ this.scope = null;
+ }
+ get removed() {
+ return (this._traverseFlags & 1) > 0;
+ }
+ set removed(v) {
+ if (v) this._traverseFlags |= 1;else this._traverseFlags &= -2;
+ }
+ get shouldStop() {
+ return (this._traverseFlags & 2) > 0;
+ }
+ set shouldStop(v) {
+ if (v) this._traverseFlags |= 2;else this._traverseFlags &= -3;
+ }
+ get shouldSkip() {
+ return (this._traverseFlags & 4) > 0;
+ }
+ set shouldSkip(v) {
+ if (v) this._traverseFlags |= 4;else this._traverseFlags &= -5;
+ }
+ static get({
+ hub,
+ parentPath,
+ parent,
+ container,
+ listKey,
+ key
+ }) {
+ if (!hub && parentPath) {
+ hub = parentPath.hub;
+ }
+ if (!parent) {
+ throw new Error("To get a node path the parent needs to exist");
+ }
+ const targetNode = container[key];
+ const paths = cache.getOrCreateCachedPaths(parent, parentPath);
+ let path = paths.get(targetNode);
+ if (!path) {
+ path = new NodePath(hub, parent);
+ if (targetNode) paths.set(targetNode, path);
+ }
+ _context.setup.call(path, parentPath, container, listKey, key);
+ return path;
+ }
+ getScope(scope) {
+ return this.isScope() ? new _index2.default(this) : scope;
+ }
+ setData(key, val) {
+ if (this.data == null) {
+ this.data = Object.create(null);
+ }
+ return this.data[key] = val;
+ }
+ getData(key, def) {
+ if (this.data == null) {
+ this.data = Object.create(null);
+ }
+ let val = this.data[key];
+ if (val === undefined && def !== undefined) val = this.data[key] = def;
+ return val;
+ }
+ hasNode() {
+ return this.node != null;
+ }
+ buildCodeFrameError(msg, Error = SyntaxError) {
+ return this.hub.buildError(this.node, msg, Error);
+ }
+ traverse(visitor, state) {
+ (0, _index.default)(this.node, visitor, this.scope, state, this);
+ }
+ set(key, node) {
+ validate(this.node, key, node);
+ this.node[key] = node;
+ }
+ getPathLocation() {
+ const parts = [];
+ let path = this;
+ do {
+ let key = path.key;
+ if (path.inList) key = `${path.listKey}[${key}]`;
+ parts.unshift(key);
+ } while (path = path.parentPath);
+ return parts.join(".");
+ }
+ debug(message) {
+ if (!debug.enabled) return;
+ debug(`${this.getPathLocation()} ${this.type}: ${message}`);
+ }
+ toString() {
+ return (0, _generator.default)(this.node).code;
+ }
+ get inList() {
+ return !!this.listKey;
+ }
+ set inList(inList) {
+ if (!inList) {
+ this.listKey = null;
+ }
+ }
+ get parentKey() {
+ return this.listKey || this.key;
+ }
+};
+const methods = {
+ findParent: NodePath_ancestry.findParent,
+ find: NodePath_ancestry.find,
+ getFunctionParent: NodePath_ancestry.getFunctionParent,
+ getStatementParent: NodePath_ancestry.getStatementParent,
+ getEarliestCommonAncestorFrom: NodePath_ancestry.getEarliestCommonAncestorFrom,
+ getDeepestCommonAncestorFrom: NodePath_ancestry.getDeepestCommonAncestorFrom,
+ getAncestry: NodePath_ancestry.getAncestry,
+ isAncestor: NodePath_ancestry.isAncestor,
+ isDescendant: NodePath_ancestry.isDescendant,
+ inType: NodePath_ancestry.inType,
+ getTypeAnnotation: NodePath_inference.getTypeAnnotation,
+ isBaseType: NodePath_inference.isBaseType,
+ couldBeBaseType: NodePath_inference.couldBeBaseType,
+ baseTypeStrictlyMatches: NodePath_inference.baseTypeStrictlyMatches,
+ isGenericType: NodePath_inference.isGenericType,
+ replaceWithMultiple: NodePath_replacement.replaceWithMultiple,
+ replaceWithSourceString: NodePath_replacement.replaceWithSourceString,
+ replaceWith: NodePath_replacement.replaceWith,
+ replaceExpressionWithStatements: NodePath_replacement.replaceExpressionWithStatements,
+ replaceInline: NodePath_replacement.replaceInline,
+ evaluateTruthy: NodePath_evaluation.evaluateTruthy,
+ evaluate: NodePath_evaluation.evaluate,
+ toComputedKey: NodePath_conversion.toComputedKey,
+ ensureBlock: NodePath_conversion.ensureBlock,
+ unwrapFunctionEnvironment: NodePath_conversion.unwrapFunctionEnvironment,
+ arrowFunctionToExpression: NodePath_conversion.arrowFunctionToExpression,
+ splitExportDeclaration: NodePath_conversion.splitExportDeclaration,
+ ensureFunctionName: NodePath_conversion.ensureFunctionName,
+ matchesPattern: NodePath_introspection.matchesPattern,
+ isStatic: NodePath_introspection.isStatic,
+ isNodeType: NodePath_introspection.isNodeType,
+ canHaveVariableDeclarationOrExpression: NodePath_introspection.canHaveVariableDeclarationOrExpression,
+ canSwapBetweenExpressionAndStatement: NodePath_introspection.canSwapBetweenExpressionAndStatement,
+ isCompletionRecord: NodePath_introspection.isCompletionRecord,
+ isStatementOrBlock: NodePath_introspection.isStatementOrBlock,
+ referencesImport: NodePath_introspection.referencesImport,
+ getSource: NodePath_introspection.getSource,
+ willIMaybeExecuteBefore: NodePath_introspection.willIMaybeExecuteBefore,
+ _guessExecutionStatusRelativeTo: NodePath_introspection._guessExecutionStatusRelativeTo,
+ resolve: NodePath_introspection.resolve,
+ isConstantExpression: NodePath_introspection.isConstantExpression,
+ isInStrictMode: NodePath_introspection.isInStrictMode,
+ isDenylisted: NodePath_context.isDenylisted,
+ visit: NodePath_context.visit,
+ skip: NodePath_context.skip,
+ skipKey: NodePath_context.skipKey,
+ stop: NodePath_context.stop,
+ setContext: NodePath_context.setContext,
+ requeue: NodePath_context.requeue,
+ requeueComputedKeyAndDecorators: NodePath_context.requeueComputedKeyAndDecorators,
+ remove: NodePath_removal.remove,
+ insertBefore: NodePath_modification.insertBefore,
+ insertAfter: NodePath_modification.insertAfter,
+ unshiftContainer: NodePath_modification.unshiftContainer,
+ pushContainer: NodePath_modification.pushContainer,
+ getOpposite: NodePath_family.getOpposite,
+ getCompletionRecords: NodePath_family.getCompletionRecords,
+ getSibling: NodePath_family.getSibling,
+ getPrevSibling: NodePath_family.getPrevSibling,
+ getNextSibling: NodePath_family.getNextSibling,
+ getAllNextSiblings: NodePath_family.getAllNextSiblings,
+ getAllPrevSiblings: NodePath_family.getAllPrevSiblings,
+ get: NodePath_family.get,
+ getAssignmentIdentifiers: NodePath_family.getAssignmentIdentifiers,
+ getBindingIdentifiers: NodePath_family.getBindingIdentifiers,
+ getOuterBindingIdentifiers: NodePath_family.getOuterBindingIdentifiers,
+ getBindingIdentifierPaths: NodePath_family.getBindingIdentifierPaths,
+ getOuterBindingIdentifierPaths: NodePath_family.getOuterBindingIdentifierPaths,
+ shareCommentsWithSiblings: NodePath_comments.shareCommentsWithSiblings,
+ addComment: NodePath_comments.addComment,
+ addComments: NodePath_comments.addComments
+};
+Object.assign(NodePath_Final.prototype, methods);
+{
+ NodePath_Final.prototype.arrowFunctionToShadowed = NodePath_conversion[String("arrowFunctionToShadowed")];
+ Object.assign(NodePath_Final.prototype, {
+ has: NodePath_introspection[String("has")],
+ is: NodePath_introspection[String("is")],
+ isnt: NodePath_introspection[String("isnt")],
+ equals: NodePath_introspection[String("equals")],
+ hoist: NodePath_modification[String("hoist")],
+ updateSiblingKeys: NodePath_modification.updateSiblingKeys,
+ call: NodePath_context.call,
+ isBlacklisted: NodePath_context[String("isBlacklisted")],
+ setScope: NodePath_context.setScope,
+ resync: NodePath_context.resync,
+ popContext: NodePath_context.popContext,
+ pushContext: NodePath_context.pushContext,
+ setup: NodePath_context.setup,
+ setKey: NodePath_context.setKey
+ });
+}
+{
+ NodePath_Final.prototype._guessExecutionStatusRelativeToDifferentFunctions = NodePath_introspection._guessExecutionStatusRelativeTo;
+ NodePath_Final.prototype._guessExecutionStatusRelativeToDifferentFunctions = NodePath_introspection._guessExecutionStatusRelativeTo;
+ Object.assign(NodePath_Final.prototype, {
+ _getTypeAnnotation: NodePath_inference._getTypeAnnotation,
+ _replaceWith: NodePath_replacement._replaceWith,
+ _resolve: NodePath_introspection._resolve,
+ _call: NodePath_context._call,
+ _resyncParent: NodePath_context._resyncParent,
+ _resyncKey: NodePath_context._resyncKey,
+ _resyncList: NodePath_context._resyncList,
+ _resyncRemoved: NodePath_context._resyncRemoved,
+ _getQueueContexts: NodePath_context._getQueueContexts,
+ _removeFromScope: NodePath_removal._removeFromScope,
+ _callRemovalHooks: NodePath_removal._callRemovalHooks,
+ _remove: NodePath_removal._remove,
+ _markRemoved: NodePath_removal._markRemoved,
+ _assertUnremoved: NodePath_removal._assertUnremoved,
+ _containerInsert: NodePath_modification._containerInsert,
+ _containerInsertBefore: NodePath_modification._containerInsertBefore,
+ _containerInsertAfter: NodePath_modification._containerInsertAfter,
+ _verifyNodeList: NodePath_modification._verifyNodeList,
+ _getKey: NodePath_family._getKey,
+ _getPattern: NodePath_family._getPattern
+ });
+}
+for (const type of t.TYPES) {
+ const typeKey = `is${type}`;
+ const fn = t[typeKey];
+ NodePath_Final.prototype[typeKey] = function (opts) {
+ return fn(this.node, opts);
+ };
+ NodePath_Final.prototype[`assert${type}`] = function (opts) {
+ if (!fn(this.node, opts)) {
+ throw new TypeError(`Expected node path of type ${type}`);
+ }
+ };
+}
+Object.assign(NodePath_Final.prototype, NodePath_virtual_types_validator);
+for (const type of Object.keys(virtualTypes)) {
+ if (type[0] === "_") continue;
+ if (!t.TYPES.includes(type)) t.TYPES.push(type);
+}
+
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@babel/traverse/lib/path/index.js.map b/node_modules/@babel/traverse/lib/path/index.js.map
new file mode 100644
index 00000000..dadc1a84
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/index.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["virtualTypes","require","_debug","_index","_index2","_t","t","cache","_generator","NodePath_ancestry","NodePath_inference","NodePath_replacement","NodePath_evaluation","NodePath_conversion","NodePath_introspection","_context","NodePath_context","NodePath_removal","NodePath_modification","NodePath_family","NodePath_comments","NodePath_virtual_types_validator","validate","debug","buildDebug","REMOVED","exports","SHOULD_STOP","SHOULD_SKIP","NodePath_Final","default","NodePath","constructor","hub","parent","contexts","state","opts","_traverseFlags","skipKeys","parentPath","container","listKey","key","node","type","_store","data","context","scope","removed","v","shouldStop","shouldSkip","get","Error","targetNode","paths","getOrCreateCachedPaths","path","set","setup","call","getScope","isScope","Scope","setData","val","Object","create","getData","def","undefined","hasNode","buildCodeFrameError","msg","SyntaxError","buildError","traverse","visitor","getPathLocation","parts","inList","unshift","join","message","enabled","toString","generator","code","parentKey","methods","findParent","find","getFunctionParent","getStatementParent","getEarliestCommonAncestorFrom","getDeepestCommonAncestorFrom","getAncestry","isAncestor","isDescendant","inType","getTypeAnnotation","isBaseType","couldBeBaseType","baseTypeStrictlyMatches","isGenericType","replaceWithMultiple","replaceWithSourceString","replaceWith","replaceExpressionWithStatements","replaceInline","evaluateTruthy","evaluate","toComputedKey","ensureBlock","unwrapFunctionEnvironment","arrowFunctionToExpression","splitExportDeclaration","ensureFunctionName","matchesPattern","isStatic","isNodeType","canHaveVariableDeclarationOrExpression","canSwapBetweenExpressionAndStatement","isCompletionRecord","isStatementOrBlock","referencesImport","getSource","willIMaybeExecuteBefore","_guessExecutionStatusRelativeTo","resolve","isConstantExpression","isInStrictMode","isDenylisted","visit","skip","skipKey","stop","setContext","requeue","requeueComputedKeyAndDecorators","remove","insertBefore","insertAfter","unshiftContainer","pushContainer","getOpposite","getCompletionRecords","getSibling","getPrevSibling","getNextSibling","getAllNextSiblings","getAllPrevSiblings","getAssignmentIdentifiers","getBindingIdentifiers","getOuterBindingIdentifiers","getBindingIdentifierPaths","getOuterBindingIdentifierPaths","shareCommentsWithSiblings","addComment","addComments","assign","prototype","arrowFunctionToShadowed","String","has","is","isnt","equals","hoist","updateSiblingKeys","isBlacklisted","setScope","resync","popContext","pushContext","setKey","_guessExecutionStatusRelativeToDifferentFunctions","_getTypeAnnotation","_replaceWith","_resolve","_call","_resyncParent","_resyncKey","_resyncList","_resyncRemoved","_getQueueContexts","_removeFromScope","_callRemovalHooks","_remove","_markRemoved","_assertUnremoved","_containerInsert","_containerInsertBefore","_containerInsertAfter","_verifyNodeList","_getKey","_getPattern","TYPES","typeKey","fn","TypeError","keys","includes","push"],"sources":["../../src/path/index.ts"],"sourcesContent":["import type { HubInterface } from \"../hub.ts\";\nimport type TraversalContext from \"../context.ts\";\nimport type { ExplodedTraverseOptions } from \"../index.ts\";\nimport * as virtualTypes from \"./lib/virtual-types.ts\";\nimport buildDebug from \"debug\";\nimport traverse from \"../index.ts\";\nimport type { Visitor } from \"../types.ts\";\nimport Scope from \"../scope/index.ts\";\nimport { validate } from \"@babel/types\";\nimport * as t from \"@babel/types\";\nimport * as cache from \"../cache.ts\";\nimport generator from \"@babel/generator\";\n\n// NodePath is split across many files.\nimport * as NodePath_ancestry from \"./ancestry.ts\";\nimport * as NodePath_inference from \"./inference/index.ts\";\nimport * as NodePath_replacement from \"./replacement.ts\";\nimport * as NodePath_evaluation from \"./evaluation.ts\";\nimport * as NodePath_conversion from \"./conversion.ts\";\nimport * as NodePath_introspection from \"./introspection.ts\";\nimport * as NodePath_context from \"./context.ts\";\nimport * as NodePath_removal from \"./removal.ts\";\nimport * as NodePath_modification from \"./modification.ts\";\nimport * as NodePath_family from \"./family.ts\";\nimport * as NodePath_comments from \"./comments.ts\";\nimport * as NodePath_virtual_types_validator from \"./lib/virtual-types-validator.ts\";\nimport type { NodePathAssertions } from \"./generated/asserts.ts\";\nimport type { NodePathValidators } from \"./generated/validators.ts\";\nimport { setup } from \"./context.ts\";\n\nconst debug = buildDebug(\"babel\");\n\nexport const REMOVED = 1 << 0;\nexport const SHOULD_STOP = 1 << 1;\nexport const SHOULD_SKIP = 1 << 2;\n\ndeclare const bit: import(\"../../../../scripts/babel-plugin-bit-decorator/types.d.ts\").BitDecorator;\n\nconst NodePath_Final = class NodePath {\n constructor(hub: HubInterface, parent: t.Node | null) {\n this.parent = parent;\n this.hub = hub;\n this.data = null;\n\n this.context = null;\n this.scope = null;\n }\n\n declare parent: t.Node;\n declare hub: HubInterface;\n declare data: Record;\n // TraversalContext is configured by setContext\n declare context: TraversalContext;\n declare scope: Scope;\n\n contexts: Array = [];\n state: any = null;\n opts: ExplodedTraverseOptions | null = null;\n\n @bit.storage _traverseFlags: number;\n @bit(REMOVED) accessor removed = false;\n @bit(SHOULD_STOP) accessor shouldStop = false;\n @bit(SHOULD_SKIP) accessor shouldSkip = false;\n\n skipKeys: Record | null = null;\n parentPath: NodePath_Final | null = null;\n container: t.Node | Array | null = null;\n listKey: string | null = null;\n key: string | number | null = null;\n node: t.Node | null = null;\n type: t.Node[\"type\"] | null = null;\n _store: Map | null = null;\n\n static get({\n hub,\n parentPath,\n parent,\n container,\n listKey,\n key,\n }: {\n hub?: HubInterface;\n parentPath: NodePath_Final | null;\n parent: t.Node;\n container: t.Node | t.Node[];\n listKey?: string;\n key: string | number;\n }): NodePath_Final {\n if (!hub && parentPath) {\n hub = parentPath.hub;\n }\n\n if (!parent) {\n throw new Error(\"To get a node path the parent needs to exist\");\n }\n\n const targetNode =\n // @ts-expect-error key must present in container\n container[key];\n\n const paths = cache.getOrCreateCachedPaths(parent, parentPath);\n\n let path = paths.get(targetNode);\n if (!path) {\n path = new NodePath(hub, parent) as NodePath_Final;\n if (targetNode) paths.set(targetNode, path);\n }\n\n setup.call(path, parentPath, container, listKey, key);\n\n return path;\n }\n\n getScope(this: NodePath_Final, scope: Scope): Scope {\n return this.isScope() ? new Scope(this) : scope;\n }\n\n setData(key: string | symbol, val: any): any {\n if (this.data == null) {\n this.data = Object.create(null);\n }\n return (this.data[key] = val);\n }\n\n getData(key: string | symbol, def?: any): any {\n if (this.data == null) {\n this.data = Object.create(null);\n }\n let val = this.data[key];\n if (val === undefined && def !== undefined) val = this.data[key] = def;\n return val;\n }\n\n hasNode(): boolean {\n return this.node != null;\n }\n\n buildCodeFrameError(\n msg: string,\n Error: new () => Error = SyntaxError,\n ): Error {\n return this.hub.buildError(this.node, msg, Error);\n }\n\n traverse(this: NodePath_Final, visitor: Visitor, state: T): void;\n traverse(this: NodePath_Final, visitor: Visitor): void;\n traverse(this: NodePath_Final, visitor: any, state?: any) {\n traverse(this.node, visitor, this.scope, state, this);\n }\n\n set(key: string, node: any) {\n validate(this.node, key, node);\n // @ts-expect-error key must present in this.node\n this.node[key] = node;\n }\n\n getPathLocation(this: NodePath_Final): string {\n const parts = [];\n let path: NodePath_Final = this;\n do {\n let key = path.key;\n if (path.inList) key = `${path.listKey}[${key}]`;\n parts.unshift(key);\n } while ((path = path.parentPath));\n return parts.join(\".\");\n }\n\n debug(this: NodePath_Final, message: string) {\n if (!debug.enabled) return;\n debug(`${this.getPathLocation()} ${this.type}: ${message}`);\n }\n\n toString() {\n return generator(this.node).code;\n }\n\n get inList() {\n return !!this.listKey;\n }\n\n set inList(inList) {\n if (!inList) {\n this.listKey = null;\n }\n // ignore inList = true as it should depend on `listKey`\n }\n\n get parentKey(): string {\n return (this.listKey || this.key) as string;\n }\n};\n\nconst methods = {\n // NodePath_ancestry\n findParent: NodePath_ancestry.findParent,\n find: NodePath_ancestry.find,\n getFunctionParent: NodePath_ancestry.getFunctionParent,\n getStatementParent: NodePath_ancestry.getStatementParent,\n getEarliestCommonAncestorFrom:\n NodePath_ancestry.getEarliestCommonAncestorFrom,\n getDeepestCommonAncestorFrom: NodePath_ancestry.getDeepestCommonAncestorFrom,\n getAncestry: NodePath_ancestry.getAncestry,\n isAncestor: NodePath_ancestry.isAncestor,\n isDescendant: NodePath_ancestry.isDescendant,\n inType: NodePath_ancestry.inType,\n\n // NodePath_inference\n getTypeAnnotation: NodePath_inference.getTypeAnnotation,\n isBaseType: NodePath_inference.isBaseType,\n couldBeBaseType: NodePath_inference.couldBeBaseType,\n baseTypeStrictlyMatches: NodePath_inference.baseTypeStrictlyMatches,\n isGenericType: NodePath_inference.isGenericType,\n\n // NodePath_replacement\n replaceWithMultiple: NodePath_replacement.replaceWithMultiple,\n replaceWithSourceString: NodePath_replacement.replaceWithSourceString,\n replaceWith: NodePath_replacement.replaceWith,\n replaceExpressionWithStatements:\n NodePath_replacement.replaceExpressionWithStatements,\n replaceInline: NodePath_replacement.replaceInline,\n\n // NodePath_evaluation\n evaluateTruthy: NodePath_evaluation.evaluateTruthy,\n evaluate: NodePath_evaluation.evaluate,\n\n // NodePath_conversion\n toComputedKey: NodePath_conversion.toComputedKey,\n ensureBlock: NodePath_conversion.ensureBlock,\n unwrapFunctionEnvironment: NodePath_conversion.unwrapFunctionEnvironment,\n arrowFunctionToExpression: NodePath_conversion.arrowFunctionToExpression,\n splitExportDeclaration: NodePath_conversion.splitExportDeclaration,\n ensureFunctionName: NodePath_conversion.ensureFunctionName,\n\n // NodePath_introspection\n matchesPattern: NodePath_introspection.matchesPattern,\n isStatic: NodePath_introspection.isStatic,\n isNodeType: NodePath_introspection.isNodeType,\n canHaveVariableDeclarationOrExpression:\n NodePath_introspection.canHaveVariableDeclarationOrExpression,\n canSwapBetweenExpressionAndStatement:\n NodePath_introspection.canSwapBetweenExpressionAndStatement,\n isCompletionRecord: NodePath_introspection.isCompletionRecord,\n isStatementOrBlock: NodePath_introspection.isStatementOrBlock,\n referencesImport: NodePath_introspection.referencesImport,\n getSource: NodePath_introspection.getSource,\n willIMaybeExecuteBefore: NodePath_introspection.willIMaybeExecuteBefore,\n _guessExecutionStatusRelativeTo:\n NodePath_introspection._guessExecutionStatusRelativeTo,\n resolve: NodePath_introspection.resolve,\n isConstantExpression: NodePath_introspection.isConstantExpression,\n isInStrictMode: NodePath_introspection.isInStrictMode,\n\n // NodePath_context\n isDenylisted: NodePath_context.isDenylisted,\n visit: NodePath_context.visit,\n skip: NodePath_context.skip,\n skipKey: NodePath_context.skipKey,\n stop: NodePath_context.stop,\n setContext: NodePath_context.setContext,\n requeue: NodePath_context.requeue,\n requeueComputedKeyAndDecorators:\n NodePath_context.requeueComputedKeyAndDecorators,\n\n // NodePath_removal\n remove: NodePath_removal.remove,\n\n // NodePath_modification\n insertBefore: NodePath_modification.insertBefore,\n insertAfter: NodePath_modification.insertAfter,\n unshiftContainer: NodePath_modification.unshiftContainer,\n pushContainer: NodePath_modification.pushContainer,\n\n // NodePath_family\n getOpposite: NodePath_family.getOpposite,\n getCompletionRecords: NodePath_family.getCompletionRecords,\n getSibling: NodePath_family.getSibling,\n getPrevSibling: NodePath_family.getPrevSibling,\n getNextSibling: NodePath_family.getNextSibling,\n getAllNextSiblings: NodePath_family.getAllNextSiblings,\n getAllPrevSiblings: NodePath_family.getAllPrevSiblings,\n get: NodePath_family.get,\n getAssignmentIdentifiers: NodePath_family.getAssignmentIdentifiers,\n getBindingIdentifiers: NodePath_family.getBindingIdentifiers,\n getOuterBindingIdentifiers: NodePath_family.getOuterBindingIdentifiers,\n getBindingIdentifierPaths: NodePath_family.getBindingIdentifierPaths,\n getOuterBindingIdentifierPaths:\n NodePath_family.getOuterBindingIdentifierPaths,\n\n // NodePath_comments\n shareCommentsWithSiblings: NodePath_comments.shareCommentsWithSiblings,\n addComment: NodePath_comments.addComment,\n addComments: NodePath_comments.addComments,\n};\n\nObject.assign(NodePath_Final.prototype, methods);\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n // String(x) is workaround for rollup\n\n // @ts-expect-error babel 7 only\n NodePath_Final.prototype.arrowFunctionToShadowed =\n // @ts-expect-error babel 7 only\n NodePath_conversion[String(\"arrowFunctionToShadowed\")];\n\n Object.assign(NodePath_Final.prototype, {\n // @ts-expect-error Babel 7 only\n has: NodePath_introspection[String(\"has\")],\n // @ts-expect-error Babel 7 only\n is: NodePath_introspection[String(\"is\")],\n // @ts-expect-error Babel 7 only\n isnt: NodePath_introspection[String(\"isnt\")],\n // @ts-expect-error Babel 7 only\n equals: NodePath_introspection[String(\"equals\")],\n // @ts-expect-error Babel 7 only\n hoist: NodePath_modification[String(\"hoist\")],\n updateSiblingKeys: NodePath_modification.updateSiblingKeys,\n call: NodePath_context.call,\n // @ts-expect-error Babel 7 only\n isBlacklisted: NodePath_context[String(\"isBlacklisted\")],\n setScope: NodePath_context.setScope,\n resync: NodePath_context.resync,\n popContext: NodePath_context.popContext,\n pushContext: NodePath_context.pushContext,\n setup: NodePath_context.setup,\n setKey: NodePath_context.setKey,\n });\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n // @ts-expect-error The original _guessExecutionStatusRelativeToDifferentFunctions only worked for paths in\n // different functions, but _guessExecutionStatusRelativeTo works as a replacement in those cases.\n NodePath_Final.prototype._guessExecutionStatusRelativeToDifferentFunctions =\n NodePath_introspection._guessExecutionStatusRelativeTo;\n\n // @ts-expect-error The original _guessExecutionStatusRelativeToDifferentFunctions only worked for paths in\n // different functions, but _guessExecutionStatusRelativeTo works as a replacement in those cases.\n NodePath_Final.prototype._guessExecutionStatusRelativeToDifferentFunctions =\n NodePath_introspection._guessExecutionStatusRelativeTo;\n\n Object.assign(NodePath_Final.prototype, {\n // NodePath_inference\n _getTypeAnnotation: NodePath_inference._getTypeAnnotation,\n\n // NodePath_replacement\n _replaceWith: NodePath_replacement._replaceWith,\n\n // NodePath_introspection\n _resolve: NodePath_introspection._resolve,\n\n // NodePath_context\n _call: NodePath_context._call,\n _resyncParent: NodePath_context._resyncParent,\n _resyncKey: NodePath_context._resyncKey,\n _resyncList: NodePath_context._resyncList,\n _resyncRemoved: NodePath_context._resyncRemoved,\n _getQueueContexts: NodePath_context._getQueueContexts,\n\n // NodePath_removal\n _removeFromScope: NodePath_removal._removeFromScope,\n _callRemovalHooks: NodePath_removal._callRemovalHooks,\n _remove: NodePath_removal._remove,\n _markRemoved: NodePath_removal._markRemoved,\n _assertUnremoved: NodePath_removal._assertUnremoved,\n\n // NodePath_modification\n _containerInsert: NodePath_modification._containerInsert,\n _containerInsertBefore: NodePath_modification._containerInsertBefore,\n _containerInsertAfter: NodePath_modification._containerInsertAfter,\n _verifyNodeList: NodePath_modification._verifyNodeList,\n\n // NodePath_family\n _getKey: NodePath_family._getKey,\n _getPattern: NodePath_family._getPattern,\n });\n}\n\n// we can not use `import { TYPES } from \"@babel/types\"` here\n// because the transformNamedBabelTypesImportToDestructuring plugin in babel.config.js\n// does not offer live bindings for `TYPES`\n// we can change to `import { TYPES }` when we are publishing ES modules only\nfor (const type of t.TYPES) {\n const typeKey = `is${type}`;\n // @ts-expect-error typeKey must present in t\n const fn = t[typeKey];\n // @ts-expect-error augmenting NodePath prototype\n NodePath_Final.prototype[typeKey] = function (opts: any) {\n return fn(this.node, opts);\n };\n\n // @ts-expect-error augmenting NodePath prototype\n NodePath_Final.prototype[`assert${type}`] = function (opts: any) {\n if (!fn(this.node, opts)) {\n throw new TypeError(`Expected node path of type ${type}`);\n }\n };\n}\n\n// Register virtual types validators after base types validators\nObject.assign(NodePath_Final.prototype, NodePath_virtual_types_validator);\n\nfor (const type of Object.keys(virtualTypes) as (keyof typeof virtualTypes)[]) {\n if (type[0] === \"_\") continue;\n if (!t.TYPES.includes(type)) t.TYPES.push(type);\n}\n\ninterface NodePathOverwrites {\n // We need to re-define these predicate and assertion\n // methods here, because we cannot refine `this` in\n // a function declaration.\n // See https://github.com/microsoft/TypeScript/issues/38150\n\n /**\n * NOTE: This assertion doesn't narrow the type on unions of\n * NodePaths, due to https://github.com/microsoft/TypeScript/issues/44212\n *\n * @see ./conversion.ts for implementation.\n */\n ensureBlock(\n this: NodePath_Final,\n ): asserts this is NodePath_Final<\n (\n | t.Loop\n | t.WithStatement\n | t.Function\n | t.LabeledStatement\n | t.CatchClause\n ) & { body: t.BlockStatement }\n >;\n /**\n * @see ./introspection.ts for implementation.\n */\n isStatementOrBlock(\n this: NodePath_Final,\n ): this is NodePath_Final;\n}\n\ntype NodePathMixins = Omit;\n\ninterface NodePath\n extends InstanceType,\n NodePathAssertions,\n NodePathValidators,\n NodePathMixins,\n NodePathOverwrites {\n type: T[\"type\"] | null;\n node: T;\n parent: t.ParentMaps[T[\"type\"]];\n parentPath: t.ParentMaps[T[\"type\"]] extends null\n ? null\n : NodePath_Final | null;\n}\n\n// This trick is necessary so that\n// NodePath_Final is the same as NodePath_Final | NodePath_Final\ntype NodePath_Final = T extends any\n ? NodePath\n : never;\n\nexport { NodePath_Final as default, type NodePath as NodePath_Internal };\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,EAAA,GAAAJ,OAAA;AAAwC,IAAAK,CAAA,GAAAD,EAAA;AAExC,IAAAE,KAAA,G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,IAAI,CAAC,EAAE;MACxB,MAAM,IAAIqK,SAAS,CAAC,8BAA8B7J,IAAI,EAAE,CAAC;IAC3D;EACF,CAAC;AACH;AAGAuB,MAAM,CAAC8F,MAAM,CAACrI,cAAc,CAACsI,SAAS,EAAE9I,gCAAgC,CAAC;AAEzE,KAAK,MAAMwB,IAAI,IAAIuB,MAAM,CAACuI,IAAI,CAAC3M,YAAY,CAAC,EAAmC;EAC7E,IAAI6C,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;EACrB,IAAI,CAACvC,CAAC,CAACiM,KAAK,CAACK,QAAQ,CAAC/J,IAAI,CAAC,EAAEvC,CAAC,CAACiM,KAAK,CAACM,IAAI,CAAChK,IAAI,CAAC;AACjD","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/traverse/lib/path/inference/index.js b/node_modules/@babel/traverse/lib/path/inference/index.js
new file mode 100644
index 00000000..c52eb7da
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/inference/index.js
@@ -0,0 +1,149 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports._getTypeAnnotation = _getTypeAnnotation;
+exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches;
+exports.couldBeBaseType = couldBeBaseType;
+exports.getTypeAnnotation = getTypeAnnotation;
+exports.isBaseType = isBaseType;
+exports.isGenericType = isGenericType;
+var inferers = require("./inferers.js");
+var _t = require("@babel/types");
+const {
+ anyTypeAnnotation,
+ isAnyTypeAnnotation,
+ isArrayTypeAnnotation,
+ isBooleanTypeAnnotation,
+ isEmptyTypeAnnotation,
+ isFlowBaseAnnotation,
+ isGenericTypeAnnotation,
+ isIdentifier,
+ isMixedTypeAnnotation,
+ isNumberTypeAnnotation,
+ isStringTypeAnnotation,
+ isTSArrayType,
+ isTSTypeAnnotation,
+ isTSTypeReference,
+ isTupleTypeAnnotation,
+ isTypeAnnotation,
+ isUnionTypeAnnotation,
+ isVoidTypeAnnotation,
+ stringTypeAnnotation,
+ voidTypeAnnotation
+} = _t;
+function getTypeAnnotation() {
+ let type = this.getData("typeAnnotation");
+ if (type != null) {
+ return type;
+ }
+ type = _getTypeAnnotation.call(this) || anyTypeAnnotation();
+ if (isTypeAnnotation(type) || isTSTypeAnnotation(type)) {
+ type = type.typeAnnotation;
+ }
+ this.setData("typeAnnotation", type);
+ return type;
+}
+const typeAnnotationInferringNodes = new WeakSet();
+function _getTypeAnnotation() {
+ const node = this.node;
+ if (!node) {
+ if (this.key === "init" && this.parentPath.isVariableDeclarator()) {
+ const declar = this.parentPath.parentPath;
+ const declarParent = declar.parentPath;
+ if (declar.key === "left" && declarParent.isForInStatement()) {
+ return stringTypeAnnotation();
+ }
+ if (declar.key === "left" && declarParent.isForOfStatement()) {
+ return anyTypeAnnotation();
+ }
+ return voidTypeAnnotation();
+ } else {
+ return;
+ }
+ }
+ if (node.typeAnnotation) {
+ return node.typeAnnotation;
+ }
+ if (typeAnnotationInferringNodes.has(node)) {
+ return;
+ }
+ typeAnnotationInferringNodes.add(node);
+ try {
+ var _inferer;
+ let inferer = inferers[node.type];
+ if (inferer) {
+ return inferer.call(this, node);
+ }
+ inferer = inferers[this.parentPath.type];
+ if ((_inferer = inferer) != null && _inferer.validParent) {
+ return this.parentPath.getTypeAnnotation();
+ }
+ } finally {
+ typeAnnotationInferringNodes.delete(node);
+ }
+}
+function isBaseType(baseName, soft) {
+ return _isBaseType(baseName, this.getTypeAnnotation(), soft);
+}
+function _isBaseType(baseName, type, soft) {
+ if (baseName === "string") {
+ return isStringTypeAnnotation(type);
+ } else if (baseName === "number") {
+ return isNumberTypeAnnotation(type);
+ } else if (baseName === "boolean") {
+ return isBooleanTypeAnnotation(type);
+ } else if (baseName === "any") {
+ return isAnyTypeAnnotation(type);
+ } else if (baseName === "mixed") {
+ return isMixedTypeAnnotation(type);
+ } else if (baseName === "empty") {
+ return isEmptyTypeAnnotation(type);
+ } else if (baseName === "void") {
+ return isVoidTypeAnnotation(type);
+ } else {
+ if (soft) {
+ return false;
+ } else {
+ throw new Error(`Unknown base type ${baseName}`);
+ }
+ }
+}
+function couldBeBaseType(name) {
+ const type = this.getTypeAnnotation();
+ if (isAnyTypeAnnotation(type)) return true;
+ if (isUnionTypeAnnotation(type)) {
+ for (const type2 of type.types) {
+ if (isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) {
+ return true;
+ }
+ }
+ return false;
+ } else {
+ return _isBaseType(name, type, true);
+ }
+}
+function baseTypeStrictlyMatches(rightArg) {
+ const left = this.getTypeAnnotation();
+ const right = rightArg.getTypeAnnotation();
+ if (!isAnyTypeAnnotation(left) && isFlowBaseAnnotation(left)) {
+ return right.type === left.type;
+ }
+ return false;
+}
+function isGenericType(genericName) {
+ const type = this.getTypeAnnotation();
+ if (genericName === "Array") {
+ if (isTSArrayType(type) || isArrayTypeAnnotation(type) || isTupleTypeAnnotation(type)) {
+ return true;
+ }
+ }
+ return isGenericTypeAnnotation(type) && isIdentifier(type.id, {
+ name: genericName
+ }) || isTSTypeReference(type) && isIdentifier(type.typeName, {
+ name: genericName
+ });
+}
+
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@babel/traverse/lib/path/inference/index.js.map b/node_modules/@babel/traverse/lib/path/inference/index.js.map
new file mode 100644
index 00000000..60b09505
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/inference/index.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["inferers","require","_t","anyTypeAnnotation","isAnyTypeAnnotation","isArrayTypeAnnotation","isBooleanTypeAnnotation","isEmptyTypeAnnotation","isFlowBaseAnnotation","isGenericTypeAnnotation","isIdentifier","isMixedTypeAnnotation","isNumberTypeAnnotation","isStringTypeAnnotation","isTSArrayType","isTSTypeAnnotation","isTSTypeReference","isTupleTypeAnnotation","isTypeAnnotation","isUnionTypeAnnotation","isVoidTypeAnnotation","stringTypeAnnotation","voidTypeAnnotation","getTypeAnnotation","type","getData","_getTypeAnnotation","call","typeAnnotation","setData","typeAnnotationInferringNodes","WeakSet","node","key","parentPath","isVariableDeclarator","declar","declarParent","isForInStatement","isForOfStatement","has","add","_inferer","inferer","validParent","delete","isBaseType","baseName","soft","_isBaseType","Error","couldBeBaseType","name","type2","types","baseTypeStrictlyMatches","rightArg","left","right","isGenericType","genericName","id","typeName"],"sources":["../../../src/path/inference/index.ts"],"sourcesContent":["import type NodePath from \"../index.ts\";\nimport * as inferers from \"./inferers.ts\";\nimport {\n anyTypeAnnotation,\n isAnyTypeAnnotation,\n isArrayTypeAnnotation,\n isBooleanTypeAnnotation,\n isEmptyTypeAnnotation,\n isFlowBaseAnnotation,\n isGenericTypeAnnotation,\n isIdentifier,\n isMixedTypeAnnotation,\n isNumberTypeAnnotation,\n isStringTypeAnnotation,\n isTSArrayType,\n isTSTypeAnnotation,\n isTSTypeReference,\n isTupleTypeAnnotation,\n isTypeAnnotation,\n isUnionTypeAnnotation,\n isVoidTypeAnnotation,\n stringTypeAnnotation,\n voidTypeAnnotation,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\n/**\n * Infer the type of the current `NodePath`.\n */\n\nexport function getTypeAnnotation(this: NodePath): t.FlowType | t.TSType {\n let type = this.getData(\"typeAnnotation\");\n if (type != null) {\n return type;\n }\n type = _getTypeAnnotation.call(this) || anyTypeAnnotation();\n if (isTypeAnnotation(type) || isTSTypeAnnotation(type)) {\n type = type.typeAnnotation;\n }\n this.setData(\"typeAnnotation\", type);\n return type;\n}\n\n// Used to avoid infinite recursion in cases like\n// var b, c; if (0) { c = 1; b = c; } c = b;\n// It also works with indirect recursion.\nconst typeAnnotationInferringNodes = new WeakSet();\n\n/**\n * todo: split up this method\n */\n\nexport function _getTypeAnnotation(this: NodePath): any {\n const node = this.node;\n\n if (!node) {\n // handle initializerless variables, add in checks for loop initializers too\n if (this.key === \"init\" && this.parentPath.isVariableDeclarator()) {\n const declar = this.parentPath.parentPath;\n const declarParent = declar.parentPath;\n\n // for (let NODE in bar) {}\n if (declar.key === \"left\" && declarParent.isForInStatement()) {\n return stringTypeAnnotation();\n }\n\n // for (let NODE of bar) {}\n if (declar.key === \"left\" && declarParent.isForOfStatement()) {\n return anyTypeAnnotation();\n }\n\n return voidTypeAnnotation();\n } else {\n return;\n }\n }\n\n // @ts-expect-error typeAnnotation may not index node\n if (node.typeAnnotation) {\n // @ts-expect-error typeAnnotation may not index node\n return node.typeAnnotation;\n }\n\n if (typeAnnotationInferringNodes.has(node)) {\n // Bail out from type inference to avoid infinite loops\n return;\n }\n typeAnnotationInferringNodes.add(node);\n\n try {\n let inferer =\n // @ts-expect-error inferers do not cover all AST types\n inferers[node.type];\n if (inferer) {\n return inferer.call(this, node);\n }\n\n // @ts-expect-error inferers do not cover all AST types\n inferer = inferers[this.parentPath.type];\n if (inferer?.validParent) {\n return this.parentPath.getTypeAnnotation();\n }\n } finally {\n typeAnnotationInferringNodes.delete(node);\n }\n}\n\nexport function isBaseType(\n this: NodePath,\n baseName: string,\n soft?: boolean,\n): boolean {\n return _isBaseType(baseName, this.getTypeAnnotation(), soft);\n}\n\nfunction _isBaseType(\n baseName: string,\n type?: t.FlowType | t.TSType,\n soft?: boolean,\n): boolean {\n if (baseName === \"string\") {\n return isStringTypeAnnotation(type);\n } else if (baseName === \"number\") {\n return isNumberTypeAnnotation(type);\n } else if (baseName === \"boolean\") {\n return isBooleanTypeAnnotation(type);\n } else if (baseName === \"any\") {\n return isAnyTypeAnnotation(type);\n } else if (baseName === \"mixed\") {\n return isMixedTypeAnnotation(type);\n } else if (baseName === \"empty\") {\n return isEmptyTypeAnnotation(type);\n } else if (baseName === \"void\") {\n return isVoidTypeAnnotation(type);\n } else {\n if (soft) {\n return false;\n } else {\n throw new Error(`Unknown base type ${baseName}`);\n }\n }\n}\n\nexport function couldBeBaseType(this: NodePath, name: string): boolean {\n const type = this.getTypeAnnotation();\n if (isAnyTypeAnnotation(type)) return true;\n\n if (isUnionTypeAnnotation(type)) {\n for (const type2 of type.types) {\n if (isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) {\n return true;\n }\n }\n return false;\n } else {\n return _isBaseType(name, type, true);\n }\n}\n\nexport function baseTypeStrictlyMatches(\n this: NodePath,\n rightArg: NodePath,\n): boolean {\n const left = this.getTypeAnnotation();\n const right = rightArg.getTypeAnnotation();\n\n if (!isAnyTypeAnnotation(left) && isFlowBaseAnnotation(left)) {\n return right.type === left.type;\n }\n return false;\n}\n\nexport function isGenericType(this: NodePath, genericName: string): boolean {\n const type = this.getTypeAnnotation();\n if (genericName === \"Array\") {\n // T[]\n if (\n isTSArrayType(type) ||\n isArrayTypeAnnotation(type) ||\n isTupleTypeAnnotation(type)\n ) {\n return true;\n }\n }\n return (\n (isGenericTypeAnnotation(type) &&\n isIdentifier(type.id, {\n name: genericName,\n })) ||\n (isTSTypeReference(type) &&\n isIdentifier(type.typeName, {\n name: genericName,\n }))\n );\n}\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,EAAA,GAAAD,OAAA;AAqBsB;EApBpBE,iBAAiB;EACjBC,mBAAmB;EACnBC,qBAAqB;EACrBC,uBAAuB;EACvBC,qBAAqB;EACrBC,oBAAoB;EACpBC,uBAAuB;EACvBC,YAAY;EACZC,qBAAqB;EACrBC,sBAAsB;EACtBC,sBAAsB;EACtBC,aAAa;EACbC,kBAAkB;EAClBC,iBAAiB;EACjBC,qBAAqB;EACrBC,gBAAgB;EAChBC,qBAAqB;EACrBC,oBAAoB;EACpBC,oBAAoB;EACpBC;AAAkB,IAAApB,EAAA;AAQb,SAASqB,iBAAiBA,CAAA,EAAwC;EACvE,IAAIC,IAAI,GAAG,IAAI,CAACC,OAAO,CAAC,gBAAgB,CAAC;EACzC,IAAID,IAAI,IAAI,IAAI,EAAE;IAChB,OAAOA,IAAI;EACb;EACAA,IAAI,GAAGE,kBAAkB,CAACC,IAAI,CAAC,IAAI,CAAC,IAAIxB,iBAAiB,CAAC,CAAC;EAC3D,IAAIe,gBAAgB,CAACM,IAAI,CAAC,IAAIT,kBAAkB,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Bd,YAAY,CAACc,IAAI,CAACqC,EAAE,EAAE;IACpBT,IAAI,EAAEQ;EACR,CAAC,CAAC,IACH5C,iBAAiB,CAACQ,IAAI,CAAC,IACtBd,YAAY,CAACc,IAAI,CAACsC,QAAQ,EAAE;IAC1BV,IAAI,EAAEQ;EACR,CAAC,CAAE;AAET","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js b/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
new file mode 100644
index 00000000..b262faf0
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
@@ -0,0 +1,151 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = _default;
+var _t = require("@babel/types");
+var _util = require("./util.js");
+const {
+ BOOLEAN_NUMBER_BINARY_OPERATORS,
+ createTypeAnnotationBasedOnTypeof,
+ numberTypeAnnotation,
+ voidTypeAnnotation
+} = _t;
+function _default(node) {
+ if (!this.isReferenced()) return;
+ const binding = this.scope.getBinding(node.name);
+ if (binding) {
+ if (binding.identifier.typeAnnotation) {
+ return binding.identifier.typeAnnotation;
+ } else {
+ return getTypeAnnotationBindingConstantViolations(binding, this, node.name);
+ }
+ }
+ if (node.name === "undefined") {
+ return voidTypeAnnotation();
+ } else if (node.name === "NaN" || node.name === "Infinity") {
+ return numberTypeAnnotation();
+ } else if (node.name === "arguments") {}
+}
+function getTypeAnnotationBindingConstantViolations(binding, path, name) {
+ const types = [];
+ const functionConstantViolations = [];
+ let constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations);
+ const testType = getConditionalAnnotation(binding, path, name);
+ if (testType) {
+ const testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement);
+ constantViolations = constantViolations.filter(path => !testConstantViolations.includes(path));
+ types.push(testType.typeAnnotation);
+ }
+ if (constantViolations.length) {
+ constantViolations.push(...functionConstantViolations);
+ for (const violation of constantViolations) {
+ types.push(violation.getTypeAnnotation());
+ }
+ }
+ if (!types.length) {
+ return;
+ }
+ return (0, _util.createUnionType)(types);
+}
+function getConstantViolationsBefore(binding, path, functions) {
+ const violations = binding.constantViolations.slice();
+ violations.unshift(binding.path);
+ return violations.filter(violation => {
+ violation = violation.resolve();
+ const status = violation._guessExecutionStatusRelativeTo(path);
+ if (functions && status === "unknown") functions.push(violation);
+ return status === "before";
+ });
+}
+function inferAnnotationFromBinaryExpression(name, path) {
+ const operator = path.node.operator;
+ const right = path.get("right").resolve();
+ const left = path.get("left").resolve();
+ let target;
+ if (left.isIdentifier({
+ name
+ })) {
+ target = right;
+ } else if (right.isIdentifier({
+ name
+ })) {
+ target = left;
+ }
+ if (target) {
+ if (operator === "===") {
+ return target.getTypeAnnotation();
+ }
+ if (BOOLEAN_NUMBER_BINARY_OPERATORS.includes(operator)) {
+ return numberTypeAnnotation();
+ }
+ return;
+ }
+ if (operator !== "===" && operator !== "==") return;
+ let typeofPath;
+ let typePath;
+ if (left.isUnaryExpression({
+ operator: "typeof"
+ })) {
+ typeofPath = left;
+ typePath = right;
+ } else if (right.isUnaryExpression({
+ operator: "typeof"
+ })) {
+ typeofPath = right;
+ typePath = left;
+ }
+ if (!typeofPath) return;
+ if (!typeofPath.get("argument").isIdentifier({
+ name
+ })) return;
+ typePath = typePath.resolve();
+ if (!typePath.isLiteral()) return;
+ const typeValue = typePath.node.value;
+ if (typeof typeValue !== "string") return;
+ return createTypeAnnotationBasedOnTypeof(typeValue);
+}
+function getParentConditionalPath(binding, path, name) {
+ let parentPath;
+ while (parentPath = path.parentPath) {
+ if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) {
+ if (path.key === "test") {
+ return;
+ }
+ return parentPath;
+ }
+ if (parentPath.isFunction()) {
+ if (parentPath.parentPath.scope.getBinding(name) !== binding) return;
+ }
+ path = parentPath;
+ }
+}
+function getConditionalAnnotation(binding, path, name) {
+ const ifStatement = getParentConditionalPath(binding, path, name);
+ if (!ifStatement) return;
+ const test = ifStatement.get("test");
+ const paths = [test];
+ const types = [];
+ for (let i = 0; i < paths.length; i++) {
+ const path = paths[i];
+ if (path.isLogicalExpression()) {
+ if (path.node.operator === "&&") {
+ paths.push(path.get("left"));
+ paths.push(path.get("right"));
+ }
+ } else if (path.isBinaryExpression()) {
+ const type = inferAnnotationFromBinaryExpression(name, path);
+ if (type) types.push(type);
+ }
+ }
+ if (types.length) {
+ return {
+ typeAnnotation: (0, _util.createUnionType)(types),
+ ifStatement
+ };
+ }
+ return getConditionalAnnotation(binding, ifStatement, name);
+}
+
+//# sourceMappingURL=inferer-reference.js.map
diff --git a/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js.map b/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js.map
new file mode 100644
index 00000000..e4dbcb4b
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["_t","require","_util","BOOLEAN_NUMBER_BINARY_OPERATORS","createTypeAnnotationBasedOnTypeof","numberTypeAnnotation","voidTypeAnnotation","_default","node","isReferenced","binding","scope","getBinding","name","identifier","typeAnnotation","getTypeAnnotationBindingConstantViolations","path","types","functionConstantViolations","constantViolations","getConstantViolationsBefore","testType","getConditionalAnnotation","testConstantViolations","ifStatement","filter","includes","push","length","violation","getTypeAnnotation","createUnionType","functions","violations","slice","unshift","resolve","status","_guessExecutionStatusRelativeTo","inferAnnotationFromBinaryExpression","operator","right","get","left","target","isIdentifier","typeofPath","typePath","isUnaryExpression","isLiteral","typeValue","value","getParentConditionalPath","parentPath","isIfStatement","isConditionalExpression","key","isFunction","test","paths","i","isLogicalExpression","isBinaryExpression","type"],"sources":["../../../src/path/inference/inferer-reference.ts"],"sourcesContent":["import type NodePath from \"../index.ts\";\nimport {\n BOOLEAN_NUMBER_BINARY_OPERATORS,\n createTypeAnnotationBasedOnTypeof,\n numberTypeAnnotation,\n voidTypeAnnotation,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type Binding from \"../../scope/binding.ts\";\n\nimport { createUnionType } from \"./util.ts\";\n\nexport default function (this: NodePath, node: t.Identifier) {\n if (!this.isReferenced()) return;\n\n // check if a binding exists of this value and if so then return a union type of all\n // possible types that the binding could be\n const binding = this.scope.getBinding(node.name);\n if (binding) {\n if (binding.identifier.typeAnnotation) {\n return binding.identifier.typeAnnotation;\n } else {\n return getTypeAnnotationBindingConstantViolations(\n binding,\n this,\n node.name,\n );\n }\n }\n\n // built-in values\n if (node.name === \"undefined\") {\n return voidTypeAnnotation();\n } else if (node.name === \"NaN\" || node.name === \"Infinity\") {\n return numberTypeAnnotation();\n } else if (node.name === \"arguments\") {\n // todo\n }\n}\n\nfunction getTypeAnnotationBindingConstantViolations(\n binding: Binding,\n path: NodePath,\n name: string,\n) {\n const types = [];\n\n const functionConstantViolations: NodePath[] = [];\n let constantViolations = getConstantViolationsBefore(\n binding,\n path,\n functionConstantViolations,\n );\n\n const testType = getConditionalAnnotation(binding, path, name);\n if (testType) {\n const testConstantViolations = getConstantViolationsBefore(\n binding,\n testType.ifStatement,\n );\n\n // remove constant violations observed before the IfStatement\n constantViolations = constantViolations.filter(\n path => !testConstantViolations.includes(path),\n );\n\n // clear current types and add in observed test type\n types.push(testType.typeAnnotation);\n }\n\n if (constantViolations.length) {\n // pick one constant from each scope which will represent the last possible\n // control flow path that it could've taken/been\n /* This code is broken for the following problems:\n * It thinks that assignments can only happen in scopes.\n * What about conditionals, if statements without block,\n * or guarded assignments.\n * It also checks to see if one of the assignments is in the\n * same scope and uses that as the only \"violation\". However,\n * the binding is returned by `getConstantViolationsBefore` so we for\n * sure always going to return that as the only \"violation\".\n let rawConstantViolations = constantViolations.reverse();\n let visitedScopes = [];\n constantViolations = [];\n for (let violation of (rawConstantViolations: Array)) {\n let violationScope = violation.scope;\n if (visitedScopes.indexOf(violationScope) >= 0) continue;\n\n visitedScopes.push(violationScope);\n constantViolations.push(violation);\n\n if (violationScope === path.scope) {\n constantViolations = [violation];\n break;\n }\n }*/\n\n // add back on function constant violations since we can't track calls\n constantViolations.push(...functionConstantViolations);\n\n // push on inferred types of violated paths\n for (const violation of constantViolations) {\n types.push(violation.getTypeAnnotation());\n }\n }\n\n if (!types.length) {\n return;\n }\n\n return createUnionType(types);\n}\n\nfunction getConstantViolationsBefore(\n binding: Binding,\n path: NodePath,\n functions?: NodePath[],\n) {\n const violations = binding.constantViolations.slice();\n violations.unshift(binding.path);\n return violations.filter(violation => {\n violation = violation.resolve();\n const status = violation._guessExecutionStatusRelativeTo(path);\n if (functions && status === \"unknown\") functions.push(violation);\n return status === \"before\";\n });\n}\n\nfunction inferAnnotationFromBinaryExpression(\n name: string,\n path: NodePath,\n) {\n const operator = path.node.operator;\n\n const right = path.get(\"right\").resolve();\n const left = path.get(\"left\").resolve();\n\n let target;\n if (left.isIdentifier({ name })) {\n target = right;\n } else if (right.isIdentifier({ name })) {\n target = left;\n }\n\n if (target) {\n if (operator === \"===\") {\n return target.getTypeAnnotation();\n }\n if (BOOLEAN_NUMBER_BINARY_OPERATORS.includes(operator)) {\n return numberTypeAnnotation();\n }\n\n return;\n }\n\n if (operator !== \"===\" && operator !== \"==\") return;\n\n let typeofPath: NodePath;\n let typePath: NodePath;\n if (left.isUnaryExpression({ operator: \"typeof\" })) {\n typeofPath = left;\n typePath = right as NodePath;\n } else if (right.isUnaryExpression({ operator: \"typeof\" })) {\n typeofPath = right;\n typePath = left as NodePath;\n }\n\n if (!typeofPath) return;\n // and that the argument of the typeof path references us!\n if (!typeofPath.get(\"argument\").isIdentifier({ name })) return;\n\n // ensure that the type path is a Literal\n typePath = typePath.resolve() as NodePath;\n if (!typePath.isLiteral()) return;\n\n // and that it's a string so we can infer it\n // @ts-expect-error todo(flow->ts): value is not defined for NullLiteral and some other\n const typeValue = typePath.node.value;\n if (typeof typeValue !== \"string\") return;\n\n // turn type value into a type annotation\n // @ts-expect-error todo(flow->ts): move validation from helper or relax type constraint to just a string\n return createTypeAnnotationBasedOnTypeof(typeValue);\n}\n\nfunction getParentConditionalPath(\n binding: Binding,\n path: NodePath,\n name: string,\n) {\n let parentPath;\n while ((parentPath = path.parentPath)) {\n if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) {\n if (path.key === \"test\") {\n return;\n }\n\n return parentPath as NodePath;\n }\n if (parentPath.isFunction()) {\n if (parentPath.parentPath.scope.getBinding(name) !== binding) return;\n }\n\n path = parentPath;\n }\n}\n\nfunction getConditionalAnnotation(\n binding: Binding,\n path: NodePath,\n name?: string,\n): {\n typeAnnotation: t.FlowType | t.TSType;\n ifStatement: NodePath;\n} {\n const ifStatement = getParentConditionalPath(binding, path, name);\n if (!ifStatement) return;\n\n const test = ifStatement.get(\"test\");\n const paths = [test];\n const types = [];\n\n for (let i = 0; i < paths.length; i++) {\n const path = paths[i];\n\n if (path.isLogicalExpression()) {\n if (path.node.operator === \"&&\") {\n paths.push(path.get(\"left\"));\n paths.push(path.get(\"right\"));\n }\n } else if (path.isBinaryExpression()) {\n const type = inferAnnotationFromBinaryExpression(name, path);\n if (type) types.push(type);\n }\n }\n\n if (types.length) {\n return {\n typeAnnotation: createUnionType(types),\n ifStatement,\n };\n }\n\n return getConditionalAnnotation(binding, ifStatement, name);\n}\n"],"mappings":";;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AASA,IAAAC,KAAA,GAAAD,OAAA;AAA4C;EAR1CE,+BAA+B;EAC/BC,iCAAiC;EACjCC,oBAAoB;EACpBC;AAAkB,IAAAN,EAAA;AAOL,SAAAO,SAAwCC,IAAkB,EAAE;EACzE,IAAI,CAAC,IAAI,CAACC,YAAY,CAAC,CAAC,EAAE;EAI1B,MAAMC,OAAO,GAAG,IAAI,CAACC,KAAK,CAACC,UAAU,CAACJ,IAAI,CAACK,IAAI,CAAC;EAChD,IAAIH,OAAO,EAAE;IACX,IAAIA,OAAO,CAACI,UAAU,CAACC,cAAc,EAAE;MACrC,OAAOL,OAAO,CAACI,UAAU,CAACC,cAAc;IAC1C,CAAC,MAAM;MACL,OAAOC,0CAA0C,CAC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Ac,EAAE,IAAAiB,qBAAe,EAACd,KAAK,CAAC;MACtCO;IACF,CAAC;EACH;EAEA,OAAOF,wBAAwB,CAACb,OAAO,EAAEe,WAAW,EAAEZ,IAAI,CAAC;AAC7D","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/traverse/lib/path/inference/inferers.js b/node_modules/@babel/traverse/lib/path/inference/inferers.js
new file mode 100644
index 00000000..a0124999
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/inference/inferers.js
@@ -0,0 +1,207 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.ArrayExpression = ArrayExpression;
+exports.AssignmentExpression = AssignmentExpression;
+exports.BinaryExpression = BinaryExpression;
+exports.BooleanLiteral = BooleanLiteral;
+exports.CallExpression = CallExpression;
+exports.ConditionalExpression = ConditionalExpression;
+exports.ClassDeclaration = exports.ClassExpression = exports.FunctionDeclaration = exports.ArrowFunctionExpression = exports.FunctionExpression = Func;
+Object.defineProperty(exports, "Identifier", {
+ enumerable: true,
+ get: function () {
+ return _infererReference.default;
+ }
+});
+exports.LogicalExpression = LogicalExpression;
+exports.NewExpression = NewExpression;
+exports.NullLiteral = NullLiteral;
+exports.NumericLiteral = NumericLiteral;
+exports.ObjectExpression = ObjectExpression;
+exports.ParenthesizedExpression = ParenthesizedExpression;
+exports.RegExpLiteral = RegExpLiteral;
+exports.RestElement = RestElement;
+exports.SequenceExpression = SequenceExpression;
+exports.StringLiteral = StringLiteral;
+exports.TSAsExpression = TSAsExpression;
+exports.TSNonNullExpression = TSNonNullExpression;
+exports.TaggedTemplateExpression = TaggedTemplateExpression;
+exports.TemplateLiteral = TemplateLiteral;
+exports.TypeCastExpression = TypeCastExpression;
+exports.UnaryExpression = UnaryExpression;
+exports.UpdateExpression = UpdateExpression;
+exports.VariableDeclarator = VariableDeclarator;
+var _t = require("@babel/types");
+var _infererReference = require("./inferer-reference.js");
+var _util = require("./util.js");
+const {
+ BOOLEAN_BINARY_OPERATORS,
+ BOOLEAN_UNARY_OPERATORS,
+ NUMBER_BINARY_OPERATORS,
+ NUMBER_UNARY_OPERATORS,
+ STRING_UNARY_OPERATORS,
+ anyTypeAnnotation,
+ arrayTypeAnnotation,
+ booleanTypeAnnotation,
+ buildMatchMemberExpression,
+ genericTypeAnnotation,
+ identifier,
+ nullLiteralTypeAnnotation,
+ numberTypeAnnotation,
+ stringTypeAnnotation,
+ tupleTypeAnnotation,
+ unionTypeAnnotation,
+ voidTypeAnnotation,
+ isIdentifier
+} = _t;
+function VariableDeclarator() {
+ if (!this.get("id").isIdentifier()) return;
+ return this.get("init").getTypeAnnotation();
+}
+function TypeCastExpression(node) {
+ return node.typeAnnotation;
+}
+TypeCastExpression.validParent = true;
+function TSAsExpression(node) {
+ return node.typeAnnotation;
+}
+TSAsExpression.validParent = true;
+function TSNonNullExpression() {
+ return this.get("expression").getTypeAnnotation();
+}
+function NewExpression(node) {
+ if (node.callee.type === "Identifier") {
+ return genericTypeAnnotation(node.callee);
+ }
+}
+function TemplateLiteral() {
+ return stringTypeAnnotation();
+}
+function UnaryExpression(node) {
+ const operator = node.operator;
+ if (operator === "void") {
+ return voidTypeAnnotation();
+ } else if (NUMBER_UNARY_OPERATORS.includes(operator)) {
+ return numberTypeAnnotation();
+ } else if (STRING_UNARY_OPERATORS.includes(operator)) {
+ return stringTypeAnnotation();
+ } else if (BOOLEAN_UNARY_OPERATORS.includes(operator)) {
+ return booleanTypeAnnotation();
+ }
+}
+function BinaryExpression(node) {
+ const operator = node.operator;
+ if (NUMBER_BINARY_OPERATORS.includes(operator)) {
+ return numberTypeAnnotation();
+ } else if (BOOLEAN_BINARY_OPERATORS.includes(operator)) {
+ return booleanTypeAnnotation();
+ } else if (operator === "+") {
+ const right = this.get("right");
+ const left = this.get("left");
+ if (left.isBaseType("number") && right.isBaseType("number")) {
+ return numberTypeAnnotation();
+ } else if (left.isBaseType("string") || right.isBaseType("string")) {
+ return stringTypeAnnotation();
+ }
+ return unionTypeAnnotation([stringTypeAnnotation(), numberTypeAnnotation()]);
+ }
+}
+function LogicalExpression() {
+ const argumentTypes = [this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()];
+ return (0, _util.createUnionType)(argumentTypes);
+}
+function ConditionalExpression() {
+ const argumentTypes = [this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()];
+ return (0, _util.createUnionType)(argumentTypes);
+}
+function SequenceExpression() {
+ return this.get("expressions").pop().getTypeAnnotation();
+}
+function ParenthesizedExpression() {
+ return this.get("expression").getTypeAnnotation();
+}
+function AssignmentExpression() {
+ return this.get("right").getTypeAnnotation();
+}
+function UpdateExpression(node) {
+ const operator = node.operator;
+ if (operator === "++" || operator === "--") {
+ return numberTypeAnnotation();
+ }
+}
+function StringLiteral() {
+ return stringTypeAnnotation();
+}
+function NumericLiteral() {
+ return numberTypeAnnotation();
+}
+function BooleanLiteral() {
+ return booleanTypeAnnotation();
+}
+function NullLiteral() {
+ return nullLiteralTypeAnnotation();
+}
+function RegExpLiteral() {
+ return genericTypeAnnotation(identifier("RegExp"));
+}
+function ObjectExpression() {
+ return genericTypeAnnotation(identifier("Object"));
+}
+function ArrayExpression() {
+ return genericTypeAnnotation(identifier("Array"));
+}
+function RestElement() {
+ return ArrayExpression();
+}
+RestElement.validParent = true;
+function Func() {
+ return genericTypeAnnotation(identifier("Function"));
+}
+const isArrayFrom = buildMatchMemberExpression("Array.from");
+const isObjectKeys = buildMatchMemberExpression("Object.keys");
+const isObjectValues = buildMatchMemberExpression("Object.values");
+const isObjectEntries = buildMatchMemberExpression("Object.entries");
+function CallExpression() {
+ const {
+ callee
+ } = this.node;
+ if (isObjectKeys(callee)) {
+ return arrayTypeAnnotation(stringTypeAnnotation());
+ } else if (isArrayFrom(callee) || isObjectValues(callee) || isIdentifier(callee, {
+ name: "Array"
+ })) {
+ return arrayTypeAnnotation(anyTypeAnnotation());
+ } else if (isObjectEntries(callee)) {
+ return arrayTypeAnnotation(tupleTypeAnnotation([stringTypeAnnotation(), anyTypeAnnotation()]));
+ }
+ return resolveCall(this.get("callee"));
+}
+function TaggedTemplateExpression() {
+ return resolveCall(this.get("tag"));
+}
+function resolveCall(callee) {
+ callee = callee.resolve();
+ if (callee.isFunction()) {
+ const {
+ node
+ } = callee;
+ if (node.async) {
+ if (node.generator) {
+ return genericTypeAnnotation(identifier("AsyncIterator"));
+ } else {
+ return genericTypeAnnotation(identifier("Promise"));
+ }
+ } else {
+ if (node.generator) {
+ return genericTypeAnnotation(identifier("Iterator"));
+ } else if (callee.node.returnType) {
+ return callee.node.returnType;
+ } else {}
+ }
+ }
+}
+
+//# sourceMappingURL=inferers.js.map
diff --git a/node_modules/@babel/traverse/lib/path/inference/inferers.js.map b/node_modules/@babel/traverse/lib/path/inference/inferers.js.map
new file mode 100644
index 00000000..656ab3b8
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/inference/inferers.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["_t","require","_infererReference","_util","BOOLEAN_BINARY_OPERATORS","BOOLEAN_UNARY_OPERATORS","NUMBER_BINARY_OPERATORS","NUMBER_UNARY_OPERATORS","STRING_UNARY_OPERATORS","anyTypeAnnotation","arrayTypeAnnotation","booleanTypeAnnotation","buildMatchMemberExpression","genericTypeAnnotation","identifier","nullLiteralTypeAnnotation","numberTypeAnnotation","stringTypeAnnotation","tupleTypeAnnotation","unionTypeAnnotation","voidTypeAnnotation","isIdentifier","VariableDeclarator","get","getTypeAnnotation","TypeCastExpression","node","typeAnnotation","validParent","TSAsExpression","TSNonNullExpression","NewExpression","callee","type","TemplateLiteral","UnaryExpression","operator","includes","BinaryExpression","right","left","isBaseType","LogicalExpression","argumentTypes","createUnionType","ConditionalExpression","SequenceExpression","pop","ParenthesizedExpression","AssignmentExpression","UpdateExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","ObjectExpression","ArrayExpression","RestElement","Func","isArrayFrom","isObjectKeys","isObjectValues","isObjectEntries","CallExpression","name","resolveCall","TaggedTemplateExpression","resolve","isFunction","async","generator","returnType"],"sources":["../../../src/path/inference/inferers.ts"],"sourcesContent":["import {\n BOOLEAN_BINARY_OPERATORS,\n BOOLEAN_UNARY_OPERATORS,\n NUMBER_BINARY_OPERATORS,\n NUMBER_UNARY_OPERATORS,\n STRING_UNARY_OPERATORS,\n anyTypeAnnotation,\n arrayTypeAnnotation,\n booleanTypeAnnotation,\n buildMatchMemberExpression,\n genericTypeAnnotation,\n identifier,\n nullLiteralTypeAnnotation,\n numberTypeAnnotation,\n stringTypeAnnotation,\n tupleTypeAnnotation,\n unionTypeAnnotation,\n voidTypeAnnotation,\n isIdentifier,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nexport { default as Identifier } from \"./inferer-reference.ts\";\n\nimport { createUnionType } from \"./util.ts\";\nimport type NodePath from \"../index.ts\";\n\nexport function VariableDeclarator(this: NodePath) {\n if (!this.get(\"id\").isIdentifier()) return;\n return this.get(\"init\").getTypeAnnotation();\n}\n\nexport function TypeCastExpression(node: t.TypeCastExpression) {\n return node.typeAnnotation;\n}\n\nTypeCastExpression.validParent = true;\n\nexport function TSAsExpression(node: t.TSAsExpression) {\n return node.typeAnnotation;\n}\n\nTSAsExpression.validParent = true;\n\nexport function TSNonNullExpression(this: NodePath) {\n return this.get(\"expression\").getTypeAnnotation();\n}\n\nexport function NewExpression(\n this: NodePath,\n node: t.NewExpression,\n) {\n if (node.callee.type === \"Identifier\") {\n // only resolve identifier callee\n return genericTypeAnnotation(node.callee);\n }\n}\n\nexport function TemplateLiteral() {\n return stringTypeAnnotation();\n}\n\nexport function UnaryExpression(node: t.UnaryExpression) {\n const operator = node.operator;\n\n if (operator === \"void\") {\n return voidTypeAnnotation();\n } else if (NUMBER_UNARY_OPERATORS.includes(operator)) {\n return numberTypeAnnotation();\n } else if (STRING_UNARY_OPERATORS.includes(operator)) {\n return stringTypeAnnotation();\n } else if (BOOLEAN_UNARY_OPERATORS.includes(operator)) {\n return booleanTypeAnnotation();\n }\n}\n\nexport function BinaryExpression(\n this: NodePath,\n node: t.BinaryExpression,\n) {\n const operator = node.operator;\n\n if (NUMBER_BINARY_OPERATORS.includes(operator)) {\n return numberTypeAnnotation();\n } else if (BOOLEAN_BINARY_OPERATORS.includes(operator)) {\n return booleanTypeAnnotation();\n } else if (operator === \"+\") {\n const right = this.get(\"right\");\n const left = this.get(\"left\");\n\n if (left.isBaseType(\"number\") && right.isBaseType(\"number\")) {\n // both numbers so this will be a number\n return numberTypeAnnotation();\n } else if (left.isBaseType(\"string\") || right.isBaseType(\"string\")) {\n // one is a string so the result will be a string\n return stringTypeAnnotation();\n }\n\n // unsure if left and right are strings or numbers so stay on the safe side\n return unionTypeAnnotation([\n stringTypeAnnotation(),\n numberTypeAnnotation(),\n ]);\n }\n}\n\nexport function LogicalExpression(this: NodePath) {\n const argumentTypes = [\n this.get(\"left\").getTypeAnnotation(),\n this.get(\"right\").getTypeAnnotation(),\n ];\n\n return createUnionType(argumentTypes);\n}\n\nexport function ConditionalExpression(this: NodePath) {\n const argumentTypes = [\n this.get(\"consequent\").getTypeAnnotation(),\n this.get(\"alternate\").getTypeAnnotation(),\n ];\n\n return createUnionType(argumentTypes);\n}\n\nexport function SequenceExpression(this: NodePath) {\n return this.get(\"expressions\").pop().getTypeAnnotation();\n}\n\nexport function ParenthesizedExpression(\n this: NodePath,\n) {\n return this.get(\"expression\").getTypeAnnotation();\n}\n\nexport function AssignmentExpression(this: NodePath) {\n return this.get(\"right\").getTypeAnnotation();\n}\n\nexport function UpdateExpression(\n this: NodePath,\n node: t.UpdateExpression,\n) {\n const operator = node.operator;\n if (operator === \"++\" || operator === \"--\") {\n return numberTypeAnnotation();\n }\n}\n\nexport function StringLiteral() {\n return stringTypeAnnotation();\n}\n\nexport function NumericLiteral() {\n return numberTypeAnnotation();\n}\n\nexport function BooleanLiteral() {\n return booleanTypeAnnotation();\n}\n\nexport function NullLiteral() {\n return nullLiteralTypeAnnotation();\n}\n\nexport function RegExpLiteral() {\n return genericTypeAnnotation(identifier(\"RegExp\"));\n}\n\nexport function ObjectExpression() {\n return genericTypeAnnotation(identifier(\"Object\"));\n}\n\nexport function ArrayExpression() {\n return genericTypeAnnotation(identifier(\"Array\"));\n}\n\nexport function RestElement() {\n return ArrayExpression();\n}\n\nRestElement.validParent = true;\n\nfunction Func() {\n return genericTypeAnnotation(identifier(\"Function\"));\n}\n\nexport {\n Func as FunctionExpression,\n Func as ArrowFunctionExpression,\n Func as FunctionDeclaration,\n Func as ClassExpression,\n Func as ClassDeclaration,\n};\n\nconst isArrayFrom = buildMatchMemberExpression(\"Array.from\");\nconst isObjectKeys = buildMatchMemberExpression(\"Object.keys\");\nconst isObjectValues = buildMatchMemberExpression(\"Object.values\");\nconst isObjectEntries = buildMatchMemberExpression(\"Object.entries\");\nexport function CallExpression(this: NodePath) {\n const { callee } = this.node;\n if (isObjectKeys(callee)) {\n return arrayTypeAnnotation(stringTypeAnnotation());\n } else if (\n isArrayFrom(callee) ||\n isObjectValues(callee) ||\n // Detect \"var foo = Array()\" calls so we can optimize for arrays vs iterables.\n isIdentifier(callee, { name: \"Array\" })\n ) {\n return arrayTypeAnnotation(anyTypeAnnotation());\n } else if (isObjectEntries(callee)) {\n return arrayTypeAnnotation(\n tupleTypeAnnotation([stringTypeAnnotation(), anyTypeAnnotation()]),\n );\n }\n\n return resolveCall(this.get(\"callee\"));\n}\n\nexport function TaggedTemplateExpression(\n this: NodePath,\n) {\n return resolveCall(this.get(\"tag\"));\n}\n\nfunction resolveCall(callee: NodePath) {\n callee = callee.resolve();\n\n if (callee.isFunction()) {\n const { node } = callee;\n if (node.async) {\n if (node.generator) {\n return genericTypeAnnotation(identifier(\"AsyncIterator\"));\n } else {\n return genericTypeAnnotation(identifier(\"Promise\"));\n }\n } else {\n if (node.generator) {\n return genericTypeAnnotation(identifier(\"Iterator\"));\n } else if (callee.node.returnType) {\n return callee.node.returnType;\n } else {\n // todo: get union type of all return arguments\n }\n }\n }\n}\n"],"mappings":";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C,MAAM,CAACN,IAAI,CAAC8C,UAAU;MAC/B,CAAC,MAAM,CAEP;IACF;EACF;AACF","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/traverse/lib/path/inference/util.js b/node_modules/@babel/traverse/lib/path/inference/util.js
new file mode 100644
index 00000000..6cc43124
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/inference/util.js
@@ -0,0 +1,30 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.createUnionType = createUnionType;
+var _t = require("@babel/types");
+const {
+ createFlowUnionType,
+ createTSUnionType,
+ createUnionTypeAnnotation,
+ isFlowType,
+ isTSType
+} = _t;
+function createUnionType(types) {
+ {
+ if (types.every(v => isFlowType(v))) {
+ if (createFlowUnionType) {
+ return createFlowUnionType(types);
+ }
+ return createUnionTypeAnnotation(types);
+ } else if (types.every(v => isTSType(v))) {
+ if (createTSUnionType) {
+ return createTSUnionType(types);
+ }
+ }
+ }
+}
+
+//# sourceMappingURL=util.js.map
diff --git a/node_modules/@babel/traverse/lib/path/inference/util.js.map b/node_modules/@babel/traverse/lib/path/inference/util.js.map
new file mode 100644
index 00000000..7d36f7cf
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/inference/util.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["_t","require","createFlowUnionType","createTSUnionType","createUnionTypeAnnotation","isFlowType","isTSType","createUnionType","types","every","v"],"sources":["../../../src/path/inference/util.ts"],"sourcesContent":["import {\n createFlowUnionType,\n createTSUnionType,\n createUnionTypeAnnotation,\n isFlowType,\n isTSType,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nexport function createUnionType(\n types: (t.FlowType | t.TSType)[],\n): t.FlowType | t.TSType | undefined {\n if (process.env.BABEL_8_BREAKING) {\n if (types.every(v => isFlowType(v))) {\n return createFlowUnionType(types);\n }\n if (types.every(v => isTSType(v))) {\n return createTSUnionType(types);\n }\n } else {\n if (types.every(v => isFlowType(v))) {\n if (createFlowUnionType) {\n return createFlowUnionType(types);\n }\n\n return createUnionTypeAnnotation(types);\n } else if (types.every(v => isTSType(v))) {\n if (createTSUnionType) {\n return createTSUnionType(types);\n }\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAMsB;EALpBC,mBAAmB;EACnBC,iBAAiB;EACjBC,yBAAyB;EACzBC,UAAU;EACVC;AAAQ,IAAAN,EAAA;AAIH,SAASO,eAAeA,CAC7BC,KAAgC,EACG;EAQ5B;IACL,IAAIA,KAAK,CAACC,KAAK,CAACC,CAAC,IAAIL,UAAU,CAACK,CAAC,CAAC,CAAC,EAAE;MACnC,IAAIR,mBAAmB,EAAE;QACvB,OAAOA,mBAAmB,CAACM,KAAK,CAAC;MACnC;MAEA,OAAOJ,yBAAyB,CAACI,KAAK,CAAC;IACzC,CAAC,MAAM,IAAIA,KAAK,CAACC,KAAK,CAACC,CAAC,IAAIJ,QAAQ,CAACI,CAAC,CAAC,CAAC,EAAE;MACxC,IAAIP,iBAAiB,EAAE;QACrB,OAAOA,iBAAiB,CAACK,KAAK,CAAC;MACjC;IACF;EACF;AACF","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/traverse/lib/path/introspection.js b/node_modules/@babel/traverse/lib/path/introspection.js
new file mode 100644
index 00000000..e93187a0
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/introspection.js
@@ -0,0 +1,398 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo;
+exports._resolve = _resolve;
+exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression;
+exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement;
+exports.getSource = getSource;
+exports.isCompletionRecord = isCompletionRecord;
+exports.isConstantExpression = isConstantExpression;
+exports.isInStrictMode = isInStrictMode;
+exports.isNodeType = isNodeType;
+exports.isStatementOrBlock = isStatementOrBlock;
+exports.isStatic = isStatic;
+exports.matchesPattern = matchesPattern;
+exports.referencesImport = referencesImport;
+exports.resolve = resolve;
+exports.willIMaybeExecuteBefore = willIMaybeExecuteBefore;
+var _t = require("@babel/types");
+const {
+ STATEMENT_OR_BLOCK_KEYS,
+ VISITOR_KEYS,
+ isBlockStatement,
+ isExpression,
+ isIdentifier,
+ isLiteral,
+ isStringLiteral,
+ isType,
+ matchesPattern: _matchesPattern
+} = _t;
+function matchesPattern(pattern, allowPartial) {
+ return _matchesPattern(this.node, pattern, allowPartial);
+}
+{
+ exports.has = function has(key) {
+ var _this$node;
+ const val = (_this$node = this.node) == null ? void 0 : _this$node[key];
+ if (val && Array.isArray(val)) {
+ return !!val.length;
+ } else {
+ return !!val;
+ }
+ };
+}
+function isStatic() {
+ return this.scope.isStatic(this.node);
+}
+{
+ exports.is = exports.has;
+ exports.isnt = function isnt(key) {
+ return !this.has(key);
+ };
+ exports.equals = function equals(key, value) {
+ return this.node[key] === value;
+ };
+}
+function isNodeType(type) {
+ return isType(this.type, type);
+}
+function canHaveVariableDeclarationOrExpression() {
+ return (this.key === "init" || this.key === "left") && this.parentPath.isFor();
+}
+function canSwapBetweenExpressionAndStatement(replacement) {
+ if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) {
+ return false;
+ }
+ if (this.isExpression()) {
+ return isBlockStatement(replacement);
+ } else if (this.isBlockStatement()) {
+ return isExpression(replacement);
+ }
+ return false;
+}
+function isCompletionRecord(allowInsideFunction) {
+ let path = this;
+ let first = true;
+ do {
+ const {
+ type,
+ container
+ } = path;
+ if (!first && (path.isFunction() || type === "StaticBlock")) {
+ return !!allowInsideFunction;
+ }
+ first = false;
+ if (Array.isArray(container) && path.key !== container.length - 1) {
+ return false;
+ }
+ } while ((path = path.parentPath) && !path.isProgram() && !path.isDoExpression());
+ return true;
+}
+function isStatementOrBlock() {
+ if (this.parentPath.isLabeledStatement() || isBlockStatement(this.container)) {
+ return false;
+ } else {
+ return STATEMENT_OR_BLOCK_KEYS.includes(this.key);
+ }
+}
+function referencesImport(moduleSource, importName) {
+ if (!this.isReferencedIdentifier()) {
+ if (this.isJSXMemberExpression() && this.node.property.name === importName || (this.isMemberExpression() || this.isOptionalMemberExpression()) && (this.node.computed ? isStringLiteral(this.node.property, {
+ value: importName
+ }) : this.node.property.name === importName)) {
+ const object = this.get("object");
+ return object.isReferencedIdentifier() && object.referencesImport(moduleSource, "*");
+ }
+ return false;
+ }
+ const binding = this.scope.getBinding(this.node.name);
+ if (!binding || binding.kind !== "module") return false;
+ const path = binding.path;
+ const parent = path.parentPath;
+ if (!parent.isImportDeclaration()) return false;
+ if (parent.node.source.value === moduleSource) {
+ if (!importName) return true;
+ } else {
+ return false;
+ }
+ if (path.isImportDefaultSpecifier() && importName === "default") {
+ return true;
+ }
+ if (path.isImportNamespaceSpecifier() && importName === "*") {
+ return true;
+ }
+ if (path.isImportSpecifier() && isIdentifier(path.node.imported, {
+ name: importName
+ })) {
+ return true;
+ }
+ return false;
+}
+function getSource() {
+ const node = this.node;
+ if (node.end) {
+ const code = this.hub.getCode();
+ if (code) return code.slice(node.start, node.end);
+ }
+ return "";
+}
+function willIMaybeExecuteBefore(target) {
+ return this._guessExecutionStatusRelativeTo(target) !== "after";
+}
+function getOuterFunction(path) {
+ return path.isProgram() ? path : (path.parentPath.scope.getFunctionParent() || path.parentPath.scope.getProgramParent()).path;
+}
+function isExecutionUncertain(type, key) {
+ switch (type) {
+ case "LogicalExpression":
+ return key === "right";
+ case "ConditionalExpression":
+ case "IfStatement":
+ return key === "consequent" || key === "alternate";
+ case "WhileStatement":
+ case "DoWhileStatement":
+ case "ForInStatement":
+ case "ForOfStatement":
+ return key === "body";
+ case "ForStatement":
+ return key === "body" || key === "update";
+ case "SwitchStatement":
+ return key === "cases";
+ case "TryStatement":
+ return key === "handler";
+ case "AssignmentPattern":
+ return key === "right";
+ case "OptionalMemberExpression":
+ return key === "property";
+ case "OptionalCallExpression":
+ return key === "arguments";
+ default:
+ return false;
+ }
+}
+function isExecutionUncertainInList(paths, maxIndex) {
+ for (let i = 0; i < maxIndex; i++) {
+ const path = paths[i];
+ if (isExecutionUncertain(path.parent.type, path.parentKey)) {
+ return true;
+ }
+ }
+ return false;
+}
+const SYMBOL_CHECKING = Symbol();
+function _guessExecutionStatusRelativeTo(target) {
+ return _guessExecutionStatusRelativeToCached(this, target, new Map());
+}
+function _guessExecutionStatusRelativeToCached(base, target, cache) {
+ const funcParent = {
+ this: getOuterFunction(base),
+ target: getOuterFunction(target)
+ };
+ if (funcParent.target.node !== funcParent.this.node) {
+ return _guessExecutionStatusRelativeToDifferentFunctionsCached(base, funcParent.target, cache);
+ }
+ const paths = {
+ target: target.getAncestry(),
+ this: base.getAncestry()
+ };
+ if (paths.target.includes(base)) return "after";
+ if (paths.this.includes(target)) return "before";
+ let commonPath;
+ const commonIndex = {
+ target: 0,
+ this: 0
+ };
+ while (!commonPath && commonIndex.this < paths.this.length) {
+ const path = paths.this[commonIndex.this];
+ commonIndex.target = paths.target.indexOf(path);
+ if (commonIndex.target >= 0) {
+ commonPath = path;
+ } else {
+ commonIndex.this++;
+ }
+ }
+ if (!commonPath) {
+ throw new Error("Internal Babel error - The two compared nodes" + " don't appear to belong to the same program.");
+ }
+ if (isExecutionUncertainInList(paths.this, commonIndex.this - 1) || isExecutionUncertainInList(paths.target, commonIndex.target - 1)) {
+ return "unknown";
+ }
+ const divergence = {
+ this: paths.this[commonIndex.this - 1],
+ target: paths.target[commonIndex.target - 1]
+ };
+ if (divergence.target.listKey && divergence.this.listKey && divergence.target.container === divergence.this.container) {
+ return divergence.target.key > divergence.this.key ? "before" : "after";
+ }
+ const keys = VISITOR_KEYS[commonPath.type];
+ const keyPosition = {
+ this: keys.indexOf(divergence.this.parentKey),
+ target: keys.indexOf(divergence.target.parentKey)
+ };
+ return keyPosition.target > keyPosition.this ? "before" : "after";
+}
+function _guessExecutionStatusRelativeToDifferentFunctionsInternal(base, target, cache) {
+ if (!target.isFunctionDeclaration()) {
+ if (_guessExecutionStatusRelativeToCached(base, target, cache) === "before") {
+ return "before";
+ }
+ return "unknown";
+ } else if (target.parentPath.isExportDeclaration()) {
+ return "unknown";
+ }
+ const binding = target.scope.getBinding(target.node.id.name);
+ if (!binding.references) return "before";
+ const referencePaths = binding.referencePaths;
+ let allStatus;
+ for (const path of referencePaths) {
+ const childOfFunction = !!path.find(path => path.node === target.node);
+ if (childOfFunction) continue;
+ if (path.key !== "callee" || !path.parentPath.isCallExpression()) {
+ return "unknown";
+ }
+ const status = _guessExecutionStatusRelativeToCached(base, path, cache);
+ if (allStatus && allStatus !== status) {
+ return "unknown";
+ } else {
+ allStatus = status;
+ }
+ }
+ return allStatus;
+}
+function _guessExecutionStatusRelativeToDifferentFunctionsCached(base, target, cache) {
+ let nodeMap = cache.get(base.node);
+ let cached;
+ if (!nodeMap) {
+ cache.set(base.node, nodeMap = new Map());
+ } else if (cached = nodeMap.get(target.node)) {
+ if (cached === SYMBOL_CHECKING) {
+ return "unknown";
+ }
+ return cached;
+ }
+ nodeMap.set(target.node, SYMBOL_CHECKING);
+ const result = _guessExecutionStatusRelativeToDifferentFunctionsInternal(base, target, cache);
+ nodeMap.set(target.node, result);
+ return result;
+}
+function resolve(dangerous, resolved) {
+ return _resolve.call(this, dangerous, resolved) || this;
+}
+function _resolve(dangerous, resolved) {
+ var _resolved;
+ if ((_resolved = resolved) != null && _resolved.includes(this)) return;
+ resolved = resolved || [];
+ resolved.push(this);
+ if (this.isVariableDeclarator()) {
+ if (this.get("id").isIdentifier()) {
+ return this.get("init").resolve(dangerous, resolved);
+ } else {}
+ } else if (this.isReferencedIdentifier()) {
+ const binding = this.scope.getBinding(this.node.name);
+ if (!binding) return;
+ if (!binding.constant) return;
+ if (binding.kind === "module") return;
+ if (binding.path !== this) {
+ const ret = binding.path.resolve(dangerous, resolved);
+ if (this.find(parent => parent.node === ret.node)) return;
+ return ret;
+ }
+ } else if (this.isTypeCastExpression()) {
+ return this.get("expression").resolve(dangerous, resolved);
+ } else if (dangerous && this.isMemberExpression()) {
+ const targetKey = this.toComputedKey();
+ if (!isLiteral(targetKey)) return;
+ const targetName = targetKey.value;
+ const target = this.get("object").resolve(dangerous, resolved);
+ if (target.isObjectExpression()) {
+ const props = target.get("properties");
+ for (const prop of props) {
+ if (!prop.isProperty()) continue;
+ const key = prop.get("key");
+ let match = prop.isnt("computed") && key.isIdentifier({
+ name: targetName
+ });
+ match = match || key.isLiteral({
+ value: targetName
+ });
+ if (match) return prop.get("value").resolve(dangerous, resolved);
+ }
+ } else if (target.isArrayExpression() && !isNaN(+targetName)) {
+ const elems = target.get("elements");
+ const elem = elems[targetName];
+ if (elem) return elem.resolve(dangerous, resolved);
+ }
+ }
+}
+function isConstantExpression() {
+ if (this.isIdentifier()) {
+ const binding = this.scope.getBinding(this.node.name);
+ if (!binding) return false;
+ return binding.constant;
+ }
+ if (this.isLiteral()) {
+ if (this.isRegExpLiteral()) {
+ return false;
+ }
+ if (this.isTemplateLiteral()) {
+ return this.get("expressions").every(expression => expression.isConstantExpression());
+ }
+ return true;
+ }
+ if (this.isUnaryExpression()) {
+ if (this.node.operator !== "void") {
+ return false;
+ }
+ return this.get("argument").isConstantExpression();
+ }
+ if (this.isBinaryExpression()) {
+ const {
+ operator
+ } = this.node;
+ return operator !== "in" && operator !== "instanceof" && this.get("left").isConstantExpression() && this.get("right").isConstantExpression();
+ }
+ if (this.isMemberExpression()) {
+ return !this.node.computed && this.get("object").isIdentifier({
+ name: "Symbol"
+ }) && !this.scope.hasBinding("Symbol", {
+ noGlobals: true
+ });
+ }
+ if (this.isCallExpression()) {
+ return this.node.arguments.length === 1 && this.get("callee").matchesPattern("Symbol.for") && !this.scope.hasBinding("Symbol", {
+ noGlobals: true
+ }) && this.get("arguments")[0].isStringLiteral();
+ }
+ return false;
+}
+function isInStrictMode() {
+ const start = this.isProgram() ? this : this.parentPath;
+ const strictParent = start.find(path => {
+ if (path.isProgram({
+ sourceType: "module"
+ })) return true;
+ if (path.isClass()) return true;
+ if (path.isArrowFunctionExpression() && !path.get("body").isBlockStatement()) {
+ return false;
+ }
+ let body;
+ if (path.isFunction()) {
+ body = path.node.body;
+ } else if (path.isProgram()) {
+ body = path.node;
+ } else {
+ return false;
+ }
+ for (const directive of body.directives) {
+ if (directive.value.value === "use strict") {
+ return true;
+ }
+ }
+ });
+ return !!strictParent;
+}
+
+//# sourceMappingURL=introspection.js.map
diff --git a/node_modules/@babel/traverse/lib/path/introspection.js.map b/node_modules/@babel/traverse/lib/path/introspection.js.map
new file mode 100644
index 00000000..e641d42a
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/introspection.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["_t","require","STATEMENT_OR_BLOCK_KEYS","VISITOR_KEYS","isBlockStatement","isExpression","isIdentifier","isLiteral","isStringLiteral","isType","matchesPattern","_matchesPattern","pattern","allowPartial","node","exports","has","key","_this$node","val","Array","isArray","length","isStatic","scope","is","isnt","equals","value","isNodeType","type","canHaveVariableDeclarationOrExpression","parentPath","isFor","canSwapBetweenExpressionAndStatement","replacement","isArrowFunctionExpression","isCompletionRecord","allowInsideFunction","path","first","container","isFunction","isProgram","isDoExpression","isStatementOrBlock","isLabeledStatement","includes","referencesImport","moduleSource","importName","isReferencedIdentifier","isJSXMemberExpression","property","name","isMemberExpression","isOptionalMemberExpression","computed","object","get","binding","getBinding","kind","parent","isImportDeclaration","source","isImportDefaultSpecifier","isImportNamespaceSpecifier","isImportSpecifier","imported","getSource","end","code","hub","getCode","slice","start","willIMaybeExecuteBefore","target","_guessExecutionStatusRelativeTo","getOuterFunction","getFunctionParent","getProgramParent","isExecutionUncertain","isExecutionUncertainInList","paths","maxIndex","i","parentKey","SYMBOL_CHECKING","Symbol","_guessExecutionStatusRelativeToCached","Map","base","cache","funcParent","this","_guessExecutionStatusRelativeToDifferentFunctionsCached","getAncestry","commonPath","commonIndex","indexOf","Error","divergence","listKey","keys","keyPosition","_guessExecutionStatusRelativeToDifferentFunctionsInternal","isFunctionDeclaration","isExportDeclaration","id","references","referencePaths","allStatus","childOfFunction","find","isCallExpression","status","nodeMap","cached","set","result","resolve","dangerous","resolved","_resolve","call","_resolved","push","isVariableDeclarator","constant","ret","isTypeCastExpression","targetKey","toComputedKey","targetName","isObjectExpression","props","prop","isProperty","match","isArrayExpression","isNaN","elems","elem","isConstantExpression","isRegExpLiteral","isTemplateLiteral","every","expression","isUnaryExpression","operator","isBinaryExpression","hasBinding","noGlobals","arguments","isInStrictMode","strictParent","sourceType","isClass","body","directive","directives"],"sources":["../../src/path/introspection.ts"],"sourcesContent":["// This file contains methods responsible for introspecting the current path for certain values.\n\nimport type NodePath from \"./index.ts\";\nimport {\n STATEMENT_OR_BLOCK_KEYS,\n VISITOR_KEYS,\n isBlockStatement,\n isExpression,\n isIdentifier,\n isLiteral,\n isStringLiteral,\n isType,\n matchesPattern as _matchesPattern,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\n/**\n * Match the current node if it matches the provided `pattern`.\n *\n * For example, given the match `React.createClass` it would match the\n * parsed nodes of `React.createClass` and `React[\"createClass\"]`.\n */\n\nexport function matchesPattern(\n this: NodePath,\n pattern: string,\n allowPartial?: boolean,\n): boolean {\n return _matchesPattern(this.node, pattern, allowPartial);\n}\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n /**\n * Check whether we have the input `key`. If the `key` references an array then we check\n * if the array has any items, otherwise we just check if it's falsy.\n */\n // eslint-disable-next-line no-restricted-globals\n exports.has = function has(\n this: NodePath,\n key: keyof N,\n ): boolean {\n const val = (this.node as N)?.[key];\n if (val && Array.isArray(val)) {\n return !!val.length;\n } else {\n return !!val;\n }\n };\n}\n\nexport function isStatic(this: NodePath): boolean {\n return this.scope.isStatic(this.node);\n}\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n /**\n * Alias of `has`.\n */\n // eslint-disable-next-line no-restricted-globals\n exports.is = exports.has;\n\n /**\n * Opposite of `has`.\n */\n // eslint-disable-next-line no-restricted-globals\n exports.isnt = function isnt(\n this: NodePath,\n key: keyof N,\n ): boolean {\n // @ts-expect-error Babel 7\n return !this.has(key);\n };\n\n /**\n * Check whether the path node `key` strict equals `value`.\n */\n // eslint-disable-next-line no-restricted-globals\n exports.equals = function equals(\n this: NodePath,\n key: keyof N,\n value: any,\n ): boolean {\n return (this.node as N)[key] === value;\n };\n}\n\n/**\n * Check the type against our stored internal type of the node. This is handy when a node has\n * been removed yet we still internally know the type and need it to calculate node replacement.\n */\n\nexport function isNodeType(this: NodePath, type: string): boolean {\n return isType(this.type, type);\n}\n\n/**\n * This checks whether or not we're in one of the following positions:\n *\n * for (KEY in right);\n * for (KEY;;);\n *\n * This is because these spots allow VariableDeclarations AND normal expressions so we need\n * to tell the path replacement that it's ok to replace this with an expression.\n */\n\nexport function canHaveVariableDeclarationOrExpression(this: NodePath) {\n return (\n (this.key === \"init\" || this.key === \"left\") && this.parentPath.isFor()\n );\n}\n\n/**\n * This checks whether we are swapping an arrow function's body between an\n * expression and a block statement (or vice versa).\n *\n * This is because arrow functions may implicitly return an expression, which\n * is the same as containing a block statement.\n */\n\nexport function canSwapBetweenExpressionAndStatement(\n this: NodePath,\n replacement: t.Node,\n): boolean {\n if (this.key !== \"body\" || !this.parentPath.isArrowFunctionExpression()) {\n return false;\n }\n\n if (this.isExpression()) {\n return isBlockStatement(replacement);\n } else if (this.isBlockStatement()) {\n return isExpression(replacement);\n }\n\n return false;\n}\n\n/**\n * Check whether the current path references a completion record\n */\n\nexport function isCompletionRecord(\n this: NodePath,\n allowInsideFunction?: boolean,\n): boolean {\n let path = this;\n let first = true;\n\n do {\n const { type, container } = path;\n\n // we're in a function so can't be a completion record\n if (!first && (path.isFunction() || type === \"StaticBlock\")) {\n return !!allowInsideFunction;\n }\n\n first = false;\n\n // check to see if we're the last item in the container and if we are\n // we're a completion record!\n if (Array.isArray(container) && path.key !== container.length - 1) {\n return false;\n }\n } while (\n (path = path.parentPath) &&\n !path.isProgram() &&\n !path.isDoExpression()\n );\n\n return true;\n}\n\n/**\n * Check whether or not the current `key` allows either a single statement or block statement\n * so we can explode it if necessary.\n */\n\nexport function isStatementOrBlock(this: NodePath): boolean {\n if (\n this.parentPath.isLabeledStatement() ||\n isBlockStatement(this.container as t.Node)\n ) {\n return false;\n } else {\n return STATEMENT_OR_BLOCK_KEYS.includes(this.key as string);\n }\n}\n\n/**\n * Check if the currently assigned path references the `importName` of `moduleSource`.\n */\n\nexport function referencesImport(\n this: NodePath,\n moduleSource: string,\n importName: string,\n): boolean {\n if (!this.isReferencedIdentifier()) {\n if (\n (this.isJSXMemberExpression() &&\n this.node.property.name === importName) ||\n ((this.isMemberExpression() || this.isOptionalMemberExpression()) &&\n (this.node.computed\n ? isStringLiteral(this.node.property, { value: importName })\n : (this.node.property as t.Identifier).name === importName))\n ) {\n const object = (\n this as NodePath\n ).get(\"object\");\n return (\n object.isReferencedIdentifier() &&\n object.referencesImport(moduleSource, \"*\")\n );\n }\n\n return false;\n }\n\n const binding = this.scope.getBinding((this.node as t.Identifier).name);\n if (!binding || binding.kind !== \"module\") return false;\n\n const path = binding.path;\n const parent = path.parentPath;\n if (!parent.isImportDeclaration()) return false;\n\n // check moduleSource\n if (parent.node.source.value === moduleSource) {\n if (!importName) return true;\n } else {\n return false;\n }\n\n if (path.isImportDefaultSpecifier() && importName === \"default\") {\n return true;\n }\n\n if (path.isImportNamespaceSpecifier() && importName === \"*\") {\n return true;\n }\n\n if (\n path.isImportSpecifier() &&\n isIdentifier(path.node.imported, { name: importName })\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Get the source code associated with this node.\n */\n\nexport function getSource(this: NodePath): string {\n const node = this.node;\n if (node.end) {\n const code = this.hub.getCode();\n if (code) return code.slice(node.start, node.end);\n }\n return \"\";\n}\n\nexport function willIMaybeExecuteBefore(\n this: NodePath,\n target: NodePath,\n): boolean {\n return this._guessExecutionStatusRelativeTo(target) !== \"after\";\n}\n\nfunction getOuterFunction(path: NodePath) {\n return path.isProgram()\n ? path\n : (\n path.parentPath.scope.getFunctionParent() ||\n path.parentPath.scope.getProgramParent()\n ).path;\n}\n\nfunction isExecutionUncertain(type: t.Node[\"type\"], key: string) {\n switch (type) {\n // a && FOO\n // a || FOO\n case \"LogicalExpression\":\n return key === \"right\";\n\n // a ? FOO : FOO\n // if (a) FOO; else FOO;\n case \"ConditionalExpression\":\n case \"IfStatement\":\n return key === \"consequent\" || key === \"alternate\";\n\n // while (a) FOO;\n case \"WhileStatement\":\n case \"DoWhileStatement\":\n case \"ForInStatement\":\n case \"ForOfStatement\":\n return key === \"body\";\n\n // for (a; b; FOO) FOO;\n case \"ForStatement\":\n return key === \"body\" || key === \"update\";\n\n // switch (a) { FOO }\n case \"SwitchStatement\":\n return key === \"cases\";\n\n // try { a } catch FOO finally { b }\n case \"TryStatement\":\n return key === \"handler\";\n\n // var [ x = FOO ]\n case \"AssignmentPattern\":\n return key === \"right\";\n\n // a?.[FOO]\n case \"OptionalMemberExpression\":\n return key === \"property\";\n\n // a?.(FOO)\n case \"OptionalCallExpression\":\n return key === \"arguments\";\n\n default:\n return false;\n }\n}\n\nfunction isExecutionUncertainInList(paths: NodePath[], maxIndex: number) {\n for (let i = 0; i < maxIndex; i++) {\n const path = paths[i];\n if (isExecutionUncertain(path.parent.type, path.parentKey)) {\n return true;\n }\n }\n return false;\n}\n\n// TODO(Babel 8)\n// This can be { before: boolean, after: boolean, unknown: boolean }.\n// This allows transforms like the tdz one to treat cases when the status\n// is both before and unknown/after like if it were before.\ntype RelativeExecutionStatus = \"before\" | \"after\" | \"unknown\";\n\n// Used to avoid infinite recursion in cases like\n// function f() { if (false) f(); }\n// f();\n// It also works with indirect recursion.\nconst SYMBOL_CHECKING = Symbol();\n\ntype ExecutionStatusCache = Map<\n t.Node,\n Map\n>;\n\n/**\n * Given a `target` check the execution status of it relative to the current path.\n *\n * \"Execution status\" simply refers to where or not we **think** this will execute\n * before or after the input `target` element.\n */\n\nexport function _guessExecutionStatusRelativeTo(\n this: NodePath,\n target: NodePath,\n): RelativeExecutionStatus {\n return _guessExecutionStatusRelativeToCached(this, target, new Map());\n}\n\nfunction _guessExecutionStatusRelativeToCached(\n base: NodePath,\n target: NodePath,\n cache: ExecutionStatusCache,\n): RelativeExecutionStatus {\n // check if the two paths are in different functions, we can't track execution of these\n const funcParent = {\n this: getOuterFunction(base),\n target: getOuterFunction(target),\n };\n\n // here we check the `node` equality as sometimes we may have different paths for the\n // same node due to path thrashing\n if (funcParent.target.node !== funcParent.this.node) {\n return _guessExecutionStatusRelativeToDifferentFunctionsCached(\n base,\n funcParent.target,\n cache,\n );\n }\n\n const paths = {\n target: target.getAncestry(),\n this: base.getAncestry(),\n };\n\n // If this is an ancestor of the target path,\n // e.g. f(g); where this is f and target is g.\n if (paths.target.includes(base)) return \"after\";\n if (paths.this.includes(target)) return \"before\";\n\n // get ancestor where the branches intersect\n let commonPath;\n const commonIndex = { target: 0, this: 0 };\n\n while (!commonPath && commonIndex.this < paths.this.length) {\n const path = paths.this[commonIndex.this];\n commonIndex.target = paths.target.indexOf(path);\n if (commonIndex.target >= 0) {\n commonPath = path;\n } else {\n commonIndex.this++;\n }\n }\n\n if (!commonPath) {\n throw new Error(\n \"Internal Babel error - The two compared nodes\" +\n \" don't appear to belong to the same program.\",\n );\n }\n\n if (\n isExecutionUncertainInList(paths.this, commonIndex.this - 1) ||\n isExecutionUncertainInList(paths.target, commonIndex.target - 1)\n ) {\n return \"unknown\";\n }\n\n const divergence = {\n this: paths.this[commonIndex.this - 1],\n target: paths.target[commonIndex.target - 1],\n };\n\n // container list so let's see which one is after the other\n // e.g. [ THIS, TARGET ]\n if (\n divergence.target.listKey &&\n divergence.this.listKey &&\n divergence.target.container === divergence.this.container\n ) {\n return divergence.target.key > divergence.this.key ? \"before\" : \"after\";\n }\n\n // otherwise we're associated by a parent node, check which key comes before the other\n const keys = VISITOR_KEYS[commonPath.type];\n const keyPosition = {\n this: keys.indexOf(divergence.this.parentKey),\n target: keys.indexOf(divergence.target.parentKey),\n };\n return keyPosition.target > keyPosition.this ? \"before\" : \"after\";\n}\n\nfunction _guessExecutionStatusRelativeToDifferentFunctionsInternal(\n base: NodePath,\n target: NodePath,\n cache: ExecutionStatusCache,\n): RelativeExecutionStatus {\n if (!target.isFunctionDeclaration()) {\n if (\n _guessExecutionStatusRelativeToCached(base, target, cache) === \"before\"\n ) {\n return \"before\";\n }\n return \"unknown\";\n } else if (target.parentPath.isExportDeclaration()) {\n return \"unknown\";\n }\n\n // so we're in a completely different function, if this is a function declaration\n // then we can be a bit smarter and handle cases where the function is either\n // a. not called at all (part of an export)\n // b. called directly\n const binding = target.scope.getBinding(target.node.id.name);\n\n // no references!\n if (!binding.references) return \"before\";\n\n const referencePaths: Array = binding.referencePaths;\n\n let allStatus;\n\n // verify that all the calls have the same execution status\n for (const path of referencePaths) {\n // if a reference is a child of the function we're checking against then we can\n // safely ignore it\n const childOfFunction = !!path.find(path => path.node === target.node);\n if (childOfFunction) continue;\n\n if (path.key !== \"callee\" || !path.parentPath.isCallExpression()) {\n // This function is passed as a reference, so we don't\n // know when it will be called.\n return \"unknown\";\n }\n\n const status = _guessExecutionStatusRelativeToCached(base, path, cache);\n\n if (allStatus && allStatus !== status) {\n return \"unknown\";\n } else {\n allStatus = status;\n }\n }\n\n return allStatus;\n}\n\nfunction _guessExecutionStatusRelativeToDifferentFunctionsCached(\n base: NodePath,\n target: NodePath,\n cache: ExecutionStatusCache,\n): RelativeExecutionStatus {\n let nodeMap = cache.get(base.node);\n let cached;\n\n if (!nodeMap) {\n cache.set(base.node, (nodeMap = new Map()));\n } else if ((cached = nodeMap.get(target.node))) {\n if (cached === SYMBOL_CHECKING) {\n return \"unknown\";\n }\n return cached;\n }\n\n nodeMap.set(target.node, SYMBOL_CHECKING);\n\n const result = _guessExecutionStatusRelativeToDifferentFunctionsInternal(\n base,\n target,\n cache,\n );\n\n nodeMap.set(target.node, result);\n return result;\n}\n\n/**\n * Resolve the value pointed to by a NodePath\n * e.g.\n * ```\n * var a = 1;\n * var b = a;\n * b;\n * ```\n * `b.resolve()` will return `1`\n */\nexport function resolve(\n this: NodePath,\n dangerous?: boolean,\n resolved?: NodePath[],\n) {\n return _resolve.call(this, dangerous, resolved) || this;\n}\n\nexport function _resolve(\n this: NodePath,\n dangerous?: boolean,\n resolved?: NodePath[],\n): NodePath | undefined | null {\n // detect infinite recursion\n // todo: possibly have a max length on this just to be safe\n if (resolved?.includes(this)) return;\n\n // we store all the paths we've \"resolved\" in this array to prevent infinite recursion\n resolved = resolved || [];\n resolved.push(this);\n\n if (this.isVariableDeclarator()) {\n if (this.get(\"id\").isIdentifier()) {\n return this.get(\"init\").resolve(dangerous, resolved);\n } else {\n // otherwise it's a request for a pattern and that's a bit more tricky\n }\n } else if (this.isReferencedIdentifier()) {\n const binding = this.scope.getBinding(this.node.name);\n if (!binding) return;\n\n // reassigned so we can't really resolve it\n if (!binding.constant) return;\n\n // todo - lookup module in dependency graph\n if (binding.kind === \"module\") return;\n\n if (binding.path !== this) {\n const ret = binding.path.resolve(dangerous, resolved);\n // If the identifier resolves to parent node then we can't really resolve it.\n if (this.find(parent => parent.node === ret.node)) return;\n return ret;\n }\n } else if (this.isTypeCastExpression()) {\n // @ ts-ignore todo: babel-types\n return this.get(\"expression\").resolve(dangerous, resolved);\n } else if (dangerous && this.isMemberExpression()) {\n // this is dangerous, as non-direct target assignments will mutate it's state\n // making this resolution inaccurate\n\n const targetKey = this.toComputedKey();\n if (!isLiteral(targetKey)) return;\n\n // @ts-expect-error todo(flow->ts): NullLiteral\n const targetName = targetKey.value;\n\n const target = this.get(\"object\").resolve(dangerous, resolved);\n\n if (target.isObjectExpression()) {\n const props = target.get(\"properties\");\n for (const prop of props as any[]) {\n if (!prop.isProperty()) continue;\n\n const key = prop.get(\"key\");\n\n // { foo: obj }\n let match =\n prop.isnt(\"computed\") && key.isIdentifier({ name: targetName });\n\n // { \"foo\": \"obj\" } or { [\"foo\"]: \"obj\" }\n match = match || key.isLiteral({ value: targetName });\n\n if (match) return prop.get(\"value\").resolve(dangerous, resolved);\n }\n } else if (target.isArrayExpression() && !isNaN(+targetName)) {\n const elems = target.get(\"elements\");\n const elem = elems[targetName];\n if (elem) return elem.resolve(dangerous, resolved);\n }\n }\n}\n\nexport function isConstantExpression(this: NodePath): boolean {\n if (this.isIdentifier()) {\n const binding = this.scope.getBinding(this.node.name);\n if (!binding) return false;\n return binding.constant;\n }\n\n if (this.isLiteral()) {\n if (this.isRegExpLiteral()) {\n return false;\n }\n\n if (this.isTemplateLiteral()) {\n return this.get(\"expressions\").every(expression =>\n expression.isConstantExpression(),\n );\n }\n\n return true;\n }\n\n if (this.isUnaryExpression()) {\n if (this.node.operator !== \"void\") {\n return false;\n }\n\n return this.get(\"argument\").isConstantExpression();\n }\n\n if (this.isBinaryExpression()) {\n const { operator } = this.node;\n return (\n operator !== \"in\" &&\n operator !== \"instanceof\" &&\n this.get(\"left\").isConstantExpression() &&\n this.get(\"right\").isConstantExpression()\n );\n }\n\n if (this.isMemberExpression()) {\n return (\n !this.node.computed &&\n this.get(\"object\").isIdentifier({ name: \"Symbol\" }) &&\n !this.scope.hasBinding(\"Symbol\", { noGlobals: true })\n );\n }\n\n if (this.isCallExpression()) {\n return (\n this.node.arguments.length === 1 &&\n this.get(\"callee\").matchesPattern(\"Symbol.for\") &&\n !this.scope.hasBinding(\"Symbol\", { noGlobals: true }) &&\n this.get(\"arguments\")[0].isStringLiteral()\n );\n }\n\n return false;\n}\n\nexport function isInStrictMode(this: NodePath) {\n const start = this.isProgram() ? this : this.parentPath;\n\n const strictParent = start.find(path => {\n if (path.isProgram({ sourceType: \"module\" })) return true;\n\n if (path.isClass()) return true;\n\n if (\n path.isArrowFunctionExpression() &&\n !path.get(\"body\").isBlockStatement()\n ) {\n return false;\n }\n\n let body: t.BlockStatement | t.Program;\n if (path.isFunction()) {\n body = path.node.body as t.BlockStatement;\n } else if (path.isProgram()) {\n // @ts-expect-error TODO: TS thinks that `path` here cannot be\n // Program due to the `isProgram()` check at the beginning of\n // the function\n body = path.node;\n } else {\n return false;\n }\n\n for (const directive of body.directives) {\n if (directive.value.value === \"use strict\") {\n return true;\n }\n }\n });\n\n return !!strictParent;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,EAAA,GAAAC,OAAA;AAUsB;EATpBC,uBAAuB;EACvBC,YAAY;EACZC,gBAAgB;EAChBC,YAAY;EACZC,YAAY;EACZC,SAAS;EACTC,eAAe;EACfC,MAAM;EACNC,cAAc,EAAIC;AAAe,IAAAX,EAAA;AAW5B,SAASU,cAAcA,CAE5BE,OAAe,EACfC,YAAsB,EACb;EACT,OAAOF,eAAe,CAAC,IAAI,CAACG,IAAI,EAAEF,OAAO,EAAEC,YAAY,CAAC;AAC1D;AAE+C;EAM7CE,OAAO,CAACC,GAAG,GAAG,SAASA,GAAGA,CAExBC,GAAY,EACH;IAAA,IAAAC,UAAA;IACT,MAAMC,GAAG,IAAAD,UAAA,GAAI,IAAI,CAACJ,IAAI,qBAAVI,UAAA,CAAmBD,GAAG,CAAC;IACnC,IAAIE,GAAG,IAAIC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE;MAC7B,OAAO,CAAC,CAACA,GAAG,CAACG,MAAM;IACrB,CAAC,MAAM;MACL,OAAO,CAAC,CAACH,GAAG;IACd;EACF,CAAC;AACH;AAEO,SAASI,QAAQA,CAAA,EAA0B;EAChD,OAAO,IAAI,CAACC,KAAK,CAACD,QAAQ,CAAC,IAAI,CAACT,IAAI,CAAC;AACvC;AAE+C;EAK7CC,OAAO,CAACU,EAAE,GAAGV,OAAO,CAACC,GAAG;EAMxBD,OAAO,CAACW,IAAI,GAAG,SAASA,IAAIA,CAE1BT,GAAY,EACH;IAET,OAAO,CAAC,IAAI,CAACD,GAAG,CAACC,GAAG,CAAC;EACvB,CAAC;EAMDF,OAAO,CAACY,MAAM,GAAG,SAASA,MAAMA,CAE9BV,GAAY,EACZW,KAAU,EACD;IACT,OAAQ,IAAI,CAACd,IAAI,CAAO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AAC,CAAC,EAAE;MAI3BqH,IAAI,GAAGzH,IAAI,CAACzB,IAAI;IAClB,CAAC,MAAM;MACL,OAAO,KAAK;IACd;IAEA,KAAK,MAAMmJ,SAAS,IAAID,IAAI,CAACE,UAAU,EAAE;MACvC,IAAID,SAAS,CAACrI,KAAK,CAACA,KAAK,KAAK,YAAY,EAAE;QAC1C,OAAO,IAAI;MACb;IACF;EACF,CAAC,CAAC;EAEF,OAAO,CAAC,CAACiI,YAAY;AACvB","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/traverse/lib/path/lib/hoister.js b/node_modules/@babel/traverse/lib/path/lib/hoister.js
new file mode 100644
index 00000000..4c4246fd
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/lib/hoister.js
@@ -0,0 +1,171 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+var _t = require("@babel/types");
+var _t2 = _t;
+const {
+ react
+} = _t;
+const {
+ cloneNode,
+ jsxExpressionContainer,
+ variableDeclaration,
+ variableDeclarator
+} = _t2;
+const referenceVisitor = {
+ ReferencedIdentifier(path, state) {
+ if (path.isJSXIdentifier() && react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) {
+ return;
+ }
+ if (path.node.name === "this") {
+ let scope = path.scope;
+ do {
+ if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) {
+ break;
+ }
+ } while (scope = scope.parent);
+ if (scope) state.breakOnScopePaths.push(scope.path);
+ }
+ const binding = path.scope.getBinding(path.node.name);
+ if (!binding) return;
+ for (const violation of binding.constantViolations) {
+ if (violation.scope !== binding.path.scope) {
+ state.mutableBinding = true;
+ path.stop();
+ return;
+ }
+ }
+ if (binding !== state.scope.getBinding(path.node.name)) return;
+ state.bindings[path.node.name] = binding;
+ }
+};
+class PathHoister {
+ constructor(path, scope) {
+ this.breakOnScopePaths = void 0;
+ this.bindings = void 0;
+ this.mutableBinding = void 0;
+ this.scopes = void 0;
+ this.scope = void 0;
+ this.path = void 0;
+ this.attachAfter = void 0;
+ this.breakOnScopePaths = [];
+ this.bindings = {};
+ this.mutableBinding = false;
+ this.scopes = [];
+ this.scope = scope;
+ this.path = path;
+ this.attachAfter = false;
+ }
+ isCompatibleScope(scope) {
+ for (const key of Object.keys(this.bindings)) {
+ const binding = this.bindings[key];
+ if (!scope.bindingIdentifierEquals(key, binding.identifier)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ getCompatibleScopes() {
+ let scope = this.path.scope;
+ do {
+ if (this.isCompatibleScope(scope)) {
+ this.scopes.push(scope);
+ } else {
+ break;
+ }
+ if (this.breakOnScopePaths.includes(scope.path)) {
+ break;
+ }
+ } while (scope = scope.parent);
+ }
+ getAttachmentPath() {
+ let path = this._getAttachmentPath();
+ if (!path) return;
+ let targetScope = path.scope;
+ if (targetScope.path === path) {
+ targetScope = path.scope.parent;
+ }
+ if (targetScope.path.isProgram() || targetScope.path.isFunction()) {
+ for (const name of Object.keys(this.bindings)) {
+ if (!targetScope.hasOwnBinding(name)) continue;
+ const binding = this.bindings[name];
+ if (binding.kind === "param" || binding.path.parentKey === "params") {
+ continue;
+ }
+ const bindingParentPath = this.getAttachmentParentForPath(binding.path);
+ if (bindingParentPath.key >= path.key) {
+ this.attachAfter = true;
+ path = binding.path;
+ for (const violationPath of binding.constantViolations) {
+ if (this.getAttachmentParentForPath(violationPath).key > path.key) {
+ path = violationPath;
+ }
+ }
+ }
+ }
+ }
+ return path;
+ }
+ _getAttachmentPath() {
+ const scopes = this.scopes;
+ const scope = scopes.pop();
+ if (!scope) return;
+ if (scope.path.isFunction()) {
+ if (this.hasOwnParamBindings(scope)) {
+ if (this.scope === scope) return;
+ const bodies = scope.path.get("body").get("body");
+ for (let i = 0; i < bodies.length; i++) {
+ if (bodies[i].node._blockHoist) continue;
+ return bodies[i];
+ }
+ } else {
+ return this.getNextScopeAttachmentParent();
+ }
+ } else if (scope.path.isProgram()) {
+ return this.getNextScopeAttachmentParent();
+ }
+ }
+ getNextScopeAttachmentParent() {
+ const scope = this.scopes.pop();
+ if (scope) return this.getAttachmentParentForPath(scope.path);
+ }
+ getAttachmentParentForPath(path) {
+ do {
+ if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
+ return path;
+ }
+ } while (path = path.parentPath);
+ }
+ hasOwnParamBindings(scope) {
+ for (const name of Object.keys(this.bindings)) {
+ if (!scope.hasOwnBinding(name)) continue;
+ const binding = this.bindings[name];
+ if (binding.kind === "param" && binding.constant) return true;
+ }
+ return false;
+ }
+ run() {
+ this.path.traverse(referenceVisitor, this);
+ if (this.mutableBinding) return;
+ this.getCompatibleScopes();
+ const attachTo = this.getAttachmentPath();
+ if (!attachTo) return;
+ if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return;
+ let uid = attachTo.scope.generateUidIdentifier("ref");
+ const declarator = variableDeclarator(uid, this.path.node);
+ const insertFn = this.attachAfter ? "insertAfter" : "insertBefore";
+ const [attached] = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : variableDeclaration("var", [declarator])]);
+ const parent = this.path.parentPath;
+ if (parent.isJSXElement() && this.path.container === parent.node.children) {
+ uid = jsxExpressionContainer(uid);
+ }
+ this.path.replaceWith(cloneNode(uid));
+ return attachTo.isVariableDeclarator() ? attached.get("init") : attached.get("declarations.0.init");
+ }
+}
+exports.default = PathHoister;
+
+//# sourceMappingURL=hoister.js.map
diff --git a/node_modules/@babel/traverse/lib/path/lib/hoister.js.map b/node_modules/@babel/traverse/lib/path/lib/hoister.js.map
new file mode 100644
index 00000000..23e0c57b
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/lib/hoister.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["_t","require","_t2","react","cloneNode","jsxExpressionContainer","variableDeclaration","variableDeclarator","referenceVisitor","ReferencedIdentifier","path","state","isJSXIdentifier","isCompatTag","node","name","parentPath","isJSXMemberExpression","scope","isFunction","isArrowFunctionExpression","parent","breakOnScopePaths","push","binding","getBinding","violation","constantViolations","mutableBinding","stop","bindings","PathHoister","constructor","scopes","attachAfter","isCompatibleScope","key","Object","keys","bindingIdentifierEquals","identifier","getCompatibleScopes","includes","getAttachmentPath","_getAttachmentPath","targetScope","isProgram","hasOwnBinding","kind","parentKey","bindingParentPath","getAttachmentParentForPath","violationPath","pop","hasOwnParamBindings","bodies","get","i","length","_blockHoist","getNextScopeAttachmentParent","Array","isArray","container","isStatement","constant","run","traverse","attachTo","getFunctionParent","uid","generateUidIdentifier","declarator","insertFn","attached","isVariableDeclarator","isJSXElement","children","replaceWith","exports","default"],"sources":["../../../src/path/lib/hoister.ts"],"sourcesContent":["// TODO: Remove this file in Babel 8\n\nimport { react } from \"@babel/types\";\nimport {\n cloneNode,\n jsxExpressionContainer,\n variableDeclaration,\n variableDeclarator,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type Scope from \"../../scope/index.ts\";\nimport type NodePath from \"../index.ts\";\nimport type Binding from \"../../scope/binding.ts\";\nimport type { Visitor } from \"../../types.ts\";\n\nconst referenceVisitor: Visitor = {\n // This visitor looks for bindings to establish a topmost scope for hoisting.\n ReferencedIdentifier(path, state) {\n // Don't hoist regular JSX identifiers ('div', 'span', etc).\n // We do have to consider member expressions for hoisting (e.g. `this.component`)\n if (\n path.isJSXIdentifier() &&\n react.isCompatTag(path.node.name) &&\n !path.parentPath.isJSXMemberExpression()\n ) {\n return;\n }\n\n // If the identifier refers to `this`, we need to break on the closest non-arrow scope.\n if (path.node.name === \"this\") {\n let scope = path.scope;\n do {\n if (\n scope.path.isFunction() &&\n !scope.path.isArrowFunctionExpression()\n ) {\n break;\n }\n } while ((scope = scope.parent));\n if (scope) state.breakOnScopePaths.push(scope.path);\n }\n\n // direct references that we need to track to hoist this to the highest scope we can\n const binding = path.scope.getBinding(path.node.name);\n if (!binding) return;\n\n // we can handle reassignments only if they happen in the same scope as the declaration\n for (const violation of binding.constantViolations) {\n if (violation.scope !== binding.path.scope) {\n state.mutableBinding = true;\n path.stop();\n return;\n }\n }\n\n // this binding isn't accessible from the parent scope so we can safely ignore it\n // eg. it's in a closure etc\n if (binding !== state.scope.getBinding(path.node.name)) return;\n\n state.bindings[path.node.name] = binding;\n },\n};\n\nexport default class PathHoister {\n breakOnScopePaths: NodePath[];\n bindings: { [k: string]: Binding };\n mutableBinding: boolean;\n private scopes: Scope[];\n scope: Scope;\n private path: NodePath;\n private attachAfter: boolean;\n\n constructor(path: NodePath, scope: Scope) {\n // Storage for scopes we can't hoist above.\n this.breakOnScopePaths = [];\n // Storage for bindings that may affect what path we can hoist to.\n this.bindings = {};\n // \"true\" if the current path contains a reference to a binding whose\n // value can change and thus can't be safely hoisted.\n this.mutableBinding = false;\n // Storage for eligible scopes.\n this.scopes = [];\n // Our original scope and path.\n this.scope = scope;\n this.path = path;\n // By default, we attach as far up as we can; but if we're trying\n // to avoid referencing a binding, we may have to go after.\n this.attachAfter = false;\n }\n\n // A scope is compatible if all required bindings are reachable.\n isCompatibleScope(scope: Scope) {\n for (const key of Object.keys(this.bindings)) {\n const binding = this.bindings[key];\n if (!scope.bindingIdentifierEquals(key, binding.identifier)) {\n return false;\n }\n }\n\n return true;\n }\n\n // Look through all scopes and push compatible ones.\n getCompatibleScopes() {\n let scope = this.path.scope;\n do {\n if (this.isCompatibleScope(scope)) {\n this.scopes.push(scope);\n } else {\n break;\n }\n\n // deopt: These scopes are set in the visitor on const violations\n if (this.breakOnScopePaths.includes(scope.path)) {\n break;\n }\n } while ((scope = scope.parent));\n }\n\n getAttachmentPath() {\n let path = this._getAttachmentPath();\n if (!path) return;\n\n let targetScope = path.scope;\n\n // don't allow paths that have their own lexical environments to pollute\n if (targetScope.path === path) {\n targetScope = path.scope.parent;\n }\n\n // avoid hoisting to a scope that contains bindings that are executed after our attachment path\n if (targetScope.path.isProgram() || targetScope.path.isFunction()) {\n for (const name of Object.keys(this.bindings)) {\n // check binding is a direct child of this paths scope\n if (!targetScope.hasOwnBinding(name)) continue;\n\n const binding = this.bindings[name];\n\n // allow parameter references and expressions in params (like destructuring rest)\n if (binding.kind === \"param\" || binding.path.parentKey === \"params\") {\n continue;\n }\n\n // For each binding, get its attachment parent. This gives us an idea of where we might\n // introduce conflicts.\n const bindingParentPath = this.getAttachmentParentForPath(binding.path);\n\n // If the binding's attachment appears at or after our attachment point, then we move after it.\n if (bindingParentPath.key >= path.key) {\n this.attachAfter = true;\n path = binding.path;\n\n // We also move past any constant violations.\n for (const violationPath of binding.constantViolations) {\n if (this.getAttachmentParentForPath(violationPath).key > path.key) {\n path = violationPath;\n }\n }\n }\n }\n }\n\n return path;\n }\n\n _getAttachmentPath() {\n const scopes = this.scopes;\n\n const scope = scopes.pop();\n // deopt: no compatible scopes\n if (!scope) return;\n\n if (scope.path.isFunction()) {\n if (this.hasOwnParamBindings(scope)) {\n // deopt: should ignore this scope since it's ourselves\n if (this.scope === scope) return;\n\n // needs to be attached to the body\n const bodies = scope.path.get(\"body\").get(\"body\") as NodePath[];\n for (let i = 0; i < bodies.length; i++) {\n // Don't attach to something that's going to get hoisted,\n // like a default parameter\n // @ts-expect-error todo(flow->ts): avoid mutating the node, introducing new fields\n if (bodies[i].node._blockHoist) continue;\n return bodies[i];\n }\n // deopt: If here, no attachment path found\n } else {\n // doesn't need to be be attached to this scope\n return this.getNextScopeAttachmentParent();\n }\n } else if (scope.path.isProgram()) {\n return this.getNextScopeAttachmentParent();\n }\n }\n\n getNextScopeAttachmentParent() {\n const scope = this.scopes.pop();\n if (scope) return this.getAttachmentParentForPath(scope.path);\n }\n\n // Find an attachment for this path.\n getAttachmentParentForPath(path: NodePath) {\n do {\n if (\n // Beginning of the scope\n !path.parentPath ||\n // Has siblings and is a statement\n (Array.isArray(path.container) && path.isStatement())\n ) {\n return path;\n }\n } while ((path = path.parentPath));\n }\n\n // Returns true if a scope has param bindings.\n hasOwnParamBindings(scope: Scope) {\n for (const name of Object.keys(this.bindings)) {\n if (!scope.hasOwnBinding(name)) continue;\n\n const binding = this.bindings[name];\n // Ensure constant; without it we could place behind a reassignment\n if (binding.kind === \"param\" && binding.constant) return true;\n }\n return false;\n }\n\n run(): NodePath | undefined {\n this.path.traverse(referenceVisitor, this);\n\n if (this.mutableBinding) return;\n\n this.getCompatibleScopes();\n\n const attachTo = this.getAttachmentPath();\n if (!attachTo) return;\n\n // don't bother hoisting to the same function as this will cause multiple branches to be\n // evaluated more than once leading to a bad optimisation\n if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return;\n\n // generate declaration and insert it to our point\n let uid: t.Identifier | t.JSXExpressionContainer =\n attachTo.scope.generateUidIdentifier(\"ref\");\n\n // @ts-expect-error todo(flow->ts): more specific type for this.path\n const declarator = variableDeclarator(uid, this.path.node);\n\n const insertFn = this.attachAfter ? \"insertAfter\" : \"insertBefore\";\n const [attached] = attachTo[insertFn]([\n attachTo.isVariableDeclarator()\n ? declarator\n : variableDeclaration(\"var\", [declarator]),\n ]);\n\n const parent = this.path.parentPath;\n if (parent.isJSXElement() && this.path.container === parent.node.children) {\n // turning the `span` in `
` to an expression so we need to wrap it with\n // an expression container\n uid = jsxExpressionContainer(uid);\n }\n\n this.path.replaceWith(cloneNode(uid));\n\n // TODO: Should we use `attached.isVariableDeclaration()`?\n return attachTo.isVariableDeclarator()\n ? // @ts-expect-error TS cannot refine the type of `attached`\n attached.get(\"init\")\n : attached.get(\"declarations.0.init\");\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,EAAA,GAAAC,OAAA;AAAqC,IAAAC,GAAA,GAAAF,EAAA;AAAA;EAA5BG;AAAK,IAAAH,EAAA;AAAA;EAEZI,SAAS;EACTC,sBAAsB;EACtBC,mBAAmB;EACnBC;AAAkB,IAAAL,GAAA;AAQpB,MAAMM,gBAAsC,GAAG;EAE7CC,oBAAoBA,CAACC,IAAI,EAAEC,KAAK,EAAE;IAGhC,IACED,IAAI,CAACE,eAAe,CAAC,CAAC,IACtBT,KAAK,CAACU,WAAW,CAACH,IAAI,CAACI,IAAI,CAACC,IAAI,CAAC,IACjC,CAACL,IAAI,CAACM,U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GAAG,GAAGjE,sBAAsB,CAACiE,GAAG,CAAC;IACnC;IAEA,IAAI,CAAC5D,IAAI,CAACoE,WAAW,CAAC1E,SAAS,CAACkE,GAAG,CAAC,CAAC;IAGrC,OAAOF,QAAQ,CAACO,oBAAoB,CAAC,CAAC,GAElCD,QAAQ,CAAClB,GAAG,CAAC,MAAM,CAAC,GACpBkB,QAAQ,CAAClB,GAAG,CAAC,qBAAqB,CAAC;EACzC;AACF;AAACuB,OAAA,CAAAC,OAAA,GAAAjD,WAAA","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js b/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
new file mode 100644
index 00000000..2d425367
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
@@ -0,0 +1,37 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.hooks = void 0;
+const hooks = exports.hooks = [function (self, parent) {
+ const removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement();
+ if (removeParent) {
+ parent.remove();
+ return true;
+ }
+}, function (self, parent) {
+ if (parent.isSequenceExpression() && parent.node.expressions.length === 1) {
+ parent.replaceWith(parent.node.expressions[0]);
+ return true;
+ }
+}, function (self, parent) {
+ if (parent.isBinary()) {
+ if (self.key === "left") {
+ parent.replaceWith(parent.node.right);
+ } else {
+ parent.replaceWith(parent.node.left);
+ }
+ return true;
+ }
+}, function (self, parent) {
+ if (parent.isIfStatement() && self.key === "consequent" || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) {
+ self.replaceWith({
+ type: "BlockStatement",
+ body: []
+ });
+ return true;
+ }
+}];
+
+//# sourceMappingURL=removal-hooks.js.map
diff --git a/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js.map b/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js.map
new file mode 100644
index 00000000..27cf956d
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["hooks","exports","self","parent","removeParent","key","isWhile","isSwitchCase","isExportDeclaration","isLabeledStatement","listKey","isVariableDeclaration","node","declarations","length","isExpressionStatement","remove","isSequenceExpression","expressions","replaceWith","isBinary","right","left","isIfStatement","isLoop","isArrowFunctionExpression","type","body"],"sources":["../../../src/path/lib/removal-hooks.ts"],"sourcesContent":["// this file contains hooks that handle ancestry cleanup of parent nodes when removing children\n\nimport type NodePath from \"../index.ts\";\nimport type * as t from \"@babel/types\";\n/**\n * Pre hooks should be used for either rejecting removal or delegating removal\n */\n\nexport const hooks = [\n function (self: NodePath, parent: NodePath) {\n const removeParent =\n // while (NODE);\n // removing the test of a while/switch, we can either just remove it entirely *or* turn the\n // `test` into `true` unlikely that the latter will ever be what's wanted so we just remove\n // the loop to avoid infinite recursion\n (self.key === \"test\" && (parent.isWhile() || parent.isSwitchCase())) ||\n // export NODE;\n // just remove a declaration for an export as this is no longer valid\n (self.key === \"declaration\" && parent.isExportDeclaration()) ||\n // label: NODE\n // stray labeled statement with no body\n (self.key === \"body\" && parent.isLabeledStatement()) ||\n // let NODE;\n // remove an entire declaration if there are no declarators left\n (self.listKey === \"declarations\" &&\n parent.isVariableDeclaration() &&\n parent.node.declarations.length === 1) ||\n // NODE;\n // remove the entire expression statement if there's no expression\n (self.key === \"expression\" && parent.isExpressionStatement());\n\n if (removeParent) {\n parent.remove();\n return true;\n }\n },\n\n function (self: NodePath, parent: NodePath) {\n if (parent.isSequenceExpression() && parent.node.expressions.length === 1) {\n // (node, NODE);\n // we've just removed the second element of a sequence expression so let's turn that sequence\n // expression into a regular expression\n parent.replaceWith(parent.node.expressions[0]);\n return true;\n }\n },\n\n function (self: NodePath, parent: NodePath) {\n if (parent.isBinary()) {\n // left + NODE;\n // NODE + right;\n // we're in a binary expression, better remove it and replace it with the last expression\n if (self.key === \"left\") {\n parent.replaceWith(parent.node.right);\n } else {\n // key === \"right\"\n parent.replaceWith(parent.node.left);\n }\n return true;\n }\n },\n\n function (self: NodePath, parent: NodePath) {\n if (\n (parent.isIfStatement() && self.key === \"consequent\") ||\n (self.key === \"body\" &&\n (parent.isLoop() || parent.isArrowFunctionExpression()))\n ) {\n self.replaceWith({\n type: \"BlockStatement\",\n body: [],\n } as t.BlockStatement);\n return true;\n }\n },\n];\n"],"mappings":";;;;;;AAQO,MAAMA,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAAG,CACnB,UAAUE,IAAc,EAAEC,MAAgB,EAAE;EAC1C,MAAMC,YAAY,GAKfF,IAAI,CAACG,GAAG,KAAK,MAAM,KAAKF,MAAM,CAACG,OAAO,CAAC,CAAC,IAAIH,MAAM,CAACI,YAAY,CAAC,CAAC,CAAC,IAGlEL,IAAI,CAACG,GAAG,KAAK,aAAa,IAAIF,MAAM,CAACK,mBAAmB,CAAC,CAAE,IAG3DN,IAAI,CAACG,GAAG,KAAK,MAAM,IAAIF,MAAM,CAACM,kBAAkB,CAAC,CAAE,IAGnDP,IAAI,CAACQ,OAAO,KAAK,cAAc,IAC9BP,MAAM,CAACQ,qBAAqB,CAAC,CAAC,IAC9BR,MAAM,CAACS,IAAI,CAACC,YAAY,CAACC,MAAM,KAAK,CAAE,IAGvCZ,IAAI,CAACG,GAAG,KAAK,YAAY,IAAIF,MAAM,CAACY,qBAAqB,CAAC,CAAE;EAE/D,IAAIX,YAAY,EAAE;IAChBD,MAAM,CAACa,MAAM,CAAC,CAAC;IACf,OAAO,IAAI;EACb;AACF,CAAC,EAED,UAAUd,IAAc,EAAEC,MAAgB,EAAE;EAC1C,IAAIA,MAAM,CAACc,oBAAoB,CAAC,CAAC,IAAId,MAAM,CAACS,IAAI,CAACM,WAAW,CAACJ,MAAM,KAAK,CAAC,EAAE;IAIzEX,MAAM,CAACgB,WAAW,CAAChB,MAAM,CAACS,IAAI,CAACM,WAAW,CAAC,CAAC,CAAC,CAAC;IAC9C,OAAO,IAAI;EACb;AACF,CAAC,EAED,UAAUhB,IAAc,EAAEC,MAAgB,EAAE;EAC1C,IAAIA,MAAM,CAACiB,QAAQ,CAAC,CAAC,EAAE;IAIrB,IAAIlB,IAAI,CAACG,GAAG,KAAK,MAAM,EAAE;MACvBF,MAAM,CAACgB,WAAW,CAAChB,MAAM,CAACS,IAAI,CAACS,KAAK,CAAC;IACvC,CAAC,MAAM;MAELlB,MAAM,CAACgB,WAAW,CAAChB,MAAM,CAACS,IAAI,CAACU,IAAI,CAAC;IACtC;IACA,OAAO,IAAI;EACb;AACF,CAAC,EAED,UAAUpB,IAAc,EAAEC,MAAgB,EAAE;EAC1C,IACGA,MAAM,CAACoB,aAAa,CAAC,CAAC,IAAIrB,IAAI,CAACG,GAAG,KAAK,YAAY,IACnDH,IAAI,CAACG,GAAG,KAAK,MAAM,KACjBF,MAAM,CAACqB,MAAM,CAAC,CAAC,IAAIrB,MAAM,CAACsB,yBAAyB,CAAC,CAAC,CAAE,EAC1D;IACAvB,IAAI,CAACiB,WAAW,CAAC;MACfO,IAAI,EAAE,gBAAgB;MACtBC,IAAI,EAAE;IACR,CAAqB,CAAC;IACtB,OAAO,IAAI;EACb;AACF,CAAC,CACF","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js b/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js
new file mode 100644
index 00000000..f8a17add
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js
@@ -0,0 +1,163 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isBindingIdentifier = isBindingIdentifier;
+exports.isBlockScoped = isBlockScoped;
+exports.isExpression = isExpression;
+exports.isFlow = isFlow;
+exports.isForAwaitStatement = isForAwaitStatement;
+exports.isGenerated = isGenerated;
+exports.isPure = isPure;
+exports.isReferenced = isReferenced;
+exports.isReferencedIdentifier = isReferencedIdentifier;
+exports.isReferencedMemberExpression = isReferencedMemberExpression;
+exports.isRestProperty = isRestProperty;
+exports.isScope = isScope;
+exports.isSpreadProperty = isSpreadProperty;
+exports.isStatement = isStatement;
+exports.isUser = isUser;
+exports.isVar = isVar;
+var _t = require("@babel/types");
+const {
+ isBinding,
+ isBlockScoped: nodeIsBlockScoped,
+ isExportDeclaration,
+ isExpression: nodeIsExpression,
+ isFlow: nodeIsFlow,
+ isForStatement,
+ isForXStatement,
+ isIdentifier,
+ isImportDeclaration,
+ isImportSpecifier,
+ isJSXIdentifier,
+ isJSXMemberExpression,
+ isMemberExpression,
+ isRestElement: nodeIsRestElement,
+ isReferenced: nodeIsReferenced,
+ isScope: nodeIsScope,
+ isStatement: nodeIsStatement,
+ isVar: nodeIsVar,
+ isVariableDeclaration,
+ react,
+ isForOfStatement
+} = _t;
+const {
+ isCompatTag
+} = react;
+function isReferencedIdentifier(opts) {
+ const {
+ node,
+ parent
+ } = this;
+ if (!isIdentifier(node, opts) && !isJSXMemberExpression(parent, opts)) {
+ if (isJSXIdentifier(node, opts)) {
+ if (isCompatTag(node.name)) return false;
+ } else {
+ return false;
+ }
+ }
+ return nodeIsReferenced(node, parent, this.parentPath.parent);
+}
+function isReferencedMemberExpression() {
+ const {
+ node,
+ parent
+ } = this;
+ return isMemberExpression(node) && nodeIsReferenced(node, parent);
+}
+function isBindingIdentifier() {
+ const {
+ node,
+ parent
+ } = this;
+ const grandparent = this.parentPath.parent;
+ return isIdentifier(node) && isBinding(node, parent, grandparent);
+}
+function isStatement() {
+ const {
+ node,
+ parent
+ } = this;
+ if (nodeIsStatement(node)) {
+ if (isVariableDeclaration(node)) {
+ if (isForXStatement(parent, {
+ left: node
+ })) return false;
+ if (isForStatement(parent, {
+ init: node
+ })) return false;
+ }
+ return true;
+ } else {
+ return false;
+ }
+}
+function isExpression() {
+ if (this.isIdentifier()) {
+ return this.isReferencedIdentifier();
+ } else {
+ return nodeIsExpression(this.node);
+ }
+}
+function isScope() {
+ return nodeIsScope(this.node, this.parent);
+}
+function isReferenced() {
+ return nodeIsReferenced(this.node, this.parent);
+}
+function isBlockScoped() {
+ return nodeIsBlockScoped(this.node);
+}
+function isVar() {
+ return nodeIsVar(this.node);
+}
+function isUser() {
+ return this.node && !!this.node.loc;
+}
+function isGenerated() {
+ return !this.isUser();
+}
+function isPure(constantsOnly) {
+ return this.scope.isPure(this.node, constantsOnly);
+}
+function isFlow() {
+ const {
+ node
+ } = this;
+ if (nodeIsFlow(node)) {
+ return true;
+ } else if (isImportDeclaration(node)) {
+ return node.importKind === "type" || node.importKind === "typeof";
+ } else if (isExportDeclaration(node)) {
+ return node.exportKind === "type";
+ } else if (isImportSpecifier(node)) {
+ return node.importKind === "type" || node.importKind === "typeof";
+ } else {
+ return false;
+ }
+}
+function isRestProperty() {
+ var _this$parentPath;
+ return nodeIsRestElement(this.node) && ((_this$parentPath = this.parentPath) == null ? void 0 : _this$parentPath.isObjectPattern());
+}
+function isSpreadProperty() {
+ var _this$parentPath2;
+ return nodeIsRestElement(this.node) && ((_this$parentPath2 = this.parentPath) == null ? void 0 : _this$parentPath2.isObjectExpression());
+}
+function isForAwaitStatement() {
+ return isForOfStatement(this.node, {
+ await: true
+ });
+}
+{
+ exports.isExistentialTypeParam = function isExistentialTypeParam() {
+ throw new Error("`path.isExistentialTypeParam` has been renamed to `path.isExistsTypeAnnotation()` in Babel 7.");
+ };
+ exports.isNumericLiteralTypeAnnotation = function isNumericLiteralTypeAnnotation() {
+ throw new Error("`path.isNumericLiteralTypeAnnotation()` has been renamed to `path.isNumberLiteralTypeAnnotation()` in Babel 7.");
+ };
+}
+
+//# sourceMappingURL=virtual-types-validator.js.map
diff --git a/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js.map b/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js.map
new file mode 100644
index 00000000..cca4aa0d
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["_t","require","isBinding","isBlockScoped","nodeIsBlockScoped","isExportDeclaration","isExpression","nodeIsExpression","isFlow","nodeIsFlow","isForStatement","isForXStatement","isIdentifier","isImportDeclaration","isImportSpecifier","isJSXIdentifier","isJSXMemberExpression","isMemberExpression","isRestElement","nodeIsRestElement","isReferenced","nodeIsReferenced","isScope","nodeIsScope","isStatement","nodeIsStatement","isVar","nodeIsVar","isVariableDeclaration","react","isForOfStatement","isCompatTag","isReferencedIdentifier","opts","node","parent","name","parentPath","isReferencedMemberExpression","isBindingIdentifier","grandparent","left","init","isUser","loc","isGenerated","isPure","constantsOnly","scope","importKind","exportKind","isRestProperty","_this$parentPath","isObjectPattern","isSpreadProperty","_this$parentPath2","isObjectExpression","isForAwaitStatement","await","exports","isExistentialTypeParam","Error","isNumericLiteralTypeAnnotation"],"sources":["../../../src/path/lib/virtual-types-validator.ts"],"sourcesContent":["import type NodePath from \"../index.ts\";\nimport {\n isBinding,\n isBlockScoped as nodeIsBlockScoped,\n isExportDeclaration,\n isExpression as nodeIsExpression,\n isFlow as nodeIsFlow,\n isForStatement,\n isForXStatement,\n isIdentifier,\n isImportDeclaration,\n isImportSpecifier,\n isJSXIdentifier,\n isJSXMemberExpression,\n isMemberExpression,\n isRestElement as nodeIsRestElement,\n isReferenced as nodeIsReferenced,\n isScope as nodeIsScope,\n isStatement as nodeIsStatement,\n isVar as nodeIsVar,\n isVariableDeclaration,\n react,\n isForOfStatement,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nconst { isCompatTag } = react;\nimport type { VirtualTypeAliases } from \"./virtual-types.ts\";\n\ntype Opts = Partial<{\n [Prop in keyof Obj]: Obj[Prop] extends t.Node\n ? t.Node\n : Obj[Prop] extends t.Node[]\n ? t.Node[]\n : Obj[Prop];\n}>;\n\nexport interface VirtualTypeNodePathValidators {\n isBindingIdentifier(\n this: NodePath,\n opts?: Opts,\n ): this is NodePath;\n isBlockScoped(opts?: Opts): boolean;\n /**\n * @deprecated\n */\n isExistentialTypeParam(\n this: NodePath,\n opts?: Opts,\n ): this is NodePath;\n isExpression(\n this: NodePath,\n opts?: Opts,\n ): this is NodePath;\n isFlow(\n this: NodePath,\n opts?: Opts,\n ): this is NodePath;\n isForAwaitStatement(\n this: NodePath,\n opts?: Opts,\n ): this is NodePath;\n isGenerated(opts?: VirtualTypeAliases[\"Generated\"]): boolean;\n /**\n * @deprecated\n */\n isNumericLiteralTypeAnnotation(\n opts?: VirtualTypeAliases[\"NumericLiteralTypeAnnotation\"],\n ): void;\n isPure(opts?: VirtualTypeAliases[\"Pure\"]): boolean;\n isReferenced(opts?: VirtualTypeAliases[\"Referenced\"]): boolean;\n isReferencedIdentifier(\n this: NodePath,\n opts?: Opts,\n ): this is NodePath;\n isReferencedMemberExpression(\n this: NodePath,\n opts?: Opts,\n ): this is NodePath;\n isRestProperty(\n this: NodePath,\n opts?: Opts,\n ): this is NodePath;\n isScope(\n this: NodePath,\n opts?: Opts,\n ): this is NodePath;\n isSpreadProperty(\n this: NodePath,\n opts?: Opts,\n ): this is NodePath;\n isStatement(\n this: NodePath,\n opts?: Opts,\n ): this is NodePath;\n isUser(opts?: VirtualTypeAliases[\"User\"]): boolean;\n isVar(\n this: NodePath,\n opts?: Opts,\n ): this is NodePath;\n}\n\nexport function isReferencedIdentifier(this: NodePath, opts?: any): boolean {\n const { node, parent } = this;\n if (!isIdentifier(node, opts) && !isJSXMemberExpression(parent, opts)) {\n if (isJSXIdentifier(node, opts)) {\n if (isCompatTag(node.name)) return false;\n } else {\n // not a JSXIdentifier or an Identifier\n return false;\n }\n }\n\n // check if node is referenced\n return nodeIsReferenced(node, parent, this.parentPath.parent);\n}\n\nexport function isReferencedMemberExpression(this: NodePath): boolean {\n const { node, parent } = this;\n return isMemberExpression(node) && nodeIsReferenced(node, parent);\n}\n\nexport function isBindingIdentifier(this: NodePath): boolean {\n const { node, parent } = this;\n const grandparent = this.parentPath.parent;\n return isIdentifier(node) && isBinding(node, parent, grandparent);\n}\n\nexport function isStatement(this: NodePath): boolean {\n const { node, parent } = this;\n if (nodeIsStatement(node)) {\n if (isVariableDeclaration(node)) {\n if (isForXStatement(parent, { left: node })) return false;\n if (isForStatement(parent, { init: node })) return false;\n }\n\n return true;\n } else {\n return false;\n }\n}\n\nexport function isExpression(this: NodePath): boolean {\n if (this.isIdentifier()) {\n return this.isReferencedIdentifier();\n } else {\n return nodeIsExpression(this.node);\n }\n}\n\nexport function isScope(this: NodePath): boolean {\n return nodeIsScope(this.node, this.parent);\n}\n\nexport function isReferenced(this: NodePath): boolean {\n return nodeIsReferenced(this.node, this.parent);\n}\n\nexport function isBlockScoped(this: NodePath): boolean {\n return nodeIsBlockScoped(this.node);\n}\n\nexport function isVar(this: NodePath): boolean {\n return nodeIsVar(this.node);\n}\n\nexport function isUser(this: NodePath): boolean {\n return this.node && !!this.node.loc;\n}\n\nexport function isGenerated(this: NodePath): boolean {\n return !this.isUser();\n}\n\nexport function isPure(this: NodePath, constantsOnly?: boolean): boolean {\n return this.scope.isPure(this.node, constantsOnly);\n}\n\nexport function isFlow(this: NodePath): boolean {\n const { node } = this;\n if (nodeIsFlow(node)) {\n return true;\n } else if (isImportDeclaration(node)) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n } else if (isExportDeclaration(node)) {\n return node.exportKind === \"type\";\n } else if (isImportSpecifier(node)) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n } else {\n return false;\n }\n}\n\n// TODO: 7.0 Backwards Compat\nexport function isRestProperty(this: NodePath): boolean {\n return nodeIsRestElement(this.node) && this.parentPath?.isObjectPattern();\n}\n\nexport function isSpreadProperty(this: NodePath): boolean {\n return nodeIsRestElement(this.node) && this.parentPath?.isObjectExpression();\n}\n\nexport function isForAwaitStatement(this: NodePath): boolean {\n return isForOfStatement(this.node, { await: true });\n}\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n // eslint-disable-next-line no-restricted-globals\n exports.isExistentialTypeParam = function isExistentialTypeParam(\n this: NodePath,\n ): void {\n throw new Error(\n \"`path.isExistentialTypeParam` has been renamed to `path.isExistsTypeAnnotation()` in Babel 7.\",\n );\n };\n\n // eslint-disable-next-line no-restricted-globals\n exports.isNumericLiteralTypeAnnotation =\n function isNumericLiteralTypeAnnotation(this: NodePath): void {\n throw new Error(\n \"`path.isNumericLiteralTypeAnnotation()` has been renamed to `path.isNumberLiteralTypeAnnotation()` in Babel 7.\",\n );\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AAsBsB;EArBpBC,SAAS;EACTC,aAAa,EAAIC,iBAAiB;EAClCC,mBAAmB;EACnBC,YAAY,EAAIC,gBAAgB;EAChCC,MAAM,EAAIC,UAAU;EACpBC,cAAc;EACdC,eAAe;EACfC,YAAY;EACZC,mBAAmB;EACnBC,iBAAiB;EACjBC,eAAe;EACfC,qBAAqB;EACrBC,kBAAkB;EAClBC,aAAa,EAAIC,iBAAiB;EAClCC,YAAY,EAAIC,gBAAgB;EAChCC,OAAO,EAAIC,WAAW;EACtBC,WAAW,EAAIC,eAAe;EAC9BC,KAAK,EAAIC,SAAS;EAClBC,qBAAqB;EACrBC,KAAK;EACLC;AAAgB,IAAA9B,EAAA;AAGlB,MAAM;EAAE+B;AAAY,CAAC,GAAGF,KAAK;AA4EtB,SAASG,sBAAsBA,CAAiBC,IAAU,EAAW;EAC1E,MAAM;IAAEC,IAAI;IAAEC;EAAO,CAAC,GAAG,IAAI;EAC7B,IAAI,CAACvB,YAAY,CAACsB,IAAI,EAAED,IAAI,CAAC,IAAI,CAACjB,qBAAqB,CAACmB,MAAM,EAAEF,IAAI,CAAC,EAAE;IACrE,IAAIlB,eAAe,CAACmB,IAAI,EAAED,IAAI,CAAC,EAAE;MAC/B,IAAIF,WAAW,CAACG,IAAI,CAACE,IAAI,CAAC,EAAE,OAAO,KAAK;IAC1C,CAAC,MAA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MAAM,IAAIf,IAAI,CAACe,UAAU,KAAK,QAAQ;EACnE,CAAC,MAAM;IACL,OAAO,KAAK;EACd;AACF;AAGO,SAASE,cAAcA,CAAA,EAA0B;EAAA,IAAAC,gBAAA;EACtD,OAAOjC,iBAAiB,CAAC,IAAI,CAACe,IAAI,CAAC,MAAAkB,gBAAA,GAAI,IAAI,CAACf,UAAU,qBAAfe,gBAAA,CAAiBC,eAAe,CAAC,CAAC;AAC3E;AAEO,SAASC,gBAAgBA,CAAA,EAA0B;EAAA,IAAAC,iBAAA;EACxD,OAAOpC,iBAAiB,CAAC,IAAI,CAACe,IAAI,CAAC,MAAAqB,iBAAA,GAAI,IAAI,CAAClB,UAAU,qBAAfkB,iBAAA,CAAiBC,kBAAkB,CAAC,CAAC;AAC9E;AAEO,SAASC,mBAAmBA,CAAA,EAA0B;EAC3D,OAAO3B,gBAAgB,CAAC,IAAI,CAACI,IAAI,EAAE;IAAEwB,KAAK,EAAE;EAAK,CAAC,CAAC;AACrD;AAE+C;EAE7CC,OAAO,CAACC,sBAAsB,GAAG,SAASA,sBAAsBA,CAAA,EAExD;IACN,MAAM,IAAIC,KAAK,CACb,+FACF,CAAC;EACH,CAAC;EAGDF,OAAO,CAACG,8BAA8B,GACpC,SAASA,8BAA8BA,CAAA,EAAuB;IAC5D,MAAM,IAAID,KAAK,CACb,gHACF,CAAC;EACH,CAAC;AACL","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/traverse/lib/path/lib/virtual-types.js b/node_modules/@babel/traverse/lib/path/lib/virtual-types.js
new file mode 100644
index 00000000..0322f091
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/lib/virtual-types.js
@@ -0,0 +1,26 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.Var = exports.User = exports.Statement = exports.SpreadProperty = exports.Scope = exports.RestProperty = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = exports.Referenced = exports.Pure = exports.NumericLiteralTypeAnnotation = exports.Generated = exports.ForAwaitStatement = exports.Flow = exports.Expression = exports.ExistentialTypeParam = exports.BlockScoped = exports.BindingIdentifier = void 0;
+const ReferencedIdentifier = exports.ReferencedIdentifier = ["Identifier", "JSXIdentifier"];
+const ReferencedMemberExpression = exports.ReferencedMemberExpression = ["MemberExpression"];
+const BindingIdentifier = exports.BindingIdentifier = ["Identifier"];
+const Statement = exports.Statement = ["Statement"];
+const Expression = exports.Expression = ["Expression"];
+const Scope = exports.Scope = ["Scopable", "Pattern"];
+const Referenced = exports.Referenced = null;
+const BlockScoped = exports.BlockScoped = null;
+const Var = exports.Var = ["VariableDeclaration"];
+const User = exports.User = null;
+const Generated = exports.Generated = null;
+const Pure = exports.Pure = null;
+const Flow = exports.Flow = ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"];
+const RestProperty = exports.RestProperty = ["RestElement"];
+const SpreadProperty = exports.SpreadProperty = ["RestElement"];
+const ExistentialTypeParam = exports.ExistentialTypeParam = ["ExistsTypeAnnotation"];
+const NumericLiteralTypeAnnotation = exports.NumericLiteralTypeAnnotation = ["NumberLiteralTypeAnnotation"];
+const ForAwaitStatement = exports.ForAwaitStatement = ["ForOfStatement"];
+
+//# sourceMappingURL=virtual-types.js.map
diff --git a/node_modules/@babel/traverse/lib/path/lib/virtual-types.js.map b/node_modules/@babel/traverse/lib/path/lib/virtual-types.js.map
new file mode 100644
index 00000000..589b1e95
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/lib/virtual-types.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["ReferencedIdentifier","exports","ReferencedMemberExpression","BindingIdentifier","Statement","Expression","Scope","Referenced","BlockScoped","Var","User","Generated","Pure","Flow","RestProperty","SpreadProperty","ExistentialTypeParam","NumericLiteralTypeAnnotation","ForAwaitStatement"],"sources":["../../../src/path/lib/virtual-types.ts"],"sourcesContent":["import type * as t from \"@babel/types\";\n\nexport interface VirtualTypeAliases {\n BindingIdentifier: t.Identifier;\n BlockScoped: t.Node;\n ExistentialTypeParam: t.ExistsTypeAnnotation;\n Expression: t.Expression;\n Flow: t.Flow | t.ImportDeclaration | t.ExportDeclaration | t.ImportSpecifier;\n ForAwaitStatement: t.ForOfStatement;\n Generated: t.Node;\n NumericLiteralTypeAnnotation: t.NumberLiteralTypeAnnotation;\n Pure: t.Node;\n Referenced: t.Node;\n ReferencedIdentifier: t.Identifier | t.JSXIdentifier;\n ReferencedMemberExpression: t.MemberExpression;\n RestProperty: t.RestElement;\n Scope: t.Scopable | t.Pattern;\n SpreadProperty: t.RestElement;\n Statement: t.Statement;\n User: t.Node;\n Var: t.VariableDeclaration;\n}\n\ntype VirtualTypeMapping = readonly (t.Node[\"type\"] | keyof t.Aliases)[] | null;\n\nexport const ReferencedIdentifier: VirtualTypeMapping = [\n \"Identifier\",\n \"JSXIdentifier\",\n] as const;\n\nexport const ReferencedMemberExpression: VirtualTypeMapping = [\n \"MemberExpression\",\n] as const;\n\nexport const BindingIdentifier: VirtualTypeMapping = [\"Identifier\"] as const;\n\nexport const Statement: VirtualTypeMapping = [\"Statement\"] as const;\n\nexport const Expression: VirtualTypeMapping = [\"Expression\"] as const;\n\nexport const Scope: VirtualTypeMapping = [\"Scopable\", \"Pattern\"] as const;\n\nexport const Referenced: VirtualTypeMapping = null;\n\nexport const BlockScoped: VirtualTypeMapping = null;\n\nexport const Var: VirtualTypeMapping = [\"VariableDeclaration\"];\n\nexport const User: VirtualTypeMapping = null;\n\nexport const Generated: VirtualTypeMapping = null;\n\nexport const Pure: VirtualTypeMapping = null;\n\nexport const Flow: VirtualTypeMapping = [\n \"Flow\",\n \"ImportDeclaration\",\n \"ExportDeclaration\",\n \"ImportSpecifier\",\n] as const;\n\n// TODO: 7.0 Backwards Compat\nexport const RestProperty: VirtualTypeMapping = [\"RestElement\"] as const;\n\nexport const SpreadProperty: VirtualTypeMapping = [\"RestElement\"] as const;\n\nexport const ExistentialTypeParam: VirtualTypeMapping = [\n \"ExistsTypeAnnotation\",\n] as const;\n\nexport const NumericLiteralTypeAnnotation: VirtualTypeMapping = [\n \"NumberLiteralTypeAnnotation\",\n] as const;\n\nexport const ForAwaitStatement: VirtualTypeMapping = [\n \"ForOfStatement\",\n] as const;\n"],"mappings":";;;;;;AAyBO,MAAMA,oBAAwC,GAAAC,OAAA,CAAAD,oBAAA,GAAG,CACtD,YAAY,EACZ,eAAe,CACP;AAEH,MAAME,0BAA8C,GAAAD,OAAA,CAAAC,0BAAA,GAAG,CAC5D,kBAAkB,CACV;AAEH,MAAMC,iBAAqC,GAAAF,OAAA,CAAAE,iBAAA,GAAG,CAAC,YAAY,CAAU;AAErE,MAAMC,SAA6B,GAAAH,OAAA,CAAAG,SAAA,GAAG,CAAC,WAAW,CAAU;AAE5D,MAAMC,UAA8B,GAAAJ,OAAA,CAAAI,UAAA,GAAG,CAAC,YAAY,CAAU;AAE9D,MAAMC,KAAyB,GAAAL,OAAA,CAAAK,KAAA,GAAG,CAAC,UAAU,EAAE,SAAS,CAAU;AAElE,MAAMC,UAA8B,GAAAN,OAAA,CAAAM,UAAA,GAAG,IAAI;AAE3C,MAAMC,WAA+B,GAAAP,OAAA,CAAAO,WAAA,GAAG,IAAI;AAE5C,MAAMC,GAAuB,GAAAR,OAAA,CAAAQ,GAAA,GAAG,CAAC,qBAAqB,CAAC;AAEvD,MAAMC,IAAwB,GAAAT,OAAA,CAAAS,IAAA,GAAG,IAAI;AAErC,MAAMC,SAA6B,GAAAV,OAAA,CAAAU,SAAA,GAAG,IAAI;AAE1C,MAAMC,IAAwB,GAAAX,OAAA,CAAAW,IAAA,GAAG,IAAI;AAErC,MAAMC,IAAwB,GAAAZ,OAAA,CAAAY,IAAA,GAAG,CACtC,MAAM,EACN,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,CACT;AAGH,MAAMC,YAAgC,GAAAb,OAAA,CAAAa,YAAA,GAAG,CAAC,aAAa,CAAU;AAEjE,MAAMC,cAAkC,GAAAd,OAAA,CAAAc,cAAA,GAAG,CAAC,aAAa,CAAU;AAEnE,MAAMC,oBAAwC,GAAAf,OAAA,CAAAe,oBAAA,GAAG,CACtD,sBAAsB,CACd;AAEH,MAAMC,4BAAgD,GAAAhB,OAAA,CAAAgB,4BAAA,GAAG,CAC9D,6BAA6B,CACrB;AAEH,MAAMC,iBAAqC,GAAAjB,OAAA,CAAAiB,iBAAA,GAAG,CACnD,gBAAgB,CACR","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/traverse/lib/path/modification.js b/node_modules/@babel/traverse/lib/path/modification.js
new file mode 100644
index 00000000..9c9f6f52
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/modification.js
@@ -0,0 +1,230 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports._containerInsert = _containerInsert;
+exports._containerInsertAfter = _containerInsertAfter;
+exports._containerInsertBefore = _containerInsertBefore;
+exports._verifyNodeList = _verifyNodeList;
+exports.insertAfter = insertAfter;
+exports.insertBefore = insertBefore;
+exports.pushContainer = pushContainer;
+exports.unshiftContainer = unshiftContainer;
+exports.updateSiblingKeys = updateSiblingKeys;
+var _cache = require("../cache.js");
+var _index = require("./index.js");
+var _context = require("./context.js");
+var _removal = require("./removal.js");
+var _t = require("@babel/types");
+var _hoister = require("./lib/hoister.js");
+const {
+ arrowFunctionExpression,
+ assertExpression,
+ assignmentExpression,
+ blockStatement,
+ callExpression,
+ cloneNode,
+ expressionStatement,
+ isAssignmentExpression,
+ isCallExpression,
+ isExportNamedDeclaration,
+ isExpression,
+ isIdentifier,
+ isSequenceExpression,
+ isSuper,
+ thisExpression
+} = _t;
+function insertBefore(nodes_) {
+ _removal._assertUnremoved.call(this);
+ const nodes = _verifyNodeList.call(this, nodes_);
+ const {
+ parentPath,
+ parent
+ } = this;
+ if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || isExportNamedDeclaration(parent) || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
+ return parentPath.insertBefore(nodes);
+ } else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
+ if (this.node) nodes.push(this.node);
+ return this.replaceExpressionWithStatements(nodes);
+ } else if (Array.isArray(this.container)) {
+ return _containerInsertBefore.call(this, nodes);
+ } else if (this.isStatementOrBlock()) {
+ const node = this.node;
+ const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null);
+ this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : []));
+ return this.unshiftContainer("body", nodes);
+ } else {
+ throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
+ }
+}
+function _containerInsert(from, nodes) {
+ updateSiblingKeys.call(this, from, nodes.length);
+ const paths = [];
+ this.container.splice(from, 0, ...nodes);
+ for (let i = 0; i < nodes.length; i++) {
+ var _this$context;
+ const to = from + i;
+ const path = this.getSibling(to);
+ paths.push(path);
+ if ((_this$context = this.context) != null && _this$context.queue) {
+ _context.pushContext.call(path, this.context);
+ }
+ }
+ const contexts = _context._getQueueContexts.call(this);
+ for (const path of paths) {
+ _context.setScope.call(path);
+ path.debug("Inserted.");
+ for (const context of contexts) {
+ context.maybeQueue(path, true);
+ }
+ }
+ return paths;
+}
+function _containerInsertBefore(nodes) {
+ return _containerInsert.call(this, this.key, nodes);
+}
+function _containerInsertAfter(nodes) {
+ return _containerInsert.call(this, this.key + 1, nodes);
+}
+const last = arr => arr[arr.length - 1];
+function isHiddenInSequenceExpression(path) {
+ return isSequenceExpression(path.parent) && (last(path.parent.expressions) !== path.node || isHiddenInSequenceExpression(path.parentPath));
+}
+function isAlmostConstantAssignment(node, scope) {
+ if (!isAssignmentExpression(node) || !isIdentifier(node.left)) {
+ return false;
+ }
+ const blockScope = scope.getBlockParent();
+ return blockScope.hasOwnBinding(node.left.name) && blockScope.getOwnBinding(node.left.name).constantViolations.length <= 1;
+}
+function insertAfter(nodes_) {
+ _removal._assertUnremoved.call(this);
+ if (this.isSequenceExpression()) {
+ return last(this.get("expressions")).insertAfter(nodes_);
+ }
+ const nodes = _verifyNodeList.call(this, nodes_);
+ const {
+ parentPath,
+ parent
+ } = this;
+ if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || isExportNamedDeclaration(parent) || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
+ return parentPath.insertAfter(nodes.map(node => {
+ return isExpression(node) ? expressionStatement(node) : node;
+ }));
+ } else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
+ const self = this;
+ if (self.node) {
+ const node = self.node;
+ let {
+ scope
+ } = this;
+ if (scope.path.isPattern()) {
+ assertExpression(node);
+ self.replaceWith(callExpression(arrowFunctionExpression([], node), []));
+ self.get("callee.body").insertAfter(nodes);
+ return [self];
+ }
+ if (isHiddenInSequenceExpression(self)) {
+ nodes.unshift(node);
+ } else if (isCallExpression(node) && isSuper(node.callee)) {
+ nodes.unshift(node);
+ nodes.push(thisExpression());
+ } else if (isAlmostConstantAssignment(node, scope)) {
+ nodes.unshift(node);
+ nodes.push(cloneNode(node.left));
+ } else if (scope.isPure(node, true)) {
+ nodes.push(node);
+ } else {
+ if (parentPath.isMethod({
+ computed: true,
+ key: node
+ })) {
+ scope = scope.parent;
+ }
+ const temp = scope.generateDeclaredUidIdentifier();
+ nodes.unshift(expressionStatement(assignmentExpression("=", cloneNode(temp), node)));
+ nodes.push(expressionStatement(cloneNode(temp)));
+ }
+ }
+ return this.replaceExpressionWithStatements(nodes);
+ } else if (Array.isArray(this.container)) {
+ return _containerInsertAfter.call(this, nodes);
+ } else if (this.isStatementOrBlock()) {
+ const node = this.node;
+ const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null);
+ this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : []));
+ return this.pushContainer("body", nodes);
+ } else {
+ throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
+ }
+}
+function updateSiblingKeys(fromIndex, incrementBy) {
+ if (!this.parent) return;
+ const paths = (0, _cache.getCachedPaths)(this);
+ if (!paths) return;
+ for (const [, path] of paths) {
+ if (typeof path.key === "number" && path.container === this.container && path.key >= fromIndex) {
+ path.key += incrementBy;
+ }
+ }
+}
+function _verifyNodeList(nodes) {
+ if (!nodes) {
+ return [];
+ }
+ if (!Array.isArray(nodes)) {
+ nodes = [nodes];
+ }
+ for (let i = 0; i < nodes.length; i++) {
+ const node = nodes[i];
+ let msg;
+ if (!node) {
+ msg = "has falsy node";
+ } else if (typeof node !== "object") {
+ msg = "contains a non-object node";
+ } else if (!node.type) {
+ msg = "without a type";
+ } else if (node instanceof _index.default) {
+ msg = "has a NodePath when it expected a raw object";
+ }
+ if (msg) {
+ const type = Array.isArray(node) ? "array" : typeof node;
+ throw new Error(`Node list ${msg} with the index of ${i} and type of ${type}`);
+ }
+ }
+ return nodes;
+}
+function unshiftContainer(listKey, nodes) {
+ _removal._assertUnremoved.call(this);
+ nodes = _verifyNodeList.call(this, nodes);
+ const path = _index.default.get({
+ parentPath: this,
+ parent: this.node,
+ container: this.node[listKey],
+ listKey,
+ key: 0
+ }).setContext(this.context);
+ return _containerInsertBefore.call(path, nodes);
+}
+function pushContainer(listKey, nodes) {
+ _removal._assertUnremoved.call(this);
+ const verifiedNodes = _verifyNodeList.call(this, nodes);
+ const container = this.node[listKey];
+ const path = _index.default.get({
+ parentPath: this,
+ parent: this.node,
+ container: container,
+ listKey,
+ key: container.length
+ }).setContext(this.context);
+ return path.replaceWithMultiple(verifiedNodes);
+}
+{
+ exports.hoist = function hoist(scope = this.scope) {
+ const hoister = new _hoister.default(this, scope);
+ return hoister.run();
+ };
+}
+
+//# sourceMappingURL=modification.js.map
diff --git a/node_modules/@babel/traverse/lib/path/modification.js.map b/node_modules/@babel/traverse/lib/path/modification.js.map
new file mode 100644
index 00000000..9aab93fd
--- /dev/null
+++ b/node_modules/@babel/traverse/lib/path/modification.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["_cache","require","_index","_context","_removal","_t","_hoister","arrowFunctionExpression","assertExpression","assignmentExpression","blockStatement","callExpression","cloneNode","expressionStatement","isAssignmentExpression","isCallExpression","isExportNamedDeclaration","isExpression","isIdentifier","isSequenceExpression","isSuper","thisExpression","insertBefore","nodes_","_assertUnremoved","call","nodes","_verifyNodeList","parentPath","parent","isExpressionStatement","isLabeledStatement","isExportDefaultDeclaration","isDeclaration","isNodeType","isJSXElement","isForStatement","key","node","push","replaceExpressionWithStatements","Array","isArray","container","_containerInsertBefore","isStatementOrBlock","shouldInsertCurrentNode","expression","replaceWith","unshiftContainer","Error","_containerInsert","from","updateSiblingKeys","length","paths","splice","i","_this$context","to","path","getSibling","context","queue","pushContext","contexts","_getQueueContexts","setScope","debug","maybeQueue","_containerInsertAfter","last","arr","isHiddenInSequenceExpression","expressions","isAlmostConstantAssignment","scope","left","blockScope","getBlockParent","hasOwnBinding","name","getOwnBinding","constantViolations","insertAfter","get","map","self","isPattern","unshift","callee","isPure","isMethod","computed","temp","generateDeclaredUidIdentifier","pushContainer","fromIndex","incrementBy","getCachedPaths","msg","type","NodePath","listKey","setContext","verifiedNodes","replaceWithMultiple","exports","hoist","hoister","PathHoister","run"],"sources":["../../src/path/modification.ts"],"sourcesContent":["// This file contains methods that modify the path/node in some ways.\n\nimport { getCachedPaths } from \"../cache.ts\";\nimport NodePath from \"./index.ts\";\nimport { _getQueueContexts, pushContext, setScope } from \"./context.ts\";\nimport { _assertUnremoved } from \"./removal.ts\";\nimport {\n arrowFunctionExpression,\n assertExpression,\n assignmentExpression,\n blockStatement,\n callExpression,\n cloneNode,\n expressionStatement,\n isAssignmentExpression,\n isCallExpression,\n isExportNamedDeclaration,\n isExpression,\n isIdentifier,\n isSequenceExpression,\n isSuper,\n thisExpression,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type Scope from \"../scope/index.ts\";\n\n/**\n * Insert the provided nodes before the current one.\n */\n\nexport function insertBefore(\n this: NodePath,\n nodes_: t.Node | t.Node[],\n): NodePath[] {\n _assertUnremoved.call(this);\n\n const nodes = _verifyNodeList.call(this, nodes_);\n\n const { parentPath, parent } = this;\n\n if (\n parentPath.isExpressionStatement() ||\n parentPath.isLabeledStatement() ||\n // https://github.com/babel/babel/issues/15293\n // When Babel transforms `export class String { field }`, the class properties plugin will inject the defineProperty\n // helper, which depends on the builtins e.g. String, Number, Symbol, etc. To prevent them from being shadowed by local\n // exports, the helper injector replaces the named export into `class _String { field }; export { _String as String }`,\n // with `parentPath` here changed to the moved ClassDeclaration, causing rare inconsistency between `parent` and `parentPath`.\n // Here we retrieve the parent type from the `parent` property. This is a temporary fix and we should revisit when\n // helpers should get injected.\n isExportNamedDeclaration(parent) ||\n (parentPath.isExportDefaultDeclaration() && this.isDeclaration())\n ) {\n return parentPath.insertBefore(nodes);\n } else if (\n (this.isNodeType(\"Expression\") && !this.isJSXElement()) ||\n (parentPath.isForStatement() && this.key === \"init\")\n ) {\n if (this.node) nodes.push(this.node);\n // @ts-expect-error todo(flow->ts): check that nodes is an array of statements\n return this.replaceExpressionWithStatements(nodes);\n } else if (Array.isArray(this.container)) {\n return _containerInsertBefore.call(this, nodes);\n } else if (this.isStatementOrBlock()) {\n const node = this.node as t.Statement;\n const shouldInsertCurrentNode =\n node &&\n (!this.isExpressionStatement() ||\n (node as t.ExpressionStatement).expression != null);\n\n this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : []));\n return (this as NodePath).unshiftContainer(\n \"body\",\n // @ts-expect-error Fixme: refine nodes to t.BlockStatement[\"body\"] when this is a BlockStatement path\n nodes,\n );\n } else {\n throw new Error(\n \"We don't know what to do with this node type. \" +\n \"We were previously a Statement but we can't fit in here?\",\n );\n }\n}\n\nexport function _containerInsert(\n this: NodePath,\n from: number,\n nodes: N[],\n): NodePath[] {\n updateSiblingKeys.call(this, from, nodes.length);\n\n const paths: NodePath[] = [];\n\n // @ts-expect-error todo(flow->ts): this.container could be a NodePath\n this.container.splice(from, 0, ...nodes);\n for (let i = 0; i < nodes.length; i++) {\n const to = from + i;\n const path = this.getSibling(to) as NodePath;\n paths.push(path);\n\n if (this.context?.queue) {\n pushContext.call(path, this.context);\n }\n }\n\n const contexts = _getQueueContexts.call(this);\n\n for (const path of paths) {\n setScope.call(path);\n path.debug(\"Inserted.\");\n\n for (const context of contexts) {\n context.maybeQueue(path, true);\n }\n }\n\n return paths;\n}\n\nexport function _containerInsertBefore(\n this: NodePath,\n nodes: N[],\n) {\n return _containerInsert.call(this, this.key as number, nodes);\n}\n\nexport function _containerInsertAfter