define(["require", "exports", "@fluentui/utilities", "./utilities/makeSemanticColors"], function (require, exports, utilities_1, makeSemanticColors_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    /**
     * Merge a partial/full theme into a full theme and returns a merged full theme.
     */
    function mergeThemes(theme, partialTheme) {
        if (partialTheme === void 0) { partialTheme = {}; }
        var _a, _b, _c, _d;
        var mergedTheme = utilities_1.merge({}, theme, partialTheme, {
            semanticColors: makeSemanticColors_1.getSemanticColors(partialTheme.palette, partialTheme.effects, partialTheme.semanticColors, partialTheme.isInverted === undefined ? theme.isInverted : partialTheme.isInverted),
        });
        if (((_a = partialTheme.palette) === null || _a === void 0 ? void 0 : _a.themePrimary) && !((_b = partialTheme.palette) === null || _b === void 0 ? void 0 : _b.accent)) {
            mergedTheme.palette.accent = partialTheme.palette.themePrimary;
        }
        if (partialTheme.defaultFontStyle) {
            for (var _i = 0, _e = Object.keys(mergedTheme.fonts); _i < _e.length; _i++) {
                var fontStyle = _e[_i];
                mergedTheme.fonts[fontStyle] = utilities_1.merge(mergedTheme.fonts[fontStyle], partialTheme.defaultFontStyle, (_d = (_c = partialTheme) === null || _c === void 0 ? void 0 : _c.fonts) === null || _d === void 0 ? void 0 : _d[fontStyle]);
            }
        }
        return mergedTheme;
    }
    exports.mergeThemes = mergeThemes;
});
//# sourceMappingURL=mergeThemes.js.map