Files
2026-08-26 16:31:12 -04:00

2 lines
17 KiB
JavaScript

import{r as o}from"./index-kE4_6-nI.js";import{N as R,a1 as L,aw as Q,F as X,ax as Y,ay as ye,Z as $,H as B,O as z,L as J,a4 as fe,az as he,aA as T,ai as _,aj as ge,aB as xe,c as F,q as ee,aC as Pe,aD as te,aE as ae,aF as be,aG as Ie,aH as G,aI as Ae,E as ne,aJ as Oe,aK as re,G as Ee,aL as De,aM as we,Q as D,A as ie,V as je,aN as Ne,aO as Se,aP as Le,aQ as Ce,aR as ke,aS as Te,j as oe,aT as U,W as Ke,$ as We,ae as Re,aU as $e,aV as Be,ad as ze,aW as Fe,av as Ve}from"./BarChart-DxUPBeMP.js";function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},K.apply(null,arguments)}var le=e=>{var t=e.cx,n=e.cy,a=e.r,r=e.className,i=R("recharts-dot",r);return L(t)&&L(n)&&L(a)?o.createElement("circle",K({},X(e),Q(e),{className:i,cx:t,cy:n,r:a})):null},Me=["points"];function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H(Object(n),!0).forEach(function(a){Ge(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function Ge(e,t,n){return(t=Ue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ue(e){var t=He(e,"string");return typeof t=="symbol"?t:t+""}function He(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},w.apply(null,arguments)}function Ze(e,t){if(e==null)return{};var n,a,r=qe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qe(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;n[a]=e[a]}return n}function Qe(e){var t=e.option,n=e.dotProps,a=e.className;if(o.isValidElement(t))return o.cloneElement(t,n);if(typeof t=="function")return t(n);var r=R(a,typeof t!="boolean"?t.className:""),i=n??{};i.points;var l=Ze(i,Me);return o.createElement(le,w({},l,{className:r}))}function Xe(e,t){return e==null?!1:t?!0:e.length===1}function Ye(e){var t=e.points,n=e.dot,a=e.className,r=e.dotClassName,i=e.dataKey,l=e.baseProps,s=e.needClip,u=e.clipPathId,c=e.zIndex,v=c===void 0?B.scatter:c;if(!Xe(t,n))return null;var p=Y(n),y=ye(n),d=t.map((f,h)=>{var x,I,g=C(C(C({r:3},l),y),{},{index:h,cx:(x=f.x)!==null&&x!==void 0?x:void 0,cy:(I=f.y)!==null&&I!==void 0?I:void 0,dataKey:i,value:f.value,payload:f.payload,points:t});return o.createElement(Qe,{key:"dot-".concat(h),option:n,dotProps:g,className:r})}),m={};return s&&u!=null&&(m.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(u,")")),o.createElement($,{zIndex:v},o.createElement(z,w({className:a},m),d))}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Z(Object(n),!0).forEach(function(a){Je(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function Je(e,t,n){return(t=_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _e(e){var t=et(e,"string");return typeof t=="symbol"?t:t+""}function et(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tt=e=>{var t=e.point,n=e.childIndex,a=e.mainColor,r=e.activeDot,i=e.dataKey,l=e.clipPath;if(r===!1||t.x==null||t.y==null)return null;var s={index:n,dataKey:i,cx:t.x,cy:t.y,r:4,fill:a??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},u=k(k(k({},s),_(r)),Q(r)),c;return o.isValidElement(r)?c=o.cloneElement(r,u):typeof r=="function"?c=r(u):c=o.createElement(le,u),o.createElement(z,{className:"recharts-active-dot",clipPath:l},c)};function at(e){var t=e.points,n=e.mainColor,a=e.activeDot,r=e.itemDataKey,i=e.clipPath,l=e.zIndex,s=l===void 0?B.activeDot:l,u=J(fe),c=he();if(t==null||c==null)return null;var v=t.find(p=>c.includes(p.payload));return T(v)?null:o.createElement($,{zIndex:s},o.createElement(tt,{point:v,childIndex:Number(u),mainColor:n,dataKey:r,activeDot:a,clipPath:i}))}var nt=["animationElapsedTime","isAnimating","isEntrance","visibleLength","strokeDasharray","connectNulls"];function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},W.apply(null,arguments)}function rt(e,t){if(e==null)return{};var n,a,r=it(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function it(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;n[a]=e[a]}return n}function ot(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function se(e,t){return"".concat(t,"px ").concat(e,"px")}function lt(e){return e.length%2!==0?[...e,...e]:e}function st(e,t){for(var n=[],a=0;a<t;++a)n.push(...e);return n}function ut(e,t,n){var a=lt(n),r=a.reduce((d,m)=>d+m,0);if(!r)return se(t,e);for(var i=Math.floor(e/r),l=e%r,s=[],u=0,c=0;u<a.length;c+=(v=a[u])!==null&&v!==void 0?v:0,++u){var v,p=a[u];if(p!=null&&c+p>l){s=[...a.slice(0,u),l-c];break}}var y=s.length%2===0?[0,t]:[t];return[...st(a,i),...s,...y].map(d=>"".concat(d,"px")).join(", ")}function ct(e,t,n){if(e){var a="".concat(e).split(/[,\s]+/gim).map(r=>parseFloat(r));return ut(n,t,a)}return se(t,n)}function dt(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,a=e.connectNulls,r=rt(e,nt),i=a??!1,l;if(t!=null){var s,u=r.pathRef,c=ot((s=u?.current)!==null&&s!==void 0?s:null);l=ct(n,c,t)}else n!=null&&(l=String(n));return o.createElement(ge,W({},r,{connectNulls:i,strokeDasharray:l}))}function pt(e){var t=o.useRef(0),n=o.useRef(0),a=o.useRef(!1),r=o.useRef(e);return r.current!==e&&(t.current=n.current,r.current=e),o.useCallback((i,l)=>{if(a.current)return null;var s=Math.min(xe(t.current+i*l),l);return i>0&&l>0&&(n.current=Math.max(n.current,s),s>=l)?(a.current=!0,null):s},[])}var ue=(e,t,n,a)=>te(e,"xAxis",t,a),ce=(e,t,n,a)=>ae(e,"xAxis",t,a),de=(e,t,n,a)=>te(e,"yAxis",n,a),pe=(e,t,n,a)=>ae(e,"yAxis",n,a),vt=F([ee,ue,de,ce,pe],(e,t,n,a,r)=>Ie(e,"xAxis")?G(t,a,!1):G(n,r,!1)),mt=(e,t,n,a,r)=>r;function yt(e){return e.type==="line"}var ft=F([be,mt],(e,t)=>e.filter(yt).find(n=>n.id===t)),ht=F([ee,ue,de,ce,pe,ft,vt,Pe],(e,t,n,a,r,i,l,s)=>{var u=s.chartData,c=s.dataStartIndex,v=s.dataEndIndex;if(!(i==null||t==null||n==null||a==null||r==null||a.length===0||r.length===0||l==null||e!=="horizontal"&&e!=="vertical")){var p=i.dataKey,y=i.data,d;if(y!=null&&y.length>0?d=y:d=u?.slice(c,v+1),d!=null)return Bt({layout:e,xAxis:t,yAxis:n,xAxisTicks:a,yAxisTicks:r,dataKey:p,bandSize:l,displayedData:d})}});function gt(e){var t=_(e),n=3,a=2;if(t!=null){var r=t.r,i=t.strokeWidth,l=Number(r),s=Number(i);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(s)||s<0)&&(s=a),{r:l,strokeWidth:s}}return{r:n,strokeWidth:a}}var xt=["id"],Pt=["type","layout","connectNulls","needClip","shape","strokeDasharray"],bt=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},j.apply(null,arguments)}function V(e,t){if(e==null)return{};var n,a,r=It(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function It(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;n[a]=e[a]}return n}function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q(Object(n),!0).forEach(function(a){At(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function At(e,t,n){return(t=Ot(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ot(e){var t=Et(e,"string");return typeof t=="symbol"?t:t+""}function Et(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dt(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function wt(e){var t=0,n=0;for(var a of e)a.status==="matched"&&a.prev.x!=null&&a.next.x!=null&&(t+=a.next.x-a.prev.x,n++);return n>0?t/n:0}var jt=(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(s=>s.status==="removed"?[]:[s.next]);var n=wt(e),a=[];for(var r of e)if(r.status==="matched")a.push(b(b({},r.next),{},{x:D(r.prev.x,r.next.x,t),y:D(r.prev.y,r.next.y,t)}));else if(r.status==="added")if(r.next.x!=null){var i=r.next.x-n;a.push(b(b({},r.next),{},{x:D(i,r.next.x,t),y:r.next.y}))}else a.push(r.next);else if(r.status==="removed"&&r.prev.x!=null){var l=r.prev.x+n;a.push(b(b({},r.prev),{},{x:D(r.prev.x,l,t),y:r.prev.y}))}return a},M={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:jt,animationMatchBy:Oe,connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",shape:dt,stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:B.line,type:"linear"},Nt=e=>{var t=e.dataKey,n=e.name,a=e.stroke,r=e.legendType,i=e.hide;return[{inactive:i,dataKey:t,type:r,color:a,value:ie(n,t),payload:e}]},St=o.memo(e=>{var t=e.dataKey,n=e.data,a=e.stroke,r=e.strokeWidth,i=e.fill,l=e.name,s=e.hide,u=e.unit,c=e.formatter,v=e.tooltipType,p=e.id,y={dataDefinedOnItem:n,getPosition:Ne,settings:{stroke:a,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:ie(l,t),hide:s,type:v,color:a,unit:u,formatter:c,graphicalItemId:p}};return o.createElement(je,{tooltipEntrySettings:y})});function Lt(e){var t=e.clipPathId,n=e.points,a=e.props,r=a.dot,i=a.dataKey,l=a.needClip;a.id;var s=V(a,xt),u=X(s);return o.createElement(Ye,{points:n,dot:r,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:i,baseProps:u,needClip:l,clipPathId:t})}function Ct(e){var t=e.showLabels,n=e.children,a=e.points,r=o.useMemo(()=>a?.map(i=>{var l,s,u={x:(l=i.x)!==null&&l!==void 0?l:0,y:(s=i.y)!==null&&s!==void 0?s:0,width:0,lowerWidth:0,upperWidth:0,height:0};return b(b({},u),{},{value:i.value,payload:i.payload,viewBox:u,parentViewBox:void 0,fill:void 0})}),[a]);return o.createElement($e,{value:t?r:void 0},n)}function kt(e){var t=e.clipPathId,n=e.pathRef,a=e.points,r=e.props,i=e.animationElapsedTime,l=e.isAnimating,s=e.isEntrance,u=e.visibleLength,c=r.type,v=r.layout,p=r.connectNulls,y=r.needClip,d=r.shape,m=r.strokeDasharray,f=V(r,Pt),h=b(b({},Be(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:y?"url(#clipPath-".concat(t,")"):void 0,points:a,type:c,layout:v,connectNulls:p,strokeDasharray:m??r.strokeDasharray,pathRef:n,animationElapsedTime:i,isAnimating:l,isEntrance:r.animateNewValues?s:!1,visibleLength:u});return o.createElement(o.Fragment,null,a?.length>1&&o.createElement(ze,{option:d,DefaultShape:M.shape,shapeProps:h}),o.createElement(Lt,{points:a,clipPathId:t,props:r}))}function Tt(e){var t=e.clipPathId,n=e.props,a=e.pathRef,r=e.previousPointsRef,i=n.points,l=n.isAnimationActive,s=n.animationBegin,u=n.animationDuration,c=n.animationEasing,v=n.animationMatchBy,p=n.animationInterpolateFn,y=n.layout,d=Dt(a.current),m=Ke(n.onAnimationStart,n.onAnimationEnd),f=m.isAnimating,h=m.handleAnimationStart,x=m.handleAnimationEnd,I=!f,g=pt(i),A=o.useCallback(P=>P>0&&d>0,[d]);return o.createElement(Ct,{points:i,showLabels:I},n.children,o.createElement(We,{animationInput:i,animationIdPrefix:"recharts-line-",items:i,previousItemsRef:r,isAnimationActive:l,animationBegin:s,animationDuration:u,animationEasing:c,onAnimationStart:h,onAnimationEnd:x,animationInterpolateFn:p,animationMatchBy:v,shouldUpdatePreviousRef:A,layout:y},(P,O,N)=>{var E=f||O<1,S=E?g(O,d):null;return o.createElement(kt,{props:n,points:P,clipPathId:t,pathRef:a,animationElapsedTime:O,isAnimating:E,isEntrance:N,visibleLength:S})}),o.createElement(Re,{label:n.label}))}function Kt(e){var t=e.clipPathId,n=e.props,a=o.useRef(null),r=o.useRef(null);return o.createElement(Tt,{props:n,clipPathId:t,previousPointsRef:a,pathRef:r})}var Wt=(e,t)=>{var n,a;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(a=e.y)!==null&&a!==void 0?a:void 0,value:e.value,errorVal:oe(e.payload,t)}};class Rt extends o.Component{render(){var t=this.props,n=t.hide,a=t.dot,r=t.points,i=t.className,l=t.xAxisId,s=t.yAxisId,u=t.top,c=t.left,v=t.width,p=t.height,y=t.id,d=t.needClip,m=t.zIndex;if(n)return null;var f=R("recharts-line",i),h=y,x=gt(a),I=x.r,g=x.strokeWidth,A=Y(a),P=I*2+g,O=d?"url(#clipPath-".concat(A?"":"dots-").concat(h,")"):void 0;return o.createElement($,{zIndex:m},o.createElement(z,{className:f},d&&o.createElement("defs",null,o.createElement(ke,{clipPathId:h,xAxisId:l,yAxisId:s}),!A&&o.createElement("clipPath",{id:"clipPath-dots-".concat(h)},o.createElement("rect",{x:c-P/2,y:u-P/2,width:v+P,height:p+P}))),o.createElement(Te,{xAxisId:l,yAxisId:s,data:r,dataPointFormatter:Wt,errorBarOffset:0},o.createElement(Kt,{props:this.props,clipPathId:h}))),o.createElement(at,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:O}))}}function $t(e){var t=ne(e,M),n=t.activeDot,a=t.animateNewValues,r=t.animationBegin,i=t.animationDuration,l=t.animationEasing,s=t.connectNulls,u=t.dot,c=t.hide,v=t.isAnimationActive,p=t.label,y=t.legendType,d=t.xAxisId,m=t.yAxisId,f=t.id,h=V(t,bt),x=Se(d,m),I=x.needClip,g=Le(),A=Ce(),P=re(),O=J(me=>ht(me,d,m,P,f));if(A!=="horizontal"&&A!=="vertical"||O==null||g==null)return null;var N=g.height,E=g.width,S=g.x,ve=g.y;return o.createElement(Rt,j({},h,{id:f,connectNulls:s,dot:u,activeDot:n,animateNewValues:a,animationBegin:r,animationDuration:i,animationEasing:l,isAnimationActive:v,hide:c,label:p,legendType:y,xAxisId:d,yAxisId:m,points:O,layout:A,height:N,width:E,left:S,top:ve,needClip:I}))}function Bt(e){var t=e.layout,n=e.xAxis,a=e.yAxis,r=e.xAxisTicks,i=e.yAxisTicks,l=e.dataKey,s=e.bandSize,u=e.displayedData;return u.map((c,v)=>{var p=oe(c,l);if(t==="horizontal"){var y=U({axis:n,ticks:r,bandSize:s,entry:c,index:v}),d=T(p)?null:a.scale.map(p);return{x:y,y:d??null,value:p,payload:c}}var m=T(p)?null:n.scale.map(p),f=U({axis:a,ticks:i,bandSize:s,entry:c,index:v});return m==null||f==null?null:{x:m,y:f,value:p,payload:c}}).filter(Boolean)}function zt(e){var t=ne(e,M),n=re();return o.createElement(Ee,{id:t.id,type:"line"},a=>o.createElement(o.Fragment,null,o.createElement(De,{legendPayload:Nt(t)}),o.createElement(St,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:a}),o.createElement(we,{type:"line",id:a,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),o.createElement($t,j({},t,{id:a}))))}var Ft=o.memo(zt,Ae);Ft.displayName="Line";var Vt=["axis"],Ut=o.forwardRef((e,t)=>o.createElement(Fe,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Vt,tooltipPayloadSearcher:Ve,categoricalChartProps:e,ref:t}));export{Ut as L,Ft as a};