import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
import React__default from 'react';
import { Tooltip } from '../Tooltip/index.js';
import { $ as $prefixCls, a as $rcPrefixCls } from '../_verture/constant-66aa48a1.js';
import { u as usePopupContainer } from '../_verture/usePopupContainer-87febeb9.js';
import clsx from 'clsx';
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
import '../_verture/slicedToArray-76060636.js';
import '../_verture/unsupportedIterableToArray-cb478f24.js';
import 'rc-tooltip';
import 'rc-tooltip/lib/placements';

var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/6/7 上午11:06\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-popover {\n  color: rgb(46, 55, 67);\n  font-size: 14px;\n  font-variant: tabular-nums;\n  line-height: 1.5715;\n  list-style: none;\n  font-feature-settings: \"tnum\";\n  position: absolute;\n  top: 0;\n  left: 0;\n  z-index: 1500;\n  font-weight: 400;\n  white-space: normal;\n  text-align: left;\n  cursor: auto;\n  user-select: text;\n}\n.paraui-v3-popover::after {\n  position: absolute;\n  background: rgba(255, 255, 255, 0.01);\n  content: \"\";\n}\n.paraui-v3-popover.component-popover-hidden {\n  display: none;\n}\n.paraui-v3-popover .component-popover-inner {\n  background-color: rgb(255, 255, 255);\n  background-clip: padding-box;\n  border-radius: 4px;\n  box-shadow: 0px 2px 8px 0px rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-popover .component-popover-title {\n  margin: 0;\n  padding: 0 24px;\n  color: rgb(46, 55, 67);\n  font-weight: 700;\n  border-bottom: 1px solid #f0f0f0;\n  min-height: 44px;\n  display: flex;\n  align-items: center;\n}\n.paraui-v3-popover .component-popover-inner-content {\n  color: rgb(46, 55, 67);\n}\n.paraui-v3-popover .component-popover-buttons {\n  margin-bottom: 4px;\n  text-align: right;\n}\n.paraui-v3-popover .component-popover-buttons button {\n  margin-left: 8px;\n}\n.paraui-v3-popover .component-popover-arrow {\n  position: absolute;\n  display: none;\n  width: 16px;\n  height: 16px;\n  overflow: hidden;\n  background: transparent;\n  pointer-events: none;\n}\n.paraui-v3-popover .component-popover-arrow-content {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  display: block;\n  width: 11.3137085px;\n  height: 11.3137085px;\n  margin: auto;\n  background-color: rgb(255, 255, 255);\n  content: \"\";\n  border-radius: 0 0 4px;\n  pointer-events: none;\n}\n.paraui-v3-popover .component-popover-arrow-content::before {\n  position: absolute;\n  top: -11.3137085px;\n  left: -11.3137085px;\n  width: 33.9411255px;\n  height: 33.9411255px;\n  background: rgb(255, 255, 255) -10px -10px no-repeat;\n  content: \"\";\n  -webkit-clip-path: path(\"M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z\");\n}\n.paraui-v3-popover.component-popover-placement-top .component-popover-arrow, .paraui-v3-popover.component-popover-placement-topLeft .component-popover-arrow, .paraui-v3-popover.component-popover-placement-topRight .component-popover-arrow {\n  bottom: -0.6862915px;\n}\n.paraui-v3-popover.component-popover-placement-top .component-popover-arrow-content, .paraui-v3-popover.component-popover-placement-topLeft .component-popover-arrow-content, .paraui-v3-popover.component-popover-placement-topRight .component-popover-arrow-content {\n  box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);\n  transform: translateY(-1px) rotate(45deg);\n}\n.paraui-v3-popover.component-popover-placement-top .component-popover-arrow {\n  left: 50%;\n  transform: translateX(-50%);\n}\n.paraui-v3-popover.component-popover-placement-topLeft .component-popover-arrow {\n  left: 16px;\n}\n.paraui-v3-popover.component-popover-placement-topRight .component-popover-arrow {\n  right: 16px;\n}\n.paraui-v3-popover.component-popover-placement-right .component-popover-arrow, .paraui-v3-popover.component-popover-placement-rightTop .component-popover-arrow, .paraui-v3-popover.component-popover-placement-rightBottom .component-popover-arrow {\n  left: -0.6862915px;\n}\n.paraui-v3-popover.component-popover-placement-right .component-popover-arrow-content, .paraui-v3-popover.component-popover-placement-rightTop .component-popover-arrow-content, .paraui-v3-popover.component-popover-placement-rightBottom .component-popover-arrow-content {\n  box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);\n  transform: translateX(1px) rotate(135deg);\n}\n.paraui-v3-popover.component-popover-placement-right .component-popover-arrow {\n  top: 50%;\n  transform: translateY(-50%);\n}\n.paraui-v3-popover.component-popover-placement-rightTop .component-popover-arrow {\n  top: 12px;\n}\n.paraui-v3-popover.component-popover-placement-rightBottom .component-popover-arrow {\n  bottom: 12px;\n}\n.paraui-v3-popover.component-popover-placement-bottom .component-popover-arrow, .paraui-v3-popover.component-popover-placement-bottomLeft .component-popover-arrow, .paraui-v3-popover.component-popover-placement-bottomRight .component-popover-arrow {\n  top: -0.6862915px;\n}\n.paraui-v3-popover.component-popover-placement-bottom .component-popover-arrow-content, .paraui-v3-popover.component-popover-placement-bottomLeft .component-popover-arrow-content, .paraui-v3-popover.component-popover-placement-bottomRight .component-popover-arrow-content {\n  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.06);\n  transform: translateY(1px) rotate(-135deg);\n}\n.paraui-v3-popover.component-popover-placement-bottom .component-popover-arrow {\n  left: 50%;\n  transform: translateX(-50%);\n}\n.paraui-v3-popover.component-popover-placement-bottomLeft .component-popover-arrow {\n  left: 16px;\n}\n.paraui-v3-popover.component-popover-placement-bottomRight .component-popover-arrow {\n  right: 16px;\n}\n.paraui-v3-popover.component-popover-placement-left .component-popover-arrow, .paraui-v3-popover.component-popover-placement-leftTop .component-popover-arrow, .paraui-v3-popover.component-popover-placement-leftBottom .component-popover-arrow {\n  right: -0.6862915px;\n}\n.paraui-v3-popover.component-popover-placement-left .component-popover-arrow-content, .paraui-v3-popover.component-popover-placement-leftTop .component-popover-arrow-content, .paraui-v3-popover.component-popover-placement-leftBottom .component-popover-arrow-content {\n  box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);\n  transform: translateX(-1px) rotate(-45deg);\n}\n.paraui-v3-popover.component-popover-placement-left .component-popover-arrow {\n  top: 50%;\n  transform: translateY(-50%);\n}\n.paraui-v3-popover.component-popover-placement-leftTop .component-popover-arrow {\n  top: 12px;\n}\n.paraui-v3-popover.component-popover-placement-leftBottom .component-popover-arrow {\n  bottom: 12px;\n}\n\n.component-popover-zoom-big-enter,\n.component-popover-zoom-big-appear {\n  animation-duration: 0.2s;\n  animation-fill-mode: both;\n  animation-play-state: paused;\n}\n\n.component-popover-zoom-big-leave {\n  animation-duration: 0.2s;\n  animation-fill-mode: both;\n  animation-play-state: paused;\n}\n\n.component-popover-zoom-big-enter.component-popover-zoom-big-enter-active,\n.component-popover-zoom-big-appear.component-popover-zoom-big-appear-active {\n  animation-name: componentPopoverZoomBigIn;\n  animation-play-state: running;\n}\n\n.component-popover-zoom-big-leave.component-popover-zoom-big-leave-active {\n  animation-name: componentPopoverZoomBigOut;\n  animation-play-state: running;\n  pointer-events: none;\n}\n\n.component-popover-zoom-big-enter,\n.component-popover-zoom-big-appear {\n  transform: scale(0);\n  opacity: 0;\n  animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);\n}\n\n.component-popover-zoom-big-enter-prepare,\n.component-popover-zoom-big-appear-prepare {\n  transform: none;\n}\n\n.component-popover-zoom-big-leave {\n  animation-timing-function: cubic-bezier(0.78, 0.14, 0.15, 0.86);\n}\n\n@keyframes componentPopoverZoomBigIn {\n  0% {\n    transform: scale(0.8);\n    opacity: 0;\n  }\n  100% {\n    transform: scale(1);\n    opacity: 1;\n  }\n}\n@keyframes componentPopoverZoomBigOut {\n  0% {\n    transform: scale(1);\n  }\n  100% {\n    transform: scale(0.8);\n    opacity: 0;\n  }\n}";
styleInject(css_248z);

//popover
var Popover = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
  var title = props.title,
    content = props.content,
    restProps = __rest(props, ["title", "content"]);
  var wrapRef = React__default.useRef();
  var getPopupContainer = usePopupContainer(wrapRef, props.getPopupContainer);
  //浮层
  var getOverlay = function getOverlay(prefixCls) {
    if (!title && !content) return null;
    return jsxs(Fragment, {
      children: [title && jsx("div", Object.assign({
        className: "".concat(prefixCls, "-title")
      }, {
        children: title
      })), jsx("div", Object.assign({
        className: "".concat(prefixCls, "-inner-content")
      }, {
        children: content
      }))]
    });
  };
  var prefixCls = "".concat($rcPrefixCls, "-popover");
  return jsx(Tooltip, Object.assign({}, restProps, {
    isPopover: true,
    prefixCls: prefixCls,
    overlayClassName: clsx("".concat($prefixCls, "-popover"), props.overlayClassName),
    ref: wrapRef,
    title: getOverlay(prefixCls),
    transitionName: "".concat($rcPrefixCls, "-popover-zoom-big"),
    getPopupContainer: getPopupContainer
  }));
});
Popover.displayName = 'Popover';
Popover.defaultProps = {
  placement: 'bottom',
  trigger: 'click',
  mouseEnterDelay: 0.1,
  mouseLeaveDelay: 0.1,
  arrow: false
};

export { Popover, Popover as default };
