@origintrail-official/dkg-node-ui 0.0.1-dev.1773506972.23bf9c0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +49 -0
- package/dist/api.d.ts +30 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +805 -0
- package/dist/api.js.map +1 -0
- package/dist/chat-assistant.d.ts +68 -0
- package/dist/chat-assistant.d.ts.map +1 -0
- package/dist/chat-assistant.js +663 -0
- package/dist/chat-assistant.js.map +1 -0
- package/dist/chat-memory.d.ts +171 -0
- package/dist/chat-memory.d.ts.map +1 -0
- package/dist/chat-memory.js +985 -0
- package/dist/chat-memory.js.map +1 -0
- package/dist/chat-persistence-queue.d.ts +67 -0
- package/dist/chat-persistence-queue.d.ts.map +1 -0
- package/dist/chat-persistence-queue.js +245 -0
- package/dist/chat-persistence-queue.js.map +1 -0
- package/dist/db.d.ts +402 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +887 -0
- package/dist/db.js.map +1 -0
- package/dist/gelf-push-worker.d.ts +67 -0
- package/dist/gelf-push-worker.d.ts.map +1 -0
- package/dist/gelf-push-worker.js +147 -0
- package/dist/gelf-push-worker.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/capability-resolver.d.ts +3 -0
- package/dist/llm/capability-resolver.d.ts.map +1 -0
- package/dist/llm/capability-resolver.js +21 -0
- package/dist/llm/capability-resolver.js.map +1 -0
- package/dist/llm/client.d.ts +23 -0
- package/dist/llm/client.d.ts.map +1 -0
- package/dist/llm/client.js +91 -0
- package/dist/llm/client.js.map +1 -0
- package/dist/llm/provider-adapter.d.ts +16 -0
- package/dist/llm/provider-adapter.d.ts.map +1 -0
- package/dist/llm/provider-adapter.js +199 -0
- package/dist/llm/provider-adapter.js.map +1 -0
- package/dist/llm/types.d.ts +64 -0
- package/dist/llm/types.d.ts.map +1 -0
- package/dist/llm/types.js +2 -0
- package/dist/llm/types.js.map +1 -0
- package/dist/metrics-collector.d.ts +36 -0
- package/dist/metrics-collector.d.ts.map +1 -0
- package/dist/metrics-collector.js +155 -0
- package/dist/metrics-collector.js.map +1 -0
- package/dist/operation-tracker.d.ts +43 -0
- package/dist/operation-tracker.d.ts.map +1 -0
- package/dist/operation-tracker.js +195 -0
- package/dist/operation-tracker.js.map +1 -0
- package/dist/structured-logger.d.ts +16 -0
- package/dist/structured-logger.d.ts.map +1 -0
- package/dist/structured-logger.js +41 -0
- package/dist/structured-logger.js.map +1 -0
- package/dist/telemetry.d.ts +35 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +45 -0
- package/dist/telemetry.js.map +1 -0
- package/dist-ui/assets/3d-force-graph-nMUNmvtB.js +964 -0
- package/dist-ui/assets/AgentHub-XKCM9uYQ.js +65 -0
- package/dist-ui/assets/AppHost-DoLIi89g.js +1 -0
- package/dist-ui/assets/Apps-Cc8HfqfD.js +1 -0
- package/dist-ui/assets/Dashboard-D5q6MK78.js +2 -0
- package/dist-ui/assets/Explorer-B80RVksc.js +64 -0
- package/dist-ui/assets/N3Parser-Q_-1ZY5E.js +7 -0
- package/dist-ui/assets/Settings-CG7-7GM-.js +71 -0
- package/dist-ui/assets/hooks-BLTFNmyP.js +1 -0
- package/dist-ui/assets/index-8_35CUX2.js +192 -0
- package/dist-ui/assets/index-CKZq_ZB-.css +1 -0
- package/dist-ui/assets/index-DH-l6lM0.js +76 -0
- package/dist-ui/assets/jsonld-32FQRO67-DhbO8O6B.js +2 -0
- package/dist-ui/assets/jsonld-BFI4wECl.js +62 -0
- package/dist-ui/assets/ntriples-ZWBY2WET-nIpilpjf.js +1 -0
- package/dist-ui/assets/ordinal-DIohFSkg.js +1 -0
- package/dist-ui/assets/renderer-3d-2EVDZII7-DsxBsJvs.js +2 -0
- package/dist-ui/assets/three.module-uCjFke6H.js +4019 -0
- package/dist-ui/assets/turtle-JJPK7LJ5-zezDJZEp.js +1 -0
- package/dist-ui/favicon.png +0 -0
- package/dist-ui/index.html +14 -0
- package/package.json +58 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderer-3d-2EVDZII7-DsxBsJvs.js","assets/index-DH-l6lM0.js","assets/index-CKZq_ZB-.css","assets/ntriples-ZWBY2WET-nIpilpjf.js","assets/N3Parser-Q_-1ZY5E.js","assets/turtle-JJPK7LJ5-zezDJZEp.js","assets/jsonld-32FQRO67-DhbO8O6B.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var $i=Object.defineProperty;var Ui=(e,n,r)=>n in e?$i(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var P=(e,n,r)=>Ui(e,typeof n!="symbol"?n+"":n,r);import{r as it,j as In,_ as qt}from"./index-DH-l6lM0.js";import{i as zt,c as Rn,a as On,b as Hi,o as Wi,m as Dn,d as Fn}from"./ordinal-DIohFSkg.js";var tn="http://www.w3.org/1999/xhtml";const jn={svg:"http://www.w3.org/2000/svg",xhtml:tn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fe(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),jn.hasOwnProperty(n)?{space:jn[n],local:e}:e}function qi(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===tn&&n.documentElement.namespaceURI===tn?n.createElement(e):n.createElementNS(r,e)}}function Bi(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Fr(e){var n=Fe(e);return(n.local?Bi:qi)(n)}function Vi(){}function yn(e){return e==null?Vi:function(){return this.querySelector(e)}}function Gi(e){typeof e!="function"&&(e=yn(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,l=i[o]=new Array(s),u,c,h=0;h<s;++h)(u=a[h])&&(c=e.call(u,u.__data__,h,a))&&("__data__"in u&&(c.__data__=u.__data__),l[h]=c);return new nt(i,this._parents)}function Xi(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Yi(){return[]}function jr(e){return e==null?Yi:function(){return this.querySelectorAll(e)}}function Ki(e){return function(){return Xi(e.apply(this,arguments))}}function Zi(e){typeof e=="function"?e=Ki(e):e=jr(e);for(var n=this._groups,r=n.length,i=[],o=[],a=0;a<r;++a)for(var s=n[a],l=s.length,u,c=0;c<l;++c)(u=s[c])&&(i.push(e.call(u,u.__data__,c,s)),o.push(u));return new nt(i,o)}function Lr(e){return function(){return this.matches(e)}}function $r(e){return function(n){return n.matches(e)}}var Qi=Array.prototype.find;function Ji(e){return function(){return Qi.call(this.children,e)}}function to(){return this.firstElementChild}function eo(e){return this.select(e==null?to:Ji(typeof e=="function"?e:$r(e)))}var no=Array.prototype.filter;function ro(){return Array.from(this.children)}function io(e){return function(){return no.call(this.children,e)}}function oo(e){return this.selectAll(e==null?ro:io(typeof e=="function"?e:$r(e)))}function ao(e){typeof e!="function"&&(e=Lr(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,l=i[o]=[],u,c=0;c<s;++c)(u=a[c])&&e.call(u,u.__data__,c,a)&&l.push(u);return new nt(i,this._parents)}function Ur(e){return new Array(e.length)}function so(){return new nt(this._enter||this._groups.map(Ur),this._parents)}function Se(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Se.prototype={constructor:Se,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 lo(e){return function(){return e}}function uo(e,n,r,i,o,a){for(var s=0,l,u=n.length,c=a.length;s<c;++s)(l=n[s])?(l.__data__=a[s],i[s]=l):r[s]=new Se(e,a[s]);for(;s<u;++s)(l=n[s])&&(o[s]=l)}function co(e,n,r,i,o,a,s){var l,u,c=new Map,h=n.length,f=a.length,d=new Array(h),p;for(l=0;l<h;++l)(u=n[l])&&(d[l]=p=s.call(u,u.__data__,l,n)+"",c.has(p)?o[l]=u:c.set(p,u));for(l=0;l<f;++l)p=s.call(e,a[l],l,a)+"",(u=c.get(p))?(i[l]=u,u.__data__=a[l],c.delete(p)):r[l]=new Se(e,a[l]);for(l=0;l<h;++l)(u=n[l])&&c.get(d[l])===u&&(o[l]=u)}function fo(e){return e.__data__}function ho(e,n){if(!arguments.length)return Array.from(this,fo);var r=n?co:uo,i=this._parents,o=this._groups;typeof e!="function"&&(e=lo(e));for(var a=o.length,s=new Array(a),l=new Array(a),u=new Array(a),c=0;c<a;++c){var h=i[c],f=o[c],d=f.length,p=po(e.call(h,h&&h.__data__,c,i)),_=p.length,m=l[c]=new Array(_),y=s[c]=new Array(_),g=u[c]=new Array(d);r(h,f,m,y,g,p,n);for(var w=0,x=0,v,b;w<_;++w)if(v=m[w]){for(w>=x&&(x=w+1);!(b=y[x])&&++x<_;);v._next=b||null}}return s=new nt(s,i),s._enter=l,s._exit=u,s}function po(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function go(){return new nt(this._exit||this._groups.map(Ur),this._parents)}function _o(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 vo(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),l=new Array(o),u=0;u<s;++u)for(var c=r[u],h=i[u],f=c.length,d=l[u]=new Array(f),p,_=0;_<f;++_)(p=c[_]||h[_])&&(d[_]=p);for(;u<o;++u)l[u]=r[u];return new nt(l,this._parents)}function yo(){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 mo(e){e||(e=bo);function n(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a){for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,h=0;h<l;++h)(c=s[h])&&(u[h]=c);u.sort(n)}return new nt(o,this._parents).order()}function bo(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function wo(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function xo(){return Array.from(this)}function ko(){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 So(){let e=0;for(const n of this)++e;return e}function Mo(){return!this.node()}function Co(e){for(var n=this._groups,r=0,i=n.length;r<i;++r)for(var o=n[r],a=0,s=o.length,l;a<s;++a)(l=o[a])&&e.call(l,l.__data__,a,o);return this}function Ao(e){return function(){this.removeAttribute(e)}}function Po(e){return function(){this.removeAttributeNS(e.space,e.local)}}function To(e,n){return function(){this.setAttribute(e,n)}}function Eo(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function No(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function zo(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function Io(e,n){var r=Fe(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?Po:Ao:typeof n=="function"?r.local?zo:No:r.local?Eo:To)(r,n))}function Hr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ro(e){return function(){this.style.removeProperty(e)}}function Oo(e,n,r){return function(){this.style.setProperty(e,n,r)}}function Do(e,n,r){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function Fo(e,n,r){return arguments.length>1?this.each((n==null?Ro:typeof n=="function"?Do:Oo)(e,n,r??"")):Ut(this.node(),e)}function Ut(e,n){return e.style.getPropertyValue(n)||Hr(e).getComputedStyle(e,null).getPropertyValue(n)}function jo(e){return function(){delete this[e]}}function Lo(e,n){return function(){this[e]=n}}function $o(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Uo(e,n){return arguments.length>1?this.each((n==null?jo:typeof n=="function"?$o:Lo)(e,n)):this.node()[e]}function Wr(e){return e.trim().split(/^|\s+/)}function mn(e){return e.classList||new qr(e)}function qr(e){this._node=e,this._names=Wr(e.getAttribute("class")||"")}qr.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 Br(e,n){for(var r=mn(e),i=-1,o=n.length;++i<o;)r.add(n[i])}function Vr(e,n){for(var r=mn(e),i=-1,o=n.length;++i<o;)r.remove(n[i])}function Ho(e){return function(){Br(this,e)}}function Wo(e){return function(){Vr(this,e)}}function qo(e,n){return function(){(n.apply(this,arguments)?Br:Vr)(this,e)}}function Bo(e,n){var r=Wr(e+"");if(arguments.length<2){for(var i=mn(this.node()),o=-1,a=r.length;++o<a;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof n=="function"?qo:n?Ho:Wo)(r,n))}function Vo(){this.textContent=""}function Go(e){return function(){this.textContent=e}}function Xo(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function Yo(e){return arguments.length?this.each(e==null?Vo:(typeof e=="function"?Xo:Go)(e)):this.node().textContent}function Ko(){this.innerHTML=""}function Zo(e){return function(){this.innerHTML=e}}function Qo(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function Jo(e){return arguments.length?this.each(e==null?Ko:(typeof e=="function"?Qo:Zo)(e)):this.node().innerHTML}function ta(){this.nextSibling&&this.parentNode.appendChild(this)}function ea(){return this.each(ta)}function na(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ra(){return this.each(na)}function ia(e){var n=typeof e=="function"?e:Fr(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function oa(){return null}function aa(e,n){var r=typeof e=="function"?e:Fr(e),i=n==null?oa:typeof n=="function"?n:yn(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function sa(){var e=this.parentNode;e&&e.removeChild(this)}function la(){return this.each(sa)}function ua(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function ca(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function fa(e){return this.select(e?ca:ua)}function ha(e){return arguments.length?this.property("__data__",e):this.node().__data__}function da(e){return function(n){e.call(this,n,this.__data__)}}function pa(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 ga(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 _a(e,n,r){return function(){var i=this.__on,o,a=da(n);if(i){for(var s=0,l=i.length;s<l;++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 va(e,n,r){var i=pa(e+""),o,a=i.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,c=l.length,h;u<c;++u)for(o=0,h=l[u];o<a;++o)if((s=i[o]).type===h.type&&s.name===h.name)return h.value}return}for(l=n?_a:ga,o=0;o<a;++o)this.each(l(i[o],n,r));return this}function Gr(e,n,r){var i=Hr(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 ya(e,n){return function(){return Gr(this,e,n)}}function ma(e,n){return function(){return Gr(this,e,n.apply(this,arguments))}}function ba(e,n){return this.each((typeof n=="function"?ma:ya)(e,n))}function*wa(){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 Xr=[null];function nt(e,n){this._groups=e,this._parents=n}function ce(){return new nt([[document.documentElement]],Xr)}function xa(){return this}nt.prototype=ce.prototype={constructor:nt,select:Gi,selectAll:Zi,selectChild:eo,selectChildren:oo,filter:ao,data:ho,enter:so,exit:go,join:_o,merge:vo,selection:xa,order:yo,sort:mo,call:wo,nodes:xo,node:ko,size:So,empty:Mo,each:Co,attr:Io,style:Fo,property:Uo,classed:Bo,text:Yo,html:Jo,raise:ea,lower:ra,append:ia,insert:aa,remove:la,clone:fa,datum:ha,on:va,dispatch:ba,[Symbol.iterator]:wa};function at(e){return typeof e=="string"?new nt([[document.querySelector(e)]],[document.documentElement]):new nt([[e]],Xr)}function ka(e){let n;for(;n=e.sourceEvent;)e=n;return e}function pt(e,n){if(e=ka(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 Sa={value:()=>{}};function fe(){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 me(r)}function me(e){this._=e}function Ma(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}})}me.prototype=fe.prototype={constructor:me,on:function(e,n){var r=this._,i=Ma(e+"",r),o,a=-1,s=i.length;if(arguments.length<2){for(;++a<s;)if((o=(e=i[a]).type)&&(o=Ca(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]=Ln(r[o],e.name,n);else if(n==null)for(o in r)r[o]=Ln(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 me(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 Ca(e,n){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===n)return o.value}function Ln(e,n,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===n){e[i]=Sa,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:n,value:r}),e}const Aa={passive:!1},se={capture:!0,passive:!1};function qe(e){e.stopImmediatePropagation()}function $t(e){e.preventDefault(),e.stopImmediatePropagation()}function Yr(e){var n=e.document.documentElement,r=at(e).on("dragstart.drag",$t,se);"onselectstart"in n?r.on("selectstart.drag",$t,se):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Kr(e,n){var r=e.document.documentElement,i=at(e).on("dragstart.drag",null);n&&(i.on("click.drag",$t,se),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 de=e=>()=>e;function en(e,{sourceEvent:n,subject:r,target:i,identifier:o,active:a,x:s,y:l,dx:u,dy:c,dispatch:h}){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:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}en.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Pa(e){return!e.ctrlKey&&!e.button}function Ta(){return this.parentNode}function Ea(e,n){return n??{x:e.x,y:e.y}}function Na(){return navigator.maxTouchPoints||"ontouchstart"in this}function za(){var e=Pa,n=Ta,r=Ea,i=Na,o={},a=fe("start","drag","end"),s=0,l,u,c,h,f=0;function d(v){v.on("mousedown.drag",p).filter(i).on("touchstart.drag",y).on("touchmove.drag",g,Aa).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(v,b){if(!(h||!e.call(this,v,b))){var k=x(this,n.call(this,v,b),v,b,"mouse");k&&(at(v.view).on("mousemove.drag",_,se).on("mouseup.drag",m,se),Yr(v.view),qe(v),c=!1,l=v.clientX,u=v.clientY,k("start",v))}}function _(v){if($t(v),!c){var b=v.clientX-l,k=v.clientY-u;c=b*b+k*k>f}o.mouse("drag",v)}function m(v){at(v.view).on("mousemove.drag mouseup.drag",null),Kr(v.view,c),$t(v),o.mouse("end",v)}function y(v,b){if(e.call(this,v,b)){var k=v.changedTouches,S=n.call(this,v,b),C=k.length,N,E;for(N=0;N<C;++N)(E=x(this,S,v,b,k[N].identifier,k[N]))&&(qe(v),E("start",v,k[N]))}}function g(v){var b=v.changedTouches,k=b.length,S,C;for(S=0;S<k;++S)(C=o[b[S].identifier])&&($t(v),C("drag",v,b[S]))}function w(v){var b=v.changedTouches,k=b.length,S,C;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),S=0;S<k;++S)(C=o[b[S].identifier])&&(qe(v),C("end",v,b[S]))}function x(v,b,k,S,C,N){var E=a.copy(),I=pt(N||k,b),R,j,M;if((M=r.call(v,new en("beforestart",{sourceEvent:k,target:d,identifier:C,active:s,x:I[0],y:I[1],dx:0,dy:0,dispatch:E}),S))!=null)return R=M.x-I[0]||0,j=M.y-I[1]||0,function z(A,O,F){var L=I,$;switch(A){case"start":o[C]=z,$=s++;break;case"end":delete o[C],--s;case"drag":I=pt(F||O,b),$=s;break}E.call(A,v,new en(A,{sourceEvent:O,subject:M,target:d,identifier:C,active:$,x:I[0]+R,y:I[1]+j,dx:I[0]-L[0],dy:I[1]-L[1],dispatch:E}),S)}}return d.filter=function(v){return arguments.length?(e=typeof v=="function"?v:de(!!v),d):e},d.container=function(v){return arguments.length?(n=typeof v=="function"?v:de(v),d):n},d.subject=function(v){return arguments.length?(r=typeof v=="function"?v:de(v),d):r},d.touchable=function(v){return arguments.length?(i=typeof v=="function"?v:de(!!v),d):i},d.on=function(){var v=a.on.apply(a,arguments);return v===a?d:v},d.clickDistance=function(v){return arguments.length?(f=(v=+v)*v,d):Math.sqrt(f)},d}var $n=180/Math.PI,nn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Zr(e,n,r,i,o,a){var s,l,u;return(s=Math.sqrt(e*e+n*n))&&(e/=s,n/=s),(u=e*r+n*i)&&(r-=e*u,i-=n*u),(l=Math.sqrt(r*r+i*i))&&(r/=l,i/=l,u/=l),e*i<n*r&&(e=-e,n=-n,u=-u,s=-s),{translateX:o,translateY:a,rotate:Math.atan2(n,e)*$n,skewX:Math.atan(u)*$n,scaleX:s,scaleY:l}}var pe;function Ia(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?nn:Zr(n.a,n.b,n.c,n.d,n.e,n.f)}function Ra(e){return e==null||(pe||(pe=document.createElementNS("http://www.w3.org/2000/svg","g")),pe.setAttribute("transform",e),!(e=pe.transform.baseVal.consolidate()))?nn:(e=e.matrix,Zr(e.a,e.b,e.c,e.d,e.e,e.f))}function Qr(e,n,r,i){function o(c){return c.length?c.pop()+" ":""}function a(c,h,f,d,p,_){if(c!==f||h!==d){var m=p.push("translate(",null,n,null,r);_.push({i:m-4,x:zt(c,f)},{i:m-2,x:zt(h,d)})}else(f||d)&&p.push("translate("+f+n+d+r)}function s(c,h,f,d){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),d.push({i:f.push(o(f)+"rotate(",null,i)-2,x:zt(c,h)})):h&&f.push(o(f)+"rotate("+h+i)}function l(c,h,f,d){c!==h?d.push({i:f.push(o(f)+"skewX(",null,i)-2,x:zt(c,h)}):h&&f.push(o(f)+"skewX("+h+i)}function u(c,h,f,d,p,_){if(c!==f||h!==d){var m=p.push(o(p)+"scale(",null,",",null,")");_.push({i:m-4,x:zt(c,f)},{i:m-2,x:zt(h,d)})}else(f!==1||d!==1)&&p.push(o(p)+"scale("+f+","+d+")")}return function(c,h){var f=[],d=[];return c=e(c),h=e(h),a(c.translateX,c.translateY,h.translateX,h.translateY,f,d),s(c.rotate,h.rotate,f,d),l(c.skewX,h.skewX,f,d),u(c.scaleX,c.scaleY,h.scaleX,h.scaleY,f,d),c=h=null,function(p){for(var _=-1,m=d.length,y;++_<m;)f[(y=d[_]).i]=y.x(p);return f.join("")}}}var Oa=Qr(Ia,"px, ","px)","deg)"),Da=Qr(Ra,", ",")",")"),Fa=1e-12;function Un(e){return((e=Math.exp(e))+1/e)/2}function ja(e){return((e=Math.exp(e))-1/e)/2}function La(e){return((e=Math.exp(2*e))-1)/(e+1)}const $a=(function e(n,r,i){function o(a,s){var l=a[0],u=a[1],c=a[2],h=s[0],f=s[1],d=s[2],p=h-l,_=f-u,m=p*p+_*_,y,g;if(m<Fa)g=Math.log(d/c)/n,y=function(S){return[l+S*p,u+S*_,c*Math.exp(n*S*g)]};else{var w=Math.sqrt(m),x=(d*d-c*c+i*m)/(2*c*r*w),v=(d*d-c*c-i*m)/(2*d*r*w),b=Math.log(Math.sqrt(x*x+1)-x),k=Math.log(Math.sqrt(v*v+1)-v);g=(k-b)/n,y=function(S){var C=S*g,N=Un(b),E=c/(r*w)*(N*La(n*C+b)-ja(b));return[l+E*p,u+E*_,c*N/Un(n*C+b)]}}return y.duration=g*1e3*n/Math.SQRT2,y}return o.rho=function(a){var s=Math.max(.001,+a),l=s*s,u=l*l;return e(s,l,u)},o})(Math.SQRT2,2,4);var Ht=0,Jt=0,Bt=0,Jr=1e3,Me,te,Ce=0,Ot=0,je=0,le=typeof performance=="object"&&performance.now?performance:Date,ti=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function bn(){return Ot||(ti(Ua),Ot=le.now()+je)}function Ua(){Ot=0}function Ae(){this._call=this._time=this._next=null}Ae.prototype=wn.prototype={constructor:Ae,restart:function(e,n,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?bn():+r)+(n==null?0:+n),!this._next&&te!==this&&(te?te._next=this:Me=this,te=this),this._call=e,this._time=r,rn()},stop:function(){this._call&&(this._call=null,this._time=1/0,rn())}};function wn(e,n,r){var i=new Ae;return i.restart(e,n,r),i}function Ha(){bn(),++Ht;for(var e=Me,n;e;)(n=Ot-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Ht}function Hn(){Ot=(Ce=le.now())+je,Ht=Jt=0;try{Ha()}finally{Ht=0,qa(),Ot=0}}function Wa(){var e=le.now(),n=e-Ce;n>Jr&&(je-=n,Ce=e)}function qa(){for(var e,n=Me,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:Me=r);te=e,rn(i)}function rn(e){if(!Ht){Jt&&(Jt=clearTimeout(Jt));var n=e-Ot;n>24?(e<1/0&&(Jt=setTimeout(Hn,e-le.now()-je)),Bt&&(Bt=clearInterval(Bt))):(Bt||(Ce=le.now(),Bt=setInterval(Wa,Jr)),Ht=1,ti(Hn))}}function Wn(e,n,r){var i=new Ae;return n=n==null?0:+n,i.restart(o=>{i.stop(),e(o+n)},n,r),i}var Ba=fe("start","end","cancel","interrupt"),Va=[],ei=0,qn=1,on=2,be=3,Bn=4,an=5,we=6;function Le(e,n,r,i,o,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;Ga(e,r,{name:n,index:i,group:o,on:Ba,tween:Va,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:ei})}function xn(e,n){var r=ht(e,n);if(r.state>ei)throw new Error("too late; already scheduled");return r}function vt(e,n){var r=ht(e,n);if(r.state>be)throw new Error("too late; already running");return r}function ht(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function Ga(e,n,r){var i=e.__transition,o;i[n]=r,r.timer=wn(a,0,r.time);function a(c){r.state=qn,r.timer.restart(s,r.delay,r.time),r.delay<=c&&s(c-r.delay)}function s(c){var h,f,d,p;if(r.state!==qn)return u();for(h in i)if(p=i[h],p.name===r.name){if(p.state===be)return Wn(s);p.state===Bn?(p.state=we,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[h]):+h<n&&(p.state=we,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete i[h])}if(Wn(function(){r.state===be&&(r.state=Bn,r.timer.restart(l,r.delay,r.time),l(c))}),r.state=on,r.on.call("start",e,e.__data__,r.index,r.group),r.state===on){for(r.state=be,o=new Array(d=r.tween.length),h=0,f=-1;h<d;++h)(p=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(o[++f]=p);o.length=f+1}}function l(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(u),r.state=an,1),f=-1,d=o.length;++f<d;)o[f].call(e,h);r.state===an&&(r.on.call("end",e,e.__data__,r.index,r.group),u())}function u(){r.state=we,r.timer.stop(),delete i[n];for(var c in i)return;delete e.__transition}}function xe(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>on&&i.state<an,i.state=we,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[s]}a&&delete e.__transition}}function Xa(e){return this.each(function(){xe(this,e)})}function Ya(e,n){var r,i;return function(){var o=vt(this,e),a=o.tween;if(a!==r){i=r=a;for(var s=0,l=i.length;s<l;++s)if(i[s].name===n){i=i.slice(),i.splice(s,1);break}}o.tween=i}}function Ka(e,n,r){var i,o;if(typeof r!="function")throw new Error;return function(){var a=vt(this,e),s=a.tween;if(s!==i){o=(i=s).slice();for(var l={name:n,value:r},u=0,c=o.length;u<c;++u)if(o[u].name===n){o[u]=l;break}u===c&&o.push(l)}a.tween=o}}function Za(e,n){var r=this._id;if(e+="",arguments.length<2){for(var i=ht(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?Ya:Ka)(r,e,n))}function kn(e,n,r){var i=e._id;return e.each(function(){var o=vt(this,i);(o.value||(o.value={}))[n]=r.apply(this,arguments)}),function(o){return ht(o,i).value[n]}}function ni(e,n){var r;return(typeof n=="number"?zt:n instanceof Rn?On:(r=Rn(n))?(n=r,On):Hi)(e,n)}function Qa(e){return function(){this.removeAttribute(e)}}function Ja(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ts(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 es(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 ns(e,n,r){var i,o,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=l+"",s===u?null:s===i&&u===o?a:(o=u,a=n(i=s,l)))}}function rs(e,n,r){var i,o,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=l+"",s===u?null:s===i&&u===o?a:(o=u,a=n(i=s,l)))}}function is(e,n){var r=Fe(e),i=r==="transform"?Da:ni;return this.attrTween(e,typeof n=="function"?(r.local?rs:ns)(r,i,kn(this,"attr."+e,n)):n==null?(r.local?Ja:Qa)(r):(r.local?es:ts)(r,i,n))}function os(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function as(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function ss(e,n){var r,i;function o(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&as(e,a)),r}return o._value=n,o}function ls(e,n){var r,i;function o(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&os(e,a)),r}return o._value=n,o}function us(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=Fe(e);return this.tween(r,(i.local?ss:ls)(i,n))}function cs(e,n){return function(){xn(this,e).delay=+n.apply(this,arguments)}}function fs(e,n){return n=+n,function(){xn(this,e).delay=n}}function hs(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?cs:fs)(n,e)):ht(this.node(),n).delay}function ds(e,n){return function(){vt(this,e).duration=+n.apply(this,arguments)}}function ps(e,n){return n=+n,function(){vt(this,e).duration=n}}function gs(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?ds:ps)(n,e)):ht(this.node(),n).duration}function _s(e,n){if(typeof n!="function")throw new Error;return function(){vt(this,e).ease=n}}function vs(e){var n=this._id;return arguments.length?this.each(_s(n,e)):ht(this.node(),n).ease}function ys(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!="function")throw new Error;vt(this,e).ease=r}}function ms(e){if(typeof e!="function")throw new Error;return this.each(ys(this._id,e))}function bs(e){typeof e!="function"&&(e=Lr(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,l=i[o]=[],u,c=0;c<s;++c)(u=a[c])&&e.call(u,u.__data__,c,a)&&l.push(u);return new Pt(i,this._parents,this._name,this._id)}function ws(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),l=0;l<a;++l)for(var u=n[l],c=r[l],h=u.length,f=s[l]=new Array(h),d,p=0;p<h;++p)(d=u[p]||c[p])&&(f[p]=d);for(;l<i;++l)s[l]=n[l];return new Pt(s,this._parents,this._name,this._id)}function xs(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 ks(e,n,r){var i,o,a=xs(n)?xn:vt;return function(){var s=a(this,e),l=s.on;l!==i&&(o=(i=l).copy()).on(n,r),s.on=o}}function Ss(e,n){var r=this._id;return arguments.length<2?ht(this.node(),r).on.on(e):this.each(ks(r,e,n))}function Ms(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function Cs(){return this.on("end.remove",Ms(this._id))}function As(e){var n=this._name,r=this._id;typeof e!="function"&&(e=yn(e));for(var i=this._groups,o=i.length,a=new Array(o),s=0;s<o;++s)for(var l=i[s],u=l.length,c=a[s]=new Array(u),h,f,d=0;d<u;++d)(h=l[d])&&(f=e.call(h,h.__data__,d,l))&&("__data__"in h&&(f.__data__=h.__data__),c[d]=f,Le(c[d],n,r,d,c,ht(h,r)));return new Pt(a,this._parents,n,r)}function Ps(e){var n=this._name,r=this._id;typeof e!="function"&&(e=jr(e));for(var i=this._groups,o=i.length,a=[],s=[],l=0;l<o;++l)for(var u=i[l],c=u.length,h,f=0;f<c;++f)if(h=u[f]){for(var d=e.call(h,h.__data__,f,u),p,_=ht(h,r),m=0,y=d.length;m<y;++m)(p=d[m])&&Le(p,n,r,m,d,_);a.push(d),s.push(h)}return new Pt(a,s,n,r)}var Ts=ce.prototype.constructor;function Es(){return new Ts(this._groups,this._parents)}function Ns(e,n){var r,i,o;return function(){var a=Ut(this,e),s=(this.style.removeProperty(e),Ut(this,e));return a===s?null:a===r&&s===i?o:o=n(r=a,i=s)}}function ri(e){return function(){this.style.removeProperty(e)}}function zs(e,n,r){var i,o=r+"",a;return function(){var s=Ut(this,e);return s===o?null:s===i?a:a=n(i=s,r)}}function Is(e,n,r){var i,o,a;return function(){var s=Ut(this,e),l=r(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),Ut(this,e))),s===u?null:s===i&&u===o?a:(o=u,a=n(i=s,l))}}function Rs(e,n){var r,i,o,a="style."+n,s="end."+a,l;return function(){var u=vt(this,e),c=u.on,h=u.value[a]==null?l||(l=ri(n)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(s,o=h),u.on=i}}function Os(e,n,r){var i=(e+="")=="transform"?Oa:ni;return n==null?this.styleTween(e,Ns(e,i)).on("end.style."+e,ri(e)):typeof n=="function"?this.styleTween(e,Is(e,i,kn(this,"style."+e,n))).each(Rs(this._id,e)):this.styleTween(e,zs(e,i,n),r).on("end.style."+e,null)}function Ds(e,n,r){return function(i){this.style.setProperty(e,n.call(this,i),r)}}function Fs(e,n,r){var i,o;function a(){var s=n.apply(this,arguments);return s!==o&&(i=(o=s)&&Ds(e,s,r)),i}return a._value=n,a}function js(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,Fs(e,n,r??""))}function Ls(e){return function(){this.textContent=e}}function $s(e){return function(){var n=e(this);this.textContent=n??""}}function Us(e){return this.tween("text",typeof e=="function"?$s(kn(this,"text",e)):Ls(e==null?"":e+""))}function Hs(e){return function(n){this.textContent=e.call(this,n)}}function Ws(e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Hs(o)),n}return i._value=e,i}function qs(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,Ws(e))}function Bs(){for(var e=this._name,n=this._id,r=ii(),i=this._groups,o=i.length,a=0;a<o;++a)for(var s=i[a],l=s.length,u,c=0;c<l;++c)if(u=s[c]){var h=ht(u,n);Le(u,e,r,c,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Pt(i,this._parents,e,r)}function Vs(){var e,n,r=this,i=r._id,o=r.size();return new Promise(function(a,s){var l={value:s},u={value:function(){--o===0&&a()}};r.each(function(){var c=vt(this,i),h=c.on;h!==e&&(n=(e=h).copy(),n._.cancel.push(l),n._.interrupt.push(l),n._.end.push(u)),c.on=n}),o===0&&a()})}var Gs=0;function Pt(e,n,r,i){this._groups=e,this._parents=n,this._name=r,this._id=i}function ii(){return++Gs}var bt=ce.prototype;Pt.prototype={constructor:Pt,select:As,selectAll:Ps,selectChild:bt.selectChild,selectChildren:bt.selectChildren,filter:bs,merge:ws,selection:Es,transition:Bs,call:bt.call,nodes:bt.nodes,node:bt.node,size:bt.size,empty:bt.empty,each:bt.each,on:Ss,attr:is,attrTween:us,style:Os,styleTween:js,text:Us,textTween:qs,remove:Cs,tween:Za,delay:hs,duration:gs,ease:vs,easeVarying:ms,end:Vs,[Symbol.iterator]:bt[Symbol.iterator]};function Xs(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ys={time:null,delay:0,duration:250,ease:Xs};function Ks(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 Zs(e){var n,r;e instanceof Pt?(n=e._id,e=e._name):(n=ii(),(r=Ys).time=bn(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,a=0;a<o;++a)for(var s=i[a],l=s.length,u,c=0;c<l;++c)(u=s[c])&&Le(u,e,n,c,s,r||Ks(u,n));return new Pt(i,this._parents,e,n)}ce.prototype.interrupt=Xa;ce.prototype.transition=Zs;const ge=e=>()=>e;function Qs(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 Mt(e,n,r){this.k=e,this.x=n,this.y=r}Mt.prototype={constructor:Mt,scale:function(e){return e===1?this:new Mt(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Mt(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 Sn=new Mt(1,0,0);dt.prototype=Mt.prototype;function dt(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Sn;return e.__zoom}function Be(e){e.stopImmediatePropagation()}function Vt(e){e.preventDefault(),e.stopImmediatePropagation()}function Js(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tl(){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 Vn(){return this.__zoom||Sn}function el(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function nl(){return navigator.maxTouchPoints||"ontouchstart"in this}function rl(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 il(){var e=Js,n=tl,r=rl,i=el,o=nl,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,u=$a,c=fe("start","zoom","end"),h,f,d,p=500,_=150,m=0,y=10;function g(M){M.property("__zoom",Vn).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",E).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(M,z,A,O){var F=M.selection?M.selection():M;F.property("__zoom",Vn),M!==F?b(M,z,A,O):F.interrupt().each(function(){k(this,arguments).event(O).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},g.scaleBy=function(M,z,A,O){g.scaleTo(M,function(){var F=this.__zoom.k,L=typeof z=="function"?z.apply(this,arguments):z;return F*L},A,O)},g.scaleTo=function(M,z,A,O){g.transform(M,function(){var F=n.apply(this,arguments),L=this.__zoom,$=A==null?v(F):typeof A=="function"?A.apply(this,arguments):A,U=L.invert($),H=typeof z=="function"?z.apply(this,arguments):z;return r(x(w(L,H),$,U),F,s)},A,O)},g.translateBy=function(M,z,A,O){g.transform(M,function(){return r(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof A=="function"?A.apply(this,arguments):A),n.apply(this,arguments),s)},null,O)},g.translateTo=function(M,z,A,O,F){g.transform(M,function(){var L=n.apply(this,arguments),$=this.__zoom,U=O==null?v(L):typeof O=="function"?O.apply(this,arguments):O;return r(Sn.translate(U[0],U[1]).scale($.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof A=="function"?-A.apply(this,arguments):-A),L,s)},O,F)};function w(M,z){return z=Math.max(a[0],Math.min(a[1],z)),z===M.k?M:new Mt(z,M.x,M.y)}function x(M,z,A){var O=z[0]-A[0]*M.k,F=z[1]-A[1]*M.k;return O===M.x&&F===M.y?M:new Mt(M.k,O,F)}function v(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function b(M,z,A,O){M.on("start.zoom",function(){k(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(O).end()}).tween("zoom",function(){var F=this,L=arguments,$=k(F,L).event(O),U=n.apply(F,L),H=A==null?v(U):typeof A=="function"?A.apply(F,L):A,Y=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),X=F.__zoom,lt=typeof z=="function"?z.apply(F,L):z,yt=u(X.invert(H).concat(Y/X.k),lt.invert(H).concat(Y/lt.k));return function(ut){if(ut===1)ut=lt;else{var mt=yt(ut),We=Y/mt[2];ut=new Mt(We,H[0]-mt[0]*We,H[1]-mt[1]*We)}$.zoom(null,ut)}})}function k(M,z,A){return!A&&M.__zooming||new S(M,z)}function S(M,z){this.that=M,this.args=z,this.active=0,this.sourceEvent=null,this.extent=n.apply(M,z),this.taps=0}S.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,z){return this.mouse&&M!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var z=at(this.that).datum();c.call(M,this.that,new Qs(M,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),z)}};function C(M,...z){if(!e.apply(this,arguments))return;var A=k(this,z).event(M),O=this.__zoom,F=Math.max(a[0],Math.min(a[1],O.k*Math.pow(2,i.apply(this,arguments)))),L=pt(M);if(A.wheel)(A.mouse[0][0]!==L[0]||A.mouse[0][1]!==L[1])&&(A.mouse[1]=O.invert(A.mouse[0]=L)),clearTimeout(A.wheel);else{if(O.k===F)return;A.mouse=[L,O.invert(L)],xe(this),A.start()}Vt(M),A.wheel=setTimeout($,_),A.zoom("mouse",r(x(w(O,F),A.mouse[0],A.mouse[1]),A.extent,s));function $(){A.wheel=null,A.end()}}function N(M,...z){if(d||!e.apply(this,arguments))return;var A=M.currentTarget,O=k(this,z,!0).event(M),F=at(M.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",Y,!0),L=pt(M,A),$=M.clientX,U=M.clientY;Yr(M.view),Be(M),O.mouse=[L,this.__zoom.invert(L)],xe(this),O.start();function H(X){if(Vt(X),!O.moved){var lt=X.clientX-$,yt=X.clientY-U;O.moved=lt*lt+yt*yt>m}O.event(X).zoom("mouse",r(x(O.that.__zoom,O.mouse[0]=pt(X,A),O.mouse[1]),O.extent,s))}function Y(X){F.on("mousemove.zoom mouseup.zoom",null),Kr(X.view,O.moved),Vt(X),O.event(X).end()}}function E(M,...z){if(e.apply(this,arguments)){var A=this.__zoom,O=pt(M.changedTouches?M.changedTouches[0]:M,this),F=A.invert(O),L=A.k*(M.shiftKey?.5:2),$=r(x(w(A,L),O,F),n.apply(this,z),s);Vt(M),l>0?at(this).transition().duration(l).call(b,$,O,M):at(this).call(g.transform,$,O,M)}}function I(M,...z){if(e.apply(this,arguments)){var A=M.touches,O=A.length,F=k(this,z,M.changedTouches.length===O).event(M),L,$,U,H;for(Be(M),$=0;$<O;++$)U=A[$],H=pt(U,this),H=[H,this.__zoom.invert(H),U.identifier],F.touch0?!F.touch1&&F.touch0[2]!==H[2]&&(F.touch1=H,F.taps=0):(F.touch0=H,L=!0,F.taps=1+!!h);h&&(h=clearTimeout(h)),L&&(F.taps<2&&(f=H[0],h=setTimeout(function(){h=null},p)),xe(this),F.start())}}function R(M,...z){if(this.__zooming){var A=k(this,z).event(M),O=M.changedTouches,F=O.length,L,$,U,H;for(Vt(M),L=0;L<F;++L)$=O[L],U=pt($,this),A.touch0&&A.touch0[2]===$.identifier?A.touch0[0]=U:A.touch1&&A.touch1[2]===$.identifier&&(A.touch1[0]=U);if($=A.that.__zoom,A.touch1){var Y=A.touch0[0],X=A.touch0[1],lt=A.touch1[0],yt=A.touch1[1],ut=(ut=lt[0]-Y[0])*ut+(ut=lt[1]-Y[1])*ut,mt=(mt=yt[0]-X[0])*mt+(mt=yt[1]-X[1])*mt;$=w($,Math.sqrt(ut/mt)),U=[(Y[0]+lt[0])/2,(Y[1]+lt[1])/2],H=[(X[0]+yt[0])/2,(X[1]+yt[1])/2]}else if(A.touch0)U=A.touch0[0],H=A.touch0[1];else return;A.zoom("touch",r(x($,U,H),A.extent,s))}}function j(M,...z){if(this.__zooming){var A=k(this,z).event(M),O=M.changedTouches,F=O.length,L,$;for(Be(M),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),L=0;L<F;++L)$=O[L],A.touch0&&A.touch0[2]===$.identifier?delete A.touch0:A.touch1&&A.touch1[2]===$.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&($=pt($,this),Math.hypot(f[0]-$[0],f[1]-$[1])<y)){var U=at(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return g.wheelDelta=function(M){return arguments.length?(i=typeof M=="function"?M:ge(+M),g):i},g.filter=function(M){return arguments.length?(e=typeof M=="function"?M:ge(!!M),g):e},g.touchable=function(M){return arguments.length?(o=typeof M=="function"?M:ge(!!M),g):o},g.extent=function(M){return arguments.length?(n=typeof M=="function"?M:ge([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),g):n},g.scaleExtent=function(M){return arguments.length?(a[0]=+M[0],a[1]=+M[1],g):[a[0],a[1]]},g.translateExtent=function(M){return arguments.length?(s[0][0]=+M[0][0],s[1][0]=+M[1][0],s[0][1]=+M[0][1],s[1][1]=+M[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(M){return arguments.length?(r=M,g):r},g.duration=function(M){return arguments.length?(l=+M,g):l},g.interpolate=function(M){return arguments.length?(u=M,g):u},g.on=function(){var M=c.on.apply(c,arguments);return M===c?g:M},g.clickDistance=function(M){return arguments.length?(m=(M=+M)*M,g):Math.sqrt(m)},g.tapDistance=function(M){return arguments.length?(y=+M,g):y},g}function ol(e,n){let r=0;for(let i of e)(i=+i)&&(r+=i);return r}var al=typeof global=="object"&&global&&global.Object===Object&&global,sl=typeof self=="object"&&self&&self.Object===Object&&self,oi=al||sl||Function("return this")(),Pe=oi.Symbol,ai=Object.prototype,ll=ai.hasOwnProperty,ul=ai.toString,Gt=Pe?Pe.toStringTag:void 0;function cl(e){var n=ll.call(e,Gt),r=e[Gt];try{e[Gt]=void 0;var i=!0}catch{}var o=ul.call(e);return i&&(n?e[Gt]=r:delete e[Gt]),o}var fl=Object.prototype,hl=fl.toString;function dl(e){return hl.call(e)}var pl="[object Null]",gl="[object Undefined]",Gn=Pe?Pe.toStringTag:void 0;function _l(e){return e==null?e===void 0?gl:pl:Gn&&Gn in Object(e)?cl(e):dl(e)}function vl(e){return e!=null&&typeof e=="object"}var yl="[object Symbol]";function ml(e){return typeof e=="symbol"||vl(e)&&_l(e)==yl}var bl=/\s/;function wl(e){for(var n=e.length;n--&&bl.test(e.charAt(n)););return n}var xl=/^\s+/;function kl(e){return e&&e.slice(0,wl(e)+1).replace(xl,"")}function Te(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var Xn=NaN,Sl=/^[-+]0x[0-9a-f]+$/i,Ml=/^0b[01]+$/i,Cl=/^0o[0-7]+$/i,Al=parseInt;function Yn(e){if(typeof e=="number")return e;if(ml(e))return Xn;if(Te(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=Te(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=kl(e);var r=Ml.test(e);return r||Cl.test(e)?Al(e.slice(2),r?2:8):Sl.test(e)?Xn:+e}var Ve=function(){return oi.Date.now()},Pl="Expected a function",Tl=Math.max,El=Math.min;function si(e,n,r){var i,o,a,s,l,u,c=0,h=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(Pl);n=Yn(n)||0,Te(r)&&(h=!!r.leading,f="maxWait"in r,a=f?Tl(Yn(r.maxWait)||0,n):a,d="trailing"in r?!!r.trailing:d);function p(k){var S=i,C=o;return i=o=void 0,c=k,s=e.apply(C,S),s}function _(k){return c=k,l=setTimeout(g,n),h?p(k):s}function m(k){var S=k-u,C=k-c,N=n-S;return f?El(N,a-C):N}function y(k){var S=k-u,C=k-c;return u===void 0||S>=n||S<0||f&&C>=a}function g(){var k=Ve();if(y(k))return w(k);l=setTimeout(g,m(k))}function w(k){return l=void 0,d&&i?p(k):(i=o=void 0,s)}function x(){l!==void 0&&clearTimeout(l),c=0,i=u=o=l=void 0}function v(){return l===void 0?s:w(Ve())}function b(){var k=Ve(),S=y(k);if(i=arguments,o=this,u=k,S){if(l===void 0)return _(u);if(f)return clearTimeout(l),l=setTimeout(g,n),p(u)}return l===void 0&&(l=setTimeout(g,n)),s}return b.cancel=x,b.flush=v,b}var Nl="Expected a function";function zl(e,n,r){var i=!0,o=!0;if(typeof e!="function")throw new TypeError(Nl);return Te(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),si(e,n,{leading:i,maxWait:n,trailing:o})}var Rt=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-Rt.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?Rt.Bounce.In(e*2)*.5:Rt.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}}}}),ee=function(){return performance.now()},li=(function(){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,n)}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(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];(n=s._group)===null||n===void 0||n.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];a._group=void 0,delete this._tweens[a.getId()],delete this._tweensAddedDuringUpdate[a.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(n){return!n.isPlaying()})},e.prototype.update=function(n,r){n===void 0&&(n=ee()),r===void 0&&(r=!0);var i=Object.keys(this._tweens);if(i.length!==0)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&&this.remove(a)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),sn={Linear:function(e,n){var r=e.length-1,i=r*n,o=Math.floor(i),a=sn.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}}},ui=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),ln=new li,Kn=(function(){function e(n,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=Rt.Linear.None,this._interpolationFunction=sn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ui.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=n,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=ln,ln.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(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=ee()),r===void 0&&(r=!1),this._isPlaying)return this;if(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 l=n[s],u=Array.isArray(l),c=u?"array":typeof l,h=!u&&Array.isArray(i[s]);if(!(c==="undefined"||c==="function")){if(h){var f=i[s];if(f.length===0)continue;for(var d=[l],p=0,_=f.length;p<_;p+=1){var m=this._handleRelativeValue(l,f[p]);if(isNaN(m)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}d.push(m)}h&&(i[s]=d)}if((c==="object"||u)&&l&&!h){r[s]=u?[]:{};var y=l;for(var g in y)r[s][g]=y[g];o[s]=u?[]:{};var f=i[s];if(!this._isDynamic){var w={};for(var g in f)w[g]=f[g];i[s]=f=w}this._setupProperties(y,r[s],f,o[s],a)}else(typeof r[s]>"u"||a)&&(r[s]=l),u||(r[s]*=1),h?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._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(n){return n===void 0&&(n=ee()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this)},e.prototype.resume=function(n){return n===void 0&&(n=ee()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,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?(n.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var n;return(n=this._group)===null||n===void 0||n.remove(this),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=Rt.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=sn.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=ee()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var a;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(n,!0);else return!1;if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=n-this._startTime,l=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),u=this._duration+this._repeat*l,c=function(){if(i._duration===0||s>u)return 1;var m=Math.trunc(s/l),y=s-m*l,g=Math.min(y/i._duration,1);return g===0&&s===i._duration?1:g},h=c(),f=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||s>=this._duration)if(this._repeat>0){var d=Math.min(Math.trunc((s-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=d);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+=l*d,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var p=0,_=this._chainedTweens.length;p<_;p++)this._chainedTweens[p].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,l=i[a],u=Array.isArray(n[a]),c=Array.isArray(l),h=!u&&c;h?n[a]=this._interpolationFunction(l,o):typeof l=="object"&&l?this._updateProperties(n[a],s,l,o):(l=this._handleRelativeValue(s,l),typeof l=="number"&&(n[a]=s+(l-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.autoStartOnUpdate=!1,e})();ui.nextId;var _t=ln;_t.getAll.bind(_t);_t.removeAll.bind(_t);_t.add.bind(_t);_t.remove.bind(_t);_t.update.bind(_t);function Zn(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 Il(e){if(Array.isArray(e))return e}function Rl(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Ol(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function Dl(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function Fl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jl(e,n){return Il(e)||Dl(e,n)||Ll(e,n)||Fl()}function Ll(e,n){if(e){if(typeof e=="string")return Zn(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)?Zn(e,n):void 0}}var $l=Ol(function e(n,r){var i=r.default,o=i===void 0?null:i,a=r.triggerUpdate,s=a===void 0?!0:a,l=r.onChange,u=l===void 0?function(c,h){}:l;Rl(this,e),this.name=n,this.defaultVal=o,this.triggerUpdate=s,this.onChange=u});function Mn(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,l=e.aliases,u=l===void 0?{}:l,c=e.init,h=c===void 0?function(){}:c,f=e.update,d=f===void 0?function(){}:f,p=Object.keys(o).map(function(_){return new $l(_,o[_])});return function _(){for(var m=arguments.length,y=new Array(m),g=0;g<m;g++)y[g]=arguments[g];var w=!!(this instanceof _&&this.constructor),x=w?y.shift():void 0,v=y[0],b=v===void 0?{}:v,k=Object.assign({},r instanceof Function?r(b):r,{initialised:!1}),S={};function C(I){return N(I,b),E(),C}var N=function(R,j){h.call(C,R,k,j),k.initialised=!0},E=si(function(){k.initialised&&(d.call(C,k,S),S={})},1);return p.forEach(function(I){C[I.name]=R(I);function R(j){var M=j.name,z=j.triggerUpdate,A=z===void 0?!1:z,O=j.onChange,F=O===void 0?function(U,H){}:O,L=j.defaultVal,$=L===void 0?null:L;return function(U){var H=k[M];if(!arguments.length)return H;var Y=U===void 0?$:U;return k[M]=Y,F.call(C,Y,k,H),!S.hasOwnProperty(M)&&(S[M]=H),A&&E(),C}}}),Object.keys(s).forEach(function(I){C[I]=function(){for(var R,j=arguments.length,M=new Array(j),z=0;z<j;z++)M[z]=arguments[z];return(R=s[I]).call.apply(R,[C,k].concat(M))}}),Object.entries(u).forEach(function(I){var R=jl(I,2),j=R[0],M=R[1];return C[j]=C[M]}),C.resetProps=function(){return p.forEach(function(I){C[I.name](I.defaultVal)}),C},C.resetProps(),k._rerender=E,w&&x&&C(x),C}}var W=(function(e){return typeof e=="function"?e:typeof e=="string"?function(n){return n[e]}:function(n){return e}});function Ee(e){"@babel/helpers - typeof";return Ee=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},Ee(e)}var Ul=/^\s+/,Hl=/\s+$/;function D(e,n){if(e=e||"",n=n||{},e instanceof D)return e;if(!(this instanceof D))return new D(e,n);var r=Wl(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}D.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,l;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?l=o/12.92:l=Math.pow((o+.055)/1.055,2.4),.2126*a+.7152*s+.0722*l},setAlpha:function(n){return this._a=ci(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=Jn(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=Jn(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=Qn(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=Qn(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 tr(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return Gl(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(V(this._r,255)*100)+"%",g:Math.round(V(this._g,255)*100)+"%",b:Math.round(V(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(V(this._r,255)*100)+"%, "+Math.round(V(this._g,255)*100)+"%, "+Math.round(V(this._b,255)*100)+"%)":"rgba("+Math.round(V(this._r,255)*100)+"%, "+Math.round(V(this._g,255)*100)+"%, "+Math.round(V(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:ou[tr(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var r="#"+er(this._r,this._g,this._b,this._a),i=r,o=this._gradientType?"GradientType = 1, ":"";if(n){var a=D(n);i="#"+er(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 D(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(Zl,arguments)},brighten:function(){return this._applyModification(Ql,arguments)},darken:function(){return this._applyModification(Jl,arguments)},desaturate:function(){return this._applyModification(Xl,arguments)},saturate:function(){return this._applyModification(Yl,arguments)},greyscale:function(){return this._applyModification(Kl,arguments)},spin:function(){return this._applyModification(tu,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(ru,arguments)},complement:function(){return this._applyCombination(eu,arguments)},monochromatic:function(){return this._applyCombination(iu,arguments)},splitcomplement:function(){return this._applyCombination(nu,arguments)},triad:function(){return this._applyCombination(nr,[3])},tetrad:function(){return this._applyCombination(nr,[4])}};D.fromRatio=function(e,n){if(Ee(e)=="object"){var r={};for(var i in e)e.hasOwnProperty(i)&&(i==="a"?r[i]=e[i]:r[i]=ne(e[i]));e=r}return D(e,n)};function Wl(e){var n={r:0,g:0,b:0},r=1,i=null,o=null,a=null,s=!1,l=!1;return typeof e=="string"&&(e=uu(e)),Ee(e)=="object"&&(wt(e.r)&&wt(e.g)&&wt(e.b)?(n=ql(e.r,e.g,e.b),s=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):wt(e.h)&&wt(e.s)&&wt(e.v)?(i=ne(e.s),o=ne(e.v),n=Vl(e.h,i,o),s=!0,l="hsv"):wt(e.h)&&wt(e.s)&&wt(e.l)&&(i=ne(e.s),a=ne(e.l),n=Bl(e.h,i,a),s=!0,l="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=ci(r),{ok:s,format:e.format||l,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 ql(e,n,r){return{r:V(e,255)*255,g:V(n,255)*255,b:V(r,255)*255}}function Qn(e,n,r){e=V(e,255),n=V(n,255),r=V(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,l=(i+o)/2;if(i==o)a=s=0;else{var u=i-o;switch(s=l>.5?u/(2-i-o):u/(i+o),i){case e:a=(n-r)/u+(n<r?6:0);break;case n:a=(r-e)/u+2;break;case r:a=(e-n)/u+4;break}a/=6}return{h:a,s,l}}function Bl(e,n,r){var i,o,a;e=V(e,360),n=V(n,100),r=V(r,100);function s(c,h,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?c+(h-c)*6*f:f<1/2?h:f<2/3?c+(h-c)*(2/3-f)*6:c}if(n===0)i=o=a=r;else{var l=r<.5?r*(1+n):r+n-r*n,u=2*r-l;i=s(u,l,e+1/3),o=s(u,l,e),a=s(u,l,e-1/3)}return{r:i*255,g:o*255,b:a*255}}function Jn(e,n,r){e=V(e,255),n=V(n,255),r=V(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,l=i,u=i-o;if(s=i===0?0:u/i,i==o)a=0;else{switch(i){case e:a=(n-r)/u+(n<r?6:0);break;case n:a=(r-e)/u+2;break;case r:a=(e-n)/u+4;break}a/=6}return{h:a,s,v:l}}function Vl(e,n,r){e=V(e,360)*6,n=V(n,100),r=V(r,100);var i=Math.floor(e),o=e-i,a=r*(1-n),s=r*(1-o*n),l=r*(1-(1-o)*n),u=i%6,c=[r,s,a,a,l,r][u],h=[l,r,r,s,a,a][u],f=[a,a,l,r,r,s][u];return{r:c*255,g:h*255,b:f*255}}function tr(e,n,r,i){var o=[ft(Math.round(e).toString(16)),ft(Math.round(n).toString(16)),ft(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 Gl(e,n,r,i,o){var a=[ft(Math.round(e).toString(16)),ft(Math.round(n).toString(16)),ft(Math.round(r).toString(16)),ft(fi(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 er(e,n,r,i){var o=[ft(fi(i)),ft(Math.round(e).toString(16)),ft(Math.round(n).toString(16)),ft(Math.round(r).toString(16))];return o.join("")}D.equals=function(e,n){return!e||!n?!1:D(e).toRgbString()==D(n).toRgbString()};D.random=function(){return D.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Xl(e,n){n=n===0?0:n||10;var r=D(e).toHsl();return r.s-=n/100,r.s=$e(r.s),D(r)}function Yl(e,n){n=n===0?0:n||10;var r=D(e).toHsl();return r.s+=n/100,r.s=$e(r.s),D(r)}function Kl(e){return D(e).desaturate(100)}function Zl(e,n){n=n===0?0:n||10;var r=D(e).toHsl();return r.l+=n/100,r.l=$e(r.l),D(r)}function Ql(e,n){n=n===0?0:n||10;var r=D(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)))),D(r)}function Jl(e,n){n=n===0?0:n||10;var r=D(e).toHsl();return r.l-=n/100,r.l=$e(r.l),D(r)}function tu(e,n){var r=D(e).toHsl(),i=(r.h+n)%360;return r.h=i<0?360+i:i,D(r)}function eu(e){var n=D(e).toHsl();return n.h=(n.h+180)%360,D(n)}function nr(e,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var r=D(e).toHsl(),i=[D(e)],o=360/n,a=1;a<n;a++)i.push(D({h:(r.h+a*o)%360,s:r.s,l:r.l}));return i}function nu(e){var n=D(e).toHsl(),r=n.h;return[D(e),D({h:(r+72)%360,s:n.s,l:n.l}),D({h:(r+216)%360,s:n.s,l:n.l})]}function ru(e,n,r){n=n||6,r=r||30;var i=D(e).toHsl(),o=360/r,a=[D(e)];for(i.h=(i.h-(o*n>>1)+720)%360;--n;)i.h=(i.h+o)%360,a.push(D(i));return a}function iu(e,n){n=n||6;for(var r=D(e).toHsv(),i=r.h,o=r.s,a=r.v,s=[],l=1/n;n--;)s.push(D({h:i,s:o,v:a})),a=(a+l)%1;return s}D.mix=function(e,n,r){r=r===0?0:r||50;var i=D(e).toRgb(),o=D(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 D(s)};D.readability=function(e,n){var r=D(e),i=D(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};D.isReadable=function(e,n,r){var i=D.readability(e,n),o,a;switch(a=!1,o=cu(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};D.mostReadable=function(e,n,r){var i=null,o=0,a,s,l,u;r=r||{},s=r.includeFallbackColors,l=r.level,u=r.size;for(var c=0;c<n.length;c++)a=D.readability(e,n[c]),a>o&&(o=a,i=D(n[c]));return D.isReadable(e,i,{level:l,size:u})||!s?i:(r.includeFallbackColors=!1,D.mostReadable(e,["#fff","#000"],r))};var un=D.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"},ou=D.hexNames=au(un);function au(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function ci(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function V(e,n){su(e)&&(e="100%");var r=lu(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 $e(e){return Math.min(1,Math.max(0,e))}function et(e){return parseInt(e,16)}function su(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function lu(e){return typeof e=="string"&&e.indexOf("%")!=-1}function ft(e){return e.length==1?"0"+e:""+e}function ne(e){return e<=1&&(e=e*100+"%"),e}function fi(e){return Math.round(parseFloat(e)*255).toString(16)}function rr(e){return et(e)/255}var ct=(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 wt(e){return!!ct.CSS_UNIT.exec(e)}function uu(e){e=e.replace(Ul,"").replace(Hl,"").toLowerCase();var n=!1;if(un[e])e=un[e],n=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=ct.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=ct.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=ct.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=ct.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=ct.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=ct.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=ct.hex8.exec(e))?{r:et(r[1]),g:et(r[2]),b:et(r[3]),a:rr(r[4]),format:n?"name":"hex8"}:(r=ct.hex6.exec(e))?{r:et(r[1]),g:et(r[2]),b:et(r[3]),format:n?"name":"hex"}:(r=ct.hex4.exec(e))?{r:et(r[1]+""+r[1]),g:et(r[2]+""+r[2]),b:et(r[3]+""+r[3]),a:rr(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=ct.hex3.exec(e))?{r:et(r[1]+""+r[1]),g:et(r[2]+""+r[2]),b:et(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function cu(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 cn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function fu(e){if(Array.isArray(e))return cn(e)}function hi(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 hu(e,n){if(n.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function du(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function rt(e,n){return e.get(hi(e,n))}function ir(e,n,r){hu(e,n),n.set(e,r)}function or(e,n,r){return e.set(hi(e,n),r),r}function pu(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,bu(i.key),i)}}function gu(e,n,r){return n&&pu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _u(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vu(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yu(e){return fu(e)||_u(e)||wu(e)||vu()}function mu(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 bu(e){var n=mu(e,"string");return typeof n=="symbol"?n:n+""}function wu(e,n){if(e){if(typeof e=="string")return cn(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)?cn(e,n):void 0}}var xu=123,ku=function(n){return"#".concat(Math.min(n,Math.pow(2,24)).toString(16).padStart(6,"0"))},di=function(n,r,i){return(n<<16)+(r<<8)+i},Su=function(n){var r=D(n).toRgb(),i=r.r,o=r.g,a=r.b;return di(i,o,a)},ar=function(n,r){return n*xu%Math.pow(2,r)},Nt=new WeakMap,xt=new WeakMap,Mu=(function(){function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6;du(this,e),ir(this,Nt,void 0),ir(this,xt,void 0),or(xt,this,n),this.reset()}return gu(e,[{key:"reset",value:function(){or(Nt,this,["__reserved for background__"])}},{key:"register",value:function(r){if(rt(Nt,this).length>=Math.pow(2,24-rt(xt,this)))return null;var i=rt(Nt,this).length,o=ar(i,rt(xt,this)),a=ku(i+(o<<24-rt(xt,this)));return rt(Nt,this).push(r),a}},{key:"lookup",value:function(r){if(!r)return null;var i=typeof r=="string"?Su(r):di.apply(void 0,yu(r));if(!i)return null;var o=i&Math.pow(2,24-rt(xt,this))-1,a=i>>24-rt(xt,this)&Math.pow(2,rt(xt,this))-1;return ar(o,rt(xt,this))!==a||o>=rt(Nt,this).length?null:rt(Nt,this)[o]}}])})(),he,G,pi,gi,It,sr,_i,vi,yi,Cn,fn,hn,Ne={},ze=[],Cu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ue=Array.isArray;function gt(e,n){for(var r in n)e[r]=n[r];return e}function An(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Au(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?he.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 ie(e,s,i,o,null)}function ie(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??++pi,__i:-1,__u:0};return o==null&&G.vnode!=null&&G.vnode(a),a}function He(e){return e.children}function ke(e,n){this.props=e,this.context=n}function Wt(e,n){if(n==null)return e.__?Wt(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"?Wt(e):null}function Pu(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],o=[],a=gt({},n);a.__v=n.__v+1,G.vnode&&G.vnode(a),Pn(e.__P,a,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??Wt(n),!!(32&n.__u),o),a.__v=n.__v,a.__.__k[a.__i]=a,xi(i,a,o),n.__e=n.__=null,a.__e!=r&&mi(a)}}function mi(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}),mi(e)}function lr(e){(!e.__d&&(e.__d=!0)&&It.push(e)&&!Ie.__r++||sr!=G.debounceRendering)&&((sr=G.debounceRendering)||_i)(Ie)}function Ie(){for(var e,n=1;It.length;)It.length>n&&It.sort(vi),e=It.shift(),n=It.length,Pu(e);Ie.__r=0}function bi(e,n,r,i,o,a,s,l,u,c,h){var f,d,p,_,m,y,g,w=i&&i.__k||ze,x=n.length;for(u=Tu(r,n,w,u,x),f=0;f<x;f++)(p=r.__k[f])!=null&&(d=p.__i!=-1&&w[p.__i]||Ne,p.__i=f,y=Pn(e,p,d,o,a,s,l,u,c,h),_=p.__e,p.ref&&d.ref!=p.ref&&(d.ref&&Tn(d.ref,null,p),h.push(p.ref,p.__c||_,p)),m==null&&_!=null&&(m=_),(g=!!(4&p.__u))||d.__k===p.__k?u=wi(p,u,e,g):typeof p.type=="function"&&y!==void 0?u=y:_&&(u=_.nextSibling),p.__u&=-7);return r.__e=m,u}function Tu(e,n,r,i,o){var a,s,l,u,c,h=r.length,f=h,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]=ie(null,s,null,null,null):Ue(s)?s=e.__k[a]=ie(He,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[a]=ie(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[a]=s,u=a+d,s.__=e,s.__b=e.__b+1,l=null,(c=s.__i=Eu(s,r,u,f))!=-1&&(f--,(l=r[c])&&(l.__u|=2)),l==null||l.__v==null?(c==-1&&(o>h?d--:o<h&&d++),typeof s.type!="function"&&(s.__u|=4)):c!=u&&(c==u-1?d--:c==u+1?d++:(c>u?d--:d++,s.__u|=4))):e.__k[a]=null;if(f)for(a=0;a<h;a++)(l=r[a])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=Wt(l)),Si(l,l));return i}function wi(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=wi(o[a],n,r,i));return n}e.__e!=n&&(i&&(n&&e.type&&!n.parentNode&&(n=Wt(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function Eu(e,n,r,i){var o,a,s,l=e.key,u=e.type,c=n[r],h=c!=null&&(2&c.__u)==0;if(c===null&&l==null||h&&l==c.key&&u==c.type)return r;if(i>(h?1:0)){for(o=r-1,a=r+1;o>=0||a<n.length;)if((c=n[s=o>=0?o--:a++])!=null&&(2&c.__u)==0&&l==c.key&&u==c.type)return s}return-1}function ur(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||Cu.test(n)?r:r+"px"}function _e(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||ur(e.style,n,"");if(r)for(n in r)i&&r[n]==i[n]||ur(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")a=n!=(n=n.replace(yi,"$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.u=i.u:(r.u=Cn,e.addEventListener(n,a?hn:fn,a)):e.removeEventListener(n,a?hn:fn,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 cr(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=Cn++;else if(n.t<r.u)return;return r(G.event?G.event(n):n)}}}function Pn(e,n,r,i,o,a,s,l,u,c){var h,f,d,p,_,m,y,g,w,x,v,b,k,S,C,N=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),a=[l=n.__e=r.__e]),(h=G.__b)&&h(n);t:if(typeof N=="function")try{if(g=n.props,w="prototype"in N&&N.prototype.render,x=(h=N.contextType)&&i[h.__c],v=h?x?x.props.value:h.__:i,r.__c?y=(f=n.__c=r.__c).__=f.__E:(w?n.__c=f=new N(g,v):(n.__c=f=new ke(g,v),f.constructor=N,f.render=zu),x&&x.sub(f),f.state||(f.state={}),f.__n=i,d=f.__d=!0,f.__h=[],f._sb=[]),w&&f.__s==null&&(f.__s=f.state),w&&N.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=gt({},f.__s)),gt(f.__s,N.getDerivedStateFromProps(g,f.__s))),p=f.props,_=f.state,f.__v=n,d)w&&N.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),w&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(w&&N.getDerivedStateFromProps==null&&g!==p&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(g,v),n.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(g,f.__s,v)===!1){n.__v!=r.__v&&(f.props=g,f.state=f.__s,f.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(E){E&&(E.__=n)}),ze.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break t}f.componentWillUpdate!=null&&f.componentWillUpdate(g,f.__s,v),w&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(p,_,m)})}if(f.context=v,f.props=g,f.__P=e,f.__e=!1,b=G.__r,k=0,w)f.state=f.__s,f.__d=!1,b&&b(n),h=f.render(f.props,f.state,f.context),ze.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,b&&b(n),h=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++k<25);f.state=f.__s,f.getChildContext!=null&&(i=gt(gt({},i),f.getChildContext())),w&&!d&&f.getSnapshotBeforeUpdate!=null&&(m=f.getSnapshotBeforeUpdate(p,_)),S=h!=null&&h.type===He&&h.key==null?ki(h.props.children):h,l=bi(e,Ue(S)?S:[S],n,r,i,o,a,s,l,u,c),f.base=n.__e,n.__u&=-161,f.__h.length&&s.push(f),y&&(f.__E=f.__=null)}catch(E){if(n.__v=null,u||a!=null)if(E.then){for(n.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,n.__e=l}else{for(C=a.length;C--;)An(a[C]);dn(n)}else n.__e=r.__e,n.__k=r.__k,E.then||dn(n);G.__e(E,n,r)}else a==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):l=n.__e=Nu(r.__e,n,r,i,o,a,s,u,c);return(h=G.diffed)&&h(n),128&n.__u?void 0:l}function dn(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(dn))}function xi(e,n,r){for(var i=0;i<r.length;i++)Tn(r[i],r[++i],r[++i]);G.__c&&G.__c(n,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){G.__e(a,o.__v)}})}function ki(e){return typeof e!="object"||e==null||e.__b>0?e:Ue(e)?e.map(ki):gt({},e)}function Nu(e,n,r,i,o,a,s,l,u){var c,h,f,d,p,_,m,y=r.props||Ne,g=n.props,w=n.type;if(w=="svg"?o="http://www.w3.org/2000/svg":w=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(c=0;c<a.length;c++)if((p=a[c])&&"setAttribute"in p==!!w&&(w?p.localName==w:p.nodeType==3)){e=p,a[c]=null;break}}if(e==null){if(w==null)return document.createTextNode(g);e=document.createElementNS(o,w,g.is&&g),l&&(G.__m&&G.__m(n,a),l=!1),a=null}if(w==null)y===g||l&&e.data==g||(e.data=g);else{if(a=a&&he.call(e.childNodes),!l&&a!=null)for(y={},c=0;c<e.attributes.length;c++)y[(p=e.attributes[c]).name]=p.value;for(c in y)p=y[c],c=="dangerouslySetInnerHTML"?f=p:c=="children"||c in g||c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g||_e(e,c,null,p,o);for(c in g)p=g[c],c=="children"?d=p:c=="dangerouslySetInnerHTML"?h=p:c=="value"?_=p:c=="checked"?m=p:l&&typeof p!="function"||y[c]===p||_e(e,c,p,y[c],o);if(h)l||f&&(h.__html==f.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),n.__k=[];else if(f&&(e.innerHTML=""),bi(n.type=="template"?e.content:e,Ue(d)?d:[d],n,r,i,w=="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,s,a?a[0]:r.__k&&Wt(r,0),l,u),a!=null)for(c=a.length;c--;)An(a[c]);l||(c="value",w=="progress"&&_==null?e.removeAttribute("value"):_!=null&&(_!==e[c]||w=="progress"&&!_||w=="option"&&_!=y[c])&&_e(e,c,_,y[c],o),c="checked",m!=null&&m!=e[c]&&_e(e,c,m,y[c],o))}return e}function Tn(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){G.__e(o,r)}}function Si(e,n,r){var i,o;if(G.unmount&&G.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Tn(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(a){G.__e(a,n)}i.base=i.__P=null}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&Si(i[o],n,r||typeof e.type!="function");r||An(e.__e),e.__c=e.__=e.__e=void 0}function zu(e,n,r){return this.constructor(e,r)}function Iu(e,n,r){var i,o,a,s;n==document&&(n=document.documentElement),G.__&&G.__(e,n),o=(i=!1)?null:n.__k,a=[],s=[],Pn(n,e=n.__k=Au(He,null,[e]),o||Ne,Ne,n.namespaceURI,o?null:n.firstChild?he.call(n.childNodes):null,a,o?o.__e:n.firstChild,i,s),xi(a,e,s)}function Mi(e,n,r){var i,o,a,s,l=gt({},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]:l[a]=n[a]===void 0&&s!=null?s[a]:n[a];return arguments.length>2&&(l.children=arguments.length>3?he.call(arguments,2):r),ie(e.type,l,i||e.key,o||e.ref,null)}he=ze.slice,G={__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(l){e=l}throw e}},pi=0,gi=function(e){return e!=null&&e.constructor===void 0},ke.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=gt({},this.state),typeof e=="function"&&(e=e(gt({},r),this.props)),e&>(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),lr(this))},ke.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),lr(this))},ke.prototype.render=He,It=[],_i=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,vi=function(e,n){return e.__v.__b-n.__v.__b},Ie.__r=0,yi=/(PointerCapture)$|Capture$/i,Cn=0,fn=cr(!1),hn=cr(!0);function fr(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 Ru(e){if(Array.isArray(e))return e}function Ou(e,n,r){return(n=Uu(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Du(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function Fu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
5
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hr(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 ju(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?hr(Object(r),!0).forEach(function(i){Ou(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hr(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Lu(e,n){return Ru(e)||Du(e,n)||Hu(e,n)||Fu()}function $u(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 Uu(e){var n=$u(e,"string");return typeof n=="symbol"?n:n+""}function Re(e){"@babel/helpers - typeof";return Re=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},Re(e)}function Hu(e,n){if(e){if(typeof e=="string")return fr(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)?fr(e,n):void 0}}var pn=function(n){if(Re(n)!=="object")return n;var r=Mi(n);if(r.props){var i;r.props=ju({},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(pn):pn(r.props.children))}return r},Wu=function(n){return gi(Mi(n))},qu=function(n,r){delete r.__k,Iu(pn(n),r)};function Bu(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 Vu=`.float-tooltip-kap {
|
|
6
|
+
position: absolute;
|
|
7
|
+
width: max-content; /* prevent shrinking near right edge */
|
|
8
|
+
max-width: max(50%, 150px);
|
|
9
|
+
padding: 3px 5px;
|
|
10
|
+
border-radius: 3px;
|
|
11
|
+
font: 12px sans-serif;
|
|
12
|
+
color: #eee;
|
|
13
|
+
background: rgba(0,0,0,0.6);
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
}
|
|
16
|
+
`;Bu(Vu);var Gu=Mn({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&&Re(n)==="object"&&!!n.node&&typeof n.node=="function",l=at(s?n.node():n);l.style("position")==="static"&&l.style("position","relative"),r.tooltipEl=l.append("div").attr("class","float-tooltip-kap"),Object.entries(a).forEach(function(c){var h=Lu(c,2),f=h[0],d=h[1];return r.tooltipEl.style(f,d)}),r.tooltipEl.style("left","-10000px").style("display","none");var u="tooltip-".concat(Math.round(Math.random()*1e12));r.mouseInside=!1,l.on("mousemove.".concat(u),function(c){r.mouseInside=!0;var h=pt(c),f=l.node(),d=f.offsetWidth,p=f.offsetHeight,_=[r.offsetX===null||r.offsetX===void 0?"-".concat(h[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-h[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",h[0]+"px").style("top",h[1]+"px").style("transform","translate(".concat(_.join(","),")")),r.content&&r.tooltipEl.style("display","inline")}),l.on("mouseover.".concat(u),function(){r.mouseInside=!0,r.content&&r.tooltipEl.style("display","inline")}),l.on("mouseout.".concat(u),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):Wu(n.content)?(n.tooltipEl.text(""),qu(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 Xu(e,n,r){var i,o=1;e==null&&(e=0),n==null&&(n=0),r==null&&(r=0);function a(){var s,l=i.length,u,c=0,h=0,f=0;for(s=0;s<l;++s)u=i[s],c+=u.x||0,h+=u.y||0,f+=u.z||0;for(c=(c/l-e)*o,h=(h/l-n)*o,f=(f/l-r)*o,s=0;s<l;++s)u=i[s],c&&(u.x-=c),h&&(u.y-=h),f&&(u.z-=f)}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 Yu(e){const n=+this._x.call(null,e);return Ci(this.cover(n),n,e)}function Ci(e,n,r){if(isNaN(n))return e;var i,o=e._root,a={data:r},s=e._x0,l=e._x1,u,c,h,f,d;if(!o)return e._root=a,e;for(;o.length;)if((h=n>=(u=(s+l)/2))?s=u:l=u,i=o,!(o=o[f=+h]))return i[f]=a,e;if(c=+e._x.call(null,o.data),n===c)return a.next=o,i?i[f]=a:e._root=a,e;do i=i?i[f]=new Array(2):e._root=new Array(2),(h=n>=(u=(s+l)/2))?s=u:l=u;while((f=+h)==(d=+(c>=u)));return i[d]=o,i[f]=a,e}function Ku(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)Ci(this,r[a],e[a]);return this}function Zu(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 Qu(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Ju(e){return arguments.length?this.cover(+e[0][0]).cover(+e[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function At(e,n,r){this.node=e,this.x0=n,this.x1=r}function tc(e,n){var r,i=this._x0,o,a,s=this._x1,l=[],u=this._root,c,h;for(u&&l.push(new At(u,i,s)),n==null?n=1/0:(i=e-n,s=e+n);c=l.pop();)if(!(!(u=c.node)||(o=c.x0)>s||(a=c.x1)<i))if(u.length){var f=(o+a)/2;l.push(new At(u[1],f,a),new At(u[0],o,f)),(h=+(e>=f))&&(c=l[l.length-1],l[l.length-1]=l[l.length-1-h],l[l.length-1-h]=c)}else{var d=Math.abs(e-+this._x.call(null,u.data));d<n&&(n=d,i=e-d,s=e+d,r=u.data)}return r}function ec(e){if(isNaN(u=+this._x.call(null,e)))return this;var n,r=this._root,i,o,a,s=this._x0,l=this._x1,u,c,h,f,d;if(!r)return this;if(r.length)for(;;){if((h=u>=(c=(s+l)/2))?s=c:l=c,n=r,!(r=r[f=+h]))return this;if(!r.length)break;n[f+1&1]&&(i=n,d=f)}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[f]=a:delete n[f],(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 nc(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function rc(){return this._root}function ic(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function oc(e){var n=[],r,i=this._root,o,a,s;for(i&&n.push(new At(i,this._x0,this._x1));r=n.pop();)if(!e(i=r.node,a=r.x0,s=r.x1)&&i.length){var l=(a+s)/2;(o=i[1])&&n.push(new At(o,l,s)),(o=i[0])&&n.push(new At(o,a,l))}return this}function ac(e){var n=[],r=[],i;for(this._root&&n.push(new At(this._root,this._x0,this._x1));i=n.pop();){var o=i.node;if(o.length){var a,s=i.x0,l=i.x1,u=(s+l)/2;(a=o[0])&&n.push(new At(a,s,u)),(a=o[1])&&n.push(new At(a,u,l))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.x1);return this}function sc(e){return e[0]}function lc(e){return arguments.length?(this._x=e,this):this._x}function Ai(e,n){var r=new En(n??sc,NaN,NaN);return e==null?r:r.addAll(e)}function En(e,n,r){this._x=e,this._x0=n,this._x1=r,this._root=void 0}function dr(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var tt=Ai.prototype=En.prototype;tt.copy=function(){var e=new En(this._x,this._x0,this._x1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=dr(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]=dr(i));return e};tt.add=Yu;tt.addAll=Ku;tt.cover=Zu;tt.data=Qu;tt.extent=Ju;tt.find=tc;tt.remove=ec;tt.removeAll=nc;tt.root=rc;tt.size=ic;tt.visit=oc;tt.visitAfter=ac;tt.x=lc;function uc(e){const n=+this._x.call(null,e),r=+this._y.call(null,e);return Pi(this.cover(n,r),n,r,e)}function Pi(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var o,a=e._root,s={data:i},l=e._x0,u=e._y0,c=e._x1,h=e._y1,f,d,p,_,m,y,g,w;if(!a)return e._root=s,e;for(;a.length;)if((m=n>=(f=(l+c)/2))?l=f:c=f,(y=r>=(d=(u+h)/2))?u=d:h=d,o=a,!(a=a[g=y<<1|m]))return o[g]=s,e;if(p=+e._x.call(null,a.data),_=+e._y.call(null,a.data),n===p&&r===_)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),(m=n>=(f=(l+c)/2))?l=f:c=f,(y=r>=(d=(u+h)/2))?u=d:h=d;while((g=y<<1|m)===(w=(_>=d)<<1|p>=f));return o[w]=a,o[g]=s,e}function cc(e){var n,r,i=e.length,o,a,s=new Array(i),l=new Array(i),u=1/0,c=1/0,h=-1/0,f=-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,l[r]=a,o<u&&(u=o),o>h&&(h=o),a<c&&(c=a),a>f&&(f=a));if(u>h||c>f)return this;for(this.cover(u,c).cover(h,f),r=0;r<i;++r)Pi(this,s[r],l[r],e[r]);return this}function fc(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,l=this._root,u,c;r>e||e>=o||i>n||n>=a;)switch(c=(n<i)<<1|e<r,u=new Array(4),u[c]=l,l=u,s*=2,c){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=l)}return this._x0=r,this._y0=i,this._x1=o,this._y1=a,this}function hc(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function dc(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 Q(e,n,r,i,o){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=o}function pc(e,n,r){var i,o=this._x0,a=this._y0,s,l,u,c,h=this._x1,f=this._y1,d=[],p=this._root,_,m;for(p&&d.push(new Q(p,o,a,h,f)),r==null?r=1/0:(o=e-r,a=n-r,h=e+r,f=n+r,r*=r);_=d.pop();)if(!(!(p=_.node)||(s=_.x0)>h||(l=_.y0)>f||(u=_.x1)<o||(c=_.y1)<a))if(p.length){var y=(s+u)/2,g=(l+c)/2;d.push(new Q(p[3],y,g,u,c),new Q(p[2],s,g,y,c),new Q(p[1],y,l,u,g),new Q(p[0],s,l,y,g)),(m=(n>=g)<<1|e>=y)&&(_=d[d.length-1],d[d.length-1]=d[d.length-1-m],d[d.length-1-m]=_)}else{var w=e-+this._x.call(null,p.data),x=n-+this._y.call(null,p.data),v=w*w+x*x;if(v<r){var b=Math.sqrt(r=v);o=e-b,a=n-b,h=e+b,f=n+b,i=p.data}}return i}function gc(e){if(isNaN(h=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var n,r=this._root,i,o,a,s=this._x0,l=this._y0,u=this._x1,c=this._y1,h,f,d,p,_,m,y,g;if(!r)return this;if(r.length)for(;;){if((_=h>=(d=(s+u)/2))?s=d:u=d,(m=f>=(p=(l+c)/2))?l=p:c=p,n=r,!(r=r[y=m<<1|_]))return this;if(!r.length)break;(n[y+1&3]||n[y+2&3]||n[y+3&3])&&(i=n,g=y)}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[y]=a:delete n[y],(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 _c(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function vc(){return this._root}function yc(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function mc(e){var n=[],r,i=this._root,o,a,s,l,u;for(i&&n.push(new Q(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,a=r.x0,s=r.y0,l=r.x1,u=r.y1)&&i.length){var c=(a+l)/2,h=(s+u)/2;(o=i[3])&&n.push(new Q(o,c,h,l,u)),(o=i[2])&&n.push(new Q(o,a,h,c,u)),(o=i[1])&&n.push(new Q(o,c,s,l,h)),(o=i[0])&&n.push(new Q(o,a,s,c,h))}return this}function bc(e){var n=[],r=[],i;for(this._root&&n.push(new Q(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,l=i.y0,u=i.x1,c=i.y1,h=(s+u)/2,f=(l+c)/2;(a=o[0])&&n.push(new Q(a,s,l,h,f)),(a=o[1])&&n.push(new Q(a,h,l,u,f)),(a=o[2])&&n.push(new Q(a,s,f,h,c)),(a=o[3])&&n.push(new Q(a,h,f,u,c))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function wc(e){return e[0]}function xc(e){return arguments.length?(this._x=e,this):this._x}function kc(e){return e[1]}function Sc(e){return arguments.length?(this._y=e,this):this._y}function Ti(e,n,r){var i=new Nn(n??wc,r??kc,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Nn(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 pr(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var J=Ti.prototype=Nn.prototype;J.copy=function(){var e=new Nn(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=pr(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]=pr(i));return e};J.add=uc;J.addAll=cc;J.cover=fc;J.data=hc;J.extent=dc;J.find=pc;J.remove=gc;J.removeAll=_c;J.root=vc;J.size=yc;J.visit=mc;J.visitAfter=bc;J.x=xc;J.y=Sc;function Mc(e){const n=+this._x.call(null,e),r=+this._y.call(null,e),i=+this._z.call(null,e);return Ei(this.cover(n,r,i),n,r,i,e)}function Ei(e,n,r,i,o){if(isNaN(n)||isNaN(r)||isNaN(i))return e;var a,s=e._root,l={data:o},u=e._x0,c=e._y0,h=e._z0,f=e._x1,d=e._y1,p=e._z1,_,m,y,g,w,x,v,b,k,S,C;if(!s)return e._root=l,e;for(;s.length;)if((v=n>=(_=(u+f)/2))?u=_:f=_,(b=r>=(m=(c+d)/2))?c=m:d=m,(k=i>=(y=(h+p)/2))?h=y:p=y,a=s,!(s=s[S=k<<2|b<<1|v]))return a[S]=l,e;if(g=+e._x.call(null,s.data),w=+e._y.call(null,s.data),x=+e._z.call(null,s.data),n===g&&r===w&&i===x)return l.next=s,a?a[S]=l:e._root=l,e;do a=a?a[S]=new Array(8):e._root=new Array(8),(v=n>=(_=(u+f)/2))?u=_:f=_,(b=r>=(m=(c+d)/2))?c=m:d=m,(k=i>=(y=(h+p)/2))?h=y:p=y;while((S=k<<2|b<<1|v)===(C=(x>=y)<<2|(w>=m)<<1|g>=_));return a[C]=s,a[S]=l,e}function Cc(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,l=1/0,u=-1/0,c=-1/0,h=-1/0;for(let f=0,d,p,_,m;f<n;++f)isNaN(p=+this._x.call(null,d=e[f]))||isNaN(_=+this._y.call(null,d))||isNaN(m=+this._z.call(null,d))||(r[f]=p,i[f]=_,o[f]=m,p<a&&(a=p),p>u&&(u=p),_<s&&(s=_),_>c&&(c=_),m<l&&(l=m),m>h&&(h=m));if(a>u||s>c||l>h)return this;this.cover(a,s,l).cover(u,c,h);for(let f=0;f<n;++f)Ei(this,r[f],i[f],o[f],e[f]);return this}function Ac(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,l=this._y1,u=this._z1;if(isNaN(i))s=(i=Math.floor(e))+1,l=(o=Math.floor(n))+1,u=(a=Math.floor(r))+1;else{for(var c=s-i||1,h=this._root,f,d;i>e||e>=s||o>n||n>=l||a>r||r>=u;)switch(d=(r<a)<<2|(n<o)<<1|e<i,f=new Array(8),f[d]=h,h=f,c*=2,d){case 0:s=i+c,l=o+c,u=a+c;break;case 1:i=s-c,l=o+c,u=a+c;break;case 2:s=i+c,o=l-c,u=a+c;break;case 3:i=s-c,o=l-c,u=a+c;break;case 4:s=i+c,l=o+c,a=u-c;break;case 5:i=s-c,l=o+c,a=u-c;break;case 6:s=i+c,o=l-c,a=u-c;break;case 7:i=s-c,o=l-c,a=u-c;break}this._root&&this._root.length&&(this._root=h)}return this._x0=i,this._y0=o,this._z0=a,this._x1=s,this._y1=l,this._z1=u,this}function Pc(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Tc(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 q(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 Ec(e,n,r,i){var o,a=this._x0,s=this._y0,l=this._z0,u,c,h,f,d,p,_=this._x1,m=this._y1,y=this._z1,g=[],w=this._root,x,v;for(w&&g.push(new q(w,a,s,l,_,m,y)),i==null?i=1/0:(a=e-i,s=n-i,l=r-i,_=e+i,m=n+i,y=r+i,i*=i);x=g.pop();)if(!(!(w=x.node)||(u=x.x0)>_||(c=x.y0)>m||(h=x.z0)>y||(f=x.x1)<a||(d=x.y1)<s||(p=x.z1)<l))if(w.length){var b=(u+f)/2,k=(c+d)/2,S=(h+p)/2;g.push(new q(w[7],b,k,S,f,d,p),new q(w[6],u,k,S,b,d,p),new q(w[5],b,c,S,f,k,p),new q(w[4],u,c,S,b,k,p),new q(w[3],b,k,h,f,d,S),new q(w[2],u,k,h,b,d,S),new q(w[1],b,c,h,f,k,S),new q(w[0],u,c,h,b,k,S)),(v=(r>=S)<<2|(n>=k)<<1|e>=b)&&(x=g[g.length-1],g[g.length-1]=g[g.length-1-v],g[g.length-1-v]=x)}else{var C=e-+this._x.call(null,w.data),N=n-+this._y.call(null,w.data),E=r-+this._z.call(null,w.data),I=C*C+N*N+E*E;if(I<i){var R=Math.sqrt(i=I);a=e-R,s=n-R,l=r-R,_=e+R,m=n+R,y=r+R,o=w.data}}return o}const Nc=(e,n,r,i,o,a)=>Math.sqrt((e-i)**2+(n-o)**2+(r-a)**2);function zc(e,n,r,i){const o=[],a=e-i,s=n-i,l=r-i,u=e+i,c=n+i,h=r+i;return this.visit((f,d,p,_,m,y,g)=>{if(!f.length)do{const w=f.data;Nc(e,n,r,this._x(w),this._y(w),this._z(w))<=i&&o.push(w)}while(f=f.next);return d>u||p>c||_>h||m<a||y<s||g<l}),o}function Ic(e){if(isNaN(d=+this._x.call(null,e))||isNaN(p=+this._y.call(null,e))||isNaN(_=+this._z.call(null,e)))return this;var n,r=this._root,i,o,a,s=this._x0,l=this._y0,u=this._z0,c=this._x1,h=this._y1,f=this._z1,d,p,_,m,y,g,w,x,v,b,k;if(!r)return this;if(r.length)for(;;){if((w=d>=(m=(s+c)/2))?s=m:c=m,(x=p>=(y=(l+h)/2))?l=y:h=y,(v=_>=(g=(u+f)/2))?u=g:f=g,n=r,!(r=r[b=v<<2|x<<1|w]))return this;if(!r.length)break;(n[b+1&7]||n[b+2&7]||n[b+3&7]||n[b+4&7]||n[b+5&7]||n[b+6&7]||n[b+7&7])&&(i=n,k=b)}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[b]=a:delete n[b],(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[k]=r:this._root=r),this):(this._root=a,this)}function Rc(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function Oc(){return this._root}function Dc(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function Fc(e){var n=[],r,i=this._root,o,a,s,l,u,c,h;for(i&&n.push(new q(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,l=r.z0,u=r.x1,c=r.y1,h=r.z1)&&i.length){var f=(a+u)/2,d=(s+c)/2,p=(l+h)/2;(o=i[7])&&n.push(new q(o,f,d,p,u,c,h)),(o=i[6])&&n.push(new q(o,a,d,p,f,c,h)),(o=i[5])&&n.push(new q(o,f,s,p,u,d,h)),(o=i[4])&&n.push(new q(o,a,s,p,f,d,h)),(o=i[3])&&n.push(new q(o,f,d,l,u,c,p)),(o=i[2])&&n.push(new q(o,a,d,l,f,c,p)),(o=i[1])&&n.push(new q(o,f,s,l,u,d,p)),(o=i[0])&&n.push(new q(o,a,s,l,f,d,p))}return this}function jc(e){var n=[],r=[],i;for(this._root&&n.push(new q(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,l=i.y0,u=i.z0,c=i.x1,h=i.y1,f=i.z1,d=(s+c)/2,p=(l+h)/2,_=(u+f)/2;(a=o[0])&&n.push(new q(a,s,l,u,d,p,_)),(a=o[1])&&n.push(new q(a,d,l,u,c,p,_)),(a=o[2])&&n.push(new q(a,s,p,u,d,h,_)),(a=o[3])&&n.push(new q(a,d,p,u,c,h,_)),(a=o[4])&&n.push(new q(a,s,l,_,d,p,f)),(a=o[5])&&n.push(new q(a,d,l,_,c,p,f)),(a=o[6])&&n.push(new q(a,s,p,_,d,h,f)),(a=o[7])&&n.push(new q(a,d,p,_,c,h,f))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.z0,i.x1,i.y1,i.z1);return this}function Lc(e){return e[0]}function $c(e){return arguments.length?(this._x=e,this):this._x}function Uc(e){return e[1]}function Hc(e){return arguments.length?(this._y=e,this):this._y}function Wc(e){return e[2]}function qc(e){return arguments.length?(this._z=e,this):this._z}function Ni(e,n,r,i){var o=new zn(n??Lc,r??Uc,i??Wc,NaN,NaN,NaN,NaN,NaN,NaN);return e==null?o:o.addAll(e)}function zn(e,n,r,i,o,a,s,l,u){this._x=e,this._y=n,this._z=r,this._x0=i,this._y0=o,this._z0=a,this._x1=s,this._y1=l,this._z1=u,this._root=void 0}function gr(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var K=Ni.prototype=zn.prototype;K.copy=function(){var e=new zn(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=gr(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]=gr(i));return e};K.add=Mc;K.addAll=Cc;K.cover=Ac;K.data=Pc;K.extent=Tc;K.find=Ec;K.findAllWithinRadius=zc;K.remove=Ic;K.removeAll=Rc;K.root=Oc;K.size=Dc;K.visit=Fc;K.visitAfter=jc;K.x=$c;K.y=Hc;K.z=qc;function Ct(e){return function(){return e}}function St(e){return(e()-.5)*1e-6}function Bc(e){return e.index}function _r(e,n){var r=e.get(n);if(!r)throw new Error("node not found: "+n);return r}function Vc(e){var n=Bc,r=d,i,o=Ct(30),a,s,l,u,c,h,f=1;e==null&&(e=[]);function d(g){return 1/Math.min(u[g.source.index],u[g.target.index])}function p(g){for(var w=0,x=e.length;w<f;++w)for(var v=0,b,k,S,C=0,N=0,E=0,I,R;v<x;++v)b=e[v],k=b.source,S=b.target,C=S.x+S.vx-k.x-k.vx||St(h),l>1&&(N=S.y+S.vy-k.y-k.vy||St(h)),l>2&&(E=S.z+S.vz-k.z-k.vz||St(h)),I=Math.sqrt(C*C+N*N+E*E),I=(I-a[v])/I*g*i[v],C*=I,N*=I,E*=I,S.vx-=C*(R=c[v]),l>1&&(S.vy-=N*R),l>2&&(S.vz-=E*R),k.vx+=C*(R=1-R),l>1&&(k.vy+=N*R),l>2&&(k.vz+=E*R)}function _(){if(s){var g,w=s.length,x=e.length,v=new Map(s.map((k,S)=>[n(k,S,s),k])),b;for(g=0,u=new Array(w);g<x;++g)b=e[g],b.index=g,typeof b.source!="object"&&(b.source=_r(v,b.source)),typeof b.target!="object"&&(b.target=_r(v,b.target)),u[b.source.index]=(u[b.source.index]||0)+1,u[b.target.index]=(u[b.target.index]||0)+1;for(g=0,c=new Array(x);g<x;++g)b=e[g],c[g]=u[b.source.index]/(u[b.source.index]+u[b.target.index]);i=new Array(x),m(),a=new Array(x),y()}}function m(){if(s)for(var g=0,w=e.length;g<w;++g)i[g]=+r(e[g],g,e)}function y(){if(s)for(var g=0,w=e.length;g<w;++g)a[g]=+o(e[g],g,e)}return p.initialize=function(g,...w){s=g,h=w.find(x=>typeof x=="function")||Math.random,l=w.find(x=>[1,2,3].includes(x))||2,_()},p.links=function(g){return arguments.length?(e=g,_(),p):e},p.id=function(g){return arguments.length?(n=g,p):n},p.iterations=function(g){return arguments.length?(f=+g,p):f},p.strength=function(g){return arguments.length?(r=typeof g=="function"?g:Ct(+g),m(),p):r},p.distance=function(g){return arguments.length?(o=typeof g=="function"?g:Ct(+g),y(),p):o},p}const Gc=1664525,Xc=1013904223,vr=4294967296;function Yc(){let e=1;return()=>(e=(Gc*e+Xc)%vr)/vr}var yr=3;function Ge(e){return e.x}function mr(e){return e.y}function Kc(e){return e.z}var Zc=10,Qc=Math.PI*(3-Math.sqrt(5)),Jc=Math.PI*20/(9+Math.sqrt(221));function tf(e,n){n=n||2;var r=Math.min(yr,Math.max(1,Math.round(n))),i,o=1,a=.001,s=1-Math.pow(a,1/300),l=0,u=.6,c=new Map,h=wn(p),f=fe("tick","end"),d=Yc();e==null&&(e=[]);function p(){_(),f.call("tick",i),o<a&&(h.stop(),f.call("end",i))}function _(g){var w,x=e.length,v;g===void 0&&(g=1);for(var b=0;b<g;++b)for(o+=(l-o)*s,c.forEach(function(k){k(o)}),w=0;w<x;++w)v=e[w],v.fx==null?v.x+=v.vx*=u:(v.x=v.fx,v.vx=0),r>1&&(v.fy==null?v.y+=v.vy*=u:(v.y=v.fy,v.vy=0)),r>2&&(v.fz==null?v.z+=v.vz*=u:(v.z=v.fz,v.vz=0));return i}function m(){for(var g=0,w=e.length,x;g<w;++g){if(x=e[g],x.index=g,x.fx!=null&&(x.x=x.fx),x.fy!=null&&(x.y=x.fy),x.fz!=null&&(x.z=x.fz),isNaN(x.x)||r>1&&isNaN(x.y)||r>2&&isNaN(x.z)){var v=Zc*(r>2?Math.cbrt(.5+g):r>1?Math.sqrt(.5+g):g),b=g*Qc,k=g*Jc;r===1?x.x=v:r===2?(x.x=v*Math.cos(b),x.y=v*Math.sin(b)):(x.x=v*Math.sin(b)*Math.cos(k),x.y=v*Math.cos(b),x.z=v*Math.sin(b)*Math.sin(k))}(isNaN(x.vx)||r>1&&isNaN(x.vy)||r>2&&isNaN(x.vz))&&(x.vx=0,r>1&&(x.vy=0),r>2&&(x.vz=0))}}function y(g){return g.initialize&&g.initialize(e,d,r),g}return m(),i={tick:_,restart:function(){return h.restart(p),i},stop:function(){return h.stop(),i},numDimensions:function(g){return arguments.length?(r=Math.min(yr,Math.max(1,Math.round(g))),c.forEach(y),i):r},nodes:function(g){return arguments.length?(e=g,m(),c.forEach(y),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?(l=+g,i):l},velocityDecay:function(g){return arguments.length?(u=1-g,i):1-u},randomSource:function(g){return arguments.length?(d=g,c.forEach(y),i):d},force:function(g,w){return arguments.length>1?(w==null?c.delete(g):c.set(g,y(w)),i):c.get(g)},find:function(){var g=Array.prototype.slice.call(arguments),w=g.shift()||0,x=(r>1?g.shift():null)||0,v=(r>2?g.shift():null)||0,b=g.shift()||1/0,k=0,S=e.length,C,N,E,I,R,j;for(b*=b,k=0;k<S;++k)R=e[k],C=w-R.x,N=x-(R.y||0),E=v-(R.z||0),I=C*C+N*N+E*E,I<b&&(j=R,b=I);return j},on:function(g,w){return arguments.length>1?(f.on(g,w),i):f.on(g)}}}function ef(){var e,n,r,i,o,a=Ct(-30),s,l=1,u=1/0,c=.81;function h(_){var m,y=e.length,g=(n===1?Ai(e,Ge):n===2?Ti(e,Ge,mr):n===3?Ni(e,Ge,mr,Kc):null).visitAfter(d);for(o=_,m=0;m<y;++m)r=e[m],g.visit(p)}function f(){if(e){var _,m=e.length,y;for(s=new Array(m),_=0;_<m;++_)y=e[_],s[y.index]=+a(y,_,e)}}function d(_){var m=0,y,g,w=0,x,v,b,k,S=_.length;if(S){for(x=v=b=k=0;k<S;++k)(y=_[k])&&(g=Math.abs(y.value))&&(m+=y.value,w+=g,x+=g*(y.x||0),v+=g*(y.y||0),b+=g*(y.z||0));m*=Math.sqrt(4/S),_.x=x/w,n>1&&(_.y=v/w),n>2&&(_.z=b/w)}else{y=_,y.x=y.data.x,n>1&&(y.y=y.data.y),n>2&&(y.z=y.data.z);do m+=s[y.data.index];while(y=y.next)}_.value=m}function p(_,m,y,g,w){if(!_.value)return!0;var x=[y,g,w][n-1],v=_.x-r.x,b=n>1?_.y-r.y:0,k=n>2?_.z-r.z:0,S=x-m,C=v*v+b*b+k*k;if(S*S/c<C)return C<u&&(v===0&&(v=St(i),C+=v*v),n>1&&b===0&&(b=St(i),C+=b*b),n>2&&k===0&&(k=St(i),C+=k*k),C<l&&(C=Math.sqrt(l*C)),r.vx+=v*_.value*o/C,n>1&&(r.vy+=b*_.value*o/C),n>2&&(r.vz+=k*_.value*o/C)),!0;if(_.length||C>=u)return;(_.data!==r||_.next)&&(v===0&&(v=St(i),C+=v*v),n>1&&b===0&&(b=St(i),C+=b*b),n>2&&k===0&&(k=St(i),C+=k*k),C<l&&(C=Math.sqrt(l*C)));do _.data!==r&&(S=s[_.data.index]*o/C,r.vx+=v*S,n>1&&(r.vy+=b*S),n>2&&(r.vz+=k*S));while(_=_.next)}return h.initialize=function(_,...m){e=_,i=m.find(y=>typeof y=="function")||Math.random,n=m.find(y=>[1,2,3].includes(y))||2,f()},h.strength=function(_){return arguments.length?(a=typeof _=="function"?_:Ct(+_),f(),h):a},h.distanceMin=function(_){return arguments.length?(l=_*_,h):Math.sqrt(l)},h.distanceMax=function(_){return arguments.length?(u=_*_,h):Math.sqrt(u)},h.theta=function(_){return arguments.length?(c=_*_,h):Math.sqrt(c)},h}function nf(e,n,r,i){var o,a,s=Ct(.1),l,u;typeof e!="function"&&(e=Ct(+e)),n==null&&(n=0),r==null&&(r=0),i==null&&(i=0);function c(f){for(var d=0,p=o.length;d<p;++d){var _=o[d],m=_.x-n||1e-6,y=(_.y||0)-r||1e-6,g=(_.z||0)-i||1e-6,w=Math.sqrt(m*m+y*y+g*g),x=(u[d]-w)*l[d]*f/w;_.vx+=m*x,a>1&&(_.vy+=y*x),a>2&&(_.vz+=g*x)}}function h(){if(o){var f,d=o.length;for(l=new Array(d),u=new Array(d),f=0;f<d;++f)u[f]=+e(o[f],f,o),l[f]=isNaN(u[f])?0:+s(o[f],f,o)}}return c.initialize=function(f,...d){o=f,a=d.find(p=>[1,2,3].includes(p))||2,h()},c.strength=function(f){return arguments.length?(s=typeof f=="function"?f:Ct(+f),h(),c):s},c.radius=function(f){return arguments.length?(e=typeof f=="function"?f:Ct(+f),h(),c):e},c.x=function(f){return arguments.length?(n=+f,c):n},c.y=function(f){return arguments.length?(r=+f,c):r},c.z=function(f){return arguments.length?(i=+f,c):i},c}const{abs:Xt,cos:kt,sin:Dt,acos:rf,atan2:Yt,sqrt:Tt,pow:ot}=Math;function Kt(e){return e<0?-ot(-e,1/3):ot(e,1/3)}const zi=Math.PI,ve=2*zi,Et=zi/2,of=1e-6,Xe=Number.MAX_SAFE_INTEGER||9007199254740991,Ye=Number.MIN_SAFE_INTEGER||-9007199254740991,af={x:0,y:0,z:0},T={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),Tt(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 l={x:o*a[0].x+e*a[1].x,y:o*a[0].y+e*a[1].y,t:e};return r&&(l.z=o*a[0].z+e*a[1].z),l}if(i<4){let l=o*o,u=e*e,c,h,f,d=0;i===2?(a=[a[0],a[1],a[2],af],c=l,h=o*e*2,f=u):i===3&&(c=l*o,h=l*e*3,f=o*u*3,d=e*u);const p={x:c*a[0].x+h*a[1].x+f*a[2].x+d*a[3].x,y:c*a[0].y+h*a[1].y+f*a[2].y+d*a[3].y,t:e};return r&&(p.z=c*a[0].z+h*a[1].z+f*a[2].z+d*a[3].z),p}const s=JSON.parse(JSON.stringify(n));for(;s.length>1;){for(let l=0;l<s.length-1;l++)s[l]={x:s[l].x+(s[l+1].x-s[l].x)*e,y:s[l].y+(s[l+1].y-s[l].y)*e},typeof s[l].z<"u"&&(s[l].z=s[l].z+(s[l+1].z-s[l].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 l=a[0],u=a[1],c=a[2],h=a[3],f;if(l*=o,u*=e,s.length===2)return f=l+u,{x:(l*s[0].x+u*s[1].x)/f,y:(l*s[0].y+u*s[1].y)/f,z:i?(l*s[0].z+u*s[1].z)/f:!1,t:e};if(l*=o,u*=2*o,c*=e*e,s.length===3)return f=l+u+c,{x:(l*s[0].x+u*s[1].x+c*s[2].x)/f,y:(l*s[0].y+u*s[1].y+c*s[2].y)/f,z:i?(l*s[0].z+u*s[1].z+c*s[2].z)/f:!1,t:e};if(l*=o,u*=1.5*o,c*=3*o,h*=e*e*e,s.length===4)return f=l+u+c+h,{x:(l*s[0].x+u*s[1].x+c*s[2].x+h*s[3].x)/f,y:(l*s[0].y+u*s[1].y+c*s[2].y+h*s[3].y)/f,z:i?(l*s[0].z+u*s[1].z+c*s[2].z+h*s[3].z)/f:!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 l=0,u;l<a;l++)u={x:a*(i[l+1].x-i[l].x),y:a*(i[l+1].y-i[l].y)},n&&(u.z=a*(i[l+1].z-i[l].z)),s.push(u);r.push(s),i=s}return r},between:function(e,n,r){return n<=e&&e<=r||T.approximately(e,n)||T.approximately(e,r)},approximately:function(e,n,r){return Xt(e-n)<=(r||of)},length:function(e){const r=T.Tvalues.length;let i=0;for(let o=0,a;o<r;o++)a=.5*T.Tvalues[o]+.5,i+=T.Cvalues[o]*T.arcfn(a,e);return .5*i},map:function(e,n,r,i,o){const a=r-n,s=o-i,l=e-n,u=l/a;return i+s*u},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(T.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,l=i*s-o*a,u=i*a+o*s;return Yt(l,u)},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 Tt(r*r+i*i)},closest:function(e,n){let r=ot(2,63),i,o;return e.forEach(function(a,s){o=T.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=ot(e,n)+ot(1-e,n),i=r-1;return Xt(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=ot(1-e,n),i=ot(e,n)+r;return r/i},lli8:function(e,n,r,i,o,a,s,l){const u=(e*i-n*r)*(o-s)-(e-r)*(o*l-a*s),c=(e*i-n*r)*(a-l)-(n-i)*(o*l-a*s),h=(e-r)*(a-l)-(n-i)*(o-s);return h==0?!1:{x:u/h,y:c/h}},lli4:function(e,n,r,i){const o=e.x,a=e.y,s=n.x,l=n.y,u=r.x,c=r.y,h=i.x,f=i.y;return T.lli8(o,a,s,l,u,c,h,f)},lli:function(e,n){return T.lli4(e,e.c,n,n.c)},makeline:function(e,n){return new B(e.x,e.y,(e.x+n.x)/2,(e.y+n.y)/2,n.x,n.y)},findbbox:function(e){let n=Xe,r=Xe,i=Ye,o=Ye;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(!T.bboxoverlap(n,i))return[];const a=[],s=[e.startcap,e.forward,e.back,e.endcap],l=[r.startcap,r.forward,r.back,r.endcap];return s.forEach(function(u){u.virtual||l.forEach(function(c){if(c.virtual)return;const h=u.intersects(c,o);h.length>0&&(h.c1=u,h.c2=c,h.s1=e,h.s2=r,a.push(h))})}),a},makeshape:function(e,n,r){const i=n.points.length,o=e.points.length,a=T.makeline(n.points[i-1],e.points[0]),s=T.makeline(e.points[o-1],n.points[0]),l={startcap:a,forward:e,back:n,endcap:s,bbox:T.findbbox([a,e,n,s])};return l.intersections=function(u){return T.shapeintersections(l,l.bbox,u,u.bbox,r)},l},getminmax:function(e,n,r){if(!r)return{min:0,max:0};let i=Xe,o=Ye,a,s;r.indexOf(0)===-1&&(r=[0].concat(r)),r.indexOf(1)===-1&&r.push(1);for(let l=0,u=r.length;l<u;l++)a=r[l],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=-Yt(n.p2.y-i,n.p2.x-r),a=function(s){return{x:(s.x-r)*kt(o)-(s.y-i)*Dt(o),y:(s.x-r)*Dt(o)+(s.y-i)*kt(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=T.align(e,n),o=function(S){return 0<=S&&S<=1};if(r===2){const S=i[0].y,C=i[1].y,N=i[2].y,E=S-2*C+N;if(E!==0){const I=-Tt(C*C-S*N),R=-S+C,j=-(I+R)/E,M=-(-I+R)/E;return[j,M].filter(o)}else if(C!==N&&E===0)return[(2*C-N)/(2*C-2*N)].filter(o);return[]}const a=i[0].y,s=i[1].y,l=i[2].y,u=i[3].y;let c=-a+3*s-3*l+u,h=3*a-6*s+3*l,f=-3*a+3*s,d=a;if(T.approximately(c,0)){if(T.approximately(h,0))return T.approximately(f,0)?[]:[-d/f].filter(o);const S=Tt(f*f-4*h*d),C=2*h;return[(S-f)/C,(-f-S)/C].filter(o)}h/=c,f/=c,d/=c;const p=(3*f-h*h)/3,_=p/3,m=(2*h*h*h-9*h*f+27*d)/27,y=m/2,g=y*y+_*_*_;let w,x,v,b,k;if(g<0){const S=-p/3,C=S*S*S,N=Tt(C),E=-m/(2*N),I=E<-1?-1:E>1?1:E,R=rf(I),j=Kt(N),M=2*j;return v=M*kt(R/3)-h/3,b=M*kt((R+ve)/3)-h/3,k=M*kt((R+2*ve)/3)-h/3,[v,b,k].filter(o)}else{if(g===0)return w=y<0?Kt(-y):-Kt(y),v=2*w-h/3,b=-w-h/3,[v,b].filter(o);{const S=Tt(g);return w=Kt(-y+S),x=Kt(y+S),[w-x-h/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=-Tt(r*r-n*i),s=-n+r,l=-(a+s)/o,u=-(-a+s)/o;return[l,u]}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,l,u,c=0,h=0;const f=T.compute(e,n),d=T.compute(e,r),p=f.x*f.x+f.y*f.y;if(i?(a=Tt(ot(f.y*d.z-d.y*f.z,2)+ot(f.z*d.x-d.z*f.x,2)+ot(f.x*d.y-d.x*f.y,2)),s=ot(p+f.z*f.z,3/2)):(a=f.x*d.y-f.y*d.x,s=ot(p,3/2)),a===0||s===0)return{k:0,r:0};if(c=a/s,h=s/a,!o){const _=T.curvature(e-.001,n,r,i,!0).k,m=T.curvature(e+.001,n,r,i,!0).k;u=(m-c+(c-_))/2,l=(Xt(m-c)+Xt(c-_))/2}return{k:c,r:h,dk:u,adk:l}},inflections:function(e){if(e.length<4)return[];const n=T.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),l=18*(3*r-i-3*o),u=18*(o-r);if(T.approximately(s,0)){if(!T.approximately(l,0)){let d=-u/l;if(0<=d&&d<=1)return[d]}return[]}const c=2*s;if(T.approximately(c,0))return[];const h=l*l-4*s*u;if(h<0)return[];const f=Math.sqrt(h);return[(f-l)/c,-(l+f)/c].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,l,u;o<i;o++)if(a=r[o],s=e[a].mid,l=n[a].mid,u=(e[a].size+n[a].size)/2,Xt(s-l)>=u)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 l=e.split(.5),u=n.split(.5),c=[{left:l.left,right:u.left},{left:l.left,right:u.right},{left:l.right,right:u.right},{left:l.right,right:u.left}];c=c.filter(function(f){return T.bboxoverlap(f.left.bbox(),f.right.bbox())});let h=[];return c.length===0||(c.forEach(function(f){h=h.concat(T.pairiteration(f.left,f.right,s))}),h=h.filter(function(f,d){return h.indexOf(f)===d})),h},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,l=i*kt(Et)-o*Dt(Et),u=i*Dt(Et)+o*kt(Et),c=a*kt(Et)-s*Dt(Et),h=a*Dt(Et)+s*kt(Et),f=(e.x+n.x)/2,d=(e.y+n.y)/2,p=(n.x+r.x)/2,_=(n.y+r.y)/2,m=f+l,y=d+u,g=p+c,w=_+h,x=T.lli8(f,d,m,y,p,_,g,w),v=T.dist(x,e);let b=Yt(e.y-x.y,e.x-x.x),k=Yt(n.y-x.y,n.x-x.x),S=Yt(r.y-x.y,r.x-x.x),C;return b<S?((b>k||k>S)&&(b+=ve),b>S&&(C=S,S=b,b=C)):S<k&&k<b?(C=S,S=b,b=C):S+=ve,x.s=b,x.e=S,x.r=v,x},numberSort:function(e,n){return e-n}};class oe{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 T.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++)T.expandbox(r,n[i].bbox());return r}offset(n){const r=[];return this.curves.forEach(function(i){r.push(...i.offset(n))}),new oe(r)}}const{abs:Zt,min:br,max:wr,cos:sf,sin:lf,acos:uf,sqrt:Qt}=Math,cf=Math.PI;class B{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(_){["x","y","z"].forEach(function(m){typeof _[m]<"u"&&p.push(_[m])})}),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",l=this.points=[];for(let p=0,_=s?3:2;p<a;p+=_){var u={x:r[p],y:r[p+1]};s&&(u.z=r[p+2]),l.push(u)}const c=this.order=l.length-1,h=this.dims=["x","y"];s&&h.push("z"),this.dimlen=h.length;const f=T.align(l,{p1:l[0],p2:l[c]}),d=T.dist(l[0],l[c]);this._linear=f.reduce((p,_)=>p+Zt(_.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 B(r,r,i);if(o===1)return new B(n,r,r);const a=B.getABC(2,n,r,i,o);return new B(n,a.A,i)}static cubicFromPoints(n,r,i,o,a){typeof o>"u"&&(o=.5);const s=B.getABC(3,n,r,i,o);typeof a>"u"&&(a=T.dist(r,s.C));const l=a*(1-o)/o,u=T.dist(n,i),c=(i.x-n.x)/u,h=(i.y-n.y)/u,f=a*c,d=a*h,p=l*c,_=l*h,m={x:r.x-f,y:r.y-d},y={x:r.x+p,y:r.y+_},g=s.A,w={x:g.x+(m.x-g.x)/(1-o),y:g.y+(m.y-g.y)/(1-o)},x={x:g.x+(y.x-g.x)/o,y:g.y+(y.y-g.y)/o},v={x:n.x+(w.x-n.x)/o,y:n.y+(w.y-n.y)/o},b={x:i.x+(x.x-i.x)/(1-o),y:i.y+(x.y-i.y)/(1-o)};return new B(n,v,b,i)}static getUtils(){return T}getUtils(){return B.getUtils()}static get PolyBezier(){return oe}valueOf(){return this.toString()}toString(){return T.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=T.derive(this.points,this._3d),this.computedirection()}computedirection(){const n=this.points,r=T.angle(n[0],n[this.order],n[1]);this.clockwise=r>0}length(){return T.length(this.derivative.bind(this))}static getABC(n=2,r,i,o,a=.5){const s=T.projectionratio(a,n),l=1-s,u={x:s*r.x+l*o.x,y:s*r.y+l*o.y},c=T.abcratio(a,n);return{A:{x:i.x+(i.x-u.x)/c,y:i.y+(i.y-u.y)/c},B:i,C:u,S:r,E:o}}getABC(n,r){r=r||this.get(n);let i=this.points[0],o=this.points[this.order];return B.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,l=0;a<i.length;a++)s=i[a],T.dist(s,n)<r&&(o.push(s),l+=a/i.length);return o.length?t/=o.length:!1}project(n){const r=this.getLUT(),i=r.length-1,o=T.closest(r,n),a=o.mpos,s=(a-1)/i,l=(a+1)/i,u=.1/i;let c=o.mdist,h=s,f=h,d;c+=1;for(let p;h<l+u;h+=u)d=this.compute(h),p=T.dist(n,d),p<c&&(c=p,f=h);return f=f<0?0:f>1?1:f,d=this.compute(f),d.t=f,d.d=c,d}get(n){return this.compute(n)}point(n){return this.points[n]}compute(n){return this.ratios?T.computeWithRatios(n,this.points,this.ratios,this._3d):T.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 B(r)}derivative(n){return T.compute(n,this.dpoints[0],this._3d)}dderivative(n){return T.compute(n,this.dpoints[1],this._3d)}align(){let n=this.points;return new B(T.align(n,{p1:n[0],p2:n[n.length-1]}))}curvature(n){return T.curvature(n,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return T.inflections(this.points)}normal(n){return this._3d?this.__normal3(n):this.__normal2(n)}__normal2(n){const r=this.derivative(n),i=Qt(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=Qt(r.x*r.x+r.y*r.y+r.z*r.z),a=Qt(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},l=Qt(s.x*s.x+s.y*s.y+s.z*s.z);s.x/=l,s.y/=l,s.z/=l;const u=[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:u[0]*r.x+u[1]*r.y+u[2]*r.z,y:u[3]*r.x+u[4]*r.y+u[5]*r.z,z:u[6]*r.x+u[7]*r.y+u[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,l,u=r.length-1;s<u;s++)l=T.lerp(n,r[s],r[s+1]),o[a++]=l,i.push(l);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 B([i[0],i[3],i[5]]):new B([i[0],i[4],i[7],i[9]]),right:this.order===2?new B([i[5],i[4],i[2]]):new B([i[9],i[8],i[6],i[3]]),span:i};return o.left._t1=T.map(0,0,1,this._t1,this._t2),o.left._t2=T.map(n,0,1,this._t1,this._t2),o.right._t1=T.map(n,0,1,this._t1,this._t2),o.right._t2=T.map(1,0,1,this._t1,this._t2),r?(r=T.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]=T.droots(a),this.order===3&&(a=this.dpoints[1].map(o),n[i]=n[i].concat(T.droots(a))),n[i]=n[i].filter(function(s){return s>=0&&s<=1}),r=r.concat(n[i].sort(T.numberSort))}).bind(this)),n.values=r.sort(T.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]=T.getminmax(this,i,n[i])}).bind(this)),r}overlaps(n){const r=this.bbox(),i=n.bbox();return T.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 B(o)]}return this.reduce().map(function(i){return i._linear?i.offset(n)[0]:i.scale(n)})}simple(){if(this.order===3){const o=T.angle(this.points[0],this.points[3],this.points[1]),a=T.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),Zt(uf(i))<cf/3}reduce(){let n,r=0,i=0,o=.01,a,s=[],l=[],u=this.extrema().values;for(u.indexOf(0)===-1&&(u=[0].concat(u)),u.indexOf(1)===-1&&u.push(1),r=u[0],n=1;n<u.length;n++)i=u[n],a=this.split(r,i),a._t1=r,a._t2=i,s.push(a),r=i;return s.forEach(function(c){for(r=0,i=0;i<=1;)for(i=r+o;i<=1+o;i+=o)if(a=c.split(r,i),!a.simple()){if(i-=o,Zt(r-i)<o)return[];a=c.split(r,i),a._t1=T.map(r,0,1,c._t1,c._t2),a._t2=T.map(i,0,1,c._t1,c._t2),l.push(a),r=i;break}r<1&&(a=c.split(r,1),a._t1=T.map(r,0,1,c._t1,c._t2),a._t2=c._t2,l.push(a))}),l}translate(n,r,i){i=typeof i=="number"?i:r;const o=this.order;let a=this.points.map((s,l)=>(1-l/o)*r+l/o*i);return new B(this.points.map((s,l)=>({x:s.x+n.x*a[l],y:s.y+n.y*a[l]})))}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,l=i?i(1):n,u=[this.offset(0,10),this.offset(1,10)],c=[],h=T.lli4(u[0],u[0].c,u[1],u[1].c);if(!h)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach(function(f){const d=c[f*r]=T.copy(a[f*r]);d.x+=(f?l:s)*u[f].n.x,d.y+=(f?l:s)*u[f].n.y}),i?([0,1].forEach(function(f){if(!(r===2&&f)){var d=a[f+1],p={x:d.x-h.x,y:d.y-h.y},_=i?i((f+1)/r):n;i&&!o&&(_=-_);var m=Qt(p.x*p.x+p.y*p.y);p.x/=m,p.y/=m,c[f+1]={x:d.x+_*p.x,y:d.y+_*p.y}}}),new B(c)):([0,1].forEach(f=>{if(r===2&&f)return;const d=c[f*r],p=this.derivative(f),_={x:d.x+p.x,y:d.y+p.y};c[f+1]=T.lli4(d,_,h,a[f+1])}),new B(c))}outline(n,r,i,o){if(r=r===void 0?n:r,this._linear){const b=this.normal(0),k=this.points[0],S=this.points[this.points.length-1];let C,N,E;i===void 0&&(i=n,o=r),C={x:k.x+b.x*n,y:k.y+b.y*n},E={x:S.x+b.x*i,y:S.y+b.y*i},N={x:(C.x+E.x)/2,y:(C.y+E.y)/2};const I=[C,N,E];C={x:k.x-b.x*r,y:k.y-b.y*r},E={x:S.x-b.x*o,y:S.y-b.y*o},N={x:(C.x+E.x)/2,y:(C.y+E.y)/2};const R=[E,N,C],j=T.makeline(R[2],I[0]),M=T.makeline(I[2],R[0]),z=[j,new B(I),M,new B(R)];return new oe(z)}const a=this.reduce(),s=a.length,l=[];let u=[],c,h=0,f=this.length();const d=typeof i<"u"&&typeof o<"u";function p(b,k,S,C,N){return function(E){const I=C/S,R=(C+N)/S,j=k-b;return T.map(E,0,1,b+I*j,b+R*j)}}a.forEach(function(b){const k=b.length();d?(l.push(b.scale(p(n,i,f,h,k))),u.push(b.scale(p(-r,-o,f,h,k)))):(l.push(b.scale(n)),u.push(b.scale(-r))),h+=k}),u=u.map(function(b){return c=b.points,c[3]?b.points=[c[3],c[2],c[1],c[0]]:b.points=[c[2],c[1],c[0]],b}).reverse();const _=l[0].points[0],m=l[s-1].points[l[s-1].points.length-1],y=u[s-1].points[u[s-1].points.length-1],g=u[0].points[0],w=T.makeline(y,_),x=T.makeline(m,g),v=[w].concat(l).concat([x]).concat(u);return new oe(v)}outlineshapes(n,r,i){r=r||n;const o=this.outline(n,r).curves,a=[];for(let s=1,l=o.length;s<l/2;s++){const u=T.makeshape(o[s],o[l-s],i);u.startcap.virtual=s>1,u.endcap.virtual=s<l/2-1,a.push(u)}return a}intersects(n,r){return n?n.p1&&n.p2?this.lineIntersects(n):(n instanceof B&&(n=n.reduce()),this.curveintersects(this.reduce(),n,r)):this.selfintersects(r)}lineIntersects(n){const r=br(n.p1.x,n.p2.x),i=br(n.p1.y,n.p2.y),o=wr(n.p1.x,n.p2.x),a=wr(n.p1.y,n.p2.y);return T.roots(this.points,n).filter(s=>{var l=this.get(s);return T.between(l.x,r,o)&&T.between(l.y,i,a)})}selfintersects(n){const r=this.reduce(),i=r.length-2,o=[];for(let a=0,s,l,u;a<i;a++)l=r.slice(a,a+1),u=r.slice(a+2),s=this.curveintersects(l,u,n),o.push(...s);return o}curveintersects(n,r,i){const o=[];n.forEach(function(s){r.forEach(function(l){s.overlaps(l)&&o.push({left:s,right:l})})});let a=[];return o.forEach(function(s){const l=T.pairiteration(s.left,s.right,i);l.length>0&&(a=a.concat(l))}),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),l=this.get(o-a),u=T.dist(n,r),c=T.dist(n,s),h=T.dist(n,l);return Zt(c-u)+Zt(h-u)}_iterate(n,r){let i=0,o=1,a;do{a=0,o=1;let s=this.get(i),l,u,c,h,f=!1,d=!1,p,_=o,m=1;do if(d=f,h=c,_=(i+o)/2,l=this.get(_),u=this.get(o),c=T.getccenter(s,l,u),c.interval={start:i,end:o},f=this._error(c,s,i,o)<=n,p=d&&!f,p||(m=o),f){if(o>=1){if(c.interval.end=m=1,h=c,o>1){let g={x:c.x+c.r*sf(c.e),y:c.y+c.r*lf(c.e)};c.e+=T.angle({x:c.x,y:c.y},g,this.get(1))}break}o=o+(o-i)/2}else o=_;while(!p&&a++<100);if(a>=100)break;h=h||c,r.push(h),i=m}while(o<1);return r}}function gn(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 ff(e){if(Array.isArray(e))return e}function hf(e){if(Array.isArray(e))return gn(e)}function df(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pf(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function gf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
17
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _f(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vf(e,n){if(e==null)return{};var r,i,o=yf(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 yf(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 mf(e,n){return ff(e)||pf(e,n)||Ii(e,n)||gf()}function bf(e){return hf(e)||df(e)||Ii(e)||_f()}function wf(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 xf(e){var n=wf(e,"string");return typeof n=="symbol"?n:n+""}function Ii(e,n){if(e){if(typeof e=="string")return gn(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)?gn(e,n):void 0}}var kf=(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(l){return{keyAccessor:l,isProp:!(l instanceof Function)}}),a=e.reduce(function(l,u){var c=l,h=u;return o.forEach(function(f,d){var p=f.keyAccessor,_=f.isProp,m;if(_){var y=h,g=y[p],w=vf(y,[p].map(xf));m=g,h=w}else m=p(h,d);d+1<o.length?(c.hasOwnProperty(m)||(c[m]={}),c=c[m]):r?(c.hasOwnProperty(m)||(c[m]=[]),c[m].push(h)):c[m]=h}),l},{});r instanceof Function&&(function l(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;c===o.length?Object.keys(u).forEach(function(h){return u[h]=r(u[h])}):Object.values(u).forEach(function(h){return l(h,c+1)})})(a);var s=a;return i&&(s=[],(function l(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];c.length===o.length?s.push({keys:c,vals:u}):Object.entries(u).forEach(function(h){var f=mf(h,2),d=f[0],p=f[1];return l(p,[].concat(bf(c),[d]))})})(a),n instanceof Array&&n.length===0&&s.length===1&&(s[0].keys=[])),s});function Sf(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 Mf=Sf("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");function Cf(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 Af=`.force-graph-container canvas {
|
|
19
|
+
display: block;
|
|
20
|
+
user-select: none;
|
|
21
|
+
outline: none;
|
|
22
|
+
-webkit-tap-highlight-color: transparent;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.force-graph-container .clickable {
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.force-graph-container .grabbable {
|
|
30
|
+
cursor: move;
|
|
31
|
+
cursor: grab;
|
|
32
|
+
cursor: -moz-grab;
|
|
33
|
+
cursor: -webkit-grab;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.force-graph-container .grabbable:active {
|
|
37
|
+
cursor: grabbing;
|
|
38
|
+
cursor: -moz-grabbing;
|
|
39
|
+
cursor: -webkit-grabbing;
|
|
40
|
+
}
|
|
41
|
+
`;Cf(Af);function _n(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 Pf(e){if(Array.isArray(e))return e}function Tf(e){if(Array.isArray(e))return _n(e)}function xr(e,n,r){if(Ri())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 ue(e,n,r){return(n=Of(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Ri(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ri=function(){return!!e})()}function Ef(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nf(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function zf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
42
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function If(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
43
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kr(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 Ft(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?kr(Object(r),!0).forEach(function(i){ue(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kr(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function ae(e,n){return Pf(e)||Nf(e,n)||Oi(e,n)||zf()}function st(e){return Tf(e)||Ef(e)||Oi(e)||If()}function Rf(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 Of(e){var n=Rf(e,"string");return typeof n=="symbol"?n:n+""}function vn(e){"@babel/helpers - typeof";return vn=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},vn(e)}function Oi(e,n){if(e){if(typeof e=="string")return _n(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)?_n(e,n):void 0}}var Df=Wi(Mf);function Sr(e,n,r){!n||typeof r!="string"||e.filter(function(i){return!i[r]}).forEach(function(i){i[r]=Df(n(i))})}function Ff(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,l=o.onLoopError,u=l===void 0?function(p){throw"Invalid DAG structure! Found cycle in node path: ".concat(p.join(" -> "),".")}:l,c={};r.forEach(function(p){return c[n(p)]={data:p,out:[],depth:-1,skip:!s(p)}}),i.forEach(function(p){var _=p.source,m=p.target,y=v(_),g=v(m);if(!c.hasOwnProperty(y))throw"Missing source node with id: ".concat(y);if(!c.hasOwnProperty(g))throw"Missing target node with id: ".concat(g);var w=c[y],x=c[g];w.out.push(x);function v(b){return vn(b)==="object"?n(b):b}});var h=[];d(Object.values(c));var f=Object.assign.apply(Object,[{}].concat(st(Object.entries(c).filter(function(p){var _=ae(p,2),m=_[1];return!m.skip}).map(function(p){var _=ae(p,2),m=_[0],y=_[1];return ue({},m,y.depth)}))));return f;function d(p){for(var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,y=function(){var v=p[g];if(_.indexOf(v)!==-1){var b=[].concat(st(_.slice(_.indexOf(v))),[v]).map(function(k){return n(k.data)});return h.some(function(k){return k.length===b.length&&k.every(function(S,C){return S===b[C]})})||(h.push(b),u(b)),1}m>v.depth&&(v.depth=m,d(v.out,[].concat(st(_),[v]),m+(v.skip?0:1)))},g=0,w=p.length;g<w;g++)y()}}var jf=2,Z=function(n,r){return r.onNeedsRedraw&&r.onNeedsRedraw()},Mr=function(n,r){if(!r.isShadow){var i=W(r.linkDirectionalParticles);r.graphData.links.forEach(function(o){var a=Math.round(Math.abs(i(o)));a?o.__photons=st(Array(a)).map(function(){return{}}):delete o.__photons})}},Oe=Mn({props:{graphData:{default:{nodes:[],links:[]},onChange:function(n,r){r.engineRunning=!1,Mr(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:Z},nodeId:{default:"id"},nodeVal:{default:"val",triggerUpdate:!1,onChange:Z},nodeColor:{default:"color",triggerUpdate:!1,onChange:Z},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:Z},nodeCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:Z},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:Z},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0,triggerUpdate:!1,onChange:Z},linkColor:{default:"color",triggerUpdate:!1,onChange:Z},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:Z},linkWidth:{default:1,triggerUpdate:!1,onChange:Z},linkCurvature:{default:0,triggerUpdate:!1,onChange:Z},linkCanvasObject:{triggerUpdate:!1,onChange:Z},linkCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:Z},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:Z},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:Z},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:Z},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:Mr},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 l=W(n.nodeVisibility),u=W(n.nodeVal),c=W(n.nodeColor),h=W(n.nodeCanvasObjectMode),f=n.ctx,d=n.isShadow/n.globalScale,p=n.graphData.nodes.filter(l);f.save(),p.forEach(function(_){var m=h(_);if(n.nodeCanvasObject&&(m==="before"||m==="replace")&&(n.nodeCanvasObject(_,f,n.globalScale),m==="replace")){f.restore();return}var y=Math.sqrt(Math.max(0,u(_)||1))*n.nodeRelSize+d;f.beginPath(),f.arc(_.x,_.y,y,0,2*Math.PI,!1),f.fillStyle=c(_)||"rgba(31, 120, 180, 0.92)",f.fill(),n.nodeCanvasObject&&m==="after"&&n.nodeCanvasObject(_,n.ctx,n.globalScale)}),f.restore()}function o(){var l=W(n.linkVisibility),u=W(n.linkColor),c=W(n.linkWidth),h=W(n.linkLineDash),f=W(n.linkCurvature),d=W(n.linkCanvasObjectMode),p=n.ctx,_=n.isShadow*2,m=n.graphData.links.filter(l);m.forEach(k);var y=[],g=[],w=m;if(n.linkCanvasObject){var x=[],v=[];m.forEach(function(S){return({before:y,after:g,replace:x}[d(S)]||v).push(S)}),w=[].concat(st(y),g,v),y=y.concat(x)}p.save(),y.forEach(function(S){return n.linkCanvasObject(S,p,n.globalScale)}),p.restore();var b=kf(w,[u,c,h]);p.save(),Object.entries(b).forEach(function(S){var C=ae(S,2),N=C[0],E=C[1],I=!N||N==="undefined"?"rgba(0,0,0,0.15)":N;Object.entries(E).forEach(function(R){var j=ae(R,2),M=j[0],z=j[1],A=(M||1)/n.globalScale+_;Object.entries(z).forEach(function(O){var F=ae(O,2);F[0];var L=F[1],$=h(L[0]);p.beginPath(),L.forEach(function(U){var H=U.source,Y=U.target;if(!(!H||!Y||!H.hasOwnProperty("x")||!Y.hasOwnProperty("x"))){p.moveTo(H.x,H.y);var X=U.__controlPoints;X?p[X.length===2?"quadraticCurveTo":"bezierCurveTo"].apply(p,st(X).concat([Y.x,Y.y])):p.lineTo(Y.x,Y.y)}}),p.strokeStyle=I,p.lineWidth=A,p.setLineDash($||[]),p.stroke()})})}),p.restore(),p.save(),g.forEach(function(S){return n.linkCanvasObject(S,p,n.globalScale)}),p.restore();function k(S){var C=f(S);if(!C){S.__controlPoints=null;return}var N=S.source,E=S.target;if(!(!N||!E||!N.hasOwnProperty("x")||!E.hasOwnProperty("x"))){var I=Math.sqrt(Math.pow(E.x-N.x,2)+Math.pow(E.y-N.y,2));if(I>0){var R=Math.atan2(E.y-N.y,E.x-N.x),j=I*C,M={x:(N.x+E.x)/2+j*Math.cos(R-Math.PI/2),y:(N.y+E.y)/2+j*Math.sin(R-Math.PI/2)};S.__controlPoints=[M.x,M.y]}else{var z=C*70;S.__controlPoints=[E.x,E.y-z,E.x+z,E.y]}}}}function a(){var l=1.6,u=.2,c=W(n.linkDirectionalArrowLength),h=W(n.linkDirectionalArrowRelPos),f=W(n.linkVisibility),d=W(n.linkDirectionalArrowColor||n.linkColor),p=W(n.nodeVal),_=n.ctx;_.save(),n.graphData.links.filter(f).forEach(function(m){var y=c(m);if(!(!y||y<0)){var g=m.source,w=m.target;if(!(!g||!w||!g.hasOwnProperty("x")||!w.hasOwnProperty("x"))){var x=Math.sqrt(Math.max(0,p(g)||1))*n.nodeRelSize,v=Math.sqrt(Math.max(0,p(w)||1))*n.nodeRelSize,b=Math.min(1,Math.max(0,h(m))),k=d(m)||"rgba(0,0,0,0.28)",S=y/l/2,C=m.__controlPoints&&xr(B,[g.x,g.y].concat(st(m.__controlPoints),[w.x,w.y])),N=C?function(A){return C.get(A)}:function(A){return{x:g.x+(w.x-g.x)*A||0,y:g.y+(w.y-g.y)*A||0}},E=C?C.length():Math.sqrt(Math.pow(w.x-g.x,2)+Math.pow(w.y-g.y,2)),I=x+y+(E-x-v-y)*b,R=N(I/E),j=N((I-y)/E),M=N((I-y*(1-u))/E),z=Math.atan2(R.y-j.y,R.x-j.x)-Math.PI/2;_.beginPath(),_.moveTo(R.x,R.y),_.lineTo(j.x+S*Math.cos(z),j.y+S*Math.sin(z)),_.lineTo(M.x,M.y),_.lineTo(j.x-S*Math.cos(z),j.y-S*Math.sin(z)),_.fillStyle=k,_.fill()}}}),_.restore()}function s(){var l=W(n.linkDirectionalParticles),u=W(n.linkDirectionalParticleSpeed),c=W(n.linkDirectionalParticleOffset),h=W(n.linkDirectionalParticleWidth),f=W(n.linkVisibility),d=W(n.linkDirectionalParticleColor||n.linkColor),p=n.ctx;p.save(),n.graphData.links.filter(f).forEach(function(_){var m=l(_);if(!(!_.hasOwnProperty("__photons")||!_.__photons.length)){var y=_.source,g=_.target;if(!(!y||!g||!y.hasOwnProperty("x")||!g.hasOwnProperty("x"))){var w=u(_),x=Math.abs(c(_)),v=_.__photons||[],b=Math.max(0,h(_)/2)/Math.sqrt(n.globalScale),k=d(_)||"rgba(0,0,0,0.28)";p.fillStyle=k;var S=_.__controlPoints?xr(B,[y.x,y.y].concat(st(_.__controlPoints),[g.x,g.y])):null,C=0,N=!1;v.forEach(function(E){var I=!!E.__singleHop;if(E.hasOwnProperty("__progressRatio")||(E.__progressRatio=I?0:(C+x)/m),!I&&C++,E.__progressRatio+=w,E.__progressRatio>=1)if(!I)E.__progressRatio=E.__progressRatio%1;else{N=!0;return}var R=E.__progressRatio,j=S?S.get(R):{x:y.x+(g.x-y.x)*R||0,y:y.y+(g.y-y.y)*R||0};n.linkDirectionalParticleCanvasObject?n.linkDirectionalParticleCanvasObject(j.x,j.y,_,p,n.globalScale):(p.beginPath(),p.arc(j.x,j.y,b,0,2*Math.PI,!1),p.fill())}),N&&(_.__photons=_.__photons.filter(function(E){return!E.__singleHop||E.__progressRatio<=1}))}}}),p.restore()}},emitParticle:function(n,r){return r&&(!r.__photons&&(r.__photons=[]),r.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:tf().force("link",Vc()).force("charge",ef()).force("center",Xu()).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&&Sr(n.graphData.nodes,W(n.nodeAutoColorBy),n.nodeColor),n.linkAutoColorBy!==null&&Sr(n.graphData.links,W(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&&Ff(n.graphData,function(d){return d[n.nodeId]},{nodeFilter:n.dagNodeFilter,onLoopError:n.onDagError||void 0}),a=Math.max.apply(Math,st(Object.values(o||[]))),s=n.dagLevelDistance||n.graphData.nodes.length/(a||1)*jf*(["radialin","radialout"].indexOf(n.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(r.dagMode)){var l=["lr","rl"].includes(r.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return delete d[l]})}if(["lr","rl","td","bu"].includes(n.dagMode)){var u=["rl","bu"].includes(n.dagMode),c=function(p){return(o[p[n.nodeId]]-a/2)*s*(u?-1:1)},h=["lr","rl"].includes(n.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return d[h]=c(d)})}n.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(n.dagMode)!==-1?nf(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 f=0;f<n.warmupTicks&&!(n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin);f++)n.forceLayout.tick();this.resetCountdown(),n.onFinishUpdate()}});function Di(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(l,u){r.forEach(function(c){return u[c][a](l)})},triggerUpdate:!1}},linkMethod:function(a){return function(s){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];var h=[];return r.forEach(function(f){var d=s[f],p=d[a].apply(d,u);p!==d&&h.push(p)}),h.length?h[0]:this}}}}var Lf=800,$f=4,Uf=5,Fi=Di("forceGraph",Oe),Hf=Di(["forceGraph","shadowGraph"],Oe),Wf=Object.assign.apply(Object,st(["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 ue({},e,Fi.linkProp(e))})).concat(st(["nodeRelSize","nodeId","nodeVal","nodeVisibility","linkSource","linkTarget","linkVisibility","linkCurvature"].map(function(e){return ue({},e,Hf.linkProp(e))})))),qf=Object.assign.apply(Object,st(["d3Force","d3ReheatSimulation","emitParticle"].map(function(e){return ue({},e,Fi.linkMethod(e))})));function Ke(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=dt(e.canvas).k;e.zoom.translateBy(e.zoom.__baseElem,(e.width-n)/2/o,(e.height-r)/2/o),e.needsRedraw=!0}}function ji(e){var n=window.devicePixelRatio;e.setTransform(n,0,0,n,0,0)}function Cr(e,n,r){e.save(),ji(e),e.clearRect(0,0,n,r),e.restore()}var Bf=Mn({props:Ft({width:{default:window.innerWidth,onChange:function(n,r){return Ke(r)},triggerUpdate:!1},height:{default:window.innerHeight,onChange:function(n,r){return Ke(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(l){if(!l.hasOwnProperty("__indexColor"))return!0;var u=r.colorTracker.lookup(l.__indexColor);return!u||!u.hasOwnProperty("d")||u.d!==l}).forEach(function(l){l.__indexColor=r.colorTracker.register({type:a,d:l})})}},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}},Wf),aliases:{stopAnimation:"pauseAnimation"},methods:Ft({graph2ScreenCoords:function(n,r,i){var o=dt(n.canvas);return{x:r*o.k+o.x,y:i*o.k+o.y}},screen2GraphCoords:function(n,r,i){var o=dt(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 Kn(s()).to(a,o).easing(Rt.Quadratic.Out).onUpdate(l).start()):l(a),this}return s();function s(){var u=dt(n.canvas);return{x:(n.width/2-u.x)/u.k,y:(n.height/2-u.y)/u.k}}function l(u){var c=u.x,h=u.y;n.zoom.translateTo(n.zoom.__baseElem,c===void 0?s().x:c,h===void 0?s().y:h),n.needsRedraw=!0}},zoom:function(n,r,i){if(!n.canvas)return null;if(r!==void 0)return i?n.tweenGroup.add(new Kn({k:o()}).to({k:r},i).easing(Rt.Quadratic.Out).onUpdate(function(s){var l=s.k;return a(l)}).start()):a(r),this;return o();function o(){return dt(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 l=this.getGraphBbox.apply(this,a);if(l){var u={x:(l.x[0]+l.x[1])/2,y:(l.y[0]+l.y[1])/2},c=Math.max(1e-12,Math.min(1e12,(n.width-i*2)/(l.x[1]-l.x[0]),(n.height-i*2)/(l.y[1]-l.y[0])));this.centerAt(u.x,u.y,r),this.zoom(c,r)}return this},getGraphBbox:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},i=W(n.nodeVal),o=function(l){return Math.sqrt(Math.max(0,i(l)||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:[Dn(a,function(s){return s.x-s.r}),Fn(a,function(s){return s.x+s.r})],y:[Dn(a,function(s){return s.y-s.r}),Fn(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:[]})}},qf),stateInit:function(){return{lastSetZoom:1,zoom:il(),forceGraph:new Oe,shadowGraph:new Oe().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new Mu,tweenGroup:new li}},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}),l={x:-1e12,y:-1e12},u=function(){var f=null,d=window.devicePixelRatio,p=l.x>0&&l.y>0?s.getImageData(l.x*d,l.y*d,1,1):null;return p&&(f=r.colorTracker.lookup(p.data)),f};at(r.canvas).call(za().subject(function(){if(!r.enableNodeDrag)return null;var h=u();return h&&h.type==="Node"?h.d:null}).on("start",function(h){var f=h.subject;f.__initialDragPos={x:f.x,y:f.y,fx:f.fx,fy:f.fy},h.active||(f.fx=f.x,f.fy=f.y),r.canvas.classList.add("grabbable")}).on("drag",function(h){var f=h.subject,d=f.__initialDragPos,p=h,_=dt(r.canvas).k,m={x:d.x+(p.x-d.x)/_-f.x,y:d.y+(p.y-d.y)/_-f.y};["x","y"].forEach(function(y){return f["f".concat(y)]=f[y]=d[y]+(p[y]-d[y])/_}),!(!f.__dragged&&Uf>=Math.sqrt(ol(["x","y"].map(function(y){return Math.pow(h[y]-d[y],2)}))))&&(r.forceGraph.d3AlphaTarget(.3).resetCountdown(),r.isPointerDragging=!0,f.__dragged=!0,r.onNodeDrag(f,m))}).on("end",function(h){var f=h.subject,d=f.__initialDragPos,p={x:f.x-d.x,y:f.y-d.y};d.fx===void 0&&(f.fx=void 0),d.fy===void 0&&(f.fy=void 0),delete f.__initialDragPos,r.forceGraph.d3AlphaTarget()&&r.forceGraph.d3AlphaTarget(0).resetCountdown(),r.canvas.classList.remove("grabbable"),r.isPointerDragging=!1,f.__dragged&&(delete f.__dragged,r.onNodeDragEnd(f,p))})),r.zoom(r.zoom.__baseElem=at(r.canvas)),r.zoom.__baseElem.on("dblclick.zoom",null),r.zoom.filter(function(h){return!h.button&&r.enableZoomPanInteraction&&(h.type!=="wheel"||W(r.enableZoomInteraction)(h))&&(h.type==="wheel"||W(r.enablePanInteraction)(h))}).on("zoom",function(h){var f=h.transform;[a,s].forEach(function(d){ji(d),d.translate(f.x,f.y),d.scale(f.k,f.k)}),r.isPointerDragging=!0,r.onZoom&&r.onZoom(Ft(Ft({},f),i.centerAt())),r.needsRedraw=!0}).on("end",function(h){r.isPointerDragging=!1,r.onZoomEnd&&r.onZoomEnd(Ft(Ft({},h.transform),i.centerAt()))}),Ke(r),r.forceGraph.onNeedsRedraw(function(){return r.needsRedraw=!0}).onFinishUpdate(function(){dt(r.canvas).k===r.lastSetZoom&&r.graphData.nodes.length&&(r.zoom.scaleTo(r.zoom.__baseElem,r.lastSetZoom=$f/Math.cbrt(r.graphData.nodes.length)),r.needsRedraw=!0)}),r.tooltip=new Gu(o),["pointermove","pointerdown"].forEach(function(h){return o.addEventListener(h,function(f){h==="pointerdown"&&(r.isPointerPressed=!0,r.pointerDownEvent=f),!r.isPointerDragging&&f.type==="pointermove"&&r.onBackgroundClick&&(f.pressure>0||r.isPointerPressed)&&(f.pointerType==="mouse"||f.movementX===void 0||[f.movementX,f.movementY].some(function(_){return Math.abs(_)>1}))&&(r.isPointerDragging=!0);var d=p(o);l.x=f.pageX-d.left,l.y=f.pageY-d.top;function p(_){var m=_.getBoundingClientRect(),y=window.pageXOffset||document.documentElement.scrollLeft,g=window.pageYOffset||document.documentElement.scrollTop;return{top:m.top+g,left:m.left+y}}},{passive:!0})}),o.addEventListener("pointerup",function(h){if(r.isPointerPressed){if(r.isPointerPressed=!1,r.isPointerDragging){r.isPointerDragging=!1;return}var f=[h,r.pointerDownEvent];requestAnimationFrame(function(){if(h.button===0)if(r.hoverObj){var d=r["on".concat(r.hoverObj.type,"Click")];d&&d.apply(void 0,[r.hoverObj.d].concat(f))}else r.onBackgroundClick&&r.onBackgroundClick.apply(r,f);if(h.button===2)if(r.hoverObj){var p=r["on".concat(r.hoverObj.type,"RightClick")];p&&p.apply(void 0,[r.hoverObj.d].concat(f))}else r.onBackgroundRightClick&&r.onBackgroundRightClick.apply(r,f)})}},{passive:!0}),o.addEventListener("contextmenu",function(h){return!r.onBackgroundRightClick&&!r.onNodeRightClick&&!r.onLinkRightClick?!0:(h.preventDefault(),!1)}),r.forceGraph(a),r.shadowGraph(s);var c=zl(function(){Cr(s,r.width,r.height),r.shadowGraph.linkWidth(function(f){return W(r.linkWidth)(f)+r.linkHoverPrecision});var h=dt(r.canvas);r.shadowGraph.globalScale(h.k).tickFrame()},Lf);r.flushShadowCanvas=c.flush,(this._animationCycle=function h(){var f=!r.autoPauseRedraw||!!r.needsRedraw||r.forceGraph.isEngineRunning()||r.graphData.links.some(function(x){return x.__photons&&x.__photons.length});if(r.needsRedraw=!1,r.enablePointerInteraction){var d=r.isPointerDragging?null:u();if(d!==r.hoverObj){var p=r.hoverObj,_=p?p.type:null,m=d?d.type:null;if(_&&_!==m){var y=r["on".concat(_,"Hover")];y&&y(null,p.d)}if(m){var g=r["on".concat(m,"Hover")];g&&g(d.d,_===m?p.d:null)}r.tooltip.content(d&&W(r["".concat(d.type.toLowerCase(),"Label")])(d.d)||null),r.canvas.classList[(d&&r["on".concat(m,"Click")]||!d&&r.onBackgroundClick)&&W(r.showPointerCursor)(d==null?void 0:d.d)?"add":"remove"]("clickable"),r.hoverObj=d}f&&c()}if(f){Cr(a,r.width,r.height);var w=dt(r.canvas).k;r.onRenderFramePre&&r.onRenderFramePre(a,w),r.forceGraph.globalScale(w).tickFrame(),r.onRenderFramePost&&r.onRenderFramePost(a,w)}r.tweenGroup.update(),r.animationFrameRequestId=requestAnimationFrame(h)})()},update:function(n){}}),Vf=["https://guardiankg.org/vocab/","https://umanitek.ai/dkg/vocab/","http://umanitek.ai/dkg/vocab/","https://schema.org/","http://schema.org/"];function Ze(e,n){var r;for(const i of Vf){const o=(r=e.properties)==null?void 0:r.get(i+n);if(o&&o.length>0)return o[0].value}return null}function Gf(e,n){var r;if(e.focal){const i=Xf(n,e.focal.uri);i&&(i.sizeMultiplier=e.focal.sizeMultiplier??1.5,e.focal.image&&(i.imageUrl=e.focal.image))}if(e.platformIcons)for(const i of n.nodes.values()){if(i.imageUrl||!i.types.some(a=>a.includes("SocialMediaPosting")))continue;const o=n.getEdgesFrom(i.id).filter(a=>a.predicate.includes("platform"));for(const a of o){const s=a.target.split("/").pop()??"";if(e.platformIcons.icons[s]){i.imageUrl=e.platformIcons.icons[s];break}}if(!i.imageUrl&&e.platformIcons.urlFallbacks){for(const[a,s]of Object.entries(e.platformIcons.urlFallbacks))if(i.id.includes(a)&&e.platformIcons.icons[s]){i.imageUrl=e.platformIcons.icons[s];break}}}if(e.highlight){const i=e.highlight,o=[],a=i.invert===!0;for(const[u,c]of n.nodes){let h=null;if(i.source==="linked"&&i.linkedVia){const f=n.getEdgesFrom(u).filter(d=>d.predicate.includes(i.linkedVia));if(f.length>0){const d=n.nodes.get(f[0].target);if(d){const p=Ze(d,i.property);p!==null&&(h=parseFloat(p))}}}else{const f=Ze(c,i.property);f!==null&&(h=parseFloat(f))}if(h!==null&&!isNaN(h)){const f=i.threshold;let d,p=!1;if(h<0){const _=Math.abs(h);c.riskScore=_,d=_,p=a?_<=f&&_>0:_>=f}else c.riskScore=h,a?(p=h<=f,d=p?f-h:0):(p=h>=f,d=h);p&&o.push({id:u,score:d})}}const s=i.topN??100;o.sort((u,c)=>c.score-u.score);const l=o.slice(0,s);if(l.length>0){const u=i.sizeMin??1,c=i.sizeMax??i.sizeMultiplier??3,h=l[0].score,f=l[l.length-1].score;for(const{id:d,score:p}of l){const _=n.nodes.get(d);if(!_||(_.isHighRisk=!0,_.sizeMultiplier))continue;let m;if(Math.abs(h-f)>0){const g=Math.log1p(Math.min(h,f)),x=Math.log1p(Math.max(h,f))-g,v=Math.log1p(p);m=x>0?(v-g)/x:.5}else m=1;_.sizeMultiplier=u+m*(c-u)}}}if(e.sizeBy){const i=e.sizeBy,o=[];for(const[a,s]of n.nodes){if(s.sizeMultiplier)continue;const l=Ze(s,i.property);if(l!==null){const u=parseFloat(l);!isNaN(u)&&u>0&&o.push({id:a,value:u})}}if(o.length>0){const a=Math.max(...o.map(l=>l.value)),s=Math.min(...o.map(l=>l.value));for(const{id:l,value:u}of o){const c=n.nodes.get(l);if(!c||c.sizeMultiplier)continue;let h;if(i.scale==="log"){const f=Math.log1p(s),p=Math.log1p(a)-f;h=p>0?(Math.log1p(u)-f)/p:.5}else{const f=a-s;h=f>0?(u-s)/f:.5}c.sizeMultiplier=.5+h*2.5}}}if(e.nodeTypes){for(const i of n.nodes.values())if(!i.imageUrl)for(const o of i.types){const a=((r=o.split("/").pop())==null?void 0:r.split("#").pop())??"",s=e.nodeTypes[o]||e.nodeTypes[`schema:${a}`]||e.nodeTypes[`vocab:${a}`]||e.nodeTypes[a];if(s!=null&&s.icon){i.imageUrl=s.icon;break}}}}function Xf(e,n){const r=e.nodes.get(n);if(r)return r;const i=n.replace(/^https?:\/\/[^\/]+\//,""),o=["https://guardiankg.org/","https://umanitek.ai/dkg/","http://umanitek.ai/dkg/"];for(const a of o){const s=e.nodes.get(a+i);if(s)return s}return null}var De={name:"dark",background:"#0a0a0f",surface:"rgba(20, 20, 30, 0.95)",surfaceBorder:"rgba(100, 100, 140, 0.3)",textPrimary:"#e2e8f0",textSecondary:"#94a3b8",textMuted:"#64748b",primary:"#6366f1",primaryMuted:"rgba(120, 120, 220, 0.5)",danger:"#e04040",warning:"#f59e0b",safe:"#10b981",info:"#3b82f6",edgeColor:"#1a1a3a",edgeLabel:"#94a3b8",particleColor:"rgba(100, 160, 255, 0.5)",focalGlow:"rgba(99, 102, 241, 0.3)",nodeColors:["#6366f1","#8b5cf6","#a855f7","#3b82f6","#06b6d4","#10b981","#f59e0b","#ef4444","#ec4899","#14b8a6","#f97316","#8b5cf6"]},Yf={name:"midnight",background:"#050510",surface:"rgba(10, 10, 25, 0.95)",surfaceBorder:"rgba(60, 80, 160, 0.3)",textPrimary:"#c8d6e5",textSecondary:"#7f8fa6",textMuted:"#4a5568",primary:"#3b82f6",primaryMuted:"rgba(59, 130, 246, 0.4)",danger:"#dc2626",warning:"#d97706",safe:"#059669",info:"#2563eb",edgeColor:"#0f1a3a",edgeLabel:"#7f8fa6",particleColor:"rgba(59, 130, 246, 0.5)",focalGlow:"rgba(59, 130, 246, 0.3)",nodeColors:["#3b82f6","#2563eb","#1d4ed8","#06b6d4","#0891b2","#0e7490","#8b5cf6","#7c3aed","#6366f1","#4f46e5","#14b8a6","#0d9488"]},Kf={name:"cyberpunk",background:"#0a0a0a",surface:"rgba(15, 15, 15, 0.95)",surfaceBorder:"rgba(0, 255, 136, 0.2)",textPrimary:"#e0ffe0",textSecondary:"#80c080",textMuted:"#407040",primary:"#00ff88",primaryMuted:"rgba(0, 255, 136, 0.3)",danger:"#ff2d6a",warning:"#ffaa00",safe:"#00ff88",info:"#00d4ff",edgeColor:"#0a1a0a",edgeLabel:"#80c080",particleColor:"rgba(0, 255, 136, 0.5)",focalGlow:"rgba(0, 255, 136, 0.3)",nodeColors:["#00ff88","#ff2d6a","#00d4ff","#ffaa00","#ff6b35","#a855f7","#06ffd0","#ff1493","#39ff14","#ff6ec7","#00bfff","#ffd700"]},Zf={name:"light",background:"#f8fafc",surface:"rgba(255, 255, 255, 0.95)",surfaceBorder:"rgba(148, 163, 184, 0.3)",textPrimary:"#1e293b",textSecondary:"#475569",textMuted:"#94a3b8",primary:"#4f46e5",primaryMuted:"rgba(79, 70, 229, 0.3)",danger:"#dc2626",warning:"#d97706",safe:"#059669",info:"#2563eb",edgeColor:"#cbd5e1",edgeLabel:"#475569",particleColor:"rgba(79, 70, 229, 0.4)",focalGlow:"rgba(79, 70, 229, 0.2)",nodeColors:["#4f46e5","#7c3aed","#9333ea","#2563eb","#0891b2","#059669","#d97706","#dc2626","#db2777","#0d9488","#ea580c","#7c3aed"]},Qf={dark:De,midnight:Yf,cyberpunk:Kf,light:Zf};function Jf(e,n){let r;return e?typeof e=="string"?r=Qf[e]??De:r=e:r=De,n?{...r,...n,name:n.name??r.name}:r}function th(e,n){const r={"--gv-bg":n.background,"--gv-surface":n.surface,"--gv-surface-border":n.surfaceBorder,"--gv-text":n.textPrimary,"--gv-text-secondary":n.textSecondary,"--gv-text-muted":n.textMuted,"--gv-primary":n.primary,"--gv-primary-muted":n.primaryMuted,"--gv-danger":n.danger,"--gv-warning":n.warning,"--gv-safe":n.safe,"--gv-info":n.info,"--gv-edge":n.edgeColor,"--gv-particle":n.particleColor,"--gv-focal-glow":n.focalGlow};for(const[i,o]of Object.entries(r))e.style.setProperty(i,o)}var jt={wasDerivedFrom:["http://www.w3.org/ns/prov#wasDerivedFrom"],wasGeneratedBy:["http://www.w3.org/ns/prov#wasGeneratedBy"],generatedAtTime:["http://www.w3.org/ns/prov#generatedAtTime"],contentHash:["https://umanitek.ai/dkg/vocab/contentHash","https://guardiankg.org/vocab/contentHash","http://umanitek.ai/dkg/vocab/contentHash"],dataSource:["https://umanitek.ai/dkg/vocab/dataSource","https://guardiankg.org/vocab/dataSource","http://umanitek.ai/dkg/vocab/dataSource"]},eh=["https://schema.org/name","http://schema.org/name","http://xmlns.com/foaf/0.1/name","http://www.w3.org/2000/01/rdf-schema#label"],Ar=["https://umanitek.ai/dkg/vocab/DataSource","http://umanitek.ai/dkg/vocab/DataSource","https://guardiankg.org/vocab/DataSource","http://www.w3.org/ns/prov#Agent"],nh=class{resolve(e){for(const n of e.nodes.values())n.provenance=this._resolveNodeProvenance(n,e)}_resolveNodeProvenance(e,n){var l,u,c;const r={sources:[],sourceNames:[]};r.contentHash=this._findValue(e,jt.contentHash),r.generatedAt=this._findMetadataValue(e,jt.generatedAtTime);const i=this._findMetadataValue(e,jt.wasGeneratedBy);if(i){r.generatedBy=i;const h=n.nodes.get(i);h?r.generatedByName=this._resolveName(h)??void 0:r.generatedByName=i.split("/").pop()??i}const o=new Set,a=[],s=n.getEdgesFrom(e.id);for(const h of s)if(jt.wasDerivedFrom.some(f=>h.predicate===f)){const f=n.nodes.get(h.target);if(f&&f.types.some(p=>Ar.includes(p))&&!o.has(h.target)){o.add(h.target);const p=this._resolveName(f)??h.target.split("/").pop()??h.target;a.push(p)}}for(const h of jt.wasDerivedFrom){const f=(l=e.metadata)==null?void 0:l.get(h);if(f)for(const d of f){const p=d.value;if(o.has(p))continue;const _=n.nodes.get(p);if(_&&_.types.some(y=>Ar.includes(y))){o.add(p);const y=this._resolveName(_)??p.split("/").pop()??p;a.push(y)}}}for(const h of jt.dataSource){const f=((u=e.properties)==null?void 0:u.get(h))??((c=e.metadata)==null?void 0:c.get(h));if(f)for(const d of f){const p=d.value;if(o.has(p))continue;o.add(p);const _=n.nodes.get(p),m=_?this._resolveName(_)??p.split("/").pop()??p:p.split("/").pop()??p;a.push(m)}}return r.sources=[...o],r.sourceNames=a,r}_findValue(e,n){var r;for(const i of n){const o=(r=e.properties)==null?void 0:r.get(i);if(o&&o.length>0)return o[0].value}}_findMetadataValue(e,n){var r;for(const i of n){const o=(r=e.metadata)==null?void 0:r.get(i);if(o&&o.length>0)return o[0].value}return this._findValue(e,n)}_resolveName(e){var n;for(const r of eh){const i=(n=e.properties)==null?void 0:n.get(r);if(i&&i.length>0)return i[0].value}return null}},rh=["https://schema.org/","http://schema.org/","https://guardiankg.org/vocab/","https://umanitek.ai/dkg/vocab/","http://umanitek.ai/dkg/vocab/","http://www.w3.org/ns/prov#"],Pr=class{constructor(e){P(this,"_nodeDates",new Map);P(this,"_dateRange",null);P(this,"_cursor",null);P(this,"_dateProperties");P(this,"_showUndated");this._dateProperties=(e==null?void 0:e.dateProperties)??["dateCreated"],this._showUndated=(e==null?void 0:e.showUndated)??!0}scan(e){this._nodeDates.clear();let n=null,r=null;for(const[i,o]of e.nodes){const a=this._extractDate(o);a&&(this._nodeDates.set(i,a),(!n||a<n)&&(n=a),(!r||a>r)&&(r=a))}n&&r?(this._dateRange=[n,r],this._cursor=r):(this._dateRange=null,this._cursor=null)}get dateRange(){return this._dateRange}get cursor(){return this._cursor}get datedNodeCount(){return this._nodeDates.size}get showUndated(){return this._showUndated}set showUndated(e){this._showUndated=e}setCursor(e){this._cursor=e}getNodeDate(e){return this._nodeDates.get(e)??null}getVisibleNodeIds(e){if(!this._dateRange||!this._cursor)return null;const n=new Set,r=this._cursor.getTime();for(const i of e){const o=this._nodeDates.get(i);o?o.getTime()<=r&&n.add(i):this._showUndated&&n.add(i)}return n}computeHistogram(e=50){if(!this._dateRange)return[];const[n,r]=this._dateRange,i=r.getTime()-n.getTime();if(i<=0)return[{date:n,count:this._nodeDates.size}];const o=i/e,a=[];for(let s=0;s<e;s++)a.push({date:new Date(n.getTime()+s*o),count:0});for(const s of this._nodeDates.values()){const l=Math.min(Math.floor((s.getTime()-n.getTime())/o),e-1);a[l].count++}return a}_extractDate(e){var r;let n=null;for(const i of this._dateProperties)for(const o of rh){const a=(r=e.properties)==null?void 0:r.get(o+i);if(a&&a.length>0){const s=new Date(a[0].value);isNaN(s.getTime())||(!n||s<n)&&(n=s)}}return n}},ih=class{constructor(e,n,r){P(this,"_container");P(this,"_filter");P(this,"_config");P(this,"_root",null);P(this,"_slider",null);P(this,"_dateLabel",null);P(this,"_countLabel",null);P(this,"_playBtn",null);P(this,"_histCanvas",null);P(this,"_startLabel",null);P(this,"_endLabel",null);P(this,"_playInterval",null);P(this,"_isPlaying",!1);P(this,"_onChange",null);P(this,"_styleId","gv-timeline-styles");this._container=e,this._filter=n,this._config=r}onChange(e){this._onChange=e}mount(){var n;this._root||!this._filter.dateRange||(this._root=document.createElement("div"),this._root.className="gv-timeline-overlay",this._root.innerHTML=this._buildHTML(),this._injectStyles(),this._container.appendChild(this._root),this._slider=this._root.querySelector(".gv-tl-slider"),this._dateLabel=this._root.querySelector(".gv-tl-date"),this._countLabel=this._root.querySelector(".gv-tl-count"),this._playBtn=this._root.querySelector(".gv-tl-play"),this._histCanvas=this._root.querySelector(".gv-tl-hist"),this._startLabel=this._root.querySelector(".gv-tl-start"),this._endLabel=this._root.querySelector(".gv-tl-end"),this._drawHistogram(),this._slider.value=this._slider.max,this._updateDateLabel(),this._slider.addEventListener("input",()=>this._onSliderInput()),(n=this._playBtn)==null||n.addEventListener("click",()=>this._togglePlay()))}unmount(){this.pause(),this._root&&(this._root.remove(),this._root=null)}get mounted(){return this._root!==null}refresh(){if(!this._root)return;const e=this._filter.dateRange;if(!e){this.unmount();return}this._slider&&(this._slider.min=String(e[0].getTime()),this._slider.max=String(e[1].getTime())),this._drawHistogram(),this._startLabel&&(this._startLabel.textContent=this._formatDateShort(e[0])),this._endLabel&&(this._endLabel.textContent=this._formatDateShort(e[1])),this._updateDateLabel()}play(){if(this._isPlaying)return;this._isPlaying=!0,this._playBtn&&(this._playBtn.textContent="⏸");const e=this._filter.dateRange;if(!e||!this._slider)return;e[1].getTime()-e[0].getTime();const n=this._getStepMs(),r=this._config.playSpeed??200;this._playInterval=setInterval(()=>{const o=parseInt(this._slider.value,10)+n;if(o>=e[1].getTime()){this._slider.value=String(e[1].getTime()),this._onSliderInput(),this.pause();return}this._slider.value=String(o),this._onSliderInput()},r)}pause(){this._isPlaying=!1,this._playBtn&&(this._playBtn.textContent="▶"),this._playInterval&&(clearInterval(this._playInterval),this._playInterval=null)}setCursor(e){this._slider&&(this._slider.value=String(e.getTime()),this._onSliderInput())}_buildHTML(){const e=this._filter.dateRange,n=e[0].getTime(),r=e[1].getTime();return`
|
|
44
|
+
<div class="gv-tl-bar">
|
|
45
|
+
<button class="gv-tl-play" title="Play/Pause timeline">▶</button>
|
|
46
|
+
<div class="gv-tl-track">
|
|
47
|
+
<div class="gv-tl-labels">
|
|
48
|
+
<span class="gv-tl-start">${this._formatDateShort(e[0])}</span>
|
|
49
|
+
<span class="gv-tl-date"></span>
|
|
50
|
+
<span class="gv-tl-end">${this._formatDateShort(e[1])}</span>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="gv-tl-slider-wrap">
|
|
53
|
+
<canvas class="gv-tl-hist" width="600" height="32"></canvas>
|
|
54
|
+
<input type="range" class="gv-tl-slider" min="${n}" max="${r}" value="${r}" step="1" />
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="gv-tl-count" title="Visible nodes">—</div>
|
|
58
|
+
</div>
|
|
59
|
+
`}_onSliderInput(){var r;if(!this._slider)return;const e=parseInt(this._slider.value,10),n=new Date(e);this._filter.setCursor(n),this._updateDateLabel(),(r=this._onChange)==null||r.call(this,n,0)}_updateDateLabel(){if(!this._dateLabel||!this._slider)return;const e=parseInt(this._slider.value,10),n=new Date(e);this._dateLabel.textContent=this._formatDateFull(n)}updateCount(e){this._countLabel&&(this._countLabel.textContent=e.toLocaleString())}_togglePlay(){this._isPlaying?this.pause():(this._slider&&this._filter.dateRange&&parseInt(this._slider.value,10)>=this._filter.dateRange[1].getTime()-this._getStepMs()&&(this._slider.value=String(this._filter.dateRange[0].getTime()),this._onSliderInput()),this.play())}_getStepMs(){const e=this._config.stepSize??"day",n=this._filter.dateRange;if(!n)return 864e5;const i=(n[1].getTime()-n[0].getTime())/200;switch(e){case"hour":return Math.max(36e5,i);case"day":return Math.max(864e5,i);case"week":return Math.max(6048e5,i);case"month":return Math.max(2592e6,i);default:return i}}_drawHistogram(){const e=this._histCanvas;if(!e)return;const n=e.getContext("2d");if(!n)return;const r=this._filter.computeHistogram(e.width/4);if(r.length===0)return;const i=Math.max(...r.map(l=>l.count));if(i===0)return;const o=e.width,a=e.height,s=o/r.length;n.clearRect(0,0,o,a);for(let l=0;l<r.length;l++){const c=r[l].count/i*(a-2);n.fillStyle="rgba(99, 102, 241, 0.25)",n.fillRect(l*s,a-c,s-1,c)}}_formatDateShort(e){return e.toLocaleDateString("en-US",{month:"short",year:"numeric"})}_formatDateFull(e){return e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}_injectStyles(){if(document.getElementById(this._styleId))return;const e=document.createElement("style");e.id=this._styleId,e.textContent=`
|
|
60
|
+
.gv-timeline-overlay {
|
|
61
|
+
position: absolute;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
left: 0;
|
|
64
|
+
right: 0;
|
|
65
|
+
z-index: 90;
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
}
|
|
68
|
+
.gv-tl-bar {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 10px;
|
|
72
|
+
padding: 10px 16px 12px;
|
|
73
|
+
background: linear-gradient(to top,
|
|
74
|
+
var(--gv-bg, rgba(10, 10, 15, 0.95)) 0%,
|
|
75
|
+
var(--gv-bg, rgba(10, 10, 15, 0.85)) 60%,
|
|
76
|
+
transparent 100%);
|
|
77
|
+
pointer-events: auto;
|
|
78
|
+
}
|
|
79
|
+
.gv-tl-play {
|
|
80
|
+
width: 32px;
|
|
81
|
+
height: 32px;
|
|
82
|
+
border-radius: 50%;
|
|
83
|
+
border: 1px solid var(--gv-surface-border, rgba(100, 100, 140, 0.3));
|
|
84
|
+
background: var(--gv-surface, rgba(20, 20, 30, 0.9));
|
|
85
|
+
color: var(--gv-text, #e0e0e0);
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
font-size: 14px;
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
transition: background 0.2s, border-color 0.2s;
|
|
93
|
+
padding: 0;
|
|
94
|
+
line-height: 1;
|
|
95
|
+
}
|
|
96
|
+
.gv-tl-play:hover {
|
|
97
|
+
background: var(--gv-primary-muted, rgba(99, 102, 241, 0.3));
|
|
98
|
+
border-color: var(--gv-primary, rgba(99, 102, 241, 0.5));
|
|
99
|
+
}
|
|
100
|
+
.gv-tl-track {
|
|
101
|
+
flex: 1;
|
|
102
|
+
min-width: 0;
|
|
103
|
+
position: relative;
|
|
104
|
+
}
|
|
105
|
+
.gv-tl-labels {
|
|
106
|
+
display: flex;
|
|
107
|
+
justify-content: space-between;
|
|
108
|
+
font-size: 10px;
|
|
109
|
+
color: var(--gv-text-muted, #666);
|
|
110
|
+
margin-bottom: 2px;
|
|
111
|
+
padding: 0 2px;
|
|
112
|
+
}
|
|
113
|
+
.gv-tl-date {
|
|
114
|
+
font-weight: 600;
|
|
115
|
+
color: var(--gv-text-secondary, #aaa);
|
|
116
|
+
font-size: 11px;
|
|
117
|
+
}
|
|
118
|
+
.gv-tl-slider-wrap {
|
|
119
|
+
position: relative;
|
|
120
|
+
height: 32px;
|
|
121
|
+
}
|
|
122
|
+
.gv-tl-hist {
|
|
123
|
+
position: absolute;
|
|
124
|
+
top: 0;
|
|
125
|
+
left: 0;
|
|
126
|
+
width: 100%;
|
|
127
|
+
height: 100%;
|
|
128
|
+
pointer-events: none;
|
|
129
|
+
opacity: 0.7;
|
|
130
|
+
}
|
|
131
|
+
.gv-tl-slider {
|
|
132
|
+
position: absolute;
|
|
133
|
+
top: 0;
|
|
134
|
+
left: 0;
|
|
135
|
+
width: 100%;
|
|
136
|
+
height: 100%;
|
|
137
|
+
margin: 0;
|
|
138
|
+
-webkit-appearance: none;
|
|
139
|
+
appearance: none;
|
|
140
|
+
background: transparent;
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
z-index: 2;
|
|
143
|
+
}
|
|
144
|
+
.gv-tl-slider::-webkit-slider-runnable-track {
|
|
145
|
+
height: 4px;
|
|
146
|
+
border-radius: 2px;
|
|
147
|
+
background: var(--gv-surface-border, rgba(100, 100, 140, 0.3));
|
|
148
|
+
margin-top: 14px;
|
|
149
|
+
}
|
|
150
|
+
.gv-tl-slider::-webkit-slider-thumb {
|
|
151
|
+
-webkit-appearance: none;
|
|
152
|
+
width: 16px;
|
|
153
|
+
height: 16px;
|
|
154
|
+
border-radius: 50%;
|
|
155
|
+
background: var(--gv-primary, #6366f1);
|
|
156
|
+
border: 2px solid var(--gv-bg, #0a0a0f);
|
|
157
|
+
margin-top: -6px;
|
|
158
|
+
box-shadow: 0 0 8px var(--gv-primary-muted, rgba(99, 102, 241, 0.4));
|
|
159
|
+
transition: transform 0.15s ease;
|
|
160
|
+
}
|
|
161
|
+
.gv-tl-slider::-webkit-slider-thumb:hover {
|
|
162
|
+
transform: scale(1.2);
|
|
163
|
+
}
|
|
164
|
+
.gv-tl-slider::-moz-range-track {
|
|
165
|
+
height: 4px;
|
|
166
|
+
border-radius: 2px;
|
|
167
|
+
background: var(--gv-surface-border, rgba(100, 100, 140, 0.3));
|
|
168
|
+
border: none;
|
|
169
|
+
}
|
|
170
|
+
.gv-tl-slider::-moz-range-thumb {
|
|
171
|
+
width: 16px;
|
|
172
|
+
height: 16px;
|
|
173
|
+
border-radius: 50%;
|
|
174
|
+
background: var(--gv-primary, #6366f1);
|
|
175
|
+
border: 2px solid var(--gv-bg, #0a0a0f);
|
|
176
|
+
box-shadow: 0 0 8px var(--gv-primary-muted, rgba(99, 102, 241, 0.4));
|
|
177
|
+
}
|
|
178
|
+
.gv-tl-count {
|
|
179
|
+
min-width: 40px;
|
|
180
|
+
padding: 4px 8px;
|
|
181
|
+
border-radius: 12px;
|
|
182
|
+
background: var(--gv-surface, rgba(20, 20, 30, 0.9));
|
|
183
|
+
border: 1px solid var(--gv-surface-border, rgba(100, 100, 140, 0.3));
|
|
184
|
+
color: var(--gv-primary, #6366f1);
|
|
185
|
+
font-size: 12px;
|
|
186
|
+
font-weight: 600;
|
|
187
|
+
text-align: center;
|
|
188
|
+
flex-shrink: 0;
|
|
189
|
+
white-space: nowrap;
|
|
190
|
+
}
|
|
191
|
+
`,document.head.appendChild(e)}},Tr="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function Er(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("urn:")||e.startsWith("_:")||e.startsWith("<")&&e.endsWith(">")}function Lt(e){return e.startsWith("<")&&e.endsWith(">")?e.slice(1,-1):e}function Nr(e,n,r){return`${e}\0${n}\0${r}`}var oh=class{constructor(e){P(this,"nodes",new Map);P(this,"edges",new Map);P(this,"prefixes",{});P(this,"_triples",[]);P(this,"_metadataPredicates",new Set);P(this,"_outEdges",new Map);P(this,"_inEdges",new Map);P(this,"kaGroups",new Map);P(this,"_kaMembershipPredicate",null);if(e)for(const n of e)this._metadataPredicates.add(n)}get triples(){return this._triples}setKaMembershipPredicate(e){this._kaMembershipPredicate=e}ensureNode(e){let n=this.nodes.get(e);return n||(n={id:e,types:[],label:e,properties:new Map,imageUrl:null,metadata:new Map,degree:0,isBoundary:!1},this.nodes.set(e,n)),n}ensureAdjacency(e){this._outEdges.has(e)||this._outEdges.set(e,new Set),this._inEdges.has(e)||this._inEdges.set(e,new Set)}addTriple(e){this._triples.push(e);const n=Lt(e.subject),r=Lt(e.predicate),i=Lt(e.object),o=this.ensureNode(n);if(r===Tr){o.types.includes(i)||o.types.push(i);return}if(Er(e.object)){if(this._metadataPredicates.has(r)){const u={value:i,datatype:e.datatype,language:e.language},c=o.metadata.get(r);c?c.push(u):o.metadata.set(r,[u]);return}const s=this.ensureNode(i),l=Nr(n,r,i);if(this.edges.has(l)||(this.edges.set(l,{id:l,source:n,target:i,predicate:r,label:r}),o.degree++,s.degree++,this.ensureAdjacency(n),this.ensureAdjacency(i),this._outEdges.get(n).add(l),this._inEdges.get(i).add(l)),this._kaMembershipPredicate&&r===this._kaMembershipPredicate){let u=this.kaGroups.get(i);u||(u=new Set,this.kaGroups.set(i,u)),u.add(n)}}else{const s={value:e.object,datatype:e.datatype,language:e.language};if(this._metadataPredicates.has(r)){const l=o.metadata.get(r);l?l.push(s):o.metadata.set(r,[s])}else{const l=o.properties.get(r);l?l.push(s):o.properties.set(r,[s])}}}addTriples(e){const n=new Set(this.nodes.keys()),r=new Set(this.edges.keys());for(const s of e)this.addTriple(s);const i=[],o=[],a=new Set;for(const s of this.nodes.keys())n.has(s)?a.add(s):i.push(s);for(const s of this.edges.keys())r.has(s)||o.push(s);return{addedNodes:i,removedNodes:[],addedEdges:o,removedEdges:[],modifiedNodes:[...a]}}removeTriples(e){var o,a;const n=[],r=new Set;for(const s of e){const l=Lt(s.subject),u=Lt(s.predicate),c=Lt(s.object),h=this._triples.findIndex(d=>d.subject===s.subject&&d.predicate===s.predicate&&d.object===s.object);if(h!==-1&&this._triples.splice(h,1),u===Tr){const d=this.nodes.get(l);d&&(d.types=d.types.filter(p=>p!==c),r.add(l));continue}if(Er(s.object)&&!this._metadataPredicates.has(u)){const d=Nr(l,u,c);if(this.edges.has(d)){this.edges.delete(d),n.push(d),(o=this._outEdges.get(l))==null||o.delete(d),(a=this._inEdges.get(c))==null||a.delete(d);const p=this.nodes.get(l),_=this.nodes.get(c);p&&p.degree--,_&&_.degree--,r.add(l),r.add(c)}}else{const d=this.nodes.get(l);if(d){const p=this._metadataPredicates.has(u)?d.metadata:d.properties,_=p.get(u);if(_){const m=_.filter(y=>y.value!==s.object);m.length===0?p.delete(u):p.set(u,m),r.add(l)}}}}const i=[];for(const[s,l]of this.nodes)l.degree===0&&l.types.length===0&&l.properties.size===0&&l.metadata.size===0&&(this.nodes.delete(s),this._outEdges.delete(s),this._inEdges.delete(s),i.push(s));return{addedNodes:[],removedNodes:i,addedEdges:[],removedEdges:n,modifiedNodes:[...r]}}getNode(e){return this.nodes.get(e)}getEdgesFrom(e){const n=this._outEdges.get(e);if(!n)return[];const r=[];for(const i of n){const o=this.edges.get(i);o&&r.push(o)}return r}getEdgesTo(e){const n=this._inEdges.get(e);if(!n)return[];const r=[];for(const i of n){const o=this.edges.get(i);o&&r.push(o)}return r}getNeighborIds(e){const n=new Set,r=this._outEdges.get(e);if(r)for(const o of r){const a=this.edges.get(o);a&&n.add(a.target)}const i=this._inEdges.get(e);if(i)for(const o of i){const a=this.edges.get(o);a&&n.add(a.source)}return n}getHighestDegreeNode(){let e=null;for(const n of this.nodes.values())(!e||n.degree>e.degree)&&(e=n);return e}clear(){this.nodes.clear(),this.edges.clear(),this._triples=[],this._outEdges.clear(),this._inEdges.clear()}get tripleCount(){return this._triples.length}},ah={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",owl:"http://www.w3.org/2002/07/owl#",xsd:"http://www.w3.org/2001/XMLSchema#",schema:"https://schema.org/",foaf:"http://xmlns.com/foaf/0.1/",dcterms:"http://purl.org/dc/terms/",dc:"http://purl.org/dc/elements/1.1/",prov:"http://www.w3.org/ns/prov#",skos:"http://www.w3.org/2004/02/skos/core#"},re=class{constructor(e){P(this,"_prefixes");P(this,"_reverse");this._prefixes=new Map,this._reverse=new Map;for(const[n,r]of Object.entries(ah))this._prefixes.set(n,r),this._reverse.set(r,n);if(e)for(const[n,r]of Object.entries(e))this._prefixes.set(n,r),this._reverse.set(r,n)}addPrefix(e,n){this._prefixes.set(e,n),this._reverse.set(n,e)}addPrefixes(e){for(const[n,r]of Object.entries(e))this.addPrefix(n,r)}getNamespace(e){return this._prefixes.get(e)}getPrefix(e){return this._reverse.get(e)}compact(e){for(const[n,r]of this._reverse)if(e.startsWith(n)){const i=e.slice(n.length);if(i.length>0)return`${r}:${i}`}return null}expand(e){const n=e.indexOf(":");if(n===-1||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("urn:"))return e;const r=e.slice(0,n),i=e.slice(n+1),o=this._prefixes.get(r);return o?o+i:e}static localName(e){const n=e.lastIndexOf("#");if(n!==-1)return e.slice(n+1);const r=e.lastIndexOf("/");return r!==-1?e.slice(r+1):e}get prefixes(){const e={};for(const[n,r]of this._prefixes)e[n]=r;return e}},sh=["http://www.w3.org/2000/01/rdf-schema#label","https://schema.org/name","http://xmlns.com/foaf/0.1/name","http://purl.org/dc/terms/title","http://purl.org/dc/elements/1.1/title","https://schema.org/alternateName"],lh=class{constructor(e,n,r){P(this,"_mode");P(this,"_prefixManager");P(this,"_labelPredicates");this._mode=e,this._prefixManager=n,this._labelPredicates=(r==null?void 0:r.predicates)??sh}get mode(){return this._mode}set mode(e){this._mode=e}resolveNodeLabel(e){for(const n of this._labelPredicates){const r=e.properties.get(n);if(r&&r.length>0)return r[0].value}return this.resolveUri(e.id)}resolveEdgeLabel(e){return this.resolveUri(e.predicate)}resolveUri(e){return this._mode==="strict"?this._prefixManager.compact(e)??re.localName(e):zr(re.localName(e))}resolveTypeLabel(e){return this._mode==="strict"?this._prefixManager.compact(e)??re.localName(e):zr(re.localName(e))}resolvePredicateLabel(e){return this.resolveUri(e)}updateLabels(e,n){for(const r of e.values())r.label=this.resolveNodeLabel(r);for(const r of n.values())r.label=this.resolveEdgeLabel(r)}};function zr(e){if(!e)return"";let n=e.replace(/_/g," ");return n=n.replace(/([a-z])([A-Z])/g,"$1 $2"),n=n.replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2"),n.length>4&&(n=n.toLowerCase()),n.trim()}var uh={"https://schema.org/":"#8b5cf6","http://www.w3.org/ns/prov#":"#3b82f6","http://xmlns.com/foaf/0.1/":"#10b981","http://purl.org/dc/terms/":"#f59e0b"},ch=class{constructor(e,n,r){P(this,"_config");P(this,"_prefixManager");P(this,"_palette");this._prefixManager=n,this._palette=r??De,this._config={classColors:(e==null?void 0:e.classColors)??{},namespaceColors:(e==null?void 0:e.namespaceColors)??{},predicateColors:(e==null?void 0:e.predicateColors)??{},gradient:(e==null?void 0:e.gradient)??!0,gradientIntensity:(e==null?void 0:e.gradientIntensity)??.3,defaultNodeColor:(e==null?void 0:e.defaultNodeColor)??this._palette.primary,defaultEdgeColor:(e==null?void 0:e.defaultEdgeColor)??this._palette.edgeColor,edgeWidth:(e==null?void 0:e.edgeWidth)??1.5,edgeArrowSize:(e==null?void 0:e.edgeArrowSize)??4,borderWidth:(e==null?void 0:e.borderWidth)??1.5,fontFamily:(e==null?void 0:e.fontFamily)??"system-ui, -apple-system, sans-serif",fontSize:(e==null?void 0:e.fontSize)??11}}get palette(){return this._palette}setPalette(e){this._palette=e,this._config={...this._config},this._config.defaultNodeColor=e.primary,this._config.defaultEdgeColor=e.edgeColor}get config(){return this._config}getNodeColor(e){for(const n of e.types){const r=this._prefixManager.compact(n);if(r&&this._config.classColors[r])return this._config.classColors[r];if(this._config.classColors[n])return this._config.classColors[n]}for(const n of e.types){for(const[r,i]of Object.entries(this._config.namespaceColors)){const o=this._prefixManager.getNamespace(r)??r;if(n.startsWith(o))return i}for(const[r,i]of Object.entries(uh))if(n.startsWith(r))return i}return this._config.defaultNodeColor}getEdgeColor(e){const n=this._prefixManager.compact(e.predicate);return n&&this._config.predicateColors[n]?this._config.predicateColors[n]:this._config.predicateColors[e.predicate]?this._config.predicateColors[e.predicate]:this._config.defaultEdgeColor}getBorderColor(e){return Ir(e,.3)}getGradientCenter(e){return Ir(e,this._config.gradientIntensity)}};function Ir(e,n){const r=fh(e);if(!r)return e;const i=Math.round(r.r+(255-r.r)*n),o=Math.round(r.g+(255-r.g)*n),a=Math.round(r.b+(255-r.b)*n);return`#${((1<<24)+(i<<16)+(o<<8)+a).toString(16).slice(1)}`}function fh(e){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}var hh={baseSize:36,minSize:24,maxSize:72,scaleWithDegree:!0,imagePredicates:["https://schema.org/image","http://xmlns.com/foaf/0.1/img","http://xmlns.com/foaf/0.1/depiction"],imageUrlPredicate:"https://schema.org/url",circleTypes:[]},ye=new Map,dh=class{constructor(e,n,r){P(this,"_config");P(this,"_styleEngine");P(this,"_maxDegree",1);P(this,"_circleTypeSet");P(this,"_onImageLoad",null);P(this,"_trustStyle","none");P(this,"_showBadges",!0);this._config={...hh,...e},this._styleEngine=n,this._circleTypeSet=new Set;for(const i of this._config.circleTypes)this._circleTypeSet.add(i),r&&this._circleTypeSet.add(r.expand(i))}isCircleNode(e){return this._circleTypeSet.size===0?!1:e.types.some(n=>this._circleTypeSet.has(n))}setImageLoadCallback(e){this._onImageLoad=e}setMaxDegree(e){this._maxDegree=Math.max(1,e)}setTrustStyle(e){this._trustStyle=e}setShowBadges(e){this._showBadges=e}getRadius(e){if(this.isCircleNode(e)){if(!this._config.scaleWithDegree)return this._config.minSize*.7;const s=e.degree/this._maxDegree,l=this._config.maxSize*.6-this._config.minSize*.7;return this._config.minSize*.7+s*l}const n=e.sizeMultiplier??(e.isHighRisk?2:1),r=e.imageUrl?Math.max(this._config.maxSize*.6,8):0;if(!this._config.scaleWithDegree)return Math.max(this._config.baseSize,r)*n;const i=e.degree/this._maxDegree,o=this._config.maxSize-this._config.minSize,a=this._config.minSize+i*o;return Math.max(a,r)*n}paint(e,n,r,i,o,a=1){var _,m;if(this.isCircleNode(n))return this.paintCircle(e,n,r,i,o);const l=this.getRadius(n)*a,u=this._styleEngine.getNodeColor(n),c=this._styleEngine.palette,h=this._styleEngine.config;if(e.save(),a>1.03&&n.isHighRisk){const y=l*1.25,g=(a-1)*2.5;e.beginPath();for(let w=0;w<6;w++){const x=Math.PI/3*w,v=r+y*Math.cos(x),b=i+y*Math.sin(x);w===0?e.moveTo(v,b):e.lineTo(v,b)}e.closePath(),e.fillStyle=`rgba(220, 50, 50, ${Math.min(.4,g)})`,e.fill()}e.beginPath();for(let y=0;y<6;y++){const g=Math.PI/3*y,w=r+l*Math.cos(g),x=i+l*Math.sin(g);y===0?e.moveTo(w,x):e.lineTo(w,x)}if(e.closePath(),h.gradient){const y=e.createRadialGradient(r,i,0,r,i,l);y.addColorStop(0,this._styleEngine.getGradientCenter(u)),y.addColorStop(1,u),e.fillStyle=y}else e.fillStyle=u;e.fill();const f=((m=(_=n.provenance)==null?void 0:_.sources)==null?void 0:m.length)??0;if(f>=2&&this._trustStyle==="glow"&&(e.shadowColor=c.info,e.shadowBlur=Math.min(12,f*3)/o,e.fill(),e.shadowBlur=0,e.shadowColor="transparent"),n.riskScore&&n.riskScore>0){const y=Math.min(1,n.riskScore);e.strokeStyle=`rgba(220, 50, 50, ${.5+y*.5})`,e.lineWidth=(h.borderWidth+(n.isHighRisk?1.5:.5))/o}else f>=2&&this._trustStyle==="border"?(e.strokeStyle=c.info,e.lineWidth=(h.borderWidth+Math.min(3,f))/o):(e.strokeStyle=this._styleEngine.getBorderColor(u),e.lineWidth=h.borderWidth/o);n.isBoundary&&!(n.riskScore&&n.riskScore>0)&&(e.strokeStyle=gh(u,.5),e.lineWidth=(h.borderWidth+1)/o),e.stroke(),e.setLineDash([]),f<2&&this._trustStyle==="opacity"&&(e.globalAlpha=.7),n.imageUrl&&this.paintAvatar(e,n.imageUrl,r,i,l),e.globalAlpha=1,o>3&&this._paintBadges(e,n,r,i,l,o);const d=1.5,p=2.5;if(o>d){const y=Math.min(1,(o-d)/(p-d)),g=h.fontSize/o;e.font=`${g}px ${h.fontFamily}`,e.textAlign="center",e.textBaseline="top",e.globalAlpha=y,e.fillStyle=c.textPrimary,e.fillText(ph(n.label,40),r,i+l+2/o),e.globalAlpha=1}return e.restore(),l}_paintBadges(e,n,r,i,o,a){if(!this._showBadges)return;const s=n.provenance;if(!s)return;const l=this._styleEngine.palette,u=Math.max(4,8/a);if(s.sources.length>0){const c=r+o*.7,h=i+o*.6,f=s.sources.length;e.beginPath(),e.arc(c,h,u,0,2*Math.PI);const d=Math.min(1,f/3);e.fillStyle=f>=2?l.info:l.textMuted,e.globalAlpha=.4+d*.6,e.fill(),u>3&&(e.fillStyle="#fff",e.globalAlpha=1,e.font=`bold ${u*1.2}px system-ui`,e.textAlign="center",e.textBaseline="middle",e.fillText(String(f),c,h))}if(s.contentHash||s.blockchainAnchor){const c=r+o*.7,h=i-o*.6;e.beginPath(),e.arc(c,h,u,0,2*Math.PI),e.fillStyle=s.blockchainAnchor?l.safe:l.info,e.globalAlpha=.85,e.fill(),e.globalAlpha=1,e.strokeStyle="#fff",e.lineWidth=u*.3,e.lineCap="round",e.lineJoin="round",e.beginPath();const f=u*.5;e.moveTo(c-f*.5,h),e.lineTo(c-f*.1,h+f*.4),e.lineTo(c+f*.5,h-f*.3),e.stroke()}e.globalAlpha=1}paintCircle(e,n,r,i,o){const a=this.getRadius(n),s=this._styleEngine.getNodeColor(n);return e.beginPath(),e.arc(r,i,a,0,2*Math.PI),e.fillStyle=s,e.fill(),a}paintAvatar(e,n,r,i,o){let a=ye.get(n);if(a===void 0){const d=new Image;n.startsWith("data:")||(d.crossOrigin="anonymous"),ye.set(n,null),d.src=n,d.onload=()=>{var p;ye.set(n,d),(p=this._onImageLoad)==null||p.call(this)},d.onerror=()=>{ye.delete(n)};return}if(!a)return;e.save(),e.beginPath();for(let d=0;d<6;d++){const p=Math.PI/3*d,_=r+o*Math.cos(p),m=i+o*Math.sin(p);d===0?e.moveTo(_,m):e.lineTo(_,m)}e.closePath(),e.clip();const s=a.naturalWidth/a.naturalHeight,u=n.startsWith("data:")?.5:1;let c,h;const f=o*2*u;s>1?(h=f,c=f*s):(c=f,h=f/s),e.globalAlpha=.95,e.drawImage(a,r-c/2,i-h/2,c,h),e.globalAlpha=1,e.restore()}resolveImageUrl(e,n,r){for(const i of this._config.imagePredicates){const o=e.properties.get(i);if(o&&o.length>0){const a=o[0].value;if(a.startsWith("http://")||a.startsWith("https://"))return a}}if(r){const i=r(e.id);for(const o of this._config.imagePredicates)for(const a of i){if(a.predicate!==o)continue;const s=n(a.target);if(!s)continue;const l=s.properties.get(this._config.imageUrlPredicate);if(l&&l.length>0){const u=l[0].value;if(u.startsWith("http://")||u.startsWith("https://"))return u}for(const u of this._config.imagePredicates){const c=s.properties.get(u);if(c&&c.length>0){const h=c[0].value;if(h.startsWith("http://")||h.startsWith("https://"))return h}}}}return null}};function ph(e,n){return e.length<=n?e:e.slice(0,n-1)+"…"}function gh(e,n){const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!r)return e;const i=Math.round(parseInt(r[1],16)+(255-parseInt(r[1],16))*n),o=Math.round(parseInt(r[2],16)+(255-parseInt(r[2],16))*n),a=Math.round(parseInt(r[3],16)+(255-parseInt(r[3],16))*n);return`#${((1<<24)+(i<<16)+(o<<8)+a).toString(16).slice(1)}`}var _h={focalNode:null,hops:2,maxNodes:200,expandOnClick:!0},Rr=class{constructor(e){P(this,"_config");P(this,"_visibleNodes",new Set);P(this,"_focalNode",null);P(this,"_enabled",!1);this._config={..._h,...e},this._focalNode=this._config.focalNode??null}get focalNode(){return this._focalNode}get enabled(){return this._enabled}get visibleNodeIds(){return this._visibleNodes}compute(e){if(e.nodes.size<=this._config.maxNodes){this._enabled=!1;for(const o of e.nodes.values())o.isBoundary=!1;return{nodes:e.nodes,edges:e.edges}}if(this._enabled=!0,!this._focalNode){const o=e.getHighestDegreeNode();this._focalNode=(o==null?void 0:o.id)??null}if(!this._focalNode)return{nodes:new Map,edges:new Map};this._visibleNodes.clear();const n=[{id:this._focalNode,depth:0}];for(this._visibleNodes.add(this._focalNode);n.length>0&&this._visibleNodes.size<this._config.maxNodes;){const o=n.shift();if(o.depth>=this._config.hops)continue;const a=e.getNeighborIds(o.id);for(const s of a){if(this._visibleNodes.size>=this._config.maxNodes)break;this._visibleNodes.has(s)||(this._visibleNodes.add(s),n.push({id:s,depth:o.depth+1}))}}const r=new Map,i=new Map;for(const o of this._visibleNodes){const a=e.getNode(o);if(a){const s=e.getNeighborIds(o);a.isBoundary=!1;for(const l of s)if(!this._visibleNodes.has(l)){a.isBoundary=!0;break}r.set(o,a)}}for(const o of e.edges.values())this._visibleNodes.has(o.source)&&this._visibleNodes.has(o.target)&&i.set(o.id,o);return{nodes:r,edges:i}}setFocus(e){this._focalNode=e}expandNode(e,n){const r=n.getNeighborIds(e);for(const i of r)this._visibleNodes.add(i)}disable(){this._enabled=!1,this._visibleNodes.clear()}enable(e){this._enabled=!0,e&&(this._focalNode=e)}},vh={statementType:"http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement",subjectPredicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#subject",predicatePredicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate",objectPredicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#object"},Or={enabled:!1,patterns:[vh]},yh=class{constructor(e){P(this,"_config");this._config={enabled:(e==null?void 0:e.enabled)??Or.enabled,patterns:(e==null?void 0:e.patterns)??Or.patterns}}get enabled(){return this._config.enabled}collapse(e){if(!this._config.enabled)return new Set;const n=new Set,r=this.detectStatements(e);for(const i of r){if(!i.reifiedSubject)continue;const o=e.getNode(i.reifiedSubject);if(o){if(i.reifiedPredicate&&i.annotations.length>0){const a=i.annotations.map(u=>({predicate:u.predicate,value:u.value,datatype:u.datatype})),s=o.properties.get(i.reifiedPredicate);if(s){for(const u of s)if(i.reifiedObject&&u.value===i.reifiedObject){u.annotations=[...u.annotations??[],...a];break}s.length>0&&!s.some(u=>{var c;return(c=u.annotations)==null?void 0:c.length})&&(s[0].annotations=[...s[0].annotations??[],...a])}const l=o.metadata.get(i.reifiedPredicate);l&&l.length>0&&(l[0].annotations=[...l[0].annotations??[],...a])}n.add(i.statementNodeId)}}return n}detectStatements(e){const n=[];for(const r of this._config.patterns)for(const i of e.nodes.values()){if(!i.types.includes(r.statementType))continue;const o={statementNodeId:i.id,reifiedSubject:null,reifiedPredicate:null,reifiedObject:null,annotations:[]},a=e.getEdgesFrom(i.id);for(const l of a)l.predicate===r.subjectPredicate?o.reifiedSubject=l.target:l.predicate===r.predicatePredicate?o.reifiedPredicate=l.target:l.predicate===r.objectPredicate&&(o.reifiedObject=l.target);for(const[l,u]of i.properties)l===r.objectPredicate&&u.length>0&&(o.reifiedObject=u[0].value);for(const[l,u]of i.metadata)u.length!==0&&(!o.reifiedSubject&&l===r.subjectPredicate?o.reifiedSubject=u[0].value:!o.reifiedPredicate&&l===r.predicatePredicate?o.reifiedPredicate=u[0].value:!o.reifiedObject&&l===r.objectPredicate&&(o.reifiedObject=u[0].value));const s=new Set([r.subjectPredicate,r.predicatePredicate,r.objectPredicate]);for(const[l,u]of i.properties)if(!s.has(l))for(const c of u)o.annotations.push({predicate:l,value:c.value,datatype:c.datatype});for(const[l,u]of i.metadata)for(const c of u)o.annotations.push({predicate:l,value:c.value,datatype:c.datatype});n.push(o)}return n}},mh=["http://www.w3.org/ns/prov#wasGeneratedBy","http://www.w3.org/ns/prov#wasAttributedTo","http://www.w3.org/ns/prov#wasDerivedFrom","http://www.w3.org/ns/prov#startedAtTime","http://www.w3.org/ns/prov#endedAtTime","http://www.w3.org/ns/prov#generatedAtTime","http://www.w3.org/ns/prov#wasStartedBy","http://www.w3.org/ns/prov#wasEndedBy","http://purl.org/dc/terms/created","http://purl.org/dc/terms/modified","http://purl.org/dc/terms/source","http://purl.org/dc/terms/creator","http://purl.org/dc/terms/publisher","http://www.w3.org/2002/07/owl#versionInfo"],bh=class{constructor(e){P(this,"_predicates");this._predicates=new Set([...mh,...(e==null?void 0:e.predicates)??[]])}get predicates(){return[...this._predicates]}isMetadata(e){return this._predicates.has(e)}addPredicates(e){for(const n of e)this._predicates.add(n)}},wh=class{constructor(){P(this,"_handlers",new Map)}on(e,n){let r=this._handlers.get(e);return r||(r=new Set,this._handlers.set(e,r)),r.add(n),()=>{r.delete(n)}}off(e,n){const r=this._handlers.get(e);r&&r.delete(n)}emit(e,n){const r=this._handlers.get(e);if(r)for(const i of r)try{i(n)}catch(o){console.error(`[dkg-graph-viz] Error in ${e} handler:`,o)}}removeAll(e){e?this._handlers.delete(e):this._handlers.clear()}},Dr=class{constructor(e){P(this,"_container");P(this,"_graph",null);P(this,"_hexPainter");P(this,"_styleEngine");P(this,"_events");P(this,"_currentNodes",new Map);P(this,"_positionCache",new Map);P(this,"_currentLinks",[]);P(this,"_repaintPending",!1);P(this,"_riskPulseEnabled",!1);P(this,"_hoverTraceEnabled",!1);P(this,"_hoveredNodeId",null);P(this,"_fadeInEnabled",!1);P(this,"_loadTime",0);P(this,"_fadeInDuration",1500);P(this,"_animFrameId",null);P(this,"_initialFitDone",!1);P(this,"_autoFitDisabled",!1);P(this,"_lastTopologyKey","");P(this,"_continuousSimulation",!1);P(this,"_fitTimeoutId",null);P(this,"_kaGroups",new Map);P(this,"_kaEnabled",!1);P(this,"_kaBoundaryOpacity",.06);this._container=e.container,this._hexPainter=e.hexPainter,this._styleEngine=e.styleEngine,this._events=e.events}_setAlphaTarget(e){var r;const n=(r=this._graph)==null?void 0:r.d3AlphaTarget;typeof n=="function"&&n.call(this._graph,e)}init(){var s;if(this._graph)return;const e=this._styleEngine.config,n=this._container.clientWidth||this._container.offsetWidth||800,r=this._container.clientHeight||this._container.offsetHeight||600;this._hexPainter.setImageLoadCallback(()=>{this._scheduleRepaint()}),this._graph=Bf()(this._container).width(n).height(r).backgroundColor("transparent").nodeCanvasObjectMode(l=>{var c;const u=l;return(c=u._graphNode)!=null&&c.sizeMultiplier&&u._graphNode.sizeMultiplier>1?"after":"replace"}).nodeCanvasObject((l,u,c)=>{const h=l;if(!h._graphNode)return;const f=h.x??0,d=h.y??0;if(this._fadeInEnabled&&this._loadTime>0){const _=performance.now()-this._loadTime;if(_<this._fadeInDuration){const m=_/this._fadeInDuration,y=1-Math.pow(1-m,3);u.globalAlpha=y}}let p=1;if(this._riskPulseEnabled&&h._graphNode.isHighRisk){const _=performance.now()/1e3,m=Qe(h._graphNode.id);p=1+.15*Math.sin(_*1.25+m)}this._hexPainter.paint(u,h._graphNode,f,d,c,p),u.globalAlpha=1}).nodePointerAreaPaint((l,u,c)=>{const h=l;if(!h._graphNode)return;const d=this._hexPainter.getRadius(h._graphNode)+6,p=h.x??0,_=h.y??0;c.beginPath(),c.arc(p,_,d,0,Math.PI*2),c.fillStyle=u,c.fill()}).linkColor(l=>{const u=l;return u._graphEdge?this._styleEngine.getEdgeColor(u._graphEdge):e.defaultEdgeColor}).linkWidth(e.edgeWidth).linkDirectionalArrowLength(e.edgeArrowSize).linkDirectionalArrowRelPos(1).linkCanvasObjectMode(()=>"after").linkCanvasObject((l,u,c)=>{if(c<3)return;const h=l;if(!h._graphEdge)return;const f=h._graphEdge.label;if(!f)return;const d=3,_=Math.min(1,(c-d)/(4-d)),m=12/c,y=h.source,g=h.target;if(!y.x||!g.x)return;const w=(y.x+g.x)/2,x=(y.y+g.y)/2;u.save(),u.globalAlpha=_,u.font=`${m}px ${e.fontFamily}`,u.textAlign="center",u.textBaseline="middle";const v=u.measureText(f).width,b=2/c;u.fillStyle="rgba(15, 23, 42, 0.75)",u.beginPath(),u.roundRect(w-v/2-b,x-m/2-b,v+b*2,m+b*2,2/c),u.fill(),u.fillStyle="#94a3b8",u.fillText(f,w,x),u.restore()}).onRenderFramePre((l,u)=>{this._drawKaBoundaries(l)}).onNodeClick(l=>{const u=l;u._graphNode&&this._events.emit("node:click",u._graphNode)}).onNodeDrag(l=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeDragEnd(l=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeHover(l=>{const u=l;u!=null&&u._graphNode?(this._hoveredNodeId=u._graphNode.id,this._events.emit("node:hover",u._graphNode),this._container.style.cursor="pointer"):(this._hoveredNodeId=null,this._events.emit("node:unhover",null),this._container.style.cursor="default")}).onLinkClick(l=>{const u=l;u._graphEdge&&this._events.emit("edge:click",u._graphEdge)}).onBackgroundClick(l=>{this._events.emit("background:click",{x:0,y:0})}).cooldownTicks(200).d3AlphaDecay(.02).d3VelocityDecay(.3).warmupTicks(60).onEngineStop(()=>{!this._autoFitDisabled&&!this._initialFitDone&&this._graph&&(this._initialFitDone=!0,this._graph.zoomToFit(400,40))});const i=this._graph.d3Force("charge");i!=null&&i.strength&&(i.strength(-150),(s=i.distanceMax)==null||s.call(i,1e3));const o=this._graph.d3Force("link");o!=null&&o.distance&&o.distance(80).strength(.2);const a=this._graph.d3Force("center");a!=null&&a.strength&&a.strength(.03)}render(e,n,r){var y;this._graph||this.init();let i=0;const o=[...e.keys()].sort();for(const g of o)i=i*31+Qe(g)|0;const a=[];for(const g of n.values())a.push(`${g.source}\0${g.target}`);a.sort();for(const g of a)i=i*31+Qe(g)|0;const s=String(i);s!==this._lastTopologyKey&&(this._lastTopologyKey=s,this._initialFitDone=!1),this._loadTime===0&&(this._loadTime=performance.now());let l=1;for(const g of e.values())g.degree>l&&(l=g.degree);this._hexPainter.setMaxDegree(l);const u=["http://schema.org/dateCreated","https://schema.org/dateCreated"],c=new Map;for(const[g,w]of e)for(const x of u){const v=(y=w.properties)==null?void 0:y.get(x);if(v&&v.length>0){const b=new Date(v[0].value);if(!isNaN(b.getTime())){c.set(g,b.getTime());break}}}let h=null;if(c.size>=2){const g=[...c.values()],w=Math.min(...g),v=Math.max(...g)-w||1,b=Math.max(400,c.size*120);h=new Map;for(const[k,S]of c)h.set(k,((S-w)/v-.5)*b)}const f=new Map;for(const[g,w]of e){if(r!=null&&r.has(g))continue;const x=this._currentNodes.get(g),v=this._positionCache.get(g),b=h==null?void 0:h.get(g);f.set(g,{id:g,x:(x==null?void 0:x.x)??(v==null?void 0:v.x)??b??(Math.random()-.5)*800,y:(x==null?void 0:x.y)??(v==null?void 0:v.y)??(Math.random()-.5)*400,vx:(x==null?void 0:x.vx)??(v==null?void 0:v.vx),vy:(x==null?void 0:x.vy)??(v==null?void 0:v.vy),fx:typeof(x==null?void 0:x.fx)=="number"?x.fx:typeof(v==null?void 0:v.fx)=="number"?v.fx:void 0,fy:typeof(x==null?void 0:x.fy)=="number"?x.fy:typeof(v==null?void 0:v.fy)=="number"?v.fy:void 0,_graphNode:w})}const d=new Set(f.keys()),p=[];for(const g of n.values())r!=null&&r.has(g.source)||r!=null&&r.has(g.target)||!d.has(g.source)||!d.has(g.target)||p.push({source:g.source,target:g.target,_graphEdge:g});this._currentNodes=f,this._currentLinks=p;const _=new Map;for(const[g,w]of f)_.set(g,{x:w.x,y:w.y,vx:w.vx,vy:w.vy,fx:typeof w.fx=="number"?w.fx:void 0,fy:typeof w.fy=="number"?w.fy:void 0});this._positionCache=_;const m=[...f.values()].sort((g,w)=>{var b,k,S,C;const x=(b=g._graphNode)!=null&&b.sizeMultiplier&&g._graphNode.sizeMultiplier>1?100:(k=g._graphNode)!=null&&k.isHighRisk?10:0,v=(S=w._graphNode)!=null&&S.sizeMultiplier&&w._graphNode.sizeMultiplier>1?100:(C=w._graphNode)!=null&&C.isHighRisk?10:0;return x-v});this._graph.graphData({nodes:m,links:p}),!this._autoFitDisabled&&!this._initialFitDone&&(this._fitTimeoutId!==null&&clearTimeout(this._fitTimeoutId),this._fitTimeoutId=setTimeout(()=>{this._graph&&!this._autoFitDisabled&&!this._initialFitDone&&(this._initialFitDone=!0,this._graph.zoomToFit(400,40)),this._fitTimeoutId=null},300)),h&&h.size>=2?this._graph.d3Force("chronoX",g=>{for(const w of m){const x=h.get(w.id);x!==void 0&&w.fx==null&&(w.vx=(w.vx??0)+(x-(w.x??0))*.05*g)}}):this._graph.d3Force("chronoX",null)}centerOnNode(e,n=350,r){const i=this._currentNodes.get(e);i&&this._graph&&(this._graph.centerAt(i.x,i.y,n),r!=null&&this._graph.zoom(r,n))}zoomToFit(e=40,n=500){var r;(r=this._graph)==null||r.zoomToFit(n,e)}set autoFitDisabled(e){this._autoFitDisabled=e}getCanvas(){return this._graph?this._container.querySelector("canvas")??null:null}refresh(){if(!this._graph)return;const e=this._graph.refresh;if(typeof e=="function"){e.call(this._graph);return}this._scheduleRepaint()}_scheduleRepaint(){this._repaintPending||(this._repaintPending=!0,requestAnimationFrame(()=>{if(this._repaintPending=!1,!!this._graph)if(this._continuousSimulation||this._riskPulseEnabled)try{this._graph.d3ReheatSimulation()}catch{}else{this._graph.cooldownTicks(3);try{this._graph.d3ReheatSimulation()}catch{}this._setAlphaTarget(0),setTimeout(()=>{this._graph&&!this._continuousSimulation&&!this._riskPulseEnabled&&(this._graph.cooldownTicks(0),this._setAlphaTarget(0))},60)}}))}_stopAnimLoop(){this._animFrameId!==null&&(cancelAnimationFrame(this._animFrameId),this._animFrameId=null)}setKaGroups(e,n,r=.06){this._kaGroups=e,this._kaEnabled=n,this._kaBoundaryOpacity=r}_drawKaBoundaries(e){if(!this._kaEnabled||this._kaGroups.size===0)return;const n=this._styleEngine.palette;let r=0;for(const[i,o]of this._kaGroups){const a=[];for(const h of o){const f=this._currentNodes.get(h);f&&f.x!==void 0&&f.y!==void 0&&a.push([f.x,f.y])}if(a.length<3)continue;const s=xh(a);if(s.length<3)continue;const l=n.nodeColors[r%n.nodeColors.length];r++,e.save(),e.beginPath();const u=s.reduce((h,f)=>h+f[0],0)/s.length,c=s.reduce((h,f)=>h+f[1],0)/s.length;for(let h=0;h<s.length;h++){const f=s[h][0]-u,d=s[h][1]-c,p=Math.sqrt(f*f+d*d),_=30,m=s[h][0]+(p>0?f/p*_:0),y=s[h][1]+(p>0?d/p*_:0);h===0?e.moveTo(m,y):e.lineTo(m,y)}e.closePath(),e.fillStyle=l,e.globalAlpha=this._kaBoundaryOpacity,e.fill(),e.strokeStyle=l,e.globalAlpha=this._kaBoundaryOpacity*2.5,e.lineWidth=1,e.stroke(),e.restore()}}resize(){this._graph&&(this._graph.width(this._container.clientWidth),this._graph.height(this._container.clientHeight))}destroy(){this._stopAnimLoop(),this._fitTimeoutId!==null&&(clearTimeout(this._fitTimeoutId),this._fitTimeoutId=null),this._graph&&(this._graph._destructor(),this._graph=null),this._currentNodes.clear(),this._positionCache.clear(),this._currentLinks=[]}applyAnimation(e){if(!this._graph)return;this._riskPulseEnabled=e.riskPulse??!1,this._fadeInEnabled=e.fadeIn??!1,this._hoverTraceEnabled=e.hoverTrace??!1;const n=e.linkParticleSpeed??.005,r=e.linkParticleColor??"rgba(100,150,255,0.6)",i=e.linkParticleWidth??1.5;if(e.linkParticles||e.hoverTrace){const a=e.linkParticleCount??1;this._hoverTraceEnabled?this._graph.linkDirectionalParticles(s=>{if(!this._hoveredNodeId)return e.linkParticles?a:0;const l=s,u=typeof l.source=="object"?l.source.id:l.source,c=typeof l.target=="object"?l.target.id:l.target;return u===this._hoveredNodeId||c===this._hoveredNodeId?4:e.linkParticles?a:0}).linkDirectionalParticleSpeed(s=>{if(!this._hoveredNodeId)return n;const l=s,u=typeof l.source=="object"?l.source.id:l.source,c=typeof l.target=="object"?l.target.id:l.target;return u===this._hoveredNodeId||c===this._hoveredNodeId?.02:n}).linkDirectionalParticleWidth(s=>{if(!this._hoveredNodeId)return i;const l=s,u=typeof l.source=="object"?l.source.id:l.source,c=typeof l.target=="object"?l.target.id:l.target;return u===this._hoveredNodeId||c===this._hoveredNodeId?3:i}).linkDirectionalParticleColor(s=>{if(!this._hoveredNodeId)return r;const l=s,u=typeof l.source=="object"?l.source.id:l.source,c=typeof l.target=="object"?l.target.id:l.target;return u===this._hoveredNodeId||c===this._hoveredNodeId?"#60a0ff":r}):this._graph.linkDirectionalParticles(a).linkDirectionalParticleSpeed(n).linkDirectionalParticleWidth(i).linkDirectionalParticleColor(()=>r)}else this._graph.linkDirectionalParticles(0);const o=e.drift||this._riskPulseEnabled;if(this._continuousSimulation=o,o?(this._graph.cooldownTicks(1/0),this._setAlphaTarget(e.driftAlpha??.008),!this._autoFitDisabled&&!this._initialFitDone&&(this._fitTimeoutId!==null&&clearTimeout(this._fitTimeoutId),this._fitTimeoutId=setTimeout(()=>{this._graph&&!this._autoFitDisabled&&!this._initialFitDone&&(this._initialFitDone=!0,this._graph.zoomToFit(400,40)),this._fitTimeoutId=null},300))):(this._graph.cooldownTicks(120),this._setAlphaTarget(0)),this._stopAnimLoop(),this._riskPulseEnabled&&!e.drift){const a=()=>{if(!this._riskPulseEnabled||!this._graph){this._animFrameId=null;return}try{this._graph.d3ReheatSimulation()}catch{}this._animFrameId=requestAnimationFrame(a)};this._animFrameId=requestAnimationFrame(a)}}applyPalette(e){this._graph&&this._graph.backgroundColor(e.background==="#0a0a0f"?"transparent":e.background)}};function Qe(e){let n=0;for(let r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r)|0;return n}function xh(e){if(e.length<3)return e;const n=[...e].sort((a,s)=>a[0]-s[0]||a[1]-s[1]),r=(a,s,l)=>(s[0]-a[0])*(l[1]-a[1])-(s[1]-a[1])*(l[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)}var kh=class{constructor(e,n={}){P(this,"_model");P(this,"_prefixManager");P(this,"_labelResolver");P(this,"_styleEngine");P(this,"_hexPainter");P(this,"_focusFilter");P(this,"_reificationCollapser");P(this,"_metadataExtractor");P(this,"_events");P(this,"_renderer");P(this,"_config");P(this,"_collapsedNodeIds",new Set);P(this,"_rendererReady");P(this,"_container");P(this,"_temporalFilter");P(this,"_timelineOverlay",null);P(this,"_renderQueued",!1);P(this,"_autoFitDisabled",!1);P(this,"_highlightState",new Map);this._config=n,this._container=e,this._metadataExtractor=new bh(n.metadata),this._model=new oh(this._metadataExtractor.predicates),this._prefixManager=new re(n.prefixes),this._labelResolver=new lh(n.labelMode??"humanized",this._prefixManager,n.labels),this._styleEngine=new ch(n.style,this._prefixManager),this._hexPainter=new dh(n.hexagon,this._styleEngine,this._prefixManager),this._focusFilter=new Rr(n.focus),this._reificationCollapser=new yh(n.reification),this._temporalFilter=new Pr,this._events=new wh;const r={container:e,hexPainter:this._hexPainter,styleEngine:this._styleEngine,events:this._events};if(n.renderer==="3d"){let i;this._rendererReady=new Promise(o=>{i=o}),this._renderer=null,qt(async()=>{const{WebGL3DRenderer:o}=await import("./renderer-3d-2EVDZII7-DsxBsJvs.js");return{WebGL3DRenderer:o}},__vite__mapDeps([0,1,2])).then(({WebGL3DRenderer:o})=>{this._renderer=new o(r),i()}).catch(o=>{console.warn("[dkg-graph-viz] 3D renderer not available, falling back to 2D:",o.message),this._renderer=new Dr(r),i()})}else this._renderer=new Dr(r),this._rendererReady=Promise.resolve();n.autoFitDisabled&&(this._autoFitDisabled=!0,this._renderer?this._renderer.autoFitDisabled=!0:this._rendererReady.then(()=>{this._renderer&&(this._renderer.autoFitDisabled=!0)})),typeof ResizeObserver<"u"&&new ResizeObserver(()=>{var o;return(o=this._renderer)==null?void 0:o.resize()}).observe(e)}async loadNTriples(e){const{parseNTriples:n}=await qt(async()=>{const{parseNTriples:i}=await import("./ntriples-ZWBY2WET-nIpilpjf.js");return{parseNTriples:i}},__vite__mapDeps([3,4])),r=n(e);this._ingest(r)}async loadNQuads(e){const{parseNQuads:n}=await qt(async()=>{const{parseNQuads:i}=await import("./ntriples-ZWBY2WET-nIpilpjf.js");return{parseNQuads:i}},__vite__mapDeps([3,4])),r=n(e);this._ingest(r)}async loadTurtle(e){const{parseTurtle:n}=await qt(async()=>{const{parseTurtle:o}=await import("./turtle-JJPK7LJ5-zezDJZEp.js");return{parseTurtle:o}},__vite__mapDeps([5,4])),{triples:r,prefixes:i}=n(e);this._prefixManager.addPrefixes(i),this._ingest(r)}async loadJsonLd(e){const{parseJsonLd:n}=await qt(async()=>{const{parseJsonLd:i}=await import("./jsonld-32FQRO67-DhbO8O6B.js");return{parseJsonLd:i}},__vite__mapDeps([6,1,2])),r=await n(e);this._ingest(r)}loadTriples(e){const n=e.map(r=>{if(Array.isArray(r))return{subject:r[0],predicate:r[1],object:r[2]};if("s"in r&&"p"in r&&"o"in r){const i=r;return{subject:i.s,predicate:i.p,object:i.o}}return r});this._ingest(n)}async loadFromSource(e,n){const r=await e.construct(n);this._ingest(r.triples)}async querySource(e,n){return e.select(n)}addTriples(e){const n=this._model.addTriples(e);return this._postIngest(),this._events.emit("data:change",n),n}removeTriples(e){const n=this._model.removeTriples(e);return this._postIngest(),this._events.emit("data:change",n),n}focus(e,n){var r;this._focusFilter.setFocus(e),n!==void 0&&(this._focusFilter=new Rr({...this._config.focus,focalNode:e,hops:n})),this._renderCurrent(),(r=this._renderer)==null||r.centerOnNode(e,500,2),this._events.emit("focus:change",{focalNode:e,visibleNodes:this._focusFilter.visibleNodeIds.size})}centerOnNode(e,n){var r;(r=this._renderer)==null||r.centerOnNode(e,n==null?void 0:n.durationMs,n==null?void 0:n.zoomLevel)}expandNode(e){this._focusFilter.expandNode(e,this._model),this._renderCurrent()}showAll(){this._focusFilter.disable(),this._renderCurrent()}get temporalFilter(){return this._temporalFilter}get timelineOverlay(){return this._timelineOverlay}setTimeCursor(e){this._temporalFilter.setCursor(e),this._renderCurrent(),this._events.emit("temporal:change",{cursor:e,visibleCount:this._lastVisibleCount(),totalDated:this._temporalFilter.datedNodeCount})}getDateRange(){return this._temporalFilter.dateRange}playTimeline(){var e;(e=this._timelineOverlay)==null||e.play()}pauseTimeline(){var e;(e=this._timelineOverlay)==null||e.pause()}_lastVisibleCount(){const{nodes:e}=this._focusFilter.compute(this._model),n=this._temporalFilter.getVisibleNodeIds(e.keys());return n?n.size:e.size}zoomToFit(e){var n;(n=this._renderer)==null||n.zoomToFit(e)}set autoFitDisabled(e){this._autoFitDisabled=e,this._renderer?this._renderer.autoFitDisabled=e:this._rendererReady.then(()=>{this._renderer&&(this._renderer.autoFitDisabled=e)})}get labelMode(){return this._labelResolver.mode}setLabelMode(e){this._labelResolver.mode=e,this._labelResolver.updateLabels(this._model.nodes,this._model.edges),this._renderCurrent()}on(e,n){return this._events.on(e,n)}off(e,n){this._events.off(e,n)}getNode(e){return this._model.getNode(e)}getEdgesFrom(e){return this._model.getEdgesFrom(e)}getEdgesTo(e){return this._model.getEdgesTo(e)}get model(){return this._model}get prefixes(){return this._prefixManager}highlightNodes(e){var r;this.clearHighlight();const n=new Set(e);for(const[i,o]of this._model.nodes)n.has(i)&&(this._highlightState.set(i,{riskScore:o.riskScore,isHighRisk:o.isHighRisk,sizeMultiplier:o.sizeMultiplier}),o.isHighRisk=!0,(!o.sizeMultiplier||o.sizeMultiplier<2)&&(o.sizeMultiplier=2));(r=this._renderer)!=null&&r.refresh?this._renderer.refresh():this._renderCurrent()}clearHighlight(){var e;if(this._highlightState.size!==0){for(const[n,r]of this._highlightState){const i=this._model.nodes.get(n);i&&(i.riskScore=r.riskScore,i.isHighRisk=r.isHighRisk,i.sizeMultiplier=r.sizeMultiplier)}this._highlightState.clear(),(e=this._renderer)!=null&&e.refresh?this._renderer.refresh():this._renderCurrent()}}async exportImage(){const e=this._renderer.getCanvas();if(!e)throw new Error("Cannot export: renderer not initialized or no canvas available");return new Promise((n,r)=>{e.toBlob(i=>{i?n(i):r(new Error("Canvas toBlob returned null"))},"image/png")})}exportTriples(){const e=[];for(const n of this._model.triples){const r=Je(n.subject),i=Je(n.predicate);if(n.datatype||n.language||!Sh(n.object)){let o=`"${Mh(n.object)}"`;n.language?o+=`@${n.language}`:n.datatype&&(o+=`^^<${n.datatype}>`),e.push(`${r} ${i} ${o} .`)}else e.push(`${r} ${i} ${Je(n.object)} .`)}return e.join(`
|
|
192
|
+
`)}applyView(e){var i,o,a,s,l;const n=Jf(e.palette,e.paletteOverrides);if(this._styleEngine.setPalette(n),th(this._container,n),(i=e.trust)!=null&&i.enabled?(this._hexPainter.setTrustStyle(e.trust.style??"border"),this._hexPainter.setShowBadges(e.trust.showBadge!==!1)):this._hexPainter.setTrustStyle("none"),Gf(e,this._model),new nh().resolve(this._model),(o=e.temporal)!=null&&o.enabled?(this._temporalFilter=new Pr(e.temporal),this._temporalFilter.scan(this._model),this._temporalFilter.dateRange&&((a=this._timelineOverlay)==null||a.unmount(),this._timelineOverlay=new ih(this._container,this._temporalFilter,e.temporal),this._timelineOverlay.onChange(u=>{this._renderCurrent(),this._events.emit("temporal:change",{cursor:u,visibleCount:this._lastVisibleCount(),totalDated:this._temporalFilter.datedNodeCount})}),this._timelineOverlay.mount())):((s=this._timelineOverlay)==null||s.unmount(),this._timelineOverlay=null),this._renderCurrent(),(l=e.knowledgeAssets)!=null&&l.enabled){const u=e.knowledgeAssets.membershipPredicate??"dkg:partOfAsset";this._model.setKaMembershipPredicate(u)}this._rendererReady.then(()=>{var u,c,h,f;e.animation&&((u=this._renderer)!=null&&u.applyAnimation)&&this._renderer.applyAnimation(e.animation),(c=this._renderer)!=null&&c.applyPalette&&this._renderer.applyPalette(n),(h=e.knowledgeAssets)!=null&&h.enabled&&((f=this._renderer)!=null&&f.setKaGroups)&&this._renderer.setKaGroups(this._model.kaGroups,e.knowledgeAssets.showBoundaries!==!1,e.knowledgeAssets.boundaryOpacity??.06)})}refresh(){this._renderCurrent()}destroy(){var e,n;(e=this._timelineOverlay)==null||e.unmount(),this._timelineOverlay=null,(n=this._renderer)==null||n.destroy(),this._events.removeAll(),this._model.clear(),this._highlightState.clear()}_ingest(e){this._model.addTriples(e),this._postIngest()}_postIngest(){for(const e of this._model.nodes.values())e.imageUrl||(e.imageUrl=this._hexPainter.resolveImageUrl(e,n=>this._model.getNode(n),n=>this._model.getEdgesFrom(n)));this._labelResolver.updateLabels(this._model.nodes,this._model.edges),this._collapsedNodeIds=this._reificationCollapser.collapse(this._model),this._renderCurrent()}_renderCurrent(){var i;if(!this._renderer){this._renderQueued||(this._renderQueued=!0,this._rendererReady.then(()=>{this._renderQueued=!1,this._renderCurrent()}));return}let{nodes:e,edges:n}=this._focusFilter.compute(this._model);const r=this._temporalFilter.getVisibleNodeIds(e.keys());if(r){const o=new Map,a=new Map;for(const[s,l]of e)r.has(s)&&o.set(s,l);for(const[s,l]of n)o.has(l.source)&&o.has(l.target)&&a.set(s,l);e=o,n=a}this._renderer.render(e,n,this._collapsedNodeIds),(i=this._timelineOverlay)!=null&&i.mounted&&this._timelineOverlay.updateCount(e.size)}};function Sh(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("urn:")||e.startsWith("_:")}function Je(e){return e.startsWith("_:")?e:`<${e}>`}function Mh(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}var Li=it.createContext({viz:null,selectedNode:null,hoveredNode:null});function Ch(){return it.useContext(Li)}function Eh({data:e,format:n="ntriples",options:r={},viewConfig:i,initialFit:o,onNodeClick:a,onNodeHover:s,onNodeUnhover:l,className:u,style:c,children:h}){const f=it.useRef(null),d=it.useRef(null),p=it.useRef(!1),[_,m]=it.useState(null),[y,g]=it.useState(null);it.useEffect(()=>{if(!f.current)return;const v=new kh(f.current,r);d.current=v;const b=[];return b.push(v.on("node:click",k=>{m(k),a==null||a(k)})),b.push(v.on("node:hover",k=>{g(k),s==null||s(k)})),b.push(v.on("node:unhover",k=>{g(null),l==null||l(k)})),b.push(v.on("background:click",()=>{m(null)})),()=>{b.forEach(k=>k()),v.destroy(),d.current=null}},[]),it.useEffect(()=>{const v=d.current;if(!v||!e)return;v.model.clear();const b=async()=>{if(typeof e=="string")switch(n){case"ntriples":await v.loadNTriples(e);break;case"nquads":await v.loadNQuads(e);break;case"turtle":await v.loadTurtle(e);break;case"jsonld":await v.loadJsonLd(e);break;default:await v.loadNTriples(e)}else Array.isArray(e)&&v.loadTriples(e);i&&v.applyView(i)};let k=!1,S;return b().then(()=>{k||v&&o&&!p.current&&(S=setTimeout(()=>{k||(p.current=!0,v.zoomToFit())},300))}).catch(C=>{k||console.error("[RdfGraph] Error loading data:",C)}),()=>{k=!0,S&&clearTimeout(S)}},[e,n,i]);const w=it.useRef(i);it.useEffect(()=>{const v=d.current;!v||!i||i===w.current||(w.current=i,v.applyView(i),v.refresh())},[i]);const x=it.useCallback(()=>({viz:d.current,selectedNode:_,hoveredNode:y}),[_,y]);return In.jsxs(Li.Provider,{value:x(),children:[In.jsx("div",{ref:f,className:u,style:{width:"100%",height:"100%",...c}}),h]})}function Nh(){const e=Ch();return{viz:e.viz,selectedNode:e.selectedNode,hoveredNode:e.hoveredNode}}export{Rt as E,li as G,Eh as R,Kn as T,Mn as a,tf as b,Vc as c,ef as d,Xu as e,nf as f,Gu as g,W as i,Mf as s,D as t,Nh as u};
|