"use strict";
cc._RF.push(module, '35875T0lsRL3rzhNkUdX4/G', 'lq_platform_util');
// Script/lq_base/util/lq_platform_util.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LQPlatformUtil = void 0;
var lq_const_1 = require("../data/lq_const");
var LQPlatformUtil = /** @class */ (function () {
    function LQPlatformUtil() {
    }
    LQPlatformUtil.init = function () {
        if (typeof qq !== 'undefined') {
            this.platform_type = lq_const_1.LQPlatformType.qq;
        }
        else if (typeof swan !== 'undefined') {
            this.platform_type = lq_const_1.LQPlatformType.baidu;
        }
        else if (typeof tt !== 'undefined') {
            this.platform_type = lq_const_1.LQPlatformType.tt;
            var info = tt.getSystemInfoSync();
            switch (info.appName) {
                case 'Toutiao':
                    this.byte_dance_type = lq_const_1.LQByteDanceType.tt;
                    break;
                case 'news_article_lite':
                    this.byte_dance_type = lq_const_1.LQByteDanceType.tt_lite;
                    break;
                case 'Douyin':
                    this.byte_dance_type = lq_const_1.LQByteDanceType.douyin;
                    break;
                case 'douyin_lite':
                    this.byte_dance_type = lq_const_1.LQByteDanceType.douyin_lite;
                    break;
                case 'PPX':
                    this.byte_dance_type = lq_const_1.LQByteDanceType.ppx;
                    break;
                case 'devtools':
                    this.byte_dance_type = lq_const_1.LQByteDanceType.devtools;
                    break;
            }
        }
        else if (typeof qg !== 'undefined') {
            if (!!qg.getBattle) {
                this.platform_type = lq_const_1.LQPlatformType.oppo;
            }
            else {
                this.platform_type = lq_const_1.LQPlatformType.vivo;
            }
        }
        else if (typeof wx !== 'undefined') {
            this.platform_type = lq_const_1.LQPlatformType.wx;
        }
        else if (typeof jsb !== 'undefined') {
            if (cc.sys.os === cc.sys.OS_ANDROID) {
                this.platform_type = lq_const_1.LQPlatformType.android;
            }
            else if (cc.sys.os === cc.sys.OS_IOS) {
                this.platform_type = lq_const_1.LQPlatformType.ios;
            }
            else {
                this.platform_type = lq_const_1.LQPlatformType.unknown;
            }
        }
        else if (cc.sys.isBrowser) {
            this.platform_type = lq_const_1.LQPlatformType.browser;
        }
    };
    LQPlatformUtil.get_platform = function () {
        return this.platform_type;
    };
    LQPlatformUtil.get_byte_dance = function () {
        return this.byte_dance_type;
    };
    LQPlatformUtil.is_wx = function () {
        return this.platform_type === lq_const_1.LQPlatformType.wx;
    };
    LQPlatformUtil.is_tt = function () {
        return this.platform_type === lq_const_1.LQPlatformType.tt;
    };
    LQPlatformUtil.is_oppo = function () {
        return this.platform_type === lq_const_1.LQPlatformType.oppo;
    };
    LQPlatformUtil.is_vivo = function () {
        return this.platform_type === lq_const_1.LQPlatformType.vivo;
    };
    LQPlatformUtil.is_ov = function () {
        return this.platform_type === lq_const_1.LQPlatformType.oppo || this.platform_type === lq_const_1.LQPlatformType.vivo;
    };
    LQPlatformUtil.is_browser = function () {
        return this.platform_type === lq_const_1.LQPlatformType.browser;
    };
    LQPlatformUtil.is_android = function () {
        return this.platform_type === lq_const_1.LQPlatformType.android;
    };
    LQPlatformUtil.is_ios = function () {
        return this.platform_type === lq_const_1.LQPlatformType.ios;
    };
    LQPlatformUtil.is_native = function () {
        return this.platform_type === lq_const_1.LQPlatformType.android || this.platform_type === lq_const_1.LQPlatformType.ios;
    };
    LQPlatformUtil.is_qq = function () {
        return this.platform_type === lq_const_1.LQPlatformType.qq;
    };
    LQPlatformUtil.is_baidu = function () {
        return this.platform_type === lq_const_1.LQPlatformType.baidu;
    };
    LQPlatformUtil.is_kwaigame = function () {
        return this.platform_type === lq_const_1.LQPlatformType.kwaigame;
    };
    return LQPlatformUtil;
}());
exports.LQPlatformUtil = LQPlatformUtil;
LQPlatformUtil.init();
if (LQPlatformUtil.is_tt()) {
    // console.log('---------当前平台:' + LQPlatformUtil.get_byte_dance());
}
else {
    // console.log('---------当前平台:' + LQPlatformUtil.get_platform());
}

cc._RF.pop();