@skydesign/tf 0.2.3 → 0.3.3
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/dist/index.d.ts +60 -25
- package/dist/index.js +1 -1
- package/dist/index.mjs +486 -342
- package/dist/render-BqWiqrE9.mjs +3586 -0
- package/dist/render-cE_lsgcR.js +94 -0
- package/dist/server.d.ts +1 -40
- package/dist/server.js +5 -5
- package/dist/server.mjs +236 -243
- package/package.json +3 -2
- package/dist/render-BsRbXyfG.js +0 -124
- package/dist/render-NL_RZBGX.mjs +0 -3537
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skydesign/tf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"lodash": "^4.17.23",
|
|
68
68
|
"mocha": "^11.7.5",
|
|
69
69
|
"next": "16.1.3",
|
|
70
|
+
"panes-cli": "0.2.6",
|
|
70
71
|
"react": "19.2.3",
|
|
71
72
|
"react-dom": "19.2.3",
|
|
72
73
|
"tailwindcss": "^4",
|
|
@@ -91,7 +92,7 @@
|
|
|
91
92
|
},
|
|
92
93
|
"license": "MIT",
|
|
93
94
|
"scripts": {
|
|
94
|
-
"dev": "
|
|
95
|
+
"dev": "panes -c .panes/dev.yaml",
|
|
95
96
|
"build": "pnpm run build:lib && next build",
|
|
96
97
|
"build:lib": "vite build --config vite.config.lib.ts",
|
|
97
98
|
"build:next": "next build",
|
package/dist/render-BsRbXyfG.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";function Gn(t){return JSON.stringify(JSON.stringify(t)).slice(1,-1)}function Jt(t){try{return JSON.parse(t)}catch{const e=JSON.parse(`"${t}"`);return JSON.parse(e)}}var Vn={value:()=>{}};function Fe(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new de(n)}function de(t){this._=t}function qn(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}de.prototype=Fe.prototype={constructor:de,on:function(t,e){var n=this._,r=qn(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=Un(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)n[i]=Ue(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Ue(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new de(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function Un(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Ue(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Vn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Ie="http://www.w3.org/1999/xhtml";const Ze={svg:"http://www.w3.org/2000/svg",xhtml:Ie,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ee(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Ze.hasOwnProperty(e)?{space:Ze[e],local:t}:t}function Zn(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Ie&&e.documentElement.namespaceURI===Ie?e.createElement(t):e.createElementNS(n,t)}}function Kn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function mn(t){var e=Ee(t);return(e.local?Kn:Zn)(e)}function Qn(){}function Oe(t){return t==null?Qn:function(){return this.querySelector(t)}}function Jn(t){typeof t!="function"&&(t=Oe(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,s=r[i]=new Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=t.call(c,c.__data__,u,a))&&("__data__"in c&&(l.__data__=c.__data__),s[u]=l);return new bt(r,this._parents)}function jn(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function tr(){return[]}function yn(t){return t==null?tr:function(){return this.querySelectorAll(t)}}function er(t){return function(){return jn(t.apply(this,arguments))}}function nr(t){typeof t=="function"?t=er(t):t=yn(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(t.call(c,c.__data__,l,o)),i.push(c));return new bt(r,i)}function xn(t){return function(){return this.matches(t)}}function _n(t){return function(e){return e.matches(t)}}var rr=Array.prototype.find;function ir(t){return function(){return rr.call(this.children,t)}}function or(){return this.firstElementChild}function ar(t){return this.select(t==null?or:ir(typeof t=="function"?t:_n(t)))}var sr=Array.prototype.filter;function lr(){return Array.from(this.children)}function cr(t){return function(){return sr.call(this.children,t)}}function ur(t){return this.selectAll(t==null?lr:cr(typeof t=="function"?t:_n(t)))}function fr(t){typeof t!="function"&&(t=xn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&t.call(c,c.__data__,l,a)&&s.push(c);return new bt(r,this._parents)}function vn(t){return new Array(t.length)}function hr(){return new bt(this._enter||this._groups.map(vn),this._parents)}function ye(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ye.prototype={constructor:ye,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function dr(t){return function(){return t}}function pr(t,e,n,r,i,a){for(var o=0,s,c=e.length,l=a.length;o<l;++o)(s=e[o])?(s.__data__=a[o],r[o]=s):n[o]=new ye(t,a[o]);for(;o<c;++o)(s=e[o])&&(i[o]=s)}function gr(t,e,n,r,i,a,o){var s,c,l=new Map,u=e.length,h=a.length,d=new Array(u),m;for(s=0;s<u;++s)(c=e[s])&&(d[s]=m=o.call(c,c.__data__,s,e)+"",l.has(m)?i[s]=c:l.set(m,c));for(s=0;s<h;++s)m=o.call(t,a[s],s,a)+"",(c=l.get(m))?(r[s]=c,c.__data__=a[s],l.delete(m)):n[s]=new ye(t,a[s]);for(s=0;s<u;++s)(c=e[s])&&l.get(d[s])===c&&(i[s]=c)}function mr(t){return t.__data__}function yr(t,e){if(!arguments.length)return Array.from(this,mr);var n=e?gr:pr,r=this._parents,i=this._groups;typeof t!="function"&&(t=dr(t));for(var a=i.length,o=new Array(a),s=new Array(a),c=new Array(a),l=0;l<a;++l){var u=r[l],h=i[l],d=h.length,m=xr(t.call(u,u&&u.__data__,l,r)),A=m.length,_=s[l]=new Array(A),M=o[l]=new Array(A),w=c[l]=new Array(d);n(u,h,_,M,w,m,e);for(var ot=0,lt=0,B,E;ot<A;++ot)if(B=_[ot]){for(ot>=lt&&(lt=ot+1);!(E=M[lt])&&++lt<A;);B._next=E||null}}return o=new bt(o,r),o._enter=s,o._exit=c,o}function xr(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function _r(){return new bt(this._exit||this._groups.map(vn),this._parents)}function vr(t,e,n){var r=this.enter(),i=this,a=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function wr(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),s=new Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],h=l.length,d=s[c]=new Array(h),m,A=0;A<h;++A)(m=l[A]||u[A])&&(d[A]=m);for(;c<i;++c)s[c]=n[c];return new bt(s,this._parents)}function br(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Er(t){t||(t=$r);function e(h,d){return h&&d?t(h.__data__,d.__data__):!h-!d}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=new Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(e)}return new bt(i,this._parents).order()}function $r(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Nr(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Cr(){return Array.from(this)}function kr(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Ar(){let t=0;for(const e of this)++t;return t}function Sr(){return!this.node()}function Mr(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&t.call(s,s.__data__,a,i);return this}function Ir(t){return function(){this.removeAttribute(t)}}function Pr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Tr(t,e){return function(){this.setAttribute(t,e)}}function Yr(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function zr(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Dr(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Rr(t,e){var n=Ee(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Pr:Ir:typeof e=="function"?n.local?Dr:zr:n.local?Yr:Tr)(n,e))}function wn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Br(t){return function(){this.style.removeProperty(t)}}function Lr(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Fr(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Or(t,e,n){return arguments.length>1?this.each((e==null?Br:typeof e=="function"?Fr:Lr)(t,e,n??"")):Vt(this.node(),t)}function Vt(t,e){return t.style.getPropertyValue(e)||wn(t).getComputedStyle(t,null).getPropertyValue(e)}function Hr(t){return function(){delete this[t]}}function Xr(t,e){return function(){this[t]=e}}function Wr(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Gr(t,e){return arguments.length>1?this.each((e==null?Hr:typeof e=="function"?Wr:Xr)(t,e)):this.node()[t]}function bn(t){return t.trim().split(/^|\s+/)}function He(t){return t.classList||new En(t)}function En(t){this._node=t,this._names=bn(t.getAttribute("class")||"")}En.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function $n(t,e){for(var n=He(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Nn(t,e){for(var n=He(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Vr(t){return function(){$n(this,t)}}function qr(t){return function(){Nn(this,t)}}function Ur(t,e){return function(){(e.apply(this,arguments)?$n:Nn)(this,t)}}function Zr(t,e){var n=bn(t+"");if(arguments.length<2){for(var r=He(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Ur:e?Vr:qr)(n,e))}function Kr(){this.textContent=""}function Qr(t){return function(){this.textContent=t}}function Jr(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function jr(t){return arguments.length?this.each(t==null?Kr:(typeof t=="function"?Jr:Qr)(t)):this.node().textContent}function ti(){this.innerHTML=""}function ei(t){return function(){this.innerHTML=t}}function ni(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function ri(t){return arguments.length?this.each(t==null?ti:(typeof t=="function"?ni:ei)(t)):this.node().innerHTML}function ii(){this.nextSibling&&this.parentNode.appendChild(this)}function oi(){return this.each(ii)}function ai(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function si(){return this.each(ai)}function li(t){var e=typeof t=="function"?t:mn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function ci(){return null}function ui(t,e){var n=typeof t=="function"?t:mn(t),r=e==null?ci:typeof e=="function"?e:Oe(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function fi(){var t=this.parentNode;t&&t.removeChild(this)}function hi(){return this.each(fi)}function di(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function pi(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function gi(t){return this.select(t?pi:di)}function mi(t){return arguments.length?this.property("__data__",t):this.node().__data__}function yi(t){return function(e){t.call(this,e,this.__data__)}}function xi(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function _i(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function vi(t,e,n){return function(){var r=this.__on,i,a=yi(e);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=e;return}}this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function wi(t,e,n){var r=xi(t+""),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=e?vi:_i,i=0;i<a;++i)this.each(s(r[i],e,n));return this}function Cn(t,e,n){var r=wn(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function bi(t,e){return function(){return Cn(this,t,e)}}function Ei(t,e){return function(){return Cn(this,t,e.apply(this,arguments))}}function $i(t,e){return this.each((typeof e=="function"?Ei:bi)(t,e))}function*Ni(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var kn=[null];function bt(t,e){this._groups=t,this._parents=e}function re(){return new bt([[document.documentElement]],kn)}function Ci(){return this}bt.prototype=re.prototype={constructor:bt,select:Jn,selectAll:nr,selectChild:ar,selectChildren:ur,filter:fr,data:yr,enter:hr,exit:_r,join:vr,merge:wr,selection:Ci,order:br,sort:Er,call:Nr,nodes:Cr,node:kr,size:Ar,empty:Sr,each:Mr,attr:Rr,style:Or,property:Gr,classed:Zr,text:jr,html:ri,raise:oi,lower:si,append:li,insert:ui,remove:hi,clone:gi,datum:mi,on:wi,dispatch:$i,[Symbol.iterator]:Ni};function G(t){return typeof t=="string"?new bt([[document.querySelector(t)]],[document.documentElement]):new bt([[t]],kn)}function ki(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Bt(t,e){if(t=ki(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const Pe={capture:!0,passive:!1};function Te(t){t.preventDefault(),t.stopImmediatePropagation()}function Ai(t){var e=t.document.documentElement,n=G(t).on("dragstart.drag",Te,Pe);"onselectstart"in e?n.on("selectstart.drag",Te,Pe):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Si(t,e){var n=t.document.documentElement,r=G(t).on("dragstart.drag",null);e&&(r.on("click.drag",Te,Pe),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Xe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function An(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ie(){}var jt=.7,xe=1/jt,Gt="\\s*([+-]?\\d+)\\s*",te="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",St="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Mi=/^#([0-9a-f]{3,8})$/,Ii=new RegExp(`^rgb\\(${Gt},${Gt},${Gt}\\)$`),Pi=new RegExp(`^rgb\\(${St},${St},${St}\\)$`),Ti=new RegExp(`^rgba\\(${Gt},${Gt},${Gt},${te}\\)$`),Yi=new RegExp(`^rgba\\(${St},${St},${St},${te}\\)$`),zi=new RegExp(`^hsl\\(${te},${St},${St}\\)$`),Di=new RegExp(`^hsla\\(${te},${St},${St},${te}\\)$`),Ke={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Xe(ie,ee,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Qe,formatHex:Qe,formatHex8:Ri,formatHsl:Bi,formatRgb:Je,toString:Je});function Qe(){return this.rgb().formatHex()}function Ri(){return this.rgb().formatHex8()}function Bi(){return Sn(this).formatHsl()}function Je(){return this.rgb().formatRgb()}function ee(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Mi.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?je(e):n===3?new _t(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?le(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?le(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ii.exec(t))?new _t(e[1],e[2],e[3],1):(e=Pi.exec(t))?new _t(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ti.exec(t))?le(e[1],e[2],e[3],e[4]):(e=Yi.exec(t))?le(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=zi.exec(t))?nn(e[1],e[2]/100,e[3]/100,1):(e=Di.exec(t))?nn(e[1],e[2]/100,e[3]/100,e[4]):Ke.hasOwnProperty(t)?je(Ke[t]):t==="transparent"?new _t(NaN,NaN,NaN,0):null}function je(t){return new _t(t>>16&255,t>>8&255,t&255,1)}function le(t,e,n,r){return r<=0&&(t=e=n=NaN),new _t(t,e,n,r)}function Li(t){return t instanceof ie||(t=ee(t)),t?(t=t.rgb(),new _t(t.r,t.g,t.b,t.opacity)):new _t}function Ye(t,e,n,r){return arguments.length===1?Li(t):new _t(t,e,n,r??1)}function _t(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Xe(_t,Ye,An(ie,{brighter(t){return t=t==null?xe:Math.pow(xe,t),new _t(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?jt:Math.pow(jt,t),new _t(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new _t(Ot(this.r),Ot(this.g),Ot(this.b),_e(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tn,formatHex:tn,formatHex8:Fi,formatRgb:en,toString:en}));function tn(){return`#${Ft(this.r)}${Ft(this.g)}${Ft(this.b)}`}function Fi(){return`#${Ft(this.r)}${Ft(this.g)}${Ft(this.b)}${Ft((isNaN(this.opacity)?1:this.opacity)*255)}`}function en(){const t=_e(this.opacity);return`${t===1?"rgb(":"rgba("}${Ot(this.r)}, ${Ot(this.g)}, ${Ot(this.b)}${t===1?")":`, ${t})`}`}function _e(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ot(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ft(t){return t=Ot(t),(t<16?"0":"")+t.toString(16)}function nn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new kt(t,e,n,r)}function Sn(t){if(t instanceof kt)return new kt(t.h,t.s,t.l,t.opacity);if(t instanceof ie||(t=ee(t)),!t)return new kt;if(t instanceof kt)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(e===a?o=(n-r)/s+(n<r)*6:n===a?o=(r-e)/s+2:o=(e-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new kt(o,s,c,t.opacity)}function Oi(t,e,n,r){return arguments.length===1?Sn(t):new kt(t,e,n,r??1)}function kt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Xe(kt,Oi,An(ie,{brighter(t){return t=t==null?xe:Math.pow(xe,t),new kt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?jt:Math.pow(jt,t),new kt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new _t(Ce(t>=240?t-240:t+120,i,r),Ce(t,i,r),Ce(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new kt(rn(this.h),ce(this.s),ce(this.l),_e(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=_e(this.opacity);return`${t===1?"hsl(":"hsla("}${rn(this.h)}, ${ce(this.s)*100}%, ${ce(this.l)*100}%${t===1?")":`, ${t})`}`}}));function rn(t){return t=(t||0)%360,t<0?t+360:t}function ce(t){return Math.max(0,Math.min(1,t||0))}function Ce(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Mn=t=>()=>t;function Hi(t,e){return function(n){return t+n*e}}function Xi(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Wi(t){return(t=+t)==1?In:function(e,n){return n-e?Xi(e,n,t):Mn(isNaN(e)?n:e)}}function In(t,e){var n=e-t;return n?Hi(t,n):Mn(isNaN(t)?e:t)}const on=(function t(e){var n=Wi(e);function r(i,a){var o=n((i=Ye(i)).r,(a=Ye(a)).r),s=n(i.g,a.g),c=n(i.b,a.b),l=In(i.opacity,a.opacity);return function(u){return i.r=o(u),i.g=s(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=t,r})(1);function zt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var ze=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ke=new RegExp(ze.source,"g");function Gi(t){return function(){return t}}function Vi(t){return function(e){return t(e)+""}}function qi(t,e){var n=ze.lastIndex=ke.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(t=t+"",e=e+"";(r=ze.exec(t))&&(i=ke.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:zt(r,i)})),n=ke.lastIndex;return n<e.length&&(a=e.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Vi(c[0].x):Gi(e):(e=c.length,function(l){for(var u=0,h;u<e;++u)s[(h=c[u]).i]=h.x(l);return s.join("")})}var an=180/Math.PI,De={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Pn(t,e,n,r,i,a){var o,s,c;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),t*r<e*n&&(t=-t,e=-e,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*an,skewX:Math.atan(c)*an,scaleX:o,scaleY:s}}var ue;function Ui(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?De:Pn(e.a,e.b,e.c,e.d,e.e,e.f)}function Zi(t){return t==null||(ue||(ue=document.createElementNS("http://www.w3.org/2000/svg","g")),ue.setAttribute("transform",t),!(t=ue.transform.baseVal.consolidate()))?De:(t=t.matrix,Pn(t.a,t.b,t.c,t.d,t.e,t.f))}function Tn(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function a(l,u,h,d,m,A){if(l!==h||u!==d){var _=m.push("translate(",null,e,null,n);A.push({i:_-4,x:zt(l,h)},{i:_-2,x:zt(u,d)})}else(h||d)&&m.push("translate("+h+e+d+n)}function o(l,u,h,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:h.push(i(h)+"rotate(",null,r)-2,x:zt(l,u)})):u&&h.push(i(h)+"rotate("+u+r)}function s(l,u,h,d){l!==u?d.push({i:h.push(i(h)+"skewX(",null,r)-2,x:zt(l,u)}):u&&h.push(i(h)+"skewX("+u+r)}function c(l,u,h,d,m,A){if(l!==h||u!==d){var _=m.push(i(m)+"scale(",null,",",null,")");A.push({i:_-4,x:zt(l,h)},{i:_-2,x:zt(u,d)})}else(h!==1||d!==1)&&m.push(i(m)+"scale("+h+","+d+")")}return function(l,u){var h=[],d=[];return l=t(l),u=t(u),a(l.translateX,l.translateY,u.translateX,u.translateY,h,d),o(l.rotate,u.rotate,h,d),s(l.skewX,u.skewX,h,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,h,d),l=u=null,function(m){for(var A=-1,_=d.length,M;++A<_;)h[(M=d[A]).i]=M.x(m);return h.join("")}}}var Ki=Tn(Ui,"px, ","px)","deg)"),Qi=Tn(Zi,", ",")",")"),Ji=1e-12;function sn(t){return((t=Math.exp(t))+1/t)/2}function ji(t){return((t=Math.exp(t))-1/t)/2}function to(t){return((t=Math.exp(2*t))-1)/(t+1)}const eo=(function t(e,n,r){function i(a,o){var s=a[0],c=a[1],l=a[2],u=o[0],h=o[1],d=o[2],m=u-s,A=h-c,_=m*m+A*A,M,w;if(_<Ji)w=Math.log(d/l)/e,M=function(V){return[s+V*m,c+V*A,l*Math.exp(e*V*w)]};else{var ot=Math.sqrt(_),lt=(d*d-l*l+r*_)/(2*l*n*ot),B=(d*d-l*l-r*_)/(2*d*n*ot),E=Math.log(Math.sqrt(lt*lt+1)-lt),$=Math.log(Math.sqrt(B*B+1)-B);w=($-E)/e,M=function(V){var dt=V*w,et=sn(E),b=l/(n*ot)*(et*to(e*dt+E)-ji(E));return[s+b*m,c+b*A,l*et/sn(e*dt+E)]}}return M.duration=w*1e3*e/Math.SQRT2,M}return i.rho=function(a){var o=Math.max(.001,+a),s=o*o,c=s*s;return t(o,s,c)},i})(Math.SQRT2,2,4);var qt=0,Kt=0,Ut=0,Yn=1e3,ve,Qt,we=0,Ht=0,$e=0,ne=typeof performance=="object"&&performance.now?performance:Date,zn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function We(){return Ht||(zn(no),Ht=ne.now()+$e)}function no(){Ht=0}function be(){this._call=this._time=this._next=null}be.prototype=Dn.prototype={constructor:be,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?We():+n)+(e==null?0:+e),!this._next&&Qt!==this&&(Qt?Qt._next=this:ve=this,Qt=this),this._call=t,this._time=n,Re()},stop:function(){this._call&&(this._call=null,this._time=1/0,Re())}};function Dn(t,e,n){var r=new be;return r.restart(t,e,n),r}function ro(){We(),++qt;for(var t=ve,e;t;)(e=Ht-t._time)>=0&&t._call.call(void 0,e),t=t._next;--qt}function ln(){Ht=(we=ne.now())+$e,qt=Kt=0;try{ro()}finally{qt=0,oo(),Ht=0}}function io(){var t=ne.now(),e=t-we;e>Yn&&($e-=e,we=t)}function oo(){for(var t,e=ve,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ve=n);Qt=t,Re(r)}function Re(t){if(!qt){Kt&&(Kt=clearTimeout(Kt));var e=t-Ht;e>24?(t<1/0&&(Kt=setTimeout(ln,t-ne.now()-$e)),Ut&&(Ut=clearInterval(Ut))):(Ut||(we=ne.now(),Ut=setInterval(io,Yn)),qt=1,zn(ln))}}function cn(t,e,n){var r=new be;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var ao=Fe("start","end","cancel","interrupt"),so=[],Rn=0,un=1,Be=2,pe=3,fn=4,Le=5,ge=6;function Ne(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;lo(t,n,{name:e,index:r,group:i,on:ao,tween:so,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Rn})}function Ge(t,e){var n=At(t,e);if(n.state>Rn)throw new Error("too late; already scheduled");return n}function Mt(t,e){var n=At(t,e);if(n.state>pe)throw new Error("too late; already running");return n}function At(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function lo(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Dn(a,0,n.time);function a(l){n.state=un,n.timer.restart(o,n.delay,n.time),n.delay<=l&&o(l-n.delay)}function o(l){var u,h,d,m;if(n.state!==un)return c();for(u in r)if(m=r[u],m.name===n.name){if(m.state===pe)return cn(o);m.state===fn?(m.state=ge,m.timer.stop(),m.on.call("interrupt",t,t.__data__,m.index,m.group),delete r[u]):+u<e&&(m.state=ge,m.timer.stop(),m.on.call("cancel",t,t.__data__,m.index,m.group),delete r[u])}if(cn(function(){n.state===pe&&(n.state=fn,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=Be,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Be){for(n.state=pe,i=new Array(d=n.tween.length),u=0,h=-1;u<d;++u)(m=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=m);i.length=h+1}}function s(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Le,1),h=-1,d=i.length;++h<d;)i[h].call(t,u);n.state===Le&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=ge,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function me(t,e){var n=t.__transition,r,i,a=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=!1;continue}i=r.state>Be&&r.state<Le,r.state=ge,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function co(t){return this.each(function(){me(this,t)})}function uo(t,e){var n,r;return function(){var i=Mt(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function fo(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=Mt(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:e,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===e){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function ho(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=At(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?uo:fo)(n,t,e))}function Ve(t,e,n){var r=t._id;return t.each(function(){var i=Mt(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return At(i,r).value[e]}}function Bn(t,e){var n;return(typeof e=="number"?zt:e instanceof ee?on:(n=ee(e))?(e=n,on):qi)(t,e)}function po(t){return function(){this.removeAttribute(t)}}function go(t){return function(){this.removeAttributeNS(t.space,t.local)}}function mo(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function yo(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function xo(t,e,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(t):(o=this.getAttribute(t),c=s+"",o===c?null:o===r&&c===i?a:(i=c,a=e(r=o,s)))}}function _o(t,e,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),c=s+"",o===c?null:o===r&&c===i?a:(i=c,a=e(r=o,s)))}}function vo(t,e){var n=Ee(t),r=n==="transform"?Qi:Bn;return this.attrTween(t,typeof e=="function"?(n.local?_o:xo)(n,r,Ve(this,"attr."+t,e)):e==null?(n.local?go:po)(n):(n.local?yo:mo)(n,r,e))}function wo(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function bo(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Eo(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&bo(t,a)),n}return i._value=e,i}function $o(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&wo(t,a)),n}return i._value=e,i}function No(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Ee(t);return this.tween(n,(r.local?Eo:$o)(r,e))}function Co(t,e){return function(){Ge(this,t).delay=+e.apply(this,arguments)}}function ko(t,e){return e=+e,function(){Ge(this,t).delay=e}}function Ao(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Co:ko)(e,t)):At(this.node(),e).delay}function So(t,e){return function(){Mt(this,t).duration=+e.apply(this,arguments)}}function Mo(t,e){return e=+e,function(){Mt(this,t).duration=e}}function Io(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?So:Mo)(e,t)):At(this.node(),e).duration}function Po(t,e){if(typeof e!="function")throw new Error;return function(){Mt(this,t).ease=e}}function To(t){var e=this._id;return arguments.length?this.each(Po(e,t)):At(this.node(),e).ease}function Yo(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Mt(this,t).ease=n}}function zo(t){if(typeof t!="function")throw new Error;return this.each(Yo(this._id,t))}function Do(t){typeof t!="function"&&(t=xn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&t.call(c,c.__data__,l,a)&&s.push(c);return new Tt(r,this._parents,this._name,this._id)}function Ro(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),s=0;s<a;++s)for(var c=e[s],l=n[s],u=c.length,h=o[s]=new Array(u),d,m=0;m<u;++m)(d=c[m]||l[m])&&(h[m]=d);for(;s<r;++s)o[s]=e[s];return new Tt(o,this._parents,this._name,this._id)}function Bo(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Lo(t,e,n){var r,i,a=Bo(e)?Ge:Mt;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}function Fo(t,e){var n=this._id;return arguments.length<2?At(this.node(),n).on.on(t):this.each(Lo(n,t,e))}function Oo(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Ho(){return this.on("end.remove",Oo(this._id))}function Xo(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Oe(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=new Array(c),u,h,d=0;d<c;++d)(u=s[d])&&(h=t.call(u,u.__data__,d,s))&&("__data__"in u&&(h.__data__=u.__data__),l[d]=h,Ne(l[d],e,n,d,l,At(u,n)));return new Tt(a,this._parents,e,n)}function Wo(t){var e=this._name,n=this._id;typeof t!="function"&&(t=yn(t));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,h=0;h<l;++h)if(u=c[h]){for(var d=t.call(u,u.__data__,h,c),m,A=At(u,n),_=0,M=d.length;_<M;++_)(m=d[_])&&Ne(m,e,n,_,d,A);a.push(d),o.push(u)}return new Tt(a,o,e,n)}var Go=re.prototype.constructor;function Vo(){return new Go(this._groups,this._parents)}function qo(t,e){var n,r,i;return function(){var a=Vt(this,t),o=(this.style.removeProperty(t),Vt(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function Ln(t){return function(){this.style.removeProperty(t)}}function Uo(t,e,n){var r,i=n+"",a;return function(){var o=Vt(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function Zo(t,e,n){var r,i,a;return function(){var o=Vt(this,t),s=n(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(t),Vt(this,t))),o===c?null:o===r&&c===i?a:(i=c,a=e(r=o,s))}}function Ko(t,e){var n,r,i,a="style."+e,o="end."+a,s;return function(){var c=Mt(this,t),l=c.on,u=c.value[a]==null?s||(s=Ln(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Qo(t,e,n){var r=(t+="")=="transform"?Ki:Bn;return e==null?this.styleTween(t,qo(t,r)).on("end.style."+t,Ln(t)):typeof e=="function"?this.styleTween(t,Zo(t,r,Ve(this,"style."+t,e))).each(Ko(this._id,t)):this.styleTween(t,Uo(t,r,e),n).on("end.style."+t,null)}function Jo(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function jo(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Jo(t,o,n)),r}return a._value=e,a}function ta(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,jo(t,e,n??""))}function ea(t){return function(){this.textContent=t}}function na(t){return function(){var e=t(this);this.textContent=e??""}}function ra(t){return this.tween("text",typeof t=="function"?na(Ve(this,"text",t)):ea(t==null?"":t+""))}function ia(t){return function(e){this.textContent=t.call(this,e)}}function oa(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&ia(i)),e}return r._value=t,r}function aa(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,oa(t))}function sa(){for(var t=this._name,e=this._id,n=Fn(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=At(c,e);Ne(c,t,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Tt(r,this._parents,t,n)}function la(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var l=Mt(this,r),u=l.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(c)),l.on=e}),i===0&&a()})}var ca=0;function Tt(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Fn(){return++ca}var It=re.prototype;Tt.prototype={constructor:Tt,select:Xo,selectAll:Wo,selectChild:It.selectChild,selectChildren:It.selectChildren,filter:Do,merge:Ro,selection:Vo,transition:sa,call:It.call,nodes:It.nodes,node:It.node,size:It.size,empty:It.empty,each:It.each,on:Fo,attr:vo,attrTween:No,style:Qo,styleTween:ta,text:ra,textTween:aa,remove:Ho,tween:ho,delay:Ao,duration:Io,ease:To,easeVarying:zo,end:la,[Symbol.iterator]:It[Symbol.iterator]};function ua(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var fa={time:null,delay:0,duration:250,ease:ua};function ha(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function da(t){var e,n;t instanceof Tt?(e=t._id,t=t._name):(e=Fn(),(n=fa).time=We(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Ne(c,t,e,l,o,n||ha(c,e));return new Tt(r,this._parents,t,e)}re.prototype.interrupt=co;re.prototype.transition=da;const fe=t=>()=>t;function pa(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Pt(t,e,n){this.k=t,this.x=e,this.y=n}Pt.prototype={constructor:Pt,scale:function(t){return t===1?this:new Pt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Pt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Dt=new Pt(1,0,0);On.prototype=Pt.prototype;function On(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Dt;return t.__zoom}function Ae(t){t.stopImmediatePropagation()}function Zt(t){t.preventDefault(),t.stopImmediatePropagation()}function ga(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function ma(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function hn(){return this.__zoom||Dt}function ya(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function xa(){return navigator.maxTouchPoints||"ontouchstart"in this}function _a(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],a=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function qe(){var t=ga,e=ma,n=_a,r=ya,i=xa,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=eo,l=Fe("start","zoom","end"),u,h,d,m=500,A=150,_=0,M=10;function w(f){f.property("__zoom",hn).on("wheel.zoom",dt,{passive:!1}).on("mousedown.zoom",et).on("dblclick.zoom",b).filter(i).on("touchstart.zoom",J).on("touchmove.zoom",Z).on("touchend.zoom touchcancel.zoom",I).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(f,y,p,N){var P=f.selection?f.selection():f;P.property("__zoom",hn),f!==P?E(f,y,p,N):P.interrupt().each(function(){$(this,arguments).event(N).start().zoom(null,typeof y=="function"?y.apply(this,arguments):y).end()})},w.scaleBy=function(f,y,p,N){w.scaleTo(f,function(){var P=this.__zoom.k,D=typeof y=="function"?y.apply(this,arguments):y;return P*D},p,N)},w.scaleTo=function(f,y,p,N){w.transform(f,function(){var P=e.apply(this,arguments),D=this.__zoom,Y=p==null?B(P):typeof p=="function"?p.apply(this,arguments):p,q=D.invert(Y),ct=typeof y=="function"?y.apply(this,arguments):y;return n(lt(ot(D,ct),Y,q),P,o)},p,N)},w.translateBy=function(f,y,p,N){w.transform(f,function(){return n(this.__zoom.translate(typeof y=="function"?y.apply(this,arguments):y,typeof p=="function"?p.apply(this,arguments):p),e.apply(this,arguments),o)},null,N)},w.translateTo=function(f,y,p,N,P){w.transform(f,function(){var D=e.apply(this,arguments),Y=this.__zoom,q=N==null?B(D):typeof N=="function"?N.apply(this,arguments):N;return n(Dt.translate(q[0],q[1]).scale(Y.k).translate(typeof y=="function"?-y.apply(this,arguments):-y,typeof p=="function"?-p.apply(this,arguments):-p),D,o)},N,P)};function ot(f,y){return y=Math.max(a[0],Math.min(a[1],y)),y===f.k?f:new Pt(y,f.x,f.y)}function lt(f,y,p){var N=y[0]-p[0]*f.k,P=y[1]-p[1]*f.k;return N===f.x&&P===f.y?f:new Pt(f.k,N,P)}function B(f){return[(+f[0][0]+ +f[1][0])/2,(+f[0][1]+ +f[1][1])/2]}function E(f,y,p,N){f.on("start.zoom",function(){$(this,arguments).event(N).start()}).on("interrupt.zoom end.zoom",function(){$(this,arguments).event(N).end()}).tween("zoom",function(){var P=this,D=arguments,Y=$(P,D).event(N),q=e.apply(P,D),ct=p==null?B(q):typeof p=="function"?p.apply(P,D):p,nt=Math.max(q[1][0]-q[0][0],q[1][1]-q[0][1]),v=P.__zoom,H=typeof y=="function"?y.apply(P,D):y,tt=c(v.invert(ct).concat(nt/v.k),H.invert(ct).concat(nt/H.k));return function(j){if(j===1)j=H;else{var g=tt(j),x=nt/g[2];j=new Pt(x,ct[0]-g[0]*x,ct[1]-g[1]*x)}Y.zoom(null,j)}})}function $(f,y,p){return!p&&f.__zooming||new V(f,y)}function V(f,y){this.that=f,this.args=y,this.active=0,this.sourceEvent=null,this.extent=e.apply(f,y),this.taps=0}V.prototype={event:function(f){return f&&(this.sourceEvent=f),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(f,y){return this.mouse&&f!=="mouse"&&(this.mouse[1]=y.invert(this.mouse[0])),this.touch0&&f!=="touch"&&(this.touch0[1]=y.invert(this.touch0[0])),this.touch1&&f!=="touch"&&(this.touch1[1]=y.invert(this.touch1[0])),this.that.__zoom=y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(f){var y=G(this.that).datum();l.call(f,this.that,new pa(f,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:l}),y)}};function dt(f,...y){if(!t.apply(this,arguments))return;var p=$(this,y).event(f),N=this.__zoom,P=Math.max(a[0],Math.min(a[1],N.k*Math.pow(2,r.apply(this,arguments)))),D=Bt(f);if(p.wheel)(p.mouse[0][0]!==D[0]||p.mouse[0][1]!==D[1])&&(p.mouse[1]=N.invert(p.mouse[0]=D)),clearTimeout(p.wheel);else{if(N.k===P)return;p.mouse=[D,N.invert(D)],me(this),p.start()}Zt(f),p.wheel=setTimeout(Y,A),p.zoom("mouse",n(lt(ot(N,P),p.mouse[0],p.mouse[1]),p.extent,o));function Y(){p.wheel=null,p.end()}}function et(f,...y){if(d||!t.apply(this,arguments))return;var p=f.currentTarget,N=$(this,y,!0).event(f),P=G(f.view).on("mousemove.zoom",ct,!0).on("mouseup.zoom",nt,!0),D=Bt(f,p),Y=f.clientX,q=f.clientY;Ai(f.view),Ae(f),N.mouse=[D,this.__zoom.invert(D)],me(this),N.start();function ct(v){if(Zt(v),!N.moved){var H=v.clientX-Y,tt=v.clientY-q;N.moved=H*H+tt*tt>_}N.event(v).zoom("mouse",n(lt(N.that.__zoom,N.mouse[0]=Bt(v,p),N.mouse[1]),N.extent,o))}function nt(v){P.on("mousemove.zoom mouseup.zoom",null),Si(v.view,N.moved),Zt(v),N.event(v).end()}}function b(f,...y){if(t.apply(this,arguments)){var p=this.__zoom,N=Bt(f.changedTouches?f.changedTouches[0]:f,this),P=p.invert(N),D=p.k*(f.shiftKey?.5:2),Y=n(lt(ot(p,D),N,P),e.apply(this,y),o);Zt(f),s>0?G(this).transition().duration(s).call(E,Y,N,f):G(this).call(w.transform,Y,N,f)}}function J(f,...y){if(t.apply(this,arguments)){var p=f.touches,N=p.length,P=$(this,y,f.changedTouches.length===N).event(f),D,Y,q,ct;for(Ae(f),Y=0;Y<N;++Y)q=p[Y],ct=Bt(q,this),ct=[ct,this.__zoom.invert(ct),q.identifier],P.touch0?!P.touch1&&P.touch0[2]!==ct[2]&&(P.touch1=ct,P.taps=0):(P.touch0=ct,D=!0,P.taps=1+!!u);u&&(u=clearTimeout(u)),D&&(P.taps<2&&(h=ct[0],u=setTimeout(function(){u=null},m)),me(this),P.start())}}function Z(f,...y){if(this.__zooming){var p=$(this,y).event(f),N=f.changedTouches,P=N.length,D,Y,q,ct;for(Zt(f),D=0;D<P;++D)Y=N[D],q=Bt(Y,this),p.touch0&&p.touch0[2]===Y.identifier?p.touch0[0]=q:p.touch1&&p.touch1[2]===Y.identifier&&(p.touch1[0]=q);if(Y=p.that.__zoom,p.touch1){var nt=p.touch0[0],v=p.touch0[1],H=p.touch1[0],tt=p.touch1[1],j=(j=H[0]-nt[0])*j+(j=H[1]-nt[1])*j,g=(g=tt[0]-v[0])*g+(g=tt[1]-v[1])*g;Y=ot(Y,Math.sqrt(j/g)),q=[(nt[0]+H[0])/2,(nt[1]+H[1])/2],ct=[(v[0]+tt[0])/2,(v[1]+tt[1])/2]}else if(p.touch0)q=p.touch0[0],ct=p.touch0[1];else return;p.zoom("touch",n(lt(Y,q,ct),p.extent,o))}}function I(f,...y){if(this.__zooming){var p=$(this,y).event(f),N=f.changedTouches,P=N.length,D,Y;for(Ae(f),d&&clearTimeout(d),d=setTimeout(function(){d=null},m),D=0;D<P;++D)Y=N[D],p.touch0&&p.touch0[2]===Y.identifier?delete p.touch0:p.touch1&&p.touch1[2]===Y.identifier&&delete p.touch1;if(p.touch1&&!p.touch0&&(p.touch0=p.touch1,delete p.touch1),p.touch0)p.touch0[1]=this.__zoom.invert(p.touch0[0]);else if(p.end(),p.taps===2&&(Y=Bt(Y,this),Math.hypot(h[0]-Y[0],h[1]-Y[1])<M)){var q=G(this).on("dblclick.zoom");q&&q.apply(this,arguments)}}}return w.wheelDelta=function(f){return arguments.length?(r=typeof f=="function"?f:fe(+f),w):r},w.filter=function(f){return arguments.length?(t=typeof f=="function"?f:fe(!!f),w):t},w.touchable=function(f){return arguments.length?(i=typeof f=="function"?f:fe(!!f),w):i},w.extent=function(f){return arguments.length?(e=typeof f=="function"?f:fe([[+f[0][0],+f[0][1]],[+f[1][0],+f[1][1]]]),w):e},w.scaleExtent=function(f){return arguments.length?(a[0]=+f[0],a[1]=+f[1],w):[a[0],a[1]]},w.translateExtent=function(f){return arguments.length?(o[0][0]=+f[0][0],o[1][0]=+f[1][0],o[0][1]=+f[0][1],o[1][1]=+f[1][1],w):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},w.constrain=function(f){return arguments.length?(n=f,w):n},w.duration=function(f){return arguments.length?(s=+f,w):s},w.interpolate=function(f){return arguments.length?(c=f,w):c},w.on=function(){var f=l.on.apply(l,arguments);return f===l?w:f},w.clickDistance=function(f){return arguments.length?(_=(f=+f)*f,w):Math.sqrt(_)},w.tapDistance=function(f){return arguments.length?(M=+f,w):M},w}const oe={horizontalExtension:30,minEdgeDistance:50,minVerticalSegment:20,loopRadius:40,edgeSpacing:80,cornerRadius:4,arrowWidth:10,arrowHeight:6,labelHeight:15,labelFontSize:10,labelPadding:6,labelCornerRadius:4,nodeSpacing:50,nearlyHorizontalThreshold:5,nearlyAlignedThreshold:30};function va(t){return{...oe,...t}}const wa=.6,ba=/mono|fira|consolas|courier|menlo|roboto mono|ui-monospace/i,dn={i:.27,l:.27,j:.27,I:.29,".":.28,",":.28,":":.28,";":.28,"'":.2,"|":.26,"!":.3,f:.32,t:.34,r:.38,"(":.34,")":.34,"[":.34,"]":.34," ":.28},pn={m:.85,w:.74,M:.83,W:.86,"@":.92};function Ea(t){if(t in dn)return dn[t];if(t in pn)return pn[t];const e=t.charCodeAt(0);return e>=48&&e<=57?.57:e>=65&&e<=90?.66:e>=97&&e<=122?.53:e>=33&&e<=126?.5:e>11904?1:.55}function $a(t){return!!t&&ba.test(t)}function Na(t,e,n){if(!t)return 0;if($a(e))return t.length*n*wa;let r=0;for(const i of t)r+=Ea(i);return r*n}function Ca(t,e,n){const o=(t.clientWidth||800)/e,s=32/(n*o);return Math.max(3,s)}function Se(t,e,n){const r=t.attr("font-family")||void 0,i=parseFloat(t.attr("font-size")||"12")||12,a=l=>Na(l,r,i);if(t.text(n),a(n)<=e)return;const o="...";let s=0,c=n.length;for(;s<c;){const l=Math.floor((s+c+1)/2);a(n.slice(0,l)+o)<=e?s=l:c=l-1}s>0?t.text(n.slice(0,s)+o):t.text(o)}class Hn{constructor(e,n,r,i,a){this.type=e,this._gvid=n,this.name=r,this._draw_=i,this._ldraw_=a}}class Xn extends Hn{constructor({_gvid:e,name:n,_draw_:r,_ldraw_:i,bb:a,pos:o,width:s,height:c,label:l}){super("node",e,n,r,i),this.virtualNode=!1,this.bb=a,this.pos=o,this.width=s,this.height=c,this.label=l}getPosition(){if(!this.pos)return null;const[e,n]=this.pos.split(",").map(Number);return[e,n]}getWidthPoints(){return parseFloat(this.width||"1")*72}getHeightPoints(){return parseFloat(this.height||"0.5")*72}getBounds(){const e=this.getPosition();if(!e)return null;const[n,r]=e,i=this.getWidthPoints(),a=this.getHeightPoints();return{x:n-i/2,y:r-a/2,width:i,height:a}}leftIn(){const e=this.getBounds();return e?{x:e.x,y:Math.trunc(e.y+e.height/4)}:null}leftOut(){const e=this.getBounds();return e?{x:e.x,y:Math.trunc(e.y+e.height/4*3)}:null}rightOut(){const e=this.getBounds();return e?{x:e.x+e.width,y:Math.trunc(e.y+e.height/4)}:null}rightIn(){const e=this.getBounds();return e?{x:e.x+e.width,y:Math.trunc(e.y+e.height/4*3)}:null}}class ka extends Hn{constructor({_gvid:e,name:n,_draw_:r,_ldraw_:i,_hdraw_:a,_tdraw_:o,head:s,tail:c,label:l}){if(super("edge",e,n,r,i),this.isBaseEdge=!1,this.depth=0,this.baseOffset=0,this.midY=0,this._hdraw_=a,this._tdraw_=o,this.head=s,this.tail=c,this.label=l,l)try{this.edgeContent=Jt(l),this.edgeIndex=this.edgeContent.index,this.edgeColor=this.edgeContent.color}catch(u){console.warn(`Failed to decode edge label for ${n}:`,u)}}setNodes(e,n){this.sourceNode=e,this.targetNode=n}getDirection(){if(!this.sourceNode||!this.targetNode)return null;const e=this.sourceNode.getPosition(),n=this.targetNode.getPosition();return!e||!n?null:this.sourceNode._gvid===this.targetNode._gvid?"self":e[0]<n[0]?"right":"left"}getStartPoint(){if(!this.sourceNode)return null;const e=this.getDirection();if(!e)return null;switch(e){case"right":return this.sourceNode.rightOut();case"left":return this.sourceNode.leftOut();case"self":return this.sourceNode.leftOut()}}getEndPoint(){if(!this.targetNode)return null;const e=this.getDirection();if(!e)return null;switch(e){case"right":return this.targetNode.leftIn();case"left":return this.targetNode.rightIn();case"self":return this.targetNode.rightIn()}}getLabelText(){var e;if((e=this.edgeContent)!=null&&e.elems&&this.edgeContent.elems.length>0)return this.edgeContent.elems.map(n=>n.text).join(" ");if(this.label)return this.label.replace(/<[^>]*>/g," ").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/ /g," ").replace(/\s+/g," ").trim()||null;if(this._ldraw_){const n=[];if(this._ldraw_.forEach(r=>{r.op==="T"&&r.text&&n.push(r.text)}),n.length>0)return n.join(" ")}return null}getColor(){const e="#9AA4B2";if(this.edgeColor)return this.edgeColor;if(this._draw_){for(const n of this._draw_)if(n.op==="c"&&n.color)return n.color}if(this._hdraw_){for(const n of this._hdraw_)if(n.op==="c"&&n.color)return n.color}return e}}class Wn{constructor(e,n=0){this.index=e,this.aboveY=n,this.belowY=n}allocateAbove(e){return this.aboveY-=e,this.aboveY}allocateBelow(e){const n=this.belowY;return this.belowY+=e,n}getRange(){return{above:this.aboveY,below:this.belowY}}}class Aa extends Wn{constructor(e,n=0){super(e,n),this.nodes=[]}addNode(e,n=!0){if(this.nodes.push(e),!n)return;const r=e.getPosition();if(r){const i=e.height?parseFloat(e.height)*72:40,a=r[1]-i/2,o=r[1]+i/2;this.aboveY=Math.min(this.aboveY,a),this.belowY=Math.max(this.belowY,o)}}}class Sa extends Wn{constructor(e,n,r=0){super(Math.min(e,n),r),this.edges=[],this.baseEdgeIndex=-1,this.sourceColIndex=e,this.targetColIndex=n}addEdge(e){this.edges.push(e)}setBaseEdge(e,n){this.baseEdge=e,this.baseEdgeIndex=n??this.edges.indexOf(e)}getKey(){const e=Math.min(this.sourceColIndex,this.targetColIndex),n=Math.max(this.sourceColIndex,this.targetColIndex);return`${e}-${n}`}}function Ma(t){if(!t)return[];const e=[],n=/<TD[^>]*>(.*?)<\/TD>/gi;let r;for(;(r=n.exec(t))!==null;){let i=r[1];i=i.replace(/<[^>]+>/g,"").trim(),i&&e.push(i)}if(e.length===0){const i=t.replace(/<[^>]+>/g,"").trim();i&&e.push(i)}return e}function Ia(t){const e=G(t).select("svg"),n=e.select("g#graph0");if(e.empty()||n.empty()){console.warn("SVG or graph group not found");return}e.attr("width","100%").attr("height","100%");const r=qe().scaleExtent([.1,2]).on("zoom",o=>{n.attr("transform",o.transform.toString())});e.call(r);const i=e.node(),a=n.node();if(i&&a){const o=a.getBBox(),s=i.parentElement;if(s){const c=s.clientWidth,l=s.clientHeight,u=o.width,h=o.height,d=o.x+u/2,m=o.y+h/2,A=.8/Math.max(u/c,h/l),_=[c/2-A*d,l/2-A*m];e.call(r.transform,Dt.translate(_[0],_[1]).scale(A))}}}function Pa(t){if(!t.sourceNode)return null;const e=t.sourceNode.getPosition();if(!e)return null;const r=50/72,i=new Xn({_gvid:-1e3-t._gvid,name:`virtual_edge_${t._gvid}`,label:t.label,pos:`${e[0]},${e[1]}`,width:"0.5",height:r.toString()});return i.virtualNode=!0,i.edge=t,t.virtualNode=i,i}function Ta(t,e,n){const r=e.nodes,i=r.findIndex(a=>a._gvid===n._gvid);if(i===-1){r.push(t);return}r.splice(i,0,t)}function Ya(t,e){const r=[],i=new Map;t.forEach(l=>{const u=l.getPosition();if(!u)return;const h=u[0];let d=r.findIndex(m=>Math.abs(h-m)<=20);d===-1&&(d=r.length,r.push(h)),i.set(l._gvid,d)});const a=r.map((l,u)=>({x:l,i:u})).sort((l,u)=>l.x-u.x).map((l,u)=>({oldIndex:l.i,newIndex:u})),o=new Map;a.forEach(({oldIndex:l,newIndex:u})=>{o.set(l,u)});for(const[l,u]of i)i.set(l,o.get(u)??u);const s=new Map;t.forEach(l=>{const u=i.get(l._gvid);u!==void 0&&(s.has(u)||s.set(u,new Aa(u,0)),s.get(u).addNode(l,!1))}),e.forEach(l=>{if(!l.sourceNode||!l.targetNode||l.sourceNode._gvid!==l.targetNode._gvid)return;const u=i.get(l.sourceNode._gvid);if(u===void 0)return;const h=s.get(u);if(!h)return;const d=Pa(l);d&&Ta(d,h,l.sourceNode)});const c=new Map;return e.forEach(l=>{if(!l.sourceNode||!l.targetNode)return;const u=i.get(l.sourceNode._gvid),h=i.get(l.targetNode._gvid);if(u===void 0||h===void 0)return;l.depth=Math.abs(h-u)-1,l.depth<0&&(l.depth=0);const d=Math.min(u,h),m=Math.max(u,h),A=`${d}-${m}`;c.has(A)||c.set(A,new Sa(u,h,0)),c.get(A).addEdge(l)}),c.forEach(l=>{l.edges.sort((u,h)=>{const d=u.getStartPoint(),m=u.getEndPoint(),A=d&&m?(d.y+m.y)/2:0,_=h.getStartPoint(),M=h.getEndPoint();return(_&&M?(_.y+M.y)/2:0)-A})}),{nodeColumnMap:i,nodeColumns:s,edgeColumns:c}}function za(t,e){t.forEach(n=>{if(n.nodes.length===0)return;let r=!0;n.nodes.forEach(i=>{const a=i.getPosition();if(!a)return;const o=i.height?parseFloat(i.height)*72:40,s=e-a[1],c=s-o/2,l=s+o/2;r?(n.aboveY=c,n.belowY=l,r=!1):(n.aboveY=Math.min(n.aboveY,c),n.belowY=Math.max(n.belowY,l))})})}function Da(t,e){t.length!==0&&e.forEach(n=>{const r=n.edges;if(r.length===0)return;const i=r.filter(h=>h.depth===0);if(i.length===0)return;const a=Math.floor(i.length/2),o=i[a];o.isBaseEdge=!0,o.baseDirection=void 0;const s=r.indexOf(o);n.setBaseEdge(o,s);const c=o.getStartPoint(),l=o.getEndPoint(),u=c&&l?(c.y+l.y)/2:0;i.forEach(h=>{if(h===o)return;const d=h.getStartPoint(),m=h.getEndPoint();(d&&m?(d.y+m.y)/2:0)>u?h.baseDirection="above":h.baseDirection="below"})})}function he(t,e,n,r=oe){const i=t.getStartPoint(),a=t.getEndPoint(),o=t.getDirection();if(!i||!a||!o||o==="self")return;const s={x:i.x,y:e-i.y},c={x:a.x,y:e-a.y};let l={x:c.x,y:c.y};o==="right"?l={x:c.x-r.arrowWidth,y:c.y}:o==="left"&&(l={x:c.x+r.arrowWidth,y:c.y});const u=r.horizontalExtension,h=r.minEdgeDistance,d=r.minVerticalSegment,m=E=>{if(E.length<2)return E;const $=[E[0]];for(let V=1;V<E.length;V++){const dt=$[$.length-1];(Math.abs(E[V].x-dt.x)>.1||Math.abs(E[V].y-dt.y)>.1)&&$.push(E[V])}return $};let A;const _=t.baseDirection===void 0;t.baseDirection==="above"?A=Math.min(s.y,l.y):t.baseDirection==="below"?A=Math.max(s.y,l.y):A=(s.y+l.y)/2;let M=A;if(!_&&n&&n.midY!==void 0){if(t.baseDirection==="above"){const E=n.midY-h;M>E&&(M=E)}else if(t.baseDirection==="below"){const E=n.midY+h;M<E&&(M=E)}}const w=Math.abs(s.y-l.y)<5,ot=(E,$)=>{const V=Math.abs(s.y-$),dt=Math.abs($-l.y),et=o==="right"?s.x+u:s.x-u,b=o==="right"?l.x-u:l.x+u;let J=[],Z=$;switch(E){case"straight":if(w){const y=(s.y+l.y)/2;Math.abs($-y)<d?(J=[s,l],Z=y):(J=[s,{x:et,y:s.y},{x:et,y:$},{x:b,y:$},{x:b,y:l.y},l],Z=$)}else return null;break;case"2seg":V<dt?Math.abs($-s.y)<d?(J=[s,{x:l.x,y:s.y},l],Z=s.y):(J=[s,{x:et,y:s.y},{x:et,y:$},{x:b,y:$},{x:b,y:l.y},l],Z=$):Math.abs($-l.y)<d?(J=[s,{x:et,y:s.y},{x:et,y:l.y},l],Z=l.y):(J=[s,{x:et,y:s.y},{x:et,y:$},{x:b,y:$},{x:b,y:l.y},l],Z=$);break;case"3seg":const f=$;J=[s,{x:et,y:s.y},{x:et,y:f},{x:b,y:f},{x:b,y:l.y},l],Z=f;break;case"4seg":J=[s,{x:et,y:s.y},{x:et,y:$},{x:b,y:$},l],Z=$;break;case"5seg":if(V<d)J=[s,{x:et,y:s.y},{x:b,y:$},{x:b,y:l.y},l],Z=$;else if(dt<d)J=[s,{x:et,y:s.y},{x:et,y:$},{x:b,y:$},l],Z=$;else return null;break;case"6seg":J=[s,{x:et,y:s.y},{x:et,y:$},{x:b,y:$},{x:b,y:l.y},l],Z=$;break}const I=m(J);return I.length>0?{points:I,actualMidY:Z}:null};let lt;_?lt=w?["straight","3seg"]:["3seg"]:lt=w?["straight","3seg","4seg","5seg","6seg"]:["3seg","4seg","5seg","6seg"];for(const E of lt){const $=ot(E,M);if($)return{midY:$.actualMidY,points:$.points}}const B=ot("6seg",M);return B?{midY:B.actualMidY,points:B.points}:void 0}function gn(t,e){if(t.length<2)return"";if(e===0||t.length===2)return`M${t[0].x},${t[0].y} ${t.slice(1).map(i=>`L${i.x},${i.y}`).join(" ")}`;const n=[];n.push(`M${t[0].x},${t[0].y}`);for(let i=1;i<t.length-1;i++){const a=t[i-1],o=t[i],s=t[i+1],c=Math.sqrt((o.x-a.x)**2+(o.y-a.y)**2),l=Math.sqrt((s.x-o.x)**2+(s.y-o.y)**2),u=Math.min(c,l)/2,h=Math.min(e,u);if(h>0){const d=h/c,m=h/l,A={x:o.x-(o.x-a.x)*d,y:o.y-(o.y-a.y)*d},_={x:o.x+(s.x-o.x)*m,y:o.y+(s.y-o.y)*m};n.push(`L${A.x},${A.y}`),n.push(`Q${o.x},${o.y} ${_.x},${_.y}`)}else n.push(`L${o.x},${o.y}`)}const r=t[t.length-1];return n.push(`L${r.x},${r.y}`),n.join(" ")}function Ra(t,e,n,r=oe,i=!0,a,o,s,c,l,u,h,d=!1,m,A){var $,V,dt,et;const _=u!=null&&t.edgeIndex===u,M=t.getColor(),w=e.append("g").attr("class",_?"edge selected":"edge").attr("id",`edge_${t._gvid}`).attr("data-edge-id",t.edgeIndex!==void 0?String(t.edgeIndex):"").attr("data-is-base",t.isBaseEdge?"true":"false").attr("data-color",M).attr("data-source-node-id",(($=t.sourceNode)==null?void 0:$.name)||"").attr("data-target-node-id",((V=t.targetNode)==null?void 0:V.name)||""),ot=t.getStartPoint(),lt=t.getEndPoint(),B=t.getDirection(),E=r.arrowWidth;if(ot&<&&B){const b={x:ot.x,y:n-ot.y},J={x:lt.x,y:n-lt.y},Z={x:J.x,y:J.y};let I={x:J.x,y:J.y};B==="right"?I={x:J.x-E,y:J.y}:B==="left"?I={x:J.x+E,y:J.y}:B==="self"&&(I={x:J.x+E,y:J.y});let f;const y=r.loopRadius,p=r.horizontalExtension,N=r.cornerRadius;if(i)if(B==="self")if(t.virtualNode){const v=t.virtualNode.getPosition();if(v){const H=n-v[1];t.midY=H;const tt=[b,{x:b.x-p,y:b.y},{x:b.x-p,y:H},{x:I.x+p,y:H},{x:I.x+p,y:I.y},I];f=gn(tt,N)}else{const H=b.x-y,tt=b.y-y,j=I.x+y,g=I.y-y;f=`M${b.x},${b.y} C${H},${tt} ${j},${g} ${I.x},${I.y}`}}else{const v=b.x-y,H=b.y-y,tt=I.x+y,j=I.y-y;f=`M${b.x},${b.y} C${v},${H} ${tt},${j} ${I.x},${I.y}`}else{let v;if(t.orthogonalPathPoints&&t.orthogonalPathPoints.length>0)v=t.orthogonalPathPoints;else{const H=Math.abs(b.y-t.midY),tt=Math.abs(t.midY-I.y),j=20,g=H>=j,x=tt>=j,L=B==="right"?b.x+p:b.x-p,C=B==="right"?I.x-p:I.x+p;if(v=[],!g&&!x){const W=(b.y+I.y)/2;v.push(b,{x:L,y:W},{x:C,y:W},I)}else g?x?v.push(b,{x:L,y:b.y},{x:L,y:t.midY},{x:C,y:t.midY},{x:C,y:I.y},I):v.push(b,{x:L,y:b.y},{x:L,y:t.midY},{x:C,y:t.midY},I):v.push(b,{x:L,y:t.midY},{x:C,y:t.midY},{x:C,y:I.y},I)}f=gn(v,N)}else if(B==="self"){const v=b.x-y,H=b.y-y,tt=I.x+y,j=I.y-y;f=`M${b.x},${b.y} C${v},${H} ${tt},${j} ${I.x},${I.y}`}else{const v=I.x-b.x,H=.4,tt=b.x+v*H,j=b.y,g=I.x-v*H,x=I.y;f=`M${b.x},${b.y} C${tt},${j} ${g},${x} ${I.x},${I.y}`}const P=d&&t.isBaseEdge?"#000000":t.getColor(),D=d&&t.isBaseEdge?4:1.5;w.append("path").attr("d",f).attr("fill","none").attr("stroke","transparent").attr("stroke-width",10).attr("class","edge-hit-area").style("cursor","pointer"),w.append("path").attr("d",f).attr("fill","none").attr("stroke",P).attr("stroke-width",D).attr("class","edge-path").style("pointer-events","none"),w.on("mouseenter",function(){G(this).raise();const v=G(this).select(".arrow-group");if(!v.empty()){const L=v.attr("data-base-transform")||"";v.attr("transform",L+" scale(1.3)")}const H=e.select(".edge.selected").size()>0,tt=G(this).classed("selected"),j=G(this).attr("data-source-node-id"),g=G(this).attr("data-target-node-id"),x=G(this).attr("id");H&&!tt?(G(this).classed("hover-highlight",!0),e.selectAll(".node").each(function(){const L=G(this).attr("data-node-id");(L===j||L===g)&&G(this).classed("hover-highlight",!0)})):(e.selectAll(".edge").each(function(){G(this).attr("id")!==x&&G(this).classed("dimmed",!0)}),e.selectAll(".node").each(function(){const L=G(this).attr("data-node-id");L!==j&&L!==g&&G(this).classed("dimmed",!0)}))}).on("mouseleave",function(){const v=G(this).select(".arrow-group");if(!v.empty()){const H=v.attr("data-base-transform")||"";v.attr("transform",H)}e.selectAll(".edge.hover-highlight").classed("hover-highlight",!1),e.selectAll(".node.hover-highlight").classed("hover-highlight",!1),e.selectAll(".edge.dimmed").classed("dimmed",!1),e.selectAll(".node.dimmed").classed("dimmed",!1)});const Y=12;let q="";B==="right"?q=`translate(${Z.x-Y/2}, ${Z.y})`:B==="left"?q=`translate(${Z.x+Y/2}, ${Z.y}) rotate(180)`:B==="self"&&(q=`translate(${Z.x+Y/2}, ${Z.y}) rotate(180)`),w.append("g").attr("class","arrow-group").attr("transform",q).attr("data-base-transform",q).append("use").attr("class","edge-arrow").attr("href","#arrow-right").attr("width",Y).attr("height",Y).attr("x",-Y/2).attr("y",-Y/2).attr("fill",P).attr("stroke",P).style("stroke-width",0);const nt={x:(b.x+I.x)/2,y:t.midY};if(w.attr("data-label-center-x",nt.x).attr("data-label-center-y",nt.y),t.label){let v="";(dt=t.edgeContent)!=null&&dt.elems&&t.edgeContent.elems.length>0&&(v=t.edgeContent.elems.map(T=>T.text).join(" ")),v||(v=Ma(t.label).map(ut=>ut.length>20?ut.slice(0,20)+"...":ut).join(" "));const H=v.length>60?v.slice(0,60)+"...":v,tt=r.labelFontSize,j=tt*.6,g=H.length*j,x=tt,L=r.labelPadding,C=16,W=_?16:0,O=t.edgeIndex!==void 0,k=O&&m!==void 0&&m(t.edgeIndex)!==void 0,U=O&&A!==void 0&&A(t.edgeIndex)!==void 0,X=(k?C:0)+(U?C:0)+W,S=g+L*2+X,ht=x+L*2,pt=r.labelCornerRadius,K=nt.y,R=nt.x,Q=T=>G(`g.edge[data-edge-id="${T}"]`),F=12,z=w.append("g").attr("class","label-area");z.append("rect").attr("class","label-bg").attr("x",R-S/2).attr("y",K-ht/2).attr("width",S).attr("height",ht).attr("rx",5).attr("ry",5).attr("fill","var(--bg-primary, #fff)").attr("stroke","var(--border-primary, #CDCFD5)").attr("stroke-width",1.5);const Et=R-S/2+C/2,at=R+S/2-C/2-W,gt=R+S/2-W/2,it=R+(k?C/2:0)-(U?C/2:0)-(_?W/2:0);if(O&&h&&w.style("cursor","pointer").on("click",function(T){T.stopPropagation(),!_&&h(t.edgeIndex)}),(et=t.edgeContent)!=null&&et.elems&&t.edgeContent.elems.length>0){const vt=t.edgeContent.elems.map(ft=>{const rt=ft.text.length*6.2,st=ft.background&&ft.background!=="transparent",xt=rt+2;return{textWidth:rt,hasBackground:st,totalWidth:xt}}),$t=vt.reduce((ft,rt,st)=>ft+rt.totalWidth+(st>0,0),0);let wt=it-$t/2;t.edgeContent.elems.forEach((ft,rt)=>{const st=vt[rt];rt>0&&(wt+=0),st.hasBackground&&z.append("rect").attr("x",wt).attr("y",K-10/2-2).attr("width",st.totalWidth).attr("height",14).attr("rx",2).attr("ry",2).attr("fill",ft.background).style("pointer-events","none"),z.append("text").attr("class","label-text-elem").attr("x",wt+1).attr("y",K).attr("text-anchor","start").attr("dominant-baseline","middle").attr("font-family","Inter, Helvetica, Arial").attr("font-size","10px").attr("font-weight","500").attr("fill",ft.color&&ft.color.length>0?ft.color:P).style("pointer-events","none").text(ft.text),wt+=st.totalWidth})}else z.append("text").attr("class","label-text").attr("x",it).attr("y",K).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","Inter, Helvetica, Arial").attr("font-size","10px").attr("fill",P).style("pointer-events","none").text(H);if(d&&w.append("circle").attr("cx",nt.x).attr("cy",nt.y).attr("r",4).attr("fill","blue").attr("opacity",.8).style("pointer-events","none").attr("class","debug-label-center"),k&&m){const T=m(t.edgeIndex),ut=z.append("g").attr("class","nav-btn-group prev-btn-group");ut.append("rect").attr("class","nav-btn-area prev-btn-area").attr("x",R-S/2).attr("y",K-ht/2).attr("width",C).attr("height",ht).attr("fill","transparent").attr("rx",pt).style("cursor","pointer").style("pointer-events","all"),ut.append("use").attr("class","nav-icon prev-icon").attr("href","#nav-left").attr("x",Et-F/2).attr("y",K-F/2).attr("width",F).attr("height",F).attr("fill","#888"),ut.on("click",function(mt){mt.stopPropagation();const yt=Q(T);if(!yt.empty()){if(a&&o&&s&&c&&l){const Nt=yt.node();if(Nt){const vt=G(Nt),$t=vt.attr("data-label-center-x"),wt=vt.attr("data-label-center-y");let ft,rt;if($t&&wt)ft=parseFloat($t),rt=parseFloat(wt);else{const Wt=vt.select(".debug-label-center").node(),Rt=vt.select(".label-text").node();if(Wt)ft=parseFloat(Wt.getAttribute("cx")||"0"),rt=parseFloat(Wt.getAttribute("cy")||"0");else if(Rt)ft=parseFloat(Rt.getAttribute("x")||"0"),rt=parseFloat(Rt.getAttribute("y")||"0");else{const Yt=Nt.getBBox();ft=Yt.x+Yt.width/2,rt=Yt.y+Yt.height/2}}const st=s.clientWidth,xt=1.2*c/st,Ct=c/2-ft*xt,Xt=l/2-rt*xt,ae=o.select("g");ae.selectAll("g.edge, g.node").style("pointer-events","none"),o.transition().duration(500).call(a.transform,Dt.translate(Ct,Xt).scale(xt)).on("end",()=>{ae.selectAll("g.edge, g.node").style("pointer-events",null)})}}h&&h(T)}})}if(U&&A&&t.edgeIndex!==void 0){const T=A(t.edgeIndex),ut=_?at:R+S/2-C/2,mt=z.append("g").attr("class","nav-btn-group next-btn-group");mt.append("rect").attr("class","nav-btn-area next-btn-area").attr("x",R+S/2-C-W).attr("y",K-ht/2).attr("width",C).attr("height",ht).attr("fill","transparent").attr("rx",pt).style("cursor","pointer").style("pointer-events","all"),mt.append("use").attr("class","nav-icon next-icon").attr("href","#nav-right").attr("x",ut-F/2).attr("y",K-F/2).attr("width",F).attr("height",F).attr("fill","#888"),mt.on("click",function(yt){yt.stopPropagation();const Nt=Q(T);if(!Nt.empty()){if(a&&o&&s&&c&&l){const vt=Nt.node();if(vt){const $t=G(vt),wt=$t.attr("data-label-center-x"),ft=$t.attr("data-label-center-y");let rt,st;if(wt&&ft)rt=parseFloat(wt),st=parseFloat(ft);else{const Rt=$t.select(".debug-label-center").node(),Yt=$t.select(".label-text").node();if(Rt)rt=parseFloat(Rt.getAttribute("cx")||"0"),st=parseFloat(Rt.getAttribute("cy")||"0");else if(Yt)rt=parseFloat(Yt.getAttribute("x")||"0"),st=parseFloat(Yt.getAttribute("y")||"0");else{const se=vt.getBBox();rt=se.x+se.width/2,st=se.y+se.height/2}}const xt=s.clientWidth,Ct=1.2*c/xt,Xt=c/2-rt*Ct,ae=l/2-st*Ct,Wt=o.select("g");Wt.selectAll("g.edge, g.node").style("pointer-events","none"),o.transition().duration(500).call(a.transform,Dt.translate(Xt,ae).scale(Ct)).on("end",()=>{Wt.selectAll("g.edge, g.node").style("pointer-events",null)})}}h&&h(T)}})}_&&O&&h&&w.append("text").attr("class","close-btn").attr("x",gt).attr("y",K).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","Arial").attr("font-size","12px").attr("font-weight","bold").attr("fill","#888").style("cursor","pointer").text("✕").on("mouseenter",function(){G(this).attr("fill","#EF4444")}).on("mouseleave",function(){G(this).attr("fill","#888")}).on("click",function(T){T.stopPropagation(),h(null)})}else t._ldraw_&&t._ldraw_.forEach(v=>{if(v.op==="T"&&v.text){const H=v.size||10,tt=H*.6,j=v.text.length*tt,g=H,x=6,L=j+x*2,C=g+x*2,W=4,O=nt.y;w.append("rect").attr("x",nt.x-L/2).attr("y",O-C/2).attr("width",L).attr("height",C).attr("rx",W).attr("ry",W).attr("fill","white").attr("stroke","#d0d0d0").attr("stroke-width",.5),w.append("text").attr("x",nt.x).attr("y",O).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family",v.face||"Inter, Helvetica, Arial").attr("font-size",`${H}px`).attr("fill",v.color||"#666").text(v.text)}});if(d){let v;t.depth===0?v=`d:0 dir:${t.baseDirection||"base"} off:${t.baseOffset} id:${t._gvid}`:v=`d:${t.depth} dir:${t.baseDirection||"?"} midY:${Math.round(t.midY)} id:${t._gvid}`,w.append("text").attr("x",nt.x).attr("y",nt.y+15).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","monospace").attr("font-size","9px").attr("fill","#999").text(v)}}else t._draw_&&t._draw_.forEach(b=>{if(b.op==="b"&&b.points){const J=b.points.map(([I,f])=>[I,n-f]),Z=`M${J[0][0]},${J[0][1]} C${J.slice(1).map(I=>`${I[0]},${I[1]}`).join(" ")}`;w.append("path").attr("d",Z).attr("fill","none").attr("stroke",b.color||"#9AA4B2").attr("stroke-width",2)}}),t._hdraw_&&t._hdraw_.forEach(b=>{if(b.op==="P"&&b.points){const J=b.points.map(([Z,I])=>[Z,n-I]);w.append("polygon").attr("points",J.map(Z=>Z.join(",")).join(" ")).attr("fill",b.color||"#9AA4B2")}}),t._ldraw_&&Lt(w,t._ldraw_,n)}function Me(t,e,n,r,i){const a=i.topLeft||0,o=i.topRight||0,s=i.bottomRight||0,c=i.bottomLeft||0;return`
|
|
2
|
-
M ${t+a} ${e}
|
|
3
|
-
L ${t+n-o} ${e}
|
|
4
|
-
${o?`Q ${t+n} ${e} ${t+n} ${e+o}`:""}
|
|
5
|
-
L ${t+n} ${e+r-s}
|
|
6
|
-
${s?`Q ${t+n} ${e+r} ${t+n-s} ${e+r}`:""}
|
|
7
|
-
L ${t+c} ${e+r}
|
|
8
|
-
${c?`Q ${t} ${e+r} ${t} ${e+r-c}`:""}
|
|
9
|
-
L ${t} ${e+a}
|
|
10
|
-
${a?`Q ${t} ${e} ${t+a} ${e}`:""}
|
|
11
|
-
Z
|
|
12
|
-
`.trim().replace(/\s+/g," ")}function Ba(t,e,n,r,i=!0,a=oe,o=!0,s=14,c=!1,l,u,h,d,m,A=!0,_={}){var j;const M=_.headless===!0;t.innerHTML="";const w=((j=e.bb)==null?void 0:j.split(",").map(Number))||[0,0,1e3,800],[,,ot,lt]=w;let B=ot;const E=lt,$=G(t).append("svg").attr("width","100%").attr("height","100%").attr("viewBox",`0 0 ${B} ${E}`);$.append("defs").html(`
|
|
13
|
-
<style>
|
|
14
|
-
@keyframes selected-pulse {
|
|
15
|
-
0%, 100% {
|
|
16
|
-
stroke-opacity: 1;
|
|
17
|
-
}
|
|
18
|
-
50% {
|
|
19
|
-
stroke-opacity: 0.7;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
.edge {
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
}
|
|
25
|
-
.edge path {
|
|
26
|
-
/* No transition on dash properties to avoid conflict with animation */
|
|
27
|
-
}
|
|
28
|
-
.edge use {
|
|
29
|
-
transition: transform 0.2s ease;
|
|
30
|
-
}
|
|
31
|
-
.edge text {
|
|
32
|
-
transition: font-weight 0.2s ease;
|
|
33
|
-
}
|
|
34
|
-
/* Marching ants animation keyframe */
|
|
35
|
-
@keyframes marching-ants {
|
|
36
|
-
0% { stroke-dashoffset: 0; }
|
|
37
|
-
100% { stroke-dashoffset: -12; }
|
|
38
|
-
}
|
|
39
|
-
/* Arrow group scaling transition (JS handles actual transform) */
|
|
40
|
-
.edge .arrow-group {
|
|
41
|
-
transition: transform 0.15s ease;
|
|
42
|
-
}
|
|
43
|
-
/* Hover effect: marching ants dashed line */
|
|
44
|
-
.edge:hover:not(.selected) path.edge-path {
|
|
45
|
-
stroke-dasharray: 6 6;
|
|
46
|
-
stroke-width: 4px;
|
|
47
|
-
animation: marching-ants 0.6s linear infinite;
|
|
48
|
-
}
|
|
49
|
-
/* Selected effect: marching ants dashed line */
|
|
50
|
-
.edge.selected path.edge-path {
|
|
51
|
-
stroke-dasharray: 6 6;
|
|
52
|
-
stroke-width: 4px;
|
|
53
|
-
animation: marching-ants 0.6s linear infinite;
|
|
54
|
-
}
|
|
55
|
-
.close-btn {
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
}
|
|
58
|
-
/* Nav icon visibility - controlled purely by CSS */
|
|
59
|
-
.nav-icon {
|
|
60
|
-
opacity: 0;
|
|
61
|
-
transition: opacity 0.15s ease, fill 0.15s ease;
|
|
62
|
-
pointer-events: none;
|
|
63
|
-
}
|
|
64
|
-
/* Show nav icons when hovering over the label area group */
|
|
65
|
-
.label-area:hover .nav-icon {
|
|
66
|
-
opacity: 1;
|
|
67
|
-
}
|
|
68
|
-
/* Also show nav icons when hovering on selected edge's nav button */
|
|
69
|
-
.nav-btn-group:hover .nav-icon {
|
|
70
|
-
fill: #3B82F6 !important;
|
|
71
|
-
opacity: 1;
|
|
72
|
-
}
|
|
73
|
-
.nav-btn-area {
|
|
74
|
-
transition: fill 0.15s ease;
|
|
75
|
-
}
|
|
76
|
-
.nav-btn-group:hover .nav-btn-area {
|
|
77
|
-
fill: rgba(59, 130, 246, 0.1);
|
|
78
|
-
}
|
|
79
|
-
/* Dimmed state for edge hover focus effect */
|
|
80
|
-
.edge.dimmed,
|
|
81
|
-
.node.dimmed {
|
|
82
|
-
opacity: 0.3;
|
|
83
|
-
transition: opacity 0.2s ease;
|
|
84
|
-
}
|
|
85
|
-
.edge:not(.dimmed),
|
|
86
|
-
.node:not(.dimmed) {
|
|
87
|
-
transition: opacity 0.2s ease;
|
|
88
|
-
}
|
|
89
|
-
/* Selection-based dimming - unrelated elements when edge is selected */
|
|
90
|
-
.edge.selection-dimmed,
|
|
91
|
-
.node.selection-dimmed {
|
|
92
|
-
opacity: 0.3;
|
|
93
|
-
transition: opacity 0.2s ease;
|
|
94
|
-
}
|
|
95
|
-
/* Hover highlight overrides selection-dimmed to restore visibility */
|
|
96
|
-
.edge.hover-highlight,
|
|
97
|
-
.node.hover-highlight {
|
|
98
|
-
opacity: 1 !important;
|
|
99
|
-
transition: opacity 0.2s ease;
|
|
100
|
-
}
|
|
101
|
-
/* Selected edge should always be at full opacity */
|
|
102
|
-
.edge.selected {
|
|
103
|
-
opacity: 1 !important;
|
|
104
|
-
}
|
|
105
|
-
</style>
|
|
106
|
-
<symbol id="arrow-right" viewBox="0 0 12 12">
|
|
107
|
-
<path d="M11.53 5.46967C11.8229 5.76256 11.8229 6.23744 11.53 6.53033L6.75736 11.303C6.46447 11.5959 5.98959 11.5959 5.6967 11.303C5.40381 11.0101 5.40381 10.5352 5.6967 10.2423L9.93934 6L5.6967 1.75736C5.40381 1.46447 5.40381 0.989593 5.6967 0.696699C5.98959 0.403806 6.46447 0.403806 6.75736 0.696699L11.53 5.46967ZM0 5.25H11V6.75H0V5.25Z"/>
|
|
108
|
-
</symbol>
|
|
109
|
-
<symbol id="nav-left" viewBox="0 0 32 32">
|
|
110
|
-
<path d="M20.7073 25.2921C20.8002 25.385 20.8739 25.4953 20.9242 25.6167C20.9745 25.7381 21.0004 25.8682 21.0004 25.9996C21.0004 26.131 20.9745 26.2611 20.9242 26.3825C20.8739 26.5039 20.8002 26.6142 20.7073 26.7071C20.6144 26.8 20.5041 26.8737 20.3827 26.924C20.2613 26.9743 20.1312 27.0001 19.9998 27.0001C19.8684 27.0001 19.7383 26.9743 19.6169 26.924C19.4955 26.8737 19.3852 26.8 19.2923 26.7071L9.29231 16.7071C9.19933 16.6142 9.12557 16.5039 9.07525 16.3825C9.02493 16.2611 8.99902 16.131 8.99902 15.9996C8.99902 15.8682 9.02493 15.738 9.07525 15.6166C9.12557 15.4952 9.19933 15.385 9.29231 15.2921L19.2923 5.29208C19.4799 5.10444 19.7344 4.99902 19.9998 4.99902C20.2652 4.99902 20.5197 5.10444 20.7073 5.29208C20.895 5.47972 21.0004 5.73422 21.0004 5.99958C21.0004 6.26494 20.895 6.51944 20.7073 6.70708L11.4136 15.9996L20.7073 25.2921Z"/>
|
|
111
|
-
</symbol>
|
|
112
|
-
<symbol id="nav-right" viewBox="0 0 32 32">
|
|
113
|
-
<path d="M22.7076 16.7071L12.7076 26.7071C12.6147 26.8 12.5044 26.8737 12.383 26.924C12.2616 26.9743 12.1315 27.0001 12.0001 27.0001C11.8687 27.0001 11.7386 26.9743 11.6172 26.924C11.4958 26.8737 11.3855 26.8 11.2926 26.7071C11.1997 26.6142 11.126 26.5039 11.0757 26.3825C11.0254 26.2611 10.9995 26.131 10.9995 25.9996C10.9995 25.8682 11.0254 25.7381 11.0757 25.6167C11.126 25.4953 11.1997 25.385 11.2926 25.2921L20.5863 15.9996L11.2926 6.70708C11.1049 6.51944 10.9995 6.26494 10.9995 5.99958C10.9995 5.73422 11.1049 5.47972 11.2926 5.29208C11.4802 5.10444 11.7347 4.99902 12.0001 4.99902C12.2654 4.99902 12.5199 5.10444 12.7076 5.29208L22.7076 15.2921C22.8005 15.385 22.8743 15.4952 22.9246 15.6166C22.975 15.738 23.0009 15.8682 23.0009 15.9996C23.0009 16.131 22.975 16.2611 22.9246 16.3825C22.8743 16.5039 22.8005 16.6142 22.7076 16.7071Z"/>
|
|
114
|
-
</symbol>
|
|
115
|
-
`);const V=$.append("g").attr("id","graph0"),et=(e.objects||[]).map(g=>new Xn({_gvid:g._gvid,name:g.name,_draw_:g._draw_,_ldraw_:g._ldraw_,bb:g.bb,pos:g.pos,width:h!==void 0?String(h/72):g.width,height:d!==void 0?String(d/72):g.height,label:g.label})),b=new Map;et.forEach(g=>{b.set(g._gvid,g)});const Z=(e.edges||[]).map(g=>{const x=new ka({_gvid:g._gvid,name:g.name,_draw_:g._draw_,_ldraw_:g._ldraw_,_hdraw_:g._hdraw_,_tdraw_:g._tdraw_,head:g.head,tail:g.tail,label:g.label}),L=g.tail!==void 0?b.get(g.tail):void 0,C=g.head!==void 0?b.get(g.head):void 0;return L&&C&&x.setNodes(L,C),x}),{nodeColumnMap:I,nodeColumns:f,edgeColumns:y}=Ya(et,Z),p=Array.from(f.keys()).sort((g,x)=>g-x),N=p.length,P=80;let D;if(m!==void 0)D=m,B=(N>1?(N-1)*D:0)+2*P;else{const g=B-2*P;D=N>1?g/(N-1):0}if(p.forEach((g,x)=>{const L=f.get(g);if(!L)return;const C=L.nodes;if(C.length===0)return;const W=N>1?P+x*D:B/2;C.sort((R,Q)=>{const F=R.getPosition(),z=Q.getPosition();return!F||!z?0:z[1]-F[1]});const O=50,k=C.filter(R=>!R.virtualNode),U=k.length;if(U===0){let R=(E+C.reduce((Q,F)=>Q+F.getHeightPoints(),0))/2;C.forEach(Q=>{const F=Q.getHeightPoints();R-=F/2,Q.pos=`${W},${R}`,R-=F/2});return}let X,S;if(U%2===1){const R=Math.floor(U/2),Q=k[R];S=C.indexOf(Q),X=E/2}else{const R=U/2-1,Q=k[R];S=C.indexOf(Q),X=E/2}const ht=C[S],pt=ht.getHeightPoints();ht.pos=`${W},${X}`;let K=X+pt/2;for(let R=S-1;R>=0;R--){const Q=C[R],F=C[R+1],z=Q.getHeightPoints(),Et=Q.virtualNode||F.virtualNode?0:O;K+=Et+z/2,Q.pos=`${W},${K}`,K+=z/2}K=X-pt/2;for(let R=S+1;R<C.length;R++){const Q=C[R],F=C[R-1],z=Q.getHeightPoints(),Et=Q.virtualNode||F.virtualNode?0:O;K-=Et+z/2,Q.pos=`${W},${K}`,K-=z/2}}),m!==void 0&&$.attr("viewBox",`0 0 ${B} ${E}`),f.forEach(g=>{g.nodes.forEach(x=>{const L=x.getPosition();if(!L)return;const[C,W]=L,O=x.getWidthPoints(),k=x.getHeightPoints(),U=x.virtualNode;if(U&&!c)return;const X=V.append("g").attr("class",U?"node virtual-node":"node").attr("id",x.name).attr("data-node-id",x.name);let S=null;try{x.label&&(S=Jt(x.label))}catch(at){console.warn(`Failed to decode node label for ${x.name}:`,at)}S!=null&&S.key&&X.attr("data-key",S.key);const ht=c&&U,pt=(S==null?void 0:S.tags)||[],K=(S==null?void 0:S.label)||"",R=(S==null?void 0:S.text)||"",Q=(S==null?void 0:S.color)||"var(--text-primary, #171921)",F=(S==null?void 0:S.background)||"white",z=F!=="white";if((pt.length>0||K.length>0)&&!U){const at=k/2,gt=k/2,it=E-W-k/2,T=4,ut="var(--border-primary, #CDCFD5)";X.append("path").attr("d",Me(C-O/2,it,O,at,{topLeft:T,topRight:T})).attr("fill",z?F:"var(--bg-quaternary, #E1E2E5)").attr("stroke",ut).attr("stroke-width",1),z&&X.append("line").attr("x1",C-O/2).attr("y1",it+at).attr("x2",C+O/2).attr("y2",it+at).attr("stroke",Q).attr("stroke-width",1),X.append("path").attr("d",Me(C-O/2,it+at,O,gt,{bottomLeft:T,bottomRight:T})).attr("fill",z?F:"var(--bg-primary, #fff)").attr("stroke",ut).attr("stroke-width",1);const mt=X.append("rect").attr("x",C-O/2-4).attr("y",it-4).attr("width",O+8).attr("height",k+8).attr("rx",5).attr("ry",5).attr("fill","none").attr("stroke","var(--gray-700, #43444C)").attr("stroke-width",2).attr("opacity",0).style("pointer-events","none");X.style("cursor","pointer").on("mouseenter",function(){if(mt.attr("opacity",1),V.select(".edge.selected").size()>0)return;const st=G(this).attr("data-node-id"),xt=new Set([st]);V.selectAll(".edge").each(function(){const Ct=G(this).attr("data-source-node-id"),Xt=G(this).attr("data-target-node-id");Ct===st||Xt===st?Ct===st?xt.add(Xt):xt.add(Ct):G(this).classed("dimmed",!0)}),V.selectAll(".node").each(function(){const Ct=G(this).attr("data-node-id");xt.has(Ct)||G(this).classed("dimmed",!0)})}).on("mouseleave",function(){mt.attr("opacity",0),V.selectAll(".edge.dimmed").classed("dimmed",!1),V.selectAll(".node.dimmed").classed("dimmed",!1)});let yt=C-O/2+8;const Nt=it+at/2,vt=7.2,$t=6,wt=18,ft=4;if(pt.forEach(rt=>{const xt=rt.length*vt+$t*2;X.append("rect").attr("x",yt).attr("y",Nt-wt/2).attr("width",xt).attr("height",wt).attr("rx",5).attr("ry",5).attr("fill","var(--bg-warning-primary, #FFF8E1)").attr("stroke","var(--border-warning-light, #FFD66D)").attr("stroke-width",1),X.append("text").attr("x",yt+$t).attr("y",Nt).attr("text-anchor","start").attr("dominant-baseline","middle").attr("font-family","var(--font-inter), Inter, Helvetica, Arial").attr("font-size","12px").attr("font-weight","500").attr("fill","var(--text-warning-primary, #CD7004)").text(rt),yt+=xt+ft}),K){const rt=C+O/2-8-yt,st=X.append("text").attr("x",yt).attr("y",Nt).attr("text-anchor","start").attr("dominant-baseline","middle").attr("font-family","var(--font-inter), Inter, Helvetica, Arial").attr("font-size","12px").attr("font-weight","600").attr("fill",Q);Se(st,rt,K)}if(R){const rt=O-16,st=X.append("text").attr("x",C-O/2+8).attr("y",it+at+gt/2).attr("text-anchor","start").attr("dominant-baseline","middle").attr("font-family","var(--font-fira-code), Fira Code, monospace").attr("font-size","12px").attr("font-weight","400").attr("fill",Q);Se(st,rt,R)}}else{const gt=ht?"#EF4444":"var(--border-primary, #CDCFD5)",it=X.append("path").attr("d",Me(C-O/2,E-W-k/2,O,k,{topLeft:4,topRight:4,bottomLeft:4,bottomRight:4})).attr("fill",z?F:"var(--bg-primary, #fff)").attr("stroke",gt).attr("stroke-width",ht?2:1);if(!U){const T=X.append("rect").attr("x",C-O/2-4).attr("y",E-W-k/2-4).attr("width",O+8).attr("height",k+8).attr("rx",5).attr("ry",5).attr("fill","none").attr("stroke","#000000").attr("stroke-width",2).attr("opacity",0).style("pointer-events","none");it.style("cursor","pointer").on("mouseenter",function(){T.attr("opacity",1)}).on("mouseleave",function(){T.attr("opacity",0)})}if(S)if(U){const T=K||R;X.append("text").attr("x",C).attr("y",E-W).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","Inter, Helvetica, Arial").attr("font-size","10px").attr("fill","#991B1B").text(T.length>20?T.slice(0,20)+"...":T)}else{const T=R||K,ut=O-16,mt=X.append("text").attr("x",C-O/2+8).attr("y",E-W).attr("text-anchor","start").attr("dominant-baseline","middle").attr("font-family","var(--font-fira-code), Fira Code, monospace").attr("font-size","12px").attr("font-weight","400").attr("fill",Q);Se(mt,ut,T)}}!x.label&&x._ldraw_&&x._ldraw_.length>0&&!U&&x._ldraw_.forEach(at=>{at.op==="T"&&at.text&&X.append("text").attr("x",C-O/2+8).attr("y",E-W).attr("text-anchor","start").attr("dominant-baseline","middle").attr("font-family",at.face||"Inter, Helvetica, Arial").attr("font-size",`${at.size||11}px`).attr("fill",at.color||"#334155").text(at.text)})})}),o){za(f,E),Da(Z,y);const g=a.loopRadius,x=a.edgeSpacing,L=a.labelHeight;y.forEach(k=>{const U=k.edges;if(U.length===0)return;const X=k.baseEdge,S=k.baseEdgeIndex;if(!X||S<0)return;const ht=X.getStartPoint(),pt=X.getEndPoint();if(!ht||!pt)return;const K=E-ht.y,R=E-pt.y;X.midY=(K+R)/2;const Q=he(X,E,void 0,a);Q&&(X.midY=Q.midY,X.orthogonalPathPoints=Q.points),k.aboveY=X.midY,k.belowY=X.midY;for(let F=S-1;F>=0;F--){const z=U[F];if(z.depth!==0)continue;if(z.getDirection()==="self"){const T=z.getStartPoint();T&&(z.midY=E-T.y-g);continue}const at=z.label?x+L:x;z.midY=k.aboveY-at,k.aboveY=z.midY,z.baseDirection="above",z.baseOffset=-(S-F);const gt=F<U.length-1?U[F+1]:void 0,it=he(z,E,gt,a);it&&(z.midY=it.midY,z.orthogonalPathPoints=it.points,k.aboveY=z.midY)}for(let F=S+1;F<U.length;F++){const z=U[F];if(z.depth!==0)continue;if(z.getDirection()==="self"){const T=z.getStartPoint();T&&(z.midY=E-T.y-g);continue}const at=z.label?x+L:x;z.midY=k.belowY+at,k.belowY=z.midY,z.baseDirection="below",z.baseOffset=F-S;const gt=F>0?U[F-1]:void 0,it=he(z,E,gt,a);it&&(z.midY=it.midY,z.orthogonalPathPoints=it.points,k.belowY=z.midY)}});const C=[];y.forEach(k=>{const U=k.edges;U.length===0||k.baseEdge||!U.every(S=>S.depth>0)||U.forEach(S=>{if(S.getDirection()!=="self")C.push(S);else{const ht=S.getStartPoint();ht&&(S.midY=E-ht.y-g)}})}),C.sort((k,U)=>k.depth-U.depth);let W=1/0,O=-1/0;y.forEach(k=>{k.aboveY!==0&&(W=Math.min(W,k.aboveY)),k.belowY!==0&&(O=Math.max(O,k.belowY))}),f.forEach(k=>{k.aboveY!==0&&(W=Math.min(W,k.aboveY)),k.belowY!==0&&(O=Math.max(O,k.belowY))}),C.forEach(k=>{if(!k.sourceNode||!k.targetNode)return;const U=I.get(k.sourceNode._gvid),X=I.get(k.targetNode._gvid);if(U===void 0||X===void 0)return;const S=Math.min(U,X),ht=Math.max(U,X),pt=[];for(let T=S;T<=ht;T++){const ut=f.get(T);ut&&pt.push(...ut.nodes)}const K=pt.map(T=>{const ut=T.getPosition();if(!ut)return null;const mt=E-ut[1],yt=T.height?parseFloat(T.height)*72:40;return{y:mt,height:yt,bottomY:mt+yt/2}}).filter(T=>T!==null).sort((T,ut)=>T.y-ut.y);let R;if(K.length===0)R=(W+O)/2;else if(K.length%2===1)R=K[Math.floor(K.length/2)].bottomY;else{const T=K.length/2;R=(K[T-1].bottomY+K[T].bottomY)/2}const Q=k.getStartPoint(),F=k.getEndPoint(),Et=(Q&&F?E-(Q.y+F.y)/2:R)<R?"above":"below";k.baseDirection=Et;const at=k.label?x+L:x;let gt;Et==="above"?(k.midY=W-at,gt=W,W=k.midY):(k.midY=O+at,gt=O,O=k.midY);const it=he(k,E,{midY:gt},a);it&&(k.midY=it.midY,k.orthogonalPathPoints=it.points,Et==="above"?W=Math.min(W,it.midY):O=Math.max(O,it.midY))})}const Y=Z.map(g=>g.edgeIndex).filter(g=>g!==void 0).sort((g,x)=>g-x),q=g=>{const x=Y.indexOf(g);if(x>0)return Y[x-1]},ct=g=>{const x=Y.indexOf(g);if(x>=0&&x<Y.length-1)return Y[x+1]},nt=qe().scaleExtent([.1,Ca(t,B,s)]).on("zoom",g=>{const x=g.transform;!isNaN(x.x)&&!isNaN(x.y)&&!isNaN(x.k)&&V.attr("transform",x.toString())});if(M||$.call(nt),!M&&!A&&($.on("wheel.zoom",null),$.on("dblclick.zoom",null)),Z.forEach(g=>{if(r!=null){if(i){if(g.depth>r)return}else if(g.depth!==r)return}Ra(g,V,E,a,o,nt,$,t,B,E,l,u,c,q,ct)}),c){const g=V.node();if(g){const x=g.getBBox(),L=x.x+x.width/2,C=x.y+x.height/2;V.append("rect").attr("x",x.x).attr("y",x.y).attr("width",x.width).attr("height",x.height).attr("fill","none").attr("stroke","yellow").attr("stroke-width",3).attr("opacity",.8).style("pointer-events","none").attr("class","debug-root-border"),V.append("circle").attr("cx",L).attr("cy",C).attr("r",10).attr("fill","yellow").attr("stroke","orange").attr("stroke-width",2).attr("opacity",.9).style("pointer-events","none").attr("class","debug-geometric-center")}}let v;if(_.initialTransform)v=_.initialTransform;else if(M)v={x:B/2-B/2*.9,y:E/2-E/2*.9,k:.9};else{const g=V.node(),x=g?g.getBBox():{x:0,y:0,width:B,height:E},L=.9*B/x.width,C=x.x+x.width/2,W=x.y+x.height/2;v={x:B/2-C*L,y:E/2-W*L,k:L}}const H=`translate(${v.x},${v.y}) scale(${v.k})`;if(M?V.attr("transform",H):$.call(nt.transform,Dt.translate(v.x,v.y).scale(v.k)),c){const g=Math.max(B,E)*.003;$.append("circle").attr("cx",B/2).attr("cy",E/2).attr("r",g).attr("fill","red").attr("opacity",.9).style("pointer-events","none").attr("class","debug-center-marker")}const tt=Z.filter(g=>g.edgeIndex!==void 0).map(g=>{var x,L;return{id:g._gvid,index:g.edgeIndex,sourceNodeId:((x=g.sourceNode)==null?void 0:x.name)||"",targetNodeId:((L=g.targetNode)==null?void 0:L.name)||"",label:g.getLabelText()}}).sort((g,x)=>g.index-x.index);return{zoomBehavior:nt,svgElement:$.node(),gElement:V.node(),baseFontSize:s,viewBoxWidth:B,edges:tt,initialTransform:v}}function Lt(t,e,n){let r="#000000",i="#000000",a="#000000";e.forEach(o=>{switch(o.op){case"c":o.color&&(r=o.color);break;case"C":o.color&&(i=o.color);break;case"F":o.color&&(a=o.color);break;case"T":o.pt&&o.text&&t.append("text").attr("x",o.pt[0]).attr("y",n-o.pt[1]).attr("text-anchor",o.align==="l"?"start":o.align==="r"?"end":"middle").attr("font-family",o.face||"Inter, Helvetica, Arial").attr("font-size",`${o.size||12}px`).attr("fill",o.color||a).text(o.text);break;case"p":if(o.points){const s=o.points.map(([c,l])=>[c,n-l]);t.append("polygon").attr("points",s.map(c=>c.join(",")).join(" ")).attr("fill",i).attr("stroke",r)}break;case"P":if(o.points){const s=o.points.map(([c,l])=>[c,n-l]);t.append("polygon").attr("points",s.map(c=>c.join(",")).join(" ")).attr("fill","none").attr("stroke",r)}break;case"e":if(o.rect){const[s,c,l,u]=o.rect;t.append("ellipse").attr("cx",s).attr("cy",n-c).attr("rx",l).attr("ry",u).attr("fill",i).attr("stroke",r)}break;case"E":if(o.rect){const[s,c,l,u]=o.rect;t.append("ellipse").attr("cx",s).attr("cy",n-c).attr("rx",l).attr("ry",u).attr("fill","none").attr("stroke",r)}break;case"b":if(o.points){const s=o.points.map(([l,u])=>[l,n-u]),c=`M${s[0][0]},${s[0][1]} C${s.slice(1).map(l=>`${l[0]},${l[1]}`).join(" ")}`;t.append("path").attr("d",c).attr("fill","none").attr("stroke",r).attr("stroke-width",1)}break;case"B":if(o.points){const s=o.points.map(([l,u])=>[l,n-u]),c=`M${s[0][0]},${s[0][1]} C${s.slice(1).map(l=>`${l[0]},${l[1]}`).join(" ")}`;t.append("path").attr("d",c).attr("fill",i).attr("stroke",r).attr("stroke-width",1)}break;case"L":if(o.points){const c=`M${o.points.map(([l,u])=>[l,n-u]).map(l=>`${l[0]},${l[1]}`).join(" L")}`;t.append("path").attr("d",c).attr("fill","none").attr("stroke",r).attr("stroke-width",1)}break}})}function La(t,e,n=14){var A;t.innerHTML="";const r=((A=e.bb)==null?void 0:A.split(",").map(Number))||[0,0,1e3,800],[,,i,a]=r,o=G(t).append("svg").attr("width","100%").attr("height","100%").attr("viewBox",`0 0 ${i} ${a}`);o.append("defs").html(`
|
|
116
|
-
<style>
|
|
117
|
-
.node rect, .node ellipse, .node polygon {
|
|
118
|
-
cursor: pointer;
|
|
119
|
-
}
|
|
120
|
-
.edge {
|
|
121
|
-
cursor: pointer;
|
|
122
|
-
}
|
|
123
|
-
</style>
|
|
124
|
-
`);const s=o.append("g").attr("id","graph0");(e.objects||[]).forEach(_=>{const M=s.append("g").attr("class","node").attr("id",_.name);_._draw_&&Lt(M,_._draw_,a),_._ldraw_&&Lt(M,_._ldraw_,a)});const l=e.edges||[];l.forEach(_=>{const M=s.append("g").attr("class","edge").attr("id",`edge_${_._gvid}`);_._draw_&&Lt(M,_._draw_,a),_._hdraw_&&Lt(M,_._hdraw_,a),_._tdraw_&&Lt(M,_._tdraw_,a),_._ldraw_&&Lt(M,_._ldraw_,a)});const u=qe().scaleExtent([.1,10]).on("zoom",_=>{s.attr("transform",_.transform.toString())});o.call(u);const h=t.clientWidth||800,d=n*(h/i),m=l.filter(_=>{if(!_.label)return!1;try{const M=Jt(_.label);return(M==null?void 0:M.index)!==void 0}catch{return!1}}).map(_=>{var w;const M=Jt(_.label);return{id:_._gvid,index:M.index,sourceNodeId:String(_.tail??""),targetNodeId:String(_.head??""),label:((w=M.elems)==null?void 0:w.map(ot=>ot.text).join(" "))||null}}).sort((_,M)=>_.index-M.index);return{zoomBehavior:u,svgElement:o.node(),gElement:s.node(),baseFontSize:d,viewBoxWidth:i,edges:m}}exports.DEFAULT_LAYOUT_CONFIG=oe;exports.createLayoutConfig=va;exports.decodeDotString=Jt;exports.encodeDotString=Gn;exports.identity=Dt;exports.renderCustomGraph=Ba;exports.renderNativeGraph=La;exports.select=G;exports.setupZoomPan=Ia;exports.transform=On;
|