UNPKG

react-graph-ts

Version:
14 lines (12 loc) 90.8 kB
(function(mt,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],z):(mt=typeof globalThis<"u"?globalThis:mt||self,z(mt.ReactGraphTs={},mt.React))})(this,(function(mt,z){"use strict";var Ut={exports:{}},Pt={};var He;function or(){if(He)return Pt;He=1;var t=z,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function u(a,s,c){var l,g={},d=null,h=null;c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),s.ref!==void 0&&(h=s.ref);for(l in s)r.call(s,l)&&!o.hasOwnProperty(l)&&(g[l]=s[l]);if(a&&a.defaultProps)for(l in s=a.defaultProps,s)g[l]===void 0&&(g[l]=s[l]);return{$$typeof:e,type:a,key:d,ref:h,props:g,_owner:i.current}}return Pt.Fragment=n,Pt.jsx=u,Pt.jsxs=u,Pt}var It={};var Ve;function ur(){return Ve||(Ve=1,process.env.NODE_ENV!=="production"&&(function(){var t=z,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),x=Symbol.iterator,v="@@iterator";function y(f){if(f===null||typeof f!="object")return null;var E=x&&f[x]||f[v];return typeof E=="function"?E:null}var p=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(f){{for(var E=arguments.length,k=new Array(E>1?E-1:0),N=1;N<E;N++)k[N-1]=arguments[N];A("error",f,k)}}function A(f,E,k){{var N=p.ReactDebugCurrentFrame,O=N.getStackAddendum();O!==""&&(E+="%s",k=k.concat([O]));var X=k.map(function(L){return String(L)});X.unshift("Warning: "+E),Function.prototype.apply.call(console[f],console,X)}}var _=!1,S=!1,R=!1,I=!1,F=!1,B;B=Symbol.for("react.module.reference");function j(f){return!!(typeof f=="string"||typeof f=="function"||f===r||f===o||F||f===i||f===c||f===l||I||f===h||_||S||R||typeof f=="object"&&f!==null&&(f.$$typeof===d||f.$$typeof===g||f.$$typeof===u||f.$$typeof===a||f.$$typeof===s||f.$$typeof===B||f.getModuleId!==void 0))}function tt(f,E,k){var N=f.displayName;if(N)return N;var O=E.displayName||E.name||"";return O!==""?k+"("+O+")":k}function bt(f){return f.displayName||"Context"}function it(f){if(f==null)return null;if(typeof f.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case l:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case a:var E=f;return bt(E)+".Consumer";case u:var k=f;return bt(k._context)+".Provider";case s:return tt(f,f.render,"ForwardRef");case g:var N=f.displayName||null;return N!==null?N:it(f.type)||"Memo";case d:{var O=f,X=O._payload,L=O._init;try{return it(L(X))}catch{return null}}}return null}var m=Object.assign,T=0,b,C,M,D,P,Y,q;function ot(){}ot.__reactDisabledLog=!0;function W(){{if(T===0){b=console.log,C=console.info,M=console.warn,D=console.error,P=console.group,Y=console.groupCollapsed,q=console.groupEnd;var f={configurable:!0,enumerable:!0,value:ot,writable:!0};Object.defineProperties(console,{info:f,log:f,warn:f,error:f,group:f,groupCollapsed:f,groupEnd:f})}T++}}function ut(){{if(T--,T===0){var f={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:m({},f,{value:b}),info:m({},f,{value:C}),warn:m({},f,{value:M}),error:m({},f,{value:D}),group:m({},f,{value:P}),groupCollapsed:m({},f,{value:Y}),groupEnd:m({},f,{value:q})})}T<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var at=p.ReactCurrentDispatcher,J;function et(f,E,k){{if(J===void 0)try{throw Error()}catch(O){var N=O.stack.trim().match(/\n( *(at )?)/);J=N&&N[1]||""}return` `+J+f}}var Et=!1,ve;{var Wa=typeof WeakMap=="function"?WeakMap:Map;ve=new Wa}function Hn(f,E){if(!f||Et)return"";{var k=ve.get(f);if(k!==void 0)return k}var N;Et=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var X;X=at.current,at.current=null,W();try{if(E){var L=function(){throw Error()};if(Object.defineProperty(L.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(L,[])}catch(nt){N=nt}Reflect.construct(f,[],L)}else{try{L.call()}catch(nt){N=nt}f.call(L.prototype)}}else{try{throw Error()}catch(nt){N=nt}f()}}catch(nt){if(nt&&N&&typeof nt.stack=="string"){for(var $=nt.stack.split(` `),Q=N.stack.split(` `),H=$.length-1,V=Q.length-1;H>=1&&V>=0&&$[H]!==Q[V];)V--;for(;H>=1&&V>=0;H--,V--)if($[H]!==Q[V]){if(H!==1||V!==1)do if(H--,V--,V<0||$[H]!==Q[V]){var st=` `+$[H].replace(" at new "," at ");return f.displayName&&st.includes("<anonymous>")&&(st=st.replace("<anonymous>",f.displayName)),typeof f=="function"&&ve.set(f,st),st}while(H>=1&&V>=0);break}}}finally{Et=!1,at.current=X,ut(),Error.prepareStackTrace=O}var Dt=f?f.displayName||f.name:"",kt=Dt?et(Dt):"";return typeof f=="function"&&ve.set(f,kt),kt}function Ga(f,E,k){return Hn(f,!1)}function Ua(f){var E=f.prototype;return!!(E&&E.isReactComponent)}function pe(f,E,k){if(f==null)return"";if(typeof f=="function")return Hn(f,Ua(f));if(typeof f=="string")return et(f);switch(f){case c:return et("Suspense");case l:return et("SuspenseList")}if(typeof f=="object")switch(f.$$typeof){case s:return Ga(f.render);case g:return pe(f.type,E,k);case d:{var N=f,O=N._payload,X=N._init;try{return pe(X(O),E,k)}catch{}}}return""}var Gt=Object.prototype.hasOwnProperty,Vn={},jn=p.ReactDebugCurrentFrame;function ye(f){if(f){var E=f._owner,k=pe(f.type,f._source,E?E.type:null);jn.setExtraStackFrame(k)}else jn.setExtraStackFrame(null)}function Ka(f,E,k,N,O){{var X=Function.call.bind(Gt);for(var L in f)if(X(f,L)){var $=void 0;try{if(typeof f[L]!="function"){var Q=Error((N||"React class")+": "+k+" type `"+L+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof f[L]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Q.name="Invariant Violation",Q}$=f[L](E,L,N,k,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(H){$=H}$&&!($ instanceof Error)&&(ye(O),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",N||"React class",k,L,typeof $),ye(null)),$ instanceof Error&&!($.message in Vn)&&(Vn[$.message]=!0,ye(O),w("Failed %s type: %s",k,$.message),ye(null))}}}var Ja=Array.isArray;function Fe(f){return Ja(f)}function Qa(f){{var E=typeof Symbol=="function"&&Symbol.toStringTag,k=E&&f[Symbol.toStringTag]||f.constructor.name||"Object";return k}}function Za(f){try{return Wn(f),!1}catch{return!0}}function Wn(f){return""+f}function Gn(f){if(Za(f))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qa(f)),Wn(f)}var Un=p.ReactCurrentOwner,ts={key:!0,ref:!0,__self:!0,__source:!0},Kn,Jn;function es(f){if(Gt.call(f,"ref")){var E=Object.getOwnPropertyDescriptor(f,"ref").get;if(E&&E.isReactWarning)return!1}return f.ref!==void 0}function ns(f){if(Gt.call(f,"key")){var E=Object.getOwnPropertyDescriptor(f,"key").get;if(E&&E.isReactWarning)return!1}return f.key!==void 0}function rs(f,E){typeof f.ref=="string"&&Un.current}function is(f,E){{var k=function(){Kn||(Kn=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};k.isReactWarning=!0,Object.defineProperty(f,"key",{get:k,configurable:!0})}}function os(f,E){{var k=function(){Jn||(Jn=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};k.isReactWarning=!0,Object.defineProperty(f,"ref",{get:k,configurable:!0})}}var us=function(f,E,k,N,O,X,L){var $={$$typeof:e,type:f,key:E,ref:k,props:L,_owner:X};return $._store={},Object.defineProperty($._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty($,"_self",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.defineProperty($,"_source",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.freeze&&(Object.freeze($.props),Object.freeze($)),$};function as(f,E,k,N,O){{var X,L={},$=null,Q=null;k!==void 0&&(Gn(k),$=""+k),ns(E)&&(Gn(E.key),$=""+E.key),es(E)&&(Q=E.ref,rs(E,O));for(X in E)Gt.call(E,X)&&!ts.hasOwnProperty(X)&&(L[X]=E[X]);if(f&&f.defaultProps){var H=f.defaultProps;for(X in H)L[X]===void 0&&(L[X]=H[X])}if($||Q){var V=typeof f=="function"?f.displayName||f.name||"Unknown":f;$&&is(L,V),Q&&os(L,V)}return us(f,$,Q,O,N,Un.current,L)}}var Ye=p.ReactCurrentOwner,Qn=p.ReactDebugCurrentFrame;function Mt(f){if(f){var E=f._owner,k=pe(f.type,f._source,E?E.type:null);Qn.setExtraStackFrame(k)}else Qn.setExtraStackFrame(null)}var Xe;Xe=!1;function qe(f){return typeof f=="object"&&f!==null&&f.$$typeof===e}function Zn(){{if(Ye.current){var f=it(Ye.current.type);if(f)return` Check the render method of \``+f+"`."}return""}}function ss(f){return""}var tr={};function cs(f){{var E=Zn();if(!E){var k=typeof f=="string"?f:f.displayName||f.name;k&&(E=` Check the top-level render call using <`+k+">.")}return E}}function er(f,E){{if(!f._store||f._store.validated||f.key!=null)return;f._store.validated=!0;var k=cs(E);if(tr[k])return;tr[k]=!0;var N="";f&&f._owner&&f._owner!==Ye.current&&(N=" It was passed a child from "+it(f._owner.type)+"."),Mt(f),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',k,N),Mt(null)}}function nr(f,E){{if(typeof f!="object")return;if(Fe(f))for(var k=0;k<f.length;k++){var N=f[k];qe(N)&&er(N,E)}else if(qe(f))f._store&&(f._store.validated=!0);else if(f){var O=y(f);if(typeof O=="function"&&O!==f.entries)for(var X=O.call(f),L;!(L=X.next()).done;)qe(L.value)&&er(L.value,E)}}}function ls(f){{var E=f.type;if(E==null||typeof E=="string")return;var k;if(typeof E=="function")k=E.propTypes;else if(typeof E=="object"&&(E.$$typeof===s||E.$$typeof===g))k=E.propTypes;else return;if(k){var N=it(E);Ka(k,f.props,"prop",N,f)}else if(E.PropTypes!==void 0&&!Xe){Xe=!0;var O=it(E);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",O||"Unknown")}typeof E.getDefaultProps=="function"&&!E.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function fs(f){{for(var E=Object.keys(f.props),k=0;k<E.length;k++){var N=E[k];if(N!=="children"&&N!=="key"){Mt(f),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",N),Mt(null);break}}f.ref!==null&&(Mt(f),w("Invalid attribute `ref` supplied to `React.Fragment`."),Mt(null))}}var rr={};function ir(f,E,k,N,O,X){{var L=j(f);if(!L){var $="";(f===void 0||typeof f=="object"&&f!==null&&Object.keys(f).length===0)&&($+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Q=ss();Q?$+=Q:$+=Zn();var H;f===null?H="null":Fe(f)?H="array":f!==void 0&&f.$$typeof===e?(H="<"+(it(f.type)||"Unknown")+" />",$=" Did you accidentally export a JSX literal instead of a component?"):H=typeof f,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",H,$)}var V=as(f,E,k,O,X);if(V==null)return V;if(L){var st=E.children;if(st!==void 0)if(N)if(Fe(st)){for(var Dt=0;Dt<st.length;Dt++)nr(st[Dt],f);Object.freeze&&Object.freeze(st)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else nr(st,f)}if(Gt.call(E,"key")){var kt=it(f),nt=Object.keys(E).filter(function(ys){return ys!=="key"}),Be=nt.length>0?"{key: someKey, "+nt.join(": ..., ")+": ...}":"{key: someKey}";if(!rr[kt+Be]){var ps=nt.length>0?"{"+nt.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,Be,kt,ps,kt),rr[kt+Be]=!0}}return f===r?fs(V):ls(V),V}}function hs(f,E,k){return ir(f,E,k,!0)}function ds(f,E,k){return ir(f,E,k,!1)}var gs=ds,vs=hs;It.Fragment=r,It.jsx=gs,It.jsxs=vs})()),It}var je;function ar(){return je||(je=1,process.env.NODE_ENV==="production"?Ut.exports=or():Ut.exports=ur()),Ut.exports}var sr=ar(),cr={value:()=>{}};function zt(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Kt(n)}function Kt(t){this._=t}function lr(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Kt.prototype=zt.prototype={constructor:Kt,on:function(t,e){var n=this._,r=lr(t+"",n),i,o=-1,u=r.length;if(arguments.length<2){for(;++o<u;)if((i=(t=r[o]).type)&&(i=fr(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<u;)if(i=(t=r[o]).type)n[i]=We(n[i],t.name,e);else if(e==null)for(i in n)n[i]=We(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Kt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function fr(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function We(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=cr,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var me="http://www.w3.org/1999/xhtml";const Ge={svg:"http://www.w3.org/2000/svg",xhtml:me,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Ge.hasOwnProperty(e)?{space:Ge[e],local:t}:t}function hr(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===me&&e.documentElement.namespaceURI===me?e.createElement(t):e.createElementNS(n,t)}}function dr(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ue(t){var e=Jt(t);return(e.local?dr:hr)(e)}function gr(){}function xe(t){return t==null?gr:function(){return this.querySelector(t)}}function vr(t){typeof t!="function"&&(t=xe(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],u=o.length,a=r[i]=new Array(u),s,c,l=0;l<u;++l)(s=o[l])&&(c=t.call(s,s.__data__,l,o))&&("__data__"in s&&(c.__data__=s.__data__),a[l]=c);return new rt(r,this._parents)}function pr(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function yr(){return[]}function Ke(t){return t==null?yr:function(){return this.querySelectorAll(t)}}function mr(t){return function(){return pr(t.apply(this,arguments))}}function xr(t){typeof t=="function"?t=mr(t):t=Ke(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var u=e[o],a=u.length,s,c=0;c<a;++c)(s=u[c])&&(r.push(t.call(s,s.__data__,c,u)),i.push(s));return new rt(r,i)}function Je(t){return function(){return this.matches(t)}}function Qe(t){return function(e){return e.matches(t)}}var _r=Array.prototype.find;function wr(t){return function(){return _r.call(this.children,t)}}function br(){return this.firstElementChild}function Er(t){return this.select(t==null?br:wr(typeof t=="function"?t:Qe(t)))}var kr=Array.prototype.filter;function Tr(){return Array.from(this.children)}function Sr(t){return function(){return kr.call(this.children,t)}}function Cr(t){return this.selectAll(t==null?Tr:Sr(typeof t=="function"?t:Qe(t)))}function Ar(t){typeof t!="function"&&(t=Je(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],u=o.length,a=r[i]=[],s,c=0;c<u;++c)(s=o[c])&&t.call(s,s.__data__,c,o)&&a.push(s);return new rt(r,this._parents)}function Ze(t){return new Array(t.length)}function Nr(){return new rt(this._enter||this._groups.map(Ze),this._parents)}function Qt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Qt.prototype={constructor:Qt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Rr(t){return function(){return t}}function Mr(t,e,n,r,i,o){for(var u=0,a,s=e.length,c=o.length;u<c;++u)(a=e[u])?(a.__data__=o[u],r[u]=a):n[u]=new Qt(t,o[u]);for(;u<s;++u)(a=e[u])&&(i[u]=a)}function Dr(t,e,n,r,i,o,u){var a,s,c=new Map,l=e.length,g=o.length,d=new Array(l),h;for(a=0;a<l;++a)(s=e[a])&&(d[a]=h=u.call(s,s.__data__,a,e)+"",c.has(h)?i[a]=s:c.set(h,s));for(a=0;a<g;++a)h=u.call(t,o[a],a,o)+"",(s=c.get(h))?(r[a]=s,s.__data__=o[a],c.delete(h)):n[a]=new Qt(t,o[a]);for(a=0;a<l;++a)(s=e[a])&&c.get(d[a])===s&&(i[a]=s)}function Pr(t){return t.__data__}function Ir(t,e){if(!arguments.length)return Array.from(this,Pr);var n=e?Dr:Mr,r=this._parents,i=this._groups;typeof t!="function"&&(t=Rr(t));for(var o=i.length,u=new Array(o),a=new Array(o),s=new Array(o),c=0;c<o;++c){var l=r[c],g=i[c],d=g.length,h=zr(t.call(l,l&&l.__data__,c,r)),x=h.length,v=a[c]=new Array(x),y=u[c]=new Array(x),p=s[c]=new Array(d);n(l,g,v,y,p,h,e);for(var w=0,A=0,_,S;w<x;++w)if(_=v[w]){for(w>=A&&(A=w+1);!(S=y[A])&&++A<x;);_._next=S||null}}return u=new rt(u,r),u._enter=a,u._exit=s,u}function zr(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function $r(){return new rt(this._exit||this._groups.map(Ze),this._parents)}function Lr(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Or(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,u=Math.min(i,o),a=new Array(i),s=0;s<u;++s)for(var c=n[s],l=r[s],g=c.length,d=a[s]=new Array(g),h,x=0;x<g;++x)(h=c[x]||l[x])&&(d[x]=h);for(;s<i;++s)a[s]=n[s];return new rt(a,this._parents)}function Fr(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],u;--i>=0;)(u=r[i])&&(o&&u.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(u,o),o=u);return this}function Yr(t){t||(t=Xr);function e(g,d){return g&&d?t(g.__data__,d.__data__):!g-!d}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var u=n[o],a=u.length,s=i[o]=new Array(a),c,l=0;l<a;++l)(c=u[l])&&(s[l]=c);s.sort(e)}return new rt(i,this._parents).order()}function Xr(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function qr(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Br(){return Array.from(this)}function Hr(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null}function Vr(){let t=0;for(const e of this)++t;return t}function jr(){return!this.node()}function Wr(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,u=i.length,a;o<u;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function Gr(t){return function(){this.removeAttribute(t)}}function Ur(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Kr(t,e){return function(){this.setAttribute(t,e)}}function Jr(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Qr(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Zr(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ti(t,e){var n=Jt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Ur:Gr:typeof e=="function"?n.local?Zr:Qr:n.local?Jr:Kr)(n,e))}function tn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ei(t){return function(){this.style.removeProperty(t)}}function ni(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ri(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function ii(t,e,n){return arguments.length>1?this.each((e==null?ei:typeof e=="function"?ri:ni)(t,e,n??"")):Tt(this.node(),t)}function Tt(t,e){return t.style.getPropertyValue(e)||tn(t).getComputedStyle(t,null).getPropertyValue(e)}function oi(t){return function(){delete this[t]}}function ui(t,e){return function(){this[t]=e}}function ai(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function si(t,e){return arguments.length>1?this.each((e==null?oi:typeof e=="function"?ai:ui)(t,e)):this.node()[t]}function en(t){return t.trim().split(/^|\s+/)}function _e(t){return t.classList||new nn(t)}function nn(t){this._node=t,this._names=en(t.getAttribute("class")||"")}nn.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function rn(t,e){for(var n=_e(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function on(t,e){for(var n=_e(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function ci(t){return function(){rn(this,t)}}function li(t){return function(){on(this,t)}}function fi(t,e){return function(){(e.apply(this,arguments)?rn:on)(this,t)}}function hi(t,e){var n=en(t+"");if(arguments.length<2){for(var r=_e(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?fi:e?ci:li)(n,e))}function di(){this.textContent=""}function gi(t){return function(){this.textContent=t}}function vi(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function pi(t){return arguments.length?this.each(t==null?di:(typeof t=="function"?vi:gi)(t)):this.node().textContent}function yi(){this.innerHTML=""}function mi(t){return function(){this.innerHTML=t}}function xi(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function _i(t){return arguments.length?this.each(t==null?yi:(typeof t=="function"?xi:mi)(t)):this.node().innerHTML}function wi(){this.nextSibling&&this.parentNode.appendChild(this)}function bi(){return this.each(wi)}function Ei(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ki(){return this.each(Ei)}function Ti(t){var e=typeof t=="function"?t:Ue(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Si(){return null}function Ci(t,e){var n=typeof t=="function"?t:Ue(t),r=e==null?Si:typeof e=="function"?e:xe(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ai(){var t=this.parentNode;t&&t.removeChild(this)}function Ni(){return this.each(Ai)}function Ri(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Mi(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Di(t){return this.select(t?Mi:Ri)}function Pi(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ii(t){return function(e){t.call(this,e,this.__data__)}}function zi(t){return t.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 $i(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function Li(t,e,n){return function(){var r=this.__on,i,o=Ii(e);if(r){for(var u=0,a=r.length;u<a;++u)if((i=r[u]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Oi(t,e,n){var r=zi(t+""),i,o=r.length,u;if(arguments.length<2){var a=this.node().__on;if(a){for(var s=0,c=a.length,l;s<c;++s)for(i=0,l=a[s];i<o;++i)if((u=r[i]).type===l.type&&u.name===l.name)return l.value}return}for(a=e?Li:$i,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function un(t,e,n){var r=tn(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Fi(t,e){return function(){return un(this,t,e)}}function Yi(t,e){return function(){return un(this,t,e.apply(this,arguments))}}function Xi(t,e){return this.each((typeof e=="function"?Yi:Fi)(t,e))}function*qi(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,u;i<o;++i)(u=r[i])&&(yield u)}var an=[null];function rt(t,e){this._groups=t,this._parents=e}function $t(){return new rt([[document.documentElement]],an)}function Bi(){return this}rt.prototype=$t.prototype={constructor:rt,select:vr,selectAll:xr,selectChild:Er,selectChildren:Cr,filter:Ar,data:Ir,enter:Nr,exit:$r,join:Lr,merge:Or,selection:Bi,order:Fr,sort:Yr,call:qr,nodes:Br,node:Hr,size:Vr,empty:jr,each:Wr,attr:ti,style:ii,property:si,classed:hi,text:pi,html:_i,raise:bi,lower:ki,append:Ti,insert:Ci,remove:Ni,clone:Di,datum:Pi,on:Oi,dispatch:Xi,[Symbol.iterator]:qi};function G(t){return typeof t=="string"?new rt([[document.querySelector(t)]],[document.documentElement]):new rt([[t]],an)}function Hi(t){let e;for(;e=t.sourceEvent;)t=e;return t}function dt(t,e){if(t=Hi(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const Vi={passive:!1},Lt={capture:!0,passive:!1};function we(t){t.stopImmediatePropagation()}function St(t){t.preventDefault(),t.stopImmediatePropagation()}function sn(t){var e=t.document.documentElement,n=G(t).on("dragstart.drag",St,Lt);"onselectstart"in e?n.on("selectstart.drag",St,Lt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function cn(t,e){var n=t.document.documentElement,r=G(t).on("dragstart.drag",null);e&&(r.on("click.drag",St,Lt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Zt=t=>()=>t;function be(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:u,y:a,dx:s,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}be.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function ji(t){return!t.ctrlKey&&!t.button}function Wi(){return this.parentNode}function Gi(t,e){return e??{x:t.x,y:t.y}}function Ui(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ki(){var t=ji,e=Wi,n=Gi,r=Ui,i={},o=zt("start","drag","end"),u=0,a,s,c,l,g=0;function d(_){_.on("mousedown.drag",h).filter(r).on("touchstart.drag",y).on("touchmove.drag",p,Vi).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(_,S){if(!(l||!t.call(this,_,S))){var R=A(this,e.call(this,_,S),_,S,"mouse");R&&(G(_.view).on("mousemove.drag",x,Lt).on("mouseup.drag",v,Lt),sn(_.view),we(_),c=!1,a=_.clientX,s=_.clientY,R("start",_))}}function x(_){if(St(_),!c){var S=_.clientX-a,R=_.clientY-s;c=S*S+R*R>g}i.mouse("drag",_)}function v(_){G(_.view).on("mousemove.drag mouseup.drag",null),cn(_.view,c),St(_),i.mouse("end",_)}function y(_,S){if(t.call(this,_,S)){var R=_.changedTouches,I=e.call(this,_,S),F=R.length,B,j;for(B=0;B<F;++B)(j=A(this,I,_,S,R[B].identifier,R[B]))&&(we(_),j("start",_,R[B]))}}function p(_){var S=_.changedTouches,R=S.length,I,F;for(I=0;I<R;++I)(F=i[S[I].identifier])&&(St(_),F("drag",_,S[I]))}function w(_){var S=_.changedTouches,R=S.length,I,F;for(l&&clearTimeout(l),l=setTimeout(function(){l=null},500),I=0;I<R;++I)(F=i[S[I].identifier])&&(we(_),F("end",_,S[I]))}function A(_,S,R,I,F,B){var j=o.copy(),tt=dt(B||R,S),bt,it,m;if((m=n.call(_,new be("beforestart",{sourceEvent:R,target:d,identifier:F,active:u,x:tt[0],y:tt[1],dx:0,dy:0,dispatch:j}),I))!=null)return bt=m.x-tt[0]||0,it=m.y-tt[1]||0,function T(b,C,M){var D=tt,P;switch(b){case"start":i[F]=T,P=u++;break;case"end":delete i[F],--u;case"drag":tt=dt(M||C,S),P=u;break}j.call(b,_,new be(b,{sourceEvent:C,subject:m,target:d,identifier:F,active:P,x:tt[0]+bt,y:tt[1]+it,dx:tt[0]-D[0],dy:tt[1]-D[1],dispatch:j}),I)}}return d.filter=function(_){return arguments.length?(t=typeof _=="function"?_:Zt(!!_),d):t},d.container=function(_){return arguments.length?(e=typeof _=="function"?_:Zt(_),d):e},d.subject=function(_){return arguments.length?(n=typeof _=="function"?_:Zt(_),d):n},d.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:Zt(!!_),d):r},d.on=function(){var _=o.on.apply(o,arguments);return _===o?d:_},d.clickDistance=function(_){return arguments.length?(g=(_=+_)*_,d):Math.sqrt(g)},d}function Ee(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ln(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ot(){}var Ft=.7,te=1/Ft,Ct="\\s*([+-]?\\d+)\\s*",Yt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ji=/^#([0-9a-f]{3,8})$/,Qi=new RegExp(`^rgb\\(${Ct},${Ct},${Ct}\\)$`),Zi=new RegExp(`^rgb\\(${ft},${ft},${ft}\\)$`),to=new RegExp(`^rgba\\(${Ct},${Ct},${Ct},${Yt}\\)$`),eo=new RegExp(`^rgba\\(${ft},${ft},${ft},${Yt}\\)$`),no=new RegExp(`^hsl\\(${Yt},${ft},${ft}\\)$`),ro=new RegExp(`^hsla\\(${Yt},${ft},${ft},${Yt}\\)$`),fn={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};Ee(Ot,Xt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:hn,formatHex:hn,formatHex8:io,formatHsl:oo,formatRgb:dn,toString:dn});function hn(){return this.rgb().formatHex()}function io(){return this.rgb().formatHex8()}function oo(){return mn(this).formatHsl()}function dn(){return this.rgb().formatRgb()}function Xt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ji.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?gn(e):n===3?new Z(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ee(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ee(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Qi.exec(t))?new Z(e[1],e[2],e[3],1):(e=Zi.exec(t))?new Z(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=to.exec(t))?ee(e[1],e[2],e[3],e[4]):(e=eo.exec(t))?ee(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=no.exec(t))?yn(e[1],e[2]/100,e[3]/100,1):(e=ro.exec(t))?yn(e[1],e[2]/100,e[3]/100,e[4]):fn.hasOwnProperty(t)?gn(fn[t]):t==="transparent"?new Z(NaN,NaN,NaN,0):null}function gn(t){return new Z(t>>16&255,t>>8&255,t&255,1)}function ee(t,e,n,r){return r<=0&&(t=e=n=NaN),new Z(t,e,n,r)}function uo(t){return t instanceof Ot||(t=Xt(t)),t?(t=t.rgb(),new Z(t.r,t.g,t.b,t.opacity)):new Z}function ke(t,e,n,r){return arguments.length===1?uo(t):new Z(t,e,n,r??1)}function Z(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Ee(Z,ke,ln(Ot,{brighter(t){return t=t==null?te:Math.pow(te,t),new Z(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new Z(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Z(xt(this.r),xt(this.g),xt(this.b),ne(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vn,formatHex:vn,formatHex8:ao,formatRgb:pn,toString:pn}));function vn(){return`#${_t(this.r)}${_t(this.g)}${_t(this.b)}`}function ao(){return`#${_t(this.r)}${_t(this.g)}${_t(this.b)}${_t((isNaN(this.opacity)?1:this.opacity)*255)}`}function pn(){const t=ne(this.opacity);return`${t===1?"rgb(":"rgba("}${xt(this.r)}, ${xt(this.g)}, ${xt(this.b)}${t===1?")":`, ${t})`}`}function ne(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function xt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _t(t){return t=xt(t),(t<16?"0":"")+t.toString(16)}function yn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ct(t,e,n,r)}function mn(t){if(t instanceof ct)return new ct(t.h,t.s,t.l,t.opacity);if(t instanceof Ot||(t=Xt(t)),!t)return new ct;if(t instanceof ct)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),u=NaN,a=o-i,s=(o+i)/2;return a?(e===o?u=(n-r)/a+(n<r)*6:n===o?u=(r-e)/a+2:u=(e-n)/a+4,a/=s<.5?o+i:2-o-i,u*=60):a=s>0&&s<1?0:u,new ct(u,a,s,t.opacity)}function so(t,e,n,r){return arguments.length===1?mn(t):new ct(t,e,n,r??1)}function ct(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Ee(ct,so,ln(Ot,{brighter(t){return t=t==null?te:Math.pow(te,t),new ct(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new ct(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Z(Te(t>=240?t-240:t+120,i,r),Te(t,i,r),Te(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new ct(xn(this.h),re(this.s),re(this.l),ne(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ne(this.opacity);return`${t===1?"hsl(":"hsla("}${xn(this.h)}, ${re(this.s)*100}%, ${re(this.l)*100}%${t===1?")":`, ${t})`}`}}));function xn(t){return t=(t||0)%360,t<0?t+360:t}function re(t){return Math.max(0,Math.min(1,t||0))}function Te(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const _n=t=>()=>t;function co(t,e){return function(n){return t+n*e}}function lo(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function fo(t){return(t=+t)==1?wn:function(e,n){return n-e?lo(e,n,t):_n(isNaN(e)?n:e)}}function wn(t,e){var n=e-t;return n?co(t,n):_n(isNaN(t)?e:t)}const bn=(function t(e){var n=fo(e);function r(i,o){var u=n((i=ke(i)).r,(o=ke(o)).r),a=n(i.g,o.g),s=n(i.b,o.b),c=wn(i.opacity,o.opacity);return function(l){return i.r=u(l),i.g=a(l),i.b=s(l),i.opacity=c(l),i+""}}return r.gamma=t,r})(1);function yt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Se=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ce=new RegExp(Se.source,"g");function ho(t){return function(){return t}}function go(t){return function(e){return t(e)+""}}function vo(t,e){var n=Se.lastIndex=Ce.lastIndex=0,r,i,o,u=-1,a=[],s=[];for(t=t+"",e=e+"";(r=Se.exec(t))&&(i=Ce.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),a[u]?a[u]+=o:a[++u]=o),(r=r[0])===(i=i[0])?a[u]?a[u]+=i:a[++u]=i:(a[++u]=null,s.push({i:u,x:yt(r,i)})),n=Ce.lastIndex;return n<e.length&&(o=e.slice(n),a[u]?a[u]+=o:a[++u]=o),a.length<2?s[0]?go(s[0].x):ho(e):(e=s.length,function(c){for(var l=0,g;l<e;++l)a[(g=s[l]).i]=g.x(c);return a.join("")})}var En=180/Math.PI,Ae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function kn(t,e,n,r,i,o){var u,a,s;return(u=Math.sqrt(t*t+e*e))&&(t/=u,e/=u),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,s/=a),t*r<e*n&&(t=-t,e=-e,s=-s,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*En,skewX:Math.atan(s)*En,scaleX:u,scaleY:a}}var ie;function po(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ae:kn(e.a,e.b,e.c,e.d,e.e,e.f)}function yo(t){return t==null||(ie||(ie=document.createElementNS("http://www.w3.org/2000/svg","g")),ie.setAttribute("transform",t),!(t=ie.transform.baseVal.consolidate()))?Ae:(t=t.matrix,kn(t.a,t.b,t.c,t.d,t.e,t.f))}function Tn(t,e,n,r){function i(c){return c.length?c.pop()+" ":""}function o(c,l,g,d,h,x){if(c!==g||l!==d){var v=h.push("translate(",null,e,null,n);x.push({i:v-4,x:yt(c,g)},{i:v-2,x:yt(l,d)})}else(g||d)&&h.push("translate("+g+e+d+n)}function u(c,l,g,d){c!==l?(c-l>180?l+=360:l-c>180&&(c+=360),d.push({i:g.push(i(g)+"rotate(",null,r)-2,x:yt(c,l)})):l&&g.push(i(g)+"rotate("+l+r)}function a(c,l,g,d){c!==l?d.push({i:g.push(i(g)+"skewX(",null,r)-2,x:yt(c,l)}):l&&g.push(i(g)+"skewX("+l+r)}function s(c,l,g,d,h,x){if(c!==g||l!==d){var v=h.push(i(h)+"scale(",null,",",null,")");x.push({i:v-4,x:yt(c,g)},{i:v-2,x:yt(l,d)})}else(g!==1||d!==1)&&h.push(i(h)+"scale("+g+","+d+")")}return function(c,l){var g=[],d=[];return c=t(c),l=t(l),o(c.translateX,c.translateY,l.translateX,l.translateY,g,d),u(c.rotate,l.rotate,g,d),a(c.skewX,l.skewX,g,d),s(c.scaleX,c.scaleY,l.scaleX,l.scaleY,g,d),c=l=null,function(h){for(var x=-1,v=d.length,y;++x<v;)g[(y=d[x]).i]=y.x(h);return g.join("")}}}var mo=Tn(po,"px, ","px)","deg)"),xo=Tn(yo,", ",")",")"),_o=1e-12;function Sn(t){return((t=Math.exp(t))+1/t)/2}function wo(t){return((t=Math.exp(t))-1/t)/2}function bo(t){return((t=Math.exp(2*t))-1)/(t+1)}const Eo=(function t(e,n,r){function i(o,u){var a=o[0],s=o[1],c=o[2],l=u[0],g=u[1],d=u[2],h=l-a,x=g-s,v=h*h+x*x,y,p;if(v<_o)p=Math.log(d/c)/e,y=function(I){return[a+I*h,s+I*x,c*Math.exp(e*I*p)]};else{var w=Math.sqrt(v),A=(d*d-c*c+r*v)/(2*c*n*w),_=(d*d-c*c-r*v)/(2*d*n*w),S=Math.log(Math.sqrt(A*A+1)-A),R=Math.log(Math.sqrt(_*_+1)-_);p=(R-S)/e,y=function(I){var F=I*p,B=Sn(S),j=c/(n*w)*(B*bo(e*F+S)-wo(S));return[a+j*h,s+j*x,c*B/Sn(e*F+S)]}}return y.duration=p*1e3*e/Math.SQRT2,y}return i.rho=function(o){var u=Math.max(.001,+o),a=u*u,s=a*a;return t(u,a,s)},i})(Math.SQRT2,2,4);var At=0,qt=0,Bt=0,Cn=1e3,oe,Ht,ue=0,wt=0,ae=0,Vt=typeof performance=="object"&&performance.now?performance:Date,An=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ne(){return wt||(An(ko),wt=Vt.now()+ae)}function ko(){wt=0}function se(){this._call=this._time=this._next=null}se.prototype=Re.prototype={constructor:se,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ne():+n)+(e==null?0:+e),!this._next&&Ht!==this&&(Ht?Ht._next=this:oe=this,Ht=this),this._call=t,this._time=n,Me()},stop:function(){this._call&&(this._call=null,this._time=1/0,Me())}};function Re(t,e,n){var r=new se;return r.restart(t,e,n),r}function To(){Ne(),++At;for(var t=oe,e;t;)(e=wt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--At}function Nn(){wt=(ue=Vt.now())+ae,At=qt=0;try{To()}finally{At=0,Co(),wt=0}}function So(){var t=Vt.now(),e=t-ue;e>Cn&&(ae-=e,ue=t)}function Co(){for(var t,e=oe,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:oe=n);Ht=t,Me(r)}function Me(t){if(!At){qt&&(qt=clearTimeout(qt));var e=t-wt;e>24?(t<1/0&&(qt=setTimeout(Nn,t-Vt.now()-ae)),Bt&&(Bt=clearInterval(Bt))):(Bt||(ue=Vt.now(),Bt=setInterval(So,Cn)),At=1,An(Nn))}}function Rn(t,e,n){var r=new se;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Ao=zt("start","end","cancel","interrupt"),No=[],Mn=0,Dn=1,De=2,ce=3,Pn=4,Pe=5,le=6;function fe(t,e,n,r,i,o){var u=t.__transition;if(!u)t.__transition={};else if(n in u)return;Ro(t,n,{name:e,index:r,group:i,on:Ao,tween:No,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Mn})}function Ie(t,e){var n=lt(t,e);if(n.state>Mn)throw new Error("too late; already scheduled");return n}function ht(t,e){var n=lt(t,e);if(n.state>ce)throw new Error("too late; already running");return n}function lt(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Ro(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Re(o,0,n.time);function o(c){n.state=Dn,n.timer.restart(u,n.delay,n.time),n.delay<=c&&u(c-n.delay)}function u(c){var l,g,d,h;if(n.state!==Dn)return s();for(l in r)if(h=r[l],h.name===n.name){if(h.state===ce)return Rn(u);h.state===Pn?(h.state=le,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete r[l]):+l<e&&(h.state=le,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete r[l])}if(Rn(function(){n.state===ce&&(n.state=Pn,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=De,n.on.call("start",t,t.__data__,n.index,n.group),n.state===De){for(n.state=ce,i=new Array(d=n.tween.length),l=0,g=-1;l<d;++l)(h=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(i[++g]=h);i.length=g+1}}function a(c){for(var l=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(s),n.state=Pe,1),g=-1,d=i.length;++g<d;)i[g].call(t,l);n.state===Pe&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){n.state=le,n.timer.stop(),delete r[e];for(var c in r)return;delete t.__transition}}function he(t,e){var n=t.__transition,r,i,o=!0,u;if(n){e=e==null?null:e+"";for(u in n){if((r=n[u]).name!==e){o=!1;continue}i=r.state>De&&r.state<Pe,r.state=le,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[u]}o&&delete t.__transition}}function Mo(t){return this.each(function(){he(this,t)})}function Do(t,e){var n,r;return function(){var i=ht(this,t),o=i.tween;if(o!==n){r=n=o;for(var u=0,a=r.length;u<a;++u)if(r[u].name===e){r=r.slice(),r.splice(u,1);break}}i.tween=r}}function Po(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=ht(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:e,value:n},s=0,c=i.length;s<c;++s)if(i[s].name===e){i[s]=a;break}s===c&&i.push(a)}o.tween=i}}function Io(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=lt(this.node(),n).tween,i=0,o=r.length,u;i<o;++i)if((u=r[i]).name===t)return u.value;return null}return this.each((e==null?Do:Po)(n,t,e))}function ze(t,e,n){var r=t._id;return t.each(function(){var i=ht(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return lt(i,r).value[e]}}function In(t,e){var n;return(typeof e=="number"?yt:e instanceof Xt?bn:(n=Xt(e))?(e=n,bn):vo)(t,e)}function zo(t){return function(){this.removeAttribute(t)}}function $o(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Lo(t,e,n){var r,i=n+"",o;return function(){var u=this.getAttribute(t);return u===i?null:u===r?o:o=e(r=u,n)}}function Oo(t,e,n){var r,i=n+"",o;return function(){var u=this.getAttributeNS(t.space,t.local);return u===i?null:u===r?o:o=e(r=u,n)}}function Fo(t,e,n){var r,i,o;return function(){var u,a=n(this),s;return a==null?void this.removeAttribute(t):(u=this.getAttribute(t),s=a+"",u===s?null:u===r&&s===i?o:(i=s,o=e(r=u,a)))}}function Yo(t,e,n){var r,i,o;return function(){var u,a=n(this),s;return a==null?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),s=a+"",u===s?null:u===r&&s===i?o:(i=s,o=e(r=u,a)))}}function Xo(t,e){var n=Jt(t),r=n==="transform"?xo:In;return this.attrTween(t,typeof e=="function"?(n.local?Yo:Fo)(n,r,ze(this,"attr."+t,e)):e==null?(n.local?$o:zo)(n):(n.local?Oo:Lo)(n,r,e))}function qo(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Bo(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Ho(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Bo(t,o)),n}return i._value=e,i}function Vo(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&qo(t,o)),n}return i._value=e,i}function jo(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Jt(t);return this.tween(n,(r.local?Ho:Vo)(r,e))}function Wo(t,e){return function(){Ie(this,t).delay=+e.apply(this,arguments)}}function Go(t,e){return e=+e,function(){Ie(this,t).delay=e}}function Uo(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Wo:Go)(e,t)):lt(this.node(),e).delay}function Ko(t,e){return function(){ht(this,t).duration=+e.apply(this,arguments)}}function Jo(t,e){return e=+e,function(){ht(this,t).duration=e}}function Qo(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ko:Jo)(e,t)):lt(this.node(),e).duration}function Zo(t,e){if(typeof e!="function")throw new Error;return function(){ht(this,t).ease=e}}function tu(t){var e=this._id;return arguments.length?this.each(Zo(e,t)):lt(this.node(),e).ease}function eu(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;ht(this,t).ease=n}}function nu(t){if(typeof t!="function")throw new Error;return this.each(eu(this._id,t))}function ru(t){typeof t!="function"&&(t=Je(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],u=o.length,a=r[i]=[],s,c=0;c<u;++c)(s=o[c])&&t.call(s,s.__data__,c,o)&&a.push(s);return new gt(r,this._parents,this._name,this._id)}function iu(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s=e[a],c=n[a],l=s.length,g=u[a]=new Array(l),d,h=0;h<l;++h)(d=s[h]||c[h])&&(g[h]=d);for(;a<r;++a)u[a]=e[a];return new gt(u,this._parents,this._name,this._id)}function ou(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function uu(t,e,n){var r,i,o=ou(e)?Ie:ht;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(e,n),u.on=i}}function au(t,e){var n=this._id;return arguments.length<2?lt(this.node(),n).on.on(t):this.each(uu(n,t,e))}function su(t)