import { defineComponent as T, computed as i, openBlock as o, createBlock as r, unref as p, normalizeProps as P, guardReactiveProps as R, withCtx as c, createElementBlock as m, Fragment as a, renderList as x, mergeProps as s, resolveDynamicComponent as _, h as y, createCommentVNode as G } from "vue";
import { Space as S } from "@aplus-frontend/antdv";
import { omit as n } from "lodash-unified";
import "../../config-provider/index.mjs";
import "../../ap-button/ap-action-button.vue2.mjs";
import "../../ap-button/ap-button.vue2.mjs";
import "../ap-batch-action-group/ApBatchActionGroup.vue.mjs";
import "../ap-export-group/ApExportGroup.vue.mjs";
import { useGlobalConfig as B } from "../../config-provider/hooks/use-global-config.mjs";
import C from "../../ap-button/ap-button.vue.mjs";
import b from "../../ap-button/ap-action-button.vue.mjs";
import g from "../ap-batch-action-group/ApBatchActionGroup.vue2.mjs";
import L from "../ap-export-group/ApExportGroup.vue2.mjs";
const J = /* @__PURE__ */ T({
  __name: "ApButtonGroup",
  props: {
    spaceProps: {},
    selectedRows: {},
    selectedRowKeys: {},
    groupList: {}
  },
  setup(d) {
    const h = B("apExportGroup"), v = i(() => h.value?.hasPermission), u = d, w = i(() => u.groupList);
    function f(t) {
      let l = t?.ifShow;
      return !t?.ifShow && t?.auth && (l = () => v.value?.(t.auth)), l?.() ?? !0;
    }
    return (t, l) => (o(), r(p(S), P(R(u.spaceProps ?? {})), {
      default: c(() => [
        (o(!0), m(a, null, x(w.value, (e, k) => (o(), m(a, { key: k }, [
          e.valueType === "button" && f(e) ? (o(), r(C, s({
            key: 0,
            ref_for: !0
          }, {
            ...p(n)(e, ["valueType", "ifShow", "auth"])
          }), {
            default: c(() => [
              (o(), r(_(y(a, [e?.content]))))
            ]),
            _: 2
          }, 1040)) : e.valueType === "actionButton" && f(e) ? (o(), r(b, s({
            key: 1,
            ref_for: !0
          }, {
            ...p(n)(e, ["valueType", "ifShow", "auth"])
          }), {
            default: c(() => [
              (o(), r(_(y(a, [e?.content]))))
            ]),
            _: 2
          }, 1040)) : e.valueType === "batchActionGroup" ? (o(), r(g, s({
            key: 2,
            ref_for: !0
          }, {
            ...p(n)(e, ["valueType"]),
            selectedRows: u?.selectedRows
          }), null, 16)) : e.valueType === "exportGroup" ? (o(), r(L, s({
            key: 3,
            ref_for: !0
          }, {
            ...p(n)(e, ["valueType"]),
            selectedRowKeys: u?.selectedRowKeys
          }), null, 16)) : G("", !0)
        ], 64))), 128))
      ]),
      _: 1
    }, 16));
  }
});
export {
  J as default
};
