"use strict";
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var electron_1 = require("electron");
var primaryWindowId;
var getPrimaryWindow = function () {
    var _a = __read(primaryWindowId ? [electron_1.BrowserWindow.fromId(primaryWindowId)] : electron_1.BrowserWindow.getAllWindows(), 1), primaryWindow = _a[0];
    return primaryWindow;
};
exports.getPrimaryWindow = getPrimaryWindow;
var setPrimaryWindowId = function (newPrimaryWindowId) {
    primaryWindowId = newPrimaryWindowId;
};
exports.setPrimaryWindowId = setPrimaryWindowId;
var showPrimaryWindow = function () {
    var browserWindow = getPrimaryWindow();
    if (browserWindow) {
        if (browserWindow.isMinimized()) {
            browserWindow.restore();
        }
        else if (!browserWindow.isVisible()) {
            browserWindow.show();
        }
        browserWindow.focus();
    }
};
exports.showPrimaryWindow = showPrimaryWindow;
//# sourceMappingURL=window-manager.js.map