"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 ChildWindowManager
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChildWindowWidget = void 0;
require("./ChildWindowWidget.scss");
const React = require("react");
const useReparentPopoutWidget_1 = require("../preview/reparent-popout-widgets/useReparentPopoutWidget");
const ReparentedPopoutWidget_1 = require("../preview/reparent-popout-widgets/ReparentedPopoutWidget");
/** Component used to wrap a widget for use in a child window.
 * @internal
 */
function ChildWindowWidget({ widgetContainerId, widgetDef, }) {
    const reparent = (0, useReparentPopoutWidget_1.useReparentPopoutWidget)(widgetDef.id);
    if (reparent) {
        return React.createElement(ReparentedPopoutWidget_1.ReparentedPopoutWidget, { widgetId: widgetContainerId });
    }
    return (React.createElement("div", { className: "uifw-popout-widget-filled-container", "data-widget-id": widgetContainerId }, widgetDef.reactNode));
}
exports.ChildWindowWidget = ChildWindowWidget;
//# sourceMappingURL=ChildWindowWidget.js.map