import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
import { tint, shade, fade } from './colors/colorFunc';

function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function getDefaultThemeBase() {
  let fontColorBase = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#0f1222';
  return {
    primaryColor: '#5384ff',
    successColor: '#00cb91',
    dangerColor: '#ff4d4f',
    warningColor: '#f29360',
    tipColor: '#5384ff',
    white: '#fff',
    black: '#000',
    bodyBgColor: '#fff',
    fontColorBase,
    fontSizeBase: '14px',
    borderRadiusBase: '4px',
    borderRadiusSm: '2px',
    borderWidthBase: '1px',
    borderStyleBase: 'solid',
    borderColorBase: tint(fontColorBase, 0.8),
    shadowColor: fade(fontColorBase, 0.1),
    shadowColorSm: fade(fontColorBase, 0.2),
    shadowRadius: '12px',
    shadowRadiusSm: '4px',
    maskColor: fade(fontColorBase, 0.45),
    maskDarkColor: fade(fontColorBase, 0.9),
    paddingLarge: '24px',
    paddingMiddle: '16px',
    paddingSmall: '12px',
    paddingXsmall: '8px'
  };
}
const baseTheme = function () {
  var _themeOverrides$commo;
  let themeOverrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  const base = Object.assign(getDefaultThemeBase((_themeOverrides$commo = themeOverrides.common) === null || _themeOverrides$commo === void 0 ? void 0 : _themeOverrides$commo.fontColorBase), themeOverrides.common);
  return _objectSpread(_objectSpread({}, base), {}, {
    linkColor: base.primaryColor,
    componentBgColor: tint(base.fontColorBase, 0.97),
    hoverColorBase: tint(base.primaryColor, 0.2),
    hoverColorLight: tint(base.primaryColor, 0.94),
    hoverSuccessColor: tint(base.successColor, 0.94),
    activeSuccessColor: shade(base.successColor, 0.06),
    hoverSuccessTextColor: tint(base.successColor, 0.2),
    hoverWarningColor: tint(base.warningColor, 0.94),
    activeWarningColor: shade(base.warningColor, 0.06),
    hoverWarningTextColor: tint(base.warningColor, 0.2),
    hoverDangerColor: tint(base.dangerColor, 0.94),
    activeDangerColor: shade(base.dangerColor, 0.06),
    hoverDangerTextColor: tint(base.dangerColor, 0.2),
    activeColor: shade(base.primaryColor, 0.06),
    focusColor: base.primaryColor,
    focusShadowColor: tint(base.primaryColor, 0.8),
    focusDangerShadowColor: tint(base.dangerColor, 0.8),
    processingColor: tint(base.primaryColor, 0.4),
    disabledColorBase: tint(base.fontColorBase, 0.8),
    disabledColorLight: tint(base.fontColorBase, 0.97),
    headColor: base.fontColorBase,
    subHeadColor: tint(base.fontColorBase, 0.35),
    textColor: base.fontColorBase,
    textColorSecondary: tint(base.fontColorBase, 0.55),
    textColorDisabled: tint(base.fontColorBase, 0.7),
    textColorDisabledLight: tint(base.fontColorBase, 0.8),
    textColorCaption: tint(base.fontColorBase, 0.8),
    hoverBaseTextColor: tint(base.fontColorBase, 0.2),
    borderColorDisabled: tint(base.fontColorBase, 0.8),
    borderColorSplit: tint(base.fontColorBase, 0.9),
    borderColorInverse: base.white,
    borderBase: `${base.borderWidthBase} ${base.borderStyleBase} ${base.borderColorBase}`,
    layoutInvertedBgColor: tint(base.fontColorBase, 0.05),
    tooltipTextBgColor: tint(base.fontColorBase, 0.3),
    selectTriggerIconColor: tint(base.fontColorBase, 0.6),
    scrollbarBgColor: fade(base.fontColorBase, 0.25),
    scrollbarActiveColor: fade(base.fontColorBase, 0.65),
    carouselColor: base.shadowColorSm,
    carouselHoverColor: base.maskColor,
    carouselActiveColor: fade(base.fontColorBase, 0.65)
  }, themeOverrides.derivedColor);
};

export { baseTheme };
