=1?(e*=m=Math.sqrt(m),t*=m):(m=Math.sqrt(1/m-1),o===n&&(m=-m),b+=g*(C=m*e*y)-d*(O=-m*t*v),w+=d*C+g*O);var S=Math.atan2((f-O)/t,(h-C)/e),E=Math.atan2((-f-O)/t,(-h-C)/e)-S;this.cubicArc(b,w,e,t,r,S,S+E,1-n)}},e.cubicArc=function(e,t,r,o,n,i,a,s,l,c){if(c){var u=s;s=l,l=u}var p=t.length,d=.5522847498307935,g=Math.sin(s),h=Math.cos(s),f=Math.sin(a),v=Math.cos(a),y=Math.PI/2,m=v*h*n-f*g*i,b=f*h*n+v*g*i,w=-v*g*n-f*h*i,C=-f*g*n+v*h*i;for((l-=s)<0&&(l+=2*Math.PI),e.push("M"),t.push(m+r,b+o);l>=y;){l-=y,e.push("C");var O=w+r;t.push(m+w*d+r,b+C*d+o,m*d+w+r,b*d+C+o,Math.abs(O)<1e-8?0:O,C+o);u=m;m=w,w=-u,u=b,b=C,C=-u}if(l){var S=4/3*Math.tan(l/4),E=Math.sin(l),x=Math.cos(l),R=x+S*E,T=E-S*x;e.push("C");O=m*x+w*E+r;t.push(m+w*S+r,b+C*S+o,m*R+w*T+r,b*R+C*T+o,Math.abs(O)<1e-8?0:O,b*x+C*E+o)}if(c)for(var A=p,P=t.length-2;A=1))throw new Error("Invalid path.");return"M"+e.slice(0,2).join(",")+"C"+e.slice(2).join(",")},e}(),jt=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),zt=function(){return(zt=Object.assign||function(e){for(var t,r=1,o=arguments.length;r=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Vt=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wt=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},Ht=function(){for(var e=[],t=0;tt&&(t=a+i.width),s+i.height>o&&(o=s+i.height)}}})),new h(e,r,t-e,o-r)},t.prototype.computeTransformedBBox=function(){return this.computeBBox()},t.prototype.render=function(e){var t;this.layer&&(null===(t=this.opts)||void 0===t?void 0:t.optimiseDirtyTracking)?this.optimisedRender(e):this.basicRender(e)},t.prototype.basicRender=function(t){var r,o,n=this.opts,i=(void 0===n?{}:n).name,a=void 0===i?void 0:i,s=this._debug,l=(void 0===s?{}:s).consoleLog,c=void 0!==l&&l,u=this,p=u.dirty,d=u.dirtyZIndex,g=u.clipPath,h=u.layer,f=u.children,v=t.ctx,y=t.forceRender,m=t.clipBBox,b=t.resized,C=t.stats,O=p>=w.b.MINOR||d||b,S=O||f.some((function(e){return e.dirty>=w.b.TRIVIAL}));if(a&&c&&console.log({name:a,group:this,isDirty:O,isChildDirty:S,renderCtx:t,forceRender:y}),h){y=!1;var E=this.computeBBox();void 0!==this.lastBBox&&this.lastBBox.equals(E)||(y=!0,this.lastBBox=E)}if(!O&&!S&&!y){if(a&&c&&C){var x=this.nodeCount;console.log({name:a,result:"skipping",renderCtx:t,counts:x,group:this})}return h&&C&&(C.layersSkipped++,C.nodesSkipped+=this.nodeCount.count),void e.prototype.markClean.call(this,{recursive:!1})}var R=this.visible;if(h){if((v=h.context).save(),v.setTransform(t.ctx.getTransform()),y=!0,h.clear(),m){var T=m.width,A=m.height,P=m.x,_=m.y;c&&console.log({name:a,clipBBox:m,ctxTransform:v.getTransform(),renderCtx:t,group:this}),g.clear(),g.rect(P,_,T,A),g.draw(v),v.clip()}}else v.globalAlpha*=this.opacity;this.computeTransformMatrix(),this.matrix.toContext(v),m=m?this.matrix.inverse().transformBBox(m):void 0,d&&(this.sortChildren(),y=!0);var D=y!==t.forceRender||m!==t.clipBBox||v!==t.ctx?zt(zt({},t),{ctx:v,forceRender:y,clipBBox:m}):t,M=0;try{for(var N=Vt(f),I=N.next();!I.done;I=N.next()){var L=I.value;L.visible&&R?y||L.dirty!==w.b.NONE?(v.save(),L.render(D),v.restore()):C&&(M+=L.nodeCount.count):(L.markClean(),C&&(M+=L.nodeCount.count))}}catch(e){r={error:e}}finally{try{I&&!I.done&&(o=N.return)&&o.call(N)}finally{if(r)throw r.error}}if(C&&(C.nodesSkipped+=M),e.prototype.render.call(this,t),h&&(C&&C.layersRendered++,v.restore(),h.snapshot()),a&&c&&C){x=this.nodeCount;console.log({name:a,result:"rendered",skipped:M,renderCtx:t,counts:x,group:this})}},t.prototype.optimisedRender=function(t){var r,o,n,i,a=this._debug,s=(void 0===a?{}:a).consoleLog,l=void 0!==s&&s,c=this,u=c.name,p=c.dirty,d=c.dirtyZIndex,g=c.clipPath,h=c.layer,f=c.dirtyChildren,v=void 0===f?{}:f,y=c.visibleChildren,m=void 0===y?{}:y,b=c.visible,C=t.ctx,O=t.clipBBox,S=t.resized,E=t.stats;if(h){var x=p>=w.b.MINOR||d||S,R=Object.keys(v).length>0;if(u&&l&&console.log({name:u,group:this,isDirty:x,isChildDirty:R,renderCtx:t}),!x&&!R){if(u&&l&&E){var T=this.nodeCount;console.log({name:u,result:"skipping",renderCtx:t,counts:T,group:this})}return E&&(E.layersSkipped++,E.nodesSkipped+=this.nodeCount.count),void e.prototype.markClean.call(this,{recursive:!1})}if((C=h.context).save(),C.setTransform(t.ctx.getTransform()),h.clear(),O){var A=O.width,P=O.height,_=O.x,D=O.y;l&&console.log({name:u,clipBBox:O,ctxTransform:C.getTransform(),renderCtx:t,group:this}),g.clear(),g.rect(_,D,A,P),g.draw(C),C.clip()}this.syncChildVisibility(),this.computeTransformMatrix(),this.matrix.toContext(C),O=O?this.matrix.inverse().transformBBox(O):void 0,d&&this.sortChildren();var M=!0!==t.forceRender||O!==t.clipBBox||C!==t.ctx?zt(zt({},t),{ctx:C,forceRender:!0,clipBBox:O}):t;l&&console.log({name:u,visibleChildren:m,dirtyChildren:v});if(b)try{for(var N=Vt(Object.values(m)),I=N.next();!I.done;I=N.next()){var L=I.value;C.save(),L.render(M),C.restore()}}catch(e){r={error:e}}finally{try{I&&!I.done&&(o=N.return)&&o.call(N)}finally{if(r)throw r.error}}this.markClean({recursive:!1});try{for(var k=Vt(Object.values(v)),F=k.next();!F.done;F=k.next()){(L=F.value).markClean(),delete v[L.id]}}catch(e){n={error:e}}finally{try{F&&!F.done&&(i=k.return)&&i.call(k)}finally{if(n)throw n.error}}if(E&&(E.nodesSkipped+=0),E&&E.layersRendered++,C.restore(),h.snapshot(),u&&l&&E){T=this.nodeCount;console.log({name:u,result:"rendered",skipped:0,renderCtx:t,counts:T,group:this})}}},t.prototype.syncChildVisibility=function(){var e,t,r=this.dirtyChildren,o=this.visibleChildren;if(r&&o)try{for(var n=Vt(Object.values(r)),i=n.next();!i.done;i=n.next()){var a=i.value;!a.visible&&o[a.id]?delete o[a.id]:a.visible&&!o[a.id]&&(o[a.id]=a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t.prototype.sortChildren=function(){this.dirtyZIndex=!1,this.children.sort((function(e,t){var r,o;return We(Ht([e.zIndex],null!=(r=e.zIndexSubOrder)?r:[void 0,void 0],[e.serialNumber]),Ht([t.zIndex],null!=(o=t.zIndexSubOrder)?o:[void 0,void 0],[t.serialNumber]),Ve)}))},t.className="Group",Bt([Object(w.c)({convertor:function(e){return Math.min(1,Math.max(0,e))},changeCb:function(e){return e.opacityChanged()}})],t.prototype,"opacity",void 0),t}(x),Kt=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Yt=function(){function e(e,t){this.next=null,this.scene=e.scene,this.parent=e,this.datum=t}return e.prototype.appendChild=function(e){if(null===this.next)return this.parent.insertBefore(e,null);if(!x.isNode(this.next))throw new Error(this.next+" is not a Node.");return this.parent.insertBefore(e,this.next)},e.prototype.insertBefore=function(e,t){return this.parent.insertBefore(e,t)},e}(),Xt=function(){function e(e,t){this.groups=e,this.parents=t}return e.select=function(t){return new e([["function"==typeof t?t():t]],[void 0])},e.selectAll=function(t){return new e([null==t?[]:t],[void 0])},e.prototype.append=function(e){return this.select((function(t){return t.appendChild(new e)}))},e.prototype.select=function(t){for(var r=this.groups,o=r.length,n=[],i=0;i=w&&(w=b+1);for(var O=y[w];!O&&w=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Zt=function(e){function t(){var t=e.call(this)||this;return t.x1=0,t.y1=0,t.x2=0,t.y2=0,t.restoreOwnStyles(),t}return qt(t,e),t.prototype.computeBBox=function(){return new h(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)},t.prototype.isPointInPath=function(e,t){return!1},t.prototype.render=function(t){var r,o=t.ctx,n=t.forceRender,i=t.stats;if(this.dirty!==w.b.NONE||n){this.computeTransformMatrix(),this.matrix.toContext(o);var a=this.x1,s=this.y1,l=this.x2,c=this.y2;if(a===l){var u=Math.round(a)+Math.floor(this.strokeWidth)%2/2;a=u,l=u}else if(s===c){var p=Math.round(s)+Math.floor(this.strokeWidth)%2/2;s=p,c=p}o.beginPath(),o.moveTo(a,s),o.lineTo(l,c),this.fillStroke(o),null===(r=this.fillShadow)||void 0===r||r.markClean(),e.prototype.render.call(this,t)}else i&&(i.nodesSkipped+=this.nodeCount.count)},t.className="Line",t.defaultStyles=R(k.defaultStyles,{fill:void 0,strokeWidth:1}),Qt([Object(w.c)({redraw:w.b.MAJOR})],t.prototype,"x1",void 0),Qt([Object(w.c)({redraw:w.b.MAJOR})],t.prototype,"y1",void 0),Qt([Object(w.c)({redraw:w.b.MAJOR})],t.prototype,"x2",void 0),Qt([Object(w.c)({redraw:w.b.MAJOR})],t.prototype,"y2",void 0),t}(k),Jt=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),$t=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};function er(e){var t=e||{},r=t.redraw,o=void 0===r?w.b.MAJOR:r,n=t.changeCb,i=t.convertor;return Object(w.c)({redraw:o,type:"path",convertor:i,changeCb:n})}var tr=function(e){function t(t){var r=e.call(this)||this;return r.renderOverride=t,r.path=new Gt,r._dirtyPath=!0,r}return Jt(t,e),Object.defineProperty(t.prototype,"dirtyPath",{get:function(){return this._dirtyPath},set:function(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty(this,w.b.MAJOR))},enumerable:!0,configurable:!0}),t.prototype.checkPathDirty=function(){var e,t;this._dirtyPath||(this.dirtyPath=this.path.isDirty()||null!=(t=null===(e=this.fillShadow)||void 0===e?void 0:e.isDirty())&&t)},t.prototype.isPointInPath=function(e,t){var r=this.transformPoint(e,t);return this.path.closedPath&&this.path.isPointInPath(r.x,r.y)},t.prototype.isDirtyPath=function(){},t.prototype.updatePath=function(){},t.prototype.render=function(t){var r,o,n=t.ctx,i=t.forceRender,a=t.stats;if(this.dirty!==w.b.NONE||i){if(this.computeTransformMatrix(),this.matrix.toContext(n),(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.clipPath){if(n.save(),"normal"===this.clipMode&&(this.clipPath.draw(n),n.clip()),this.renderOverride?this.renderOverride(n):(this.path.draw(n),this.fillStroke(n)),"punch-out"===this.clipMode){this.clipPath.draw(n),n.clip();var s=null!=(r=this.computeBBox())?r:{},l=s.x,c=void 0===l?-1e4:l,u=s.y,p=void 0===u?-1e4:u,d=s.width,g=void 0===d?2e4:d,h=s.height,f=void 0===h?2e4:h;n.clearRect(c,p,g,f)}n.restore()}else this.renderOverride?this.renderOverride(n):(this.path.draw(n),this.fillStroke(n));null===(o=this.fillShadow)||void 0===o||o.markClean(),e.prototype.render.call(this,t)}else a&&(a.nodesSkipped+=this.nodeCount.count)},t.className="Path",$t([er()],t.prototype,"clipPath",void 0),$t([er()],t.prototype,"clipMode",void 0),t}(k),rr=2*Math.PI;function or(e){return e%=rr,e+=rr,e%=rr}function nr(e){return e/180*Math.PI}function ir(e,t,r){return void 0===r&&(r=1e-10),Math.abs(e-t)=0||!isFinite(r)?e.toFixed(t):e.toFixed(Math.abs(r)-1+t)}Number.EPSILON||Math.pow(2,-52);var sr,lr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),cr=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};!function(e){e[e.Open=0]="Open",e[e.Chord=1]="Chord",e[e.Round=2]="Round"}(sr||(sr={}));var ur=function(e){function t(){var t=e.call(this)||this;return t.centerX=0,t.centerY=0,t.radiusX=10,t.radiusY=10,t.startAngle=0,t.endAngle=2*Math.PI,t.counterClockwise=!1,t.type=sr.Open,t.restoreOwnStyles(),t}return lr(t,e),Object.defineProperty(t.prototype,"fullPie",{get:function(){return ir(or(this.startAngle),or(this.endAngle))},enumerable:!0,configurable:!0}),t.prototype.updatePath=function(){var e=this.path;e.clear(),e.cubicArc(this.centerX,this.centerY,this.radiusX,this.radiusY,0,this.startAngle,this.endAngle,this.counterClockwise?1:0),this.type===sr.Chord?e.closePath():this.type!==sr.Round||this.fullPie||(e.lineTo(this.centerX,this.centerY),e.closePath())},t.prototype.computeBBox=function(){return new h(this.centerX-this.radiusX,this.centerY-this.radiusY,2*this.radiusX,2*this.radiusY)},t.prototype.isPointInPath=function(e,t){var r=this.transformPoint(e,t),o=this.computeBBox();return this.type!==sr.Open&&o.containsPoint(r.x,r.y)&&this.path.isPointInPath(r.x,r.y)},t.className="Arc",t.defaultStyles=R(k.defaultStyles,{lineWidth:1,fillStyle:null}),cr([er()],t.prototype,"centerX",void 0),cr([er()],t.prototype,"centerY",void 0),cr([er()],t.prototype,"radiusX",void 0),cr([er()],t.prototype,"radiusY",void 0),cr([er()],t.prototype,"startAngle",void 0),cr([er()],t.prototype,"endAngle",void 0),cr([er()],t.prototype,"counterClockwise",void 0),cr([er()],t.prototype,"type",void 0),t}(tr),pr={};function dr(e,t){pr[t]||(e(),pr[t]=!0)}var gr,hr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),fr=new Date,vr=new Date,yr=function(){function e(e,t){this._floor=e,this._offset=t}return e.prototype.floor=function(e){return e=new Date(+e),this._floor(e),e},e.prototype.ceil=function(e){return e=new Date(+e-1),this._floor(e),this._offset(e,1),this._floor(e),e},e.prototype.round=function(e){var t=this.floor(e),r=this.ceil(e),o=+e;return o-t.getTime()t||r<=0)return n;do{o=new Date(+e),n.push(o),this._offset(e,r),this._floor(e)}while(o=e)for(r._floor(e);!t(e);)e.setTime(e.getTime()-1),r._floor(e);return e}),(function(e,o){if(e>=e)if(o<0)for(;++o<=0;)do{r._offset(e,-1)}while(!t(e));else for(;--o>=0;)do{r._offset(e,1)}while(!t(e));return e}))},e}(),mr=function(e){function t(t,r,o,n){var i=e.call(this,t,r)||this;return i._count=o,i._field=n,i}return hr(t,e),t.prototype.count=function(e,t){return fr.setTime(+e),vr.setTime(+t),this._floor(fr),this._floor(vr),Math.floor(this._count(fr,vr))},t.prototype.every=function(e){var t,r=this;if(e=Math.floor(e),isFinite(e)&&e>0)if(e>1){var o=this._field;t=o?this.filter((function(t){return o(t)%e==0})):this.filter((function(t){return r.count(0,t)%e==0}))}else t=this;return t},t}(yr);function br(e,t,r,o,n){var i=e.xt+o?t+o:e.x,a=e.yr+n?r+n:e.y,s=e.x-i,l=e.y-a;return Math.sqrt(s*s+l*l)<=.5*e.size}function wr(e,t,r,o,n){var i=e.x+e.width>t&&e.xr&&e.y=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Er=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},xr=function(){for(var e=[],t=0;t=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Tr=Y((function(e,t){return fe(0)(e,t)||e instanceof yr}),"expecting a tick count Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'"),Ar=Y((function(e,t){return X(e,t,Tr)}),"expecting an optional tick count Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'"),Pr=["stroke","lineDash"],_r=Y(q(void 0,(function(e){for(var t in e)if(!Pr.includes(t))return!1;return!0})),"expecting an Array of objects with gridline style properties such as 'stroke' and 'lineDash'");!function(e){e[e.Tick=0]="Tick",e[e.GridLine=1]="GridLine"}(Or||(Or={}));var Dr,Mr,Nr=function(){function e(){this.width=1,this.color="rgba(195, 195, 195, 1)"}return Sr([K(fe(0))],e.prototype,"width",void 0),Sr([K(ge)],e.prototype,"color",void 0),e}(),Ir=function(){function e(){this.width=1,this.size=6,this.color="rgba(195, 195, 195, 1)",this.count=void 0}return Sr([K(fe(0))],e.prototype,"width",void 0),Sr([K(fe(0))],e.prototype,"size",void 0),Sr([K(ge)],e.prototype,"color",void 0),Sr([K(Ar)],e.prototype,"count",void 0),e}(),Lr=function(){function e(){this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)",this.rotation=void 0,this.autoRotate=void 0,this.autoRotateAngle=335,this.mirrored=!1,this.parallel=!1,this.formatter=void 0,this.format=void 0}return Sr([K(Se)],e.prototype,"fontStyle",void 0),Sr([K(xe)],e.prototype,"fontWeight",void 0),Sr([K(fe(1))],e.prototype,"fontSize",void 0),Sr([K(ie)],e.prototype,"fontFamily",void 0),Sr([K(fe(0))],e.prototype,"padding",void 0),Sr([K(ge)],e.prototype,"color",void 0),Sr([K(ve(-360,360))],e.prototype,"rotation",void 0),Sr([K(ne)],e.prototype,"autoRotate",void 0),Sr([K(fe(-360,360))],e.prototype,"autoRotateAngle",void 0),Sr([K(oe)],e.prototype,"mirrored",void 0),Sr([K(oe)],e.prototype,"parallel",void 0),Sr([K(ae)],e.prototype,"format",void 0),e}(),kr=function(){function e(e){this.id=m(this),this.nice=!0,this.dataDomain=[],this.axisGroup=new Ut({name:this.id+"-axis",layer:!0,zIndex:gr.AXIS_ZINDEX}),this.crossLineGroup=new Ut({name:this.id+"-CrossLines"}),this.lineGroup=this.axisGroup.appendChild(new Ut({name:this.id+"-Line"})),this.tickGroup=this.axisGroup.appendChild(new Ut({name:this.id+"-Tick"})),this.titleGroup=this.axisGroup.appendChild(new Ut({name:this.id+"-Title"})),this.tickGroupSelection=Xt.select(this.tickGroup).selectAll(),this.lineNode=this.lineGroup.appendChild(new Zt),this.gridlineGroup=new Ut({name:this.id+"-gridline",layer:!0,zIndex:gr.AXIS_GRIDLINES_ZINDEX}),this.gridlineGroupSelection=Xt.select(this.gridlineGroup).selectAll(),this._crossLines=[],this.line=new Nr,this.tick=new Ir,this.label=new Lr,this.translation={x:0,y:0},this.rotation=0,this.requestedRange=[0,1],this._visibleRange=[0,1],this._title=void 0,this._gridLength=0,this.gridStyle=[{stroke:"rgba(219, 219, 219, 1)",lineDash:[4,2]}],this._radialGrid=!1,this.fractionDigits=0,this.gridPadding=0,this.thickness=0,this._scale=e,this.refreshScale()}return Object.defineProperty(e.prototype,"scale",{get:function(){return this._scale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"crossLines",{get:function(){return this._crossLines},set:function(e){var t,r,o=this;null===(t=this._crossLines)||void 0===t||t.forEach((function(e){return o.detachCrossLine(e)})),this._crossLines=e,null===(r=this._crossLines)||void 0===r||r.forEach((function(e){o.attachCrossLine(e),o.initCrossLine(e)}))},enumerable:!0,configurable:!0}),e.prototype.attachCrossLine=function(e){this.crossLineGroup.appendChild(e.group)},e.prototype.detachCrossLine=function(e){this.crossLineGroup.removeChild(e.group)},e.prototype.getMeta=function(){},e.prototype.refreshScale=function(){var e,t=this;this.requestedRange=this.scale.range.slice(),null===(e=this.crossLines)||void 0===e||e.forEach((function(e){t.initCrossLine(e)}))},e.prototype.updateRange=function(){var e,t=this.requestedRange,r=this.visibleRange,o=this.scale,n=(t[1]-t[0])/(r[1]-r[0]),i=n*r[0],a=t[0]-i;o.range=[a,a+n],null===(e=this.crossLines)||void 0===e||e.forEach((function(e){e.clippedRange=[t[0],t[1]]}))},e.prototype.inRange=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=0),0===this.inRangeEx(e,t,r)},e.prototype.inRangeEx=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=0);var o=this.range,n=Math.min(o[0],o[1]),i=Math.max(o[0],o[1]);return e+ti+r?1:0},Object.defineProperty(e.prototype,"range",{get:function(){return this.requestedRange},set:function(e){this.requestedRange=e.slice(),this.updateRange()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visibleRange",{get:function(){return this._visibleRange.slice()},set:function(e){if(e&&2===e.length){var t=Er(e,2),r=t[0],o=t[1];r=Math.max(0,r),o=Math.min(1,o),r=Math.min(r,o),o=Math.max(r,o),this._visibleRange=[r,o],this.updateRange()}},enumerable:!0,configurable:!0}),e.prototype.onLabelFormatChange=function(e,t){var r=this.scale;if(t&&r&&r.tickFormat)try{this.labelFormatter=r.tickFormat({ticks:e,count:e.length,specifier:t})}catch(e){this.labelFormatter=void 0,dr((function(){return console.warn("AG Charts - the axis label format string "+t+" is invalid. No formatting will be applied")}),"invalid axis label format string "+t)}else this.labelFormatter=void 0},Object.defineProperty(e.prototype,"title",{get:function(){return this._title},set:function(e){var t=this._title;t!==e&&(t&&this.titleGroup.removeChild(t.node),e&&(e.node.rotation=-Math.PI/2,this.titleGroup.appendChild(e.node)),this._title=e,this.updateTitle({ticks:this.scale.ticks(this.tick.count)}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridLength",{get:function(){return this._gridLength},set:function(e){var t,r=this;(this._gridLength&&!e||!this._gridLength&&e)&&(this.gridlineGroupSelection=this.gridlineGroupSelection.remove().setData([])),this._gridLength=e,null===(t=this.crossLines)||void 0===t||t.forEach((function(e){r.initCrossLine(e)}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"radialGrid",{get:function(){return this._radialGrid},set:function(e){this._radialGrid!==e&&(this._radialGrid=e,this.gridlineGroupSelection=this.gridlineGroupSelection.remove().setData([]))},enumerable:!0,configurable:!0}),e.prototype.update=function(e){var t,r;this.calculateDomain();var o=this,n=o.scale,i=o.gridLength,a=o.tick,s=o.label,l=o.requestedRange,c=Math.min.apply(Math,xr(l)),u=Math.max.apply(Math,xr(l)),p=nr(this.rotation),d=s.parallel,g=this.isAnySeriesActive(),h=s.mirrored?1:-1,f=or(p),v=or(p-Math.PI/2),y=(n.bandwidth||0)/2;this.updatePosition(),this.updateLine();var m=0,b=!0,w=[],C=void 0!==this.tick.count,O=this.nice&&n.nice,S=n instanceof qe,E=void 0!==e,x=!E&&!C&&O;for(n.domain=this.dataDomain,O&&n.nice(this.tick.count);b;){for(var R=!0,T=function(){if(m>=10)return"break";x&&(n.domain=A.dataDomain,n.nice(10-m));var r=w,o=S&&!C||0===m?void 0:w.filter((function(e,t){return t%2==0})),a=void 0;E&&(a=A.updateSecondaryAxisTicks(e)),w=null!=(t=null!=o?o:a)?t:A.scale.ticks(A.tick.count,m),A.updateSelections({halfBandwidth:y,gridLength:i,ticks:w}),!E&&w.length>0&&(e=w.length),R=w.every((function(e,t){return e===r[t]})),m++},A=this;R;){if("break"===T())break}if(R)break;this.onLabelFormatChange(w,this.label.format);var P=this.updateLabels({parallelFlipRotation:f,regularFlipRotation:v,sideFlag:h,tickLineGroupSelection:this.tickGroupSelection,ticks:w});b=Cr(P.labelData,P.rotated?0:10)}this.updateGridLines({gridLength:i,halfBandwidth:y,sideFlag:h});var _=!1,D=function(e){var t=Math.floor(c),r=Math.ceil(u),o=t!==r&&e.translationY>=t&&e.translationY<=r;return _=o||_,o},M=this.gridlineGroupSelection,N=this.tickGroupSelection;return M.attrFn("visible",D),N.attrFn("visible",D),this.tickGroup.visible=_,this.gridlineGroup.visible=_,null===(r=this.crossLines)||void 0===r||r.forEach((function(e){e.sideFlag=-h,e.direction=p===-Math.PI/2?Dr.X:Dr.Y,e.label.parallel=void 0!==e.label.parallel?e.label.parallel:d,e.parallelFlipRotation=f,e.regularFlipRotation=v,e.update(g)})),this.updateTitle({ticks:w}),N.selectByTag(Or.Tick).each((function(e){e.strokeWidth=a.width,e.stroke=a.color,e.visible=_})).attr("x1",h*a.size).attr("x2",0).attr("y1",0).attr("y2",0),e},e.prototype.calculateDomain=function(){},e.prototype.updatePosition=function(){var e=this,t=e.label,r=e.axisGroup,o=e.gridlineGroup,n=e.crossLineGroup,i=e.translation,a=e.gridlineGroupSelection,s=e.gridPadding,l=e.gridLength,c=nr(this.rotation),u=t.mirrored?1:-1,p=Math.floor(i.x),d=Math.floor(i.y);n.translationX=p,n.translationY=d,n.rotation=c,r.translationX=p,r.translationY=d,r.rotation=c,o.translationX=p,o.translationY=d,o.rotation=c,a.selectByTag(Or.GridLine).each((function(e){e.x1=s,e.x2=-u*l+s,e.y1=0,e.y2=0}))},e.prototype.updateSecondaryAxisTicks=function(e){throw new Error("AG Charts - unexpected call to updateSecondaryAxisTicks() - check axes configuration.")},e.prototype.updateTickGroupSelection=function(e){var t=e.data,r=this.tickGroupSelection.setData(t);r.exit.remove();var o=r.enter.append(Ut);return o.append(Zt).each((function(e){return e.tag=Or.Tick})),o.append(B),r.merge(o)},e.prototype.updateGridLineGroupSelection=function(e){var t=e.gridLength,r=e.data,o=this.gridlineGroupSelection.setData(t?r:[]);o.exit.remove();var n=o;if(t){var i=function(e){return e.tag=Or.GridLine},a=o.enter.append(Ut);this.radialGrid?a.append(ur).each(i):a.append(Zt).each(i),n=o.merge(a)}return n},e.prototype.updateSelections=function(e){var t=e.ticks,r=e.halfBandwidth,o=e.gridLength,n=this.scale,i=t.map((function(e){return{tick:e,translationY:n.convert(e)+r}})),a=this.updateGridLineGroupSelection({gridLength:o,data:i}),s=this.updateTickGroupSelection({data:i});a.attrFn("translationY",(function(e,t){return Math.round(t.translationY)})),s.attrFn("translationY",(function(e,t){return Math.round(t.translationY)})),this.tickGroupSelection=s,this.gridlineGroupSelection=a},e.prototype.updateGridLines=function(e){var t,r=e.gridLength,o=e.halfBandwidth,n=e.sideFlag,i=this.gridStyle,a=this.scale,s=this.tick,l=this.gridPadding;if(r&&i.length){var c=i.length,u=void 0;if(this.radialGrid){var p=(t=nr(r),t%=rr,(t+=rr)!==rr&&(t%=rr),t);u=this.gridlineGroupSelection.selectByTag(Or.GridLine).each((function(e,t){var r=Math.round(a.convert(t)+o);e.centerX=0,e.centerY=a.range[0]-r,e.endAngle=p,e.radiusX=r,e.radiusY=r}))}else u=this.gridlineGroupSelection.selectByTag(Or.GridLine).each((function(e){e.x1=l,e.x2=-n*r+l,e.y1=0,e.y2=0,e.visible=Math.abs(e.parent.translationY-a.range[0])>1}));u.each((function(e,t,r){var o=i[r%c];e.stroke=o.stroke,e.strokeWidth=s.width,e.lineDash=o.lineDash,e.fill=void 0}))}},e.prototype.updateLabels=function(e){var t=this,r=e.ticks,o=e.tickLineGroupSelection,n=e.sideFlag,i=e.parallelFlipRotation,a=e.regularFlipRotation,s=this,l=s.label,c=s.label.parallel,u=s.scale,p=s.tick,d=s.requestedRange,g=Math.min.apply(Math,xr(d)),f=Math.max.apply(Math,xr(d)),y=0,m=l.rotation?or(nr(l.rotation)):0,b=!m&&i>=0&&i<=Math.PI?-1:1,w=!m&&a>=0&&a<=Math.PI?-1:1;this.fractionDigits=r.fractionDigits>=0?r.fractionDigits:0;var C=new Map,O=0,S=!1,E=!1,x=f-g,R=o.selectByClass(B).each((function(e,o,n){var i=o.tick;e.fontStyle=l.fontStyle,e.fontWeight=l.fontWeight,e.fontSize=l.fontSize,e.fontFamily=l.fontFamily,e.fill=l.color,e.text=t.formatTickDatum(i,n);var a=""===e.text||null==e.text;C.set(n,a?null:e.computeBBox()),a||(O++,0===n&&e.translationY===u.range[0]?S=!0:n===r.length-1&&e.translationY===u.range[1]&&(E=!0))})),T=n*(p.size+l.padding),A=x/O,P=function(e,t){var r,o,n=!1,i=e.size-1;try{for(var a=Rr(e.entries()),s=a.next();!s.done;s=a.next()){var l=Er(s.value,2),c=l[0],u=l[1];if(null!=u){var p=0===c&&S||c===i&&E?2:1,d=t?u.width/p:u.height/p;(d<=0?0:d+12)>A&&(n=!0)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return n}(C,c);void 0===l.rotation&&!0===l.autoRotate&&P&&(y=or(nr(l.autoRotateAngle)));var _=c?b*Math.PI/2:-1===w?Math.PI:0,D=c&&!m?n*b==-1?"hanging":"bottom":"middle",M=m>0&&m<=Math.PI||y>0&&y<=Math.PI?-1:1,N=c?m||y?n*M==-1?"end":"start":"center":n*w==-1?"end":"start",I=[],L=_+m+y,k=new v;return L&&v.updateTransformMatrix(k,1,1,L,0,0),R.each((function(e,t){if(""!==e.text&&null!=e.text){if(e.textBaseline=D,e.textAlign=N,e.x=T,e.rotationCenterX=T,e.rotation=L,!(""===e.text||null==e.text)){var r=e.computeBBox(),o=r.width,n=void 0===o?0:o,i=r.height,a=void 0===i?0:i,s=t.translationY,l=new h(T,s,0,0);k.transformBBox(l,0,r);var c=r.x,u=void 0===c?0:c,p=r.y,d=void 0===p?0:p;I.push({point:{x:u,y:d,size:0},label:{width:n,height:a,text:e.text}})}}else e.visible=!1})),{labelData:I,rotated:!(!m&&!y)}},e.prototype.updateLine=function(){var e=this.lineNode,t=this.requestedRange;e.x1=0,e.x2=0,e.y1=t[0],e.y2=t[1],e.strokeWidth=this.line.width,e.stroke=this.line.color,e.visible=!0},e.prototype.updateTitle=function(e){var t,r=e.ticks,o=this,n=o.label,i=o.rotation,a=o.title,s=o.lineNode,l=o.requestedRange,c=o.tickGroup,u=o.lineGroup;if(a){var p=!1;if(a.enabled&&s.visible){p=!0;var d=n.mirrored?1:-1,g=or(i),h=Fe.PADDING,f=a.node,v=-1===d&&g>Math.PI&&g<2*Math.PI?-1:1;f.rotation=v*d*Math.PI/2,f.x=Math.floor(v*d*(l[0]+l[1])/2);var y=u.computeBBox(),m=0===i?y.width:y.height;if((null===(t=r)||void 0===t?void 0:t.length)>0){var b=c.computeBBox(),w=0===i?b.width:b.height;Math.abs(w)<1/0&&(m+=w)}f.y=-1===d?Math.floor(v*(-h-m)):Math.floor(-h-m),f.textBaseline=1===v?"bottom":"top"}a.node.visible=p}},e.prototype.formatTickDatum=function(e,t){var r=this.label,o=this.labelFormatter,n=this.fractionDigits,i=this.getMeta();return r.formatter?r.formatter({value:n>=0?e:String(e),index:t,fractionDigits:n,formatter:o,axis:i}):o?o(e):"number"==typeof e&&n>=0?e.toFixed(n):String(e)},e.prototype.formatDatum=function(e){return String(e)},e.prototype.computeBBox=function(){return this.axisGroup.computeBBox()},e.prototype.initCrossLine=function(e){e.scale=this.scale,e.gridLength=this.gridLength},e.prototype.isAnySeriesActive=function(){return!1},Sr([K(oe)],e.prototype,"nice",void 0),Sr([K(_r)],e.prototype,"gridStyle",void 0),Sr([K(fe(0))],e.prototype,"thickness",void 0),e}(),Fr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Gr=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},jr=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},zr=function(){for(var e=[],t=0;t0&&o<=1)return r/10;if(o>1&&o<=2)return 2*r/10;if(o>1&&o<=5)return 5*r/10;if(o>5&&o<=10)return 10*r/10;if(o>10&&o<=20)return 20*r/10;if(o>20&&o<=40)return 40*r/10;if(o>40&&o<=50)return 50*r/10;if(o>50&&o<=100)return 100*r/10;return o}((t-e)/(r-1))}(l=Math.floor(r/s)*s,c,t);return[[l,c=l+(t-1)*u],function(e,t,r){for(var o=Math.floor(Math.log10(t)),n=t>0&&t<1?Math.abs(o):0,i=Math.pow(10,n),a=new ot(n),s=0;s=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Kr=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a};function Yr(e,t){return Y((function(r){return"number"==typeof r&&(isNaN(r)||Number.isFinite(r))&&(void 0===e||r>=e)&&(void 0===t||r<=t)}),"expecting a finite Number"+(void 0!==e?", more than or equal to "+e:"")+(void 0!==t?", less than or equal to "+t:""))}var Xr=function(e){function t(t){void 0===t&&(t=new wt);var r=e.call(this,t)||this;return r.min=NaN,r.max=NaN,r.scale.clamper=Xe,r}return Hr(t,e),t.prototype.normaliseDataDomain=function(e){var t=this.min,r=this.max;return e.length>2&&(e=Et(e,Pt,Number)||[NaN,NaN]),isNaN(t)||(e=[t,e[1]]),isNaN(r)||(e=[e[0],r]),e[0]>e[1]&&(e=[]),this.scale.clamp=!0,e},t.prototype.formatDatum=function(e){return"number"==typeof e?e.toFixed(2):(dr((function(){return console.warn("AG Charts - Data contains Date objects which are being plotted against a number axis, please only use a number axis for numbers.")}),"number axis config used with Date objects"),String(e))},t.prototype.updateSecondaryAxisTicks=function(e){if(null==this.dataDomain)throw new Error("AG Charts - dataDomain not calculated, cannot perform tick calculation.");var t=Kr(Wr(this.dataDomain,null!=e?e:0),2),r=t[0],o=t[1];return this.scale.domain=r,o},t.className="NumberAxis",t.type="number",Ur([K(Z(Yr(),$("max")))],t.prototype,"min",void 0),Ur([K(Z(Yr(),ee("min")))],t.prototype,"max",void 0),t}(Vr),qr=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},Qr=function(){function e(){this.type="band",this.index=new Map,this.ordinalRange=[],this._domain=[],this._range=[0,1],this._bandwidth=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0,this._round=!1,this._align=.5}return Object.defineProperty(e.prototype,"domain",{get:function(){return this._domain},set:function(e){var t=this._domain;t.length=0,this.index=new Map;var r=this.index;e.forEach((function(e){void 0===r.get(e)&&r.set(e,t.push(e)-1)})),this.rescale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"range",{get:function(){return this._range},set:function(e){this._range[0]=e[0],this._range[1]=e[1],this.rescale()},enumerable:!0,configurable:!0}),e.prototype.ticks=function(){return this._domain},e.prototype.convert=function(e){var t=this.index.get(e);if(void 0===t)return NaN;var r=this.ordinalRange[t];return void 0===r?NaN:r},Object.defineProperty(e.prototype,"bandwidth",{get:function(){return this._bandwidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rawBandwidth",{get:function(){return this._rawBandwidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this._paddingInner},set:function(e){e=Math.max(0,Math.min(1,e)),this._paddingInner=e,this._paddingOuter=e,this.rescale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paddingInner",{get:function(){return this._paddingInner},set:function(e){this._paddingInner=Math.max(0,Math.min(1,e)),this.rescale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paddingOuter",{get:function(){return this._paddingOuter},set:function(e){this._paddingOuter=Math.max(0,Math.min(1,e)),this.rescale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"round",{get:function(){return this._round},set:function(e){this._round=e,this.rescale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(e){this._align=Math.max(0,Math.min(1,e)),this.rescale()},enumerable:!0,configurable:!0}),e.prototype.rescale=function(){var e,t=this._domain.length;if(t){var r=qr(this._range,2),o=r[0],n=r[1],i=n=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},$r=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},eo=function(){for(var e=[],t=0;t0&&this.parent?this.parent.children[this.number-1]:void 0},e.prototype.getLeftmostSibling=function(){return this.number>0&&this.parent?this.parent.children[0]:void 0},e.prototype.nextLeft=function(){return this.children?this.children[0]:this.thread},e.prototype.nextRight=function(){return this.children?this.children[this.children.length-1]:this.thread},e.prototype.getSiblings=function(){var e=this;return this.parent?this.parent.children.filter((function(t,r){return r!==e.number})):[]},e}();function oo(e,t){void 0===t&&(t=!0);var r=new ro,o=0;return t&&e.forEach((function(e){return o=Math.max(o,e.labels.length)})),e.forEach((function(e){if(t)for(;e.labels.length=0?e.ancestor:r}function ao(e,t){var r=e.children;if(r.length){var o=r[0];r.forEach((function(e){ao(e,t),o=function(e,t,r){var o=e.getLeftSibling();if(o){for(var n=e,i=e,a=o,s=i.getLeftmostSibling(),l=i.mod,c=n.mod,u=a.mod,p=s.mod;a.nextRight()&&i.nextLeft();){a=a.nextRight(),i=i.nextLeft(),s=s.nextLeft(),(n=n.nextRight()).ancestor=e;var d=a.prelim+u-(i.prelim+l)+r;d>0&&(no(io(a,e,t),e,d),l+=d,c+=d),u+=a.mod,l+=i.mod,p+=s.mod,c+=n.mod}a.nextRight()&&!n.nextRight()?(n.thread=a.nextRight(),n.mod+=u-c):(i.nextLeft()&&!s.nextLeft()&&(s.thread=i.nextLeft(),s.mod+=l-p),t=e)}return t}(e,o,t)})),function(e){var t=e.children;if(t)for(var r=0,o=0,n=t.length-1;n>=0;n--){var i=t[n];i.prelim+=r,i.mod+=r,o+=i.change,r+=i.shift+o}}(e);var n=(r[0].prelim+r[r.length-1].prelim)/2;(i=e.getLeftSibling())?(e.prelim=i.prelim+t,e.mod=e.prelim-n):e.prelim=n}else{var i=e.getLeftSibling();e.prelim=i?i.prelim+t:0}}var so=function(){function e(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}return e.prototype.update=function(e,t){var r=t(e),o=r.x,n=r.y;o>this.right&&(this.right=o),othis.bottom&&(this.bottom=n),nthis.depth&&(this.depth=e.depth),this.nodes.push(e)},e.prototype.resize=function(e,t,r,o,n){void 0===r&&(r=0),void 0===o&&(o=0),void 0===n&&(n=!1);var i=this.leafCount-1,a=this.depth,s=this.dimensions,l=1,c=1;if(e>0&&i){var u=(s.right-s.left)/i;l=e/i/u,n&&(l=-l)}if(t>0&&a){var p=(s.bottom-s.top)/a;c=t/a/p}var d=new so;this.nodes.forEach((function(e){e.screenX=e.x*l,e.screenY=e.y*c,d.update(e,(function(e){return{x:e.screenX,y:e.screenY}}))}));var g=-d.left,h=-d.top;this.nodes.forEach((function(e){e.screenX+=g+r,e.screenY+=h+o}))},e}(),uo=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),po=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},go=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},ho=function(){for(var e=[],t=0;t1,b=n.ticks(),w=o.mirrored?1:-1,C=or(u),O=!d&&C>=0&&C<=Math.PI?-1:1,S=or(u-Math.PI/2),E=!d&&S>=0&&S<=Math.PI?-1:1,x=this.gridLineSelection.setData(this.gridLength?b:[]);x.exit.remove();var R=x.enter.append(Zt),T=x.merge(R),A=this.labelSelection.setData(y);A.exit.remove();var P=A.enter.append(B),_=A.merge(P),D=o.formatter,M=new Map,N=0;_.each((function(e,t,r){e.fontStyle=o.fontStyle,e.fontWeight=o.fontWeight,e.fontSize=o.fontSize,e.fontFamily=o.fontFamily,e.fill=o.color,e.textBaseline=-1===O?"bottom":"hanging",e.textAlign="center",e.translationX=t.screenY-.25*o.fontSize,e.translationY=t.screenX,0===r?g&&g.enabled&&v.length>0?(e.visible=!0,e.text=g.text,e.fontSize=g.fontSize,e.fontStyle=g.fontStyle,e.fontWeight=g.fontWeight,e.fontFamily=g.fontFamily,e.textBaseline="hanging"):e.visible=!1:(e.text=D?D({value:String(t.label),index:r}):String(t.label),e.visible=t.screenX>=i[0]&&t.screenX<=i[1]);var n=e.computeBBox();M.set(e.id,n),n.width>N&&(N=n.width)}));var I=w*o.padding,L=c?O*Math.PI/2:-1===E?Math.PI:0,k=this.label.grid,F=[];_.each((function(e,r,o){if(e.x=I,e.rotationCenterX=I,r.children.length){e.translationX-=N-h+t.label.padding;var n=r.leafCount*l;(i=M.get(e.id))&&i.width>n?e.visible=!1:e.rotation=p?L:-Math.PI/2}else{var i;e.rotation=d,e.textAlign="end",e.textBaseline="middle",(i=M.get(e.id))&&i.height>l&&(e.visible=!1)}if(r.parent&&m){var a=r.children.length?r.screenX-r.leafCount*l/2:r.screenX-l/2;if(r.children.length){var s=-N-2*t.label.padding+r.screenY;F.push({y:a,x1:s+h,x2:s,toString:function(){return String(o)}})}else(r.number!==r.children.length-1||k)&&F.push({y:a,x1:0,x2:-N-2*t.label.padding,toString:function(){return String(o)}})}}));var G=0;F.forEach((function(e){return G=Math.min(G,e.x2)})),F.push({y:Math.max(a,s),x1:0,x2:G,toString:function(){return String(F.length)}});var j=this.separatorSelection.setData(F);j.exit.remove();var z=j.enter.append(Zt),V=j.merge(z);this.separatorSelection=V;V.each((function(e,r){e.x1=r.x1,e.x2=r.x2,e.y1=r.y,e.y2=r.y,e.visible=r.y>=i[0]-1e-7&&r.y<=i[1]+1e-7,e.stroke=t.tick.color,e.fill=void 0,e.strokeWidth=1})),this.gridLineSelection=T,this.labelSelection=_;for(var W=f?f.depth+1:1,H=[],U=0;U0?-N-2*t.label.padding-(o-1)*h:0;e.x1=n,e.x2=n,e.y1=i[0],e.y2=i[1],e.strokeWidth=t.line.width,e.stroke=t.line.color,e.visible=v.length>0&&(0===o||k&&m)})),this.gridLength){var q=this.gridStyle,Q=q.length;T.each((function(e,r,o){var s=Math.round(n.convert(r));e.x1=0,e.x2=-w*t.gridLength,e.y1=s,e.y2=s,e.visible=s>=i[0]&&s<=i[1]&&Math.abs(e.parent.translationY-a)>1;var l=q[o%Q];e.stroke=l.stroke,e.strokeWidth=t.tick.width,e.lineDash=l.lineDash,e.fill=void 0}))}return e},t.className="GroupedCategoryAxis",t.type="groupedCategory",po([K(ge)],t.prototype,"labelColor",void 0),t}(Vr);var yo=new mr((function(e){return e}),(function(e,t){e.setTime(e.getTime()+t)}),(function(e,t){return t.getTime()-e.getTime()})),mo=yo,bo=new Date(0).getFullYear();var wo=new mr((function(e){e.setTime(e.getTime()-e.getMilliseconds())}),(function(e,t){e.setTime(e.getTime()+1e3*t)}),(function(e,t){return(t.getTime()-e.getTime())/1e3})),Co=wo;var Oo=new mr((function(e){e.setTime(e.getTime()-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(e.getTime()+6e4*t)}),(function(e,t){return(t.getTime()-e.getTime())/6e4}),(function(e){return Math.floor(e.getTime()/6e4)})),So=Oo;var Eo=new mr((function(e){e.setTime(e.getTime()-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(e.getTime()+36e5*t)}),(function(e,t){return(t.getTime()-e.getTime())/36e5}),(function(e){return Math.floor(e.getTime()/36e5)})),xo=Eo;var Ro=new mr((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){var r=t.getTimezoneOffset()-e.getTimezoneOffset();return(t.getTime()-e.getTime()-6e4*r)/864e5}),(function(e){return Math.floor(e.getTime()/864e5)})),To=Ro;function Ao(e){return new mr((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t.getTime()-e.getTime()-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}var Po=Ao(0),_o=Ao(1),Do=Ao(2),Mo=Ao(3),No=Ao(4),Io=Ao(5),Lo=Ao(6),ko=Po;var Fo=new mr((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return 12*(e.getFullYear()-bo)+e.getMonth()})),Go=Fo;var jo=new mr((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()-bo})),zo=jo;var Bo=new mr((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t.getTime()-e.getTime())/864e5}),(function(e){return e.getUTCDate()-1})),Vo=Bo;var Wo=new mr((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()})),Ho=Wo;function Uo(e){return new mr((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t.getTime()-e.getTime())/6048e5}))}var Ko=Uo(0),Yo=Uo(1),Xo=(Uo(2),Uo(3),Uo(4)),qo=(Uo(5),Uo(6),Ko);function Qo(e){if(e.y>=0&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Zo(e){if(e.y>=0&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Jo(e){for(var t={},r=0,o=e.length;r=12?1:0]},Q:_,s:D,S:function(e,t){return ln(e.getSeconds(),t,2)},u:function(e){var t=e.getDay();return 0===t?7:t},U:function(e,t){return ln(Po.count(zo.floor(e),e),t,2)},V:function(e,t){var r=e.getDay();e=r>=4||0===r?No.floor(e):No.ceil(e);var o=zo.floor(e);return ln(No.count(o,e)+(4===o.getDay()?1:0),t,2)},w:function(e){return e.getDay()},W:function(e,t){return ln(_o.count(zo.floor(e),e),t,2)},x:void 0,X:void 0,y:function(e,t){return ln(e.getFullYear()%100,t,2)},Y:function(e,t){return ln(e.getFullYear()%1e4,t,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ln(Math.floor(t/60),"0",2)+ln(t%60,"0",2)},"%":P},w={a:function(e){return a[e.getUTCDay()]},A:function(e){return i[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:void 0,d:A,e:A,f:function(e,t){return T(e,t)+"000"},H:function(e,t){return ln(e.getUTCHours(),t,2)},I:function(e,t){return ln(e.getUTCHours()%12||12,t,2)},j:function(e,t){return ln(1+Vo.count(Ho.floor(e),e),t,3)},L:T,m:function(e,t){return ln(e.getUTCMonth()+1,t,2)},M:function(e,t){return ln(e.getUTCMinutes(),t,2)},p:function(e){return n[e.getUTCHours()>=12?1:0]},Q:_,s:D,S:function(e,t){return ln(e.getUTCSeconds(),t,2)},u:function(e){var t=e.getUTCDay();return 0===t?7:t},U:function(e,t){return ln(qo.count(Ho.floor(e),e),t,2)},V:function(e,t){var r=e.getUTCDay();e=r>=4||0===r?Xo.floor(e):Xo.ceil(e);var o=Ho.floor(e);return ln(Xo.count(o,e)+(4===o.getUTCDay()?1:0),t,4)},w:function(e){return e.getUTCDay()},W:function(e,t){return ln(Yo.count(Ho.floor(e),e),t,2)},x:void 0,X:void 0,y:function(e,t){return ln(e.getUTCFullYear()%100,t,2)},Y:function(e,t){return ln(e.getUTCFullYear()%1e4,t,4)},Z:function(){return"+0000"},"%":P},C={a:function(e,t,r){var o=g.exec(t.slice(r));return o?(e.w=h[o[0].toLowerCase()],r+o[0].length):-1},A:function(e,t,r){var o=p.exec(t.slice(r));return o?(e.w=d[o[0].toLowerCase()],r+o[0].length):-1},b:function(e,t,r){var o=y.exec(t.slice(r));return o?(e.m=m[o[0].toLowerCase()],r+o[0].length):-1},B:function(e,t,r){var o=f.exec(t.slice(r));return o?(e.m=v[o[0].toLowerCase()],r+o[0].length):-1},c:function(e,r,o){return E(e,t,r,o)},d:N,e:N,f:function(e,t,r){var o=tn.exec(t.slice(r,r+6));return o?(e.L=Math.floor(parseFloat(o[0])/1e3),r+o[0].length):-1},H:M,I:M,j:function(e,t,r){var o=tn.exec(t.slice(r,r+3));return o?(e.m=0,e.d=+o[0],r+o[0].length):-1},L:function(e,t,r){var o=tn.exec(t.slice(r,r+3));return o?(e.L=+o[0],r+o[0].length):-1},m:function(e,t,r){var o=tn.exec(t.slice(r,r+2));return o?(e.m=parseFloat(o[0])-1,r+o[0].length):-1},M:function(e,t,r){var o=tn.exec(t.slice(r,r+2));return o?(e.M=+o[0],r+o[0].length):-1},p:function(e,t,r){var o=c.exec(t.slice(r));return o?(e.p=u[o[0].toLowerCase()],r+o[0].length):-1},Q:function(e,t,r){var o=tn.exec(t.slice(r));return o?(e.Q=+o[0],r+o[0].length):-1},s:function(e,t,r){var o=tn.exec(t.slice(r));return o?(e.Q=1e3*+o[0],r+o[0].length):-1},S:function(e,t,r){var o=tn.exec(t.slice(r,r+2));return o?(e.S=+o[0],r+o[0].length):-1},u:function(e,t,r){var o=tn.exec(t.slice(r,r+1));return o?(e.u=+o[0],r+o[0].length):-1},U:function(e,t,r){var o=tn.exec(t.slice(r,r+2));return o?(e.U=+o[0],r+o[0].length):-1},V:function(e,t,r){var o=tn.exec(t.slice(r,r+2));return o?(e.V=+o[0],r+o[0].length):-1},w:function(e,t,r){var o=tn.exec(t.slice(r,r+1));return o?(e.w=+o[0],r+o[0].length):-1},W:function(e,t,r){var o=tn.exec(t.slice(r,r+2));return o?(e.W=+o[0],r+o[0].length):-1},x:function(e,t,o){return E(e,r,t,o)},X:function(e,t,r){return E(e,o,t,r)},y:function(e,t,r){var o=tn.exec(t.slice(r,r+2));return o?(e.y=+o[0]+(+o[0]>68?1900:2e3),r+o[0].length):-1},Y:function(e,t,r){var o=tn.exec(t.slice(r,r+4));return o?(e.y=+o[0],r+o[0].length):-1},Z:function(e,t,r){var o=/^(Z)|^([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return o?(e.Z=o[1]?0:-(o[2]+(o[3]||"00")),r+o[0].length):-1},"%":function(e,t,r){var o=rn.exec(t.slice(r,r+1));return o?r+o[0].length:-1}};function O(e,t){return function(r){var o=$o(1900);if(E(o,e,r+="",0)==r.length){if("Q"in o)return new Date(o.Q);if("p"in o&&(o.H=o.H%12+12*o.p),"V"in o){if(o.V<1||o.V>53)return;if("w"in o||(o.w=1),"Z"in o){var n=(i=Zo($o(o.y))).getUTCDay();i=n>4||0===n?Yo.ceil(i):Yo.floor(i),i=Vo.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7}else{var i;n=(i=t($o(o.y))).getDay();i=n>4||0===n?_o.ceil(i):_o.floor(i),i=To.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7}}else if("W"in o||"U"in o){"w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0);n="Z"in o?Zo($o(o.y)).getUTCDay():t($o(o.y)).getDay();o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(n+5)%7:o.w+7*o.U-(n+6)%7}return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Zo(o)):t(o)}}}function S(e,t){return function(r){var o=[],n=e.length,i=-1,a=0;for(r instanceof Date||(r=new Date(+r));++i=a)return-1;var s=t.charCodeAt(n++);if(37===s){var l=t.charAt(n++),c=C[l in sn?t.charAt(n++):l];if(!c||(o=c(e,r,o))<0)return-1}else if(s!=r.charCodeAt(o++))return-1}return o}function x(e,t){return ln(e.getMilliseconds(),t,3)}function R(e,t){return ln(e.getDate(),t,2)}function T(e,t){return ln(e.getUTCMilliseconds(),t,3)}function A(e,t){return ln(e.getUTCDate(),t,2)}function P(){return"%"}function _(e){return e.getTime()}function D(e){return Math.floor(e.getTime()/1e3)}function M(e,t,r){var o=tn.exec(t.slice(r,r+2));return o?(e.H=+o[0],r+o[0].length):-1}function N(e,t,r){var o=tn.exec(t.slice(r,r+2));return o?(e.d=+o[0],r+o[0].length):-1}return b.x=S(r,b),b.X=S(o,b),b.c=S(t,b),w.x=S(r,w),w.X=S(o,w),w.c=S(t,w),{format:function(e){var t=S(e,b);return t.toString=function(){return e},t},parse:function(e){var t=O(e,Qo);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e,w);return t.toString=function(){return e},t},utcParse:function(e){var t=O(e,Zo);return t.toString=function(){return e},t}}}(e)}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var cn,un,pn=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),dn=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},gn=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},hn=function(){for(var e=[],t=0;t1&&d.push(fn[un.MINUTE]);case un.MINUTE:p/36e5>1&&d.push(fn[un.HOUR]);case un.HOUR:g=d.length,p/864e5>1&&d.push(fn[un.SHORT_MONTH]);case un.SHORT_MONTH:case un.MONTH:p/31536e6>1&&d.push(fn[un.YEAR])}return g0&&g<(d=hn(d.slice(0,g).reverse(),d.slice(g))).length&&d.splice(g,0," "),d.join("")},t.prototype.defaultTickFormat=function(e){var t=this,r=this.calculateDefaultTickFormat(e);return function(e){return t.format(r)(e)}},t.prototype.tickInterval=function(e){var t,r=e.interval,o=e.start,n=e.stop,i=e.step,a=e.offset;if("number"==typeof r){var s=Math.max(0,r-(null!=a?a:0)),l=this.tickIntervals,c=Math.abs(n-o)/s,u=He(l,c,(function(e){return e[2]}));u===l.length?(i=tt(o/31536e6,n/31536e6,s),r=this.year):u?(r=(t=gn(l[c/l[u-1][2]=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},bn=function(e){function t(){var t=e.call(this,new vn)||this;t.datumFormat="%m/%d/%y, %H:%M:%S",t.min=void 0,t.max=void 0;var r=t.scale;return r.clamp=!0,r.clamper=Xe,t.refreshScale(),t.datumFormatter=r.tickFormat({specifier:t.datumFormat}),t}return yn(t,e),t.prototype.normaliseDataDomain=function(e){var t=this.min,r=this.max;return"number"==typeof t&&(t=new Date(t)),"number"==typeof r&&(r=new Date(r)),e.length>2&&(e=(Et(e,Pt,Number)||[0,1e3]).map((function(e){return new Date(e)}))),t instanceof Date&&(e=[t,e[1]]),r instanceof Date&&(e=[e[0],r]),e[0]>e[1]&&(e=[]),e},t.prototype.onLabelFormatChange=function(t,r){r?e.prototype.onLabelFormatChange.call(this,t,r):this.labelFormatter=this.scale.tickFormat({ticks:t})},t.prototype.formatDatum=function(e){return this.datumFormatter(e)},t.className="TimeAxis",t.type="time",mn([K(Z(ue,$("max")))],t.prototype,"min",void 0),mn([K(Z(ue,ee("min")))],t.prototype,"max",void 0),t}(Vr),wn=function(){function e(e){var t=e.width,r=void 0===t?600:t,o=e.height,n=void 0===o?300:o,i=e.overrideDevicePixelRatio,a=void 0===i?void 0:i;this.enabled=!0,this.opacity=1,this._pixelRatio=NaN,this._width=0,this._height=0,this.canvas=new OffscreenCanvas(r,n),this.context=this.canvas.getContext("2d"),this.imageSource=this.canvas.transferToImageBitmap(),this.setPixelRatio(a),this.resize(r,n)}return e.isSupported=function(){return null!=window.OffscreenCanvas},e.prototype.snapshot=function(){this.imageSource.close(),this.imageSource=this.canvas.transferToImageBitmap()},e.prototype.destroy=function(){this.imageSource.close()},e.prototype.clear=function(){this.context.save(),this.context.resetTransform(),this.context.clearRect(0,0,this.width,this.height),this.context.restore()},Object.defineProperty(e.prototype,"pixelRatio",{get:function(){return this._pixelRatio},enumerable:!0,configurable:!0}),e.prototype.setPixelRatio=function(e){var t=e||window.devicePixelRatio;t!==this.pixelRatio&&(F.overrideScale(this.context,t),this._pixelRatio=t,this.resize(this.width,this.height))},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),e.prototype.resize=function(e,t){if(e>0&&t>0){var r=this.canvas,o=this.context,n=this.pixelRatio;r.width=Math.round(e*n),r.height=Math.round(t*n),o.resetTransform(),this._width=e,this._height=t}},e}(),Cn=r(68),On=function(){return(On=Object.assign||function(e){for(var t,r=1,o=arguments.length;r0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},Rn=function(){for(var e=[],t=0;t=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},An=function(){function e(e){var t,r;this.id=m(this),this.layers=[],this._nextZIndex=0,this._nextLayerId=0,this._dirty=!1,this._root=null,this.debug={dirtyTree:!1,stats:!1,renderBoundingBoxes:!1,consoleLog:!1};var o=e.document,n=void 0===o?window.document:o,i=e.mode,a=void 0===i?Object(Cn.a)("agChartsSceneRenderModel")||"adv-composite":i,s=e.width,l=e.height,c=e.overrideDevicePixelRatio,u=void 0===c?void 0:c;this.overrideDevicePixelRatio=u,this.opts={document:n,mode:a},this.debug.stats=null!=(t=Object(Cn.a)("agChartsSceneStats"))&&t,this.debug.dirtyTree=null!=(r=Object(Cn.a)("agChartsSceneDirtyTree"))&&r,this.canvas=new F({document:n,width:s,height:l,overrideDevicePixelRatio:u}),this.ctx=this.canvas.context}return Object.defineProperty(e.prototype,"container",{get:function(){return this.canvas.container},set:function(e){this.canvas.container=e},enumerable:!0,configurable:!0}),e.prototype.download=function(e,t){this.canvas.download(e,t)},e.prototype.getDataURL=function(e){return this.canvas.getDataURL(e)},Object.defineProperty(e.prototype,"width",{get:function(){return this.pendingSize?this.pendingSize[0]:this.canvas.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.pendingSize?this.pendingSize[1]:this.canvas.height},enumerable:!0,configurable:!0}),e.prototype.resize=function(e,t){e=Math.round(e),t=Math.round(t);var r=e<=0||t<=0;return!(e===this.width&&t===this.height||r)&&(this.pendingSize=[e,t],this.markDirty(),!0)},e.prototype.addLayer=function(e){var t,r=this.opts.mode;if(["composite","dom-composite","adv-composite"].includes(r)){var o=e||{},n=o.zIndex,i=void 0===n?this._nextZIndex++:n,a=o.name,s=o.zIndexSubOrder,l=this.width,c=this.height,u=this.overrideDevicePixelRatio,p="dom-composite"===r,d="adv-composite"===r&&wn.isSupported()?new wn({width:l,height:c,overrideDevicePixelRatio:u}):new F({document:this.opts.document,width:l,height:c,domLayer:p,zIndex:i,name:a,overrideDevicePixelRatio:u}),g={id:this._nextLayerId++,name:a,zIndex:i,zIndexSubOrder:s,canvas:d};if(i>=this._nextZIndex&&(this._nextZIndex=i+1),this.layers.push(g),this.sortLayers(),p){var h=this.layers.map((function(e){return e.canvas})).filter((function(e){return e instanceof F})),f=h.findIndex((function(e){return e===d}));(null!=(t=h[f-1])?t:this.canvas).element.insertAdjacentElement("afterend",d.element)}return this.debug.consoleLog&&console.log({layers:this.layers}),g.canvas}},e.prototype.removeLayer=function(e){var t=this.layers.findIndex((function(t){return t.canvas===e}));t>=0&&(this.layers.splice(t,1),e.destroy(),this.markDirty(),this.debug.consoleLog&&console.log({layers:this.layers}))},e.prototype.moveLayer=function(e,t,r){var o=this.layers.find((function(t){return t.canvas===e}));o&&(o.zIndex=t,o.zIndexSubOrder=r,this.sortLayers(),this.markDirty(),this.debug.consoleLog&&console.log({layers:this.layers}))},e.prototype.sortLayers=function(){this.layers.sort((function(e,t){var r,o;return We(Rn([e.zIndex],null!=(r=e.zIndexSubOrder)?r:[void 0,void 0],[e.id]),Rn([t.zIndex],null!=(o=t.zIndexSubOrder)?o:[void 0,void 0],[t.id]),Ve)}))},e.prototype.markDirty=function(){this._dirty=!0},Object.defineProperty(e.prototype,"dirty",{get:function(){return this._dirty},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this._root},set:function(e){e!==this._root&&(this._root&&this._root._setScene(),this._root=e,e&&(null===e.parent&&e.scene&&e.scene!==this&&(e.scene.root=null),e._setScene(this)),this.markDirty())},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){var e,t;this.container=void 0;var r=this.layers;try{for(var o=Tn(r),n=o.next();!n.done;n=o.next()){var i=n.value;i.canvas.destroy(),delete i.canvas}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}r.splice(0,r.length)},e.prototype.render=function(e){return Sn(this,void 0,void 0,(function(){var t,r,o,n,i,a,s,l,c,u,p,d,g,h,f,v,y,m;return En(this,(function(b){return r=(t=e||{}).debugSplitTimes,o=void 0===r?[performance.now()]:r,n=t.extraDebugStats,i=void 0===n?{}:n,s=(a=this).canvas,l=a.ctx,c=a.root,u=a.layers,p=a.pendingSize,d=a.opts.mode,p&&((m=this.canvas).resize.apply(m,Rn(p)),this.layers.forEach((function(e){var t;return(t=e.canvas).resize.apply(t,Rn(p))})),this.pendingSize=void 0),c&&!c.visible?(this._dirty=!1,[2]):c&&!this.dirty?(this.debug.consoleLog&&console.log("no-op",{redrawType:w.b[c.dirty],tree:this.buildTree(c)}),this.debugStats(o,l,void 0,i),[2]):(g={ctx:l,forceRender:!0,resized:!!p},"detailed"===this.debug.stats&&(g.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0}),h=!1,(!c||c.dirty>=w.b.TRIVIAL)&&(h=!0,s.clear()),c&&this.debug.dirtyTree&&(f=this.buildDirtyTree(c),v=f.dirtyTree,y=f.paths,console.log({dirtyTree:v,paths:y})),c&&h&&(this.debug.consoleLog&&console.log("before",{redrawType:w.b[c.dirty],canvasCleared:h,tree:this.buildTree(c)}),c.visible&&(l.save(),c.render(g),l.restore())),"dom-composite"!==d&&u.length>0&&h&&(l.save(),l.setTransform(1/s.pixelRatio,0,0,1/s.pixelRatio,0,0),u.forEach((function(e){var t=e.canvas,r=t.imageSource,o=t.enabled,n=t.opacity;o&&(l.globalAlpha=n,l.drawImage(r,0,0))})),l.restore()),this._dirty=!1,this.debugStats(o,l,g.stats,i),c&&this.debug.consoleLog&&console.log("after",{redrawType:w.b[c.dirty],canvasCleared:h,tree:this.buildTree(c)}),[2])}))}))},e.prototype.debugStats=function(e,t,r,o){var n,i;void 0===o&&(o={});var a=performance.now();if(this.debug.stats){var s=e[0];e.push(a);var l=function(e,t){var r=e+t;return e+" / "+r+" ("+Math.round(100*e/r)+"%)"},c=function(e,t){return Math.round(100*(t-e))/100+"ms"},u=null!=r?r:{},p=u.layersRendered,d=void 0===p?0:p,g=u.layersSkipped,h=void 0===g?0:g,f=u.nodesRendered,v=void 0===f?0:f,y=u.nodesSkipped,m=void 0===y?0:y,b=e.map((function(t,r){return r>0?c(e[r-1],t):null})).filter((function(e){return null!=e})).join(" + "),w=Object.entries(o).map((function(e){var t=xn(e,2);return t[0]+": "+t[1]})).join(" ; "),C=[c(s,a)+" ("+b+")",""+w,"detailed"===this.debug.stats?"Layers: "+l(d,h):null,"detailed"===this.debug.stats?"Nodes: "+l(v,m):null].filter((function(e){return null!=e}));t.save(),t.fillStyle="white",t.fillRect(0,0,200,10+15*C.length),t.fillStyle="black";var O=0;try{for(var S=Tn(C),E=S.next();!E.done;E=S.next()){var x=E.value;t.fillText(x,2,10+15*O++)}}catch(e){n={error:e}}finally{try{E&&!E.done&&(i=S.return)&&i.call(S)}finally{if(n)throw n.error}}t.restore()}},e.prototype.buildTree=function(e){var t,r=this,o=null!=(t=e instanceof Ut?e.name:null)?t:e.id;return On({name:o,node:e,dirty:w.b[e.dirty]},e.children.map((function(e){return r.buildTree(e)})).reduce((function(t,r){var o=r.name,n=r.node,i=n.visible,a=n.opacity,s=n.zIndex,l=n.zIndexSubOrder;return(!i||a<=0)&&(o="( "+o+" )"),e instanceof Ut&&e.isLayer()&&(o="[ "+o+" ]"),t[[""+(null!=o?o:""),"z: "+s,l&&"zo: "+l.join(" / ")].filter((function(e){return!!e})).join(" ")]=r,t}),{}))},e.prototype.buildDirtyTree=function(e){var t,r=this;if(e.dirty===w.b.NONE)return{dirtyTree:{},paths:[]};var o=e.children.map((function(e){return r.buildDirtyTree(e)})).filter((function(e){return e.paths.length>0})),n=null!=(t=e instanceof Ut?e.name:null)?t:e.id,i=0===o.length?[n]:o.map((function(e){return e.paths})).reduce((function(e,t){return e.concat(t)}),[]).map((function(e){return n+"."+e}));return{dirtyTree:On({name:n,node:e,dirty:w.b[e.dirty]},o.map((function(e){return e.dirtyTree})).filter((function(e){return void 0!==e.dirty})).reduce((function(e,t){return e[t.name||""]=t,e}),{})),paths:i}},e.className="Scene",e}();function Pn(){var e=!1;return function(t,r){if(!e){var o=["AG Charts - Property ["+t+"] is deprecated.",r].filter((function(e){return null!=e})).join(" ");console.warn(o),e=!0}}}function _n(e,t){var r,o=null===(r=t)||void 0===r?void 0:r.default,n=Pn();return function(t,r){if(!t.hasOwnProperty(r)){var i=Symbol("__"+r+"__");Object.defineProperty(t,r,{get:function(){return this[i]},set:function(t){t!==o&&n(r,e),this[i]=t},enumerable:!0,configurable:!1})}}}function Dn(e){var t=Pn();return function(r,o){if(!r.hasOwnProperty(o)){var n=function(){return t(o,"Use ["+e+"] instead.")};Object.defineProperty(r,o,{get:function(){return n(),this[e]},set:function(t){t!==this[e]&&(n(),this[e]=t)},enumerable:!0,configurable:!1})}}}var Mn,Nn=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),In=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Ln=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},kn=function(){for(var e=[],t=0;t=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(e){e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_BY_MAIN_AXIS_FIRST=1]="NEAREST_BY_MAIN_AXIS_FIRST",e[e.NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST=2]="NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST",e[e.NEAREST_NODE=3]="NEAREST_NODE"}(Mn||(Mn={}));var Gn,jn=Pn(),zn=function(){function e(e,t,r){this.type="nodeClick",this.event=e,this.datum=t.datum,this.seriesId=r.id,this._series=r}return Object.defineProperty(e.prototype,"series",{get:function(){return jn("series","Use seriesId to get the series ID"),this._series},enumerable:!0,configurable:!0}),e}(),Bn=function(){function e(){this.fill="yellow",this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=void 0}return In([K(ge)],e.prototype,"fill",void 0),In([K(ve(0,1))],e.prototype,"fillOpacity",void 0),In([K(ge)],e.prototype,"stroke",void 0),In([K(ve(0))],e.prototype,"strokeWidth",void 0),e}(),Vn=function(){function e(){this.strokeWidth=void 0,this.dimOpacity=void 0,this.enabled=void 0}return In([K(ve(0))],e.prototype,"strokeWidth",void 0),In([K(ve(0,1))],e.prototype,"dimOpacity",void 0),In([K(ne)],e.prototype,"enabled",void 0),e}(),Wn=function(){function e(){this.fill=void 0,this.stroke=void 0,this.strokeWidth=void 0,this.item=new Bn,this.series=new Vn}return In([_n("Use item.fill instead.")],e.prototype,"fill",void 0),In([_n("Use item.stroke instead.")],e.prototype,"stroke",void 0),In([_n("Use item.strokeWidth instead.")],e.prototype,"strokeWidth",void 0),e}(),Hn=function(){function e(){this.enabled=!0}return In([K(oe)],e.prototype,"enabled",void 0),e}(),Un=function(e){function t(t){var r=void 0===t?{}:t,o=r.useSeriesGroupLayer,n=void 0===o||o,i=r.useLabelLayer,a=void 0!==i&&i,s=r.pickModes,l=void 0===s?[Mn.NEAREST_BY_MAIN_AXIS_FIRST]:s,c=e.call(this)||this;c.id=m(c),c.group=new Ut,c.directions=[Dr.X,Dr.Y],c.directionKeys={},c.nodeDataRefresh=!0,c._data=void 0,c._visible=!0,c.showInLegend=!0,c.cursor="default",c.highlightStyle=new Wn;var u=c.group;return c.backgroundGroup=u.appendChild(new Ut({name:c.id+"-background",layer:n,zIndex:gr.SERIES_BACKGROUND_ZINDEX})),c.seriesGroup=u.appendChild(new Ut({name:c.id+"-series",layer:n,zIndex:gr.SERIES_LAYER_ZINDEX})),c.pickGroup=c.seriesGroup.appendChild(new Ut),c.highlightGroup=u.appendChild(new Ut({name:c.id+"-highlight",layer:!0,zIndex:gr.SERIES_LAYER_ZINDEX,zIndexSubOrder:[c.id,15e3],optimiseDirtyTracking:!0})),c.highlightNode=c.highlightGroup.appendChild(new Ut),c.highlightLabel=c.highlightGroup.appendChild(new Ut),c.highlightNode.zIndex=0,c.highlightLabel.zIndex=10,c.pickModes=l,a&&(c.labelGroup=u.appendChild(new Ut({name:c.id+"-series-labels",layer:!0,zIndex:gr.SERIES_LABEL_ZINDEX}))),c}return Nn(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return this.constructor.type||""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e,this.nodeDataRefresh=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(e){this._visible=e,this.visibleChanged()},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){},Object.defineProperty(t.prototype,"grouped",{set:function(e){if(!0===e)throw new Error("AG Charts - grouped: true is unsupported for series of type: "+this.type)},enumerable:!0,configurable:!0}),t.prototype.setColors=function(e,t){},t.prototype.getKeys=function(e){var t=this,r=this.directionKeys,o=r&&r[e],n=[];return o&&o.forEach((function(e){var r=t[e];r&&(Array.isArray(r)?n.push.apply(n,kn(r)):n.push(r))})),n},t.prototype.markNodeDataDirty=function(){this.nodeDataRefresh=!0},t.prototype.visibleChanged=function(){},t.prototype.getOpacity=function(e){var t=this.highlightStyle.series,r=t.dimOpacity,o=void 0===r?1:r,n=t.enabled;if(!1===(void 0===n||n)||1===o)return 1;switch(this.isItemIdHighlighted(e)){case"no-highlight":case"highlighted":return 1;case"peer-highlighted":case"other-highlighted":return o}},t.prototype.getStrokeWidth=function(e,t){var r=this.highlightStyle.series,o=r.strokeWidth,n=r.enabled;if(!1===(void 0===n||n)||void 0===o)return e;switch(this.isItemIdHighlighted(t)){case"highlighted":return o;case"no-highlight":case"other-highlighted":case"peer-highlighted":return e}},t.prototype.isItemIdHighlighted=function(e){var t=this.chart,r=void 0===t?{}:t,o=r.highlightedDatum,n=void 0===o?{}:o,i=n.series,a=void 0===i?void 0:i,s=n.itemId,l=void 0===s?void 0:s,c=r.highlightedDatum;return null!=a?a!==this?"other-highlighted":void 0===l?"highlighted":e&&(void 0===c?void 0:c)!==e&&l!==e.itemId?"peer-highlighted":"highlighted":"no-highlight"},t.prototype.pickNode=function(e,t){var r,o,n=this.pickModes,i=this.visible,a=this.group;if(i&&a.visible)try{for(var s=Fn(n),l=s.next();!l.done;l=s.next()){var c=l.value;if(!t||t.includes(c)){var u=void 0;switch(c){case Mn.EXACT_SHAPE_MATCH:u=this.pickNodeExactShape(e);break;case Mn.NEAREST_BY_MAIN_AXIS_FIRST:case Mn.NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST:u=this.pickNodeMainAxisFirst(e,c===Mn.NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST);break;case Mn.NEAREST_NODE:u=this.pickNodeClosestDatum(e)}if(u)return{pickMode:c,match:u.datum,distance:u.distance}}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}},t.prototype.pickNodeExactShape=function(e){var t=this.pickGroup.pickNode(e.x,e.y);if(t)return{datum:t.datum,distance:0}},t.prototype.pickNodeClosestDatum=function(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")},t.prototype.pickNodeMainAxisFirst=function(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")},t.prototype.fireNodeClickEvent=function(e,t){var r=this.getNodeClickEvent(e,t);this.fireEvent(r)},t.prototype.getNodeClickEvent=function(e,t){return new zn(e,t,this)},t.prototype.toggleSeriesItem=function(e,t){this.visible=t,this.nodeDataRefresh=!0},t.prototype.isEnabled=function(){return this.visible},t.prototype.fixNumericExtent=function(e,t){if(void 0===e)return[];var r=Ln(e,2),o=r[0],n=r[1];if(n=+n,0===(o=+o)&&0===n)return[0,1];if(o===1/0&&n===-1/0)return[];if(o===1/0&&(o=0),n===-1/0&&(n=0),o===n)if(t instanceof bn)o-=1,n+=1;else{var i=Math.abs(.01*o);o-=i,n+=i}return xt(o)&&xt(n)?[o,n]:[]},t.highlightedZIndex=1e12,In([K(ie)],t.prototype,"id",void 0),In([K(oe)],t.prototype,"_visible",void 0),In([K(oe)],t.prototype,"showInLegend",void 0),In([K(ie)],t.prototype,"cursor",void 0),t}(W),Kn=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Yn=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Xn=function(e){function t(t,r,o,n){void 0===t&&(t=0),void 0===r&&(r=t),void 0===o&&(o=t),void 0===n&&(n=r);var i=e.call(this)||this;return i.top=t,i.right=r,i.bottom=o,i.left=n,i}return Kn(t,e),t.prototype.clear=function(){this.top=this.right=this.bottom=this.left=0},Yn([K(fe(0))],t.prototype,"top",void 0),Yn([K(fe(0))],t.prototype,"right",void 0),Yn([K(fe(0))],t.prototype,"bottom",void 0),Yn([K(fe(0))],t.prototype,"left",void 0),t}(W),qn=function(){this.stops=[]},Qn=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Zn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.angle=0,t}return Qn(t,e),t.prototype.createGradient=function(e,t){var r=this.stops,o=this.angle%360*Math.PI/180,n=Math.cos(o),i=Math.sin(o),a=t.width,s=t.height,l=t.x+.5*a,c=t.y+.5*s;if(a>0&&s>0){var u=Math.sqrt(s*s+a*a)*Math.abs(Math.cos(o-Math.atan(s/a)))/2,p=e.createLinearGradient(l+n*u,c+i*u,l-n*u,c-i*u);return r.forEach((function(e){p.addColorStop(e.offset,e.color)})),p}return"black"},t}(qn),Jn=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),$n=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};!function(e){e[e.Content=0]="Content",e[e.Border=1]="Border"}(Gn||(Gn={}));var ei=function(e){function t(){var t=e.call(this,(function(e){return t.renderRect(e)}))||this;return t.borderPath=new Gt,t.x=0,t.y=0,t.width=10,t.height=10,t.radius=0,t.crisp=!1,t.gradient=!1,t.lastUpdatePathStrokeWidth=k.defaultStyles.strokeWidth,t.effectiveStrokeWidth=k.defaultStyles.strokeWidth,t.microPixelEffectOpacity=1,t}return Jn(t,e),t.prototype.updateGradientInstance=function(){var e=this.fill;if(this.gradient){if(e){var t=new Zn;t.angle=270,t.stops=[{offset:0,color:U.fromString(e).brighter().toString()},{offset:1,color:U.fromString(e).darker().toString()}],this.gradientInstance=t}}else this.gradientInstance=void 0;this.gradientFill=e},t.prototype.isDirtyPath=function(){var e;return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty()||(null===(e=this.clipPath)||void 0===e?void 0:e.isDirty()))},t.prototype.updatePath=function(){var e,t,r,o=this.path,n=this.borderPath,i=this.crisp,a=this,s=a.x,l=a.y,c=a.width,u=a.height,p=a.strokeWidth,d=1/(null!=(t=null===(e=this.scene)||void 0===e?void 0:e.canvas.pixelRatio)?t:1),g=1;if(o.clear({trackChanges:!0}),n.clear({trackChanges:!0}),i&&(c<=d&&(g*=c/d),u<=d&&(g*=u/d),c=this.align(s,c),u=this.align(l,u),s=this.align(s),l=this.align(l)),p)if(c=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},oi=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.node=new ei,t._visible=!0,t}return ti(t,e),Object.defineProperty(t.prototype,"width",{get:function(){return this.node.width},set:function(e){this.node.width=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.node.height},set:function(e){this.node.height=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(e){this._visible=e,this.node.visible=this._visible},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(e){this._fill=e,this.node.fill=this._fill},enumerable:!0,configurable:!0}),ri([K(oe)],t.prototype,"_visible",void 0),ri([K(ge)],t.prototype,"_fill",void 0),t}(W),ni=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),ii=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},ai=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},si=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.x=0,t.y=0,t.size=12,t}return ni(t,e),t.prototype.computeBBox=function(){var e=this.x,t=this.y,r=this.size,o=r/2;return new h(e-o,t-o,r,r)},t.prototype.applyPath=function(e,t){var r,o,n=this.path,i=this.x,a=this.y;n.clear();try{for(var s=ai(t),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.x,p=c.y,d=c.t;i+=u*e,a+=p*e,"move"===d?n.moveTo(i,a):n.lineTo(i,a)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}n.closePath()},ii([er()],t.prototype,"x",void 0),ii([er()],t.prototype,"y",void 0),ii([er({convertor:Math.abs})],t.prototype,"size",void 0),t}(tr),li=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),ci=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return li(t,e),t.prototype.updatePath=function(){var e=this.path,t=this.x,r=this.y,o=this.size/2;e.clear(),e.moveTo(this.align(t-o),this.align(r-o)),e.lineTo(this.align(t+o),this.align(r-o)),e.lineTo(this.align(t+o),this.align(r+o)),e.lineTo(this.align(t-o),this.align(r+o)),e.closePath()},t.className="Square",t}(si),ui=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),pi=function(e){function t(){var t=e.call(this)||this;t.label=new B,t._marker=new ci,t._markerSize=15,t._spacing=8;var r=t.label;return r.textBaseline="middle",r.fontSize=12,r.fontFamily="Verdana, sans-serif",r.fill="black",r.y=F.has.textMetrics?1:0,t.append([t.marker,r]),t.update(),t}return ui(t,e),Object.defineProperty(t.prototype,"text",{get:function(){return this.label.text},set:function(e){this.label.text=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this.label.fontStyle},set:function(e){this.label.fontStyle=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this.label.fontWeight},set:function(e){this.label.fontWeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.label.fontSize},set:function(e){this.label.fontSize=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this.label.fontFamily},set:function(e){this.label.fontFamily=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.label.fill},set:function(e){this.label.fill=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"marker",{get:function(){return this._marker},set:function(e){this._marker!==e&&(this.removeChild(this._marker),this._marker=e,this.appendChild(e),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"markerSize",{get:function(){return this._markerSize},set:function(e){this._markerSize!==e&&(this._markerSize=e,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"markerFill",{get:function(){return this.marker.fill},set:function(e){this.marker.fill=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"markerStroke",{get:function(){return this.marker.stroke},set:function(e){this.marker.stroke=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"markerStrokeWidth",{get:function(){return this.marker.strokeWidth},set:function(e){this.marker.strokeWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"markerFillOpacity",{get:function(){return this.marker.fillOpacity},set:function(e){this.marker.fillOpacity=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"markerStrokeOpacity",{get:function(){return this.marker.strokeOpacity},set:function(e){this.marker.strokeOpacity=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"spacing",{get:function(){return this._spacing},set:function(e){this._spacing!==e&&(this._spacing=e,this.update())},enumerable:!0,configurable:!0}),t.prototype.update=function(){var e=this.marker,t=this.markerSize;e.size=t,this.label.x=t/2+this.spacing},t.prototype.render=function(t){this.marker.opacity=this.opacity,this.label.opacity=this.opacity,e.prototype.render.call(this,t)},t.className="MarkerLabel",t}(Ut),di=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),gi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return di(t,e),t.prototype.updatePath=function(){var e=this.x,t=this.y,r=this.path,o=this.size/2;r.clear(),r.cubicArc(e,t,o,o,0,0,2*Math.PI,0),r.closePath()},t.className="Circle",t}(si),hi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),fi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return hi(t,e),t.prototype.updatePath=function(){var r=this.size/4.2;e.prototype.applyPath.call(this,r,t.moves)},t.className="Cross",t.moves=[{x:-1,y:0,t:"move"},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:-1,y:1},{x:-1,y:-1}],t}(si),vi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),yi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vi(t,e),t.prototype.updatePath=function(){var r=this.size/2;e.prototype.applyPath.call(this,r,t.moves)},t.className="Diamond",t.moves=[{x:0,y:-1,t:"move"},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:1,y:-1}],t}(si),mi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),bi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return mi(t,e),t.prototype.rad=function(e){return e/180*Math.PI},t.prototype.updatePath=function(){var e=this.x,t=this.path,r=this.size,o=this.rad,n=r/4,i=this.y+n/2;t.clear(),t.cubicArc(e-n,i-n,n,n,0,o(130),o(330),0),t.cubicArc(e+n,i-n,n,n,0,o(220),o(50),0),t.lineTo(e,i+n),t.closePath()},t.className="Heart",t}(si),wi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Ci=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return wi(t,e),t.prototype.updatePath=function(){var r=this.size/3;e.prototype.applyPath.call(this,r,t.moves)},t.className="Plus",t.moves=[{x:-.5,y:-.5,t:"move"},{x:0,y:-1},{x:1,y:0},{x:0,y:1},{x:1,y:0},{x:0,y:1},{x:-1,y:0},{x:0,y:1},{x:-1,y:0},{x:0,y:-1},{x:-1,y:0},{x:0,y:-1}],t}(si),Oi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Si=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Oi(t,e),t.prototype.updatePath=function(){var r=1.1*this.size;e.prototype.applyPath.call(this,r,t.moves)},t.className="Triangle",t.moves=[{x:0,y:-.48,t:"move"},{x:.5,y:.87},{x:-1,y:0}],t}(si);function Ei(e){if(void 0===e&&(e=ci),"string"==typeof e)switch(e){case"circle":return gi;case"cross":return fi;case"diamond":return yi;case"heart":return bi;case"plus":return Ci;case"triangle":return Si;default:return ci}return"function"==typeof e?e:ci}var xi,Ri,Ti=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Ai=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},Pi=function(){for(var e=[],t=0;t=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(e){e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal"}(xi||(xi={})),function(e){e.Top="top",e.Right="right",e.Bottom="bottom",e.Left="left"}(Ri||(Ri={}));var Di=function(){function e(){this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif",this.formatter=void 0}return e.prototype.getFont=function(){return V(this.fontSize,this.fontFamily,this.fontStyle,this.fontWeight)},Ti([K(ve(0))],e.prototype,"maxLength",void 0),Ti([K(de)],e.prototype,"color",void 0),Ti([K(Se)],e.prototype,"fontStyle",void 0),Ti([K(xe)],e.prototype,"fontWeight",void 0),Ti([K(fe(0))],e.prototype,"fontSize",void 0),Ti([K(ie)],e.prototype,"fontFamily",void 0),Ti([K(re)],e.prototype,"formatter",void 0),e}(),Mi=function(){function e(){this.size=15,this._shape=void 0,this.padding=8,this.strokeWidth=1}return Object.defineProperty(e.prototype,"shape",{get:function(){return this._shape},set:function(e){var t;this._shape=e,null===(t=this.parent)||void 0===t||t.onMarkerShapeChange()},enumerable:!0,configurable:!0}),Ti([K(fe(0))],e.prototype,"size",void 0),Ti([K(fe(0))],e.prototype,"padding",void 0),Ti([K(fe(0))],e.prototype,"strokeWidth",void 0),e}(),Ni=function(){function e(){this.marker=new Mi,this.label=new Di,this.maxWidth=void 0,this.paddingX=16,this.paddingY=8}return Ti([K(ve(0))],e.prototype,"maxWidth",void 0),Ti([K(fe(0))],e.prototype,"paddingX",void 0),Ti([K(fe(0))],e.prototype,"paddingY",void 0),e}(),Ii=function(){},Li=function(){function e(){this.legendItemClick=Ii}return Ti([K(te)],e.prototype,"legendItemClick",void 0),e}(),ki=function(){function e(){this.id=m(this),this.group=new Ut({name:"legend",layer:!0,zIndex:gr.LEGEND_ZINDEX}),this.itemSelection=Xt.select(this.group).selectAll(),this.oldSize=[0,0],this.item=new Ni,this.listeners=new Li,this.truncatedItems=new Set,this._data=[],this._enabled=!0,this.orientation=xi.Vertical,this._position=Ri.Right,this.reverseOrder=void 0,this.spacing=20,this.characterWidths=new Map,this.size=[0,0],this.item.marker.parent=this}return Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e,this.group.visible=e.length>0&&this.enabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(e){this._enabled=e,this.group.visible=e&&this.data.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this._position},set:function(e){switch(this._position=e,e){case"right":case"left":this.orientation=xi.Vertical;break;case"bottom":case"top":this.orientation=xi.Horizontal}},enumerable:!0,configurable:!0}),e.prototype.onMarkerShapeChange=function(){this.itemSelection=this.itemSelection.setData([]),this.itemSelection.exit.remove(),this.group.markDirty(this.group,w.b.MINOR)},e.prototype.getCharacterWidths=function(e){var t=this.characterWidths;if(t.has(e))return t.get(e);var r={"...":F.getTextSize("...",e).width};return t.set(e,r),r},e.prototype.performLayout=function(e,t){var r=this,o=this.item,n=o.paddingX,i=o.paddingY,a=o.label,s=o.maxWidth,l=o.marker,c=l.size,u=l.padding,p=l.shape,d=o.label,g=d.maxLength,h=void 0===g?1/0:g,f=d.fontStyle,v=d.fontWeight,y=d.fontSize,m=d.fontFamily,b=Pi(this.data);this.reverseOrder&&b.reverse();var w=this.itemSelection.setData(b,(function(e,t){var r=Ei(p||t.marker.shape);return t.id+"-"+t.itemId+"-"+r.name}));w.exit.remove();var C=w.enter.append(pi).each((function(e,t){var r=Ei(p||t.marker.shape);e.marker=new r})),O=this.itemSelection=w.merge(C),S=O.size,E=[],x=a.getFont(),R=null!=s?s:.8*e;O.each((function(e,t){var o,n,i,a=null!=(i=t.label.text)?i:"";e.markerSize=c,e.spacing=u,e.fontStyle=f,e.fontWeight=v,e.fontSize=y,e.fontFamily=m;var s=a.split(""),l=!1;if(a.length>h&&(a=""+a.substring(0,h),l=!0),c+u+F.getTextSize(a,x).width>R){var p="",d=r.getCharacterWidths(x),g=d["..."];try{for(var b=_i(s),w=b.next();!w.done;w=b.next()){var C=w.value;if(d[C]||(d[C]=F.getTextSize(C,x).width),(g+=d[C])>R)break;p+=C}}catch(e){o={error:e}}finally{try{w&&!w.done&&(n=b.return)&&n.call(b)}finally{if(o)throw o.error}}a=p,l=!0}var O=t.itemId||t.id;l?(a+="...",r.truncatedItems.add(O)):r.truncatedItems.delete(O),e.text=a,E.push(e.computeBBox())}));var T=E.length&&E[0].height,A=0,P=0,_=0,D=0;switch(e=Math.max(1,e),t=Math.max(1,t),this.orientation){case xi.Horizontal:if(!(isFinite(e)&&e>0))return!1;A=0;var M=0;do{var N=0;M=0,P=0,A++;for(var I=0;IP&&(P=G.width),++I%A==0&&(N+=P,P=0,M++)}I%A!=0&&(N+=P,M++),_=N+(M-1)*n}while(_>e&&M>1);D=T*A+(A-1)*i;break;case xi.Vertical:if(!(isFinite(t)&&t>0))return!1;A=2*S;do{A=(A>>1)+A%2,P=0;N=0;var L=0,k=0;for(I=0;IP&&(P=G.width),++I%A==0&&(N+=P,P=0,k++)}I%A!=0&&(N+=P,k++),_=N+(k-1)*n,D=L+(A-1)*i}while(D>t&&A>1)}var j=(e-_)/2,z=(t-D)/2,B=0,V=0;P=0,O.each((function(e,t,r){e.translationX=Math.floor(j+B),e.translationY=Math.floor(z+V);var o=E[r];o.width>P&&(P=o.width),(r+1)%A==0?(B+=P+n,V=0,P=0):V+=o.height+i})),this.update();var W=this.size,H=this.oldSize;W[0]=_,W[1]=D,W[0]===H[0]&&W[1]===H[1]||(H[0]=W[0],H[1]=W[1])},e.prototype.update=function(){var e=this.item,t=e.marker.strokeWidth,r=e.label.color;this.itemSelection.each((function(e,o){var n=o.marker;e.markerFill=n.fill,e.markerStroke=n.stroke,e.markerStrokeWidth=t,e.markerFillOpacity=n.fillOpacity,e.markerStrokeOpacity=n.strokeOpacity,e.opacity=o.enabled?1:.5,e.color=r}))},e.prototype.getDatumForPoint=function(e,t){var r=this.group.pickNode(e,t);if(r&&r.parent)return r.parent.datum},e.className="Legend",Ti([K(oe)],e.prototype,"_enabled",void 0),Ti([K(Ne)],e.prototype,"_position",void 0),Ti([K(ne)],e.prototype,"reverseOrder",void 0),Ti([K(fe(0))],e.prototype,"spacing",void 0),e}(),Fi=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gi=function(){function e(){}return e.init=function(){var e=this,t=window.ResizeObserver;if(t)this.resizeObserver=new t((function(t){var r,o;try{for(var n=Fi(t),i=n.next();!i.done;i=n.next()){var a=i.value,s=a.contentRect,l=s.width,c=s.height;e.checkSize(e.elements.get(a.target),a.target,l,c)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}}));else{window.setInterval((function(){e.elements.forEach((function(t,r){e.checkClientSize(r,t)}))}),100)}this.ready=!0},e.checkSize=function(e,t,r,o){e&&(e.size&&r===e.size.width&&o===e.size.height||(e.size={width:r,height:o},e.cb(e.size,t)))},e.observe=function(e,t){this.ready||this.init(),this.unobserve(e),this.resizeObserver&&this.resizeObserver.observe(e),this.elements.set(e,{cb:t}),this.checkClientSize(e,{cb:t})},e.unobserve=function(e){this.resizeObserver&&this.resizeObserver.unobserve(e),this.elements.delete(e)},e.checkClientSize=function(e,t){var r=e.clientWidth?e.clientWidth:0,o=e.clientHeight?e.clientHeight:0;this.checkSize(t,e,r,o)},e.elements=new Map,e.ready=!1,e}(),ji=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))},zi=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]0&&e(l)},l=function(){var e=n;n=0,i=!0;var r=t({count:e});r?r.then(s).catch(s):s()};return{schedule:function(){0!==n||a()||e(l),n++},await:function(){return ji(this,void 0,void 0,(function(){return zi(this,(function(e){switch(e.label){case 0:if(!a())return[2];r||(r=new Promise((function(e){o=e}))),e.label=1;case 1:return a()?[4,r]:[3,3];case 2:return e.sent(),[3,1];case 3:return[2]}}))}))}}}var Vi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Wi=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Hi=["circle","cross","diamond","heart","plus","square","triangle"],Ui=Y((function(e){return Hi.includes(e)||Object.getPrototypeOf(e)===si}),"expecting a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class"),Ki=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.enabled=!0,t.shape=gi,t.size=6,t.maxSize=30,t.domain=void 0,t.fill=void 0,t.stroke=void 0,t.strokeWidth=1,t.fillOpacity=void 0,t.strokeOpacity=void 0,t}return Vi(t,e),Wi([Ie({validatePredicate:oe,sceneChangeDetectionOpts:{redraw:w.b.MAJOR}})],t.prototype,"enabled",void 0),Wi([Ie({validatePredicate:Ui,sceneChangeDetectionOpts:{redraw:w.b.MAJOR}})],t.prototype,"shape",void 0),Wi([Ie({validatePredicate:fe(0),sceneChangeDetectionOpts:{redraw:w.b.MAJOR}})],t.prototype,"size",void 0),Wi([Ie({validatePredicate:fe(0),sceneChangeDetectionOpts:{redraw:w.b.MAJOR}})],t.prototype,"maxSize",void 0),Wi([Ie({validatePredicate:me,sceneChangeDetectionOpts:{redraw:w.b.MAJOR}})],t.prototype,"domain",void 0),Wi([Ie({validatePredicate:ge,sceneChangeDetectionOpts:{redraw:w.b.MAJOR}})],t.prototype,"fill",void 0),Wi([Ie({validatePredicate:ge,sceneChangeDetectionOpts:{redraw:w.b.MAJOR}})],t.prototype,"stroke",void 0),Wi([Ie({validatePredicate:ve(0),sceneChangeDetectionOpts:{redraw:w.b.MAJOR}})],t.prototype,"strokeWidth",void 0),Wi([Ie({validatePredicate:ve(0,1),sceneChangeDetectionOpts:{redraw:w.b.MAJOR}})],t.prototype,"fillOpacity",void 0),Wi([Ie({validatePredicate:ve(0,1),sceneChangeDetectionOpts:{redraw:w.b.MAJOR}})],t.prototype,"strokeOpacity",void 0),t}(w.a),Yi=function(){return(Yi=Object.assign||function(e){for(var t,r=1,o=arguments.length;r0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},qi=function(){for(var e=[],t=0;t=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Zi(e,t){var r,o,n=ra(e),i=ra(t);if("array"===i)return"array"!==n||e.length!==t.length||t.some((function(t,r){var o;return null!=Zi(null===(o=e)||void 0===o?void 0:o[r],t)}))?qi(t):null;if("primitive"===i)return"primitive"!==n?Yi({},t):e!==t?t:null;var a=e||{},s=t||{},l=new Set(qi(Object.keys(a),Object.keys(s))),c=0,u={},p=function(e){if(a[e]===s[e])return"continue";var t=function(t){u[e]=t,c++},r=ra(a[e]),o=ra(s[e]);if(r!==o)return t(s[e]),"continue";if("primitive"===o||null===o)return t(s[e]),"continue";if("array"===o&&a[e].length!==s[e].length)return t(s[e]),"continue";if("class-instance"===o)return t(s[e]),"continue";if("function"===o&&a[e]!==s[e])return t(s[e]),"continue";var n=Zi(a[e],s[e]);null!==n&&t(n)};try{for(var d=Qi(l),g=d.next();!g.done;g=d.next()){p(g.value)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}return 0===c?null:u}var Ji=Symbol(""),$i=Symbol("");function ea(e,t){var r,o,n,i=(null===(n=t)||void 0===n?void 0:n.avoidDeepClone)||[];if(e.map((function(e){return ra(e)})).some((function(e){return"array"===e}))){var a=e[e.length-1];return a instanceof Array?a.map((function(e){var r=ra(e);return"array"===r?ea([[],e],t):"object"===r?ea([{},e],t):e})):a}var s={},l=new Set(e.map((function(e){return null!=e?Object.keys(e):[]})).reduce((function(e,t){return e.concat(t)}),[])),c=function(r){var o=e.map((function(e){return null!=e&&r in e?e[r]:$i})).filter((function(e){return e!==$i}));if(0===o.length)return"continue";var n=o[o.length-1];if(n===Ji)return"continue";var a=o.map((function(e){return ra(e)})),l=a[0];if(a.some((function(e){return e!==l&&null!==e})))return s[r]=n,"continue";"array"!==l&&"object"!==l||i.includes(r)?s[r]="array"===l?qi(n):n:s[r]=ea(o,t)};try{for(var u=Qi(l),p=u.next();!p.done;p=u.next()){c(p.value)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return s}function ta(e,t,r){var o,n,i,a;void 0===r&&(r={});var s=r.path,l=void 0===s?void 0:s,c=r.matcherPath,u=void 0===c?l?l.replace(/(\[[0-9+]+\])/i,"[]"):void 0:c,p=r.skip,d=void 0===p?[]:p,g=r.constructors,h=void 0===g?{}:g,f=r.allowedTypes,v=void 0===f?{}:f;if(null==e)throw new Error("AG Charts - target is uninitialised: "+(l||""));if(null==t)return e;var y=ra(e),m=function(s){var c=(u?u+".":"")+s;if(d.indexOf(c)>=0)return"continue";var p=t[s],g=(l?l+".":"")+s,f=e,m=f.constructor,b=f[s],w=null!=(o=h[s])?o:h[c];try{var C=ra(b),O=ra(p);if("class-instance"===y&&!(s in e)&&!f.hasOwnProperty(s))return console.warn("AG Charts - unable to set ["+g+"] in "+(null===(n=m)||void 0===n?void 0:n.name)+" - property is unknown"),"continue";var S=v[c]||[C];if("class-instance"===C&&"object"===O);else if(null!=C&&null!=O&&!S.includes(O))return console.warn("AG Charts - unable to set ["+g+"] in "+(null===(i=m)||void 0===i?void 0:i.name)+" - can't apply type of ["+O+"], allowed types are: ["+S+"]"),"continue";if("array"===O)if(null!=(w=null!=w?w:h[c+"[]"])){var E=p;f[s]=E.map((function(e){return ta(new w,e,Yi(Yi({},r),{path:g,matcherPath:c+"[]"}))}))}else f[s]=p;else"class-instance"===O?f[s]=p:"object"===O?null!=b?ta(b,p,Yi(Yi({},r),{path:g,matcherPath:c})):f[s]=null!=w?ta(new w,p,Yi(Yi({},r),{path:g,matcherPath:c})):p:f[s]=p}catch(e){return console.warn("AG Charts - unable to set ["+g+"] in ["+(null===(a=m)||void 0===a?void 0:a.name)+"]; nested error is: "+e.message),"continue"}};for(var b in t)m(b);return e}function ra(e){return null==e?null:e instanceof HTMLElement?"primitive":e instanceof Array?"array":e instanceof Date?"primitive":"object"==typeof e&&e.constructor===Object?"object":"function"==typeof e?"function":"object"==typeof e&&null!=e.constructor?"class-instance":"primitive"}var oa=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),na=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},ia=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))},aa=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},la=function(){for(var e=[],t=0;t