import * as c from "react";
import f from "../../../../rc-util/es/Children/toArray.mjs";
import { devUseWarning as p } from "../../_util/warning.mjs";
var b = globalThis && globalThis.__rest || function(r, n) {
  var o = {};
  for (var t in r)
    Object.prototype.hasOwnProperty.call(r, t) && n.indexOf(t) < 0 && (o[t] = r[t]);
  if (r != null && typeof Object.getOwnPropertySymbols == "function")
    for (var e = 0, t = Object.getOwnPropertySymbols(r); e < t.length; e++)
      n.indexOf(t[e]) < 0 && Object.prototype.propertyIsEnumerable.call(r, t[e]) && (o[t[e]] = r[t[e]]);
  return o;
};
function u(r) {
  return r.filter((n) => n);
}
function O(r, n) {
  if (process.env.NODE_ENV !== "production" && p("Tabs").deprecated(!n, "Tabs.TabPane", "items"), r)
    return r;
  const o = f(n).map((t) => {
    if (/* @__PURE__ */ c.isValidElement(t)) {
      const {
        key: e,
        props: i
      } = t, a = i || {}, {
        tab: s
      } = a, l = b(a, ["tab"]);
      return Object.assign(Object.assign({
        key: String(e)
      }, l), {
        label: s
      });
    }
    return null;
  });
  return u(o);
}
export {
  O as default
};
