45 lines
200 KiB
JavaScript
45 lines
200 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-force-graph-3d-MeqEw_23.js","assets/index-fLiDJSpq.js","assets/index-zla_6Pw1.css"])))=>i.map(i=>d[i]);
|
||
import{a as e,c as n,d as r,f as i,i as a,l as o,n as s,o as c,r as l,s as u,t as d,u as f}from"./index-fLiDJSpq.js";var p=i(f(),1);function m(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function h(e,n,r){return n=E(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function g(e,n){return y(e)||m(e,n)||x(e,n)||w()}function _(e){return v(e)||b(e)||x(e)||C()}function v(e){if(Array.isArray(e))return S(e)}function y(e){if(Array.isArray(e))return e}function b(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function x(e,n){if(e){if(typeof e==`string`)return S(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Array.from(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return S(e,n)}}function S(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function C(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T(e,n){if(typeof e!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(typeof i!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function E(e){var n=T(e,`string`);return typeof n==`symbol`?n:String(n)}var D=function(e,n){var r=new Set(n);return Object.assign.apply(Object,[{}].concat(_(Object.entries(e).filter(function(e){var n=g(e,1)[0];return!r.has(n)}).map(function(e){var n=g(e,2),r=n[0],i=n[1];return h({},r,i)}))))};function ee(e,{wrapperElementType:n=`div`,nodeMapper:r=e=>e,methodNames:i=[],initPropNames:a=[]}={}){return(0,p.forwardRef)((o,s)=>{let c=(0,p.useRef)(),l=(0,p.useMemo)(()=>e(Object.fromEntries(a.filter(e=>o.hasOwnProperty(e)).map(e=>[e,o[e]]))),[]);O(()=>{l(r(c.current))},p.useLayoutEffect),O(()=>l._destructor instanceof Function?l._destructor:void 0);let u=(0,p.useCallback)((e,...n)=>l[e]instanceof Function?l[e](...n):void 0,[l]),d=(0,p.useRef)({});return Object.keys(D(o,[...i,...a])).filter(e=>d.current[e]!==o[e]).forEach(e=>u(e,o[e])),d.current=o,(0,p.useImperativeHandle)(s,()=>Object.fromEntries(i.map(e=>[e,(...n)=>u(e,...n)])),[u]),p.createElement(n,{ref:c})})}function O(e,n=p.useEffect){let r=(0,p.useRef)(),i=(0,p.useRef)(!1),a=(0,p.useRef)(!1),[o,s]=(0,p.useState)(0);i.current&&(a.current=!0),n(()=>(i.current||=(r.current=e(),!0),s(e=>e+1),()=>{a.current&&=(r.current&&r.current(),r.current=void 0,i.current=!1,!1)}),[])}function te(e,n,r){var i,a=1;e??=0,n??=0,r??=0;function o(){var o,s=i.length,c,l=0,u=0,d=0;for(o=0;o<s;++o)c=i[o],l+=c.x||0,u+=c.y||0,d+=c.z||0;for(l=(l/s-e)*a,u=(u/s-n)*a,d=(d/s-r)*a,o=0;o<s;++o)c=i[o],l&&(c.x-=l),u&&(c.y-=u),d&&(c.z-=d)}return o.initialize=function(e){i=e},o.x=function(n){return arguments.length?(e=+n,o):e},o.y=function(e){return arguments.length?(n=+e,o):n},o.z=function(e){return arguments.length?(r=+e,o):r},o.strength=function(e){return arguments.length?(a=+e,o):a},o}function ne(e){let n=+this._x.call(null,e);return re(this.cover(n),n,e)}function re(e,n,r){if(isNaN(n))return e;var i,a=e._root,o={data:r},s=e._x0,c=e._x1,l,u,d,f,p;if(!a)return e._root=o,e;for(;a.length;)if((d=n>=(l=(s+c)/2))?s=l:c=l,i=a,!(a=a[f=+d]))return i[f]=o,e;if(u=+e._x.call(null,a.data),n===u)return o.next=a,i?i[f]=o:e._root=o,e;do i=i?i[f]=[,,]:e._root=[,,],(d=n>=(l=(s+c)/2))?s=l:c=l;while((f=+d)==(p=+(u>=l)));return i[p]=a,i[f]=o,e}function ie(e){Array.isArray(e)||(e=Array.from(e));let n=e.length,r=new Float64Array(n),i=1/0,a=-1/0;for(let o=0,s;o<n;++o)isNaN(s=+this._x.call(null,e[o]))||(r[o]=s,s<i&&(i=s),s>a&&(a=s));if(i>a)return this;this.cover(i).cover(a);for(let i=0;i<n;++i)re(this,r[i],e[i]);return this}function ae(e){if(isNaN(e=+e))return this;var n=this._x0,r=this._x1;if(isNaN(n))r=(n=Math.floor(e))+1;else{for(var i=r-n||1,a=this._root,o,s;n>e||e>=r;)switch(s=+(e<n),o=[,,],o[s]=a,a=o,i*=2,s){case 0:r=n+i;break;case 1:n=r-i}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._x1=r,this}function oe(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function se(e){return arguments.length?this.cover(+e[0][0]).cover(+e[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function k(e,n,r){this.node=e,this.x0=n,this.x1=r}function ce(e,n){var r,i=this._x0,a,o,s=this._x1,c=[],l=this._root,u,d;for(l&&c.push(new k(l,i,s)),n==null?n=1/0:(i=e-n,s=e+n);u=c.pop();)if(!(!(l=u.node)||(a=u.x0)>s||(o=u.x1)<i)){if(l.length){var f=(a+o)/2;c.push(new k(l[1],f,o),new k(l[0],a,f)),(d=+(e>=f))&&(u=c[c.length-1],c[c.length-1]=c[c.length-1-d],c[c.length-1-d]=u)}else{var p=Math.abs(e-+this._x.call(null,l.data));p<n&&(n=p,i=e-p,s=e+p,r=l.data)}}return r}function le(e){if(isNaN(l=+this._x.call(null,e)))return this;var n,r=this._root,i,a,o,s=this._x0,c=this._x1,l,u,d,f,p;if(!r)return this;if(r.length)for(;;){if((d=l>=(u=(s+c)/2))?s=u:c=u,n=r,!(r=r[f=+d]))return this;if(!r.length)break;n[f+1&1]&&(i=n,p=f)}for(;r.data!==e;)if(a=r,!(r=r.next))return this;return(o=r.next)&&delete r.next,a?(o?a.next=o:delete a.next,this):n?(o?n[f]=o:delete n[f],(r=n[0]||n[1])&&r===(n[1]||n[0])&&!r.length&&(i?i[p]=r:this._root=r),this):(this._root=o,this)}function ue(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function de(){return this._root}function fe(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function pe(e){var n=[],r,i=this._root,a,o,s;for(i&&n.push(new k(i,this._x0,this._x1));r=n.pop();)if(!e(i=r.node,o=r.x0,s=r.x1)&&i.length){var c=(o+s)/2;(a=i[1])&&n.push(new k(a,c,s)),(a=i[0])&&n.push(new k(a,o,c))}return this}function me(e){var n=[],r=[],i;for(this._root&&n.push(new k(this._root,this._x0,this._x1));i=n.pop();){var a=i.node;if(a.length){var o,s=i.x0,c=i.x1,l=(s+c)/2;(o=a[0])&&n.push(new k(o,s,l)),(o=a[1])&&n.push(new k(o,l,c))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.x1);return this}function he(e){return e[0]}function ge(e){return arguments.length?(this._x=e,this):this._x}function _e(e,n){var r=new ve(n??he,NaN,NaN);return e==null?r:r.addAll(e)}function ve(e,n,r){this._x=e,this._x0=n,this._x1=r,this._root=void 0}function ye(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var A=_e.prototype=ve.prototype;A.copy=function(){var e=new ve(this._x,this._x0,this._x1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=ye(n),e;for(r=[{source:n,target:e._root=[,,]}];n=r.pop();)for(var a=0;a<2;++a)(i=n.source[a])&&(i.length?r.push({source:i,target:n.target[a]=[,,]}):n.target[a]=ye(i));return e},A.add=ne,A.addAll=ie,A.cover=ae,A.data=oe,A.extent=se,A.find=ce,A.remove=le,A.removeAll=ue,A.root=de,A.size=fe,A.visit=pe,A.visitAfter=me,A.x=ge;function be(e){let n=+this._x.call(null,e),r=+this._y.call(null,e);return xe(this.cover(n,r),n,r,e)}function xe(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var a,o=e._root,s={data:i},c=e._x0,l=e._y0,u=e._x1,d=e._y1,f,p,m,h,g,_,v,y;if(!o)return e._root=s,e;for(;o.length;)if((g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p,a=o,!(o=o[v=_<<1|g]))return a[v]=s,e;if(m=+e._x.call(null,o.data),h=+e._y.call(null,o.data),n===m&&r===h)return s.next=o,a?a[v]=s:e._root=s,e;do a=a?a[v]=[,,,,]:e._root=[,,,,],(g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p;while((v=_<<1|g)==(y=(h>=p)<<1|m>=f));return a[y]=o,a[v]=s,e}function Se(e){var n,r,i=e.length,a,o,s=Array(i),c=Array(i),l=1/0,u=1/0,d=-1/0,f=-1/0;for(r=0;r<i;++r)isNaN(a=+this._x.call(null,n=e[r]))||isNaN(o=+this._y.call(null,n))||(s[r]=a,c[r]=o,a<l&&(l=a),a>d&&(d=a),o<u&&(u=o),o>f&&(f=o));if(l>d||u>f)return this;for(this.cover(l,u).cover(d,f),r=0;r<i;++r)xe(this,s[r],c[r],e[r]);return this}function Ce(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,a=this._x1,o=this._y1;if(isNaN(r))a=(r=Math.floor(e))+1,o=(i=Math.floor(n))+1;else{for(var s=a-r||1,c=this._root,l,u;r>e||e>=a||i>n||n>=o;)switch(u=(n<i)<<1|e<r,l=[,,,,],l[u]=c,c=l,s*=2,u){case 0:a=r+s,o=i+s;break;case 1:r=a-s,o=i+s;break;case 2:a=r+s,i=o-s;break;case 3:r=a-s,i=o-s}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=i,this._x1=a,this._y1=o,this}function we(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Te(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function j(e,n,r,i,a){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=a}function Ee(e,n,r){var i,a=this._x0,o=this._y0,s,c,l,u,d=this._x1,f=this._y1,p=[],m=this._root,h,g;for(m&&p.push(new j(m,a,o,d,f)),r==null?r=1/0:(a=e-r,o=n-r,d=e+r,f=n+r,r*=r);h=p.pop();)if(!(!(m=h.node)||(s=h.x0)>d||(c=h.y0)>f||(l=h.x1)<a||(u=h.y1)<o)){if(m.length){var _=(s+l)/2,v=(c+u)/2;p.push(new j(m[3],_,v,l,u),new j(m[2],s,v,_,u),new j(m[1],_,c,l,v),new j(m[0],s,c,_,v)),(g=(n>=v)<<1|e>=_)&&(h=p[p.length-1],p[p.length-1]=p[p.length-1-g],p[p.length-1-g]=h)}else{var y=e-+this._x.call(null,m.data),b=n-+this._y.call(null,m.data),x=y*y+b*b;if(x<r){var S=Math.sqrt(r=x);a=e-S,o=n-S,d=e+S,f=n+S,i=m.data}}}return i}function De(e){if(isNaN(d=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var n,r=this._root,i,a,o,s=this._x0,c=this._y0,l=this._x1,u=this._y1,d,f,p,m,h,g,_,v;if(!r)return this;if(r.length)for(;;){if((h=d>=(p=(s+l)/2))?s=p:l=p,(g=f>=(m=(c+u)/2))?c=m:u=m,n=r,!(r=r[_=g<<1|h]))return this;if(!r.length)break;(n[_+1&3]||n[_+2&3]||n[_+3&3])&&(i=n,v=_)}for(;r.data!==e;)if(a=r,!(r=r.next))return this;return(o=r.next)&&delete r.next,a?(o?a.next=o:delete a.next,this):n?(o?n[_]=o:delete n[_],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[v]=r:this._root=r),this):(this._root=o,this)}function Oe(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function ke(){return this._root}function Ae(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function je(e){var n=[],r,i=this._root,a,o,s,c,l;for(i&&n.push(new j(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,o=r.x0,s=r.y0,c=r.x1,l=r.y1)&&i.length){var u=(o+c)/2,d=(s+l)/2;(a=i[3])&&n.push(new j(a,u,d,c,l)),(a=i[2])&&n.push(new j(a,o,d,u,l)),(a=i[1])&&n.push(new j(a,u,s,c,d)),(a=i[0])&&n.push(new j(a,o,s,u,d))}return this}function Me(e){var n=[],r=[],i;for(this._root&&n.push(new j(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var a=i.node;if(a.length){var o,s=i.x0,c=i.y0,l=i.x1,u=i.y1,d=(s+l)/2,f=(c+u)/2;(o=a[0])&&n.push(new j(o,s,c,d,f)),(o=a[1])&&n.push(new j(o,d,c,l,f)),(o=a[2])&&n.push(new j(o,s,f,d,u)),(o=a[3])&&n.push(new j(o,d,f,l,u))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function Ne(e){return e[0]}function Pe(e){return arguments.length?(this._x=e,this):this._x}function Fe(e){return e[1]}function Ie(e){return arguments.length?(this._y=e,this):this._y}function Le(e,n,r){var i=new Re(n??Ne,r??Fe,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Re(e,n,r,i,a,o){this._x=e,this._y=n,this._x0=r,this._y0=i,this._x1=a,this._y1=o,this._root=void 0}function ze(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var M=Le.prototype=Re.prototype;M.copy=function(){var e=new Re(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=ze(n),e;for(r=[{source:n,target:e._root=[,,,,]}];n=r.pop();)for(var a=0;a<4;++a)(i=n.source[a])&&(i.length?r.push({source:i,target:n.target[a]=[,,,,]}):n.target[a]=ze(i));return e},M.add=be,M.addAll=Se,M.cover=Ce,M.data=we,M.extent=Te,M.find=Ee,M.remove=De,M.removeAll=Oe,M.root=ke,M.size=Ae,M.visit=je,M.visitAfter=Me,M.x=Pe,M.y=Ie;function Be(e){let n=+this._x.call(null,e),r=+this._y.call(null,e),i=+this._z.call(null,e);return Ve(this.cover(n,r,i),n,r,i,e)}function Ve(e,n,r,i,a){if(isNaN(n)||isNaN(r)||isNaN(i))return e;var o,s=e._root,c={data:a},l=e._x0,u=e._y0,d=e._z0,f=e._x1,p=e._y1,m=e._z1,h,g,_,v,y,b,x,S,C,w,T;if(!s)return e._root=c,e;for(;s.length;)if((x=n>=(h=(l+f)/2))?l=h:f=h,(S=r>=(g=(u+p)/2))?u=g:p=g,(C=i>=(_=(d+m)/2))?d=_:m=_,o=s,!(s=s[w=C<<2|S<<1|x]))return o[w]=c,e;if(v=+e._x.call(null,s.data),y=+e._y.call(null,s.data),b=+e._z.call(null,s.data),n===v&&r===y&&i===b)return c.next=s,o?o[w]=c:e._root=c,e;do o=o?o[w]=Array(8):e._root=Array(8),(x=n>=(h=(l+f)/2))?l=h:f=h,(S=r>=(g=(u+p)/2))?u=g:p=g,(C=i>=(_=(d+m)/2))?d=_:m=_;while((w=C<<2|S<<1|x)==(T=(b>=_)<<2|(y>=g)<<1|v>=h));return o[T]=s,o[w]=c,e}function He(e){Array.isArray(e)||(e=Array.from(e));let n=e.length,r=new Float64Array(n),i=new Float64Array(n),a=new Float64Array(n),o=1/0,s=1/0,c=1/0,l=-1/0,u=-1/0,d=-1/0;for(let f=0,p,m,h,g;f<n;++f)isNaN(m=+this._x.call(null,p=e[f]))||isNaN(h=+this._y.call(null,p))||isNaN(g=+this._z.call(null,p))||(r[f]=m,i[f]=h,a[f]=g,m<o&&(o=m),m>l&&(l=m),h<s&&(s=h),h>u&&(u=h),g<c&&(c=g),g>d&&(d=g));if(o>l||s>u||c>d)return this;this.cover(o,s,c).cover(l,u,d);for(let o=0;o<n;++o)Ve(this,r[o],i[o],a[o],e[o]);return this}function Ue(e,n,r){if(isNaN(e=+e)||isNaN(n=+n)||isNaN(r=+r))return this;var i=this._x0,a=this._y0,o=this._z0,s=this._x1,c=this._y1,l=this._z1;if(isNaN(i))s=(i=Math.floor(e))+1,c=(a=Math.floor(n))+1,l=(o=Math.floor(r))+1;else{for(var u=s-i||1,d=this._root,f,p;i>e||e>=s||a>n||n>=c||o>r||r>=l;)switch(p=(r<o)<<2|(n<a)<<1|e<i,f=Array(8),f[p]=d,d=f,u*=2,p){case 0:s=i+u,c=a+u,l=o+u;break;case 1:i=s-u,c=a+u,l=o+u;break;case 2:s=i+u,a=c-u,l=o+u;break;case 3:i=s-u,a=c-u,l=o+u;break;case 4:s=i+u,c=a+u,o=l-u;break;case 5:i=s-u,c=a+u,o=l-u;break;case 6:s=i+u,a=c-u,o=l-u;break;case 7:i=s-u,a=c-u,o=l-u}this._root&&this._root.length&&(this._root=d)}return this._x0=i,this._y0=a,this._z0=o,this._x1=s,this._y1=c,this._z1=l,this}function We(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Ge(e){return arguments.length?this.cover(+e[0][0],+e[0][1],+e[0][2]).cover(+e[1][0],+e[1][1],+e[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function N(e,n,r,i,a,o,s){this.node=e,this.x0=n,this.y0=r,this.z0=i,this.x1=a,this.y1=o,this.z1=s}function Ke(e,n,r,i){var a,o=this._x0,s=this._y0,c=this._z0,l,u,d,f,p,m,h=this._x1,g=this._y1,_=this._z1,v=[],y=this._root,b,x;for(y&&v.push(new N(y,o,s,c,h,g,_)),i==null?i=1/0:(o=e-i,s=n-i,c=r-i,h=e+i,g=n+i,_=r+i,i*=i);b=v.pop();)if(!(!(y=b.node)||(l=b.x0)>h||(u=b.y0)>g||(d=b.z0)>_||(f=b.x1)<o||(p=b.y1)<s||(m=b.z1)<c)){if(y.length){var S=(l+f)/2,C=(u+p)/2,w=(d+m)/2;v.push(new N(y[7],S,C,w,f,p,m),new N(y[6],l,C,w,S,p,m),new N(y[5],S,u,w,f,C,m),new N(y[4],l,u,w,S,C,m),new N(y[3],S,C,d,f,p,w),new N(y[2],l,C,d,S,p,w),new N(y[1],S,u,d,f,C,w),new N(y[0],l,u,d,S,C,w)),(x=(r>=w)<<2|(n>=C)<<1|e>=S)&&(b=v[v.length-1],v[v.length-1]=v[v.length-1-x],v[v.length-1-x]=b)}else{var T=e-+this._x.call(null,y.data),E=n-+this._y.call(null,y.data),D=r-+this._z.call(null,y.data),ee=T*T+E*E+D*D;if(ee<i){var O=Math.sqrt(i=ee);o=e-O,s=n-O,c=r-O,h=e+O,g=n+O,_=r+O,a=y.data}}}return a}var qe=(e,n,r,i,a,o)=>Math.sqrt((e-i)**2+(n-a)**2+(r-o)**2);function Je(e,n,r,i){let a=[],o=e-i,s=n-i,c=r-i,l=e+i,u=n+i,d=r+i;return this.visit((f,p,m,h,g,_,v)=>{if(!f.length)do{let o=f.data;qe(e,n,r,this._x(o),this._y(o),this._z(o))<=i&&a.push(o)}while(f=f.next);return p>l||m>u||h>d||g<o||_<s||v<c}),a}function Ye(e){if(isNaN(p=+this._x.call(null,e))||isNaN(m=+this._y.call(null,e))||isNaN(h=+this._z.call(null,e)))return this;var n,r=this._root,i,a,o,s=this._x0,c=this._y0,l=this._z0,u=this._x1,d=this._y1,f=this._z1,p,m,h,g,_,v,y,b,x,S,C;if(!r)return this;if(r.length)for(;;){if((y=p>=(g=(s+u)/2))?s=g:u=g,(b=m>=(_=(c+d)/2))?c=_:d=_,(x=h>=(v=(l+f)/2))?l=v:f=v,n=r,!(r=r[S=x<<2|b<<1|y]))return this;if(!r.length)break;(n[S+1&7]||n[S+2&7]||n[S+3&7]||n[S+4&7]||n[S+5&7]||n[S+6&7]||n[S+7&7])&&(i=n,C=S)}for(;r.data!==e;)if(a=r,!(r=r.next))return this;return(o=r.next)&&delete r.next,a?(o?a.next=o:delete a.next,this):n?(o?n[S]=o:delete n[S],(r=n[0]||n[1]||n[2]||n[3]||n[4]||n[5]||n[6]||n[7])&&r===(n[7]||n[6]||n[5]||n[4]||n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[C]=r:this._root=r),this):(this._root=o,this)}function Xe(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function Ze(){return this._root}function Qe(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function $e(e){var n=[],r,i=this._root,a,o,s,c,l,u,d;for(i&&n.push(new N(i,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));r=n.pop();)if(!e(i=r.node,o=r.x0,s=r.y0,c=r.z0,l=r.x1,u=r.y1,d=r.z1)&&i.length){var f=(o+l)/2,p=(s+u)/2,m=(c+d)/2;(a=i[7])&&n.push(new N(a,f,p,m,l,u,d)),(a=i[6])&&n.push(new N(a,o,p,m,f,u,d)),(a=i[5])&&n.push(new N(a,f,s,m,l,p,d)),(a=i[4])&&n.push(new N(a,o,s,m,f,p,d)),(a=i[3])&&n.push(new N(a,f,p,c,l,u,m)),(a=i[2])&&n.push(new N(a,o,p,c,f,u,m)),(a=i[1])&&n.push(new N(a,f,s,c,l,p,m)),(a=i[0])&&n.push(new N(a,o,s,c,f,p,m))}return this}function et(e){var n=[],r=[],i;for(this._root&&n.push(new N(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));i=n.pop();){var a=i.node;if(a.length){var o,s=i.x0,c=i.y0,l=i.z0,u=i.x1,d=i.y1,f=i.z1,p=(s+u)/2,m=(c+d)/2,h=(l+f)/2;(o=a[0])&&n.push(new N(o,s,c,l,p,m,h)),(o=a[1])&&n.push(new N(o,p,c,l,u,m,h)),(o=a[2])&&n.push(new N(o,s,m,l,p,d,h)),(o=a[3])&&n.push(new N(o,p,m,l,u,d,h)),(o=a[4])&&n.push(new N(o,s,c,h,p,m,f)),(o=a[5])&&n.push(new N(o,p,c,h,u,m,f)),(o=a[6])&&n.push(new N(o,s,m,h,p,d,f)),(o=a[7])&&n.push(new N(o,p,m,h,u,d,f))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.z0,i.x1,i.y1,i.z1);return this}function tt(e){return e[0]}function nt(e){return arguments.length?(this._x=e,this):this._x}function rt(e){return e[1]}function it(e){return arguments.length?(this._y=e,this):this._y}function at(e){return e[2]}function ot(e){return arguments.length?(this._z=e,this):this._z}function st(e,n,r,i){var a=new ct(n??tt,r??rt,i??at,NaN,NaN,NaN,NaN,NaN,NaN);return e==null?a:a.addAll(e)}function ct(e,n,r,i,a,o,s,c,l){this._x=e,this._y=n,this._z=r,this._x0=i,this._y0=a,this._z0=o,this._x1=s,this._y1=c,this._z1=l,this._root=void 0}function lt(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var P=st.prototype=ct.prototype;P.copy=function(){var e=new ct(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=lt(n),e;for(r=[{source:n,target:e._root=Array(8)}];n=r.pop();)for(var a=0;a<8;++a)(i=n.source[a])&&(i.length?r.push({source:i,target:n.target[a]=Array(8)}):n.target[a]=lt(i));return e},P.add=Be,P.addAll=He,P.cover=Ue,P.data=We,P.extent=Ge,P.find=Ke,P.findAllWithinRadius=Je,P.remove=Ye,P.removeAll=Xe,P.root=Ze,P.size=Qe,P.visit=$e,P.visitAfter=et,P.x=nt,P.y=it,P.z=ot;function ut(e){return function(){return e}}function dt(e){return(e()-.5)*1e-6}function ft(e){return e.index}function pt(e,n){var r=e.get(n);if(!r)throw Error(`node not found: `+n);return r}function mt(e){var n=ft,r=p,i,a=ut(30),o,s,c,l,u,d,f=1;e??=[];function p(e){return 1/Math.min(l[e.source.index],l[e.target.index])}function m(n){for(var r=0,a=e.length;r<f;++r)for(var s=0,l,p,m,h=0,g=0,_=0,v,y;s<a;++s)l=e[s],p=l.source,m=l.target,h=m.x+m.vx-p.x-p.vx||dt(d),c>1&&(g=m.y+m.vy-p.y-p.vy||dt(d)),c>2&&(_=m.z+m.vz-p.z-p.vz||dt(d)),v=Math.sqrt(h*h+g*g+_*_),v=(v-o[s])/v*n*i[s],h*=v,g*=v,_*=v,m.vx-=h*(y=u[s]),c>1&&(m.vy-=g*y),c>2&&(m.vz-=_*y),p.vx+=h*(y=1-y),c>1&&(p.vy+=g*y),c>2&&(p.vz+=_*y)}function h(){if(s){var r,a=s.length,c=e.length,d=new Map(s.map((e,r)=>[n(e,r,s),e])),f;for(r=0,l=Array(a);r<c;++r)f=e[r],f.index=r,typeof f.source!=`object`&&(f.source=pt(d,f.source)),typeof f.target!=`object`&&(f.target=pt(d,f.target)),l[f.source.index]=(l[f.source.index]||0)+1,l[f.target.index]=(l[f.target.index]||0)+1;for(r=0,u=Array(c);r<c;++r)f=e[r],u[r]=l[f.source.index]/(l[f.source.index]+l[f.target.index]);i=Array(c),g(),o=Array(c),_()}}function g(){if(s)for(var n=0,a=e.length;n<a;++n)i[n]=+r(e[n],n,e)}function _(){if(s)for(var n=0,r=e.length;n<r;++n)o[n]=+a(e[n],n,e)}return m.initialize=function(e,...n){s=e,d=n.find(e=>typeof e==`function`)||Math.random,c=n.find(e=>[1,2,3].includes(e))||2,h()},m.links=function(n){return arguments.length?(e=n,h(),m):e},m.id=function(e){return arguments.length?(n=e,m):n},m.iterations=function(e){return arguments.length?(f=+e,m):f},m.strength=function(e){return arguments.length?(r=typeof e==`function`?e:ut(+e),g(),m):r},m.distance=function(e){return arguments.length?(a=typeof e==`function`?e:ut(+e),_(),m):a},m}var ht={value:()=>{}};function gt(){for(var e=0,n=arguments.length,r={},i;e<n;++e){if(!(i=arguments[e]+``)||i in r||/[\s.]/.test(i))throw Error(`illegal type: `+i);r[i]=[]}return new _t(r)}function _t(e){this._=e}function vt(e,n){return e.trim().split(/^|\s+/).map(function(e){var r=``,i=e.indexOf(`.`);if(i>=0&&(r=e.slice(i+1),e=e.slice(0,i)),e&&!n.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:r}})}_t.prototype=gt.prototype={constructor:_t,on:function(e,n){var r=this._,i=vt(e+``,r),a,o=-1,s=i.length;if(arguments.length<2){for(;++o<s;)if((a=(e=i[o]).type)&&(a=yt(r[a],e.name)))return a;return}if(n!=null&&typeof n!=`function`)throw Error(`invalid callback: `+n);for(;++o<s;)if(a=(e=i[o]).type)r[a]=bt(r[a],e.name,n);else if(n==null)for(a in r)r[a]=bt(r[a],e.name,null);return this},copy:function(){var e={},n=this._;for(var r in n)e[r]=n[r].slice();return new _t(e)},call:function(e,n){if((a=arguments.length-2)>0)for(var r=Array(a),i=0,a,o;i<a;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(o=this._[e],i=0,a=o.length;i<a;++i)o[i].value.apply(n,r)},apply:function(e,n,r){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var i=this._[e],a=0,o=i.length;a<o;++a)i[a].value.apply(n,r)}};function yt(e,n){for(var r=0,i=e.length,a;r<i;++r)if((a=e[r]).name===n)return a.value}function bt(e,n,r){for(var i=0,a=e.length;i<a;++i)if(e[i].name===n){e[i]=ht,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:n,value:r}),e}var xt=0,St=0,Ct=0,wt=1e3,Tt,Et,Dt=0,Ot=0,kt=0,At=typeof performance==`object`&&performance.now?performance:Date,jt=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Mt(){return Ot||=(jt(Nt),At.now()+kt)}function Nt(){Ot=0}function Pt(){this._call=this._time=this._next=null}Pt.prototype=Ft.prototype={constructor:Pt,restart:function(e,n,r){if(typeof e!=`function`)throw TypeError(`callback is not a function`);r=(r==null?Mt():+r)+(n==null?0:+n),!this._next&&Et!==this&&(Et?Et._next=this:Tt=this,Et=this),this._call=e,this._time=r,Bt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Bt())}};function Ft(e,n,r){var i=new Pt;return i.restart(e,n,r),i}function It(){Mt(),++xt;for(var e=Tt,n;e;)(n=Ot-e._time)>=0&&e._call.call(void 0,n),e=e._next;--xt}function Lt(){Ot=(Dt=At.now())+kt,xt=St=0;try{It()}finally{xt=0,zt(),Ot=0}}function Rt(){var e=At.now(),n=e-Dt;n>wt&&(kt-=n,Dt=e)}function zt(){for(var e,n=Tt,r,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:Tt=r);Et=e,Bt(i)}function Bt(e){xt||(St&&=clearTimeout(St),e-Ot>24?(e<1/0&&(St=setTimeout(Lt,e-At.now()-kt)),Ct&&=clearInterval(Ct)):(Ct||=(Dt=At.now(),setInterval(Rt,wt)),xt=1,jt(Lt)))}function Vt(e,n,r){var i=new Pt;return n=n==null?0:+n,i.restart(r=>{i.stop(),e(r+n)},n,r),i}var Ht=1664525,Ut=1013904223,Wt=4294967296;function Gt(){let e=1;return()=>(e=(Ht*e+Ut)%Wt)/Wt}var Kt=3;function qt(e){return e.x}function Jt(e){return e.y}function Yt(e){return e.z}var Xt=10,Zt=Math.PI*(3-Math.sqrt(5)),Qt=Math.PI*20/(9+Math.sqrt(221));function $t(e,n){n||=2;var r=Math.min(Kt,Math.max(1,Math.round(n))),i,a=1,o=.001,s=1-o**(1/300),c=0,l=.6,u=new Map,d=Ft(m),f=gt(`tick`,`end`),p=Gt();e??=[];function m(){h(),f.call(`tick`,i),a<o&&(d.stop(),f.call(`end`,i))}function h(n){var o,d=e.length,f;n===void 0&&(n=1);for(var p=0;p<n;++p)for(a+=(c-a)*s,u.forEach(function(e){e(a)}),o=0;o<d;++o)f=e[o],f.fx==null?f.x+=f.vx*=l:(f.x=f.fx,f.vx=0),r>1&&(f.fy==null?f.y+=f.vy*=l:(f.y=f.fy,f.vy=0)),r>2&&(f.fz==null?f.z+=f.vz*=l:(f.z=f.fz,f.vz=0));return i}function g(){for(var n=0,i=e.length,a;n<i;++n){if(a=e[n],a.index=n,a.fx!=null&&(a.x=a.fx),a.fy!=null&&(a.y=a.fy),a.fz!=null&&(a.z=a.fz),isNaN(a.x)||r>1&&isNaN(a.y)||r>2&&isNaN(a.z)){var o=Xt*(r>2?Math.cbrt(.5+n):r>1?Math.sqrt(.5+n):n),s=n*Zt,c=n*Qt;r===1?a.x=o:r===2?(a.x=o*Math.cos(s),a.y=o*Math.sin(s)):(a.x=o*Math.sin(s)*Math.cos(c),a.y=o*Math.cos(s),a.z=o*Math.sin(s)*Math.sin(c))}(isNaN(a.vx)||r>1&&isNaN(a.vy)||r>2&&isNaN(a.vz))&&(a.vx=0,r>1&&(a.vy=0),r>2&&(a.vz=0))}}function _(n){return n.initialize&&n.initialize(e,p,r),n}return g(),i={tick:h,restart:function(){return d.restart(m),i},stop:function(){return d.stop(),i},numDimensions:function(e){return arguments.length?(r=Math.min(Kt,Math.max(1,Math.round(e))),u.forEach(_),i):r},nodes:function(n){return arguments.length?(e=n,g(),u.forEach(_),i):e},alpha:function(e){return arguments.length?(a=+e,i):a},alphaMin:function(e){return arguments.length?(o=+e,i):o},alphaDecay:function(e){return arguments.length?(s=+e,i):+s},alphaTarget:function(e){return arguments.length?(c=+e,i):c},velocityDecay:function(e){return arguments.length?(l=1-e,i):1-l},randomSource:function(e){return arguments.length?(p=e,u.forEach(_),i):p},force:function(e,n){return arguments.length>1?(n==null?u.delete(e):u.set(e,_(n)),i):u.get(e)},find:function(){var n=Array.prototype.slice.call(arguments),i=n.shift()||0,a=(r>1?n.shift():null)||0,o=(r>2?n.shift():null)||0,s=n.shift()||1/0,c=0,l=e.length,u,d,f,p,m,h;for(s*=s,c=0;c<l;++c)m=e[c],u=i-m.x,d=a-(m.y||0),f=o-(m.z||0),p=u*u+d*d+f*f,p<s&&(h=m,s=p);return h},on:function(e,n){return arguments.length>1?(f.on(e,n),i):f.on(e)}}}function en(){var e,n,r,i,a,o=ut(-30),s,c=1,l=1/0,u=.81;function d(i){var o,s=e.length,c=(n===1?_e(e,qt):n===2?Le(e,qt,Jt):n===3?st(e,qt,Jt,Yt):null).visitAfter(p);for(a=i,o=0;o<s;++o)r=e[o],c.visit(m)}function f(){if(e){var n,r=e.length,i;for(s=Array(r),n=0;n<r;++n)i=e[n],s[i.index]=+o(i,n,e)}}function p(e){var r=0,i,a,o=0,c,l,u,d,f=e.length;if(f){for(c=l=u=d=0;d<f;++d)(i=e[d])&&(a=Math.abs(i.value))&&(r+=i.value,o+=a,c+=a*(i.x||0),l+=a*(i.y||0),u+=a*(i.z||0));r*=Math.sqrt(4/f),e.x=c/o,n>1&&(e.y=l/o),n>2&&(e.z=u/o)}else{i=e,i.x=i.data.x,n>1&&(i.y=i.data.y),n>2&&(i.z=i.data.z);do r+=s[i.data.index];while(i=i.next)}e.value=r}function m(e,o,d,f,p){if(!e.value)return!0;var m=[d,f,p][n-1],h=e.x-r.x,g=n>1?e.y-r.y:0,_=n>2?e.z-r.z:0,v=m-o,y=h*h+g*g+_*_;if(v*v/u<y)return y<l&&(h===0&&(h=dt(i),y+=h*h),n>1&&g===0&&(g=dt(i),y+=g*g),n>2&&_===0&&(_=dt(i),y+=_*_),y<c&&(y=Math.sqrt(c*y)),r.vx+=h*e.value*a/y,n>1&&(r.vy+=g*e.value*a/y),n>2&&(r.vz+=_*e.value*a/y)),!0;if(!(e.length||y>=l)){(e.data!==r||e.next)&&(h===0&&(h=dt(i),y+=h*h),n>1&&g===0&&(g=dt(i),y+=g*g),n>2&&_===0&&(_=dt(i),y+=_*_),y<c&&(y=Math.sqrt(c*y)));do e.data!==r&&(v=s[e.data.index]*a/y,r.vx+=h*v,n>1&&(r.vy+=g*v),n>2&&(r.vz+=_*v));while(e=e.next)}}return d.initialize=function(r,...a){e=r,i=a.find(e=>typeof e==`function`)||Math.random,n=a.find(e=>[1,2,3].includes(e))||2,f()},d.strength=function(e){return arguments.length?(o=typeof e==`function`?e:ut(+e),f(),d):o},d.distanceMin=function(e){return arguments.length?(c=e*e,d):Math.sqrt(c)},d.distanceMax=function(e){return arguments.length?(l=e*e,d):Math.sqrt(l)},d.theta=function(e){return arguments.length?(u=e*e,d):Math.sqrt(u)},d}function tn(e,n,r,i){var a,o,s=ut(.1),c,l;typeof e!=`function`&&(e=ut(+e)),n??=0,r??=0,i??=0;function u(e){for(var s=0,u=a.length;s<u;++s){var d=a[s],f=d.x-n||1e-6,p=(d.y||0)-r||1e-6,m=(d.z||0)-i||1e-6,h=Math.sqrt(f*f+p*p+m*m),g=(l[s]-h)*c[s]*e/h;d.vx+=f*g,o>1&&(d.vy+=p*g),o>2&&(d.vz+=m*g)}}function d(){if(a){var n,r=a.length;for(c=Array(r),l=Array(r),n=0;n<r;++n)l[n]=+e(a[n],n,a),c[n]=isNaN(l[n])?0:+s(a[n],n,a)}}return u.initialize=function(e,...n){a=e,o=n.find(e=>[1,2,3].includes(e))||2,d()},u.strength=function(e){return arguments.length?(s=typeof e==`function`?e:ut(+e),d(),u):s},u.radius=function(n){return arguments.length?(e=typeof n==`function`?n:ut(+n),d(),u):e},u.x=function(e){return arguments.length?(n=+e,u):n},u.y=function(e){return arguments.length?(r=+e,u):r},u.z=function(e){return arguments.length?(i=+e,u):i},u}function nn(e){var n=typeof e;return e!=null&&(n==`object`||n==`function`)}var rn=typeof global==`object`&&global&&global.Object===Object&&global,an=typeof self==`object`&&self&&self.Object===Object&&self,on=rn||an||Function(`return this`)(),sn=function(){return on.Date.now()},cn=/\s/;function ln(e){for(var n=e.length;n--&&cn.test(e.charAt(n)););return n}var un=/^\s+/;function dn(e){return e&&e.slice(0,ln(e)+1).replace(un,``)}var fn=on.Symbol,pn=Object.prototype,mn=pn.hasOwnProperty,hn=pn.toString,gn=fn?fn.toStringTag:void 0;function _n(e){var n=mn.call(e,gn),r=e[gn];try{e[gn]=void 0;var i=!0}catch{}var a=hn.call(e);return i&&(n?e[gn]=r:delete e[gn]),a}var vn=Object.prototype.toString;function yn(e){return vn.call(e)}var bn=`[object Null]`,xn=`[object Undefined]`,Sn=fn?fn.toStringTag:void 0;function Cn(e){return e==null?e===void 0?xn:bn:Sn&&Sn in Object(e)?_n(e):yn(e)}function wn(e){return typeof e==`object`&&!!e}var Tn=`[object Symbol]`;function En(e){return typeof e==`symbol`||wn(e)&&Cn(e)==Tn}var Dn=NaN,On=/^[-+]0x[0-9a-f]+$/i,kn=/^0b[01]+$/i,An=/^0o[0-7]+$/i,jn=parseInt;function Mn(e){if(typeof e==`number`)return e;if(En(e))return Dn;if(nn(e)){var n=typeof e.valueOf==`function`?e.valueOf():e;e=nn(n)?n+``:n}if(typeof e!=`string`)return e===0?e:+e;e=dn(e);var r=kn.test(e);return r||An.test(e)?jn(e.slice(2),r?2:8):On.test(e)?Dn:+e}var Nn=`Expected a function`,Pn=Math.max,Fn=Math.min;function In(e,n,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(Nn);n=Mn(n)||0,nn(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?Pn(Mn(r.maxWait)||0,n):o,p=`trailing`in r?!!r.trailing:p);function m(n){var r=i,o=a;return i=a=void 0,u=n,s=e.apply(o,r),s}function h(e){return u=e,c=setTimeout(v,n),d?m(e):s}function g(e){var r=e-l,i=e-u,a=n-r;return f?Fn(a,o-i):a}function _(e){var r=e-l,i=e-u;return l===void 0||r>=n||r<0||f&&i>=o}function v(){var e=sn();if(_(e))return y(e);c=setTimeout(v,g(e))}function y(e){return c=void 0,p&&i?m(e):(i=a=void 0,s)}function b(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function x(){return c===void 0?s:y(sn())}function S(){var e=sn(),r=_(e);if(i=arguments,a=this,l=e,r){if(c===void 0)return h(l);if(f)return clearTimeout(c),c=setTimeout(v,n),m(l)}return c===void 0&&(c=setTimeout(v,n)),s}return S.cancel=b,S.flush=x,S}function Ln(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function Rn(e){if(Array.isArray(e))return e}function zn(e,n){if(!(e instanceof n))throw TypeError(`Cannot call a class as a function`)}function Bn(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function Vn(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n!==0)for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function Hn(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Un(e,n){return Rn(e)||Vn(e,n)||Wn(e,n)||Hn()}function Wn(e,n){if(e){if(typeof e==`string`)return Ln(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ln(e,n):void 0}}var Gn=Bn(function e(n,r){var i=r.default,a=i===void 0?null:i,o=r.triggerUpdate,s=o===void 0||o,c=r.onChange,l=c===void 0?function(e,n){}:c;zn(this,e),this.name=n,this.defaultVal=a,this.triggerUpdate=s,this.onChange=l});function Kn(e){var n=e.stateInit,r=n===void 0?function(){return{}}:n,i=e.props,a=i===void 0?{}:i,o=e.methods,s=o===void 0?{}:o,c=e.aliases,l=c===void 0?{}:c,u=e.init,d=u===void 0?function(){}:u,f=e.update,p=f===void 0?function(){}:f,m=Object.keys(a).map(function(e){return new Gn(e,a[e])});return function e(){var n=[...arguments],i=!!(this instanceof e&&this.constructor),a=i?n.shift():void 0,o=n[0],c=o===void 0?{}:o,u=Object.assign({},r instanceof Function?r(c):r,{initialised:!1}),f={};function h(e){return g(e,c),_(),h}var g=function(e,n){d.call(h,e,u,n),u.initialised=!0},_=In(function(){u.initialised&&(p.call(h,u,f),f={})},1);return m.forEach(function(e){h[e.name]=n(e);function n(e){var n=e.name,r=e.triggerUpdate,i=r!==void 0&&r,a=e.onChange,o=a===void 0?function(e,n){}:a,s=e.defaultVal,c=s===void 0?null:s;return function(e){var r=u[n];if(!arguments.length)return r;var a=e===void 0?c:e;return u[n]=a,o.call(h,a,u,r),!f.hasOwnProperty(n)&&(f[n]=r),i&&_(),h}}}),Object.keys(s).forEach(function(e){h[e]=function(){var n,r=[...arguments];return(n=s[e]).call.apply(n,[h,u].concat(r))}}),Object.entries(l).forEach(function(e){var n=Un(e,2),r=n[0];return h[r]=h[n[1]]}),h.resetProps=function(){return m.forEach(function(e){h[e.name](e.defaultVal)}),h},h.resetProps(),u._rerender=_,i&&a&&h(a),h}}var F=(function(e){return typeof e==`function`?e:typeof e==`string`?function(n){return n[e]}:function(n){return e}}),qn=class extends Map{constructor(e,n=Zn){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let[n,r]of e)this.set(n,r)}get(e){return super.get(Jn(this,e))}has(e){return super.has(Jn(this,e))}set(e,n){return super.set(Yn(this,e),n)}delete(e){return super.delete(Xn(this,e))}};function Jn({_intern:e,_key:n},r){let i=n(r);return e.has(i)?e.get(i):r}function Yn({_intern:e,_key:n},r){let i=n(r);return e.has(i)?e.get(i):(e.set(i,r),r)}function Xn({_intern:e,_key:n},r){let i=n(r);return e.has(i)&&(r=e.get(i),e.delete(i)),r}function Zn(e){return typeof e==`object`&&e?e.valueOf():e}function Qn(e,n){let r;if(n===void 0)for(let n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);else{let i=-1;for(let a of e)(a=n(a,++i,e))!=null&&(r<a||r===void 0&&a>=a)&&(r=a)}return r}function $n(e,n){let r;if(n===void 0)for(let n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let i=-1;for(let a of e)(a=n(a,++i,e))!=null&&(r>a||r===void 0&&a>=a)&&(r=a)}return r}function er(e,n){let r=0;if(n===void 0)for(let n of e)(n=+n)&&(r+=n);else{let i=-1;for(let a of e)(a=+n(a,++i,e))&&(r+=a)}return r}function tr(e,n){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(n).domain(e)}return this}var nr=Symbol(`implicit`);function rr(){var e=new qn,n=[],r=[],i=nr;function a(a){let o=e.get(a);if(o===void 0){if(i!==nr)return i;e.set(a,o=n.push(a)-1)}return r[o%r.length]}return a.domain=function(r){if(!arguments.length)return n.slice();n=[],e=new qn;for(let i of r)e.has(i)||e.set(i,n.push(i)-1);return a},a.range=function(e){return arguments.length?(r=Array.from(e),a):r.slice()},a.unknown=function(e){return arguments.length?(i=e,a):i},a.copy=function(){return rr(n,r).unknown(i)},tr.apply(a,arguments),a}function ir(e,n,r){e.prototype=n.prototype=r,r.constructor=e}function ar(e,n){var r=Object.create(e.prototype);for(var i in n)r[i]=n[i];return r}function or(){}var sr=.7,cr=1/sr,lr=`\\s*([+-]?\\d+)\\s*`,ur=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,dr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,fr=/^#([0-9a-f]{3,8})$/,pr=RegExp(`^rgb\\(${lr},${lr},${lr}\\)$`),mr=RegExp(`^rgb\\(${dr},${dr},${dr}\\)$`),hr=RegExp(`^rgba\\(${lr},${lr},${lr},${ur}\\)$`),gr=RegExp(`^rgba\\(${dr},${dr},${dr},${ur}\\)$`),_r=RegExp(`^hsl\\(${ur},${dr},${dr}\\)$`),vr=RegExp(`^hsla\\(${ur},${dr},${dr},${ur}\\)$`),yr={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};ir(or,wr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:br,formatHex:br,formatHex8:xr,formatHsl:Sr,formatRgb:Cr,toString:Cr});function br(){return this.rgb().formatHex()}function xr(){return this.rgb().formatHex8()}function Sr(){return Ir(this).formatHsl()}function Cr(){return this.rgb().formatRgb()}function wr(e){var n,r;return e=(e+``).trim().toLowerCase(),(n=fr.exec(e))?(r=n[1].length,n=parseInt(n[1],16),r===6?Tr(n):r===3?new I(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):r===8?Er(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):r===4?Er(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=pr.exec(e))?new I(n[1],n[2],n[3],1):(n=mr.exec(e))?new I(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=hr.exec(e))?Er(n[1],n[2],n[3],n[4]):(n=gr.exec(e))?Er(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=_r.exec(e))?Fr(n[1],n[2]/100,n[3]/100,1):(n=vr.exec(e))?Fr(n[1],n[2]/100,n[3]/100,n[4]):yr.hasOwnProperty(e)?Tr(yr[e]):e===`transparent`?new I(NaN,NaN,NaN,0):null}function Tr(e){return new I(e>>16&255,e>>8&255,e&255,1)}function Er(e,n,r,i){return i<=0&&(e=n=r=NaN),new I(e,n,r,i)}function Dr(e){return e instanceof or||(e=wr(e)),e?(e=e.rgb(),new I(e.r,e.g,e.b,e.opacity)):new I}function Or(e,n,r,i){return arguments.length===1?Dr(e):new I(e,n,r,i??1)}function I(e,n,r,i){this.r=+e,this.g=+n,this.b=+r,this.opacity=+i}ir(I,Or,ar(or,{brighter(e){return e=e==null?cr:cr**+e,new I(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?sr:sr**+e,new I(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new I(Nr(this.r),Nr(this.g),Nr(this.b),Mr(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:kr,formatHex:kr,formatHex8:Ar,formatRgb:jr,toString:jr}));function kr(){return`#${Pr(this.r)}${Pr(this.g)}${Pr(this.b)}`}function Ar(){return`#${Pr(this.r)}${Pr(this.g)}${Pr(this.b)}${Pr((isNaN(this.opacity)?1:this.opacity)*255)}`}function jr(){let e=Mr(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Nr(this.r)}, ${Nr(this.g)}, ${Nr(this.b)}${e===1?`)`:`, ${e})`}`}function Mr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Nr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Pr(e){return e=Nr(e),(e<16?`0`:``)+e.toString(16)}function Fr(e,n,r,i){return i<=0?e=n=r=NaN:r<=0||r>=1?e=n=NaN:n<=0&&(e=NaN),new Rr(e,n,r,i)}function Ir(e){if(e instanceof Rr)return new Rr(e.h,e.s,e.l,e.opacity);if(e instanceof or||(e=wr(e)),!e)return new Rr;if(e instanceof Rr)return e;e=e.rgb();var n=e.r/255,r=e.g/255,i=e.b/255,a=Math.min(n,r,i),o=Math.max(n,r,i),s=NaN,c=o-a,l=(o+a)/2;return c?(s=n===o?(r-i)/c+(r<i)*6:r===o?(i-n)/c+2:(n-r)/c+4,c/=l<.5?o+a:2-o-a,s*=60):c=l>0&&l<1?0:s,new Rr(s,c,l,e.opacity)}function Lr(e,n,r,i){return arguments.length===1?Ir(e):new Rr(e,n,r,i??1)}function Rr(e,n,r,i){this.h=+e,this.s=+n,this.l=+r,this.opacity=+i}ir(Rr,Lr,ar(or,{brighter(e){return e=e==null?cr:cr**+e,new Rr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?sr:sr**+e,new Rr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*n,a=2*r-i;return new I(Vr(e>=240?e-240:e+120,a,i),Vr(e,a,i),Vr(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new Rr(zr(this.h),Br(this.s),Br(this.l),Mr(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(){let e=Mr(this.opacity);return`${e===1?`hsl(`:`hsla(`}${zr(this.h)}, ${Br(this.s)*100}%, ${Br(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function zr(e){return e=(e||0)%360,e<0?e+360:e}function Br(e){return Math.max(0,Math.min(1,e||0))}function Vr(e,n,r){return(e<60?n+(r-n)*e/60:e<180?r:e<240?n+(r-n)*(240-e)/60:n)*255}var Hr=e=>()=>e;function Ur(e,n){return function(r){return e+r*n}}function Wr(e,n,r){return e**=+r,n=n**+r-e,r=1/r,function(i){return(e+i*n)**+r}}function Gr(e){return(e=+e)==1?Kr:function(n,r){return r-n?Wr(n,r,e):Hr(isNaN(n)?r:n)}}function Kr(e,n){var r=n-e;return r?Ur(e,r):Hr(isNaN(e)?n:e)}var qr=(function e(n){var r=Gr(n);function i(e,n){var i=r((e=Or(e)).r,(n=Or(n)).r),a=r(e.g,n.g),o=r(e.b,n.b),s=Kr(e.opacity,n.opacity);return function(n){return e.r=i(n),e.g=a(n),e.b=o(n),e.opacity=s(n),e+``}}return i.gamma=e,i})(1);function Jr(e,n){return e=+e,n=+n,function(r){return e*(1-r)+n*r}}var Yr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xr=new RegExp(Yr.source,`g`);function Zr(e){return function(){return e}}function Qr(e){return function(n){return e(n)+``}}function $r(e,n){var r=Yr.lastIndex=Xr.lastIndex=0,i,a,o,s=-1,c=[],l=[];for(e+=``,n+=``;(i=Yr.exec(e))&&(a=Xr.exec(n));)(o=a.index)>r&&(o=n.slice(r,o),c[s]?c[s]+=o:c[++s]=o),(i=i[0])===(a=a[0])?c[s]?c[s]+=a:c[++s]=a:(c[++s]=null,l.push({i:s,x:Jr(i,a)})),r=Xr.lastIndex;return r<n.length&&(o=n.slice(r),c[s]?c[s]+=o:c[++s]=o),c.length<2?l[0]?Qr(l[0].x):Zr(n):(n=l.length,function(e){for(var r=0,i;r<n;++r)c[(i=l[r]).i]=i.x(e);return c.join(``)})}var ei=180/Math.PI,ti={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ni(e,n,r,i,a,o){var s,c,l;return(s=Math.sqrt(e*e+n*n))&&(e/=s,n/=s),(l=e*r+n*i)&&(r-=e*l,i-=n*l),(c=Math.sqrt(r*r+i*i))&&(r/=c,i/=c,l/=c),e*i<n*r&&(e=-e,n=-n,l=-l,s=-s),{translateX:a,translateY:o,rotate:Math.atan2(n,e)*ei,skewX:Math.atan(l)*ei,scaleX:s,scaleY:c}}var ri;function ii(e){let n=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return n.isIdentity?ti:ni(n.a,n.b,n.c,n.d,n.e,n.f)}function ai(e){return e==null||(ri||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),ri.setAttribute(`transform`,e),!(e=ri.transform.baseVal.consolidate()))?ti:(e=e.matrix,ni(e.a,e.b,e.c,e.d,e.e,e.f))}function oi(e,n,r,i){function a(e){return e.length?e.pop()+` `:``}function o(e,i,a,o,s,c){if(e!==a||i!==o){var l=s.push(`translate(`,null,n,null,r);c.push({i:l-4,x:Jr(e,a)},{i:l-2,x:Jr(i,o)})}else(a||o)&&s.push(`translate(`+a+n+o+r)}function s(e,n,r,o){e===n?n&&r.push(a(r)+`rotate(`+n+i):(e-n>180?n+=360:n-e>180&&(e+=360),o.push({i:r.push(a(r)+`rotate(`,null,i)-2,x:Jr(e,n)}))}function c(e,n,r,o){e===n?n&&r.push(a(r)+`skewX(`+n+i):o.push({i:r.push(a(r)+`skewX(`,null,i)-2,x:Jr(e,n)})}function l(e,n,r,i,o,s){if(e!==r||n!==i){var c=o.push(a(o)+`scale(`,null,`,`,null,`)`);s.push({i:c-4,x:Jr(e,r)},{i:c-2,x:Jr(n,i)})}else(r!==1||i!==1)&&o.push(a(o)+`scale(`+r+`,`+i+`)`)}return function(n,r){var i=[],a=[];return n=e(n),r=e(r),o(n.translateX,n.translateY,r.translateX,r.translateY,i,a),s(n.rotate,r.rotate,i,a),c(n.skewX,r.skewX,i,a),l(n.scaleX,n.scaleY,r.scaleX,r.scaleY,i,a),n=r=null,function(e){for(var n=-1,r=a.length,o;++n<r;)i[(o=a[n]).i]=o.x(e);return i.join(``)}}}var si=oi(ii,`px, `,`px)`,`deg)`),ci=oi(ai,`, `,`)`,`)`),li=1e-12;function ui(e){return((e=Math.exp(e))+1/e)/2}function di(e){return((e=Math.exp(e))-1/e)/2}function fi(e){return((e=Math.exp(2*e))-1)/(e+1)}var pi=(function e(n,r,i){function a(e,a){var o=e[0],s=e[1],c=e[2],l=a[0],u=a[1],d=a[2],f=l-o,p=u-s,m=f*f+p*p,h,g;if(m<li)g=Math.log(d/c)/n,h=function(e){return[o+e*f,s+e*p,c*Math.exp(n*e*g)]};else{var _=Math.sqrt(m),v=(d*d-c*c+i*m)/(2*c*r*_),y=(d*d-c*c-i*m)/(2*d*r*_),b=Math.log(Math.sqrt(v*v+1)-v);g=(Math.log(Math.sqrt(y*y+1)-y)-b)/n,h=function(e){var i=e*g,a=ui(b),l=c/(r*_)*(a*fi(n*i+b)-di(b));return[o+l*f,s+l*p,c*a/ui(n*i+b)]}}return h.duration=g*1e3*n/Math.SQRT2,h}return a.rho=function(n){var r=Math.max(.001,+n),i=r*r;return e(r,i,i*i)},a})(Math.SQRT2,2,4);function mi(e){for(var n=e.length/6|0,r=Array(n),i=0;i<n;)r[i]=`#`+e.slice(i*6,++i*6);return r}var hi=mi(`a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928`);function gi(e){"@babel/helpers - typeof";return gi=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},gi(e)}var _i=/^\s+/,vi=/\s+$/;function L(e,n){if(e||=``,n||={},e instanceof L)return e;if(!(this instanceof L))return new L(e,n);var r=yi(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}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 e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),n=e.r/255,r=e.g/255,i=e.b/255,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4;return .2126*a+.7152*o+.0722*s},setAlpha:function(e){return this._a=Ui(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=Ci(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=Ci(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?`hsv(`+n+`, `+r+`%, `+i+`%)`:`hsva(`+n+`, `+r+`%, `+i+`%, `+this._roundA+`)`},toHsl:function(){var e=xi(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=xi(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?`hsl(`+n+`, `+r+`%, `+i+`%)`:`hsla(`+n+`, `+r+`%, `+i+`%, `+this._roundA+`)`},toHex:function(e){return Ti(this._r,this._g,this._b,e)},toHexString:function(e){return`#`+this.toHex(e)},toHex8:function(e){return Ei(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return`#`+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?`rgb(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`)`:`rgba(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`, `+this._roundA+`)`},toPercentageRgb:function(){return{r:Math.round(R(this._r,255)*100)+`%`,g:Math.round(R(this._g,255)*100)+`%`,b:Math.round(R(this._b,255)*100)+`%`,a:this._a}},toPercentageRgbString:function(){return this._a==1?`rgb(`+Math.round(R(this._r,255)*100)+`%, `+Math.round(R(this._g,255)*100)+`%, `+Math.round(R(this._b,255)*100)+`%)`:`rgba(`+Math.round(R(this._r,255)*100)+`%, `+Math.round(R(this._g,255)*100)+`%, `+Math.round(R(this._b,255)*100)+`%, `+this._roundA+`)`},toName:function(){return this._a===0?`transparent`:this._a<1?!1:Vi[Ti(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var n=`#`+Di(this._r,this._g,this._b,this._a),r=n,i=this._gradientType?`GradientType = 1, `:``;if(e){var a=L(e);r=`#`+Di(a._r,a._g,a._b,a._a)}return`progid:DXImageTransform.Microsoft.gradient(`+i+`startColorstr=`+n+`,endColorstr=`+r+`)`},toString:function(e){var n=!!e;e||=this._format;var r=!1,i=this._a<1&&this._a>=0;return!n&&i&&(e===`hex`||e===`hex6`||e===`hex3`||e===`hex4`||e===`hex8`||e===`name`)?e===`name`&&this._a===0?this.toName():this.toRgbString():(e===`rgb`&&(r=this.toRgbString()),e===`prgb`&&(r=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(r=this.toHexString()),e===`hex3`&&(r=this.toHexString(!0)),e===`hex4`&&(r=this.toHex8String(!0)),e===`hex8`&&(r=this.toHex8String()),e===`name`&&(r=this.toName()),e===`hsl`&&(r=this.toHslString()),e===`hsv`&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return L(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(ji,arguments)},brighten:function(){return this._applyModification(Mi,arguments)},darken:function(){return this._applyModification(Ni,arguments)},desaturate:function(){return this._applyModification(Oi,arguments)},saturate:function(){return this._applyModification(ki,arguments)},greyscale:function(){return this._applyModification(Ai,arguments)},spin:function(){return this._applyModification(Pi,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(Ri,arguments)},complement:function(){return this._applyCombination(Fi,arguments)},monochromatic:function(){return this._applyCombination(zi,arguments)},splitcomplement:function(){return this._applyCombination(Li,arguments)},triad:function(){return this._applyCombination(Ii,[3])},tetrad:function(){return this._applyCombination(Ii,[4])}},L.fromRatio=function(e,n){if(gi(e)==`object`){var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=i===`a`?e[i]:qi(e[i]));e=r}return L(e,n)};function yi(e){var n={r:0,g:0,b:0},r=1,i=null,a=null,o=null,s=!1,c=!1;return typeof e==`string`&&(e=Zi(e)),gi(e)==`object`&&(Xi(e.r)&&Xi(e.g)&&Xi(e.b)?(n=bi(e.r,e.g,e.b),s=!0,c=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):Xi(e.h)&&Xi(e.s)&&Xi(e.v)?(i=qi(e.s),a=qi(e.v),n=wi(e.h,i,a),s=!0,c=`hsv`):Xi(e.h)&&Xi(e.s)&&Xi(e.l)&&(i=qi(e.s),o=qi(e.l),n=Si(e.h,i,o),s=!0,c=`hsl`),e.hasOwnProperty(`a`)&&(r=e.a)),r=Ui(r),{ok:s,format:e.format||c,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function bi(e,n,r){return{r:R(e,255)*255,g:R(n,255)*255,b:R(r,255)*255}}function xi(e,n,r){e=R(e,255),n=R(n,255),r=R(r,255);var i=Math.max(e,n,r),a=Math.min(e,n,r),o,s,c=(i+a)/2;if(i==a)o=s=0;else{var l=i-a;switch(s=c>.5?l/(2-i-a):l/(i+a),i){case e:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-e)/l+2;break;case r:o=(e-n)/l+4}o/=6}return{h:o,s,l:c}}function Si(e,n,r){var i,a,o;e=R(e,360),n=R(n,100),r=R(r,100);function s(e,n,r){return r<0&&(r+=1),r>1&&--r,r<1/6?e+(n-e)*6*r:r<1/2?n:r<2/3?e+(n-e)*(2/3-r)*6:e}if(n===0)i=a=o=r;else{var c=r<.5?r*(1+n):r+n-r*n,l=2*r-c;i=s(l,c,e+1/3),a=s(l,c,e),o=s(l,c,e-1/3)}return{r:i*255,g:a*255,b:o*255}}function Ci(e,n,r){e=R(e,255),n=R(n,255),r=R(r,255);var i=Math.max(e,n,r),a=Math.min(e,n,r),o,s,c=i,l=i-a;if(s=i===0?0:l/i,i==a)o=0;else{switch(i){case e:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-e)/l+2;break;case r:o=(e-n)/l+4}o/=6}return{h:o,s,v:c}}function wi(e,n,r){e=R(e,360)*6,n=R(n,100),r=R(r,100);var i=Math.floor(e),a=e-i,o=r*(1-n),s=r*(1-a*n),c=r*(1-(1-a)*n),l=i%6,u=[r,s,o,o,c,r][l],d=[c,r,r,s,o,o][l],f=[o,o,c,r,r,s][l];return{r:u*255,g:d*255,b:f*255}}function Ti(e,n,r,i){var a=[B(Math.round(e).toString(16)),B(Math.round(n).toString(16)),B(Math.round(r).toString(16))];return 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[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join(``)}function Ei(e,n,r,i,a){var o=[B(Math.round(e).toString(16)),B(Math.round(n).toString(16)),B(Math.round(r).toString(16)),B(Ji(i))];return a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join(``)}function Di(e,n,r,i){return[B(Ji(i)),B(Math.round(e).toString(16)),B(Math.round(n).toString(16)),B(Math.round(r).toString(16))].join(``)}L.equals=function(e,n){return!e||!n?!1:L(e).toRgbString()==L(n).toRgbString()},L.random=function(){return L.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Oi(e,n){n=n===0?0:n||10;var r=L(e).toHsl();return r.s-=n/100,r.s=Wi(r.s),L(r)}function ki(e,n){n=n===0?0:n||10;var r=L(e).toHsl();return r.s+=n/100,r.s=Wi(r.s),L(r)}function Ai(e){return L(e).desaturate(100)}function ji(e,n){n=n===0?0:n||10;var r=L(e).toHsl();return r.l+=n/100,r.l=Wi(r.l),L(r)}function Mi(e,n){n=n===0?0:n||10;var r=L(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(n/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(n/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(n/100)))),L(r)}function Ni(e,n){n=n===0?0:n||10;var r=L(e).toHsl();return r.l-=n/100,r.l=Wi(r.l),L(r)}function Pi(e,n){var r=L(e).toHsl(),i=(r.h+n)%360;return r.h=i<0?360+i:i,L(r)}function Fi(e){var n=L(e).toHsl();return n.h=(n.h+180)%360,L(n)}function Ii(e,n){if(isNaN(n)||n<=0)throw Error(`Argument to polyad must be a positive number`);for(var r=L(e).toHsl(),i=[L(e)],a=360/n,o=1;o<n;o++)i.push(L({h:(r.h+o*a)%360,s:r.s,l:r.l}));return i}function Li(e){var n=L(e).toHsl(),r=n.h;return[L(e),L({h:(r+72)%360,s:n.s,l:n.l}),L({h:(r+216)%360,s:n.s,l:n.l})]}function Ri(e,n,r){n||=6,r||=30;var i=L(e).toHsl(),a=360/r,o=[L(e)];for(i.h=(i.h-(a*n>>1)+720)%360;--n;)i.h=(i.h+a)%360,o.push(L(i));return o}function zi(e,n){n||=6;for(var r=L(e).toHsv(),i=r.h,a=r.s,o=r.v,s=[],c=1/n;n--;)s.push(L({h:i,s:a,v:o})),o=(o+c)%1;return s}L.mix=function(e,n,r){r=r===0?0:r||50;var i=L(e).toRgb(),a=L(n).toRgb(),o=r/100;return L({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},L.readability=function(e,n){var r=L(e),i=L(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)},L.isReadable=function(e,n,r){var i=L.readability(e,n),a,o=!1;switch(a=Qi(r),a.level+a.size){case`AAsmall`:case`AAAlarge`:o=i>=4.5;break;case`AAlarge`:o=i>=3;break;case`AAAsmall`:o=i>=7}return o},L.mostReadable=function(e,n,r){var i=null,a=0,o,s,c,l;r||={},s=r.includeFallbackColors,c=r.level,l=r.size;for(var u=0;u<n.length;u++)o=L.readability(e,n[u]),o>a&&(a=o,i=L(n[u]));return L.isReadable(e,i,{level:c,size:l})||!s?i:(r.includeFallbackColors=!1,L.mostReadable(e,[`#fff`,`#000`],r))};var Bi=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`},Vi=L.hexNames=Hi(Bi);function Hi(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function Ui(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function R(e,n){Gi(e)&&(e=`100%`);var r=Ki(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function Wi(e){return Math.min(1,Math.max(0,e))}function z(e){return parseInt(e,16)}function Gi(e){return typeof e==`string`&&e.indexOf(`.`)!=-1&&parseFloat(e)===1}function Ki(e){return typeof e==`string`&&e.indexOf(`%`)!=-1}function B(e){return e.length==1?`0`+e:``+e}function qi(e){return e<=1&&(e=e*100+`%`),e}function Ji(e){return Math.round(parseFloat(e)*255).toString(16)}function Yi(e){return z(e)/255}var V=function(){var e=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,n=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`,r=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`;return{CSS_UNIT:new RegExp(e),rgb:RegExp(`rgb`+n),rgba:RegExp(`rgba`+r),hsl:RegExp(`hsl`+n),hsla:RegExp(`hsla`+r),hsv:RegExp(`hsv`+n),hsva:RegExp(`hsva`+r),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 Xi(e){return!!V.CSS_UNIT.exec(e)}function Zi(e){e=e.replace(_i,``).replace(vi,``).toLowerCase();var n=!1;if(Bi[e])e=Bi[e],n=!0;else if(e==`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var r;return(r=V.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=V.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=V.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=V.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=V.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=V.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=V.hex8.exec(e))?{r:z(r[1]),g:z(r[2]),b:z(r[3]),a:Yi(r[4]),format:n?`name`:`hex8`}:(r=V.hex6.exec(e))?{r:z(r[1]),g:z(r[2]),b:z(r[3]),format:n?`name`:`hex`}:(r=V.hex4.exec(e))?{r:z(r[1]+``+r[1]),g:z(r[2]+``+r[2]),b:z(r[3]+``+r[3]),a:Yi(r[4]+``+r[4]),format:n?`name`:`hex8`}:(r=V.hex3.exec(e))?{r:z(r[1]+``+r[1]),g:z(r[2]+``+r[2]),b:z(r[3]+``+r[3]),format:n?`name`:`hex`}:!1}function Qi(e){var n,r;return e||={level:`AA`,size:`small`},n=(e.level||`AA`).toUpperCase(),r=(e.size||`small`).toLowerCase(),n!==`AA`&&n!==`AAA`&&(n=`AA`),r!==`small`&&r!==`large`&&(r=`small`),{level:n,size:r}}var $i=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:1024**(e-1)},Out:function(e){return e===1?1:1-2**(-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-(2**(10*(e-1)))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:2**(-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*2**(10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*2**(-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-$i.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?$i.Bounce.In(e*2)*.5:$i.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<2**-52?2**-52:e,e=e>1e4?1e4:e,{In:function(n){return n**+e},Out:function(n){return 1-(1-n)**e},InOut:function(n){return n<.5?(n*2)**e/2:(1-(2-n*2)**e)/2+.5}}}}),ea=function(){return performance.now()},ta=function(){function e(){var e=[...arguments];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(n){return e._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=0,a=n;i<a.length;i++){var o=a[i];(e=o._group)==null||e.remove(o),o._group=this,this._tweens[o.getId()]=o,this._tweensAddedDuringUpdate[o.getId()]=o}},e.prototype.remove=function(){for(var e=[...arguments],n=0,r=e;n<r.length;n++){var i=r[n];i._group=void 0,delete this._tweens[i.getId()],delete this._tweensAddedDuringUpdate[i.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},e.prototype.update=function(e,n){e===void 0&&(e=ea()),n===void 0&&(n=!0);var r=Object.keys(this._tweens);if(r.length!==0)for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<r.length;i++){var a=this._tweens[r[i]],o=!n;a&&a.update(e,o)===!1&&!n&&this.remove(a)}r=Object.keys(this._tweensAddedDuringUpdate)}},e}(),na={Linear:function(e,n){var r=e.length-1,i=r*n,a=Math.floor(i),o=na.Utils.Linear;return n<0?o(e[0],e[1],i):n>1?o(e[r],e[r-1],r-i):o(e[a],e[a+1>r?r:a+1],i-a)},Bezier:function(e,n){for(var r=0,i=e.length-1,a=Math.pow,o=na.Utils.Bernstein,s=0;s<=i;s++)r+=a(1-n,i-s)*a(n,s)*e[s]*o(i,s);return r},CatmullRom:function(e,n){var r=e.length-1,i=r*n,a=Math.floor(i),o=na.Utils.CatmullRom;return e[0]===e[r]?(n<0&&(a=Math.floor(i=r*(1+n))),o(e[(a-1+r)%r],e[a],e[(a+1)%r],e[(a+2)%r],i-a)):n<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):n>1?e[r]-(o(e[r],e[r],e[r-1],e[r-1],i-r)-e[r]):o(e[a?a-1:0],e[a],e[r<a+1?r:a+1],e[r<a+2?r:a+2],i-a)},Utils:{Linear:function(e,n,r){return(n-e)*r+e},Bernstein:function(e,n){var r=na.Utils.Factorial;return r(e)/r(n)/r(e-n)},Factorial:(function(){var e=[1];return function(n){var r=1;if(e[n])return e[n];for(var i=n;i>1;i--)r*=i;return e[n]=r,r}})(),CatmullRom:function(e,n,r,i,a){var o=(r-e)*.5,s=(i-n)*.5,c=a*a,l=a*c;return(2*n-2*r+o+s)*l+(-3*n+3*r-2*o-s)*c+o*a+n}}},ra=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),ia=new ta,aa=function(){function e(e,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=$i.Linear.None,this._interpolationFunction=na.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ra.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof n==`object`?(this._group=n,n.add(this)):n===!0&&(this._group=ia,ia.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,n){if(n===void 0&&(n=1e3),this._isPlaying)throw Error(`Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.`);return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,n){if(e===void 0&&(e=ea()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var r in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var a in this._valuesEnd)i[a]=this._valuesEnd[a];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,n,r,i,a){for(var o in r){var s=e[o],c=Array.isArray(s),l=c?`array`:typeof s,u=!c&&Array.isArray(r[o]);if(l!==`undefined`&&l!==`function`){if(u){var d=r[o];if(d.length===0)continue;for(var f=[s],p=0,m=d.length;p<m;p+=1){var h=this._handleRelativeValue(s,d[p]);if(isNaN(h)){u=!1,console.warn(`Found invalid interpolation list. Skipping.`);break}f.push(h)}u&&(r[o]=f)}if((l===`object`||c)&&s&&!u){n[o]=c?[]:{};var g=s;for(var _ in g)n[o][_]=g[_];i[o]=c?[]:{};var d=r[o];if(!this._isDynamic){var v={};for(var _ in d)v[_]=d[_];r[o]=d=v}this._setupProperties(g,n[o],d,i[o],a)}else(n[o]===void 0||a)&&(n[o]=s),c||(n[o]*=1),i[o]=u?r[o].slice().reverse():n[o]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(e){return e===void 0&&(e=ea()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},e.prototype.resume=function(e){return e===void 0&&(e=ea()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var e=0,n=this._chainedTweens.length;e<n;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return e?(e.add(this),this):(console.warn(`tween.group() without args has been removed, use group.add(tween) instead.`),this)},e.prototype.remove=function(){var e;return(e=this._group)==null||e.remove(this),this},e.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},e.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},e.prototype.easing=function(e){return e===void 0&&(e=$i.Linear.None),this._easingFunction=e,this},e.prototype.interpolation=function(e){return e===void 0&&(e=na.Linear),this._interpolationFunction=e,this},e.prototype.chain=function(){var e=[...arguments];return this._chainedTweens=e,this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(n,r){var i=this;if(n===void 0&&(n=ea()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var a;if(!this._goToEnd&&!this._isPlaying){if(r)this.start(n,!0);else return!1}if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var o=n-this._startTime,s=this._duration+(this._repeatDelayTime??this._delayTime),c=this._duration+this._repeat*s,l=function(){if(i._duration===0||o>c)return 1;var e=o-Math.trunc(o/s)*s,n=Math.min(e/i._duration,1);return n===0&&o===i._duration?1:n}(),u=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,u),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),this._duration===0||o>=this._duration){if(this._repeat>0){var d=Math.min(Math.trunc((o-this._duration)/s)+1,this._repeat);for(a in isFinite(this._repeat)&&(this._repeat-=d),this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]==`string`&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=s*d,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var f=0,p=this._chainedTweens.length;f<p;f++)this._chainedTweens[f].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,n,r,i){for(var a in r)if(n[a]!==void 0){var o=n[a]||0,s=r[a];!Array.isArray(e[a])&&Array.isArray(s)?e[a]=this._interpolationFunction(s,i):typeof s==`object`&&s?this._updateProperties(e[a],o,s,i):(s=this._handleRelativeValue(o,s),typeof s==`number`&&(e[a]=o+(s-o)*i))}},e.prototype._handleRelativeValue=function(e,n){return typeof n==`string`?n.charAt(0)===`+`||n.charAt(0)===`-`?e+parseFloat(n):parseFloat(n):n},e.prototype._swapEndStartRepeatValues=function(e){var n=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r==`string`?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=n},e.autoStartOnUpdate=!1,e}();ra.nextId;var oa=ia;oa.getAll.bind(oa),oa.removeAll.bind(oa),oa.add.bind(oa),oa.remove.bind(oa),oa.update.bind(oa);var sa={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function ca(e){var n=e+=``,r=n.indexOf(`:`);return r>=0&&(n=e.slice(0,r))!==`xmlns`&&(e=e.slice(r+1)),sa.hasOwnProperty(n)?{space:sa[n],local:e}:e}function la(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===`http://www.w3.org/1999/xhtml`&&n.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?n.createElement(e):n.createElementNS(r,e)}}function ua(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function da(e){var n=ca(e);return(n.local?ua:la)(n)}function fa(){}function pa(e){return e==null?fa:function(){return this.querySelector(e)}}function ma(e){typeof e!=`function`&&(e=pa(e));for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a)for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u,d=0;d<s;++d)(l=o[d])&&(u=e.call(l,l.__data__,d,o))&&(`__data__`in l&&(u.__data__=l.__data__),c[d]=u);return new H(i,this._parents)}function ha(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ga(){return[]}function _a(e){return e==null?ga:function(){return this.querySelectorAll(e)}}function va(e){return function(){return ha(e.apply(this,arguments))}}function ya(e){e=typeof e==`function`?va(e):_a(e);for(var n=this._groups,r=n.length,i=[],a=[],o=0;o<r;++o)for(var s=n[o],c=s.length,l,u=0;u<c;++u)(l=s[u])&&(i.push(e.call(l,l.__data__,u,s)),a.push(l));return new H(i,a)}function ba(e){return function(){return this.matches(e)}}function xa(e){return function(n){return n.matches(e)}}var Sa=Array.prototype.find;function Ca(e){return function(){return Sa.call(this.children,e)}}function wa(){return this.firstElementChild}function Ta(e){return this.select(e==null?wa:Ca(typeof e==`function`?e:xa(e)))}var Ea=Array.prototype.filter;function Da(){return Array.from(this.children)}function Oa(e){return function(){return Ea.call(this.children,e)}}function ka(e){return this.selectAll(e==null?Da:Oa(typeof e==`function`?e:xa(e)))}function Aa(e){typeof e!=`function`&&(e=ba(e));for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a)for(var o=n[a],s=o.length,c=i[a]=[],l,u=0;u<s;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&c.push(l);return new H(i,this._parents)}function ja(e){return Array(e.length)}function Ma(){return new H(this._enter||this._groups.map(ja),this._parents)}function Na(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Na.prototype={constructor:Na,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Pa(e){return function(){return e}}function Fa(e,n,r,i,a,o){for(var s=0,c,l=n.length,u=o.length;s<u;++s)(c=n[s])?(c.__data__=o[s],i[s]=c):r[s]=new Na(e,o[s]);for(;s<l;++s)(c=n[s])&&(a[s]=c)}function Ia(e,n,r,i,a,o,s){var c,l,u=new Map,d=n.length,f=o.length,p=Array(d),m;for(c=0;c<d;++c)(l=n[c])&&(p[c]=m=s.call(l,l.__data__,c,n)+``,u.has(m)?a[c]=l:u.set(m,l));for(c=0;c<f;++c)m=s.call(e,o[c],c,o)+``,(l=u.get(m))?(i[c]=l,l.__data__=o[c],u.delete(m)):r[c]=new Na(e,o[c]);for(c=0;c<d;++c)(l=n[c])&&u.get(p[c])===l&&(a[c]=l)}function La(e){return e.__data__}function Ra(e,n){if(!arguments.length)return Array.from(this,La);var r=n?Ia:Fa,i=this._parents,a=this._groups;typeof e!=`function`&&(e=Pa(e));for(var o=a.length,s=Array(o),c=Array(o),l=Array(o),u=0;u<o;++u){var d=i[u],f=a[u],p=f.length,m=za(e.call(d,d&&d.__data__,u,i)),h=m.length,g=c[u]=Array(h),_=s[u]=Array(h);r(d,f,g,_,l[u]=Array(p),m,n);for(var v=0,y=0,b,x;v<h;++v)if(b=g[v]){for(v>=y&&(y=v+1);!(x=_[y])&&++y<h;);b._next=x||null}}return s=new H(s,i),s._enter=c,s._exit=l,s}function za(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Ba(){return new H(this._exit||this._groups.map(ja),this._parents)}function Va(e,n,r){var i=this.enter(),a=this,o=this.exit();return typeof e==`function`?(i=e(i),i&&=i.selection()):i=i.append(e+``),n!=null&&(a=n(a),a&&=a.selection()),r==null?o.remove():r(o),i&&a?i.merge(a).order():a}function Ha(e){for(var n=e.selection?e.selection():e,r=this._groups,i=n._groups,a=r.length,o=i.length,s=Math.min(a,o),c=Array(a),l=0;l<s;++l)for(var u=r[l],d=i[l],f=u.length,p=c[l]=Array(f),m,h=0;h<f;++h)(m=u[h]||d[h])&&(p[h]=m);for(;l<a;++l)c[l]=r[l];return new H(c,this._parents)}function Ua(){for(var e=this._groups,n=-1,r=e.length;++n<r;)for(var i=e[n],a=i.length-1,o=i[a],s;--a>=0;)(s=i[a])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function Wa(e){e||=Ga;function n(n,r){return n&&r?e(n.__data__,r.__data__):!n-!r}for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o){for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d=0;d<c;++d)(u=s[d])&&(l[d]=u);l.sort(n)}return new H(a,this._parents).order()}function Ga(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function Ka(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function qa(){return Array.from(this)}function Ja(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length;a<o;++a){var s=i[a];if(s)return s}return null}function Ya(){let e=0;for(let n of this)++e;return e}function Xa(){return!this.node()}function Za(e){for(var n=this._groups,r=0,i=n.length;r<i;++r)for(var a=n[r],o=0,s=a.length,c;o<s;++o)(c=a[o])&&e.call(c,c.__data__,o,a);return this}function Qa(e){return function(){this.removeAttribute(e)}}function $a(e){return function(){this.removeAttributeNS(e.space,e.local)}}function eo(e,n){return function(){this.setAttribute(e,n)}}function to(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function no(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function ro(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function io(e,n){var r=ca(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((n==null?r.local?$a:Qa:typeof n==`function`?r.local?ro:no:r.local?to:eo)(r,n))}function ao(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function oo(e){return function(){this.style.removeProperty(e)}}function so(e,n,r){return function(){this.style.setProperty(e,n,r)}}function co(e,n,r){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function lo(e,n,r){return arguments.length>1?this.each((n==null?oo:typeof n==`function`?co:so)(e,n,r??``)):uo(this.node(),e)}function uo(e,n){return e.style.getPropertyValue(n)||ao(e).getComputedStyle(e,null).getPropertyValue(n)}function fo(e){return function(){delete this[e]}}function po(e,n){return function(){this[e]=n}}function mo(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function ho(e,n){return arguments.length>1?this.each((n==null?fo:typeof n==`function`?mo:po)(e,n)):this.node()[e]}function go(e){return e.trim().split(/^|\s+/)}function _o(e){return e.classList||new vo(e)}function vo(e){this._node=e,this._names=go(e.getAttribute(`class`)||``)}vo.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function yo(e,n){for(var r=_o(e),i=-1,a=n.length;++i<a;)r.add(n[i])}function bo(e,n){for(var r=_o(e),i=-1,a=n.length;++i<a;)r.remove(n[i])}function xo(e){return function(){yo(this,e)}}function So(e){return function(){bo(this,e)}}function Co(e,n){return function(){(n.apply(this,arguments)?yo:bo)(this,e)}}function wo(e,n){var r=go(e+``);if(arguments.length<2){for(var i=_o(this.node()),a=-1,o=r.length;++a<o;)if(!i.contains(r[a]))return!1;return!0}return this.each((typeof n==`function`?Co:n?xo:So)(r,n))}function To(){this.textContent=``}function Eo(e){return function(){this.textContent=e}}function Do(e){return function(){var n=e.apply(this,arguments);this.textContent=n??``}}function Oo(e){return arguments.length?this.each(e==null?To:(typeof e==`function`?Do:Eo)(e)):this.node().textContent}function ko(){this.innerHTML=``}function Ao(e){return function(){this.innerHTML=e}}function jo(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??``}}function Mo(e){return arguments.length?this.each(e==null?ko:(typeof e==`function`?jo:Ao)(e)):this.node().innerHTML}function No(){this.nextSibling&&this.parentNode.appendChild(this)}function Po(){return this.each(No)}function Fo(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Io(){return this.each(Fo)}function Lo(e){var n=typeof e==`function`?e:da(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function Ro(){return null}function zo(e,n){var r=typeof e==`function`?e:da(e),i=n==null?Ro:typeof n==`function`?n:pa(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function Bo(){var e=this.parentNode;e&&e.removeChild(this)}function Vo(){return this.each(Bo)}function Ho(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function Uo(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function Wo(e){return this.select(e?Uo:Ho)}function Go(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Ko(e){return function(n){e.call(this,n,this.__data__)}}function qo(e){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Jo(e){return function(){var n=this.__on;if(n){for(var r=0,i=-1,a=n.length,o;r<a;++r)o=n[r],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):n[++i]=o;++i?n.length=i:delete this.__on}}}function Yo(e,n,r){return function(){var i=this.__on,a,o=Ko(n);if(i){for(var s=0,c=i.length;s<c;++s)if((a=i[s]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=o,a.options=r),a.value=n;return}}this.addEventListener(e.type,o,r),a={type:e.type,name:e.name,value:n,listener:o,options:r},i?i.push(a):this.__on=[a]}}function Xo(e,n,r){var i=qo(e+``),a,o=i.length,s;if(arguments.length<2){var c=this.node().__on;if(c){for(var l=0,u=c.length,d;l<u;++l)for(a=0,d=c[l];a<o;++a)if((s=i[a]).type===d.type&&s.name===d.name)return d.value}return}for(c=n?Yo:Jo,a=0;a<o;++a)this.each(c(i[a],n,r));return this}function Zo(e,n,r){var i=ao(e),a=i.CustomEvent;typeof a==`function`?a=new a(n,r):(a=i.document.createEvent(`Event`),r?(a.initEvent(n,r.bubbles,r.cancelable),a.detail=r.detail):a.initEvent(n,!1,!1)),e.dispatchEvent(a)}function Qo(e,n){return function(){return Zo(this,e,n)}}function $o(e,n){return function(){return Zo(this,e,n.apply(this,arguments))}}function es(e,n){return this.each((typeof n==`function`?$o:Qo)(e,n))}function*ts(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&(yield s)}var ns=[null];function H(e,n){this._groups=e,this._parents=n}function rs(){return new H([[document.documentElement]],ns)}function is(){return this}H.prototype=rs.prototype={constructor:H,select:ma,selectAll:ya,selectChild:Ta,selectChildren:ka,filter:Aa,data:Ra,enter:Ma,exit:Ba,join:Va,merge:Ha,selection:is,order:Ua,sort:Wa,call:Ka,nodes:qa,node:Ja,size:Ya,empty:Xa,each:Za,attr:io,style:lo,property:ho,classed:wo,text:Oo,html:Mo,raise:Po,lower:Io,append:Lo,insert:zo,remove:Vo,clone:Wo,datum:Go,on:Xo,dispatch:es,[Symbol.iterator]:ts};function U(e){return typeof e==`string`?new H([[document.querySelector(e)]],[document.documentElement]):new H([[e]],ns)}function as(e){let n;for(;n=e.sourceEvent;)e=n;return e}function os(e,n){if(e=as(e),n===void 0&&(n=e.currentTarget),n){var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}}return[e.pageX,e.pageY]}var ss,W,cs,ls,us,ds,fs,ps,ms,hs,gs,_s,vs,ys,bs,xs={},Ss=[],Cs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ws=Array.isArray;function Ts(e,n){for(var r in n)e[r]=n[r];return e}function Es(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ds(e,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?ss.call(arguments,2):r),typeof e==`function`&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return Os(e,s,i,a,null)}function Os(e,n,r,i,a){var o={type:e,props:n,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++cs,__i:-1,__u:0};return a==null&&W.vnode!=null&&W.vnode(o),o}function ks(e){return e.children}function As(e,n){this.props=e,this.context=n}function js(e,n){if(n==null)return e.__?js(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type==`function`?js(e):null}function Ms(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],o=Ts({},n);o.__v=n.__v+1,W.vnode&&W.vnode(o),Us(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??js(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,Gs(i,o,a),n.__e=n.__=null,o.__e!=r&&Ns(o)}}function Ns(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),Ns(e)}function Ps(e){(!e.__d&&(e.__d=!0)&&us.push(e)&&!Fs.__r++||ds!=W.debounceRendering)&&((ds=W.debounceRendering)||fs)(Fs)}function Fs(){try{for(var e,n=1;us.length;)us.length>n&&us.sort(ps),e=us.shift(),n=us.length,Ms(e)}finally{us.length=Fs.__r=0}}function Is(e,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v=i&&i.__k||Ss,y=n.length;for(l=Ls(r,n,v,l,y),f=0;f<y;f++)(m=r.__k[f])!=null&&(p=m.__i!=-1&&v[m.__i]||xs,m.__i=f,_=Us(e,m,p,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Js(p.ref,null,m),d.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),4&m.__u?(l=Rs(m,l,e),p.__e&&(p.__e=null)):typeof m.type==`function`&&_!==void 0?l=_:h&&(l=h.nextSibling),m.__u&=-7);return r.__e=g,l}function Ls(e,n,r,i,a){var o,s,c,l,u,d=r.length,f=d,p=0;for(e.__k=Array(a),o=0;o<a;o++)(s=n[o])!=null&&typeof s!=`boolean`&&typeof s!=`function`?(typeof s==`string`||typeof s==`number`||typeof s==`bigint`||s.constructor==String?s=e.__k[o]=Os(null,s,null,null,null):ws(s)?s=e.__k[o]=Os(ks,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[o]=Os(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[o]=s,l=o+p,s.__=e,s.__b=e.__b+1,c=null,(u=s.__i=zs(s,r,l,f))!=-1&&(f--,(c=r[u])&&(c.__u|=2)),c==null||c.__v==null?(u==-1&&(a>d?p--:a<d&&p++),typeof s.type!=`function`&&(s.__u|=4)):u!=l&&(u==l-1?p--:u==l+1?p++:(u>l?p--:p++,s.__u|=4))):e.__k[o]=null;if(f)for(o=0;o<d;o++)(c=r[o])!=null&&!(2&c.__u)&&(c.__e==i&&(i=js(c)),Ys(c,c));return i}function Rs(e,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,n=Rs(i[a],n,r));return n}e.__e!=n&&(n&&e.type&&!n.parentNode&&(n=js(e)),n=r.insertBefore(e.__e,n||null));do n&&=n.nextSibling;while(n!=null&&n.nodeType==8);return n}function zs(e,n,r,i){var a,o,s,c=e.key,l=e.type,u=n[r],d=u!=null&&!(2&u.__u);if(u===null&&c==null||d&&c==u.key&&l==u.type)return r;if(i>+!!d){for(a=r-1,o=r+1;a>=0||o<n.length;)if((u=n[s=a>=0?a--:o++])!=null&&!(2&u.__u)&&c==u.key&&l==u.type)return s}return-1}function Bs(e,n,r){n[0]==`-`?e.setProperty(n,r??``):e[n]=r==null?``:typeof r!=`number`||Cs.test(n)?r:r+`px`}function Vs(e,n,r,i,a){var o,s;n:if(n==`style`){if(typeof r==`string`)e.style.cssText=r;else{if(typeof i==`string`&&(e.style.cssText=i=``),i)for(n in i)r&&n in r||Bs(e.style,n,``);if(r)for(n in r)i&&r[n]==i[n]||Bs(e.style,n,r[n])}}else if(n[0]==`o`&&n[1]==`n`)o=n!=(n=n.replace(_s,`$1`)),s=n.toLowerCase(),n=s in e||n==`onFocusOut`||n==`onFocusIn`?s.slice(2):n.slice(2),e.l||={},e.l[n+o]=r,r?i?r[gs]=i[gs]:(r[gs]=vs,e.addEventListener(n,o?bs:ys,o)):e.removeEventListener(n,o?bs:ys,o);else{if(a==`http://www.w3.org/2000/svg`)n=n.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(n!=`width`&&n!=`height`&&n!=`href`&&n!=`list`&&n!=`form`&&n!=`tabIndex`&&n!=`download`&&n!=`rowSpan`&&n!=`colSpan`&&n!=`role`&&n!=`popover`&&n in e)try{e[n]=r??``;break n}catch{}typeof r==`function`||(r==null||!1===r&&n[4]!=`-`?e.removeAttribute(n):e.setAttribute(n,n==`popover`&&r==1?``:r))}}function Hs(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[hs]==null)n[hs]=vs++;else if(n[hs]<r[gs])return;return r(W.event?W.event(n):n)}}}function Us(e,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(d=W.__b)&&d(n);n:if(typeof D==`function`){f=s.length;try{if(y=n.props,b=D.prototype&&D.prototype.render,x=(d=D.contextType)&&i[d.__c],S=d?x?x.props.value:d.__:i,r.__c?v=(p=n.__c=r.__c).__=p.__E:(b?n.__c=p=new D(y,S):(n.__c=p=new As(y,S),p.constructor=D,p.render=Xs),x&&x.sub(p),p.state||(p.state={}),p.__n=i,m=p.__d=!0,p.__h=[],p._sb=[]),b&&p.__s==null&&(p.__s=p.state),b&&D.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Ts({},p.__s)),Ts(p.__s,D.getDerivedStateFromProps(y,p.__s))),h=p.props,g=p.state,p.__v=n,m)b&&D.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),b&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(b&&D.getDerivedStateFromProps==null&&y!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(y,S),n.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(y,p.__s,S)){n.__v!=r.__v&&(p.props=y,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),Ss.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p),c=js(r);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(y,p.__s,S),b&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,g,_)})}if(p.context=S,p.props=y,p.__P=e,p.__e=!1,C=W.__r,w=0,b)p.state=p.__s,p.__d=!1,C&&C(n),d=p.render(p.props,p.state,p.context),Ss.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,C&&C(n),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++w<25);p.state=p.__s,p.getChildContext!=null&&(i=Ts(Ts({},i),p.getChildContext())),b&&!m&&p.getSnapshotBeforeUpdate!=null&&(_=p.getSnapshotBeforeUpdate(h,g)),T=d!=null&&d.type===ks&&d.key==null?Ks(d.props.children):d,c=Is(e,ws(T)?T:[T],n,r,i,a,o,s,c,l,u),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),v&&(p.__E=p.__=null)}catch(e){if(s.length=f,n.__v=null,l||o!=null){if(e.then){for(n.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o!=null&&(o[o.indexOf(c)]=null),n.__e=c}else if(o!=null)for(E=o.length;E--;)Es(o[E])}else n.__e=r.__e;n.__k??=r.__k||[],e.then||Ws(n),W.__e(e,n,r)}}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=qs(r.__e,n,r,i,a,o,s,l,u);return(d=W.diffed)&&d(n),128&n.__u?void 0:c}function Ws(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ws))}function Gs(e,n,r){for(var i=0;i<r.length;i++)Js(r[i],r[++i],r[++i]);W.__c&&W.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){W.__e(e,n.__v)}})}function Ks(e){return typeof e!=`object`||!e||e.__b>0?e:ws(e)?e.map(Ks):e.constructor===void 0?Ts({},e):null}function qs(e,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_=r.props||xs,v=n.props,y=n.type;if(y==`svg`?a=`http://www.w3.org/2000/svg`:y==`math`?a=`http://www.w3.org/1998/Math/MathML`:a||=`http://www.w3.org/1999/xhtml`,o!=null){for(u=0;u<o.length;u++)if((m=o[u])&&`setAttribute`in m==!!y&&(y?m.localName==y:m.nodeType==3)){e=m,o[u]=null;break}}if(e==null){if(y==null)return document.createTextNode(v);e=document.createElementNS(a,y,v.is&&v),c&&=(W.__m&&W.__m(n,o),!1),o=null}if(y==null)_===v||c&&e.data==v||(e.data=v);else{if(o=y==`textarea`&&v.defaultValue!=null?null:o&&ss.call(e.childNodes),!c&&o!=null)for(_={},u=0;u<e.attributes.length;u++)_[(m=e.attributes[u]).name]=m.value;for(u in _)m=_[u],u==`dangerouslySetInnerHTML`?f=m:u==`children`||u in v||u==`value`&&`defaultValue`in v||u==`checked`&&`defaultChecked`in v||Vs(e,u,null,m,a);for(u in v)m=v[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:c&&typeof m!=`function`||_[u]===m||Vs(e,u,m,_[u],a);if(d)c||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),n.__k=[];else if(f&&(e.innerHTML=``),Is(n.type==`template`?e.content:e,ws(p)?p:[p],n,r,i,y==`foreignObject`?`http://www.w3.org/1999/xhtml`:a,o,s,o?o[0]:r.__k&&js(r,0),c,l),o!=null)for(u=o.length;u--;)Es(o[u]);c&&y!=`textarea`||(u=`value`,y==`progress`&&h==null?e.removeAttribute(`value`):h!=null&&(h!==e[u]||y==`progress`&&!h||y==`option`&&h!=_[u])&&Vs(e,u,h,_[u],a),u=`checked`,g!=null&&g!=e[u]&&Vs(e,u,g,_[u],a))}return e}function Js(e,n,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(e){W.__e(e,r)}}function Ys(e,n,r){var i,a;if(W.unmount&&W.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Js(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){W.__e(e,n)}i.base=i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&Ys(i[a],n,r||typeof e.type!=`function`);r||Es(e.__e),e.__c=e.__=e.__e=void 0}function Xs(e,n,r){return this.constructor(e,r)}function Zs(e,n,r){var i,a,o,s;n==document&&(n=document.documentElement),W.__&&W.__(e,n),a=(i=typeof r==`function`)?null:r&&r.__k||n.__k,o=[],s=[],Us(n,e=(!i&&r||n).__k=Ds(ks,null,[e]),a||xs,xs,n.namespaceURI,!i&&r?[r]:a?null:n.firstChild?ss.call(n.childNodes):null,o,!i&&r?r:a?a.__e:n.firstChild,i,s),Gs(o,e,s),e.props.children=null}function Qs(e,n,r){var i,a,o,s,c=Ts({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)o==`key`?i=n[o]:o==`ref`?a=n[o]:c[o]=n[o]===void 0&&s!=null?s[o]:n[o];return arguments.length>2&&(c.children=arguments.length>3?ss.call(arguments,2):r),Os(e.type,c,i||e.key,a||e.ref,null)}ss=Ss.slice,W={__e:function(e,n,r,i){for(var a,o,s;n=n.__;)if((a=n.__c)&&!a.__)try{if((o=a.constructor)&&o.getDerivedStateFromError!=null&&(a.setState(o.getDerivedStateFromError(e)),s=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,i||{}),s=a.__d),s)return a.__E=a}catch(n){e=n}throw e}},cs=0,ls=function(e){return e!=null&&e.constructor===void 0},As.prototype.setState=function(e,n){var r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ts({},this.state);typeof e==`function`&&(e=e(Ts({},r),this.props)),e&&Ts(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),Ps(this))},As.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ps(this))},As.prototype.render=ks,us=[],fs=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ps=function(e,n){return e.__v.__b-n.__v.__b},Fs.__r=0,ms=Math.random().toString(8),hs=`__d`+ms,gs=`__a`+ms,_s=/(PointerCapture)$|Capture$/i,vs=0,ys=Hs(!1),bs=Hs(!0);function $s(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function ec(e){if(Array.isArray(e))return e}function tc(e,n,r){return(n=cc(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function nc(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n!==0)for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function rc(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ic(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function ac(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]==null?{}:arguments[n];n%2?ic(Object(r),!0).forEach(function(n){tc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ic(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oc(e,n){return ec(e)||nc(e,n)||uc(e,n)||rc()}function sc(e,n){if(typeof e!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function cc(e){var n=sc(e,`string`);return typeof n==`symbol`?n:n+``}function lc(e){"@babel/helpers - typeof";return lc=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},lc(e)}function uc(e,n){if(e){if(typeof e==`string`)return $s(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$s(e,n):void 0}}var dc=function(e){if(lc(e)!==`object`)return e;var n=Qs(e);if(n.props){var r;n.props=ac({},n.props),n!=null&&(r=n.props)!=null&&r.children&&(n.props.children=Array.isArray(n.props.children)?n.props.children.map(dc):dc(n.props.children))}return n},fc=function(e){return ls(Qs(e))},pc=function(e,n){delete n.__k,Zs(dc(e),n)};function mc(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>`u`)){var i=document.head||document.getElementsByTagName(`head`)[0],a=document.createElement(`style`);a.type=`text/css`,r===`top`&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}mc(`.float-tooltip-kap {
|
||
position: absolute;
|
||
width: max-content; /* prevent shrinking near right edge */
|
||
max-width: max(50%, 150px);
|
||
padding: 3px 5px;
|
||
border-radius: 3px;
|
||
font: 12px sans-serif;
|
||
color: #eee;
|
||
background: rgba(0,0,0,0.6);
|
||
pointer-events: none;
|
||
}
|
||
`);var hc=Kn({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(e,n){var r=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).style,i=r===void 0?{}:r,a=U(e&&lc(e)===`object`&&e.node&&typeof e.node==`function`?e.node():e);a.style(`position`)===`static`&&a.style(`position`,`relative`),n.tooltipEl=a.append(`div`).attr(`class`,`float-tooltip-kap`),Object.entries(i).forEach(function(e){var r=oc(e,2),i=r[0],a=r[1];return n.tooltipEl.style(i,a)}),n.tooltipEl.style(`left`,`-10000px`).style(`display`,`none`);var o=`tooltip-${Math.round(Math.random()*0xe8d4a51000)}`;n.mouseInside=!1,a.on(`mousemove.${o}`,function(e){n.mouseInside=!0;var r=os(e),i=a.node(),o=i.offsetWidth,s=i.offsetHeight,c=[n.offsetX===null||n.offsetX===void 0?`-${r[0]/o*100}%`:typeof n.offsetX==`number`?`calc(-50% + ${n.offsetX}px)`:n.offsetX,n.offsetY===null||n.offsetY===void 0?s>130&&s-r[1]<100?`calc(-100% - 6px)`:`21px`:typeof n.offsetY==`number`?n.offsetY<0?`calc(-100% - ${Math.abs(n.offsetY)}px)`:`${n.offsetY}px`:n.offsetY];n.tooltipEl.style(`left`,r[0]+`px`).style(`top`,r[1]+`px`).style(`transform`,`translate(${c.join(`,`)})`),n.content&&n.tooltipEl.style(`display`,`inline`)}),a.on(`mouseover.${o}`,function(){n.mouseInside=!0,n.content&&n.tooltipEl.style(`display`,`inline`)}),a.on(`mouseout.${o}`,function(){n.mouseInside=!1,n.tooltipEl.style(`display`,`none`)})},update:function(e){e.tooltipEl.style(`display`,e.content&&e.mouseInside?`inline`:`none`),e.content?e.content instanceof HTMLElement?(e.tooltipEl.text(``),e.tooltipEl.append(function(){return e.content})):typeof e.content==`string`?e.tooltipEl.html(e.content):fc(e.content)?(e.tooltipEl.text(``),pc(e.content,e.tooltipEl.node())):(e.tooltipEl.style(`display`,`none`),console.warn(`Tooltip content is invalid, skipping.`,e.content,e.content.toString())):e.tooltipEl.text(``)}}),gc=r(((e,n)=>{n.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),_c=r(((e,n)=>{var r=gc();function i(){}function a(){}a.resetWarningCache=i,n.exports=function(){function e(e,n,i,a,o,s){if(s!==r){var c=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name=`Invariant Violation`,c}}e.isRequired=e;function n(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:n,element:e,elementType:e,instanceOf:n,node:e,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:a,resetWarningCache:i};return o.PropTypes=o,o}})),vc=r(((e,n)=>{n.exports=_c()()})),yc={passive:!1},bc={capture:!0,passive:!1};function xc(e){e.stopImmediatePropagation()}function Sc(e){e.preventDefault(),e.stopImmediatePropagation()}function Cc(e){var n=e.document.documentElement,r=U(e).on(`dragstart.drag`,Sc,bc);`onselectstart`in n?r.on(`selectstart.drag`,Sc,bc):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect=`none`)}function wc(e,n){var r=e.document.documentElement,i=U(e).on(`dragstart.drag`,null);n&&(i.on(`click.drag`,Sc,bc),setTimeout(function(){i.on(`click.drag`,null)},0)),`onselectstart`in r?i.on(`selectstart.drag`,null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}var Tc=e=>()=>e;function Ec(e,{sourceEvent:n,subject:r,target:i,identifier:a,active:o,x:s,y:c,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}Ec.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Dc(e){return!e.ctrlKey&&!e.button}function Oc(){return this.parentNode}function kc(e,n){return n??{x:e.x,y:e.y}}function Ac(){return navigator.maxTouchPoints||`ontouchstart`in this}function jc(){var e=Dc,n=Oc,r=kc,i=Ac,a={},o=gt(`start`,`drag`,`end`),s=0,c,l,u,d,f=0;function p(e){e.on(`mousedown.drag`,m).filter(i).on(`touchstart.drag`,_).on(`touchmove.drag`,v,yc).on(`touchend.drag touchcancel.drag`,y).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function m(r,i){if(!d&&e.call(this,r,i)){var a=b(this,n.call(this,r,i),r,i,`mouse`);a&&(U(r.view).on(`mousemove.drag`,h,bc).on(`mouseup.drag`,g,bc),Cc(r.view),xc(r),u=!1,c=r.clientX,l=r.clientY,a(`start`,r))}}function h(e){if(Sc(e),!u){var n=e.clientX-c,r=e.clientY-l;u=n*n+r*r>f}a.mouse(`drag`,e)}function g(e){U(e.view).on(`mousemove.drag mouseup.drag`,null),wc(e.view,u),Sc(e),a.mouse(`end`,e)}function _(r,i){if(e.call(this,r,i))for(var a=r.changedTouches,o=n.call(this,r,i),s=a.length,c=0,l;c<s;++c)(l=b(this,o,r,i,a[c].identifier,a[c]))&&(xc(r),l(`start`,r,a[c]))}function v(e){for(var n=e.changedTouches,r=n.length,i=0,o;i<r;++i)(o=a[n[i].identifier])&&(Sc(e),o(`drag`,e,n[i]))}function y(e){var n=e.changedTouches,r=n.length,i,o;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),i=0;i<r;++i)(o=a[n[i].identifier])&&(xc(e),o(`end`,e,n[i]))}function b(e,n,i,c,l,u){var d=o.copy(),f=os(u||i,n),m,h,g;if((g=r.call(e,new Ec(`beforestart`,{sourceEvent:i,target:p,identifier:l,active:s,x:f[0],y:f[1],dx:0,dy:0,dispatch:d}),c))!=null)return m=g.x-f[0]||0,h=g.y-f[1]||0,function r(i,o,u){var _=f,v;switch(i){case`start`:a[l]=r,v=s++;break;case`end`:delete a[l],--s;case`drag`:f=os(u||o,n),v=s}d.call(i,e,new Ec(i,{sourceEvent:o,subject:g,target:p,identifier:l,active:v,x:f[0]+m,y:f[1]+h,dx:f[0]-_[0],dy:f[1]-_[1],dispatch:d}),c)}}return p.filter=function(n){return arguments.length?(e=typeof n==`function`?n:Tc(!!n),p):e},p.container=function(e){return arguments.length?(n=typeof e==`function`?e:Tc(e),p):n},p.subject=function(e){return arguments.length?(r=typeof e==`function`?e:Tc(e),p):r},p.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Tc(!!e),p):i},p.on=function(){var e=o.on.apply(o,arguments);return e===o?p:e},p.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,p):Math.sqrt(f)},p}var Mc=gt(`start`,`end`,`cancel`,`interrupt`),Nc=[];function Pc(e,n,r,i,a,o){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;Lc(e,r,{name:n,index:i,group:a,on:Mc,tween:Nc,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function Fc(e,n){var r=G(e,n);if(r.state>0)throw Error(`too late; already scheduled`);return r}function Ic(e,n){var r=G(e,n);if(r.state>3)throw Error(`too late; already running`);return r}function G(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw Error(`transition not found`);return r}function Lc(e,n,r){var i=e.__transition,a;i[n]=r,r.timer=Ft(o,0,r.time);function o(e){r.state=1,r.timer.restart(s,r.delay,r.time),r.delay<=e&&s(e-r.delay)}function s(o){var u,d,f,p;if(r.state!==1)return l();for(u in i)if(p=i[u],p.name===r.name){if(p.state===3)return Vt(s);p.state===4?(p.state=6,p.timer.stop(),p.on.call(`interrupt`,e,e.__data__,p.index,p.group),delete i[u]):+u<n&&(p.state=6,p.timer.stop(),p.on.call(`cancel`,e,e.__data__,p.index,p.group),delete i[u])}if(Vt(function(){r.state===3&&(r.state=4,r.timer.restart(c,r.delay,r.time),c(o))}),r.state=2,r.on.call(`start`,e,e.__data__,r.index,r.group),r.state===2){for(r.state=3,a=Array(f=r.tween.length),u=0,d=-1;u<f;++u)(p=r.tween[u].value.call(e,e.__data__,r.index,r.group))&&(a[++d]=p);a.length=d+1}}function c(n){for(var i=n<r.duration?r.ease.call(null,n/r.duration):(r.timer.restart(l),r.state=5,1),o=-1,s=a.length;++o<s;)a[o].call(e,i);r.state===5&&(r.on.call(`end`,e,e.__data__,r.index,r.group),l())}function l(){for(var a in r.state=6,r.timer.stop(),delete i[n],i)return;delete e.__transition}}function Rc(e,n){var r=e.__transition,i,a,o=!0,s;if(r){for(s in n=n==null?null:n+``,r){if((i=r[s]).name!==n){o=!1;continue}a=i.state>2&&i.state<5,i.state=6,i.timer.stop(),i.on.call(a?`interrupt`:`cancel`,e,e.__data__,i.index,i.group),delete r[s]}o&&delete e.__transition}}function zc(e){return this.each(function(){Rc(this,e)})}function Bc(e,n){var r,i;return function(){var a=Ic(this,e),o=a.tween;if(o!==r){i=r=o;for(var s=0,c=i.length;s<c;++s)if(i[s].name===n){i=i.slice(),i.splice(s,1);break}}a.tween=i}}function Vc(e,n,r){var i,a;if(typeof r!=`function`)throw Error();return function(){var o=Ic(this,e),s=o.tween;if(s!==i){a=(i=s).slice();for(var c={name:n,value:r},l=0,u=a.length;l<u;++l)if(a[l].name===n){a[l]=c;break}l===u&&a.push(c)}o.tween=a}}function Hc(e,n){var r=this._id;if(e+=``,arguments.length<2){for(var i=G(this.node(),r).tween,a=0,o=i.length,s;a<o;++a)if((s=i[a]).name===e)return s.value;return null}return this.each((n==null?Bc:Vc)(r,e,n))}function Uc(e,n,r){var i=e._id;return e.each(function(){var e=Ic(this,i);(e.value||={})[n]=r.apply(this,arguments)}),function(e){return G(e,i).value[n]}}function Wc(e,n){var r;return(typeof n==`number`?Jr:n instanceof wr?qr:(r=wr(n))?(n=r,qr):$r)(e,n)}function Gc(e){return function(){this.removeAttribute(e)}}function Kc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qc(e,n,r){var i,a=r+``,o;return function(){var s=this.getAttribute(e);return s===a?null:s===i?o:o=n(i=s,r)}}function Jc(e,n,r){var i,a=r+``,o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===a?null:s===i?o:o=n(i=s,r)}}function Yc(e,n,r){var i,a,o;return function(){var s,c=r(this),l;return c==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=c+``,s===l?null:s===i&&l===a?o:(a=l,o=n(i=s,c)))}}function Xc(e,n,r){var i,a,o;return function(){var s,c=r(this),l;return c==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=c+``,s===l?null:s===i&&l===a?o:(a=l,o=n(i=s,c)))}}function Zc(e,n){var r=ca(e),i=r===`transform`?ci:Wc;return this.attrTween(e,typeof n==`function`?(r.local?Xc:Yc)(r,i,Uc(this,`attr.`+e,n)):n==null?(r.local?Kc:Gc)(r):(r.local?Jc:qc)(r,i,n))}function Qc(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function $c(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function el(e,n){var r,i;function a(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&$c(e,a)),r}return a._value=n,a}function tl(e,n){var r,i;function a(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&Qc(e,a)),r}return a._value=n,a}function nl(e,n){var r=`attr.`+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!=`function`)throw Error();var i=ca(e);return this.tween(r,(i.local?el:tl)(i,n))}function rl(e,n){return function(){Fc(this,e).delay=+n.apply(this,arguments)}}function il(e,n){return n=+n,function(){Fc(this,e).delay=n}}function al(e){var n=this._id;return arguments.length?this.each((typeof e==`function`?rl:il)(n,e)):G(this.node(),n).delay}function ol(e,n){return function(){Ic(this,e).duration=+n.apply(this,arguments)}}function sl(e,n){return n=+n,function(){Ic(this,e).duration=n}}function cl(e){var n=this._id;return arguments.length?this.each((typeof e==`function`?ol:sl)(n,e)):G(this.node(),n).duration}function ll(e,n){if(typeof n!=`function`)throw Error();return function(){Ic(this,e).ease=n}}function ul(e){var n=this._id;return arguments.length?this.each(ll(n,e)):G(this.node(),n).ease}function dl(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!=`function`)throw Error();Ic(this,e).ease=r}}function fl(e){if(typeof e!=`function`)throw Error();return this.each(dl(this._id,e))}function pl(e){typeof e!=`function`&&(e=ba(e));for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a)for(var o=n[a],s=o.length,c=i[a]=[],l,u=0;u<s;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&c.push(l);return new Hl(i,this._parents,this._name,this._id)}function ml(e){if(e._id!==this._id)throw Error();for(var n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Hl(s,this._parents,this._name,this._id)}function hl(e){return(e+``).trim().split(/^|\s+/).every(function(e){var n=e.indexOf(`.`);return n>=0&&(e=e.slice(0,n)),!e||e===`start`})}function gl(e,n,r){var i,a,o=hl(n)?Fc:Ic;return function(){var s=o(this,e),c=s.on;c!==i&&(a=(i=c).copy()).on(n,r),s.on=a}}function _l(e,n){var r=this._id;return arguments.length<2?G(this.node(),r).on.on(e):this.each(gl(r,e,n))}function vl(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function yl(){return this.on(`end.remove`,vl(this._id))}function bl(e){var n=this._name,r=this._id;typeof e!=`function`&&(e=pa(e));for(var i=this._groups,a=i.length,o=Array(a),s=0;s<a;++s)for(var c=i[s],l=c.length,u=o[s]=Array(l),d,f,p=0;p<l;++p)(d=c[p])&&(f=e.call(d,d.__data__,p,c))&&(`__data__`in d&&(f.__data__=d.__data__),u[p]=f,Pc(u[p],n,r,p,u,G(d,r)));return new Hl(o,this._parents,n,r)}function xl(e){var n=this._name,r=this._id;typeof e!=`function`&&(e=_a(e));for(var i=this._groups,a=i.length,o=[],s=[],c=0;c<a;++c)for(var l=i[c],u=l.length,d,f=0;f<u;++f)if(d=l[f]){for(var p=e.call(d,d.__data__,f,l),m,h=G(d,r),g=0,_=p.length;g<_;++g)(m=p[g])&&Pc(m,n,r,g,p,h);o.push(p),s.push(d)}return new Hl(o,s,n,r)}var Sl=rs.prototype.constructor;function Cl(){return new Sl(this._groups,this._parents)}function wl(e,n){var r,i,a;return function(){var o=uo(this,e),s=(this.style.removeProperty(e),uo(this,e));return o===s?null:o===r&&s===i?a:a=n(r=o,i=s)}}function Tl(e){return function(){this.style.removeProperty(e)}}function El(e,n,r){var i,a=r+``,o;return function(){var s=uo(this,e);return s===a?null:s===i?o:o=n(i=s,r)}}function Dl(e,n,r){var i,a,o;return function(){var s=uo(this,e),c=r(this),l=c+``;return c??(l=c=(this.style.removeProperty(e),uo(this,e))),s===l?null:s===i&&l===a?o:(a=l,o=n(i=s,c))}}function Ol(e,n){var r,i,a,o=`style.`+n,s=`end.`+o,c;return function(){var l=Ic(this,e),u=l.on,d=l.value[o]==null?c||=Tl(n):void 0;(u!==r||a!==d)&&(i=(r=u).copy()).on(s,a=d),l.on=i}}function kl(e,n,r){var i=(e+=``)==`transform`?si:Wc;return n==null?this.styleTween(e,wl(e,i)).on(`end.style.`+e,Tl(e)):typeof n==`function`?this.styleTween(e,Dl(e,i,Uc(this,`style.`+e,n))).each(Ol(this._id,e)):this.styleTween(e,El(e,i,n),r).on(`end.style.`+e,null)}function Al(e,n,r){return function(i){this.style.setProperty(e,n.call(this,i),r)}}function jl(e,n,r){var i,a;function o(){var o=n.apply(this,arguments);return o!==a&&(i=(a=o)&&Al(e,o,r)),i}return o._value=n,o}function Ml(e,n,r){var i=`style.`+(e+=``);if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!=`function`)throw Error();return this.tween(i,jl(e,n,r??``))}function Nl(e){return function(){this.textContent=e}}function Pl(e){return function(){var n=e(this);this.textContent=n??``}}function Fl(e){return this.tween(`text`,typeof e==`function`?Pl(Uc(this,`text`,e)):Nl(e==null?``:e+``))}function Il(e){return function(n){this.textContent=e.call(this,n)}}function Ll(e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&Il(i)),n}return i._value=e,i}function Rl(e){var n=`text`;if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!=`function`)throw Error();return this.tween(n,Ll(e))}function zl(){for(var e=this._name,n=this._id,r=Ul(),i=this._groups,a=i.length,o=0;o<a;++o)for(var s=i[o],c=s.length,l,u=0;u<c;++u)if(l=s[u]){var d=G(l,n);Pc(l,e,r,u,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Hl(i,this._parents,e,r)}function Bl(){var e,n,r=this,i=r._id,a=r.size();return new Promise(function(o,s){var c={value:s},l={value:function(){--a===0&&o()}};r.each(function(){var r=Ic(this,i),a=r.on;a!==e&&(n=(e=a).copy(),n._.cancel.push(c),n._.interrupt.push(c),n._.end.push(l)),r.on=n}),a===0&&o()})}var Vl=0;function Hl(e,n,r,i){this._groups=e,this._parents=n,this._name=r,this._id=i}function Ul(){return++Vl}var Wl=rs.prototype;Hl.prototype={constructor:Hl,select:bl,selectAll:xl,selectChild:Wl.selectChild,selectChildren:Wl.selectChildren,filter:pl,merge:ml,selection:Cl,transition:zl,call:Wl.call,nodes:Wl.nodes,node:Wl.node,size:Wl.size,empty:Wl.empty,each:Wl.each,on:_l,attr:Zc,attrTween:nl,style:kl,styleTween:Ml,text:Fl,textTween:Rl,remove:yl,tween:Hc,delay:al,duration:cl,ease:ul,easeVarying:fl,end:Bl,[Symbol.iterator]:Wl[Symbol.iterator]};function Gl(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Kl={time:null,delay:0,duration:250,ease:Gl};function ql(e,n){for(var r;!(r=e.__transition)||!(r=r[n]);)if(!(e=e.parentNode))throw Error(`transition ${n} not found`);return r}function Jl(e){var n,r;e instanceof Hl?(n=e._id,e=e._name):(n=Ul(),(r=Kl).time=Mt(),e=e==null?null:e+``);for(var i=this._groups,a=i.length,o=0;o<a;++o)for(var s=i[o],c=s.length,l,u=0;u<c;++u)(l=s[u])&&Pc(l,e,n,u,s,r||ql(l,n));return new Hl(i,this._parents,e,n)}rs.prototype.interrupt=zc,rs.prototype.transition=Jl;var Yl=e=>()=>e;function Xl(e,{sourceEvent:n,target:r,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function Zl(e,n,r){this.k=e,this.x=n,this.y=r}Zl.prototype={constructor:Zl,scale:function(e){return e===1?this:new Zl(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Zl(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Ql=new Zl(1,0,0);$l.prototype=Zl.prototype;function $l(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ql;return e.__zoom}function eu(e){e.stopImmediatePropagation()}function tu(e){e.preventDefault(),e.stopImmediatePropagation()}function nu(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function ru(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function iu(){return this.__zoom||Ql}function au(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ou(){return navigator.maxTouchPoints||`ontouchstart`in this}function su(e,n,r){var i=e.invertX(n[0][0])-r[0][0],a=e.invertX(n[1][0])-r[1][0],o=e.invertY(n[0][1])-r[0][1],s=e.invertY(n[1][1])-r[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function cu(){var e=nu,n=ru,r=su,i=au,a=ou,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],c=250,l=pi,u=gt(`start`,`zoom`,`end`),d,f,p,m=500,h=150,g=0,_=10;function v(e){e.property(`__zoom`,iu).on(`wheel.zoom`,T,{passive:!1}).on(`mousedown.zoom`,E).on(`dblclick.zoom`,D).filter(a).on(`touchstart.zoom`,ee).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,te).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}v.transform=function(e,n,r,i){var a=e.selection?e.selection():e;a.property(`__zoom`,iu),e===a?a.interrupt().each(function(){C(this,arguments).event(i).start().zoom(null,typeof n==`function`?n.apply(this,arguments):n).end()}):S(e,n,r,i)},v.scaleBy=function(e,n,r,i){v.scaleTo(e,function(){return this.__zoom.k*(typeof n==`function`?n.apply(this,arguments):n)},r,i)},v.scaleTo=function(e,i,a,o){v.transform(e,function(){var e=n.apply(this,arguments),o=this.__zoom,c=a==null?x(e):typeof a==`function`?a.apply(this,arguments):a,l=o.invert(c),u=typeof i==`function`?i.apply(this,arguments):i;return r(b(y(o,u),c,l),e,s)},a,o)},v.translateBy=function(e,i,a,o){v.transform(e,function(){return r(this.__zoom.translate(typeof i==`function`?i.apply(this,arguments):i,typeof a==`function`?a.apply(this,arguments):a),n.apply(this,arguments),s)},null,o)},v.translateTo=function(e,i,a,o,c){v.transform(e,function(){var e=n.apply(this,arguments),c=this.__zoom,l=o==null?x(e):typeof o==`function`?o.apply(this,arguments):o;return r(Ql.translate(l[0],l[1]).scale(c.k).translate(typeof i==`function`?-i.apply(this,arguments):-i,typeof a==`function`?-a.apply(this,arguments):-a),e,s)},o,c)};function y(e,n){return n=Math.max(o[0],Math.min(o[1],n)),n===e.k?e:new Zl(n,e.x,e.y)}function b(e,n,r){var i=n[0]-r[0]*e.k,a=n[1]-r[1]*e.k;return i===e.x&&a===e.y?e:new Zl(e.k,i,a)}function x(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function S(e,r,i,a){e.on(`start.zoom`,function(){C(this,arguments).event(a).start()}).on(`interrupt.zoom end.zoom`,function(){C(this,arguments).event(a).end()}).tween(`zoom`,function(){var e=this,o=arguments,s=C(e,o).event(a),c=n.apply(e,o),u=i==null?x(c):typeof i==`function`?i.apply(e,o):i,d=Math.max(c[1][0]-c[0][0],c[1][1]-c[0][1]),f=e.__zoom,p=typeof r==`function`?r.apply(e,o):r,m=l(f.invert(u).concat(d/f.k),p.invert(u).concat(d/p.k));return function(e){if(e===1)e=p;else{var n=m(e),r=d/n[2];e=new Zl(r,u[0]-n[0]*r,u[1]-n[1]*r)}s.zoom(null,e)}})}function C(e,n,r){return!r&&e.__zooming||new w(e,n)}function w(e,r){this.that=e,this.args=r,this.active=0,this.sourceEvent=null,this.extent=n.apply(e,r),this.taps=0}w.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,n){return this.mouse&&e!==`mouse`&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var n=U(this.that).datum();u.call(e,this.that,new Xl(e,{sourceEvent:this.sourceEvent,target:v,type:e,transform:this.that.__zoom,dispatch:u}),n)}};function T(n,...a){if(!e.apply(this,arguments))return;var c=C(this,a).event(n),l=this.__zoom,u=Math.max(o[0],Math.min(o[1],l.k*2**i.apply(this,arguments))),d=os(n);if(c.wheel)(c.mouse[0][0]!==d[0]||c.mouse[0][1]!==d[1])&&(c.mouse[1]=l.invert(c.mouse[0]=d)),clearTimeout(c.wheel);else if(l.k===u)return;else c.mouse=[d,l.invert(d)],Rc(this),c.start();tu(n),c.wheel=setTimeout(f,h),c.zoom(`mouse`,r(b(y(l,u),c.mouse[0],c.mouse[1]),c.extent,s));function f(){c.wheel=null,c.end()}}function E(n,...i){if(p||!e.apply(this,arguments))return;var a=n.currentTarget,o=C(this,i,!0).event(n),c=U(n.view).on(`mousemove.zoom`,f,!0).on(`mouseup.zoom`,m,!0),l=os(n,a),u=n.clientX,d=n.clientY;Cc(n.view),eu(n),o.mouse=[l,this.__zoom.invert(l)],Rc(this),o.start();function f(e){if(tu(e),!o.moved){var n=e.clientX-u,i=e.clientY-d;o.moved=n*n+i*i>g}o.event(e).zoom(`mouse`,r(b(o.that.__zoom,o.mouse[0]=os(e,a),o.mouse[1]),o.extent,s))}function m(e){c.on(`mousemove.zoom mouseup.zoom`,null),wc(e.view,o.moved),tu(e),o.event(e).end()}}function D(i,...a){if(e.apply(this,arguments)){var o=this.__zoom,l=os(i.changedTouches?i.changedTouches[0]:i,this),u=o.invert(l),d=o.k*(i.shiftKey?.5:2),f=r(b(y(o,d),l,u),n.apply(this,a),s);tu(i),c>0?U(this).transition().duration(c).call(S,f,l,i):U(this).call(v.transform,f,l,i)}}function ee(n,...r){if(e.apply(this,arguments)){var i=n.touches,a=i.length,o=C(this,r,n.changedTouches.length===a).event(n),s,c,l,u;for(eu(n),c=0;c<a;++c)l=i[c],u=os(l,this),u=[u,this.__zoom.invert(u),l.identifier],o.touch0?!o.touch1&&o.touch0[2]!==u[2]&&(o.touch1=u,o.taps=0):(o.touch0=u,s=!0,o.taps=1+!!d);d&&=clearTimeout(d),s&&(o.taps<2&&(f=u[0],d=setTimeout(function(){d=null},m)),Rc(this),o.start())}}function O(e,...n){if(this.__zooming){var i=C(this,n).event(e),a=e.changedTouches,o=a.length,c,l,u,d;for(tu(e),c=0;c<o;++c)l=a[c],u=os(l,this),i.touch0&&i.touch0[2]===l.identifier?i.touch0[0]=u:i.touch1&&i.touch1[2]===l.identifier&&(i.touch1[0]=u);if(l=i.that.__zoom,i.touch1){var f=i.touch0[0],p=i.touch0[1],m=i.touch1[0],h=i.touch1[1],g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g,_=(_=h[0]-p[0])*_+(_=h[1]-p[1])*_;l=y(l,Math.sqrt(g/_)),u=[(f[0]+m[0])/2,(f[1]+m[1])/2],d=[(p[0]+h[0])/2,(p[1]+h[1])/2]}else if(i.touch0)u=i.touch0[0],d=i.touch0[1];else return;i.zoom(`touch`,r(b(l,u,d),i.extent,s))}}function te(e,...n){if(this.__zooming){var r=C(this,n).event(e),i=e.changedTouches,a=i.length,o,s;for(eu(e),p&&clearTimeout(p),p=setTimeout(function(){p=null},m),o=0;o<a;++o)s=i[o],r.touch0&&r.touch0[2]===s.identifier?delete r.touch0:r.touch1&&r.touch1[2]===s.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),r.taps===2&&(s=os(s,this),Math.hypot(f[0]-s[0],f[1]-s[1])<_)){var c=U(this).on(`dblclick.zoom`);c&&c.apply(this,arguments)}}}return v.wheelDelta=function(e){return arguments.length?(i=typeof e==`function`?e:Yl(+e),v):i},v.filter=function(n){return arguments.length?(e=typeof n==`function`?n:Yl(!!n),v):e},v.touchable=function(e){return arguments.length?(a=typeof e==`function`?e:Yl(!!e),v):a},v.extent=function(e){return arguments.length?(n=typeof e==`function`?e:Yl([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),v):n},v.scaleExtent=function(e){return arguments.length?(o[0]=+e[0],o[1]=+e[1],v):[o[0],o[1]]},v.translateExtent=function(e){return arguments.length?(s[0][0]=+e[0][0],s[1][0]=+e[1][0],s[0][1]=+e[0][1],s[1][1]=+e[1][1],v):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},v.constrain=function(e){return arguments.length?(r=e,v):r},v.duration=function(e){return arguments.length?(c=+e,v):c},v.interpolate=function(e){return arguments.length?(l=e,v):l},v.on=function(){var e=u.on.apply(u,arguments);return e===u?v:e},v.clickDistance=function(e){return arguments.length?(g=(e=+e)*e,v):Math.sqrt(g)},v.tapDistance=function(e){return arguments.length?(_=+e,v):_},v}var lu=`Expected a function`;function uu(e,n,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(lu);return nn(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),In(e,n,{leading:i,maxWait:n,trailing:a})}function du(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function fu(e){if(Array.isArray(e))return du(e)}function pu(e,n,r){if(typeof e==`function`?e===n:e.has(n))return arguments.length<3?n:r;throw TypeError(`Private element is not present on this object`)}function mu(e,n){if(n.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function hu(e,n){if(!(e instanceof n))throw TypeError(`Cannot call a class as a function`)}function K(e,n){return e.get(pu(e,n))}function gu(e,n,r){mu(e,n),n.set(e,r)}function _u(e,n,r){return e.set(pu(e,n),r),r}function vu(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,`value`in i&&(i.writable=!0),Object.defineProperty(e,wu(i.key),i)}}function yu(e,n,r){return n&&vu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bu(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function xu(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Su(e){return fu(e)||bu(e)||Tu(e)||xu()}function Cu(e,n){if(typeof e!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}function wu(e){var n=Cu(e,`string`);return typeof n==`symbol`?n:n+``}function Tu(e,n){if(e){if(typeof e==`string`)return du(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?du(e,n):void 0}}var Eu=123,Du=function(e){return`#${Math.min(e,2**24).toString(16).padStart(6,`0`)}`},Ou=function(e,n,r){return(e<<16)+(n<<8)+r},ku=function(e){var n=L(e).toRgb(),r=n.r,i=n.g,a=n.b;return Ou(r,i,a)},Au=function(e,n){return e*Eu%2**n},ju=new WeakMap,Mu=new WeakMap,Nu=function(){function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6;hu(this,e),gu(this,ju,void 0),gu(this,Mu,void 0),_u(Mu,this,n),this.reset()}return yu(e,[{key:`reset`,value:function(){_u(ju,this,[`__reserved for background__`])}},{key:`register`,value:function(e){if(K(ju,this).length>=2**(24-K(Mu,this)))return null;var n=K(ju,this).length,r=Du(n+(Au(n,K(Mu,this))<<24-K(Mu,this)));return K(ju,this).push(e),r}},{key:`lookup`,value:function(e){if(!e)return null;var n=typeof e==`string`?ku(e):Ou.apply(void 0,Su(e));if(!n)return null;var r=n&2**(24-K(Mu,this))-1,i=n>>24-K(Mu,this)&2**K(Mu,this)-1;return Au(r,K(Mu,this))!==i||r>=K(ju,this).length?null:K(ju,this)[r]}}])}(),{abs:Pu,cos:Fu,sin:Iu,acos:Lu,atan2:Ru,sqrt:zu,pow:q}=Math;function Bu(e){return e<0?-q(-e,1/3):q(e,1/3)}var Vu=Math.PI,Hu=2*Vu,Uu=Vu/2,Wu=1e-6,Gu=2**53-1||9007199254740991,Ku=-(2**53-1)||-9007199254740991,qu={x:0,y:0,z:0},J={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(e,n){let r=n(e),i=r.x*r.x+r.y*r.y;return r.z!==void 0&&(i+=r.z*r.z),zu(i)},compute:function(e,n,r){if(e===0)return n[0].t=0,n[0];let i=n.length-1;if(e===1)return n[i].t=1,n[i];let a=1-e,o=n;if(i===0)return n[0].t=e,n[0];if(i===1){let n={x:a*o[0].x+e*o[1].x,y:a*o[0].y+e*o[1].y,t:e};return r&&(n.z=a*o[0].z+e*o[1].z),n}if(i<4){let n=a*a,s=e*e,c,l,u,d=0;i===2?(o=[o[0],o[1],o[2],qu],c=n,l=a*e*2,u=s):i===3&&(c=n*a,l=n*e*3,u=a*s*3,d=e*s);let f={x:c*o[0].x+l*o[1].x+u*o[2].x+d*o[3].x,y:c*o[0].y+l*o[1].y+u*o[2].y+d*o[3].y,t:e};return r&&(f.z=c*o[0].z+l*o[1].z+u*o[2].z+d*o[3].z),f}let s=JSON.parse(JSON.stringify(n));for(;s.length>1;){for(let n=0;n<s.length-1;n++)s[n]={x:s[n].x+(s[n+1].x-s[n].x)*e,y:s[n].y+(s[n+1].y-s[n].y)*e},s[n].z!==void 0&&(s[n].z=s[n].z+(s[n+1].z-s[n].z)*e);s.splice(s.length-1,1)}return s[0].t=e,s[0]},computeWithRatios:function(e,n,r,i){let a=1-e,o=r,s=n,c=o[0],l=o[1],u=o[2],d=o[3],f;if(c*=a,l*=e,s.length===2)return f=c+l,{x:(c*s[0].x+l*s[1].x)/f,y:(c*s[0].y+l*s[1].y)/f,z:i?(c*s[0].z+l*s[1].z)/f:!1,t:e};if(c*=a,l*=2*a,u*=e*e,s.length===3)return f=c+l+u,{x:(c*s[0].x+l*s[1].x+u*s[2].x)/f,y:(c*s[0].y+l*s[1].y+u*s[2].y)/f,z:i?(c*s[0].z+l*s[1].z+u*s[2].z)/f:!1,t:e};if(c*=a,l*=1.5*a,u*=3*a,d*=e*e*e,s.length===4)return f=c+l+u+d,{x:(c*s[0].x+l*s[1].x+u*s[2].x+d*s[3].x)/f,y:(c*s[0].y+l*s[1].y+u*s[2].y+d*s[3].y)/f,z:i?(c*s[0].z+l*s[1].z+u*s[2].z+d*s[3].z)/f:!1,t:e}},derive:function(e,n){let r=[];for(let i=e,a=i.length,o=a-1;a>1;a--,o--){let e=[];for(let r=0,a;r<o;r++)a={x:o*(i[r+1].x-i[r].x),y:o*(i[r+1].y-i[r].y)},n&&(a.z=o*(i[r+1].z-i[r].z)),e.push(a);r.push(e),i=e}return r},between:function(e,n,r){return n<=e&&e<=r||J.approximately(e,n)||J.approximately(e,r)},approximately:function(e,n,r){return Pu(e-n)<=(r||Wu)},length:function(e){let n=.5,r=J.Tvalues.length,i=0;for(let a=0,o;a<r;a++)o=n*J.Tvalues[a]+n,i+=J.Cvalues[a]*J.arcfn(o,e);return n*i},map:function(e,n,r,i,a){let o=r-n;return i+(a-i)*((e-n)/o)},lerp:function(e,n,r){let i={x:n.x+e*(r.x-n.x),y:n.y+e*(r.y-n.y)};return n.z!==void 0&&r.z!==void 0&&(i.z=n.z+e*(r.z-n.z)),i},pointToString:function(e){let n=e.x+`/`+e.y;return e.z!==void 0&&(n+=`/`+e.z),n},pointsToString:function(e){return`[`+e.map(J.pointToString).join(`, `)+`]`},copy:function(e){return JSON.parse(JSON.stringify(e))},angle:function(e,n,r){let i=n.x-e.x,a=n.y-e.y,o=r.x-e.x,s=r.y-e.y;return Ru(i*s-a*o,i*o+a*s)},round:function(e,n){let r=``+e,i=r.indexOf(`.`);return parseFloat(r.substring(0,i+1+n))},dist:function(e,n){let r=e.x-n.x,i=e.y-n.y;return zu(r*r+i*i)},closest:function(e,n){let r=q(2,63),i,a;return e.forEach(function(e,o){a=J.dist(n,e),a<r&&(r=a,i=o)}),{mdist:r,mpos:i}},abcratio:function(e,n){if(n!==2&&n!==3)return!1;if(e===void 0)e=.5;else if(e===0||e===1)return e;let r=q(e,n)+q(1-e,n);return Pu((r-1)/r)},projectionratio:function(e,n){if(n!==2&&n!==3)return!1;if(e===void 0)e=.5;else if(e===0||e===1)return e;let r=q(1-e,n);return r/(q(e,n)+r)},lli8:function(e,n,r,i,a,o,s,c){let l=(e*i-n*r)*(a-s)-(e-r)*(a*c-o*s),u=(e*i-n*r)*(o-c)-(n-i)*(a*c-o*s),d=(e-r)*(o-c)-(n-i)*(a-s);return d!=0&&{x:l/d,y:u/d}},lli4:function(e,n,r,i){let a=e.x,o=e.y,s=n.x,c=n.y,l=r.x,u=r.y,d=i.x,f=i.y;return J.lli8(a,o,s,c,l,u,d,f)},lli:function(e,n){return J.lli4(e,e.c,n,n.c)},makeline:function(e,n){return new rd(e.x,e.y,(e.x+n.x)/2,(e.y+n.y)/2,n.x,n.y)},findbbox:function(e){let n=Gu,r=Gu,i=Ku,a=Ku;return e.forEach(function(e){let o=e.bbox();n>o.x.min&&(n=o.x.min),r>o.y.min&&(r=o.y.min),i<o.x.max&&(i=o.x.max),a<o.y.max&&(a=o.y.max)}),{x:{min:n,mid:(n+i)/2,max:i,size:i-n},y:{min:r,mid:(r+a)/2,max:a,size:a-r}}},shapeintersections:function(e,n,r,i,a){if(!J.bboxoverlap(n,i))return[];let o=[],s=[e.startcap,e.forward,e.back,e.endcap],c=[r.startcap,r.forward,r.back,r.endcap];return s.forEach(function(n){n.virtual||c.forEach(function(i){if(i.virtual)return;let s=n.intersects(i,a);s.length>0&&(s.c1=n,s.c2=i,s.s1=e,s.s2=r,o.push(s))})}),o},makeshape:function(e,n,r){let i=n.points.length,a=e.points.length,o=J.makeline(n.points[i-1],e.points[0]),s=J.makeline(e.points[a-1],n.points[0]),c={startcap:o,forward:e,back:n,endcap:s,bbox:J.findbbox([o,e,n,s])};return c.intersections=function(e){return J.shapeintersections(c,c.bbox,e,e.bbox,r)},c},getminmax:function(e,n,r){if(!r)return{min:0,max:0};let i=Gu,a=Ku,o,s;r.indexOf(0)===-1&&(r=[0].concat(r)),r.indexOf(1)===-1&&r.push(1);for(let c=0,l=r.length;c<l;c++)o=r[c],s=e.get(o),s[n]<i&&(i=s[n]),s[n]>a&&(a=s[n]);return{min:i,mid:(i+a)/2,max:a,size:a-i}},align:function(e,n){let r=n.p1.x,i=n.p1.y,a=-Ru(n.p2.y-i,n.p2.x-r);return e.map(function(e){return{x:(e.x-r)*Fu(a)-(e.y-i)*Iu(a),y:(e.x-r)*Iu(a)+(e.y-i)*Fu(a)}})},roots:function(e,n){n||={p1:{x:0,y:0},p2:{x:1,y:0}};let r=e.length-1,i=J.align(e,n),a=function(e){return 0<=e&&e<=1};if(r===2){let e=i[0].y,n=i[1].y,r=i[2].y,o=e-2*n+r;if(o!==0){let i=-zu(n*n-e*r),s=-e+n;return[-(i+s)/o,-(-i+s)/o].filter(a)}return n!==r&&o===0?[(2*n-r)/(2*n-2*r)].filter(a):[]}let o=i[0].y,s=i[1].y,c=i[2].y,l=i[3].y,u=-o+3*s-3*c+l,d=3*o-6*s+3*c,f=-3*o+3*s,p=o;if(J.approximately(u,0)){if(J.approximately(d,0))return J.approximately(f,0)?[]:[-p/f].filter(a);let e=zu(f*f-4*d*p),n=2*d;return[(e-f)/n,(-f-e)/n].filter(a)}d/=u,f/=u,p/=u;let m=(3*f-d*d)/3,h=m/3,g=(2*d*d*d-9*d*f+27*p)/27,_=g/2,v=_*_+h*h*h,y,b,x,S,C;if(v<0){let e=-m/3,n=zu(e*e*e),r=-g/(2*n),i=Lu(r<-1?-1:r>1?1:r),o=2*Bu(n);return x=o*Fu(i/3)-d/3,S=o*Fu((i+Hu)/3)-d/3,C=o*Fu((i+2*Hu)/3)-d/3,[x,S,C].filter(a)}if(v===0)return y=_<0?Bu(-_):-Bu(_),x=2*y-d/3,S=-y-d/3,[x,S].filter(a);{let e=zu(v);return y=Bu(-_+e),b=Bu(_+e),[y-b-d/3].filter(a)}},droots:function(e){if(e.length===3){let n=e[0],r=e[1],i=e[2],a=n-2*r+i;if(a!==0){let e=-zu(r*r-n*i),o=-n+r;return[-(e+o)/a,-(-e+o)/a]}return r!==i&&a===0?[(2*r-i)/(2*(r-i))]:[]}if(e.length===2){let n=e[0],r=e[1];return n===r?[]:[n/(n-r)]}return[]},curvature:function(e,n,r,i,a){let o,s,c,l,u=0,d=0,f=J.compute(e,n),p=J.compute(e,r),m=f.x*f.x+f.y*f.y;if(i?(o=zu(q(f.y*p.z-p.y*f.z,2)+q(f.z*p.x-p.z*f.x,2)+q(f.x*p.y-p.x*f.y,2)),s=q(m+f.z*f.z,3/2)):(o=f.x*p.y-f.y*p.x,s=q(m,3/2)),o===0||s===0)return{k:0,r:0};if(u=o/s,d=s/o,!a){let a=J.curvature(e-.001,n,r,i,!0).k,o=J.curvature(e+.001,n,r,i,!0).k;l=(o-u+(u-a))/2,c=(Pu(o-u)+Pu(u-a))/2}return{k:u,r:d,dk:l,adk:c}},inflections:function(e){if(e.length<4)return[];let n=J.align(e,{p1:e[0],p2:e.slice(-1)[0]}),r=n[2].x*n[1].y,i=n[3].x*n[1].y,a=n[1].x*n[2].y,o=n[3].x*n[2].y,s=18*(-3*r+2*i+3*a-o),c=18*(3*r-i-3*a),l=18*(a-r);if(J.approximately(s,0)){if(!J.approximately(c,0)){let e=-l/c;if(0<=e&&e<=1)return[e]}return[]}let u=2*s;if(J.approximately(u,0))return[];let d=c*c-4*s*l;if(d<0)return[];let f=Math.sqrt(d);return[(f-c)/u,-(c+f)/u].filter(function(e){return 0<=e&&e<=1})},bboxoverlap:function(e,n){let r=[`x`,`y`],i=r.length;for(let a=0,o,s,c,l;a<i;a++)if(o=r[a],s=e[o].mid,c=n[o].mid,l=(e[o].size+n[o].size)/2,Pu(s-c)>=l)return!1;return!0},expandbox:function(e,n){n.x.min<e.x.min&&(e.x.min=n.x.min),n.y.min<e.y.min&&(e.y.min=n.y.min),n.z&&n.z.min<e.z.min&&(e.z.min=n.z.min),n.x.max>e.x.max&&(e.x.max=n.x.max),n.y.max>e.y.max&&(e.y.max=n.y.max),n.z&&n.z.max>e.z.max&&(e.z.max=n.z.max),e.x.mid=(e.x.min+e.x.max)/2,e.y.mid=(e.y.min+e.y.max)/2,e.z&&(e.z.mid=(e.z.min+e.z.max)/2),e.x.size=e.x.max-e.x.min,e.y.size=e.y.max-e.y.min,e.z&&(e.z.size=e.z.max-e.z.min)},pairiteration:function(e,n,r){let i=e.bbox(),a=n.bbox(),o=1e5,s=r||.5;if(i.x.size+i.y.size<s&&a.x.size+a.y.size<s)return[(o*(e._t1+e._t2)/2|0)/o+`/`+(o*(n._t1+n._t2)/2|0)/o];let c=e.split(.5),l=n.split(.5),u=[{left:c.left,right:l.left},{left:c.left,right:l.right},{left:c.right,right:l.right},{left:c.right,right:l.left}];u=u.filter(function(e){return J.bboxoverlap(e.left.bbox(),e.right.bbox())});let d=[];return u.length===0?d:(u.forEach(function(e){d=d.concat(J.pairiteration(e.left,e.right,s))}),d=d.filter(function(e,n){return d.indexOf(e)===n}),d)},getccenter:function(e,n,r){let i=n.x-e.x,a=n.y-e.y,o=r.x-n.x,s=r.y-n.y,c=i*Fu(Uu)-a*Iu(Uu),l=i*Iu(Uu)+a*Fu(Uu),u=o*Fu(Uu)-s*Iu(Uu),d=o*Iu(Uu)+s*Fu(Uu),f=(e.x+n.x)/2,p=(e.y+n.y)/2,m=(n.x+r.x)/2,h=(n.y+r.y)/2,g=f+c,_=p+l,v=m+u,y=h+d,b=J.lli8(f,p,g,_,m,h,v,y),x=J.dist(b,e),S=Ru(e.y-b.y,e.x-b.x),C=Ru(n.y-b.y,n.x-b.x),w=Ru(r.y-b.y,r.x-b.x),T;return S<w?((S>C||C>w)&&(S+=Hu),S>w&&(T=w,w=S,S=T)):w<C&&C<S?(T=w,w=S,S=T):w+=Hu,b.s=S,b.e=w,b.r=x,b},numberSort:function(e,n){return e-n}},Ju=class e{constructor(e){this.curves=[],this._3d=!1,e&&(this.curves=e,this._3d=this.curves[0]._3d)}valueOf(){return this.toString()}toString(){return`[`+this.curves.map(function(e){return J.pointsToString(e.points)}).join(`, `)+`]`}addCurve(e){this.curves.push(e),this._3d=this._3d||e._3d}length(){return this.curves.map(function(e){return e.length()}).reduce(function(e,n){return e+n})}curve(e){return this.curves[e]}bbox(){let e=this.curves;for(var n=e[0].bbox(),r=1;r<e.length;r++)J.expandbox(n,e[r].bbox());return n}offset(n){let r=[];return this.curves.forEach(function(e){r.push(...e.offset(n))}),new e(r)}},{abs:Yu,min:Xu,max:Zu,cos:Qu,sin:$u,acos:ed,sqrt:td}=Math,nd=Math.PI,rd=class e{constructor(e){let n=e&&e.forEach?e:Array.from(arguments).slice(),r=!1;if(typeof n[0]==`object`){r=n.length;let e=[];n.forEach(function(n){[`x`,`y`,`z`].forEach(function(r){n[r]!==void 0&&e.push(n[r])})}),n=e}let i=!1,a=n.length;if(r){if(r>4){if(arguments.length!==1)throw Error(`Only new Bezier(point[]) is accepted for 4th and higher order curves`);i=!0}}else if(a!==6&&a!==8&&a!==9&&a!==12&&arguments.length!==1)throw Error(`Only new Bezier(point[]) is accepted for 4th and higher order curves`);let o=this._3d=!i&&(a===9||a===12)||e&&e[0]&&e[0].z!==void 0,s=this.points=[];for(let e=0,r=o?3:2;e<a;e+=r){var c={x:n[e],y:n[e+1]};o&&(c.z=n[e+2]),s.push(c)}let l=this.order=s.length-1,u=this.dims=[`x`,`y`];o&&u.push(`z`),this.dimlen=u.length;let d=J.align(s,{p1:s[0],p2:s[l]}),f=J.dist(s[0],s[l]);this._linear=d.reduce((e,n)=>e+Yu(n.y),0)<f/50,this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(n,r,i,a){if(a===void 0&&(a=.5),a===0)return new e(r,r,i);if(a===1)return new e(n,r,r);let o=e.getABC(2,n,r,i,a);return new e(n,o.A,i)}static cubicFromPoints(n,r,i,a,o){a===void 0&&(a=.5);let s=e.getABC(3,n,r,i,a);o===void 0&&(o=J.dist(r,s.C));let c=o*(1-a)/a,l=J.dist(n,i),u=(i.x-n.x)/l,d=(i.y-n.y)/l,f=o*u,p=o*d,m=c*u,h=c*d,g={x:r.x-f,y:r.y-p},_={x:r.x+m,y:r.y+h},v=s.A,y={x:v.x+(g.x-v.x)/(1-a),y:v.y+(g.y-v.y)/(1-a)},b={x:v.x+(_.x-v.x)/a,y:v.y+(_.y-v.y)/a},x={x:n.x+(y.x-n.x)/a,y:n.y+(y.y-n.y)/a},S={x:i.x+(b.x-i.x)/(1-a),y:i.y+(b.y-i.y)/(1-a)};return new e(n,x,S,i)}static getUtils(){return J}getUtils(){return e.getUtils()}static get PolyBezier(){return Ju}valueOf(){return this.toString()}toString(){return J.pointsToString(this.points)}toSVG(){if(this._3d)return!1;let e=this.points,n=[`M`,e[0].x,e[0].y,this.order===2?`Q`:`C`];for(let r=1,i=e.length;r<i;r++)n.push(e[r].x),n.push(e[r].y);return n.join(` `)}setRatios(e){if(e.length!==this.points.length)throw Error(`incorrect number of ratio values`);this.ratios=e,this._lut=[]}verify(){let e=this.coordDigest();e!==this._print&&(this._print=e,this.update())}coordDigest(){return this.points.map(function(e,n){return``+n+e.x+e.y+(e.z?e.z:0)}).join(``)}update(){this._lut=[],this.dpoints=J.derive(this.points,this._3d),this.computedirection()}computedirection(){let e=this.points,n=J.angle(e[0],e[this.order],e[1]);this.clockwise=n>0}length(){return J.length(this.derivative.bind(this))}static getABC(e=2,n,r,i,a=.5){let o=J.projectionratio(a,e),s=1-o,c={x:o*n.x+s*i.x,y:o*n.y+s*i.y},l=J.abcratio(a,e);return{A:{x:r.x+(r.x-c.x)/l,y:r.y+(r.y-c.y)/l},B:r,C:c,S:n,E:i}}getABC(n,r){r||=this.get(n);let i=this.points[0],a=this.points[this.order];return e.getABC(this.order,i,r,a,n)}getLUT(e){if(this.verify(),e||=100,this._lut.length===e+1)return this._lut;this._lut=[],e++,this._lut=[];for(let n=0,r,i;n<e;n++)i=n/(e-1),r=this.compute(i),r.t=i,this._lut.push(r);return this._lut}on(e,n){n||=5;let r=this.getLUT(),i=[];for(let a=0,o,s=0;a<r.length;a++)o=r[a],J.dist(o,e)<n&&(i.push(o),s+=a/r.length);return i.length?t/=i.length:!1}project(e){let n=this.getLUT(),r=n.length-1,i=J.closest(n,e),a=i.mpos,o=(a-1)/r,s=(a+1)/r,c=.1/r,l=i.mdist,u=o,d=u,f;l+=1;for(let n;u<s+c;u+=c)f=this.compute(u),n=J.dist(e,f),n<l&&(l=n,d=u);return d=d<0?0:d>1?1:d,f=this.compute(d),f.t=d,f.d=l,f}get(e){return this.compute(e)}point(e){return this.points[e]}compute(e){return this.ratios?J.computeWithRatios(e,this.points,this.ratios,this._3d):J.compute(e,this.points,this._3d,this.ratios)}raise(){let n=this.points,r=[n[0]],i=n.length;for(let e=1,a,o;e<i;e++)a=n[e],o=n[e-1],r[e]={x:(i-e)/i*a.x+e/i*o.x,y:(i-e)/i*a.y+e/i*o.y};return r[i]=n[i-1],new e(r)}derivative(e){return J.compute(e,this.dpoints[0],this._3d)}dderivative(e){return J.compute(e,this.dpoints[1],this._3d)}align(){let n=this.points;return new e(J.align(n,{p1:n[0],p2:n[n.length-1]}))}curvature(e){return J.curvature(e,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return J.inflections(this.points)}normal(e){return this._3d?this.__normal3(e):this.__normal2(e)}__normal2(e){let n=this.derivative(e),r=td(n.x*n.x+n.y*n.y);return{t:e,x:-n.y/r,y:n.x/r}}__normal3(e){let n=this.derivative(e),r=this.derivative(e+.01),i=td(n.x*n.x+n.y*n.y+n.z*n.z),a=td(r.x*r.x+r.y*r.y+r.z*r.z);n.x/=i,n.y/=i,n.z/=i,r.x/=a,r.y/=a,r.z/=a;let o={x:r.y*n.z-r.z*n.y,y:r.z*n.x-r.x*n.z,z:r.x*n.y-r.y*n.x},s=td(o.x*o.x+o.y*o.y+o.z*o.z);o.x/=s,o.y/=s,o.z/=s;let c=[o.x*o.x,o.x*o.y-o.z,o.x*o.z+o.y,o.x*o.y+o.z,o.y*o.y,o.y*o.z-o.x,o.x*o.z-o.y,o.y*o.z+o.x,o.z*o.z];return{t:e,x:c[0]*n.x+c[1]*n.y+c[2]*n.z,y:c[3]*n.x+c[4]*n.y+c[5]*n.z,z:c[6]*n.x+c[7]*n.y+c[8]*n.z}}hull(e){let n=this.points,r=[],i=[],a=0;for(i[a++]=n[0],i[a++]=n[1],i[a++]=n[2],this.order===3&&(i[a++]=n[3]);n.length>1;){r=[];for(let o=0,s,c=n.length-1;o<c;o++)s=J.lerp(e,n[o],n[o+1]),i[a++]=s,r.push(s);n=r}return i}split(n,r){if(n===0&&r)return this.split(r).left;if(r===1)return this.split(n).right;let i=this.hull(n),a={left:this.order===2?new e([i[0],i[3],i[5]]):new e([i[0],i[4],i[7],i[9]]),right:this.order===2?new e([i[5],i[4],i[2]]):new e([i[9],i[8],i[6],i[3]]),span:i};return a.left._t1=J.map(0,0,1,this._t1,this._t2),a.left._t2=J.map(n,0,1,this._t1,this._t2),a.right._t1=J.map(n,0,1,this._t1,this._t2),a.right._t2=J.map(1,0,1,this._t1,this._t2),r?(r=J.map(r,n,1,0,1),a.right.split(r).left):a}extrema(){let e={},n=[];return this.dims.forEach(function(r){let i=function(e){return e[r]},a=this.dpoints[0].map(i);e[r]=J.droots(a),this.order===3&&(a=this.dpoints[1].map(i),e[r]=e[r].concat(J.droots(a))),e[r]=e[r].filter(function(e){return e>=0&&e<=1}),n=n.concat(e[r].sort(J.numberSort))}.bind(this)),e.values=n.sort(J.numberSort).filter(function(e,r){return n.indexOf(e)===r}),e}bbox(){let e=this.extrema(),n={};return this.dims.forEach(function(r){n[r]=J.getminmax(this,r,e[r])}.bind(this)),n}overlaps(e){let n=this.bbox(),r=e.bbox();return J.bboxoverlap(n,r)}offset(n,r){if(r!==void 0){let e=this.get(n),i=this.normal(n),a={c:e,n:i,x:e.x+i.x*r,y:e.y+i.y*r};return this._3d&&(a.z=e.z+i.z*r),a}if(this._linear){let r=this.normal(0),i=this.points.map(function(e){let i={x:e.x+n*r.x,y:e.y+n*r.y};return e.z&&r.z&&(i.z=e.z+n*r.z),i});return[new e(i)]}return this.reduce().map(function(e){return e._linear?e.offset(n)[0]:e.scale(n)})}simple(){if(this.order===3){let e=J.angle(this.points[0],this.points[3],this.points[1]),n=J.angle(this.points[0],this.points[3],this.points[2]);if(e>0&&n<0||e<0&&n>0)return!1}let e=this.normal(0),n=this.normal(1),r=e.x*n.x+e.y*n.y;return this._3d&&(r+=e.z*n.z),Yu(ed(r))<nd/3}reduce(){let e,n=0,r=0,i=.01,a,o=[],s=[],c=this.extrema().values;for(c.indexOf(0)===-1&&(c=[0].concat(c)),c.indexOf(1)===-1&&c.push(1),n=c[0],e=1;e<c.length;e++)r=c[e],a=this.split(n,r),a._t1=n,a._t2=r,o.push(a),n=r;return o.forEach(function(e){for(n=0,r=0;r<=1;)for(r=n+i;r<=1.01;r+=i)if(a=e.split(n,r),!a.simple()){if(r-=i,Yu(n-r)<i)return[];a=e.split(n,r),a._t1=J.map(n,0,1,e._t1,e._t2),a._t2=J.map(r,0,1,e._t1,e._t2),s.push(a),n=r;break}n<1&&(a=e.split(n,1),a._t1=J.map(n,0,1,e._t1,e._t2),a._t2=e._t2,s.push(a))}),s}translate(n,r,i){i=typeof i==`number`?i:r;let a=this.order,o=this.points.map((e,n)=>(1-n/a)*r+n/a*i);return new e(this.points.map((e,r)=>({x:e.x+n.x*o[r],y:e.y+n.y*o[r]})))}scale(n){let r=this.order,i=!1;if(typeof n==`function`&&(i=n),i&&r===2)return this.raise().scale(i);let a=this.clockwise,o=this.points;if(this._linear)return this.translate(this.normal(0),i?i(0):n,i?i(1):n);let s=i?i(0):n,c=i?i(1):n,l=[this.offset(0,10),this.offset(1,10)],u=[],d=J.lli4(l[0],l[0].c,l[1],l[1].c);if(!d)throw Error(`cannot scale this curve. Try reducing it first.`);return[0,1].forEach(function(e){let n=u[e*r]=J.copy(o[e*r]);n.x+=(e?c:s)*l[e].n.x,n.y+=(e?c:s)*l[e].n.y}),i?([0,1].forEach(function(e){if(!(r===2&&e)){var s=o[e+1],c={x:s.x-d.x,y:s.y-d.y},l=i?i((e+1)/r):n;i&&!a&&(l=-l);var f=td(c.x*c.x+c.y*c.y);c.x/=f,c.y/=f,u[e+1]={x:s.x+l*c.x,y:s.y+l*c.y}}}),new e(u)):([0,1].forEach(e=>{if(r===2&&e)return;let n=u[e*r],i=this.derivative(e),a={x:n.x+i.x,y:n.y+i.y};u[e+1]=J.lli4(n,a,d,o[e+1])}),new e(u))}outline(n,r,i,a){if(r=r===void 0?n:r,this._linear){let o=this.normal(0),s=this.points[0],c=this.points[this.points.length-1],l,u,d;i===void 0&&(i=n,a=r),l={x:s.x+o.x*n,y:s.y+o.y*n},d={x:c.x+o.x*i,y:c.y+o.y*i},u={x:(l.x+d.x)/2,y:(l.y+d.y)/2};let f=[l,u,d];l={x:s.x-o.x*r,y:s.y-o.y*r},d={x:c.x-o.x*a,y:c.y-o.y*a},u={x:(l.x+d.x)/2,y:(l.y+d.y)/2};let p=[d,u,l],m=J.makeline(p[2],f[0]),h=J.makeline(f[2],p[0]);return new Ju([m,new e(f),h,new e(p)])}let o=this.reduce(),s=o.length,c=[],l=[],u,d=0,f=this.length(),p=i!==void 0&&a!==void 0;function m(e,n,r,i,a){return function(o){let s=i/r,c=(i+a)/r,l=n-e;return J.map(o,0,1,e+s*l,e+c*l)}}o.forEach(function(e){let o=e.length();p?(c.push(e.scale(m(n,i,f,d,o))),l.push(e.scale(m(-r,-a,f,d,o)))):(c.push(e.scale(n)),l.push(e.scale(-r))),d+=o}),l=l.map(function(e){return u=e.points,e.points=u[3]?[u[3],u[2],u[1],u[0]]:[u[2],u[1],u[0]],e}).reverse();let h=c[0].points[0],g=c[s-1].points[c[s-1].points.length-1],_=l[s-1].points[l[s-1].points.length-1],v=l[0].points[0],y=J.makeline(_,h),b=J.makeline(g,v);return new Ju([y].concat(c,[b],l))}outlineshapes(e,n,r){n||=e;let i=this.outline(e,n).curves,a=[];for(let e=1,n=i.length;e<n/2;e++){let o=J.makeshape(i[e],i[n-e],r);o.startcap.virtual=e>1,o.endcap.virtual=e<n/2-1,a.push(o)}return a}intersects(n,r){return n?n.p1&&n.p2?this.lineIntersects(n):(n instanceof e&&(n=n.reduce()),this.curveintersects(this.reduce(),n,r)):this.selfintersects(r)}lineIntersects(e){let n=Xu(e.p1.x,e.p2.x),r=Xu(e.p1.y,e.p2.y),i=Zu(e.p1.x,e.p2.x),a=Zu(e.p1.y,e.p2.y);return J.roots(this.points,e).filter(e=>{var o=this.get(e);return J.between(o.x,n,i)&&J.between(o.y,r,a)})}selfintersects(e){let n=this.reduce(),r=n.length-2,i=[];for(let a=0,o,s,c;a<r;a++)s=n.slice(a,a+1),c=n.slice(a+2),o=this.curveintersects(s,c,e),i.push(...o);return i}curveintersects(e,n,r){let i=[];e.forEach(function(e){n.forEach(function(n){e.overlaps(n)&&i.push({left:e,right:n})})});let a=[];return i.forEach(function(e){let n=J.pairiteration(e.left,e.right,r);n.length>0&&(a=a.concat(n))}),a}arcs(e){return e||=.5,this._iterate(e,[])}_error(e,n,r,i){let a=(i-r)/4,o=this.get(r+a),s=this.get(i-a),c=J.dist(e,n),l=J.dist(e,o),u=J.dist(e,s);return Yu(l-c)+Yu(u-c)}_iterate(e,n){let r=0,i=1,a;do{a=0,i=1;let o=this.get(r),s,c,l,u,d=!1,f=!1,p,m=i,h=1,g=0;do if(f=d,u=l,m=(r+i)/2,g++,s=this.get(m),c=this.get(i),l=J.getccenter(o,s,c),l.interval={start:r,end:i},d=this._error(l,o,r,i)<=e,p=f&&!d,p||(h=i),d){if(i>=1){if(l.interval.end=h=1,u=l,i>1){let e={x:l.x+l.r*Qu(l.e),y:l.y+l.r*$u(l.e)};l.e+=J.angle({x:l.x,y:l.y},e,this.get(1))}break}i+=(i-r)/2}else i=m;while(!p&&a++<100);if(a>=100)break;u||=l,n.push(u),r=h}while(i<1);return n}};function id(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function ad(e){if(Array.isArray(e))return e}function od(e){if(Array.isArray(e))return id(e)}function sd(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function cd(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n!==0)for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function ld(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ud(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dd(e,n){if(e==null)return{};var r,i,a=fd(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],n.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function fd(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.includes(i))continue;r[i]=e[i]}return r}function pd(e,n){return ad(e)||cd(e,n)||_d(e,n)||ld()}function md(e){return od(e)||sd(e)||_d(e)||ud()}function hd(e,n){if(typeof e!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}function gd(e){var n=hd(e,`string`);return typeof n==`symbol`?n:n+``}function _d(e,n){if(e){if(typeof e==`string`)return id(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?id(e,n):void 0}}var vd=(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0&&arguments[3],a=(n instanceof Array?n.length?n:[void 0]:[n]).map(function(e){return{keyAccessor:e,isProp:!(e instanceof Function)}}),o=e.reduce(function(e,n){var i=e,o=n;return a.forEach(function(e,n){var s=e.keyAccessor,c=e.isProp,l;if(c){var u=o,d=u[s],f=dd(u,[s].map(gd));l=d,o=f}else l=s(o,n);n+1<a.length?(i.hasOwnProperty(l)||(i[l]={}),i=i[l]):r?(i.hasOwnProperty(l)||(i[l]=[]),i[l].push(o)):i[l]=o}),e},{});r instanceof Function&&(function e(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;i===a.length?Object.keys(n).forEach(function(e){return n[e]=r(n[e])}):Object.values(n).forEach(function(n){return e(n,i+1)})})(o);var s=o;return i&&(s=[],(function e(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];r.length===a.length?s.push({keys:r,vals:n}):Object.entries(n).forEach(function(n){var i=pd(n,2),a=i[0],o=i[1];return e(o,[].concat(md(r),[a]))})})(o),n instanceof Array&&n.length===0&&s.length===1&&(s[0].keys=[])),s});function yd(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>`u`)){var i=document.head||document.getElementsByTagName(`head`)[0],a=document.createElement(`style`);a.type=`text/css`,r===`top`&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}yd(`.force-graph-container canvas {
|
||
display: block;
|
||
user-select: none;
|
||
outline: none;
|
||
-webkit-tap-highlight-color: transparent;
|
||
}
|
||
|
||
.force-graph-container .clickable {
|
||
cursor: pointer;
|
||
}
|
||
|
||
.force-graph-container .grabbable {
|
||
cursor: move;
|
||
cursor: grab;
|
||
cursor: -moz-grab;
|
||
cursor: -webkit-grab;
|
||
}
|
||
|
||
.force-graph-container .grabbable:active {
|
||
cursor: grabbing;
|
||
cursor: -moz-grabbing;
|
||
cursor: -webkit-grabbing;
|
||
}
|
||
`);function bd(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function xd(e){if(Array.isArray(e))return e}function Sd(e){if(Array.isArray(e))return bd(e)}function Cd(e,n,r){if(Td())return Reflect.construct.apply(null,arguments);var i=[null];return i.push.apply(i,n),new(e.bind.apply(e,i))}function wd(e,n,r){return(n=Pd(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Td(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Td=function(){return!!e})()}function Ed(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Dd(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n!==0)for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function Od(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kd(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ad(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function jd(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]==null?{}:arguments[n];n%2?Ad(Object(r),!0).forEach(function(n){wd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ad(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Md(e,n){return xd(e)||Dd(e,n)||Id(e,n)||Od()}function Y(e){return Sd(e)||Ed(e)||Id(e)||kd()}function Nd(e,n){if(typeof e!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function Pd(e){var n=Nd(e,`string`);return typeof n==`symbol`?n:n+``}function Fd(e){"@babel/helpers - typeof";return Fd=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Fd(e)}function Id(e,n){if(e){if(typeof e==`string`)return bd(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bd(e,n):void 0}}var Ld=rr(hi);function Rd(e,n,r){n&&typeof r==`string`&&e.filter(function(e){return!e[r]}).forEach(function(e){e[r]=Ld(n(e))})}function zd(e,n){var r=e.nodes,i=e.links,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=a.nodeFilter,s=o===void 0?function(){return!0}:o,c=a.onLoopError,l=c===void 0?function(e){throw`Invalid DAG structure! Found cycle in node path: ${e.join(` -> `)}.`}:c,u={};r.forEach(function(e){return u[n(e)]={data:e,out:[],depth:-1,skip:!s(e)}}),i.forEach(function(e){var r=e.source,i=e.target,a=l(r),o=l(i);if(!u.hasOwnProperty(a))throw`Missing source node with id: ${a}`;if(!u.hasOwnProperty(o))throw`Missing target node with id: ${o}`;var s=u[a],c=u[o];s.out.push(c);function l(e){return Fd(e)===`object`?n(e):e}});var d=[];return f(Object.values(u)),Object.assign.apply(Object,[{}].concat(Y(Object.entries(u).filter(function(e){return!Md(e,2)[1].skip}).map(function(e){var n=Md(e,2),r=n[0],i=n[1];return wd({},r,i.depth)}))));function f(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=function(){var a=e[o];if(r.indexOf(a)!==-1){var s=[].concat(Y(r.slice(r.indexOf(a))),[a]).map(function(e){return n(e.data)});return d.some(function(e){return e.length===s.length&&e.every(function(e,n){return e===s[n]})})||(d.push(s),l(s)),1}i>a.depth&&(a.depth=i,f(a.out,[].concat(Y(r),[a]),i+ +!a.skip))},o=0,s=e.length;o<s;o++)if(a())continue}}var Bd=2,X=function(e,n){return n.onNeedsRedraw&&n.onNeedsRedraw()},Vd=function(e,n){if(!n.isShadow){var r=F(n.linkDirectionalParticles);n.graphData.links.forEach(function(e){var n=Math.round(Math.abs(r(e)));n?e.__photons=Y(Array(n)).map(function(){return{}}):delete e.__photons})}},Hd=Kn({props:{graphData:{default:{nodes:[],links:[]},onChange:function(e,n){n.engineRunning=!1,Vd(e,n)}},dagMode:{onChange:function(e,n){!e&&(n.graphData.nodes||[]).forEach(function(e){e.fx=e.fy=void 0})}},dagLevelDistance:{},dagNodeFilter:{default:function(e){return!0}},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4,triggerUpdate:!1,onChange:X},nodeId:{default:`id`},nodeVal:{default:`val`,triggerUpdate:!1,onChange:X},nodeColor:{default:`color`,triggerUpdate:!1,onChange:X},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:X},nodeCanvasObjectMode:{default:function(){return`replace`},triggerUpdate:!1,onChange:X},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:X},linkSource:{default:`source`},linkTarget:{default:`target`},linkVisibility:{default:!0,triggerUpdate:!1,onChange:X},linkColor:{default:`color`,triggerUpdate:!1,onChange:X},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:X},linkWidth:{default:1,triggerUpdate:!1,onChange:X},linkCurvature:{default:0,triggerUpdate:!1,onChange:X},linkCanvasObject:{triggerUpdate:!1,onChange:X},linkCanvasObjectMode:{default:function(){return`replace`},triggerUpdate:!1,onChange:X},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:X},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:X},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:X},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:Vd},linkDirectionalParticleSpeed:{default:.01,triggerUpdate:!1},linkDirectionalParticleOffset:{default:0,triggerUpdate:!1},linkDirectionalParticleWidth:{default:4,triggerUpdate:!1},linkDirectionalParticleColor:{triggerUpdate:!1},linkDirectionalParticleCanvasObject:{triggerUpdate:!1},globalScale:{default:1,triggerUpdate:!1},d3AlphaMin:{default:0,triggerUpdate:!1},d3AlphaDecay:{default:.0228,triggerUpdate:!1,onChange:function(e,n){n.forceLayout.alphaDecay(e)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange:function(e,n){n.forceLayout.alphaTarget(e)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange:function(e,n){n.forceLayout.velocityDecay(e)}},warmupTicks:{default:0,triggerUpdate:!1},cooldownTicks:{default:1/0,triggerUpdate:!1},cooldownTime:{default:15e3,triggerUpdate:!1},onUpdate:{default:function(){},triggerUpdate:!1},onFinishUpdate:{default:function(){},triggerUpdate:!1},onEngineTick:{default:function(){},triggerUpdate:!1},onEngineStop:{default:function(){},triggerUpdate:!1},onNeedsRedraw:{triggerUpdate:!1},isShadow:{default:!1,triggerUpdate:!1}},methods:{d3Force:function(e,n,r){return r===void 0?e.forceLayout.force(n):(e.forceLayout.force(n,r),this)},d3ReheatSimulation:function(e){return e.forceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(e){return e.cntTicks=0,e.startTickTime=new Date,e.engineRunning=!0,this},isEngineRunning:function(e){return!!e.engineRunning},tickFrame:function(e){return!e.isShadow&&n(),i(),!e.isShadow&&a(),!e.isShadow&&o(),r(),this;function n(){e.engineRunning&&(++e.cntTicks>e.cooldownTicks||new Date-e.startTickTime>e.cooldownTime||e.d3AlphaMin>0&&e.forceLayout.alpha()<e.d3AlphaMin?(e.engineRunning=!1,e.onEngineStop()):(e.forceLayout.tick(),e.onEngineTick()))}function r(){var n=F(e.nodeVisibility),r=F(e.nodeVal),i=F(e.nodeColor),a=F(e.nodeCanvasObjectMode),o=e.ctx,s=e.isShadow/e.globalScale,c=e.graphData.nodes.filter(n);o.save(),c.forEach(function(n){var c=a(n);if(e.nodeCanvasObject&&(c===`before`||c===`replace`)&&(e.nodeCanvasObject(n,o,e.globalScale),c===`replace`)){o.restore();return}var l=Math.sqrt(Math.max(0,r(n)||1))*e.nodeRelSize+s;o.beginPath(),o.arc(n.x,n.y,l,0,2*Math.PI,!1),o.fillStyle=i(n)||`rgba(31, 120, 180, 0.92)`,o.fill(),e.nodeCanvasObject&&c===`after`&&e.nodeCanvasObject(n,e.ctx,e.globalScale)}),o.restore()}function i(){var n=F(e.linkVisibility),r=F(e.linkColor),i=F(e.linkWidth),a=F(e.linkLineDash),o=F(e.linkCurvature),s=F(e.linkCanvasObjectMode),c=e.ctx,l=e.isShadow*2,u=e.graphData.links.filter(n);u.forEach(_);var d=[],f=[],p=u;if(e.linkCanvasObject){var m=[],h=[];u.forEach(function(e){return({before:d,after:f,replace:m}[s(e)]||h).push(e)}),p=[].concat(Y(d),f,h),d=d.concat(m)}c.save(),d.forEach(function(n){return e.linkCanvasObject(n,c,e.globalScale)}),c.restore();var g=vd(p,[r,i,a]);c.save(),Object.entries(g).forEach(function(n){var r=Md(n,2),i=r[0],o=r[1],s=!i||i===`undefined`?`rgba(0,0,0,0.15)`:i;Object.entries(o).forEach(function(n){var r=Md(n,2),i=r[0],o=r[1],u=(i||1)/e.globalScale+l;Object.entries(o).forEach(function(e){var n=Md(e,2);n[0];var r=n[1],i=a(r[0]);c.beginPath(),r.forEach(function(e){var n=e.source,r=e.target;if(n&&r&&n.hasOwnProperty(`x`)&&r.hasOwnProperty(`x`)){c.moveTo(n.x,n.y);var i=e.__controlPoints;i?c[i.length===2?`quadraticCurveTo`:`bezierCurveTo`].apply(c,Y(i).concat([r.x,r.y])):c.lineTo(r.x,r.y)}}),c.strokeStyle=s,c.lineWidth=u,c.setLineDash(i||[]),c.stroke()})})}),c.restore(),c.save(),f.forEach(function(n){return e.linkCanvasObject(n,c,e.globalScale)}),c.restore();function _(e){var n=o(e);if(!n){e.__controlPoints=null;return}var r=e.source,i=e.target;if(r&&i&&r.hasOwnProperty(`x`)&&i.hasOwnProperty(`x`)){var a=Math.sqrt((i.x-r.x)**2+(i.y-r.y)**2);if(a>0){var s=Math.atan2(i.y-r.y,i.x-r.x),c=a*n,l={x:(r.x+i.x)/2+c*Math.cos(s-Math.PI/2),y:(r.y+i.y)/2+c*Math.sin(s-Math.PI/2)};e.__controlPoints=[l.x,l.y]}else{var u=n*70;e.__controlPoints=[i.x,i.y-u,i.x+u,i.y]}}}}function a(){var n=F(e.linkDirectionalArrowLength),r=F(e.linkDirectionalArrowRelPos),i=F(e.linkVisibility),a=F(e.linkDirectionalArrowColor||e.linkColor),o=F(e.nodeVal),s=e.ctx;s.save(),e.graphData.links.filter(i).forEach(function(i){var c=n(i);if(!(!c||c<0)){var l=i.source,u=i.target;if(l&&u&&l.hasOwnProperty(`x`)&&u.hasOwnProperty(`x`)){var d=Math.sqrt(Math.max(0,o(l)||1))*e.nodeRelSize,f=Math.sqrt(Math.max(0,o(u)||1))*e.nodeRelSize,p=Math.min(1,Math.max(0,r(i))),m=a(i)||`rgba(0,0,0,0.28)`,h=c/1.6/2,g=i.__controlPoints&&Cd(rd,[l.x,l.y].concat(Y(i.__controlPoints),[u.x,u.y])),_=g?function(e){return g.get(e)}:function(e){return{x:l.x+(u.x-l.x)*e||0,y:l.y+(u.y-l.y)*e||0}},v=g?g.length():Math.sqrt((u.x-l.x)**2+(u.y-l.y)**2),y=d+c+(v-d-f-c)*p,b=_(y/v),x=_((y-c)/v),S=_((y-c*.8)/v),C=Math.atan2(b.y-x.y,b.x-x.x)-Math.PI/2;s.beginPath(),s.moveTo(b.x,b.y),s.lineTo(x.x+h*Math.cos(C),x.y+h*Math.sin(C)),s.lineTo(S.x,S.y),s.lineTo(x.x-h*Math.cos(C),x.y-h*Math.sin(C)),s.fillStyle=m,s.fill()}}}),s.restore()}function o(){var n=F(e.linkDirectionalParticles),r=F(e.linkDirectionalParticleSpeed),i=F(e.linkDirectionalParticleOffset),a=F(e.linkDirectionalParticleWidth),o=F(e.linkVisibility),s=F(e.linkDirectionalParticleColor||e.linkColor),c=e.ctx;c.save(),e.graphData.links.filter(o).forEach(function(o){var l=n(o);if(o.hasOwnProperty(`__photons`)&&o.__photons.length){var u=o.source,d=o.target;if(u&&d&&u.hasOwnProperty(`x`)&&d.hasOwnProperty(`x`)){var f=r(o),p=Math.abs(i(o)),m=o.__photons||[],h=Math.max(0,a(o)/2)/Math.sqrt(e.globalScale);c.fillStyle=s(o)||`rgba(0,0,0,0.28)`;var g=o.__controlPoints?Cd(rd,[u.x,u.y].concat(Y(o.__controlPoints),[d.x,d.y])):null,_=0,v=!1;m.forEach(function(n){var r=!!n.__singleHop;if(n.hasOwnProperty(`__progressRatio`)||(n.__progressRatio=r?+(f<0):(_+p)/l),!r&&_++,n.__progressRatio+=f,n.__progressRatio>=1||n.__progressRatio<0){if(!r)n.__progressRatio%=1,n.__progressRatio<0&&n.__progressRatio++;else{v=!0;return}}var i=n.__progressRatio,a=g?g.get(i):{x:u.x+(d.x-u.x)*i||0,y:u.y+(d.y-u.y)*i||0};e.linkDirectionalParticleCanvasObject?e.linkDirectionalParticleCanvasObject(a.x,a.y,o,c,e.globalScale):(c.beginPath(),c.arc(a.x,a.y,h,0,2*Math.PI,!1),c.fill())}),v&&(o.__photons=o.__photons.filter(function(e){return!e.__singleHop||e.__progressRatio<=1&&e.__progressRatio>=0}))}}}),c.restore()}},emitParticle:function(e,n){return n&&(!n.__photons&&(n.__photons=[]),n.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:$t().force(`link`,mt()).force(`charge`,en()).force(`center`,te()).force(`dagRadial`,null).stop(),engineRunning:!1}},init:function(e,n){n.ctx=e},update:function(e,n){e.engineRunning=!1,e.onUpdate(),e.nodeAutoColorBy!==null&&Rd(e.graphData.nodes,F(e.nodeAutoColorBy),e.nodeColor),e.linkAutoColorBy!==null&&Rd(e.graphData.links,F(e.linkAutoColorBy),e.linkColor),e.graphData.links.forEach(function(n){n.source=n[e.linkSource],n.target=n[e.linkTarget]}),e.forceLayout.stop().alpha(1).nodes(e.graphData.nodes);var r=e.forceLayout.force(`link`);r&&r.id(function(n){return n[e.nodeId]}).links(e.graphData.links);var i=e.dagMode&&zd(e.graphData,function(n){return n[e.nodeId]},{nodeFilter:e.dagNodeFilter,onLoopError:e.onDagError||void 0}),a=Math.max.apply(Math,Y(Object.values(i||[]))),o=e.dagLevelDistance||e.graphData.nodes.length/(a||1)*Bd*([`radialin`,`radialout`].indexOf(e.dagMode)===-1?1:.7);if([`lr`,`rl`,`td`,`bu`].includes(n.dagMode)){var s=[`lr`,`rl`].includes(n.dagMode)?`fx`:`fy`;e.graphData.nodes.filter(e.dagNodeFilter).forEach(function(e){return delete e[s]})}if([`lr`,`rl`,`td`,`bu`].includes(e.dagMode)){var c=[`rl`,`bu`].includes(e.dagMode),l=function(n){return(i[n[e.nodeId]]-a/2)*o*(c?-1:1)},u=[`lr`,`rl`].includes(e.dagMode)?`fx`:`fy`;e.graphData.nodes.filter(e.dagNodeFilter).forEach(function(e){return e[u]=l(e)})}e.forceLayout.force(`dagRadial`,[`radialin`,`radialout`].indexOf(e.dagMode)===-1?null:tn(function(n){var r=i[n[e.nodeId]]||-1;return(e.dagMode===`radialin`?a-r:r)*o}).strength(function(n){return+!!e.dagNodeFilter(n)}));for(var d=0;d<e.warmupTicks&&!(e.d3AlphaMin>0&&e.forceLayout.alpha()<e.d3AlphaMin);d++)e.forceLayout.tick();this.resetCountdown(),e.onFinishUpdate()}});function Ud(e,n){var r=e instanceof Array?e:[e],i=new n;return i._destructor&&i._destructor(),{linkProp:function(e){return{default:i[e](),onChange:function(n,i){r.forEach(function(r){return i[r][e](n)})},triggerUpdate:!1}},linkMethod:function(e){return function(n){var i=[...arguments].slice(1),a=[];return r.forEach(function(r){var o=n[r],s=o[e].apply(o,i);s!==o&&a.push(s)}),a.length?a[0]:this}}}}var Wd=800,Gd=4,Kd=5,qd=Ud(`forceGraph`,Hd),Jd=Ud([`forceGraph`,`shadowGraph`],Hd),Yd=Object.assign.apply(Object,Y(`nodeColor.nodeAutoColorBy.nodeCanvasObject.nodeCanvasObjectMode.linkColor.linkAutoColorBy.linkLineDash.linkWidth.linkCanvasObject.linkCanvasObjectMode.linkDirectionalArrowLength.linkDirectionalArrowColor.linkDirectionalArrowRelPos.linkDirectionalParticles.linkDirectionalParticleSpeed.linkDirectionalParticleOffset.linkDirectionalParticleWidth.linkDirectionalParticleColor.linkDirectionalParticleCanvasObject.dagMode.dagLevelDistance.dagNodeFilter.onDagError.d3AlphaMin.d3AlphaDecay.d3VelocityDecay.warmupTicks.cooldownTicks.cooldownTime.onEngineTick.onEngineStop`.split(`.`).map(function(e){return wd({},e,qd.linkProp(e))})).concat(Y([`nodeRelSize`,`nodeId`,`nodeVal`,`nodeVisibility`,`linkSource`,`linkTarget`,`linkVisibility`,`linkCurvature`].map(function(e){return wd({},e,Jd.linkProp(e))})))),Xd=Object.assign.apply(Object,Y([`d3Force`,`d3ReheatSimulation`,`emitParticle`].map(function(e){return wd({},e,qd.linkMethod(e))})));function Zd(e){if(e.canvas){var n=e.canvas.width,r=e.canvas.height;n===300&&r===150&&(n=r=0);var i=window.devicePixelRatio;n/=i,r/=i,[e.canvas,e.shadowCanvas].forEach(function(a){a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.width=e.width*i,a.height=e.height*i,!n&&!r&&a.getContext(`2d`).scale(i,i)});var a=$l(e.canvas).k;e.zoom.translateBy(e.zoom.__baseElem,(e.width-n)/2/a,(e.height-r)/2/a),e.needsRedraw=!0}}function Qd(e){var n=window.devicePixelRatio;e.setTransform(n,0,0,n,0,0)}function $d(e,n,r){e.save(),Qd(e),e.clearRect(0,0,n,r),e.restore()}var ef=Kn({props:jd({width:{default:window.innerWidth,onChange:function(e,n){return Zd(n)},triggerUpdate:!1},height:{default:window.innerHeight,onChange:function(e,n){return Zd(n)},triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:function(e,n){[e.nodes,e.links].every(function(e){return(e||[]).every(function(e){return!e.hasOwnProperty(`__indexColor`)})})&&n.colorTracker.reset(),[{type:`Node`,objs:e.nodes},{type:`Link`,objs:e.links}].forEach(r),n.forceGraph.graphData(e),n.shadowGraph.graphData(e);function r(e){var r=e.type;e.objs.filter(function(e){if(!e.hasOwnProperty(`__indexColor`))return!0;var r=n.colorTracker.lookup(e.__indexColor);return!r||!r.hasOwnProperty(`d`)||r.d!==e}).forEach(function(e){e.__indexColor=n.colorTracker.register({type:r,d:e})})}},triggerUpdate:!1},backgroundColor:{onChange:function(e,n){n.canvas&&e&&(n.canvas.style.background=e)},triggerUpdate:!1},nodeLabel:{default:`name`,triggerUpdate:!1},nodePointerAreaPaint:{onChange:function(e,n){n.shadowGraph.nodeCanvasObject(e?function(n,r,i){return e(n,n.__indexColor,r,i)}:null),n.flushShadowCanvas&&n.flushShadowCanvas()},triggerUpdate:!1},linkPointerAreaPaint:{onChange:function(e,n){n.shadowGraph.linkCanvasObject(e?function(n,r,i){return e(n,n.__indexColor,r,i)}:null),n.flushShadowCanvas&&n.flushShadowCanvas()},triggerUpdate:!1},linkLabel:{default:`name`,triggerUpdate:!1},linkHoverPrecision:{default:4,triggerUpdate:!1},minZoom:{default:.01,onChange:function(e,n){n.zoom.scaleExtent([e,n.zoom.scaleExtent()[1]])},triggerUpdate:!1},maxZoom:{default:1e3,onChange:function(e,n){n.zoom.scaleExtent([n.zoom.scaleExtent()[0],e])},triggerUpdate:!1},enableNodeDrag:{default:!0,triggerUpdate:!1},enableZoomInteraction:{default:!0,triggerUpdate:!1},enablePanInteraction:{default:!0,triggerUpdate:!1},enableZoomPanInteraction:{default:!0,triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange:function(e,n){n.hoverObj=null},triggerUpdate:!1},autoPauseRedraw:{default:!0,triggerUpdate:!1},onNodeDrag:{default:function(){},triggerUpdate:!1},onNodeDragEnd:{default:function(){},triggerUpdate:!1},onNodeClick:{triggerUpdate:!1},onNodeRightClick:{triggerUpdate:!1},onNodeHover:{triggerUpdate:!1},onLinkClick:{triggerUpdate:!1},onLinkRightClick:{triggerUpdate:!1},onLinkHover:{triggerUpdate:!1},onBackgroundClick:{triggerUpdate:!1},onBackgroundRightClick:{triggerUpdate:!1},showPointerCursor:{default:!0,triggerUpdate:!1},onZoom:{triggerUpdate:!1},onZoomEnd:{triggerUpdate:!1},onRenderFramePre:{triggerUpdate:!1},onRenderFramePost:{triggerUpdate:!1}},Yd),aliases:{stopAnimation:`pauseAnimation`},methods:jd({graph2ScreenCoords:function(e,n,r){var i=$l(e.canvas);return{x:n*i.k+i.x,y:r*i.k+i.y}},screen2GraphCoords:function(e,n,r){var i=$l(e.canvas);return{x:(n-i.x)/i.k,y:(r-i.y)/i.k}},centerAt:function(e,n,r,i){if(!e.canvas)return null;if(n!==void 0||r!==void 0){var a=Object.assign({},n===void 0?{}:{x:n},r===void 0?{}:{y:r});return i?e.tweenGroup.add(new aa(o()).to(a,i).easing($i.Quadratic.Out).onUpdate(s).onComplete(function(){e.tweenGroup.remove(this)}).start()):s(a),this}return o();function o(){var n=$l(e.canvas);return{x:(e.width/2-n.x)/n.k,y:(e.height/2-n.y)/n.k}}function s(n){var r=n.x,i=n.y;e.zoom.translateTo(e.zoom.__baseElem,r===void 0?o().x:r,i===void 0?o().y:i),e.needsRedraw=!0}},zoom:function(e,n,r){if(!e.canvas)return null;if(n!==void 0)return r?e.tweenGroup.add(new aa({k:i()}).to({k:n},r).easing($i.Quadratic.Out).onUpdate(function(e){var n=e.k;return a(n)}).onComplete(function(){e.tweenGroup.remove(this)}).start()):a(n),this;return i();function i(){return $l(e.canvas).k}function a(n){e.zoom.scaleTo(e.zoom.__baseElem,n),e.needsRedraw=!0}},zoomToFit:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,i=[...arguments].slice(3),a=this.getGraphBbox.apply(this,i);if(a){var o={x:(a.x[0]+a.x[1])/2,y:(a.y[0]+a.y[1])/2},s=Math.max(1e-12,Math.min(0xe8d4a51000,(e.width-r*2)/(a.x[1]-a.x[0]),(e.height-r*2)/(a.y[1]-a.y[0])));this.centerAt(o.x,o.y,n),this.zoom(s,n)}return this},getGraphBbox:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},r=F(e.nodeVal),i=function(n){return Math.sqrt(Math.max(0,r(n)||1))*e.nodeRelSize},a=e.graphData.nodes.filter(n).map(function(e){return{x:e.x,y:e.y,r:i(e)}});return a.length?{x:[$n(a,function(e){return e.x-e.r}),Qn(a,function(e){return e.x+e.r})],y:[$n(a,function(e){return e.y-e.r}),Qn(a,function(e){return e.y+e.r})]}:null},pauseAnimation:function(e){return e.animationFrameRequestId&&=(cancelAnimationFrame(e.animationFrameRequestId),null),this},resumeAnimation:function(e){return e.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},Xd),stateInit:function(){return{lastSetZoom:1,zoom:cu(),forceGraph:new Hd,shadowGraph:new Hd().cooldownTicks(0).nodeColor(`__indexColor`).linkColor(`__indexColor`).isShadow(!0),colorTracker:new Nu,tweenGroup:new ta}},init:function(e,n){var r=this;e.innerHTML=``;var i=document.createElement(`div`);i.classList.add(`force-graph-container`),i.style.position=`relative`,e.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 a=n.canvas.getContext(`2d`),o=n.shadowCanvas.getContext(`2d`,{willReadFrequently:!0}),s={x:-0xe8d4a51000,y:-0xe8d4a51000},c=function(){var e=null,r=window.devicePixelRatio,i=s.x>0&&s.y>0?o.getImageData(s.x*r,s.y*r,1,1):null;return i&&(e=n.colorTracker.lookup(i.data)),e};U(n.canvas).call(jc().subject(function(){if(!n.enableNodeDrag)return null;var e=c();return e&&e.type===`Node`?e.d:null}).on(`start`,function(e){var r=e.subject;r.__initialDragPos={x:r.x,y:r.y,fx:r.fx,fy:r.fy},e.active||(r.fx=r.x,r.fy=r.y),n.canvas.classList.add(`grabbable`)}).on(`drag`,function(e){var r=e.subject,i=r.__initialDragPos,a=e,o=$l(n.canvas).k,s={x:i.x+(a.x-i.x)/o-r.x,y:i.y+(a.y-i.y)/o-r.y};[`x`,`y`].forEach(function(e){return r[`f${e}`]=r[e]=i[e]+(a[e]-i[e])/o}),!(!r.__dragged&&Kd>=Math.sqrt(er([`x`,`y`].map(function(n){return(e[n]-i[n])**2}))))&&(n.forceGraph.d3AlphaTarget(.3).resetCountdown(),n.isPointerDragging=!0,r.__dragged=!0,n.onNodeDrag(r,s))}).on(`end`,function(e){var r=e.subject,i=r.__initialDragPos,a={x:r.x-i.x,y:r.y-i.y};i.fx===void 0&&(r.fx=void 0),i.fy===void 0&&(r.fy=void 0),delete r.__initialDragPos,n.forceGraph.d3AlphaTarget()&&n.forceGraph.d3AlphaTarget(0).resetCountdown(),n.canvas.classList.remove(`grabbable`),n.isPointerDragging=!1,r.__dragged&&(delete r.__dragged,n.onNodeDragEnd(r,a))})),n.zoom(n.zoom.__baseElem=U(n.canvas)),n.zoom.__baseElem.on(`dblclick.zoom`,null),n.zoom.filter(function(e){return!e.button&&n.enableZoomPanInteraction&&(e.type!==`wheel`||F(n.enableZoomInteraction)(e))&&(e.type===`wheel`||F(n.enablePanInteraction)(e))}).on(`zoom`,function(e){var i=e.transform;[a,o].forEach(function(e){Qd(e),e.translate(i.x,i.y),e.scale(i.k,i.k)}),n.isPointerDragging=!0,n.onZoom&&n.onZoom(jd(jd({},i),r.centerAt())),n.needsRedraw=!0}).on(`end`,function(e){n.isPointerDragging=!1,n.onZoomEnd&&n.onZoomEnd(jd(jd({},e.transform),r.centerAt()))}),Zd(n),n.forceGraph.onNeedsRedraw(function(){return n.needsRedraw=!0}).onFinishUpdate(function(){$l(n.canvas).k===n.lastSetZoom&&n.graphData.nodes.length&&(n.zoom.scaleTo(n.zoom.__baseElem,n.lastSetZoom=Gd/Math.cbrt(n.graphData.nodes.length)),n.needsRedraw=!0)}),n.tooltip=new hc(i),[`pointermove`,`pointerdown`].forEach(function(e){return i.addEventListener(e,function(r){e===`pointerdown`&&(n.isPointerPressed=!0,n.pointerDownEvent=r),!n.isPointerDragging&&r.type===`pointermove`&&n.onBackgroundClick&&(r.pressure>0||n.isPointerPressed)&&(r.pointerType===`mouse`||r.movementX===void 0||[r.movementX,r.movementY].some(function(e){return Math.abs(e)>1}))&&(n.isPointerDragging=!0);var a=o(i);s.x=r.pageX-a.left,s.y=r.pageY-a.top;function o(e){var n=e.getBoundingClientRect(),r=window.pageXOffset||document.documentElement.scrollLeft,i=window.pageYOffset||document.documentElement.scrollTop;return{top:n.top+i,left:n.left+r}}},{passive:!0})}),i.addEventListener(`pointerup`,function(e){if(n.isPointerPressed){if(n.isPointerPressed=!1,n.isPointerDragging){n.isPointerDragging=!1;return}var r=[e,n.pointerDownEvent];requestAnimationFrame(function(){if(e.button===0){if(n.hoverObj){var i=n[`on${n.hoverObj.type}Click`];i&&i.apply(void 0,[n.hoverObj.d].concat(r))}else n.onBackgroundClick&&n.onBackgroundClick.apply(n,r)}if(e.button===2){if(n.hoverObj){var a=n[`on${n.hoverObj.type}RightClick`];a&&a.apply(void 0,[n.hoverObj.d].concat(r))}else n.onBackgroundRightClick&&n.onBackgroundRightClick.apply(n,r)}})}},{passive:!0}),i.addEventListener(`contextmenu`,function(e){return!n.onBackgroundRightClick&&!n.onNodeRightClick&&!n.onLinkRightClick||(e.preventDefault(),!1)}),n.forceGraph(a),n.shadowGraph(o);var l=uu(function(){$d(o,n.width,n.height),n.shadowGraph.linkWidth(function(e){return F(n.linkWidth)(e)+n.linkHoverPrecision});var e=$l(n.canvas);n.shadowGraph.globalScale(e.k).tickFrame()},Wd);n.flushShadowCanvas=l.flush,(this._animationCycle=function e(){var r=!n.autoPauseRedraw||!!n.needsRedraw||n.forceGraph.isEngineRunning()||n.graphData.links.some(function(e){return e.__photons&&e.__photons.length});if(n.needsRedraw=!1,n.enablePointerInteraction){var i=n.isPointerDragging?null:c();if(i!==n.hoverObj){var o=n.hoverObj,s=o?o.type:null,u=i?i.type:null;if(s&&s!==u){var d=n[`on${s}Hover`];d&&d(null,o.d)}if(u){var f=n[`on${u}Hover`];f&&f(i.d,s===u?o.d:null)}n.tooltip.content(i&&F(n[`${i.type.toLowerCase()}Label`])(i.d)||null),n.canvas.classList[(i&&n[`on${u}Click`]||!i&&n.onBackgroundClick)&&F(n.showPointerCursor)(i?.d)?`add`:`remove`](`clickable`),n.hoverObj=i}r&&l()}if(r){$d(a,n.width,n.height);var p=$l(n.canvas).k;n.onRenderFramePre&&n.onRenderFramePre(a,p),n.forceGraph.globalScale(p).tickFrame(),n.onRenderFramePost&&n.onRenderFramePost(a,p)}n.tweenGroup.update(),n.animationFrameRequestId=requestAnimationFrame(e)})()},update:function(e){}}),Z=i(vc(),1),tf={width:Z.default.number,height:Z.default.number,graphData:Z.default.shape({nodes:Z.default.arrayOf(Z.default.object).isRequired,links:Z.default.arrayOf(Z.default.object).isRequired}),backgroundColor:Z.default.string,nodeRelSize:Z.default.number,nodeId:Z.default.string,nodeLabel:Z.default.oneOfType([Z.default.string,Z.default.func]),nodeVal:Z.default.oneOfType([Z.default.number,Z.default.string,Z.default.func]),nodeVisibility:Z.default.oneOfType([Z.default.bool,Z.default.string,Z.default.func]),nodeColor:Z.default.oneOfType([Z.default.string,Z.default.func]),nodeAutoColorBy:Z.default.oneOfType([Z.default.string,Z.default.func]),onNodeHover:Z.default.func,onNodeClick:Z.default.func,linkSource:Z.default.string,linkTarget:Z.default.string,linkLabel:Z.default.oneOfType([Z.default.string,Z.default.func]),linkVisibility:Z.default.oneOfType([Z.default.bool,Z.default.string,Z.default.func]),linkColor:Z.default.oneOfType([Z.default.string,Z.default.func]),linkAutoColorBy:Z.default.oneOfType([Z.default.string,Z.default.func]),linkWidth:Z.default.oneOfType([Z.default.number,Z.default.string,Z.default.func]),linkCurvature:Z.default.oneOfType([Z.default.number,Z.default.string,Z.default.func]),linkDirectionalArrowLength:Z.default.oneOfType([Z.default.number,Z.default.string,Z.default.func]),linkDirectionalArrowColor:Z.default.oneOfType([Z.default.string,Z.default.func]),linkDirectionalArrowRelPos:Z.default.oneOfType([Z.default.number,Z.default.string,Z.default.func]),linkDirectionalParticles:Z.default.oneOfType([Z.default.number,Z.default.string,Z.default.func]),linkDirectionalParticleSpeed:Z.default.oneOfType([Z.default.number,Z.default.string,Z.default.func]),linkDirectionalParticleOffset:Z.default.oneOfType([Z.default.number,Z.default.string,Z.default.func]),linkDirectionalParticleWidth:Z.default.oneOfType([Z.default.number,Z.default.string,Z.default.func]),linkDirectionalParticleColor:Z.default.oneOfType([Z.default.string,Z.default.func]),onLinkHover:Z.default.func,onLinkClick:Z.default.func,dagMode:Z.default.oneOf([`td`,`bu`,`lr`,`rl`,`zin`,`zout`,`radialin`,`radialout`]),dagLevelDistance:Z.default.number,dagNodeFilter:Z.default.func,onDagError:Z.default.func,d3AlphaMin:Z.default.number,d3AlphaDecay:Z.default.number,d3VelocityDecay:Z.default.number,warmupTicks:Z.default.number,cooldownTicks:Z.default.number,cooldownTime:Z.default.number,onEngineTick:Z.default.func,onEngineStop:Z.default.func,getGraphBbox:Z.default.func},nf={zoomToFit:Z.default.func,onNodeRightClick:Z.default.func,onNodeDrag:Z.default.func,onNodeDragEnd:Z.default.func,onLinkRightClick:Z.default.func,linkHoverPrecision:Z.default.number,onBackgroundClick:Z.default.func,onBackgroundRightClick:Z.default.func,showPointerCursor:Z.default.oneOfType([Z.default.bool,Z.default.func]),enablePointerInteraction:Z.default.bool,enableNodeDrag:Z.default.bool},rf={showNavInfo:Z.default.bool,nodeOpacity:Z.default.number,nodeResolution:Z.default.number,nodeThreeObject:Z.default.oneOfType([Z.default.object,Z.default.string,Z.default.func]),nodeThreeObjectExtend:Z.default.oneOfType([Z.default.bool,Z.default.string,Z.default.func]),nodePositionUpdate:Z.default.func,linkOpacity:Z.default.number,linkResolution:Z.default.number,linkCurveRotation:Z.default.oneOfType([Z.default.number,Z.default.string,Z.default.func]),linkMaterial:Z.default.oneOfType([Z.default.object,Z.default.string,Z.default.func]),linkThreeObject:Z.default.oneOfType([Z.default.object,Z.default.string,Z.default.func]),linkThreeObjectExtend:Z.default.oneOfType([Z.default.bool,Z.default.string,Z.default.func]),linkPositionUpdate:Z.default.func,linkDirectionalArrowResolution:Z.default.number,linkDirectionalParticleResolution:Z.default.number,linkDirectionalParticleThreeObject:Z.default.oneOfType([Z.default.object,Z.default.string,Z.default.func]),forceEngine:Z.default.oneOf([`d3`,`ngraph`]),ngraphPhysics:Z.default.object,numDimensions:Z.default.oneOf([1,2,3])},af=Object.assign({},tf,nf,{linkLineDash:Z.default.oneOfType([Z.default.arrayOf(Z.default.number),Z.default.string,Z.default.func]),nodeCanvasObjectMode:Z.default.oneOfType([Z.default.string,Z.default.func]),nodeCanvasObject:Z.default.func,nodePointerAreaPaint:Z.default.func,linkCanvasObjectMode:Z.default.oneOfType([Z.default.string,Z.default.func]),linkCanvasObject:Z.default.func,linkPointerAreaPaint:Z.default.func,linkDirectionalParticleCanvasObject:Z.default.func,autoPauseRedraw:Z.default.bool,minZoom:Z.default.number,maxZoom:Z.default.number,enableZoomInteraction:Z.default.oneOfType([Z.default.bool,Z.default.func]),enablePanInteraction:Z.default.oneOfType([Z.default.bool,Z.default.func]),onZoom:Z.default.func,onZoomEnd:Z.default.func,onRenderFramePre:Z.default.func,onRenderFramePost:Z.default.func});Object.assign({},tf,nf,rf,{enableNavigationControls:Z.default.bool,controlType:Z.default.oneOf([`trackball`,`orbit`,`fly`]),rendererConfig:Z.default.object,extraRenderers:Z.default.arrayOf(Z.default.shape({render:Z.default.func.isRequired}))}),Object.assign({},tf,rf,{nodeDesc:Z.default.oneOfType([Z.default.string,Z.default.func]),linkDesc:Z.default.oneOfType([Z.default.string,Z.default.func])}),Object.assign({},tf,rf,{markerAttrs:Z.default.object,yOffset:Z.default.number,glScale:Z.default.number});var of=ee(ef,{methodNames:[`emitParticle`,`d3Force`,`d3ReheatSimulation`,`stopAnimation`,`pauseAnimation`,`resumeAnimation`,`centerAt`,`zoom`,`zoomToFit`,`getGraphBbox`,`screen2GraphCoords`,`graph2ScreenCoords`]});of.displayName=`ForceGraph2D`,of.propTypes=af;var Q=o(),sf=(0,p.lazy)(()=>d(()=>import(`./react-force-graph-3d-MeqEw_23.js`).then(e=>({default:e.default})),__vite__mapDeps([0,1,2]))),cf=e=>{let n=e.label&&!/^(doc:|legal-corpus:)/.test(e.label)?e.label:e.document_title||`Документ`;if(e.kind!==`point`)return n;let r=n.match(/^(?:Пункт|п\.)\s*(\d+(?:\.\d+)*)/i)?.[1],i=e.id.match(/:article:(\d+(?:\.\d+)*):/)?.[1];return r?`Пункт `+r+(i?` статьи `+i:``):n},lf=e=>typeof e==`object`?e.id:e,uf=getComputedStyle(document.documentElement),$={blue:uf.getPropertyValue(`--accent`).trim(),red:uf.getPropertyValue(`--red`).trim(),point:uf.getPropertyValue(`--graph-point`).trim(),canvas:uf.getPropertyValue(`--graph-canvas`).trim(),ink:uf.getPropertyValue(`--ink`).trim()},df=e=>e.document_kind===`plenum`?$.red:e.kind===`point`?$.point:$.blue,ff=e=>{let n=document.createElement(`span`);return n.textContent=cf(e)+(e.kind===`document`?``:` · `+(e.document_title||``)),n.innerHTML},pf=class extends p.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?(0,Q.jsxs)(`div`,{className:`p-connection-state`,role:`alert`,children:[(0,Q.jsx)(`p`,{children:`Объемный граф недоступен в этом браузере.`}),(0,Q.jsx)(`button`,{className:`p-button`,onClick:this.props.onFallback,children:`Открыть 2D`})]}):this.props.children}};function mf({route:r}){let[i,o]=(0,p.useState)(r.q||``),[c,l]=(0,p.useState)(`graph`),[u,d]=(0,p.useState)(!1),[f,m]=(0,p.useState)(r.node_id||``),[h,g]=(0,p.useState)(null),[_,v]=(0,p.useState)(``),[y,b]=(0,p.useState)(0),x=r.level===`documents`?`documents`:`atoms`,S=r.include_contains!==`0`,C=`/graph/network?`+new URLSearchParams({level:x,limit:`1000`,include_contains:S?`1`:`0`,...r.fragment?{fragment:r.fragment}:{},...r.resource_id?{resource_id:r.resource_id}:{},...r.node_id?{node_id:r.node_id}:{},...r.q?{q:r.q}:{},...r.kind?{kind:r.kind}:{}});(0,p.useEffect)(()=>o(r.q||``),[r.q]),(0,p.useEffect)(()=>{let e=new AbortController,n;g(null),v(``),m(r.node_id||``);let i=()=>s(C,{signal:e.signal}).then(a=>{if(!e.signal.aborted){if(a.loading&&!a.nodes.length){n=setTimeout(i,700);return}g(a),m(a.focus_id||r.node_id||``)}}).catch(n=>{e.signal.aborted||v(n.message)});return i(),()=>{e.abort(),clearTimeout(n)}},[C,y]);let w=e=>{location.hash=a({view:`graph`,level:x,fragment:r.fragment,include_contains:r.include_contains,...r.resource_id?{resource_id:r.resource_id}:{},...r.node_id?{node_id:r.node_id}:{},q:r.q,kind:r.kind,...e})};return(0,Q.jsxs)(`section`,{className:`p-connections`,"aria-labelledby":`connections-title`,children:[(0,Q.jsxs)(`header`,{className:`p-connections-head`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`p-eyebrow`,children:`Статьи, пункты и точные ссылки`}),(0,Q.jsx)(`h1`,{id:`connections-title`,children:`Граф знаний`}),(0,Q.jsx)(`p`,{children:x===`atoms`?`Каждая точка — отдельная статья или пункт. Найдите норму или откройте ее граф из текста.`:`Сводный обзор документов. Для точных связей переключитесь на статьи и пункты.`})]}),(0,Q.jsxs)(`div`,{className:`p-connection-actions`,"aria-label":`Вид графа`,children:[(0,Q.jsx)(`button`,{className:`p-button`,"aria-pressed":c===`graph`&&!u,onClick:()=>{l(`graph`),d(!1)},children:`2D`}),(0,Q.jsx)(`button`,{className:`p-button`,"aria-pressed":c===`graph`&&u,onClick:()=>{l(`graph`),d(!0)},children:`3D`}),(0,Q.jsx)(`button`,{className:`p-button`,"aria-pressed":c===`list`,onClick:()=>l(`list`),children:`Список`})]})]}),(0,Q.jsxs)(`form`,{className:`p-connection-filters`,onSubmit:e=>{e.preventDefault(),w({q:i||void 0,node_id:void 0,fragment:void 0,resource_id:void 0})},children:[(0,Q.jsxs)(`label`,{className:`p-field`,children:[(0,Q.jsx)(`span`,{children:`Поиск узлов`}),(0,Q.jsx)(`input`,{value:i,onChange:e=>o(e.target.value),placeholder:`Например, ст. 395 ГК или ст. 131 ГПК`})]}),(0,Q.jsxs)(`label`,{className:`p-field`,children:[(0,Q.jsx)(`span`,{children:`Слой`}),(0,Q.jsxs)(`select`,{value:x,onChange:e=>w({level:e.target.value,node_id:void 0,fragment:void 0,resource_id:void 0}),children:[(0,Q.jsx)(`option`,{value:`atoms`,children:`Статьи и пункты`}),(0,Q.jsx)(`option`,{value:`documents`,children:`Обзор документов`})]})]}),(0,Q.jsxs)(`label`,{className:`p-field`,children:[(0,Q.jsx)(`span`,{children:`Тип`}),(0,Q.jsxs)(`select`,{value:r.kind||``,onChange:e=>w({kind:e.target.value||void 0}),children:[(0,Q.jsx)(`option`,{value:``,children:`Все типы`}),Object.entries(e).map(([e,n])=>(0,Q.jsx)(`option`,{value:e,children:n[0]},e))]})]}),(0,Q.jsxs)(`button`,{className:`p-button p-button-primary`,type:`submit`,children:[(0,Q.jsx)(n,{name:`search`}),`Найти`]})]}),x===`atoms`&&(0,Q.jsxs)(`label`,{className:`p-structure-toggle`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:S,onChange:e=>w({include_contains:e.target.checked?`1`:`0`})}),`Показывать состав статьи и вложенные пункты`]}),(r.resource_id||r.node_id||r.fragment||r.q||r.kind)&&(0,Q.jsxs)(`div`,{className:`p-graph-scope`,children:[(0,Q.jsx)(`span`,{children:r.node_id||r.fragment?`Связи выбранной нормы`:r.resource_id?`Статьи документа`:`Результаты поиска норм`}),(0,Q.jsx)(`a`,{href:a({view:`graph`}),children:`Общий граф`})]}),h?.stale&&(0,Q.jsx)(`p`,{className:`p-connection-notice`,children:`После сборки исходные тексты изменились. Связи требуют сверки.`}),!!h?.warnings?.length&&(0,Q.jsxs)(`details`,{className:`p-connection-warnings`,children:[(0,Q.jsxs)(`summary`,{children:[`Проверка источников · `,h.warnings.length]}),h.warnings.map((e,n)=>(0,Q.jsx)(`p`,{children:e.problem||e.output||`Источник требует сверки.`},n))]}),_?(0,Q.jsxs)(`div`,{className:`p-connection-state`,role:`alert`,children:[(0,Q.jsx)(`strong`,{children:`Граф недоступен`}),(0,Q.jsx)(`p`,{children:_}),(0,Q.jsx)(`button`,{className:`p-button`,onClick:()=>b(e=>e+1),children:`Повторить`})]}):h?h.nodes.length?(0,Q.jsx)(hf,{data:h,mode:c,threeD:u,selected:f,onSelect:m,onFallback:()=>d(!1)},C):(0,Q.jsx)(`p`,{className:`p-connection-state`,children:h.status===`focus_not_found`?`Этот фрагмент еще не выделен в графе. Связи всего документа вместо него не подставляются.`:`Узлы не найдены. Измените запрос или фильтры.`}):(0,Q.jsx)(`p`,{className:`p-connection-state`,role:`status`,children:`Загружаем узлы и связи…`})]})}function hf({data:e,mode:r,threeD:i,selected:a,onSelect:o,onFallback:s}){let[c,l]=(0,p.useState)(``),[u,d]=(0,p.useState)(()=>matchMedia(`(prefers-reduced-motion: reduce)`).matches),[f,m]=(0,p.useState)(u),[h,g]=(0,p.useState)(!1),[_,v]=(0,p.useState)({width:640,height:540}),[y,b]=(0,p.useState)(!1),x=(0,p.useRef)([]),S=(0,p.useRef)(null),C=(0,p.useRef)(void 0),w=(0,p.useRef)(void 0),T=(0,p.useRef)(!1),E=(0,p.useMemo)(()=>{let n=new Map;return e.edges.forEach(e=>{n.set(e.source,(n.get(e.source)||0)+1),n.set(e.target,(n.get(e.target)||0)+1)}),n},[e]),D=e.nodes.filter(e=>!E.has(e.id)).length,ee=(0,p.useMemo)(()=>({nodes:e.nodes.filter(n=>n.id===e.focus_id||y||!e.edges.length||E.has(n.id)).map(e=>({...e})),links:e.edges.map(e=>({...e}))}),[e,i,y,E]),O=c||a,te=(0,p.useMemo)(()=>new Set(e.nodes.filter(n=>n.id===O||e.nodes.find(e=>e.id===O)?.kind===`article`&&n.id.startsWith(O+`:`)).map(e=>e.id)),[e,O]),ne=(0,p.useMemo)(()=>{let n=new Set(te);return e.edges.forEach(e=>{te.has(e.source)&&n.add(e.target),te.has(e.target)&&n.add(e.source)}),n},[e,te]),re=e.nodes.find(e=>e.id===a),ie=u?0:240,ae=()=>{(i?w.current:C.current)?.zoomToFit(ie,36)};(0,p.useEffect)(()=>{let e=matchMedia(`(prefers-reduced-motion: reduce)`),n=()=>{d(e.matches),e.matches&&m(!0)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),(0,p.useEffect)(()=>{let e=S.current;if(!e)return;let n=new ResizeObserver(([e])=>{v({width:Math.max(1,Math.floor(e.contentRect.width)),height:Math.max(1,Math.floor(e.contentRect.height))})});return n.observe(e),()=>n.disconnect()},[r,i]),(0,p.useEffect)(()=>{T.current=!1,g(!1),l(``)},[ee,r,i]),(0,p.useEffect)(()=>{if(!T.current)return;let e=setTimeout(ae,50);return()=>clearTimeout(e)},[_.width,_.height]);let oe=()=>{g(!0),T.current||(T.current=!0,ae())},se=()=>{f||h?(m(!1),g(!1),(i?w.current:C.current)?.d3ReheatSimulation()):m(!0)},k=e=>{if(!i){let n=C.current;n&&n.zoom(Math.max(.05,Math.min(20,n.zoom()*e)),ie);return}let n=w.current;if(!n)return;let r=n.camera(),a=n.controls().target||{x:0,y:0,z:0};n.cameraPosition({x:a.x+(r.position.x-a.x)/e,y:a.y+(r.position.y-a.y)/e,z:a.z+(r.position.z-a.z)/e},a,ie)},ce=e=>O&&!ne.has(e.id)?`#d4dfed`:e.id===O?$.blue:df(e),le=(e,n,r)=>{let i=1.6*Math.sqrt(3+Math.sqrt(E.get(e.id)||0)*2);if(n.beginPath(),n.arc(e.x||0,e.y||0,i,0,Math.PI*2),n.strokeStyle=e.id===O?$.red:$.blue,n.lineWidth=(e.id===O?2:1)/r,n.stroke(),e.id!==O&&ee.nodes.length>70&&r<2)return;let a=gf(e),o=a.length>52?a.slice(0,49)+`…`:a;n.font=`${e.id===O?500:400} ${11/r}px Golos Text`;let s=n.measureText(o).width+8/r,c=15/r,l={x:(e.x||0)-s/2,y:(e.y||0)+i+5/r,width:s,height:c};e.id!==O&&x.current.some(e=>l.x<e.x+e.width&&l.x+l.width>e.x&&l.y<e.y+e.height&&l.y+l.height>e.y)||(x.current.push(l),n.fillStyle=$.canvas,n.fillRect(l.x,l.y,l.width,l.height),n.fillStyle=$.ink,n.textAlign=`center`,n.fillText(o,e.x||0,l.y+11/r))},ue=e=>O&&(te.has(String(lf(e.source)))||te.has(String(lf(e.target)))),de={graphData:ee,width:_.width,height:_.height,backgroundColor:$.canvas,nodeLabel:ff,nodeColor:ce,nodeVal:e=>3+Math.sqrt(E.get(e.id)||0)*2,linkColor:e=>ue(e)?$.blue:O?`#d4dfed`:e.relation===`contains`?`#99abc2`:`#6e95bd`,linkDirectionalArrowLength:e=>e.relation===`contains`?0:3,linkDirectionalArrowRelPos:1,linkWidth:e=>ue(e)?1.8:.6,onNodeClick:e=>o(e.id),onNodeHover:e=>l(e?.id||``),onBackgroundClick:()=>o(``),warmupTicks:120,cooldownTicks:f?0:180,cooldownTime:5e3,onEngineStop:oe,onEngineTick:()=>{T.current||(T.current=!0,ae())},enableNodeDrag:!0};return(0,Q.jsxs)(`div`,{className:`p-network-layout`,children:[(0,Q.jsxs)(`div`,{className:`p-network-main`,children:[(0,Q.jsxs)(`div`,{className:`p-network-toolbar`,children:[(0,Q.jsxs)(`span`,{children:[r===`graph`?ee.nodes.length:e.nodes.length,` узлов · `,e.edges.length,` связей`]}),r===`graph`&&(0,Q.jsxs)(`div`,{className:`p-network-controls`,children:[(0,Q.jsx)(`button`,{className:`p-button`,"aria-label":`Приблизить карту`,onClick:()=>k(1.3),children:`+`}),(0,Q.jsx)(`button`,{className:`p-button`,"aria-label":`Отдалить карту`,onClick:()=>k(1/1.3),children:`−`}),(0,Q.jsx)(`button`,{className:`p-button`,onClick:ae,children:`По размеру`}),(0,Q.jsx)(`button`,{className:`p-button`,"aria-pressed":f||h,onClick:se,children:f||h?`Оживить`:`Пауза`})]})]}),r===`graph`&&D>0&&e.edges.length>0&&(0,Q.jsxs)(`label`,{className:`p-isolated-toggle`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:y,onChange:e=>b(e.target.checked)}),`Показать также узлы без связей · `,D]}),e.truncated&&(0,Q.jsxs)(`p`,{className:`p-connection-notice`,children:[`Показано `,e.nodes.length,` из `,e.total_nodes,` узлов и `,e.edges.length,` из `,e.total_edges,` связей. Уточните документ или запрос.`]}),r===`graph`?(0,Q.jsx)(`div`,{className:`p-force-canvas`,ref:S,onPointerLeave:()=>l(``),role:`region`,"aria-label":i?`Объемный граф знаний`:`Граф знаний: перетаскивание и масштабирование`,children:i?(0,Q.jsx)(pf,{onFallback:s,children:(0,Q.jsx)(p.Suspense,{fallback:(0,Q.jsx)(`p`,{role:`status`,className:`p-connection-state`,children:`Загружаем объемный граф…`}),children:(0,Q.jsx)(sf,{...de,ref:w,controlType:`orbit`,showNavInfo:!1,nodeResolution:12,linkOpacity:.55})})}):(0,Q.jsx)(of,{...de,ref:C,nodeRelSize:1.6,minZoom:.05,maxZoom:20,linkLineDash:e=>e.relation===`contains`?[3,3]:null,nodeCanvasObjectMode:()=>`after`,onRenderFramePre:()=>{x.current=[]},nodeCanvasObject:le})}):(0,Q.jsx)(`div`,{className:`p-network-list`,"aria-label":`Список узлов`,children:e.nodes.map(e=>(0,Q.jsxs)(`button`,{className:`p-network-list-row`,"aria-pressed":e.id===a,onClick:()=>o(e.id),children:[(0,Q.jsx)(`span`,{className:`p-network-dot`,style:{background:df(e)}}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`strong`,{children:cf(e)}),(0,Q.jsxs)(`small`,{children:[e.document_title,` · `,E.get(e.id)||0,` связей`]})]}),(0,Q.jsx)(n,{name:`arrow`})]},e.id))}),(0,Q.jsxs)(`div`,{className:`p-network-legend`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{style:{background:$.blue}}),`Статьи`]}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{style:{background:$.red}}),`Пункты Пленумов`]}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{style:{background:$.point}}),`Другие пункты`]})]})]}),(0,Q.jsx)(`aside`,{className:`p-network-panel`,"aria-label":`Выбранный узел`,children:re?(0,Q.jsx)(_f,{node:re,data:e,onSelect:o}):(0,Q.jsxs)(`div`,{className:`p-connection-state`,children:[(0,Q.jsx)(n,{name:`graph`}),(0,Q.jsx)(`h2`,{children:`Связи конкретной нормы`}),(0,Q.jsx)(`p`,{children:`Выберите статью или пункт. Здесь появятся точные входящие и исходящие ссылки с фрагментами источников.`}),(0,Q.jsx)(`p`,{children:`Стрелка — прямая ссылка. Линия без стрелки — состав статьи.`})]})})]})}function gf(e){if(e.kind===`document`)return cf(e);let n=e.label.match(/^(?:Статья|Пункт|п\.)\s*(\d+(?:\.\d+)*)/i)?.[1],r=e.aliases?.filter(e=>e.length<=12).sort((e,n)=>e.length-n.length)[0]?.toLocaleUpperCase(`ru`),i=e.document_number||e.document_title?.match(/(?:N|№)\s*([\d-]+)/)?.[1],a=r||(e.document_kind===`plenum`?`Пленум`+(i?` №`+i:``):(e.document_title||``).slice(0,28)),o=e.kind===`point`?e.id.match(/:article:(\d+(?:\.\d+)*):/)?.[1]:void 0;return n?(e.kind===`article`?`ст.`:`п.`)+` `+n+(o?` ст. `+o:``)+` · `+a:cf(e)}function _f({node:e,data:r,onSelect:i}){let o=new Set(r.nodes.filter(n=>n.id===e.id||e.kind===`article`&&n.id.startsWith(e.id+`:`)).map(e=>e.id)),s=r.edges.filter(e=>o.has(e.source)||o.has(e.target)),d=s.filter(e=>e.relation!==`contains`),f=s.filter(e=>e.relation===`contains`);return(0,Q.jsxs)(`div`,{className:`p-selected-node`,children:[(0,Q.jsxs)(`div`,{className:`p-panel-heading`,children:[(0,Q.jsx)(`p`,{className:`p-eyebrow`,children:e.kind===`document`?`Документ`:`Конкретная норма`}),(0,Q.jsx)(`button`,{className:`p-icon-button`,"aria-label":`Снять выбор`,onClick:()=>i(``),children:(0,Q.jsx)(n,{name:`close`})})]}),(0,Q.jsx)(`h2`,{children:cf(e)}),e.document_title!==cf(e)&&(0,Q.jsx)(`p`,{children:e.document_title}),(0,Q.jsx)(`a`,{className:`p-button p-button-primary`,href:l(e.resource_id,e.reader_id),children:e.kind===`document`?`Читать документ`:`Читать точное место`}),(0,Q.jsxs)(`a`,{className:`p-local-graph-link`,href:a({view:`graph`,level:`atoms`,resource_id:e.resource_id,node_id:e.kind===`document`?void 0:e.id}),children:[e.kind===`document`?`Статьи этого документа`:`В центре — эта норма`,(0,Q.jsx)(n,{name:`graph`})]}),(0,Q.jsxs)(`h3`,{children:[`Прямые ссылки · `,d.length]}),!d.length&&(0,Q.jsx)(`p`,{className:`p-muted`,children:`Прямые ссылки для этой нормы в сохраненном графе не найдены. Это не означает отсутствия правовой связи.`}),[...d,...f].map((a,s)=>{let d=o.has(a.source),f=r.nodes.find(e=>e.id===(d?a.target:a.source));if(!f)return null;let p=r.nodes.find(e=>e.id===(d?a.source:a.target)),m=p&&p.id!==e.id?cf(p)+` · `:``,h=a.relation===`contains`?d?`Содержит`:`Входит в`:m+(d?`Ссылается на`:`Ссылка из`);return(0,Q.jsxs)(`section`,{className:`p-atomic-relation`,children:[(0,Q.jsx)(`p`,{className:`p-eyebrow`,children:h}),(0,Q.jsxs)(`button`,{className:`p-related-node`,onClick:()=>i(f.id),children:[(0,Q.jsxs)(`span`,{children:[cf(f),(0,Q.jsx)(`small`,{children:f.document_title})]}),(0,Q.jsx)(n,{name:`arrow`})]}),a.relation!==`contains`&&(0,Q.jsxs)(`details`,{className:`p-network-evidence`,children:[(0,Q.jsx)(`summary`,{children:`Основание этой связи`}),(0,Q.jsx)(`blockquote`,{children:a.evidence?.excerpt||`Подтверждающий фрагмент не сохранен.`}),a.evidence?.revision&&(0,Q.jsxs)(`small`,{children:[`Редакция: `,u(a.evidence.revision)]}),a.evidence?.source_url&&(0,Q.jsx)(`a`,{href:c(a.evidence.source_url),target:`_blank`,rel:`noreferrer`,children:`Источник ↗`})]}),(0,Q.jsxs)(`a`,{className:`p-atomic-read`,href:l(f.resource_id,f.reader_id),children:[`Читать `,gf(f)]})]},a.source+`-`+a.target+`-`+s)})]})}export{mf as Connections,te as _,aa as a,rr as c,F as d,Kn as f,mt as g,$t as h,ta as i,$n as l,en as m,hc as n,L as o,tn as p,$i as r,hi as s,vc as t,Qn as u,ee as v}; |