"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _clsx = _interopRequireDefault(require("clsx"));
var _element = require("@wordpress/element");
var _blockSelectionButton = _interopRequireDefault(require("./block-selection-button"));
var _blockPopover = require("../block-popover");
var _useBlockToolbarPopoverProps = _interopRequireDefault(require("./use-block-toolbar-popover-props"));
var _useSelectedBlockToolProps = _interopRequireDefault(require("./use-selected-block-tool-props"));
var _jsxRuntime = require("react/jsx-runtime");
/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

function BlockToolbarBreadcrumb({
  clientId,
  __unstableContentRef
}, ref) {
  const {
    capturingClientId,
    isInsertionPointVisible,
    lastClientId,
    rootClientId
  } = (0, _useSelectedBlockToolProps.default)(clientId);
  const popoverProps = (0, _useBlockToolbarPopoverProps.default)({
    contentElement: __unstableContentRef?.current,
    clientId
  });
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockPopover.PrivateBlockPopover, {
    clientId: capturingClientId || clientId,
    bottomClientId: lastClientId,
    className: (0, _clsx.default)('block-editor-block-list__block-popover', {
      'is-insertion-point-visible': isInsertionPointVisible
    }),
    resize: false,
    ...popoverProps,
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockSelectionButton.default, {
      ref: ref,
      clientId: clientId,
      rootClientId: rootClientId
    })
  });
}
var _default = exports.default = (0, _element.forwardRef)(BlockToolbarBreadcrumb);
//# sourceMappingURL=block-toolbar-breadcrumb.js.map