@hpcc-js/chart 3.5.3 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- var t=Object.defineProperty,e=(e,i)=>t(e,"name",{value:i,configurable:!0}),i=(e,i,n)=>((e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n)(e,"symbol"!=typeof i?i+"":i,n);import{INDChart as n,ITooltip as o,I2DChart as s,I1DChart as a,I2DAggrChart as r}from"@hpcc-js/api";import{SVGWidget as l,select as h,scaleTime as c,timeParse as u,timeFormat as p,scaleLog as d,format as f,scalePow as y,scaleLinear as _,scaleBand as x,Utility as m,brush as g,brushX as b,brushY as v,brushSelection as w,d3Event as S,hsl as A,min as k,max as M,scaleSqrt as P,extent as T,local as C,Text as z,FAChar as F,descending as I,HTMLWidget as E,thresholdSturges as O,tickStep as R,range as D,drag as j,event as N,dispatch as L,interpolateHcl as B,interpolate as $,Palette as H,rgb as q,CanvasWidget as V,zoom as W}from"@hpcc-js/common";import{normalizeRadians as G,degreesToRadians as X}from"@hpcc-js/util";const Y="@hpcc-js/chart",U="3.5.3",Q="3.16.1";var Z=Math.PI,J=2*Z,K=1e-6,tt=J-K;function et(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function it(){return new et}function nt(t){/* @__PURE__ */
2
- return e(function(){return t},"constant")}e(et,"Path"),e(it,"path"),et.prototype=it.prototype={constructor:et,moveTo:/* @__PURE__ */e(function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},"moveTo"),closePath:/* @__PURE__ */e(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:/* @__PURE__ */e(function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},"lineTo"),quadraticCurveTo:/* @__PURE__ */e(function(t,e,i,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+n)},"quadraticCurveTo"),bezierCurveTo:/* @__PURE__ */e(function(t,e,i,n,o,s){this._+="C"+ +t+","+ +e+","+ +i+","+ +n+","+(this._x1=+o)+","+(this._y1=+s)},"bezierCurveTo"),arcTo:/* @__PURE__ */e(function(t,e,i,n,o){t=+t,e=+e,i=+i,n=+n,o=+o;var s=this._x1,a=this._y1,r=i-t,l=n-e,h=s-t,c=a-e,u=h*h+c*c;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(u>K)if(Math.abs(c*r-l*h)>K&&o){var p=i-s,d=n-a,f=r*r+l*l,y=p*p+d*d,_=Math.sqrt(f),x=Math.sqrt(u),m=o*Math.tan((Z-Math.acos((f+u-y)/(2*_*x)))/2),g=m/x,b=m/_;Math.abs(g-1)>K&&(this._+="L"+(t+g*h)+","+(e+g*c)),this._+="A"+o+","+o+",0,0,"+ +(c*p>h*d)+","+(this._x1=t+b*r)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},"arcTo"),arc:/* @__PURE__ */e(function(t,e,i,n,o,s){t=+t,e=+e,s=!!s;var a=(i=+i)*Math.cos(n),r=i*Math.sin(n),l=t+a,h=e+r,c=1^s,u=s?n-o:o-n;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+l+","+h:(Math.abs(this._x1-l)>K||Math.abs(this._y1-h)>K)&&(this._+="L"+l+","+h),i&&(u<0&&(u=u%J+J),u>tt?this._+="A"+i+","+i+",0,1,"+c+","+(t-a)+","+(e-r)+"A"+i+","+i+",0,1,"+c+","+(this._x1=l)+","+(this._y1=h):u>K&&(this._+="A"+i+","+i+",0,"+ +(u>=Z)+","+c+","+(this._x1=t+i*Math.cos(o))+","+(this._y1=e+i*Math.sin(o))))},"arc"),rect:/* @__PURE__ */e(function(t,e,i,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},"rect"),toString:/* @__PURE__ */e(function(){return this._},"toString")},e(nt,"constant$3");var ot=Math.abs,st=Math.atan2,at=Math.cos,rt=Math.max,lt=Math.min,ht=Math.sin,ct=Math.sqrt,ut=1e-12,pt=Math.PI,dt=pt/2,ft=2*pt;function yt(t){return t>1?0:t<-1?pt:Math.acos(t)}function _t(t){return t>=1?dt:t<=-1?-dt:Math.asin(t)}function xt(t){return t.innerRadius}function mt(t){return t.outerRadius}function gt(t){return t.startAngle}function bt(t){return t.endAngle}function vt(t){return t&&t.padAngle}function wt(t,e,i,n,o,s,a,r){var l=i-t,h=n-e,c=a-o,u=r-s,p=u*l-c*h;if(!(p*p<ut))return[t+(p=(c*(e-s)-u*(t-o))/p)*l,e+p*h]}function St(t,e,i,n,o,s,a){var r=t-i,l=e-n,h=(a?s:-s)/ct(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-s,w=p*y-f*d,S=(g<0?-1:1)*ct(rt(0,v*v*b-w*w)),A=(w*g-m*S)/b,k=(-w*m-g*S)/b,M=(w*g+m*S)/b,P=(-w*m+g*S)/b,T=A-_,C=k-x,z=M-_,F=P-x;return T*T+C*C>z*z+F*F&&(A=M,k=P),{cx:A,cy:k,x01:-c,y01:-u,x11:A*(o/v-1),y11:k*(o/v-1)}}function At(){var t=xt,i=mt,n=nt(0),o=null,s=gt,a=bt,r=vt,l=null;function h(){var e,h,c=+t.apply(this,arguments),u=+i.apply(this,arguments),p=s.apply(this,arguments)-dt,d=a.apply(this,arguments)-dt,f=ot(d-p),y=d>p;if(l||(l=e=it()),u<c&&(h=u,u=c,c=h),u>ut)if(f>ft-ut)l.moveTo(u*at(p),u*ht(p)),l.arc(0,0,u,p,d,!y),c>ut&&(l.moveTo(c*at(d),c*ht(d)),l.arc(0,0,c,d,p,y));else{var _,x,m=p,g=d,b=p,v=d,w=f,S=f,A=r.apply(this,arguments)/2,k=A>ut&&(o?+o.apply(this,arguments):ct(c*c+u*u)),M=lt(ot(u-c)/2,+n.apply(this,arguments)),P=M,T=M;if(k>ut){var C=_t(k/c*ht(A)),z=_t(k/u*ht(A));(w-=2*C)>ut?(b+=C*=y?1:-1,v-=C):(w=0,b=v=(p+d)/2),(S-=2*z)>ut?(m+=z*=y?1:-1,g-=z):(S=0,m=g=(p+d)/2)}var F=u*at(m),I=u*ht(m),E=c*at(v),O=c*ht(v);if(M>ut){var R,D=u*at(g),j=u*ht(g),N=c*at(b),L=c*ht(b);if(f<pt&&(R=wt(F,I,N,L,D,j,E,O))){var B=F-R[0],$=I-R[1],H=D-R[0],q=j-R[1],V=1/ht(yt((B*H+$*q)/(ct(B*B+$*$)*ct(H*H+q*q)))/2),W=ct(R[0]*R[0]+R[1]*R[1]);P=lt(M,(c-W)/(V-1)),T=lt(M,(u-W)/(V+1))}}S>ut?T>ut?(_=St(N,L,F,I,u,T,y),x=St(D,j,E,O,u,T,y),l.moveTo(_.cx+_.x01,_.cy+_.y01),T<M?l.arc(_.cx,_.cy,T,st(_.y01,_.x01),st(x.y01,x.x01),!y):(l.arc(_.cx,_.cy,T,st(_.y01,_.x01),st(_.y11,_.x11),!y),l.arc(0,0,u,st(_.cy+_.y11,_.cx+_.x11),st(x.cy+x.y11,x.cx+x.x11),!y),l.arc(x.cx,x.cy,T,st(x.y11,x.x11),st(x.y01,x.x01),!y))):(l.moveTo(F,I),l.arc(0,0,u,m,g,!y)):l.moveTo(F,I),c>ut&&w>ut?P>ut?(_=St(E,O,D,j,c,-P,y),x=St(F,I,N,L,c,-P,y),l.lineTo(_.cx+_.x01,_.cy+_.y01),P<M?l.arc(_.cx,_.cy,P,st(_.y01,_.x01),st(x.y01,x.x01),!y):(l.arc(_.cx,_.cy,P,st(_.y01,_.x01),st(_.y11,_.x11),!y),l.arc(0,0,c,st(_.cy+_.y11,_.cx+_.x11),st(x.cy+x.y11,x.cx+x.x11),y),l.arc(x.cx,x.cy,P,st(x.y11,x.x11),st(x.y01,x.x01),!y))):l.arc(0,0,c,v,b,y):l.lineTo(E,O)}else l.moveTo(0,0);if(l.closePath(),e)return l=null,e+""||null}return e(h,"arc"),h.centroid=function(){var e=(+t.apply(this,arguments)+ +i.apply(this,arguments))/2,n=(+s.apply(this,arguments)+ +a.apply(this,arguments))/2-pt/2;return[at(n)*e,ht(n)*e]},h.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:nt(+e),h):t},h.outerRadius=function(t){return arguments.length?(i="function"==typeof t?t:nt(+t),h):i},h.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:nt(+t),h):n},h.padRadius=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:nt(+t),h):o},h.startAngle=function(t){return arguments.length?(s="function"==typeof t?t:nt(+t),h):s},h.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:nt(+t),h):a},h.padAngle=function(t){return arguments.length?(r="function"==typeof t?t:nt(+t),h):r},h.context=function(t){return arguments.length?(l=null==t?null:t,h):l},h}function kt(t){this._context=t}function Mt(t){return new kt(t)}function Pt(t){return t[0]}function Tt(t){return t[1]}function Ct(){var t=Pt,i=Tt,n=nt(!0),o=null,s=Mt,a=null;function r(e){var r,l,h,c=e.length,u=!1;for(null==o&&(a=s(h=it())),r=0;r<=c;++r)!(r<c&&n(l=e[r],r,e))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+t(l,r,e),+i(l,r,e));if(h)return a=null,h+""||null}return e(r,"line"),r.x=function(e){return arguments.length?(t="function"==typeof e?e:nt(+e),r):t},r.y=function(t){return arguments.length?(i="function"==typeof t?t:nt(+t),r):i},r.defined=function(t){return arguments.length?(n="function"==typeof t?t:nt(!!t),r):n},r.curve=function(t){return arguments.length?(s=t,null!=o&&(a=s(o)),r):s},r.context=function(t){return arguments.length?(null==t?o=a=null:a=s(o=t),r):o},r}function zt(){var t=Pt,i=null,n=nt(0),o=Tt,s=nt(!0),a=null,r=Mt,l=null;function h(e){var h,c,u,p,d,f=e.length,y=!1,_=new Array(f),x=new Array(f);for(null==a&&(l=r(d=it())),h=0;h<=f;++h){if(!(h<f&&s(p=e[h],h,e))===y)if(y=!y)c=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),u=h-1;u>=c;--u)l.point(_[u],x[u]);l.lineEnd(),l.areaEnd()}y&&(_[h]=+t(p,h,e),x[h]=+n(p,h,e),l.point(i?+i(p,h,e):_[h],o?+o(p,h,e):x[h]))}if(d)return l=null,d+""||null}function c(){return Ct().defined(s).curve(r).context(a)}return e(h,"area"),e(c,"arealine"),h.x=function(e){return arguments.length?(t="function"==typeof e?e:nt(+e),i=null,h):t},h.x0=function(e){return arguments.length?(t="function"==typeof e?e:nt(+e),h):t},h.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:nt(+t),h):i},h.y=function(t){return arguments.length?(n="function"==typeof t?t:nt(+t),o=null,h):n},h.y0=function(t){return arguments.length?(n="function"==typeof t?t:nt(+t),h):n},h.y1=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:nt(+t),h):o},h.lineX0=h.lineY0=function(){return c().x(t).y(n)},h.lineY1=function(){return c().x(t).y(o)},h.lineX1=function(){return c().x(i).y(n)},h.defined=function(t){return arguments.length?(s="function"==typeof t?t:nt(!!t),h):s},h.curve=function(t){return arguments.length?(r=t,null!=a&&(l=r(a)),h):r},h.context=function(t){return arguments.length?(null==t?a=l=null:l=r(a=t),h):a},h}function Ft(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function It(t){return t}function Et(){var t=It,i=Ft,n=null,o=nt(0),s=nt(ft),a=nt(0);function r(e){var r,l,h,c,u,p=e.length,d=0,f=new Array(p),y=new Array(p),_=+o.apply(this,arguments),x=Math.min(ft,Math.max(-ft,s.apply(this,arguments)-_)),m=Math.min(Math.abs(x)/p,a.apply(this,arguments)),g=m*(x<0?-1:1);for(r=0;r<p;++r)(u=y[f[r]=r]=+t(e[r],r,e))>0&&(d+=u);for(null!=i?f.sort(function(t,e){return i(y[t],y[e])}):null!=n&&f.sort(function(t,i){return n(e[t],e[i])}),r=0,h=d?(x-p*g)/d:0;r<p;++r,_=c)l=f[r],c=_+((u=y[l])>0?u*h:0)+g,y[l]={data:e[l],index:r,value:u,startAngle:_,endAngle:c,padAngle:m};return y}return e(r,"pie"),r.value=function(e){return arguments.length?(t="function"==typeof e?e:nt(+e),r):t},r.sortValues=function(t){return arguments.length?(i=t,n=null,r):i},r.sort=function(t){return arguments.length?(n=t,i=null,r):n},r.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:nt(+t),r):o},r.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:nt(+t),r):s},r.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:nt(+t),r):a},r}function Ot(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function Rt(t){this._context=t}function Dt(t){return new Rt(t)}function jt(t,e){this._basis=new Rt(t),this._beta=e}e(yt,"acos"),e(_t,"asin$1"),e(xt,"arcInnerRadius$1"),e(mt,"arcOuterRadius$1"),e(gt,"arcStartAngle$1"),e(bt,"arcEndAngle$1"),e(vt,"arcPadAngle$1"),e(wt,"intersect$1"),e(St,"cornerTangents$1"),e(At,"d3Arc"),e(kt,"Linear$1"),kt.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},e(Mt,"d3CurveLinear"),e(Pt,"x$1"),e(Tt,"y$1"),e(Ct,"d3Line"),e(zt,"d3Area"),e(Ft,"descending"),e(It,"identity$2"),e(Et,"d3Pie"),e(Ot,"point$7"),e(Rt,"Basis$1"),Rt.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 3:Ot(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ot(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},e(Dt,"d3CurveBasis"),e(jt,"Bundle$1"),jt.prototype={lineStart:/* @__PURE__ */e(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:/* @__PURE__ */e(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],s=e[0],a=t[i]-o,r=e[i]-s,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*a),this._beta*e[l]+(1-this._beta)*(s+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:/* @__PURE__ */e(function(t,e){this._x.push(+t),this._y.push(+e)},"point")};const Nt=/* @__PURE__ */e(function t(i){function n(t){return 1===i?new Rt(t):new jt(t,i)}return e(n,"bundle"),n.beta=function(e){return t(+e)},n},"custom")(.85);function Lt(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function Bt(t,e){this._context=t,this._k=(1-e)/6}e(Lt,"point$6"),e(Bt,"Cardinal$1"),Bt.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Lt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Lt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const $t=/* @__PURE__ */e(function t(i){function n(t){return new Bt(t,i)}return e(n,"cardinal"),n.tension=function(e){return t(+e)},n},"custom")(0);function Ht(t,e,i){var n=t._x1,o=t._y1,s=t._x2,a=t._y2;if(t._l01_a>ut){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>ut){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*h+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,s,a,t._x2,t._y2)}function qt(t,e){this._context=t,this._alpha=e}e(Ht,"point$5"),e(qt,"CatmullRom$1"),qt.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Ht(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const Vt=/* @__PURE__ */e(function t(i){function n(t){return i?new qt(t,i):new Bt(t,0)}return e(n,"catmullRom"),n.alpha=function(e){return t(+e)},n},"custom")(.5);function Wt(t){return t<0?-1:1}function Gt(t,e,i){var n=t._x1-t._x0,o=e-t._x1,s=(t._y1-t._y0)/(n||o<0&&-0),a=(i-t._y1)/(o||n<0&&-0),r=(s*o+a*n)/(n+o);return(Wt(s)+Wt(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(r))||0}function Xt(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Yt(t,e,i){var n=t._x0,o=t._y0,s=t._x1,a=t._y1,r=(s-n)/3;t._context.bezierCurveTo(n+r,o+r*e,s-r,a-r*i,s,a)}function Ut(t){this._context=t}function Qt(t){return new Ut(t)}function Zt(t){this._context=t}function Jt(t){var e,i,n=t.length-1,o=new Array(n),s=new Array(n),a=new Array(n);for(o[0]=0,s[0]=2,a[0]=t[0]+2*t[1],e=1;e<n-1;++e)o[e]=1,s[e]=4,a[e]=4*t[e]+2*t[e+1];for(o[n-1]=2,s[n-1]=7,a[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)i=o[e]/s[e-1],s[e]-=i,a[e]-=i*a[e-1];for(o[n-1]=a[n-1]/s[n-1],e=n-2;e>=0;--e)o[e]=(a[e]-o[e+1])/s[e];for(s[n-1]=(t[n]+o[n-1])/2,e=0;e<n-1;++e)s[e]=2*t[e+1]-o[e+1];return[o,s]}function Kt(t){return new Zt(t)}function te(t,e){this._context=t,this._t=e}function ee(t){return new te(t,.5)}function ie(t){return new te(t,0)}function ne(t){return new te(t,1)}e(Wt,"sign$1"),e(Gt,"slope3$1"),e(Xt,"slope2$1"),e(Yt,"point$4"),e(Ut,"MonotoneX$1"),Ut.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Yt(this,this._t0,Xt(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Yt(this,Xt(this,i=Gt(this,t,e)),i);break;default:Yt(this,this._t0,i=Gt(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(Ut.prototype).point=function(t,e){Ut.prototype.point.call(this,e,t)},e(Qt,"monotoneX"),e(Zt,"Natural"),Zt.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x=[],this._y=[]},"lineStart"),lineEnd:/* @__PURE__ */e(function(){var t=this._x,e=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===i)this._context.lineTo(t[1],e[1]);else for(var n=Jt(t),o=Jt(e),s=0,a=1;a<i;++s,++a)this._context.bezierCurveTo(n[0][s],o[0][s],n[1][s],o[1][s],t[a],e[a]);(this._line||0!==this._line&&1===i)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},"lineEnd"),point:/* @__PURE__ */e(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},e(Jt,"controlPoints"),e(Kt,"d3CurveNatural"),e(te,"Step$1"),te.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x=this._y=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,e)}}this._x=t,this._y=e},"point")},e(ee,"d3CurveStep"),e(ie,"stepBefore"),e(ne,"stepAfter");var oe=Array.prototype.slice;function se(t){return t}e(se,"identity$1");var ae=1e-6;function re(t){return"translate("+(t+.5)+",0)"}function le(t){return"translate(0,"+(t+.5)+")"}function he(t){return function(e){return+t(e)}}function ce(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(i){return+t(i)+e}}function ue(){return!this.__axis}function pe(t,i){var n=[],o=null,s=null,a=6,r=6,l=3,h=1===t||4===t?-1:1,c=4===t||2===t?"x":"y",u=1===t||3===t?re:le;function p(e){var p=null==o?i.ticks?i.ticks.apply(i,n):i.domain():o,d=null==s?i.tickFormat?i.tickFormat.apply(i,n):se:s,f=Math.max(a,0)+l,y=i.range(),_=+y[0]+.5,x=+y[y.length-1]+.5,m=(i.bandwidth?ce:he)(i.copy()),g=e.selection?e.selection():e,b=g.selectAll(".domain").data([null]),v=g.selectAll(".tick").data(p,i).order(),w=v.exit(),S=v.enter().append("g").attr("class","tick"),A=v.select("line"),k=v.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),v=v.merge(S),A=A.merge(S.append("line").attr("stroke","currentColor").attr(c+"2",h*a)),k=k.merge(S.append("text").attr("fill","currentColor").attr(c,h*f).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),e!==g&&(b=b.transition(e),v=v.transition(e),A=A.transition(e),k=k.transition(e),w=w.transition(e).attr("opacity",ae).attr("transform",function(t){return isFinite(t=m(t))?u(t):this.getAttribute("transform")}),S.attr("opacity",ae).attr("transform",function(t){var e=this.parentNode.__axis;return u(e&&isFinite(e=e(t))?e:m(t))})),w.remove(),b.attr("d",4===t||2==t?r?"M"+h*r+","+_+"H0.5V"+x+"H"+h*r:"M0.5,"+_+"V"+x:r?"M"+_+","+h*r+"V0.5H"+x+"V"+h*r:"M"+_+",0.5H"+x),v.attr("opacity",1).attr("transform",function(t){return u(m(t))}),A.attr(c+"2",h*a),k.attr(c,h*f).text(d),g.filter(ue).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),g.each(function(){this.__axis=m})}return e(p,"axis"),p.scale=function(t){return arguments.length?(i=t,p):i},p.ticks=function(){return n=oe.call(arguments),p},p.tickArguments=function(t){return arguments.length?(n=null==t?[]:oe.call(t),p):n.slice()},p.tickValues=function(t){return arguments.length?(o=null==t?null:oe.call(t),p):o&&o.slice()},p.tickFormat=function(t){return arguments.length?(s=t,p):s},p.tickSize=function(t){return arguments.length?(a=r=+t,p):a},p.tickSizeInner=function(t){return arguments.length?(a=+t,p):a},p.tickSizeOuter=function(t){return arguments.length?(r=+t,p):r},p.tickPadding=function(t){return arguments.length?(l=+t,p):l},p}function de(t){return pe(1,t)}function fe(t){return pe(2,t)}function ye(t){return pe(3,t)}function _e(t){return pe(4,t)}e(re,"translateX"),e(le,"translateY"),e(he,"number"),e(ce,"center"),e(ue,"entering"),e(pe,"axis"),e(de,"axisTop"),e(fe,"axisRight"),e(ye,"axisBottom"),e(_e,"axisLeft");const xe=class _Axis extends l{_origType;_origTimePattern;parser;parserInvert;formatter;d3Scale;d3Axis;d3Guides;_guideElement;svg;svgAxis;svgGuides;_tickFormatFunc;constructor(t="origin"){super(),this._drawStartPos=t,this.updateScale()}lowValue(){return this.parse(this.low())}highValue(){return this.parse(this.high())}parse(t,e){if(t instanceof Array)return t.map(function(t){return this.parse(t)},this);if(null!=t){if(this.parser)return this.parser("number"==typeof t?t.toString():t);if(e&&"string"==typeof t)return+t}return t}parseInvert(t){return t instanceof Array?t.map(function(t){return this.parseInvert(t)},this):this.parserInvert&&t?this.parserInvert(t):t}format(t){return t instanceof Array?t.map(function(t){return this.format(t)},this):null!=t&&this.formatter?this.formatter(t):t}parseFormat(t){return this.format(this.parse(t))}tickFormatFunc(t){return arguments.length?(this._tickFormatFunc=t,this.updateScale(),this):this._tickFormatFunc}scalePos(t){let e=this.d3Scale(this.parse(t));return"ordinal"===this.type()&&(e+=this.bandwidth()/2),e}bandwidth(){return this.d3Scale.bandwidth?this.d3Scale.bandwidth():0}isHorizontal(){switch(this.orientation()){case"left":case"right":return!1}return!0}domain(t){return arguments.length?(this.d3Scale.domain(t),this):this.d3Scale.domain()}range(t){if(!arguments.length){if(this.d3Scale.rangeRoundBands)return this.d3Scale.rangeExtent();if(this.d3Scale.rangeRound)return this.d3Scale.range()}return this.d3Scale.rangeRoundBands?this.d3Scale.rangeRoundBands(t,.1):this.d3Scale.rangeRound&&this.d3Scale.range(t),this}invert(t){return this.d3Scale.invert(t)}guideTarget(t){return this._guideElement=h(t).attr("class",this._class),this}enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgAxis=this.svg.append("g").attr("class","axis"),this.svgGuides=(this._guideElement||e).append("g").attr("class","guide")}_prevOrientation;updateScale(){switch(this.type()){case"ordinal":if(this.d3Scale=x().paddingInner(this.ordinalPaddingInner()).paddingOuter(this.ordinalPaddingOuter()),this.ordinals_exists()&&this.d3Scale.domain(this.ordinals()),this.parser=null,this.ordinalMappings_exists()){const t=this.ordinalMappings();this.formatter=e=>t[e]||e}else this.formatter=null;break;case"linear":this.d3Scale=_(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?f(this.tickFormat()):null;break;case"pow":this.d3Scale=y().exponent(this.powExponent()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?f(this.tickFormat()):null;break;case"log":this.d3Scale=d().base(this.logBase()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?f(this.tickFormat()):null;break;case"time":this.d3Scale=c(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=this.timePattern_exists()?u(this.timePattern()):null,this.parserInvert=this.timePattern_exists()?p(this.timePattern()):null,this._tickFormatFunc?this.formatter=this._tickFormatFunc:this.formatter=this.tickFormat_exists()?p(this.tickFormat()):null}if(this._prevOrientation!==this.orientation()){switch(this.orientation()){case"left":this.d3Axis=_e(this.d3Scale),this.d3Guides=_e(this.d3Scale);break;case"top":this.d3Axis=de(this.d3Scale),this.d3Guides=de(this.d3Scale);break;case"right":this.d3Axis=fe(this.d3Scale),this.d3Guides=fe(this.d3Scale);break;default:this.d3Axis=ye(this.d3Scale),this.d3Guides=ye(this.d3Scale)}this._prevOrientation=this.orientation(),this.svgAxis&&this.svgAxis.html(""),this.svgGuides&&this.svgGuides.html("")}if(this.extend())if("ordinal"===this.type());else{let t,e,i,n,o,s;this.isHorizontal()?(t=this.width(),this.d3Scale.range([0,t]),e=t*this.extend()/100,i=this.d3Scale.invert(0),o=this.d3Scale.invert(-e),n=this.d3Scale.invert(t),s=this.d3Scale.invert(t+e)):(t=this.height(),this.d3Scale.range([t,0]),e=t*this.extend()/100,i=this.d3Scale.invert(t),o=this.d3Scale.invert(t+e),n=this.d3Scale.invert(0),s=this.d3Scale.invert(-e)),o===i&&(o=i-i*this.extend()/100),s===n&&(s=n+n*this.extend()/100),Math.sign(i)!==Math.sign(o)&&(o=0),Math.sign(n)!==Math.sign(s)&&(s=0),this.d3Scale.domain([o,s])}this.d3Axis.scale(this.d3Scale).tickFormat(this.formatter).ticks(this.tickCount()),this.d3Guides.scale(this.d3Scale).tickSize(this.tickLength_exists()?-this.tickLength():0).tickFormat("").ticks(this.tickCount());const t=this.ticks();return t.length&&(this.d3Axis.tickValues(t.map(t=>this.parse(t.value))).tickFormat((e,i)=>t[i].label),this.d3Guides.tickValues(t.map(t=>this.parse(t.value)))),this}adjustText(t,e){const i=this.isHorizontal(),n="left"===this.orientation(),o="bottom"===this.orientation(),s=this,a=t.selectAll(".tick > text").style("font-family",this.fontFamily()).style("font-size",this.fontSize_exists()?this.fontSize()+"px":null);if("linebreak"===this.overlapMode())"ordinal"===this.type()&&a.call(function(){return s.linebreak.apply(s,arguments)},this.bandwidth());else if("wrap"===this.overlapMode())"ordinal"===this.type()&&a.call(function(){return s.wrap.apply(s,arguments)},this.bandwidth());else switch(i?this.overlapMode():"none"){case"stagger":a.style("text-anchor","middle").attr("dy",function(t,i){return(o?1:-1)*((o?.71:0)+i%e)+"em"}).attr("dx",0).attr("visibility",null).attr("transform","rotate(0)");break;case"hide":a.style("text-anchor","middle").attr("dy",(o?.71:0)+"em").attr("dx",0).attr("visibility",function(t,i){return i%e?"hidden":null}).attr("transform","rotate(0)");break;case"rotate":const t=-this.labelRotation()||0;if(0!==t&&e>1){a.each(function(){const e=h(this),i=e.node().getBBox(),n=(o?1:-1)*Math.sin(Math.PI*(-Math.abs(t)/180));e.style("text-anchor",t>0?o?"start":"end":o?"end":"start").attr("dy",i.height/2*n+"px").attr("dx",t>0?o?"0.71em":"-0.71em":o?"-0.71em":"0.71em").attr("transform","rotate("+t+")").attr("visibility",null)});break}default:a.style("text-anchor",i?"middle":n?"end":"start").attr("dy",i?(o?.71:0)+"em":"0.32em").attr("dx",0).attr("visibility",null).attr("transform","rotate(0)")}}calcTickOverlapModulus(t){let e=1;switch(this.overlapMode()){case"rotate":case"stagger":case"hide":const i=[];t.selectAll(".tick > text").each(function(){const t=this.getBoundingClientRect();for(let n=i.length-1;n>=0&&!(i[n].right<t.left);--n)i.length+1-n>e&&(e=i.length+1-n);i.push(t)})}return e}calcOverflow(t,e){if(this.updateScale(),this.hidden())return{left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:1};const i=this.isHorizontal();this.range(i?[0,this.width()]:[this.height(),0]);const n=t.append("g").attr("class",this.classID()),o=n.append("g");o.attr("class",i?"x":"y").call(this.d3Axis),e&&t.selectAll(".tick > text").remove();const s={left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:this.calcTickOverlapModulus(o)};this.adjustText(o,s.tickOverlapModulus);const a=o.node().getBBox();switch(s.depth=i?a.height:a.width,this.shrinkToFit()){case"low":case"both":s.left=i?-a.x:0,s.bottom=i?0:-(this.height()-(a.height+a.y))}switch(this.shrinkToFit()){case"high":case"both":s.top=i?0:-a.y,s.right=i?-(this.width()-a.x-a.width):0}return n.remove(),s}wrap(t,e,i){i=i||/\s+/;const n=this;t.each(function(){const t=h(this),o=t.text().split(i).reverse();let s=[],a=0;const r=t.attr("x"),l=t.attr("y"),c=parseFloat(t.style("font-size"))||10,u=Math.floor(e/(1.1*c))-1,p=n.isHorizontal()?1:Math.ceil(o.length/u),d=parseFloat(t.attr("dy"));let f=t.text(null).append("tspan").attr("x",r).attr("y",l).attr("dy",d+"em"),y=0,_=o.pop();for(;_;)s.push(_),f.text(s.join(" ")),y++,f.node().getComputedTextLength()>e&&y>=p&&(s.pop(),f.text(s.join(" ")),s=[_],f=t.append("tspan").attr("x",r).attr("y",l).attr("dy",1.1*++a+d+"em").text(_),y=0),_=o.pop();n.isHorizontal()||t.selectAll("tspan").attr("y",-a/2+"em")})}linebreak(t,e){this.wrap(t,e,"\n")}update(t,i){super.update(t,i),this.svg.style("display",this.hidden()?"none":null);const n=this.calcOverflow(i),o=this.isHorizontal()?n.left:this.height()-n.top-n.bottom,s=this.isHorizontal()?this.width()-n.right-this.padding():0+this.padding();this.range(this.reverse()?[s,o]:[o,s]);const a=this;function r(t){t.attr("transform",function(){switch(a.orientation()){case"left":return"translate("+n.depth+", "+n.top+")";case"top":return"translate(0,"+n.depth+")";case"right":return"translate("+(a.width()-n.depth)+", "+n.top+")";case"bottom":return"translate(0,"+(a.height()-n.depth)+")"}return"translate(0,0)"})}e(r,"doPosition"),this.svg.style("visibility","none"===this.type()?"hidden":null).transition().call(r),this._guideElement&&this.svgGuides.transition().call(r),this.svgAxis.call(this.d3Axis),this.adjustText(this.svgAxis,n.tickOverlapModulus);this.pos().x;const l=this.width(),h=this.svgAxis.selectAll(".axisTitle").data(this.title()?[this.title()]:[]),c=h.enter().append("text").attr("class","axisTitle").merge(h).transition().attr("dx",null).style("text-anchor","end");switch(this.orientation()){case"left":c.attr("transform","rotate(-90)").attr("x",-2).attr("y",2).attr("dy",".71em");break;case"right":c.attr("transform","rotate(-90)").attr("x",-2).attr("y",4).attr("dx",null).attr("dy","-.71em");break;case"top":c.attr("transform","rotate(0)").attr("x",l-2).attr("y",2).attr("dx",null).attr("dy",".71em");break;case"bottom":c.attr("transform","rotate(0)").attr("x",l-2).attr("y",-2).attr("dy",null)}c.text(this.title_exists()?this.title():""),h.exit().remove(),this.svgGuides.call(this.d3Guides).selectAll(".tick").classed("guide-0",t=>0===t&&this.low()<0)}rerender(){this.svgAxis.call(this.d3Axis),this.svgGuides.call(this.d3Guides)}postUpdate(t,e){super.postUpdate(t,e),this._guideElement&&this._guideElement.attr("transform",this._element.attr("transform"))}};e(xe,"Axis");let me=xe;me.prototype._class+=" chart_Axis",me.prototype.publish("type","linear","set","Type",["none","ordinal","linear","pow","log","time"]),me.prototype.publish("timePattern","%Y-%m-%d","string","Time Series Pattern",null,{disable:/* @__PURE__ */e(t=>"time"!==t.type(),"disable")}),me.prototype.publish("reverse",!1,"boolean","Reverse"),me.prototype.publish("title",null,"string","Title"),me.prototype.publish("orientation","bottom","set","Placement/orientation of the axis",["left","top","right","bottom"]),me.prototype.publish("powExponent",2,"number","Power exponent (disabled when type is not 'pow')",null,{disable:/* @__PURE__ */e(t=>"pow"!==t.type(),"disable")}),me.prototype.publish("logBase",10,"number","Logarithmic base (disabled when type is not 'log')",null,{disable:/* @__PURE__ */e(t=>"log"!==t.type(),"disable")}),me.prototype.publish("ordinals",[],"array","Array of ordinal values to display (disabled when type is not 'ordinal')",null,{disable:/* @__PURE__ */e(t=>"ordinal"!==t.type(),"disable")}),me.prototype.publish("fontSize",null,"number","Size of tick label font (pixels)",null,{optional:!0}),me.prototype.publish("fontFamily",null,"string","Font family of tick labels",null,{optional:!0}),me.prototype.publish("tickCount",null,"number","Number of ticks to display (disabled when type is 'ordinal')",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.type(),"disable")}),me.prototype.publish("tickFormat",null,"string","Format rules for tick text (disabled when type is 'ordinal')",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.type(),"disable")}),me.prototype.publish("tickLength",null,"number","Height (or width for left/right orientations) of the axis ticks (in pixels)",null,{optional:!0}),me.prototype.publish("ticks",[],"array","Custom tick labels",null,{optional:!0}),me.prototype.publish("low",null,"any","Minimum tick value (disabled when type is ordinal)",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.type(),"disable")}),me.prototype.publish("high",null,"any","Maximum tick value (disabled when type is ordinal)",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.type(),"disable")}),me.prototype.publish("overlapMode","none","set","Specifies the behavior when tick labels overlap",["none","stagger","hide","rotate","linebreak","wrap"]),me.prototype.publish("labelRotation",33,"number","Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')",null,{optional:!0,disable:/* @__PURE__ */e(t=>"rotate"!==t.overlapMode(),"disable")}),me.prototype.publish("shrinkToFit","both","set","shrinkToFit",["none","low","high","both"]),me.prototype.publish("extend",5,"number","Extend the axis range by this % beyond what is needed to display the data (disabled when type is 'ordinal')",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.type(),"disable")}),me.prototype.publish("hidden",!1,"boolean","Hides axis when 'true'"),me.prototype.publish("ordinalPaddingInner",.1,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)",null,{disable:/* @__PURE__ */e(t=>"ordinal"!==t.type(),"disable")}),me.prototype.publish("ordinalPaddingOuter",.1,"number","Determines the ratio of the range that is reserved for blank space before the first band and after the last band (0->1)",null,{disable:/* @__PURE__ */e(t=>"ordinal"!==t.type(),"disable")}),me.prototype.publish("ordinalMappings",null,"object","Alternative label mappings (icons)",null,{optional:!0}),me.prototype.publish("padding",0,"number","Padding space at top of axis (pixels)",null,{optional:!0}),me.prototype._origType=me.prototype.type,me.prototype.type=function(t){const e=me.prototype._origType.apply(this,arguments);return void 0!==t&&(this._type=t,this.updateScale()),e},me.prototype._origTimePattern=me.prototype.timePattern,me.prototype.timePattern=function(t){const e=me.prototype._origTimePattern.apply(this,arguments);return void 0!==t&&(this._timePattern=t,this.updateScale()),e};const ge=class _XYAxis extends l{domainAxis;valueAxis;xAxis;yAxis;xyBrush;xBrush;yBrush;margin;focusChart;constructor(){super(),m.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.domainAxis=(new me).classed({domain:!0}).orientation_default("bottom").type("ordinal").overlapMode_default("stagger").shrinkToFit_default("high").extend_default(0),this.valueAxis=(new me).classed({value:!0}).orientation_default("left").type("linear").shrinkToFit_default("high"),this.xyBrush=g().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.xBrush=b().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.yBrush=v().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2())}_prevBrush;resetSelection(){return this._prevBrush=null,this}parseData(t){return this.domainAxis.parse(t)}parseValue(t){return this.valueAxis.parse(t,!0)}formatData(t){return this.domainAxis.format(t)}formatValue(t){return this.valueAxis.format(t)}parsedData(){return this.data().map(function(t){let e=0;return t.map(function(t,i){if(0===i)return this.parseData(t);if(i>=this.columns().length)return t;const n=this.yAxisStacked()?[e,e+this.parseValue(t)]:this.parseValue(t);return e+=this.parseValue(t),n},this)},this)}bandwidth(){return this.domainAxis.bandwidth()}svg;svgRegions;svgDomainGuide;svgValueGuide;svgData;svgDataClipRect;svgFocus;svgBrush;enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgRegions=e.append("g"),this.svgDomainGuide=this.svg.append("g"),this.svgValueGuide=this.svg.append("g"),this.svgData=this.svg.append("g"),this.svgDataClipRect=this.svg.append("clipPath").attr("id",this.id()+"_clippath").append("rect").attr("x",0).attr("y",0),this.svgData=this.svg.append("g").attr("clip-path","url(#"+this.id()+"_clippath)"),this._selection.widgetElement(this.svgData),this.svgFocus=e.append("g"),this.domainAxis.target(this.svg.node()).guideTarget(this.svgDomainGuide.node()),this.valueAxis.target(this.svg.node()).guideTarget(this.svgValueGuide.node()),this.svgBrush=e.append("g").attr("class","brush"),this.chartsEnter(this,this.svgData,250)}resizeBrushHandle(t,e,i){let n,o,s;return"e"===t.type||"w"===t.type?(n=+("e"===t.type),o=n?1:-1,s=i/3,"M"+.5*o+","+s+"A6,6 0 0 "+n+" "+6.5*o+","+(s+6)+"V"+(2*s-6)+"A6,6 0 0 "+n+" "+.5*o+","+2*s+"ZM"+2.5*o+","+(s+8)+"V"+(2*s-8)+"M"+4.5*o+","+(s+8)+"V"+(2*s-8)):(n=+("s"===t.type),s=n?1:-1,o=e/3,"M"+o+", "+.5*s+"A6,6 0 0 "+(n+1)%2+" "+(o+6)+","+6.5*s+"H"+(2*o-6)+"A6,6 0 0 "+(n+1)%2+" "+2*o+","+.5*s+"ZM"+(o+8)+","+2.5*s+"H"+(2*o-8)+"M"+(o+8)+","+4.5*s+"H"+(2*o-8))}_skipSelection=!1;skipSelection(t){return arguments.length?(this._skipSelection=t,this):this._skipSelection}brushMoved(){if(this._skipSelection)return;let t=[];const e=this,i=w(this.svgBrush.node());i&&(t=this.data().filter(function(t){const n=e.dataPos(t[0]);if(e.use2dSelection()){const o=e.valuePos(t[1])+e.valueAxis.bandwidth()/2;return n>=i[0][0]&&n<=i[1][0]&&o>=i[0][1]&&o<=i[1][1]}return n>=i[0]&&n<=i[1]})),this.selection(t)}brushMoved2(){const t="horizontal"===this.orientation(),e=this.use2dSelection()?[]:t?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],i=this.svgBrush.selectAll(".handle--custom").data(e),n=S()?.selection;null==n?i.attr("display","none"):t?i.attr("display",null).attr("transform",(t,e)=>"translate("+n[e]+",0)"):i.attr("display",null).attr("transform",(t,e)=>"translate(0, "+n[e]+")")}dataPos(t){return this.domainAxis.scalePos(t)}valuePos(t){return this.valueAxis.scalePos(t)}getAxisSize(t){return{width:this.xAxis?this.xAxis.width():t.xAxis.width(),height:this.yAxis?this.yAxis.height():t.yAxis.width()}}calcMargin(t,e,i){const n={top:!i&&this.selectionMode()?10:2,right:i&&(this.selectionMode()||this.xAxisFocus())?10:2,bottom:(this.xAxisFocus()?this.xAxisFocusHeight():0)+2,left:2},o=this.width()-n.left-n.right,s=this.height()-n.top-n.bottom;let a=0,r=30,l=0,h=30;for(let c=0;c<10;++c){this.xAxis.width(o-h).height(0);const t=this.xAxis.calcOverflow(e),i=t.depth;this.yAxis.width(0).height(s-r);const n=this.yAxis.calcOverflow(e),c=n.depth;if(a=t.right,l=n.top,i===r&&c===h)break;r=i,h=c}return this.xAxis.x(o/2+h/2+n.left).y(s+n.top).width(o-h),this.yAxis.x(n.left).y(s/2-r/2+n.top).height(s-r),n.left+=h,n.top+=l,n.right+=a,n.bottom+=r,n}updateRegions(t,e,i){const n=this,o=this.svgRegions.selectAll(".region").data(this.regions());o.enter().append("rect").attr("class","region"),i?o.attr("x",function(t){return n.dataPos(t.x0)}).attr("y",0).attr("width",function(t){return n.dataPos(t.x1)-n.dataPos(t.x0)}).attr("height",this.height()).style("stroke",function(t){return n._palette(t.colorID)}).style("fill",function(t){return A(n._palette(t.colorID)).brighter()}):o.attr("x",0).attr("y",function(t){return n.dataPos(t.x0)}).attr("width",this.width()).attr("height",function(t){return n.dataPos(t.x0)-n.dataPos(t.x1)}).style("stroke",function(t){return n._palette(t.colorID)}).style("fill",function(t){return A(n._palette(t.colorID)).brighter()}),o.exit().remove()}_prevXAxisType;update(t,e){super.update(t,e);const i=this,n="horizontal"===this.orientation();if(this.updateRegions(t,e,n),this.domainAxis.orientation(n?"bottom":"left").title(this.xAxisTitle_exists()?this.xAxisTitle():this.columns()[0]),this.valueAxis.orientation(n?"left":"bottom"),this.xAxis=n?this.domainAxis:this.valueAxis,this.yAxis=n?this.valueAxis:this.domainAxis,"ordinal"===this.xAxisType()){const t=this.columns().length,e={};this.domainAxis.ordinals(this.data().map(function(n){return e[n[0]]=i.xAxisOrdinalMapping(n,n[t]),n[0]})).ordinalMappings(e)}else{const t=this.xAxisDomainLow()?this.xAxisDomainLow():this.domainAxis.parseInvert(k(this.parsedData(),function(t){return t[0]})),e=this.xAxisDomainHigh()?this.xAxisDomainHigh():this.domainAxis.parseInvert(M(this.parsedData(),function(t){return t[0]}));void 0!==t&&void 0!==e&&this.domainAxis.low(t).high(e)}const o=this.yAxisDomainLow()?this.yAxisDomainLow():this.valueAxis.parseInvert(k(this.parsedData(),function(t){return k(t.filter(function(t,e){return e>0&&i.columns()[e]&&0!==i.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[0]:t})})),s=this.yAxisDomainHigh()?this.yAxisDomainHigh():this.valueAxis.parseInvert(M(this.parsedData(),function(t){return M(t.filter(function(t,e){return e>0&&i.columns()[e]&&0!==i.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[1]:t})}));this.valueAxis.low(o).high(s),this.margin=this.calcMargin(t,e,n);let a=this.width()-this.margin.left-this.margin.right;a<0&&(a=0);let r=this.height()-this.margin.top-this.margin.bottom;r<0&&(r=0);const l=n?a:r,h=n?r:a;if(this.domainAxis.tickLength(this.xAxisGuideLines()?h:0).render(),this.valueAxis.tickLength(this.yAxisGuideLines()?l:0).render(),this.svgDataClipRect.attr("width",a).attr("height",r),this.svgData.transition().attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.updateBrush(a,r,l,n),this.updateFocusChart(t,e,this.margin,a,r,n),this.chartsUpdate(a,r,250),this.selectionMode())return this.brushMoved()}updateBrush(t,e,i,n){const o=this.use2dSelection()?this.xyBrush:n?this.xBrush:this.yBrush,s=w(this.svgBrush.node());o.extent([[0,0],[t,e]]),this.svgBrush.attr("transform","translate("+this.margin.left+", "+this.margin.top+")").style("display",this.selectionMode()?null:"none").call(o);const a=this.use2dSelection()?[]:n?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],r=this.svgBrush.selectAll(".handle--custom").data(a);if(r.enter().append("path").attr("class","handle--custom").merge(r).attr("cursor",n?"ew-resize":"ns-resize").attr("d",i=>this.resizeBrushHandle(i,t,e)),this.selectionMode()){if(this._prevXAxisType!==this.xAxisType()&&(this._prevXAxisType=this.xAxisType(),this._prevBrush=null),this._prevBrush){if(s){if(this._prevBrush.orientation!==this.orientation()){const t=s[0];s[0]=this._prevBrush.maxCurrExtent-s[1],s[1]=this._prevBrush.maxCurrExtent-t}const t=i/this._prevBrush.maxCurrExtent;1!==t&&this.svgBrush.transition().on("start",function(){o.on("end",null)}).call(o.move,[s[0]*t,s[1]*t]).on("end",()=>{o.on("end",()=>this.brushMoved())})}}else this.svgBrush.call(o.move,[0,i]);this._prevBrush={orientation:this.orientation(),maxCurrExtent:i}}}updateFocusChart(t,e,i,n,o,s){const a=this,r=this.svgFocus.selectAll("#"+this.id()+"_focusChart").data(this.xAxisFocus()?[!0]:[]);r.enter().append("g").attr("id",this.id()+"_focusChart").attr("class","focus").each(function(){a.focusChart=(new a.constructor).target(this),a.focusChart.xBrush.on("brush.focus",function(){a.syncAxis(n),a.chartsUpdate(n,o,0)}),a.focusChart.layers(a.layers().map(t=>new t.constructor))}).merge(r).each(function(){a.copyPropsTo(a.focusChart,["layers"]);let t=0;for(const e of a.layers())e.copyPropsTo(a.focusChart.layers()[t]),t++;a.focusChart.xAxisFocus(!1).selectionMode(!0).skipSelection(!0).orientation("horizontal").xAxisGuideLines(!1).xAxisDomainLow(null).xAxisDomainHigh(null).yAxisGuideLines(!1).x(a.width()/2).y(a.height()-a.xAxisFocusHeight()/2).width(a.width()).height(a.xAxisFocusHeight()).columns(a.columns()).data(a.data()).render(),a.syncAxis(n)}),r.exit().each(function(){a.focusChart&&(a.focusChart.target(null),delete a.focusChart)}).remove()}syncAxis(t){const e=w(this.focusChart.svgBrush.node());if(e){if("ordinal"!==this.focusChart.xAxisType())this.xAxis.domain([this.focusChart.xAxis.invert(e[0]),this.focusChart.xAxis.invert(e[1])]);else{const i=(e[1]-e[0])/t;this.xAxis.range([-e[0]/i,(t-e[0])/i])}this.xAxis.rerender()}}layerColumns(t){const e=t.columns(),i=super.columns().filter(t=>t!==e[0]);return i.length?[e[0],...i]:e}layerColumnIndices(t){const e=t.columns();return this.layerColumns(t).map(t=>e.indexOf(t))}layerColumnIndex(t,e){return t.columns().indexOf(e)}layerData(t){if(1===arguments.length){const e=this.layerColumnIndices(t);return t.data().map(t=>{const i=e.map(e=>t[e]);return i.__hpcc_origRow=t,i})}throw new Error("Setting data on XYAxisLayer is not supported.")}layerEnter(t,e,i=250){}layerUpdate(t,e,i=250){}layerExit(t,e,i=250){}chartsEnter(t,e,i=250){this.layerEnter(this,e,i);for(const n of this.layers())n.__xyAxisElement=e.append("g").attr("class",n.class()),n.target(n.__xyAxisElement.node()).layerEnter(this,e,i)}chartsUpdate(t,e,i){this.layerUpdate(this,this.svgData,i);for(const n of this.layers())n.resize({width:t,height:e}).layerUpdate(this,n.__xyAxisElement,i)}exit(t,e){this.valueAxis.target(null),this.domainAxis.target(null),super.exit(t,e)}selection(t){const e=this;this._selection.widgetElement().selectAll(".selected,.deselected").each(function(i){const n=t.indexOf(i.origRow)>=0;h(this).classed("selected",n).classed("deselected",!n).attr("filter",e._selection.svgGlowID()&&n?`url(#${e._selection.svgGlowID()})`:null)});const i=t.map(t=>this.rowToObj(t));setTimeout(()=>{this.click(i,"",!0)},0)}xAxisOrdinalMapping(t,e){return t[0]}click(t,e,i){}_selection};e(ge,"XYAxis");let be=ge;be.prototype._class+=" chart_XYAxis",be.prototype.mixin(m.SimpleSelectionMixin),be.prototype.publish("orientation","horizontal","set","Selects orientation for the axis",["horizontal","vertical"]),be.prototype.publish("pointSizeColumn",null,"string","pointSizeColumn",null,{optional:!0}),be.prototype.publish("minPointSize",6,"number","minPointSize"),be.prototype.publish("maxPointSize",26,"number","maxPointSize"),be.prototype.publish("use2dSelection",!1,"boolean","2D Range Selector"),be.prototype.publish("selectionMode",!1,"boolean","Range Selector"),be.prototype.publishProxy("xAxisTitle","domainAxis","title"),be.prototype.publishProxy("xAxisTickCount","domainAxis","tickCount"),be.prototype.publishProxy("xAxisTickFormat","domainAxis","tickFormat"),be.prototype.publishProxy("xAxisTicks","domainAxis","ticks"),be.prototype.publishProxy("xAxisType","domainAxis","type"),be.prototype.publishProxy("xAxisTypeTimePattern","domainAxis","timePattern"),be.prototype.publish("xAxisDomainLow",null,"string","X-Axis Low",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.xAxisType(),"disable")}),be.prototype.publish("xAxisDomainHigh",null,"string","X-Axis High",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.xAxisType(),"disable")}),be.prototype.publishProxy("xAxisFontSize","domainAxis","fontSize"),be.prototype.publishProxy("xAxisFontFamily","domainAxis","fontFamily"),be.prototype.publishProxy("xAxisOrdinalPaddingInner","domainAxis","ordinalPaddingInner"),be.prototype.publishProxy("xAxisOrdinalPaddingOuter","domainAxis","ordinalPaddingOuter"),be.prototype.publishProxy("xAxisOverlapMode","domainAxis","overlapMode"),be.prototype.publishProxy("xAxisLabelRotation","domainAxis","labelRotation"),be.prototype.publishProxy("xAxisDomainPadding","domainAxis","extend"),be.prototype.publish("xAxisGuideLines",!1,"boolean","Y-Axis Guide Lines"),be.prototype.publish("xAxisFocus",!1,"boolean","X-Axis Focus",null,{disable:/* @__PURE__ */e(t=>"horizontal"!==t.orientation(),"disable")}),be.prototype.publish("xAxisFocusHeight",80,"number","X-Axis Focus Height",null,{disable:/* @__PURE__ */e(t=>!t.xAxisFocus(),"disable")}),be.prototype.publishProxy("xAxisHidden","domainAxis","hidden"),be.prototype.publishProxy("yAxisFontSize","valueAxis","fontSize"),be.prototype.publishProxy("yAxisFontFamily","valueAxis","fontFamily"),be.prototype.publishProxy("yAxisTitle","valueAxis","title"),be.prototype.publishProxy("yAxisTickCount","valueAxis","tickCount"),be.prototype.publishProxy("yAxisTickFormat","valueAxis","tickFormat"),be.prototype.publishProxy("yAxisTicks","valueAxis","ticks"),be.prototype.publishProxy("yAxisType","valueAxis","type"),be.prototype.publishProxy("yAxisTypeTimePattern","valueAxis","timePattern"),be.prototype.publishProxy("yAxisTypePowExponent","valueAxis","powExponent"),be.prototype.publishProxy("yAxisTypeLogBase","valueAxis","logBase"),be.prototype.publish("yAxisStacked",!1,"boolean","Stacked Chart",null,{tags:["Basic"],disable:/* @__PURE__ */e(t=>"ordinal"!==t.xAxisType()||t._class.indexOf("chart_Column")<0,"disable")}),be.prototype.publish("yAxisDomainLow",null,"string","Y-Axis Low",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.yAxisType(),"disable")}),be.prototype.publish("yAxisDomainHigh",null,"string","Y-Axis High",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.yAxisType(),"disable")}),be.prototype.publishProxy("yAxisDomainPadding","valueAxis","extend"),be.prototype.publish("yAxisGuideLines",!0,"boolean","Y-Axis Guide Lines"),be.prototype.publishProxy("yAxisHidden","valueAxis","hidden"),be.prototype.publish("regions",[],"array","Regions"),be.prototype.publish("layers",[],"widgetArray","Layers",null,{render:!1}),be.prototype.publishProxy("xAxisPadding","domainAxis","padding"),be.prototype.publishProxy("yAxisPadding","valueAxis","padding");const ve=class _Scatter extends be{constructor(){super(),n.call(this),o.call(this),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}curve(){switch(this.interpolate()){case"linear":return Mt;case"step":return ee;case"step-before":return ie;case"step-after":return ne;case"basis":return Dt;case"bundle":return Nt;case"cardinal":return $t;case"catmullRom":return Vt;case"natural":return Kt;default:return Qt}}getScale(){switch(this.pointSizeScale()){case"linear":return _();case"pow":return y().exponent(2);case"log":return d();case"sqrt":return P()}}pointColor(t,e,i,n){return this.interpolate()&&this.pointDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}lineColor(t,e,i,n){return this.interpolateFill()&&this.interpolateDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}areaColor(t,e,i,n){return this.fillColor(t,e,i,n)}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(t){return"series-table"===n.tooltipStyle()?n.tooltipFormat({label:t.label,arr:n.columns().slice(1).map(function(e,i){return{label:e,color:n._palette(e),value:n.data()[t.rowIdx][i+1]}})}):n.tooltipFormat({label:t.label,series:t.column,value:t.value})})}_prevPointShape;layerUpdate(t,i,n=250){super.layerUpdate(t,i);const o="horizontal"===t.orientation(),s=o?this.height():this.width(),a=this;function r(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._prevPointShape!==this.pointShape()&&(i.selectAll(".data").remove(),this._prevPointShape=this.pointShape()),e(r,"mapShape");let l,c,u;this.pointSizeColumn_exists()&&(l=this.columns().indexOf(this.pointSizeColumn()),c=T(this.data(),t=>t[l]),u=this.getScale().domain(c));const p=this.layerColumns(t),d=this.layerData(t),f=this.flattenData(p,d).map(function(t){return t.shape=r(a.pointShape()),t.column=p[t.colIdx],t.row=d[t.rowIdx],t.origRow=d[t.rowIdx].__hpcc_origRow,c?(t.size=u(t.row[l])*(a.maxPointSize()-a.minPointSize())+a.minPointSize(),t.column!==a.pointSizeColumn()&&t):(t.size=a.pointSize(),t)}).filter(t=>t),y=i.selectAll(".area").data(p.filter(function(t,e){return a.interpolate()&&a.interpolateFill()&&e>0})),_=y.enter().append("path"),x=zt().curve(this.curve());o?x.x(function(e){return a.xPos(t,e)}).y0(Math.min(s,this.yPos(t,{value:0}))).y1(function(e){return a.yPos(t,e)}):x.y(function(e){return a.yPos(t,e)}).x0(Math.max(0,this.xPos(t,{value:0}))).x1(function(e){return a.xPos(t,e)}),_.merge(y).attr("class",t=>"area series series-"+this.cssTag(t)).each(function(t,e){h(this).attr("d",x(f.filter(function(t){return t.colIdx===e+1}))).style("opacity",a.interpolateFillOpacity()).style("stroke","none").style("fill",a.areaColor([],t,void 0,[]))}),y.exit().remove();const m=i.selectAll(".line").data(p.filter(function(t,e){return a.interpolate()&&e>0})),g=m.enter().append("path"),b=Ct().x(function(e){return a.xPos(t,e)}).y(function(e){return a.yPos(t,e)}).curve(this.curve());g.merge(m).attr("class",t=>"line series series-"+this.cssTag(t)).each(function(t,e){const i=h(this),n=f.filter(function(t){return t.colIdx===e+1});i.attr("d",b(n)).style("stroke",a.lineColor([],t,void 0,[])).style("fill","none")}),m.exit().remove();const v=i.selectAll(".point").data(f,function(t,e){return t.shape+"_"+e});v.enter().append("g").each(function(e){const i=h(this);i.append(e.shape).attr("class","pointShape"),i.append("text").attr("class","pointValue").style("display","none").attr("text-anchor",a.valueAnchor()).attr("alignment-baseline",a.valueBaseline()).attr("fill",function(t,e){return"middle"===a.valueBaseline()||"central"===a.valueBaseline()?a.textColor(t.row,t.column,t.value,t.origRow):null}),i.append("circle").attr("class","pointSelection").on("mouseout.tooltip",a.tooltip.hide).on("mousemove.tooltip",a.tooltip.show).call(t._selection.enter.bind(t._selection)).on("click",function(e,i){a.click(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))}).on("dblclick",function(e,i){a.dblclick(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))})}).merge(v).attr("class",t=>"point series series-"+this.cssTag(t.column)).each(function(e){h(this).select(".pointValue").attr("x",function(e){return a.xPos(t,e)}).attr("y",function(e){return a.yPos(t,e)}).style("display",a.showValue()?"block":"none").attr("text-anchor",a.valueAnchor()).attr("alignment-baseline",a.valueBaseline()).text(function(t){return t.value});h(this).select(".pointSelection").attr("cx",function(e){return a.xPos(t,e)}).attr("cy",function(e){return a.yPos(t,e)}).attr("r",e.size);const i=h(this).select(".pointShape");switch(e.shape){case"rect":i.attr("x",function(i){return a.xPos(t,i)-e.size/2}).attr("y",function(i){return a.yPos(t,i)-e.size/2}).attr("width",e.size).attr("height",e.size).style("fill",a.pointColor(e.row,e.column,e.value,e.origRow));break;case"circle":i.attr("cx",function(e){return a.xPos(t,e)}).attr("cy",function(e){return a.yPos(t,e)}).attr("r",.9*e.size).style("fill",a.pointColor(e.row,e.column,e.value,e.origRow));break;case"path":i.attr("d",function(i){return"M"+(a.xPos(t,i)-e.size/2)+" "+(a.yPos(t,i)-e.size/2)+" L"+(a.xPos(t,i)+e.size/2)+" "+(a.yPos(t,i)+e.size/2)+" M"+(a.xPos(t,i)-e.size/2)+" "+(a.yPos(t,i)+e.size/2)+" L"+(a.xPos(t,i)+e.size/2)+" "+(a.yPos(t,i)-e.size/2)}).style("stroke",a.pointColor(e.row,e.column,e.value,e.origRow))}}),v.exit().remove()}exit(t,e){super.exit(t,e)}};e(ve,"Scatter"),i(ve,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number",multi:!0}]);let we=ve;we.prototype._class+=" chart_Scatter",we.prototype.implements(n.prototype),we.prototype.implements(o.prototype),we.prototype.publish("paletteID","default","set","Color palette for this widget",we.prototype._palette.switch(),{tags:["Basic","Shared"]}),we.prototype.publish("pointSizeScale","linear","set","pointSizeScale",["linear","pow","log","sqrt"]),we.prototype.publish("pointShape","cross","set","Shape of the data points",["circle","rectangle","cross"]),we.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),we.prototype.publish("interpolate","","set","Interpolate Data",["","linear","step","step-before","step-after","basis","bundle","cardinal","catmullRom","natural","monotone"]),we.prototype.publish("pointDarken",!0,"boolean","If true, and interpolate is set, then points will have a slightly darker color than their assigned palette color",null,{disable:/* @__PURE__ */e(t=>!t.interpolate(),"disable")}),we.prototype.publish("interpolateDarken",!0,"boolean","If true, and interpolateFill is true, then lines will have a slightly darker color than their assigned palette color",null,{disable:/* @__PURE__ */e(t=>!t.interpolateFill(),"disable")}),we.prototype.publish("interpolateFill",!1,"boolean","If true, the area between the line and zero will be filled"),we.prototype.publish("interpolateFillOpacity",.66,"number","Fill interpolation Opacity",null,{range:{min:0,step:.01,max:1}}),we.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),we.prototype.publish("showValue",!1,"boolean"),we.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),we.prototype.publish("valueBaseline","ideographic","set","alignment-baseline for shown value text",["auto","baseline","before-edge","text-before-edge","middle","central","after-edge","text-after-edge","ideographic","alphabetic","hanging","mathematical","inherit"]);const Se=class _Area extends we{constructor(){super(),this.interpolate_default("linear").interpolateFill_default(!0)}};e(Se,"Area");let Ae=Se;Ae.prototype._class+=" chart_Area";const ke=class _Column extends be{_linearGap;textLocal=C();stackedTextLocal=C();isHorizontal;constructor(){super(),n.call(this),o.call(this),this._selection.skipBringToTop(!0),this._linearGap=25}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(e){if("series-table"===n.tooltipStyle())return n.tooltipFormat({label:e.row[0],arr:n.columns().slice(1).map(function(t,i){return{label:t,color:n._palette(t),value:e.row[i+1]}})});{let i=e.row[e.idx];return i instanceof Array&&(i=i[1]-i[0]),n.tooltipFormat({label:e.row[0],series:n.layerColumns(t)[e.idx],value:i})}})}adjustedData(t){return this.layerData(t).map(e=>{let i=0;return e.map((e,n)=>{if(0===n)return e;if(n>=this.layerColumns(t).length)return e;const o=t.yAxisStacked()?[i,i+e]:e;return i+=e,o},this)},this)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i);const n="horizontal"===t.orientation();this.isHorizontal=n;const o=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const s=f(o.showValueAsPercentFormat());let a=10,r=0;switch(t.xAxisType()){case"ordinal":a=t.bandwidth(),r=-a/2;break;case"linear":case"time":a=Math.max(Math.abs(t.dataPos(2)-t.dataPos(1))*(100-this._linearGap)/100,a),r=-a/2}this.tooltip.direction(n?"n":"e");const l=x().domain(o.layerColumns(t).filter(function(t,e){return e>0})).rangeRound(n?[0,a]:[a,0]).paddingInner(this.xAxisSeriesPaddingInner()).paddingOuter(0);let c=[];const u=[],p=this.columns().length,d=this.data();this.showValue()&&"series"===this.showValueAsPercent()&&d.forEach(t=>{t.filter((t,e)=>e>0&&e<p).forEach((t,e)=>{void 0===u[e+1]&&(u[e+1]=0),u[e+1]+=t})}),(this.showDomainTotal()||this.showValue()&&"domain"===this.showValueAsPercent())&&(c=d.map(t=>t.filter((t,e)=>e>0&&e<p).reduce((t,e)=>t+e,0)));const y=e.selectAll(".dataRow").data(this.adjustedData(t)),_=t.data(),m=this.getAxisSize(t);y.enter().append("g").attr("class","dataRow").merge(y).each(function(e,d){const y=h(this),x=y.selectAll(".dataCell").data(e.filter(function(e,i){return i<o.layerColumns(t).length}).map(function(i,n){return{column:o.layerColumns(t)[n],row:e,origRow:_[d],value:i,idx:n}}).filter(function(t){return null!==t.value&&t.idx>0}),t=>t.column),g=x.enter().append("g").attr("class","dataCell").on("mouseout.tooltip",function(t){(!o.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&o.tooltip.hide.apply(o,arguments)}).on("mousemove.tooltip",function(t){(!o.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&o.tooltip.show.apply(o,arguments)}).call(t._selection.enter.bind(t._selection)).on("click",function(e){o.click(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).on("dblclick",function(e){o.dblclick(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).style("opacity",0).each(function(t){const e=h(this);e.append("rect").attr("class","columnRect series series-"+o.cssTag(t.column)),e.append("text").attr("class","columnRectText").style("stroke","transparent")});g.transition().duration(i).style("opacity",1);const b=t.yAxisStacked()?a:l.bandwidth();g.merge(x).each(function(a){const y=h(this),_=t.dataPos(e[0])+(t.yAxisStacked()?0:l(a.column))+r,x=a.value instanceof Array?a.value[1]:a.value;let g=a.origRow[a.idx];if(o.showValue()){const t=o.dataMeta();switch(o.showValueAsPercent()){case"series":const e=void 0!==t.sum?t.sum:u[a.idx];g=s(g/e);break;case"domain":const i=void 0!==t.sum?t.sum:c[d];g=s(g/i);break;default:g=f(o.showValueFormat())(g)}}const v=t.valuePos(x),w=t.valuePos(a.value instanceof Array?a.value[0]:0),S=Math.min(w,v),A=Math.abs(v-w),k=o.innerTextFontSize(),M=o.innerTextPadding_exists()?o.innerTextPadding():k/2.5,P=o.intersectRectRect({x:n?_:S,y:n?S:_,width:n?b:A,height:n?A:b},{x:0,y:0,width:m.width,height:m.height}),T=y.select("rect").transition().duration(i).style("fill",t=>o.fillColor(t.row,t.column,t.value,t.origRow));n?T.attr("x",_).attr("y",S).attr("width",b).attr("height",A):T.attr("y",_).attr("x",S).attr("height",b).attr("width",A);const C=y.select("text").transition().duration(i).style("font-size",k+"px").style("fill",t=>o.textColor(t.row,t.column,t.value,t.origRow));C.style("font-family",o.innerTextFontFamily_exists()?o.innerTextFontFamily():null);const F=o.innerTextPadding_exists()?o.innerTextPadding():8,I=k/2.7;if(n){const t=P.y+P.height-M;C.attr("x",_+b/2).attr("y",t+I).attr("transform",`rotate(-90, ${_+b/2}, ${t})`)}else C.attr("x",P.x+F).attr("y",_+b/2+I);C.attr("height",b).attr("width",A),o.showInnerText()&&C.text(t=>{const e=o.innerText(t.origRow,t.origRow[p],t.idx);if(e){const i=n?P.height:P.width,s=o.calcInnerText(i,e,g);return t.innerTextObj=s,s.text}return""});const E=y.selectAll(".dataText").data(o.showValue()?[`${x}`]:[]);E.enter().append("g").attr("class","dataText").each(function(t){o.textLocal.set(this,(new z).target(this).colorStroke_default("transparent"))}).merge(E).each(function(){const t={x:0,y:0},e=o.valueFontFamily(),i=o.valueFontSize(),s=o.textSize(g,e,i),r=parseFloat(g)>=0;let l=o.valueAnchor()?o.valueAnchor():n?"middle":"start";const h=P.x,c=m.width-(P.x+P.width),u=P.y,p=m.height-(P.y+P.height);let d,f,y;if(a.innerTextObj){const{padding:e,valueTextWidth:o}=a.innerTextObj;f=!1,n?(l="middle",t.x=_+b/2,4===a.innerTextObj.category?(f=!0,t.y=S-e-i/2):t.y=S+e+i/2):(l="start",4===a.innerTextObj.category?(f=!0,t.x=A+S+e):t.x=A+S-o-e,t.y=_+b/2)}else n?(d=P.height<s.height,f=!o.valueCentered()||d,t.x=P.x+P.width/2,f?r?(y=u<s.height+F,y?d?t.y=P.y+P.height+s.height:(f=!1,t.y=P.y+P.height/2):t.y=P.y-s.height/2-F):(y=p<s.height,y?d?t.y=P.y-s.height/2-F:(f=!1,t.y=P.y+P.height/2):t.y=P.y+s.height+F):t.y=P.y+P.height/2):(d=P.width<s.width,f=!o.valueCentered()||d,t.y=P.y+P.height/2,f?r?(y=c<s.width+F,y?o.showInnerText()||!d?(f=!1,t.x=P.x+P.width/2):t.x=P.x-(s.width-F):t.x=P.x+P.width+s.width/2+F):(y=h<s.width,y?o.showInnerText()||!d?(f=!1,t.x=P.x+P.width/2):t.x=P.x+P.width+(s.width-F):t.x=P.x-(s.width-F)):t.x=P.x+P.width/2);const x=f?null:o.textColor(a.row,a.column,a.value,a.origRow),v=o.columns(),w=o.yAxisStacked()&&d||f&&o.yAxisStacked()&&v.indexOf(a.column)!==v.length-1;o.textLocal.get(this).pos(t).anchor(l).fontFamily(e).fontSize(i).text(`${g}`).colorFill(x).visible(o.showValue()&&!w).render()}),E.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),x.exit().transition().duration(i).style("opacity",0).remove();const v=t.yAxisStacked()?c[d]:Math.max(...e.filter((t,e)=>e>0&&e<p)),w=y.selectAll(".stackedTotalText").data(o.showDomainTotal()?[c[d]]:[]);w.enter().append("g").attr("class","stackedTotalText").each(function(t){o.stackedTextLocal.set(this,(new z).target(this).colorStroke_default("transparent"))}).merge(w).each(function(i){const s={x:0,y:0},a=t.dataPos(e[0]),r=t.valuePos(v),l=o.valueFontFamily(),h=o.valueFontSize(),c=o.textSize(i,l,h),u=parseFloat(i)>=0;let p="middle";n?(s.x=a,s.y=u?r-c.height/2:r+c.height/2):(p="start",s.y=a,s.x=u?r+c.width/2:r-c.width/2),o.stackedTextLocal.get(this).pos(s).anchor(p).fontFamily(l).fontSize(h).text(i).render()}),w.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),y.exit().transition().duration(i).remove()}calcInnerText(t,e,i){const n=this.innerTextFontFamily_exists()?this.innerTextFontFamily():"Verdana",o=this.innerTextFontSize(),s=this.valueFontFamily_exists()?this.valueFontFamily():"Verdana",a=this.valueFontSize(),r=this.innerTextPadding_exists()?this.innerTextPadding():o/2.5,l=this.isHorizontal?a:this.textSize(i,s,a).width,h=e,c=3*r+this.textSize("...",n,o).width+l,u=1*r+l;let p=4;if(3*r+this.textSize(e,n,o).width+l<t)p=1;else if(c<t){const i=t-c;let s="";for(const t of e){if(this.textSize(s+t,n,o).width>i){e=s+"...";break}s+=t}p=2}else u<t?(e="",p=3):e="";return{text:e,isTruncated:h!==e,padding:r,category:p,valueTextWidth:l}}innerText(t,e,i){return t[0]}};e(ke,"Column"),i(ke,"__inputs",[{id:"label",type:"string"},{id:"values",type:"number",multi:!0}]);let Me=ke;Me.prototype._class+=" chart_Column",Me.prototype.implements(n.prototype),Me.prototype.implements(o.prototype),Me.prototype.publish("valueFontFamily",null,"string","Font family of value text",null,{optional:!0}),Me.prototype.publish("valueFontSize",12,"number","Height of value text (pixels)"),Me.prototype.publish("innerTextFontFamily",null,"string","Font family of inner text",null,{optional:!0}),Me.prototype.publish("innerTextPadding",8,"number","Offset of inner text (pixels)",null,{optional:!0}),Me.prototype.publish("innerTextFontSize",12,"number","Height of inner text (pixels)"),Me.prototype.publish("paletteID","default","set","Color palette for this widget",()=>Me.prototype._palette.switch(),{tags:["Basic","Shared"]}),Me.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Me.prototype.publish("showValue",!1,"boolean","Show Value in column"),Me.prototype.publish("showInnerText",!1,"boolean","Show Label in column"),Me.prototype.publish("showValueFormat",",","string","D3 Format for Value",null,{disable:/* @__PURE__ */e(t=>!t.showValue()||!!t.showValueAsPercent(),"disable")}),Me.prototype.publish("showValueAsPercent",null,"set","If showValue is true, optionally show value as a percentage by Series or Domain",[null,"series","domain"],{disable:/* @__PURE__ */e(t=>!t.showValue(),"disable"),optional:!0}),Me.prototype.publish("showValueAsPercentFormat",".0%","string","D3 Format for %",null,{disable:/* @__PURE__ */e(t=>!t.showValue()||!t.showValueAsPercent(),"disable")}),Me.prototype.publish("showDomainTotal",!1,"boolean","Show Total Value for Stacked Columns",null),Me.prototype.publish("valueCentered",!1,"boolean","Show Value in center of column"),Me.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),Me.prototype.publish("xAxisSeriesPaddingInner",0,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)"),Me.prototype.publish("tooltipInnerTextEllipsedOnly",!1,"boolean","Show tooltip only when inner text is truncated with an ellipsis");const Pe=class _Bar extends Me{constructor(){super(),this.orientation_default("vertical")}};e(Pe,"Bar");let Te=Pe;function Ce(t){var e=0,i=t.children,n=i&&i.length;if(n)for(;--n>=0;)e+=i[n].value;else e=1;t.value=e}function ze(){return this.eachAfter(Ce)}function Fe(t){var e,i,n,o,s=this,a=[s];do{for(e=a.reverse(),a=[];s=e.pop();)if(t(s),i=s.children)for(n=0,o=i.length;n<o;++n)a.push(i[n])}while(a.length);return this}function Ie(t){for(var e,i,n=this,o=[n];n=o.pop();)if(t(n),e=n.children)for(i=e.length-1;i>=0;--i)o.push(e[i]);return this}function Ee(t){for(var e,i,n,o=this,s=[o],a=[];o=s.pop();)if(a.push(o),e=o.children)for(i=0,n=e.length;i<n;++i)s.push(e[i]);for(;o=a.pop();)t(o);return this}function Oe(t){return this.eachAfter(function(e){for(var i=+t(e.data)||0,n=e.children,o=n&&n.length;--o>=0;)i+=n[o].value;e.value=i})}function Re(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function De(t){for(var e=this,i=je(e,t),n=[e];e!==i;)e=e.parent,n.push(e);for(var o=n.length;t!==i;)n.splice(o,0,t),t=t.parent;return n}function je(t,e){if(t===e)return t;var i=t.ancestors(),n=e.ancestors(),o=null;for(t=i.pop(),e=n.pop();t===e;)o=t,t=i.pop(),e=n.pop();return o}function Ne(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Le(){var t=[];return this.each(function(e){t.push(e)}),t}function Be(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function $e(){var t=this,e=[];return t.each(function(i){i!==t&&e.push({source:i.parent,target:i})}),e}function He(t,e){var i,n,o,s,a,r=new Xe(t),l=+t.value&&(r.value=t.value),h=[r];for(null==e&&(e=Ve);i=h.pop();)if(l&&(i.value=+i.data.value),(o=e(i.data))&&(a=o.length))for(i.children=new Array(a),s=a-1;s>=0;--s)h.push(n=i.children[s]=new Xe(o[s])),n.parent=i,n.depth=i.depth+1;return r.eachBefore(Ge)}function qe(){return He(this).eachBefore(We)}function Ve(t){return t.children}function We(t){t.data=t.data.data}function Ge(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Xe(t){this.data=t,this.depth=this.height=0,this.parent=null}Te.prototype._class+=" chart_Bar",e(Ce,"count"),e(ze,"node_count"),e(Fe,"node_each"),e(Ie,"node_eachBefore"),e(Ee,"node_eachAfter"),e(Oe,"node_sum"),e(Re,"node_sort"),e(De,"node_path"),e(je,"leastCommonAncestor"),e(Ne,"node_ancestors"),e(Le,"node_descendants"),e(Be,"node_leaves"),e($e,"node_links"),e(He,"hierarchy"),e(qe,"node_copy"),e(Ve,"defaultChildren"),e(We,"copyData"),e(Ge,"computeHeight"),e(Xe,"Node$1"),Xe.prototype=He.prototype={constructor:Xe,count:ze,each:Fe,eachAfter:Ee,eachBefore:Ie,sum:Oe,sort:Re,path:De,ancestors:Ne,descendants:Le,leaves:Be,links:$e,copy:qe};var Ye=Array.prototype.slice;function Ue(t){for(var e,i,n=t.length;n;)i=Math.random()*n--|0,e=t[n],t[n]=t[i],t[i]=e;return t}function Qe(t){for(var e,i,n=0,o=(t=Ue(Ye.call(t))).length,s=[];n<o;)e=t[n],i&&Ke(i,e)?++n:(i=ei(s=Ze(s,e)),n=0);return i}function Ze(t,e){var i,n;if(ti(e,t))return[e];for(i=0;i<t.length;++i)if(Je(e,t[i])&&ti(ni(t[i],e),t))return[t[i],e];for(i=0;i<t.length-1;++i)for(n=i+1;n<t.length;++n)if(Je(ni(t[i],t[n]),e)&&Je(ni(t[i],e),t[n])&&Je(ni(t[n],e),t[i])&&ti(oi(t[i],t[n],e),t))return[t[i],t[n],e];throw new Error}function Je(t,e){var i=t.r-e.r,n=e.x-t.x,o=e.y-t.y;return i<0||i*i<n*n+o*o}function Ke(t,e){var i=t.r-e.r+1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function ti(t,e){for(var i=0;i<e.length;++i)if(!Ke(t,e[i]))return!1;return!0}function ei(t){switch(t.length){case 1:return ii(t[0]);case 2:return ni(t[0],t[1]);case 3:return oi(t[0],t[1],t[2])}}function ii(t){return{x:t.x,y:t.y,r:t.r}}function ni(t,e){var i=t.x,n=t.y,o=t.r,s=e.x,a=e.y,r=e.r,l=s-i,h=a-n,c=r-o,u=Math.sqrt(l*l+h*h);return{x:(i+s+l/u*c)/2,y:(n+a+h/u*c)/2,r:(u+o+r)/2}}function oi(t,e,i){var n=t.x,o=t.y,s=t.r,a=e.x,r=e.y,l=e.r,h=i.x,c=i.y,u=i.r,p=n-a,d=n-h,f=o-r,y=o-c,_=l-s,x=u-s,m=n*n+o*o-s*s,g=m-a*a-r*r+l*l,b=m-h*h-c*c+u*u,v=d*f-p*y,w=(f*b-y*g)/(2*v)-n,S=(y*_-f*x)/v,A=(d*g-p*b)/(2*v)-o,k=(p*x-d*_)/v,M=S*S+k*k-1,P=2*(s+w*S+A*k),T=w*w+A*A-s*s,C=-(M?(P+Math.sqrt(P*P-4*M*T))/(2*M):T/P);return{x:n+w+S*C,y:o+A+k*C,r:C}}function si(t,e,i){var n,o,s,a,r=t.x-e.x,l=t.y-e.y,h=r*r+l*l;h?(o=e.r+i.r,o*=o,a=t.r+i.r,o>(a*=a)?(n=(h+a-o)/(2*h),s=Math.sqrt(Math.max(0,a/h-n*n)),i.x=t.x-n*r-s*l,i.y=t.y-n*l+s*r):(n=(h+o-a)/(2*h),s=Math.sqrt(Math.max(0,o/h-n*n)),i.x=e.x+n*r-s*l,i.y=e.y+n*l+s*r)):(i.x=e.x+i.r,i.y=e.y)}function ai(t,e){var i=t.r+e.r-1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function ri(t){var e=t._,i=t.next._,n=e.r+i.r,o=(e.x*i.r+i.x*e.r)/n,s=(e.y*i.r+i.y*e.r)/n;return o*o+s*s}function li(t){this._=t,this.next=null,this.previous=null}function hi(t){if(!(o=t.length))return 0;var e,i,n,o,s,a,r,l,h,c,u;if((e=t[0]).x=0,e.y=0,!(o>1))return e.r;if(i=t[1],e.x=-i.r,i.x=e.r,i.y=0,!(o>2))return e.r+i.r;si(i,e,n=t[2]),e=new li(e),i=new li(i),n=new li(n),e.next=n.previous=i,i.next=e.previous=n,n.next=i.previous=e;t:for(r=3;r<o;++r){si(e._,i._,n=t[r]),n=new li(n),l=i.next,h=e.previous,c=i._.r,u=e._.r;do{if(c<=u){if(ai(l._,n._)){i=l,e.next=i,i.previous=e,--r;continue t}c+=l._.r,l=l.next}else{if(ai(h._,n._)){(e=h).next=i,i.previous=e,--r;continue t}u+=h._.r,h=h.previous}}while(l!==h.next);for(n.previous=e,n.next=i,e.next=i.previous=i=n,s=ri(e);(n=n.next)!==i;)(a=ri(n))<s&&(e=n,s=a);i=e.next}for(e=[i._],n=i;(n=n.next)!==i;)e.push(n._);for(n=Qe(e),r=0;r<o;++r)(e=t[r]).x-=n.x,e.y-=n.y;return n.r}function ci(t){return null==t?null:ui(t)}function ui(t){if("function"!=typeof t)throw new Error;return t}function pi(){return 0}function di(t){return function(){return t}}function fi(t){return Math.sqrt(t.value)}function yi(){var t=null,i=1,n=1,o=pi;function s(e){return e.x=i/2,e.y=n/2,t?e.eachBefore(_i(t)).eachAfter(xi(o,.5)).eachBefore(mi(1)):e.eachBefore(_i(fi)).eachAfter(xi(pi,1)).eachAfter(xi(o,e.r/Math.min(i,n))).eachBefore(mi(Math.min(i,n)/(2*e.r))),e}return e(s,"pack"),s.radius=function(e){return arguments.length?(t=ci(e),s):t},s.size=function(t){return arguments.length?(i=+t[0],n=+t[1],s):[i,n]},s.padding=function(t){return arguments.length?(o="function"==typeof t?t:di(+t),s):o},s}function _i(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function xi(t,e){return function(i){if(n=i.children){var n,o,s,a=n.length,r=t(i)*e||0;if(r)for(o=0;o<a;++o)n[o].r+=r;if(s=hi(n),r)for(o=0;o<a;++o)n[o].r-=r;i.r=s+r}}}function mi(t){return function(e){var i=e.parent;e.r*=t,i&&(e.x=i.x+t*e.x,e.y=i.y+t*e.y)}}e(Ue,"shuffle"),e(Qe,"enclose"),e(Ze,"extendBasis"),e(Je,"enclosesNot"),e(Ke,"enclosesWeak"),e(ti,"enclosesWeakAll"),e(ei,"encloseBasis"),e(ii,"encloseBasis1"),e(ni,"encloseBasis2"),e(oi,"encloseBasis3"),e(si,"place"),e(ai,"intersects"),e(ri,"score"),e(li,"Node"),e(hi,"packEnclose"),e(ci,"optional"),e(ui,"required"),e(pi,"constantZero"),e(di,"constant$2"),e(fi,"defaultRadius"),e(yi,"d3Pack"),e(_i,"radiusLeaf"),e(xi,"packChildren"),e(mi,"translateChild");const gi=class _Bubble extends l{labelWidgets;d3Pack;constructor(){super(),s.call(this),o.call(this),m.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.labelWidgets={},this.d3Pack=yi().size([this.width(),this.height()]).padding(1.5)}size(t){const e=super.size.apply(this,arguments);return arguments.length&&this.d3Pack.size([this.width(),this.height()]),e}enter(t,e){super.enter(t,e),this._selection.widgetElement(e);const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t[0]),value:t[1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,e){super.update(t,e);const i=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const n=He({children:this.cloneData()}).sum(function(t){return t[1]}).sort(function(t,e){return e[1]<t[1]?-1:e[1]>t[1]?1:0});this.d3Pack(n);const o=e.selectAll(".node").data(n.children||[],t=>t.data[0]);o.enter().append("g").attr("class",(t,e)=>"node series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).each(function(t){const e=h(this),n=t.x,o=t.y;e.append("circle").attr("transform","translate("+n+","+o+")").attr("r",0).on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show),t.__viz_faChar?i.labelWidgets[t.data[0]]=(new F).char(t.__viz_faChar).target(this).render():i.labelWidgets[t.data[0]]=(new z).text(t.data[0]).target(this).render()}).merge(o).transition().attr("opacity",1).each(function(t){const e=h(this),n={x:t.x,y:t.y};e.select("circle").transition().attr("transform","translate("+n.x+","+n.y+")").style("fill",i.fillColor(t.data,i.columns()[1],t.data[1])).attr("r",t.r).select("title").text(t.data[0]+" ("+t.data[1]+")"),t.__viz_faChar?i.labelWidgets[t.data[0]].pos(n).render():i.labelWidgets[t.data[0]].pos(n).colorFill_default(i.textColor(t.data,i.columns()[1],t.data[1])).width(2*t.r).text(t.data[0]).render()}),o.exit().transition().style("opacity",0).remove()}exit(t,e){super.exit(t,e)}};e(gi,"Bubble"),i(gi,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let bi=gi;bi.prototype._class+=" chart_Bubble",bi.prototype.implements(s.prototype),bi.prototype.implements(o.prototype),bi.prototype.mixin(m.SimpleSelectionMixin),bi.prototype.publish("paletteID","default","set","Color palette for this widget",bi.prototype._palette.switch(),{tags:["Basic","Shared"]}),bi.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});const vi=class _BubbleXY extends we{constructor(){super()}enter(t,e){this.pointSizeColumn_exists()||this.pointSizeColumn(this.columns()[this.columns().length-1]),super.enter(t,e)}};e(vi,"BubbleXY");let wi=vi;wi.prototype._class+=" chart_BubbleXY";var Si,Ai,ki=0,Mi=0,Pi=0,Ti=0,Ci=0,zi=0,Fi="object"==typeof performance&&performance.now?performance:Date,Ii="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ei(){return Ci||(Ii(Oi),Ci=Fi.now()+zi)}function Oi(){Ci=0}function Ri(){this._call=this._time=this._next=null}function Di(){Ei(),++ki;for(var t,e=Si;e;)(t=Ci-e._time)>=0&&e._call.call(null,t),e=e._next;--ki}function ji(){Ci=(Ti=Fi.now())+zi,ki=Mi=0;try{Di()}finally{ki=0,Li(),Ci=0}}function Ni(){var t=Fi.now(),e=t-Ti;e>1e3&&(zi-=e,Ti=t)}function Li(){for(var t,e,i=Si,n=1/0;i;)i._call?(n>i._time&&(n=i._time),t=i,i=i._next):(e=i._next,i._next=null,i=t?t._next=e:Si=e);Ai=t,Bi(n)}function Bi(t){ki||(Mi&&(Mi=clearTimeout(Mi)),t-Ci>24?(t<1/0&&(Mi=setTimeout(ji,t-Fi.now()-zi)),Pi&&(Pi=clearInterval(Pi))):(Pi||(Ti=Fi.now(),Pi=setInterval(Ni,1e3)),ki=1,Ii(ji)))}function $i(){var t="left",i=!1,n=!1,o=Hi,s=qi,a=Vi,r=380,l=30,c=_e();function u(t){t.each(function(t,e){var u,p,d=o.call(this,t,e).slice().sort(I),f=s.call(this,t,e).slice().sort(I),y=a.call(this,t,e).slice().sort(I),x=h(this),m=x.select("g.wrap");m.empty()&&(m=x.append("g").attr("class","wrap")),n?(u=l,p=r,m.attr("transform","rotate(90)translate(0,"+-r+")")):(u=r,p=l,m.attr("transform",null));var g=_().domain([0,Math.max(d[0],f[0],y[0])]).range(i?[u,0]:[0,u]),b=this.__chart__||_().domain([0,1/0]).range(g.range());this.__chart__=g;var v=Wi(b),w=Wi(g),S=m.selectAll("rect.range").data(d);S.enter().append("rect").attr("class",function(t,e){return"range s"+e}).attr("width",v).attr("height",p).attr("x",i?b:0).merge(S).transition(S).attr("x",i?g:0).attr("width",w).attr("height",p);var A=m.selectAll("rect.measure").data(y);A.enter().append("rect").attr("class",function(t,e){return"measure s"+e}).attr("width",v).attr("height",p/3).attr("x",i?b:0).attr("y",p/3).merge(A).transition(A).attr("width",w).attr("height",p/3).attr("x",i?g:0).attr("y",p/3);var k=m.selectAll("line.marker").data(f);k.enter().append("line").attr("class","marker").attr("x1",b).attr("x2",b).attr("y1",p/6).attr("y2",5*p/6).merge(k).transition(k).attr("x1",g).attr("x2",g).attr("y1",p/6).attr("y2",5*p/6);var M=x.selectAll("g.axis").data([0]);M.enter().append("g").attr("class","axis"),M.attr("transform",n?null:"translate(0,"+p+")").call(c.scale(g))}),Di()}return e(u,"bulvar"),u.orient=function(e){return arguments.length?(i="right"===(t=e+"")||"bottom"===t,c.orient((n="top"===t||"bottom"===t)?"left":"bottom"),u):t},u.ranges=function(t){return arguments.length?(o=t,u):o},u.markers=function(t){return arguments.length?(s=t,u):s},u.measures=function(t){return arguments.length?(a=t,u):a},u.width=function(t){return arguments.length?(r=+t,u):r},u.height=function(t){return arguments.length?(l=+t,u):l},u.tickFormat=function(t){return arguments.length?(c.tickFormat(t),u):c.tickFormat()},u}function Hi(t){return t.ranges}function qi(t){return t.markers}function Vi(t){return t.measures}function Wi(t){var e=t(0);return function(i){return Math.abs(t(i)-e)}}e(Ei,"now"),e(Oi,"clearNow"),e(Ri,"Timer"),Ri.prototype={constructor:Ri,restart:/* @__PURE__ */e(function(t,e,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?Ei():+i)+(null==e?0:+e),this._next||Ai===this||(Ai?Ai._next=this:Si=this,Ai=this),this._call=t,this._time=i,Bi()},"restart"),stop:/* @__PURE__ */e(function(){this._call&&(this._call=null,this._time=1/0,Bi())},"stop")},e(Di,"timerFlush"),e(ji,"wake"),e(Ni,"poke"),e(Li,"nap"),e(Bi,"sleep"),e($i,"d3Bullet"),e(Hi,"bulvarRanges"),e(qi,"bulvarMarkers"),e(Vi,"bulvarMeasures"),e(Wi,"bulvarWidth");const Gi=class _Bullet extends E{_hiddenColumns={};constructor(){super(),m.SimpleSelectionMixin.call(this,!0)}bulletData(){const t=this;this._hiddenColumns={};const e=this.columns();return this.data().map(function(t){return{title:i(t,this.titleColumn()),subtitle:i(t,this.subtitleColumn()),ranges:i(t,this.rangesColumn(),"range"),measures:i(t,this.measuresColumn(),"measure"),markers:i(t,this.markersColumn(),"marker"),origRow:t}},this);function i(i,n,o){const s=e.indexOf(n);return s>=0?i[s]instanceof Array?i[s]:[i[s]]:(o&&(t._hiddenColumns[o]=!0),[0])}}enter(t,e){super.enter(t,e),h(t.parentNode).style("overflow","auto"),this._selection.widgetElement(e)}update(t,e){super.update(t,e);const i=this;e.selectAll(".axis").style("display","none"),e.selectAll(".range,.measure,.marker").style("display",null);const n=2,o=8,s=2,a=8,r=this.width()-n-s,l=40-o-a,c=e.selectAll("svg").data(this.bulletData()),u=c.enter().append("svg").attr("class","bullet").call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.origRow),i.titleColumn(),i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.origRow),i.titleColumn(),i._selection.selected(this))}).each(function(){const t=h(this).append("g").attr("class",(t,e)=>"bulletBar series series-"+i.cssTag(i.titleColumn())).append("g").attr("class","bulletTitle");t.append("text").attr("class","title"),t.append("text").attr("class","subtitle").attr("dy","1em")}).merge(c),p=u.select(".bulletTitle").style("text-anchor","end").attr("transform","translate(-6,"+l/2+")");p.select(".title").text(function(t){return t.title}),p.select(".subtitle").text(function(t){return t.subtitle});let d=0;p.each(function(){const t=this.getBBox();t.width>d&&(d=t.width)});const f=$i().width(r-d-6).height(l);u.attr("width",r).attr("height",l+o+a).style("margin-left",`${n}px`),u.select(".bulletBar").attr("transform","translate("+(d+6)+","+o+")").call(f),c.exit().remove(),Object.keys(this._hiddenColumns).length>0&&e.selectAll(`.${Object.keys(this._hiddenColumns).join(",.")}`).style("display","none")}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}_selection};e(Gi,"Bullet");let Xi=Gi;Xi.prototype._class+=" chart_Bullet",Xi.prototype.publish("titleColumn",null,"set","Title Column",function(){return this.columns()},{optional:!0}),Xi.prototype.publish("subtitleColumn",null,"set","Subtitle Column",function(){return this.columns()},{optional:!0}),Xi.prototype.publish("rangesColumn",null,"set","Ranges Column",function(){return this.columns()},{optional:!0}),Xi.prototype.publish("measuresColumn",null,"set","Measures Column",function(){return this.columns()},{optional:!0}),Xi.prototype.publish("markersColumn",null,"set","Markers Column",function(){return this.columns()},{optional:!0});var Yi=Array.prototype.slice;function Ui(t,e){return t-e}function Qi(t){for(var e=0,i=t.length,n=t[i-1][1]*t[0][0]-t[i-1][0]*t[0][1];++e<i;)n+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return n}function Zi(t){return function(){return t}}function Ji(t,e){for(var i,n=-1,o=e.length;++n<o;)if(i=Ki(t,e[n]))return i;return 0}function Ki(t,e){for(var i=e[0],n=e[1],o=-1,s=0,a=t.length,r=a-1;s<a;r=s++){var l=t[s],h=l[0],c=l[1],u=t[r],p=u[0],d=u[1];if(tn(l,u,e))return 0;c>n!=d>n&&i<(p-h)*(n-c)/(d-c)+h&&(o=-o)}return o}function tn(t,e,i){var n;return en(t,e,i)&&nn(t[n=+(t[0]===e[0])],i[n],e[n])}function en(t,e,i){return(e[0]-t[0])*(i[1]-t[1])===(i[0]-t[0])*(e[1]-t[1])}function nn(t,e,i){return t<=e&&e<=i||i<=e&&e<=t}function on(){}e(Ui,"ascending"),e(Qi,"area"),e(Zi,"constant$1"),e(Ji,"contains"),e(Ki,"ringContains"),e(tn,"segmentContains"),e(en,"collinear"),e(nn,"within"),e(on,"noop$2");var sn=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function an(){var t=1,i=1,n=O,o=h;function s(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Ui);else{var i=T(t),o=i[0],s=i[1];e=R(o,s,e),e=D(Math.floor(o/e)*e,Math.floor(s/e)*e,e)}return e.map(function(e){return a(t,e)})}function a(t,e){var i=[],n=[];return r(t,e,function(s){o(s,t,e),Qi(s)>0?i.push([s]):n.push(s)}),n.forEach(function(t){for(var e,n=0,o=i.length;n<o;++n)if(-1!==Ji((e=i[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:e,coordinates:i}}function r(n,o,s){var a,r,h,c,u,p,d=new Array,f=new Array;for(a=r=-1,c=n[0]>=o,sn[c<<1].forEach(y);++a<t-1;)h=c,c=n[a+1]>=o,sn[h|c<<1].forEach(y);for(sn[c|0].forEach(y);++r<i-1;){for(a=-1,c=n[r*t+t]>=o,u=n[r*t]>=o,sn[c<<1|u<<2].forEach(y);++a<t-1;)h=c,c=n[r*t+t+a+1]>=o,p=u,u=n[r*t+a+1]>=o,sn[h|c<<1|u<<2|p<<3].forEach(y);sn[c|u<<3].forEach(y)}for(a=-1,u=n[r*t]>=o,sn[u<<2].forEach(y);++a<t-1;)p=u,u=n[r*t+a+1]>=o,sn[u<<2|p<<3].forEach(y);function y(t){var e,i,n=[t[0][0]+a,t[0][1]+r],o=[t[1][0]+a,t[1][1]+r],h=l(n),c=l(o);(e=f[h])?(i=d[c])?(delete f[e.end],delete d[i.start],e===i?(e.ring.push(o),s(e.ring)):d[e.start]=f[i.end]={start:e.start,end:i.end,ring:e.ring.concat(i.ring)}):(delete f[e.end],e.ring.push(o),f[e.end=c]=e):(e=d[c])?(i=f[h])?(delete d[e.start],delete f[i.end],e===i?(e.ring.push(o),s(e.ring)):d[i.start]=f[e.end]={start:i.start,end:e.end,ring:i.ring.concat(e.ring)}):(delete d[e.start],e.ring.unshift(n),d[e.start=h]=e):d[h]=f[c]={start:h,end:c,ring:[n,o]}}sn[u<<3].forEach(y),e(y,"stitch")}function l(e){return 2*e[0]+e[1]*(t+1)*4}function h(e,n,o){e.forEach(function(e){var s,a=e[0],r=e[1],l=0|a,h=0|r,c=n[h*t+l];a>0&&a<t&&l===a&&(s=n[h*t+l-1],e[0]=a+(o-s)/(c-s)-.5),r>0&&r<i&&h===r&&(s=n[(h-1)*t+l],e[1]=r+(o-s)/(c-s)-.5)})}return e(s,"contours"),e(a,"contour"),e(r,"isorings"),e(l,"index"),e(h,"smoothLinear"),s.contour=a,s.size=function(e){if(!arguments.length)return[t,i];var n=Math.ceil(e[0]),o=Math.ceil(e[1]);if(!(n>0&&o>0))throw new Error("invalid size");return t=n,i=o,s},s.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?Zi(Yi.call(t)):Zi(t),s):n},s.smooth=function(t){return arguments.length?(o=t?h:on,s):o===h},s}function rn(t,e,i){for(var n=t.width,o=t.height,s=1+(i<<1),a=0;a<o;++a)for(var r=0,l=0;r<n+i;++r)r<n&&(l+=t.data[r+a*n]),r>=i&&(r>=s&&(l-=t.data[r-s+a*n]),e.data[r-i+a*n]=l/Math.min(r+1,n-1+s-r,s))}function ln(t,e,i){for(var n=t.width,o=t.height,s=1+(i<<1),a=0;a<n;++a)for(var r=0,l=0;r<o+i;++r)r<o&&(l+=t.data[a+r*n]),r>=i&&(r>=s&&(l-=t.data[a+(r-s)*n]),e.data[a+(r-i)*n]=l/Math.min(r+1,o-1+s-r,s))}function hn(t){return t[0]}function cn(t){return t[1]}function un(){return 1}function pn(){var t=hn,i=cn,n=un,o=960,s=500,a=20,r=2,l=3*a,h=o+2*l>>r,c=s+2*l>>r,u=Zi(20);function p(e){var o=new Float32Array(h*c),s=new Float32Array(h*c);e.forEach(function(e,s,a){var u=+t(e,s,a)+l>>r,p=+i(e,s,a)+l>>r,d=+n(e,s,a);u>=0&&u<h&&p>=0&&p<c&&(o[u+p*h]+=d)}),rn({width:h,height:c,data:o},{data:s},a>>r),ln({width:h,height:c,data:s},{data:o},a>>r),rn({width:h,height:c,data:o},{data:s},a>>r),ln({width:h,height:c,data:s},{data:o},a>>r),rn({width:h,height:c,data:o},{data:s},a>>r),ln({width:h,height:c,data:s},{data:o},a>>r);var p=u(o);if(!Array.isArray(p)){var f=M(o);p=R(0,f,p),(p=D(0,Math.floor(f/p)*p,p)).shift()}return an().thresholds(p).size([h,c])(o).map(d)}function d(t){return t.value*=Math.pow(2,-2*r),t.coordinates.forEach(f),t}function f(t){t.forEach(y)}function y(t){t.forEach(_)}function _(t){t[0]=t[0]*Math.pow(2,r)-l,t[1]=t[1]*Math.pow(2,r)-l}function x(){return h=o+2*(l=3*a)>>r,c=s+2*l>>r,p}return e(p,"density"),e(d,"transform"),e(f,"transformPolygon"),e(y,"transformRing"),e(_,"transformPoint"),e(x,"resize"),p.x=function(e){return arguments.length?(t="function"==typeof e?e:Zi(+e),p):t},p.y=function(t){return arguments.length?(i="function"==typeof t?t:Zi(+t),p):i},p.weight=function(t){return arguments.length?(n="function"==typeof t?t:Zi(+t),p):n},p.size=function(t){if(!arguments.length)return[o,s];var e=Math.ceil(t[0]),i=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return o=e,s=i,x()},p.cellSize=function(t){if(!arguments.length)return 1<<r;if(!((t=+t)>=1))throw new Error("invalid cell size");return r=Math.floor(Math.log(t)/Math.LN2),x()},p.thresholds=function(t){return arguments.length?(u="function"==typeof t?t:Array.isArray(t)?Zi(Yi.call(t)):Zi(t),p):u},p.bandwidth=function(t){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return a=Math.round((Math.sqrt(4*t*t+1)-1)/2),x()},p}function dn(){return new fn}function fn(){this.reset()}e(an,"contours"),e(rn,"blurX"),e(ln,"blurY"),e(hn,"defaultX"),e(cn,"defaultY"),e(un,"defaultWeight"),e(pn,"d3ContourDensity"),e(dn,"adder"),e(fn,"Adder"),fn.prototype={constructor:fn,reset:/* @__PURE__ */e(function(){this.s=this.t=0},"reset"),add:/* @__PURE__ */e(function(t){_n(yn,t,this.t),_n(this,yn.s,this.s),this.s?this.t+=yn.t:this.s=yn.t},"add"),valueOf:/* @__PURE__ */e(function(){return this.s},"valueOf")};var yn=new fn;function _n(t,e,i){var n=t.s=e+i,o=n-e,s=n-o;t.t=e-s+(i-o)}e(_n,"add");var xn=2*Math.PI,mn=Math.abs,gn=Math.sqrt;function bn(){}function vn(t,e){t&&Sn.hasOwnProperty(t.type)&&Sn[t.type](t,e)}e(bn,"noop$1"),e(vn,"streamGeometry");var wn={Feature:/* @__PURE__ */e(function(t,e){vn(t.geometry,e)},"Feature"),FeatureCollection:/* @__PURE__ */e(function(t,e){for(var i=t.features,n=-1,o=i.length;++n<o;)vn(i[n].geometry,e)},"FeatureCollection")},Sn={Sphere:/* @__PURE__ */e(function(t,e){e.sphere()},"Sphere"),Point:/* @__PURE__ */e(function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},"Point"),MultiPoint:/* @__PURE__ */e(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)t=i[n],e.point(t[0],t[1],t[2])},"MultiPoint"),LineString:/* @__PURE__ */e(function(t,e){An(t.coordinates,e,0)},"LineString"),MultiLineString:/* @__PURE__ */e(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)An(i[n],e,0)},"MultiLineString"),Polygon:/* @__PURE__ */e(function(t,e){kn(t.coordinates,e)},"Polygon"),MultiPolygon:/* @__PURE__ */e(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)kn(i[n],e)},"MultiPolygon"),GeometryCollection:/* @__PURE__ */e(function(t,e){for(var i=t.geometries,n=-1,o=i.length;++n<o;)vn(i[n],e)},"GeometryCollection")};function An(t,e,i){var n,o=-1,s=t.length-i;for(e.lineStart();++o<s;)n=t[o],e.point(n[0],n[1],n[2]);e.lineEnd()}function kn(t,e){var i=-1,n=t.length;for(e.polygonStart();++i<n;)An(t[i],e,1);e.polygonEnd()}function Mn(t,e){t&&wn.hasOwnProperty(t.type)?wn[t.type](t,e):vn(t,e)}function Pn(t){return t}e(An,"streamLine"),e(kn,"streamPolygon"),e(Mn,"geoStream"),e(Pn,"identity");var Tn,Cn,zn,Fn,In=dn(),En=dn(),On={point:bn,lineStart:bn,lineEnd:bn,polygonStart:/* @__PURE__ */e(function(){On.lineStart=Rn,On.lineEnd=Nn},"polygonStart"),polygonEnd:/* @__PURE__ */e(function(){On.lineStart=On.lineEnd=On.point=bn,In.add(mn(En)),En.reset()},"polygonEnd"),result:/* @__PURE__ */e(function(){var t=In/2;return In.reset(),t},"result")};function Rn(){On.point=Dn}function Dn(t,e){On.point=jn,Tn=zn=t,Cn=Fn=e}function jn(t,e){En.add(Fn*t-zn*e),zn=t,Fn=e}function Nn(){jn(Tn,Cn)}e(Rn,"areaRingStart"),e(Dn,"areaPointFirst"),e(jn,"areaPoint"),e(Nn,"areaRingEnd");var Ln=1/0,Bn=Ln,$n=-Ln,Hn=$n,qn={point:Vn,lineStart:bn,lineEnd:bn,polygonStart:bn,polygonEnd:bn,result:/* @__PURE__ */e(function(){var t=[[Ln,Bn],[$n,Hn]];return $n=Hn=-(Bn=Ln=1/0),t},"result")};function Vn(t,e){t<Ln&&(Ln=t),t>$n&&($n=t),e<Bn&&(Bn=e),e>Hn&&(Hn=e)}e(Vn,"boundsPoint");var Wn,Gn,Xn,Yn,Un=0,Qn=0,Zn=0,Jn=0,Kn=0,to=0,eo=0,io=0,no=0,oo={point:so,lineStart:ao,lineEnd:ho,polygonStart:/* @__PURE__ */e(function(){oo.lineStart=co,oo.lineEnd=uo},"polygonStart"),polygonEnd:/* @__PURE__ */e(function(){oo.point=so,oo.lineStart=ao,oo.lineEnd=ho},"polygonEnd"),result:/* @__PURE__ */e(function(){var t=no?[eo/no,io/no]:to?[Jn/to,Kn/to]:Zn?[Un/Zn,Qn/Zn]:[NaN,NaN];return Un=Qn=Zn=Jn=Kn=to=eo=io=no=0,t},"result")};function so(t,e){Un+=t,Qn+=e,++Zn}function ao(){oo.point=ro}function ro(t,e){oo.point=lo,so(Xn=t,Yn=e)}function lo(t,e){var i=t-Xn,n=e-Yn,o=gn(i*i+n*n);Jn+=o*(Xn+t)/2,Kn+=o*(Yn+e)/2,to+=o,so(Xn=t,Yn=e)}function ho(){oo.point=so}function co(){oo.point=po}function uo(){fo(Wn,Gn)}function po(t,e){oo.point=fo,so(Wn=Xn=t,Gn=Yn=e)}function fo(t,e){var i=t-Xn,n=e-Yn,o=gn(i*i+n*n);Jn+=o*(Xn+t)/2,Kn+=o*(Yn+e)/2,to+=o,eo+=(o=Yn*t-Xn*e)*(Xn+t),io+=o*(Yn+e),no+=3*o,so(Xn=t,Yn=e)}function yo(t){this._context=t}e(so,"centroidPoint"),e(ao,"centroidLineStart"),e(ro,"centroidPointFirstLine"),e(lo,"centroidPointLine"),e(ho,"centroidLineEnd"),e(co,"centroidRingStart"),e(uo,"centroidRingEnd"),e(po,"centroidPointFirstRing"),e(fo,"centroidPointRing"),e(yo,"PathContext"),yo.prototype={_radius:4.5,pointRadius:/* @__PURE__ */e(function(t){return this._radius=t,this},"pointRadius"),polygonStart:/* @__PURE__ */e(function(){this._line=0},"polygonStart"),polygonEnd:/* @__PURE__ */e(function(){this._line=NaN},"polygonEnd"),lineStart:/* @__PURE__ */e(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){0===this._line&&this._context.closePath(),this._point=NaN},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,xn)}},"point"),result:bn};var _o,xo,mo,go,bo,vo=dn(),wo={point:bn,lineStart:/* @__PURE__ */e(function(){wo.point=So},"lineStart"),lineEnd:/* @__PURE__ */e(function(){_o&&Ao(xo,mo),wo.point=bn},"lineEnd"),polygonStart:/* @__PURE__ */e(function(){_o=!0},"polygonStart"),polygonEnd:/* @__PURE__ */e(function(){_o=null},"polygonEnd"),result:/* @__PURE__ */e(function(){var t=+vo;return vo.reset(),t},"result")};function So(t,e){wo.point=Ao,xo=go=t,mo=bo=e}function Ao(t,e){go-=t,bo-=e,vo.add(gn(go*go+bo*bo)),go=t,bo=e}function ko(){this._string=[]}function Mo(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Po(t,i){var n,o,s=4.5;function a(t){return t&&("function"==typeof s&&o.pointRadius(+s.apply(this,arguments)),Mn(t,n(o))),o.result()}return e(a,"path"),a.area=function(t){return Mn(t,n(On)),On.result()},a.measure=function(t){return Mn(t,n(wo)),wo.result()},a.bounds=function(t){return Mn(t,n(qn)),qn.result()},a.centroid=function(t){return Mn(t,n(oo)),oo.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,Pn):(t=e).stream,a):t},a.context=function(t){return arguments.length?(o=null==t?(i=null,new ko):new yo(i=t),"function"!=typeof s&&o.pointRadius(s),a):i},a.pointRadius=function(t){return arguments.length?(s="function"==typeof t?t:(o.pointRadius(+t),+t),a):s},a.projection(t).context(i)}e(So,"lengthPointFirst"),e(Ao,"lengthPoint"),e(ko,"PathString"),ko.prototype={_radius:4.5,_circle:Mo(4.5),pointRadius:/* @__PURE__ */e(function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},"pointRadius"),polygonStart:/* @__PURE__ */e(function(){this._line=0},"polygonStart"),polygonEnd:/* @__PURE__ */e(function(){this._line=NaN},"polygonEnd"),lineStart:/* @__PURE__ */e(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){0===this._line&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Mo(this._radius)),this._string.push("M",t,",",e,this._circle)}},"point"),result:/* @__PURE__ */e(function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null},"result")},e(Mo,"circle"),e(Po,"geoPath");const To=class _Contour extends be{_dataMinWeight;_dataMaxWeight;constructor(){super(),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerEnter(t,e,i=250){super.layerEnter(t,e,i)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i),this._palette=this._palette.switch(this.paletteID());const n=this.flattenData(this.layerColumns(t),this.layerData(t)),o=pn().x(e=>this.xPos(t,e)).y(e=>this.yPos(t,e)).size([this.width(),this.height()]).bandwidth(this.contourBandwidth())(n),s=o.map(t=>t.value),a=Math.min.apply(this,s),r=Math.max.apply(this,s);this._dataMinWeight=a,this._dataMaxWeight=r;const l=e.selectAll("path").data(o);l.enter().append("path").merge(l).attr("d",Po()).attr("fill",t=>this.showContourFill()?this._palette(t.value,a,r):"none").attr("stroke",this.contourStrokeColor()).attr("stroke-linejoin","round").attr("stroke-width",this.contourStrokeWidth()),l.exit().remove()}exit(t,e){super.exit(t,e)}};e(To,"Contour"),i(To,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let Co=To;Co.prototype._class+=" chart_Contour",Co.prototype.implements(a.prototype),Co.prototype.publish("paletteID","YlGnBu","string","Color palette for this widget"),Co.prototype.publish("useClonedPalette",!0,"boolean","Enable or disable using a cloned palette"),Co.prototype.publish("showContourFill",!0,"boolean","Show/hide the contour background colors"),Co.prototype.publish("showContour",!0,"boolean","Show/hide the contour border lines"),Co.prototype.publish("contourBandwidth",40,"number","Controls the sensitivity of the contour grouping algorithm"),Co.prototype.publish("contourStrokeColor","#2C3A47","html-color","Color of the contour border lines"),Co.prototype.publish("contourStrokeWidth",1,"number","Width of the contour border lines");const zo=class _Gantt extends Te{constructor(){super(),this.orientation_default("vertical").xAxisType_default("ordinal").yAxisType_default("time")}};e(zo,"Gantt");let Fo=zo;function Io(t){/* @__PURE__ */
3
- return e(function(){return t},"constant")}Fo.prototype._class+=" chart_Gantt",e(Io,"constant");var Eo=1e-12,Oo=Math.PI,Ro=Oo/2,Do=2*Oo;function jo(t){return t.innerRadius}function No(t){return t.outerRadius}function Lo(t){return t.startAngle}function Bo(t){return t.endAngle}function $o(t){return t&&t.padAngle}function Ho(t){return t>=1?Ro:t<=-1?-Ro:Math.asin(t)}function qo(t,e,i,n,o,s,a,r){var l=i-t,h=n-e,c=a-o,u=r-s,p=(c*(e-s)-u*(t-o))/(u*l-c*h);return[t+p*l,e+p*h]}function Vo(t,e,i,n,o,s,a){var r=t-i,l=e-n,h=(a?s:-s)/Math.sqrt(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-s,w=p*y-f*d,S=(g<0?-1:1)*Math.sqrt(Math.max(0,v*v*b-w*w)),A=(w*g-m*S)/b,k=(-w*m-g*S)/b,M=(w*g+m*S)/b,P=(-w*m+g*S)/b,T=A-_,C=k-x,z=M-_,F=P-x;return T*T+C*C>z*z+F*F&&(A=M,k=P),{cx:A,cy:k,x01:-c,y01:-u,x11:A*(o/v-1),y11:k*(o/v-1)}}function Wo(){var t=jo,i=No,n=Io(0),o=null,s=Lo,a=Bo,r=$o,l=null;function h(){var e,h,c=+t.apply(this,arguments),u=+i.apply(this,arguments),p=s.apply(this,arguments)-Ro,d=a.apply(this,arguments)-Ro,f=Math.abs(d-p),y=d>p;if(l||(l=e=it()),u<c&&(h=u,u=c,c=h),u>Eo)if(f>Do-Eo)l.moveTo(u*Math.cos(p),u*Math.sin(p)),l.arc(0,0,u,p,d,!y),c>Eo&&(l.moveTo(c*Math.cos(d),c*Math.sin(d)),l.arc(0,0,c,d,p,y));else{var _,x,m=p,g=d,b=p,v=d,w=f,S=f,A=r.apply(this,arguments)/2,k=A>Eo&&(o?+o.apply(this,arguments):Math.sqrt(c*c+u*u)),M=Math.min(Math.abs(u-c)/2,+n.apply(this,arguments)),P=M,T=M;if(k>Eo){var C=Ho(k/c*Math.sin(A)),z=Ho(k/u*Math.sin(A));(w-=2*C)>Eo?(b+=C*=y?1:-1,v-=C):(w=0,b=v=(p+d)/2),(S-=2*z)>Eo?(m+=z*=y?1:-1,g-=z):(S=0,m=g=(p+d)/2)}var F=u*Math.cos(m),I=u*Math.sin(m),E=c*Math.cos(v),O=c*Math.sin(v);if(M>Eo){var R=u*Math.cos(g),D=u*Math.sin(g),j=c*Math.cos(b),N=c*Math.sin(b);if(f<Oo){var L=w>Eo?qo(F,I,j,N,R,D,E,O):[E,O],B=F-L[0],$=I-L[1],H=R-L[0],q=D-L[1],V=1/Math.sin(Math.acos((B*H+$*q)/(Math.sqrt(B*B+$*$)*Math.sqrt(H*H+q*q)))/2),W=Math.sqrt(L[0]*L[0]+L[1]*L[1]);P=Math.min(M,(c-W)/(V-1)),T=Math.min(M,(u-W)/(V+1))}}S>Eo?T>Eo?(_=Vo(j,N,F,I,u,T,y),x=Vo(R,D,E,O,u,T,y),l.moveTo(_.cx+_.x01,_.cy+_.y01),T<M?l.arc(_.cx,_.cy,T,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(l.arc(_.cx,_.cy,T,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!y),l.arc(0,0,u,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(x.cy+x.y11,x.cx+x.x11),!y),l.arc(x.cx,x.cy,T,Math.atan2(x.y11,x.x11),Math.atan2(x.y01,x.x01),!y))):(l.moveTo(F,I),l.arc(0,0,u,m,g,!y)):l.moveTo(F,I),c>Eo&&w>Eo?P>Eo?(_=Vo(E,O,R,D,c,-P,y),x=Vo(F,I,j,N,c,-P,y),l.lineTo(_.cx+_.x01,_.cy+_.y01),P<M?l.arc(_.cx,_.cy,P,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(l.arc(_.cx,_.cy,P,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!y),l.arc(0,0,c,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(x.cy+x.y11,x.cx+x.x11),y),l.arc(x.cx,x.cy,P,Math.atan2(x.y11,x.x11),Math.atan2(x.y01,x.x01),!y))):l.arc(0,0,c,v,b,y):l.lineTo(E,O)}else l.moveTo(0,0);if(l.closePath(),e)return l=null,e+""||null}return e(h,"arc"),h.centroid=function(){var e=(+t.apply(this,arguments)+ +i.apply(this,arguments))/2,n=(+s.apply(this,arguments)+ +a.apply(this,arguments))/2-Oo/2;return[Math.cos(n)*e,Math.sin(n)*e]},h.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Io(+e),h):t},h.outerRadius=function(t){return arguments.length?(i="function"==typeof t?t:Io(+t),h):i},h.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Io(+t),h):n},h.padRadius=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:Io(+t),h):o},h.startAngle=function(t){return arguments.length?(s="function"==typeof t?t:Io(+t),h):s},h.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Io(+t),h):a},h.padAngle=function(t){return arguments.length?(r="function"==typeof t?t:Io(+t),h):r},h.context=function(t){return arguments.length?(l=null==t?null:t,h):l},h}function Go(t){this._context=t}function Xo(t){return new Go(t)}function Yo(t){return t[0]}function Uo(t){return t[1]}function Qo(){var t=Yo,i=Uo,n=Io(!0),o=null,s=Xo,a=null;function r(e){var r,l,h,c=e.length,u=!1;for(null==o&&(a=s(h=it())),r=0;r<=c;++r)!(r<c&&n(l=e[r],r,e))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+t(l,r,e),+i(l,r,e));if(h)return a=null,h+""||null}return e(r,"line"),r.x=function(e){return arguments.length?(t="function"==typeof e?e:Io(+e),r):t},r.y=function(t){return arguments.length?(i="function"==typeof t?t:Io(+t),r):i},r.defined=function(t){return arguments.length?(n="function"==typeof t?t:Io(!!t),r):n},r.curve=function(t){return arguments.length?(s=t,null!=o&&(a=s(o)),r):s},r.context=function(t){return arguments.length?(null==t?o=a=null:a=s(o=t),r):o},r}function Zo(){}function Jo(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function Ko(t){this._context=t}function ts(t,e){this._basis=new Ko(t),this._beta=e}function es(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function is(t,e){this._context=t,this._k=(1-e)/6}function ns(t,e){this._context=t,this._k=(1-e)/6}function os(t,e){this._context=t,this._k=(1-e)/6}function ss(t,e,i){var n=t._x1,o=t._y1,s=t._x2,a=t._y2;if(t._l01_a>Eo){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Eo){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*h+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,s,a,t._x2,t._y2)}function as(t,e){this._context=t,this._alpha=e}e(jo,"arcInnerRadius"),e(No,"arcOuterRadius"),e(Lo,"arcStartAngle"),e(Bo,"arcEndAngle"),e($o,"arcPadAngle"),e(Ho,"asin"),e(qo,"intersect"),e(Vo,"cornerTangents"),e(Wo,"arc"),e(Go,"Linear"),Go.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},e(Xo,"curveLinear"),e(Yo,"x"),e(Uo,"y"),e(Qo,"line"),e(Zo,"noop"),e(Jo,"point$3"),e(Ko,"Basis"),Ko.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 3:Jo(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Jo(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},e(ts,"Bundle"),ts.prototype={lineStart:/* @__PURE__ */e(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:/* @__PURE__ */e(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],s=e[0],a=t[i]-o,r=e[i]-s,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*a),this._beta*e[l]+(1-this._beta)*(s+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:/* @__PURE__ */e(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},
4
- /* @__PURE__ */e(function t(i){function n(t){return 1===i?new Ko(t):new ts(t,i)}return e(n,"bundle"),n.beta=function(e){return t(+e)},n},"custom")(.85),e(es,"point$2"),e(is,"Cardinal"),is.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:es(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:es(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},
5
- /* @__PURE__ */e(function t(i){function n(t){return new is(t,i)}return e(n,"cardinal"),n.tension=function(e){return t(+e)},n},"custom")(0),e(ns,"CardinalClosed"),ns.prototype={areaStart:Zo,areaEnd:Zo,lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:es(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},
6
- /* @__PURE__ */e(function t(i){function n(t){return new ns(t,i)}return e(n,"cardinal"),n.tension=function(e){return t(+e)},n},"custom")(0),e(os,"CardinalOpen"),os.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:es(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},
7
- /* @__PURE__ */e(function t(i){function n(t){return new os(t,i)}return e(n,"cardinal"),n.tension=function(e){return t(+e)},n},"custom")(0),e(ss,"point$1"),e(as,"CatmullRom"),as.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:ss(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const rs=/* @__PURE__ */e(function t(i){function n(t){return i?new as(t,i):new is(t,0)}return e(n,"catmullRom"),n.alpha=function(e){return t(+e)},n},"custom")(.5);function ls(t,e){this._context=t,this._alpha=e}function hs(t,e){this._context=t,this._alpha=e}function cs(t){return t<0?-1:1}function us(t,e,i){var n=t._x1-t._x0,o=e-t._x1,s=(t._y1-t._y0)/(n||o<0&&-0),a=(i-t._y1)/(o||n<0&&-0),r=(s*o+a*n)/(n+o);return(cs(s)+cs(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(r))||0}function ps(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function ds(t,e,i){var n=t._x0,o=t._y0,s=t._x1,a=t._y1,r=(s-n)/3;t._context.bezierCurveTo(n+r,o+r*e,s-r,a-r*i,s,a)}function fs(t){this._context=t}e(ls,"CatmullRomClosed"),ls.prototype={areaStart:Zo,areaEnd:Zo,lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:/* @__PURE__ */e(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ss(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},
8
- /* @__PURE__ */e(function t(i){function n(t){return i?new ls(t,i):new ns(t,0)}return e(n,"catmullRom"),n.alpha=function(e){return t(+e)},n},"custom")(.5),e(hs,"CatmullRomOpen"),hs.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ss(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},
9
- /* @__PURE__ */e(function t(i){function n(t){return i?new hs(t,i):new os(t,0)}return e(n,"catmullRom"),n.alpha=function(e){return t(+e)},n},"custom")(.5),e(cs,"sign"),e(us,"slope3"),e(ps,"slope2"),e(ds,"point"),e(fs,"MonotoneX"),fs.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ds(this,this._t0,ps(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,ds(this,ps(this,i=us(this,t,e)),i);break;default:ds(this,this._t0,i=us(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(fs.prototype).point=function(t,e){fs.prototype.point.call(this,e,t)};var ys="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_s=/* @__PURE__ */e(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},"classCallCheck"),xs=/* @__PURE__ */function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return e(t,"defineProperties"),function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),ms=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},gs=/* @__PURE__ */e(function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var s=Object.getPrototypeOf(e);return null===s?void 0:t(s,i,n)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(n):void 0},"get"),bs=/* @__PURE__ */e(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},"inherits"),vs=/* @__PURE__ */e(function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},"possibleConstructorReturn"),ws=/* @__PURE__ */e(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)},"toConsumableArray"),Ss=function(){function t(e){var i=e.x,n=void 0===i?0:i,o=e.y,s=void 0===o?0:o,a=e.nx,r=e.ny,l=e.dy,h=void 0===l?0:l,c=e.dx,u=void 0===c?0:c,p=e.color,d=void 0===p?"grey":p,f=e.data,y=e.type,_=e.subject,x=e.connector,m=e.note,g=e.disable,b=e.id,v=e.className;_s(this,t),this._dx=void 0!==a?a-n:u,this._dy=void 0!==r?r-s:h,this._x=n,this._y=s,this._color=d,this.id=b,this._className=v||"",this._type=y||"",this.data=f,this.note=m||{},this.connector=x||{},this.subject=_||{},this.disable=g||[]}return e(t,"Annotation"),xs(t,[{key:"updatePosition",value:/* @__PURE__ */e(function(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&0!==this.type.subject.selectAll(":not(.handle)").nodes().length&&this.type.redrawSubject())},"updatePosition")},{key:"clearComponents",value:/* @__PURE__ */e(function(){this.type.clearComponents&&this.type.clearComponents()},"clearComponents")},{key:"updateOffset",value:/* @__PURE__ */e(function(){this.type.setOffset&&(this.type.setOffset(),0!==this.type.connector.selectAll(":not(.handle)").nodes().length&&this.type.redrawConnector(),this.type.redrawNote())},"updateOffset")},{key:"className",get:/* @__PURE__ */e(function(){return this._className},"get$$1"),set:/* @__PURE__ */e(function(t){this._className=t,this.type.setClassName&&this.type.setClassName()},"set$$1")},{key:"type",get:/* @__PURE__ */e(function(){return this._type},"get$$1"),set:/* @__PURE__ */e(function(t){this._type=t,this.clearComponents()},"set$$1")},{key:"x",get:/* @__PURE__ */e(function(){return this._x},"get$$1"),set:/* @__PURE__ */e(function(t){this._x=t,this.updatePosition()},"set$$1")},{key:"y",get:/* @__PURE__ */e(function(){return this._y},"get$$1"),set:/* @__PURE__ */e(function(t){this._y=t,this.updatePosition()},"set$$1")},{key:"color",get:/* @__PURE__ */e(function(){return this._color},"get$$1"),set:/* @__PURE__ */e(function(t){this._color=t,this.updatePosition()},"set$$1")},{key:"dx",get:/* @__PURE__ */e(function(){return this._dx},"get$$1"),set:/* @__PURE__ */e(function(t){this._dx=t,this.updateOffset()},"set$$1")},{key:"dy",get:/* @__PURE__ */e(function(){return this._dy},"get$$1"),set:/* @__PURE__ */e(function(t){this._dy=t,this.updateOffset()},"set$$1")},{key:"nx",set:/* @__PURE__ */e(function(t){this._dx=t-this._x,this.updateOffset()},"set$$1")},{key:"ny",set:/* @__PURE__ */e(function(t){this._dy=t-this._y,this.updateOffset()},"set$$1")},{key:"offset",get:/* @__PURE__ */e(function(){return{x:this._dx,y:this._dy}},"get$$1"),set:/* @__PURE__ */e(function(t){var e=t.x,i=t.y;this._dx=e,this._dy=i,this.updateOffset()},"set$$1")},{key:"position",get:/* @__PURE__ */e(function(){return{x:this._x,y:this._y}},"get$$1"),set:/* @__PURE__ */e(function(t){var e=t.x,i=t.y;this._x=e,this._y=i,this.updatePosition()},"set$$1")},{key:"translation",get:/* @__PURE__ */e(function(){return{x:this._x+this._dx,y:this._y+this._dy}},"get$$1")},{key:"json",get:/* @__PURE__ */e(function(){var t={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(t.data=this.data),this.type&&(t.type=this.type),this._className&&(t.className=this._className),Object.keys(this.connector).length>0&&(t.connector=this.connector),Object.keys(this.subject).length>0&&(t.subject=this.subject),Object.keys(this.note).length>0&&(t.note=this.note),t},"get$$1")}]),t}(),As=function(){function t(e){var i=e.annotations,n=e.accessors,o=e.accessorsInverse;_s(this,t),this.accessors=n,this.accessorsInverse=o,this.annotations=i}return e(t,"AnnotationCollection"),xs(t,[{key:"clearTypes",value:/* @__PURE__ */e(function(t){this.annotations.forEach(function(e){e.type=void 0,e.subject=t&&t.subject||e.subject,e.connector=t&&t.connector||e.connector,e.note=t&&t.note||e.note})},"clearTypes")},{key:"setPositionWithAccessors",value:/* @__PURE__ */e(function(){var t=this;this.annotations.forEach(function(e){e.type.setPositionWithAccessors(t.accessors)})},"setPositionWithAccessors")},{key:"editMode",value:/* @__PURE__ */e(function(t){this.annotations.forEach(function(e){e.type&&(e.type.editMode=t,e.type.updateEditMode())})},"editMode")},{key:"updateDisable",value:/* @__PURE__ */e(function(t){this.annotations.forEach(function(e){e.disable=t,e.type&&t.forEach(function(t){e.type[t]&&(e.type[t].remove&&e.type[t].remove(),e.type[t]=void 0)})})},"updateDisable")},{key:"updateTextWrap",value:/* @__PURE__ */e(function(t){this.annotations.forEach(function(e){e.type&&e.type.updateTextWrap&&e.type.updateTextWrap(t)})},"updateTextWrap")},{key:"updateText",value:/* @__PURE__ */e(function(){this.annotations.forEach(function(t){t.type&&t.type.drawText&&t.type.drawText()})},"updateText")},{key:"updateNotePadding",value:/* @__PURE__ */e(function(t){this.annotations.forEach(function(e){e.type&&(e.type.notePadding=t)})},"updateNotePadding")},{key:"json",get:/* @__PURE__ */e(function(){var t=this;return this.annotations.map(function(e){var i=e.json;return t.accessorsInverse&&e.data&&(i.data={},Object.keys(t.accessorsInverse).forEach(function(n){i.data[n]=t.accessorsInverse[n]({x:e.x,y:e.y})})),i})},"get$$1")},{key:"noteNodes",get:/* @__PURE__ */e(function(){return this.annotations.map(function(t){return ms({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})})},"get$$1")}]),t}(),ks=/* @__PURE__ */e(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy;return{move:{x:i,y:void 0===n?0:n}}},"pointHandle"),Ms=/* @__PURE__ */e(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy,o=void 0===n?0:n,s=t.r1,a=t.r2,r=t.padding,l={move:{x:i,y:o}};return void 0!==s&&(l.r1={x:i+s/Math.sqrt(2),y:o+s/Math.sqrt(2)}),void 0!==a&&(l.r2={x:i+a/Math.sqrt(2),y:o+a/Math.sqrt(2)}),void 0!==r&&(l.padding={x:i+s+r,y:o}),l},"circleHandles"),Ps=/* @__PURE__ */e(function(t){var e=t.group,i=t.handles,n=t.r,o=void 0===n?10:n,s=e.selectAll("circle.handle").data(i);s.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(j().container(h("g.annotations").node()).on("start",function(t){return t.start&&t.start(t)}).on("drag",function(t){return t.drag&&t.drag(t)}).on("end",function(t){return t.end&&t.end(t)})),e.selectAll("circle.handle").attr("cx",function(t){return t.x}).attr("cy",function(t){return t.y}).attr("r",function(t){return t.r||o}).attr("class",function(t){return"handle "+(t.className||"")}),s.exit().remove()},"addHandles"),Ts=/* @__PURE__ */e(function(t,e){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},"leftRightDynamic"),Cs=/* @__PURE__ */e(function(t,e){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},"topBottomDynamic"),zs=["topBottom","top","bottom"],Fs=["leftRight","left","right"],Is=/* @__PURE__ */e(function(t){var e=t.padding,i=void 0===e?0:e,n=t.bbox,o=void 0===n?{x:0,width:0,height:0}:n,s=t.align,a=t.orientation,r=t.offset,l=void 0===r?{x:0,y:0}:r,h=-o.x,c=0;return-1!==zs.indexOf(a)?(s=Cs(s,l.x),l.y<0&&"topBottom"===a||"top"===a?c-=o.height+i:c+=i,"middle"===s?h-=o.width/2:"right"===s&&(h-=o.width)):-1!==Fs.indexOf(a)&&(s=Ts(s,l.y),l.x<0&&"leftRight"===a||"left"===a?h-=o.width+i:h+=i,"middle"===s?c-=o.height/2:"top"===s&&(c-=o.height)),{x:h,y:c}},"noteAlignment"),Es=/* @__PURE__ */e(function(t){var e=t.data,i=t.curve,n=void 0===i?Xo:i,o=t.canvasContext,s=t.className,a=t.classID,r=Qo().curve(n),l={type:"path",className:s,classID:a,data:e};return o?(r.context(o),l.pathMethods=r):l.attrs={d:r(e)},l},"lineBuilder"),Os=/* @__PURE__ */e(function(t){var e=t.data,i=t.canvasContext,n={type:"path",className:t.className,classID:t.classID,data:e},o=Wo().innerRadius(e.innerRadius||0).outerRadius(e.outerRadius||e.radius||2).startAngle(e.startAngle||0).endAngle(e.endAngle||2*Math.PI);return i?(o.context(i),n.pathMethods=lineGen):n.attrs={d:o()},n},"arcBuilder"),Rs=/* @__PURE__ */e(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,s=void 0===o?0:o,a=t.bbox,r=t.offset;"top"===(e=Ts(e,r.y))?s-=a.height:"middle"===e&&(s-=a.height/2);var l=[[n,s],[n,s+a.height]];return{components:[Es({data:l,className:"note-line"})]}},"noteVertical"),Ds=/* @__PURE__ */e(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,s=void 0===o?0:o,a=t.offset,r=t.bbox;"right"===(e=Cs(e,a.x))?n-=r.width:"middle"===e&&(n-=r.width/2);var l=[[n,s],[n+r.width,s]];return{components:[Es({data:l,className:"note-line"})]}},"noteHorizontal"),js=/* @__PURE__ */e(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,s=n.x-o.x,a=s+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("circle"===i&&(h.outerRadius||h.radius)){var c=Math.sqrt((s-a)*(s-a)+(r-l)*(r-l)),u=Math.asin(-l/c),p=h.outerRadius||h.radius+(h.radiusPadding||0);s=Math.abs(Math.cos(u)*p)*(a<0?-1:1),r=Math.abs(Math.sin(u)*p)*(l<0?-1:1)}if("rect"===i){var d=h.width,f=h.height;(d>0&&n.dx>0||d<0&&n.dx<0)&&(s=Math.abs(d)>Math.abs(n.dx)?d/2:d),(f>0&&n.dy>0||f<0&&n.dy<0)&&(r=Math.abs(f)>Math.abs(n.dy)?f/2:f),s===d/2&&r===f/2&&(s=a,r=l)}return[[s,r],[a,l]]},"lineSetup"),Ns=/* @__PURE__ */e(function(t){var e=js(t);return{components:[Es({data:e,className:"connector"})]}},"connectorLine"),Ls=/* @__PURE__ */e(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,s=n.x-o.x,a=s+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("rect"===i){var c=h.width,u=h.height;(c>0&&n.dx>0||c<0&&n.dx<0)&&(s=Math.abs(c)>Math.abs(n.dx)?c/2:c),(u>0&&n.dy>0||u<0&&n.dy<0)&&(r=Math.abs(u)>Math.abs(n.dy)?u/2:u),s===c/2&&r===u/2&&(s=a,r=l)}var p=[[s,r],[a,l]],d=l-r,f=a-s,y=a,_=l,x=l<r&&a>s||a<s&&l>r?-1:1;if(Math.abs(f)<Math.abs(d)?(y=a,_=r+f*x):(_=l,y=s+d*x),"circle"===i&&(h.outerRadius||h.radius)){var m=(h.outerRadius||h.radius)+(h.radiusPadding||0),g=m/Math.sqrt(2);if(Math.abs(f)>g&&Math.abs(d)>g)p=[[s=g*(a<0?-1:1),r=g*(l<0?-1:1)],[y,_],[a,l]];else if(Math.abs(f)>Math.abs(d)){var b=Math.asin(-l/m);p=[[s=Math.abs(Math.cos(b)*m)*(a<0?-1:1),l],[a,l]]}else{var v=Math.acos(a/m);p=[[a,r=Math.abs(Math.sin(v)*m)*(l<0?-1:1)],[a,l]]}}else p=[[s,r],[y,_],[a,l]];return{components:[Es({data:p,className:"connector"})]}},"connectorElbow"),Bs=/* @__PURE__ */e(function(t){var i=t.type,n=t.connectorData,o=t.subjectType;n||(n={}),n.points&&"number"!=typeof n.points||(n.points=$s(i.annotation.offset,n.points)),n.curve||(n.curve=rs);var s=[];if(i.editMode){var a=n.points.map(function(t,e){return ms({},ks({cx:t[0],cy:t[1]}),{index:e})}),r=/* @__PURE__ */e(function(t){n.points[t][0]+=N.dx,n.points[t][1]+=N.dy,i.redrawConnector()},"updatePoint");s=i.mapHandles(a.map(function(t){return ms({},t.move,{drag:r.bind(i,t.index)})}))}var l=js({type:i,subjectType:o});return l=[l[0]].concat(ws(n.points),[l[1]]),{components:[Es({data:l,curve:n.curve,className:"connector"})],handles:s}},"connectorCurve"),$s=/* @__PURE__ */e(function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=t.x/(e+1),n=t.y/(e+1),o=[],s=1;s<=e;s++)o.push([i*s+s%2*20,n*s-s%2*20]);return o},"createPoints"),Hs=/* @__PURE__ */e(function(t){var e=t.annotation,i=t.start,n=t.end,o=t.scale,s=void 0===o?1:o,a=e.position;i=i?[-n[0]+i[0],-n[1]+i[1]]:[e.dx,e.dy],n||(n=[e.x-a.x,e.y-a.y]);var r=n[0],l=n[1],h=i[0],c=i[1],u=10*s,p=16/180*Math.PI,d=Math.atan(c/h);h<0&&(d+=Math.PI);var f=[[r,l],[Math.cos(d+p)*u+r,Math.sin(d+p)*u+l],[Math.cos(d-p)*u+r,Math.sin(d-p)*u+l],[r,l]];return{components:[Es({data:f,className:"connector-end connector-arrow",classID:"connector-end"})]}},"connectorArrow"),qs=/* @__PURE__ */e(function(t){var e=t.line,i=t.scale,n=void 0===i?1:i,o=Os({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(n)}});return o.attrs.transform="translate("+e.data[0][0]+", "+e.data[0][1]+")",{components:[o]}},"connectorDot"),Vs=/* @__PURE__ */e(function(t){var i=t.subjectData,n=t.type;i.radius||i.outerRadius||(i.radius=20);var o=[],s=Os({data:i,className:"subject"});if(n.editMode){var a=Ms({r1:s.data.outerRadius||s.data.radius,r2:s.data.innerRadius,padding:i.radiusPadding}),r=/* @__PURE__ */e(function(t){var e=i[t]+N.dx*Math.sqrt(2);i[t]=e,n.redrawSubject(),n.redrawConnector()},"updateRadius"),l=[ms({},a.r1,{drag:r.bind(n,void 0!==i.outerRadius?"outerRadius":"radius")})];i.innerRadius&&l.push(ms({},a.r2,{drag:r.bind(n,"innerRadius")})),o=n.mapHandles(l)}return s.attrs["fill-opacity"]=0,{components:[s],handles:o}},"subjectCircle"),Ws=/* @__PURE__ */e(function(t){var i=t.subjectData,n=t.type;i.width||(i.width=100),i.height||(i.height=100);var o=[],s=i.width,a=i.height,r=Es({data:[[0,0],[s,0],[s,a],[0,a],[0,0]],className:"subject"});if(n.editMode){var l=/* @__PURE__ */e(function(){i.width=N.x,n.redrawSubject(),n.redrawConnector()},"updateWidth"),h=/* @__PURE__ */e(function(){i.height=N.y,n.redrawSubject(),n.redrawConnector()},"updateHeight"),c=[{x:s,y:a/2,drag:l.bind(n)},{x:s/2,y:a,drag:h.bind(n)}];o=n.mapHandles(c)}return r.attrs["fill-opacity"]=.1,{components:[r],handles:o}},"subjectRect"),Gs=/* @__PURE__ */e(function(t){var e=t.subjectData,i=t.type.annotation.position,n=(void 0!==e.x1?e.x1:i.x)-i.x,o=(void 0!==e.x2?e.x2:i.x)-i.x,s=(void 0!==e.y1?e.y1:i.y)-i.y,a=(void 0!==e.y2?e.y2:i.y)-i.y;return{components:[Es({data:[[n,s],[o,a]],className:"subject"})]}},"subjectThreshold"),Xs=/* @__PURE__ */e(function(t){var i=t.subjectData,n=void 0===i?{}:i,o=t.type,s=void 0===o?{}:o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=s.typeSettings&&s.typeSettings.subject;n.radius||(r&&r.radius?n.radius=r.radius:n.radius=14),n.x||r&&r.x&&(n.x=r.x),n.y||r&&r.y&&(n.y=r.y);var l=[],h=[],c=n.radius,u=.7*c,p=0,d=0,f=Math.sqrt(2)*c,y={xleftcorner:-c,xrightcorner:c,ytopcorner:-c,ybottomcorner:c,xleft:-f,xright:f,ytop:-f,ybottom:f};n.x&&!n.y?p=y["x"+n.x]:n.y&&!n.x?d=y["y"+n.y]:n.x&&n.y&&(p=y["x"+n.x+"corner"],d=y["y"+n.y+"corner"]);var _="translate("+p+", "+d+")",x=Os({className:"subject",data:{radius:c}});x.attrs.transform=_,x.attrs.fill=a.color,x.attrs["stroke-linecap"]="round",x.attrs["stroke-width"]="3px";var m=Os({className:"subject-ring",data:{outerRadius:c,innerRadius:u}});m.attrs.transform=_,m.attrs["stroke-width"]="3px",m.attrs.fill="white";var g=void 0;if(p&&d||!p&&!d)g=Es({className:"subject-pointer",data:[[0,0],[p||0,0],[0,d||0],[0,0]]});else if(p||d){var b=/* @__PURE__ */e(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*c/Math.sqrt(2)},"notCornerPointerXY");g=Es({className:"subject-pointer",data:[[0,0],[b(p),b(d)],[b(p,-1),b(d,-1)],[0,0]]})}if(g&&(g.attrs.fill=a.color,g.attrs["stroke-linecap"]="round",g.attrs["stroke-width"]="3px",h.push(g)),s.editMode){var v={x:2*p,y:2*d,drag:/* @__PURE__ */e(function(){n.x=N.x<2*-c?"left":N.x>2*c?"right":void 0,n.y=N.y<2*-c?"top":N.y>2*c?"bottom":void 0,s.redrawSubject()},"dragBadge").bind(s)};v.x||v.y||(v.y=-c),l=s.mapHandles([v])}var w=void 0;return n.text&&(w={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:n.text,"text-anchor":"middle",dy:".25em",x:p,y:d}}),h.push(x),h.push(m),h.push(w),{components:h,handles:l}},"subjectBadge"),Ys=function(){function t(e){var i=e.a,n=e.annotation,o=e.editMode,s=e.dispatcher,a=e.notePadding,r=e.accessors;if(_s(this,t),this.a=i,this.note=-1===n.disable.indexOf("note")&&i.select("g.annotation-note"),this.noteContent=this.note&&i.select("g.annotation-note-content"),this.connector=-1===n.disable.indexOf("connector")&&i.select("g.annotation-connector"),this.subject=-1===n.disable.indexOf("subject")&&i.select("g.annotation-subject"),this.dispatcher=s,s){var l=ta.bind(null,s,n);l({component:this.note,name:"note"}),l({component:this.connector,name:"connector"}),l({component:this.subject,name:"subject"})}this.annotation=n,this.editMode=n.editMode||o,this.notePadding=void 0!==a?a:3,this.offsetCornerX=0,this.offsetCornerY=0,r&&n.data&&this.init(r)}return e(t,"Type"),xs(t,[{key:"init",value:/* @__PURE__ */e(function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)},"init")},{key:"mapY",value:/* @__PURE__ */e(function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))},"mapY")},{key:"mapX",value:/* @__PURE__ */e(function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))},"mapX")},{key:"updateEditMode",value:/* @__PURE__ */e(function(){this.a.selectAll("circle.handle").remove()},"updateEditMode")},{key:"drawOnSVG",value:/* @__PURE__ */e(function(t,e){var i=this;Array.isArray(e)||(e=[e]),e.filter(function(t){return t}).forEach(function(e){var n=e.type,o=e.className,s=e.attrs,a=e.handles,r=e.classID;if("handle"===n)Ps({group:t,r:s&&s.r,handles:a});else{Ks(t,[i.annotation],n,o,r);for(var l=t.select(n+"."+(r||o)),h=Object.keys(s),c=[],u=l.node().attributes,p=u.length-1;p>=0;p--){var d=u[p].name;-1===h.indexOf(d)&&"class"!==d&&c.push(d)}h.forEach(function(t){"text"===t?l.text(s[t]):l.attr(t,s[t])}),c.forEach(function(t){return l.attr(t,null)})}})},"drawOnSVG")},{key:"getNoteBBox",value:/* @__PURE__ */e(function(){return ia(this.note,".annotation-note-content text")},"getNoteBBox")},{key:"getNoteBBoxOffset",value:/* @__PURE__ */e(function(){var t=ia(this.note,".annotation-note-content"),e=this.noteContent.attr("transform").split(/\(|\,|\)/g);return t.offsetCornerX=parseFloat(e[1])+this.annotation.dx,t.offsetCornerY=parseFloat(e[2])+this.annotation.dy,t.offsetX=this.annotation.dx,t.offsetY=this.annotation.dy,t},"getNoteBBoxOffset")},{key:"drawSubject",value:/* @__PURE__ */e(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.subject,n=e.type,o={type:this,subjectData:i},s={};"circle"===n?s=Vs(o):"rect"===n?s=Ws(o):"threshold"===n?s=Gs(o):"badge"===n&&(s=Xs(o,this.annotation));var a=s,r=a.components,l=void 0===r?[]:r,h=a.handles,c=void 0===h?[]:h;return l.forEach(function(e){e&&e.attrs&&!e.attrs.stroke&&(e.attrs.stroke=t.annotation.color)}),this.editMode&&(c=c.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),l.push({type:"handle",handles:c})),l},"drawSubject")},{key:"drawConnector",value:/* @__PURE__ */e(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.connector,n=i.type||e.type,o={type:this,connectorData:i};o.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var s="curve"===n?Bs(o):"elbow"===n?Ls(o):Ns(o),a=s.components,r=void 0===a?[]:a,l=s.handles,h=void 0===l?[]:l,c=r[0];c&&(c.attrs.stroke=this.annotation.color,c.attrs.fill="none");var u=i.end||e.end,p={};if("arrow"===u){var d=c.data[1],f=c.data[0];Math.sqrt(Math.pow(d[0]-f[0],2)+Math.pow(d[1]-f[1],2))<5&&c.data[2]&&(d=c.data[2]),p=Hs({annotation:this.annotation,start:d,end:f,scale:i.endScale})}else"dot"===u?p=qs({line:c,scale:i.endScale}):u&&"none"!==u||this.connector&&this.connector.select(".connector-end").remove();return p.components&&(p.components.forEach(function(e){e.attrs.fill=t.annotation.color,e.attrs.stroke=t.annotation.color}),r=r.concat(p.components)),this.editMode&&0!==h.length&&r.push({type:"handle",handles:h}),r},"drawConnector")},{key:"drawNote",value:/* @__PURE__ */e(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.note,n=i.align||e.align||"dynamic",o={bbox:e.bbox,align:n,offset:this.annotation.offset},s=i.lineType||e.lineType,a={};"vertical"===s?a=Rs(o):"horizontal"===s&&(a=Ds(o));var r=a,l=r.components,c=void 0===l?[]:l,u=r.handles,p=void 0===u?[]:u;if(c.forEach(function(e){e.attrs.stroke=t.annotation.color}),this.editMode){p=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),c.push({type:"handle",handles:p});var d=this.dragNote.bind(this),f=this.dragstarted.bind(this),y=this.dragended.bind(this);this.note.call(j().container(h("g.annotations").node()).on("start",function(t){return f(t)}).on("drag",function(t){return d(t)}).on("end",function(t){return y(t)}))}else this.note.on("mousedown.drag",null);return c},"drawNote")},{key:"drawNoteContent",value:/* @__PURE__ */e(function(t){var e=this.annotation.note,i=void 0!==e.padding?e.padding:this.notePadding,n=e.orientation||t.orientation||"topBottom",o=e.lineType||t.lineType,s=e.align||t.align||"dynamic";"vertical"===o?n="leftRight":"horizontal"===o&&(n="topBottom");var a={padding:i,bbox:t.bbox,offset:this.annotation.offset,orientation:n,align:s},r=Is(a),l=r.x,h=r.y;return this.offsetCornerX=l+this.annotation.dx,this.offsetCornerY=h+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+l+", "+h+")"),[]},"drawNoteContent")},{key:"drawOnScreen",value:/* @__PURE__ */e(function(t,e){return this.drawOnSVG(t,e)},"drawOnScreen")},{key:"redrawSubject",value:/* @__PURE__ */e(function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())},"redrawSubject")},{key:"redrawConnector",value:/* @__PURE__ */e(function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())},"redrawConnector")},{key:"redrawNote",value:/* @__PURE__ */e(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:t})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:t}))},"redrawNote")},{key:"setPosition",value:/* @__PURE__ */e(function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")},"setPosition")},{key:"clearComponents",value:/* @__PURE__ */e(function(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()},"clearComponents")},{key:"setOffset",value:/* @__PURE__ */e(function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}},"setOffset")},{key:"setPositionWithAccessors",value:/* @__PURE__ */e(function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()},"setPositionWithAccessors")},{key:"setClassName",value:/* @__PURE__ */e(function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))},"setClassName")},{key:"draw",value:/* @__PURE__ */e(function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()},"draw")},{key:"dragstarted",value:/* @__PURE__ */e(function(){N.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")},"dragstarted")},{key:"dragended",value:/* @__PURE__ */e(function(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")},"dragended")},{key:"dragSubject",value:/* @__PURE__ */e(function(){var t=this.annotation.position;t.x+=N.dx,t.y+=N.dy,this.annotation.position=t},"dragSubject")},{key:"dragNote",value:/* @__PURE__ */e(function(){var t=this.annotation.offset;t.x+=N.dx,t.y+=N.dy,this.annotation.offset=t},"dragNote")},{key:"mapHandles",value:/* @__PURE__ */e(function(t){var e=this;return t.map(function(t){return ms({},t,{start:e.dragstarted.bind(e),end:e.dragended.bind(e)})})},"mapHandles")}]),t}(),Us=/* @__PURE__ */e(function(t,i,n){return function(t){function o(t){_s(this,o);var e=vs(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,t));return e.typeSettings=i,i.disable&&i.disable.forEach(function(t){e[t]&&e[t].remove(),e[t]=void 0,"note"===t&&(e.noteContent=void 0)}),e}return bs(o,t),e(o,"customType"),xs(o,[{key:"className",value:/* @__PURE__ */e(function(){return""+(i.className||gs(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"className",this)&&gs(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"className",this).call(this)||"")},"className")},{key:"drawSubject",value:/* @__PURE__ */e(function(t){return this.typeSettings.subject=ms({},i.subject,this.typeSettings.subject),gs(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"drawSubject",this).call(this,ms({},t,this.typeSettings.subject))},"drawSubject")},{key:"drawConnector",value:/* @__PURE__ */e(function(t){return this.typeSettings.connector=ms({},i.connector,this.typeSettings.connector),gs(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"drawConnector",this).call(this,ms({},t,i.connector,this.typeSettings.connector))},"drawConnector")},{key:"drawNote",value:/* @__PURE__ */e(function(t){return this.typeSettings.note=ms({},i.note,this.typeSettings.note),gs(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"drawNote",this).call(this,ms({},t,i.note,this.typeSettings.note))},"drawNote")},{key:"drawNoteContent",value:/* @__PURE__ */e(function(t){return gs(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"drawNoteContent",this).call(this,ms({},t,i.note,this.typeSettings.note))},"drawNoteContent")}],[{key:"init",value:/* @__PURE__ */e(function(t,e){return gs(o.__proto__||Object.getPrototypeOf(o),"init",this).call(this,t,e),n&&(t=n(t,e)),t},"init")}]),o}(t)},"customType"),Qs=function(){function t(e){_s(this,t);var i=vs(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.textWrap=e.textWrap||120,i.drawText(),i}return bs(t,Ys),e(t,"d3NoteText"),xs(t,[{key:"updateTextWrap",value:/* @__PURE__ */e(function(t){this.textWrap=t,this.drawText()},"updateTextWrap")},{key:"drawText",value:/* @__PURE__ */e(function(){if(this.note){Ks(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");Ks(t,[this.annotation],"rect","annotation-note-bg"),Ks(t,[this.annotation],"text","annotation-note-label"),Ks(t,[this.annotation],"text","annotation-note-title");var e={height:0},i=this.a.select("text.annotation-note-label"),n=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,o=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,s=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,a={top:0,bottom:0,left:0,right:0};if("number"==typeof s?a={top:s,bottom:s,left:s,right:s}:s&&"object"===(void 0===s?"undefined":ys(s))&&(a=ms(a,s)),this.annotation.note.title){var r=this.a.select("text.annotation-note-title");r.text(this.annotation.note.title),r.attr("fill",this.annotation.color),r.attr("font-weight","bold"),r.call(ea,n,o),e=r.node().getBBox()}i.text(this.annotation.note.label).attr("dx","0"),i.call(ea,n,o),i.attr("y",1.1*e.height||0),i.attr("fill",this.annotation.color);var l=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",l.width+a.left+a.right).attr("height",l.height+a.top+a.bottom).attr("x",l.x-a.left).attr("y",-a.top).attr("fill","white").attr("fill-opacity",0)}},"drawText")}]),t}();Us(Qs,{className:"label",note:{align:"middle"}});var Zs=Us(Qs,{className:"callout",note:{lineType:"horizontal"}}),Js=Us(Zs,{className:"callout elbow",connector:{type:"elbow"}});Us(Zs,{className:"callout curve",connector:{type:"curve"}}),Us(Ys,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),Us(Qs,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),Us(Qs,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),Us(function(){function t(){return _s(this,t),vs(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return bs(t,Zs),e(t,"ThresholdMap"),xs(t,[{key:"mapY",value:/* @__PURE__ */e(function(e){gs(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"mapY",this).call(this,e);var i=this.annotation;(i.subject.x1||i.subject.x2)&&i.data&&e.y&&(i.y=e.y(i.data)),!i.subject.x1&&!i.subject.x2||i.x||(i.x=i.subject.x1||i.subject.x2)},"mapY")},{key:"mapX",value:/* @__PURE__ */e(function(e){gs(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"mapX",this).call(this,e);var i=this.annotation;(i.subject.y1||i.subject.y2)&&i.data&&e.x&&(i.x=e.x(i.data)),!i.subject.y1&&!i.subject.y2||i.y||(i.y=i.subject.y1||i.subject.y2)},"mapX")}]),t}(),{className:"callout xythreshold",subject:{type:"threshold"}});var Ks=/* @__PURE__ */e(function(t,e,i,n,o){var s=t.selectAll(i+"."+(o||n)).data(e);return s.enter().append(i).merge(s).attr("class",n),s.exit().remove(),t},"newWithClass"),ta=/* @__PURE__ */e(function(t,e,i){var n=i.component,o=i.name;n&&n.on("mouseover.annotations",function(){t.call(o+"over",n,e)}).on("mouseout.annotations",function(){return t.call(o+"out",n,e)}).on("click.annotations",function(){return t.call(o+"click",n,e)})},"addHandlers"),ea=/* @__PURE__ */e(function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each(function(){for(var t=h(this),o=t.text().split(i||/[ \t\r\n]+/).reverse().filter(function(t){return""!==t}),s=void 0,a=[],r=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");s=o.pop();)a.push(s),r.text(a.join(" ")),r.node().getComputedTextLength()>e&&a.length>1&&(a.pop(),r.text(a.join(" ")),a=[s],r=t.append("tspan").attr("x",0).attr("dy",n+"em").text(s))})},"wrap"),ia=/* @__PURE__ */e(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return t?t.selectAll(e).nodes().reduce(function(t,e){var i=e.getBBox();t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),t.width=Math.max(t.width,i.width);var n=e&&e.attributes&&e.attributes.y;return t.height=Math.max(t.height,(n&&parseFloat(n.value)||0)+i.height),t},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}},"bboxWithoutHandles");function na(){var t=[],i=void 0,n=void 0,o=[],s={},a={},r=!1,l=void 0,c=Zs,u=void 0,p=void 0,d=L("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),f=void 0,y=/* @__PURE__ */e(function(e){f=e,r||e.selectAll("circle.handle").remove();var n=t.map(function(t){return t.type||(t.type=c),t.disable||(t.disable=o),new Ss(t)});i=i||new As({annotations:n,accessors:s,accessorsInverse:a,ids:l}),e.selectAll("g").data([i]).enter().append("g").attr("class","annotations");var y=e.select("g.annotations");Ks(y,i.annotations,"g","annotation"),y.selectAll("g.annotation").each(function(t){var e=h(this);e.attr("class","annotation"),Ks(e,[t],"g","annotation-connector"),Ks(e,[t],"g","annotation-subject"),Ks(e,[t],"g","annotation-note"),Ks(e.select("g.annotation-note"),[t],"g","annotation-note-content"),t.type="[object Object]"===t.type.toString()?t.type:new t.type({a:e,annotation:t,textWrap:u,notePadding:p,editMode:r,dispatcher:d,accessors:s}),t.type.draw(),t.type.drawText&&t.type.drawText()})},"annotation");return y.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",i.json),window.copy(JSON.stringify(i.json.map(function(t){return delete t.type,t}))),y},y.update=function(){return t&&i&&(t=i.annotations.map(function(t){return t.type.draw(),t})),y},y.updateText=function(){return i&&(i.updateText(u),t=i.annotations),y},y.updatedAccessors=function(){return i.setPositionWithAccessors(),t=i.annotations,y},y.disable=function(e){return arguments.length?(o=e,i&&(i.updateDisable(o),t=i.annotations),y):o},y.textWrap=function(e){return arguments.length?(u=e,i&&(i.updateTextWrap(u),t=i.annotations),y):u},y.notePadding=function(e){return arguments.length?(p=e,i&&(i.updateNotePadding(p),t=i.annotations),y):p},y.type=function(e,n){return arguments.length?(c=e,i&&(i.annotations.map(function(t){t.type.note&&t.type.note.selectAll("*:not(.annotation-note-content)").remove(),t.type.noteContent&&t.type.noteContent.selectAll("*").remove(),t.type.subject&&t.type.subject.selectAll("*").remove(),t.type.connector&&t.type.connector.selectAll("*").remove(),t.type.typeSettings={},t.type=c,t.subject=n&&n.subject||t.subject,t.connector=n&&n.connector||t.connector,t.note=n&&n.note||t.note}),t=i.annotations),y):c},y.annotations=function(e){if(!arguments.length)return i&&i.annotations||t;(t=e,i&&i.annotations)&&(t.some(function(t){return!t.type||"[object Object]"!==t.type.toString()})?(i=null,y(f)):i.annotations=t);return y},y.context=function(t){return arguments.length?(n=t,y):n},y.accessors=function(t){return arguments.length?(s=t,y):s},y.accessorsInverse=function(t){return arguments.length?(a=t,y):a},y.ids=function(t){return arguments.length?(l=t,y):l},y.editMode=function(e){return arguments.length?(r=e,f&&f.selectAll("g.annotation").classed("editable",r),i&&(i.editMode(r),t=i.annotations),y):r},y.collection=function(t){return arguments.length?(i=t,y):i},y.on=function(){var t=d.on.apply(d,arguments);return t===d?y:t},y}function oa(t){return.65*(t-.5)*2*Math.PI}function sa(t,e){return{x:Math.cos(t-Math.PI/2)*e,y:Math.sin(t-Math.PI/2)*e}}function aa(t,e,i=!1){const n=sa(t,e),o=180*t/Math.PI+(!0===i?180:0);return`translate(${n.x}, ${n.y}) rotate(${o})`}function ra(t,e,i=!1){return function(n){const o=$(n.angle,t);return n.angle=t,function(t){return aa(o(t),e,i)}}}function la(t,e,i){return function(n){const o=$(n.startAngle,t),s=$(n.endAngle,e);return function(t){return n.startAngle=o(t),n.endAngle=s(t),i(n)}}}e(na,"annotation"),e(oa,"value2Angle"),e(sa,"pointOnArc"),e(aa,"indicatorTranslate"),e(ra,"indicatorTween"),e(la,"arcTween");const ha=class _Gauge extends l{_d3Arc=At().innerRadius(85).outerRadius(100);_colorScale=_().interpolate(B);_usageArc;_meanArc;_freeArc;_indInner;_indOuter;_centerTextG;_centerText;_bottomText;_tooltipG;_mainTooltip;constructor(){super()}tip(t){if(null===t||""===t.label)this._tooltipG.transition().style("opacity",0).on("interrupt end",()=>{this._tooltipG.selectAll("g").remove()});else{this._tooltipG.interrupt().style("opacity",1),t.w=this._centerText.datum().w+10;let i="horizontal",n=0,o=5,s=5;t.y>=5&&t.y<=25?(n=t.x<0?-t.w/2:t.w/2,o=12.5,s=void 0,i="vertical"):t.y>25&&(o=25,s=0);const a=na().type(Js).annotations([{data:t,dx:-t.x+n,dy:-t.y+o,color:"black",note:{label:t.label,lineType:i,padding:s,align:"middle"}}]).accessors({x:/* @__PURE__ */e(t=>t.x,"x"),y:/* @__PURE__ */e(t=>t.y,"y")});this._tooltipG.call(a)}}calcSize(t,e,i){const n=t.node().getBBox(),o=e/n.width,s=i/n.height,a=o<s?o:s;return{width:n.width,height:n.height,scale:a}}updateText(t,e,i,n,o){t.datum({x:e,y:i,w:n,h:o}).attr("transform",null);const s=this.calcSize(t,n,o),a=e+n/2-s.width/2*s.scale,r=i+o/2-s.height/2*s.scale;t.attr("transform",`translate(${a}, ${r}) scale(${s.scale})`)}calcWidth(){return Math.min(this.width(),this.height(),this.maxDiameter())}enter(t,i){super.enter(t,i),i.on("click",t=>{this.click(t)}),this._usageArc=i.append("path").datum({startAngle:oa(0),endAngle:oa(0)}).style("fill","green").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._freeArc=i.append("path").datum({startAngle:oa(0),endAngle:oa(1)}).style("fill","lightGrey"),this._meanArc=i.append("path").datum({startAngle:oa(0),endAngle:oa(0)}).style("fill","black").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.tickValueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._mainTooltip=i.append("title");const n=this;function o(){return i.append("path").datum({angle:oa(0)}).style("fill","black").style("stroke","black").attr("d","M 0 0 l -3 -3 l 6 0 z").on("mousemove",t=>{const[e,i]=n._d3Arc.centroid(n._meanArc.datum());n.tip({x:e,y:i,label:n.tickValueDescription()})}).on("mouseout",t=>{n.tip(null)})}e(o,"appendIndicator"),this._indInner=o(),this._indOuter=o(),this._centerText=i.append("text").attr("dy",".66em").style("fill","green").on("mousemove",t=>{this.tip({x:0,y:0,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._bottomText=i.append("text").attr("dy",".66em").on("mousemove",t=>{this.tip({x:0,y:t.y,label:this.titleDescription()})}).on("mouseout",t=>{this.tip(null)}),this._tooltipG=i.append("g").attr("class","annotation-tip")}update(t,e){super.update(t,e),this._colorScale.domain(this.colorDomain()).range(this.colorRange()),e.attr("title",this.tooltip()).style("cursor",this.click!==_Gauge.prototype.click?"pointer":null);const i=this.calcWidth()/3,n=this.calcWidth()/2-5;this._d3Arc.innerRadius(i).outerRadius(n);const o=this.value(),s=this.tickValue();this._usageArc.style("fill",this._colorScale(o)).transition().duration(750).attrTween("d",la(oa(0),oa(o),this._d3Arc)),this._freeArc.style("fill",this.emptyColor()).transition().duration(750).attrTween("d",la(oa(o),oa(1),this._d3Arc)),this._meanArc.style("fill",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("d",la(oa(s-.001),oa(s+.001),this._d3Arc)),this._indInner.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",ra(oa(s),i,!0)),this._indOuter.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",ra(oa(s),n)),this._centerText.style("fill",this._colorScale(o)).text(f(".0%")(o)),this._bottomText.style("fill",this.click!==_Gauge.prototype.click?this.titleClickColor():this.titleColor()).style("text-decoration",this.click!==_Gauge.prototype.click?"underline":null).text(this.title());const a=sa(oa(1),i-8);this.updateText(this._centerText,-a.x,-a.y,2*a.x,2*a.y);const r=sa(oa(1),n);r.y+=5;const l=this.calcWidth()-20,h=this.calcWidth()/2-r.y-5;this.updateText(this._bottomText,-l/2,r.y,l,h),this._mainTooltip.text(this.tooltip())}click(t){}};e(ha,"Gauge");let ca=ha;ca.prototype._class+=" chart_Gauge",ca.prototype.publish("title","","string","Title"),ca.prototype.publish("titleDescription","","string","Title Description"),ca.prototype.publish("titleColor","black","html-color","Color of the title text"),ca.prototype.publish("titleClickColor","blue","html-color","Color of the title text when clickable"),ca.prototype.publish("maxDiameter",128,"number","Max Diameter"),ca.prototype.publish("value",0,"number","Value"),ca.prototype.publish("valueDescription","","string","Value Description"),ca.prototype.publish("showTick",!1,"boolean","Show Tick"),ca.prototype.publish("tickValue",0,"number","Tick Value"),ca.prototype.publish("tickValueDescription","","string","Tick Value Description"),ca.prototype.publish("tooltip","","string","Tooltip"),ca.prototype.publish("colorRange",["green","green","green","green","green","green","green","green","orange","red","red"],"array","Array of colors for the filled gauge portion. The fill color will be relative to the gauge value."),ca.prototype.publish("colorDomain",[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],"array","This array augments the mapping of the value to the fill colorRange."),ca.prototype.publish("emptyColor","lightgrey","html-color","Color of the empty portion of the gauge"),ca.prototype.publish("tickColor","black","html-color","Color of the tick");const ua=/* @__PURE__ */e((t,e)=>t[1]-e[1]>0?1:-1,"sortAscending"),pa=/* @__PURE__ */e((t,e)=>t[1]-e[1]>0?-1:1,"sortDescending"),da=class _Pie extends l{_totalValue;d3Pie;d3Arc;d3LabelArc;_labelPositions;_smallValueLabelHeight;_labelWidthLimit;_quadIdxArr;_minLabelTop=0;_maxLabelBottom=0;_seriesValueFormatter;_seriesPercentageFormatter;constructor(){super(),s.call(this),o.call(this),m.SimpleSelectionMixin.call(this),this.d3Pie=Et(),this.d3Arc=At(),this.d3LabelArc=At(),this.tooltipTick_default(!1).tooltipOffset_default(0)}intersection(t,e){return this.intersectCircle(this.calcOuterRadius(),t,e)}calcInnerRadius(){return this.innerRadius_exists()?this.calcOuterRadius()*this.innerRadius()/100:0}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t},!1)),"Verdana",12).width,e=this._size.width-(this.showLabels()?2*t:0)-20,i=this._size.height-36-(this.showLabels()?this._smallValueLabelHeight:0),n=Math.min(e,i)/2-2;return e/2-2<this.minOuterRadius()?this._labelWidthLimit=t-(this.minOuterRadius()-(e/2-2)):this._labelWidthLimit=t,n<this.minOuterRadius()?this.minOuterRadius():n}calcSmallValueLabelHeight(){const t=this.data().reduce((t,e)=>t+e[1],0);let e=0;return this.data().forEach(i=>{i[1]/t<.1&&e++}),this.labelHeight()*e}calcTotalValue(){return this.data().reduce((t,e)=>t+e[1],0)}getLabelText(t,e){let i,n=t.data[0];if(void 0!==this._labelWidthLimit&&e){const t=this.textSize(n,"Verdana",this.labelHeight()).width;this._labelWidthLimit<t&&(i=n.length*(this._labelWidthLimit/t)-3,n=i<n.length?n.slice(0,i)+"...":n)}if(this.showSeriesValue()&&(n+=` : ${this._seriesValueFormatter(t.data[1])}`),this.showSeriesPercentage()){let e=this._totalValue;const i=this.dataMeta();void 0!==i.sum&&(e=i.sum);const o=t.data[1]/e*100;n+=` : ${this._seriesPercentageFormatter(o)}%`}return n}selection(t){if(!arguments.length)try{return this._selection.selection2()[0]?.data}catch(i){return}const e=JSON.stringify(t);this._selection.selection2(t=>e===JSON.stringify(t.data))}selectByLabel(t){const e=this.data().filter(e=>e[0]===t)[0];e&&this.selection(e)}_slices;_labels;enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this._slices=e.append("g"),this._labels=e.append("g");const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t.data[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t.data[0]),value:t.data[n+1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,i){super.update(t,i);const n=this;this.updateD3Pie(),this._palette=this._palette.switch(this.paletteID()),this._seriesValueFormatter=f(this.seriesValueFormat()),this._seriesPercentageFormatter=f(this.seriesPercentageFormat()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._smallValueLabelHeight=this.calcSmallValueLabelHeight(),this._totalValue=this.calcTotalValue();const o=this.calcInnerRadius(),s=this.calcOuterRadius(),a=s+12;this.d3Arc.innerRadius(o).padRadius(s).outerRadius(s),this._quadIdxArr=[[],[],[],[]];const r=[...this.data()];switch(this.sortDataByValue()){case"ascending":r.sort(ua);break;case"descending":r.sort(pa)}const l=this._slices.selectAll(".arc").data(this.d3Pie(r),t=>t.data[0]);this._labelPositions=[],l.enter().append("g").attr("class",(t,e)=>"arc series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){n.click(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this))}).on("dblclick",function(t){n.dblclick(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this))}).each(function(t,e){h(this).append("path").on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).on("mouseover",y(0,0)).on("mouseout",y(-5,150))}).merge(l).transition().attr("opacity",1).each(function(t,e){const i=n.getQuadrant(d(t));n._quadIdxArr[i].push(e),t.outerRadius=s-5;h(this).select("path").transition().attr("d",n.d3Arc).style("fill",n.fillColor(t.data,n.columns()[1],t.data[1]))}),l.exit().transition().style("opacity",0).remove(),this.d3LabelArc.innerRadius(a).outerRadius(a);const c=this._labels.selectAll("text").data(this.showLabels()?this.d3Pie(r):[],t=>t.data[0]),u=c.enter().append("text").on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).attr("dy",".5em").on("click",function(t){n._slices.selectAll("g").filter(function(e){t.data===e.data&&(n._selection.click(this),n.click(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this)))})}).on("dblclick",function(t){n._slices.selectAll("g").filter(function(e){t.data===e.data&&n.dblclick(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this))})}).merge(c).text(t=>this.getLabelText(t,!0)).each(function(t,e){const i=n.d3LabelArc.centroid(t),o=d(t);i[0]=a*(n.isLeftSide(o)?1:-1),n._labelPositions.push({top:i[1],bottom:i[1]+n.labelHeight()})});this.showLabels()&&(this.adjustForOverlap(),u.transition().style("font-size",this.labelHeight()+"px").attr("transform",(t,e)=>{const i=n.d3LabelArc.centroid(t);return i[0]=a*(n.isLeftSide(d(t))?1:-1),i[1]=n._labelPositions[e].top,"translate("+i+")"}).style("text-anchor",t=>this.isLeftSide(d(t))?"start":"end")),c.exit().remove();const p=this._labels.selectAll("polyline").data(this.showLabels()?this.d3Pie(r):[],t=>this.getLabelText(t,!0));function d(t){return t.startAngle+(t.endAngle-t.startAngle)/2}function y(t,e){return function(){h(this).transition().delay(e).attrTween("d",function(e){const i=$(e.outerRadius,s+t);return function(t){return e.outerRadius=i(t),n.d3Arc(e)}})}}p.enter().append("polyline").merge(p).transition().attr("points",function(t,e){const i=n.d3LabelArc.centroid(t),o=n.d3Arc.centroid(t),s=[...i];return i[0]=a*(n.isLeftSide(d(t))?1:-1),i[1]=n._labelPositions[e].top,[o,s,i]}),p.exit().remove(),this.showLabels()&&this.centerOnLabels(),e(d,"midAngle"),e(y,"arcTween")}isLeftSide(t){return(t=G(t))>2*Math.PI?t:t<Math.PI&&t>0}getQuadrant(t){let e=0;const i=G(t);return e=i<=1*Math.PI&&i>=.5*Math.PI?3:e,e=i<=.5*Math.PI&&i>=0*Math.PI?2:e,e=i<=0*Math.PI&&i>=-.5*Math.PI?1:e,e}centerOnLabels(){const t=this.pos().y,e=2*t,i=this.calcOuterRadius(),n=Math.min(this._minLabelTop,-i),o=Math.max(this._maxLabelBottom,i),s=e-(o-n),a=Math.abs(this._minLabelTop);let r=0;o>t?(r=t-o+this.labelHeight()/2,r-=s/2):n<0&&a>t&&(r=a-t+this.labelHeight()/2,r+=s/2);const l=this.pos();this.pos({y:l.y+r,x:l.x})}adjustForOverlap(){const t=this.labelHeight();this._quadIdxArr.forEach((e,i)=>{let n;this._quadIdxArr[i].sort((t,e)=>1===i||2===i?this._labelPositions[t].top>this._labelPositions[e].top?-1:1:0===i||3===i?this._labelPositions[t].top>this._labelPositions[e].top?1:-1:void 0),this._quadIdxArr[i].forEach((e,o)=>{if(o>0)if(1===i||2===i){if(n<this._labelPositions[e].bottom){const t=this._labelPositions[e].bottom-n;this._labelPositions[e].top-=t,this._labelPositions[e].bottom-=t}}else if((0===i||3===i)&&n+t>this._labelPositions[e].top){const i=Math.abs(this._labelPositions[e].top)-Math.abs(n+t);this._labelPositions[e].top-=i,this._labelPositions[e].bottom-=i}n=this._labelPositions[e].top})}),this._minLabelTop=0,this._maxLabelBottom=0,this._quadIdxArr.forEach((t,e)=>{this._quadIdxArr[e].forEach((t,e)=>{this._minLabelTop>this._labelPositions[t].top&&(this._minLabelTop=this._labelPositions[t].top),this._maxLabelBottom<this._labelPositions[t].bottom&&(this._maxLabelBottom=this._labelPositions[t].bottom)})})}exit(t,e){super.exit(t,e)}updateD3Pie(){const t=G(X(this.startAngle()));switch(this.sortDataByValue()){case"ascending":this.d3Pie.sort(ua);break;case"descending":this.d3Pie.sort(pa);break;default:this.d3Pie.sort(null)}this.d3Pie.padAngle(.0025).startAngle(t).endAngle(2*Math.PI+t).value(function(t){return t[1]})}};e(da,"Pie"),i(da,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let fa=da;fa.prototype._class+=" chart_Pie",fa.prototype.implements(s.prototype),fa.prototype.implements(o.prototype),fa.prototype.mixin(m.SimpleSelectionMixin),fa.prototype.publish("showLabels",!0,"boolean","If true, wedge labels will display"),fa.prototype.publish("showSeriesValue",!1,"boolean","Append data series value next to label",null,{disable:/* @__PURE__ */e(t=>!t.showLabels(),"disable")}),fa.prototype.publish("seriesValueFormat",",.0f","string","Number format used for formatting series values",null,{disable:/* @__PURE__ */e(t=>!t.showSeriesValue(),"disable")}),fa.prototype.publish("showSeriesPercentage",!1,"boolean","Append data series percentage next to label",null,{disable:/* @__PURE__ */e(t=>!t.showLabels(),"disable")}),fa.prototype.publish("seriesPercentageFormat",",.0f","string","Number format used for formatting series percentages",null,{disable:/* @__PURE__ */e(t=>!t.showSeriesPercentage(),"disable")}),fa.prototype.publish("paletteID","default","set","Color palette for this widget",fa.prototype._palette.switch(),{tags:["Basic","Shared"]}),fa.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),fa.prototype.publish("innerRadius",0,"number","Sets inner pie hole radius as a percentage of the radius of the pie chart",null,{tags:["Basic"],range:{min:0,step:1,max:100}}),fa.prototype.publish("minOuterRadius",20,"number","Minimum outer radius (pixels)"),fa.prototype.publish("startAngle",0,"number","Starting angle of the first (and largest) wedge (degrees)"),fa.prototype.publish("labelHeight",12,"number","Font size of labels (pixels)",null,{disable:/* @__PURE__ */e(t=>!t.showLabels(),"disable")}),fa.prototype.publish("sortDataByValue","descending","set","Sort data by value",["none","ascending","descending"]);const ya=class _HalfPie extends fa{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i=this._pos.x,n=this._pos.y;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),n+=this._size.height/4,this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(-Math.PI/2).endAngle(Math.PI/2)}};e(ya,"HalfPie");let _a=ya;_a.prototype._class+=" chart_HalfPie";const xa=class _Heat extends be{_domForeignObject;_domCanvas;_heat;constructor(){super(),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}radius(t){return this.radiusX(t),this.radiusY(t),this}layerEnter(t,e,i=250){super.layerEnter(t,e,i),this._domForeignObject=this.svg.insert("foreignObject","#"+(this.id()+"_clippath")),this._domCanvas=this._domForeignObject.append("xhtml:body").style("margin","0px").style("padding","0px").style("background-color","transparent").append("canvas"),this._heat=ga(this._domCanvas.node())}layerUpdate(t,e,i=250){super.layerUpdate(t,e),this._palette=this._palette.switch(this.paletteID());let n=this.width()-this.margin.left-this.margin.right;n<0&&(n=0);let o=this.height()-this.margin.top-this.margin.bottom;o<0&&(o=0),this._domForeignObject.attr("x",this.margin.left).attr("y",this.margin.top).attr("width",n).attr("height",o),this._domCanvas.attr("width",n).attr("height",o);const s="horizontal"===t.orientation()?this.data().map(e=>[t.dataPos(e[0]),t.valuePos(e[1]),e[2]]):this.data().map(e=>[t.valuePos(e[1]),t.dataPos(e[0]),e[2]]),a=this.maxWeight_exists()?this.maxWeight():M(s,t=>t[2]);if("default"!==this.paletteID()){const t={},e=8,i=this.reversePalette();for(let n=0;n<e;++n)t[n/e]=this._palette((i?e-n:n)/e,0,1);this._heat.gradient(t)}else this._heat.gradient(this._heat.defaultGradient);this._heat.resize();const r=this.radiusAsPercent()?this.radiusX()*n/100:this.radiusX(),l=this.radiusAsPercent()?this.radiusY()*o/100:this.radiusY();this._heat.clear().radius(r,l,this.blur()).max(a).data(s).draw(this.minOpacity())}};e(xa,"Heat");let ma=xa;function ga(t){if(!(this instanceof ga))return new ga(t);this._canvas=t="string"==typeof t?document.getElementById(t):t,this._ctx=t.getContext("2d"),this._width=t.width,this._height=t.height,this._max=1,this._data=[]}ma.prototype._class+=" chart_Heat",ma.prototype._palette=H.rainbow("default"),ma.prototype.publish("paletteID","default","set","Color palette for this widget",ma.prototype._palette.switch(),{tags:["Basic"]}),ma.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),ma.prototype.publish("reversePalette",!1,"boolean","Reverse Palette Colors",null,{disable:/* @__PURE__ */e(t=>"default"===t.paletteID(),"disable")}),ma.prototype.publish("radiusX",25,"number","Point X radius (25 by default)"),ma.prototype.publish("radiusY",25,"number","Point Y radius (25 by default)"),ma.prototype.publish("radiusAsPercent",!1,"boolean","Calculate RadiusX + RadiusY as % of size"),ma.prototype.publish("blur",15,"number","Point blur radius (15 by default)"),ma.prototype.publish("maxWeight",void 0,"number","Clamp max weight to value (optional), omitting uses max data point",void 0,{optional:!0}),ma.prototype.publish("minOpacity",.05,"number","Minimum point opacity (0.05 by default)"),e(ga,"simpleheat"),ga.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:/* @__PURE__ */e(function(t){return this._data=t,this},"data"),max:/* @__PURE__ */e(function(t){return this._max=t,this},"max"),add:/* @__PURE__ */e(function(t){return this._data.push(t),this},"add"),clear:/* @__PURE__ */e(function(){return this._data=[],this},"clear"),radius:/* @__PURE__ */e(function(t,e,i){i=void 0===i?15:i;const n=this._ellipse=this._createCanvas(),o=n.getContext("2d"),s=this._r=t+i,a=this._r=e+i;return n.width=2*s,n.height=2*a,o.shadowOffsetX=o.shadowOffsetY=2*s,o.shadowOffsetY=o.shadowOffsetY=2*a,o.shadowBlur=i,o.shadowColor="black",o.beginPath(),o.ellipse(-s,-a,t,e,0,0,2*Math.PI,!0),o.closePath(),o.fill(),this},"radius"),resize:/* @__PURE__ */e(function(){this._width=this._canvas.width,this._height=this._canvas.height},"resize"),gradient:/* @__PURE__ */e(function(t){const e=this._createCanvas(),i=e.getContext("2d"),n=i.createLinearGradient(0,0,0,256);e.width=1,e.height=256;for(const o in t)n.addColorStop(+o,t[o]);return i.fillStyle=n,i.fillRect(0,0,1,256),this._grad=i.getImageData(0,0,1,256).data,this},"gradient"),draw:/* @__PURE__ */e(function(t){this._ellipse||this.radius(this.defaultRadius,this.defaultRadius),this._grad||this.gradient(this.defaultGradient);const e=this._ctx;e.clearRect(0,0,this._width,this._height);for(let n,o=0,s=this._data.length;o<s;o++)n=this._data[o],n[2]<0?n[2]=0:n[2]>this._max&&(n[2]=this._max),e.globalAlpha=Math.max(n[2]/this._max,void 0===t?.05:t),e.drawImage(this._ellipse,n[0]-this._r,n[1]-this._r);const i=e.getImageData(0,0,this._width,this._height);return this._colorize(i.data,this._grad),e.putImageData(i,0,0),this},"draw"),_colorize:/* @__PURE__ */e(function(t,e){for(let i,n=0,o=t.length;n<o;n+=4)i=4*t[n+3],i&&(t[n]=e[i],t[n+1]=e[i+1],t[n+2]=e[i+2])},"_colorize"),_createCanvas:/* @__PURE__ */e(function(){return"undefined"!=typeof document?document.createElement("canvas"):new this._canvas.constructor},"_createCanvas")};var ba=Math.PI/3,va=[0,ba,2*ba,3*ba,4*ba,5*ba];function wa(t){return t[0]}function Sa(t){return t[1]}function Aa(){var t,i,n,o=0,s=0,a=1,r=1,l=wa,h=Sa;function c(t){var e,o={},s=[],a=t.length;for(e=0;e<a;++e)if(!isNaN(c=+l.call(null,r=t[e],e,t))&&!isNaN(u=+h.call(null,r,e,t))){var r,c,u,p=Math.round(u/=n),d=Math.round(c=c/i-(1&p)/2),f=u-p;if(3*Math.abs(f)>1){var y=c-d,_=d+(c<d?-1:1)/2,x=p+(u<p?-1:1),m=c-_,g=u-x;y*y+f*f>m*m+g*g&&(d=_+(1&p?1:-1)/2,p=x)}var b=d+"-"+p,v=o[b];v?v.push(r):(s.push(v=o[b]=[r]),v.x=(d+(1&p)/2)*i,v.y=p*n)}return s}function u(t){var e=0,i=0;return va.map(function(n){var o=Math.sin(n)*t,s=-Math.cos(n)*t,a=o-e,r=s-i;return e=o,i=s,[a,r]})}return e(c,"hexbin"),e(u,"hexagon"),c.hexagon=function(e){return"m"+u(null==e?t:+e).join("l")+"z"},c.centers=function(){for(var e=[],l=Math.round(s/n),h=Math.round(o/i),c=l*n;c<r+t;c+=n,++l)for(var u=h*i+(1&l)*i/2;u<a+i/2;u+=i)e.push([u,c]);return e},c.mesh=function(){var e=u(t).slice(0,4).join("l");return c.centers().map(function(t){return"M"+t+"m"+e}).join("")},c.x=function(t){return arguments.length?(l=t,c):l},c.y=function(t){return arguments.length?(h=t,c):h},c.radius=function(e){return arguments.length?(i=2*(t=+e)*Math.sin(ba),n=1.5*t,c):t},c.size=function(t){return arguments.length?(o=s=0,a=+t[0],r=+t[1],c):[a-o,r-s]},c.extent=function(t){return arguments.length?(o=+t[0][0],s=+t[0][1],a=+t[1][0],r=+t[1][1],c):[[o,s],[a,r]]},c.radius(1)}e(wa,"pointX"),e(Sa,"pointY"),e(Aa,"d3HexBin");const ka=class _HexBin extends be{_hexbin;_dataMinWeight;_dataMaxWeight;constructor(){super(),r.call(this),this.tooltipValueFormat_default(",.0f"),o.call(this),this.tooltipHTML(t=>{const e=T(t,t=>t.label),i=T(t,t=>t.value);return this.tooltipFormat({series:e[0]===e[1]?e[0]:`${e[0]} -> ${e[1]}`,label:i[0]===i[1]?i[0]:`${i[0]} -> ${i[1]}`,value:t.length})}),this._hexbin=Aa().x(t=>t.x).y(t=>t.y),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i);const n=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._hexbin.extent([0,0],[this.width(),this.height()]).radius(this.binSize());const o=this.flattenData().map(e=>({x:n.xPos(t,e),y:n.yPos(t,e),label:t.parseData(e.label),value:t.parseValue(e.value),origRow:e})),s=this._hexbin(o),a=k(s,function(t){return t.length}),r=M(s,function(t){return t.length});this._dataMinWeight=a,this._dataMaxWeight=r;const l=e.selectAll(".hexagon").data(s,function(t){return t.i+"_"+t.j});l.enter().append("path").attr("class","hexagon").call(t._selection.enter.bind(t._selection)).on("click",function(e){const i=n.data();n.click(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),n.columns()[1],t._selection.selected(this))}).on("dblclick",function(e){const i=n.data();n.dblclick(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),n.columns()[1],t._selection.selected(this))}).on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).merge(l).transition().duration(i).attr("d",this._hexbin.hexagon()).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(1)"}).style("fill",function(t){return n._palette(t.length,a,r)}),l.exit().transition().duration(i).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).remove()}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}};e(ka,"HexBin"),i(ka,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let Ma=ka;Ma.prototype._class+=" chart_HexBin",Ma.prototype.implements(r.prototype),Ma.prototype.implements(o.prototype),Ma.prototype.publish("paletteID","Blues","set","Color palette for this widget",Ma.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ma.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ma.prototype.publish("binSize",20,"number","Bin radius",null,{range:{min:1,max:300,step:1}});const Pa=class _Line extends we{constructor(){super(),this.interpolate_default("linear")}};e(Pa,"Line");let Ta=Pa;Ta.prototype._class+=" chart_Line";const Ca=class _QuarterPie extends fa{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i="left"===this.orientation()?0:this._size.width,n=this._size.height;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle("left"===this.orientation()?0:-Math.PI/2).endAngle("left"===this.orientation()?Math.PI/2:0)}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t})),"Verdana",12).width;return Math.min(this._size.width-t-10,this._size.height-36)-2}};e(Ca,"QuarterPie");let za=Ca;za.prototype._class+=" chart_QuarterPie",za.prototype.publish("orientation","left","set","Determines the placement and start/end angle.",["left","right"]);const Fa=class _QuartileCandlestick extends l{_g;_leftLine;_rightLine;_midLine;_midOuterRect;_midInnerRect1;_midInnerRect2;_q0text;_q1text;_q2text;_q3text;_q4text;_q0val;_q1val;_q2val;_q3val;_q4val;constructor(){super()}enter(t,e){super.enter(t,e),this._g=e.append("g"),this._leftLine=this._g.append("rect"),this._rightLine=this._g.append("rect"),this._midLine=this._g.append("rect"),this._midOuterRect=this._g.append("rect"),this._midInnerRect1=this._g.append("rect"),this._midInnerRect2=this._g.append("rect"),this._q0text=this._g.append("text"),this._q1text=this._g.append("text"),this._q2text=this._g.append("text"),this._q3text=this._g.append("text"),this._q4text=this._g.append("text"),this._q0val=this._g.append("text"),this._q1val=this._g.append("text"),this._q2val=this._g.append("text"),this._q3val=this._g.append("text"),this._q4val=this._g.append("text")}update(t,e){super.update(t,e);const i=("horizontal"===this.orientation()?this.width():this.height())-this.lineWidth(),n="horizontal"===this.orientation()?this.height():this.width(),o=_().domain([this.data()[0],this.data()[4]]).range([this.edgePadding(),i-this.edgePadding()]),s=this.candleWidth_exists()?this.candleWidth():n,a=this.lineWidth(),r=this.lineColor(),l=this.roundedCorners(),h=this.edgePadding();let c=o(this.data()[1]),u=o(this.data()[2]),p=o(this.data()[3]);const d=-s/2,f=s/2,y=this.upperTextRotation(),x=this.lowerTextRotation(),m=this.textPadding(),g=this.labelFontSize(),b=this.valueFontSize(),v=Math.max(g,b),w=i-h;if(v>0){for(;c-h<v;)c+=v;for(;u-c<v;)u+=v;for(;p-u<v;)p+=v;for(;w-p<v;)p-=v;for(;p-u<v;)u-=v;for(;u-c<v;)c-=v}let S=-i/2-this.lineWidth()/2,A=0,k=0;let M=1,P="start",T="end";"vertical"===this.orientation()&&(S=0,A=i/2+this.lineWidth()/2,k=-90,P="end",T="start",M=-1),this._g.style("shape-rendering","crispEdges").attr("transform",`translate(${S},${A})rotate(${k})scale(1)`),this._leftLine.attr("fill",r).attr("height",s).attr("width",a).attr("x",h).attr("y",d).attr("rx",l).attr("ry",l),this._rightLine.attr("class","right-line").attr("fill",r).attr("height",s).attr("width",a).attr("x",w).attr("y",d).attr("rx",l).attr("ry",l),this._midLine.attr("fill",r).attr("height",a).attr("width",w-h).attr("x",h).attr("y",-a/2),this._midOuterRect.attr("fill",r).attr("height",s).attr("width",p-c).attr("x",c).attr("y",d).attr("rx",l).attr("ry",l),this._midInnerRect1.attr("fill",this.innerRectColor()).attr("height",s-2*a).attr("width",u-(c+2*a)).attr("x",c+a).attr("y",a-s/2).attr("rx",.618*l).attr("ry",.618*l),this._midInnerRect2.attr("fill",this.innerRectColor()).attr("height",s-2*a).attr("width",p-u-a).attr("x",u).attr("y",a-s/2).attr("rx",.618*l).attr("ry",.618*l),this._q0text.attr("height",s).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${h}, ${d-m})rotate(${y})scale(${M})`).attr("font-size",g).attr("text-anchor",P).attr("alignment-baseline","hanging").text(this.columns()[0]),this._q1text.attr("height",s).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${d-m})rotate(${y})scale(${M})`).attr("font-size",g).attr("text-anchor",P).attr("alignment-baseline","middle").text(this.columns()[1]),this._q2text.attr("height",s).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${d-m})rotate(${y})scale(${M})`).attr("font-size",g).attr("text-anchor",P).attr("alignment-baseline","middle").text(this.columns()[2]),this._q3text.attr("height",s).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${d-m})rotate(${y})scale(${M})`).attr("font-size",g).attr("text-anchor",P).attr("alignment-baseline","middle").text(this.columns()[3]),this._q4text.attr("height",s).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${w+a}, ${d-m})rotate(${y})scale(${M})`).attr("font-size",g).attr("text-anchor",P).attr("alignment-baseline","baseline").text(this.columns()[4]),this._q0val.attr("height",s).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${h}, ${f+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","hanging").text(this.data()[0]),this._q1val.attr("height",s).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${f+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[1]),this._q2val.attr("height",s).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${f+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[2]),this._q3val.attr("height",s).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${f+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[3]),this._q4val.attr("height",s).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${w+a}, ${f+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","baseline").text(this.data()[4])}};e(Fa,"QuartileCandlestick");let Ia=Fa;Ia.prototype._class+=" chart_QuartileCandlestick",Ia.prototype.publish("textColor","black","html-color","Color of label and value text"),Ia.prototype.publish("showLabels",!0,"boolean","If true, labels will be shown"),Ia.prototype.publish("showValues",!0,"boolean","If true, values will be shown"),Ia.prototype.publish("orientation","horizontal","set","Determines layout",["horizontal","vertical"]),Ia.prototype.publish("valueFontSize",12,"number","Font size of value text (pixels)"),Ia.prototype.publish("labelFontSize",12,"number","Font size of label text (pixels)"),Ia.prototype.publish("roundedCorners",8,"number","Radius of rounded rect corners (pixels)"),Ia.prototype.publish("lineWidth",4,"number","Width of lines (pixels)"),Ia.prototype.publish("candleWidth",null,"number","Height of outer rect (pixels)",null,{optional:!0}),Ia.prototype.publish("textPadding",8,"number","Padding between outer rect and text (pixels)"),Ia.prototype.publish("edgePadding",30,"number","Padding between outer rect and left/right sides (pixels)"),Ia.prototype.publish("lineColor","#333","html-color","Color of outer rect and lines"),Ia.prototype.publish("innerRectColor","white","html-color","Color of the inner rects"),Ia.prototype.publish("upperTextRotation",-60,"number","Rotation of label text (degrees)"),Ia.prototype.publish("lowerTextRotation",-60,"number","Rotation of value text (degrees)");const Ea=class _Radar extends l{constructor(){super(),n.call(this),o.call(this),m.SimpleSelectionMixin.call(this)}mapShape(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}setPointAttributes(t,e,i){const n=this;switch(this.mapShape(this.pointShape())){case"rect":t.attr("width",n.pointSize()).attr("height",n.pointSize()).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"circle":t.attr("r",n.pointSize()/2).attr("cx",e).attr("cy",i).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"path":const o=n.pointSize()/2;t.attr("d",function(t){return"M"+(e-o)+" "+(i-o)+" L"+(e+o)+" "+(i+o)+" M"+(e-o)+" "+(i+o)+" L"+(e+o)+" "+(i-o)}).style("stroke",t=>this.strokeColor(t.data,t.column,t.value))}}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t.label,series:t.column,value:t.value}))}update(t,e){super.update(t,e),this._palette=this._palette.switch(this.paletteID());const i=this,n=this.height()/2,o=this.width()/2,s=this.columns(),a=this.data(),r=this.flattenData(s,a).map((t,e)=>(t.shape=this.mapShape(this.pointShape()),t.column=s[t.colIdx],t.row=a[e],t)),l=[],c=this.degrees2radians(360/this.data().length),u=this.fontSize();let p=0;r.filter(t=>1===t.colIdx).forEach(t=>{const e=super.textSize(t.label,`${this.fontFamily()}`,this.fontSize());p<e.width&&(p=e.width)});const d=Math.min(n-u,o-p),f=e.selectAll(".label").data(r.filter(t=>1===t.colIdx)),y=Math.max.apply(i,r.map(t=>t.value));f.enter().append("text").attr("class","label").attr("text-anchor","middle").merge(f).attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).each(function(t,e){const n=i.polar2cartesian(d,e*c-Math.PI/2);l.push(n.map(t=>t*i.labelPaddingRatio()));let o="middle";const s=Math.round(n[0]);o=s>0?"start":o,o=s<0?"end":o,h(this).attr("text-anchor",o).attr("x",n[0]).attr("y",n[1])}).text(t=>t.label),f.exit().remove();const _=e.selectAll(".domain").data(r.filter(t=>1===t.colIdx));_.enter().append("line").classed("domain",!0).style("stroke","#000").style("stroke-opacity","0.75").style("stroke-width","1px").merge(_).attr("x1",0).attr("y1",0).attr("x2",(t,e)=>l[e][0]).attr("y2",(t,e)=>l[e][1]),_.exit().remove();const x=e.selectAll(".value_guide").data(this.valueGuideRatios());x.enter().append("polygon").classed("value_guide",!0).style("stroke","grey").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(x).each(function(t,e){const i=[];l.forEach((e,n)=>{i.push([e[0]*t,e[1]*t])}),h(this).attr("points",i.join(" ")).attr("stroke","rgb(0, 0, 0)").attr("stroke-opacity",.75).attr("stroke-width",.3).attr("fill-opacity",0)}),x.exit().remove();const m=e.selectAll(".value_guide_text").data(this.valueGuideRatios());m.enter().append("text").attr("class","value_guide_text").attr("text-anchor","start").attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).merge(m).attr("x",2).attr("y",t=>l[0][1]*t).text((t,e)=>Math.round(t*y)),x.exit().remove();const g=e.selectAll(".area").data(s.filter((t,e)=>e>0));g.enter().append("polygon").attr("class","area").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(g).style("stroke",t=>this.strokeColor([],t,0)).style("fill",t=>this.fillColor([],t,0)).style("fill-opacity",this.fillOpacity()).attr("points",(t,e)=>l.map((t,i)=>{const n=a[i][e+1],o=0===n?0:n/y;return t[0]*o+","+t[1]*o}).join(" ")),g.exit().remove();const b=e.selectAll(".point").data(r);b.enter().append("g").attr("class","point").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).on("click",function(t,e){const n=i.data()[t.rowIdx],o=i.rowToObj(n),s=i._selection.selected(this);i.click(o,i.columns()[t.colIdx],s)}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(i.data()[t.rowIdx]),t.column,i._selection.selected(this))}).each(function(t){const e=h(this);e.append("circle").attr("class","pointSelection").attr("r",i.pointSize()).call(i._selection.enter.bind(i._selection)),e.append(i.mapShape(i.pointShape())).attr("class","pointShape")}).merge(b).each(function(t){const e=h(this),n=0===t.value?0:t.value/y,o=l[t.rowIdx][0]*n,s=l[t.rowIdx][1]*n;e.select(".pointSelection").attr("cx",o).attr("cy",s);const a=e.select(".pointShape").style("stroke",i.strokeColor(t.row,t.column,t.value)).style("fill",i.fillColor(t.row,t.column,t.value));i.setPointAttributes(a,o,s)}),b.exit().remove()}polar2cartesian(t,e){return[t*Math.cos(e),t*Math.sin(e)]}cartesian2polar(t,e){return[Math.atan2(e,t),Math.sqrt(t*t+e*e)]}degrees2radians(t){return t/57.295779513}radians2degrees(t){return 57.295779513*t}point_in_polygon(t,e){const i=t[0],n=t[1];let o=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const t=e[s][0],r=e[s][1],l=e[a][0],h=e[a][1];r>n!=h>n&&i<(l-t)*(n-r)/(h-r)+t&&(o=!o)}return o}};e(Ea,"Radar");let Oa=Ea;Oa.prototype._class+=" chart_Radar",Oa.prototype.implements(n.prototype),Oa.prototype.implements(o.prototype),Oa.prototype.mixin(m.SimpleSelectionMixin),Oa.prototype.publish("paletteID","default","set","Color palette for this widget",Oa.prototype._palette.switch()),Oa.prototype.publish("pointShape","cross","set","pointShape",["circle","rectangle","cross"]),Oa.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),Oa.prototype.publish("valueGuideRatios",[.2,.4,.6,.8,1],"array","Array of values between 0 and 1 that are multiplied by the widget radius to produce guide lines"),Oa.prototype.publish("fillOpacity",.66,"number","Opacity of the data polygon(s)"),Oa.prototype.publish("fontFamily","","string","fontFamily"),Oa.prototype.publish("fontSize",16,"number","fontSize"),Oa.prototype.publish("labelPaddingRatio",.9,"number","labelPaddingRatio");const Ra=class _RadialBar extends l{_domainScale=x();_valueScale=_();_d3Arc=At().startAngle(0).endAngle(t=>this._valueScale(t[1]));_arcs;_axialAxis;_radialAxis;constructor(){super(),n.call(this),o.call(this),m.SimpleSelectionMixin.call(this)}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t[0],value:t[1]})),this._radialAxis=e.append("g").attr("class","r axis"),this._axialAxis=e.append("g").attr("class","a axis"),this._arcs=e.append("g").attr("class","data")}update(t,e){super.update(t,e);const i=this,n=Math.max(this.valueDomainHigh_exists()?this.valueDomainHigh():0,...this.data().map(t=>t[1]));this._valueScale.domain([0,n]).range([0,this.radians(this.valueMaxAngle())]);const o=this._valueScale.ticks(this.tickCount()),s=this.textSize(o.map(t=>""+t),"Verdana",12).width,a=Math.min(this.width()-2*(10+s),this.height()-44)/2,r=this.data().map(t=>t[0]);this._domainScale.domain(r).range([0,a]).padding(this.domainPadding());const l=this._domainScale.step()*this._domainScale.padding(),h=this._radialAxis.selectAll("circle").data(r);h.enter().append("circle").attr("fill","transparent").merge(h).attr("r",t=>this._domainScale(t)+this._domainScale.step()-l/2),h.exit().remove();const c=this._radialAxis.selectAll(".arc-text").data(r);c.enter().append("text").attr("class","arc-text").attr("x",-4).attr("alignment-baseline","middle").attr("text-anchor","end").merge(c).attr("y",t=>-this._domainScale(t)-this._domainScale.bandwidth()/2).text(t=>t),c.exit().remove();const u=this._axialAxis.selectAll("line").data(o);u.enter().append("line").merge(u).attr("x2",t=>a*Math.cos(this._valueScale(t)-this.radians(90))).attr("y2",t=>a*Math.sin(this._valueScale(t)-this.radians(90))),u.exit().remove();const p=this._axialAxis.selectAll("text").data(o);p.enter().append("text").style("dominant-baseline","central").merge(p).attr("x",t=>(a+10)*Math.cos(this._valueScale(t)-this.radians(90))).attr("y",t=>(a+10)*Math.sin(this._valueScale(t)-this.radians(90))).style("text-anchor",t=>{const e=this.degrees(this._valueScale(t));return e>=0&&e<=20||e>=160&&e<=200||e>=340&&e<=360?"middle":e>=180&&e<=360?"end":null}).text(t=>t),p.exit().remove();const d=this.columns().length>1?this.columns()[1]:"";this._d3Arc.innerRadius(t=>this._domainScale(t[0])).outerRadius(t=>this._domainScale(t[0])+this._domainScale.bandwidth());const f=this._arcs.selectAll("path").data(this.data(),t=>t[0]);f.enter().append("path").attr("class","arc").call(this._selection.enter.bind(this._selection)).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("click",function(t,e){i.click(i.rowToObj(t),d,i._selection.selected(this))}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(t),d,i._selection.selected(this))}).merge(f).style("fill",(t,e)=>this.fillColor(t,t[0],t[1])).transition().delay((t,e)=>e*this.transitionDelay()).duration(this.transitionDuration()).attrTween("d",(t,e)=>{const i=$(t._current||0,t[1]);return t._current=t[1],n=>this._d3Arc([t[0],i(n)],e)}),f.exit().remove()}degrees(t){return 180*t/Math.PI}radians(t){return t*Math.PI/180}};e(Ra,"RadialBar"),i(Ra,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number"}]);let Da=Ra;Da.prototype._class+=" chart_RadialBar",Da.prototype.implements(n.prototype),Da.prototype.implements(o.prototype),Da.prototype.mixin(m.SimpleSelectionMixin),Da.prototype.publish("paletteID","default","set","Color palette for this widget",Da.prototype._palette.switch()),Da.prototype.publish("tickCount",10,"number","Number of ticks to display"),Da.prototype.publish("domainPadding",.25,"number","Padding between chart edge and container edge (0..1)"),Da.prototype.publish("valueMaxAngle",270,"number","Maximum angular length of a bar (degrees)"),Da.prototype.publish("valueDomainHigh",null,"number","Value domain high",void 0,{optional:!0}),Da.prototype.publish("transitionDelay",100,"number","Delay between the start of each row animation (ms)"),Da.prototype.publish("transitionDuration",750,"number","Duration of a row's animation (ms)");const ja=H.rainbow("Blues"),Na=H.ordinal("Quartile",[ja(100,0,100),ja(50,0,100),ja(50,0,100),ja(75,0,100)]);function La(t){const e=f(t);return function(t){const i=(Math.round(100*t)/100).toString();return i.length<=4?i:e(t)}}Na("Std. Dev."),Na("MinMax"),Na("25%"),Na("50%"),e(La,"myFormatter");const Ba=class _StatChart extends E{_selectElement;_tickFormatter;_bellCurve=(new we).columns(["","Std. Dev."]).paletteID("Quartile").interpolate_default("basis").pointSize(0).xAxisType("linear").xAxisOverlapMode("none").xAxisTickFormat(",").yAxisHidden(!0).yAxisDomainLow(0).yAxisDomainHigh(110).yAxisGuideLines(!1);_candle=(new Ia).columns(["Min","25%","50%","75%","Max"]).edgePadding(0).roundedCorners(1).lineWidth(1).upperTextRotation(-90).lowerTextRotation(-90).labelFontSize(0).valueFontSize(0).lineColor(ja(90,0,100)).innerRectColor(ja(10,0,100));constructor(){super(),this.columns(["Min","25%","50%","75%","Max","Mean","Std. Dev."])}stdDev(t){return this.mean()+t*this.standardDeviation()}formatStdDev(t){return this._tickFormatter(this.stdDev(t))}quartile(t){return this.quartiles()[t]}formatQ(t){return this._tickFormatter(this.quartile(t))}domain(t){switch(t){case"25_75":return[this.quartile(1),this.quartile(3)];case"normal":return[this.stdDev(-4),this.stdDev(4)];default:return[this.quartile(0),this.quartile(4)]}}min(){return this.quartile(0)}max(){return this.quartile(4)}data(t){if(!arguments.length)return[[...this.quartiles(),this.mean(),this.standardDeviation()]];const e=t[0];return this.quartiles([e[0],e[1],e[2],e[3],e[4]]),this.mean(e[5]),this.standardDeviation(e[6]),this}enter(t,e){super.enter(t,e),this._bellCurve.target(e.append("div").node()),this._candle.target(e.append("div").node()),this._selectElement=e.append("div").style("position","absolute").style("top","0px").style("right","0px").append("select").on("change",()=>{this.view(this._selectElement.node().value),this.lazyRender()}),this._selectElement.append("option").attr("value","min_max").text("Min / Max"),this._selectElement.append("option").attr("value","25_75").text("25% / 75%"),this._selectElement.append("option").attr("value","normal").text("Normal")}bellTicks(t){let e;switch(t){case"25_75":e=[{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)}];break;case"normal":e=[{label:this.formatStdDev(-4),value:this.stdDev(-4)},{label:"-3σ",value:this.stdDev(-3)},{label:"-2σ",value:this.stdDev(-2)},{label:"-1σ",value:this.stdDev(-1)},{label:this.formatStdDev(0),value:this.stdDev(0)},{label:"+1σ",value:this.stdDev(1)},{label:"+2σ",value:this.stdDev(2)},{label:"+3σ",value:this.stdDev(3)},{label:this.formatStdDev(4),value:this.stdDev(4)}];break;default:e=[{label:this.formatQ(0),value:this.quartile(0)},{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)},{label:this.formatQ(4),value:this.quartile(4)}]}const[i,n]=this.domain(this._selectElement.node().value);return e.filter(t=>t.value>=i&&t.value<=n).map(t=>({label:t.label,value:t.value.toString()}))}updateScatter(){const t=this._selectElement.node().value,[e,i]=this.domain(t),n=(i-e)*(this.domainPadding()/100);this._bellCurve.xAxisDomainLow(e-n).xAxisDomainHigh(i+n).xAxisTicks(this.bellTicks(t)).data([[this.stdDev(-4),0],[this.stdDev(-3),.3],[this.stdDev(-2),5],[this.stdDev(-1),68],[this.stdDev(0),100],[this.stdDev(1),68],[this.stdDev(2),5],[this.stdDev(3),.3],[this.stdDev(4),0]]).resize({width:this.width(),height:this.height()-this.candleHeight()}).render()}updateCandle(){const t=this._bellCurve.dataPos(this.quartile(0)),e=this._bellCurve.dataPos(this.quartile(4))-t;this._candle.resize({width:this.width(),height:this.candleHeight()}).pos({x:t+e/2+2,y:this.candleHeight()/2}).width(e).candleWidth(this.candleHeight()).data(this.quartiles()).render()}update(t,e){super.update(t,e),this._tickFormatter=La(this.tickFormat()),this._selectElement.node().value=this.view(),this.updateScatter(),this.updateCandle()}exit(t,e){this._bellCurve.target(null),this._candle.target(null),this._selectElement.remove(),super.exit(t,e)}};e(Ba,"StatChart");let $a=Ba;$a.prototype._class+=" chart_StatChart",$a.prototype.publish("view","min_max","set","View",["min_max","25_75","normal"]),$a.prototype.publish("tickFormat",".2e","string","X-Axis Tick Format"),$a.prototype.publish("candleHeight",20,"number","Height of candle widget (pixels)"),$a.prototype.publish("domainPadding",10,"number","Domain value padding"),$a.prototype.publish("mean",.5,"number","Mean"),$a.prototype.publish("standardDeviation",.125,"number","Standard Deviation (σ)"),$a.prototype.publish("quartiles",[0,.25,.5,.75,1],"object","Quartiles (Min, 25%, 50%, 75%, Max)");const Ha=class _Step extends we{constructor(){super(),this.interpolate_default("step")}};e(Ha,"Step");let qa=Ha;qa.prototype._class+=" chart_Step";const Va="text",Wa="html",Ga=class _Summary extends E{_playIntervalIdx=0;_mainDiv;_headerDiv;_textDiv;constructor(){super(),this._tag="div",this._drawStartPos="center",this.playInterval(this.playInterval())}lookupFieldIdx(t,e){let i=e;if(!(this[t+"_exists"]()&&(i=this.columns().indexOf(this[t]()),i<0)))return i}lookupFieldText(t,e){return this[t+"_exists"]()?this[t]():void 0!==e&&this.columns()[e]||""}currentRow(){return this.data()[this._playIntervalIdx]}summaryData(){let t;this.hideLabel()||(t=this.lookupFieldIdx("labelColumn",0));const e=this.lookupFieldIdx("iconColumn"),i=this.lookupFieldIdx("valueColumn",1);let n,o;this.hideMore()||(n=this.lookupFieldIdx("moreIconColumn"),o=this.lookupFieldIdx("moreTextColumn"));const s=this.lookupFieldIdx("colorFillColumn"),a=this.lookupFieldIdx("colorStrokeColumn");return this.formattedData().map(function(r){return{icon:void 0===e?this.icon():r[e],label:void 0===t?"":r[t],value:r[i],moreIcon:void 0===n?this.hideMore()?"":this.moreIcon():r[n],moreText:void 0===o?this.hideMore()?"":this.moreText():r[o],fill:void 0===s?this.colorFill():r[s],stroke:void 0===a?this.colorStroke():r[a]}},this)}enter(t,e){super.enter(t,e),this._mainDiv=e.append("div");const i=this;this._headerDiv=this._mainDiv.append("h2").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}),this._textDiv=this._mainDiv.append("div").attr("class","text").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)})}update(t,e){super.update(t,e),this.data().length;const i=this.summaryData();this._playIntervalIdx>=i.length&&(this._playIntervalIdx=0);const n=this._playIntervalIdx<i.length?i[this._playIntervalIdx]:["",""];e.style("width",this.fixedSize()?this.minWidth_exists()?this.minWidth()+"px":null:"100%").style("height",this.fixedSize()?this.minHeight_exists()?this.minHeight()+"px":null:"100%"),this._mainDiv.attr("class","content bgIcon "+n.icon).transition().style("background-color",n.fill).style("color",n.stroke).style("min-width",this.minWidth_exists()?this.minWidth()+"px":null).style("min-height",this.minHeight_exists()?this.minHeight()+"px":null).style("font-size",this.iconFontSize()+"px"),this._headerDiv.transition().style("color",n.stroke).style("font-size",this.headerFontSize()+"px")[this.valueHTML()?Wa:Va](n.value),this._textDiv.style("font-size",this.textFontSize()+"px")[this.labelHTML()?Wa:Va](n.label);const o=this,s=this._mainDiv.selectAll(".more").data([n]),a=s.enter().append("div").attr("class","more").on("click",function(t){o.click(o.rowToObj(o.currentRow()),o.lookupFieldText("moreTextColumn")||"more",!0)}).each(function(){const t=h(this);t.append("i"),t.append("span")}).merge(s).style("display",this.hideMoreWrapper()?"none":null).style("font-size",this.moreFontSize()+"px").style("height",this.moreWrapperHeight_exists()?this.moreWrapperHeight()+"px":null).transition().style("background-color",q(n.fill).darker(.75).toString());a.select("i").attr("class",function(t){return"fa "+t.moreIcon}),this.moreTextHTML()?a.select("span").each(function(t){this.innerHTML=t.moreText}):a.select("span").text(t=>t.moreText),s.exit().remove()}exit(t,e){super.exit(t,e)}};e(Ga,"Summary");let Xa=Ga;Xa.prototype._class+=" chart_Summary",Xa.prototype.implements(s.prototype),Xa.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),Xa.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:/* @__PURE__ */e(t=>t.iconColumn(),"disable")}),Xa.prototype.publish("headerFontSize",null,"number","headerFontSize"),Xa.prototype.publish("textFontSize",null,"number","textFontSize"),Xa.prototype.publish("moreFontSize",null,"number","moreFontSize"),Xa.prototype.publish("iconFontSize",null,"number","iconFontSize"),Xa.prototype.publish("hideLabel",!1,"boolean","Hide label column"),Xa.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:/* @__PURE__ */e(t=>t.hideLabel(),"disable")}),Xa.prototype.publish("labelHTML",!1,"boolean","Allow HTML",null,{disable:/* @__PURE__ */e(t=>t.hideLabel(),"disable")}),Xa.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),Xa.prototype.publish("valueHTML",!1,"boolean","Allow HTML"),Xa.prototype.publish("hideMore",!1,"boolean","Hide More Information"),Xa.prototype.publish("hideMoreWrapper",!1,"boolean","Hide More Information Wrapper"),Xa.prototype.publish("moreWrapperHeight",null,"number","Height of the 'more' text wrapper (pixels)"),Xa.prototype.publish("moreIconColumn",null,"set","Select More Icon Column",function(){return this.columns()},{optional:!0,disable:/* @__PURE__ */e(t=>t.hideMore(),"disable")}),Xa.prototype.publish("moreIcon","fa-info-circle","string","FA Char icon class",null,{disable:/* @__PURE__ */e(t=>t.hideMore()||t.moreIconColumn(),"disable")}),Xa.prototype.publish("moreTextColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:/* @__PURE__ */e(t=>t.hideMore(),"disable")}),Xa.prototype.publish("moreText","More Info","string","More text",null,{disable:/* @__PURE__ */e(t=>t.hideMore()||t.moreTextColumn(),"disable")}),Xa.prototype.publish("moreTextHTML",!1,"boolean","Allow HTML",null,{disable:/* @__PURE__ */e(t=>t.hideMore(),"disable")}),Xa.prototype.publish("colorFillColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),Xa.prototype.publish("colorFill","#3498db","html-color","Fill Color",null,{disable:/* @__PURE__ */e(t=>t.colorFillColumn(),"disable")}),Xa.prototype.publish("colorStrokeColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),Xa.prototype.publish("colorStroke","#ffffff","html-color","Fill Color",null,{disable:/* @__PURE__ */e(t=>t.colorStrokeColumn(),"disable")}),Xa.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),Xa.prototype.publish("minWidth",225,"number","Minimum Width"),Xa.prototype.publish("minHeight",150,"number","Minimum Height"),Xa.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0});const Ya=Xa.prototype.playInterval;Xa.prototype.playInterval=function(t){const e=Ya.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const Ua=class _SummaryC extends V{_playIntervalIdx=0;constructor(){super(),s.call(this),this.playInterval(this.playInterval())}currentRow(){return this.data()[this._playIntervalIdx]}enter(t,e){super.enter.apply(this,arguments);const{width:i,height:n}=this.size();t.height=n,t.width=i}update(t,i){super.update.apply(this,arguments);const n=this;this._playIntervalIdx>=this.data().length&&(this._playIntervalIdx=0);const o=this.size(),s=Math.min(o.width,o.height),a=this.fontSizeRatio(),r=this.columns().indexOf(this.labelColumn()),l=this.columns().indexOf(this.valueColumn()),h=this.columns().indexOf(this.colorFillColumn()),c=this.columns().indexOf(this.colorStrokeColumn()),u=this.columns().indexOf(this.iconColumn()),p=-1!==u?this.currentRow()[u]:this.icon(),d=-1!==r?this.currentRow()[r]:"",f=-1!==l?this.currentRow()[l]:"",y=-1!==h?this.currentRow()[h]:this.colorFill(),_=-1!==c?this.currentRow()[c]:this.colorStroke();let x=o.height*(a-this.paddingSizeRatio());const g=o.height*(1-a-this.paddingSizeRatio()),b=o.height*(this.iconSizeRatio()-this.paddingSizeRatio()),v=s*this.paddingSizeRatio(),w=t.getContext("2d");w.clearRect(0,0,o.width,o.height);const S=n.fontFamily();function A(t,e,i,n){w.textBaseline="top",w.font=`${i}px ${S}`,w.fillStyle=_;let s=w.measureText(t);if(s.width>o.width-2*v){i*=(o.width-2*v)/s.width,w.font=`${i}px ${S}`,s=w.measureText(t)}const a=M(s.width,n);return w.fillText(t,a,e),i}function k(t,e,i){if(void 0===t)return;w.textBaseline=n.iconBaseline(),w.font=`${e}px FontAwesome`,w.fillStyle=_;let s=w.measureText(t);if(s.width>o.width-2*v){const i=(o.width-2*v)/s.width;w.font=e*i+"px FontAwesome",s=w.measureText(t)}const a=M(s.width,i),r=P(n.iconBaseline());w.fillText(t,a,r)}function M(t,e){switch(e){case"start":return v;case"middle":return o.width/2-t/2;case"end":return o.width-t-v}}function P(t){switch(t){case"top":return v;case"middle":return o.height/2;case"bottom":return o.height-v}}w.fillStyle=y,w.fillRect(0,0,o.width,o.height),w.globalAlpha=this.iconOpacity(),k(m.faChar(p),b,n.iconAnchor()),w.globalAlpha=this.valueOpacity(),x=A(f,v,x,n.valueAnchor()),w.globalAlpha=this.labelOpacity(),A(d,x+v,g,n.labelAnchor()),e(A,"drawText"),e(k,"drawIcon"),e(M,"getTextOffsetX"),e(P,"getTextOffsetY")}};e(Ua,"SummaryC");let Qa=Ua;Qa.prototype._class+=" chart_SummaryC",Qa.prototype.implements(s.prototype),Qa.prototype.publish("iconBaseline","bottom","string","Text baseline for the icon",["top","middle","bottom"]),Qa.prototype.publish("iconAnchor","end","set","Anchors the icon either at the start, middle, or end of the summary",["start","middle","end"]),Qa.prototype.publish("valueAnchor","start","set","Anchors the value either at the start, middle, or end of the summary",["start","middle","end"]),Qa.prototype.publish("labelAnchor","start","set","Anchors the label either at the start, middle, or end of the summary",["start","middle","end"]),Qa.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),Qa.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:/* @__PURE__ */e(t=>t.iconColumn(),"disable")}),Qa.prototype.publish("fontFamily","Arial","string","Font Family"),Qa.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),Qa.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),Qa.prototype.publish("colorFillColumn",null,"set","Column for background color",function(){return this.columns()},{optional:!0}),Qa.prototype.publish("colorFill","#0097e6","html-color","Background Color",null,{disable:/* @__PURE__ */e(t=>t.colorFillColumn(),"disable")}),Qa.prototype.publish("colorStrokeColumn",null,"set","Column for font color",function(){return this.columns()},{optional:!0}),Qa.prototype.publish("colorStroke","#2f3640","html-color","Font Color",null,{disable:/* @__PURE__ */e(t=>t.colorStrokeColumn(),"disable")}),Qa.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),Qa.prototype.publish("minWidth",225,"number","Minimum Width"),Qa.prototype.publish("minHeight",150,"number","Minimum Height"),Qa.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0}),Qa.prototype.publish("fontSizeRatio",.618,"number","Ratio between widget height and value font size"),Qa.prototype.publish("valueOpacity",1,"number","Opacity of value text (0..1)"),Qa.prototype.publish("labelOpacity",.9,"number","Opacity of label text (0..1)"),Qa.prototype.publish("iconOpacity",.3,"number","Opacity of icon text (0..1)"),Qa.prototype.publish("paddingSizeRatio",.1,"number","Ratio of the smallest dimension for edge padding (0..1)"),Qa.prototype.publish("iconSizeRatio",.9,"number","Ratio of the height for icon size (0..1)");const Za=Qa.prototype.playInterval;Qa.prototype.playInterval=function(t){const e=Za.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const Ja=Math.PI/180,Ka=2048;function tr(){const t=L("word","end"),i={};let n=[256,256],o=er,s=ir,a=or,r=nr,l=nr,h=sr,c=ar,u=[],p=ur,d=1/0,f=null,y=Math.random,_=fr;function x(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=Ka/e;const i=t.getContext("2d");return i.fillStyle=i.strokeStyle="red",i.textAlign="center",{context:i,ratio:e}}function m(t,e,i){const o=e.x,s=e.y,a=Math.sqrt(n[0]*n[0]+n[1]*n[1]),r=p(n),l=y()<.5?1:-1;let h,c,u,d=-l;for(;(h=r(d+=l))&&(c=~~h[0],u=~~h[1],!(Math.min(Math.abs(c),Math.abs(u))>=a));)if(e.x=o+c,e.y=s+u,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>n[0]||e.y+e.y1>n[1])&&(!i||!lr(e,t,n[0]))&&(!i||cr(e,i))){const i=e.sprite,o=e.width>>5,s=n[0]>>5,a=e.x-(o<<4),r=127&a,l=32-r,h=e.y1-e.y0;let c,u=(e.y+e.y0)*s+(a>>5);for(let e=0;e<h;e++){c=0;for(let n=0;n<=o;n++)t[u+n]|=c<<l|(n<o?(c=i[e*o+n])>>>r:0);u+=s}return delete e.sprite,!0}return!1}return i.canvas=function(t){return arguments.length?(_=yr(t),i):_},i.start=function(){const e=x(_()),p=dr((n[0]>>5)*n[1]);let g=null;const b=u.length;let v=-1;const w=[],S=u.map(function(t,e){return t.text=o.call(this,t,e),t.font=s.call(this,t,e),t.style=r.call(this,t,e),t.weight=l.call(this,t,e),t.rotate=h.call(this,t,e),t.size=~~a.call(this,t,e),t.padding=c.call(this,t,e),t}).sort(function(t,e){return e.size-t.size});return f&&clearInterval(f),f=setInterval(A,0),A(),i;function A(){const o=Date.now();for(;Date.now()-o<d&&++v<b&&f;){const o=S[v];o.x=n[0]*(y()+.5)>>1,o.y=n[1]*(y()+.5)>>1,rr(e,o,S,v),o.hasText&&m(p,o,g)&&(w.push(o),t.call("word",i,o),g?hr(g,o):g=[{x:o.x+o.x0,y:o.y+o.y0},{x:o.x+o.x1,y:o.y+o.y1}],o.x-=n[0]>>1,o.y-=n[1]>>1)}v>=b&&(i.stop(),t.call("end",i,w,g))}},i.stop=function(){return f&&(clearInterval(f),f=null),i},e(x,"getContext"),e(m,"place"),i.timeInterval=function(t){return arguments.length?(d=null==t?1/0:t,i):d},i.words=function(t){return arguments.length?(u=t,i):u},i.size=function(t){return arguments.length?(n=[+t[0],+t[1]],i):n},i.font=function(t){return arguments.length?(s=yr(t),i):s},i.fontStyle=function(t){return arguments.length?(r=yr(t),i):r},i.fontWeight=function(t){return arguments.length?(l=yr(t),i):l},i.rotate=function(t){return arguments.length?(h=yr(t),i):h},i.text=function(t){return arguments.length?(o=yr(t),i):o},i.spiral=function(t){return arguments.length?(p=_r[t]||t,i):p},i.fontSize=function(t){return arguments.length?(a=yr(t),i):a},i.padding=function(t){return arguments.length?(c=yr(t),i):c},i.random=function(t){return arguments.length?(y=t,i):y},i.on=function(){const e=t.on.apply(t,arguments);return e===t?i:e},i}function er(t){return t.text}function ir(){return"serif"}function nr(){return"normal"}function or(t){return Math.sqrt(t.value)}function sr(){return 30*(~~(6*Math.random())-3)}function ar(){return 1}function rr(t,e,i,n){if(e.sprite)return;const o=t.context,s=t.ratio;o.clearRect(0,0,2048/s,Ka/s);let a=0,r=0,l=0;const h=i.length;for(--n;++n<h;){e=i[n],o.save(),o.font=e.style+" "+e.weight+" "+~~((e.size+1)/s)+"px "+e.font;let t=o.measureText(e.text+"m").width*s,h=e.size<<1;if(e.rotate){const i=Math.sin(e.rotate*Ja),n=Math.cos(e.rotate*Ja),o=t*n,s=t*i,a=h*n,r=h*i;t=Math.max(Math.abs(o+r),Math.abs(o-r))+31>>5<<5,h=~~Math.max(Math.abs(s+a),Math.abs(s-a))}else t=t+31>>5<<5;if(h>l&&(l=h),a+t>=2048&&(a=0,r+=l,l=0),r+h>=Ka)break;o.translate((a+(t>>1))/s,(r+(h>>1))/s),e.rotate&&o.rotate(e.rotate*Ja),o.fillText(e.text,0,0),e.padding&&(o.lineWidth=2*e.padding,o.strokeText(e.text,0,0)),o.restore(),e.width=t,e.height=h,e.xoff=a,e.yoff=r,e.x1=t>>1,e.y1=h>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,a+=t}const c=o.getImageData(0,0,2048/s,Ka/s).data,u=[];for(;--n>=0;){if(!(e=i[n]).hasText)continue;const t=e.width,o=t>>5;let s=e.y1-e.y0;for(let e=0;e<s*o;e++)u[e]=0;if(a=e.xoff,null==a)return;r=e.yoff;let l=0,h=-1;for(let i=0;i<s;i++){for(let e=0;e<t;e++){const t=o*i+(e>>5),n=c[2048*(r+i)+(a+e)<<2]?1<<31-e%32:0;u[t]|=n,l|=n}l?h=i:(e.y0++,s--,i--,r++)}e.y1=e.y0+h,e.sprite=u.slice(0,(e.y1-e.y0)*o)}}function lr(t,e,i){i>>=5;const n=t.sprite,o=t.width>>5,s=t.x-(o<<4),a=127&s,r=32-a,l=t.y1-t.y0;let h,c=(t.y+t.y0)*i+(s>>5);for(let u=0;u<l;u++){h=0;for(let t=0;t<=o;t++)if((h<<r|(t<o?(h=n[u*o+t])>>>a:0))&e[c+t])return!0;c+=i}return!1}function hr(t,e){const i=t[0],n=t[1];e.x+e.x0<i.x&&(i.x=e.x+e.x0),e.y+e.y0<i.y&&(i.y=e.y+e.y0),e.x+e.x1>n.x&&(n.x=e.x+e.x1),e.y+e.y1>n.y&&(n.y=e.y+e.y1)}function cr(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function ur(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function pr(t){const e=4*t[0]/t[1];let i=0,n=0;return function(t){const o=t<0?-1:1;switch(Math.sqrt(1+4*o*t)-o&3){case 0:i+=e;break;case 1:n+=4;break;case 2:i-=e;break;default:n-=4}return[i,n]}}function dr(t){const e=[];let i=-1;for(;++i<t;)e[i]=0;return e}function fr(){return document.createElement("canvas")}function yr(t){return"function"==typeof t?t:function(){return t}}e(tr,"d3Cloud"),e(er,"cloudText"),e(ir,"cloudFont"),e(nr,"cloudFontNormal"),e(or,"cloudFontSize"),e(sr,"cloudRotate"),e(ar,"cloudPadding"),e(rr,"cloudSprite"),e(lr,"cloudCollide"),e(hr,"cloudBounds"),e(cr,"collideRects"),e(ur,"archimedeanSpiral"),e(pr,"rectangularSpiral"),e(dr,"zeroArray"),e(fr,"cloudCanvas"),e(yr,"functor");const _r={archimedean:ur,rectangular:pr},xr=class _WordCloud extends l{_prevOffsetX;_prevOffsetY;_prevZoom;_root;_canvas;_d3Cloud;_d3Zoom;constructor(){super(),s.call(this),o.call(this),m.SimpleSelectionMixin.call(this),this._prevOffsetX=this.offsetX(),this._prevOffsetY=this.offsetY(),this._prevZoom=this.zoom()}calcData(){return this.data().map(t=>({__viz_label:t[0],__viz_weight:t[1],__viz_row:t}))}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this._root=e.append("g"),this._canvas=document.createElement("canvas");const i=this;this._d3Zoom=W().scaleExtent([.1,10]),this._d3Zoom.on("zoom",function(t){const e=S();e&&e.transform&&i.zoomed(i._d3Zoom,[e.transform.x,e.transform.y],e.transform.k)}),e.call(this._d3Zoom),this.tooltipHTML(function(t){const e=i.columns(),n=e&&e.length?e[0]:"Word";return i.tooltipFormat({label:t.__viz_label,series:n,value:t.__viz_weight})})}update(t,i){super.update(t,i),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._d3Cloud=tr().canvas(()=>this._canvas),this.zoomed(this,[this.offsetX(),this.offsetY()],this.zoom());const n=this.calcData(),o=this,s=T(n,function(t){return t.__viz_weight});let a;switch(this.scaleMode()){case"log":a=d;break;case"sqrt":a=P;break;case"pow":a=y;break;default:a=_}const r=a().domain(s).range([this.fontSizeFrom(),this.fontSizeTo()]),l=_().domain([0,o.angleCount()-1]).range([o.angleFrom(),o.angleTo()]);function h(t,e){const i=o._root.selectAll("text").data(t,function(t){return t.__viz_label?t.__viz_label.toLowerCase():""});i.enter().append("text").attr("text-anchor","middle").call(o._selection.enter.bind(o._selection)).text(function(t){return t.__viz_label}).on("click",function(t){o.click(o.rowToObj(t.__viz_row),o.columns()[1],o._selection.selected(this))}).on("dblclick",function(t){o.dblclick(o.rowToObj(t.__viz_row),o.columns()[1],o._selection.selected(this))}).on("mouseout.tooltip",o.tooltip.hide).on("mousemove.tooltip",o.tooltip.show).style("opacity",1e-6).merge(i).style("font-size",function(t){return r(t.__viz_weight)+"px"}).style("font-family",o.fontFamily()).transition().duration(1e3).attr("transform",function(t){return"translate("+[t.x,t.y]+")rotate("+t.rotate+")"}).style("fill",function(t){return o._palette(t.__viz_label?t.__viz_label.toLowerCase():"")}).style("opacity",1),i.exit().transition().duration(1e3).style("opacity",1e-4).remove()}this._d3Cloud.stop().size([this.width(),this.height()]).words(n).font(this.fontFamily()).padding(this.padding()).spiral(this.spiral()).text(function(t){return t.__viz_label.trim()}).fontSize(function(t){return r(t.__viz_weight)}).rotate((t,e)=>l(e%o.angleCount())).on("word",t=>{}).on("end",h).start(),e(h,"draw")}zoomed(t,e,i){if(e[0]!==this._prevOffsetX||e[1]!==this._prevOffsetY||i!==this._prevZoom){switch(this._root.attr("transform",e),t){case this:break;case this._d3Zoom:this.offsetX(e[0]),this.offsetY(e[1]),this.zoom(i)}this._prevOffsetX=e[0],this._prevOffsetY=e[1],this._prevZoom=i}}};e(xr,"WordCloud"),i(xr,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let mr=xr;function gr(){const t=p(".%L"),e=p(":%S"),i=p("%H:%M"),n=p("%H:00"),o=p("%b %d"),s=p("%b"),a=p("%Y");return r=>0!==r.getMilliseconds()?t(r):0!==r.getSeconds()?e(r):0!==r.getMinutes()?i(r):0!==r.getHours()?n(r):1!==r.getDate()?o(r):0!==r.getMonth()?s(r):a(r)}mr.prototype._class+=" chart_WordCloud",mr.prototype.implements(s.prototype),mr.prototype.implements(o.prototype),mr.prototype.mixin(m.SimpleSelectionMixin),mr.prototype.publish("paletteID","default","set","Color palette for this widget",mr.prototype._palette.switch(),{tags:["Basic","Shared"]}),mr.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),mr.prototype.publish("fontFamily","Impact","string","Font Name",null,{tags:["Basic"]}),mr.prototype.publish("fontSizeFrom",6,"number","Minimum font size (pixels)",null,{tags:["Basic"]}),mr.prototype.publish("fontSizeTo",48,"number","Maximum font size (pixels)",null,{tags:["Basic"]}),mr.prototype.publish("angleFrom",-60,"number","Minimum angle (degrees)",null,{tags:["Basic"]}),mr.prototype.publish("angleTo",60,"number","Maximum angle (degrees)",null,{tags:["Basic"]}),mr.prototype.publish("angleCount",5,"number","Number of different angles",null,{tags:["Basic"]}),mr.prototype.publish("padding",0,"number","Padding between words (pixels)",null,{tags:["Intermediate"]}),mr.prototype.publish("scaleMode","linear","set","Text scaling mode",["linear","log","sqrt","pow"],{tags:["Intermediate"]}),mr.prototype.publish("spiral","archimedean","set","Text scaling mode",["archimedean","rectangular"],{tags:["Intermediate"]}),mr.prototype.publish("offsetX",0,"number","X offset",null,{tags:["Advanced"]}),mr.prototype.publish("offsetY",0,"number","Y offset",null,{tags:["Advanced"]}),mr.prototype.publish("zoom",1,"number","Zoom",null,{tags:["Advanced"]}),e(gr,"multiScale24Hours");export{Ae as Area,me as Axis,Q as BUILD_VERSION,Te as Bar,bi as Bubble,wi as BubbleXY,Xi as Bullet,Me as Column,Co as Contour,Fo as Gantt,ca as Gauge,_a as HalfPie,ma as Heat,Ma as HexBin,Ta as Line,Y as PKG_NAME,U as PKG_VERSION,fa as Pie,za as QuarterPie,Ia as QuartileCandlestick,Oa as Radar,Da as RadialBar,we as Scatter,$a as StatChart,qa as Step,Xa as Summary,Qa as SummaryC,mr as WordCloud,be as XYAxis,gr as multiScale24Hours};
1
+ var t=Object.defineProperty,e=(e,i)=>t(e,"name",{value:i,configurable:!0}),i=(e,i,n)=>((e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n)(e,"symbol"!=typeof i?i+"":i,n);import{INDChart as n,ITooltip as o,I2DChart as a,I1DChart as s,I2DAggrChart as r}from"@hpcc-js/api";import{SVGWidget as l,select as h,scaleTime as c,timeParse as u,timeFormat as p,scaleLog as d,format as f,scalePow as y,scaleLinear as _,scaleBand as x,Utility as m,brush as g,brushX as b,brushY as v,brushSelection as w,d3Event as S,hsl as A,min as k,max as M,scaleSqrt as P,extent as T,local as C,Text as z,FAChar as F,descending as I,HTMLWidget as E,thresholdSturges as R,tickStep as D,range as O,drag as j,event as N,dispatch as L,interpolateHcl as B,interpolate as $,Palette as H,rgb as V,CanvasWidget as q,zoom as W}from"@hpcc-js/common";import{normalizeRadians as G,degreesToRadians as X}from"@hpcc-js/util";const Y="@hpcc-js/chart",U="3.6.0",Q="3.17.0";var Z=Math.PI,J=2*Z,K=1e-6,tt=J-K;function et(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function it(){return new et}function nt(t){/* @__PURE__ */
2
+ return e(function(){return t},"constant")}e(et,"Path"),e(it,"path"),et.prototype=it.prototype={constructor:et,moveTo:/* @__PURE__ */e(function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},"moveTo"),closePath:/* @__PURE__ */e(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:/* @__PURE__ */e(function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},"lineTo"),quadraticCurveTo:/* @__PURE__ */e(function(t,e,i,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+n)},"quadraticCurveTo"),bezierCurveTo:/* @__PURE__ */e(function(t,e,i,n,o,a){this._+="C"+ +t+","+ +e+","+ +i+","+ +n+","+(this._x1=+o)+","+(this._y1=+a)},"bezierCurveTo"),arcTo:/* @__PURE__ */e(function(t,e,i,n,o){t=+t,e=+e,i=+i,n=+n,o=+o;var a=this._x1,s=this._y1,r=i-t,l=n-e,h=a-t,c=s-e,u=h*h+c*c;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(u>K)if(Math.abs(c*r-l*h)>K&&o){var p=i-a,d=n-s,f=r*r+l*l,y=p*p+d*d,_=Math.sqrt(f),x=Math.sqrt(u),m=o*Math.tan((Z-Math.acos((f+u-y)/(2*_*x)))/2),g=m/x,b=m/_;Math.abs(g-1)>K&&(this._+="L"+(t+g*h)+","+(e+g*c)),this._+="A"+o+","+o+",0,0,"+ +(c*p>h*d)+","+(this._x1=t+b*r)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},"arcTo"),arc:/* @__PURE__ */e(function(t,e,i,n,o,a){t=+t,e=+e,a=!!a;var s=(i=+i)*Math.cos(n),r=i*Math.sin(n),l=t+s,h=e+r,c=1^a,u=a?n-o:o-n;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+l+","+h:(Math.abs(this._x1-l)>K||Math.abs(this._y1-h)>K)&&(this._+="L"+l+","+h),i&&(u<0&&(u=u%J+J),u>tt?this._+="A"+i+","+i+",0,1,"+c+","+(t-s)+","+(e-r)+"A"+i+","+i+",0,1,"+c+","+(this._x1=l)+","+(this._y1=h):u>K&&(this._+="A"+i+","+i+",0,"+ +(u>=Z)+","+c+","+(this._x1=t+i*Math.cos(o))+","+(this._y1=e+i*Math.sin(o))))},"arc"),rect:/* @__PURE__ */e(function(t,e,i,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},"rect"),toString:/* @__PURE__ */e(function(){return this._},"toString")},e(nt,"constant$3");var ot=Math.abs,at=Math.atan2,st=Math.cos,rt=Math.max,lt=Math.min,ht=Math.sin,ct=Math.sqrt,ut=1e-12,pt=Math.PI,dt=pt/2,ft=2*pt;function yt(t){return t>1?0:t<-1?pt:Math.acos(t)}function _t(t){return t>=1?dt:t<=-1?-dt:Math.asin(t)}function xt(t){return t.innerRadius}function mt(t){return t.outerRadius}function gt(t){return t.startAngle}function bt(t){return t.endAngle}function vt(t){return t&&t.padAngle}function wt(t,e,i,n,o,a,s,r){var l=i-t,h=n-e,c=s-o,u=r-a,p=u*l-c*h;if(!(p*p<ut))return[t+(p=(c*(e-a)-u*(t-o))/p)*l,e+p*h]}function St(t,e,i,n,o,a,s){var r=t-i,l=e-n,h=(s?a:-a)/ct(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-a,w=p*y-f*d,S=(g<0?-1:1)*ct(rt(0,v*v*b-w*w)),A=(w*g-m*S)/b,k=(-w*m-g*S)/b,M=(w*g+m*S)/b,P=(-w*m+g*S)/b,T=A-_,C=k-x,z=M-_,F=P-x;return T*T+C*C>z*z+F*F&&(A=M,k=P),{cx:A,cy:k,x01:-c,y01:-u,x11:A*(o/v-1),y11:k*(o/v-1)}}function At(){var t=xt,i=mt,n=nt(0),o=null,a=gt,s=bt,r=vt,l=null;function h(){var e,h,c=+t.apply(this,arguments),u=+i.apply(this,arguments),p=a.apply(this,arguments)-dt,d=s.apply(this,arguments)-dt,f=ot(d-p),y=d>p;if(l||(l=e=it()),u<c&&(h=u,u=c,c=h),u>ut)if(f>ft-ut)l.moveTo(u*st(p),u*ht(p)),l.arc(0,0,u,p,d,!y),c>ut&&(l.moveTo(c*st(d),c*ht(d)),l.arc(0,0,c,d,p,y));else{var _,x,m=p,g=d,b=p,v=d,w=f,S=f,A=r.apply(this,arguments)/2,k=A>ut&&(o?+o.apply(this,arguments):ct(c*c+u*u)),M=lt(ot(u-c)/2,+n.apply(this,arguments)),P=M,T=M;if(k>ut){var C=_t(k/c*ht(A)),z=_t(k/u*ht(A));(w-=2*C)>ut?(b+=C*=y?1:-1,v-=C):(w=0,b=v=(p+d)/2),(S-=2*z)>ut?(m+=z*=y?1:-1,g-=z):(S=0,m=g=(p+d)/2)}var F=u*st(m),I=u*ht(m),E=c*st(v),R=c*ht(v);if(M>ut){var D,O=u*st(g),j=u*ht(g),N=c*st(b),L=c*ht(b);if(f<pt&&(D=wt(F,I,N,L,O,j,E,R))){var B=F-D[0],$=I-D[1],H=O-D[0],V=j-D[1],q=1/ht(yt((B*H+$*V)/(ct(B*B+$*$)*ct(H*H+V*V)))/2),W=ct(D[0]*D[0]+D[1]*D[1]);P=lt(M,(c-W)/(q-1)),T=lt(M,(u-W)/(q+1))}}S>ut?T>ut?(_=St(N,L,F,I,u,T,y),x=St(O,j,E,R,u,T,y),l.moveTo(_.cx+_.x01,_.cy+_.y01),T<M?l.arc(_.cx,_.cy,T,at(_.y01,_.x01),at(x.y01,x.x01),!y):(l.arc(_.cx,_.cy,T,at(_.y01,_.x01),at(_.y11,_.x11),!y),l.arc(0,0,u,at(_.cy+_.y11,_.cx+_.x11),at(x.cy+x.y11,x.cx+x.x11),!y),l.arc(x.cx,x.cy,T,at(x.y11,x.x11),at(x.y01,x.x01),!y))):(l.moveTo(F,I),l.arc(0,0,u,m,g,!y)):l.moveTo(F,I),c>ut&&w>ut?P>ut?(_=St(E,R,O,j,c,-P,y),x=St(F,I,N,L,c,-P,y),l.lineTo(_.cx+_.x01,_.cy+_.y01),P<M?l.arc(_.cx,_.cy,P,at(_.y01,_.x01),at(x.y01,x.x01),!y):(l.arc(_.cx,_.cy,P,at(_.y01,_.x01),at(_.y11,_.x11),!y),l.arc(0,0,c,at(_.cy+_.y11,_.cx+_.x11),at(x.cy+x.y11,x.cx+x.x11),y),l.arc(x.cx,x.cy,P,at(x.y11,x.x11),at(x.y01,x.x01),!y))):l.arc(0,0,c,v,b,y):l.lineTo(E,R)}else l.moveTo(0,0);if(l.closePath(),e)return l=null,e+""||null}return e(h,"arc"),h.centroid=function(){var e=(+t.apply(this,arguments)+ +i.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +s.apply(this,arguments))/2-pt/2;return[st(n)*e,ht(n)*e]},h.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:nt(+e),h):t},h.outerRadius=function(t){return arguments.length?(i="function"==typeof t?t:nt(+t),h):i},h.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:nt(+t),h):n},h.padRadius=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:nt(+t),h):o},h.startAngle=function(t){return arguments.length?(a="function"==typeof t?t:nt(+t),h):a},h.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:nt(+t),h):s},h.padAngle=function(t){return arguments.length?(r="function"==typeof t?t:nt(+t),h):r},h.context=function(t){return arguments.length?(l=null==t?null:t,h):l},h}function kt(t){this._context=t}function Mt(t){return new kt(t)}function Pt(t){return t[0]}function Tt(t){return t[1]}function Ct(){var t=Pt,i=Tt,n=nt(!0),o=null,a=Mt,s=null;function r(e){var r,l,h,c=e.length,u=!1;for(null==o&&(s=a(h=it())),r=0;r<=c;++r)!(r<c&&n(l=e[r],r,e))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+t(l,r,e),+i(l,r,e));if(h)return s=null,h+""||null}return e(r,"line"),r.x=function(e){return arguments.length?(t="function"==typeof e?e:nt(+e),r):t},r.y=function(t){return arguments.length?(i="function"==typeof t?t:nt(+t),r):i},r.defined=function(t){return arguments.length?(n="function"==typeof t?t:nt(!!t),r):n},r.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),r):a},r.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),r):o},r}function zt(){var t=Pt,i=null,n=nt(0),o=Tt,a=nt(!0),s=null,r=Mt,l=null;function h(e){var h,c,u,p,d,f=e.length,y=!1,_=new Array(f),x=new Array(f);for(null==s&&(l=r(d=it())),h=0;h<=f;++h){if(!(h<f&&a(p=e[h],h,e))===y)if(y=!y)c=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),u=h-1;u>=c;--u)l.point(_[u],x[u]);l.lineEnd(),l.areaEnd()}y&&(_[h]=+t(p,h,e),x[h]=+n(p,h,e),l.point(i?+i(p,h,e):_[h],o?+o(p,h,e):x[h]))}if(d)return l=null,d+""||null}function c(){return Ct().defined(a).curve(r).context(s)}return e(h,"area"),e(c,"arealine"),h.x=function(e){return arguments.length?(t="function"==typeof e?e:nt(+e),i=null,h):t},h.x0=function(e){return arguments.length?(t="function"==typeof e?e:nt(+e),h):t},h.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:nt(+t),h):i},h.y=function(t){return arguments.length?(n="function"==typeof t?t:nt(+t),o=null,h):n},h.y0=function(t){return arguments.length?(n="function"==typeof t?t:nt(+t),h):n},h.y1=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:nt(+t),h):o},h.lineX0=h.lineY0=function(){return c().x(t).y(n)},h.lineY1=function(){return c().x(t).y(o)},h.lineX1=function(){return c().x(i).y(n)},h.defined=function(t){return arguments.length?(a="function"==typeof t?t:nt(!!t),h):a},h.curve=function(t){return arguments.length?(r=t,null!=s&&(l=r(s)),h):r},h.context=function(t){return arguments.length?(null==t?s=l=null:l=r(s=t),h):s},h}function Ft(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function It(t){return t}function Et(){var t=It,i=Ft,n=null,o=nt(0),a=nt(ft),s=nt(0);function r(e){var r,l,h,c,u,p=e.length,d=0,f=new Array(p),y=new Array(p),_=+o.apply(this,arguments),x=Math.min(ft,Math.max(-ft,a.apply(this,arguments)-_)),m=Math.min(Math.abs(x)/p,s.apply(this,arguments)),g=m*(x<0?-1:1);for(r=0;r<p;++r)(u=y[f[r]=r]=+t(e[r],r,e))>0&&(d+=u);for(null!=i?f.sort(function(t,e){return i(y[t],y[e])}):null!=n&&f.sort(function(t,i){return n(e[t],e[i])}),r=0,h=d?(x-p*g)/d:0;r<p;++r,_=c)l=f[r],c=_+((u=y[l])>0?u*h:0)+g,y[l]={data:e[l],index:r,value:u,startAngle:_,endAngle:c,padAngle:m};return y}return e(r,"pie"),r.value=function(e){return arguments.length?(t="function"==typeof e?e:nt(+e),r):t},r.sortValues=function(t){return arguments.length?(i=t,n=null,r):i},r.sort=function(t){return arguments.length?(n=t,i=null,r):n},r.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:nt(+t),r):o},r.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:nt(+t),r):a},r.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:nt(+t),r):s},r}function Rt(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function Dt(t){this._context=t}function Ot(t){return new Dt(t)}function jt(t,e){this._basis=new Dt(t),this._beta=e}e(yt,"acos"),e(_t,"asin$1"),e(xt,"arcInnerRadius$1"),e(mt,"arcOuterRadius$1"),e(gt,"arcStartAngle$1"),e(bt,"arcEndAngle$1"),e(vt,"arcPadAngle$1"),e(wt,"intersect$1"),e(St,"cornerTangents$1"),e(At,"d3Arc"),e(kt,"Linear$1"),kt.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},e(Mt,"d3CurveLinear"),e(Pt,"x$1"),e(Tt,"y$1"),e(Ct,"d3Line"),e(zt,"d3Area"),e(Ft,"descending"),e(It,"identity$2"),e(Et,"d3Pie"),e(Rt,"point$7"),e(Dt,"Basis$1"),Dt.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 3:Rt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Rt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},e(Ot,"d3CurveBasis"),e(jt,"Bundle$1"),jt.prototype={lineStart:/* @__PURE__ */e(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:/* @__PURE__ */e(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],a=e[0],s=t[i]-o,r=e[i]-a,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*s),this._beta*e[l]+(1-this._beta)*(a+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:/* @__PURE__ */e(function(t,e){this._x.push(+t),this._y.push(+e)},"point")};const Nt=/* @__PURE__ */e(function t(i){function n(t){return 1===i?new Dt(t):new jt(t,i)}return e(n,"bundle"),n.beta=function(e){return t(+e)},n},"custom")(.85);function Lt(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function Bt(t,e){this._context=t,this._k=(1-e)/6}e(Lt,"point$6"),e(Bt,"Cardinal$1"),Bt.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Lt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Lt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const $t=/* @__PURE__ */e(function t(i){function n(t){return new Bt(t,i)}return e(n,"cardinal"),n.tension=function(e){return t(+e)},n},"custom")(0);function Ht(t,e,i){var n=t._x1,o=t._y1,a=t._x2,s=t._y2;if(t._l01_a>ut){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>ut){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*h+t._x1*t._l23_2a-e*t._l12_2a)/c,s=(s*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,a,s,t._x2,t._y2)}function Vt(t,e){this._context=t,this._alpha=e}e(Ht,"point$5"),e(Vt,"CatmullRom$1"),Vt.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Ht(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const qt=/* @__PURE__ */e(function t(i){function n(t){return i?new Vt(t,i):new Bt(t,0)}return e(n,"catmullRom"),n.alpha=function(e){return t(+e)},n},"custom")(.5);function Wt(t){return t<0?-1:1}function Gt(t,e,i){var n=t._x1-t._x0,o=e-t._x1,a=(t._y1-t._y0)/(n||o<0&&-0),s=(i-t._y1)/(o||n<0&&-0),r=(a*o+s*n)/(n+o);return(Wt(a)+Wt(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(r))||0}function Xt(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Yt(t,e,i){var n=t._x0,o=t._y0,a=t._x1,s=t._y1,r=(a-n)/3;t._context.bezierCurveTo(n+r,o+r*e,a-r,s-r*i,a,s)}function Ut(t){this._context=t}function Qt(t){return new Ut(t)}function Zt(t){this._context=t}function Jt(t){var e,i,n=t.length-1,o=new Array(n),a=new Array(n),s=new Array(n);for(o[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)o[e]=1,a[e]=4,s[e]=4*t[e]+2*t[e+1];for(o[n-1]=2,a[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)i=o[e]/a[e-1],a[e]-=i,s[e]-=i*s[e-1];for(o[n-1]=s[n-1]/a[n-1],e=n-2;e>=0;--e)o[e]=(s[e]-o[e+1])/a[e];for(a[n-1]=(t[n]+o[n-1])/2,e=0;e<n-1;++e)a[e]=2*t[e+1]-o[e+1];return[o,a]}function Kt(t){return new Zt(t)}function te(t,e){this._context=t,this._t=e}function ee(t){return new te(t,.5)}function ie(t){return new te(t,0)}function ne(t){return new te(t,1)}e(Wt,"sign$1"),e(Gt,"slope3$1"),e(Xt,"slope2$1"),e(Yt,"point$4"),e(Ut,"MonotoneX$1"),Ut.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Yt(this,this._t0,Xt(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Yt(this,Xt(this,i=Gt(this,t,e)),i);break;default:Yt(this,this._t0,i=Gt(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(Ut.prototype).point=function(t,e){Ut.prototype.point.call(this,e,t)},e(Qt,"monotoneX"),e(Zt,"Natural"),Zt.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x=[],this._y=[]},"lineStart"),lineEnd:/* @__PURE__ */e(function(){var t=this._x,e=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===i)this._context.lineTo(t[1],e[1]);else for(var n=Jt(t),o=Jt(e),a=0,s=1;s<i;++a,++s)this._context.bezierCurveTo(n[0][a],o[0][a],n[1][a],o[1][a],t[s],e[s]);(this._line||0!==this._line&&1===i)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},"lineEnd"),point:/* @__PURE__ */e(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},e(Jt,"controlPoints"),e(Kt,"d3CurveNatural"),e(te,"Step$1"),te.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x=this._y=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,e)}}this._x=t,this._y=e},"point")},e(ee,"d3CurveStep"),e(ie,"stepBefore"),e(ne,"stepAfter");var oe=Array.prototype.slice;function ae(t){return t}e(ae,"identity$1");var se=1e-6;function re(t){return"translate("+(t+.5)+",0)"}function le(t){return"translate(0,"+(t+.5)+")"}function he(t){return function(e){return+t(e)}}function ce(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(i){return+t(i)+e}}function ue(){return!this.__axis}function pe(t,i){var n=[],o=null,a=null,s=6,r=6,l=3,h=1===t||4===t?-1:1,c=4===t||2===t?"x":"y",u=1===t||3===t?re:le;function p(e){var p=null==o?i.ticks?i.ticks.apply(i,n):i.domain():o,d=null==a?i.tickFormat?i.tickFormat.apply(i,n):ae:a,f=Math.max(s,0)+l,y=i.range(),_=+y[0]+.5,x=+y[y.length-1]+.5,m=(i.bandwidth?ce:he)(i.copy()),g=e.selection?e.selection():e,b=g.selectAll(".domain").data([null]),v=g.selectAll(".tick").data(p,i).order(),w=v.exit(),S=v.enter().append("g").attr("class","tick"),A=v.select("line"),k=v.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),v=v.merge(S),A=A.merge(S.append("line").attr("stroke","currentColor").attr(c+"2",h*s)),k=k.merge(S.append("text").attr("fill","currentColor").attr(c,h*f).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),e!==g&&(b=b.transition(e),v=v.transition(e),A=A.transition(e),k=k.transition(e),w=w.transition(e).attr("opacity",se).attr("transform",function(t){return isFinite(t=m(t))?u(t):this.getAttribute("transform")}),S.attr("opacity",se).attr("transform",function(t){var e=this.parentNode.__axis;return u(e&&isFinite(e=e(t))?e:m(t))})),w.remove(),b.attr("d",4===t||2==t?r?"M"+h*r+","+_+"H0.5V"+x+"H"+h*r:"M0.5,"+_+"V"+x:r?"M"+_+","+h*r+"V0.5H"+x+"V"+h*r:"M"+_+",0.5H"+x),v.attr("opacity",1).attr("transform",function(t){return u(m(t))}),A.attr(c+"2",h*s),k.attr(c,h*f).text(d),g.filter(ue).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),g.each(function(){this.__axis=m})}return e(p,"axis"),p.scale=function(t){return arguments.length?(i=t,p):i},p.ticks=function(){return n=oe.call(arguments),p},p.tickArguments=function(t){return arguments.length?(n=null==t?[]:oe.call(t),p):n.slice()},p.tickValues=function(t){return arguments.length?(o=null==t?null:oe.call(t),p):o&&o.slice()},p.tickFormat=function(t){return arguments.length?(a=t,p):a},p.tickSize=function(t){return arguments.length?(s=r=+t,p):s},p.tickSizeInner=function(t){return arguments.length?(s=+t,p):s},p.tickSizeOuter=function(t){return arguments.length?(r=+t,p):r},p.tickPadding=function(t){return arguments.length?(l=+t,p):l},p}function de(t){return pe(1,t)}function fe(t){return pe(2,t)}function ye(t){return pe(3,t)}function _e(t){return pe(4,t)}e(re,"translateX"),e(le,"translateY"),e(he,"number"),e(ce,"center"),e(ue,"entering"),e(pe,"axis"),e(de,"axisTop"),e(fe,"axisRight"),e(ye,"axisBottom"),e(_e,"axisLeft");const xe=class _Axis extends l{_origType;_origTimePattern;parser;parserInvert;formatter;d3Scale;d3Axis;d3Guides;_guideElement;svg;svgAxis;svgGuides;_tickFormatFunc;constructor(t="origin"){super(),this._drawStartPos=t,this.updateScale()}lowValue(){return this.parse(this.low())}highValue(){return this.parse(this.high())}parse(t,e){if(t instanceof Array)return t.map(function(t){return this.parse(t)},this);if(null!=t){if(this.parser)return this.parser("number"==typeof t?t.toString():t);if(e&&"string"==typeof t)return+t}return t}parseInvert(t){return t instanceof Array?t.map(function(t){return this.parseInvert(t)},this):this.parserInvert&&t?this.parserInvert(t):t}format(t){return t instanceof Array?t.map(function(t){return this.format(t)},this):null!=t&&this.formatter?this.formatter(t):t}parseFormat(t){return this.format(this.parse(t))}tickFormatFunc(t){return arguments.length?(this._tickFormatFunc=t,this.updateScale(),this):this._tickFormatFunc}scalePos(t){let e=this.d3Scale(this.parse(t));return"ordinal"===this.type()&&(e+=this.bandwidth()/2),e}bandwidth(){return this.d3Scale.bandwidth?this.d3Scale.bandwidth():0}isHorizontal(){switch(this.orientation()){case"left":case"right":return!1}return!0}domain(t){return arguments.length?(this.d3Scale.domain(t),this):this.d3Scale.domain()}range(t){if(!arguments.length){if(this.d3Scale.rangeRoundBands)return this.d3Scale.rangeExtent();if(this.d3Scale.rangeRound)return this.d3Scale.range()}return this.d3Scale.rangeRoundBands?this.d3Scale.rangeRoundBands(t,.1):this.d3Scale.rangeRound&&this.d3Scale.range(t),this}invert(t){return this.d3Scale.invert(t)}guideTarget(t){return this._guideElement=h(t).attr("class",this._class),this}enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgAxis=this.svg.append("g").attr("class","axis"),this.svgGuides=(this._guideElement||e).append("g").attr("class","guide")}_prevOrientation;updateScale(){switch(this.type()){case"ordinal":if(this.d3Scale=x().paddingInner(this.ordinalPaddingInner()).paddingOuter(this.ordinalPaddingOuter()),this.ordinals_exists()&&this.d3Scale.domain(this.ordinals()),this.parser=null,this.ordinalMappings_exists()){const t=this.ordinalMappings();this.formatter=e=>t[e]||e}else this.formatter=null;break;case"linear":this.d3Scale=_(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?f(this.tickFormat()):null;break;case"pow":this.d3Scale=y().exponent(this.powExponent()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?f(this.tickFormat()):null;break;case"log":this.d3Scale=d().base(this.logBase()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?f(this.tickFormat()):null;break;case"time":this.d3Scale=c(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=this.timePattern_exists()?u(this.timePattern()):null,this.parserInvert=this.timePattern_exists()?p(this.timePattern()):null,this._tickFormatFunc?this.formatter=this._tickFormatFunc:this.formatter=this.tickFormat_exists()?p(this.tickFormat()):null}if(this._prevOrientation!==this.orientation()){switch(this.orientation()){case"left":this.d3Axis=_e(this.d3Scale),this.d3Guides=_e(this.d3Scale);break;case"top":this.d3Axis=de(this.d3Scale),this.d3Guides=de(this.d3Scale);break;case"right":this.d3Axis=fe(this.d3Scale),this.d3Guides=fe(this.d3Scale);break;default:this.d3Axis=ye(this.d3Scale),this.d3Guides=ye(this.d3Scale)}this._prevOrientation=this.orientation(),this.svgAxis&&this.svgAxis.html(""),this.svgGuides&&this.svgGuides.html("")}if(this.extend())if("ordinal"===this.type());else{let t,e,i,n,o,a;this.isHorizontal()?(t=this.width(),this.d3Scale.range([0,t]),e=t*this.extend()/100,i=this.d3Scale.invert(0),o=this.d3Scale.invert(-e),n=this.d3Scale.invert(t),a=this.d3Scale.invert(t+e)):(t=this.height(),this.d3Scale.range([t,0]),e=t*this.extend()/100,i=this.d3Scale.invert(t),o=this.d3Scale.invert(t+e),n=this.d3Scale.invert(0),a=this.d3Scale.invert(-e)),o===i&&(o=i-i*this.extend()/100),a===n&&(a=n+n*this.extend()/100),Math.sign(i)!==Math.sign(o)&&(o=0),Math.sign(n)!==Math.sign(a)&&(a=0),this.d3Scale.domain([o,a])}this.d3Axis.scale(this.d3Scale).tickFormat(this.formatter).ticks(this.tickCount()),this.d3Guides.scale(this.d3Scale).tickSize(this.tickLength_exists()?-this.tickLength():0).tickFormat("").ticks(this.tickCount());const t=this.ticks();return t.length&&(this.d3Axis.tickValues(t.map(t=>this.parse(t.value))).tickFormat((e,i)=>t[i].label),this.d3Guides.tickValues(t.map(t=>this.parse(t.value)))),this}adjustText(t,e){const i=this.isHorizontal(),n="left"===this.orientation(),o="bottom"===this.orientation(),a=this,s=t.selectAll(".tick > text").style("font-family",this.fontFamily()).style("font-size",this.fontSize_exists()?this.fontSize()+"px":null);if("linebreak"===this.overlapMode())"ordinal"===this.type()&&s.call(function(){return a.linebreak.apply(a,arguments)},this.bandwidth());else if("wrap"===this.overlapMode())"ordinal"===this.type()&&s.call(function(){return a.wrap.apply(a,arguments)},this.bandwidth());else switch(i?this.overlapMode():"none"){case"stagger":s.style("text-anchor","middle").attr("dy",function(t,i){return(o?1:-1)*((o?.71:0)+i%e)+"em"}).attr("dx",0).attr("visibility",null).attr("transform","rotate(0)");break;case"hide":s.style("text-anchor","middle").attr("dy",(o?.71:0)+"em").attr("dx",0).attr("visibility",function(t,i){return i%e?"hidden":null}).attr("transform","rotate(0)");break;case"rotate":const t=-this.labelRotation()||0;if(0!==t&&e>1){s.each(function(){const e=h(this),i=e.node().getBBox(),n=(o?1:-1)*Math.sin(Math.PI*(-Math.abs(t)/180));e.style("text-anchor",t>0?o?"start":"end":o?"end":"start").attr("dy",i.height/2*n+"px").attr("dx",t>0?o?"0.71em":"-0.71em":o?"-0.71em":"0.71em").attr("transform","rotate("+t+")").attr("visibility",null)});break}default:s.style("text-anchor",i?"middle":n?"end":"start").attr("dy",i?(o?.71:0)+"em":"0.32em").attr("dx",0).attr("visibility",null).attr("transform","rotate(0)")}}calcTickOverlapModulus(t){let e=1;switch(this.overlapMode()){case"rotate":case"stagger":case"hide":const i=[];t.selectAll(".tick > text").each(function(){const t=this.getBoundingClientRect();for(let n=i.length-1;n>=0&&!(i[n].right<t.left);--n)i.length+1-n>e&&(e=i.length+1-n);i.push(t)})}return e}calcOverflow(t,e){if(this.updateScale(),this.hidden())return{left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:1};const i=this.isHorizontal();this.range(i?[0,this.width()]:[this.height(),0]);const n=t.append("g").attr("class",this.classID()),o=n.append("g");o.attr("class",i?"x":"y").call(this.d3Axis),e&&t.selectAll(".tick > text").remove();const a={left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:this.calcTickOverlapModulus(o)};this.adjustText(o,a.tickOverlapModulus);const s=o.node().getBBox();switch(a.depth=i?s.height:s.width,this.shrinkToFit()){case"low":case"both":a.left=i?-s.x:0,a.bottom=i?0:-(this.height()-(s.height+s.y))}switch(this.shrinkToFit()){case"high":case"both":a.top=i?0:-s.y,a.right=i?-(this.width()-s.x-s.width):0}return n.remove(),a}wrap(t,e,i){i=i||/\s+/;const n=this;t.each(function(){const t=h(this),o=t.text().split(i).reverse();let a=[],s=0;const r=t.attr("x"),l=t.attr("y"),c=parseFloat(t.style("font-size"))||10,u=Math.floor(e/(1.1*c))-1,p=n.isHorizontal()?1:Math.ceil(o.length/u),d=parseFloat(t.attr("dy"));let f=t.text(null).append("tspan").attr("x",r).attr("y",l).attr("dy",d+"em"),y=0,_=o.pop();for(;_;)a.push(_),f.text(a.join(" ")),y++,f.node().getComputedTextLength()>e&&y>=p&&(a.pop(),f.text(a.join(" ")),a=[_],f=t.append("tspan").attr("x",r).attr("y",l).attr("dy",1.1*++s+d+"em").text(_),y=0),_=o.pop();n.isHorizontal()||t.selectAll("tspan").attr("y",-s/2+"em")})}linebreak(t,e){this.wrap(t,e,"\n")}update(t,i){super.update(t,i),this.svg.style("display",this.hidden()?"none":null);const n=this.calcOverflow(i),o=this.isHorizontal()?n.left:this.height()-n.top-n.bottom,a=this.isHorizontal()?this.width()-n.right-this.padding():0+this.padding();this.range(this.reverse()?[a,o]:[o,a]);const s=this;function r(t){t.attr("transform",function(){switch(s.orientation()){case"left":return"translate("+n.depth+", "+n.top+")";case"top":return"translate(0,"+n.depth+")";case"right":return"translate("+(s.width()-n.depth)+", "+n.top+")";case"bottom":return"translate(0,"+(s.height()-n.depth)+")"}return"translate(0,0)"})}e(r,"doPosition"),this.svg.style("visibility","none"===this.type()?"hidden":null).transition().call(r),this._guideElement&&this.svgGuides.transition().call(r),this.svgAxis.call(this.d3Axis),this.adjustText(this.svgAxis,n.tickOverlapModulus);this.pos().x;const l=this.width(),h=this.svgAxis.selectAll(".axisTitle").data(this.title()?[this.title()]:[]),c=h.enter().append("text").attr("class","axisTitle").merge(h).transition().attr("dx",null).style("text-anchor","end");switch(this.orientation()){case"left":c.attr("transform","rotate(-90)").attr("x",-2).attr("y",2).attr("dy",".71em");break;case"right":c.attr("transform","rotate(-90)").attr("x",-2).attr("y",4).attr("dx",null).attr("dy","-.71em");break;case"top":c.attr("transform","rotate(0)").attr("x",l-2).attr("y",2).attr("dx",null).attr("dy",".71em");break;case"bottom":c.attr("transform","rotate(0)").attr("x",l-2).attr("y",-2).attr("dy",null)}c.text(this.title_exists()?this.title():""),h.exit().remove(),this.svgGuides.call(this.d3Guides).selectAll(".tick").classed("guide-0",t=>0===t&&this.low()<0)}rerender(){this.svgAxis.call(this.d3Axis),this.svgGuides.call(this.d3Guides)}postUpdate(t,e){super.postUpdate(t,e),this._guideElement&&this._guideElement.attr("transform",this._element.attr("transform"))}};e(xe,"Axis");let me=xe;me.prototype._class+=" chart_Axis",me.prototype.publish("type","linear","set","Type",["none","ordinal","linear","pow","log","time"]),me.prototype.publish("timePattern","%Y-%m-%d","string","Time Series Pattern",null,{disable:/* @__PURE__ */e(t=>"time"!==t.type(),"disable")}),me.prototype.publish("reverse",!1,"boolean","Reverse"),me.prototype.publish("title",null,"string","Title"),me.prototype.publish("orientation","bottom","set","Placement/orientation of the axis",["left","top","right","bottom"]),me.prototype.publish("powExponent",2,"number","Power exponent (disabled when type is not 'pow')",null,{disable:/* @__PURE__ */e(t=>"pow"!==t.type(),"disable")}),me.prototype.publish("logBase",10,"number","Logarithmic base (disabled when type is not 'log')",null,{disable:/* @__PURE__ */e(t=>"log"!==t.type(),"disable")}),me.prototype.publish("ordinals",[],"array","Array of ordinal values to display (disabled when type is not 'ordinal')",null,{disable:/* @__PURE__ */e(t=>"ordinal"!==t.type(),"disable")}),me.prototype.publish("fontSize",null,"number","Size of tick label font (pixels)",null,{optional:!0}),me.prototype.publish("fontFamily",null,"string","Font family of tick labels",null,{optional:!0}),me.prototype.publish("tickCount",null,"number","Number of ticks to display (disabled when type is 'ordinal')",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.type(),"disable")}),me.prototype.publish("tickFormat",null,"string","Format rules for tick text (disabled when type is 'ordinal')",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.type(),"disable")}),me.prototype.publish("tickLength",null,"number","Height (or width for left/right orientations) of the axis ticks (in pixels)",null,{optional:!0}),me.prototype.publish("ticks",[],"array","Custom tick labels",null,{optional:!0}),me.prototype.publish("low",null,"any","Minimum tick value (disabled when type is ordinal)",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.type(),"disable")}),me.prototype.publish("high",null,"any","Maximum tick value (disabled when type is ordinal)",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.type(),"disable")}),me.prototype.publish("overlapMode","none","set","Specifies the behavior when tick labels overlap",["none","stagger","hide","rotate","linebreak","wrap"]),me.prototype.publish("labelRotation",33,"number","Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')",null,{optional:!0,disable:/* @__PURE__ */e(t=>"rotate"!==t.overlapMode(),"disable")}),me.prototype.publish("shrinkToFit","both","set","shrinkToFit",["none","low","high","both"]),me.prototype.publish("extend",5,"number","Extend the axis range by this % beyond what is needed to display the data (disabled when type is 'ordinal')",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.type(),"disable")}),me.prototype.publish("hidden",!1,"boolean","Hides axis when 'true'"),me.prototype.publish("ordinalPaddingInner",.1,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)",null,{disable:/* @__PURE__ */e(t=>"ordinal"!==t.type(),"disable")}),me.prototype.publish("ordinalPaddingOuter",.1,"number","Determines the ratio of the range that is reserved for blank space before the first band and after the last band (0->1)",null,{disable:/* @__PURE__ */e(t=>"ordinal"!==t.type(),"disable")}),me.prototype.publish("ordinalMappings",null,"object","Alternative label mappings (icons)",null,{optional:!0}),me.prototype.publish("padding",0,"number","Padding space at top of axis (pixels)",null,{optional:!0}),me.prototype._origType=me.prototype.type,me.prototype.type=function(t){const e=me.prototype._origType.apply(this,arguments);return void 0!==t&&(this._type=t,this.updateScale()),e},me.prototype._origTimePattern=me.prototype.timePattern,me.prototype.timePattern=function(t){const e=me.prototype._origTimePattern.apply(this,arguments);return void 0!==t&&(this._timePattern=t,this.updateScale()),e};const ge=class _XYAxis extends l{domainAxis;valueAxis;xAxis;yAxis;xyBrush;xBrush;yBrush;margin;focusChart;constructor(){super(),m.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.domainAxis=(new me).classed({domain:!0}).orientation_default("bottom").type("ordinal").overlapMode_default("stagger").shrinkToFit_default("high").extend_default(0),this.valueAxis=(new me).classed({value:!0}).orientation_default("left").type("linear").shrinkToFit_default("high"),this.xyBrush=g().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.xBrush=b().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.yBrush=v().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2())}_prevBrush;resetSelection(){return this._prevBrush=null,this}parseData(t){return this.domainAxis.parse(t)}parseValue(t){return this.valueAxis.parse(t,!0)}formatData(t){return this.domainAxis.format(t)}formatValue(t){return this.valueAxis.format(t)}parsedData(){return this.data().map(function(t){let e=0;return t.map(function(t,i){if(0===i)return this.parseData(t);if(i>=this.columns().length)return t;const n=this.yAxisStacked()?[e,e+this.parseValue(t)]:this.parseValue(t);return e+=this.parseValue(t),n},this)},this)}bandwidth(){return this.domainAxis.bandwidth()}svg;svgRegions;svgDomainGuide;svgValueGuide;svgData;svgDataClipRect;svgFocus;svgBrush;enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgRegions=e.append("g"),this.svgDomainGuide=this.svg.append("g"),this.svgValueGuide=this.svg.append("g"),this.svgData=this.svg.append("g"),this.svgDataClipRect=this.svg.append("clipPath").attr("id",this.id()+"_clippath").append("rect").attr("x",0).attr("y",0),this.svgData=this.svg.append("g").attr("clip-path","url(#"+this.id()+"_clippath)"),this._selection.widgetElement(this.svgData),this.svgFocus=e.append("g"),this.domainAxis.target(this.svg.node()).guideTarget(this.svgDomainGuide.node()),this.valueAxis.target(this.svg.node()).guideTarget(this.svgValueGuide.node()),this.svgBrush=e.append("g").attr("class","brush"),this.chartsEnter(this,this.svgData,250)}resizeBrushHandle(t,e,i){let n,o,a;return"e"===t.type||"w"===t.type?(n=+("e"===t.type),o=n?1:-1,a=i/3,"M"+.5*o+","+a+"A6,6 0 0 "+n+" "+6.5*o+","+(a+6)+"V"+(2*a-6)+"A6,6 0 0 "+n+" "+.5*o+","+2*a+"ZM"+2.5*o+","+(a+8)+"V"+(2*a-8)+"M"+4.5*o+","+(a+8)+"V"+(2*a-8)):(n=+("s"===t.type),a=n?1:-1,o=e/3,"M"+o+", "+.5*a+"A6,6 0 0 "+(n+1)%2+" "+(o+6)+","+6.5*a+"H"+(2*o-6)+"A6,6 0 0 "+(n+1)%2+" "+2*o+","+.5*a+"ZM"+(o+8)+","+2.5*a+"H"+(2*o-8)+"M"+(o+8)+","+4.5*a+"H"+(2*o-8))}_skipSelection=!1;skipSelection(t){return arguments.length?(this._skipSelection=t,this):this._skipSelection}brushMoved(){if(this._skipSelection)return;let t=[];const e=this,i=w(this.svgBrush.node());i&&(t=this.data().filter(function(t){const n=e.dataPos(t[0]);if(e.use2dSelection()){const o=e.valuePos(t[1])+e.valueAxis.bandwidth()/2;return n>=i[0][0]&&n<=i[1][0]&&o>=i[0][1]&&o<=i[1][1]}return n>=i[0]&&n<=i[1]})),this.selection(t)}brushMoved2(){const t="horizontal"===this.orientation(),e=this.use2dSelection()?[]:t?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],i=this.svgBrush.selectAll(".handle--custom").data(e),n=S()?.selection;null==n?i.attr("display","none"):t?i.attr("display",null).attr("transform",(t,e)=>"translate("+n[e]+",0)"):i.attr("display",null).attr("transform",(t,e)=>"translate(0, "+n[e]+")")}dataPos(t){return this.domainAxis.scalePos(t)}valuePos(t){return this.valueAxis.scalePos(t)}getAxisSize(t){return{width:this.xAxis?this.xAxis.width():t.xAxis.width(),height:this.yAxis?this.yAxis.height():t.yAxis.width()}}calcMargin(t,e,i){const n={top:!i&&this.selectionMode()?10:2,right:i&&(this.selectionMode()||this.xAxisFocus())?10:2,bottom:(this.xAxisFocus()?this.xAxisFocusHeight():0)+2,left:2},o=this.width()-n.left-n.right,a=this.height()-n.top-n.bottom;let s=0,r=30,l=0,h=30;for(let c=0;c<10;++c){this.xAxis.width(o-h).height(0);const t=this.xAxis.calcOverflow(e),i=t.depth;this.yAxis.width(0).height(a-r);const n=this.yAxis.calcOverflow(e),c=n.depth;if(s=t.right,l=n.top,i===r&&c===h)break;r=i,h=c}return this.xAxis.x(o/2+h/2+n.left).y(a+n.top).width(o-h),this.yAxis.x(n.left).y(a/2-r/2+n.top).height(a-r),n.left+=h,n.top+=l,n.right+=s,n.bottom+=r,n}updateRegions(t,e,i){const n=this,o=this.svgRegions.selectAll(".region").data(this.regions());o.enter().append("rect").attr("class","region"),i?o.attr("x",function(t){return n.dataPos(t.x0)}).attr("y",0).attr("width",function(t){return n.dataPos(t.x1)-n.dataPos(t.x0)}).attr("height",this.height()).style("stroke",function(t){return n._palette(t.colorID)}).style("fill",function(t){return A(n._palette(t.colorID)).brighter()}):o.attr("x",0).attr("y",function(t){return n.dataPos(t.x0)}).attr("width",this.width()).attr("height",function(t){return n.dataPos(t.x0)-n.dataPos(t.x1)}).style("stroke",function(t){return n._palette(t.colorID)}).style("fill",function(t){return A(n._palette(t.colorID)).brighter()}),o.exit().remove()}_prevXAxisType;update(t,e){this.selectionGlow(!this.tabNavigation()),super.update(t,e);const i=this,n="horizontal"===this.orientation();if(this.updateRegions(t,e,n),this.domainAxis.orientation(n?"bottom":"left").title(this.xAxisTitle_exists()?this.xAxisTitle():this.columns()[0]),this.valueAxis.orientation(n?"left":"bottom"),this.xAxis=n?this.domainAxis:this.valueAxis,this.yAxis=n?this.valueAxis:this.domainAxis,"ordinal"===this.xAxisType()){const t=this.columns().length,e={};this.domainAxis.ordinals(this.data().map(function(n){return e[n[0]]=i.xAxisOrdinalMapping(n,n[t]),n[0]})).ordinalMappings(e)}else{const t=this.xAxisDomainLow()?this.xAxisDomainLow():this.domainAxis.parseInvert(k(this.parsedData(),function(t){return t[0]})),e=this.xAxisDomainHigh()?this.xAxisDomainHigh():this.domainAxis.parseInvert(M(this.parsedData(),function(t){return t[0]}));void 0!==t&&void 0!==e&&this.domainAxis.low(t).high(e)}const o=this.yAxisDomainLow()?this.yAxisDomainLow():this.valueAxis.parseInvert(k(this.parsedData(),function(t){return k(t.filter(function(t,e){return e>0&&i.columns()[e]&&0!==i.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[0]:t})})),a=this.yAxisDomainHigh()?this.yAxisDomainHigh():this.valueAxis.parseInvert(M(this.parsedData(),function(t){return M(t.filter(function(t,e){return e>0&&i.columns()[e]&&0!==i.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[1]:t})}));this.valueAxis.low(o).high(a),this.margin=this.calcMargin(t,e,n);let s=this.width()-this.margin.left-this.margin.right;s<0&&(s=0);let r=this.height()-this.margin.top-this.margin.bottom;r<0&&(r=0);const l=n?s:r,h=n?r:s;if(this.domainAxis.tickLength(this.xAxisGuideLines()?h:0).render(),this.valueAxis.tickLength(this.yAxisGuideLines()?l:0).render(),this.svgDataClipRect.attr("width",s).attr("height",r),this.svgData.transition().attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.updateBrush(s,r,l,n),this.updateFocusChart(t,e,this.margin,s,r,n),this.chartsUpdate(s,r,250),this.selectionMode())return this.brushMoved()}updateBrush(t,e,i,n){const o=this.use2dSelection()?this.xyBrush:n?this.xBrush:this.yBrush,a=w(this.svgBrush.node());o.extent([[0,0],[t,e]]),this.svgBrush.attr("transform","translate("+this.margin.left+", "+this.margin.top+")").style("display",this.selectionMode()?null:"none").call(o);const s=this.use2dSelection()?[]:n?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],r=this.svgBrush.selectAll(".handle--custom").data(s);if(r.enter().append("path").attr("class","handle--custom").merge(r).attr("cursor",n?"ew-resize":"ns-resize").attr("d",i=>this.resizeBrushHandle(i,t,e)),this.selectionMode()){if(this._prevXAxisType!==this.xAxisType()&&(this._prevXAxisType=this.xAxisType(),this._prevBrush=null),this._prevBrush){if(a){if(this._prevBrush.orientation!==this.orientation()){const t=a[0];a[0]=this._prevBrush.maxCurrExtent-a[1],a[1]=this._prevBrush.maxCurrExtent-t}const t=i/this._prevBrush.maxCurrExtent;1!==t&&this.svgBrush.transition().on("start",function(){o.on("end",null)}).call(o.move,[a[0]*t,a[1]*t]).on("end",()=>{o.on("end",()=>this.brushMoved())})}}else this.svgBrush.call(o.move,[0,i]);this._prevBrush={orientation:this.orientation(),maxCurrExtent:i}}}updateFocusChart(t,e,i,n,o,a){const s=this,r=this.svgFocus.selectAll("#"+this.id()+"_focusChart").data(this.xAxisFocus()?[!0]:[]);r.enter().append("g").attr("id",this.id()+"_focusChart").attr("class","focus").each(function(){s.focusChart=(new s.constructor).target(this),s.focusChart.xBrush.on("brush.focus",function(){s.syncAxis(n),s.chartsUpdate(n,o,0)}),s.focusChart.layers(s.layers().map(t=>new t.constructor))}).merge(r).each(function(){s.copyPropsTo(s.focusChart,["layers"]);let t=0;for(const e of s.layers())e.copyPropsTo(s.focusChart.layers()[t]),t++;s.focusChart.xAxisFocus(!1).selectionMode(!0).skipSelection(!0).orientation("horizontal").xAxisGuideLines(!1).xAxisDomainLow(null).xAxisDomainHigh(null).yAxisGuideLines(!1).x(s.width()/2).y(s.height()-s.xAxisFocusHeight()/2).width(s.width()).height(s.xAxisFocusHeight()).columns(s.columns()).data(s.data()).render(),s.syncAxis(n)}),r.exit().each(function(){s.focusChart&&(s.focusChart.target(null),delete s.focusChart)}).remove()}syncAxis(t){const e=w(this.focusChart.svgBrush.node());if(e){if("ordinal"!==this.focusChart.xAxisType())this.xAxis.domain([this.focusChart.xAxis.invert(e[0]),this.focusChart.xAxis.invert(e[1])]);else{const i=(e[1]-e[0])/t;this.xAxis.range([-e[0]/i,(t-e[0])/i])}this.xAxis.rerender()}}layerColumns(t){const e=t.columns(),i=super.columns().filter(t=>t!==e[0]);return i.length?[e[0],...i]:e}layerColumnIndices(t){const e=t.columns();return this.layerColumns(t).map(t=>e.indexOf(t))}layerColumnIndex(t,e){return t.columns().indexOf(e)}layerData(t){if(1===arguments.length){const e=this.layerColumnIndices(t);return t.data().map(t=>{const i=e.map(e=>t[e]);return i.__hpcc_origRow=t,i})}throw new Error("Setting data on XYAxisLayer is not supported.")}layerEnter(t,e,i=250){}layerUpdate(t,e,i=250){}layerExit(t,e,i=250){}chartsEnter(t,e,i=250){this.layerEnter(this,e,i);for(const n of this.layers())n.__xyAxisElement=e.append("g").attr("class",n.class()),n.target(n.__xyAxisElement.node()).layerEnter(this,e,i)}chartsUpdate(t,e,i){this.layerUpdate(this,this.svgData,i);for(const n of this.layers())n.resize({width:t,height:e}).layerUpdate(this,n.__xyAxisElement,i)}exit(t,e){this.valueAxis.target(null),this.domainAxis.target(null),super.exit(t,e)}selection(t){const e=this;this._selection.widgetElement().selectAll(".selected,.deselected").each(function(i){const n=t.indexOf(i.origRow)>=0;h(this).classed("selected",n).classed("deselected",!n).attr("filter",e._selection.svgGlowID()&&n?`url(#${e._selection.svgGlowID()})`:null)});const i=t.map(t=>this.rowToObj(t));setTimeout(()=>{this.click(i,"",!0)},0)}xAxisOrdinalMapping(t,e){return t[0]}click(t,e,i){}_selection};e(ge,"XYAxis");let be=ge;be.prototype._class+=" chart_XYAxis",be.prototype.mixin(m.SimpleSelectionMixin),be.prototype.publish("orientation","horizontal","set","Selects orientation for the axis",["horizontal","vertical"]),be.prototype.publish("pointSizeColumn",null,"string","pointSizeColumn",null,{optional:!0}),be.prototype.publish("minPointSize",6,"number","minPointSize"),be.prototype.publish("maxPointSize",26,"number","maxPointSize"),be.prototype.publish("use2dSelection",!1,"boolean","2D Range Selector"),be.prototype.publish("selectionMode",!1,"boolean","Range Selector"),be.prototype.publishProxy("xAxisTitle","domainAxis","title"),be.prototype.publishProxy("xAxisTickCount","domainAxis","tickCount"),be.prototype.publishProxy("xAxisTickFormat","domainAxis","tickFormat"),be.prototype.publishProxy("xAxisTicks","domainAxis","ticks"),be.prototype.publishProxy("xAxisType","domainAxis","type"),be.prototype.publishProxy("xAxisTypeTimePattern","domainAxis","timePattern"),be.prototype.publish("xAxisDomainLow",null,"string","X-Axis Low",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.xAxisType(),"disable")}),be.prototype.publish("xAxisDomainHigh",null,"string","X-Axis High",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.xAxisType(),"disable")}),be.prototype.publishProxy("xAxisFontSize","domainAxis","fontSize"),be.prototype.publishProxy("xAxisFontFamily","domainAxis","fontFamily"),be.prototype.publishProxy("xAxisOrdinalPaddingInner","domainAxis","ordinalPaddingInner"),be.prototype.publishProxy("xAxisOrdinalPaddingOuter","domainAxis","ordinalPaddingOuter"),be.prototype.publishProxy("xAxisOverlapMode","domainAxis","overlapMode"),be.prototype.publishProxy("xAxisLabelRotation","domainAxis","labelRotation"),be.prototype.publishProxy("xAxisDomainPadding","domainAxis","extend"),be.prototype.publish("xAxisGuideLines",!1,"boolean","Y-Axis Guide Lines"),be.prototype.publish("xAxisFocus",!1,"boolean","X-Axis Focus",null,{disable:/* @__PURE__ */e(t=>"horizontal"!==t.orientation(),"disable")}),be.prototype.publish("xAxisFocusHeight",80,"number","X-Axis Focus Height",null,{disable:/* @__PURE__ */e(t=>!t.xAxisFocus(),"disable")}),be.prototype.publishProxy("xAxisHidden","domainAxis","hidden"),be.prototype.publishProxy("yAxisFontSize","valueAxis","fontSize"),be.prototype.publishProxy("yAxisFontFamily","valueAxis","fontFamily"),be.prototype.publishProxy("yAxisTitle","valueAxis","title"),be.prototype.publishProxy("yAxisTickCount","valueAxis","tickCount"),be.prototype.publishProxy("yAxisTickFormat","valueAxis","tickFormat"),be.prototype.publishProxy("yAxisTicks","valueAxis","ticks"),be.prototype.publishProxy("yAxisType","valueAxis","type"),be.prototype.publishProxy("yAxisTypeTimePattern","valueAxis","timePattern"),be.prototype.publishProxy("yAxisTypePowExponent","valueAxis","powExponent"),be.prototype.publishProxy("yAxisTypeLogBase","valueAxis","logBase"),be.prototype.publish("yAxisStacked",!1,"boolean","Stacked Chart",null,{tags:["Basic"],disable:/* @__PURE__ */e(t=>"ordinal"!==t.xAxisType()||t._class.indexOf("chart_Column")<0,"disable")}),be.prototype.publish("yAxisDomainLow",null,"string","Y-Axis Low",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.yAxisType(),"disable")}),be.prototype.publish("yAxisDomainHigh",null,"string","Y-Axis High",null,{optional:!0,disable:/* @__PURE__ */e(t=>"ordinal"===t.yAxisType(),"disable")}),be.prototype.publishProxy("yAxisDomainPadding","valueAxis","extend"),be.prototype.publish("yAxisGuideLines",!0,"boolean","Y-Axis Guide Lines"),be.prototype.publishProxy("yAxisHidden","valueAxis","hidden"),be.prototype.publish("regions",[],"array","Regions"),be.prototype.publish("layers",[],"widgetArray","Layers",null,{render:!1}),be.prototype.publishProxy("xAxisPadding","domainAxis","padding"),be.prototype.publishProxy("yAxisPadding","valueAxis","padding"),be.prototype.publish("tabNavigation",!1,"boolean","Enable or disable tab navigation");const ve=class _Scatter extends be{constructor(){super(),n.call(this),o.call(this),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}curve(){switch(this.interpolate()){case"linear":return Mt;case"step":return ee;case"step-before":return ie;case"step-after":return ne;case"basis":return Ot;case"bundle":return Nt;case"cardinal":return $t;case"catmullRom":return qt;case"natural":return Kt;default:return Qt}}getScale(){switch(this.pointSizeScale()){case"linear":return _();case"pow":return y().exponent(2);case"log":return d();case"sqrt":return P()}}pointColor(t,e,i,n){return this.interpolate()&&this.pointDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}lineColor(t,e,i,n){return this.interpolateFill()&&this.interpolateDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}areaColor(t,e,i,n){return this.fillColor(t,e,i,n)}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(t){return"series-table"===n.tooltipStyle()?n.tooltipFormat({label:t.label,arr:n.columns().slice(1).map(function(e,i){return{label:e,color:n._palette(e),value:n.data()[t.rowIdx][i+1]}})}):n.tooltipFormat({label:t.label,series:t.column,value:t.value})})}_prevPointShape;layerUpdate(t,i,n=250){super.layerUpdate(t,i);const o="horizontal"===t.orientation(),a=o?this.height():this.width(),s=this;function r(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}this.tabNavigation()&&t.parentRelativeDiv?t.parentRelativeDiv.attr("tabindex","0").attr("role","group").attr("aria-label",`${this.columns()[0]||"Chart"} data`):t.parentRelativeDiv&&t.parentRelativeDiv.attr("tabindex",null).attr("role",null).attr("aria-label",null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._prevPointShape!==this.pointShape()&&(i.selectAll(".data").remove(),this._prevPointShape=this.pointShape()),e(r,"mapShape");let l,c,u;this.pointSizeColumn_exists()&&(l=this.columns().indexOf(this.pointSizeColumn()),c=T(this.data(),t=>t[l]),u=this.getScale().domain(c));const p=this.layerColumns(t),d=this.layerData(t),f=this.flattenData(p,d).map(function(t){return t.shape=r(s.pointShape()),t.column=p[t.colIdx],t.row=d[t.rowIdx],t.origRow=d[t.rowIdx].__hpcc_origRow,c?(t.size=u(t.row[l])*(s.maxPointSize()-s.minPointSize())+s.minPointSize(),t.column!==s.pointSizeColumn()&&t):(t.size=s.pointSize(),t)}).filter(t=>t),y=i.selectAll(".area").data(p.filter(function(t,e){return s.interpolate()&&s.interpolateFill()&&e>0})),_=y.enter().append("path"),x=zt().curve(this.curve());o?x.x(function(e){return s.xPos(t,e)}).y0(Math.min(a,this.yPos(t,{value:0}))).y1(function(e){return s.yPos(t,e)}):x.y(function(e){return s.yPos(t,e)}).x0(Math.max(0,this.xPos(t,{value:0}))).x1(function(e){return s.xPos(t,e)}),_.merge(y).attr("class",t=>"area series series-"+this.cssTag(t)).each(function(t,e){h(this).attr("d",x(f.filter(function(t){return t.colIdx===e+1}))).style("opacity",s.interpolateFillOpacity()).style("stroke","none").style("fill",s.areaColor([],t,void 0,[]))}),y.exit().remove();const m=i.selectAll(".line").data(p.filter(function(t,e){return s.interpolate()&&e>0})),g=m.enter().append("path"),b=Ct().x(function(e){return s.xPos(t,e)}).y(function(e){return s.yPos(t,e)}).curve(this.curve());g.merge(m).attr("class",t=>"line series series-"+this.cssTag(t)).each(function(t,e){const i=h(this),n=f.filter(function(t){return t.colIdx===e+1});i.attr("d",b(n)).style("stroke",s.lineColor([],t,void 0,[])).style("fill","none")}),m.exit().remove();const v=i.selectAll(".point").data(f,function(t,e){return t.shape+"_"+e});v.enter().append("g").each(function(e){const i=h(this);i.append(e.shape).attr("class","pointShape"),i.append("text").attr("class","pointValue").style("display","none").attr("text-anchor",s.valueAnchor()).attr("alignment-baseline",s.valueBaseline()).attr("fill",function(t,e){return"middle"===s.valueBaseline()||"central"===s.valueBaseline()?s.textColor(t.row,t.column,t.value,t.origRow):null}),i.append("circle").attr("class","pointSelection").on("mouseout.tooltip",s.tooltip.hide).on("mousemove.tooltip",s.tooltip.show).call(t._selection.enter.bind(t._selection)).on("click",function(e,i){s.click(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))}).on("dblclick",function(e,i){s.dblclick(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))}).on("keydown",function(e,i){if(s.tabNavigation()){const e=S();"Space"!==e.code&&"Enter"!==e.key||(e.preventDefault(),t._selection.click(this))}})}).merge(v).attr("class",t=>"point series series-"+this.cssTag(t.column)).each(function(e){h(this).select(".pointValue").attr("x",function(e){return s.xPos(t,e)}).attr("y",function(e){return s.yPos(t,e)}).style("display",s.showValue()?"block":"none").attr("text-anchor",s.valueAnchor()).attr("alignment-baseline",s.valueBaseline()).text(function(t){return t.value});h(this).select(".pointSelection").attr("cx",function(e){return s.xPos(t,e)}).attr("cy",function(e){return s.yPos(t,e)}).attr("r",e.size).attr("tabindex",s.tabNavigation()?0:null).attr("role",s.tabNavigation()?"button":null).attr("aria-label",s.tabNavigation()?t=>`${t.column||"Value"}: ${t.value} @ ${t.label}`:null);const i=h(this).select(".pointShape");switch(e.shape){case"rect":i.attr("x",function(i){return s.xPos(t,i)-e.size/2}).attr("y",function(i){return s.yPos(t,i)-e.size/2}).attr("width",e.size).attr("height",e.size).style("fill",s.pointColor(e.row,e.column,e.value,e.origRow));break;case"circle":i.attr("cx",function(e){return s.xPos(t,e)}).attr("cy",function(e){return s.yPos(t,e)}).attr("r",.9*e.size).style("fill",s.pointColor(e.row,e.column,e.value,e.origRow));break;case"path":i.attr("d",function(i){return"M"+(s.xPos(t,i)-e.size/2)+" "+(s.yPos(t,i)-e.size/2)+" L"+(s.xPos(t,i)+e.size/2)+" "+(s.yPos(t,i)+e.size/2)+" M"+(s.xPos(t,i)-e.size/2)+" "+(s.yPos(t,i)+e.size/2)+" L"+(s.xPos(t,i)+e.size/2)+" "+(s.yPos(t,i)-e.size/2)}).style("stroke",s.pointColor(e.row,e.column,e.value,e.origRow))}}),v.exit().remove()}exit(t,e){super.exit(t,e)}};e(ve,"Scatter"),i(ve,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number",multi:!0}]);let we=ve;we.prototype._class+=" chart_Scatter",we.prototype.implements(n.prototype),we.prototype.implements(o.prototype),we.prototype.publish("paletteID","default","set","Color palette for this widget",we.prototype._palette.switch(),{tags:["Basic","Shared"]}),we.prototype.publish("pointSizeScale","linear","set","pointSizeScale",["linear","pow","log","sqrt"]),we.prototype.publish("pointShape","cross","set","Shape of the data points",["circle","rectangle","cross"]),we.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),we.prototype.publish("interpolate","","set","Interpolate Data",["","linear","step","step-before","step-after","basis","bundle","cardinal","catmullRom","natural","monotone"]),we.prototype.publish("pointDarken",!0,"boolean","If true, and interpolate is set, then points will have a slightly darker color than their assigned palette color",null,{disable:/* @__PURE__ */e(t=>!t.interpolate(),"disable")}),we.prototype.publish("interpolateDarken",!0,"boolean","If true, and interpolateFill is true, then lines will have a slightly darker color than their assigned palette color",null,{disable:/* @__PURE__ */e(t=>!t.interpolateFill(),"disable")}),we.prototype.publish("interpolateFill",!1,"boolean","If true, the area between the line and zero will be filled"),we.prototype.publish("interpolateFillOpacity",.66,"number","Fill interpolation Opacity",null,{range:{min:0,step:.01,max:1}}),we.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),we.prototype.publish("showValue",!1,"boolean"),we.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),we.prototype.publish("valueBaseline","ideographic","set","alignment-baseline for shown value text",["auto","baseline","before-edge","text-before-edge","middle","central","after-edge","text-after-edge","ideographic","alphabetic","hanging","mathematical","inherit"]);const Se=class _Area extends we{constructor(){super(),this.interpolate_default("linear").interpolateFill_default(!0)}};e(Se,"Area");let Ae=Se;Ae.prototype._class+=" chart_Area";const ke=class _Column extends be{_linearGap;textLocal=C();stackedTextLocal=C();isHorizontal;constructor(){super(),n.call(this),o.call(this),this._selection.skipBringToTop(!0),this._linearGap=25}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(e){if("series-table"===n.tooltipStyle())return n.tooltipFormat({label:e.row[0],arr:n.columns().slice(1).map(function(t,i){return{label:t,color:n._palette(t),value:e.row[i+1]}})});{let i=e.row[e.idx];return i instanceof Array&&(i=i[1]-i[0]),n.tooltipFormat({label:e.row[0],series:n.layerColumns(t)[e.idx],value:i})}})}adjustedData(t){return this.layerData(t).map(e=>{let i=0;return e.map((e,n)=>{if(0===n)return e;if(n>=this.layerColumns(t).length)return e;const o=t.yAxisStacked()?[i,i+e]:e;return i+=e,o},this)},this)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i);const n="horizontal"===t.orientation();this.isHorizontal=n;const o=this;this.tabNavigation()&&t.parentRelativeDiv?t.parentRelativeDiv.attr("tabindex","0").attr("role","group").attr("aria-label",`${this.columns()[0]||"Chart"} data`):t.parentRelativeDiv&&t.parentRelativeDiv.attr("tabindex",null).attr("role",null).attr("aria-label",null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const a=f(o.showValueAsPercentFormat());let s=10,r=0;switch(t.xAxisType()){case"ordinal":s=t.bandwidth(),r=-s/2;break;case"linear":case"time":s=Math.max(Math.abs(t.dataPos(2)-t.dataPos(1))*(100-this._linearGap)/100,s),r=-s/2}this.tooltip.direction(n?"n":"e");const l=x().domain(o.layerColumns(t).filter(function(t,e){return e>0})).rangeRound(n?[0,s]:[s,0]).paddingInner(Math.max(this.xAxisSeriesPaddingInner(),.05)).paddingOuter(0);let c=[];const u=[],p=this.columns().length,d=this.data();this.showValue()&&"series"===this.showValueAsPercent()&&d.forEach(t=>{t.filter((t,e)=>e>0&&e<p).forEach((t,e)=>{void 0===u[e+1]&&(u[e+1]=0),u[e+1]+=t})}),(this.showDomainTotal()||this.showValue()&&"domain"===this.showValueAsPercent())&&(c=d.map(t=>t.filter((t,e)=>e>0&&e<p).reduce((t,e)=>t+e,0)));const y=e.selectAll(".dataRow").data(this.adjustedData(t)),_=t.data(),m=this.getAxisSize(t);y.enter().append("g").attr("class","dataRow").merge(y).each(function(e,d){const y=h(this),x=y.selectAll(".dataCell").data(e.filter(function(e,i){return i<o.layerColumns(t).length}).map(function(i,n){return{column:o.layerColumns(t)[n],row:e,origRow:_[d],value:i,idx:n}}).filter(function(t){return null!==t.value&&t.idx>0}),t=>t.column),g=x.enter().append("g").attr("class","dataCell").on("mouseout.tooltip",function(t){(!o.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&o.tooltip.hide.apply(o,arguments)}).on("mousemove.tooltip",function(t){(!o.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&o.tooltip.show.apply(o,arguments)}).call(t._selection.enter.bind(t._selection)).on("click",function(e){o.click(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).on("dblclick",function(e){o.dblclick(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).on("keydown",function(e,i){if(o.tabNavigation()){const e=S();"Space"!==e.code&&"Enter"!==e.key||(e.preventDefault(),t._selection.click(this))}}).style("opacity",0).each(function(t){const e=h(this);e.append("rect").attr("class","columnRect series series-"+o.cssTag(t.column)),e.append("text").attr("class","columnRectText").style("stroke","transparent")});g.transition().duration(i).style("opacity",1);const b=t.yAxisStacked()?s:l.bandwidth();g.merge(x).attr("tabindex",o.tabNavigation()?0:null).attr("role",o.tabNavigation()?"button":null).attr("aria-label",o.tabNavigation()?t=>`${t.origRow[0]} - ${t.column}: ${t.value instanceof Array?t.value[1]-t.value[0]:t.value}`:null).each(function(s){const y=h(this),_=t.dataPos(e[0])+(t.yAxisStacked()?0:l(s.column))+r,x=s.value instanceof Array?s.value[1]:s.value;let g=s.origRow[s.idx];if(o.showValue()){const t=o.dataMeta();switch(o.showValueAsPercent()){case"series":const e=void 0!==t.sum?t.sum:u[s.idx];g=a(g/e);break;case"domain":const i=void 0!==t.sum?t.sum:c[d];g=a(g/i);break;default:g=f(o.showValueFormat())(g)}}const v=t.valuePos(x),w=t.valuePos(s.value instanceof Array?s.value[0]:0),S=Math.min(w,v),A=Math.abs(v-w),k=o.innerTextFontSize(),M=o.innerTextPadding_exists()?o.innerTextPadding():k/2.5,P=o.intersectRectRect({x:n?_:S,y:n?S:_,width:n?b:A,height:n?A:b},{x:0,y:0,width:m.width,height:m.height}),T=y.select("rect").transition().duration(i).style("fill",t=>o.fillColor(t.row,t.column,t.value,t.origRow));n?T.attr("x",_).attr("y",S).attr("width",b).attr("height",A):T.attr("y",_).attr("x",S).attr("height",b).attr("width",A);const C=y.select("text").transition().duration(i).style("font-size",k+"px").style("fill",t=>o.textColor(t.row,t.column,t.value,t.origRow));C.style("font-family",o.innerTextFontFamily_exists()?o.innerTextFontFamily():null);const F=o.innerTextPadding_exists()?o.innerTextPadding():8,I=k/2.7;if(n){const t=P.y+P.height-M;C.attr("x",_+b/2).attr("y",t+I).attr("transform",`rotate(-90, ${_+b/2}, ${t})`)}else C.attr("x",P.x+F).attr("y",_+b/2+I);C.attr("height",b).attr("width",A),o.showInnerText()&&C.text(t=>{const e=o.innerText(t.origRow,t.origRow[p],t.idx);if(e){const i=n?P.height:P.width,a=o.calcInnerText(i,e,g);return t.innerTextObj=a,a.text}return""});const E=y.selectAll(".dataText").data(o.showValue()?[`${x}`]:[]);E.enter().append("g").attr("class","dataText").each(function(t){o.textLocal.set(this,(new z).target(this).colorStroke_default("transparent"))}).merge(E).each(function(){const t={x:0,y:0},e=o.valueFontFamily(),i=o.valueFontSize(),a=o.textSize(g,e,i),r=parseFloat(g)>=0;let l=o.valueAnchor()?o.valueAnchor():n?"middle":"start";const h=P.x,c=m.width-(P.x+P.width),u=P.y,p=m.height-(P.y+P.height);let d,f,y;if(s.innerTextObj){const{padding:e,valueTextWidth:o}=s.innerTextObj;f=!1,n?(l="middle",t.x=_+b/2,4===s.innerTextObj.category?(f=!0,t.y=S-e-i/2):t.y=S+e+i/2):(l="start",4===s.innerTextObj.category?(f=!0,t.x=A+S+e):t.x=A+S-o-e,t.y=_+b/2)}else n?(d=P.height<a.height,f=!o.valueCentered()||d,t.x=P.x+P.width/2,f?r?(y=u<a.height+F,y?d?t.y=P.y+P.height+a.height:(f=!1,t.y=P.y+P.height/2):t.y=P.y-a.height/2-F):(y=p<a.height,y?d?t.y=P.y-a.height/2-F:(f=!1,t.y=P.y+P.height/2):t.y=P.y+a.height+F):t.y=P.y+P.height/2):(d=P.width<a.width,f=!o.valueCentered()||d,t.y=P.y+P.height/2,f?r?(y=c<a.width+F,y?o.showInnerText()||!d?(f=!1,t.x=P.x+P.width/2):t.x=P.x-(a.width-F):t.x=P.x+P.width+a.width/2+F):(y=h<a.width,y?o.showInnerText()||!d?(f=!1,t.x=P.x+P.width/2):t.x=P.x+P.width+(a.width-F):t.x=P.x-(a.width-F)):t.x=P.x+P.width/2);const x=f?null:o.textColor(s.row,s.column,s.value,s.origRow),v=o.columns(),w=o.yAxisStacked()&&d||f&&o.yAxisStacked()&&v.indexOf(s.column)!==v.length-1;o.textLocal.get(this).pos(t).anchor(l).fontFamily(e).fontSize(i).text(`${g}`).colorFill(x).visible(o.showValue()&&!w).render()}),E.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),x.exit().transition().duration(i).style("opacity",0).remove();const v=t.yAxisStacked()?c[d]:Math.max(...e.filter((t,e)=>e>0&&e<p)),w=y.selectAll(".stackedTotalText").data(o.showDomainTotal()?[c[d]]:[]);w.enter().append("g").attr("class","stackedTotalText").each(function(t){o.stackedTextLocal.set(this,(new z).target(this).colorStroke_default("transparent"))}).merge(w).each(function(i){const a={x:0,y:0},s=t.dataPos(e[0]),r=t.valuePos(v),l=o.valueFontFamily(),h=o.valueFontSize(),c=o.textSize(i,l,h),u=parseFloat(i)>=0;let p="middle";n?(a.x=s,a.y=u?r-c.height/2:r+c.height/2):(p="start",a.y=s,a.x=u?r+c.width/2:r-c.width/2),o.stackedTextLocal.get(this).pos(a).anchor(p).fontFamily(l).fontSize(h).text(i).render()}),w.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),y.exit().transition().duration(i).remove()}calcInnerText(t,e,i){const n=this.innerTextFontFamily_exists()?this.innerTextFontFamily():"Verdana",o=this.innerTextFontSize(),a=this.valueFontFamily_exists()?this.valueFontFamily():"Verdana",s=this.valueFontSize(),r=this.innerTextPadding_exists()?this.innerTextPadding():o/2.5,l=this.isHorizontal?s:this.textSize(i,a,s).width,h=e,c=3*r+this.textSize("...",n,o).width+l,u=1*r+l;let p=4;if(3*r+this.textSize(e,n,o).width+l<t)p=1;else if(c<t){const i=t-c;let a="";for(const t of e){if(this.textSize(a+t,n,o).width>i){e=a+"...";break}a+=t}p=2}else u<t?(e="",p=3):e="";return{text:e,isTruncated:h!==e,padding:r,category:p,valueTextWidth:l}}innerText(t,e,i){return t[0]}};e(ke,"Column"),i(ke,"__inputs",[{id:"label",type:"string"},{id:"values",type:"number",multi:!0}]);let Me=ke;Me.prototype._class+=" chart_Column",Me.prototype.implements(n.prototype),Me.prototype.implements(o.prototype),Me.prototype.publish("valueFontFamily",null,"string","Font family of value text",null,{optional:!0}),Me.prototype.publish("valueFontSize",12,"number","Height of value text (pixels)"),Me.prototype.publish("innerTextFontFamily",null,"string","Font family of inner text",null,{optional:!0}),Me.prototype.publish("innerTextPadding",8,"number","Offset of inner text (pixels)",null,{optional:!0}),Me.prototype.publish("innerTextFontSize",12,"number","Height of inner text (pixels)"),Me.prototype.publish("paletteID","default","set","Color palette for this widget",()=>Me.prototype._palette.switch(),{tags:["Basic","Shared"]}),Me.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Me.prototype.publish("showValue",!1,"boolean","Show Value in column"),Me.prototype.publish("showInnerText",!1,"boolean","Show Label in column"),Me.prototype.publish("showValueFormat",",","string","D3 Format for Value",null,{disable:/* @__PURE__ */e(t=>!t.showValue()||!!t.showValueAsPercent(),"disable")}),Me.prototype.publish("showValueAsPercent",null,"set","If showValue is true, optionally show value as a percentage by Series or Domain",[null,"series","domain"],{disable:/* @__PURE__ */e(t=>!t.showValue(),"disable"),optional:!0}),Me.prototype.publish("showValueAsPercentFormat",".0%","string","D3 Format for %",null,{disable:/* @__PURE__ */e(t=>!t.showValue()||!t.showValueAsPercent(),"disable")}),Me.prototype.publish("showDomainTotal",!1,"boolean","Show Total Value for Stacked Columns",null),Me.prototype.publish("valueCentered",!1,"boolean","Show Value in center of column"),Me.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),Me.prototype.publish("xAxisSeriesPaddingInner",0,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)"),Me.prototype.publish("tooltipInnerTextEllipsedOnly",!1,"boolean","Show tooltip only when inner text is truncated with an ellipsis");const Pe=class _Bar extends Me{constructor(){super(),this.orientation_default("vertical")}};e(Pe,"Bar");let Te=Pe;function Ce(t){var e=0,i=t.children,n=i&&i.length;if(n)for(;--n>=0;)e+=i[n].value;else e=1;t.value=e}function ze(){return this.eachAfter(Ce)}function Fe(t){var e,i,n,o,a=this,s=[a];do{for(e=s.reverse(),s=[];a=e.pop();)if(t(a),i=a.children)for(n=0,o=i.length;n<o;++n)s.push(i[n])}while(s.length);return this}function Ie(t){for(var e,i,n=this,o=[n];n=o.pop();)if(t(n),e=n.children)for(i=e.length-1;i>=0;--i)o.push(e[i]);return this}function Ee(t){for(var e,i,n,o=this,a=[o],s=[];o=a.pop();)if(s.push(o),e=o.children)for(i=0,n=e.length;i<n;++i)a.push(e[i]);for(;o=s.pop();)t(o);return this}function Re(t){return this.eachAfter(function(e){for(var i=+t(e.data)||0,n=e.children,o=n&&n.length;--o>=0;)i+=n[o].value;e.value=i})}function De(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Oe(t){for(var e=this,i=je(e,t),n=[e];e!==i;)e=e.parent,n.push(e);for(var o=n.length;t!==i;)n.splice(o,0,t),t=t.parent;return n}function je(t,e){if(t===e)return t;var i=t.ancestors(),n=e.ancestors(),o=null;for(t=i.pop(),e=n.pop();t===e;)o=t,t=i.pop(),e=n.pop();return o}function Ne(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Le(){var t=[];return this.each(function(e){t.push(e)}),t}function Be(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function $e(){var t=this,e=[];return t.each(function(i){i!==t&&e.push({source:i.parent,target:i})}),e}function He(t,e){var i,n,o,a,s,r=new Xe(t),l=+t.value&&(r.value=t.value),h=[r];for(null==e&&(e=qe);i=h.pop();)if(l&&(i.value=+i.data.value),(o=e(i.data))&&(s=o.length))for(i.children=new Array(s),a=s-1;a>=0;--a)h.push(n=i.children[a]=new Xe(o[a])),n.parent=i,n.depth=i.depth+1;return r.eachBefore(Ge)}function Ve(){return He(this).eachBefore(We)}function qe(t){return t.children}function We(t){t.data=t.data.data}function Ge(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Xe(t){this.data=t,this.depth=this.height=0,this.parent=null}Te.prototype._class+=" chart_Bar",e(Ce,"count"),e(ze,"node_count"),e(Fe,"node_each"),e(Ie,"node_eachBefore"),e(Ee,"node_eachAfter"),e(Re,"node_sum"),e(De,"node_sort"),e(Oe,"node_path"),e(je,"leastCommonAncestor"),e(Ne,"node_ancestors"),e(Le,"node_descendants"),e(Be,"node_leaves"),e($e,"node_links"),e(He,"hierarchy"),e(Ve,"node_copy"),e(qe,"defaultChildren"),e(We,"copyData"),e(Ge,"computeHeight"),e(Xe,"Node$1"),Xe.prototype=He.prototype={constructor:Xe,count:ze,each:Fe,eachAfter:Ee,eachBefore:Ie,sum:Re,sort:De,path:Oe,ancestors:Ne,descendants:Le,leaves:Be,links:$e,copy:Ve};var Ye=Array.prototype.slice;function Ue(t){for(var e,i,n=t.length;n;)i=Math.random()*n--|0,e=t[n],t[n]=t[i],t[i]=e;return t}function Qe(t){for(var e,i,n=0,o=(t=Ue(Ye.call(t))).length,a=[];n<o;)e=t[n],i&&Ke(i,e)?++n:(i=ei(a=Ze(a,e)),n=0);return i}function Ze(t,e){var i,n;if(ti(e,t))return[e];for(i=0;i<t.length;++i)if(Je(e,t[i])&&ti(ni(t[i],e),t))return[t[i],e];for(i=0;i<t.length-1;++i)for(n=i+1;n<t.length;++n)if(Je(ni(t[i],t[n]),e)&&Je(ni(t[i],e),t[n])&&Je(ni(t[n],e),t[i])&&ti(oi(t[i],t[n],e),t))return[t[i],t[n],e];throw new Error}function Je(t,e){var i=t.r-e.r,n=e.x-t.x,o=e.y-t.y;return i<0||i*i<n*n+o*o}function Ke(t,e){var i=t.r-e.r+1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function ti(t,e){for(var i=0;i<e.length;++i)if(!Ke(t,e[i]))return!1;return!0}function ei(t){switch(t.length){case 1:return ii(t[0]);case 2:return ni(t[0],t[1]);case 3:return oi(t[0],t[1],t[2])}}function ii(t){return{x:t.x,y:t.y,r:t.r}}function ni(t,e){var i=t.x,n=t.y,o=t.r,a=e.x,s=e.y,r=e.r,l=a-i,h=s-n,c=r-o,u=Math.sqrt(l*l+h*h);return{x:(i+a+l/u*c)/2,y:(n+s+h/u*c)/2,r:(u+o+r)/2}}function oi(t,e,i){var n=t.x,o=t.y,a=t.r,s=e.x,r=e.y,l=e.r,h=i.x,c=i.y,u=i.r,p=n-s,d=n-h,f=o-r,y=o-c,_=l-a,x=u-a,m=n*n+o*o-a*a,g=m-s*s-r*r+l*l,b=m-h*h-c*c+u*u,v=d*f-p*y,w=(f*b-y*g)/(2*v)-n,S=(y*_-f*x)/v,A=(d*g-p*b)/(2*v)-o,k=(p*x-d*_)/v,M=S*S+k*k-1,P=2*(a+w*S+A*k),T=w*w+A*A-a*a,C=-(M?(P+Math.sqrt(P*P-4*M*T))/(2*M):T/P);return{x:n+w+S*C,y:o+A+k*C,r:C}}function ai(t,e,i){var n,o,a,s,r=t.x-e.x,l=t.y-e.y,h=r*r+l*l;h?(o=e.r+i.r,o*=o,s=t.r+i.r,o>(s*=s)?(n=(h+s-o)/(2*h),a=Math.sqrt(Math.max(0,s/h-n*n)),i.x=t.x-n*r-a*l,i.y=t.y-n*l+a*r):(n=(h+o-s)/(2*h),a=Math.sqrt(Math.max(0,o/h-n*n)),i.x=e.x+n*r-a*l,i.y=e.y+n*l+a*r)):(i.x=e.x+i.r,i.y=e.y)}function si(t,e){var i=t.r+e.r-1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function ri(t){var e=t._,i=t.next._,n=e.r+i.r,o=(e.x*i.r+i.x*e.r)/n,a=(e.y*i.r+i.y*e.r)/n;return o*o+a*a}function li(t){this._=t,this.next=null,this.previous=null}function hi(t){if(!(o=t.length))return 0;var e,i,n,o,a,s,r,l,h,c,u;if((e=t[0]).x=0,e.y=0,!(o>1))return e.r;if(i=t[1],e.x=-i.r,i.x=e.r,i.y=0,!(o>2))return e.r+i.r;ai(i,e,n=t[2]),e=new li(e),i=new li(i),n=new li(n),e.next=n.previous=i,i.next=e.previous=n,n.next=i.previous=e;t:for(r=3;r<o;++r){ai(e._,i._,n=t[r]),n=new li(n),l=i.next,h=e.previous,c=i._.r,u=e._.r;do{if(c<=u){if(si(l._,n._)){i=l,e.next=i,i.previous=e,--r;continue t}c+=l._.r,l=l.next}else{if(si(h._,n._)){(e=h).next=i,i.previous=e,--r;continue t}u+=h._.r,h=h.previous}}while(l!==h.next);for(n.previous=e,n.next=i,e.next=i.previous=i=n,a=ri(e);(n=n.next)!==i;)(s=ri(n))<a&&(e=n,a=s);i=e.next}for(e=[i._],n=i;(n=n.next)!==i;)e.push(n._);for(n=Qe(e),r=0;r<o;++r)(e=t[r]).x-=n.x,e.y-=n.y;return n.r}function ci(t){return null==t?null:ui(t)}function ui(t){if("function"!=typeof t)throw new Error;return t}function pi(){return 0}function di(t){return function(){return t}}function fi(t){return Math.sqrt(t.value)}function yi(){var t=null,i=1,n=1,o=pi;function a(e){return e.x=i/2,e.y=n/2,t?e.eachBefore(_i(t)).eachAfter(xi(o,.5)).eachBefore(mi(1)):e.eachBefore(_i(fi)).eachAfter(xi(pi,1)).eachAfter(xi(o,e.r/Math.min(i,n))).eachBefore(mi(Math.min(i,n)/(2*e.r))),e}return e(a,"pack"),a.radius=function(e){return arguments.length?(t=ci(e),a):t},a.size=function(t){return arguments.length?(i=+t[0],n=+t[1],a):[i,n]},a.padding=function(t){return arguments.length?(o="function"==typeof t?t:di(+t),a):o},a}function _i(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function xi(t,e){return function(i){if(n=i.children){var n,o,a,s=n.length,r=t(i)*e||0;if(r)for(o=0;o<s;++o)n[o].r+=r;if(a=hi(n),r)for(o=0;o<s;++o)n[o].r-=r;i.r=a+r}}}function mi(t){return function(e){var i=e.parent;e.r*=t,i&&(e.x=i.x+t*e.x,e.y=i.y+t*e.y)}}e(Ue,"shuffle"),e(Qe,"enclose"),e(Ze,"extendBasis"),e(Je,"enclosesNot"),e(Ke,"enclosesWeak"),e(ti,"enclosesWeakAll"),e(ei,"encloseBasis"),e(ii,"encloseBasis1"),e(ni,"encloseBasis2"),e(oi,"encloseBasis3"),e(ai,"place"),e(si,"intersects"),e(ri,"score"),e(li,"Node"),e(hi,"packEnclose"),e(ci,"optional"),e(ui,"required"),e(pi,"constantZero"),e(di,"constant$2"),e(fi,"defaultRadius"),e(yi,"d3Pack"),e(_i,"radiusLeaf"),e(xi,"packChildren"),e(mi,"translateChild");const gi=class _Bubble extends l{labelWidgets;d3Pack;constructor(){super(),a.call(this),o.call(this),m.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.labelWidgets={},this.d3Pack=yi().size([this.width(),this.height()]).padding(1.5)}size(t){const e=super.size.apply(this,arguments);return arguments.length&&this.d3Pack.size([this.width(),this.height()]),e}enter(t,e){super.enter(t,e),this._selection.widgetElement(e);const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t[0]),value:t[1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,e){super.update(t,e);const i=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const n=He({children:this.cloneData()}).sum(function(t){return t[1]}).sort(function(t,e){return e[1]<t[1]?-1:e[1]>t[1]?1:0});this.d3Pack(n);const o=e.selectAll(".node").data(n.children||[],t=>t.data[0]);o.enter().append("g").attr("class",(t,e)=>"node series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).each(function(t){const e=h(this),n=t.x,o=t.y;e.append("circle").attr("transform","translate("+n+","+o+")").attr("r",0).on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show),t.__viz_faChar?i.labelWidgets[t.data[0]]=(new F).char(t.__viz_faChar).target(this).render():i.labelWidgets[t.data[0]]=(new z).text(t.data[0]).target(this).render()}).merge(o).transition().attr("opacity",1).each(function(t){const e=h(this),n={x:t.x,y:t.y};e.select("circle").transition().attr("transform","translate("+n.x+","+n.y+")").style("fill",i.fillColor(t.data,i.columns()[1],t.data[1])).attr("r",t.r).select("title").text(t.data[0]+" ("+t.data[1]+")"),t.__viz_faChar?i.labelWidgets[t.data[0]].pos(n).render():i.labelWidgets[t.data[0]].pos(n).colorFill_default(i.textColor(t.data,i.columns()[1],t.data[1])).width(2*t.r).text(t.data[0]).render()}),o.exit().transition().style("opacity",0).remove()}exit(t,e){super.exit(t,e)}};e(gi,"Bubble"),i(gi,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let bi=gi;bi.prototype._class+=" chart_Bubble",bi.prototype.implements(a.prototype),bi.prototype.implements(o.prototype),bi.prototype.mixin(m.SimpleSelectionMixin),bi.prototype.publish("paletteID","default","set","Color palette for this widget",bi.prototype._palette.switch(),{tags:["Basic","Shared"]}),bi.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});const vi=class _BubbleXY extends we{constructor(){super()}enter(t,e){this.pointSizeColumn_exists()||this.pointSizeColumn(this.columns()[this.columns().length-1]),super.enter(t,e)}};e(vi,"BubbleXY");let wi=vi;wi.prototype._class+=" chart_BubbleXY";var Si,Ai,ki=0,Mi=0,Pi=0,Ti=0,Ci=0,zi=0,Fi="object"==typeof performance&&performance.now?performance:Date,Ii="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ei(){return Ci||(Ii(Ri),Ci=Fi.now()+zi)}function Ri(){Ci=0}function Di(){this._call=this._time=this._next=null}function Oi(){Ei(),++ki;for(var t,e=Si;e;)(t=Ci-e._time)>=0&&e._call.call(null,t),e=e._next;--ki}function ji(){Ci=(Ti=Fi.now())+zi,ki=Mi=0;try{Oi()}finally{ki=0,Li(),Ci=0}}function Ni(){var t=Fi.now(),e=t-Ti;e>1e3&&(zi-=e,Ti=t)}function Li(){for(var t,e,i=Si,n=1/0;i;)i._call?(n>i._time&&(n=i._time),t=i,i=i._next):(e=i._next,i._next=null,i=t?t._next=e:Si=e);Ai=t,Bi(n)}function Bi(t){ki||(Mi&&(Mi=clearTimeout(Mi)),t-Ci>24?(t<1/0&&(Mi=setTimeout(ji,t-Fi.now()-zi)),Pi&&(Pi=clearInterval(Pi))):(Pi||(Ti=Fi.now(),Pi=setInterval(Ni,1e3)),ki=1,Ii(ji)))}function $i(){var t="left",i=!1,n=!1,o=Hi,a=Vi,s=qi,r=380,l=30,c=_e();function u(t){t.each(function(t,e){var u,p,d=o.call(this,t,e).slice().sort(I),f=a.call(this,t,e).slice().sort(I),y=s.call(this,t,e).slice().sort(I),x=h(this),m=x.select("g.wrap");m.empty()&&(m=x.append("g").attr("class","wrap")),n?(u=l,p=r,m.attr("transform","rotate(90)translate(0,"+-r+")")):(u=r,p=l,m.attr("transform",null));var g=_().domain([0,Math.max(d[0],f[0],y[0])]).range(i?[u,0]:[0,u]),b=this.__chart__||_().domain([0,1/0]).range(g.range());this.__chart__=g;var v=Wi(b),w=Wi(g),S=m.selectAll("rect.range").data(d);S.enter().append("rect").attr("class",function(t,e){return"range s"+e}).attr("width",v).attr("height",p).attr("x",i?b:0).merge(S).transition(S).attr("x",i?g:0).attr("width",w).attr("height",p);var A=m.selectAll("rect.measure").data(y);A.enter().append("rect").attr("class",function(t,e){return"measure s"+e}).attr("width",v).attr("height",p/3).attr("x",i?b:0).attr("y",p/3).merge(A).transition(A).attr("width",w).attr("height",p/3).attr("x",i?g:0).attr("y",p/3);var k=m.selectAll("line.marker").data(f);k.enter().append("line").attr("class","marker").attr("x1",b).attr("x2",b).attr("y1",p/6).attr("y2",5*p/6).merge(k).transition(k).attr("x1",g).attr("x2",g).attr("y1",p/6).attr("y2",5*p/6);var M=x.selectAll("g.axis").data([0]);M.enter().append("g").attr("class","axis"),M.attr("transform",n?null:"translate(0,"+p+")").call(c.scale(g))}),Oi()}return e(u,"bulvar"),u.orient=function(e){return arguments.length?(i="right"===(t=e+"")||"bottom"===t,c.orient((n="top"===t||"bottom"===t)?"left":"bottom"),u):t},u.ranges=function(t){return arguments.length?(o=t,u):o},u.markers=function(t){return arguments.length?(a=t,u):a},u.measures=function(t){return arguments.length?(s=t,u):s},u.width=function(t){return arguments.length?(r=+t,u):r},u.height=function(t){return arguments.length?(l=+t,u):l},u.tickFormat=function(t){return arguments.length?(c.tickFormat(t),u):c.tickFormat()},u}function Hi(t){return t.ranges}function Vi(t){return t.markers}function qi(t){return t.measures}function Wi(t){var e=t(0);return function(i){return Math.abs(t(i)-e)}}e(Ei,"now"),e(Ri,"clearNow"),e(Di,"Timer"),Di.prototype={constructor:Di,restart:/* @__PURE__ */e(function(t,e,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?Ei():+i)+(null==e?0:+e),this._next||Ai===this||(Ai?Ai._next=this:Si=this,Ai=this),this._call=t,this._time=i,Bi()},"restart"),stop:/* @__PURE__ */e(function(){this._call&&(this._call=null,this._time=1/0,Bi())},"stop")},e(Oi,"timerFlush"),e(ji,"wake"),e(Ni,"poke"),e(Li,"nap"),e(Bi,"sleep"),e($i,"d3Bullet"),e(Hi,"bulvarRanges"),e(Vi,"bulvarMarkers"),e(qi,"bulvarMeasures"),e(Wi,"bulvarWidth");const Gi=class _Bullet extends E{_hiddenColumns={};constructor(){super(),m.SimpleSelectionMixin.call(this,!0)}bulletData(){const t=this;this._hiddenColumns={};const e=this.columns();return this.data().map(function(t){return{title:i(t,this.titleColumn()),subtitle:i(t,this.subtitleColumn()),ranges:i(t,this.rangesColumn(),"range"),measures:i(t,this.measuresColumn(),"measure"),markers:i(t,this.markersColumn(),"marker"),origRow:t}},this);function i(i,n,o){const a=e.indexOf(n);return a>=0?i[a]instanceof Array?i[a]:[i[a]]:(o&&(t._hiddenColumns[o]=!0),[0])}}enter(t,e){super.enter(t,e),h(t.parentNode).style("overflow","auto"),this._selection.widgetElement(e)}update(t,e){super.update(t,e);const i=this;e.selectAll(".axis").style("display","none"),e.selectAll(".range,.measure,.marker").style("display",null);const n=2,o=8,a=2,s=8,r=this.width()-n-a,l=40-o-s,c=e.selectAll("svg").data(this.bulletData()),u=c.enter().append("svg").attr("class","bullet").call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.origRow),i.titleColumn(),i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.origRow),i.titleColumn(),i._selection.selected(this))}).each(function(){const t=h(this).append("g").attr("class",(t,e)=>"bulletBar series series-"+i.cssTag(i.titleColumn())).append("g").attr("class","bulletTitle");t.append("text").attr("class","title"),t.append("text").attr("class","subtitle").attr("dy","1em")}).merge(c),p=u.select(".bulletTitle").style("text-anchor","end").attr("transform","translate(-6,"+l/2+")");p.select(".title").text(function(t){return t.title}),p.select(".subtitle").text(function(t){return t.subtitle});let d=0;p.each(function(){const t=this.getBBox();t.width>d&&(d=t.width)});const f=$i().width(r-d-6).height(l);u.attr("width",r).attr("height",l+o+s).style("margin-left",`${n}px`),u.select(".bulletBar").attr("transform","translate("+(d+6)+","+o+")").call(f),c.exit().remove(),Object.keys(this._hiddenColumns).length>0&&e.selectAll(`.${Object.keys(this._hiddenColumns).join(",.")}`).style("display","none")}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}_selection};e(Gi,"Bullet");let Xi=Gi;Xi.prototype._class+=" chart_Bullet",Xi.prototype.publish("titleColumn",null,"set","Title Column",function(){return this.columns()},{optional:!0}),Xi.prototype.publish("subtitleColumn",null,"set","Subtitle Column",function(){return this.columns()},{optional:!0}),Xi.prototype.publish("rangesColumn",null,"set","Ranges Column",function(){return this.columns()},{optional:!0}),Xi.prototype.publish("measuresColumn",null,"set","Measures Column",function(){return this.columns()},{optional:!0}),Xi.prototype.publish("markersColumn",null,"set","Markers Column",function(){return this.columns()},{optional:!0});var Yi=Array.prototype.slice;function Ui(t,e){return t-e}function Qi(t){for(var e=0,i=t.length,n=t[i-1][1]*t[0][0]-t[i-1][0]*t[0][1];++e<i;)n+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return n}function Zi(t){return function(){return t}}function Ji(t,e){for(var i,n=-1,o=e.length;++n<o;)if(i=Ki(t,e[n]))return i;return 0}function Ki(t,e){for(var i=e[0],n=e[1],o=-1,a=0,s=t.length,r=s-1;a<s;r=a++){var l=t[a],h=l[0],c=l[1],u=t[r],p=u[0],d=u[1];if(tn(l,u,e))return 0;c>n!=d>n&&i<(p-h)*(n-c)/(d-c)+h&&(o=-o)}return o}function tn(t,e,i){var n;return en(t,e,i)&&nn(t[n=+(t[0]===e[0])],i[n],e[n])}function en(t,e,i){return(e[0]-t[0])*(i[1]-t[1])===(i[0]-t[0])*(e[1]-t[1])}function nn(t,e,i){return t<=e&&e<=i||i<=e&&e<=t}function on(){}e(Ui,"ascending"),e(Qi,"area"),e(Zi,"constant$1"),e(Ji,"contains"),e(Ki,"ringContains"),e(tn,"segmentContains"),e(en,"collinear"),e(nn,"within"),e(on,"noop$2");var an=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function sn(){var t=1,i=1,n=R,o=h;function a(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Ui);else{var i=T(t),o=i[0],a=i[1];e=D(o,a,e),e=O(Math.floor(o/e)*e,Math.floor(a/e)*e,e)}return e.map(function(e){return s(t,e)})}function s(t,e){var i=[],n=[];return r(t,e,function(a){o(a,t,e),Qi(a)>0?i.push([a]):n.push(a)}),n.forEach(function(t){for(var e,n=0,o=i.length;n<o;++n)if(-1!==Ji((e=i[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:e,coordinates:i}}function r(n,o,a){var s,r,h,c,u,p,d=new Array,f=new Array;for(s=r=-1,c=n[0]>=o,an[c<<1].forEach(y);++s<t-1;)h=c,c=n[s+1]>=o,an[h|c<<1].forEach(y);for(an[c|0].forEach(y);++r<i-1;){for(s=-1,c=n[r*t+t]>=o,u=n[r*t]>=o,an[c<<1|u<<2].forEach(y);++s<t-1;)h=c,c=n[r*t+t+s+1]>=o,p=u,u=n[r*t+s+1]>=o,an[h|c<<1|u<<2|p<<3].forEach(y);an[c|u<<3].forEach(y)}for(s=-1,u=n[r*t]>=o,an[u<<2].forEach(y);++s<t-1;)p=u,u=n[r*t+s+1]>=o,an[u<<2|p<<3].forEach(y);function y(t){var e,i,n=[t[0][0]+s,t[0][1]+r],o=[t[1][0]+s,t[1][1]+r],h=l(n),c=l(o);(e=f[h])?(i=d[c])?(delete f[e.end],delete d[i.start],e===i?(e.ring.push(o),a(e.ring)):d[e.start]=f[i.end]={start:e.start,end:i.end,ring:e.ring.concat(i.ring)}):(delete f[e.end],e.ring.push(o),f[e.end=c]=e):(e=d[c])?(i=f[h])?(delete d[e.start],delete f[i.end],e===i?(e.ring.push(o),a(e.ring)):d[i.start]=f[e.end]={start:i.start,end:e.end,ring:i.ring.concat(e.ring)}):(delete d[e.start],e.ring.unshift(n),d[e.start=h]=e):d[h]=f[c]={start:h,end:c,ring:[n,o]}}an[u<<3].forEach(y),e(y,"stitch")}function l(e){return 2*e[0]+e[1]*(t+1)*4}function h(e,n,o){e.forEach(function(e){var a,s=e[0],r=e[1],l=0|s,h=0|r,c=n[h*t+l];s>0&&s<t&&l===s&&(a=n[h*t+l-1],e[0]=s+(o-a)/(c-a)-.5),r>0&&r<i&&h===r&&(a=n[(h-1)*t+l],e[1]=r+(o-a)/(c-a)-.5)})}return e(a,"contours"),e(s,"contour"),e(r,"isorings"),e(l,"index"),e(h,"smoothLinear"),a.contour=s,a.size=function(e){if(!arguments.length)return[t,i];var n=Math.ceil(e[0]),o=Math.ceil(e[1]);if(!(n>0&&o>0))throw new Error("invalid size");return t=n,i=o,a},a.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?Zi(Yi.call(t)):Zi(t),a):n},a.smooth=function(t){return arguments.length?(o=t?h:on,a):o===h},a}function rn(t,e,i){for(var n=t.width,o=t.height,a=1+(i<<1),s=0;s<o;++s)for(var r=0,l=0;r<n+i;++r)r<n&&(l+=t.data[r+s*n]),r>=i&&(r>=a&&(l-=t.data[r-a+s*n]),e.data[r-i+s*n]=l/Math.min(r+1,n-1+a-r,a))}function ln(t,e,i){for(var n=t.width,o=t.height,a=1+(i<<1),s=0;s<n;++s)for(var r=0,l=0;r<o+i;++r)r<o&&(l+=t.data[s+r*n]),r>=i&&(r>=a&&(l-=t.data[s+(r-a)*n]),e.data[s+(r-i)*n]=l/Math.min(r+1,o-1+a-r,a))}function hn(t){return t[0]}function cn(t){return t[1]}function un(){return 1}function pn(){var t=hn,i=cn,n=un,o=960,a=500,s=20,r=2,l=3*s,h=o+2*l>>r,c=a+2*l>>r,u=Zi(20);function p(e){var o=new Float32Array(h*c),a=new Float32Array(h*c);e.forEach(function(e,a,s){var u=+t(e,a,s)+l>>r,p=+i(e,a,s)+l>>r,d=+n(e,a,s);u>=0&&u<h&&p>=0&&p<c&&(o[u+p*h]+=d)}),rn({width:h,height:c,data:o},{data:a},s>>r),ln({width:h,height:c,data:a},{data:o},s>>r),rn({width:h,height:c,data:o},{data:a},s>>r),ln({width:h,height:c,data:a},{data:o},s>>r),rn({width:h,height:c,data:o},{data:a},s>>r),ln({width:h,height:c,data:a},{data:o},s>>r);var p=u(o);if(!Array.isArray(p)){var f=M(o);p=D(0,f,p),(p=O(0,Math.floor(f/p)*p,p)).shift()}return sn().thresholds(p).size([h,c])(o).map(d)}function d(t){return t.value*=Math.pow(2,-2*r),t.coordinates.forEach(f),t}function f(t){t.forEach(y)}function y(t){t.forEach(_)}function _(t){t[0]=t[0]*Math.pow(2,r)-l,t[1]=t[1]*Math.pow(2,r)-l}function x(){return h=o+2*(l=3*s)>>r,c=a+2*l>>r,p}return e(p,"density"),e(d,"transform"),e(f,"transformPolygon"),e(y,"transformRing"),e(_,"transformPoint"),e(x,"resize"),p.x=function(e){return arguments.length?(t="function"==typeof e?e:Zi(+e),p):t},p.y=function(t){return arguments.length?(i="function"==typeof t?t:Zi(+t),p):i},p.weight=function(t){return arguments.length?(n="function"==typeof t?t:Zi(+t),p):n},p.size=function(t){if(!arguments.length)return[o,a];var e=Math.ceil(t[0]),i=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return o=e,a=i,x()},p.cellSize=function(t){if(!arguments.length)return 1<<r;if(!((t=+t)>=1))throw new Error("invalid cell size");return r=Math.floor(Math.log(t)/Math.LN2),x()},p.thresholds=function(t){return arguments.length?(u="function"==typeof t?t:Array.isArray(t)?Zi(Yi.call(t)):Zi(t),p):u},p.bandwidth=function(t){if(!arguments.length)return Math.sqrt(s*(s+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return s=Math.round((Math.sqrt(4*t*t+1)-1)/2),x()},p}function dn(){return new fn}function fn(){this.reset()}e(sn,"contours"),e(rn,"blurX"),e(ln,"blurY"),e(hn,"defaultX"),e(cn,"defaultY"),e(un,"defaultWeight"),e(pn,"d3ContourDensity"),e(dn,"adder"),e(fn,"Adder"),fn.prototype={constructor:fn,reset:/* @__PURE__ */e(function(){this.s=this.t=0},"reset"),add:/* @__PURE__ */e(function(t){_n(yn,t,this.t),_n(this,yn.s,this.s),this.s?this.t+=yn.t:this.s=yn.t},"add"),valueOf:/* @__PURE__ */e(function(){return this.s},"valueOf")};var yn=new fn;function _n(t,e,i){var n=t.s=e+i,o=n-e,a=n-o;t.t=e-a+(i-o)}e(_n,"add");var xn=2*Math.PI,mn=Math.abs,gn=Math.sqrt;function bn(){}function vn(t,e){t&&Sn.hasOwnProperty(t.type)&&Sn[t.type](t,e)}e(bn,"noop$1"),e(vn,"streamGeometry");var wn={Feature:/* @__PURE__ */e(function(t,e){vn(t.geometry,e)},"Feature"),FeatureCollection:/* @__PURE__ */e(function(t,e){for(var i=t.features,n=-1,o=i.length;++n<o;)vn(i[n].geometry,e)},"FeatureCollection")},Sn={Sphere:/* @__PURE__ */e(function(t,e){e.sphere()},"Sphere"),Point:/* @__PURE__ */e(function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},"Point"),MultiPoint:/* @__PURE__ */e(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)t=i[n],e.point(t[0],t[1],t[2])},"MultiPoint"),LineString:/* @__PURE__ */e(function(t,e){An(t.coordinates,e,0)},"LineString"),MultiLineString:/* @__PURE__ */e(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)An(i[n],e,0)},"MultiLineString"),Polygon:/* @__PURE__ */e(function(t,e){kn(t.coordinates,e)},"Polygon"),MultiPolygon:/* @__PURE__ */e(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)kn(i[n],e)},"MultiPolygon"),GeometryCollection:/* @__PURE__ */e(function(t,e){for(var i=t.geometries,n=-1,o=i.length;++n<o;)vn(i[n],e)},"GeometryCollection")};function An(t,e,i){var n,o=-1,a=t.length-i;for(e.lineStart();++o<a;)n=t[o],e.point(n[0],n[1],n[2]);e.lineEnd()}function kn(t,e){var i=-1,n=t.length;for(e.polygonStart();++i<n;)An(t[i],e,1);e.polygonEnd()}function Mn(t,e){t&&wn.hasOwnProperty(t.type)?wn[t.type](t,e):vn(t,e)}function Pn(t){return t}e(An,"streamLine"),e(kn,"streamPolygon"),e(Mn,"geoStream"),e(Pn,"identity");var Tn,Cn,zn,Fn,In=dn(),En=dn(),Rn={point:bn,lineStart:bn,lineEnd:bn,polygonStart:/* @__PURE__ */e(function(){Rn.lineStart=Dn,Rn.lineEnd=Nn},"polygonStart"),polygonEnd:/* @__PURE__ */e(function(){Rn.lineStart=Rn.lineEnd=Rn.point=bn,In.add(mn(En)),En.reset()},"polygonEnd"),result:/* @__PURE__ */e(function(){var t=In/2;return In.reset(),t},"result")};function Dn(){Rn.point=On}function On(t,e){Rn.point=jn,Tn=zn=t,Cn=Fn=e}function jn(t,e){En.add(Fn*t-zn*e),zn=t,Fn=e}function Nn(){jn(Tn,Cn)}e(Dn,"areaRingStart"),e(On,"areaPointFirst"),e(jn,"areaPoint"),e(Nn,"areaRingEnd");var Ln=1/0,Bn=Ln,$n=-Ln,Hn=$n,Vn={point:qn,lineStart:bn,lineEnd:bn,polygonStart:bn,polygonEnd:bn,result:/* @__PURE__ */e(function(){var t=[[Ln,Bn],[$n,Hn]];return $n=Hn=-(Bn=Ln=1/0),t},"result")};function qn(t,e){t<Ln&&(Ln=t),t>$n&&($n=t),e<Bn&&(Bn=e),e>Hn&&(Hn=e)}e(qn,"boundsPoint");var Wn,Gn,Xn,Yn,Un=0,Qn=0,Zn=0,Jn=0,Kn=0,to=0,eo=0,io=0,no=0,oo={point:ao,lineStart:so,lineEnd:ho,polygonStart:/* @__PURE__ */e(function(){oo.lineStart=co,oo.lineEnd=uo},"polygonStart"),polygonEnd:/* @__PURE__ */e(function(){oo.point=ao,oo.lineStart=so,oo.lineEnd=ho},"polygonEnd"),result:/* @__PURE__ */e(function(){var t=no?[eo/no,io/no]:to?[Jn/to,Kn/to]:Zn?[Un/Zn,Qn/Zn]:[NaN,NaN];return Un=Qn=Zn=Jn=Kn=to=eo=io=no=0,t},"result")};function ao(t,e){Un+=t,Qn+=e,++Zn}function so(){oo.point=ro}function ro(t,e){oo.point=lo,ao(Xn=t,Yn=e)}function lo(t,e){var i=t-Xn,n=e-Yn,o=gn(i*i+n*n);Jn+=o*(Xn+t)/2,Kn+=o*(Yn+e)/2,to+=o,ao(Xn=t,Yn=e)}function ho(){oo.point=ao}function co(){oo.point=po}function uo(){fo(Wn,Gn)}function po(t,e){oo.point=fo,ao(Wn=Xn=t,Gn=Yn=e)}function fo(t,e){var i=t-Xn,n=e-Yn,o=gn(i*i+n*n);Jn+=o*(Xn+t)/2,Kn+=o*(Yn+e)/2,to+=o,eo+=(o=Yn*t-Xn*e)*(Xn+t),io+=o*(Yn+e),no+=3*o,ao(Xn=t,Yn=e)}function yo(t){this._context=t}e(ao,"centroidPoint"),e(so,"centroidLineStart"),e(ro,"centroidPointFirstLine"),e(lo,"centroidPointLine"),e(ho,"centroidLineEnd"),e(co,"centroidRingStart"),e(uo,"centroidRingEnd"),e(po,"centroidPointFirstRing"),e(fo,"centroidPointRing"),e(yo,"PathContext"),yo.prototype={_radius:4.5,pointRadius:/* @__PURE__ */e(function(t){return this._radius=t,this},"pointRadius"),polygonStart:/* @__PURE__ */e(function(){this._line=0},"polygonStart"),polygonEnd:/* @__PURE__ */e(function(){this._line=NaN},"polygonEnd"),lineStart:/* @__PURE__ */e(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){0===this._line&&this._context.closePath(),this._point=NaN},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,xn)}},"point"),result:bn};var _o,xo,mo,go,bo,vo=dn(),wo={point:bn,lineStart:/* @__PURE__ */e(function(){wo.point=So},"lineStart"),lineEnd:/* @__PURE__ */e(function(){_o&&Ao(xo,mo),wo.point=bn},"lineEnd"),polygonStart:/* @__PURE__ */e(function(){_o=!0},"polygonStart"),polygonEnd:/* @__PURE__ */e(function(){_o=null},"polygonEnd"),result:/* @__PURE__ */e(function(){var t=+vo;return vo.reset(),t},"result")};function So(t,e){wo.point=Ao,xo=go=t,mo=bo=e}function Ao(t,e){go-=t,bo-=e,vo.add(gn(go*go+bo*bo)),go=t,bo=e}function ko(){this._string=[]}function Mo(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Po(t,i){var n,o,a=4.5;function s(t){return t&&("function"==typeof a&&o.pointRadius(+a.apply(this,arguments)),Mn(t,n(o))),o.result()}return e(s,"path"),s.area=function(t){return Mn(t,n(Rn)),Rn.result()},s.measure=function(t){return Mn(t,n(wo)),wo.result()},s.bounds=function(t){return Mn(t,n(Vn)),Vn.result()},s.centroid=function(t){return Mn(t,n(oo)),oo.result()},s.projection=function(e){return arguments.length?(n=null==e?(t=null,Pn):(t=e).stream,s):t},s.context=function(t){return arguments.length?(o=null==t?(i=null,new ko):new yo(i=t),"function"!=typeof a&&o.pointRadius(a),s):i},s.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(o.pointRadius(+t),+t),s):a},s.projection(t).context(i)}e(So,"lengthPointFirst"),e(Ao,"lengthPoint"),e(ko,"PathString"),ko.prototype={_radius:4.5,_circle:Mo(4.5),pointRadius:/* @__PURE__ */e(function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},"pointRadius"),polygonStart:/* @__PURE__ */e(function(){this._line=0},"polygonStart"),polygonEnd:/* @__PURE__ */e(function(){this._line=NaN},"polygonEnd"),lineStart:/* @__PURE__ */e(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){0===this._line&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Mo(this._radius)),this._string.push("M",t,",",e,this._circle)}},"point"),result:/* @__PURE__ */e(function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null},"result")},e(Mo,"circle"),e(Po,"geoPath");const To=class _Contour extends be{_dataMinWeight;_dataMaxWeight;constructor(){super(),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerEnter(t,e,i=250){super.layerEnter(t,e,i)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i),this._palette=this._palette.switch(this.paletteID());const n=this.flattenData(this.layerColumns(t),this.layerData(t)),o=pn().x(e=>this.xPos(t,e)).y(e=>this.yPos(t,e)).size([this.width(),this.height()]).bandwidth(this.contourBandwidth())(n),a=o.map(t=>t.value),s=Math.min.apply(this,a),r=Math.max.apply(this,a);this._dataMinWeight=s,this._dataMaxWeight=r;const l=e.selectAll("path").data(o);l.enter().append("path").merge(l).attr("d",Po()).attr("fill",t=>this.showContourFill()?this._palette(t.value,s,r):"none").attr("stroke",this.contourStrokeColor()).attr("stroke-linejoin","round").attr("stroke-width",this.contourStrokeWidth()),l.exit().remove()}exit(t,e){super.exit(t,e)}};e(To,"Contour"),i(To,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let Co=To;Co.prototype._class+=" chart_Contour",Co.prototype.implements(s.prototype),Co.prototype.publish("paletteID","YlGnBu","string","Color palette for this widget"),Co.prototype.publish("useClonedPalette",!0,"boolean","Enable or disable using a cloned palette"),Co.prototype.publish("showContourFill",!0,"boolean","Show/hide the contour background colors"),Co.prototype.publish("showContour",!0,"boolean","Show/hide the contour border lines"),Co.prototype.publish("contourBandwidth",40,"number","Controls the sensitivity of the contour grouping algorithm"),Co.prototype.publish("contourStrokeColor","#2C3A47","html-color","Color of the contour border lines"),Co.prototype.publish("contourStrokeWidth",1,"number","Width of the contour border lines");const zo=class _Gantt extends Te{constructor(){super(),this.orientation_default("vertical").xAxisType_default("ordinal").yAxisType_default("time")}};e(zo,"Gantt");let Fo=zo;function Io(t){/* @__PURE__ */
3
+ return e(function(){return t},"constant")}Fo.prototype._class+=" chart_Gantt",e(Io,"constant");var Eo=1e-12,Ro=Math.PI,Do=Ro/2,Oo=2*Ro;function jo(t){return t.innerRadius}function No(t){return t.outerRadius}function Lo(t){return t.startAngle}function Bo(t){return t.endAngle}function $o(t){return t&&t.padAngle}function Ho(t){return t>=1?Do:t<=-1?-Do:Math.asin(t)}function Vo(t,e,i,n,o,a,s,r){var l=i-t,h=n-e,c=s-o,u=r-a,p=(c*(e-a)-u*(t-o))/(u*l-c*h);return[t+p*l,e+p*h]}function qo(t,e,i,n,o,a,s){var r=t-i,l=e-n,h=(s?a:-a)/Math.sqrt(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-a,w=p*y-f*d,S=(g<0?-1:1)*Math.sqrt(Math.max(0,v*v*b-w*w)),A=(w*g-m*S)/b,k=(-w*m-g*S)/b,M=(w*g+m*S)/b,P=(-w*m+g*S)/b,T=A-_,C=k-x,z=M-_,F=P-x;return T*T+C*C>z*z+F*F&&(A=M,k=P),{cx:A,cy:k,x01:-c,y01:-u,x11:A*(o/v-1),y11:k*(o/v-1)}}function Wo(){var t=jo,i=No,n=Io(0),o=null,a=Lo,s=Bo,r=$o,l=null;function h(){var e,h,c=+t.apply(this,arguments),u=+i.apply(this,arguments),p=a.apply(this,arguments)-Do,d=s.apply(this,arguments)-Do,f=Math.abs(d-p),y=d>p;if(l||(l=e=it()),u<c&&(h=u,u=c,c=h),u>Eo)if(f>Oo-Eo)l.moveTo(u*Math.cos(p),u*Math.sin(p)),l.arc(0,0,u,p,d,!y),c>Eo&&(l.moveTo(c*Math.cos(d),c*Math.sin(d)),l.arc(0,0,c,d,p,y));else{var _,x,m=p,g=d,b=p,v=d,w=f,S=f,A=r.apply(this,arguments)/2,k=A>Eo&&(o?+o.apply(this,arguments):Math.sqrt(c*c+u*u)),M=Math.min(Math.abs(u-c)/2,+n.apply(this,arguments)),P=M,T=M;if(k>Eo){var C=Ho(k/c*Math.sin(A)),z=Ho(k/u*Math.sin(A));(w-=2*C)>Eo?(b+=C*=y?1:-1,v-=C):(w=0,b=v=(p+d)/2),(S-=2*z)>Eo?(m+=z*=y?1:-1,g-=z):(S=0,m=g=(p+d)/2)}var F=u*Math.cos(m),I=u*Math.sin(m),E=c*Math.cos(v),R=c*Math.sin(v);if(M>Eo){var D=u*Math.cos(g),O=u*Math.sin(g),j=c*Math.cos(b),N=c*Math.sin(b);if(f<Ro){var L=w>Eo?Vo(F,I,j,N,D,O,E,R):[E,R],B=F-L[0],$=I-L[1],H=D-L[0],V=O-L[1],q=1/Math.sin(Math.acos((B*H+$*V)/(Math.sqrt(B*B+$*$)*Math.sqrt(H*H+V*V)))/2),W=Math.sqrt(L[0]*L[0]+L[1]*L[1]);P=Math.min(M,(c-W)/(q-1)),T=Math.min(M,(u-W)/(q+1))}}S>Eo?T>Eo?(_=qo(j,N,F,I,u,T,y),x=qo(D,O,E,R,u,T,y),l.moveTo(_.cx+_.x01,_.cy+_.y01),T<M?l.arc(_.cx,_.cy,T,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(l.arc(_.cx,_.cy,T,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!y),l.arc(0,0,u,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(x.cy+x.y11,x.cx+x.x11),!y),l.arc(x.cx,x.cy,T,Math.atan2(x.y11,x.x11),Math.atan2(x.y01,x.x01),!y))):(l.moveTo(F,I),l.arc(0,0,u,m,g,!y)):l.moveTo(F,I),c>Eo&&w>Eo?P>Eo?(_=qo(E,R,D,O,c,-P,y),x=qo(F,I,j,N,c,-P,y),l.lineTo(_.cx+_.x01,_.cy+_.y01),P<M?l.arc(_.cx,_.cy,P,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(l.arc(_.cx,_.cy,P,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!y),l.arc(0,0,c,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(x.cy+x.y11,x.cx+x.x11),y),l.arc(x.cx,x.cy,P,Math.atan2(x.y11,x.x11),Math.atan2(x.y01,x.x01),!y))):l.arc(0,0,c,v,b,y):l.lineTo(E,R)}else l.moveTo(0,0);if(l.closePath(),e)return l=null,e+""||null}return e(h,"arc"),h.centroid=function(){var e=(+t.apply(this,arguments)+ +i.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +s.apply(this,arguments))/2-Ro/2;return[Math.cos(n)*e,Math.sin(n)*e]},h.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Io(+e),h):t},h.outerRadius=function(t){return arguments.length?(i="function"==typeof t?t:Io(+t),h):i},h.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Io(+t),h):n},h.padRadius=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:Io(+t),h):o},h.startAngle=function(t){return arguments.length?(a="function"==typeof t?t:Io(+t),h):a},h.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:Io(+t),h):s},h.padAngle=function(t){return arguments.length?(r="function"==typeof t?t:Io(+t),h):r},h.context=function(t){return arguments.length?(l=null==t?null:t,h):l},h}function Go(t){this._context=t}function Xo(t){return new Go(t)}function Yo(t){return t[0]}function Uo(t){return t[1]}function Qo(){var t=Yo,i=Uo,n=Io(!0),o=null,a=Xo,s=null;function r(e){var r,l,h,c=e.length,u=!1;for(null==o&&(s=a(h=it())),r=0;r<=c;++r)!(r<c&&n(l=e[r],r,e))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+t(l,r,e),+i(l,r,e));if(h)return s=null,h+""||null}return e(r,"line"),r.x=function(e){return arguments.length?(t="function"==typeof e?e:Io(+e),r):t},r.y=function(t){return arguments.length?(i="function"==typeof t?t:Io(+t),r):i},r.defined=function(t){return arguments.length?(n="function"==typeof t?t:Io(!!t),r):n},r.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),r):a},r.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),r):o},r}function Zo(){}function Jo(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function Ko(t){this._context=t}function ta(t,e){this._basis=new Ko(t),this._beta=e}function ea(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function ia(t,e){this._context=t,this._k=(1-e)/6}function na(t,e){this._context=t,this._k=(1-e)/6}function oa(t,e){this._context=t,this._k=(1-e)/6}function aa(t,e,i){var n=t._x1,o=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Eo){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Eo){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*h+t._x1*t._l23_2a-e*t._l12_2a)/c,s=(s*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,a,s,t._x2,t._y2)}function sa(t,e){this._context=t,this._alpha=e}e(jo,"arcInnerRadius"),e(No,"arcOuterRadius"),e(Lo,"arcStartAngle"),e(Bo,"arcEndAngle"),e($o,"arcPadAngle"),e(Ho,"asin"),e(Vo,"intersect"),e(qo,"cornerTangents"),e(Wo,"arc"),e(Go,"Linear"),Go.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},e(Xo,"curveLinear"),e(Yo,"x"),e(Uo,"y"),e(Qo,"line"),e(Zo,"noop"),e(Jo,"point$3"),e(Ko,"Basis"),Ko.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 3:Jo(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Jo(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},e(ta,"Bundle"),ta.prototype={lineStart:/* @__PURE__ */e(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:/* @__PURE__ */e(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],a=e[0],s=t[i]-o,r=e[i]-a,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*s),this._beta*e[l]+(1-this._beta)*(a+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:/* @__PURE__ */e(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},
4
+ /* @__PURE__ */e(function t(i){function n(t){return 1===i?new Ko(t):new ta(t,i)}return e(n,"bundle"),n.beta=function(e){return t(+e)},n},"custom")(.85),e(ea,"point$2"),e(ia,"Cardinal"),ia.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ea(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ea(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},
5
+ /* @__PURE__ */e(function t(i){function n(t){return new ia(t,i)}return e(n,"cardinal"),n.tension=function(e){return t(+e)},n},"custom")(0),e(na,"CardinalClosed"),na.prototype={areaStart:Zo,areaEnd:Zo,lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ea(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},
6
+ /* @__PURE__ */e(function t(i){function n(t){return new na(t,i)}return e(n,"cardinal"),n.tension=function(e){return t(+e)},n},"custom")(0),e(oa,"CardinalOpen"),oa.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ea(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},
7
+ /* @__PURE__ */e(function t(i){function n(t){return new oa(t,i)}return e(n,"cardinal"),n.tension=function(e){return t(+e)},n},"custom")(0),e(aa,"point$1"),e(sa,"CatmullRom"),sa.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:aa(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const ra=/* @__PURE__ */e(function t(i){function n(t){return i?new sa(t,i):new ia(t,0)}return e(n,"catmullRom"),n.alpha=function(e){return t(+e)},n},"custom")(.5);function la(t,e){this._context=t,this._alpha=e}function ha(t,e){this._context=t,this._alpha=e}function ca(t){return t<0?-1:1}function ua(t,e,i){var n=t._x1-t._x0,o=e-t._x1,a=(t._y1-t._y0)/(n||o<0&&-0),s=(i-t._y1)/(o||n<0&&-0),r=(a*o+s*n)/(n+o);return(ca(a)+ca(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(r))||0}function pa(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function da(t,e,i){var n=t._x0,o=t._y0,a=t._x1,s=t._y1,r=(a-n)/3;t._context.bezierCurveTo(n+r,o+r*e,a-r,s-r*i,a,s)}function fa(t){this._context=t}e(la,"CatmullRomClosed"),la.prototype={areaStart:Zo,areaEnd:Zo,lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:/* @__PURE__ */e(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:aa(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},
8
+ /* @__PURE__ */e(function t(i){function n(t){return i?new la(t,i):new na(t,0)}return e(n,"catmullRom"),n.alpha=function(e){return t(+e)},n},"custom")(.5),e(ha,"CatmullRomOpen"),ha.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:aa(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},
9
+ /* @__PURE__ */e(function t(i){function n(t){return i?new ha(t,i):new oa(t,0)}return e(n,"catmullRom"),n.alpha=function(e){return t(+e)},n},"custom")(.5),e(ca,"sign"),e(ua,"slope3"),e(pa,"slope2"),e(da,"point"),e(fa,"MonotoneX"),fa.prototype={areaStart:/* @__PURE__ */e(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */e(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */e(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */e(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:da(this,this._t0,pa(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */e(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,da(this,pa(this,i=ua(this,t,e)),i);break;default:da(this,this._t0,i=ua(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(fa.prototype).point=function(t,e){fa.prototype.point.call(this,e,t)};var ya="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_a=/* @__PURE__ */e(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},"classCallCheck"),xa=/* @__PURE__ */function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return e(t,"defineProperties"),function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),ma=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},ga=/* @__PURE__ */e(function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var s=o.get;return void 0!==s?s.call(n):void 0},"get"),ba=/* @__PURE__ */e(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},"inherits"),va=/* @__PURE__ */e(function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},"possibleConstructorReturn"),wa=/* @__PURE__ */e(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)},"toConsumableArray"),Sa=function(){function t(e){var i=e.x,n=void 0===i?0:i,o=e.y,a=void 0===o?0:o,s=e.nx,r=e.ny,l=e.dy,h=void 0===l?0:l,c=e.dx,u=void 0===c?0:c,p=e.color,d=void 0===p?"grey":p,f=e.data,y=e.type,_=e.subject,x=e.connector,m=e.note,g=e.disable,b=e.id,v=e.className;_a(this,t),this._dx=void 0!==s?s-n:u,this._dy=void 0!==r?r-a:h,this._x=n,this._y=a,this._color=d,this.id=b,this._className=v||"",this._type=y||"",this.data=f,this.note=m||{},this.connector=x||{},this.subject=_||{},this.disable=g||[]}return e(t,"Annotation"),xa(t,[{key:"updatePosition",value:/* @__PURE__ */e(function(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&0!==this.type.subject.selectAll(":not(.handle)").nodes().length&&this.type.redrawSubject())},"updatePosition")},{key:"clearComponents",value:/* @__PURE__ */e(function(){this.type.clearComponents&&this.type.clearComponents()},"clearComponents")},{key:"updateOffset",value:/* @__PURE__ */e(function(){this.type.setOffset&&(this.type.setOffset(),0!==this.type.connector.selectAll(":not(.handle)").nodes().length&&this.type.redrawConnector(),this.type.redrawNote())},"updateOffset")},{key:"className",get:/* @__PURE__ */e(function(){return this._className},"get$$1"),set:/* @__PURE__ */e(function(t){this._className=t,this.type.setClassName&&this.type.setClassName()},"set$$1")},{key:"type",get:/* @__PURE__ */e(function(){return this._type},"get$$1"),set:/* @__PURE__ */e(function(t){this._type=t,this.clearComponents()},"set$$1")},{key:"x",get:/* @__PURE__ */e(function(){return this._x},"get$$1"),set:/* @__PURE__ */e(function(t){this._x=t,this.updatePosition()},"set$$1")},{key:"y",get:/* @__PURE__ */e(function(){return this._y},"get$$1"),set:/* @__PURE__ */e(function(t){this._y=t,this.updatePosition()},"set$$1")},{key:"color",get:/* @__PURE__ */e(function(){return this._color},"get$$1"),set:/* @__PURE__ */e(function(t){this._color=t,this.updatePosition()},"set$$1")},{key:"dx",get:/* @__PURE__ */e(function(){return this._dx},"get$$1"),set:/* @__PURE__ */e(function(t){this._dx=t,this.updateOffset()},"set$$1")},{key:"dy",get:/* @__PURE__ */e(function(){return this._dy},"get$$1"),set:/* @__PURE__ */e(function(t){this._dy=t,this.updateOffset()},"set$$1")},{key:"nx",set:/* @__PURE__ */e(function(t){this._dx=t-this._x,this.updateOffset()},"set$$1")},{key:"ny",set:/* @__PURE__ */e(function(t){this._dy=t-this._y,this.updateOffset()},"set$$1")},{key:"offset",get:/* @__PURE__ */e(function(){return{x:this._dx,y:this._dy}},"get$$1"),set:/* @__PURE__ */e(function(t){var e=t.x,i=t.y;this._dx=e,this._dy=i,this.updateOffset()},"set$$1")},{key:"position",get:/* @__PURE__ */e(function(){return{x:this._x,y:this._y}},"get$$1"),set:/* @__PURE__ */e(function(t){var e=t.x,i=t.y;this._x=e,this._y=i,this.updatePosition()},"set$$1")},{key:"translation",get:/* @__PURE__ */e(function(){return{x:this._x+this._dx,y:this._y+this._dy}},"get$$1")},{key:"json",get:/* @__PURE__ */e(function(){var t={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(t.data=this.data),this.type&&(t.type=this.type),this._className&&(t.className=this._className),Object.keys(this.connector).length>0&&(t.connector=this.connector),Object.keys(this.subject).length>0&&(t.subject=this.subject),Object.keys(this.note).length>0&&(t.note=this.note),t},"get$$1")}]),t}(),Aa=function(){function t(e){var i=e.annotations,n=e.accessors,o=e.accessorsInverse;_a(this,t),this.accessors=n,this.accessorsInverse=o,this.annotations=i}return e(t,"AnnotationCollection"),xa(t,[{key:"clearTypes",value:/* @__PURE__ */e(function(t){this.annotations.forEach(function(e){e.type=void 0,e.subject=t&&t.subject||e.subject,e.connector=t&&t.connector||e.connector,e.note=t&&t.note||e.note})},"clearTypes")},{key:"setPositionWithAccessors",value:/* @__PURE__ */e(function(){var t=this;this.annotations.forEach(function(e){e.type.setPositionWithAccessors(t.accessors)})},"setPositionWithAccessors")},{key:"editMode",value:/* @__PURE__ */e(function(t){this.annotations.forEach(function(e){e.type&&(e.type.editMode=t,e.type.updateEditMode())})},"editMode")},{key:"updateDisable",value:/* @__PURE__ */e(function(t){this.annotations.forEach(function(e){e.disable=t,e.type&&t.forEach(function(t){e.type[t]&&(e.type[t].remove&&e.type[t].remove(),e.type[t]=void 0)})})},"updateDisable")},{key:"updateTextWrap",value:/* @__PURE__ */e(function(t){this.annotations.forEach(function(e){e.type&&e.type.updateTextWrap&&e.type.updateTextWrap(t)})},"updateTextWrap")},{key:"updateText",value:/* @__PURE__ */e(function(){this.annotations.forEach(function(t){t.type&&t.type.drawText&&t.type.drawText()})},"updateText")},{key:"updateNotePadding",value:/* @__PURE__ */e(function(t){this.annotations.forEach(function(e){e.type&&(e.type.notePadding=t)})},"updateNotePadding")},{key:"json",get:/* @__PURE__ */e(function(){var t=this;return this.annotations.map(function(e){var i=e.json;return t.accessorsInverse&&e.data&&(i.data={},Object.keys(t.accessorsInverse).forEach(function(n){i.data[n]=t.accessorsInverse[n]({x:e.x,y:e.y})})),i})},"get$$1")},{key:"noteNodes",get:/* @__PURE__ */e(function(){return this.annotations.map(function(t){return ma({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})})},"get$$1")}]),t}(),ka=/* @__PURE__ */e(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy;return{move:{x:i,y:void 0===n?0:n}}},"pointHandle"),Ma=/* @__PURE__ */e(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy,o=void 0===n?0:n,a=t.r1,s=t.r2,r=t.padding,l={move:{x:i,y:o}};return void 0!==a&&(l.r1={x:i+a/Math.sqrt(2),y:o+a/Math.sqrt(2)}),void 0!==s&&(l.r2={x:i+s/Math.sqrt(2),y:o+s/Math.sqrt(2)}),void 0!==r&&(l.padding={x:i+a+r,y:o}),l},"circleHandles"),Pa=/* @__PURE__ */e(function(t){var e=t.group,i=t.handles,n=t.r,o=void 0===n?10:n,a=e.selectAll("circle.handle").data(i);a.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(j().container(h("g.annotations").node()).on("start",function(t){return t.start&&t.start(t)}).on("drag",function(t){return t.drag&&t.drag(t)}).on("end",function(t){return t.end&&t.end(t)})),e.selectAll("circle.handle").attr("cx",function(t){return t.x}).attr("cy",function(t){return t.y}).attr("r",function(t){return t.r||o}).attr("class",function(t){return"handle "+(t.className||"")}),a.exit().remove()},"addHandles"),Ta=/* @__PURE__ */e(function(t,e){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},"leftRightDynamic"),Ca=/* @__PURE__ */e(function(t,e){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},"topBottomDynamic"),za=["topBottom","top","bottom"],Fa=["leftRight","left","right"],Ia=/* @__PURE__ */e(function(t){var e=t.padding,i=void 0===e?0:e,n=t.bbox,o=void 0===n?{x:0,width:0,height:0}:n,a=t.align,s=t.orientation,r=t.offset,l=void 0===r?{x:0,y:0}:r,h=-o.x,c=0;return-1!==za.indexOf(s)?(a=Ca(a,l.x),l.y<0&&"topBottom"===s||"top"===s?c-=o.height+i:c+=i,"middle"===a?h-=o.width/2:"right"===a&&(h-=o.width)):-1!==Fa.indexOf(s)&&(a=Ta(a,l.y),l.x<0&&"leftRight"===s||"left"===s?h-=o.width+i:h+=i,"middle"===a?c-=o.height/2:"top"===a&&(c-=o.height)),{x:h,y:c}},"noteAlignment"),Ea=/* @__PURE__ */e(function(t){var e=t.data,i=t.curve,n=void 0===i?Xo:i,o=t.canvasContext,a=t.className,s=t.classID,r=Qo().curve(n),l={type:"path",className:a,classID:s,data:e};return o?(r.context(o),l.pathMethods=r):l.attrs={d:r(e)},l},"lineBuilder"),Ra=/* @__PURE__ */e(function(t){var e=t.data,i=t.canvasContext,n={type:"path",className:t.className,classID:t.classID,data:e},o=Wo().innerRadius(e.innerRadius||0).outerRadius(e.outerRadius||e.radius||2).startAngle(e.startAngle||0).endAngle(e.endAngle||2*Math.PI);return i?(o.context(i),n.pathMethods=lineGen):n.attrs={d:o()},n},"arcBuilder"),Da=/* @__PURE__ */e(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,a=void 0===o?0:o,s=t.bbox,r=t.offset;"top"===(e=Ta(e,r.y))?a-=s.height:"middle"===e&&(a-=s.height/2);var l=[[n,a],[n,a+s.height]];return{components:[Ea({data:l,className:"note-line"})]}},"noteVertical"),Oa=/* @__PURE__ */e(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,a=void 0===o?0:o,s=t.offset,r=t.bbox;"right"===(e=Ca(e,s.x))?n-=r.width:"middle"===e&&(n-=r.width/2);var l=[[n,a],[n+r.width,a]];return{components:[Ea({data:l,className:"note-line"})]}},"noteHorizontal"),ja=/* @__PURE__ */e(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,a=n.x-o.x,s=a+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("circle"===i&&(h.outerRadius||h.radius)){var c=Math.sqrt((a-s)*(a-s)+(r-l)*(r-l)),u=Math.asin(-l/c),p=h.outerRadius||h.radius+(h.radiusPadding||0);a=Math.abs(Math.cos(u)*p)*(s<0?-1:1),r=Math.abs(Math.sin(u)*p)*(l<0?-1:1)}if("rect"===i){var d=h.width,f=h.height;(d>0&&n.dx>0||d<0&&n.dx<0)&&(a=Math.abs(d)>Math.abs(n.dx)?d/2:d),(f>0&&n.dy>0||f<0&&n.dy<0)&&(r=Math.abs(f)>Math.abs(n.dy)?f/2:f),a===d/2&&r===f/2&&(a=s,r=l)}return[[a,r],[s,l]]},"lineSetup"),Na=/* @__PURE__ */e(function(t){var e=ja(t);return{components:[Ea({data:e,className:"connector"})]}},"connectorLine"),La=/* @__PURE__ */e(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,a=n.x-o.x,s=a+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("rect"===i){var c=h.width,u=h.height;(c>0&&n.dx>0||c<0&&n.dx<0)&&(a=Math.abs(c)>Math.abs(n.dx)?c/2:c),(u>0&&n.dy>0||u<0&&n.dy<0)&&(r=Math.abs(u)>Math.abs(n.dy)?u/2:u),a===c/2&&r===u/2&&(a=s,r=l)}var p=[[a,r],[s,l]],d=l-r,f=s-a,y=s,_=l,x=l<r&&s>a||s<a&&l>r?-1:1;if(Math.abs(f)<Math.abs(d)?(y=s,_=r+f*x):(_=l,y=a+d*x),"circle"===i&&(h.outerRadius||h.radius)){var m=(h.outerRadius||h.radius)+(h.radiusPadding||0),g=m/Math.sqrt(2);if(Math.abs(f)>g&&Math.abs(d)>g)p=[[a=g*(s<0?-1:1),r=g*(l<0?-1:1)],[y,_],[s,l]];else if(Math.abs(f)>Math.abs(d)){var b=Math.asin(-l/m);p=[[a=Math.abs(Math.cos(b)*m)*(s<0?-1:1),l],[s,l]]}else{var v=Math.acos(s/m);p=[[s,r=Math.abs(Math.sin(v)*m)*(l<0?-1:1)],[s,l]]}}else p=[[a,r],[y,_],[s,l]];return{components:[Ea({data:p,className:"connector"})]}},"connectorElbow"),Ba=/* @__PURE__ */e(function(t){var i=t.type,n=t.connectorData,o=t.subjectType;n||(n={}),n.points&&"number"!=typeof n.points||(n.points=$a(i.annotation.offset,n.points)),n.curve||(n.curve=ra);var a=[];if(i.editMode){var s=n.points.map(function(t,e){return ma({},ka({cx:t[0],cy:t[1]}),{index:e})}),r=/* @__PURE__ */e(function(t){n.points[t][0]+=N.dx,n.points[t][1]+=N.dy,i.redrawConnector()},"updatePoint");a=i.mapHandles(s.map(function(t){return ma({},t.move,{drag:r.bind(i,t.index)})}))}var l=ja({type:i,subjectType:o});return l=[l[0]].concat(wa(n.points),[l[1]]),{components:[Ea({data:l,curve:n.curve,className:"connector"})],handles:a}},"connectorCurve"),$a=/* @__PURE__ */e(function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=t.x/(e+1),n=t.y/(e+1),o=[],a=1;a<=e;a++)o.push([i*a+a%2*20,n*a-a%2*20]);return o},"createPoints"),Ha=/* @__PURE__ */e(function(t){var e=t.annotation,i=t.start,n=t.end,o=t.scale,a=void 0===o?1:o,s=e.position;i=i?[-n[0]+i[0],-n[1]+i[1]]:[e.dx,e.dy],n||(n=[e.x-s.x,e.y-s.y]);var r=n[0],l=n[1],h=i[0],c=i[1],u=10*a,p=16/180*Math.PI,d=Math.atan(c/h);h<0&&(d+=Math.PI);var f=[[r,l],[Math.cos(d+p)*u+r,Math.sin(d+p)*u+l],[Math.cos(d-p)*u+r,Math.sin(d-p)*u+l],[r,l]];return{components:[Ea({data:f,className:"connector-end connector-arrow",classID:"connector-end"})]}},"connectorArrow"),Va=/* @__PURE__ */e(function(t){var e=t.line,i=t.scale,n=void 0===i?1:i,o=Ra({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(n)}});return o.attrs.transform="translate("+e.data[0][0]+", "+e.data[0][1]+")",{components:[o]}},"connectorDot"),qa=/* @__PURE__ */e(function(t){var i=t.subjectData,n=t.type;i.radius||i.outerRadius||(i.radius=20);var o=[],a=Ra({data:i,className:"subject"});if(n.editMode){var s=Ma({r1:a.data.outerRadius||a.data.radius,r2:a.data.innerRadius,padding:i.radiusPadding}),r=/* @__PURE__ */e(function(t){var e=i[t]+N.dx*Math.sqrt(2);i[t]=e,n.redrawSubject(),n.redrawConnector()},"updateRadius"),l=[ma({},s.r1,{drag:r.bind(n,void 0!==i.outerRadius?"outerRadius":"radius")})];i.innerRadius&&l.push(ma({},s.r2,{drag:r.bind(n,"innerRadius")})),o=n.mapHandles(l)}return a.attrs["fill-opacity"]=0,{components:[a],handles:o}},"subjectCircle"),Wa=/* @__PURE__ */e(function(t){var i=t.subjectData,n=t.type;i.width||(i.width=100),i.height||(i.height=100);var o=[],a=i.width,s=i.height,r=Ea({data:[[0,0],[a,0],[a,s],[0,s],[0,0]],className:"subject"});if(n.editMode){var l=/* @__PURE__ */e(function(){i.width=N.x,n.redrawSubject(),n.redrawConnector()},"updateWidth"),h=/* @__PURE__ */e(function(){i.height=N.y,n.redrawSubject(),n.redrawConnector()},"updateHeight"),c=[{x:a,y:s/2,drag:l.bind(n)},{x:a/2,y:s,drag:h.bind(n)}];o=n.mapHandles(c)}return r.attrs["fill-opacity"]=.1,{components:[r],handles:o}},"subjectRect"),Ga=/* @__PURE__ */e(function(t){var e=t.subjectData,i=t.type.annotation.position,n=(void 0!==e.x1?e.x1:i.x)-i.x,o=(void 0!==e.x2?e.x2:i.x)-i.x,a=(void 0!==e.y1?e.y1:i.y)-i.y,s=(void 0!==e.y2?e.y2:i.y)-i.y;return{components:[Ea({data:[[n,a],[o,s]],className:"subject"})]}},"subjectThreshold"),Xa=/* @__PURE__ */e(function(t){var i=t.subjectData,n=void 0===i?{}:i,o=t.type,a=void 0===o?{}:o,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=a.typeSettings&&a.typeSettings.subject;n.radius||(r&&r.radius?n.radius=r.radius:n.radius=14),n.x||r&&r.x&&(n.x=r.x),n.y||r&&r.y&&(n.y=r.y);var l=[],h=[],c=n.radius,u=.7*c,p=0,d=0,f=Math.sqrt(2)*c,y={xleftcorner:-c,xrightcorner:c,ytopcorner:-c,ybottomcorner:c,xleft:-f,xright:f,ytop:-f,ybottom:f};n.x&&!n.y?p=y["x"+n.x]:n.y&&!n.x?d=y["y"+n.y]:n.x&&n.y&&(p=y["x"+n.x+"corner"],d=y["y"+n.y+"corner"]);var _="translate("+p+", "+d+")",x=Ra({className:"subject",data:{radius:c}});x.attrs.transform=_,x.attrs.fill=s.color,x.attrs["stroke-linecap"]="round",x.attrs["stroke-width"]="3px";var m=Ra({className:"subject-ring",data:{outerRadius:c,innerRadius:u}});m.attrs.transform=_,m.attrs["stroke-width"]="3px",m.attrs.fill="white";var g=void 0;if(p&&d||!p&&!d)g=Ea({className:"subject-pointer",data:[[0,0],[p||0,0],[0,d||0],[0,0]]});else if(p||d){var b=/* @__PURE__ */e(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*c/Math.sqrt(2)},"notCornerPointerXY");g=Ea({className:"subject-pointer",data:[[0,0],[b(p),b(d)],[b(p,-1),b(d,-1)],[0,0]]})}if(g&&(g.attrs.fill=s.color,g.attrs["stroke-linecap"]="round",g.attrs["stroke-width"]="3px",h.push(g)),a.editMode){var v={x:2*p,y:2*d,drag:/* @__PURE__ */e(function(){n.x=N.x<2*-c?"left":N.x>2*c?"right":void 0,n.y=N.y<2*-c?"top":N.y>2*c?"bottom":void 0,a.redrawSubject()},"dragBadge").bind(a)};v.x||v.y||(v.y=-c),l=a.mapHandles([v])}var w=void 0;return n.text&&(w={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:n.text,"text-anchor":"middle",dy:".25em",x:p,y:d}}),h.push(x),h.push(m),h.push(w),{components:h,handles:l}},"subjectBadge"),Ya=function(){function t(e){var i=e.a,n=e.annotation,o=e.editMode,a=e.dispatcher,s=e.notePadding,r=e.accessors;if(_a(this,t),this.a=i,this.note=-1===n.disable.indexOf("note")&&i.select("g.annotation-note"),this.noteContent=this.note&&i.select("g.annotation-note-content"),this.connector=-1===n.disable.indexOf("connector")&&i.select("g.annotation-connector"),this.subject=-1===n.disable.indexOf("subject")&&i.select("g.annotation-subject"),this.dispatcher=a,a){var l=ts.bind(null,a,n);l({component:this.note,name:"note"}),l({component:this.connector,name:"connector"}),l({component:this.subject,name:"subject"})}this.annotation=n,this.editMode=n.editMode||o,this.notePadding=void 0!==s?s:3,this.offsetCornerX=0,this.offsetCornerY=0,r&&n.data&&this.init(r)}return e(t,"Type"),xa(t,[{key:"init",value:/* @__PURE__ */e(function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)},"init")},{key:"mapY",value:/* @__PURE__ */e(function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))},"mapY")},{key:"mapX",value:/* @__PURE__ */e(function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))},"mapX")},{key:"updateEditMode",value:/* @__PURE__ */e(function(){this.a.selectAll("circle.handle").remove()},"updateEditMode")},{key:"drawOnSVG",value:/* @__PURE__ */e(function(t,e){var i=this;Array.isArray(e)||(e=[e]),e.filter(function(t){return t}).forEach(function(e){var n=e.type,o=e.className,a=e.attrs,s=e.handles,r=e.classID;if("handle"===n)Pa({group:t,r:a&&a.r,handles:s});else{Ka(t,[i.annotation],n,o,r);for(var l=t.select(n+"."+(r||o)),h=Object.keys(a),c=[],u=l.node().attributes,p=u.length-1;p>=0;p--){var d=u[p].name;-1===h.indexOf(d)&&"class"!==d&&c.push(d)}h.forEach(function(t){"text"===t?l.text(a[t]):l.attr(t,a[t])}),c.forEach(function(t){return l.attr(t,null)})}})},"drawOnSVG")},{key:"getNoteBBox",value:/* @__PURE__ */e(function(){return is(this.note,".annotation-note-content text")},"getNoteBBox")},{key:"getNoteBBoxOffset",value:/* @__PURE__ */e(function(){var t=is(this.note,".annotation-note-content"),e=this.noteContent.attr("transform").split(/\(|\,|\)/g);return t.offsetCornerX=parseFloat(e[1])+this.annotation.dx,t.offsetCornerY=parseFloat(e[2])+this.annotation.dy,t.offsetX=this.annotation.dx,t.offsetY=this.annotation.dy,t},"getNoteBBoxOffset")},{key:"drawSubject",value:/* @__PURE__ */e(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.subject,n=e.type,o={type:this,subjectData:i},a={};"circle"===n?a=qa(o):"rect"===n?a=Wa(o):"threshold"===n?a=Ga(o):"badge"===n&&(a=Xa(o,this.annotation));var s=a,r=s.components,l=void 0===r?[]:r,h=s.handles,c=void 0===h?[]:h;return l.forEach(function(e){e&&e.attrs&&!e.attrs.stroke&&(e.attrs.stroke=t.annotation.color)}),this.editMode&&(c=c.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),l.push({type:"handle",handles:c})),l},"drawSubject")},{key:"drawConnector",value:/* @__PURE__ */e(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.connector,n=i.type||e.type,o={type:this,connectorData:i};o.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var a="curve"===n?Ba(o):"elbow"===n?La(o):Na(o),s=a.components,r=void 0===s?[]:s,l=a.handles,h=void 0===l?[]:l,c=r[0];c&&(c.attrs.stroke=this.annotation.color,c.attrs.fill="none");var u=i.end||e.end,p={};if("arrow"===u){var d=c.data[1],f=c.data[0];Math.sqrt(Math.pow(d[0]-f[0],2)+Math.pow(d[1]-f[1],2))<5&&c.data[2]&&(d=c.data[2]),p=Ha({annotation:this.annotation,start:d,end:f,scale:i.endScale})}else"dot"===u?p=Va({line:c,scale:i.endScale}):u&&"none"!==u||this.connector&&this.connector.select(".connector-end").remove();return p.components&&(p.components.forEach(function(e){e.attrs.fill=t.annotation.color,e.attrs.stroke=t.annotation.color}),r=r.concat(p.components)),this.editMode&&0!==h.length&&r.push({type:"handle",handles:h}),r},"drawConnector")},{key:"drawNote",value:/* @__PURE__ */e(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.note,n=i.align||e.align||"dynamic",o={bbox:e.bbox,align:n,offset:this.annotation.offset},a=i.lineType||e.lineType,s={};"vertical"===a?s=Da(o):"horizontal"===a&&(s=Oa(o));var r=s,l=r.components,c=void 0===l?[]:l,u=r.handles,p=void 0===u?[]:u;if(c.forEach(function(e){e.attrs.stroke=t.annotation.color}),this.editMode){p=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),c.push({type:"handle",handles:p});var d=this.dragNote.bind(this),f=this.dragstarted.bind(this),y=this.dragended.bind(this);this.note.call(j().container(h("g.annotations").node()).on("start",function(t){return f(t)}).on("drag",function(t){return d(t)}).on("end",function(t){return y(t)}))}else this.note.on("mousedown.drag",null);return c},"drawNote")},{key:"drawNoteContent",value:/* @__PURE__ */e(function(t){var e=this.annotation.note,i=void 0!==e.padding?e.padding:this.notePadding,n=e.orientation||t.orientation||"topBottom",o=e.lineType||t.lineType,a=e.align||t.align||"dynamic";"vertical"===o?n="leftRight":"horizontal"===o&&(n="topBottom");var s={padding:i,bbox:t.bbox,offset:this.annotation.offset,orientation:n,align:a},r=Ia(s),l=r.x,h=r.y;return this.offsetCornerX=l+this.annotation.dx,this.offsetCornerY=h+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+l+", "+h+")"),[]},"drawNoteContent")},{key:"drawOnScreen",value:/* @__PURE__ */e(function(t,e){return this.drawOnSVG(t,e)},"drawOnScreen")},{key:"redrawSubject",value:/* @__PURE__ */e(function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())},"redrawSubject")},{key:"redrawConnector",value:/* @__PURE__ */e(function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())},"redrawConnector")},{key:"redrawNote",value:/* @__PURE__ */e(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:t})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:t}))},"redrawNote")},{key:"setPosition",value:/* @__PURE__ */e(function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")},"setPosition")},{key:"clearComponents",value:/* @__PURE__ */e(function(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()},"clearComponents")},{key:"setOffset",value:/* @__PURE__ */e(function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}},"setOffset")},{key:"setPositionWithAccessors",value:/* @__PURE__ */e(function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()},"setPositionWithAccessors")},{key:"setClassName",value:/* @__PURE__ */e(function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))},"setClassName")},{key:"draw",value:/* @__PURE__ */e(function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()},"draw")},{key:"dragstarted",value:/* @__PURE__ */e(function(){N.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")},"dragstarted")},{key:"dragended",value:/* @__PURE__ */e(function(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")},"dragended")},{key:"dragSubject",value:/* @__PURE__ */e(function(){var t=this.annotation.position;t.x+=N.dx,t.y+=N.dy,this.annotation.position=t},"dragSubject")},{key:"dragNote",value:/* @__PURE__ */e(function(){var t=this.annotation.offset;t.x+=N.dx,t.y+=N.dy,this.annotation.offset=t},"dragNote")},{key:"mapHandles",value:/* @__PURE__ */e(function(t){var e=this;return t.map(function(t){return ma({},t,{start:e.dragstarted.bind(e),end:e.dragended.bind(e)})})},"mapHandles")}]),t}(),Ua=/* @__PURE__ */e(function(t,i,n){return function(t){function o(t){_a(this,o);var e=va(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,t));return e.typeSettings=i,i.disable&&i.disable.forEach(function(t){e[t]&&e[t].remove(),e[t]=void 0,"note"===t&&(e.noteContent=void 0)}),e}return ba(o,t),e(o,"customType"),xa(o,[{key:"className",value:/* @__PURE__ */e(function(){return""+(i.className||ga(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"className",this)&&ga(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"className",this).call(this)||"")},"className")},{key:"drawSubject",value:/* @__PURE__ */e(function(t){return this.typeSettings.subject=ma({},i.subject,this.typeSettings.subject),ga(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"drawSubject",this).call(this,ma({},t,this.typeSettings.subject))},"drawSubject")},{key:"drawConnector",value:/* @__PURE__ */e(function(t){return this.typeSettings.connector=ma({},i.connector,this.typeSettings.connector),ga(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"drawConnector",this).call(this,ma({},t,i.connector,this.typeSettings.connector))},"drawConnector")},{key:"drawNote",value:/* @__PURE__ */e(function(t){return this.typeSettings.note=ma({},i.note,this.typeSettings.note),ga(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"drawNote",this).call(this,ma({},t,i.note,this.typeSettings.note))},"drawNote")},{key:"drawNoteContent",value:/* @__PURE__ */e(function(t){return ga(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"drawNoteContent",this).call(this,ma({},t,i.note,this.typeSettings.note))},"drawNoteContent")}],[{key:"init",value:/* @__PURE__ */e(function(t,e){return ga(o.__proto__||Object.getPrototypeOf(o),"init",this).call(this,t,e),n&&(t=n(t,e)),t},"init")}]),o}(t)},"customType"),Qa=function(){function t(e){_a(this,t);var i=va(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.textWrap=e.textWrap||120,i.drawText(),i}return ba(t,Ya),e(t,"d3NoteText"),xa(t,[{key:"updateTextWrap",value:/* @__PURE__ */e(function(t){this.textWrap=t,this.drawText()},"updateTextWrap")},{key:"drawText",value:/* @__PURE__ */e(function(){if(this.note){Ka(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");Ka(t,[this.annotation],"rect","annotation-note-bg"),Ka(t,[this.annotation],"text","annotation-note-label"),Ka(t,[this.annotation],"text","annotation-note-title");var e={height:0},i=this.a.select("text.annotation-note-label"),n=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,o=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,a=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,s={top:0,bottom:0,left:0,right:0};if("number"==typeof a?s={top:a,bottom:a,left:a,right:a}:a&&"object"===(void 0===a?"undefined":ya(a))&&(s=ma(s,a)),this.annotation.note.title){var r=this.a.select("text.annotation-note-title");r.text(this.annotation.note.title),r.attr("fill",this.annotation.color),r.attr("font-weight","bold"),r.call(es,n,o),e=r.node().getBBox()}i.text(this.annotation.note.label).attr("dx","0"),i.call(es,n,o),i.attr("y",1.1*e.height||0),i.attr("fill",this.annotation.color);var l=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",l.width+s.left+s.right).attr("height",l.height+s.top+s.bottom).attr("x",l.x-s.left).attr("y",-s.top).attr("fill","white").attr("fill-opacity",0)}},"drawText")}]),t}();Ua(Qa,{className:"label",note:{align:"middle"}});var Za=Ua(Qa,{className:"callout",note:{lineType:"horizontal"}}),Ja=Ua(Za,{className:"callout elbow",connector:{type:"elbow"}});Ua(Za,{className:"callout curve",connector:{type:"curve"}}),Ua(Ya,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),Ua(Qa,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),Ua(Qa,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),Ua(function(){function t(){return _a(this,t),va(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return ba(t,Za),e(t,"ThresholdMap"),xa(t,[{key:"mapY",value:/* @__PURE__ */e(function(e){ga(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"mapY",this).call(this,e);var i=this.annotation;(i.subject.x1||i.subject.x2)&&i.data&&e.y&&(i.y=e.y(i.data)),!i.subject.x1&&!i.subject.x2||i.x||(i.x=i.subject.x1||i.subject.x2)},"mapY")},{key:"mapX",value:/* @__PURE__ */e(function(e){ga(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"mapX",this).call(this,e);var i=this.annotation;(i.subject.y1||i.subject.y2)&&i.data&&e.x&&(i.x=e.x(i.data)),!i.subject.y1&&!i.subject.y2||i.y||(i.y=i.subject.y1||i.subject.y2)},"mapX")}]),t}(),{className:"callout xythreshold",subject:{type:"threshold"}});var Ka=/* @__PURE__ */e(function(t,e,i,n,o){var a=t.selectAll(i+"."+(o||n)).data(e);return a.enter().append(i).merge(a).attr("class",n),a.exit().remove(),t},"newWithClass"),ts=/* @__PURE__ */e(function(t,e,i){var n=i.component,o=i.name;n&&n.on("mouseover.annotations",function(){t.call(o+"over",n,e)}).on("mouseout.annotations",function(){return t.call(o+"out",n,e)}).on("click.annotations",function(){return t.call(o+"click",n,e)})},"addHandlers"),es=/* @__PURE__ */e(function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each(function(){for(var t=h(this),o=t.text().split(i||/[ \t\r\n]+/).reverse().filter(function(t){return""!==t}),a=void 0,s=[],r=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");a=o.pop();)s.push(a),r.text(s.join(" ")),r.node().getComputedTextLength()>e&&s.length>1&&(s.pop(),r.text(s.join(" ")),s=[a],r=t.append("tspan").attr("x",0).attr("dy",n+"em").text(a))})},"wrap"),is=/* @__PURE__ */e(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return t?t.selectAll(e).nodes().reduce(function(t,e){var i=e.getBBox();t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),t.width=Math.max(t.width,i.width);var n=e&&e.attributes&&e.attributes.y;return t.height=Math.max(t.height,(n&&parseFloat(n.value)||0)+i.height),t},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}},"bboxWithoutHandles");function ns(){var t=[],i=void 0,n=void 0,o=[],a={},s={},r=!1,l=void 0,c=Za,u=void 0,p=void 0,d=L("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),f=void 0,y=/* @__PURE__ */e(function(e){f=e,r||e.selectAll("circle.handle").remove();var n=t.map(function(t){return t.type||(t.type=c),t.disable||(t.disable=o),new Sa(t)});i=i||new Aa({annotations:n,accessors:a,accessorsInverse:s,ids:l}),e.selectAll("g").data([i]).enter().append("g").attr("class","annotations");var y=e.select("g.annotations");Ka(y,i.annotations,"g","annotation"),y.selectAll("g.annotation").each(function(t){var e=h(this);e.attr("class","annotation"),Ka(e,[t],"g","annotation-connector"),Ka(e,[t],"g","annotation-subject"),Ka(e,[t],"g","annotation-note"),Ka(e.select("g.annotation-note"),[t],"g","annotation-note-content"),t.type="[object Object]"===t.type.toString()?t.type:new t.type({a:e,annotation:t,textWrap:u,notePadding:p,editMode:r,dispatcher:d,accessors:a}),t.type.draw(),t.type.drawText&&t.type.drawText()})},"annotation");return y.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",i.json),window.copy(JSON.stringify(i.json.map(function(t){return delete t.type,t}))),y},y.update=function(){return t&&i&&(t=i.annotations.map(function(t){return t.type.draw(),t})),y},y.updateText=function(){return i&&(i.updateText(u),t=i.annotations),y},y.updatedAccessors=function(){return i.setPositionWithAccessors(),t=i.annotations,y},y.disable=function(e){return arguments.length?(o=e,i&&(i.updateDisable(o),t=i.annotations),y):o},y.textWrap=function(e){return arguments.length?(u=e,i&&(i.updateTextWrap(u),t=i.annotations),y):u},y.notePadding=function(e){return arguments.length?(p=e,i&&(i.updateNotePadding(p),t=i.annotations),y):p},y.type=function(e,n){return arguments.length?(c=e,i&&(i.annotations.map(function(t){t.type.note&&t.type.note.selectAll("*:not(.annotation-note-content)").remove(),t.type.noteContent&&t.type.noteContent.selectAll("*").remove(),t.type.subject&&t.type.subject.selectAll("*").remove(),t.type.connector&&t.type.connector.selectAll("*").remove(),t.type.typeSettings={},t.type=c,t.subject=n&&n.subject||t.subject,t.connector=n&&n.connector||t.connector,t.note=n&&n.note||t.note}),t=i.annotations),y):c},y.annotations=function(e){if(!arguments.length)return i&&i.annotations||t;(t=e,i&&i.annotations)&&(t.some(function(t){return!t.type||"[object Object]"!==t.type.toString()})?(i=null,y(f)):i.annotations=t);return y},y.context=function(t){return arguments.length?(n=t,y):n},y.accessors=function(t){return arguments.length?(a=t,y):a},y.accessorsInverse=function(t){return arguments.length?(s=t,y):s},y.ids=function(t){return arguments.length?(l=t,y):l},y.editMode=function(e){return arguments.length?(r=e,f&&f.selectAll("g.annotation").classed("editable",r),i&&(i.editMode(r),t=i.annotations),y):r},y.collection=function(t){return arguments.length?(i=t,y):i},y.on=function(){var t=d.on.apply(d,arguments);return t===d?y:t},y}function os(t){return.65*(t-.5)*2*Math.PI}function as(t,e){return{x:Math.cos(t-Math.PI/2)*e,y:Math.sin(t-Math.PI/2)*e}}function ss(t,e,i=!1){const n=as(t,e),o=180*t/Math.PI+(!0===i?180:0);return`translate(${n.x}, ${n.y}) rotate(${o})`}function rs(t,e,i=!1){return function(n){const o=$(n.angle,t);return n.angle=t,function(t){return ss(o(t),e,i)}}}function ls(t,e,i){return function(n){const o=$(n.startAngle,t),a=$(n.endAngle,e);return function(t){return n.startAngle=o(t),n.endAngle=a(t),i(n)}}}e(ns,"annotation"),e(os,"value2Angle"),e(as,"pointOnArc"),e(ss,"indicatorTranslate"),e(rs,"indicatorTween"),e(ls,"arcTween");const hs=class _Gauge extends l{_d3Arc=At().innerRadius(85).outerRadius(100);_colorScale=_().interpolate(B);_usageArc;_meanArc;_freeArc;_indInner;_indOuter;_centerTextG;_centerText;_bottomText;_tooltipG;_mainTooltip;constructor(){super()}tip(t){if(null===t||""===t.label)this._tooltipG.transition().style("opacity",0).on("interrupt end",()=>{this._tooltipG.selectAll("g").remove()});else{this._tooltipG.interrupt().style("opacity",1),t.w=this._centerText.datum().w+10;let i="horizontal",n=0,o=5,a=5;t.y>=5&&t.y<=25?(n=t.x<0?-t.w/2:t.w/2,o=12.5,a=void 0,i="vertical"):t.y>25&&(o=25,a=0);const s=ns().type(Ja).annotations([{data:t,dx:-t.x+n,dy:-t.y+o,color:"black",note:{label:t.label,lineType:i,padding:a,align:"middle"}}]).accessors({x:/* @__PURE__ */e(t=>t.x,"x"),y:/* @__PURE__ */e(t=>t.y,"y")});this._tooltipG.call(s)}}calcSize(t,e,i){const n=t.node().getBBox(),o=e/n.width,a=i/n.height,s=o<a?o:a;return{width:n.width,height:n.height,scale:s}}updateText(t,e,i,n,o){t.datum({x:e,y:i,w:n,h:o}).attr("transform",null);const a=this.calcSize(t,n,o),s=e+n/2-a.width/2*a.scale,r=i+o/2-a.height/2*a.scale;t.attr("transform",`translate(${s}, ${r}) scale(${a.scale})`)}calcWidth(){return Math.min(this.width(),this.height(),this.maxDiameter())}enter(t,i){super.enter(t,i),i.on("click",t=>{this.click(t)}),this._usageArc=i.append("path").datum({startAngle:os(0),endAngle:os(0)}).style("fill","green").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._freeArc=i.append("path").datum({startAngle:os(0),endAngle:os(1)}).style("fill","lightGrey"),this._meanArc=i.append("path").datum({startAngle:os(0),endAngle:os(0)}).style("fill","black").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.tickValueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._mainTooltip=i.append("title");const n=this;function o(){return i.append("path").datum({angle:os(0)}).style("fill","black").style("stroke","black").attr("d","M 0 0 l -3 -3 l 6 0 z").on("mousemove",t=>{const[e,i]=n._d3Arc.centroid(n._meanArc.datum());n.tip({x:e,y:i,label:n.tickValueDescription()})}).on("mouseout",t=>{n.tip(null)})}e(o,"appendIndicator"),this._indInner=o(),this._indOuter=o(),this._centerText=i.append("text").attr("dy",".66em").style("fill","green").on("mousemove",t=>{this.tip({x:0,y:0,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._bottomText=i.append("text").attr("dy",".66em").on("mousemove",t=>{this.tip({x:0,y:t.y,label:this.titleDescription()})}).on("mouseout",t=>{this.tip(null)}),this._tooltipG=i.append("g").attr("class","annotation-tip")}update(t,e){super.update(t,e),this._colorScale.domain(this.colorDomain()).range(this.colorRange()),e.attr("title",this.tooltip()).style("cursor",this.click!==_Gauge.prototype.click?"pointer":null);const i=this.calcWidth()/3,n=this.calcWidth()/2-5;this._d3Arc.innerRadius(i).outerRadius(n);const o=this.value(),a=this.tickValue();this._usageArc.style("fill",this._colorScale(o)).transition().duration(750).attrTween("d",ls(os(0),os(o),this._d3Arc)),this._freeArc.style("fill",this.emptyColor()).transition().duration(750).attrTween("d",ls(os(o),os(1),this._d3Arc)),this._meanArc.style("fill",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("d",ls(os(a-.001),os(a+.001),this._d3Arc)),this._indInner.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",rs(os(a),i,!0)),this._indOuter.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",rs(os(a),n)),this._centerText.style("fill",this._colorScale(o)).text(f(".0%")(o)),this._bottomText.style("fill",this.click!==_Gauge.prototype.click?this.titleClickColor():this.titleColor()).style("text-decoration",this.click!==_Gauge.prototype.click?"underline":null).text(this.title());const s=as(os(1),i-8);this.updateText(this._centerText,-s.x,-s.y,2*s.x,2*s.y);const r=as(os(1),n);r.y+=5;const l=this.calcWidth()-20,h=this.calcWidth()/2-r.y-5;this.updateText(this._bottomText,-l/2,r.y,l,h),this._mainTooltip.text(this.tooltip())}click(t){}};e(hs,"Gauge");let cs=hs;cs.prototype._class+=" chart_Gauge",cs.prototype.publish("title","","string","Title"),cs.prototype.publish("titleDescription","","string","Title Description"),cs.prototype.publish("titleColor","black","html-color","Color of the title text"),cs.prototype.publish("titleClickColor","blue","html-color","Color of the title text when clickable"),cs.prototype.publish("maxDiameter",128,"number","Max Diameter"),cs.prototype.publish("value",0,"number","Value"),cs.prototype.publish("valueDescription","","string","Value Description"),cs.prototype.publish("showTick",!1,"boolean","Show Tick"),cs.prototype.publish("tickValue",0,"number","Tick Value"),cs.prototype.publish("tickValueDescription","","string","Tick Value Description"),cs.prototype.publish("tooltip","","string","Tooltip"),cs.prototype.publish("colorRange",["green","green","green","green","green","green","green","green","orange","red","red"],"array","Array of colors for the filled gauge portion. The fill color will be relative to the gauge value."),cs.prototype.publish("colorDomain",[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],"array","This array augments the mapping of the value to the fill colorRange."),cs.prototype.publish("emptyColor","lightgrey","html-color","Color of the empty portion of the gauge"),cs.prototype.publish("tickColor","black","html-color","Color of the tick");const us=/* @__PURE__ */e((t,e)=>t[1]-e[1]>0?1:-1,"sortAscending"),ps=/* @__PURE__ */e((t,e)=>t[1]-e[1]>0?-1:1,"sortDescending"),ds=class _Pie extends l{_totalValue;d3Pie;d3Arc;d3LabelArc;_labelPositions;_smallValueLabelHeight;_labelWidthLimit;_quadIdxArr;_minLabelTop=0;_maxLabelBottom=0;_seriesValueFormatter;_seriesPercentageFormatter;constructor(){super(),a.call(this),o.call(this),m.SimpleSelectionMixin.call(this),this.d3Pie=Et(),this.d3Arc=At(),this.d3LabelArc=At(),this.tooltipTick_default(!1).tooltipOffset_default(0)}intersection(t,e){return this.intersectCircle(this.calcOuterRadius(),t,e)}calcInnerRadius(){return this.innerRadius_exists()?this.calcOuterRadius()*this.innerRadius()/100:0}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t},!1)),"Verdana",12).width,e=this._size.width-(this.showLabels()?2*t:0)-20,i=this._size.height-36-(this.showLabels()?this._smallValueLabelHeight:0),n=Math.min(e,i)/2-2;return e/2-2<this.minOuterRadius()?this._labelWidthLimit=t-(this.minOuterRadius()-(e/2-2)):this._labelWidthLimit=t,n<this.minOuterRadius()?this.minOuterRadius():n}calcSmallValueLabelHeight(){const t=this.data().reduce((t,e)=>t+e[1],0);let e=0;return this.data().forEach(i=>{i[1]/t<.1&&e++}),this.labelHeight()*e}calcTotalValue(){return this.data().reduce((t,e)=>t+e[1],0)}calcPadAngleRadians(){const t=this.slicePadding();return t>0?Math.min(t,.05):0}getLabelText(t,e){let i,n=t.data[0];if(void 0!==this._labelWidthLimit&&e){const t=this.textSize(n,"Verdana",this.labelHeight()).width;this._labelWidthLimit<t&&(i=n.length*(this._labelWidthLimit/t)-3,n=i<n.length?n.slice(0,i)+"...":n)}if(this.showSeriesValue()&&(n+=` : ${this._seriesValueFormatter(t.data[1])}`),this.showSeriesPercentage()){let e=this._totalValue;const i=this.dataMeta();void 0!==i.sum&&(e=i.sum);const o=t.data[1]/e*100;n+=` : ${this._seriesPercentageFormatter(o)}%`}return n}selection(t){if(!arguments.length)try{return this._selection.selection2()[0]?.data}catch(i){return}const e=JSON.stringify(t);this._selection.selection2(t=>e===JSON.stringify(t.data))}selectByLabel(t){const e=this.data().filter(e=>e[0]===t)[0];e&&this.selection(e)}_slices;_labels;enter(t,e){super.enter(t,e),this._selection.widgetElement(e).skipBringToTop(!0),this._slices=e.append("g"),this._labels=e.append("g");const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t.data[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t.data[0]),value:t.data[n+1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,i){this.selectionGlow(!this.tabNavigation()),super.update(t,i);const n=this;this.updateD3Pie(),this._palette=this._palette.switch(this.paletteID()),this._seriesValueFormatter=f(this.seriesValueFormat()),this._seriesPercentageFormatter=f(this.seriesPercentageFormat()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._smallValueLabelHeight=this.calcSmallValueLabelHeight(),this._totalValue=this.calcTotalValue();const o=this.calcOuterRadius(),a=Math.max(this.calcInnerRadius(),Math.min(o/30,6)),s=o+12;this.d3Arc.innerRadius(a).padRadius(o).outerRadius(o).padAngle(this.calcPadAngleRadians()),this._quadIdxArr=[[],[],[],[]];const r=[...this.data()];switch(this.sortDataByValue()){case"ascending":r.sort(us);break;case"descending":r.sort(ps)}const l=this._slices.selectAll(".arc").data(this.d3Pie(r),t=>t.data[0]);this._labelPositions=[],l.enter().append("g").attr("class",(t,e)=>"arc series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){n.click(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this))}).on("dblclick",function(t){n.dblclick(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this))}).on("keydown",function(t,e){const i=S();!n.tabNavigation()||"Space"!==i.code&&"Enter"!==i.key||(i.preventDefault(),n._selection.click(this))}).each(function(t,e){h(this).append("path").on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).on("mouseover",y(0,0)).on("mouseout",y(-5,150))}).merge(l).transition().attr("opacity",1).attr("tabindex",n.tabNavigation()?"0":null).attr("role",n.tabNavigation()?"button":null).attr("aria-label",n.tabNavigation()?t=>`${t.data[0]}: ${t.data[1]}`:null).each(function(t,e){const i=n.getQuadrant(d(t));n._quadIdxArr[i].push(e),t.outerRadius=o-5;h(this).select("path").transition().attr("d",n.d3Arc).style("fill",n.fillColor(t.data,n.columns()[1],t.data[1]))}),l.exit().transition().style("opacity",0).remove(),this.d3LabelArc.innerRadius(s).outerRadius(s);const c=this._labels.selectAll("text").data(this.showLabels()?this.d3Pie(r):[],t=>t.data[0]),u=c.enter().append("text").on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).attr("dy",".5em").on("click",function(t){n._slices.selectAll("g").filter(function(e){t.data===e.data&&(n._selection.click(this),n.click(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this)))})}).on("dblclick",function(t){n._slices.selectAll("g").filter(function(e){t.data===e.data&&n.dblclick(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this))})}).merge(c).text(t=>this.getLabelText(t,!0)).each(function(t,e){const i=n.d3LabelArc.centroid(t),o=d(t);i[0]=s*(n.isLeftSide(o)?1:-1),n._labelPositions.push({top:i[1],bottom:i[1]+n.labelHeight()})});this.showLabels()&&(this.adjustForOverlap(),u.transition().style("font-size",this.labelHeight()+"px").attr("transform",(t,e)=>{const i=n.d3LabelArc.centroid(t);return i[0]=s*(n.isLeftSide(d(t))?1:-1),i[1]=n._labelPositions[e].top,"translate("+i+")"}).style("text-anchor",t=>this.isLeftSide(d(t))?"start":"end")),c.exit().remove();const p=this._labels.selectAll("polyline").data(this.showLabels()?this.d3Pie(r):[],t=>this.getLabelText(t,!0));function d(t){return t.startAngle+(t.endAngle-t.startAngle)/2}function y(t,e){return function(){h(this).transition().delay(e).attrTween("d",function(e){const i=$(e.outerRadius,o+t);return function(t){return e.outerRadius=i(t),n.d3Arc(e)}})}}p.enter().append("polyline").merge(p).transition().attr("points",function(t,e){const i=n.d3LabelArc.centroid(t),o=n.d3Arc.centroid(t),a=[...i];return i[0]=s*(n.isLeftSide(d(t))?1:-1),i[1]=n._labelPositions[e].top,[o,a,i]}),p.exit().remove(),this.showLabels()&&this.centerOnLabels(),e(d,"midAngle"),e(y,"arcTween")}isLeftSide(t){return(t=G(t))>2*Math.PI?t:t<Math.PI&&t>0}getQuadrant(t){let e=0;const i=G(t);return e=i<=1*Math.PI&&i>=.5*Math.PI?3:e,e=i<=.5*Math.PI&&i>=0*Math.PI?2:e,e=i<=0*Math.PI&&i>=-.5*Math.PI?1:e,e}centerOnLabels(){const t=this.pos().y,e=2*t,i=this.calcOuterRadius(),n=Math.min(this._minLabelTop,-i),o=Math.max(this._maxLabelBottom,i),a=e-(o-n),s=Math.abs(this._minLabelTop);let r=0;o>t?(r=t-o+this.labelHeight()/2,r-=a/2):n<0&&s>t&&(r=s-t+this.labelHeight()/2,r+=a/2);const l=this.pos();this.pos({y:l.y+r,x:l.x})}adjustForOverlap(){const t=this.labelHeight();this._quadIdxArr.forEach((e,i)=>{let n;this._quadIdxArr[i].sort((t,e)=>1===i||2===i?this._labelPositions[t].top>this._labelPositions[e].top?-1:1:0===i||3===i?this._labelPositions[t].top>this._labelPositions[e].top?1:-1:void 0),this._quadIdxArr[i].forEach((e,o)=>{if(o>0)if(1===i||2===i){if(n<this._labelPositions[e].bottom){const t=this._labelPositions[e].bottom-n;this._labelPositions[e].top-=t,this._labelPositions[e].bottom-=t}}else if((0===i||3===i)&&n+t>this._labelPositions[e].top){const i=Math.abs(this._labelPositions[e].top)-Math.abs(n+t);this._labelPositions[e].top-=i,this._labelPositions[e].bottom-=i}n=this._labelPositions[e].top})}),this._minLabelTop=0,this._maxLabelBottom=0,this._quadIdxArr.forEach((t,e)=>{this._quadIdxArr[e].forEach((t,e)=>{this._minLabelTop>this._labelPositions[t].top&&(this._minLabelTop=this._labelPositions[t].top),this._maxLabelBottom<this._labelPositions[t].bottom&&(this._maxLabelBottom=this._labelPositions[t].bottom)})})}exit(t,e){super.exit(t,e)}updateD3Pie(){const t=G(X(this.startAngle()));switch(this.sortDataByValue()){case"ascending":this.d3Pie.sort(us);break;case"descending":this.d3Pie.sort(ps);break;default:this.d3Pie.sort(null)}this.d3Pie.padAngle(this.calcPadAngleRadians()).startAngle(t).endAngle(2*Math.PI+t).value(function(t){return t[1]})}};e(ds,"Pie"),i(ds,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let fs=ds;fs.prototype._class+=" chart_Pie",fs.prototype.implements(a.prototype),fs.prototype.implements(o.prototype),fs.prototype.mixin(m.SimpleSelectionMixin),fs.prototype.publish("showLabels",!0,"boolean","If true, wedge labels will display"),fs.prototype.publish("showSeriesValue",!1,"boolean","Append data series value next to label",null,{disable:/* @__PURE__ */e(t=>!t.showLabels(),"disable")}),fs.prototype.publish("seriesValueFormat",",.0f","string","Number format used for formatting series values",null,{disable:/* @__PURE__ */e(t=>!t.showSeriesValue(),"disable")}),fs.prototype.publish("showSeriesPercentage",!1,"boolean","Append data series percentage next to label",null,{disable:/* @__PURE__ */e(t=>!t.showLabels(),"disable")}),fs.prototype.publish("seriesPercentageFormat",",.0f","string","Number format used for formatting series percentages",null,{disable:/* @__PURE__ */e(t=>!t.showSeriesPercentage(),"disable")}),fs.prototype.publish("paletteID","default","set","Color palette for this widget",fs.prototype._palette.switch(),{tags:["Basic","Shared"]}),fs.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),fs.prototype.publish("innerRadius",0,"number","Sets inner pie hole radius as a percentage of the radius of the pie chart",null,{tags:["Basic"],range:{min:0,step:1,max:100}}),fs.prototype.publish("minOuterRadius",20,"number","Minimum outer radius (pixels)"),fs.prototype.publish("startAngle",0,"number","Starting angle of the first (and largest) wedge (degrees)"),fs.prototype.publish("labelHeight",12,"number","Font size of labels (pixels)",null,{disable:/* @__PURE__ */e(t=>!t.showLabels(),"disable")}),fs.prototype.publish("slicePadding",.01,"number","Padding between pie slices (converted to pixels)",null,{tags:["Basic"],range:{min:0,step:.01,max:.2}}),fs.prototype.publish("sortDataByValue","descending","set","Sort data by value",["none","ascending","descending"]),fs.prototype.publish("tabNavigation",!1,"boolean","Enable or disable tab navigation");const ys=class _HalfPie extends fs{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i=this._pos.x,n=this._pos.y;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),n+=this._size.height/4,this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(-Math.PI/2).endAngle(Math.PI/2)}};e(ys,"HalfPie");let _s=ys;_s.prototype._class+=" chart_HalfPie";const xs=class _Heat extends be{_domForeignObject;_domCanvas;_heat;constructor(){super(),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}radius(t){return this.radiusX(t),this.radiusY(t),this}layerEnter(t,e,i=250){super.layerEnter(t,e,i),this._domForeignObject=this.svg.insert("foreignObject","#"+(this.id()+"_clippath")),this._domCanvas=this._domForeignObject.append("xhtml:body").style("margin","0px").style("padding","0px").style("background-color","transparent").append("canvas"),this._heat=gs(this._domCanvas.node())}layerUpdate(t,e,i=250){super.layerUpdate(t,e),this._palette=this._palette.switch(this.paletteID());let n=this.width()-this.margin.left-this.margin.right;n<0&&(n=0);let o=this.height()-this.margin.top-this.margin.bottom;o<0&&(o=0),this._domForeignObject.attr("x",this.margin.left).attr("y",this.margin.top).attr("width",n).attr("height",o),this._domCanvas.attr("width",n).attr("height",o);const a="horizontal"===t.orientation()?this.data().map(e=>[t.dataPos(e[0]),t.valuePos(e[1]),e[2]]):this.data().map(e=>[t.valuePos(e[1]),t.dataPos(e[0]),e[2]]),s=this.maxWeight_exists()?this.maxWeight():M(a,t=>t[2]);if("default"!==this.paletteID()){const t={},e=8,i=this.reversePalette();for(let n=0;n<e;++n)t[n/e]=this._palette((i?e-n:n)/e,0,1);this._heat.gradient(t)}else this._heat.gradient(this._heat.defaultGradient);this._heat.resize();const r=this.radiusAsPercent()?this.radiusX()*n/100:this.radiusX(),l=this.radiusAsPercent()?this.radiusY()*o/100:this.radiusY();this._heat.clear().radius(r,l,this.blur()).max(s).data(a).draw(this.minOpacity())}};e(xs,"Heat");let ms=xs;function gs(t){if(!(this instanceof gs))return new gs(t);this._canvas=t="string"==typeof t?document.getElementById(t):t,this._ctx=t.getContext("2d"),this._width=t.width,this._height=t.height,this._max=1,this._data=[]}ms.prototype._class+=" chart_Heat",ms.prototype._palette=H.rainbow("default"),ms.prototype.publish("paletteID","default","set","Color palette for this widget",ms.prototype._palette.switch(),{tags:["Basic"]}),ms.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),ms.prototype.publish("reversePalette",!1,"boolean","Reverse Palette Colors",null,{disable:/* @__PURE__ */e(t=>"default"===t.paletteID(),"disable")}),ms.prototype.publish("radiusX",25,"number","Point X radius (25 by default)"),ms.prototype.publish("radiusY",25,"number","Point Y radius (25 by default)"),ms.prototype.publish("radiusAsPercent",!1,"boolean","Calculate RadiusX + RadiusY as % of size"),ms.prototype.publish("blur",15,"number","Point blur radius (15 by default)"),ms.prototype.publish("maxWeight",void 0,"number","Clamp max weight to value (optional), omitting uses max data point",void 0,{optional:!0}),ms.prototype.publish("minOpacity",.05,"number","Minimum point opacity (0.05 by default)"),e(gs,"simpleheat"),gs.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:/* @__PURE__ */e(function(t){return this._data=t,this},"data"),max:/* @__PURE__ */e(function(t){return this._max=t,this},"max"),add:/* @__PURE__ */e(function(t){return this._data.push(t),this},"add"),clear:/* @__PURE__ */e(function(){return this._data=[],this},"clear"),radius:/* @__PURE__ */e(function(t,e,i){i=void 0===i?15:i;const n=this._ellipse=this._createCanvas(),o=n.getContext("2d"),a=this._r=t+i,s=this._r=e+i;return n.width=2*a,n.height=2*s,o.shadowOffsetX=o.shadowOffsetY=2*a,o.shadowOffsetY=o.shadowOffsetY=2*s,o.shadowBlur=i,o.shadowColor="black",o.beginPath(),o.ellipse(-a,-s,t,e,0,0,2*Math.PI,!0),o.closePath(),o.fill(),this},"radius"),resize:/* @__PURE__ */e(function(){this._width=this._canvas.width,this._height=this._canvas.height},"resize"),gradient:/* @__PURE__ */e(function(t){const e=this._createCanvas(),i=e.getContext("2d"),n=i.createLinearGradient(0,0,0,256);e.width=1,e.height=256;for(const o in t)n.addColorStop(+o,t[o]);return i.fillStyle=n,i.fillRect(0,0,1,256),this._grad=i.getImageData(0,0,1,256).data,this},"gradient"),draw:/* @__PURE__ */e(function(t){this._ellipse||this.radius(this.defaultRadius,this.defaultRadius),this._grad||this.gradient(this.defaultGradient);const e=this._ctx;e.clearRect(0,0,this._width,this._height);for(let n,o=0,a=this._data.length;o<a;o++)n=this._data[o],n[2]<0?n[2]=0:n[2]>this._max&&(n[2]=this._max),e.globalAlpha=Math.max(n[2]/this._max,void 0===t?.05:t),e.drawImage(this._ellipse,n[0]-this._r,n[1]-this._r);const i=e.getImageData(0,0,this._width,this._height);return this._colorize(i.data,this._grad),e.putImageData(i,0,0),this},"draw"),_colorize:/* @__PURE__ */e(function(t,e){for(let i,n=0,o=t.length;n<o;n+=4)i=4*t[n+3],i&&(t[n]=e[i],t[n+1]=e[i+1],t[n+2]=e[i+2])},"_colorize"),_createCanvas:/* @__PURE__ */e(function(){return"undefined"!=typeof document?document.createElement("canvas"):new this._canvas.constructor},"_createCanvas")};var bs=Math.PI/3,vs=[0,bs,2*bs,3*bs,4*bs,5*bs];function ws(t){return t[0]}function Ss(t){return t[1]}function As(){var t,i,n,o=0,a=0,s=1,r=1,l=ws,h=Ss;function c(t){var e,o={},a=[],s=t.length;for(e=0;e<s;++e)if(!isNaN(c=+l.call(null,r=t[e],e,t))&&!isNaN(u=+h.call(null,r,e,t))){var r,c,u,p=Math.round(u/=n),d=Math.round(c=c/i-(1&p)/2),f=u-p;if(3*Math.abs(f)>1){var y=c-d,_=d+(c<d?-1:1)/2,x=p+(u<p?-1:1),m=c-_,g=u-x;y*y+f*f>m*m+g*g&&(d=_+(1&p?1:-1)/2,p=x)}var b=d+"-"+p,v=o[b];v?v.push(r):(a.push(v=o[b]=[r]),v.x=(d+(1&p)/2)*i,v.y=p*n)}return a}function u(t){var e=0,i=0;return vs.map(function(n){var o=Math.sin(n)*t,a=-Math.cos(n)*t,s=o-e,r=a-i;return e=o,i=a,[s,r]})}return e(c,"hexbin"),e(u,"hexagon"),c.hexagon=function(e){return"m"+u(null==e?t:+e).join("l")+"z"},c.centers=function(){for(var e=[],l=Math.round(a/n),h=Math.round(o/i),c=l*n;c<r+t;c+=n,++l)for(var u=h*i+(1&l)*i/2;u<s+i/2;u+=i)e.push([u,c]);return e},c.mesh=function(){var e=u(t).slice(0,4).join("l");return c.centers().map(function(t){return"M"+t+"m"+e}).join("")},c.x=function(t){return arguments.length?(l=t,c):l},c.y=function(t){return arguments.length?(h=t,c):h},c.radius=function(e){return arguments.length?(i=2*(t=+e)*Math.sin(bs),n=1.5*t,c):t},c.size=function(t){return arguments.length?(o=a=0,s=+t[0],r=+t[1],c):[s-o,r-a]},c.extent=function(t){return arguments.length?(o=+t[0][0],a=+t[0][1],s=+t[1][0],r=+t[1][1],c):[[o,a],[s,r]]},c.radius(1)}e(ws,"pointX"),e(Ss,"pointY"),e(As,"d3HexBin");const ks=class _HexBin extends be{_hexbin;_dataMinWeight;_dataMaxWeight;constructor(){super(),r.call(this),this.tooltipValueFormat_default(",.0f"),o.call(this),this.tooltipHTML(t=>{const e=T(t,t=>t.label),i=T(t,t=>t.value);return this.tooltipFormat({series:e[0]===e[1]?e[0]:`${e[0]} -> ${e[1]}`,label:i[0]===i[1]?i[0]:`${i[0]} -> ${i[1]}`,value:t.length})}),this._hexbin=As().x(t=>t.x).y(t=>t.y),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i);const n=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._hexbin.extent([0,0],[this.width(),this.height()]).radius(this.binSize());const o=this.flattenData().map(e=>({x:n.xPos(t,e),y:n.yPos(t,e),label:t.parseData(e.label),value:t.parseValue(e.value),origRow:e})),a=this._hexbin(o),s=k(a,function(t){return t.length}),r=M(a,function(t){return t.length});this._dataMinWeight=s,this._dataMaxWeight=r;const l=e.selectAll(".hexagon").data(a,function(t){return t.i+"_"+t.j});l.enter().append("path").attr("class","hexagon").call(t._selection.enter.bind(t._selection)).on("click",function(e){const i=n.data();n.click(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),n.columns()[1],t._selection.selected(this))}).on("dblclick",function(e){const i=n.data();n.dblclick(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),n.columns()[1],t._selection.selected(this))}).on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).merge(l).transition().duration(i).attr("d",this._hexbin.hexagon()).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(1)"}).style("fill",function(t){return n._palette(t.length,s,r)}),l.exit().transition().duration(i).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).remove()}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}};e(ks,"HexBin"),i(ks,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let Ms=ks;Ms.prototype._class+=" chart_HexBin",Ms.prototype.implements(r.prototype),Ms.prototype.implements(o.prototype),Ms.prototype.publish("paletteID","Blues","set","Color palette for this widget",Ms.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ms.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ms.prototype.publish("binSize",20,"number","Bin radius",null,{range:{min:1,max:300,step:1}});const Ps=class _Line extends we{constructor(){super(),this.interpolate_default("linear")}};e(Ps,"Line");let Ts=Ps;Ts.prototype._class+=" chart_Line";const Cs=class _QuarterPie extends fs{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i="left"===this.orientation()?0:this._size.width,n=this._size.height;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle("left"===this.orientation()?0:-Math.PI/2).endAngle("left"===this.orientation()?Math.PI/2:0)}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t})),"Verdana",12).width;return Math.min(this._size.width-t-10,this._size.height-36)-2}};e(Cs,"QuarterPie");let zs=Cs;zs.prototype._class+=" chart_QuarterPie",zs.prototype.publish("orientation","left","set","Determines the placement and start/end angle.",["left","right"]);const Fs=class _QuartileCandlestick extends l{_g;_leftLine;_rightLine;_midLine;_midOuterRect;_midInnerRect1;_midInnerRect2;_q0text;_q1text;_q2text;_q3text;_q4text;_q0val;_q1val;_q2val;_q3val;_q4val;constructor(){super()}enter(t,e){super.enter(t,e),this._g=e.append("g"),this._leftLine=this._g.append("rect"),this._rightLine=this._g.append("rect"),this._midLine=this._g.append("rect"),this._midOuterRect=this._g.append("rect"),this._midInnerRect1=this._g.append("rect"),this._midInnerRect2=this._g.append("rect"),this._q0text=this._g.append("text"),this._q1text=this._g.append("text"),this._q2text=this._g.append("text"),this._q3text=this._g.append("text"),this._q4text=this._g.append("text"),this._q0val=this._g.append("text"),this._q1val=this._g.append("text"),this._q2val=this._g.append("text"),this._q3val=this._g.append("text"),this._q4val=this._g.append("text")}update(t,e){super.update(t,e);const i=("horizontal"===this.orientation()?this.width():this.height())-this.lineWidth(),n="horizontal"===this.orientation()?this.height():this.width(),o=_().domain([this.data()[0],this.data()[4]]).range([this.edgePadding(),i-this.edgePadding()]),a=this.candleWidth_exists()?this.candleWidth():n,s=this.lineWidth(),r=this.lineColor(),l=this.roundedCorners(),h=this.edgePadding();let c=o(this.data()[1]),u=o(this.data()[2]),p=o(this.data()[3]);const d=-a/2,f=a/2,y=this.upperTextRotation(),x=this.lowerTextRotation(),m=this.textPadding(),g=this.labelFontSize(),b=this.valueFontSize(),v=Math.max(g,b),w=i-h;if(v>0){for(;c-h<v;)c+=v;for(;u-c<v;)u+=v;for(;p-u<v;)p+=v;for(;w-p<v;)p-=v;for(;p-u<v;)u-=v;for(;u-c<v;)c-=v}let S=-i/2-this.lineWidth()/2,A=0,k=0;let M=1,P="start",T="end";"vertical"===this.orientation()&&(S=0,A=i/2+this.lineWidth()/2,k=-90,P="end",T="start",M=-1),this._g.style("shape-rendering","crispEdges").attr("transform",`translate(${S},${A})rotate(${k})scale(1)`),this._leftLine.attr("fill",r).attr("height",a).attr("width",s).attr("x",h).attr("y",d).attr("rx",l).attr("ry",l),this._rightLine.attr("class","right-line").attr("fill",r).attr("height",a).attr("width",s).attr("x",w).attr("y",d).attr("rx",l).attr("ry",l),this._midLine.attr("fill",r).attr("height",s).attr("width",w-h).attr("x",h).attr("y",-s/2),this._midOuterRect.attr("fill",r).attr("height",a).attr("width",p-c).attr("x",c).attr("y",d).attr("rx",l).attr("ry",l),this._midInnerRect1.attr("fill",this.innerRectColor()).attr("height",a-2*s).attr("width",u-(c+2*s)).attr("x",c+s).attr("y",s-a/2).attr("rx",.618*l).attr("ry",.618*l),this._midInnerRect2.attr("fill",this.innerRectColor()).attr("height",a-2*s).attr("width",p-u-s).attr("x",u).attr("y",s-a/2).attr("rx",.618*l).attr("ry",.618*l),this._q0text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${h}, ${d-m})rotate(${y})scale(${M})`).attr("font-size",g).attr("text-anchor",P).attr("alignment-baseline","hanging").text(this.columns()[0]),this._q1text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${d-m})rotate(${y})scale(${M})`).attr("font-size",g).attr("text-anchor",P).attr("alignment-baseline","middle").text(this.columns()[1]),this._q2text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${d-m})rotate(${y})scale(${M})`).attr("font-size",g).attr("text-anchor",P).attr("alignment-baseline","middle").text(this.columns()[2]),this._q3text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${d-m})rotate(${y})scale(${M})`).attr("font-size",g).attr("text-anchor",P).attr("alignment-baseline","middle").text(this.columns()[3]),this._q4text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${w+s}, ${d-m})rotate(${y})scale(${M})`).attr("font-size",g).attr("text-anchor",P).attr("alignment-baseline","baseline").text(this.columns()[4]),this._q0val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${h}, ${f+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","hanging").text(this.data()[0]),this._q1val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${f+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[1]),this._q2val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${f+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[2]),this._q3val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${f+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[3]),this._q4val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${w+s}, ${f+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","baseline").text(this.data()[4])}};e(Fs,"QuartileCandlestick");let Is=Fs;Is.prototype._class+=" chart_QuartileCandlestick",Is.prototype.publish("textColor","black","html-color","Color of label and value text"),Is.prototype.publish("showLabels",!0,"boolean","If true, labels will be shown"),Is.prototype.publish("showValues",!0,"boolean","If true, values will be shown"),Is.prototype.publish("orientation","horizontal","set","Determines layout",["horizontal","vertical"]),Is.prototype.publish("valueFontSize",12,"number","Font size of value text (pixels)"),Is.prototype.publish("labelFontSize",12,"number","Font size of label text (pixels)"),Is.prototype.publish("roundedCorners",8,"number","Radius of rounded rect corners (pixels)"),Is.prototype.publish("lineWidth",4,"number","Width of lines (pixels)"),Is.prototype.publish("candleWidth",null,"number","Height of outer rect (pixels)",null,{optional:!0}),Is.prototype.publish("textPadding",8,"number","Padding between outer rect and text (pixels)"),Is.prototype.publish("edgePadding",30,"number","Padding between outer rect and left/right sides (pixels)"),Is.prototype.publish("lineColor","#333","html-color","Color of outer rect and lines"),Is.prototype.publish("innerRectColor","white","html-color","Color of the inner rects"),Is.prototype.publish("upperTextRotation",-60,"number","Rotation of label text (degrees)"),Is.prototype.publish("lowerTextRotation",-60,"number","Rotation of value text (degrees)");const Es=class _Radar extends l{constructor(){super(),n.call(this),o.call(this),m.SimpleSelectionMixin.call(this)}mapShape(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}setPointAttributes(t,e,i){const n=this;switch(this.mapShape(this.pointShape())){case"rect":t.attr("width",n.pointSize()).attr("height",n.pointSize()).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"circle":t.attr("r",n.pointSize()/2).attr("cx",e).attr("cy",i).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"path":const o=n.pointSize()/2;t.attr("d",function(t){return"M"+(e-o)+" "+(i-o)+" L"+(e+o)+" "+(i+o)+" M"+(e-o)+" "+(i+o)+" L"+(e+o)+" "+(i-o)}).style("stroke",t=>this.strokeColor(t.data,t.column,t.value))}}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t.label,series:t.column,value:t.value}))}update(t,e){super.update(t,e),this._palette=this._palette.switch(this.paletteID());const i=this,n=this.height()/2,o=this.width()/2,a=this.columns(),s=this.data(),r=this.flattenData(a,s).map((t,e)=>(t.shape=this.mapShape(this.pointShape()),t.column=a[t.colIdx],t.row=s[e],t)),l=[],c=this.degrees2radians(360/this.data().length),u=this.fontSize();let p=0;r.filter(t=>1===t.colIdx).forEach(t=>{const e=super.textSize(t.label,`${this.fontFamily()}`,this.fontSize());p<e.width&&(p=e.width)});const d=Math.min(n-u,o-p),f=e.selectAll(".label").data(r.filter(t=>1===t.colIdx)),y=Math.max.apply(i,r.map(t=>t.value));f.enter().append("text").attr("class","label").attr("text-anchor","middle").merge(f).attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).each(function(t,e){const n=i.polar2cartesian(d,e*c-Math.PI/2);l.push(n.map(t=>t*i.labelPaddingRatio()));let o="middle";const a=Math.round(n[0]);o=a>0?"start":o,o=a<0?"end":o,h(this).attr("text-anchor",o).attr("x",n[0]).attr("y",n[1])}).text(t=>t.label),f.exit().remove();const _=e.selectAll(".domain").data(r.filter(t=>1===t.colIdx));_.enter().append("line").classed("domain",!0).style("stroke","#000").style("stroke-opacity","0.75").style("stroke-width","1px").merge(_).attr("x1",0).attr("y1",0).attr("x2",(t,e)=>l[e][0]).attr("y2",(t,e)=>l[e][1]),_.exit().remove();const x=e.selectAll(".value_guide").data(this.valueGuideRatios());x.enter().append("polygon").classed("value_guide",!0).style("stroke","grey").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(x).each(function(t,e){const i=[];l.forEach((e,n)=>{i.push([e[0]*t,e[1]*t])}),h(this).attr("points",i.join(" ")).attr("stroke","rgb(0, 0, 0)").attr("stroke-opacity",.75).attr("stroke-width",.3).attr("fill-opacity",0)}),x.exit().remove();const m=e.selectAll(".value_guide_text").data(this.valueGuideRatios());m.enter().append("text").attr("class","value_guide_text").attr("text-anchor","start").attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).merge(m).attr("x",2).attr("y",t=>l[0][1]*t).text((t,e)=>Math.round(t*y)),x.exit().remove();const g=e.selectAll(".area").data(a.filter((t,e)=>e>0));g.enter().append("polygon").attr("class","area").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(g).style("stroke",t=>this.strokeColor([],t,0)).style("fill",t=>this.fillColor([],t,0)).style("fill-opacity",this.fillOpacity()).attr("points",(t,e)=>l.map((t,i)=>{const n=s[i][e+1],o=0===n?0:n/y;return t[0]*o+","+t[1]*o}).join(" ")),g.exit().remove();const b=e.selectAll(".point").data(r);b.enter().append("g").attr("class","point").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).on("click",function(t,e){const n=i.data()[t.rowIdx],o=i.rowToObj(n),a=i._selection.selected(this);i.click(o,i.columns()[t.colIdx],a)}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(i.data()[t.rowIdx]),t.column,i._selection.selected(this))}).each(function(t){const e=h(this);e.append("circle").attr("class","pointSelection").attr("r",i.pointSize()).call(i._selection.enter.bind(i._selection)),e.append(i.mapShape(i.pointShape())).attr("class","pointShape")}).merge(b).each(function(t){const e=h(this),n=0===t.value?0:t.value/y,o=l[t.rowIdx][0]*n,a=l[t.rowIdx][1]*n;e.select(".pointSelection").attr("cx",o).attr("cy",a);const s=e.select(".pointShape").style("stroke",i.strokeColor(t.row,t.column,t.value)).style("fill",i.fillColor(t.row,t.column,t.value));i.setPointAttributes(s,o,a)}),b.exit().remove()}polar2cartesian(t,e){return[t*Math.cos(e),t*Math.sin(e)]}cartesian2polar(t,e){return[Math.atan2(e,t),Math.sqrt(t*t+e*e)]}degrees2radians(t){return t/57.295779513}radians2degrees(t){return 57.295779513*t}point_in_polygon(t,e){const i=t[0],n=t[1];let o=!1;for(let a=0,s=e.length-1;a<e.length;s=a++){const t=e[a][0],r=e[a][1],l=e[s][0],h=e[s][1];r>n!=h>n&&i<(l-t)*(n-r)/(h-r)+t&&(o=!o)}return o}};e(Es,"Radar");let Rs=Es;Rs.prototype._class+=" chart_Radar",Rs.prototype.implements(n.prototype),Rs.prototype.implements(o.prototype),Rs.prototype.mixin(m.SimpleSelectionMixin),Rs.prototype.publish("paletteID","default","set","Color palette for this widget",Rs.prototype._palette.switch()),Rs.prototype.publish("pointShape","cross","set","pointShape",["circle","rectangle","cross"]),Rs.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),Rs.prototype.publish("valueGuideRatios",[.2,.4,.6,.8,1],"array","Array of values between 0 and 1 that are multiplied by the widget radius to produce guide lines"),Rs.prototype.publish("fillOpacity",.66,"number","Opacity of the data polygon(s)"),Rs.prototype.publish("fontFamily","","string","fontFamily"),Rs.prototype.publish("fontSize",16,"number","fontSize"),Rs.prototype.publish("labelPaddingRatio",.9,"number","labelPaddingRatio");const Ds=class _RadialBar extends l{_domainScale=x();_valueScale=_();_d3Arc=At().startAngle(0).endAngle(t=>this._valueScale(t[1]));_arcs;_axialAxis;_radialAxis;constructor(){super(),n.call(this),o.call(this),m.SimpleSelectionMixin.call(this)}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t[0],value:t[1]})),this._radialAxis=e.append("g").attr("class","r axis"),this._axialAxis=e.append("g").attr("class","a axis"),this._arcs=e.append("g").attr("class","data")}update(t,e){super.update(t,e);const i=this,n=Math.max(this.valueDomainHigh_exists()?this.valueDomainHigh():0,...this.data().map(t=>t[1]));this._valueScale.domain([0,n]).range([0,this.radians(this.valueMaxAngle())]);const o=this._valueScale.ticks(this.tickCount()),a=this.textSize(o.map(t=>""+t),"Verdana",12).width,s=Math.min(this.width()-2*(10+a),this.height()-44)/2,r=this.data().map(t=>t[0]);this._domainScale.domain(r).range([0,s]).padding(this.domainPadding());const l=this._domainScale.step()*this._domainScale.padding(),h=this._radialAxis.selectAll("circle").data(r);h.enter().append("circle").attr("fill","transparent").merge(h).attr("r",t=>this._domainScale(t)+this._domainScale.step()-l/2),h.exit().remove();const c=this._radialAxis.selectAll(".arc-text").data(r);c.enter().append("text").attr("class","arc-text").attr("x",-4).attr("alignment-baseline","middle").attr("text-anchor","end").merge(c).attr("y",t=>-this._domainScale(t)-this._domainScale.bandwidth()/2).text(t=>t),c.exit().remove();const u=this._axialAxis.selectAll("line").data(o);u.enter().append("line").merge(u).attr("x2",t=>s*Math.cos(this._valueScale(t)-this.radians(90))).attr("y2",t=>s*Math.sin(this._valueScale(t)-this.radians(90))),u.exit().remove();const p=this._axialAxis.selectAll("text").data(o);p.enter().append("text").style("dominant-baseline","central").merge(p).attr("x",t=>(s+10)*Math.cos(this._valueScale(t)-this.radians(90))).attr("y",t=>(s+10)*Math.sin(this._valueScale(t)-this.radians(90))).style("text-anchor",t=>{const e=this.degrees(this._valueScale(t));return e>=0&&e<=20||e>=160&&e<=200||e>=340&&e<=360?"middle":e>=180&&e<=360?"end":null}).text(t=>t),p.exit().remove();const d=this.columns().length>1?this.columns()[1]:"";this._d3Arc.innerRadius(t=>this._domainScale(t[0])).outerRadius(t=>this._domainScale(t[0])+this._domainScale.bandwidth());const f=this._arcs.selectAll("path").data(this.data(),t=>t[0]);f.enter().append("path").attr("class","arc").call(this._selection.enter.bind(this._selection)).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("click",function(t,e){i.click(i.rowToObj(t),d,i._selection.selected(this))}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(t),d,i._selection.selected(this))}).merge(f).style("fill",(t,e)=>this.fillColor(t,t[0],t[1])).transition().delay((t,e)=>e*this.transitionDelay()).duration(this.transitionDuration()).attrTween("d",(t,e)=>{const i=$(t._current||0,t[1]);return t._current=t[1],n=>this._d3Arc([t[0],i(n)],e)}),f.exit().remove()}degrees(t){return 180*t/Math.PI}radians(t){return t*Math.PI/180}};e(Ds,"RadialBar"),i(Ds,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number"}]);let Os=Ds;Os.prototype._class+=" chart_RadialBar",Os.prototype.implements(n.prototype),Os.prototype.implements(o.prototype),Os.prototype.mixin(m.SimpleSelectionMixin),Os.prototype.publish("paletteID","default","set","Color palette for this widget",Os.prototype._palette.switch()),Os.prototype.publish("tickCount",10,"number","Number of ticks to display"),Os.prototype.publish("domainPadding",.25,"number","Padding between chart edge and container edge (0..1)"),Os.prototype.publish("valueMaxAngle",270,"number","Maximum angular length of a bar (degrees)"),Os.prototype.publish("valueDomainHigh",null,"number","Value domain high",void 0,{optional:!0}),Os.prototype.publish("transitionDelay",100,"number","Delay between the start of each row animation (ms)"),Os.prototype.publish("transitionDuration",750,"number","Duration of a row's animation (ms)");const js=H.rainbow("Blues"),Ns=H.ordinal("Quartile",[js(100,0,100),js(50,0,100),js(50,0,100),js(75,0,100)]);function Ls(t){const e=f(t);return function(t){const i=(Math.round(100*t)/100).toString();return i.length<=4?i:e(t)}}Ns("Std. Dev."),Ns("MinMax"),Ns("25%"),Ns("50%"),e(Ls,"myFormatter");const Bs=class _StatChart extends E{_selectElement;_tickFormatter;_bellCurve=(new we).columns(["","Std. Dev."]).paletteID("Quartile").interpolate_default("basis").pointSize(0).xAxisType("linear").xAxisOverlapMode("none").xAxisTickFormat(",").yAxisHidden(!0).yAxisDomainLow(0).yAxisDomainHigh(110).yAxisGuideLines(!1);_candle=(new Is).columns(["Min","25%","50%","75%","Max"]).edgePadding(0).roundedCorners(1).lineWidth(1).upperTextRotation(-90).lowerTextRotation(-90).labelFontSize(0).valueFontSize(0).lineColor(js(90,0,100)).innerRectColor(js(10,0,100));constructor(){super(),this.columns(["Min","25%","50%","75%","Max","Mean","Std. Dev."])}stdDev(t){return this.mean()+t*this.standardDeviation()}formatStdDev(t){return this._tickFormatter(this.stdDev(t))}quartile(t){return this.quartiles()[t]}formatQ(t){return this._tickFormatter(this.quartile(t))}domain(t){switch(t){case"25_75":return[this.quartile(1),this.quartile(3)];case"normal":return[this.stdDev(-4),this.stdDev(4)];default:return[this.quartile(0),this.quartile(4)]}}min(){return this.quartile(0)}max(){return this.quartile(4)}data(t){if(!arguments.length)return[[...this.quartiles(),this.mean(),this.standardDeviation()]];const e=t[0];return this.quartiles([e[0],e[1],e[2],e[3],e[4]]),this.mean(e[5]),this.standardDeviation(e[6]),this}enter(t,e){super.enter(t,e),this._bellCurve.target(e.append("div").node()),this._candle.target(e.append("div").node()),this._selectElement=e.append("div").style("position","absolute").style("top","0px").style("right","0px").append("select").on("change",()=>{this.view(this._selectElement.node().value),this.lazyRender()}),this._selectElement.append("option").attr("value","min_max").text("Min / Max"),this._selectElement.append("option").attr("value","25_75").text("25% / 75%"),this._selectElement.append("option").attr("value","normal").text("Normal")}bellTicks(t){let e;switch(t){case"25_75":e=[{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)}];break;case"normal":e=[{label:this.formatStdDev(-4),value:this.stdDev(-4)},{label:"-3σ",value:this.stdDev(-3)},{label:"-2σ",value:this.stdDev(-2)},{label:"-1σ",value:this.stdDev(-1)},{label:this.formatStdDev(0),value:this.stdDev(0)},{label:"+1σ",value:this.stdDev(1)},{label:"+2σ",value:this.stdDev(2)},{label:"+3σ",value:this.stdDev(3)},{label:this.formatStdDev(4),value:this.stdDev(4)}];break;default:e=[{label:this.formatQ(0),value:this.quartile(0)},{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)},{label:this.formatQ(4),value:this.quartile(4)}]}const[i,n]=this.domain(this._selectElement.node().value);return e.filter(t=>t.value>=i&&t.value<=n).map(t=>({label:t.label,value:t.value.toString()}))}updateScatter(){const t=this._selectElement.node().value,[e,i]=this.domain(t),n=(i-e)*(this.domainPadding()/100);this._bellCurve.xAxisDomainLow(e-n).xAxisDomainHigh(i+n).xAxisTicks(this.bellTicks(t)).data([[this.stdDev(-4),0],[this.stdDev(-3),.3],[this.stdDev(-2),5],[this.stdDev(-1),68],[this.stdDev(0),100],[this.stdDev(1),68],[this.stdDev(2),5],[this.stdDev(3),.3],[this.stdDev(4),0]]).resize({width:this.width(),height:this.height()-this.candleHeight()}).render()}updateCandle(){const t=this._bellCurve.dataPos(this.quartile(0)),e=this._bellCurve.dataPos(this.quartile(4))-t;this._candle.resize({width:this.width(),height:this.candleHeight()}).pos({x:t+e/2+2,y:this.candleHeight()/2}).width(e).candleWidth(this.candleHeight()).data(this.quartiles()).render()}update(t,e){super.update(t,e),this._tickFormatter=Ls(this.tickFormat()),this._selectElement.node().value=this.view(),this.updateScatter(),this.updateCandle()}exit(t,e){this._bellCurve.target(null),this._candle.target(null),this._selectElement.remove(),super.exit(t,e)}};e(Bs,"StatChart");let $s=Bs;$s.prototype._class+=" chart_StatChart",$s.prototype.publish("view","min_max","set","View",["min_max","25_75","normal"]),$s.prototype.publish("tickFormat",".2e","string","X-Axis Tick Format"),$s.prototype.publish("candleHeight",20,"number","Height of candle widget (pixels)"),$s.prototype.publish("domainPadding",10,"number","Domain value padding"),$s.prototype.publish("mean",.5,"number","Mean"),$s.prototype.publish("standardDeviation",.125,"number","Standard Deviation (σ)"),$s.prototype.publish("quartiles",[0,.25,.5,.75,1],"object","Quartiles (Min, 25%, 50%, 75%, Max)");const Hs=class _Step extends we{constructor(){super(),this.interpolate_default("step")}};e(Hs,"Step");let Vs=Hs;Vs.prototype._class+=" chart_Step";const qs="text",Ws="html",Gs=class _Summary extends E{_playIntervalIdx=0;_mainDiv;_headerDiv;_textDiv;constructor(){super(),this._tag="div",this._drawStartPos="center",this.playInterval(this.playInterval())}lookupFieldIdx(t,e){let i=e;if(!(this[t+"_exists"]()&&(i=this.columns().indexOf(this[t]()),i<0)))return i}lookupFieldText(t,e){return this[t+"_exists"]()?this[t]():void 0!==e&&this.columns()[e]||""}currentRow(){return this.data()[this._playIntervalIdx]}summaryData(){let t;this.hideLabel()||(t=this.lookupFieldIdx("labelColumn",0));const e=this.lookupFieldIdx("iconColumn"),i=this.lookupFieldIdx("valueColumn",1);let n,o;this.hideMore()||(n=this.lookupFieldIdx("moreIconColumn"),o=this.lookupFieldIdx("moreTextColumn"));const a=this.lookupFieldIdx("colorFillColumn"),s=this.lookupFieldIdx("colorStrokeColumn");return this.formattedData().map(function(r){return{icon:void 0===e?this.icon():r[e],label:void 0===t?"":r[t],value:r[i],moreIcon:void 0===n?this.hideMore()?"":this.moreIcon():r[n],moreText:void 0===o?this.hideMore()?"":this.moreText():r[o],fill:void 0===a?this.colorFill():r[a],stroke:void 0===s?this.colorStroke():r[s]}},this)}enter(t,e){super.enter(t,e),this._mainDiv=e.append("div");const i=this;this._headerDiv=this._mainDiv.append("h2").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}),this._textDiv=this._mainDiv.append("div").attr("class","text").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)})}update(t,e){super.update(t,e),this.data().length;const i=this.summaryData();this._playIntervalIdx>=i.length&&(this._playIntervalIdx=0);const n=this._playIntervalIdx<i.length?i[this._playIntervalIdx]:["",""];e.style("width",this.fixedSize()?this.minWidth_exists()?this.minWidth()+"px":null:"100%").style("height",this.fixedSize()?this.minHeight_exists()?this.minHeight()+"px":null:"100%"),this._mainDiv.attr("class","content bgIcon "+n.icon).transition().style("background-color",n.fill).style("color",n.stroke).style("min-width",this.minWidth_exists()?this.minWidth()+"px":null).style("min-height",this.minHeight_exists()?this.minHeight()+"px":null).style("font-size",this.iconFontSize()+"px"),this._headerDiv.transition().style("color",n.stroke).style("font-size",this.headerFontSize()+"px")[this.valueHTML()?Ws:qs](n.value),this._textDiv.style("font-size",this.textFontSize()+"px")[this.labelHTML()?Ws:qs](n.label);const o=this,a=this._mainDiv.selectAll(".more").data([n]),s=a.enter().append("div").attr("class","more").on("click",function(t){o.click(o.rowToObj(o.currentRow()),o.lookupFieldText("moreTextColumn")||"more",!0)}).each(function(){const t=h(this);t.append("i"),t.append("span")}).merge(a).style("display",this.hideMoreWrapper()?"none":null).style("font-size",this.moreFontSize()+"px").style("height",this.moreWrapperHeight_exists()?this.moreWrapperHeight()+"px":null).transition().style("background-color",V(n.fill).darker(.75).toString());s.select("i").attr("class",function(t){return"fa "+t.moreIcon}),this.moreTextHTML()?s.select("span").each(function(t){this.innerHTML=t.moreText}):s.select("span").text(t=>t.moreText),a.exit().remove()}exit(t,e){super.exit(t,e)}};e(Gs,"Summary");let Xs=Gs;Xs.prototype._class+=" chart_Summary",Xs.prototype.implements(a.prototype),Xs.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),Xs.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:/* @__PURE__ */e(t=>t.iconColumn(),"disable")}),Xs.prototype.publish("headerFontSize",null,"number","headerFontSize"),Xs.prototype.publish("textFontSize",null,"number","textFontSize"),Xs.prototype.publish("moreFontSize",null,"number","moreFontSize"),Xs.prototype.publish("iconFontSize",null,"number","iconFontSize"),Xs.prototype.publish("hideLabel",!1,"boolean","Hide label column"),Xs.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:/* @__PURE__ */e(t=>t.hideLabel(),"disable")}),Xs.prototype.publish("labelHTML",!1,"boolean","Allow HTML",null,{disable:/* @__PURE__ */e(t=>t.hideLabel(),"disable")}),Xs.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),Xs.prototype.publish("valueHTML",!1,"boolean","Allow HTML"),Xs.prototype.publish("hideMore",!1,"boolean","Hide More Information"),Xs.prototype.publish("hideMoreWrapper",!1,"boolean","Hide More Information Wrapper"),Xs.prototype.publish("moreWrapperHeight",null,"number","Height of the 'more' text wrapper (pixels)"),Xs.prototype.publish("moreIconColumn",null,"set","Select More Icon Column",function(){return this.columns()},{optional:!0,disable:/* @__PURE__ */e(t=>t.hideMore(),"disable")}),Xs.prototype.publish("moreIcon","fa-info-circle","string","FA Char icon class",null,{disable:/* @__PURE__ */e(t=>t.hideMore()||t.moreIconColumn(),"disable")}),Xs.prototype.publish("moreTextColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:/* @__PURE__ */e(t=>t.hideMore(),"disable")}),Xs.prototype.publish("moreText","More Info","string","More text",null,{disable:/* @__PURE__ */e(t=>t.hideMore()||t.moreTextColumn(),"disable")}),Xs.prototype.publish("moreTextHTML",!1,"boolean","Allow HTML",null,{disable:/* @__PURE__ */e(t=>t.hideMore(),"disable")}),Xs.prototype.publish("colorFillColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),Xs.prototype.publish("colorFill","#3498db","html-color","Fill Color",null,{disable:/* @__PURE__ */e(t=>t.colorFillColumn(),"disable")}),Xs.prototype.publish("colorStrokeColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),Xs.prototype.publish("colorStroke","#ffffff","html-color","Fill Color",null,{disable:/* @__PURE__ */e(t=>t.colorStrokeColumn(),"disable")}),Xs.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),Xs.prototype.publish("minWidth",225,"number","Minimum Width"),Xs.prototype.publish("minHeight",150,"number","Minimum Height"),Xs.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0});const Ys=Xs.prototype.playInterval;Xs.prototype.playInterval=function(t){const e=Ys.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const Us=class _SummaryC extends q{_playIntervalIdx=0;constructor(){super(),a.call(this),this.playInterval(this.playInterval())}currentRow(){return this.data()[this._playIntervalIdx]}enter(t,e){super.enter.apply(this,arguments);const{width:i,height:n}=this.size();t.height=n,t.width=i}update(t,i){super.update.apply(this,arguments);const n=this;this._playIntervalIdx>=this.data().length&&(this._playIntervalIdx=0);const o=this.size(),a=Math.min(o.width,o.height),s=this.fontSizeRatio(),r=this.columns().indexOf(this.labelColumn()),l=this.columns().indexOf(this.valueColumn()),h=this.columns().indexOf(this.colorFillColumn()),c=this.columns().indexOf(this.colorStrokeColumn()),u=this.columns().indexOf(this.iconColumn()),p=-1!==u?this.currentRow()[u]:this.icon(),d=-1!==r?this.currentRow()[r]:"",f=-1!==l?this.currentRow()[l]:"",y=-1!==h?this.currentRow()[h]:this.colorFill(),_=-1!==c?this.currentRow()[c]:this.colorStroke();let x=o.height*(s-this.paddingSizeRatio());const g=o.height*(1-s-this.paddingSizeRatio()),b=o.height*(this.iconSizeRatio()-this.paddingSizeRatio()),v=a*this.paddingSizeRatio(),w=t.getContext("2d");w.clearRect(0,0,o.width,o.height);const S=n.fontFamily();function A(t,e,i,n){w.textBaseline="top",w.font=`${i}px ${S}`,w.fillStyle=_;let a=w.measureText(t);if(a.width>o.width-2*v){i*=(o.width-2*v)/a.width,w.font=`${i}px ${S}`,a=w.measureText(t)}const s=M(a.width,n);return w.fillText(t,s,e),i}function k(t,e,i){if(void 0===t)return;w.textBaseline=n.iconBaseline(),w.font=`${e}px FontAwesome`,w.fillStyle=_;let a=w.measureText(t);if(a.width>o.width-2*v){const i=(o.width-2*v)/a.width;w.font=e*i+"px FontAwesome",a=w.measureText(t)}const s=M(a.width,i),r=P(n.iconBaseline());w.fillText(t,s,r)}function M(t,e){switch(e){case"start":return v;case"middle":return o.width/2-t/2;case"end":return o.width-t-v}}function P(t){switch(t){case"top":return v;case"middle":return o.height/2;case"bottom":return o.height-v}}w.fillStyle=y,w.fillRect(0,0,o.width,o.height),w.globalAlpha=this.iconOpacity(),k(m.faChar(p),b,n.iconAnchor()),w.globalAlpha=this.valueOpacity(),x=A(f,v,x,n.valueAnchor()),w.globalAlpha=this.labelOpacity(),A(d,x+v,g,n.labelAnchor()),e(A,"drawText"),e(k,"drawIcon"),e(M,"getTextOffsetX"),e(P,"getTextOffsetY")}};e(Us,"SummaryC");let Qs=Us;Qs.prototype._class+=" chart_SummaryC",Qs.prototype.implements(a.prototype),Qs.prototype.publish("iconBaseline","bottom","string","Text baseline for the icon",["top","middle","bottom"]),Qs.prototype.publish("iconAnchor","end","set","Anchors the icon either at the start, middle, or end of the summary",["start","middle","end"]),Qs.prototype.publish("valueAnchor","start","set","Anchors the value either at the start, middle, or end of the summary",["start","middle","end"]),Qs.prototype.publish("labelAnchor","start","set","Anchors the label either at the start, middle, or end of the summary",["start","middle","end"]),Qs.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),Qs.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:/* @__PURE__ */e(t=>t.iconColumn(),"disable")}),Qs.prototype.publish("fontFamily","Arial","string","Font Family"),Qs.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),Qs.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),Qs.prototype.publish("colorFillColumn",null,"set","Column for background color",function(){return this.columns()},{optional:!0}),Qs.prototype.publish("colorFill","#0097e6","html-color","Background Color",null,{disable:/* @__PURE__ */e(t=>t.colorFillColumn(),"disable")}),Qs.prototype.publish("colorStrokeColumn",null,"set","Column for font color",function(){return this.columns()},{optional:!0}),Qs.prototype.publish("colorStroke","#2f3640","html-color","Font Color",null,{disable:/* @__PURE__ */e(t=>t.colorStrokeColumn(),"disable")}),Qs.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),Qs.prototype.publish("minWidth",225,"number","Minimum Width"),Qs.prototype.publish("minHeight",150,"number","Minimum Height"),Qs.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0}),Qs.prototype.publish("fontSizeRatio",.618,"number","Ratio between widget height and value font size"),Qs.prototype.publish("valueOpacity",1,"number","Opacity of value text (0..1)"),Qs.prototype.publish("labelOpacity",.9,"number","Opacity of label text (0..1)"),Qs.prototype.publish("iconOpacity",.3,"number","Opacity of icon text (0..1)"),Qs.prototype.publish("paddingSizeRatio",.1,"number","Ratio of the smallest dimension for edge padding (0..1)"),Qs.prototype.publish("iconSizeRatio",.9,"number","Ratio of the height for icon size (0..1)");const Zs=Qs.prototype.playInterval;Qs.prototype.playInterval=function(t){const e=Zs.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const Js=Math.PI/180,Ks=2048;function tr(){const t=L("word","end"),i={};let n=[256,256],o=er,a=ir,s=or,r=nr,l=nr,h=ar,c=sr,u=[],p=ur,d=1/0,f=null,y=Math.random,_=fr;function x(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=Ks/e;const i=t.getContext("2d");return i.fillStyle=i.strokeStyle="red",i.textAlign="center",{context:i,ratio:e}}function m(t,e,i){const o=e.x,a=e.y,s=Math.sqrt(n[0]*n[0]+n[1]*n[1]),r=p(n),l=y()<.5?1:-1;let h,c,u,d=-l;for(;(h=r(d+=l))&&(c=~~h[0],u=~~h[1],!(Math.min(Math.abs(c),Math.abs(u))>=s));)if(e.x=o+c,e.y=a+u,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>n[0]||e.y+e.y1>n[1])&&(!i||!lr(e,t,n[0]))&&(!i||cr(e,i))){const i=e.sprite,o=e.width>>5,a=n[0]>>5,s=e.x-(o<<4),r=127&s,l=32-r,h=e.y1-e.y0;let c,u=(e.y+e.y0)*a+(s>>5);for(let e=0;e<h;e++){c=0;for(let n=0;n<=o;n++)t[u+n]|=c<<l|(n<o?(c=i[e*o+n])>>>r:0);u+=a}return delete e.sprite,!0}return!1}return i.canvas=function(t){return arguments.length?(_=yr(t),i):_},i.start=function(){const e=x(_()),p=dr((n[0]>>5)*n[1]);let g=null;const b=u.length;let v=-1;const w=[],S=u.map(function(t,e){return t.text=o.call(this,t,e),t.font=a.call(this,t,e),t.style=r.call(this,t,e),t.weight=l.call(this,t,e),t.rotate=h.call(this,t,e),t.size=~~s.call(this,t,e),t.padding=c.call(this,t,e),t}).sort(function(t,e){return e.size-t.size});return f&&clearInterval(f),f=setInterval(A,0),A(),i;function A(){const o=Date.now();for(;Date.now()-o<d&&++v<b&&f;){const o=S[v];o.x=n[0]*(y()+.5)>>1,o.y=n[1]*(y()+.5)>>1,rr(e,o,S,v),o.hasText&&m(p,o,g)&&(w.push(o),t.call("word",i,o),g?hr(g,o):g=[{x:o.x+o.x0,y:o.y+o.y0},{x:o.x+o.x1,y:o.y+o.y1}],o.x-=n[0]>>1,o.y-=n[1]>>1)}v>=b&&(i.stop(),t.call("end",i,w,g))}},i.stop=function(){return f&&(clearInterval(f),f=null),i},e(x,"getContext"),e(m,"place"),i.timeInterval=function(t){return arguments.length?(d=null==t?1/0:t,i):d},i.words=function(t){return arguments.length?(u=t,i):u},i.size=function(t){return arguments.length?(n=[+t[0],+t[1]],i):n},i.font=function(t){return arguments.length?(a=yr(t),i):a},i.fontStyle=function(t){return arguments.length?(r=yr(t),i):r},i.fontWeight=function(t){return arguments.length?(l=yr(t),i):l},i.rotate=function(t){return arguments.length?(h=yr(t),i):h},i.text=function(t){return arguments.length?(o=yr(t),i):o},i.spiral=function(t){return arguments.length?(p=_r[t]||t,i):p},i.fontSize=function(t){return arguments.length?(s=yr(t),i):s},i.padding=function(t){return arguments.length?(c=yr(t),i):c},i.random=function(t){return arguments.length?(y=t,i):y},i.on=function(){const e=t.on.apply(t,arguments);return e===t?i:e},i}function er(t){return t.text}function ir(){return"serif"}function nr(){return"normal"}function or(t){return Math.sqrt(t.value)}function ar(){return 30*(~~(6*Math.random())-3)}function sr(){return 1}function rr(t,e,i,n){if(e.sprite)return;const o=t.context,a=t.ratio;o.clearRect(0,0,2048/a,Ks/a);let s=0,r=0,l=0;const h=i.length;for(--n;++n<h;){e=i[n],o.save(),o.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;let t=o.measureText(e.text+"m").width*a,h=e.size<<1;if(e.rotate){const i=Math.sin(e.rotate*Js),n=Math.cos(e.rotate*Js),o=t*n,a=t*i,s=h*n,r=h*i;t=Math.max(Math.abs(o+r),Math.abs(o-r))+31>>5<<5,h=~~Math.max(Math.abs(a+s),Math.abs(a-s))}else t=t+31>>5<<5;if(h>l&&(l=h),s+t>=2048&&(s=0,r+=l,l=0),r+h>=Ks)break;o.translate((s+(t>>1))/a,(r+(h>>1))/a),e.rotate&&o.rotate(e.rotate*Js),o.fillText(e.text,0,0),e.padding&&(o.lineWidth=2*e.padding,o.strokeText(e.text,0,0)),o.restore(),e.width=t,e.height=h,e.xoff=s,e.yoff=r,e.x1=t>>1,e.y1=h>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,s+=t}const c=o.getImageData(0,0,2048/a,Ks/a).data,u=[];for(;--n>=0;){if(!(e=i[n]).hasText)continue;const t=e.width,o=t>>5;let a=e.y1-e.y0;for(let e=0;e<a*o;e++)u[e]=0;if(s=e.xoff,null==s)return;r=e.yoff;let l=0,h=-1;for(let i=0;i<a;i++){for(let e=0;e<t;e++){const t=o*i+(e>>5),n=c[2048*(r+i)+(s+e)<<2]?1<<31-e%32:0;u[t]|=n,l|=n}l?h=i:(e.y0++,a--,i--,r++)}e.y1=e.y0+h,e.sprite=u.slice(0,(e.y1-e.y0)*o)}}function lr(t,e,i){i>>=5;const n=t.sprite,o=t.width>>5,a=t.x-(o<<4),s=127&a,r=32-s,l=t.y1-t.y0;let h,c=(t.y+t.y0)*i+(a>>5);for(let u=0;u<l;u++){h=0;for(let t=0;t<=o;t++)if((h<<r|(t<o?(h=n[u*o+t])>>>s:0))&e[c+t])return!0;c+=i}return!1}function hr(t,e){const i=t[0],n=t[1];e.x+e.x0<i.x&&(i.x=e.x+e.x0),e.y+e.y0<i.y&&(i.y=e.y+e.y0),e.x+e.x1>n.x&&(n.x=e.x+e.x1),e.y+e.y1>n.y&&(n.y=e.y+e.y1)}function cr(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function ur(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function pr(t){const e=4*t[0]/t[1];let i=0,n=0;return function(t){const o=t<0?-1:1;switch(Math.sqrt(1+4*o*t)-o&3){case 0:i+=e;break;case 1:n+=4;break;case 2:i-=e;break;default:n-=4}return[i,n]}}function dr(t){const e=[];let i=-1;for(;++i<t;)e[i]=0;return e}function fr(){return document.createElement("canvas")}function yr(t){return"function"==typeof t?t:function(){return t}}e(tr,"d3Cloud"),e(er,"cloudText"),e(ir,"cloudFont"),e(nr,"cloudFontNormal"),e(or,"cloudFontSize"),e(ar,"cloudRotate"),e(sr,"cloudPadding"),e(rr,"cloudSprite"),e(lr,"cloudCollide"),e(hr,"cloudBounds"),e(cr,"collideRects"),e(ur,"archimedeanSpiral"),e(pr,"rectangularSpiral"),e(dr,"zeroArray"),e(fr,"cloudCanvas"),e(yr,"functor");const _r={archimedean:ur,rectangular:pr},xr=class _WordCloud extends l{_prevOffsetX;_prevOffsetY;_prevZoom;_root;_canvas;_d3Cloud;_d3Zoom;constructor(){super(),a.call(this),o.call(this),m.SimpleSelectionMixin.call(this),this._prevOffsetX=this.offsetX(),this._prevOffsetY=this.offsetY(),this._prevZoom=this.zoom()}calcData(){return this.data().map(t=>({__viz_label:t[0],__viz_weight:t[1],__viz_row:t}))}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this._root=e.append("g"),this._canvas=document.createElement("canvas");const i=this;this._d3Zoom=W().scaleExtent([.1,10]),this._d3Zoom.on("zoom",function(t){const e=S();e&&e.transform&&i.zoomed(i._d3Zoom,[e.transform.x,e.transform.y],e.transform.k)}),e.call(this._d3Zoom),this.tooltipHTML(function(t){const e=i.columns(),n=e&&e.length?e[0]:"Word";return i.tooltipFormat({label:t.__viz_label,series:n,value:t.__viz_weight})})}update(t,i){super.update(t,i),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._d3Cloud=tr().canvas(()=>this._canvas),this.zoomed(this,[this.offsetX(),this.offsetY()],this.zoom());const n=this.calcData(),o=this,a=T(n,function(t){return t.__viz_weight});let s;switch(this.scaleMode()){case"log":s=d;break;case"sqrt":s=P;break;case"pow":s=y;break;default:s=_}const r=s().domain(a).range([this.fontSizeFrom(),this.fontSizeTo()]),l=_().domain([0,o.angleCount()-1]).range([o.angleFrom(),o.angleTo()]);function h(t,e){const i=o._root.selectAll("text").data(t,function(t){return t.__viz_label?t.__viz_label.toLowerCase():""});i.enter().append("text").attr("text-anchor","middle").call(o._selection.enter.bind(o._selection)).text(function(t){return t.__viz_label}).on("click",function(t){o.click(o.rowToObj(t.__viz_row),o.columns()[1],o._selection.selected(this))}).on("dblclick",function(t){o.dblclick(o.rowToObj(t.__viz_row),o.columns()[1],o._selection.selected(this))}).on("mouseout.tooltip",o.tooltip.hide).on("mousemove.tooltip",o.tooltip.show).style("opacity",1e-6).merge(i).style("font-size",function(t){return r(t.__viz_weight)+"px"}).style("font-family",o.fontFamily()).transition().duration(1e3).attr("transform",function(t){return"translate("+[t.x,t.y]+")rotate("+t.rotate+")"}).style("fill",function(t){return o._palette(t.__viz_label?t.__viz_label.toLowerCase():"")}).style("opacity",1),i.exit().transition().duration(1e3).style("opacity",1e-4).remove()}this._d3Cloud.stop().size([this.width(),this.height()]).words(n).font(this.fontFamily()).padding(this.padding()).spiral(this.spiral()).text(function(t){return t.__viz_label.trim()}).fontSize(function(t){return r(t.__viz_weight)}).rotate((t,e)=>l(e%o.angleCount())).on("word",t=>{}).on("end",h).start(),e(h,"draw")}zoomed(t,e,i){if(e[0]!==this._prevOffsetX||e[1]!==this._prevOffsetY||i!==this._prevZoom){switch(this._root.attr("transform",e),t){case this:break;case this._d3Zoom:this.offsetX(e[0]),this.offsetY(e[1]),this.zoom(i)}this._prevOffsetX=e[0],this._prevOffsetY=e[1],this._prevZoom=i}}};e(xr,"WordCloud"),i(xr,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let mr=xr;function gr(){const t=p(".%L"),e=p(":%S"),i=p("%H:%M"),n=p("%H:00"),o=p("%b %d"),a=p("%b"),s=p("%Y");return r=>0!==r.getMilliseconds()?t(r):0!==r.getSeconds()?e(r):0!==r.getMinutes()?i(r):0!==r.getHours()?n(r):1!==r.getDate()?o(r):0!==r.getMonth()?a(r):s(r)}mr.prototype._class+=" chart_WordCloud",mr.prototype.implements(a.prototype),mr.prototype.implements(o.prototype),mr.prototype.mixin(m.SimpleSelectionMixin),mr.prototype.publish("paletteID","default","set","Color palette for this widget",mr.prototype._palette.switch(),{tags:["Basic","Shared"]}),mr.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),mr.prototype.publish("fontFamily","Impact","string","Font Name",null,{tags:["Basic"]}),mr.prototype.publish("fontSizeFrom",6,"number","Minimum font size (pixels)",null,{tags:["Basic"]}),mr.prototype.publish("fontSizeTo",48,"number","Maximum font size (pixels)",null,{tags:["Basic"]}),mr.prototype.publish("angleFrom",-60,"number","Minimum angle (degrees)",null,{tags:["Basic"]}),mr.prototype.publish("angleTo",60,"number","Maximum angle (degrees)",null,{tags:["Basic"]}),mr.prototype.publish("angleCount",5,"number","Number of different angles",null,{tags:["Basic"]}),mr.prototype.publish("padding",0,"number","Padding between words (pixels)",null,{tags:["Intermediate"]}),mr.prototype.publish("scaleMode","linear","set","Text scaling mode",["linear","log","sqrt","pow"],{tags:["Intermediate"]}),mr.prototype.publish("spiral","archimedean","set","Text scaling mode",["archimedean","rectangular"],{tags:["Intermediate"]}),mr.prototype.publish("offsetX",0,"number","X offset",null,{tags:["Advanced"]}),mr.prototype.publish("offsetY",0,"number","Y offset",null,{tags:["Advanced"]}),mr.prototype.publish("zoom",1,"number","Zoom",null,{tags:["Advanced"]}),e(gr,"multiScale24Hours");export{Ae as Area,me as Axis,Q as BUILD_VERSION,Te as Bar,bi as Bubble,wi as BubbleXY,Xi as Bullet,Me as Column,Co as Contour,Fo as Gantt,cs as Gauge,_s as HalfPie,ms as Heat,Ms as HexBin,Ts as Line,Y as PKG_NAME,U as PKG_VERSION,fs as Pie,zs as QuarterPie,Is as QuartileCandlestick,Rs as Radar,Os as RadialBar,we as Scatter,$s as StatChart,Vs as Step,Xs as Summary,Qs as SummaryC,mr as WordCloud,be as XYAxis,gr as multiScale24Hours};
10
10
  //# sourceMappingURL=index.js.map
11
- !function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".chart_Axis{fill:#000;font:10px sans-serif}.chart_Axis .axis .tick>text{font:10px sans-serif}.chart_Axis .axis path.domain,.chart_Axis .axis .tick line{fill:none;stroke:#000}.chart_Axis .guide path.domain{fill:none;stroke:none}.chart_Axis .guide .tick line{fill:none;stroke:#d3d3d3;opacity:.7}.chart_Axis .guide .tick.guide-0 line{stroke:#000;stroke-width:1;stroke-dasharray:3 5}.chart_Axis line,.chart_Axis path{shape-rendering:crispEdges}.chart_XYAxis .axis{fill:#000;font:10px sans-serif}.chart_XYAxis .tick>text{font:10px sans-serif}.chart_XYAxis .focus .chart_Axis.value .tick{visibility:hidden}.chart_XYAxis .axis path,.chart_XYAxis .axis line{fill:none;stroke:#000;shape-rendering:crispEdges}.chart_XYAxis .region{opacity:.33}.chart_XYAxis .brush rect.background{z-index:-999}.chart_XYAxis .brush .selection{stroke:#4682b4;stroke-opacity:1;stroke-width:1px;fill:#4682b4;fill-opacity:.125;shape-rendering:crispEdges}.chart_XYAxis .brush path.handle--custom{fill:#eee;stroke:#666}.chart_Scatter .pointShape,.chart_Scatter .line,.chart_Scatter .area{pointer-events:none}.chart_Scatter .point .pointSelection{fill:none;stroke:none;pointer-events:all}.chart_Scatter .point .pointSelection.selected{fill:none;stroke:red}.chart_Column .columnRect{fill:#4682b4;cursor:pointer}.chart_Column .data.axis path{display:none}.chart_Column .columnRect{stroke:transparent;border-width:1.5px}.chart_Column .columnRect.selected{stroke:red}.chart_Bubble circle{cursor:pointer}.chart_Bubble .selected circle{stroke:red;stroke-width:1.5px}.chart_Bubble .common_FAChar{fill:#fff;pointer-events:none}.chart_Bubble .common_Text{pointer-events:none}.chart_Bullet .domain{opacity:0}.chart_Bullet .bullet{border:solid 1px;border-color:transparent;font:10px sans-serif}.chart_Bullet .bullet.selected{border-color:red}.chart_Bullet .bullet.over{border-color:orange}.chart_Bullet .bullet.selected.over{border-color:red}.chart_Bullet .bullet .marker{stroke:#000;stroke-width:2px}.chart_Bullet .bullet .tick line{stroke:#666;stroke-width:.5px}.chart_Bullet .bullet .range.s0{fill:#eee}.chart_Bullet .bullet .range.s1{fill:#ddd}.chart_Bullet .bullet .range.s2{fill:#ccc}.chart_Bullet .bullet .measure.s0{fill:#b0c4de}.chart_Bullet .bullet .measure.s1{fill:#4682b4}.chart_Bullet .bullet .title{font-size:14px;font-weight:700}.chart_Bullet .bullet .subtitle{fill:#999}.chart_Pie path{cursor:pointer}.chart_Pie>g>text{cursor:pointer}.chart_Pie .arc path{stroke:#fff;stroke-width:.75px}.chart_Pie .arc.selected path{stroke:red;stroke-width:1.5px}.chart_Pie polyline{opacity:.3;stroke:#000;stroke-width:2px;fill:none}.chart_HexBin .hexagon{fill:none;stroke:#000;stroke-width:.5px}.chart_HexBin .hexagon.selected{stroke:red}.chart_Line .dataLine{fill:none;stroke:#4682b4;stroke-width:1.5px}.chart_Radar .pointShape,.chart_Radar .area{pointer-events:none}.chart_Radar .point .pointSelection{fill:none;stroke:none;pointer-events:all}.chart_Radar .point .pointSelection.selected{fill:none;stroke:red}.chart_RadialBar path.arc{opacity:.9;transition:opacity .5s}.chart_RadialBar path.arc.selected{stroke:red}.chart_RadialBar path.arc:hover{opacity:.7}.chart_RadialBar .axis line,.chart_RadialBar .axis circle{stroke:#ccc;stroke-width:1px}.chart_RadialBar .axis circle{fill:none}.chart_RadialBar .r.axis text{text-anchor:end}.chart_Summary{width:225px;height:150px;font-size:14px}.chart_Summary .content h2{font-weight:700;font-size:3em;margin-left:10px;margin-top:10px;margin-bottom:10px}.chart_Summary .bgIcon:before{position:absolute;font-family:FontAwesome;font-size:5.5em;opacity:.4;top:.5em;right:15px}.chart_Summary .bgIcon{position:relative}.chart_Summary .content{float:left;width:100%;height:100%;background-color:#efd752}.chart_Summary .content div{margin-top:-1.1em;font-size:1.1em;opacity:.8}.chart_Summary .content .text{padding-left:10px}.chart_Summary .content .more{position:absolute;bottom:0;width:100%;height:3em;line-height:3em}.chart_Summary .content .more i{padding-left:10px;padding-right:.5em}.other_Wordcloud text{cursor:pointer}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();
11
+ !function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".chart_Axis{fill:#000;font:10px sans-serif}.chart_Axis .axis .tick>text{font:10px sans-serif}.chart_Axis .axis path.domain,.chart_Axis .axis .tick line{fill:none;stroke:#000}.chart_Axis .guide path.domain{fill:none;stroke:none}.chart_Axis .guide .tick line{fill:none;stroke:#d3d3d3;opacity:.7}.chart_Axis .guide .tick.guide-0 line{stroke:#000;stroke-width:1;stroke-dasharray:3 5}.chart_Axis line,.chart_Axis path{shape-rendering:crispEdges}.chart_XYAxis .axis{fill:#000;font:10px sans-serif}.chart_XYAxis .tick>text{font:10px sans-serif}.chart_XYAxis .focus .chart_Axis.value .tick{visibility:hidden}.chart_XYAxis .axis path,.chart_XYAxis .axis line{fill:none;stroke:#000;shape-rendering:crispEdges}.chart_XYAxis .region{opacity:.33}.chart_XYAxis .brush rect.background{z-index:-999}.chart_XYAxis .brush .selection{stroke:#4682b4;stroke-opacity:1;stroke-width:1px;fill:#4682b4;fill-opacity:.125;shape-rendering:crispEdges}.chart_XYAxis .brush path.handle--custom{fill:#eee;stroke:#666}.chart_Scatter .pointShape,.chart_Scatter .line,.chart_Scatter .area{pointer-events:none}.chart_Scatter .point .pointSelection{fill:none;stroke:transparent;stroke-width:2px;pointer-events:all;transition:all .2s ease}.chart_Scatter .point .pointSelection.selected{stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Scatter .point .pointSelection:hover{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Scatter .point .pointSelection:focus{stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Scatter .point .pointSelection.selected:focus{stroke:#6f42c1!important}.chart_Scatter .point .pointSelection:focus-visible{outline:none}.chart_Scatter .point .pointSelection:active{outline:none!important}.chart_Column .columnRect{fill:#4682b4;cursor:pointer}.chart_Column .data.axis path{display:none}.chart_Column .columnRect{stroke:transparent;border-width:2px}.chart_Column .dataCell.selected .columnRect{stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important;transition:all .2s ease}.chart_Column .dataCell:hover .columnRect{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Column .dataCell:focus .columnRect{stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important;transition:all .2s ease}.chart_Column .dataCell.selected:focus .columnRect{stroke:#6f42c1!important}.chart_Column .dataCell:focus-visible{outline:none}.chart_Column .dataCell:active{outline:none!important}.chart_Bubble circle{cursor:pointer}.chart_Bubble .selected circle{stroke:red;stroke-width:1.5px}.chart_Bubble .common_FAChar{fill:#fff;pointer-events:none}.chart_Bubble .common_Text{pointer-events:none}.chart_Bullet .domain{opacity:0}.chart_Bullet .bullet{border:solid 1px;border-color:transparent;font:10px sans-serif}.chart_Bullet .bullet.selected{border-color:red}.chart_Bullet .bullet.over{border-color:orange}.chart_Bullet .bullet.selected.over{border-color:red}.chart_Bullet .bullet .marker{stroke:#000;stroke-width:2px}.chart_Bullet .bullet .tick line{stroke:#666;stroke-width:.5px}.chart_Bullet .bullet .range.s0{fill:#eee}.chart_Bullet .bullet .range.s1{fill:#ddd}.chart_Bullet .bullet .range.s2{fill:#ccc}.chart_Bullet .bullet .measure.s0{fill:#b0c4de}.chart_Bullet .bullet .measure.s1{fill:#4682b4}.chart_Bullet .bullet .title{font-size:14px;font-weight:700}.chart_Bullet .bullet .subtitle{fill:#999}.chart_Pie path{cursor:pointer}.chart_Pie>g>text{cursor:pointer}.chart_Pie .arc path{stroke:transparent;stroke-width:2px}.chart_Pie .arc.selected path{stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important;transition:all .2s ease}.chart_Pie polyline{opacity:.3;stroke:#000;stroke-width:2px;fill:none}.chart_Pie .arc:hover path{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Pie .arc:focus path{stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important;transition:all .2s ease}.chart_Pie .arc.selected:focus path{stroke:#6f42c1!important}.chart_Pie .arc:focus-visible{outline:none}.chart_Pie .arc:active{outline:none!important}.chart_HexBin .hexagon{fill:none;stroke:#000;stroke-width:.5px}.chart_HexBin .hexagon.selected{stroke:red}.chart_Line .dataLine{fill:none;stroke:#4682b4;stroke-width:1.5px}.chart_Radar .pointShape,.chart_Radar .area{pointer-events:none}.chart_Radar .point .pointSelection{fill:none;stroke:none;pointer-events:all}.chart_Radar .point .pointSelection.selected{fill:none;stroke:red}.chart_RadialBar path.arc{opacity:.9;transition:opacity .5s}.chart_RadialBar path.arc.selected{stroke:red}.chart_RadialBar path.arc:hover{opacity:.7}.chart_RadialBar .axis line,.chart_RadialBar .axis circle{stroke:#ccc;stroke-width:1px}.chart_RadialBar .axis circle{fill:none}.chart_RadialBar .r.axis text{text-anchor:end}.chart_Summary{width:225px;height:150px;font-size:14px}.chart_Summary .content h2{font-weight:700;font-size:3em;margin-left:10px;margin-top:10px;margin-bottom:10px}.chart_Summary .bgIcon:before{position:absolute;font-family:FontAwesome;font-size:5.5em;opacity:.4;top:.5em;right:15px}.chart_Summary .bgIcon{position:relative}.chart_Summary .content{float:left;width:100%;height:100%;background-color:#efd752}.chart_Summary .content div{margin-top:-1.1em;font-size:1.1em;opacity:.8}.chart_Summary .content .text{padding-left:10px}.chart_Summary .content .more{position:absolute;bottom:0;width:100%;height:3em;line-height:3em}.chart_Summary .content .more i{padding-left:10px;padding-right:.5em}.other_Wordcloud text{cursor:pointer}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();