"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = EmptyBlockInserter;
var _clsx = _interopRequireDefault(require("clsx"));
var _cover = _interopRequireDefault(require("../block-popover/cover"));
var _useBlockToolbarPopoverProps = _interopRequireDefault(require("./use-block-toolbar-popover-props"));
var _inserter = _interopRequireDefault(require("../inserter"));
var _useSelectedBlockToolProps = _interopRequireDefault(require("./use-selected-block-tool-props"));
var _jsxRuntime = require("react/jsx-runtime");
/**
 * External dependencies
 */

/**
 * Internal dependencies
 */

function EmptyBlockInserter({
  clientId,
  __unstableContentRef
}) {
  const {
    capturingClientId,
    isInsertionPointVisible,
    lastClientId,
    rootClientId
  } = (0, _useSelectedBlockToolProps.default)(clientId);
  const popoverProps = (0, _useBlockToolbarPopoverProps.default)({
    contentElement: __unstableContentRef?.current,
    clientId
  });
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_cover.default, {
    clientId: capturingClientId || clientId,
    bottomClientId: lastClientId,
    className: (0, _clsx.default)('block-editor-block-list__block-side-inserter-popover', {
      'is-insertion-point-visible': isInsertionPointVisible
    }),
    __unstableContentRef: __unstableContentRef,
    ...popoverProps,
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
      className: "block-editor-block-list__empty-block-inserter",
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_inserter.default, {
        position: "bottom right",
        rootClientId: rootClientId,
        clientId: clientId,
        __experimentalIsQuick: true
      })
    })
  });
}
//# sourceMappingURL=empty-block-inserter.js.map