gf-components 0.1.154 → 0.1.155
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -498,7 +498,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
498
498
|
`,Cle=({pieChartData:e,title:t,isEmpty:n,sortByValue:r=!0,arcLabel:i=null,tooltip:o=null,customStyle:a={},customMargin:s={},height:l=600,legendWidth:c="50%"})=>{const[u,d]=S.useState([]),f=({centerX:m,centerY:g,dataWithArc:v})=>(u.length||d(v),p.jsx("text",{x:m,y:g,textAnchor:"middle",dominantBaseline:"central",style:{fontSize:"16px",font:"var(--gf-label-md-default)",fontWeight:400},children:n?"Data niet openbaar beschikbaar":""})),h=({data:m})=>p.jsx(tn,{gap:16,className:"gf-full",justify:"center",wrap:!0,style:{width:c},children:m==null?void 0:m.map((g,v)=>p.jsxs(tn,{gap:8,align:"center",children:[p.jsx("div",{style:{minWidth:16,minHeight:16,backgroundColor:g.color}}),p.jsx(yle,{children:g.label})]},`legend-${v}`))});return p.jsxs(p.Fragment,{children:[p.jsx(yn,{}),p.jsxs(tn,{vertical:!0,gap:8,align:"center",style:{width:"100%"},children:[p.jsx(ble,{children:t}),p.jsx("div",{style:{width:"100%",height:l},children:p.jsx(ple,{colors:n?{scheme:"greys"}:{datum:"data.color"},data:e,sortByValue:r,enableArcLabels:!n,arcLabel:m=>(i==null?void 0:i(m))||m.formattedValue,enableArcLinkLabels:!1,margin:{top:50,right:80,bottom:50,left:80,...s},innerRadius:.5,padAngle:.7,cornerRadius:3,activeOuterRadiusOffset:8,borderWidth:1,borderColor:{from:"color",modifiers:[["darker",.2]]},arcLabelsSkipAngle:10,arcLabelsTextColor:{from:"color",modifiers:[["darker",2]]},isInteractive:!n,layers:["arcs","arcLabels","arcLinkLabels","legends",f],tooltip:m=>p.jsx(Zn,{body:(o==null?void 0:o(m))||p.jsx("span",{children:"Pie chart tooltip"})})})}),!n&&p.jsx(h,{data:u})]})]})};var xle=df,wle=Ch,Sle=1,$le=2;function Mle(e,t,n,r){var i=n.length,o=i,a=!r;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var l=s[0],c=e[l],u=s[1];if(a&&s[2]){if(c===void 0&&!(l in e))return!1}else{var d=new xle;if(r)var f=r(c,u,l,e,t,d);if(!(f===void 0?wle(u,c,Sle|$le,r,d):f))return!1}}return!0}var Ele=Mle,_le=Mi;function Ole(e){return e===e&&!_le(e)}var H$=Ole,Hle=H$,Vle=M1;function Tle(e){for(var t=Vle(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Hle(i)]}return t}var Rle=Tle;function kle(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var V$=kle,Lle=Ele,jle=Rle,Ple=V$;function Ile(e){var t=jle(e);return t.length==1&&t[0][2]?Ple(t[0][0],t[0][1]):function(n){return n===e||Lle(n,e,t)}}var Ale=Ile,Nle=Ch,Fle=kw,Dle=RS,zle=N6,Ble=H$,Wle=V$,Zle=ul,Ule=1,qle=2;function Gle(e,t){return zle(e)&&Ble(t)?Wle(Zle(e),t):function(n){var r=Fle(n,e);return r===void 0&&r===t?Dle(n,e):Nle(t,r,Ule|qle)}}var Yle=Gle;function Kle(e){return function(t){return t==null?void 0:t[e]}}var Xle=Kle,Qle=C1;function Jle(e){return function(t){return Qle(t,e)}}var ece=Jle,tce=Xle,nce=ece,rce=N6,ice=ul;function oce(e){return rce(e)?tce(ice(e)):nce(e)}var ace=oce,sce=Ale,lce=Yle,cce=mf,uce=xr,dce=ace;function fce(e){return typeof e=="function"?e:e==null?cce:typeof e=="object"?uce(e)?lce(e[0],e[1]):sce(e):dce(e)}var Eh=fce,hce=Eh,gce=Mx;function vce(e,t){return e&&e.length?gce(e,hce(t)):[]}var mce=vce;const P4=xn(mce);var pce=vw,bce=M1;function yce(e,t){return e&&pce(e,t,bce)}var Cce=yce,xce=al;function wce(e,t){return function(n,r){if(n==null)return n;if(!xce(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var Sce=wce,$ce=Cce,Mce=Sce,Ece=Mce($ce),T$=Ece,_ce=T$,Oce=al;function Hce(e,t){var n=-1,r=Oce(e)?Array(e.length):[];return _ce(e,function(i,o,a){r[++n]=t(i,o,a)}),r}var Vce=Hce;function Tce(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var Rce=Tce,Xm=pf;function kce(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,o=Xm(e),a=t!==void 0,s=t===null,l=t===t,c=Xm(t);if(!s&&!c&&!o&&e>t||o&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&e<t||c&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!l)return-1}return 0}var Lce=kce,jce=Lce;function Pce(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r<a;){var l=jce(i[r],o[r]);if(l){if(r>=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return e.index-t.index}var Ice=Pce,$2=bf,Ace=C1,Nce=Eh,Fce=Vce,Dce=Rce,zce=sl,Bce=Ice,Wce=mf,Zce=xr;function Uce(e,t,n){t.length?t=$2(t,function(o){return Zce(o)?function(a){return Ace(a,o.length===1?o[0]:o)}:o}):t=[Wce];var r=-1;t=$2(t,zce(Nce));var i=Fce(e,function(o,a,s){var l=$2(t,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return Dce(i,function(o,a){return Bce(o,a,n)})}var qce=Uce,Gce=LS,Yce=qce,Kce=I6,Qm=Vw,Xce=Kce(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Qm(e,t[0],t[1])?t=[]:n>2&&Qm(t[0],t[1],t[2])&&(t=[t[0]]),Yce(e,Gce(t,1),[])}),Qce=Xce;const Jce=xn(Qce);var e1e=po,t1e=Gr,n1e="[object Date]";function r1e(e){return t1e(e)&&e1e(e)==n1e}var i1e=r1e,o1e=i1e,a1e=sl,Jm=gf,ep=Jm&&Jm.isDate,s1e=ep?a1e(ep):o1e,l1e=s1e;const c1e=xn(l1e);var M2=new Date,E2=new Date;function Mn(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=function(o){return e(o=new Date(+o)),o},i.ceil=function(o){return e(o=new Date(o-1)),t(o,1),e(o),o},i.round=function(o){var a=i(o),s=i.ceil(o);return o-a<s-o?a:s},i.offset=function(o,a){return t(o=new Date(+o),a==null?1:Math.floor(a)),o},i.range=function(o,a,s){var l=[],c;if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o<a)||!(s>0))return l;do l.push(c=new Date(+o)),t(o,s),e(o);while(c<o&&o<a);return l},i.filter=function(o){return Mn(function(a){if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},function(a,s){if(a>=a)if(s<0)for(;++s<=0;)for(;t(a,-1),!o(a););else for(;--s>=0;)for(;t(a,1),!o(a););})},n&&(i.count=function(o,a){return M2.setTime(+o),E2.setTime(+a),e(M2),e(E2),Math.floor(n(M2,E2))},i.every=function(o){return o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?function(a){return r(a)%o===0}:function(a){return i.count(0,a)%o===0}):i}),i}var vo=Mn(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});vo.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Mn(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):vo};vo.range;var yd=1e3,Zs=6e4,Cd=36e5,R$=6048e5,Ma=Mn(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*yd)},function(e,t){return(t-e)/yd},function(e){return e.getUTCSeconds()});Ma.range;var Af=Mn(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*yd)},function(e,t){e.setTime(+e+t*Zs)},function(e,t){return(t-e)/Zs},function(e){return e.getMinutes()});Af.range;var Nf=Mn(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*yd-e.getMinutes()*Zs)},function(e,t){e.setTime(+e+t*Cd)},function(e,t){return(t-e)/Cd},function(e){return e.getHours()});Nf.range;function qa(e){return Mn(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n*7)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Zs)/R$})}var Ea=qa(0),Ff=qa(1),Df=qa(2),zf=qa(3),Bf=qa(4),Wf=qa(5),Zf=qa(6);Ea.range;Ff.range;Df.range;zf.range;Bf.range;Wf.range;Zf.range;var Uf=Mn(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()});Uf.range;var _1=Mn(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});_1.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:Mn(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})};_1.range;var qf=Mn(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*Zs)},function(e,t){return(t-e)/Zs},function(e){return e.getUTCMinutes()});qf.range;var Gf=Mn(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*Cd)},function(e,t){return(t-e)/Cd},function(e){return e.getUTCHours()});Gf.range;function Ga(e){return Mn(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n*7)},function(t,n){return(n-t)/R$})}var _a=Ga(0),Yf=Ga(1),Kf=Ga(2),Xf=Ga(3),Qf=Ga(4),Jf=Ga(5),e0=Ga(6);_a.range;Yf.range;Kf.range;Xf.range;Qf.range;Jf.range;e0.range;var t0=Mn(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()});t0.range;var O1=Mn(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});O1.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:Mn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})};O1.range;function ia(){return ia=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ia.apply(this,arguments)}var us=[function(e){return e.setMilliseconds(0)},function(e){return e.setSeconds(0)},function(e){return e.setMinutes(0)},function(e){return e.setHours(0)},function(e){return e.setDate(1)},function(e){return e.setMonth(0)}],u1e={millisecond:[],second:us.slice(0,1),minute:us.slice(0,2),hour:us.slice(0,3),day:us.slice(0,4),month:us.slice(0,5),year:us.slice(0,6)},d1e=function(e){return function(t){return u1e[e].forEach(function(n){n(t)}),t}},k$=function(e){var t=e.format,n=t===void 0?"native":t,r=e.precision,i=r===void 0?"millisecond":r,o=e.useUTC,a=o===void 0||o,s=d1e(i);return function(l){if(l===void 0)return l;if(n==="native"||l instanceof Date)return s(l);var c=a?ph(n):mh(n);return s(c(l))}},f1e=function(e,t,n,r){var i,o,a,s,l=e.min,c=l===void 0?0:l,u=e.max,d=u===void 0?"auto":u,f=e.stacked,h=f!==void 0&&f,m=e.reverse,g=m!==void 0&&m,v=e.clamp,b=v!==void 0&&v,y=e.nice,x=y!==void 0&&y;c==="auto"?i=h===!0?(o=t.minStacked)!=null?o:0:t.min:i=c,d==="auto"?a=h===!0?(s=t.maxStacked)!=null?s:0:t.max:a=d;var $=qo().rangeRound(r==="x"?[0,n]:[n,0]).domain(g?[a,i]:[i,a]).clamp(b);return x===!0?$.nice():typeof x=="number"&&$.nice(x),h1e($,h)},h1e=function(e,t){t===void 0&&(t=!1);var n=e;return n.type="linear",n.stacked=t,n},g1e=function(e,t,n){var r=Ww().range([0,n]).domain(t.all);return r.type="point",r},v1e=function(e,t,n,r){var i=e.round,o=i===void 0||i,a=Ns().range(r==="x"?[0,n]:[n,0]).domain(t.all).round(o);return m1e(a)},m1e=function(e){var t=e;return t.type="band",t},p1e=function(e,t,n){var r,i,o=e.format,a=o===void 0?"native":o,s=e.precision,l=s===void 0?"millisecond":s,c=e.min,u=c===void 0?"auto":c,d=e.max,f=d===void 0?"auto":d,h=e.useUTC,m=h===void 0||h,g=e.nice,v=g!==void 0&&g,b=k$({format:a,precision:l,useUTC:m});r=u==="auto"?b(t.min):a!=="native"?b(u):u,i=f==="auto"?b(t.max):a!=="native"?b(f):f;var y=m?oS():iS();y.range([0,n]),r&&i&&y.domain([r,i]),v===!0?y.nice():typeof v!="object"&&typeof v!="number"||y.nice(v);var x=y;return x.type="time",x.useUTC=m,x},b1e=function(e,t,n,r){var i,o=e.base,a=o===void 0?10:o,s=e.min,l=s===void 0?"auto":s,c=e.max,u=c===void 0?"auto":c;if(t.all.some(function(g){return g===0}))throw new Error("a log scale domain must not include or cross zero");var d,f,h=!1;if(t.all.filter(function(g){return g!=null}).forEach(function(g){h||(i===void 0?i=Math.sign(g):Math.sign(g)!==i&&(h=!0))}),h)throw new Error("a log scale domain must be strictly-positive or strictly-negative");d=l==="auto"?t.min:l,f=u==="auto"?t.max:u;var m=K6().domain([d,f]).rangeRound(r==="x"?[0,n]:[n,0]).base(a).nice();return m.type="log",m},y1e=function(e,t,n,r){var i,o,a=e.constant,s=a===void 0?1:a,l=e.min,c=l===void 0?"auto":l,u=e.max,d=u===void 0?"auto":u,f=e.reverse,h=f!==void 0&&f;i=c==="auto"?t.min:c,o=d==="auto"?t.max:d;var m=X6().constant(s).rangeRound(r==="x"?[0,n]:[n,0]).nice();h===!0?m.domain([o,i]):m.domain([i,o]);var g=m;return g.type="symlog",g},C1e=function(e){return e==="x"?"y":"x"},x1e=function(e,t){return e===t},w1e=function(e,t){return e.getTime()===t.getTime()};function tp(e,t,n,r){switch(e.type){case"linear":return f1e(e,t,n,r);case"point":return g1e(e,t,n);case"band":return v1e(e,t,n,r);case"time":return p1e(e,t,n);case"log":return b1e(e,t,n,r);case"symlog":return y1e(e,t,n,r);default:throw new Error("invalid scale spec")}}var np=function(e,t,n){var r;if("stacked"in n&&n.stacked){var i=e.data[t==="x"?"xStacked":"yStacked"];return i==null?null:n(i)}return(r=n(e.data[t]))!=null?r:null},L$=function(e,t,n,r,i){var o=e.map(function(u){return function(d){return ia({},d,{data:d.data.map(function(f){return{data:ia({},f)}})})}(u)}),a=S1e(o,t,n);"stacked"in t&&t.stacked===!0&&$1e(a,o),"stacked"in n&&n.stacked===!0&&M1e(a,o);var s=tp(t,a.x,r,"x"),l=tp(n,a.y,i,"y"),c=o.map(function(u){return ia({},u,{data:u.data.map(function(d){return ia({},d,{position:{x:np(d,"x",s),y:np(d,"y",l)}})})})});return ia({},a,{series:c,xScale:s,yScale:l})},S1e=function(e,t,n){return{x:rp(e,"x",t),y:rp(e,"y",n)}},rp=function(e,t,n,r){var i={},o=i.getValue,a=o===void 0?function(m){return m.data[t]}:o,s=i.setValue,l=s===void 0?function(m,g){m.data[t]=g}:s;if(n.type==="linear")e.forEach(function(m){m.data.forEach(function(g){var v=a(g);v&&l(g,parseFloat(String(v)))})});else if(n.type==="time"&&n.format!=="native"){var c=k$(n);e.forEach(function(m){m.data.forEach(function(g){var v=a(g);v&&l(g,c(v))})})}var u=[];switch(e.forEach(function(m){m.data.forEach(function(g){u.push(a(g))})}),n.type){case"linear":var d=Jce(Q3(u).filter(function(m){return m!==null}),function(m){return m});return{all:d,min:Math.min.apply(Math,d),max:Math.max.apply(Math,d)};case"time":var f=P4(u,function(m){return m.getTime()}).slice(0).sort(function(m,g){return g.getTime()-m.getTime()}).reverse();return{all:f,min:f[0],max:ue(f)};default:var h=Q3(u);return{all:h,min:h[0],max:ue(h)}}},j$=function(e,t,n){var r=C1e(e),i=[];t[r].all.forEach(function(o){var a=c1e(o)?w1e:x1e,s=[];n.forEach(function(l){var c=l.data.find(function(h){return a(h.data[r],o)}),u=null,d=null;if(c!==void 0){if((u=c.data[e])!==null){var f=ue(s);f===void 0?d=u:f!==null&&(d=f+u)}c.data[e==="x"?"xStacked":"yStacked"]=d}s.push(d),d!==null&&i.push(d)})}),t[e].minStacked=Math.min.apply(Math,i),t[e].maxStacked=Math.max.apply(Math,i)},$1e=function(e,t){return j$("x",e,t)},M1e=function(e,t){return j$("y",e,t)},P$=function(e){var t=e.bandwidth();if(t===0)return e;var n=t/2;return e.round()&&(n=Math.round(n)),function(r){var i;return((i=e(r))!=null?i:0)+n}},I$={millisecond:[vo,vo],second:[Ma,Ma],minute:[Af,qf],hour:[Nf,Gf],day:[Mn(function(e){return e.setHours(0,0,0,0)},function(e,t){return e.setDate(e.getDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)}),Mn(function(e){return e.setUTCHours(0,0,0,0)},function(e,t){return e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)})],week:[Ea,_a],sunday:[Ea,_a],monday:[Ff,Yf],tuesday:[Df,Kf],wednesday:[zf,Xf],thursday:[Bf,Qf],friday:[Wf,Jf],saturday:[Zf,e0],month:[Uf,t0],year:[_1,O1]},E1e=Object.keys(I$),_1e=new RegExp("^every\\s*(\\d+)?\\s*("+E1e.join("|")+")s?$","i"),A$=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var n=t.match(_1e);if(n){var r=n[1],i=n[2],o=I$[i][e.useUTC?1:0];if(i==="day"){var a,s,l=e.domain(),c=l[0],u=l[1],d=new Date(u);return d.setDate(d.getDate()+1),(a=(s=o.every(Number(r??1)))==null?void 0:s.range(c,d))!=null?a:[]}if(r===void 0)return e.ticks(o);var f=o.every(Number(r));if(f)return e.ticks(f)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(h=t)=="number"&&isFinite(h)&&Math.floor(h)===h)return e.ticks(t)}var h;return e.domain()};function zr(){return zr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zr.apply(this,arguments)}var N$=function(e){var t,n=e.axis,r=e.scale,i=e.ticksPosition,o=e.tickValues,a=e.tickSize,s=e.tickPadding,l=e.tickRotation,c=e.truncateTickAt,u=e.engine,d=u===void 0?"svg":u,f=A$(r,o),h=aie[d],m="bandwidth"in r?P$(r):r,g={lineX:0,lineY:0},v={textX:0,textY:0},b=typeof document=="object"&&document.dir==="rtl",y=h.align.center,x=h.baseline.center;return n==="x"?(t=function($){var w;return{x:(w=m($))!=null?w:0,y:0}},g.lineY=a*(i==="after"?1:-1),v.textY=(a+s)*(i==="after"?1:-1),x=i==="after"?h.baseline.top:h.baseline.bottom,l===0?y=h.align.center:i==="after"&&l<0||i==="before"&&l>0?(y=h.align[b?"left":"right"],x=h.baseline.center):(i==="after"&&l>0||i==="before"&&l<0)&&(y=h.align[b?"right":"left"],x=h.baseline.center)):(t=function($){var w;return{x:0,y:(w=m($))!=null?w:0}},g.lineX=a*(i==="after"?1:-1),v.textX=(a+s)*(i==="after"?1:-1),y=i==="after"?h.align.left:h.align.right),{ticks:f.map(function($){var w=typeof $=="string"?function(M){var T=String(M).length;return c&&c>0&&T>c?""+String(M).slice(0,c).concat("..."):""+M}($):$;return zr({key:$ instanceof Date?""+$.valueOf():""+$,value:w},t($),g,v)}),textAlign:y,textBaseline:x}},F$=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var n=Wa(e);return function(r){return n(r instanceof Date?r:new Date(r))}}return Da(e)},I4=function(e){var t,n=e.width,r=e.height,i=e.scale,o=e.axis,a=e.values,s=(t=a,(Array.isArray(t)?a:void 0)||A$(i,a)),l="bandwidth"in i?P$(i):i,c=o==="x"?s.map(function(u){var d,f;return{key:u instanceof Date?""+u.valueOf():""+u,x1:(d=l(u))!=null?d:0,x2:(f=l(u))!=null?f:0,y1:0,y2:r}}):s.map(function(u){var d,f;return{key:u instanceof Date?""+u.valueOf():""+u,x1:0,x2:n,y1:(d=l(u))!=null?d:0,y2:(f=l(u))!=null?f:0}});return c},O1e=S.memo(function(e){var t,n=e.value,r=e.format,i=e.lineX,o=e.lineY,a=e.onClick,s=e.textBaseline,l=e.textAnchor,c=e.animatedProps,u=Wt(),d=u.axis.ticks.line,f=u.axis.ticks.text,h=(t=r==null?void 0:r(n))!=null?t:n,m=S.useMemo(function(){var g={opacity:c.opacity};return a?{style:zr({},g,{cursor:"pointer"}),onClick:function(v){return a(v,h)}}:{style:g}},[c.opacity,a,h]);return p.jsxs(et.g,zr({transform:c.transform},m,{children:[p.jsx("line",{x1:0,x2:i,y1:0,y2:o,style:d}),f.outlineWidth>0&&p.jsx(et.text,{dominantBaseline:s,textAnchor:l,transform:c.textTransform,style:f,strokeWidth:2*f.outlineWidth,stroke:f.outlineColor,strokeLinejoin:"round",children:""+h}),p.jsx(et.text,{dominantBaseline:s,textAnchor:l,transform:c.textTransform,style:wh(f),children:""+h})]}))}),H1e=function(e){var t=e.axis,n=e.scale,r=e.x,i=r===void 0?0:r,o=e.y,a=o===void 0?0:o,s=e.length,l=e.ticksPosition,c=e.tickValues,u=e.tickSize,d=u===void 0?5:u,f=e.tickPadding,h=f===void 0?5:f,m=e.tickRotation,g=m===void 0?0:m,v=e.format,b=e.renderTick,y=b===void 0?O1e:b,x=e.truncateTickAt,$=e.legend,w=e.legendPosition,M=w===void 0?"end":w,T=e.legendOffset,_=T===void 0?0:T,E=e.onClick,H=e.ariaHidden,k=Wt(),A=k.axis.legend.text,j=S.useMemo(function(){return F$(v,n)},[v,n]),O=N$({axis:t,scale:n,ticksPosition:l,tickValues:c,tickSize:d,tickPadding:h,tickRotation:g,truncateTickAt:x}),R=O.ticks,L=O.textAlign,V=O.textBaseline,I=null;if($!==void 0){var P,N=0,z=0,q=0;t==="y"?(q=-90,N=_,M==="start"?(P="start",z=s):M==="middle"?(P="middle",z=s/2):M==="end"&&(P="end")):(z=_,M==="start"?P="start":M==="middle"?(P="middle",N=s/2):M==="end"&&(P="end",N=s)),I=p.jsxs(p.Fragment,{children:[A.outlineWidth>0&&p.jsx("text",{transform:"translate("+N+", "+z+") rotate("+q+")",textAnchor:P,style:zr({dominantBaseline:"central"},A),strokeWidth:2*A.outlineWidth,stroke:A.outlineColor,strokeLinejoin:"round",children:$}),p.jsx("text",{transform:"translate("+N+", "+z+") rotate("+q+")",textAnchor:P,style:zr({dominantBaseline:"central"},A),children:$})]})}var G=Fn(),Y=G.animate,ee=G.config,Q=Xt({transform:"translate("+i+","+a+")",lineX2:t==="x"?s:0,lineY2:t==="x"?0:s,config:ee,immediate:!Y}),K=S.useCallback(function(Z){return{opacity:1,transform:"translate("+Z.x+","+Z.y+")",textTransform:"translate("+Z.textX+","+Z.textY+") rotate("+g+")"}},[g]),J=S.useCallback(function(Z){return{opacity:0,transform:"translate("+Z.x+","+Z.y+")",textTransform:"translate("+Z.textX+","+Z.textY+") rotate("+g+")"}},[g]),W=Cr(R,{keys:function(Z){return Z.key},initial:K,from:J,enter:K,update:K,leave:{opacity:0},config:ee,immediate:!Y});return p.jsxs(et.g,{transform:Q.transform,"aria-hidden":H,children:[W(function(Z,U,F,re){return C.createElement(y,zr({tickIndex:re,format:j,rotate:g,textBaseline:V,textAnchor:L,truncateTickAt:x,animatedProps:Z},U,E?{onClick:E}:{}))}),p.jsx(et.line,{style:k.axis.domain.line,x1:0,x2:Q.lineX2,y1:0,y2:Q.lineY2}),I]})},V1e=S.memo(H1e),D$=["top","right","bottom","left"],z$=S.memo(function(e){var t=e.xScale,n=e.yScale,r=e.width,i=e.height,o={top:e.top,right:e.right,bottom:e.bottom,left:e.left};return p.jsx(p.Fragment,{children:D$.map(function(a){var s=o[a];if(!s)return null;var l=a==="top"||a==="bottom";return p.jsx(V1e,zr({},s,{axis:l?"x":"y",x:a==="right"?r:0,y:a==="bottom"?i:0,scale:l?t:n,length:l?r:i,ticksPosition:a==="top"||a==="left"?"before":"after",truncateTickAt:s.truncateTickAt}),a)})})}),T1e=S.memo(function(e){var t=e.animatedProps,n=Wt();return p.jsx(et.line,zr({},t,n.grid.line))}),ip=S.memo(function(e){var t=e.lines,n=Fn(),r=n.animate,i=n.config,o=Cr(t,{keys:function(a){return a.key},initial:function(a){return{opacity:1,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},from:function(a){return{opacity:0,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},enter:function(a){return{opacity:1,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},update:function(a){return{opacity:1,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},leave:{opacity:0},config:i,immediate:!r});return p.jsx("g",{children:o(function(a,s){return S.createElement(T1e,zr({},s,{key:s.key,animatedProps:a}))})})}),B$=S.memo(function(e){var t=e.width,n=e.height,r=e.xScale,i=e.yScale,o=e.xValues,a=e.yValues,s=S.useMemo(function(){return!!r&&I4({width:t,height:n,scale:r,axis:"x",values:o})},[r,o,t,n]),l=S.useMemo(function(){return!!i&&I4({width:t,height:n,scale:i,axis:"y",values:a})},[n,t,i,a]);return p.jsxs(p.Fragment,{children:[s&&p.jsx(ip,{lines:s}),l&&p.jsx(ip,{lines:l})]})}),R1e=function(e,t){var n,r=t.axis,i=t.scale,o=t.x,a=o===void 0?0:o,s=t.y,l=s===void 0?0:s,c=t.length,u=t.ticksPosition,d=t.tickValues,f=t.tickSize,h=f===void 0?5:f,m=t.tickPadding,g=m===void 0?5:m,v=t.tickRotation,b=v===void 0?0:v,y=t.format,x=t.legend,$=t.legendPosition,w=$===void 0?"end":$,M=t.legendOffset,T=M===void 0?0:M,_=t.theme,E=N$({axis:r,scale:i,ticksPosition:u,tickValues:d,tickSize:h,tickPadding:g,tickRotation:b,engine:"canvas"}),H=E.ticks,k=E.textAlign,A=E.textBaseline;e.save(),e.translate(a,l),e.textAlign=k,e.textBaseline=A;var j=_.axis.ticks.text;e.font=(j.fontWeight?j.fontWeight+" ":"")+j.fontSize+"px "+j.fontFamily,((n=_.axis.domain.line.strokeWidth)!=null?n:0)>0&&(e.lineWidth=Number(_.axis.domain.line.strokeWidth),e.lineCap="square",_.axis.domain.line.stroke&&(e.strokeStyle=_.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(r==="x"?c:0,r==="x"?0:c),e.stroke());var O=typeof y=="function"?y:function(P){return""+P};if(H.forEach(function(P){var N;((N=_.axis.ticks.line.strokeWidth)!=null?N:0)>0&&(e.lineWidth=Number(_.axis.ticks.line.strokeWidth),e.lineCap="square",_.axis.ticks.line.stroke&&(e.strokeStyle=_.axis.ticks.line.stroke),e.beginPath(),e.moveTo(P.x,P.y),e.lineTo(P.x+P.lineX,P.y+P.lineY),e.stroke());var z=O(P.value);e.save(),e.translate(P.x+P.textX,P.y+P.textY),e.rotate(Dr(b)),j.outlineWidth>0&&(e.strokeStyle=j.outlineColor,e.lineWidth=2*j.outlineWidth,e.lineJoin="round",e.strokeText(""+z,0,0)),_.axis.ticks.text.fill&&(e.fillStyle=j.fill),e.fillText(""+z,0,0),e.restore()}),x!==void 0){var R=0,L=0,V=0,I="center";r==="y"?(V=-90,R=T,w==="start"?(I="start",L=c):w==="middle"?(I="center",L=c/2):w==="end"&&(I="end")):(L=T,w==="start"?I="start":w==="middle"?(I="center",R=c/2):w==="end"&&(I="end",R=c)),e.translate(R,L),e.rotate(Dr(V)),e.font=(_.axis.legend.text.fontWeight?_.axis.legend.text.fontWeight+" ":"")+_.axis.legend.text.fontSize+"px "+_.axis.legend.text.fontFamily,_.axis.legend.text.fill&&(e.fillStyle=_.axis.legend.text.fill),e.textAlign=I,e.textBaseline="middle",e.fillText(x,0,0)}e.restore()},W$=function(e,t){var n=t.xScale,r=t.yScale,i=t.width,o=t.height,a=t.top,s=t.right,l=t.bottom,c=t.left,u=t.theme,d={top:a,right:s,bottom:l,left:c};D$.forEach(function(f){var h=d[f];if(!h)return null;var m=f==="top"||f==="bottom",g=f==="top"||f==="left"?"before":"after",v=m?n:r,b=F$(h.format,v);R1e(e,zr({},h,{axis:m?"x":"y",x:f==="right"?i:0,y:f==="bottom"?o:0,scale:v,format:b,length:m?i:o,ticksPosition:g,theme:u}))})},xd=function(e,t){var n=t.width,r=t.height,i=t.scale,o=t.axis,a=t.values;I4({width:n,height:r,scale:i,axis:o,values:a}).forEach(function(s){e.beginPath(),e.moveTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.stroke()})},k1e=T$;function L1e(e,t){var n=[];return k1e(e,function(r,i,o){t(r,i,o)&&n.push(r)}),n}var j1e=L1e,P1e=NS,I1e=j1e,A1e=Eh,N1e=xr;function F1e(e,t){var n=N1e(e)?P1e:I1e;return n(e,A1e(t))}var D1e=F1e;const _h=xn(D1e);var z1e=po,B1e=Gr,W1e="[object Number]";function Z1e(e){return typeof e=="number"||B1e(e)&&z1e(e)==W1e}var U1e=Z1e;const Oa=xn(U1e);function q1e(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}var Z$=q1e,G1e=C1,Y1e=Z$;function K1e(e,t){return t.length<2?e:G1e(e,Y1e(t,0,-1))}var X1e=K1e,Q1e=cl,J1e=Fw,eue=X1e,tue=ul;function nue(e,t){return t=Q1e(t,e),e=eue(e,t),e==null||delete e[tue(J1e(t))]}var rue=nue,iue=L6;function oue(e){return iue(e)?void 0:e}var aue=oue,sue=bf,lue=w$,cue=rue,uue=cl,due=ll,fue=aue,hue=jS,gue=b$,vue=1,mue=2,pue=4,bue=hue(function(e,t){var n={};if(e==null)return n;var r=!1;t=sue(t,function(o){return o=uue(o,e),r||(r=o.length>1),o}),due(e,gue(e),n),r&&(n=lue(n,vue|mue|pue,fue));for(var i=t.length;i--;)cue(n,t[i]);return n}),yue=bue;const Ya=xn(yue);function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ao.apply(this,arguments)}var A4={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},Cue=function(e){var t=typeof e;return S.isValidElement(e)||t==="string"||t==="function"||t==="object"},xue=function(e){var t=typeof e;return t==="string"||t==="function"},Kc=function(e){return e.type==="circle"},N4=function(e){return e.type==="dot"},Xc=function(e){return e.type==="rect"},wue=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return n.reduce(function(o,a){var s=a.offset||0;return[].concat(o,_h(t,a.match).map(function(l){var c=r(l),u=i(l);return(Kc(a)||Xc(a))&&(u.size=u.size+2*s,u.width=u.width+2*s,u.height=u.height+2*s),Ao({},Ya(a,["match","offset"]),c,u,{size:a.size||u.size,datum:l})}))},[])},Sue=function(e,t,n,r){var i=Math.atan2(r-t,n-e);return oie(Pf(i))},$ue=function(e){var t,n,r=e.x,i=e.y,o=e.noteX,a=e.noteY,s=e.noteWidth,l=s===void 0?A4.noteWidth:s,c=e.noteTextOffset,u=c===void 0?A4.noteTextOffset:c;if(Oa(o))t=r+o;else{if(o.abs===void 0)throw new Error("noteX should be either a number or an object containing an 'abs' property");t=o.abs}if(Oa(a))n=i+a;else{if(a.abs===void 0)throw new Error("noteY should be either a number or an object containing an 'abs' property");n=a.abs}var d=r,f=i,h=Sue(r,i,t,n);if(Kc(e)){var m=ma(Dr(h),e.size/2);d+=m.x,f+=m.y}if(Xc(e)){var g=Math.round((h+90)/45)%8;g===0&&(f-=e.height/2),g===1&&(d+=e.width/2,f-=e.height/2),g===2&&(d+=e.width/2),g===3&&(d+=e.width/2,f+=e.height/2),g===4&&(f+=e.height/2),g===5&&(d-=e.width/2,f+=e.height/2),g===6&&(d-=e.width/2),g===7&&(d-=e.width/2,f-=e.height/2)}var v=t,b=t;return(h+90)%360>180?(v-=l,b-=l):b+=l,{points:[[d,f],[t,n],[b,n]],text:[v,n-u],angle:h+90}},Mue=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return S.useMemo(function(){return wue({data:t,annotations:n,getPosition:r,getDimensions:i})},[t,n,r,i])},Eue=function(e){return S.useMemo(function(){return $ue(e)},[e])},_ue=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,o=Wt(),a=Fn(),s=a.animate,l=a.config,c=Xt({x:n,y:r,config:l,immediate:!s});return typeof i=="function"?S.createElement(i,{x:n,y:r,datum:t}):p.jsxs(p.Fragment,{children:[o.annotations.text.outlineWidth>0&&p.jsx(et.text,{x:c.x,y:c.y,style:Ao({},o.annotations.text,{strokeLinejoin:"round",strokeWidth:2*o.annotations.text.outlineWidth,stroke:o.annotations.text.outlineColor}),children:i}),p.jsx(et.text,{x:c.x,y:c.y,style:Ya(o.annotations.text,["outlineWidth","outlineColor"]),children:i})]})},op=function(e){var t=e.points,n=e.isOutline,r=n!==void 0&&n,i=Wt(),o=S.useMemo(function(){var l=t[0];return t.slice(1).reduce(function(c,u){return c+" L"+u[0]+","+u[1]},"M"+l[0]+","+l[1])},[t]),a=jf(o);if(r&&i.annotations.link.outlineWidth<=0)return null;var s=Ao({},i.annotations.link);return r&&(s.strokeLinecap="square",s.strokeWidth=i.annotations.link.strokeWidth+2*i.annotations.link.outlineWidth,s.stroke=i.annotations.link.outlineColor,s.opacity=i.annotations.link.outlineOpacity),p.jsx(et.path,{fill:"none",d:a,style:s})},Oue=function(e){var t=e.x,n=e.y,r=e.size,i=Wt(),o=Fn(),a=o.animate,s=o.config,l=Xt({x:t,y:n,radius:r/2,config:s,immediate:!a});return p.jsxs(p.Fragment,{children:[i.annotations.outline.outlineWidth>0&&p.jsx(et.circle,{cx:l.x,cy:l.y,r:l.radius,style:Ao({},i.annotations.outline,{fill:"none",strokeWidth:i.annotations.outline.strokeWidth+2*i.annotations.outline.outlineWidth,stroke:i.annotations.outline.outlineColor,opacity:i.annotations.outline.outlineOpacity})}),p.jsx(et.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.outline})]})},Hue=function(e){var t=e.x,n=e.y,r=e.size,i=r===void 0?A4.dotSize:r,o=Wt(),a=Fn(),s=a.animate,l=a.config,c=Xt({x:t,y:n,radius:i/2,config:l,immediate:!s});return p.jsxs(p.Fragment,{children:[o.annotations.outline.outlineWidth>0&&p.jsx(et.circle,{cx:c.x,cy:c.y,r:c.radius,style:Ao({},o.annotations.outline,{fill:"none",strokeWidth:2*o.annotations.outline.outlineWidth,stroke:o.annotations.outline.outlineColor,opacity:o.annotations.outline.outlineOpacity})}),p.jsx(et.circle,{cx:c.x,cy:c.y,r:c.radius,style:o.annotations.symbol})]})},Vue=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=e.borderRadius,a=o===void 0?6:o,s=Wt(),l=Fn(),c=l.animate,u=l.config,d=Xt({x:t-r/2,y:n-i/2,width:r,height:i,config:u,immediate:!c});return p.jsxs(p.Fragment,{children:[s.annotations.outline.outlineWidth>0&&p.jsx(et.rect,{x:d.x,y:d.y,rx:a,ry:a,width:d.width,height:d.height,style:Ao({},s.annotations.outline,{fill:"none",strokeWidth:s.annotations.outline.strokeWidth+2*s.annotations.outline.outlineWidth,stroke:s.annotations.outline.outlineColor,opacity:s.annotations.outline.outlineOpacity})}),p.jsx(et.rect,{x:d.x,y:d.y,rx:a,ry:a,width:d.width,height:d.height,style:s.annotations.outline})]})},Tue=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,o=Eue(e);if(!Cue(i))throw new Error("note should be a valid react element");return p.jsxs(p.Fragment,{children:[p.jsx(op,{points:o.points,isOutline:!0}),Kc(e)&&p.jsx(Oue,{x:n,y:r,size:e.size}),N4(e)&&p.jsx(Hue,{x:n,y:r,size:e.size}),Xc(e)&&p.jsx(Vue,{x:n,y:r,width:e.width,height:e.height,borderRadius:e.borderRadius}),p.jsx(op,{points:o.points}),p.jsx(_ue,{datum:t,x:o.text[0],y:o.text[1],note:i})]})},ap=function(e,t){t.forEach(function(n,r){var i=n[0],o=n[1];r===0?e.moveTo(i,o):e.lineTo(i,o)})},Rue=function(e,t){var n=t.annotations,r=t.theme;n.length!==0&&(e.save(),n.forEach(function(i){if(!xue(i.note))throw new Error("note is invalid for canvas implementation");r.annotations.link.outlineWidth>0&&(e.lineCap="square",e.strokeStyle=r.annotations.link.outlineColor,e.lineWidth=r.annotations.link.strokeWidth+2*r.annotations.link.outlineWidth,e.beginPath(),ap(e,i.computed.points),e.stroke(),e.lineCap="butt"),Kc(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),N4(i)&&r.annotations.symbol.outlineWidth>0&&(e.strokeStyle=r.annotations.symbol.outlineColor,e.lineWidth=2*r.annotations.symbol.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Xc(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),e.strokeStyle=r.annotations.link.stroke,e.lineWidth=r.annotations.link.strokeWidth,e.beginPath(),ap(e,i.computed.points),e.stroke(),Kc(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),N4(i)&&(e.fillStyle=r.annotations.symbol.fill,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.fill()),Xc(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),typeof i.note=="function"?i.note(e,{datum:i.datum,x:i.computed.text[0],y:i.computed.text[1],theme:r}):(e.font=r.annotations.text.fontSize+"px "+r.annotations.text.fontFamily,e.textAlign="left",e.textBaseline="alphabetic",e.fillStyle=r.annotations.text.fill,e.strokeStyle=r.annotations.text.outlineColor,e.lineWidth=2*r.annotations.text.outlineWidth,r.annotations.text.outlineWidth>0&&(e.lineJoin="round",e.strokeText(i.note,i.computed.text[0],i.computed.text[1]),e.lineJoin="miter"),e.fillText(i.note,i.computed.text[0],i.computed.text[1]))}),e.restore())};const lo=11102230246251565e-32,nr=134217729,kue=(3+8*lo)*lo;function _2(e,t,n,r,i){let o,a,s,l,c=t[0],u=r[0],d=0,f=0;u>c==u>-c?(o=c,c=t[++d]):(o=u,u=r[++f]);let h=0;if(d<e&&f<n)for(u>c==u>-c?(a=c+o,s=o-(a-c),c=t[++d]):(a=u+o,s=o-(a-u),u=r[++f]),o=a,s!==0&&(i[h++]=s);d<e&&f<n;)u>c==u>-c?(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=t[++d]):(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=r[++f]),o=a,s!==0&&(i[h++]=s);for(;d<e;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=t[++d],o=a,s!==0&&(i[h++]=s);for(;f<n;)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=r[++f],o=a,s!==0&&(i[h++]=s);return(o!==0||h===0)&&(i[h++]=o),h}function Lue(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function H1(e){return new Float64Array(e)}const jue=(3+16*lo)*lo,Pue=(2+12*lo)*lo,Iue=(9+64*lo)*lo*lo,ds=H1(4),sp=H1(8),lp=H1(12),cp=H1(16),dr=H1(4);function Aue(e,t,n,r,i,o,a){let s,l,c,u,d,f,h,m,g,v,b,y,x,$,w,M,T,_;const E=e-i,H=n-i,k=t-o,A=r-o;$=E*A,f=nr*E,h=f-(f-E),m=E-h,f=nr*A,g=f-(f-A),v=A-g,w=m*v-($-h*g-m*g-h*v),M=k*H,f=nr*k,h=f-(f-k),m=k-h,f=nr*H,g=f-(f-H),v=H-g,T=m*v-(M-h*g-m*g-h*v),b=w-T,d=w-b,ds[0]=w-(b+d)+(d-T),y=$+b,d=y-$,x=$-(y-d)+(b-d),b=x-M,d=x-b,ds[1]=x-(b+d)+(d-M),_=y+b,d=_-y,ds[2]=y-(_-d)+(b-d),ds[3]=_;let j=Lue(4,ds),O=Pue*a;if(j>=O||-j>=O||(d=e-E,s=e-(E+d)+(d-i),d=n-H,c=n-(H+d)+(d-i),d=t-k,l=t-(k+d)+(d-o),d=r-A,u=r-(A+d)+(d-o),s===0&&l===0&&c===0&&u===0)||(O=Iue*a+kue*Math.abs(j),j+=E*u+A*s-(k*c+H*l),j>=O||-j>=O))return j;$=s*A,f=nr*s,h=f-(f-s),m=s-h,f=nr*A,g=f-(f-A),v=A-g,w=m*v-($-h*g-m*g-h*v),M=l*H,f=nr*l,h=f-(f-l),m=l-h,f=nr*H,g=f-(f-H),v=H-g,T=m*v-(M-h*g-m*g-h*v),b=w-T,d=w-b,dr[0]=w-(b+d)+(d-T),y=$+b,d=y-$,x=$-(y-d)+(b-d),b=x-M,d=x-b,dr[1]=x-(b+d)+(d-M),_=y+b,d=_-y,dr[2]=y-(_-d)+(b-d),dr[3]=_;const R=_2(4,ds,4,dr,sp);$=E*u,f=nr*E,h=f-(f-E),m=E-h,f=nr*u,g=f-(f-u),v=u-g,w=m*v-($-h*g-m*g-h*v),M=k*c,f=nr*k,h=f-(f-k),m=k-h,f=nr*c,g=f-(f-c),v=c-g,T=m*v-(M-h*g-m*g-h*v),b=w-T,d=w-b,dr[0]=w-(b+d)+(d-T),y=$+b,d=y-$,x=$-(y-d)+(b-d),b=x-M,d=x-b,dr[1]=x-(b+d)+(d-M),_=y+b,d=_-y,dr[2]=y-(_-d)+(b-d),dr[3]=_;const L=_2(R,sp,4,dr,lp);$=s*u,f=nr*s,h=f-(f-s),m=s-h,f=nr*u,g=f-(f-u),v=u-g,w=m*v-($-h*g-m*g-h*v),M=l*c,f=nr*l,h=f-(f-l),m=l-h,f=nr*c,g=f-(f-c),v=c-g,T=m*v-(M-h*g-m*g-h*v),b=w-T,d=w-b,dr[0]=w-(b+d)+(d-T),y=$+b,d=y-$,x=$-(y-d)+(b-d),b=x-M,d=x-b,dr[1]=x-(b+d)+(d-M),_=y+b,d=_-y,dr[2]=y-(_-d)+(b-d),dr[3]=_;const V=_2(L,lp,4,dr,cp);return cp[V-1]}function du(e,t,n,r,i,o){const a=(t-o)*(n-i),s=(e-i)*(r-o),l=a-s,c=Math.abs(a+s);return Math.abs(l)>=jue*c?l:-Aue(e,t,n,r,i,o,c)}const up=Math.pow(2,-52),fu=new Uint32Array(512);class wd{static from(t,n=Bue,r=Wue){const i=t.length,o=new Float64Array(i*2);for(let a=0;a<i;a++){const s=t[a];o[2*a]=n(s),o[2*a+1]=r(s)}return new wd(o)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,a=t.length>>1;let s=1/0,l=1/0,c=-1/0,u=-1/0;for(let E=0;E<a;E++){const H=t[2*E],k=t[2*E+1];H<s&&(s=H),k<l&&(l=k),H>c&&(c=H),k>u&&(u=k),this._ids[E]=E}const d=(s+c)/2,f=(l+u)/2;let h,m,g;for(let E=0,H=1/0;E<a;E++){const k=O2(d,f,t[2*E],t[2*E+1]);k<H&&(h=E,H=k)}const v=t[2*h],b=t[2*h+1];for(let E=0,H=1/0;E<a;E++){if(E===h)continue;const k=O2(v,b,t[2*E],t[2*E+1]);k<H&&k>0&&(m=E,H=k)}let y=t[2*m],x=t[2*m+1],$=1/0;for(let E=0;E<a;E++){if(E===h||E===m)continue;const H=Due(v,b,y,x,t[2*E],t[2*E+1]);H<$&&(g=E,$=H)}let w=t[2*g],M=t[2*g+1];if($===1/0){for(let k=0;k<a;k++)this._dists[k]=t[2*k]-t[0]||t[2*k+1]-t[1];Cs(this._ids,this._dists,0,a-1);const E=new Uint32Array(a);let H=0;for(let k=0,A=-1/0;k<a;k++){const j=this._ids[k],O=this._dists[j];O>A&&(E[H++]=j,A=O)}this.hull=E.subarray(0,H),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(du(v,b,y,x,w,M)<0){const E=m,H=y,k=x;m=g,y=w,x=M,g=E,w=H,M=k}const T=zue(v,b,y,x,w,M);this._cx=T.x,this._cy=T.y;for(let E=0;E<a;E++)this._dists[E]=O2(t[2*E],t[2*E+1],T.x,T.y);Cs(this._ids,this._dists,0,a-1),this._hullStart=h;let _=3;r[h]=n[g]=m,r[m]=n[h]=g,r[g]=n[m]=h,i[h]=0,i[m]=1,i[g]=2,o.fill(-1),o[this._hashKey(v,b)]=h,o[this._hashKey(y,x)]=m,o[this._hashKey(w,M)]=g,this.trianglesLen=0,this._addTriangle(h,m,g,-1,-1,-1);for(let E=0,H,k;E<this._ids.length;E++){const A=this._ids[E],j=t[2*A],O=t[2*A+1];if(E>0&&Math.abs(j-H)<=up&&Math.abs(O-k)<=up||(H=j,k=O,A===h||A===m||A===g))continue;let R=0;for(let N=0,z=this._hashKey(j,O);N<this._hashSize&&(R=o[(z+N)%this._hashSize],!(R!==-1&&R!==r[R]));N++);R=n[R];let L=R,V;for(;V=r[L],du(j,O,t[2*L],t[2*L+1],t[2*V],t[2*V+1])>=0;)if(L=V,L===R){L=-1;break}if(L===-1)continue;let I=this._addTriangle(L,A,r[L],-1,-1,i[L]);i[A]=this._legalize(I+2),i[L]=I,_++;let P=r[L];for(;V=r[P],du(j,O,t[2*P],t[2*P+1],t[2*V],t[2*V+1])<0;)I=this._addTriangle(P,A,V,i[A],-1,i[P]),i[A]=this._legalize(I+2),r[P]=P,_--,P=V;if(L===R)for(;V=n[L],du(j,O,t[2*V],t[2*V+1],t[2*L],t[2*L+1])<0;)I=this._addTriangle(V,A,L,-1,i[L],i[V]),this._legalize(I+2),i[V]=I,r[L]=L,_--,L=V;this._hullStart=n[A]=L,r[L]=n[P]=A,r[A]=P,o[this._hashKey(j,O)]=A,o[this._hashKey(t[2*L],t[2*L+1])]=L}this.hull=new Uint32Array(_);for(let E=0,H=this._hullStart;E<_;E++)this.hull[E]=H,H=r[H];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(Nue(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:r,coords:i}=this;let o=0,a=0;for(;;){const s=r[t],l=t-t%3;if(a=l+(t+2)%3,s===-1){if(o===0)break;t=fu[--o];continue}const c=s-s%3,u=l+(t+1)%3,d=c+(s+2)%3,f=n[a],h=n[t],m=n[u],g=n[d];if(Fue(i[2*f],i[2*f+1],i[2*h],i[2*h+1],i[2*m],i[2*m+1],i[2*g],i[2*g+1])){n[t]=g,n[s]=f;const b=r[d];if(b===-1){let x=this._hullStart;do{if(this._hullTri[x]===d){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,b),this._link(s,r[a]),this._link(a,d);const y=c+(s+1)%3;o<fu.length&&(fu[o++]=y)}else{if(o===0)break;t=fu[--o]}}return a}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,r,i,o,a){const s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=n,this._triangles[s+2]=r,this._link(s,i),this._link(s+1,o),this._link(s+2,a),this.trianglesLen+=3,s}}function Nue(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function O2(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function Fue(e,t,n,r,i,o,a,s){const l=e-a,c=t-s,u=n-a,d=r-s,f=i-a,h=o-s,m=l*l+c*c,g=u*u+d*d,v=f*f+h*h;return l*(d*v-g*h)-c*(u*v-g*f)+m*(u*h-d*f)<0}function Due(e,t,n,r,i,o){const a=n-e,s=r-t,l=i-e,c=o-t,u=a*a+s*s,d=l*l+c*c,f=.5/(a*c-s*l),h=(c*u-s*d)*f,m=(a*d-l*u)*f;return h*h+m*m}function zue(e,t,n,r,i,o){const a=n-e,s=r-t,l=i-e,c=o-t,u=a*a+s*s,d=l*l+c*c,f=.5/(a*c-s*l),h=e+(c*u-s*d)*f,m=t+(a*d-l*u)*f;return{x:h,y:m}}function Cs(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=e[i],a=t[o];let s=i-1;for(;s>=n&&t[e[s]]>a;)e[s+1]=e[s--];e[s+1]=o}else{const i=n+r>>1;let o=n+1,a=r;Gl(e,i,o),t[e[n]]>t[e[r]]&&Gl(e,n,r),t[e[o]]>t[e[r]]&&Gl(e,o,r),t[e[n]]>t[e[o]]&&Gl(e,n,o);const s=e[o],l=t[s];for(;;){do o++;while(t[e[o]]<l);do a--;while(t[e[a]]>l);if(a<o)break;Gl(e,o,a)}e[n+1]=e[a],e[a]=s,r-o+1>=a-n?(Cs(e,t,o,r),Cs(e,t,n,a-1)):(Cs(e,t,n,a-1),Cs(e,t,o,r))}}function Gl(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Bue(e){return e[0]}function Wue(e){return e[1]}const dp=1e-6;class da{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;const i=t+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>dp||Math.abs(this._y1-o)>dp)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class F4{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class Zue{constructor(t,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this;let o,a;const s=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,v=0,b=r.length,y,x;g<b;g+=3,v+=2){const $=r[g]*2,w=r[g+1]*2,M=r[g+2]*2,T=t[$],_=t[$+1],E=t[w],H=t[w+1],k=t[M],A=t[M+1],j=E-T,O=H-_,R=k-T,L=A-_,V=(j*L-O*R)*2;if(Math.abs(V)<1e-9){if(o===void 0){o=a=0;for(const P of n)o+=t[P*2],a+=t[P*2+1];o/=n.length,a/=n.length}const I=1e9*Math.sign((o-T)*L-(a-_)*R);y=(T+k)/2-I*L,x=(_+A)/2+I*R}else{const I=1/V,P=j*j+O*O,N=R*R+L*L;y=T+(L*P-O*N)*I,x=_+(j*N-R*P)*I}s[v]=y,s[v+1]=x}let l=n[n.length-1],c,u=l*4,d,f=t[2*l],h,m=t[2*l+1];i.fill(0);for(let g=0;g<n.length;++g)l=n[g],c=u,d=f,h=m,u=l*4,f=t[2*l],m=t[2*l+1],i[c+2]=i[u]=h-m,i[c+3]=i[u+1]=f-d}render(t){const n=t==null?t=new da:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:a,vectors:s}=this;if(o.length<=1)return null;for(let u=0,d=r.length;u<d;++u){const f=r[u];if(f<u)continue;const h=Math.floor(u/3)*2,m=Math.floor(f/3)*2,g=a[h],v=a[h+1],b=a[m],y=a[m+1];this._renderSegment(g,v,b,y,t)}let l,c=o[o.length-1];for(let u=0;u<o.length;++u){l=c,c=o[u];const d=Math.floor(i[c]/3)*2,f=a[d],h=a[d+1],m=l*4,g=this._project(f,h,s[m+2],s[m+3]);g&&this._renderSegment(f,h,g[0],g[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new da:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const r=n==null?n=new da:void 0,i=this._clip(t);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let o=i.length;for(;i[0]===i[o-2]&&i[1]===i[o-1]&&o>1;)o-=2;for(let a=2;a<o;a+=2)(i[a]!==i[a-2]||i[a+1]!==i[a-1])&&n.lineTo(i[a],i[a+1]);return n.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,r=t.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(t){const n=new F4;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,o){let a;const s=this._regioncode(t,n),l=this._regioncode(r,i);s===0&&l===0?(o.moveTo(t,n),o.lineTo(r,i)):(a=this._clipSegment(t,n,r,i,s,l))&&(o.moveTo(a[0],a[1]),o.lineTo(a[2],a[3]))}contains(t,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(t,n,r)===t}*neighbors(t){const n=this._clip(t);if(n)for(const r of this.delaunay.neighbors(t)){const i=this._clip(r);if(i){e:for(let o=0,a=n.length;o<a;o+=2)for(let s=0,l=i.length;s<l;s+=2)if(n[o]===i[s]&&n[o+1]===i[s+1]&&n[(o+2)%a]===i[(s+l-2)%l]&&n[(o+3)%a]===i[(s+l-1)%l]){yield r;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,a=r[t];if(a===-1)return null;const s=[];let l=a;do{const c=Math.floor(l/3);if(s.push(n[c*2],n[c*2+1]),l=l%3===2?l-2:l+1,o[l]!==t)break;l=i[l]}while(l!==a&&l!==-1);return s}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:r}=this,i=t*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(t,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(t,n))}_clipFinite(t,n){const r=n.length;let i=null,o,a,s=n[r-2],l=n[r-1],c,u=this._regioncode(s,l),d,f=0;for(let h=0;h<r;h+=2)if(o=s,a=l,s=n[h],l=n[h+1],c=u,u=this._regioncode(s,l),c===0&&u===0)d=f,f=0,i?i.push(s,l):i=[s,l];else{let m,g,v,b,y;if(c===0){if((m=this._clipSegment(o,a,s,l,c,u))===null)continue;[g,v,b,y]=m}else{if((m=this._clipSegment(s,l,o,a,u,c))===null)continue;[b,y,g,v]=m,d=f,f=this._edgecode(g,v),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(g,v):i=[g,v]}d=f,f=this._edgecode(b,y),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(b,y):i=[b,y]}if(i)d=f,f=this._edgecode(i[0],i[1]),d&&f&&this._edge(t,d,f,i,i.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(t,n,r,i,o,a){const s=o<a;for(s&&([t,n,r,i,o,a]=[r,i,t,n,a,o]);;){if(o===0&&a===0)return s?[r,i,t,n]:[t,n,r,i];if(o&a)return null;let l,c,u=o||a;u&8?(l=t+(r-t)*(this.ymax-n)/(i-n),c=this.ymax):u&4?(l=t+(r-t)*(this.ymin-n)/(i-n),c=this.ymin):u&2?(c=n+(i-n)*(this.xmax-t)/(r-t),l=this.xmax):(c=n+(i-n)*(this.xmin-t)/(r-t),l=this.xmin),o?(t=l,n=c,o=this._regioncode(t,n)):(r=l,i=c,a=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,o,a){let s=Array.from(n),l;if((l=this._project(s[0],s[1],r,i))&&s.unshift(l[0],l[1]),(l=this._project(s[s.length-2],s[s.length-1],o,a))&&s.push(l[0],l[1]),s=this._clipFinite(t,s))for(let c=0,u=s.length,d,f=this._edgecode(s[u-2],s[u-1]);c<u;c+=2)d=f,f=this._edgecode(s[c],s[c+1]),d&&f&&(c=this._edge(t,d,f,s,c),u=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,n,r,i,o){for(;n!==r;){let a,s;switch(n){case 5:n=4;continue;case 4:n=6,a=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,a=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,a=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,a=this.xmin,s=this.ymin;break}(i[o]!==a||i[o+1]!==s)&&this.contains(t,a,s)&&(i.splice(o,0,a,s),o+=2)}return o}_project(t,n,r,i){let o=1/0,a,s,l;if(i<0){if(n<=this.ymin)return null;(a=(this.ymin-n)/i)<o&&(l=this.ymin,s=t+(o=a)*r)}else if(i>0){if(n>=this.ymax)return null;(a=(this.ymax-n)/i)<o&&(l=this.ymax,s=t+(o=a)*r)}if(r>0){if(t>=this.xmax)return null;(a=(this.xmax-t)/r)<o&&(s=this.xmax,l=n+(o=a)*i)}else if(r<0){if(t<=this.xmin)return null;(a=(this.xmin-t)/r)<o&&(s=this.xmin,l=n+(o=a)*i)}return[s,l]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const r=(n+2)%t.length,i=(n+4)%t.length;(t[n]===t[r]&&t[r]===t[i]||t[n+1]===t[r+1]&&t[r+1]===t[i+1])&&(t.splice(r,2),n-=2)}t.length||(t=null)}return t}}const Uue=2*Math.PI,fs=Math.pow;function que(e){return e[0]}function Gue(e){return e[1]}function Yue(e){const{triangles:t,coords:n}=e;for(let r=0;r<t.length;r+=3){const i=2*t[r],o=2*t[r+1],a=2*t[r+2];if((n[a]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[a+1]-n[i+1])>1e-10)return!1}return!0}function Kue(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Oh{static from(t,n=que,r=Gue,i){return new Oh("length"in t?Xue(t,n,r,i):Float64Array.from(Que(t,n,r,i)))}constructor(t){this._delaunator=new wd(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&Yue(t)){this.collinear=Int32Array.from({length:n.length/2},(f,h)=>h).sort((f,h)=>n[2*f]-n[2*h]||n[2*f+1]-n[2*h+1]);const l=this.collinear[0],c=this.collinear[this.collinear.length-1],u=[n[2*l],n[2*l+1],n[2*c],n[2*c+1]],d=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let f=0,h=n.length/2;f<h;++f){const m=Kue(n[2*f],n[2*f+1],d);n[2*f]=m[0],n[2*f+1]=m[1]}this._delaunator=new wd(n)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let l=0,c=r.length;l<c;++l){const u=o[l%3===2?l-2:l+1];(r[l]===-1||a[u]===-1)&&(a[u]=l)}for(let l=0,c=i.length;l<c;++l)s[i[l]]=l;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],a[i[0]]=1,i.length===2&&(a[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new Zue(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:a,collinear:s}=this;if(s){const d=s.indexOf(t);d>0&&(yield s[d-1]),d<s.length-1&&(yield s[d+1]);return}const l=n[t];if(l===-1)return;let c=l,u=-1;do{if(yield u=a[c],c=c%3===2?c-2:c+1,a[c]!==t)return;if(c=o[c],c===-1){const d=r[(i[t]+1)%r.length];d!==u&&(yield d);return}}while(c!==l)}find(t,n,r=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const i=r;let o;for(;(o=this._step(r,t,n))>=0&&o!==r&&o!==i;)r=o;return o}_step(t,n,r){const{inedges:i,hull:o,_hullIndex:a,halfedges:s,triangles:l,points:c}=this;if(i[t]===-1||!c.length)return(t+1)%(c.length>>1);let u=t,d=fs(n-c[t*2],2)+fs(r-c[t*2+1],2);const f=i[t];let h=f;do{let m=l[h];const g=fs(n-c[m*2],2)+fs(r-c[m*2+1],2);if(g<d&&(d=g,u=m),h=h%3===2?h-2:h+1,l[h]!==t)break;if(h=s[h],h===-1){if(h=o[(a[t]+1)%o.length],h!==m&&fs(n-c[h*2],2)+fs(r-c[h*2+1],2)<d)return h;break}}while(h!==f);return u}render(t){const n=t==null?t=new da:void 0,{points:r,halfedges:i,triangles:o}=this;for(let a=0,s=i.length;a<s;++a){const l=i[a];if(l<a)continue;const c=o[a]*2,u=o[l]*2;t.moveTo(r[c],r[c+1]),t.lineTo(r[u],r[u+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const r=t==null?t=new da:void 0,{points:i}=this;for(let o=0,a=i.length;o<a;o+=2){const s=i[o],l=i[o+1];t.moveTo(s+n,l),t.arc(s,l,n,0,Uue)}return r&&r.value()}renderHull(t){const n=t==null?t=new da:void 0,{hull:r,points:i}=this,o=r[0]*2,a=r.length;t.moveTo(i[o],i[o+1]);for(let s=1;s<a;++s){const l=2*r[s];t.lineTo(i[l],i[l+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new F4;return this.renderHull(t),t.value()}renderTriangle(t,n){const r=n==null?n=new da:void 0,{points:i,triangles:o}=this,a=o[t*=3]*2,s=o[t+1]*2,l=o[t+2]*2;return n.moveTo(i[a],i[a+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[l],i[l+1]),n.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,r=t.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new F4;return this.renderTriangle(t,n),n.value()}}function Xue(e,t,n,r){const i=e.length,o=new Float64Array(i*2);for(let a=0;a<i;++a){const s=e[a];o[a*2]=t.call(r,s,a,e),o[a*2+1]=n.call(r,s,a,e)}return o}function*Que(e,t,n,r){let i=0;for(const o of e)yield t.call(r,o,i,e),yield n.call(r,o,i,e),++i}var Hh=function(e){return[e.x,e.y]},V1=GS,U$="cursor",q$="top",Jue=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?Hh:n,i=e.margin,o=i===void 0?V1:i;return t.map(function(a){var s=r(a),l=s[0],c=s[1];return[l+o.left,c+o.top]})},ede=function(e){var t=e.points,n=e.width,r=e.height,i=e.margin,o=i===void 0?V1:i,a=e.debug,s=Oh.from(t),l=a?s.voronoi([0,0,o.left+n+o.right,o.top+r+o.bottom]):void 0;return{points:t,delaunay:s,voronoi:l}},Vh=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?Hh:n,i=e.width,o=e.height,a=e.margin,s=a===void 0?V1:a,l=e.debug;return S.useMemo(function(){return ede({points:Jue({points:t,margin:s,getNodePosition:r}),width:i,height:o,margin:s,debug:l})},[t,i,o,s,l])},tde=function(e){var t=e.elementRef,n=e.nodes,r=e.getNodePosition,i=r===void 0?Hh:r,o=e.delaunay,a=e.setCurrent,s=e.margin,l=s===void 0?V1:s,c=e.detectionRadius,u=c===void 0?1/0:c,d=e.isInteractive,f=d===void 0||d,h=e.onMouseEnter,m=e.onMouseMove,g=e.onMouseLeave,v=e.onClick,b=e.onTouchStart,y=e.onTouchMove,x=e.onTouchEnd,$=e.enableTouchCrosshair,w=$!==void 0&&$,M=e.tooltip,T=e.tooltipPosition,_=T===void 0?U$:T,E=e.tooltipAnchor,H=E===void 0?q$:E,k=S.useState(null),A=k[0],j=k[1],O=S.useRef(null);S.useEffect(function(){O.current=A},[O,A]);var R=S.useCallback(function(J){if(!t.current)return null;var W=Sh(t.current,J),Z=W[0],U=W[1],F=o.find(Z,U),re=F!==void 0?n[F]:null;if(re&&u!==1/0){var B=i(re),ie=B[0],oe=B[1];vie(Z,U,ie+l.left,oe+l.top)>u&&(F=null,re=null)}return F===null||re===null?null:[F,re]},[t,o,n,i,l,u]),L=ci(),V=L.showTooltipAt,I=L.showTooltipFromEvent,P=L.hideTooltip,N=S.useMemo(function(){if(M)return _==="cursor"?function(J,W){I(M(J),W,H)}:function(J){var W=i(J),Z=W[0],U=W[1];V(M(J),[Z+l.left,U+l.top],H)}},[V,I,M,_,H,i,l]),z=S.useCallback(function(J){var W=R(J);if(j(W),a==null||a(W?W[1]:null),W){var Z=W[1];N==null||N(Z,J),h==null||h(W[1],J)}},[R,j,a,N,h]),q=S.useCallback(function(J){var W=R(J);if(j(W),W){var Z=W[0],U=W[1];if(a==null||a(U),N==null||N(U,J),O.current){var F=O.current,re=F[0],B=F[1];Z!==re?g==null||g(B,J):m==null||m(U,J)}else h==null||h(U,J)}else a==null||a(null),P==null||P(),O.current&&(g==null||g(O.current[1],J))},[R,j,O,h,m,g,N,P]),G=S.useCallback(function(J){j(null),a==null||a(null),P(),g&&O.current&&g(O.current[1],J)},[j,a,O,P,g]),Y=S.useCallback(function(J){var W=R(J);j(W),W&&(v==null||v(W[1],J))},[R,j,v]),ee=S.useCallback(function(J){var W=R(J);w&&(j(W),a==null||a(W?W[1]:null)),W&&(b==null||b(W[1],J))},[R,j,a,w,b]),Q=S.useCallback(function(J){var W=R(J);w&&(j(W),a==null||a(W?W[1]:null)),W&&(y==null||y(W[1],J))},[R,j,a,w,y]),K=S.useCallback(function(J){w&&(j(null),a==null||a(null)),x&&O.current&&x(O.current[1],J)},[w,j,a,x,O]);return{current:A,handleMouseEnter:f?z:void 0,handleMouseMove:f?q:void 0,handleMouseLeave:f?G:void 0,handleClick:f?Y:void 0,handleTouchStart:f?ee:void 0,handleTouchMove:f?Q:void 0,handleTouchEnd:f?K:void 0}},G$=function(e){var t=e.nodes,n=e.width,r=e.height,i=e.margin,o=i===void 0?V1:i,a=e.getNodePosition,s=e.setCurrent,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,m=e.onTouchEnd,g=e.enableTouchCrosshair,v=g!==void 0&&g,b=e.detectionRadius,y=b===void 0?1/0:b,x=e.tooltip,$=e.tooltipPosition,w=$===void 0?U$:$,M=e.tooltipAnchor,T=M===void 0?q$:M,_=e.debug,E=S.useRef(null),H=Vh({points:t,getNodePosition:a,width:n,height:r,margin:o,debug:_}),k=H.delaunay,A=H.voronoi,j=tde({elementRef:E,nodes:t,delaunay:k,margin:o,detectionRadius:y,setCurrent:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onTouchStart:f,onTouchMove:h,onTouchEnd:m,enableTouchCrosshair:v,tooltip:x,tooltipPosition:w,tooltipAnchor:T}),O=j.current,R=j.handleMouseEnter,L=j.handleMouseMove,V=j.handleMouseLeave,I=j.handleClick,P=j.handleTouchStart,N=j.handleTouchMove,z=j.handleTouchEnd,q=S.useMemo(function(){if(_&&A)return A.render()},[_,A]);return p.jsxs("g",{ref:E,transform:"translate("+-o.left+","+-o.top+")",children:[_&&A&&p.jsxs(p.Fragment,{children:[p.jsx("path",{d:q,stroke:"red",strokeWidth:1,opacity:.75}),y<1/0&&p.jsx("path",{stroke:"red",strokeWidth:.35,fill:"none",d:k.renderPoints(void 0,y)}),O&&p.jsx("path",{fill:"pink",opacity:.35,d:A.renderCell(O[0])})]}),p.jsx("rect",{"data-ref":"mesh-interceptor",width:o.left+n+o.right,height:o.top+r+o.bottom,fill:"red",opacity:0,style:{cursor:"auto"},onMouseEnter:R,onMouseMove:L,onMouseLeave:V,onTouchStart:P,onTouchMove:N,onTouchEnd:z,onClick:I})]})},Y$=function(e,t){e.save(),e.globalAlpha=.75,e.beginPath(),t.render(e),e.strokeStyle="red",e.lineWidth=1,e.stroke(),e.restore()},K$=function(e,t,n){e.save(),e.globalAlpha=.35,e.beginPath(),t.renderCell(n,e),e.fillStyle="pink",e.fill(),e.restore()};function Vr(){return Vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vr.apply(this,arguments)}function X$(e,t){if(e==null)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var nde=function(e){if(typeof e=="function")return e;if(Oa(e))return function(){return e};if(function(n){return Zo(n)}(e)){if(!Sf(e.key))throw new Error("symbolSize is invalid, key should be a string pointing to the property to use to determine node size");if(!Array.isArray(e.values)||e.values.length!==2)throw new Error("symbolSize is invalid, values spec should be an array containing two values, min and max");if(!Array.isArray(e.sizes)||e.sizes.length!==2)throw new Error("symbolSize is invalid, sizes spec should be an array containing two values, min and max");var t=qo().domain([e.values[0],e.values[1]]).range([e.sizes[0],e.sizes[1]]);return function(n){return t(bn(n,e.key))}}throw new Error("nodeSize is invalid, it should be either a function, a number or an object")},Q$=function(e){var t,n=e.data,r=e.xScaleSpec,i=e.xFormat,o=e.yScaleSpec,a=e.yFormat,s=e.width,l=e.height,c=e.nodeId,u=e.nodeSize,d=e.colors,f=S.useMemo(function(){return L$(n,r,o,s,l)},[n,r,o,s,l]),h=f.series,m=f.xScale,g=f.yScale,v=Po(i),b=Po(a),y=bi(c),x=S.useMemo(function(){return function(M){var T=M.series,_=M.formatX,E=M.formatY,H=M.getNodeId,k=[];return T.forEach(function(A){A.data.forEach(function(j,O){var R={index:k.length,serieIndex:O,serieId:A.id,x:j.position.x,xValue:j.data.x,formattedX:_(j.data.x),y:j.position.y,yValue:j.data.y,formattedY:E(j.data.y),data:j.data};k.push(Vr({},R,{id:H(R)}))})}),k}({series:h,formatX:v,formatY:b,getNodeId:y})},[h,v,b,y]),$=S.useMemo(function(){return nde(t)},[t=u]),w=E1(d,"serieId");return{xScale:m,yScale:g,nodes:S.useMemo(function(){return x.map(function(M){return Vr({},M,{size:$(M),color:w({serieId:M.serieId})})})},[x,$,w]),legendData:S.useMemo(function(){return h.map(function(M){return{id:M.id,label:M.id,color:w({serieId:M.id})}})},[h,w])}},J$=function(e,t){return Mue({data:e,annotations:t,getPosition:function(n){return{x:n.x,y:n.y}},getDimensions:function(n){return{size:n.size,width:n.size,height:n.size}}})},rde=function(e){return e/2},eM={xScale:{type:"linear",min:0,max:"auto"},yScale:{type:"linear",min:0,max:"auto"},enableGridX:!0,enableGridY:!0,axisBottom:{},axisLeft:{},nodeId:function(e){return e.serieId+"."+e.index},nodeSize:9,nodeComponent:function(e){var t=e.node,n=e.style,r=e.blendMode,i=e.isInteractive,o=e.onMouseEnter,a=e.onMouseMove,s=e.onMouseLeave,l=e.onClick,c=S.useCallback(function(h){return o==null?void 0:o(t,h)},[t,o]),u=S.useCallback(function(h){return a==null?void 0:a(t,h)},[t,a]),d=S.useCallback(function(h){return s==null?void 0:s(t,h)},[t,s]),f=S.useCallback(function(h){return l==null?void 0:l(t,h)},[t,l]);return p.jsx(et.circle,{cx:n.x,cy:n.y,r:n.size.to(rde),fill:n.color,style:{mixBlendMode:r},onMouseEnter:i?c:void 0,onMouseMove:i?u:void 0,onMouseLeave:i?d:void 0,onClick:i?f:void 0})},colors:{scheme:"nivo"},isInteractive:!0,debugMesh:!1,tooltip:function(e){var t=e.node;return p.jsx(Is,{id:t.serieId,value:"x: "+t.formattedX+", y: "+t.formattedY,enableChip:!0,color:t.color})},markers:[],legends:[],annotations:[]},mn=Vr({},eM,{blendMode:"normal",layers:["grid","axes","nodes","markers","mesh","legends","annotations"],role:"img",useMesh:!0,animate:!0,motionConfig:"default"}),rr=Vr({},eM,{layers:["grid","axes","nodes","mesh","legends","annotations"],pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,renderNode:function(e,t){e.beginPath(),e.arc(t.x,t.y,t.size/2,0,2*Math.PI),e.fillStyle=t.color,e.fill()}}),ide=function(e){var t=e.nodes,n=e.annotations,r=J$(t,n);return p.jsx(p.Fragment,{children:r.map(function(i,o){return p.jsx(Tue,Vr({},i),o)})})},ode=function(e){return e.id},H2=function(e){return{x:e.x,y:e.y,size:e.size,color:e.color}},ade=function(e){return{x:e.x,y:e.y,size:0,color:e.color}},sde=function(e){var t=e.nodes,n=e.nodeComponent,r=e.isInteractive,i=e.onMouseEnter,o=e.onMouseMove,a=e.onMouseLeave,s=e.onClick,l=e.tooltip,c=e.blendMode,u=Fn(),d=u.animate,f=u.config,h=Cr(t,{keys:ode,from:H2,enter:H2,update:H2,leave:ade,config:f,immediate:!d}),m=ci(),g=m.showTooltipFromEvent,v=m.hideTooltip,b=S.useCallback(function(w,M){g(S.createElement(l,{node:w}),M),i==null||i(w,M)},[l,g,i]),y=S.useCallback(function(w,M){g(S.createElement(l,{node:w}),M),o==null||o(w,M)},[l,g,o]),x=S.useCallback(function(w,M){v(),a==null||a(w,M)},[v,a]),$=S.useCallback(function(w,M){return s==null?void 0:s(w,M)},[s]);return p.jsx(p.Fragment,{children:h(function(w,M){return S.createElement(n,{node:M,style:w,blendMode:c,isInteractive:r,onMouseEnter:r?b:void 0,onMouseMove:r?y:void 0,onMouseLeave:r?x:void 0,onClick:r?$:void 0})})})},lde=function(e){var t=e.nodes,n=e.width,r=e.height,i=e.onMouseEnter,o=e.onMouseMove,a=e.onMouseLeave,s=e.onClick,l=e.tooltip,c=e.debug,u=ci(),d=u.showTooltipFromEvent,f=u.hideTooltip,h=S.useCallback(function(b,y){d(S.createElement(l,{node:b}),y),i&&i(b,y)},[d,l,i]),m=S.useCallback(function(b,y){d(S.createElement(l,{node:b}),y),o&&o(b,y)},[d,l,o]),g=S.useCallback(function(b,y){f(),a&&a(b,y)},[f,a]),v=S.useCallback(function(b,y){s&&s(b,y)},[s]);return p.jsx(G$,{nodes:t,width:n,height:r,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,onClick:v,debug:c})},cde=["isInteractive","animate","motionConfig","theme","renderWrapper"],ude=function(e){var t=e.data,n=e.xScale,r=n===void 0?mn.xScale:n,i=e.xFormat,o=e.yScale,a=o===void 0?mn.yScale:o,s=e.yFormat,l=e.width,c=e.height,u=e.margin,d=e.layers,f=d===void 0?mn.layers:d,h=e.colors,m=h===void 0?mn.colors:h,g=e.blendMode,v=g===void 0?mn.blendMode:g,b=e.nodeId,y=b===void 0?mn.nodeId:b,x=e.nodeSize,$=x===void 0?mn.nodeSize:x,w=e.nodeComponent,M=w===void 0?mn.nodeComponent:w,T=e.enableGridX,_=T===void 0?mn.enableGridX:T,E=e.enableGridY,H=E===void 0?mn.enableGridY:E,k=e.gridXValues,A=e.gridYValues,j=e.axisTop,O=e.axisRight,R=e.axisBottom,L=R===void 0?mn.axisBottom:R,V=e.axisLeft,I=V===void 0?mn.axisLeft:V,P=e.annotations,N=P===void 0?mn.annotations:P,z=e.isInteractive,q=z===void 0?mn.isInteractive:z,G=e.useMesh,Y=G===void 0?mn.useMesh:G,ee=e.debugMesh,Q=ee===void 0?mn.debugMesh:ee,K=e.onMouseEnter,J=e.onMouseMove,W=e.onMouseLeave,Z=e.onClick,U=e.tooltip,F=U===void 0?mn.tooltip:U,re=e.markers,B=re===void 0?mn.markers:re,ie=e.legends,oe=ie===void 0?mn.legends:ie,ve=e.role,Ce=ve===void 0?mn.role:ve,pe=e.ariaLabel,ye=e.ariaLabelledBy,Se=e.ariaDescribedBy,me=Za(l,c,u),ge=me.margin,ce=me.innerWidth,$e=me.innerHeight,he=me.outerWidth,Ae=me.outerHeight,Ie=Q$({data:t,xScaleSpec:r,xFormat:i,yScaleSpec:a,yFormat:s,width:ce,height:$e,nodeId:y,nodeSize:$,colors:m}),Te=Ie.xScale,ke=Ie.yScale,Ye=Ie.nodes,Xe=Ie.legendData,Fe=S.useMemo(function(){return{xScale:Te,yScale:ke,nodes:Ye,margin:ge,innerWidth:ce,innerHeight:$e,outerWidth:he,outerHeight:Ae}},[Te,ke,Ye,ge,ce,$e,he,Ae]),Le={grid:null,axes:null,nodes:null,markers:null,mesh:null,annotations:null,legends:null};return f.includes("grid")&&(Le.grid=p.jsx(B$,{width:ce,height:$e,xScale:_?Te:null,yScale:H?ke:null,xValues:k,yValues:A},"grid")),f.includes("axes")&&(Le.axes=p.jsx(z$,{xScale:Te,yScale:ke,width:ce,height:$e,top:j,right:O,bottom:L,left:I},"axes")),f.includes("nodes")&&(Le.nodes=p.jsx(sde,{nodes:Ye,nodeComponent:M,isInteractive:q,tooltip:F,blendMode:v,onMouseEnter:K,onMouseMove:J,onMouseLeave:W,onClick:Z},"nodes")),f.includes("markers")&&(Le.markers=p.jsx(s$,{markers:B,width:ce,height:$e,xScale:Te,yScale:ke},"markers")),f.includes("mesh")&&q&&Y&&(Le.mesh=p.jsx(lde,{nodes:Ye,width:ce,height:$e,onMouseEnter:K,onMouseMove:J,onMouseLeave:W,onClick:Z,tooltip:F,debug:Q},"mesh")),f.includes("annotations")&&(Le.annotations=p.jsx(ide,{nodes:Ye,annotations:N},"annotations")),f.includes("legends")&&(Le.legends=oe.map(function(Qe,Ze){return p.jsx(If,Vr({},Qe,{containerWidth:ce,containerHeight:$e,data:Xe}),Ze)})),p.jsx(Sl,{width:he,height:Ae,margin:ge,role:Ce,ariaLabel:pe,ariaLabelledBy:ye,ariaDescribedBy:Se,children:f.map(function(Qe,Ze){if(typeof Qe=="string"&&Le[Qe]!==void 0)return Le[Qe];if(typeof Qe=="function")return p.jsx(S.Fragment,{children:S.createElement(Qe,Fe)},Ze);throw new Error("Unknown layer ("+Qe+")")})})},dde=function(e){var t=e.isInteractive,n=t===void 0?mn.isInteractive:t,r=e.animate,i=r===void 0?mn.animate:r,o=e.motionConfig,a=o===void 0?mn.motionConfig:o,s=e.theme,l=e.renderWrapper,c=X$(e,cde);return p.jsx(Ua,{animate:i,isInteractive:n,motionConfig:a,renderWrapper:l,theme:s,children:p.jsx(ude,Vr({isInteractive:n},c))})},tM=function(e){return p.jsx(Go,{children:function(t){var n=t.width,r=t.height;return p.jsx(dde,Vr({width:n,height:r},e))}})},fde=["isInteractive","renderWrapper","theme"],hde=function(e){var t=e.data,n=e.xScale,r=n===void 0?rr.xScale:n,i=e.xFormat,o=e.yScale,a=o===void 0?rr.yScale:o,s=e.yFormat,l=e.width,c=e.height,u=e.margin,d=e.pixelRatio,f=d===void 0?rr.pixelRatio:d,h=e.layers,m=h===void 0?rr.layers:h,g=e.colors,v=g===void 0?rr.colors:g,b=e.nodeId,y=b===void 0?mn.nodeId:b,x=e.nodeSize,$=x===void 0?rr.nodeSize:x,w=e.renderNode,M=w===void 0?rr.renderNode:w,T=e.enableGridX,_=T===void 0?rr.enableGridX:T,E=e.gridXValues,H=e.enableGridY,k=H===void 0?rr.enableGridY:H,A=e.gridYValues,j=e.axisTop,O=e.axisRight,R=e.axisBottom,L=R===void 0?rr.axisBottom:R,V=e.axisLeft,I=V===void 0?rr.axisLeft:V,P=e.annotations,N=P===void 0?rr.annotations:P,z=e.isInteractive,q=z===void 0?rr.isInteractive:z,G=e.debugMesh,Y=G===void 0?rr.debugMesh:G,ee=e.onMouseEnter,Q=e.onMouseMove,K=e.onMouseLeave,J=e.onClick,W=e.tooltip,Z=W===void 0?rr.tooltip:W,U=e.legends,F=U===void 0?rr.legends:U,re=e.canvasRef,B=S.useRef(null),ie=Wt(),oe=S.useState(null),ve=oe[0],Ce=oe[1],pe=Za(l,c,u),ye=pe.margin,Se=pe.innerWidth,me=pe.innerHeight,ge=pe.outerWidth,ce=pe.outerHeight,$e=Q$({data:t,xScaleSpec:r,xFormat:i,yScaleSpec:a,yFormat:s,width:Se,height:me,nodeId:y,nodeSize:$,colors:v}),he=$e.xScale,Ae=$e.yScale,Ie=$e.nodes,Te=$e.legendData,ke=J$(Ie,N),Ye=Vh({points:Ie,width:Se,height:me,debug:Y}),Xe=Ye.delaunay,Fe=Ye.voronoi,Le=S.useMemo(function(){return{xScale:he,yScale:Ae,nodes:Ie,margin:ye,innerWidth:Se,innerHeight:me,outerWidth:ge,outerHeight:ce}},[he,Ae,Ie,ye,Se,me,ge,ce]);S.useEffect(function(){if(B.current){B.current.width=ge*f,B.current.height=ce*f;var Ne=B.current.getContext("2d");Ne.scale(f,f),Ne.fillStyle=ie.background,Ne.fillRect(0,0,ge,ce),Ne.translate(ye.left,ye.top),m.forEach(function(ze){if(ze==="grid")Ne.lineWidth=ie.grid.line.strokeWidth,Ne.strokeStyle=ie.grid.line.stroke,_&&xd(Ne,{width:Se,height:me,scale:he,axis:"x",values:E}),k&&xd(Ne,{width:Se,height:me,scale:Ae,axis:"y",values:A});else if(ze==="annotations")Rue(Ne,{annotations:ke,theme:ie});else if(ze==="axes")W$(Ne,{xScale:he,yScale:Ae,width:Se,height:me,top:j,right:O,bottom:L,left:I,theme:ie});else if(ze==="nodes")Ie.forEach(function(De){M(Ne,De)});else if(ze==="mesh")Y&&(Y$(Ne,Fe),ve&&K$(Ne,Fe,ve.index));else if(ze==="legends")F.forEach(function(De){v$(Ne,Vr({},De,{data:Te,containerWidth:Se,containerHeight:me,theme:ie}))});else{if(typeof ze!="function")throw new Error("Invalid layer: "+ze);ze(Ne,Le)}})}},[B,Se,me,ge,ce,ye.top,ye.left,f,M,m,Le,ie,he,Ae,Ie,_,k,j,O,L,I,F,Te,Y,Fe,ve,ke]);var Qe=ci(),Ze=Qe.showTooltipFromEvent,qe=Qe.hideTooltip,de=S.useCallback(function(Ne){var ze=Sh(B.current,Ne),De=ze[0],Je=ze[1];if(!c$(ye.left,ye.top,Se,me,De,Je))return null;var tt=Xe.find(De-ye.left,Je-ye.top);return Ie[tt]},[B,ye,Se,me,Xe]),_e=S.useCallback(function(Ne){var ze=de(Ne);Ce(ze),ze?(Ze(S.createElement(Z,{node:ze}),Ne),ve&&ve.id!==ze.id&&(K&&K(ve,Ne),ee&&ee(ze,Ne)),ve||ee&&ee(ze,Ne),Q&&Q(ze,Ne)):(qe(),ve&&K&&K(ve,Ne))},[de,ve,Ce,Ze,qe,Z,ee,Q,K]),Ke=S.useCallback(function(Ne){qe(),Ce(null),ve&&K&&K(ve,Ne)},[qe,ve,Ce,K]),nt=S.useCallback(function(Ne){if(J){var ze=de(Ne);ze&&J(ze,Ne)}},[de,J]);return p.jsx("canvas",{ref:function(Ne){B.current=Ne,re&&"current"in re&&(re.current=Ne)},width:ge*f,height:ce*f,style:{width:ge,height:ce,cursor:q?"auto":"normal"},onMouseEnter:q?_e:void 0,onMouseMove:q?_e:void 0,onMouseLeave:q?Ke:void 0,onClick:q?nt:void 0})},gde=S.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,o=X$(e,fde);return p.jsx(Ua,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:p.jsx(hde,Vr({},o,{canvasRef:t}))})});S.forwardRef(function(e,t){return p.jsx(Go,{children:function(n){var r=n.width,i=n.height;return p.jsx(gde,Vr({width:r,height:i},e,{ref:t}))}})});const vde=({x1:e,x2:t,y1:n,y2:r})=>p.jsx("g",{children:p.jsx("line",{x1:e,y1:n,x2:t,y2:r,stroke:"red",strokeWidth:"3"})}),mde=({scatterPlotData:e,style:t={},margin:n={},axisBottom:r={},axisLeft:i={},tooltip:o=null})=>{var h,m;const a=e==null?void 0:e.line,s=a==null?void 0:a.x1,l=a==null?void 0:a.y1,c=a==null?void 0:a.x2,u=a==null?void 0:a.y2,d=(m=(h=e==null?void 0:e.points)==null?void 0:h.data)==null?void 0:m.map(g=>g.y);Math.min(l,u,...d);const f=Math.max(l,u,...d);return p.jsxs(p.Fragment,{children:[p.jsx(yn,{}),p.jsx("div",{style:{width:"100%",height:600,...t},children:p.jsx(tM,{data:[e==null?void 0:e.points],margin:{top:20,right:120,bottom:100,left:120,...n},xScale:{type:"point"},yScale:{type:"linear",min:0,max:f,reverse:!1},axisBottom:{orient:"bottom",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:46,truncateTickAt:0,legend:"axisBottom",...r},axisLeft:{orient:"left",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:-60,truncateTickAt:0,legend:"axisLeft",...i},layers:["grid","markers","axes","nodes","legends",g=>p.jsx(vde,{x1:g.xScale(s),y1:g.yScale(l),x2:g.xScale(c),y2:g.yScale(u)})],tooltip:({node:g})=>p.jsx(Zn,{body:(o==null?void 0:o({node:g}))||p.jsx("span",{children:"Scatterplot tooltip"})})})})]})};function pde(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}var bde=pde;function yde(e){return function(t){return e==null?void 0:e[t]}}var Cde=yde,xde=Cde,wde={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Sde=xde(wde),$de=Sde,Mde=$de,Ede=y1,_de=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ode="\\u0300-\\u036f",Hde="\\ufe20-\\ufe2f",Vde="\\u20d0-\\u20ff",Tde=Ode+Hde+Vde,Rde="["+Tde+"]",kde=RegExp(Rde,"g");function Lde(e){return e=Ede(e),e&&e.replace(_de,Mde).replace(kde,"")}var jde=Lde,Pde=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ide(e){return e.match(Pde)||[]}var Ade=Ide,Nde=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Fde(e){return Nde.test(e)}var Dde=Fde,nM="\\ud800-\\udfff",zde="\\u0300-\\u036f",Bde="\\ufe20-\\ufe2f",Wde="\\u20d0-\\u20ff",Zde=zde+Bde+Wde,rM="\\u2700-\\u27bf",iM="a-z\\xdf-\\xf6\\xf8-\\xff",Ude="\\xac\\xb1\\xd7\\xf7",qde="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Gde="\\u2000-\\u206f",Yde=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",oM="A-Z\\xc0-\\xd6\\xd8-\\xde",Kde="\\ufe0e\\ufe0f",aM=Ude+qde+Gde+Yde,sM="['’]",fp="["+aM+"]",Xde="["+Zde+"]",lM="\\d+",Qde="["+rM+"]",cM="["+iM+"]",uM="[^"+nM+aM+lM+rM+iM+oM+"]",Jde="\\ud83c[\\udffb-\\udfff]",efe="(?:"+Xde+"|"+Jde+")",tfe="[^"+nM+"]",dM="(?:\\ud83c[\\udde6-\\uddff]){2}",fM="[\\ud800-\\udbff][\\udc00-\\udfff]",vs="["+oM+"]",nfe="\\u200d",hp="(?:"+cM+"|"+uM+")",rfe="(?:"+vs+"|"+uM+")",gp="(?:"+sM+"(?:d|ll|m|re|s|t|ve))?",vp="(?:"+sM+"(?:D|LL|M|RE|S|T|VE))?",hM=efe+"?",gM="["+Kde+"]?",ife="(?:"+nfe+"(?:"+[tfe,dM,fM].join("|")+")"+gM+hM+")*",ofe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",afe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sfe=gM+hM+ife,lfe="(?:"+[Qde,dM,fM].join("|")+")"+sfe,cfe=RegExp([vs+"?"+cM+"+"+gp+"(?="+[fp,vs,"$"].join("|")+")",rfe+"+"+vp+"(?="+[fp,vs+hp,"$"].join("|")+")",vs+"?"+hp+"+"+gp,vs+"+"+vp,afe,ofe,lM,lfe].join("|"),"g");function ufe(e){return e.match(cfe)||[]}var dfe=ufe,ffe=Ade,hfe=Dde,gfe=y1,vfe=dfe;function mfe(e,t,n){return e=gfe(e),t=n?void 0:t,t===void 0?hfe(e)?vfe(e):ffe(e):e.match(t)||[]}var pfe=mfe,bfe=bde,yfe=jde,Cfe=pfe,xfe="['’]",wfe=RegExp(xfe,"g");function Sfe(e){return function(t){return bfe(Cfe(yfe(t).replace(wfe,"")),e,"")}}var $fe=Sfe,Mfe=Z$;function Efe(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Mfe(e,t,n)}var _fe=Efe,Ofe="\\ud800-\\udfff",Hfe="\\u0300-\\u036f",Vfe="\\ufe20-\\ufe2f",Tfe="\\u20d0-\\u20ff",Rfe=Hfe+Vfe+Tfe,kfe="\\ufe0e\\ufe0f",Lfe="\\u200d",jfe=RegExp("["+Lfe+Ofe+Rfe+kfe+"]");function Pfe(e){return jfe.test(e)}var vM=Pfe;function Ife(e){return e.split("")}var Afe=Ife,mM="\\ud800-\\udfff",Nfe="\\u0300-\\u036f",Ffe="\\ufe20-\\ufe2f",Dfe="\\u20d0-\\u20ff",zfe=Nfe+Ffe+Dfe,Bfe="\\ufe0e\\ufe0f",Wfe="["+mM+"]",D4="["+zfe+"]",z4="\\ud83c[\\udffb-\\udfff]",Zfe="(?:"+D4+"|"+z4+")",pM="[^"+mM+"]",bM="(?:\\ud83c[\\udde6-\\uddff]){2}",yM="[\\ud800-\\udbff][\\udc00-\\udfff]",Ufe="\\u200d",CM=Zfe+"?",xM="["+Bfe+"]?",qfe="(?:"+Ufe+"(?:"+[pM,bM,yM].join("|")+")"+xM+CM+")*",Gfe=xM+CM+qfe,Yfe="(?:"+[pM+D4+"?",D4,bM,yM,Wfe].join("|")+")",Kfe=RegExp(z4+"(?="+z4+")|"+Yfe+Gfe,"g");function Xfe(e){return e.match(Kfe)||[]}var Qfe=Xfe,Jfe=Afe,e0e=vM,t0e=Qfe;function n0e(e){return e0e(e)?t0e(e):Jfe(e)}var r0e=n0e,i0e=_fe,o0e=vM,a0e=r0e,s0e=y1;function l0e(e){return function(t){t=s0e(t);var n=o0e(t)?a0e(t):void 0,r=n?n[0]:t.charAt(0),i=n?i0e(n,1).join(""):t.slice(1);return r[e]()+i}}var c0e=l0e,u0e=c0e,d0e=u0e("toUpperCase"),f0e=d0e,h0e=$fe,g0e=f0e,v0e=h0e(function(e,t,n){return e+(n?" ":"")+g0e(t)}),m0e=v0e;const p0e=xn(m0e);function b0e(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function y0e(){return this.eachAfter(b0e)}function C0e(e){var t=this,n,r=[t],i,o,a;do for(n=r.reverse(),r=[];t=n.pop();)if(e(t),i=t.children,i)for(o=0,a=i.length;o<a;++o)r.push(i[o]);while(r.length);return this}function x0e(e){for(var t=this,n=[t],r,i;t=n.pop();)if(e(t),r=t.children,r)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function w0e(e){for(var t=this,n=[t],r=[],i,o,a;t=n.pop();)if(r.push(t),i=t.children,i)for(o=0,a=i.length;o<a;++o)n.push(i[o]);for(;t=r.pop();)e(t);return this}function S0e(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function $0e(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function M0e(e){for(var t=this,n=E0e(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function E0e(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function _0e(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function O0e(){var e=[];return this.each(function(t){e.push(t)}),e}function H0e(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function V0e(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function Th(e,t){var n=new Sd(e),r=+e.value&&(n.value=e.value),i,o=[n],a,s,l,c;for(t==null&&(t=R0e);i=o.pop();)if(r&&(i.value=+i.data.value),(s=t(i.data))&&(c=s.length))for(i.children=new Array(c),l=c-1;l>=0;--l)o.push(a=i.children[l]=new Sd(s[l])),a.parent=i,a.depth=i.depth+1;return n.eachBefore(L0e)}function T0e(){return Th(this).eachBefore(k0e)}function R0e(e){return e.children}function k0e(e){e.data=e.data.data}function L0e(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Sd(e){this.data=e,this.depth=this.height=0,this.parent=null}Sd.prototype=Th.prototype={constructor:Sd,count:y0e,each:C0e,eachAfter:w0e,eachBefore:x0e,sum:S0e,sort:$0e,path:M0e,ancestors:_0e,descendants:O0e,leaves:H0e,links:V0e,copy:T0e};function j0e(e){if(typeof e!="function")throw new Error;return e}function Yl(){return 0}function Kl(e){return function(){return e}}function P0e(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Rh(e,t,n,r,i){for(var o=e.children,a,s=-1,l=o.length,c=e.value&&(r-t)/e.value;++s<l;)a=o[s],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*c}function kh(e,t,n,r,i){for(var o=e.children,a,s=-1,l=o.length,c=e.value&&(i-n)/e.value;++s<l;)a=o[s],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var I0e=(1+Math.sqrt(5))/2;function A0e(e,t,n,r,i,o){for(var a=[],s=t.children,l,c,u=0,d=0,f=s.length,h,m,g=t.value,v,b,y,x,$,w,M;u<f;){h=i-n,m=o-r;do v=s[d++].value;while(!v&&d<f);for(b=y=v,w=Math.max(m/h,h/m)/(g*e),M=v*v*w,$=Math.max(y/M,M/b);d<f;++d){if(v+=c=s[d].value,c<b&&(b=c),c>y&&(y=c),M=v*v*w,x=Math.max(y/M,M/b),x>$){v-=c;break}$=x}a.push(l={value:v,dice:h<m,children:s.slice(u,d)}),l.dice?Rh(l,n,r,i,g?r+=m*v/g:o):kh(l,n,r,g?n+=h*v/g:i,o),g-=v,u=d}return a}const wM=function e(t){function n(r,i,o,a,s){A0e(t,r,i,o,a,s)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(I0e);function N0e(){var e=wM,t=!1,n=1,r=1,i=[0],o=Yl,a=Yl,s=Yl,l=Yl,c=Yl;function u(f){return f.x0=f.y0=0,f.x1=n,f.y1=r,f.eachBefore(d),i=[0],t&&f.eachBefore(P0e),f}function d(f){var h=i[f.depth],m=f.x0+h,g=f.y0+h,v=f.x1-h,b=f.y1-h;v<m&&(m=v=(m+v)/2),b<g&&(g=b=(g+b)/2),f.x0=m,f.y0=g,f.x1=v,f.y1=b,f.children&&(h=i[f.depth+1]=o(f)/2,m+=c(f)-h,g+=a(f)-h,v-=s(f)-h,b-=l(f)-h,v<m&&(m=v=(m+v)/2),b<g&&(g=b=(g+b)/2),e(f,m,g,v,b))}return u.round=function(f){return arguments.length?(t=!!f,u):t},u.size=function(f){return arguments.length?(n=+f[0],r=+f[1],u):[n,r]},u.tile=function(f){return arguments.length?(e=j0e(f),u):e},u.padding=function(f){return arguments.length?u.paddingInner(f).paddingOuter(f):u.paddingInner()},u.paddingInner=function(f){return arguments.length?(o=typeof f=="function"?f:Kl(+f),u):o},u.paddingOuter=function(f){return arguments.length?u.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):u.paddingTop()},u.paddingTop=function(f){return arguments.length?(a=typeof f=="function"?f:Kl(+f),u):a},u.paddingRight=function(f){return arguments.length?(s=typeof f=="function"?f:Kl(+f),u):s},u.paddingBottom=function(f){return arguments.length?(l=typeof f=="function"?f:Kl(+f),u):l},u.paddingLeft=function(f){return arguments.length?(c=typeof f=="function"?f:Kl(+f),u):c},u}function F0e(e,t,n,r,i){var o=e.children,a,s=o.length,l,c=new Array(s+1);for(c[0]=l=a=0;a<s;++a)c[a+1]=l+=o[a].value;u(0,s,e.value,t,n,r,i);function u(d,f,h,m,g,v,b){if(d>=f-1){var y=o[d];y.x0=m,y.y0=g,y.x1=v,y.y1=b;return}for(var x=c[d],$=h/2+x,w=d+1,M=f-1;w<M;){var T=w+M>>>1;c[T]<$?w=T+1:M=T}$-c[w-1]<c[w]-$&&d+1<w&&--w;var _=c[w]-x,E=h-_;if(v-m>b-g){var H=(m*E+v*_)/h;u(d,w,_,m,g,H,b),u(w,f,E,H,g,v,b)}else{var k=(g*E+b*_)/h;u(d,w,_,m,g,v,k),u(w,f,E,m,k,v,b)}}}function D0e(e,t,n,r,i){(e.depth&1?kh:Rh)(e,t,n,r,i)}function Tr(){return Tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tr.apply(this,arguments)}function z0e(e,t){if(e==null)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var B0e=function(e,t){return Vn([e,t],function(n,r){return"translate("+n+","+r+")"})},W0e=function(e,t){return Vn([e,t],function(n,r){return"translate("+n+"px, "+r+"px)"})},mp=function(e,t,n){return Vn([e,t,n],function(r,i,o){return"translate("+r+","+i+") rotate("+o+")"})},Z0e=function(e,t,n){return Vn([e,t,n],function(r,i,o){return"translate("+r+"px,"+i+"px) rotate("+o+"deg)"})},U0e=function(e,t,n){return Vn([e,t,n],function(r,i,o){return"translate("+(r-(o===0?0:5))+"px,"+(i-(o===0?5:0))+"px) rotate("+o+"deg)"})},q0e=S.memo(function(e){var t=e.node,n=e.animatedProps,r=e.borderWidth,i=e.enableLabel,o=e.enableParentLabel,a=e.labelSkipSize,s=Wt(),l=i&&t.isLeaf&&(a===0||Math.min(t.width,t.height)>a),c=o&&t.isParent;return p.jsxs(et.g,{transform:B0e(n.x,n.y),children:[p.jsx(et.rect,{"data-testid":"node."+t.id,width:Vn(n.width,function(u){return Math.max(u,0)}),height:Vn(n.height,function(u){return Math.max(u,0)}),fill:t.fill?t.fill:n.color,strokeWidth:r,stroke:t.borderColor,fillOpacity:t.opacity,onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),l&&p.jsx(et.text,{"data-testid":"label."+t.id,textAnchor:"middle",dominantBaseline:"central",style:Tr({},s.labels.text,{fill:t.labelTextColor,pointerEvents:"none"}),fillOpacity:n.labelOpacity,transform:mp(n.labelX,n.labelY,n.labelRotation),children:t.label}),c&&p.jsx(et.text,{"data-testid":"parentLabel."+t.id,dominantBaseline:"central",style:Tr({},s.labels.text,{fill:t.parentLabelTextColor,pointerEvents:"none"}),fillOpacity:n.parentLabelOpacity,transform:mp(n.parentLabelX,n.parentLabelY,n.parentLabelRotation),children:t.parentLabel})]})}),G0e=S.memo(function(e){var t=e.node;return p.jsx(Is,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})}),Y0e=S.memo(function(e){var t=e.node,n=e.animatedProps,r=e.borderWidth,i=e.enableLabel,o=e.enableParentLabel,a=e.labelSkipSize,s=Wt(),l=i&&t.isLeaf&&(a===0||Math.min(t.width,t.height)>a),c=o&&t.isParent;return p.jsxs(et.div,{"data-testid":"node."+t.id,id:t.path.replace(/[^\w]/gi,"-"),style:{boxSizing:"border-box",position:"absolute",top:0,left:0,transform:W0e(n.x,n.y),width:n.width,height:n.height,borderWidth:r,borderStyle:"solid",borderColor:t.borderColor,overflow:"hidden"},children:[p.jsx(et.div,{style:{boxSizing:"border-box",position:"absolute",top:0,left:0,opacity:t.opacity,width:n.width,height:n.height,background:n.color},onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),l&&p.jsx(et.span,{"data-testid":"label."+t.id,style:Tr({},s.labels.text,{position:"absolute",display:"flex",top:-5,left:-5,width:10,height:10,justifyContent:"center",alignItems:"center",whiteSpace:"nowrap",color:t.labelTextColor,transformOrigin:"center center",transform:Z0e(n.labelX,n.labelY,n.labelRotation),opacity:n.labelOpacity,pointerEvents:"none"}),children:t.label}),c&&p.jsx(et.span,{"data-testid":"parentLabel."+t.id,style:Tr({},s.labels.text,{position:"absolute",display:"flex",justifyContent:"flex-start",alignItems:"center",whiteSpace:"nowrap",width:10,height:10,color:t.parentLabelTextColor,transformOrigin:"top left",transform:U0e(n.parentLabelX,n.parentLabelY,n.parentLabelRotation),opacity:n.parentLabelOpacity,pointerEvents:"none"}),children:t.parentLabel})]})}),$n={layers:["nodes"],identity:"id",value:"value",tile:"squarify",leavesOnly:!1,innerPadding:0,outerPadding:0,colors:{scheme:"nivo"},colorBy:"pathComponents.1",nodeOpacity:.33,enableLabel:!0,label:"formattedValue",labelSkipSize:0,labelTextColor:{from:"color",modifiers:[["darker",1]]},orientLabel:!0,enableParentLabel:!0,parentLabel:"id",parentLabelSize:20,parentLabelPosition:"top",parentLabelPadding:6,parentLabelTextColor:{from:"color",modifiers:[["darker",1]]},borderWidth:1,borderColor:{from:"color",modifiers:[["darker",1]]},isInteractive:!0,tooltip:G0e,role:"img",animate:!0,motionConfig:"gentle"},Zt=Tr({},$n,{nodeComponent:q0e,defs:[],fill:[]});Tr({},$n,{nodeComponent:Y0e});Tr({},$n,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var K0e={binary:F0e,dice:Rh,slice:kh,sliceDice:D0e,squarify:wM},X0e=function(e){var t=e.root,n=e.getValue;return S.useMemo(function(){return Th(t).sum(n)},[t,n])},Q0e=function(e){var t=e.data,n=e.width,r=e.height,i=e.identity,o=i===void 0?$n.identity:i,a=e.value,s=a===void 0?$n.value:a,l=e.valueFormat,c=e.leavesOnly,u=c===void 0?$n.leavesOnly:c,d=e.tile,f=d===void 0?$n.tile:d,h=e.innerPadding,m=h===void 0?$n.innerPadding:h,g=e.outerPadding,v=g===void 0?$n.outerPadding:g,b=e.label,y=b===void 0?$n.label:b,x=e.orientLabel,$=x===void 0?$n.orientLabel:x,w=e.enableParentLabel,M=w===void 0?$n.enableParentLabel:w,T=e.parentLabel,_=T===void 0?$n.parentLabel:T,E=e.parentLabelSize,H=E===void 0?$n.parentLabelSize:E,k=e.parentLabelPosition,A=k===void 0?$n.parentLabelPosition:k,j=e.parentLabelPadding,O=j===void 0?$n.parentLabelPadding:j,R=e.colors,L=R===void 0?$n.colors:R,V=e.colorBy,I=V===void 0?$n.colorBy:V,P=e.nodeOpacity,N=P===void 0?$n.nodeOpacity:P,z=e.borderColor,q=z===void 0?$n.borderColor:z,G=e.labelTextColor,Y=G===void 0?$n.labelTextColor:G,ee=e.parentLabelTextColor,Q=ee===void 0?$n.parentLabelTextColor:ee,K=bi(o),J=bi(s),W=Po(l),Z=bi(y),U=bi(_),F=function(me){var ge=me.width,ce=me.height,$e=me.tile,he=me.innerPadding,Ae=me.outerPadding,Ie=me.enableParentLabel,Te=me.parentLabelSize,ke=me.parentLabelPosition,Ye=me.leavesOnly;return S.useMemo(function(){var Xe=N0e().size([ge,ce]).tile(K0e[$e]).round(!0).paddingInner(he).paddingOuter(Ae);if(Ie&&!Ye){var Fe=Te+2*Ae;Xe["padding"+p0e(ke)](Fe)}return Xe},[ge,ce,$e,he,Ae,Ie,Te,ke,Ye])}({width:n,height:r,tile:f,innerPadding:m,outerPadding:v,enableParentLabel:M,parentLabelSize:H,parentLabelPosition:A,leavesOnly:u}),re=X0e({root:t,getValue:J}),B=S.useMemo(function(){var me=S$(re);return F(me),u?me.leaves():me.descendants()},[re,F,u]),ie=S.useMemo(function(){return B.map(function(me){var ge=function(Ae,Ie){var Te=Ae.ancestors().map(function(ke){return Ie(ke.data)}).reverse();return{path:Te.join("."),pathComponents:Te}}(me,K),ce=ge.path,$e=ge.pathComponents,he={id:K(me.data),path:ce,pathComponents:$e,data:Ya(me.data,"children"),x:me.x0,y:me.y0,width:me.x1-me.x0,height:me.y1-me.y0,value:me.value,formattedValue:W(me.value),treeDepth:me.depth,treeHeight:me.height,isParent:me.height>0,isLeaf:me.height===0,parentLabelX:0,parentLabelY:0,parentLabelRotation:0};return he.labelRotation=$&&he.height>he.width?-90:0,A==="top"&&(he.parentLabelX=v+O,he.parentLabelY=v+H/2),A==="right"&&(he.parentLabelX=he.width-v-H/2,he.parentLabelY=he.height-v-O,he.parentLabelRotation=-90),A==="bottom"&&(he.parentLabelX=v+O,he.parentLabelY=he.height-v-H/2),A==="left"&&(he.parentLabelX=v+H/2,he.parentLabelY=he.height-v-O,he.parentLabelRotation=-90),he.label=Z(he),he.parentLabel=U(he),he})},[B,K,W,Z,$,U,H,A,O,v]),oe=Wt(),ve=E1(L,I),Ce=Or(q,oe),pe=Or(Y,oe),ye=Or(Q,oe),Se=S.useMemo(function(){return ie.map(function(me){var ge=Tr({},me,{color:ve(me),opacity:N});return ge.borderColor=Ce(ge),ge.labelTextColor=pe(ge),ge.parentLabelTextColor=ye(ge),ge})},[ie,ve,N,Ce,pe,ye]);return{hierarchy:re,nodes:Se,layout:F}},J0e=function(e){var t=e.nodes;return S.useMemo(function(){return{nodes:t}},[t])},V2=function(e){return{x:e.x,y:e.y,width:e.width,height:e.height,color:e.color,labelX:e.width/2,labelY:e.height/2,labelRotation:e.labelRotation,labelOpacity:1,parentLabelX:e.parentLabelX,parentLabelY:e.parentLabelY,parentLabelRotation:e.parentLabelRotation,parentLabelOpacity:1}},pp=function(e){return{x:e.x+e.width/2,y:e.y+e.height/2,width:0,height:0,color:e.color,labelX:0,labelY:0,labelRotation:e.labelRotation,labelOpacity:0,parentLabelX:0,parentLabelY:0,parentLabelRotation:e.parentLabelRotation,parentLabelOpacity:0}},e2e=S.memo(function(e){var t=e.nodes,n=e.nodeComponent,r=e.borderWidth,i=e.enableLabel,o=e.labelSkipSize,a=e.enableParentLabel,s=function(f,h){var m=h.isInteractive,g=h.onMouseEnter,v=h.onMouseMove,b=h.onMouseLeave,y=h.onClick,x=h.tooltip,$=ci(),w=$.showTooltipFromEvent,M=$.hideTooltip,T=S.useCallback(function(A,j){w(S.createElement(x,{node:A}),j,"left")},[w,x]),_=S.useCallback(function(A,j){T(A,j),g==null||g(A,j)},[g,T]),E=S.useCallback(function(A,j){T(A,j),v==null||v(A,j)},[v,T]),H=S.useCallback(function(A,j){M(),b==null||b(A,j)},[b,M]),k=S.useCallback(function(A,j){y==null||y(A,j)},[y]);return S.useMemo(function(){return f.map(function(A){return m?Tr({},A,{onMouseEnter:function(j){return _(A,j)},onMouseMove:function(j){return E(A,j)},onMouseLeave:function(j){return H(A,j)},onClick:function(j){return k(A,j)}}):A})},[m,f,_,E,H,k])}(t,{isInteractive:e.isInteractive,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseLeave:e.onMouseLeave,onClick:e.onClick,tooltip:e.tooltip}),l=Fn(),c=l.animate,u=l.config,d=Cr(s,{keys:function(f){return f.path},initial:V2,from:pp,enter:V2,update:V2,leave:pp,config:u,immediate:!c});return p.jsx(p.Fragment,{children:d(function(f,h){return S.createElement(n,{key:h.path,node:h,animatedProps:f,borderWidth:r,enableLabel:i,labelSkipSize:o,enableParentLabel:a})})})}),t2e=["isInteractive","animate","motionConfig","theme","renderWrapper"],n2e=function(e){var t=e.data,n=e.identity,r=n===void 0?Zt.identity:n,i=e.value,o=i===void 0?Zt.value:i,a=e.valueFormat,s=e.tile,l=s===void 0?Zt.tile:s,c=e.nodeComponent,u=c===void 0?Zt.nodeComponent:c,d=e.innerPadding,f=d===void 0?Zt.innerPadding:d,h=e.outerPadding,m=h===void 0?Zt.outerPadding:h,g=e.leavesOnly,v=g===void 0?Zt.leavesOnly:g,b=e.width,y=e.height,x=e.margin,$=e.layers,w=$===void 0?Zt.layers:$,M=e.colors,T=M===void 0?Zt.colors:M,_=e.colorBy,E=_===void 0?Zt.colorBy:_,H=e.nodeOpacity,k=H===void 0?Zt.nodeOpacity:H,A=e.borderWidth,j=A===void 0?Zt.borderWidth:A,O=e.borderColor,R=O===void 0?Zt.borderColor:O,L=e.defs,V=L===void 0?Zt.defs:L,I=e.fill,P=I===void 0?Zt.fill:I,N=e.enableLabel,z=N===void 0?Zt.enableLabel:N,q=e.label,G=q===void 0?Zt.label:q,Y=e.labelTextColor,ee=Y===void 0?Zt.labelTextColor:Y,Q=e.orientLabel,K=Q===void 0?Zt.orientLabel:Q,J=e.labelSkipSize,W=J===void 0?Zt.labelSkipSize:J,Z=e.enableParentLabel,U=Z===void 0?Zt.enableParentLabel:Z,F=e.parentLabel,re=F===void 0?Zt.parentLabel:F,B=e.parentLabelSize,ie=B===void 0?Zt.parentLabelSize:B,oe=e.parentLabelPosition,ve=oe===void 0?Zt.parentLabelPosition:oe,Ce=e.parentLabelPadding,pe=Ce===void 0?Zt.parentLabelPadding:Ce,ye=e.parentLabelTextColor,Se=ye===void 0?Zt.parentLabelTextColor:ye,me=e.isInteractive,ge=me===void 0?Zt.isInteractive:me,ce=e.onMouseEnter,$e=e.onMouseMove,he=e.onMouseLeave,Ae=e.onClick,Ie=e.tooltip,Te=Ie===void 0?Zt.tooltip:Ie,ke=e.role,Ye=e.ariaLabel,Xe=e.ariaLabelledBy,Fe=e.ariaDescribedBy,Le=Za(b,y,x),Qe=Le.margin,Ze=Le.innerWidth,qe=Le.innerHeight,de=Le.outerWidth,_e=Le.outerHeight,Ke=Q0e({data:t,identity:r,value:o,valueFormat:a,leavesOnly:v,width:Ze,height:qe,tile:l,innerPadding:f,outerPadding:m,colors:T,colorBy:E,nodeOpacity:k,borderColor:R,label:G,labelTextColor:ee,orientLabel:K,enableParentLabel:U,parentLabel:re,parentLabelSize:ie,parentLabelPosition:ve,parentLabelPadding:pe,parentLabelTextColor:Se}).nodes,nt={nodes:null};w.includes("nodes")&&(nt.nodes=p.jsx(e2e,{nodes:Ke,nodeComponent:u,borderWidth:j,enableLabel:z,labelSkipSize:W,enableParentLabel:U,isInteractive:ge,onMouseEnter:ce,onMouseMove:$e,onMouseLeave:he,onClick:Ae,tooltip:Te},"nodes"));var Ne=J0e({nodes:Ke}),ze=$h(V,Ke,P);return p.jsx(Sl,{width:de,height:_e,margin:Qe,defs:ze,role:ke,ariaLabel:Ye,ariaLabelledBy:Xe,ariaDescribedBy:Fe,children:w.map(function(De,Je){var tt;return typeof De=="function"?p.jsx(S.Fragment,{children:S.createElement(De,Ne)},Je):(tt=nt==null?void 0:nt[De])!=null?tt:null})})},r2e=function(e){var t=e.isInteractive,n=t===void 0?Zt.isInteractive:t,r=e.animate,i=r===void 0?Zt.animate:r,o=e.motionConfig,a=o===void 0?Zt.motionConfig:o,s=e.theme,l=e.renderWrapper,c=z0e(e,t2e);return p.jsx(Ua,{animate:i,isInteractive:n,motionConfig:a,renderWrapper:l,theme:s,children:p.jsx(n2e,Tr({isInteractive:n},c))})},i2e=function(e){return p.jsx(Go,{children:function(t){var n=t.width,r=t.height;return p.jsx(r2e,Tr({width:n,height:r},e))}})};function o2e(e,t){if(e.startsWith("rgba"))return e.replace(/rgba?\((\d+), (\d+), (\d+),? ([\d.]+)?\)/,(n,r,i,o,a)=>`rgba(${r}, ${i}, ${o}, ${t})`);if(e.startsWith("rgb"))return e.replace(/rgb\((\d+), (\d+), (\d+)\)/,(n,r,i,o)=>`rgba(${r}, ${i}, ${o}, ${t})`);if(e.startsWith("hsl"))return e.replace(/hsl\((\d+), (\d+)%?, (\d+)%?\)/,(n,r,i,o)=>`hsla(${r}, ${i}%, ${o}%, ${t})`);if(e.startsWith("hsla"))return e.replace(/hsla?\((\d+), (\d+)%?, (\d+)%?,? ([\d.]+)?\)/,(n,r,i,o,a)=>`hsla(${r}, ${i}%, ${o}%, ${t})`);if(e.startsWith("#")){const n=a2e(e);return`rgba(${n.r}, ${n.g}, ${n.b}, ${t})`}throw new Error("Unsupported color format")}function a2e(e){const t=e.startsWith("#")?e.slice(1):e,n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16);return{r:n,g:r,b:i}}const s2e=(e,t=12)=>{const r=document.createElement("canvas").getContext("2d");return r.font=`${t}px Roboto, sans-serif`,r.measureText(e)},l2e=(e,t,n=12)=>{const r=e.split(" "),i=[];let o=r[0];for(let a=1;a<r.length;a++){const s=`${o} ${r[a]}`;s2e(s,n).width>t?(i.push(o),o=r[a]):o=s}return i.push(o),i},c2e=({treeMapData:e,style:t={},colors:n={scheme:"nivo"},identity:r="name",value:i="loc",margin:o={},nodeOpacity:a=.67,labelTextColor:s="black",borderColor:l="white",labelTitle:c="name",labelTitleSize:u=16,labelText:d="name",labelTextSize:f=12,labelPadding:h=10,labelGap:m=10,labelLineHeight:g=14,tooltip:v=null})=>{const b=S.useRef(null),[y,x]=S.useState({width:0,height:0});S.useEffect(()=>{if(!(b!=null&&b.current))return;const M=()=>{const _=b.current.getBoundingClientRect();x({width:_.width,height:_.height})},T=new ResizeObserver(M);return T.observe(b==null?void 0:b.current),M(),()=>{T.disconnect()}},[]);const $=({node:M})=>{var L,V;const T=S.useRef(null),_=S.useRef(null),[E,H]=S.useState(!1),[k,A]=S.useState(!1),j=()=>{if(!(T!=null&&T.current)||!(_!=null&&_.current))return;const I=T.current.getBoundingClientRect(),P=_.current.getBoundingClientRect(),N=Math.max([P,I]);H(I.height>M.height-h*2||I.width>M.width-h*2),A(P.height+I.height+g>M.height-h*2||N>M.width-h*2)};S.useEffect(()=>{j()},[]);const O=((L=M==null?void 0:M.data)==null?void 0:L[d])||"Text",R=l2e(O,M.width-h*2,f);return M.isParent?p.jsx(p.Fragment,{}):p.jsxs("g",{transform:`translate(${M.x}, ${M.y})`,children:[p.jsx("rect",{width:M.width,height:M.height,style:{fill:o2e(M.color,a),stroke:l,strokeWidth:1}}),!E&&p.jsx("text",{ref:T,dominantBaseline:"hanging",x:h,y:h,style:{fill:s,font:"var(--gf-label-lg-default)",fontWeight:"bold",fontSize:u},children:((V=M==null?void 0:M.data)==null?void 0:V[c])||"Title"}),!E&&!k&&p.jsx("text",{ref:_,dominantBaseline:"hanging",children:R.map((I,P)=>p.jsx("tspan",{x:h,y:h+u+m+g*P,style:{fill:s,font:"var(--gf-label-lg-default)",fontSize:f},children:I},P))})]})},w=({nodes:M})=>M.map(T=>p.jsx($,{node:T},T.id));return p.jsxs(p.Fragment,{children:[p.jsx(yn,{}),p.jsxs(tn,{gap:16,vertical:!0,children:[p.jsx("div",{ref:b,style:{width:"100%",height:600,...t},children:p.jsx(i2e,{data:e,colors:n,identity:r,value:i,margin:{top:10,right:10,bottom:10,left:10,...o},enableParentLabel:!1,enableLabel:!1,nodeOpacity:0,borderWidth:0,tooltip:({node:M})=>p.jsx(Zn,{body:(v==null?void 0:v({node:M}))||p.jsx("span",{children:"Treemap tooltip"})}),layers:[w,"nodes"]})}),p.jsx("p",{style:{padding:"0 10px",fontFamily:"Roboto, sans-serif",fontSize:14,lineHeight:"22px",color:"#475467"},children:"In de grafiek hierboven zijn alle afvalstromen uitgesplitst per EURAL-code, een zescijferige code uit de Europese Afvallijst (EWL) die in heel Europa wordt gebruikt om afval te classificeren. De code geeft de bron van het afval aan, het proces of de activiteit waaruit het afkomstig is en het specifieke type afval, zoals bouw- of huishoudelijk afval. Een asterisk (*) achter de code betekent dat het afval gevaarlijk is."})]})]})};var u2e=y1,d2e=0;function f2e(e){var t=++d2e;return u2e(e)+t}var h2e=f2e;const g2e=xn(h2e);function hr(){return hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hr.apply(this,arguments)}var Lh=S.memo(function(e){var t=e.point;return p.jsx(Is,{id:p.jsxs("span",{children:["x: ",p.jsx("strong",{children:t.data.xFormatted}),", y:"," ",p.jsx("strong",{children:t.data.yFormatted})]}),enableChip:!0,color:t.serieColor})}),SM=S.memo(function(e){var t=e.slice,n=e.axis,r=Wt(),i=n==="x"?"y":"x";return p.jsx(uw,{rows:t.points.map(function(o){return[p.jsx(Ju,{color:o.serieColor,style:r.tooltip.chip},"chip"),o.serieId,p.jsx("span",{style:r.tooltip.tableCellValue,children:o.data[i+"Formatted"]},"value")]})})}),$M={curve:"linear",xScale:{type:"point"},yScale:{type:"linear",min:0,max:"auto"},layers:["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"],axisBottom:{},axisLeft:{},enableGridX:!0,enableGridY:!0,enablePoints:!0,pointSize:6,pointColor:{from:"color"},pointBorderWidth:0,pointBorderColor:{theme:"background"},enablePointLabel:!1,pointLabel:"yFormatted",colors:{scheme:"nivo"},enableArea:!1,areaBaselineValue:0,areaOpacity:.2,areaBlendMode:"normal",lineWidth:2,legends:[],isInteractive:!0,tooltip:Lh,enableSlices:!1,debugSlices:!1,sliceTooltip:SM,debugMesh:!1,enableCrosshair:!0,crosshairType:"bottom-left"},So=hr({},$M,{enablePointLabel:!1,useMesh:!1,enableTouchCrosshair:!1,animate:!0,motionConfig:"gentle",defs:[],fill:[],role:"img"});hr({},$M,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var v2e=function(e){var t=e.curve;return S.useMemo(function(){return Yc().defined(function(n){return n.x!==null&&n.y!==null}).x(function(n){return n.x}).y(function(n){return n.y}).curve(qS(t))},[t])},m2e=function(e){var t=e.curve,n=e.yScale,r=e.areaBaselineValue;return S.useMemo(function(){return fS().defined(function(i){return i.x!==null&&i.y!==null}).x(function(i){return i.x}).y1(function(i){return i.y}).curve(qS(t)).y0(n(r))},[t,n,r])},p2e=function(e){var t=e.componentId,n=e.enableSlices,r=e.points,i=e.width,o=e.height;return S.useMemo(function(){if(n===!1)return[];if(n==="x"){var a=new Map;return r.forEach(function(l){l.data.x!==null&&l.data.y!==null&&(a.has(l.x)?a.get(l.x).push(l):a.set(l.x,[l]))}),Array.from(a.entries()).sort(function(l,c){return l[0]-c[0]}).map(function(l,c,u){var d,f,h=l[0],m=l[1],g=u[c-1],v=u[c+1];return d=g?h-(h-g[0])/2:h,f=v?h-d+(v[0]-h)/2:i-d,{id:"slice:"+t+":"+h,x0:d,x:h,y0:0,y:0,width:f,height:o,points:m.reverse()}})}if(n==="y"){var s=new Map;return r.forEach(function(l){l.data.x!==null&&l.data.y!==null&&(s.has(l.y)?s.get(l.y).push(l):s.set(l.y,[l]))}),Array.from(s.entries()).sort(function(l,c){return l[0]-c[0]}).map(function(l,c,u){var d,f,h=l[0],m=l[1],g=u[c-1],v=u[c+1];return d=g?h-(h-g[0])/2:h,f=v?h-d+(v[0]-h)/2:o-d,{id:h,x0:0,x:0,y0:d,y:h,width:i,height:f,points:m.reverse()}})}},[t,n,o,r,i])},b2e="line",MM=function(e){var t=e.data,n=e.xScale,r=n===void 0?So.xScale:n,i=e.xFormat,o=e.yScale,a=o===void 0?So.yScale:o,s=e.yFormat,l=e.width,c=e.height,u=e.colors,d=u===void 0?So.colors:u,f=e.curve,h=f===void 0?So.curve:f,m=e.areaBaselineValue,g=m===void 0?So.areaBaselineValue:m,v=e.pointColor,b=v===void 0?So.pointColor:v,y=e.pointBorderColor,x=y===void 0?So.pointBorderColor:y,$=e.enableSlices,w=$===void 0?So.enableSlicesTooltip:$,M=S.useState(g2e(b2e))[0],T=Po(i),_=Po(s),E=E1(d,"id"),H=Wt(),k=Or(b,H),A=Or(x,H),j=S.useState([]),O=j[0],R=j[1],L=S.useMemo(function(){return L$(t.filter(function(Q){return O.indexOf(Q.id)===-1}),r,a,l,c)},[t,O,r,a,l,c]),V=L.xScale,I=L.yScale,P=L.series,N=S.useMemo(function(){var Q=t.map(function(J){return{id:J.id,label:J.id,color:E(J)}}),K=Q.map(function(J){return hr({},P.find(function(W){return W.id===J.id}),{color:J.color})}).filter(function(J){return!!J.id});return{legendData:Q.map(function(J){return hr({},J,{hidden:!K.find(function(W){return W.id===J.id})})}).reverse(),series:K}},[t,P,E]),z=N.legendData,q=N.series,G=S.useCallback(function(Q){R(function(K){return K.indexOf(Q)>-1?K.filter(function(J){return J!==Q}):[].concat(K,[Q])})},[]),Y=function(Q){var K=Q.series,J=Q.getPointColor,W=Q.getPointBorderColor,Z=Q.formatX,U=Q.formatY;return S.useMemo(function(){return K.reduce(function(F,re){return[].concat(F,re.data.filter(function(B){return B.position.x!==null&&B.position.y!==null}).map(function(B,ie){var oe={id:re.id+"."+ie,index:F.length+ie,serieId:re.id,serieColor:re.color,x:B.position.x,y:B.position.y};return oe.color=J(re),oe.borderColor=W(oe),oe.data=hr({},B.data,{xFormatted:Z(B.data.x),yFormatted:U(B.data.y)}),oe}))},[])},[K,J,W,Z,U])}({series:q,getPointColor:k,getPointBorderColor:A,formatX:T,formatY:_}),ee=p2e({componentId:M,enableSlices:w,points:Y,width:l,height:c});return{legendData:z,toggleSerie:G,lineGenerator:v2e({curve:h}),areaGenerator:m2e({curve:h,yScale:I,areaBaselineValue:g}),getColor:E,series:q,xScale:V,yScale:I,slices:ee,points:Y}},y2e=function(e){var t=e.areaBlendMode,n=e.areaOpacity,r=e.color,i=e.fill,o=e.path,a=Fn(),s=a.animate,l=a.config,c=jf(o),u=Xt({color:r,config:l,immediate:!s});return p.jsx(et.path,{d:c,fill:i||u.color,fillOpacity:n,strokeWidth:0,style:{mixBlendMode:t}})},C2e=S.memo(function(e){var t=e.areaGenerator,n=e.areaOpacity,r=e.areaBlendMode,i=e.lines.slice(0).reverse();return p.jsx("g",{children:i.map(function(o){return p.jsx(y2e,hr({path:t(o.data.map(function(a){return a.position}))},hr({areaOpacity:n,areaBlendMode:r},o)),o.id)})})}),x2e=S.memo(function(e){var t=e.lineGenerator,n=e.points,r=e.color,i=e.thickness,o=S.useMemo(function(){return t(n)},[t,n]),a=jf(o);return p.jsx(et.path,{d:a,fill:"none",strokeWidth:i,stroke:r})}),w2e=S.memo(function(e){var t=e.lines,n=e.lineGenerator,r=e.lineWidth;return t.slice(0).reverse().map(function(i){var o=i.id,a=i.data,s=i.color;return p.jsx(x2e,{id:o,points:a.map(function(l){return l.position}),lineGenerator:n,color:s,thickness:r},o)})}),S2e=S.memo(function(e){var t=e.slice,n=e.slices,r=e.axis,i=e.debug,o=e.tooltip,a=e.isCurrent,s=e.setCurrent,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,m=e.onTouchEnd,g=ci(),v=g.showTooltipFromEvent,b=g.hideTooltip,y=S.useCallback(function(E){v(S.createElement(o,{slice:t,axis:r}),E,"right"),s(t),l&&l(t,E)},[v,o,t,r,s,l]),x=S.useCallback(function(E){v(S.createElement(o,{slice:t,axis:r}),E,"right"),c&&c(t,E)},[v,o,t,r,c]),$=S.useCallback(function(E){b(),s(null),u&&u(t,E)},[b,s,u,t]),w=S.useCallback(function(E){d&&d(t,E)},[t,d]),M=S.useCallback(function(E){v(S.createElement(o,{slice:t,axis:r}),E,"right"),s(t),f&&f(t,E)},[r,f,s,v,t,o]),T=S.useCallback(function(E){var H=E.touches[0],k=document.elementFromPoint(H.clientX,H.clientY),A=k==null?void 0:k.getAttribute("data-ref");if(A){var j=n.find(function(O){return O.id===A});j&&(v(S.createElement(o,{slice:j,axis:r}),E,"right"),s(j))}h&&h(t,E)},[r,h,s,v,t,n,o]),_=S.useCallback(function(E){b(),s(null),m&&m(t,E)},[b,s,m,t]);return p.jsx("rect",{x:t.x0,y:t.y0,width:t.width,height:t.height,stroke:"red",strokeWidth:i?1:0,strokeOpacity:.75,fill:"red",fillOpacity:a&&i?.35:0,onMouseEnter:y,onMouseMove:x,onMouseLeave:$,onClick:w,onTouchStart:M,onTouchMove:T,onTouchEnd:_,"data-ref":t.id})}),$2e=S.memo(function(e){var t=e.slices,n=e.axis,r=e.debug,i=e.height,o=e.tooltip,a=e.current,s=e.setCurrent,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,m=e.onTouchEnd;return t.map(function(g){return p.jsx(S2e,{slice:g,slices:t,axis:n,debug:r,height:i,tooltip:o,setCurrent:s,isCurrent:a!==null&&a.id===g.id,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onTouchStart:f,onTouchMove:h,onTouchEnd:m},g.id)})}),M2e=S.memo(function(e){var t=e.points,n=e.symbol,r=e.size,i=e.borderWidth,o=e.enableLabel,a=e.label,s=e.labelYOffset,l=Wt(),c=hie(a),u=t.slice(0).reverse().map(function(d){return{id:d.id,x:d.x,y:d.y,datum:d.data,fill:d.color,stroke:d.borderColor,label:o?c(d):null}});return p.jsx("g",{children:u.map(function(d){return p.jsx(uie,{x:d.x,y:d.y,datum:d.datum,symbol:n,size:r,color:d.fill,borderWidth:i,borderColor:d.stroke,label:d.label,labelYOffset:s,theme:l},d.id)})})}),E2e=S.memo(function(e){var t=e.points,n=e.width,r=e.height,i=e.margin,o=e.setCurrent,a=e.onMouseEnter,s=e.onMouseMove,l=e.onMouseLeave,c=e.onClick,u=e.onTouchStart,d=e.onTouchMove,f=e.onTouchEnd,h=e.tooltip,m=e.debug,g=e.enableTouchCrosshair,v=ci(),b=v.showTooltipAt,y=v.hideTooltip,x=S.useCallback(function(H,k){b(S.createElement(h,{point:H}),[H.x+i.left,H.y+i.top],"top"),a&&a(H,k)},[b,h,a,i]),$=S.useCallback(function(H,k){b(S.createElement(h,{point:H}),[H.x+i.left,H.y+i.top],"top"),s&&s(H,k)},[b,h,i.left,i.top,s]),w=S.useCallback(function(H,k){y(),l&&l(H,k)},[y,l]),M=S.useCallback(function(H,k){c&&c(H,k)},[c]),T=S.useCallback(function(H,k){b(S.createElement(h,{point:H}),[H.x+i.left,H.y+i.top],"top"),u&&u(H,k)},[i.left,i.top,u,b,h]),_=S.useCallback(function(H,k){b(S.createElement(h,{point:H}),[H.x+i.left,H.y+i.top],"top"),d&&d(H,k)},[i.left,i.top,d,b,h]),E=S.useCallback(function(H,k){y(),f&&f(H,k)},[f,y]);return p.jsx(G$,{nodes:t,width:n,height:r,setCurrent:o,onMouseEnter:x,onMouseMove:$,onMouseLeave:w,onClick:M,onTouchStart:T,onTouchMove:_,onTouchEnd:E,enableTouchCrosshair:g,debug:m})}),_2e=l$(function(e){var t=e.data,n=e.xScale,r=n===void 0?{type:"point"}:n,i=e.xFormat,o=e.yScale,a=o===void 0?{type:"linear",min:0,max:"auto"}:o,s=e.yFormat,l=e.layers,c=l===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:l,u=e.curve,d=u===void 0?"linear":u,f=e.areaBaselineValue,h=f===void 0?0:f,m=e.colors,g=m===void 0?{scheme:"nivo"}:m,v=e.margin,b=e.width,y=e.height,x=e.axisTop,$=e.axisRight,w=e.axisBottom,M=w===void 0?{}:w,T=e.axisLeft,_=T===void 0?{}:T,E=e.enableGridX,H=E===void 0||E,k=e.enableGridY,A=k===void 0||k,j=e.gridXValues,O=e.gridYValues,R=e.lineWidth,L=R===void 0?2:R,V=e.enableArea,I=V!==void 0&&V,P=e.areaOpacity,N=P===void 0?.2:P,z=e.areaBlendMode,q=z===void 0?"normal":z,G=e.enablePoints,Y=G===void 0||G,ee=e.pointSymbol,Q=e.pointSize,K=Q===void 0?6:Q,J=e.pointColor,W=J===void 0?{from:"color"}:J,Z=e.pointBorderWidth,U=Z===void 0?0:Z,F=e.pointBorderColor,re=F===void 0?{theme:"background"}:F,B=e.enablePointLabel,ie=B!==void 0&&B,oe=e.pointLabel,ve=oe===void 0?"data.yFormatted":oe,Ce=e.pointLabelYOffset,pe=e.defs,ye=pe===void 0?[]:pe,Se=e.fill,me=Se===void 0?[]:Se,ge=e.markers,ce=e.legends,$e=ce===void 0?[]:ce,he=e.isInteractive,Ae=he===void 0||he,Ie=e.useMesh,Te=Ie!==void 0&&Ie,ke=e.debugMesh,Ye=ke!==void 0&&ke,Xe=e.onMouseEnter,Fe=e.onMouseMove,Le=e.onMouseLeave,Qe=e.onClick,Ze=e.onTouchStart,qe=e.onTouchMove,de=e.onTouchEnd,_e=e.tooltip,Ke=_e===void 0?Lh:_e,nt=e.enableSlices,Ne=nt!==void 0&&nt,ze=e.debugSlices,De=ze!==void 0&&ze,Je=e.sliceTooltip,tt=Je===void 0?SM:Je,Be=e.enableCrosshair,je=Be===void 0||Be,ct=e.crosshairType,pt=ct===void 0?"bottom-left":ct,Oe=e.enableTouchCrosshair,fe=Oe!==void 0&&Oe,we=e.role,He=we===void 0?"img":we,Ge=Za(b,y,v),We=Ge.margin,rt=Ge.innerWidth,X=Ge.innerHeight,ae=Ge.outerWidth,se=Ge.outerHeight,Ve=MM({data:t,xScale:r,xFormat:i,yScale:a,yFormat:s,width:rt,height:X,colors:g,curve:d,areaBaselineValue:h,pointColor:W,pointBorderColor:re,enableSlices:Ne}),it=Ve.legendData,at=Ve.toggleSerie,st=Ve.lineGenerator,ft=Ve.areaGenerator,be=Ve.series,xe=Ve.xScale,Re=Ve.yScale,ot=Ve.slices,vt=Ve.points,xt=Wt(),ht=Or(W,xt),Ht=Or(re,xt),rn=S.useState(null),It=rn[0],fn=rn[1],lr=S.useState(null),Nt=lr[0],Tn=lr[1],lt={grid:p.jsx(B$,{theme:xt,width:rt,height:X,xScale:H?xe:null,yScale:A?Re:null,xValues:j,yValues:O},"grid"),markers:p.jsx(s$,{markers:ge,width:rt,height:X,xScale:xe,yScale:Re,theme:xt},"markers"),axes:p.jsx(z$,{xScale:xe,yScale:Re,width:rt,height:X,theme:xt,top:x,right:$,bottom:M,left:_},"axes"),areas:null,lines:p.jsx(w2e,{lines:be,lineGenerator:st,lineWidth:L},"lines"),slices:null,points:null,crosshair:null,mesh:null,legends:$e.map(function(cn,hn){return p.jsx(If,hr({},cn,{containerWidth:rt,containerHeight:X,data:cn.data||it,theme:xt,toggleSerie:cn.toggleSerie?at:void 0}),"legend."+hn)})},En=$h(ye,be,me);return I&&(lt.areas=p.jsx(C2e,{areaGenerator:ft,areaOpacity:N,areaBlendMode:q,lines:be},"areas")),Ae&&Ne!==!1&&(lt.slices=p.jsx($2e,{slices:ot,axis:Ne,debug:De,height:X,tooltip:tt,current:Nt,setCurrent:Tn,onMouseEnter:Xe,onMouseMove:Fe,onMouseLeave:Le,onClick:Qe,onTouchStart:Ze,onTouchMove:qe,onTouchEnd:de},"slices")),Y&&(lt.points=p.jsx(M2e,{points:vt,symbol:ee,size:K,color:ht,borderWidth:U,borderColor:Ht,enableLabel:ie,label:ve,labelYOffset:Ce},"points")),Ae&&je&&(It!==null&&(lt.crosshair=p.jsx(g4,{width:rt,height:X,x:It.x,y:It.y,type:pt},"crosshair")),Nt!==null&&(lt.crosshair=p.jsx(g4,{width:rt,height:X,x:Nt.x,y:Nt.y,type:Ne},"crosshair"))),Ae&&Te&&Ne===!1&&(lt.mesh=p.jsx(E2e,{points:vt,width:rt,height:X,margin:We,current:It,setCurrent:fn,onMouseEnter:Xe,onMouseMove:Fe,onMouseLeave:Le,onClick:Qe,onTouchStart:Ze,onTouchMove:qe,onTouchEnd:de,tooltip:Ke,enableTouchCrosshair:fe,debug:Ye},"mesh")),p.jsx(Sl,{defs:En,width:ae,height:se,margin:We,role:He,children:c.map(function(cn,hn){return typeof cn=="function"?p.jsx(S.Fragment,{children:cn(hr({},e,{innerWidth:rt,innerHeight:X,series:be,slices:ot,points:vt,xScale:xe,yScale:Re,lineGenerator:st,areaGenerator:ft,currentPoint:It,setCurrentPoint:fn,currentSlice:Nt,setCurrentSlice:Tn}))},hn):lt[cn]})})}),O2e=function(e){return p.jsx(Go,{children:function(t){var n=t.width,r=t.height;return p.jsx(_2e,hr({width:n,height:r},e))}})},H2e=l$(function(e){var t=S.useRef(null),n=e.width,r=e.height,i=e.margin,o=e.pixelRatio,a=o===void 0?typeof window<"u"&&window.devicePixelRatio||1:o,s=e.data,l=e.xScale,c=l===void 0?{type:"point"}:l,u=e.xFormat,d=e.yScale,f=d===void 0?{type:"linear",min:0,max:"auto"}:d,h=e.yFormat,m=e.curve,g=m===void 0?"linear":m,v=e.layers,b=v===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:v,y=e.colors,x=y===void 0?{scheme:"nivo"}:y,$=e.lineWidth,w=$===void 0?2:$,M=e.enableArea,T=M!==void 0&&M,_=e.areaBaselineValue,E=_===void 0?0:_,H=e.areaOpacity,k=H===void 0?.2:H,A=e.enablePoints,j=A===void 0||A,O=e.pointSize,R=O===void 0?6:O,L=e.pointColor,V=L===void 0?{from:"color"}:L,I=e.pointBorderWidth,P=I===void 0?0:I,N=e.pointBorderColor,z=N===void 0?{theme:"background"}:N,q=e.enableGridX,G=q===void 0||q,Y=e.gridXValues,ee=e.enableGridY,Q=ee===void 0||ee,K=e.gridYValues,J=e.axisTop,W=e.axisRight,Z=e.axisBottom,U=Z===void 0?{}:Z,F=e.axisLeft,re=F===void 0?{}:F,B=e.legends,ie=B===void 0?[]:B,oe=e.isInteractive,ve=oe===void 0||oe,Ce=e.debugMesh,pe=Ce!==void 0&&Ce,ye=e.onMouseLeave,Se=e.onClick,me=e.tooltip,ge=me===void 0?Lh:me,ce=e.canvasRef,$e=Za(n,r,i),he=$e.margin,Ae=$e.innerWidth,Ie=$e.innerHeight,Te=$e.outerWidth,ke=$e.outerHeight,Ye=Wt(),Xe=S.useState(null),Fe=Xe[0],Le=Xe[1],Qe=MM({data:s,xScale:c,xFormat:u,yScale:f,yFormat:h,width:Ae,height:Ie,colors:x,curve:g,areaBaselineValue:E,pointColor:V,pointBorderColor:z}),Ze=Qe.lineGenerator,qe=Qe.areaGenerator,de=Qe.series,_e=Qe.xScale,Ke=Qe.yScale,nt=Qe.points,Ne=Vh({points:nt,width:Ae,height:Ie,debug:pe}),ze=Ne.delaunay,De=Ne.voronoi;S.useEffect(function(){ce&&(ce.current=t.current),t.current.width=Te*a,t.current.height=ke*a;var fe=t.current.getContext("2d");fe.scale(a,a),fe.fillStyle=Ye.background,fe.fillRect(0,0,Te,ke),fe.translate(he.left,he.top),b.forEach(function(we){if(typeof we=="function"&&we({ctx:fe,innerWidth:Ae,innerHeight:Ie,series:de,points:nt,xScale:_e,yScale:Ke,lineWidth:w,lineGenerator:Ze,areaGenerator:qe,currentPoint:Fe,setCurrentPoint:Le}),we==="grid"&&Ye.grid.line.strokeWidth>0&&(fe.lineWidth=Ye.grid.line.strokeWidth,fe.strokeStyle=Ye.grid.line.stroke,G&&xd(fe,{width:Ae,height:Ie,scale:_e,axis:"x",values:Y}),Q&&xd(fe,{width:Ae,height:Ie,scale:Ke,axis:"y",values:K})),we==="axes"&&W$(fe,{xScale:_e,yScale:Ke,width:Ae,height:Ie,top:J,right:W,bottom:U,left:re,theme:Ye}),we==="areas"&&T===!0){fe.save(),fe.globalAlpha=k,qe.context(fe);for(var He=de.length-1;He>=0;He--)fe.fillStyle=de[He].color,fe.beginPath(),qe(de[He].data.map(function(We){return We.position})),fe.fill();fe.restore()}if(we==="lines"&&(Ze.context(fe),de.forEach(function(We){fe.strokeStyle=We.color,fe.lineWidth=w,fe.beginPath(),Ze(We.data.map(function(rt){return rt.position})),fe.stroke()})),we==="points"&&j===!0&&R>0&&nt.forEach(function(We){fe.fillStyle=We.color,fe.beginPath(),fe.arc(We.x,We.y,R/2,0,2*Math.PI),fe.fill(),P>0&&(fe.strokeStyle=We.borderColor,fe.lineWidth=P,fe.stroke())}),we==="mesh"&&pe===!0&&(Y$(fe,De),Fe&&K$(fe,De,Fe.index)),we==="legends"){var Ge=de.map(function(We){return{id:We.id,label:We.id,color:We.color}}).reverse();ie.forEach(function(We){v$(fe,hr({},We,{data:We.data||Ge,containerWidth:Ae,containerHeight:Ie,theme:Ye}))})}})},[t,Te,ke,b,Ye,Ze,de,_e,Ke,G,Y,Q,K,J,W,U,re,ie,nt,j,R,Fe]);var Je=S.useCallback(function(fe){var we=Sh(t.current,fe),He=we[0],Ge=we[1];if(!c$(he.left,he.top,Ae,Ie,He,Ge))return null;var We=ze.find(He-he.left,Ge-he.top);return nt[We]},[t,he,Ae,Ie,ze]),tt=ci(),Be=tt.showTooltipFromEvent,je=tt.hideTooltip,ct=S.useCallback(function(fe){var we=Je(fe);Le(we),we?Be(S.createElement(ge,{point:we}),fe):je()},[Je,Le,Be,je,ge]),pt=S.useCallback(function(fe){je(),Le(null),Fe&&ye&&ye(Fe,fe)},[je,Le,ye]),Oe=S.useCallback(function(fe){if(Se){var we=Je(fe);we&&Se(we,fe)}},[Je,Se]);return p.jsx("canvas",{ref:t,width:Te*a,height:ke*a,style:{width:Te,height:ke,cursor:ve?"auto":"normal"},onMouseEnter:ve?ct:void 0,onMouseMove:ve?ct:void 0,onMouseLeave:ve?pt:void 0,onClick:ve?Oe:void 0})}),V2e=S.forwardRef(function(e,t){return p.jsx(H2e,hr({},e,{canvasRef:t}))});S.forwardRef(function(e,t){return p.jsx(Go,{children:function(n){var r=n.width,i=n.height;return p.jsx(V2e,hr({width:r,height:i},e,{ref:t}))}})});const T2e=Ct.span`
|
|
499
499
|
font: var(--gf-label-md-default);
|
|
500
500
|
color: var(--gf-color-text-secondary);
|
|
501
|
-
`,bp={A:"#39b54a",B:"#8cc63f",C:"#d9e021",D:"#fcee21",E:"#fbb03b",F:"#f7931e",G:"#f15a24",H:"#cc3333",I:"#4d4d4d"},R2e={A:"Direct hoogwaardig inzetten",B:"Indirect hoogwaardig inzetten",C:"Voorbereiding voor recycling",D:"Microbiologische verwerking",E:"Grondreiniging",F:"Verbranding met opbrengst",G:"Verbranden",H:"Storten",I:"Opslag"},k2e=()=>p.jsx("div",{style:{marginTop:10,marginLeft:10,whiteSpace:"nowrap"},children:Object.keys(bp).map((e,t)=>p.jsxs(tn,{gap:8,align:"center",children:[p.jsx("div",{style:{backgroundColor:bp[e],minWidth:22,minHeight:22,border:"1px solid gray"}}),p.jsx(T2e,{children:`${e} ${R2e[e]}`})]},`legend-${t}`))}),L2e=({trendsData:e,height:t=null,margin:n={},colors:r=null,xLeg:i,yLeg:o,tooltip:a=null})=>p.jsxs(p.Fragment,{children:[p.jsx(yn,{}),p.jsxs(ko,{style:{width:"100%"},children:[p.jsx(br,{span:6,children:p.jsx(k2e,{})}),p.jsx(br,{span:18,children:p.jsx("div",{style:{width:"100%",height:t||600},children:p.jsx(O2e,{data:e,margin:{top:20,right:20,bottom:60,left:90,...n},colors:r||{scheme:"nivo"},xScale:{type:"point"},yScale:{type:"linear",min:
|
|
501
|
+
`,bp={A:"#39b54a",B:"#8cc63f",C:"#d9e021",D:"#fcee21",E:"#fbb03b",F:"#f7931e",G:"#f15a24",H:"#cc3333",I:"#4d4d4d"},R2e={A:"Direct hoogwaardig inzetten",B:"Indirect hoogwaardig inzetten",C:"Voorbereiding voor recycling",D:"Microbiologische verwerking",E:"Grondreiniging",F:"Verbranding met opbrengst",G:"Verbranden",H:"Storten",I:"Opslag"},k2e=()=>p.jsx("div",{style:{marginTop:10,marginLeft:10,whiteSpace:"nowrap"},children:Object.keys(bp).map((e,t)=>p.jsxs(tn,{gap:8,align:"center",children:[p.jsx("div",{style:{backgroundColor:bp[e],minWidth:22,minHeight:22,border:"1px solid gray"}}),p.jsx(T2e,{children:`${e} ${R2e[e]}`})]},`legend-${t}`))}),L2e=({trendsData:e,height:t=null,margin:n={},colors:r=null,xLeg:i,yLeg:o,tooltip:a=null})=>p.jsxs(p.Fragment,{children:[p.jsx(yn,{}),p.jsxs(ko,{style:{width:"100%"},children:[p.jsx(br,{span:6,children:p.jsx(k2e,{})}),p.jsx(br,{span:18,children:p.jsx("div",{style:{width:"100%",height:t||600},children:p.jsx(O2e,{data:e,margin:{top:20,right:20,bottom:60,left:90,...n},colors:r||{scheme:"nivo"},xScale:{type:"point"},yScale:{type:"linear",min:0,max:"auto",reverse:!1},axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:-45,legend:i,legendOffset:50,legendPosition:"middle"},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0,legend:o,legendOffset:-70,legendPosition:"middle"},pointSize:10,pointColor:{theme:"background"},pointBorderWidth:2,pointBorderColor:{from:"serieColor"},pointLabelYOffset:-12,useMesh:!0,tooltip:s=>p.jsx(Zn,{body:(a==null?void 0:a(s))||p.jsx("span",{children:"Line tooltip"})})})})})]})]}),j2e=Ct.h3`
|
|
502
502
|
color: var(--gf-color-button-primary);
|
|
503
503
|
`,P2e=({selectors:e,setter:t,style:n})=>{const r=24/e.length;return p.jsxs(p.Fragment,{children:[p.jsx(yn,{}),p.jsx(Qs,{cardtype:"default",style:{width:"100%",...n},children:p.jsx(ko,{gutter:20,children:e.map((i,o)=>p.jsxs(br,{span:r,children:[p.jsx(j2e,{children:i.title}),p.jsx(Pa,{defaultValue:i.defaultValue,style:{width:"100%"},onChange:a=>{t(i.key,a)},options:i.options})]},`col-${o}`))})})]})},T2=Ct.span`
|
|
504
504
|
font: var(--gf-label-md-default);
|