'use strict';
Object.defineProperty(exports, '__esModule', {
    value: true
});
exports.checkIPhoneX = exports.getSystemInfo = exports.safeAreaInset = void 0;
var systemInfo = null;
var safeAreaInset = {
    top: 88,
    left: 0,
    right: 0,
    bottom: 34
};
exports.safeAreaInset = safeAreaInset;
var getSystemInfo = function (e) {
    if (!systemInfo || e) {
        try {
            systemInfo = uni.getSystemInfoSync();
        } catch (e) {
            console.log('CatchClause', e);
            console.log('CatchClause', e);
        }
        try {
            safeAreaInset.top = systemInfo.statusBarHeight + systemInfo.safeArea.top;
            safeAreaInset.bottom = systemInfo.screenHeight - systemInfo.safeArea.bottom;
        } catch (e) {
            console.log('CatchClause', e);
            console.log('CatchClause', e);
        }
    }
    return systemInfo;
};
exports.getSystemInfo = getSystemInfo;
var isIPhoneX = function (e) {
    var t = e.model;
    var s = e.windowHeight;
    var o = e.windowWidth;
    return /iphone (x|12|13)/.test(t.toLowerCase()) || (812 <= s && 2 < s / o);
};
var checkIPhoneX = function (e) {
    return isIPhoneX(getSystemInfo(e));
};
(exports.checkIPhoneX = checkIPhoneX)();
