'use strict';

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

var vue = require('vue');
require('../../../utils/index.cjs');
var LocaleReceiver = require('../../locale-provider/src/LocaleReceiver.cjs');
require('../../config-provider/src/context/index.cjs');
var index = require('../style/index.cjs');
var DefaultEmptyImg = require('./DefaultEmptyImg.cjs');
var SimpleEmptyImg = require('./SimpleEmptyImg.cjs');
var props = require('./props.cjs');
var context = require('../../config-provider/src/context/context.cjs');
var _class = require('../../../utils/dom/class.cjs');
var props$1 = require('../../../utils/vue/props.cjs');

const defaultEmptyImg = vue.createVNode(DefaultEmptyImg.default, null, null);
const simpleEmptyImg = vue.createVNode(SimpleEmptyImg.default, null, null);
var AEmpty = /* @__PURE__ */ vue.defineComponent({
  name: "AEmpty",
  compatConfig: {
    MODE: 3
  },
  inheritAttrs: false,
  props: props.emptyProps(),
  PRESENTED_IMAGE_DEFAULT: defaultEmptyImg,
  PRESENTED_IMAGE_SIMPLE: simpleEmptyImg,
  setup(props, {
    slots = {},
    attrs
  }) {
    const configProvider = vue.inject(context.configProviderKey, context.defaultConfigProvider);
    const prefixClsRef = vue.computed(() => configProvider.getPrefixCls("empty", props.prefixCls));
    const direction = vue.computed(() => {
      var _a;
      return (_a = configProvider.direction) == null ? void 0 : _a.value;
    });
    const [wrapSSR, hashId] = index.default(prefixClsRef);
    return () => {
      var _a, _b;
      const prefixCls = prefixClsRef.value;
      const {
        image = ((_a = slots.image) == null ? void 0 : _a.call(slots)) || defaultEmptyImg,
        description = ((_b = slots.description) == null ? void 0 : _b.call(slots)) || void 0,
        imageStyle,
        class: className = "",
        ...restProps
      } = {
        ...props,
        ...attrs
      };
      return wrapSSR(vue.createVNode(LocaleReceiver.default, {
        "componentName": "Empty",
        "children": (locale) => {
          const des = typeof description !== "undefined" ? description : locale.description;
          const alt = typeof des === "string" ? des : "empty";
          let imageNode = null;
          if (typeof image === "string")
            imageNode = vue.createVNode("img", {
              "alt": alt,
              "src": image
            }, null);
          else
            imageNode = image;
          return vue.createVNode("div", {
            "class": _class.classNames(prefixCls, className, hashId.value, {
              [`${prefixCls}-normal`]: image === simpleEmptyImg,
              [`${prefixCls}-rtl`]: direction.value === "rtl"
            }),
            ...restProps
          }, [vue.createVNode("div", {
            "class": `${prefixCls}-image`,
            "style": imageStyle
          }, [imageNode]), des && vue.createVNode("p", {
            "class": `${prefixCls}-description`
          }, [des]), slots.default && vue.createVNode("div", {
            "class": `${prefixCls}-footer`
          }, [props$1.filterEmpty(slots.default())])]);
        }
      }, null));
    };
  }
});

exports.default = AEmpty;
//# sourceMappingURL=Empty.cjs.map
