import v from "../../../@babel/runtime/helpers/esm/extends.mjs";
import b from "../../../@babel/runtime/helpers/esm/objectSpread2.mjs";
import k from "../../../@babel/runtime/helpers/esm/objectWithoutProperties.mjs";
import E from "../../../@babel/runtime/helpers/esm/defineProperty.mjs";
import r from "../../../classnames/index.mjs";
import h from "../../../rc-motion/es/CSSMotion.mjs";
import "../../../rc-motion/es/CSSMotionList.mjs";
import * as n from "react";
import K from "../TabContext.mjs";
import L from "./TabPane.mjs";
var j = ["key", "forceRender", "style", "className", "destroyInactiveTabPane"], B = function(a) {
  var f = a.id, y = a.activeKey, c = a.animated, P = a.tabPosition, p = a.destroyInactiveTabPane, i = n.useContext(K), t = i.prefixCls, u = i.tabs, s = c.tabPane, m = "".concat(t, "-tabpane");
  return /* @__PURE__ */ n.createElement("div", {
    className: r("".concat(t, "-content-holder"))
  }, /* @__PURE__ */ n.createElement("div", {
    className: r("".concat(t, "-content"), "".concat(t, "-content-").concat(P), E({}, "".concat(t, "-content-animated"), s))
  }, u.map(function(e) {
    var o = e.key, C = e.forceRender, x = e.style, N = e.className, T = e.destroyInactiveTabPane, R = k(e, j), l = o === y;
    return /* @__PURE__ */ n.createElement(h, v({
      key: o,
      visible: l,
      forceRender: C,
      removeOnLeave: !!(p || T),
      leavedClassName: "".concat(m, "-hidden")
    }, c.tabPaneMotion), function(d, I) {
      var S = d.style, _ = d.className;
      return /* @__PURE__ */ n.createElement(L, v({}, R, {
        prefixCls: m,
        id: f,
        tabKey: o,
        animated: s,
        active: l,
        style: b(b({}, x), S),
        className: r(N, _),
        ref: I
      }));
    });
  })));
};
export {
  B as default
};
