"use strict";
/* NOTE: There is similar (but currently insanely convoluted)
   functionality in @cocalc/frontend/feature.ts.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.isChrome = exports.isSafari = exports.isIOS = void 0;
function isIOS() {
    var _a;
    if (typeof window == "undefined")
        return false;
    var navigator = window.navigator;
    return (((_a = navigator === null || navigator === void 0 ? void 0 : navigator.userAgent) === null || _a === void 0 ? void 0 : _a.match(/Mac/)) &&
        navigator.maxTouchPoints &&
        navigator.maxTouchPoints > 2);
}
exports.isIOS = isIOS;
function isSafari() {
    var _a;
    if (typeof window == "undefined")
        return false;
    if (isChrome())
        return false;
    var navigator = window.navigator;
    return (_a = navigator === null || navigator === void 0 ? void 0 : navigator.userAgent) === null || _a === void 0 ? void 0 : _a.match(/Safari/);
}
exports.isSafari = isSafari;
function isChrome() {
    var _a;
    if (typeof window == "undefined")
        return false;
    var navigator = window.navigator;
    return /Chrom(e|ium)/.test((_a = navigator === null || navigator === void 0 ? void 0 : navigator.userAgent) !== null && _a !== void 0 ? _a : "");
}
exports.isChrome = isChrome;
//# sourceMappingURL=feature.js.map