import { defineComponent as v, computed as w, unref as r, openBlock as o, createElementBlock as u, createVNode as c, withCtx as l, Fragment as m, renderList as b, createBlock as d, mergeProps as x, resolveDynamicComponent as B, createCommentVNode as V } from "vue";
import { Row as N, Col as h, Checkbox as I } from "@aplus-frontend/antdv";
import { useInjectApTable as L } from "../../../context.mjs";
import "../select-group/index.vue.mjs";
import { getLabelNode as P } from "../utils.mjs";
import S from "../select-group/index.vue2.mjs";
const U = { key: 0 }, T = /* @__PURE__ */ v({
  __name: "index",
  props: {
    value: {}
  },
  setup(s) {
    const i = s, { columnsBackup: p, renderConfig: k } = L(), g = w(() => [...r(p) || []].sort((e, t) => e.children?.length && !t.children?.length ? 1 : !e.children?.length && t.children?.length ? -1 : 0));
    function f(n) {
      return i.value.find((e) => e.key === n.key);
    }
    function C(n) {
      const e = f(n);
      return {
        checked: e?.show,
        disabled: e?.disabled
      };
    }
    function _(n, e) {
      const a = i.value?.find((y) => y.key === n);
      a && (a.show = e);
    }
    return (n, e) => s.value?.length ? (o(), u("div", U, [
      c(r(N), { gutter: [24, 12] }, {
        default: l(() => [
          (o(!0), u(m, null, b(g.value, (t) => (o(), u(m, {
            key: t.key
          }, [
            t.children?.length ? (o(), d(r(h), {
              key: 1,
              span: 24
            }, {
              default: l(() => [
                c(S, {
                  value: f(t)
                }, null, 8, ["value"])
              ]),
              _: 2
            }, 1024)) : (o(), d(r(h), {
              key: 0,
              span: 12
            }, {
              default: l(() => [
                c(r(I), x({ ref_for: !0 }, C(t), {
                  "onUpdate:checked": (a) => _(t.key, a)
                }), {
                  default: l(() => [
                    (o(), d(B(r(P)(t, r(k)))))
                  ]),
                  _: 2
                }, 1040, ["onUpdate:checked"])
              ]),
              _: 2
            }, 1024))
          ], 64))), 128))
        ]),
        _: 1
      })
    ])) : V("", !0);
  }
});
export {
  T as default
};
