import{presetPrimaryColors as u}from"@ant-design/colors";import d from"../vc-util/devWarning.mjs";function l(e){return!e||e<0?0:e>100?100:e}function i({success:e,successPercent:n}){let r=n;return e&&"progress"in e&&(d(!1,"Progress","`success.progress` is deprecated. Please use `success.percent` instead."),r=e.progress),e&&"percent"in e&&(r=e.percent),r}function g({percent:e,success:n,successPercent:r}){const t=l(i({success:n,successPercent:r}));return[t,l(l(e)-t)]}function a({success:e={},strokeColor:n}){const{strokeColor:r}=e;return[r||u.green,n||null]}const m=(e,n,r)=>{let t=-1,o=-1;if(n==="step"){const f=r.steps,c=r.strokeWidth;typeof e=="string"||typeof e>"u"?(t=e==="small"?2:14,o=c??8):typeof e=="number"?[t,o]=[e,e]:[t=14,o=8]=e,t*=f}else if(n==="line"){const f=r?.strokeWidth;typeof e=="string"||typeof e>"u"?o=f||(e==="small"?6:8):typeof e=="number"?[t,o]=[e,e]:[t=-1,o=8]=e}else(n==="circle"||n==="dashboard")&&(typeof e=="string"||typeof e>"u"?[t,o]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[t,o]=[e,e]:(t=e[0]??e[1]??120,o=e[0]??e[1]??120));return{width:t,height:o}};export{g as getPercentage,m as getSize,a as getStrokeColor,i as getSuccessPercent,l as validProgress};
