import { isVNode as _, defineComponent as P, createVNode as s, mergeProps as a, openBlock as y, createBlock as S, unref as r, withCtx as c, renderSlot as h } from "vue";
import { Col as w, Row as C } from "@aplus-frontend/antdv";
import { pick as R, isBoolean as b, omit as N } from "lodash-unified";
import "../../render/index.mjs";
import "../../config-provider/index.mjs";
import "../../utils/index.mjs";
import { apFormItemColPropKeys as j } from "../constant.mjs";
import k from "../style/item-group.mjs";
import { buildColSpan as x, getStringName as B } from "./helper.mjs";
import { useNamespace as I } from "../../config-provider/hooks/use-namespace.mjs";
import { isDef as $ } from "../../utils/is.mjs";
import F from "../../render/render.mjs";
function O(o) {
  return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !_(o);
}
const M = /* @__PURE__ */ P({
  name: "ApFormItemGroup",
  __name: "index",
  props: {
    align: {},
    justify: {},
    prefixCls: {},
    gutter: {
      default: 24
    },
    wrap: {
      type: Boolean,
      default: void 0
    },
    countPerRow: {
      default: 3
    }
  },
  setup(o) {
    const p = o, {
      b: m
    } = I("ap-form-item-group"), f = k("ap-form-item-group");
    function u(n) {
      return n.map((e, d) => {
        const t = e.props, i = R(t, j), l = i?.span ? {} : x(p.countPerRow), g = b(t.hidden) ? !!t.hidden : $(t.hidden);
        return s(w, a(l, i, {
          key: `${d}-${B(t.name)}`,
          class: g ? m("col-hidden") : ""
        }), O(e) ? e : {
          default: () => [e]
        });
      });
    }
    return (n, e) => (y(), S(r(C), a({
      class: [r(m)(), r(f)]
    }, r(N)(p, ["countPerRow"])), {
      default: c(() => [s(r(F), {
        renderer: u
      }, {
        default: c(() => [h(n.$slots, "default")]),
        _: 3
      })]),
      _: 3
    }, 16, ["class"]));
  }
});
export {
  M as default
};
