import _ from "../../../../@babel/runtime/helpers/esm/extends.mjs";
import o from "../../../../@babel/runtime/helpers/esm/objectSpread2.mjs";
import E from "../../../../@babel/runtime/helpers/esm/slicedToArray.mjs";
import * as r from "react";
import { useRef as I } from "react";
import V from "../../../../classnames/index.mjs";
import p from "../../../../rc-motion/es/CSSMotion.mjs";
import "../../../../rc-motion/es/CSSMotionList.mjs";
import { offset as A } from "../../util.mjs";
import T from "./Panel.mjs";
var $ = /* @__PURE__ */ r.forwardRef(function(e, f) {
  var c = e.prefixCls, d = e.title, u = e.style, v = e.className, C = e.visible, y = e.forceRender, N = e.destroyOnClose, R = e.motionName, x = e.ariaId, S = e.onVisibleChanged, a = e.mousePosition, i = I(), b = r.useState(), n = E(b, 2), m = n[0], g = n[1], s = {};
  m && (s.transformOrigin = m);
  function l() {
    var t = A(i.current);
    g(a ? "".concat(a.x - t.left, "px ").concat(a.y - t.top, "px") : "");
  }
  return /* @__PURE__ */ r.createElement(p, {
    visible: C,
    onVisibleChanged: S,
    onAppearPrepare: l,
    onEnterPrepare: l,
    forceRender: y,
    motionName: R,
    removeOnLeave: N,
    ref: i
  }, function(t, O) {
    var P = t.className, h = t.style;
    return /* @__PURE__ */ r.createElement(T, _({}, e, {
      ref: f,
      title: d,
      ariaId: x,
      prefixCls: c,
      holderRef: O,
      style: o(o(o({}, h), u), s),
      className: V(v, P)
    }));
  });
});
$.displayName = "Content";
export {
  $ as default
};
