"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var constants = __importStar(require("./constants"));
var testAutomation_1 = require("./testAutomation");
var config = {};
var initialized = false;
function setConfig(conf) {
    config = conf; // IMPORTANT - config should be link to RC.Config, do not clone conf object!!!
    if (!initialized) {
        initialized = !!(conf && conf.brandId);
    }
}
exports.setConfig = setConfig;
function getConfig() {
    if (!initialized) {
        var message_1 = 'getConfig used earlier than setConfig';
        if (testAutomation_1.isAutomationTestActive()) {
            setTimeout(function () { return alert(message_1); });
        }
        throw new Error(message_1);
    }
    return config;
}
exports.getConfig = getConfig;
function isConfigInitialized() {
    return initialized;
}
exports.isConfigInitialized = isConfigInitialized;
function testConfig(config) {
    setConfig(Object.assign({
        brandId: constants.defaultBrandId,
        userLanguage: constants.defaultUserLanguage,
        brandDisplayName: constants.defaultBrandDisplayName,
        shortBrandName: constants.defaultShortBrandName
    }, config || {}));
}
exports.testConfig = testConfig;
//# sourceMappingURL=config.js.map