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