Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.safeArea = void 0;

var e = null;

function t() {
    return new Promise(function(t, s) {
        null != e ? t(e) : wx.getSystemInfo({
            success: function(s) {
                var o = s.model, a = s.screenHeight, n = s.statusBarHeight, r = /iphone x/i.test(o), i = /iPhone11/i.test(o) && 812 === a;
                t(e = {
                    isIPhoneX: r || i,
                    statusBarHeight: n
                });
            },
            fail: s
        });
    });
}

exports.safeArea = function() {
    var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, s = e.safeAreaInsetBottom, o = void 0 === s || s, a = e.safeAreaInsetTop, n = void 0 !== a && a;
    return Behavior({
        properties: {
            safeAreaInsetTop: {
                type: Boolean,
                value: n
            },
            safeAreaInsetBottom: {
                type: Boolean,
                value: o
            }
        },
        created: function() {
            var e = this;
            t().then(function(t) {
                var s = t.isIPhoneX, o = t.statusBarHeight;
                e.set({
                    isIPhoneX: s,
                    statusBarHeight: o
                });
            });
        }
    });
};