'use strict';

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

var vue = require('vue');
require('../../../utils/index.cjs');
var useConfigInject = require('../../config-provider/src/hooks/useConfigInject.cjs');
var props = require('./props.cjs');
var initDefaultProps = require('../../../utils/vue/initDefaultProps.cjs');

var ATimelineItem = /* @__PURE__ */ vue.defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "ATimelineItem",
  props: initDefaultProps.initDefaultProps(props.timelineItemProps(), {
    color: "blue",
    pending: false
  }),
  slots: Object,
  setup(props, {
    slots
  }) {
    const {
      prefixCls
    } = useConfigInject.default("timeline", props);
    const itemClassName = vue.computed(() => ({
      [`${prefixCls.value}-item`]: true,
      [`${prefixCls.value}-item-pending`]: props.pending
    }));
    const customColor = vue.computed(() => /blue|red|green|gray/.test(props.color || "") ? void 0 : props.color || "blue");
    const dotClassName = vue.computed(() => ({
      [`${prefixCls.value}-item-head`]: true,
      [`${prefixCls.value}-item-head-${props.color || "blue"}`]: !customColor.value
    }));
    return () => {
      var _a, _b, _c;
      const {
        label = (_a = slots.label) == null ? void 0 : _a.call(slots),
        dot = (_b = slots.dot) == null ? void 0 : _b.call(slots)
      } = props;
      return vue.createVNode("li", {
        "class": itemClassName.value
      }, [label && vue.createVNode("div", {
        "class": `${prefixCls.value}-item-label`
      }, [label]), vue.createVNode("div", {
        "class": `${prefixCls.value}-item-tail`
      }, null), vue.createVNode("div", {
        "class": [dotClassName.value, !!dot && `${prefixCls.value}-item-head-custom`],
        "style": {
          borderColor: customColor.value,
          color: customColor.value
        }
      }, [dot]), vue.createVNode("div", {
        "class": `${prefixCls.value}-item-content`
      }, [(_c = slots.default) == null ? void 0 : _c.call(slots)])]);
    };
  }
});

exports.default = ATimelineItem;
//# sourceMappingURL=TimelineItem.cjs.map
