horizon-timeseries-chart
Version:
A chart to represent time-series data using multiple vertically layered horizon area plots
3 lines • 113 kB
JavaScript
// Version 1.11.4 horizon-timeseries-chart - https://github.com/vasturiano/horizon-timeseries-chart
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).HorizonTSChart=n()}(this,(function(){"use strict";function t(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e<n;e++)r[e]=t[e];return r}function n(t,n,e){return(n=function(t){var n=function(t,n){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,n||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==typeof n?n:n+""}(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function e(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function r(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))}))}return t}function i(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,i,o,a,u=[],l=!0,c=!1;try{if(o=(e=e.call(t)).next,0===n);else for(;!(l=(r=o.call(e)).done)&&(u.push(r.value),u.length!==n);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw i}}return u}}(t,n)||u(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(n){return function(n){if(Array.isArray(n))return t(n)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||u(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function u(n,e){if(n){if("string"==typeof n)return t(n,e);var r={}.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(n,e):void 0}}!function(t,n){void 0===n&&(n={});var e=n.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===e&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}(".horizon-series {\n position: relative;\n border: 0 solid darkgray;\n}\n\n.horizon-series:hover {\n border-top: 1px solid indianred;\n border-bottom: 1px solid indianred;\n}\n\n.horizon-series .label {\n position: absolute;\n bottom: 0;\n left: 4px;\n font-family: sans-serif;\n text-shadow: 0 1px 0 rgba(255, 255, 255, .5);\n pointer-events: none;\n}\n\n.horizon-series .chart .float-tooltip-kap {\n z-index: 1000;\n}\n\n.horizon-ruler {\n position: absolute;\n background: black;\n opacity: 0;\n top: 0;\n bottom: 0;\n width: 1px;\n pointer-events: none;\n transition: opacity 0.5s;\n z-index: 100;\n}");var l="http://www.w3.org/1999/xhtml",c={svg:"http://www.w3.org/2000/svg",xhtml:l,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function s(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),c.hasOwnProperty(n)?{space:c[n],local:t}:t}function f(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===l&&n.documentElement.namespaceURI===l?n.createElement(t):n.createElementNS(e,t)}}function h(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function p(t){var n=s(t);return(n.local?h:f)(n)}function d(){}function y(t){return null==t?d:function(){return this.querySelector(t)}}function g(){return[]}function v(t){return null==t?g:function(){return this.querySelectorAll(t)}}function m(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}function _(t){return function(){return this.matches(t)}}function w(t){return function(n){return n.matches(t)}}var b=Array.prototype.find;function x(){return this.firstElementChild}var M=Array.prototype.filter;function S(){return Array.from(this.children)}function C(t){return new Array(t.length)}function T(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function A(t,n,e,r,i,o){for(var a,u=0,l=n.length,c=o.length;u<c;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new T(t,o[u]);for(;u<l;++u)(a=n[u])&&(i[u]=a)}function k(t,n,e,r,i,o,a){var u,l,c,s=new Map,f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(l=n[u])&&(p[u]=c=a.call(l,l.__data__,u,n)+"",s.has(c)?i[u]=l:s.set(c,l));for(u=0;u<h;++u)c=a.call(t,o[u],u,o)+"",(l=s.get(c))?(r[u]=l,l.__data__=o[u],s.delete(c)):e[u]=new T(t,o[u]);for(u=0;u<f;++u)(l=n[u])&&s.get(p[u])===l&&(i[u]=l)}function E(t){return t.__data__}function $(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function z(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function N(t){return function(){this.removeAttribute(t)}}function j(t){return function(){this.removeAttributeNS(t.space,t.local)}}function D(t,n){return function(){this.setAttribute(t,n)}}function U(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function O(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function P(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function F(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function H(t){return function(){this.style.removeProperty(t)}}function Y(t,n,e){return function(){this.style.setProperty(t,n,e)}}function I(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function L(t,n){return t.style.getPropertyValue(n)||F(t).getComputedStyle(t,null).getPropertyValue(n)}function q(t){return function(){delete this[t]}}function X(t,n){return function(){this[t]=n}}function V(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function B(t){return t.trim().split(/^|\s+/)}function R(t){return t.classList||new W(t)}function W(t){this._node=t,this._names=B(t.getAttribute("class")||"")}function Z(t,n){for(var e=R(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function G(t,n){for(var e=R(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function Q(t){return function(){Z(this,t)}}function J(t){return function(){G(this,t)}}function K(t,n){return function(){(n.apply(this,arguments)?Z:G)(this,t)}}function tt(){this.textContent=""}function nt(t){return function(){this.textContent=t}}function et(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function rt(){this.innerHTML=""}function it(t){return function(){this.innerHTML=t}}function ot(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function at(){this.nextSibling&&this.parentNode.appendChild(this)}function ut(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function lt(){return null}function ct(){var t=this.parentNode;t&&t.removeChild(this)}function st(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ft(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ht(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function pt(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var a=0,u=i.length;a<u;++a)if((r=i[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function dt(t,n,e){var r=F(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function yt(t,n){return function(){return dt(this,t,n)}}function gt(t,n){return function(){return dt(this,t,n.apply(this,arguments))}}T.prototype={constructor:T,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},W.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var vt=[null];function mt(t,n){this._groups=t,this._parents=n}function _t(){return new mt([[document.documentElement]],vt)}function wt(t){return"string"==typeof t?new mt([[document.querySelector(t)]],[document.documentElement]):new mt([[t]],vt)}function bt(t,n){if(t=function(t){let n;for(;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]}mt.prototype=_t.prototype={constructor:mt,select:function(t){"function"!=typeof t&&(t=y(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],l=u.length,c=r[i]=new Array(l),s=0;s<l;++s)(o=u[s])&&(a=t.call(o,o.__data__,s,u))&&("__data__"in o&&(a.__data__=o.__data__),c[s]=a);return new mt(r,this._parents)},selectAll:function(t){t="function"==typeof t?m(t):v(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a,u=n[o],l=u.length,c=0;c<l;++c)(a=u[c])&&(r.push(t.call(a,a.__data__,c,u)),i.push(a));return new mt(r,i)},selectChild:function(t){return this.select(null==t?x:function(t){return function(){return b.call(this.children,t)}}("function"==typeof t?t:w(t)))},selectChildren:function(t){return this.selectAll(null==t?S:function(t){return function(){return M.call(this.children,t)}}("function"==typeof t?t:w(t)))},filter:function(t){"function"!=typeof t&&(t=_(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,l=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&l.push(o);return new mt(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,E);var e=n?k:A,r=this._parents,i=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var o=i.length,a=new Array(o),u=new Array(o),l=new Array(o),c=0;c<o;++c){var s=r[c],f=i[c],h=f.length,p=$(t.call(s,s&&s.__data__,c,r)),d=p.length,y=u[c]=new Array(d),g=a[c]=new Array(d);e(s,f,y,g,l[c]=new Array(h),p,n);for(var v,m,_=0,w=0;_<d;++_)if(v=y[_]){for(_>=w&&(w=_+1);!(m=g[w])&&++w<d;);v._next=m||null}}return(a=new mt(a,r))._enter=u,a._exit=l,a},enter:function(){return new mt(this._enter||this._groups.map(C),this._parents)},exit:function(){return new mt(this._exit||this._groups.map(C),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=n&&(i=n(i))&&(i=i.selection()),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,a=Math.min(i,o),u=new Array(i),l=0;l<a;++l)for(var c,s=e[l],f=r[l],h=s.length,p=u[l]=new Array(h),d=0;d<h;++d)(c=s[d]||f[d])&&(p[d]=c);for(;l<i;++l)u[l]=e[l];return new mt(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=z);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],l=u.length,c=i[o]=new Array(l),s=0;s<l;++s)(a=u[s])&&(c[s]=a);c.sort(n)}return new mt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=s(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?j:N:"function"==typeof n?e.local?P:O:e.local?U:D)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?H:"function"==typeof n?I:Y)(t,n,null==e?"":e)):L(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?q:"function"==typeof n?V:X)(t,n)):this.node()[t]},classed:function(t,n){var e=B(t+"");if(arguments.length<2){for(var r=R(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?K:n?Q:J)(e,n))},text:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?et:nt)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?rt:("function"==typeof t?ot:it)(t)):this.node().innerHTML},raise:function(){return this.each(at)},lower:function(){return this.each(ut)},append:function(t){var n="function"==typeof t?t:p(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:p(t),r=null==n?lt:"function"==typeof n?n:y(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(ct)},clone:function(t){return this.select(t?ft:st)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=function(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?pt:ht,r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var l,c=0,s=u.length;c<s;++c)for(r=0,l=u[c];r<a;++r)if((i=o[r]).type===l.type&&i.name===l.name)return l.value},dispatch:function(t,n){return this.each(("function"==typeof n?gt:yt)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};var xt={value:()=>{}};function Mt(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new St(r)}function St(t){this._=t}function Ct(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function Tt(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=xt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}St.prototype=Mt.prototype={constructor:St,on:function(t,n){var e,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");if(e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a<u;)if(e=(t=o[a]).type)i[e]=Tt(i[e],t.name,n);else if(null==n)for(e in i)i[e]=Tt(i[e],t.name,null);return this}for(;++a<u;)if((e=(t=o[a]).type)&&(e=Ct(i[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new St(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var At,kt,Et=0,$t=0,zt=0,Nt=0,jt=0,Dt=0,Ut="object"==typeof performance&&performance.now?performance:Date,Ot="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Pt(){return jt||(Ot(Ft),jt=Ut.now()+Dt)}function Ft(){jt=0}function Ht(){this._call=this._time=this._next=null}function Yt(t,n,e){var r=new Ht;return r.restart(t,n,e),r}function It(){jt=(Nt=Ut.now())+Dt,Et=$t=0;try{!function(){Pt(),++Et;for(var t,n=At;n;)(t=jt-n._time)>=0&&n._call.call(void 0,t),n=n._next;--Et}()}finally{Et=0,function(){var t,n,e=At,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:At=n);kt=t,qt(r)}(),jt=0}}function Lt(){var t=Ut.now(),n=t-Nt;n>1e3&&(Dt-=n,Nt=t)}function qt(t){Et||($t&&($t=clearTimeout($t)),t-jt>24?(t<1/0&&($t=setTimeout(It,t-Ut.now()-Dt)),zt&&(zt=clearInterval(zt))):(zt||(Nt=Ut.now(),zt=setInterval(Lt,1e3)),Et=1,Ot(It)))}function Xt(t,n,e){var r=new Ht;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}Ht.prototype=Yt.prototype={constructor:Ht,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Pt():+e)+(null==n?0:+n),this._next||kt===this||(kt?kt._next=this:At=this,kt=this),this._call=t,this._time=e,qt()},stop:function(){this._call&&(this._call=null,this._time=1/0,qt())}};var Vt=Mt("start","end","cancel","interrupt"),Bt=[];function Rt(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=1,e.timer.restart(a,e.delay,e.time),e.delay<=t&&a(t-e.delay)}function a(o){var c,s,f,h;if(1!==e.state)return l();for(c in i)if((h=i[c]).name===e.name){if(3===h.state)return Xt(a);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+c<n&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete i[c])}if(Xt((function(){3===e.state&&(e.state=4,e.timer.restart(u,e.delay,e.time),u(o))})),e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(f=e.tween.length),c=0,s=-1;c<f;++c)(h=e.tween[c].value.call(t,t.__data__,e.index,e.group))&&(r[++s]=h);r.length=s+1}}function u(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(l),e.state=5,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),l())}function l(){for(var r in e.state=6,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=Yt(o,0,e.time)}(t,e,{name:n,index:r,group:i,on:Vt,tween:Bt,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function Wt(t,n){var e=Gt(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function Zt(t,n){var e=Gt(t,n);if(e.state>3)throw new Error("too late; already running");return e}function Gt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Qt(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):a=!1;a&&delete t.__transition}}function Jt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Kt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function tn(){}var nn=.7,en=1/nn,rn="\\s*([+-]?\\d+)\\s*",on="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",an="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",un=/^#([0-9a-f]{3,8})$/,ln=new RegExp(`^rgb\\(${rn},${rn},${rn}\\)$`),cn=new RegExp(`^rgb\\(${an},${an},${an}\\)$`),sn=new RegExp(`^rgba\\(${rn},${rn},${rn},${on}\\)$`),fn=new RegExp(`^rgba\\(${an},${an},${an},${on}\\)$`),hn=new RegExp(`^hsl\\(${on},${an},${an}\\)$`),pn=new RegExp(`^hsla\\(${on},${an},${an},${on}\\)$`),dn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function yn(){return this.rgb().formatHex()}function gn(){return this.rgb().formatRgb()}function vn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=un.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?mn(n):3===e?new bn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?_n(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?_n(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=ln.exec(t))?new bn(n[1],n[2],n[3],1):(n=cn.exec(t))?new bn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=sn.exec(t))?_n(n[1],n[2],n[3],n[4]):(n=fn.exec(t))?_n(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=hn.exec(t))?An(n[1],n[2]/100,n[3]/100,1):(n=pn.exec(t))?An(n[1],n[2]/100,n[3]/100,n[4]):dn.hasOwnProperty(t)?mn(dn[t]):"transparent"===t?new bn(NaN,NaN,NaN,0):null}function mn(t){return new bn(t>>16&255,t>>8&255,255&t,1)}function _n(t,n,e,r){return r<=0&&(t=n=e=NaN),new bn(t,n,e,r)}function wn(t,n,e,r){return 1===arguments.length?((i=t)instanceof tn||(i=vn(i)),i?new bn((i=i.rgb()).r,i.g,i.b,i.opacity):new bn):new bn(t,n,e,null==r?1:r);var i}function bn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function xn(){return`#${Tn(this.r)}${Tn(this.g)}${Tn(this.b)}`}function Mn(){const t=Sn(this.opacity);return`${1===t?"rgb(":"rgba("}${Cn(this.r)}, ${Cn(this.g)}, ${Cn(this.b)}${1===t?")":`, ${t})`}`}function Sn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Cn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Tn(t){return((t=Cn(t))<16?"0":"")+t.toString(16)}function An(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new En(t,n,e,r)}function kn(t){if(t instanceof En)return new En(t.h,t.s,t.l,t.opacity);if(t instanceof tn||(t=vn(t)),!t)return new En;if(t instanceof En)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,l=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e<r):e===o?(r-n)/u+2:(n-e)/u+4,u/=l<.5?o+i:2-o-i,a*=60):u=l>0&&l<1?0:a,new En(a,u,l,t.opacity)}function En(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function $n(t){return(t=(t||0)%360)<0?t+360:t}function zn(t){return Math.max(0,Math.min(1,t||0))}function Nn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Jt(tn,vn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:yn,formatHex:yn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return kn(this).formatHsl()},formatRgb:gn,toString:gn}),Jt(bn,wn,Kt(tn,{brighter(t){return t=null==t?en:Math.pow(en,t),new bn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?nn:Math.pow(nn,t),new bn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new bn(Cn(this.r),Cn(this.g),Cn(this.b),Sn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xn,formatHex:xn,formatHex8:function(){return`#${Tn(this.r)}${Tn(this.g)}${Tn(this.b)}${Tn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Mn,toString:Mn})),Jt(En,(function(t,n,e,r){return 1===arguments.length?kn(t):new En(t,n,e,null==r?1:r)}),Kt(tn,{brighter(t){return t=null==t?en:Math.pow(en,t),new En(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?nn:Math.pow(nn,t),new En(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new bn(Nn(t>=240?t-240:t+120,i,r),Nn(t,i,r),Nn(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new En($n(this.h),zn(this.s),zn(this.l),Sn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Sn(this.opacity);return`${1===t?"hsl(":"hsla("}${$n(this.h)}, ${100*zn(this.s)}%, ${100*zn(this.l)}%${1===t?")":`, ${t})`}`}}));var jn=t=>()=>t;function Dn(t){return 1==(t=+t)?Un:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):jn(isNaN(n)?e:n)}}function Un(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):jn(isNaN(t)?n:t)}var On=function t(n){var e=Dn(n);function r(t,n){var r=e((t=wn(t)).r,(n=wn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=Un(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function Pn(t,n){n||(n=[]);var e,r=t?Math.min(n.length,t.length):0,i=n.slice();return function(o){for(e=0;e<r;++e)i[e]=t[e]*(1-o)+n[e]*o;return i}}function Fn(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(e=0;e<i;++e)o[e]=Vn(t[e],n[e]);for(;e<r;++e)a[e]=n[e];return function(t){for(e=0;e<i;++e)a[e]=o[e](t);return a}}function Hn(t,n){var e=new Date;return t=+t,n=+n,function(r){return e.setTime(t*(1-r)+n*r),e}}function Yn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function In(t,n){var e,r={},i={};for(e in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)e in t?r[e]=Vn(t[e],n[e]):i[e]=n[e];return function(t){for(e in r)i[e]=r[e](t);return i}}var Ln=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qn=new RegExp(Ln.source,"g");function Xn(t,n){var e,r,i,o=Ln.lastIndex=qn.lastIndex=0,a=-1,u=[],l=[];for(t+="",n+="";(e=Ln.exec(t))&&(r=qn.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,l.push({i:a,x:Yn(e,r)})),o=qn.lastIndex;return o<n.length&&(i=n.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?l[0]?function(t){return function(n){return t(n)+""}}(l[0].x):function(t){return function(){return t}}(n):(n=l.length,function(t){for(var e,r=0;r<n;++r)u[(e=l[r]).i]=e.x(t);return u.join("")})}function Vn(t,n){var e,r=typeof n;return null==n||"boolean"===r?jn(n):("number"===r?Yn:"string"===r?(e=vn(n))?(n=e,On):Xn:n instanceof vn?On:n instanceof Date?Hn:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(n)?Pn:Array.isArray(n)?Fn:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?In:Yn)(t,n)}function Bn(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}var Rn,Wn=180/Math.PI,Zn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Gn(t,n,e,r,i,o){var a,u,l;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(l=t*e+n*r)&&(e-=t*l,r-=n*l),(u=Math.sqrt(e*e+r*r))&&(e/=u,r/=u,l/=u),t*r<n*e&&(t=-t,n=-n,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Wn,skewX:Math.atan(l)*Wn,scaleX:a,scaleY:u}}function Qn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var u=[],l=[];return o=t(o),a=t(a),function(t,r,i,o,a,u){if(t!==i||r!==o){var l=a.push("translate(",null,n,null,e);u.push({i:l-4,x:Yn(t,i)},{i:l-2,x:Yn(r,o)})}else(i||o)&&a.push("translate("+i+n+o+e)}(o.translateX,o.translateY,a.translateX,a.translateY,u,l),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Yn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,l),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Yn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,l),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:Yn(t,e)},{i:u-2,x:Yn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,l),o=a=null,function(t){for(var n,e=-1,r=l.length;++e<r;)u[(n=l[e]).i]=n.x(t);return u.join("")}}}var Jn=Qn((function(t){const n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?Zn:Gn(n.a,n.b,n.c,n.d,n.e,n.f)}),"px, ","px)","deg)"),Kn=Qn((function(t){return null==t?Zn:(Rn||(Rn=document.createElementNS("http://www.w3.org/2000/svg","g")),Rn.setAttribute("transform",t),(t=Rn.transform.baseVal.consolidate())?Gn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Zn)}),", ",")",")");function te(t){return((t=Math.exp(t))+1/t)/2}var ne=function t(n,e,r){function i(t,i){var o,a,u=t[0],l=t[1],c=t[2],s=i[0],f=i[1],h=i[2],p=s-u,d=f-l,y=p*p+d*d;if(y<1e-12)a=Math.log(h/c)/n,o=function(t){return[u+t*p,l+t*d,c*Math.exp(n*t*a)]};else{var g=Math.sqrt(y),v=(h*h-c*c+r*y)/(2*c*e*g),m=(h*h-c*c-r*y)/(2*h*e*g),_=Math.log(Math.sqrt(v*v+1)-v),w=Math.log(Math.sqrt(m*m+1)-m);a=(w-_)/n,o=function(t){var r=t*a,i=te(_),o=c/(e*g)*(i*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(n*r+_)-function(t){return((t=Math.exp(t))-1/t)/2}(_));return[u+o*p,l+o*d,c*i/te(n*r+_)]}}return o.duration=1e3*a*n/Math.SQRT2,o}return i.rho=function(n){var e=Math.max(.001,+n),r=e*e;return t(e,r,r*r)},i}(Math.SQRT2,2,4);function ee(t,n){var e,r;return function(){var i=Zt(this,t),o=i.tween;if(o!==e)for(var a=0,u=(r=e=o).length;a<u;++a)if(r[a].name===n){(r=r.slice()).splice(a,1);break}i.tween=r}}function re(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Zt(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var u={name:n,value:e},l=0,c=i.length;l<c;++l)if(i[l].name===n){i[l]=u;break}l===c&&i.push(u)}o.tween=i}}function ie(t,n,e){var r=t._id;return t.each((function(){var t=Zt(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return Gt(t,r).value[n]}}function oe(t,n){var e;return("number"==typeof n?Yn:n instanceof vn?On:(e=vn(n))?(n=e,On):Xn)(t,n)}function ae(t){return function(){this.removeAttribute(t)}}function ue(t){return function(){this.removeAttributeNS(t.space,t.local)}}function le(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=n(r=a,e)}}function ce(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=n(r=a,e)}}function se(t,n,e){var r,i,o;return function(){var a,u,l=e(this);if(null!=l)return(a=this.getAttribute(t))===(u=l+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,l));this.removeAttribute(t)}}function fe(t,n,e){var r,i,o;return function(){var a,u,l=e(this);if(null!=l)return(a=this.getAttributeNS(t.space,t.local))===(u=l+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,l));this.removeAttributeNS(t.space,t.local)}}function he(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}(t,i)),e}return i._value=n,i}function pe(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}(t,i)),e}return i._value=n,i}function de(t,n){return function(){Wt(this,t).delay=+n.apply(this,arguments)}}function ye(t,n){return n=+n,function(){Wt(this,t).delay=n}}function ge(t,n){return function(){Zt(this,t).duration=+n.apply(this,arguments)}}function ve(t,n){return n=+n,function(){Zt(this,t).duration=n}}var me=_t.prototype.constructor;function _e(t){return function(){this.style.removeProperty(t)}}var we=0;function be(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function xe(t){return _t().transition(t)}function Me(){return++we}var Se=_t.prototype;be.prototype=xe.prototype={constructor:be,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=y(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var u,l,c=r[a],s=c.length,f=o[a]=new Array(s),h=0;h<s;++h)(u=c[h])&&(l=t.call(u,u.__data__,h,c))&&("__data__"in u&&(l.__data__=u.__data__),f[h]=l,Rt(f[h],n,e,h,f,Gt(u,e)));return new be(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=v(t));for(var r=this._groups,i=r.length,o=[],a=[],u=0;u<i;++u)for(var l,c=r[u],s=c.length,f=0;f<s;++f)if(l=c[f]){for(var h,p=t.call(l,l.__data__,f,c),d=Gt(l,e),y=0,g=p.length;y<g;++y)(h=p[y])&&Rt(h,n,e,y,p,d);o.push(p),a.push(l)}return new be(o,a,n,e)},selectChild:Se.selectChild,selectChildren:Se.selectChildren,filter:function(t){"function"!=typeof t&&(t=_(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,l=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&l.push(o);return new be(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var l,c=n[u],s=e[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(l=c[p]||s[p])&&(h[p]=l);for(;u<r;++u)a[u]=n[u];return new be(a,this._parents,this._name,this._id)},selection:function(){return new me(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=Me(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],l=u.length,c=0;c<l;++c)if(a=u[c]){var s=Gt(a,n);Rt(a,t,e,c,u,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new be(r,this._parents,t,e)},call:Se.call,nodes:Se.nodes,node:Se.node,size:Se.size,empty:Se.empty,each:Se.each,on:function(t,n){var e=this._id;return arguments.length<2?Gt(this.node(),e).on.on(t):this.each(function(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?Wt:Zt;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=s(t),r="transform"===e?Kn:oe;return this.attrTween(t,"function"==typeof n?(e.local?fe:se)(e,r,ie(this,"attr."+t,n)):null==n?(e.local?ue:ae)(e):(e.local?ce:le)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=s(t);return this.tween(e,(r.local?he:pe)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Jn:oe;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=L(this,t),a=(this.style.removeProperty(t),L(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,_e(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var a=L(this,t),u=e(this),l=u+"";return null==u&&(this.style.removeProperty(t),l=u=L(this,t)),a===l?null:a===r&&l===i?o:(i=l,o=n(r=a,u))}}(t,r,ie(this,"style."+t,n))).each(function(t,n){var e,r,i,o,a="style."+n,u="end."+a;return function(){var l=Zt(this,t),c=l.on,s=null==l.value[a]?o||(o=_e(n)):void 0;c===e&&i===s||(r=(e=c).copy()).on(u,i=s),l.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var a=L(this,t);return a===o?null:a===r?i:i=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(ie(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Gt(this.node(),e).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?ee:re)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?de:ye)(n,t)):Gt(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ge:ve)(n,t)):Gt(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(function(t,n){if("function"!=typeof n)throw new Error;return function(){Zt(this,t).ease=n}}(n,t)):Gt(this.node(),n).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,n){return function(){var e=n.apply(this,arguments);if("function"!=typeof e)throw new Error;Zt(this,t).ease=e}}(this._id,t))},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(o,a){var u={value:a},l={value:function(){0==--i&&o()}};e.each((function(){var e=Zt(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(u),n._.interrupt.push(u),n._.end.push(l)),e.on=n})),0===i&&o()}))},[Symbol.iterator]:Se[Symbol.iterator]};var Ce={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Te(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}_t.prototype.interrupt=function(t){return this.each((function(){Qt(this,t)}))},_t.prototype.transition=function(t){var n,e;t instanceof be?(n=t._id,t=t._name):(n=Me(),(e=Ce).time=Pt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],l=u.length,c=0;c<l;++c)(a=u[c])&&Rt(a,t,n,c,u,e||Te(a,n));return new be(r,this._parents,t,n)};const Ae={capture:!0,passive:!1};function ke(t){t.preventDefault(),t.stopImmediatePropagation()}var Ee=t=>()=>t;function $e(t,{sourceEvent:n,target:e,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ze(t,n,e){this.k=t,this.x=n,this.y=e}ze.prototype={constructor:ze,scale:function(t){return 1===t?this:new ze(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new ze(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ne=new ze(1,0,0);function je(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Ne;return t.__zoom}function De(t){t.stopImmediatePropagation()}function Ue(t){t.preventDefault(),t.stopImmediatePropagation()}function Oe(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Pe(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Fe(){return this.__zoom||Ne}function He(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Ye(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ie(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function Le(){var t,n,e,r=Oe,i=Pe,o=Ie,a=He,u=Ye,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],s=250,f=ne,h=Mt("start","zoom","end"),p=0,d=10;function y(t){t.property("__zoom",Fe).on("wheel.zoom",x,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",S).filter(u).on("touchstart.zoom",C).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,n){return(n=Math.max(l[0],Math.min(l[1],n)))===t.k?t:new ze(n,t.x,t.y)}function v(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new ze(t.k,r,i)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function _(t,n,e,r){t.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=w(t,o).event(r),u=i.apply(t,o),l=null==e?m(u):"function"==typeof e?e.apply(t,o):e,c=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),s=t.__zoom,h="function"==typeof n?n.apply(t,o):n,p=f(s.invert(l).concat(c/s.k),h.invert(l).concat(c/h.k));return function(t){if(1===t)t=h;else{var n=p(t),e=c/n[2];t=new ze(e,l[0]-n[0]*e,l[1]-n[1]*e)}a.zoom(null,t)}}))}function w(t,n,e){return!e&&t.__zooming||new b(t,n)}function b(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,n),this.taps=0}function x(t,...n){if(r.apply(this,arguments)){var e=w(this,n).event(t),i=this.__zoom,u=Math.max(l[0],Math.min(l[1],i.k*Math.pow(2,a.apply(this,arguments)))),s=bt(t);if(e.wheel)e.mouse[0][0]===s[0]&&e.mouse[0][1]===s[1]||(e.mouse[1]=i.invert(e.mouse[0]=s)),clearTimeout(e.wheel);else{if(i.k===u)return;e.mouse=[s,i.invert(s)],Qt(this),e.start()}Ue(t),e.wheel=setTimeout((function(){e.wheel=null,e.end()}),150),e.zoom("mouse",o(v(g(i,u),e.mouse[0],e.mouse[1]),e.extent,c))}}function M(t,...n){if(!e&&r.apply(this,arguments)){var i=t.currentTarget,a=w(this,n,!0).event(t),u=wt(t.view).on("mousemove.zoom",(function(t){if(Ue(t),!a.moved){var n=t.clientX-s,e=t.clientY-f;a.moved=n*n+e*e>p}a.event(t).zoom("mouse",o(v(a.that.__zoom,a.mouse[0]=bt(t,i),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),function(t,n){var e=t.document.documentElement,r=wt(t).on("dragstart.drag",null);n&&(r.on("click.drag",ke,Ae),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}(t.view,a.moved),Ue(t),a.event(t).end()}),!0),l=bt(t,i),s=t.clientX,f=t.clientY;!function(t){var n=t.document.documentElement,e=wt(t).on("dragstart.drag",ke,Ae);"onselectstart"in n?e.on("selectstart.drag",ke,Ae):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(t.view),De(t),a.mouse=[l,this.__zoom.invert(l)],Qt(this),a.start()}}function S(t,...n){if(r.apply(this,arguments)){var e=this.__zoom,a=bt(t.changedTouches?t.changedTouches[0]:t,this),u=e.invert(a),l=e.k*(t.shiftKey?.5:2),f=o(v(g(e,l),a,u),i.apply(this,n),c);Ue(t),s>0?wt(this).transition().duration(s).call(_,f,a,t):wt(this).call(y.transform,f,a,t)}}function C(e,...i){if(r.apply(this,arguments)){var o,a,u,l,c=e.touches,s=c.length,f=w(this,i,e.changedTouches.length===s).event(e);for(De(e),a=0;a<s;++a)l=[l=bt(u=c[a],this),this.__zoom.invert(l),u.identifier],f.touch0?f.touch1||f.touch0[2]===l[2]||(f.touch1=l,f.taps=0):(f.touch0=l,o=!0,f.taps=1+!!t);t&&(t=clearTimeout(t)),o&&(f.taps<2&&(n=l[0],t=setTimeout((function(){t=null}),500)),Qt(this),f.start())}}function T(t,...n){if(this.__zooming){var e,r,i,a,u=w(this,n).event(t),l=t.changedTouches,s=l.length;for(Ue(t),e=0;e<s;++e)i=bt(r=l[e],this),u.touch0&&u.touch0[2]===r.identifier?u.touch0[0]=i:u.touch1&&u.touch1[2]===r.identifier&&(u.touch1[0]=i);if(r=u.that.__zoom,u.touch1){var f=u.touch0[0],h=u.touch0[1],p=u.touch1[0],d=u.touch1[1],y=(y=p[0]-f[0])*y+(y=p[1]-f[1])*y,m=(m=d[0]-h[0])*m+(m=d[1]-h[1])*m;r=g(r,Math.sqrt(y/m)),i=[(f[0]+p[0])/2,(f[1]+p[1])/2],a=[(h[0]+d[0])/2,(h[1]+d[1])/2]}else{if(!u.touch0)return;i=u.touch0[0],a=u.touch0[1]}u.zoom("touch",o(v(r,i,a),u.extent,c))}}function A(t,...r){if(this.__zooming){var i,o,a=w(this,r).event(t),u=t.changedTouches,l=u.length;for(De(t),e&&clearTimeout(e),e=setTimeout((function(){e=null}),500),i=0;i<l;++i)o=u[i],a.touch0&&a.touch0[2]===o.identifier?delete a.touch0:a.touch1&&a.touch1[2]===o.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(o=bt(o,this),Math.hypot(n[0]-o[0],n[1]-o[1])<d)){var c=wt(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return y.transform=function(t,n,e,r){var i=t.selection?t.selection():t;i.property("__zoom",Fe),t!==i?_(t,n,e,r):i.interrupt().each((function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()}))},y.scaleBy=function(t,n,e,r){y.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof n?n.apply(this,arguments):n)}),e,r)},y.scaleTo=function(t,n,e,r){y.transform(t,(function(){var t=i.apply(this,arguments),r=this.__zoom,a=null==e?m(t):"function"==typeof e?e.apply(this,arguments):e,u=r.invert(a),l="function"==typeof n?n.apply(this,arguments):n;return o(v(g(r,l),a,u),t,c)}),e,r)},y.translateBy=function(t,n,e,r){y.transform(t,(function(){return o(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof e?e.apply(this,arguments):e),i.apply(this,arguments),c)}),null,r)},y.translateTo=function(t,n,e,r,a){y.transform(t,(function(){var t=i.apply(this,arguments),a=this.__zoom,u=null==r?m(t):"function"==typeof r?r.apply(this,arguments):r;return o(Ne.translate(u[0],u[1]).scale(a.k).translate("function"==typeof n?-n.apply(this,arguments):-n,"function"==typeof e?-e.apply(this,arguments):-e),t,c)}),r,a)},b.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var n=wt(this.that).datum();h.call(t,this.that,new $e(t,{sourceEvent:this.sourceEvent,target:y,type:t,transform:this.that.__zoom,dispatch:h}),n)}},y.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:Ee(+t),y):a},y.filter=function(t){return arguments.length?(r="function"==typeof t?t:Ee(!!t),y):r},y.touchable=function(t){return arguments.length?(u="function"==typeof t?t:Ee(!!t),y):u},y.extent=function(t){return arguments.length?(i="function"==typeof t?t:Ee([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),y):i},y.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],y):[l[0],l[1]]},y.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],y):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},y.constrain=function(t){return arguments.length?(o=t,y):o},y.duration=function(t){return arguments.length?(s=+t,y):s},y.interpolate=function(t){return arguments.length?(f=t,y):f},y.on=function(){var t=h.on.apply(h,arguments);return t===h?y:t},y.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,y):Math.sqrt(p)},y.tapDistance=function(t){return arguments.length?(d=+t,y):d},y}function qe(t){return t}je.prototype=ze.prototype;var Xe=1e-6;function Ve(t){return"translate("+t+",0)"}function Be(t){return n=>+t(n)}function Re(t,n){return n=Math.max(0,t.bandwidth()-2*n)/2,t.round()&&(n=Math.round(n)),e=>+t(e)+n}function We(){return!this.__axis}function Ze(t,n){var e=[],r=null,i=null,o=6,a=6,u=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c="y",s=Ve;function f(t){var f=null==r?n.ticks?n.ticks.apply(n,e):n.domain():r,h=null==i?n.tickFormat?n.tickFormat.apply(n,e):qe:i,p=Math.max(o,0)+u,d=n.range(),y=+d[0]+l,g=+d[d.length-1]+l,v=(n.bandwidth?Re:Be)(n.copy(),l),m=t.selection?t.selection():t,_=m.selectAll(".domain").data([null]),w=m.selectAll(".tick").data(f,n).order(),b=w.exit(),x=w.enter().append("g").attr("class","tick"),M=w.select("line"),S=w.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(x),M=M.merge(x.append("line").attr("stroke","currentColor").attr("y2",1*o)),S=S.merge(x.append("text").attr("fill","currentColor").attr(c,1*p).attr("dy","0.71em")),t!==m&&(_=_.transition(t),w=w.transition(t),M=M.transition(t),S=S.transition(t),b=b.transition(t).attr("opacity",Xe).attr("transform",(function(t){return isFinite(t=v(t))?s(t+l):this.getAttribute("transform")})),x.attr("opacity",Xe).attr("transform",(function(t){var n=this.parentNode.__axis;return s((n&&isFinite(n=n(t))?n:v(t))+l)}))),b.remove(),_.attr("d",a?"M"+y+","+1*a+"V"+l+"H"+g+"V"+1*a:"M"+y+","+l+"H"+g),w.attr("opacity",1).attr("transform",(function(t){return s(v(t)+l)})),M.attr("y2",1*o),S.attr(c,1*p).text(h),m.filter(We).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor","middle"),m.each((function(){this.__axis=v}))}return f.scale=function(t){return arguments.length?(n=t,f):n},f.ticks=function(){return e=Array.from(arguments),f},f.tickArguments=function(t){return arguments.length?(e=null==t?[]:Array.from(t),f):e.slice()},f.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),f):r&&r.slice()},f.tickFormat=function(t){return arguments.length?(i=t,f):i},f.tickSize=function(t){return arguments.length?(o=a=+t,f):o},f.tickSizeInner=function(t){return arguments.length?(o=+t,f):o},f.tickSizeOuter=function(t){return arguments.length?(a=+t,f):a},f.tickPadding=function(t){return arguments.length?(u=+t,f):u},f.offset=function(t){return arguments.length?(l=+t,f):l},f}function Ge(t,n){return null==t||null==n?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function Qe(t,n){return null==t||null==n?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function Je(t){let n,e,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==n(r,r))return o;do{const n=i+o>>>1;e(t[n],r)<0?i=n+1:o=n}while(i<o)}return i}return 2!==t.length?(n=Ge,e=(n,e)=>Ge(t(n),e),r=(n,e)=>t(n)-e):(n=t===Ge||t===Qe?t:Ke,e=t,r=t),{left:i,center:function(t,n,e=0,o=t.length){const a=i(t,n,e,o-1);return a>e&&r(t[a-1],n)>-r(t[a],n)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==n(r,r))return o;do{const n=i+o>>>1;e(t[n],r)<=0?i=n+1:o=n}while(i<o)}return i}}}function Ke(){return 0}const tr=Je(Ge).right;Je((function(t){return null===t?NaN:+t})).center;const nr=Math.sqrt(50),er=Math.sqrt(10),rr=Math.sqrt(2);function ir(t,n,e){const r=(n-t)/Math.max(0,e),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=nr?10:o>=er?5:o>=rr?2:1;let u,l,c;return i<0?(c=Math.pow(10,-i)/a,u=Math.round(t*c),l=Math.round(n*c),u/c<t&&++u,l/c>n&&--l,c=-c):(c=Math.pow(10,i)*a,u=Math.round(t/c),l=Math.round(n/c),u*c<t&&++u,l*c>n&&--l),l<u&&.5<=e&&e<2?ir(t,n,2*e):[u,l,c]}function or(t,n,e){return ir(t=+t,n=+n,e=+e)[2]}function ar(t,n,e){e=+e;const r=(n=+n)<(t=+t),i=r?or(n,t,e):or(t,n,e);return(r?-1:1)*(i<0?1/-i:i)}function ur(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r<i;)o[r]=t+r*e;return o}function lr(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function cr(t){return+t}var sr=[0,1];function fr(t){return t}function hr(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:function(t){return function(){return t}}(isNaN(n)?NaN:.5)}function pr(t,n,e){var r=t[0],i=t[1],o=n[0],a=n[1];return i<r?(r=hr(i,r),o=e(a,o)):(r=hr(r,i),o=e(o,a)),function(t){return o(r(t))}}function dr(t,n,e){var r=Math.min(t.length,n.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<r;)i[a]=hr(t[a],t[a+1]),o[a]=e(n[a],n[a+1]);return function(n){var e=tr(t,n,1,r)-1;return o[e](i[e](n))}}function yr(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function gr(){var t,n,e,r,i,o,a=sr,u=sr,l=Vn,c=fr;function s(){var t,n,e,l=Math.min(a.length,u.length);return c!==fr&&(t=a[0],n=a[l-1],t>n&&(e=t,t=n,n=e),c=function(e){return Math.max(t,Math.min(n,e))}),r=l>2?dr:pr,i=o=null,f}function f(n){return null==n||isNaN(n=+n)?e:(i||(i=r(a.map(t),u,l)))(t(c(n)))}return f.invert=function(e){return c(n((o||(o=r(u,a.map(t),Yn)))(e)))},f.domain=function(t){return arguments.length?(a=Array.from(t,cr),s()):a.slice()},f.range=function(t){return arguments.length?(u=Array.from(t),s()):u.slice()},f.rangeRound=function(t){return u=Array.from(t),l=Bn,s()},f.clamp=function(t){return arguments.length?(c=!!t||fr,s()):c!==fr},f.interpolate=function(t){return arguments.length?(l=t,s()):l},f.unknown=function(t){return arguments.length?(e=t,f):e},function(e,r){return t=e,n=r,s()}}function vr(){return gr()(fr,fr)}function mr(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function _r(t){return(t=mr(Math.abs(t)))?t[1]:NaN}var wr,br=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function xr(t){if(!(n=br.exec(t)))throw new Error("invalid format: "+t);var n;return new Mr({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function Mr(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Sr(t,n){var e=mr(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}xr.prototype=Mr.prototype,Mr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Cr={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>Sr(100*t,n),r:Sr,s:function(t,n){var e=mr(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(wr=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+mr(t,Math.max(0,n+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Tr(t){return t}var Ar,kr,Er,$r=Array.prototype.map,zr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Nr(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?Tr:(n=$r.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=n[0],l=0;i>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),o.push(t.substring(i-=u,i+u)),!((l+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Tr:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}($r.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var n=(t=xr(t)).fill,e=t.align,f=t.sign,h=t.symbol,p=t.zero,d=t.width,y=t.comma,g=t.precision,v=t.trim,m=t.type;"n"===m?(y=!0,m="g"):Cr[m]||(void 0===g&&(g=12),v=!0,m="g"),(p||"0"===n&&"="===e)&&(p=!0,n="0",e="=");var _="$"===h?i:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",w="$"===h?o:/[%p]/.test(m)?l:"",b=Cr[m],x=/[defgprs%]/.test(m);function M(t){var i,o,l,h=_,M=w;if("c"===m)M=b(t)+M,t="";else{var S=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:b(Math.abs(t),g),v&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r<e;++r)switch(t[r]){case".":i=n=r;break;case"0":0===i&&(i=r),n=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),S&&0==+t&&"+"!==f&&(S=!1),h=(S?"("===f?f:c:"-"===f||"("===f?"":f)+h,M=("s"===m?zr[8+wr/3]:"")+M+(S&&"("===f?")":""),x)for(i=-1,o=t.length;++i<o;)if(48>(l=t.charCodeAt(i))||l>57){M=(46===l?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}y&&!p&&(t=r(t,1/0));var C=h.length+t.length+M.length,T=C<d?new Array(d-C+1).join(n):"";switch(y&&p&&(t=r(T+t,T.length?d-M.length:1/0),T=""),e){case"<":t=h+t+M+T;break;case"=":t=h+T+t+M;break;case"^":t=T.slice(0,C=T.length>>1)+h+t+M+T.slice(C);break;default:t=T+h+t+M}return u(t)}return g=void 0===g?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,n){var e=f(((t=xr(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(_r(n)/3))),i=Math.pow(10,-r),o=zr[8+r/3];return function(t){return e(i*t)+o}}}}function jr(t,n,e,r){var i,o=ar(t,n,e);switch((r=xr(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(n));return null!=r.precision||isNaN(i=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(_r(n)/3)))-_r(Math.abs(t)))}(o,a))||(r.precision=i),Er(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,_r(n)-_r(t))+1}(o,Math.max(Math.abs(t),Math.abs(n))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-_r(Math.abs(t)))}(o))||(r.precision=i-2*("%"===r.type))}return kr(r)}function Dr(t){var n=t.domain;return t.ticks=function(t){var e=n();return function(t,n,e){if(!((e=+e)>0))return[];if((t=+t)==(n=+n))return[t];const r=n<t,[i,o,a]=r?ir(n,t,e):ir(t,n,e);if(!(o>=i))return[];const u=o-i+1,l=new Array(u);if(r)if(a<0)for(let t=0;t<u;++t)l[t]=(o-t)/-a;else for(let t=0;t<u;++t)l[t]=(o-t)*a;else if(a<0)for(let t=0;t<u;++t)l[t]=(i+t)/-a;else for(let t=0;t<u;++t)l[t]=(i+t)*a;return l}(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return jr(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i,o=n(),a=0,u=o.length-1,l=o[a],c=o[u],s=10;for(c<l&&(i=l,l=c,c=i,i=a,a=u,u=i);s-- >0;){if((i=or(l,c,e))===r)return o[a]=l,o[u]=c,n(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function Ur(){var t=vr();return t.copy=function(){return yr(t,Ur())},lr.apply(t,arguments),Dr(t)}function Or(t){return function(n){return n<0?-Math.pow(-n,t):Math.pow(n,t)}}function Pr(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Fr(t){return t<0?-t*t:t*t}function Hr(t){var n=t(fr,fr),e=1;return n.exponent=function(n){return arguments.length?1===(e=+n)?t(fr,fr):.5===e?t(Pr,Fr):t(Or(e),Or(1/e)):e},Dr(n)}function Yr(){var t=Hr(gr());return t.copy=function(){return yr(t,Yr()).exponent(t.exponent())},lr.apply(t,arguments),t}Ar=Nr({thousands:",",grouping:[3],currency:["$",""]}),kr=Ar.format,Er=Ar.formatPrefix;const Ir=new Date,Lr=new Date;function qr(t,n,e,r){function i(n){return t(n=0===arguments.length?new Date:new Date(+n)),n}return i.floor=n=>(t(n=new Date(+n)),n),i.ceil=e=>(t(e=new Date(e-1)),n(e,1),t(e),e),i.round=t=>{const n=i(t),e=i.ceil(t);return t-n<e-t?n:e},i.offset=(t,e)=>(n(t=new Date(+t),null==e?1:Math.floor(e)),t),i.range=(e,r,o)=>{const a=[];if(e=i.ceil(e),o=null==o?1:Math.floor(o),!(e<r&&o>0))return a;let u;do{a.push(u=new Date(+e)),n(e,o),t(e)}while(u<e&&e<r);return a},i.filter=e=>qr((n=>{if(n>=n)for(;t(n),!e(n);)n.setTime(n-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););})),e&&(i.count=(n,r)=>(Ir.setTime(+n),Lr.setTime(+r),t(Ir),t(Lr),Math.floor(e(Ir,Lr))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?n=>r(n)%t==0:n=>i.count(0,n)%t==0):i:null)),i}const Xr=qr((()=>{}),((t,n)=>{t.setTime(+t+n)}),((t,n)=>n-t));Xr.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?qr((n=>{n.setTime(Math.floor(n/t)*t)}),((n,e)=>{n.setTime(+n+e*t)}),((n,e)=>(e-n)/t)):Xr:null),Xr.range;const Vr=1e3,Br=6e4,Rr=36e5,Wr=864e5,Zr=6048e5,Gr=2592e6,Qr=31536e6,Jr=qr((t=>{t.setTime(t-t.getMilliseconds())}),((t,n)=>{t.setTime(+t+n*Vr)}),((t,n)=>(n-t)/Vr),(t=>t.getUTCSeconds()));Jr.range;const Kr=qr((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Vr)}),((t,n)=>{t.setTime(+t+n*Br)}),((t,n)=>(n-t)/Br),(t=>t.getMinutes()));Kr.range;const ti=qr((t=>{t.setUTCSeconds(0,0)}),((t,n)=>{t.setTime(+t+n*Br)}),((t,n)=>(n-t)/Br),(t=>t.getUTCMinutes()));ti.range;const ni=qr((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Vr-t.getMinutes()*Br)}),((t,n)=>{t.setTime(+t+n*Rr)}),((t,n)=>(n-t)/Rr),(t=>t.getHours()));ni.range;const ei=qr((t=>{t.setUTCMinutes(0,0,0)}),((t,n)=>{t.setTime(+t+n*Rr)}),((t,n)=>(n-t)/Rr),(t=>t.getUTCHours()));ei.range;const ri=qr((t=>t.setHours(0,0,0,0)),((t,n)=>t.setDate(t.getDate()+n)),((t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Br)/Wr),(t=>t.getDate()-1));ri.range;const ii=qr((t=>{t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCDate(t.getUTCDate()+n)}),((t,n)=>(n-t)/Wr),(t=>t.getUTCDate()-1));ii.range;const oi=qr((t=>{t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCDate(t.getUTCDate()+n)}),((t,n)=>(n-t)/Wr),(t=>Math.floor(t/Wr)));function ai(t){return qr((n=>{n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),((t,n)=>{t.setDate(t.getDate()+7*n)}),((t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Br)/Zr))}oi.range;const ui=ai(0),li=ai(1),ci=ai(2),si=ai(3),fi=ai(4),hi=ai(5),pi=ai(6);function di(t){return qr((n=>{n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCDate(t.getUTCDate()+7*n)}),((t,n)=>(n-t)/Zr))}ui.range,li.range,ci.range,si.range,fi.range,hi.range,pi.range;const yi=di(0),gi=di(1),vi=di(2),mi=di(3),_i=di(4),wi=di(5),bi=di(6);yi.range,gi.range,vi.range,mi.range,_i.range,wi.range,bi.range;const xi=qr((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,n)=>{t.setMonth(t.getMonth()+n)}),((t,n)=>n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())),(t=>t.getMonth()));xi.range;const Mi=qr((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCMonth(t.getUTCMonth()+n)}),((t,n)=>n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()));Mi.range;const Si=qr((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n)}),((t,n)=>n.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));Si.every=t=>isFinite(t=Math.floor(t))&&t>0?qr((n=>{n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),((n,e)=>{n.setFullYear(n.getFullYear()+e*t)})):null,Si.range;const Ci=qr((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n)}),((t,n)=>n.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));function Ti(t,n,e,r,i,o){const a=[[Jr,1,Vr],[Jr,5,5e3],[Jr,15,15e3],[Jr,30,3e4],[o,1,Br],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,Rr],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,Wr],[r,2,1728e5],[e,1,Zr],[n,1,Gr],[n,3,7776e6],[t,1,Qr]];function u(n,e,r){const i=Math.abs(e-n)/r,o=Je((([,,t])=>t)).right(a,i);if(o===a.length)return t.every(ar(n/Qr,e/Qr,r));if(0===o)return Xr.every(Math.max(ar(n,e,r),1));const[u,l]=a[i/a[o-1][2]<a[o][2]/i?o-1:o];return u.every(l)}return[function(t,n,e){const r=n<t;r&&([t,n]=[n,t]);const i=e&&"function"==typeof e.range?e:u(t,n,e),o=i?i.range(t,+n+1):[];return r?o.reverse():o},u]}Ci.every=t=>isFinite(t=Math.floor(t))&&t>0?qr((n=>{n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),((n,e)=>{n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null,Ci.range;const[Ai,ki]=Ti(Ci,Mi,yi,oi,ei,ti),[Ei,$i]=Ti(Si,xi,ui,ri,ni,Kr);function zi(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Ni(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ji(t,n,e){return{y:t,m:n,d:e,H:0,M:0,S:0,L:0}}var Di,Ui,Oi,Pi={"-":"",_:" ",0:"0"},Fi=/^\s*\d+/,Hi=/^%/,Yi=/[\\^$*+?|[\]().{}]/g;function Ii(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<e?new Array(e-o+1).join(n)+i:i)}function Li(t){return t.replace(Yi,"\\$&")}function qi(t){return new RegExp("^(?:"+t.map(Li).join("|")+")","i")}function Xi(t){return new Map(t.map(((t,n)=>[t.toLowerCase(),n])))}function Vi(t,n,e){var r=Fi.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function Bi(t,n,e){var r=Fi.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function Ri(t,n,e){var r=Fi.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function Wi(t,n,e){var r=Fi.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function Zi(t,n,e){var r=Fi.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function Gi(t,n,e){var r=Fi.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function Qi(t,n,e){var r=Fi.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function Ji(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Ki(t,n,e){var r=Fi.exec(n.slice(e,e+1));return r?(t.q=3*r[0]-3,e+r[0].length):-1}function to(t,n,e){var r=Fi.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function no(t,n,e){var r=Fi.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function eo(t,n,e){var r=Fi.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function ro(t,n,e){var r=Fi.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function io(t,n,e){var r=Fi.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function oo(t,n,e){var r=Fi.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function ao(t,n,e){var r=Fi.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function uo(t,n,e){var r=Fi.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function lo(t,n,e){var r=Hi.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function co(t,n,e){var r=Fi.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function so(t,n,e){var r=Fi.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function fo(t,n){return Ii(t.getDate(),n,2)}function ho(t,n){return Ii(t.getHours(),n,2)}function po(t,n){return Ii(t.getHours()%12||12,n,2)}function yo(t,n){return Ii(1+ri.count(Si(t),t),n,3)}function go(t,n){return Ii(t.getMilliseconds(),n,3)}function vo(t,n){return go(t,n)+"000"}function mo(t,n){return Ii(t.getMonth()+1,n,2)}function _o(t,n){return Ii(t.getMinutes(),n,2)}function wo(t,n){return Ii(t.getSeconds(),n,2)}function bo(t){var n=t.getDay();return 0===n?7:n}function xo(t,n){return Ii(ui.count(Si(t)-1,t),n,2)}function Mo(t){var n=t.getDay();return n>=4||0===n?fi(t):fi.ceil(t)}function So(t,n){return t=Mo(t),Ii(fi.count(Si(t),t)+(4===Si(t).getDay()),n,2)}function Co(t){return t.getDay()}function To(t,n){return Ii(li.count(Si(t)-1,t),n,2)}function Ao(t,n){return Ii(t.getFullYear()%100,n,2)}function ko(t,n){return Ii((t=Mo(t)).getFullYear()%100,n,2)}function Eo(t,n){return Ii(t.getFullYear()%1e4,n,4)}function $o(t,n){var e=t.getDay();return Ii((t=e>=4||0===e?fi(t):fi.ceil(t)).getFullYear()%1e4,n,4)}function zo(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Ii(n/60|0,"0",2)+Ii(n%60,"0",2)}function No(t,n){return Ii(t.getUTCDate(),n,2)}function jo(t,n){return Ii(t.getUTCHours(),n,2)}function Do(t,n){return Ii(t.getUTCHours()%12||12,n,2)}function Uo(t,n){return Ii(1+ii.count(Ci(t),t),n,3)}function Oo(t,n){return Ii(t.getUTCMilliseconds(),n,3)}function Po(t,n){return Oo(t,n)+"000"}function Fo(t,n){return Ii(t.getUTCMonth()+1,n,2)}function Ho(t,n){return Ii(t.getUTCMinutes(),n,2)}function Yo(t,n){return Ii(t.getUTCSeconds(),n,2)}function Io(t){var n=t.getUTCDay();return 0===n?7:n}function Lo(t,n){return Ii(yi.count(Ci(t)-1,t),n,2)}function qo(t){var n=t.getUTCDay();return n>=4||0===n?_i(t):_i.ceil(t)}function Xo(t,n){return t=qo(t),Ii(_i.count(Ci(t),t)+(4===Ci(t).getUTCDay()),n,2)}function Vo(t){return t.getUTCDay()}function Bo(t,n){return Ii(gi.count(Ci(t)-1,t),n,2)}function Ro(t,n){return Ii(t.getUTCFullYear()%100,n,2)}function Wo(t,n){return Ii((t=qo(t)).getUTCFullYear()%100,n,2)}function Zo(t,n){return Ii(t.getUTCFullYear()%1e4,n,4)}function Go(t,n){var e=t.getUTCDay();return Ii((t=e>=4||0===e?_i(t):_i.ceil(t)).getUTCFullYear()%1e4,n,4)}function Qo(){return"+0000"}function Jo(){return"%"}function Ko(t){return+t}function ta(t){return Math.floor(+t/1e3)}function na(t){return new Date(t)}function ea(t){return t instanceof Date?+t:+new Date(+t)}function ra(t,n,e,r,i,o,a,u,l,c){var s=vr(),f=s.invert,h=s.domain,p=c(".%L"),d=c(":%S"),y=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),m=c("%b %d"),_=c("%B"),w=c("%Y");function b(t){return(l(t)<t?p:u(t)<t?d:a(t)<t?y:o(t)<t?g:r(t)<t?i(t)<t?v:m:e(t)<t?_:w)(t)}return s.invert=function(t){return new Date(f(t))},s.domain=function(t){return arguments.length?h(Array.from(t,ea)):h().map(na)},s.ticks=function(n){var e=h();return t(e[0],e[e.length-1],null==n?10:n)},s.tickFormat=function(t,n){return null==n?b:c(n)},s.nice=function(t){var e=h();return t&&"function"==typeof t.range||(t=n(e[0],e[e.length-1],null==t?10:t)),t?h(function(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a<o&&(e=r,r=i,i=e,e=o,o=a,a=e),t[r]=n.floor(o),t[i]=n.ceil(a),t}(e,t)):s},s.copy=function(){return yr(s,ra(t,n,e,r,i,o,a,u,l,c))},s}function ia(){return lr.apply(ra(Ei,$i,Si,xi,ui,ri,ni,Kr,Jr,Ui).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function oa(){return lr.apply(ra(Ai,ki,Ci,Mi,yi,ii,ei,ti,Jr,Oi).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function aa(t){return function(){return t}}!function(t){Di=function(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,l=t.shortMonths,c=qi(i),s=Xi(i),f=qi(o),h=Xi(o),p=qi(a),d=Xi(a),y=qi(u),g=Xi(u),v=qi(l),m=Xi(l),_={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:fo,e:fo,f:vo,g:ko,G:$o,H:ho,I:po,j:yo,L:go,m:mo,M:_o,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Ko,s:ta,S:wo,u:bo,U:xo,V:So,w:Co,W:To,x:null,X:null,y:Ao,Y:Eo,Z:zo,"%":Jo},w={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:No,e:No,f:Po,g:Wo,G:Go,H:jo,I:Do,j:Uo,L:Oo,m:Fo,M:Ho,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Ko,s:ta,S:Yo,u:Io,U:Lo,V:Xo,w:Vo,W:Bo,x:null,X:null,y:Ro,Y:Zo,Z:Qo,"%":Jo},b={a:function(t,n,e){var r=p.exec(n.slice(e));return r?(t.w=d.get(r[0].toLowerCase()),e+r[0].length):-1},A:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.w=h.get(r[0].toLowerCase()),e+r[0].length):-1},b:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=m.get(r[0].toLowerCase()),e+r[0].length):-1},B:function(t,n,e){var r=y.exec(n.slice(e));return r?(t.m=g.get(r[0].toLowerCase()),e+r[0].length):-1},c:function(t,e,r){return S(t,n,e,r)},d:no,e:no,f:uo,g:Qi,G:Gi,H:ro,I:ro,j:eo,L:ao,m:to,M:io,p:function(t,n,e){var r=c.exec(n.slice(e));return r?(t.p=s.get(r[0].toLowerCase()),e+r[0].length):-1},q:Ki,Q:co,s:so,S:oo,u:Bi,U:Ri,V:Wi,w:Vi,W:Zi,x:function(t,n,r){return S(t,e,n,r)},X:function(t,n,e){return S(t,r,n,e)},y:Qi,Y:Gi,Z:Ji,"%":lo};function x(t,n){return function(e){var r,i,o,a=[],u=-1,l=0,c=t.length;for(e instanceof Date||(e=new Date(+e));++u<c;)37===t.charCodeAt(u)&&(a.push(t.slice(l,u)),null!=(i=Pi[r=t.charAt(++u)])?r=t.charAt(++u):i="e"===r?" ":"0",(o=n[r])&&(r=o(e,i)),a.push(r),l=u+1);return a.push(t.slice(l,u)),a.join("")}}function M(t,n){return function(e){var r,i,o=ji(1900,void 0,1);if(S(o,t,e+="",0)!=e.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(n&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Ni(ji(o.y,0,1))).getUTCDay(),r=i>4||0===i?gi.ceil(r):gi(r),r=ii.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=zi(ji(o.y,0,1))).getDay(),r=i>4||0===i?li.ceil(r):li(r),r=ri.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Ni(ji(o.y,0,1)).getUTCDay():zi(ji(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Ni(o)):zi(o)}}function S(t,n,e,r){for(var i,o,a=0,u=n.length,l=e.length;a<u;){if(r>=l)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=b[i in Pi?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return _.x=x(e,_),_.X=x(r,_),_.c=x(n,_),w.x=x(e,w),w.X=x(r,w),w.c=x(n,w),{format:function(t){var n=x(t+="",_);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",!1);return n.toString=function(){return t},n},utcFormat:function(t){var n=x(t+="",w);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t+="",!0);return n.toString=function(){return t},n}}}(t),Ui=Di.format,Di.parse,Oi=Di.utcFormat,Di.utcParse}({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"]});const ua=Math.PI,la=2*ua,ca=1e-6,sa=la-ca;function fa(t){this._+=t[0];for(let n=1,e=t.length;n<e;++n)this._+=arguments[n]+t[n]}class ha{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?fa:function(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return fa;const e=10**n;return function(t){this._+=t[0];for(let n=1,r=t.length;n<r;++n)this._+=Math.round(arguments[n]*e)/e+t[n]}}(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,e,r){this._append`Q${+t},${+n},${this._x1=+e},${this._y1=+r}`}bezierCurveTo(t,n,e,r,i,o){this._append`C${+t},${+n},${+e},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(t,n,e,r,i){if(t=+t,n=+n,e=+e,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,u=e-t,l=r-n,c=o-t,s=a-n,f=c*c+s*s;if(null===this._x1)this._append`M${this._x1=t},${this._y1=n}`;else if(f>ca)if(Math.abs(s*u-l*c)>ca&&i){let h=e-o,p=r-a,d=u*u+l*l,y=h*h+p*p,g=Math.sqrt(d),v=Math.sqrt(f),m=i*Math.tan((ua-Math.acos((d+f-y)/(2*g*v)))/2),_=m/v,w=m/g;Math.abs(_-1)>ca&&this._append`L${t+_*c},${n+_*s}`,this._append`A${i},${i},0,0,${+(s*h>c*p)},${this._x1=t+w*u},${this._y1=n+w*l}`}else this._append`L${this._x1=t},${this._y1=n}`;else;}arc(t,n,e,r,i,o){if(t=+t,n=+n,o=!!o,(e=+e)<0)throw new Error(`negative radius: ${e}`);let a=e*Math.cos(r),u=e*Math.sin(r),l=t+a,c=n+u,s=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>ca||Math.abs(this._y1-c)>ca)&&this._append`L${l},${c}`,e&&(f<0&&(f=f%la+la),f>sa?this._append`A${e},${e},0,1,${s},${t-a},${n-u}A${e},${e},0,1,${s},${this._x1=l},${this._y1=c}`:f>ca&&this._append`A${e},${e},0,${+(f>=ua)},${s},${this._x1=t+e*Math.cos(i)},${this._y1=n+e*Math.sin(i)}`)}rect(t,n,e,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${e=+e}v${+r}h${-e}Z`}toString(){return this._}}function pa(t){let n=3;return t.digits=function(e){if(!arguments.length)return n;if(null==e)n=null;else{const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);n=t}return t},()=>new ha(n)}function da(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ya(t){this._context=t}function ga(t){return new ya(t)}function va(t){return t[0]}function ma(t){return t[1]}function _a(t,n,e){var r=null,i=aa(!0),o=null,a=ga,u=null,l=pa(c);function c(c){var s,f,h,p,d,y=(c=da(c)).length,g=!1,v=new Array(y),m=new Array(y);for(null==o&&(u=a(d=l())),s=0;s<=y;++s){if(!(s<y&&i(p=c[s],s,c))===g)if(g=!g)f=s,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),h=s-1;h>=f;--h)u.point(v[h],m[h]);u.lineEnd(),u.areaEnd()}g&&(v[s]=+t(p,s,c),m[s]=+n(p,s,c),u.point(r?+r(p,s,c):v[s],e?+e(p,s,c):m[s]))}if(d)return u=null,d+""||null}function s(){return function(t,n){var e=aa(!0),r=null,i=ga,o=null,a=pa(u);function u(u){var l,c,s,f=(u=da(u)).length,h=!1;for(null==r&&(o=i(s=a())),l=0;l<=f;++l)!(l<f&&e(c=u[l],l,u))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(c,l,u),+n(c,l,u));if(s)return o=null,s+""||null}return t="function"==typeof t?t:void 0===t?va:aa(t),n="function"==typeof n?n:void 0===n?ma:aa(n),u.x=function(n){return arguments.length?(t="function"==typeof n?n:aa(+n),u):t},u.y=function(t){return arguments.length?(n="function"==typeof t?t:aa(+t),u):n},u.defined=function(t){return arguments.length?(e="function"==typeof t?t:aa(!!t),u):e},u.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),u):i},u.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),u):r},u}().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?va:aa(+t),n="function"==typeof n?n:aa(void 0===n?0:+n),e="function"==typeof e?e:void 0===e?ma:aa(+e),c.x=function(n){return arguments.length?(t="function"==typeof n?n:aa(+n),r=null,c):t},c.x0=function(n){return arguments.length?(t="function"==typeof n?n:aa(+n),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:aa(+t),c):r},c.y=function(t){return arguments.length?(n="function"==typeof t?t:aa(+t),e=null,c):n},c.y0=function(t){return arguments.length?(n="function"==typeof t?t:aa(+t),c):n},c.y1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:aa(+t),c):e},c.lineX0=c.lineY0=function(){return s().x(t).y(n)},c.lineY1=function(){return s().x(t).y(e)},c.lineX1=function(){return s().x(r).y(n)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:aa(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),c):o},c}function wa(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function ba(t){this._context=t}function xa(t){return new ba(t)}function Ma(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}ya.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}},ba.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:wa(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:wa(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Sa="object"==typeof global&&global&&global.Object===Object&&global,Ca="object"==typeof self&&self&&self.Object===Object&&self,Ta=Sa||Ca||Function("return this")(),Aa=function(){return Ta.Date.now()},ka=/\s/;var Ea=/^\s+/;function $a(t){return t?t.slice(0,function(t){for(var n=t.length;n--&&ka.test(t.charAt(n)););return n}(t)+1).replace(Ea,""):t}var za=Ta.Symbol,Na=Object.prototype,ja=Na.hasOwnProperty,Da=Na.toString,Ua=za?za.toStringTag:void 0;var Oa=Object.prototype.toString;var Pa=za?za.toStringTag:void 0;function Fa(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Pa&&Pa in Object(t)?function(t){var n=ja.call(t,Ua),e=t[Ua];try{t[Ua]=void 0;var r=!0}catch(t){}var i=Da.call(t);return r&&(n?t[Ua]=e:delete t[Ua]),i}(t):function(t){return Oa.call(t)}(t)}var Ha=/^[-+]0x[0-9a-f]+$/i,Ya=/^0b[01]+$/i,Ia=/^0o[0-7]+$/i,La=parseInt;function qa(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==Fa(t)}(t))return NaN;if(Ma(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=Ma(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=$a(t);var e=Ya.test(t);return e||Ia.test(t)?La(t.slice(2),e?2:8):Ha.test(t)?NaN:+t}var Xa=Math.max,Va=Math.min;function Ba(t,n,e){var r,i,o,a,u,l,c=0,s=!1,f=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(n){var e=r,o=i;return r=i=void 0,c=n,a=t.apply(o,e)}function d(t){var e=t-l;return void 0===l||e>=n||e<0||f&&t-c>=o}function y(){var t=Aa();if(d(t))return g(t);u=setTimeout(y,function(t){var e=n-(t-l);return f?Va(e,o-(t-c)):e}(t))}function g(t){return u=void 0,h&&r?p(t):(r=i=void 0,a)}function v(){var t=Aa(),e=d(t);if(r=arguments,i=this,l=t,e){if(void 0===u)return function(t){return c=t,u=setTimeout(y,n),s?p(t):a}(l);if(f)return clearTimeout(u),u=setTimeout(y,n),p(l)}return void 0===u&&(u=setTimeout(y,n)),a}return n=qa(n)||0,Ma(e)&&(s=!!e.leading,o=(f="maxWait"in e)?Xa(qa(e.maxWait)||0,n):o,h="trailing"in e?!!e.trailing:h),v.cancel=function(){void 0!==u&&clearTimeout(u),c=0,r=l=i=u=void 0},v.flush=function(){return void 0===u?a:g(Aa())},v}function Ra(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e<n;e++)r[e]=t[e];return r}function Wa(t,n,e){return Object.defineProperty(t,"prototype",{writable:!1}),t}function Za(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,i,o,a,u=[],l=!0,c=!1;try{if(o=(e=e.call(t)).next,0===n);else for(;!(l=(r=o.call(e)).done)&&(u.push(r.value),u.length!==n);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw i}}return u}}(t,n)||function(t,n){if(t){if("string"==typeof t)return Ra(t,n);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ra(t,n):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ga=Wa((function t(n,e){var r=e.default,i=void 0===r?null:r,o=e.triggerUpdate,a=void 0===o||o,u=e.onChange,l=void 0===u?function(t,n){}:u;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=n,this.defaultVal=i,this.triggerUpdate=a,this.onChange=l}));function Qa(t){var n=t.stateInit,e=void 0===n?function(){return{}}:n,r=t.props,i=void 0===r?{}:r,o=t.methods,a=void 0===o?{}:o,u=t.aliases,l=void 0===u?{}:u,c=t.init,s=void 0===c?function(){}:c,f=t.update,h=void 0===f?function(){}:f,p=Object.keys(i).map((function(t){return new Ga(t,i[t])}));return function t(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var o=!!(this instanceof t?this.constructor:void 0),u=o?r.shift():void 0,c=r[0],f=void 0===c?{}:c,d=Object.assign({},e instanceof Function?e(f):e,{initialised:!1}),y={};function g(t){return v(t,f),m(),g}var v=function(t,n){s.call(g,t,d,n),d.initialised=!0},m=Ba((function(){d.initialised&&(h.call(g,d,y),y={})}),1);return p.forEach((function(t){g[t.name]=function(t){var n=t.name,e=t.triggerUpdate,r=void 0!==e&&e,i=t.onChange,o=void 0===i?function(t,n){}:i,a=t.defaultVal,u=void 0===a?null:a;return function(t){var e=d[n];if(!arguments.length)return e;var i=void 0===t?u:t;return d[n]=i,o.call(g,i,d,e),!y.hasOwnProperty(n)&&(y[n]=e),r&&m(),g}}(t)})),Object.keys(a).forEach((function(t){g[t]=function(){for(var n,e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return(n=a[t]).call.apply(n,[g,d].concat(r))}})),Object.entries(l).forEach((function(t){var n=Za(t,2),e=n[0],r=n[1];return g[e]=g[r]})),g.resetProps=function(){return p.forEach((function(t){g[t.name](t.defaultVal)})),g},g.resetProps(),d._rerender=m,o&&u&&g(u),g}}var Ja=function(t){return"function"==typeof t?t:"string"==typeof t?function(n){return n[t]}:function(n){return t}};function Ka(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e<n;e++)r[e]=t[e];return r}function tu(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,i,o,a,u=[],l=!0,c=!1;try{if(o=(e=e.call(t)).next,0===n);else for(;!(l=(r=o.call(e)).done)&&(u.push(r.value),u.length!==n);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw i}}return u}}(t,n)||ru(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nu(t){return function(t){if(Array.isArray(t))return Ka(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ru(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eu(t){var n=function(t,n){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,n);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof n?n:n+""}function ru(t,n){if(t){if("string"==typeof t)return Ka(t,n);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ka(t,n):void 0}}var iu=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(n instanceof Array?n.length?n:[void 0]:[n]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),o=t.reduce((function(t,n){var r=t,o=n;return i.forEach((function(t,n){var a,u=t.keyAccessor;if(t.isProp){var l=o,c=l[u],s=function(t,n){if(null==t)return{};var e,r,i=function(t,n){if(null==t)return{};var e={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(n.includes(r))continue;e[r]=t[r]}return e}(t,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)e=o[r],n.includes(e)||{}.propertyIsEnumerable.call(t,e)&&(i[e]=t[e])}return i}(l,[u].map(eu));a=c,o=s}else a=u(o,n);n+1<i.length?(r.hasOwnProperty(a)||(r[a]={}),r=r[a]):e?(r.hasOwnProperty(a)||(r[a]=[]),r[a].push(o)):r[a]=o})),t}),{});e instanceof Function&&function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;r===i.length?Object.keys(n).forEach((function(t){return n[t]=e(n[t])})):Object.values(n).forEach((function(n){return t(n,r+1)}))}(o);var a=o;return r&&(a=[],function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.length===i.length?a.push({keys:e,vals:n}):Object.entries(n).forEach((function(n){var r=tu(n,2),i=r[0],o=r[1];return t(o,[].concat(nu(e),[i]))}))}(o),n instanceof Array&&0===n.length&&1===a.length&&(a[0].keys=[])),a};function ou(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e<n;e++)r[e]=t[e];return r}function au(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,i,o,a,u=[],l=!0,c=!1;try{if(o=(e=e.call(t)).next,0===n);else for(;!(l=(r=o.call(e)).done)&&(u.push(r.value),u.length!==n);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw i}}return u}}(t,n)||function(t,n){if(t){if("string"==typeof t)return ou(t,n);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?ou(t,n):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uu(t){return uu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uu(t)}!function(t,n){void 0===n&&(n={});var e=n.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===e&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}(".float-tooltip-kap {\n position: absolute;\n width: max-content; /* prevent shrinking near right edge */\n padding: 3px 5px;\n border-radius: 3px;\n font: 12px sans-serif;\n color: #eee;\n background: rgba(0,0,0,0.6);\n pointer-events: none;\n}\n");var lu=Qa({props:{content:{default:!1}},init:function(t,n){var e=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).style,r=void 0===e?{}:e,i=wt(!!t&&"object"===uu(t)&&!!t.node&&"function"==typeof t.node?t.node():t);n.tooltipEl=i.append("div").attr("class","float-tooltip-kap"),Object.entries(r).forEach((function(t){var e=au(t,2),r=e[0],i=e[1];return n.tooltipEl.style(r,i)})),n.tooltipEl.style("left","-10000px").style("display","none"),n.mouseInside=!1,i.on("mousemove.tooltip",(function(t){n.mouseInside=!0;var e=bt(t),r=i.node(),o=r.offsetWidth,a=r.offsetHeight;n.tooltipEl.style("left",e[0]+"px").style("top",e[1]+"px").style("transform","translate(-".concat(e[0]/o*100,"%, ").concat(a>130&&a-e[1]<100?"calc(-100% - 6px)":"21px",")"))})),i.on("mouseover.tooltip",(function(){n.mouseInside=!0,n.content&&n.tooltipEl.style("display","inline")})),i.on("mouseout.tooltip",(function(){n.mouseInside=!1,n.tooltipEl.style("display","none")}))},update:function(t){t.tooltipEl.style("display",t.content&&t.mouseInside?"inline":"none"),t.tooltipEl.html(t.content||"")}});function cu(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e<n;e++)r[e]=t[e];return r}function su(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,i,o,a,u=[],l=!0,c=!1;try{if(o=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;l=!1}else for(;!(l=(r=o.call(e)).done)&&(u.push(r.value),u.length!==n);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw i}}return u}}(t,n)||pu(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fu(t){return function(t){if(Array.isArray(t))return cu(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||pu(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hu(t){return hu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hu(t)}function pu(t,n){if(t){if("string"==typeof t)return cu(t,n);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?cu(t,n):void 0}}!function(t,n){void 0===n&&(n={});var e=n.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===e&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}(".horizon-container {\n position: relative;\n}\n\n.horizon-container.clickable {\n cursor: pointer;\n}");var du,yu,gu=Qa({props:{width:{default:window.innerWidth},height:{default:40},data:{default:[]},bands:{default:4},mode:{default:"offset"},x:{default:function(t){return t[0]}},y:{default:function(t){return t[1]}},xMin:{},xMax:{},yExtent:{},yScaleExp:{default:1},yAggregation:{default:function(t){return t.reduce((function(t,n){return t+n}))}},positiveColors:{default:["white","midnightblue"]},negativeColors:{default:["white","crimson"]},positiveColorStops:{},negativeColorStops:{},interpolationCurve:{default:xa,onChange:function(t,n){return n.area.curve(t||ga)}},duration:{default:0,triggerUpdate:!1},tooltipContent:{default:function(t){var n=t.x,e=t.y;return"<b>".concat(n,"</b>: ").concat(e)},triggerUpdate:!1},onHover:{triggerUpdate:!1},onClick:{triggerUpdate:!1}},stateInit:function(){return{area:_a(),xScale:Ur(),yScale:Yr(),colorScale:Ur()}},init:function(t,n,e){var r=e.useCanvas,i=void 0===r||r,o=wt(!!t&&"object"===hu(t)&&!!t.node&&"function"==typeof t.node?t.node():t);o.html(null);var a=n.container=o.append("div");a.attr("class","horizon-container"),n.tooltip=new lu(a),n.useCanvas=i,i?(n.canvas=a.append("canvas"),n.phantomDom=wt(document.createElement("phantom"))):n.svg=a.append("svg"),n[i?"canvas":"svg"].style("display","block").attr("width",n.width).attr("height",n.height)},update:function(t){var n=Ja(t.x),e=Ja(t.y),r=iu(t.data,(function(t){return+n(t)})),i=Object.entries(r).map((function(n){var r=su(n,2),i=r[0],o=r[1];return[+i,t.yAggregation(o.map(e)),o]})).sort((function(t,n){return su(t,1)[0]-su(n,1)[0]})),o=void 0!==t.xMin&&null!==t.xMin?t.xMin:i.length?i[0][0]:0,a=void 0!==t.xMax&&null!==t.xMax?t.xMax:i.length?i[i.length-1][0]:1,u=i.map((function(t){return su(t,1)[0]})),l=Math.max.apply(Math,fu(u.filter((function(t){return t<=o})))),c=Math.min.apply(Math,fu(u.filter((function(t){return t>=a}))));i=i.filter((function(t){var n=su(t,1)[0];return n>=l&&n<=c}));var s=t.yExtent||Math.max.apply(Math,[0].concat(fu(i.map((function(t){return Math.abs(t[1])})))));t.xScale.domain([o,a]).range([0,t.width]),t.yScale.domain([0,s]).range([0,t.height*t.bands]).exponent(Math.abs(t.yScaleExp||1));var f={},h={};["negative","positive"].forEach((function(n){var e="".concat(n,"Colors"),r="".concat(n,"ColorStops"),i=t[e].slice(),o=(t[r]||[]).slice().sort((function(t,n){return t-n}));if(i.length<2)throw new Error("".concat(e," (").concat(JSON.stringify(i),") must include at least 2 colors"));if(o.some((function(t){return t<=0||t>=1})))throw new Error("".concat(r," (").concat(JSON.stringify(o),") must only include values within ]0, 1["));var a=[0].concat(fu(o.slice(0,i.length-2))),u=a.pop();a=a.concat(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return fu(new Array(t)).map((function(t,n){return n})).map(Ur().domain([0,t-1]).range([n,e]))}(i.length-a.length,u,1)),f[n]=a,h[n]=i})),t.colorScale.domain([].concat(fu(f.negative.map((function(t){return-t})).reverse()),fu(f.positive)).map((function(n){return Math.round(n*t.bands)}))).range([].concat(fu(h.negative.reverse()),fu(h.positive)));var p=null;t[t.useCanvas?"canvas":"svg"].on("click",(function(){t.onClick&&t.onClick(p?{x:p[0],y:p[1],points:p[2]}:null)})).on("mousemove",(function(n){if(t.onHover||t.onClick||t.tooltipContent){var e=bt(n),r=function(n){var e=null,r=1/0;return i.some((function(t){var i=Math.abs(n-t[0]);if(i>r)return!0;r=i,e=t})),t.xScale(r)-t.xScale(0)>25?null:e}(t.xScale.invert(e[0]));if((!t.tooltipContent||!r)&&t.tooltip.content(null),p!==r){var o=(p=r)?{x:p[0],y:p[1],points:p[2]}:null;t.onHover&&t.onHover(o),o&&t.tooltipContent&&t.tooltip.content(t.tooltipContent(o))}}})).on("mouseleave",(function(){t.tooltip.content(null),p=null,t.onHover&&t.onHover(null)})),t.container.node().classList[t.onClick?"add":"remove"]("clickable");var d=ur(-1,-t.bands-1,-1).concat(ur(1,t.bands+1));t.useCanvas?function(){var n=t.phantomDom.selectAll("band").data(d,Number),e=(o=t.bands,a=t.height,u=t.mode,"offset"===u?function(t){return(t+(t<0)-o)*a}:function(t){return(t-o)*a}),r=function(t){return function(n){return"offset"===t||n>=0?1:-1}}(t.mode);var o,a,u;n.exit().transition().duration(t.duration).attr("yTranslate",e).attr("yScale",r).remove();var l=n.enter().append("band").attr("fillColor",t.colorScale).attr("yTranslate",e).attr("yScale",r).attr("ySize",0);n.merge(l).transition().duration(t.duration).attr("fillColor",t.colorScale).attr("yTranslate",e).attr("yScale",r).attr("ySize",1),t.phantomDom.attr("canvasWidth")||t.phantomDom.attr("canvasWidth",t.width);t.phantomDom.attr("canvasHeight")||t.phantomDom.attr("canvasHeight",t.height);t.phantomDom.transition().duration(t.duration).attr("canvasWidth",t.width).attr("canvasHeight",t.height).tween("drawAnimate",(function(){return s}));var c=t.canvas.node().getContext("2d");function s(){var n=t.phantomDom.attr("canvasWidth"),e=t.phantomDom.attr("canvasHeight");t.canvas.attr("width",n).attr("height",e),c.clearRect(0,0,n,e),t.phantomDom.selectAll("band").each((function(){var n=wt(this);c.save(),c.scale(1,n.attr("yScale")),c.translate(0,n.attr("yTranslate")),c.beginPath(),t.area.y1((function(e){return t.height*t.bands-t.yScale(e[1])*n.attr("ySize")}))(i),c.restore(),c.fillStyle=n.attr("fillColor"),c.fill()}))}t.area.x((function(n){return t.xScale(n[0])})).y0(t.height*t.bands).context(c)}():function(){t.svg.transition().duration(t.duration).attr("width",t.width).attr("height",t.height);var n=t.height*t.bands,e=t.area.x((function(n){return t.xScale(n[0])})).y0(n).y1(n)(i),r=t.area.y1((function(n){return t.height*t.bands-t.yScale(n[1])}))(i),o=(u=t.bands,l=t.height,c=t.mode,"offset"===c?function(t){return"translate(0,".concat((t+(t<0)-u)*l,")")}:function(t){return"".concat(t<0?"scale(1,-1)":""," translate(0,").concat((t-u)*l,")")}),a=t.svg.selectAll("path").data(d,Number);var u,l,c;a.exit().transition().duration(t.duration).attr("transform",o).remove();var s=a.enter().append("path").style("fill",t.colorScale).attr("transform",o).attr("d",e);a.merge(s).transition().duration(t.duration).style("fill",t.colorScale).attr("transform",o).attr("d",r)}()}}),vu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function mu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _u=function(){if(yu)return du;yu=1;var t,n="__lodash_hash_undefined__",e="[object Function]",r="[object GeneratorFunction]",i=/^\[object .+?Constructor\]$/,o="object"==typeof vu&&vu&&vu.Object===Object&&vu,a="object"==typeof self&&self&&self.Object===Object&&self,u=o||a||Function("return this")(),l=Array.prototype,c=Function.prototype,s=Object.prototype,f=u["__core-js_shared__"],h=(t=/[^.]+$/.exec(f&&f.keys&&f.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"",p=c.toString,d=s.hasOwnProperty,y=s.toString,g=RegExp("^"+p.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=l.splice,m=T(u,"Map"),_=T(Object,"create");function w(t){var n=-1,e=t?t.length:0;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function b(t){var n=-1,e=t?t.length:0;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function x(t){var n=-1,e=t?t.length:0;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function M(t,n){for(var e,r,i=t.length;i--;)if((e=t[i][0])===(r=n)||e!=e&&r!=r)return i;return-1}function S(t){if(!k(t)||(n=t,h&&h in n))return!1;var n,o=function(t){var n=k(t)?y.call(t):"";return n==e||n==r}(t)||function(t){var n=!1;if(null!=t&&"function"!=typeof t.toString)try{n=!!(t+"")}catch(t){}return n}(t)?g:i;return o.test(function(t){if(null!=t){try{return p.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function C(t,n){var e,r,i=t.__data__;return("string"==(r=typeof(e=n))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e)?i["string"==typeof n?"string":"hash"]:i.map}function T(t,n){var e=function(t,n){return null==t?void 0:t[n]}(t,n);return S(e)?e:void 0}function A(t,n){if("function"!=typeof t||n&&"function"!=typeof n)throw new TypeError("Expected a function");var e=function(){var r=arguments,i=n?n.apply(this,r):r[0],o=e.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return e.cache=o.set(i,a),a};return e.cache=new(A.Cache||x),e}function k(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}return w.prototype.clear=function(){this.__data__=_?_(null):{}},w.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},w.prototype.get=function(t){var e=this.__data__;if(_){var r=e[t];return r===n?void 0:r}return d.call(e,t)?e[t]:void 0},w.prototype.has=function(t){var n=this.__data__;return _?void 0!==n[t]:d.call(n,t)},w.prototype.set=function(t,e){return this.__data__[t]=_&&void 0===e?n:e,this},b.prototype.clear=function(){this.__data__=[]},b.prototype.delete=function(t){var n=this.__data__,e=M(n,t);return!(e<0)&&(e==n.length-1?n.pop():v.call(n,e,1),!0)},b.prototype.get=function(t){var n=this.__data__,e=M(n,t);return e<0?void 0:n[e][1]},b.prototype.has=function(t){return M(this.__data__,t)>-1},b.prototype.set=function(t,n){var e=this.__data__,r=M(e,t);return r<0?e.push([t,n]):e[r][1]=n,this},x.prototype.clear=function(){this.__data__={hash:new w,map:new(m||b),string:new w}},x.prototype.delete=function(t){return C(this,t).delete(t)},x.prototype.get=function(t){return C(this,t).get(t)},x.prototype.has=function(t){return C(this,t).has(t)},x.prototype.set=function(t,n){return C(this,t).set(t,n),this},A.Cache=x,du=A}(),wu=mu(_u),bu={second:Jr,minute:Kr,hour:ni,day:ri,week:ui,month:xi,year:Si},xu={second:Jr,minute:ti,hour:ei,day:ii,week:yi,month:Mi,year:Ci},Mu={millisecond:function(){return".%L"},second:function(){return":%S"},minute:function(t){var n=t.use24h;return"%".concat(n?"H":"I",":%M")},hour:function(t){return t.use24h?"%H:%M":"%I %p"},day:function(){return"%a %d"},week:function(){return"%b %d"},month:function(){return"%b"},year:function(){return"%Y"}};var Su=["x","y"],Cu=Qa({props:{width:{default:window.innerWidth},height:{default:window.innerHeight},data:{default:[]},ts:{default:"ts"},val:{default:"val"},series:{},seriesComparator:{default:function(t,n){return t.localeCompare(n)}},horizonBands:{default:4},horizonMode:{default:"offset"},useUtc:{default:!1},use24h:{default:!0},yExtent:{},yNormalize:{default:!1},yScaleExp:{default:1},yAggregation:{default:function(t){return t.reduce((function(t,n){return t+n}))}},positiveColors:{default:["white","midnightblue"]},negativeColors:{default:["white","crimson"]},positiveColorStops:{},negativeColorStops:{},interpolationCurve:{default:xa},seriesLabelFormatter:{default:function(t){return t}},showRuler:{default:!0,triggerUpdate:!1,onChange:function(t,n){return n.ruler&&n.ruler.style("visibility",t?"visible":"hidden")}},enableZoom:{default:!1},tooltipContent:{default:function(t){var n=t.series,e=t.ts,r=t.val,i=t.useUtc,o=t.use24h;return"<b>".concat(n,"</b><br>\n ").concat(new Date(e).toLocaleString(void 0,{timeZone:i?"UTC":void 0,hour12:!o}),":\n <b>").concat(r,"</b>")}},transitionDuration:{default:250},onHover:{triggerUpdate:!1},onClick:{}},stateInit:function(){return{horizonLayouts:{},zoomedInteraction:!1,timeAxis:Ze(0,t)};var t},init:function(t,n){var e=wt(!!t&&"object"===a(t)&&!!t.node&&"function"==typeof t.node?t.node():t);e.html(null),n.chartsEl=e.append("div").style("position","relative"),n.ruler=n.chartsEl.append("div").attr("class","horizon-ruler"),n.axisEl=e.append("svg").attr("height",20).style("display","block"),n.chartsEl.call(n.zoom=Le()),n.zoom.__baseElem=n.chartsEl,n.zoom.on("zoom",(function(){n.enableZoom&&(n.zoomedInteraction=!0,n._rerender())}))},update:function(t){var e,a,u,l,c,s,f,h,p=Ja(t.val),d=Ja(t.yExtent),y=Ja(t.yScaleExp),g=Ja(t.positiveColors),v=Ja(t.negativeColors),m=Ja(t.positiveColorStops),_=Ja(t.negativeColorStops),w=wu(Ja(t.ts)),b=t.data.map(w),x=(t.useUtc?oa:ia)().domain(function(t){let n,e;for(const r of t)null!=r&&(void 0===n?r>=r&&(n=e=r):(n>r&&(n=r),e<r&&(e=r)));return[n,e]}(b)).range([0,t.width]);if(t.timeAxis.scale(x).tickFormat((e={useUtc:t.useUtc,use24h:t.use24h},a=e.useUtc,u=void 0!==a&&a,l=e.use24h,c={use24h:void 0!==l&&l},s=u?Oi:Ui,f=Object.assign.apply(Object,[{}].concat(o(Object.entries(Mu).map((function(t){var e=i(t,2),r=e[0],o=e[1];return n({},r,s(o(c)))}))))),h=u?xu:bu,function(t){return(h.second(t)<t?f.millisecond:h.minute(t)<t?f.second:h.hour(t)<t?f.minute:h.day(t)<t?f.hour:h.month(t)<t?h.week(t)<t?f.day:f.week:h.year(t)<t?f.month:f.year)(t)})),t.zoom.scaleExtent([1,t.enableZoom?5e3:1]),t.enableZoom){t.zoom.translateExtent([[0,0],[t.width,0]]);var M=je(t.zoom.__baseElem.node()),S=(x.domain()[1]-x.domain()[0])/M.k,C=x.invert(-M.x/M.k);x.domain([C,new Date(+C+S)])}var T=iu(t.data,t.series),A=Object.keys(T).sort(t.seriesComparator).map((function(t){return{series:t,data:T[t]}})),k=t.yNormalize?function(t){let n;for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);return n}(iu(t.data,[t.series,function(t){return+w(t)}],(function(n){return t.yAggregation(n.map(p))}),!0).map((function(t){return t.vals})).map(Math.abs)):null,E=(t.height-20)/A.length,$=Math.min(13,Math.round(.9*E)),z=E>=20?1:0,N=xe().duration(t.zoomedInteraction?0:t.transitionDuration),j=t.chartsEl.selectAll(".horizon-series").data(A,(function(t){return t.series}));j.exit().each((function(n){var e=n.series;t.horizonLayouts[e].height(0),delete t.horizonLayouts[e]})).transition(N).remove();var D=j.enter().append("div").attr("class","horizon-series");D.append("div").attr("class","chart").each((function(n){var e=n.series;t.horizonLayouts[e]=new gu(this).width(t.width).height(E-z)})),D.append("span").attr("class","label").style("font-size",0);var U=j.merge(D).order();U.transition(N).style("width",t.width).style("border-top-width","".concat(z,"px")),U.select(".chart").each((function(n){var e=n.series,i=n.data;return t.horizonLayouts[e].width(t.width).height(E-z).data(i).bands(t.horizonBands).mode(t.horizonMode).x(w).y(p).yExtent(d(e)||k||null).yScaleExp(y(e)).yAggregation(t.yAggregation).xMin(x.domain()[0]).xMax(x.domain()[1]).positiveColors(g(e)).negativeColors(v(e)).positiveColorStops(m(e)).negativeColorStops(_(e)).interpolationCurve(t.interpolationCurve).duration(t.transitionDuration).tooltipContent(t.tooltipContent&&function(n){var i=n.x,o=n.y,a=function(t,n){if(null==t)return{};var e,r,i=function(t,n){if(null==t)return{};var e={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(n.includes(r))continue;e[r]=t[r]}return e}(t,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)e=o[r],n.includes(e)||{}.propertyIsEnumerable.call(t,e)&&(i[e]=t[e])}return i}(n,Su);return t.tooltipContent(r(r({series:e,ts:i,val:o},a),{},{useUtc:t.useUtc,use24h:t.use24h}))}).onHover((function(n){n&&t.ruler.style("left","".concat(x(n.x),"px")),t.ruler.style("opacity",n?.2:0),n&&t.onHover&&t.onHover({series:e,ts:n.x,val:n.y,points:n.points})})).onClick(t.onClick?function(n){return n&&t.onClick({series:e,ts:n.x,val:n.y,points:n.points})}:void 0)})),U.select(".label").transition(N).style("font-size","".concat($,"px")).text((function(n){return t.seriesLabelFormatter(n.series)})),t.axisEl.call(t.timeAxis).transition(N).attr("width",t.width),t.zoomedInteraction=!1}});return Cu}));