import { __assign } from "tslib";
export var getTheme = function (_a) {
    var _b;
    var theme = _a.theme, componentName = _a.componentName, defaultTheme = _a.defaultTheme;
    var componentTheme = Object.fromEntries(Object.keys(defaultTheme).map(function (paramsName) {
        var _a;
        var value = paramsName in ((_a = theme.components[componentName]) !== null && _a !== void 0 ? _a : {})
            ? theme.components[componentName][paramsName]
            : theme.colors[defaultTheme[paramsName]];
        return [paramsName, value];
    }));
    var components = __assign(__assign({}, theme.components), (_b = {}, _b[componentName] = componentTheme, _b));
    return __assign(__assign({}, theme), { components: components });
};
