{"size": 1760, "ext": "js", "max_stars_repo_path": "client/islets/common/y-global/y-global.bt.js", "max_stars_repo_name": "chitalka/reader", "max_stars_repo_stars_event_min_datetime": "2015-06-20T15:46:40.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-01T10:50:25.000Z", "max_issues_repo_path": "client/islets/common/y-global/y-global.bt.js", "max_issues_repo_name": "chitalka/reader", "max_issues_repo_issues_event_min_datetime": "2015-06-22T08:09:08.000Z", "max_issues_repo_issues_event_max_datetime": "2015-10-29T09:29:07.000Z", "max_forks_repo_path": "client/islets/common/y-global/y-global.bt.js", "max_forks_repo_name": "chitalka/reader", "max_forks_repo_forks_event_min_datetime": "2015-06-22T18:28:18.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-16T11:50:22.000Z"}
{"max_stars_count": 93, "max_issues_count": 22, "max_forks_count": 14, "avg_line_length": 37.4468085106, "max_line_length": 100, "alphanum_fraction": 0.5551136364}
module.exports = function (bt) {

    bt.lib.global = bt.lib.global || {};
    bt.lib.global.lang = bt.lib.global.lang || 'ru';
    bt.lib.global.tld = bt.lib.global.tld || 'ru';
    bt.lib.global['content-region'] = bt.lib.global['content-region'] || 'ru';
    bt.lib.global['click-host'] = bt.lib.global['click-host'] || '//clck.yandex.ru';
    bt.lib.global['passport-host'] = bt.lib.global['passport-host'] || 'https://passport.yandex.ru';
    bt.lib.global['pass-host'] = bt.lib.global['pass-host'] || '//pass.yandex.ru';
    bt.lib.global['social-host'] = bt.lib.global['social-host'] || '//social.yandex.ru';
    bt.lib.global['export-host'] = bt.lib.global['export-host'] || '//export.yandex.ru';

    /**
     * Changes top level domain.
     *
     * @param {String} tld Top level domain.
     */
    bt.lib.global.setTld = function (tld) {
        var xYaDomain = tld === 'tr' ? 'yandex.com.tr' : 'yandex.' + tld;
        var yaDomain = ['ua', 'by', 'kz'].indexOf(tld) !== -1 ? 'yandex.ru' : xYaDomain;
        var globalObj = bt.lib.global;
        globalObj['content-region'] = tld;
        globalObj['click-host'] = '//clck.' + yaDomain;
        globalObj['passport-host'] = 'https://passport.' + yaDomain;
        globalObj['pass-host'] = '//pass.' + xYaDomain;
        globalObj['social-host'] = '//social.' + xYaDomain;
        globalObj['export-host'] = '//export.' + xYaDomain;
        globalObj.tld = tld;
    };

    /**
     * @returns {String}
     */
    bt.lib.global.getTld = function () {
        return bt.lib.global.tld;
    };

    if (bt.lib.i18n && bt.lib.i18n.getLanguage) {
        var tld = bt.lib.i18n.getLanguage();
        if (tld === 'uk') {
            tld = 'ua';
        }
        bt.lib.global.setTld(tld);
    }

};
