@origintrail-official/dkg-node-ui 10.0.0 → 10.0.2

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.
Files changed (39) hide show
  1. package/dist/index.d.ts +4 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +4 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/otlp-log-worker.d.ts +127 -0
  6. package/dist/otlp-log-worker.d.ts.map +1 -0
  7. package/dist/otlp-log-worker.js +268 -0
  8. package/dist/otlp-log-worker.js.map +1 -0
  9. package/dist/telemetry-resource.d.ts +41 -0
  10. package/dist/telemetry-resource.d.ts.map +1 -0
  11. package/dist/telemetry-resource.js +31 -0
  12. package/dist/telemetry-resource.js.map +1 -0
  13. package/dist/telemetry.d.ts +75 -16
  14. package/dist/telemetry.d.ts.map +1 -1
  15. package/dist/telemetry.js +152 -29
  16. package/dist/telemetry.js.map +1 -1
  17. package/dist-ui/assets/{3d-force-graph-CJApDMaR.js → 3d-force-graph-CcVMtgO4.js} +1 -1
  18. package/dist-ui/assets/Admin-DNNaF7rz.js +45 -0
  19. package/dist-ui/assets/{AgentHub-B2hxc5jq.js → AgentHub-eWb_Tns6.js} +1 -1
  20. package/dist-ui/assets/AgentProfilePage-D2T_V6PG.js +1 -0
  21. package/dist-ui/assets/Network-C6MDsv2e.js +1 -0
  22. package/dist-ui/assets/OnChainProvenanceCard-BbrU7jzL.js +1 -0
  23. package/dist-ui/assets/{Operations-F276JTZb.js → Operations-CCMDENBd.js} +3 -3
  24. package/dist-ui/assets/Settings-WaFKYtwQ.js +1 -0
  25. package/dist-ui/assets/ccip-CDdHldzo.js +1 -0
  26. package/dist-ui/assets/formatTrac-BTy0WudH.js +1 -0
  27. package/dist-ui/assets/{index--rkHgZxC.js → index-2Gzrk1k3.js} +164 -173
  28. package/dist-ui/assets/{index-DOgQqEa_.js → index-BrxEjqsW.js} +3 -3
  29. package/dist-ui/assets/{index-BgRu6zNc.css → index-CmliV5st.css} +1 -1
  30. package/dist-ui/assets/{index-IQUCPHDs.js → index-W4n8cdTA.js} +11 -11
  31. package/dist-ui/assets/{jsonld-32FQRO67-C6LUWPog.js → jsonld-32FQRO67-CbN9NJJW.js} +2 -2
  32. package/dist-ui/assets/{jsonld-RkISz_bF.js → jsonld-DkQdPwg5.js} +1 -1
  33. package/dist-ui/assets/{renderer-3d-2EVDZII7-DwK8fIlO.js → renderer-3d-2EVDZII7-CTUExXUn.js} +2 -2
  34. package/dist-ui/index.html +2 -2
  35. package/package.json +13 -4
  36. package/dist-ui/assets/AgentProfilePage-CDWiC_8K.js +0 -1
  37. package/dist-ui/assets/Network-DqdABbM7.js +0 -1
  38. package/dist-ui/assets/OnChainProvenanceCard-DDG5hBdy.js +0 -1
  39. package/dist-ui/assets/Settings-CXLPuyz1.js +0 -1
@@ -1,4 +1,4 @@
1
- import{f as oi,I as le,M as $,R as P,d as ne,K as h,$ as Re,G as vt,D as lt,N as gi,s as Yx,q as Zx,u as Jx,r as Qx,t as e1,l as t1,i as r1,j as n1,m as i1,x as a1,p as o1,w as s1,o as u1,n as c1}from"./index--rkHgZxC.js";import{a as l1,e as Uc,c as ld,f as fd,g as f1,h as dd,m as hd,o as Bg,d as at,b as Pt,i as d1}from"./ordinal-DhEzRPdO.js";function h1(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function p1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function v1(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=Gr(e[o],t[o]);for(;o<r;++o)a[o]=t[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}function y1(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function m1(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Gr(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}function Gr(e,t){var r=typeof t,n;return t==null||r==="boolean"?l1(t):(r==="number"?Uc:r==="string"?(n=ld(t))?(t=n,fd):f1:t instanceof ld?fd:t instanceof Date?y1:p1(t)?h1:Array.isArray(t)?v1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?m1:Uc)(e,t)}function of(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function g1(e,t){t===void 0&&(t=e,e=Gr);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(o){var s=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return a[s](o-s)}}function Dt(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function b1(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function sf(e){let t,r,n;e.length!==2?(t=Dt,r=(s,u)=>Dt(e(s),u),n=(s,u)=>e(s)-u):(t=e===Dt||e===b1?e:x1,r=e,n=e);function i(s,u,c=0,f=s.length){if(c<f){if(t(u,u)!==0)return f;do{const l=c+f>>>1;r(s[l],u)<0?c=l+1:f=l}while(c<f)}return c}function a(s,u,c=0,f=s.length){if(c<f){if(t(u,u)!==0)return f;do{const l=c+f>>>1;r(s[l],u)<=0?c=l+1:f=l}while(c<f)}return c}function o(s,u,c=0,f=s.length){const l=i(s,u,c,f-1);return l>c&&n(s[l-1],u)>-n(s[l],u)?l-1:l}return{left:i,center:o,right:a}}function x1(){return 0}function Lg(e){return e===null?NaN:+e}function*w1(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const _1=sf(Dt),Qn=_1.right;sf(Lg).center;function O1(e=Dt){if(e===Dt)return qg;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function qg(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const S1=Math.sqrt(50),j1=Math.sqrt(10),A1=Math.sqrt(2);function bi(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=S1?10:a>=j1?5:a>=A1?2:1;let s,u,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(e*c),u=Math.round(t*c),s/c<e&&++s,u/c>t&&--u,c=-c):(c=Math.pow(10,i)*o,s=Math.round(e/c),u=Math.round(t/c),s*c<e&&++s,u*c>t&&--u),u<s&&.5<=r&&r<2?bi(e,t,r*2):[s,u,c]}function Gc(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,a,o]=n?bi(t,e,r):bi(e,t,r);if(!(a>=i))return[];const s=a-i+1,u=new Array(s);if(n)if(o<0)for(let c=0;c<s;++c)u[c]=(a-c)/-o;else for(let c=0;c<s;++c)u[c]=(a-c)*o;else if(o<0)for(let c=0;c<s;++c)u[c]=(i+c)/-o;else for(let c=0;c<s;++c)u[c]=(i+c)*o;return u}function Hc(e,t,r){return t=+t,e=+e,r=+r,bi(e,t,r)[2]}function Kc(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?Hc(t,e,r):Hc(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function zg(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?qg:O1(i);n>r;){if(n-r>600){const u=n-r+1,c=t-r+1,f=Math.log(u),l=.5*Math.exp(2*f/3),d=.5*Math.sqrt(f*l*(u-l)/u)*(c-u/2<0?-1:1),v=Math.max(r,Math.floor(t-c*l/u+d)),m=Math.min(n,Math.floor(t+(u-c)*l/u+d));zg(e,t,v,m,i)}const a=e[t];let o=r,s=n;for(en(e,r,t),i(e[n],a)>0&&en(e,r,n);o<s;){for(en(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[r],a)===0?en(e,r,s):(++s,en(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function en(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function P1(e,t,r){if(e=Float64Array.from(w1(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return dd(e);if(t>=1)return hd(e);var n,i=(n-1)*t,a=Math.floor(i),o=hd(zg(e,a).subarray(0,a+1)),s=dd(e.subarray(a+1));return o+(s-o)*(i-a)}}function T1(e,t,r=Lg){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function E1(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n<i;)a[n]=e+n*r;return a}function bn(){var e=Bg().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,a,o,s=!1,u=0,c=0,f=.5;delete e.unknown;function l(){var d=t().length,v=i<n,m=v?i:n,y=v?n:i;a=(y-m)/Math.max(1,d-u+c*2),s&&(a=Math.floor(a)),m+=(y-m-a*(d-u))*f,o=a*(1-u),s&&(m=Math.round(m),o=Math.round(o));var p=E1(d).map(function(g){return m+a*g});return r(v?p.reverse():p)}return e.domain=function(d){return arguments.length?(t(d),l()):t()},e.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,l()):[n,i]},e.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,s=!0,l()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(d){return arguments.length?(s=!!d,l()):s},e.padding=function(d){return arguments.length?(u=Math.min(1,c=+d),l()):u},e.paddingInner=function(d){return arguments.length?(u=Math.min(1,d),l()):u},e.paddingOuter=function(d){return arguments.length?(c=+d,l()):c},e.align=function(d){return arguments.length?(f=Math.max(0,Math.min(1,d)),l()):f},e.copy=function(){return bn(t(),[n,i]).round(s).paddingInner(u).paddingOuter(c).align(f)},at.apply(l(),arguments)}function Fg(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Fg(t())},e}function pn(){return Fg(bn.apply(null,arguments).paddingInner(1))}function M1(e){return function(){return e}}function xi(e){return+e}var pd=[0,1];function ke(e){return e}function Vc(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:M1(isNaN(t)?NaN:.5)}function C1(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function I1(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i<n?(n=Vc(i,n),a=r(o,a)):(n=Vc(n,i),a=r(a,o)),function(s){return a(n(s))}}function k1(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),a=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)i[o]=Vc(e[o],e[o+1]),a[o]=r(t[o],t[o+1]);return function(s){var u=Qn(e,s,1,n)-1;return a[u](i[u](s))}}function ei(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function va(){var e=pd,t=pd,r=Gr,n,i,a,o=ke,s,u,c;function f(){var d=Math.min(e.length,t.length);return o!==ke&&(o=C1(e[0],e[d-1])),s=d>2?k1:I1,u=c=null,l}function l(d){return d==null||isNaN(d=+d)?a:(u||(u=s(e.map(n),t,r)))(n(o(d)))}return l.invert=function(d){return o(i((c||(c=s(t,e.map(n),Uc)))(d)))},l.domain=function(d){return arguments.length?(e=Array.from(d,xi),f()):e.slice()},l.range=function(d){return arguments.length?(t=Array.from(d),f()):t.slice()},l.rangeRound=function(d){return t=Array.from(d),r=of,f()},l.clamp=function(d){return arguments.length?(o=d?!0:ke,f()):o!==ke},l.interpolate=function(d){return arguments.length?(r=d,f()):r},l.unknown=function(d){return arguments.length?(a=d,l):a},function(d,v){return n=d,i=v,f()}}function uf(){return va()(ke,ke)}function $1(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function wi(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Or(e){return e=wi(Math.abs(e)),e?e[1]:NaN}function N1(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>n&&(s=Math.max(1,n-u)),a.push(r.substring(i-=s,i+s)),!((u+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function R1(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var D1=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function xn(e){if(!(t=D1.exec(e)))throw new Error("invalid format: "+e);var t;return new cf({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}xn.prototype=cf.prototype;function cf(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}cf.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function B1(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var _i;function L1(e,t){var r=wi(e,t);if(!r)return _i=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(_i=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+wi(e,Math.max(0,t+a-1))[0]}function vd(e,t){var r=wi(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const yd={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:$1,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>vd(e*100,t),r:vd,s:L1,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function md(e){return e}var gd=Array.prototype.map,bd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function q1(e){var t=e.grouping===void 0||e.thousands===void 0?md:N1(gd.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?md:R1(gd.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function c(l,d){l=xn(l);var v=l.fill,m=l.align,y=l.sign,p=l.symbol,g=l.zero,x=l.width,O=l.comma,_=l.precision,b=l.trim,w=l.type;w==="n"?(O=!0,w="g"):yd[w]||(_===void 0&&(_=12),b=!0,w="g"),(g||v==="0"&&m==="=")&&(g=!0,v="0",m="=");var S=(d&&d.prefix!==void 0?d.prefix:"")+(p==="$"?r:p==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),j=(p==="$"?n:/[%p]/.test(w)?o:"")+(d&&d.suffix!==void 0?d.suffix:""),A=yd[w],C=/[defgprs%]/.test(w);_=_===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function E(T){var M=S,k=j,I,R,B;if(w==="c")k=A(T)+k,T="";else{T=+T;var q=T<0||1/T<0;if(T=isNaN(T)?u:A(Math.abs(T),_),b&&(T=B1(T)),q&&+T==0&&y!=="+"&&(q=!1),M=(q?y==="("?y:s:y==="-"||y==="("?"":y)+M,k=(w==="s"&&!isNaN(T)&&_i!==void 0?bd[8+_i/3]:"")+k+(q&&y==="("?")":""),C){for(I=-1,R=T.length;++I<R;)if(B=T.charCodeAt(I),48>B||B>57){k=(B===46?i+T.slice(I+1):T.slice(I))+k,T=T.slice(0,I);break}}}O&&!g&&(T=t(T,1/0));var z=M.length+T.length+k.length,G=z<x?new Array(x-z+1).join(v):"";switch(O&&g&&(T=t(G+T,G.length?x-k.length:1/0),G=""),m){case"<":T=M+T+k+G;break;case"=":T=M+G+T+k;break;case"^":T=G.slice(0,z=G.length>>1)+M+T+k+G.slice(z);break;default:T=G+M+T+k;break}return a(T)}return E.toString=function(){return l+""},E}function f(l,d){var v=Math.max(-8,Math.min(8,Math.floor(Or(d)/3)))*3,m=Math.pow(10,-v),y=c((l=xn(l),l.type="f",l),{suffix:bd[8+v/3]});return function(p){return y(m*p)}}return{format:c,formatPrefix:f}}var si,lf,Wg;z1({thousands:",",grouping:[3],currency:["$",""]});function z1(e){return si=q1(e),lf=si.format,Wg=si.formatPrefix,si}function F1(e){return Math.max(0,-Or(Math.abs(e)))}function W1(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Or(t)/3)))*3-Or(Math.abs(e)))}function U1(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Or(t)-Or(e))+1}function Ug(e,t,r,n){var i=Kc(e,t,r),a;switch(n=xn(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=W1(i,o))&&(n.precision=a),Wg(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=U1(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=F1(i))&&(n.precision=a-(n.type==="%")*2);break}}return lf(n)}function qt(e){var t=e.domain;return e.ticks=function(r){var n=t();return Gc(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Ug(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],u,c,f=10;for(s<o&&(c=o,o=s,s=c,c=i,i=a,a=c);f-- >0;){if(c=Hc(o,s,r),c===u)return n[i]=o,n[a]=s,t(n);if(c>0)o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c;else if(c<0)o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c;else break;u=c}return e},e}function Oi(){var e=uf();return e.copy=function(){return ei(e,Oi())},at.apply(e,arguments),qt(e)}function Gg(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,xi),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Gg(e).unknown(t)},e=arguments.length?Array.from(e,xi):[0,1],qt(r)}function Hg(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return a<i&&(o=r,r=n,n=o,o=i,i=a,a=o),e[r]=t.floor(i),e[n]=t.ceil(a),e}function xd(e){return Math.log(e)}function wd(e){return Math.exp(e)}function G1(e){return-Math.log(-e)}function H1(e){return-Math.exp(-e)}function K1(e){return isFinite(e)?+("1e"+e):e<0?0:e}function V1(e){return e===10?K1:e===Math.E?Math.exp:t=>Math.pow(e,t)}function X1(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function _d(e){return(t,r)=>-e(-t,r)}function ff(e){const t=e(xd,wd),r=t.domain;let n=10,i,a;function o(){return i=X1(n),a=V1(n),r()[0]<0?(i=_d(i),a=_d(a),e(G1,H1)):e(xd,wd),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const u=r();let c=u[0],f=u[u.length-1];const l=f<c;l&&([c,f]=[f,c]);let d=i(c),v=i(f),m,y;const p=s==null?10:+s;let g=[];if(!(n%1)&&v-d<p){if(d=Math.floor(d),v=Math.ceil(v),c>0){for(;d<=v;++d)for(m=1;m<n;++m)if(y=d<0?m/a(-d):m*a(d),!(y<c)){if(y>f)break;g.push(y)}}else for(;d<=v;++d)for(m=n-1;m>=1;--m)if(y=d>0?m/a(-d):m*a(d),!(y<c)){if(y>f)break;g.push(y)}g.length*2<p&&(g=Gc(c,f,p))}else g=Gc(d,v,Math.min(v-d,p)).map(a);return l?g.reverse():g},t.tickFormat=(s,u)=>{if(s==null&&(s=10),u==null&&(u=n===10?"s":","),typeof u!="function"&&(!(n%1)&&(u=xn(u)).precision==null&&(u.trim=!0),u=lf(u)),s===1/0)return u;const c=Math.max(1,n*s/t.ticks().length);return f=>{let l=f/a(Math.round(i(f)));return l*n<n-.5&&(l*=n),l<=c?u(f):""}},t.nice=()=>r(Hg(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function Kg(){const e=ff(va()).domain([1,10]);return e.copy=()=>ei(e,Kg()).base(e.base()),at.apply(e,arguments),e}function Od(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Sd(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function df(e){var t=1,r=e(Od(t),Sd(t));return r.constant=function(n){return arguments.length?e(Od(t=+n),Sd(t)):t},qt(r)}function Vg(){var e=df(va());return e.copy=function(){return ei(e,Vg()).constant(e.constant())},at.apply(e,arguments)}function jd(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Y1(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Z1(e){return e<0?-e*e:e*e}function hf(e){var t=e(ke,ke),r=1;function n(){return r===1?e(ke,ke):r===.5?e(Y1,Z1):e(jd(r),jd(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},qt(t)}function pf(){var e=hf(va());return e.copy=function(){return ei(e,pf()).exponent(e.exponent())},at.apply(e,arguments),e}function J1(){return pf.apply(null,arguments).exponent(.5)}function Ad(e){return Math.sign(e)*e*e}function Q1(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Xg(){var e=uf(),t=[0,1],r=!1,n;function i(a){var o=Q1(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(Ad(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,xi)).map(Ad)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Xg(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},at.apply(i,arguments),qt(i)}function Yg(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o<s;)r[o-1]=T1(e,o/s);return a}function a(o){return o==null||isNaN(o=+o)?n:t[Qn(r,o)]}return a.invertExtent=function(o){var s=t.indexOf(o);return s<0?[NaN,NaN]:[s>0?r[s-1]:e[0],s<r.length?r[s]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let s of o)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Dt),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(n=o,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return Yg().domain(e).range(t).unknown(n)},at.apply(a,arguments)}function Zg(){var e=0,t=1,r=1,n=[.5],i=[0,1],a;function o(u){return u!=null&&u<=u?i[Qn(n,u,0,r)]:a}function s(){var u=-1;for(n=new Array(r);++u<r;)n[u]=((u+1)*t-(u-r)*e)/(r+1);return o}return o.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,s()):[e,t]},o.range=function(u){return arguments.length?(r=(i=Array.from(u)).length-1,s()):i.slice()},o.invertExtent=function(u){var c=i.indexOf(u);return c<0?[NaN,NaN]:c<1?[e,n[0]]:c>=r?[n[r-1],t]:[n[c-1],n[c]]},o.unknown=function(u){return arguments.length&&(a=u),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Zg().domain([e,t]).range(i).unknown(a)},at.apply(qt(o),arguments)}function Jg(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[Qn(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Jg().domain(e).range(t).unknown(r)},at.apply(i,arguments)}const Va=new Date,Xa=new Date;function Oe(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o<s-a?o:s},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const u=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return u;let c;do u.push(c=new Date(+a)),t(a,s),e(a);while(c<a&&a<o);return u},i.filter=a=>Oe(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Va.setTime(+a),Xa.setTime(+o),e(Va),e(Xa),Math.floor(r(Va,Xa))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Si=Oe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Si.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Oe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Si);Si.range;const yt=1e3,Ze=yt*60,mt=Ze*60,Ot=mt*24,vf=Ot*7,Pd=Ot*30,Ya=Ot*365,Zt=Oe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*yt)},(e,t)=>(t-e)/yt,e=>e.getUTCSeconds());Zt.range;const yf=Oe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yt)},(e,t)=>{e.setTime(+e+t*Ze)},(e,t)=>(t-e)/Ze,e=>e.getMinutes());yf.range;const mf=Oe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ze)},(e,t)=>(t-e)/Ze,e=>e.getUTCMinutes());mf.range;const gf=Oe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yt-e.getMinutes()*Ze)},(e,t)=>{e.setTime(+e+t*mt)},(e,t)=>(t-e)/mt,e=>e.getHours());gf.range;const bf=Oe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*mt)},(e,t)=>(t-e)/mt,e=>e.getUTCHours());bf.range;const ti=Oe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ze)/Ot,e=>e.getDate()-1);ti.range;const ya=Oe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ot,e=>e.getUTCDate()-1);ya.range;const Qg=Oe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ot,e=>Math.floor(e/Ot));Qg.range;function lr(e){return Oe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Ze)/vf)}const ma=lr(0),ji=lr(1),ew=lr(2),tw=lr(3),Sr=lr(4),rw=lr(5),nw=lr(6);ma.range;ji.range;ew.range;tw.range;Sr.range;rw.range;nw.range;function fr(e){return Oe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/vf)}const ga=fr(0),Ai=fr(1),iw=fr(2),aw=fr(3),jr=fr(4),ow=fr(5),sw=fr(6);ga.range;Ai.range;iw.range;aw.range;jr.range;ow.range;sw.range;const xf=Oe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());xf.range;const wf=Oe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());wf.range;const St=Oe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());St.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Oe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});St.range;const jt=Oe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());jt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Oe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});jt.range;function eb(e,t,r,n,i,a){const o=[[Zt,1,yt],[Zt,5,5*yt],[Zt,15,15*yt],[Zt,30,30*yt],[a,1,Ze],[a,5,5*Ze],[a,15,15*Ze],[a,30,30*Ze],[i,1,mt],[i,3,3*mt],[i,6,6*mt],[i,12,12*mt],[n,1,Ot],[n,2,2*Ot],[r,1,vf],[t,1,Pd],[t,3,3*Pd],[e,1,Ya]];function s(c,f,l){const d=f<c;d&&([c,f]=[f,c]);const v=l&&typeof l.range=="function"?l:u(c,f,l),m=v?v.range(c,+f+1):[];return d?m.reverse():m}function u(c,f,l){const d=Math.abs(f-c)/l,v=sf(([,,p])=>p).right(o,d);if(v===o.length)return e.every(Kc(c/Ya,f/Ya,l));if(v===0)return Si.every(Math.max(Kc(c,f,l),1));const[m,y]=o[d/o[v-1][2]<o[v][2]/d?v-1:v];return m.every(y)}return[s,u]}const[uw,cw]=eb(jt,wf,ga,Qg,bf,mf),[lw,fw]=eb(St,xf,ma,ti,gf,yf);function Za(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ja(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function tn(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function dw(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,u=e.shortMonths,c=rn(i),f=nn(i),l=rn(a),d=nn(a),v=rn(o),m=nn(o),y=rn(s),p=nn(s),g=rn(u),x=nn(u),O={a:B,A:q,b:z,B:G,c:null,d:kd,e:kd,f:Nw,g:Gw,G:Kw,H:Iw,I:kw,j:$w,L:tb,m:Rw,M:Dw,p:K,q:W,Q:Rd,s:Dd,S:Bw,u:Lw,U:qw,V:zw,w:Fw,W:Ww,x:null,X:null,y:Uw,Y:Hw,Z:Vw,"%":Nd},_={a:V,A:ue,b:ve,B:Le,c:null,d:$d,e:$d,f:Jw,g:u_,G:l_,H:Xw,I:Yw,j:Zw,L:nb,m:Qw,M:e_,p:Gt,q:$e,Q:Rd,s:Dd,S:t_,u:r_,U:n_,V:i_,w:a_,W:o_,x:null,X:null,y:s_,Y:c_,Z:f_,"%":Nd},b={a:C,A:E,b:T,B:M,c:k,d:Cd,e:Cd,f:Tw,g:Md,G:Ed,H:Id,I:Id,j:Sw,L:Pw,m:Ow,M:jw,p:A,q:_w,Q:Mw,s:Cw,S:Aw,u:mw,U:gw,V:bw,w:yw,W:xw,x:I,X:R,y:Md,Y:Ed,Z:ww,"%":Ew};O.x=w(r,O),O.X=w(n,O),O.c=w(t,O),_.x=w(r,_),_.X=w(n,_),_.c=w(t,_);function w(F,X){return function(Z){var D=[],he=-1,ee=0,ge=F.length,be,Ne,Mt;for(Z instanceof Date||(Z=new Date(+Z));++he<ge;)F.charCodeAt(he)===37&&(D.push(F.slice(ee,he)),(Ne=Td[be=F.charAt(++he)])!=null?be=F.charAt(++he):Ne=be==="e"?" ":"0",(Mt=X[be])&&(be=Mt(Z,Ne)),D.push(be),ee=he+1);return D.push(F.slice(ee,he)),D.join("")}}function S(F,X){return function(Z){var D=tn(1900,void 0,1),he=j(D,F,Z+="",0),ee,ge;if(he!=Z.length)return null;if("Q"in D)return new Date(D.Q);if("s"in D)return new Date(D.s*1e3+("L"in D?D.L:0));if(X&&!("Z"in D)&&(D.Z=0),"p"in D&&(D.H=D.H%12+D.p*12),D.m===void 0&&(D.m="q"in D?D.q:0),"V"in D){if(D.V<1||D.V>53)return null;"w"in D||(D.w=1),"Z"in D?(ee=Ja(tn(D.y,0,1)),ge=ee.getUTCDay(),ee=ge>4||ge===0?Ai.ceil(ee):Ai(ee),ee=ya.offset(ee,(D.V-1)*7),D.y=ee.getUTCFullYear(),D.m=ee.getUTCMonth(),D.d=ee.getUTCDate()+(D.w+6)%7):(ee=Za(tn(D.y,0,1)),ge=ee.getDay(),ee=ge>4||ge===0?ji.ceil(ee):ji(ee),ee=ti.offset(ee,(D.V-1)*7),D.y=ee.getFullYear(),D.m=ee.getMonth(),D.d=ee.getDate()+(D.w+6)%7)}else("W"in D||"U"in D)&&("w"in D||(D.w="u"in D?D.u%7:"W"in D?1:0),ge="Z"in D?Ja(tn(D.y,0,1)).getUTCDay():Za(tn(D.y,0,1)).getDay(),D.m=0,D.d="W"in D?(D.w+6)%7+D.W*7-(ge+5)%7:D.w+D.U*7-(ge+6)%7);return"Z"in D?(D.H+=D.Z/100|0,D.M+=D.Z%100,Ja(D)):Za(D)}}function j(F,X,Z,D){for(var he=0,ee=X.length,ge=Z.length,be,Ne;he<ee;){if(D>=ge)return-1;if(be=X.charCodeAt(he++),be===37){if(be=X.charAt(he++),Ne=b[be in Td?X.charAt(he++):be],!Ne||(D=Ne(F,Z,D))<0)return-1}else if(be!=Z.charCodeAt(D++))return-1}return D}function A(F,X,Z){var D=c.exec(X.slice(Z));return D?(F.p=f.get(D[0].toLowerCase()),Z+D[0].length):-1}function C(F,X,Z){var D=v.exec(X.slice(Z));return D?(F.w=m.get(D[0].toLowerCase()),Z+D[0].length):-1}function E(F,X,Z){var D=l.exec(X.slice(Z));return D?(F.w=d.get(D[0].toLowerCase()),Z+D[0].length):-1}function T(F,X,Z){var D=g.exec(X.slice(Z));return D?(F.m=x.get(D[0].toLowerCase()),Z+D[0].length):-1}function M(F,X,Z){var D=y.exec(X.slice(Z));return D?(F.m=p.get(D[0].toLowerCase()),Z+D[0].length):-1}function k(F,X,Z){return j(F,t,X,Z)}function I(F,X,Z){return j(F,r,X,Z)}function R(F,X,Z){return j(F,n,X,Z)}function B(F){return o[F.getDay()]}function q(F){return a[F.getDay()]}function z(F){return u[F.getMonth()]}function G(F){return s[F.getMonth()]}function K(F){return i[+(F.getHours()>=12)]}function W(F){return 1+~~(F.getMonth()/3)}function V(F){return o[F.getUTCDay()]}function ue(F){return a[F.getUTCDay()]}function ve(F){return u[F.getUTCMonth()]}function Le(F){return s[F.getUTCMonth()]}function Gt(F){return i[+(F.getUTCHours()>=12)]}function $e(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var X=w(F+="",O);return X.toString=function(){return F},X},parse:function(F){var X=S(F+="",!1);return X.toString=function(){return F},X},utcFormat:function(F){var X=w(F+="",_);return X.toString=function(){return F},X},utcParse:function(F){var X=S(F+="",!0);return X.toString=function(){return F},X}}}var Td={"-":"",_:" ",0:"0"},Pe=/^\s*\d+/,hw=/^%/,pw=/[\\^$*+?|[\]().{}]/g;function re(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(t)+i:i)}function vw(e){return e.replace(pw,"\\$&")}function rn(e){return new RegExp("^(?:"+e.map(vw).join("|")+")","i")}function nn(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function yw(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function mw(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function gw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function bw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function xw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Ed(e,t,r){var n=Pe.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Md(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function ww(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function _w(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Ow(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Cd(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Sw(e,t,r){var n=Pe.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Id(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function jw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Aw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Pw(e,t,r){var n=Pe.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Tw(e,t,r){var n=Pe.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Ew(e,t,r){var n=hw.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Mw(e,t,r){var n=Pe.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Cw(e,t,r){var n=Pe.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function kd(e,t){return re(e.getDate(),t,2)}function Iw(e,t){return re(e.getHours(),t,2)}function kw(e,t){return re(e.getHours()%12||12,t,2)}function $w(e,t){return re(1+ti.count(St(e),e),t,3)}function tb(e,t){return re(e.getMilliseconds(),t,3)}function Nw(e,t){return tb(e,t)+"000"}function Rw(e,t){return re(e.getMonth()+1,t,2)}function Dw(e,t){return re(e.getMinutes(),t,2)}function Bw(e,t){return re(e.getSeconds(),t,2)}function Lw(e){var t=e.getDay();return t===0?7:t}function qw(e,t){return re(ma.count(St(e)-1,e),t,2)}function rb(e){var t=e.getDay();return t>=4||t===0?Sr(e):Sr.ceil(e)}function zw(e,t){return e=rb(e),re(Sr.count(St(e),e)+(St(e).getDay()===4),t,2)}function Fw(e){return e.getDay()}function Ww(e,t){return re(ji.count(St(e)-1,e),t,2)}function Uw(e,t){return re(e.getFullYear()%100,t,2)}function Gw(e,t){return e=rb(e),re(e.getFullYear()%100,t,2)}function Hw(e,t){return re(e.getFullYear()%1e4,t,4)}function Kw(e,t){var r=e.getDay();return e=r>=4||r===0?Sr(e):Sr.ceil(e),re(e.getFullYear()%1e4,t,4)}function Vw(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+re(t/60|0,"0",2)+re(t%60,"0",2)}function $d(e,t){return re(e.getUTCDate(),t,2)}function Xw(e,t){return re(e.getUTCHours(),t,2)}function Yw(e,t){return re(e.getUTCHours()%12||12,t,2)}function Zw(e,t){return re(1+ya.count(jt(e),e),t,3)}function nb(e,t){return re(e.getUTCMilliseconds(),t,3)}function Jw(e,t){return nb(e,t)+"000"}function Qw(e,t){return re(e.getUTCMonth()+1,t,2)}function e_(e,t){return re(e.getUTCMinutes(),t,2)}function t_(e,t){return re(e.getUTCSeconds(),t,2)}function r_(e){var t=e.getUTCDay();return t===0?7:t}function n_(e,t){return re(ga.count(jt(e)-1,e),t,2)}function ib(e){var t=e.getUTCDay();return t>=4||t===0?jr(e):jr.ceil(e)}function i_(e,t){return e=ib(e),re(jr.count(jt(e),e)+(jt(e).getUTCDay()===4),t,2)}function a_(e){return e.getUTCDay()}function o_(e,t){return re(Ai.count(jt(e)-1,e),t,2)}function s_(e,t){return re(e.getUTCFullYear()%100,t,2)}function u_(e,t){return e=ib(e),re(e.getUTCFullYear()%100,t,2)}function c_(e,t){return re(e.getUTCFullYear()%1e4,t,4)}function l_(e,t){var r=e.getUTCDay();return e=r>=4||r===0?jr(e):jr.ceil(e),re(e.getUTCFullYear()%1e4,t,4)}function f_(){return"+0000"}function Nd(){return"%"}function Rd(e){return+e}function Dd(e){return Math.floor(+e/1e3)}var vr,ab,ob;d_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function d_(e){return vr=dw(e),ab=vr.format,vr.parse,ob=vr.utcFormat,vr.utcParse,vr}function h_(e){return new Date(e)}function p_(e){return e instanceof Date?+e:+new Date(+e)}function _f(e,t,r,n,i,a,o,s,u,c){var f=uf(),l=f.invert,d=f.domain,v=c(".%L"),m=c(":%S"),y=c("%I:%M"),p=c("%I %p"),g=c("%a %d"),x=c("%b %d"),O=c("%B"),_=c("%Y");function b(w){return(u(w)<w?v:s(w)<w?m:o(w)<w?y:a(w)<w?p:n(w)<w?i(w)<w?g:x:r(w)<w?O:_)(w)}return f.invert=function(w){return new Date(l(w))},f.domain=function(w){return arguments.length?d(Array.from(w,p_)):d().map(h_)},f.ticks=function(w){var S=d();return e(S[0],S[S.length-1],w??10)},f.tickFormat=function(w,S){return S==null?b:c(S)},f.nice=function(w){var S=d();return(!w||typeof w.range!="function")&&(w=t(S[0],S[S.length-1],w??10)),w?d(Hg(S,w)):f},f.copy=function(){return ei(f,_f(e,t,r,n,i,a,o,s,u,c))},f}function v_(){return at.apply(_f(lw,fw,St,xf,ma,ti,gf,yf,Zt,ab).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function y_(){return at.apply(_f(uw,cw,jt,wf,ga,ya,bf,mf,Zt,ob).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ba(){var e=0,t=1,r,n,i,a,o=ke,s=!1,u;function c(l){return l==null||isNaN(l=+l)?u:o(i===0?.5:(l=(a(l)-r)*i,s?Math.max(0,Math.min(1,l)):l))}c.domain=function(l){return arguments.length?([e,t]=l,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),c):[e,t]},c.clamp=function(l){return arguments.length?(s=!!l,c):s},c.interpolator=function(l){return arguments.length?(o=l,c):o};function f(l){return function(d){var v,m;return arguments.length?([v,m]=d,o=l(v,m),c):[o(0),o(1)]}}return c.range=f(Gr),c.rangeRound=f(of),c.unknown=function(l){return arguments.length?(u=l,c):u},function(l){return a=l,r=l(e),n=l(t),i=r===n?0:1/(n-r),c}}function zt(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function sb(){var e=qt(ba()(ke));return e.copy=function(){return zt(e,sb())},Pt.apply(e,arguments)}function ub(){var e=ff(ba()).domain([1,10]);return e.copy=function(){return zt(e,ub()).base(e.base())},Pt.apply(e,arguments)}function cb(){var e=df(ba());return e.copy=function(){return zt(e,cb()).constant(e.constant())},Pt.apply(e,arguments)}function Of(){var e=hf(ba());return e.copy=function(){return zt(e,Of()).exponent(e.exponent())},Pt.apply(e,arguments)}function m_(){return Of.apply(null,arguments).exponent(.5)}function lb(){var e=[],t=ke;function r(n){if(n!=null&&!isNaN(n=+n))return t((Qn(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Dt),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>P1(e,a/n))},r.copy=function(){return lb(t).domain(e)},Pt.apply(r,arguments)}function xa(){var e=0,t=.5,r=1,n=1,i,a,o,s,u,c=ke,f,l=!1,d;function v(y){return isNaN(y=+y)?d:(y=.5+((y=+f(y))-a)*(n*y<n*a?s:u),c(l?Math.max(0,Math.min(1,y)):y))}v.domain=function(y){return arguments.length?([e,t,r]=y,i=f(e=+e),a=f(t=+t),o=f(r=+r),s=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v):[e,t,r]},v.clamp=function(y){return arguments.length?(l=!!y,v):l},v.interpolator=function(y){return arguments.length?(c=y,v):c};function m(y){return function(p){var g,x,O;return arguments.length?([g,x,O]=p,c=g1(y,[g,x,O]),v):[c(0),c(.5),c(1)]}}return v.range=m(Gr),v.rangeRound=m(of),v.unknown=function(y){return arguments.length?(d=y,v):d},function(y){return f=y,i=y(e),a=y(t),o=y(r),s=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v}}function fb(){var e=qt(xa()(ke));return e.copy=function(){return zt(e,fb())},Pt.apply(e,arguments)}function db(){var e=ff(xa()).domain([.1,1,10]);return e.copy=function(){return zt(e,db()).base(e.base())},Pt.apply(e,arguments)}function hb(){var e=df(xa());return e.copy=function(){return zt(e,hb()).constant(e.constant())},Pt.apply(e,arguments)}function Sf(){var e=hf(xa());return e.copy=function(){return zt(e,Sf()).exponent(e.exponent())},Pt.apply(e,arguments)}function g_(){return Sf.apply(null,arguments).exponent(.5)}function pb(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=pb(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function te(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=pb(e))&&(n&&(n+=" "),n+=t);return n}var Qa,Bd;function Be(){if(Bd)return Qa;Bd=1;var e=Array.isArray;return Qa=e,Qa}var eo,Ld;function vb(){if(Ld)return eo;Ld=1;var e=typeof oi=="object"&&oi&&oi.Object===Object&&oi;return eo=e,eo}var to,qd;function ht(){if(qd)return to;qd=1;var e=vb(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return to=r,to}var ro,zd;function ri(){if(zd)return ro;zd=1;var e=ht(),t=e.Symbol;return ro=t,ro}var no,Fd;function b_(){if(Fd)return no;Fd=1;var e=ri(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var s=r.call(o,i),u=o[i];try{o[i]=void 0;var c=!0}catch{}var f=n.call(o);return c&&(s?o[i]=u:delete o[i]),f}return no=a,no}var io,Wd;function x_(){if(Wd)return io;Wd=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return io=r,io}var ao,Ud;function Tt(){if(Ud)return ao;Ud=1;var e=ri(),t=b_(),r=x_(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?t(s):r(s)}return ao=o,ao}var oo,Gd;function Et(){if(Gd)return oo;Gd=1;function e(t){return t!=null&&typeof t=="object"}return oo=e,oo}var so,Hd;function Hr(){if(Hd)return so;Hd=1;var e=Tt(),t=Et(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return so=n,so}var uo,Kd;function jf(){if(Kd)return uo;Kd=1;var e=Be(),t=Hr(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return uo=i,uo}var co,Vd;function Ft(){if(Vd)return co;Vd=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return co=e,co}var lo,Xd;function Af(){if(Xd)return lo;Xd=1;var e=Tt(),t=Ft(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!t(s))return!1;var u=e(s);return u==n||u==i||u==r||u==a}return lo=o,lo}var fo,Yd;function w_(){if(Yd)return fo;Yd=1;var e=ht(),t=e["__core-js_shared__"];return fo=t,fo}var ho,Zd;function __(){if(Zd)return ho;Zd=1;var e=w_(),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 ho=r,ho}var po,Jd;function yb(){if(Jd)return po;Jd=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 po=r,po}var vo,Qd;function O_(){if(Qd)return vo;Qd=1;var e=Af(),t=__(),r=Ft(),n=yb(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,f=RegExp("^"+u.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(d){if(!r(d)||t(d))return!1;var v=e(d)?f:a;return v.test(n(d))}return vo=l,vo}var yo,eh;function S_(){if(eh)return yo;eh=1;function e(t,r){return t==null?void 0:t[r]}return yo=e,yo}var mo,th;function dr(){if(th)return mo;th=1;var e=O_(),t=S_();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return mo=r,mo}var go,rh;function wa(){if(rh)return go;rh=1;var e=dr(),t=e(Object,"create");return go=t,go}var bo,nh;function j_(){if(nh)return bo;nh=1;var e=wa();function t(){this.__data__=e?e(null):{},this.size=0}return bo=t,bo}var xo,ih;function A_(){if(ih)return xo;ih=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return xo=e,xo}var wo,ah;function P_(){if(ah)return wo;ah=1;var e=wa(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var s=o[a];return s===t?void 0:s}return n.call(o,a)?o[a]:void 0}return wo=i,wo}var _o,oh;function T_(){if(oh)return _o;oh=1;var e=wa(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return _o=n,_o}var Oo,sh;function E_(){if(sh)return Oo;sh=1;var e=wa(),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 Oo=r,Oo}var So,uh;function M_(){if(uh)return So;uh=1;var e=j_(),t=A_(),r=P_(),n=T_(),i=E_();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];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,So=a,So}var jo,ch;function C_(){if(ch)return jo;ch=1;function e(){this.__data__=[],this.size=0}return jo=e,jo}var Ao,lh;function Pf(){if(lh)return Ao;lh=1;function e(t,r){return t===r||t!==t&&r!==r}return Ao=e,Ao}var Po,fh;function _a(){if(fh)return Po;fh=1;var e=Pf();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return Po=t,Po}var To,dh;function I_(){if(dh)return To;dh=1;var e=_a(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var s=a.length-1;return o==s?a.pop():r.call(a,o,1),--this.size,!0}return To=n,To}var Eo,hh;function k_(){if(hh)return Eo;hh=1;var e=_a();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return Eo=t,Eo}var Mo,ph;function $_(){if(ph)return Mo;ph=1;var e=_a();function t(r){return e(this.__data__,r)>-1}return Mo=t,Mo}var Co,vh;function N_(){if(vh)return Co;vh=1;var e=_a();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 Co=t,Co}var Io,yh;function Oa(){if(yh)return Io;yh=1;var e=C_(),t=I_(),r=k_(),n=$_(),i=N_();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];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,Io=a,Io}var ko,mh;function Tf(){if(mh)return ko;mh=1;var e=dr(),t=ht(),r=e(t,"Map");return ko=r,ko}var $o,gh;function R_(){if(gh)return $o;gh=1;var e=M_(),t=Oa(),r=Tf();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return $o=n,$o}var No,bh;function D_(){if(bh)return No;bh=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return No=e,No}var Ro,xh;function Sa(){if(xh)return Ro;xh=1;var e=D_();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Ro=t,Ro}var Do,wh;function B_(){if(wh)return Do;wh=1;var e=Sa();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Do=t,Do}var Bo,_h;function L_(){if(_h)return Bo;_h=1;var e=Sa();function t(r){return e(this,r).get(r)}return Bo=t,Bo}var Lo,Oh;function q_(){if(Oh)return Lo;Oh=1;var e=Sa();function t(r){return e(this,r).has(r)}return Lo=t,Lo}var qo,Sh;function z_(){if(Sh)return qo;Sh=1;var e=Sa();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 qo=t,qo}var zo,jh;function Ef(){if(jh)return zo;jh=1;var e=R_(),t=B_(),r=L_(),n=q_(),i=z_();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];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,zo=a,zo}var Fo,Ah;function mb(){if(Ah)return Fo;Ah=1;var e=Ef(),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,s=i?i.apply(this,o):o[0],u=a.cache;if(u.has(s))return u.get(s);var c=n.apply(this,o);return a.cache=u.set(s,c)||u,c};return a.cache=new(r.Cache||e),a}return r.Cache=e,Fo=r,Fo}var Wo,Ph;function F_(){if(Ph)return Wo;Ph=1;var e=mb(),t=500;function r(n){var i=e(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return Wo=r,Wo}var Uo,Th;function W_(){if(Th)return Uo;Th=1;var e=F_(),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,s,u,c){a.push(u?c.replace(r,"$1"):s||o)}),a});return Uo=n,Uo}var Go,Eh;function Mf(){if(Eh)return Go;Eh=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 Go=e,Go}var Ho,Mh;function U_(){if(Mh)return Ho;Mh=1;var e=ri(),t=Mf(),r=Be(),n=Hr(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return t(s,o)+"";if(n(s))return a?a.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return Ho=o,Ho}var Ko,Ch;function gb(){if(Ch)return Ko;Ch=1;var e=U_();function t(r){return r==null?"":e(r)}return Ko=t,Ko}var Vo,Ih;function bb(){if(Ih)return Vo;Ih=1;var e=Be(),t=jf(),r=W_(),n=gb();function i(a,o){return e(a)?a:t(a,o)?[a]:r(n(a))}return Vo=i,Vo}var Xo,kh;function ja(){if(kh)return Xo;kh=1;var e=Hr();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Xo=t,Xo}var Yo,$h;function Cf(){if($h)return Yo;$h=1;var e=bb(),t=ja();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 Yo=r,Yo}var Zo,Nh;function xb(){if(Nh)return Zo;Nh=1;var e=Cf();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return Zo=t,Zo}var G_=xb();const Je=le(G_);var Jo,Rh;function H_(){if(Rh)return Jo;Rh=1;function e(t){return t==null}return Jo=e,Jo}var K_=H_();const Q=le(K_);var Qo,Dh;function V_(){if(Dh)return Qo;Dh=1;var e=Tt(),t=Be(),r=Et(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return Qo=i,Qo}var X_=V_();const ar=le(X_);var Y_=Af();const Y=le(Y_);var Z_=Ft();const Kr=le(Z_);var es={exports:{}},ie={};/**
1
+ import{h as oi,V as le,Z as $,R as P,d as ne,X as h,ag as Re,T as vt,I as Yx,z as Zx,O as lt,v as Jx,t as Qx,H as e1,a5 as gi,D as t1,B as r1,F as n1,C as i1,E as a1,r as o1,o as s1,p as u1,s as c1}from"./index-2Gzrk1k3.js";import{a as l1,e as Uc,c as ld,f as fd,g as f1,h as dd,m as hd,o as Bg,d as at,b as Pt,i as d1}from"./ordinal-DhEzRPdO.js";function h1(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function p1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function v1(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=Gr(e[o],t[o]);for(;o<r;++o)a[o]=t[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}function y1(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function m1(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Gr(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}function Gr(e,t){var r=typeof t,n;return t==null||r==="boolean"?l1(t):(r==="number"?Uc:r==="string"?(n=ld(t))?(t=n,fd):f1:t instanceof ld?fd:t instanceof Date?y1:p1(t)?h1:Array.isArray(t)?v1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?m1:Uc)(e,t)}function of(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function g1(e,t){t===void 0&&(t=e,e=Gr);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(o){var s=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return a[s](o-s)}}function Dt(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function b1(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function sf(e){let t,r,n;e.length!==2?(t=Dt,r=(s,u)=>Dt(e(s),u),n=(s,u)=>e(s)-u):(t=e===Dt||e===b1?e:x1,r=e,n=e);function i(s,u,c=0,f=s.length){if(c<f){if(t(u,u)!==0)return f;do{const l=c+f>>>1;r(s[l],u)<0?c=l+1:f=l}while(c<f)}return c}function a(s,u,c=0,f=s.length){if(c<f){if(t(u,u)!==0)return f;do{const l=c+f>>>1;r(s[l],u)<=0?c=l+1:f=l}while(c<f)}return c}function o(s,u,c=0,f=s.length){const l=i(s,u,c,f-1);return l>c&&n(s[l-1],u)>-n(s[l],u)?l-1:l}return{left:i,center:o,right:a}}function x1(){return 0}function Lg(e){return e===null?NaN:+e}function*w1(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const _1=sf(Dt),Qn=_1.right;sf(Lg).center;function O1(e=Dt){if(e===Dt)return qg;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function qg(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const S1=Math.sqrt(50),j1=Math.sqrt(10),A1=Math.sqrt(2);function bi(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=S1?10:a>=j1?5:a>=A1?2:1;let s,u,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(e*c),u=Math.round(t*c),s/c<e&&++s,u/c>t&&--u,c=-c):(c=Math.pow(10,i)*o,s=Math.round(e/c),u=Math.round(t/c),s*c<e&&++s,u*c>t&&--u),u<s&&.5<=r&&r<2?bi(e,t,r*2):[s,u,c]}function Gc(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,a,o]=n?bi(t,e,r):bi(e,t,r);if(!(a>=i))return[];const s=a-i+1,u=new Array(s);if(n)if(o<0)for(let c=0;c<s;++c)u[c]=(a-c)/-o;else for(let c=0;c<s;++c)u[c]=(a-c)*o;else if(o<0)for(let c=0;c<s;++c)u[c]=(i+c)/-o;else for(let c=0;c<s;++c)u[c]=(i+c)*o;return u}function Hc(e,t,r){return t=+t,e=+e,r=+r,bi(e,t,r)[2]}function Kc(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?Hc(t,e,r):Hc(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function zg(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?qg:O1(i);n>r;){if(n-r>600){const u=n-r+1,c=t-r+1,f=Math.log(u),l=.5*Math.exp(2*f/3),d=.5*Math.sqrt(f*l*(u-l)/u)*(c-u/2<0?-1:1),v=Math.max(r,Math.floor(t-c*l/u+d)),m=Math.min(n,Math.floor(t+(u-c)*l/u+d));zg(e,t,v,m,i)}const a=e[t];let o=r,s=n;for(en(e,r,t),i(e[n],a)>0&&en(e,r,n);o<s;){for(en(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[r],a)===0?en(e,r,s):(++s,en(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function en(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function P1(e,t,r){if(e=Float64Array.from(w1(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return dd(e);if(t>=1)return hd(e);var n,i=(n-1)*t,a=Math.floor(i),o=hd(zg(e,a).subarray(0,a+1)),s=dd(e.subarray(a+1));return o+(s-o)*(i-a)}}function T1(e,t,r=Lg){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function E1(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n<i;)a[n]=e+n*r;return a}function bn(){var e=Bg().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,a,o,s=!1,u=0,c=0,f=.5;delete e.unknown;function l(){var d=t().length,v=i<n,m=v?i:n,y=v?n:i;a=(y-m)/Math.max(1,d-u+c*2),s&&(a=Math.floor(a)),m+=(y-m-a*(d-u))*f,o=a*(1-u),s&&(m=Math.round(m),o=Math.round(o));var p=E1(d).map(function(g){return m+a*g});return r(v?p.reverse():p)}return e.domain=function(d){return arguments.length?(t(d),l()):t()},e.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,l()):[n,i]},e.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,s=!0,l()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(d){return arguments.length?(s=!!d,l()):s},e.padding=function(d){return arguments.length?(u=Math.min(1,c=+d),l()):u},e.paddingInner=function(d){return arguments.length?(u=Math.min(1,d),l()):u},e.paddingOuter=function(d){return arguments.length?(c=+d,l()):c},e.align=function(d){return arguments.length?(f=Math.max(0,Math.min(1,d)),l()):f},e.copy=function(){return bn(t(),[n,i]).round(s).paddingInner(u).paddingOuter(c).align(f)},at.apply(l(),arguments)}function Fg(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Fg(t())},e}function pn(){return Fg(bn.apply(null,arguments).paddingInner(1))}function M1(e){return function(){return e}}function xi(e){return+e}var pd=[0,1];function ke(e){return e}function Vc(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:M1(isNaN(t)?NaN:.5)}function C1(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function I1(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i<n?(n=Vc(i,n),a=r(o,a)):(n=Vc(n,i),a=r(a,o)),function(s){return a(n(s))}}function k1(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),a=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)i[o]=Vc(e[o],e[o+1]),a[o]=r(t[o],t[o+1]);return function(s){var u=Qn(e,s,1,n)-1;return a[u](i[u](s))}}function ei(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function va(){var e=pd,t=pd,r=Gr,n,i,a,o=ke,s,u,c;function f(){var d=Math.min(e.length,t.length);return o!==ke&&(o=C1(e[0],e[d-1])),s=d>2?k1:I1,u=c=null,l}function l(d){return d==null||isNaN(d=+d)?a:(u||(u=s(e.map(n),t,r)))(n(o(d)))}return l.invert=function(d){return o(i((c||(c=s(t,e.map(n),Uc)))(d)))},l.domain=function(d){return arguments.length?(e=Array.from(d,xi),f()):e.slice()},l.range=function(d){return arguments.length?(t=Array.from(d),f()):t.slice()},l.rangeRound=function(d){return t=Array.from(d),r=of,f()},l.clamp=function(d){return arguments.length?(o=d?!0:ke,f()):o!==ke},l.interpolate=function(d){return arguments.length?(r=d,f()):r},l.unknown=function(d){return arguments.length?(a=d,l):a},function(d,v){return n=d,i=v,f()}}function uf(){return va()(ke,ke)}function $1(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function wi(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Or(e){return e=wi(Math.abs(e)),e?e[1]:NaN}function N1(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>n&&(s=Math.max(1,n-u)),a.push(r.substring(i-=s,i+s)),!((u+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function R1(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var D1=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function xn(e){if(!(t=D1.exec(e)))throw new Error("invalid format: "+e);var t;return new cf({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}xn.prototype=cf.prototype;function cf(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}cf.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function B1(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var _i;function L1(e,t){var r=wi(e,t);if(!r)return _i=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(_i=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+wi(e,Math.max(0,t+a-1))[0]}function vd(e,t){var r=wi(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const yd={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:$1,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>vd(e*100,t),r:vd,s:L1,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function md(e){return e}var gd=Array.prototype.map,bd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function q1(e){var t=e.grouping===void 0||e.thousands===void 0?md:N1(gd.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?md:R1(gd.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function c(l,d){l=xn(l);var v=l.fill,m=l.align,y=l.sign,p=l.symbol,g=l.zero,x=l.width,O=l.comma,_=l.precision,b=l.trim,w=l.type;w==="n"?(O=!0,w="g"):yd[w]||(_===void 0&&(_=12),b=!0,w="g"),(g||v==="0"&&m==="=")&&(g=!0,v="0",m="=");var S=(d&&d.prefix!==void 0?d.prefix:"")+(p==="$"?r:p==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),j=(p==="$"?n:/[%p]/.test(w)?o:"")+(d&&d.suffix!==void 0?d.suffix:""),A=yd[w],C=/[defgprs%]/.test(w);_=_===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function E(T){var M=S,k=j,I,R,B;if(w==="c")k=A(T)+k,T="";else{T=+T;var q=T<0||1/T<0;if(T=isNaN(T)?u:A(Math.abs(T),_),b&&(T=B1(T)),q&&+T==0&&y!=="+"&&(q=!1),M=(q?y==="("?y:s:y==="-"||y==="("?"":y)+M,k=(w==="s"&&!isNaN(T)&&_i!==void 0?bd[8+_i/3]:"")+k+(q&&y==="("?")":""),C){for(I=-1,R=T.length;++I<R;)if(B=T.charCodeAt(I),48>B||B>57){k=(B===46?i+T.slice(I+1):T.slice(I))+k,T=T.slice(0,I);break}}}O&&!g&&(T=t(T,1/0));var z=M.length+T.length+k.length,G=z<x?new Array(x-z+1).join(v):"";switch(O&&g&&(T=t(G+T,G.length?x-k.length:1/0),G=""),m){case"<":T=M+T+k+G;break;case"=":T=M+G+T+k;break;case"^":T=G.slice(0,z=G.length>>1)+M+T+k+G.slice(z);break;default:T=G+M+T+k;break}return a(T)}return E.toString=function(){return l+""},E}function f(l,d){var v=Math.max(-8,Math.min(8,Math.floor(Or(d)/3)))*3,m=Math.pow(10,-v),y=c((l=xn(l),l.type="f",l),{suffix:bd[8+v/3]});return function(p){return y(m*p)}}return{format:c,formatPrefix:f}}var si,lf,Wg;z1({thousands:",",grouping:[3],currency:["$",""]});function z1(e){return si=q1(e),lf=si.format,Wg=si.formatPrefix,si}function F1(e){return Math.max(0,-Or(Math.abs(e)))}function W1(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Or(t)/3)))*3-Or(Math.abs(e)))}function U1(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Or(t)-Or(e))+1}function Ug(e,t,r,n){var i=Kc(e,t,r),a;switch(n=xn(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=W1(i,o))&&(n.precision=a),Wg(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=U1(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=F1(i))&&(n.precision=a-(n.type==="%")*2);break}}return lf(n)}function qt(e){var t=e.domain;return e.ticks=function(r){var n=t();return Gc(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Ug(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],u,c,f=10;for(s<o&&(c=o,o=s,s=c,c=i,i=a,a=c);f-- >0;){if(c=Hc(o,s,r),c===u)return n[i]=o,n[a]=s,t(n);if(c>0)o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c;else if(c<0)o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c;else break;u=c}return e},e}function Oi(){var e=uf();return e.copy=function(){return ei(e,Oi())},at.apply(e,arguments),qt(e)}function Gg(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,xi),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Gg(e).unknown(t)},e=arguments.length?Array.from(e,xi):[0,1],qt(r)}function Hg(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return a<i&&(o=r,r=n,n=o,o=i,i=a,a=o),e[r]=t.floor(i),e[n]=t.ceil(a),e}function xd(e){return Math.log(e)}function wd(e){return Math.exp(e)}function G1(e){return-Math.log(-e)}function H1(e){return-Math.exp(-e)}function K1(e){return isFinite(e)?+("1e"+e):e<0?0:e}function V1(e){return e===10?K1:e===Math.E?Math.exp:t=>Math.pow(e,t)}function X1(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function _d(e){return(t,r)=>-e(-t,r)}function ff(e){const t=e(xd,wd),r=t.domain;let n=10,i,a;function o(){return i=X1(n),a=V1(n),r()[0]<0?(i=_d(i),a=_d(a),e(G1,H1)):e(xd,wd),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const u=r();let c=u[0],f=u[u.length-1];const l=f<c;l&&([c,f]=[f,c]);let d=i(c),v=i(f),m,y;const p=s==null?10:+s;let g=[];if(!(n%1)&&v-d<p){if(d=Math.floor(d),v=Math.ceil(v),c>0){for(;d<=v;++d)for(m=1;m<n;++m)if(y=d<0?m/a(-d):m*a(d),!(y<c)){if(y>f)break;g.push(y)}}else for(;d<=v;++d)for(m=n-1;m>=1;--m)if(y=d>0?m/a(-d):m*a(d),!(y<c)){if(y>f)break;g.push(y)}g.length*2<p&&(g=Gc(c,f,p))}else g=Gc(d,v,Math.min(v-d,p)).map(a);return l?g.reverse():g},t.tickFormat=(s,u)=>{if(s==null&&(s=10),u==null&&(u=n===10?"s":","),typeof u!="function"&&(!(n%1)&&(u=xn(u)).precision==null&&(u.trim=!0),u=lf(u)),s===1/0)return u;const c=Math.max(1,n*s/t.ticks().length);return f=>{let l=f/a(Math.round(i(f)));return l*n<n-.5&&(l*=n),l<=c?u(f):""}},t.nice=()=>r(Hg(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function Kg(){const e=ff(va()).domain([1,10]);return e.copy=()=>ei(e,Kg()).base(e.base()),at.apply(e,arguments),e}function Od(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Sd(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function df(e){var t=1,r=e(Od(t),Sd(t));return r.constant=function(n){return arguments.length?e(Od(t=+n),Sd(t)):t},qt(r)}function Vg(){var e=df(va());return e.copy=function(){return ei(e,Vg()).constant(e.constant())},at.apply(e,arguments)}function jd(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Y1(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Z1(e){return e<0?-e*e:e*e}function hf(e){var t=e(ke,ke),r=1;function n(){return r===1?e(ke,ke):r===.5?e(Y1,Z1):e(jd(r),jd(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},qt(t)}function pf(){var e=hf(va());return e.copy=function(){return ei(e,pf()).exponent(e.exponent())},at.apply(e,arguments),e}function J1(){return pf.apply(null,arguments).exponent(.5)}function Ad(e){return Math.sign(e)*e*e}function Q1(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Xg(){var e=uf(),t=[0,1],r=!1,n;function i(a){var o=Q1(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(Ad(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,xi)).map(Ad)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Xg(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},at.apply(i,arguments),qt(i)}function Yg(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o<s;)r[o-1]=T1(e,o/s);return a}function a(o){return o==null||isNaN(o=+o)?n:t[Qn(r,o)]}return a.invertExtent=function(o){var s=t.indexOf(o);return s<0?[NaN,NaN]:[s>0?r[s-1]:e[0],s<r.length?r[s]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let s of o)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Dt),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(n=o,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return Yg().domain(e).range(t).unknown(n)},at.apply(a,arguments)}function Zg(){var e=0,t=1,r=1,n=[.5],i=[0,1],a;function o(u){return u!=null&&u<=u?i[Qn(n,u,0,r)]:a}function s(){var u=-1;for(n=new Array(r);++u<r;)n[u]=((u+1)*t-(u-r)*e)/(r+1);return o}return o.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,s()):[e,t]},o.range=function(u){return arguments.length?(r=(i=Array.from(u)).length-1,s()):i.slice()},o.invertExtent=function(u){var c=i.indexOf(u);return c<0?[NaN,NaN]:c<1?[e,n[0]]:c>=r?[n[r-1],t]:[n[c-1],n[c]]},o.unknown=function(u){return arguments.length&&(a=u),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Zg().domain([e,t]).range(i).unknown(a)},at.apply(qt(o),arguments)}function Jg(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[Qn(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Jg().domain(e).range(t).unknown(r)},at.apply(i,arguments)}const Va=new Date,Xa=new Date;function Oe(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o<s-a?o:s},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const u=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return u;let c;do u.push(c=new Date(+a)),t(a,s),e(a);while(c<a&&a<o);return u},i.filter=a=>Oe(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Va.setTime(+a),Xa.setTime(+o),e(Va),e(Xa),Math.floor(r(Va,Xa))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Si=Oe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Si.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Oe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Si);Si.range;const yt=1e3,Ze=yt*60,mt=Ze*60,Ot=mt*24,vf=Ot*7,Pd=Ot*30,Ya=Ot*365,Zt=Oe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*yt)},(e,t)=>(t-e)/yt,e=>e.getUTCSeconds());Zt.range;const yf=Oe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yt)},(e,t)=>{e.setTime(+e+t*Ze)},(e,t)=>(t-e)/Ze,e=>e.getMinutes());yf.range;const mf=Oe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ze)},(e,t)=>(t-e)/Ze,e=>e.getUTCMinutes());mf.range;const gf=Oe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yt-e.getMinutes()*Ze)},(e,t)=>{e.setTime(+e+t*mt)},(e,t)=>(t-e)/mt,e=>e.getHours());gf.range;const bf=Oe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*mt)},(e,t)=>(t-e)/mt,e=>e.getUTCHours());bf.range;const ti=Oe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ze)/Ot,e=>e.getDate()-1);ti.range;const ya=Oe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ot,e=>e.getUTCDate()-1);ya.range;const Qg=Oe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ot,e=>Math.floor(e/Ot));Qg.range;function lr(e){return Oe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Ze)/vf)}const ma=lr(0),ji=lr(1),ew=lr(2),tw=lr(3),Sr=lr(4),rw=lr(5),nw=lr(6);ma.range;ji.range;ew.range;tw.range;Sr.range;rw.range;nw.range;function fr(e){return Oe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/vf)}const ga=fr(0),Ai=fr(1),iw=fr(2),aw=fr(3),jr=fr(4),ow=fr(5),sw=fr(6);ga.range;Ai.range;iw.range;aw.range;jr.range;ow.range;sw.range;const xf=Oe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());xf.range;const wf=Oe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());wf.range;const St=Oe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());St.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Oe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});St.range;const jt=Oe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());jt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Oe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});jt.range;function eb(e,t,r,n,i,a){const o=[[Zt,1,yt],[Zt,5,5*yt],[Zt,15,15*yt],[Zt,30,30*yt],[a,1,Ze],[a,5,5*Ze],[a,15,15*Ze],[a,30,30*Ze],[i,1,mt],[i,3,3*mt],[i,6,6*mt],[i,12,12*mt],[n,1,Ot],[n,2,2*Ot],[r,1,vf],[t,1,Pd],[t,3,3*Pd],[e,1,Ya]];function s(c,f,l){const d=f<c;d&&([c,f]=[f,c]);const v=l&&typeof l.range=="function"?l:u(c,f,l),m=v?v.range(c,+f+1):[];return d?m.reverse():m}function u(c,f,l){const d=Math.abs(f-c)/l,v=sf(([,,p])=>p).right(o,d);if(v===o.length)return e.every(Kc(c/Ya,f/Ya,l));if(v===0)return Si.every(Math.max(Kc(c,f,l),1));const[m,y]=o[d/o[v-1][2]<o[v][2]/d?v-1:v];return m.every(y)}return[s,u]}const[uw,cw]=eb(jt,wf,ga,Qg,bf,mf),[lw,fw]=eb(St,xf,ma,ti,gf,yf);function Za(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ja(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function tn(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function dw(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,u=e.shortMonths,c=rn(i),f=nn(i),l=rn(a),d=nn(a),v=rn(o),m=nn(o),y=rn(s),p=nn(s),g=rn(u),x=nn(u),O={a:B,A:q,b:z,B:G,c:null,d:kd,e:kd,f:Nw,g:Gw,G:Kw,H:Iw,I:kw,j:$w,L:tb,m:Rw,M:Dw,p:K,q:W,Q:Rd,s:Dd,S:Bw,u:Lw,U:qw,V:zw,w:Fw,W:Ww,x:null,X:null,y:Uw,Y:Hw,Z:Vw,"%":Nd},_={a:V,A:ue,b:ve,B:Le,c:null,d:$d,e:$d,f:Jw,g:u_,G:l_,H:Xw,I:Yw,j:Zw,L:nb,m:Qw,M:e_,p:Gt,q:$e,Q:Rd,s:Dd,S:t_,u:r_,U:n_,V:i_,w:a_,W:o_,x:null,X:null,y:s_,Y:c_,Z:f_,"%":Nd},b={a:C,A:E,b:T,B:M,c:k,d:Cd,e:Cd,f:Tw,g:Md,G:Ed,H:Id,I:Id,j:Sw,L:Pw,m:Ow,M:jw,p:A,q:_w,Q:Mw,s:Cw,S:Aw,u:mw,U:gw,V:bw,w:yw,W:xw,x:I,X:R,y:Md,Y:Ed,Z:ww,"%":Ew};O.x=w(r,O),O.X=w(n,O),O.c=w(t,O),_.x=w(r,_),_.X=w(n,_),_.c=w(t,_);function w(F,X){return function(Z){var D=[],he=-1,ee=0,ge=F.length,be,Ne,Mt;for(Z instanceof Date||(Z=new Date(+Z));++he<ge;)F.charCodeAt(he)===37&&(D.push(F.slice(ee,he)),(Ne=Td[be=F.charAt(++he)])!=null?be=F.charAt(++he):Ne=be==="e"?" ":"0",(Mt=X[be])&&(be=Mt(Z,Ne)),D.push(be),ee=he+1);return D.push(F.slice(ee,he)),D.join("")}}function S(F,X){return function(Z){var D=tn(1900,void 0,1),he=j(D,F,Z+="",0),ee,ge;if(he!=Z.length)return null;if("Q"in D)return new Date(D.Q);if("s"in D)return new Date(D.s*1e3+("L"in D?D.L:0));if(X&&!("Z"in D)&&(D.Z=0),"p"in D&&(D.H=D.H%12+D.p*12),D.m===void 0&&(D.m="q"in D?D.q:0),"V"in D){if(D.V<1||D.V>53)return null;"w"in D||(D.w=1),"Z"in D?(ee=Ja(tn(D.y,0,1)),ge=ee.getUTCDay(),ee=ge>4||ge===0?Ai.ceil(ee):Ai(ee),ee=ya.offset(ee,(D.V-1)*7),D.y=ee.getUTCFullYear(),D.m=ee.getUTCMonth(),D.d=ee.getUTCDate()+(D.w+6)%7):(ee=Za(tn(D.y,0,1)),ge=ee.getDay(),ee=ge>4||ge===0?ji.ceil(ee):ji(ee),ee=ti.offset(ee,(D.V-1)*7),D.y=ee.getFullYear(),D.m=ee.getMonth(),D.d=ee.getDate()+(D.w+6)%7)}else("W"in D||"U"in D)&&("w"in D||(D.w="u"in D?D.u%7:"W"in D?1:0),ge="Z"in D?Ja(tn(D.y,0,1)).getUTCDay():Za(tn(D.y,0,1)).getDay(),D.m=0,D.d="W"in D?(D.w+6)%7+D.W*7-(ge+5)%7:D.w+D.U*7-(ge+6)%7);return"Z"in D?(D.H+=D.Z/100|0,D.M+=D.Z%100,Ja(D)):Za(D)}}function j(F,X,Z,D){for(var he=0,ee=X.length,ge=Z.length,be,Ne;he<ee;){if(D>=ge)return-1;if(be=X.charCodeAt(he++),be===37){if(be=X.charAt(he++),Ne=b[be in Td?X.charAt(he++):be],!Ne||(D=Ne(F,Z,D))<0)return-1}else if(be!=Z.charCodeAt(D++))return-1}return D}function A(F,X,Z){var D=c.exec(X.slice(Z));return D?(F.p=f.get(D[0].toLowerCase()),Z+D[0].length):-1}function C(F,X,Z){var D=v.exec(X.slice(Z));return D?(F.w=m.get(D[0].toLowerCase()),Z+D[0].length):-1}function E(F,X,Z){var D=l.exec(X.slice(Z));return D?(F.w=d.get(D[0].toLowerCase()),Z+D[0].length):-1}function T(F,X,Z){var D=g.exec(X.slice(Z));return D?(F.m=x.get(D[0].toLowerCase()),Z+D[0].length):-1}function M(F,X,Z){var D=y.exec(X.slice(Z));return D?(F.m=p.get(D[0].toLowerCase()),Z+D[0].length):-1}function k(F,X,Z){return j(F,t,X,Z)}function I(F,X,Z){return j(F,r,X,Z)}function R(F,X,Z){return j(F,n,X,Z)}function B(F){return o[F.getDay()]}function q(F){return a[F.getDay()]}function z(F){return u[F.getMonth()]}function G(F){return s[F.getMonth()]}function K(F){return i[+(F.getHours()>=12)]}function W(F){return 1+~~(F.getMonth()/3)}function V(F){return o[F.getUTCDay()]}function ue(F){return a[F.getUTCDay()]}function ve(F){return u[F.getUTCMonth()]}function Le(F){return s[F.getUTCMonth()]}function Gt(F){return i[+(F.getUTCHours()>=12)]}function $e(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var X=w(F+="",O);return X.toString=function(){return F},X},parse:function(F){var X=S(F+="",!1);return X.toString=function(){return F},X},utcFormat:function(F){var X=w(F+="",_);return X.toString=function(){return F},X},utcParse:function(F){var X=S(F+="",!0);return X.toString=function(){return F},X}}}var Td={"-":"",_:" ",0:"0"},Pe=/^\s*\d+/,hw=/^%/,pw=/[\\^$*+?|[\]().{}]/g;function re(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(t)+i:i)}function vw(e){return e.replace(pw,"\\$&")}function rn(e){return new RegExp("^(?:"+e.map(vw).join("|")+")","i")}function nn(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function yw(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function mw(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function gw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function bw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function xw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Ed(e,t,r){var n=Pe.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Md(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function ww(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function _w(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Ow(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Cd(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Sw(e,t,r){var n=Pe.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Id(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function jw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Aw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Pw(e,t,r){var n=Pe.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Tw(e,t,r){var n=Pe.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Ew(e,t,r){var n=hw.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Mw(e,t,r){var n=Pe.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Cw(e,t,r){var n=Pe.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function kd(e,t){return re(e.getDate(),t,2)}function Iw(e,t){return re(e.getHours(),t,2)}function kw(e,t){return re(e.getHours()%12||12,t,2)}function $w(e,t){return re(1+ti.count(St(e),e),t,3)}function tb(e,t){return re(e.getMilliseconds(),t,3)}function Nw(e,t){return tb(e,t)+"000"}function Rw(e,t){return re(e.getMonth()+1,t,2)}function Dw(e,t){return re(e.getMinutes(),t,2)}function Bw(e,t){return re(e.getSeconds(),t,2)}function Lw(e){var t=e.getDay();return t===0?7:t}function qw(e,t){return re(ma.count(St(e)-1,e),t,2)}function rb(e){var t=e.getDay();return t>=4||t===0?Sr(e):Sr.ceil(e)}function zw(e,t){return e=rb(e),re(Sr.count(St(e),e)+(St(e).getDay()===4),t,2)}function Fw(e){return e.getDay()}function Ww(e,t){return re(ji.count(St(e)-1,e),t,2)}function Uw(e,t){return re(e.getFullYear()%100,t,2)}function Gw(e,t){return e=rb(e),re(e.getFullYear()%100,t,2)}function Hw(e,t){return re(e.getFullYear()%1e4,t,4)}function Kw(e,t){var r=e.getDay();return e=r>=4||r===0?Sr(e):Sr.ceil(e),re(e.getFullYear()%1e4,t,4)}function Vw(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+re(t/60|0,"0",2)+re(t%60,"0",2)}function $d(e,t){return re(e.getUTCDate(),t,2)}function Xw(e,t){return re(e.getUTCHours(),t,2)}function Yw(e,t){return re(e.getUTCHours()%12||12,t,2)}function Zw(e,t){return re(1+ya.count(jt(e),e),t,3)}function nb(e,t){return re(e.getUTCMilliseconds(),t,3)}function Jw(e,t){return nb(e,t)+"000"}function Qw(e,t){return re(e.getUTCMonth()+1,t,2)}function e_(e,t){return re(e.getUTCMinutes(),t,2)}function t_(e,t){return re(e.getUTCSeconds(),t,2)}function r_(e){var t=e.getUTCDay();return t===0?7:t}function n_(e,t){return re(ga.count(jt(e)-1,e),t,2)}function ib(e){var t=e.getUTCDay();return t>=4||t===0?jr(e):jr.ceil(e)}function i_(e,t){return e=ib(e),re(jr.count(jt(e),e)+(jt(e).getUTCDay()===4),t,2)}function a_(e){return e.getUTCDay()}function o_(e,t){return re(Ai.count(jt(e)-1,e),t,2)}function s_(e,t){return re(e.getUTCFullYear()%100,t,2)}function u_(e,t){return e=ib(e),re(e.getUTCFullYear()%100,t,2)}function c_(e,t){return re(e.getUTCFullYear()%1e4,t,4)}function l_(e,t){var r=e.getUTCDay();return e=r>=4||r===0?jr(e):jr.ceil(e),re(e.getUTCFullYear()%1e4,t,4)}function f_(){return"+0000"}function Nd(){return"%"}function Rd(e){return+e}function Dd(e){return Math.floor(+e/1e3)}var vr,ab,ob;d_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function d_(e){return vr=dw(e),ab=vr.format,vr.parse,ob=vr.utcFormat,vr.utcParse,vr}function h_(e){return new Date(e)}function p_(e){return e instanceof Date?+e:+new Date(+e)}function _f(e,t,r,n,i,a,o,s,u,c){var f=uf(),l=f.invert,d=f.domain,v=c(".%L"),m=c(":%S"),y=c("%I:%M"),p=c("%I %p"),g=c("%a %d"),x=c("%b %d"),O=c("%B"),_=c("%Y");function b(w){return(u(w)<w?v:s(w)<w?m:o(w)<w?y:a(w)<w?p:n(w)<w?i(w)<w?g:x:r(w)<w?O:_)(w)}return f.invert=function(w){return new Date(l(w))},f.domain=function(w){return arguments.length?d(Array.from(w,p_)):d().map(h_)},f.ticks=function(w){var S=d();return e(S[0],S[S.length-1],w??10)},f.tickFormat=function(w,S){return S==null?b:c(S)},f.nice=function(w){var S=d();return(!w||typeof w.range!="function")&&(w=t(S[0],S[S.length-1],w??10)),w?d(Hg(S,w)):f},f.copy=function(){return ei(f,_f(e,t,r,n,i,a,o,s,u,c))},f}function v_(){return at.apply(_f(lw,fw,St,xf,ma,ti,gf,yf,Zt,ab).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function y_(){return at.apply(_f(uw,cw,jt,wf,ga,ya,bf,mf,Zt,ob).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ba(){var e=0,t=1,r,n,i,a,o=ke,s=!1,u;function c(l){return l==null||isNaN(l=+l)?u:o(i===0?.5:(l=(a(l)-r)*i,s?Math.max(0,Math.min(1,l)):l))}c.domain=function(l){return arguments.length?([e,t]=l,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),c):[e,t]},c.clamp=function(l){return arguments.length?(s=!!l,c):s},c.interpolator=function(l){return arguments.length?(o=l,c):o};function f(l){return function(d){var v,m;return arguments.length?([v,m]=d,o=l(v,m),c):[o(0),o(1)]}}return c.range=f(Gr),c.rangeRound=f(of),c.unknown=function(l){return arguments.length?(u=l,c):u},function(l){return a=l,r=l(e),n=l(t),i=r===n?0:1/(n-r),c}}function zt(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function sb(){var e=qt(ba()(ke));return e.copy=function(){return zt(e,sb())},Pt.apply(e,arguments)}function ub(){var e=ff(ba()).domain([1,10]);return e.copy=function(){return zt(e,ub()).base(e.base())},Pt.apply(e,arguments)}function cb(){var e=df(ba());return e.copy=function(){return zt(e,cb()).constant(e.constant())},Pt.apply(e,arguments)}function Of(){var e=hf(ba());return e.copy=function(){return zt(e,Of()).exponent(e.exponent())},Pt.apply(e,arguments)}function m_(){return Of.apply(null,arguments).exponent(.5)}function lb(){var e=[],t=ke;function r(n){if(n!=null&&!isNaN(n=+n))return t((Qn(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Dt),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>P1(e,a/n))},r.copy=function(){return lb(t).domain(e)},Pt.apply(r,arguments)}function xa(){var e=0,t=.5,r=1,n=1,i,a,o,s,u,c=ke,f,l=!1,d;function v(y){return isNaN(y=+y)?d:(y=.5+((y=+f(y))-a)*(n*y<n*a?s:u),c(l?Math.max(0,Math.min(1,y)):y))}v.domain=function(y){return arguments.length?([e,t,r]=y,i=f(e=+e),a=f(t=+t),o=f(r=+r),s=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v):[e,t,r]},v.clamp=function(y){return arguments.length?(l=!!y,v):l},v.interpolator=function(y){return arguments.length?(c=y,v):c};function m(y){return function(p){var g,x,O;return arguments.length?([g,x,O]=p,c=g1(y,[g,x,O]),v):[c(0),c(.5),c(1)]}}return v.range=m(Gr),v.rangeRound=m(of),v.unknown=function(y){return arguments.length?(d=y,v):d},function(y){return f=y,i=y(e),a=y(t),o=y(r),s=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v}}function fb(){var e=qt(xa()(ke));return e.copy=function(){return zt(e,fb())},Pt.apply(e,arguments)}function db(){var e=ff(xa()).domain([.1,1,10]);return e.copy=function(){return zt(e,db()).base(e.base())},Pt.apply(e,arguments)}function hb(){var e=df(xa());return e.copy=function(){return zt(e,hb()).constant(e.constant())},Pt.apply(e,arguments)}function Sf(){var e=hf(xa());return e.copy=function(){return zt(e,Sf()).exponent(e.exponent())},Pt.apply(e,arguments)}function g_(){return Sf.apply(null,arguments).exponent(.5)}function pb(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=pb(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function te(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=pb(e))&&(n&&(n+=" "),n+=t);return n}var Qa,Bd;function Be(){if(Bd)return Qa;Bd=1;var e=Array.isArray;return Qa=e,Qa}var eo,Ld;function vb(){if(Ld)return eo;Ld=1;var e=typeof oi=="object"&&oi&&oi.Object===Object&&oi;return eo=e,eo}var to,qd;function ht(){if(qd)return to;qd=1;var e=vb(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return to=r,to}var ro,zd;function ri(){if(zd)return ro;zd=1;var e=ht(),t=e.Symbol;return ro=t,ro}var no,Fd;function b_(){if(Fd)return no;Fd=1;var e=ri(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var s=r.call(o,i),u=o[i];try{o[i]=void 0;var c=!0}catch{}var f=n.call(o);return c&&(s?o[i]=u:delete o[i]),f}return no=a,no}var io,Wd;function x_(){if(Wd)return io;Wd=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return io=r,io}var ao,Ud;function Tt(){if(Ud)return ao;Ud=1;var e=ri(),t=b_(),r=x_(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?t(s):r(s)}return ao=o,ao}var oo,Gd;function Et(){if(Gd)return oo;Gd=1;function e(t){return t!=null&&typeof t=="object"}return oo=e,oo}var so,Hd;function Hr(){if(Hd)return so;Hd=1;var e=Tt(),t=Et(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return so=n,so}var uo,Kd;function jf(){if(Kd)return uo;Kd=1;var e=Be(),t=Hr(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return uo=i,uo}var co,Vd;function Ft(){if(Vd)return co;Vd=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return co=e,co}var lo,Xd;function Af(){if(Xd)return lo;Xd=1;var e=Tt(),t=Ft(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!t(s))return!1;var u=e(s);return u==n||u==i||u==r||u==a}return lo=o,lo}var fo,Yd;function w_(){if(Yd)return fo;Yd=1;var e=ht(),t=e["__core-js_shared__"];return fo=t,fo}var ho,Zd;function __(){if(Zd)return ho;Zd=1;var e=w_(),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 ho=r,ho}var po,Jd;function yb(){if(Jd)return po;Jd=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 po=r,po}var vo,Qd;function O_(){if(Qd)return vo;Qd=1;var e=Af(),t=__(),r=Ft(),n=yb(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,f=RegExp("^"+u.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(d){if(!r(d)||t(d))return!1;var v=e(d)?f:a;return v.test(n(d))}return vo=l,vo}var yo,eh;function S_(){if(eh)return yo;eh=1;function e(t,r){return t==null?void 0:t[r]}return yo=e,yo}var mo,th;function dr(){if(th)return mo;th=1;var e=O_(),t=S_();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return mo=r,mo}var go,rh;function wa(){if(rh)return go;rh=1;var e=dr(),t=e(Object,"create");return go=t,go}var bo,nh;function j_(){if(nh)return bo;nh=1;var e=wa();function t(){this.__data__=e?e(null):{},this.size=0}return bo=t,bo}var xo,ih;function A_(){if(ih)return xo;ih=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return xo=e,xo}var wo,ah;function P_(){if(ah)return wo;ah=1;var e=wa(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var s=o[a];return s===t?void 0:s}return n.call(o,a)?o[a]:void 0}return wo=i,wo}var _o,oh;function T_(){if(oh)return _o;oh=1;var e=wa(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return _o=n,_o}var Oo,sh;function E_(){if(sh)return Oo;sh=1;var e=wa(),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 Oo=r,Oo}var So,uh;function M_(){if(uh)return So;uh=1;var e=j_(),t=A_(),r=P_(),n=T_(),i=E_();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];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,So=a,So}var jo,ch;function C_(){if(ch)return jo;ch=1;function e(){this.__data__=[],this.size=0}return jo=e,jo}var Ao,lh;function Pf(){if(lh)return Ao;lh=1;function e(t,r){return t===r||t!==t&&r!==r}return Ao=e,Ao}var Po,fh;function _a(){if(fh)return Po;fh=1;var e=Pf();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return Po=t,Po}var To,dh;function I_(){if(dh)return To;dh=1;var e=_a(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var s=a.length-1;return o==s?a.pop():r.call(a,o,1),--this.size,!0}return To=n,To}var Eo,hh;function k_(){if(hh)return Eo;hh=1;var e=_a();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return Eo=t,Eo}var Mo,ph;function $_(){if(ph)return Mo;ph=1;var e=_a();function t(r){return e(this.__data__,r)>-1}return Mo=t,Mo}var Co,vh;function N_(){if(vh)return Co;vh=1;var e=_a();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 Co=t,Co}var Io,yh;function Oa(){if(yh)return Io;yh=1;var e=C_(),t=I_(),r=k_(),n=$_(),i=N_();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];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,Io=a,Io}var ko,mh;function Tf(){if(mh)return ko;mh=1;var e=dr(),t=ht(),r=e(t,"Map");return ko=r,ko}var $o,gh;function R_(){if(gh)return $o;gh=1;var e=M_(),t=Oa(),r=Tf();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return $o=n,$o}var No,bh;function D_(){if(bh)return No;bh=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return No=e,No}var Ro,xh;function Sa(){if(xh)return Ro;xh=1;var e=D_();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Ro=t,Ro}var Do,wh;function B_(){if(wh)return Do;wh=1;var e=Sa();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Do=t,Do}var Bo,_h;function L_(){if(_h)return Bo;_h=1;var e=Sa();function t(r){return e(this,r).get(r)}return Bo=t,Bo}var Lo,Oh;function q_(){if(Oh)return Lo;Oh=1;var e=Sa();function t(r){return e(this,r).has(r)}return Lo=t,Lo}var qo,Sh;function z_(){if(Sh)return qo;Sh=1;var e=Sa();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 qo=t,qo}var zo,jh;function Ef(){if(jh)return zo;jh=1;var e=R_(),t=B_(),r=L_(),n=q_(),i=z_();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];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,zo=a,zo}var Fo,Ah;function mb(){if(Ah)return Fo;Ah=1;var e=Ef(),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,s=i?i.apply(this,o):o[0],u=a.cache;if(u.has(s))return u.get(s);var c=n.apply(this,o);return a.cache=u.set(s,c)||u,c};return a.cache=new(r.Cache||e),a}return r.Cache=e,Fo=r,Fo}var Wo,Ph;function F_(){if(Ph)return Wo;Ph=1;var e=mb(),t=500;function r(n){var i=e(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return Wo=r,Wo}var Uo,Th;function W_(){if(Th)return Uo;Th=1;var e=F_(),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,s,u,c){a.push(u?c.replace(r,"$1"):s||o)}),a});return Uo=n,Uo}var Go,Eh;function Mf(){if(Eh)return Go;Eh=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 Go=e,Go}var Ho,Mh;function U_(){if(Mh)return Ho;Mh=1;var e=ri(),t=Mf(),r=Be(),n=Hr(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return t(s,o)+"";if(n(s))return a?a.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return Ho=o,Ho}var Ko,Ch;function gb(){if(Ch)return Ko;Ch=1;var e=U_();function t(r){return r==null?"":e(r)}return Ko=t,Ko}var Vo,Ih;function bb(){if(Ih)return Vo;Ih=1;var e=Be(),t=jf(),r=W_(),n=gb();function i(a,o){return e(a)?a:t(a,o)?[a]:r(n(a))}return Vo=i,Vo}var Xo,kh;function ja(){if(kh)return Xo;kh=1;var e=Hr();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Xo=t,Xo}var Yo,$h;function Cf(){if($h)return Yo;$h=1;var e=bb(),t=ja();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 Yo=r,Yo}var Zo,Nh;function xb(){if(Nh)return Zo;Nh=1;var e=Cf();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return Zo=t,Zo}var G_=xb();const Je=le(G_);var Jo,Rh;function H_(){if(Rh)return Jo;Rh=1;function e(t){return t==null}return Jo=e,Jo}var K_=H_();const Q=le(K_);var Qo,Dh;function V_(){if(Dh)return Qo;Dh=1;var e=Tt(),t=Be(),r=Et(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return Qo=i,Qo}var X_=V_();const ar=le(X_);var Y_=Af();const Y=le(Y_);var Z_=Ft();const Kr=le(Z_);var es={exports:{}},ie={};/**
2
2
  * @license React
3
3
  * react-is.production.min.js
4
4
  *
@@ -65,7 +65,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
65
65
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ck(e,t){if(e){if(typeof e=="string")return hg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hg(e,t)}}function hg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lk(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(f){c=!0,i=f}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function fk(e){if(Array.isArray(e))return e}function Fl(){return Fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fl.apply(this,arguments)}var dk=function(t,r){var n;return P.isValidElement(t)?n=P.cloneElement(t,r):Y(t)?n=t(r):n=P.createElement("line",Fl({},r,{className:"recharts-reference-line-line"})),n},hk=function(t,r,n,i,a,o,s,u,c){var f=a.x,l=a.y,d=a.width,v=a.height;if(n){var m=c.y,y=t.y.apply(m,{position:o});if(ft(c,"discard")&&!t.y.isInRange(y))return null;var p=[{x:f+d,y},{x:f,y}];return u==="left"?p.reverse():p}if(r){var g=c.x,x=t.x.apply(g,{position:o});if(ft(c,"discard")&&!t.x.isInRange(x))return null;var O=[{x,y:l+v},{x,y:l}];return s==="top"?O.reverse():O}if(i){var _=c.segment,b=_.map(function(w){return t.apply(w,{position:o})});return ft(c,"discard")&&oI(b,function(w){return!t.isInRange(w)})?null:b}return null};function pk(e){var t=e.x,r=e.y,n=e.segment,i=e.xAxisId,a=e.yAxisId,o=e.shape,s=e.className,u=e.alwaysShow,c=VI(),f=yx(i),l=mx(a),d=ZI();if(!c||!d)return null;wt(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var v=Jf({x:f.scale,y:l.scale}),m=_e(t),y=_e(r),p=n&&n.length===2,g=hk(v,m,y,p,d,e.position,f.orientation,l.orientation,e);if(!g)return null;var x=sk(g,2),O=x[0],_=O.x,b=O.y,w=x[1],S=w.x,j=w.y,A=ft(e,"hidden")?"url(#".concat(c,")"):void 0,C=dg(dg({clipPath:A},J(e,!0)),{},{x1:_,y1:b,x2:S,y2:j});return P.createElement(de,{className:te("recharts-reference-line",s)},dk(o,C),Ce.renderCallByParent(e,RI({x1:_,y1:b,x2:S,y2:j})))}var id=(function(e){function t(){return QI(this,t),rk(this,t,arguments)}return ak(t,e),tk(t,[{key:"render",value:function(){return P.createElement(pk,this.props)}}])})(P.Component);nd(id,"displayName","ReferenceLine");nd(id,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Wl(){return Wl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wl.apply(this,arguments)}function Dr(e){"@babel/helpers - typeof";return Dr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dr(e)}function pg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pg(Object(r),!0).forEach(function(n){qa(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wx(n.key),n)}}function mk(e,t,r){return t&&yk(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gk(e,t,r){return t=oa(t),bk(e,xx()?Reflect.construct(t,r||[],oa(e).constructor):t.apply(e,r))}function bk(e,t){if(t&&(Dr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xk(e)}function xk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xx=function(){return!!e})()}function oa(e){return oa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},oa(e)}function wk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ul(e,t)}function Ul(e,t){return Ul=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ul(e,t)}function qa(e,t,r){return t=wx(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wx(e){var t=_k(e,"string");return Dr(t)=="symbol"?t:t+""}function _k(e,t){if(Dr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Dr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ok=function(t){var r=t.x,n=t.y,i=t.xAxis,a=t.yAxis,o=Jf({x:i.scale,y:a.scale}),s=o.apply({x:r,y:n},{bandAware:!0});return ft(t,"discard")&&!o.isInRange(s)?null:s},za=(function(e){function t(){return vk(this,t),gk(this,t,arguments)}return wk(t,e),mk(t,[{key:"render",value:function(){var n=this.props,i=n.x,a=n.y,o=n.r,s=n.alwaysShow,u=n.clipPathId,c=_e(i),f=_e(a);if(wt(s===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!c||!f)return null;var l=Ok(this.props);if(!l)return null;var d=l.x,v=l.y,m=this.props,y=m.shape,p=m.className,g=ft(this.props,"hidden")?"url(#".concat(u,")"):void 0,x=vg(vg({clipPath:g},J(this.props,!0)),{},{cx:d,cy:v});return P.createElement(de,{className:te("recharts-reference-dot",p)},t.renderDot(y,x),Ce.renderCallByParent(this.props,{x:d-o,y:v-o,width:2*o,height:2*o}))}}])})(P.Component);qa(za,"displayName","ReferenceDot");qa(za,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});qa(za,"renderDot",function(e,t){var r;return P.isValidElement(e)?r=P.cloneElement(e,t):Y(e)?r=e(t):r=P.createElement(Zf,Wl({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gl.apply(this,arguments)}function Br(e){"@babel/helpers - typeof";return Br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Br(e)}function yg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yg(Object(r),!0).forEach(function(n){Fa(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ox(n.key),n)}}function Ak(e,t,r){return t&&jk(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pk(e,t,r){return t=sa(t),Tk(e,_x()?Reflect.construct(t,r||[],sa(e).constructor):t.apply(e,r))}function Tk(e,t){if(t&&(Br(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ek(e)}function Ek(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _x(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_x=function(){return!!e})()}function sa(e){return sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sa(e)}function Mk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hl(e,t)}function Hl(e,t){return Hl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Hl(e,t)}function Fa(e,t,r){return t=Ox(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ox(e){var t=Ck(e,"string");return Br(t)=="symbol"?t:t+""}function Ck(e,t){if(Br(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Br(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ik=function(t,r,n,i,a){var o=a.x1,s=a.x2,u=a.y1,c=a.y2,f=a.xAxis,l=a.yAxis;if(!f||!l)return null;var d=Jf({x:f.scale,y:l.scale}),v={x:t?d.x.apply(o,{position:"start"}):d.x.rangeMin,y:n?d.y.apply(u,{position:"start"}):d.y.rangeMin},m={x:r?d.x.apply(s,{position:"end"}):d.x.rangeMax,y:i?d.y.apply(c,{position:"end"}):d.y.rangeMax};return ft(a,"discard")&&(!d.isInRange(v)||!d.isInRange(m))?null:cx(v,m)},Wa=(function(e){function t(){return Sk(this,t),Pk(this,t,arguments)}return Mk(t,e),Ak(t,[{key:"render",value:function(){var n=this.props,i=n.x1,a=n.x2,o=n.y1,s=n.y2,u=n.className,c=n.alwaysShow,f=n.clipPathId;wt(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var l=_e(i),d=_e(a),v=_e(o),m=_e(s),y=this.props.shape;if(!l&&!d&&!v&&!m&&!y)return null;var p=Ik(l,d,v,m,this.props);if(!p&&!y)return null;var g=ft(this.props,"hidden")?"url(#".concat(f,")"):void 0;return P.createElement(de,{className:te("recharts-reference-area",u)},t.renderRect(y,mg(mg({clipPath:g},J(this.props,!0)),p)),Ce.renderCallByParent(this.props,p))}}])})(P.Component);Fa(Wa,"displayName","ReferenceArea");Fa(Wa,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Fa(Wa,"renderRect",function(e,t){var r;return P.isValidElement(e)?r=P.cloneElement(e,t):Y(e)?r=e(t):r=P.createElement(Yf,Gl({},t,{className:"recharts-reference-area-rect"})),r});function Sx(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],i=0;i<e.length;i+=t)n.push(e[i]);return n}function kk(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return BI(n,r)}function $k(e,t,r){var n=r==="width",i=e.x,a=e.y,o=e.width,s=e.height;return t===1?{start:n?i:a,end:n?i+o:a+s}:{start:n?i+o:a+s,end:n?i:a}}function ua(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function Nk(e,t){return Sx(e,t+1)}function Rk(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,u=0,c=1,f=o,l=function(){var m=n==null?void 0:n[u];if(m===void 0)return{v:Sx(n,c)};var y=u,p,g=function(){return p===void 0&&(p=r(m,y)),p},x=m.coordinate,O=u===0||ua(e,x,g,f,s);O||(u=0,f=o,c+=1),O&&(f=x+e*(g()/2+i),u+=c)},d;c<=a.length;)if(d=l(),d)return d.v;return[]}function Xn(e){"@babel/helpers - typeof";return Xn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xn(e)}function gg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Me(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gg(Object(r),!0).forEach(function(n){Dk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dk(e,t,r){return t=Bk(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bk(e){var t=Lk(e,"string");return Xn(t)=="symbol"?t:t+""}function Lk(e,t){if(Xn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qk(e,t,r,n,i){for(var a=(n||[]).slice(),o=a.length,s=t.start,u=t.end,c=function(d){var v=a[d],m,y=function(){return m===void 0&&(m=r(v,d)),m};if(d===o-1){var p=e*(v.coordinate+e*y()/2-u);a[d]=v=Me(Me({},v),{},{tickCoord:p>0?v.coordinate-p*e:v.coordinate})}else a[d]=v=Me(Me({},v),{},{tickCoord:v.coordinate});var g=ua(e,v.tickCoord,y,s,u);g&&(u=v.tickCoord-e*(y()/2+i),a[d]=Me(Me({},v),{},{isShow:!0}))},f=o-1;f>=0;f--)c(f);return a}function zk(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,u=t.start,c=t.end;if(a){var f=n[s-1],l=r(f,s-1),d=e*(f.coordinate+e*l/2-c);o[s-1]=f=Me(Me({},f),{},{tickCoord:d>0?f.coordinate-d*e:f.coordinate});var v=ua(e,f.tickCoord,function(){return l},u,c);v&&(c=f.tickCoord-e*(l/2+i),o[s-1]=Me(Me({},f),{},{isShow:!0}))}for(var m=a?s-1:s,y=function(x){var O=o[x],_,b=function(){return _===void 0&&(_=r(O,x)),_};if(x===0){var w=e*(O.coordinate-e*b()/2-u);o[x]=O=Me(Me({},O),{},{tickCoord:w<0?O.coordinate-w*e:O.coordinate})}else o[x]=O=Me(Me({},O),{},{tickCoord:O.coordinate});var S=ua(e,O.tickCoord,b,u,c);S&&(u=O.tickCoord+e*(b()/2+i),o[x]=Me(Me({},O),{},{isShow:!0}))},p=0;p<m;p++)y(p);return o}function ad(e,t,r){var n=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,s=e.orientation,u=e.interval,c=e.tickFormatter,f=e.unit,l=e.angle;if(!i||!i.length||!n)return[];if(L(u)||Yr.isSsr)return Nk(i,typeof u=="number"&&L(u)?u:0);var d=[],v=s==="top"||s==="bottom"?"width":"height",m=f&&v==="width"?vn(f,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=function(O,_){var b=Y(c)?c(O.value,_):O.value;return v==="width"?kk(vn(b,{fontSize:t,letterSpacing:r}),m,l):vn(b,{fontSize:t,letterSpacing:r})[v]},p=i.length>=2?nt(i[1].coordinate-i[0].coordinate):1,g=$k(a,p,v);return u==="equidistantPreserveStart"?Rk(p,g,y,i,o):(u==="preserveStart"||u==="preserveStartEnd"?d=zk(p,g,y,i,o,u==="preserveStartEnd"):d=qk(p,g,y,i,o),d.filter(function(x){return x.isShow}))}var Fk=["viewBox"],Wk=["viewBox"],Uk=["ticks"];function Lr(e){"@babel/helpers - typeof";return Lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lr(e)}function br(){return br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},br.apply(this,arguments)}function bg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bg(Object(r),!0).forEach(function(n){od(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Lc(e,t){if(e==null)return{};var r=Gk(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Gk(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Hk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ax(n.key),n)}}function Kk(e,t,r){return t&&xg(e.prototype,t),r&&xg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vk(e,t,r){return t=ca(t),Xk(e,jx()?Reflect.construct(t,r||[],ca(e).constructor):t.apply(e,r))}function Xk(e,t){if(t&&(Lr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yk(e)}function Yk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jx=function(){return!!e})()}function ca(e){return ca=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ca(e)}function Zk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kl(e,t)}function Kl(e,t){return Kl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Kl(e,t)}function od(e,t,r){return t=Ax(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ax(e){var t=Jk(e,"string");return Lr(t)=="symbol"?t:t+""}function Jk(e,t){if(Lr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Lr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Qr=(function(e){function t(r){var n;return Hk(this,t),n=Vk(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return Zk(t,e),Kk(t,[{key:"shouldComponentUpdate",value:function(n,i){var a=n.viewBox,o=Lc(n,Fk),s=this.props,u=s.viewBox,c=Lc(s,Wk);return!wr(a,u)||!wr(o,c)||!wr(i,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var i=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var i=this.props,a=i.x,o=i.y,s=i.width,u=i.height,c=i.orientation,f=i.tickSize,l=i.mirror,d=i.tickMargin,v,m,y,p,g,x,O=l?-1:1,_=n.tickSize||f,b=L(n.tickCoord)?n.tickCoord:n.coordinate;switch(c){case"top":v=m=n.coordinate,p=o+ +!l*u,y=p-O*_,x=y-O*d,g=b;break;case"left":y=p=n.coordinate,m=a+ +!l*s,v=m-O*_,g=v-O*d,x=b;break;case"right":y=p=n.coordinate,m=a+ +l*s,v=m+O*_,g=v+O*d,x=b;break;default:v=m=n.coordinate,p=o+ +l*u,y=p+O*_,x=y+O*d,g=b;break}return{line:{x1:v,y1:y,x2:m,y2:p},tick:{x:g,y:x}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,i=n.orientation,a=n.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 n=this.props,i=n.orientation,a=n.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 n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,u=n.orientation,c=n.mirror,f=n.axisLine,l=xe(xe(xe({},J(this.props,!1)),J(f,!1)),{},{fill:"none"});if(u==="top"||u==="bottom"){var d=+(u==="top"&&!c||u==="bottom"&&c);l=xe(xe({},l),{},{x1:i,y1:a+d*s,x2:i+o,y2:a+d*s})}else{var v=+(u==="left"&&!c||u==="right"&&c);l=xe(xe({},l),{},{x1:i+v*o,y1:a,x2:i+v*o,y2:a+s})}return P.createElement("line",br({},l,{className:te("recharts-cartesian-axis-line",Je(f,"className"))}))}},{key:"renderTicks",value:function(n,i,a){var o=this,s=this.props,u=s.tickLine,c=s.stroke,f=s.tick,l=s.tickFormatter,d=s.unit,v=ad(xe(xe({},this.props),{},{ticks:n}),i,a),m=this.getTickTextAnchor(),y=this.getTickVerticalAnchor(),p=J(this.props,!1),g=J(f,!1),x=xe(xe({},p),{},{fill:"none"},J(u,!1)),O=v.map(function(_,b){var w=o.getTickLineCoord(_),S=w.line,j=w.tick,A=xe(xe(xe(xe({textAnchor:m,verticalAnchor:y},p),{},{stroke:"none",fill:c},g),j),{},{index:b,payload:_,visibleTicksCount:v.length,tickFormatter:l});return P.createElement(de,br({className:"recharts-cartesian-axis-tick",key:"tick-".concat(_.value,"-").concat(_.coordinate,"-").concat(_.tickCoord)},Ei(o.props,_,b)),u&&P.createElement("line",br({},x,S,{className:te("recharts-cartesian-axis-tick-line",Je(u,"className"))})),f&&t.renderTickItem(f,A,"".concat(Y(l)?l(_.value,b):_.value).concat(d||"")))});return P.createElement("g",{className:"recharts-cartesian-axis-ticks"},O)}},{key:"render",value:function(){var n=this,i=this.props,a=i.axisLine,o=i.width,s=i.height,u=i.ticksGenerator,c=i.className,f=i.hide;if(f)return null;var l=this.props,d=l.ticks,v=Lc(l,Uk),m=d;return Y(u)&&(m=d&&d.length>0?u(this.props):u(v)),o<=0||s<=0||!m||!m.length?null:P.createElement(de,{className:te("recharts-cartesian-axis",c),ref:function(p){n.layerReference=p}},a&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),Ce.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=te(i.className,"recharts-cartesian-axis-tick-value");return P.isValidElement(n)?o=P.cloneElement(n,xe(xe({},i),{},{className:s})):Y(n)?o=n(xe(xe({},i),{},{className:s})):o=P.createElement(qi,br({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})($.Component);od(Qr,"displayName","CartesianAxis");od(Qr,"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 Qk=["x1","y1","x2","y2","key"],e$=["offset"];function cr(e){"@babel/helpers - typeof";return cr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(e)}function wg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wg(Object(r),!0).forEach(function(n){t$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function t$(e,t,r){return t=r$(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r$(e){var t=n$(e,"string");return cr(t)=="symbol"?t:t+""}function n$(e,t){if(cr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(cr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qt(){return Qt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qt.apply(this,arguments)}function _g(e,t){if(e==null)return{};var r=i$(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function i$(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var a$=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,s=t.height,u=t.ry;return P.createElement("rect",{x:i,y:a,ry:u,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Px(e,t){var r;if(P.isValidElement(e))r=P.cloneElement(e,t);else if(Y(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.key,u=_g(t,Qk),c=J(u,!1);c.offset;var f=_g(c,e$);r=P.createElement("line",Qt({},f,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:s}))}return r}function o$(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,u){var c=Ie(Ie({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(u),index:u});return Px(i,c)});return P.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function s$(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,u){var c=Ie(Ie({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(u),index:u});return Px(i,c)});return P.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function u$(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,u=e.horizontal,c=u===void 0?!0:u;if(!c||!t||!t.length)return null;var f=s.map(function(d){return Math.round(d+i-i)}).sort(function(d,v){return d-v});i!==f[0]&&f.unshift(0);var l=f.map(function(d,v){var m=!f[v+1],y=m?i+o-d:f[v+1]-d;if(y<=0)return null;var p=v%t.length;return P.createElement("rect",{key:"react-".concat(v),y:d,x:n,height:y,width:a,stroke:"none",fill:t[p],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return P.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},l)}function c$(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,u=e.height,c=e.verticalPoints;if(!r||!n||!n.length)return null;var f=c.map(function(d){return Math.round(d+a-a)}).sort(function(d,v){return d-v});a!==f[0]&&f.unshift(0);var l=f.map(function(d,v){var m=!f[v+1],y=m?a+s-d:f[v+1]-d;if(y<=0)return null;var p=v%n.length;return P.createElement("rect",{key:"react-".concat(v),x:d,y:o,width:y,height:u,stroke:"none",fill:n[p],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return P.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},l)}var l$=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return q0(ad(Ie(Ie(Ie({},Qr.defaultProps),n),{},{ticks:bt(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},f$=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return q0(ad(Ie(Ie(Ie({},Qr.defaultProps),n),{},{ticks:bt(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},mr={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function ut(e){var t,r,n,i,a,o,s=td(),u=rd(),c=JI(),f=Ie(Ie({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:mr.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:mr.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:mr.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:mr.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:mr.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:mr.verticalFill,x:L(e.x)?e.x:c.left,y:L(e.y)?e.y:c.top,width:L(e.width)?e.width:c.width,height:L(e.height)?e.height:c.height}),l=f.x,d=f.y,v=f.width,m=f.height,y=f.syncWithTicks,p=f.horizontalValues,g=f.verticalValues,x=XI(),O=YI();if(!L(v)||v<=0||!L(m)||m<=0||!L(l)||l!==+l||!L(d)||d!==+d)return null;var _=f.verticalCoordinatesGenerator||l$,b=f.horizontalCoordinatesGenerator||f$,w=f.horizontalPoints,S=f.verticalPoints;if((!w||!w.length)&&Y(b)){var j=p&&p.length,A=b({yAxis:O?Ie(Ie({},O),{},{ticks:j?p:O.ticks}):void 0,width:s,height:u,offset:c},j?!0:y);wt(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(cr(A),"]")),Array.isArray(A)&&(w=A)}if((!S||!S.length)&&Y(_)){var C=g&&g.length,E=_({xAxis:x?Ie(Ie({},x),{},{ticks:C?g:x.ticks}):void 0,width:s,height:u,offset:c},C?!0:y);wt(Array.isArray(E),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(cr(E),"]")),Array.isArray(E)&&(S=E)}return P.createElement("g",{className:"recharts-cartesian-grid"},P.createElement(a$,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),P.createElement(o$,Qt({},f,{offset:c,horizontalPoints:w,xAxis:x,yAxis:O})),P.createElement(s$,Qt({},f,{offset:c,verticalPoints:S,xAxis:x,yAxis:O})),P.createElement(u$,Qt({},f,{horizontalPoints:w})),P.createElement(c$,Qt({},f,{verticalPoints:S})))}ut.displayName="CartesianGrid";var d$=["layout","type","stroke","connectNulls","isRange","ref"],h$=["key"],Tx;function qr(e){"@babel/helpers - typeof";return qr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qr(e)}function Ex(e,t){if(e==null)return{};var r=p$(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function p$(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function er(){return er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},er.apply(this,arguments)}function Og(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Og(Object(r),!0).forEach(function(n){ct(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Og(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function v$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Cx(n.key),n)}}function y$(e,t,r){return t&&Sg(e.prototype,t),r&&Sg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function m$(e,t,r){return t=la(t),g$(e,Mx()?Reflect.construct(t,r||[],la(e).constructor):t.apply(e,r))}function g$(e,t){if(t&&(qr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return b$(e)}function b$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Mx=function(){return!!e})()}function la(e){return la=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},la(e)}function x$(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vl(e,t)}function Vl(e,t){return Vl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Vl(e,t)}function ct(e,t,r){return t=Cx(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cx(e){var t=w$(e,"string");return qr(t)=="symbol"?t:t+""}function w$(e,t){if(qr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(qr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ae=(function(e){function t(){var r;v$(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=m$(this,t,[].concat(i)),ct(r,"state",{isAnimationFinished:!0}),ct(r,"id",ni("recharts-area-")),ct(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Y(o)&&o()}),ct(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Y(o)&&o()}),r}return x$(t,e),y$(t,[{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive,s=this.state.isAnimationFinished;if(o&&!s)return null;var u=this.props,c=u.dot,f=u.points,l=u.dataKey,d=J(this.props,!1),v=J(c,!0),m=f.map(function(p,g){var x=Ct(Ct(Ct({key:"dot-".concat(g),r:3},d),v),{},{index:g,cx:p.x,cy:p.y,dataKey:l,value:p.value,payload:p.payload,points:f});return t.renderDotItem(c,x)}),y={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return P.createElement(de,er({className:"recharts-area-dots"},y),m)}},{key:"renderHorizontalRect",value:function(n){var i=this.props,a=i.baseLine,o=i.points,s=i.strokeWidth,u=o[0].x,c=o[o.length-1].x,f=n*Math.abs(u-c),l=$t(o.map(function(d){return d.y||0}));return L(a)&&typeof a=="number"?l=Math.max(a,l):a&&Array.isArray(a)&&a.length&&(l=Math.max($t(a.map(function(d){return d.y||0})),l)),L(l)?P.createElement("rect",{x:u<c?u:u-f,y:0,width:f,height:Math.floor(l+(s?parseInt("".concat(s),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var i=this.props,a=i.baseLine,o=i.points,s=i.strokeWidth,u=o[0].y,c=o[o.length-1].y,f=n*Math.abs(u-c),l=$t(o.map(function(d){return d.x||0}));return L(a)&&typeof a=="number"?l=Math.max(a,l):a&&Array.isArray(a)&&a.length&&(l=Math.max($t(a.map(function(d){return d.x||0})),l)),L(l)?P.createElement("rect",{x:0,y:u<c?u:u-f,width:l+(s?parseInt("".concat(s),10):1),height:Math.floor(f)}):null}},{key:"renderClipRect",value:function(n){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,i,a,o){var s=this.props,u=s.layout,c=s.type,f=s.stroke,l=s.connectNulls,d=s.isRange;s.ref;var v=Ex(s,d$);return P.createElement(de,{clipPath:a?"url(#clipPath-".concat(o,")"):null},P.createElement(mn,er({},J(v,!0),{points:n,connectNulls:l,type:c,baseLine:i,layout:u,stroke:"none",className:"recharts-area-area"})),f!=="none"&&P.createElement(mn,er({},J(this.props,!1),{className:"recharts-area-curve",layout:u,type:c,connectNulls:l,fill:"none",points:n})),f!=="none"&&d&&P.createElement(mn,er({},J(this.props,!1),{className:"recharts-area-curve",layout:u,type:c,connectNulls:l,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,u=o.baseLine,c=o.isAnimationActive,f=o.animationBegin,l=o.animationDuration,d=o.animationEasing,v=o.animationId,m=this.state,y=m.prevPoints,p=m.prevBaseLine;return P.createElement(At,{begin:f,duration:l,isActive:c,easing:d,from:{t:0},to:{t:1},key:"area-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(g){var x=g.t;if(y){var O=y.length/s.length,_=s.map(function(j,A){var C=Math.floor(A*O);if(y[C]){var E=y[C],T=Ye(E.x,j.x),M=Ye(E.y,j.y);return Ct(Ct({},j),{},{x:T(x),y:M(x)})}return j}),b;if(L(u)&&typeof u=="number"){var w=Ye(p,u);b=w(x)}else if(Q(u)||Vr(u)){var S=Ye(p,0);b=S(x)}else b=u.map(function(j,A){var C=Math.floor(A*O);if(p[C]){var E=p[C],T=Ye(E.x,j.x),M=Ye(E.y,j.y);return Ct(Ct({},j),{},{x:T(x),y:M(x)})}return j});return a.renderAreaStatically(_,b,n,i)}return P.createElement(de,null,P.createElement("defs",null,P.createElement("clipPath",{id:"animationClipPath-".concat(i)},a.renderClipRect(x))),P.createElement(de,{clipPath:"url(#animationClipPath-".concat(i,")")},a.renderAreaStatically(s,u,n,i)))})}},{key:"renderArea",value:function(n,i){var a=this.props,o=a.points,s=a.baseLine,u=a.isAnimationActive,c=this.state,f=c.prevPoints,l=c.prevBaseLine,d=c.totalLength;return u&&o&&o.length&&(!f&&d>0||!Tn(f,o)||!Tn(l,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,u=i.className,c=i.top,f=i.left,l=i.xAxis,d=i.yAxis,v=i.width,m=i.height,y=i.isAnimationActive,p=i.id;if(a||!s||!s.length)return null;var g=this.state.isAnimationFinished,x=s.length===1,O=te("recharts-area",u),_=l&&l.allowDataOverflow,b=d&&d.allowDataOverflow,w=_||b,S=Q(p)?this.id:p,j=(n=J(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=j.r,C=A===void 0?3:A,E=j.strokeWidth,T=E===void 0?2:E,M=mO(o)?o:{},k=M.clipDot,I=k===void 0?!0:k,R=C*2+T;return P.createElement(de,{className:O},_||b?P.createElement("defs",null,P.createElement("clipPath",{id:"clipPath-".concat(S)},P.createElement("rect",{x:_?f:f-v/2,y:b?c:c-m/2,width:_?v:v*2,height:b?m:m*2})),!I&&P.createElement("clipPath",{id:"clipPath-dots-".concat(S)},P.createElement("rect",{x:f-R/2,y:c-R/2,width:v+R,height:m+R}))):null,x?null:this.renderArea(w,S),(o||x)&&this.renderDots(w,I,S),(!y||g)&&Bt.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])})($.PureComponent);Tx=Ae;ct(Ae,"displayName","Area");ct(Ae,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Yr.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});ct(Ae,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,s=o??a;if(L(s)&&typeof s=="number")return s;var u=i==="horizontal"?n:r,c=u.scale.domain();if(u.type==="number"){var f=Math.max(c[0],c[1]),l=Math.min(c[0],c[1]);return s==="dataMin"?l:s==="dataMax"||f<0?f:Math.max(Math.min(c[0],c[1]),0)}return s==="dataMin"?c[0]:s==="dataMax"?c[1]:c[0]});ct(Ae,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,u=e.dataKey,c=e.stackedData,f=e.dataStartIndex,l=e.displayedData,d=e.offset,v=t.layout,m=c&&c.length,y=Tx.getBaseValue(t,r,n,i),p=v==="horizontal",g=!1,x=l.map(function(_,b){var w;m?w=c[f+b]:(w=He(_,u),Array.isArray(w)?g=!0:w=[y,w]);var S=w[1]==null||m&&He(_,u)==null;return p?{x:Gy({axis:n,ticks:a,bandSize:s,entry:_,index:b}),y:S?null:i.scale(w[1]),value:w,payload:_}:{x:S?null:n.scale(w[1]),y:Gy({axis:i,ticks:o,bandSize:s,entry:_,index:b}),value:w,payload:_}}),O;return m||g?O=x.map(function(_){var b=Array.isArray(_.value)?_.value[0]:null;return p?{x:_.x,y:b!=null&&_.y!=null?i.scale(b):null}:{x:b!=null?n.scale(b):null,y:_.y}}):O=p?i.scale(y):n.scale(y),Ct({points:x,baseLine:O,layout:v,isRange:g},d)});ct(Ae,"renderDotItem",function(e,t){var r;if(P.isValidElement(e))r=P.cloneElement(e,t);else if(Y(e))r=e(t);else{var n=te("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=Ex(t,h$);r=P.createElement(Zf,er({},a,{key:i,className:n}))}return r});function zr(e){"@babel/helpers - typeof";return zr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zr(e)}function _$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O$(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$x(n.key),n)}}function S$(e,t,r){return t&&O$(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function j$(e,t,r){return t=fa(t),A$(e,Ix()?Reflect.construct(t,r||[],fa(e).constructor):t.apply(e,r))}function A$(e,t){if(t&&(zr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P$(e)}function P$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ix(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ix=function(){return!!e})()}function fa(e){return fa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fa(e)}function T$(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xl(e,t)}function Xl(e,t){return Xl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Xl(e,t)}function kx(e,t,r){return t=$x(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $x(e){var t=E$(e,"string");return zr(t)=="symbol"?t:t+""}function E$(e,t){if(zr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Yl(){return Yl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yl.apply(this,arguments)}function M$(e){var t=e.xAxisId,r=td(),n=rd(),i=yx(t);return i==null?null:$.createElement(Qr,Yl({},i,{className:te("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return bt(o,!0)}}))}var Ge=(function(e){function t(){return _$(this,t),j$(this,t,arguments)}return T$(t,e),S$(t,[{key:"render",value:function(){return $.createElement(M$,this.props)}}])})($.Component);kx(Ge,"displayName","XAxis");kx(Ge,"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 Fr(e){"@babel/helpers - typeof";return Fr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fr(e)}function C$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I$(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Dx(n.key),n)}}function k$(e,t,r){return t&&I$(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $$(e,t,r){return t=da(t),N$(e,Nx()?Reflect.construct(t,r||[],da(e).constructor):t.apply(e,r))}function N$(e,t){if(t&&(Fr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return R$(e)}function R$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Nx=function(){return!!e})()}function da(e){return da=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},da(e)}function D$(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zl(e,t)}function Zl(e,t){return Zl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Zl(e,t)}function Rx(e,t,r){return t=Dx(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dx(e){var t=B$(e,"string");return Fr(t)=="symbol"?t:t+""}function B$(e,t){if(Fr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Jl(){return Jl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jl.apply(this,arguments)}var L$=function(t){var r=t.yAxisId,n=td(),i=rd(),a=mx(r);return a==null?null:$.createElement(Qr,Jl({},a,{className:te("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(s){return bt(s,!0)}}))},De=(function(e){function t(){return C$(this,t),$$(this,t,arguments)}return D$(t,e),k$(t,[{key:"render",value:function(){return $.createElement(L$,this.props)}}])})($.Component);Rx(De,"displayName","YAxis");Rx(De,"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});function jg(e){return W$(e)||F$(e)||z$(e)||q$()}function q$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
66
66
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z$(e,t){if(e){if(typeof e=="string")return Ql(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ql(e,t)}}function F$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function W$(e){if(Array.isArray(e))return Ql(e)}function Ql(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ef=function(t,r,n,i,a){var o=it(t,id),s=it(t,za),u=[].concat(jg(o),jg(s)),c=it(t,Wa),f="".concat(i,"Id"),l=i[0],d=r;if(u.length&&(d=u.reduce(function(y,p){if(p.props[f]===n&&ft(p.props,"extendDomain")&&L(p.props[l])){var g=p.props[l];return[Math.min(y[0],g),Math.max(y[1],g)]}return y},d)),c.length){var v="".concat(l,"1"),m="".concat(l,"2");d=c.reduce(function(y,p){if(p.props[f]===n&&ft(p.props,"extendDomain")&&L(p.props[v])&&L(p.props[m])){var g=p.props[v],x=p.props[m];return[Math.min(y[0],g,x),Math.max(y[1],g,x)]}return y},d)}return a&&a.length&&(d=a.reduce(function(y,p){return L(p)?[Math.min(y[0],p),Math.max(y[1],p)]:y},d)),d},qc={exports:{}},Ag;function U$(){return Ag||(Ag=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(u,c,f){this.fn=u,this.context=c,this.once=f||!1}function a(u,c,f,l,d){if(typeof f!="function")throw new TypeError("The listener must be a function");var v=new i(f,l||u,d),m=r?r+c:c;return u._events[m]?u._events[m].fn?u._events[m]=[u._events[m],v]:u._events[m].push(v):(u._events[m]=v,u._eventsCount++),u}function o(u,c){--u._eventsCount===0?u._events=new n:delete u._events[c]}function s(){this._events=new n,this._eventsCount=0}s.prototype.eventNames=function(){var c=[],f,l;if(this._eventsCount===0)return c;for(l in f=this._events)t.call(f,l)&&c.push(r?l.slice(1):l);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(f)):c},s.prototype.listeners=function(c){var f=r?r+c:c,l=this._events[f];if(!l)return[];if(l.fn)return[l.fn];for(var d=0,v=l.length,m=new Array(v);d<v;d++)m[d]=l[d].fn;return m},s.prototype.listenerCount=function(c){var f=r?r+c:c,l=this._events[f];return l?l.fn?1:l.length:0},s.prototype.emit=function(c,f,l,d,v,m){var y=r?r+c:c;if(!this._events[y])return!1;var p=this._events[y],g=arguments.length,x,O;if(p.fn){switch(p.once&&this.removeListener(c,p.fn,void 0,!0),g){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,f),!0;case 3:return p.fn.call(p.context,f,l),!0;case 4:return p.fn.call(p.context,f,l,d),!0;case 5:return p.fn.call(p.context,f,l,d,v),!0;case 6:return p.fn.call(p.context,f,l,d,v,m),!0}for(O=1,x=new Array(g-1);O<g;O++)x[O-1]=arguments[O];p.fn.apply(p.context,x)}else{var _=p.length,b;for(O=0;O<_;O++)switch(p[O].once&&this.removeListener(c,p[O].fn,void 0,!0),g){case 1:p[O].fn.call(p[O].context);break;case 2:p[O].fn.call(p[O].context,f);break;case 3:p[O].fn.call(p[O].context,f,l);break;case 4:p[O].fn.call(p[O].context,f,l,d);break;default:if(!x)for(b=1,x=new Array(g-1);b<g;b++)x[b-1]=arguments[b];p[O].fn.apply(p[O].context,x)}}return!0},s.prototype.on=function(c,f,l){return a(this,c,f,l,!1)},s.prototype.once=function(c,f,l){return a(this,c,f,l,!0)},s.prototype.removeListener=function(c,f,l,d){var v=r?r+c:c;if(!this._events[v])return this;if(!f)return o(this,v),this;var m=this._events[v];if(m.fn)m.fn===f&&(!d||m.once)&&(!l||m.context===l)&&o(this,v);else{for(var y=0,p=[],g=m.length;y<g;y++)(m[y].fn!==f||d&&!m[y].once||l&&m[y].context!==l)&&p.push(m[y]);p.length?this._events[v]=p.length===1?p[0]:p:o(this,v)}return this},s.prototype.removeAllListeners=function(c){var f;return c?(f=r?r+c:c,this._events[f]&&o(this,f)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s})(qc)),qc.exports}var G$=U$();const H$=le(G$);var zc=new H$,Fc="recharts.syncMouseEvents";function Yn(e){"@babel/helpers - typeof";return Yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(e)}function K$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V$(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Bx(n.key),n)}}function X$(e,t,r){return t&&V$(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wc(e,t,r){return t=Bx(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bx(e){var t=Y$(e,"string");return Yn(t)=="symbol"?t:t+""}function Y$(e,t){if(Yn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Yn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Z$=(function(){function e(){K$(this,e),Wc(this,"activeIndex",0),Wc(this,"coordinateList",[]),Wc(this,"layout","horizontal")}return X$(e,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,a=i===void 0?null:i,o=r.container,s=o===void 0?null:o,u=r.layout,c=u===void 0?null:u,f=r.offset,l=f===void 0?null:f,d=r.mouseHandlerCallback,v=d===void 0?null:d;this.coordinateList=(n=a??this.coordinateList)!==null&&n!==void 0?n:[],this.container=s??this.container,this.layout=c??this.layout,this.offset=l??this.offset,this.mouseHandlerCallback=v??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),a=i.x,o=i.y,s=i.height,u=this.coordinateList[this.activeIndex].coordinate,c=((r=window)===null||r===void 0?void 0:r.scrollX)||0,f=((n=window)===null||n===void 0?void 0:n.scrollY)||0,l=a+u+c,d=o+this.offset.top+s/2+f;this.mouseHandlerCallback({pageX:l,pageY:d})}}}])})();function J$(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],i=e==null?void 0:e[1];if(n&&i&&L(n)&&L(i))return!0}return!1}function Q$(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function Lx(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,a=e.endAngle,o=Ee(t,r,n,i),s=Ee(t,r,n,a);return{points:[o,s],cx:t,cy:r,radius:n,startAngle:i,endAngle:a}}function eN(e,t,r){var n,i,a,o;if(e==="horizontal")n=t.x,a=n,i=r.top,o=r.top+r.height;else if(e==="vertical")i=t.y,o=i,n=r.left,a=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var s=t.cx,u=t.cy,c=t.innerRadius,f=t.outerRadius,l=t.angle,d=Ee(s,u,c,l),v=Ee(s,u,f,l);n=d.x,i=d.y,a=v.x,o=v.y}else return Lx(t);return[{x:n,y:i},{x:a,y:o}]}function Zn(e){"@babel/helpers - typeof";return Zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zn(e)}function Pg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pg(Object(r),!0).forEach(function(n){tN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tN(e,t,r){return t=rN(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rN(e){var t=nN(e,"string");return Zn(t)=="symbol"?t:t+""}function nN(e,t){if(Zn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iN(e){var t,r,n=e.element,i=e.tooltipEventType,a=e.isActive,o=e.activeCoordinate,s=e.activePayload,u=e.offset,c=e.activeTooltipIndex,f=e.tooltipAxisBandSize,l=e.layout,d=e.chartName,v=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!v||!a||!o||d!=="ScatterChart"&&i!=="axis")return null;var m,y=mn;if(d==="ScatterChart")m=o,y=o2;else if(d==="BarChart")m=Q$(l,o,u,f),y=Yf;else if(l==="radial"){var p=Lx(o),g=p.cx,x=p.cy,O=p.radius,_=p.startAngle,b=p.endAngle;m={cx:g,cy:x,startAngle:_,endAngle:b,innerRadius:O,outerRadius:O},y=G0}else m={points:eN(l,o,u)},y=mn;var w=yi(yi(yi(yi({stroke:"#ccc",pointerEvents:"none"},u),m),J(v,!1)),{},{payload:s,payloadIndex:c,className:te("recharts-tooltip-cursor",v.className)});return $.isValidElement(v)?$.cloneElement(v,w):$.createElement(y,w)}var aN=["item"],oN=["children","className","width","height","style","compact","title","desc"];function Wr(e){"@babel/helpers - typeof";return Wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wr(e)}function xr(){return xr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xr.apply(this,arguments)}function Tg(e,t){return cN(e)||uN(e,t)||zx(e,t)||sN()}function sN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
67
67
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uN(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(f){c=!0,i=f}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function cN(e){if(Array.isArray(e))return e}function Eg(e,t){if(e==null)return{};var r=lN(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lN(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function fN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dN(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Fx(n.key),n)}}function hN(e,t,r){return t&&dN(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pN(e,t,r){return t=ha(t),vN(e,qx()?Reflect.construct(t,r||[],ha(e).constructor):t.apply(e,r))}function vN(e,t){if(t&&(Wr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yN(e)}function yN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qx=function(){return!!e})()}function ha(e){return ha=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ha(e)}function mN(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tf(e,t)}function tf(e,t){return tf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},tf(e,t)}function Ur(e){return xN(e)||bN(e)||zx(e)||gN()}function gN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
68
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zx(e,t){if(e){if(typeof e=="string")return rf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rf(e,t)}}function bN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xN(e){if(Array.isArray(e))return rf(e)}function rf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Mg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mg(Object(r),!0).forEach(function(n){H(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function H(e,t,r){return t=Fx(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fx(e){var t=wN(e,"string");return Wr(t)=="symbol"?t:t+""}function wN(e,t){if(Wr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _N={xAxis:["bottom","top"],yAxis:["left","right"]},ON={width:"100%",height:"100%"},Wx={x:0,y:0};function mi(e){return e}var SN=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},jN=function(t,r,n,i){var a=r.find(function(f){return f&&f.index===n});if(a){if(t==="horizontal")return{x:a.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:a.coordinate};if(t==="centric"){var o=a.coordinate,s=i.radius;return N(N(N({},i),Ee(i.cx,i.cy,s,o)),{},{angle:o,radius:s})}var u=a.coordinate,c=i.angle;return N(N(N({},i),Ee(i.cx,i.cy,u,c)),{},{angle:c,radius:u})}return Wx},Ua=function(t,r){var n=r.graphicalItems,i=r.dataStartIndex,a=r.dataEndIndex,o=(n??[]).reduce(function(s,u){var c=u.props.data;return c&&c.length?[].concat(Ur(s),Ur(c)):s},[]);return o.length>0?o:t&&t.length&&L(i)&&L(a)?t.slice(i,a+1):[]};function Ux(e){return e==="number"?[0,"auto"]:void 0}var nf=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=Ua(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(u,c){var f,l=(f=c.props.data)!==null&&f!==void 0?f:r;l&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(l=l.slice(t.dataStartIndex,t.dataEndIndex+1));var d;if(o.dataKey&&!o.allowDuplicatedCategory){var v=l===void 0?s:l;d=Pi(v,o.dataKey,i)}else d=l&&l[n]||s[n];return d?[].concat(Ur(u),[F0(c,d)]):u},[])},Cg=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=SN(a,n),s=t.orderedTooltipTicks,u=t.tooltipAxis,c=t.tooltipTicks,f=WT(o,s,c,u);if(f>=0&&c){var l=c[f]&&c[f].value,d=nf(t,r,f,l),v=jN(n,s,f,a);return{activeTooltipIndex:f,activeLabel:l,activePayload:d,activeCoordinate:v}}return null},AN=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,u=r.dataStartIndex,c=r.dataEndIndex,f=t.layout,l=t.children,d=t.stackOffset,v=L0(f,a);return n.reduce(function(m,y){var p,g=y.type.defaultProps!==void 0?N(N({},y.type.defaultProps),y.props):y.props,x=g.type,O=g.dataKey,_=g.allowDataOverflow,b=g.allowDuplicatedCategory,w=g.scale,S=g.ticks,j=g.includeHidden,A=g[o];if(m[A])return m;var C=Ua(t.data,{graphicalItems:i.filter(function(W){var V,ue=o in W.props?W.props[o]:(V=W.type.defaultProps)===null||V===void 0?void 0:V[o];return ue===A}),dataStartIndex:u,dataEndIndex:c}),E=C.length,T,M,k;J$(g.domain,_,x)&&(T=_l(g.domain,null,_),v&&(x==="number"||w!=="auto")&&(k=yn(C,O,"category")));var I=Ux(x);if(!T||T.length===0){var R,B=(R=g.domain)!==null&&R!==void 0?R:I;if(O){if(T=yn(C,O,x),x==="category"&&v){var q=sO(T);b&&q?(M=T,T=ea(0,E)):b||(T=Xy(B,T,y).reduce(function(W,V){return W.indexOf(V)>=0?W:[].concat(Ur(W),[V])},[]))}else if(x==="category")b?T=T.filter(function(W){return W!==""&&!Q(W)}):T=Xy(B,T,y).reduce(function(W,V){return W.indexOf(V)>=0||V===""||Q(V)?W:[].concat(Ur(W),[V])},[]);else if(x==="number"){var z=VT(C,i.filter(function(W){var V,ue,ve=o in W.props?W.props[o]:(V=W.type.defaultProps)===null||V===void 0?void 0:V[o],Le="hide"in W.props?W.props.hide:(ue=W.type.defaultProps)===null||ue===void 0?void 0:ue.hide;return ve===A&&(j||!Le)}),O,a,f);z&&(T=z)}v&&(x==="number"||w!=="auto")&&(k=yn(C,O,"category"))}else v?T=ea(0,E):s&&s[A]&&s[A].hasStack&&x==="number"?T=d==="expand"?[0,1]:z0(s[A].stackGroups,u,c):T=B0(C,i.filter(function(W){var V=o in W.props?W.props[o]:W.type.defaultProps[o],ue="hide"in W.props?W.props.hide:W.type.defaultProps.hide;return V===A&&(j||!ue)}),x,f,!0);if(x==="number")T=ef(l,T,A,a,S),B&&(T=_l(B,T,_));else if(x==="category"&&B){var G=B,K=T.every(function(W){return G.indexOf(W)>=0});K&&(T=G)}}return N(N({},m),{},H({},A,N(N({},g),{},{axisType:a,domain:T,categoricalDomain:k,duplicateDomain:M,originalDomain:(p=g.domain)!==null&&p!==void 0?p:I,isCategorical:v,layout:f})))},{})},PN=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,u=r.dataStartIndex,c=r.dataEndIndex,f=t.layout,l=t.children,d=Ua(t.data,{graphicalItems:n,dataStartIndex:u,dataEndIndex:c}),v=d.length,m=L0(f,a),y=-1;return n.reduce(function(p,g){var x=g.type.defaultProps!==void 0?N(N({},g.type.defaultProps),g.props):g.props,O=x[o],_=Ux("number");if(!p[O]){y++;var b;return m?b=ea(0,v):s&&s[O]&&s[O].hasStack?(b=z0(s[O].stackGroups,u,c),b=ef(l,b,O,a)):(b=_l(_,B0(d,n.filter(function(w){var S,j,A=o in w.props?w.props[o]:(S=w.type.defaultProps)===null||S===void 0?void 0:S[o],C="hide"in w.props?w.props.hide:(j=w.type.defaultProps)===null||j===void 0?void 0:j.hide;return A===O&&!C}),"number",f),i.defaultProps.allowDataOverflow),b=ef(l,b,O,a)),N(N({},p),{},H({},O,N(N({axisType:a},i.defaultProps),{},{hide:!0,orientation:Je(_N,"".concat(a,".").concat(y%2),null),domain:b,originalDomain:_,isCategorical:m,layout:f})))}return p},{})},TN=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,u=r.dataStartIndex,c=r.dataEndIndex,f=t.children,l="".concat(i,"Id"),d=it(f,a),v={};return d&&d.length?v=AN(t,{axes:d,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:s,dataStartIndex:u,dataEndIndex:c}):o&&o.length&&(v=PN(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:s,dataStartIndex:u,dataEndIndex:c})),v},EN=function(t){var r=kt(t),n=bt(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Gf(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Ui(r,n)}},Ig=function(t){var r=t.children,n=t.defaultShowTooltip,i=ze(r,$r),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},MN=function(t){return!t||!t.length?!1:t.some(function(r){var n=xt(r&&r.type);return n&&n.indexOf("Bar")>=0})},kg=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},CN=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,u=s===void 0?{}:s,c=n.width,f=n.height,l=n.children,d=n.margin||{},v=ze(l,$r),m=ze(l,Ue),y=Object.keys(u).reduce(function(b,w){var S=u[w],j=S.orientation;return!S.mirror&&!S.hide?N(N({},b),{},H({},j,b[j]+S.width)):b},{left:d.left||0,right:d.right||0}),p=Object.keys(o).reduce(function(b,w){var S=o[w],j=S.orientation;return!S.mirror&&!S.hide?N(N({},b),{},H({},j,Je(b,"".concat(j))+S.height)):b},{top:d.top||0,bottom:d.bottom||0}),g=N(N({},p),y),x=g.bottom;v&&(g.bottom+=v.props.height||$r.defaultProps.height),m&&r&&(g=HT(g,i,n,r));var O=c-g.left-g.right,_=f-g.top-g.bottom;return N(N({brushBottom:x},g),{},{width:Math.max(O,0),height:Math.max(_,0)})},IN=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Gx=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,u=t.axisComponents,c=t.legendContent,f=t.formatAxisMap,l=t.defaultProps,d=function(g,x){var O=x.graphicalItems,_=x.stackGroups,b=x.offset,w=x.updateId,S=x.dataStartIndex,j=x.dataEndIndex,A=g.barSize,C=g.layout,E=g.barGap,T=g.barCategoryGap,M=g.maxBarSize,k=kg(C),I=k.numericAxisName,R=k.cateAxisName,B=MN(O),q=[];return O.forEach(function(z,G){var K=Ua(g.data,{graphicalItems:[z],dataStartIndex:S,dataEndIndex:j}),W=z.type.defaultProps!==void 0?N(N({},z.type.defaultProps),z.props):z.props,V=W.dataKey,ue=W.maxBarSize,ve=W["".concat(I,"Id")],Le=W["".concat(R,"Id")],Gt={},$e=u.reduce(function(Ht,Kt){var Ka=x["".concat(Kt.axisType,"Map")],ud=W["".concat(Kt.axisType,"Id")];Ka&&Ka[ud]||Kt.axisType==="zAxis"||ur();var cd=Ka[ud];return N(N({},Ht),{},H(H({},Kt.axisType,cd),"".concat(Kt.axisType,"Ticks"),bt(cd)))},Gt),F=$e[R],X=$e["".concat(R,"Ticks")],Z=_&&_[ve]&&_[ve].hasStack&&oE(z,_[ve].stackGroups),D=xt(z.type).indexOf("Bar")>=0,he=Ui(F,X),ee=[],ge=B&&UT({barSize:A,stackGroups:_,totalSize:IN($e,R)});if(D){var be,Ne,Mt=Q(ue)?M:ue,pr=(be=(Ne=Ui(F,X,!0))!==null&&Ne!==void 0?Ne:Mt)!==null&&be!==void 0?be:0;ee=GT({barGap:E,barCategoryGap:T,bandSize:pr!==he?pr:he,sizeList:ge[Le],maxBarSize:Mt}),pr!==he&&(ee=ee.map(function(Ht){return N(N({},Ht),{},{position:N(N({},Ht.position),{},{offset:Ht.position.offset-pr/2})})}))}var ai=z&&z.type&&z.type.getComposedData;ai&&q.push({props:N(N({},ai(N(N({},$e),{},{displayedData:K,props:g,dataKey:V,item:z,bandSize:he,barPosition:ee,offset:b,stackedData:Z,layout:C,dataStartIndex:S,dataEndIndex:j}))),{},H(H(H({key:z.key||"item-".concat(G)},I,$e[I]),R,$e[R]),"animationId",w)),childIndex:xO(z,g.children),item:z})}),q},v=function(g,x){var O=g.props,_=g.dataStartIndex,b=g.dataEndIndex,w=g.updateId;if(!Hh({props:O}))return null;var S=O.children,j=O.layout,A=O.stackOffset,C=O.data,E=O.reverseStackOrder,T=kg(j),M=T.numericAxisName,k=T.cateAxisName,I=it(S,n),R=nE(C,I,"".concat(M,"Id"),"".concat(k,"Id"),A,E),B=u.reduce(function(W,V){var ue="".concat(V.axisType,"Map");return N(N({},W),{},H({},ue,TN(O,N(N({},V),{},{graphicalItems:I,stackGroups:V.axisType===M&&R,dataStartIndex:_,dataEndIndex:b}))))},{}),q=CN(N(N({},B),{},{props:O,graphicalItems:I}),x==null?void 0:x.legendBBox);Object.keys(B).forEach(function(W){B[W]=f(O,B[W],q,W.replace("Map",""),r)});var z=B["".concat(k,"Map")],G=EN(z),K=d(O,N(N({},B),{},{dataStartIndex:_,dataEndIndex:b,updateId:w,graphicalItems:I,stackGroups:R,offset:q}));return N(N({formattedGraphicalItems:K,graphicalItems:I,offset:q,stackGroups:R},G),B)},m=(function(p){function g(x){var O,_,b;return fN(this,g),b=pN(this,g,[x]),H(b,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),H(b,"accessibilityManager",new Z$),H(b,"handleLegendBBoxUpdate",function(w){if(w){var S=b.state,j=S.dataStartIndex,A=S.dataEndIndex,C=S.updateId;b.setState(N({legendBBox:w},v({props:b.props,dataStartIndex:j,dataEndIndex:A,updateId:C},N(N({},b.state),{},{legendBBox:w}))))}}),H(b,"handleReceiveSyncEvent",function(w,S,j){if(b.props.syncId===w){if(j===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(S)}}),H(b,"handleBrushChange",function(w){var S=w.startIndex,j=w.endIndex;if(S!==b.state.dataStartIndex||j!==b.state.dataEndIndex){var A=b.state.updateId;b.setState(function(){return N({dataStartIndex:S,dataEndIndex:j},v({props:b.props,dataStartIndex:S,dataEndIndex:j,updateId:A},b.state))}),b.triggerSyncEvent({dataStartIndex:S,dataEndIndex:j})}}),H(b,"handleMouseEnter",function(w){var S=b.getMouseInfo(w);if(S){var j=N(N({},S),{},{isTooltipActive:!0});b.setState(j),b.triggerSyncEvent(j);var A=b.props.onMouseEnter;Y(A)&&A(j,w)}}),H(b,"triggeredAfterMouseMove",function(w){var S=b.getMouseInfo(w),j=S?N(N({},S),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(j),b.triggerSyncEvent(j);var A=b.props.onMouseMove;Y(A)&&A(j,w)}),H(b,"handleItemMouseEnter",function(w){b.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),H(b,"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),H(b,"handleMouseMove",function(w){w.persist(),b.throttleTriggeredAfterMouseMove(w)}),H(b,"handleMouseLeave",function(w){b.throttleTriggeredAfterMouseMove.cancel();var S={isTooltipActive:!1};b.setState(S),b.triggerSyncEvent(S);var j=b.props.onMouseLeave;Y(j)&&j(S,w)}),H(b,"handleOuterEvent",function(w){var S=bO(w),j=Je(b.props,"".concat(S));if(S&&Y(j)){var A,C;/.*touch.*/i.test(S)?C=b.getMouseInfo(w.changedTouches[0]):C=b.getMouseInfo(w),j((A=C)!==null&&A!==void 0?A:{},w)}}),H(b,"handleClick",function(w){var S=b.getMouseInfo(w);if(S){var j=N(N({},S),{},{isTooltipActive:!0});b.setState(j),b.triggerSyncEvent(j);var A=b.props.onClick;Y(A)&&A(j,w)}}),H(b,"handleMouseDown",function(w){var S=b.props.onMouseDown;if(Y(S)){var j=b.getMouseInfo(w);S(j,w)}}),H(b,"handleMouseUp",function(w){var S=b.props.onMouseUp;if(Y(S)){var j=b.getMouseInfo(w);S(j,w)}}),H(b,"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),H(b,"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseDown(w.changedTouches[0])}),H(b,"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseUp(w.changedTouches[0])}),H(b,"handleDoubleClick",function(w){var S=b.props.onDoubleClick;if(Y(S)){var j=b.getMouseInfo(w);S(j,w)}}),H(b,"handleContextMenu",function(w){var S=b.props.onContextMenu;if(Y(S)){var j=b.getMouseInfo(w);S(j,w)}}),H(b,"triggerSyncEvent",function(w){b.props.syncId!==void 0&&zc.emit(Fc,b.props.syncId,w,b.eventEmitterSymbol)}),H(b,"applySyncEvent",function(w){var S=b.props,j=S.layout,A=S.syncMethod,C=b.state.updateId,E=w.dataStartIndex,T=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)b.setState(N({dataStartIndex:E,dataEndIndex:T},v({props:b.props,dataStartIndex:E,dataEndIndex:T,updateId:C},b.state)));else if(w.activeTooltipIndex!==void 0){var M=w.chartX,k=w.chartY,I=w.activeTooltipIndex,R=b.state,B=R.offset,q=R.tooltipTicks;if(!B)return;if(typeof A=="function")I=A(q,w);else if(A==="value"){I=-1;for(var z=0;z<q.length;z++)if(q[z].value===w.activeLabel){I=z;break}}var G=N(N({},B),{},{x:B.left,y:B.top}),K=Math.min(M,G.x+G.width),W=Math.min(k,G.y+G.height),V=q[I]&&q[I].value,ue=nf(b.state,b.props.data,I),ve=q[I]?{x:j==="horizontal"?q[I].coordinate:K,y:j==="horizontal"?W:q[I].coordinate}:Wx;b.setState(N(N({},w),{},{activeLabel:V,activeCoordinate:ve,activePayload:ue,activeTooltipIndex:I}))}else b.setState(w)}),H(b,"renderCursor",function(w){var S,j=b.state,A=j.isTooltipActive,C=j.activeCoordinate,E=j.activePayload,T=j.offset,M=j.activeTooltipIndex,k=j.tooltipAxisBandSize,I=b.getTooltipEventType(),R=(S=w.props.active)!==null&&S!==void 0?S:A,B=b.props.layout,q=w.key||"_recharts-cursor";return P.createElement(iN,{key:q,activeCoordinate:C,activePayload:E,activeTooltipIndex:M,chartName:r,element:w,isActive:R,layout:B,offset:T,tooltipAxisBandSize:k,tooltipEventType:I})}),H(b,"renderPolarAxis",function(w,S,j){var A=Je(w,"type.axisType"),C=Je(b.state,"".concat(A,"Map")),E=w.type.defaultProps,T=E!==void 0?N(N({},E),w.props):w.props,M=C&&C[T["".concat(A,"Id")]];return $.cloneElement(w,N(N({},M),{},{className:te(A,M.className),key:w.key||"".concat(S,"-").concat(j),ticks:bt(M,!0)}))}),H(b,"renderPolarGrid",function(w){var S=w.props,j=S.radialLines,A=S.polarAngles,C=S.polarRadius,E=b.state,T=E.radiusAxisMap,M=E.angleAxisMap,k=kt(T),I=kt(M),R=I.cx,B=I.cy,q=I.innerRadius,z=I.outerRadius;return $.cloneElement(w,{polarAngles:Array.isArray(A)?A:bt(I,!0).map(function(G){return G.coordinate}),polarRadius:Array.isArray(C)?C:bt(k,!0).map(function(G){return G.coordinate}),cx:R,cy:B,innerRadius:q,outerRadius:z,key:w.key||"polar-grid",radialLines:j})}),H(b,"renderLegend",function(){var w=b.state.formattedGraphicalItems,S=b.props,j=S.children,A=S.width,C=S.height,E=b.props.margin||{},T=A-(E.left||0)-(E.right||0),M=R0({children:j,formattedGraphicalItems:w,legendWidth:T,legendContent:c});if(!M)return null;var k=M.item,I=Eg(M,aN);return $.cloneElement(k,N(N({},I),{},{chartWidth:A,chartHeight:C,margin:E,onBBoxUpdate:b.handleLegendBBoxUpdate}))}),H(b,"renderTooltip",function(){var w,S=b.props,j=S.children,A=S.accessibilityLayer,C=ze(j,je);if(!C)return null;var E=b.state,T=E.isTooltipActive,M=E.activeCoordinate,k=E.activePayload,I=E.activeLabel,R=E.offset,B=(w=C.props.active)!==null&&w!==void 0?w:T;return $.cloneElement(C,{viewBox:N(N({},R),{},{x:R.left,y:R.top}),active:B,label:I,payload:B?k:[],coordinate:M,accessibilityLayer:A})}),H(b,"renderBrush",function(w){var S=b.props,j=S.margin,A=S.data,C=b.state,E=C.offset,T=C.dataStartIndex,M=C.dataEndIndex,k=C.updateId;return $.cloneElement(w,{key:w.key||"_recharts-brush",onChange:di(b.handleBrushChange,w.props.onChange),data:A,x:L(w.props.x)?w.props.x:E.left,y:L(w.props.y)?w.props.y:E.top+E.height+E.brushBottom-(j.bottom||0),width:L(w.props.width)?w.props.width:E.width,startIndex:T,endIndex:M,updateId:"brush-".concat(k)})}),H(b,"renderReferenceElement",function(w,S,j){if(!w)return null;var A=b,C=A.clipPathId,E=b.state,T=E.xAxisMap,M=E.yAxisMap,k=E.offset,I=w.type.defaultProps||{},R=w.props,B=R.xAxisId,q=B===void 0?I.xAxisId:B,z=R.yAxisId,G=z===void 0?I.yAxisId:z;return $.cloneElement(w,{key:w.key||"".concat(S,"-").concat(j),xAxis:T[q],yAxis:M[G],viewBox:{x:k.left,y:k.top,width:k.width,height:k.height},clipPathId:C})}),H(b,"renderActivePoints",function(w){var S=w.item,j=w.activePoint,A=w.basePoint,C=w.childIndex,E=w.isRange,T=[],M=S.props.key,k=S.item.type.defaultProps!==void 0?N(N({},S.item.type.defaultProps),S.item.props):S.item.props,I=k.activeDot,R=k.dataKey,B=N(N({index:C,dataKey:R,cx:j.x,cy:j.y,r:4,fill:Xf(S.item),strokeWidth:2,stroke:"#fff",payload:j.payload,value:j.value},J(I,!1)),Ti(I));return T.push(g.renderActiveDot(I,B,"".concat(M,"-activePoint-").concat(C))),A?T.push(g.renderActiveDot(I,N(N({},B),{},{cx:A.x,cy:A.y}),"".concat(M,"-basePoint-").concat(C))):E&&T.push(null),T}),H(b,"renderGraphicChild",function(w,S,j){var A=b.filterFormatItem(w,S,j);if(!A)return null;var C=b.getTooltipEventType(),E=b.state,T=E.isTooltipActive,M=E.tooltipAxis,k=E.activeTooltipIndex,I=E.activeLabel,R=b.props.children,B=ze(R,je),q=A.props,z=q.points,G=q.isRange,K=q.baseLine,W=A.item.type.defaultProps!==void 0?N(N({},A.item.type.defaultProps),A.item.props):A.item.props,V=W.activeDot,ue=W.hide,ve=W.activeBar,Le=W.activeShape,Gt=!!(!ue&&T&&B&&(V||ve||Le)),$e={};C!=="axis"&&B&&B.props.trigger==="click"?$e={onClick:di(b.handleItemMouseEnter,w.props.onClick)}:C!=="axis"&&($e={onMouseLeave:di(b.handleItemMouseLeave,w.props.onMouseLeave),onMouseEnter:di(b.handleItemMouseEnter,w.props.onMouseEnter)});var F=$.cloneElement(w,N(N({},A.props),$e));function X(Kt){return typeof M.dataKey=="function"?M.dataKey(Kt.payload):null}if(Gt)if(k>=0){var Z,D;if(M.dataKey&&!M.allowDuplicatedCategory){var he=typeof M.dataKey=="function"?X:"payload.".concat(M.dataKey.toString());Z=Pi(z,he,I),D=G&&K&&Pi(K,he,I)}else Z=z==null?void 0:z[k],D=G&&K&&K[k];if(Le||ve){var ee=w.props.activeIndex!==void 0?w.props.activeIndex:k;return[$.cloneElement(w,N(N(N({},A.props),$e),{},{activeIndex:ee})),null,null]}if(!Q(Z))return[F].concat(Ur(b.renderActivePoints({item:A,activePoint:Z,basePoint:D,childIndex:k,isRange:G})))}else{var ge,be=(ge=b.getItemByXY(b.state.activeCoordinate))!==null&&ge!==void 0?ge:{graphicalItem:F},Ne=be.graphicalItem,Mt=Ne.item,pr=Mt===void 0?w:Mt,ai=Ne.childIndex,Ht=N(N(N({},A.props),$e),{},{activeIndex:ai});return[$.cloneElement(pr,Ht),null,null]}return G?[F,null,null]:[F,null]}),H(b,"renderCustomized",function(w,S,j){return $.cloneElement(w,N(N({key:"recharts-customized-".concat(j)},b.props),b.state))}),H(b,"renderMap",{CartesianGrid:{handler:mi,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:mi},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:mi},YAxis:{handler:mi},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((O=x.id)!==null&&O!==void 0?O:ni("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=p0(b.triggeredAfterMouseMove,(_=x.throttleDelay)!==null&&_!==void 0?_:1e3/60),b.state={},b}return mN(g,p),hN(g,[{key:"componentDidMount",value:function(){var O,_;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var O=this.props,_=O.children,b=O.data,w=O.height,S=O.layout,j=ze(_,je);if(j){var A=j.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,E=nf(this.state,b,A,C),T=this.state.tooltipTicks[A].coordinate,M=(this.state.offset.top+w)/2,k=S==="horizontal",I=k?{x:T,y:M}:{y:T,x:M},R=this.state.formattedGraphicalItems.find(function(q){var z=q.item;return z.type.name==="Scatter"});R&&(I=N(N({},I),R.props.points[A].tooltipPosition),E=R.props.points[A].tooltipPayload);var B={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:C,activePayload:E,activeCoordinate:I};this.setState(B),this.renderCursor(j),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(O,_){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==_.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==O.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==O.margin){var b,w;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(O){Zc([ze(O.children,je)],[ze(this.props.children,je)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var O=ze(this.props.children,je);if(O&&typeof O.props.shared=="boolean"){var _=O.props.shared?"axis":"item";return s.indexOf(_)>=0?_:a}return a}},{key:"getMouseInfo",value:function(O){if(!this.container)return null;var _=this.container,b=_.getBoundingClientRect(),w=oP(b),S={chartX:Math.round(O.pageX-w.left),chartY:Math.round(O.pageY-w.top)},j=b.width/_.offsetWidth||1,A=this.inRange(S.chartX,S.chartY,j);if(!A)return null;var C=this.state,E=C.xAxisMap,T=C.yAxisMap,M=this.getTooltipEventType(),k=Cg(this.state,this.props.data,this.props.layout,A);if(M!=="axis"&&E&&T){var I=kt(E).scale,R=kt(T).scale,B=I&&I.invert?I.invert(S.chartX):null,q=R&&R.invert?R.invert(S.chartY):null;return N(N({},S),{},{xValue:B,yValue:q},k)}return k?N(N({},S),k):null}},{key:"inRange",value:function(O,_){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,S=O/b,j=_/b;if(w==="horizontal"||w==="vertical"){var A=this.state.offset,C=S>=A.left&&S<=A.left+A.width&&j>=A.top&&j<=A.top+A.height;return C?{x:S,y:j}:null}var E=this.state,T=E.angleAxisMap,M=E.radiusAxisMap;if(T&&M){var k=kt(T);return Jy({x:S,y:j},k)}return null}},{key:"parseEventsOfWrapper",value:function(){var O=this.props.children,_=this.getTooltipEventType(),b=ze(O,je),w={};b&&_==="axis"&&(b.props.trigger==="click"?w={onClick:this.handleClick}:w={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var S=Ti(this.props,this.handleOuterEvent);return N(N({},S),w)}},{key:"addListener",value:function(){zc.on(Fc,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){zc.removeListener(Fc,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(O,_,b){for(var w=this.state.formattedGraphicalItems,S=0,j=w.length;S<j;S++){var A=w[S];if(A.item===O||A.props.key===O.key||_===xt(A.item.type)&&b===A.childIndex)return A}return null}},{key:"renderClipPath",value:function(){var O=this.clipPathId,_=this.state.offset,b=_.left,w=_.top,S=_.height,j=_.width;return P.createElement("defs",null,P.createElement("clipPath",{id:O},P.createElement("rect",{x:b,y:w,height:S,width:j})))}},{key:"getXScales",value:function(){var O=this.state.xAxisMap;return O?Object.entries(O).reduce(function(_,b){var w=Tg(b,2),S=w[0],j=w[1];return N(N({},_),{},H({},S,j.scale))},{}):null}},{key:"getYScales",value:function(){var O=this.state.yAxisMap;return O?Object.entries(O).reduce(function(_,b){var w=Tg(b,2),S=w[0],j=w[1];return N(N({},_),{},H({},S,j.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(O){var _;return(_=this.state.xAxisMap)===null||_===void 0||(_=_[O])===null||_===void 0?void 0:_.scale}},{key:"getYScaleByAxisId",value:function(O){var _;return(_=this.state.yAxisMap)===null||_===void 0||(_=_[O])===null||_===void 0?void 0:_.scale}},{key:"getItemByXY",value:function(O){var _=this.state,b=_.formattedGraphicalItems,w=_.activeItem;if(b&&b.length)for(var S=0,j=b.length;S<j;S++){var A=b[S],C=A.props,E=A.item,T=E.type.defaultProps!==void 0?N(N({},E.type.defaultProps),E.props):E.props,M=xt(E.type);if(M==="Bar"){var k=(C.data||[]).find(function(q){return YC(O,q)});if(k)return{graphicalItem:A,payload:k}}else if(M==="RadialBar"){var I=(C.data||[]).find(function(q){return Jy(O,q)});if(I)return{graphicalItem:A,payload:I}}else if(Da(A,w)||Ba(A,w)||Gn(A,w)){var R=q2({graphicalItem:A,activeTooltipItem:w,itemData:T.data}),B=T.activeIndex===void 0?R:T.activeIndex;return{graphicalItem:N(N({},A),{},{childIndex:B}),payload:Gn(A,w)?T.data[R]:A.props.data[R]}}}return null}},{key:"render",value:function(){var O=this;if(!Hh(this))return null;var _=this.props,b=_.children,w=_.className,S=_.width,j=_.height,A=_.style,C=_.compact,E=_.title,T=_.desc,M=Eg(_,oN),k=J(M,!1);if(C)return P.createElement(lg,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},P.createElement(Qc,xr({},k,{width:S,height:j,title:E,desc:T}),this.renderClipPath(),Vh(b,this.renderMap)));if(this.props.accessibilityLayer){var I,R;k.tabIndex=(I=this.props.tabIndex)!==null&&I!==void 0?I:0,k.role=(R=this.props.role)!==null&&R!==void 0?R:"application",k.onKeyDown=function(q){O.accessibilityManager.keyboardEvent(q)},k.onFocus=function(){O.accessibilityManager.focus()}}var B=this.parseEventsOfWrapper();return P.createElement(lg,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},P.createElement("div",xr({className:te("recharts-wrapper",w),style:N({position:"relative",cursor:"default",width:S,height:j},A)},B,{ref:function(z){O.container=z}}),P.createElement(Qc,xr({},k,{width:S,height:j,title:E,desc:T,style:ON}),this.renderClipPath(),Vh(b,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})($.Component);H(m,"displayName",r),H(m,"defaultProps",N({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},l)),H(m,"getDerivedStateFromProps",function(p,g){var x=p.dataKey,O=p.data,_=p.children,b=p.width,w=p.height,S=p.layout,j=p.stackOffset,A=p.margin,C=g.dataStartIndex,E=g.dataEndIndex;if(g.updateId===void 0){var T=Ig(p);return N(N(N({},T),{},{updateId:0},v(N(N({props:p},T),{},{updateId:0}),g)),{},{prevDataKey:x,prevData:O,prevWidth:b,prevHeight:w,prevLayout:S,prevStackOffset:j,prevMargin:A,prevChildren:_})}if(x!==g.prevDataKey||O!==g.prevData||b!==g.prevWidth||w!==g.prevHeight||S!==g.prevLayout||j!==g.prevStackOffset||!wr(A,g.prevMargin)){var M=Ig(p),k={chartX:g.chartX,chartY:g.chartY,isTooltipActive:g.isTooltipActive},I=N(N({},Cg(g,O,S)),{},{updateId:g.updateId+1}),R=N(N(N({},M),k),I);return N(N(N({},R),v(N({props:p},R),g)),{},{prevDataKey:x,prevData:O,prevWidth:b,prevHeight:w,prevLayout:S,prevStackOffset:j,prevMargin:A,prevChildren:_})}if(!Zc(_,g.prevChildren)){var B,q,z,G,K=ze(_,$r),W=K&&(B=(q=K.props)===null||q===void 0?void 0:q.startIndex)!==null&&B!==void 0?B:C,V=K&&(z=(G=K.props)===null||G===void 0?void 0:G.endIndex)!==null&&z!==void 0?z:E,ue=W!==C||V!==E,ve=!Q(O),Le=ve&&!ue?g.updateId:g.updateId+1;return N(N({updateId:Le},v(N(N({props:p},g),{},{updateId:Le,dataStartIndex:W,dataEndIndex:V}),g)),{},{prevChildren:_,dataStartIndex:W,dataEndIndex:V})}return null}),H(m,"renderActiveDot",function(p,g,x){var O;return $.isValidElement(p)?O=$.cloneElement(p,g):Y(p)?O=p(g):O=P.createElement(Zf,g),P.createElement(de,{className:"recharts-active-dot",key:x},O)});var y=$.forwardRef(function(g,x){return P.createElement(m,xr({},g,{ref:x}))});return y.displayName=m.displayName,y},$g=Gx({chartName:"BarChart",GraphicalChild:Lt,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Ge},{axisType:"yAxis",AxisComp:De}],formatAxisMap:ux}),tr=Gx({chartName:"AreaChart",GraphicalChild:Ae,axisComponents:[{axisType:"xAxis",AxisComp:Ge},{axisType:"yAxis",AxisComp:De}],formatAxisMap:ux});const nr={prepare:"#3b82f6","prepare:ensureContextGraph":"#60a5fa","prepare:partition":"#2563eb","prepare:manifest":"#93c5fd","prepare:validate":"#1d4ed8","prepare:merkle":"#7dd3fc",store:"#8b5cf6",chain:"#f59e0b","chain:sign":"#fbbf24","chain:submit":"#d97706","chain:writeahead":"#ea580c","chain:metadata":"#f97316",broadcast:"#22c55e",decode:"#14b8a6",validate:"#2dd4bf","read-shared-memory":"#06b6d4",parse:"#3b82f6",execute:"#8b5cf6",transfer:"#60a5fa",verify:"#22c55e"},ir="#a78bfa",kN=[{phase:"prepare",label:"Prepare"},{phase:"store",label:"Store"},{phase:"chain",label:"Chain"},{phase:"chain:writeahead",label:"Write-ahead"},{phase:"broadcast",label:"Broadcast"},{phase:"parse",label:"Parse"},{phase:"execute",label:"Execute"},{phase:"transfer",label:"Transfer"},{phase:"verify",label:"Verify"},{phase:"decode",label:"Decode"},{phase:"validate",label:"Validate"}],$N=kN.map(({phase:e,label:t})=>({phase:e,label:t,color:nr[e]??ir})),Jn={prepare:"Partitioning triples, computing Merkle hashes, validating & signing.",store:"Inserting triples into the local triple store and data graph.",chain:"Submitting on-chain tx and waiting for confirmation.","chain:writeahead":'Publish/update tx about to hit the wire — recovery window for "broadcast without receipt" crashes.',broadcast:"Broadcasting to network peers via GossipSub.",parse:"Validating and parsing the SPARQL query syntax.",execute:"Running the SPARQL query against the local triple store.",transfer:"Fetching triple pages from the remote peer.",verify:"Verifying Merkle proofs and inserting synced triples."},rt={publish:"#22c55e",publishFromSWM:"#16a34a",update:"#14b8a6","ka-update":"#0d9488",query:"#8b5cf6",resolve:"#a78bfa",workspace:"#f59e0b",connect:"#06b6d4",sync:"#ec4899",share:"#f472b6",gossip:"#f97316",reconstruct:"#fb923c",verify:"#84cc16",init:"#94a3b8",system:"#6b7280"},Ng={publish:"Publish a Knowledge Asset on-chain to a context graph",publishFromSWM:"Publish a Knowledge Asset derived from Shared Working Memory",update:"Update an existing Knowledge Asset on-chain","ka-update":"Incremental Knowledge Asset update (ka-update path)",query:"Run a SPARQL query against the knowledge graph",resolve:"Resolve a Knowledge Asset from the network",workspace:"Manage shared memory for staging changes",connect:"Establish a connection with a network peer",sync:"Synchronize knowledge data with remote peers",share:"Share a SWM delta with subscribed peers",gossip:"Propagate updates across the peer-to-peer network via GossipSub",reconstruct:"Reconstruct a Knowledge Asset from distributed shares",verify:"Verify Merkle proofs and assert data integrity",init:"Node or component initialisation sequence",system:"Internal system maintenance operation"},Rt={background:"var(--surface)",border:"1px solid var(--border)",borderRadius:6,fontSize:12,color:"var(--text)"},af=[{value:"5m",label:"5 min",ms:5*6e4},{value:"15m",label:"15 min",ms:15*6e4},{value:"30m",label:"30 min",ms:30*6e4},{value:"1h",label:"1 hour",ms:60*6e4},{value:"3h",label:"3 hours",ms:180*6e4},{value:"6h",label:"6 hours",ms:360*6e4},{value:"12h",label:"12 hours",ms:720*6e4},{value:"24h",label:"24 hours",ms:1440*6e4},{value:"7d",label:"7 days",ms:7*864e5},{value:"30d",label:"30 days",ms:30*864e5}],Rg={m:6e4,h:36e5,d:864e5,w:6048e5};function Ga(e){const t=af.find(n=>n.value===e);if(t)return t.ms;const r=e.match(/^(\d+)\s*([mhdw])$/i);if(r){const n=parseInt(r[1],10),i=r[2].toLowerCase();if(n>0&&Rg[i])return n*Rg[i]}return 864e5}function Ha({value:e,onChange:t}){const r=!af.some(u=>u.value===e),[n,i]=$.useState(""),[a,o]=$.useState(r),s=()=>{const u=n.trim();u&&/^\d+\s*[mhdw]$/i.test(u)&&(t(u.replace(/\s+/g,"")),o(!1))};return h.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[h.jsxs("select",{className:"input",value:r?"__custom__":e,onChange:u=>{if(u.target.value==="__custom__"){o(!0);return}o(!1),t(u.target.value)},children:[af.map(u=>h.jsx("option",{value:u.value,children:u.label},u.value)),h.jsx("option",{value:"__custom__",children:"Custom..."})]}),(a||r)&&h.jsx("input",{className:"input mono",placeholder:"e.g. 2d, 45m, 3h",value:n||(r?e:""),onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&s(),onBlur:s,style:{width:90},autoFocus:!0}),r&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:e})]})}function NN(){const[e,t]=$.useState("operations");return h.jsxs("div",{children:[h.jsxs("div",{className:"tab-group",style:{marginBottom:16},children:[h.jsx("button",{className:`tab-item ${e==="operations"?"active":""}`,onClick:()=>t("operations"),children:"All Operations"}),h.jsx("button",{className:`tab-item ${e==="replication"?"active":""}`,onClick:()=>t("replication"),children:"Replication"}),h.jsx("button",{className:`tab-item ${e==="hardware"?"active":""}`,onClick:()=>t("hardware"),children:"Hardware"}),h.jsx("button",{className:`tab-item ${e==="logs"?"active":""}`,onClick:()=>t("logs"),children:"Logs"}),h.jsx("button",{className:`tab-item ${e==="errors"?"active":""}`,onClick:()=>t("errors"),children:"Errors"})]}),e==="operations"?h.jsx(qN,{}):e==="replication"?h.jsx(RN,{}):e==="hardware"?h.jsx(FN,{}):e==="errors"?h.jsx(DN,{}):h.jsx(KN,{})]})}function Dg(e){return e==null?"—":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function RN(){const[e,t]=$.useState("24h"),[r,n]=$.useState(null),i=Ga(e),{data:a}=Re(()=>e1(i),[i],5e3),{data:o}=Re(()=>Yx(i),[i],5e3),{data:s}=Re(()=>Zx(),[],5e3),{data:u}=Re(()=>Jx({periodMs:i,bucketMs:Math.max(6e4,Math.floor(i/48)),cg:r??void 0}),[i,r],5e3),{data:c}=Re(()=>r?Qx(r,100):Promise.resolve(null),[r],5e3),f=(o==null?void 0:o.rows)??[],l=(s==null?void 0:s.cursors)??[],d=((u==null?void 0:u.buckets)??[]).map(y=>({...y,t:vt(y.bucket)})),v=(c==null?void 0:c.events)??[],m=(a==null?void 0:a.successRate)!=null?`${(a.successRate*100).toFixed(0)}%`:"—";return h.jsxs("div",{children:[h.jsxs("div",{className:"filters",style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginBottom:16},children:[h.jsx(Ha,{value:e,onChange:t}),h.jsx("span",{style:{fontSize:12,color:"var(--text-muted)"},children:"Chain-anchored publishes reconciled into Verifiable Memory. Auto-refreshes every 5s."})]}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(160px, 1fr))",gap:12,marginBottom:16},children:[h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",children:"Promotions"}),h.jsx("div",{style:{fontSize:28,fontWeight:600},children:(a==null?void 0:a.promotes)??"—"}),h.jsx("div",{style:{fontSize:12,color:"var(--text-muted)"},children:"landed in VM this period"})]}),h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",children:"Success rate"}),h.jsx("div",{style:{fontSize:28,fontWeight:600},children:m}),h.jsx("div",{style:{fontSize:12,color:"var(--text-muted)"},children:"promote / (promote + defer)"})]}),h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",children:"Promotion latency"}),h.jsx("div",{style:{fontSize:28,fontWeight:600},children:Dg(a==null?void 0:a.latencyP50Ms)}),h.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:["P50 · P95 ",Dg(a==null?void 0:a.latencyP95Ms)]})]}),h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",children:"Active fetches"}),h.jsx("div",{style:{fontSize:28,fontWeight:600},children:(a==null?void 0:a.fetches)??"—"}),h.jsx("div",{style:{fontSize:12,color:"var(--text-muted)"},children:"core-first catch-up pulls"})]})]}),h.jsxs("div",{className:"card",style:{padding:16,marginBottom:16},children:[h.jsxs("div",{className:"card-title",style:{marginBottom:8},children:["Reconciliation timeline",r?` — ${r}`:" — all CGs"]}),d.length===0?h.jsxs("div",{className:"empty-state empty-state--compact",children:[h.jsx("div",{className:"empty-state-title",children:"No reconciliation activity"}),h.jsx("div",{className:"empty-state-desc",children:"No chain-driven VM promotions recorded in this period."})]}):h.jsx(gt,{width:"100%",height:220,children:h.jsxs(tr,{data:d,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"var(--border)"}),h.jsx(Ge,{dataKey:"t",tick:{fontSize:11}}),h.jsx(De,{allowDecimals:!1,tick:{fontSize:11}}),h.jsx(je,{}),h.jsx(Ue,{}),h.jsx(Ae,{type:"monotone",dataKey:"promotes",stackId:"1",stroke:"#22c55e",fill:"#22c55e",fillOpacity:.5,name:"promotes"}),h.jsx(Ae,{type:"monotone",dataKey:"fetches",stackId:"1",stroke:"#3b82f6",fill:"#3b82f6",fillOpacity:.4,name:"fetches"}),h.jsx(Ae,{type:"monotone",dataKey:"defers",stackId:"1",stroke:"#f59e0b",fill:"#f59e0b",fillOpacity:.4,name:"defers"})]})})]}),h.jsxs("div",{className:"card",style:{padding:16,marginBottom:16},children:[h.jsx("div",{className:"card-title",style:{marginBottom:8},children:"Cursor inspector"}),h.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:12},children:"Per-CG persisted watermark (contiguous registration ordinal promoted to VM) vs. last observed chain head."}),l.length===0?h.jsx("div",{className:"empty-state empty-state--compact",children:h.jsx("div",{className:"empty-state-title",children:"No subscriptions"})}):h.jsxs("table",{className:"data-table",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Context graph"}),h.jsx("th",{children:"On-chain id"}),h.jsx("th",{children:"Role"}),h.jsx("th",{children:"Watermark"}),h.jsx("th",{children:"Chain head"}),h.jsx("th",{children:"Lag"}),h.jsx("th",{children:"Last event"})]})}),h.jsx("tbody",{children:l.map(y=>{const p=y.last_reconciled_ordinal??0,g=y.last_head??null,x=g!=null?Math.max(0,g-p):null;return h.jsxs("tr",{children:[h.jsx("td",{className:"mono",children:y.context_graph_id}),h.jsx("td",{className:"mono",children:y.on_chain_id??"—"}),h.jsx("td",{children:y.core_hosted?h.jsx("span",{className:"badge badge-info",title:"Core hosts this public CG; fills its own gaps from chain (Phase D)",children:"host"}):h.jsx("span",{className:"badge",children:"member"})}),h.jsx("td",{children:p}),h.jsx("td",{children:g??"—"}),h.jsx("td",{children:x==null?"—":h.jsx("span",{className:`badge ${x===0?"badge-success":"badge-error"}`,children:x})}),h.jsx("td",{children:y.last_event_ts?vt(y.last_event_ts):"—"})]},y.context_graph_id)})})]})]}),h.jsxs("div",{className:"card",style:{padding:16,marginBottom:16},children:[h.jsx("div",{className:"card-title",style:{marginBottom:8},children:"Per-CG activity"}),h.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:12},children:"Click a row to scope the timeline + open its event stream."}),f.length===0?h.jsx("div",{className:"empty-state empty-state--compact",children:h.jsx("div",{className:"empty-state-title",children:"No activity in this period"})}):h.jsxs("table",{className:"data-table",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Context graph"}),h.jsx("th",{children:"Promotes"}),h.jsx("th",{children:"Fetches"}),h.jsx("th",{children:"Defers"}),h.jsx("th",{children:"Cursor moves"}),h.jsx("th",{children:"Watermark"}),h.jsx("th",{children:"Last event"})]})}),h.jsx("tbody",{children:f.map(y=>h.jsxs("tr",{onClick:()=>n(r===y.context_graph_id?null:y.context_graph_id),style:{cursor:"pointer",background:r===y.context_graph_id?"var(--bg-hover, rgba(255,255,255,0.04))":void 0},children:[h.jsx("td",{className:"mono",children:y.context_graph_id}),h.jsx("td",{children:y.promotes}),h.jsx("td",{children:y.fetches}),h.jsx("td",{children:y.defers}),h.jsx("td",{children:y.cursor_advances}),h.jsx("td",{children:y.last_watermark??"—"}),h.jsx("td",{children:y.last_event_ts?vt(y.last_event_ts):"—"})]},y.context_graph_id))})]})]}),r&&h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsxs("div",{className:"card-title",style:{marginBottom:8},children:["Event stream — ",r]}),v.length===0?h.jsx("div",{className:"empty-state empty-state--compact",children:h.jsx("div",{className:"empty-state-title",children:"No events"})}):h.jsxs("table",{className:"data-table",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Time"}),h.jsx("th",{children:"Action"}),h.jsx("th",{children:"Ordinal"}),h.jsx("th",{children:"Cursor"}),h.jsx("th",{children:"UAL"}),h.jsx("th",{children:"Detail"})]})}),h.jsx("tbody",{children:v.map((y,p)=>h.jsxs("tr",{children:[h.jsx("td",{children:vt(y.ts)}),h.jsx("td",{children:h.jsx("span",{className:`badge ${y.action==="promote"?"badge-success":y.action==="defer"?"badge-error":""}`,children:y.action})}),h.jsx("td",{children:y.ordinal??"—"}),h.jsx("td",{className:"mono",children:y.from_watermark!=null&&y.to_watermark!=null?`${y.from_watermark}->${y.to_watermark}`:"—"}),h.jsx("td",{className:"mono",style:{maxWidth:280,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:y.ual??"",children:y.ual??"—"}),h.jsx("td",{className:"mono",children:y.detail??"—"})]},p))})]})]})]})}function eR(){return h.jsxs("div",{className:"page-section",children:[h.jsx("h1",{className:"page-title",style:{marginBottom:4},children:"Observability"}),h.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:20},children:"Track operation performance, phases, and errors"}),h.jsx(NN,{})]})}function DN(){const[e,t]=$.useState("24h"),[r,n]=$.useState(""),[i,a]=$.useState(null),[o,s]=$.useState(null),u=Ga(e),{data:c}=Re(()=>r1(u),[u],15e3),f=(c==null?void 0:c.hotspots)??[],l=i?f.find(m=>`${m.operation_name}-${m.phase}`===i):null,{data:d}=Re(()=>l?n1({phase:l.phase,operationName:l.operation_name,periodMs:u,q:r||void 0}):Promise.resolve(null),[i,u,r],1e4),v=(d==null?void 0:d.operations)??[];return h.jsxs("div",{children:[h.jsxs("div",{className:"filters",style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginBottom:16},children:[h.jsx(Ha,{value:e,onChange:t}),h.jsx("input",{className:"input mono",placeholder:"Search errors, operation IDs...",value:r,onChange:m=>n(m.target.value),style:{flex:1,minWidth:200}})]}),h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",style:{marginBottom:4},children:"Error Hotspots"}),h.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:16,lineHeight:1.5},children:"Click a phase to see all failed operations. Click an operation to expand its logs."}),f.length===0?h.jsxs("div",{className:"empty-state empty-state--compact",children:[h.jsx("div",{className:"empty-state-icon",style:{background:"rgba(74,222,128,.1)",borderColor:"rgba(74,222,128,.25)"},children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),h.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]})}),h.jsx("div",{className:"empty-state-title",style:{color:"var(--green)"},children:"No errors in this period"}),h.jsx("div",{className:"empty-state-desc",children:"All operations completed successfully. Nice work."})]}):h.jsxs("table",{className:"data-table",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Operation"}),h.jsx("th",{children:"Phase"}),h.jsx("th",{children:"Errors"}),h.jsx("th",{children:"Last Error"}),h.jsx("th",{children:"Last Occurred"})]})}),h.jsx("tbody",{children:f.map(m=>{const y=`${m.operation_name}-${m.phase}`;return h.jsxs(P.Fragment,{children:[h.jsxs("tr",{onClick:()=>{a(p=>p===y?null:y),s(null)},style:{cursor:"pointer",background:i===y?"rgba(239,68,68,.08)":void 0},children:[h.jsxs("td",{style:{fontSize:12,color:"var(--text-muted)",padding:"10px 14px"},children:[h.jsx("span",{style:{marginRight:6,fontSize:10},children:i===y?"▼":"▸"}),m.operation_name]}),h.jsx("td",{style:{color:nr[m.phase]??ir,fontWeight:600,padding:"10px 14px"},children:m.phase}),h.jsx("td",{style:{padding:"10px 14px"},children:h.jsx("span",{className:"badge badge-error",children:m.error_count})}),h.jsx("td",{style:{fontSize:12,color:"var(--text-muted)",maxWidth:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"10px 14px"},title:m.last_error??"",children:m.last_error??"—"}),h.jsx("td",{style:{padding:"10px 14px"},children:m.last_occurred?vt(m.last_occurred):"—"})]}),i===y&&h.jsx("tr",{children:h.jsx("td",{colSpan:5,style:{padding:0,background:"rgba(0,0,0,.15)"},children:h.jsx(BN,{operations:v,expandedOp:o,onToggleOp:p=>s(g=>g===p?null:p)})})})]},y)})})]})]})]})}function BN({operations:e,expandedOp:t,onToggleOp:r}){return e.length===0?h.jsx("div",{style:{padding:"12px 16px",fontSize:11,color:"var(--text-muted)"},children:"No matching failed operations"}):h.jsx("div",{style:{padding:"8px 0"},children:e.map(n=>h.jsxs("div",{style:{borderBottom:"1px solid var(--border)"},children:[h.jsxs("div",{onClick:()=>r(n.operation_id),style:{display:"flex",alignItems:"center",gap:10,padding:"10px 20px",cursor:"pointer",background:t===n.operation_id?"rgba(239,68,68,.05)":void 0},children:[h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:t===n.operation_id?"▼":"▸"}),h.jsx("span",{style:{fontWeight:600,fontSize:12,color:rt[n.operation_name]??"var(--text-muted)"},children:n.operation_name}),h.jsx(pa,{status:n.status}),h.jsxs("span",{className:"mono",style:{fontSize:10,color:"var(--text-dim)"},children:[n.operation_id," ",h.jsx(sd,{text:n.operation_id})]}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",marginLeft:"auto"},children:vt(n.phase_started_at)}),n.duration_ms!=null&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:lt(n.duration_ms)})]}),t===n.operation_id&&h.jsxs("div",{style:{padding:"4px 20px 16px"},children:[n.phase_error&&h.jsx("div",{style:{padding:"6px 10px",marginBottom:8,background:"rgba(239,68,68,.1)",borderRadius:6,border:"1px solid rgba(239,68,68,.2)",fontSize:11,color:"var(--red)"},children:n.phase_error}),n.error_message&&n.error_message!==n.phase_error&&h.jsx("div",{style:{padding:"6px 10px",marginBottom:8,background:"rgba(239,68,68,.06)",borderRadius:6,border:"1px solid rgba(239,68,68,.15)",fontSize:11,color:"var(--red)"},children:n.error_message}),n.logs&&n.logs.length>0?h.jsx(Xx,{maxHeight:200,children:n.logs.map(i=>h.jsx(Vx,{ts:i.ts,level:i.level,module:i.module,message:i.message},i.id))}):h.jsx("div",{style:{fontSize:11,color:"var(--text-dim)",padding:"4px 0"},children:"No logs for this operation"})]})]},`${n.operation_id}-${n.phase_started_at}`))})}const LN=[{value:"0",label:"Auto"},{value:String(5*6e4),label:"5 min"},{value:String(15*6e4),label:"15 min"},{value:String(30*6e4),label:"30 min"},{value:String(36e5),label:"1 hour"},{value:String(6*36e5),label:"6 hours"},{value:String(864e5),label:"1 day"}];function qN(){return h.jsxs("div",{children:[h.jsx(zN,{}),h.jsx(UN,{})]})}function zN(){const[e,t]=$.useState("3h"),[r,n]=$.useState("0"),[i,a]=$.useState(new Set),o=Ga(e),s=r==="0"?void 0:parseInt(r,10),{data:u}=Re(()=>a1(o),[o],15e3),{data:c}=Re(()=>o1(o,s),[o,s],15e3),f=(u==null?void 0:u.rates)??[],l=$.useMemo(()=>o<=36e5?{hour:"2-digit",minute:"2-digit"}:o<=864e5?{hour:"2-digit",minute:"2-digit"}:{month:"short",day:"numeric",hour:"2-digit"},[o]),d=$.useMemo(()=>{var g;return(g=c==null?void 0:c.buckets)!=null&&g.length?c.buckets.map((x,O)=>{var b;const _={time:new Date(x).toLocaleString(void 0,l)};for(const w of c.types){const S=(b=c.series[w])==null?void 0:b[O];_[`${w}_count`]=(S==null?void 0:S.count)??0,_[`${w}_avgMs`]=S!=null&&S.avgMs?+(S.avgMs/1e3).toFixed(2):0,_[`${w}_successPct`]=S?Math.round(S.successRate*100):0,_[`${w}_gas`]=(S==null?void 0:S.gasCostEth)??0}return _}):[]},[c]),v=(c==null?void 0:c.types)??[],m=d.length>1,y=$.useCallback(g=>{const x=g.value??g.dataKey;x&&a(O=>{const _=new Set(O);return _.has(x)?_.delete(x):_.add(x),_})},[]),p=$.useCallback(g=>{const x=i.has(g);return h.jsx("span",{style:{color:x?"var(--text-dim)":void 0,textDecoration:x?"line-through":void 0,cursor:"pointer"},children:g})},[i]);return h.jsxs("div",{style:{marginBottom:16},children:[h.jsxs("div",{className:"filters",style:{display:"flex",gap:8,alignItems:"center",marginBottom:16,flexWrap:"wrap"},children:[h.jsx(Ha,{value:e,onChange:t}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",fontWeight:600,textTransform:"uppercase",letterSpacing:".04em"},children:"per"}),h.jsx("select",{className:"input",value:r,onChange:g=>n(g.target.value),style:{width:"auto"},children:LN.map(g=>h.jsx("option",{value:g.value,children:g.label},g.value))})]})]}),h.jsxs(h.Fragment,{children:[f.length>0&&h.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:10,marginBottom:16},children:f.map(g=>{const x=rt[g.type]??"var(--text-muted)",O=g.rate>=.9?"var(--green-mid)":g.rate>=.7?"var(--amber)":"var(--red)";return h.jsxs("div",{style:{background:"rgba(255,255,255,.03)",borderRadius:8,padding:"12px 14px",border:"1px solid var(--border)",borderLeft:`3px solid ${x}`},children:[h.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:h.jsx("span",{style:{fontSize:13,fontWeight:700,color:x},children:g.type})}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"6px 12px",fontSize:11},children:[h.jsxs("div",{children:[h.jsx("div",{style:{color:"var(--text-dim)",fontSize:9,textTransform:"uppercase",letterSpacing:".04em",marginBottom:2},children:"Operations"}),h.jsx("div",{style:{fontWeight:700,fontSize:16},children:g.total})]}),h.jsxs("div",{children:[h.jsx("div",{style:{color:"var(--text-dim)",fontSize:9,textTransform:"uppercase",letterSpacing:".04em",marginBottom:2},children:"Success"}),h.jsxs("div",{style:{fontWeight:700,fontSize:16,color:O},children:[(g.rate*100).toFixed(0),"%"]})]}),h.jsxs("div",{children:[h.jsx("div",{style:{color:"var(--text-dim)",fontSize:9,textTransform:"uppercase",letterSpacing:".04em",marginBottom:2},children:"Avg Duration"}),h.jsx("div",{style:{fontWeight:600,fontSize:13},children:lt(g.avgMs)})]}),h.jsxs("div",{children:[h.jsx("div",{style:{color:"var(--text-dim)",fontSize:9,textTransform:"uppercase",letterSpacing:".04em",marginBottom:2},children:"Errors"}),h.jsx("div",{style:{fontWeight:600,fontSize:13,color:g.error>0?"var(--red)":"var(--text-dim)"},children:g.error})]})]}),h.jsx("div",{style:{height:3,background:"rgba(255,255,255,.06)",borderRadius:2,overflow:"hidden",marginTop:10},children:h.jsx("div",{style:{height:"100%",width:`${g.rate*100}%`,background:O,borderRadius:2}})})]},g.type)})}),m?h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,marginBottom:14},children:[h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Operations Over Time"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs($g,{data:d,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{tick:{fontSize:9,fill:"#9ca3af"},width:28}),h.jsx(je,{contentStyle:Rt,cursor:{fill:"rgba(255,255,255,.06)"}}),h.jsx(Ue,{wrapperStyle:{fontSize:9},onClick:y,formatter:p}),v.map(g=>h.jsx(Lt,{dataKey:`${g}_count`,name:g,stackId:"ops",fill:rt[g]??"#6b7280",fillOpacity:.6,hide:i.has(g)},g))]})})]}),h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Avg Duration by Operation Type (s)"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs(tr,{data:d,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{tick:{fontSize:9,fill:"#9ca3af"},width:32}),h.jsx(je,{contentStyle:Rt}),h.jsx(Ue,{wrapperStyle:{fontSize:9},onClick:y,formatter:p}),v.map(g=>h.jsx(Ae,{type:"monotone",dataKey:`${g}_avgMs`,name:g,stroke:rt[g]??"#6b7280",fill:rt[g]??"#6b7280",fillOpacity:.1,strokeWidth:2,dot:!1,hide:i.has(g)},g))]})})]}),h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Success Rate by Operation Type (%)"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs(tr,{data:d,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{domain:[0,100],tick:{fontSize:9,fill:"#9ca3af"},width:28}),h.jsx(je,{contentStyle:Rt}),h.jsx(Ue,{wrapperStyle:{fontSize:9},onClick:y,formatter:p}),v.map(g=>h.jsx(Ae,{type:"monotone",dataKey:`${g}_successPct`,name:g,stroke:rt[g]??"#6b7280",fill:rt[g]??"#6b7280",fillOpacity:.1,strokeWidth:2,dot:!1,hide:i.has(g)},g))]})})]}),h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Gas Cost by Operation Type (ETH)"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs($g,{data:d,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{tick:{fontSize:9,fill:"#9ca3af"},width:32}),h.jsx(je,{contentStyle:Rt,cursor:{fill:"rgba(255,255,255,.06)"}}),h.jsx(Ue,{wrapperStyle:{fontSize:9},onClick:y,formatter:p}),v.map(g=>h.jsx(Lt,{dataKey:`${g}_gas`,name:g,stackId:"gas",fill:rt[g]??"#6b7280",fillOpacity:.6,hide:i.has(g)},g))]})})]})]}):h.jsx("div",{className:"card",style:{marginBottom:14},children:h.jsxs("div",{className:"empty-state empty-state--compact",children:[h.jsx("div",{className:"empty-state-icon",children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"10"}),h.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),h.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"14"})]})}),h.jsx("div",{className:"empty-state-title",children:"Not enough data for charts"}),h.jsx("div",{className:"empty-state-desc",children:"Charts will render once enough operations have been processed."})]})})]})]})}function FN(){const[e,t]=$.useState("3h"),r=Ga(e),n=$.useMemo(()=>r<=864e5?{hour:"2-digit",minute:"2-digit"}:{month:"short",day:"numeric",hour:"2-digit"},[r]),{data:i}=Re(()=>t1(Date.now()-r,Date.now(),200),[r],1e4),a=$.useMemo(()=>((i==null?void 0:i.snapshots)??[]).map(c=>({time:new Date(c.ts).toLocaleString(void 0,n),cpu:c.cpu_percent??0,memGB:c.mem_used_bytes?+(c.mem_used_bytes/1024**3).toFixed(2):0,heapMB:c.heap_used_bytes?+(c.heap_used_bytes/1024**2).toFixed(1):0,diskPct:c.disk_total_bytes?Math.round(c.disk_used_bytes/c.disk_total_bytes*100):0,peers:c.peer_count??0,rpcMs:c.rpc_latency_ms??0})),[i,n]),o=$.useMemo(()=>{const c=(i==null?void 0:i.snapshots)??[];if(!c.length)return null;const f=c[c.length-1];return{cpu:f.cpu_percent??0,memUsedGB:f.mem_used_bytes?+(f.mem_used_bytes/1024**3).toFixed(1):0,memTotalGB:f.mem_total_bytes?+(f.mem_total_bytes/1024**3).toFixed(1):0,memPct:f.mem_total_bytes?Math.round(f.mem_used_bytes/f.mem_total_bytes*100):0,heapMB:f.heap_used_bytes?+(f.heap_used_bytes/1024**2).toFixed(0):0,diskUsedGB:f.disk_used_bytes?+(f.disk_used_bytes/1024**3).toFixed(1):null,diskTotalGB:f.disk_total_bytes?+(f.disk_total_bytes/1024**3).toFixed(1):null,diskPct:f.disk_total_bytes?Math.round(f.disk_used_bytes/f.disk_total_bytes*100):null,peers:f.peer_count??0,rpcMs:f.rpc_latency_ms??null}},[i]),s=!o,u=[{label:"CPU",value:o?`${o.cpu.toFixed(1)}%`:"—",sub:o?"utilisation":"waiting…",pct:o?o.cpu:null,color:o?o.cpu>80?"#ef4444":o.cpu>60?"#f59e0b":"#3b82f6":"#374151"},{label:"RAM",value:o?`${o.memUsedGB} / ${o.memTotalGB} GB`:"—",sub:o?`${o.memPct}% used`:"waiting…",pct:o?o.memPct:null,color:o?o.memPct>85?"#ef4444":o.memPct>70?"#f59e0b":"#8b5cf6":"#374151"},{label:"Heap",value:o?`${o.heapMB} MB`:"—",sub:o?"Node.js heap":"waiting…",pct:null,color:o?"#06b6d4":"#374151"},{label:"Disk",value:o?o.diskPct!==null?`${o.diskUsedGB} / ${o.diskTotalGB} GB`:"n/a":"—",sub:o?o.diskPct!==null?`${o.diskPct}% used`:"not configured":"waiting…",pct:o?o.diskPct:null,color:o?o.diskPct!==null?o.diskPct>85?"#ef4444":"#f59e0b":"#6b7280":"#374151"}];return h.jsxs("div",{children:[h.jsx("div",{className:"filters",style:{marginBottom:16},children:h.jsx(Ha,{value:e,onChange:t})}),h.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:8,marginBottom:12},children:u.map(c=>h.jsxs("div",{className:"card",style:{padding:"10px 12px",opacity:s?.5:1,transition:"opacity .3s"},children:[h.jsx("div",{style:{fontSize:10,fontWeight:700,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:".06em",marginBottom:4},children:c.label}),h.jsx("div",{style:{fontSize:18,fontWeight:700,color:c.color,lineHeight:1,marginBottom:3},children:c.value}),c.pct!==null?h.jsx("div",{style:{height:3,background:"rgba(255,255,255,.06)",borderRadius:2,margin:"5px 0 3px"},children:h.jsx("div",{style:{height:3,width:`${Math.min(c.pct,100)}%`,background:c.color,borderRadius:2,transition:"width .4s ease"}})}):h.jsx("div",{style:{height:3,margin:"5px 0 3px"}}),h.jsx("div",{style:{fontSize:10,color:"var(--text-dim)"},children:c.sub})]},c.label))}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:8,marginBottom:12},children:[h.jsxs("div",{className:"card",style:{padding:"10px 12px",opacity:s?.5:1,transition:"opacity .3s"},children:[h.jsx("div",{style:{fontSize:10,fontWeight:700,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:".06em",marginBottom:4},children:"Peers"}),h.jsx("div",{style:{fontSize:18,fontWeight:700,color:o?"#22c55e":"#374151",lineHeight:1},children:o?o.peers:"—"}),h.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginTop:3},children:o?"connected":"waiting…"})]}),h.jsxs("div",{className:"card",style:{padding:"10px 12px",opacity:s?.5:1,transition:"opacity .3s"},children:[h.jsx("div",{style:{fontSize:10,fontWeight:700,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:".06em",marginBottom:4},children:"RPC Latency"}),h.jsx("div",{style:{fontSize:18,fontWeight:700,color:o?o.rpcMs!==null&&o.rpcMs>500?"#ef4444":"#22c55e":"#374151",lineHeight:1},children:o&&o.rpcMs!==null?`${o.rpcMs} ms`:"—"}),h.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginTop:3},children:o?"last measurement":"waiting…"})]})]}),a.length>1?h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"CPU Usage (%)"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs(tr,{data:a,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{domain:[0,100],tick:{fontSize:9,fill:"#9ca3af"},width:28}),h.jsx(je,{contentStyle:Rt}),h.jsx(Ae,{type:"monotone",dataKey:"cpu",stroke:"#3b82f6",fill:"#3b82f6",fillOpacity:.12,strokeWidth:1.5,dot:!1,name:"CPU %"})]})})]}),h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Memory & Heap"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs(tr,{data:a,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{tick:{fontSize:9,fill:"#9ca3af"},width:32}),h.jsx(je,{contentStyle:Rt}),h.jsx(Ue,{wrapperStyle:{fontSize:9}}),h.jsx(Ae,{type:"monotone",dataKey:"memGB",stroke:"#8b5cf6",fill:"#8b5cf6",fillOpacity:.1,strokeWidth:1.5,dot:!1,name:"Sys RAM (GB)"}),h.jsx(Ae,{type:"monotone",dataKey:"heapMB",stroke:"#06b6d4",fill:"#06b6d4",fillOpacity:.1,strokeWidth:1.5,dot:!1,name:"Heap (MB)"})]})})]}),h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Disk Usage (%)"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs(tr,{data:a,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{domain:[0,100],tick:{fontSize:9,fill:"#9ca3af"},width:28}),h.jsx(je,{contentStyle:Rt}),h.jsx(Ae,{type:"monotone",dataKey:"diskPct",stroke:"#f59e0b",fill:"#f59e0b",fillOpacity:.12,strokeWidth:1.5,dot:!1,name:"Disk %"})]})})]}),h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Network & RPC"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs(tr,{data:a,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{tick:{fontSize:9,fill:"#9ca3af"},width:28,yAxisId:"left"}),h.jsx(De,{tick:{fontSize:9,fill:"#9ca3af"},width:28,yAxisId:"right",orientation:"right"}),h.jsx(je,{contentStyle:Rt}),h.jsx(Ue,{wrapperStyle:{fontSize:9}}),h.jsx(Ae,{type:"monotone",dataKey:"peers",stroke:"#22c55e",fill:"#22c55e",fillOpacity:.1,strokeWidth:1.5,dot:!1,name:"Peers",yAxisId:"left"}),h.jsx(Ae,{type:"monotone",dataKey:"rpcMs",stroke:"#ef4444",fill:"#ef4444",fillOpacity:.08,strokeWidth:1.5,dot:!1,name:"RPC (ms)",yAxisId:"right"})]})})]})]}):h.jsx("div",{style:{fontSize:11,color:"var(--text-dim)",textAlign:"center",padding:"8px 0"},children:"History charts appear after a second snapshot (~30 s)"})]})}function WN({phases:e,totalMs:t}){const[r,n]=$.useState(null);if(!(e!=null&&e.length))return h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",fontStyle:"italic"},children:"event-based"});if(t<=0)return h.jsx("span",{style:{color:"var(--text-dim)"},children:"—"});const i=e.reduce((a,o)=>a+(o.duration_ms??0),0)||t;return h.jsxs("div",{style:{position:"relative",minWidth:120,maxWidth:260},children:[h.jsx("div",{style:{display:"flex",gap:4,marginBottom:3,flexWrap:"wrap"},children:e.map((a,o)=>{const s=a.status==="error"?"#ef4444":nr[a.phase]??ir;return h.jsxs("span",{style:{fontSize:9,fontWeight:600,color:s,letterSpacing:".02em",display:"inline-flex",alignItems:"center",gap:3},children:[h.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:s,display:"inline-block",flexShrink:0}}),a.phase,h.jsx("span",{style:{fontWeight:400,color:"var(--text-dim)",fontFamily:"'JetBrains Mono', monospace"},children:lt(a.duration_ms)})]},`label-${a.phase}-${o}`)})}),h.jsx("div",{style:{display:"flex",height:10,borderRadius:3,overflow:"hidden",background:"rgba(255,255,255,.04)"},children:e.map((a,o)=>{const s=Math.max((a.duration_ms??0)/i*100,3),u=a.status==="error"?"#ef4444":nr[a.phase]??ir,c=r===o;return h.jsx("div",{onMouseEnter:()=>n(o),onMouseLeave:()=>n(null),style:{width:`${s}%`,background:u,minWidth:3,opacity:c?1:.65,transition:"opacity .15s, width .2s",cursor:"default"}},`${a.phase}-${o}`)})}),r!==null&&e[r]&&(()=>{const a=e[r].phase,o=a.includes(":")?a.split(":")[0]:a,s=Jn[a]??Jn[o];return h.jsxs("div",{style:{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:6,padding:"5px 10px",borderRadius:6,background:"var(--surface)",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,.4)",fontSize:11,zIndex:10,pointerEvents:"none",maxWidth:260},children:[h.jsxs("div",{style:{whiteSpace:"nowrap"},children:[h.jsx("span",{style:{fontWeight:700,color:nr[a]??ir},children:a}),h.jsx("span",{style:{color:"var(--text-muted)",margin:"0 6px"},children:"·"}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",color:"var(--text)"},children:lt(e[r].duration_ms)}),h.jsxs("span",{style:{color:"var(--text-dim)",marginLeft:6},children:["(",Math.round((e[r].duration_ms??0)/t*100),"%)"]}),e[r].status==="error"&&h.jsx("span",{style:{color:"var(--red)",marginLeft:6,fontWeight:600},children:"FAILED"})]}),s&&h.jsx("div",{style:{fontSize:10,color:"var(--text-muted)",marginTop:3,whiteSpace:"normal",lineHeight:1.4},children:s})]})})()]})}const ln=50;function UN(){const[e,t]=$.useState(""),[r,n]=$.useState(""),[i,a]=$.useState(""),[o,s]=$.useState(null),[u,c]=$.useState(0);$.useEffect(()=>{c(0)},[e,r,i]);const f={limit:String(ln),offset:String(u*ln)};e&&(f.name=e),r&&(f.status=r),i.trim()&&(f.operationId=i.trim());const{data:l}=Re(()=>u1(f),[e,r,i,u],5e3),{data:d}=Re(()=>o?c1(o):Promise.resolve(null),[o]),{data:v}=Re(s1,[],3e4),m=v==null?void 0:v.blockExplorerUrl,y=(l==null?void 0:l.operations)??[],p=(l==null?void 0:l.total)??0,g=Math.max(1,Math.ceil(p/ln));return h.jsxs("div",{children:[h.jsxs("div",{className:"filters",style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginBottom:12},children:[h.jsxs("select",{className:"input",value:e,onChange:x=>t(x.target.value),title:"Filter by operation type",children:[h.jsx("option",{value:"",children:"All types"}),Object.entries(Ng).map(([x,O])=>h.jsxs("option",{value:x,title:O,children:[x," — ",O]},x))]}),h.jsxs("select",{className:"input",value:r,onChange:x=>n(x.target.value),children:[h.jsx("option",{value:"",children:"All statuses"}),h.jsx("option",{value:"success",children:"success"}),h.jsx("option",{value:"error",children:"error"}),h.jsx("option",{value:"in_progress",children:"in_progress"})]}),h.jsx("input",{className:"input mono",placeholder:"Filter by Operation ID...",value:i,onChange:x=>a(x.target.value),style:{minWidth:240,flex:1}}),h.jsxs("span",{style:{fontSize:11,color:"var(--text-dim)"},children:[p," total"]})]}),h.jsxs("div",{style:{display:"flex",gap:14,flexWrap:"wrap",marginBottom:10,padding:"6px 12px",borderRadius:6,background:"rgba(255,255,255,.02)",border:"1px solid var(--border)",fontSize:10,color:"var(--text-muted)",alignItems:"center"},children:[h.jsx("span",{style:{fontSize:9,fontWeight:700,letterSpacing:".06em",textTransform:"uppercase",color:"var(--text-dim)",marginRight:2},children:"Phases"}),$N.map(({phase:x,label:O,color:_})=>h.jsxs("span",{title:Jn[x]??"",style:{display:"inline-flex",alignItems:"center",gap:4,cursor:"default"},children:[h.jsx("span",{style:{width:7,height:7,borderRadius:2,background:_,display:"inline-block",flexShrink:0}}),O]},x))]}),h.jsx("div",{className:"card",style:{padding:0,overflow:"hidden"},children:y.length===0?h.jsxs("div",{className:"empty-state empty-state--rich",style:{margin:16},children:[h.jsx("div",{className:"empty-state-icon",children:h.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}),h.jsx("div",{className:"empty-state-title",children:"No operations recorded"}),h.jsx("div",{className:"empty-state-desc",children:"Operations will appear here as your node processes publish, query, and other DKG requests."})]}):h.jsxs("table",{className:"data-table",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Time"}),h.jsx("th",{children:"Type"}),h.jsx("th",{children:"Status"}),h.jsx("th",{children:"Phases"}),h.jsx("th",{children:"Duration"}),h.jsx("th",{children:"Cost (ETH)"}),h.jsx("th",{children:"TX"}),h.jsx("th",{children:"Operation ID"})]})}),h.jsx("tbody",{children:y.map(x=>h.jsxs("tr",{onClick:()=>s(x.operation_id),style:{cursor:"pointer",background:o===x.operation_id?"rgba(59,130,246,.1)":void 0},children:[h.jsx("td",{title:x.started_at?new Date(x.started_at).toLocaleString():void 0,children:vt(x.started_at)}),h.jsx("td",{children:h.jsx("span",{className:"badge",title:Ng[x.operation_name]??"",style:{background:`${rt[x.operation_name]??"var(--text-muted)"}22`,color:rt[x.operation_name]??"var(--text-muted)"},children:x.operation_name})}),h.jsx("td",{children:h.jsx(pa,{status:x.status})}),h.jsx("td",{children:h.jsx(WN,{phases:x.phases,totalMs:x.duration_ms})}),h.jsx("td",{children:lt(x.duration_ms)}),h.jsx("td",{children:x.gas_cost_eth!=null?x.gas_cost_eth.toFixed(6):"—"}),h.jsx("td",{children:x.tx_hash?h.jsx("a",{href:m?`${m}/tx/${x.tx_hash}`:"#",target:"_blank",rel:"noopener noreferrer",onClick:O=>O.stopPropagation(),title:x.tx_hash,className:"tx-link-icon",children:h.jsx(ZN,{})}):"—"}),h.jsxs("td",{className:"mono",children:[gi(x.operation_id)," ",h.jsx(sd,{text:x.operation_id})]})]},x.operation_id))})]})}),g>1&&h.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 0",fontSize:11,color:"var(--text-muted)"},children:[h.jsxs("span",{children:["Showing ",u*ln+1,"–",Math.min((u+1)*ln,p)," of ",p]}),h.jsxs("div",{style:{display:"flex",gap:4},children:[h.jsx("button",{disabled:u===0,onClick:()=>c(0),style:{padding:"4px 8px",borderRadius:4,fontSize:11,fontWeight:600,cursor:u===0?"default":"pointer",border:"1px solid var(--border)",background:"var(--surface)",color:u===0?"var(--text-dim)":"var(--text-muted)",opacity:u===0?.4:1},children:"««"}),h.jsx("button",{disabled:u===0,onClick:()=>c(x=>Math.max(0,x-1)),style:{padding:"4px 10px",borderRadius:4,fontSize:11,fontWeight:600,cursor:u===0?"default":"pointer",border:"1px solid var(--border)",background:"var(--surface)",color:u===0?"var(--text-dim)":"var(--text-muted)",opacity:u===0?.4:1},children:"‹ Prev"}),h.jsxs("span",{style:{padding:"4px 10px",fontSize:11,fontWeight:600},children:["Page ",u+1," / ",g]}),h.jsx("button",{disabled:u>=g-1,onClick:()=>c(x=>Math.min(g-1,x+1)),style:{padding:"4px 10px",borderRadius:4,fontSize:11,fontWeight:600,cursor:u>=g-1?"default":"pointer",border:"1px solid var(--border)",background:"var(--surface)",color:u>=g-1?"var(--text-dim)":"var(--text-muted)",opacity:u>=g-1?.4:1},children:"Next ›"}),h.jsx("button",{disabled:u>=g-1,onClick:()=>c(g-1),style:{padding:"4px 8px",borderRadius:4,fontSize:11,fontWeight:600,cursor:u>=g-1?"default":"pointer",border:"1px solid var(--border)",background:"var(--surface)",color:u>=g-1?"var(--text-dim)":"var(--text-muted)",opacity:u>=g-1?.4:1},children:"»»"})]})]}),o&&h.jsxs(h.Fragment,{children:[h.jsx("div",{onClick:()=>s(null),style:{position:"fixed",inset:0,background:"rgba(0,0,0,.4)",zIndex:900,animation:"fadeIn .15s ease-out"}}),h.jsx("div",{style:{position:"fixed",top:0,right:0,bottom:0,width:"55%",minWidth:480,maxWidth:800,background:"var(--bg)",borderLeft:"1px solid var(--border)",zIndex:901,overflowY:"auto",padding:"20px 24px",boxShadow:"-8px 0 30px rgba(0,0,0,.3)",animation:"slideInRight .2s ease-out"},children:d!=null&&d.operation?h.jsx(HN,{op:d.operation,logs:d.logs,phases:d.phases??[],explorerUrl:m,onBack:()=>s(null)}):h.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"Loading..."})}),h.jsx("style",{children:`
68
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zx(e,t){if(e){if(typeof e=="string")return rf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rf(e,t)}}function bN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xN(e){if(Array.isArray(e))return rf(e)}function rf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Mg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mg(Object(r),!0).forEach(function(n){H(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function H(e,t,r){return t=Fx(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fx(e){var t=wN(e,"string");return Wr(t)=="symbol"?t:t+""}function wN(e,t){if(Wr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _N={xAxis:["bottom","top"],yAxis:["left","right"]},ON={width:"100%",height:"100%"},Wx={x:0,y:0};function mi(e){return e}var SN=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},jN=function(t,r,n,i){var a=r.find(function(f){return f&&f.index===n});if(a){if(t==="horizontal")return{x:a.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:a.coordinate};if(t==="centric"){var o=a.coordinate,s=i.radius;return N(N(N({},i),Ee(i.cx,i.cy,s,o)),{},{angle:o,radius:s})}var u=a.coordinate,c=i.angle;return N(N(N({},i),Ee(i.cx,i.cy,u,c)),{},{angle:c,radius:u})}return Wx},Ua=function(t,r){var n=r.graphicalItems,i=r.dataStartIndex,a=r.dataEndIndex,o=(n??[]).reduce(function(s,u){var c=u.props.data;return c&&c.length?[].concat(Ur(s),Ur(c)):s},[]);return o.length>0?o:t&&t.length&&L(i)&&L(a)?t.slice(i,a+1):[]};function Ux(e){return e==="number"?[0,"auto"]:void 0}var nf=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=Ua(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(u,c){var f,l=(f=c.props.data)!==null&&f!==void 0?f:r;l&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(l=l.slice(t.dataStartIndex,t.dataEndIndex+1));var d;if(o.dataKey&&!o.allowDuplicatedCategory){var v=l===void 0?s:l;d=Pi(v,o.dataKey,i)}else d=l&&l[n]||s[n];return d?[].concat(Ur(u),[F0(c,d)]):u},[])},Cg=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=SN(a,n),s=t.orderedTooltipTicks,u=t.tooltipAxis,c=t.tooltipTicks,f=WT(o,s,c,u);if(f>=0&&c){var l=c[f]&&c[f].value,d=nf(t,r,f,l),v=jN(n,s,f,a);return{activeTooltipIndex:f,activeLabel:l,activePayload:d,activeCoordinate:v}}return null},AN=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,u=r.dataStartIndex,c=r.dataEndIndex,f=t.layout,l=t.children,d=t.stackOffset,v=L0(f,a);return n.reduce(function(m,y){var p,g=y.type.defaultProps!==void 0?N(N({},y.type.defaultProps),y.props):y.props,x=g.type,O=g.dataKey,_=g.allowDataOverflow,b=g.allowDuplicatedCategory,w=g.scale,S=g.ticks,j=g.includeHidden,A=g[o];if(m[A])return m;var C=Ua(t.data,{graphicalItems:i.filter(function(W){var V,ue=o in W.props?W.props[o]:(V=W.type.defaultProps)===null||V===void 0?void 0:V[o];return ue===A}),dataStartIndex:u,dataEndIndex:c}),E=C.length,T,M,k;J$(g.domain,_,x)&&(T=_l(g.domain,null,_),v&&(x==="number"||w!=="auto")&&(k=yn(C,O,"category")));var I=Ux(x);if(!T||T.length===0){var R,B=(R=g.domain)!==null&&R!==void 0?R:I;if(O){if(T=yn(C,O,x),x==="category"&&v){var q=sO(T);b&&q?(M=T,T=ea(0,E)):b||(T=Xy(B,T,y).reduce(function(W,V){return W.indexOf(V)>=0?W:[].concat(Ur(W),[V])},[]))}else if(x==="category")b?T=T.filter(function(W){return W!==""&&!Q(W)}):T=Xy(B,T,y).reduce(function(W,V){return W.indexOf(V)>=0||V===""||Q(V)?W:[].concat(Ur(W),[V])},[]);else if(x==="number"){var z=VT(C,i.filter(function(W){var V,ue,ve=o in W.props?W.props[o]:(V=W.type.defaultProps)===null||V===void 0?void 0:V[o],Le="hide"in W.props?W.props.hide:(ue=W.type.defaultProps)===null||ue===void 0?void 0:ue.hide;return ve===A&&(j||!Le)}),O,a,f);z&&(T=z)}v&&(x==="number"||w!=="auto")&&(k=yn(C,O,"category"))}else v?T=ea(0,E):s&&s[A]&&s[A].hasStack&&x==="number"?T=d==="expand"?[0,1]:z0(s[A].stackGroups,u,c):T=B0(C,i.filter(function(W){var V=o in W.props?W.props[o]:W.type.defaultProps[o],ue="hide"in W.props?W.props.hide:W.type.defaultProps.hide;return V===A&&(j||!ue)}),x,f,!0);if(x==="number")T=ef(l,T,A,a,S),B&&(T=_l(B,T,_));else if(x==="category"&&B){var G=B,K=T.every(function(W){return G.indexOf(W)>=0});K&&(T=G)}}return N(N({},m),{},H({},A,N(N({},g),{},{axisType:a,domain:T,categoricalDomain:k,duplicateDomain:M,originalDomain:(p=g.domain)!==null&&p!==void 0?p:I,isCategorical:v,layout:f})))},{})},PN=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,u=r.dataStartIndex,c=r.dataEndIndex,f=t.layout,l=t.children,d=Ua(t.data,{graphicalItems:n,dataStartIndex:u,dataEndIndex:c}),v=d.length,m=L0(f,a),y=-1;return n.reduce(function(p,g){var x=g.type.defaultProps!==void 0?N(N({},g.type.defaultProps),g.props):g.props,O=x[o],_=Ux("number");if(!p[O]){y++;var b;return m?b=ea(0,v):s&&s[O]&&s[O].hasStack?(b=z0(s[O].stackGroups,u,c),b=ef(l,b,O,a)):(b=_l(_,B0(d,n.filter(function(w){var S,j,A=o in w.props?w.props[o]:(S=w.type.defaultProps)===null||S===void 0?void 0:S[o],C="hide"in w.props?w.props.hide:(j=w.type.defaultProps)===null||j===void 0?void 0:j.hide;return A===O&&!C}),"number",f),i.defaultProps.allowDataOverflow),b=ef(l,b,O,a)),N(N({},p),{},H({},O,N(N({axisType:a},i.defaultProps),{},{hide:!0,orientation:Je(_N,"".concat(a,".").concat(y%2),null),domain:b,originalDomain:_,isCategorical:m,layout:f})))}return p},{})},TN=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,u=r.dataStartIndex,c=r.dataEndIndex,f=t.children,l="".concat(i,"Id"),d=it(f,a),v={};return d&&d.length?v=AN(t,{axes:d,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:s,dataStartIndex:u,dataEndIndex:c}):o&&o.length&&(v=PN(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:s,dataStartIndex:u,dataEndIndex:c})),v},EN=function(t){var r=kt(t),n=bt(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Gf(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Ui(r,n)}},Ig=function(t){var r=t.children,n=t.defaultShowTooltip,i=ze(r,$r),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},MN=function(t){return!t||!t.length?!1:t.some(function(r){var n=xt(r&&r.type);return n&&n.indexOf("Bar")>=0})},kg=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},CN=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,u=s===void 0?{}:s,c=n.width,f=n.height,l=n.children,d=n.margin||{},v=ze(l,$r),m=ze(l,Ue),y=Object.keys(u).reduce(function(b,w){var S=u[w],j=S.orientation;return!S.mirror&&!S.hide?N(N({},b),{},H({},j,b[j]+S.width)):b},{left:d.left||0,right:d.right||0}),p=Object.keys(o).reduce(function(b,w){var S=o[w],j=S.orientation;return!S.mirror&&!S.hide?N(N({},b),{},H({},j,Je(b,"".concat(j))+S.height)):b},{top:d.top||0,bottom:d.bottom||0}),g=N(N({},p),y),x=g.bottom;v&&(g.bottom+=v.props.height||$r.defaultProps.height),m&&r&&(g=HT(g,i,n,r));var O=c-g.left-g.right,_=f-g.top-g.bottom;return N(N({brushBottom:x},g),{},{width:Math.max(O,0),height:Math.max(_,0)})},IN=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Gx=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,u=t.axisComponents,c=t.legendContent,f=t.formatAxisMap,l=t.defaultProps,d=function(g,x){var O=x.graphicalItems,_=x.stackGroups,b=x.offset,w=x.updateId,S=x.dataStartIndex,j=x.dataEndIndex,A=g.barSize,C=g.layout,E=g.barGap,T=g.barCategoryGap,M=g.maxBarSize,k=kg(C),I=k.numericAxisName,R=k.cateAxisName,B=MN(O),q=[];return O.forEach(function(z,G){var K=Ua(g.data,{graphicalItems:[z],dataStartIndex:S,dataEndIndex:j}),W=z.type.defaultProps!==void 0?N(N({},z.type.defaultProps),z.props):z.props,V=W.dataKey,ue=W.maxBarSize,ve=W["".concat(I,"Id")],Le=W["".concat(R,"Id")],Gt={},$e=u.reduce(function(Ht,Kt){var Ka=x["".concat(Kt.axisType,"Map")],ud=W["".concat(Kt.axisType,"Id")];Ka&&Ka[ud]||Kt.axisType==="zAxis"||ur();var cd=Ka[ud];return N(N({},Ht),{},H(H({},Kt.axisType,cd),"".concat(Kt.axisType,"Ticks"),bt(cd)))},Gt),F=$e[R],X=$e["".concat(R,"Ticks")],Z=_&&_[ve]&&_[ve].hasStack&&oE(z,_[ve].stackGroups),D=xt(z.type).indexOf("Bar")>=0,he=Ui(F,X),ee=[],ge=B&&UT({barSize:A,stackGroups:_,totalSize:IN($e,R)});if(D){var be,Ne,Mt=Q(ue)?M:ue,pr=(be=(Ne=Ui(F,X,!0))!==null&&Ne!==void 0?Ne:Mt)!==null&&be!==void 0?be:0;ee=GT({barGap:E,barCategoryGap:T,bandSize:pr!==he?pr:he,sizeList:ge[Le],maxBarSize:Mt}),pr!==he&&(ee=ee.map(function(Ht){return N(N({},Ht),{},{position:N(N({},Ht.position),{},{offset:Ht.position.offset-pr/2})})}))}var ai=z&&z.type&&z.type.getComposedData;ai&&q.push({props:N(N({},ai(N(N({},$e),{},{displayedData:K,props:g,dataKey:V,item:z,bandSize:he,barPosition:ee,offset:b,stackedData:Z,layout:C,dataStartIndex:S,dataEndIndex:j}))),{},H(H(H({key:z.key||"item-".concat(G)},I,$e[I]),R,$e[R]),"animationId",w)),childIndex:xO(z,g.children),item:z})}),q},v=function(g,x){var O=g.props,_=g.dataStartIndex,b=g.dataEndIndex,w=g.updateId;if(!Hh({props:O}))return null;var S=O.children,j=O.layout,A=O.stackOffset,C=O.data,E=O.reverseStackOrder,T=kg(j),M=T.numericAxisName,k=T.cateAxisName,I=it(S,n),R=nE(C,I,"".concat(M,"Id"),"".concat(k,"Id"),A,E),B=u.reduce(function(W,V){var ue="".concat(V.axisType,"Map");return N(N({},W),{},H({},ue,TN(O,N(N({},V),{},{graphicalItems:I,stackGroups:V.axisType===M&&R,dataStartIndex:_,dataEndIndex:b}))))},{}),q=CN(N(N({},B),{},{props:O,graphicalItems:I}),x==null?void 0:x.legendBBox);Object.keys(B).forEach(function(W){B[W]=f(O,B[W],q,W.replace("Map",""),r)});var z=B["".concat(k,"Map")],G=EN(z),K=d(O,N(N({},B),{},{dataStartIndex:_,dataEndIndex:b,updateId:w,graphicalItems:I,stackGroups:R,offset:q}));return N(N({formattedGraphicalItems:K,graphicalItems:I,offset:q,stackGroups:R},G),B)},m=(function(p){function g(x){var O,_,b;return fN(this,g),b=pN(this,g,[x]),H(b,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),H(b,"accessibilityManager",new Z$),H(b,"handleLegendBBoxUpdate",function(w){if(w){var S=b.state,j=S.dataStartIndex,A=S.dataEndIndex,C=S.updateId;b.setState(N({legendBBox:w},v({props:b.props,dataStartIndex:j,dataEndIndex:A,updateId:C},N(N({},b.state),{},{legendBBox:w}))))}}),H(b,"handleReceiveSyncEvent",function(w,S,j){if(b.props.syncId===w){if(j===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(S)}}),H(b,"handleBrushChange",function(w){var S=w.startIndex,j=w.endIndex;if(S!==b.state.dataStartIndex||j!==b.state.dataEndIndex){var A=b.state.updateId;b.setState(function(){return N({dataStartIndex:S,dataEndIndex:j},v({props:b.props,dataStartIndex:S,dataEndIndex:j,updateId:A},b.state))}),b.triggerSyncEvent({dataStartIndex:S,dataEndIndex:j})}}),H(b,"handleMouseEnter",function(w){var S=b.getMouseInfo(w);if(S){var j=N(N({},S),{},{isTooltipActive:!0});b.setState(j),b.triggerSyncEvent(j);var A=b.props.onMouseEnter;Y(A)&&A(j,w)}}),H(b,"triggeredAfterMouseMove",function(w){var S=b.getMouseInfo(w),j=S?N(N({},S),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(j),b.triggerSyncEvent(j);var A=b.props.onMouseMove;Y(A)&&A(j,w)}),H(b,"handleItemMouseEnter",function(w){b.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),H(b,"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),H(b,"handleMouseMove",function(w){w.persist(),b.throttleTriggeredAfterMouseMove(w)}),H(b,"handleMouseLeave",function(w){b.throttleTriggeredAfterMouseMove.cancel();var S={isTooltipActive:!1};b.setState(S),b.triggerSyncEvent(S);var j=b.props.onMouseLeave;Y(j)&&j(S,w)}),H(b,"handleOuterEvent",function(w){var S=bO(w),j=Je(b.props,"".concat(S));if(S&&Y(j)){var A,C;/.*touch.*/i.test(S)?C=b.getMouseInfo(w.changedTouches[0]):C=b.getMouseInfo(w),j((A=C)!==null&&A!==void 0?A:{},w)}}),H(b,"handleClick",function(w){var S=b.getMouseInfo(w);if(S){var j=N(N({},S),{},{isTooltipActive:!0});b.setState(j),b.triggerSyncEvent(j);var A=b.props.onClick;Y(A)&&A(j,w)}}),H(b,"handleMouseDown",function(w){var S=b.props.onMouseDown;if(Y(S)){var j=b.getMouseInfo(w);S(j,w)}}),H(b,"handleMouseUp",function(w){var S=b.props.onMouseUp;if(Y(S)){var j=b.getMouseInfo(w);S(j,w)}}),H(b,"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),H(b,"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseDown(w.changedTouches[0])}),H(b,"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseUp(w.changedTouches[0])}),H(b,"handleDoubleClick",function(w){var S=b.props.onDoubleClick;if(Y(S)){var j=b.getMouseInfo(w);S(j,w)}}),H(b,"handleContextMenu",function(w){var S=b.props.onContextMenu;if(Y(S)){var j=b.getMouseInfo(w);S(j,w)}}),H(b,"triggerSyncEvent",function(w){b.props.syncId!==void 0&&zc.emit(Fc,b.props.syncId,w,b.eventEmitterSymbol)}),H(b,"applySyncEvent",function(w){var S=b.props,j=S.layout,A=S.syncMethod,C=b.state.updateId,E=w.dataStartIndex,T=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)b.setState(N({dataStartIndex:E,dataEndIndex:T},v({props:b.props,dataStartIndex:E,dataEndIndex:T,updateId:C},b.state)));else if(w.activeTooltipIndex!==void 0){var M=w.chartX,k=w.chartY,I=w.activeTooltipIndex,R=b.state,B=R.offset,q=R.tooltipTicks;if(!B)return;if(typeof A=="function")I=A(q,w);else if(A==="value"){I=-1;for(var z=0;z<q.length;z++)if(q[z].value===w.activeLabel){I=z;break}}var G=N(N({},B),{},{x:B.left,y:B.top}),K=Math.min(M,G.x+G.width),W=Math.min(k,G.y+G.height),V=q[I]&&q[I].value,ue=nf(b.state,b.props.data,I),ve=q[I]?{x:j==="horizontal"?q[I].coordinate:K,y:j==="horizontal"?W:q[I].coordinate}:Wx;b.setState(N(N({},w),{},{activeLabel:V,activeCoordinate:ve,activePayload:ue,activeTooltipIndex:I}))}else b.setState(w)}),H(b,"renderCursor",function(w){var S,j=b.state,A=j.isTooltipActive,C=j.activeCoordinate,E=j.activePayload,T=j.offset,M=j.activeTooltipIndex,k=j.tooltipAxisBandSize,I=b.getTooltipEventType(),R=(S=w.props.active)!==null&&S!==void 0?S:A,B=b.props.layout,q=w.key||"_recharts-cursor";return P.createElement(iN,{key:q,activeCoordinate:C,activePayload:E,activeTooltipIndex:M,chartName:r,element:w,isActive:R,layout:B,offset:T,tooltipAxisBandSize:k,tooltipEventType:I})}),H(b,"renderPolarAxis",function(w,S,j){var A=Je(w,"type.axisType"),C=Je(b.state,"".concat(A,"Map")),E=w.type.defaultProps,T=E!==void 0?N(N({},E),w.props):w.props,M=C&&C[T["".concat(A,"Id")]];return $.cloneElement(w,N(N({},M),{},{className:te(A,M.className),key:w.key||"".concat(S,"-").concat(j),ticks:bt(M,!0)}))}),H(b,"renderPolarGrid",function(w){var S=w.props,j=S.radialLines,A=S.polarAngles,C=S.polarRadius,E=b.state,T=E.radiusAxisMap,M=E.angleAxisMap,k=kt(T),I=kt(M),R=I.cx,B=I.cy,q=I.innerRadius,z=I.outerRadius;return $.cloneElement(w,{polarAngles:Array.isArray(A)?A:bt(I,!0).map(function(G){return G.coordinate}),polarRadius:Array.isArray(C)?C:bt(k,!0).map(function(G){return G.coordinate}),cx:R,cy:B,innerRadius:q,outerRadius:z,key:w.key||"polar-grid",radialLines:j})}),H(b,"renderLegend",function(){var w=b.state.formattedGraphicalItems,S=b.props,j=S.children,A=S.width,C=S.height,E=b.props.margin||{},T=A-(E.left||0)-(E.right||0),M=R0({children:j,formattedGraphicalItems:w,legendWidth:T,legendContent:c});if(!M)return null;var k=M.item,I=Eg(M,aN);return $.cloneElement(k,N(N({},I),{},{chartWidth:A,chartHeight:C,margin:E,onBBoxUpdate:b.handleLegendBBoxUpdate}))}),H(b,"renderTooltip",function(){var w,S=b.props,j=S.children,A=S.accessibilityLayer,C=ze(j,je);if(!C)return null;var E=b.state,T=E.isTooltipActive,M=E.activeCoordinate,k=E.activePayload,I=E.activeLabel,R=E.offset,B=(w=C.props.active)!==null&&w!==void 0?w:T;return $.cloneElement(C,{viewBox:N(N({},R),{},{x:R.left,y:R.top}),active:B,label:I,payload:B?k:[],coordinate:M,accessibilityLayer:A})}),H(b,"renderBrush",function(w){var S=b.props,j=S.margin,A=S.data,C=b.state,E=C.offset,T=C.dataStartIndex,M=C.dataEndIndex,k=C.updateId;return $.cloneElement(w,{key:w.key||"_recharts-brush",onChange:di(b.handleBrushChange,w.props.onChange),data:A,x:L(w.props.x)?w.props.x:E.left,y:L(w.props.y)?w.props.y:E.top+E.height+E.brushBottom-(j.bottom||0),width:L(w.props.width)?w.props.width:E.width,startIndex:T,endIndex:M,updateId:"brush-".concat(k)})}),H(b,"renderReferenceElement",function(w,S,j){if(!w)return null;var A=b,C=A.clipPathId,E=b.state,T=E.xAxisMap,M=E.yAxisMap,k=E.offset,I=w.type.defaultProps||{},R=w.props,B=R.xAxisId,q=B===void 0?I.xAxisId:B,z=R.yAxisId,G=z===void 0?I.yAxisId:z;return $.cloneElement(w,{key:w.key||"".concat(S,"-").concat(j),xAxis:T[q],yAxis:M[G],viewBox:{x:k.left,y:k.top,width:k.width,height:k.height},clipPathId:C})}),H(b,"renderActivePoints",function(w){var S=w.item,j=w.activePoint,A=w.basePoint,C=w.childIndex,E=w.isRange,T=[],M=S.props.key,k=S.item.type.defaultProps!==void 0?N(N({},S.item.type.defaultProps),S.item.props):S.item.props,I=k.activeDot,R=k.dataKey,B=N(N({index:C,dataKey:R,cx:j.x,cy:j.y,r:4,fill:Xf(S.item),strokeWidth:2,stroke:"#fff",payload:j.payload,value:j.value},J(I,!1)),Ti(I));return T.push(g.renderActiveDot(I,B,"".concat(M,"-activePoint-").concat(C))),A?T.push(g.renderActiveDot(I,N(N({},B),{},{cx:A.x,cy:A.y}),"".concat(M,"-basePoint-").concat(C))):E&&T.push(null),T}),H(b,"renderGraphicChild",function(w,S,j){var A=b.filterFormatItem(w,S,j);if(!A)return null;var C=b.getTooltipEventType(),E=b.state,T=E.isTooltipActive,M=E.tooltipAxis,k=E.activeTooltipIndex,I=E.activeLabel,R=b.props.children,B=ze(R,je),q=A.props,z=q.points,G=q.isRange,K=q.baseLine,W=A.item.type.defaultProps!==void 0?N(N({},A.item.type.defaultProps),A.item.props):A.item.props,V=W.activeDot,ue=W.hide,ve=W.activeBar,Le=W.activeShape,Gt=!!(!ue&&T&&B&&(V||ve||Le)),$e={};C!=="axis"&&B&&B.props.trigger==="click"?$e={onClick:di(b.handleItemMouseEnter,w.props.onClick)}:C!=="axis"&&($e={onMouseLeave:di(b.handleItemMouseLeave,w.props.onMouseLeave),onMouseEnter:di(b.handleItemMouseEnter,w.props.onMouseEnter)});var F=$.cloneElement(w,N(N({},A.props),$e));function X(Kt){return typeof M.dataKey=="function"?M.dataKey(Kt.payload):null}if(Gt)if(k>=0){var Z,D;if(M.dataKey&&!M.allowDuplicatedCategory){var he=typeof M.dataKey=="function"?X:"payload.".concat(M.dataKey.toString());Z=Pi(z,he,I),D=G&&K&&Pi(K,he,I)}else Z=z==null?void 0:z[k],D=G&&K&&K[k];if(Le||ve){var ee=w.props.activeIndex!==void 0?w.props.activeIndex:k;return[$.cloneElement(w,N(N(N({},A.props),$e),{},{activeIndex:ee})),null,null]}if(!Q(Z))return[F].concat(Ur(b.renderActivePoints({item:A,activePoint:Z,basePoint:D,childIndex:k,isRange:G})))}else{var ge,be=(ge=b.getItemByXY(b.state.activeCoordinate))!==null&&ge!==void 0?ge:{graphicalItem:F},Ne=be.graphicalItem,Mt=Ne.item,pr=Mt===void 0?w:Mt,ai=Ne.childIndex,Ht=N(N(N({},A.props),$e),{},{activeIndex:ai});return[$.cloneElement(pr,Ht),null,null]}return G?[F,null,null]:[F,null]}),H(b,"renderCustomized",function(w,S,j){return $.cloneElement(w,N(N({key:"recharts-customized-".concat(j)},b.props),b.state))}),H(b,"renderMap",{CartesianGrid:{handler:mi,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:mi},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:mi},YAxis:{handler:mi},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((O=x.id)!==null&&O!==void 0?O:ni("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=p0(b.triggeredAfterMouseMove,(_=x.throttleDelay)!==null&&_!==void 0?_:1e3/60),b.state={},b}return mN(g,p),hN(g,[{key:"componentDidMount",value:function(){var O,_;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var O=this.props,_=O.children,b=O.data,w=O.height,S=O.layout,j=ze(_,je);if(j){var A=j.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,E=nf(this.state,b,A,C),T=this.state.tooltipTicks[A].coordinate,M=(this.state.offset.top+w)/2,k=S==="horizontal",I=k?{x:T,y:M}:{y:T,x:M},R=this.state.formattedGraphicalItems.find(function(q){var z=q.item;return z.type.name==="Scatter"});R&&(I=N(N({},I),R.props.points[A].tooltipPosition),E=R.props.points[A].tooltipPayload);var B={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:C,activePayload:E,activeCoordinate:I};this.setState(B),this.renderCursor(j),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(O,_){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==_.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==O.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==O.margin){var b,w;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(O){Zc([ze(O.children,je)],[ze(this.props.children,je)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var O=ze(this.props.children,je);if(O&&typeof O.props.shared=="boolean"){var _=O.props.shared?"axis":"item";return s.indexOf(_)>=0?_:a}return a}},{key:"getMouseInfo",value:function(O){if(!this.container)return null;var _=this.container,b=_.getBoundingClientRect(),w=oP(b),S={chartX:Math.round(O.pageX-w.left),chartY:Math.round(O.pageY-w.top)},j=b.width/_.offsetWidth||1,A=this.inRange(S.chartX,S.chartY,j);if(!A)return null;var C=this.state,E=C.xAxisMap,T=C.yAxisMap,M=this.getTooltipEventType(),k=Cg(this.state,this.props.data,this.props.layout,A);if(M!=="axis"&&E&&T){var I=kt(E).scale,R=kt(T).scale,B=I&&I.invert?I.invert(S.chartX):null,q=R&&R.invert?R.invert(S.chartY):null;return N(N({},S),{},{xValue:B,yValue:q},k)}return k?N(N({},S),k):null}},{key:"inRange",value:function(O,_){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,S=O/b,j=_/b;if(w==="horizontal"||w==="vertical"){var A=this.state.offset,C=S>=A.left&&S<=A.left+A.width&&j>=A.top&&j<=A.top+A.height;return C?{x:S,y:j}:null}var E=this.state,T=E.angleAxisMap,M=E.radiusAxisMap;if(T&&M){var k=kt(T);return Jy({x:S,y:j},k)}return null}},{key:"parseEventsOfWrapper",value:function(){var O=this.props.children,_=this.getTooltipEventType(),b=ze(O,je),w={};b&&_==="axis"&&(b.props.trigger==="click"?w={onClick:this.handleClick}:w={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var S=Ti(this.props,this.handleOuterEvent);return N(N({},S),w)}},{key:"addListener",value:function(){zc.on(Fc,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){zc.removeListener(Fc,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(O,_,b){for(var w=this.state.formattedGraphicalItems,S=0,j=w.length;S<j;S++){var A=w[S];if(A.item===O||A.props.key===O.key||_===xt(A.item.type)&&b===A.childIndex)return A}return null}},{key:"renderClipPath",value:function(){var O=this.clipPathId,_=this.state.offset,b=_.left,w=_.top,S=_.height,j=_.width;return P.createElement("defs",null,P.createElement("clipPath",{id:O},P.createElement("rect",{x:b,y:w,height:S,width:j})))}},{key:"getXScales",value:function(){var O=this.state.xAxisMap;return O?Object.entries(O).reduce(function(_,b){var w=Tg(b,2),S=w[0],j=w[1];return N(N({},_),{},H({},S,j.scale))},{}):null}},{key:"getYScales",value:function(){var O=this.state.yAxisMap;return O?Object.entries(O).reduce(function(_,b){var w=Tg(b,2),S=w[0],j=w[1];return N(N({},_),{},H({},S,j.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(O){var _;return(_=this.state.xAxisMap)===null||_===void 0||(_=_[O])===null||_===void 0?void 0:_.scale}},{key:"getYScaleByAxisId",value:function(O){var _;return(_=this.state.yAxisMap)===null||_===void 0||(_=_[O])===null||_===void 0?void 0:_.scale}},{key:"getItemByXY",value:function(O){var _=this.state,b=_.formattedGraphicalItems,w=_.activeItem;if(b&&b.length)for(var S=0,j=b.length;S<j;S++){var A=b[S],C=A.props,E=A.item,T=E.type.defaultProps!==void 0?N(N({},E.type.defaultProps),E.props):E.props,M=xt(E.type);if(M==="Bar"){var k=(C.data||[]).find(function(q){return YC(O,q)});if(k)return{graphicalItem:A,payload:k}}else if(M==="RadialBar"){var I=(C.data||[]).find(function(q){return Jy(O,q)});if(I)return{graphicalItem:A,payload:I}}else if(Da(A,w)||Ba(A,w)||Gn(A,w)){var R=q2({graphicalItem:A,activeTooltipItem:w,itemData:T.data}),B=T.activeIndex===void 0?R:T.activeIndex;return{graphicalItem:N(N({},A),{},{childIndex:B}),payload:Gn(A,w)?T.data[R]:A.props.data[R]}}}return null}},{key:"render",value:function(){var O=this;if(!Hh(this))return null;var _=this.props,b=_.children,w=_.className,S=_.width,j=_.height,A=_.style,C=_.compact,E=_.title,T=_.desc,M=Eg(_,oN),k=J(M,!1);if(C)return P.createElement(lg,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},P.createElement(Qc,xr({},k,{width:S,height:j,title:E,desc:T}),this.renderClipPath(),Vh(b,this.renderMap)));if(this.props.accessibilityLayer){var I,R;k.tabIndex=(I=this.props.tabIndex)!==null&&I!==void 0?I:0,k.role=(R=this.props.role)!==null&&R!==void 0?R:"application",k.onKeyDown=function(q){O.accessibilityManager.keyboardEvent(q)},k.onFocus=function(){O.accessibilityManager.focus()}}var B=this.parseEventsOfWrapper();return P.createElement(lg,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},P.createElement("div",xr({className:te("recharts-wrapper",w),style:N({position:"relative",cursor:"default",width:S,height:j},A)},B,{ref:function(z){O.container=z}}),P.createElement(Qc,xr({},k,{width:S,height:j,title:E,desc:T,style:ON}),this.renderClipPath(),Vh(b,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})($.Component);H(m,"displayName",r),H(m,"defaultProps",N({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},l)),H(m,"getDerivedStateFromProps",function(p,g){var x=p.dataKey,O=p.data,_=p.children,b=p.width,w=p.height,S=p.layout,j=p.stackOffset,A=p.margin,C=g.dataStartIndex,E=g.dataEndIndex;if(g.updateId===void 0){var T=Ig(p);return N(N(N({},T),{},{updateId:0},v(N(N({props:p},T),{},{updateId:0}),g)),{},{prevDataKey:x,prevData:O,prevWidth:b,prevHeight:w,prevLayout:S,prevStackOffset:j,prevMargin:A,prevChildren:_})}if(x!==g.prevDataKey||O!==g.prevData||b!==g.prevWidth||w!==g.prevHeight||S!==g.prevLayout||j!==g.prevStackOffset||!wr(A,g.prevMargin)){var M=Ig(p),k={chartX:g.chartX,chartY:g.chartY,isTooltipActive:g.isTooltipActive},I=N(N({},Cg(g,O,S)),{},{updateId:g.updateId+1}),R=N(N(N({},M),k),I);return N(N(N({},R),v(N({props:p},R),g)),{},{prevDataKey:x,prevData:O,prevWidth:b,prevHeight:w,prevLayout:S,prevStackOffset:j,prevMargin:A,prevChildren:_})}if(!Zc(_,g.prevChildren)){var B,q,z,G,K=ze(_,$r),W=K&&(B=(q=K.props)===null||q===void 0?void 0:q.startIndex)!==null&&B!==void 0?B:C,V=K&&(z=(G=K.props)===null||G===void 0?void 0:G.endIndex)!==null&&z!==void 0?z:E,ue=W!==C||V!==E,ve=!Q(O),Le=ve&&!ue?g.updateId:g.updateId+1;return N(N({updateId:Le},v(N(N({props:p},g),{},{updateId:Le,dataStartIndex:W,dataEndIndex:V}),g)),{},{prevChildren:_,dataStartIndex:W,dataEndIndex:V})}return null}),H(m,"renderActiveDot",function(p,g,x){var O;return $.isValidElement(p)?O=$.cloneElement(p,g):Y(p)?O=p(g):O=P.createElement(Zf,g),P.createElement(de,{className:"recharts-active-dot",key:x},O)});var y=$.forwardRef(function(g,x){return P.createElement(m,xr({},g,{ref:x}))});return y.displayName=m.displayName,y},$g=Gx({chartName:"BarChart",GraphicalChild:Lt,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Ge},{axisType:"yAxis",AxisComp:De}],formatAxisMap:ux}),tr=Gx({chartName:"AreaChart",GraphicalChild:Ae,axisComponents:[{axisType:"xAxis",AxisComp:Ge},{axisType:"yAxis",AxisComp:De}],formatAxisMap:ux});const nr={prepare:"#3b82f6","prepare:ensureContextGraph":"#60a5fa","prepare:partition":"#2563eb","prepare:manifest":"#93c5fd","prepare:validate":"#1d4ed8","prepare:merkle":"#7dd3fc",store:"#8b5cf6",chain:"#f59e0b","chain:sign":"#fbbf24","chain:submit":"#d97706","chain:writeahead":"#ea580c","chain:metadata":"#f97316",broadcast:"#22c55e",decode:"#14b8a6",validate:"#2dd4bf","read-shared-memory":"#06b6d4",parse:"#3b82f6",execute:"#8b5cf6",transfer:"#60a5fa",verify:"#22c55e"},ir="#a78bfa",kN=[{phase:"prepare",label:"Prepare"},{phase:"store",label:"Store"},{phase:"chain",label:"Chain"},{phase:"chain:writeahead",label:"Write-ahead"},{phase:"broadcast",label:"Broadcast"},{phase:"parse",label:"Parse"},{phase:"execute",label:"Execute"},{phase:"transfer",label:"Transfer"},{phase:"verify",label:"Verify"},{phase:"decode",label:"Decode"},{phase:"validate",label:"Validate"}],$N=kN.map(({phase:e,label:t})=>({phase:e,label:t,color:nr[e]??ir})),Jn={prepare:"Partitioning triples, computing Merkle hashes, validating & signing.",store:"Inserting triples into the local triple store and data graph.",chain:"Submitting on-chain tx and waiting for confirmation.","chain:writeahead":'Publish/update tx about to hit the wire — recovery window for "broadcast without receipt" crashes.',broadcast:"Broadcasting to network peers via GossipSub.",parse:"Validating and parsing the SPARQL query syntax.",execute:"Running the SPARQL query against the local triple store.",transfer:"Fetching triple pages from the remote peer.",verify:"Verifying Merkle proofs and inserting synced triples."},rt={publish:"#22c55e",publishFromSWM:"#16a34a",update:"#14b8a6","ka-update":"#0d9488",query:"#8b5cf6",resolve:"#a78bfa",workspace:"#f59e0b",connect:"#06b6d4",sync:"#ec4899",share:"#f472b6",gossip:"#f97316",reconstruct:"#fb923c",verify:"#84cc16",init:"#94a3b8",system:"#6b7280"},Ng={publish:"Publish a Knowledge Asset on-chain to a context graph",publishFromSWM:"Publish a Knowledge Asset derived from Shared Working Memory",update:"Update an existing Knowledge Asset on-chain","ka-update":"Incremental Knowledge Asset update (ka-update path)",query:"Run a SPARQL query against the knowledge graph",resolve:"Resolve a Knowledge Asset from the network",workspace:"Manage shared memory for staging changes",connect:"Establish a connection with a network peer",sync:"Synchronize knowledge data with remote peers",share:"Share a SWM delta with subscribed peers",gossip:"Propagate updates across the peer-to-peer network via GossipSub",reconstruct:"Reconstruct a Knowledge Asset from distributed shares",verify:"Verify Merkle proofs and assert data integrity",init:"Node or component initialisation sequence",system:"Internal system maintenance operation"},Rt={background:"var(--surface)",border:"1px solid var(--border)",borderRadius:6,fontSize:12,color:"var(--text)"},af=[{value:"5m",label:"5 min",ms:5*6e4},{value:"15m",label:"15 min",ms:15*6e4},{value:"30m",label:"30 min",ms:30*6e4},{value:"1h",label:"1 hour",ms:60*6e4},{value:"3h",label:"3 hours",ms:180*6e4},{value:"6h",label:"6 hours",ms:360*6e4},{value:"12h",label:"12 hours",ms:720*6e4},{value:"24h",label:"24 hours",ms:1440*6e4},{value:"7d",label:"7 days",ms:7*864e5},{value:"30d",label:"30 days",ms:30*864e5}],Rg={m:6e4,h:36e5,d:864e5,w:6048e5};function Ga(e){const t=af.find(n=>n.value===e);if(t)return t.ms;const r=e.match(/^(\d+)\s*([mhdw])$/i);if(r){const n=parseInt(r[1],10),i=r[2].toLowerCase();if(n>0&&Rg[i])return n*Rg[i]}return 864e5}function Ha({value:e,onChange:t}){const r=!af.some(u=>u.value===e),[n,i]=$.useState(""),[a,o]=$.useState(r),s=()=>{const u=n.trim();u&&/^\d+\s*[mhdw]$/i.test(u)&&(t(u.replace(/\s+/g,"")),o(!1))};return h.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[h.jsxs("select",{className:"input",value:r?"__custom__":e,onChange:u=>{if(u.target.value==="__custom__"){o(!0);return}o(!1),t(u.target.value)},children:[af.map(u=>h.jsx("option",{value:u.value,children:u.label},u.value)),h.jsx("option",{value:"__custom__",children:"Custom..."})]}),(a||r)&&h.jsx("input",{className:"input mono",placeholder:"e.g. 2d, 45m, 3h",value:n||(r?e:""),onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&s(),onBlur:s,style:{width:90},autoFocus:!0}),r&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:e})]})}function NN(){const[e,t]=$.useState("operations");return h.jsxs("div",{children:[h.jsxs("div",{className:"tab-group",style:{marginBottom:16},children:[h.jsx("button",{className:`tab-item ${e==="operations"?"active":""}`,onClick:()=>t("operations"),children:"All Operations"}),h.jsx("button",{className:`tab-item ${e==="replication"?"active":""}`,onClick:()=>t("replication"),children:"Replication"}),h.jsx("button",{className:`tab-item ${e==="hardware"?"active":""}`,onClick:()=>t("hardware"),children:"Hardware"}),h.jsx("button",{className:`tab-item ${e==="logs"?"active":""}`,onClick:()=>t("logs"),children:"Logs"}),h.jsx("button",{className:`tab-item ${e==="errors"?"active":""}`,onClick:()=>t("errors"),children:"Errors"})]}),e==="operations"?h.jsx(qN,{}):e==="replication"?h.jsx(RN,{}):e==="hardware"?h.jsx(FN,{}):e==="errors"?h.jsx(DN,{}):h.jsx(KN,{})]})}function Dg(e){return e==null?"—":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function RN(){const[e,t]=$.useState("24h"),[r,n]=$.useState(null),i=Ga(e),{data:a}=Re(()=>a1(i),[i],5e3),{data:o}=Re(()=>t1(i),[i],5e3),{data:s}=Re(()=>r1(),[],5e3),{data:u}=Re(()=>n1({periodMs:i,bucketMs:Math.max(6e4,Math.floor(i/48)),cg:r??void 0}),[i,r],5e3),{data:c}=Re(()=>r?i1(r,100):Promise.resolve(null),[r],5e3),f=(o==null?void 0:o.rows)??[],l=(s==null?void 0:s.cursors)??[],d=((u==null?void 0:u.buckets)??[]).map(y=>({...y,t:vt(y.bucket)})),v=(c==null?void 0:c.events)??[],m=(a==null?void 0:a.successRate)!=null?`${(a.successRate*100).toFixed(0)}%`:"—";return h.jsxs("div",{children:[h.jsxs("div",{className:"filters",style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginBottom:16},children:[h.jsx(Ha,{value:e,onChange:t}),h.jsx("span",{style:{fontSize:12,color:"var(--text-muted)"},children:"Chain-anchored publishes reconciled into Verifiable Memory. Auto-refreshes every 5s."})]}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(160px, 1fr))",gap:12,marginBottom:16},children:[h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",children:"Promotions"}),h.jsx("div",{style:{fontSize:28,fontWeight:600},children:(a==null?void 0:a.promotes)??"—"}),h.jsx("div",{style:{fontSize:12,color:"var(--text-muted)"},children:"landed in VM this period"})]}),h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",children:"Success rate"}),h.jsx("div",{style:{fontSize:28,fontWeight:600},children:m}),h.jsx("div",{style:{fontSize:12,color:"var(--text-muted)"},children:"promote / (promote + defer)"})]}),h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",children:"Promotion latency"}),h.jsx("div",{style:{fontSize:28,fontWeight:600},children:Dg(a==null?void 0:a.latencyP50Ms)}),h.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:["P50 · P95 ",Dg(a==null?void 0:a.latencyP95Ms)]})]}),h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",children:"Active fetches"}),h.jsx("div",{style:{fontSize:28,fontWeight:600},children:(a==null?void 0:a.fetches)??"—"}),h.jsx("div",{style:{fontSize:12,color:"var(--text-muted)"},children:"core-first catch-up pulls"})]})]}),h.jsxs("div",{className:"card",style:{padding:16,marginBottom:16},children:[h.jsxs("div",{className:"card-title",style:{marginBottom:8},children:["Reconciliation timeline",r?` — ${r}`:" — all CGs"]}),d.length===0?h.jsxs("div",{className:"empty-state empty-state--compact",children:[h.jsx("div",{className:"empty-state-title",children:"No reconciliation activity"}),h.jsx("div",{className:"empty-state-desc",children:"No chain-driven VM promotions recorded in this period."})]}):h.jsx(gt,{width:"100%",height:220,children:h.jsxs(tr,{data:d,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"var(--border)"}),h.jsx(Ge,{dataKey:"t",tick:{fontSize:11}}),h.jsx(De,{allowDecimals:!1,tick:{fontSize:11}}),h.jsx(je,{}),h.jsx(Ue,{}),h.jsx(Ae,{type:"monotone",dataKey:"promotes",stackId:"1",stroke:"#22c55e",fill:"#22c55e",fillOpacity:.5,name:"promotes"}),h.jsx(Ae,{type:"monotone",dataKey:"fetches",stackId:"1",stroke:"#3b82f6",fill:"#3b82f6",fillOpacity:.4,name:"fetches"}),h.jsx(Ae,{type:"monotone",dataKey:"defers",stackId:"1",stroke:"#f59e0b",fill:"#f59e0b",fillOpacity:.4,name:"defers"})]})})]}),h.jsxs("div",{className:"card",style:{padding:16,marginBottom:16},children:[h.jsx("div",{className:"card-title",style:{marginBottom:8},children:"Cursor inspector"}),h.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:12},children:"Per-CG persisted watermark (contiguous registration ordinal promoted to VM) vs. last observed chain head."}),l.length===0?h.jsx("div",{className:"empty-state empty-state--compact",children:h.jsx("div",{className:"empty-state-title",children:"No subscriptions"})}):h.jsxs("table",{className:"data-table",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Context graph"}),h.jsx("th",{children:"On-chain id"}),h.jsx("th",{children:"Role"}),h.jsx("th",{children:"Watermark"}),h.jsx("th",{children:"Chain head"}),h.jsx("th",{children:"Lag"}),h.jsx("th",{children:"Last event"})]})}),h.jsx("tbody",{children:l.map(y=>{const p=y.last_reconciled_ordinal??0,g=y.last_head??null,x=g!=null?Math.max(0,g-p):null;return h.jsxs("tr",{children:[h.jsx("td",{className:"mono",children:y.context_graph_id}),h.jsx("td",{className:"mono",children:y.on_chain_id??"—"}),h.jsx("td",{children:y.core_hosted?h.jsx("span",{className:"badge badge-info",title:"Core hosts this public CG; fills its own gaps from chain (Phase D)",children:"host"}):h.jsx("span",{className:"badge",children:"member"})}),h.jsx("td",{children:p}),h.jsx("td",{children:g??"—"}),h.jsx("td",{children:x==null?"—":h.jsx("span",{className:`badge ${x===0?"badge-success":"badge-error"}`,children:x})}),h.jsx("td",{children:y.last_event_ts?vt(y.last_event_ts):"—"})]},y.context_graph_id)})})]})]}),h.jsxs("div",{className:"card",style:{padding:16,marginBottom:16},children:[h.jsx("div",{className:"card-title",style:{marginBottom:8},children:"Per-CG activity"}),h.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:12},children:"Click a row to scope the timeline + open its event stream."}),f.length===0?h.jsx("div",{className:"empty-state empty-state--compact",children:h.jsx("div",{className:"empty-state-title",children:"No activity in this period"})}):h.jsxs("table",{className:"data-table",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Context graph"}),h.jsx("th",{children:"Promotes"}),h.jsx("th",{children:"Fetches"}),h.jsx("th",{children:"Defers"}),h.jsx("th",{children:"Cursor moves"}),h.jsx("th",{children:"Watermark"}),h.jsx("th",{children:"Last event"})]})}),h.jsx("tbody",{children:f.map(y=>h.jsxs("tr",{onClick:()=>n(r===y.context_graph_id?null:y.context_graph_id),style:{cursor:"pointer",background:r===y.context_graph_id?"var(--bg-hover, rgba(255,255,255,0.04))":void 0},children:[h.jsx("td",{className:"mono",children:y.context_graph_id}),h.jsx("td",{children:y.promotes}),h.jsx("td",{children:y.fetches}),h.jsx("td",{children:y.defers}),h.jsx("td",{children:y.cursor_advances}),h.jsx("td",{children:y.last_watermark??"—"}),h.jsx("td",{children:y.last_event_ts?vt(y.last_event_ts):"—"})]},y.context_graph_id))})]})]}),r&&h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsxs("div",{className:"card-title",style:{marginBottom:8},children:["Event stream — ",r]}),v.length===0?h.jsx("div",{className:"empty-state empty-state--compact",children:h.jsx("div",{className:"empty-state-title",children:"No events"})}):h.jsxs("table",{className:"data-table",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Time"}),h.jsx("th",{children:"Action"}),h.jsx("th",{children:"Ordinal"}),h.jsx("th",{children:"Cursor"}),h.jsx("th",{children:"UAL"}),h.jsx("th",{children:"Detail"})]})}),h.jsx("tbody",{children:v.map((y,p)=>h.jsxs("tr",{children:[h.jsx("td",{children:vt(y.ts)}),h.jsx("td",{children:h.jsx("span",{className:`badge ${y.action==="promote"?"badge-success":y.action==="defer"?"badge-error":""}`,children:y.action})}),h.jsx("td",{children:y.ordinal??"—"}),h.jsx("td",{className:"mono",children:y.from_watermark!=null&&y.to_watermark!=null?`${y.from_watermark}->${y.to_watermark}`:"—"}),h.jsx("td",{className:"mono",style:{maxWidth:280,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:y.ual??"",children:y.ual??"—"}),h.jsx("td",{className:"mono",children:y.detail??"—"})]},p))})]})]})]})}function eR(){return h.jsxs("div",{className:"page-section",children:[h.jsx("h1",{className:"page-title",style:{marginBottom:4},children:"Observability"}),h.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:20},children:"Track operation performance, phases, and errors"}),h.jsx(NN,{})]})}function DN(){const[e,t]=$.useState("24h"),[r,n]=$.useState(""),[i,a]=$.useState(null),[o,s]=$.useState(null),u=Ga(e),{data:c}=Re(()=>s1(u),[u],15e3),f=(c==null?void 0:c.hotspots)??[],l=i?f.find(m=>`${m.operation_name}-${m.phase}`===i):null,{data:d}=Re(()=>l?u1({phase:l.phase,operationName:l.operation_name,periodMs:u,q:r||void 0}):Promise.resolve(null),[i,u,r],1e4),v=(d==null?void 0:d.operations)??[];return h.jsxs("div",{children:[h.jsxs("div",{className:"filters",style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginBottom:16},children:[h.jsx(Ha,{value:e,onChange:t}),h.jsx("input",{className:"input mono",placeholder:"Search errors, operation IDs...",value:r,onChange:m=>n(m.target.value),style:{flex:1,minWidth:200}})]}),h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",style:{marginBottom:4},children:"Error Hotspots"}),h.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:16,lineHeight:1.5},children:"Click a phase to see all failed operations. Click an operation to expand its logs."}),f.length===0?h.jsxs("div",{className:"empty-state empty-state--compact",children:[h.jsx("div",{className:"empty-state-icon",style:{background:"rgba(74,222,128,.1)",borderColor:"rgba(74,222,128,.25)"},children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),h.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]})}),h.jsx("div",{className:"empty-state-title",style:{color:"var(--green)"},children:"No errors in this period"}),h.jsx("div",{className:"empty-state-desc",children:"All operations completed successfully. Nice work."})]}):h.jsxs("table",{className:"data-table",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Operation"}),h.jsx("th",{children:"Phase"}),h.jsx("th",{children:"Errors"}),h.jsx("th",{children:"Last Error"}),h.jsx("th",{children:"Last Occurred"})]})}),h.jsx("tbody",{children:f.map(m=>{const y=`${m.operation_name}-${m.phase}`;return h.jsxs(P.Fragment,{children:[h.jsxs("tr",{onClick:()=>{a(p=>p===y?null:y),s(null)},style:{cursor:"pointer",background:i===y?"rgba(239,68,68,.08)":void 0},children:[h.jsxs("td",{style:{fontSize:12,color:"var(--text-muted)",padding:"10px 14px"},children:[h.jsx("span",{style:{marginRight:6,fontSize:10},children:i===y?"▼":"▸"}),m.operation_name]}),h.jsx("td",{style:{color:nr[m.phase]??ir,fontWeight:600,padding:"10px 14px"},children:m.phase}),h.jsx("td",{style:{padding:"10px 14px"},children:h.jsx("span",{className:"badge badge-error",children:m.error_count})}),h.jsx("td",{style:{fontSize:12,color:"var(--text-muted)",maxWidth:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"10px 14px"},title:m.last_error??"",children:m.last_error??"—"}),h.jsx("td",{style:{padding:"10px 14px"},children:m.last_occurred?vt(m.last_occurred):"—"})]}),i===y&&h.jsx("tr",{children:h.jsx("td",{colSpan:5,style:{padding:0,background:"rgba(0,0,0,.15)"},children:h.jsx(BN,{operations:v,expandedOp:o,onToggleOp:p=>s(g=>g===p?null:p)})})})]},y)})})]})]})]})}function BN({operations:e,expandedOp:t,onToggleOp:r}){return e.length===0?h.jsx("div",{style:{padding:"12px 16px",fontSize:11,color:"var(--text-muted)"},children:"No matching failed operations"}):h.jsx("div",{style:{padding:"8px 0"},children:e.map(n=>h.jsxs("div",{style:{borderBottom:"1px solid var(--border)"},children:[h.jsxs("div",{onClick:()=>r(n.operation_id),style:{display:"flex",alignItems:"center",gap:10,padding:"10px 20px",cursor:"pointer",background:t===n.operation_id?"rgba(239,68,68,.05)":void 0},children:[h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:t===n.operation_id?"▼":"▸"}),h.jsx("span",{style:{fontWeight:600,fontSize:12,color:rt[n.operation_name]??"var(--text-muted)"},children:n.operation_name}),h.jsx(pa,{status:n.status}),h.jsxs("span",{className:"mono",style:{fontSize:10,color:"var(--text-dim)"},children:[n.operation_id," ",h.jsx(sd,{text:n.operation_id})]}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",marginLeft:"auto"},children:vt(n.phase_started_at)}),n.duration_ms!=null&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:lt(n.duration_ms)})]}),t===n.operation_id&&h.jsxs("div",{style:{padding:"4px 20px 16px"},children:[n.phase_error&&h.jsx("div",{style:{padding:"6px 10px",marginBottom:8,background:"rgba(239,68,68,.1)",borderRadius:6,border:"1px solid rgba(239,68,68,.2)",fontSize:11,color:"var(--red)"},children:n.phase_error}),n.error_message&&n.error_message!==n.phase_error&&h.jsx("div",{style:{padding:"6px 10px",marginBottom:8,background:"rgba(239,68,68,.06)",borderRadius:6,border:"1px solid rgba(239,68,68,.15)",fontSize:11,color:"var(--red)"},children:n.error_message}),n.logs&&n.logs.length>0?h.jsx(Xx,{maxHeight:200,children:n.logs.map(i=>h.jsx(Vx,{ts:i.ts,level:i.level,module:i.module,message:i.message},i.id))}):h.jsx("div",{style:{fontSize:11,color:"var(--text-dim)",padding:"4px 0"},children:"No logs for this operation"})]})]},`${n.operation_id}-${n.phase_started_at}`))})}const LN=[{value:"0",label:"Auto"},{value:String(5*6e4),label:"5 min"},{value:String(15*6e4),label:"15 min"},{value:String(30*6e4),label:"30 min"},{value:String(36e5),label:"1 hour"},{value:String(6*36e5),label:"6 hours"},{value:String(864e5),label:"1 day"}];function qN(){return h.jsxs("div",{children:[h.jsx(zN,{}),h.jsx(UN,{})]})}function zN(){const[e,t]=$.useState("3h"),[r,n]=$.useState("0"),[i,a]=$.useState(new Set),o=Ga(e),s=r==="0"?void 0:parseInt(r,10),{data:u}=Re(()=>Yx(o),[o],15e3),{data:c}=Re(()=>Zx(o,s),[o,s],15e3),f=(u==null?void 0:u.rates)??[],l=$.useMemo(()=>o<=36e5?{hour:"2-digit",minute:"2-digit"}:o<=864e5?{hour:"2-digit",minute:"2-digit"}:{month:"short",day:"numeric",hour:"2-digit"},[o]),d=$.useMemo(()=>{var g;return(g=c==null?void 0:c.buckets)!=null&&g.length?c.buckets.map((x,O)=>{var b;const _={time:new Date(x).toLocaleString(void 0,l)};for(const w of c.types){const S=(b=c.series[w])==null?void 0:b[O];_[`${w}_count`]=(S==null?void 0:S.count)??0,_[`${w}_avgMs`]=S!=null&&S.avgMs?+(S.avgMs/1e3).toFixed(2):0,_[`${w}_successPct`]=S?Math.round(S.successRate*100):0,_[`${w}_gas`]=(S==null?void 0:S.gasCostEth)??0}return _}):[]},[c]),v=(c==null?void 0:c.types)??[],m=d.length>1,y=$.useCallback(g=>{const x=g.value??g.dataKey;x&&a(O=>{const _=new Set(O);return _.has(x)?_.delete(x):_.add(x),_})},[]),p=$.useCallback(g=>{const x=i.has(g);return h.jsx("span",{style:{color:x?"var(--text-dim)":void 0,textDecoration:x?"line-through":void 0,cursor:"pointer"},children:g})},[i]);return h.jsxs("div",{style:{marginBottom:16},children:[h.jsxs("div",{className:"filters",style:{display:"flex",gap:8,alignItems:"center",marginBottom:16,flexWrap:"wrap"},children:[h.jsx(Ha,{value:e,onChange:t}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",fontWeight:600,textTransform:"uppercase",letterSpacing:".04em"},children:"per"}),h.jsx("select",{className:"input",value:r,onChange:g=>n(g.target.value),style:{width:"auto"},children:LN.map(g=>h.jsx("option",{value:g.value,children:g.label},g.value))})]})]}),h.jsxs(h.Fragment,{children:[f.length>0&&h.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:10,marginBottom:16},children:f.map(g=>{const x=rt[g.type]??"var(--text-muted)",O=g.rate>=.9?"var(--green-mid)":g.rate>=.7?"var(--amber)":"var(--red)";return h.jsxs("div",{style:{background:"rgba(255,255,255,.03)",borderRadius:8,padding:"12px 14px",border:"1px solid var(--border)",borderLeft:`3px solid ${x}`},children:[h.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:h.jsx("span",{style:{fontSize:13,fontWeight:700,color:x},children:g.type})}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"6px 12px",fontSize:11},children:[h.jsxs("div",{children:[h.jsx("div",{style:{color:"var(--text-dim)",fontSize:9,textTransform:"uppercase",letterSpacing:".04em",marginBottom:2},children:"Operations"}),h.jsx("div",{style:{fontWeight:700,fontSize:16},children:g.total})]}),h.jsxs("div",{children:[h.jsx("div",{style:{color:"var(--text-dim)",fontSize:9,textTransform:"uppercase",letterSpacing:".04em",marginBottom:2},children:"Success"}),h.jsxs("div",{style:{fontWeight:700,fontSize:16,color:O},children:[(g.rate*100).toFixed(0),"%"]})]}),h.jsxs("div",{children:[h.jsx("div",{style:{color:"var(--text-dim)",fontSize:9,textTransform:"uppercase",letterSpacing:".04em",marginBottom:2},children:"Avg Duration"}),h.jsx("div",{style:{fontWeight:600,fontSize:13},children:lt(g.avgMs)})]}),h.jsxs("div",{children:[h.jsx("div",{style:{color:"var(--text-dim)",fontSize:9,textTransform:"uppercase",letterSpacing:".04em",marginBottom:2},children:"Errors"}),h.jsx("div",{style:{fontWeight:600,fontSize:13,color:g.error>0?"var(--red)":"var(--text-dim)"},children:g.error})]})]}),h.jsx("div",{style:{height:3,background:"rgba(255,255,255,.06)",borderRadius:2,overflow:"hidden",marginTop:10},children:h.jsx("div",{style:{height:"100%",width:`${g.rate*100}%`,background:O,borderRadius:2}})})]},g.type)})}),m?h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,marginBottom:14},children:[h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Operations Over Time"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs($g,{data:d,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{tick:{fontSize:9,fill:"#9ca3af"},width:28}),h.jsx(je,{contentStyle:Rt,cursor:{fill:"rgba(255,255,255,.06)"}}),h.jsx(Ue,{wrapperStyle:{fontSize:9},onClick:y,formatter:p}),v.map(g=>h.jsx(Lt,{dataKey:`${g}_count`,name:g,stackId:"ops",fill:rt[g]??"#6b7280",fillOpacity:.6,hide:i.has(g)},g))]})})]}),h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Avg Duration by Operation Type (s)"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs(tr,{data:d,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{tick:{fontSize:9,fill:"#9ca3af"},width:32}),h.jsx(je,{contentStyle:Rt}),h.jsx(Ue,{wrapperStyle:{fontSize:9},onClick:y,formatter:p}),v.map(g=>h.jsx(Ae,{type:"monotone",dataKey:`${g}_avgMs`,name:g,stroke:rt[g]??"#6b7280",fill:rt[g]??"#6b7280",fillOpacity:.1,strokeWidth:2,dot:!1,hide:i.has(g)},g))]})})]}),h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Success Rate by Operation Type (%)"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs(tr,{data:d,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{domain:[0,100],tick:{fontSize:9,fill:"#9ca3af"},width:28}),h.jsx(je,{contentStyle:Rt}),h.jsx(Ue,{wrapperStyle:{fontSize:9},onClick:y,formatter:p}),v.map(g=>h.jsx(Ae,{type:"monotone",dataKey:`${g}_successPct`,name:g,stroke:rt[g]??"#6b7280",fill:rt[g]??"#6b7280",fillOpacity:.1,strokeWidth:2,dot:!1,hide:i.has(g)},g))]})})]}),h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Gas Cost by Operation Type (ETH)"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs($g,{data:d,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{tick:{fontSize:9,fill:"#9ca3af"},width:32}),h.jsx(je,{contentStyle:Rt,cursor:{fill:"rgba(255,255,255,.06)"}}),h.jsx(Ue,{wrapperStyle:{fontSize:9},onClick:y,formatter:p}),v.map(g=>h.jsx(Lt,{dataKey:`${g}_gas`,name:g,stackId:"gas",fill:rt[g]??"#6b7280",fillOpacity:.6,hide:i.has(g)},g))]})})]})]}):h.jsx("div",{className:"card",style:{marginBottom:14},children:h.jsxs("div",{className:"empty-state empty-state--compact",children:[h.jsx("div",{className:"empty-state-icon",children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"10"}),h.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),h.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"14"})]})}),h.jsx("div",{className:"empty-state-title",children:"Not enough data for charts"}),h.jsx("div",{className:"empty-state-desc",children:"Charts will render once enough operations have been processed."})]})})]})]})}function FN(){const[e,t]=$.useState("3h"),r=Ga(e),n=$.useMemo(()=>r<=864e5?{hour:"2-digit",minute:"2-digit"}:{month:"short",day:"numeric",hour:"2-digit"},[r]),{data:i}=Re(()=>o1(Date.now()-r,Date.now(),200),[r],1e4),a=$.useMemo(()=>((i==null?void 0:i.snapshots)??[]).map(c=>({time:new Date(c.ts).toLocaleString(void 0,n),cpu:c.cpu_percent??0,memGB:c.mem_used_bytes?+(c.mem_used_bytes/1024**3).toFixed(2):0,heapMB:c.heap_used_bytes?+(c.heap_used_bytes/1024**2).toFixed(1):0,diskPct:c.disk_total_bytes?Math.round(c.disk_used_bytes/c.disk_total_bytes*100):0,peers:c.peer_count??0,rpcMs:c.rpc_latency_ms??0})),[i,n]),o=$.useMemo(()=>{const c=(i==null?void 0:i.snapshots)??[];if(!c.length)return null;const f=c[c.length-1];return{cpu:f.cpu_percent??0,memUsedGB:f.mem_used_bytes?+(f.mem_used_bytes/1024**3).toFixed(1):0,memTotalGB:f.mem_total_bytes?+(f.mem_total_bytes/1024**3).toFixed(1):0,memPct:f.mem_total_bytes?Math.round(f.mem_used_bytes/f.mem_total_bytes*100):0,heapMB:f.heap_used_bytes?+(f.heap_used_bytes/1024**2).toFixed(0):0,diskUsedGB:f.disk_used_bytes?+(f.disk_used_bytes/1024**3).toFixed(1):null,diskTotalGB:f.disk_total_bytes?+(f.disk_total_bytes/1024**3).toFixed(1):null,diskPct:f.disk_total_bytes?Math.round(f.disk_used_bytes/f.disk_total_bytes*100):null,peers:f.peer_count??0,rpcMs:f.rpc_latency_ms??null}},[i]),s=!o,u=[{label:"CPU",value:o?`${o.cpu.toFixed(1)}%`:"—",sub:o?"utilisation":"waiting…",pct:o?o.cpu:null,color:o?o.cpu>80?"#ef4444":o.cpu>60?"#f59e0b":"#3b82f6":"#374151"},{label:"RAM",value:o?`${o.memUsedGB} / ${o.memTotalGB} GB`:"—",sub:o?`${o.memPct}% used`:"waiting…",pct:o?o.memPct:null,color:o?o.memPct>85?"#ef4444":o.memPct>70?"#f59e0b":"#8b5cf6":"#374151"},{label:"Heap",value:o?`${o.heapMB} MB`:"—",sub:o?"Node.js heap":"waiting…",pct:null,color:o?"#06b6d4":"#374151"},{label:"Disk",value:o?o.diskPct!==null?`${o.diskUsedGB} / ${o.diskTotalGB} GB`:"n/a":"—",sub:o?o.diskPct!==null?`${o.diskPct}% used`:"not configured":"waiting…",pct:o?o.diskPct:null,color:o?o.diskPct!==null?o.diskPct>85?"#ef4444":"#f59e0b":"#6b7280":"#374151"}];return h.jsxs("div",{children:[h.jsx("div",{className:"filters",style:{marginBottom:16},children:h.jsx(Ha,{value:e,onChange:t})}),h.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:8,marginBottom:12},children:u.map(c=>h.jsxs("div",{className:"card",style:{padding:"10px 12px",opacity:s?.5:1,transition:"opacity .3s"},children:[h.jsx("div",{style:{fontSize:10,fontWeight:700,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:".06em",marginBottom:4},children:c.label}),h.jsx("div",{style:{fontSize:18,fontWeight:700,color:c.color,lineHeight:1,marginBottom:3},children:c.value}),c.pct!==null?h.jsx("div",{style:{height:3,background:"rgba(255,255,255,.06)",borderRadius:2,margin:"5px 0 3px"},children:h.jsx("div",{style:{height:3,width:`${Math.min(c.pct,100)}%`,background:c.color,borderRadius:2,transition:"width .4s ease"}})}):h.jsx("div",{style:{height:3,margin:"5px 0 3px"}}),h.jsx("div",{style:{fontSize:10,color:"var(--text-dim)"},children:c.sub})]},c.label))}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:8,marginBottom:12},children:[h.jsxs("div",{className:"card",style:{padding:"10px 12px",opacity:s?.5:1,transition:"opacity .3s"},children:[h.jsx("div",{style:{fontSize:10,fontWeight:700,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:".06em",marginBottom:4},children:"Peers"}),h.jsx("div",{style:{fontSize:18,fontWeight:700,color:o?"#22c55e":"#374151",lineHeight:1},children:o?o.peers:"—"}),h.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginTop:3},children:o?"connected":"waiting…"})]}),h.jsxs("div",{className:"card",style:{padding:"10px 12px",opacity:s?.5:1,transition:"opacity .3s"},children:[h.jsx("div",{style:{fontSize:10,fontWeight:700,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:".06em",marginBottom:4},children:"RPC Latency"}),h.jsx("div",{style:{fontSize:18,fontWeight:700,color:o?o.rpcMs!==null&&o.rpcMs>500?"#ef4444":"#22c55e":"#374151",lineHeight:1},children:o&&o.rpcMs!==null?`${o.rpcMs} ms`:"—"}),h.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginTop:3},children:o?"last measurement":"waiting…"})]})]}),a.length>1?h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"CPU Usage (%)"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs(tr,{data:a,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{domain:[0,100],tick:{fontSize:9,fill:"#9ca3af"},width:28}),h.jsx(je,{contentStyle:Rt}),h.jsx(Ae,{type:"monotone",dataKey:"cpu",stroke:"#3b82f6",fill:"#3b82f6",fillOpacity:.12,strokeWidth:1.5,dot:!1,name:"CPU %"})]})})]}),h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Memory & Heap"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs(tr,{data:a,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{tick:{fontSize:9,fill:"#9ca3af"},width:32}),h.jsx(je,{contentStyle:Rt}),h.jsx(Ue,{wrapperStyle:{fontSize:9}}),h.jsx(Ae,{type:"monotone",dataKey:"memGB",stroke:"#8b5cf6",fill:"#8b5cf6",fillOpacity:.1,strokeWidth:1.5,dot:!1,name:"Sys RAM (GB)"}),h.jsx(Ae,{type:"monotone",dataKey:"heapMB",stroke:"#06b6d4",fill:"#06b6d4",fillOpacity:.1,strokeWidth:1.5,dot:!1,name:"Heap (MB)"})]})})]}),h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Disk Usage (%)"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs(tr,{data:a,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{domain:[0,100],tick:{fontSize:9,fill:"#9ca3af"},width:28}),h.jsx(je,{contentStyle:Rt}),h.jsx(Ae,{type:"monotone",dataKey:"diskPct",stroke:"#f59e0b",fill:"#f59e0b",fillOpacity:.12,strokeWidth:1.5,dot:!1,name:"Disk %"})]})})]}),h.jsxs("div",{className:"card",style:{padding:"12px 14px"},children:[h.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-muted)",marginBottom:6,textTransform:"uppercase",letterSpacing:".04em"},children:"Network & RPC"}),h.jsx(gt,{width:"100%",height:150,children:h.jsxs(tr,{data:a,children:[h.jsx(ut,{strokeDasharray:"3 3",stroke:"#1f2937"}),h.jsx(Ge,{dataKey:"time",tick:{fontSize:9,fill:"#9ca3af"}}),h.jsx(De,{tick:{fontSize:9,fill:"#9ca3af"},width:28,yAxisId:"left"}),h.jsx(De,{tick:{fontSize:9,fill:"#9ca3af"},width:28,yAxisId:"right",orientation:"right"}),h.jsx(je,{contentStyle:Rt}),h.jsx(Ue,{wrapperStyle:{fontSize:9}}),h.jsx(Ae,{type:"monotone",dataKey:"peers",stroke:"#22c55e",fill:"#22c55e",fillOpacity:.1,strokeWidth:1.5,dot:!1,name:"Peers",yAxisId:"left"}),h.jsx(Ae,{type:"monotone",dataKey:"rpcMs",stroke:"#ef4444",fill:"#ef4444",fillOpacity:.08,strokeWidth:1.5,dot:!1,name:"RPC (ms)",yAxisId:"right"})]})})]})]}):h.jsx("div",{style:{fontSize:11,color:"var(--text-dim)",textAlign:"center",padding:"8px 0"},children:"History charts appear after a second snapshot (~30 s)"})]})}function WN({phases:e,totalMs:t}){const[r,n]=$.useState(null);if(!(e!=null&&e.length))return h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",fontStyle:"italic"},children:"event-based"});if(t<=0)return h.jsx("span",{style:{color:"var(--text-dim)"},children:"—"});const i=e.reduce((a,o)=>a+(o.duration_ms??0),0)||t;return h.jsxs("div",{style:{position:"relative",minWidth:120,maxWidth:260},children:[h.jsx("div",{style:{display:"flex",gap:4,marginBottom:3,flexWrap:"wrap"},children:e.map((a,o)=>{const s=a.status==="error"?"#ef4444":nr[a.phase]??ir;return h.jsxs("span",{style:{fontSize:9,fontWeight:600,color:s,letterSpacing:".02em",display:"inline-flex",alignItems:"center",gap:3},children:[h.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:s,display:"inline-block",flexShrink:0}}),a.phase,h.jsx("span",{style:{fontWeight:400,color:"var(--text-dim)",fontFamily:"'JetBrains Mono', monospace"},children:lt(a.duration_ms)})]},`label-${a.phase}-${o}`)})}),h.jsx("div",{style:{display:"flex",height:10,borderRadius:3,overflow:"hidden",background:"rgba(255,255,255,.04)"},children:e.map((a,o)=>{const s=Math.max((a.duration_ms??0)/i*100,3),u=a.status==="error"?"#ef4444":nr[a.phase]??ir,c=r===o;return h.jsx("div",{onMouseEnter:()=>n(o),onMouseLeave:()=>n(null),style:{width:`${s}%`,background:u,minWidth:3,opacity:c?1:.65,transition:"opacity .15s, width .2s",cursor:"default"}},`${a.phase}-${o}`)})}),r!==null&&e[r]&&(()=>{const a=e[r].phase,o=a.includes(":")?a.split(":")[0]:a,s=Jn[a]??Jn[o];return h.jsxs("div",{style:{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:6,padding:"5px 10px",borderRadius:6,background:"var(--surface)",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,.4)",fontSize:11,zIndex:10,pointerEvents:"none",maxWidth:260},children:[h.jsxs("div",{style:{whiteSpace:"nowrap"},children:[h.jsx("span",{style:{fontWeight:700,color:nr[a]??ir},children:a}),h.jsx("span",{style:{color:"var(--text-muted)",margin:"0 6px"},children:"·"}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",color:"var(--text)"},children:lt(e[r].duration_ms)}),h.jsxs("span",{style:{color:"var(--text-dim)",marginLeft:6},children:["(",Math.round((e[r].duration_ms??0)/t*100),"%)"]}),e[r].status==="error"&&h.jsx("span",{style:{color:"var(--red)",marginLeft:6,fontWeight:600},children:"FAILED"})]}),s&&h.jsx("div",{style:{fontSize:10,color:"var(--text-muted)",marginTop:3,whiteSpace:"normal",lineHeight:1.4},children:s})]})})()]})}const ln=50;function UN(){const[e,t]=$.useState(""),[r,n]=$.useState(""),[i,a]=$.useState(""),[o,s]=$.useState(null),[u,c]=$.useState(0);$.useEffect(()=>{c(0)},[e,r,i]);const f={limit:String(ln),offset:String(u*ln)};e&&(f.name=e),r&&(f.status=r),i.trim()&&(f.operationId=i.trim());const{data:l}=Re(()=>Jx(f),[e,r,i,u],5e3),{data:d}=Re(()=>o?Qx(o):Promise.resolve(null),[o]),{data:v}=Re(e1,[],3e4),m=v==null?void 0:v.blockExplorerUrl,y=(l==null?void 0:l.operations)??[],p=(l==null?void 0:l.total)??0,g=Math.max(1,Math.ceil(p/ln));return h.jsxs("div",{children:[h.jsxs("div",{className:"filters",style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginBottom:12},children:[h.jsxs("select",{className:"input",value:e,onChange:x=>t(x.target.value),title:"Filter by operation type",children:[h.jsx("option",{value:"",children:"All types"}),Object.entries(Ng).map(([x,O])=>h.jsxs("option",{value:x,title:O,children:[x," — ",O]},x))]}),h.jsxs("select",{className:"input",value:r,onChange:x=>n(x.target.value),children:[h.jsx("option",{value:"",children:"All statuses"}),h.jsx("option",{value:"success",children:"success"}),h.jsx("option",{value:"error",children:"error"}),h.jsx("option",{value:"in_progress",children:"in_progress"})]}),h.jsx("input",{className:"input mono",placeholder:"Filter by Operation ID...",value:i,onChange:x=>a(x.target.value),style:{minWidth:240,flex:1}}),h.jsxs("span",{style:{fontSize:11,color:"var(--text-dim)"},children:[p," total"]})]}),h.jsxs("div",{style:{display:"flex",gap:14,flexWrap:"wrap",marginBottom:10,padding:"6px 12px",borderRadius:6,background:"rgba(255,255,255,.02)",border:"1px solid var(--border)",fontSize:10,color:"var(--text-muted)",alignItems:"center"},children:[h.jsx("span",{style:{fontSize:9,fontWeight:700,letterSpacing:".06em",textTransform:"uppercase",color:"var(--text-dim)",marginRight:2},children:"Phases"}),$N.map(({phase:x,label:O,color:_})=>h.jsxs("span",{title:Jn[x]??"",style:{display:"inline-flex",alignItems:"center",gap:4,cursor:"default"},children:[h.jsx("span",{style:{width:7,height:7,borderRadius:2,background:_,display:"inline-block",flexShrink:0}}),O]},x))]}),h.jsx("div",{className:"card",style:{padding:0,overflow:"hidden"},children:y.length===0?h.jsxs("div",{className:"empty-state empty-state--rich",style:{margin:16},children:[h.jsx("div",{className:"empty-state-icon",children:h.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}),h.jsx("div",{className:"empty-state-title",children:"No operations recorded"}),h.jsx("div",{className:"empty-state-desc",children:"Operations will appear here as your node processes publish, query, and other DKG requests."})]}):h.jsxs("table",{className:"data-table",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Time"}),h.jsx("th",{children:"Type"}),h.jsx("th",{children:"Status"}),h.jsx("th",{children:"Phases"}),h.jsx("th",{children:"Duration"}),h.jsx("th",{children:"Cost (ETH)"}),h.jsx("th",{children:"TX"}),h.jsx("th",{children:"Operation ID"})]})}),h.jsx("tbody",{children:y.map(x=>h.jsxs("tr",{onClick:()=>s(x.operation_id),style:{cursor:"pointer",background:o===x.operation_id?"rgba(59,130,246,.1)":void 0},children:[h.jsx("td",{title:x.started_at?new Date(x.started_at).toLocaleString():void 0,children:vt(x.started_at)}),h.jsx("td",{children:h.jsx("span",{className:"badge",title:Ng[x.operation_name]??"",style:{background:`${rt[x.operation_name]??"var(--text-muted)"}22`,color:rt[x.operation_name]??"var(--text-muted)"},children:x.operation_name})}),h.jsx("td",{children:h.jsx(pa,{status:x.status})}),h.jsx("td",{children:h.jsx(WN,{phases:x.phases,totalMs:x.duration_ms})}),h.jsx("td",{children:lt(x.duration_ms)}),h.jsx("td",{children:x.gas_cost_eth!=null?x.gas_cost_eth.toFixed(6):"—"}),h.jsx("td",{children:x.tx_hash?h.jsx("a",{href:m?`${m}/tx/${x.tx_hash}`:"#",target:"_blank",rel:"noopener noreferrer",onClick:O=>O.stopPropagation(),title:x.tx_hash,className:"tx-link-icon",children:h.jsx(ZN,{})}):"—"}),h.jsxs("td",{className:"mono",children:[gi(x.operation_id)," ",h.jsx(sd,{text:x.operation_id})]})]},x.operation_id))})]})}),g>1&&h.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 0",fontSize:11,color:"var(--text-muted)"},children:[h.jsxs("span",{children:["Showing ",u*ln+1,"–",Math.min((u+1)*ln,p)," of ",p]}),h.jsxs("div",{style:{display:"flex",gap:4},children:[h.jsx("button",{disabled:u===0,onClick:()=>c(0),style:{padding:"4px 8px",borderRadius:4,fontSize:11,fontWeight:600,cursor:u===0?"default":"pointer",border:"1px solid var(--border)",background:"var(--surface)",color:u===0?"var(--text-dim)":"var(--text-muted)",opacity:u===0?.4:1},children:"««"}),h.jsx("button",{disabled:u===0,onClick:()=>c(x=>Math.max(0,x-1)),style:{padding:"4px 10px",borderRadius:4,fontSize:11,fontWeight:600,cursor:u===0?"default":"pointer",border:"1px solid var(--border)",background:"var(--surface)",color:u===0?"var(--text-dim)":"var(--text-muted)",opacity:u===0?.4:1},children:"‹ Prev"}),h.jsxs("span",{style:{padding:"4px 10px",fontSize:11,fontWeight:600},children:["Page ",u+1," / ",g]}),h.jsx("button",{disabled:u>=g-1,onClick:()=>c(x=>Math.min(g-1,x+1)),style:{padding:"4px 10px",borderRadius:4,fontSize:11,fontWeight:600,cursor:u>=g-1?"default":"pointer",border:"1px solid var(--border)",background:"var(--surface)",color:u>=g-1?"var(--text-dim)":"var(--text-muted)",opacity:u>=g-1?.4:1},children:"Next ›"}),h.jsx("button",{disabled:u>=g-1,onClick:()=>c(g-1),style:{padding:"4px 8px",borderRadius:4,fontSize:11,fontWeight:600,cursor:u>=g-1?"default":"pointer",border:"1px solid var(--border)",background:"var(--surface)",color:u>=g-1?"var(--text-dim)":"var(--text-muted)",opacity:u>=g-1?.4:1},children:"»»"})]})]}),o&&h.jsxs(h.Fragment,{children:[h.jsx("div",{onClick:()=>s(null),style:{position:"fixed",inset:0,background:"rgba(0,0,0,.4)",zIndex:900,animation:"fadeIn .15s ease-out"}}),h.jsx("div",{style:{position:"fixed",top:0,right:0,bottom:0,width:"55%",minWidth:480,maxWidth:800,background:"var(--bg)",borderLeft:"1px solid var(--border)",zIndex:901,overflowY:"auto",padding:"20px 24px",boxShadow:"-8px 0 30px rgba(0,0,0,.3)",animation:"slideInRight .2s ease-out"},children:d!=null&&d.operation?h.jsx(HN,{op:d.operation,logs:d.logs,phases:d.phases??[],explorerUrl:m,onBack:()=>s(null)}):h.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"Loading..."})}),h.jsx("style",{children:`
69
69
  @keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
70
70
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
71
- `})]})]})}function GN({phases:e,op:t}){if(!e.length)return null;const r=t.started_at,n=r+(t.duration_ms||0),i=n-r;if(i<=0)return null;const a=o=>new Date(o).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:1});return h.jsxs("div",{children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:9,color:"var(--text-dim)",marginBottom:4,fontFamily:"'JetBrains Mono', monospace"},children:[h.jsx("span",{children:a(r)}),h.jsx("span",{children:lt(i)}),h.jsx("span",{children:a(n)})]}),h.jsx("div",{style:{position:"relative",background:"rgba(255,255,255,.03)",borderRadius:6,border:"1px solid var(--border)",padding:"6px 0"},children:e.map((o,s)=>{const u=o.started_at??r,c=o.duration_ms??0,f=Math.max(0,(u-r)/i*100),l=Math.max(1.5,c/i*100),d=o.status==="error",v=o.status==="in_progress",m=d?"#ef4444":v?"#f59e0b":nr[o.phase]??ir;return h.jsxs("div",{style:{display:"flex",alignItems:"center",height:22,padding:"0 8px",position:"relative"},children:[h.jsx("div",{style:{width:140,minWidth:140,fontSize:10,fontWeight:600,color:m,flexShrink:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:o.phase,children:o.phase}),h.jsx("div",{style:{flex:1,position:"relative",height:12},children:h.jsx("div",{title:`${o.phase}: ${lt(c)}${d?" — FAILED: "+(o.details??""):""}`,style:{position:"absolute",left:`${f}%`,width:`${Math.min(l,100-f)}%`,height:"100%",borderRadius:3,opacity:v?.7:1,transition:"width .3s ease",background:d?"repeating-linear-gradient(45deg, #ef4444, #ef4444 3px, #b91c1c 3px, #b91c1c 6px)":m}})}),h.jsx("div",{style:{width:55,textAlign:"right",fontSize:10,color:"var(--text-dim)",fontFamily:"'JetBrains Mono', monospace",flexShrink:0,marginLeft:8},children:lt(c)})]},`${o.phase}-${s}`)})}),h.jsxs("div",{style:{display:"flex",gap:12,marginTop:6,fontSize:9,color:"var(--text-dim)"},children:[e.some(o=>o.status==="success")&&h.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3},children:[h.jsx("span",{style:{width:8,height:8,borderRadius:2,background:"var(--green-mid)",display:"inline-block"}})," Success"]}),e.some(o=>o.status==="error")&&h.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3},children:[h.jsx("span",{style:{width:8,height:8,borderRadius:2,background:"var(--red)",display:"inline-block"}})," Failed"]}),e.some(o=>o.status==="in_progress")&&h.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3},children:[h.jsx("span",{style:{width:8,height:8,borderRadius:2,background:"var(--amber)",display:"inline-block"}})," In Progress"]})]})]})}function HN({op:e,logs:t,phases:r,explorerUrl:n,onBack:i}){return h.jsxs("div",{children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[h.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-muted)"},children:"Operation Detail"}),h.jsx("button",{onClick:i,style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-dim)",padding:4,display:"flex"},title:"Close",children:h.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),h.jsxs("div",{className:"card",style:{padding:16,marginBottom:12},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",marginBottom:10},children:[h.jsx("span",{style:{fontSize:15,fontWeight:700},children:e.operation_name}),h.jsx(pa,{status:e.status}),h.jsx("span",{style:{fontSize:12,color:"var(--text-dim)"},children:lt(e.duration_ms)}),h.jsxs("span",{style:{fontSize:11,color:"var(--text-dim)",fontFamily:"'JetBrains Mono', monospace"},children:[e.operation_id," ",h.jsx(sd,{text:e.operation_id})]})]}),h.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",fontSize:12,color:"var(--text-muted)"},children:[h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"Started"})," ",new Date(e.started_at).toLocaleString()]}),e.contextGraph_id&&h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"Context Graph"})," ",e.contextGraph_id]}),e.triple_count!=null&&h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"Triples"})," ",e.triple_count]}),e.peer_id&&h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"Peer"})," ",h.jsx("span",{className:"mono",children:gi(e.peer_id)})]}),e.gas_cost_eth!=null&&h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"Gas"})," ",e.gas_cost_eth.toFixed(6)," ETH"]}),e.trac_cost!=null&&h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"TRAC"})," ",e.trac_cost.toFixed(4)]}),e.tx_hash&&h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"TX"})," ",n?h.jsx("a",{href:`${n}/tx/${e.tx_hash}`,target:"_blank",rel:"noopener noreferrer",className:"mono",children:gi(e.tx_hash)}):h.jsx("span",{className:"mono",children:gi(e.tx_hash)})]})]}),e.error_message&&h.jsx("div",{style:{marginTop:8,padding:"8px 12px",background:"rgba(239,68,68,.1)",borderRadius:6,border:"1px solid rgba(239,68,68,.2)",fontSize:12,color:"var(--red)"},children:e.error_message})]}),r.length>0&&h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,marginBottom:12},children:[h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",style:{marginBottom:10},children:"Phase Timeline"}),h.jsx(GN,{phases:r,op:e})]}),h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",style:{marginBottom:10},children:"Phase Details"}),h.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:r.map((a,o)=>{const s=nr[a.phase]??ir,u=a.phase.includes(":")?a.phase.split(":")[0]:a.phase,c=Jn[a.phase]??Jn[u];return h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 10px",background:"rgba(255,255,255,.02)",borderRadius:6,borderLeft:`3px solid ${a.status==="error"?"var(--red)":s}`},children:[h.jsx("span",{style:{fontWeight:600,fontSize:12,color:s,minWidth:65},title:c??"",children:a.phase}),h.jsx(pa,{status:a.status}),h.jsx("span",{style:{fontSize:11,color:"var(--text-dim)",fontFamily:"'JetBrains Mono', monospace"},children:lt(a.duration_ms)}),c&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",fontStyle:"italic",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",marginLeft:"auto",flexShrink:0},title:a.started_at?new Date(a.started_at).toLocaleString():void 0,children:a.started_at?vt(a.started_at):""}),a.status==="error"&&a.details&&h.jsx("span",{style:{fontSize:10,color:"var(--red)",maxWidth:200,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:a.details,children:a.details})]},`${a.phase}-${o}`)})})]})]}),h.jsxs("div",{className:"card",style:{padding:0,overflow:"hidden"},children:[h.jsx("div",{style:{padding:"10px 16px",borderBottom:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:h.jsxs("span",{className:"card-title",style:{margin:0},children:["Logs (",t.length,")"]})}),t.length===0?h.jsxs("div",{className:"empty-state empty-state--compact",children:[h.jsx("div",{className:"empty-state-icon",children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),h.jsx("polyline",{points:"14 2 14 8 20 8"}),h.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),h.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),h.jsx("div",{className:"empty-state-title",children:"No logs available"}),h.jsx("div",{className:"empty-state-desc",children:"This operation has no log entries recorded."})]}):h.jsx(Xx,{maxHeight:350,children:t.map(a=>h.jsx(Vx,{ts:a.ts,level:a.level,module:a.module,message:a.message},a.id))})]})]})}function Hx(e){return/\[ERROR\]/.test(e)||/\berror\b/i.test(e.slice(0,60))?"error":/\[WARN\]/.test(e)||/\bwarn\b/i.test(e.slice(0,60))?"warn":"info"}function KN(){const[e,t]=$.useState(""),[r,n]=$.useState(""),[i,a]=$.useState(500),[o,s]=$.useState(!0),[u,c]=$.useState("all"),[f,l]=$.useState(3e3),d=$.useRef(null);$.useEffect(()=>{const _=setTimeout(()=>n(e),300);return()=>clearTimeout(_)},[e]);const{data:v,loading:m,refresh:y}=Re(()=>i1({lines:i,q:r||void 0}),[i,r],f),p=$.useMemo(()=>v!=null&&v.lines?u==="all"?v.lines:v.lines.filter(_=>{const b=Hx(_);return u==="error"?b==="error":b==="error"||b==="warn"}):[],[v==null?void 0:v.lines,u]);$.useEffect(()=>{o&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[p,o]);const g=$.useCallback(()=>{if(!d.current)return;const{scrollTop:_,scrollHeight:b,clientHeight:w}=d.current,S=b-_-w<40;s(S)},[]),x=_=>_<1024?`${_} B`:_<1024*1024?`${(_/1024).toFixed(1)} KB`:`${(_/(1024*1024)).toFixed(1)} MB`,O=_=>{if(!r)return _;const b=_.toLowerCase().indexOf(r.toLowerCase());return b===-1?_:h.jsxs(h.Fragment,{children:[_.slice(0,b),h.jsx("mark",{style:{background:"var(--amber)",color:"var(--bg)",borderRadius:2,padding:"0 1px"},children:_.slice(b,b+r.length)}),_.slice(b+r.length)]})};return h.jsxs("div",{children:[h.jsxs("div",{className:"filters",style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginBottom:12},children:[h.jsx("input",{className:"input",placeholder:"Search node log...",value:e,onChange:_=>t(_.target.value),style:{flex:1,minWidth:200}}),h.jsxs("select",{className:"input",value:u,onChange:_=>c(_.target.value),children:[h.jsx("option",{value:"all",children:"All levels"}),h.jsx("option",{value:"warn",children:"Warnings + Errors"}),h.jsx("option",{value:"error",children:"Errors only"})]}),h.jsxs("select",{className:"input",value:i,onChange:_=>a(Number(_.target.value)),children:[h.jsx("option",{value:200,children:"200 lines"}),h.jsx("option",{value:500,children:"500 lines"}),h.jsx("option",{value:1e3,children:"1,000 lines"}),h.jsx("option",{value:3e3,children:"3,000 lines"}),h.jsx("option",{value:5e3,children:"5,000 lines"})]}),h.jsxs("select",{className:"input",value:f,onChange:_=>l(Number(_.target.value)),children:[h.jsx("option",{value:1e3,children:"1s refresh"}),h.jsx("option",{value:3e3,children:"3s refresh"}),h.jsx("option",{value:5e3,children:"5s refresh"}),h.jsx("option",{value:1e4,children:"10s refresh"}),h.jsx("option",{value:0,children:"Paused"})]}),h.jsxs("button",{onClick:y,title:"Refresh now",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"5px 10px",borderRadius:6,border:"1px solid var(--border)",background:"var(--surface)",color:"var(--text-muted)",fontSize:11,fontWeight:600,cursor:"pointer",transition:"all .15s"},onMouseEnter:_=>{_.currentTarget.style.borderColor="var(--green)",_.currentTarget.style.color="var(--green)"},onMouseLeave:_=>{_.currentTarget.style.borderColor="var(--border)",_.currentTarget.style.color="var(--text-muted)"},children:[h.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("polyline",{points:"23 4 23 10 17 10"}),h.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),"Refresh"]}),h.jsxs("button",{onClick:()=>s(_=>!_),title:o?"Auto-scroll enabled":"Auto-scroll disabled",style:{display:"inline-flex",alignItems:"center",gap:5,padding:"5px 10px",borderRadius:6,border:`1px solid ${o?"rgba(74,222,128,.3)":"var(--border)"}`,background:o?"var(--green-dim)":"var(--surface)",color:o?"var(--green)":"var(--text-muted)",fontSize:11,fontWeight:600,cursor:"pointer",transition:"all .15s"},children:[h.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),h.jsx("polyline",{points:"19 12 12 19 5 12"})]}),"Auto-scroll"]})]}),h.jsxs("div",{style:{borderRadius:10,overflow:"hidden",border:"1px solid rgba(139,92,246,.15)",boxShadow:"0 0 40px rgba(139,92,246,.04)"},children:[h.jsxs("div",{style:{padding:"8px 16px",background:"linear-gradient(135deg, rgba(139,92,246,.08) 0%, rgba(59,130,246,.05) 100%)",borderBottom:"1px solid rgba(139,92,246,.12)",fontSize:11,color:"var(--text-muted)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsxs("span",{children:[p.length," lines",r?` matching "${r}"`:"",m?h.jsx("span",{style:{marginLeft:6,color:"var(--purple)",fontSize:10},children:"refreshing..."}):""]}),h.jsxs("span",{className:"mono",style:{fontSize:10,color:"rgba(139,92,246,.6)"},children:["daemon.log ",v!=null&&v.totalSize?`(${x(v.totalSize)})`:""]})]}),h.jsx("div",{ref:d,onScroll:g,style:{height:"calc(100vh - 240px)",minHeight:500,overflowY:"auto",padding:"8px 0",background:"linear-gradient(180deg, rgba(13,17,23,1) 0%, rgba(20,15,35,1) 50%, rgba(13,17,23,1) 100%)",fontFamily:Kx,fontSize:10.5,lineHeight:1.5},children:p.length===0?h.jsx("div",{className:"empty-state empty-state--compact",children:m?h.jsx("div",{className:"empty-state-desc",children:"Loading..."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"empty-state-icon",children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),h.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),h.jsx("div",{className:"empty-state-title",children:"No log lines found"}),h.jsx("div",{className:"empty-state-desc",children:"Try adjusting the search filters or check back later."})]})}):p.map((_,b)=>h.jsx(YN,{line:_,lineNum:b+1,highlight:r?O:void 0},b))})]})]})}const Kx='"SF Mono", "Consolas", "Liberation Mono", "Menlo", monospace',Fe={timestamp:"#6e7681",module:"#79c0ff",levelError:"#f85149",levelWarn:"#d29922",levelInfo:"#8b949e",message:"#c9d1d9",bg:"#0d1117"};function Vx({ts:e,level:t,module:r,message:n}){const i=t==="error"?Fe.levelError:t==="warn"?Fe.levelWarn:Fe.levelInfo;return h.jsxs("div",{style:{padding:"1px 12px",whiteSpace:"pre-wrap",wordBreak:"break-all",background:t==="error"?"rgba(248,81,73,.08)":void 0},children:[h.jsx("span",{style:{color:Fe.timestamp,marginRight:6},children:vt(e)}),h.jsx("span",{style:{color:i,fontWeight:600,marginRight:6},children:t.toUpperCase().padEnd(5)}),h.jsxs("span",{style:{color:Fe.module,marginRight:6},children:["[",r,"]"]}),h.jsx("span",{style:{color:Fe.message},children:n})]})}function Xx({children:e,maxHeight:t=300}){return h.jsx("div",{style:{maxHeight:t,overflowY:"auto",background:Fe.bg,borderRadius:6,padding:"6px 0",fontFamily:Kx,fontSize:10.5,lineHeight:1.5},children:e})}const VN=/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (\S+) (\S+) \[([^\]]+)\] (.*)$/;function XN(e){const t=VN.exec(e);return t?{ts:t[1],opName:t[2],opId:t[3],module:t[4],message:t[5]}:null}function YN({line:e,lineNum:t,highlight:r}){const n=XN(e),i=Hx(e),a=i==="error"?"rgba(248,81,73,.08)":void 0;if(!n){const s=i==="error"?Fe.levelError:i==="warn"?Fe.levelWarn:Fe.message;return h.jsxs("div",{style:{padding:"0 16px",color:s,whiteSpace:"pre-wrap",wordBreak:"break-all",background:a},children:[h.jsx("span",{style:{color:"var(--text-dim)",userSelect:"none",marginRight:8,display:"inline-block",width:40,textAlign:"right"},children:t}),r?r(e):e]})}const o=rt[n.opName]??"var(--text-muted)";return h.jsxs("div",{style:{padding:"0 16px",whiteSpace:"pre-wrap",wordBreak:"break-all",background:a},children:[h.jsx("span",{style:{color:"var(--text-dim)",userSelect:"none",marginRight:8,display:"inline-block",width:40,textAlign:"right"},children:t}),h.jsx("span",{style:{color:Fe.timestamp},children:n.ts})," ",h.jsx("span",{style:{color:o,fontWeight:600},children:n.opName})," ",h.jsx("span",{style:{color:"var(--text-dim)"},children:n.opId.slice(0,8)})," ",h.jsxs("span",{style:{color:Fe.module},children:["[",n.module,"]"]})," ",h.jsx("span",{style:{color:Fe.message},children:r?r(n.message):n.message})]})}function pa({status:e}){const t=e==="success"?"badge-success":e==="error"?"badge-error":"badge-warning";return h.jsx("span",{className:`badge ${t}`,children:e})}function sd({text:e}){const[t,r]=$.useState(!1),n=$.useCallback(i=>{i.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})},[e]);return h.jsx("button",{onClick:n,title:"Copy to clipboard",style:{background:"none",border:"none",cursor:"pointer",padding:"1px 3px",color:t?"var(--green)":"var(--text-dim)",fontSize:11,display:"inline-flex",alignItems:"center",verticalAlign:"middle",transition:"color .15s"},children:t?h.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("polyline",{points:"20 6 9 17 4 12"})}):h.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),h.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}function ZN(){return h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),h.jsx("polyline",{points:"15 3 21 3 21 9"}),h.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}export{NN as ObservabilitySection,eR as OperationsPage};
71
+ `})]})]})}function GN({phases:e,op:t}){if(!e.length)return null;const r=t.started_at,n=r+(t.duration_ms||0),i=n-r;if(i<=0)return null;const a=o=>new Date(o).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:1});return h.jsxs("div",{children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:9,color:"var(--text-dim)",marginBottom:4,fontFamily:"'JetBrains Mono', monospace"},children:[h.jsx("span",{children:a(r)}),h.jsx("span",{children:lt(i)}),h.jsx("span",{children:a(n)})]}),h.jsx("div",{style:{position:"relative",background:"rgba(255,255,255,.03)",borderRadius:6,border:"1px solid var(--border)",padding:"6px 0"},children:e.map((o,s)=>{const u=o.started_at??r,c=o.duration_ms??0,f=Math.max(0,(u-r)/i*100),l=Math.max(1.5,c/i*100),d=o.status==="error",v=o.status==="in_progress",m=d?"#ef4444":v?"#f59e0b":nr[o.phase]??ir;return h.jsxs("div",{style:{display:"flex",alignItems:"center",height:22,padding:"0 8px",position:"relative"},children:[h.jsx("div",{style:{width:140,minWidth:140,fontSize:10,fontWeight:600,color:m,flexShrink:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:o.phase,children:o.phase}),h.jsx("div",{style:{flex:1,position:"relative",height:12},children:h.jsx("div",{title:`${o.phase}: ${lt(c)}${d?" — FAILED: "+(o.details??""):""}`,style:{position:"absolute",left:`${f}%`,width:`${Math.min(l,100-f)}%`,height:"100%",borderRadius:3,opacity:v?.7:1,transition:"width .3s ease",background:d?"repeating-linear-gradient(45deg, #ef4444, #ef4444 3px, #b91c1c 3px, #b91c1c 6px)":m}})}),h.jsx("div",{style:{width:55,textAlign:"right",fontSize:10,color:"var(--text-dim)",fontFamily:"'JetBrains Mono', monospace",flexShrink:0,marginLeft:8},children:lt(c)})]},`${o.phase}-${s}`)})}),h.jsxs("div",{style:{display:"flex",gap:12,marginTop:6,fontSize:9,color:"var(--text-dim)"},children:[e.some(o=>o.status==="success")&&h.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3},children:[h.jsx("span",{style:{width:8,height:8,borderRadius:2,background:"var(--green-mid)",display:"inline-block"}})," Success"]}),e.some(o=>o.status==="error")&&h.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3},children:[h.jsx("span",{style:{width:8,height:8,borderRadius:2,background:"var(--red)",display:"inline-block"}})," Failed"]}),e.some(o=>o.status==="in_progress")&&h.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3},children:[h.jsx("span",{style:{width:8,height:8,borderRadius:2,background:"var(--amber)",display:"inline-block"}})," In Progress"]})]})]})}function HN({op:e,logs:t,phases:r,explorerUrl:n,onBack:i}){return h.jsxs("div",{children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[h.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-muted)"},children:"Operation Detail"}),h.jsx("button",{onClick:i,style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-dim)",padding:4,display:"flex"},title:"Close",children:h.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),h.jsxs("div",{className:"card",style:{padding:16,marginBottom:12},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",marginBottom:10},children:[h.jsx("span",{style:{fontSize:15,fontWeight:700},children:e.operation_name}),h.jsx(pa,{status:e.status}),h.jsx("span",{style:{fontSize:12,color:"var(--text-dim)"},children:lt(e.duration_ms)}),h.jsxs("span",{style:{fontSize:11,color:"var(--text-dim)",fontFamily:"'JetBrains Mono', monospace"},children:[e.operation_id," ",h.jsx(sd,{text:e.operation_id})]})]}),h.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",fontSize:12,color:"var(--text-muted)"},children:[h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"Started"})," ",new Date(e.started_at).toLocaleString()]}),e.contextGraph_id&&h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"Context Graph"})," ",e.contextGraph_id]}),e.triple_count!=null&&h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"Triples"})," ",e.triple_count]}),e.peer_id&&h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"Peer"})," ",h.jsx("span",{className:"mono",children:gi(e.peer_id)})]}),e.gas_cost_eth!=null&&h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"Gas"})," ",e.gas_cost_eth.toFixed(6)," ETH"]}),e.trac_cost!=null&&h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"TRAC"})," ",e.trac_cost.toFixed(4)]}),e.tx_hash&&h.jsxs("span",{children:[h.jsx("b",{style:{color:"var(--text-muted)"},children:"TX"})," ",n?h.jsx("a",{href:`${n}/tx/${e.tx_hash}`,target:"_blank",rel:"noopener noreferrer",className:"mono",children:gi(e.tx_hash)}):h.jsx("span",{className:"mono",children:gi(e.tx_hash)})]})]}),e.error_message&&h.jsx("div",{style:{marginTop:8,padding:"8px 12px",background:"rgba(239,68,68,.1)",borderRadius:6,border:"1px solid rgba(239,68,68,.2)",fontSize:12,color:"var(--red)"},children:e.error_message})]}),r.length>0&&h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,marginBottom:12},children:[h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",style:{marginBottom:10},children:"Phase Timeline"}),h.jsx(GN,{phases:r,op:e})]}),h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{className:"card-title",style:{marginBottom:10},children:"Phase Details"}),h.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:r.map((a,o)=>{const s=nr[a.phase]??ir,u=a.phase.includes(":")?a.phase.split(":")[0]:a.phase,c=Jn[a.phase]??Jn[u];return h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 10px",background:"rgba(255,255,255,.02)",borderRadius:6,borderLeft:`3px solid ${a.status==="error"?"var(--red)":s}`},children:[h.jsx("span",{style:{fontWeight:600,fontSize:12,color:s,minWidth:65},title:c??"",children:a.phase}),h.jsx(pa,{status:a.status}),h.jsx("span",{style:{fontSize:11,color:"var(--text-dim)",fontFamily:"'JetBrains Mono', monospace"},children:lt(a.duration_ms)}),c&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",fontStyle:"italic",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",marginLeft:"auto",flexShrink:0},title:a.started_at?new Date(a.started_at).toLocaleString():void 0,children:a.started_at?vt(a.started_at):""}),a.status==="error"&&a.details&&h.jsx("span",{style:{fontSize:10,color:"var(--red)",maxWidth:200,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:a.details,children:a.details})]},`${a.phase}-${o}`)})})]})]}),h.jsxs("div",{className:"card",style:{padding:0,overflow:"hidden"},children:[h.jsx("div",{style:{padding:"10px 16px",borderBottom:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:h.jsxs("span",{className:"card-title",style:{margin:0},children:["Logs (",t.length,")"]})}),t.length===0?h.jsxs("div",{className:"empty-state empty-state--compact",children:[h.jsx("div",{className:"empty-state-icon",children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),h.jsx("polyline",{points:"14 2 14 8 20 8"}),h.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),h.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),h.jsx("div",{className:"empty-state-title",children:"No logs available"}),h.jsx("div",{className:"empty-state-desc",children:"This operation has no log entries recorded."})]}):h.jsx(Xx,{maxHeight:350,children:t.map(a=>h.jsx(Vx,{ts:a.ts,level:a.level,module:a.module,message:a.message},a.id))})]})]})}function Hx(e){return/\[ERROR\]/.test(e)||/\berror\b/i.test(e.slice(0,60))?"error":/\[WARN\]/.test(e)||/\bwarn\b/i.test(e.slice(0,60))?"warn":"info"}function KN(){const[e,t]=$.useState(""),[r,n]=$.useState(""),[i,a]=$.useState(500),[o,s]=$.useState(!0),[u,c]=$.useState("all"),[f,l]=$.useState(3e3),d=$.useRef(null);$.useEffect(()=>{const _=setTimeout(()=>n(e),300);return()=>clearTimeout(_)},[e]);const{data:v,loading:m,refresh:y}=Re(()=>c1({lines:i,q:r||void 0}),[i,r],f),p=$.useMemo(()=>v!=null&&v.lines?u==="all"?v.lines:v.lines.filter(_=>{const b=Hx(_);return u==="error"?b==="error":b==="error"||b==="warn"}):[],[v==null?void 0:v.lines,u]);$.useEffect(()=>{o&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[p,o]);const g=$.useCallback(()=>{if(!d.current)return;const{scrollTop:_,scrollHeight:b,clientHeight:w}=d.current,S=b-_-w<40;s(S)},[]),x=_=>_<1024?`${_} B`:_<1024*1024?`${(_/1024).toFixed(1)} KB`:`${(_/(1024*1024)).toFixed(1)} MB`,O=_=>{if(!r)return _;const b=_.toLowerCase().indexOf(r.toLowerCase());return b===-1?_:h.jsxs(h.Fragment,{children:[_.slice(0,b),h.jsx("mark",{style:{background:"var(--amber)",color:"var(--bg)",borderRadius:2,padding:"0 1px"},children:_.slice(b,b+r.length)}),_.slice(b+r.length)]})};return h.jsxs("div",{children:[h.jsxs("div",{className:"filters",style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginBottom:12},children:[h.jsx("input",{className:"input",placeholder:"Search node log...",value:e,onChange:_=>t(_.target.value),style:{flex:1,minWidth:200}}),h.jsxs("select",{className:"input",value:u,onChange:_=>c(_.target.value),children:[h.jsx("option",{value:"all",children:"All levels"}),h.jsx("option",{value:"warn",children:"Warnings + Errors"}),h.jsx("option",{value:"error",children:"Errors only"})]}),h.jsxs("select",{className:"input",value:i,onChange:_=>a(Number(_.target.value)),children:[h.jsx("option",{value:200,children:"200 lines"}),h.jsx("option",{value:500,children:"500 lines"}),h.jsx("option",{value:1e3,children:"1,000 lines"}),h.jsx("option",{value:3e3,children:"3,000 lines"}),h.jsx("option",{value:5e3,children:"5,000 lines"})]}),h.jsxs("select",{className:"input",value:f,onChange:_=>l(Number(_.target.value)),children:[h.jsx("option",{value:1e3,children:"1s refresh"}),h.jsx("option",{value:3e3,children:"3s refresh"}),h.jsx("option",{value:5e3,children:"5s refresh"}),h.jsx("option",{value:1e4,children:"10s refresh"}),h.jsx("option",{value:0,children:"Paused"})]}),h.jsxs("button",{onClick:y,title:"Refresh now",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"5px 10px",borderRadius:6,border:"1px solid var(--border)",background:"var(--surface)",color:"var(--text-muted)",fontSize:11,fontWeight:600,cursor:"pointer",transition:"all .15s"},onMouseEnter:_=>{_.currentTarget.style.borderColor="var(--green)",_.currentTarget.style.color="var(--green)"},onMouseLeave:_=>{_.currentTarget.style.borderColor="var(--border)",_.currentTarget.style.color="var(--text-muted)"},children:[h.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("polyline",{points:"23 4 23 10 17 10"}),h.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),"Refresh"]}),h.jsxs("button",{onClick:()=>s(_=>!_),title:o?"Auto-scroll enabled":"Auto-scroll disabled",style:{display:"inline-flex",alignItems:"center",gap:5,padding:"5px 10px",borderRadius:6,border:`1px solid ${o?"rgba(74,222,128,.3)":"var(--border)"}`,background:o?"var(--green-dim)":"var(--surface)",color:o?"var(--green)":"var(--text-muted)",fontSize:11,fontWeight:600,cursor:"pointer",transition:"all .15s"},children:[h.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),h.jsx("polyline",{points:"19 12 12 19 5 12"})]}),"Auto-scroll"]})]}),h.jsxs("div",{style:{borderRadius:10,overflow:"hidden",border:"1px solid rgba(139,92,246,.15)",boxShadow:"0 0 40px rgba(139,92,246,.04)"},children:[h.jsxs("div",{style:{padding:"8px 16px",background:"linear-gradient(135deg, rgba(139,92,246,.08) 0%, rgba(59,130,246,.05) 100%)",borderBottom:"1px solid rgba(139,92,246,.12)",fontSize:11,color:"var(--text-muted)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsxs("span",{children:[p.length," lines",r?` matching "${r}"`:"",m?h.jsx("span",{style:{marginLeft:6,color:"var(--purple)",fontSize:10},children:"refreshing..."}):""]}),h.jsxs("span",{className:"mono",style:{fontSize:10,color:"rgba(139,92,246,.6)"},children:["daemon.log ",v!=null&&v.totalSize?`(${x(v.totalSize)})`:""]})]}),h.jsx("div",{ref:d,onScroll:g,style:{height:"calc(100vh - 240px)",minHeight:500,overflowY:"auto",padding:"8px 0",background:"linear-gradient(180deg, rgba(13,17,23,1) 0%, rgba(20,15,35,1) 50%, rgba(13,17,23,1) 100%)",fontFamily:Kx,fontSize:10.5,lineHeight:1.5},children:p.length===0?h.jsx("div",{className:"empty-state empty-state--compact",children:m?h.jsx("div",{className:"empty-state-desc",children:"Loading..."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"empty-state-icon",children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),h.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),h.jsx("div",{className:"empty-state-title",children:"No log lines found"}),h.jsx("div",{className:"empty-state-desc",children:"Try adjusting the search filters or check back later."})]})}):p.map((_,b)=>h.jsx(YN,{line:_,lineNum:b+1,highlight:r?O:void 0},b))})]})]})}const Kx='"SF Mono", "Consolas", "Liberation Mono", "Menlo", monospace',Fe={timestamp:"#6e7681",module:"#79c0ff",levelError:"#f85149",levelWarn:"#d29922",levelInfo:"#8b949e",message:"#c9d1d9",bg:"#0d1117"};function Vx({ts:e,level:t,module:r,message:n}){const i=t==="error"?Fe.levelError:t==="warn"?Fe.levelWarn:Fe.levelInfo;return h.jsxs("div",{style:{padding:"1px 12px",whiteSpace:"pre-wrap",wordBreak:"break-all",background:t==="error"?"rgba(248,81,73,.08)":void 0},children:[h.jsx("span",{style:{color:Fe.timestamp,marginRight:6},children:vt(e)}),h.jsx("span",{style:{color:i,fontWeight:600,marginRight:6},children:t.toUpperCase().padEnd(5)}),h.jsxs("span",{style:{color:Fe.module,marginRight:6},children:["[",r,"]"]}),h.jsx("span",{style:{color:Fe.message},children:n})]})}function Xx({children:e,maxHeight:t=300}){return h.jsx("div",{style:{maxHeight:t,overflowY:"auto",background:Fe.bg,borderRadius:6,padding:"6px 0",fontFamily:Kx,fontSize:10.5,lineHeight:1.5},children:e})}const VN=/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (\S+) (\S+) \[([^\]]+)\] (.*)$/;function XN(e){const t=VN.exec(e);return t?{ts:t[1],opName:t[2],opId:t[3],module:t[4],message:t[5]}:null}function YN({line:e,lineNum:t,highlight:r}){const n=XN(e),i=Hx(e),a=i==="error"?"rgba(248,81,73,.08)":void 0;if(!n){const s=i==="error"?Fe.levelError:i==="warn"?Fe.levelWarn:Fe.message;return h.jsxs("div",{style:{padding:"0 16px",color:s,whiteSpace:"pre-wrap",wordBreak:"break-all",background:a},children:[h.jsx("span",{style:{color:"var(--text-dim)",userSelect:"none",marginRight:8,display:"inline-block",width:40,textAlign:"right"},children:t}),r?r(e):e]})}const o=rt[n.opName]??"var(--text-muted)";return h.jsxs("div",{style:{padding:"0 16px",whiteSpace:"pre-wrap",wordBreak:"break-all",background:a},children:[h.jsx("span",{style:{color:"var(--text-dim)",userSelect:"none",marginRight:8,display:"inline-block",width:40,textAlign:"right"},children:t}),h.jsx("span",{style:{color:Fe.timestamp},children:n.ts})," ",h.jsx("span",{style:{color:o,fontWeight:600},children:n.opName})," ",h.jsx("span",{style:{color:"var(--text-dim)"},children:n.opId.slice(0,8)})," ",h.jsxs("span",{style:{color:Fe.module},children:["[",n.module,"]"]})," ",h.jsx("span",{style:{color:Fe.message},children:r?r(n.message):n.message})]})}function pa({status:e}){const t=e==="success"?"badge-success":e==="error"?"badge-error":"badge-warning";return h.jsx("span",{className:`badge ${t}`,children:e})}function sd({text:e}){const[t,r]=$.useState(!1),n=$.useCallback(i=>{i.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})},[e]);return h.jsx("button",{onClick:n,title:"Copy to clipboard",style:{background:"none",border:"none",cursor:"pointer",padding:"1px 3px",color:t?"var(--green)":"var(--text-dim)",fontSize:11,display:"inline-flex",alignItems:"center",verticalAlign:"middle",transition:"color .15s"},children:t?h.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("polyline",{points:"20 6 9 17 4 12"})}):h.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),h.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}function ZN(){return h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),h.jsx("polyline",{points:"15 3 21 3 21 9"}),h.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}export{NN as ObservabilitySection,eR as OperationsPage};