import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import { vShow as _vShow, createVNode as _createVNode, withDirectives as _withDirectives } from "vue";
import _extends from "@babel/runtime/helpers/esm/extends";
import { Transition } from 'vue';
import { getMotion } from '../utils/motionUtil';
import { getTransitionProps } from '../../_util/transition';
export default function Mask(props) {
  const {
    prefixCls,
    zIndex,
    mask,
    maskAnimation,
    maskTransitionName,
    onClick,
    visible,
    maskStyle = {}
  } = props;
  if (!mask) {
    return null;
  }
  let transitionProps = {};
  if (maskTransitionName || maskAnimation) {
    const motion = getMotion({
      prefixCls,
      transitionName: maskTransitionName,
      animation: maskAnimation
    });
    transitionProps = getTransitionProps(motion.name);
  }
  return _createVNode(Transition, _objectSpread({
    "appear": true
  }, transitionProps), {
    default: () => [_withDirectives(_createVNode("div", {
      "style": _extends({
        zIndex
      }, maskStyle),
      "class": `${prefixCls}-mask`,
      "onClick": onClick
    }, null), [[_vShow, visible]])]
  });
}
Mask.displayName = 'Mask';