import { defineComponent as p, cloneVNode as f, openBlock as i, createBlock as u, unref as c, withCtx as l, renderSlot as d } from "vue";
import "../../render/index.mjs";
import "../../utils/index.mjs";
import { useDevWarning as _ } from "../../utils/warning.mjs";
import g from "../hooks/use-regist-form.mjs";
import { isDef as F } from "../../utils/is.mjs";
import k from "../../render/render.mjs";
const B = /* @__PURE__ */ p({
  name: "ApFormSet",
  __name: "index",
  props: {
    name: {},
    as: { default: "array" },
    initialValue: {},
    transform: {}
  },
  setup(o) {
    const e = o;
    g(e);
    const t = _("ApFormSet"), a = (n) => n.map((r, m) => {
      if (e.as === "object" && !F(r.props?.name))
        return t(!1, "usage", "FormItem skip because of no name prop."), r;
      const s = e.as === "array" ? [e.name, m] : [e.name, r.props.name];
      return f(r, { name: s.flat() });
    });
    return (n, r) => (i(), u(c(k), { renderer: a }, {
      default: l(() => [
        d(n.$slots, "default")
      ]),
      _: 3
    }));
  }
});
export {
  B as default
};
