import v from "../../../@babel/runtime/helpers/esm/slicedToArray.mjs";
import A from "../../../@babel/runtime/helpers/esm/typeof.mjs";
import E from "../../../rc-util/es/hooks/useMemo.mjs";
import P from "../../../rc-util/es/isEqual.mjs";
import R from "../../../rc-util/es/utils/get.mjs";
import { warningOnce as h } from "../../../rc-util/es/warning.mjs";
import * as a from "react";
import N from "../context/PerfContext.mjs";
import { validateValue as V } from "../utils/valueUtil.mjs";
import { useImmutableMark as _ } from "../context/TableContext.mjs";
function b(r) {
  return r && A(r) === "object" && !Array.isArray(r) && !/* @__PURE__ */ a.isValidElement(r);
}
function z(r, e, n, s, m, p) {
  var l = a.useContext(N), c = _(), y = E(function() {
    if (V(s))
      return [s];
    var u = e == null || e === "" ? [] : Array.isArray(e) ? e : [e], i = R(r, u), t = i, f = void 0;
    if (m) {
      var o = m(i, r, n);
      b(o) ? (process.env.NODE_ENV !== "production" && h(!1, "`columns.render` return cell props is deprecated with perf issue, please use `onCell` instead."), t = o.children, f = o.props, l.renderWithProps = !0) : t = o;
    }
    return [t, f];
  }, [
    // Force update deps
    c,
    // Normal deps
    r,
    s,
    e,
    m,
    n
  ], function(u, i) {
    if (p) {
      var t = v(u, 2), f = t[1], o = v(i, 2), C = o[1];
      return p(C, f);
    }
    return l.renderWithProps ? !0 : !P(u, i, !0);
  });
  return y;
}
export {
  z as default
};
