"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "AlertDialogBody", {
  enumerable: true,
  get: function get() {
    return _Modal.ModalBody;
  }
});
Object.defineProperty(exports, "AlertDialogCloseButton", {
  enumerable: true,
  get: function get() {
    return _Modal.ModalCloseButton;
  }
});
Object.defineProperty(exports, "AlertDialogFooter", {
  enumerable: true,
  get: function get() {
    return _Modal.ModalFooter;
  }
});
Object.defineProperty(exports, "AlertDialogHeader", {
  enumerable: true,
  get: function get() {
    return _Modal.ModalHeader;
  }
});
Object.defineProperty(exports, "AlertDialogOverlay", {
  enumerable: true,
  get: function get() {
    return _Modal.ModalOverlay;
  }
});
exports.AlertDialogContent = exports.AlertDialog = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireWildcard(require("react"));

var _Modal = require("../Modal");

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

var __jsx = _react["default"].createElement;

var formatIds = function formatIds(id) {
  return {
    content: "alert-dialog-".concat(id),
    header: "alert-dialog-".concat(id, "-label"),
    body: "alert-dialog-".concat(id, "-desc")
  };
};

var AlertDialog = function AlertDialog(_ref) {
  var leastDestructiveRef = _ref.leastDestructiveRef,
      children = _ref.children,
      props = (0, _objectWithoutProperties2["default"])(_ref, ["leastDestructiveRef", "children"]);
  return __jsx(_Modal.Modal, (0, _extends2["default"])({
    formatIds: formatIds,
    initialFocusRef: leastDestructiveRef
  }, props), children);
};

exports.AlertDialog = AlertDialog;
var AlertDialogContent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
  return __jsx(_Modal.ModalContent, (0, _extends2["default"])({
    ref: ref,
    role: "alertdialog"
  }, props), props.children);
});
exports.AlertDialogContent = AlertDialogContent;
//# sourceMappingURL=AlertDialog.js.map