"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const runtime = require("../../../utils/vue/props/runtime.js");
const vnode = require("../../../utils/vue/vnode.js");
const index = require("../../../hooks/use-namespace/index.js");
const index$1 = require("../../../hooks/use-same-target/index.js");
const Vue = require("vue");
const overlayProps = runtime.buildProps({
  mask: {
    type: Boolean,
    default: true
  },
  customMaskEvent: Boolean,
  overlayClass: { type: runtime.definePropType([
    String,
    Array,
    Object
  ]) },
  zIndex: { type: runtime.definePropType([String, Number]) }
});
const overlayEmits = { click: (evt) => evt instanceof MouseEvent };
const BLOCK = "overlay";
var overlay_default = Vue.defineComponent({
  name: "ElOverlay",
  props: overlayProps,
  emits: overlayEmits,
  setup(props, { slots, emit }) {
    const ns = index.useNamespace(BLOCK);
    const onMaskClick = (e) => {
      emit("click", e);
    };
    const { onClick, onMousedown, onMouseup } = index$1.useSameTarget(props.customMaskEvent ? void 0 : onMaskClick);
    return () => {
      return props.mask ? Vue.createVNode("div", {
        class: [ns.b(), props.overlayClass],
        style: { zIndex: props.zIndex },
        onClick,
        onMousedown,
        onMouseup
      }, [Vue.renderSlot(slots, "default")], vnode.PatchFlags.STYLE | vnode.PatchFlags.CLASS | vnode.PatchFlags.PROPS, [
        "onClick",
        "onMouseup",
        "onMousedown"
      ]) : Vue.h("div", {
        class: props.overlayClass,
        style: {
          zIndex: props.zIndex,
          position: "fixed",
          top: "0px",
          right: "0px",
          bottom: "0px",
          left: "0px"
        }
      }, [Vue.renderSlot(slots, "default")]);
    };
  }
});
exports.default = overlay_default;
exports.overlayEmits = overlayEmits;
exports.overlayProps = overlayProps;
