'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var CloseOutlined = require('@ant-design/icons-vue');
var classNames = require('../_util/classNames.js');
var Notice = require('../vc-notification/Notice.js');
require('../hooks/index.js');
var util = require('../_util/util.js');
var index = require('./style/index.js');
var useConfigInject = require('../config-provider/hooks/useConfigInject.js');

function getCloseIcon(prefixCls, closeIcon) {
  return closeIcon || vue.createVNode("span", {
    "class": `${prefixCls}-close-x`
  }, [vue.createVNode(CloseOutlined.CloseOutlined, {
    "class": `${prefixCls}-close-icon`
  }, null)]);
}
const TypeIcon = {
  info: vue.createVNode(CloseOutlined.InfoCircleFilled, null, null),
  success: vue.createVNode(CloseOutlined.CheckCircleFilled, null, null),
  error: vue.createVNode(CloseOutlined.CloseCircleFilled, null, null),
  warning: vue.createVNode(CloseOutlined.ExclamationCircleFilled, null, null),
  loading: vue.createVNode(CloseOutlined.LoadingOutlined, null, null)
};
const typeToIcon = {
  success: CloseOutlined.CheckCircleFilled,
  info: CloseOutlined.InfoCircleFilled,
  error: CloseOutlined.CloseCircleFilled,
  warning: CloseOutlined.ExclamationCircleFilled
};
function PureContent({
  prefixCls,
  icon,
  type,
  message,
  description,
  btn
}) {
  let iconNode = null;
  if (icon) {
    iconNode = vue.createVNode("span", {
      "class": `${prefixCls}-icon`
    }, [util.renderHelper(icon)]);
  } else if (type) {
    const Icon = typeToIcon[type];
    iconNode = vue.createVNode(Icon, {
      "class": `${prefixCls}-icon ${prefixCls}-icon-${type}`
    }, null);
  }
  return vue.createVNode("div", {
    "class": classNames.default({
      [`${prefixCls}-with-icon`]: iconNode
    }),
    "role": "alert"
  }, [iconNode, vue.createVNode("div", {
    "class": `${prefixCls}-message`
  }, [message]), vue.createVNode("div", {
    "class": `${prefixCls}-description`
  }, [description]), btn && vue.createVNode("div", {
    "class": `${prefixCls}-btn`
  }, [btn])]);
}
var PurePanel = /* @__PURE__ */ vue.defineComponent({
  name: "PurePanel",
  inheritAttrs: false,
  props: ["prefixCls", "icon", "type", "message", "description", "btn", "closeIcon"],
  setup(props) {
    const {
      getPrefixCls
    } = useConfigInject.default("notification", props);
    const prefixCls = vue.computed(() => props.prefixCls || getPrefixCls("notification"));
    const noticePrefixCls = vue.computed(() => `${prefixCls.value}-notice`);
    const [, hashId] = index.default(prefixCls);
    return () => {
      return vue.createVNode(Notice.default, vue.mergeProps(props, {
        "prefixCls": prefixCls.value,
        "class": classNames.default(hashId.value, `${noticePrefixCls.value}-pure-panel`),
        "noticeKey": "pure",
        "duration": null,
        "closable": props.closable,
        "closeIcon": getCloseIcon(prefixCls.value, props.closeIcon)
      }), {
        default: () => [vue.createVNode(PureContent, {
          "prefixCls": noticePrefixCls.value,
          "icon": props.icon,
          "type": props.type,
          "message": props.message,
          "description": props.description,
          "btn": props.btn
        }, null)]
      });
    };
  }
});

exports.PureContent = PureContent;
exports.TypeIcon = TypeIcon;
exports.default = PurePanel;
exports.getCloseIcon = getCloseIcon;
//# sourceMappingURL=PurePanel.js.map
