gf-components 0.1.97 → 0.1.98

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 CHANGED
@@ -495,7 +495,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
495
495
  font: var(--gf-label-md-default);
496
496
  color: var(--gf-color-text-secondary);
497
497
  font-size: 10px;
498
- `,l61=({pieChartData:e,title:t,isEmpty:C,sortByValue:n=!0,arcLabel:r=null,tooltip:i=null,customStyle:o={},customMargin:a={},height:s=600,legendWidth:l="50%"})=>{const[c,u]=$.useState([]),d=({centerX:v,centerY:g,dataWithArc:h})=>(c.length||u(h),p.jsx("text",{x:v,y:g,textAnchor:"middle",dominantBaseline:"central",style:{fontSize:"16px",fontWeight:400},children:C?"Data niet openbaar beschikbaar":""})),f=({data:v})=>p.jsx(Q2,{gap:16,className:"gf-full",justify:"center",wrap:!0,style:{width:l},children:v==null?void 0:v.map((g,h)=>p.jsxs(Q2,{gap:8,align:"center",children:[p.jsx("div",{style:{minWidth:16,minHeight:16,backgroundColor:g.color}}),p.jsx(s61,{children:g.label})]},`legend-${h}`))});return p.jsxs(p.Fragment,{children:[p.jsx(S2,{}),p.jsxs(Q2,{vertical:!0,gap:8,align:"center",style:{width:"100%"},children:[p.jsx(a61,{children:t}),p.jsx("div",{style:{width:"100%",height:s},children:p.jsx(o61,{colors:{scheme:C?"greys":"nivo"},data:e,sortByValue:n,enableArcLabels:!C,arcLabel:v=>(r==null?void 0:r(v))||v.formattedValue,enableArcLinkLabels:!1,margin:{top:50,right:80,bottom:50,left:80,...a},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:!C,layers:["arcs","arcLabels","arcLinkLabels","legends",d],tooltip:({datum:{id:v,value:g,unit:h}})=>p.jsx(f4,{body:(i==null?void 0:i({id:v,value:g,unit:h}))||p.jsx("span",{children:"Pie chart tooltip"})})})}),p.jsx(f,{data:c})]})]})};var c61=rn,u61=du,d61=1,f61=2;function h61(e,t,C,n){var r=C.length,i=r,o=!n;if(e==null)return!i;for(e=Object(e);r--;){var a=C[r];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<i;){a=C[r];var s=a[0],l=e[s],c=a[1];if(o&&a[2]){if(l===void 0&&!(s in e))return!1}else{var u=new c61;if(n)var d=n(l,c,s,e,t,u);if(!(d===void 0?u61(c,l,d61|f61,n,u):d))return!1}}return!0}var g61=h61,v61=$3;function m61(e){return e===e&&!v61(e)}var y$=m61,p61=y$,b61=ye;function y61(e){for(var t=b61(e),C=t.length;C--;){var n=t[C],r=e[n];t[C]=[n,r,p61(r)]}return t}var x61=y61;function w61(e,t){return function(C){return C==null?!1:C[e]===t&&(t!==void 0||e in Object(C))}}var x$=w61,S61=g61,$61=x61,M61=x$;function E61(e){var t=$61(e);return t.length==1&&t[0][2]?M61(t[0][0],t[0][1]):function(C){return C===e||S61(C,e,t)}}var _61=E61,O61=du,V61=$w,T61=SS,R61=Rl,H61=y$,k61=x$,L61=s6,P61=1,j61=2;function I61(e,t){return R61(e)&&H61(t)?k61(L61(e),t):function(C){var n=V61(C,e);return n===void 0&&n===t?T61(C,e):O61(t,n,P61|j61)}}var A61=I61;function N61(e){return function(t){return t==null?void 0:t[e]}}var D61=N61,F61=ge;function z61(e){return function(t){return F61(t,e)}}var B61=z61,W61=D61,U61=B61,Z61=Rl,q61=s6;function G61(e){return Z61(e)?W61(q61(e)):U61(e)}var Y61=G61,K61=_61,X61=A61,Q61=cn,J61=b4,e01=Y61;function t01(e){return typeof e=="function"?e:e==null?Q61:typeof e=="object"?J61(e)?X61(e[0],e[1]):K61(e):e01(e)}var pu=t01,C01=pu,n01=vx;function r01(e,t){return e&&e.length?n01(e,C01(t)):[]}var i01=r01;const Oa=p2(i01);var o01=ow,a01=ye;function s01(e,t){return e&&o01(e,t,a01)}var l01=s01,c01=r6;function u01(e,t){return function(C,n){if(C==null)return C;if(!c01(C))return e(C,n);for(var r=C.length,i=t?r:-1,o=Object(C);(t?i--:++i<r)&&n(o[i],i,o)!==!1;);return C}}var d01=u01,f01=l01,h01=d01,g01=h01(f01),w$=g01,v01=w$,m01=r6;function p01(e,t){var C=-1,n=m01(e)?Array(e.length):[];return v01(e,function(r,i,o){n[++C]=t(r,i,o)}),n}var b01=p01;function y01(e,t){var C=e.length;for(e.sort(t);C--;)e[C]=e[C].value;return e}var x01=y01,Wv=un;function w01(e,t){if(e!==t){var C=e!==void 0,n=e===null,r=e===e,i=Wv(e),o=t!==void 0,a=t===null,s=t===t,l=Wv(t);if(!a&&!l&&!i&&e>t||i&&o&&s&&!a&&!l||n&&o&&s||!C&&s||!r)return 1;if(!n&&!i&&!l&&e<t||l&&C&&r&&!n&&!i||a&&C&&r||!o&&r||!s)return-1}return 0}var S01=w01,$01=S01;function M01(e,t,C){for(var n=-1,r=e.criteria,i=t.criteria,o=r.length,a=C.length;++n<o;){var s=$01(r[n],i[n]);if(s){if(n>=a)return s;var l=C[n];return s*(l=="desc"?-1:1)}}return e.index-t.index}var E01=M01,pi=dn,_01=ge,O01=pu,V01=b01,T01=x01,R01=i6,H01=E01,k01=cn,L01=b4;function P01(e,t,C){t.length?t=pi(t,function(i){return L01(i)?function(o){return _01(o,i.length===1?i[0]:i)}:i}):t=[k01];var n=-1;t=pi(t,R01(O01));var r=V01(e,function(i,o,a){var s=pi(t,function(l){return l(i)});return{criteria:s,index:++n,value:i}});return T01(r,function(i,o){return H01(i,o,C)})}var j01=P01,I01=MS,A01=j01,N01=Vl,Uv=xw,D01=N01(function(e,t){if(e==null)return[];var C=t.length;return C>1&&Uv(e,t[0],t[1])?t=[]:C>2&&Uv(t[0],t[1],t[2])&&(t=[t[0]]),A01(e,I01(t,1),[])}),F01=D01;const z01=p2(F01);var B01=g7,W01=Z4,U01="[object Date]";function Z01(e){return W01(e)&&B01(e)==U01}var q01=Z01,G01=q01,Y01=i6,Zv=sn,qv=Zv&&Zv.isDate,K01=qv?Y01(qv):G01,X01=K01;const Q01=p2(X01);var bi=new Date,yi=new Date;function w2(e,t,C,n){function r(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return r.floor=function(i){return e(i=new Date(+i)),i},r.ceil=function(i){return e(i=new Date(i-1)),t(i,1),e(i),i},r.round=function(i){var o=r(i),a=r.ceil(i);return i-o<a-i?o:a},r.offset=function(i,o){return t(i=new Date(+i),o==null?1:Math.floor(o)),i},r.range=function(i,o,a){var s=[],l;if(i=r.ceil(i),a=a==null?1:Math.floor(a),!(i<o)||!(a>0))return s;do s.push(l=new Date(+i)),t(i,a),e(i);while(l<i&&i<o);return s},r.filter=function(i){return w2(function(o){if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},function(o,a){if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!i(o););else for(;--a>=0;)for(;t(o,1),!i(o););})},C&&(r.count=function(i,o){return bi.setTime(+i),yi.setTime(+o),e(bi),e(yi),Math.floor(C(bi,yi))},r.every=function(i){return i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?r.filter(n?function(o){return n(o)%i===0}:function(o){return r.count(0,o)%i===0}):r}),r}var f7=w2(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});f7.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?w2(function(t){t.setTime(Math.floor(t/e)*e)},function(t,C){t.setTime(+t+C*e)},function(t,C){return(C-t)/e}):f7};f7.range;var fC=1e3,B9=6e4,hC=36e5,S$=6048e5,w8=w2(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*fC)},function(e,t){return(t-e)/fC},function(e){return e.getUTCSeconds()});w8.range;var Hn=w2(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*fC)},function(e,t){e.setTime(+e+t*B9)},function(e,t){return(t-e)/B9},function(e){return e.getMinutes()});Hn.range;var kn=w2(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*fC-e.getMinutes()*B9)},function(e,t){e.setTime(+e+t*hC)},function(e,t){return(t-e)/hC},function(e){return e.getHours()});kn.range;function W8(e){return w2(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,C){t.setDate(t.getDate()+C*7)},function(t,C){return(C-t-(C.getTimezoneOffset()-t.getTimezoneOffset())*B9)/S$})}var S8=W8(0),Ln=W8(1),Pn=W8(2),jn=W8(3),In=W8(4),An=W8(5),Nn=W8(6);S8.range;Ln.range;Pn.range;jn.range;In.range;An.range;Nn.range;var Dn=w2(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()});Dn.range;var we=w2(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()});we.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:w2(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,C){t.setFullYear(t.getFullYear()+C*e)})};we.range;var Fn=w2(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*B9)},function(e,t){return(t-e)/B9},function(e){return e.getUTCMinutes()});Fn.range;var zn=w2(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*hC)},function(e,t){return(t-e)/hC},function(e){return e.getUTCHours()});zn.range;function U8(e){return w2(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,C){t.setUTCDate(t.getUTCDate()+C*7)},function(t,C){return(C-t)/S$})}var $8=U8(0),Bn=U8(1),Wn=U8(2),Un=U8(3),Zn=U8(4),qn=U8(5),Gn=U8(6);$8.range;Bn.range;Wn.range;Un.range;Zn.range;qn.range;Gn.range;var Yn=w2(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()});Yn.range;var Se=w2(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()});Se.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:w2(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,C){t.setUTCFullYear(t.getUTCFullYear()+C*e)})};Se.range;function t8(){return t8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},t8.apply(this,arguments)}var a9=[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)}],J01={millisecond:[],second:a9.slice(0,1),minute:a9.slice(0,2),hour:a9.slice(0,3),day:a9.slice(0,4),month:a9.slice(0,5),year:a9.slice(0,6)},ee1=function(e){return function(t){return J01[e].forEach(function(C){C(t)}),t}},$$=function(e){var t=e.format,C=t===void 0?"native":t,n=e.precision,r=n===void 0?"millisecond":n,i=e.useUTC,o=i===void 0||i,a=ee1(r);return function(s){if(s===void 0)return s;if(C==="native"||s instanceof Date)return a(s);var l=o?lu(C):su(C);return a(l(s))}},te1=function(e,t,C,n){var r,i,o,a,s=e.min,l=s===void 0?0:s,c=e.max,u=c===void 0?"auto":c,d=e.stacked,f=d!==void 0&&d,v=e.reverse,g=v!==void 0&&v,h=e.clamp,m=h!==void 0&&h,b=e.nice,x=b!==void 0&&b;l==="auto"?r=f===!0?(i=t.minStacked)!=null?i:0:t.min:r=l,u==="auto"?o=f===!0?(a=t.maxStacked)!=null?a:0:t.max:o=u;var S=P8().rangeRound(n==="x"?[0,C]:[C,0]).domain(g?[o,r]:[r,o]).clamp(m);return x===!0?S.nice():typeof x=="number"&&S.nice(x),Ce1(S,f)},Ce1=function(e,t){t===void 0&&(t=!1);var C=e;return C.type="linear",C.stacked=t,C},ne1=function(e,t,C){var n=Pw().range([0,C]).domain(t.all);return n.type="point",n},re1=function(e,t,C,n){var r=e.round,i=r===void 0||r,o=I9().range(n==="x"?[0,C]:[C,0]).domain(t.all).round(i);return ie1(o)},ie1=function(e){var t=e;return t.type="band",t},oe1=function(e,t,C){var n,r,i=e.format,o=i===void 0?"native":i,a=e.precision,s=a===void 0?"millisecond":a,l=e.min,c=l===void 0?"auto":l,u=e.max,d=u===void 0?"auto":u,f=e.useUTC,v=f===void 0||f,g=e.nice,h=g!==void 0&&g,m=$$({format:o,precision:s,useUTC:v});n=c==="auto"?m(t.min):o!=="native"?m(c):c,r=d==="auto"?m(t.max):o!=="native"?m(d):d;var b=v?Kw():Yw();b.range([0,C]),n&&r&&b.domain([n,r]),h===!0?b.nice():typeof h!="object"&&typeof h!="number"||b.nice(h);var x=b;return x.type="time",x.useUTC=v,x},ae1=function(e,t,C,n){var r,i=e.base,o=i===void 0?10:i,a=e.min,s=a===void 0?"auto":a,l=e.max,c=l===void 0?"auto":l;if(t.all.some(function(g){return g===0}))throw new Error("a log scale domain must not include or cross zero");var u,d,f=!1;if(t.all.filter(function(g){return g!=null}).forEach(function(g){f||(r===void 0?r=Math.sign(g):Math.sign(g)!==r&&(f=!0))}),f)throw new Error("a log scale domain must be strictly-positive or strictly-negative");u=s==="auto"?t.min:s,d=c==="auto"?t.max:c;var v=zl().domain([u,d]).rangeRound(n==="x"?[0,C]:[C,0]).base(o).nice();return v.type="log",v},se1=function(e,t,C,n){var r,i,o=e.constant,a=o===void 0?1:o,s=e.min,l=s===void 0?"auto":s,c=e.max,u=c===void 0?"auto":c,d=e.reverse,f=d!==void 0&&d;r=l==="auto"?t.min:l,i=u==="auto"?t.max:u;var v=Bl().constant(a).rangeRound(n==="x"?[0,C]:[C,0]).nice();f===!0?v.domain([i,r]):v.domain([r,i]);var g=v;return g.type="symlog",g},le1=function(e){return e==="x"?"y":"x"},ce1=function(e,t){return e===t},ue1=function(e,t){return e.getTime()===t.getTime()};function Gv(e,t,C,n){switch(e.type){case"linear":return te1(e,t,C,n);case"point":return ne1(e,t,C);case"band":return re1(e,t,C,n);case"time":return oe1(e,t,C);case"log":return ae1(e,t,C,n);case"symlog":return se1(e,t,C,n);default:throw new Error("invalid scale spec")}}var Yv=function(e,t,C){var n;if("stacked"in C&&C.stacked){var r=e.data[t==="x"?"xStacked":"yStacked"];return r==null?null:C(r)}return(n=C(e.data[t]))!=null?n:null},M$=function(e,t,C,n,r){var i=e.map(function(c){return function(u){return t8({},u,{data:u.data.map(function(d){return{data:t8({},d)}})})}(c)}),o=de1(i,t,C);"stacked"in t&&t.stacked===!0&&fe1(o,i),"stacked"in C&&C.stacked===!0&&he1(o,i);var a=Gv(t,o.x,n,"x"),s=Gv(C,o.y,r,"y"),l=i.map(function(c){return t8({},c,{data:c.data.map(function(u){return t8({},u,{position:{x:Yv(u,"x",a),y:Yv(u,"y",s)}})})})});return t8({},o,{series:l,xScale:a,yScale:s})},de1=function(e,t,C){return{x:Kv(e,"x",t),y:Kv(e,"y",C)}},Kv=function(e,t,C,n){var r={},i=r.getValue,o=i===void 0?function(v){return v.data[t]}:i,a=r.setValue,s=a===void 0?function(v,g){v.data[t]=g}:a;if(C.type==="linear")e.forEach(function(v){v.data.forEach(function(g){var h=o(g);h&&s(g,parseFloat(String(h)))})});else if(C.type==="time"&&C.format!=="native"){var l=$$(C);e.forEach(function(v){v.data.forEach(function(g){var h=o(g);h&&s(g,l(h))})})}var c=[];switch(e.forEach(function(v){v.data.forEach(function(g){c.push(o(g))})}),C.type){case"linear":var u=z01(Wo(c).filter(function(v){return v!==null}),function(v){return v});return{all:u,min:Math.min.apply(Math,u),max:Math.max.apply(Math,u)};case"time":var d=Oa(c,function(v){return v.getTime()}).slice(0).sort(function(v,g){return g.getTime()-v.getTime()}).reverse();return{all:d,min:d[0],max:c1(d)};default:var f=Wo(c);return{all:f,min:f[0],max:c1(f)}}},E$=function(e,t,C){var n=le1(e),r=[];t[n].all.forEach(function(i){var o=Q01(i)?ue1:ce1,a=[];C.forEach(function(s){var l=s.data.find(function(f){return o(f.data[n],i)}),c=null,u=null;if(l!==void 0){if((c=l.data[e])!==null){var d=c1(a);d===void 0?u=c:d!==null&&(u=d+c)}l.data[e==="x"?"xStacked":"yStacked"]=u}a.push(u),u!==null&&r.push(u)})}),t[e].minStacked=Math.min.apply(Math,r),t[e].maxStacked=Math.max.apply(Math,r)},fe1=function(e,t){return E$("x",e,t)},he1=function(e,t){return E$("y",e,t)},_$=function(e){var t=e.bandwidth();if(t===0)return e;var C=t/2;return e.round()&&(C=Math.round(C)),function(n){var r;return((r=e(n))!=null?r:0)+C}},O$={millisecond:[f7,f7],second:[w8,w8],minute:[Hn,Fn],hour:[kn,zn],day:[w2(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)}),w2(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:[S8,$8],sunday:[S8,$8],monday:[Ln,Bn],tuesday:[Pn,Wn],wednesday:[jn,Un],thursday:[In,Zn],friday:[An,qn],saturday:[Nn,Gn],month:[Dn,Yn],year:[we,Se]},ge1=Object.keys(O$),ve1=new RegExp("^every\\s*(\\d+)?\\s*("+ge1.join("|")+")s?$","i"),V$=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var C=t.match(ve1);if(C){var n=C[1],r=C[2],i=O$[r][e.useUTC?1:0];if(r==="day"){var o,a,s=e.domain(),l=s[0],c=s[1],u=new Date(c);return u.setDate(u.getDate()+1),(o=(a=i.every(Number(n??1)))==null?void 0:a.range(l,u))!=null?o:[]}if(n===void 0)return e.ticks(i);var d=i.every(Number(n));if(d)return e.ticks(d)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(f=t)=="number"&&isFinite(f)&&Math.floor(f)===f)return e.ticks(t)}var f;return e.domain()};function D4(){return D4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},D4.apply(this,arguments)}var T$=function(e){var t,C=e.axis,n=e.scale,r=e.ticksPosition,i=e.tickValues,o=e.tickSize,a=e.tickPadding,s=e.tickRotation,l=e.truncateTickAt,c=e.engine,u=c===void 0?"svg":c,d=V$(n,i),f=Y41[u],v="bandwidth"in n?_$(n):n,g={lineX:0,lineY:0},h={textX:0,textY:0},m=typeof document=="object"&&document.dir==="rtl",b=f.align.center,x=f.baseline.center;return C==="x"?(t=function(S){var w;return{x:(w=v(S))!=null?w:0,y:0}},g.lineY=o*(r==="after"?1:-1),h.textY=(o+a)*(r==="after"?1:-1),x=r==="after"?f.baseline.top:f.baseline.bottom,s===0?b=f.align.center:r==="after"&&s<0||r==="before"&&s>0?(b=f.align[m?"left":"right"],x=f.baseline.center):(r==="after"&&s>0||r==="before"&&s<0)&&(b=f.align[m?"right":"left"],x=f.baseline.center)):(t=function(S){var w;return{x:0,y:(w=v(S))!=null?w:0}},g.lineX=o*(r==="after"?1:-1),h.textX=(o+a)*(r==="after"?1:-1),b=r==="after"?f.align.left:f.align.right),{ticks:d.map(function(S){var w=typeof S=="string"?function(M){var _=String(M).length;return l&&l>0&&_>l?""+String(M).slice(0,l).concat("..."):""+M}(S):S;return D4({key:S instanceof Date?""+S.valueOf():""+S,value:w},t(S),g,h)}),textAlign:b,textBaseline:x}},R$=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var C=F8(e);return function(n){return C(n instanceof Date?n:new Date(n))}}return A8(e)},Va=function(e){var t,C=e.width,n=e.height,r=e.scale,i=e.axis,o=e.values,a=(t=o,(Array.isArray(t)?o:void 0)||V$(r,o)),s="bandwidth"in r?_$(r):r,l=i==="x"?a.map(function(c){var u,d;return{key:c instanceof Date?""+c.valueOf():""+c,x1:(u=s(c))!=null?u:0,x2:(d=s(c))!=null?d:0,y1:0,y2:n}}):a.map(function(c){var u,d;return{key:c instanceof Date?""+c.valueOf():""+c,x1:0,x2:C,y1:(u=s(c))!=null?u:0,y2:(d=s(c))!=null?d:0}});return l},me1=$.memo(function(e){var t,C=e.value,n=e.format,r=e.lineX,i=e.lineY,o=e.onClick,a=e.textBaseline,s=e.textAnchor,l=e.animatedProps,c=W5(),u=c.axis.ticks.line,d=c.axis.ticks.text,f=(t=n==null?void 0:n(C))!=null?t:C,v=$.useMemo(function(){var g={opacity:l.opacity};return o?{style:D4({},g,{cursor:"pointer"}),onClick:function(h){return o(h,f)}}:{style:g}},[l.opacity,o,f]);return p.jsxs(e5.g,D4({transform:l.transform},v,{children:[p.jsx("line",{x1:0,x2:r,y1:0,y2:i,style:u}),d.outlineWidth>0&&p.jsx(e5.text,{dominantBaseline:a,textAnchor:s,transform:l.textTransform,style:d,strokeWidth:2*d.outlineWidth,stroke:d.outlineColor,strokeLinejoin:"round",children:""+f}),p.jsx(e5.text,{dominantBaseline:a,textAnchor:s,transform:l.textTransform,style:hu(d),children:""+f})]}))}),pe1=function(e){var t=e.axis,C=e.scale,n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.length,s=e.ticksPosition,l=e.tickValues,c=e.tickSize,u=c===void 0?5:c,d=e.tickPadding,f=d===void 0?5:d,v=e.tickRotation,g=v===void 0?0:v,h=e.format,m=e.renderTick,b=m===void 0?me1:m,x=e.truncateTickAt,S=e.legend,w=e.legendPosition,M=w===void 0?"end":w,_=e.legendOffset,E=_===void 0?0:_,O=e.onClick,T=e.ariaHidden,k=W5(),A=k.axis.legend.text,V=$.useMemo(function(){return R$(h,C)},[h,C]),R=T$({axis:t,scale:C,ticksPosition:s,tickValues:l,tickSize:u,tickPadding:f,tickRotation:g,truncateTickAt:x}),P=R.ticks,L=R.textAlign,H=R.textBaseline,I=null;if(S!==void 0){var j,N=0,z=0,q=0;t==="y"?(q=-90,N=E,M==="start"?(j="start",z=a):M==="middle"?(j="middle",z=a/2):M==="end"&&(j="end")):(z=E,M==="start"?j="start":M==="middle"?(j="middle",N=a/2):M==="end"&&(j="end",N=a)),I=p.jsxs(p.Fragment,{children:[A.outlineWidth>0&&p.jsx("text",{transform:"translate("+N+", "+z+") rotate("+q+")",textAnchor:j,style:D4({dominantBaseline:"central"},A),strokeWidth:2*A.outlineWidth,stroke:A.outlineColor,strokeLinejoin:"round",children:S}),p.jsx("text",{transform:"translate("+N+", "+z+") rotate("+q+")",textAnchor:j,style:D4({dominantBaseline:"central"},A),children:S})]})}var G=A2(),Y=G.animate,e1=G.config,Q=X5({transform:"translate("+r+","+o+")",lineX2:t==="x"?a:0,lineY2:t==="x"?0:a,config:e1,immediate:!Y}),K=$.useCallback(function(U){return{opacity:1,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+g+")"}},[g]),J=$.useCallback(function(U){return{opacity:0,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+g+")"}},[g]),W=p4(P,{keys:function(U){return U.key},initial:K,from:J,enter:K,update:K,leave:{opacity:0},config:e1,immediate:!Y});return p.jsxs(e5.g,{transform:Q.transform,"aria-hidden":T,children:[W(function(U,Z,D,n1){return y.createElement(b,D4({tickIndex:n1,format:V,rotate:g,textBaseline:H,textAnchor:L,truncateTickAt:x,animatedProps:U},Z,O?{onClick:O}:{}))}),p.jsx(e5.line,{style:k.axis.domain.line,x1:0,x2:Q.lineX2,y1:0,y2:Q.lineY2}),I]})},be1=$.memo(pe1),H$=["top","right","bottom","left"],k$=$.memo(function(e){var t=e.xScale,C=e.yScale,n=e.width,r=e.height,i={top:e.top,right:e.right,bottom:e.bottom,left:e.left};return p.jsx(p.Fragment,{children:H$.map(function(o){var a=i[o];if(!a)return null;var s=o==="top"||o==="bottom";return p.jsx(be1,D4({},a,{axis:s?"x":"y",x:o==="right"?n:0,y:o==="bottom"?r:0,scale:s?t:C,length:s?n:r,ticksPosition:o==="top"||o==="left"?"before":"after",truncateTickAt:a.truncateTickAt}),o)})})}),ye1=$.memo(function(e){var t=e.animatedProps,C=W5();return p.jsx(e5.line,D4({},t,C.grid.line))}),Xv=$.memo(function(e){var t=e.lines,C=A2(),n=C.animate,r=C.config,i=p4(t,{keys:function(o){return o.key},initial:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},from:function(o){return{opacity:0,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},enter:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},update:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},leave:{opacity:0},config:r,immediate:!n});return p.jsx("g",{children:i(function(o,a){return $.createElement(ye1,D4({},a,{key:a.key,animatedProps:o}))})})}),L$=$.memo(function(e){var t=e.width,C=e.height,n=e.xScale,r=e.yScale,i=e.xValues,o=e.yValues,a=$.useMemo(function(){return!!n&&Va({width:t,height:C,scale:n,axis:"x",values:i})},[n,i,t,C]),s=$.useMemo(function(){return!!r&&Va({width:t,height:C,scale:r,axis:"y",values:o})},[C,t,r,o]);return p.jsxs(p.Fragment,{children:[a&&p.jsx(Xv,{lines:a}),s&&p.jsx(Xv,{lines:s})]})}),xe1=function(e,t){var C,n=t.axis,r=t.scale,i=t.x,o=i===void 0?0:i,a=t.y,s=a===void 0?0:a,l=t.length,c=t.ticksPosition,u=t.tickValues,d=t.tickSize,f=d===void 0?5:d,v=t.tickPadding,g=v===void 0?5:v,h=t.tickRotation,m=h===void 0?0:h,b=t.format,x=t.legend,S=t.legendPosition,w=S===void 0?"end":S,M=t.legendOffset,_=M===void 0?0:M,E=t.theme,O=T$({axis:n,scale:r,ticksPosition:c,tickValues:u,tickSize:f,tickPadding:g,tickRotation:m,engine:"canvas"}),T=O.ticks,k=O.textAlign,A=O.textBaseline;e.save(),e.translate(o,s),e.textAlign=k,e.textBaseline=A;var V=E.axis.ticks.text;e.font=(V.fontWeight?V.fontWeight+" ":"")+V.fontSize+"px "+V.fontFamily,((C=E.axis.domain.line.strokeWidth)!=null?C:0)>0&&(e.lineWidth=Number(E.axis.domain.line.strokeWidth),e.lineCap="square",E.axis.domain.line.stroke&&(e.strokeStyle=E.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(n==="x"?l:0,n==="x"?0:l),e.stroke());var R=typeof b=="function"?b:function(j){return""+j};if(T.forEach(function(j){var N;((N=E.axis.ticks.line.strokeWidth)!=null?N:0)>0&&(e.lineWidth=Number(E.axis.ticks.line.strokeWidth),e.lineCap="square",E.axis.ticks.line.stroke&&(e.strokeStyle=E.axis.ticks.line.stroke),e.beginPath(),e.moveTo(j.x,j.y),e.lineTo(j.x+j.lineX,j.y+j.lineY),e.stroke());var z=R(j.value);e.save(),e.translate(j.x+j.textX,j.y+j.textY),e.rotate(N4(m)),V.outlineWidth>0&&(e.strokeStyle=V.outlineColor,e.lineWidth=2*V.outlineWidth,e.lineJoin="round",e.strokeText(""+z,0,0)),E.axis.ticks.text.fill&&(e.fillStyle=V.fill),e.fillText(""+z,0,0),e.restore()}),x!==void 0){var P=0,L=0,H=0,I="center";n==="y"?(H=-90,P=_,w==="start"?(I="start",L=l):w==="middle"?(I="center",L=l/2):w==="end"&&(I="end")):(L=_,w==="start"?I="start":w==="middle"?(I="center",P=l/2):w==="end"&&(I="end",P=l)),e.translate(P,L),e.rotate(N4(H)),e.font=(E.axis.legend.text.fontWeight?E.axis.legend.text.fontWeight+" ":"")+E.axis.legend.text.fontSize+"px "+E.axis.legend.text.fontFamily,E.axis.legend.text.fill&&(e.fillStyle=E.axis.legend.text.fill),e.textAlign=I,e.textBaseline="middle",e.fillText(x,0,0)}e.restore()},P$=function(e,t){var C=t.xScale,n=t.yScale,r=t.width,i=t.height,o=t.top,a=t.right,s=t.bottom,l=t.left,c=t.theme,u={top:o,right:a,bottom:s,left:l};H$.forEach(function(d){var f=u[d];if(!f)return null;var v=d==="top"||d==="bottom",g=d==="top"||d==="left"?"before":"after",h=v?C:n,m=R$(f.format,h);xe1(e,D4({},f,{axis:v?"x":"y",x:d==="right"?r:0,y:d==="bottom"?i:0,scale:h,format:m,length:v?r:i,ticksPosition:g,theme:c}))})},gC=function(e,t){var C=t.width,n=t.height,r=t.scale,i=t.axis,o=t.values;Va({width:C,height:n,scale:r,axis:i,values:o}).forEach(function(a){e.beginPath(),e.moveTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.stroke()})},we1=w$;function Se1(e,t){var C=[];return we1(e,function(n,r,i){t(n,r,i)&&C.push(n)}),C}var $e1=Se1,Me1=TS,Ee1=$e1,_e1=pu,Oe1=b4;function Ve1(e,t){var C=Oe1(e)?Me1:Ee1;return C(e,_e1(t))}var Te1=Ve1;const bu=p2(Te1);var Re1=g7,He1=Z4,ke1="[object Number]";function Le1(e){return typeof e=="number"||He1(e)&&Re1(e)==ke1}var Pe1=Le1;const M8=p2(Pe1);function je1(e,t,C){var n=-1,r=e.length;t<0&&(t=-t>r?0:r+t),C=C>r?r:C,C<0&&(C+=r),r=t>C?0:C-t>>>0,t>>>=0;for(var i=Array(r);++n<r;)i[n]=e[n+t];return i}var j$=je1,Ie1=ge,Ae1=j$;function Ne1(e,t){return t.length<2?e:Ie1(e,Ae1(t,0,-1))}var De1=Ne1,Fe1=a6,ze1=Rw,Be1=De1,We1=s6;function Ue1(e,t){return t=Fe1(t,e),e=Be1(e,t),e==null||delete e[We1(ze1(t))]}var Ze1=Ue1,qe1=El;function Ge1(e){return qe1(e)?void 0:e}var Ye1=Ge1,Ke1=dn,Xe1=f$,Qe1=Ze1,Je1=a6,et1=o6,tt1=Ye1,Ct1=ES,nt1=l$,rt1=1,it1=2,ot1=4,at1=Ct1(function(e,t){var C={};if(e==null)return C;var n=!1;t=Ke1(t,function(i){return i=Je1(i,e),n||(n=i.length>1),i}),et1(e,nt1(e),C),n&&(C=Xe1(C,rt1|it1|ot1,tt1));for(var r=t.length;r--;)Qe1(C,t[r]);return C}),st1=at1;const Z8=p2(st1);function P7(){return P7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},P7.apply(this,arguments)}var Ta={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},lt1=function(e){var t=typeof e;return $.isValidElement(e)||t==="string"||t==="function"||t==="object"},ct1=function(e){var t=typeof e;return t==="string"||t==="function"},Z0=function(e){return e.type==="circle"},Ra=function(e){return e.type==="dot"},q0=function(e){return e.type==="rect"},ut1=function(e){var t=e.data,C=e.annotations,n=e.getPosition,r=e.getDimensions;return C.reduce(function(i,o){var a=o.offset||0;return[].concat(i,bu(t,o.match).map(function(s){var l=n(s),c=r(s);return(Z0(o)||q0(o))&&(c.size=c.size+2*a,c.width=c.width+2*a,c.height=c.height+2*a),P7({},Z8(o,["match","offset"]),l,c,{size:o.size||c.size,datum:s})}))},[])},dt1=function(e,t,C,n){var r=Math.atan2(n-t,C-e);return G41(Tn(r))},ft1=function(e){var t,C,n=e.x,r=e.y,i=e.noteX,o=e.noteY,a=e.noteWidth,s=a===void 0?Ta.noteWidth:a,l=e.noteTextOffset,c=l===void 0?Ta.noteTextOffset:l;if(M8(i))t=n+i;else{if(i.abs===void 0)throw new Error("noteX should be either a number or an object containing an 'abs' property");t=i.abs}if(M8(o))C=r+o;else{if(o.abs===void 0)throw new Error("noteY should be either a number or an object containing an 'abs' property");C=o.abs}var u=n,d=r,f=dt1(n,r,t,C);if(Z0(e)){var v=f8(N4(f),e.size/2);u+=v.x,d+=v.y}if(q0(e)){var g=Math.round((f+90)/45)%8;g===0&&(d-=e.height/2),g===1&&(u+=e.width/2,d-=e.height/2),g===2&&(u+=e.width/2),g===3&&(u+=e.width/2,d+=e.height/2),g===4&&(d+=e.height/2),g===5&&(u-=e.width/2,d+=e.height/2),g===6&&(u-=e.width/2),g===7&&(u-=e.width/2,d-=e.height/2)}var h=t,m=t;return(f+90)%360>180?(h-=s,m-=s):m+=s,{points:[[u,d],[t,C],[m,C]],text:[h,C-c],angle:f+90}},ht1=function(e){var t=e.data,C=e.annotations,n=e.getPosition,r=e.getDimensions;return $.useMemo(function(){return ut1({data:t,annotations:C,getPosition:n,getDimensions:r})},[t,C,n,r])},gt1=function(e){return $.useMemo(function(){return ft1(e)},[e])},vt1=function(e){var t=e.datum,C=e.x,n=e.y,r=e.note,i=W5(),o=A2(),a=o.animate,s=o.config,l=X5({x:C,y:n,config:s,immediate:!a});return typeof r=="function"?$.createElement(r,{x:C,y:n,datum:t}):p.jsxs(p.Fragment,{children:[i.annotations.text.outlineWidth>0&&p.jsx(e5.text,{x:l.x,y:l.y,style:P7({},i.annotations.text,{strokeLinejoin:"round",strokeWidth:2*i.annotations.text.outlineWidth,stroke:i.annotations.text.outlineColor}),children:r}),p.jsx(e5.text,{x:l.x,y:l.y,style:Z8(i.annotations.text,["outlineWidth","outlineColor"]),children:r})]})},Qv=function(e){var t=e.points,C=e.isOutline,n=C!==void 0&&C,r=W5(),i=$.useMemo(function(){var s=t[0];return t.slice(1).reduce(function(l,c){return l+" L"+c[0]+","+c[1]},"M"+s[0]+","+s[1])},[t]),o=Vn(i);if(n&&r.annotations.link.outlineWidth<=0)return null;var a=P7({},r.annotations.link);return n&&(a.strokeLinecap="square",a.strokeWidth=r.annotations.link.strokeWidth+2*r.annotations.link.outlineWidth,a.stroke=r.annotations.link.outlineColor,a.opacity=r.annotations.link.outlineOpacity),p.jsx(e5.path,{fill:"none",d:o,style:a})},mt1=function(e){var t=e.x,C=e.y,n=e.size,r=W5(),i=A2(),o=i.animate,a=i.config,s=X5({x:t,y:C,radius:n/2,config:a,immediate:!o});return p.jsxs(p.Fragment,{children:[r.annotations.outline.outlineWidth>0&&p.jsx(e5.circle,{cx:s.x,cy:s.y,r:s.radius,style:P7({},r.annotations.outline,{fill:"none",strokeWidth:r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,stroke:r.annotations.outline.outlineColor,opacity:r.annotations.outline.outlineOpacity})}),p.jsx(e5.circle,{cx:s.x,cy:s.y,r:s.radius,style:r.annotations.outline})]})},pt1=function(e){var t=e.x,C=e.y,n=e.size,r=n===void 0?Ta.dotSize:n,i=W5(),o=A2(),a=o.animate,s=o.config,l=X5({x:t,y:C,radius:r/2,config:s,immediate:!a});return p.jsxs(p.Fragment,{children:[i.annotations.outline.outlineWidth>0&&p.jsx(e5.circle,{cx:l.x,cy:l.y,r:l.radius,style:P7({},i.annotations.outline,{fill:"none",strokeWidth:2*i.annotations.outline.outlineWidth,stroke:i.annotations.outline.outlineColor,opacity:i.annotations.outline.outlineOpacity})}),p.jsx(e5.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.symbol})]})},bt1=function(e){var t=e.x,C=e.y,n=e.width,r=e.height,i=e.borderRadius,o=i===void 0?6:i,a=W5(),s=A2(),l=s.animate,c=s.config,u=X5({x:t-n/2,y:C-r/2,width:n,height:r,config:c,immediate:!l});return p.jsxs(p.Fragment,{children:[a.annotations.outline.outlineWidth>0&&p.jsx(e5.rect,{x:u.x,y:u.y,rx:o,ry:o,width:u.width,height:u.height,style:P7({},a.annotations.outline,{fill:"none",strokeWidth:a.annotations.outline.strokeWidth+2*a.annotations.outline.outlineWidth,stroke:a.annotations.outline.outlineColor,opacity:a.annotations.outline.outlineOpacity})}),p.jsx(e5.rect,{x:u.x,y:u.y,rx:o,ry:o,width:u.width,height:u.height,style:a.annotations.outline})]})},yt1=function(e){var t=e.datum,C=e.x,n=e.y,r=e.note,i=gt1(e);if(!lt1(r))throw new Error("note should be a valid react element");return p.jsxs(p.Fragment,{children:[p.jsx(Qv,{points:i.points,isOutline:!0}),Z0(e)&&p.jsx(mt1,{x:C,y:n,size:e.size}),Ra(e)&&p.jsx(pt1,{x:C,y:n,size:e.size}),q0(e)&&p.jsx(bt1,{x:C,y:n,width:e.width,height:e.height,borderRadius:e.borderRadius}),p.jsx(Qv,{points:i.points}),p.jsx(vt1,{datum:t,x:i.text[0],y:i.text[1],note:r})]})},Jv=function(e,t){t.forEach(function(C,n){var r=C[0],i=C[1];n===0?e.moveTo(r,i):e.lineTo(r,i)})},xt1=function(e,t){var C=t.annotations,n=t.theme;C.length!==0&&(e.save(),C.forEach(function(r){if(!ct1(r.note))throw new Error("note is invalid for canvas implementation");n.annotations.link.outlineWidth>0&&(e.lineCap="square",e.strokeStyle=n.annotations.link.outlineColor,e.lineWidth=n.annotations.link.strokeWidth+2*n.annotations.link.outlineWidth,e.beginPath(),Jv(e,r.computed.points),e.stroke(),e.lineCap="butt"),Z0(r)&&n.annotations.outline.outlineWidth>0&&(e.strokeStyle=n.annotations.outline.outlineColor,e.lineWidth=n.annotations.outline.strokeWidth+2*n.annotations.outline.outlineWidth,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.stroke()),Ra(r)&&n.annotations.symbol.outlineWidth>0&&(e.strokeStyle=n.annotations.symbol.outlineColor,e.lineWidth=2*n.annotations.symbol.outlineWidth,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.stroke()),q0(r)&&n.annotations.outline.outlineWidth>0&&(e.strokeStyle=n.annotations.outline.outlineColor,e.lineWidth=n.annotations.outline.strokeWidth+2*n.annotations.outline.outlineWidth,e.beginPath(),e.rect(r.x-r.width/2,r.y-r.height/2,r.width,r.height),e.stroke()),e.strokeStyle=n.annotations.link.stroke,e.lineWidth=n.annotations.link.strokeWidth,e.beginPath(),Jv(e,r.computed.points),e.stroke(),Z0(r)&&(e.strokeStyle=n.annotations.outline.stroke,e.lineWidth=n.annotations.outline.strokeWidth,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.stroke()),Ra(r)&&(e.fillStyle=n.annotations.symbol.fill,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.fill()),q0(r)&&(e.strokeStyle=n.annotations.outline.stroke,e.lineWidth=n.annotations.outline.strokeWidth,e.beginPath(),e.rect(r.x-r.width/2,r.y-r.height/2,r.width,r.height),e.stroke()),typeof r.note=="function"?r.note(e,{datum:r.datum,x:r.computed.text[0],y:r.computed.text[1],theme:n}):(e.font=n.annotations.text.fontSize+"px "+n.annotations.text.fontFamily,e.textAlign="left",e.textBaseline="alphabetic",e.fillStyle=n.annotations.text.fill,e.strokeStyle=n.annotations.text.outlineColor,e.lineWidth=2*n.annotations.text.outlineWidth,n.annotations.text.outlineWidth>0&&(e.lineJoin="round",e.strokeText(r.note,r.computed.text[0],r.computed.text[1]),e.lineJoin="miter"),e.fillText(r.note,r.computed.text[0],r.computed.text[1]))}),e.restore())};const a7=11102230246251565e-32,e4=134217729,wt1=(3+8*a7)*a7;function xi(e,t,C,n,r){let i,o,a,s,l=t[0],c=n[0],u=0,d=0;c>l==c>-l?(i=l,l=t[++u]):(i=c,c=n[++d]);let f=0;if(u<e&&d<C)for(c>l==c>-l?(o=l+i,a=i-(o-l),l=t[++u]):(o=c+i,a=i-(o-c),c=n[++d]),i=o,a!==0&&(r[f++]=a);u<e&&d<C;)c>l==c>-l?(o=i+l,s=o-i,a=i-(o-s)+(l-s),l=t[++u]):(o=i+c,s=o-i,a=i-(o-s)+(c-s),c=n[++d]),i=o,a!==0&&(r[f++]=a);for(;u<e;)o=i+l,s=o-i,a=i-(o-s)+(l-s),l=t[++u],i=o,a!==0&&(r[f++]=a);for(;d<C;)o=i+c,s=o-i,a=i-(o-s)+(c-s),c=n[++d],i=o,a!==0&&(r[f++]=a);return(i!==0||f===0)&&(r[f++]=i),f}function St1(e,t){let C=t[0];for(let n=1;n<e;n++)C+=t[n];return C}function $e(e){return new Float64Array(e)}const $t1=(3+16*a7)*a7,Mt1=(2+12*a7)*a7,Et1=(9+64*a7)*a7*a7,s9=$e(4),em=$e(8),tm=$e(12),Cm=$e(16),l4=$e(4);function _t1(e,t,C,n,r,i,o){let a,s,l,c,u,d,f,v,g,h,m,b,x,S,w,M,_,E;const O=e-r,T=C-r,k=t-i,A=n-i;S=O*A,d=e4*O,f=d-(d-O),v=O-f,d=e4*A,g=d-(d-A),h=A-g,w=v*h-(S-f*g-v*g-f*h),M=k*T,d=e4*k,f=d-(d-k),v=k-f,d=e4*T,g=d-(d-T),h=T-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,s9[0]=w-(m+u)+(u-_),b=S+m,u=b-S,x=S-(b-u)+(m-u),m=x-M,u=x-m,s9[1]=x-(m+u)+(u-M),E=b+m,u=E-b,s9[2]=b-(E-u)+(m-u),s9[3]=E;let V=St1(4,s9),R=Mt1*o;if(V>=R||-V>=R||(u=e-O,a=e-(O+u)+(u-r),u=C-T,l=C-(T+u)+(u-r),u=t-k,s=t-(k+u)+(u-i),u=n-A,c=n-(A+u)+(u-i),a===0&&s===0&&l===0&&c===0)||(R=Et1*o+wt1*Math.abs(V),V+=O*c+A*a-(k*l+T*s),V>=R||-V>=R))return V;S=a*A,d=e4*a,f=d-(d-a),v=a-f,d=e4*A,g=d-(d-A),h=A-g,w=v*h-(S-f*g-v*g-f*h),M=s*T,d=e4*s,f=d-(d-s),v=s-f,d=e4*T,g=d-(d-T),h=T-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,l4[0]=w-(m+u)+(u-_),b=S+m,u=b-S,x=S-(b-u)+(m-u),m=x-M,u=x-m,l4[1]=x-(m+u)+(u-M),E=b+m,u=E-b,l4[2]=b-(E-u)+(m-u),l4[3]=E;const P=xi(4,s9,4,l4,em);S=O*c,d=e4*O,f=d-(d-O),v=O-f,d=e4*c,g=d-(d-c),h=c-g,w=v*h-(S-f*g-v*g-f*h),M=k*l,d=e4*k,f=d-(d-k),v=k-f,d=e4*l,g=d-(d-l),h=l-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,l4[0]=w-(m+u)+(u-_),b=S+m,u=b-S,x=S-(b-u)+(m-u),m=x-M,u=x-m,l4[1]=x-(m+u)+(u-M),E=b+m,u=E-b,l4[2]=b-(E-u)+(m-u),l4[3]=E;const L=xi(P,em,4,l4,tm);S=a*c,d=e4*a,f=d-(d-a),v=a-f,d=e4*c,g=d-(d-c),h=c-g,w=v*h-(S-f*g-v*g-f*h),M=s*l,d=e4*s,f=d-(d-s),v=s-f,d=e4*l,g=d-(d-l),h=l-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,l4[0]=w-(m+u)+(u-_),b=S+m,u=b-S,x=S-(b-u)+(m-u),m=x-M,u=x-m,l4[1]=x-(m+u)+(u-M),E=b+m,u=E-b,l4[2]=b-(E-u)+(m-u),l4[3]=E;const H=xi(L,tm,4,l4,Cm);return Cm[H-1]}function ot(e,t,C,n,r,i){const o=(t-i)*(C-r),a=(e-r)*(n-i),s=o-a,l=Math.abs(o+a);return Math.abs(s)>=$t1*l?s:-_t1(e,t,C,n,r,i,l)}const nm=Math.pow(2,-52),at=new Uint32Array(512);class vC{static from(t,C=Ht1,n=kt1){const r=t.length,i=new Float64Array(r*2);for(let o=0;o<r;o++){const a=t[o];i[2*o]=C(a),i[2*o+1]=n(a)}return new vC(i)}constructor(t){const C=t.length>>1;if(C>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*C-5,0);this._triangles=new Uint32Array(n*3),this._halfedges=new Int32Array(n*3),this._hashSize=Math.ceil(Math.sqrt(C)),this._hullPrev=new Uint32Array(C),this._hullNext=new Uint32Array(C),this._hullTri=new Uint32Array(C),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(C),this._dists=new Float64Array(C),this.update()}update(){const{coords:t,_hullPrev:C,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,s=1/0,l=-1/0,c=-1/0;for(let O=0;O<o;O++){const T=t[2*O],k=t[2*O+1];T<a&&(a=T),k<s&&(s=k),T>l&&(l=T),k>c&&(c=k),this._ids[O]=O}const u=(a+l)/2,d=(s+c)/2;let f,v,g;for(let O=0,T=1/0;O<o;O++){const k=wi(u,d,t[2*O],t[2*O+1]);k<T&&(f=O,T=k)}const h=t[2*f],m=t[2*f+1];for(let O=0,T=1/0;O<o;O++){if(O===f)continue;const k=wi(h,m,t[2*O],t[2*O+1]);k<T&&k>0&&(v=O,T=k)}let b=t[2*v],x=t[2*v+1],S=1/0;for(let O=0;O<o;O++){if(O===f||O===v)continue;const T=Tt1(h,m,b,x,t[2*O],t[2*O+1]);T<S&&(g=O,S=T)}let w=t[2*g],M=t[2*g+1];if(S===1/0){for(let k=0;k<o;k++)this._dists[k]=t[2*k]-t[0]||t[2*k+1]-t[1];p9(this._ids,this._dists,0,o-1);const O=new Uint32Array(o);let T=0;for(let k=0,A=-1/0;k<o;k++){const V=this._ids[k],R=this._dists[V];R>A&&(O[T++]=V,A=R)}this.hull=O.subarray(0,T),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(ot(h,m,b,x,w,M)<0){const O=v,T=b,k=x;v=g,b=w,x=M,g=O,w=T,M=k}const _=Rt1(h,m,b,x,w,M);this._cx=_.x,this._cy=_.y;for(let O=0;O<o;O++)this._dists[O]=wi(t[2*O],t[2*O+1],_.x,_.y);p9(this._ids,this._dists,0,o-1),this._hullStart=f;let E=3;n[f]=C[g]=v,n[v]=C[f]=g,n[g]=C[v]=f,r[f]=0,r[v]=1,r[g]=2,i.fill(-1),i[this._hashKey(h,m)]=f,i[this._hashKey(b,x)]=v,i[this._hashKey(w,M)]=g,this.trianglesLen=0,this._addTriangle(f,v,g,-1,-1,-1);for(let O=0,T,k;O<this._ids.length;O++){const A=this._ids[O],V=t[2*A],R=t[2*A+1];if(O>0&&Math.abs(V-T)<=nm&&Math.abs(R-k)<=nm||(T=V,k=R,A===f||A===v||A===g))continue;let P=0;for(let N=0,z=this._hashKey(V,R);N<this._hashSize&&(P=i[(z+N)%this._hashSize],!(P!==-1&&P!==n[P]));N++);P=C[P];let L=P,H;for(;H=n[L],ot(V,R,t[2*L],t[2*L+1],t[2*H],t[2*H+1])>=0;)if(L=H,L===P){L=-1;break}if(L===-1)continue;let I=this._addTriangle(L,A,n[L],-1,-1,r[L]);r[A]=this._legalize(I+2),r[L]=I,E++;let j=n[L];for(;H=n[j],ot(V,R,t[2*j],t[2*j+1],t[2*H],t[2*H+1])<0;)I=this._addTriangle(j,A,H,r[A],-1,r[j]),r[A]=this._legalize(I+2),n[j]=j,E--,j=H;if(L===P)for(;H=C[L],ot(V,R,t[2*H],t[2*H+1],t[2*L],t[2*L+1])<0;)I=this._addTriangle(H,A,L,-1,r[L],r[H]),this._legalize(I+2),r[H]=I,n[L]=L,E--,L=H;this._hullStart=C[A]=L,n[L]=C[j]=A,n[A]=j,i[this._hashKey(V,R)]=A,i[this._hashKey(t[2*L],t[2*L+1])]=L}this.hull=new Uint32Array(E);for(let O=0,T=this._hullStart;O<E;O++)this.hull[O]=T,T=n[T];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,C){return Math.floor(Ot1(t-this._cx,C-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:C,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,a===-1){if(i===0)break;t=at[--i];continue}const l=a-a%3,c=s+(t+1)%3,u=l+(a+2)%3,d=C[o],f=C[t],v=C[c],g=C[u];if(Vt1(r[2*d],r[2*d+1],r[2*f],r[2*f+1],r[2*v],r[2*v+1],r[2*g],r[2*g+1])){C[t]=g,C[a]=d;const m=n[u];if(m===-1){let x=this._hullStart;do{if(this._hullTri[x]===u){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,m),this._link(a,n[o]),this._link(o,u);const b=l+(a+1)%3;i<at.length&&(at[i++]=b)}else{if(i===0)break;t=at[--i]}}return o}_link(t,C){this._halfedges[t]=C,C!==-1&&(this._halfedges[C]=t)}_addTriangle(t,C,n,r,i,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=C,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,o),this.trianglesLen+=3,a}}function Ot1(e,t){const C=e/(Math.abs(e)+Math.abs(t));return(t>0?3-C:1+C)/4}function wi(e,t,C,n){const r=e-C,i=t-n;return r*r+i*i}function Vt1(e,t,C,n,r,i,o,a){const s=e-o,l=t-a,c=C-o,u=n-a,d=r-o,f=i-a,v=s*s+l*l,g=c*c+u*u,h=d*d+f*f;return s*(u*h-g*f)-l*(c*h-g*d)+v*(c*f-u*d)<0}function Tt1(e,t,C,n,r,i){const o=C-e,a=n-t,s=r-e,l=i-t,c=o*o+a*a,u=s*s+l*l,d=.5/(o*l-a*s),f=(l*c-a*u)*d,v=(o*u-s*c)*d;return f*f+v*v}function Rt1(e,t,C,n,r,i){const o=C-e,a=n-t,s=r-e,l=i-t,c=o*o+a*a,u=s*s+l*l,d=.5/(o*l-a*s),f=e+(l*c-a*u)*d,v=t+(o*u-s*c)*d;return{x:f,y:v}}function p9(e,t,C,n){if(n-C<=20)for(let r=C+1;r<=n;r++){const i=e[r],o=t[i];let a=r-1;for(;a>=C&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=i}else{const r=C+n>>1;let i=C+1,o=n;U6(e,r,i),t[e[C]]>t[e[n]]&&U6(e,C,n),t[e[i]]>t[e[n]]&&U6(e,i,n),t[e[C]]>t[e[i]]&&U6(e,C,i);const a=e[i],s=t[a];for(;;){do i++;while(t[e[i]]<s);do o--;while(t[e[o]]>s);if(o<i)break;U6(e,i,o)}e[C+1]=e[o],e[o]=a,n-i+1>=o-C?(p9(e,t,i,n),p9(e,t,C,o-1)):(p9(e,t,C,o-1),p9(e,t,i,n))}}function U6(e,t,C){const n=e[t];e[t]=e[C],e[C]=n}function Ht1(e){return e[0]}function kt1(e){return e[1]}const rm=1e-6;class s8{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,C){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+C}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,C){this._+=`L${this._x1=+t},${this._y1=+C}`}arc(t,C,n){t=+t,C=+C,n=+n;const r=t+n,i=C;if(n<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>rm||Math.abs(this._y1-i)>rm)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${C}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,C,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+C}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Ha{constructor(){this._=[]}moveTo(t,C){this._.push([t,C])}closePath(){this._.push(this._[0].slice())}lineTo(t,C){this._.push([t,C])}value(){return this._.length?this._:null}}class Lt1{constructor(t,[C,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(C=+C))||!((i=+i)>=(n=+n)))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=r,this.xmin=C,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:C,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let g=0,h=0,m=n.length,b,x;g<m;g+=3,h+=2){const S=n[g]*2,w=n[g+1]*2,M=n[g+2]*2,_=t[S],E=t[S+1],O=t[w],T=t[w+1],k=t[M],A=t[M+1],V=O-_,R=T-E,P=k-_,L=A-E,H=(V*L-R*P)*2;if(Math.abs(H)<1e-9){if(i===void 0){i=o=0;for(const j of C)i+=t[j*2],o+=t[j*2+1];i/=C.length,o/=C.length}const I=1e9*Math.sign((i-_)*L-(o-E)*P);b=(_+k)/2-I*L,x=(E+A)/2+I*P}else{const I=1/H,j=V*V+R*R,N=P*P+L*L;b=_+(L*j-R*N)*I,x=E+(V*N-P*j)*I}a[h]=b,a[h+1]=x}let s=C[C.length-1],l,c=s*4,u,d=t[2*s],f,v=t[2*s+1];r.fill(0);for(let g=0;g<C.length;++g)s=C[g],l=c,u=d,f=v,c=s*4,d=t[2*s],v=t[2*s+1],r[l+2]=r[c]=f-v,r[l+3]=r[c+1]=d-u}render(t){const C=t==null?t=new s8:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:o,vectors:a}=this;if(i.length<=1)return null;for(let c=0,u=n.length;c<u;++c){const d=n[c];if(d<c)continue;const f=Math.floor(c/3)*2,v=Math.floor(d/3)*2,g=o[f],h=o[f+1],m=o[v],b=o[v+1];this._renderSegment(g,h,m,b,t)}let s,l=i[i.length-1];for(let c=0;c<i.length;++c){s=l,l=i[c];const u=Math.floor(r[l]/3)*2,d=o[u],f=o[u+1],v=s*4,g=this._project(d,f,a[v+2],a[v+3]);g&&this._renderSegment(d,f,g[0],g[1],t)}return C&&C.value()}renderBounds(t){const C=t==null?t=new s8:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),C&&C.value()}renderCell(t,C){const n=C==null?C=new s8:void 0,r=this._clip(t);if(r===null||!r.length)return;C.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let o=2;o<i;o+=2)(r[o]!==r[o-2]||r[o+1]!==r[o-1])&&C.lineTo(r[o],r[o+1]);return C.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let C=0,n=t.length/2;C<n;++C){const r=this.cellPolygon(C);r&&(r.index=C,yield r)}}cellPolygon(t){const C=new Ha;return this.renderCell(t,C),C.value()}_renderSegment(t,C,n,r,i){let o;const a=this._regioncode(t,C),s=this._regioncode(n,r);a===0&&s===0?(i.moveTo(t,C),i.lineTo(n,r)):(o=this._clipSegment(t,C,n,r,a,s))&&(i.moveTo(o[0],o[1]),i.lineTo(o[2],o[3]))}contains(t,C,n){return C=+C,C!==C||(n=+n,n!==n)?!1:this.delaunay._step(t,C,n)===t}*neighbors(t){const C=this._clip(t);if(C)for(const n of this.delaunay.neighbors(t)){const r=this._clip(n);if(r){e:for(let i=0,o=C.length;i<o;i+=2)for(let a=0,s=r.length;a<s;a+=2)if(C[i]===r[a]&&C[i+1]===r[a+1]&&C[(i+2)%o]===r[(a+s-2)%s]&&C[(i+3)%o]===r[(a+s-1)%s]){yield n;break e}}}}_cell(t){const{circumcenters:C,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,o=n[t];if(o===-1)return null;const a=[];let s=o;do{const l=Math.floor(s/3);if(a.push(C[l*2],C[l*2+1]),s=s%3===2?s-2:s+1,i[s]!==t)break;s=r[s]}while(s!==o&&s!==-1);return a}_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 C=this._cell(t);if(C===null)return null;const{vectors:n}=this,r=t*4;return this._simplify(n[r]||n[r+1]?this._clipInfinite(t,C,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,C))}_clipFinite(t,C){const n=C.length;let r=null,i,o,a=C[n-2],s=C[n-1],l,c=this._regioncode(a,s),u,d=0;for(let f=0;f<n;f+=2)if(i=a,o=s,a=C[f],s=C[f+1],l=c,c=this._regioncode(a,s),l===0&&c===0)u=d,d=0,r?r.push(a,s):r=[a,s];else{let v,g,h,m,b;if(l===0){if((v=this._clipSegment(i,o,a,s,l,c))===null)continue;[g,h,m,b]=v}else{if((v=this._clipSegment(a,s,i,o,c,l))===null)continue;[m,b,g,h]=v,u=d,d=this._edgecode(g,h),u&&d&&this._edge(t,u,d,r,r.length),r?r.push(g,h):r=[g,h]}u=d,d=this._edgecode(m,b),u&&d&&this._edge(t,u,d,r,r.length),r?r.push(m,b):r=[m,b]}if(r)u=d,d=this._edgecode(r[0],r[1]),u&&d&&this._edge(t,u,d,r,r.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 r}_clipSegment(t,C,n,r,i,o){const a=i<o;for(a&&([t,C,n,r,i,o]=[n,r,t,C,o,i]);;){if(i===0&&o===0)return a?[n,r,t,C]:[t,C,n,r];if(i&o)return null;let s,l,c=i||o;c&8?(s=t+(n-t)*(this.ymax-C)/(r-C),l=this.ymax):c&4?(s=t+(n-t)*(this.ymin-C)/(r-C),l=this.ymin):c&2?(l=C+(r-C)*(this.xmax-t)/(n-t),s=this.xmax):(l=C+(r-C)*(this.xmin-t)/(n-t),s=this.xmin),i?(t=s,C=l,i=this._regioncode(t,C)):(n=s,r=l,o=this._regioncode(n,r))}}_clipInfinite(t,C,n,r,i,o){let a=Array.from(C),s;if((s=this._project(a[0],a[1],n,r))&&a.unshift(s[0],s[1]),(s=this._project(a[a.length-2],a[a.length-1],i,o))&&a.push(s[0],s[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,u,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)u=d,d=this._edgecode(a[l],a[l+1]),u&&d&&(l=this._edge(t,u,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,C,n,r,i){for(;C!==n;){let o,a;switch(C){case 5:C=4;continue;case 4:C=6,o=this.xmax,a=this.ymin;break;case 6:C=2;continue;case 2:C=10,o=this.xmax,a=this.ymax;break;case 10:C=8;continue;case 8:C=9,o=this.xmin,a=this.ymax;break;case 9:C=1;continue;case 1:C=5,o=this.xmin,a=this.ymin;break}(r[i]!==o||r[i+1]!==a)&&this.contains(t,o,a)&&(r.splice(i,0,o,a),i+=2)}return i}_project(t,C,n,r){let i=1/0,o,a,s;if(r<0){if(C<=this.ymin)return null;(o=(this.ymin-C)/r)<i&&(s=this.ymin,a=t+(i=o)*n)}else if(r>0){if(C>=this.ymax)return null;(o=(this.ymax-C)/r)<i&&(s=this.ymax,a=t+(i=o)*n)}if(n>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/n)<i&&(a=this.xmax,s=C+(i=o)*r)}else if(n<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/n)<i&&(a=this.xmin,s=C+(i=o)*r)}return[a,s]}_edgecode(t,C){return(t===this.xmin?1:t===this.xmax?2:0)|(C===this.ymin?4:C===this.ymax?8:0)}_regioncode(t,C){return(t<this.xmin?1:t>this.xmax?2:0)|(C<this.ymin?4:C>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let C=0;C<t.length;C+=2){const n=(C+2)%t.length,r=(C+4)%t.length;(t[C]===t[n]&&t[n]===t[r]||t[C+1]===t[n+1]&&t[n+1]===t[r+1])&&(t.splice(n,2),C-=2)}t.length||(t=null)}return t}}const Pt1=2*Math.PI,l9=Math.pow;function jt1(e){return e[0]}function It1(e){return e[1]}function At1(e){const{triangles:t,coords:C}=e;for(let n=0;n<t.length;n+=3){const r=2*t[n],i=2*t[n+1],o=2*t[n+2];if((C[o]-C[r])*(C[i+1]-C[r+1])-(C[i]-C[r])*(C[o+1]-C[r+1])>1e-10)return!1}return!0}function Nt1(e,t,C){return[e+Math.sin(e+t)*C,t+Math.cos(e-t)*C]}class yu{static from(t,C=jt1,n=It1,r){return new yu("length"in t?Dt1(t,C,n,r):Float64Array.from(Ft1(t,C,n,r)))}constructor(t){this._delaunator=new vC(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,C=this.points;if(t.hull&&t.hull.length>2&&At1(t)){this.collinear=Int32Array.from({length:C.length/2},(d,f)=>f).sort((d,f)=>C[2*d]-C[2*f]||C[2*d+1]-C[2*f+1]);const s=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[C[2*s],C[2*s+1],C[2*l],C[2*l+1]],u=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,f=C.length/2;d<f;++d){const v=Nt1(C[2*d],C[2*d+1],u);C[2*d]=v[0],C[2*d+1]=v[1]}this._delaunator=new vC(C)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let s=0,l=n.length;s<l;++s){const c=i[s%3===2?s-2:s+1];(n[s]===-1||o[c]===-1)&&(o[c]=s)}for(let s=0,l=r.length;s<l;++s)a[r[s]]=s;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Lt1(this,t)}*neighbors(t){const{inedges:C,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const u=a.indexOf(t);u>0&&(yield a[u-1]),u<a.length-1&&(yield a[u+1]);return}const s=C[t];if(s===-1)return;let l=s,c=-1;do{if(yield c=o[l],l=l%3===2?l-2:l+1,o[l]!==t)return;if(l=i[l],l===-1){const u=n[(r[t]+1)%n.length];u!==c&&(yield u);return}}while(l!==s)}find(t,C,n=0){if(t=+t,t!==t||(C=+C,C!==C))return-1;const r=n;let i;for(;(i=this._step(n,t,C))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,C,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,u=l9(C-l[t*2],2)+l9(n-l[t*2+1],2);const d=r[t];let f=d;do{let v=s[f];const g=l9(C-l[v*2],2)+l9(n-l[v*2+1],2);if(g<u&&(u=g,c=v),f=f%3===2?f-2:f+1,s[f]!==t)break;if(f=a[f],f===-1){if(f=i[(o[t]+1)%i.length],f!==v&&l9(C-l[f*2],2)+l9(n-l[f*2+1],2)<u)return f;break}}while(f!==d);return c}render(t){const C=t==null?t=new s8:void 0,{points:n,halfedges:r,triangles:i}=this;for(let o=0,a=r.length;o<a;++o){const s=r[o];if(s<o)continue;const l=i[o]*2,c=i[s]*2;t.moveTo(n[l],n[l+1]),t.lineTo(n[c],n[c+1])}return this.renderHull(t),C&&C.value()}renderPoints(t,C){C===void 0&&(!t||typeof t.moveTo!="function")&&(C=t,t=null),C=C==null?2:+C;const n=t==null?t=new s8:void 0,{points:r}=this;for(let i=0,o=r.length;i<o;i+=2){const a=r[i],s=r[i+1];t.moveTo(a+C,s),t.arc(a,s,C,0,Pt1)}return n&&n.value()}renderHull(t){const C=t==null?t=new s8:void 0,{hull:n,points:r}=this,i=n[0]*2,o=n.length;t.moveTo(r[i],r[i+1]);for(let a=1;a<o;++a){const s=2*n[a];t.lineTo(r[s],r[s+1])}return t.closePath(),C&&C.value()}hullPolygon(){const t=new Ha;return this.renderHull(t),t.value()}renderTriangle(t,C){const n=C==null?C=new s8:void 0,{points:r,triangles:i}=this,o=i[t*=3]*2,a=i[t+1]*2,s=i[t+2]*2;return C.moveTo(r[o],r[o+1]),C.lineTo(r[a],r[a+1]),C.lineTo(r[s],r[s+1]),C.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let C=0,n=t.length/3;C<n;++C)yield this.trianglePolygon(C)}trianglePolygon(t){const C=new Ha;return this.renderTriangle(t,C),C.value()}}function Dt1(e,t,C,n){const r=e.length,i=new Float64Array(r*2);for(let o=0;o<r;++o){const a=e[o];i[o*2]=t.call(n,a,o,e),i[o*2+1]=C.call(n,a,o,e)}return i}function*Ft1(e,t,C,n){let r=0;for(const i of e)yield t.call(n,i,r,e),yield C.call(n,i,r,e),++r}var xu=function(e){return[e.x,e.y]},Me=NS,I$="cursor",A$="top",zt1=function(e){var t=e.points,C=e.getNodePosition,n=C===void 0?xu:C,r=e.margin,i=r===void 0?Me:r;return t.map(function(o){var a=n(o),s=a[0],l=a[1];return[s+i.left,l+i.top]})},Bt1=function(e){var t=e.points,C=e.width,n=e.height,r=e.margin,i=r===void 0?Me:r,o=e.debug,a=yu.from(t),s=o?a.voronoi([0,0,i.left+C+i.right,i.top+n+i.bottom]):void 0;return{points:t,delaunay:a,voronoi:s}},wu=function(e){var t=e.points,C=e.getNodePosition,n=C===void 0?xu:C,r=e.width,i=e.height,o=e.margin,a=o===void 0?Me:o,s=e.debug;return $.useMemo(function(){return Bt1({points:zt1({points:t,margin:a,getNodePosition:n}),width:r,height:i,margin:a,debug:s})},[t,r,i,a,s])},Wt1=function(e){var t=e.elementRef,C=e.nodes,n=e.getNodePosition,r=n===void 0?xu:n,i=e.delaunay,o=e.setCurrent,a=e.margin,s=a===void 0?Me:a,l=e.detectionRadius,c=l===void 0?1/0:l,u=e.isInteractive,d=u===void 0||u,f=e.onMouseEnter,v=e.onMouseMove,g=e.onMouseLeave,h=e.onClick,m=e.onTouchStart,b=e.onTouchMove,x=e.onTouchEnd,S=e.enableTouchCrosshair,w=S!==void 0&&S,M=e.tooltip,_=e.tooltipPosition,E=_===void 0?I$:_,O=e.tooltipAnchor,T=O===void 0?A$:O,k=$.useState(null),A=k[0],V=k[1],R=$.useRef(null);$.useEffect(function(){R.current=A},[R,A]);var P=$.useCallback(function(J){if(!t.current)return null;var W=gu(t.current,J),U=W[0],Z=W[1],D=i.find(U,Z),n1=D!==void 0?C[D]:null;if(n1&&c!==1/0){var B=r(n1),r1=B[0],i1=B[1];r31(U,Z,r1+s.left,i1+s.top)>c&&(D=null,n1=null)}return D===null||n1===null?null:[D,n1]},[t,i,C,r,s,c]),L=a3(),H=L.showTooltipAt,I=L.showTooltipFromEvent,j=L.hideTooltip,N=$.useMemo(function(){if(M)return E==="cursor"?function(J,W){I(M(J),W,T)}:function(J){var W=r(J),U=W[0],Z=W[1];H(M(J),[U+s.left,Z+s.top],T)}},[H,I,M,E,T,r,s]),z=$.useCallback(function(J){var W=P(J);if(V(W),o==null||o(W?W[1]:null),W){var U=W[1];N==null||N(U,J),f==null||f(W[1],J)}},[P,V,o,N,f]),q=$.useCallback(function(J){var W=P(J);if(V(W),W){var U=W[0],Z=W[1];if(o==null||o(Z),N==null||N(Z,J),R.current){var D=R.current,n1=D[0],B=D[1];U!==n1?g==null||g(B,J):v==null||v(Z,J)}else f==null||f(Z,J)}else o==null||o(null),j==null||j(),R.current&&(g==null||g(R.current[1],J))},[P,V,R,f,v,g,N,j]),G=$.useCallback(function(J){V(null),o==null||o(null),j(),g&&R.current&&g(R.current[1],J)},[V,o,R,j,g]),Y=$.useCallback(function(J){var W=P(J);V(W),W&&(h==null||h(W[1],J))},[P,V,h]),e1=$.useCallback(function(J){var W=P(J);w&&(V(W),o==null||o(W?W[1]:null)),W&&(m==null||m(W[1],J))},[P,V,o,w,m]),Q=$.useCallback(function(J){var W=P(J);w&&(V(W),o==null||o(W?W[1]:null)),W&&(b==null||b(W[1],J))},[P,V,o,w,b]),K=$.useCallback(function(J){w&&(V(null),o==null||o(null)),x&&R.current&&x(R.current[1],J)},[w,V,o,x,R]);return{current:A,handleMouseEnter:d?z:void 0,handleMouseMove:d?q:void 0,handleMouseLeave:d?G:void 0,handleClick:d?Y:void 0,handleTouchStart:d?e1:void 0,handleTouchMove:d?Q:void 0,handleTouchEnd:d?K:void 0}},N$=function(e){var t=e.nodes,C=e.width,n=e.height,r=e.margin,i=r===void 0?Me:r,o=e.getNodePosition,a=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onClick,d=e.onTouchStart,f=e.onTouchMove,v=e.onTouchEnd,g=e.enableTouchCrosshair,h=g!==void 0&&g,m=e.detectionRadius,b=m===void 0?1/0:m,x=e.tooltip,S=e.tooltipPosition,w=S===void 0?I$:S,M=e.tooltipAnchor,_=M===void 0?A$:M,E=e.debug,O=$.useRef(null),T=wu({points:t,getNodePosition:o,width:C,height:n,margin:i,debug:E}),k=T.delaunay,A=T.voronoi,V=Wt1({elementRef:O,nodes:t,delaunay:k,margin:i,detectionRadius:b,setCurrent:a,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,onClick:u,onTouchStart:d,onTouchMove:f,onTouchEnd:v,enableTouchCrosshair:h,tooltip:x,tooltipPosition:w,tooltipAnchor:_}),R=V.current,P=V.handleMouseEnter,L=V.handleMouseMove,H=V.handleMouseLeave,I=V.handleClick,j=V.handleTouchStart,N=V.handleTouchMove,z=V.handleTouchEnd,q=$.useMemo(function(){if(E&&A)return A.render()},[E,A]);return p.jsxs("g",{ref:O,transform:"translate("+-i.left+","+-i.top+")",children:[E&&A&&p.jsxs(p.Fragment,{children:[p.jsx("path",{d:q,stroke:"red",strokeWidth:1,opacity:.75}),b<1/0&&p.jsx("path",{stroke:"red",strokeWidth:.35,fill:"none",d:k.renderPoints(void 0,b)}),R&&p.jsx("path",{fill:"pink",opacity:.35,d:A.renderCell(R[0])})]}),p.jsx("rect",{"data-ref":"mesh-interceptor",width:i.left+C+i.right,height:i.top+n+i.bottom,fill:"red",opacity:0,style:{cursor:"auto"},onMouseEnter:P,onMouseMove:L,onMouseLeave:H,onTouchStart:j,onTouchMove:N,onTouchEnd:z,onClick:I})]})},D$=function(e,t){e.save(),e.globalAlpha=.75,e.beginPath(),t.render(e),e.strokeStyle="red",e.lineWidth=1,e.stroke(),e.restore()},F$=function(e,t,C){e.save(),e.globalAlpha=.35,e.beginPath(),t.renderCell(C,e),e.fillStyle="pink",e.fill(),e.restore()};function O4(){return O4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},O4.apply(this,arguments)}function z$(e,t){if(e==null)return{};var C,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)C=i[n],t.indexOf(C)>=0||(r[C]=e[C]);return r}var Ut1=function(e){if(typeof e=="function")return e;if(M8(e))return function(){return e};if(function(C){return z7(C)}(e)){if(!mn(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=P8().domain([e.values[0],e.values[1]]).range([e.sizes[0],e.sizes[1]]);return function(C){return t(v2(C,e.key))}}throw new Error("nodeSize is invalid, it should be either a function, a number or an object")},B$=function(e){var t,C=e.data,n=e.xScaleSpec,r=e.xFormat,i=e.yScaleSpec,o=e.yFormat,a=e.width,s=e.height,l=e.nodeId,c=e.nodeSize,u=e.colors,d=$.useMemo(function(){return M$(C,n,i,a,s)},[C,n,i,a,s]),f=d.series,v=d.xScale,g=d.yScale,h=k7(r),m=k7(o),b=m3(l),x=$.useMemo(function(){return function(M){var _=M.series,E=M.formatX,O=M.formatY,T=M.getNodeId,k=[];return _.forEach(function(A){A.data.forEach(function(V,R){var P={index:k.length,serieIndex:R,serieId:A.id,x:V.position.x,xValue:V.data.x,formattedX:E(V.data.x),y:V.position.y,yValue:V.data.y,formattedY:O(V.data.y),data:V.data};k.push(O4({},P,{id:T(P)}))})}),k}({series:f,formatX:h,formatY:m,getNodeId:b})},[f,h,m,b]),S=$.useMemo(function(){return Ut1(t)},[t=c]),w=xe(u,"serieId");return{xScale:v,yScale:g,nodes:$.useMemo(function(){return x.map(function(M){return O4({},M,{size:S(M),color:w({serieId:M.serieId})})})},[x,S,w]),legendData:$.useMemo(function(){return f.map(function(M){return{id:M.id,label:M.id,color:w({serieId:M.id})}})},[f,w])}},W$=function(e,t){return ht1({data:e,annotations:t,getPosition:function(C){return{x:C.x,y:C.y}},getDimensions:function(C){return{size:C.size,width:C.size,height:C.size}}})},Zt1=function(e){return e/2},U$={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,C=e.style,n=e.blendMode,r=e.isInteractive,i=e.onMouseEnter,o=e.onMouseMove,a=e.onMouseLeave,s=e.onClick,l=$.useCallback(function(f){return i==null?void 0:i(t,f)},[t,i]),c=$.useCallback(function(f){return o==null?void 0:o(t,f)},[t,o]),u=$.useCallback(function(f){return a==null?void 0:a(t,f)},[t,a]),d=$.useCallback(function(f){return s==null?void 0:s(t,f)},[t,s]);return p.jsx(e5.circle,{cx:C.x,cy:C.y,r:C.size.to(Zt1),fill:C.color,style:{mixBlendMode:n},onMouseEnter:r?l:void 0,onMouseMove:r?c:void 0,onMouseLeave:r?u:void 0,onClick:r?d:void 0})},colors:{scheme:"nivo"},isInteractive:!0,debugMesh:!1,tooltip:function(e){var t=e.node;return p.jsx(P9,{id:t.serieId,value:"x: "+t.formattedX+", y: "+t.formattedY,enableChip:!0,color:t.color})},markers:[],legends:[],annotations:[]},h2=O4({},U$,{blendMode:"normal",layers:["grid","axes","nodes","markers","mesh","legends","annotations"],role:"img",useMesh:!0,animate:!0,motionConfig:"default"}),t4=O4({},U$,{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()}}),qt1=function(e){var t=e.nodes,C=e.annotations,n=W$(t,C);return p.jsx(p.Fragment,{children:n.map(function(r,i){return p.jsx(yt1,O4({},r),i)})})},Gt1=function(e){return e.id},Si=function(e){return{x:e.x,y:e.y,size:e.size,color:e.color}},Yt1=function(e){return{x:e.x,y:e.y,size:0,color:e.color}},Kt1=function(e){var t=e.nodes,C=e.nodeComponent,n=e.isInteractive,r=e.onMouseEnter,i=e.onMouseMove,o=e.onMouseLeave,a=e.onClick,s=e.tooltip,l=e.blendMode,c=A2(),u=c.animate,d=c.config,f=p4(t,{keys:Gt1,from:Si,enter:Si,update:Si,leave:Yt1,config:d,immediate:!u}),v=a3(),g=v.showTooltipFromEvent,h=v.hideTooltip,m=$.useCallback(function(w,M){g($.createElement(s,{node:w}),M),r==null||r(w,M)},[s,g,r]),b=$.useCallback(function(w,M){g($.createElement(s,{node:w}),M),i==null||i(w,M)},[s,g,i]),x=$.useCallback(function(w,M){h(),o==null||o(w,M)},[h,o]),S=$.useCallback(function(w,M){return a==null?void 0:a(w,M)},[a]);return p.jsx(p.Fragment,{children:f(function(w,M){return $.createElement(C,{node:M,style:w,blendMode:l,isInteractive:n,onMouseEnter:n?m:void 0,onMouseMove:n?b:void 0,onMouseLeave:n?x:void 0,onClick:n?S:void 0})})})},Xt1=function(e){var t=e.nodes,C=e.width,n=e.height,r=e.onMouseEnter,i=e.onMouseMove,o=e.onMouseLeave,a=e.onClick,s=e.tooltip,l=e.debug,c=a3(),u=c.showTooltipFromEvent,d=c.hideTooltip,f=$.useCallback(function(m,b){u($.createElement(s,{node:m}),b),r&&r(m,b)},[u,s,r]),v=$.useCallback(function(m,b){u($.createElement(s,{node:m}),b),i&&i(m,b)},[u,s,i]),g=$.useCallback(function(m,b){d(),o&&o(m,b)},[d,o]),h=$.useCallback(function(m,b){a&&a(m,b)},[a]);return p.jsx(N$,{nodes:t,width:C,height:n,onMouseEnter:f,onMouseMove:v,onMouseLeave:g,onClick:h,debug:l})},Qt1=["isInteractive","animate","motionConfig","theme","renderWrapper"],Jt1=function(e){var t=e.data,C=e.xScale,n=C===void 0?h2.xScale:C,r=e.xFormat,i=e.yScale,o=i===void 0?h2.yScale:i,a=e.yFormat,s=e.width,l=e.height,c=e.margin,u=e.layers,d=u===void 0?h2.layers:u,f=e.colors,v=f===void 0?h2.colors:f,g=e.blendMode,h=g===void 0?h2.blendMode:g,m=e.nodeId,b=m===void 0?h2.nodeId:m,x=e.nodeSize,S=x===void 0?h2.nodeSize:x,w=e.nodeComponent,M=w===void 0?h2.nodeComponent:w,_=e.enableGridX,E=_===void 0?h2.enableGridX:_,O=e.enableGridY,T=O===void 0?h2.enableGridY:O,k=e.gridXValues,A=e.gridYValues,V=e.axisTop,R=e.axisRight,P=e.axisBottom,L=P===void 0?h2.axisBottom:P,H=e.axisLeft,I=H===void 0?h2.axisLeft:H,j=e.annotations,N=j===void 0?h2.annotations:j,z=e.isInteractive,q=z===void 0?h2.isInteractive:z,G=e.useMesh,Y=G===void 0?h2.useMesh:G,e1=e.debugMesh,Q=e1===void 0?h2.debugMesh:e1,K=e.onMouseEnter,J=e.onMouseMove,W=e.onMouseLeave,U=e.onClick,Z=e.tooltip,D=Z===void 0?h2.tooltip:Z,n1=e.markers,B=n1===void 0?h2.markers:n1,r1=e.legends,i1=r1===void 0?h2.legends:r1,g1=e.role,y1=g1===void 0?h2.role:g1,m1=e.ariaLabel,b1=e.ariaLabelledBy,S1=e.ariaDescribedBy,v1=z8(s,l,c),h1=v1.margin,l1=v1.innerWidth,$1=v1.innerHeight,f1=v1.outerWidth,A1=v1.outerHeight,I1=B$({data:t,xScaleSpec:n,xFormat:r,yScaleSpec:o,yFormat:a,width:l1,height:$1,nodeId:b,nodeSize:S,colors:v}),R1=I1.xScale,k1=I1.yScale,Y1=I1.nodes,X1=I1.legendData,D1=$.useMemo(function(){return{xScale:R1,yScale:k1,nodes:Y1,margin:h1,innerWidth:l1,innerHeight:$1,outerWidth:f1,outerHeight:A1}},[R1,k1,Y1,h1,l1,$1,f1,A1]),L1={grid:null,axes:null,nodes:null,markers:null,mesh:null,annotations:null,legends:null};return d.includes("grid")&&(L1.grid=p.jsx(L$,{width:l1,height:$1,xScale:E?R1:null,yScale:T?k1:null,xValues:k,yValues:A},"grid")),d.includes("axes")&&(L1.axes=p.jsx(k$,{xScale:R1,yScale:k1,width:l1,height:$1,top:V,right:R,bottom:L,left:I},"axes")),d.includes("nodes")&&(L1.nodes=p.jsx(Kt1,{nodes:Y1,nodeComponent:M,isInteractive:q,tooltip:D,blendMode:h,onMouseEnter:K,onMouseMove:J,onMouseLeave:W,onClick:U},"nodes")),d.includes("markers")&&(L1.markers=p.jsx(QS,{markers:B,width:l1,height:$1,xScale:R1,yScale:k1},"markers")),d.includes("mesh")&&q&&Y&&(L1.mesh=p.jsx(Xt1,{nodes:Y1,width:l1,height:$1,onMouseEnter:K,onMouseMove:J,onMouseLeave:W,onClick:U,tooltip:D,debug:Q},"mesh")),d.includes("annotations")&&(L1.annotations=p.jsx(qt1,{nodes:Y1,annotations:N},"annotations")),d.includes("legends")&&(L1.legends=i1.map(function(Q1,U1){return p.jsx(Rn,O4({},Q1,{containerWidth:l1,containerHeight:$1,data:X1}),U1)})),p.jsx(x6,{width:f1,height:A1,margin:h1,role:y1,ariaLabel:m1,ariaLabelledBy:b1,ariaDescribedBy:S1,children:d.map(function(Q1,U1){if(typeof Q1=="string"&&L1[Q1]!==void 0)return L1[Q1];if(typeof Q1=="function")return p.jsx($.Fragment,{children:$.createElement(Q1,D1)},U1);throw new Error("Unknown layer ("+Q1+")")})})},eC1=function(e){var t=e.isInteractive,C=t===void 0?h2.isInteractive:t,n=e.animate,r=n===void 0?h2.animate:n,i=e.motionConfig,o=i===void 0?h2.motionConfig:i,a=e.theme,s=e.renderWrapper,l=z$(e,Qt1);return p.jsx(B8,{animate:r,isInteractive:C,motionConfig:o,renderWrapper:s,theme:a,children:p.jsx(Jt1,O4({isInteractive:C},l))})},Z$=function(e){return p.jsx(W7,{children:function(t){var C=t.width,n=t.height;return p.jsx(eC1,O4({width:C,height:n},e))}})},tC1=["isInteractive","renderWrapper","theme"],CC1=function(e){var t=e.data,C=e.xScale,n=C===void 0?t4.xScale:C,r=e.xFormat,i=e.yScale,o=i===void 0?t4.yScale:i,a=e.yFormat,s=e.width,l=e.height,c=e.margin,u=e.pixelRatio,d=u===void 0?t4.pixelRatio:u,f=e.layers,v=f===void 0?t4.layers:f,g=e.colors,h=g===void 0?t4.colors:g,m=e.nodeId,b=m===void 0?h2.nodeId:m,x=e.nodeSize,S=x===void 0?t4.nodeSize:x,w=e.renderNode,M=w===void 0?t4.renderNode:w,_=e.enableGridX,E=_===void 0?t4.enableGridX:_,O=e.gridXValues,T=e.enableGridY,k=T===void 0?t4.enableGridY:T,A=e.gridYValues,V=e.axisTop,R=e.axisRight,P=e.axisBottom,L=P===void 0?t4.axisBottom:P,H=e.axisLeft,I=H===void 0?t4.axisLeft:H,j=e.annotations,N=j===void 0?t4.annotations:j,z=e.isInteractive,q=z===void 0?t4.isInteractive:z,G=e.debugMesh,Y=G===void 0?t4.debugMesh:G,e1=e.onMouseEnter,Q=e.onMouseMove,K=e.onMouseLeave,J=e.onClick,W=e.tooltip,U=W===void 0?t4.tooltip:W,Z=e.legends,D=Z===void 0?t4.legends:Z,n1=e.canvasRef,B=$.useRef(null),r1=W5(),i1=$.useState(null),g1=i1[0],y1=i1[1],m1=z8(s,l,c),b1=m1.margin,S1=m1.innerWidth,v1=m1.innerHeight,h1=m1.outerWidth,l1=m1.outerHeight,$1=B$({data:t,xScaleSpec:n,xFormat:r,yScaleSpec:o,yFormat:a,width:S1,height:v1,nodeId:b,nodeSize:S,colors:h}),f1=$1.xScale,A1=$1.yScale,I1=$1.nodes,R1=$1.legendData,k1=W$(I1,N),Y1=wu({points:I1,width:S1,height:v1,debug:Y}),X1=Y1.delaunay,D1=Y1.voronoi,L1=$.useMemo(function(){return{xScale:f1,yScale:A1,nodes:I1,margin:b1,innerWidth:S1,innerHeight:v1,outerWidth:h1,outerHeight:l1}},[f1,A1,I1,b1,S1,v1,h1,l1]);$.useEffect(function(){if(B.current){B.current.width=h1*d,B.current.height=l1*d;var N1=B.current.getContext("2d");N1.scale(d,d),N1.fillStyle=r1.background,N1.fillRect(0,0,h1,l1),N1.translate(b1.left,b1.top),v.forEach(function(z1){if(z1==="grid")N1.lineWidth=r1.grid.line.strokeWidth,N1.strokeStyle=r1.grid.line.stroke,E&&gC(N1,{width:S1,height:v1,scale:f1,axis:"x",values:O}),k&&gC(N1,{width:S1,height:v1,scale:A1,axis:"y",values:A});else if(z1==="annotations")xt1(N1,{annotations:k1,theme:r1});else if(z1==="axes")P$(N1,{xScale:f1,yScale:A1,width:S1,height:v1,top:V,right:R,bottom:L,left:I,theme:r1});else if(z1==="nodes")I1.forEach(function(F1){M(N1,F1)});else if(z1==="mesh")Y&&(D$(N1,D1),g1&&F$(N1,D1,g1.index));else if(z1==="legends")D.forEach(function(F1){o$(N1,O4({},F1,{data:R1,containerWidth:S1,containerHeight:v1,theme:r1}))});else{if(typeof z1!="function")throw new Error("Invalid layer: "+z1);z1(N1,L1)}})}},[B,S1,v1,h1,l1,b1.top,b1.left,d,M,v,L1,r1,f1,A1,I1,E,k,V,R,L,I,D,R1,Y,D1,g1,k1]);var Q1=a3(),U1=Q1.showTooltipFromEvent,q1=Q1.hideTooltip,u1=$.useCallback(function(N1){var z1=gu(B.current,N1),F1=z1[0],J1=z1[1];if(!e$(b1.left,b1.top,S1,v1,F1,J1))return null;var t5=X1.find(F1-b1.left,J1-b1.top);return I1[t5]},[B,b1,S1,v1,X1]),_1=$.useCallback(function(N1){var z1=u1(N1);y1(z1),z1?(U1($.createElement(U,{node:z1}),N1),g1&&g1.id!==z1.id&&(K&&K(g1,N1),e1&&e1(z1,N1)),g1||e1&&e1(z1,N1),Q&&Q(z1,N1)):(q1(),g1&&K&&K(g1,N1))},[u1,g1,y1,U1,q1,U,e1,Q,K]),K1=$.useCallback(function(N1){q1(),y1(null),g1&&K&&K(g1,N1)},[q1,g1,y1,K]),C5=$.useCallback(function(N1){if(J){var z1=u1(N1);z1&&J(z1,N1)}},[u1,J]);return p.jsx("canvas",{ref:function(N1){B.current=N1,n1&&"current"in n1&&(n1.current=N1)},width:h1*d,height:l1*d,style:{width:h1,height:l1,cursor:q?"auto":"normal"},onMouseEnter:q?_1:void 0,onMouseMove:q?_1:void 0,onMouseLeave:q?K1:void 0,onClick:q?C5:void 0})},nC1=$.forwardRef(function(e,t){var C=e.isInteractive,n=e.renderWrapper,r=e.theme,i=z$(e,tC1);return p.jsx(B8,{isInteractive:C,renderWrapper:n,theme:r,animate:!1,children:p.jsx(CC1,O4({},i,{canvasRef:t}))})});$.forwardRef(function(e,t){return p.jsx(W7,{children:function(C){var n=C.width,r=C.height;return p.jsx(nC1,O4({width:n,height:r},e,{ref:t}))}})});const rC1=({x1:e,x2:t,y1:C,y2:n})=>p.jsx("g",{children:p.jsx("line",{x1:e,y1:C,x2:t,y2:n,stroke:"red",strokeWidth:"3"})}),iC1=({scatterPlotData:e,style:t={},margin:C={},axisBottom:n={},axisLeft:r={},tooltip:i=null})=>{const o=e==null?void 0:e.line,a=o==null?void 0:o.x1,s=o==null?void 0:o.y1,l=o==null?void 0:o.x2,c=o==null?void 0:o.y2;return p.jsxs(p.Fragment,{children:[p.jsx(S2,{}),p.jsx("div",{style:{width:"100%",height:600,...t},children:p.jsx(Z$,{data:[e==null?void 0:e.points],margin:{top:20,right:120,bottom:100,left:120,...C},xScale:{type:"point"},axisBottom:{orient:"bottom",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:46,truncateTickAt:0,legend:"axisBottom",...n},axisLeft:{orient:"left",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:-60,truncateTickAt:0,legend:"axisLeft",...r},layers:["grid","markers","axes","nodes","legends",u=>p.jsx(rC1,{x1:u.xScale(a),y1:u.yScale(s),x2:u.xScale(l),y2:u.yScale(c)})],tooltip:({node:u})=>p.jsx(f4,{body:(i==null?void 0:i({node:u}))||p.jsx("span",{children:"Scatterplot tooltip"})})})})]})};function oC1(e,t,C,n){var r=-1,i=e==null?0:e.length;for(n&&i&&(C=e[++r]);++r<i;)C=t(C,e[r],r,e);return C}var aC1=oC1;function sC1(e){return function(t){return e==null?void 0:e[t]}}var lC1=sC1,cC1=lC1,uC1={À:"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"},dC1=cC1(uC1),fC1=dC1,hC1=fC1,gC1=he,vC1=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mC1="\\u0300-\\u036f",pC1="\\ufe20-\\ufe2f",bC1="\\u20d0-\\u20ff",yC1=mC1+pC1+bC1,xC1="["+yC1+"]",wC1=RegExp(xC1,"g");function SC1(e){return e=gC1(e),e&&e.replace(vC1,hC1).replace(wC1,"")}var $C1=SC1,MC1=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function EC1(e){return e.match(MC1)||[]}var _C1=EC1,OC1=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function VC1(e){return OC1.test(e)}var TC1=VC1,q$="\\ud800-\\udfff",RC1="\\u0300-\\u036f",HC1="\\ufe20-\\ufe2f",kC1="\\u20d0-\\u20ff",LC1=RC1+HC1+kC1,G$="\\u2700-\\u27bf",Y$="a-z\\xdf-\\xf6\\xf8-\\xff",PC1="\\xac\\xb1\\xd7\\xf7",jC1="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",IC1="\\u2000-\\u206f",AC1=" \\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",K$="A-Z\\xc0-\\xd6\\xd8-\\xde",NC1="\\ufe0e\\ufe0f",X$=PC1+jC1+IC1+AC1,Q$="['’]",im="["+X$+"]",DC1="["+LC1+"]",J$="\\d+",FC1="["+G$+"]",eM="["+Y$+"]",tM="[^"+q$+X$+J$+G$+Y$+K$+"]",zC1="\\ud83c[\\udffb-\\udfff]",BC1="(?:"+DC1+"|"+zC1+")",WC1="[^"+q$+"]",CM="(?:\\ud83c[\\udde6-\\uddff]){2}",nM="[\\ud800-\\udbff][\\udc00-\\udfff]",f9="["+K$+"]",UC1="\\u200d",om="(?:"+eM+"|"+tM+")",ZC1="(?:"+f9+"|"+tM+")",am="(?:"+Q$+"(?:d|ll|m|re|s|t|ve))?",sm="(?:"+Q$+"(?:D|LL|M|RE|S|T|VE))?",rM=BC1+"?",iM="["+NC1+"]?",qC1="(?:"+UC1+"(?:"+[WC1,CM,nM].join("|")+")"+iM+rM+")*",GC1="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",YC1="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",KC1=iM+rM+qC1,XC1="(?:"+[FC1,CM,nM].join("|")+")"+KC1,QC1=RegExp([f9+"?"+eM+"+"+am+"(?="+[im,f9,"$"].join("|")+")",ZC1+"+"+sm+"(?="+[im,f9+om,"$"].join("|")+")",f9+"?"+om+"+"+am,f9+"+"+sm,YC1,GC1,J$,XC1].join("|"),"g");function JC1(e){return e.match(QC1)||[]}var en1=JC1,tn1=_C1,Cn1=TC1,nn1=he,rn1=en1;function in1(e,t,C){return e=nn1(e),t=C?void 0:t,t===void 0?Cn1(e)?rn1(e):tn1(e):e.match(t)||[]}var on1=in1,an1=aC1,sn1=$C1,ln1=on1,cn1="['’]",un1=RegExp(cn1,"g");function dn1(e){return function(t){return an1(ln1(sn1(t).replace(un1,"")),e,"")}}var fn1=dn1,hn1=j$;function gn1(e,t,C){var n=e.length;return C=C===void 0?n:C,!t&&C>=n?e:hn1(e,t,C)}var vn1=gn1,mn1="\\ud800-\\udfff",pn1="\\u0300-\\u036f",bn1="\\ufe20-\\ufe2f",yn1="\\u20d0-\\u20ff",xn1=pn1+bn1+yn1,wn1="\\ufe0e\\ufe0f",Sn1="\\u200d",$n1=RegExp("["+Sn1+mn1+xn1+wn1+"]");function Mn1(e){return $n1.test(e)}var oM=Mn1;function En1(e){return e.split("")}var _n1=En1,aM="\\ud800-\\udfff",On1="\\u0300-\\u036f",Vn1="\\ufe20-\\ufe2f",Tn1="\\u20d0-\\u20ff",Rn1=On1+Vn1+Tn1,Hn1="\\ufe0e\\ufe0f",kn1="["+aM+"]",ka="["+Rn1+"]",La="\\ud83c[\\udffb-\\udfff]",Ln1="(?:"+ka+"|"+La+")",sM="[^"+aM+"]",lM="(?:\\ud83c[\\udde6-\\uddff]){2}",cM="[\\ud800-\\udbff][\\udc00-\\udfff]",Pn1="\\u200d",uM=Ln1+"?",dM="["+Hn1+"]?",jn1="(?:"+Pn1+"(?:"+[sM,lM,cM].join("|")+")"+dM+uM+")*",In1=dM+uM+jn1,An1="(?:"+[sM+ka+"?",ka,lM,cM,kn1].join("|")+")",Nn1=RegExp(La+"(?="+La+")|"+An1+In1,"g");function Dn1(e){return e.match(Nn1)||[]}var Fn1=Dn1,zn1=_n1,Bn1=oM,Wn1=Fn1;function Un1(e){return Bn1(e)?Wn1(e):zn1(e)}var Zn1=Un1,qn1=vn1,Gn1=oM,Yn1=Zn1,Kn1=he;function Xn1(e){return function(t){t=Kn1(t);var C=Gn1(t)?Yn1(t):void 0,n=C?C[0]:t.charAt(0),r=C?qn1(C,1).join(""):t.slice(1);return n[e]()+r}}var Qn1=Xn1,Jn1=Qn1,er1=Jn1("toUpperCase"),tr1=er1,Cr1=fn1,nr1=tr1,rr1=Cr1(function(e,t,C){return e+(C?" ":"")+nr1(t)}),ir1=rr1;const or1=p2(ir1);function ar1(e){var t=0,C=e.children,n=C&&C.length;if(!n)t=1;else for(;--n>=0;)t+=C[n].value;e.value=t}function sr1(){return this.eachAfter(ar1)}function lr1(e){var t=this,C,n=[t],r,i,o;do for(C=n.reverse(),n=[];t=C.pop();)if(e(t),r=t.children,r)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length);return this}function cr1(e){for(var t=this,C=[t],n,r;t=C.pop();)if(e(t),n=t.children,n)for(r=n.length-1;r>=0;--r)C.push(n[r]);return this}function ur1(e){for(var t=this,C=[t],n=[],r,i,o;t=C.pop();)if(n.push(t),r=t.children,r)for(i=0,o=r.length;i<o;++i)C.push(r[i]);for(;t=n.pop();)e(t);return this}function dr1(e){return this.eachAfter(function(t){for(var C=+e(t.data)||0,n=t.children,r=n&&n.length;--r>=0;)C+=n[r].value;t.value=C})}function fr1(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function hr1(e){for(var t=this,C=gr1(t,e),n=[t];t!==C;)t=t.parent,n.push(t);for(var r=n.length;e!==C;)n.splice(r,0,e),e=e.parent;return n}function gr1(e,t){if(e===t)return e;var C=e.ancestors(),n=t.ancestors(),r=null;for(e=C.pop(),t=n.pop();e===t;)r=e,e=C.pop(),t=n.pop();return r}function vr1(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function mr1(){var e=[];return this.each(function(t){e.push(t)}),e}function pr1(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function br1(){var e=this,t=[];return e.each(function(C){C!==e&&t.push({source:C.parent,target:C})}),t}function Su(e,t){var C=new mC(e),n=+e.value&&(C.value=e.value),r,i=[C],o,a,s,l;for(t==null&&(t=xr1);r=i.pop();)if(n&&(r.value=+r.data.value),(a=t(r.data))&&(l=a.length))for(r.children=new Array(l),s=l-1;s>=0;--s)i.push(o=r.children[s]=new mC(a[s])),o.parent=r,o.depth=r.depth+1;return C.eachBefore(Sr1)}function yr1(){return Su(this).eachBefore(wr1)}function xr1(e){return e.children}function wr1(e){e.data=e.data.data}function Sr1(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function mC(e){this.data=e,this.depth=this.height=0,this.parent=null}mC.prototype=Su.prototype={constructor:mC,count:sr1,each:lr1,eachAfter:ur1,eachBefore:cr1,sum:dr1,sort:fr1,path:hr1,ancestors:vr1,descendants:mr1,leaves:pr1,links:br1,copy:yr1};function $r1(e){if(typeof e!="function")throw new Error;return e}function Z6(){return 0}function q6(e){return function(){return e}}function Mr1(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 $u(e,t,C,n,r){for(var i=e.children,o,a=-1,s=i.length,l=e.value&&(n-t)/e.value;++a<s;)o=i[a],o.y0=C,o.y1=r,o.x0=t,o.x1=t+=o.value*l}function Mu(e,t,C,n,r){for(var i=e.children,o,a=-1,s=i.length,l=e.value&&(r-C)/e.value;++a<s;)o=i[a],o.x0=t,o.x1=n,o.y0=C,o.y1=C+=o.value*l}var Er1=(1+Math.sqrt(5))/2;function _r1(e,t,C,n,r,i){for(var o=[],a=t.children,s,l,c=0,u=0,d=a.length,f,v,g=t.value,h,m,b,x,S,w,M;c<d;){f=r-C,v=i-n;do h=a[u++].value;while(!h&&u<d);for(m=b=h,w=Math.max(v/f,f/v)/(g*e),M=h*h*w,S=Math.max(b/M,M/m);u<d;++u){if(h+=l=a[u].value,l<m&&(m=l),l>b&&(b=l),M=h*h*w,x=Math.max(b/M,M/m),x>S){h-=l;break}S=x}o.push(s={value:h,dice:f<v,children:a.slice(c,u)}),s.dice?$u(s,C,n,r,g?n+=v*h/g:i):Mu(s,C,n,g?C+=f*h/g:r,i),g-=h,c=u}return o}const fM=function e(t){function C(n,r,i,o,a){_r1(t,n,r,i,o,a)}return C.ratio=function(n){return e((n=+n)>1?n:1)},C}(Er1);function Or1(){var e=fM,t=!1,C=1,n=1,r=[0],i=Z6,o=Z6,a=Z6,s=Z6,l=Z6;function c(d){return d.x0=d.y0=0,d.x1=C,d.y1=n,d.eachBefore(u),r=[0],t&&d.eachBefore(Mr1),d}function u(d){var f=r[d.depth],v=d.x0+f,g=d.y0+f,h=d.x1-f,m=d.y1-f;h<v&&(v=h=(v+h)/2),m<g&&(g=m=(g+m)/2),d.x0=v,d.y0=g,d.x1=h,d.y1=m,d.children&&(f=r[d.depth+1]=i(d)/2,v+=l(d)-f,g+=o(d)-f,h-=a(d)-f,m-=s(d)-f,h<v&&(v=h=(v+h)/2),m<g&&(g=m=(g+m)/2),e(d,v,g,h,m))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(C=+d[0],n=+d[1],c):[C,n]},c.tile=function(d){return arguments.length?(e=$r1(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(i=typeof d=="function"?d:q6(+d),c):i},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(o=typeof d=="function"?d:q6(+d),c):o},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:q6(+d),c):a},c.paddingBottom=function(d){return arguments.length?(s=typeof d=="function"?d:q6(+d),c):s},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:q6(+d),c):l},c}function Vr1(e,t,C,n,r){var i=e.children,o,a=i.length,s,l=new Array(a+1);for(l[0]=s=o=0;o<a;++o)l[o+1]=s+=i[o].value;c(0,a,e.value,t,C,n,r);function c(u,d,f,v,g,h,m){if(u>=d-1){var b=i[u];b.x0=v,b.y0=g,b.x1=h,b.y1=m;return}for(var x=l[u],S=f/2+x,w=u+1,M=d-1;w<M;){var _=w+M>>>1;l[_]<S?w=_+1:M=_}S-l[w-1]<l[w]-S&&u+1<w&&--w;var E=l[w]-x,O=f-E;if(h-v>m-g){var T=(v*O+h*E)/f;c(u,w,E,v,g,T,m),c(w,d,O,T,g,h,m)}else{var k=(g*O+m*E)/f;c(u,w,E,v,g,h,k),c(w,d,O,v,k,h,m)}}}function Tr1(e,t,C,n,r){(e.depth&1?Mu:$u)(e,t,C,n,r)}function V4(){return V4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},V4.apply(this,arguments)}function Rr1(e,t){if(e==null)return{};var C,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)C=i[n],t.indexOf(C)>=0||(r[C]=e[C]);return r}var Hr1=function(e,t){return O2([e,t],function(C,n){return"translate("+C+","+n+")"})},kr1=function(e,t){return O2([e,t],function(C,n){return"translate("+C+"px, "+n+"px)"})},lm=function(e,t,C){return O2([e,t,C],function(n,r,i){return"translate("+n+","+r+") rotate("+i+")"})},Lr1=function(e,t,C){return O2([e,t,C],function(n,r,i){return"translate("+n+"px,"+r+"px) rotate("+i+"deg)"})},Pr1=function(e,t,C){return O2([e,t,C],function(n,r,i){return"translate("+(n-(i===0?0:5))+"px,"+(r-(i===0?5:0))+"px) rotate("+i+"deg)"})},jr1=$.memo(function(e){var t=e.node,C=e.animatedProps,n=e.borderWidth,r=e.enableLabel,i=e.enableParentLabel,o=e.labelSkipSize,a=W5(),s=r&&t.isLeaf&&(o===0||Math.min(t.width,t.height)>o),l=i&&t.isParent;return p.jsxs(e5.g,{transform:Hr1(C.x,C.y),children:[p.jsx(e5.rect,{"data-testid":"node."+t.id,width:O2(C.width,function(c){return Math.max(c,0)}),height:O2(C.height,function(c){return Math.max(c,0)}),fill:t.fill?t.fill:C.color,strokeWidth:n,stroke:t.borderColor,fillOpacity:t.opacity,onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),s&&p.jsx(e5.text,{"data-testid":"label."+t.id,textAnchor:"middle",dominantBaseline:"central",style:V4({},a.labels.text,{fill:t.labelTextColor,pointerEvents:"none"}),fillOpacity:C.labelOpacity,transform:lm(C.labelX,C.labelY,C.labelRotation),children:t.label}),l&&p.jsx(e5.text,{"data-testid":"parentLabel."+t.id,dominantBaseline:"central",style:V4({},a.labels.text,{fill:t.parentLabelTextColor,pointerEvents:"none"}),fillOpacity:C.parentLabelOpacity,transform:lm(C.parentLabelX,C.parentLabelY,C.parentLabelRotation),children:t.parentLabel})]})}),Ir1=$.memo(function(e){var t=e.node;return p.jsx(P9,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})}),Ar1=$.memo(function(e){var t=e.node,C=e.animatedProps,n=e.borderWidth,r=e.enableLabel,i=e.enableParentLabel,o=e.labelSkipSize,a=W5(),s=r&&t.isLeaf&&(o===0||Math.min(t.width,t.height)>o),l=i&&t.isParent;return p.jsxs(e5.div,{"data-testid":"node."+t.id,id:t.path.replace(/[^\w]/gi,"-"),style:{boxSizing:"border-box",position:"absolute",top:0,left:0,transform:kr1(C.x,C.y),width:C.width,height:C.height,borderWidth:n,borderStyle:"solid",borderColor:t.borderColor,overflow:"hidden"},children:[p.jsx(e5.div,{style:{boxSizing:"border-box",position:"absolute",top:0,left:0,opacity:t.opacity,width:C.width,height:C.height,background:C.color},onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),s&&p.jsx(e5.span,{"data-testid":"label."+t.id,style:V4({},a.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:Lr1(C.labelX,C.labelY,C.labelRotation),opacity:C.labelOpacity,pointerEvents:"none"}),children:t.label}),l&&p.jsx(e5.span,{"data-testid":"parentLabel."+t.id,style:V4({},a.labels.text,{position:"absolute",display:"flex",justifyContent:"flex-start",alignItems:"center",whiteSpace:"nowrap",width:10,height:10,color:t.parentLabelTextColor,transformOrigin:"top left",transform:Pr1(C.parentLabelX,C.parentLabelY,C.parentLabelRotation),opacity:C.parentLabelOpacity,pointerEvents:"none"}),children:t.parentLabel})]})}),x2={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:Ir1,role:"img",animate:!0,motionConfig:"gentle"},U5=V4({},x2,{nodeComponent:jr1,defs:[],fill:[]});V4({},x2,{nodeComponent:Ar1});V4({},x2,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var Nr1={binary:Vr1,dice:$u,slice:Mu,sliceDice:Tr1,squarify:fM},Dr1=function(e){var t=e.root,C=e.getValue;return $.useMemo(function(){return Su(t).sum(C)},[t,C])},Fr1=function(e){var t=e.data,C=e.width,n=e.height,r=e.identity,i=r===void 0?x2.identity:r,o=e.value,a=o===void 0?x2.value:o,s=e.valueFormat,l=e.leavesOnly,c=l===void 0?x2.leavesOnly:l,u=e.tile,d=u===void 0?x2.tile:u,f=e.innerPadding,v=f===void 0?x2.innerPadding:f,g=e.outerPadding,h=g===void 0?x2.outerPadding:g,m=e.label,b=m===void 0?x2.label:m,x=e.orientLabel,S=x===void 0?x2.orientLabel:x,w=e.enableParentLabel,M=w===void 0?x2.enableParentLabel:w,_=e.parentLabel,E=_===void 0?x2.parentLabel:_,O=e.parentLabelSize,T=O===void 0?x2.parentLabelSize:O,k=e.parentLabelPosition,A=k===void 0?x2.parentLabelPosition:k,V=e.parentLabelPadding,R=V===void 0?x2.parentLabelPadding:V,P=e.colors,L=P===void 0?x2.colors:P,H=e.colorBy,I=H===void 0?x2.colorBy:H,j=e.nodeOpacity,N=j===void 0?x2.nodeOpacity:j,z=e.borderColor,q=z===void 0?x2.borderColor:z,G=e.labelTextColor,Y=G===void 0?x2.labelTextColor:G,e1=e.parentLabelTextColor,Q=e1===void 0?x2.parentLabelTextColor:e1,K=m3(i),J=m3(a),W=k7(s),U=m3(b),Z=m3(E),D=function(v1){var h1=v1.width,l1=v1.height,$1=v1.tile,f1=v1.innerPadding,A1=v1.outerPadding,I1=v1.enableParentLabel,R1=v1.parentLabelSize,k1=v1.parentLabelPosition,Y1=v1.leavesOnly;return $.useMemo(function(){var X1=Or1().size([h1,l1]).tile(Nr1[$1]).round(!0).paddingInner(f1).paddingOuter(A1);if(I1&&!Y1){var D1=R1+2*A1;X1["padding"+or1(k1)](D1)}return X1},[h1,l1,$1,f1,A1,I1,R1,k1,Y1])}({width:C,height:n,tile:d,innerPadding:v,outerPadding:h,enableParentLabel:M,parentLabelSize:T,parentLabelPosition:A,leavesOnly:c}),n1=Dr1({root:t,getValue:J}),B=$.useMemo(function(){var v1=h$(n1);return D(v1),c?v1.leaves():v1.descendants()},[n1,D,c]),r1=$.useMemo(function(){return B.map(function(v1){var h1=function(A1,I1){var R1=A1.ancestors().map(function(k1){return I1(k1.data)}).reverse();return{path:R1.join("."),pathComponents:R1}}(v1,K),l1=h1.path,$1=h1.pathComponents,f1={id:K(v1.data),path:l1,pathComponents:$1,data:Z8(v1.data,"children"),x:v1.x0,y:v1.y0,width:v1.x1-v1.x0,height:v1.y1-v1.y0,value:v1.value,formattedValue:W(v1.value),treeDepth:v1.depth,treeHeight:v1.height,isParent:v1.height>0,isLeaf:v1.height===0,parentLabelX:0,parentLabelY:0,parentLabelRotation:0};return f1.labelRotation=S&&f1.height>f1.width?-90:0,A==="top"&&(f1.parentLabelX=h+R,f1.parentLabelY=h+T/2),A==="right"&&(f1.parentLabelX=f1.width-h-T/2,f1.parentLabelY=f1.height-h-R,f1.parentLabelRotation=-90),A==="bottom"&&(f1.parentLabelX=h+R,f1.parentLabelY=f1.height-h-T/2),A==="left"&&(f1.parentLabelX=h+T/2,f1.parentLabelY=f1.height-h-R,f1.parentLabelRotation=-90),f1.label=U(f1),f1.parentLabel=Z(f1),f1})},[B,K,W,U,S,Z,T,A,R,h]),i1=W5(),g1=xe(L,I),y1=E4(q,i1),m1=E4(Y,i1),b1=E4(Q,i1),S1=$.useMemo(function(){return r1.map(function(v1){var h1=V4({},v1,{color:g1(v1),opacity:N});return h1.borderColor=y1(h1),h1.labelTextColor=m1(h1),h1.parentLabelTextColor=b1(h1),h1})},[r1,g1,N,y1,m1,b1]);return{hierarchy:n1,nodes:S1,layout:D}},zr1=function(e){var t=e.nodes;return $.useMemo(function(){return{nodes:t}},[t])},$i=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}},cm=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}},Br1=$.memo(function(e){var t=e.nodes,C=e.nodeComponent,n=e.borderWidth,r=e.enableLabel,i=e.labelSkipSize,o=e.enableParentLabel,a=function(d,f){var v=f.isInteractive,g=f.onMouseEnter,h=f.onMouseMove,m=f.onMouseLeave,b=f.onClick,x=f.tooltip,S=a3(),w=S.showTooltipFromEvent,M=S.hideTooltip,_=$.useCallback(function(A,V){w($.createElement(x,{node:A}),V,"left")},[w,x]),E=$.useCallback(function(A,V){_(A,V),g==null||g(A,V)},[g,_]),O=$.useCallback(function(A,V){_(A,V),h==null||h(A,V)},[h,_]),T=$.useCallback(function(A,V){M(),m==null||m(A,V)},[m,M]),k=$.useCallback(function(A,V){b==null||b(A,V)},[b]);return $.useMemo(function(){return d.map(function(A){return v?V4({},A,{onMouseEnter:function(V){return E(A,V)},onMouseMove:function(V){return O(A,V)},onMouseLeave:function(V){return T(A,V)},onClick:function(V){return k(A,V)}}):A})},[v,d,E,O,T,k])}(t,{isInteractive:e.isInteractive,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseLeave:e.onMouseLeave,onClick:e.onClick,tooltip:e.tooltip}),s=A2(),l=s.animate,c=s.config,u=p4(a,{keys:function(d){return d.path},initial:$i,from:cm,enter:$i,update:$i,leave:cm,config:c,immediate:!l});return p.jsx(p.Fragment,{children:u(function(d,f){return $.createElement(C,{key:f.path,node:f,animatedProps:d,borderWidth:n,enableLabel:r,labelSkipSize:i,enableParentLabel:o})})})}),Wr1=["isInteractive","animate","motionConfig","theme","renderWrapper"],Ur1=function(e){var t=e.data,C=e.identity,n=C===void 0?U5.identity:C,r=e.value,i=r===void 0?U5.value:r,o=e.valueFormat,a=e.tile,s=a===void 0?U5.tile:a,l=e.nodeComponent,c=l===void 0?U5.nodeComponent:l,u=e.innerPadding,d=u===void 0?U5.innerPadding:u,f=e.outerPadding,v=f===void 0?U5.outerPadding:f,g=e.leavesOnly,h=g===void 0?U5.leavesOnly:g,m=e.width,b=e.height,x=e.margin,S=e.layers,w=S===void 0?U5.layers:S,M=e.colors,_=M===void 0?U5.colors:M,E=e.colorBy,O=E===void 0?U5.colorBy:E,T=e.nodeOpacity,k=T===void 0?U5.nodeOpacity:T,A=e.borderWidth,V=A===void 0?U5.borderWidth:A,R=e.borderColor,P=R===void 0?U5.borderColor:R,L=e.defs,H=L===void 0?U5.defs:L,I=e.fill,j=I===void 0?U5.fill:I,N=e.enableLabel,z=N===void 0?U5.enableLabel:N,q=e.label,G=q===void 0?U5.label:q,Y=e.labelTextColor,e1=Y===void 0?U5.labelTextColor:Y,Q=e.orientLabel,K=Q===void 0?U5.orientLabel:Q,J=e.labelSkipSize,W=J===void 0?U5.labelSkipSize:J,U=e.enableParentLabel,Z=U===void 0?U5.enableParentLabel:U,D=e.parentLabel,n1=D===void 0?U5.parentLabel:D,B=e.parentLabelSize,r1=B===void 0?U5.parentLabelSize:B,i1=e.parentLabelPosition,g1=i1===void 0?U5.parentLabelPosition:i1,y1=e.parentLabelPadding,m1=y1===void 0?U5.parentLabelPadding:y1,b1=e.parentLabelTextColor,S1=b1===void 0?U5.parentLabelTextColor:b1,v1=e.isInteractive,h1=v1===void 0?U5.isInteractive:v1,l1=e.onMouseEnter,$1=e.onMouseMove,f1=e.onMouseLeave,A1=e.onClick,I1=e.tooltip,R1=I1===void 0?U5.tooltip:I1,k1=e.role,Y1=e.ariaLabel,X1=e.ariaLabelledBy,D1=e.ariaDescribedBy,L1=z8(m,b,x),Q1=L1.margin,U1=L1.innerWidth,q1=L1.innerHeight,u1=L1.outerWidth,_1=L1.outerHeight,K1=Fr1({data:t,identity:n,value:i,valueFormat:o,leavesOnly:h,width:U1,height:q1,tile:s,innerPadding:d,outerPadding:v,colors:_,colorBy:O,nodeOpacity:k,borderColor:P,label:G,labelTextColor:e1,orientLabel:K,enableParentLabel:Z,parentLabel:n1,parentLabelSize:r1,parentLabelPosition:g1,parentLabelPadding:m1,parentLabelTextColor:S1}).nodes,C5={nodes:null};w.includes("nodes")&&(C5.nodes=p.jsx(Br1,{nodes:K1,nodeComponent:c,borderWidth:V,enableLabel:z,labelSkipSize:W,enableParentLabel:Z,isInteractive:h1,onMouseEnter:l1,onMouseMove:$1,onMouseLeave:f1,onClick:A1,tooltip:R1},"nodes"));var N1=zr1({nodes:K1}),z1=vu(H,K1,j);return p.jsx(x6,{width:u1,height:_1,margin:Q1,defs:z1,role:k1,ariaLabel:Y1,ariaLabelledBy:X1,ariaDescribedBy:D1,children:w.map(function(F1,J1){var t5;return typeof F1=="function"?p.jsx($.Fragment,{children:$.createElement(F1,N1)},J1):(t5=C5==null?void 0:C5[F1])!=null?t5:null})})},Zr1=function(e){var t=e.isInteractive,C=t===void 0?U5.isInteractive:t,n=e.animate,r=n===void 0?U5.animate:n,i=e.motionConfig,o=i===void 0?U5.motionConfig:i,a=e.theme,s=e.renderWrapper,l=Rr1(e,Wr1);return p.jsx(B8,{animate:r,isInteractive:C,motionConfig:o,renderWrapper:s,theme:a,children:p.jsx(Ur1,V4({isInteractive:C},l))})},qr1=function(e){return p.jsx(W7,{children:function(t){var C=t.width,n=t.height;return p.jsx(Zr1,V4({width:C,height:n},e))}})};function Gr1(e,t){if(e.startsWith("rgba"))return e.replace(/rgba?\((\d+), (\d+), (\d+),? ([\d.]+)?\)/,(C,n,r,i,o)=>`rgba(${n}, ${r}, ${i}, ${t})`);if(e.startsWith("rgb"))return e.replace(/rgb\((\d+), (\d+), (\d+)\)/,(C,n,r,i)=>`rgba(${n}, ${r}, ${i}, ${t})`);if(e.startsWith("hsl"))return e.replace(/hsl\((\d+), (\d+)%?, (\d+)%?\)/,(C,n,r,i)=>`hsla(${n}, ${r}%, ${i}%, ${t})`);if(e.startsWith("hsla"))return e.replace(/hsla?\((\d+), (\d+)%?, (\d+)%?,? ([\d.]+)?\)/,(C,n,r,i,o)=>`hsla(${n}, ${r}%, ${i}%, ${t})`);if(e.startsWith("#")){const C=Yr1(e);return`rgba(${C.r}, ${C.g}, ${C.b}, ${t})`}throw new Error("Unsupported color format")}function Yr1(e){const t=e.startsWith("#")?e.slice(1):e,C=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return{r:C,g:n,b:r}}const Kr1=({treeMapData:e,style:t={},colors:C={scheme:"nivo"},identity:n="name",value:r="loc",margin:i={},nodeOpacity:o=.67,labelTextColor:a="black",borderColor:s="white",labelTitle:l="name",labelTitleSize:c=16,labelText:u="name",labelTextSize:d=10,labelPadding:f=5,tooltip:v=null})=>{const g=({node:m})=>{var O,T;const b=$.useRef(null),x=$.useRef(null),[S,w]=$.useState(!1),[M,_]=$.useState(!1),E=()=>{if(!(b!=null&&b.current)||!(x!=null&&x.current))return;const k=x.current.getBoundingClientRect(),A=b.current.getBoundingClientRect(),V=Math.max([k,A]);w(A.height>m.height-f*2||A.width>m.width-f*2),_(k.height+A.height>m.height-f*2||V>m.width-f*2)};return $.useEffect(()=>{E()},[]),m.isParent?p.jsx(p.Fragment,{}):p.jsx("g",{transform:`translate(${m.x}, ${m.y})`,children:p.jsx("foreignObject",{width:m.width,height:m.height,style:{backgroundColor:Gr1(m.color,o),border:`1px solid ${s}`},children:p.jsxs("div",{style:{font:"var(--gf-label-lg-default)",color:a,padding:f,display:S?"none":"auto"},children:[p.jsx("span",{ref:b,style:{fontSize:c,display:"inline-block"},children:p.jsx("b",{children:((O=m==null?void 0:m.data)==null?void 0:O[l])||"Title"})}),p.jsx("div",{style:{display:M?"none":"auto"},children:p.jsx("span",{ref:x,style:{fontSize:d,display:"inline-block"},children:((T=m==null?void 0:m.data)==null?void 0:T[u])||"Text"})})]})})})},h=({nodes:m})=>m.map(b=>p.jsx(g,{node:b},b.id));return p.jsxs(p.Fragment,{children:[p.jsx(S2,{}),p.jsx("div",{style:{width:"100%",height:600,...t},children:p.jsx(qr1,{data:e,colors:C,identity:n,value:r,margin:{top:10,right:10,bottom:10,left:10,...i},enableParentLabel:!1,enableLabel:!1,nodeOpacity:0,borderWidth:0,tooltip:({node:m})=>p.jsx(f4,{body:(v==null?void 0:v({node:m}))||p.jsx("span",{children:"Treemap tooltip"})}),layers:[h,"nodes"]})})]})};var Xr1=he,Qr1=0;function Jr1(e){var t=++Qr1;return Xr1(e)+t}var ei1=Jr1;const ti1=p2(ei1);function u4(){return u4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},u4.apply(this,arguments)}var Eu=$.memo(function(e){var t=e.point;return p.jsx(P9,{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})}),hM=$.memo(function(e){var t=e.slice,C=e.axis,n=W5(),r=C==="x"?"y":"x";return p.jsx(tw,{rows:t.points.map(function(i){return[p.jsx(qt,{color:i.serieColor,style:n.tooltip.chip},"chip"),i.serieId,p.jsx("span",{style:n.tooltip.tableCellValue,children:i.data[r+"Formatted"]},"value")]})})}),gM={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:Eu,enableSlices:!1,debugSlices:!1,sliceTooltip:hM,debugMesh:!1,enableCrosshair:!0,crosshairType:"bottom-left"},x7=u4({},gM,{enablePointLabel:!1,useMesh:!1,enableTouchCrosshair:!1,animate:!0,motionConfig:"gentle",defs:[],fill:[],role:"img"});u4({},gM,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var Ci1=function(e){var t=e.curve;return $.useMemo(function(){return U0().defined(function(C){return C.x!==null&&C.y!==null}).x(function(C){return C.x}).y(function(C){return C.y}).curve(AS(t))},[t])},ni1=function(e){var t=e.curve,C=e.yScale,n=e.areaBaselineValue;return $.useMemo(function(){return nS().defined(function(r){return r.x!==null&&r.y!==null}).x(function(r){return r.x}).y1(function(r){return r.y}).curve(AS(t)).y0(C(n))},[t,C,n])},ri1=function(e){var t=e.componentId,C=e.enableSlices,n=e.points,r=e.width,i=e.height;return $.useMemo(function(){if(C===!1)return[];if(C==="x"){var o=new Map;return n.forEach(function(s){s.data.x!==null&&s.data.y!==null&&(o.has(s.x)?o.get(s.x).push(s):o.set(s.x,[s]))}),Array.from(o.entries()).sort(function(s,l){return s[0]-l[0]}).map(function(s,l,c){var u,d,f=s[0],v=s[1],g=c[l-1],h=c[l+1];return u=g?f-(f-g[0])/2:f,d=h?f-u+(h[0]-f)/2:r-u,{id:"slice:"+t+":"+f,x0:u,x:f,y0:0,y:0,width:d,height:i,points:v.reverse()}})}if(C==="y"){var a=new Map;return n.forEach(function(s){s.data.x!==null&&s.data.y!==null&&(a.has(s.y)?a.get(s.y).push(s):a.set(s.y,[s]))}),Array.from(a.entries()).sort(function(s,l){return s[0]-l[0]}).map(function(s,l,c){var u,d,f=s[0],v=s[1],g=c[l-1],h=c[l+1];return u=g?f-(f-g[0])/2:f,d=h?f-u+(h[0]-f)/2:i-u,{id:f,x0:0,x:0,y0:u,y:f,width:r,height:d,points:v.reverse()}})}},[t,C,i,n,r])},ii1="line",vM=function(e){var t=e.data,C=e.xScale,n=C===void 0?x7.xScale:C,r=e.xFormat,i=e.yScale,o=i===void 0?x7.yScale:i,a=e.yFormat,s=e.width,l=e.height,c=e.colors,u=c===void 0?x7.colors:c,d=e.curve,f=d===void 0?x7.curve:d,v=e.areaBaselineValue,g=v===void 0?x7.areaBaselineValue:v,h=e.pointColor,m=h===void 0?x7.pointColor:h,b=e.pointBorderColor,x=b===void 0?x7.pointBorderColor:b,S=e.enableSlices,w=S===void 0?x7.enableSlicesTooltip:S,M=$.useState(ti1(ii1))[0],_=k7(r),E=k7(a),O=xe(u,"id"),T=W5(),k=E4(m,T),A=E4(x,T),V=$.useState([]),R=V[0],P=V[1],L=$.useMemo(function(){return M$(t.filter(function(Q){return R.indexOf(Q.id)===-1}),n,o,s,l)},[t,R,n,o,s,l]),H=L.xScale,I=L.yScale,j=L.series,N=$.useMemo(function(){var Q=t.map(function(J){return{id:J.id,label:J.id,color:O(J)}}),K=Q.map(function(J){return u4({},j.find(function(W){return W.id===J.id}),{color:J.color})}).filter(function(J){return!!J.id});return{legendData:Q.map(function(J){return u4({},J,{hidden:!K.find(function(W){return W.id===J.id})})}).reverse(),series:K}},[t,j,O]),z=N.legendData,q=N.series,G=$.useCallback(function(Q){P(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,U=Q.formatX,Z=Q.formatY;return $.useMemo(function(){return K.reduce(function(D,n1){return[].concat(D,n1.data.filter(function(B){return B.position.x!==null&&B.position.y!==null}).map(function(B,r1){var i1={id:n1.id+"."+r1,index:D.length+r1,serieId:n1.id,serieColor:n1.color,x:B.position.x,y:B.position.y};return i1.color=J(n1),i1.borderColor=W(i1),i1.data=u4({},B.data,{xFormatted:U(B.data.x),yFormatted:Z(B.data.y)}),i1}))},[])},[K,J,W,U,Z])}({series:q,getPointColor:k,getPointBorderColor:A,formatX:_,formatY:E}),e1=ri1({componentId:M,enableSlices:w,points:Y,width:s,height:l});return{legendData:z,toggleSerie:G,lineGenerator:Ci1({curve:f}),areaGenerator:ni1({curve:f,yScale:I,areaBaselineValue:g}),getColor:O,series:q,xScale:H,yScale:I,slices:e1,points:Y}},oi1=function(e){var t=e.areaBlendMode,C=e.areaOpacity,n=e.color,r=e.fill,i=e.path,o=A2(),a=o.animate,s=o.config,l=Vn(i),c=X5({color:n,config:s,immediate:!a});return p.jsx(e5.path,{d:l,fill:r||c.color,fillOpacity:C,strokeWidth:0,style:{mixBlendMode:t}})},ai1=$.memo(function(e){var t=e.areaGenerator,C=e.areaOpacity,n=e.areaBlendMode,r=e.lines.slice(0).reverse();return p.jsx("g",{children:r.map(function(i){return p.jsx(oi1,u4({path:t(i.data.map(function(o){return o.position}))},u4({areaOpacity:C,areaBlendMode:n},i)),i.id)})})}),si1=$.memo(function(e){var t=e.lineGenerator,C=e.points,n=e.color,r=e.thickness,i=$.useMemo(function(){return t(C)},[t,C]),o=Vn(i);return p.jsx(e5.path,{d:o,fill:"none",strokeWidth:r,stroke:n})}),li1=$.memo(function(e){var t=e.lines,C=e.lineGenerator,n=e.lineWidth;return t.slice(0).reverse().map(function(r){var i=r.id,o=r.data,a=r.color;return p.jsx(si1,{id:i,points:o.map(function(s){return s.position}),lineGenerator:C,color:a,thickness:n},i)})}),ci1=$.memo(function(e){var t=e.slice,C=e.slices,n=e.axis,r=e.debug,i=e.tooltip,o=e.isCurrent,a=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onClick,d=e.onTouchStart,f=e.onTouchMove,v=e.onTouchEnd,g=a3(),h=g.showTooltipFromEvent,m=g.hideTooltip,b=$.useCallback(function(O){h($.createElement(i,{slice:t,axis:n}),O,"right"),a(t),s&&s(t,O)},[h,i,t,n,a,s]),x=$.useCallback(function(O){h($.createElement(i,{slice:t,axis:n}),O,"right"),l&&l(t,O)},[h,i,t,n,l]),S=$.useCallback(function(O){m(),a(null),c&&c(t,O)},[m,a,c,t]),w=$.useCallback(function(O){u&&u(t,O)},[t,u]),M=$.useCallback(function(O){h($.createElement(i,{slice:t,axis:n}),O,"right"),a(t),d&&d(t,O)},[n,d,a,h,t,i]),_=$.useCallback(function(O){var T=O.touches[0],k=document.elementFromPoint(T.clientX,T.clientY),A=k==null?void 0:k.getAttribute("data-ref");if(A){var V=C.find(function(R){return R.id===A});V&&(h($.createElement(i,{slice:V,axis:n}),O,"right"),a(V))}f&&f(t,O)},[n,f,a,h,t,C,i]),E=$.useCallback(function(O){m(),a(null),v&&v(t,O)},[m,a,v,t]);return p.jsx("rect",{x:t.x0,y:t.y0,width:t.width,height:t.height,stroke:"red",strokeWidth:r?1:0,strokeOpacity:.75,fill:"red",fillOpacity:o&&r?.35:0,onMouseEnter:b,onMouseMove:x,onMouseLeave:S,onClick:w,onTouchStart:M,onTouchMove:_,onTouchEnd:E,"data-ref":t.id})}),ui1=$.memo(function(e){var t=e.slices,C=e.axis,n=e.debug,r=e.height,i=e.tooltip,o=e.current,a=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onClick,d=e.onTouchStart,f=e.onTouchMove,v=e.onTouchEnd;return t.map(function(g){return p.jsx(ci1,{slice:g,slices:t,axis:C,debug:n,height:r,tooltip:i,setCurrent:a,isCurrent:o!==null&&o.id===g.id,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,onClick:u,onTouchStart:d,onTouchMove:f,onTouchEnd:v},g.id)})}),di1=$.memo(function(e){var t=e.points,C=e.symbol,n=e.size,r=e.borderWidth,i=e.enableLabel,o=e.label,a=e.labelYOffset,s=W5(),l=C31(o),c=t.slice(0).reverse().map(function(u){return{id:u.id,x:u.x,y:u.y,datum:u.data,fill:u.color,stroke:u.borderColor,label:i?l(u):null}});return p.jsx("g",{children:c.map(function(u){return p.jsx(J41,{x:u.x,y:u.y,datum:u.datum,symbol:C,size:n,color:u.fill,borderWidth:r,borderColor:u.stroke,label:u.label,labelYOffset:a,theme:s},u.id)})})}),fi1=$.memo(function(e){var t=e.points,C=e.width,n=e.height,r=e.margin,i=e.setCurrent,o=e.onMouseEnter,a=e.onMouseMove,s=e.onMouseLeave,l=e.onClick,c=e.onTouchStart,u=e.onTouchMove,d=e.onTouchEnd,f=e.tooltip,v=e.debug,g=e.enableTouchCrosshair,h=a3(),m=h.showTooltipAt,b=h.hideTooltip,x=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),o&&o(T,k)},[m,f,o,r]),S=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),a&&a(T,k)},[m,f,r.left,r.top,a]),w=$.useCallback(function(T,k){b(),s&&s(T,k)},[b,s]),M=$.useCallback(function(T,k){l&&l(T,k)},[l]),_=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),c&&c(T,k)},[r.left,r.top,c,m,f]),E=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),u&&u(T,k)},[r.left,r.top,u,m,f]),O=$.useCallback(function(T,k){b(),d&&d(T,k)},[d,b]);return p.jsx(N$,{nodes:t,width:C,height:n,setCurrent:i,onMouseEnter:x,onMouseMove:S,onMouseLeave:w,onClick:M,onTouchStart:_,onTouchMove:E,onTouchEnd:O,enableTouchCrosshair:g,debug:v})}),hi1=JS(function(e){var t=e.data,C=e.xScale,n=C===void 0?{type:"point"}:C,r=e.xFormat,i=e.yScale,o=i===void 0?{type:"linear",min:0,max:"auto"}:i,a=e.yFormat,s=e.layers,l=s===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:s,c=e.curve,u=c===void 0?"linear":c,d=e.areaBaselineValue,f=d===void 0?0:d,v=e.colors,g=v===void 0?{scheme:"nivo"}:v,h=e.margin,m=e.width,b=e.height,x=e.axisTop,S=e.axisRight,w=e.axisBottom,M=w===void 0?{}:w,_=e.axisLeft,E=_===void 0?{}:_,O=e.enableGridX,T=O===void 0||O,k=e.enableGridY,A=k===void 0||k,V=e.gridXValues,R=e.gridYValues,P=e.lineWidth,L=P===void 0?2:P,H=e.enableArea,I=H!==void 0&&H,j=e.areaOpacity,N=j===void 0?.2:j,z=e.areaBlendMode,q=z===void 0?"normal":z,G=e.enablePoints,Y=G===void 0||G,e1=e.pointSymbol,Q=e.pointSize,K=Q===void 0?6:Q,J=e.pointColor,W=J===void 0?{from:"color"}:J,U=e.pointBorderWidth,Z=U===void 0?0:U,D=e.pointBorderColor,n1=D===void 0?{theme:"background"}:D,B=e.enablePointLabel,r1=B!==void 0&&B,i1=e.pointLabel,g1=i1===void 0?"data.yFormatted":i1,y1=e.pointLabelYOffset,m1=e.defs,b1=m1===void 0?[]:m1,S1=e.fill,v1=S1===void 0?[]:S1,h1=e.markers,l1=e.legends,$1=l1===void 0?[]:l1,f1=e.isInteractive,A1=f1===void 0||f1,I1=e.useMesh,R1=I1!==void 0&&I1,k1=e.debugMesh,Y1=k1!==void 0&&k1,X1=e.onMouseEnter,D1=e.onMouseMove,L1=e.onMouseLeave,Q1=e.onClick,U1=e.onTouchStart,q1=e.onTouchMove,u1=e.onTouchEnd,_1=e.tooltip,K1=_1===void 0?Eu:_1,C5=e.enableSlices,N1=C5!==void 0&&C5,z1=e.debugSlices,F1=z1!==void 0&&z1,J1=e.sliceTooltip,t5=J1===void 0?hM:J1,B1=e.enableCrosshair,P1=B1===void 0||B1,l5=e.crosshairType,m5=l5===void 0?"bottom-left":l5,O1=e.enableTouchCrosshair,d1=O1!==void 0&&O1,w1=e.role,V1=w1===void 0?"img":w1,G1=z8(m,b,h),W1=G1.margin,n5=G1.innerWidth,X=G1.innerHeight,o1=G1.outerWidth,a1=G1.outerHeight,T1=vM({data:t,xScale:n,xFormat:r,yScale:o,yFormat:a,width:n5,height:X,colors:g,curve:u,areaBaselineValue:f,pointColor:W,pointBorderColor:n1,enableSlices:N1}),r5=T1.legendData,o5=T1.toggleSerie,a5=T1.lineGenerator,d5=T1.areaGenerator,p1=T1.series,x1=T1.xScale,H1=T1.yScale,i5=T1.slices,g5=T1.points,y5=W5(),f5=E4(W,y5),V5=E4(n1,y5),C2=$.useState(null),I5=C2[0],c2=C2[1],o4=$.useState(null),N5=o4[0],V2=o4[1],s5={grid:p.jsx(L$,{theme:y5,width:n5,height:X,xScale:T?x1:null,yScale:A?H1:null,xValues:V,yValues:R},"grid"),markers:p.jsx(QS,{markers:h1,width:n5,height:X,xScale:x1,yScale:H1,theme:y5},"markers"),axes:p.jsx(k$,{xScale:x1,yScale:H1,width:n5,height:X,theme:y5,top:x,right:S,bottom:M,left:E},"axes"),areas:null,lines:p.jsx(li1,{lines:p1,lineGenerator:a5,lineWidth:L},"lines"),slices:null,points:null,crosshair:null,mesh:null,legends:$1.map(function(a2,u2){return p.jsx(Rn,u4({},a2,{containerWidth:n5,containerHeight:X,data:a2.data||r5,theme:y5,toggleSerie:a2.toggleSerie?o5:void 0}),"legend."+u2)})},$2=vu(b1,p1,v1);return I&&(s5.areas=p.jsx(ai1,{areaGenerator:d5,areaOpacity:N,areaBlendMode:q,lines:p1},"areas")),A1&&N1!==!1&&(s5.slices=p.jsx(ui1,{slices:i5,axis:N1,debug:F1,height:X,tooltip:t5,current:N5,setCurrent:V2,onMouseEnter:X1,onMouseMove:D1,onMouseLeave:L1,onClick:Q1,onTouchStart:U1,onTouchMove:q1,onTouchEnd:u1},"slices")),Y&&(s5.points=p.jsx(di1,{points:g5,symbol:e1,size:K,color:f5,borderWidth:Z,borderColor:V5,enableLabel:r1,label:g1,labelYOffset:y1},"points")),A1&&P1&&(I5!==null&&(s5.crosshair=p.jsx(oa,{width:n5,height:X,x:I5.x,y:I5.y,type:m5},"crosshair")),N5!==null&&(s5.crosshair=p.jsx(oa,{width:n5,height:X,x:N5.x,y:N5.y,type:N1},"crosshair"))),A1&&R1&&N1===!1&&(s5.mesh=p.jsx(fi1,{points:g5,width:n5,height:X,margin:W1,current:I5,setCurrent:c2,onMouseEnter:X1,onMouseMove:D1,onMouseLeave:L1,onClick:Q1,onTouchStart:U1,onTouchMove:q1,onTouchEnd:u1,tooltip:K1,enableTouchCrosshair:d1,debug:Y1},"mesh")),p.jsx(x6,{defs:$2,width:o1,height:a1,margin:W1,role:V1,children:l.map(function(a2,u2){return typeof a2=="function"?p.jsx($.Fragment,{children:a2(u4({},e,{innerWidth:n5,innerHeight:X,series:p1,slices:i5,points:g5,xScale:x1,yScale:H1,lineGenerator:a5,areaGenerator:d5,currentPoint:I5,setCurrentPoint:c2,currentSlice:N5,setCurrentSlice:V2}))},u2):s5[a2]})})}),gi1=function(e){return p.jsx(W7,{children:function(t){var C=t.width,n=t.height;return p.jsx(hi1,u4({width:C,height:n},e))}})},vi1=JS(function(e){var t=$.useRef(null),C=e.width,n=e.height,r=e.margin,i=e.pixelRatio,o=i===void 0?typeof window<"u"&&window.devicePixelRatio||1:i,a=e.data,s=e.xScale,l=s===void 0?{type:"point"}:s,c=e.xFormat,u=e.yScale,d=u===void 0?{type:"linear",min:0,max:"auto"}:u,f=e.yFormat,v=e.curve,g=v===void 0?"linear":v,h=e.layers,m=h===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:h,b=e.colors,x=b===void 0?{scheme:"nivo"}:b,S=e.lineWidth,w=S===void 0?2:S,M=e.enableArea,_=M!==void 0&&M,E=e.areaBaselineValue,O=E===void 0?0:E,T=e.areaOpacity,k=T===void 0?.2:T,A=e.enablePoints,V=A===void 0||A,R=e.pointSize,P=R===void 0?6:R,L=e.pointColor,H=L===void 0?{from:"color"}:L,I=e.pointBorderWidth,j=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,e1=e.enableGridY,Q=e1===void 0||e1,K=e.gridYValues,J=e.axisTop,W=e.axisRight,U=e.axisBottom,Z=U===void 0?{}:U,D=e.axisLeft,n1=D===void 0?{}:D,B=e.legends,r1=B===void 0?[]:B,i1=e.isInteractive,g1=i1===void 0||i1,y1=e.debugMesh,m1=y1!==void 0&&y1,b1=e.onMouseLeave,S1=e.onClick,v1=e.tooltip,h1=v1===void 0?Eu:v1,l1=e.canvasRef,$1=z8(C,n,r),f1=$1.margin,A1=$1.innerWidth,I1=$1.innerHeight,R1=$1.outerWidth,k1=$1.outerHeight,Y1=W5(),X1=$.useState(null),D1=X1[0],L1=X1[1],Q1=vM({data:a,xScale:l,xFormat:c,yScale:d,yFormat:f,width:A1,height:I1,colors:x,curve:g,areaBaselineValue:O,pointColor:H,pointBorderColor:z}),U1=Q1.lineGenerator,q1=Q1.areaGenerator,u1=Q1.series,_1=Q1.xScale,K1=Q1.yScale,C5=Q1.points,N1=wu({points:C5,width:A1,height:I1,debug:m1}),z1=N1.delaunay,F1=N1.voronoi;$.useEffect(function(){l1&&(l1.current=t.current),t.current.width=R1*o,t.current.height=k1*o;var d1=t.current.getContext("2d");d1.scale(o,o),d1.fillStyle=Y1.background,d1.fillRect(0,0,R1,k1),d1.translate(f1.left,f1.top),m.forEach(function(w1){if(typeof w1=="function"&&w1({ctx:d1,innerWidth:A1,innerHeight:I1,series:u1,points:C5,xScale:_1,yScale:K1,lineWidth:w,lineGenerator:U1,areaGenerator:q1,currentPoint:D1,setCurrentPoint:L1}),w1==="grid"&&Y1.grid.line.strokeWidth>0&&(d1.lineWidth=Y1.grid.line.strokeWidth,d1.strokeStyle=Y1.grid.line.stroke,G&&gC(d1,{width:A1,height:I1,scale:_1,axis:"x",values:Y}),Q&&gC(d1,{width:A1,height:I1,scale:K1,axis:"y",values:K})),w1==="axes"&&P$(d1,{xScale:_1,yScale:K1,width:A1,height:I1,top:J,right:W,bottom:Z,left:n1,theme:Y1}),w1==="areas"&&_===!0){d1.save(),d1.globalAlpha=k,q1.context(d1);for(var V1=u1.length-1;V1>=0;V1--)d1.fillStyle=u1[V1].color,d1.beginPath(),q1(u1[V1].data.map(function(W1){return W1.position})),d1.fill();d1.restore()}if(w1==="lines"&&(U1.context(d1),u1.forEach(function(W1){d1.strokeStyle=W1.color,d1.lineWidth=w,d1.beginPath(),U1(W1.data.map(function(n5){return n5.position})),d1.stroke()})),w1==="points"&&V===!0&&P>0&&C5.forEach(function(W1){d1.fillStyle=W1.color,d1.beginPath(),d1.arc(W1.x,W1.y,P/2,0,2*Math.PI),d1.fill(),j>0&&(d1.strokeStyle=W1.borderColor,d1.lineWidth=j,d1.stroke())}),w1==="mesh"&&m1===!0&&(D$(d1,F1),D1&&F$(d1,F1,D1.index)),w1==="legends"){var G1=u1.map(function(W1){return{id:W1.id,label:W1.id,color:W1.color}}).reverse();r1.forEach(function(W1){o$(d1,u4({},W1,{data:W1.data||G1,containerWidth:A1,containerHeight:I1,theme:Y1}))})}})},[t,R1,k1,m,Y1,U1,u1,_1,K1,G,Y,Q,K,J,W,Z,n1,r1,C5,V,P,D1]);var J1=$.useCallback(function(d1){var w1=gu(t.current,d1),V1=w1[0],G1=w1[1];if(!e$(f1.left,f1.top,A1,I1,V1,G1))return null;var W1=z1.find(V1-f1.left,G1-f1.top);return C5[W1]},[t,f1,A1,I1,z1]),t5=a3(),B1=t5.showTooltipFromEvent,P1=t5.hideTooltip,l5=$.useCallback(function(d1){var w1=J1(d1);L1(w1),w1?B1($.createElement(h1,{point:w1}),d1):P1()},[J1,L1,B1,P1,h1]),m5=$.useCallback(function(d1){P1(),L1(null),D1&&b1&&b1(D1,d1)},[P1,L1,b1]),O1=$.useCallback(function(d1){if(S1){var w1=J1(d1);w1&&S1(w1,d1)}},[J1,S1]);return p.jsx("canvas",{ref:t,width:R1*o,height:k1*o,style:{width:R1,height:k1,cursor:g1?"auto":"normal"},onMouseEnter:g1?l5:void 0,onMouseMove:g1?l5:void 0,onMouseLeave:g1?m5:void 0,onClick:g1?O1:void 0})}),mi1=$.forwardRef(function(e,t){return p.jsx(vi1,u4({},e,{canvasRef:t}))});$.forwardRef(function(e,t){return p.jsx(W7,{children:function(C){var n=C.width,r=C.height;return p.jsx(mi1,u4({width:n,height:r},e,{ref:t}))}})});const pi1=({trendsData:e,height:t=null,margin:C={},colors:n=null,xLeg:r,yLeg:i,tooltip:o=null})=>p.jsxs(p.Fragment,{children:[p.jsx(S2,{}),p.jsx("div",{style:{width:"100%",height:t||600},children:p.jsx(gi1,{data:e,margin:{top:50,right:90,bottom:50,left:90,...C},colors:n||{scheme:"nivo"},xScale:{type:"point"},yScale:{type:"linear",min:"auto",max:"auto",reverse:!1},axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:0,legend:r,legendOffset:36,legendPosition:"middle"},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0,legend:i,legendOffset:-70,legendPosition:"middle"},pointSize:10,pointColor:{theme:"background"},pointBorderWidth:2,pointBorderColor:{from:"serieColor"},pointLabelYOffset:-12,useMesh:!0,legends:[{anchor:"top-right",direction:"column",justify:!1,translateX:210,translateY:-40,itemsSpacing:0,itemDirection:"left-to-right",itemWidth:200,itemHeight:20,itemOpacity:.9,symbolSize:8,symbolShape:"circle",symbolBorderColor:"rgba(0, 0, 0, .5)",effects:[{on:"hover",style:{itemBackground:"rgba(0, 0, 0, .03)",itemOpacity:1}}]}],tooltip:a=>p.jsx(f4,{body:(o==null?void 0:o(a))||p.jsx("span",{children:"Line tooltip"})})})})]}),bi1=E5.h3`
498
+ `,l61=({pieChartData:e,title:t,isEmpty:C,sortByValue:n=!0,arcLabel:r=null,tooltip:i=null,customStyle:o={},customMargin:a={},height:s=600,legendWidth:l="50%"})=>{const[c,u]=$.useState([]),d=({centerX:v,centerY:g,dataWithArc:h})=>(c.length||u(h),p.jsx("text",{x:v,y:g,textAnchor:"middle",dominantBaseline:"central",style:{fontSize:"16px",font:"var(--gf-label-md-default)",fontWeight:400},children:C?"Data niet openbaar beschikbaar":""})),f=({data:v})=>p.jsx(Q2,{gap:16,className:"gf-full",justify:"center",wrap:!0,style:{width:l},children:v==null?void 0:v.map((g,h)=>p.jsxs(Q2,{gap:8,align:"center",children:[p.jsx("div",{style:{minWidth:16,minHeight:16,backgroundColor:g.color}}),p.jsx(s61,{children:g.label})]},`legend-${h}`))});return p.jsxs(p.Fragment,{children:[p.jsx(S2,{}),p.jsxs(Q2,{vertical:!0,gap:8,align:"center",style:{width:"100%"},children:[p.jsx(a61,{children:t}),p.jsx("div",{style:{width:"100%",height:s},children:p.jsx(o61,{colors:{scheme:C?"greys":"nivo"},data:e,sortByValue:n,enableArcLabels:!C,arcLabel:v=>(r==null?void 0:r(v))||v.formattedValue,enableArcLinkLabels:!1,margin:{top:50,right:80,bottom:50,left:80,...a},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:!C,layers:["arcs","arcLabels","arcLinkLabels","legends",d],tooltip:({datum:{id:v,value:g,unit:h}})=>p.jsx(f4,{body:(i==null?void 0:i({id:v,value:g,unit:h}))||p.jsx("span",{children:"Pie chart tooltip"})})})}),!C&&p.jsx(f,{data:c})]})]})};var c61=rn,u61=du,d61=1,f61=2;function h61(e,t,C,n){var r=C.length,i=r,o=!n;if(e==null)return!i;for(e=Object(e);r--;){var a=C[r];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<i;){a=C[r];var s=a[0],l=e[s],c=a[1];if(o&&a[2]){if(l===void 0&&!(s in e))return!1}else{var u=new c61;if(n)var d=n(l,c,s,e,t,u);if(!(d===void 0?u61(c,l,d61|f61,n,u):d))return!1}}return!0}var g61=h61,v61=$3;function m61(e){return e===e&&!v61(e)}var y$=m61,p61=y$,b61=ye;function y61(e){for(var t=b61(e),C=t.length;C--;){var n=t[C],r=e[n];t[C]=[n,r,p61(r)]}return t}var x61=y61;function w61(e,t){return function(C){return C==null?!1:C[e]===t&&(t!==void 0||e in Object(C))}}var x$=w61,S61=g61,$61=x61,M61=x$;function E61(e){var t=$61(e);return t.length==1&&t[0][2]?M61(t[0][0],t[0][1]):function(C){return C===e||S61(C,e,t)}}var _61=E61,O61=du,V61=$w,T61=SS,R61=Rl,H61=y$,k61=x$,L61=s6,P61=1,j61=2;function I61(e,t){return R61(e)&&H61(t)?k61(L61(e),t):function(C){var n=V61(C,e);return n===void 0&&n===t?T61(C,e):O61(t,n,P61|j61)}}var A61=I61;function N61(e){return function(t){return t==null?void 0:t[e]}}var D61=N61,F61=ge;function z61(e){return function(t){return F61(t,e)}}var B61=z61,W61=D61,U61=B61,Z61=Rl,q61=s6;function G61(e){return Z61(e)?W61(q61(e)):U61(e)}var Y61=G61,K61=_61,X61=A61,Q61=cn,J61=b4,e01=Y61;function t01(e){return typeof e=="function"?e:e==null?Q61:typeof e=="object"?J61(e)?X61(e[0],e[1]):K61(e):e01(e)}var pu=t01,C01=pu,n01=vx;function r01(e,t){return e&&e.length?n01(e,C01(t)):[]}var i01=r01;const Oa=p2(i01);var o01=ow,a01=ye;function s01(e,t){return e&&o01(e,t,a01)}var l01=s01,c01=r6;function u01(e,t){return function(C,n){if(C==null)return C;if(!c01(C))return e(C,n);for(var r=C.length,i=t?r:-1,o=Object(C);(t?i--:++i<r)&&n(o[i],i,o)!==!1;);return C}}var d01=u01,f01=l01,h01=d01,g01=h01(f01),w$=g01,v01=w$,m01=r6;function p01(e,t){var C=-1,n=m01(e)?Array(e.length):[];return v01(e,function(r,i,o){n[++C]=t(r,i,o)}),n}var b01=p01;function y01(e,t){var C=e.length;for(e.sort(t);C--;)e[C]=e[C].value;return e}var x01=y01,Wv=un;function w01(e,t){if(e!==t){var C=e!==void 0,n=e===null,r=e===e,i=Wv(e),o=t!==void 0,a=t===null,s=t===t,l=Wv(t);if(!a&&!l&&!i&&e>t||i&&o&&s&&!a&&!l||n&&o&&s||!C&&s||!r)return 1;if(!n&&!i&&!l&&e<t||l&&C&&r&&!n&&!i||a&&C&&r||!o&&r||!s)return-1}return 0}var S01=w01,$01=S01;function M01(e,t,C){for(var n=-1,r=e.criteria,i=t.criteria,o=r.length,a=C.length;++n<o;){var s=$01(r[n],i[n]);if(s){if(n>=a)return s;var l=C[n];return s*(l=="desc"?-1:1)}}return e.index-t.index}var E01=M01,pi=dn,_01=ge,O01=pu,V01=b01,T01=x01,R01=i6,H01=E01,k01=cn,L01=b4;function P01(e,t,C){t.length?t=pi(t,function(i){return L01(i)?function(o){return _01(o,i.length===1?i[0]:i)}:i}):t=[k01];var n=-1;t=pi(t,R01(O01));var r=V01(e,function(i,o,a){var s=pi(t,function(l){return l(i)});return{criteria:s,index:++n,value:i}});return T01(r,function(i,o){return H01(i,o,C)})}var j01=P01,I01=MS,A01=j01,N01=Vl,Uv=xw,D01=N01(function(e,t){if(e==null)return[];var C=t.length;return C>1&&Uv(e,t[0],t[1])?t=[]:C>2&&Uv(t[0],t[1],t[2])&&(t=[t[0]]),A01(e,I01(t,1),[])}),F01=D01;const z01=p2(F01);var B01=g7,W01=Z4,U01="[object Date]";function Z01(e){return W01(e)&&B01(e)==U01}var q01=Z01,G01=q01,Y01=i6,Zv=sn,qv=Zv&&Zv.isDate,K01=qv?Y01(qv):G01,X01=K01;const Q01=p2(X01);var bi=new Date,yi=new Date;function w2(e,t,C,n){function r(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return r.floor=function(i){return e(i=new Date(+i)),i},r.ceil=function(i){return e(i=new Date(i-1)),t(i,1),e(i),i},r.round=function(i){var o=r(i),a=r.ceil(i);return i-o<a-i?o:a},r.offset=function(i,o){return t(i=new Date(+i),o==null?1:Math.floor(o)),i},r.range=function(i,o,a){var s=[],l;if(i=r.ceil(i),a=a==null?1:Math.floor(a),!(i<o)||!(a>0))return s;do s.push(l=new Date(+i)),t(i,a),e(i);while(l<i&&i<o);return s},r.filter=function(i){return w2(function(o){if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},function(o,a){if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!i(o););else for(;--a>=0;)for(;t(o,1),!i(o););})},C&&(r.count=function(i,o){return bi.setTime(+i),yi.setTime(+o),e(bi),e(yi),Math.floor(C(bi,yi))},r.every=function(i){return i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?r.filter(n?function(o){return n(o)%i===0}:function(o){return r.count(0,o)%i===0}):r}),r}var f7=w2(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});f7.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?w2(function(t){t.setTime(Math.floor(t/e)*e)},function(t,C){t.setTime(+t+C*e)},function(t,C){return(C-t)/e}):f7};f7.range;var fC=1e3,B9=6e4,hC=36e5,S$=6048e5,w8=w2(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*fC)},function(e,t){return(t-e)/fC},function(e){return e.getUTCSeconds()});w8.range;var Hn=w2(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*fC)},function(e,t){e.setTime(+e+t*B9)},function(e,t){return(t-e)/B9},function(e){return e.getMinutes()});Hn.range;var kn=w2(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*fC-e.getMinutes()*B9)},function(e,t){e.setTime(+e+t*hC)},function(e,t){return(t-e)/hC},function(e){return e.getHours()});kn.range;function W8(e){return w2(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,C){t.setDate(t.getDate()+C*7)},function(t,C){return(C-t-(C.getTimezoneOffset()-t.getTimezoneOffset())*B9)/S$})}var S8=W8(0),Ln=W8(1),Pn=W8(2),jn=W8(3),In=W8(4),An=W8(5),Nn=W8(6);S8.range;Ln.range;Pn.range;jn.range;In.range;An.range;Nn.range;var Dn=w2(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()});Dn.range;var we=w2(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()});we.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:w2(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,C){t.setFullYear(t.getFullYear()+C*e)})};we.range;var Fn=w2(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*B9)},function(e,t){return(t-e)/B9},function(e){return e.getUTCMinutes()});Fn.range;var zn=w2(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*hC)},function(e,t){return(t-e)/hC},function(e){return e.getUTCHours()});zn.range;function U8(e){return w2(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,C){t.setUTCDate(t.getUTCDate()+C*7)},function(t,C){return(C-t)/S$})}var $8=U8(0),Bn=U8(1),Wn=U8(2),Un=U8(3),Zn=U8(4),qn=U8(5),Gn=U8(6);$8.range;Bn.range;Wn.range;Un.range;Zn.range;qn.range;Gn.range;var Yn=w2(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()});Yn.range;var Se=w2(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()});Se.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:w2(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,C){t.setUTCFullYear(t.getUTCFullYear()+C*e)})};Se.range;function t8(){return t8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},t8.apply(this,arguments)}var a9=[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)}],J01={millisecond:[],second:a9.slice(0,1),minute:a9.slice(0,2),hour:a9.slice(0,3),day:a9.slice(0,4),month:a9.slice(0,5),year:a9.slice(0,6)},ee1=function(e){return function(t){return J01[e].forEach(function(C){C(t)}),t}},$$=function(e){var t=e.format,C=t===void 0?"native":t,n=e.precision,r=n===void 0?"millisecond":n,i=e.useUTC,o=i===void 0||i,a=ee1(r);return function(s){if(s===void 0)return s;if(C==="native"||s instanceof Date)return a(s);var l=o?lu(C):su(C);return a(l(s))}},te1=function(e,t,C,n){var r,i,o,a,s=e.min,l=s===void 0?0:s,c=e.max,u=c===void 0?"auto":c,d=e.stacked,f=d!==void 0&&d,v=e.reverse,g=v!==void 0&&v,h=e.clamp,m=h!==void 0&&h,b=e.nice,x=b!==void 0&&b;l==="auto"?r=f===!0?(i=t.minStacked)!=null?i:0:t.min:r=l,u==="auto"?o=f===!0?(a=t.maxStacked)!=null?a:0:t.max:o=u;var S=P8().rangeRound(n==="x"?[0,C]:[C,0]).domain(g?[o,r]:[r,o]).clamp(m);return x===!0?S.nice():typeof x=="number"&&S.nice(x),Ce1(S,f)},Ce1=function(e,t){t===void 0&&(t=!1);var C=e;return C.type="linear",C.stacked=t,C},ne1=function(e,t,C){var n=Pw().range([0,C]).domain(t.all);return n.type="point",n},re1=function(e,t,C,n){var r=e.round,i=r===void 0||r,o=I9().range(n==="x"?[0,C]:[C,0]).domain(t.all).round(i);return ie1(o)},ie1=function(e){var t=e;return t.type="band",t},oe1=function(e,t,C){var n,r,i=e.format,o=i===void 0?"native":i,a=e.precision,s=a===void 0?"millisecond":a,l=e.min,c=l===void 0?"auto":l,u=e.max,d=u===void 0?"auto":u,f=e.useUTC,v=f===void 0||f,g=e.nice,h=g!==void 0&&g,m=$$({format:o,precision:s,useUTC:v});n=c==="auto"?m(t.min):o!=="native"?m(c):c,r=d==="auto"?m(t.max):o!=="native"?m(d):d;var b=v?Kw():Yw();b.range([0,C]),n&&r&&b.domain([n,r]),h===!0?b.nice():typeof h!="object"&&typeof h!="number"||b.nice(h);var x=b;return x.type="time",x.useUTC=v,x},ae1=function(e,t,C,n){var r,i=e.base,o=i===void 0?10:i,a=e.min,s=a===void 0?"auto":a,l=e.max,c=l===void 0?"auto":l;if(t.all.some(function(g){return g===0}))throw new Error("a log scale domain must not include or cross zero");var u,d,f=!1;if(t.all.filter(function(g){return g!=null}).forEach(function(g){f||(r===void 0?r=Math.sign(g):Math.sign(g)!==r&&(f=!0))}),f)throw new Error("a log scale domain must be strictly-positive or strictly-negative");u=s==="auto"?t.min:s,d=c==="auto"?t.max:c;var v=zl().domain([u,d]).rangeRound(n==="x"?[0,C]:[C,0]).base(o).nice();return v.type="log",v},se1=function(e,t,C,n){var r,i,o=e.constant,a=o===void 0?1:o,s=e.min,l=s===void 0?"auto":s,c=e.max,u=c===void 0?"auto":c,d=e.reverse,f=d!==void 0&&d;r=l==="auto"?t.min:l,i=u==="auto"?t.max:u;var v=Bl().constant(a).rangeRound(n==="x"?[0,C]:[C,0]).nice();f===!0?v.domain([i,r]):v.domain([r,i]);var g=v;return g.type="symlog",g},le1=function(e){return e==="x"?"y":"x"},ce1=function(e,t){return e===t},ue1=function(e,t){return e.getTime()===t.getTime()};function Gv(e,t,C,n){switch(e.type){case"linear":return te1(e,t,C,n);case"point":return ne1(e,t,C);case"band":return re1(e,t,C,n);case"time":return oe1(e,t,C);case"log":return ae1(e,t,C,n);case"symlog":return se1(e,t,C,n);default:throw new Error("invalid scale spec")}}var Yv=function(e,t,C){var n;if("stacked"in C&&C.stacked){var r=e.data[t==="x"?"xStacked":"yStacked"];return r==null?null:C(r)}return(n=C(e.data[t]))!=null?n:null},M$=function(e,t,C,n,r){var i=e.map(function(c){return function(u){return t8({},u,{data:u.data.map(function(d){return{data:t8({},d)}})})}(c)}),o=de1(i,t,C);"stacked"in t&&t.stacked===!0&&fe1(o,i),"stacked"in C&&C.stacked===!0&&he1(o,i);var a=Gv(t,o.x,n,"x"),s=Gv(C,o.y,r,"y"),l=i.map(function(c){return t8({},c,{data:c.data.map(function(u){return t8({},u,{position:{x:Yv(u,"x",a),y:Yv(u,"y",s)}})})})});return t8({},o,{series:l,xScale:a,yScale:s})},de1=function(e,t,C){return{x:Kv(e,"x",t),y:Kv(e,"y",C)}},Kv=function(e,t,C,n){var r={},i=r.getValue,o=i===void 0?function(v){return v.data[t]}:i,a=r.setValue,s=a===void 0?function(v,g){v.data[t]=g}:a;if(C.type==="linear")e.forEach(function(v){v.data.forEach(function(g){var h=o(g);h&&s(g,parseFloat(String(h)))})});else if(C.type==="time"&&C.format!=="native"){var l=$$(C);e.forEach(function(v){v.data.forEach(function(g){var h=o(g);h&&s(g,l(h))})})}var c=[];switch(e.forEach(function(v){v.data.forEach(function(g){c.push(o(g))})}),C.type){case"linear":var u=z01(Wo(c).filter(function(v){return v!==null}),function(v){return v});return{all:u,min:Math.min.apply(Math,u),max:Math.max.apply(Math,u)};case"time":var d=Oa(c,function(v){return v.getTime()}).slice(0).sort(function(v,g){return g.getTime()-v.getTime()}).reverse();return{all:d,min:d[0],max:c1(d)};default:var f=Wo(c);return{all:f,min:f[0],max:c1(f)}}},E$=function(e,t,C){var n=le1(e),r=[];t[n].all.forEach(function(i){var o=Q01(i)?ue1:ce1,a=[];C.forEach(function(s){var l=s.data.find(function(f){return o(f.data[n],i)}),c=null,u=null;if(l!==void 0){if((c=l.data[e])!==null){var d=c1(a);d===void 0?u=c:d!==null&&(u=d+c)}l.data[e==="x"?"xStacked":"yStacked"]=u}a.push(u),u!==null&&r.push(u)})}),t[e].minStacked=Math.min.apply(Math,r),t[e].maxStacked=Math.max.apply(Math,r)},fe1=function(e,t){return E$("x",e,t)},he1=function(e,t){return E$("y",e,t)},_$=function(e){var t=e.bandwidth();if(t===0)return e;var C=t/2;return e.round()&&(C=Math.round(C)),function(n){var r;return((r=e(n))!=null?r:0)+C}},O$={millisecond:[f7,f7],second:[w8,w8],minute:[Hn,Fn],hour:[kn,zn],day:[w2(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)}),w2(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:[S8,$8],sunday:[S8,$8],monday:[Ln,Bn],tuesday:[Pn,Wn],wednesday:[jn,Un],thursday:[In,Zn],friday:[An,qn],saturday:[Nn,Gn],month:[Dn,Yn],year:[we,Se]},ge1=Object.keys(O$),ve1=new RegExp("^every\\s*(\\d+)?\\s*("+ge1.join("|")+")s?$","i"),V$=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var C=t.match(ve1);if(C){var n=C[1],r=C[2],i=O$[r][e.useUTC?1:0];if(r==="day"){var o,a,s=e.domain(),l=s[0],c=s[1],u=new Date(c);return u.setDate(u.getDate()+1),(o=(a=i.every(Number(n??1)))==null?void 0:a.range(l,u))!=null?o:[]}if(n===void 0)return e.ticks(i);var d=i.every(Number(n));if(d)return e.ticks(d)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(f=t)=="number"&&isFinite(f)&&Math.floor(f)===f)return e.ticks(t)}var f;return e.domain()};function D4(){return D4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},D4.apply(this,arguments)}var T$=function(e){var t,C=e.axis,n=e.scale,r=e.ticksPosition,i=e.tickValues,o=e.tickSize,a=e.tickPadding,s=e.tickRotation,l=e.truncateTickAt,c=e.engine,u=c===void 0?"svg":c,d=V$(n,i),f=Y41[u],v="bandwidth"in n?_$(n):n,g={lineX:0,lineY:0},h={textX:0,textY:0},m=typeof document=="object"&&document.dir==="rtl",b=f.align.center,x=f.baseline.center;return C==="x"?(t=function(S){var w;return{x:(w=v(S))!=null?w:0,y:0}},g.lineY=o*(r==="after"?1:-1),h.textY=(o+a)*(r==="after"?1:-1),x=r==="after"?f.baseline.top:f.baseline.bottom,s===0?b=f.align.center:r==="after"&&s<0||r==="before"&&s>0?(b=f.align[m?"left":"right"],x=f.baseline.center):(r==="after"&&s>0||r==="before"&&s<0)&&(b=f.align[m?"right":"left"],x=f.baseline.center)):(t=function(S){var w;return{x:0,y:(w=v(S))!=null?w:0}},g.lineX=o*(r==="after"?1:-1),h.textX=(o+a)*(r==="after"?1:-1),b=r==="after"?f.align.left:f.align.right),{ticks:d.map(function(S){var w=typeof S=="string"?function(M){var _=String(M).length;return l&&l>0&&_>l?""+String(M).slice(0,l).concat("..."):""+M}(S):S;return D4({key:S instanceof Date?""+S.valueOf():""+S,value:w},t(S),g,h)}),textAlign:b,textBaseline:x}},R$=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var C=F8(e);return function(n){return C(n instanceof Date?n:new Date(n))}}return A8(e)},Va=function(e){var t,C=e.width,n=e.height,r=e.scale,i=e.axis,o=e.values,a=(t=o,(Array.isArray(t)?o:void 0)||V$(r,o)),s="bandwidth"in r?_$(r):r,l=i==="x"?a.map(function(c){var u,d;return{key:c instanceof Date?""+c.valueOf():""+c,x1:(u=s(c))!=null?u:0,x2:(d=s(c))!=null?d:0,y1:0,y2:n}}):a.map(function(c){var u,d;return{key:c instanceof Date?""+c.valueOf():""+c,x1:0,x2:C,y1:(u=s(c))!=null?u:0,y2:(d=s(c))!=null?d:0}});return l},me1=$.memo(function(e){var t,C=e.value,n=e.format,r=e.lineX,i=e.lineY,o=e.onClick,a=e.textBaseline,s=e.textAnchor,l=e.animatedProps,c=W5(),u=c.axis.ticks.line,d=c.axis.ticks.text,f=(t=n==null?void 0:n(C))!=null?t:C,v=$.useMemo(function(){var g={opacity:l.opacity};return o?{style:D4({},g,{cursor:"pointer"}),onClick:function(h){return o(h,f)}}:{style:g}},[l.opacity,o,f]);return p.jsxs(e5.g,D4({transform:l.transform},v,{children:[p.jsx("line",{x1:0,x2:r,y1:0,y2:i,style:u}),d.outlineWidth>0&&p.jsx(e5.text,{dominantBaseline:a,textAnchor:s,transform:l.textTransform,style:d,strokeWidth:2*d.outlineWidth,stroke:d.outlineColor,strokeLinejoin:"round",children:""+f}),p.jsx(e5.text,{dominantBaseline:a,textAnchor:s,transform:l.textTransform,style:hu(d),children:""+f})]}))}),pe1=function(e){var t=e.axis,C=e.scale,n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.length,s=e.ticksPosition,l=e.tickValues,c=e.tickSize,u=c===void 0?5:c,d=e.tickPadding,f=d===void 0?5:d,v=e.tickRotation,g=v===void 0?0:v,h=e.format,m=e.renderTick,b=m===void 0?me1:m,x=e.truncateTickAt,S=e.legend,w=e.legendPosition,M=w===void 0?"end":w,_=e.legendOffset,E=_===void 0?0:_,O=e.onClick,T=e.ariaHidden,k=W5(),A=k.axis.legend.text,V=$.useMemo(function(){return R$(h,C)},[h,C]),R=T$({axis:t,scale:C,ticksPosition:s,tickValues:l,tickSize:u,tickPadding:f,tickRotation:g,truncateTickAt:x}),P=R.ticks,L=R.textAlign,H=R.textBaseline,I=null;if(S!==void 0){var j,N=0,z=0,q=0;t==="y"?(q=-90,N=E,M==="start"?(j="start",z=a):M==="middle"?(j="middle",z=a/2):M==="end"&&(j="end")):(z=E,M==="start"?j="start":M==="middle"?(j="middle",N=a/2):M==="end"&&(j="end",N=a)),I=p.jsxs(p.Fragment,{children:[A.outlineWidth>0&&p.jsx("text",{transform:"translate("+N+", "+z+") rotate("+q+")",textAnchor:j,style:D4({dominantBaseline:"central"},A),strokeWidth:2*A.outlineWidth,stroke:A.outlineColor,strokeLinejoin:"round",children:S}),p.jsx("text",{transform:"translate("+N+", "+z+") rotate("+q+")",textAnchor:j,style:D4({dominantBaseline:"central"},A),children:S})]})}var G=A2(),Y=G.animate,e1=G.config,Q=X5({transform:"translate("+r+","+o+")",lineX2:t==="x"?a:0,lineY2:t==="x"?0:a,config:e1,immediate:!Y}),K=$.useCallback(function(U){return{opacity:1,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+g+")"}},[g]),J=$.useCallback(function(U){return{opacity:0,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+g+")"}},[g]),W=p4(P,{keys:function(U){return U.key},initial:K,from:J,enter:K,update:K,leave:{opacity:0},config:e1,immediate:!Y});return p.jsxs(e5.g,{transform:Q.transform,"aria-hidden":T,children:[W(function(U,Z,D,n1){return y.createElement(b,D4({tickIndex:n1,format:V,rotate:g,textBaseline:H,textAnchor:L,truncateTickAt:x,animatedProps:U},Z,O?{onClick:O}:{}))}),p.jsx(e5.line,{style:k.axis.domain.line,x1:0,x2:Q.lineX2,y1:0,y2:Q.lineY2}),I]})},be1=$.memo(pe1),H$=["top","right","bottom","left"],k$=$.memo(function(e){var t=e.xScale,C=e.yScale,n=e.width,r=e.height,i={top:e.top,right:e.right,bottom:e.bottom,left:e.left};return p.jsx(p.Fragment,{children:H$.map(function(o){var a=i[o];if(!a)return null;var s=o==="top"||o==="bottom";return p.jsx(be1,D4({},a,{axis:s?"x":"y",x:o==="right"?n:0,y:o==="bottom"?r:0,scale:s?t:C,length:s?n:r,ticksPosition:o==="top"||o==="left"?"before":"after",truncateTickAt:a.truncateTickAt}),o)})})}),ye1=$.memo(function(e){var t=e.animatedProps,C=W5();return p.jsx(e5.line,D4({},t,C.grid.line))}),Xv=$.memo(function(e){var t=e.lines,C=A2(),n=C.animate,r=C.config,i=p4(t,{keys:function(o){return o.key},initial:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},from:function(o){return{opacity:0,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},enter:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},update:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},leave:{opacity:0},config:r,immediate:!n});return p.jsx("g",{children:i(function(o,a){return $.createElement(ye1,D4({},a,{key:a.key,animatedProps:o}))})})}),L$=$.memo(function(e){var t=e.width,C=e.height,n=e.xScale,r=e.yScale,i=e.xValues,o=e.yValues,a=$.useMemo(function(){return!!n&&Va({width:t,height:C,scale:n,axis:"x",values:i})},[n,i,t,C]),s=$.useMemo(function(){return!!r&&Va({width:t,height:C,scale:r,axis:"y",values:o})},[C,t,r,o]);return p.jsxs(p.Fragment,{children:[a&&p.jsx(Xv,{lines:a}),s&&p.jsx(Xv,{lines:s})]})}),xe1=function(e,t){var C,n=t.axis,r=t.scale,i=t.x,o=i===void 0?0:i,a=t.y,s=a===void 0?0:a,l=t.length,c=t.ticksPosition,u=t.tickValues,d=t.tickSize,f=d===void 0?5:d,v=t.tickPadding,g=v===void 0?5:v,h=t.tickRotation,m=h===void 0?0:h,b=t.format,x=t.legend,S=t.legendPosition,w=S===void 0?"end":S,M=t.legendOffset,_=M===void 0?0:M,E=t.theme,O=T$({axis:n,scale:r,ticksPosition:c,tickValues:u,tickSize:f,tickPadding:g,tickRotation:m,engine:"canvas"}),T=O.ticks,k=O.textAlign,A=O.textBaseline;e.save(),e.translate(o,s),e.textAlign=k,e.textBaseline=A;var V=E.axis.ticks.text;e.font=(V.fontWeight?V.fontWeight+" ":"")+V.fontSize+"px "+V.fontFamily,((C=E.axis.domain.line.strokeWidth)!=null?C:0)>0&&(e.lineWidth=Number(E.axis.domain.line.strokeWidth),e.lineCap="square",E.axis.domain.line.stroke&&(e.strokeStyle=E.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(n==="x"?l:0,n==="x"?0:l),e.stroke());var R=typeof b=="function"?b:function(j){return""+j};if(T.forEach(function(j){var N;((N=E.axis.ticks.line.strokeWidth)!=null?N:0)>0&&(e.lineWidth=Number(E.axis.ticks.line.strokeWidth),e.lineCap="square",E.axis.ticks.line.stroke&&(e.strokeStyle=E.axis.ticks.line.stroke),e.beginPath(),e.moveTo(j.x,j.y),e.lineTo(j.x+j.lineX,j.y+j.lineY),e.stroke());var z=R(j.value);e.save(),e.translate(j.x+j.textX,j.y+j.textY),e.rotate(N4(m)),V.outlineWidth>0&&(e.strokeStyle=V.outlineColor,e.lineWidth=2*V.outlineWidth,e.lineJoin="round",e.strokeText(""+z,0,0)),E.axis.ticks.text.fill&&(e.fillStyle=V.fill),e.fillText(""+z,0,0),e.restore()}),x!==void 0){var P=0,L=0,H=0,I="center";n==="y"?(H=-90,P=_,w==="start"?(I="start",L=l):w==="middle"?(I="center",L=l/2):w==="end"&&(I="end")):(L=_,w==="start"?I="start":w==="middle"?(I="center",P=l/2):w==="end"&&(I="end",P=l)),e.translate(P,L),e.rotate(N4(H)),e.font=(E.axis.legend.text.fontWeight?E.axis.legend.text.fontWeight+" ":"")+E.axis.legend.text.fontSize+"px "+E.axis.legend.text.fontFamily,E.axis.legend.text.fill&&(e.fillStyle=E.axis.legend.text.fill),e.textAlign=I,e.textBaseline="middle",e.fillText(x,0,0)}e.restore()},P$=function(e,t){var C=t.xScale,n=t.yScale,r=t.width,i=t.height,o=t.top,a=t.right,s=t.bottom,l=t.left,c=t.theme,u={top:o,right:a,bottom:s,left:l};H$.forEach(function(d){var f=u[d];if(!f)return null;var v=d==="top"||d==="bottom",g=d==="top"||d==="left"?"before":"after",h=v?C:n,m=R$(f.format,h);xe1(e,D4({},f,{axis:v?"x":"y",x:d==="right"?r:0,y:d==="bottom"?i:0,scale:h,format:m,length:v?r:i,ticksPosition:g,theme:c}))})},gC=function(e,t){var C=t.width,n=t.height,r=t.scale,i=t.axis,o=t.values;Va({width:C,height:n,scale:r,axis:i,values:o}).forEach(function(a){e.beginPath(),e.moveTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.stroke()})},we1=w$;function Se1(e,t){var C=[];return we1(e,function(n,r,i){t(n,r,i)&&C.push(n)}),C}var $e1=Se1,Me1=TS,Ee1=$e1,_e1=pu,Oe1=b4;function Ve1(e,t){var C=Oe1(e)?Me1:Ee1;return C(e,_e1(t))}var Te1=Ve1;const bu=p2(Te1);var Re1=g7,He1=Z4,ke1="[object Number]";function Le1(e){return typeof e=="number"||He1(e)&&Re1(e)==ke1}var Pe1=Le1;const M8=p2(Pe1);function je1(e,t,C){var n=-1,r=e.length;t<0&&(t=-t>r?0:r+t),C=C>r?r:C,C<0&&(C+=r),r=t>C?0:C-t>>>0,t>>>=0;for(var i=Array(r);++n<r;)i[n]=e[n+t];return i}var j$=je1,Ie1=ge,Ae1=j$;function Ne1(e,t){return t.length<2?e:Ie1(e,Ae1(t,0,-1))}var De1=Ne1,Fe1=a6,ze1=Rw,Be1=De1,We1=s6;function Ue1(e,t){return t=Fe1(t,e),e=Be1(e,t),e==null||delete e[We1(ze1(t))]}var Ze1=Ue1,qe1=El;function Ge1(e){return qe1(e)?void 0:e}var Ye1=Ge1,Ke1=dn,Xe1=f$,Qe1=Ze1,Je1=a6,et1=o6,tt1=Ye1,Ct1=ES,nt1=l$,rt1=1,it1=2,ot1=4,at1=Ct1(function(e,t){var C={};if(e==null)return C;var n=!1;t=Ke1(t,function(i){return i=Je1(i,e),n||(n=i.length>1),i}),et1(e,nt1(e),C),n&&(C=Xe1(C,rt1|it1|ot1,tt1));for(var r=t.length;r--;)Qe1(C,t[r]);return C}),st1=at1;const Z8=p2(st1);function P7(){return P7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},P7.apply(this,arguments)}var Ta={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},lt1=function(e){var t=typeof e;return $.isValidElement(e)||t==="string"||t==="function"||t==="object"},ct1=function(e){var t=typeof e;return t==="string"||t==="function"},Z0=function(e){return e.type==="circle"},Ra=function(e){return e.type==="dot"},q0=function(e){return e.type==="rect"},ut1=function(e){var t=e.data,C=e.annotations,n=e.getPosition,r=e.getDimensions;return C.reduce(function(i,o){var a=o.offset||0;return[].concat(i,bu(t,o.match).map(function(s){var l=n(s),c=r(s);return(Z0(o)||q0(o))&&(c.size=c.size+2*a,c.width=c.width+2*a,c.height=c.height+2*a),P7({},Z8(o,["match","offset"]),l,c,{size:o.size||c.size,datum:s})}))},[])},dt1=function(e,t,C,n){var r=Math.atan2(n-t,C-e);return G41(Tn(r))},ft1=function(e){var t,C,n=e.x,r=e.y,i=e.noteX,o=e.noteY,a=e.noteWidth,s=a===void 0?Ta.noteWidth:a,l=e.noteTextOffset,c=l===void 0?Ta.noteTextOffset:l;if(M8(i))t=n+i;else{if(i.abs===void 0)throw new Error("noteX should be either a number or an object containing an 'abs' property");t=i.abs}if(M8(o))C=r+o;else{if(o.abs===void 0)throw new Error("noteY should be either a number or an object containing an 'abs' property");C=o.abs}var u=n,d=r,f=dt1(n,r,t,C);if(Z0(e)){var v=f8(N4(f),e.size/2);u+=v.x,d+=v.y}if(q0(e)){var g=Math.round((f+90)/45)%8;g===0&&(d-=e.height/2),g===1&&(u+=e.width/2,d-=e.height/2),g===2&&(u+=e.width/2),g===3&&(u+=e.width/2,d+=e.height/2),g===4&&(d+=e.height/2),g===5&&(u-=e.width/2,d+=e.height/2),g===6&&(u-=e.width/2),g===7&&(u-=e.width/2,d-=e.height/2)}var h=t,m=t;return(f+90)%360>180?(h-=s,m-=s):m+=s,{points:[[u,d],[t,C],[m,C]],text:[h,C-c],angle:f+90}},ht1=function(e){var t=e.data,C=e.annotations,n=e.getPosition,r=e.getDimensions;return $.useMemo(function(){return ut1({data:t,annotations:C,getPosition:n,getDimensions:r})},[t,C,n,r])},gt1=function(e){return $.useMemo(function(){return ft1(e)},[e])},vt1=function(e){var t=e.datum,C=e.x,n=e.y,r=e.note,i=W5(),o=A2(),a=o.animate,s=o.config,l=X5({x:C,y:n,config:s,immediate:!a});return typeof r=="function"?$.createElement(r,{x:C,y:n,datum:t}):p.jsxs(p.Fragment,{children:[i.annotations.text.outlineWidth>0&&p.jsx(e5.text,{x:l.x,y:l.y,style:P7({},i.annotations.text,{strokeLinejoin:"round",strokeWidth:2*i.annotations.text.outlineWidth,stroke:i.annotations.text.outlineColor}),children:r}),p.jsx(e5.text,{x:l.x,y:l.y,style:Z8(i.annotations.text,["outlineWidth","outlineColor"]),children:r})]})},Qv=function(e){var t=e.points,C=e.isOutline,n=C!==void 0&&C,r=W5(),i=$.useMemo(function(){var s=t[0];return t.slice(1).reduce(function(l,c){return l+" L"+c[0]+","+c[1]},"M"+s[0]+","+s[1])},[t]),o=Vn(i);if(n&&r.annotations.link.outlineWidth<=0)return null;var a=P7({},r.annotations.link);return n&&(a.strokeLinecap="square",a.strokeWidth=r.annotations.link.strokeWidth+2*r.annotations.link.outlineWidth,a.stroke=r.annotations.link.outlineColor,a.opacity=r.annotations.link.outlineOpacity),p.jsx(e5.path,{fill:"none",d:o,style:a})},mt1=function(e){var t=e.x,C=e.y,n=e.size,r=W5(),i=A2(),o=i.animate,a=i.config,s=X5({x:t,y:C,radius:n/2,config:a,immediate:!o});return p.jsxs(p.Fragment,{children:[r.annotations.outline.outlineWidth>0&&p.jsx(e5.circle,{cx:s.x,cy:s.y,r:s.radius,style:P7({},r.annotations.outline,{fill:"none",strokeWidth:r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,stroke:r.annotations.outline.outlineColor,opacity:r.annotations.outline.outlineOpacity})}),p.jsx(e5.circle,{cx:s.x,cy:s.y,r:s.radius,style:r.annotations.outline})]})},pt1=function(e){var t=e.x,C=e.y,n=e.size,r=n===void 0?Ta.dotSize:n,i=W5(),o=A2(),a=o.animate,s=o.config,l=X5({x:t,y:C,radius:r/2,config:s,immediate:!a});return p.jsxs(p.Fragment,{children:[i.annotations.outline.outlineWidth>0&&p.jsx(e5.circle,{cx:l.x,cy:l.y,r:l.radius,style:P7({},i.annotations.outline,{fill:"none",strokeWidth:2*i.annotations.outline.outlineWidth,stroke:i.annotations.outline.outlineColor,opacity:i.annotations.outline.outlineOpacity})}),p.jsx(e5.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.symbol})]})},bt1=function(e){var t=e.x,C=e.y,n=e.width,r=e.height,i=e.borderRadius,o=i===void 0?6:i,a=W5(),s=A2(),l=s.animate,c=s.config,u=X5({x:t-n/2,y:C-r/2,width:n,height:r,config:c,immediate:!l});return p.jsxs(p.Fragment,{children:[a.annotations.outline.outlineWidth>0&&p.jsx(e5.rect,{x:u.x,y:u.y,rx:o,ry:o,width:u.width,height:u.height,style:P7({},a.annotations.outline,{fill:"none",strokeWidth:a.annotations.outline.strokeWidth+2*a.annotations.outline.outlineWidth,stroke:a.annotations.outline.outlineColor,opacity:a.annotations.outline.outlineOpacity})}),p.jsx(e5.rect,{x:u.x,y:u.y,rx:o,ry:o,width:u.width,height:u.height,style:a.annotations.outline})]})},yt1=function(e){var t=e.datum,C=e.x,n=e.y,r=e.note,i=gt1(e);if(!lt1(r))throw new Error("note should be a valid react element");return p.jsxs(p.Fragment,{children:[p.jsx(Qv,{points:i.points,isOutline:!0}),Z0(e)&&p.jsx(mt1,{x:C,y:n,size:e.size}),Ra(e)&&p.jsx(pt1,{x:C,y:n,size:e.size}),q0(e)&&p.jsx(bt1,{x:C,y:n,width:e.width,height:e.height,borderRadius:e.borderRadius}),p.jsx(Qv,{points:i.points}),p.jsx(vt1,{datum:t,x:i.text[0],y:i.text[1],note:r})]})},Jv=function(e,t){t.forEach(function(C,n){var r=C[0],i=C[1];n===0?e.moveTo(r,i):e.lineTo(r,i)})},xt1=function(e,t){var C=t.annotations,n=t.theme;C.length!==0&&(e.save(),C.forEach(function(r){if(!ct1(r.note))throw new Error("note is invalid for canvas implementation");n.annotations.link.outlineWidth>0&&(e.lineCap="square",e.strokeStyle=n.annotations.link.outlineColor,e.lineWidth=n.annotations.link.strokeWidth+2*n.annotations.link.outlineWidth,e.beginPath(),Jv(e,r.computed.points),e.stroke(),e.lineCap="butt"),Z0(r)&&n.annotations.outline.outlineWidth>0&&(e.strokeStyle=n.annotations.outline.outlineColor,e.lineWidth=n.annotations.outline.strokeWidth+2*n.annotations.outline.outlineWidth,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.stroke()),Ra(r)&&n.annotations.symbol.outlineWidth>0&&(e.strokeStyle=n.annotations.symbol.outlineColor,e.lineWidth=2*n.annotations.symbol.outlineWidth,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.stroke()),q0(r)&&n.annotations.outline.outlineWidth>0&&(e.strokeStyle=n.annotations.outline.outlineColor,e.lineWidth=n.annotations.outline.strokeWidth+2*n.annotations.outline.outlineWidth,e.beginPath(),e.rect(r.x-r.width/2,r.y-r.height/2,r.width,r.height),e.stroke()),e.strokeStyle=n.annotations.link.stroke,e.lineWidth=n.annotations.link.strokeWidth,e.beginPath(),Jv(e,r.computed.points),e.stroke(),Z0(r)&&(e.strokeStyle=n.annotations.outline.stroke,e.lineWidth=n.annotations.outline.strokeWidth,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.stroke()),Ra(r)&&(e.fillStyle=n.annotations.symbol.fill,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.fill()),q0(r)&&(e.strokeStyle=n.annotations.outline.stroke,e.lineWidth=n.annotations.outline.strokeWidth,e.beginPath(),e.rect(r.x-r.width/2,r.y-r.height/2,r.width,r.height),e.stroke()),typeof r.note=="function"?r.note(e,{datum:r.datum,x:r.computed.text[0],y:r.computed.text[1],theme:n}):(e.font=n.annotations.text.fontSize+"px "+n.annotations.text.fontFamily,e.textAlign="left",e.textBaseline="alphabetic",e.fillStyle=n.annotations.text.fill,e.strokeStyle=n.annotations.text.outlineColor,e.lineWidth=2*n.annotations.text.outlineWidth,n.annotations.text.outlineWidth>0&&(e.lineJoin="round",e.strokeText(r.note,r.computed.text[0],r.computed.text[1]),e.lineJoin="miter"),e.fillText(r.note,r.computed.text[0],r.computed.text[1]))}),e.restore())};const a7=11102230246251565e-32,e4=134217729,wt1=(3+8*a7)*a7;function xi(e,t,C,n,r){let i,o,a,s,l=t[0],c=n[0],u=0,d=0;c>l==c>-l?(i=l,l=t[++u]):(i=c,c=n[++d]);let f=0;if(u<e&&d<C)for(c>l==c>-l?(o=l+i,a=i-(o-l),l=t[++u]):(o=c+i,a=i-(o-c),c=n[++d]),i=o,a!==0&&(r[f++]=a);u<e&&d<C;)c>l==c>-l?(o=i+l,s=o-i,a=i-(o-s)+(l-s),l=t[++u]):(o=i+c,s=o-i,a=i-(o-s)+(c-s),c=n[++d]),i=o,a!==0&&(r[f++]=a);for(;u<e;)o=i+l,s=o-i,a=i-(o-s)+(l-s),l=t[++u],i=o,a!==0&&(r[f++]=a);for(;d<C;)o=i+c,s=o-i,a=i-(o-s)+(c-s),c=n[++d],i=o,a!==0&&(r[f++]=a);return(i!==0||f===0)&&(r[f++]=i),f}function St1(e,t){let C=t[0];for(let n=1;n<e;n++)C+=t[n];return C}function $e(e){return new Float64Array(e)}const $t1=(3+16*a7)*a7,Mt1=(2+12*a7)*a7,Et1=(9+64*a7)*a7*a7,s9=$e(4),em=$e(8),tm=$e(12),Cm=$e(16),l4=$e(4);function _t1(e,t,C,n,r,i,o){let a,s,l,c,u,d,f,v,g,h,m,b,x,S,w,M,_,E;const O=e-r,T=C-r,k=t-i,A=n-i;S=O*A,d=e4*O,f=d-(d-O),v=O-f,d=e4*A,g=d-(d-A),h=A-g,w=v*h-(S-f*g-v*g-f*h),M=k*T,d=e4*k,f=d-(d-k),v=k-f,d=e4*T,g=d-(d-T),h=T-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,s9[0]=w-(m+u)+(u-_),b=S+m,u=b-S,x=S-(b-u)+(m-u),m=x-M,u=x-m,s9[1]=x-(m+u)+(u-M),E=b+m,u=E-b,s9[2]=b-(E-u)+(m-u),s9[3]=E;let V=St1(4,s9),R=Mt1*o;if(V>=R||-V>=R||(u=e-O,a=e-(O+u)+(u-r),u=C-T,l=C-(T+u)+(u-r),u=t-k,s=t-(k+u)+(u-i),u=n-A,c=n-(A+u)+(u-i),a===0&&s===0&&l===0&&c===0)||(R=Et1*o+wt1*Math.abs(V),V+=O*c+A*a-(k*l+T*s),V>=R||-V>=R))return V;S=a*A,d=e4*a,f=d-(d-a),v=a-f,d=e4*A,g=d-(d-A),h=A-g,w=v*h-(S-f*g-v*g-f*h),M=s*T,d=e4*s,f=d-(d-s),v=s-f,d=e4*T,g=d-(d-T),h=T-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,l4[0]=w-(m+u)+(u-_),b=S+m,u=b-S,x=S-(b-u)+(m-u),m=x-M,u=x-m,l4[1]=x-(m+u)+(u-M),E=b+m,u=E-b,l4[2]=b-(E-u)+(m-u),l4[3]=E;const P=xi(4,s9,4,l4,em);S=O*c,d=e4*O,f=d-(d-O),v=O-f,d=e4*c,g=d-(d-c),h=c-g,w=v*h-(S-f*g-v*g-f*h),M=k*l,d=e4*k,f=d-(d-k),v=k-f,d=e4*l,g=d-(d-l),h=l-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,l4[0]=w-(m+u)+(u-_),b=S+m,u=b-S,x=S-(b-u)+(m-u),m=x-M,u=x-m,l4[1]=x-(m+u)+(u-M),E=b+m,u=E-b,l4[2]=b-(E-u)+(m-u),l4[3]=E;const L=xi(P,em,4,l4,tm);S=a*c,d=e4*a,f=d-(d-a),v=a-f,d=e4*c,g=d-(d-c),h=c-g,w=v*h-(S-f*g-v*g-f*h),M=s*l,d=e4*s,f=d-(d-s),v=s-f,d=e4*l,g=d-(d-l),h=l-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,l4[0]=w-(m+u)+(u-_),b=S+m,u=b-S,x=S-(b-u)+(m-u),m=x-M,u=x-m,l4[1]=x-(m+u)+(u-M),E=b+m,u=E-b,l4[2]=b-(E-u)+(m-u),l4[3]=E;const H=xi(L,tm,4,l4,Cm);return Cm[H-1]}function ot(e,t,C,n,r,i){const o=(t-i)*(C-r),a=(e-r)*(n-i),s=o-a,l=Math.abs(o+a);return Math.abs(s)>=$t1*l?s:-_t1(e,t,C,n,r,i,l)}const nm=Math.pow(2,-52),at=new Uint32Array(512);class vC{static from(t,C=Ht1,n=kt1){const r=t.length,i=new Float64Array(r*2);for(let o=0;o<r;o++){const a=t[o];i[2*o]=C(a),i[2*o+1]=n(a)}return new vC(i)}constructor(t){const C=t.length>>1;if(C>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*C-5,0);this._triangles=new Uint32Array(n*3),this._halfedges=new Int32Array(n*3),this._hashSize=Math.ceil(Math.sqrt(C)),this._hullPrev=new Uint32Array(C),this._hullNext=new Uint32Array(C),this._hullTri=new Uint32Array(C),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(C),this._dists=new Float64Array(C),this.update()}update(){const{coords:t,_hullPrev:C,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,s=1/0,l=-1/0,c=-1/0;for(let O=0;O<o;O++){const T=t[2*O],k=t[2*O+1];T<a&&(a=T),k<s&&(s=k),T>l&&(l=T),k>c&&(c=k),this._ids[O]=O}const u=(a+l)/2,d=(s+c)/2;let f,v,g;for(let O=0,T=1/0;O<o;O++){const k=wi(u,d,t[2*O],t[2*O+1]);k<T&&(f=O,T=k)}const h=t[2*f],m=t[2*f+1];for(let O=0,T=1/0;O<o;O++){if(O===f)continue;const k=wi(h,m,t[2*O],t[2*O+1]);k<T&&k>0&&(v=O,T=k)}let b=t[2*v],x=t[2*v+1],S=1/0;for(let O=0;O<o;O++){if(O===f||O===v)continue;const T=Tt1(h,m,b,x,t[2*O],t[2*O+1]);T<S&&(g=O,S=T)}let w=t[2*g],M=t[2*g+1];if(S===1/0){for(let k=0;k<o;k++)this._dists[k]=t[2*k]-t[0]||t[2*k+1]-t[1];p9(this._ids,this._dists,0,o-1);const O=new Uint32Array(o);let T=0;for(let k=0,A=-1/0;k<o;k++){const V=this._ids[k],R=this._dists[V];R>A&&(O[T++]=V,A=R)}this.hull=O.subarray(0,T),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(ot(h,m,b,x,w,M)<0){const O=v,T=b,k=x;v=g,b=w,x=M,g=O,w=T,M=k}const _=Rt1(h,m,b,x,w,M);this._cx=_.x,this._cy=_.y;for(let O=0;O<o;O++)this._dists[O]=wi(t[2*O],t[2*O+1],_.x,_.y);p9(this._ids,this._dists,0,o-1),this._hullStart=f;let E=3;n[f]=C[g]=v,n[v]=C[f]=g,n[g]=C[v]=f,r[f]=0,r[v]=1,r[g]=2,i.fill(-1),i[this._hashKey(h,m)]=f,i[this._hashKey(b,x)]=v,i[this._hashKey(w,M)]=g,this.trianglesLen=0,this._addTriangle(f,v,g,-1,-1,-1);for(let O=0,T,k;O<this._ids.length;O++){const A=this._ids[O],V=t[2*A],R=t[2*A+1];if(O>0&&Math.abs(V-T)<=nm&&Math.abs(R-k)<=nm||(T=V,k=R,A===f||A===v||A===g))continue;let P=0;for(let N=0,z=this._hashKey(V,R);N<this._hashSize&&(P=i[(z+N)%this._hashSize],!(P!==-1&&P!==n[P]));N++);P=C[P];let L=P,H;for(;H=n[L],ot(V,R,t[2*L],t[2*L+1],t[2*H],t[2*H+1])>=0;)if(L=H,L===P){L=-1;break}if(L===-1)continue;let I=this._addTriangle(L,A,n[L],-1,-1,r[L]);r[A]=this._legalize(I+2),r[L]=I,E++;let j=n[L];for(;H=n[j],ot(V,R,t[2*j],t[2*j+1],t[2*H],t[2*H+1])<0;)I=this._addTriangle(j,A,H,r[A],-1,r[j]),r[A]=this._legalize(I+2),n[j]=j,E--,j=H;if(L===P)for(;H=C[L],ot(V,R,t[2*H],t[2*H+1],t[2*L],t[2*L+1])<0;)I=this._addTriangle(H,A,L,-1,r[L],r[H]),this._legalize(I+2),r[H]=I,n[L]=L,E--,L=H;this._hullStart=C[A]=L,n[L]=C[j]=A,n[A]=j,i[this._hashKey(V,R)]=A,i[this._hashKey(t[2*L],t[2*L+1])]=L}this.hull=new Uint32Array(E);for(let O=0,T=this._hullStart;O<E;O++)this.hull[O]=T,T=n[T];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,C){return Math.floor(Ot1(t-this._cx,C-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:C,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,a===-1){if(i===0)break;t=at[--i];continue}const l=a-a%3,c=s+(t+1)%3,u=l+(a+2)%3,d=C[o],f=C[t],v=C[c],g=C[u];if(Vt1(r[2*d],r[2*d+1],r[2*f],r[2*f+1],r[2*v],r[2*v+1],r[2*g],r[2*g+1])){C[t]=g,C[a]=d;const m=n[u];if(m===-1){let x=this._hullStart;do{if(this._hullTri[x]===u){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,m),this._link(a,n[o]),this._link(o,u);const b=l+(a+1)%3;i<at.length&&(at[i++]=b)}else{if(i===0)break;t=at[--i]}}return o}_link(t,C){this._halfedges[t]=C,C!==-1&&(this._halfedges[C]=t)}_addTriangle(t,C,n,r,i,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=C,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,o),this.trianglesLen+=3,a}}function Ot1(e,t){const C=e/(Math.abs(e)+Math.abs(t));return(t>0?3-C:1+C)/4}function wi(e,t,C,n){const r=e-C,i=t-n;return r*r+i*i}function Vt1(e,t,C,n,r,i,o,a){const s=e-o,l=t-a,c=C-o,u=n-a,d=r-o,f=i-a,v=s*s+l*l,g=c*c+u*u,h=d*d+f*f;return s*(u*h-g*f)-l*(c*h-g*d)+v*(c*f-u*d)<0}function Tt1(e,t,C,n,r,i){const o=C-e,a=n-t,s=r-e,l=i-t,c=o*o+a*a,u=s*s+l*l,d=.5/(o*l-a*s),f=(l*c-a*u)*d,v=(o*u-s*c)*d;return f*f+v*v}function Rt1(e,t,C,n,r,i){const o=C-e,a=n-t,s=r-e,l=i-t,c=o*o+a*a,u=s*s+l*l,d=.5/(o*l-a*s),f=e+(l*c-a*u)*d,v=t+(o*u-s*c)*d;return{x:f,y:v}}function p9(e,t,C,n){if(n-C<=20)for(let r=C+1;r<=n;r++){const i=e[r],o=t[i];let a=r-1;for(;a>=C&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=i}else{const r=C+n>>1;let i=C+1,o=n;U6(e,r,i),t[e[C]]>t[e[n]]&&U6(e,C,n),t[e[i]]>t[e[n]]&&U6(e,i,n),t[e[C]]>t[e[i]]&&U6(e,C,i);const a=e[i],s=t[a];for(;;){do i++;while(t[e[i]]<s);do o--;while(t[e[o]]>s);if(o<i)break;U6(e,i,o)}e[C+1]=e[o],e[o]=a,n-i+1>=o-C?(p9(e,t,i,n),p9(e,t,C,o-1)):(p9(e,t,C,o-1),p9(e,t,i,n))}}function U6(e,t,C){const n=e[t];e[t]=e[C],e[C]=n}function Ht1(e){return e[0]}function kt1(e){return e[1]}const rm=1e-6;class s8{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,C){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+C}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,C){this._+=`L${this._x1=+t},${this._y1=+C}`}arc(t,C,n){t=+t,C=+C,n=+n;const r=t+n,i=C;if(n<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>rm||Math.abs(this._y1-i)>rm)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${C}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,C,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+C}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Ha{constructor(){this._=[]}moveTo(t,C){this._.push([t,C])}closePath(){this._.push(this._[0].slice())}lineTo(t,C){this._.push([t,C])}value(){return this._.length?this._:null}}class Lt1{constructor(t,[C,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(C=+C))||!((i=+i)>=(n=+n)))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=r,this.xmin=C,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:C,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let g=0,h=0,m=n.length,b,x;g<m;g+=3,h+=2){const S=n[g]*2,w=n[g+1]*2,M=n[g+2]*2,_=t[S],E=t[S+1],O=t[w],T=t[w+1],k=t[M],A=t[M+1],V=O-_,R=T-E,P=k-_,L=A-E,H=(V*L-R*P)*2;if(Math.abs(H)<1e-9){if(i===void 0){i=o=0;for(const j of C)i+=t[j*2],o+=t[j*2+1];i/=C.length,o/=C.length}const I=1e9*Math.sign((i-_)*L-(o-E)*P);b=(_+k)/2-I*L,x=(E+A)/2+I*P}else{const I=1/H,j=V*V+R*R,N=P*P+L*L;b=_+(L*j-R*N)*I,x=E+(V*N-P*j)*I}a[h]=b,a[h+1]=x}let s=C[C.length-1],l,c=s*4,u,d=t[2*s],f,v=t[2*s+1];r.fill(0);for(let g=0;g<C.length;++g)s=C[g],l=c,u=d,f=v,c=s*4,d=t[2*s],v=t[2*s+1],r[l+2]=r[c]=f-v,r[l+3]=r[c+1]=d-u}render(t){const C=t==null?t=new s8:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:o,vectors:a}=this;if(i.length<=1)return null;for(let c=0,u=n.length;c<u;++c){const d=n[c];if(d<c)continue;const f=Math.floor(c/3)*2,v=Math.floor(d/3)*2,g=o[f],h=o[f+1],m=o[v],b=o[v+1];this._renderSegment(g,h,m,b,t)}let s,l=i[i.length-1];for(let c=0;c<i.length;++c){s=l,l=i[c];const u=Math.floor(r[l]/3)*2,d=o[u],f=o[u+1],v=s*4,g=this._project(d,f,a[v+2],a[v+3]);g&&this._renderSegment(d,f,g[0],g[1],t)}return C&&C.value()}renderBounds(t){const C=t==null?t=new s8:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),C&&C.value()}renderCell(t,C){const n=C==null?C=new s8:void 0,r=this._clip(t);if(r===null||!r.length)return;C.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let o=2;o<i;o+=2)(r[o]!==r[o-2]||r[o+1]!==r[o-1])&&C.lineTo(r[o],r[o+1]);return C.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let C=0,n=t.length/2;C<n;++C){const r=this.cellPolygon(C);r&&(r.index=C,yield r)}}cellPolygon(t){const C=new Ha;return this.renderCell(t,C),C.value()}_renderSegment(t,C,n,r,i){let o;const a=this._regioncode(t,C),s=this._regioncode(n,r);a===0&&s===0?(i.moveTo(t,C),i.lineTo(n,r)):(o=this._clipSegment(t,C,n,r,a,s))&&(i.moveTo(o[0],o[1]),i.lineTo(o[2],o[3]))}contains(t,C,n){return C=+C,C!==C||(n=+n,n!==n)?!1:this.delaunay._step(t,C,n)===t}*neighbors(t){const C=this._clip(t);if(C)for(const n of this.delaunay.neighbors(t)){const r=this._clip(n);if(r){e:for(let i=0,o=C.length;i<o;i+=2)for(let a=0,s=r.length;a<s;a+=2)if(C[i]===r[a]&&C[i+1]===r[a+1]&&C[(i+2)%o]===r[(a+s-2)%s]&&C[(i+3)%o]===r[(a+s-1)%s]){yield n;break e}}}}_cell(t){const{circumcenters:C,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,o=n[t];if(o===-1)return null;const a=[];let s=o;do{const l=Math.floor(s/3);if(a.push(C[l*2],C[l*2+1]),s=s%3===2?s-2:s+1,i[s]!==t)break;s=r[s]}while(s!==o&&s!==-1);return a}_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 C=this._cell(t);if(C===null)return null;const{vectors:n}=this,r=t*4;return this._simplify(n[r]||n[r+1]?this._clipInfinite(t,C,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,C))}_clipFinite(t,C){const n=C.length;let r=null,i,o,a=C[n-2],s=C[n-1],l,c=this._regioncode(a,s),u,d=0;for(let f=0;f<n;f+=2)if(i=a,o=s,a=C[f],s=C[f+1],l=c,c=this._regioncode(a,s),l===0&&c===0)u=d,d=0,r?r.push(a,s):r=[a,s];else{let v,g,h,m,b;if(l===0){if((v=this._clipSegment(i,o,a,s,l,c))===null)continue;[g,h,m,b]=v}else{if((v=this._clipSegment(a,s,i,o,c,l))===null)continue;[m,b,g,h]=v,u=d,d=this._edgecode(g,h),u&&d&&this._edge(t,u,d,r,r.length),r?r.push(g,h):r=[g,h]}u=d,d=this._edgecode(m,b),u&&d&&this._edge(t,u,d,r,r.length),r?r.push(m,b):r=[m,b]}if(r)u=d,d=this._edgecode(r[0],r[1]),u&&d&&this._edge(t,u,d,r,r.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 r}_clipSegment(t,C,n,r,i,o){const a=i<o;for(a&&([t,C,n,r,i,o]=[n,r,t,C,o,i]);;){if(i===0&&o===0)return a?[n,r,t,C]:[t,C,n,r];if(i&o)return null;let s,l,c=i||o;c&8?(s=t+(n-t)*(this.ymax-C)/(r-C),l=this.ymax):c&4?(s=t+(n-t)*(this.ymin-C)/(r-C),l=this.ymin):c&2?(l=C+(r-C)*(this.xmax-t)/(n-t),s=this.xmax):(l=C+(r-C)*(this.xmin-t)/(n-t),s=this.xmin),i?(t=s,C=l,i=this._regioncode(t,C)):(n=s,r=l,o=this._regioncode(n,r))}}_clipInfinite(t,C,n,r,i,o){let a=Array.from(C),s;if((s=this._project(a[0],a[1],n,r))&&a.unshift(s[0],s[1]),(s=this._project(a[a.length-2],a[a.length-1],i,o))&&a.push(s[0],s[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,u,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)u=d,d=this._edgecode(a[l],a[l+1]),u&&d&&(l=this._edge(t,u,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,C,n,r,i){for(;C!==n;){let o,a;switch(C){case 5:C=4;continue;case 4:C=6,o=this.xmax,a=this.ymin;break;case 6:C=2;continue;case 2:C=10,o=this.xmax,a=this.ymax;break;case 10:C=8;continue;case 8:C=9,o=this.xmin,a=this.ymax;break;case 9:C=1;continue;case 1:C=5,o=this.xmin,a=this.ymin;break}(r[i]!==o||r[i+1]!==a)&&this.contains(t,o,a)&&(r.splice(i,0,o,a),i+=2)}return i}_project(t,C,n,r){let i=1/0,o,a,s;if(r<0){if(C<=this.ymin)return null;(o=(this.ymin-C)/r)<i&&(s=this.ymin,a=t+(i=o)*n)}else if(r>0){if(C>=this.ymax)return null;(o=(this.ymax-C)/r)<i&&(s=this.ymax,a=t+(i=o)*n)}if(n>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/n)<i&&(a=this.xmax,s=C+(i=o)*r)}else if(n<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/n)<i&&(a=this.xmin,s=C+(i=o)*r)}return[a,s]}_edgecode(t,C){return(t===this.xmin?1:t===this.xmax?2:0)|(C===this.ymin?4:C===this.ymax?8:0)}_regioncode(t,C){return(t<this.xmin?1:t>this.xmax?2:0)|(C<this.ymin?4:C>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let C=0;C<t.length;C+=2){const n=(C+2)%t.length,r=(C+4)%t.length;(t[C]===t[n]&&t[n]===t[r]||t[C+1]===t[n+1]&&t[n+1]===t[r+1])&&(t.splice(n,2),C-=2)}t.length||(t=null)}return t}}const Pt1=2*Math.PI,l9=Math.pow;function jt1(e){return e[0]}function It1(e){return e[1]}function At1(e){const{triangles:t,coords:C}=e;for(let n=0;n<t.length;n+=3){const r=2*t[n],i=2*t[n+1],o=2*t[n+2];if((C[o]-C[r])*(C[i+1]-C[r+1])-(C[i]-C[r])*(C[o+1]-C[r+1])>1e-10)return!1}return!0}function Nt1(e,t,C){return[e+Math.sin(e+t)*C,t+Math.cos(e-t)*C]}class yu{static from(t,C=jt1,n=It1,r){return new yu("length"in t?Dt1(t,C,n,r):Float64Array.from(Ft1(t,C,n,r)))}constructor(t){this._delaunator=new vC(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,C=this.points;if(t.hull&&t.hull.length>2&&At1(t)){this.collinear=Int32Array.from({length:C.length/2},(d,f)=>f).sort((d,f)=>C[2*d]-C[2*f]||C[2*d+1]-C[2*f+1]);const s=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[C[2*s],C[2*s+1],C[2*l],C[2*l+1]],u=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,f=C.length/2;d<f;++d){const v=Nt1(C[2*d],C[2*d+1],u);C[2*d]=v[0],C[2*d+1]=v[1]}this._delaunator=new vC(C)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let s=0,l=n.length;s<l;++s){const c=i[s%3===2?s-2:s+1];(n[s]===-1||o[c]===-1)&&(o[c]=s)}for(let s=0,l=r.length;s<l;++s)a[r[s]]=s;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Lt1(this,t)}*neighbors(t){const{inedges:C,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const u=a.indexOf(t);u>0&&(yield a[u-1]),u<a.length-1&&(yield a[u+1]);return}const s=C[t];if(s===-1)return;let l=s,c=-1;do{if(yield c=o[l],l=l%3===2?l-2:l+1,o[l]!==t)return;if(l=i[l],l===-1){const u=n[(r[t]+1)%n.length];u!==c&&(yield u);return}}while(l!==s)}find(t,C,n=0){if(t=+t,t!==t||(C=+C,C!==C))return-1;const r=n;let i;for(;(i=this._step(n,t,C))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,C,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,u=l9(C-l[t*2],2)+l9(n-l[t*2+1],2);const d=r[t];let f=d;do{let v=s[f];const g=l9(C-l[v*2],2)+l9(n-l[v*2+1],2);if(g<u&&(u=g,c=v),f=f%3===2?f-2:f+1,s[f]!==t)break;if(f=a[f],f===-1){if(f=i[(o[t]+1)%i.length],f!==v&&l9(C-l[f*2],2)+l9(n-l[f*2+1],2)<u)return f;break}}while(f!==d);return c}render(t){const C=t==null?t=new s8:void 0,{points:n,halfedges:r,triangles:i}=this;for(let o=0,a=r.length;o<a;++o){const s=r[o];if(s<o)continue;const l=i[o]*2,c=i[s]*2;t.moveTo(n[l],n[l+1]),t.lineTo(n[c],n[c+1])}return this.renderHull(t),C&&C.value()}renderPoints(t,C){C===void 0&&(!t||typeof t.moveTo!="function")&&(C=t,t=null),C=C==null?2:+C;const n=t==null?t=new s8:void 0,{points:r}=this;for(let i=0,o=r.length;i<o;i+=2){const a=r[i],s=r[i+1];t.moveTo(a+C,s),t.arc(a,s,C,0,Pt1)}return n&&n.value()}renderHull(t){const C=t==null?t=new s8:void 0,{hull:n,points:r}=this,i=n[0]*2,o=n.length;t.moveTo(r[i],r[i+1]);for(let a=1;a<o;++a){const s=2*n[a];t.lineTo(r[s],r[s+1])}return t.closePath(),C&&C.value()}hullPolygon(){const t=new Ha;return this.renderHull(t),t.value()}renderTriangle(t,C){const n=C==null?C=new s8:void 0,{points:r,triangles:i}=this,o=i[t*=3]*2,a=i[t+1]*2,s=i[t+2]*2;return C.moveTo(r[o],r[o+1]),C.lineTo(r[a],r[a+1]),C.lineTo(r[s],r[s+1]),C.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let C=0,n=t.length/3;C<n;++C)yield this.trianglePolygon(C)}trianglePolygon(t){const C=new Ha;return this.renderTriangle(t,C),C.value()}}function Dt1(e,t,C,n){const r=e.length,i=new Float64Array(r*2);for(let o=0;o<r;++o){const a=e[o];i[o*2]=t.call(n,a,o,e),i[o*2+1]=C.call(n,a,o,e)}return i}function*Ft1(e,t,C,n){let r=0;for(const i of e)yield t.call(n,i,r,e),yield C.call(n,i,r,e),++r}var xu=function(e){return[e.x,e.y]},Me=NS,I$="cursor",A$="top",zt1=function(e){var t=e.points,C=e.getNodePosition,n=C===void 0?xu:C,r=e.margin,i=r===void 0?Me:r;return t.map(function(o){var a=n(o),s=a[0],l=a[1];return[s+i.left,l+i.top]})},Bt1=function(e){var t=e.points,C=e.width,n=e.height,r=e.margin,i=r===void 0?Me:r,o=e.debug,a=yu.from(t),s=o?a.voronoi([0,0,i.left+C+i.right,i.top+n+i.bottom]):void 0;return{points:t,delaunay:a,voronoi:s}},wu=function(e){var t=e.points,C=e.getNodePosition,n=C===void 0?xu:C,r=e.width,i=e.height,o=e.margin,a=o===void 0?Me:o,s=e.debug;return $.useMemo(function(){return Bt1({points:zt1({points:t,margin:a,getNodePosition:n}),width:r,height:i,margin:a,debug:s})},[t,r,i,a,s])},Wt1=function(e){var t=e.elementRef,C=e.nodes,n=e.getNodePosition,r=n===void 0?xu:n,i=e.delaunay,o=e.setCurrent,a=e.margin,s=a===void 0?Me:a,l=e.detectionRadius,c=l===void 0?1/0:l,u=e.isInteractive,d=u===void 0||u,f=e.onMouseEnter,v=e.onMouseMove,g=e.onMouseLeave,h=e.onClick,m=e.onTouchStart,b=e.onTouchMove,x=e.onTouchEnd,S=e.enableTouchCrosshair,w=S!==void 0&&S,M=e.tooltip,_=e.tooltipPosition,E=_===void 0?I$:_,O=e.tooltipAnchor,T=O===void 0?A$:O,k=$.useState(null),A=k[0],V=k[1],R=$.useRef(null);$.useEffect(function(){R.current=A},[R,A]);var P=$.useCallback(function(J){if(!t.current)return null;var W=gu(t.current,J),U=W[0],Z=W[1],D=i.find(U,Z),n1=D!==void 0?C[D]:null;if(n1&&c!==1/0){var B=r(n1),r1=B[0],i1=B[1];r31(U,Z,r1+s.left,i1+s.top)>c&&(D=null,n1=null)}return D===null||n1===null?null:[D,n1]},[t,i,C,r,s,c]),L=a3(),H=L.showTooltipAt,I=L.showTooltipFromEvent,j=L.hideTooltip,N=$.useMemo(function(){if(M)return E==="cursor"?function(J,W){I(M(J),W,T)}:function(J){var W=r(J),U=W[0],Z=W[1];H(M(J),[U+s.left,Z+s.top],T)}},[H,I,M,E,T,r,s]),z=$.useCallback(function(J){var W=P(J);if(V(W),o==null||o(W?W[1]:null),W){var U=W[1];N==null||N(U,J),f==null||f(W[1],J)}},[P,V,o,N,f]),q=$.useCallback(function(J){var W=P(J);if(V(W),W){var U=W[0],Z=W[1];if(o==null||o(Z),N==null||N(Z,J),R.current){var D=R.current,n1=D[0],B=D[1];U!==n1?g==null||g(B,J):v==null||v(Z,J)}else f==null||f(Z,J)}else o==null||o(null),j==null||j(),R.current&&(g==null||g(R.current[1],J))},[P,V,R,f,v,g,N,j]),G=$.useCallback(function(J){V(null),o==null||o(null),j(),g&&R.current&&g(R.current[1],J)},[V,o,R,j,g]),Y=$.useCallback(function(J){var W=P(J);V(W),W&&(h==null||h(W[1],J))},[P,V,h]),e1=$.useCallback(function(J){var W=P(J);w&&(V(W),o==null||o(W?W[1]:null)),W&&(m==null||m(W[1],J))},[P,V,o,w,m]),Q=$.useCallback(function(J){var W=P(J);w&&(V(W),o==null||o(W?W[1]:null)),W&&(b==null||b(W[1],J))},[P,V,o,w,b]),K=$.useCallback(function(J){w&&(V(null),o==null||o(null)),x&&R.current&&x(R.current[1],J)},[w,V,o,x,R]);return{current:A,handleMouseEnter:d?z:void 0,handleMouseMove:d?q:void 0,handleMouseLeave:d?G:void 0,handleClick:d?Y:void 0,handleTouchStart:d?e1:void 0,handleTouchMove:d?Q:void 0,handleTouchEnd:d?K:void 0}},N$=function(e){var t=e.nodes,C=e.width,n=e.height,r=e.margin,i=r===void 0?Me:r,o=e.getNodePosition,a=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onClick,d=e.onTouchStart,f=e.onTouchMove,v=e.onTouchEnd,g=e.enableTouchCrosshair,h=g!==void 0&&g,m=e.detectionRadius,b=m===void 0?1/0:m,x=e.tooltip,S=e.tooltipPosition,w=S===void 0?I$:S,M=e.tooltipAnchor,_=M===void 0?A$:M,E=e.debug,O=$.useRef(null),T=wu({points:t,getNodePosition:o,width:C,height:n,margin:i,debug:E}),k=T.delaunay,A=T.voronoi,V=Wt1({elementRef:O,nodes:t,delaunay:k,margin:i,detectionRadius:b,setCurrent:a,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,onClick:u,onTouchStart:d,onTouchMove:f,onTouchEnd:v,enableTouchCrosshair:h,tooltip:x,tooltipPosition:w,tooltipAnchor:_}),R=V.current,P=V.handleMouseEnter,L=V.handleMouseMove,H=V.handleMouseLeave,I=V.handleClick,j=V.handleTouchStart,N=V.handleTouchMove,z=V.handleTouchEnd,q=$.useMemo(function(){if(E&&A)return A.render()},[E,A]);return p.jsxs("g",{ref:O,transform:"translate("+-i.left+","+-i.top+")",children:[E&&A&&p.jsxs(p.Fragment,{children:[p.jsx("path",{d:q,stroke:"red",strokeWidth:1,opacity:.75}),b<1/0&&p.jsx("path",{stroke:"red",strokeWidth:.35,fill:"none",d:k.renderPoints(void 0,b)}),R&&p.jsx("path",{fill:"pink",opacity:.35,d:A.renderCell(R[0])})]}),p.jsx("rect",{"data-ref":"mesh-interceptor",width:i.left+C+i.right,height:i.top+n+i.bottom,fill:"red",opacity:0,style:{cursor:"auto"},onMouseEnter:P,onMouseMove:L,onMouseLeave:H,onTouchStart:j,onTouchMove:N,onTouchEnd:z,onClick:I})]})},D$=function(e,t){e.save(),e.globalAlpha=.75,e.beginPath(),t.render(e),e.strokeStyle="red",e.lineWidth=1,e.stroke(),e.restore()},F$=function(e,t,C){e.save(),e.globalAlpha=.35,e.beginPath(),t.renderCell(C,e),e.fillStyle="pink",e.fill(),e.restore()};function O4(){return O4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},O4.apply(this,arguments)}function z$(e,t){if(e==null)return{};var C,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)C=i[n],t.indexOf(C)>=0||(r[C]=e[C]);return r}var Ut1=function(e){if(typeof e=="function")return e;if(M8(e))return function(){return e};if(function(C){return z7(C)}(e)){if(!mn(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=P8().domain([e.values[0],e.values[1]]).range([e.sizes[0],e.sizes[1]]);return function(C){return t(v2(C,e.key))}}throw new Error("nodeSize is invalid, it should be either a function, a number or an object")},B$=function(e){var t,C=e.data,n=e.xScaleSpec,r=e.xFormat,i=e.yScaleSpec,o=e.yFormat,a=e.width,s=e.height,l=e.nodeId,c=e.nodeSize,u=e.colors,d=$.useMemo(function(){return M$(C,n,i,a,s)},[C,n,i,a,s]),f=d.series,v=d.xScale,g=d.yScale,h=k7(r),m=k7(o),b=m3(l),x=$.useMemo(function(){return function(M){var _=M.series,E=M.formatX,O=M.formatY,T=M.getNodeId,k=[];return _.forEach(function(A){A.data.forEach(function(V,R){var P={index:k.length,serieIndex:R,serieId:A.id,x:V.position.x,xValue:V.data.x,formattedX:E(V.data.x),y:V.position.y,yValue:V.data.y,formattedY:O(V.data.y),data:V.data};k.push(O4({},P,{id:T(P)}))})}),k}({series:f,formatX:h,formatY:m,getNodeId:b})},[f,h,m,b]),S=$.useMemo(function(){return Ut1(t)},[t=c]),w=xe(u,"serieId");return{xScale:v,yScale:g,nodes:$.useMemo(function(){return x.map(function(M){return O4({},M,{size:S(M),color:w({serieId:M.serieId})})})},[x,S,w]),legendData:$.useMemo(function(){return f.map(function(M){return{id:M.id,label:M.id,color:w({serieId:M.id})}})},[f,w])}},W$=function(e,t){return ht1({data:e,annotations:t,getPosition:function(C){return{x:C.x,y:C.y}},getDimensions:function(C){return{size:C.size,width:C.size,height:C.size}}})},Zt1=function(e){return e/2},U$={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,C=e.style,n=e.blendMode,r=e.isInteractive,i=e.onMouseEnter,o=e.onMouseMove,a=e.onMouseLeave,s=e.onClick,l=$.useCallback(function(f){return i==null?void 0:i(t,f)},[t,i]),c=$.useCallback(function(f){return o==null?void 0:o(t,f)},[t,o]),u=$.useCallback(function(f){return a==null?void 0:a(t,f)},[t,a]),d=$.useCallback(function(f){return s==null?void 0:s(t,f)},[t,s]);return p.jsx(e5.circle,{cx:C.x,cy:C.y,r:C.size.to(Zt1),fill:C.color,style:{mixBlendMode:n},onMouseEnter:r?l:void 0,onMouseMove:r?c:void 0,onMouseLeave:r?u:void 0,onClick:r?d:void 0})},colors:{scheme:"nivo"},isInteractive:!0,debugMesh:!1,tooltip:function(e){var t=e.node;return p.jsx(P9,{id:t.serieId,value:"x: "+t.formattedX+", y: "+t.formattedY,enableChip:!0,color:t.color})},markers:[],legends:[],annotations:[]},h2=O4({},U$,{blendMode:"normal",layers:["grid","axes","nodes","markers","mesh","legends","annotations"],role:"img",useMesh:!0,animate:!0,motionConfig:"default"}),t4=O4({},U$,{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()}}),qt1=function(e){var t=e.nodes,C=e.annotations,n=W$(t,C);return p.jsx(p.Fragment,{children:n.map(function(r,i){return p.jsx(yt1,O4({},r),i)})})},Gt1=function(e){return e.id},Si=function(e){return{x:e.x,y:e.y,size:e.size,color:e.color}},Yt1=function(e){return{x:e.x,y:e.y,size:0,color:e.color}},Kt1=function(e){var t=e.nodes,C=e.nodeComponent,n=e.isInteractive,r=e.onMouseEnter,i=e.onMouseMove,o=e.onMouseLeave,a=e.onClick,s=e.tooltip,l=e.blendMode,c=A2(),u=c.animate,d=c.config,f=p4(t,{keys:Gt1,from:Si,enter:Si,update:Si,leave:Yt1,config:d,immediate:!u}),v=a3(),g=v.showTooltipFromEvent,h=v.hideTooltip,m=$.useCallback(function(w,M){g($.createElement(s,{node:w}),M),r==null||r(w,M)},[s,g,r]),b=$.useCallback(function(w,M){g($.createElement(s,{node:w}),M),i==null||i(w,M)},[s,g,i]),x=$.useCallback(function(w,M){h(),o==null||o(w,M)},[h,o]),S=$.useCallback(function(w,M){return a==null?void 0:a(w,M)},[a]);return p.jsx(p.Fragment,{children:f(function(w,M){return $.createElement(C,{node:M,style:w,blendMode:l,isInteractive:n,onMouseEnter:n?m:void 0,onMouseMove:n?b:void 0,onMouseLeave:n?x:void 0,onClick:n?S:void 0})})})},Xt1=function(e){var t=e.nodes,C=e.width,n=e.height,r=e.onMouseEnter,i=e.onMouseMove,o=e.onMouseLeave,a=e.onClick,s=e.tooltip,l=e.debug,c=a3(),u=c.showTooltipFromEvent,d=c.hideTooltip,f=$.useCallback(function(m,b){u($.createElement(s,{node:m}),b),r&&r(m,b)},[u,s,r]),v=$.useCallback(function(m,b){u($.createElement(s,{node:m}),b),i&&i(m,b)},[u,s,i]),g=$.useCallback(function(m,b){d(),o&&o(m,b)},[d,o]),h=$.useCallback(function(m,b){a&&a(m,b)},[a]);return p.jsx(N$,{nodes:t,width:C,height:n,onMouseEnter:f,onMouseMove:v,onMouseLeave:g,onClick:h,debug:l})},Qt1=["isInteractive","animate","motionConfig","theme","renderWrapper"],Jt1=function(e){var t=e.data,C=e.xScale,n=C===void 0?h2.xScale:C,r=e.xFormat,i=e.yScale,o=i===void 0?h2.yScale:i,a=e.yFormat,s=e.width,l=e.height,c=e.margin,u=e.layers,d=u===void 0?h2.layers:u,f=e.colors,v=f===void 0?h2.colors:f,g=e.blendMode,h=g===void 0?h2.blendMode:g,m=e.nodeId,b=m===void 0?h2.nodeId:m,x=e.nodeSize,S=x===void 0?h2.nodeSize:x,w=e.nodeComponent,M=w===void 0?h2.nodeComponent:w,_=e.enableGridX,E=_===void 0?h2.enableGridX:_,O=e.enableGridY,T=O===void 0?h2.enableGridY:O,k=e.gridXValues,A=e.gridYValues,V=e.axisTop,R=e.axisRight,P=e.axisBottom,L=P===void 0?h2.axisBottom:P,H=e.axisLeft,I=H===void 0?h2.axisLeft:H,j=e.annotations,N=j===void 0?h2.annotations:j,z=e.isInteractive,q=z===void 0?h2.isInteractive:z,G=e.useMesh,Y=G===void 0?h2.useMesh:G,e1=e.debugMesh,Q=e1===void 0?h2.debugMesh:e1,K=e.onMouseEnter,J=e.onMouseMove,W=e.onMouseLeave,U=e.onClick,Z=e.tooltip,D=Z===void 0?h2.tooltip:Z,n1=e.markers,B=n1===void 0?h2.markers:n1,r1=e.legends,i1=r1===void 0?h2.legends:r1,g1=e.role,y1=g1===void 0?h2.role:g1,m1=e.ariaLabel,b1=e.ariaLabelledBy,S1=e.ariaDescribedBy,v1=z8(s,l,c),h1=v1.margin,l1=v1.innerWidth,$1=v1.innerHeight,f1=v1.outerWidth,A1=v1.outerHeight,I1=B$({data:t,xScaleSpec:n,xFormat:r,yScaleSpec:o,yFormat:a,width:l1,height:$1,nodeId:b,nodeSize:S,colors:v}),R1=I1.xScale,k1=I1.yScale,Y1=I1.nodes,X1=I1.legendData,D1=$.useMemo(function(){return{xScale:R1,yScale:k1,nodes:Y1,margin:h1,innerWidth:l1,innerHeight:$1,outerWidth:f1,outerHeight:A1}},[R1,k1,Y1,h1,l1,$1,f1,A1]),L1={grid:null,axes:null,nodes:null,markers:null,mesh:null,annotations:null,legends:null};return d.includes("grid")&&(L1.grid=p.jsx(L$,{width:l1,height:$1,xScale:E?R1:null,yScale:T?k1:null,xValues:k,yValues:A},"grid")),d.includes("axes")&&(L1.axes=p.jsx(k$,{xScale:R1,yScale:k1,width:l1,height:$1,top:V,right:R,bottom:L,left:I},"axes")),d.includes("nodes")&&(L1.nodes=p.jsx(Kt1,{nodes:Y1,nodeComponent:M,isInteractive:q,tooltip:D,blendMode:h,onMouseEnter:K,onMouseMove:J,onMouseLeave:W,onClick:U},"nodes")),d.includes("markers")&&(L1.markers=p.jsx(QS,{markers:B,width:l1,height:$1,xScale:R1,yScale:k1},"markers")),d.includes("mesh")&&q&&Y&&(L1.mesh=p.jsx(Xt1,{nodes:Y1,width:l1,height:$1,onMouseEnter:K,onMouseMove:J,onMouseLeave:W,onClick:U,tooltip:D,debug:Q},"mesh")),d.includes("annotations")&&(L1.annotations=p.jsx(qt1,{nodes:Y1,annotations:N},"annotations")),d.includes("legends")&&(L1.legends=i1.map(function(Q1,U1){return p.jsx(Rn,O4({},Q1,{containerWidth:l1,containerHeight:$1,data:X1}),U1)})),p.jsx(x6,{width:f1,height:A1,margin:h1,role:y1,ariaLabel:m1,ariaLabelledBy:b1,ariaDescribedBy:S1,children:d.map(function(Q1,U1){if(typeof Q1=="string"&&L1[Q1]!==void 0)return L1[Q1];if(typeof Q1=="function")return p.jsx($.Fragment,{children:$.createElement(Q1,D1)},U1);throw new Error("Unknown layer ("+Q1+")")})})},eC1=function(e){var t=e.isInteractive,C=t===void 0?h2.isInteractive:t,n=e.animate,r=n===void 0?h2.animate:n,i=e.motionConfig,o=i===void 0?h2.motionConfig:i,a=e.theme,s=e.renderWrapper,l=z$(e,Qt1);return p.jsx(B8,{animate:r,isInteractive:C,motionConfig:o,renderWrapper:s,theme:a,children:p.jsx(Jt1,O4({isInteractive:C},l))})},Z$=function(e){return p.jsx(W7,{children:function(t){var C=t.width,n=t.height;return p.jsx(eC1,O4({width:C,height:n},e))}})},tC1=["isInteractive","renderWrapper","theme"],CC1=function(e){var t=e.data,C=e.xScale,n=C===void 0?t4.xScale:C,r=e.xFormat,i=e.yScale,o=i===void 0?t4.yScale:i,a=e.yFormat,s=e.width,l=e.height,c=e.margin,u=e.pixelRatio,d=u===void 0?t4.pixelRatio:u,f=e.layers,v=f===void 0?t4.layers:f,g=e.colors,h=g===void 0?t4.colors:g,m=e.nodeId,b=m===void 0?h2.nodeId:m,x=e.nodeSize,S=x===void 0?t4.nodeSize:x,w=e.renderNode,M=w===void 0?t4.renderNode:w,_=e.enableGridX,E=_===void 0?t4.enableGridX:_,O=e.gridXValues,T=e.enableGridY,k=T===void 0?t4.enableGridY:T,A=e.gridYValues,V=e.axisTop,R=e.axisRight,P=e.axisBottom,L=P===void 0?t4.axisBottom:P,H=e.axisLeft,I=H===void 0?t4.axisLeft:H,j=e.annotations,N=j===void 0?t4.annotations:j,z=e.isInteractive,q=z===void 0?t4.isInteractive:z,G=e.debugMesh,Y=G===void 0?t4.debugMesh:G,e1=e.onMouseEnter,Q=e.onMouseMove,K=e.onMouseLeave,J=e.onClick,W=e.tooltip,U=W===void 0?t4.tooltip:W,Z=e.legends,D=Z===void 0?t4.legends:Z,n1=e.canvasRef,B=$.useRef(null),r1=W5(),i1=$.useState(null),g1=i1[0],y1=i1[1],m1=z8(s,l,c),b1=m1.margin,S1=m1.innerWidth,v1=m1.innerHeight,h1=m1.outerWidth,l1=m1.outerHeight,$1=B$({data:t,xScaleSpec:n,xFormat:r,yScaleSpec:o,yFormat:a,width:S1,height:v1,nodeId:b,nodeSize:S,colors:h}),f1=$1.xScale,A1=$1.yScale,I1=$1.nodes,R1=$1.legendData,k1=W$(I1,N),Y1=wu({points:I1,width:S1,height:v1,debug:Y}),X1=Y1.delaunay,D1=Y1.voronoi,L1=$.useMemo(function(){return{xScale:f1,yScale:A1,nodes:I1,margin:b1,innerWidth:S1,innerHeight:v1,outerWidth:h1,outerHeight:l1}},[f1,A1,I1,b1,S1,v1,h1,l1]);$.useEffect(function(){if(B.current){B.current.width=h1*d,B.current.height=l1*d;var N1=B.current.getContext("2d");N1.scale(d,d),N1.fillStyle=r1.background,N1.fillRect(0,0,h1,l1),N1.translate(b1.left,b1.top),v.forEach(function(z1){if(z1==="grid")N1.lineWidth=r1.grid.line.strokeWidth,N1.strokeStyle=r1.grid.line.stroke,E&&gC(N1,{width:S1,height:v1,scale:f1,axis:"x",values:O}),k&&gC(N1,{width:S1,height:v1,scale:A1,axis:"y",values:A});else if(z1==="annotations")xt1(N1,{annotations:k1,theme:r1});else if(z1==="axes")P$(N1,{xScale:f1,yScale:A1,width:S1,height:v1,top:V,right:R,bottom:L,left:I,theme:r1});else if(z1==="nodes")I1.forEach(function(F1){M(N1,F1)});else if(z1==="mesh")Y&&(D$(N1,D1),g1&&F$(N1,D1,g1.index));else if(z1==="legends")D.forEach(function(F1){o$(N1,O4({},F1,{data:R1,containerWidth:S1,containerHeight:v1,theme:r1}))});else{if(typeof z1!="function")throw new Error("Invalid layer: "+z1);z1(N1,L1)}})}},[B,S1,v1,h1,l1,b1.top,b1.left,d,M,v,L1,r1,f1,A1,I1,E,k,V,R,L,I,D,R1,Y,D1,g1,k1]);var Q1=a3(),U1=Q1.showTooltipFromEvent,q1=Q1.hideTooltip,u1=$.useCallback(function(N1){var z1=gu(B.current,N1),F1=z1[0],J1=z1[1];if(!e$(b1.left,b1.top,S1,v1,F1,J1))return null;var t5=X1.find(F1-b1.left,J1-b1.top);return I1[t5]},[B,b1,S1,v1,X1]),_1=$.useCallback(function(N1){var z1=u1(N1);y1(z1),z1?(U1($.createElement(U,{node:z1}),N1),g1&&g1.id!==z1.id&&(K&&K(g1,N1),e1&&e1(z1,N1)),g1||e1&&e1(z1,N1),Q&&Q(z1,N1)):(q1(),g1&&K&&K(g1,N1))},[u1,g1,y1,U1,q1,U,e1,Q,K]),K1=$.useCallback(function(N1){q1(),y1(null),g1&&K&&K(g1,N1)},[q1,g1,y1,K]),C5=$.useCallback(function(N1){if(J){var z1=u1(N1);z1&&J(z1,N1)}},[u1,J]);return p.jsx("canvas",{ref:function(N1){B.current=N1,n1&&"current"in n1&&(n1.current=N1)},width:h1*d,height:l1*d,style:{width:h1,height:l1,cursor:q?"auto":"normal"},onMouseEnter:q?_1:void 0,onMouseMove:q?_1:void 0,onMouseLeave:q?K1:void 0,onClick:q?C5:void 0})},nC1=$.forwardRef(function(e,t){var C=e.isInteractive,n=e.renderWrapper,r=e.theme,i=z$(e,tC1);return p.jsx(B8,{isInteractive:C,renderWrapper:n,theme:r,animate:!1,children:p.jsx(CC1,O4({},i,{canvasRef:t}))})});$.forwardRef(function(e,t){return p.jsx(W7,{children:function(C){var n=C.width,r=C.height;return p.jsx(nC1,O4({width:n,height:r},e,{ref:t}))}})});const rC1=({x1:e,x2:t,y1:C,y2:n})=>p.jsx("g",{children:p.jsx("line",{x1:e,y1:C,x2:t,y2:n,stroke:"red",strokeWidth:"3"})}),iC1=({scatterPlotData:e,style:t={},margin:C={},axisBottom:n={},axisLeft:r={},tooltip:i=null})=>{const o=e==null?void 0:e.line,a=o==null?void 0:o.x1,s=o==null?void 0:o.y1,l=o==null?void 0:o.x2,c=o==null?void 0:o.y2;return p.jsxs(p.Fragment,{children:[p.jsx(S2,{}),p.jsx("div",{style:{width:"100%",height:600,...t},children:p.jsx(Z$,{data:[e==null?void 0:e.points],margin:{top:20,right:120,bottom:100,left:120,...C},xScale:{type:"point"},axisBottom:{orient:"bottom",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:46,truncateTickAt:0,legend:"axisBottom",...n},axisLeft:{orient:"left",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:-60,truncateTickAt:0,legend:"axisLeft",...r},layers:["grid","markers","axes","nodes","legends",u=>p.jsx(rC1,{x1:u.xScale(a),y1:u.yScale(s),x2:u.xScale(l),y2:u.yScale(c)})],tooltip:({node:u})=>p.jsx(f4,{body:(i==null?void 0:i({node:u}))||p.jsx("span",{children:"Scatterplot tooltip"})})})})]})};function oC1(e,t,C,n){var r=-1,i=e==null?0:e.length;for(n&&i&&(C=e[++r]);++r<i;)C=t(C,e[r],r,e);return C}var aC1=oC1;function sC1(e){return function(t){return e==null?void 0:e[t]}}var lC1=sC1,cC1=lC1,uC1={À:"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"},dC1=cC1(uC1),fC1=dC1,hC1=fC1,gC1=he,vC1=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mC1="\\u0300-\\u036f",pC1="\\ufe20-\\ufe2f",bC1="\\u20d0-\\u20ff",yC1=mC1+pC1+bC1,xC1="["+yC1+"]",wC1=RegExp(xC1,"g");function SC1(e){return e=gC1(e),e&&e.replace(vC1,hC1).replace(wC1,"")}var $C1=SC1,MC1=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function EC1(e){return e.match(MC1)||[]}var _C1=EC1,OC1=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function VC1(e){return OC1.test(e)}var TC1=VC1,q$="\\ud800-\\udfff",RC1="\\u0300-\\u036f",HC1="\\ufe20-\\ufe2f",kC1="\\u20d0-\\u20ff",LC1=RC1+HC1+kC1,G$="\\u2700-\\u27bf",Y$="a-z\\xdf-\\xf6\\xf8-\\xff",PC1="\\xac\\xb1\\xd7\\xf7",jC1="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",IC1="\\u2000-\\u206f",AC1=" \\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",K$="A-Z\\xc0-\\xd6\\xd8-\\xde",NC1="\\ufe0e\\ufe0f",X$=PC1+jC1+IC1+AC1,Q$="['’]",im="["+X$+"]",DC1="["+LC1+"]",J$="\\d+",FC1="["+G$+"]",eM="["+Y$+"]",tM="[^"+q$+X$+J$+G$+Y$+K$+"]",zC1="\\ud83c[\\udffb-\\udfff]",BC1="(?:"+DC1+"|"+zC1+")",WC1="[^"+q$+"]",CM="(?:\\ud83c[\\udde6-\\uddff]){2}",nM="[\\ud800-\\udbff][\\udc00-\\udfff]",f9="["+K$+"]",UC1="\\u200d",om="(?:"+eM+"|"+tM+")",ZC1="(?:"+f9+"|"+tM+")",am="(?:"+Q$+"(?:d|ll|m|re|s|t|ve))?",sm="(?:"+Q$+"(?:D|LL|M|RE|S|T|VE))?",rM=BC1+"?",iM="["+NC1+"]?",qC1="(?:"+UC1+"(?:"+[WC1,CM,nM].join("|")+")"+iM+rM+")*",GC1="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",YC1="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",KC1=iM+rM+qC1,XC1="(?:"+[FC1,CM,nM].join("|")+")"+KC1,QC1=RegExp([f9+"?"+eM+"+"+am+"(?="+[im,f9,"$"].join("|")+")",ZC1+"+"+sm+"(?="+[im,f9+om,"$"].join("|")+")",f9+"?"+om+"+"+am,f9+"+"+sm,YC1,GC1,J$,XC1].join("|"),"g");function JC1(e){return e.match(QC1)||[]}var en1=JC1,tn1=_C1,Cn1=TC1,nn1=he,rn1=en1;function in1(e,t,C){return e=nn1(e),t=C?void 0:t,t===void 0?Cn1(e)?rn1(e):tn1(e):e.match(t)||[]}var on1=in1,an1=aC1,sn1=$C1,ln1=on1,cn1="['’]",un1=RegExp(cn1,"g");function dn1(e){return function(t){return an1(ln1(sn1(t).replace(un1,"")),e,"")}}var fn1=dn1,hn1=j$;function gn1(e,t,C){var n=e.length;return C=C===void 0?n:C,!t&&C>=n?e:hn1(e,t,C)}var vn1=gn1,mn1="\\ud800-\\udfff",pn1="\\u0300-\\u036f",bn1="\\ufe20-\\ufe2f",yn1="\\u20d0-\\u20ff",xn1=pn1+bn1+yn1,wn1="\\ufe0e\\ufe0f",Sn1="\\u200d",$n1=RegExp("["+Sn1+mn1+xn1+wn1+"]");function Mn1(e){return $n1.test(e)}var oM=Mn1;function En1(e){return e.split("")}var _n1=En1,aM="\\ud800-\\udfff",On1="\\u0300-\\u036f",Vn1="\\ufe20-\\ufe2f",Tn1="\\u20d0-\\u20ff",Rn1=On1+Vn1+Tn1,Hn1="\\ufe0e\\ufe0f",kn1="["+aM+"]",ka="["+Rn1+"]",La="\\ud83c[\\udffb-\\udfff]",Ln1="(?:"+ka+"|"+La+")",sM="[^"+aM+"]",lM="(?:\\ud83c[\\udde6-\\uddff]){2}",cM="[\\ud800-\\udbff][\\udc00-\\udfff]",Pn1="\\u200d",uM=Ln1+"?",dM="["+Hn1+"]?",jn1="(?:"+Pn1+"(?:"+[sM,lM,cM].join("|")+")"+dM+uM+")*",In1=dM+uM+jn1,An1="(?:"+[sM+ka+"?",ka,lM,cM,kn1].join("|")+")",Nn1=RegExp(La+"(?="+La+")|"+An1+In1,"g");function Dn1(e){return e.match(Nn1)||[]}var Fn1=Dn1,zn1=_n1,Bn1=oM,Wn1=Fn1;function Un1(e){return Bn1(e)?Wn1(e):zn1(e)}var Zn1=Un1,qn1=vn1,Gn1=oM,Yn1=Zn1,Kn1=he;function Xn1(e){return function(t){t=Kn1(t);var C=Gn1(t)?Yn1(t):void 0,n=C?C[0]:t.charAt(0),r=C?qn1(C,1).join(""):t.slice(1);return n[e]()+r}}var Qn1=Xn1,Jn1=Qn1,er1=Jn1("toUpperCase"),tr1=er1,Cr1=fn1,nr1=tr1,rr1=Cr1(function(e,t,C){return e+(C?" ":"")+nr1(t)}),ir1=rr1;const or1=p2(ir1);function ar1(e){var t=0,C=e.children,n=C&&C.length;if(!n)t=1;else for(;--n>=0;)t+=C[n].value;e.value=t}function sr1(){return this.eachAfter(ar1)}function lr1(e){var t=this,C,n=[t],r,i,o;do for(C=n.reverse(),n=[];t=C.pop();)if(e(t),r=t.children,r)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length);return this}function cr1(e){for(var t=this,C=[t],n,r;t=C.pop();)if(e(t),n=t.children,n)for(r=n.length-1;r>=0;--r)C.push(n[r]);return this}function ur1(e){for(var t=this,C=[t],n=[],r,i,o;t=C.pop();)if(n.push(t),r=t.children,r)for(i=0,o=r.length;i<o;++i)C.push(r[i]);for(;t=n.pop();)e(t);return this}function dr1(e){return this.eachAfter(function(t){for(var C=+e(t.data)||0,n=t.children,r=n&&n.length;--r>=0;)C+=n[r].value;t.value=C})}function fr1(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function hr1(e){for(var t=this,C=gr1(t,e),n=[t];t!==C;)t=t.parent,n.push(t);for(var r=n.length;e!==C;)n.splice(r,0,e),e=e.parent;return n}function gr1(e,t){if(e===t)return e;var C=e.ancestors(),n=t.ancestors(),r=null;for(e=C.pop(),t=n.pop();e===t;)r=e,e=C.pop(),t=n.pop();return r}function vr1(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function mr1(){var e=[];return this.each(function(t){e.push(t)}),e}function pr1(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function br1(){var e=this,t=[];return e.each(function(C){C!==e&&t.push({source:C.parent,target:C})}),t}function Su(e,t){var C=new mC(e),n=+e.value&&(C.value=e.value),r,i=[C],o,a,s,l;for(t==null&&(t=xr1);r=i.pop();)if(n&&(r.value=+r.data.value),(a=t(r.data))&&(l=a.length))for(r.children=new Array(l),s=l-1;s>=0;--s)i.push(o=r.children[s]=new mC(a[s])),o.parent=r,o.depth=r.depth+1;return C.eachBefore(Sr1)}function yr1(){return Su(this).eachBefore(wr1)}function xr1(e){return e.children}function wr1(e){e.data=e.data.data}function Sr1(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function mC(e){this.data=e,this.depth=this.height=0,this.parent=null}mC.prototype=Su.prototype={constructor:mC,count:sr1,each:lr1,eachAfter:ur1,eachBefore:cr1,sum:dr1,sort:fr1,path:hr1,ancestors:vr1,descendants:mr1,leaves:pr1,links:br1,copy:yr1};function $r1(e){if(typeof e!="function")throw new Error;return e}function Z6(){return 0}function q6(e){return function(){return e}}function Mr1(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 $u(e,t,C,n,r){for(var i=e.children,o,a=-1,s=i.length,l=e.value&&(n-t)/e.value;++a<s;)o=i[a],o.y0=C,o.y1=r,o.x0=t,o.x1=t+=o.value*l}function Mu(e,t,C,n,r){for(var i=e.children,o,a=-1,s=i.length,l=e.value&&(r-C)/e.value;++a<s;)o=i[a],o.x0=t,o.x1=n,o.y0=C,o.y1=C+=o.value*l}var Er1=(1+Math.sqrt(5))/2;function _r1(e,t,C,n,r,i){for(var o=[],a=t.children,s,l,c=0,u=0,d=a.length,f,v,g=t.value,h,m,b,x,S,w,M;c<d;){f=r-C,v=i-n;do h=a[u++].value;while(!h&&u<d);for(m=b=h,w=Math.max(v/f,f/v)/(g*e),M=h*h*w,S=Math.max(b/M,M/m);u<d;++u){if(h+=l=a[u].value,l<m&&(m=l),l>b&&(b=l),M=h*h*w,x=Math.max(b/M,M/m),x>S){h-=l;break}S=x}o.push(s={value:h,dice:f<v,children:a.slice(c,u)}),s.dice?$u(s,C,n,r,g?n+=v*h/g:i):Mu(s,C,n,g?C+=f*h/g:r,i),g-=h,c=u}return o}const fM=function e(t){function C(n,r,i,o,a){_r1(t,n,r,i,o,a)}return C.ratio=function(n){return e((n=+n)>1?n:1)},C}(Er1);function Or1(){var e=fM,t=!1,C=1,n=1,r=[0],i=Z6,o=Z6,a=Z6,s=Z6,l=Z6;function c(d){return d.x0=d.y0=0,d.x1=C,d.y1=n,d.eachBefore(u),r=[0],t&&d.eachBefore(Mr1),d}function u(d){var f=r[d.depth],v=d.x0+f,g=d.y0+f,h=d.x1-f,m=d.y1-f;h<v&&(v=h=(v+h)/2),m<g&&(g=m=(g+m)/2),d.x0=v,d.y0=g,d.x1=h,d.y1=m,d.children&&(f=r[d.depth+1]=i(d)/2,v+=l(d)-f,g+=o(d)-f,h-=a(d)-f,m-=s(d)-f,h<v&&(v=h=(v+h)/2),m<g&&(g=m=(g+m)/2),e(d,v,g,h,m))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(C=+d[0],n=+d[1],c):[C,n]},c.tile=function(d){return arguments.length?(e=$r1(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(i=typeof d=="function"?d:q6(+d),c):i},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(o=typeof d=="function"?d:q6(+d),c):o},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:q6(+d),c):a},c.paddingBottom=function(d){return arguments.length?(s=typeof d=="function"?d:q6(+d),c):s},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:q6(+d),c):l},c}function Vr1(e,t,C,n,r){var i=e.children,o,a=i.length,s,l=new Array(a+1);for(l[0]=s=o=0;o<a;++o)l[o+1]=s+=i[o].value;c(0,a,e.value,t,C,n,r);function c(u,d,f,v,g,h,m){if(u>=d-1){var b=i[u];b.x0=v,b.y0=g,b.x1=h,b.y1=m;return}for(var x=l[u],S=f/2+x,w=u+1,M=d-1;w<M;){var _=w+M>>>1;l[_]<S?w=_+1:M=_}S-l[w-1]<l[w]-S&&u+1<w&&--w;var E=l[w]-x,O=f-E;if(h-v>m-g){var T=(v*O+h*E)/f;c(u,w,E,v,g,T,m),c(w,d,O,T,g,h,m)}else{var k=(g*O+m*E)/f;c(u,w,E,v,g,h,k),c(w,d,O,v,k,h,m)}}}function Tr1(e,t,C,n,r){(e.depth&1?Mu:$u)(e,t,C,n,r)}function V4(){return V4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},V4.apply(this,arguments)}function Rr1(e,t){if(e==null)return{};var C,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)C=i[n],t.indexOf(C)>=0||(r[C]=e[C]);return r}var Hr1=function(e,t){return O2([e,t],function(C,n){return"translate("+C+","+n+")"})},kr1=function(e,t){return O2([e,t],function(C,n){return"translate("+C+"px, "+n+"px)"})},lm=function(e,t,C){return O2([e,t,C],function(n,r,i){return"translate("+n+","+r+") rotate("+i+")"})},Lr1=function(e,t,C){return O2([e,t,C],function(n,r,i){return"translate("+n+"px,"+r+"px) rotate("+i+"deg)"})},Pr1=function(e,t,C){return O2([e,t,C],function(n,r,i){return"translate("+(n-(i===0?0:5))+"px,"+(r-(i===0?5:0))+"px) rotate("+i+"deg)"})},jr1=$.memo(function(e){var t=e.node,C=e.animatedProps,n=e.borderWidth,r=e.enableLabel,i=e.enableParentLabel,o=e.labelSkipSize,a=W5(),s=r&&t.isLeaf&&(o===0||Math.min(t.width,t.height)>o),l=i&&t.isParent;return p.jsxs(e5.g,{transform:Hr1(C.x,C.y),children:[p.jsx(e5.rect,{"data-testid":"node."+t.id,width:O2(C.width,function(c){return Math.max(c,0)}),height:O2(C.height,function(c){return Math.max(c,0)}),fill:t.fill?t.fill:C.color,strokeWidth:n,stroke:t.borderColor,fillOpacity:t.opacity,onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),s&&p.jsx(e5.text,{"data-testid":"label."+t.id,textAnchor:"middle",dominantBaseline:"central",style:V4({},a.labels.text,{fill:t.labelTextColor,pointerEvents:"none"}),fillOpacity:C.labelOpacity,transform:lm(C.labelX,C.labelY,C.labelRotation),children:t.label}),l&&p.jsx(e5.text,{"data-testid":"parentLabel."+t.id,dominantBaseline:"central",style:V4({},a.labels.text,{fill:t.parentLabelTextColor,pointerEvents:"none"}),fillOpacity:C.parentLabelOpacity,transform:lm(C.parentLabelX,C.parentLabelY,C.parentLabelRotation),children:t.parentLabel})]})}),Ir1=$.memo(function(e){var t=e.node;return p.jsx(P9,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})}),Ar1=$.memo(function(e){var t=e.node,C=e.animatedProps,n=e.borderWidth,r=e.enableLabel,i=e.enableParentLabel,o=e.labelSkipSize,a=W5(),s=r&&t.isLeaf&&(o===0||Math.min(t.width,t.height)>o),l=i&&t.isParent;return p.jsxs(e5.div,{"data-testid":"node."+t.id,id:t.path.replace(/[^\w]/gi,"-"),style:{boxSizing:"border-box",position:"absolute",top:0,left:0,transform:kr1(C.x,C.y),width:C.width,height:C.height,borderWidth:n,borderStyle:"solid",borderColor:t.borderColor,overflow:"hidden"},children:[p.jsx(e5.div,{style:{boxSizing:"border-box",position:"absolute",top:0,left:0,opacity:t.opacity,width:C.width,height:C.height,background:C.color},onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),s&&p.jsx(e5.span,{"data-testid":"label."+t.id,style:V4({},a.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:Lr1(C.labelX,C.labelY,C.labelRotation),opacity:C.labelOpacity,pointerEvents:"none"}),children:t.label}),l&&p.jsx(e5.span,{"data-testid":"parentLabel."+t.id,style:V4({},a.labels.text,{position:"absolute",display:"flex",justifyContent:"flex-start",alignItems:"center",whiteSpace:"nowrap",width:10,height:10,color:t.parentLabelTextColor,transformOrigin:"top left",transform:Pr1(C.parentLabelX,C.parentLabelY,C.parentLabelRotation),opacity:C.parentLabelOpacity,pointerEvents:"none"}),children:t.parentLabel})]})}),x2={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:Ir1,role:"img",animate:!0,motionConfig:"gentle"},U5=V4({},x2,{nodeComponent:jr1,defs:[],fill:[]});V4({},x2,{nodeComponent:Ar1});V4({},x2,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var Nr1={binary:Vr1,dice:$u,slice:Mu,sliceDice:Tr1,squarify:fM},Dr1=function(e){var t=e.root,C=e.getValue;return $.useMemo(function(){return Su(t).sum(C)},[t,C])},Fr1=function(e){var t=e.data,C=e.width,n=e.height,r=e.identity,i=r===void 0?x2.identity:r,o=e.value,a=o===void 0?x2.value:o,s=e.valueFormat,l=e.leavesOnly,c=l===void 0?x2.leavesOnly:l,u=e.tile,d=u===void 0?x2.tile:u,f=e.innerPadding,v=f===void 0?x2.innerPadding:f,g=e.outerPadding,h=g===void 0?x2.outerPadding:g,m=e.label,b=m===void 0?x2.label:m,x=e.orientLabel,S=x===void 0?x2.orientLabel:x,w=e.enableParentLabel,M=w===void 0?x2.enableParentLabel:w,_=e.parentLabel,E=_===void 0?x2.parentLabel:_,O=e.parentLabelSize,T=O===void 0?x2.parentLabelSize:O,k=e.parentLabelPosition,A=k===void 0?x2.parentLabelPosition:k,V=e.parentLabelPadding,R=V===void 0?x2.parentLabelPadding:V,P=e.colors,L=P===void 0?x2.colors:P,H=e.colorBy,I=H===void 0?x2.colorBy:H,j=e.nodeOpacity,N=j===void 0?x2.nodeOpacity:j,z=e.borderColor,q=z===void 0?x2.borderColor:z,G=e.labelTextColor,Y=G===void 0?x2.labelTextColor:G,e1=e.parentLabelTextColor,Q=e1===void 0?x2.parentLabelTextColor:e1,K=m3(i),J=m3(a),W=k7(s),U=m3(b),Z=m3(E),D=function(v1){var h1=v1.width,l1=v1.height,$1=v1.tile,f1=v1.innerPadding,A1=v1.outerPadding,I1=v1.enableParentLabel,R1=v1.parentLabelSize,k1=v1.parentLabelPosition,Y1=v1.leavesOnly;return $.useMemo(function(){var X1=Or1().size([h1,l1]).tile(Nr1[$1]).round(!0).paddingInner(f1).paddingOuter(A1);if(I1&&!Y1){var D1=R1+2*A1;X1["padding"+or1(k1)](D1)}return X1},[h1,l1,$1,f1,A1,I1,R1,k1,Y1])}({width:C,height:n,tile:d,innerPadding:v,outerPadding:h,enableParentLabel:M,parentLabelSize:T,parentLabelPosition:A,leavesOnly:c}),n1=Dr1({root:t,getValue:J}),B=$.useMemo(function(){var v1=h$(n1);return D(v1),c?v1.leaves():v1.descendants()},[n1,D,c]),r1=$.useMemo(function(){return B.map(function(v1){var h1=function(A1,I1){var R1=A1.ancestors().map(function(k1){return I1(k1.data)}).reverse();return{path:R1.join("."),pathComponents:R1}}(v1,K),l1=h1.path,$1=h1.pathComponents,f1={id:K(v1.data),path:l1,pathComponents:$1,data:Z8(v1.data,"children"),x:v1.x0,y:v1.y0,width:v1.x1-v1.x0,height:v1.y1-v1.y0,value:v1.value,formattedValue:W(v1.value),treeDepth:v1.depth,treeHeight:v1.height,isParent:v1.height>0,isLeaf:v1.height===0,parentLabelX:0,parentLabelY:0,parentLabelRotation:0};return f1.labelRotation=S&&f1.height>f1.width?-90:0,A==="top"&&(f1.parentLabelX=h+R,f1.parentLabelY=h+T/2),A==="right"&&(f1.parentLabelX=f1.width-h-T/2,f1.parentLabelY=f1.height-h-R,f1.parentLabelRotation=-90),A==="bottom"&&(f1.parentLabelX=h+R,f1.parentLabelY=f1.height-h-T/2),A==="left"&&(f1.parentLabelX=h+T/2,f1.parentLabelY=f1.height-h-R,f1.parentLabelRotation=-90),f1.label=U(f1),f1.parentLabel=Z(f1),f1})},[B,K,W,U,S,Z,T,A,R,h]),i1=W5(),g1=xe(L,I),y1=E4(q,i1),m1=E4(Y,i1),b1=E4(Q,i1),S1=$.useMemo(function(){return r1.map(function(v1){var h1=V4({},v1,{color:g1(v1),opacity:N});return h1.borderColor=y1(h1),h1.labelTextColor=m1(h1),h1.parentLabelTextColor=b1(h1),h1})},[r1,g1,N,y1,m1,b1]);return{hierarchy:n1,nodes:S1,layout:D}},zr1=function(e){var t=e.nodes;return $.useMemo(function(){return{nodes:t}},[t])},$i=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}},cm=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}},Br1=$.memo(function(e){var t=e.nodes,C=e.nodeComponent,n=e.borderWidth,r=e.enableLabel,i=e.labelSkipSize,o=e.enableParentLabel,a=function(d,f){var v=f.isInteractive,g=f.onMouseEnter,h=f.onMouseMove,m=f.onMouseLeave,b=f.onClick,x=f.tooltip,S=a3(),w=S.showTooltipFromEvent,M=S.hideTooltip,_=$.useCallback(function(A,V){w($.createElement(x,{node:A}),V,"left")},[w,x]),E=$.useCallback(function(A,V){_(A,V),g==null||g(A,V)},[g,_]),O=$.useCallback(function(A,V){_(A,V),h==null||h(A,V)},[h,_]),T=$.useCallback(function(A,V){M(),m==null||m(A,V)},[m,M]),k=$.useCallback(function(A,V){b==null||b(A,V)},[b]);return $.useMemo(function(){return d.map(function(A){return v?V4({},A,{onMouseEnter:function(V){return E(A,V)},onMouseMove:function(V){return O(A,V)},onMouseLeave:function(V){return T(A,V)},onClick:function(V){return k(A,V)}}):A})},[v,d,E,O,T,k])}(t,{isInteractive:e.isInteractive,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseLeave:e.onMouseLeave,onClick:e.onClick,tooltip:e.tooltip}),s=A2(),l=s.animate,c=s.config,u=p4(a,{keys:function(d){return d.path},initial:$i,from:cm,enter:$i,update:$i,leave:cm,config:c,immediate:!l});return p.jsx(p.Fragment,{children:u(function(d,f){return $.createElement(C,{key:f.path,node:f,animatedProps:d,borderWidth:n,enableLabel:r,labelSkipSize:i,enableParentLabel:o})})})}),Wr1=["isInteractive","animate","motionConfig","theme","renderWrapper"],Ur1=function(e){var t=e.data,C=e.identity,n=C===void 0?U5.identity:C,r=e.value,i=r===void 0?U5.value:r,o=e.valueFormat,a=e.tile,s=a===void 0?U5.tile:a,l=e.nodeComponent,c=l===void 0?U5.nodeComponent:l,u=e.innerPadding,d=u===void 0?U5.innerPadding:u,f=e.outerPadding,v=f===void 0?U5.outerPadding:f,g=e.leavesOnly,h=g===void 0?U5.leavesOnly:g,m=e.width,b=e.height,x=e.margin,S=e.layers,w=S===void 0?U5.layers:S,M=e.colors,_=M===void 0?U5.colors:M,E=e.colorBy,O=E===void 0?U5.colorBy:E,T=e.nodeOpacity,k=T===void 0?U5.nodeOpacity:T,A=e.borderWidth,V=A===void 0?U5.borderWidth:A,R=e.borderColor,P=R===void 0?U5.borderColor:R,L=e.defs,H=L===void 0?U5.defs:L,I=e.fill,j=I===void 0?U5.fill:I,N=e.enableLabel,z=N===void 0?U5.enableLabel:N,q=e.label,G=q===void 0?U5.label:q,Y=e.labelTextColor,e1=Y===void 0?U5.labelTextColor:Y,Q=e.orientLabel,K=Q===void 0?U5.orientLabel:Q,J=e.labelSkipSize,W=J===void 0?U5.labelSkipSize:J,U=e.enableParentLabel,Z=U===void 0?U5.enableParentLabel:U,D=e.parentLabel,n1=D===void 0?U5.parentLabel:D,B=e.parentLabelSize,r1=B===void 0?U5.parentLabelSize:B,i1=e.parentLabelPosition,g1=i1===void 0?U5.parentLabelPosition:i1,y1=e.parentLabelPadding,m1=y1===void 0?U5.parentLabelPadding:y1,b1=e.parentLabelTextColor,S1=b1===void 0?U5.parentLabelTextColor:b1,v1=e.isInteractive,h1=v1===void 0?U5.isInteractive:v1,l1=e.onMouseEnter,$1=e.onMouseMove,f1=e.onMouseLeave,A1=e.onClick,I1=e.tooltip,R1=I1===void 0?U5.tooltip:I1,k1=e.role,Y1=e.ariaLabel,X1=e.ariaLabelledBy,D1=e.ariaDescribedBy,L1=z8(m,b,x),Q1=L1.margin,U1=L1.innerWidth,q1=L1.innerHeight,u1=L1.outerWidth,_1=L1.outerHeight,K1=Fr1({data:t,identity:n,value:i,valueFormat:o,leavesOnly:h,width:U1,height:q1,tile:s,innerPadding:d,outerPadding:v,colors:_,colorBy:O,nodeOpacity:k,borderColor:P,label:G,labelTextColor:e1,orientLabel:K,enableParentLabel:Z,parentLabel:n1,parentLabelSize:r1,parentLabelPosition:g1,parentLabelPadding:m1,parentLabelTextColor:S1}).nodes,C5={nodes:null};w.includes("nodes")&&(C5.nodes=p.jsx(Br1,{nodes:K1,nodeComponent:c,borderWidth:V,enableLabel:z,labelSkipSize:W,enableParentLabel:Z,isInteractive:h1,onMouseEnter:l1,onMouseMove:$1,onMouseLeave:f1,onClick:A1,tooltip:R1},"nodes"));var N1=zr1({nodes:K1}),z1=vu(H,K1,j);return p.jsx(x6,{width:u1,height:_1,margin:Q1,defs:z1,role:k1,ariaLabel:Y1,ariaLabelledBy:X1,ariaDescribedBy:D1,children:w.map(function(F1,J1){var t5;return typeof F1=="function"?p.jsx($.Fragment,{children:$.createElement(F1,N1)},J1):(t5=C5==null?void 0:C5[F1])!=null?t5:null})})},Zr1=function(e){var t=e.isInteractive,C=t===void 0?U5.isInteractive:t,n=e.animate,r=n===void 0?U5.animate:n,i=e.motionConfig,o=i===void 0?U5.motionConfig:i,a=e.theme,s=e.renderWrapper,l=Rr1(e,Wr1);return p.jsx(B8,{animate:r,isInteractive:C,motionConfig:o,renderWrapper:s,theme:a,children:p.jsx(Ur1,V4({isInteractive:C},l))})},qr1=function(e){return p.jsx(W7,{children:function(t){var C=t.width,n=t.height;return p.jsx(Zr1,V4({width:C,height:n},e))}})};function Gr1(e,t){if(e.startsWith("rgba"))return e.replace(/rgba?\((\d+), (\d+), (\d+),? ([\d.]+)?\)/,(C,n,r,i,o)=>`rgba(${n}, ${r}, ${i}, ${t})`);if(e.startsWith("rgb"))return e.replace(/rgb\((\d+), (\d+), (\d+)\)/,(C,n,r,i)=>`rgba(${n}, ${r}, ${i}, ${t})`);if(e.startsWith("hsl"))return e.replace(/hsl\((\d+), (\d+)%?, (\d+)%?\)/,(C,n,r,i)=>`hsla(${n}, ${r}%, ${i}%, ${t})`);if(e.startsWith("hsla"))return e.replace(/hsla?\((\d+), (\d+)%?, (\d+)%?,? ([\d.]+)?\)/,(C,n,r,i,o)=>`hsla(${n}, ${r}%, ${i}%, ${t})`);if(e.startsWith("#")){const C=Yr1(e);return`rgba(${C.r}, ${C.g}, ${C.b}, ${t})`}throw new Error("Unsupported color format")}function Yr1(e){const t=e.startsWith("#")?e.slice(1):e,C=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return{r:C,g:n,b:r}}const Kr1=({treeMapData:e,style:t={},colors:C={scheme:"nivo"},identity:n="name",value:r="loc",margin:i={},nodeOpacity:o=.67,labelTextColor:a="black",borderColor:s="white",labelTitle:l="name",labelTitleSize:c=16,labelText:u="name",labelTextSize:d=10,labelPadding:f=5,tooltip:v=null})=>{const g=({node:m})=>{var O,T;const b=$.useRef(null),x=$.useRef(null),[S,w]=$.useState(!1),[M,_]=$.useState(!1),E=()=>{if(!(b!=null&&b.current)||!(x!=null&&x.current))return;const k=x.current.getBoundingClientRect(),A=b.current.getBoundingClientRect(),V=Math.max([k,A]);w(A.height>m.height-f*2||A.width>m.width-f*2),_(k.height+A.height>m.height-f*2||V>m.width-f*2)};return $.useEffect(()=>{E()},[]),m.isParent?p.jsx(p.Fragment,{}):p.jsx("g",{transform:`translate(${m.x}, ${m.y})`,children:p.jsx("foreignObject",{width:m.width,height:m.height,style:{backgroundColor:Gr1(m.color,o),border:`1px solid ${s}`},children:p.jsxs("div",{style:{font:"var(--gf-label-lg-default)",color:a,padding:f,display:S?"none":"auto"},children:[p.jsx("span",{ref:b,style:{fontSize:c,display:"inline-block"},children:p.jsx("b",{children:((O=m==null?void 0:m.data)==null?void 0:O[l])||"Title"})}),p.jsx("div",{style:{display:M?"none":"auto"},children:p.jsx("span",{ref:x,style:{fontSize:d,display:"inline-block"},children:((T=m==null?void 0:m.data)==null?void 0:T[u])||"Text"})})]})})})},h=({nodes:m})=>m.map(b=>p.jsx(g,{node:b},b.id));return p.jsxs(p.Fragment,{children:[p.jsx(S2,{}),p.jsx("div",{style:{width:"100%",height:600,...t},children:p.jsx(qr1,{data:e,colors:C,identity:n,value:r,margin:{top:10,right:10,bottom:10,left:10,...i},enableParentLabel:!1,enableLabel:!1,nodeOpacity:0,borderWidth:0,tooltip:({node:m})=>p.jsx(f4,{body:(v==null?void 0:v({node:m}))||p.jsx("span",{children:"Treemap tooltip"})}),layers:[h,"nodes"]})})]})};var Xr1=he,Qr1=0;function Jr1(e){var t=++Qr1;return Xr1(e)+t}var ei1=Jr1;const ti1=p2(ei1);function u4(){return u4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},u4.apply(this,arguments)}var Eu=$.memo(function(e){var t=e.point;return p.jsx(P9,{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})}),hM=$.memo(function(e){var t=e.slice,C=e.axis,n=W5(),r=C==="x"?"y":"x";return p.jsx(tw,{rows:t.points.map(function(i){return[p.jsx(qt,{color:i.serieColor,style:n.tooltip.chip},"chip"),i.serieId,p.jsx("span",{style:n.tooltip.tableCellValue,children:i.data[r+"Formatted"]},"value")]})})}),gM={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:Eu,enableSlices:!1,debugSlices:!1,sliceTooltip:hM,debugMesh:!1,enableCrosshair:!0,crosshairType:"bottom-left"},x7=u4({},gM,{enablePointLabel:!1,useMesh:!1,enableTouchCrosshair:!1,animate:!0,motionConfig:"gentle",defs:[],fill:[],role:"img"});u4({},gM,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var Ci1=function(e){var t=e.curve;return $.useMemo(function(){return U0().defined(function(C){return C.x!==null&&C.y!==null}).x(function(C){return C.x}).y(function(C){return C.y}).curve(AS(t))},[t])},ni1=function(e){var t=e.curve,C=e.yScale,n=e.areaBaselineValue;return $.useMemo(function(){return nS().defined(function(r){return r.x!==null&&r.y!==null}).x(function(r){return r.x}).y1(function(r){return r.y}).curve(AS(t)).y0(C(n))},[t,C,n])},ri1=function(e){var t=e.componentId,C=e.enableSlices,n=e.points,r=e.width,i=e.height;return $.useMemo(function(){if(C===!1)return[];if(C==="x"){var o=new Map;return n.forEach(function(s){s.data.x!==null&&s.data.y!==null&&(o.has(s.x)?o.get(s.x).push(s):o.set(s.x,[s]))}),Array.from(o.entries()).sort(function(s,l){return s[0]-l[0]}).map(function(s,l,c){var u,d,f=s[0],v=s[1],g=c[l-1],h=c[l+1];return u=g?f-(f-g[0])/2:f,d=h?f-u+(h[0]-f)/2:r-u,{id:"slice:"+t+":"+f,x0:u,x:f,y0:0,y:0,width:d,height:i,points:v.reverse()}})}if(C==="y"){var a=new Map;return n.forEach(function(s){s.data.x!==null&&s.data.y!==null&&(a.has(s.y)?a.get(s.y).push(s):a.set(s.y,[s]))}),Array.from(a.entries()).sort(function(s,l){return s[0]-l[0]}).map(function(s,l,c){var u,d,f=s[0],v=s[1],g=c[l-1],h=c[l+1];return u=g?f-(f-g[0])/2:f,d=h?f-u+(h[0]-f)/2:i-u,{id:f,x0:0,x:0,y0:u,y:f,width:r,height:d,points:v.reverse()}})}},[t,C,i,n,r])},ii1="line",vM=function(e){var t=e.data,C=e.xScale,n=C===void 0?x7.xScale:C,r=e.xFormat,i=e.yScale,o=i===void 0?x7.yScale:i,a=e.yFormat,s=e.width,l=e.height,c=e.colors,u=c===void 0?x7.colors:c,d=e.curve,f=d===void 0?x7.curve:d,v=e.areaBaselineValue,g=v===void 0?x7.areaBaselineValue:v,h=e.pointColor,m=h===void 0?x7.pointColor:h,b=e.pointBorderColor,x=b===void 0?x7.pointBorderColor:b,S=e.enableSlices,w=S===void 0?x7.enableSlicesTooltip:S,M=$.useState(ti1(ii1))[0],_=k7(r),E=k7(a),O=xe(u,"id"),T=W5(),k=E4(m,T),A=E4(x,T),V=$.useState([]),R=V[0],P=V[1],L=$.useMemo(function(){return M$(t.filter(function(Q){return R.indexOf(Q.id)===-1}),n,o,s,l)},[t,R,n,o,s,l]),H=L.xScale,I=L.yScale,j=L.series,N=$.useMemo(function(){var Q=t.map(function(J){return{id:J.id,label:J.id,color:O(J)}}),K=Q.map(function(J){return u4({},j.find(function(W){return W.id===J.id}),{color:J.color})}).filter(function(J){return!!J.id});return{legendData:Q.map(function(J){return u4({},J,{hidden:!K.find(function(W){return W.id===J.id})})}).reverse(),series:K}},[t,j,O]),z=N.legendData,q=N.series,G=$.useCallback(function(Q){P(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,U=Q.formatX,Z=Q.formatY;return $.useMemo(function(){return K.reduce(function(D,n1){return[].concat(D,n1.data.filter(function(B){return B.position.x!==null&&B.position.y!==null}).map(function(B,r1){var i1={id:n1.id+"."+r1,index:D.length+r1,serieId:n1.id,serieColor:n1.color,x:B.position.x,y:B.position.y};return i1.color=J(n1),i1.borderColor=W(i1),i1.data=u4({},B.data,{xFormatted:U(B.data.x),yFormatted:Z(B.data.y)}),i1}))},[])},[K,J,W,U,Z])}({series:q,getPointColor:k,getPointBorderColor:A,formatX:_,formatY:E}),e1=ri1({componentId:M,enableSlices:w,points:Y,width:s,height:l});return{legendData:z,toggleSerie:G,lineGenerator:Ci1({curve:f}),areaGenerator:ni1({curve:f,yScale:I,areaBaselineValue:g}),getColor:O,series:q,xScale:H,yScale:I,slices:e1,points:Y}},oi1=function(e){var t=e.areaBlendMode,C=e.areaOpacity,n=e.color,r=e.fill,i=e.path,o=A2(),a=o.animate,s=o.config,l=Vn(i),c=X5({color:n,config:s,immediate:!a});return p.jsx(e5.path,{d:l,fill:r||c.color,fillOpacity:C,strokeWidth:0,style:{mixBlendMode:t}})},ai1=$.memo(function(e){var t=e.areaGenerator,C=e.areaOpacity,n=e.areaBlendMode,r=e.lines.slice(0).reverse();return p.jsx("g",{children:r.map(function(i){return p.jsx(oi1,u4({path:t(i.data.map(function(o){return o.position}))},u4({areaOpacity:C,areaBlendMode:n},i)),i.id)})})}),si1=$.memo(function(e){var t=e.lineGenerator,C=e.points,n=e.color,r=e.thickness,i=$.useMemo(function(){return t(C)},[t,C]),o=Vn(i);return p.jsx(e5.path,{d:o,fill:"none",strokeWidth:r,stroke:n})}),li1=$.memo(function(e){var t=e.lines,C=e.lineGenerator,n=e.lineWidth;return t.slice(0).reverse().map(function(r){var i=r.id,o=r.data,a=r.color;return p.jsx(si1,{id:i,points:o.map(function(s){return s.position}),lineGenerator:C,color:a,thickness:n},i)})}),ci1=$.memo(function(e){var t=e.slice,C=e.slices,n=e.axis,r=e.debug,i=e.tooltip,o=e.isCurrent,a=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onClick,d=e.onTouchStart,f=e.onTouchMove,v=e.onTouchEnd,g=a3(),h=g.showTooltipFromEvent,m=g.hideTooltip,b=$.useCallback(function(O){h($.createElement(i,{slice:t,axis:n}),O,"right"),a(t),s&&s(t,O)},[h,i,t,n,a,s]),x=$.useCallback(function(O){h($.createElement(i,{slice:t,axis:n}),O,"right"),l&&l(t,O)},[h,i,t,n,l]),S=$.useCallback(function(O){m(),a(null),c&&c(t,O)},[m,a,c,t]),w=$.useCallback(function(O){u&&u(t,O)},[t,u]),M=$.useCallback(function(O){h($.createElement(i,{slice:t,axis:n}),O,"right"),a(t),d&&d(t,O)},[n,d,a,h,t,i]),_=$.useCallback(function(O){var T=O.touches[0],k=document.elementFromPoint(T.clientX,T.clientY),A=k==null?void 0:k.getAttribute("data-ref");if(A){var V=C.find(function(R){return R.id===A});V&&(h($.createElement(i,{slice:V,axis:n}),O,"right"),a(V))}f&&f(t,O)},[n,f,a,h,t,C,i]),E=$.useCallback(function(O){m(),a(null),v&&v(t,O)},[m,a,v,t]);return p.jsx("rect",{x:t.x0,y:t.y0,width:t.width,height:t.height,stroke:"red",strokeWidth:r?1:0,strokeOpacity:.75,fill:"red",fillOpacity:o&&r?.35:0,onMouseEnter:b,onMouseMove:x,onMouseLeave:S,onClick:w,onTouchStart:M,onTouchMove:_,onTouchEnd:E,"data-ref":t.id})}),ui1=$.memo(function(e){var t=e.slices,C=e.axis,n=e.debug,r=e.height,i=e.tooltip,o=e.current,a=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onClick,d=e.onTouchStart,f=e.onTouchMove,v=e.onTouchEnd;return t.map(function(g){return p.jsx(ci1,{slice:g,slices:t,axis:C,debug:n,height:r,tooltip:i,setCurrent:a,isCurrent:o!==null&&o.id===g.id,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,onClick:u,onTouchStart:d,onTouchMove:f,onTouchEnd:v},g.id)})}),di1=$.memo(function(e){var t=e.points,C=e.symbol,n=e.size,r=e.borderWidth,i=e.enableLabel,o=e.label,a=e.labelYOffset,s=W5(),l=C31(o),c=t.slice(0).reverse().map(function(u){return{id:u.id,x:u.x,y:u.y,datum:u.data,fill:u.color,stroke:u.borderColor,label:i?l(u):null}});return p.jsx("g",{children:c.map(function(u){return p.jsx(J41,{x:u.x,y:u.y,datum:u.datum,symbol:C,size:n,color:u.fill,borderWidth:r,borderColor:u.stroke,label:u.label,labelYOffset:a,theme:s},u.id)})})}),fi1=$.memo(function(e){var t=e.points,C=e.width,n=e.height,r=e.margin,i=e.setCurrent,o=e.onMouseEnter,a=e.onMouseMove,s=e.onMouseLeave,l=e.onClick,c=e.onTouchStart,u=e.onTouchMove,d=e.onTouchEnd,f=e.tooltip,v=e.debug,g=e.enableTouchCrosshair,h=a3(),m=h.showTooltipAt,b=h.hideTooltip,x=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),o&&o(T,k)},[m,f,o,r]),S=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),a&&a(T,k)},[m,f,r.left,r.top,a]),w=$.useCallback(function(T,k){b(),s&&s(T,k)},[b,s]),M=$.useCallback(function(T,k){l&&l(T,k)},[l]),_=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),c&&c(T,k)},[r.left,r.top,c,m,f]),E=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),u&&u(T,k)},[r.left,r.top,u,m,f]),O=$.useCallback(function(T,k){b(),d&&d(T,k)},[d,b]);return p.jsx(N$,{nodes:t,width:C,height:n,setCurrent:i,onMouseEnter:x,onMouseMove:S,onMouseLeave:w,onClick:M,onTouchStart:_,onTouchMove:E,onTouchEnd:O,enableTouchCrosshair:g,debug:v})}),hi1=JS(function(e){var t=e.data,C=e.xScale,n=C===void 0?{type:"point"}:C,r=e.xFormat,i=e.yScale,o=i===void 0?{type:"linear",min:0,max:"auto"}:i,a=e.yFormat,s=e.layers,l=s===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:s,c=e.curve,u=c===void 0?"linear":c,d=e.areaBaselineValue,f=d===void 0?0:d,v=e.colors,g=v===void 0?{scheme:"nivo"}:v,h=e.margin,m=e.width,b=e.height,x=e.axisTop,S=e.axisRight,w=e.axisBottom,M=w===void 0?{}:w,_=e.axisLeft,E=_===void 0?{}:_,O=e.enableGridX,T=O===void 0||O,k=e.enableGridY,A=k===void 0||k,V=e.gridXValues,R=e.gridYValues,P=e.lineWidth,L=P===void 0?2:P,H=e.enableArea,I=H!==void 0&&H,j=e.areaOpacity,N=j===void 0?.2:j,z=e.areaBlendMode,q=z===void 0?"normal":z,G=e.enablePoints,Y=G===void 0||G,e1=e.pointSymbol,Q=e.pointSize,K=Q===void 0?6:Q,J=e.pointColor,W=J===void 0?{from:"color"}:J,U=e.pointBorderWidth,Z=U===void 0?0:U,D=e.pointBorderColor,n1=D===void 0?{theme:"background"}:D,B=e.enablePointLabel,r1=B!==void 0&&B,i1=e.pointLabel,g1=i1===void 0?"data.yFormatted":i1,y1=e.pointLabelYOffset,m1=e.defs,b1=m1===void 0?[]:m1,S1=e.fill,v1=S1===void 0?[]:S1,h1=e.markers,l1=e.legends,$1=l1===void 0?[]:l1,f1=e.isInteractive,A1=f1===void 0||f1,I1=e.useMesh,R1=I1!==void 0&&I1,k1=e.debugMesh,Y1=k1!==void 0&&k1,X1=e.onMouseEnter,D1=e.onMouseMove,L1=e.onMouseLeave,Q1=e.onClick,U1=e.onTouchStart,q1=e.onTouchMove,u1=e.onTouchEnd,_1=e.tooltip,K1=_1===void 0?Eu:_1,C5=e.enableSlices,N1=C5!==void 0&&C5,z1=e.debugSlices,F1=z1!==void 0&&z1,J1=e.sliceTooltip,t5=J1===void 0?hM:J1,B1=e.enableCrosshair,P1=B1===void 0||B1,l5=e.crosshairType,m5=l5===void 0?"bottom-left":l5,O1=e.enableTouchCrosshair,d1=O1!==void 0&&O1,w1=e.role,V1=w1===void 0?"img":w1,G1=z8(m,b,h),W1=G1.margin,n5=G1.innerWidth,X=G1.innerHeight,o1=G1.outerWidth,a1=G1.outerHeight,T1=vM({data:t,xScale:n,xFormat:r,yScale:o,yFormat:a,width:n5,height:X,colors:g,curve:u,areaBaselineValue:f,pointColor:W,pointBorderColor:n1,enableSlices:N1}),r5=T1.legendData,o5=T1.toggleSerie,a5=T1.lineGenerator,d5=T1.areaGenerator,p1=T1.series,x1=T1.xScale,H1=T1.yScale,i5=T1.slices,g5=T1.points,y5=W5(),f5=E4(W,y5),V5=E4(n1,y5),C2=$.useState(null),I5=C2[0],c2=C2[1],o4=$.useState(null),N5=o4[0],V2=o4[1],s5={grid:p.jsx(L$,{theme:y5,width:n5,height:X,xScale:T?x1:null,yScale:A?H1:null,xValues:V,yValues:R},"grid"),markers:p.jsx(QS,{markers:h1,width:n5,height:X,xScale:x1,yScale:H1,theme:y5},"markers"),axes:p.jsx(k$,{xScale:x1,yScale:H1,width:n5,height:X,theme:y5,top:x,right:S,bottom:M,left:E},"axes"),areas:null,lines:p.jsx(li1,{lines:p1,lineGenerator:a5,lineWidth:L},"lines"),slices:null,points:null,crosshair:null,mesh:null,legends:$1.map(function(a2,u2){return p.jsx(Rn,u4({},a2,{containerWidth:n5,containerHeight:X,data:a2.data||r5,theme:y5,toggleSerie:a2.toggleSerie?o5:void 0}),"legend."+u2)})},$2=vu(b1,p1,v1);return I&&(s5.areas=p.jsx(ai1,{areaGenerator:d5,areaOpacity:N,areaBlendMode:q,lines:p1},"areas")),A1&&N1!==!1&&(s5.slices=p.jsx(ui1,{slices:i5,axis:N1,debug:F1,height:X,tooltip:t5,current:N5,setCurrent:V2,onMouseEnter:X1,onMouseMove:D1,onMouseLeave:L1,onClick:Q1,onTouchStart:U1,onTouchMove:q1,onTouchEnd:u1},"slices")),Y&&(s5.points=p.jsx(di1,{points:g5,symbol:e1,size:K,color:f5,borderWidth:Z,borderColor:V5,enableLabel:r1,label:g1,labelYOffset:y1},"points")),A1&&P1&&(I5!==null&&(s5.crosshair=p.jsx(oa,{width:n5,height:X,x:I5.x,y:I5.y,type:m5},"crosshair")),N5!==null&&(s5.crosshair=p.jsx(oa,{width:n5,height:X,x:N5.x,y:N5.y,type:N1},"crosshair"))),A1&&R1&&N1===!1&&(s5.mesh=p.jsx(fi1,{points:g5,width:n5,height:X,margin:W1,current:I5,setCurrent:c2,onMouseEnter:X1,onMouseMove:D1,onMouseLeave:L1,onClick:Q1,onTouchStart:U1,onTouchMove:q1,onTouchEnd:u1,tooltip:K1,enableTouchCrosshair:d1,debug:Y1},"mesh")),p.jsx(x6,{defs:$2,width:o1,height:a1,margin:W1,role:V1,children:l.map(function(a2,u2){return typeof a2=="function"?p.jsx($.Fragment,{children:a2(u4({},e,{innerWidth:n5,innerHeight:X,series:p1,slices:i5,points:g5,xScale:x1,yScale:H1,lineGenerator:a5,areaGenerator:d5,currentPoint:I5,setCurrentPoint:c2,currentSlice:N5,setCurrentSlice:V2}))},u2):s5[a2]})})}),gi1=function(e){return p.jsx(W7,{children:function(t){var C=t.width,n=t.height;return p.jsx(hi1,u4({width:C,height:n},e))}})},vi1=JS(function(e){var t=$.useRef(null),C=e.width,n=e.height,r=e.margin,i=e.pixelRatio,o=i===void 0?typeof window<"u"&&window.devicePixelRatio||1:i,a=e.data,s=e.xScale,l=s===void 0?{type:"point"}:s,c=e.xFormat,u=e.yScale,d=u===void 0?{type:"linear",min:0,max:"auto"}:u,f=e.yFormat,v=e.curve,g=v===void 0?"linear":v,h=e.layers,m=h===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:h,b=e.colors,x=b===void 0?{scheme:"nivo"}:b,S=e.lineWidth,w=S===void 0?2:S,M=e.enableArea,_=M!==void 0&&M,E=e.areaBaselineValue,O=E===void 0?0:E,T=e.areaOpacity,k=T===void 0?.2:T,A=e.enablePoints,V=A===void 0||A,R=e.pointSize,P=R===void 0?6:R,L=e.pointColor,H=L===void 0?{from:"color"}:L,I=e.pointBorderWidth,j=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,e1=e.enableGridY,Q=e1===void 0||e1,K=e.gridYValues,J=e.axisTop,W=e.axisRight,U=e.axisBottom,Z=U===void 0?{}:U,D=e.axisLeft,n1=D===void 0?{}:D,B=e.legends,r1=B===void 0?[]:B,i1=e.isInteractive,g1=i1===void 0||i1,y1=e.debugMesh,m1=y1!==void 0&&y1,b1=e.onMouseLeave,S1=e.onClick,v1=e.tooltip,h1=v1===void 0?Eu:v1,l1=e.canvasRef,$1=z8(C,n,r),f1=$1.margin,A1=$1.innerWidth,I1=$1.innerHeight,R1=$1.outerWidth,k1=$1.outerHeight,Y1=W5(),X1=$.useState(null),D1=X1[0],L1=X1[1],Q1=vM({data:a,xScale:l,xFormat:c,yScale:d,yFormat:f,width:A1,height:I1,colors:x,curve:g,areaBaselineValue:O,pointColor:H,pointBorderColor:z}),U1=Q1.lineGenerator,q1=Q1.areaGenerator,u1=Q1.series,_1=Q1.xScale,K1=Q1.yScale,C5=Q1.points,N1=wu({points:C5,width:A1,height:I1,debug:m1}),z1=N1.delaunay,F1=N1.voronoi;$.useEffect(function(){l1&&(l1.current=t.current),t.current.width=R1*o,t.current.height=k1*o;var d1=t.current.getContext("2d");d1.scale(o,o),d1.fillStyle=Y1.background,d1.fillRect(0,0,R1,k1),d1.translate(f1.left,f1.top),m.forEach(function(w1){if(typeof w1=="function"&&w1({ctx:d1,innerWidth:A1,innerHeight:I1,series:u1,points:C5,xScale:_1,yScale:K1,lineWidth:w,lineGenerator:U1,areaGenerator:q1,currentPoint:D1,setCurrentPoint:L1}),w1==="grid"&&Y1.grid.line.strokeWidth>0&&(d1.lineWidth=Y1.grid.line.strokeWidth,d1.strokeStyle=Y1.grid.line.stroke,G&&gC(d1,{width:A1,height:I1,scale:_1,axis:"x",values:Y}),Q&&gC(d1,{width:A1,height:I1,scale:K1,axis:"y",values:K})),w1==="axes"&&P$(d1,{xScale:_1,yScale:K1,width:A1,height:I1,top:J,right:W,bottom:Z,left:n1,theme:Y1}),w1==="areas"&&_===!0){d1.save(),d1.globalAlpha=k,q1.context(d1);for(var V1=u1.length-1;V1>=0;V1--)d1.fillStyle=u1[V1].color,d1.beginPath(),q1(u1[V1].data.map(function(W1){return W1.position})),d1.fill();d1.restore()}if(w1==="lines"&&(U1.context(d1),u1.forEach(function(W1){d1.strokeStyle=W1.color,d1.lineWidth=w,d1.beginPath(),U1(W1.data.map(function(n5){return n5.position})),d1.stroke()})),w1==="points"&&V===!0&&P>0&&C5.forEach(function(W1){d1.fillStyle=W1.color,d1.beginPath(),d1.arc(W1.x,W1.y,P/2,0,2*Math.PI),d1.fill(),j>0&&(d1.strokeStyle=W1.borderColor,d1.lineWidth=j,d1.stroke())}),w1==="mesh"&&m1===!0&&(D$(d1,F1),D1&&F$(d1,F1,D1.index)),w1==="legends"){var G1=u1.map(function(W1){return{id:W1.id,label:W1.id,color:W1.color}}).reverse();r1.forEach(function(W1){o$(d1,u4({},W1,{data:W1.data||G1,containerWidth:A1,containerHeight:I1,theme:Y1}))})}})},[t,R1,k1,m,Y1,U1,u1,_1,K1,G,Y,Q,K,J,W,Z,n1,r1,C5,V,P,D1]);var J1=$.useCallback(function(d1){var w1=gu(t.current,d1),V1=w1[0],G1=w1[1];if(!e$(f1.left,f1.top,A1,I1,V1,G1))return null;var W1=z1.find(V1-f1.left,G1-f1.top);return C5[W1]},[t,f1,A1,I1,z1]),t5=a3(),B1=t5.showTooltipFromEvent,P1=t5.hideTooltip,l5=$.useCallback(function(d1){var w1=J1(d1);L1(w1),w1?B1($.createElement(h1,{point:w1}),d1):P1()},[J1,L1,B1,P1,h1]),m5=$.useCallback(function(d1){P1(),L1(null),D1&&b1&&b1(D1,d1)},[P1,L1,b1]),O1=$.useCallback(function(d1){if(S1){var w1=J1(d1);w1&&S1(w1,d1)}},[J1,S1]);return p.jsx("canvas",{ref:t,width:R1*o,height:k1*o,style:{width:R1,height:k1,cursor:g1?"auto":"normal"},onMouseEnter:g1?l5:void 0,onMouseMove:g1?l5:void 0,onMouseLeave:g1?m5:void 0,onClick:g1?O1:void 0})}),mi1=$.forwardRef(function(e,t){return p.jsx(vi1,u4({},e,{canvasRef:t}))});$.forwardRef(function(e,t){return p.jsx(W7,{children:function(C){var n=C.width,r=C.height;return p.jsx(mi1,u4({width:n,height:r},e,{ref:t}))}})});const pi1=({trendsData:e,height:t=null,margin:C={},colors:n=null,xLeg:r,yLeg:i,tooltip:o=null})=>p.jsxs(p.Fragment,{children:[p.jsx(S2,{}),p.jsx("div",{style:{width:"100%",height:t||600},children:p.jsx(gi1,{data:e,margin:{top:50,right:90,bottom:50,left:90,...C},colors:n||{scheme:"nivo"},xScale:{type:"point"},yScale:{type:"linear",min:"auto",max:"auto",reverse:!1},axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:0,legend:r,legendOffset:36,legendPosition:"middle"},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0,legend:i,legendOffset:-70,legendPosition:"middle"},pointSize:10,pointColor:{theme:"background"},pointBorderWidth:2,pointBorderColor:{from:"serieColor"},pointLabelYOffset:-12,useMesh:!0,legends:[{anchor:"top-right",direction:"column",justify:!1,translateX:210,translateY:-40,itemsSpacing:0,itemDirection:"left-to-right",itemWidth:200,itemHeight:20,itemOpacity:.9,symbolSize:8,symbolShape:"circle",symbolBorderColor:"rgba(0, 0, 0, .5)",effects:[{on:"hover",style:{itemBackground:"rgba(0, 0, 0, .03)",itemOpacity:1}}]}],tooltip:a=>p.jsx(f4,{body:(o==null?void 0:o(a))||p.jsx("span",{children:"Line tooltip"})})})})]}),bi1=E5.h3`
499
499
  color: var(--gf-color-button-primary);
500
500
  `,yi1=({selectors:e,setter:t})=>{const C=24/e.length;return p.jsxs(p.Fragment,{children:[p.jsx(S2,{}),p.jsx(K9,{cardtype:"default",style:{width:"100%"},children:p.jsx(k9,{gutter:20,children:e.map((n,r)=>p.jsxs(g3,{span:C,children:[p.jsx(bi1,{children:n.title}),p.jsx(H8,{defaultValue:n.defaultValue,style:{width:"100%"},onChange:i=>{t(n.key,i)},options:n.options})]},`col-${r}`))})})]})},Mi=E5.span`
501
501
  font: var(--gf-label-md-default);