{"version":3,"names":["_core","require","buildClassDecorator","template","statement","buildClassPrototype","buildGetDescriptor","buildGetObjectInitializer","WARNING_CALLS","WeakSet","applyEnsureOrdering","path","decorators","isClass","get","reduce","acc","prop","concat","node","identDecorators","filter","decorator","t","isIdentifier","expression","length","sequenceExpression","map","id","scope","generateDeclaredUidIdentifier","assignmentExpression","applyClassDecorators","classPath","hasClassDecorators","name","dec","reverse","CLASS_REF","cloneNode","DECORATOR","INNER","classNode","_classNode$decorators","applyMethodDecorators","state","hasMethodDecorators","body","applyTargetDecorators","some","_node$decorators","applyObjectDecorators","properties","type","decoratedProps","exprs","computed","buildCodeFrameError","property","isLiteral","key","stringLiteral","target","static","isClassProperty","descriptor","initializer","value","functionExpression","blockStatement","returnStatement","nullLiteral","callExpression","addHelper","thisExpression","add","push","arrayExpression","objectExpression","objectProperty","identifier","booleanLiteral","isObjectProperty","TEMP","TARGET","PROPERTY","decoratedClassToExpression","ref","generateUidIdentifier","variableDeclaration","variableDeclarator","toExpression","visitor","ExportDefaultDeclaration","decl","isClassDeclaration","replacement","varDeclPath","replaceWithMultiple","exportNamedDeclaration","exportSpecifier","declarations","registerDeclaration","ClassDeclaration","newPath","replaceWith","binding","getOwnBinding","ClassExpression","decoratedClass","ObjectExpression","decoratedObject","AssignmentExpression","has","right","CallExpression","arguments","callee","_default","exports","default"],"sources":["../src/transformer-legacy.ts"],"sourcesContent":["// Fork of https://github.com/loganfsmyth/babel-plugin-proposal-decorators-legacy\n\nimport { template, types as t, type PluginPass } from \"@babel/core\";\nimport type { NodePath, Visitor } from \"@babel/traverse\";\n\nconst buildClassDecorator = template.statement(`\n DECORATOR(CLASS_REF = INNER) || CLASS_REF;\n`) as (replacements: {\n DECORATOR: t.Expression;\n CLASS_REF: t.Identifier;\n INNER: t.Expression;\n}) => t.ExpressionStatement;\n\nconst buildClassPrototype = template(`\n CLASS_REF.prototype;\n`) as (replacements: { CLASS_REF: t.Identifier }) => t.ExpressionStatement;\n\nconst buildGetDescriptor = template(`\n Object.getOwnPropertyDescriptor(TARGET, PROPERTY);\n`) as (replacements: {\n TARGET: t.Expression;\n PROPERTY: t.Literal;\n}) => t.ExpressionStatement;\n\nconst buildGetObjectInitializer = template(`\n (TEMP = Object.getOwnPropertyDescriptor(TARGET, PROPERTY), (TEMP = TEMP ? TEMP.value : undefined), {\n enumerable: true,\n configurable: true,\n writable: true,\n initializer: function(){\n return TEMP;\n }\n })\n`) as (replacements: {\n TEMP: t.Identifier;\n TARGET: t.Expression;\n PROPERTY: t.Literal;\n}) => t.ExpressionStatement;\n\nconst WARNING_CALLS = new WeakSet();\n\n// legacy decorator does not support ClassAccessorProperty\ntype ClassDecoratableElement =\n | t.ClassMethod\n | t.ClassPrivateMethod\n | t.ClassProperty\n | t.ClassPrivateProperty;\n\n/**\n * If the decorator expressions are non-identifiers, hoist them to before the class so we can be sure\n * that they are evaluated in order.\n */\nfunction applyEnsureOrdering(\n path: NodePath,\n) {\n // TODO: This should probably also hoist computed properties.\n const decorators: t.Decorator[] = (\n path.isClass()\n ? [\n path,\n ...(path.get(\"body.body\") as NodePath[]),\n ]\n : path.get(\"properties\")\n ).reduce(\n (\n acc: t.Decorator[],\n prop: NodePath<\n t.ObjectMember | t.ClassExpression | ClassDecoratableElement\n >,\n ) => acc.concat(prop.node.decorators || []),\n [],\n );\n\n const identDecorators = decorators.filter(\n decorator => !t.isIdentifier(decorator.expression),\n );\n if (identDecorators.length === 0) return;\n\n return t.sequenceExpression(\n identDecorators\n .map((decorator): t.Expression => {\n const expression = decorator.expression;\n const id = (decorator.expression =\n path.scope.generateDeclaredUidIdentifier(\"dec\"));\n return t.assignmentExpression(\"=\", id, expression);\n })\n .concat([path.node]),\n );\n}\n\n/**\n * Given a class expression with class-level decorators, create a new expression\n * with the proper decorated behavior.\n */\nfunction applyClassDecorators(classPath: NodePath) {\n if (!hasClassDecorators(classPath.node)) return;\n\n const decorators = classPath.node.decorators || [];\n classPath.node.decorators = null;\n\n const name = classPath.scope.generateDeclaredUidIdentifier(\"class\");\n\n return decorators\n .map(dec => dec.expression)\n .reverse()\n .reduce(function (acc, decorator) {\n return buildClassDecorator({\n CLASS_REF: t.cloneNode(name),\n DECORATOR: t.cloneNode(decorator),\n INNER: acc,\n }).expression;\n }, classPath.node);\n}\n\nfunction hasClassDecorators(classNode: t.Class) {\n return !!classNode.decorators?.length;\n}\n\n/**\n * Given a class expression with method-level decorators, create a new expression\n * with the proper decorated behavior.\n */\nfunction applyMethodDecorators(\n path: NodePath,\n state: PluginPass,\n) {\n if (!hasMethodDecorators(path.node.body.body)) return;\n\n return applyTargetDecorators(\n path,\n state,\n // @ts-expect-error ClassAccessorProperty is not supported in legacy decorator\n path.node.body.body,\n );\n}\n\nfunction hasMethodDecorators(\n body: t.ClassBody[\"body\"] | t.ObjectExpression[\"properties\"],\n) {\n return body.some(\n node =>\n // @ts-expect-error decorators not in SpreadElement/StaticBlock\n node.decorators?.length,\n );\n}\n\n/**\n * Given an object expression with property decorators, create a new expression\n * with the proper decorated behavior.\n */\nfunction applyObjectDecorators(\n path: NodePath,\n state: PluginPass,\n) {\n if (!hasMethodDecorators(path.node.properties)) return;\n\n return applyTargetDecorators(\n path,\n state,\n path.node.properties.filter(\n (prop): prop is t.ObjectMember => prop.type !== \"SpreadElement\",\n ),\n );\n}\n\n/**\n * A helper to pull out property decorators into a sequence expression.\n */\nfunction applyTargetDecorators(\n path: NodePath,\n state: PluginPass,\n decoratedProps: (t.ObjectMember | ClassDecoratableElement)[],\n) {\n const name = path.scope.generateDeclaredUidIdentifier(\n path.isClass() ? \"class\" : \"obj\",\n );\n\n const exprs = decoratedProps.reduce(function (acc, node) {\n let decorators: t.Decorator[] = [];\n if (node.decorators != null) {\n decorators = node.decorators;\n node.decorators = null;\n }\n\n if (decorators.length === 0) return acc;\n\n if (\n // @ts-expect-error computed is not in ClassPrivateProperty\n node.computed\n ) {\n throw path.buildCodeFrameError(\n \"Computed method/property decorators are not yet supported.\",\n );\n }\n\n const property: t.Literal = t.isLiteral(node.key)\n ? node.key\n : t.stringLiteral(\n // @ts-expect-error: should we handle ClassPrivateProperty?\n node.key.name,\n );\n\n const target =\n path.isClass() && !(node as ClassDecoratableElement).static\n ? buildClassPrototype({\n CLASS_REF: name,\n }).expression\n : name;\n\n if (t.isClassProperty(node, { static: false })) {\n const descriptor = path.scope.generateDeclaredUidIdentifier(\"descriptor\");\n\n const initializer = node.value\n ? t.functionExpression(\n null,\n [],\n t.blockStatement([t.returnStatement(node.value)]),\n )\n : t.nullLiteral();\n\n node.value = t.callExpression(\n state.addHelper(\"initializerWarningHelper\"),\n [descriptor, t.thisExpression()],\n );\n\n WARNING_CALLS.add(node.value);\n\n acc.push(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(descriptor),\n t.callExpression(state.addHelper(\"applyDecoratedDescriptor\"), [\n t.cloneNode(target),\n t.cloneNode(property),\n t.arrayExpression(\n decorators.map(dec => t.cloneNode(dec.expression)),\n ),\n t.objectExpression([\n t.objectProperty(\n t.identifier(\"configurable\"),\n t.booleanLiteral(true),\n ),\n t.objectProperty(\n t.identifier(\"enumerable\"),\n t.booleanLiteral(true),\n ),\n t.objectProperty(\n t.identifier(\"writable\"),\n t.booleanLiteral(true),\n ),\n t.objectProperty(t.identifier(\"initializer\"), initializer),\n ]),\n ]),\n ),\n );\n } else {\n acc.push(\n t.callExpression(state.addHelper(\"applyDecoratedDescriptor\"), [\n t.cloneNode(target),\n t.cloneNode(property),\n t.arrayExpression(decorators.map(dec => t.cloneNode(dec.expression))),\n t.isObjectProperty(node) || t.isClassProperty(node, { static: true })\n ? buildGetObjectInitializer({\n TEMP: path.scope.generateDeclaredUidIdentifier(\"init\"),\n TARGET: t.cloneNode(target),\n PROPERTY: t.cloneNode(property),\n }).expression\n : buildGetDescriptor({\n TARGET: t.cloneNode(target),\n PROPERTY: t.cloneNode(property),\n }).expression,\n t.cloneNode(target),\n ]),\n );\n }\n\n return acc;\n }, []);\n\n return t.sequenceExpression([\n t.assignmentExpression(\"=\", t.cloneNode(name), path.node),\n t.sequenceExpression(exprs),\n t.cloneNode(name),\n ]);\n}\n\nfunction decoratedClassToExpression({ node, scope }: NodePath) {\n if (!hasClassDecorators(node) && !hasMethodDecorators(node.body.body)) {\n return;\n }\n\n const ref = node.id\n ? t.cloneNode(node.id)\n : scope.generateUidIdentifier(\"class\");\n\n return t.variableDeclaration(\"let\", [\n t.variableDeclarator(ref, t.toExpression(node)),\n ]);\n}\n\nconst visitor: Visitor = {\n ExportDefaultDeclaration(path) {\n const decl = path.get(\"declaration\");\n if (!decl.isClassDeclaration()) return;\n\n const replacement = decoratedClassToExpression(decl);\n if (replacement) {\n const [varDeclPath] = path.replaceWithMultiple([\n replacement,\n t.exportNamedDeclaration(null, [\n t.exportSpecifier(\n // @ts-expect-error todo(flow->ts) might be add more specific return type for decoratedClassToExpression\n t.cloneNode(replacement.declarations[0].id),\n t.identifier(\"default\"),\n ),\n ]),\n ]);\n\n if (!decl.node.id) {\n path.scope.registerDeclaration(varDeclPath);\n }\n }\n },\n ClassDeclaration(path) {\n const replacement = decoratedClassToExpression(path);\n if (replacement) {\n const [newPath] = path.replaceWith(replacement);\n\n const decl = newPath.get(\"declarations.0\");\n const id = decl.node.id as t.Identifier;\n\n // TODO: Maybe add this logic to @babel/traverse\n const binding = path.scope.getOwnBinding(id.name);\n binding.identifier = id;\n binding.path = decl;\n }\n },\n ClassExpression(path, state) {\n // Create a replacement for the class node if there is one. We do one pass to replace classes with\n // class decorators, and a second pass to process method decorators.\n const decoratedClass =\n applyEnsureOrdering(path) ||\n applyClassDecorators(path) ||\n applyMethodDecorators(path, state);\n\n if (decoratedClass) path.replaceWith(decoratedClass);\n },\n ObjectExpression(path, state) {\n const decoratedObject =\n applyEnsureOrdering(path) || applyObjectDecorators(path, state);\n\n if (decoratedObject) path.replaceWith(decoratedObject);\n },\n\n AssignmentExpression(path, state) {\n if (!WARNING_CALLS.has(path.node.right)) return;\n\n path.replaceWith(\n t.callExpression(state.addHelper(\"initializerDefineProperty\"), [\n // @ts-expect-error todo(flow->ts) typesafe NodePath.get\n t.cloneNode(path.get(\"left.object\").node),\n t.stringLiteral(\n // @ts-expect-error todo(flow->ts) typesafe NodePath.get\n path.get(\"left.property\").node.name ||\n // @ts-expect-error todo(flow->ts) typesafe NodePath.get\n path.get(\"left.property\").node.value,\n ),\n // @ts-expect-error todo(flow->ts)\n t.cloneNode(path.get(\"right.arguments\")[0].node),\n // @ts-expect-error todo(flow->ts)\n t.cloneNode(path.get(\"right.arguments\")[1].node),\n ]),\n );\n },\n\n CallExpression(path, state) {\n if (path.node.arguments.length !== 3) return;\n if (!WARNING_CALLS.has(path.node.arguments[2])) return;\n\n // If the class properties plugin isn't enabled, this line will add an unused helper\n // to the code. It's not ideal, but it's ok since the configuration is not valid anyway.\n // @ts-expect-error todo(flow->ts) check that `callee` is Identifier\n if (path.node.callee.name !== state.addHelper(\"defineProperty\").name) {\n return;\n }\n\n path.replaceWith(\n t.callExpression(state.addHelper(\"initializerDefineProperty\"), [\n t.cloneNode(path.get(\"arguments\")[0].node),\n t.cloneNode(path.get(\"arguments\")[1].node),\n // @ts-expect-error todo(flow->ts)\n t.cloneNode(path.get(\"arguments.2.arguments\")[0].node),\n // @ts-expect-error todo(flow->ts)\n t.cloneNode(path.get(\"arguments.2.arguments\")[1].node),\n ]),\n );\n },\n};\n\nexport default visitor;\n"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAGA,MAAMC,mBAAmB,GAAGC,cAAQ,CAACC,SAAS,CAAE;AAChD;AACA,CAAC,CAI0B;AAE3B,MAAMC,mBAAmB,GAAG,IAAAF,cAAQ,EAAE;AACtC;AACA,CAAC,CAAyE;AAE1E,MAAMG,kBAAkB,GAAG,IAAAH,cAAQ,EAAE;AACrC;AACA,CAAC,CAG0B;AAE3B,MAAMI,yBAAyB,GAAG,IAAAJ,cAAQ,EAAE;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAI0B;AAE3B,MAAM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