import { computed as O, createElementBlock as u, openBlock as f, renderSlot as a, normalizeProps as i, guardReactiveProps as c, Fragment as S, renderList as D, createVNode as k, mergeProps as v, unref as y } from "vue";
import { I as e, _ as g, a as C, k as $, S as h } from "./install-BuMO14Rb.js";
const b = [
  e.ADD,
  e.ADD_CONTACT,
  e.COPY,
  e.DOWNLOAD_PDF,
  e.DOWNLOAD,
  e.UPLOAD,
  e.COLUMNS,
  e.VARIABLES,
  e.FILTERS,
  e.REFRESH,
  e.DELETE,
  e.SORT
], z = b, E = { class: "wt-action-bar" }, L = {
  __name: "wt-action-bar",
  props: {
    /**
     * [`'table'`, `'section'`]
     * */
    mode: {
      type: String,
      default: "table",
      validator: (t) => [
        "table",
        "section"
      ].includes(t)
    },
    /**
     * Not implemented
     */
    size: {
      type: String
      // default: 'md',
      // validator: (v) => ['sm', 'md', 'lg'].includes(v),
    },
    /**
     * Leave the default value for the mode only listed in includes prop
     */
    include: {
      type: Array,
      default: () => []
    },
    /**
     * Leave the default values for the mode, except for those in exclude prop
     */
    exclude: {
      type: Array,
      default: () => []
    },
    "sort:order": {
      type: String,
      default: null,
      required: !1,
      validator: (t) => Object.values(h).includes(t)
    },
    /**
     * Built dynamically on `disabled:[IconAction]` pattern for all available [IconActions](../../enums/IconAction/Readme.md).
     */
    disabled: {
      // Not implemented, but can be used to disable all actions
      type: Boolean,
      default: !1
    },
    ...Object.values(e).reduce((t, o) => (t[`disabled:${o}`] = {
      type: Boolean,
      default: !1
    }, t), {})
  },
  emits: [
    /**
     * click:IconAction
     */
    ...Object.values(e).map((t) => `click:${t}`)
  ],
  setup(t, { emit: o }) {
    const s = t, m = o, p = O(() => {
      const r = s.mode === "section" ? z : b;
      return s.include.length ? r.filter((l) => s.include.includes(l)) : s.exclude.length ? r.filter((l) => !s.exclude.includes(l)) : r;
    }), d = (r) => {
      m(`click:${r}`);
    }, A = (r) => r === e.SORT ? {
      "sort:order": s["sort:order"]
    } : {};
    return (r, l) => (f(), u("div", E, [
      a(r.$slots, "search-bar", i(c({ size: t.size })), void 0, !0),
      a(r.$slots, "default", i(c({ size: t.size })), void 0, !0),
      (f(!0), u(S, null, D(p.value, (n) => a(r.$slots, n, i(c({ action: n, size: t.size, onClick: () => d(n) })), () => [
        k(C, v(A(n), {
          action: n,
          disabled: s[`disabled:${y($)(n)}`]
        }, {
          onClick: (_) => d(n)
        }), null, 16, ["action", "disabled", "onClick"])
      ], !0)), 256))
    ]));
  }
}, T = /* @__PURE__ */ g(L, [["__scopeId", "data-v-affcbbbe"]]);
export {
  T as default
};
