"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const event = require("../../../constants/event.js");
const index = require("../../../hooks/use-namespace/index.js");
const checkTag = require("./check-tag.js");
const vue = require("vue");
var check_tag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ vue.defineComponent({
  name: "ElCheckTag",
  __name: "check-tag",
  props: checkTag.checkTagProps,
  emits: checkTag.checkTagEmits,
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const ns = index.useNamespace("check-tag");
    const containerKls = vue.computed(() => [
      ns.b(),
      ns.is("checked", props.checked),
      ns.is("disabled", props.disabled),
      ns.m(props.type || "primary")
    ]);
    const handleChange = () => {
      if (props.disabled) return;
      const checked = !props.checked;
      emit(event.CHANGE_EVENT, checked);
      emit("update:checked", checked);
    };
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createElementBlock("span", {
        class: vue.normalizeClass(containerKls.value),
        onClick: handleChange
      }, [vue.renderSlot(_ctx.$slots, "default")], 2);
    };
  }
});
exports.default = check_tag_vue_vue_type_script_setup_true_lang_default;
