@ww-ai-lab/openclaw-office 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -3
- package/README.zh.md +18 -3
- package/dist/assets/{ActivityHeatmap-BBam6E0n.js → ActivityHeatmap-tMKuM1UM.js} +1 -1
- package/dist/assets/{CostPieChart-DAWcMLAM.js → CostPieChart-7a55pRVP.js} +1 -1
- package/dist/assets/{NetworkGraph-C7bId4Qo.js → NetworkGraph-Dh-5R6Yt.js} +1 -1
- package/dist/assets/{Scene3D-CUH0kBa1.js → Scene3D-Ds6Ko60O.js} +1 -1
- package/dist/assets/{TokenLineChart-CoV2eBb4.js → TokenLineChart-DY_YXiO5.js} +1 -1
- package/dist/assets/{generateCategoricalChart-3d0tNdH3.js → generateCategoricalChart-K9WHzrHy.js} +1 -1
- package/dist/assets/{index-DNKPM7x5.js → index-CsSAduQA.js} +99 -94
- package/dist/assets/index-Df0vkxXq.css +1 -0
- package/dist/assets/{ws-adapter-sYZJya-9.js → ws-adapter-LktCvqUH.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/index-CLdO2Rfn.css +0 -1
package/README.md
CHANGED
|
@@ -98,13 +98,28 @@ npm install -g @ww-ai-lab/openclaw-office
|
|
|
98
98
|
openclaw-office
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
### Gateway Token Auto-Detection
|
|
102
|
+
|
|
103
|
+
If [OpenClaw](https://github.com/openclaw/openclaw) is installed locally, the Gateway auth token is **automatically detected** from `~/.openclaw/openclaw.json` — no manual configuration needed.
|
|
104
|
+
|
|
105
|
+
You can also provide the token explicitly:
|
|
102
106
|
|
|
103
107
|
```bash
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
openclaw-office --token <your-gateway-token>
|
|
109
|
+
# or via environment variable
|
|
110
|
+
OPENCLAW_GATEWAY_TOKEN=<token> openclaw-office
|
|
106
111
|
```
|
|
107
112
|
|
|
113
|
+
### CLI Options
|
|
114
|
+
|
|
115
|
+
| Flag | Description | Default |
|
|
116
|
+
|------|-------------|---------|
|
|
117
|
+
| `-t, --token <token>` | Gateway auth token | auto-detected |
|
|
118
|
+
| `-g, --gateway <url>` | Gateway WebSocket URL | `ws://localhost:18789` |
|
|
119
|
+
| `-p, --port <port>` | Server port | `5180` |
|
|
120
|
+
| `--host <host>` | Bind address | `0.0.0.0` |
|
|
121
|
+
| `-h, --help` | Show help | — |
|
|
122
|
+
|
|
108
123
|
> **Note:** This serves the pre-built production bundle. For development with hot reload, see [Development](#development) below.
|
|
109
124
|
|
|
110
125
|
---
|
package/README.zh.md
CHANGED
|
@@ -98,13 +98,28 @@ npm install -g @ww-ai-lab/openclaw-office
|
|
|
98
98
|
openclaw-office
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
### Gateway Token 自动检测
|
|
102
|
+
|
|
103
|
+
如果本地已安装 [OpenClaw](https://github.com/openclaw/openclaw),Gateway 认证 token 会从 `~/.openclaw/openclaw.json` **自动读取**,无需手动配置。
|
|
104
|
+
|
|
105
|
+
也可以手动指定 token:
|
|
102
106
|
|
|
103
107
|
```bash
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
openclaw-office --token <你的-gateway-token>
|
|
109
|
+
# 或通过环境变量
|
|
110
|
+
OPENCLAW_GATEWAY_TOKEN=<token> openclaw-office
|
|
106
111
|
```
|
|
107
112
|
|
|
113
|
+
### CLI 参数
|
|
114
|
+
|
|
115
|
+
| 参数 | 说明 | 默认值 |
|
|
116
|
+
|------|------|--------|
|
|
117
|
+
| `-t, --token <token>` | Gateway 认证 token | 自动检测 |
|
|
118
|
+
| `-g, --gateway <url>` | Gateway WebSocket 地址 | `ws://localhost:18789` |
|
|
119
|
+
| `-p, --port <port>` | 服务端口 | `5180` |
|
|
120
|
+
| `--host <host>` | 绑定地址 | `0.0.0.0` |
|
|
121
|
+
| `-h, --help` | 显示帮助 | — |
|
|
122
|
+
|
|
108
123
|
> **说明:** 此方式运行的是预构建的生产版本。如需热重载开发,请参见下方 [开发](#开发) 部分。
|
|
109
124
|
|
|
110
125
|
---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as H,h as v,d as b,j as r}from"./index-
|
|
1
|
+
import{u as H,h as v,d as b,j as r}from"./index-CsSAduQA.js";const N=10,d=24,x=10,u=14,w=[{max:0,color:"#f3f4f6"},{max:5,color:"#bbf7d0"},{max:10,color:"#4ade80"},{max:1/0,color:"#16a34a"}],D=[{max:0,color:"#1e293b"},{max:5,color:"#14532d"},{max:10,color:"#166534"},{max:1/0,color:"#22c55e"}];function E(c,i){const l=i?D:w;for(const s of l)if(c<=s.max)return s.color;return l[l.length-1].color}function M(c){const i=Date.now(),l=3600*1e3,s=new Map;for(const t of c){const a=t.timestamp,n=(i-a)/l;if(n<0||n>=d)continue;const m=23-Math.min(23,Math.floor(n));let o=s.get(t.agentId);o||(o={name:t.agentName,counts:Array.from({length:d},()=>0)},s.set(t.agentId,o)),m>=0&&m<d&&o.counts[m]++}return Array.from(s.entries()).map(([t,{name:a,counts:n}])=>({agentId:t,agentName:a,counts:n})).toSorted((t,a)=>{const n=t.counts.reduce((o,e)=>o+e,0);return a.counts.reduce((o,e)=>o+e,0)-n}).slice(0,N)}function O(){const{t:c}=H("panels"),i=v(e=>e.eventHistory),s=v(e=>e.theme)==="dark",[t,a]=b.useState(null),n=b.useMemo(()=>M(i),[i]);if(n.length===0)return r.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-gray-500 dark:text-gray-400",children:c("common:empty.noActivityData")});const m=Date.now(),o=3600*1e3;return r.jsxs("div",{className:"relative",children:[r.jsx("svg",{width:d*x+60,height:N*u+24,className:"overflow-visible",children:n.map((e,f)=>r.jsxs("g",{children:[r.jsx("text",{x:0,y:f*u+u/2+4,fontSize:9,fill:s?"#e2e8f0":"#374151",children:e.agentName.length>10?`${e.agentName.slice(0,8)}…`:e.agentName}),e.counts.map((h,g)=>{const L=55+g*x,j=f*u+4,y=m-(d-g)*o,S=y+o,A=`${new Date(y).getHours()}:00-${new Date(S).getHours()}:00`;return r.jsx("rect",{x:L,y:j,width:x-1,height:u-1,fill:E(h,s),onMouseEnter:C=>{const p=C.target.getBoundingClientRect();a({agentName:e.agentName,hour:A,count:h,x:p.left,y:p.top})},onMouseLeave:()=>a(null)},g)})]},e.agentId))}),t&&r.jsxs("div",{className:"fixed z-10 rounded border border-gray-200 bg-white px-2 py-1 text-xs shadow dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200",style:{left:t.x,top:t.y-32},children:[t.agentName," | ",t.hour," | ",t.count," ",c("activityHeatmap.eventsUnit")]})]})}export{O as ActivityHeatmap};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as f,g as Ce,d as me,u as Qe,h as xe,j as S,i as Xe}from"./index-
|
|
1
|
+
import{e as f,g as Ce,d as me,u as Qe,h as xe,j as S,i as Xe}from"./index-CsSAduQA.js";import{c as I,f as A,H as Be,I as Ye,J as Fe,K as et,b as D,T as he,M as T,L as _,N as Ke,e as ye,h as Me,D as tt,C as rt,n as z,q as K,S as nt,A as it,d as at,k as Oe,l as ot,i as M,p as st,u as ct,G as lt,m as ee,j as ut,O as Ve,P as ft,Q as Y,U as Pe,z as pt,V as dt,R as vt,F as mt}from"./generateCategoricalChart-K9WHzrHy.js";var ht=["points","className","baseLinePoints","connectNulls"];function V(){return V=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},V.apply(this,arguments)}function yt(r,e){if(r==null)return{};var n=gt(r,e),t,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)t=o[i],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(n[t]=r[t])}return n}function gt(r,e){if(r==null)return{};var n={};for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t)){if(e.indexOf(t)>=0)continue;n[t]=r[t]}return n}function ke(r){return Ot(r)||xt(r)||At(r)||bt()}function bt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function At(r,e){if(r){if(typeof r=="string")return fe(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fe(r,e)}}function xt(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Ot(r){if(Array.isArray(r))return fe(r)}function fe(r,e){(e==null||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}var _e=function(e){return e&&e.x===+e.x&&e.y===+e.y},Pt=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(t){_e(t)?n[n.length-1].push(t):n[n.length-1].length>0&&n.push([])}),_e(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},U=function(e,n){var t=Pt(e);n&&(t=[t.reduce(function(o,a){return[].concat(ke(o),ke(a))},[])]);var i=t.map(function(o){return o.reduce(function(a,s,l){return"".concat(a).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return t.length===1?"".concat(i,"Z"):i},kt=function(e,n,t){var i=U(e,t);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(U(n.reverse(),t).slice(1))},_t=function(e){var n=e.points,t=e.className,i=e.baseLinePoints,o=e.connectNulls,a=yt(e,ht);if(!n||!n.length)return null;var s=I("recharts-polygon",t);if(i&&i.length){var l=a.stroke&&a.stroke!=="none",c=kt(n,i,o);return f.createElement("g",{className:s},f.createElement("path",V({},A(a,!0),{fill:c.slice(-1)==="Z"?a.fill:"none",stroke:"none",d:c})),l?f.createElement("path",V({},A(a,!0),{fill:"none",d:U(n,o)})):null,l?f.createElement("path",V({},A(a,!0),{fill:"none",d:U(i,o)})):null)}var p=U(n,o);return f.createElement("path",V({},A(a,!0),{fill:p.slice(-1)==="Z"?a.fill:"none",className:s,d:p}))},le,je;function jt(){if(je)return le;je=1;var r=Be(),e=Ye(),n=Fe();function t(i,o){return i&&i.length?r(i,n(o,2),e):void 0}return le=t,le}var wt=jt();const St=Ce(wt);var ue,we;function Tt(){if(we)return ue;we=1;var r=Be(),e=Fe(),n=et();function t(i,o){return i&&i.length?r(i,e(o,2),n):void 0}return ue=t,ue}var Et=Tt();const Rt=Ce(Et);var It=["cx","cy","angle","ticks","axisLine"],Lt=["ticks","tick","angle","tickFormatter","stroke"];function W(r){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(r)}function J(){return J=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},J.apply(this,arguments)}function Se(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),n.push.apply(n,t)}return n}function $(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Se(Object(n),!0).forEach(function(t){ae(r,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):Se(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))})}return r}function Te(r,e){if(r==null)return{};var n=$t(r,e),t,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)t=o[i],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(n[t]=r[t])}return n}function $t(r,e){if(r==null)return{};var n={};for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t)){if(e.indexOf(t)>=0)continue;n[t]=r[t]}return n}function Nt(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Ee(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,ze(t.key),t)}}function Dt(r,e,n){return e&&Ee(r.prototype,e),n&&Ee(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function Ct(r,e,n){return e=re(e),Bt(r,qe()?Reflect.construct(e,n||[],re(r).constructor):e.apply(r,n))}function Bt(r,e){if(e&&(W(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ft(r)}function Ft(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function qe(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qe=function(){return!!r})()}function re(r){return re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},re(r)}function Kt(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&pe(r,e)}function pe(r,e){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},pe(r,e)}function ae(r,e,n){return e=ze(e),e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function ze(r){var e=Mt(r,"string");return W(e)=="symbol"?e:e+""}function Mt(r,e){if(W(r)!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var t=n.call(r,e);if(W(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var oe=(function(r){function e(){return Nt(this,e),Ct(this,e,arguments)}return Kt(e,r),Dt(e,[{key:"getTickValueCoord",value:function(t){var i=t.coordinate,o=this.props,a=o.angle,s=o.cx,l=o.cy;return T(s,l,i,a)}},{key:"getTickTextAnchor",value:function(){var t=this.props.orientation,i;switch(t){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var t=this.props,i=t.cx,o=t.cy,a=t.angle,s=t.ticks,l=St(s,function(p){return p.coordinate||0}),c=Rt(s,function(p){return p.coordinate||0});return{cx:i,cy:o,startAngle:a,endAngle:a,innerRadius:c.coordinate||0,outerRadius:l.coordinate||0}}},{key:"renderAxisLine",value:function(){var t=this.props,i=t.cx,o=t.cy,a=t.angle,s=t.ticks,l=t.axisLine,c=Te(t,It),p=s.reduce(function(d,u){return[Math.min(d[0],u.coordinate),Math.max(d[1],u.coordinate)]},[1/0,-1/0]),v=T(i,o,p[0],a),y=T(i,o,p[1],a),x=$($($({},A(c,!1)),{},{fill:"none"},A(l,!1)),{},{x1:v.x,y1:v.y,x2:y.x,y2:y.y});return f.createElement("line",J({className:"recharts-polar-radius-axis-line"},x))}},{key:"renderTicks",value:function(){var t=this,i=this.props,o=i.ticks,a=i.tick,s=i.angle,l=i.tickFormatter,c=i.stroke,p=Te(i,Lt),v=this.getTickTextAnchor(),y=A(p,!1),x=A(a,!1),d=o.map(function(u,h){var g=t.getTickValueCoord(u),b=$($($($({textAnchor:v,transform:"rotate(".concat(90-s,", ").concat(g.x,", ").concat(g.y,")")},y),{},{stroke:"none",fill:c},x),{},{index:h},g),{},{payload:u});return f.createElement(_,J({className:I("recharts-polar-radius-axis-tick",Ke(a)),key:"tick-".concat(u.coordinate)},ye(t.props,u,h)),e.renderTickItem(a,b,l?l(u.value,h):u.value))});return f.createElement(_,{className:"recharts-polar-radius-axis-ticks"},d)}},{key:"render",value:function(){var t=this.props,i=t.ticks,o=t.axisLine,a=t.tick;return!i||!i.length?null:f.createElement(_,{className:I("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),a&&this.renderTicks(),Me.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(t,i,o){var a;return f.isValidElement(t)?a=f.cloneElement(t,i):D(t)?a=t(i):a=f.createElement(he,J({},i,{className:"recharts-polar-radius-axis-tick-value"}),o),a}}])})(me.PureComponent);ae(oe,"displayName","PolarRadiusAxis");ae(oe,"axisType","radiusAxis");ae(oe,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function G(r){"@babel/helpers - typeof";return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G(r)}function C(){return C=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},C.apply(this,arguments)}function Re(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),n.push.apply(n,t)}return n}function N(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Re(Object(n),!0).forEach(function(t){se(r,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):Re(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))})}return r}function Vt(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Ie(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,Ge(t.key),t)}}function qt(r,e,n){return e&&Ie(r.prototype,e),n&&Ie(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function zt(r,e,n){return e=ne(e),Wt(r,We()?Reflect.construct(e,n||[],ne(r).constructor):e.apply(r,n))}function Wt(r,e){if(e&&(G(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gt(r)}function Gt(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function We(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(We=function(){return!!r})()}function ne(r){return ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ne(r)}function Ht(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&de(r,e)}function de(r,e){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},de(r,e)}function se(r,e,n){return e=Ge(e),e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function Ge(r){var e=Zt(r,"string");return G(e)=="symbol"?e:e+""}function Zt(r,e){if(G(r)!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var t=n.call(r,e);if(G(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ut=Math.PI/180,Le=1e-5,ce=(function(r){function e(){return Vt(this,e),zt(this,e,arguments)}return Ht(e,r),qt(e,[{key:"getTickLineCoord",value:function(t){var i=this.props,o=i.cx,a=i.cy,s=i.radius,l=i.orientation,c=i.tickSize,p=c||8,v=T(o,a,s,t.coordinate),y=T(o,a,s+(l==="inner"?-1:1)*p,t.coordinate);return{x1:v.x,y1:v.y,x2:y.x,y2:y.y}}},{key:"getTickTextAnchor",value:function(t){var i=this.props.orientation,o=Math.cos(-t.coordinate*Ut),a;return o>Le?a=i==="outer"?"start":"end":o<-Le?a=i==="outer"?"end":"start":a="middle",a}},{key:"renderAxisLine",value:function(){var t=this.props,i=t.cx,o=t.cy,a=t.radius,s=t.axisLine,l=t.axisLineType,c=N(N({},A(this.props,!1)),{},{fill:"none"},A(s,!1));if(l==="circle")return f.createElement(tt,C({className:"recharts-polar-angle-axis-line"},c,{cx:i,cy:o,r:a}));var p=this.props.ticks,v=p.map(function(y){return T(i,o,a,y.coordinate)});return f.createElement(_t,C({className:"recharts-polar-angle-axis-line"},c,{points:v}))}},{key:"renderTicks",value:function(){var t=this,i=this.props,o=i.ticks,a=i.tick,s=i.tickLine,l=i.tickFormatter,c=i.stroke,p=A(this.props,!1),v=A(a,!1),y=N(N({},p),{},{fill:"none"},A(s,!1)),x=o.map(function(d,u){var h=t.getTickLineCoord(d),g=t.getTickTextAnchor(d),b=N(N(N({textAnchor:g},p),{},{stroke:"none",fill:c},v),{},{index:u,payload:d,x:h.x2,y:h.y2});return f.createElement(_,C({className:I("recharts-polar-angle-axis-tick",Ke(a)),key:"tick-".concat(d.coordinate)},ye(t.props,d,u)),s&&f.createElement("line",C({className:"recharts-polar-angle-axis-tick-line"},y,h)),a&&e.renderTickItem(a,b,l?l(d.value,u):d.value))});return f.createElement(_,{className:"recharts-polar-angle-axis-ticks"},x)}},{key:"render",value:function(){var t=this.props,i=t.ticks,o=t.radius,a=t.axisLine;return o<=0||!i||!i.length?null:f.createElement(_,{className:I("recharts-polar-angle-axis",this.props.className)},a&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(t,i,o){var a;return f.isValidElement(t)?a=f.cloneElement(t,i):D(t)?a=t(i):a=f.createElement(he,C({},i,{className:"recharts-polar-angle-axis-tick-value"}),o),a}}])})(me.PureComponent);se(ce,"displayName","PolarAngleAxis");se(ce,"axisType","angleAxis");se(ce,"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 te;function H(r){"@babel/helpers - typeof";return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(r)}function q(){return q=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},q.apply(this,arguments)}function $e(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),n.push.apply(n,t)}return n}function m(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$e(Object(n),!0).forEach(function(t){P(r,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))})}return r}function Jt(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Ne(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,Ze(t.key),t)}}function Qt(r,e,n){return e&&Ne(r.prototype,e),n&&Ne(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function Xt(r,e,n){return e=ie(e),Yt(r,He()?Reflect.construct(e,n||[],ie(r).constructor):e.apply(r,n))}function Yt(r,e){if(e&&(H(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return er(r)}function er(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function He(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(He=function(){return!!r})()}function ie(r){return ie=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ie(r)}function tr(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&ve(r,e)}function ve(r,e){return ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},ve(r,e)}function P(r,e,n){return e=Ze(e),e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function Ze(r){var e=rr(r,"string");return H(e)=="symbol"?e:e+""}function rr(r,e){if(H(r)!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var t=n.call(r,e);if(H(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}var E=(function(r){function e(n){var t;return Jt(this,e),t=Xt(this,e,[n]),P(t,"pieRef",null),P(t,"sectorRefs",[]),P(t,"id",ct("recharts-pie-")),P(t,"handleAnimationEnd",function(){var i=t.props.onAnimationEnd;t.setState({isAnimationFinished:!0}),D(i)&&i()}),P(t,"handleAnimationStart",function(){var i=t.props.onAnimationStart;t.setState({isAnimationFinished:!1}),D(i)&&i()}),t.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},t}return tr(e,r),Qt(e,[{key:"isActiveIndex",value:function(t){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(t)!==-1:t===i}},{key:"hasActiveIndex",value:function(){var t=this.props.activeIndex;return Array.isArray(t)?t.length!==0:t||t===0}},{key:"renderLabels",value:function(t){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.label,s=o.labelLine,l=o.dataKey,c=o.valueKey,p=A(this.props,!1),v=A(a,!1),y=A(s,!1),x=a&&a.offsetRadius||20,d=t.map(function(u,h){var g=(u.startAngle+u.endAngle)/2,b=T(u.cx,u.cy,u.outerRadius+x,g),k=m(m(m(m({},p),u),{},{stroke:"none"},v),{},{index:h,textAnchor:e.getTextAnchor(b.x,u.cx)},b),B=m(m(m(m({},p),u),{},{fill:"none",stroke:u.fill},y),{},{index:h,points:[T(u.cx,u.cy,u.outerRadius,g),b]}),j=l;return z(l)&&z(c)?j="value":z(l)&&(j=c),f.createElement(_,{key:"label-".concat(u.startAngle,"-").concat(u.endAngle,"-").concat(u.midAngle,"-").concat(h)},s&&e.renderLabelLineItem(s,B,"line"),e.renderLabelItem(a,k,K(u,j)))});return f.createElement(_,{className:"recharts-pie-labels"},d)}},{key:"renderSectorsStatically",value:function(t){var i=this,o=this.props,a=o.activeShape,s=o.blendStroke,l=o.inactiveShape;return t.map(function(c,p){if((c==null?void 0:c.startAngle)===0&&(c==null?void 0:c.endAngle)===0&&t.length!==1)return null;var v=i.isActiveIndex(p),y=l&&i.hasActiveIndex()?l:null,x=v?a:y,d=m(m({},c),{},{stroke:s?c.fill:c.stroke,tabIndex:-1});return f.createElement(_,q({ref:function(h){h&&!i.sectorRefs.includes(h)&&i.sectorRefs.push(h)},tabIndex:-1,className:"recharts-pie-sector"},ye(i.props,c,p),{key:"sector-".concat(c==null?void 0:c.startAngle,"-").concat(c==null?void 0:c.endAngle,"-").concat(c.midAngle,"-").concat(p)}),f.createElement(nt,q({option:x,isActive:v,shapeType:"sector"},d)))})}},{key:"renderSectorsWithAnimation",value:function(){var t=this,i=this.props,o=i.sectors,a=i.isAnimationActive,s=i.animationBegin,l=i.animationDuration,c=i.animationEasing,p=i.animationId,v=this.state,y=v.prevSectors,x=v.prevIsAnimationActive;return f.createElement(it,{begin:s,duration:l,isActive:a,easing:c,from:{t:0},to:{t:1},key:"pie-".concat(p,"-").concat(x),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(d){var u=d.t,h=[],g=o&&o[0],b=g.startAngle;return o.forEach(function(k,B){var j=y&&y[B],L=B>0?at(k,"paddingAngle",0):0;if(j){var Z=Oe(j.endAngle-j.startAngle,k.endAngle-k.startAngle),O=m(m({},k),{},{startAngle:b+L,endAngle:b+Z(u)+L});h.push(O),b=O.endAngle}else{var F=k.endAngle,w=k.startAngle,Q=Oe(0,F-w),X=Q(u),R=m(m({},k),{},{startAngle:b+L,endAngle:b+X+L});h.push(R),b=R.endAngle}}),f.createElement(_,null,t.renderSectorsStatically(h))})}},{key:"attachKeyboardHandlers",value:function(t){var i=this;t.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var a=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[a].focus(),i.setState({sectorToFocus:a});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var t=this.props,i=t.sectors,o=t.isAnimationActive,a=this.state.prevSectors;return o&&i&&i.length&&(!a||!ot(a,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var t=this,i=this.props,o=i.hide,a=i.sectors,s=i.className,l=i.label,c=i.cx,p=i.cy,v=i.innerRadius,y=i.outerRadius,x=i.isAnimationActive,d=this.state.isAnimationFinished;if(o||!a||!a.length||!M(c)||!M(p)||!M(v)||!M(y))return null;var u=I("recharts-pie",s);return f.createElement(_,{tabIndex:this.props.rootTabIndex,className:u,ref:function(g){t.pieRef=g}},this.renderSectors(),l&&this.renderLabels(a),Me.renderCallByParent(this.props,null,!1),(!x||d)&&st.renderCallByParent(this.props,a,!1))}}],[{key:"getDerivedStateFromProps",value:function(t,i){return i.prevIsAnimationActive!==t.isAnimationActive?{prevIsAnimationActive:t.isAnimationActive,prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:[],isAnimationFinished:!0}:t.isAnimationActive&&t.animationId!==i.prevAnimationId?{prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:t.sectors!==i.curSectors?{curSectors:t.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(t,i){return t>i?"start":t<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(t,i,o){if(f.isValidElement(t))return f.cloneElement(t,i);if(D(t))return t(i);var a=I("recharts-pie-label-line",typeof t!="boolean"?t.className:"");return f.createElement(rt,q({},i,{key:o,type:"linear",className:a}))}},{key:"renderLabelItem",value:function(t,i,o){if(f.isValidElement(t))return f.cloneElement(t,i);var a=o;if(D(t)&&(a=t(i),f.isValidElement(a)))return a;var s=I("recharts-pie-label-text",typeof t!="boolean"&&!D(t)?t.className:"");return f.createElement(he,q({},i,{alignmentBaseline:"middle",className:s}),a)}}])})(me.PureComponent);te=E;P(E,"displayName","Pie");P(E,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!lt.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});P(E,"parseDeltaAngle",function(r,e){var n=ee(e-r),t=Math.min(Math.abs(e-r),360);return n*t});P(E,"getRealPieData",function(r){var e=r.data,n=r.children,t=A(r,!1),i=ut(n,Ve);return e&&e.length?e.map(function(o,a){return m(m(m({payload:o},t),o),i&&i[a]&&i[a].props)}):i&&i.length?i.map(function(o){return m(m({},t),o.props)}):[]});P(E,"parseCoordinateOfPie",function(r,e){var n=e.top,t=e.left,i=e.width,o=e.height,a=ft(i,o),s=t+Y(r.cx,i,i/2),l=n+Y(r.cy,o,o/2),c=Y(r.innerRadius,a,0),p=Y(r.outerRadius,a,a*.8),v=r.maxRadius||Math.sqrt(i*i+o*o)/2;return{cx:s,cy:l,innerRadius:c,outerRadius:p,maxRadius:v}});P(E,"getComposedData",function(r){var e=r.item,n=r.offset,t=e.type.defaultProps!==void 0?m(m({},e.type.defaultProps),e.props):e.props,i=te.getRealPieData(t);if(!i||!i.length)return null;var o=t.cornerRadius,a=t.startAngle,s=t.endAngle,l=t.paddingAngle,c=t.dataKey,p=t.nameKey,v=t.valueKey,y=t.tooltipType,x=Math.abs(t.minAngle),d=te.parseCoordinateOfPie(t,n),u=te.parseDeltaAngle(a,s),h=Math.abs(u),g=c;z(c)&&z(v)?(Pe(!1,`Use "dataKey" to specify the value of pie,
|
|
3
3
|
the props "valueKey" will be deprecated in 1.1.0`),g="value"):z(c)&&(Pe(!1,`Use "dataKey" to specify the value of pie,
|
|
4
4
|
the props "valueKey" will be deprecated in 1.1.0`),g=v);var b=i.filter(function(O){return K(O,g,0)!==0}).length,k=(h>=360?b:b-1)*l,B=h-b*x-k,j=i.reduce(function(O,F){var w=K(F,g,0);return O+(M(w)?w:0)},0),L;if(j>0){var Z;L=i.map(function(O,F){var w=K(O,g,0),Q=K(O,p,F),X=(M(w)?w:0)/j,R;F?R=Z.endAngle+ee(u)*l*(w!==0?1:0):R=a;var ge=R+ee(u)*((w!==0?x:0)+X*B),be=(R+ge)/2,Ae=(d.innerRadius+d.outerRadius)/2,Ue=[{name:Q,value:w,payload:O,dataKey:g,type:y}],Je=T(d.cx,d.cy,Ae,be);return Z=m(m(m({percent:X,cornerRadius:o,name:Q,tooltipPayload:Ue,midAngle:be,middleRadius:Ae,tooltipPosition:Je},O),d),{},{value:K(O,g),startAngle:R,endAngle:ge,payload:O,paddingAngle:ee(u)*l}),Z})}return m(m({},d),{},{sectors:L,data:i})});var nr=pt({chartName:"PieChart",GraphicalChild:E,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:ce},{axisType:"radiusAxis",AxisComp:oe}],formatAxisMap:dt,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function De(r){return r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}k`:String(r)}function or(){const{t:r}=Qe(),e=xe(a=>a.agentCosts),n=xe(a=>a.agents),t=Object.entries(e).filter(([,a])=>a>0),i=t.reduce((a,[,s])=>a+s,0);if(t.length===0)return S.jsx("div",{className:"flex h-24 items-center justify-center text-sm text-gray-500 dark:text-gray-400",children:r("empty.noCostData")});const o=t.map(([a,s])=>{var l;return{name:((l=n.get(a))==null?void 0:l.name)??a,agentId:a,value:s,color:Xe(a)}});return S.jsxs("div",{className:"relative h-[200px] w-full",children:[S.jsx(vt,{width:"100%",height:"100%",children:S.jsxs(nr,{children:[S.jsx(E,{data:o,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",innerRadius:50,outerRadius:80,paddingAngle:2,children:o.map((a,s)=>S.jsx(Ve,{fill:a.color},s))}),S.jsx(mt,{formatter:(a,s)=>{const l=typeof a=="number"?a:0,c=i>0?(l/i*100).toFixed(0):"0";return`${s}: ${De(l)} (${c}%)`}})]})}),S.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:S.jsx("span",{className:"text-sm font-bold text-gray-700 dark:text-gray-300",children:De(i)})})]})}export{or as CostPieChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as S,h as g,d as M,j as d,S as k}from"./index-
|
|
1
|
+
import{u as S,h as g,d as M,j as d,S as k}from"./index-CsSAduQA.js";const y=8,C=24,j=20,p=280;function T(l,n,s,f){const e=new Map,r=l.length;if(r===0)return e;for(let u=0;u<r;u++){const h=2*Math.PI*u/r-Math.PI/2;e.set(l[u].id,{x:n+f*Math.cos(h),y:s+f*Math.sin(h)})}return e}function w(l,n){if(n<=0)return y;const s=Math.min(l/n,1);return y+s*(C-y)}function E(){const{t:l}=S(),n=g(t=>t.agents),s=g(t=>t.links),f=g(t=>t.theme),[e,r]=M.useState(null),u=f==="dark",{topAgents:h,positions:x,maxToolCount:I}=M.useMemo(()=>{const t=Array.from(n.values()).toSorted((i,m)=>m.toolCallCount-i.toolCallCount).slice(0,j),o=Math.max(1,...t.map(i=>i.toolCallCount)),a=Math.min(80,Math.max(40,t.length*8)),c=T(t,p/2,p/2,a);return{topAgents:t,positions:c,maxToolCount:o}},[n]),v=M.useMemo(()=>{if(!e)return new Set;const t=new Set;for(const o of s)(o.sourceId===e||o.targetId===e)&&t.add(`${o.sourceId}-${o.targetId}`);return t},[s,e]);return h.length===0&&s.length===0?d.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-gray-500 dark:text-gray-400",children:l("empty.noRelationData")}):d.jsxs("svg",{width:"100%",height:200,viewBox:`0 0 ${p} ${p}`,className:"overflow-visible",onMouseLeave:()=>r(null),children:[s.filter(t=>x.has(t.sourceId)&&x.has(t.targetId)).map(t=>{const o=x.get(t.sourceId),a=x.get(t.targetId),c=`${t.sourceId}-${t.targetId}`,i=v.has(c),m=Math.max(1,t.strength*3);return d.jsx("line",{x1:o.x,y1:o.y,x2:a.x,y2:a.y,stroke:i?"#3b82f6":"rgba(107,114,128,0.4)",strokeWidth:m},c)}),h.map(t=>{const o=x.get(t.id);if(!o)return null;const a=w(t.toolCallCount,I),c=e===t.id,i=c?1.2:1,m=k[t.status];return d.jsxs("g",{onMouseEnter:()=>r(t.id),onMouseLeave:()=>r(null),children:[d.jsx("circle",{cx:o.x,cy:o.y,r:a*i,fill:m,stroke:c?"#1e40af":"transparent",strokeWidth:2}),d.jsx("text",{x:o.x,y:o.y+a+10,textAnchor:"middle",fontSize:9,fill:u?"#e2e8f0":"#374151",children:t.name.length>8?`${t.name.slice(0,6)}…`:t.name})]},t.id)})]})}export{E as NetworkGraph};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as qE,a as YE,g as ob,c as $E,e as Mg,b as ZE,d as me,j as B,f as KE,_ as Wh,u as lb,h as Gr,i as JE,p as Xh,M as QE,S as ew,Z as Ji}from"./index-
|
|
1
|
+
import{r as qE,a as YE,g as ob,c as $E,e as Mg,b as ZE,d as me,j as B,f as KE,_ as Wh,u as lb,h as Gr,i as JE,p as Xh,M as QE,S as ew,Z as Ji}from"./index-CsSAduQA.js";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2010-2026 Three.js Authors
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as w,d as D,u as Jt,h as Qt,j as A,P as Z}from"./index-DNKPM7x5.js";import{g as Zt,i as ht,G as Ct,a as lt,m as te,b as q,c as C,T as ee,s as ft,f as $,d as Pt,L as X,e as re,h as ne,D as ie,j as oe,E as ae,C as ce,A as se,k as Y,l as ue,n as yt,o as le,p as fe,q as Dt,u as pe,r as kt,t as Nt,v as Lt,w as he,x as It,y as ye,z as ve,B as de,R as me,F as be}from"./generateCategoricalChart-3d0tNdH3.js";function zt(t,e,n){if(e<1)return[];if(e===1&&n===void 0)return t;for(var r=[],i=0;i<t.length;i+=e)r.push(t[i]);return r}function ge(t,e,n){var r={width:t.width+e.width,height:t.height+e.height};return Zt(r,n)}function xe(t,e,n){var r=n==="width",i=t.x,a=t.y,o=t.width,c=t.height;return e===1?{start:r?i:a,end:r?i+o:a+c}:{start:r?i+o:a+c,end:r?i:a}}function et(t,e,n,r,i){if(t*e<t*r||t*e>t*i)return!1;var a=n();return t*(e-t*a/2-r)>=0&&t*(e+t*a/2-i)<=0}function Oe(t,e){return zt(t,e+1)}function we(t,e,n,r,i){for(var a=(r||[]).slice(),o=e.start,c=e.end,s=0,h=1,f=o,y=function(){var p=r==null?void 0:r[s];if(p===void 0)return{v:zt(r,h)};var v=s,d,g=function(){return d===void 0&&(d=n(p,v)),d},b=p.coordinate,m=s===0||et(t,b,g,f,c);m||(s=0,f=o,h+=1),m&&(f=b+t*(g()/2+i),s+=h)},l;h<=a.length;)if(l=y(),l)return l.v;return[]}function J(t){"@babel/helpers - typeof";return J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J(t)}function _t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function k(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?_t(Object(n),!0).forEach(function(r){Pe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_t(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Pe(t,e,n){return e=ke(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ke(t){var e=_e(t,"string");return J(e)=="symbol"?e:e+""}function _e(t,e){if(J(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(J(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Se(t,e,n,r,i){for(var a=(r||[]).slice(),o=a.length,c=e.start,s=e.end,h=function(l){var u=a[l],p,v=function(){return p===void 0&&(p=n(u,l)),p};if(l===o-1){var d=t*(u.coordinate+t*v()/2-s);a[l]=u=k(k({},u),{},{tickCoord:d>0?u.coordinate-d*t:u.coordinate})}else a[l]=u=k(k({},u),{},{tickCoord:u.coordinate});var g=et(t,u.tickCoord,v,c,s);g&&(s=u.tickCoord-t*(v()/2+i),a[l]=k(k({},u),{},{isShow:!0}))},f=o-1;f>=0;f--)h(f);return a}function Ae(t,e,n,r,i,a){var o=(r||[]).slice(),c=o.length,s=e.start,h=e.end;if(a){var f=r[c-1],y=n(f,c-1),l=t*(f.coordinate+t*y/2-h);o[c-1]=f=k(k({},f),{},{tickCoord:l>0?f.coordinate-l*t:f.coordinate});var u=et(t,f.tickCoord,function(){return y},s,h);u&&(h=f.tickCoord-t*(y/2+i),o[c-1]=k(k({},f),{},{isShow:!0}))}for(var p=a?c-1:c,v=function(b){var m=o[b],x,O=function(){return x===void 0&&(x=n(m,b)),x};if(b===0){var j=t*(m.coordinate-t*O()/2-s);o[b]=m=k(k({},m),{},{tickCoord:j<0?m.coordinate-j*t:m.coordinate})}else o[b]=m=k(k({},m),{},{tickCoord:m.coordinate});var T=et(t,m.tickCoord,O,s,h);T&&(s=m.tickCoord+t*(O()/2+i),o[b]=k(k({},m),{},{isShow:!0}))},d=0;d<p;d++)v(d);return o}function je(t,e,n){var r=t.tick,i=t.ticks,a=t.viewBox,o=t.minTickGap,c=t.orientation,s=t.interval,h=t.tickFormatter,f=t.unit,y=t.angle;if(!i||!i.length||!r)return[];if(ht(s)||Ct.isSsr)return Oe(i,typeof s=="number"&&ht(s)?s:0);var l=[],u=c==="top"||c==="bottom"?"width":"height",p=f&&u==="width"?lt(f,{fontSize:e,letterSpacing:n}):{width:0,height:0},v=function(m,x){var O=q(h)?h(m.value,x):m.value;return u==="width"?ge(lt(O,{fontSize:e,letterSpacing:n}),p,y):lt(O,{fontSize:e,letterSpacing:n})[u]},d=i.length>=2?te(i[1].coordinate-i[0].coordinate):1,g=xe(a,d,u);return s==="equidistantPreserveStart"?we(d,g,v,i,o):(s==="preserveStart"||s==="preserveStartEnd"?l=Ae(d,g,v,i,o,s==="preserveStartEnd"):l=Se(d,g,v,i,o),l.filter(function(b){return b.isShow}))}var Te=["viewBox"],Ee=["viewBox"],$e=["ticks"];function B(t){"@babel/helpers - typeof";return B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(t)}function R(){return R=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},R.apply(this,arguments)}function St(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?St(Object(n),!0).forEach(function(r){wt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function pt(t,e){if(t==null)return{};var n=Ce(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ce(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function De(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function At(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bt(r.key),r)}}function Ne(t,e,n){return e&&At(t.prototype,e),n&&At(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Le(t,e,n){return e=rt(e),Ie(t,Rt()?Reflect.construct(e,n||[],rt(t).constructor):e.apply(t,n))}function Ie(t,e){if(e&&(B(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ze(t)}function ze(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Rt=function(){return!!t})()}function rt(t){return rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rt(t)}function Re(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vt(t,e)}function vt(t,e){return vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},vt(t,e)}function wt(t,e,n){return e=Bt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bt(t){var e=Be(t,"string");return B(e)=="symbol"?e:e+""}function Be(t,e){if(B(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(B(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var at=(function(t){function e(n){var r;return De(this,e),r=Le(this,e,[n]),r.state={fontSize:"",letterSpacing:""},r}return Re(e,t),Ne(e,[{key:"shouldComponentUpdate",value:function(r,i){var a=r.viewBox,o=pt(r,Te),c=this.props,s=c.viewBox,h=pt(c,Ee);return!ft(a,s)||!ft(o,h)||!ft(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.x,o=i.y,c=i.width,s=i.height,h=i.orientation,f=i.tickSize,y=i.mirror,l=i.tickMargin,u,p,v,d,g,b,m=y?-1:1,x=r.tickSize||f,O=ht(r.tickCoord)?r.tickCoord:r.coordinate;switch(h){case"top":u=p=r.coordinate,d=o+ +!y*s,v=d-m*x,b=v-m*l,g=O;break;case"left":v=d=r.coordinate,p=a+ +!y*c,u=p-m*x,g=u-m*l,b=O;break;case"right":v=d=r.coordinate,p=a+ +y*c,u=p+m*x,g=u+m*l,b=O;break;default:u=p=r.coordinate,d=o+ +y*s,v=d+m*x,b=v+m*l,g=O;break}return{line:{x1:u,y1:v,x2:p,y2:d},tick:{x:g,y:b}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o;switch(i){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,c=r.height,s=r.orientation,h=r.mirror,f=r.axisLine,y=P(P(P({},$(this.props,!1)),$(f,!1)),{},{fill:"none"});if(s==="top"||s==="bottom"){var l=+(s==="top"&&!h||s==="bottom"&&h);y=P(P({},y),{},{x1:i,y1:a+l*c,x2:i+o,y2:a+l*c})}else{var u=+(s==="left"&&!h||s==="right"&&h);y=P(P({},y),{},{x1:i+u*o,y1:a,x2:i+u*o,y2:a+c})}return w.createElement("line",R({},y,{className:C("recharts-cartesian-axis-line",Pt(f,"className"))}))}},{key:"renderTicks",value:function(r,i,a){var o=this,c=this.props,s=c.tickLine,h=c.stroke,f=c.tick,y=c.tickFormatter,l=c.unit,u=je(P(P({},this.props),{},{ticks:r}),i,a),p=this.getTickTextAnchor(),v=this.getTickVerticalAnchor(),d=$(this.props,!1),g=$(f,!1),b=P(P({},d),{},{fill:"none"},$(s,!1)),m=u.map(function(x,O){var j=o.getTickLineCoord(x),T=j.line,N=j.tick,L=P(P(P(P({textAnchor:p,verticalAnchor:v},d),{},{stroke:"none",fill:h},g),N),{},{index:O,payload:x,visibleTicksCount:u.length,tickFormatter:y});return w.createElement(X,R({className:"recharts-cartesian-axis-tick",key:"tick-".concat(x.value,"-").concat(x.coordinate,"-").concat(x.tickCoord)},re(o.props,x,O)),s&&w.createElement("line",R({},b,T,{className:C("recharts-cartesian-axis-tick-line",Pt(s,"className"))})),f&&e.renderTickItem(f,L,"".concat(q(y)?y(x.value,O):x.value).concat(l||"")))});return w.createElement("g",{className:"recharts-cartesian-axis-ticks"},m)}},{key:"render",value:function(){var r=this,i=this.props,a=i.axisLine,o=i.width,c=i.height,s=i.ticksGenerator,h=i.className,f=i.hide;if(f)return null;var y=this.props,l=y.ticks,u=pt(y,$e),p=l;return q(s)&&(p=l&&l.length>0?s(this.props):s(u)),o<=0||c<=0||!p||!p.length?null:w.createElement(X,{className:C("recharts-cartesian-axis",h),ref:function(d){r.layerReference=d}},a&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),ne.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,a){var o,c=C(i.className,"recharts-cartesian-axis-tick-value");return w.isValidElement(r)?o=w.cloneElement(r,P(P({},i),{},{className:c})):q(r)?o=r(P(P({},i),{},{className:c})):o=w.createElement(ee,R({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(D.Component);wt(at,"displayName","CartesianAxis");wt(at,"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"});var Fe=["type","layout","connectNulls","ref"],We=["key"];function F(t){"@babel/helpers - typeof";return F=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(t)}function jt(t,e){if(t==null)return{};var n=Ke(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ke(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function H(){return H=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},H.apply(this,arguments)}function Tt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function S(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Tt(Object(n),!0).forEach(function(r){E(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function z(t){return Ue(t)||Ge(t)||Ve(t)||Me()}function Me(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1
|
+
import{e as w,d as D,u as Jt,h as Qt,j as A,P as Z}from"./index-CsSAduQA.js";import{g as Zt,i as ht,G as Ct,a as lt,m as te,b as q,c as C,T as ee,s as ft,f as $,d as Pt,L as X,e as re,h as ne,D as ie,j as oe,E as ae,C as ce,A as se,k as Y,l as ue,n as yt,o as le,p as fe,q as Dt,u as pe,r as kt,t as Nt,v as Lt,w as he,x as It,y as ye,z as ve,B as de,R as me,F as be}from"./generateCategoricalChart-K9WHzrHy.js";function zt(t,e,n){if(e<1)return[];if(e===1&&n===void 0)return t;for(var r=[],i=0;i<t.length;i+=e)r.push(t[i]);return r}function ge(t,e,n){var r={width:t.width+e.width,height:t.height+e.height};return Zt(r,n)}function xe(t,e,n){var r=n==="width",i=t.x,a=t.y,o=t.width,c=t.height;return e===1?{start:r?i:a,end:r?i+o:a+c}:{start:r?i+o:a+c,end:r?i:a}}function et(t,e,n,r,i){if(t*e<t*r||t*e>t*i)return!1;var a=n();return t*(e-t*a/2-r)>=0&&t*(e+t*a/2-i)<=0}function Oe(t,e){return zt(t,e+1)}function we(t,e,n,r,i){for(var a=(r||[]).slice(),o=e.start,c=e.end,s=0,h=1,f=o,y=function(){var p=r==null?void 0:r[s];if(p===void 0)return{v:zt(r,h)};var v=s,d,g=function(){return d===void 0&&(d=n(p,v)),d},b=p.coordinate,m=s===0||et(t,b,g,f,c);m||(s=0,f=o,h+=1),m&&(f=b+t*(g()/2+i),s+=h)},l;h<=a.length;)if(l=y(),l)return l.v;return[]}function J(t){"@babel/helpers - typeof";return J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J(t)}function _t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function k(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?_t(Object(n),!0).forEach(function(r){Pe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_t(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Pe(t,e,n){return e=ke(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ke(t){var e=_e(t,"string");return J(e)=="symbol"?e:e+""}function _e(t,e){if(J(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(J(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Se(t,e,n,r,i){for(var a=(r||[]).slice(),o=a.length,c=e.start,s=e.end,h=function(l){var u=a[l],p,v=function(){return p===void 0&&(p=n(u,l)),p};if(l===o-1){var d=t*(u.coordinate+t*v()/2-s);a[l]=u=k(k({},u),{},{tickCoord:d>0?u.coordinate-d*t:u.coordinate})}else a[l]=u=k(k({},u),{},{tickCoord:u.coordinate});var g=et(t,u.tickCoord,v,c,s);g&&(s=u.tickCoord-t*(v()/2+i),a[l]=k(k({},u),{},{isShow:!0}))},f=o-1;f>=0;f--)h(f);return a}function Ae(t,e,n,r,i,a){var o=(r||[]).slice(),c=o.length,s=e.start,h=e.end;if(a){var f=r[c-1],y=n(f,c-1),l=t*(f.coordinate+t*y/2-h);o[c-1]=f=k(k({},f),{},{tickCoord:l>0?f.coordinate-l*t:f.coordinate});var u=et(t,f.tickCoord,function(){return y},s,h);u&&(h=f.tickCoord-t*(y/2+i),o[c-1]=k(k({},f),{},{isShow:!0}))}for(var p=a?c-1:c,v=function(b){var m=o[b],x,O=function(){return x===void 0&&(x=n(m,b)),x};if(b===0){var j=t*(m.coordinate-t*O()/2-s);o[b]=m=k(k({},m),{},{tickCoord:j<0?m.coordinate-j*t:m.coordinate})}else o[b]=m=k(k({},m),{},{tickCoord:m.coordinate});var T=et(t,m.tickCoord,O,s,h);T&&(s=m.tickCoord+t*(O()/2+i),o[b]=k(k({},m),{},{isShow:!0}))},d=0;d<p;d++)v(d);return o}function je(t,e,n){var r=t.tick,i=t.ticks,a=t.viewBox,o=t.minTickGap,c=t.orientation,s=t.interval,h=t.tickFormatter,f=t.unit,y=t.angle;if(!i||!i.length||!r)return[];if(ht(s)||Ct.isSsr)return Oe(i,typeof s=="number"&&ht(s)?s:0);var l=[],u=c==="top"||c==="bottom"?"width":"height",p=f&&u==="width"?lt(f,{fontSize:e,letterSpacing:n}):{width:0,height:0},v=function(m,x){var O=q(h)?h(m.value,x):m.value;return u==="width"?ge(lt(O,{fontSize:e,letterSpacing:n}),p,y):lt(O,{fontSize:e,letterSpacing:n})[u]},d=i.length>=2?te(i[1].coordinate-i[0].coordinate):1,g=xe(a,d,u);return s==="equidistantPreserveStart"?we(d,g,v,i,o):(s==="preserveStart"||s==="preserveStartEnd"?l=Ae(d,g,v,i,o,s==="preserveStartEnd"):l=Se(d,g,v,i,o),l.filter(function(b){return b.isShow}))}var Te=["viewBox"],Ee=["viewBox"],$e=["ticks"];function B(t){"@babel/helpers - typeof";return B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(t)}function R(){return R=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},R.apply(this,arguments)}function St(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?St(Object(n),!0).forEach(function(r){wt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function pt(t,e){if(t==null)return{};var n=Ce(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ce(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function De(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function At(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bt(r.key),r)}}function Ne(t,e,n){return e&&At(t.prototype,e),n&&At(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Le(t,e,n){return e=rt(e),Ie(t,Rt()?Reflect.construct(e,n||[],rt(t).constructor):e.apply(t,n))}function Ie(t,e){if(e&&(B(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ze(t)}function ze(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Rt=function(){return!!t})()}function rt(t){return rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rt(t)}function Re(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vt(t,e)}function vt(t,e){return vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},vt(t,e)}function wt(t,e,n){return e=Bt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bt(t){var e=Be(t,"string");return B(e)=="symbol"?e:e+""}function Be(t,e){if(B(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(B(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var at=(function(t){function e(n){var r;return De(this,e),r=Le(this,e,[n]),r.state={fontSize:"",letterSpacing:""},r}return Re(e,t),Ne(e,[{key:"shouldComponentUpdate",value:function(r,i){var a=r.viewBox,o=pt(r,Te),c=this.props,s=c.viewBox,h=pt(c,Ee);return!ft(a,s)||!ft(o,h)||!ft(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.x,o=i.y,c=i.width,s=i.height,h=i.orientation,f=i.tickSize,y=i.mirror,l=i.tickMargin,u,p,v,d,g,b,m=y?-1:1,x=r.tickSize||f,O=ht(r.tickCoord)?r.tickCoord:r.coordinate;switch(h){case"top":u=p=r.coordinate,d=o+ +!y*s,v=d-m*x,b=v-m*l,g=O;break;case"left":v=d=r.coordinate,p=a+ +!y*c,u=p-m*x,g=u-m*l,b=O;break;case"right":v=d=r.coordinate,p=a+ +y*c,u=p+m*x,g=u+m*l,b=O;break;default:u=p=r.coordinate,d=o+ +y*s,v=d+m*x,b=v+m*l,g=O;break}return{line:{x1:u,y1:v,x2:p,y2:d},tick:{x:g,y:b}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o;switch(i){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,c=r.height,s=r.orientation,h=r.mirror,f=r.axisLine,y=P(P(P({},$(this.props,!1)),$(f,!1)),{},{fill:"none"});if(s==="top"||s==="bottom"){var l=+(s==="top"&&!h||s==="bottom"&&h);y=P(P({},y),{},{x1:i,y1:a+l*c,x2:i+o,y2:a+l*c})}else{var u=+(s==="left"&&!h||s==="right"&&h);y=P(P({},y),{},{x1:i+u*o,y1:a,x2:i+u*o,y2:a+c})}return w.createElement("line",R({},y,{className:C("recharts-cartesian-axis-line",Pt(f,"className"))}))}},{key:"renderTicks",value:function(r,i,a){var o=this,c=this.props,s=c.tickLine,h=c.stroke,f=c.tick,y=c.tickFormatter,l=c.unit,u=je(P(P({},this.props),{},{ticks:r}),i,a),p=this.getTickTextAnchor(),v=this.getTickVerticalAnchor(),d=$(this.props,!1),g=$(f,!1),b=P(P({},d),{},{fill:"none"},$(s,!1)),m=u.map(function(x,O){var j=o.getTickLineCoord(x),T=j.line,N=j.tick,L=P(P(P(P({textAnchor:p,verticalAnchor:v},d),{},{stroke:"none",fill:h},g),N),{},{index:O,payload:x,visibleTicksCount:u.length,tickFormatter:y});return w.createElement(X,R({className:"recharts-cartesian-axis-tick",key:"tick-".concat(x.value,"-").concat(x.coordinate,"-").concat(x.tickCoord)},re(o.props,x,O)),s&&w.createElement("line",R({},b,T,{className:C("recharts-cartesian-axis-tick-line",Pt(s,"className"))})),f&&e.renderTickItem(f,L,"".concat(q(y)?y(x.value,O):x.value).concat(l||"")))});return w.createElement("g",{className:"recharts-cartesian-axis-ticks"},m)}},{key:"render",value:function(){var r=this,i=this.props,a=i.axisLine,o=i.width,c=i.height,s=i.ticksGenerator,h=i.className,f=i.hide;if(f)return null;var y=this.props,l=y.ticks,u=pt(y,$e),p=l;return q(s)&&(p=l&&l.length>0?s(this.props):s(u)),o<=0||c<=0||!p||!p.length?null:w.createElement(X,{className:C("recharts-cartesian-axis",h),ref:function(d){r.layerReference=d}},a&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),ne.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,a){var o,c=C(i.className,"recharts-cartesian-axis-tick-value");return w.isValidElement(r)?o=w.cloneElement(r,P(P({},i),{},{className:c})):q(r)?o=r(P(P({},i),{},{className:c})):o=w.createElement(ee,R({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(D.Component);wt(at,"displayName","CartesianAxis");wt(at,"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"});var Fe=["type","layout","connectNulls","ref"],We=["key"];function F(t){"@babel/helpers - typeof";return F=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(t)}function jt(t,e){if(t==null)return{};var n=Ke(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ke(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function H(){return H=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},H.apply(this,arguments)}function Tt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function S(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Tt(Object(n),!0).forEach(function(r){E(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function z(t){return Ue(t)||Ge(t)||Ve(t)||Me()}function Me(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ve(t,e){if(t){if(typeof t=="string")return dt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dt(t,e)}}function Ge(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Ue(t){if(Array.isArray(t))return dt(t)}function dt(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ye(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Et(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Wt(r.key),r)}}function qe(t,e,n){return e&&Et(t.prototype,e),n&&Et(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Xe(t,e,n){return e=nt(e),He(t,Ft()?Reflect.construct(e,n||[],nt(t).constructor):e.apply(t,n))}function He(t,e){if(e&&(F(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Je(t)}function Je(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ft(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ft=function(){return!!t})()}function nt(t){return nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},nt(t)}function Qe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mt(t,e)}function mt(t,e){return mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},mt(t,e)}function E(t,e,n){return e=Wt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wt(t){var e=Ze(t,"string");return F(e)=="symbol"?e:e+""}function Ze(t,e){if(F(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(F(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var W=(function(t){function e(){var n;Ye(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=Xe(this,e,[].concat(i)),E(n,"state",{isAnimationFinished:!0,totalLength:0}),E(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),E(n,"getStrokeDasharray",function(o,c,s){var h=s.reduce(function(g,b){return g+b});if(!h)return n.generateSimpleStrokeDasharray(c,o);for(var f=Math.floor(o/h),y=o%h,l=c-o,u=[],p=0,v=0;p<s.length;v+=s[p],++p)if(v+s[p]>y){u=[].concat(z(s.slice(0,p)),[y-v]);break}var d=u.length%2===0?[0,l]:[l];return[].concat(z(e.repeat(s,f)),z(u),d).map(function(g){return"".concat(g,"px")}).join(", ")}),E(n,"id",pe("recharts-line-")),E(n,"pathRef",function(o){n.mainCurve=o}),E(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),E(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Qe(e,t),qe(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,c=a.xAxis,s=a.yAxis,h=a.layout,f=a.children,y=oe(f,ae);if(!y)return null;var l=function(v,d){return{x:v.x,y:v.y,value:v.value,errorVal:Dt(v.payload,d)}},u={clipPath:r?"url(#clipPath-".concat(i,")"):null};return w.createElement(X,u,y.map(function(p){return w.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:o,xAxis:c,yAxis:s,layout:h,dataPointFormatter:l})}))}},{key:"renderDots",value:function(r,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var c=this.props,s=c.dot,h=c.points,f=c.dataKey,y=$(this.props,!1),l=$(s,!0),u=h.map(function(v,d){var g=S(S(S({key:"dot-".concat(d),r:3},y),l),{},{index:d,cx:v.x,cy:v.y,value:v.value,dataKey:f,payload:v.payload,points:h});return e.renderDotItem(s,g)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return w.createElement(X,H({className:"recharts-line-dots",key:"dots"},p),u)}},{key:"renderCurveStatically",value:function(r,i,a,o){var c=this.props,s=c.type,h=c.layout,f=c.connectNulls;c.ref;var y=jt(c,Fe),l=S(S(S({},$(y,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:r},o),{},{type:s,layout:h,connectNulls:f});return w.createElement(ce,H({},l,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var a=this,o=this.props,c=o.points,s=o.strokeDasharray,h=o.isAnimationActive,f=o.animationBegin,y=o.animationDuration,l=o.animationEasing,u=o.animationId,p=o.animateNewValues,v=o.width,d=o.height,g=this.state,b=g.prevPoints,m=g.totalLength;return w.createElement(se,{begin:f,duration:y,isActive:h,easing:l,from:{t:0},to:{t:1},key:"line-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(x){var O=x.t;if(b){var j=b.length/c.length,T=c.map(function(_,ut){var G=Math.floor(ut*j);if(b[G]){var U=b[G],I=Y(U.x,_.x),qt=Y(U.y,_.y);return S(S({},_),{},{x:I(O),y:qt(O)})}if(p){var Xt=Y(v*2,_.x),Ht=Y(d/2,_.y);return S(S({},_),{},{x:Xt(O),y:Ht(O)})}return S(S({},_),{},{x:_.x,y:_.y})});return a.renderCurveStatically(T,r,i)}var N=Y(0,m),L=N(O),V;if(s){var Q="".concat(s).split(/[,\s]+/gim).map(function(_){return parseFloat(_)});V=a.getStrokeDasharray(L,m,Q)}else V=a.generateSimpleStrokeDasharray(m,L);return a.renderCurveStatically(c,r,i,{strokeDasharray:V})})}},{key:"renderCurve",value:function(r,i){var a=this.props,o=a.points,c=a.isAnimationActive,s=this.state,h=s.prevPoints,f=s.totalLength;return c&&o&&o.length&&(!h&&f>0||!ue(h,o))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(o,r,i)}},{key:"render",value:function(){var r,i=this.props,a=i.hide,o=i.dot,c=i.points,s=i.className,h=i.xAxis,f=i.yAxis,y=i.top,l=i.left,u=i.width,p=i.height,v=i.isAnimationActive,d=i.id;if(a||!c||!c.length)return null;var g=this.state.isAnimationFinished,b=c.length===1,m=C("recharts-line",s),x=h&&h.allowDataOverflow,O=f&&f.allowDataOverflow,j=x||O,T=yt(d)?this.id:d,N=(r=$(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},L=N.r,V=L===void 0?3:L,Q=N.strokeWidth,_=Q===void 0?2:Q,ut=le(o)?o:{},G=ut.clipDot,U=G===void 0?!0:G,I=V*2+_;return w.createElement(X,{className:m},x||O?w.createElement("defs",null,w.createElement("clipPath",{id:"clipPath-".concat(T)},w.createElement("rect",{x:x?l:l-u/2,y:O?y:y-p/2,width:x?u:u*2,height:O?p:p*2})),!U&&w.createElement("clipPath",{id:"clipPath-dots-".concat(T)},w.createElement("rect",{x:l-I/2,y:y-I/2,width:u+I,height:p+I}))):null,!b&&this.renderCurve(j,T),this.renderErrorBar(j,T),(b||o)&&this.renderDots(j,U,T),(!v||g)&&fe.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var a=r.length%2!==0?[].concat(z(r),[0]):r,o=[],c=0;c<i;++c)o=[].concat(z(o),z(a));return o}},{key:"renderDotItem",value:function(r,i){var a;if(w.isValidElement(r))a=w.cloneElement(r,i);else if(q(r))a=r(i);else{var o=i.key,c=jt(i,We),s=C("recharts-line-dot",typeof r!="boolean"?r.className:"");a=w.createElement(ie,H({key:o},c,{className:s}))}return a}}])})(D.PureComponent);E(W,"displayName","Line");E(W,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Ct.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});E(W,"getComposedData",function(t){var e=t.props,n=t.xAxis,r=t.yAxis,i=t.xAxisTicks,a=t.yAxisTicks,o=t.dataKey,c=t.bandSize,s=t.displayedData,h=t.offset,f=e.layout,y=s.map(function(l,u){var p=Dt(l,o);return f==="horizontal"?{x:kt({axis:n,ticks:i,bandSize:c,entry:l,index:u}),y:yt(p)?null:r.scale(p),value:p,payload:l}:{x:yt(p)?null:n.scale(p),y:kt({axis:r,ticks:a,bandSize:c,entry:l,index:u}),value:p,payload:l}});return S({points:y,layout:f},h)});function K(t){"@babel/helpers - typeof";return K=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K(t)}function tr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function er(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Vt(r.key),r)}}function rr(t,e,n){return e&&er(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function nr(t,e,n){return e=it(e),ir(t,Kt()?Reflect.construct(e,n||[],it(t).constructor):e.apply(t,n))}function ir(t,e){if(e&&(K(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return or(t)}function or(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Kt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kt=function(){return!!t})()}function it(t){return it=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},it(t)}function ar(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bt(t,e)}function bt(t,e){return bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},bt(t,e)}function Mt(t,e,n){return e=Vt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vt(t){var e=cr(t,"string");return K(e)=="symbol"?e:e+""}function cr(t,e){if(K(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(K(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function gt(){return gt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gt.apply(this,arguments)}function sr(t){var e=t.xAxisId,n=Nt(),r=Lt(),i=he(e);return i==null?null:D.createElement(at,gt({},i,{className:C("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return It(o,!0)}}))}var ct=(function(t){function e(){return tr(this,e),nr(this,e,arguments)}return ar(e,t),rr(e,[{key:"render",value:function(){return D.createElement(sr,this.props)}}])})(D.Component);Mt(ct,"displayName","XAxis");Mt(ct,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function M(t){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(t)}function ur(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Yt(r.key),r)}}function fr(t,e,n){return e&&lr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function pr(t,e,n){return e=ot(e),hr(t,Gt()?Reflect.construct(e,n||[],ot(t).constructor):e.apply(t,n))}function hr(t,e){if(e&&(M(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yr(t)}function yr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Gt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Gt=function(){return!!t})()}function ot(t){return ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ot(t)}function vr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xt(t,e)}function xt(t,e){return xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},xt(t,e)}function Ut(t,e,n){return e=Yt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yt(t){var e=dr(t,"string");return M(e)=="symbol"?e:e+""}function dr(t,e){if(M(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(M(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Ot(){return Ot=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ot.apply(this,arguments)}var mr=function(e){var n=e.yAxisId,r=Nt(),i=Lt(),a=ye(n);return a==null?null:D.createElement(at,Ot({},a,{className:C("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(c){return It(c,!0)}}))},st=(function(t){function e(){return ur(this,e),pr(this,e,arguments)}return vr(e,t),fr(e,[{key:"render",value:function(){return D.createElement(mr,this.props)}}])})(D.Component);Ut(st,"displayName","YAxis");Ut(st,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});var br=ve({chartName:"LineChart",GraphicalChild:W,axisComponents:[{axisType:"xAxis",AxisComp:ct},{axisType:"yAxis",AxisComp:st}],formatAxisMap:de});function $t(t){const e=new Date(t);return`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`}function tt(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function wr(){const{t}=Jt("panels"),e=Qt(i=>i.tokenHistory);if(e.length<2)return A.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-gray-500 dark:text-gray-400",children:t("common:empty.waitingUsageData")});const n=gr(e,5),r=e.map(i=>{const a={timestamp:i.timestamp,time:$t(i.timestamp),total:i.total};for(const o of n)a[o]=i.byAgent[o]??0;return a});return A.jsx(me,{width:"100%",height:200,children:A.jsxs(br,{data:r,margin:{top:5,right:5,left:0,bottom:0},children:[A.jsx(ct,{dataKey:"time",tick:{fontSize:10}}),A.jsx(st,{tick:{fontSize:10},tickFormatter:tt}),A.jsx(be,{formatter:i=>tt(i),labelFormatter:(i,a)=>{var c;const o=(c=a[0])==null?void 0:c.payload;return o?$t(o.timestamp):""},content:({active:i,payload:a,label:o})=>{var f;if(!i||!(a!=null&&a.length))return null;const c=(f=a[0])==null?void 0:f.payload;if(!c)return null;const s=c.total,h=[A.jsxs("div",{children:[t("tokenChart.total")," ",tt(s)]},"total"),...n.map((y,l)=>{const u=c[y]??0;return A.jsxs("div",{style:{color:Z[l%Z.length]},children:[y,": ",tt(u)]},y)})];return A.jsxs("div",{className:"rounded border border-gray-200 bg-white px-2 py-1 text-xs shadow dark:border-gray-700 dark:bg-gray-900",children:[A.jsx("div",{className:"font-medium text-gray-700 dark:text-gray-300",children:o}),h]})}}),A.jsx(W,{type:"monotone",dataKey:"total",stroke:"#3b82f6",strokeWidth:2,dot:!1,name:t("tokenChart.totalLine")}),n.map((i,a)=>A.jsx(W,{type:"monotone",dataKey:i,stroke:Z[a%Z.length],strokeWidth:1,strokeDasharray:"4 2",dot:!1,name:i},i))]})})}function gr(t,e){const n={};for(const r of t)for(const[i,a]of Object.entries(r.byAgent))n[i]=(n[i]??0)+a;return Object.entries(n).toSorted(([,r],[,i])=>i-r).slice(0,e).map(([r])=>r)}export{wr as TokenLineChart};
|
package/dist/assets/{generateCategoricalChart-3d0tNdH3.js → generateCategoricalChart-K9WHzrHy.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as Cn,g as ce,d as k,e as E}from"./index-
|
|
1
|
+
import{k as Cn,g as ce,d as k,e as E}from"./index-CsSAduQA.js";function om(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=om(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ue(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=om(e))&&(n&&(n+=" "),n+=t);return n}var ya,jf;function Ce(){if(jf)return ya;jf=1;var e=Array.isArray;return ya=e,ya}var ga,Cf;function um(){if(Cf)return ga;Cf=1;var e=typeof Cn=="object"&&Cn&&Cn.Object===Object&&Cn;return ga=e,ga}var ma,If;function tt(){if(If)return ma;If=1;var e=um(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return ma=r,ma}var ba,$f;function _n(){if($f)return ba;$f=1;var e=tt(),t=e.Symbol;return ba=t,ba}var xa,Rf;function rx(){if(Rf)return xa;Rf=1;var e=_n(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var u=r.call(o,i),s=o[i];try{o[i]=void 0;var c=!0}catch{}var f=n.call(o);return c&&(u?o[i]=s:delete o[i]),f}return xa=a,xa}var wa,Df;function nx(){if(Df)return wa;Df=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return wa=r,wa}var _a,Nf;function ht(){if(Nf)return _a;Nf=1;var e=_n(),t=rx(),r=nx(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(u){return u==null?u===void 0?i:n:a&&a in Object(u)?t(u):r(u)}return _a=o,_a}var Oa,qf;function pt(){if(qf)return Oa;qf=1;function e(t){return t!=null&&typeof t=="object"}return Oa=e,Oa}var Sa,kf;function br(){if(kf)return Sa;kf=1;var e=ht(),t=pt(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return Sa=n,Sa}var Aa,Bf;function Ml(){if(Bf)return Aa;Bf=1;var e=Ce(),t=br(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var u=typeof a;return u=="number"||u=="symbol"||u=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return Aa=i,Aa}var Pa,Lf;function xt(){if(Lf)return Pa;Lf=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Pa=e,Pa}var Ta,Ff;function jl(){if(Ff)return Ta;Ff=1;var e=ht(),t=xt(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(u){if(!t(u))return!1;var s=e(u);return s==n||s==i||s==r||s==a}return Ta=o,Ta}var Ea,Uf;function ix(){if(Uf)return Ea;Uf=1;var e=tt(),t=e["__core-js_shared__"];return Ea=t,Ea}var Ma,Wf;function ax(){if(Wf)return Ma;Wf=1;var e=ix(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Ma=r,Ma}var ja,Hf;function sm(){if(Hf)return ja;Hf=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return ja=r,ja}var Ca,zf;function ox(){if(zf)return Ca;zf=1;var e=jl(),t=ax(),r=xt(),n=sm(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,s=o.toString,c=u.hasOwnProperty,f=RegExp("^"+s.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(h){if(!r(h)||t(h))return!1;var d=e(h)?f:a;return d.test(n(h))}return Ca=l,Ca}var Ia,Gf;function ux(){if(Gf)return Ia;Gf=1;function e(t,r){return t==null?void 0:t[r]}return Ia=e,Ia}var $a,Kf;function Ft(){if(Kf)return $a;Kf=1;var e=ox(),t=ux();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return $a=r,$a}var Ra,Xf;function Ni(){if(Xf)return Ra;Xf=1;var e=Ft(),t=e(Object,"create");return Ra=t,Ra}var Da,Vf;function sx(){if(Vf)return Da;Vf=1;var e=Ni();function t(){this.__data__=e?e(null):{},this.size=0}return Da=t,Da}var Na,Yf;function cx(){if(Yf)return Na;Yf=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Na=e,Na}var qa,Zf;function lx(){if(Zf)return qa;Zf=1;var e=Ni(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var u=o[a];return u===t?void 0:u}return n.call(o,a)?o[a]:void 0}return qa=i,qa}var ka,Jf;function fx(){if(Jf)return ka;Jf=1;var e=Ni(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return ka=n,ka}var Ba,Qf;function hx(){if(Qf)return Ba;Qf=1;var e=Ni(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return Ba=r,Ba}var La,eh;function px(){if(eh)return La;eh=1;var e=sx(),t=cx(),r=lx(),n=fx(),i=hx();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,La=a,La}var Fa,th;function dx(){if(th)return Fa;th=1;function e(){this.__data__=[],this.size=0}return Fa=e,Fa}var Ua,rh;function Cl(){if(rh)return Ua;rh=1;function e(t,r){return t===r||t!==t&&r!==r}return Ua=e,Ua}var Wa,nh;function qi(){if(nh)return Wa;nh=1;var e=Cl();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return Wa=t,Wa}var Ha,ih;function vx(){if(ih)return Ha;ih=1;var e=qi(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var u=a.length-1;return o==u?a.pop():r.call(a,o,1),--this.size,!0}return Ha=n,Ha}var za,ah;function yx(){if(ah)return za;ah=1;var e=qi();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return za=t,za}var Ga,oh;function gx(){if(oh)return Ga;oh=1;var e=qi();function t(r){return e(this.__data__,r)>-1}return Ga=t,Ga}var Ka,uh;function mx(){if(uh)return Ka;uh=1;var e=qi();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return Ka=t,Ka}var Xa,sh;function ki(){if(sh)return Xa;sh=1;var e=dx(),t=vx(),r=yx(),n=gx(),i=mx();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Xa=a,Xa}var Va,ch;function Il(){if(ch)return Va;ch=1;var e=Ft(),t=tt(),r=e(t,"Map");return Va=r,Va}var Ya,lh;function bx(){if(lh)return Ya;lh=1;var e=px(),t=ki(),r=Il();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Ya=n,Ya}var Za,fh;function xx(){if(fh)return Za;fh=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Za=e,Za}var Ja,hh;function Bi(){if(hh)return Ja;hh=1;var e=xx();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Ja=t,Ja}var Qa,ph;function wx(){if(ph)return Qa;ph=1;var e=Bi();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Qa=t,Qa}var eo,dh;function _x(){if(dh)return eo;dh=1;var e=Bi();function t(r){return e(this,r).get(r)}return eo=t,eo}var to,vh;function Ox(){if(vh)return to;vh=1;var e=Bi();function t(r){return e(this,r).has(r)}return to=t,to}var ro,yh;function Sx(){if(yh)return ro;yh=1;var e=Bi();function t(r,n){var i=e(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return ro=t,ro}var no,gh;function $l(){if(gh)return no;gh=1;var e=bx(),t=wx(),r=_x(),n=Ox(),i=Sx();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,no=a,no}var io,mh;function cm(){if(mh)return io;mh=1;var e=$l(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,u=i?i.apply(this,o):o[0],s=a.cache;if(s.has(u))return s.get(u);var c=n.apply(this,o);return a.cache=s.set(u,c)||s,c};return a.cache=new(r.Cache||e),a}return r.Cache=e,io=r,io}var ao,bh;function Ax(){if(bh)return ao;bh=1;var e=cm(),t=500;function r(n){var i=e(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return ao=r,ao}var oo,xh;function Px(){if(xh)return oo;xh=1;var e=Ax(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,u,s,c){a.push(s?c.replace(r,"$1"):u||o)}),a});return oo=n,oo}var uo,wh;function Rl(){if(wh)return uo;wh=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=Array(i);++n<i;)a[n]=r(t[n],n,t);return a}return uo=e,uo}var so,_h;function Tx(){if(_h)return so;_h=1;var e=_n(),t=Rl(),r=Ce(),n=br(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(u){if(typeof u=="string")return u;if(r(u))return t(u,o)+"";if(n(u))return a?a.call(u):"";var s=u+"";return s=="0"&&1/u==-1/0?"-0":s}return so=o,so}var co,Oh;function lm(){if(Oh)return co;Oh=1;var e=Tx();function t(r){return r==null?"":e(r)}return co=t,co}var lo,Sh;function fm(){if(Sh)return lo;Sh=1;var e=Ce(),t=Ml(),r=Px(),n=lm();function i(a,o){return e(a)?a:t(a,o)?[a]:r(n(a))}return lo=i,lo}var fo,Ah;function Li(){if(Ah)return fo;Ah=1;var e=br();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return fo=t,fo}var ho,Ph;function Dl(){if(Ph)return ho;Ph=1;var e=fm(),t=Li();function r(n,i){i=e(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[t(i[a++])];return a&&a==o?n:void 0}return ho=r,ho}var po,Th;function hm(){if(Th)return po;Th=1;var e=Dl();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return po=t,po}var Ex=hm();const Ze=ce(Ex);var vo,Eh;function Mx(){if(Eh)return vo;Eh=1;function e(t){return t==null}return vo=e,vo}var jx=Mx();const Y=ce(jx);var yo,Mh;function Cx(){if(Mh)return yo;Mh=1;var e=ht(),t=Ce(),r=pt(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return yo=i,yo}var Ix=Cx();const kt=ce(Ix);var $x=jl();const J=ce($x);var Rx=xt();const xr=ce(Rx);var go={exports:{}},ee={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-is.production.min.js
|
|
4
4
|
*
|