import{booleanType as e,tuple as t}from"../_util/type.mjs";import n from"../_util/classNames.mjs";import r from"../_util/props-util/initDefaultProps.mjs";import{filterEmpty as i}from"../_util/props-util/index.mjs";import a from"../config-provider/hooks/useConfigInject.mjs";import o from"../_util/vue-types/index.mjs";import s from"./TimelineItem.mjs";import c from"./style/index.mjs";import{cloneVNode as l,createVNode as u,defineComponent as d}from"vue";import{LoadingOutlined as f}from"@antsoo-lib/icons";var p=()=>({prefixCls:String,pending:o.any,pendingDot:o.any,reverse:e(),mode:o.oneOf(t(`left`,`alternate`,`right`,``))}),m=d({compatConfig:{MODE:3},name:`ATimeline`,inheritAttrs:!1,props:r(p(),{reverse:!1,mode:``}),slots:Object,setup(e,{slots:t,attrs:r}){let{prefixCls:o,direction:d}=a(`timeline`,e),[p,m]=c(o),h=(t,n)=>{let r=t.props||{};return e.mode===`alternate`?r.position===`right`?`${o.value}-item-right`:r.position===`left`||n%2==0?`${o.value}-item-left`:`${o.value}-item-right`:e.mode===`left`?`${o.value}-item-left`:e.mode===`right`||r.position===`right`?`${o.value}-item-right`:``};return()=>{let{pending:a=t.pending?.(),pendingDot:c=t.pendingDot?.(),reverse:g,mode:_}=e,v=typeof a==`boolean`?null:a,y=i(t.default?.()),b=a?u(s,{pending:!!a,dot:c||u(f,null,null)},{default:()=>[v]}):null;b&&y.push(b);let x=g?y.reverse():y,S=x.length,C=`${o.value}-item-last`,w=x.map((e,t)=>{let r=t===S-2?C:``,i=t===S-1?C:``;return l(e,{class:n([!g&&a?r:i,h(e,t)])})}),T=x.some(e=>!!(e.props?.label||e.children?.label)),E=n(o.value,{[`${o.value}-pending`]:!!a,[`${o.value}-reverse`]:!!g,[`${o.value}-${_}`]:!!_&&!T,[`${o.value}-label`]:T,[`${o.value}-rtl`]:d.value===`rtl`},r.class,m.value);return p(u(`ul`,{...r,class:E},[w]))}}});export{m as default,p as timelineProps};