'use strict';

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

var vue = require('vue');
var iconsVue = require('@ant-design/icons-vue');
require('../../../utils/index.cjs');
var Notice = require('../../../vue-components/vc-notification/src/Notice.cjs');
var useConfigInject = require('../../config-provider/src/hooks/useConfigInject.cjs');
var index = require('../style/index.cjs');
var util = require('../../../utils/vue/util.cjs');
var _class = require('../../../utils/dom/class.cjs');

function getCloseIcon(prefixCls, closeIcon) {
  return closeIcon || vue.createVNode("span", {
    "class": `${prefixCls}-close-x`
  }, [vue.createVNode(iconsVue.CloseOutlined, {
    "class": `${prefixCls}-close-icon`
  }, null)]);
}
const TypeIcon = {
  info: vue.createVNode(iconsVue.InfoCircleFilled, null, null),
  success: vue.createVNode(iconsVue.CheckCircleFilled, null, null),
  error: vue.createVNode(iconsVue.CloseCircleFilled, null, null),
  warning: vue.createVNode(iconsVue.ExclamationCircleFilled, null, null),
  loading: vue.createVNode(iconsVue.LoadingOutlined, null, null)
};
const typeToIcon = {
  success: iconsVue.CheckCircleFilled,
  info: iconsVue.InfoCircleFilled,
  error: iconsVue.CloseCircleFilled,
  warning: iconsVue.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": _class.classNames({
      [`${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, {
        ...props,
        "prefixCls": prefixCls.value,
        "class": _class.classNames(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.cjs.map
