You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
44 KiB

{"version":3,"names":["_helperPluginUtils","require","_core","_helperModuleTransforms","_helperValidatorIdentifier","buildTemplate","template","statement","buildExportAll","MISSING_PLUGIN_WARNING","MISSING_PLUGIN_ERROR","getExportSpecifierName","node","stringSpecifiers","type","name","stringValue","value","isIdentifierName","add","Error","constructExportCall","path","exportIdent","exportNames","exportValues","exportStarTarget","statements","length","push","t","expressionStatement","callExpression","stringLiteral","objectProperties","i","exportName","exportValue","objectProperty","has","identifier","objectExpression","exportObj","scope","generateUid","variableDeclaration","variableDeclarator","KEY","generateUidIdentifier","EXPORT_OBJ","TARGET","assignmentExpression","memberExpression","_default","exports","default","declare","api","options","assertVersion","systemGlobal","allowTopLevelThis","reassignmentVisited","WeakSet","reassignmentVisitor","AssignmentExpression|UpdateExpression","arg","isAssignmentExpression","get","isObjectPattern","isArrayPattern","exprs","Object","keys","getBindingIdentifiers","getBinding","exportedNames","exportedName","buildCall","expression","replaceWith","sequenceExpression","isIdentifier","isPostUpdateExpression","isUpdateExpression","prefix","binaryExpression","operator","unaryExpression","cloneNode","argument","numericLiteral","pre","file","set","visitor","types","importExpression","state","isCallExpression","isImport","callee","console","warn","buildDynamicImport","specifier","contextIdent","MetaProperty","meta","property","ReferencedIdentifier","hasBinding","Program","enter","Set","rewriteThis","exit","exportMap","create","modules","beforeBody","setters","sources","variableIds","removedPaths","addExportName","key","val","pushModule","source","specifiers","module","forEach","m","imports","concat","buildExportCall","body","isFunctionDeclaration","isClassDeclaration","id","toExpression","isVariableDeclaration","kind","isImportDeclaration","removeBinding","remove","isExportAllDeclaration","isExportDefaultDeclaration","declar","declaration","buildUndefinedNode","isExportNamedDeclaration","isFunction","isClass","nodes","local","exported","binding","replaceWithMultiple","setterBody","target","isImportNamespaceSpecifier","isImportDefaultSpecifier","importSpecifier","isImportSpecifier","imported","hasExportStar","isExportSpecifier","isStringLiteral","functionExpression","blockStatement","moduleName","getModuleName","opts","_path$scope","_path$scope$hoistVari","hoistVariables","Scope","prototype","hasInit","unshift","map","traverse","hasTLA","AwaitExpression","stop","Function","skip","noScope","SYSTEM_REGISTER","BEFORE_BODY","MODULE_NAME","SETTERS","arrayExpression","EXECUTE","SOURCES","EXPORT_IDENTIFIER","CONTEXT_IDENTIFIER","requeue"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport { template, types as t } from \"@babel/core\";\nimport type { PluginPass, NodePath, Scope, Visitor } from \"@babel/core\";\nimport {\n buildDynamicImport,\n getModuleName,\n rewriteThis,\n} from \"@babel/helper-module-transforms\";\nimport type { PluginOptions } from \"@babel/helper-module-transforms\";\nimport { isIdentifierName } from \"@babel/helper-validator-identifier\";\n\nconst buildTemplate = template.statement(`\n SYSTEM_REGISTER(MODULE_NAME, SOURCES, function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {\n \"use strict\";\n BEFORE_BODY;\n return {\n setters: SETTERS,\n execute: EXECUTE,\n };\n });\n`);\n\nconst buildExportAll = template.statement(`\n for (var KEY in TARGET) {\n if (KEY !== \"default\" && KEY !== \"__esModule\") EXPORT_OBJ[KEY] = TARGET[KEY];\n }\n`);\n\nconst MISSING_PLUGIN_WARNING = `\\\nWARNING: Dynamic import() transformation must be enabled using the\n @babel/plugin-transform-dynamic-import plugin. Babel 8 will\n no longer transform import() without using that plugin.\n`;\n\nconst MISSING_PLUGIN_ERROR = `\\\nERROR: Dynamic import() transformation must be enabled using the\n @babel/plugin-transform-dynamic-import plugin. Babel 8\n no longer transforms import() without using that plugin.\n`;\n\n//todo: use getExportSpecifierName in `helper-module-transforms` when this library is refactored to NodePath usage.\n\nexport function getExportSpecifierName(\n node: t.Node,\n stringSpecifiers: Set<string>,\n): string {\n if (node.type === \"Identifier\") {\n return node.name;\n } else if (node.type === \"StringLiteral\") {\n const stringValue = node.value;\n // add specifier value to `stringSpecifiers` only when it can not be converted to an identifier name\n // i.e In `import { \"foo\" as bar }`\n // we do not consider `\"foo\"` to be a `stringSpecifier` because we can treat it as\n // `import { foo as bar }`\n // This helps minimize the size of `stringSpecifiers` and reduce overhead of checking valid identifier names\n // when building transpiled code from metadata\n if (!isIdentifierName(stringValue)) {\n stringSpecifiers.add(stringValue);\n }\n return stringValue;\n } else {\n throw new Error(\n `Expected export specifier to be either Identifier or StringLiteral, got ${node.type}`,\n );\n }\n}\n\ntype PluginState = {\n contextIdent: string;\n // List of names that should only be printed as string literals.\n // i.e. `import { \"any unicode\" as foo } from \"some-module\"`\n // `stringSpecifiers` is Set(1) [\"any unicode\"]\n // In most cases `stringSpecifiers` is an empty Set\n stringSpecifiers: Set<string>;\n};\n\ntype ModuleMetadata = {\n key: string;\n imports: any[];\n exports: any[];\n};\n\nfunction constructExportCall(\n path: NodePath<t.Program>,\n exportIdent: t.Identifier,\n exportNames: string[],\n exportValues: t.Expression[],\n exportStarTarget: t.Identifier | null,\n stringSpecifiers: Set<string>,\n) {\n const statements = [];\n if (!exportStarTarget) {\n if (exportNames.length === 1) {\n statements.push(\n t.expressionStatement(\n t.callExpression(exportIdent, [\n t.stringLiteral(exportNames[0]),\n exportValues[0],\n ]),\n ),\n );\n } else {\n const objectProperties = [];\n for (let i = 0; i < exportNames.length; i++) {\n const exportName = exportNames[i];\n const exportValue = exportValues[i];\n objectProperties.push(\n t.objectProperty(\n stringSpecifiers.has(exportName)\n ? t.stringLiteral(exportName)\n : t.identifier(exportName),\n exportValue,\n ),\n );\n }\n statements.push(\n t.expressionStatement(\n t.callExpression(exportIdent, [t.objectExpression(objectProperties)]),\n ),\n );\n }\n } else {\n const exportObj = path.scope.generateUid(\"exportObj\");\n\n statements.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.identifier(exportObj), t.objectExpression([])),\n ]),\n );\n\n statements.push(\n buildExportAll({\n KEY: path.scope.generateUidIdentifier(\"key\"),\n EXPORT_OBJ: t.identifier(exportObj),\n TARGET: exportStarTarget,\n }),\n );\n\n for (let i = 0; i < exportNames.length; i++) {\n const exportName = exportNames[i];\n const exportValue = exportValues[i];\n\n statements.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(\n t.identifier(exportObj),\n t.identifier(exportName),\n ),\n exportValue,\n ),\n ),\n );\n }\n\n statements.push(\n t.expressionStatement(\n t.callExpression(exportIdent, [t.identifier(exportObj)]),\n ),\n );\n }\n return statements;\n}\n\nexport interface Options extends PluginOptions {\n allowTopLevelThis?: boolean;\n systemGlobal?: string;\n}\n\ntype ReassignmentVisitorState = {\n scope: Scope;\n exports: any;\n buildCall: (name: string, value: t.Expression) => t.ExpressionStatement;\n};\n\nexport default declare<PluginState>((api, options: Options) => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n const { systemGlobal = \"System\", allowTopLevelThis = false } = options;\n const reassignmentVisited = new WeakSet();\n\n const reassignmentVisitor: Visitor<ReassignmentVisitorState> = {\n \"AssignmentExpression|UpdateExpression\"(\n path: NodePath<t.AssignmentExpression | t.UpdateExpression>,\n ) {\n if (reassignmentVisited.has(path.node)) return;\n reassignmentVisited.add(path.node);\n\n const arg = path.isAssignmentExpression()\n ? path.get(\"left\")\n : path.get(\"argument\");\n\n if (arg.isObjectPattern() || arg.isArrayPattern()) {\n const exprs: t.SequenceExpression[\"expressions\"] = [path.node];\n for (const name of Object.keys(arg.getBindingIdentifiers())) {\n if (this.scope.getBinding(name) !== path.scope.getBinding(name)) {\n return;\n }\n const exportedNames = this.exports[name];\n if (!exportedNames) continue;\n for (const exportedName of exportedNames) {\n exprs.push(\n this.buildCall(exportedName, t.identifier(name)).expression,\n );\n }\n }\n path.replaceWith(t.sequenceExpression(exprs));\n return;\n }\n\n if (!arg.isIdentifier()) return;\n\n const name = arg.node.name;\n\n // redeclared in this scope\n if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return;\n\n const exportedNames = this.exports[name];\n if (!exportedNames) return;\n\n let node: t.Expression = path.node;\n\n // if it is a non-prefix update expression (x++ etc)\n // then we must replace with the expression (_export('x', x + 1), x++)\n // in order to ensure the same update expression value\n const isPostUpdateExpression = t.isUpdateExpression(node, {\n prefix: false,\n });\n if (isPostUpdateExpression) {\n node = t.binaryExpression(\n // @ts-expect-error The operator of a post-update expression must be \"++\" | \"--\"\n node.operator[0],\n t.unaryExpression(\n \"+\",\n t.cloneNode(\n // @ts-expect-error node is UpdateExpression\n node.argument,\n ),\n ),\n t.numericLiteral(1),\n );\n }\n\n for (const exportedName of exportedNames) {\n node = this.buildCall(exportedName, node).expression;\n }\n\n if (isPostUpdateExpression) {\n node = t.sequenceExpression([node, path.node]);\n }\n\n path.replaceWith(node);\n },\n };\n\n return {\n name: \"transform-modules-systemjs\",\n\n pre() {\n this.file.set(\"@babel/plugin-transform-modules-*\", \"systemjs\");\n },\n\n visitor: {\n [\"CallExpression\" +\n (api.types.importExpression ? \"|ImportExpression\" : \"\")](\n this: PluginPass & PluginState,\n path: NodePath<t.CallExpression | t.ImportExpression>,\n state: PluginState,\n ) {\n if (path.isCallExpression() && !t.isImport(path.node.callee)) return;\n if (path.isCallExpression()) {\n if (!this.file.has(\"@babel/plugin-proposal-dynamic-import\")) {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(MISSING_PLUGIN_ERROR);\n } else {\n console.warn(MISSING_PLUGIN_WARNING);\n }\n }\n } else {\n // when createImportExpressions is true, we require the dynamic import transform\n if (!this.file.has(\"@babel/plugin-proposal-dynamic-import\")) {\n throw new Error(MISSING_PLUGIN_ERROR);\n }\n }\n path.replaceWith(\n buildDynamicImport(path.node, false, true, specifier =>\n t.callExpression(\n t.memberExpression(\n t.identifier(state.contextIdent),\n t.identifier(\"import\"),\n ),\n [specifier],\n ),\n ),\n );\n },\n\n MetaProperty(path, state: PluginState) {\n if (\n path.node.meta.name === \"import\" &&\n path.node.property.name === \"meta\"\n ) {\n path.replaceWith(\n t.memberExpression(\n t.identifier(state.contextIdent),\n t.identifier(\"meta\"),\n ),\n );\n }\n },\n\n ReferencedIdentifier(path, state) {\n if (\n path.node.name === \"__moduleName\" &&\n !path.scope.hasBinding(\"__moduleName\")\n ) {\n path.replaceWith(\n t.memberExpression(\n t.identifier(state.contextIdent),\n t.identifier(\"id\"),\n ),\n );\n }\n },\n\n Program: {\n enter(path, state) {\n state.contextIdent = path.scope.generateUid(\"context\");\n state.stringSpecifiers = new Set();\n if (!allowTopLevelThis) {\n rewriteThis(path);\n }\n },\n exit(path, state) {\n const scope = path.scope;\n const exportIdent = scope.generateUid(\"export\");\n const { contextIdent, stringSpecifiers } = state;\n\n const exportMap: Record<string, string[]> = Object.create(null);\n const modules: ModuleMetadata[] = [];\n\n const beforeBody = [];\n const setters: t.Expression[] = [];\n const sources: t.StringLiteral[] = [];\n const variableIds = [];\n const removedPaths = [];\n\n function addExportName(key: string, val: string) {\n exportMap[key] = exportMap[key] || [];\n exportMap[key].push(val);\n }\n\n function pushModule(\n source: string,\n key: \"imports\" | \"exports\",\n specifiers: t.ModuleSpecifier[] | t.ExportAllDeclaration,\n ) {\n let module: ModuleMetadata;\n modules.forEach(function (m) {\n if (m.key === source) {\n module = m;\n }\n });\n if (!module) {\n modules.push(\n (module = { key: source, imports: [], exports: [] }),\n );\n }\n module[key] = module[key].concat(specifiers);\n }\n\n function buildExportCall(name: string, val: t.Expression) {\n return t.expressionStatement(\n t.callExpression(t.identifier(exportIdent), [\n t.stringLiteral(name),\n val,\n ]),\n );\n }\n\n const exportNames = [];\n const exportValues: t.Expression[] = [];\n\n const body = path.get(\"body\");\n\n for (const path of body) {\n if (path.isFunctionDeclaration()) {\n beforeBody.push(path.node);\n removedPaths.push(path);\n } else if (path.isClassDeclaration()) {\n variableIds.push(t.cloneNode(path.node.id));\n path.replaceWith(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(path.node.id),\n t.toExpression(path.node),\n ),\n ),\n );\n } else if (path.isVariableDeclaration()) {\n // Convert top-level variable declarations to \"var\",\n // because they must be hoisted\n path.node.kind = \"var\";\n } else if (path.isImportDeclaration()) {\n const source = path.node.source.value;\n pushModule(source, \"imports\", path.node.specifiers);\n for (const name of Object.keys(path.getBindingIdentifiers())) {\n scope.removeBinding(name);\n variableIds.push(t.identifier(name));\n }\n path.remove();\n } else if (path.isExportAllDeclaration()) {\n pushModule(path.node.source.value, \"exports\", path.node);\n path.remove();\n } else if (path.isExportDefaultDeclaration()) {\n const declar = path.node.declaration;\n if (t.isClassDeclaration(declar)) {\n const id = declar.id;\n if (id) {\n exportNames.push(\"default\");\n exportValues.push(scope.buildUndefinedNode());\n variableIds.push(t.cloneNode(id));\n addExportName(id.name, \"default\");\n path.replaceWith(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(id),\n t.toExpression(declar),\n ),\n ),\n );\n } else {\n exportNames.push(\"default\");\n exportValues.push(t.toExpression(declar));\n removedPaths.push(path);\n }\n } else if (t.isFunctionDeclaration(declar)) {\n const id = declar.id;\n if (id) {\n beforeBody.push(declar);\n exportNames.push(\"default\");\n exportValues.push(t.cloneNode(id));\n addExportName(id.name, \"default\");\n } else {\n exportNames.push(\"default\");\n exportValues.push(t.toExpression(declar));\n }\n removedPaths.push(path);\n } else {\n // @ts-expect-error TSDeclareFunction is not expected here\n path.replaceWith(buildExportCall(\"default\", declar));\n }\n } else if (path.isExportNamedDeclaration()) {\n const declar = path.node.declaration;\n\n if (declar) {\n path.replaceWith(declar);\n\n if (t.isFunction(declar)) {\n const name = declar.id.name;\n addExportName(name, name);\n beforeBody.push(declar);\n exportNames.push(name);\n exportValues.push(t.cloneNode(declar.id));\n removedPaths.push(path);\n } else if (t.isClass(declar)) {\n const name = declar.id.name;\n exportNames.push(name);\n exportValues.push(scope.buildUndefinedNode());\n variableIds.push(t.cloneNode(declar.id));\n path.replaceWith(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(declar.id),\n t.toExpression(declar),\n ),\n ),\n );\n addExportName(name, name);\n } else {\n if (t.isVariableDeclaration(declar)) {\n // Convert top-level variable declarations to \"var\",\n // because they must be hoisted\n declar.kind = \"var\";\n }\n for (const name of Object.keys(\n t.getBindingIdentifiers(declar),\n )) {\n addExportName(name, name);\n }\n }\n } else {\n const specifiers = path.node.specifiers;\n if (specifiers?.length) {\n if (path.node.source) {\n pushModule(path.node.source.value, \"exports\", specifiers);\n path.remove();\n } else {\n const nodes = [];\n\n for (const specifier of specifiers) {\n // @ts-expect-error This isn't an \"export ... from\" declaration\n // because path.node.source is falsy, so the local specifier exists.\n const { local, exported } = specifier;\n\n const binding = scope.getBinding(local.name);\n const exportedName = getExportSpecifierName(\n exported,\n stringSpecifiers,\n );\n // hoisted function export\n if (\n binding &&\n t.isFunctionDeclaration(binding.path.node)\n ) {\n exportNames.push(exportedName);\n exportValues.push(t.cloneNode(local));\n }\n // only globals also exported this way\n else if (!binding) {\n nodes.push(buildExportCall(exportedName, local));\n }\n addExportName(local.name, exportedName);\n }\n\n path.replaceWithMultiple(nodes);\n }\n } else {\n path.remove();\n }\n }\n }\n }\n\n modules.forEach(function (specifiers) {\n const setterBody = [];\n const target = scope.generateUid(specifiers.key);\n\n for (let specifier of specifiers.imports) {\n if (t.isImportNamespaceSpecifier(specifier)) {\n setterBody.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n specifier.local,\n t.identifier(target),\n ),\n ),\n );\n } else if (t.isImportDefaultSpecifier(specifier)) {\n specifier = t.importSpecifier(\n specifier.local,\n t.identifier(\"default\"),\n );\n }\n\n if (t.isImportSpecifier(specifier)) {\n const { imported } = specifier;\n setterBody.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n specifier.local,\n t.memberExpression(\n t.identifier(target),\n specifier.imported,\n /* computed */ imported.type === \"StringLiteral\",\n ),\n ),\n ),\n );\n }\n }\n\n if (specifiers.exports.length) {\n const exportNames = [];\n const exportValues = [];\n let hasExportStar = false;\n\n for (const node of specifiers.exports) {\n if (t.isExportAllDeclaration(node)) {\n hasExportStar = true;\n } else if (t.isExportSpecifier(node)) {\n const exportedName = getExportSpecifierName(\n node.exported,\n stringSpecifiers,\n );\n exportNames.push(exportedName);\n exportValues.push(\n t.memberExpression(\n t.identifier(target),\n node.local,\n t.isStringLiteral(node.local),\n ),\n );\n } else {\n // todo\n }\n }\n\n setterBody.push(\n ...constructExportCall(\n path,\n t.identifier(exportIdent),\n exportNames,\n exportValues,\n hasExportStar ? t.identifier(target) : null,\n stringSpecifiers,\n ),\n );\n }\n\n sources.push(t.stringLiteral(specifiers.key));\n setters.push(\n t.functionExpression(\n null,\n [t.identifier(target)],\n t.blockStatement(setterBody),\n ),\n );\n });\n\n let moduleName = getModuleName(this.file.opts, options);\n // @ts-expect-error todo(flow->ts): do not reuse variables\n if (moduleName) moduleName = t.stringLiteral(moduleName);\n\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n path.scope.hoistVariables ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").Scope.prototype.hoistVariables;\n }\n\n path.scope.hoistVariables((id, hasInit) => {\n variableIds.push(id);\n if (!hasInit && id.name in exportMap) {\n for (const exported of exportMap[id.name]) {\n exportNames.push(exported);\n exportValues.push(t.buildUndefinedNode());\n }\n }\n });\n\n if (variableIds.length) {\n beforeBody.unshift(\n t.variableDeclaration(\n \"var\",\n variableIds.map(id => t.variableDeclarator(id)),\n ),\n );\n }\n\n if (exportNames.length) {\n beforeBody.push(\n ...constructExportCall(\n path,\n t.identifier(exportIdent),\n exportNames,\n exportValues,\n null,\n stringSpecifiers,\n ),\n );\n }\n\n path.traverse(reassignmentVisitor, {\n exports: exportMap,\n buildCall: buildExportCall,\n scope,\n });\n\n for (const path of removedPaths) {\n path.remove();\n }\n\n let hasTLA = false;\n path.traverse({\n AwaitExpression(path) {\n hasTLA = true;\n path.stop();\n },\n Function(path) {\n path.skip();\n },\n // @ts-expect-error - todo: add noScope to type definitions\n noScope: true,\n });\n\n path.node.body = [\n buildTemplate({\n SYSTEM_REGISTER: t.memberExpression(\n t.identifier(systemGlobal),\n t.identifier(\"register\"),\n ),\n BEFORE_BODY: beforeBody,\n MODULE_NAME: moduleName,\n SETTERS: t.arrayExpression(setters),\n EXECUTE: t.functionExpression(\n null,\n [],\n t.blockStatement(path.node.body),\n false,\n hasTLA,\n ),\n SOURCES: t.arrayExpression(sources),\n EXPORT_IDENTIFIER: t.identifier(exportIdent),\n CONTEXT_IDENTIFIER: t.identifier(contextIdent),\n }),\n ];\n path.requeue(path.get(\"body.0\"));\n },\n },\n },\n };\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,uBAAA,GAAAF,OAAA;AAMA,IAAAG,0BAAA,GAAAH,OAAA;AAEA,MAAMI,aAAa,GAAGC,cAAQ,CAACC,SAAS,CAAC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AAEF,MAAMC,cAAc,GAAGF,cAAQ,CAACC,SAAS,CAAC;AAC1C;AACA;AACA;AACA,CAAC,CAAC;AAEF,MAAME,sBAAsB,GAAG;AAC/B;AACA;AACA;AACA,CAAC;AAED,MAAMC,oBAAoB,GAAG;AAC7B;AACA;AACA;AACA,CAAC;AAIM,SAASC,sBAAsBA,CACpCC,IAAY,EACZC,gBAA6B,EACrB;EACR,IAAID,IAAI,CAACE,IAAI,KAAK,YAAY,EAAE;IAC9B,OAAOF,IAAI,CAACG,IAAI;EAClB,CAAC,MAAM,IAAIH,IAAI,CAACE,IAAI,KAAK,eAAe,EAAE;IACxC,MAAME,WAAW,GAAGJ,IAAI,CAACK,KAAK;IAO9B,IAAI,CAAC,IAAAC,2CAAgB,EAACF,WAAW,CAAC,EAAE;MAClCH,gBAAgB,CAACM,GAAG,CAACH,WAAW,CAAC;IACnC;IACA,OAAOA,WAAW;EACpB,CAAC,MAAM;IACL,MAAM,IAAII,KAAK,CACb,2EAA2ER,IAAI,CAACE,IAAI,EACtF,CAAC;EACH;A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