import{$t as e,Bt as t,Or as n,Sr as r,St as i,Tr as a,Vn as o,cn as s,dn as c,hn as l,lr as u,mn as d,nn as f,wn as p,xr as m,yr as h}from"./jsx-runtime-NwRKtVrk.js";import{n as g,r as _}from"./ExclamationCircleFilled-gmOeErIU.js";import{v}from"./CopyOutlined-bJLUKQgS.js";import{r as y}from"./statusUtils-G17j4Ng-.js";var b=n(a()),x={percent:0,prefixCls:`rc-progress`,strokeColor:`#2db7f5`,strokeLinecap:`round`,strokeWidth:1,railColor:`#D9D9D9`,railWidth:1,gapPosition:`bottom`,loading:!1},S=()=>{let e=(0,b.useRef)([]),t=(0,b.useRef)(null);return(0,b.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},C=({bg:e,children:t})=>b.createElement(`div`,{style:{width:`100%`,height:`100%`,background:e}},t);function w(e,t){return Object.keys(e).map(n=>{let r=`${Math.floor(parseFloat(n)*t)}%`;return`${e[n]} ${r}`})}var T=b.forwardRef((e,t)=>{let{prefixCls:n,color:i,gradientId:a,radius:o,className:s,style:c,ptg:l,strokeLinecap:u,strokeWidth:d,size:f,gapDegree:p}=e,m=i&&typeof i==`object`,h=m?`#FFF`:void 0,g=f/2,_=b.createElement(`circle`,{className:r(`${n}-circle-path`,s),r:o,cx:g,cy:g,stroke:h,strokeLinecap:u,strokeWidth:d,opacity:l===0?0:1,style:c,ref:t});if(!m)return _;let v=`${a}-conic`,y=p?`${180+p/2}deg`:`0deg`,x=w(i,(360-p)/360),S=w(i,1),T=`conic-gradient(from ${y}, ${x.join(`, `)})`,E=`linear-gradient(to ${p?`bottom`:`top`}, ${S.join(`, `)})`;return b.createElement(b.Fragment,null,b.createElement(`mask`,{id:v},_),b.createElement(`foreignObject`,{x:0,y:0,width:f,height:f,mask:`url(#${v})`},b.createElement(C,{bg:E},b.createElement(C,{bg:T}))))}),E=(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}},D=(({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:b.createElement(`style`,null,`@keyframes ${n} { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }`)}});function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{id:t,prefixCls:n,classNames:i={},styles:a={},steps:o,strokeWidth:s,railWidth:c,gapDegree:l=0,gapPosition:d,railColor:f,strokeLinecap:p,style:m,className:h,strokeColor:g,percent:_,loading:v,...y}={...x,...e},C=u(t),w=`${C}-gradient`,A=50-s/2,j=Math.PI*2*A,M=l>0?90+l/2:-90,N=j*((360-l)/360),{count:P,gap:F}=typeof o==`object`?o:{count:o,gap:2},I=k(_),L=k(g),R=L.find(e=>e&&typeof e==`object`),z=R&&typeof R==`object`?`butt`:p,{indeterminateStyleProps:B,indeterminateStyleAnimation:V}=D({id:C,loading:v}),H=E(j,N,0,100,M,l,d,f,z,s),U=S(),W=()=>{let e=0;return I.map((t,r)=>{let o=L[r]||L[L.length-1],c=E(j,N,e,t,M,l,d,o,z,s);return e+=t,b.createElement(T,{key:r,color:o,ptg:t,radius:A,prefixCls:n,gradientId:w,className:i.track,style:{...c,...B,...a.track},strokeLinecap:z,strokeWidth:s,gapDegree:l,ref:e=>{U[r]=e},size:100})}).reverse()},G=()=>{let e=Math.round(P*(I[0]/100)),t=100/P,o=0;return Array(P).fill(null).map((c,u)=>{let p=u<=e-1?L[0]:f,m=p&&typeof p==`object`?`url(#${w})`:void 0,h=E(j,N,o,t,M,l,d,p,`butt`,s,F);return o+=(N-h.strokeDashoffset+F)*100/N,b.createElement(`circle`,{key:u,className:r(`${n}-circle-path`,i.track),r:A,cx:50,cy:50,stroke:m,strokeWidth:s,opacity:1,style:{...h,...a.track},ref:e=>{U[u]=e}})})};return b.createElement(`svg`,O({className:r(`${n}-circle`,i.root,h),viewBox:`0 0 100 100`,style:{...a.root,...m},id:t,role:`presentation`},y),!P&&b.createElement(`circle`,{className:r(`${n}-circle-rail`,i.rail),r:A,cx:50,cy:50,stroke:f,strokeLinecap:z,strokeWidth:c||s,style:{...H,...a.rail}}),P?G():W(),V)};function j(e){return!e||e<0?0:e>100?100:e}function M({success:e}){let t;return e&&`percent`in e&&(t=e.percent),t}var N=({percent:e,success:t})=>{let n=j(M({success:t}));return[n,j(j(e)-n)]},P=({success:e={},strokeColor:t})=>{let{strokeColor:n}=e;return[n||h.green,t||null]},F=(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):d(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):d(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]:d(e)?[r,i]=[e,e]:Array.isArray(e)&&(r=e[0]??e[1]??120,i=e[0]??e[1]??120));return[r,i]},I=3,L=e=>I/e*100,R=[`root`,`body`,`indicator`],z=e=>{let{prefixCls:t,classNames:n,styles:i,railColor:a,trailColor:c,strokeLinecap:u=`round`,gapPosition:d,gapPlacement:f,gapDegree:p,width:m=120,type:h,children:g,success:_,size:v=m,steps:x}=e,{direction:S}=s(`progress`),C=a??c,[w,T]=F(v,`circle`),{strokeWidth:E}=e;E===void 0&&(E=Math.max(L(w),6));let D={width:w,height:T,fontSize:w*.15+6},O=b.useMemo(()=>{if(p||p===0)return p;if(h===`dashboard`)return 75},[p,h]),k=N(e),j=b.useMemo(()=>{let e=(f??d)||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,f,d,h]),M=l(e.strokeColor),I=P({success:_,strokeColor:e.strokeColor}),z=r(`${t}-body`,{[`${t}-circle-gradient`]:M},n.body),B=b.createElement(A,{steps:x,percent:x?k[1]:k,strokeWidth:E,railWidth:E,strokeColor:x?I[1]:I,strokeLinecap:u,railColor:C,prefixCls:t,gapDegree:O,gapPosition:j,classNames:o(n,R),styles:o(i,R)}),V=w<=20,H=b.createElement(`div`,{className:z,style:{...D,...i.body}},B,!V&&g);return V?b.createElement(y,{title:g},H):H},B=`--progress-line-stroke-color`,V=e=>{let t=e?`100%`:`-100%`;return new f(`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}})},H=t=>{let{componentCls:n,iconCls:r}=t;return{[n]:{...e(t),display:`inline-flex`,"&-rtl":{direction:`rtl`},[`${n}-indicator`]:{color:t.colorText,lineHeight:1,whiteSpace:`nowrap`,verticalAlign:`middle`,wordBreak:`normal`,[r]:{fontSize:t.fontSize}},[`&${n}-status-exception`]:{[`${n}-indicator`]:{color:t.colorError}},[`&${n}-status-success`]:{[`${n}-indicator`]:{color:t.colorSuccess}}}}},U=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:V(),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)`}}}}},W=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`}}}},G=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}}}},ee=i(`Progress`,e=>{let n=e.calc(e.marginXXS).div(2).equal(),r=t(e,{progressStepMarginInlineEnd:n,progressStepMinWidth:n,progressActiveMotionDuration:`2.4s`});return[H(r),U(r),W(r),G(r),K(r)]},e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:`1em`,circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`})),te=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(`, `)},ne=(e,t)=>{let{from:n=h.blue,to:r=h.blue,direction:i=t===`rtl`?`to left`:`to right`,...a}=e;if(Object.keys(a).length!==0){let e=`linear-gradient(${i}, ${te(a)})`;return{background:e,[B]:e}}let o=`linear-gradient(${i}, ${n}, ${r})`;return{background:o,[B]:o}},re=e=>{let{prefixCls:t,classNames:n,styles:i,direction:a,percent:o,size:s,strokeWidth:c,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,[x,S]=F(s??[-1,c||(s===`small`?6:8)],`line`,{strokeWidth:c}),C={backgroundColor:v||void 0,borderRadius:y,height:S},w=`${t}-track`,T=l&&typeof l!=`string`?ne(l,a):{[B]:l,background:l},E={width:`${j(o)}%`,height:S,borderRadius:y,...T},D=M(e),O={width:`${j(D)}%`,height:S,borderRadius:y,backgroundColor:h?.strokeColor};return b.createElement(`div`,{className:r(`${t}-body`,n.body,{[`${t}-body-layout-bottom`]:g===`center`&&_===`outer`}),style:{width:x>0?x:`100%`,...i.body}},b.createElement(`div`,{className:r(`${t}-rail`,n.rail),style:{...C,...i.rail}},b.createElement(`div`,{className:r(w,n.track),style:{...E,...i.track}},_===`inner`&&d),D!==void 0&&b.createElement(`div`,{className:r(w,`${w}-success`,n.track),style:{...O,...i.track}})),_===`outer`&&d)},ie=e=>{let{classNames:t,styles:n,size:i,steps:a,rounding:o=Math.round,percent:s=0,strokeWidth:c=8,strokeColor:l,railColor:u,trailColor:d,prefixCls:f,children:p}=e,m=o(s/100*a),[h,g]=F(i??[i===`small`?2:14,c],`step`,{steps:a,strokeWidth:c}),_=h/a,v=Array.from({length:a}),y=u??d;for(let e=0;e{let{prefixCls:n,className:i,rootClassName:a,classNames:u,styles:d,steps:f,strokeColor:h,percent:y=0,size:x=`medium`,showInfo:S=!0,type:C=`line`,status:w,format:T,style:E,percentPosition:D={},...O}=e,{align:k=`end`,type:A=`outer`}=D,N=Array.isArray(h)?h[0]:h,P=typeof h==`string`||Array.isArray(h)?h:void 0,I=b.useMemo(()=>N?new m(typeof N==`string`?N:Object.values(N)[0]).isLight():!1,[h]),L=b.useMemo(()=>{let t=M(e);return Number.parseInt(t===void 0?(y??0)?.toString():(t??0)?.toString(),10)},[y,e.success]),R=b.useMemo(()=>!ae.includes(w)&&L>=100?`success`:w||`normal`,[w,L]),{getPrefixCls:B,direction:V,className:H,style:U,classNames:W,styles:G}=s(`progress`),K=B(`progress`,n),[te,ne]=ee(K),oe={...e,percent:y,type:C,size:x,showInfo:S,percentPosition:D},[q,J]=c([W,u],[G,d],{props:oe}),Y=C===`line`,X=Y&&!f,Z=b.useMemo(()=>{if(!S)return null;let t=M(e),n,i=T||(e=>`${e}%`),a=Y&&I&&A===`inner`;return A===`inner`||T||R!==`exception`&&R!==`success`?n=i(j(y),j(t)):R===`exception`?n=Y?b.createElement(g,null):b.createElement(p,null):R===`success`&&(n=Y?b.createElement(_,null):b.createElement(v,null)),b.createElement(`span`,{className:r(`${K}-indicator`,{[`${K}-indicator-bright`]:a,[`${K}-indicator-${k}`]:X,[`${K}-indicator-${A}`]:X},q.indicator),style:J.indicator,title:typeof n==`string`?n:void 0},n)},[S,y,L,R,C,K,T,Y,I,A,k,X,q.indicator,J.indicator]),Q={...e,classNames:q,styles:J},$;C===`line`?$=f?b.createElement(ie,{...Q,strokeColor:P,prefixCls:K,steps:l(f)?f.count:f},Z):b.createElement(re,{...Q,strokeColor:N,prefixCls:K,direction:V,percentPosition:{align:k,type:A}},Z):(C===`circle`||C===`dashboard`)&&($=b.createElement(z,{...Q,strokeColor:N,prefixCls:K,progressStatus:R},Z));let se=r(K,`${K}-status-${R}`,{[`${K}-${C===`dashboard`&&`circle`||C}`]:C!==`line`,[`${K}-inline-circle`]:C===`circle`&&F(x,`circle`)[0]<=20,[`${K}-line`]:X,[`${K}-line-align-${k}`]:X,[`${K}-line-position-${A}`]:X,[`${K}-steps`]:f,[`${K}-show-info`]:S,[`${K}-small`]:x===`small`,[`${K}-rtl`]:V===`rtl`},H,i,a,q.root,te,ne);return b.createElement(`div`,{ref:t,style:{...U,...J.root,...E},className:se,role:`progressbar`,"aria-valuenow":L,"aria-valuemin":0,"aria-valuemax":100,...o(O,[`railColor`,`trailColor`,`strokeWidth`,`width`,`gapDegree`,`gapPosition`,`gapPlacement`,`strokeLinecap`,`success`])},$)});export{oe as t};