"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var HTMLLanguageElementProvider_1 = require("./HTMLLanguageElementProvider");
var BrowserLanguageProvider_1 = require("./BrowserLanguageProvider");
var LanguageEnvVariableProvider_1 = require("./LanguageEnvVariableProvider");
/**
 * Contains language providers which are processed in the defined order.
 */
var ConversationLanguageResolver = /** @class */ (function () {
    function ConversationLanguageResolver() {
        this.LANGUAGE_PROVIDERS = [
            new LanguageEnvVariableProvider_1.LanguageEnvVariableProvider(),
            new HTMLLanguageElementProvider_1.HTMLLanguageElementProvider(),
            new BrowserLanguageProvider_1.BrowserLanguageProvider()
        ];
    }
    /**
     * It goes through all language providers to extract the conversation language
     */
    ConversationLanguageResolver.prototype.get = function () {
        var conversationLanguage = this.LANGUAGE_PROVIDERS.map(function (e) { return e.get(); }).find(function (l) { return l !== undefined; });
        if (conversationLanguage === undefined) {
            console.error("No language was configured for the conversation");
        }
        return conversationLanguage;
    };
    return ConversationLanguageResolver;
}());
exports.ConversationLanguageResolver = ConversationLanguageResolver;
//# sourceMappingURL=ConversationLanguageResolver.js.map