"use strict";

require("core-js/modules/es.object.define-property.js");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.FcrDraggableModal = void 0;
var _reactRnd = require("react-rnd");
var _windowHeader = require("../window-header");
require("./draggable-dialog.css");
var _classnames = _interopRequireDefault(require("classnames"));
var _jsxRuntime = require("react/jsx-runtime");
var FcrDraggableModal = exports.FcrDraggableModal = function FcrDraggableModal(_ref) {
  var children = _ref.children,
    title = _ref.title,
    width = _ref.width,
    height = _ref.height,
    onClose = _ref.onClose,
    rootClassName = _ref.rootClassName;
  var DIALOG_WIDTH = width !== null && width !== void 0 ? width : 440;
  var DIALOG_HEIGHT = height !== null && height !== void 0 ? height : 434;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRnd.Rnd, {
    bounds: '#root',
    enableResizing: false,
    cancel: ".frc-window-header__operates",
    dragHandleClassName: "frc-window-header",
    "default": {
      width: DIALOG_WIDTH,
      height: DIALOG_HEIGHT,
      x: (document.body.clientWidth - DIALOG_WIDTH) / 2,
      y: (document.body.clientHeight - DIALOG_HEIGHT) / 2
    },
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: (0, _classnames["default"])('frc-draggable-dialog', rootClassName),
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_windowHeader.FcrWindowHeader, {
        title: title,
        showClose: true,
        type: _windowHeader.WindowType.MODAL,
        onClose: onClose,
        withWindowPopUpButton: false
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        className: "fcr-dialog-content",
        children: children
      })]
    }, "frc-common-dialog")
  }, 'common-dialog');
};