You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/38703.async.js

1 line
14 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[38703],{38703:function(e,t,r){r.d(t,{Z:function(){return te}});var o=r(67294),n=r(23526),s=r(60068),i=r(30186),c=r(85846),a=r(94184),l=r.n(a),u=r(10366),d=r(53124),p=r(87462),g=r(1413),m=r(45987),f={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},h=function(){var e=(0,o.useRef)([]),t=(0,o.useRef)(null);return(0,o.useEffect)((function(){var r=Date.now(),o=!1;e.current.forEach((function(e){if(e){o=!0;var n=e.style;n.transitionDuration=".3s, .3s, .3s, .06s",t.current&&r-t.current<100&&(n.transitionDuration="0s, 0s")}})),o&&(t.current=Date.now())})),e.current};var b=r(71002),k=r(97685),y=r(98924),v=0,$=(0,y.Z)();var C=function(e){var t=o.useState(),r=(0,k.Z)(t,2),n=r[0],s=r[1];return o.useEffect((function(){var e;s("rc_progress_".concat(($?(e=v,v+=1):e="TEST_OR_SSR",e)))}),[]),e||n},x=function(e){var t=e.bg,r=e.children;return o.createElement("div",{style:{width:"100%",height:"100%",background:t}},r)};function S(e,t){return Object.keys(e).map((function(r){var o=parseFloat(r),n="".concat(Math.floor(o*t),"%");return"".concat(e[r]," ").concat(n)}))}var E=o.forwardRef((function(e,t){var r=e.prefixCls,n=e.color,s=e.gradientId,i=e.radius,c=e.style,a=e.ptg,l=e.strokeLinecap,u=e.strokeWidth,d=e.size,p=e.gapDegree,g=n&&"object"===(0,b.Z)(n),m=g?"#FFF":void 0,f=d/2,h=o.createElement("circle",{className:"".concat(r,"-circle-path"),r:i,cx:f,cy:f,stroke:m,strokeLinecap:l,strokeWidth:u,opacity:0===a?0:1,style:c,ref:t});if(!g)return h;var k="".concat(s,"-conic"),y=p?"".concat(180+p/2,"deg"):"0deg",v=S(n,(360-p)/360),$=S(n,1),C="conic-gradient(from ".concat(y,", ").concat(v.join(", "),")"),E="linear-gradient(to ".concat(p?"bottom":"top",", ").concat($.join(", "),")");return o.createElement(o.Fragment,null,o.createElement("mask",{id:k},h),o.createElement("foreignObject",{x:0,y:0,width:d,height:d,mask:"url(#".concat(k,")")},o.createElement(x,{bg:E},o.createElement(x,{bg:C}))))})),w=100,O=function(e,t,r,o,n,s,i,c,a,l){var u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,d=r/100*360*((360-s)/360),p=0===s?0:{bottom:0,top:180,left:90,right:-90}[i],g=(100-o)/100*t;"round"===a&&100!==o&&(g+=l/2)>=t&&(g=t-.01);var m=50;return{stroke:"string"==typeof c?c:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:g+u,transform:"rotate(".concat(n+d+p,"deg)"),transformOrigin:"".concat(m,"px ").concat(m,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},j=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function W(e){var t=null!=e?e:[];return Array.isArray(t)?t:[t]}var N=function(e){var t,r,n,s=(0,g.Z)((0,g.Z)({},f),e),i=s.id,c=s.prefixCls,a=s.steps,u=s.strokeWidth,d=s.trailWidth,k=s.gapDegree,y=void 0===k?0:k,v=s.gapPosition,$=s.trailColor,x=s.strokeLinecap,S=s.style,N=s.className,P=s.strokeColor,D=s.percent,I=(0,m.Z)(s,j),z=C(i),Z="".concat(z,"-gradient"),A=50-u/2,R=2*Math.PI*A,M=y>0?90+y/2:-90,L=R*((360-y)/360),X="object"===(0,b.Z)(a)?a:{count:a,space:2},F=X.count,T=X.space,B=W(D),_=W(P),H=_.find((function(e){return e&&"object"===(0,b.Z)(e)})),q=H&&"object"===(0,b.Z)(H)?"butt":x,K=O(R,L,0,100,M,y,v,$,q,u),Q=h();return o.createElement("svg",(0,p.Z)({className:l()("".concat(c,"-circle"),N),viewBox:"0 0 ".concat(w," ").concat(w),style:S,id:i,role:"presentation"},I),!F&&o.createElement("circle",{className:"".concat(c,"-circle-trail"),r:A,cx:50,cy:50,stroke:$,strokeLinecap:q,strokeWidth:d||u,style:K}),F?(t=Math.round(F*(B[0]/100)),r=100/F,n=0,new Array(F).fill(null).map((function(e,s){var i=s<=t-1?_[0]:$,a=i&&"object"===(0,b.Z)(i)?"url(#".concat(Z,")"):void 0,l=O(R,L,n,r,M,y,v,i,"butt",u,T);return n+=100*(L-l.strokeDashoffset+T)/L,o.createElement("circle",{key:s,className:"".concat(c,"-circle-path"),r:A,cx:50,cy:50,stroke:a,strokeWidth:u,opacity:1,style:l,ref:function(e){Q[s]=e}})}))):function(){var e=0;return B.map((function(t,r){var n=_[r]||_[_.length-1],s=O(R,L,e,t,M,y,v,n,q,u);return e+=t,o.createElement(E,{key:r,color:n,ptg:t,radius:A,prefixCls:c,gradientId:Z,style:s,strokeLinecap:q,strokeWidth:u,gapDegree:y,ref:function(e){Q[r]=e},size:w})})).reverse()}())},P=r(83062),D=r(16397);function I(e){return!e||e<0?0:e>100?100:e}function z(e){let{success:t,successPercent:r}=e,o=r;return t&&"progress"in t&&(o=t.progress),t&&"percent"in t&&(o=t.percent),o}const Z=e=>{let{percent:t,success:r,successPercent:o}=e;const n=I(z({success:r,successPercent:o}));return[n,I(I(t)-n)]},A=(e,t,r)=>{var o,n,s,i;let c=-1,a=-1;if("step"===t){const t=r.steps,o=r.strokeWidth;"string"==typeof e||void 0===e?(c="small"===e?2:14,a=null!=o?o:8):"number"==typeof e?[c,a]=[e,e]:[c=14,a=8]=e,c*=t}else if("line"===t){const t=null==r?void 0:r.strokeWidth;"string"==typeof e||void 0===e?a=t||("small"===e?6:8):"number"==typeof e?[c,a]=[e,e]:[c=-1,a=8]=e}else"circle"!==t&&"dashboard"!==t||("string"==typeof e||void 0===e?[c,a]="small"===e?[60,60]:[120,120]:"number"==typeof e?[c,a]=[e,e]:(c=null!==(n=null!==(o=e[0])&&void 0!==o?o:e[1])&&void 0!==n?n:120,a=null!==(i=null!==(s=e[0])&&void 0!==s?s:e[1])&&void 0!==i?i:120));return[c,a]};var R=e=>{const{prefixCls:t,trailColor:r=null,strokeLinecap:n="round",gapPosition:s,gapDegree:i,width:c=120,type:a,children:u,success:d,size:p=c}=e,[g,m]=A(p,"circle");let{strokeWidth:f}=e;void 0===f&&(f=Math.max((e=>3/e*100)(g),6));const h={width:g,height:m,fontSize:.15*g+6},b=o.useMemo((()=>i||0===i?i:"dashboard"===a?75:void 0),[i,a]),k=s||"dashboard"===a&&"bottom"||void 0,y="[object Object]"===Object.prototype.toString.call(e.strokeColor),v=(e=>{let{success:t={},strokeColor:r}=e;const{strokeColor:o}=t;return[o||D.presetPrimaryColors.green,r||null]})({success:d,strokeColor:e.strokeColor}),$=l()(`${t}-inner`,{[`${t}-circle-gradient`]:y}),C=o.createElement(N,{percent:Z(e),strokeWidth:f,trailWidth:f,strokeColor:v,strokeLinecap:n,trailColor:r,prefixCls:t,gapDegree:b,gapPosition:k});return o.createElement("div",{className:$,style:h},g<=20?o.createElement(P.Z,{title:u},o.createElement("span",null,C)):o.createElement(o.Fragment,null,C,u))},M=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};const L=(e,t)=>{const{from:r=D.presetPrimaryColors.blue,to:o=D.presetPrimaryColors.blue,direction:n=("rtl"===t?"to left":"to right")}=e,s=M(e,["from","to","direction"]);if(0!==Object.keys(s).length){return{backgroundImage:`linear-gradient(${n}, ${(e=>{let t=[];return Object.keys(e).forEach((r=>{const o=parseFloat(r.replace(/%/g,""));isNaN(o)||t.push({key:o,value:e[r]})})),t=t.sort(((e,t)=>e.key-t.key)),t.map((e=>{let{key:t,value:r}=e;return`${r} ${t}%`})).join(", ")})(s)})`}}return{backgroundImage:`linear-gradient(${n}, ${r}, ${o})`}};var X=e=>{const{prefixCls:t,direction:r,percent:n,size:s,strokeWidth:i,strokeColor:c,strokeLinecap:a="round",children:l,trailColor:u=null,success:d}=e,p=c&&"string"!=typeof c?L(c,r):{backgroundColor:c},g="square"===a||"butt"===a?0:void 0,m={backgroundColor:u||void 0,borderRadius:g},f=null!=s?s:[-1,i||("small"===s?6:8)],[h,b]=A(f,"line",{strokeWidth:i});const k=Object.assign({width:`${I(n)}%`,height:b,borderRadius:g},p),y=z(e),v={width:`${I(y)}%`,height:b,borderRadius:g,backgroundColor:null==d?void 0:d.strokeColor},$={width:h<0?"100%":h,height:b};return o.createElement(o.Fragment,null,o.createElement("div",{className:`${t}-outer`,style:$},o.createElement("div",{className:`${t}-inner`,style:m},o.createElement("div",{className:`${t}-bg`,style:k}),void 0!==y?o.createElement("div",{className:`${t}-success-bg`,style:v}):null)),l)};var F=e=>{const{size:t,steps:r,percent:n=0,strokeWidth:s=8,strokeColor:i,trailColor:c=null,prefixCls:a,children:u}=e,d=Math.round(r*(n/100)),p=null!=t?t:["small"===t?2:14,s],[g,m]=A(p,"step",{steps:r,strokeWidth:s}),f=g/r,h=new Array(r);for(let e=0;e<r;e++){const t=Array.isArray(i)?i[e]:i;h[e]=o.createElement("div",{key:e,className:l()(`${a}-steps-item`,{[`${a}-steps-item-active`]:e<=d-1}),style:{backgroundColor:e<=d-1?t:c,width:f,height:m}})}return o.createElement("div",{className:`${a}-steps-outer`},h,u)},T=r(45930),B=r(14747),_=r(67968),H=r(45503);const q=e=>{const t=e?"100%":"-100%";return new T.Keyframes(`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}})},K=e=>{const{componentCls:t,iconCls:r}=e;return{[t]:Object.assign(Object.assign({},(0,B.Wf)(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize,marginInlineEnd:e.marginXS,marginBottom:e.marginXS},[`${t}-outer`]:{display:"inline-block",width:"100%"},[`&${t}-show-info`]:{[`${t}-outer`]:{marginInlineEnd:`calc(-2em - ${e.marginXS}px)`,paddingInlineEnd:`calc(2em + ${e.paddingXS}px)`}},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",backgroundColor:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",width:"2em",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[r]:{fontSize:e.fontSize}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:q(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:q(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},Q=e=>{const{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.remainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{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%)",[r]:{fontSize:e.fontSize/e.fontSizeSM+"em"}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}},Y=e=>{const{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},G=e=>{const{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${r}`]:{fontSize:e.fontSizeSM}}}};var J=(0,_.Z)("Progress",(e=>{const t=e.marginXXS/2,r=(0,H.TS)(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[K(r),Q(r),Y(r),G(r)]}),(e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em"}))),U=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};const V=["normal","exception","active","success"],ee=o.forwardRef(((e,t)=>{const{prefixCls:r,className:a,rootClassName:p,steps:g,strokeColor:m,percent:f=0,size:h="default",showInfo:b=!0,type:k="line",status:y,format:v,style:$}=e,C=U(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style"]),x=o.useMemo((()=>{var t,r;const o=z(e);return parseInt(void 0!==o?null===(t=null!=o?o:0)||void 0===t?void 0:t.toString():null===(r=null!=f?f:0)||void 0===r?void 0:r.toString(),10)}),[f,e.success,e.successPercent]),S=o.useMemo((()=>!V.includes(y)&&x>=100?"success":y||"normal"),[y,x]),{getPrefixCls:E,direction:w,progress:O}=o.useContext(d.E_),j=E("progress",r),[W,N]=J(j),P=o.useMemo((()=>{if(!b)return null;const t=z(e);let r;const a="line"===k;return v||"exception"!==S&&"success"!==S?r=(v||(e=>`${e}%`))(I(f),I(t)):"exception"===S?r=a?o.createElement(i.Z,null):o.createElement(c.Z,null):"success"===S&&(r=a?o.createElement(n.Z,null):o.createElement(s.Z,null)),o.createElement("span",{className:`${j}-text`,title:"string"==typeof r?r:void 0},r)}),[b,f,x,S,k,j,v]);const D=Array.isArray(m)?m[0]:m,Z="string"==typeof m||Array.isArray(m)?m:void 0;let M;"line"===k?M=g?o.createElement(F,Object.assign({},e,{strokeColor:Z,prefixCls:j,steps:g}),P):o.createElement(X,Object.assign({},e,{strokeColor:D,prefixCls:j,direction:w}),P):"circle"!==k&&"dashboard"!==k||(M=o.createElement(R,Object.assign({},e,{strokeColor:D,prefixCls:j,progressStatus:S}),P));const L=l()(j,`${j}-status-${S}`,`${j}-${("dashboard"===k?"circle":g&&"steps")||k}`,{[`${j}-inline-circle`]:"circle"===k&&A(h,"circle")[0]<=20,[`${j}-show-info`]:b,[`${j}-${h}`]:"string"==typeof h,[`${j}-rtl`]:"rtl"===w},null==O?void 0:O.className,a,p,N);return W(o.createElement("div",Object.assign({ref:t,style:Object.assign(Object.assign({},null==O?void 0:O.style),$),className:L,role:"progressbar","aria-valuenow":x},(0,u.Z)(C,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),M))}));var te=ee}}]);