"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var HTMLLanguageElementProvider = /** @class */ (function () {
    function HTMLLanguageElementProvider() {
        this.LANGUAGE_CLASS = "lto-language";
    }
    /**
     * Obtains the default language of the browser
     */
    HTMLLanguageElementProvider.prototype.get = function () {
        var htmlLanguageElement = this.findHTMLLanguageElement();
        if (htmlLanguageElement === undefined) {
            console.error("No element with class '" + this.LANGUAGE_CLASS + "' could be found to resolve conversation language");
            return undefined;
        }
        var conversationLanguage = htmlLanguageElement.value;
        console.log("Language from HTML Element " + conversationLanguage);
        return conversationLanguage;
    };
    HTMLLanguageElementProvider.prototype.findHTMLLanguageElement = function () {
        var elements = document.getElementsByClassName(this.LANGUAGE_CLASS);
        if (elements !== undefined && elements.length > 0) {
            return elements[0];
        }
        return undefined;
    };
    HTMLLanguageElementProvider.prototype.toString = function () {
        return "Class [" + HTMLLanguageElementProvider.name + "] with value: " + this.get();
    };
    return HTMLLanguageElementProvider;
}());
exports.HTMLLanguageElementProvider = HTMLLanguageElementProvider;
//# sourceMappingURL=HTMLLanguageElementProvider.js.map