'use strict';

class BrowserWindow {
    /**
     * Returns the width of the window
     */
    get width() {
        if (balBrowser.hasWindow) {
            return window.innerWidth;
        }
        return 0;
    }
    /**
     * Returns the height of the window
     */
    get height() {
        if (balBrowser.hasWindow) {
            return window.innerHeight;
        }
        return 0;
    }
}
class Browser {
    constructor() {
        this.window = new BrowserWindow();
    }
    /**
     * Is true when it is a Safari browser
     */
    get isSafari() {
        return /^((?!chrome|android).)*safari/i.test(this.userAgent);
    }
    /**
     * Is true when the window object is defined
     */
    get hasWindow() {
        return typeof window !== 'undefined';
    }
    /**
     * Is true when the navigator object is defined
     */
    get hasNavigator() {
        return typeof navigator !== 'undefined';
    }
    /**
     * Is true when the document object is defined
     */
    get hasDocument() {
        return typeof document !== 'undefined';
    }
    /**
     * Returns a string with the user agents
     */
    get userAgent() {
        var _a;
        if (this.hasWindow && this.hasNavigator) {
            return (_a = navigator.userAgent) !== null && _a !== void 0 ? _a : '';
        }
        return '';
    }
}
const balBrowser = new Browser();

exports.balBrowser = balBrowser;
