import "core-js/modules/es.symbol.js";
import "core-js/modules/es.array.filter.js";
import "core-js/modules/es.array.for-each.js";
import "core-js/modules/es.array.push.js";
import "core-js/modules/es.object.define-properties.js";
import "core-js/modules/es.object.define-property.js";
import "core-js/modules/es.object.get-own-property-descriptor.js";
import "core-js/modules/es.object.get-own-property-descriptors.js";
import "core-js/modules/es.object.keys.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/esnext.iterator.constructor.js";
import "core-js/modules/esnext.iterator.filter.js";
import "core-js/modules/esnext.iterator.for-each.js";
import "core-js/modules/web.dom-collections.for-each.js";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import classNames from 'classnames';
import { FcrButton } from '../button';
import { FcrCheckbox } from '../checkbox';
import { BaseDialog } from '.';
import './confirm-dialog.css';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export var FcrConfirmDialog = function FcrConfirmDialog(props) {
  var onCancel = props.onCancel,
    visible = props.visible,
    onClose = props.onClose,
    content = props.content,
    children = props.children,
    title = props.title,
    closable = props.closable,
    footer = props.footer,
    closeIcon = props.closeIcon,
    maskClosable = props.maskClosable,
    onOk = props.onOk,
    checkable = props.checkable,
    checkedProps = props.checkedProps,
    width = props.width,
    icon = props.icon,
    okText = props.okText,
    cancelText = props.cancelText,
    afterClose = props.afterClose,
    okButtonProps = props.okButtonProps,
    cancelButtonProps = props.cancelButtonProps,
    _props$okButtonVisibl = props.okButtonVisible,
    okButtonVisible = _props$okButtonVisibl === void 0 ? true : _props$okButtonVisibl,
    _props$cancelButtonVi = props.cancelButtonVisible,
    cancelButtonVisible = _props$cancelButtonVi === void 0 ? true : _props$cancelButtonVi,
    getContainer = props.getContainer;
  return /*#__PURE__*/_jsxs(BaseDialog, {
    wrapClassName: "fcr-confirm-dialog-wrap",
    classNames: "fcr-confirm-dialog",
    getContainer: getContainer,
    afterClose: afterClose,
    closable: closable,
    closeIcon: closeIcon,
    width: width || 415,
    maskClosable: maskClosable,
    visible: visible,
    onClose: onClose,
    children: [/*#__PURE__*/_jsxs("div", {
      className: "fcr-confirm-dialog-inner-wrap",
      children: [icon && /*#__PURE__*/_jsx("div", {
        className: "fcr-confirm-dialog-inner-icon",
        children: icon
      }), /*#__PURE__*/_jsx("div", {}), /*#__PURE__*/_jsxs("div", {
        children: [/*#__PURE__*/_jsx("div", {
          className: classNames('fcr-confirm-dialog-title'),
          children: title
        }), /*#__PURE__*/_jsx("div", {
          className: classNames('fcr-confirm-dialog-inner'),
          children: content || children
        })]
      })]
    }), /*#__PURE__*/_jsxs("div", {
      className: classNames('fcr-confirm-dialog-footer'),
      children: [checkable && /*#__PURE__*/_jsx(FcrCheckbox, _objectSpread({}, checkedProps)), footer || /*#__PURE__*/_jsxs("div", {
        className: classNames('fcr-confirm-dialog-footer-btns'),
        children: [cancelButtonVisible && /*#__PURE__*/_jsx(FcrButton, _objectSpread(_objectSpread({
          type: "gray",
          onClick: function onClick() {
            onCancel === null || onCancel === void 0 || onCancel();
            onClose === null || onClose === void 0 || onClose();
          },
          size: "S"
        }, cancelButtonProps), {}, {
          children: cancelText || 'Cancel'
        })), okButtonVisible && /*#__PURE__*/_jsx(FcrButton, _objectSpread(_objectSpread({
          onClick: onOk,
          size: "S"
        }, okButtonProps), {}, {
          children: okText || 'OK'
        }))]
      })]
    })]
  });
};