// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import {
  Modal,
  ConfigProvider,
  message,
  notification,
} from 'antd';
import { ApplyPluginsType } from 'umi';
import { getPluginManager } from '../core/plugin';

let cacheAntdConfig = null;

const getAntdConfig = () => {
  if(!cacheAntdConfig){
    cacheAntdConfig = getPluginManager().applyPlugins({
      key: 'antd',
      type: ApplyPluginsType.modify,
      initialValue: {
        ...{"theme":{"token":{"colorPrimary":"#5858FF","colorError":"#F52209","colorSuccess":"#108043","colorInfo":"#1E90FF","colorWarning":"#CF8909","controlHeight":48,"controlHeightSM":24,"controlOutlineWidth":0,"borderRadius":3,"fontSize":16,"lineHeight":1.2857,"fontFamily":"Roboto"},"components":{"Radio":{"radioSize":22,"dotSize":8,"buttonCheckedBgDisabled":"rgba(0, 0, 0, 0.04)"},"Pagination":{"itemSizeSM":40},"DatePicker":{"pickerPanelCellWidth":36}}}},
      },
    });
  }
  return cacheAntdConfig;
}

export function rootContainer(rawContainer) {
  const {
    appConfig,
    ...finalConfigProvider
  } = getAntdConfig();
  let container = rawContainer;
  if (finalConfigProvider.prefixCls) {
    Modal.config({
      rootPrefixCls: finalConfigProvider.prefixCls
    });
    message.config({
      prefixCls: `${finalConfigProvider.prefixCls}-message`
    });
    notification.config({
      prefixCls: `${finalConfigProvider.prefixCls}-notification`
    });
  }

  if (finalConfigProvider.iconPrefixCls) {
    // Icons in message need to set iconPrefixCls via ConfigProvider.config()
    ConfigProvider.config({
      iconPrefixCls: finalConfigProvider.iconPrefixCls,
    });
  };

  if (finalConfigProvider.theme) {
    // Pass config theme to static method
    ConfigProvider.config({
      theme: finalConfigProvider.theme,
    });
  }

  container = <ConfigProvider {...finalConfigProvider}>{container}</ConfigProvider>;


  return container;
}
