react-force-graph-2d
Version:
React component for 2D force directed graphs
2 lines • 169 kB
JavaScript
// Version 1.16.1 react-force-graph-2d - https://github.com/vasturiano/react-force-graph
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):(t=t||self).ForceGraph2D=n(t.React)}(this,(function(t){"use strict";var n="default"in t?t.default:t;function e(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if(!(Symbol.iterator in Object(t))&&"[object Arguments]"!==Object.prototype.toString.call(t))return;var e=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(e.push(a.value),!n||e.length!==n);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}return e}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function r(t){return function(t){if(Array.isArray(t)){for(var n=0,e=new Array(t.length);n<t.length;n++)e[n]=t[n];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var i=function(t,n){var i=new Set(n);return Object.assign.apply(Object,[{}].concat(r(Object.entries(t).filter((function(t){var n=e(t,1)[0];return!i.has(n)})).map((function(t){var n=e(t,2);return function(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}({},n[0],n[1])})))))},o=function(t){return[...t].reduce((t,[n,e])=>(t[n]=e,t),{})};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})(t)}function u(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var e=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(e.push(a.value),!n||e.length!==n);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}return e}(t,n)||c(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 s(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||c(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 c(t,n){if(t){if("string"==typeof t)return l(t,n);var e=Object.prototype.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)?l(t,n):void 0}}function l(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}var f="http://www.w3.org/1999/xhtml",h={svg:"http://www.w3.org/2000/svg",xhtml:f,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function p(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),h.hasOwnProperty(n)?{space:h[n],local:t}:t}function d(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===f&&n.documentElement.namespaceURI===f?n.createElement(t):n.createElementNS(e,t)}}function y(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function g(t){var n=p(t);return(n.local?y:d)(n)}function v(){}function m(t){return null==t?v:function(){return this.querySelector(t)}}function _(){return[]}function b(t){return null==t?_:function(){return this.querySelectorAll(t)}}function x(t){return function(){return this.matches(t)}}function w(t){return new Array(t.length)}function k(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}k.prototype={constructor:k,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)}};function z(t,n,e,r,i,o){for(var a,u=0,s=n.length,c=o.length;u<c;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new k(t,o[u]);for(;u<s;++u)(a=n[u])&&(i[u]=a)}function A(t,n,e,r,i,o,a){var u,s,c,l={},f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(s=n[u])&&(p[u]=c="$"+a.call(s,s.__data__,u,n),c in l?i[u]=s:l[c]=s);for(u=0;u<h;++u)(s=l[c="$"+a.call(t,o[u],u,o)])?(r[u]=s,s.__data__=o[u],l[c]=null):e[u]=new k(t,o[u]);for(u=0;u<f;++u)(s=n[u])&&l[p[u]]===s&&(i[u]=s)}function O(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function S(t){return function(){this.removeAttribute(t)}}function M(t){return function(){this.removeAttributeNS(t.space,t.local)}}function C(t,n){return function(){this.setAttribute(t,n)}}function E(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function T(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function j(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 N(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function P(t){return function(){this.style.removeProperty(t)}}function R(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 D(t,n){return t.style.getPropertyValue(n)||N(t).getComputedStyle(t,null).getPropertyValue(n)}function U(t){return function(){delete this[t]}}function L(t,n){return function(){this[t]=n}}function F(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function q(t){return t.trim().split(/^|\s+/)}function B(t){return t.classList||new H(t)}function H(t){this._node=t,this._names=q(t.getAttribute("class")||"")}function V(t,n){for(var e=B(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function $(t,n){for(var e=B(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function G(t){return function(){V(this,t)}}function X(t){return function(){$(this,t)}}function Y(t,n){return function(){(n.apply(this,arguments)?V:$)(this,t)}}function W(){this.textContent=""}function Z(t){return function(){this.textContent=t}}function Q(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function J(){this.innerHTML=""}function K(t){return function(){this.innerHTML=t}}function tt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function nt(){this.nextSibling&&this.parentNode.appendChild(this)}function et(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rt(){return null}function it(){var t=this.parentNode;t&&t.removeChild(this)}function ot(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function at(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}H.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 ut={},st=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(ut={mouseenter:"mouseover",mouseleave:"mouseout"}));function ct(t,n,e){return t=lt(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function lt(t,n,e){return function(r){var i=st;st=r;try{t.call(this,this.__data__,n,e)}finally{st=i}}}function ft(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}}))}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.capture);++i?n.length=i:delete this.__on}}}function pt(t,n,e){var r=ut.hasOwnProperty(t.type)?ct:lt;return function(i,o,a){var u,s=this.__on,c=r(n,o,a);if(s)for(var l=0,f=s.length;l<f;++l)if((u=s[l]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=c,u.capture=e),void(u.value=n);this.addEventListener(t.type,c,e),u={type:t.type,name:t.name,value:n,listener:c,capture:e},s?s.push(u):this.__on=[u]}}function dt(t,n,e,r){var i=st;t.sourceEvent=st,st=t;try{return n.apply(e,r)}finally{st=i}}function yt(t,n,e){var r=N(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 gt(t,n){return function(){return yt(this,t,n)}}function vt(t,n){return function(){return yt(this,t,n.apply(this,arguments))}}var mt=[null];function _t(t,n){this._groups=t,this._parents=n}function bt(){return new _t([[document.documentElement]],mt)}function xt(t){return"string"==typeof t?new _t([[document.querySelector(t)]],[document.documentElement]):new _t([[t]],mt)}function wt(){for(var t,n=st;t=n.sourceEvent;)n=t;return n}function kt(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]}function zt(t){var n=wt();return n.changedTouches&&(n=n.changedTouches[0]),kt(t,n)}function At(t,n,e){arguments.length<3&&(e=n,n=wt().changedTouches);for(var r,i=0,o=n?n.length:0;i<o;++i)if((r=n[i]).identifier===e)return kt(t,r);return null}_t.prototype=bt.prototype={constructor:_t,select:function(t){"function"!=typeof t&&(t=m(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],s=u.length,c=r[i]=new Array(s),l=0;l<s;++l)(o=u[l])&&(a=t.call(o,o.__data__,l,u))&&("__data__"in o&&(a.__data__=o.__data__),c[l]=a);return new _t(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=b(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a,u=n[o],s=u.length,c=0;c<s;++c)(a=u[c])&&(r.push(t.call(a,a.__data__,c,u)),i.push(a));return new _t(r,i)},filter:function(t){"function"!=typeof t&&(t=x(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,s=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&s.push(o);return new _t(r,this._parents)},data:function(t,n){if(!t)return p=new Array(this.size()),c=-1,this.each((function(t){p[++c]=t})),p;var e=n?A:z,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),s=new Array(o),c=0;c<o;++c){var l=r[c],f=i[c],h=f.length,p=t.call(l,l&&l.__data__,c,r),d=p.length,y=u[c]=new Array(d),g=a[c]=new Array(d);e(l,f,y,g,s[c]=new Array(h),p,n);for(var v,m,_=0,b=0;_<d;++_)if(v=y[_]){for(_>=b&&(b=_+1);!(m=g[b])&&++b<d;);v._next=m||null}}return(a=new _t(a,r))._enter=u,a._exit=s,a},enter:function(){return new _t(this._enter||this._groups.map(w),this._parents)},exit:function(){return new _t(this._exit||this._groups.map(w),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){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 s,c=n[u],l=e[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=c[p]||l[p])&&(h[p]=s);for(;u<r;++u)a[u]=n[u];return new _t(a,this._parents)},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=O);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],s=u.length,c=i[o]=new Array(s),l=0;l<s;++l)(a=u[l])&&(c[l]=a);c.sort(n)}return new _t(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each((function(){t[++n]=this})),t},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(){var t=0;return this.each((function(){++t})),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=p(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?M:S:"function"==typeof n?e.local?j:T:e.local?E:C)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?P:"function"==typeof n?I:R)(t,n,null==e?"":e)):D(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?U:"function"==typeof n?F:L)(t,n)):this.node()[t]},classed:function(t,n){var e=q(t+"");if(arguments.length<2){for(var r=B(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?Y:n?G:X)(e,n))},text:function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?Q:Z)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?J:("function"==typeof t?tt:K)(t)):this.node().innerHTML},raise:function(){return this.each(nt)},lower:function(){return this.each(et)},append:function(t){var n="function"==typeof t?t:g(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:g(t),r=null==n?rt:"function"==typeof n?n:m(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(it)},clone:function(t){return this.select(t?at:ot)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=ft(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?pt:ht,null==e&&(e=!1),r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var s,c=0,l=u.length;c<l;++c)for(r=0,s=u[c];r<a;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?vt:gt)(t,n))}};var Ot={value:function(){}};function St(){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 Mt(r)}function Mt(t){this._=t}function Ct(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function Et(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]=Ot,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}function jt(){st.stopImmediatePropagation()}function Nt(){st.preventDefault(),st.stopImmediatePropagation()}function Pt(t){var n=t.document.documentElement,e=xt(t).on("dragstart.drag",Nt,!0);"onselectstart"in n?e.on("selectstart.drag",Nt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Rt(t,n){var e=t.document.documentElement,r=xt(t).on("dragstart.drag",null);n&&(r.on("click.drag",Nt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}function It(t){return function(){return t}}function Dt(t,n,e,r,i,o,a,u,s,c){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=u,this.dy=s,this._=c}function Ut(){return!st.ctrlKey&&!st.button}function Lt(){return this.parentNode}function Ft(t){return null==t?{x:st.x,y:st.y}:t}function qt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Ht(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Vt(){}Mt.prototype=St.prototype={constructor:Mt,on:function(t,n){var e,r=this._,i=Ct(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<a;)if(e=(t=i[o]).type)r[e]=Tt(r[e],t.name,n);else if(null==n)for(e in r)r[e]=Tt(r[e],t.name,null);return this}for(;++o<a;)if((e=(t=i[o]).type)&&(e=Et(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new Mt(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)}},Dt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var $t="\\s*([+-]?\\d+)\\s*",Gt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yt=/^#([0-9a-f]{3,8})$/,Wt=new RegExp("^rgb\\("+[$t,$t,$t]+"\\)$"),Zt=new RegExp("^rgb\\("+[Xt,Xt,Xt]+"\\)$"),Qt=new RegExp("^rgba\\("+[$t,$t,$t,Gt]+"\\)$"),Jt=new RegExp("^rgba\\("+[Xt,Xt,Xt,Gt]+"\\)$"),Kt=new RegExp("^hsl\\("+[Gt,Xt,Xt]+"\\)$"),tn=new RegExp("^hsla\\("+[Gt,Xt,Xt,Gt]+"\\)$"),nn={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 en(){return this.rgb().formatHex()}function rn(){return this.rgb().formatRgb()}function on(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=Yt.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?an(n):3===e?new ln(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?un(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?un(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=Wt.exec(t))?new ln(n[1],n[2],n[3],1):(n=Zt.exec(t))?new ln(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Qt.exec(t))?un(n[1],n[2],n[3],n[4]):(n=Jt.exec(t))?un(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Kt.exec(t))?dn(n[1],n[2]/100,n[3]/100,1):(n=tn.exec(t))?dn(n[1],n[2]/100,n[3]/100,n[4]):nn.hasOwnProperty(t)?an(nn[t]):"transparent"===t?new ln(NaN,NaN,NaN,0):null}function an(t){return new ln(t>>16&255,t>>8&255,255&t,1)}function un(t,n,e,r){return r<=0&&(t=n=e=NaN),new ln(t,n,e,r)}function sn(t){return t instanceof Vt||(t=on(t)),t?new ln((t=t.rgb()).r,t.g,t.b,t.opacity):new ln}function cn(t,n,e,r){return 1===arguments.length?sn(t):new ln(t,n,e,null==r?1:r)}function ln(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function fn(){return"#"+pn(this.r)+pn(this.g)+pn(this.b)}function hn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function pn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function dn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new gn(t,n,e,r)}function yn(t){if(t instanceof gn)return new gn(t.h,t.s,t.l,t.opacity);if(t instanceof Vt||(t=on(t)),!t)return new gn;if(t instanceof gn)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,s=(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/=s<.5?o+i:2-o-i,a*=60):u=s>0&&s<1?0:a,new gn(a,u,s,t.opacity)}function gn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function vn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function mn(t){return function(){return t}}function _n(t){return 1==(t=+t)?bn: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):mn(isNaN(n)?e:n)}}function bn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):mn(isNaN(t)?n:t)}Bt(Vt,on,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:en,formatHex:en,formatHsl:function(){return yn(this).formatHsl()},formatRgb:rn,toString:rn}),Bt(ln,cn,Ht(Vt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new ln(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new ln(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){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:fn,formatHex:fn,formatRgb:hn,toString:hn})),Bt(gn,(function(t,n,e,r){return 1===arguments.length?yn(t):new gn(t,n,e,null==r?1:r)}),Ht(Vt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new gn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new gn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){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 ln(vn(t>=240?t-240:t+120,i,r),vn(t,i,r),vn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var xn=function t(n){var e=_n(n);function r(t,n){var r=e((t=cn(t)).r,(n=cn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=bn(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 wn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var kn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zn=new RegExp(kn.source,"g");function An(t,n){var e,r,i,o=kn.lastIndex=zn.lastIndex=0,a=-1,u=[],s=[];for(t+="",n+="";(e=kn.exec(t))&&(r=zn.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,s.push({i:a,x:wn(e,r)})),o=zn.lastIndex;return o<n.length&&(i=n.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?s[0]?function(t){return function(n){return t(n)+""}}(s[0].x):function(t){return function(){return t}}(n):(n=s.length,function(t){for(var e,r=0;r<n;++r)u[(e=s[r]).i]=e.x(t);return u.join("")})}var On,Sn,Mn,Cn,En=180/Math.PI,Tn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function jn(t,n,e,r,i,o){var a,u,s;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(s=t*e+n*r)&&(e-=t*s,r-=n*s),(u=Math.sqrt(e*e+r*r))&&(e/=u,r/=u,s/=u),t*r<n*e&&(t=-t,n=-n,s=-s,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*En,skewX:Math.atan(s)*En,scaleX:a,scaleY:u}}function Nn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var u=[],s=[];return o=t(o),a=t(a),function(t,r,i,o,a,u){if(t!==i||r!==o){var s=a.push("translate(",null,n,null,e);u.push({i:s-4,x:wn(t,i)},{i:s-2,x:wn(r,o)})}else(i||o)&&a.push("translate("+i+n+o+e)}(o.translateX,o.translateY,a.translateX,a.translateY,u,s),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:wn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,s),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:wn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,s),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:wn(t,e)},{i:u-2,x:wn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,s),o=a=null,function(t){for(var n,e=-1,r=s.length;++e<r;)u[(n=s[e]).i]=n.x(t);return u.join("")}}}var Pn=Nn((function(t){return"none"===t?Tn:(On||(On=document.createElement("DIV"),Sn=document.documentElement,Mn=document.defaultView),On.style.transform=t,t=Mn.getComputedStyle(Sn.appendChild(On),null).getPropertyValue("transform"),Sn.removeChild(On),jn(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),Rn=Nn((function(t){return null==t?Tn:(Cn||(Cn=document.createElementNS("http://www.w3.org/2000/svg","g")),Cn.setAttribute("transform",t),(t=Cn.transform.baseVal.consolidate())?jn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Tn)}),", ",")",")"),In=Math.SQRT2;function Dn(t){return((t=Math.exp(t))+1/t)/2}function Un(t,n){var e,r,i=t[0],o=t[1],a=t[2],u=n[0],s=n[1],c=n[2],l=u-i,f=s-o,h=l*l+f*f;if(h<1e-12)r=Math.log(c/a)/In,e=function(t){return[i+t*l,o+t*f,a*Math.exp(In*t*r)]};else{var p=Math.sqrt(h),d=(c*c-a*a+4*h)/(2*a*2*p),y=(c*c-a*a-4*h)/(2*c*2*p),g=Math.log(Math.sqrt(d*d+1)-d),v=Math.log(Math.sqrt(y*y+1)-y);r=(v-g)/In,e=function(t){var n=t*r,e=Dn(g),u=a/(2*p)*(e*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(In*n+g)-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+u*l,o+u*f,a*e/Dn(In*n+g)]}}return e.duration=1e3*r,e}var Ln,Fn,qn=0,Bn=0,Hn=0,Vn=0,$n=0,Gn=0,Xn="object"==typeof performance&&performance.now?performance:Date,Yn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Wn(){return $n||(Yn(Zn),$n=Xn.now()+Gn)}function Zn(){$n=0}function Qn(){this._call=this._time=this._next=null}function Jn(t,n,e){var r=new Qn;return r.restart(t,n,e),r}function Kn(){$n=(Vn=Xn.now())+Gn,qn=Bn=0;try{!function(){Wn(),++qn;for(var t,n=Ln;n;)(t=$n-n._time)>=0&&n._call.call(null,t),n=n._next;--qn}()}finally{qn=0,function(){var t,n,e=Ln,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:Ln=n);Fn=t,ne(r)}(),$n=0}}function te(){var t=Xn.now(),n=t-Vn;n>1e3&&(Gn-=n,Vn=t)}function ne(t){qn||(Bn&&(Bn=clearTimeout(Bn)),t-$n>24?(t<1/0&&(Bn=setTimeout(Kn,t-Xn.now()-Gn)),Hn&&(Hn=clearInterval(Hn))):(Hn||(Vn=Xn.now(),Hn=setInterval(te,1e3)),qn=1,Yn(Kn)))}function ee(t,n,e){var r=new Qn;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r}Qn.prototype=Jn.prototype={constructor:Qn,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Wn():+e)+(null==n?0:+n),this._next||Fn===this||(Fn?Fn._next=this:Ln=this,Fn=this),this._call=t,this._time=e,ne()},stop:function(){this._call&&(this._call=null,this._time=1/0,ne())}};var re=St("start","end","cancel","interrupt"),ie=[];function oe(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(s){var c,l,f,h;if(1!==e.state)return u();for(c in i)if((h=i[c]).name===e.name){if(3===h.state)return ee(o);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(ee((function(){3===e.state&&(e.state=4,e.timer.restart(a,e.delay,e.time),a(s))})),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,l=-1;c<f;++c)(h=e.tween[c].value.call(t,t.__data__,e.index,e.group))&&(r[++l]=h);r.length=l+1}}function a(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(u),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),u())}function u(){for(var r in e.state=6,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=Jn((function(t){e.state=1,e.timer.restart(o,e.delay,e.time),e.delay<=t&&o(t-e.delay)}),0,e.time)}(t,e,{name:n,index:r,group:i,on:re,tween:ie,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function ae(t,n){var e=se(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function ue(t,n){var e=se(t,n);if(e.state>3)throw new Error("too late; already running");return e}function se(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function ce(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 le(t,n){var e,r;return function(){var i=ue(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 fe(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=ue(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var u={name:n,value:e},s=0,c=i.length;s<c;++s)if(i[s].name===n){i[s]=u;break}s===c&&i.push(u)}o.tween=i}}function he(t,n,e){var r=t._id;return t.each((function(){var t=ue(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return se(t,r).value[n]}}function pe(t,n){var e;return("number"==typeof n?wn:n instanceof on?xn:(e=on(n))?(n=e,xn):An)(t,n)}function de(t){return function(){this.removeAttribute(t)}}function ye(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ge(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 ve(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 me(t,n,e){var r,i,o;return function(){var a,u,s=e(this);if(null!=s)return(a=this.getAttribute(t))===(u=s+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,s));this.removeAttribute(t)}}function _e(t,n,e){var r,i,o;return function(){var a,u,s=e(this);if(null!=s)return(a=this.getAttributeNS(t.space,t.local))===(u=s+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,s));this.removeAttributeNS(t.space,t.local)}}function be(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function xe(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function we(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&xe(t,i)),e}return i._value=n,i}function ke(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&be(t,i)),e}return i._value=n,i}function ze(t,n){return function(){ae(this,t).delay=+n.apply(this,arguments)}}function Ae(t,n){return n=+n,function(){ae(this,t).delay=n}}function Oe(t,n){return function(){ue(this,t).duration=+n.apply(this,arguments)}}function Se(t,n){return n=+n,function(){ue(this,t).duration=n}}function Me(t,n){if("function"!=typeof n)throw new Error;return function(){ue(this,t).ease=n}}function Ce(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)?ae:ue;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}var Ee=bt.prototype.constructor;function Te(t){return function(){this.style.removeProperty(t)}}function je(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function Ne(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&je(t,o,e)),r}return o._value=n,o}function Pe(t){return function(n){this.textContent=t.call(this,n)}}function Re(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&Pe(r)),n}return r._value=t,r}var Ie=0;function De(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Ue(){return++Ie}var Le=bt.prototype;De.prototype=function(t){return bt().transition(t)}.prototype={constructor:De,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=m(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var u,s,c=r[a],l=c.length,f=o[a]=new Array(l),h=0;h<l;++h)(u=c[h])&&(s=t.call(u,u.__data__,h,c))&&("__data__"in u&&(s.__data__=u.__data__),f[h]=s,oe(f[h],n,e,h,f,se(u,e)));return new De(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=b(t));for(var r=this._groups,i=r.length,o=[],a=[],u=0;u<i;++u)for(var s,c=r[u],l=c.length,f=0;f<l;++f)if(s=c[f]){for(var h,p=t.call(s,s.__data__,f,c),d=se(s,e),y=0,g=p.length;y<g;++y)(h=p[y])&&oe(h,n,e,y,p,d);o.push(p),a.push(s)}return new De(o,a,n,e)},filter:function(t){"function"!=typeof t&&(t=x(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,s=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&s.push(o);return new De(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 s,c=n[u],l=e[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=c[p]||l[p])&&(h[p]=s);for(;u<r;++u)a[u]=n[u];return new De(a,this._parents,this._name,this._id)},selection:function(){return new Ee(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=Ue(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],s=u.length,c=0;c<s;++c)if(a=u[c]){var l=se(a,n);oe(a,t,e,c,u,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new De(r,this._parents,t,e)},call:Le.call,nodes:Le.nodes,node:Le.node,size:Le.size,empty:Le.empty,each:Le.each,on:function(t,n){var e=this._id;return arguments.length<2?se(this.node(),e).on.on(t):this.each(Ce(e,t,n))},attr:function(t,n){var e=p(t),r="transform"===e?Rn:pe;return this.attrTween(t,"function"==typeof n?(e.local?_e:me)(e,r,he(this,"attr."+t,n)):null==n?(e.local?ye:de)(e):(e.local?ve:ge)(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=p(t);return this.tween(e,(r.local?we:ke)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Pn:pe;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=D(this,t),a=(this.style.removeProperty(t),D(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,Te(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var a=D(this,t),u=e(this),s=u+"";return null==u&&(this.style.removeProperty(t),s=u=D(this,t)),a===s?null:a===r&&s===i?o:(i=s,o=n(r=a,u))}}(t,r,he(this,"style."+t,n))).each(function(t,n){var e,r,i,o,a="style."+n,u="end."+a;return function(){var s=ue(this,t),c=s.on,l=null==s.value[a]?o||(o=Te(n)):void 0;c===e&&i===l||(r=(e=c).copy()).on(u,i=l),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var a=D(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,Ne(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}}(he(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,Re(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=se(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?le:fe)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ze:Ae)(n,t)):se(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Oe:Se)(n,t)):se(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(Me(n,t)):se(this.node(),n).ease},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(o,a){var u={value:a},s={value:function(){0==--i&&o()}};e.each((function(){var e=ue(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(u),n._.interrupt.push(u),n._.end.push(s)),e.on=n}))}))}};var Fe={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function qe(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return Fe.time=Wn(),Fe;return e}function Be(t){return function(){return t}}function He(t,n,e){this.target=t,this.type=n,this.transform=e}function Ve(t,n,e){this.k=t,this.x=n,this.y=e}bt.prototype.interrupt=function(t){return this.each((function(){ce(this,t)}))},bt.prototype.transition=function(t){var n,e;t instanceof De?(n=t._id,t=t._name):(n=Ue(),(e=Fe).time=Wn(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],s=u.length,c=0;c<s;++c)(a=u[c])&&oe(a,t,n,c,u,e||qe(a,n));return new De(r,this._parents,t,n)},Ve.prototype={constructor:Ve,scale:function(t){return 1===t?this:new Ve(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Ve(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 $e=new Ve(1,0,0);function Ge(t){for(;!t.__zoom;)if(!(t=t.parentNode))return $e;return t.__zoom}function Xe(){st.stopImmediatePropagation()}function Ye(){st.preventDefault(),st.stopImmediatePropagation()}function We(){return!st.ctrlKey&&!st.button}function Ze(){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 Qe(){return this.__zoom||$e}function Je(){return-st.deltaY*(1===st.deltaMode?.05:st.deltaMode?1:.002)}function Ke(){return navigator.maxTouchPoints||"ontouchstart"in this}function tr(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 nr(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e<i||void 0===e&&i>=i)&&(e=i)}return e}function er(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e>i||void 0===e&&i>=i)&&(e=i)}return e}Ge.prototype=Ve.prototype;var rr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ir(t,n,e){return t(e={path:n,exports:{},require:function(t,n){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==n&&e.path)}},e.exports),e.exports}var or=/^\s+|\s+$/g,ar=/^[-+]0x[0-9a-f]+$/i,ur=/^0b[01]+$/i,sr=/^0o[0-7]+$/i,cr=parseInt,lr="object"==typeof rr&&rr&&rr.Object===Object&&rr,fr="object"==typeof self&&self&&self.Object===Object&&self,hr=lr||fr||Function("return this")(),pr=Object.prototype.toString,dr=Math.max,yr=Math.min,gr=function(){return hr.Date.now()};function vr(t,n,e){var r,i,o,a,u,s,c=0,l=!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){return c=t,u=setTimeout(g,n),l?p(t):a}function y(t){var e=t-s;return void 0===s||e>=n||e<0||f&&t-c>=o}function g(){var t=gr();if(y(t))return v(t);u=setTimeout(g,function(t){var e=n-(t-s);return f?yr(e,o-(t-c)):e}(t))}function v(t){return u=void 0,h&&r?p(t):(r=i=void 0,a)}function m(){var t=gr(),e=y(t);if(r=arguments,i=this,s=t,e){if(void 0===u)return d(s);if(f)return u=setTimeout(g,n),p(s)}return void 0===u&&(u=setTimeout(g,n)),a}return n=_r(n)||0,mr(e)&&(l=!!e.leading,o=(f="maxWait"in e)?dr(_r(e.maxWait)||0,n):o,h="trailing"in e?!!e.trailing:h),m.cancel=function(){void 0!==u&&clearTimeout(u),c=0,r=s=i=u=void 0},m.flush=function(){return void 0===u?a:v(gr())},m}function mr(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function _r(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==pr.call(t)}(t))return NaN;if(mr(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=mr(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(or,"");var e=ur.test(t);return e||sr.test(t)?cr(t.slice(2),e?2:8):ar.test(t)?NaN:+t}var br=function(t,n,e){var r=!0,i=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return mr(e)&&(r="leading"in e?!!e.leading:r,i="trailing"in e?!!e.trailing:i),vr(t,n,{leading:r,maxWait:n,trailing:i})},xr=function(){this._tweens={},this._tweensAddedDuringUpdate={}};xr.prototype={getAll:function(){return Object.keys(this._tweens).map(function(t){return this._tweens[t]}.bind(this))},removeAll:function(){this._tweens={}},add:function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},remove:function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},update:function(t,n){var e=Object.keys(this._tweens);if(0===e.length)return!1;for(t=void 0!==t?t:kr.now();e.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<e.length;r++){var i=this._tweens[e[r]];i&&!1===i.update(t)&&(i._isPlaying=!1,n||delete this._tweens[e[r]])}e=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var wr,kr=new xr;function zr(t,n,e){var r,i,o,a,u;function s(){var c=Date.now()-a;c<n&&c>=0?r=setTimeout(s,n-c):(r=null,e||(u=t.apply(o,i),o=i=null))}null==n&&(n=100);var c=function(){o=this,i=arguments,a=Date.now();var c=e&&!r;return r||(r=setTimeout(s,n)),c&&(u=t.apply(o,i),o=i=null),u};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(u=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},c}kr.Group=xr,kr._nextId=0,kr.nextId=function(){return kr._nextId++},"undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?kr.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?kr.now=self.performance.now.bind(self.performance):void 0!==Date.now?kr.now=Date.now:kr.now=function(){return(new Date).getTime()},kr.Tween=function(t,n){this._isPaused=!1,this._pauseStart=null,this._object=t,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=kr.Easing.Linear.None,this._interpolationFunction=kr.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onRepeatCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=n||kr,this._id=kr.nextId()},kr.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},isPaused:function(){return this._isPaused},to:function(t,n){return this._valuesEnd=Object.create(t),void 0!==n&&(this._duration=n),this},duration:function(t){return this._duration=t,this},start:function(t){for(var n in this._group.add(this),this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._startTime=void 0!==t?"string"==typeof t?kr.now()+parseFloat(t):t:kr.now(),this._startTime+=this._delayTime,this._valuesEnd){if(this._valuesEnd[n]instanceof Array){if(0===this._valuesEnd[n].length)continue;this._valuesEnd[n]=[this._object[n]].concat(this._valuesEnd[n])}void 0!==this._object[n]&&(void 0===this._valuesStart[n]&&(this._valuesStart[n]=this._object[n]),this._valuesStart[n]instanceof Array==!1&&(this._valuesStart[n]*=1),this._valuesStartRepeat[n]=this._valuesStart[n]||0)}return this},stop:function(){return this._isPlaying?(this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,null!==this._onStopCallback&&this._onStopCallback(this._object),this.stopChainedTweens(),this):this},end:function(){return this.update(1/0),this},pause:function(t){return this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=void 0===t?kr.now():t,this._group.remove(this)),this},resume:function(t){return this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=(void 0===t?kr.now():t)-this._pauseStart,this._pauseStart=0,this._group.add(this),this):this},stopChainedTweens:function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop()},group:function(t){return this._group=t,this},delay:function(t){return this._delayTime=t,this},repeat:function(t){return this._repeat=t,this},repeatDelay:function(t){return this._repeatDelayTime=t,this},yoyo:function(t){return this._yoyo=t,this},easing:function(t){return this._easingFunction=t,this},interpolation:function(t){return this._interpolationFunction=t,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(t){return this._onStartCallback=t,this},onUpdate:function(t){return this._onUpdateCallback=t,this},onRepeat:function(t){return this._onRepeatCallback=t,this},onComplete:function(t){return this._onCompleteCallback=t,this},onStop:function(t){return this._onStopCallback=t,this},update:function(t){var n,e,r;if(t<this._startTime)return!0;for(n in!1===this._onStartCallbackFired&&(null!==this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),e=(t-this._startTime)/this._duration,e=0===this._duration||e>1?1:e,r=this._easingFunction(e),this._valuesEnd)if(void 0!==this._valuesStart[n]){var i=this._valuesStart[n]||0,o=this._valuesEnd[n];o instanceof Array?this._object[n]=this._interpolationFunction(o,r):("string"==typeof o&&(o="+"===o.charAt(0)||"-"===o.charAt(0)?i+parseFloat(o):parseFloat(o)),"number"==typeof o&&(this._object[n]=i+(o-i)*r))}if(null!==this._onUpdateCallback&&this._onUpdateCallba