import{functionType as e,stringType as t}from"../_util/type.mjs";import n from"../_util/classNames.mjs";import{filterEmpty as r}from"../_util/props-util/index.mjs";import i from"../_util/vue-types/index.mjs";import{cloneElement as a}from"../_util/vnode.mjs";import o from"./Step.mjs";import{createVNode as s,defineComponent as c}from"vue";var l=c({compatConfig:{MODE:3},name:`Steps`,props:{type:i.string.def(`default`),prefixCls:i.string.def(`vc-steps`),iconPrefix:i.string.def(`vc`),direction:i.string.def(`horizontal`),labelPlacement:i.string.def(`horizontal`),status:t(`process`),size:i.string.def(``),progressDot:i.oneOfType([i.looseBool,i.func]).def(void 0),initial:i.number.def(0),current:i.number.def(0),items:i.array.def(()=>[]),icons:i.shape({finish:i.any,error:i.any}).loose,stepIcon:e(),isInline:i.looseBool,itemRender:e()},emits:[`change`],setup(e,{slots:t,emit:i}){let c=t=>{let{current:n}=e;n!==t&&i(`change`,t)},l=(n,r,i)=>{let{prefixCls:a,iconPrefix:l,status:u,current:d,initial:f,icons:p,stepIcon:m=t.stepIcon,isInline:h,itemRender:g,progressDot:_=t.progressDot}=e,v=h||_,y={...n,class:``},b=f+r,x={active:b===d,stepNumber:b+1,stepIndex:b,key:b,prefixCls:a,iconPrefix:l,progressDot:v,stepIcon:m,icons:p,onStepClick:c};return u===`error`&&r===d-1&&(y.class=`${a}-next-error`),y.status||(b===d?y.status=u:b<d?y.status=`finish`:y.status=`wait`),h&&(y.icon=void 0,y.subTitle=void 0),i?i({...y,...x}):(g&&(y.itemRender=e=>g(y,e)),s(o,{...y,...x,__legacy:!1},null))},u=(e,t)=>l({...e.props},t,t=>a(e,t));return()=>{let{prefixCls:i,direction:a,type:o,labelPlacement:c,iconPrefix:d,status:f,size:p,current:m,progressDot:h=t.progressDot,initial:g,icons:_,items:v,isInline:y,itemRender:b,...x}=e,S=o===`navigation`,C=y||h,w=y?`horizontal`:a,T=y?void 0:p,E=C?`vertical`:c;return s(`div`,{class:n(i,`${i}-${a}`,{[`${i}-${T}`]:T,[`${i}-label-${E}`]:w===`horizontal`,[`${i}-dot`]:!!C,[`${i}-navigation`]:S,[`${i}-inline`]:y}),...x},[v.filter(e=>e).map((e,t)=>l(e,t)),r(t.default?.()).map(u)])}}});export{l as default};