"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _utils = require("../utils");

var _babelPresetReactOption = _interopRequireDefault(require("./babel-option-utils/babel-preset-react-option"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const {
  module: {
    mode,
    disableES5Transpile
  },
  babelCustomizationForLibrary: {
    babelPlugins
  }
} = (0, _utils.getOptions)();
const isProd = mode.toLowerCase() === 'prod';
const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
  __DOCS__: false
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('@babel/plugin-proposal-optional-chaining'), require.resolve('@babel/plugin-proposal-class-properties')];
const plugins = [...babelPlugins, ...defaultPlugins];
console.log(disableES5Transpile);

var _default = () => ({
  presets: [[require.resolve('@babel/preset-env'), disableES5Transpile ? {
    modules: false,
    useBuiltIns: 'usage',
    corejs: 3,
    targets: {
      browsers: ['last 3 Chrome versions', 'last 3 Firefox versions', 'last 3 Edge versions', 'last 3 Safari versions']
    }
  } : {
    modules: false
  }], (0, _babelPresetReactOption.default)({
    disableES5Transpile
  }), require.resolve('@babel/preset-typescript')],
  plugins: plugins
});

exports.default = _default;