{"version":3,"names":["_semver","require","_debug","_filterItems","_moduleTransformations","_normalizeOptions","_shippedProposals","_pluginsCompatData","_babelPluginPolyfillCorejs","_babel7Plugins","_helperCompilationTargets","_availablePlugins","_helperPluginUtils","pluginCoreJS3","_pluginCoreJS3","default","isPluginRequired","targets","support","isRequired","compatData","filterStageFromList","list","stageList","Object","keys","reduce","result","item","has","pluginLists","withProposals","withoutBugfixes","pluginsList","withBugfixes","assign","pluginsBugfixesList","withoutProposals","proposalPlugins","getPluginList","proposals","bugfixes","getPlugin","pluginName","plugin","availablePlugins","Error","transformIncludesAndExcludes","opts","opt","target","match","add","all","plugins","Set","builtIns","exports","getSpecialModulesPluginNames","modules","shouldTransformDynamicImport","modulesPluginNames","push","moduleTransformations","console","warn","getCoreJSOptions","useBuiltIns","corejs","polyfillTargets","include","exclude","shippedProposals","debug","method","version","toString","undefined","noRuntimeName","getPolyfillPlugins","regenerator","polyfillPlugins","pluginOptions","major","babel7","pluginCoreJS2","legacyBabelPolyfillPlugin","usage","deprecated","pluginRegenerator","removeRegeneratorEntryPlugin","getLocalTargets","optionsTargets","ignoreBrowserslistConfig","configPath","browserslistEnv","esmodules","browsers","getTargets","supportsStaticESM","caller","supportsDynamicImport","supportsExportNamespaceFrom","_default","declarePreset","api","assertVersion","babelTargets","optionsExclude","forceAllTransforms","optionsInclude","optionsModules","normalizeOptions","loose","spec","semver","lt","hasUglifyTarget","uglify","transformTargets","pluginNames","filterItems","pluginSyntaxMap","addProposalSyntaxPlugins","proposalSyntaxPlugins","removeUnsupportedItems","removeUnnecessaryItems","overlappingPlugins","pluginUseBuiltIns","Array","from","map","deprecatedAssertSyntax","concat","log","JSON","stringify","prettifyTargets","forEach","logPlugin","getModulesPluginNames","transformations","shouldTransformESM","shouldTransformExportNamespaceFrom"],"sources":["../src/index.ts"],"sourcesContent":["import semver, { type SemVer } from \"semver\";\nimport { logPlugin } from \"./debug.ts\";\nimport {\n addProposalSyntaxPlugins,\n removeUnnecessaryItems,\n removeUnsupportedItems,\n} from \"./filter-items.ts\";\nimport moduleTransformations from \"./module-transformations.ts\";\nimport normalizeOptions from \"./normalize-options.ts\";\nimport {\n pluginSyntaxMap,\n proposalPlugins,\n proposalSyntaxPlugins,\n} from \"./shipped-proposals.ts\";\nimport {\n plugins as pluginsList,\n pluginsBugfixes as pluginsBugfixesList,\n overlappingPlugins,\n} from \"./plugins-compat-data.ts\";\n\nimport type { CallerMetadata } from \"@babel/core\";\n\nimport _pluginCoreJS3 from \"babel-plugin-polyfill-corejs3\";\n// TODO(Babel 8): Just use the default import\nconst pluginCoreJS3 = _pluginCoreJS3.default || _pluginCoreJS3;\n\n// TODO(Babel 8): Remove this\nimport babel7 from \"./polyfills/babel-7-plugins.cjs\";\n\nimport getTargets, {\n prettifyTargets,\n filterItems,\n isRequired,\n} from \"@babel/helper-compilation-targets\";\nimport type { Targets, InputTargets } from \"@babel/helper-compilation-targets\";\nimport availablePlugins from \"./available-plugins.ts\";\nimport { declarePreset } from \"@babel/helper-plugin-utils\";\n\nimport type { BuiltInsOption, ModuleOption, Options } from \"./types.ts\";\n\n// TODO: Remove in Babel 8\nexport function isPluginRequired(targets: Targets, support: Targets) {\n return isRequired(\"fake-name\", targets, {\n compatData: { \"fake-name\": support },\n });\n}\n\nfunction filterStageFromList(\n list: { [feature: string]: Targets },\n stageList: Set,\n) {\n return Object.keys(list).reduce((result, item) => {\n if (!stageList.has(item)) {\n // @ts-expect-error todo: refine result types\n result[item] = list[item];\n }\n\n return result;\n }, {});\n}\n\nconst pluginLists = {\n withProposals: {\n withoutBugfixes: pluginsList,\n withBugfixes: Object.assign({}, pluginsList, pluginsBugfixesList),\n },\n withoutProposals: {\n withoutBugfixes: filterStageFromList(pluginsList, proposalPlugins),\n withBugfixes: filterStageFromList(\n Object.assign({}, pluginsList, pluginsBugfixesList),\n proposalPlugins,\n ),\n },\n};\n\nfunction getPluginList(proposals: boolean, bugfixes: boolean) {\n if (proposals) {\n if (bugfixes) return pluginLists.withProposals.withBugfixes;\n else return pluginLists.withProposals.withoutBugfixes;\n } else {\n if (bugfixes) return pluginLists.withoutProposals.withBugfixes;\n else return pluginLists.withoutProposals.withoutBugfixes;\n }\n}\n\nconst getPlugin = (pluginName: string) => {\n const plugin =\n // @ts-expect-error plugin name is constructed from available plugin list\n availablePlugins[pluginName]();\n\n if (!plugin) {\n throw new Error(\n `Could not find plugin \"${pluginName}\". Ensure there is an entry in ./available-plugins.js for it.`,\n );\n }\n\n return plugin;\n};\n\nexport const transformIncludesAndExcludes = (opts: Array): any => {\n return opts.reduce(\n (result, opt) => {\n const target = opt.match(/^(es|es6|es7|esnext|web)\\./)\n ? \"builtIns\"\n : \"plugins\";\n result[target].add(opt);\n return result;\n },\n {\n all: opts,\n plugins: new Set(),\n builtIns: new Set(),\n },\n );\n};\n\nfunction getSpecialModulesPluginNames(\n modules: Exclude,\n shouldTransformDynamicImport: boolean,\n) {\n const modulesPluginNames = [];\n if (modules) {\n modulesPluginNames.push(moduleTransformations[modules]);\n }\n\n if (shouldTransformDynamicImport) {\n if (modules && modules !== \"umd\") {\n modulesPluginNames.push(\"transform-dynamic-import\");\n } else {\n console.warn(\n \"Dynamic import can only be transformed when transforming ES\" +\n \" modules to AMD, CommonJS or SystemJS.\",\n );\n }\n }\n\n if (!process.env.BABEL_8_BREAKING) {\n // Enable module-related syntax plugins for older Babel versions\n if (!shouldTransformDynamicImport) {\n modulesPluginNames.push(\"syntax-dynamic-import\");\n }\n modulesPluginNames.push(\"syntax-top-level-await\");\n modulesPluginNames.push(\"syntax-import-meta\");\n }\n\n return modulesPluginNames;\n}\n\nconst getCoreJSOptions = ({\n useBuiltIns,\n corejs,\n polyfillTargets,\n include,\n exclude,\n proposals,\n shippedProposals,\n debug,\n}: {\n useBuiltIns: BuiltInsOption;\n corejs: SemVer | null | false;\n polyfillTargets: Targets;\n include: Set;\n exclude: Set;\n proposals: boolean;\n shippedProposals: boolean;\n debug: boolean;\n}) => ({\n method: `${useBuiltIns}-global`,\n version: corejs ? corejs.toString() : undefined,\n targets: polyfillTargets,\n include,\n exclude,\n proposals,\n shippedProposals,\n debug,\n \"#__secret_key__@babel/preset-env__compatibility\": {\n noRuntimeName: true,\n },\n});\n\nif (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var getPolyfillPlugins = ({\n useBuiltIns,\n corejs,\n polyfillTargets,\n include,\n exclude,\n proposals,\n shippedProposals,\n regenerator,\n debug,\n }: {\n useBuiltIns: BuiltInsOption;\n corejs: SemVer | null | false;\n polyfillTargets: Targets;\n include: Set;\n exclude: Set;\n proposals: boolean;\n shippedProposals: boolean;\n regenerator: boolean;\n debug: boolean;\n }) => {\n const polyfillPlugins = [];\n if (useBuiltIns === \"usage\" || useBuiltIns === \"entry\") {\n const pluginOptions = getCoreJSOptions({\n useBuiltIns,\n corejs,\n polyfillTargets,\n include,\n exclude,\n proposals,\n shippedProposals,\n debug,\n });\n\n if (corejs) {\n if (process.env.BABEL_8_BREAKING) {\n polyfillPlugins.push([pluginCoreJS3, pluginOptions]);\n } else {\n if (useBuiltIns === \"usage\") {\n if (corejs.major === 2) {\n polyfillPlugins.push(\n [babel7.pluginCoreJS2, pluginOptions],\n [babel7.legacyBabelPolyfillPlugin, { usage: true }],\n );\n } else {\n polyfillPlugins.push(\n [pluginCoreJS3, pluginOptions],\n [\n babel7.legacyBabelPolyfillPlugin,\n { usage: true, deprecated: true },\n ],\n );\n }\n if (regenerator) {\n polyfillPlugins.push([\n babel7.pluginRegenerator,\n { method: \"usage-global\", debug },\n ]);\n }\n } else {\n if (corejs.major === 2) {\n polyfillPlugins.push(\n [babel7.legacyBabelPolyfillPlugin, { regenerator }],\n [babel7.pluginCoreJS2, pluginOptions],\n );\n } else {\n polyfillPlugins.push(\n [pluginCoreJS3, pluginOptions],\n [babel7.legacyBabelPolyfillPlugin, { deprecated: true }],\n );\n if (!regenerator) {\n polyfillPlugins.push([\n babel7.removeRegeneratorEntryPlugin,\n pluginOptions,\n ]);\n }\n }\n }\n }\n }\n }\n return polyfillPlugins;\n };\n\n if (!USE_ESM) {\n // eslint-disable-next-line no-restricted-globals\n exports.getPolyfillPlugins = getPolyfillPlugins;\n }\n}\n\nfunction getLocalTargets(\n optionsTargets: Options[\"targets\"],\n ignoreBrowserslistConfig: boolean,\n configPath: string,\n browserslistEnv: string,\n) {\n if (optionsTargets?.esmodules && optionsTargets.browsers) {\n console.warn(`\n@babel/preset-env: esmodules and browsers targets have been specified together.\n\\`browsers\\` target, \\`${optionsTargets.browsers.toString()}\\` will be ignored.\n`);\n }\n\n return getTargets(optionsTargets as InputTargets, {\n ignoreBrowserslistConfig,\n configPath,\n browserslistEnv,\n });\n}\n\nfunction supportsStaticESM(caller: CallerMetadata | undefined) {\n // TODO(Babel 8): Fallback to true\n // @ts-expect-error supportsStaticESM is not defined in CallerMetadata\n return !!caller?.supportsStaticESM;\n}\n\nfunction supportsDynamicImport(caller: CallerMetadata | undefined) {\n // TODO(Babel 8): Fallback to true\n // @ts-expect-error supportsDynamicImport is not defined in CallerMetadata\n return !!caller?.supportsDynamicImport;\n}\n\nfunction supportsExportNamespaceFrom(caller: CallerMetadata | undefined) {\n // TODO(Babel 8): Fallback to null\n // @ts-expect-error supportsExportNamespaceFrom is not defined in CallerMetadata\n return !!caller?.supportsExportNamespaceFrom;\n}\n\nexport default declarePreset((api, opts: Options) => {\n api.assertVersion(\n process.env.BABEL_8_BREAKING && process.env.IS_PUBLISH\n ? PACKAGE_JSON.version\n : 7,\n );\n\n const babelTargets = api.targets();\n\n if (process.env.BABEL_8_BREAKING && (\"loose\" in opts || \"spec\" in opts)) {\n throw new Error(\n \"@babel/preset-env: The 'loose' and 'spec' options have been removed, \" +\n \"and you should configure granular compiler assumptions instead. See \" +\n \"https://babeljs.io/assumptions for more information.\",\n );\n }\n\n const {\n bugfixes,\n configPath,\n debug,\n exclude: optionsExclude,\n forceAllTransforms,\n ignoreBrowserslistConfig,\n include: optionsInclude,\n modules: optionsModules,\n shippedProposals,\n targets: optionsTargets,\n useBuiltIns,\n corejs: { version: corejs, proposals },\n browserslistEnv,\n } = normalizeOptions(opts);\n\n if (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var { loose, spec = false } = opts;\n }\n\n let targets = babelTargets;\n\n if (\n // @babel/core < 7.13.0 doesn't load targets (api.targets() always\n // returns {} thanks to @babel/helper-plugin-utils), so we always want\n // to fallback to the old targets behavior in this case.\n semver.lt(api.version, \"7.13.0\") ||\n // If any browserslist-related option is specified, fallback to the old\n // behavior of not using the targets specified in the top-level options.\n opts.targets ||\n opts.configPath ||\n opts.browserslistEnv ||\n opts.ignoreBrowserslistConfig\n ) {\n if (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var hasUglifyTarget = false;\n\n if (optionsTargets?.uglify) {\n hasUglifyTarget = true;\n delete optionsTargets.uglify;\n\n console.warn(`\nThe uglify target has been deprecated. Set the top level\noption \\`forceAllTransforms: true\\` instead.\n`);\n }\n }\n\n targets = getLocalTargets(\n optionsTargets,\n ignoreBrowserslistConfig,\n configPath,\n browserslistEnv,\n );\n }\n\n const transformTargets = (\n process.env.BABEL_8_BREAKING\n ? forceAllTransforms\n : forceAllTransforms || hasUglifyTarget\n )\n ? ({} as Targets)\n : targets;\n\n const include = transformIncludesAndExcludes(optionsInclude);\n const exclude = transformIncludesAndExcludes(optionsExclude);\n\n const compatData = getPluginList(shippedProposals, bugfixes);\n const modules =\n optionsModules === \"auto\"\n ? api.caller(supportsStaticESM)\n ? false\n : \"commonjs\"\n : optionsModules;\n const shouldTransformDynamicImport =\n optionsModules === \"auto\" ? !api.caller(supportsDynamicImport) : !!modules;\n\n // If the caller does not support export-namespace-from, we forcefully add\n // the plugin to `includes`.\n // TODO(Babel 8): stop doing this, similarly to how we don't do this for any\n // other plugin. We can consider adding bundlers as targets in the future,\n // but we should not have a one-off special case for this plugin.\n if (\n optionsModules === \"auto\" &&\n !api.caller(supportsExportNamespaceFrom) &&\n !exclude.plugins.has(\"transform-export-namespace-from\")\n ) {\n include.plugins.add(\"transform-export-namespace-from\");\n }\n\n const pluginNames = filterItems(\n compatData,\n include.plugins,\n exclude.plugins,\n transformTargets,\n getSpecialModulesPluginNames(modules, shouldTransformDynamicImport),\n process.env.BABEL_8_BREAKING || !loose\n ? undefined\n : [\"transform-typeof-symbol\"],\n pluginSyntaxMap,\n );\n if (shippedProposals) {\n addProposalSyntaxPlugins(pluginNames, proposalSyntaxPlugins);\n }\n removeUnsupportedItems(pluginNames, api.version);\n removeUnnecessaryItems(pluginNames, overlappingPlugins);\n\n const polyfillPlugins = process.env.BABEL_8_BREAKING\n ? useBuiltIns\n ? [\n [\n pluginCoreJS3,\n getCoreJSOptions({\n useBuiltIns,\n corejs,\n polyfillTargets: targets,\n include: include.builtIns,\n exclude: exclude.builtIns,\n proposals,\n shippedProposals,\n debug,\n }),\n ],\n ]\n : []\n : getPolyfillPlugins({\n useBuiltIns,\n corejs,\n polyfillTargets: targets,\n include: include.builtIns,\n exclude: exclude.builtIns,\n proposals,\n shippedProposals,\n regenerator: pluginNames.has(\"transform-regenerator\"),\n debug,\n });\n\n const pluginUseBuiltIns = useBuiltIns !== false;\n const plugins = Array.from(pluginNames)\n .map(pluginName => {\n if (\n !process.env.BABEL_8_BREAKING &&\n (pluginName === \"transform-class-properties\" ||\n pluginName === \"transform-private-methods\" ||\n pluginName === \"transform-private-property-in-object\")\n ) {\n return [\n getPlugin(pluginName),\n {\n loose: loose\n ? \"#__internal__@babel/preset-env__prefer-true-but-false-is-ok-if-it-prevents-an-error\"\n : \"#__internal__@babel/preset-env__prefer-false-but-true-is-ok-if-it-prevents-an-error\",\n },\n ];\n }\n if (pluginName === \"syntax-import-attributes\") {\n // For backward compatibility with the import-assertions plugin, we\n // allow the deprecated `assert` keyword.\n // TODO(Babel 8): Revisit this.\n return [getPlugin(pluginName), { deprecatedAssertSyntax: true }];\n }\n return [\n getPlugin(pluginName),\n process.env.BABEL_8_BREAKING\n ? { useBuiltIns: pluginUseBuiltIns }\n : { spec, loose, useBuiltIns: pluginUseBuiltIns },\n ];\n })\n .concat(polyfillPlugins);\n\n if (debug) {\n console.log(\"@babel/preset-env: `DEBUG` option\");\n console.log(\"\\nUsing targets:\");\n console.log(JSON.stringify(prettifyTargets(targets), null, 2));\n console.log(`\\nUsing modules transform: ${optionsModules.toString()}`);\n console.log(\"\\nUsing plugins:\");\n pluginNames.forEach(pluginName => {\n logPlugin(pluginName, targets, compatData);\n });\n\n if (!useBuiltIns) {\n console.log(\n \"\\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.\",\n );\n }\n }\n\n return { plugins };\n});\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n // eslint-disable-next-line no-restricted-globals\n exports.getModulesPluginNames = ({\n modules,\n transformations,\n shouldTransformESM,\n shouldTransformDynamicImport,\n shouldTransformExportNamespaceFrom,\n }: {\n modules: ModuleOption;\n transformations: typeof import(\"./module-transformations\").default;\n shouldTransformESM: boolean;\n shouldTransformDynamicImport: boolean;\n shouldTransformExportNamespaceFrom: boolean;\n }) => {\n const modulesPluginNames = [];\n if (modules !== false && transformations[modules]) {\n if (shouldTransformESM) {\n modulesPluginNames.push(transformations[modules]);\n }\n\n if (shouldTransformDynamicImport) {\n if (shouldTransformESM && modules !== \"umd\") {\n modulesPluginNames.push(\"transform-dynamic-import\");\n } else {\n console.warn(\n \"Dynamic import can only be transformed when transforming ES\" +\n \" modules to AMD, CommonJS or SystemJS.\",\n );\n }\n }\n }\n\n if (shouldTransformExportNamespaceFrom) {\n modulesPluginNames.push(\"transform-export-namespace-from\");\n }\n if (!shouldTransformDynamicImport) {\n modulesPluginNames.push(\"syntax-dynamic-import\");\n }\n if (!shouldTransformExportNamespaceFrom) {\n modulesPluginNames.push(\"syntax-export-namespace-from\");\n }\n modulesPluginNames.push(\"syntax-top-level-await\");\n modulesPluginNames.push(\"syntax-import-meta\");\n\n return modulesPluginNames;\n };\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC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