import { defineComponent as k, useSlots as h, createElementBlock as a, openBlock as t, normalizeClass as v, createCommentVNode as u, createElementVNode as r, createBlock as C, toDisplayString as c, unref as m, withCtx as _, renderSlot as x, Fragment as y, renderList as B, createVNode as g, withModifiers as N } from "vue";
/* empty css                       */
import S from "../PlCheckbox/PlCheckboxBase.vue.js";
import $ from "../PlTooltip/PlTooltip.vue.js";
const w = { key: 0 }, E = ["onClick"], M = {
  name: "PlCheckboxGroup"
}, G = /* @__PURE__ */ k({
  ...M,
  props: {
    modelValue: {},
    label: {},
    options: {},
    disabled: { type: Boolean }
  },
  emits: ["update:modelValue"],
  setup(o, { emit: b }) {
    const p = h(), f = b, s = o, d = (l) => s.modelValue.includes(l), i = (l) => {
      const n = s.modelValue ?? [];
      f("update:modelValue", d(l) ? n.filter((e) => e !== l) : [...n, l]);
    };
    return (l, n) => (t(), a("div", {
      class: v(["pl-checkbox-group", { disabled: o.disabled }])
    }, [
      o.label ? (t(), a("label", w, [
        r("span", null, c(o.label), 1),
        m(p).tooltip ? (t(), C(m($), {
          key: 0,
          class: "info",
          position: "top"
        }, {
          tooltip: _(() => [
            x(l.$slots, "tooltip")
          ]),
          _: 3
        })) : u("", !0)
      ])) : u("", !0),
      (t(!0), a(y, null, B(o.options.map((e) => ({ label: "label" in e ? e.label : e.text, value: e.value })), (e, V) => (t(), a("div", { key: V }, [
        g(S, {
          disabled: o.disabled,
          label: e.label,
          "model-value": d(e.value),
          "onUpdate:modelValue": () => i(e.value)
        }, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue"]),
        r("label", {
          onClick: N(() => i(e.value), ["stop"])
        }, c(e.label), 9, E)
      ]))), 128))
    ], 2));
  }
});
export {
  G as default
};
//# sourceMappingURL=PlCheckboxGroup.vue.js.map
