import { balBrowser } from "../browser";
import { config, configFromLocalStorage } from "./config";
export const setupConfig = (userConfig = {}, win = {}) => {
    if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
        win = window;
    }
    win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
    config.reset(Object.assign(Object.assign(Object.assign({}, configFromLocalStorage(win)), userConfig), { icons: Object.assign({}, userConfig.icons) }));
    win.BaloiseDesignSystem.config = config;
};
export default setupConfig;
