"use strict";
/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Dialog
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.InternalModalDialogManager = void 0;
const DialogManagerBase_1 = require("./DialogManagerBase");
const core_bentley_1 = require("@itwin/core-bentley");
/** Modal Dialog Manager class displays and manages multiple modal dialogs
 * @internal
 */
class InternalModalDialogManager {
    /** Get the array of modal dialogs */
    static get dialogs() {
        return InternalModalDialogManager.dialogManager.dialogs;
    }
    /** Open a modal dialog
     * @param dialog The Dialog to open
     * @param id The id of the Dialog. If one is not provided, an id is generated.
     * @param parentDocument The Document used to determine the owning window.
     */
    static open(dialog, id, parentDocument = document) {
        InternalModalDialogManager.dialogManager.openDialog(dialog, id, parentDocument);
    }
    /** Close a modal dialog
     * @param dialog The Dialog to open. If one is not specified, the active dialog will be closed.
     */
    static close(dialog) {
        InternalModalDialogManager.dialogManager.closeDialog(dialog);
    }
    /** @internal */
    static closeAll() {
        InternalModalDialogManager.dialogManager.closeAll();
    }
    /** Update the dialogs */
    static update() {
        InternalModalDialogManager.dialogManager.update();
    }
    /** Get the active modal dialog */
    static get active() {
        return InternalModalDialogManager.dialogManager.activeDialog;
    }
    /** Get the count of modal dialogs */
    static get count() {
        return InternalModalDialogManager.dialogManager.dialogCount;
    }
}
exports.InternalModalDialogManager = InternalModalDialogManager;
/** Modal Dialog Changed Event */
InternalModalDialogManager.onModalDialogChangedEvent = new core_bentley_1.BeUiEvent(); // eslint-disable-line deprecation/deprecation
/** @internal */
InternalModalDialogManager.dialogManager = new DialogManagerBase_1.DialogManagerBase(InternalModalDialogManager.onModalDialogChangedEvent);
//# sourceMappingURL=InternalModalDialogManager.js.map