import{o as e}from"./request-DWqS4XYU.js";import{$n as t,Cr as n,Ct as r,Hn as i,Nn as a,Ot as o,Pr as s,Wn as c,_n as l,en as u,hn as d,kt as f,qt as p,wn as m,wt as h}from"./jsx-runtime-Dk2XcqH2.js";import{t as g}from"./tooltip-Up9y7xD6.js";import{t as _}from"./CheckCircleFilled-DlIVY69t.js";import{t as v}from"./CloseCircleFilled-CDRAZ4fZ.js";import{r as y}from"./PlusOutlined-B7_Swmw6.js";import{h as b}from"./style-DRVsp3wL.js";var x=e(s()),S={percent:0,prefixCls:`rc-progress`,strokeColor:`#2db7f5`,strokeLinecap:`round`,strokeWidth:1,railColor:`#D9D9D9`,railWidth:1,gapPosition:`bottom`,loading:!1},C=()=>{let e=(0,x.useRef)([]),t=(0,x.useRef)(null);return(0,x.useEffect)(()=>{let n=Date.now(),r=!1;e.current.forEach(e=>{if(!e)return;r=!0;let i=e.style;i.transitionDuration=`.3s, .3s, .3s, .06s`,t.current&&n-t.current<100&&(i.transitionDuration=`0s, 0s`)}),r&&(t.current=Date.now())}),e.current},w=({bg:e,children:t})=>x.createElement(`div`,{style:{width:`100%`,height:`100%`,background:e}},t);function T(e,t){return Object.keys(e).map(n=>{let r=`${Math.floor(parseFloat(n)*t)}%`;return`${e[n]} ${r}`})}var E=x.forwardRef((e,t)=>{let{prefixCls:n,color:r,gradientId:i,radius:a,className:o,style:s,ptg:l,strokeLinecap:u,strokeWidth:d,size:f,gapDegree:p}=e,m=r&&typeof r==`object`,h=m?`#FFF`:void 0,g=f/2,_=x.createElement(`circle`,{className:c(`${n}-circle-path`,o),r:a,cx:g,cy:g,stroke:h,strokeLinecap:u,strokeWidth:d,opacity:l===0?0:1,style:s,ref:t});if(!m)return _;let v=`${i}-conic`,y=p?`${180+p/2}deg`:`0deg`,b=T(r,(360-p)/360),S=T(r,1),C=`conic-gradient(from ${y}, ${b.join(`, `)})`,E=`linear-gradient(to ${p?`bottom`:`top`}, ${S.join(`, `)})`;return x.createElement(x.Fragment,null,x.createElement(`mask`,{id:v},_),x.createElement(`foreignObject`,{x:0,y:0,width:f,height:f,mask:`url(#${v})`},x.createElement(w,{bg:E},x.createElement(w,{bg:C}))))}),D=(e,t,n,r,i,a,o,s,c,l,u=0)=>{let d=n/100*360*((360-a)/360),f=a===0?0:{bottom:0,top:180,left:90,right:-90}[o],p=(100-r)/100*t;return c===`round`&&r!==100&&(p+=l/2,p>=t&&(p=t-.01)),{stroke:typeof s==`string`?s:void 0,strokeDasharray:`${t}px ${e}`,strokeDashoffset:p+u,transform:`rotate(${i+d+f}deg)`,transformOrigin:`50px 50px`,transition:`stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s`,fillOpacity:0}},O=(({id:e,loading:t})=>{if(!t)return{indeterminateStyleProps:{},indeterminateStyleAnimation:null};let n=`${e}-indeterminate-animate`;return{indeterminateStyleProps:{transform:`rotate(0deg)`,animation:`${n} 1s linear infinite`},indeterminateStyleAnimation:x.createElement(`style`,null,`@keyframes ${n} { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }`)}});function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{id:t,prefixCls:r,classNames:i={},styles:a={},steps:o,strokeWidth:s,railWidth:l,gapDegree:u=0,gapPosition:d,railColor:f,strokeLinecap:p,style:m,className:h,strokeColor:g,percent:_,loading:v,...y}={...S,...e},b=n(t),w=`${b}-gradient`,T=50-s/2,j=Math.PI*2*T,M=u>0?90+u/2:-90,N=j*((360-u)/360),{count:P,gap:F}=typeof o==`object`?o:{count:o,gap:2},I=A(_),L=A(g),R=L.find(e=>e&&typeof e==`object`),z=R&&typeof R==`object`?`butt`:p,{indeterminateStyleProps:B,indeterminateStyleAnimation:V}=O({id:b,loading:v}),H=D(j,N,0,100,M,u,d,f,z,s),U=C(),W=()=>{let e=0;return I.map((t,n)=>{let o=L[n]||L[L.length-1],c=D(j,N,e,t,M,u,d,o,z,s);return e+=t,x.createElement(E,{key:n,color:o,ptg:t,radius:T,prefixCls:r,gradientId:w,className:i.track,style:{...c,...B,...a.track},strokeLinecap:z,strokeWidth:s,gapDegree:u,ref:e=>{U[n]=e},size:100})}).reverse()},G=()=>{let e=Math.round(P*(I[0]/100)),t=100/P,n=0;return Array(P).fill(null).map((o,l)=>{let p=l<=e-1?L[0]:f,m=p&&typeof p==`object`?`url(#${w})`:void 0,h=D(j,N,n,t,M,u,d,p,`butt`,s,F);return n+=(N-h.strokeDashoffset+F)*100/N,x.createElement(`circle`,{key:l,className:c(`${r}-circle-path`,i.track),r:T,cx:50,cy:50,stroke:m,strokeWidth:s,opacity:1,style:{...h,...a.track},ref:e=>{U[l]=e}})})};return x.createElement(`svg`,k({className:c(`${r}-circle`,i.root,h),viewBox:`0 0 100 100`,style:{...a.root,...m},id:t,role:`presentation`},y),!P&&x.createElement(`circle`,{className:c(`${r}-circle-rail`,i.rail),r:T,cx:50,cy:50,stroke:f,strokeLinecap:z,strokeWidth:l||s,style:{...H,...a.rail}}),P?G():W(),V)};function M(e){return!e||e<0?0:e>100?100:e}function N({success:e}){let t;return e&&`percent`in e&&(t=e.percent),t}var P=({percent:e,success:t})=>{let n=M(N({success:t}));return[n,M(M(e)-n)]},F=({success:e={},strokeColor:t})=>{let{strokeColor:n}=e;return[n||d.green,t||null]},I=(e,t,n)=>{let r=-1,i=-1;if(t===`step`){let t=n.steps,a=n.strokeWidth;typeof e==`string`||e===void 0?(r=e===`small`?2:14,i=a??8):o(e)?[r,i]=[e,e]:[r=14,i=8]=Array.isArray(e)?e:[e.width,e.height],r*=t}else if(t===`line`){let t=n?.strokeWidth;typeof e==`string`||e===void 0?i=t||(e===`small`?6:8):o(e)?[r,i]=[e,e]:[r=-1,i=8]=Array.isArray(e)?e:[e.width,e.height]}else(t===`circle`||t===`dashboard`)&&(typeof e==`string`||e===void 0?[r,i]=e===`small`?[60,60]:[120,120]:o(e)?[r,i]=[e,e]:Array.isArray(e)&&(r=e[0]??e[1]??120,i=e[0]??e[1]??120));return[r,i]},L=3,R=e=>L/e*100,z=[`root`,`body`,`indicator`],B=e=>{let{prefixCls:n,classNames:r,styles:a,railColor:o,trailColor:s,strokeLinecap:l=`round`,gapPosition:u,gapPlacement:d,gapDegree:p,width:m=120,type:h,children:_,success:v,size:y=m,steps:b}=e,{direction:S}=i(`progress`),C=o??s,[w,T]=I(y,`circle`),{strokeWidth:E}=e;E===void 0&&(E=Math.max(R(w),6));let D={width:w,height:T,fontSize:w*.15+6},O=x.useMemo(()=>{if(p||p===0)return p;if(h===`dashboard`)return 75},[p,h]),k=P(e),A=x.useMemo(()=>{let e=(d??u)||h===`dashboard`&&`bottom`||void 0,t=S===`rtl`;switch(e){case`start`:return t?`right`:`left`;case`end`:return t?`left`:`right`;default:return e}},[S,d,u,h]),M=f(e.strokeColor),N=F({success:v,strokeColor:e.strokeColor}),L=c(`${n}-body`,{[`${n}-circle-gradient`]:M},r.body),B=x.createElement(j,{steps:b,percent:b?k[1]:k,strokeWidth:E,railWidth:E,strokeColor:b?N[1]:N,strokeLinecap:l,railColor:C,prefixCls:n,gapDegree:O,gapPosition:A,classNames:t(r,z),styles:t(a,z)}),V=w<=20,H=x.createElement(`div`,{className:L,style:{...D,...a.body}},B,!V&&_);return V?x.createElement(g,{title:_},H):H},V=`--progress-line-stroke-color`,H=e=>{let t=e?`100%`:`-100%`;return new a(`antProgress${e?`RTL`:`LTR`}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:`translateX(0) scaleX(1)`,opacity:0}})},U=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:{...u(e),display:`inline-flex`,"&-rtl":{direction:`rtl`},[`${t}-indicator`]:{color:e.colorText,lineHeight:1,whiteSpace:`nowrap`,verticalAlign:`middle`,wordBreak:`normal`,[n]:{fontSize:e.fontSize}},[`&${t}-status-exception`]:{[`${t}-indicator`]:{color:e.colorError}},[`&${t}-status-success`]:{[`${t}-indicator`]:{color:e.colorSuccess}}}}},W=e=>{let{componentCls:t}=e;return{[`${t}-line`]:{position:`relative`,width:`100%`,fontSize:e.fontSize,[`${t}-body`]:{display:`inline-flex`,alignItems:`center`,width:`100%`,gap:e.marginXS},[`${t}-rail`]:{flex:`auto`,background:e.remainingColor,borderRadius:e.lineBorderRadius,position:`relative`,width:`100%`,overflow:`hidden`},[`&${t}-status-active`]:{[`${t}-track:after`]:{content:`""`,position:`absolute`,inset:0,backgroundColor:e.colorBgContainer,borderRadius:`inherit`,opacity:0,animationName:H(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:`infinite`}},[`${t}-track`]:{position:`absolute`,insetInlineStart:0,insetBlock:0,borderRadius:`inherit`,background:e.defaultColor,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,minWidth:`max-content`,display:`flex`,alignItems:`center`,"&-success":{background:e.colorSuccess}},[`&${t}-status-exception`]:{[`${t}-track`]:{background:e.colorError}},[`&${t}-status-success`]:{[`${t}-track`]:{background:e.colorSuccess}},[`${t}-indicator-outer`]:{[`&${t}-indicator-start`]:{order:-1}},[`${t}-body-layout-bottom`]:{flexDirection:`column`,alignItems:`center`,gap:e.marginXXS},[`${t}-indicator${t}-indicator-inner`]:{color:e.colorWhite,paddingInline:e.paddingXXS,width:`100%`,display:`flex`,justifyContent:`center`,[`&${t}-indicator-end`]:{justifyContent:`end`},[`&${t}-indicator-start`]:{justifyContent:`start`},[`&${t}-indicator-bright`]:{color:`rgba(0, 0, 0, 0.45)`}}}}},G=e=>{let{componentCls:t,iconCls:n}=e;return{[`${t}-circle`]:{[`${t}-circle-rail`]:{stroke:e.remainingColor},[`${t}-body:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-body`]:{position:`relative`,lineHeight:1,backgroundColor:`transparent`},[`${t}-indicator`]:{position:`absolute`,insetBlockStart:`50%`,insetInlineStart:0,width:`100%`,margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:`normal`,textAlign:`center`,transform:`translateY(-50%)`,[n]:{fontSize:e.circleIconFontSize}},[`&${t}-status-exception`]:{[`${t}-body:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}}},[`&${t}-status-success`]:{[`${t}-body:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:`bottom`}}}},ee=e=>{let{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:`inline-block`,"&-body":{display:`flex`,flexDirection:`row`,alignItems:`center`,gap:e.progressStepMarginInlineEnd,[`${t}-indicator`]:{marginInlineStart:e.marginXS}},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},K=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-indicator ${n}`]:{fontSize:e.fontSizeSM}}}},te=p(`Progress`,e=>{let t=e.calc(e.marginXXS).div(2).equal(),n=m(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:`2.4s`});return[U(n),W(n),G(n),ee(n),K(n)]},e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:`1em`,circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`})),ne=e=>{let t=[];return Object.keys(e).forEach(n=>{let r=Number.parseFloat(n.replace(/%/g,``));Number.isNaN(r)||t.push({key:r,value:e[n]})}),t=t.sort((e,t)=>e.key-t.key),t.map(({key:e,value:t})=>`${t} ${e}%`).join(`, `)},re=(e,t)=>{let{from:n=d.blue,to:r=d.blue,direction:i=t===`rtl`?`to left`:`to right`,...a}=e;if(Object.keys(a).length!==0){let e=`linear-gradient(${i}, ${ne(a)})`;return{background:e,[V]:e}}let o=`linear-gradient(${i}, ${n}, ${r})`;return{background:o,[V]:o}},ie=e=>{let{prefixCls:t,classNames:n,styles:r,direction:i,percent:a,size:o,strokeWidth:s,strokeColor:l,strokeLinecap:u=`round`,children:d,railColor:f,trailColor:p,percentPosition:m,success:h}=e,{align:g,type:_}=m,v=f??p,y=u===`square`||u===`butt`?0:void 0,[b,S]=I(o??[-1,s||(o===`small`?6:8)],`line`,{strokeWidth:s}),C={backgroundColor:v||void 0,borderRadius:y,height:S},w=`${t}-track`,T=l&&typeof l!=`string`?re(l,i):{[V]:l,background:l},E={width:`${M(a)}%`,height:S,borderRadius:y,...T},D=N(e),O={width:`${M(D)}%`,height:S,borderRadius:y,backgroundColor:h?.strokeColor};return x.createElement(`div`,{className:c(`${t}-body`,n.body,{[`${t}-body-layout-bottom`]:g===`center`&&_===`outer`}),style:{width:b>0?b:`100%`,...r.body}},x.createElement(`div`,{className:c(`${t}-rail`,n.rail),style:{...C,...r.rail}},x.createElement(`div`,{className:c(w,n.track),style:{...E,...r.track}},_===`inner`&&d),D!==void 0&&x.createElement(`div`,{className:c(w,`${w}-success`,n.track),style:{...O,...r.track}})),_===`outer`&&d)},ae=e=>{let{classNames:t,styles:n,size:r,steps:i,rounding:a=Math.round,percent:o=0,strokeWidth:s=8,strokeColor:l,railColor:u,trailColor:d,prefixCls:f,children:p}=e,m=a(o/100*i),[h,g]=I(r??[r===`small`?2:14,s],`step`,{steps:i,strokeWidth:s}),_=h/i,v=Array.from({length:i}),y=u??d;for(let e=0;e{let{prefixCls:a,className:o,rootClassName:s,classNames:u,styles:d,steps:p,strokeColor:m,percent:g=0,size:S=`medium`,showInfo:C=!0,type:w=`line`,status:T,format:E,style:D,percentPosition:O={},...k}=e,{align:A=`end`,type:j=`outer`}=O,P=Array.isArray(m)?m[0]:m,F=typeof m==`string`||Array.isArray(m)?m:void 0,L=x.useMemo(()=>{if(P){let e=typeof P==`string`?P:Object.values(P)[0];return new l(e).isLight()}return!1},[m]),R=x.useMemo(()=>{let t=N(e);return Number.parseInt(t===void 0?(g??0)?.toString():(t??0)?.toString(),10)},[g,e.success]),z=x.useMemo(()=>!oe.includes(T)&&R>=100?`success`:T||`normal`,[T,R]),{getPrefixCls:V,direction:H,className:U,style:W,classNames:G,styles:ee}=i(`progress`),K=V(`progress`,a),[ne,re]=te(K),se={...e,percent:g,type:w,size:S,showInfo:C,percentPosition:O},ce=h(W),le=h(D),[q,J]=r([G,u],[ee,ce,d,le],{props:se}),Y=w===`line`,X=Y&&!p,Z=x.useMemo(()=>{if(!C)return null;let t=N(e),n,r=E||(e=>`${e}%`),i=Y&&L&&j===`inner`;return j===`inner`||E||z!==`exception`&&z!==`success`?n=r(M(g),M(t)):z===`exception`?n=Y?x.createElement(v,null):x.createElement(y,null):z===`success`&&(n=Y?x.createElement(_,null):x.createElement(b,null)),x.createElement(`span`,{className:c(`${K}-indicator`,{[`${K}-indicator-bright`]:i,[`${K}-indicator-${A}`]:X,[`${K}-indicator-${j}`]:X},q.indicator),style:J.indicator,title:typeof n==`string`?n:void 0},n)},[C,g,R,z,w,K,E,Y,L,j,A,X,q.indicator,J.indicator]),Q={...e,classNames:q,styles:J},$;w===`line`?$=p?x.createElement(ae,{...Q,strokeColor:F,prefixCls:K,steps:f(p)?p.count:p},Z):x.createElement(ie,{...Q,strokeColor:P,prefixCls:K,direction:H,percentPosition:{align:A,type:j}},Z):(w===`circle`||w===`dashboard`)&&($=x.createElement(B,{...Q,strokeColor:P,prefixCls:K,progressStatus:z},Z));let ue=c(K,`${K}-status-${z}`,{[`${K}-${w===`dashboard`&&`circle`||w}`]:w!==`line`,[`${K}-inline-circle`]:w===`circle`&&I(S,`circle`)[0]<=20,[`${K}-line`]:X,[`${K}-line-align-${A}`]:X,[`${K}-line-position-${j}`]:X,[`${K}-steps`]:p,[`${K}-show-info`]:C,[`${K}-small`]:S===`small`,[`${K}-rtl`]:H===`rtl`},U,o,s,q.root,ne,re);return x.createElement(`div`,{ref:n,style:J.root,className:ue,role:`progressbar`,"aria-valuenow":R,"aria-valuemin":0,"aria-valuemax":100,...t(k,[`railColor`,`trailColor`,`strokeWidth`,`width`,`gapDegree`,`gapPosition`,`gapPlacement`,`strokeLinecap`,`success`])},$)});export{se as t};