const e=require("../_util/props-util/initDefaultProps.js"),t=require("../config-provider/hooks/useConfigInject.js"),n=require("./props.js"),r=require("./utils.js"),i=require("./Circle.js"),a=require("./Line.js"),o=require("./Steps.js"),s=require("./style/index.js");let c=require("vue"),l=require("@antsoo-lib/icons");var u=(0,c.defineComponent)({compatConfig:{MODE:3},name:`AProgress`,inheritAttrs:!1,props:e.default(n.progressProps(),{type:`line`,percent:0,showInfo:!0,trailColor:null,size:`default`,strokeLinecap:`round`}),slots:Object,setup(e,{slots:u,attrs:d}){let{prefixCls:f,direction:p}=t.default(`progress`,e),[m,h]=s.default(f),g=(0,c.computed)(()=>Array.isArray(e.strokeColor)?e.strokeColor[0]:e.strokeColor),_=(0,c.computed)(()=>{let{percent:t=0}=e,n=r.getSuccessPercent(e);return Number.parseInt(n===void 0?t.toString():n.toString(),10)}),v=(0,c.computed)(()=>{let{status:t}=e;return!n.progressStatuses.includes(t)&&_.value>=100?`success`:t||`normal`}),y=(0,c.computed)(()=>{let{type:t,showInfo:n,size:i}=e,a=f.value;return{[a]:!0,[`${a}-inline-circle`]:t===`circle`&&r.getSize(i,`circle`).width<=20,[`${a}-${t===`dashboard`&&`circle`||t}`]:!0,[`${a}-status-${v.value}`]:!0,[`${a}-show-info`]:n,[`${a}-${i}`]:i,[`${a}-rtl`]:p.value===`rtl`,[h.value]:!0}}),b=(0,c.computed)(()=>typeof e.strokeColor==`string`||Array.isArray(e.strokeColor)?e.strokeColor:void 0),x=()=>{let{showInfo:t,format:n,type:i,percent:a,title:o}=e,s=r.getSuccessPercent(e);if(!t)return null;let d,p=n||u?.format||(e=>`${e}%`),m=i===`line`;return n||u?.format||v.value!==`exception`&&v.value!==`success`?d=p(r.validProgress(a),r.validProgress(s)):v.value===`exception`?d=m?(0,c.createVNode)(l.CloseCircleFilled,null,null):(0,c.createVNode)(l.CloseOutlined,null,null):v.value===`success`&&(d=m?(0,c.createVNode)(l.CheckCircleFilled,null,null):(0,c.createVNode)(l.CheckOutlined,null,null)),(0,c.createVNode)(`span`,{class:`${f.value}-text`,title:o===void 0&&typeof d==`string`?d:void 0},[d])};return()=>{let{type:t,steps:n,title:r}=e,{class:s,...l}=d,u=x(),h;return t===`line`?h=n?(0,c.createVNode)(o.default,{...e,strokeColor:b.value,prefixCls:f.value,steps:n},{default:()=>[u]}):(0,c.createVNode)(a.default,{...e,strokeColor:g.value,prefixCls:f.value,direction:p.value},{default:()=>[u]}):(t===`circle`||t===`dashboard`)&&(h=(0,c.createVNode)(i.default,{...e,prefixCls:f.value,strokeColor:g.value,progressStatus:v.value},{default:()=>[u]})),m((0,c.createVNode)(`div`,{role:`progressbar`,...l,class:[y.value,s],title:r},[h]))}}});exports.default=u;