// Version 1.42.16 force-graph - https://github.com/vasturiano/force-graph !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).ForceGraph=n()}(this,(function(){"use strict";function n(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 e(t){for(var e=1;et.length)&&(n=t.length);for(var e=0,r=new Array(n);e=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),d.hasOwnProperty(n)?{space:d[n],local:t}:t}function g(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 v(t){var n=p(t);return(n.local?y:g)(n)}function _(){}function m(t){return null==t?_:function(){return this.querySelector(t)}}function x(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function b(){return[]}function w(t){return null==t?b:function(){return this.querySelectorAll(t)}}function k(t){return function(){return this.matches(t)}}function z(t){return function(n){return n.matches(t)}}var A=Array.prototype.find;function M(){return this.firstElementChild}var S=Array.prototype.filter;function C(){return Array.from(this.children)}function E(t){return new Array(t.length)}function N(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function P(t){return function(){return t}}function O(t,n,e,r,i,o){for(var a,s=0,u=n.length,l=o.length;sn?1:t>=n?0:NaN}function I(t){return function(){this.removeAttribute(t)}}function U(t){return function(){this.removeAttributeNS(t.space,t.local)}}function F(t,n){return function(){this.setAttribute(t,n)}}function L(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function q(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function B(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 $(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function H(t){return function(){this.style.removeProperty(t)}}function V(t,n,e){return function(){this.style.setProperty(t,n,e)}}function G(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function X(t,n){return t.style.getPropertyValue(n)||$(t).getComputedStyle(t,null).getPropertyValue(n)}function Y(t){return function(){delete this[t]}}function W(t,n){return function(){this[t]=n}}function Z(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 K(t){return t.classList||new J(t)}function J(t){this._node=t,this._names=Q(t.getAttribute("class")||"")}function tt(t,n){for(var e=K(t),r=-1,i=n.length;++r=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function _t(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var kt=[null];function zt(t,n){this._groups=t,this._parents=n}function At(){return new zt([[document.documentElement]],kt)}function Mt(t){return"string"==typeof t?new zt([[document.querySelector(t)]],[document.documentElement]):new zt([[t]],kt)}function St(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]}zt.prototype=At.prototype={constructor:zt,select:function(t){"function"!=typeof t&&(t=m(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i=b&&(b=x+1);!(m=y[b])&&++b=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=D);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?H:"function"==typeof n?G:V)(t,n,null==e?"":e)):X(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?Y:"function"==typeof n?Z:W)(t,n)):this.node()[t]},classed:function(t,n){var e=Q(t+"");if(arguments.length<2){for(var r=K(this.node()),i=-1,o=e.length;++i{}};function Et(){for(var t,n=0,e=arguments.length,r={};n=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 Ot(t,n){for(var e,r=0,i=t.length;r0)for(var e,r,i=new Array(e),o=0;o()=>t;function qt(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:s,dx:u,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}function Bt(t){return!t.ctrlKey&&!t.button}function $t(){return this.parentNode}function Ht(t,n){return null==n?{x:t.x,y:t.y}:n}function Vt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Xt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Yt(){}qt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Wt=.7,Zt=1/Wt,Qt="\\s*([+-]?\\d+)\\s*",Kt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tn=/^#([0-9a-f]{3,8})$/,nn=new RegExp(`^rgb\\(${Qt},${Qt},${Qt}\\)$`),en=new RegExp(`^rgb\\(${Jt},${Jt},${Jt}\\)$`),rn=new RegExp(`^rgba\\(${Qt},${Qt},${Qt},${Kt}\\)$`),on=new RegExp(`^rgba\\(${Jt},${Jt},${Jt},${Kt}\\)$`),an=new RegExp(`^hsl\\(${Kt},${Jt},${Jt}\\)$`),sn=new RegExp(`^hsla\\(${Kt},${Jt},${Jt},${Kt}\\)$`),un={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 ln(){return this.rgb().formatHex()}function cn(){return this.rgb().formatRgb()}function hn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=tn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?fn(n):3===e?new yn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?dn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?dn(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=nn.exec(t))?new yn(n[1],n[2],n[3],1):(n=en.exec(t))?new yn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=rn.exec(t))?dn(n[1],n[2],n[3],n[4]):(n=on.exec(t))?dn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=an.exec(t))?wn(n[1],n[2]/100,n[3]/100,1):(n=sn.exec(t))?wn(n[1],n[2]/100,n[3]/100,n[4]):un.hasOwnProperty(t)?fn(un[t]):"transparent"===t?new yn(NaN,NaN,NaN,0):null}function fn(t){return new yn(t>>16&255,t>>8&255,255&t,1)}function dn(t,n,e,r){return r<=0&&(t=n=e=NaN),new yn(t,n,e,r)}function pn(t){return t instanceof Yt||(t=hn(t)),t?new yn((t=t.rgb()).r,t.g,t.b,t.opacity):new yn}function gn(t,n,e,r){return 1===arguments.length?pn(t):new yn(t,n,e,null==r?1:r)}function yn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function vn(){return`#${bn(this.r)}${bn(this.g)}${bn(this.b)}`}function _n(){const t=mn(this.opacity);return`${1===t?"rgb(":"rgba("}${xn(this.r)}, ${xn(this.g)}, ${xn(this.b)}${1===t?")":`, ${t})`}`}function mn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function xn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function bn(t){return((t=xn(t))<16?"0":"")+t.toString(16)}function wn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new zn(t,n,e,r)}function kn(t){if(t instanceof zn)return new zn(t.h,t.s,t.l,t.opacity);if(t instanceof Yt||(t=hn(t)),!t)return new zn;if(t instanceof zn)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,s=o-i,u=(o+i)/2;return s?(a=n===o?(e-r)/s+6*(e0&&u<1?0:a,new zn(a,s,u,t.opacity)}function zn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function An(t){return(t=(t||0)%360)<0?t+360:t}function Mn(t){return Math.max(0,Math.min(1,t||0))}function Sn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Gt(Yt,hn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ln,formatHex:ln,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return kn(this).formatHsl()},formatRgb:cn,toString:cn}),Gt(yn,gn,Xt(Yt,{brighter(t){return t=null==t?Zt:Math.pow(Zt,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Wt:Math.pow(Wt,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new yn(xn(this.r),xn(this.g),xn(this.b),mn(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:vn,formatHex:vn,formatHex8:function(){return`#${bn(this.r)}${bn(this.g)}${bn(this.b)}${bn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:_n,toString:_n})),Gt(zn,(function(t,n,e,r){return 1===arguments.length?kn(t):new zn(t,n,e,null==r?1:r)}),Xt(Yt,{brighter(t){return t=null==t?Zt:Math.pow(Zt,t),new zn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Wt:Math.pow(Wt,t),new zn(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 yn(Sn(t>=240?t-240:t+120,i,r),Sn(t,i,r),Sn(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new zn(An(this.h),Mn(this.s),Mn(this.l),mn(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=mn(this.opacity);return`${1===t?"hsl(":"hsla("}${An(this.h)}, ${100*Mn(this.s)}%, ${100*Mn(this.l)}%${1===t?")":`, ${t})`}`}}));var Cn=t=>()=>t;function En(t){return 1==(t=+t)?Nn: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):Cn(isNaN(n)?e:n)}}function Nn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):Cn(isNaN(t)?n:t)}var Pn=function t(n){var e=En(n);function r(t,n){var r=e((t=gn(t)).r,(n=gn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=Nn(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 On(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var Tn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,jn=new RegExp(Tn.source,"g");function Rn(t,n){var e,r,i,o=Tn.lastIndex=jn.lastIndex=0,a=-1,s=[],u=[];for(t+="",n+="";(e=Tn.exec(t))&&(r=jn.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(e=e[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:On(e,r)})),o=jn.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:On(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,s,u),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:On(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,s,u),function(t,n,e,r,o,a){if(t!==e||n!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:On(t,e)},{i:s-2,x:On(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var n,e=-1,r=u.length;++e=0&&n._call.call(void 0,t),n=n._next;--Xn}()}finally{Xn=0,function(){var t,n,e=Hn,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:Hn=n);Vn=t,se(r)}(),Qn=0}}function ae(){var t=Jn.now(),n=t-Zn;n>1e3&&(Kn-=n,Zn=t)}function se(t){Xn||(Yn&&(Yn=clearTimeout(Yn)),t-Qn>24?(t<1/0&&(Yn=setTimeout(oe,t-Jn.now()-Kn)),Wn&&(Wn=clearInterval(Wn))):(Wn||(Zn=Jn.now(),Wn=setInterval(ae,1e3)),Xn=1,te(oe)))}function ue(t,n,e){var r=new re;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}re.prototype=ie.prototype={constructor:re,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?ne():+e)+(null==n?0:+n),this._next||Vn===this||(Vn?Vn._next=this:Hn=this,Vn=this),this._call=t,this._time=e,se()},stop:function(){this._call&&(this._call=null,this._time=1/0,se())}};var le=Et("start","end","cancel","interrupt"),ce=[];function he(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 l,c,h,f;if(1!==e.state)return u();for(l in i)if((f=i[l]).name===e.name){if(3===f.state)return ue(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l0)throw new Error("too late; already scheduled");return e}function de(t,n){var e=pe(t,n);if(e.state>3)throw new Error("too late; already running");return e}function pe(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function ge(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 ye(t,n){var e,r;return function(){var i=de(this,t),o=i.tween;if(o!==e)for(var a=0,s=(r=e=o).length;a=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?fe:de;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(n,e),a.on=i}}var De=At.prototype.constructor;function Ie(t){return function(){this.style.removeProperty(t)}}function Ue(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function Fe(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&Ue(t,o,e)),r}return o._value=n,o}function Le(t){return function(n){this.textContent=t.call(this,n)}}function qe(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&Le(r)),n}return r._value=t,r}var Be=0;function $e(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function He(){return++Be}var Ve=At.prototype;$e.prototype={constructor:$e,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()=>t;function We(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 Qe=new Ze(1,0,0);function Ke(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Qe;return t.__zoom}function Je(t){t.stopImmediatePropagation()}function tr(t){t.preventDefault(),t.stopImmediatePropagation()}function nr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function er(){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 rr(){return this.__zoom||Qe}function ir(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function or(){return navigator.maxTouchPoints||"ontouchstart"in this}function ar(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 sr(){var t,n,e,r=nr,i=er,o=ar,a=ir,s=or,u=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,h=Gn,f=Et("start","zoom","end"),d=500,p=0,g=10;function y(t){t.property("__zoom",rr).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",A).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,n){return(n=Math.max(u[0],Math.min(u[1],n)))===t.k?t:new Ze(n,t.x,t.y)}function _(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 x(t,n,e,r){t.on("start.zoom",(function(){b(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=b(t,o).event(r),s=i.apply(t,o),u=null==e?m(s):"function"==typeof e?e.apply(t,o):e,l=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),c=t.__zoom,f="function"==typeof n?n.apply(t,o):n,d=h(c.invert(u).concat(l/c.k),f.invert(u).concat(l/f.k));return function(t){if(1===t)t=f;else{var n=d(t),e=l/n[2];t=new Ze(e,u[0]-n[0]*e,u[1]-n[1]*e)}a.zoom(null,t)}}))}function b(t,n,e){return!e&&t.__zooming||new w(t,n)}function w(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,n),this.taps=0}function k(t,...n){if(r.apply(this,arguments)){var e=b(this,n).event(t),i=this.__zoom,s=Math.max(u[0],Math.min(u[1],i.k*Math.pow(2,a.apply(this,arguments)))),c=St(t);if(e.wheel)e.mouse[0][0]===c[0]&&e.mouse[0][1]===c[1]||(e.mouse[1]=i.invert(e.mouse[0]=c)),clearTimeout(e.wheel);else{if(i.k===s)return;e.mouse=[c,i.invert(c)],ge(this),e.start()}tr(t),e.wheel=setTimeout(h,150),e.zoom("mouse",o(_(v(i,s),e.mouse[0],e.mouse[1]),e.extent,l))}function h(){e.wheel=null,e.end()}}function z(t,...n){if(!e&&r.apply(this,arguments)){var i=t.currentTarget,a=b(this,n,!0).event(t),s=Mt(t.view).on("mousemove.zoom",f,!0).on("mouseup.zoom",d,!0),u=St(t,i),c=t.clientX,h=t.clientY;Ut(t.view),Je(t),a.mouse=[u,this.__zoom.invert(u)],ge(this),a.start()}function f(t){if(tr(t),!a.moved){var n=t.clientX-c,e=t.clientY-h;a.moved=n*n+e*e>p}a.event(t).zoom("mouse",o(_(a.that.__zoom,a.mouse[0]=St(t,i),a.mouse[1]),a.extent,l))}function d(t){s.on("mousemove.zoom mouseup.zoom",null),Ft(t.view,a.moved),tr(t),a.event(t).end()}}function A(t,...n){if(r.apply(this,arguments)){var e=this.__zoom,a=St(t.changedTouches?t.changedTouches[0]:t,this),s=e.invert(a),u=e.k*(t.shiftKey?.5:2),h=o(_(v(e,u),a,s),i.apply(this,n),l);tr(t),c>0?Mt(this).transition().duration(c).call(x,h,a,t):Mt(this).call(y.transform,h,a,t)}}function M(e,...i){if(r.apply(this,arguments)){var o,a,s,u,l=e.touches,c=l.length,h=b(this,i,e.changedTouches.length===c).event(e);for(Je(e),a=0;a=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e=i)&&(e=i)}return e}function fr(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}var dr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},pr="Expected a function",gr=/^\s+|\s+$/g,yr=/^[-+]0x[0-9a-f]+$/i,vr=/^0b[01]+$/i,_r=/^0o[0-7]+$/i,mr=parseInt,xr="object"==typeof dr&&dr&&dr.Object===Object&&dr,br="object"==typeof self&&self&&self.Object===Object&&self,wr=xr||br||Function("return this")(),kr=Object.prototype.toString,zr=Math.max,Ar=Math.min,Mr=function(){return wr.Date.now()};function Sr(t,n,e){var r,i,o,a,s,u,l=0,c=!1,h=!1,f=!0;if("function"!=typeof t)throw new TypeError(pr);function d(n){var e=r,o=i;return r=i=void 0,l=n,a=t.apply(o,e)}function p(t){return l=t,s=setTimeout(y,n),c?d(t):a}function g(t){var e=t-u;return void 0===u||e>=n||e<0||h&&t-l>=o}function y(){var t=Mr();if(g(t))return v(t);s=setTimeout(y,function(t){var e=n-(t-u);return h?Ar(e,o-(t-l)):e}(t))}function v(t){return s=void 0,f&&r?d(t):(r=i=void 0,a)}function _(){var t=Mr(),e=g(t);if(r=arguments,i=this,u=t,e){if(void 0===s)return p(u);if(h)return s=setTimeout(y,n),d(u)}return void 0===s&&(s=setTimeout(y,n)),a}return n=Er(n)||0,Cr(e)&&(c=!!e.leading,o=(h="maxWait"in e)?zr(Er(e.maxWait)||0,n):o,f="trailing"in e?!!e.trailing:f),_.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=i=s=void 0},_.flush=function(){return void 0===s?a:v(Mr())},_}function Cr(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function Er(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==kr.call(t)}(t))return NaN;if(Cr(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=Cr(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(gr,"");var e=vr.test(t);return e||_r.test(t)?mr(t.slice(2),e?2:8):yr.test(t)?NaN:+t}var Nr=function(t,n,e){var r=!0,i=!0;if("function"!=typeof t)throw new TypeError(pr);return Cr(e)&&(r="leading"in e?!!e.leading:r,i="trailing"in e?!!e.trailing:i),Sr(t,n,{leading:r,maxWait:n,trailing:i})},Pr={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var n=1.70158;return t*t*((n+1)*t-n)},Out:function(t){var n=1.70158;return--t*t*((n+1)*t+n)+1},InOut:function(t){var n=2.5949095;return(t*=2)<1?t*t*((n+1)*t-n)*.5:.5*((t-=2)*t*((n+1)*t+n)+2)}},Bounce:{In:function(t){return 1-Pr.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*Pr.Bounce.In(2*t):.5*Pr.Bounce.Out(2*t-1)+.5}}},Or="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},Tr=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(n){return t._tweens[n]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,n){void 0===t&&(t=Or()),void 0===n&&(n=!1);var e=Object.keys(this._tweens);if(0===e.length)return!1;for(;e.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r1?o(t[e],t[e-1],e-r):o(t[i],t[i+1>e?e:i+1],r-i)},Bezier:function(t,n){for(var e=0,r=t.length-1,i=Math.pow,o=jr.Utils.Bernstein,a=0;a<=r;a++)e+=i(1-n,r-a)*i(n,a)*t[a]*o(r,a);return e},CatmullRom:function(t,n){var e=t.length-1,r=e*n,i=Math.floor(r),o=jr.Utils.CatmullRom;return t[0]===t[e]?(n<0&&(i=Math.floor(r=e*(1+n))),o(t[(i-1+e)%e],t[i],t[(i+1)%e],t[(i+2)%e],r-i)):n<0?t[0]-(o(t[0],t[0],t[1],t[1],-r)-t[0]):n>1?t[e]-(o(t[e],t[e],t[e-1],t[e-1],r-e)-t[e]):o(t[i?i-1:0],t[i],t[e1;r--)e*=r;return t[n]=e,e}}(),CatmullRom:function(t,n,e,r,i){var o=.5*(e-t),a=.5*(r-n),s=i*i;return(2*n-2*e+o+a)*(i*s)+(-3*n+3*e-2*o-a)*s+o*i+n}}},Rr=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),Dr=new Tr,Ir=function(){function t(t,n){void 0===n&&(n=Dr),this._object=t,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Pr.Linear.None,this._interpolationFunction=jr.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=Rr.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,n){return this._valuesEnd=Object.create(t),void 0!==n&&(this._duration=n),this},t.prototype.duration=function(t){return this._duration=t,this},t.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==t?"string"==typeof t?Or()+parseFloat(t):t:Or(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,n,e,r){for(var i in e){var o=t[i],a=Array.isArray(o),s=a?"array":typeof o,u=!a&&Array.isArray(e[i]);if("undefined"!==s&&"function"!==s){if(u){var l=e[i];if(0===l.length)continue;l=l.map(this._handleRelativeValue.bind(this,o)),e[i]=[o].concat(l)}if("object"!==s&&!a||!o||u)void 0===n[i]&&(n[i]=o),a||(n[i]*=1),r[i]=u?e[i].slice().reverse():n[i]||0;else{for(var c in n[i]=a?[]:{},o)n[i][c]=o[c];r[i]=a?[]:{},this._setupProperties(o,n[i],e[i],r[i])}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=Or()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=Or()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;ti)return!1;n&&this.start(t)}if(this._goToEnd=!1,t1?1:r;var o=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),1===r){if(this._repeat>0){for(e in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[e]||(this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(this._valuesEnd[e])),this._yoyo&&this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,s=this._chainedTweens.length;a=0?r=setTimeout(u,n-l):(r=null,e||(s=t.apply(o,i),o=i=null))}null==n&&(n=100);var l=function(){o=this,i=arguments,a=Date.now();var l=e&&!r;return r||(r=setTimeout(u,n)),l&&(s=t.apply(o,i),o=i=null),s};return l.clear=function(){r&&(clearTimeout(r),r=null)},l.flush=function(){r&&(s=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},l}Gr.debounce=Gr;var Xr=Gr;function Yr(t,n){for(var e=0;et.length)&&(n=t.length);for(var e=0,r=new Array(n);e0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},e instanceof Function?e(t):e,{initialised:!1}),r={};function i(n){return o(n,t),s(),i}var o=function(t,e){c.call(i,t,n,e),n.initialised=!0},s=Xr((function(){n.initialised&&(f.call(i,n,r),r={})}),1);return d.forEach((function(t){i[t.name]=function(t){var e=t.name,o=t.triggerUpdate,a=void 0!==o&&o,u=t.onChange,l=void 0===u?function(t,n){}:u,c=t.defaultVal,h=void 0===c?null:c;return function(t){var o=n[e];if(!arguments.length)return o;var u=void 0===t?h:t;return n[e]=u,l.call(i,u,n,o),!r.hasOwnProperty(e)&&(r[e]=o),a&&s(),i}}(t)})),Object.keys(a).forEach((function(t){i[t]=function(){for(var e,r=arguments.length,o=new Array(r),s=0;s1&&(e-=1),e<1/6?t+6*(n-t)*e:e<.5?n:e<2/3?t+(n-t)*(2/3-e)*6:t}if(t=N(t,360),n=N(n,100),e=N(e,100),0===n)r=i=o=e;else{var s=e<.5?e*(1+n):e+n-e*n,u=2*e-s;r=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,u,c),h=!0,f="hsl"),t.hasOwnProperty("a")&&(o=t.a));var d,p,g;return o=E(o),{ok:h,format:t.format||f,r:a(255,s(i.r,0)),g:a(255,s(i.g,0)),b:a(255,s(i.b,0)),a:o}}(t);this._originalInput=t,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=o(100*this._a)/100,this._format=u.format||c.format,this._gradientType=u.gradientType,this._r<1&&(this._r=o(this._r)),this._g<1&&(this._g=o(this._g)),this._b<1&&(this._b=o(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,n,e){t=N(t,255),n=N(n,255),e=N(e,255);var r,i,o=s(t,n,e),u=a(t,n,e),l=(o+u)/2;if(o==u)r=i=0;else{var c=o-u;switch(i=l>.5?c/(2-o-u):c/(o+u),o){case t:r=(n-e)/c+(n>1)+720)%360;--n;)r.h=(r.h+i)%360,o.push(l(r));return o}function M(t,n){n=n||6;for(var e=l(t).toHsv(),r=e.h,i=e.s,o=e.v,a=[],s=1/n;n--;)a.push(l({h:r,s:i,v:o})),o=(o+s)%1;return a}l.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,i=this.toRgb();return t=i.r/255,e=i.g/255,r=i.b/255,.2126*(t<=.03928?t/12.92:n.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:n.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:n.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=o(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),n=o(360*t.h),e=o(100*t.s),r=o(100*t.v);return 1==this._a?"hsv("+n+", "+e+"%, "+r+"%)":"hsva("+n+", "+e+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),n=o(360*t.h),e=o(100*t.s),r=o(100*t.l);return 1==this._a?"hsl("+n+", "+e+"%, "+r+"%)":"hsla("+n+", "+e+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return f(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,n,e,r,i){var a=[T(o(t).toString(16)),T(o(n).toString(16)),T(o(e).toString(16)),T(R(r))];if(i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:o(this._r),g:o(this._g),b:o(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+o(this._r)+", "+o(this._g)+", "+o(this._b)+")":"rgba("+o(this._r)+", "+o(this._g)+", "+o(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:o(100*N(this._r,255))+"%",g:o(100*N(this._g,255))+"%",b:o(100*N(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+o(100*N(this._r,255))+"%, "+o(100*N(this._g,255))+"%, "+o(100*N(this._b,255))+"%)":"rgba("+o(100*N(this._r,255))+"%, "+o(100*N(this._g,255))+"%, "+o(100*N(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var n="#"+d(this._r,this._g,this._b,this._a),e=n,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=l(t);e="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+n+",endColorstr="+e+")"},toString:function(t){var n=!!t;t=t||this._format;var e=!1,r=this._a<1&&this._a>=0;return n||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(e=this.toRgbString()),"prgb"===t&&(e=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(e=this.toHexString()),"hex3"===t&&(e=this.toHexString(!0)),"hex4"===t&&(e=this.toHex8String(!0)),"hex8"===t&&(e=this.toHex8String()),"name"===t&&(e=this.toName()),"hsl"===t&&(e=this.toHslString()),"hsv"===t&&(e=this.toHsvString()),e||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return l(this.toString())},_applyModification:function(t,n){var e=t.apply(null,[this].concat([].slice.call(n)));return this._r=e._r,this._g=e._g,this._b=e._b,this.setAlpha(e._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(z,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},l.fromRatio=function(t,n){if("object"==typeof t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]="a"===r?t[r]:j(t[r]));t=e}return l(t,n)},l.equals=function(t,n){return!(!t||!n)&&l(t).toRgbString()==l(n).toRgbString()},l.random=function(){return l.fromRatio({r:u(),g:u(),b:u()})},l.mix=function(t,n,e){e=0===e?0:e||50;var r=l(t).toRgb(),i=l(n).toRgb(),o=e/100;return l({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})}, // =4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},l.mostReadable=function(t,n,e){var r,i,o,a,s=null,u=0;i=(e=e||{}).includeFallbackColors,o=e.level,a=e.size;for(var c=0;cu&&(u=r,s=l(n[c]));return l.isReadable(t,s,{level:o,size:a})||!i?s:(e.includeFallbackColors=!1,l.mostReadable(t,["#fff","#000"],e))};var S=l.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=l.hexNames=function(t){var n={};for(var e in t)t.hasOwnProperty(e)&&(n[t[e]]=e);return n}(S);function E(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function N(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=a(e,s(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),n.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function P(t){return a(1,s(0,t))}function O(t){return parseInt(t,16)}function T(t){return 1==t.length?"0"+t:""+t}function j(t){return t<=1&&(t=100*t+"%"),t}function R(t){return n.round(255*parseFloat(t)).toString(16)}function D(t){return O(t)/255}var I,U,F,L=(U="[\\s|\\(]+("+(I="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",F="[\\s|\\(]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",{CSS_UNIT:new RegExp(I),rgb:new RegExp("rgb"+U),rgba:new RegExp("rgba"+F),hsl:new RegExp("hsl"+U),hsla:new RegExp("hsla"+F),hsv:new RegExp("hsv"+U),hsva:new RegExp("hsva"+F),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function q(t){return!!L.CSS_UNIT.exec(t)}t.exports?t.exports=l:window.tinycolor=l}(Math)}(ni);var ei=ni.exports;function ri(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function ii(t,n){for(var e=0;et.length)&&(n=t.length);for(var e=0,r=new Array(n);e0&&void 0!==arguments[0]?arguments[0]:6;ri(this,t),this.csBits=n,this.registry=["__reserved for background__"]}var n,e,r;return n=t,e=[{key:"register",value:function(t){if(this.registry.length>=Math.pow(2,24-this.csBits))return null;var n,e=this.registry.length,r=ui(e,this.csBits),i=(n=e+(r<<24-this.csBits),"#".concat(Math.min(n,Math.pow(2,24)).toString(16).padStart(6,"0")));return this.registry.push(t),i}},{key:"lookup",value:function(t){var n,e,r,i,o="string"==typeof t?(n=ei(t).toRgb(),e=n.r,r=n.g,i=n.b,si(e,r,i)):si.apply(void 0,oi(t));if(!o)return null;var a=o&Math.pow(2,24-this.csBits)-1,s=o>>24-this.csBits&Math.pow(2,this.csBits)-1;return ui(a,this.csBits)!==s||a>=this.registry.length?null:this.registry[a]}}],e&&ii(n.prototype,e),r&&ii(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function ci(t,n,e){var r,i=1;function o(){var o,a,s=r.length,u=0,l=0,c=0;for(o=0;o=(i=(h+f)/2))?h=i:f=i,r=l,!(l=l[s=+a]))return r[s]=c,t;if(n===(o=+t._x.call(null,l.data)))return c.next=l,r?r[s]=c:t._root=c,t;do{r=r?r[s]=new Array(2):t._root=new Array(2),(a=n>=(i=(h+f)/2))?h=i:f=i}while((s=+a)==(u=+(o>=i)));return r[u]=l,r[s]=c,t}function fi(t,n,e){this.node=t,this.x0=n,this.x1=e}function di(t){return t[0]}function pi(t,n){var e=new gi(null==n?di:n,NaN,NaN);return null==t?e:e.addAll(t)}function gi(t,n,e){this._x=t,this._x0=n,this._x1=e,this._root=void 0}function yi(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var vi=pi.prototype=gi.prototype;function _i(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,a,s,u,l,c,h,f,d=t._root,p={data:r},g=t._x0,y=t._y0,v=t._x1,_=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=n>=(o=(g+v)/2))?g=o:v=o,(c=e>=(a=(y+_)/2))?y=a:_=a,i=d,!(d=d[h=c<<1|l]))return i[h]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),n===s&&e===u)return p.next=d,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(l=n>=(o=(g+v)/2))?g=o:v=o,(c=e>=(a=(y+_)/2))?y=a:_=a}while((h=c<<1|l)==(f=(u>=a)<<1|s>=o));return i[f]=d,i[h]=p,t}function mi(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function xi(t){return t[0]}function bi(t){return t[1]}function wi(t,n,e){var r=new ki(null==n?xi:n,null==e?bi:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ki(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function zi(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}vi.copy=function(){var t,n,e=new gi(this._x,this._x0,this._x1),r=this._root;if(!r)return e;if(!r.length)return e._root=yi(r),e;for(t=[{source:r,target:e._root=new Array(2)}];r=t.pop();)for(var i=0;i<2;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(2)}):r.target[i]=yi(n));return e},vi.add=function(t){var n=+this._x.call(null,t);return hi(this.cover(n),n,t)},vi.addAll=function(t){var n,e,r=t.length,i=new Array(r),o=1/0,a=-1/0;for(n=0;na&&(a=e));if(o>a)return this;for(this.cover(o).cover(a),n=0;nt||t>=e;)switch(i=+(tu||(i=o.x1)=h))&&(o=l[l.length-1],l[l.length-1]=l[l.length-1-a],l[l.length-1-a]=o)}else{var f=Math.abs(t-+this._x.call(null,c.data));f=(a=(h+f)/2))?h=a:f=a,n=c,!(c=c[u=+s]))return this;if(!c.length)break;n[u+1&1]&&(e=n,l=u)}for(;c.data!==t;)if(r=c,!(c=c.next))return this;return(i=c.next)&&delete c.next,r?(i?r.next=i:delete r.next,this):n?(i?n[u]=i:delete n[u],(c=n[0]||n[1])&&c===(n[1]||n[0])&&!c.length&&(e?e[l]=c:this._root=c),this):(this._root=i,this)},vi.removeAll=function(t){for(var n=0,e=t.length;n=(a=(m+w)/2))?m=a:w=a,(d=e>=(s=(x+k)/2))?x=s:k=s,(p=r>=(u=(b+z)/2))?b=u:z=u,o=v,!(v=v[g=p<<2|d<<1|f]))return o[g]=_,t;if(l=+t._x.call(null,v.data),c=+t._y.call(null,v.data),h=+t._z.call(null,v.data),n===l&&e===c&&r===h)return _.next=v,o?o[g]=_:t._root=_,t;do{o=o?o[g]=new Array(8):t._root=new Array(8),(f=n>=(a=(m+w)/2))?m=a:w=a,(d=e>=(s=(x+k)/2))?x=s:k=s,(p=r>=(u=(b+z)/2))?b=u:z=u}while((g=p<<2|d<<1|f)==(y=(h>=u)<<2|(c>=s)<<1|l>=a));return o[y]=v,o[g]=_,t}function Si(t,n,e,r,i,o,a){this.node=t,this.x0=n,this.y0=e,this.z0=r,this.x1=i,this.y1=o,this.z1=a}function Ci(t){return t[0]}function Ei(t){return t[1]}function Ni(t){return t[2]}function Pi(t,n,e,r){var i=new Oi(null==n?Ci:n,null==e?Ei:e,null==r?Ni:r,NaN,NaN,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Oi(t,n,e,r,i,o,a,s,u){this._x=t,this._y=n,this._z=e,this._x0=r,this._y0=i,this._z0=o,this._x1=a,this._y1=s,this._z1=u,this._root=void 0}function Ti(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}Ai.copy=function(){var t,n,e=new ki(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=zi(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=zi(n));return e},Ai.add=function(t){const n=+this._x.call(null,t),e=+this._y.call(null,t);return _i(this.cover(n,e),n,e,t)},Ai.addAll=function(t){var n,e,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,h=-1/0;for(e=0;ec&&(c=r),ih&&(h=i));if(u>c||l>h)return this;for(this.cover(u,l).cover(c,h),e=0;et||t>=i||r>n||n>=o;)switch(s=(nf||(o=u.y0)>d||(a=u.x1)=v)<<1|t>=y)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var _=t-+this._x.call(null,g.data),m=n-+this._y.call(null,g.data),x=_*_+m*m;if(x=(s=(p+y)/2))?p=s:y=s,(c=a>=(u=(g+v)/2))?g=u:v=u,n=d,!(d=d[h=c<<1|l]))return this;if(!d.length)break;(n[h+1&3]||n[h+2&3]||n[h+3&3])&&(e=n,f=h)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[h]=i:delete n[h],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[f]=d:this._root=d),this):(this._root=i,this)},Ai.removeAll=function(t){for(var n=0,e=t.length;n1&&(v=f.y+f.vy-c.y-c.vy||Di(s)),i>2&&(_=f.z+f.vz-c.z-c.vz||Di(s)),y*=d=((d=Math.sqrt(y*y+v*v+_*_))-e[g])/d*r*n[g],v*=d,_*=d,f.vx-=y*(p=a[g]),i>1&&(f.vy-=v*p),i>2&&(f.vz-=_*p),c.vx+=y*(p=1-p),i>1&&(c.vy+=v*p),i>2&&(c.vz+=_*p)}function d(){if(r){var i,s,l=r.length,c=t.length,h=new Map(r.map(((t,n)=>[u(t,n,r),t])));for(i=0,o=new Array(l);i"function"==typeof t))||Math.random,i=n.find((t=>[1,2,3].includes(t)))||2,d()},f.links=function(n){return arguments.length?(t=n,d(),f):t},f.id=function(t){return arguments.length?(u=t,f):u},f.iterations=function(t){return arguments.length?(h=+t,f):h},f.strength=function(t){return arguments.length?(l="function"==typeof t?t:Ri(+t),p(),f):l},f.distance=function(t){return arguments.length?(c="function"==typeof t?t:Ri(+t),g(),f):c},f}ji.copy=function(){var t,n,e=new Oi(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),r=this._root;if(!r)return e;if(!r.length)return e._root=Ti(r),e;for(t=[{source:r,target:e._root=new Array(8)}];r=t.pop();)for(var i=0;i<8;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(8)}):r.target[i]=Ti(n));return e},ji.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t),r=+this._z.call(null,t);return Mi(this.cover(n,e,r),n,e,r,t)},ji.addAll=function(t){var n,e,r,i,o,a=t.length,s=new Array(a),u=new Array(a),l=new Array(a),c=1/0,h=1/0,f=1/0,d=-1/0,p=-1/0,g=-1/0;for(e=0;ed&&(d=r),ip&&(p=i),og&&(g=o));if(c>d||h>p||f>g)return this;for(this.cover(c,h,f).cover(d,p,g),e=0;et||t>=a||i>n||n>=s||o>e||e>=u;)switch(c=(ey||(a=h.y0)>v||(s=h.z0)>_||(u=h.x1)=k)<<2|(n>=w)<<1|t>=b)&&(h=m[m.length-1],m[m.length-1]=m[m.length-1-f],m[m.length-1-f]=h)}else{var z=t-+this._x.call(null,x.data),A=n-+this._y.call(null,x.data),M=e-+this._z.call(null,x.data),S=z*z+A*A+M*M;if(S=(u=(v+x)/2))?v=u:x=u,(f=a>=(l=(_+b)/2))?_=l:b=l,(d=s>=(c=(m+w)/2))?m=c:w=c,n=y,!(y=y[p=d<<2|f<<1|h]))return this;if(!y.length)break;(n[p+1&7]||n[p+2&7]||n[p+3&7]||n[p+4&7]||n[p+5&7]||n[p+6&7]||n[p+7&7])&&(e=n,g=p)}for(;y.data!==t;)if(r=y,!(y=y.next))return this;return(i=y.next)&&delete y.next,r?(i?r.next=i:delete r.next,this):n?(i?n[p]=i:delete n[p],(y=n[0]||n[1]||n[2]||n[3]||n[4]||n[5]||n[6]||n[7])&&y===(n[7]||n[6]||n[5]||n[4]||n[3]||n[2]||n[1]||n[0])&&!y.length&&(e?e[g]=y:this._root=y),this):(this._root=i,this)},ji.removeAll=function(t){for(var n=0,e=t.length;n(t=(1664525*t+1013904223)%Li)/Li}();function d(){p(),h.call("tick",e),i1&&(null==c.fy?c.y+=c.vy*=u:(c.y=c.fy,c.vy=0)),r>2&&(null==c.fz?c.z+=c.vz*=u:(c.z=c.fz,c.vz=0));return e}function g(){for(var n,e=0,i=t.length;e1&&isNaN(n.y)||r>2&&isNaN(n.z)){var o=10*(r>2?Math.cbrt(.5+e):r>1?Math.sqrt(.5+e):e),a=e*Hi,s=e*Vi;1===r?n.x=o:2===r?(n.x=o*Math.cos(a),n.y=o*Math.sin(a)):(n.x=o*Math.sin(a)*Math.cos(s),n.y=o*Math.cos(a),n.z=o*Math.sin(a)*Math.sin(s))}(isNaN(n.vx)||r>1&&isNaN(n.vy)||r>2&&isNaN(n.vz))&&(n.vx=0,r>1&&(n.vy=0),r>2&&(n.vz=0))}}function y(n){return n.initialize&&n.initialize(t,f,r),n}return null==t&&(t=[]),g(),e={tick:p,restart:function(){return c.restart(d),e},stop:function(){return c.stop(),e},numDimensions:function(t){return arguments.length?(r=Math.min(3,Math.max(1,Math.round(t))),l.forEach(y),e):r},nodes:function(n){return arguments.length?(t=n,g(),l.forEach(y),e):t},alpha:function(t){return arguments.length?(i=+t,e):i},alphaMin:function(t){return arguments.length?(o=+t,e):o},alphaDecay:function(t){return arguments.length?(a=+t,e):+a},alphaTarget:function(t){return arguments.length?(s=+t,e):s},velocityDecay:function(t){return arguments.length?(u=1-t,e):1-u},randomSource:function(t){return arguments.length?(f=t,l.forEach(y),e):f},force:function(t,n){return arguments.length>1?(null==n?l.delete(t):l.set(t,y(n)),e):l.get(t)},find:function(){var n,e,i,o,a,s,u=Array.prototype.slice.call(arguments),l=u.shift()||0,c=(r>1?u.shift():null)||0,h=(r>2?u.shift():null)||0,f=u.shift()||1/0,d=0,p=t.length;for(f*=f,d=0;d1?(h.on(t,n),e):h.on(t)}}}function Xi(){var t,n,e,r,i,o,a=Ri(-30),s=1,u=1/0,l=.81;function c(r){var o,a=t.length,s=(1===n?pi(t,qi):2===n?wi(t,qi,Bi):3===n?Pi(t,qi,Bi,$i):null).visitAfter(f);for(i=r,o=0;o1&&(t.y=a/c),n>2&&(t.z=s/c)}else{(e=t).x=e.data.x,n>1&&(e.y=e.data.y),n>2&&(e.z=e.data.z);do{l+=o[e.data.index]}while(e=e.next)}t.value=l}function d(t,a,c,h,f){if(!t.value)return!0;var d=[c,h,f][n-1],p=t.x-e.x,g=n>1?t.y-e.y:0,y=n>2?t.z-e.z:0,v=d-a,_=p*p+g*g+y*y;if(v*v/l<_)return _1&&0===g&&(_+=(g=Di(r))*g),n>2&&0===y&&(_+=(y=Di(r))*y),_1&&(e.vy+=g*t.value*i/_),n>2&&(e.vz+=y*t.value*i/_)),!0;if(!(t.length||_>=u)){(t.data!==e||t.next)&&(0===p&&(_+=(p=Di(r))*p),n>1&&0===g&&(_+=(g=Di(r))*g),n>2&&0===y&&(_+=(y=Di(r))*y),_1&&(e.vy+=g*v),n>2&&(e.vz+=y*v))}while(t=t.next)}}return c.initialize=function(e,...i){t=e,r=i.find((t=>"function"==typeof t))||Math.random,n=i.find((t=>[1,2,3].includes(t)))||2,h()},c.strength=function(t){return arguments.length?(a="function"==typeof t?t:Ri(+t),h(),c):a},c.distanceMin=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c.distanceMax=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c.theta=function(t){return arguments.length?(l=t*t,c):Math.sqrt(l)},c}const{abs:Yi,cos:Wi,sin:Zi,acos:Qi,atan2:Ki,sqrt:Ji,pow:to}=Math;function no(t){return t<0?-to(-t,1/3):to(t,1/3)}const eo=Math.PI,ro=2*eo,io=eo/2,oo=Number.MAX_SAFE_INTEGER||9007199254740991,ao=Number.MIN_SAFE_INTEGER||-9007199254740991,so={x:0,y:0,z:0},uo={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(t,n){const e=n(t);let r=e.x*e.x+e.y*e.y;return void 0!==e.z&&(r+=e.z*e.z),Ji(r)},compute:function(t,n,e){if(0===t)return n[0].t=0,n[0];const r=n.length-1;if(1===t)return n[r].t=1,n[r];const i=1-t;let o=n;if(0===r)return n[0].t=t,n[0];if(1===r){const n={x:i*o[0].x+t*o[1].x,y:i*o[0].y+t*o[1].y,t:t};return e&&(n.z=i*o[0].z+t*o[1].z),n}if(r<4){let n,a,s,u=i*i,l=t*t,c=0;2===r?(o=[o[0],o[1],o[2],so],n=u,a=i*t*2,s=l):3===r&&(n=u*i,a=u*t*3,s=i*l*3,c=t*l);const h={x:n*o[0].x+a*o[1].x+s*o[2].x+c*o[3].x,y:n*o[0].y+a*o[1].y+s*o[2].y+c*o[3].y,t:t};return e&&(h.z=n*o[0].z+a*o[1].z+s*o[2].z+c*o[3].z),h}const a=JSON.parse(JSON.stringify(n));for(;a.length>1;){for(let n=0;n1;i--,o--){const t=[];for(let e,i=0;io.x.min&&(n=o.x.min),e>o.y.min&&(e=o.y.min),r0&&(a.c1=n,a.c2=r,a.s1=t,a.s2=e,o.push(a))}))})),o},makeshape:function(t,n,e){const r=n.points.length,i=t.points.length,o=uo.makeline(n.points[r-1],t.points[0]),a=uo.makeline(t.points[i-1],n.points[0]),s={startcap:o,forward:t,back:n,endcap:a,bbox:uo.findbbox([o,t,n,a]),intersections:function(t){return uo.shapeintersections(s,s.bbox,t,t.bbox,e)}};return s},getminmax:function(t,n,e){if(!e)return{min:0,max:0};let r,i,o=oo,a=ao;-1===e.indexOf(0)&&(e=[0].concat(e)),-1===e.indexOf(1)&&e.push(1);for(let s=0,u=e.length;sa&&(a=i[n]);return{min:o,mid:(o+a)/2,max:a,size:a-o}},align:function(t,n){const e=n.p1.x,r=n.p1.y,i=-Ki(n.p2.y-r,n.p2.x-e);return t.map((function(t){return{x:(t.x-e)*Wi(i)-(t.y-r)*Zi(i),y:(t.x-e)*Zi(i)+(t.y-r)*Wi(i)}}))},roots:function(t,n){n=n||{p1:{x:0,y:0},p2:{x:1,y:0}};const e=t.length-1,r=uo.align(t,n),i=function(t){return 0<=t&&t<=1};if(2===e){const t=r[0].y,n=r[1].y,e=r[2].y,o=t-2*n+e;if(0!==o){const r=-Ji(n*n-t*e),a=-t+n;return[-(r+a)/o,-(-r+a)/o].filter(i)}return n!==e&&0===o?[(2*n-e)/(2*n-2*e)].filter(i):[]}const o=r[0].y,a=r[1].y,s=r[2].y;let u=3*a-o-3*s+r[3].y,l=3*o-6*a+3*s,c=-3*o+3*a,h=o;if(uo.approximately(u,0)){if(uo.approximately(l,0))return uo.approximately(c,0)?[]:[-h/c].filter(i);const t=Ji(c*c-4*l*h),n=2*l;return[(t-c)/n,(-c-t)/n].filter(i)}l/=u,c/=u,h/=u;const f=(3*c-l*l)/3,d=f/3,p=(2*l*l*l-9*l*c+27*h)/27,g=p/2,y=g*g+d*d*d;let v,_,m,x,b;if(y<0){const t=-f/3,n=Ji(t*t*t),e=-p/(2*n),r=Qi(e<-1?-1:e>1?1:e),o=2*no(n);return m=o*Wi(r/3)-l/3,x=o*Wi((r+ro)/3)-l/3,b=o*Wi((r+2*ro)/3)-l/3,[m,x,b].filter(i)}if(0===y)return v=g<0?no(-g):-no(g),m=2*v-l/3,x=-v-l/3,[m,x].filter(i);{const t=Ji(y);return v=no(-g+t),_=no(g+t),[v-_-l/3].filter(i)}},droots:function(t){if(3===t.length){const n=t[0],e=t[1],r=t[2],i=n-2*e+r;if(0!==i){const t=-Ji(e*e-n*r),o=-n+e;return[-(t+o)/i,-(-t+o)/i]}return e!==r&&0===i?[(2*e-r)/(2*(e-r))]:[]}if(2===t.length){const n=t[0],e=t[1];return n!==e?[n/(n-e)]:[]}return[]},curvature:function(t,n,e,r,i){let o,a,s,u,l=0,c=0;const h=uo.compute(t,n),f=uo.compute(t,e),d=h.x*h.x+h.y*h.y;if(r?(o=Ji(to(h.y*f.z-f.y*h.z,2)+to(h.z*f.x-f.z*h.x,2)+to(h.x*f.y-f.x*h.y,2)),a=to(d+h.z*h.z,1.5)):(o=h.x*f.y-h.y*f.x,a=to(d,1.5)),0===o||0===a)return{k:0,r:0};if(l=o/a,c=a/o,!i){const i=uo.curvature(t-.001,n,e,r,!0).k,o=uo.curvature(t+.001,n,e,r,!0).k;u=(o-l+(l-i))/2,s=(Yi(o-l)+Yi(l-i))/2}return{k:l,r:c,dk:u,adk:s}},inflections:function(t){if(t.length<4)return[];const n=uo.align(t,{p1:t[0],p2:t.slice(-1)[0]}),e=n[2].x*n[1].y,r=n[3].x*n[1].y,i=n[1].x*n[2].y,o=18*(-3*e+2*r+3*i-n[3].x*n[2].y),a=18*(3*e-r-3*i),s=18*(i-e);if(uo.approximately(o,0)){if(!uo.approximately(a,0)){let t=-s/a;if(0<=t&&t<=1)return[t]}return[]}const u=2*o;if(uo.approximately(u,0))return[];const l=a*a-4*o*s;if(l<0)return[];const c=Math.sqrt(l);return[(c-a)/u,-(a+c)/u].filter((function(t){return 0<=t&&t<=1}))},bboxoverlap:function(t,n){const e=["x","y"],r=e.length;for(let i,o,a,s,u=0;u=s)return!1;return!0},expandbox:function(t,n){n.x.mint.x.max&&(t.x.max=n.x.max),n.y.max>t.y.max&&(t.y.max=n.y.max),n.z&&n.z.max>t.z.max&&(t.z.max=n.z.max),t.x.mid=(t.x.min+t.x.max)/2,t.y.mid=(t.y.min+t.y.max)/2,t.z&&(t.z.mid=(t.z.min+t.z.max)/2),t.x.size=t.x.max-t.x.min,t.y.size=t.y.max-t.y.min,t.z&&(t.z.size=t.z.max-t.z.min)},pairiteration:function(t,n,e){const r=t.bbox(),i=n.bbox(),o=1e5,a=e||.5;if(r.x.size+r.y.sizek||k>z)&&(w+=ro),w>z&&(b=z,z=w,w=b)):z4){if(1!==arguments.length)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");r=!0}}else if(6!==i&&8!==i&&9!==i&&12!==i&&1!==arguments.length)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");const o=this._3d=!r&&(9===i||12===i)||t&&t[0]&&void 0!==t[0].z,a=this.points=[];for(let t=0,e=o?3:2;tt+co(n.y)),0)0}length(){return uo.length(this.derivative.bind(this))}static getABC(t=2,n,e,r,i=.5){const o=uo.projectionratio(i,t),a=1-o,s={x:o*n.x+a*r.x,y:o*n.y+a*r.y},u=uo.abcratio(i,t);return{A:{x:e.x+(e.x-s.x)/u,y:e.y+(e.y-s.y)/u},B:e,C:s,S:n,E:r}}getABC(t,n){n=n||this.get(t);let e=this.points[0],r=this.points[this.order];return mo.getABC(this.order,e,n,r,t)}getLUT(t){if(this.verify(),t=t||100,this._lut.length===t)return this._lut;this._lut=[],t++,this._lut=[];for(let n,e,r=0;r1?1:f,u=this.compute(f),u.t=f,u.d=c,u}get(t){return this.compute(t)}point(t){return this.points[t]}compute(t){return this.ratios?uo.computeWithRatios(t,this.points,this.ratios,this._3d):uo.compute(t,this.points,this._3d,this.ratios)}raise(){const t=this.points,n=[t[0]],e=t.length;for(let r,i,o=1;o1;){e=[];for(let o,a=0,s=n.length-1;a=0&&t<=1})),n=n.concat(t[e].sort(uo.numberSort))}.bind(this)),t.values=n.sort(uo.numberSort).filter((function(t,e){return n.indexOf(t)===e})),t}bbox(){const t=this.extrema(),n={};return this.dims.forEach(function(e){n[e]=uo.getminmax(this,e,t[e])}.bind(this)),n}overlaps(t){const n=this.bbox(),e=t.bbox();return uo.bboxoverlap(n,e)}offset(t,n){if(void 0!==n){const e=this.get(t),r=this.normal(t),i={c:e,n:r,x:e.x+r.x*n,y:e.y+r.y*n};return this._3d&&(i.z=e.z+r.z*n),i}if(this._linear){const n=this.normal(0),e=this.points.map((function(e){const r={x:e.x+t*n.x,y:e.y+t*n.y};return e.z&&n.z&&(r.z=e.z+t*n.z),r}));return[new mo(e)]}return this.reduce().map((function(n){return n._linear?n.offset(t)[0]:n.scale(t)}))}simple(){if(3===this.order){const t=uo.angle(this.points[0],this.points[3],this.points[1]),n=uo.angle(this.points[0],this.points[3],this.points[2]);if(t>0&&n<0||t<0&&n>0)return!1}const t=this.normal(0),n=this.normal(1);let e=t.x*n.x+t.y*n.y;return this._3d&&(e+=t.z*n.z),co(yo(e))<_o/3}reduce(){let t,n,e=0,r=0,i=.01,o=[],a=[],s=this.extrema().values;for(-1===s.indexOf(0)&&(s=[0].concat(s)),-1===s.indexOf(1)&&s.push(1),e=s[0],t=1;t(1-i/r)*n+i/r*e));return new mo(this.points.map(((n,e)=>({x:n.x+t.x*i[e],y:n.y+t.y*i[e]}))))}scale(t){const n=this.order;let e=!1;if("function"==typeof t&&(e=t),e&&2===n)return this.raise().scale(e);const r=this.clockwise,i=this.points;if(this._linear)return this.translate(this.normal(0),e?e(0):t,e?e(1):t);const o=e?e(0):t,a=e?e(1):t,s=[this.offset(0,10),this.offset(1,10)],u=[],l=uo.lli4(s[0],s[0].c,s[1],s[1].c);if(!l)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach((function(t){const e=u[t*n]=uo.copy(i[t*n]);e.x+=(t?a:o)*s[t].n.x,e.y+=(t?a:o)*s[t].n.y})),e?([0,1].forEach((function(o){if(2!==n||!o){var a=i[o+1],s={x:a.x-l.x,y:a.y-l.y},c=e?e((o+1)/n):t;e&&!r&&(c=-c);var h=vo(s.x*s.x+s.y*s.y);s.x/=h,s.y/=h,u[o+1]={x:a.x+c*s.x,y:a.y+c*s.y}}})),new mo(u)):([0,1].forEach((t=>{if(2===n&&t)return;const e=u[t*n],r=this.derivative(t),o={x:e.x+r.x,y:e.y+r.y};u[t+1]=uo.lli4(e,o,l,i[t+1])})),new mo(u))}outline(t,n,e,r){if(n=void 0===n?t:n,this._linear){const i=this.normal(0),o=this.points[0],a=this.points[this.points.length-1];let s,u,l;void 0===e&&(e=t,r=n),s={x:o.x+i.x*t,y:o.y+i.y*t},l={x:a.x+i.x*e,y:a.y+i.y*e},u={x:(s.x+l.x)/2,y:(s.y+l.y)/2};const c=[s,u,l];s={x:o.x-i.x*n,y:o.y-i.y*n},l={x:a.x-i.x*r,y:a.y-i.y*r},u={x:(s.x+l.x)/2,y:(s.y+l.y)/2};const h=[l,u,s],f=uo.makeline(h[2],c[0]),d=uo.makeline(c[2],h[0]),p=[f,new mo(c),d,new mo(h)];return new lo(p)}const i=this.reduce(),o=i.length,a=[];let s,u=[],l=0,c=this.length();const h=void 0!==e&&void 0!==r;function f(t,n,e,r,i){return function(o){const a=r/e,s=(r+i)/e,u=n-t;return uo.map(o,0,1,t+a*u,t+s*u)}}i.forEach((function(i){const o=i.length();h?(a.push(i.scale(f(t,e,c,l,o))),u.push(i.scale(f(-n,-r,c,l,o)))):(a.push(i.scale(t)),u.push(i.scale(-n))),l+=o})),u=u.map((function(t){return s=t.points,s[3]?t.points=[s[3],s[2],s[1],s[0]]:t.points=[s[2],s[1],s[0]],t})).reverse();const d=a[0].points[0],p=a[o-1].points[a[o-1].points.length-1],g=u[o-1].points[u[o-1].points.length-1],y=u[0].points[0],v=uo.makeline(g,d),_=uo.makeline(p,y),m=[v].concat(a).concat([_]).concat(u);return new lo(m)}outlineshapes(t,n,e){n=n||t;const r=this.outline(t,n).curves,i=[];for(let t=1,n=r.length;t1,o.endcap.virtual=t{var o=this.get(t);return uo.between(o.x,n,r)&&uo.between(o.y,e,i)}))}selfintersects(t){const n=this.reduce(),e=n.length-2,r=[];for(let i,o,a,s=0;s0&&(i=i.concat(n))})),i}arcs(t){return t=t||.5,this._iterate(t,[])}_error(t,n,e,r){const i=(r-e)/4,o=this.get(e+i),a=this.get(r-i),s=uo.dist(t,n),u=uo.dist(t,o),l=uo.dist(t,a);return co(u-s)+co(l-s)}_iterate(t,n){let e,r=0,i=1;do{e=0,i=1;let o,a,s,u,l,c=this.get(r),h=!1,f=!1,d=i,p=1;do{if(f=h,u=s,d=(r+i)/2,o=this.get(d),a=this.get(i),s=uo.getccenter(c,o,a),s.interval={start:r,end:i},h=this._error(s,c,r,i)<=t,l=f&&!h,l||(p=i),h){if(i>=1){if(s.interval.end=p=1,u=s,i>1){let t={x:s.x+s.r*po(s.e),y:s.y+s.r*go(s.e)};s.e+=uo.angle({x:s.x,y:s.y},t,this.get(1))}break}i+=(i-r)/2}else i=d}while(!l&&e++<100);if(e>=100)break;u=u||s,n.push(u),r=p}while(i<1);return n}}function xo(t,n){if(null==t)return{};var e,r,i=function(t,n){if(null==t)return{};var e,r,i={},o=Object.keys(t);for(r=0;r=0||(i[e]=t[e]);return i}(t,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(i[e]=t[e])}return i}function bo(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)return;var r,i,o=[],a=!0,s=!1;try{for(e=e.call(t);!(a=(r=e.next()).done)&&(o.push(r.value),!n||o.length!==n);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==e.return||e.return()}finally{if(s)throw i}}return o}(t,n)||ko(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 wo(t){return function(t){if(Array.isArray(t))return zo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ko(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 ko(t,n){if(t){if("string"==typeof t)return zo(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)?zo(t,n):void 0}}function zo(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);et.cooldownTicks||new Date-t.startTickTime>t.cooldownTime||t.d3AlphaMin>0&&t.forceLayout.alpha()0){var a=Math.atan2(r.y-e.y,r.x-e.x),s=i*n,u={x:(e.x+r.x)/2+s*Math.cos(a-Math.PI/2),y:(e.y+r.y)/2+s*Math.sin(a-Math.PI/2)};t.__controlPoints=[u.x,u.y]}else{var l=70*n;t.__controlPoints=[r.x,r.y-l,r.x+l,r.y]}}));var f=[],d=[],p=h;if(t.linkCanvasObject){var g=[],y=[];h.forEach((function(t){return({before:f,after:d,replace:g}[a(t)]||y).push(t)})),p=[].concat(l(f),d,y),f=f.concat(g)}s.save(),f.forEach((function(n){return t.linkCanvasObject(n,s,t.globalScale)})),s.restore();var v=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,s=t.keyAccessor;if(t.isProp){var u=o,l=u[s],c=xo(u,[s].map(Ao));a=l,o=c}else a=s(o,n);n+11&&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=bo(n,2),i=r[0],o=r[1];return t(o,[].concat(wo(e),[i]))}))}(o),n instanceof Array&&0===n.length&&1===a.length&&(a[0].keys=[])),a}(p,[e,r,i]);s.save(),Object.entries(v).forEach((function(n){var e=u(n,2),r=e[0],o=e[1],a=r&&"undefined"!==r?r:"rgba(0,0,0,0.15)";Object.entries(o).forEach((function(n){var e=u(n,2),r=e[0],o=e[1],h=(r||1)/t.globalScale+c;Object.entries(o).forEach((function(t){var n=u(t,2);n[0];var e=n[1],r=i(e[0]);s.beginPath(),e.forEach((function(t){var n=t.source,e=t.target;if(n&&e&&n.hasOwnProperty("x")&&e.hasOwnProperty("x")){s.moveTo(n.x,n.y);var r=t.__controlPoints;r?s[2===r.length?"quadraticCurveTo":"bezierCurveTo"].apply(s,l(r).concat([e.x,e.y])):s.lineTo(e.x,e.y)}})),s.strokeStyle=a,s.lineWidth=h,s.setLineDash(r||[]),s.stroke()}))}))})),s.restore(),s.save(),d.forEach((function(n){return t.linkCanvasObject(n,s,t.globalScale)})),s.restore()}(),!t.isShadow&&(n=ti(t.linkDirectionalArrowLength),e=ti(t.linkDirectionalArrowRelPos),r=ti(t.linkVisibility),i=ti(t.linkDirectionalArrowColor||t.linkColor),o=ti(t.nodeVal),(a=t.ctx).save(),t.graphData.links.filter(r).forEach((function(r){var u=n(r);if(u&&!(u<0)){var c=r.source,h=r.target;if(c&&h&&c.hasOwnProperty("x")&&h.hasOwnProperty("x")){var f=Math.sqrt(Math.max(0,o(c)||1))*t.nodeRelSize,d=Math.sqrt(Math.max(0,o(h)||1))*t.nodeRelSize,p=Math.min(1,Math.max(0,e(r))),g=i(r)||"rgba(0,0,0,0.28)",y=u/1.6/2,v=r.__controlPoints&&s(mo,[c.x,c.y].concat(l(r.__controlPoints),[h.x,h.y])),_=v?function(t){return v.get(t)}:function(t){return{x:c.x+(h.x-c.x)*t||0,y:c.y+(h.y-c.y)*t||0}},m=v?v.length():Math.sqrt(Math.pow(h.x-c.x,2)+Math.pow(h.y-c.y,2)),x=f+u+(m-f-d-u)*p,b=_(x/m),w=_((x-u)/m),k=_((x-.8*u)/m),z=Math.atan2(b.y-w.y,b.x-w.x)-Math.PI/2;a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(w.x+y*Math.cos(z),w.y+y*Math.sin(z)),a.lineTo(k.x,k.y),a.lineTo(w.x-y*Math.cos(z),w.y-y*Math.sin(z)),a.fillStyle=g,a.fill()}}})),a.restore()),!t.isShadow&&function(){var n=ti(t.linkDirectionalParticles),e=ti(t.linkDirectionalParticleSpeed),r=ti(t.linkDirectionalParticleWidth),i=ti(t.linkVisibility),o=ti(t.linkDirectionalParticleColor||t.linkColor),a=t.ctx;a.save(),t.graphData.links.filter(i).forEach((function(i){var u=n(i);if(i.hasOwnProperty("__photons")&&i.__photons.length){var c=i.source,h=i.target;if(c&&h&&c.hasOwnProperty("x")&&h.hasOwnProperty("x")){var f=e(i),d=i.__photons||[],p=Math.max(0,r(i)/2)/Math.sqrt(t.globalScale),g=o(i)||"rgba(0,0,0,0.28)";a.fillStyle=g;var y=i.__controlPoints?s(mo,[c.x,c.y].concat(l(i.__controlPoints),[h.x,h.y])):null,v=0,_=!1;d.forEach((function(t){var n=!!t.__singleHop;if(t.hasOwnProperty("__progressRatio")||(t.__progressRatio=n?0:v/u),!n&&v++,t.__progressRatio+=f,t.__progressRatio>=1){if(n)return void(_=!0);t.__progressRatio=t.__progressRatio%1}var e=t.__progressRatio,r=y?y.get(e):{x:c.x+(h.x-c.x)*e||0,y:c.y+(h.y-c.y)*e||0};a.beginPath(),a.arc(r.x,r.y,p,0,2*Math.PI,!1),a.fill()})),_&&(i.__photons=i.__photons.filter((function(t){return!t.__singleHop||t.__progressRatio<=1})))}}})),a.restore()}(),function(){var n=ti(t.nodeVisibility),e=ti(t.nodeVal),r=ti(t.nodeColor),i=ti(t.nodeCanvasObjectMode),o=t.ctx,a=t.isShadow/t.globalScale,s=t.graphData.nodes.filter(n);o.save(),s.forEach((function(n){var s=i(n);if(!t.nodeCanvasObject||"before"!==s&&"replace"!==s||(t.nodeCanvasObject(n,o,t.globalScale),"replace"!==s)){var u=Math.sqrt(Math.max(0,e(n)||1))*t.nodeRelSize+a;o.beginPath(),o.arc(n.x,n.y,u,0,2*Math.PI,!1),o.fillStyle=r(n)||"rgba(31, 120, 180, 0.92)",o.fill(),t.nodeCanvasObject&&"after"===s&&t.nodeCanvasObject(n,t.ctx,t.globalScale)}else o.restore()})),o.restore()}(),this},emitParticle:function(t,n){return n&&(!n.__photons&&(n.__photons=[]),n.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:Gi().force("link",Fi()).force("charge",Xi()).force("center",ci()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(t,n){n.ctx=t},update:function(t){if(t.engineRunning=!1,t.onUpdate(),null!==t.nodeAutoColorBy&&No(t.graphData.nodes,ti(t.nodeAutoColorBy),t.nodeColor),null!==t.linkAutoColorBy&&No(t.graphData.links,ti(t.linkAutoColorBy),t.linkColor),t.graphData.links.forEach((function(n){n.source=n[t.linkSource],n.target=n[t.linkTarget]})),!t.isShadow){var n=ti(t.linkDirectionalParticles);t.graphData.links.forEach((function(t){var e=Math.round(Math.abs(n(t)));e?t.__photons=l(Array(e)).map((function(){return{}})):delete t.__photons}))}t.forceLayout.stop().alpha(1).nodes(t.graphData.nodes);var e=t.forceLayout.force("link");e&&e.id((function(n){return n[t.nodeId]})).links(t.graphData.links);var o=t.dagMode&&function(t,n){var e=t.nodes,o=t.links,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=a.nodeFilter,c=void 0===s?function(){return!0}:s,h=a.onLoopError,f=void 0===h?function(t){throw"Invalid DAG structure! Found cycle in node path: ".concat(t.join(" -> "),".")}:h,d={};e.forEach((function(t){return d[n(t)]={data:t,out:[],depth:-1,skip:!c(t)}})),o.forEach((function(t){var e=t.source,i=t.target,o=l(e),a=l(i);if(!d.hasOwnProperty(o))throw"Missing source node with id: ".concat(o);if(!d.hasOwnProperty(a))throw"Missing target node with id: ".concat(a);var s=d[o],u=d[a];function l(t){return"object"===r(t)?n(t):t}s.out.push(u)}));var p=[];return g(Object.values(d)),Object.assign.apply(Object,[{}].concat(l(Object.entries(d).filter((function(t){return!u(t,2)[1].skip})).map((function(t){var n=u(t,2);return i({},n[0],n[1].depth)})))));function g(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=0,o=t.length;ia.depth&&(a.depth=r,g(a.out,[].concat(l(e),[a]),r+(a.skip?0:1)))}}}(t.graphData,(function(n){return n[t.nodeId]}),{nodeFilter:t.dagNodeFilter,onLoopError:t.onDagError||void 0}),a=Math.max.apply(Math,l(Object.values(o||[]))),s=t.dagLevelDistance||t.graphData.nodes.length/(a||1)*2*(-1!==["radialin","radialout"].indexOf(t.dagMode)?.7:1);if(t.dagMode){var c=function(n,e){return function(r){return n?(o[r[t.nodeId]]-a/2)*s*(e?-1:1):void 0}},h=c(-1!==["lr","rl"].indexOf(t.dagMode),"rl"===t.dagMode),f=c(-1!==["td","bu"].indexOf(t.dagMode),"bu"===t.dagMode);t.graphData.nodes.filter(t.dagNodeFilter).forEach((function(t){t.fx=h(t),t.fy=f(t)}))}t.forceLayout.force("dagRadial",-1!==["radialin","radialout"].indexOf(t.dagMode)?function(t,n,e,r){var i,o,a,s,u=Ri(.1);function l(t){for(var u=0,l=i.length;u1&&(c.vy+=f*g),o>2&&(c.vz+=d*g)}}function c(){if(i){var n,e=i.length;for(a=new Array(e),s=new Array(e),n=0;n[1,2,3].includes(t)))||2,c()},l.strength=function(t){return arguments.length?(u="function"==typeof t?t:Ri(+t),c(),l):u},l.radius=function(n){return arguments.length?(t="function"==typeof n?n:Ri(+n),c(),l):t},l.x=function(t){return arguments.length?(n=+t,l):n},l.y=function(t){return arguments.length?(e=+t,l):e},l.z=function(t){return arguments.length?(r=+t,l):r},l}((function(n){var e=o[n[t.nodeId]]||-1;return("radialin"===t.dagMode?a-e:e)*s})).strength((function(n){return t.dagNodeFilter(n)?1:0})):null);for(var d=0;d0&&t.forceLayout.alpha()1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length,i=new Array(r>3?r-3:0),o=3;o1&&void 0!==arguments[1]?arguments[1]:function(){return!0},e=ti(t.nodeVal),r=function(n){return Math.sqrt(Math.max(0,e(n)||1))*t.nodeRelSize},i=t.graphData.nodes.filter(n).map((function(t){return{x:t.x,y:t.y,r:r(t)}}));return i.length?{x:[fr(i,(function(t){return t.x-t.r})),hr(i,(function(t){return t.x+t.r}))],y:[fr(i,(function(t){return t.y-t.r})),hr(i,(function(t){return t.y+t.r}))]}:null},pauseAnimation:function(t){return t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),this},resumeAnimation:function(t){return t.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},Io),stateInit:function(){return{lastSetZoom:1,zoom:sr(),forceGraph:new Oo,shadowGraph:(new Oo).cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new li}},init:function(t,n){var r=this;t.innerHTML="";var i=document.createElement("div");i.classList.add("force-graph-container"),i.style.position="relative",t.appendChild(i),n.canvas=document.createElement("canvas"),n.backgroundColor&&(n.canvas.style.background=n.backgroundColor),i.appendChild(n.canvas),n.shadowCanvas=document.createElement("canvas");var o=n.canvas.getContext("2d"),a=n.shadowCanvas.getContext("2d"),s={x:-1e12,y:-1e12},u=function(){var t=null,e=window.devicePixelRatio,r=s.x>0&&s.y>0?a.getImageData(s.x*e,s.y*e,1,1):null;return r&&(t=n.colorTracker.lookup(r.data)),t};Mt(n.canvas).call(function(){var t,n,e,r,i=Bt,o=$t,a=Ht,s=Vt,u={},l=Et("start","drag","end"),c=0,h=0;function f(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",y).on("touchmove.drag",v,jt).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(a,s){if(!r&&i.call(this,a,s)){var u=m(this,o.call(this,a,s),a,s,"mouse");u&&(Mt(a.view).on("mousemove.drag",p,Rt).on("mouseup.drag",g,Rt),Ut(a.view),Dt(a),e=!1,t=a.clientX,n=a.clientY,u("start",a))}}function p(r){if(It(r),!e){var i=r.clientX-t,o=r.clientY-n;e=i*i+o*o>h}u.mouse("drag",r)}function g(t){Mt(t.view).on("mousemove.drag mouseup.drag",null),Ft(t.view,e),It(t),u.mouse("end",t)}function y(t,n){if(i.call(this,t,n)){var e,r,a=t.changedTouches,s=o.call(this,t,n),u=a.length;for(e=0;e0||n.isPointerPressed)&&("touch"!==e.pointerType||void 0===e.movementX||[e.movementX,e.movementY].some((function(t){return Math.abs(t)>1})))&&(n.isPointerDragging=!0);var r,o,a,u=(r=i.getBoundingClientRect(),o=window.pageXOffset||document.documentElement.scrollLeft,a=window.pageYOffset||document.documentElement.scrollTop,{top:r.top+a,left:r.left+o});s.x=e.pageX-u.left,s.y=e.pageY-u.top,l.style.top="".concat(s.y,"px"),l.style.left="".concat(s.x,"px"),l.style.transform="translate(-".concat(s.x/n.width*100,"%, ").concat(n.height-s.y<100?"calc(-100% - 8px)":"21px",")")}),{passive:!0})})),i.addEventListener("pointerup",(function(t){if(n.isPointerPressed=!1,n.isPointerDragging)n.isPointerDragging=!1;else{var e=[t,n.pointerDownEvent];requestAnimationFrame((function(){if(0===t.button)if(n.hoverObj){var r=n["on".concat(n.hoverObj.type,"Click")];r&&r.apply(void 0,[n.hoverObj.d].concat(e))}else n.onBackgroundClick&&n.onBackgroundClick.apply(n,e);if(2===t.button)if(n.hoverObj){var i=n["on".concat(n.hoverObj.type,"RightClick")];i&&i.apply(void 0,[n.hoverObj.d].concat(e))}else n.onBackgroundRightClick&&n.onBackgroundRightClick.apply(n,e)}))}}),{passive:!0}),i.addEventListener("contextmenu",(function(t){return!(n.onBackgroundRightClick||n.onNodeRightClick||n.onLinkRightClick)||(t.preventDefault(),!1)})),n.forceGraph(o),n.shadowGraph(a);var c=Nr((function(){Lo(a,n.width,n.height),n.shadowGraph.linkWidth((function(t){return ti(n.linkWidth)(t)+n.linkHoverPrecision}));var t=Ke(n.canvas);n.shadowGraph.globalScale(t.k).tickFrame()}),800);n.flushShadowCanvas=c.flush,(this._animationCycle=function t(){var e=!n.autoPauseRedraw||!!n.needsRedraw||n.forceGraph.isEngineRunning()||n.graphData.links.some((function(t){return t.__photons&&t.__photons.length}));if(n.needsRedraw=!1,n.enablePointerInteraction){var r=n.isPointerDragging?null:u();if(r!==n.hoverObj){var i=n.hoverObj,a=i?i.type:null,s=r?r.type:null;if(a&&a!==s){var h=n["on".concat(a,"Hover")];h&&h(null,i.d)}if(s){var f=n["on".concat(s,"Hover")];f&&f(r.d,a===s?i.d:null)}var d=r&&ti(n["".concat(r.type.toLowerCase(),"Label")])(r.d)||"";l.style.visibility=d?"visible":"hidden",l.innerHTML=d,n.canvas.classList[r&&n["on".concat(s,"Click")]||!r&&n.onBackgroundClick?"add":"remove"]("clickable"),n.hoverObj=r}e&&c()}if(e){Lo(o,n.width,n.height);var p=Ke(n.canvas).k;n.onRenderFramePre&&n.onRenderFramePre(o,p),n.forceGraph.globalScale(p).tickFrame(),n.onRenderFramePost&&n.onRenderFramePost(o,p)}Vr.update(),n.animationFrameRequestId=requestAnimationFrame(t)})()},update:function(t){}});return qo}));