import { defineComponent, ref, watch, openBlock, createElementBlock, withDirectives, createElementVNode, withModifiers, vShow, normalizeStyle, createVNode, createCommentVNode, toDisplayString, renderSlot } from "vue";
import SvgIcon from "./SvgIcon.vue.mjs";
import ArrowDown from "../icons/ArrowDown.vue.mjs";
const _hoisted_1 = {
  key: 1,
  class: "container-header"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "ActionSheep",
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: ""
    },
    showClose: {
      type: Boolean,
      default: true
    },
    showMask: {
      type: Boolean,
      default: true
    },
    height: {
      type: String,
      default: ""
    }
  },
  emits: ["input"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const show = ref(false);
    watch(
      () => props.visible,
      (val) => show.value = val,
      { immediate: true }
    );
    watch(show, (val) => emit("input", val), { immediate: true });
    const toggleShow = () => show.value = !show.value;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", null, [
        withDirectives(createElementVNode("div", {
          class: "mask",
          onClick: withModifiers(toggleShow, ["stop"])
        }, null, 512), [
          [vShow, show.value && __props.showMask]
        ]),
        withDirectives(createElementVNode("div", {
          class: "container",
          style: normalizeStyle({ height: props.height })
        }, [
          __props.showClose ? (openBlock(), createElementBlock("div", {
            key: 0,
            class: "container-close",
            onClick: toggleShow
          }, [
            createVNode(SvgIcon, { icon: ArrowDown })
          ])) : createCommentVNode("", true),
          __props.title ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
          renderSlot(_ctx.$slots, "default", {}, void 0, true)
        ], 4), [
          [vShow, show.value]
        ])
      ]);
    };
  }
});
export {
  _sfc_main as default
};
