'use strict';

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

var vue = require('vue');
var iconsVue = require('@ant-design/icons-vue');
require('../../../utils/index.cjs');
var useConfigInject = require('../../config-provider/src/hooks/useConfigInject.cjs');
var index = require('../../dropdown/index.cjs');
var props = require('./props.cjs');
var props$1 = require('../../../utils/vue/props.cjs');

var ABreadcrumbItem = /* @__PURE__ */ vue.defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "ABreadcrumbItem",
  inheritAttrs: false,
  __ANT_BREADCRUMB_ITEM: true,
  props: props.breadcrumbItemProps(),
  // emits: ['click'],
  slots: Object,
  setup(props, {
    slots,
    attrs,
    emit
  }) {
    const {
      prefixCls
    } = useConfigInject.default("breadcrumb", props);
    const renderBreadcrumbNode = (breadcrumbItem, prefix) => {
      const overlay = props$1.getPropsSlot(slots, props, "overlay");
      if (overlay) {
        return vue.createVNode(index.Dropdown, {
          ...props.dropdownProps,
          "overlay": overlay,
          "placement": "bottom"
        }, {
          default: () => [vue.createVNode("span", {
            "class": `${prefix}-overlay-link`
          }, [breadcrumbItem, vue.createVNode(iconsVue.DownOutlined, null, null)])]
        });
      }
      return breadcrumbItem;
    };
    const handleClick = (e) => {
      emit("click", e);
    };
    return () => {
      var _a;
      const separator = (_a = props$1.getPropsSlot(slots, props, "separator")) != null ? _a : "/";
      const children = props$1.getPropsSlot(slots, props);
      const {
        class: cls,
        style,
        ...restAttrs
      } = attrs;
      let link;
      if (props.href !== void 0) {
        link = vue.createVNode("a", {
          "class": `${prefixCls.value}-link`,
          "onClick": handleClick,
          ...restAttrs
        }, [children]);
      } else {
        link = vue.createVNode("span", {
          "class": `${prefixCls.value}-link`,
          "onClick": handleClick,
          ...restAttrs
        }, [children]);
      }
      link = renderBreadcrumbNode(link, prefixCls.value);
      if (children !== void 0 && children !== null) {
        return vue.createVNode("li", {
          "class": cls,
          "style": style
        }, [link, separator && vue.createVNode("span", {
          "class": `${prefixCls.value}-separator`
        }, [separator])]);
      }
      return null;
    };
  }
});

exports.default = ABreadcrumbItem;
//# sourceMappingURL=BreadcrumbItem.cjs.map
