"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),V=require("@ant-design/icons-vue/LoadingOutlined"),$=require("../_util/classNames.js"),j=require("../_util/props-util/index.js"),x=require("../_util/props-util/initDefaultProps.js"),q=require("../_util/type.js"),c=require("../_util/vue-types/index.js"),L=require("../config-provider/hooks/useConfigInject.js"),M=require("./TimelineItem.js"),A=require("./style/index.js"),C=()=>({prefixCls:String,pending:c.default.any,pendingDot:c.default.any,reverse:q.booleanType(),mode:c.default.oneOf(q.tuple("left","alternate","right",""))}),E=r.defineComponent({compatConfig:{MODE:3},name:"ATimeline",inheritAttrs:!1,props:x.default(C(),{reverse:!1,mode:""}),slots:Object,setup(i,{slots:o,attrs:f}){const{prefixCls:e,direction:b}=L.default("timeline",i),[y,I]=A.default(e),N=(t,s)=>{const n=t.props||{};return i.mode==="alternate"?n.position==="right"?`${e.value}-item-right`:n.position==="left"?`${e.value}-item-left`:s%2===0?`${e.value}-item-left`:`${e.value}-item-right`:i.mode==="left"?`${e.value}-item-left`:i.mode==="right"?`${e.value}-item-right`:n.position==="right"?`${e.value}-item-right`:""};return()=>{const{pending:t=o.pending?.(),pendingDot:s=o.pendingDot?.(),reverse:n,mode:m}=i,P=typeof t=="boolean"?null:t,u=j.filterEmpty(o.default?.()),p=t?r.createVNode(M.default,{pending:!!t,dot:s||r.createVNode(V,null,null)},{default:()=>[P]}):null;p&&u.push(p);const a=n?u.reverse():u,g=a.length,v=`${e.value}-item-last`,S=a.map((l,d)=>{const O=d===g-2?v:"",T=d===g-1?v:"";return r.cloneVNode(l,{class:$.default([!n&&t?O:T,N(l,d)])})}),h=a.some(l=>!!(l.props?.label||l.children?.label)),D=$.default(e.value,{[`${e.value}-pending`]:!!t,[`${e.value}-reverse`]:!!n,[`${e.value}-${m}`]:!!m&&!h,[`${e.value}-label`]:h,[`${e.value}-rtl`]:b.value==="rtl"},f.class,I.value);return y(r.createVNode("ul",{...f,class:D},[S]))}}});exports.default=E;exports.timelineProps=C;
