Vierte Etappe. Der Client-Zustand hatte bisher keinen Ort: zwei handgebaute
useSyncExternalStore-Speicher, drei CustomEvent-Kanaele und ein localStorage-Griff
mitten in einem useState — verteilt ueber fuenf Dateien.
## Ein Store (Befund B-08/B-09)
app/store.ts (Zustand, 1,2 kB gzip) haelt genau vier Dinge: Bedienvorlieben
(Schiene, Expertenmodus, Palette), die Lage des Ereignisstroms und die
Meldungs-Warteschlange. Der Kopfkommentar nennt die Regel, nach der etwas dort
landen darf — und ein Test prueft sie: gespeichert werden AUSSCHLIESSLICH
Schienen- und Expertenmodus-Zustand, kein Strom, keine Meldungen, kein Geheimnis.
Der Metrik-Verlauf bleibt bewusst DRAUSSEN (lib/metricsStore.ts): Er nimmt ab P4
jede Sekunde einen Messpunkt entgegen, ein Store-Update pro Sekunde wuerde jede
abonnierende Komponente neu rendern.
Die drei CustomEvent-Kanaele sind ERSATZLOS weg — `grep -r dispatchEvent src`
liefert nichts mehr. Wer die Schublade oeffnen will, setzt `?system=`; wer springen
will, navigiert. Auch der letzte Rest von P2 (`mc-palette-open`) ist aufgeloest.
## Statusleiste (Spezifikation §4.1)
Der Zustand der Box stand bisher verstreut: die Ampel unten in der Sidebar, die
Auslastung nur im Cockpit, das aktive Modell nur im Modell-Manager. Wer in der
Konsole arbeitete, sah gar nichts.
Jetzt eine feste Leiste ueber allen Ansichten: Motor/Hirn-Ampel (klickbar zum
Agenten) · aktive Rolle + Durchsatz mit Sparkline · geteilter Speicher ALS BALKEN
(nicht als Prozent — 128 GB Unified Memory ist die Kernzahl dieser Box) · CPU/GPU
· Temperatur (ab 85 °C bernstein) · Betriebszeit · Token-Summe · Live-Anzeige.
Die Sparklines sind eigenes SVG, ~20 Zeilen. Fuer eine 56-Pixel-Linie waere eine
Diagramm-Bibliothek Verschwendung.
Dafuer neu im Backend: `uptime_s` in /api/system/status (psutil.boot_time).
Gehoert dorthin, weil die Box sich woechentlich selbst neu startet — dann ist
"laeuft seit 20 Minuten" die Antwort auf eine ganze Klasse von Fragen.
Liefert psutil nichts, steht dort None und die Leiste blendet das Feld aus,
statt eine Zahl zu erfinden.
## aria-live (Befund B-11) — und diesmal mit Absender
Im ganzen Frontend gab es KEIN einziges aria-live. app/shell/Meldungen.tsx ist
jetzt die eine Stelle fuer beilaeufige Rueckmeldungen; Fehler bekommen
`assertive` und bleiben stehen, alles andere `polite` und raeumt sich weg.
Wichtig: Die Region ist keine Attrappe. Gespeist wird sie von den Uebergaengen des
Ereignisstroms und vom Konsolen-Neustart (mit dem echten Grund aus ApiError.detail).
Der erste Verbindungsaufbau wird bewusst NICHT gemeldet — sonst begruesst jede
Seite den Nutzer mit "Verbindung wieder da".
## Ehrliche Anzeige statt stillem Altern (Befund B-15/B-18)
lib/events.ts fuehrt die Stromlage jetzt im Store: live · nachlauf · getrennt.
Beim Wechsel wird EINMAL invalidiert — vorher las relax() den Zustand erst beim
naechsten Refetch, nach einem Riss blieb die UI bis zu 150 s im langsamen Modus.
## Bahnbreiten-Deckel (Befund B-10)
Die Arbeitsflaeche endet bei 1600 px. Ohne Deckel zog sich das Cockpit auf einem
3440-px-Ultrawide auf ueber 3 000 px, waehrend die Wurzel-Schriftgroesse mitwuchs
und die Zeilen GROESSER statt lesbarer machte.
## Nebenbei
Der Buendel-Budget-Check aus P0 war fragil: `ls dist/assets/index-*.js | head -1`
kann den falschen treffen, weil Rollup auch kleine geteilte Module "index-*.js"
nennt (gemessen: ein 67-Byte-Chunk neben dem 374-kB-Einstieg). Er waere dann still
immer gruen gewesen. Beide Ampel-Dateien lesen den Einstieg jetzt aus index.html.
## Verifiziert im Browser
Statusleiste: alle Felder mit Live-Daten, "Laeuft seit 1 Std 10 min"
Backend abgewuergt -> Leiste springt auf "Nachlauf" UND die aria-live-Region
meldet "Verbindung zur Zentrale verloren" (polite)
Backend zurueck -> "Live", ohne Begruessungs-Meldung
Cockpit-Kachel -> /cockpit?system=logs, Schublade offen, Reiter "System-Logs"
Arbeitsflaeche -> max-width 1600 px
33/33 Tests gruen (7 neue fuer den Store) · ESLint 0 Fehler · tsc sauber ·
Einstieg 118 153 B gzip / Budget 125 000.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
53 lines
192 KiB
JavaScript
53 lines
192 KiB
JavaScript
var to=Object.defineProperty;var eo=(e,n,r)=>n in e?to(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var Bn=(e,n,r)=>eo(e,typeof n!="symbol"?n+"":n,r);import{c as no,r as W,am as ro,an as io,j as $,ao as oo,ap as ao,n as so,b as Ae,L as Ke,a0 as uo,aq as lo}from"./index-CB2Jz083.js";import{i as Ft,c as Xn,a as Yn,b as co,o as fo,m as Zn,d as Kn}from"./string-DoZi9Vij.js";import{R as ho}from"./refresh-cw-BaiqRBZd.js";import{S as po}from"./search-DIWv8lX1.js";import{F as go}from"./file-text-jLFOD20t.js";/**
|
|
* @license lucide-react v0.460.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const yo=no("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);function _o(e,n){let r=0;for(let i of e)(i=+i)&&(r+=i);return r}var Qn=180/Math.PI,fn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Yr(e,n,r,i,o,a){var s,u,c;return(s=Math.sqrt(e*e+n*n))&&(e/=s,n/=s),(c=e*r+n*i)&&(r-=e*c,i-=n*c),(u=Math.sqrt(r*r+i*i))&&(r/=u,i/=u,c/=u),e*i<n*r&&(e=-e,n=-n,c=-c,s=-s),{translateX:o,translateY:a,rotate:Math.atan2(n,e)*Qn,skewX:Math.atan(c)*Qn,scaleX:s,scaleY:u}}var xe;function vo(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?fn:Yr(n.a,n.b,n.c,n.d,n.e,n.f)}function mo(e){return e==null||(xe||(xe=document.createElementNS("http://www.w3.org/2000/svg","g")),xe.setAttribute("transform",e),!(e=xe.transform.baseVal.consolidate()))?fn:(e=e.matrix,Yr(e.a,e.b,e.c,e.d,e.e,e.f))}function Zr(e,n,r,i){function o(l){return l.length?l.pop()+" ":""}function a(l,f,h,d,p,y){if(l!==h||f!==d){var x=p.push("translate(",null,n,null,r);y.push({i:x-4,x:Ft(l,h)},{i:x-2,x:Ft(f,d)})}else(h||d)&&p.push("translate("+h+n+d+r)}function s(l,f,h,d){l!==f?(l-f>180?f+=360:f-l>180&&(l+=360),d.push({i:h.push(o(h)+"rotate(",null,i)-2,x:Ft(l,f)})):f&&h.push(o(h)+"rotate("+f+i)}function u(l,f,h,d){l!==f?d.push({i:h.push(o(h)+"skewX(",null,i)-2,x:Ft(l,f)}):f&&h.push(o(h)+"skewX("+f+i)}function c(l,f,h,d,p,y){if(l!==h||f!==d){var x=p.push(o(p)+"scale(",null,",",null,")");y.push({i:x-4,x:Ft(l,h)},{i:x-2,x:Ft(f,d)})}else(h!==1||d!==1)&&p.push(o(p)+"scale("+h+","+d+")")}return function(l,f){var h=[],d=[];return l=e(l),f=e(f),a(l.translateX,l.translateY,f.translateX,f.translateY,h,d),s(l.rotate,f.rotate,h,d),u(l.skewX,f.skewX,h,d),c(l.scaleX,l.scaleY,f.scaleX,f.scaleY,h,d),l=f=null,function(p){for(var y=-1,x=d.length,m;++y<x;)h[(m=d[y]).i]=m.x(p);return h.join("")}}}var xo=Zr(vo,"px, ","px)","deg)"),bo=Zr(mo,", ",")",")"),wo=1e-12;function Jn(e){return((e=Math.exp(e))+1/e)/2}function ko(e){return((e=Math.exp(e))-1/e)/2}function Co(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ao=(function e(n,r,i){function o(a,s){var u=a[0],c=a[1],l=a[2],f=s[0],h=s[1],d=s[2],p=f-u,y=h-c,x=p*p+y*y,m,g;if(x<wo)g=Math.log(d/l)/n,m=function(M){return[u+M*p,c+M*y,l*Math.exp(n*M*g)]};else{var k=Math.sqrt(x),w=(d*d-l*l+i*x)/(2*l*r*k),_=(d*d-l*l-i*x)/(2*d*r*k),v=Math.log(Math.sqrt(w*w+1)-w),A=Math.log(Math.sqrt(_*_+1)-_);g=(A-v)/n,m=function(M){var T=M*g,R=Jn(v),P=l/(r*k)*(R*Co(n*T+v)-ko(v));return[u+P*p,c+P*y,l*R/Jn(n*T+v)]}}return m.duration=g*1e3*n/Math.SQRT2,m}return o.rho=function(a){var s=Math.max(.001,+a),u=s*s,c=u*u;return e(s,u,c)},o})(Math.SQRT2,2,4);function So(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],c=!0,l=!1;try{if(a=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);c=!0);}catch(f){l=!0,o=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return u}}function Mo(e,n,r){return n=jo(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function tr(e,n){return Oo(e)||So(e,n)||Kr(e,n)||No()}function To(e){return Po(e)||Eo(e)||Kr(e)||zo()}function Po(e){if(Array.isArray(e))return hn(e)}function Oo(e){if(Array.isArray(e))return e}function Eo(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Kr(e,n){if(e){if(typeof e=="string")return hn(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 hn(e,n)}}function hn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function zo(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function No(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ro(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function jo(e){var n=Ro(e,"string");return typeof n=="symbol"?n:String(n)}var Do=function(n,r){var i=new Set(r);return Object.assign.apply(Object,[{}].concat(To(Object.entries(n).filter(function(o){var a=tr(o,1),s=a[0];return!i.has(s)}).map(function(o){var a=tr(o,2),s=a[0],u=a[1];return Mo({},s,u)}))))};function Io(e,{wrapperElementType:n="div",nodeMapper:r=a=>a,methodNames:i=[],initPropNames:o=[]}={}){return W.forwardRef((a,s)=>{const u=W.useRef(),c=W.useMemo(()=>{const h=Object.fromEntries(o.filter(d=>a.hasOwnProperty(d)).map(d=>[d,a[d]]));return e(h)},[]);er(()=>{c(r(u.current))},W.useLayoutEffect),er(()=>c._destructor instanceof Function?c._destructor:void 0);const l=W.useCallback((h,...d)=>c[h]instanceof Function?c[h](...d):void 0,[c]),f=W.useRef({});return Object.keys(Do(a,[...i,...o])).filter(h=>f.current[h]!==a[h]).forEach(h=>l(h,a[h])),f.current=a,W.useImperativeHandle(s,()=>Object.fromEntries(i.map(h=>[h,(...d)=>l(h,...d)])),[l]),ro.createElement(n,{ref:u})})}function er(e,n=W.useEffect){const r=W.useRef(),i=W.useRef(!1),o=W.useRef(!1),[a,s]=W.useState(0);i.current&&(o.current=!0),n(()=>(i.current||(r.current=e(),i.current=!0),s(u=>u+1),()=>{o.current&&(r.current&&r.current(),r.current=void 0,i.current=!1,o.current=!1)}),[])}var dn="http://www.w3.org/1999/xhtml";const nr={svg:"http://www.w3.org/2000/svg",xhtml:dn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function We(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),nr.hasOwnProperty(n)?{space:nr[n],local:e}:e}function $o(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===dn&&n.documentElement.namespaceURI===dn?n.createElement(e):n.createElementNS(r,e)}}function Lo(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Qr(e){var n=We(e);return(n.local?Lo:$o)(n)}function Fo(){}function Tn(e){return e==null?Fo:function(){return this.querySelector(e)}}function Uo(e){typeof e!="function"&&(e=Tn(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a=n[o],s=a.length,u=i[o]=new Array(s),c,l,f=0;f<s;++f)(c=a[f])&&(l=e.call(c,c.__data__,f,a))&&("__data__"in c&&(l.__data__=c.__data__),u[f]=l);return new ft(i,this._parents)}function Ho(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qo(){return[]}function Jr(e){return e==null?qo:function(){return this.querySelectorAll(e)}}function Wo(e){return function(){return Ho(e.apply(this,arguments))}}function Go(e){typeof e=="function"?e=Wo(e):e=Jr(e);for(var n=this._groups,r=n.length,i=[],o=[],a=0;a<r;++a)for(var s=n[a],u=s.length,c,l=0;l<u;++l)(c=s[l])&&(i.push(e.call(c,c.__data__,l,s)),o.push(c));return new ft(i,o)}function ti(e){return function(){return this.matches(e)}}function ei(e){return function(n){return n.matches(e)}}var Vo=Array.prototype.find;function Bo(e){return function(){return Vo.call(this.children,e)}}function Xo(){return this.firstElementChild}function Yo(e){return this.select(e==null?Xo:Bo(typeof e=="function"?e:ei(e)))}var Zo=Array.prototype.filter;function Ko(){return Array.from(this.children)}function Qo(e){return function(){return Zo.call(this.children,e)}}function Jo(e){return this.selectAll(e==null?Ko:Qo(typeof e=="function"?e:ei(e)))}function ta(e){typeof e!="function"&&(e=ti(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a=n[o],s=a.length,u=i[o]=[],c,l=0;l<s;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&u.push(c);return new ft(i,this._parents)}function ni(e){return new Array(e.length)}function ea(){return new ft(this._enter||this._groups.map(ni),this._parents)}function ze(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}ze.prototype={constructor:ze,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 na(e){return function(){return e}}function ra(e,n,r,i,o,a){for(var s=0,u,c=n.length,l=a.length;s<l;++s)(u=n[s])?(u.__data__=a[s],i[s]=u):r[s]=new ze(e,a[s]);for(;s<c;++s)(u=n[s])&&(o[s]=u)}function ia(e,n,r,i,o,a,s){var u,c,l=new Map,f=n.length,h=a.length,d=new Array(f),p;for(u=0;u<f;++u)(c=n[u])&&(d[u]=p=s.call(c,c.__data__,u,n)+"",l.has(p)?o[u]=c:l.set(p,c));for(u=0;u<h;++u)p=s.call(e,a[u],u,a)+"",(c=l.get(p))?(i[u]=c,c.__data__=a[u],l.delete(p)):r[u]=new ze(e,a[u]);for(u=0;u<f;++u)(c=n[u])&&l.get(d[u])===c&&(o[u]=c)}function oa(e){return e.__data__}function aa(e,n){if(!arguments.length)return Array.from(this,oa);var r=n?ia:ra,i=this._parents,o=this._groups;typeof e!="function"&&(e=na(e));for(var a=o.length,s=new Array(a),u=new Array(a),c=new Array(a),l=0;l<a;++l){var f=i[l],h=o[l],d=h.length,p=sa(e.call(f,f&&f.__data__,l,i)),y=p.length,x=u[l]=new Array(y),m=s[l]=new Array(y),g=c[l]=new Array(d);r(f,h,x,m,g,p,n);for(var k=0,w=0,_,v;k<y;++k)if(_=x[k]){for(k>=w&&(w=k+1);!(v=m[w])&&++w<y;);_._next=v||null}}return s=new ft(s,i),s._enter=u,s._exit=c,s}function sa(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ua(){return new ft(this._exit||this._groups.map(ni),this._parents)}function la(e,n,r){var i=this.enter(),o=this,a=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),r==null?a.remove():r(a),i&&o?i.merge(o).order():o}function ca(e){for(var n=e.selection?e.selection():e,r=this._groups,i=n._groups,o=r.length,a=i.length,s=Math.min(o,a),u=new Array(o),c=0;c<s;++c)for(var l=r[c],f=i[c],h=l.length,d=u[c]=new Array(h),p,y=0;y<h;++y)(p=l[y]||f[y])&&(d[y]=p);for(;c<o;++c)u[c]=r[c];return new ft(u,this._parents)}function fa(){for(var e=this._groups,n=-1,r=e.length;++n<r;)for(var i=e[n],o=i.length-1,a=i[o],s;--o>=0;)(s=i[o])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function ha(e){e||(e=da);function n(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a){for(var s=r[a],u=s.length,c=o[a]=new Array(u),l,f=0;f<u;++f)(l=s[f])&&(c[f]=l);c.sort(n)}return new ft(o,this._parents).order()}function da(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function pa(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ga(){return Array.from(this)}function ya(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length;o<a;++o){var s=i[o];if(s)return s}return null}function _a(){let e=0;for(const n of this)++e;return e}function va(){return!this.node()}function ma(e){for(var n=this._groups,r=0,i=n.length;r<i;++r)for(var o=n[r],a=0,s=o.length,u;a<s;++a)(u=o[a])&&e.call(u,u.__data__,a,o);return this}function xa(e){return function(){this.removeAttribute(e)}}function ba(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wa(e,n){return function(){this.setAttribute(e,n)}}function ka(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function Ca(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Aa(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 Sa(e,n){var r=We(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?ba:xa:typeof n=="function"?r.local?Aa:Ca:r.local?ka:wa)(r,n))}function ri(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ma(e){return function(){this.style.removeProperty(e)}}function Ta(e,n,r){return function(){this.style.setProperty(e,n,r)}}function Pa(e,n,r){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function Oa(e,n,r){return arguments.length>1?this.each((n==null?Ma:typeof n=="function"?Pa:Ta)(e,n,r??"")):Bt(this.node(),e)}function Bt(e,n){return e.style.getPropertyValue(n)||ri(e).getComputedStyle(e,null).getPropertyValue(n)}function Ea(e){return function(){delete this[e]}}function za(e,n){return function(){this[e]=n}}function Na(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Ra(e,n){return arguments.length>1?this.each((n==null?Ea:typeof n=="function"?Na:za)(e,n)):this.node()[e]}function ii(e){return e.trim().split(/^|\s+/)}function Pn(e){return e.classList||new oi(e)}function oi(e){this._node=e,this._names=ii(e.getAttribute("class")||"")}oi.prototype={add:function(e){var n=this._names.indexOf(e);n<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 ai(e,n){for(var r=Pn(e),i=-1,o=n.length;++i<o;)r.add(n[i])}function si(e,n){for(var r=Pn(e),i=-1,o=n.length;++i<o;)r.remove(n[i])}function ja(e){return function(){ai(this,e)}}function Da(e){return function(){si(this,e)}}function Ia(e,n){return function(){(n.apply(this,arguments)?ai:si)(this,e)}}function $a(e,n){var r=ii(e+"");if(arguments.length<2){for(var i=Pn(this.node()),o=-1,a=r.length;++o<a;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof n=="function"?Ia:n?ja:Da)(r,n))}function La(){this.textContent=""}function Fa(e){return function(){this.textContent=e}}function Ua(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function Ha(e){return arguments.length?this.each(e==null?La:(typeof e=="function"?Ua:Fa)(e)):this.node().textContent}function qa(){this.innerHTML=""}function Wa(e){return function(){this.innerHTML=e}}function Ga(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function Va(e){return arguments.length?this.each(e==null?qa:(typeof e=="function"?Ga:Wa)(e)):this.node().innerHTML}function Ba(){this.nextSibling&&this.parentNode.appendChild(this)}function Xa(){return this.each(Ba)}function Ya(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Za(){return this.each(Ya)}function Ka(e){var n=typeof e=="function"?e:Qr(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function Qa(){return null}function Ja(e,n){var r=typeof e=="function"?e:Qr(e),i=n==null?Qa:typeof n=="function"?n:Tn(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function ts(){var e=this.parentNode;e&&e.removeChild(this)}function es(){return this.each(ts)}function ns(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function rs(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function is(e){return this.select(e?rs:ns)}function os(e){return arguments.length?this.property("__data__",e):this.node().__data__}function as(e){return function(n){e.call(this,n,this.__data__)}}function ss(e){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");return i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),{type:n,name:r}})}function us(e){return function(){var n=this.__on;if(n){for(var r=0,i=-1,o=n.length,a;r<o;++r)a=n[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):n[++i]=a;++i?n.length=i:delete this.__on}}}function ls(e,n,r){return function(){var i=this.__on,o,a=as(n);if(i){for(var s=0,u=i.length;s<u;++s)if((o=i[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=n;return}}this.addEventListener(e.type,a,r),o={type:e.type,name:e.name,value:n,listener:a,options:r},i?i.push(o):this.__on=[o]}}function cs(e,n,r){var i=ss(e+""),o,a=i.length,s;if(arguments.length<2){var u=this.node().__on;if(u){for(var c=0,l=u.length,f;c<l;++c)for(o=0,f=u[c];o<a;++o)if((s=i[o]).type===f.type&&s.name===f.name)return f.value}return}for(u=n?ls:us,o=0;o<a;++o)this.each(u(i[o],n,r));return this}function ui(e,n,r){var i=ri(e),o=i.CustomEvent;typeof o=="function"?o=new o(n,r):(o=i.document.createEvent("Event"),r?(o.initEvent(n,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function fs(e,n){return function(){return ui(this,e,n)}}function hs(e,n){return function(){return ui(this,e,n.apply(this,arguments))}}function ds(e,n){return this.each((typeof n=="function"?hs:fs)(e,n))}function*ps(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&(yield s)}var li=[null];function ft(e,n){this._groups=e,this._parents=n}function _e(){return new ft([[document.documentElement]],li)}function gs(){return this}ft.prototype=_e.prototype={constructor:ft,select:Uo,selectAll:Go,selectChild:Yo,selectChildren:Jo,filter:ta,data:aa,enter:ea,exit:ua,join:la,merge:ca,selection:gs,order:fa,sort:ha,call:pa,nodes:ga,node:ya,size:_a,empty:va,each:ma,attr:Sa,style:Oa,property:Ra,classed:$a,text:Ha,html:Va,raise:Xa,lower:Za,append:Ka,insert:Ja,remove:es,clone:is,datum:os,on:cs,dispatch:ds,[Symbol.iterator]:ps};function pt(e){return typeof e=="string"?new ft([[document.querySelector(e)]],[document.documentElement]):new ft([[e]],li)}function ys(e){let n;for(;n=e.sourceEvent;)e=n;return e}function xt(e,n){if(e=ys(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 o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}var _s={value:()=>{}};function ve(){for(var e=0,n=arguments.length,r={},i;e<n;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new Se(r)}function Se(e){this._=e}function vs(e,n){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}Se.prototype=ve.prototype={constructor:Se,on:function(e,n){var r=this._,i=vs(e+"",r),o,a=-1,s=i.length;if(arguments.length<2){for(;++a<s;)if((o=(e=i[a]).type)&&(o=ms(r[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++a<s;)if(o=(e=i[a]).type)r[o]=rr(r[o],e.name,n);else if(n==null)for(o in r)r[o]=rr(r[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var r in n)e[r]=n[r].slice();return new Se(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,a;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],i=0,o=a.length;i<o;++i)a[i].value.apply(n,r)},apply:function(e,n,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,a=i.length;o<a;++o)i[o].value.apply(n,r)}};function ms(e,n){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===n)return o.value}function rr(e,n,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===n){e[i]=_s,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:n,value:r}),e}const xs={passive:!1},pe={capture:!0,passive:!1};function Qe(e){e.stopImmediatePropagation()}function Vt(e){e.preventDefault(),e.stopImmediatePropagation()}function ci(e){var n=e.document.documentElement,r=pt(e).on("dragstart.drag",Vt,pe);"onselectstart"in n?r.on("selectstart.drag",Vt,pe):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function fi(e,n){var r=e.document.documentElement,i=pt(e).on("dragstart.drag",null);n&&(i.on("click.drag",Vt,pe),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const be=e=>()=>e;function pn(e,{sourceEvent:n,subject:r,target:i,identifier:o,active:a,x:s,y:u,dx:c,dy:l,dispatch:f}){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:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:f}})}pn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function bs(e){return!e.ctrlKey&&!e.button}function ws(){return this.parentNode}function ks(e,n){return n??{x:e.x,y:e.y}}function Cs(){return navigator.maxTouchPoints||"ontouchstart"in this}function As(){var e=bs,n=ws,r=ks,i=Cs,o={},a=ve("start","drag","end"),s=0,u,c,l,f,h=0;function d(_){_.on("mousedown.drag",p).filter(i).on("touchstart.drag",m).on("touchmove.drag",g,xs).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,v){if(!(f||!e.call(this,_,v))){var A=w(this,n.call(this,_,v),_,v,"mouse");A&&(pt(_.view).on("mousemove.drag",y,pe).on("mouseup.drag",x,pe),ci(_.view),Qe(_),l=!1,u=_.clientX,c=_.clientY,A("start",_))}}function y(_){if(Vt(_),!l){var v=_.clientX-u,A=_.clientY-c;l=v*v+A*A>h}o.mouse("drag",_)}function x(_){pt(_.view).on("mousemove.drag mouseup.drag",null),fi(_.view,l),Vt(_),o.mouse("end",_)}function m(_,v){if(e.call(this,_,v)){var A=_.changedTouches,M=n.call(this,_,v),T=A.length,R,P;for(R=0;R<T;++R)(P=w(this,M,_,v,A[R].identifier,A[R]))&&(Qe(_),P("start",_,A[R]))}}function g(_){var v=_.changedTouches,A=v.length,M,T;for(M=0;M<A;++M)(T=o[v[M].identifier])&&(Vt(_),T("drag",_,v[M]))}function k(_){var v=_.changedTouches,A=v.length,M,T;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),M=0;M<A;++M)(T=o[v[M].identifier])&&(Qe(_),T("end",_,v[M]))}function w(_,v,A,M,T,R){var P=a.copy(),N=xt(R||A,v),D,U,S;if((S=r.call(_,new pn("beforestart",{sourceEvent:A,target:d,identifier:T,active:s,x:N[0],y:N[1],dx:0,dy:0,dispatch:P}),M))!=null)return D=S.x-N[0]||0,U=S.y-N[1]||0,function j(E,C,O){var I=N,L;switch(E){case"start":o[T]=j,L=s++;break;case"end":delete o[T],--s;case"drag":N=xt(O||C,v),L=s;break}P.call(E,_,new pn(E,{sourceEvent:C,subject:S,target:d,identifier:T,active:L,x:N[0]+D,y:N[1]+U,dx:N[0]-I[0],dy:N[1]-I[1],dispatch:P}),M)}}return d.filter=function(_){return arguments.length?(e=typeof _=="function"?_:be(!!_),d):e},d.container=function(_){return arguments.length?(n=typeof _=="function"?_:be(_),d):n},d.subject=function(_){return arguments.length?(r=typeof _=="function"?_:be(_),d):r},d.touchable=function(_){return arguments.length?(i=typeof _=="function"?_:be(!!_),d):i},d.on=function(){var _=a.on.apply(a,arguments);return _===a?d:_},d.clickDistance=function(_){return arguments.length?(h=(_=+_)*_,d):Math.sqrt(h)},d}var Xt=0,ae=0,Qt=0,hi=1e3,Ne,se,Re=0,Ht=0,Ge=0,ge=typeof performance=="object"&&performance.now?performance:Date,di=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function On(){return Ht||(di(Ss),Ht=ge.now()+Ge)}function Ss(){Ht=0}function je(){this._call=this._time=this._next=null}je.prototype=En.prototype={constructor:je,restart:function(e,n,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?On():+r)+(n==null?0:+n),!this._next&&se!==this&&(se?se._next=this:Ne=this,se=this),this._call=e,this._time=r,gn()},stop:function(){this._call&&(this._call=null,this._time=1/0,gn())}};function En(e,n,r){var i=new je;return i.restart(e,n,r),i}function Ms(){On(),++Xt;for(var e=Ne,n;e;)(n=Ht-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Xt}function ir(){Ht=(Re=ge.now())+Ge,Xt=ae=0;try{Ms()}finally{Xt=0,Ps(),Ht=0}}function Ts(){var e=ge.now(),n=e-Re;n>hi&&(Ge-=n,Re=e)}function Ps(){for(var e,n=Ne,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:Ne=r);se=e,gn(i)}function gn(e){if(!Xt){ae&&(ae=clearTimeout(ae));var n=e-Ht;n>24?(e<1/0&&(ae=setTimeout(ir,e-ge.now()-Ge)),Qt&&(Qt=clearInterval(Qt))):(Qt||(Re=ge.now(),Qt=setInterval(Ts,hi)),Xt=1,di(ir))}}function or(e,n,r){var i=new je;return n=n==null?0:+n,i.restart(o=>{i.stop(),e(o+n)},n,r),i}var Os=ve("start","end","cancel","interrupt"),Es=[],pi=0,ar=1,yn=2,Me=3,sr=4,_n=5,Te=6;function Ve(e,n,r,i,o,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;zs(e,r,{name:n,index:i,group:o,on:Os,tween:Es,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:pi})}function zn(e,n){var r=vt(e,n);if(r.state>pi)throw new Error("too late; already scheduled");return r}function Ct(e,n){var r=vt(e,n);if(r.state>Me)throw new Error("too late; already running");return r}function vt(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function zs(e,n,r){var i=e.__transition,o;i[n]=r,r.timer=En(a,0,r.time);function a(l){r.state=ar,r.timer.restart(s,r.delay,r.time),r.delay<=l&&s(l-r.delay)}function s(l){var f,h,d,p;if(r.state!==ar)return c();for(f in i)if(p=i[f],p.name===r.name){if(p.state===Me)return or(s);p.state===sr?(p.state=Te,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[f]):+f<n&&(p.state=Te,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete i[f])}if(or(function(){r.state===Me&&(r.state=sr,r.timer.restart(u,r.delay,r.time),u(l))}),r.state=yn,r.on.call("start",e,e.__data__,r.index,r.group),r.state===yn){for(r.state=Me,o=new Array(d=r.tween.length),f=0,h=-1;f<d;++f)(p=r.tween[f].value.call(e,e.__data__,r.index,r.group))&&(o[++h]=p);o.length=h+1}}function u(l){for(var f=l<r.duration?r.ease.call(null,l/r.duration):(r.timer.restart(c),r.state=_n,1),h=-1,d=o.length;++h<d;)o[h].call(e,f);r.state===_n&&(r.on.call("end",e,e.__data__,r.index,r.group),c())}function c(){r.state=Te,r.timer.stop(),delete i[n];for(var l in i)return;delete e.__transition}}function Pe(e,n){var r=e.__transition,i,o,a=!0,s;if(r){n=n==null?null:n+"";for(s in r){if((i=r[s]).name!==n){a=!1;continue}o=i.state>yn&&i.state<_n,i.state=Te,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[s]}a&&delete e.__transition}}function Ns(e){return this.each(function(){Pe(this,e)})}function Rs(e,n){var r,i;return function(){var o=Ct(this,e),a=o.tween;if(a!==r){i=r=a;for(var s=0,u=i.length;s<u;++s)if(i[s].name===n){i=i.slice(),i.splice(s,1);break}}o.tween=i}}function js(e,n,r){var i,o;if(typeof r!="function")throw new Error;return function(){var a=Ct(this,e),s=a.tween;if(s!==i){o=(i=s).slice();for(var u={name:n,value:r},c=0,l=o.length;c<l;++c)if(o[c].name===n){o[c]=u;break}c===l&&o.push(u)}a.tween=o}}function Ds(e,n){var r=this._id;if(e+="",arguments.length<2){for(var i=vt(this.node(),r).tween,o=0,a=i.length,s;o<a;++o)if((s=i[o]).name===e)return s.value;return null}return this.each((n==null?Rs:js)(r,e,n))}function Nn(e,n,r){var i=e._id;return e.each(function(){var o=Ct(this,i);(o.value||(o.value={}))[n]=r.apply(this,arguments)}),function(o){return vt(o,i).value[n]}}function gi(e,n){var r;return(typeof n=="number"?Ft:n instanceof Xn?Yn:(r=Xn(n))?(n=r,Yn):co)(e,n)}function Is(e){return function(){this.removeAttribute(e)}}function $s(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ls(e,n,r){var i,o=r+"",a;return function(){var s=this.getAttribute(e);return s===o?null:s===i?a:a=n(i=s,r)}}function Fs(e,n,r){var i,o=r+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===i?a:a=n(i=s,r)}}function Us(e,n,r){var i,o,a;return function(){var s,u=r(this),c;return u==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=u+"",s===c?null:s===i&&c===o?a:(o=c,a=n(i=s,u)))}}function Hs(e,n,r){var i,o,a;return function(){var s,u=r(this),c;return u==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=u+"",s===c?null:s===i&&c===o?a:(o=c,a=n(i=s,u)))}}function qs(e,n){var r=We(e),i=r==="transform"?bo:gi;return this.attrTween(e,typeof n=="function"?(r.local?Hs:Us)(r,i,Nn(this,"attr."+e,n)):n==null?(r.local?$s:Is)(r):(r.local?Fs:Ls)(r,i,n))}function Ws(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function Gs(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function Vs(e,n){var r,i;function o(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&Gs(e,a)),r}return o._value=n,o}function Bs(e,n){var r,i;function o(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&Ws(e,a)),r}return o._value=n,o}function Xs(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 new Error;var i=We(e);return this.tween(r,(i.local?Vs:Bs)(i,n))}function Ys(e,n){return function(){zn(this,e).delay=+n.apply(this,arguments)}}function Zs(e,n){return n=+n,function(){zn(this,e).delay=n}}function Ks(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?Ys:Zs)(n,e)):vt(this.node(),n).delay}function Qs(e,n){return function(){Ct(this,e).duration=+n.apply(this,arguments)}}function Js(e,n){return n=+n,function(){Ct(this,e).duration=n}}function tu(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?Qs:Js)(n,e)):vt(this.node(),n).duration}function eu(e,n){if(typeof n!="function")throw new Error;return function(){Ct(this,e).ease=n}}function nu(e){var n=this._id;return arguments.length?this.each(eu(n,e)):vt(this.node(),n).ease}function ru(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!="function")throw new Error;Ct(this,e).ease=r}}function iu(e){if(typeof e!="function")throw new Error;return this.each(ru(this._id,e))}function ou(e){typeof e!="function"&&(e=ti(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a=n[o],s=a.length,u=i[o]=[],c,l=0;l<s;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&u.push(c);return new Rt(i,this._parents,this._name,this._id)}function au(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),u=0;u<a;++u)for(var c=n[u],l=r[u],f=c.length,h=s[u]=new Array(f),d,p=0;p<f;++p)(d=c[p]||l[p])&&(h[p]=d);for(;u<i;++u)s[u]=n[u];return new Rt(s,this._parents,this._name,this._id)}function su(e){return(e+"").trim().split(/^|\s+/).every(function(n){var r=n.indexOf(".");return r>=0&&(n=n.slice(0,r)),!n||n==="start"})}function uu(e,n,r){var i,o,a=su(n)?zn:Ct;return function(){var s=a(this,e),u=s.on;u!==i&&(o=(i=u).copy()).on(n,r),s.on=o}}function lu(e,n){var r=this._id;return arguments.length<2?vt(this.node(),r).on.on(e):this.each(uu(r,e,n))}function cu(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function fu(){return this.on("end.remove",cu(this._id))}function hu(e){var n=this._name,r=this._id;typeof e!="function"&&(e=Tn(e));for(var i=this._groups,o=i.length,a=new Array(o),s=0;s<o;++s)for(var u=i[s],c=u.length,l=a[s]=new Array(c),f,h,d=0;d<c;++d)(f=u[d])&&(h=e.call(f,f.__data__,d,u))&&("__data__"in f&&(h.__data__=f.__data__),l[d]=h,Ve(l[d],n,r,d,l,vt(f,r)));return new Rt(a,this._parents,n,r)}function du(e){var n=this._name,r=this._id;typeof e!="function"&&(e=Jr(e));for(var i=this._groups,o=i.length,a=[],s=[],u=0;u<o;++u)for(var c=i[u],l=c.length,f,h=0;h<l;++h)if(f=c[h]){for(var d=e.call(f,f.__data__,h,c),p,y=vt(f,r),x=0,m=d.length;x<m;++x)(p=d[x])&&Ve(p,n,r,x,d,y);a.push(d),s.push(f)}return new Rt(a,s,n,r)}var pu=_e.prototype.constructor;function gu(){return new pu(this._groups,this._parents)}function yu(e,n){var r,i,o;return function(){var a=Bt(this,e),s=(this.style.removeProperty(e),Bt(this,e));return a===s?null:a===r&&s===i?o:o=n(r=a,i=s)}}function yi(e){return function(){this.style.removeProperty(e)}}function _u(e,n,r){var i,o=r+"",a;return function(){var s=Bt(this,e);return s===o?null:s===i?a:a=n(i=s,r)}}function vu(e,n,r){var i,o,a;return function(){var s=Bt(this,e),u=r(this),c=u+"";return u==null&&(c=u=(this.style.removeProperty(e),Bt(this,e))),s===c?null:s===i&&c===o?a:(o=c,a=n(i=s,u))}}function mu(e,n){var r,i,o,a="style."+n,s="end."+a,u;return function(){var c=Ct(this,e),l=c.on,f=c.value[a]==null?u||(u=yi(n)):void 0;(l!==r||o!==f)&&(i=(r=l).copy()).on(s,o=f),c.on=i}}function xu(e,n,r){var i=(e+="")=="transform"?xo:gi;return n==null?this.styleTween(e,yu(e,i)).on("end.style."+e,yi(e)):typeof n=="function"?this.styleTween(e,vu(e,i,Nn(this,"style."+e,n))).each(mu(this._id,e)):this.styleTween(e,_u(e,i,n),r).on("end.style."+e,null)}function bu(e,n,r){return function(i){this.style.setProperty(e,n.call(this,i),r)}}function wu(e,n,r){var i,o;function a(){var s=n.apply(this,arguments);return s!==o&&(i=(o=s)&&bu(e,s,r)),i}return a._value=n,a}function ku(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 new Error;return this.tween(i,wu(e,n,r??""))}function Cu(e){return function(){this.textContent=e}}function Au(e){return function(){var n=e(this);this.textContent=n??""}}function Su(e){return this.tween("text",typeof e=="function"?Au(Nn(this,"text",e)):Cu(e==null?"":e+""))}function Mu(e){return function(n){this.textContent=e.call(this,n)}}function Tu(e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Mu(o)),n}return i._value=e,i}function Pu(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 new Error;return this.tween(n,Tu(e))}function Ou(){for(var e=this._name,n=this._id,r=_i(),i=this._groups,o=i.length,a=0;a<o;++a)for(var s=i[a],u=s.length,c,l=0;l<u;++l)if(c=s[l]){var f=vt(c,n);Ve(c,e,r,l,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new Rt(i,this._parents,e,r)}function Eu(){var e,n,r=this,i=r._id,o=r.size();return new Promise(function(a,s){var u={value:s},c={value:function(){--o===0&&a()}};r.each(function(){var l=Ct(this,i),f=l.on;f!==e&&(n=(e=f).copy(),n._.cancel.push(u),n._.interrupt.push(u),n._.end.push(c)),l.on=n}),o===0&&a()})}var zu=0;function Rt(e,n,r,i){this._groups=e,this._parents=n,this._name=r,this._id=i}function _i(){return++zu}var St=_e.prototype;Rt.prototype={constructor:Rt,select:hu,selectAll:du,selectChild:St.selectChild,selectChildren:St.selectChildren,filter:ou,merge:au,selection:gu,transition:Ou,call:St.call,nodes:St.nodes,node:St.node,size:St.size,empty:St.empty,each:St.each,on:lu,attr:qs,attrTween:Xs,style:xu,styleTween:ku,text:Su,textTween:Pu,remove:fu,tween:Ds,delay:Ks,duration:tu,ease:nu,easeVarying:iu,end:Eu,[Symbol.iterator]:St[Symbol.iterator]};function Nu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ru={time:null,delay:0,duration:250,ease:Nu};function ju(e,n){for(var r;!(r=e.__transition)||!(r=r[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return r}function Du(e){var n,r;e instanceof Rt?(n=e._id,e=e._name):(n=_i(),(r=Ru).time=On(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,a=0;a<o;++a)for(var s=i[a],u=s.length,c,l=0;l<u;++l)(c=s[l])&&Ve(c,e,n,l,s,r||ju(c,n));return new Rt(i,this._parents,e,n)}_e.prototype.interrupt=Ns;_e.prototype.transition=Du;const we=e=>()=>e;function Iu(e,{sourceEvent:n,target:r,transform:i,dispatch:o}){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:o}})}function Et(e,n,r){this.k=e,this.x=n,this.y=r}Et.prototype={constructor:Et,scale:function(e){return e===1?this:new Et(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Et(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 Rn=new Et(1,0,0);mt.prototype=Et.prototype;function mt(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Rn;return e.__zoom}function Je(e){e.stopImmediatePropagation()}function Jt(e){e.preventDefault(),e.stopImmediatePropagation()}function $u(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Lu(){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 ur(){return this.__zoom||Rn}function Fu(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Uu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Hu(e,n,r){var i=e.invertX(n[0][0])-r[0][0],o=e.invertX(n[1][0])-r[1][0],a=e.invertY(n[0][1])-r[0][1],s=e.invertY(n[1][1])-r[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function qu(){var e=$u,n=Lu,r=Hu,i=Fu,o=Uu,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],u=250,c=Ao,l=ve("start","zoom","end"),f,h,d,p=500,y=150,x=0,m=10;function g(S){S.property("__zoom",ur).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",P).filter(o).on("touchstart.zoom",N).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(S,j,E,C){var O=S.selection?S.selection():S;O.property("__zoom",ur),S!==O?v(S,j,E,C):O.interrupt().each(function(){A(this,arguments).event(C).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},g.scaleBy=function(S,j,E,C){g.scaleTo(S,function(){var O=this.__zoom.k,I=typeof j=="function"?j.apply(this,arguments):j;return O*I},E,C)},g.scaleTo=function(S,j,E,C){g.transform(S,function(){var O=n.apply(this,arguments),I=this.__zoom,L=E==null?_(O):typeof E=="function"?E.apply(this,arguments):E,H=I.invert(L),F=typeof j=="function"?j.apply(this,arguments):j;return r(w(k(I,F),L,H),O,s)},E,C)},g.translateBy=function(S,j,E,C){g.transform(S,function(){return r(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof E=="function"?E.apply(this,arguments):E),n.apply(this,arguments),s)},null,C)},g.translateTo=function(S,j,E,C,O){g.transform(S,function(){var I=n.apply(this,arguments),L=this.__zoom,H=C==null?_(I):typeof C=="function"?C.apply(this,arguments):C;return r(Rn.translate(H[0],H[1]).scale(L.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof E=="function"?-E.apply(this,arguments):-E),I,s)},C,O)};function k(S,j){return j=Math.max(a[0],Math.min(a[1],j)),j===S.k?S:new Et(j,S.x,S.y)}function w(S,j,E){var C=j[0]-E[0]*S.k,O=j[1]-E[1]*S.k;return C===S.x&&O===S.y?S:new Et(S.k,C,O)}function _(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function v(S,j,E,C){S.on("start.zoom",function(){A(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(C).end()}).tween("zoom",function(){var O=this,I=arguments,L=A(O,I).event(C),H=n.apply(O,I),F=E==null?_(H):typeof E=="function"?E.apply(O,I):E,G=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),V=O.__zoom,X=typeof j=="function"?j.apply(O,I):j,tt=c(V.invert(F).concat(G/V.k),X.invert(F).concat(G/X.k));return function(Z){if(Z===1)Z=X;else{var st=tt(Z),et=G/st[2];Z=new Et(et,F[0]-st[0]*et,F[1]-st[1]*et)}L.zoom(null,Z)}})}function A(S,j,E){return!E&&S.__zooming||new M(S,j)}function M(S,j){this.that=S,this.args=j,this.active=0,this.sourceEvent=null,this.extent=n.apply(S,j),this.taps=0}M.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,j){return this.mouse&&S!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var j=pt(this.that).datum();l.call(S,this.that,new Iu(S,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:l}),j)}};function T(S,...j){if(!e.apply(this,arguments))return;var E=A(this,j).event(S),C=this.__zoom,O=Math.max(a[0],Math.min(a[1],C.k*Math.pow(2,i.apply(this,arguments)))),I=xt(S);if(E.wheel)(E.mouse[0][0]!==I[0]||E.mouse[0][1]!==I[1])&&(E.mouse[1]=C.invert(E.mouse[0]=I)),clearTimeout(E.wheel);else{if(C.k===O)return;E.mouse=[I,C.invert(I)],Pe(this),E.start()}Jt(S),E.wheel=setTimeout(L,y),E.zoom("mouse",r(w(k(C,O),E.mouse[0],E.mouse[1]),E.extent,s));function L(){E.wheel=null,E.end()}}function R(S,...j){if(d||!e.apply(this,arguments))return;var E=S.currentTarget,C=A(this,j,!0).event(S),O=pt(S.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",G,!0),I=xt(S,E),L=S.clientX,H=S.clientY;ci(S.view),Je(S),C.mouse=[I,this.__zoom.invert(I)],Pe(this),C.start();function F(V){if(Jt(V),!C.moved){var X=V.clientX-L,tt=V.clientY-H;C.moved=X*X+tt*tt>x}C.event(V).zoom("mouse",r(w(C.that.__zoom,C.mouse[0]=xt(V,E),C.mouse[1]),C.extent,s))}function G(V){O.on("mousemove.zoom mouseup.zoom",null),fi(V.view,C.moved),Jt(V),C.event(V).end()}}function P(S,...j){if(e.apply(this,arguments)){var E=this.__zoom,C=xt(S.changedTouches?S.changedTouches[0]:S,this),O=E.invert(C),I=E.k*(S.shiftKey?.5:2),L=r(w(k(E,I),C,O),n.apply(this,j),s);Jt(S),u>0?pt(this).transition().duration(u).call(v,L,C,S):pt(this).call(g.transform,L,C,S)}}function N(S,...j){if(e.apply(this,arguments)){var E=S.touches,C=E.length,O=A(this,j,S.changedTouches.length===C).event(S),I,L,H,F;for(Je(S),L=0;L<C;++L)H=E[L],F=xt(H,this),F=[F,this.__zoom.invert(F),H.identifier],O.touch0?!O.touch1&&O.touch0[2]!==F[2]&&(O.touch1=F,O.taps=0):(O.touch0=F,I=!0,O.taps=1+!!f);f&&(f=clearTimeout(f)),I&&(O.taps<2&&(h=F[0],f=setTimeout(function(){f=null},p)),Pe(this),O.start())}}function D(S,...j){if(this.__zooming){var E=A(this,j).event(S),C=S.changedTouches,O=C.length,I,L,H,F;for(Jt(S),I=0;I<O;++I)L=C[I],H=xt(L,this),E.touch0&&E.touch0[2]===L.identifier?E.touch0[0]=H:E.touch1&&E.touch1[2]===L.identifier&&(E.touch1[0]=H);if(L=E.that.__zoom,E.touch1){var G=E.touch0[0],V=E.touch0[1],X=E.touch1[0],tt=E.touch1[1],Z=(Z=X[0]-G[0])*Z+(Z=X[1]-G[1])*Z,st=(st=tt[0]-V[0])*st+(st=tt[1]-V[1])*st;L=k(L,Math.sqrt(Z/st)),H=[(G[0]+X[0])/2,(G[1]+X[1])/2],F=[(V[0]+tt[0])/2,(V[1]+tt[1])/2]}else if(E.touch0)H=E.touch0[0],F=E.touch0[1];else return;E.zoom("touch",r(w(L,H,F),E.extent,s))}}function U(S,...j){if(this.__zooming){var E=A(this,j).event(S),C=S.changedTouches,O=C.length,I,L;for(Je(S),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),I=0;I<O;++I)L=C[I],E.touch0&&E.touch0[2]===L.identifier?delete E.touch0:E.touch1&&E.touch1[2]===L.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(L=xt(L,this),Math.hypot(h[0]-L[0],h[1]-L[1])<m)){var H=pt(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return g.wheelDelta=function(S){return arguments.length?(i=typeof S=="function"?S:we(+S),g):i},g.filter=function(S){return arguments.length?(e=typeof S=="function"?S:we(!!S),g):e},g.touchable=function(S){return arguments.length?(o=typeof S=="function"?S:we(!!S),g):o},g.extent=function(S){return arguments.length?(n=typeof S=="function"?S:we([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),g):n},g.scaleExtent=function(S){return arguments.length?(a[0]=+S[0],a[1]=+S[1],g):[a[0],a[1]]},g.translateExtent=function(S){return arguments.length?(s[0][0]=+S[0][0],s[1][0]=+S[1][0],s[0][1]=+S[0][1],s[1][1]=+S[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(S){return arguments.length?(r=S,g):r},g.duration=function(S){return arguments.length?(u=+S,g):u},g.interpolate=function(S){return arguments.length?(c=S,g):c},g.on=function(){var S=l.on.apply(l,arguments);return S===l?g:S},g.clickDistance=function(S){return arguments.length?(x=(S=+S)*S,g):Math.sqrt(x)},g.tapDistance=function(S){return arguments.length?(m=+S,g):m},g}var Wu=typeof global=="object"&&global&&global.Object===Object&&global,Gu=typeof self=="object"&&self&&self.Object===Object&&self,vi=Wu||Gu||Function("return this")(),De=vi.Symbol,mi=Object.prototype,Vu=mi.hasOwnProperty,Bu=mi.toString,te=De?De.toStringTag:void 0;function Xu(e){var n=Vu.call(e,te),r=e[te];try{e[te]=void 0;var i=!0}catch{}var o=Bu.call(e);return i&&(n?e[te]=r:delete e[te]),o}var Yu=Object.prototype,Zu=Yu.toString;function Ku(e){return Zu.call(e)}var Qu="[object Null]",Ju="[object Undefined]",lr=De?De.toStringTag:void 0;function tl(e){return e==null?e===void 0?Ju:Qu:lr&&lr in Object(e)?Xu(e):Ku(e)}function el(e){return e!=null&&typeof e=="object"}var nl="[object Symbol]";function rl(e){return typeof e=="symbol"||el(e)&&tl(e)==nl}var il=/\s/;function ol(e){for(var n=e.length;n--&&il.test(e.charAt(n)););return n}var al=/^\s+/;function sl(e){return e&&e.slice(0,ol(e)+1).replace(al,"")}function Ie(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var cr=NaN,ul=/^[-+]0x[0-9a-f]+$/i,ll=/^0b[01]+$/i,cl=/^0o[0-7]+$/i,fl=parseInt;function fr(e){if(typeof e=="number")return e;if(rl(e))return cr;if(Ie(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=Ie(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=sl(e);var r=ll.test(e);return r||cl.test(e)?fl(e.slice(2),r?2:8):ul.test(e)?cr:+e}var tn=function(){return vi.Date.now()},hl="Expected a function",dl=Math.max,pl=Math.min;function xi(e,n,r){var i,o,a,s,u,c,l=0,f=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(hl);n=fr(n)||0,Ie(r)&&(f=!!r.leading,h="maxWait"in r,a=h?dl(fr(r.maxWait)||0,n):a,d="trailing"in r?!!r.trailing:d);function p(A){var M=i,T=o;return i=o=void 0,l=A,s=e.apply(T,M),s}function y(A){return l=A,u=setTimeout(g,n),f?p(A):s}function x(A){var M=A-c,T=A-l,R=n-M;return h?pl(R,a-T):R}function m(A){var M=A-c,T=A-l;return c===void 0||M>=n||M<0||h&&T>=a}function g(){var A=tn();if(m(A))return k(A);u=setTimeout(g,x(A))}function k(A){return u=void 0,d&&i?p(A):(i=o=void 0,s)}function w(){u!==void 0&&clearTimeout(u),l=0,i=c=o=u=void 0}function _(){return u===void 0?s:k(tn())}function v(){var A=tn(),M=m(A);if(i=arguments,o=this,c=A,M){if(u===void 0)return y(c);if(h)return clearTimeout(u),u=setTimeout(g,n),p(c)}return u===void 0&&(u=setTimeout(g,n)),s}return v.cancel=w,v.flush=_,v}var gl="Expected a function";function yl(e,n,r){var i=!0,o=!0;if(typeof e!="function")throw new TypeError(gl);return Ie(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),xi(e,n,{leading:i,maxWait:n,trailing:o})}var Ut=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:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(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:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(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*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(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-Ut.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?Ut.Bounce.In(e*2)*.5:Ut.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),ue=function(){return performance.now()},bi=(function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(r){return n._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(n){this._tweens[n.getId()]=n,this._tweensAddedDuringUpdate[n.getId()]=n},e.prototype.remove=function(n){delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]},e.prototype.update=function(n,r){n===void 0&&(n=ue()),r===void 0&&(r=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var a=this._tweens[i[o]],s=!r;a&&a.update(n,s)===!1&&!r&&delete this._tweens[i[o]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e})(),vn={Linear:function(e,n){var r=e.length-1,i=r*n,o=Math.floor(i),a=vn.Utils.Linear;return n<0?a(e[0],e[1],i):n>1?a(e[r],e[r-1],r-i):a(e[o],e[o+1>r?r:o+1],i-o)},Utils:{Linear:function(e,n,r){return(n-e)*r+e}}},wi=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),mn=new bi,hr=(function(){function e(n,r){r===void 0&&(r=mn),this._object=n,this._group=r,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=Ut.Linear.None,this._interpolationFunction=vn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=wi.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}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(n,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,r){if(n===void 0&&(n=ue()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var a in this._valuesEnd)o[a]=this._valuesEnd[a];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,r,i,o,a){for(var s in i){var u=n[s],c=Array.isArray(u),l=c?"array":typeof u,f=!c&&Array.isArray(i[s]);if(!(l==="undefined"||l==="function")){if(f){var h=i[s];if(h.length===0)continue;for(var d=[u],p=0,y=h.length;p<y;p+=1){var x=this._handleRelativeValue(u,h[p]);if(isNaN(x)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}d.push(x)}f&&(i[s]=d)}if((l==="object"||c)&&u&&!f){r[s]=c?[]:{};var m=u;for(var g in m)r[s][g]=m[g];o[s]=c?[]:{};var h=i[s];if(!this._isDynamic){var k={};for(var g in h)k[g]=h[g];i[s]=h=k}this._setupProperties(m,r[s],h,o[s],a)}else(typeof r[s]>"u"||a)&&(r[s]=u),c||(r[s]*=1),f?o[s]=i[s].slice().reverse():o[s]=r[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(n){return n===void 0&&(n=ue()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this._group&&this._group.remove(this),this)},e.prototype.resume=function(n){return n===void 0&&(n=ue()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var n=0,r=this._chainedTweens.length;n<r;n++)this._chainedTweens[n].stop();return this},e.prototype.group=function(n){return n===void 0&&(n=mn),this._group=n,this},e.prototype.delay=function(n){return n===void 0&&(n=0),this._delayTime=n,this},e.prototype.repeat=function(n){return n===void 0&&(n=0),this._initialRepeat=n,this._repeat=n,this},e.prototype.repeatDelay=function(n){return this._repeatDelayTime=n,this},e.prototype.yoyo=function(n){return n===void 0&&(n=!1),this._yoyo=n,this},e.prototype.easing=function(n){return n===void 0&&(n=Ut.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=vn.Linear),this._interpolationFunction=n,this},e.prototype.chain=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return this._chainedTweens=n,this},e.prototype.onStart=function(n){return this._onStartCallback=n,this},e.prototype.onEveryStart=function(n){return this._onEveryStartCallback=n,this},e.prototype.onUpdate=function(n){return this._onUpdateCallback=n,this},e.prototype.onRepeat=function(n){return this._onRepeatCallback=n,this},e.prototype.onComplete=function(n){return this._onCompleteCallback=n,this},e.prototype.onStop=function(n){return this._onStopCallback=n,this},e.prototype.update=function(n,r){var i=this,o;if(n===void 0&&(n=ue()),r===void 0&&(r=!0),this._isPaused)return!0;var a,s=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(n>s)return!1;r&&this.start(n,!0)}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 u=n-this._startTime,c=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),l=this._duration+this._repeat*c,f=function(){if(i._duration===0||u>l)return 1;var m=Math.trunc(u/c),g=u-m*c,k=Math.min(g/i._duration,1);return k===0&&u===i._duration?1:k},h=f(),d=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||u>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((u-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(a in 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+=c*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var y=0,x=this._chainedTweens.length;y<x;y++)this._chainedTweens[y].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(n,r,i,o){for(var a in i)if(r[a]!==void 0){var s=r[a]||0,u=i[a],c=Array.isArray(n[a]),l=Array.isArray(u),f=!c&&l;f?n[a]=this._interpolationFunction(u,o):typeof u=="object"&&u?this._updateProperties(n[a],s,u,o):(u=this._handleRelativeValue(s,u),typeof u=="number"&&(n[a]=s+(u-s)*o))}},e.prototype._handleRelativeValue=function(n,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?n+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(n){var r=this._valuesStartRepeat[n],i=this._valuesEnd[n];typeof i=="string"?this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(i):this._valuesStartRepeat[n]=this._valuesEnd[n],this._valuesEnd[n]=r},e})();wi.nextId;var kt=mn;kt.getAll.bind(kt);kt.removeAll.bind(kt);kt.add.bind(kt);kt.remove.bind(kt);kt.update.bind(kt);function dr(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 _l(e){if(Array.isArray(e))return e}function vl(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function ml(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function xl(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],c=!0,l=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(c=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);c=!0);}catch(f){l=!0,o=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return u}}function bl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wl(e,n){return _l(e)||xl(e,n)||kl(e,n)||bl()}function kl(e,n){if(e){if(typeof e=="string")return dr(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)?dr(e,n):void 0}}var Cl=ml(function e(n,r){var i=r.default,o=i===void 0?null:i,a=r.triggerUpdate,s=a===void 0?!0:a,u=r.onChange,c=u===void 0?function(l,f){}:u;vl(this,e),this.name=n,this.defaultVal=o,this.triggerUpdate=s,this.onChange=c});function jn(e){var n=e.stateInit,r=n===void 0?function(){return{}}:n,i=e.props,o=i===void 0?{}:i,a=e.methods,s=a===void 0?{}:a,u=e.aliases,c=u===void 0?{}:u,l=e.init,f=l===void 0?function(){}:l,h=e.update,d=h===void 0?function(){}:h,p=Object.keys(o).map(function(y){return new Cl(y,o[y])});return function y(){for(var x=arguments.length,m=new Array(x),g=0;g<x;g++)m[g]=arguments[g];var k=!!(this instanceof y&&this.constructor),w=k?m.shift():void 0,_=m[0],v=_===void 0?{}:_,A=Object.assign({},r instanceof Function?r(v):r,{initialised:!1}),M={};function T(N){return R(N,v),P(),T}var R=function(D,U){f.call(T,D,A,U),A.initialised=!0},P=xi(function(){A.initialised&&(d.call(T,A,M),M={})},1);return p.forEach(function(N){T[N.name]=D(N);function D(U){var S=U.name,j=U.triggerUpdate,E=j===void 0?!1:j,C=U.onChange,O=C===void 0?function(H,F){}:C,I=U.defaultVal,L=I===void 0?null:I;return function(H){var F=A[S];if(!arguments.length)return F;var G=H===void 0?L:H;return A[S]=G,O.call(T,G,A,F),!M.hasOwnProperty(S)&&(M[S]=F),E&&P(),T}}}),Object.keys(s).forEach(function(N){T[N]=function(){for(var D,U=arguments.length,S=new Array(U),j=0;j<U;j++)S[j]=arguments[j];return(D=s[N]).call.apply(D,[T,A].concat(S))}}),Object.entries(c).forEach(function(N){var D=wl(N,2),U=D[0],S=D[1];return T[U]=T[S]}),T.resetProps=function(){return p.forEach(function(N){T[N.name](N.defaultVal)}),T},T.resetProps(),A._rerender=P,k&&w&&T(w),T}}var B=(function(e){return typeof e=="function"?e:typeof e=="string"?function(n){return n[e]}:function(n){return e}});function $e(e){"@babel/helpers - typeof";return $e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},$e(e)}var Al=/^\s+/,Sl=/\s+$/;function q(e,n){if(e=e||"",n=n||{},e instanceof q)return e;if(!(this instanceof q))return new q(e,n);var r=Ml(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}q.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 n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),r,i,o,a,s,u;return r=n.r/255,i=n.g/255,o=n.b/255,r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),o<=.03928?u=o/12.92:u=Math.pow((o+.055)/1.055,2.4),.2126*a+.7152*s+.0722*u},setAlpha:function(n){return this._a=ki(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=gr(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=gr(this._r,this._g,this._b),r=Math.round(n.h*360),i=Math.round(n.s*100),o=Math.round(n.v*100);return this._a==1?"hsv("+r+", "+i+"%, "+o+"%)":"hsva("+r+", "+i+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var n=pr(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=pr(this._r,this._g,this._b),r=Math.round(n.h*360),i=Math.round(n.s*100),o=Math.round(n.l*100);return this._a==1?"hsl("+r+", "+i+"%, "+o+"%)":"hsla("+r+", "+i+"%, "+o+"%, "+this._roundA+")"},toHex:function(n){return yr(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return El(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},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(Q(this._r,255)*100)+"%",g:Math.round(Q(this._g,255)*100)+"%",b:Math.round(Q(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Q(this._r,255)*100)+"%, "+Math.round(Q(this._g,255)*100)+"%, "+Math.round(Q(this._b,255)*100)+"%)":"rgba("+Math.round(Q(this._r,255)*100)+"%, "+Math.round(Q(this._g,255)*100)+"%, "+Math.round(Q(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:ql[yr(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var r="#"+_r(this._r,this._g,this._b,this._a),i=r,o=this._gradientType?"GradientType = 1, ":"";if(n){var a=q(n);i="#"+_r(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+r+",endColorstr="+i+")"},toString:function(n){var r=!!n;n=n||this._format;var i=!1,o=this._a<1&&this._a>=0,a=!r&&o&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return a?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(i=this.toRgbString()),n==="prgb"&&(i=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(i=this.toHexString()),n==="hex3"&&(i=this.toHexString(!0)),n==="hex4"&&(i=this.toHex8String(!0)),n==="hex8"&&(i=this.toHex8String()),n==="name"&&(i=this.toName()),n==="hsl"&&(i=this.toHslString()),n==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return q(this.toString())},_applyModification:function(n,r){var i=n.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(jl,arguments)},brighten:function(){return this._applyModification(Dl,arguments)},darken:function(){return this._applyModification(Il,arguments)},desaturate:function(){return this._applyModification(zl,arguments)},saturate:function(){return this._applyModification(Nl,arguments)},greyscale:function(){return this._applyModification(Rl,arguments)},spin:function(){return this._applyModification($l,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(Ul,arguments)},complement:function(){return this._applyCombination(Ll,arguments)},monochromatic:function(){return this._applyCombination(Hl,arguments)},splitcomplement:function(){return this._applyCombination(Fl,arguments)},triad:function(){return this._applyCombination(vr,[3])},tetrad:function(){return this._applyCombination(vr,[4])}};q.fromRatio=function(e,n){if($e(e)=="object"){var r={};for(var i in e)e.hasOwnProperty(i)&&(i==="a"?r[i]=e[i]:r[i]=le(e[i]));e=r}return q(e,n)};function Ml(e){var n={r:0,g:0,b:0},r=1,i=null,o=null,a=null,s=!1,u=!1;return typeof e=="string"&&(e=Bl(e)),$e(e)=="object"&&(Mt(e.r)&&Mt(e.g)&&Mt(e.b)?(n=Tl(e.r,e.g,e.b),s=!0,u=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Mt(e.h)&&Mt(e.s)&&Mt(e.v)?(i=le(e.s),o=le(e.v),n=Ol(e.h,i,o),s=!0,u="hsv"):Mt(e.h)&&Mt(e.s)&&Mt(e.l)&&(i=le(e.s),a=le(e.l),n=Pl(e.h,i,a),s=!0,u="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=ki(r),{ok:s,format:e.format||u,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 Tl(e,n,r){return{r:Q(e,255)*255,g:Q(n,255)*255,b:Q(r,255)*255}}function pr(e,n,r){e=Q(e,255),n=Q(n,255),r=Q(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,u=(i+o)/2;if(i==o)a=s=0;else{var c=i-o;switch(s=u>.5?c/(2-i-o):c/(i+o),i){case e:a=(n-r)/c+(n<r?6:0);break;case n:a=(r-e)/c+2;break;case r:a=(e-n)/c+4;break}a/=6}return{h:a,s,l:u}}function Pl(e,n,r){var i,o,a;e=Q(e,360),n=Q(n,100),r=Q(r,100);function s(l,f,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?l+(f-l)*6*h:h<1/2?f:h<2/3?l+(f-l)*(2/3-h)*6:l}if(n===0)i=o=a=r;else{var u=r<.5?r*(1+n):r+n-r*n,c=2*r-u;i=s(c,u,e+1/3),o=s(c,u,e),a=s(c,u,e-1/3)}return{r:i*255,g:o*255,b:a*255}}function gr(e,n,r){e=Q(e,255),n=Q(n,255),r=Q(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,u=i,c=i-o;if(s=i===0?0:c/i,i==o)a=0;else{switch(i){case e:a=(n-r)/c+(n<r?6:0);break;case n:a=(r-e)/c+2;break;case r:a=(e-n)/c+4;break}a/=6}return{h:a,s,v:u}}function Ol(e,n,r){e=Q(e,360)*6,n=Q(n,100),r=Q(r,100);var i=Math.floor(e),o=e-i,a=r*(1-n),s=r*(1-o*n),u=r*(1-(1-o)*n),c=i%6,l=[r,s,a,a,u,r][c],f=[u,r,r,s,a,a][c],h=[a,a,u,r,r,s][c];return{r:l*255,g:f*255,b:h*255}}function yr(e,n,r,i){var o=[_t(Math.round(e).toString(16)),_t(Math.round(n).toString(16)),_t(Math.round(r).toString(16))];return i&&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[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function El(e,n,r,i,o){var a=[_t(Math.round(e).toString(16)),_t(Math.round(n).toString(16)),_t(Math.round(r).toString(16)),_t(Ci(i))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function _r(e,n,r,i){var o=[_t(Ci(i)),_t(Math.round(e).toString(16)),_t(Math.round(n).toString(16)),_t(Math.round(r).toString(16))];return o.join("")}q.equals=function(e,n){return!e||!n?!1:q(e).toRgbString()==q(n).toRgbString()};q.random=function(){return q.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function zl(e,n){n=n===0?0:n||10;var r=q(e).toHsl();return r.s-=n/100,r.s=Be(r.s),q(r)}function Nl(e,n){n=n===0?0:n||10;var r=q(e).toHsl();return r.s+=n/100,r.s=Be(r.s),q(r)}function Rl(e){return q(e).desaturate(100)}function jl(e,n){n=n===0?0:n||10;var r=q(e).toHsl();return r.l+=n/100,r.l=Be(r.l),q(r)}function Dl(e,n){n=n===0?0:n||10;var r=q(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)))),q(r)}function Il(e,n){n=n===0?0:n||10;var r=q(e).toHsl();return r.l-=n/100,r.l=Be(r.l),q(r)}function $l(e,n){var r=q(e).toHsl(),i=(r.h+n)%360;return r.h=i<0?360+i:i,q(r)}function Ll(e){var n=q(e).toHsl();return n.h=(n.h+180)%360,q(n)}function vr(e,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var r=q(e).toHsl(),i=[q(e)],o=360/n,a=1;a<n;a++)i.push(q({h:(r.h+a*o)%360,s:r.s,l:r.l}));return i}function Fl(e){var n=q(e).toHsl(),r=n.h;return[q(e),q({h:(r+72)%360,s:n.s,l:n.l}),q({h:(r+216)%360,s:n.s,l:n.l})]}function Ul(e,n,r){n=n||6,r=r||30;var i=q(e).toHsl(),o=360/r,a=[q(e)];for(i.h=(i.h-(o*n>>1)+720)%360;--n;)i.h=(i.h+o)%360,a.push(q(i));return a}function Hl(e,n){n=n||6;for(var r=q(e).toHsv(),i=r.h,o=r.s,a=r.v,s=[],u=1/n;n--;)s.push(q({h:i,s:o,v:a})),a=(a+u)%1;return s}q.mix=function(e,n,r){r=r===0?0:r||50;var i=q(e).toRgb(),o=q(n).toRgb(),a=r/100,s={r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a};return q(s)};q.readability=function(e,n){var r=q(e),i=q(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};q.isReadable=function(e,n,r){var i=q.readability(e,n),o,a;switch(a=!1,o=Xl(r),o.level+o.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7;break}return a};q.mostReadable=function(e,n,r){var i=null,o=0,a,s,u,c;r=r||{},s=r.includeFallbackColors,u=r.level,c=r.size;for(var l=0;l<n.length;l++)a=q.readability(e,n[l]),a>o&&(o=a,i=q(n[l]));return q.isReadable(e,i,{level:u,size:c})||!s?i:(r.includeFallbackColors=!1,q.mostReadable(e,["#fff","#000"],r))};var xn=q.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"},ql=q.hexNames=Wl(xn);function Wl(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function ki(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Q(e,n){Gl(e)&&(e="100%");var r=Vl(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 Be(e){return Math.min(1,Math.max(0,e))}function ct(e){return parseInt(e,16)}function Gl(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Vl(e){return typeof e=="string"&&e.indexOf("%")!=-1}function _t(e){return e.length==1?"0"+e:""+e}function le(e){return e<=1&&(e=e*100+"%"),e}function Ci(e){return Math.round(parseFloat(e)*255).toString(16)}function mr(e){return ct(e)/255}var yt=(function(){var e="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",r="(?:"+n+")|(?:"+e+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+o),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 Mt(e){return!!yt.CSS_UNIT.exec(e)}function Bl(e){e=e.replace(Al,"").replace(Sl,"").toLowerCase();var n=!1;if(xn[e])e=xn[e],n=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=yt.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=yt.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=yt.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=yt.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=yt.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=yt.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=yt.hex8.exec(e))?{r:ct(r[1]),g:ct(r[2]),b:ct(r[3]),a:mr(r[4]),format:n?"name":"hex8"}:(r=yt.hex6.exec(e))?{r:ct(r[1]),g:ct(r[2]),b:ct(r[3]),format:n?"name":"hex"}:(r=yt.hex4.exec(e))?{r:ct(r[1]+""+r[1]),g:ct(r[2]+""+r[2]),b:ct(r[3]+""+r[3]),a:mr(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=yt.hex3.exec(e))?{r:ct(r[1]+""+r[1]),g:ct(r[2]+""+r[2]),b:ct(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function Xl(e){var n,r;return e=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}}function bn(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 Yl(e){if(Array.isArray(e))return bn(e)}function Ai(e,n,r){if(typeof e=="function"?e===n:e.has(n))return arguments.length<3?n:r;throw new TypeError("Private element is not present on this object")}function Zl(e,n){if(n.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Kl(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function ht(e,n){return e.get(Ai(e,n))}function xr(e,n,r){Zl(e,n),n.set(e,r)}function br(e,n,r){return e.set(Ai(e,n),r),r}function Ql(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,ic(i.key),i)}}function Jl(e,n,r){return n&&Ql(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tc(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ec(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nc(e){return Yl(e)||tc(e)||oc(e)||ec()}function rc(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 new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ic(e){var n=rc(e,"string");return typeof n=="symbol"?n:n+""}function oc(e,n){if(e){if(typeof e=="string")return bn(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)?bn(e,n):void 0}}var ac=123,sc=function(n){return"#".concat(Math.min(n,Math.pow(2,24)).toString(16).padStart(6,"0"))},Si=function(n,r,i){return(n<<16)+(r<<8)+i},uc=function(n){var r=q(n).toRgb(),i=r.r,o=r.g,a=r.b;return Si(i,o,a)},wr=function(n,r){return n*ac%Math.pow(2,r)},Lt=new WeakMap,Tt=new WeakMap,lc=(function(){function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6;Kl(this,e),xr(this,Lt,void 0),xr(this,Tt,void 0),br(Tt,this,n),this.reset()}return Jl(e,[{key:"reset",value:function(){br(Lt,this,["__reserved for background__"])}},{key:"register",value:function(r){if(ht(Lt,this).length>=Math.pow(2,24-ht(Tt,this)))return null;var i=ht(Lt,this).length,o=wr(i,ht(Tt,this)),a=sc(i+(o<<24-ht(Tt,this)));return ht(Lt,this).push(r),a}},{key:"lookup",value:function(r){if(!r)return null;var i=typeof r=="string"?uc(r):Si.apply(void 0,nc(r));if(!i)return null;var o=i&Math.pow(2,24-ht(Tt,this))-1,a=i>>24-ht(Tt,this)&Math.pow(2,ht(Tt,this))-1;return wr(o,ht(Tt,this))!==a||o>=ht(Lt,this).length?null:ht(Lt,this)[o]}}])})(),me,J,Mi,Ti,$t,kr,Pi,Oi,en,Oe,ce,Ei,Dn,wn,kn,Le={},Fe=[],cc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Xe=Array.isArray;function bt(e,n){for(var r in n)e[r]=n[r];return e}function In(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function fc(e,n,r){var i,o,a,s={};for(a in n)a=="key"?i=n[a]:a=="ref"?o=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?me.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)s[a]===void 0&&(s[a]=e.defaultProps[a]);return fe(e,s,i,o,null)}function fe(e,n,r,i,o){var a={type:e,props:n,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Mi,__i:-1,__u:0};return o==null&&J.vnode!=null&&J.vnode(a),a}function Ye(e){return e.children}function Ee(e,n){this.props=e,this.context=n}function Yt(e,n){if(n==null)return e.__?Yt(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"?Yt(e):null}function hc(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],o=[],a=bt({},n);a.__v=n.__v+1,J.vnode&&J.vnode(a),$n(e.__P,a,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??Yt(n),!!(32&n.__u),o),a.__v=n.__v,a.__.__k[a.__i]=a,Di(i,a,o),n.__e=n.__=null,a.__e!=r&&zi(a)}}function zi(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}),zi(e)}function Cr(e){(!e.__d&&(e.__d=!0)&&$t.push(e)&&!Ue.__r++||kr!=J.debounceRendering)&&((kr=J.debounceRendering)||Pi)(Ue)}function Ue(){try{for(var e,n=1;$t.length;)$t.length>n&&$t.sort(Oi),e=$t.shift(),n=$t.length,hc(e)}finally{$t.length=Ue.__r=0}}function Ni(e,n,r,i,o,a,s,u,c,l,f){var h,d,p,y,x,m,g,k=i&&i.__k||Fe,w=n.length;for(c=dc(r,n,k,c,w),h=0;h<w;h++)(p=r.__k[h])!=null&&(d=p.__i!=-1&&k[p.__i]||Le,p.__i=h,m=$n(e,p,d,o,a,s,u,c,l,f),y=p.__e,p.ref&&d.ref!=p.ref&&(d.ref&&Ln(d.ref,null,p),f.push(p.ref,p.__c||y,p)),x==null&&y!=null&&(x=y),(g=!!(4&p.__u))||d.__k===p.__k?(c=Ri(p,c,e,g),g&&d.__e&&(d.__e=null)):typeof p.type=="function"&&m!==void 0?c=m:y&&(c=y.nextSibling),p.__u&=-7);return r.__e=x,c}function dc(e,n,r,i,o){var a,s,u,c,l,f=r.length,h=f,d=0;for(e.__k=new Array(o),a=0;a<o;a++)(s=n[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[a]=fe(null,s,null,null,null):Xe(s)?s=e.__k[a]=fe(Ye,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[a]=fe(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[a]=s,c=a+d,s.__=e,s.__b=e.__b+1,u=null,(l=s.__i=pc(s,r,c,h))!=-1&&(h--,(u=r[l])&&(u.__u|=2)),u==null||u.__v==null?(l==-1&&(o>f?d--:o<f&&d++),typeof s.type!="function"&&(s.__u|=4)):l!=c&&(l==c-1?d--:l==c+1?d++:(l>c?d--:d++,s.__u|=4))):e.__k[a]=null;if(h)for(a=0;a<f;a++)(u=r[a])!=null&&(2&u.__u)==0&&(u.__e==i&&(i=Yt(u)),$i(u,u));return i}function Ri(e,n,r,i){var o,a;if(typeof e.type=="function"){for(o=e.__k,a=0;o&&a<o.length;a++)o[a]&&(o[a].__=e,n=Ri(o[a],n,r,i));return n}e.__e!=n&&(i&&(n&&e.type&&!n.parentNode&&(n=Yt(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function pc(e,n,r,i){var o,a,s,u=e.key,c=e.type,l=n[r],f=l!=null&&(2&l.__u)==0;if(l===null&&u==null||f&&u==l.key&&c==l.type)return r;if(i>(f?1:0)){for(o=r-1,a=r+1;o>=0||a<n.length;)if((l=n[s=o>=0?o--:a++])!=null&&(2&l.__u)==0&&u==l.key&&c==l.type)return s}return-1}function Ar(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||cc.test(n)?r:r+"px"}function ke(e,n,r,i,o){var a,s;t: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||Ar(e.style,n,"");if(r)for(n in r)i&&r[n]==i[n]||Ar(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")a=n!=(n=n.replace(Ei,"$1")),s=n.toLowerCase(),n=s in e||n=="onFocusOut"||n=="onFocusIn"?s.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+a]=r,r?i?r[ce]=i[ce]:(r[ce]=Dn,e.addEventListener(n,a?kn:wn,a)):e.removeEventListener(n,a?kn:wn,a);else{if(o=="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 t}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function Sr(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[Oe]==null)n[Oe]=Dn++;else if(n[Oe]<r[ce])return;return r(J.event?J.event(n):n)}}}function $n(e,n,r,i,o,a,s,u,c,l){var f,h,d,p,y,x,m,g,k,w,_,v,A,M,T,R,P=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),a=[u=n.__e=r.__e]),(f=J.__b)&&f(n);t:if(typeof P=="function"){h=s.length;try{if(k=n.props,w=P.prototype&&P.prototype.render,_=(f=P.contextType)&&i[f.__c],v=f?_?_.props.value:f.__:i,r.__c?g=(d=n.__c=r.__c).__=d.__E:(w?n.__c=d=new P(k,v):(n.__c=d=new Ee(k,v),d.constructor=P,d.render=yc),_&&_.sub(d),d.state||(d.state={}),d.__n=i,p=d.__d=!0,d.__h=[],d._sb=[]),w&&d.__s==null&&(d.__s=d.state),w&&P.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=bt({},d.__s)),bt(d.__s,P.getDerivedStateFromProps(k,d.__s))),y=d.props,x=d.state,d.__v=n,p)w&&P.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),w&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(w&&P.getDerivedStateFromProps==null&&k!==y&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(k,v),n.__v==r.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(k,d.__s,v)===!1){n.__v!=r.__v&&(d.props=k,d.state=d.__s,d.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(N){N&&(N.__=n)}),Fe.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break t}d.componentWillUpdate!=null&&d.componentWillUpdate(k,d.__s,v),w&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(y,x,m)})}if(d.context=v,d.props=k,d.__P=e,d.__e=!1,A=J.__r,M=0,w)d.state=d.__s,d.__d=!1,A&&A(n),f=d.render(d.props,d.state,d.context),Fe.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,A&&A(n),f=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++M<25);d.state=d.__s,d.getChildContext!=null&&(i=bt(bt({},i),d.getChildContext())),w&&!p&&d.getSnapshotBeforeUpdate!=null&&(m=d.getSnapshotBeforeUpdate(y,x)),T=f!=null&&f.type===Ye&&f.key==null?Ii(f.props.children):f,u=Ni(e,Xe(T)?T:[T],n,r,i,o,a,s,u,c,l),d.base=n.__e,n.__u&=-161,d.__h.length&&s.push(d),g&&(d.__E=d.__=null)}catch(N){if(s.length=h,n.__v=null,c||a!=null){if(N.then){for(n.__u|=c?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;a!=null&&(a[a.indexOf(u)]=null),n.__e=u}else if(a!=null)for(R=a.length;R--;)In(a[R])}else n.__e=r.__e;n.__k==null&&(n.__k=r.__k||[]),N.then||ji(n),J.__e(N,n,r)}}else a==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):u=n.__e=gc(r.__e,n,r,i,o,a,s,c,l);return(f=J.diffed)&&f(n),128&n.__u?void 0:u}function ji(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ji))}function Di(e,n,r){for(var i=0;i<r.length;i++)Ln(r[i],r[++i],r[++i]);J.__c&&J.__c(n,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){J.__e(a,o.__v)}})}function Ii(e){return typeof e!="object"||e==null||e.__b>0?e:Xe(e)?e.map(Ii):e.constructor!==void 0?null:bt({},e)}function gc(e,n,r,i,o,a,s,u,c){var l,f,h,d,p,y,x,m=r.props||Le,g=n.props,k=n.type;if(k=="svg"?o="http://www.w3.org/2000/svg":k=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&"setAttribute"in p==!!k&&(k?p.localName==k:p.nodeType==3)){e=p,a[l]=null;break}}if(e==null){if(k==null)return document.createTextNode(g);e=document.createElementNS(o,k,g.is&&g),u&&(J.__m&&J.__m(n,a),u=!1),a=null}if(k==null)m===g||u&&e.data==g||(e.data=g);else{if(a=k=="textarea"&&g.defaultValue!=null?null:a&&me.call(e.childNodes),!u&&a!=null)for(m={},l=0;l<e.attributes.length;l++)m[(p=e.attributes[l]).name]=p.value;for(l in m)p=m[l],l=="dangerouslySetInnerHTML"?h=p:l=="children"||l in g||l=="value"&&"defaultValue"in g||l=="checked"&&"defaultChecked"in g||ke(e,l,null,p,o);for(l in g)p=g[l],l=="children"?d=p:l=="dangerouslySetInnerHTML"?f=p:l=="value"?y=p:l=="checked"?x=p:u&&typeof p!="function"||m[l]===p||ke(e,l,p,m[l],o);if(f)u||h&&(f.__html==h.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),n.__k=[];else if(h&&(e.innerHTML=""),Ni(n.type=="template"?e.content:e,Xe(d)?d:[d],n,r,i,k=="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,s,a?a[0]:r.__k&&Yt(r,0),u,c),a!=null)for(l=a.length;l--;)In(a[l]);u&&k!="textarea"||(l="value",k=="progress"&&y==null?e.removeAttribute("value"):y!=null&&(y!==e[l]||k=="progress"&&!y||k=="option"&&y!=m[l])&&ke(e,l,y,m[l],o),l="checked",x!=null&&x!=e[l]&&ke(e,l,x,m[l],o))}return e}function Ln(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(o){J.__e(o,r)}}function $i(e,n,r){var i,o;if(J.unmount&&J.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Ln(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(a){J.__e(a,n)}i.base=i.__P=i.__n=null}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&$i(i[o],n,r||typeof e.type!="function");r||In(e.__e),e.__c=e.__=e.__e=void 0}function yc(e,n,r){return this.constructor(e,r)}function _c(e,n,r){var i,o,a,s;n==document&&(n=document.documentElement),J.__&&J.__(e,n),o=(i=!1)?null:n.__k,a=[],s=[],$n(n,e=n.__k=fc(Ye,null,[e]),o||Le,Le,n.namespaceURI,o?null:n.firstChild?me.call(n.childNodes):null,a,o?o.__e:n.firstChild,i,s),Di(a,e,s),e.props.children=null}function Li(e,n,r){var i,o,a,s,u=bt({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)a=="key"?i=n[a]:a=="ref"?o=n[a]:u[a]=n[a]===void 0&&s!=null?s[a]:n[a];return arguments.length>2&&(u.children=arguments.length>3?me.call(arguments,2):r),fe(e.type,u,i||e.key,o||e.ref,null)}me=Fe.slice,J={__e:function(e,n,r,i){for(var o,a,s;n=n.__;)if((o=n.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,i||{}),s=o.__d),s)return o.__E=o}catch(u){e=u}throw e}},Mi=0,Ti=function(e){return e!=null&&e.constructor===void 0},Ee.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=bt({},this.state),typeof e=="function"&&(e=e(bt({},r),this.props)),e&&bt(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),Cr(this))},Ee.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Cr(this))},Ee.prototype.render=Ye,$t=[],Pi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Oi=function(e,n){return e.__v.__b-n.__v.__b},Ue.__r=0,en=Math.random().toString(8),Oe="__d"+en,ce="__a"+en,Ei=/(PointerCapture)$|Capture$/i,Dn=0,wn=Sr(!1),kn=Sr(!0);function Mr(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 vc(e){if(Array.isArray(e))return e}function mc(e,n,r){return(n=Ac(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function xc(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],c=!0,l=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(c=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);c=!0);}catch(f){l=!0,o=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return u}}function bc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tr(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function wc(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Tr(Object(r),!0).forEach(function(i){mc(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tr(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function kc(e,n){return vc(e)||xc(e,n)||Sc(e,n)||bc()}function Cc(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 new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Ac(e){var n=Cc(e,"string");return typeof n=="symbol"?n:n+""}function He(e){"@babel/helpers - typeof";return He=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},He(e)}function Sc(e,n){if(e){if(typeof e=="string")return Mr(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)?Mr(e,n):void 0}}var Cn=function(n){if(He(n)!=="object")return n;var r=Li(n);if(r.props){var i;r.props=wc({},r.props),r!=null&&(i=r.props)!==null&&i!==void 0&&i.children&&(r.props.children=Array.isArray(r.props.children)?r.props.children.map(Cn):Cn(r.props.children))}return r},Mc=function(n){return Ti(Li(n))},Tc=function(n,r){delete r.__k,_c(Cn(n),r)};function Pc(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var Oc=`.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;
|
|
}
|
|
`;Pc(Oc);var Ec=jn({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.style,a=o===void 0?{}:o,s=!!n&&He(n)==="object"&&!!n.node&&typeof n.node=="function",u=pt(s?n.node():n);u.style("position")==="static"&&u.style("position","relative"),r.tooltipEl=u.append("div").attr("class","float-tooltip-kap"),Object.entries(a).forEach(function(l){var f=kc(l,2),h=f[0],d=f[1];return r.tooltipEl.style(h,d)}),r.tooltipEl.style("left","-10000px").style("display","none");var c="tooltip-".concat(Math.round(Math.random()*1e12));r.mouseInside=!1,u.on("mousemove.".concat(c),function(l){r.mouseInside=!0;var f=xt(l),h=u.node(),d=h.offsetWidth,p=h.offsetHeight,y=[r.offsetX===null||r.offsetX===void 0?"-".concat(f[0]/d*100,"%"):typeof r.offsetX=="number"?"calc(-50% + ".concat(r.offsetX,"px)"):r.offsetX,r.offsetY===null||r.offsetY===void 0?p>130&&p-f[1]<100?"calc(-100% - 6px)":"21px":typeof r.offsetY=="number"?r.offsetY<0?"calc(-100% - ".concat(Math.abs(r.offsetY),"px)"):"".concat(r.offsetY,"px"):r.offsetY];r.tooltipEl.style("left",f[0]+"px").style("top",f[1]+"px").style("transform","translate(".concat(y.join(","),")")),r.content&&r.tooltipEl.style("display","inline")}),u.on("mouseover.".concat(c),function(){r.mouseInside=!0,r.content&&r.tooltipEl.style("display","inline")}),u.on("mouseout.".concat(c),function(){r.mouseInside=!1,r.tooltipEl.style("display","none")})},update:function(n){n.tooltipEl.style("display",n.content&&n.mouseInside?"inline":"none"),n.content?n.content instanceof HTMLElement?(n.tooltipEl.text(""),n.tooltipEl.append(function(){return n.content})):typeof n.content=="string"?n.tooltipEl.html(n.content):Mc(n.content)?(n.tooltipEl.text(""),Tc(n.content,n.tooltipEl.node())):(n.tooltipEl.style("display","none"),console.warn("Tooltip content is invalid, skipping.",n.content,n.content.toString())):n.tooltipEl.text("")}});function zc(e,n,r){var i,o=1;e==null&&(e=0),n==null&&(n=0),r==null&&(r=0);function a(){var s,u=i.length,c,l=0,f=0,h=0;for(s=0;s<u;++s)c=i[s],l+=c.x||0,f+=c.y||0,h+=c.z||0;for(l=(l/u-e)*o,f=(f/u-n)*o,h=(h/u-r)*o,s=0;s<u;++s)c=i[s],l&&(c.x-=l),f&&(c.y-=f),h&&(c.z-=h)}return a.initialize=function(s){i=s},a.x=function(s){return arguments.length?(e=+s,a):e},a.y=function(s){return arguments.length?(n=+s,a):n},a.z=function(s){return arguments.length?(r=+s,a):r},a.strength=function(s){return arguments.length?(o=+s,a):o},a}function Nc(e){const n=+this._x.call(null,e);return Fi(this.cover(n),n,e)}function Fi(e,n,r){if(isNaN(n))return e;var i,o=e._root,a={data:r},s=e._x0,u=e._x1,c,l,f,h,d;if(!o)return e._root=a,e;for(;o.length;)if((f=n>=(c=(s+u)/2))?s=c:u=c,i=o,!(o=o[h=+f]))return i[h]=a,e;if(l=+e._x.call(null,o.data),n===l)return a.next=o,i?i[h]=a:e._root=a,e;do i=i?i[h]=new Array(2):e._root=new Array(2),(f=n>=(c=(s+u)/2))?s=c:u=c;while((h=+f)==(d=+(l>=c)));return i[d]=o,i[h]=a,e}function Rc(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n);let i=1/0,o=-1/0;for(let a=0,s;a<n;++a)isNaN(s=+this._x.call(null,e[a]))||(r[a]=s,s<i&&(i=s),s>o&&(o=s));if(i>o)return this;this.cover(i).cover(o);for(let a=0;a<n;++a)Fi(this,r[a],e[a]);return this}function jc(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,o=this._root,a,s;n>e||e>=r;)switch(s=+(e<n),a=new Array(2),a[s]=o,o=a,i*=2,s){case 0:r=n+i;break;case 1:n=r-i;break}this._root&&this._root.length&&(this._root=o)}return this._x0=n,this._x1=r,this}function Dc(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Ic(e){return arguments.length?this.cover(+e[0][0]).cover(+e[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function Nt(e,n,r){this.node=e,this.x0=n,this.x1=r}function $c(e,n){var r,i=this._x0,o,a,s=this._x1,u=[],c=this._root,l,f;for(c&&u.push(new Nt(c,i,s)),n==null?n=1/0:(i=e-n,s=e+n);l=u.pop();)if(!(!(c=l.node)||(o=l.x0)>s||(a=l.x1)<i))if(c.length){var h=(o+a)/2;u.push(new Nt(c[1],h,a),new Nt(c[0],o,h)),(f=+(e>=h))&&(l=u[u.length-1],u[u.length-1]=u[u.length-1-f],u[u.length-1-f]=l)}else{var d=Math.abs(e-+this._x.call(null,c.data));d<n&&(n=d,i=e-d,s=e+d,r=c.data)}return r}function Lc(e){if(isNaN(c=+this._x.call(null,e)))return this;var n,r=this._root,i,o,a,s=this._x0,u=this._x1,c,l,f,h,d;if(!r)return this;if(r.length)for(;;){if((f=c>=(l=(s+u)/2))?s=l:u=l,n=r,!(r=r[h=+f]))return this;if(!r.length)break;n[h+1&1]&&(i=n,d=h)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,o?(a?o.next=a:delete o.next,this):n?(a?n[h]=a:delete n[h],(r=n[0]||n[1])&&r===(n[1]||n[0])&&!r.length&&(i?i[d]=r:this._root=r),this):(this._root=a,this)}function Fc(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function Uc(){return this._root}function Hc(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function qc(e){var n=[],r,i=this._root,o,a,s;for(i&&n.push(new Nt(i,this._x0,this._x1));r=n.pop();)if(!e(i=r.node,a=r.x0,s=r.x1)&&i.length){var u=(a+s)/2;(o=i[1])&&n.push(new Nt(o,u,s)),(o=i[0])&&n.push(new Nt(o,a,u))}return this}function Wc(e){var n=[],r=[],i;for(this._root&&n.push(new Nt(this._root,this._x0,this._x1));i=n.pop();){var o=i.node;if(o.length){var a,s=i.x0,u=i.x1,c=(s+u)/2;(a=o[0])&&n.push(new Nt(a,s,c)),(a=o[1])&&n.push(new Nt(a,c,u))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.x1);return this}function Gc(e){return e[0]}function Vc(e){return arguments.length?(this._x=e,this):this._x}function Ui(e,n){var r=new Fn(n??Gc,NaN,NaN);return e==null?r:r.addAll(e)}function Fn(e,n,r){this._x=e,this._x0=n,this._x1=r,this._root=void 0}function Pr(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var ut=Ui.prototype=Fn.prototype;ut.copy=function(){var e=new Fn(this._x,this._x0,this._x1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=Pr(n),e;for(r=[{source:n,target:e._root=new Array(2)}];n=r.pop();)for(var o=0;o<2;++o)(i=n.source[o])&&(i.length?r.push({source:i,target:n.target[o]=new Array(2)}):n.target[o]=Pr(i));return e};ut.add=Nc;ut.addAll=Rc;ut.cover=jc;ut.data=Dc;ut.extent=Ic;ut.find=$c;ut.remove=Lc;ut.removeAll=Fc;ut.root=Uc;ut.size=Hc;ut.visit=qc;ut.visitAfter=Wc;ut.x=Vc;function Bc(e){const n=+this._x.call(null,e),r=+this._y.call(null,e);return Hi(this.cover(n,r),n,r,e)}function Hi(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var o,a=e._root,s={data:i},u=e._x0,c=e._y0,l=e._x1,f=e._y1,h,d,p,y,x,m,g,k;if(!a)return e._root=s,e;for(;a.length;)if((x=n>=(h=(u+l)/2))?u=h:l=h,(m=r>=(d=(c+f)/2))?c=d:f=d,o=a,!(a=a[g=m<<1|x]))return o[g]=s,e;if(p=+e._x.call(null,a.data),y=+e._y.call(null,a.data),n===p&&r===y)return s.next=a,o?o[g]=s:e._root=s,e;do o=o?o[g]=new Array(4):e._root=new Array(4),(x=n>=(h=(u+l)/2))?u=h:l=h,(m=r>=(d=(c+f)/2))?c=d:f=d;while((g=m<<1|x)===(k=(y>=d)<<1|p>=h));return o[k]=a,o[g]=s,e}function Xc(e){var n,r,i=e.length,o,a,s=new Array(i),u=new Array(i),c=1/0,l=1/0,f=-1/0,h=-1/0;for(r=0;r<i;++r)isNaN(o=+this._x.call(null,n=e[r]))||isNaN(a=+this._y.call(null,n))||(s[r]=o,u[r]=a,o<c&&(c=o),o>f&&(f=o),a<l&&(l=a),a>h&&(h=a));if(c>f||l>h)return this;for(this.cover(c,l).cover(f,h),r=0;r<i;++r)Hi(this,s[r],u[r],e[r]);return this}function Yc(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,o=this._x1,a=this._y1;if(isNaN(r))o=(r=Math.floor(e))+1,a=(i=Math.floor(n))+1;else{for(var s=o-r||1,u=this._root,c,l;r>e||e>=o||i>n||n>=a;)switch(l=(n<i)<<1|e<r,c=new Array(4),c[l]=u,u=c,s*=2,l){case 0:o=r+s,a=i+s;break;case 1:r=o-s,a=i+s;break;case 2:o=r+s,i=a-s;break;case 3:r=o-s,i=a-s;break}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=i,this._x1=o,this._y1=a,this}function Zc(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Kc(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 ot(e,n,r,i,o){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=o}function Qc(e,n,r){var i,o=this._x0,a=this._y0,s,u,c,l,f=this._x1,h=this._y1,d=[],p=this._root,y,x;for(p&&d.push(new ot(p,o,a,f,h)),r==null?r=1/0:(o=e-r,a=n-r,f=e+r,h=n+r,r*=r);y=d.pop();)if(!(!(p=y.node)||(s=y.x0)>f||(u=y.y0)>h||(c=y.x1)<o||(l=y.y1)<a))if(p.length){var m=(s+c)/2,g=(u+l)/2;d.push(new ot(p[3],m,g,c,l),new ot(p[2],s,g,m,l),new ot(p[1],m,u,c,g),new ot(p[0],s,u,m,g)),(x=(n>=g)<<1|e>=m)&&(y=d[d.length-1],d[d.length-1]=d[d.length-1-x],d[d.length-1-x]=y)}else{var k=e-+this._x.call(null,p.data),w=n-+this._y.call(null,p.data),_=k*k+w*w;if(_<r){var v=Math.sqrt(r=_);o=e-v,a=n-v,f=e+v,h=n+v,i=p.data}}return i}function Jc(e){if(isNaN(f=+this._x.call(null,e))||isNaN(h=+this._y.call(null,e)))return this;var n,r=this._root,i,o,a,s=this._x0,u=this._y0,c=this._x1,l=this._y1,f,h,d,p,y,x,m,g;if(!r)return this;if(r.length)for(;;){if((y=f>=(d=(s+c)/2))?s=d:c=d,(x=h>=(p=(u+l)/2))?u=p:l=p,n=r,!(r=r[m=x<<1|y]))return this;if(!r.length)break;(n[m+1&3]||n[m+2&3]||n[m+3&3])&&(i=n,g=m)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,o?(a?o.next=a:delete o.next,this):n?(a?n[m]=a:delete n[m],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[g]=r:this._root=r),this):(this._root=a,this)}function tf(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function ef(){return this._root}function nf(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function rf(e){var n=[],r,i=this._root,o,a,s,u,c;for(i&&n.push(new ot(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,a=r.x0,s=r.y0,u=r.x1,c=r.y1)&&i.length){var l=(a+u)/2,f=(s+c)/2;(o=i[3])&&n.push(new ot(o,l,f,u,c)),(o=i[2])&&n.push(new ot(o,a,f,l,c)),(o=i[1])&&n.push(new ot(o,l,s,u,f)),(o=i[0])&&n.push(new ot(o,a,s,l,f))}return this}function of(e){var n=[],r=[],i;for(this._root&&n.push(new ot(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var o=i.node;if(o.length){var a,s=i.x0,u=i.y0,c=i.x1,l=i.y1,f=(s+c)/2,h=(u+l)/2;(a=o[0])&&n.push(new ot(a,s,u,f,h)),(a=o[1])&&n.push(new ot(a,f,u,c,h)),(a=o[2])&&n.push(new ot(a,s,h,f,l)),(a=o[3])&&n.push(new ot(a,f,h,c,l))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function af(e){return e[0]}function sf(e){return arguments.length?(this._x=e,this):this._x}function uf(e){return e[1]}function lf(e){return arguments.length?(this._y=e,this):this._y}function Un(e,n,r){var i=new Hn(n??af,r??uf,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Hn(e,n,r,i,o,a){this._x=e,this._y=n,this._x0=r,this._y0=i,this._x1=o,this._y1=a,this._root=void 0}function Or(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var at=Un.prototype=Hn.prototype;at.copy=function(){var e=new Hn(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=Or(n),e;for(r=[{source:n,target:e._root=new Array(4)}];n=r.pop();)for(var o=0;o<4;++o)(i=n.source[o])&&(i.length?r.push({source:i,target:n.target[o]=new Array(4)}):n.target[o]=Or(i));return e};at.add=Bc;at.addAll=Xc;at.cover=Yc;at.data=Zc;at.extent=Kc;at.find=Qc;at.remove=Jc;at.removeAll=tf;at.root=ef;at.size=nf;at.visit=rf;at.visitAfter=of;at.x=sf;at.y=lf;function cf(e){const n=+this._x.call(null,e),r=+this._y.call(null,e),i=+this._z.call(null,e);return qi(this.cover(n,r,i),n,r,i,e)}function qi(e,n,r,i,o){if(isNaN(n)||isNaN(r)||isNaN(i))return e;var a,s=e._root,u={data:o},c=e._x0,l=e._y0,f=e._z0,h=e._x1,d=e._y1,p=e._z1,y,x,m,g,k,w,_,v,A,M,T;if(!s)return e._root=u,e;for(;s.length;)if((_=n>=(y=(c+h)/2))?c=y:h=y,(v=r>=(x=(l+d)/2))?l=x:d=x,(A=i>=(m=(f+p)/2))?f=m:p=m,a=s,!(s=s[M=A<<2|v<<1|_]))return a[M]=u,e;if(g=+e._x.call(null,s.data),k=+e._y.call(null,s.data),w=+e._z.call(null,s.data),n===g&&r===k&&i===w)return u.next=s,a?a[M]=u:e._root=u,e;do a=a?a[M]=new Array(8):e._root=new Array(8),(_=n>=(y=(c+h)/2))?c=y:h=y,(v=r>=(x=(l+d)/2))?l=x:d=x,(A=i>=(m=(f+p)/2))?f=m:p=m;while((M=A<<2|v<<1|_)===(T=(w>=m)<<2|(k>=x)<<1|g>=y));return a[T]=s,a[M]=u,e}function ff(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n),i=new Float64Array(n),o=new Float64Array(n);let a=1/0,s=1/0,u=1/0,c=-1/0,l=-1/0,f=-1/0;for(let h=0,d,p,y,x;h<n;++h)isNaN(p=+this._x.call(null,d=e[h]))||isNaN(y=+this._y.call(null,d))||isNaN(x=+this._z.call(null,d))||(r[h]=p,i[h]=y,o[h]=x,p<a&&(a=p),p>c&&(c=p),y<s&&(s=y),y>l&&(l=y),x<u&&(u=x),x>f&&(f=x));if(a>c||s>l||u>f)return this;this.cover(a,s,u).cover(c,l,f);for(let h=0;h<n;++h)qi(this,r[h],i[h],o[h],e[h]);return this}function hf(e,n,r){if(isNaN(e=+e)||isNaN(n=+n)||isNaN(r=+r))return this;var i=this._x0,o=this._y0,a=this._z0,s=this._x1,u=this._y1,c=this._z1;if(isNaN(i))s=(i=Math.floor(e))+1,u=(o=Math.floor(n))+1,c=(a=Math.floor(r))+1;else{for(var l=s-i||1,f=this._root,h,d;i>e||e>=s||o>n||n>=u||a>r||r>=c;)switch(d=(r<a)<<2|(n<o)<<1|e<i,h=new Array(8),h[d]=f,f=h,l*=2,d){case 0:s=i+l,u=o+l,c=a+l;break;case 1:i=s-l,u=o+l,c=a+l;break;case 2:s=i+l,o=u-l,c=a+l;break;case 3:i=s-l,o=u-l,c=a+l;break;case 4:s=i+l,u=o+l,a=c-l;break;case 5:i=s-l,u=o+l,a=c-l;break;case 6:s=i+l,o=u-l,a=c-l;break;case 7:i=s-l,o=u-l,a=c-l;break}this._root&&this._root.length&&(this._root=f)}return this._x0=i,this._y0=o,this._z0=a,this._x1=s,this._y1=u,this._z1=c,this}function df(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function pf(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 Y(e,n,r,i,o,a,s){this.node=e,this.x0=n,this.y0=r,this.z0=i,this.x1=o,this.y1=a,this.z1=s}function gf(e,n,r,i){var o,a=this._x0,s=this._y0,u=this._z0,c,l,f,h,d,p,y=this._x1,x=this._y1,m=this._z1,g=[],k=this._root,w,_;for(k&&g.push(new Y(k,a,s,u,y,x,m)),i==null?i=1/0:(a=e-i,s=n-i,u=r-i,y=e+i,x=n+i,m=r+i,i*=i);w=g.pop();)if(!(!(k=w.node)||(c=w.x0)>y||(l=w.y0)>x||(f=w.z0)>m||(h=w.x1)<a||(d=w.y1)<s||(p=w.z1)<u))if(k.length){var v=(c+h)/2,A=(l+d)/2,M=(f+p)/2;g.push(new Y(k[7],v,A,M,h,d,p),new Y(k[6],c,A,M,v,d,p),new Y(k[5],v,l,M,h,A,p),new Y(k[4],c,l,M,v,A,p),new Y(k[3],v,A,f,h,d,M),new Y(k[2],c,A,f,v,d,M),new Y(k[1],v,l,f,h,A,M),new Y(k[0],c,l,f,v,A,M)),(_=(r>=M)<<2|(n>=A)<<1|e>=v)&&(w=g[g.length-1],g[g.length-1]=g[g.length-1-_],g[g.length-1-_]=w)}else{var T=e-+this._x.call(null,k.data),R=n-+this._y.call(null,k.data),P=r-+this._z.call(null,k.data),N=T*T+R*R+P*P;if(N<i){var D=Math.sqrt(i=N);a=e-D,s=n-D,u=r-D,y=e+D,x=n+D,m=r+D,o=k.data}}return o}const yf=(e,n,r,i,o,a)=>Math.sqrt((e-i)**2+(n-o)**2+(r-a)**2);function _f(e,n,r,i){const o=[],a=e-i,s=n-i,u=r-i,c=e+i,l=n+i,f=r+i;return this.visit((h,d,p,y,x,m,g)=>{if(!h.length)do{const k=h.data;yf(e,n,r,this._x(k),this._y(k),this._z(k))<=i&&o.push(k)}while(h=h.next);return d>c||p>l||y>f||x<a||m<s||g<u}),o}function vf(e){if(isNaN(d=+this._x.call(null,e))||isNaN(p=+this._y.call(null,e))||isNaN(y=+this._z.call(null,e)))return this;var n,r=this._root,i,o,a,s=this._x0,u=this._y0,c=this._z0,l=this._x1,f=this._y1,h=this._z1,d,p,y,x,m,g,k,w,_,v,A;if(!r)return this;if(r.length)for(;;){if((k=d>=(x=(s+l)/2))?s=x:l=x,(w=p>=(m=(u+f)/2))?u=m:f=m,(_=y>=(g=(c+h)/2))?c=g:h=g,n=r,!(r=r[v=_<<2|w<<1|k]))return this;if(!r.length)break;(n[v+1&7]||n[v+2&7]||n[v+3&7]||n[v+4&7]||n[v+5&7]||n[v+6&7]||n[v+7&7])&&(i=n,A=v)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,o?(a?o.next=a:delete o.next,this):n?(a?n[v]=a:delete n[v],(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[A]=r:this._root=r),this):(this._root=a,this)}function mf(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function xf(){return this._root}function bf(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function wf(e){var n=[],r,i=this._root,o,a,s,u,c,l,f;for(i&&n.push(new Y(i,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));r=n.pop();)if(!e(i=r.node,a=r.x0,s=r.y0,u=r.z0,c=r.x1,l=r.y1,f=r.z1)&&i.length){var h=(a+c)/2,d=(s+l)/2,p=(u+f)/2;(o=i[7])&&n.push(new Y(o,h,d,p,c,l,f)),(o=i[6])&&n.push(new Y(o,a,d,p,h,l,f)),(o=i[5])&&n.push(new Y(o,h,s,p,c,d,f)),(o=i[4])&&n.push(new Y(o,a,s,p,h,d,f)),(o=i[3])&&n.push(new Y(o,h,d,u,c,l,p)),(o=i[2])&&n.push(new Y(o,a,d,u,h,l,p)),(o=i[1])&&n.push(new Y(o,h,s,u,c,d,p)),(o=i[0])&&n.push(new Y(o,a,s,u,h,d,p))}return this}function kf(e){var n=[],r=[],i;for(this._root&&n.push(new Y(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));i=n.pop();){var o=i.node;if(o.length){var a,s=i.x0,u=i.y0,c=i.z0,l=i.x1,f=i.y1,h=i.z1,d=(s+l)/2,p=(u+f)/2,y=(c+h)/2;(a=o[0])&&n.push(new Y(a,s,u,c,d,p,y)),(a=o[1])&&n.push(new Y(a,d,u,c,l,p,y)),(a=o[2])&&n.push(new Y(a,s,p,c,d,f,y)),(a=o[3])&&n.push(new Y(a,d,p,c,l,f,y)),(a=o[4])&&n.push(new Y(a,s,u,y,d,p,h)),(a=o[5])&&n.push(new Y(a,d,u,y,l,p,h)),(a=o[6])&&n.push(new Y(a,s,p,y,d,f,h)),(a=o[7])&&n.push(new Y(a,d,p,y,l,f,h))}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 Cf(e){return e[0]}function Af(e){return arguments.length?(this._x=e,this):this._x}function Sf(e){return e[1]}function Mf(e){return arguments.length?(this._y=e,this):this._y}function Tf(e){return e[2]}function Pf(e){return arguments.length?(this._z=e,this):this._z}function Wi(e,n,r,i){var o=new qn(n??Cf,r??Sf,i??Tf,NaN,NaN,NaN,NaN,NaN,NaN);return e==null?o:o.addAll(e)}function qn(e,n,r,i,o,a,s,u,c){this._x=e,this._y=n,this._z=r,this._x0=i,this._y0=o,this._z0=a,this._x1=s,this._y1=u,this._z1=c,this._root=void 0}function Er(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var rt=Wi.prototype=qn.prototype;rt.copy=function(){var e=new qn(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=Er(n),e;for(r=[{source:n,target:e._root=new Array(8)}];n=r.pop();)for(var o=0;o<8;++o)(i=n.source[o])&&(i.length?r.push({source:i,target:n.target[o]=new Array(8)}):n.target[o]=Er(i));return e};rt.add=cf;rt.addAll=ff;rt.cover=hf;rt.data=df;rt.extent=pf;rt.find=gf;rt.findAllWithinRadius=_f;rt.remove=vf;rt.removeAll=mf;rt.root=xf;rt.size=bf;rt.visit=wf;rt.visitAfter=kf;rt.x=Af;rt.y=Mf;rt.z=Pf;function zt(e){return function(){return e}}function Ot(e){return(e()-.5)*1e-6}function Of(e){return e.index}function zr(e,n){var r=e.get(n);if(!r)throw new Error("node not found: "+n);return r}function Ef(e){var n=Of,r=d,i,o=zt(30),a,s,u,c,l,f,h=1;e==null&&(e=[]);function d(g){return 1/Math.min(c[g.source.index],c[g.target.index])}function p(g){for(var k=0,w=e.length;k<h;++k)for(var _=0,v,A,M,T=0,R=0,P=0,N,D;_<w;++_)v=e[_],A=v.source,M=v.target,T=M.x+M.vx-A.x-A.vx||Ot(f),u>1&&(R=M.y+M.vy-A.y-A.vy||Ot(f)),u>2&&(P=M.z+M.vz-A.z-A.vz||Ot(f)),N=Math.sqrt(T*T+R*R+P*P),N=(N-a[_])/N*g*i[_],T*=N,R*=N,P*=N,M.vx-=T*(D=l[_]),u>1&&(M.vy-=R*D),u>2&&(M.vz-=P*D),A.vx+=T*(D=1-D),u>1&&(A.vy+=R*D),u>2&&(A.vz+=P*D)}function y(){if(s){var g,k=s.length,w=e.length,_=new Map(s.map((A,M)=>[n(A,M,s),A])),v;for(g=0,c=new Array(k);g<w;++g)v=e[g],v.index=g,typeof v.source!="object"&&(v.source=zr(_,v.source)),typeof v.target!="object"&&(v.target=zr(_,v.target)),c[v.source.index]=(c[v.source.index]||0)+1,c[v.target.index]=(c[v.target.index]||0)+1;for(g=0,l=new Array(w);g<w;++g)v=e[g],l[g]=c[v.source.index]/(c[v.source.index]+c[v.target.index]);i=new Array(w),x(),a=new Array(w),m()}}function x(){if(s)for(var g=0,k=e.length;g<k;++g)i[g]=+r(e[g],g,e)}function m(){if(s)for(var g=0,k=e.length;g<k;++g)a[g]=+o(e[g],g,e)}return p.initialize=function(g,...k){s=g,f=k.find(w=>typeof w=="function")||Math.random,u=k.find(w=>[1,2,3].includes(w))||2,y()},p.links=function(g){return arguments.length?(e=g,y(),p):e},p.id=function(g){return arguments.length?(n=g,p):n},p.iterations=function(g){return arguments.length?(h=+g,p):h},p.strength=function(g){return arguments.length?(r=typeof g=="function"?g:zt(+g),x(),p):r},p.distance=function(g){return arguments.length?(o=typeof g=="function"?g:zt(+g),m(),p):o},p}const zf=1664525,Nf=1013904223,Nr=4294967296;function Rf(){let e=1;return()=>(e=(zf*e+Nf)%Nr)/Nr}var Rr=3;function nn(e){return e.x}function jr(e){return e.y}function jf(e){return e.z}var Df=10,If=Math.PI*(3-Math.sqrt(5)),$f=Math.PI*20/(9+Math.sqrt(221));function Lf(e,n){n=n||2;var r=Math.min(Rr,Math.max(1,Math.round(n))),i,o=1,a=.001,s=1-Math.pow(a,1/300),u=0,c=.6,l=new Map,f=En(p),h=ve("tick","end"),d=Rf();e==null&&(e=[]);function p(){y(),h.call("tick",i),o<a&&(f.stop(),h.call("end",i))}function y(g){var k,w=e.length,_;g===void 0&&(g=1);for(var v=0;v<g;++v)for(o+=(u-o)*s,l.forEach(function(A){A(o)}),k=0;k<w;++k)_=e[k],_.fx==null?_.x+=_.vx*=c:(_.x=_.fx,_.vx=0),r>1&&(_.fy==null?_.y+=_.vy*=c:(_.y=_.fy,_.vy=0)),r>2&&(_.fz==null?_.z+=_.vz*=c:(_.z=_.fz,_.vz=0));return i}function x(){for(var g=0,k=e.length,w;g<k;++g){if(w=e[g],w.index=g,w.fx!=null&&(w.x=w.fx),w.fy!=null&&(w.y=w.fy),w.fz!=null&&(w.z=w.fz),isNaN(w.x)||r>1&&isNaN(w.y)||r>2&&isNaN(w.z)){var _=Df*(r>2?Math.cbrt(.5+g):r>1?Math.sqrt(.5+g):g),v=g*If,A=g*$f;r===1?w.x=_:r===2?(w.x=_*Math.cos(v),w.y=_*Math.sin(v)):(w.x=_*Math.sin(v)*Math.cos(A),w.y=_*Math.cos(v),w.z=_*Math.sin(v)*Math.sin(A))}(isNaN(w.vx)||r>1&&isNaN(w.vy)||r>2&&isNaN(w.vz))&&(w.vx=0,r>1&&(w.vy=0),r>2&&(w.vz=0))}}function m(g){return g.initialize&&g.initialize(e,d,r),g}return x(),i={tick:y,restart:function(){return f.restart(p),i},stop:function(){return f.stop(),i},numDimensions:function(g){return arguments.length?(r=Math.min(Rr,Math.max(1,Math.round(g))),l.forEach(m),i):r},nodes:function(g){return arguments.length?(e=g,x(),l.forEach(m),i):e},alpha:function(g){return arguments.length?(o=+g,i):o},alphaMin:function(g){return arguments.length?(a=+g,i):a},alphaDecay:function(g){return arguments.length?(s=+g,i):+s},alphaTarget:function(g){return arguments.length?(u=+g,i):u},velocityDecay:function(g){return arguments.length?(c=1-g,i):1-c},randomSource:function(g){return arguments.length?(d=g,l.forEach(m),i):d},force:function(g,k){return arguments.length>1?(k==null?l.delete(g):l.set(g,m(k)),i):l.get(g)},find:function(){var g=Array.prototype.slice.call(arguments),k=g.shift()||0,w=(r>1?g.shift():null)||0,_=(r>2?g.shift():null)||0,v=g.shift()||1/0,A=0,M=e.length,T,R,P,N,D,U;for(v*=v,A=0;A<M;++A)D=e[A],T=k-D.x,R=w-(D.y||0),P=_-(D.z||0),N=T*T+R*R+P*P,N<v&&(U=D,v=N);return U},on:function(g,k){return arguments.length>1?(h.on(g,k),i):h.on(g)}}}function Ff(){var e,n,r,i,o,a=zt(-30),s,u=1,c=1/0,l=.81;function f(y){var x,m=e.length,g=(n===1?Ui(e,nn):n===2?Un(e,nn,jr):n===3?Wi(e,nn,jr,jf):null).visitAfter(d);for(o=y,x=0;x<m;++x)r=e[x],g.visit(p)}function h(){if(e){var y,x=e.length,m;for(s=new Array(x),y=0;y<x;++y)m=e[y],s[m.index]=+a(m,y,e)}}function d(y){var x=0,m,g,k=0,w,_,v,A,M=y.length;if(M){for(w=_=v=A=0;A<M;++A)(m=y[A])&&(g=Math.abs(m.value))&&(x+=m.value,k+=g,w+=g*(m.x||0),_+=g*(m.y||0),v+=g*(m.z||0));x*=Math.sqrt(4/M),y.x=w/k,n>1&&(y.y=_/k),n>2&&(y.z=v/k)}else{m=y,m.x=m.data.x,n>1&&(m.y=m.data.y),n>2&&(m.z=m.data.z);do x+=s[m.data.index];while(m=m.next)}y.value=x}function p(y,x,m,g,k){if(!y.value)return!0;var w=[m,g,k][n-1],_=y.x-r.x,v=n>1?y.y-r.y:0,A=n>2?y.z-r.z:0,M=w-x,T=_*_+v*v+A*A;if(M*M/l<T)return T<c&&(_===0&&(_=Ot(i),T+=_*_),n>1&&v===0&&(v=Ot(i),T+=v*v),n>2&&A===0&&(A=Ot(i),T+=A*A),T<u&&(T=Math.sqrt(u*T)),r.vx+=_*y.value*o/T,n>1&&(r.vy+=v*y.value*o/T),n>2&&(r.vz+=A*y.value*o/T)),!0;if(y.length||T>=c)return;(y.data!==r||y.next)&&(_===0&&(_=Ot(i),T+=_*_),n>1&&v===0&&(v=Ot(i),T+=v*v),n>2&&A===0&&(A=Ot(i),T+=A*A),T<u&&(T=Math.sqrt(u*T)));do y.data!==r&&(M=s[y.data.index]*o/T,r.vx+=_*M,n>1&&(r.vy+=v*M),n>2&&(r.vz+=A*M));while(y=y.next)}return f.initialize=function(y,...x){e=y,i=x.find(m=>typeof m=="function")||Math.random,n=x.find(m=>[1,2,3].includes(m))||2,h()},f.strength=function(y){return arguments.length?(a=typeof y=="function"?y:zt(+y),h(),f):a},f.distanceMin=function(y){return arguments.length?(u=y*y,f):Math.sqrt(u)},f.distanceMax=function(y){return arguments.length?(c=y*y,f):Math.sqrt(c)},f.theta=function(y){return arguments.length?(l=y*y,f):Math.sqrt(l)},f}function Uf(e,n,r,i){var o,a,s=zt(.1),u,c;typeof e!="function"&&(e=zt(+e)),n==null&&(n=0),r==null&&(r=0),i==null&&(i=0);function l(h){for(var d=0,p=o.length;d<p;++d){var y=o[d],x=y.x-n||1e-6,m=(y.y||0)-r||1e-6,g=(y.z||0)-i||1e-6,k=Math.sqrt(x*x+m*m+g*g),w=(c[d]-k)*u[d]*h/k;y.vx+=x*w,a>1&&(y.vy+=m*w),a>2&&(y.vz+=g*w)}}function f(){if(o){var h,d=o.length;for(u=new Array(d),c=new Array(d),h=0;h<d;++h)c[h]=+e(o[h],h,o),u[h]=isNaN(c[h])?0:+s(o[h],h,o)}}return l.initialize=function(h,...d){o=h,a=d.find(p=>[1,2,3].includes(p))||2,f()},l.strength=function(h){return arguments.length?(s=typeof h=="function"?h:zt(+h),f(),l):s},l.radius=function(h){return arguments.length?(e=typeof h=="function"?h:zt(+h),f(),l):e},l.x=function(h){return arguments.length?(n=+h,l):n},l.y=function(h){return arguments.length?(r=+h,l):r},l.z=function(h){return arguments.length?(i=+h,l):i},l}const{abs:ee,cos:Pt,sin:Wt,acos:Hf,atan2:ne,sqrt:Dt,pow:dt}=Math;function re(e){return e<0?-dt(-e,1/3):dt(e,1/3)}const Gi=Math.PI,Ce=2*Gi,It=Gi/2,qf=1e-6,rn=Number.MAX_SAFE_INTEGER||9007199254740991,on=Number.MIN_SAFE_INTEGER||-9007199254740991,Wf={x:0,y:0,z:0},z={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){const r=n(e);let i=r.x*r.x+r.y*r.y;return typeof r.z<"u"&&(i+=r.z*r.z),Dt(i)},compute:function(e,n,r){if(e===0)return n[0].t=0,n[0];const i=n.length-1;if(e===1)return n[i].t=1,n[i];const o=1-e;let a=n;if(i===0)return n[0].t=e,n[0];if(i===1){const u={x:o*a[0].x+e*a[1].x,y:o*a[0].y+e*a[1].y,t:e};return r&&(u.z=o*a[0].z+e*a[1].z),u}if(i<4){let u=o*o,c=e*e,l,f,h,d=0;i===2?(a=[a[0],a[1],a[2],Wf],l=u,f=o*e*2,h=c):i===3&&(l=u*o,f=u*e*3,h=o*c*3,d=e*c);const p={x:l*a[0].x+f*a[1].x+h*a[2].x+d*a[3].x,y:l*a[0].y+f*a[1].y+h*a[2].y+d*a[3].y,t:e};return r&&(p.z=l*a[0].z+f*a[1].z+h*a[2].z+d*a[3].z),p}const s=JSON.parse(JSON.stringify(n));for(;s.length>1;){for(let u=0;u<s.length-1;u++)s[u]={x:s[u].x+(s[u+1].x-s[u].x)*e,y:s[u].y+(s[u+1].y-s[u].y)*e},typeof s[u].z<"u"&&(s[u].z=s[u].z+(s[u+1].z-s[u].z)*e);s.splice(s.length-1,1)}return s[0].t=e,s[0]},computeWithRatios:function(e,n,r,i){const o=1-e,a=r,s=n;let u=a[0],c=a[1],l=a[2],f=a[3],h;if(u*=o,c*=e,s.length===2)return h=u+c,{x:(u*s[0].x+c*s[1].x)/h,y:(u*s[0].y+c*s[1].y)/h,z:i?(u*s[0].z+c*s[1].z)/h:!1,t:e};if(u*=o,c*=2*o,l*=e*e,s.length===3)return h=u+c+l,{x:(u*s[0].x+c*s[1].x+l*s[2].x)/h,y:(u*s[0].y+c*s[1].y+l*s[2].y)/h,z:i?(u*s[0].z+c*s[1].z+l*s[2].z)/h:!1,t:e};if(u*=o,c*=1.5*o,l*=3*o,f*=e*e*e,s.length===4)return h=u+c+l+f,{x:(u*s[0].x+c*s[1].x+l*s[2].x+f*s[3].x)/h,y:(u*s[0].y+c*s[1].y+l*s[2].y+f*s[3].y)/h,z:i?(u*s[0].z+c*s[1].z+l*s[2].z+f*s[3].z)/h:!1,t:e}},derive:function(e,n){const r=[];for(let i=e,o=i.length,a=o-1;o>1;o--,a--){const s=[];for(let u=0,c;u<a;u++)c={x:a*(i[u+1].x-i[u].x),y:a*(i[u+1].y-i[u].y)},n&&(c.z=a*(i[u+1].z-i[u].z)),s.push(c);r.push(s),i=s}return r},between:function(e,n,r){return n<=e&&e<=r||z.approximately(e,n)||z.approximately(e,r)},approximately:function(e,n,r){return ee(e-n)<=(r||qf)},length:function(e){const r=z.Tvalues.length;let i=0;for(let o=0,a;o<r;o++)a=.5*z.Tvalues[o]+.5,i+=z.Cvalues[o]*z.arcfn(a,e);return .5*i},map:function(e,n,r,i,o){const a=r-n,s=o-i,u=e-n,c=u/a;return i+s*c},lerp:function(e,n,r){const 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 typeof e.z<"u"&&(n+="/"+e.z),n},pointsToString:function(e){return"["+e.map(z.pointToString).join(", ")+"]"},copy:function(e){return JSON.parse(JSON.stringify(e))},angle:function(e,n,r){const i=n.x-e.x,o=n.y-e.y,a=r.x-e.x,s=r.y-e.y,u=i*s-o*a,c=i*a+o*s;return ne(u,c)},round:function(e,n){const r=""+e,i=r.indexOf(".");return parseFloat(r.substring(0,i+1+n))},dist:function(e,n){const r=e.x-n.x,i=e.y-n.y;return Dt(r*r+i*i)},closest:function(e,n){let r=dt(2,63),i,o;return e.forEach(function(a,s){o=z.dist(n,a),o<r&&(r=o,i=s)}),{mdist:r,mpos:i}},abcratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=dt(e,n)+dt(1-e,n),i=r-1;return ee(i/r)},projectionratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=dt(1-e,n),i=dt(e,n)+r;return r/i},lli8:function(e,n,r,i,o,a,s,u){const c=(e*i-n*r)*(o-s)-(e-r)*(o*u-a*s),l=(e*i-n*r)*(a-u)-(n-i)*(o*u-a*s),f=(e-r)*(a-u)-(n-i)*(o-s);return f==0?!1:{x:c/f,y:l/f}},lli4:function(e,n,r,i){const o=e.x,a=e.y,s=n.x,u=n.y,c=r.x,l=r.y,f=i.x,h=i.y;return z.lli8(o,a,s,u,c,l,f,h)},lli:function(e,n){return z.lli4(e,e.c,n,n.c)},makeline:function(e,n){return new K(e.x,e.y,(e.x+n.x)/2,(e.y+n.y)/2,n.x,n.y)},findbbox:function(e){let n=rn,r=rn,i=on,o=on;return e.forEach(function(a){const s=a.bbox();n>s.x.min&&(n=s.x.min),r>s.y.min&&(r=s.y.min),i<s.x.max&&(i=s.x.max),o<s.y.max&&(o=s.y.max)}),{x:{min:n,mid:(n+i)/2,max:i,size:i-n},y:{min:r,mid:(r+o)/2,max:o,size:o-r}}},shapeintersections:function(e,n,r,i,o){if(!z.bboxoverlap(n,i))return[];const a=[],s=[e.startcap,e.forward,e.back,e.endcap],u=[r.startcap,r.forward,r.back,r.endcap];return s.forEach(function(c){c.virtual||u.forEach(function(l){if(l.virtual)return;const f=c.intersects(l,o);f.length>0&&(f.c1=c,f.c2=l,f.s1=e,f.s2=r,a.push(f))})}),a},makeshape:function(e,n,r){const i=n.points.length,o=e.points.length,a=z.makeline(n.points[i-1],e.points[0]),s=z.makeline(e.points[o-1],n.points[0]),u={startcap:a,forward:e,back:n,endcap:s,bbox:z.findbbox([a,e,n,s])};return u.intersections=function(c){return z.shapeintersections(u,u.bbox,c,c.bbox,r)},u},getminmax:function(e,n,r){if(!r)return{min:0,max:0};let i=rn,o=on,a,s;r.indexOf(0)===-1&&(r=[0].concat(r)),r.indexOf(1)===-1&&r.push(1);for(let u=0,c=r.length;u<c;u++)a=r[u],s=e.get(a),s[n]<i&&(i=s[n]),s[n]>o&&(o=s[n]);return{min:i,mid:(i+o)/2,max:o,size:o-i}},align:function(e,n){const r=n.p1.x,i=n.p1.y,o=-ne(n.p2.y-i,n.p2.x-r),a=function(s){return{x:(s.x-r)*Pt(o)-(s.y-i)*Wt(o),y:(s.x-r)*Wt(o)+(s.y-i)*Pt(o)}};return e.map(a)},roots:function(e,n){n=n||{p1:{x:0,y:0},p2:{x:1,y:0}};const r=e.length-1,i=z.align(e,n),o=function(M){return 0<=M&&M<=1};if(r===2){const M=i[0].y,T=i[1].y,R=i[2].y,P=M-2*T+R;if(P!==0){const N=-Dt(T*T-M*R),D=-M+T,U=-(N+D)/P,S=-(-N+D)/P;return[U,S].filter(o)}else if(T!==R&&P===0)return[(2*T-R)/(2*T-2*R)].filter(o);return[]}const a=i[0].y,s=i[1].y,u=i[2].y,c=i[3].y;let l=-a+3*s-3*u+c,f=3*a-6*s+3*u,h=-3*a+3*s,d=a;if(z.approximately(l,0)){if(z.approximately(f,0))return z.approximately(h,0)?[]:[-d/h].filter(o);const M=Dt(h*h-4*f*d),T=2*f;return[(M-h)/T,(-h-M)/T].filter(o)}f/=l,h/=l,d/=l;const p=(3*h-f*f)/3,y=p/3,x=(2*f*f*f-9*f*h+27*d)/27,m=x/2,g=m*m+y*y*y;let k,w,_,v,A;if(g<0){const M=-p/3,T=M*M*M,R=Dt(T),P=-x/(2*R),N=P<-1?-1:P>1?1:P,D=Hf(N),U=re(R),S=2*U;return _=S*Pt(D/3)-f/3,v=S*Pt((D+Ce)/3)-f/3,A=S*Pt((D+2*Ce)/3)-f/3,[_,v,A].filter(o)}else{if(g===0)return k=m<0?re(-m):-re(m),_=2*k-f/3,v=-k-f/3,[_,v].filter(o);{const M=Dt(g);return k=re(-m+M),w=re(m+M),[k-w-f/3].filter(o)}}},droots:function(e){if(e.length===3){const n=e[0],r=e[1],i=e[2],o=n-2*r+i;if(o!==0){const a=-Dt(r*r-n*i),s=-n+r,u=-(a+s)/o,c=-(-a+s)/o;return[u,c]}else if(r!==i&&o===0)return[(2*r-i)/(2*(r-i))];return[]}if(e.length===2){const n=e[0],r=e[1];return n!==r?[n/(n-r)]:[]}return[]},curvature:function(e,n,r,i,o){let a,s,u,c,l=0,f=0;const h=z.compute(e,n),d=z.compute(e,r),p=h.x*h.x+h.y*h.y;if(i?(a=Dt(dt(h.y*d.z-d.y*h.z,2)+dt(h.z*d.x-d.z*h.x,2)+dt(h.x*d.y-d.x*h.y,2)),s=dt(p+h.z*h.z,3/2)):(a=h.x*d.y-h.y*d.x,s=dt(p,3/2)),a===0||s===0)return{k:0,r:0};if(l=a/s,f=s/a,!o){const y=z.curvature(e-.001,n,r,i,!0).k,x=z.curvature(e+.001,n,r,i,!0).k;c=(x-l+(l-y))/2,u=(ee(x-l)+ee(l-y))/2}return{k:l,r:f,dk:c,adk:u}},inflections:function(e){if(e.length<4)return[];const n=z.align(e,{p1:e[0],p2:e.slice(-1)[0]}),r=n[2].x*n[1].y,i=n[3].x*n[1].y,o=n[1].x*n[2].y,a=n[3].x*n[2].y,s=18*(-3*r+2*i+3*o-a),u=18*(3*r-i-3*o),c=18*(o-r);if(z.approximately(s,0)){if(!z.approximately(u,0)){let d=-c/u;if(0<=d&&d<=1)return[d]}return[]}const l=2*s;if(z.approximately(l,0))return[];const f=u*u-4*s*c;if(f<0)return[];const h=Math.sqrt(f);return[(h-u)/l,-(u+h)/l].filter(function(d){return 0<=d&&d<=1})},bboxoverlap:function(e,n){const r=["x","y"],i=r.length;for(let o=0,a,s,u,c;o<i;o++)if(a=r[o],s=e[a].mid,u=n[a].mid,c=(e[a].size+n[a].size)/2,ee(s-u)>=c)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){const i=e.bbox(),o=n.bbox(),a=1e5,s=r||.5;if(i.x.size+i.y.size<s&&o.x.size+o.y.size<s)return[(a*(e._t1+e._t2)/2|0)/a+"/"+(a*(n._t1+n._t2)/2|0)/a];let u=e.split(.5),c=n.split(.5),l=[{left:u.left,right:c.left},{left:u.left,right:c.right},{left:u.right,right:c.right},{left:u.right,right:c.left}];l=l.filter(function(h){return z.bboxoverlap(h.left.bbox(),h.right.bbox())});let f=[];return l.length===0||(l.forEach(function(h){f=f.concat(z.pairiteration(h.left,h.right,s))}),f=f.filter(function(h,d){return f.indexOf(h)===d})),f},getccenter:function(e,n,r){const i=n.x-e.x,o=n.y-e.y,a=r.x-n.x,s=r.y-n.y,u=i*Pt(It)-o*Wt(It),c=i*Wt(It)+o*Pt(It),l=a*Pt(It)-s*Wt(It),f=a*Wt(It)+s*Pt(It),h=(e.x+n.x)/2,d=(e.y+n.y)/2,p=(n.x+r.x)/2,y=(n.y+r.y)/2,x=h+u,m=d+c,g=p+l,k=y+f,w=z.lli8(h,d,x,m,p,y,g,k),_=z.dist(w,e);let v=ne(e.y-w.y,e.x-w.x),A=ne(n.y-w.y,n.x-w.x),M=ne(r.y-w.y,r.x-w.x),T;return v<M?((v>A||A>M)&&(v+=Ce),v>M&&(T=M,M=v,v=T)):M<A&&A<v?(T=M,M=v,v=T):M+=Ce,w.s=v,w.e=M,w.r=_,w},numberSort:function(e,n){return e-n}};class he{constructor(n){this.curves=[],this._3d=!1,n&&(this.curves=n,this._3d=this.curves[0]._3d)}valueOf(){return this.toString()}toString(){return"["+this.curves.map(function(n){return z.pointsToString(n.points)}).join(", ")+"]"}addCurve(n){this.curves.push(n),this._3d=this._3d||n._3d}length(){return this.curves.map(function(n){return n.length()}).reduce(function(n,r){return n+r})}curve(n){return this.curves[n]}bbox(){const n=this.curves;for(var r=n[0].bbox(),i=1;i<n.length;i++)z.expandbox(r,n[i].bbox());return r}offset(n){const r=[];return this.curves.forEach(function(i){r.push(...i.offset(n))}),new he(r)}}const{abs:ie,min:Dr,max:Ir,cos:Gf,sin:Vf,acos:Bf,sqrt:oe}=Math,Xf=Math.PI;class K{constructor(n){let r=n&&n.forEach?n:Array.from(arguments).slice(),i=!1;if(typeof r[0]=="object"){i=r.length;const p=[];r.forEach(function(y){["x","y","z"].forEach(function(x){typeof y[x]<"u"&&p.push(y[x])})}),r=p}let o=!1;const a=r.length;if(i){if(i>4){if(arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");o=!0}}else if(a!==6&&a!==8&&a!==9&&a!==12&&arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");const s=this._3d=!o&&(a===9||a===12)||n&&n[0]&&typeof n[0].z<"u",u=this.points=[];for(let p=0,y=s?3:2;p<a;p+=y){var c={x:r[p],y:r[p+1]};s&&(c.z=r[p+2]),u.push(c)}const l=this.order=u.length-1,f=this.dims=["x","y"];s&&f.push("z"),this.dimlen=f.length;const h=z.align(u,{p1:u[0],p2:u[l]}),d=z.dist(u[0],u[l]);this._linear=h.reduce((p,y)=>p+ie(y.y),0)<d/50,this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(n,r,i,o){if(typeof o>"u"&&(o=.5),o===0)return new K(r,r,i);if(o===1)return new K(n,r,r);const a=K.getABC(2,n,r,i,o);return new K(n,a.A,i)}static cubicFromPoints(n,r,i,o,a){typeof o>"u"&&(o=.5);const s=K.getABC(3,n,r,i,o);typeof a>"u"&&(a=z.dist(r,s.C));const u=a*(1-o)/o,c=z.dist(n,i),l=(i.x-n.x)/c,f=(i.y-n.y)/c,h=a*l,d=a*f,p=u*l,y=u*f,x={x:r.x-h,y:r.y-d},m={x:r.x+p,y:r.y+y},g=s.A,k={x:g.x+(x.x-g.x)/(1-o),y:g.y+(x.y-g.y)/(1-o)},w={x:g.x+(m.x-g.x)/o,y:g.y+(m.y-g.y)/o},_={x:n.x+(k.x-n.x)/o,y:n.y+(k.y-n.y)/o},v={x:i.x+(w.x-i.x)/(1-o),y:i.y+(w.y-i.y)/(1-o)};return new K(n,_,v,i)}static getUtils(){return z}getUtils(){return K.getUtils()}static get PolyBezier(){return he}valueOf(){return this.toString()}toString(){return z.pointsToString(this.points)}toSVG(){if(this._3d)return!1;const n=this.points,r=n[0].x,i=n[0].y,o=["M",r,i,this.order===2?"Q":"C"];for(let a=1,s=n.length;a<s;a++)o.push(n[a].x),o.push(n[a].y);return o.join(" ")}setRatios(n){if(n.length!==this.points.length)throw new Error("incorrect number of ratio values");this.ratios=n,this._lut=[]}verify(){const n=this.coordDigest();n!==this._print&&(this._print=n,this.update())}coordDigest(){return this.points.map(function(n,r){return""+r+n.x+n.y+(n.z?n.z:0)}).join("")}update(){this._lut=[],this.dpoints=z.derive(this.points,this._3d),this.computedirection()}computedirection(){const n=this.points,r=z.angle(n[0],n[this.order],n[1]);this.clockwise=r>0}length(){return z.length(this.derivative.bind(this))}static getABC(n=2,r,i,o,a=.5){const s=z.projectionratio(a,n),u=1-s,c={x:s*r.x+u*o.x,y:s*r.y+u*o.y},l=z.abcratio(a,n);return{A:{x:i.x+(i.x-c.x)/l,y:i.y+(i.y-c.y)/l},B:i,C:c,S:r,E:o}}getABC(n,r){r=r||this.get(n);let i=this.points[0],o=this.points[this.order];return K.getABC(this.order,i,r,o,n)}getLUT(n){if(this.verify(),n=n||100,this._lut.length===n+1)return this._lut;this._lut=[],n++,this._lut=[];for(let r=0,i,o;r<n;r++)o=r/(n-1),i=this.compute(o),i.t=o,this._lut.push(i);return this._lut}on(n,r){r=r||5;const i=this.getLUT(),o=[];for(let a=0,s,u=0;a<i.length;a++)s=i[a],z.dist(s,n)<r&&(o.push(s),u+=a/i.length);return o.length?t/=o.length:!1}project(n){const r=this.getLUT(),i=r.length-1,o=z.closest(r,n),a=o.mpos,s=(a-1)/i,u=(a+1)/i,c=.1/i;let l=o.mdist,f=s,h=f,d;l+=1;for(let p;f<u+c;f+=c)d=this.compute(f),p=z.dist(n,d),p<l&&(l=p,h=f);return h=h<0?0:h>1?1:h,d=this.compute(h),d.t=h,d.d=l,d}get(n){return this.compute(n)}point(n){return this.points[n]}compute(n){return this.ratios?z.computeWithRatios(n,this.points,this.ratios,this._3d):z.compute(n,this.points,this._3d,this.ratios)}raise(){const n=this.points,r=[n[0]],i=n.length;for(let o=1,a,s;o<i;o++)a=n[o],s=n[o-1],r[o]={x:(i-o)/i*a.x+o/i*s.x,y:(i-o)/i*a.y+o/i*s.y};return r[i]=n[i-1],new K(r)}derivative(n){return z.compute(n,this.dpoints[0],this._3d)}dderivative(n){return z.compute(n,this.dpoints[1],this._3d)}align(){let n=this.points;return new K(z.align(n,{p1:n[0],p2:n[n.length-1]}))}curvature(n){return z.curvature(n,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return z.inflections(this.points)}normal(n){return this._3d?this.__normal3(n):this.__normal2(n)}__normal2(n){const r=this.derivative(n),i=oe(r.x*r.x+r.y*r.y);return{t:n,x:-r.y/i,y:r.x/i}}__normal3(n){const r=this.derivative(n),i=this.derivative(n+.01),o=oe(r.x*r.x+r.y*r.y+r.z*r.z),a=oe(i.x*i.x+i.y*i.y+i.z*i.z);r.x/=o,r.y/=o,r.z/=o,i.x/=a,i.y/=a,i.z/=a;const s={x:i.y*r.z-i.z*r.y,y:i.z*r.x-i.x*r.z,z:i.x*r.y-i.y*r.x},u=oe(s.x*s.x+s.y*s.y+s.z*s.z);s.x/=u,s.y/=u,s.z/=u;const c=[s.x*s.x,s.x*s.y-s.z,s.x*s.z+s.y,s.x*s.y+s.z,s.y*s.y,s.y*s.z-s.x,s.x*s.z-s.y,s.y*s.z+s.x,s.z*s.z];return{t:n,x:c[0]*r.x+c[1]*r.y+c[2]*r.z,y:c[3]*r.x+c[4]*r.y+c[5]*r.z,z:c[6]*r.x+c[7]*r.y+c[8]*r.z}}hull(n){let r=this.points,i=[],o=[],a=0;for(o[a++]=r[0],o[a++]=r[1],o[a++]=r[2],this.order===3&&(o[a++]=r[3]);r.length>1;){i=[];for(let s=0,u,c=r.length-1;s<c;s++)u=z.lerp(n,r[s],r[s+1]),o[a++]=u,i.push(u);r=i}return o}split(n,r){if(n===0&&r)return this.split(r).left;if(r===1)return this.split(n).right;const i=this.hull(n),o={left:this.order===2?new K([i[0],i[3],i[5]]):new K([i[0],i[4],i[7],i[9]]),right:this.order===2?new K([i[5],i[4],i[2]]):new K([i[9],i[8],i[6],i[3]]),span:i};return o.left._t1=z.map(0,0,1,this._t1,this._t2),o.left._t2=z.map(n,0,1,this._t1,this._t2),o.right._t1=z.map(n,0,1,this._t1,this._t2),o.right._t2=z.map(1,0,1,this._t1,this._t2),r?(r=z.map(r,n,1,0,1),o.right.split(r).left):o}extrema(){const n={};let r=[];return this.dims.forEach((function(i){let o=function(s){return s[i]},a=this.dpoints[0].map(o);n[i]=z.droots(a),this.order===3&&(a=this.dpoints[1].map(o),n[i]=n[i].concat(z.droots(a))),n[i]=n[i].filter(function(s){return s>=0&&s<=1}),r=r.concat(n[i].sort(z.numberSort))}).bind(this)),n.values=r.sort(z.numberSort).filter(function(i,o){return r.indexOf(i)===o}),n}bbox(){const n=this.extrema(),r={};return this.dims.forEach((function(i){r[i]=z.getminmax(this,i,n[i])}).bind(this)),r}overlaps(n){const r=this.bbox(),i=n.bbox();return z.bboxoverlap(r,i)}offset(n,r){if(typeof r<"u"){const i=this.get(n),o=this.normal(n),a={c:i,n:o,x:i.x+o.x*r,y:i.y+o.y*r};return this._3d&&(a.z=i.z+o.z*r),a}if(this._linear){const i=this.normal(0),o=this.points.map(function(a){const s={x:a.x+n*i.x,y:a.y+n*i.y};return a.z&&i.z&&(s.z=a.z+n*i.z),s});return[new K(o)]}return this.reduce().map(function(i){return i._linear?i.offset(n)[0]:i.scale(n)})}simple(){if(this.order===3){const o=z.angle(this.points[0],this.points[3],this.points[1]),a=z.angle(this.points[0],this.points[3],this.points[2]);if(o>0&&a<0||o<0&&a>0)return!1}const n=this.normal(0),r=this.normal(1);let i=n.x*r.x+n.y*r.y;return this._3d&&(i+=n.z*r.z),ie(Bf(i))<Xf/3}reduce(){let n,r=0,i=0,o=.01,a,s=[],u=[],c=this.extrema().values;for(c.indexOf(0)===-1&&(c=[0].concat(c)),c.indexOf(1)===-1&&c.push(1),r=c[0],n=1;n<c.length;n++)i=c[n],a=this.split(r,i),a._t1=r,a._t2=i,s.push(a),r=i;return s.forEach(function(l){for(r=0,i=0;i<=1;)for(i=r+o;i<=1+o;i+=o)if(a=l.split(r,i),!a.simple()){if(i-=o,ie(r-i)<o)return[];a=l.split(r,i),a._t1=z.map(r,0,1,l._t1,l._t2),a._t2=z.map(i,0,1,l._t1,l._t2),u.push(a),r=i;break}r<1&&(a=l.split(r,1),a._t1=z.map(r,0,1,l._t1,l._t2),a._t2=l._t2,u.push(a))}),u}translate(n,r,i){i=typeof i=="number"?i:r;const o=this.order;let a=this.points.map((s,u)=>(1-u/o)*r+u/o*i);return new K(this.points.map((s,u)=>({x:s.x+n.x*a[u],y:s.y+n.y*a[u]})))}scale(n){const r=this.order;let i=!1;if(typeof n=="function"&&(i=n),i&&r===2)return this.raise().scale(i);const o=this.clockwise,a=this.points;if(this._linear)return this.translate(this.normal(0),i?i(0):n,i?i(1):n);const s=i?i(0):n,u=i?i(1):n,c=[this.offset(0,10),this.offset(1,10)],l=[],f=z.lli4(c[0],c[0].c,c[1],c[1].c);if(!f)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach(function(h){const d=l[h*r]=z.copy(a[h*r]);d.x+=(h?u:s)*c[h].n.x,d.y+=(h?u:s)*c[h].n.y}),i?([0,1].forEach(function(h){if(!(r===2&&h)){var d=a[h+1],p={x:d.x-f.x,y:d.y-f.y},y=i?i((h+1)/r):n;i&&!o&&(y=-y);var x=oe(p.x*p.x+p.y*p.y);p.x/=x,p.y/=x,l[h+1]={x:d.x+y*p.x,y:d.y+y*p.y}}}),new K(l)):([0,1].forEach(h=>{if(r===2&&h)return;const d=l[h*r],p=this.derivative(h),y={x:d.x+p.x,y:d.y+p.y};l[h+1]=z.lli4(d,y,f,a[h+1])}),new K(l))}outline(n,r,i,o){if(r=r===void 0?n:r,this._linear){const v=this.normal(0),A=this.points[0],M=this.points[this.points.length-1];let T,R,P;i===void 0&&(i=n,o=r),T={x:A.x+v.x*n,y:A.y+v.y*n},P={x:M.x+v.x*i,y:M.y+v.y*i},R={x:(T.x+P.x)/2,y:(T.y+P.y)/2};const N=[T,R,P];T={x:A.x-v.x*r,y:A.y-v.y*r},P={x:M.x-v.x*o,y:M.y-v.y*o},R={x:(T.x+P.x)/2,y:(T.y+P.y)/2};const D=[P,R,T],U=z.makeline(D[2],N[0]),S=z.makeline(N[2],D[0]),j=[U,new K(N),S,new K(D)];return new he(j)}const a=this.reduce(),s=a.length,u=[];let c=[],l,f=0,h=this.length();const d=typeof i<"u"&&typeof o<"u";function p(v,A,M,T,R){return function(P){const N=T/M,D=(T+R)/M,U=A-v;return z.map(P,0,1,v+N*U,v+D*U)}}a.forEach(function(v){const A=v.length();d?(u.push(v.scale(p(n,i,h,f,A))),c.push(v.scale(p(-r,-o,h,f,A)))):(u.push(v.scale(n)),c.push(v.scale(-r))),f+=A}),c=c.map(function(v){return l=v.points,l[3]?v.points=[l[3],l[2],l[1],l[0]]:v.points=[l[2],l[1],l[0]],v}).reverse();const y=u[0].points[0],x=u[s-1].points[u[s-1].points.length-1],m=c[s-1].points[c[s-1].points.length-1],g=c[0].points[0],k=z.makeline(m,y),w=z.makeline(x,g),_=[k].concat(u).concat([w]).concat(c);return new he(_)}outlineshapes(n,r,i){r=r||n;const o=this.outline(n,r).curves,a=[];for(let s=1,u=o.length;s<u/2;s++){const c=z.makeshape(o[s],o[u-s],i);c.startcap.virtual=s>1,c.endcap.virtual=s<u/2-1,a.push(c)}return a}intersects(n,r){return n?n.p1&&n.p2?this.lineIntersects(n):(n instanceof K&&(n=n.reduce()),this.curveintersects(this.reduce(),n,r)):this.selfintersects(r)}lineIntersects(n){const r=Dr(n.p1.x,n.p2.x),i=Dr(n.p1.y,n.p2.y),o=Ir(n.p1.x,n.p2.x),a=Ir(n.p1.y,n.p2.y);return z.roots(this.points,n).filter(s=>{var u=this.get(s);return z.between(u.x,r,o)&&z.between(u.y,i,a)})}selfintersects(n){const r=this.reduce(),i=r.length-2,o=[];for(let a=0,s,u,c;a<i;a++)u=r.slice(a,a+1),c=r.slice(a+2),s=this.curveintersects(u,c,n),o.push(...s);return o}curveintersects(n,r,i){const o=[];n.forEach(function(s){r.forEach(function(u){s.overlaps(u)&&o.push({left:s,right:u})})});let a=[];return o.forEach(function(s){const u=z.pairiteration(s.left,s.right,i);u.length>0&&(a=a.concat(u))}),a}arcs(n){return n=n||.5,this._iterate(n,[])}_error(n,r,i,o){const a=(o-i)/4,s=this.get(i+a),u=this.get(o-a),c=z.dist(n,r),l=z.dist(n,s),f=z.dist(n,u);return ie(l-c)+ie(f-c)}_iterate(n,r){let i=0,o=1,a;do{a=0,o=1;let s=this.get(i),u,c,l,f,h=!1,d=!1,p,y=o,x=1;do if(d=h,f=l,y=(i+o)/2,u=this.get(y),c=this.get(o),l=z.getccenter(s,u,c),l.interval={start:i,end:o},h=this._error(l,s,i,o)<=n,p=d&&!h,p||(x=o),h){if(o>=1){if(l.interval.end=x=1,f=l,o>1){let g={x:l.x+l.r*Gf(l.e),y:l.y+l.r*Vf(l.e)};l.e+=z.angle({x:l.x,y:l.y},g,this.get(1))}break}o=o+(o-i)/2}else o=y;while(!p&&a++<100);if(a>=100)break;f=f||l,r.push(f),i=x}while(o<1);return r}}function An(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 Yf(e){if(Array.isArray(e))return e}function Zf(e){if(Array.isArray(e))return An(e)}function Kf(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qf(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],c=!0,l=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(c=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);c=!0);}catch(f){l=!0,o=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return u}}function Jf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function th(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eh(e,n){if(e==null)return{};var r,i,o=nh(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],n.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function nh(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 rh(e,n){return Yf(e)||Qf(e,n)||Vi(e,n)||Jf()}function ih(e){return Zf(e)||Kf(e)||Vi(e)||th()}function oh(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 new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ah(e){var n=oh(e,"string");return typeof n=="symbol"?n:n+""}function Vi(e,n){if(e){if(typeof e=="string")return An(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)?An(e,n):void 0}}var sh=(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]:!1,o=(n instanceof Array?n.length?n:[void 0]:[n]).map(function(u){return{keyAccessor:u,isProp:!(u instanceof Function)}}),a=e.reduce(function(u,c){var l=u,f=c;return o.forEach(function(h,d){var p=h.keyAccessor,y=h.isProp,x;if(y){var m=f,g=m[p],k=eh(m,[p].map(ah));x=g,f=k}else x=p(f,d);d+1<o.length?(l.hasOwnProperty(x)||(l[x]={}),l=l[x]):r?(l.hasOwnProperty(x)||(l[x]=[]),l[x].push(f)):l[x]=f}),u},{});r instanceof Function&&(function u(c){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;l===o.length?Object.keys(c).forEach(function(f){return c[f]=r(c[f])}):Object.values(c).forEach(function(f){return u(f,l+1)})})(a);var s=a;return i&&(s=[],(function u(c){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];l.length===o.length?s.push({keys:l,vals:c}):Object.entries(c).forEach(function(f){var h=rh(f,2),d=h[0],p=h[1];return u(p,[].concat(ih(l),[d]))})})(a),n instanceof Array&&n.length===0&&s.length===1&&(s[0].keys=[])),s});function uh(e){for(var n=e.length/6|0,r=new Array(n),i=0;i<n;)r[i]="#"+e.slice(i*6,++i*6);return r}const lh=uh("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");function ch(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var fh=`.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;
|
|
}
|
|
`;ch(fh);function Sn(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 hh(e){if(Array.isArray(e))return e}function dh(e){if(Array.isArray(e))return Sn(e)}function $r(e,n,r){if(Bi())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,n);var o=new(e.bind.apply(e,i));return o}function ye(e,n,r){return(n=mh(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Bi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Bi=function(){return!!e})()}function ph(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gh(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],c=!0,l=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(c=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);c=!0);}catch(f){l=!0,o=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return u}}function yh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _h(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lr(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function Gt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Lr(Object(r),!0).forEach(function(i){ye(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function de(e,n){return hh(e)||gh(e,n)||Xi(e,n)||yh()}function gt(e){return dh(e)||ph(e)||Xi(e)||_h()}function vh(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 new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function mh(e){var n=vh(e,"string");return typeof n=="symbol"?n:n+""}function Mn(e){"@babel/helpers - typeof";return Mn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Mn(e)}function Xi(e,n){if(e){if(typeof e=="string")return Sn(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)?Sn(e,n):void 0}}var xh=fo(lh);function Fr(e,n,r){!n||typeof r!="string"||e.filter(function(i){return!i[r]}).forEach(function(i){i[r]=xh(n(i))})}function bh(e,n){var r=e.nodes,i=e.links,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=o.nodeFilter,s=a===void 0?function(){return!0}:a,u=o.onLoopError,c=u===void 0?function(p){throw"Invalid DAG structure! Found cycle in node path: ".concat(p.join(" -> "),".")}:u,l={};r.forEach(function(p){return l[n(p)]={data:p,out:[],depth:-1,skip:!s(p)}}),i.forEach(function(p){var y=p.source,x=p.target,m=_(y),g=_(x);if(!l.hasOwnProperty(m))throw"Missing source node with id: ".concat(m);if(!l.hasOwnProperty(g))throw"Missing target node with id: ".concat(g);var k=l[m],w=l[g];k.out.push(w);function _(v){return Mn(v)==="object"?n(v):v}});var f=[];d(Object.values(l));var h=Object.assign.apply(Object,[{}].concat(gt(Object.entries(l).filter(function(p){var y=de(p,2),x=y[1];return!x.skip}).map(function(p){var y=de(p,2),x=y[0],m=y[1];return ye({},x,m.depth)}))));return h;function d(p){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,m=function(){var _=p[g];if(y.indexOf(_)!==-1){var v=[].concat(gt(y.slice(y.indexOf(_))),[_]).map(function(A){return n(A.data)});return f.some(function(A){return A.length===v.length&&A.every(function(M,T){return M===v[T]})})||(f.push(v),c(v)),1}x>_.depth&&(_.depth=x,d(_.out,[].concat(gt(y),[_]),x+(_.skip?0:1)))},g=0,k=p.length;g<k;g++)m()}}var wh=2,it=function(n,r){return r.onNeedsRedraw&&r.onNeedsRedraw()},Ur=function(n,r){if(!r.isShadow){var i=B(r.linkDirectionalParticles);r.graphData.links.forEach(function(o){var a=Math.round(Math.abs(i(o)));a?o.__photons=gt(Array(a)).map(function(){return{}}):delete o.__photons})}},qe=jn({props:{graphData:{default:{nodes:[],links:[]},onChange:function(n,r){r.engineRunning=!1,Ur(n,r)}},dagMode:{onChange:function(n,r){!n&&(r.graphData.nodes||[]).forEach(function(i){return i.fx=i.fy=void 0})}},dagLevelDistance:{},dagNodeFilter:{default:function(n){return!0}},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4,triggerUpdate:!1,onChange:it},nodeId:{default:"id"},nodeVal:{default:"val",triggerUpdate:!1,onChange:it},nodeColor:{default:"color",triggerUpdate:!1,onChange:it},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:it},nodeCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:it},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:it},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0,triggerUpdate:!1,onChange:it},linkColor:{default:"color",triggerUpdate:!1,onChange:it},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:it},linkWidth:{default:1,triggerUpdate:!1,onChange:it},linkCurvature:{default:0,triggerUpdate:!1,onChange:it},linkCanvasObject:{triggerUpdate:!1,onChange:it},linkCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:it},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:it},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:it},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:it},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:Ur},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(n,r){r.forceLayout.alphaDecay(n)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaTarget(n)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.velocityDecay(n)}},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(n,r,i){return i===void 0?n.forceLayout.force(r):(n.forceLayout.force(r,i),this)},d3ReheatSimulation:function(n){return n.forceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(n){return n.cntTicks=0,n.startTickTime=new Date,n.engineRunning=!0,this},isEngineRunning:function(n){return!!n.engineRunning},tickFrame:function(n){return!n.isShadow&&r(),o(),!n.isShadow&&a(),!n.isShadow&&s(),i(),this;function r(){n.engineRunning&&(++n.cntTicks>n.cooldownTicks||new Date-n.startTickTime>n.cooldownTime||n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin?(n.engineRunning=!1,n.onEngineStop()):(n.forceLayout.tick(),n.onEngineTick()))}function i(){var u=B(n.nodeVisibility),c=B(n.nodeVal),l=B(n.nodeColor),f=B(n.nodeCanvasObjectMode),h=n.ctx,d=n.isShadow/n.globalScale,p=n.graphData.nodes.filter(u);h.save(),p.forEach(function(y){var x=f(y);if(n.nodeCanvasObject&&(x==="before"||x==="replace")&&(n.nodeCanvasObject(y,h,n.globalScale),x==="replace")){h.restore();return}var m=Math.sqrt(Math.max(0,c(y)||1))*n.nodeRelSize+d;h.beginPath(),h.arc(y.x,y.y,m,0,2*Math.PI,!1),h.fillStyle=l(y)||"rgba(31, 120, 180, 0.92)",h.fill(),n.nodeCanvasObject&&x==="after"&&n.nodeCanvasObject(y,n.ctx,n.globalScale)}),h.restore()}function o(){var u=B(n.linkVisibility),c=B(n.linkColor),l=B(n.linkWidth),f=B(n.linkLineDash),h=B(n.linkCurvature),d=B(n.linkCanvasObjectMode),p=n.ctx,y=n.isShadow*2,x=n.graphData.links.filter(u);x.forEach(A);var m=[],g=[],k=x;if(n.linkCanvasObject){var w=[],_=[];x.forEach(function(M){return({before:m,after:g,replace:w}[d(M)]||_).push(M)}),k=[].concat(gt(m),g,_),m=m.concat(w)}p.save(),m.forEach(function(M){return n.linkCanvasObject(M,p,n.globalScale)}),p.restore();var v=sh(k,[c,l,f]);p.save(),Object.entries(v).forEach(function(M){var T=de(M,2),R=T[0],P=T[1],N=!R||R==="undefined"?"rgba(0,0,0,0.15)":R;Object.entries(P).forEach(function(D){var U=de(D,2),S=U[0],j=U[1],E=(S||1)/n.globalScale+y;Object.entries(j).forEach(function(C){var O=de(C,2);O[0];var I=O[1],L=f(I[0]);p.beginPath(),I.forEach(function(H){var F=H.source,G=H.target;if(!(!F||!G||!F.hasOwnProperty("x")||!G.hasOwnProperty("x"))){p.moveTo(F.x,F.y);var V=H.__controlPoints;V?p[V.length===2?"quadraticCurveTo":"bezierCurveTo"].apply(p,gt(V).concat([G.x,G.y])):p.lineTo(G.x,G.y)}}),p.strokeStyle=N,p.lineWidth=E,p.setLineDash(L||[]),p.stroke()})})}),p.restore(),p.save(),g.forEach(function(M){return n.linkCanvasObject(M,p,n.globalScale)}),p.restore();function A(M){var T=h(M);if(!T){M.__controlPoints=null;return}var R=M.source,P=M.target;if(!(!R||!P||!R.hasOwnProperty("x")||!P.hasOwnProperty("x"))){var N=Math.sqrt(Math.pow(P.x-R.x,2)+Math.pow(P.y-R.y,2));if(N>0){var D=Math.atan2(P.y-R.y,P.x-R.x),U=N*T,S={x:(R.x+P.x)/2+U*Math.cos(D-Math.PI/2),y:(R.y+P.y)/2+U*Math.sin(D-Math.PI/2)};M.__controlPoints=[S.x,S.y]}else{var j=T*70;M.__controlPoints=[P.x,P.y-j,P.x+j,P.y]}}}}function a(){var u=1.6,c=.2,l=B(n.linkDirectionalArrowLength),f=B(n.linkDirectionalArrowRelPos),h=B(n.linkVisibility),d=B(n.linkDirectionalArrowColor||n.linkColor),p=B(n.nodeVal),y=n.ctx;y.save(),n.graphData.links.filter(h).forEach(function(x){var m=l(x);if(!(!m||m<0)){var g=x.source,k=x.target;if(!(!g||!k||!g.hasOwnProperty("x")||!k.hasOwnProperty("x"))){var w=Math.sqrt(Math.max(0,p(g)||1))*n.nodeRelSize,_=Math.sqrt(Math.max(0,p(k)||1))*n.nodeRelSize,v=Math.min(1,Math.max(0,f(x))),A=d(x)||"rgba(0,0,0,0.28)",M=m/u/2,T=x.__controlPoints&&$r(K,[g.x,g.y].concat(gt(x.__controlPoints),[k.x,k.y])),R=T?function(E){return T.get(E)}:function(E){return{x:g.x+(k.x-g.x)*E||0,y:g.y+(k.y-g.y)*E||0}},P=T?T.length():Math.sqrt(Math.pow(k.x-g.x,2)+Math.pow(k.y-g.y,2)),N=w+m+(P-w-_-m)*v,D=R(N/P),U=R((N-m)/P),S=R((N-m*(1-c))/P),j=Math.atan2(D.y-U.y,D.x-U.x)-Math.PI/2;y.beginPath(),y.moveTo(D.x,D.y),y.lineTo(U.x+M*Math.cos(j),U.y+M*Math.sin(j)),y.lineTo(S.x,S.y),y.lineTo(U.x-M*Math.cos(j),U.y-M*Math.sin(j)),y.fillStyle=A,y.fill()}}}),y.restore()}function s(){var u=B(n.linkDirectionalParticles),c=B(n.linkDirectionalParticleSpeed),l=B(n.linkDirectionalParticleOffset),f=B(n.linkDirectionalParticleWidth),h=B(n.linkVisibility),d=B(n.linkDirectionalParticleColor||n.linkColor),p=n.ctx;p.save(),n.graphData.links.filter(h).forEach(function(y){var x=u(y);if(!(!y.hasOwnProperty("__photons")||!y.__photons.length)){var m=y.source,g=y.target;if(!(!m||!g||!m.hasOwnProperty("x")||!g.hasOwnProperty("x"))){var k=c(y),w=Math.abs(l(y)),_=y.__photons||[],v=Math.max(0,f(y)/2)/Math.sqrt(n.globalScale),A=d(y)||"rgba(0,0,0,0.28)";p.fillStyle=A;var M=y.__controlPoints?$r(K,[m.x,m.y].concat(gt(y.__controlPoints),[g.x,g.y])):null,T=0,R=!1;_.forEach(function(P){var N=!!P.__singleHop;if(P.hasOwnProperty("__progressRatio")||(P.__progressRatio=N?k<0?1:0:(T+w)/x),!N&&T++,P.__progressRatio+=k,P.__progressRatio>=1||P.__progressRatio<0)if(!N)P.__progressRatio=P.__progressRatio%1,P.__progressRatio<0&&P.__progressRatio++;else{R=!0;return}var D=P.__progressRatio,U=M?M.get(D):{x:m.x+(g.x-m.x)*D||0,y:m.y+(g.y-m.y)*D||0};n.linkDirectionalParticleCanvasObject?n.linkDirectionalParticleCanvasObject(U.x,U.y,y,p,n.globalScale):(p.beginPath(),p.arc(U.x,U.y,v,0,2*Math.PI,!1),p.fill())}),R&&(y.__photons=y.__photons.filter(function(P){return!P.__singleHop||P.__progressRatio<=1&&P.__progressRatio>=0}))}}}),p.restore()}},emitParticle:function(n,r){return r&&(!r.__photons&&(r.__photons=[]),r.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:Lf().force("link",Ef()).force("charge",Ff()).force("center",zc()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(n,r){r.ctx=n},update:function(n,r){n.engineRunning=!1,n.onUpdate(),n.nodeAutoColorBy!==null&&Fr(n.graphData.nodes,B(n.nodeAutoColorBy),n.nodeColor),n.linkAutoColorBy!==null&&Fr(n.graphData.links,B(n.linkAutoColorBy),n.linkColor),n.graphData.links.forEach(function(d){d.source=d[n.linkSource],d.target=d[n.linkTarget]}),n.forceLayout.stop().alpha(1).nodes(n.graphData.nodes);var i=n.forceLayout.force("link");i&&i.id(function(d){return d[n.nodeId]}).links(n.graphData.links);var o=n.dagMode&&bh(n.graphData,function(d){return d[n.nodeId]},{nodeFilter:n.dagNodeFilter,onLoopError:n.onDagError||void 0}),a=Math.max.apply(Math,gt(Object.values(o||[]))),s=n.dagLevelDistance||n.graphData.nodes.length/(a||1)*wh*(["radialin","radialout"].indexOf(n.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(r.dagMode)){var u=["lr","rl"].includes(r.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return delete d[u]})}if(["lr","rl","td","bu"].includes(n.dagMode)){var c=["rl","bu"].includes(n.dagMode),l=function(p){return(o[p[n.nodeId]]-a/2)*s*(c?-1:1)},f=["lr","rl"].includes(n.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return d[f]=l(d)})}n.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(n.dagMode)!==-1?Uf(function(d){var p=o[d[n.nodeId]]||-1;return(n.dagMode==="radialin"?a-p:p)*s}).strength(function(d){return n.dagNodeFilter(d)?1:0}):null);for(var h=0;h<n.warmupTicks&&!(n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin);h++)n.forceLayout.tick();this.resetCountdown(),n.onFinishUpdate()}});function Yi(e,n){var r=e instanceof Array?e:[e],i=new n;return i._destructor&&i._destructor(),{linkProp:function(a){return{default:i[a](),onChange:function(u,c){r.forEach(function(l){return c[l][a](u)})},triggerUpdate:!1}},linkMethod:function(a){return function(s){for(var u=arguments.length,c=new Array(u>1?u-1:0),l=1;l<u;l++)c[l-1]=arguments[l];var f=[];return r.forEach(function(h){var d=s[h],p=d[a].apply(d,c);p!==d&&f.push(p)}),f.length?f[0]:this}}}}var kh=800,Ch=4,Ah=5,Zi=Yi("forceGraph",qe),Sh=Yi(["forceGraph","shadowGraph"],qe),Mh=Object.assign.apply(Object,gt(["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"].map(function(e){return ye({},e,Zi.linkProp(e))})).concat(gt(["nodeRelSize","nodeId","nodeVal","nodeVisibility","linkSource","linkTarget","linkVisibility","linkCurvature"].map(function(e){return ye({},e,Sh.linkProp(e))})))),Th=Object.assign.apply(Object,gt(["d3Force","d3ReheatSimulation","emitParticle"].map(function(e){return ye({},e,Zi.linkMethod(e))})));function an(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="".concat(e.width,"px"),a.style.height="".concat(e.height,"px"),a.width=e.width*i,a.height=e.height*i,!n&&!r&&a.getContext("2d").scale(i,i)});var o=mt(e.canvas).k;e.zoom.translateBy(e.zoom.__baseElem,(e.width-n)/2/o,(e.height-r)/2/o),e.needsRedraw=!0}}function Ki(e){var n=window.devicePixelRatio;e.setTransform(n,0,0,n,0,0)}function Hr(e,n,r){e.save(),Ki(e),e.clearRect(0,0,n,r),e.restore()}var Ph=jn({props:Gt({width:{default:window.innerWidth,onChange:function(n,r){return an(r)},triggerUpdate:!1},height:{default:window.innerHeight,onChange:function(n,r){return an(r)},triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:function(n,r){[n.nodes,n.links].every(function(o){return(o||[]).every(function(a){return!a.hasOwnProperty("__indexColor")})})&&r.colorTracker.reset(),[{type:"Node",objs:n.nodes},{type:"Link",objs:n.links}].forEach(i),r.forceGraph.graphData(n),r.shadowGraph.graphData(n);function i(o){var a=o.type,s=o.objs;s.filter(function(u){if(!u.hasOwnProperty("__indexColor"))return!0;var c=r.colorTracker.lookup(u.__indexColor);return!c||!c.hasOwnProperty("d")||c.d!==u}).forEach(function(u){u.__indexColor=r.colorTracker.register({type:a,d:u})})}},triggerUpdate:!1},backgroundColor:{onChange:function(n,r){r.canvas&&n&&(r.canvas.style.background=n)},triggerUpdate:!1},nodeLabel:{default:"name",triggerUpdate:!1},nodePointerAreaPaint:{onChange:function(n,r){r.shadowGraph.nodeCanvasObject(n?function(i,o,a){return n(i,i.__indexColor,o,a)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkPointerAreaPaint:{onChange:function(n,r){r.shadowGraph.linkCanvasObject(n?function(i,o,a){return n(i,i.__indexColor,o,a)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkLabel:{default:"name",triggerUpdate:!1},linkHoverPrecision:{default:4,triggerUpdate:!1},minZoom:{default:.01,onChange:function(n,r){r.zoom.scaleExtent([n,r.zoom.scaleExtent()[1]])},triggerUpdate:!1},maxZoom:{default:1e3,onChange:function(n,r){r.zoom.scaleExtent([r.zoom.scaleExtent()[0],n])},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(n,r){r.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}},Mh),aliases:{stopAnimation:"pauseAnimation"},methods:Gt({graph2ScreenCoords:function(n,r,i){var o=mt(n.canvas);return{x:r*o.k+o.x,y:i*o.k+o.y}},screen2GraphCoords:function(n,r,i){var o=mt(n.canvas);return{x:(r-o.x)/o.k,y:(i-o.y)/o.k}},centerAt:function(n,r,i,o){if(!n.canvas)return null;if(r!==void 0||i!==void 0){var a=Object.assign({},r!==void 0?{x:r}:{},i!==void 0?{y:i}:{});return o?n.tweenGroup.add(new hr(s()).to(a,o).easing(Ut.Quadratic.Out).onUpdate(u).onComplete(function(){n.tweenGroup.remove(this)}).start()):u(a),this}return s();function s(){var c=mt(n.canvas);return{x:(n.width/2-c.x)/c.k,y:(n.height/2-c.y)/c.k}}function u(c){var l=c.x,f=c.y;n.zoom.translateTo(n.zoom.__baseElem,l===void 0?s().x:l,f===void 0?s().y:f),n.needsRedraw=!0}},zoom:function(n,r,i){if(!n.canvas)return null;if(r!==void 0)return i?n.tweenGroup.add(new hr({k:o()}).to({k:r},i).easing(Ut.Quadratic.Out).onUpdate(function(s){var u=s.k;return a(u)}).onComplete(function(){n.tweenGroup.remove(this)}).start()):a(r),this;return o();function o(){return mt(n.canvas).k}function a(s){n.zoom.scaleTo(n.zoom.__baseElem,s),n.needsRedraw=!0}},zoomToFit:function(n){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,o=arguments.length,a=new Array(o>3?o-3:0),s=3;s<o;s++)a[s-3]=arguments[s];var u=this.getGraphBbox.apply(this,a);if(u){var c={x:(u.x[0]+u.x[1])/2,y:(u.y[0]+u.y[1])/2},l=Math.max(1e-12,Math.min(1e12,(n.width-i*2)/(u.x[1]-u.x[0]),(n.height-i*2)/(u.y[1]-u.y[0])));this.centerAt(c.x,c.y,r),this.zoom(l,r)}return this},getGraphBbox:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},i=B(n.nodeVal),o=function(u){return Math.sqrt(Math.max(0,i(u)||1))*n.nodeRelSize},a=n.graphData.nodes.filter(r).map(function(s){return{x:s.x,y:s.y,r:o(s)}});return a.length?{x:[Zn(a,function(s){return s.x-s.r}),Kn(a,function(s){return s.x+s.r})],y:[Zn(a,function(s){return s.y-s.r}),Kn(a,function(s){return s.y+s.r})]}:null},pauseAnimation:function(n){return n.animationFrameRequestId&&(cancelAnimationFrame(n.animationFrameRequestId),n.animationFrameRequestId=null),this},resumeAnimation:function(n){return n.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},Th),stateInit:function(){return{lastSetZoom:1,zoom:qu(),forceGraph:new qe,shadowGraph:new qe().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new lc,tweenGroup:new bi}},init:function(n,r){var i=this;n.innerHTML="";var o=document.createElement("div");o.classList.add("force-graph-container"),o.style.position="relative",n.appendChild(o),r.canvas=document.createElement("canvas"),r.backgroundColor&&(r.canvas.style.background=r.backgroundColor),o.appendChild(r.canvas),r.shadowCanvas=document.createElement("canvas");var a=r.canvas.getContext("2d"),s=r.shadowCanvas.getContext("2d",{willReadFrequently:!0}),u={x:-1e12,y:-1e12},c=function(){var h=null,d=window.devicePixelRatio,p=u.x>0&&u.y>0?s.getImageData(u.x*d,u.y*d,1,1):null;return p&&(h=r.colorTracker.lookup(p.data)),h};pt(r.canvas).call(As().subject(function(){if(!r.enableNodeDrag)return null;var f=c();return f&&f.type==="Node"?f.d:null}).on("start",function(f){var h=f.subject;h.__initialDragPos={x:h.x,y:h.y,fx:h.fx,fy:h.fy},f.active||(h.fx=h.x,h.fy=h.y),r.canvas.classList.add("grabbable")}).on("drag",function(f){var h=f.subject,d=h.__initialDragPos,p=f,y=mt(r.canvas).k,x={x:d.x+(p.x-d.x)/y-h.x,y:d.y+(p.y-d.y)/y-h.y};["x","y"].forEach(function(m){return h["f".concat(m)]=h[m]=d[m]+(p[m]-d[m])/y}),!(!h.__dragged&&Ah>=Math.sqrt(_o(["x","y"].map(function(m){return Math.pow(f[m]-d[m],2)}))))&&(r.forceGraph.d3AlphaTarget(.3).resetCountdown(),r.isPointerDragging=!0,h.__dragged=!0,r.onNodeDrag(h,x))}).on("end",function(f){var h=f.subject,d=h.__initialDragPos,p={x:h.x-d.x,y:h.y-d.y};d.fx===void 0&&(h.fx=void 0),d.fy===void 0&&(h.fy=void 0),delete h.__initialDragPos,r.forceGraph.d3AlphaTarget()&&r.forceGraph.d3AlphaTarget(0).resetCountdown(),r.canvas.classList.remove("grabbable"),r.isPointerDragging=!1,h.__dragged&&(delete h.__dragged,r.onNodeDragEnd(h,p))})),r.zoom(r.zoom.__baseElem=pt(r.canvas)),r.zoom.__baseElem.on("dblclick.zoom",null),r.zoom.filter(function(f){return!f.button&&r.enableZoomPanInteraction&&(f.type!=="wheel"||B(r.enableZoomInteraction)(f))&&(f.type==="wheel"||B(r.enablePanInteraction)(f))}).on("zoom",function(f){var h=f.transform;[a,s].forEach(function(d){Ki(d),d.translate(h.x,h.y),d.scale(h.k,h.k)}),r.isPointerDragging=!0,r.onZoom&&r.onZoom(Gt(Gt({},h),i.centerAt())),r.needsRedraw=!0}).on("end",function(f){r.isPointerDragging=!1,r.onZoomEnd&&r.onZoomEnd(Gt(Gt({},f.transform),i.centerAt()))}),an(r),r.forceGraph.onNeedsRedraw(function(){return r.needsRedraw=!0}).onFinishUpdate(function(){mt(r.canvas).k===r.lastSetZoom&&r.graphData.nodes.length&&(r.zoom.scaleTo(r.zoom.__baseElem,r.lastSetZoom=Ch/Math.cbrt(r.graphData.nodes.length)),r.needsRedraw=!0)}),r.tooltip=new Ec(o),["pointermove","pointerdown"].forEach(function(f){return o.addEventListener(f,function(h){f==="pointerdown"&&(r.isPointerPressed=!0,r.pointerDownEvent=h),!r.isPointerDragging&&h.type==="pointermove"&&r.onBackgroundClick&&(h.pressure>0||r.isPointerPressed)&&(h.pointerType==="mouse"||h.movementX===void 0||[h.movementX,h.movementY].some(function(y){return Math.abs(y)>1}))&&(r.isPointerDragging=!0);var d=p(o);u.x=h.pageX-d.left,u.y=h.pageY-d.top;function p(y){var x=y.getBoundingClientRect(),m=window.pageXOffset||document.documentElement.scrollLeft,g=window.pageYOffset||document.documentElement.scrollTop;return{top:x.top+g,left:x.left+m}}},{passive:!0})}),o.addEventListener("pointerup",function(f){if(r.isPointerPressed){if(r.isPointerPressed=!1,r.isPointerDragging){r.isPointerDragging=!1;return}var h=[f,r.pointerDownEvent];requestAnimationFrame(function(){if(f.button===0)if(r.hoverObj){var d=r["on".concat(r.hoverObj.type,"Click")];d&&d.apply(void 0,[r.hoverObj.d].concat(h))}else r.onBackgroundClick&&r.onBackgroundClick.apply(r,h);if(f.button===2)if(r.hoverObj){var p=r["on".concat(r.hoverObj.type,"RightClick")];p&&p.apply(void 0,[r.hoverObj.d].concat(h))}else r.onBackgroundRightClick&&r.onBackgroundRightClick.apply(r,h)})}},{passive:!0}),o.addEventListener("contextmenu",function(f){return!r.onBackgroundRightClick&&!r.onNodeRightClick&&!r.onLinkRightClick?!0:(f.preventDefault(),!1)}),r.forceGraph(a),r.shadowGraph(s);var l=yl(function(){Hr(s,r.width,r.height),r.shadowGraph.linkWidth(function(h){return B(r.linkWidth)(h)+r.linkHoverPrecision});var f=mt(r.canvas);r.shadowGraph.globalScale(f.k).tickFrame()},kh);r.flushShadowCanvas=l.flush,(this._animationCycle=function f(){var h=!r.autoPauseRedraw||!!r.needsRedraw||r.forceGraph.isEngineRunning()||r.graphData.links.some(function(w){return w.__photons&&w.__photons.length});if(r.needsRedraw=!1,r.enablePointerInteraction){var d=r.isPointerDragging?null:c();if(d!==r.hoverObj){var p=r.hoverObj,y=p?p.type:null,x=d?d.type:null;if(y&&y!==x){var m=r["on".concat(y,"Hover")];m&&m(null,p.d)}if(x){var g=r["on".concat(x,"Hover")];g&&g(d.d,y===x?p.d:null)}r.tooltip.content(d&&B(r["".concat(d.type.toLowerCase(),"Label")])(d.d)||null),r.canvas.classList[(d&&r["on".concat(x,"Click")]||!d&&r.onBackgroundClick)&&B(r.showPointerCursor)(d==null?void 0:d.d)?"add":"remove"]("clickable"),r.hoverObj=d}h&&l()}if(h){Hr(a,r.width,r.height);var k=mt(r.canvas).k;r.onRenderFramePre&&r.onRenderFramePre(a,k),r.forceGraph.globalScale(k).tickFrame(),r.onRenderFramePost&&r.onRenderFramePost(a,k)}r.tweenGroup.update(),r.animationFrameRequestId=requestAnimationFrame(f)})()},update:function(n){}}),sn={exports:{}},un,qr;function Oh(){if(qr)return un;qr=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return un=e,un}var ln,Wr;function Eh(){if(Wr)return ln;Wr=1;var e=Oh();function n(){}function r(){}return r.resetWarningCache=n,ln=function(){function i(s,u,c,l,f,h){if(h!==e){var d=new 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 d.name="Invariant Violation",d}}i.isRequired=i;function o(){return i}var a={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:n};return a.PropTypes=a,a},ln}var Gr;function zh(){return Gr||(Gr=1,sn.exports=Eh()()),sn.exports}var Nh=zh();const b=io(Nh),Ze={width:b.number,height:b.number,graphData:b.shape({nodes:b.arrayOf(b.object).isRequired,links:b.arrayOf(b.object).isRequired}),backgroundColor:b.string,nodeRelSize:b.number,nodeId:b.string,nodeLabel:b.oneOfType([b.string,b.func]),nodeVal:b.oneOfType([b.number,b.string,b.func]),nodeVisibility:b.oneOfType([b.bool,b.string,b.func]),nodeColor:b.oneOfType([b.string,b.func]),nodeAutoColorBy:b.oneOfType([b.string,b.func]),onNodeHover:b.func,onNodeClick:b.func,linkSource:b.string,linkTarget:b.string,linkLabel:b.oneOfType([b.string,b.func]),linkVisibility:b.oneOfType([b.bool,b.string,b.func]),linkColor:b.oneOfType([b.string,b.func]),linkAutoColorBy:b.oneOfType([b.string,b.func]),linkWidth:b.oneOfType([b.number,b.string,b.func]),linkCurvature:b.oneOfType([b.number,b.string,b.func]),linkDirectionalArrowLength:b.oneOfType([b.number,b.string,b.func]),linkDirectionalArrowColor:b.oneOfType([b.string,b.func]),linkDirectionalArrowRelPos:b.oneOfType([b.number,b.string,b.func]),linkDirectionalParticles:b.oneOfType([b.number,b.string,b.func]),linkDirectionalParticleSpeed:b.oneOfType([b.number,b.string,b.func]),linkDirectionalParticleOffset:b.oneOfType([b.number,b.string,b.func]),linkDirectionalParticleWidth:b.oneOfType([b.number,b.string,b.func]),linkDirectionalParticleColor:b.oneOfType([b.string,b.func]),onLinkHover:b.func,onLinkClick:b.func,dagMode:b.oneOf(["td","bu","lr","rl","zin","zout","radialin","radialout"]),dagLevelDistance:b.number,dagNodeFilter:b.func,onDagError:b.func,d3AlphaMin:b.number,d3AlphaDecay:b.number,d3VelocityDecay:b.number,warmupTicks:b.number,cooldownTicks:b.number,cooldownTime:b.number,onEngineTick:b.func,onEngineStop:b.func,getGraphBbox:b.func},Qi={zoomToFit:b.func,onNodeRightClick:b.func,onNodeDrag:b.func,onNodeDragEnd:b.func,onLinkRightClick:b.func,linkHoverPrecision:b.number,onBackgroundClick:b.func,onBackgroundRightClick:b.func,showPointerCursor:b.oneOfType([b.bool,b.func]),enablePointerInteraction:b.bool,enableNodeDrag:b.bool},Wn={showNavInfo:b.bool,nodeOpacity:b.number,nodeResolution:b.number,nodeThreeObject:b.oneOfType([b.object,b.string,b.func]),nodeThreeObjectExtend:b.oneOfType([b.bool,b.string,b.func]),nodePositionUpdate:b.func,linkOpacity:b.number,linkResolution:b.number,linkCurveRotation:b.oneOfType([b.number,b.string,b.func]),linkMaterial:b.oneOfType([b.object,b.string,b.func]),linkThreeObject:b.oneOfType([b.object,b.string,b.func]),linkThreeObjectExtend:b.oneOfType([b.bool,b.string,b.func]),linkPositionUpdate:b.func,linkDirectionalArrowResolution:b.number,linkDirectionalParticleResolution:b.number,linkDirectionalParticleThreeObject:b.oneOfType([b.object,b.string,b.func]),forceEngine:b.oneOf(["d3","ngraph"]),ngraphPhysics:b.object,numDimensions:b.oneOf([1,2,3])},Rh=Object.assign({},Ze,Qi,{linkLineDash:b.oneOfType([b.arrayOf(b.number),b.string,b.func]),nodeCanvasObjectMode:b.oneOfType([b.string,b.func]),nodeCanvasObject:b.func,nodePointerAreaPaint:b.func,linkCanvasObjectMode:b.oneOfType([b.string,b.func]),linkCanvasObject:b.func,linkPointerAreaPaint:b.func,linkDirectionalParticleCanvasObject:b.func,autoPauseRedraw:b.bool,minZoom:b.number,maxZoom:b.number,enableZoomInteraction:b.oneOfType([b.bool,b.func]),enablePanInteraction:b.oneOfType([b.bool,b.func]),onZoom:b.func,onZoomEnd:b.func,onRenderFramePre:b.func,onRenderFramePost:b.func});Object.assign({},Ze,Qi,Wn,{enableNavigationControls:b.bool,controlType:b.oneOf(["trackball","orbit","fly"]),rendererConfig:b.object,extraRenderers:b.arrayOf(b.shape({render:b.func.isRequired}))});Object.assign({},Ze,Wn,{nodeDesc:b.oneOfType([b.string,b.func]),linkDesc:b.oneOfType([b.string,b.func])});Object.assign({},Ze,Wn,{markerAttrs:b.object,yOffset:b.number,glScale:b.number});const Gn=Io(Ph,{methodNames:["emitParticle","d3Force","d3ReheatSimulation","stopAnimation","pauseAnimation","resumeAnimation","centerAt","zoom","zoomToFit","getGraphBbox","screen2GraphCoords","graph2ScreenCoords"]});Gn.displayName="ForceGraph2D";Gn.propTypes=Rh;function wt(e){return function(){return e}}function Vr(e){return(e()-.5)*1e-6}function jh(e){return e.x+e.vx}function Dh(e){return e.y+e.vy}function Ih(e){var n,r,i,o=1,a=1;typeof e!="function"&&(e=wt(e==null?1:+e));function s(){for(var l,f=n.length,h,d,p,y,x,m,g=0;g<a;++g)for(h=Un(n,jh,Dh).visitAfter(u),l=0;l<f;++l)d=n[l],x=r[d.index],m=x*x,p=d.x+d.vx,y=d.y+d.vy,h.visit(k);function k(w,_,v,A,M){var T=w.data,R=w.r,P=x+R;if(T){if(T.index>d.index){var N=p-T.x-T.vx,D=y-T.y-T.vy,U=N*N+D*D;U<P*P&&(N===0&&(N=Vr(i),U+=N*N),D===0&&(D=Vr(i),U+=D*D),U=(P-(U=Math.sqrt(U)))/U*o,d.vx+=(N*=U)*(P=(R*=R)/(m+R)),d.vy+=(D*=U)*P,T.vx-=N*(P=1-P),T.vy-=D*P)}return}return _>p+P||A<p-P||v>y+P||M<y-P}}function u(l){if(l.data)return l.r=r[l.data.index];for(var f=l.r=0;f<4;++f)l[f]&&l[f].r>l.r&&(l.r=l[f].r)}function c(){if(n){var l,f=n.length,h;for(r=new Array(f),l=0;l<f;++l)h=n[l],r[h.index]=+e(h,l,n)}}return s.initialize=function(l,f){n=l,i=f,c()},s.iterations=function(l){return arguments.length?(a=+l,s):a},s.strength=function(l){return arguments.length?(o=+l,s):o},s.radius=function(l){return arguments.length?(e=typeof l=="function"?l:wt(+l),c(),s):e},s}function $h(e){var n=wt(.1),r,i,o;typeof e!="function"&&(e=wt(e==null?0:+e));function a(u){for(var c=0,l=r.length,f;c<l;++c)f=r[c],f.vx+=(o[c]-f.x)*i[c]*u}function s(){if(r){var u,c=r.length;for(i=new Array(c),o=new Array(c),u=0;u<c;++u)i[u]=isNaN(o[u]=+e(r[u],u,r))?0:+n(r[u],u,r)}}return a.initialize=function(u){r=u,s()},a.strength=function(u){return arguments.length?(n=typeof u=="function"?u:wt(+u),s(),a):n},a.x=function(u){return arguments.length?(e=typeof u=="function"?u:wt(+u),s(),a):e},a}function Lh(e){var n=wt(.1),r,i,o;typeof e!="function"&&(e=wt(e==null?0:+e));function a(u){for(var c=0,l=r.length,f;c<l;++c)f=r[c],f.vy+=(o[c]-f.y)*i[c]*u}function s(){if(r){var u,c=r.length;for(i=new Array(c),o=new Array(c),u=0;u<c;++u)i[u]=isNaN(o[u]=+e(r[u],u,r))?0:+n(r[u],u,r)}}return a.initialize=function(u){r=u,s()},a.strength=function(u){return arguments.length?(n=typeof u=="function"?u:wt(+u),s(),a):n},a.y=function(u){return arguments.length?(e=typeof u=="function"?u:wt(+u),s(),a):e},a}const Br={identity:"#00f5ff",knowledge:"#3b82f6",rules:"#d946ef",events:"#fbbf24"},Xr={identity:"Identität",knowledge:"Wissen",rules:"Regeln",events:"Ereignisse"},Fh="rgba(99, 102, 241, 0.9)",Uh="rgba(100, 116, 139, 0.3)",Hh={identity:"rgba(0, 245, 255, 0.3)",knowledge:"rgba(59, 130, 246, 0.3)",rules:"rgba(217, 70, 239, 0.3)",events:"rgba(251, 191, 36, 0.3)"},qh={identity:"rgba(0, 245, 255, 0.16)",knowledge:"rgba(59, 130, 246, 0.16)",rules:"rgba(217, 70, 239, 0.16)",events:"rgba(251, 191, 36, 0.16)"},Wh={identity:"rgba(0, 245, 255, 0.05)",knowledge:"rgba(59, 130, 246, 0.05)",rules:"rgba(217, 70, 239, 0.05)",events:"rgba(251, 191, 36, 0.05)"},Gh={identity:"rgba(0, 245, 255, 0.16)",knowledge:"rgba(59, 130, 246, 0.16)",rules:"rgba(217, 70, 239, 0.16)",events:"rgba(251, 191, 36, 0.16)"},Vh={identity:"rgba(0, 245, 255, 0.3)",knowledge:"rgba(59, 130, 246, 0.3)",rules:"rgba(217, 70, 239, 0.3)",events:"rgba(251, 191, 36, 0.3)"};function Bh(e){if(e.length<3)return e;const n=[...e].sort((a,s)=>a[0]-s[0]||a[1]-s[1]),r=(a,s,u)=>(s[0]-a[0])*(u[1]-a[1])-(s[1]-a[1])*(u[0]-a[0]),i=[];for(const a of n){for(;i.length>=2&&r(i[i.length-2],i[i.length-1],a)<=0;)i.pop();i.push(a)}const o=[];for(let a=n.length-1;a>=0;a--){const s=n[a];for(;o.length>=2&&r(o[o.length-2],o[o.length-1],s)<=0;)o.pop();o.push(s)}return i.pop(),o.pop(),i.concat(o)}function Xh({data:e,selectedNodeId:n,onNodeSelect:r}){const[i,o]=W.useState(null),[a,s]=W.useState(.75),u=W.useRef(null),c=W.useRef(null),[l,f]=W.useState({width:500,height:560});W.useEffect(()=>{if(!u.current)return;const C=new ResizeObserver(O=>{for(const I of O)I.contentRect.width>0&&I.contentRect.height>0&&f({width:Math.floor(I.contentRect.width),height:Math.floor(I.contentRect.height)})});return C.observe(u.current),()=>C.disconnect()},[]);const h=W.useRef(new Map),d=W.useMemo(()=>{const C=h.current,O=new Set,I=e.nodes.map(F=>{O.add(F.id);let G=C.get(F.id);return G?(G.content!==F.content||G.category!==F.category)&&(G.content=F.content,G.category=F.category,G.__baseTextWidth=void 0):(G={...F},C.set(F.id,G)),G});for(const F of Array.from(C.keys()))O.has(F)||C.delete(F);const L=new Map(e.nodes.map(F=>[F.id,F.category])),H=e.edges.map(F=>({source:F.source,target:F.target,weight:F.weight||0,__sid:F.source,__tid:F.target,__sameCat:L.get(F.source)===L.get(F.target),__restColor:Hh[L.get(F.source)??""]??Uh}));return{nodes:I,links:H}},[e]),p=W.useMemo(()=>{const C={};return e.edges.forEach(O=>{C[O.source]=(C[O.source]||0)+1,C[O.target]=(C[O.target]||0)+1}),C},[e]),y=C=>({identity:-240,knowledge:240,rules:-240,events:240})[C]||0,x=C=>({identity:-240,knowledge:-240,rules:240,events:240})[C]||0,m=W.useMemo(()=>`${e.nodes.map(C=>C.id).sort().join(",")}#${e.edges.length}`,[e]);W.useEffect(()=>{const C=c.current;if(!C)return;C.d3Force("center",null),C.d3Force("x",$h().x(L=>y(L.category)).strength(.1)),C.d3Force("y",Lh().y(L=>x(L.category)).strength(.1));const O=C.d3Force("charge");O&&O.strength(-380),C.d3Force("collide",Ih().radius(28).iterations(2));const I=C.d3Force("link");I&&I.distance(L=>L.__sameCat?70:200).strength(L=>L.__sameCat?.3*(L.weight||.6):.01),C.d3ReheatSimulation()},[m]);const g=i||n,k=W.useMemo(()=>d.links.filter(C=>C.__sameCat&&(C.weight||0)>=a).length,[d,a]),w=()=>{c.current&&c.current.zoomToFit(400,40)},_=W.useMemo(()=>{if(!g)return new Set;const C=new Set;return e.edges.forEach(O=>{O.source===g&&C.add(O.target),O.target===g&&C.add(O.source)}),C},[g,e]),v=W.useCallback(C=>g?C.__sid===g||C.__tid===g:C.__sameCat&&(C.weight||0)>=a,[g,a]),A=W.useCallback(C=>g&&(C.__sid===g||C.__tid===g)?Fh:C.__restColor,[g]),M=W.useCallback(C=>g&&(C.__sid===g||C.__tid===g)?2.5:1.4,[g]),T=W.useCallback(C=>g&&(C.__sid===g||C.__tid===g)?4:0,[g]),R=W.useCallback((C,O)=>{const I=c.current,L=u.current;if(!I||!L)return null;const H=L.getBoundingClientRect(),{x:F,y:G}=I.screen2GraphCoords(C-H.left,O-H.top),V=Math.max(I.zoom()||1,.01);let X=null,tt=1/0;for(const Z of d.nodes){if(Z.x==null||Z.y==null)continue;const st=6+Math.min(p[Z.id]||0,15)*.8,et=Math.max(st+3,16/V),qt=Z.x-F,At=Z.y-G,nt=qt*qt+At*At;nt<=et*et&&nt<tt&&(tt=nt,X=Z)}return X},[d,p]),P=W.useCallback(C=>{const O=C.target instanceof HTMLCanvasElement?R(C.clientX,C.clientY):null;o(O?O.id:null),u.current&&(u.current.style.cursor=O?"pointer":"default")},[R]),N=W.useCallback(()=>{o(null),u.current&&(u.current.style.cursor="default")},[]),D=W.useRef(null),U=W.useCallback(C=>{D.current={x:C.clientX,y:C.clientY}},[]),S=W.useCallback(C=>{if(!(C.target instanceof HTMLCanvasElement))return;const O=D.current;if(O&&Math.hypot(C.clientX-O.x,C.clientY-O.y)>6)return;const I=R(C.clientX,C.clientY);r(I?I.id:null)},[R,r]),j=W.useCallback((C,O)=>{var L;const I={};for(const H of d.nodes)H.x==null||H.y==null||(I[L=H.category]??(I[L]=[])).push([H.x,H.y]);for(const[H,F]of Object.entries(I)){const G=Wh[H];if(!G||F.length===0)continue;const V=Bh(F);let X=0,tt=0;V.forEach(et=>{X+=et[0],tt+=et[1]}),X/=V.length,tt/=V.length;const Z=34;if(C.beginPath(),V.length<3)C.arc(X,tt,Z+16,0,2*Math.PI);else{const et=V.map(([nt,lt])=>{const jt=nt-X,Zt=lt-tt,Kt=Math.hypot(jt,Zt)||1;return[nt+jt/Kt*Z,lt+Zt/Kt*Z]}),qt=(nt,lt)=>[(nt[0]+lt[0])/2,(nt[1]+lt[1])/2],At=qt(et[et.length-1],et[0]);C.moveTo(At[0],At[1]);for(let nt=0;nt<et.length;nt++){const lt=et[nt],jt=qt(lt,et[(nt+1)%et.length]);C.quadraticCurveTo(lt[0],lt[1],jt[0],jt[1])}C.closePath()}C.fillStyle=G,C.fill(),C.strokeStyle=Gh[H],C.lineWidth=1.2/Math.max(O,.3),C.stroke();const st=Math.min(...V.map(et=>et[1]));C.font='600 26px "Space Grotesk", sans-serif',C.textAlign="center",C.textBaseline="bottom",C.fillStyle=Vh[H],C.fillText(Xr[H]||H,X,st-Z-8)}},[d]),E=W.useCallback((C,O,I)=>{const L=C.x??0,H=C.y??0,F=6+Math.min(p[C.id]||0,15)*.8,G=Br[C.category]||"#64748b",V=C.id===i,X=C.id===n,tt=g&&C.id!==g&&!_.has(C.id),Z=tt?"#1e293b":G;if(tt||(O.beginPath(),O.arc(L,H,F*1.9,0,2*Math.PI,!1),O.fillStyle=qh[C.category]||"rgba(100, 116, 139, 0.14)",O.fill()),(V||X)&&(O.shadowColor=G,O.shadowBlur=15),O.beginPath(),O.arc(L,H,F,0,2*Math.PI,!1),O.fillStyle=Z,O.fill(),O.shadowBlur=0,(V||X)&&(O.beginPath(),O.arc(L,H,F+2.5,0,2*Math.PI,!1),O.strokeStyle=X?"#ffffff":"rgba(255, 255, 255, 0.7)",O.lineWidth=1.5,O.stroke()),V||X||g&&_.has(C.id)){const et=C.content.length>35?C.content.slice(0,34)+"…":C.content;if(C.__baseTextWidth===void 0){const Ji=O.font;O.font='500 10px "Space Grotesk", sans-serif',C.__baseTextWidth=O.measureText(et).width,O.font=Ji}const At=(V||X?10.5:9.5)/Math.max(.5,I);O.font=`${V||X?"bold":"500"} ${At}px "Space Grotesk", sans-serif`;const nt=C.__baseTextWidth*(At/10),lt=4.5/Math.max(.5,I),jt=L-nt/2-lt,Zt=H+F+6/Math.max(.5,I),Kt=nt+lt*2,Vn=At+lt*1.6;O.fillStyle=tt?"rgba(10, 15, 25, 0.45)":"rgba(8, 12, 20, 0.88)",O.fillRect(jt,Zt,Kt,Vn),O.strokeStyle=V||X?"rgba(255, 255, 255, 0.2)":"rgba(255, 255, 255, 0.08)",O.lineWidth=.6/Math.max(.5,I),O.strokeRect(jt,Zt,Kt,Vn),O.textAlign="center",O.textBaseline="top",O.fillStyle=tt?"#475569":V||X?"#ffffff":"#cbd5e1",O.fillText(et,L,H+F+7/Math.max(.5,I))}},[p,i,n,g,_]);return $.jsxs("div",{className:"absolute inset-0",ref:u,onPointerMove:P,onPointerLeave:N,onPointerDown:U,onClick:S,style:{background:"radial-gradient(circle at center, rgba(59, 130, 246, 0.08) 0%, #030712 100%)"},children:[$.jsx(Gn,{ref:c,width:l.width,height:l.height,graphData:d,backgroundColor:"rgba(0,0,0,0)",cooldownTicks:120,enablePointerInteraction:!1,enableNodeDrag:!1,onRenderFramePre:j,linkVisibility:v,linkColor:A,linkWidth:M,linkDirectionalParticles:T,linkDirectionalParticleWidth:2.2,linkDirectionalParticleSpeed:.006,nodeCanvasObject:E}),$.jsxs("button",{onClick:w,title:"Zentrieren",className:"absolute right-3 top-3 z-10 flex items-center gap-1.5 rounded-lg border border-border/60 bg-background/50 px-2.5 py-1.5 text-[11px] text-muted-foreground hover:text-foreground backdrop-blur-sm transition-colors cursor-pointer",children:[$.jsx(ho,{className:"h-3.5 w-3.5"})," Zentrieren"]}),$.jsxs("div",{className:"absolute left-3 bottom-3 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-lg bg-background/40 px-2.5 py-1.5 backdrop-blur-sm",children:[Object.entries(Xr).map(([C,O])=>$.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[$.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:Br[C]}}),O]},C)),$.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-muted-foreground border-l border-border/40 pl-3",children:[$.jsx("span",{children:"Verbindungen"}),$.jsx("span",{className:"text-[9px] text-muted-foreground/60",children:"alle"}),$.jsx("input",{type:"range",min:.45,max:.95,step:.05,value:a,onChange:C=>s(Number(C.target.value)),className:"w-20 accent-primary cursor-pointer",title:"Nur Verbindungen ab dieser Stärke zeigen"}),$.jsx("span",{className:"text-[9px] text-muted-foreground/60",children:"stark"}),$.jsx("span",{className:"font-mono text-[9px] text-muted-foreground/80 min-w-[3ch] text-right",children:k})]})]})]})}class Yh extends W.Component{constructor(){super(...arguments);Bn(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}render(){return this.state.error?$.jsxs("div",{className:"h-[480px] rounded-2xl border border-red-500/20 bg-red-500/5 p-6 text-xs text-red-400 overflow-auto",children:[$.jsx("div",{className:"font-semibold mb-2",children:"Graph konnte nicht gerendert werden"}),$.jsx("pre",{className:"whitespace-pre-wrap break-words text-[11px] leading-relaxed",children:this.state.error.message})]}):this.props.children}}const Zh={"":"Allgemein",traeume:"Träume",muster:"Muster","skill-kandidaten":"Skill-Kandidaten","skill-kandidaten/beauftragt":"Skill-Kandidaten · beauftragt","skill-kandidaten/verworfen":"Skill-Kandidaten · verworfen"};function id(){const{data:e,isLoading:n}=oo(),[r,i]=W.useState(null),[o,a]=W.useState(null),[s,u]=W.useState(!1),[c,l]=W.useState(""),[f,h]=W.useState(!1),{data:d,isLoading:p}=ao(f),y=W.useMemo(()=>(e==null?void 0:e.files)??[],[e]),x=W.useMemo(()=>{const w=new Map;for(const _ of y)w.set(_.name.toLowerCase(),_.path);return w},[y]),m=W.useMemo(()=>{if(!c.trim())return y;const w=c.toLowerCase();return y.filter(_=>_.title.toLowerCase().includes(w)||_.path.toLowerCase().includes(w))},[y,c]),g=W.useMemo(()=>{const w=[];for(const _ of m){const v=w.find(A=>A.dir===_.dir);v?v.files.push(_):w.push({dir:_.dir,files:[_]})}return w.sort((_,v)=>_.dir===""?-1:v.dir===""?1:_.dir.localeCompare(v.dir))},[m]);W.useEffect(()=>{if(!r&&y.length){const w=y.find(_=>_.path.toLowerCase()==="index.md");i((w==null?void 0:w.path)??y[0].path)}},[y,r]),W.useEffect(()=>{r&&(u(!0),so(`/api/wissen/datei?pfad=${encodeURIComponent(r)}`).then(a).catch(()=>a({path:r,content:"*(Notiz nicht ladbar)*",mtime:0})).finally(()=>u(!1)))},[r]);const k=w=>{const _=x.get(w.toLowerCase());_&&i(_)};return $.jsxs("div",{className:"space-y-5",children:[$.jsxs("div",{className:"flex items-center justify-between",children:[$.jsxs("div",{children:[$.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Wissen"}),$.jsx("p",{className:"text-sm text-muted-foreground",children:"Was sich die Box nachts erschließt — Traum-Notizen, Muster und Skill-Ideen aus dem Wissens-Vault, verlinkt wie ein Wiki."})]}),y.length>0&&$.jsxs("div",{className:"flex rounded-lg border border-border/60 bg-card p-1",children:[$.jsx("button",{onClick:()=>h(!1),className:Ae("rounded-md px-3 py-1.5 text-xs font-medium transition-colors",f?"text-muted-foreground hover:bg-muted":"bg-primary text-primary-foreground shadow"),children:"Liste"}),$.jsx("button",{onClick:()=>h(!0),className:Ae("rounded-md px-3 py-1.5 text-xs font-medium transition-colors",f?"bg-primary text-primary-foreground shadow":"text-muted-foreground hover:bg-muted"),children:"Graph"})]})]}),e&&!e.available&&$.jsx("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-xs text-amber-300",children:"Der Wissens-Vault liegt auf der Box (~/wissens-vault) — im lokalen Dev-Modus nicht verfügbar."}),n&&$.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card/30 p-6 text-xs text-muted-foreground",children:[$.jsx(Ke,{className:"h-4 w-4 animate-spin"})," Vault wird geladen …"]}),(e==null?void 0:e.available)&&y.length===0&&$.jsx("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 text-center text-xs text-muted-foreground",children:"Noch keine Notizen. Der nächtliche Traum (03:15) legt sie an — morgen früh steht hier die erste."}),f?$.jsxs("div",{className:"mc-card flex h-[70vh] flex-col overflow-hidden p-0 relative",children:[p&&$.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 z-10",children:$.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card p-6 text-xs text-muted-foreground",children:[$.jsx(Ke,{className:"h-4 w-4 animate-spin"})," Graph wird berechnet …"]})}),$.jsx(Yh,{children:d&&$.jsx(Xh,{data:d,selectedNodeId:r,onNodeSelect:w=>{w&&(i(w),h(!1))}})})]}):y.length>0&&$.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row",children:[$.jsxs("aside",{className:"w-full shrink-0 space-y-3 lg:w-72",children:[$.jsxs("div",{className:"relative",children:[$.jsx("input",{value:c,onChange:w=>l(w.target.value),type:"search",placeholder:"Notizen durchsuchen…","aria-label":"Notizen durchsuchen",className:"h-9 w-full rounded-lg border border-border/60 bg-card/45 pl-8 pr-3 text-xs text-foreground outline-none focus:ring-1 focus:ring-primary/50"}),$.jsx(po,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),$.jsx("div",{className:"max-h-[70vh] space-y-3 overflow-y-auto pr-1 scrollbar-thin",children:g.map(({dir:w,files:_})=>$.jsxs("div",{children:[$.jsxs("p",{className:"mb-1 flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider text-muted-foreground/60",children:[$.jsx(yo,{className:"h-3 w-3"})," ",Zh[w]??w]}),$.jsx("div",{className:"space-y-0.5",children:_.map(v=>$.jsxs("button",{onClick:()=>i(v.path),className:Ae("flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs transition-all cursor-pointer",r===v.path?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[$.jsx(go,{className:"h-3.5 w-3.5 shrink-0"}),$.jsx("span",{className:"truncate",title:v.title,children:v.name}),v.neu&&$.jsxs("span",{className:"ml-auto flex items-center gap-0.5 rounded bg-violet-500/15 px-1 py-0.5 text-[8px] font-bold uppercase text-violet-300",children:[$.jsx(uo,{className:"h-2.5 w-2.5"}),"neu"]})]},v.path))})]},w||"__root"))})]}),$.jsx("div",{className:"min-w-0 flex-1 mc-card p-5",children:s?$.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[$.jsx(Ke,{className:"h-4 w-4 animate-spin"})," Notiz wird geladen …"]}):o?$.jsxs($.Fragment,{children:[$.jsxs("div",{className:"mb-3 flex items-center justify-between border-b border-border/40 pb-2",children:[$.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[$.jsx(lo,{className:"h-3.5 w-3.5"})," ",o.path]}),o.mtime>0&&$.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["Stand ",new Date(o.mtime*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})]})]}),$.jsx(Kh,{text:o.content,onWikiLink:k,known:x})]}):null})]})]})}function Kh({text:e,onWikiLink:n,known:r}){const i=e.split(`
|
|
`),o=[];let a=[],s=null;const u=c=>{a.length&&(o.push($.jsx("ul",{className:"mb-3 ml-4 list-disc space-y-1",children:a},c)),a=[])};return i.forEach((c,l)=>{const f=`l${l}`;if(s!==null){c.trimEnd()==="```"?(o.push($.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px] leading-relaxed text-foreground/85",children:s.join(`
|
|
`)},f)),s=null):s.push(c);return}if(c.trimStart().startsWith("```")){u(f),s=[];return}const h=c.trimEnd();if(!h.trim()){u(f);return}const d=h.match(/^(#{1,4})\s+(.*)$/);if(d){u(f);const y=d[1].length,x=y===1?"text-lg font-bold mt-1 mb-3":y===2?"text-base font-bold mt-4 mb-2":"text-sm font-bold mt-3 mb-1.5";o.push($.jsx("p",{className:Ae(x,"font-space text-foreground"),children:cn(d[2],n,r,f)},f));return}const p=h.match(/^\s*[-*•]\s+(.*)$/);if(p){a.push($.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:cn(p[1],n,r,f)},f));return}u(f),o.push($.jsx("p",{className:"mb-2 text-xs leading-relaxed text-foreground/85",children:cn(h,n,r,f)},f))}),u("end"),s!==null&&o.push($.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px]",children:s.join(`
|
|
`)},"code-end")),$.jsx("div",{className:"max-w-3xl",children:o})}function cn(e,n,r,i){return e.split(/(\[\[[^\]]+\]\]|\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g).map((a,s)=>{const u=`${i}-${s}`,c=a.match(/^\[\[([^\]|]+)(?:\|([^\]]+))?\]\]$/);if(c){const l=c[1].trim(),f=(c[2]??c[1]).trim();return r.has(l.toLowerCase())?$.jsx("button",{onClick:()=>n(l),className:"rounded bg-primary/10 px-1 text-primary underline decoration-primary/40 underline-offset-2 hover:bg-primary/20 cursor-pointer",children:f},u):$.jsx("span",{className:"rounded bg-background/40 px-1 text-muted-foreground",title:"Notiz existiert (noch) nicht",children:f},u)}return a.startsWith("**")&&a.endsWith("**")?$.jsx("b",{className:"font-semibold text-foreground",children:a.slice(2,-2)},u):a.startsWith("*")&&a.endsWith("*")&&a.length>2?$.jsx("i",{children:a.slice(1,-1)},u):a.startsWith("`")&&a.endsWith("`")?$.jsx("code",{className:"rounded bg-background/50 px-1 font-mono text-[11px] text-teal-300",children:a.slice(1,-1)},u):$.jsx("span",{children:a},u)})}export{id as WissenView};
|