=o){var m=s?null:i(c);if(m)return a(m);y=!1,h=n,d=new e}else d=s?[]:v;e:for(;++l=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function aP(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function oP(e){return e.value}function uP(e,t){if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return S.createElement(e,t);t.ref;var r=iP(t,YS);return S.createElement(Nh,r)}var Ny=1,jr=(function(e){function t(){var r;ZS(this,t);for(var n=arguments.length,i=new Array(n),a=0;aNy||Math.abs(i.height-this.lastBoundingBox.height)>Ny)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ot({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,u=i.verticalAlign,c=i.margin,s=i.chartWidth,f=i.chartHeight,l,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();l={left:((s||0)-p.width)/2}}else l=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var y=this.getBBoxSnapshot();h={top:((f||0)-y.height)/2}}else h=u==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Ot(Ot({},l),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,u=i.height,c=i.wrapperStyle,s=i.payloadUniqBy,f=i.payload,l=Ot(Ot({position:"absolute",width:o||"auto",height:u||"auto"},this.getDefaultPosition(c)),c);return S.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(p){n.wrapperNode=p}},uP(a,Ot(Ot({},this.props),{},{payload:sw(f,s,oP)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Ot(Ot({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&q(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])})(N.PureComponent);Xa(jr,"displayName","Legend");Xa(jr,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var ns,qy;function cP(){if(qy)return ns;qy=1;var e=nn(),t=Uh(),r=Fe(),n=e?e.isConcatSpreadable:void 0;function i(a){return r(a)||t(a)||!!(n&&a&&a[n])}return ns=i,ns}var is,Ly;function Xh(){if(Ly)return is;Ly=1;var e=Bh(),t=cP();function r(n,i,a,o,u){var c=-1,s=n.length;for(a||(a=t),u||(u=[]);++c0&&a(f)?i>1?r(f,i-1,a,o,u):e(u,f):o||(u[u.length]=f)}return u}return is=r,is}var as,By;function sP(){if(By)return as;By=1;function e(t){return function(r,n,i){for(var a=-1,o=Object(r),u=i(r),c=u.length;c--;){var s=u[t?c:++a];if(n(o[s],s,o)===!1)break}return r}}return as=e,as}var os,Fy;function lP(){if(Fy)return os;Fy=1;var e=sP(),t=e();return os=t,os}var us,Uy;function hw(){if(Uy)return us;Uy=1;var e=lP(),t=sn();function r(n,i){return n&&e(n,i,t)}return us=r,us}var cs,Wy;function fP(){if(Wy)return cs;Wy=1;var e=cn();function t(r,n){return function(i,a){if(i==null)return i;if(!e(i))return r(i,a);for(var o=i.length,u=n?o:-1,c=Object(i);(n?u--:++un||u&&c&&f&&!s&&!l||a&&c&&f||!i&&f||!o)return 1;if(!a&&!u&&!l&&r=s)return f;var l=i[a];return f*(l=="desc"?-1:1)}}return r.index-n.index}return ps=t,ps}var ds,Xy;function vP(){if(Xy)return ds;Xy=1;var e=jh(),t=Mh(),r=xt(),n=pw(),i=hP(),a=Ga(),o=dP(),u=ln(),c=Fe();function s(f,l,h){l.length?l=e(l,function(v){return c(v)?function(d){return t(d,v.length===1?v[0]:v)}:v}):l=[u];var p=-1;l=e(l,a(r));var y=n(f,function(v,d,m){var x=e(l,function(w){return w(v)});return{criteria:x,index:++p,value:v}});return i(y,function(v,d){return o(v,d,h)})}return ds=s,ds}var vs,Yy;function yP(){if(Yy)return vs;Yy=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return vs=e,vs}var ys,Zy;function dw(){if(Zy)return ys;Zy=1;var e=yP(),t=Math.max;function r(n,i,a){return i=t(i===void 0?n.length-1:i,0),function(){for(var o=arguments,u=-1,c=t(o.length-i,0),s=Array(c);++u0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return xs=n,xs}var ws,rg;function yw(){if(rg)return ws;rg=1;var e=mP(),t=bP(),r=t(e);return ws=r,ws}var Os,ng;function xP(){if(ng)return Os;ng=1;var e=ln(),t=dw(),r=yw();function n(i,a){return r(t(i,a,e),i+"")}return Os=n,Os}var _s,ig;function Ya(){if(ig)return _s;ig=1;var e=qa(),t=cn(),r=zh(),n=ht();function i(a,o,u){if(!n(u))return!1;var c=typeof o;return(c=="number"?t(u)&&r(o,u.length):c=="string"&&o in u)?e(u[o],a):!1}return _s=i,_s}var As,ag;function wP(){if(ag)return As;ag=1;var e=Xh(),t=vP(),r=xP(),n=Ya(),i=r(function(a,o){if(a==null)return[];var u=o.length;return u>1&&n(a,o[0],o[1])?o=[]:u>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return As=i,As}var OP=wP();const Zh=ce(OP);function qn(e){"@babel/helpers - typeof";return qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qn(e)}function gf(){return gf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(yn,"-left"),q(r)&&t&&q(t.x)&&r=t.y),"".concat(yn,"-top"),q(n)&&t&&q(t.y)&&nv?Math.max(f,c[n]):Math.max(l,c[n])}function NP(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function qP(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,u=e.useTranslate3d,c=e.viewBox,s,f,l;return o.height>0&&o.width>0&&r?(f=cg({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),l=cg({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),s=NP({translateX:f,translateY:l,useTranslate3d:u})):s=RP,{cssProperties:s,cssClasses:DP({translateX:f,translateY:l,coordinate:r})}}function Rr(e){"@babel/helpers - typeof";return Rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(e)}function sg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function lg(e){for(var t=1;tfg||Math.abs(n.height-this.state.lastBoundingBox.height)>fg)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,u=i.animationDuration,c=i.animationEasing,s=i.children,f=i.coordinate,l=i.hasPayload,h=i.isAnimationActive,p=i.offset,y=i.position,v=i.reverseDirection,d=i.useTranslate3d,m=i.viewBox,x=i.wrapperStyle,w=qP({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:p,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:d,viewBox:m}),O=w.cssClasses,g=w.cssProperties,b=lg(lg({transition:h&&a?"transform ".concat(u,"ms ").concat(c):void 0},g),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&l?"visible":"hidden",position:"absolute",top:0,left:0},x);return S.createElement("div",{tabIndex:-1,className:O,style:b,ref:function(A){n.wrapperNode=A}},s)}}])})(N.PureComponent),VP=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},pr={isSsr:VP()};function Dr(e){"@babel/helpers - typeof";return Dr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dr(e)}function hg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pg(e){for(var t=1;t0;return S.createElement(GP,{allowEscapeViewBox:o,animationDuration:u,animationEasing:c,isAnimationActive:h,active:a,coordinate:f,hasPayload:b,offset:p,position:d,reverseDirection:m,useTranslate3d:x,viewBox:w,wrapperStyle:O},iT(s,pg(pg({},this.props),{},{payload:g})))}}])})(N.PureComponent);Jh(_t,"displayName","Tooltip");Jh(_t,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!pr.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Ps,dg;function aT(){if(dg)return Ps;dg=1;var e=lt(),t=function(){return e.Date.now()};return Ps=t,Ps}var Ts,vg;function oT(){if(vg)return Ts;vg=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Ts=t,Ts}var Es,yg;function uT(){if(yg)return Es;yg=1;var e=oT(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Es=r,Es}var js,gg;function ww(){if(gg)return js;gg=1;var e=uT(),t=ht(),r=an(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,u=parseInt;function c(s){if(typeof s=="number")return s;if(r(s))return n;if(t(s)){var f=typeof s.valueOf=="function"?s.valueOf():s;s=t(f)?f+"":f}if(typeof s!="string")return s===0?s:+s;s=e(s);var l=a.test(s);return l||o.test(s)?u(s.slice(2),l?2:8):i.test(s)?n:+s}return js=c,js}var Ms,mg;function cT(){if(mg)return Ms;mg=1;var e=ht(),t=aT(),r=ww(),n="Expected a function",i=Math.max,a=Math.min;function o(u,c,s){var f,l,h,p,y,v,d=0,m=!1,x=!1,w=!0;if(typeof u!="function")throw new TypeError(n);c=r(c)||0,e(s)&&(m=!!s.leading,x="maxWait"in s,h=x?i(r(s.maxWait)||0,c):h,w="trailing"in s?!!s.trailing:w);function O(M){var I=f,$=l;return f=l=void 0,d=M,p=u.apply($,I),p}function g(M){return d=M,y=setTimeout(A,c),m?O(M):p}function b(M){var I=M-v,$=M-d,k=c-I;return x?a(k,h-$):k}function _(M){var I=M-v,$=M-d;return v===void 0||I>=c||I<0||x&&$>=h}function A(){var M=t();if(_(M))return P(M);y=setTimeout(A,b(M))}function P(M){return y=void 0,w&&f?O(M):(f=l=void 0,p)}function j(){y!==void 0&&clearTimeout(y),d=0,f=v=l=y=void 0}function T(){return y===void 0?p:P(t())}function E(){var M=t(),I=_(M);if(f=arguments,l=this,v=M,I){if(y===void 0)return g(v);if(x)return clearTimeout(y),y=setTimeout(A,c),O(v)}return y===void 0&&(y=setTimeout(A,c)),p}return E.cancel=j,E.flush=T,E}return Ms=o,Ms}var $s,bg;function sT(){if(bg)return $s;bg=1;var e=cT(),t=ht(),r="Expected a function";function n(i,a,o){var u=!0,c=!0;if(typeof i!="function")throw new TypeError(r);return t(o)&&(u="leading"in o?!!o.leading:u,c="trailing"in o?!!o.trailing:c),e(i,a,{leading:u,maxWait:a,trailing:c})}return $s=n,$s}var lT=sT();const Ow=ce(lT);function Bn(e){"@babel/helpers - typeof";return Bn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bn(e)}function xg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ti(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(M=Ow(M,v,{trailing:!0,leading:!1}));var I=new ResizeObserver(M),$=g.current.getBoundingClientRect(),k=$.width,R=$.height;return T(k,R),I.observe(g.current),function(){I.disconnect()}},[T,v]);var E=N.useMemo(function(){var M=P.containerWidth,I=P.containerHeight;if(M<0||I<0)return null;st(er(o)||er(c),`The width(%s) and height(%s) are both fixed numbers,
+ maybe you don't need to use a ResponsiveContainer.`,o,c),st(!r||r>0,"The aspect(%s) must be greater than zero.",r);var $=er(o)?M:o,k=er(c)?I:c;r&&r>0&&($?k=$/r:k&&($=k*r),h&&k>h&&(k=h)),st($>0||k>0,`The width(%s) and height(%s) of chart should be greater than 0,
+ please check the style of container, or the props width(%s) and height(%s),
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
+ height and width.`,$,k,o,c,f,l,r);var R=!Array.isArray(p)&&Et(p.type).endsWith("Chart");return S.Children.map(p,function(L){return S.isValidElement(L)?N.cloneElement(L,Ti({width:$,height:k},R?{style:Ti({height:"100%",width:"100%",maxHeight:k,maxWidth:$},L.props.style)}:{})):L})},[r,p,c,h,l,f,P,o]);return S.createElement("div",{id:d?"".concat(d):void 0,className:te("recharts-responsive-container",m),style:Ti(Ti({},O),{},{width:o,height:c,minWidth:f,minHeight:l,maxHeight:h}),ref:g},E)}),Qh=function(t){return null};Qh.displayName="Cell";function Fn(e){"@babel/helpers - typeof";return Fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fn(e)}function Og(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wf(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||pr.isSsr)return{width:0,height:0};var n=AT(r),i=JSON.stringify({text:t,copyStyle:n});if(br.widthCache[i])return br.widthCache[i];try{var a=document.getElementById(_g);a||(a=document.createElement("span"),a.setAttribute("id",_g),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=wf(wf({},_T),n);Object.assign(a.style,o),a.textContent="".concat(t);var u=a.getBoundingClientRect(),c={width:u.width,height:u.height};return br.widthCache[i]=c,++br.cacheCount>OT&&(br.cacheCount=0,br.widthCache={}),c}catch{return{width:0,height:0}}},ST=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Un(e){"@babel/helpers - typeof";return Un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(e)}function Zi(e,t){return jT(e)||ET(e,t)||TT(e,t)||PT()}function PT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TT(e,t){if(e){if(typeof e=="string")return Ag(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ag(e,t)}}function Ag(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function WT(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Mg(e,t){return GT(e)||HT(e,t)||KT(e,t)||zT()}function zT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KT(e,t){if(e){if(typeof e=="string")return $g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $g(e,t)}}function $g(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return $.reduce(function(k,R){var L=R.word,B=R.width,z=k[k.length-1];if(z&&(i==null||a||z.width+B+nR.width?k:R})};if(!f)return p;for(var v="…",d=function($){var k=l.slice(0,$),R=Pw({breakAll:s,style:c,children:k+v}).wordsWithComputedWidth,L=h(R),B=L.length>o||y(L).width>Number(i);return[B,L]},m=0,x=l.length-1,w=0,O;m<=x&&w<=l.length-1;){var g=Math.floor((m+x)/2),b=g-1,_=d(b),A=Mg(_,2),P=A[0],j=A[1],T=d(g),E=Mg(T,1),M=E[0];if(!P&&!M&&(m=g+1),P&&M&&(x=g-1),!P&&M){O=j;break}w++}return O||p},Ig=function(t){var r=J(t)?[]:t.toString().split(Sw);return[{words:r}]},XT=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,u=t.maxLines;if((r||n)&&!pr.isSsr){var c,s,f=Pw({breakAll:o,children:i,style:a});if(f){var l=f.wordsWithComputedWidth,h=f.spaceWidth;c=l,s=h}else return Ig(i);return VT({breakAll:o,children:i,maxLines:u,style:a},c,s,r,n)}return Ig(i)},Cg="#808080",sr=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,u=o===void 0?"1em":o,c=t.capHeight,s=c===void 0?"0.71em":c,f=t.scaleToFit,l=f===void 0?!1:f,h=t.textAnchor,p=h===void 0?"start":h,y=t.verticalAnchor,v=y===void 0?"end":y,d=t.fill,m=d===void 0?Cg:d,x=jg(t,FT),w=N.useMemo(function(){return XT({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:l,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,l,x.style,x.width]),O=x.dx,g=x.dy,b=x.angle,_=x.className,A=x.breakAll,P=jg(x,UT);if(!Se(n)||!Se(a))return null;var j=n+(q(O)?O:0),T=a+(q(g)?g:0),E;switch(v){case"start":E=Is("calc(".concat(s,")"));break;case"middle":E=Is("calc(".concat((w.length-1)/2," * -").concat(u," + (").concat(s," / 2))"));break;default:E=Is("calc(".concat(w.length-1," * -").concat(u,")"));break}var M=[];if(l){var I=w[0].width,$=x.width;M.push("scale(".concat((q($)?$/I:1)/I,")"))}return b&&M.push("rotate(".concat(b,", ").concat(j,", ").concat(T,")")),M.length&&(P.transform=M.join(" ")),S.createElement("text",Of({},K(P,!0),{x:j,y:T,className:te("recharts-text",_),textAnchor:p,fill:m.includes("url")?Cg:m}),w.map(function(k,R){var L=k.words.join(A?"":" ");return S.createElement("tspan",{x:j,dy:R===0?E:u,key:"".concat(L,"-").concat(R)},L)}))};function Bt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function YT(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function ep(e){let t,r,n;e.length!==2?(t=Bt,r=(u,c)=>Bt(e(u),c),n=(u,c)=>e(u)-c):(t=e===Bt||e===YT?e:ZT,r=e,n=e);function i(u,c,s=0,f=u.length){if(s>>1;r(u[l],c)<0?s=l+1:f=l}while(s>>1;r(u[l],c)<=0?s=l+1:f=l}while(ss&&n(u[l-1],c)>-n(u[l],c)?l-1:l}return{left:i,center:o,right:a}}function ZT(){return 0}function Tw(e){return e===null?NaN:+e}function*JT(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const QT=ep(Bt),mi=QT.right;ep(Tw).center;class kg extends Map{constructor(t,r=rE){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Rg(this,t))}has(t){return super.has(Rg(this,t))}set(t,r){return super.set(eE(this,t),r)}delete(t){return super.delete(tE(this,t))}}function Rg({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function eE({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function tE({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function rE(e){return e!==null&&typeof e=="object"?e.valueOf():e}function nE(e=Bt){if(e===Bt)return Ew;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function Ew(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const iE=Math.sqrt(50),aE=Math.sqrt(10),oE=Math.sqrt(2);function Ji(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=iE?10:a>=aE?5:a>=oE?2:1;let u,c,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(e*s),c=Math.round(t*s),u/st&&--c,s=-s):(s=Math.pow(10,i)*o,u=Math.round(e/s),c=Math.round(t/s),u*st&&--c),c0))return[];if(e===t)return[e];const n=t=i))return[];const u=a-i+1,c=new Array(u);if(n)if(o<0)for(let s=0;s=n)&&(r=n);return r}function Ng(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function jw(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?Ew:nE(i);n>r;){if(n-r>600){const c=n-r+1,s=t-r+1,f=Math.log(c),l=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*l*(c-l)/c)*(s-c/2<0?-1:1),p=Math.max(r,Math.floor(t-s*l/c+h)),y=Math.min(n,Math.floor(t+(c-s)*l/c+h));jw(e,t,p,y,i)}const a=e[t];let o=r,u=n;for(gn(e,r,t),i(e[n],a)>0&&gn(e,r,n);o0;)--u}i(e[r],a)===0?gn(e,r,u):(++u,gn(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function gn(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function uE(e,t,r){if(e=Float64Array.from(JT(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Ng(e);if(t>=1)return Dg(e);var n,i=(n-1)*t,a=Math.floor(i),o=Dg(jw(e,a).subarray(0,a+1)),u=Ng(e.subarray(a+1));return o+(u-o)*(i-a)}}function cE(e,t,r=Tw){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function sE(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ji(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ji(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=fE.exec(e))?new Ue(t[1],t[2],t[3],1):(t=hE.exec(e))?new Ue(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pE.exec(e))?ji(t[1],t[2],t[3],t[4]):(t=dE.exec(e))?ji(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vE.exec(e))?zg(t[1],t[2]/100,t[3]/100,1):(t=yE.exec(e))?zg(t[1],t[2]/100,t[3]/100,t[4]):qg.hasOwnProperty(e)?Fg(qg[e]):e==="transparent"?new Ue(NaN,NaN,NaN,0):null}function Fg(e){return new Ue(e>>16&255,e>>8&255,e&255,1)}function ji(e,t,r,n){return n<=0&&(e=t=r=NaN),new Ue(e,t,r,n)}function bE(e){return e instanceof bi||(e=Hn(e)),e?(e=e.rgb(),new Ue(e.r,e.g,e.b,e.opacity)):new Ue}function Tf(e,t,r,n){return arguments.length===1?bE(e):new Ue(e,t,r,n??1)}function Ue(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}rp(Ue,Tf,$w(bi,{brighter(e){return e=e==null?Qi:Math.pow(Qi,e),new Ue(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zn:Math.pow(zn,e),new Ue(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ue(ir(this.r),ir(this.g),ir(this.b),ea(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ug,formatHex:Ug,formatHex8:xE,formatRgb:Wg,toString:Wg}));function Ug(){return`#${tr(this.r)}${tr(this.g)}${tr(this.b)}`}function xE(){return`#${tr(this.r)}${tr(this.g)}${tr(this.b)}${tr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wg(){const e=ea(this.opacity);return`${e===1?"rgb(":"rgba("}${ir(this.r)}, ${ir(this.g)}, ${ir(this.b)}${e===1?")":`, ${e})`}`}function ea(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ir(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tr(e){return e=ir(e),(e<16?"0":"")+e.toString(16)}function zg(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ct(e,t,r,n)}function Iw(e){if(e instanceof ct)return new ct(e.h,e.s,e.l,e.opacity);if(e instanceof bi||(e=Hn(e)),!e)return new ct;if(e instanceof ct)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,u=a-i,c=(a+i)/2;return u?(t===a?o=(r-n)/u+(r0&&c<1?0:o,new ct(o,u,c,e.opacity)}function wE(e,t,r,n){return arguments.length===1?Iw(e):new ct(e,t,r,n??1)}function ct(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}rp(ct,wE,$w(bi,{brighter(e){return e=e==null?Qi:Math.pow(Qi,e),new ct(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zn:Math.pow(zn,e),new ct(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Ue(Cs(e>=240?e-240:e+120,i,n),Cs(e,i,n),Cs(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ct(Kg(this.h),Mi(this.s),Mi(this.l),ea(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ea(this.opacity);return`${e===1?"hsl(":"hsla("}${Kg(this.h)}, ${Mi(this.s)*100}%, ${Mi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Kg(e){return e=(e||0)%360,e<0?e+360:e}function Mi(e){return Math.max(0,Math.min(1,e||0))}function Cs(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const np=e=>()=>e;function OE(e,t){return function(r){return e+r*t}}function _E(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function AE(e){return(e=+e)==1?Cw:function(t,r){return r-t?_E(t,r,e):np(isNaN(t)?r:t)}}function Cw(e,t){var r=t-e;return r?OE(e,r):np(isNaN(e)?t:e)}const Hg=(function e(t){var r=AE(t);function n(i,a){var o=r((i=Tf(i)).r,(a=Tf(a)).r),u=r(i.g,a.g),c=r(i.b,a.b),s=Cw(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=c(f),i.opacity=s(f),i+""}}return n.gamma=e,n})(1);function SE(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,c.push({i:o,x:dt(n,i)})),r=ks.lastIndex;return r180?f+=360:f-s>180&&(s+=360),h.push({i:l.push(i(l)+"rotate(",null,n)-2,x:dt(s,f)})):f&&l.push(i(l)+"rotate("+f+n)}function u(s,f,l,h){s!==f?h.push({i:l.push(i(l)+"skewX(",null,n)-2,x:dt(s,f)}):f&&l.push(i(l)+"skewX("+f+n)}function c(s,f,l,h,p,y){if(s!==l||f!==h){var v=p.push(i(p)+"scale(",null,",",null,")");y.push({i:v-4,x:dt(s,l)},{i:v-2,x:dt(f,h)})}else(l!==1||h!==1)&&p.push(i(p)+"scale("+l+","+h+")")}return function(s,f){var l=[],h=[];return s=e(s),f=e(f),a(s.translateX,s.translateY,f.translateX,f.translateY,l,h),o(s.rotate,f.rotate,l,h),u(s.skewX,f.skewX,l,h),c(s.scaleX,s.scaleY,f.scaleX,f.scaleY,l,h),s=f=null,function(p){for(var y=-1,v=h.length,d;++yt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function FE(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?UE:FE,c=s=null,l}function l(h){return h==null||isNaN(h=+h)?a:(c||(c=u(e.map(n),t,r)))(n(o(h)))}return l.invert=function(h){return o(i((s||(s=u(t,e.map(n),dt)))(h)))},l.domain=function(h){return arguments.length?(e=Array.from(h,ta),f()):e.slice()},l.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},l.rangeRound=function(h){return t=Array.from(h),r=ip,f()},l.clamp=function(h){return arguments.length?(o=h?!0:Be,f()):o!==Be},l.interpolate=function(h){return arguments.length?(r=h,f()):r},l.unknown=function(h){return arguments.length?(a=h,l):a},function(h,p){return n=h,i=p,f()}}function ap(){return Za()(Be,Be)}function WE(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ra(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Nr(e){return e=ra(Math.abs(e)),e?e[1]:NaN}function zE(e,t){return function(r,n){for(var i=r.length,a=[],o=0,u=e[0],c=0;i>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),a.push(r.substring(i-=u,i+u)),!((c+=u+1)>n));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function KE(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var HE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Gn(e){if(!(t=HE.exec(e)))throw new Error("invalid format: "+e);var t;return new op({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Gn.prototype=op.prototype;function op(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}op.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function GE(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Dw;function VE(e,t){var r=ra(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(Dw=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+ra(e,Math.max(0,t+a-1))[0]}function Yg(e,t){var r=ra(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const Zg={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:WE,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Yg(e*100,t),r:Yg,s:VE,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Jg(e){return e}var Qg=Array.prototype.map,em=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function XE(e){var t=e.grouping===void 0||e.thousands===void 0?Jg:zE(Qg.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?Jg:KE(Qg.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function s(l){l=Gn(l);var h=l.fill,p=l.align,y=l.sign,v=l.symbol,d=l.zero,m=l.width,x=l.comma,w=l.precision,O=l.trim,g=l.type;g==="n"?(x=!0,g="g"):Zg[g]||(w===void 0&&(w=12),O=!0,g="g"),(d||h==="0"&&p==="=")&&(d=!0,h="0",p="=");var b=v==="$"?r:v==="#"&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",_=v==="$"?n:/[%p]/.test(g)?o:"",A=Zg[g],P=/[defgprs%]/.test(g);w=w===void 0?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function j(T){var E=b,M=_,I,$,k;if(g==="c")M=A(T)+M,T="";else{T=+T;var R=T<0||1/T<0;if(T=isNaN(T)?c:A(Math.abs(T),w),O&&(T=GE(T)),R&&+T==0&&y!=="+"&&(R=!1),E=(R?y==="("?y:u:y==="-"||y==="("?"":y)+E,M=(g==="s"?em[8+Dw/3]:"")+M+(R&&y==="("?")":""),P){for(I=-1,$=T.length;++I<$;)if(k=T.charCodeAt(I),48>k||k>57){M=(k===46?i+T.slice(I+1):T.slice(I))+M,T=T.slice(0,I);break}}}x&&!d&&(T=t(T,1/0));var L=E.length+T.length+M.length,B=L>1)+E+T+M+B.slice(L);break;default:T=B+E+T+M;break}return a(T)}return j.toString=function(){return l+""},j}function f(l,h){var p=s((l=Gn(l),l.type="f",l)),y=Math.max(-8,Math.min(8,Math.floor(Nr(h)/3)))*3,v=Math.pow(10,-y),d=em[8+y/3];return function(m){return p(v*m)+d}}return{format:s,formatPrefix:f}}var Ii,up,Nw;YE({thousands:",",grouping:[3],currency:["$",""]});function YE(e){return Ii=XE(e),up=Ii.format,Nw=Ii.formatPrefix,Ii}function ZE(e){return Math.max(0,-Nr(Math.abs(e)))}function JE(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Nr(t)/3)))*3-Nr(Math.abs(e)))}function QE(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Nr(t)-Nr(e))+1}function qw(e,t,r,n){var i=Sf(e,t,r),a;switch(n=Gn(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=JE(i,o))&&(n.precision=a),Nw(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=QE(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=ZE(i))&&(n.precision=a-(n.type==="%")*2);break}}return up(n)}function Ft(e){var t=e.domain;return e.ticks=function(r){var n=t();return _f(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return qw(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],u=n[a],c,s,f=10;for(u0;){if(s=Af(o,u,r),s===c)return n[i]=o,n[a]=u,t(n);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;c=s}return e},e}function na(){var e=ap();return e.copy=function(){return xi(e,na())},it.apply(e,arguments),Ft(e)}function Lw(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,ta),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Lw(e).unknown(t)},e=arguments.length?Array.from(e,ta):[0,1],Ft(r)}function Bw(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function ij(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function nm(e){return(t,r)=>-e(-t,r)}function cp(e){const t=e(tm,rm),r=t.domain;let n=10,i,a;function o(){return i=ij(n),a=nj(n),r()[0]<0?(i=nm(i),a=nm(a),e(ej,tj)):e(tm,rm),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const c=r();let s=c[0],f=c[c.length-1];const l=f0){for(;h<=p;++h)for(y=1;yf)break;m.push(v)}}else for(;h<=p;++h)for(y=n-1;y>=1;--y)if(v=h>0?y/a(-h):y*a(h),!(vf)break;m.push(v)}m.length*2{if(u==null&&(u=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Gn(c)).precision==null&&(c.trim=!0),c=up(c)),u===1/0)return c;const s=Math.max(1,n*u/t.ticks().length);return f=>{let l=f/a(Math.round(i(f)));return l*nr(Bw(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function Fw(){const e=cp(Za()).domain([1,10]);return e.copy=()=>xi(e,Fw()).base(e.base()),it.apply(e,arguments),e}function im(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function am(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function sp(e){var t=1,r=e(im(t),am(t));return r.constant=function(n){return arguments.length?e(im(t=+n),am(t)):t},Ft(r)}function Uw(){var e=sp(Za());return e.copy=function(){return xi(e,Uw()).constant(e.constant())},it.apply(e,arguments)}function om(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function aj(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function oj(e){return e<0?-e*e:e*e}function lp(e){var t=e(Be,Be),r=1;function n(){return r===1?e(Be,Be):r===.5?e(aj,oj):e(om(r),om(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Ft(t)}function fp(){var e=lp(Za());return e.copy=function(){return xi(e,fp()).exponent(e.exponent())},it.apply(e,arguments),e}function uj(){return fp.apply(null,arguments).exponent(.5)}function um(e){return Math.sign(e)*e*e}function cj(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Ww(){var e=ap(),t=[0,1],r=!1,n;function i(a){var o=cj(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(um(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,ta)).map(um)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Ww(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},it.apply(i,arguments),Ft(i)}function zw(){var e=[],t=[],r=[],n;function i(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[s-1],n[s]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Kw().domain([e,t]).range(i).unknown(a)},it.apply(Ft(o),arguments)}function Hw(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[mi(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Hw().domain(e).range(t).unknown(r)},it.apply(i,arguments)}const Rs=new Date,Ds=new Date;function Pe(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const c=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a0))return c;let s;do c.push(s=new Date(+a)),t(a,u),e(a);while(sPe(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Rs.setTime(+a),Ds.setTime(+o),e(Rs),e(Ds),Math.floor(r(Rs,Ds))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const ia=Pe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ia.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Pe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):ia);ia.range;const St=1e3,rt=St*60,Pt=rt*60,$t=Pt*24,hp=$t*7,cm=$t*30,Ns=$t*365,rr=Pe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*St)},(e,t)=>(t-e)/St,e=>e.getUTCSeconds());rr.range;const pp=Pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*St)},(e,t)=>{e.setTime(+e+t*rt)},(e,t)=>(t-e)/rt,e=>e.getMinutes());pp.range;const dp=Pe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*rt)},(e,t)=>(t-e)/rt,e=>e.getUTCMinutes());dp.range;const vp=Pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*St-e.getMinutes()*rt)},(e,t)=>{e.setTime(+e+t*Pt)},(e,t)=>(t-e)/Pt,e=>e.getHours());vp.range;const yp=Pe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Pt)},(e,t)=>(t-e)/Pt,e=>e.getUTCHours());yp.range;const wi=Pe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*rt)/$t,e=>e.getDate()-1);wi.range;const Ja=Pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$t,e=>e.getUTCDate()-1);Ja.range;const Gw=Pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$t,e=>Math.floor(e/$t));Gw.range;function dr(e){return Pe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*rt)/hp)}const Qa=dr(0),aa=dr(1),sj=dr(2),lj=dr(3),qr=dr(4),fj=dr(5),hj=dr(6);Qa.range;aa.range;sj.range;lj.range;qr.range;fj.range;hj.range;function vr(e){return Pe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/hp)}const eo=vr(0),oa=vr(1),pj=vr(2),dj=vr(3),Lr=vr(4),vj=vr(5),yj=vr(6);eo.range;oa.range;pj.range;dj.range;Lr.range;vj.range;yj.range;const gp=Pe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());gp.range;const mp=Pe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());mp.range;const It=Pe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());It.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});It.range;const Ct=Pe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ct.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Ct.range;function Vw(e,t,r,n,i,a){const o=[[rr,1,St],[rr,5,5*St],[rr,15,15*St],[rr,30,30*St],[a,1,rt],[a,5,5*rt],[a,15,15*rt],[a,30,30*rt],[i,1,Pt],[i,3,3*Pt],[i,6,6*Pt],[i,12,12*Pt],[n,1,$t],[n,2,2*$t],[r,1,hp],[t,1,cm],[t,3,3*cm],[e,1,Ns]];function u(s,f,l){const h=fd).right(o,h);if(p===o.length)return e.every(Sf(s/Ns,f/Ns,l));if(p===0)return ia.every(Math.max(Sf(s,f,l),1));const[y,v]=o[h/o[p-1][2]53)return null;"w"in D||(D.w=1),"Z"in D?(re=Ls(mn(D.y,0,1)),Y=re.getUTCDay(),re=Y>4||Y===0?oa.ceil(re):oa(re),re=Ja.offset(re,(D.V-1)*7),D.y=re.getUTCFullYear(),D.m=re.getUTCMonth(),D.d=re.getUTCDate()+(D.w+6)%7):(re=qs(mn(D.y,0,1)),Y=re.getDay(),re=Y>4||Y===0?aa.ceil(re):aa(re),re=wi.offset(re,(D.V-1)*7),D.y=re.getFullYear(),D.m=re.getMonth(),D.d=re.getDate()+(D.w+6)%7)}else("W"in D||"U"in D)&&("w"in D||(D.w="u"in D?D.u%7:"W"in D?1:0),Y="Z"in D?Ls(mn(D.y,0,1)).getUTCDay():qs(mn(D.y,0,1)).getDay(),D.m=0,D.d="W"in D?(D.w+6)%7+D.W*7-(Y+5)%7:D.w+D.U*7-(Y+6)%7);return"Z"in D?(D.H+=D.Z/100|0,D.M+=D.Z%100,Ls(D)):qs(D)}}function A(F,Q,ee,D){for(var ve=0,re=Q.length,Y=ee.length,ye,Z;ve=Y)return-1;if(ye=Q.charCodeAt(ve++),ye===37){if(ye=Q.charAt(ve++),Z=g[ye in sm?Q.charAt(ve++):ye],!Z||(D=Z(F,ee,D))<0)return-1}else if(ye!=ee.charCodeAt(D++))return-1}return D}function P(F,Q,ee){var D=s.exec(Q.slice(ee));return D?(F.p=f.get(D[0].toLowerCase()),ee+D[0].length):-1}function j(F,Q,ee){var D=p.exec(Q.slice(ee));return D?(F.w=y.get(D[0].toLowerCase()),ee+D[0].length):-1}function T(F,Q,ee){var D=l.exec(Q.slice(ee));return D?(F.w=h.get(D[0].toLowerCase()),ee+D[0].length):-1}function E(F,Q,ee){var D=m.exec(Q.slice(ee));return D?(F.m=x.get(D[0].toLowerCase()),ee+D[0].length):-1}function M(F,Q,ee){var D=v.exec(Q.slice(ee));return D?(F.m=d.get(D[0].toLowerCase()),ee+D[0].length):-1}function I(F,Q,ee){return A(F,t,Q,ee)}function $(F,Q,ee){return A(F,r,Q,ee)}function k(F,Q,ee){return A(F,n,Q,ee)}function R(F){return o[F.getDay()]}function L(F){return a[F.getDay()]}function B(F){return c[F.getMonth()]}function z(F){return u[F.getMonth()]}function H(F){return i[+(F.getHours()>=12)]}function U(F){return 1+~~(F.getMonth()/3)}function G(F){return o[F.getUTCDay()]}function se(F){return a[F.getUTCDay()]}function me(F){return c[F.getUTCMonth()]}function De(F){return u[F.getUTCMonth()]}function wt(F){return i[+(F.getUTCHours()>=12)]}function Ie(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var Q=b(F+="",w);return Q.toString=function(){return F},Q},parse:function(F){var Q=_(F+="",!1);return Q.toString=function(){return F},Q},utcFormat:function(F){var Q=b(F+="",O);return Q.toString=function(){return F},Q},utcParse:function(F){var Q=_(F+="",!0);return Q.toString=function(){return F},Q}}}var sm={"-":"",_:" ",0:"0"},Me=/^\s*\d+/,Oj=/^%/,_j=/[\\^$*+?|[\]().{}]/g;function ie(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function Sj(e,t,r){var n=Me.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Pj(e,t,r){var n=Me.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Tj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Ej(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function jj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function lm(e,t,r){var n=Me.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function fm(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Mj(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function $j(e,t,r){var n=Me.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Ij(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function hm(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Cj(e,t,r){var n=Me.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function pm(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function kj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Rj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Dj(e,t,r){var n=Me.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Nj(e,t,r){var n=Me.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function qj(e,t,r){var n=Oj.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Lj(e,t,r){var n=Me.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Bj(e,t,r){var n=Me.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function dm(e,t){return ie(e.getDate(),t,2)}function Fj(e,t){return ie(e.getHours(),t,2)}function Uj(e,t){return ie(e.getHours()%12||12,t,2)}function Wj(e,t){return ie(1+wi.count(It(e),e),t,3)}function Xw(e,t){return ie(e.getMilliseconds(),t,3)}function zj(e,t){return Xw(e,t)+"000"}function Kj(e,t){return ie(e.getMonth()+1,t,2)}function Hj(e,t){return ie(e.getMinutes(),t,2)}function Gj(e,t){return ie(e.getSeconds(),t,2)}function Vj(e){var t=e.getDay();return t===0?7:t}function Xj(e,t){return ie(Qa.count(It(e)-1,e),t,2)}function Yw(e){var t=e.getDay();return t>=4||t===0?qr(e):qr.ceil(e)}function Yj(e,t){return e=Yw(e),ie(qr.count(It(e),e)+(It(e).getDay()===4),t,2)}function Zj(e){return e.getDay()}function Jj(e,t){return ie(aa.count(It(e)-1,e),t,2)}function Qj(e,t){return ie(e.getFullYear()%100,t,2)}function eM(e,t){return e=Yw(e),ie(e.getFullYear()%100,t,2)}function tM(e,t){return ie(e.getFullYear()%1e4,t,4)}function rM(e,t){var r=e.getDay();return e=r>=4||r===0?qr(e):qr.ceil(e),ie(e.getFullYear()%1e4,t,4)}function nM(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ie(t/60|0,"0",2)+ie(t%60,"0",2)}function vm(e,t){return ie(e.getUTCDate(),t,2)}function iM(e,t){return ie(e.getUTCHours(),t,2)}function aM(e,t){return ie(e.getUTCHours()%12||12,t,2)}function oM(e,t){return ie(1+Ja.count(Ct(e),e),t,3)}function Zw(e,t){return ie(e.getUTCMilliseconds(),t,3)}function uM(e,t){return Zw(e,t)+"000"}function cM(e,t){return ie(e.getUTCMonth()+1,t,2)}function sM(e,t){return ie(e.getUTCMinutes(),t,2)}function lM(e,t){return ie(e.getUTCSeconds(),t,2)}function fM(e){var t=e.getUTCDay();return t===0?7:t}function hM(e,t){return ie(eo.count(Ct(e)-1,e),t,2)}function Jw(e){var t=e.getUTCDay();return t>=4||t===0?Lr(e):Lr.ceil(e)}function pM(e,t){return e=Jw(e),ie(Lr.count(Ct(e),e)+(Ct(e).getUTCDay()===4),t,2)}function dM(e){return e.getUTCDay()}function vM(e,t){return ie(oa.count(Ct(e)-1,e),t,2)}function yM(e,t){return ie(e.getUTCFullYear()%100,t,2)}function gM(e,t){return e=Jw(e),ie(e.getUTCFullYear()%100,t,2)}function mM(e,t){return ie(e.getUTCFullYear()%1e4,t,4)}function bM(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Lr(e):Lr.ceil(e),ie(e.getUTCFullYear()%1e4,t,4)}function xM(){return"+0000"}function ym(){return"%"}function gm(e){return+e}function mm(e){return Math.floor(+e/1e3)}var xr,Qw,eO;wM({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function wM(e){return xr=wj(e),Qw=xr.format,xr.parse,eO=xr.utcFormat,xr.utcParse,xr}function OM(e){return new Date(e)}function _M(e){return e instanceof Date?+e:+new Date(+e)}function bp(e,t,r,n,i,a,o,u,c,s){var f=ap(),l=f.invert,h=f.domain,p=s(".%L"),y=s(":%S"),v=s("%I:%M"),d=s("%I %p"),m=s("%a %d"),x=s("%b %d"),w=s("%B"),O=s("%Y");function g(b){return(c(b)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>uE(e,a/n))},r.copy=function(){return iO(t).domain(e)},Rt.apply(r,arguments)}function ro(){var e=0,t=.5,r=1,n=1,i,a,o,u,c,s=Be,f,l=!1,h;function p(v){return isNaN(v=+v)?h:(v=.5+((v=+f(v))-a)*(n*vr}return Fs=e,Fs}var Us,Om;function EM(){if(Om)return Us;Om=1;var e=no(),t=cO(),r=ln();function n(i){return i&&i.length?e(i,r,t):void 0}return Us=n,Us}var jM=EM();const io=ce(jM);var Ws,_m;function sO(){if(_m)return Ws;_m=1;function e(t,r){return te.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};W.decimalPlaces=W.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*de;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};W.dividedBy=W.div=function(e){return jt(this,new this.constructor(e))};W.dividedToIntegerBy=W.idiv=function(e){var t=this,r=t.constructor;return le(jt(t,new r(e),0,1),r.precision)};W.equals=W.eq=function(e){return!this.cmp(e)};W.exponent=function(){return we(this)};W.greaterThan=W.gt=function(e){return this.cmp(e)>0};W.greaterThanOrEqualTo=W.gte=function(e){return this.cmp(e)>=0};W.isInteger=W.isint=function(){return this.e>this.d.length-2};W.isNegative=W.isneg=function(){return this.s<0};W.isPositive=W.ispos=function(){return this.s>0};W.isZero=function(){return this.s===0};W.lessThan=W.lt=function(e){return this.cmp(e)<0};W.lessThanOrEqualTo=W.lte=function(e){return this.cmp(e)<1};W.logarithm=W.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Ve))throw Error(nt+"NaN");if(r.s<1)throw Error(nt+(r.s?"NaN":"-Infinity"));return r.eq(Ve)?new n(0):(ge=!1,t=jt(Vn(r,a),Vn(e,a),a),ge=!0,le(t,i))};W.minus=W.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?pO(t,e):fO(t,(e.s=-e.s,e))};W.modulo=W.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(nt+"NaN");return r.s?(ge=!1,t=jt(r,e,0,1).times(e),ge=!0,r.minus(t)):le(new n(r),i)};W.naturalExponential=W.exp=function(){return hO(this)};W.naturalLogarithm=W.ln=function(){return Vn(this)};W.negated=W.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};W.plus=W.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?fO(t,e):pO(t,(e.s=-e.s,e))};W.precision=W.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ar+e);if(t=we(i)+1,n=i.d.length-1,r=n*de+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};W.squareRoot=W.sqrt=function(){var e,t,r,n,i,a,o,u=this,c=u.constructor;if(u.s<1){if(!u.s)return new c(0);throw Error(nt+"NaN")}for(e=we(u),ge=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=vt(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=pn((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(a=n,n=a.plus(jt(u,a,o+2)).times(.5),vt(a.d).slice(0,o)===(t=vt(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(le(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;o+=4}return ge=!0,le(n,r)};W.times=W.mul=function(e){var t,r,n,i,a,o,u,c,s,f=this,l=f.constructor,h=f.d,p=(e=new l(e)).d;if(!f.s||!e.s)return new l(0);for(e.s*=f.s,r=f.e+e.e,c=h.length,s=p.length,c=0;){for(t=0,i=c+n;i>n;)u=a[i]+p[n]*h[i-n-1]+t,a[i--]=u%Ee|0,t=u/Ee|0;a[i]=(a[i]+t)%Ee|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,ge?le(e,l.precision):e};W.toDecimalPlaces=W.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(mt(e,0,hn),t===void 0?t=n.rounding:mt(t,0,8),le(r,e+we(r)+1,t))};W.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=lr(n,!0):(mt(e,0,hn),t===void 0?t=i.rounding:mt(t,0,8),n=le(new i(n),e+1,t),r=lr(n,!0,e+1)),r};W.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?lr(i):(mt(e,0,hn),t===void 0?t=a.rounding:mt(t,0,8),n=le(new a(i),e+we(i)+1,t),r=lr(n.abs(),!1,e+we(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};W.toInteger=W.toint=function(){var e=this,t=e.constructor;return le(new t(e),we(e)+1,t.rounding)};W.toNumber=function(){return+this};W.toPower=W.pow=function(e){var t,r,n,i,a,o,u=this,c=u.constructor,s=12,f=+(e=new c(e));if(!e.s)return new c(Ve);if(u=new c(u),!u.s){if(e.s<1)throw Error(nt+"Infinity");return u}if(u.eq(Ve))return u;if(n=c.precision,e.eq(Ve))return le(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=u.s,o){if((r=f<0?-f:f)<=lO){for(i=new c(Ve),t=Math.ceil(n/de+4),ge=!1;r%2&&(i=i.times(u),jm(i.d,t)),r=pn(r/2),r!==0;)u=u.times(u),jm(u.d,t);return ge=!0,e.s<0?new c(Ve).div(i):le(i,n)}}else if(a<0)throw Error(nt+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,ge=!1,i=e.times(Vn(u,n+s)),ge=!0,i=hO(i),i.s=a,i};W.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=we(i),n=lr(i,r<=a.toExpNeg||r>=a.toExpPos)):(mt(e,1,hn),t===void 0?t=a.rounding:mt(t,0,8),i=le(new a(i),e,t),r=we(i),n=lr(i,e<=r||r<=a.toExpNeg,e)),n};W.toSignificantDigits=W.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(mt(e,1,hn),t===void 0?t=n.rounding:mt(t,0,8)),le(new n(r),e,t)};W.toString=W.valueOf=W.val=W.toJSON=W[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=we(e),r=e.constructor;return lr(e,t<=r.toExpNeg||t>=r.toExpPos)};function fO(e,t){var r,n,i,a,o,u,c,s,f=e.constructor,l=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),ge?le(t,l):t;if(c=e.d,s=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(n=c,a=-a,u=s.length):(n=s,i=o,u=c.length),o=Math.ceil(l/de),u=o>u?o+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=c.length,a=s.length,u-a<0&&(a=u,n=s,s=c,c=n),r=0;a;)r=(c[--a]=c[a]+s[a]+r)/Ee|0,c[a]%=Ee;for(r&&(c.unshift(r),++i),u=c.length;c[--u]==0;)c.pop();return t.d=c,t.e=i,ge?le(t,l):t}function mt(e,t,r){if(e!==~~e||er)throw Error(ar+e)}function vt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(u=c=0;ui[u]?1:-1;break}return c}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var u,c,s,f,l,h,p,y,v,d,m,x,w,O,g,b,_,A,P=n.constructor,j=n.s==i.s?1:-1,T=n.d,E=i.d;if(!n.s)return new P(n);if(!i.s)throw Error(nt+"Division by zero");for(c=n.e-i.e,_=E.length,g=T.length,p=new P(j),y=p.d=[],s=0;E[s]==(T[s]||0);)++s;if(E[s]>(T[s]||0)&&--c,a==null?x=a=P.precision:o?x=a+(we(n)-we(i))+1:x=a,x<0)return new P(0);if(x=x/de+2|0,s=0,_==1)for(f=0,E=E[0],x++;(s1&&(E=e(E,f),T=e(T,f),_=E.length,g=T.length),O=_,v=T.slice(0,_),d=v.length;d<_;)v[d++]=0;A=E.slice(),A.unshift(0),b=E[0],E[1]>=Ee/2&&++b;do f=0,u=t(E,v,_,d),u<0?(m=v[0],_!=d&&(m=m*Ee+(v[1]||0)),f=m/b|0,f>1?(f>=Ee&&(f=Ee-1),l=e(E,f),h=l.length,d=v.length,u=t(l,v,h,d),u==1&&(f--,r(l,_16)throw Error(Op+we(e));if(!e.s)return new f(Ve);for(ge=!1,u=l,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),s+=5;for(n=Math.log(Jt(2,s))/Math.LN10*2+5|0,u+=n,r=i=a=new f(Ve),f.precision=u;;){if(i=le(i.times(e),u),r=r.times(++c),o=a.plus(jt(i,r,u)),vt(o.d).slice(0,u)===vt(a.d).slice(0,u)){for(;s--;)a=le(a.times(a),u);return f.precision=l,t==null?(ge=!0,le(a,l)):a}a=o}}function we(e){for(var t=e.e*de,r=e.d[0];r>=10;r/=10)t++;return t}function Vs(e,t,r){if(t>e.LN10.sd())throw ge=!0,r&&(e.precision=r),Error(nt+"LN10 precision limit exceeded");return le(new e(e.LN10),t)}function Nt(e){for(var t="";e--;)t+="0";return t}function Vn(e,t){var r,n,i,a,o,u,c,s,f,l=1,h=10,p=e,y=p.d,v=p.constructor,d=v.precision;if(p.s<1)throw Error(nt+(p.s?"NaN":"-Infinity"));if(p.eq(Ve))return new v(0);if(t==null?(ge=!1,s=d):s=t,p.eq(10))return t==null&&(ge=!0),Vs(v,s);if(s+=h,v.precision=s,r=vt(y),n=r.charAt(0),a=we(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=vt(p.d),n=r.charAt(0),l++;a=we(p),n>1?(p=new v("0."+r),a++):p=new v(n+"."+r.slice(1))}else return c=Vs(v,s+2,d).times(a+""),p=Vn(new v(n+"."+r.slice(1)),s-h).plus(c),v.precision=d,t==null?(ge=!0,le(p,d)):p;for(u=o=p=jt(p.minus(Ve),p.plus(Ve),s),f=le(p.times(p),s),i=3;;){if(o=le(o.times(f),s),c=u.plus(jt(o,new v(i),s)),vt(c.d).slice(0,s)===vt(u.d).slice(0,s))return u=u.times(2),a!==0&&(u=u.plus(Vs(v,s+2,d).times(a+""))),u=jt(u,new v(l),s),v.precision=d,t==null?(ge=!0,le(u,d)):u;u=c,i+=2}}function Em(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=pn(r/de),e.d=[],n=(r+1)%de,r<0&&(n+=de),nua||e.e<-ua))throw Error(Op+r)}else e.s=0,e.e=0,e.d=[0];return e}function le(e,t,r){var n,i,a,o,u,c,s,f,l=e.d;for(o=1,a=l[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=de,i=t,s=l[f=0];else{if(f=Math.ceil((n+1)/de),a=l.length,f>=a)return e;for(s=a=l[f],o=1;a>=10;a/=10)o++;n%=de,i=n-de+o}if(r!==void 0&&(a=Jt(10,o-i-1),u=s/a%10|0,c=t<0||l[f+1]!==void 0||s%a,c=r<4?(u||c)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||c||r==6&&(n>0?i>0?s/Jt(10,o-i):0:l[f-1])%10&1||r==(e.s<0?8:7))),t<1||!l[0])return c?(a=we(e),l.length=1,t=t-a-1,l[0]=Jt(10,(de-t%de)%de),e.e=pn(-t/de)||0):(l.length=1,l[0]=e.e=e.s=0),e;if(n==0?(l.length=f,a=1,f--):(l.length=f+1,a=Jt(10,de-n),l[f]=i>0?(s/Jt(10,o-i)%Jt(10,i)|0)*a:0),c)for(;;)if(f==0){(l[0]+=a)==Ee&&(l[0]=1,++e.e);break}else{if(l[f]+=a,l[f]!=Ee)break;l[f--]=0,a=1}for(n=l.length;l[--n]===0;)l.pop();if(ge&&(e.e>ua||e.e<-ua))throw Error(Op+we(e));return e}function pO(e,t){var r,n,i,a,o,u,c,s,f,l,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),ge?le(t,p):t;if(c=e.d,l=t.d,n=t.e,s=e.e,c=c.slice(),o=s-n,o){for(f=o<0,f?(r=c,o=-o,u=l.length):(r=l,n=s,u=c.length),i=Math.max(Math.ceil(p/de),u)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,u=l.length,f=i0;--i)c[u++]=0;for(i=l.length;i>o;){if(c[--i]