=0?1:-1,s=r>=0?1:-1,u=a>=0&&r>=0||a<0&&r<0?1:0,d;if(o>0&&i instanceof Array){for(var f=[0,0,0,0],h=0,p=4;ho?o:i[h];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+s*f[0],",").concat(n)),d+="L ".concat(t+r-s*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
+ `).concat(t+r,",").concat(n+l*f[1])),d+="L ".concat(t+r,",").concat(n+a-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
+ `).concat(t+r-s*f[2],",").concat(n+a)),d+="L ".concat(t+s*f[3],",").concat(n+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
+ `).concat(t,",").concat(n+a-l*f[3])),d+="Z"}else if(o>0&&i===+i&&i>0){var b=Math.min(o,i);d="M ".concat(t,",").concat(n+l*b,`
+ A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t+s*b,",").concat(n,`
+ L `).concat(t+r-s*b,",").concat(n,`
+ A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*b,`
+ L `).concat(t+r,",").concat(n+a-l*b,`
+ A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t+r-s*b,",").concat(n+a,`
+ L `).concat(t+s*b,",").concat(n+a,`
+ A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t,",").concat(n+a-l*b," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return d},pae=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,i=n.x,o=n.y,l=n.width,s=n.height;if(Math.abs(l)>0&&Math.abs(s)>0){var u=Math.min(i,i+l),d=Math.max(i,i+l),f=Math.min(o,o+s),h=Math.max(o,o+s);return r>=u&&r<=d&&a>=f&&a<=h}return!1},mae={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},c1=function(t){var n=AO(AO({},mae),t),r=O.useRef(),a=O.useState(-1),i=oae(a,2),o=i[0],l=i[1];O.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var S=r.current.getTotalLength();S&&l(S)}catch{}},[]);var s=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,p=n.className,b=n.animationEasing,v=n.animationDuration,x=n.animationBegin,m=n.isAnimationActive,y=n.isUpdateAnimationActive;if(s!==+s||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var g=ve("recharts-rectangle",p);return y?$.createElement(ma,{canBegin:o>0,from:{width:d,height:f,x:s,y:u},to:{width:d,height:f,x:s,y:u},duration:v,animationEasing:b,isActive:y},function(S){var w=S.width,j=S.height,A=S.x,E=S.y;return $.createElement(ma,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:v,isActive:m,easing:b},$.createElement("path",Ch({},oe(n,!0),{className:g,d:EO(A,E,w,j,h),ref:r})))}):$.createElement("path",Ch({},oe(n,!0),{className:g,d:EO(s,u,d,f,h)}))},yae=["points","className","baseLinePoints","connectNulls"];function Vo(){return Vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function _O(e){return wae(e)||Sae(e)||xae(e)||bae()}function bae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xae(e,t){if(e){if(typeof e=="string")return p0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p0(e,t)}}function Sae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wae(e){if(Array.isArray(e))return p0(e)}function p0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){TO(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),TO(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Eu=function(t,n){var r=jae(t);n&&(r=[r.reduce(function(i,o){return[].concat(_O(i),_O(o))},[])]);var a=r.map(function(i){return i.reduce(function(o,l,s){return"".concat(o).concat(s===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},Oae=function(t,n,r){var a=Eu(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Eu(n.reverse(),r).slice(1))},Aae=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=vae(t,yae);if(!n||!n.length)return null;var l=ve("recharts-polygon",r);if(a&&a.length){var s=o.stroke&&o.stroke!=="none",u=Oae(n,a,i);return $.createElement("g",{className:l},$.createElement("path",Vo({},oe(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),s?$.createElement("path",Vo({},oe(o,!0),{fill:"none",d:Eu(n,i)})):null,s?$.createElement("path",Vo({},oe(o,!0),{fill:"none",d:Eu(a,i)})):null)}var d=Eu(n,i);return $.createElement("path",Vo({},oe(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:l,d}))};function m0(){return m0=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Pae=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},$ae=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.top,l=o===void 0?0:o,s=t.left,u=s===void 0?0:s,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,b=t.className,v=Mae(t,Eae),x=_ae({x:r,y:i,top:l,left:u,width:f,height:p},v);return!V(r)||!V(i)||!V(f)||!V(p)||!V(l)||!V(u)?null:$.createElement("path",y0({},oe(x,!0),{className:ve("recharts-cross",b),d:Pae(r,i,f,p,l,u)}))},kae=Wp,Dae=ZM,Lae=fi;function zae(e,t){return e&&e.length?kae(e,Lae(t),Dae):void 0}var Bae=zae;const Iae=qe(Bae);var Uae=Wp,qae=fi,Hae=JM;function Fae(e,t){return e&&e.length?Uae(e,qae(t),Hae):void 0}var Gae=Fae;const Kae=qe(Gae);var Yae=["cx","cy","angle","ticks","axisLine"],Vae=["ticks","tick","angle","tickFormatter","stroke"];function Vl(e){"@babel/helpers - typeof";return Vl=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},Vl(e)}function _u(){return _u=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Qae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RO(e,t){for(var n=0;nkO?o=a==="outer"?"start":"end":i<-kO?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.radius,l=r.axisLine,s=r.axisLineType,u=xi(xi({},oe(this.props,!1)),{},{fill:"none"},oe(l,!1));if(s==="circle")return $.createElement(f1,Ti({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:o}));var d=this.props.ticks,f=d.map(function(h){return Ve(a,i,o,h.coordinate)});return $.createElement(Aae,Ti({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,l=a.tickLine,s=a.tickFormatter,u=a.stroke,d=oe(this.props,!1),f=oe(o,!1),h=xi(xi({},d),{},{fill:"none"},oe(l,!1)),p=i.map(function(b,v){var x=r.getTickLineCoord(b),m=r.getTickTextAnchor(b),y=xi(xi(xi({textAnchor:m},d),{},{stroke:"none",fill:u},f),{},{index:v,payload:b,x:x.x2,y:x.y2});return $.createElement(ke,Ti({className:ve("recharts-polar-angle-axis-tick",E3(o)),key:"tick-".concat(b.coordinate)},lo(r.props,b,v)),l&&$.createElement("line",Ti({className:"recharts-polar-angle-axis-tick-line"},h,x)),o&&t.renderTickItem(o,y,s?s(b.value,v):b.value))});return $.createElement(ke,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,o=r.axisLine;return i<=0||!a||!a.length?null:$.createElement(ke,{className:ve("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return $.isValidElement(r)?o=$.cloneElement(r,a):se(r)?o=r(a):o=$.createElement(so,Ti({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(O.PureComponent);om(lm,"displayName","PolarAngleAxis");om(lm,"axisType","angleAxis");om(lm,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var fie=QC,die=fie(Object.getPrototypeOf,Object),hie=die,pie=va,mie=hie,yie=ga,vie="[object Object]",gie=Function.prototype,bie=Object.prototype,F3=gie.toString,xie=bie.hasOwnProperty,Sie=F3.call(Object);function wie(e){if(!yie(e)||pie(e)!=vie)return!1;var t=mie(e);if(t===null)return!0;var n=xie.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&F3.call(n)==Sie}var jie=wie;const Oie=qe(jie);var Aie=va,Eie=ga,_ie="[object Boolean]";function Tie(e){return e===!0||e===!1||Eie(e)&&Aie(e)==_ie}var Nie=Tie;const Cie=qe(Nie);function gc(e){"@babel/helpers - typeof";return gc=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},gc(e)}function Ph(){return Ph=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:h,x:s,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:s,y:u},duration:v,animationEasing:b,isActive:m},function(g){var S=g.upperWidth,w=g.lowerWidth,j=g.height,A=g.x,E=g.y;return $.createElement(ma,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:v,easing:b},$.createElement("path",Ph({},oe(n,!0),{className:y,d:BO(A,E,S,w,j),ref:r})))}):$.createElement("g",null,$.createElement("path",Ph({},oe(n,!0),{className:y,d:BO(s,u,d,f,h)})))},Uie=["option","shapeType","propTransformer","activeClassName","isActive"];function bc(e){"@babel/helpers - typeof";return bc=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},bc(e)}function qie(e,t){if(e==null)return{};var n=Hie(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Hie(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function IO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $h(e){for(var t=1;t0?Rn(g,"paddingAngle",0):0;if(w){var A=Aa(w.endAngle-w.startAngle,g.endAngle-g.startAngle),E=Ge(Ge({},g),{},{startAngle:y+j,endAngle:y+A(v)+j});x.push(E),y=E.endAngle}else{var _=g.endAngle,N=g.startAngle,D=Aa(0,_-N),R=D(v),B=Ge(Ge({},g),{},{startAngle:y+j,endAngle:y+R+j});x.push(B),y=B.endAngle}}),$.createElement(ke,null,r.renderSectorsStatically(x))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!em(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,i=a.hide,o=a.sectors,l=a.className,s=a.label,u=a.cx,d=a.cy,f=a.innerRadius,h=a.outerRadius,p=a.isAnimationActive,b=this.state.isAnimationFinished;if(i||!o||!o.length||!V(u)||!V(d)||!V(f)||!V(h))return null;var v=ve("recharts-pie",l);return $.createElement(ke,{tabIndex:this.props.rootTabIndex,className:v,ref:function(m){r.pieRef=m}},this.renderSectors(),s&&this.renderLabels(o),Mt.renderCallByParent(this.props,null,!1),(!p||b)&&ri.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r=360?y:y-1)*s,S=x-y*p-g,w=a.reduce(function(E,_){var N=Kt(_,m,0);return E+(V(N)?N:0)},0),j;if(w>0){var A;j=a.map(function(E,_){var N=Kt(E,m,0),D=Kt(E,d,_),R=(V(N)?N:0)/w,B;_?B=A.endAngle+Jt(v)*s*(N!==0?1:0):B=o;var k=B+Jt(v)*((N!==0?p:0)+R*S),C=(B+k)/2,M=(b.innerRadius+b.outerRadius)/2,L=[{name:D,value:N,payload:E,dataKey:m,type:h}],z=Ve(b.cx,b.cy,M,C);return A=Ge(Ge(Ge({percent:R,cornerRadius:i,name:D,tooltipPayload:L,midAngle:C,middleRadius:M,tooltipPosition:z},E),b),{},{value:Kt(E,m),startAngle:B,endAngle:k,payload:E,paddingAngle:Jt(v)*s}),A})}return Ge(Ge({},b),{},{sectors:j,data:a})});var coe=Math.ceil,foe=Math.max;function doe(e,t,n,r){for(var a=-1,i=foe(coe((t-e)/(n||1)),0),o=Array(i);i--;)o[r?i:++a]=e,e+=n;return o}var hoe=doe,poe=pM,FO=1/0,moe=17976931348623157e292;function yoe(e){if(!e)return e===0?e:0;if(e=poe(e),e===FO||e===-FO){var t=e<0?-1:1;return t*moe}return e===e?e:0}var voe=yoe,goe=hoe,boe=Hp,$y=voe;function xoe(e){return function(t,n,r){return r&&typeof r!="number"&&boe(t,n,r)&&(n=r=void 0),t=$y(t),n===void 0?(n=t,t=0):n=$y(n),r=r===void 0?t0&&r.handleDrag(a.changedTouches[0])}),bn(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,i=a.endIndex,o=a.onDragEnd,l=a.startIndex;o==null||o({endIndex:i,startIndex:l})}),r.detachDragEndListener()}),bn(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),bn(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),bn(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),bn(r,"handleSlideDragStart",function(a){var i=XO(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return $oe(t,e),Coe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,i=r.endX,o=this.state.scaleValues,l=this.props,s=l.gap,u=l.data,d=u.length-1,f=Math.min(a,i),h=Math.max(a,i),p=t.getIndexInRange(o,f),b=t.getIndexInRange(o,h);return{startIndex:p-p%s,endIndex:b===d?d:b-b%s}}},{key:"getTextOfTick",value:function(r){var a=this.props,i=a.data,o=a.tickFormatter,l=a.dataKey,s=Kt(i[r],l,r);return se(o)?o(s,r):s}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,i=a.slideMoveStartX,o=a.startX,l=a.endX,s=this.props,u=s.x,d=s.width,f=s.travellerWidth,h=s.startIndex,p=s.endIndex,b=s.onChange,v=r.pageX-i;v>0?v=Math.min(v,u+d-f-l,u+d-f-o):v<0&&(v=Math.max(v,u-o,u-l));var x=this.getIndex({startX:o+v,endX:l+v});(x.startIndex!==h||x.endIndex!==p)&&b&&b(x),this.setState({startX:o+v,endX:l+v,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=XO(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,l=a.endX,s=a.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,b=d.onChange,v=d.gap,x=d.data,m={startX:this.state.startX,endX:this.state.endX},y=r.pageX-i;y>0?y=Math.min(y,f+h-p-u):y<0&&(y=Math.max(y,f-u)),m[o]=u+y;var g=this.getIndex(m),S=g.startIndex,w=g.endIndex,j=function(){var E=x.length-1;return o==="startX"&&(l>s?S%v===0:w%v===0)||ls?w%v===0:S%v===0)||l>s&&w===E};this.setState(bn(bn({},o,u+y),"brushMoveStartX",r.pageX),function(){b&&j()&&b(g)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var i=this,o=this.state,l=o.scaleValues,s=o.startX,u=o.endX,d=this.state[a],f=l.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=l.length)){var p=l[h];a==="startX"&&p>=u||a==="endX"&&p<=s||this.setState(bn({},a,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,l=r.height,s=r.fill,u=r.stroke;return $.createElement("rect",{stroke:u,fill:s,x:a,y:i,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,l=r.height,s=r.data,u=r.children,d=r.padding,f=O.Children.only(u);return f?$.cloneElement(f,{x:a,y:i,width:o,height:l,margin:d,compact:!0,data:s}):null}},{key:"renderTravellerLayer",value:function(r,a){var i,o,l=this,s=this.props,u=s.y,d=s.travellerWidth,f=s.height,h=s.traveller,p=s.ariaLabel,b=s.data,v=s.startIndex,x=s.endIndex,m=Math.max(r,this.props.x),y=ky(ky({},oe(this.props,!1)),{},{x:m,y:u,width:d,height:f}),g=p||"Min value: ".concat((i=b[v])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=b[x])===null||o===void 0?void 0:o.name);return $.createElement(ke,{tabIndex:0,role:"slider","aria-label":g,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),l.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,y))}},{key:"renderSlide",value:function(r,a){var i=this.props,o=i.y,l=i.height,s=i.stroke,u=i.travellerWidth,d=Math.min(r,a)+u,f=Math.max(Math.abs(a-r)-u,0);return $.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:s,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,i=r.endIndex,o=r.y,l=r.height,s=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,h=d.endX,p=5,b={pointerEvents:"none",fill:u};return $.createElement(ke,{className:"recharts-brush-texts"},$.createElement(so,Lh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+l/2},b),this.getTextOfTick(a)),$.createElement(so,Lh({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+s+p,y:o+l/2},b),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,a=r.data,i=r.className,o=r.children,l=r.x,s=r.y,u=r.width,d=r.height,f=r.alwaysShowText,h=this.state,p=h.startX,b=h.endX,v=h.isTextActive,x=h.isSlideMoving,m=h.isTravellerMoving,y=h.isTravellerFocused;if(!a||!a.length||!V(l)||!V(s)||!V(u)||!V(d)||u<=0||d<=0)return null;var g=ve("recharts-brush",i),S=$.Children.count(o)===1,w=Toe("userSelect","none");return $.createElement(ke,{className:g,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,b),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(b,"endX"),(v||x||m||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,i=r.y,o=r.width,l=r.height,s=r.stroke,u=Math.floor(i+l/2)-1;return $.createElement($.Fragment,null,$.createElement("rect",{x:a,y:i,width:o,height:l,fill:s,stroke:"none"}),$.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),$.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var i;return $.isValidElement(r)?i=$.cloneElement(r,a):se(r)?i=r(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(r,a){var i=r.data,o=r.width,l=r.x,s=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return ky({prevData:i,prevTravellerWidth:s,prevUpdateId:u,prevX:l,prevWidth:o},i&&i.length?Doe({data:i,width:o,x:l,travellerWidth:s,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||l!==a.prevX||s!==a.prevTravellerWidth)){a.scale.range([l,l+o-s]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:i,prevTravellerWidth:s,prevUpdateId:u,prevX:l,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,a){for(var i=r.length,o=0,l=i-1;l-o>1;){var s=Math.floor((o+l)/2);r[s]>a?l=s:o=s}return a>=r[l]?l:o}}])}(O.PureComponent);bn(Zl,"displayName","Brush");bn(Zl,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Loe=Dx;function zoe(e,t){var n;return Loe(e,function(r,a,i){return n=t(r,a,i),!n}),!!n}var Boe=zoe,Ioe=qC,Uoe=fi,qoe=Boe,Hoe=vn,Foe=Hp;function Goe(e,t,n){var r=Hoe(e)?Ioe:qoe;return n&&Foe(e,t,n)&&(t=void 0),r(e,Uoe(t))}var Koe=Goe;const Yoe=qe(Koe);var Er=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},QO=uM;function Voe(e,t,n){t=="__proto__"&&QO?QO(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Xoe=Voe,Qoe=Xoe,Woe=lM,Zoe=fi;function Joe(e,t){var n={};return t=Zoe(t),Woe(e,function(r,a,i){Qoe(n,a,t(r,a,i))}),n}var ele=Joe;const tle=qe(ele);function nle(e,t){for(var n=-1,r=e==null?0:e.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xle(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Sle(e,t){var n=e.x,r=e.y,a=ble(e,mle),i="".concat(n),o=parseInt(i,10),l="".concat(r),s=parseInt(l,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),h=parseInt(f,10);return eu(eu(eu(eu(eu({},t),a),o?{x:o}:{}),s?{y:s}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function ZO(e){return $.createElement(G3,S0({shapeType:"rectangle",propTransformer:Sle,activeClassName:"recharts-active-bar"},e))}var wle=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var i=V(r)||UU(r);return i?t(r,a):(i||co(),n)}},jle=["value","background"],W3;function Jl(e){"@babel/helpers - typeof";return Jl=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},Jl(e)}function Ole(e,t){if(e==null)return{};var n=Ale(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ale(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Bh(){return Bh=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(C)0&&Math.abs(k)0&&(B=Math.min((me||0)-(k[Le-1]||0),B))}),Number.isFinite(B)){var C=B/R,M=v.layout==="vertical"?r.height:r.width;if(v.padding==="gap"&&(A=C*M/2),v.padding==="no-gap"){var L=en(t.barCategoryGap,C*M),z=C*M/2;A=z-L-(z-L)/M*L}}}a==="xAxis"?E=[r.left+(g.left||0)+(A||0),r.left+r.width-(g.right||0)-(A||0)]:a==="yAxis"?E=s==="horizontal"?[r.top+r.height-(g.bottom||0),r.top+(g.top||0)]:[r.top+(g.top||0)+(A||0),r.top+r.height-(g.bottom||0)-(A||0)]:E=v.range,w&&(E=[E[1],E[0]]);var F=b3(v,i,h),K=F.scale,G=F.realScaleType;K.domain(m).range(E),x3(K);var Y=S3(K,ur(ur({},v),{},{realScaleType:G}));a==="xAxis"?(D=x==="top"&&!S||x==="bottom"&&S,_=r.left,N=f[j]-D*v.height):a==="yAxis"&&(D=x==="left"&&!S||x==="right"&&S,_=f[j]-D*v.width,N=r.top);var J=ur(ur(ur({},v),Y),{},{realScaleType:G,x:_,y:N,scale:K,width:a==="xAxis"?r.width:v.width,height:a==="yAxis"?r.height:v.height});return J.bandSize=jh(J,Y),!v.hide&&a==="xAxis"?f[j]+=(D?-1:1)*J.height:v.hide||(f[j]+=(D?-1:1)*J.width),ur(ur({},p),{},cm({},b,J))},{})},tR=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return{x:Math.min(r,i),y:Math.min(a,o),width:Math.abs(i-r),height:Math.abs(o-a)}},Lle=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return tR({x:n,y:r},{x:a,y:i})},nR=function(){function e(t){Ple(this,e),this.scale=t}return $le(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(a){var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],i=r[r.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])}();cm(nR,"EPS",1e-4);var d1=function(t){var n=Object.keys(t).reduce(function(r,a){return ur(ur({},r),{},cm({},a,nR.create(t[a])))},{});return ur(ur({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,l=i.position;return tle(a,function(s,u){return n[u].apply(s,{bandAware:o,position:l})})},isInRange:function(a){return ple(a,function(i,o){return n[o].isInRange(i)})}})};function zle(e){return(e%180+180)%180}var Ble=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=zle(a),o=i*Math.PI/180,l=Math.atan(r/n),s=o>l&&oe.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*a)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-a)<=0}function Ese(e,t){return bR(e,t+1)}function _se(e,t,n,r,a){for(var i=(r||[]).slice(),o=t.start,l=t.end,s=0,u=1,d=o,f=function(){var b=r==null?void 0:r[s];if(b===void 0)return{v:bR(r,u)};var v=s,x,m=function(){return x===void 0&&(x=n(b,v)),x},y=b.coordinate,g=s===0||Fh(e,y,m,d,l);g||(s=0,d=o,u+=1),g&&(d=y+e*(m()/2+a),s+=u)},h;u<=i.length;)if(h=f(),h)return h.v;return[]}function Oc(e){"@babel/helpers - typeof";return Oc=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},Oc(e)}function fA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Gt(e){for(var t=1;t0?p.coordinate-x*e:p.coordinate})}else i[h]=p=Gt(Gt({},p),{},{tickCoord:p.coordinate});var m=Fh(e,p.tickCoord,v,l,s);m&&(s=p.tickCoord-e*(v()/2+a),i[h]=Gt(Gt({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return i}function Rse(e,t,n,r,a,i){var o=(r||[]).slice(),l=o.length,s=t.start,u=t.end;if(i){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-u);o[l-1]=d=Gt(Gt({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=Fh(e,d.tickCoord,function(){return f},s,u);p&&(u=d.tickCoord-e*(f/2+a),o[l-1]=Gt(Gt({},d),{},{isShow:!0}))}for(var b=i?l-1:l,v=function(y){var g=o[y],S,w=function(){return S===void 0&&(S=n(g,y)),S};if(y===0){var j=e*(g.coordinate-e*w()/2-s);o[y]=g=Gt(Gt({},g),{},{tickCoord:j<0?g.coordinate-j*e:g.coordinate})}else o[y]=g=Gt(Gt({},g),{},{tickCoord:g.coordinate});var A=Fh(e,g.tickCoord,w,s,u);A&&(s=g.tickCoord+e*(w()/2+a),o[y]=Gt(Gt({},g),{},{isShow:!0}))},x=0;x=2?Jt(a[1].coordinate-a[0].coordinate):1,m=Ase(i,x,p);return s==="equidistantPreserveStart"?_se(x,m,v,a,o):(s==="preserveStart"||s==="preserveStartEnd"?h=Rse(x,m,v,a,o,s==="preserveStartEnd"):h=Mse(x,m,v,a,o),h.filter(function(y){return y.isShow}))}var $se=["viewBox"],kse=["viewBox"],Dse=["ticks"];function rs(e){"@babel/helpers - typeof";return rs=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},rs(e)}function Qo(){return Qo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Lse(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function zse(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hA(e,t){for(var n=0;n0?s(this.props):s(p)),o<=0||l<=0||!b||!b.length?null:$.createElement(ke,{className:ve("recharts-cartesian-axis",u),ref:function(x){r.layerReference=x}},i&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),Mt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,l=ve(a.className,"recharts-cartesian-axis-tick-value");return $.isValidElement(r)?o=$.cloneElement(r,xt(xt({},a),{},{className:l})):se(r)?o=r(xt(xt({},a),{},{className:l})):o=$.createElement(so,Qo({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(O.Component);m1(mm,"displayName","CartesianAxis");m1(mm,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});function as(e){"@babel/helpers - typeof";return as=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},as(e)}function Gse(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kse(e,t){for(var n=0;n