mirror of
https://github.com/owncast/owncast.git
synced 2025-01-04 15:47:41 +03:00
1 line
No EOL
22 KiB
JavaScript
Vendored
1 line
No EOL
22 KiB
JavaScript
Vendored
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8187],{37182:function(e,t,r){"use strict";var n=r(75263).default,o=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(r(38416)),i=r(92138),s=o(r(94184)),c=r(34744),l=n(r(67294)),u=r(4087);function getPercentage(e){var t=e.percent,r=e.success,n=e.successPercent,o=(0,u.validProgress)((0,u.getSuccessPercent)({success:r,successPercent:n}));return[o,(0,u.validProgress)((0,u.validProgress)(t)-o)]}function getStrokeColor(e){var t=e.success,r=e.strokeColor;return[(void 0===t?{}:t).strokeColor||i.presetPrimaryColors.green,r||null]}t.default=function(e){var t=e.prefixCls,r=e.width,n=e.strokeWidth,o=e.trailColor,i=e.strokeLinecap,u=e.gapPosition,d=e.gapDegree,f=e.type,p=e.children,v=e.success,m=r||120,g=n||6,y="[object Object]"===Object.prototype.toString.call(e.strokeColor),h=getStrokeColor({success:v,strokeColor:e.strokeColor}),b=(0,s.default)("".concat(t,"-inner"),(0,a.default)({},"".concat(t,"-circle-gradient"),y));return l.createElement("div",{className:b,style:{width:m,height:m,fontSize:.15*m+6}},l.createElement(c.Circle,{percent:getPercentage(e),strokeWidth:g,trailWidth:g,strokeColor:h,strokeLinecap:void 0===i?"round":i,trailColor:void 0===o?null:o,prefixCls:t,gapDegree:d||0===d?d:"dashboard"===f?75:void 0,gapPosition:u||"dashboard"===f&&"bottom"||void 0}),p)}},2384:function(e,t,r){"use strict";var n=r(75263).default,o=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.sortGradient=t.handleGradient=t.default=void 0;var a=o(r(10434)),i=r(92138),s=n(r(67294)),c=r(4087),__rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>t.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r},l=t.sortGradient=function(e){var t=[];return Object.keys(e).forEach(function(r){var n=parseFloat(r.replace(/%/g,""));isNaN(n)||t.push({key:n,value:e[r]})}),(t=t.sort(function(e,t){return e.key-t.key})).map(function(e){var t=e.key,r=e.value;return"".concat(r," ").concat(t,"%")}).join(", ")},u=t.handleGradient=function(e,t){var r=e.from,n=void 0===r?i.presetPrimaryColors.blue:r,o=e.to,a=void 0===o?i.presetPrimaryColors.blue:o,s=e.direction,c=void 0===s?"rtl"===t?"to left":"to right":s,u=__rest(e,["from","to","direction"]);if(0!==Object.keys(u).length){var d=l(u);return{backgroundImage:"linear-gradient(".concat(c,", ").concat(d,")")}}return{backgroundImage:"linear-gradient(".concat(c,", ").concat(n,", ").concat(a,")")}};t.default=function(e){var t=e.prefixCls,r=e.direction,n=e.percent,o=e.strokeWidth,i=e.size,l=e.strokeColor,d=e.strokeLinecap,f=void 0===d?"round":d,p=e.children,v=e.trailColor,m=e.success,g=l&&"string"!=typeof l?u(l,r):{background:l},y="square"===f||"butt"===f?0:void 0,h=(0,a.default)({width:"".concat((0,c.validProgress)(n),"%"),height:o||("small"===i?6:8),borderRadius:y},g),b=(0,c.getSuccessPercent)(e),k={width:"".concat((0,c.validProgress)(b),"%"),height:o||("small"===i?6:8),borderRadius:y,backgroundColor:null==m?void 0:m.strokeColor},C=void 0!==b?s.createElement("div",{className:"".concat(t,"-success-bg"),style:k}):null;return s.createElement(s.Fragment,null,s.createElement("div",{className:"".concat(t,"-outer")},s.createElement("div",{className:"".concat(t,"-inner"),style:{backgroundColor:(void 0===v?null:v)||void 0,borderRadius:y}},s.createElement("div",{className:"".concat(t,"-bg"),style:h}),C)),p)}},44428:function(e,t,r){"use strict";var n=r(75263).default,o=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(r(38416)),i=o(r(94184)),s=n(r(67294));t.default=function(e){for(var t=e.size,r=e.steps,n=e.percent,o=e.strokeWidth,c=void 0===o?8:o,l=e.strokeColor,u=e.trailColor,d=void 0===u?null:u,f=e.prefixCls,p=e.children,v=Math.round(r*((void 0===n?0:n)/100)),m="small"===t?2:14,g=Array(r),y=0;y<r;y++){var h=Array.isArray(l)?l[y]:l;g[y]=s.createElement("div",{key:y,className:(0,i.default)("".concat(f,"-steps-item"),(0,a.default)({},"".concat(f,"-steps-item-active"),y<=v-1)),style:{backgroundColor:y<=v-1?h:d,width:m,height:c}})}return s.createElement("div",{className:"".concat(f,"-steps-outer")},g,p)}},74806:function(e,t,r){"use strict";var n=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(7325));t.default=o.default},7325:function(e,t,r){"use strict";var n=r(75263).default,o=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(r(38416)),i=o(r(10434)),s=o(r(37431)),c=o(r(71961)),l=o(r(42547)),u=o(r(40753)),d=o(r(94184)),f=o(r(18475)),p=n(r(67294)),v=r(31929),m=r(66764);o(r(13594));var g=o(r(37182)),y=o(r(2384)),h=o(r(44428)),b=r(4087),__rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>t.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};(0,m.tuple)("line","circle","dashboard");var k=(0,m.tuple)("normal","exception","active","success");t.default=function(e){var t,r=e.prefixCls,n=e.className,o=e.steps,m=e.strokeColor,C=e.percent,E=void 0===C?0:C,P=e.size,x=void 0===P?"default":P,w=e.showInfo,N=void 0===w||w,O=e.type,S=void 0===O?"line":O,j=__rest(e,["prefixCls","className","steps","strokeColor","percent","size","showInfo","type"]);function getPercentNumber(){var t=(0,b.getSuccessPercent)(e);return parseInt(void 0!==t?t.toString():E.toString(),10)}function getProgressStatus(){var t=e.status;return!k.includes(t)&&getPercentNumber()>=100?"success":t||"normal"}function renderProcessInfo(t,r){var n,o=e.format,a=(0,b.getSuccessPercent)(e);if(!N)return null;var i="line"===S;return o||"exception"!==r&&"success"!==r?n=(o||function(e){return"".concat(e,"%")})((0,b.validProgress)(E),(0,b.validProgress)(a)):"exception"===r?n=i?p.createElement(l.default,null):p.createElement(u.default,null):"success"===r&&(n=i?p.createElement(s.default,null):p.createElement(c.default,null)),p.createElement("span",{className:"".concat(t,"-text"),title:"string"==typeof n?n:void 0},n)}var _=p.useContext(v.ConfigContext),D=_.getPrefixCls,A=_.direction,W=D("progress",r),Z=getProgressStatus(),I=renderProcessInfo(W,Z),M=Array.isArray(m)?m[0]:m,T="string"==typeof m||Array.isArray(m)?m:void 0;"line"===S?t=o?p.createElement(h.default,(0,i.default)({},e,{strokeColor:T,prefixCls:W,steps:o}),I):p.createElement(y.default,(0,i.default)({},e,{strokeColor:M,prefixCls:W,direction:A}),I):("circle"===S||"dashboard"===S)&&(t=p.createElement(g.default,(0,i.default)({},e,{strokeColor:M,prefixCls:W,progressStatus:Z}),I));var L=(0,d.default)(W,(0,a.default)((0,a.default)((0,a.default)((0,a.default)((0,a.default)({},"".concat(W,"-").concat("dashboard"===S&&"circle"||o&&"steps"||S),!0),"".concat(W,"-status-").concat(Z),!0),"".concat(W,"-show-info"),N),"".concat(W,"-").concat(x),x),"".concat(W,"-rtl"),"rtl"===A),n);return p.createElement("div",(0,i.default)({},(0,f.default)(j,["status","format","trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"]),{className:L,role:"progressbar"}),t)}},4087:function(e,t,r){"use strict";var n=r(64836).default;function validProgress(e){return!e||e<0?0:e>100?100:e}function getSuccessPercent(e){var t=e.success,r=e.successPercent;return t&&"progress"in t&&(r=t.progress),t&&"percent"in t&&(r=t.percent),r}Object.defineProperty(t,"__esModule",{value:!0}),t.getSuccessPercent=getSuccessPercent,t.validProgress=validProgress,n(r(13594))},89552:function(e,t,r){"use strict";var n=r(75263).default,o=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(r(10434)),i=o(r(38416)),s=o(r(27424)),c=o(r(94184)),l=o(r(23279)),u=o(r(18475)),d=n(r(67294)),f=r(31929),p=r(47419),v=r(66764),__rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>t.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};(0,v.tuple)("small","default","large");var m=null;function renderIndicator(e,t){var r=t.indicator,n="".concat(e,"-dot");return null===r?null:(0,p.isValidElement)(r)?(0,p.cloneElement)(r,{className:(0,c.default)(r.props.className,n)}):(0,p.isValidElement)(m)?(0,p.cloneElement)(m,{className:(0,c.default)(m.props.className,n)}):d.createElement("span",{className:(0,c.default)(n,"".concat(e,"-dot-spin"))},d.createElement("i",{className:"".concat(e,"-dot-item")}),d.createElement("i",{className:"".concat(e,"-dot-item")}),d.createElement("i",{className:"".concat(e,"-dot-item")}),d.createElement("i",{className:"".concat(e,"-dot-item")}))}function shouldDelay(e,t){return!!e&&!!t&&!isNaN(Number(t))}var Spin=function(e){var t=e.spinPrefixCls,r=e.spinning,n=void 0===r||r,o=e.delay,p=e.className,v=e.size,m=void 0===v?"default":v,g=e.tip,y=e.wrapperClassName,h=e.style,b=e.children,k=__rest(e,["spinPrefixCls","spinning","delay","className","size","tip","wrapperClassName","style","children"]),C=d.useState(function(){return n&&!shouldDelay(n,o)}),E=(0,s.default)(C,2),P=E[0],x=E[1];return d.useEffect(function(){var e=(0,l.default)(function(){x(n)},o);return e(),function(){var t;null===(t=null==e?void 0:e.cancel)||void 0===t||t.call(e)}},[o,n]),d.createElement(f.ConfigConsumer,null,function(r){var n=r.direction,o=(0,c.default)(t,(0,i.default)((0,i.default)((0,i.default)((0,i.default)((0,i.default)({},"".concat(t,"-sm"),"small"===m),"".concat(t,"-lg"),"large"===m),"".concat(t,"-spinning"),P),"".concat(t,"-show-text"),!!g),"".concat(t,"-rtl"),"rtl"===n),p),s=(0,u.default)(k,["indicator","prefixCls"]),l=d.createElement("div",(0,a.default)({},s,{style:h,className:o,"aria-live":"polite","aria-busy":P}),renderIndicator(t,e),g?d.createElement("div",{className:"".concat(t,"-text")},g):null);if(void 0!==b){var f=(0,c.default)("".concat(t,"-container"),(0,i.default)({},"".concat(t,"-blur"),P));return d.createElement("div",(0,a.default)({},s,{className:(0,c.default)("".concat(t,"-nested-loading"),y)}),P&&d.createElement("div",{key:"loading"},l),d.createElement("div",{className:f,key:"container"},b))}return l})},SpinFC=function(e){var t=e.prefixCls,r=(0,d.useContext(f.ConfigContext).getPrefixCls)("spin",t),n=(0,a.default)((0,a.default)({},e),{spinPrefixCls:r});return d.createElement(Spin,(0,a.default)({},n))};SpinFC.setDefaultIndicator=function(e){m=e},t.default=SpinFC},13882:function(e,t,r){"use strict";function requiredArgs(e,t){if(t.length<e)throw TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}r.d(t,{Z:function(){return requiredArgs}})},19013:function(e,t,r){"use strict";r.d(t,{Z:function(){return toDate}});var n=r(71002),o=r(13882);function toDate(e){(0,o.Z)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,n.Z)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):(("string"==typeof e||"[object String]"===t)&&"undefined"!=typeof console&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}},27561:function(e,t,r){var n=r(67990),o=/^\s+/;function baseTrim(e){return e?e.slice(0,n(e)+1).replace(o,""):e}e.exports=baseTrim},67990:function(e){var t=/\s/;function trimmedEndIndex(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}e.exports=trimmedEndIndex},23279:function(e,t,r){var n=r(13218),o=r(7771),a=r(14841),i=Math.max,s=Math.min;function debounce(e,t,r){var c,l,u,d,f,p,v=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function invokeFunc(t){var r=c,n=l;return c=l=void 0,v=t,d=e.apply(n,r)}function leadingEdge(e){return v=e,f=setTimeout(timerExpired,t),m?invokeFunc(e):d}function remainingWait(e){var r=e-p,n=e-v,o=t-r;return g?s(o,u-n):o}function shouldInvoke(e){var r=e-p,n=e-v;return void 0===p||r>=t||r<0||g&&n>=u}function timerExpired(){var e=o();if(shouldInvoke(e))return trailingEdge(e);f=setTimeout(timerExpired,remainingWait(e))}function trailingEdge(e){return(f=void 0,y&&c)?invokeFunc(e):(c=l=void 0,d)}function cancel(){void 0!==f&&clearTimeout(f),v=0,c=p=l=f=void 0}function flush(){return void 0===f?d:trailingEdge(o())}function debounced(){var e=o(),r=shouldInvoke(e);if(c=arguments,l=this,p=e,r){if(void 0===f)return leadingEdge(p);if(g)return clearTimeout(f),f=setTimeout(timerExpired,t),invokeFunc(p)}return void 0===f&&(f=setTimeout(timerExpired,t)),d}return t=a(t)||0,n(r)&&(m=!!r.leading,u=(g="maxWait"in r)?i(a(r.maxWait)||0,t):u,y="trailing"in r?!!r.trailing:y),debounced.cancel=cancel,debounced.flush=flush,debounced}e.exports=debounce},13218:function(e){function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=isObject},7771:function(e,t,r){var n=r(55639);e.exports=function(){return n.Date.now()}},14841:function(e,t,r){var n=r(27561),o=r(13218),a=r(33448),i=0/0,s=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function toNumber(e){if("number"==typeof e)return e;if(a(e))return i;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=c.test(e);return r||l.test(e)?u(e.slice(2),r?2:8):s.test(e)?i:+e}e.exports=toNumber},60057:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return k}});var n=r(4942),o=r(1413),a=r(97685),i=r(45987),s=r(67294),c=r(81263),l=r(94184),u=r.n(l),d={adjustX:1,adjustY:1},f=[0,0],p={topLeft:{points:["bl","tl"],overflow:d,offset:[0,-4],targetOffset:f},topCenter:{points:["bc","tc"],overflow:d,offset:[0,-4],targetOffset:f},topRight:{points:["br","tr"],overflow:d,offset:[0,-4],targetOffset:f},bottomLeft:{points:["tl","bl"],overflow:d,offset:[0,4],targetOffset:f},bottomCenter:{points:["tc","bc"],overflow:d,offset:[0,4],targetOffset:f},bottomRight:{points:["tr","br"],overflow:d,offset:[0,4],targetOffset:f}},v=r(15105),m=r(75164),g=r(88603),y=v.Z.ESC,h=v.Z.TAB;function useAccessibility(e){var t=e.visible,r=e.setTriggerVisible,n=e.triggerRef,o=e.onVisibleChange,a=e.autoFocus,i=s.useRef(!1),handleCloseMenuAndReturnFocus=function(){if(t&&n.current){var e,a,i,s;null===(e=n.current)||void 0===e||null===(a=e.triggerRef)||void 0===a||null===(i=a.current)||void 0===i||null===(s=i.focus)||void 0===s||s.call(i),r(!1),"function"==typeof o&&o(!1)}},focusMenu=function(){var e,t,r,o,a=(0,g.tS)(null===(e=n.current)||void 0===e?void 0:null===(t=e.popupRef)||void 0===t?void 0:null===(r=t.current)||void 0===r?void 0:null===(o=r.getElement)||void 0===o?void 0:o.call(r))[0];return null!=a&&!!a.focus&&(a.focus(),i.current=!0,!0)},handleKeyDown=function(e){switch(e.keyCode){case y:handleCloseMenuAndReturnFocus();break;case h:var t=!1;i.current||(t=focusMenu()),t?e.preventDefault():handleCloseMenuAndReturnFocus()}};s.useEffect(function(){return t?(window.addEventListener("keydown",handleKeyDown),a&&(0,m.Z)(focusMenu,3),function(){window.removeEventListener("keydown",handleKeyDown),i.current=!1}):function(){i.current=!1}},[t])}var b=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus"];function Dropdown(e,t){var r,l,d,f,v,m,g=e.arrow,y=void 0!==g&&g,h=e.prefixCls,k=void 0===h?"rc-dropdown":h,C=e.transitionName,E=e.animation,P=e.align,x=e.placement,w=e.placements,N=void 0===w?p:w,O=e.getPopupContainer,S=e.showAction,j=e.hideAction,_=e.overlayClassName,D=e.overlayStyle,A=e.visible,W=e.trigger,Z=void 0===W?["hover"]:W,I=e.autoFocus,M=(0,i.Z)(e,b),T=s.useState(),L=(0,a.Z)(T,2),R=L[0],F=L[1],V="visible"in e?A:R,z=s.useRef(null);s.useImperativeHandle(t,function(){return z.current}),useAccessibility({visible:V,setTriggerVisible:F,triggerRef:z,onVisibleChange:e.onVisibleChange,autoFocus:I});var getOverlayElement=function(){var t=e.overlay;return"function"==typeof t?t():t},getMenuElement=function(){var e=getOverlayElement();return s.createElement(s.Fragment,null,y&&s.createElement("div",{className:"".concat(k,"-arrow")}),e)},G=j;return G||-1===Z.indexOf("contextMenu")||(G=["click"]),s.createElement(c.Z,(0,o.Z)((0,o.Z)({builtinPlacements:N},M),{},{prefixCls:k,ref:z,popupClassName:u()(_,(0,n.Z)({},"".concat(k,"-show-arrow"),y)),popupStyle:D,action:Z,showAction:S,hideAction:G||[],popupPlacement:void 0===x?"bottomLeft":x,popupAlign:P,popupTransitionName:C,popupAnimation:E,popupVisible:V,stretch:(l=e.minOverlayWidthMatchTrigger,d=e.alignPoint,"minOverlayWidthMatchTrigger"in e?l:!d)?"minWidth":"",popup:"function"==typeof e.overlay?getMenuElement:getMenuElement(),onPopupVisibleChange:function(t){var r=e.onVisibleChange;F(t),"function"==typeof r&&r(t)},onPopupClick:function(t){var r=e.onOverlayClick;F(!1),r&&r(t)},getPopupContainer:O}),(v=(f=e.children).props?f.props:{},m=u()(v.className,void 0!==(r=e.openClassName)?r:"".concat(k,"-open")),V&&f?s.cloneElement(f,{className:m}):f))}var k=s.forwardRef(Dropdown)},34744:function(e,t,r){"use strict";r.r(t),r.d(t,{Circle:function(){return es_Circle},Line:function(){return es_Line},default:function(){return y}});var n=r(87462),o=r(1413),a=r(45987),i=r(67294),s=r(94184),c=r.n(s),l={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},useTransitionDuration=function(){var e=(0,i.useRef)([]),t=(0,i.useRef)(null);return(0,i.useEffect)(function(){var r=Date.now(),n=!1;e.current.forEach(function(e){if(e){n=!0;var o=e.style;o.transitionDuration=".3s, .3s, .3s, .06s",t.current&&r-t.current<100&&(o.transitionDuration="0s, 0s")}}),n&&(t.current=Date.now())}),e.current},u=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],es_Line=function(e){var t=(0,o.Z)((0,o.Z)({},l),e),r=t.className,s=t.percent,d=t.prefixCls,f=t.strokeColor,p=t.strokeLinecap,v=t.strokeWidth,m=t.style,g=t.trailColor,y=t.trailWidth,h=t.transition,b=(0,a.Z)(t,u);delete b.gapPosition;var k=Array.isArray(s)?s:[s],C=Array.isArray(f)?f:[f],E=useTransitionDuration(),P=v/2,x="M ".concat("round"===p?P:0,",").concat(P,"\n L ").concat("round"===p?100-v/2:100,",").concat(P),w=0;return i.createElement("svg",(0,n.Z)({className:c()("".concat(d,"-line"),r),viewBox:"0 0 100 ".concat(v),preserveAspectRatio:"none",style:m},b),i.createElement("path",{className:"".concat(d,"-line-trail"),d:x,strokeLinecap:p,stroke:g,strokeWidth:y||v,fillOpacity:"0"}),k.map(function(e,t){var r=1;switch(p){case"round":r=1-v/100;break;case"square":r=1-v/2/100;break;default:r=1}var n={strokeDasharray:"".concat(e*r,"px, 100px"),strokeDashoffset:"-".concat(w,"px"),transition:h||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},o=C[t]||C[C.length-1];return w+=e,i.createElement("path",{key:t,className:"".concat(d,"-line-path"),d:x,strokeLinecap:p,stroke:o,strokeWidth:v,fillOpacity:"0",ref:function(e){E[t]=e},style:n})}))},d=r(71002),f=r(97685),p=r(98924),v=0,m=(0,p.Z)();function getUUID(){var e;return m?(e=v,v+=1):e="TEST_OR_SSR",e}var useId=function(e){var t=i.useState(),r=(0,f.Z)(t,2),n=r[0],o=r[1];return i.useEffect(function(){o("rc_progress_".concat(getUUID()))},[]),e||n},g=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function stripPercentToNumber(e){return+e.replace("%","")}function toArray(e){var t=null!=e?e:[];return Array.isArray(t)?t:[t]}var getCircleStyle=function(e,t,r,n,o,a,i,s,c,l){var u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,d=(100-n)/100*t;return"round"===c&&100!==n&&(d+=l/2)>=t&&(d=t-.01),{stroke:"string"==typeof s?s:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:d+u,transform:"rotate(".concat(o+r/100*360*((360-a)/360)+(0===a?0:({bottom:0,top:180,left:90,right:-90})[i]),"deg)"),transformOrigin:"0 0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},es_Circle=function(e){var t,r,s,u,f=(0,o.Z)((0,o.Z)({},l),e),p=f.id,v=f.prefixCls,m=f.steps,y=f.strokeWidth,h=f.trailWidth,b=f.gapDegree,k=void 0===b?0:b,C=f.gapPosition,E=f.trailColor,P=f.strokeLinecap,x=f.style,w=f.className,N=f.strokeColor,O=f.percent,S=(0,a.Z)(f,g),j=useId(p),_="".concat(j,"-gradient"),D=50-y/2,A=2*Math.PI*D,W=k>0?90+k/2:-90,Z=A*((360-k)/360),I="object"===(0,d.Z)(m)?m:{count:m,space:2},M=I.count,T=I.space,L=getCircleStyle(A,Z,0,100,W,k,C,E,P,y),R=toArray(O),F=toArray(N),V=F.find(function(e){return e&&"object"===(0,d.Z)(e)}),z=useTransitionDuration();return i.createElement("svg",(0,n.Z)({className:c()("".concat(v,"-circle"),w),viewBox:"".concat(-50," ").concat(-50," ").concat(100," ").concat(100),style:x,id:p,role:"presentation"},S),V&&i.createElement("defs",null,i.createElement("linearGradient",{id:_,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(V).sort(function(e,t){return stripPercentToNumber(e)-stripPercentToNumber(t)}).map(function(e,t){return i.createElement("stop",{key:t,offset:e,stopColor:V[e]})}))),!M&&i.createElement("circle",{className:"".concat(v,"-circle-trail"),r:D,cx:0,cy:0,stroke:E,strokeLinecap:P,strokeWidth:h||y,style:L}),M?(t=Math.round(M*(R[0]/100)),r=100/M,s=0,Array(M).fill(null).map(function(e,n){var o=n<=t-1?F[0]:E,a=o&&"object"===(0,d.Z)(o)?"url(#".concat(_,")"):void 0,c=getCircleStyle(A,Z,s,r,W,k,C,o,"butt",y,T);return s+=(Z-c.strokeDashoffset+T)*100/Z,i.createElement("circle",{key:n,className:"".concat(v,"-circle-path"),r:D,cx:0,cy:0,stroke:a,strokeWidth:y,opacity:1,style:c,ref:function(e){z[n]=e}})})):(u=0,R.map(function(e,t){var r=F[t]||F[F.length-1],n=r&&"object"===(0,d.Z)(r)?"url(#".concat(_,")"):void 0,o=getCircleStyle(A,Z,u,e,W,k,C,r,P,y);return u+=e,i.createElement("circle",{key:t,className:"".concat(v,"-circle-path"),r:D,cx:0,cy:0,stroke:n,strokeLinecap:P,strokeWidth:y,opacity:0===e?0:1,style:o,ref:function(e){z[t]=e}})}).reverse()))},y={Line:es_Line,Circle:es_Circle}}}]); |