gitopo 0.0.1

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.
Files changed (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +110 -0
  3. package/bin/gitopo.js +20 -0
  4. package/dist/renderer/assets/index-B-xnAFkZ.css +1 -0
  5. package/dist/renderer/assets/index-B4NR76vm.css +1 -0
  6. package/dist/renderer/assets/index-B8-bMEZL.js +3 -0
  7. package/dist/renderer/assets/index-BSM6CD5c.js +3 -0
  8. package/dist/renderer/assets/index-Biwf0g5L.js +3 -0
  9. package/dist/renderer/assets/index-BkSteF7v.js +3 -0
  10. package/dist/renderer/assets/index-Bu2Is4Gi.js +3 -0
  11. package/dist/renderer/assets/index-BuunUFeT.js +3 -0
  12. package/dist/renderer/assets/index-BztqQcTT.js +3 -0
  13. package/dist/renderer/assets/index-C5GvfFhL.js +3 -0
  14. package/dist/renderer/assets/index-C5pqhkpE.css +1 -0
  15. package/dist/renderer/assets/index-CAjBcm7_.js +3 -0
  16. package/dist/renderer/assets/index-CPhqr81-.css +1 -0
  17. package/dist/renderer/assets/index-CRBk_3U9.js +4 -0
  18. package/dist/renderer/assets/index-CV77y4NX.js +3 -0
  19. package/dist/renderer/assets/index-CX4EqujF.js +3 -0
  20. package/dist/renderer/assets/index-Caevx9so.js +3 -0
  21. package/dist/renderer/assets/index-CbVNESqC.js +3 -0
  22. package/dist/renderer/assets/index-CgV3hEXF.js +3 -0
  23. package/dist/renderer/assets/index-Cgxb7yXH.js +3 -0
  24. package/dist/renderer/assets/index-Cu7Bdfdp.js +3 -0
  25. package/dist/renderer/assets/index-D-4eDZ-q.css +1 -0
  26. package/dist/renderer/assets/index-D3WoIbyB.js +3 -0
  27. package/dist/renderer/assets/index-DATWWeXq.js +3 -0
  28. package/dist/renderer/assets/index-DGVlk6ue.css +1 -0
  29. package/dist/renderer/assets/index-DKxk7KCa.js +3 -0
  30. package/dist/renderer/assets/index-DPD27o55.js +3 -0
  31. package/dist/renderer/assets/index-DaP2KGsB.js +3 -0
  32. package/dist/renderer/assets/index-DeuGEmKM.js +3 -0
  33. package/dist/renderer/assets/index-Dg_WVb0M.js +3 -0
  34. package/dist/renderer/assets/index-Dhbf0Fci.js +3 -0
  35. package/dist/renderer/assets/index-DnUHDinm.css +1 -0
  36. package/dist/renderer/assets/index-DuNCgxuJ.js +3 -0
  37. package/dist/renderer/assets/index-HYzjpgUI.js +3 -0
  38. package/dist/renderer/assets/index-Mn_-m7Tt.js +3 -0
  39. package/dist/renderer/assets/index-N_FqOAes.js +3 -0
  40. package/dist/renderer/assets/index-TVFDuiMT.js +3 -0
  41. package/dist/renderer/assets/index-UF9gobFY.css +1 -0
  42. package/dist/renderer/assets/index-V7JII7CO.js +3 -0
  43. package/dist/renderer/assets/index-jDaMuPPI.css +1 -0
  44. package/dist/renderer/assets/index-kUku5Va6.js +3 -0
  45. package/dist/renderer/index.html +38 -0
  46. package/docs/screenshot.png +0 -0
  47. package/package.json +57 -0
  48. package/src/main/index.js +85 -0
  49. package/src/main/preload.js +16 -0
@@ -0,0 +1,3 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var sn={value:()=>{}};function ke(){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 xt(n)}function xt(t){this._=t}function an(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}})}xt.prototype=ke.prototype={constructor:xt,on:function(t,e){var n=this._,r=an(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=cn(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=pe(n[i],t.name,e);else if(e==null)for(i in n)n[i]=pe(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 xt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function cn(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function pe(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=sn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Dt="http://www.w3.org/1999/xhtml";const de={svg:"http://www.w3.org/2000/svg",xhtml:Dt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function kt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),de.hasOwnProperty(e)?{space:de[e],local:t}:t}function ln(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Dt&&e.documentElement.namespaceURI===Dt?e.createElement(t):e.createElementNS(n,t)}}function un(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Be(t){var e=kt(t);return(e.local?un:ln)(e)}function fn(){}function Qt(t){return t==null?fn:function(){return this.querySelector(t)}}function hn(t){typeof t!="function"&&(t=Qt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=new Array(s),c,l,u=0;u<s;++u)(c=o[u])&&(l=t.call(c,c.__data__,u,o))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new A(r,this._parents)}function pn(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function dn(){return[]}function Re(t){return t==null?dn:function(){return this.querySelectorAll(t)}}function gn(t){return function(){return pn(t.apply(this,arguments))}}function mn(t){typeof t=="function"?t=gn(t):t=Re(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(r.push(t.call(c,c.__data__,l,s)),i.push(c));return new A(r,i)}function Me(t){return function(){return this.matches(t)}}function Te(t){return function(e){return e.matches(t)}}var wn=Array.prototype.find;function yn(t){return function(){return wn.call(this.children,t)}}function _n(){return this.firstElementChild}function xn(t){return this.select(t==null?_n:yn(typeof t=="function"?t:Te(t)))}var vn=Array.prototype.filter;function bn(){return Array.from(this.children)}function $n(t){return function(){return vn.call(this.children,t)}}function En(t){return this.selectAll(t==null?bn:$n(typeof t=="function"?t:Te(t)))}function Sn(t){typeof t!="function"&&(t=Me(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new A(r,this._parents)}function Ie(t){return new Array(t.length)}function Nn(){return new A(this._enter||this._groups.map(Ie),this._parents)}function $t(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}$t.prototype={constructor:$t,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 Cn(t){return function(){return t}}function An(t,e,n,r,i,o){for(var s=0,a,c=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new $t(t,o[s]);for(;s<c;++s)(a=e[s])&&(i[s]=a)}function kn(t,e,n,r,i,o,s){var a,c,l=new Map,u=e.length,p=o.length,d=new Array(u),g;for(a=0;a<u;++a)(c=e[a])&&(d[a]=g=s.call(c,c.__data__,a,e)+"",l.has(g)?i[a]=c:l.set(g,c));for(a=0;a<p;++a)g=s.call(t,o[a],a,o)+"",(c=l.get(g))?(r[a]=c,c.__data__=o[a],l.delete(g)):n[a]=new $t(t,o[a]);for(a=0;a<u;++a)(c=e[a])&&l.get(d[a])===c&&(i[a]=c)}function Bn(t){return t.__data__}function Rn(t,e){if(!arguments.length)return Array.from(this,Bn);var n=e?kn:An,r=this._parents,i=this._groups;typeof t!="function"&&(t=Cn(t));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],p=i[l],d=p.length,g=Mn(t.call(u,u&&u.__data__,l,r)),m=g.length,E=a[l]=new Array(m),N=s[l]=new Array(m),Mt=c[l]=new Array(d);n(u,p,E,N,Mt,g,e);for(var I=0,D=0,S,ft;I<m;++I)if(S=E[I]){for(I>=D&&(D=I+1);!(ft=N[D])&&++D<m;);S._next=ft||null}}return s=new A(s,r),s._enter=a,s._exit=c,s}function Mn(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Tn(){return new A(this._exit||this._groups.map(Ie),this._parents)}function In(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function On(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var l=n[c],u=r[c],p=l.length,d=a[c]=new Array(p),g,m=0;m<p;++m)(g=l[m]||u[m])&&(d[m]=g);for(;c<i;++c)a[c]=n[c];return new A(a,this._parents)}function Pn(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function Fn(t){t||(t=Xn);function e(p,d){return p&&d?t(p.__data__,d.__data__):!p-!d}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,c=i[o]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(e)}return new A(i,this._parents).order()}function Xn(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ln(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Yn(){return Array.from(this)}function Hn(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function Dn(){let t=0;for(const e of this)++t;return t}function qn(){return!this.node()}function Vn(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function zn(t){return function(){this.removeAttribute(t)}}function Un(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Zn(t,e){return function(){this.setAttribute(t,e)}}function Kn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Wn(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Gn(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 Jn(t,e){var n=kt(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?Un:zn:typeof e=="function"?n.local?Gn:Wn:n.local?Kn:Zn)(n,e))}function Oe(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Qn(t){return function(){this.style.removeProperty(t)}}function jn(t,e,n){return function(){this.style.setProperty(t,e,n)}}function tr(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function er(t,e,n){return arguments.length>1?this.each((e==null?Qn:typeof e=="function"?tr:jn)(t,e,n??"")):G(this.node(),t)}function G(t,e){return t.style.getPropertyValue(e)||Oe(t).getComputedStyle(t,null).getPropertyValue(e)}function nr(t){return function(){delete this[t]}}function rr(t,e){return function(){this[t]=e}}function ir(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function or(t,e){return arguments.length>1?this.each((e==null?nr:typeof e=="function"?ir:rr)(t,e)):this.node()[t]}function Pe(t){return t.trim().split(/^|\s+/)}function jt(t){return t.classList||new Fe(t)}function Fe(t){this._node=t,this._names=Pe(t.getAttribute("class")||"")}Fe.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 Xe(t,e){for(var n=jt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Le(t,e){for(var n=jt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function sr(t){return function(){Xe(this,t)}}function ar(t){return function(){Le(this,t)}}function cr(t,e){return function(){(e.apply(this,arguments)?Xe:Le)(this,t)}}function lr(t,e){var n=Pe(t+"");if(arguments.length<2){for(var r=jt(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?cr:e?sr:ar)(n,e))}function ur(){this.textContent=""}function fr(t){return function(){this.textContent=t}}function hr(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function pr(t){return arguments.length?this.each(t==null?ur:(typeof t=="function"?hr:fr)(t)):this.node().textContent}function dr(){this.innerHTML=""}function gr(t){return function(){this.innerHTML=t}}function mr(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function wr(t){return arguments.length?this.each(t==null?dr:(typeof t=="function"?mr:gr)(t)):this.node().innerHTML}function yr(){this.nextSibling&&this.parentNode.appendChild(this)}function _r(){return this.each(yr)}function xr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vr(){return this.each(xr)}function br(t){var e=typeof t=="function"?t:Be(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function $r(){return null}function Er(t,e){var n=typeof t=="function"?t:Be(t),r=e==null?$r:typeof e=="function"?e:Qt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Sr(){var t=this.parentNode;t&&t.removeChild(this)}function Nr(){return this.each(Sr)}function Cr(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ar(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function kr(t){return this.select(t?Ar:Cr)}function Br(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Rr(t){return function(e){t.call(this,e,this.__data__)}}function Mr(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 Tr(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function Ir(t,e,n){return function(){var r=this.__on,i,o=Rr(e);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Or(t,e,n){var r=Mr(t+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(i=0,u=a[c];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?Ir:Tr,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function Ye(t,e,n){var r=Oe(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 Pr(t,e){return function(){return Ye(this,t,e)}}function Fr(t,e){return function(){return Ye(this,t,e.apply(this,arguments))}}function Xr(t,e){return this.each((typeof e=="function"?Fr:Pr)(t,e))}function*Lr(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var He=[null];function A(t,e){this._groups=t,this._parents=e}function lt(){return new A([[document.documentElement]],He)}function Yr(){return this}A.prototype=lt.prototype={constructor:A,select:hn,selectAll:mn,selectChild:xn,selectChildren:En,filter:Sn,data:Rn,enter:Nn,exit:Tn,join:In,merge:On,selection:Yr,order:Pn,sort:Fn,call:Ln,nodes:Yn,node:Hn,size:Dn,empty:qn,each:Vn,attr:Jn,style:er,property:or,classed:lr,text:pr,html:wr,raise:_r,lower:vr,append:br,insert:Er,remove:Nr,clone:kr,datum:Br,on:Or,dispatch:Xr,[Symbol.iterator]:Lr};function Xt(t){return typeof t=="string"?new A([[document.querySelector(t)]],[document.documentElement]):new A([[t]],He)}function te(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function De(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ut(){}var ot=.7,Et=1/ot,W="\\s*([+-]?\\d+)\\s*",st="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",O="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Hr=/^#([0-9a-f]{3,8})$/,Dr=new RegExp(`^rgb\\(${W},${W},${W}\\)$`),qr=new RegExp(`^rgb\\(${O},${O},${O}\\)$`),Vr=new RegExp(`^rgba\\(${W},${W},${W},${st}\\)$`),zr=new RegExp(`^rgba\\(${O},${O},${O},${st}\\)$`),Ur=new RegExp(`^hsl\\(${st},${O},${O}\\)$`),Zr=new RegExp(`^hsla\\(${st},${O},${O},${st}\\)$`),ge={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};te(ut,at,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:me,formatHex:me,formatHex8:Kr,formatHsl:Wr,formatRgb:we,toString:we});function me(){return this.rgb().formatHex()}function Kr(){return this.rgb().formatHex8()}function Wr(){return qe(this).formatHsl()}function we(){return this.rgb().formatRgb()}function at(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Hr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?ye(e):n===3?new C(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?wt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?wt(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=Dr.exec(t))?new C(e[1],e[2],e[3],1):(e=qr.exec(t))?new C(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Vr.exec(t))?wt(e[1],e[2],e[3],e[4]):(e=zr.exec(t))?wt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Ur.exec(t))?ve(e[1],e[2]/100,e[3]/100,1):(e=Zr.exec(t))?ve(e[1],e[2]/100,e[3]/100,e[4]):ge.hasOwnProperty(t)?ye(ge[t]):t==="transparent"?new C(NaN,NaN,NaN,0):null}function ye(t){return new C(t>>16&255,t>>8&255,t&255,1)}function wt(t,e,n,r){return r<=0&&(t=e=n=NaN),new C(t,e,n,r)}function Gr(t){return t instanceof ut||(t=at(t)),t?(t=t.rgb(),new C(t.r,t.g,t.b,t.opacity)):new C}function qt(t,e,n,r){return arguments.length===1?Gr(t):new C(t,e,n,r??1)}function C(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}te(C,qt,De(ut,{brighter(t){return t=t==null?Et:Math.pow(Et,t),new C(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ot:Math.pow(ot,t),new C(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new C(z(this.r),z(this.g),z(this.b),St(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:_e,formatHex:_e,formatHex8:Jr,formatRgb:xe,toString:xe}));function _e(){return`#${V(this.r)}${V(this.g)}${V(this.b)}`}function Jr(){return`#${V(this.r)}${V(this.g)}${V(this.b)}${V((isNaN(this.opacity)?1:this.opacity)*255)}`}function xe(){const t=St(this.opacity);return`${t===1?"rgb(":"rgba("}${z(this.r)}, ${z(this.g)}, ${z(this.b)}${t===1?")":`, ${t})`}`}function St(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function z(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function V(t){return t=z(t),(t<16?"0":"")+t.toString(16)}function ve(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new M(t,e,n,r)}function qe(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);if(t instanceof ut||(t=at(t)),!t)return new M;if(t instanceof M)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(e===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-e)/a+2:s=(e-n)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new M(s,a,c,t.opacity)}function Qr(t,e,n,r){return arguments.length===1?qe(t):new M(t,e,n,r??1)}function M(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}te(M,Qr,De(ut,{brighter(t){return t=t==null?Et:Math.pow(Et,t),new M(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ot:Math.pow(ot,t),new M(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 C(Lt(t>=240?t-240:t+120,i,r),Lt(t,i,r),Lt(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new M(be(this.h),yt(this.s),yt(this.l),St(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=St(this.opacity);return`${t===1?"hsl(":"hsla("}${be(this.h)}, ${yt(this.s)*100}%, ${yt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function be(t){return t=(t||0)%360,t<0?t+360:t}function yt(t){return Math.max(0,Math.min(1,t||0))}function Lt(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 Ve=t=>()=>t;function jr(t,e){return function(n){return t+n*e}}function ti(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 ei(t){return(t=+t)==1?ze:function(e,n){return n-e?ti(e,n,t):Ve(isNaN(e)?n:e)}}function ze(t,e){var n=e-t;return n?jr(t,n):Ve(isNaN(t)?e:t)}const $e=(function t(e){var n=ei(e);function r(i,o){var s=n((i=qt(i)).r,(o=qt(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=ze(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=t,r})(1);function H(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Vt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yt=new RegExp(Vt.source,"g");function ni(t){return function(){return t}}function ri(t){return function(e){return t(e)+""}}function ii(t,e){var n=Vt.lastIndex=Yt.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=Vt.exec(t))&&(i=Yt.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:H(r,i)})),n=Yt.lastIndex;return n<e.length&&(o=e.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?ri(c[0].x):ni(e):(e=c.length,function(l){for(var u=0,p;u<e;++u)a[(p=c[u]).i]=p.x(l);return a.join("")})}var Ee=180/Math.PI,zt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ue(t,e,n,r,i,o){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*Ee,skewX:Math.atan(c)*Ee,scaleX:s,scaleY:a}}var _t;function oi(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?zt:Ue(e.a,e.b,e.c,e.d,e.e,e.f)}function si(t){return t==null||(_t||(_t=document.createElementNS("http://www.w3.org/2000/svg","g")),_t.setAttribute("transform",t),!(t=_t.transform.baseVal.consolidate()))?zt:(t=t.matrix,Ue(t.a,t.b,t.c,t.d,t.e,t.f))}function Ze(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,p,d,g,m){if(l!==p||u!==d){var E=g.push("translate(",null,e,null,n);m.push({i:E-4,x:H(l,p)},{i:E-2,x:H(u,d)})}else(p||d)&&g.push("translate("+p+e+d+n)}function s(l,u,p,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:p.push(i(p)+"rotate(",null,r)-2,x:H(l,u)})):u&&p.push(i(p)+"rotate("+u+r)}function a(l,u,p,d){l!==u?d.push({i:p.push(i(p)+"skewX(",null,r)-2,x:H(l,u)}):u&&p.push(i(p)+"skewX("+u+r)}function c(l,u,p,d,g,m){if(l!==p||u!==d){var E=g.push(i(g)+"scale(",null,",",null,")");m.push({i:E-4,x:H(l,p)},{i:E-2,x:H(u,d)})}else(p!==1||d!==1)&&g.push(i(g)+"scale("+p+","+d+")")}return function(l,u){var p=[],d=[];return l=t(l),u=t(u),o(l.translateX,l.translateY,u.translateX,u.translateY,p,d),s(l.rotate,u.rotate,p,d),a(l.skewX,u.skewX,p,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,p,d),l=u=null,function(g){for(var m=-1,E=d.length,N;++m<E;)p[(N=d[m]).i]=N.x(g);return p.join("")}}}var ai=Ze(oi,"px, ","px)","deg)"),ci=Ze(si,", ",")",")"),J=0,et=0,tt=0,Ke=1e3,Nt,nt,Ct=0,Z=0,Bt=0,ct=typeof performance=="object"&&performance.now?performance:Date,We=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ee(){return Z||(We(li),Z=ct.now()+Bt)}function li(){Z=0}function At(){this._call=this._time=this._next=null}At.prototype=Ge.prototype={constructor:At,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?ee():+n)+(e==null?0:+e),!this._next&&nt!==this&&(nt?nt._next=this:Nt=this,nt=this),this._call=t,this._time=n,Ut()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ut())}};function Ge(t,e,n){var r=new At;return r.restart(t,e,n),r}function ui(){ee(),++J;for(var t=Nt,e;t;)(e=Z-t._time)>=0&&t._call.call(void 0,e),t=t._next;--J}function Se(){Z=(Ct=ct.now())+Bt,J=et=0;try{ui()}finally{J=0,hi(),Z=0}}function fi(){var t=ct.now(),e=t-Ct;e>Ke&&(Bt-=e,Ct=t)}function hi(){for(var t,e=Nt,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:Nt=n);nt=t,Ut(r)}function Ut(t){if(!J){et&&(et=clearTimeout(et));var e=t-Z;e>24?(t<1/0&&(et=setTimeout(Se,t-ct.now()-Bt)),tt&&(tt=clearInterval(tt))):(tt||(Ct=ct.now(),tt=setInterval(fi,Ke)),J=1,We(Se))}}function Ne(t,e,n){var r=new At;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var pi=ke("start","end","cancel","interrupt"),di=[],Je=0,Ce=1,Zt=2,vt=3,Ae=4,Kt=5,bt=6;function Rt(t,e,n,r,i,o){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;gi(t,n,{name:e,index:r,group:i,on:pi,tween:di,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Je})}function ne(t,e){var n=T(t,e);if(n.state>Je)throw new Error("too late; already scheduled");return n}function P(t,e){var n=T(t,e);if(n.state>vt)throw new Error("too late; already running");return n}function T(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function gi(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Ge(o,0,n.time);function o(l){n.state=Ce,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,p,d,g;if(n.state!==Ce)return c();for(u in r)if(g=r[u],g.name===n.name){if(g.state===vt)return Ne(s);g.state===Ae?(g.state=bt,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete r[u]):+u<e&&(g.state=bt,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete r[u])}if(Ne(function(){n.state===vt&&(n.state=Ae,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Zt,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Zt){for(n.state=vt,i=new Array(d=n.tween.length),u=0,p=-1;u<d;++u)(g=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++p]=g);i.length=p+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Kt,1),p=-1,d=i.length;++p<d;)i[p].call(t,u);n.state===Kt&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=bt,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function mi(t,e){var n=t.__transition,r,i,o=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){o=!1;continue}i=r.state>Zt&&r.state<Kt,r.state=bt,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}o&&delete t.__transition}}function wi(t){return this.each(function(){mi(this,t)})}function yi(t,e){var n,r;return function(){var i=P(this,t),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function _i(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=P(this,t),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:e,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===e){i[c]=a;break}c===l&&i.push(a)}o.tween=i}}function xi(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=T(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===t)return s.value;return null}return this.each((e==null?yi:_i)(n,t,e))}function re(t,e,n){var r=t._id;return t.each(function(){var i=P(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return T(i,r).value[e]}}function Qe(t,e){var n;return(typeof e=="number"?H:e instanceof at?$e:(n=at(e))?(e=n,$e):ii)(t,e)}function vi(t){return function(){this.removeAttribute(t)}}function bi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function $i(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttribute(t);return s===i?null:s===r?o:o=e(r=s,n)}}function Ei(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===r?o:o=e(r=s,n)}}function Si(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function Ni(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function Ci(t,e){var n=kt(t),r=n==="transform"?ci:Qe;return this.attrTween(t,typeof e=="function"?(n.local?Ni:Si)(n,r,re(this,"attr."+t,e)):e==null?(n.local?bi:vi)(n):(n.local?Ei:$i)(n,r,e))}function Ai(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function ki(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Bi(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&ki(t,o)),n}return i._value=e,i}function Ri(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Ai(t,o)),n}return i._value=e,i}function Mi(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=kt(t);return this.tween(n,(r.local?Bi:Ri)(r,e))}function Ti(t,e){return function(){ne(this,t).delay=+e.apply(this,arguments)}}function Ii(t,e){return e=+e,function(){ne(this,t).delay=e}}function Oi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ti:Ii)(e,t)):T(this.node(),e).delay}function Pi(t,e){return function(){P(this,t).duration=+e.apply(this,arguments)}}function Fi(t,e){return e=+e,function(){P(this,t).duration=e}}function Xi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Pi:Fi)(e,t)):T(this.node(),e).duration}function Li(t,e){if(typeof e!="function")throw new Error;return function(){P(this,t).ease=e}}function Yi(t){var e=this._id;return arguments.length?this.each(Li(e,t)):T(this.node(),e).ease}function Hi(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;P(this,t).ease=n}}function Di(t){if(typeof t!="function")throw new Error;return this.each(Hi(this._id,t))}function qi(t){typeof t!="function"&&(t=Me(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new L(r,this._parents,this._name,this._id)}function Vi(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=e[a],l=n[a],u=c.length,p=s[a]=new Array(u),d,g=0;g<u;++g)(d=c[g]||l[g])&&(p[g]=d);for(;a<r;++a)s[a]=e[a];return new L(s,this._parents,this._name,this._id)}function zi(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 Ui(t,e,n){var r,i,o=zi(e)?ne:P;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}function Zi(t,e){var n=this._id;return arguments.length<2?T(this.node(),n).on.on(t):this.each(Ui(n,t,e))}function Ki(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Wi(){return this.on("end.remove",Ki(this._id))}function Gi(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Qt(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],c=a.length,l=o[s]=new Array(c),u,p,d=0;d<c;++d)(u=a[d])&&(p=t.call(u,u.__data__,d,a))&&("__data__"in u&&(p.__data__=u.__data__),l[d]=p,Rt(l[d],e,n,d,l,T(u,n)));return new L(o,this._parents,e,n)}function Ji(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Re(t));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],l=c.length,u,p=0;p<l;++p)if(u=c[p]){for(var d=t.call(u,u.__data__,p,c),g,m=T(u,n),E=0,N=d.length;E<N;++E)(g=d[E])&&Rt(g,e,n,E,d,m);o.push(d),s.push(u)}return new L(o,s,e,n)}var Qi=lt.prototype.constructor;function ji(){return new Qi(this._groups,this._parents)}function to(t,e){var n,r,i;return function(){var o=G(this,t),s=(this.style.removeProperty(t),G(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}function je(t){return function(){this.style.removeProperty(t)}}function eo(t,e,n){var r,i=n+"",o;return function(){var s=G(this,t);return s===i?null:s===r?o:o=e(r=s,n)}}function no(t,e,n){var r,i,o;return function(){var s=G(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),G(this,t))),s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a))}}function ro(t,e){var n,r,i,o="style."+e,s="end."+o,a;return function(){var c=P(this,t),l=c.on,u=c.value[o]==null?a||(a=je(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function io(t,e,n){var r=(t+="")=="transform"?ai:Qe;return e==null?this.styleTween(t,to(t,r)).on("end.style."+t,je(t)):typeof e=="function"?this.styleTween(t,no(t,r,re(this,"style."+t,e))).each(ro(this._id,t)):this.styleTween(t,eo(t,r,e),n).on("end.style."+t,null)}function oo(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function so(t,e,n){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&oo(t,s,n)),r}return o._value=e,o}function ao(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,so(t,e,n??""))}function co(t){return function(){this.textContent=t}}function lo(t){return function(){var e=t(this);this.textContent=e??""}}function uo(t){return this.tween("text",typeof t=="function"?lo(re(this,"text",t)):co(t==null?"":t+""))}function fo(t){return function(e){this.textContent=t.call(this,e)}}function ho(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&fo(i)),e}return r._value=t,r}function po(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,ho(t))}function go(){for(var t=this._name,e=this._id,n=tn(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=T(c,e);Rt(c,t,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new L(r,this._parents,t,n)}function mo(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var l=P(this,r),u=l.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),l.on=e}),i===0&&o()})}var wo=0;function L(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function tn(){return++wo}var X=lt.prototype;L.prototype={constructor:L,select:Gi,selectAll:Ji,selectChild:X.selectChild,selectChildren:X.selectChildren,filter:qi,merge:Vi,selection:ji,transition:go,call:X.call,nodes:X.nodes,node:X.node,size:X.size,empty:X.empty,each:X.each,on:Zi,attr:Ci,attrTween:Mi,style:io,styleTween:ao,text:uo,textTween:po,remove:Wi,tween:xi,delay:Oi,duration:Xi,ease:Yi,easeVarying:Di,end:mo,[Symbol.iterator]:X[Symbol.iterator]};function yo(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var _o={time:null,delay:0,duration:250,ease:yo};function xo(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 vo(t){var e,n;t instanceof L?(e=t._id,t=t._name):(e=tn(),(n=_o).time=ee(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&Rt(c,t,e,l,s,n||xo(c,e));return new L(r,this._parents,t,e)}lt.prototype.interrupt=wi;lt.prototype.transition=vo;function rt(t,e,n){this.k=t,this.x=e,this.y=n}rt.prototype={constructor:rt,scale:function(t){return t===1?this:new rt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new rt(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+")"}};rt.prototype;let B=[],it=[],Wt=[],U=new Map,Ht="",q=1,Gt={};async function bo(){const t=await window.gitopo.git.exec("rev-parse --show-toplevel");if(t.success){const e=t.output.trim();return e.split("/").pop()||e}return"Unknown Repository"}async function $o(){const t=await window.gitopo.config.get();return t.success?t.config:(console.error("Failed to fetch config:",t.error),{})}async function Eo(){const t=await window.gitopo.gh.exec("pr list --state open --json number,title,headRefName,headRefOid");if(!t.success)return console.error("Failed to fetch pull requests:",t.error),[];try{return JSON.parse(t.output).map(n=>({number:n.number,title:n.title,branch:n.headRefName,headCommit:n.headRefOid}))}catch(e){return console.error("Failed to parse PR data:",e),[]}}async function So(){const t=await window.gitopo.git.exec('log --all --format="%H|%P|%ct|%s" --date-order -1000');if(!t.success)return console.error("Failed to fetch commits:",t.error),[];const e=[],n=t.output.trim().split(`
2
+ `);for(const r of n){const i=r.split("|");if(i.length>=4){const o=i[0],s=i[1],a=parseInt(i[2],10),c=i.slice(3).join("|"),l=s.trim()?s.trim().split(" "):[];e.push({hash:o,parents:l,timestamp:a,message:c})}}return e.sort((r,i)=>i.timestamp-r.timestamp),e}async function No(){const t=await window.gitopo.git.exec('branch -a --format="%(refname:short) %(objectname)"');if(!t.success)return console.error("Failed to fetch branches:",t.error),[];const e=[],n=t.output.trim().split(`
3
+ `);for(const r of n){const i=r.trim().split(" ");if(i.length>=2){const o=i[0],s=i[1];e.push({name:o,hash:s})}}return e}function Co(t){const e=["branch1","branch2","branch3"],n=Gt.keyBranches||[],r=t.find(i=>i.name==="main"||i.name==="master");e.forEach((i,o)=>{const s=document.getElementById(i);s.innerHTML="";const a=document.createElement("option");if(a.value="",a.textContent="----",s.appendChild(a),t.forEach(c=>{const l=document.createElement("option");l.value=c.name,l.textContent=c.name,s.appendChild(l)}),n[o]){const c=t.find(l=>l.name===n[o]);c&&(s.value=c.name)}else o===0&&r&&(s.value=r.name);s.addEventListener("change",()=>Jt())})}function Ao(t){const e=it.find(i=>i.name===t);if(!e)return new Set;const n=new Set;let r=e.hash;for(;r;){n.add(r);const i=U.get(r);if(i&&i.parents.length>0)r=i.parents[0];else break}return n}function ko(t,e=new Set){const n=[],r=new Set,i=new Map;for(const c of B)for(const l of c.parents)i.has(l)||i.set(l,[]),i.get(l).push(c.hash);function o(c){const l=new Set,u=[c];for(;u.length>0;){const p=u.pop();if(l.has(p)||t.has(p)||e.has(p)||r.has(p))continue;const d=U.get(p);if(!d)continue;l.add(p);for(const m of d.parents)!t.has(m)&&!e.has(m)&&!l.has(m)&&u.push(m);const g=i.get(p)||[];for(const m of g)!t.has(m)&&!e.has(m)&&!l.has(m)&&u.push(m)}return l}function s(c){for(const l of c){const u=U.get(l);if(u){for(const p of u.parents)if(!t.has(p)&&!c.has(p))return!1}}return!0}function a(c){for(const l of t){const u=U.get(l);if(!(!u||u.parents.length<2)){for(let p=1;p<u.parents.length;p++)if(c.has(u.parents[p]))return l}}return null}for(const c of B){if(t.has(c.hash)||e.has(c.hash)||r.has(c.hash))continue;const l=o(c.hash);l.size>0&&s(l)&&(l.forEach(u=>r.add(u)),n.push({mergeCommit:a(l),commits:l}))}return n}function Bo(){const t=[];return["branch1","branch2","branch3"].forEach(e=>{const n=document.getElementById(e);n&&n.value&&t.push(n.value)}),t}function Jt(){const t=Xt("#graph");t.selectAll("*").remove();const e=Xt("#app");e.selectAll(".tooltip").remove();const n=document.getElementById("controls").offsetHeight,r=window.innerWidth,i=window.innerHeight-n;t.attr("width",r).attr("height",i);const o=6,s=30,a=150,c=30,l=50,u=50,d=Bo().map(f=>({name:f,lineage:Ao(f)})),g=new Set;d.forEach(({lineage:f})=>{f.forEach(h=>g.add(h))});const m=d.map(({name:f,lineage:h})=>{const w=new Set;d.forEach(_=>{_.name!==f&&_.lineage.forEach(y=>w.add(y))});const x=ko(h,w);return{name:f,lineage:h,subBranches:x}}),E=new Map;it.forEach(f=>{E.has(f.hash)||E.set(f.hash,[]),E.get(f.hash).push(f.name)});const N=new Map;B.forEach(f=>{N.set(f.hash,{mainCol:m.length,subOffset:0,isSubBranch:!1})}),m.forEach((f,h)=>{for(const w of f.lineage)N.set(w,{mainCol:h,subOffset:0,isSubBranch:!1})});let Mt=0;m.forEach((f,h)=>{const w=new Map;f.subBranches.forEach(x=>{const _=`sb-${Mt++}`,y=[];x.commits.forEach(b=>{const k=B.findIndex(F=>F.hash===b);k>=0&&y.push(k)});let $=1,v=!0;for(;v;){v=!1;for(const b of y)if((w.get(b)||new Set).has($)){v=!0,$++;break}}for(const b of y)w.has(b)||w.set(b,new Set),w.get(b).add($);x.commits.forEach(b=>{N.set(b,{mainCol:h,subOffset:$,isSubBranch:!0,subBranchId:_})})})});const I=new Map;let D=u;for(let f=0;f<=m.length;f++)if(I.set(f,D),f<m.length){let h=0;B.forEach(w=>{const x=N.get(w.hash);x.mainCol===f&&x.subOffset>h&&(h=x.subOffset)}),D+=a+h*c}const S=new Map;B.forEach((f,h)=>{const w=N.get(f.hash),_=I.get(w.mainCol)+w.subOffset*c;S.set(f.hash,{col:w.mainCol,subOffset:w.subOffset,row:h,x:_,y:l+h*s,isSubBranch:w.isSubBranch,subBranchId:w.subBranchId||null})});const ft=Array.from(N.values()).some(f=>f.mainCol===m.length),R=t.append("g").attr("class","main-group"),Tt=e.append("div").attr("class","tooltip").style("opacity",0),ht=["#4CAF50","#2196F3","#FF9800"];m.forEach((f,h)=>{R.append("text").attr("x",I.get(h)).attr("y",25).attr("fill",ht[h]||"#888").attr("font-size","14px").attr("font-weight","bold").text(f.name)}),ft&&R.append("text").attr("x",I.get(m.length)).attr("y",25).attr("fill","#888").attr("font-size","14px").text("Other");const pt=new Map;B.forEach(f=>{f.parents.forEach(h=>{pt.has(h)||pt.set(h,[]),pt.get(h).push(f.hash)})});const en=new Set;m.forEach(f=>{f.commits.forEach(h=>en.add(h))});function ie(f){const h=[],w=new Set;function x(y){if(w.has(y))return;w.add(y);const $=U.get(y);$&&$.parents.forEach(v=>{h.push({source:y,target:v});const b=S.get(v);b&&b.col===m.length&&!b.isSubBranch&&x(v)})}function _(y){if(w.has(y))return;w.add(y),(pt.get(y)||[]).forEach(v=>{h.push({source:v,target:y});const b=S.get(v);b&&b.col===m.length&&!b.isSubBranch&&_(v)})}return x(f),w.delete(f),_(f),h}B.forEach(f=>{const h=S.get(f.hash);h&&f.parents.forEach(w=>{const x=S.get(w);if(x){const _=h.col===m.length||x.col===m.length,y=h.x,$=h.y*q,v=x.x,b=x.y*q;let k;if(y===v)k=`M ${y} ${$} L ${v} ${b}`;else{const mt=($+b)/2;k=`M ${y} ${$} C ${y} ${mt}, ${v} ${mt}, ${v} ${b}`}const F=h.subBranchId||x.subBranchId||null,Pt=h.isSubBranch||x.isSubBranch,rn=!Pt&&!_&&h.col<m.length;let Ft="#666";_?Ft="#444":h.col<m.length&&(Ft=ht[h.col]||"#666");let j=1.5;_?j=1:rn?j=3:Pt&&(j=1.5);const on=R.append("path").attr("d",k).attr("fill","none").attr("stroke",Ft).attr("stroke-width",j).attr("stroke-opacity",_?.4:Pt?.5:.8).attr("stroke-dasharray",_?"4,4":"none").attr("class",F?`edge edge-${F}`:"edge").attr("data-source",f.hash).attr("data-target",w);if(F){const mt=j;on.style("cursor","pointer").on("mouseenter",()=>{R.selectAll(`.edge-${F}`).attr("stroke-width",3).attr("stroke-opacity",.9)}).on("mouseleave",()=>{R.selectAll(`.edge-${F}`).attr("stroke-width",mt).attr("stroke-opacity",.5)})}}})});const Q=new Map;Wt.forEach(f=>{Q.set(f.headCommit,f)});const It=R.selectAll("g.node").data(B).enter().append("g").attr("class","node").attr("transform",f=>{const h=S.get(f.hash);return h?`translate(${h.x}, ${h.y*q})`:"translate(-100, -100)"});It.filter(f=>Q.has(f.hash)).append("circle").attr("r",o+6).attr("fill","none").attr("stroke","#888").attr("stroke-width",2).attr("stroke-dasharray","3,2"),It.append("circle").attr("r",f=>{const h=S.get(f.hash);return h.isSubBranch?o*.6:h.col<m.length?o:o*.7}).attr("fill",f=>{const h=S.get(f.hash);return h.col<m.length?ht[h.col]||"#fff":h.isSubBranch?"#a0a0a0":"#888"}).attr("stroke",f=>{const h=S.get(f.hash);return h.col<m.length&&ht[h.col]||"#333"}).attr("stroke-width",f=>{const h=S.get(f.hash);return h.isSubBranch?1:h.col<m.length?2:1}).style("cursor","pointer").on("mouseenter",(f,h)=>{const w=E.get(h.hash),x=w?`[${w.join(", ")}]<br/>`:"",_=Q.get(h.hash),y=_?`<span class="pr-info">PR #${_.number}: ${_.title}</span><br/>`:"",$=new Date(h.timestamp*1e3).toLocaleString();Tt.html(`<strong>${h.hash.substring(0,7)}</strong><br/>${y}${x}${h.message}<br/><span class="date">${$}</span>`).style("left",f.pageX+15+"px").style("top",f.pageY-10+"px").style("opacity",1);const v=S.get(h.hash);v&&v.col===m.length&&!v.isSubBranch&&ie(h.hash).forEach(({source:k,target:F})=>{R.selectAll(`path.edge[data-source="${k}"][data-target="${F}"]`).attr("stroke-width",3).attr("stroke-opacity",.9)})}).on("mousemove",f=>{Tt.style("left",f.pageX+15+"px").style("top",f.pageY-10+"px")}).on("mouseleave",(f,h)=>{Tt.style("opacity",0);const w=S.get(h.hash);w&&w.col===m.length&&!w.isSubBranch&&ie(h.hash).forEach(({source:_,target:y})=>{R.selectAll(`path.edge[data-source="${_}"][data-target="${y}"]`).attr("stroke-width",1).attr("stroke-opacity",.4)})}),It.filter(f=>Q.has(f.hash)).append("text").attr("x",o+10).attr("y",4).attr("fill","#ccc").attr("font-size","11px").text(f=>{const h=Q.get(f.hash);return`PR #${h.number}: ${h.title.substring(0,30)}${h.title.length>30?"...":""}`});let K=0,Y=0,dt=!1,oe=0,se=0,ae=0,ce=0;function Ot(f){return f*q}function gt(){R.attr("transform",`translate(${K}, ${Y})`)}function nn(){R.selectAll("g.node").attr("transform",f=>{const h=S.get(f.hash);return h?`translate(${h.x}, ${Ot(h.y)})`:"translate(-100, -100)"}),R.selectAll("path.edge").attr("d",function(){const f=Xt(this),h=f.attr("data-source"),w=f.attr("data-target"),x=S.get(h),_=S.get(w);if(!x||!_)return"";const y=x.x,$=Ot(x.y),v=_.x,b=Ot(_.y);if(y===v)return`M ${y} ${$} L ${v} ${b}`;{const k=($+b)/2;return`M ${y} ${$} C ${y} ${k}, ${v} ${k}, ${v} ${b}`}})}t.on("wheel",f=>{if(f.preventDefault(),f.ctrlKey||f.metaKey){const h=f.deltaY>0?.9:1.1,_=Math.max(.1,Math.min(5,q*h)),y=t.node().getBoundingClientRect(),$=f.clientY-y.top,v=$-Y;Y=$-v*(_/q),q=_,nn(),gt()}else K-=f.deltaX,Y-=f.deltaY,gt()}),t.on("mousedown",f=>{f.button===0&&(dt=!0,oe=f.clientX,se=f.clientY,ae=K,ce=Y,f.preventDefault())}),t.on("mousemove",f=>{dt&&(K=ae+(f.clientX-oe),Y=ce+(f.clientY-se),gt())}),t.on("mouseup",f=>{f.button===0&&(dt=!1)}),t.on("mouseleave",()=>{dt=!1});let le=0,ue=0,fe=0,he=0;t.on("touchstart",f=>{if(f.touches.length===1){const h=f.touches[0];le=h.clientX,ue=h.clientY,fe=K,he=Y}}),t.on("touchmove",f=>{if(f.touches.length===1){f.preventDefault();const h=f.touches[0];K=fe+(h.clientX-le),Y=he+(h.clientY-ue),gt()}}),t.on("contextmenu",f=>{f.preventDefault()})}async function Ro(){[B,it,Ht,Wt,Gt]=await Promise.all([So(),No(),bo(),Eo(),$o()]),document.getElementById("repo-name").textContent=Ht,U.clear(),B.forEach(t=>U.set(t.hash,t)),console.log("Repository:",Ht),console.log("Commits:",B.length),console.log("Branches:",it.length),console.log("Open PRs:",Wt.length),console.log("Config:",Gt),Co(it),Jt(),window.addEventListener("resize",()=>{Jt()})}Ro();
@@ -0,0 +1,3 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var nn={value:()=>{}};function Ae(){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 _t(n)}function _t(t){this._=t}function rn(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}})}_t.prototype=Ae.prototype={constructor:_t,on:function(t,e){var n=this._,r=rn(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=on(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=fe(n[i],t.name,e);else if(e==null)for(i in n)n[i]=fe(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 _t(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function on(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function fe(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=nn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Yt="http://www.w3.org/1999/xhtml";const he={svg:"http://www.w3.org/2000/svg",xhtml:Yt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ct(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),he.hasOwnProperty(e)?{space:he[e],local:t}:t}function sn(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Yt&&e.documentElement.namespaceURI===Yt?e.createElement(t):e.createElementNS(n,t)}}function an(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ce(t){var e=Ct(t);return(e.local?an:sn)(e)}function cn(){}function Jt(t){return t==null?cn:function(){return this.querySelector(t)}}function ln(t){typeof t!="function"&&(t=Jt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=new Array(s),c,l,u=0;u<s;++u)(c=o[u])&&(l=t.call(c,c.__data__,u,o))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new A(r,this._parents)}function un(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function fn(){return[]}function ke(t){return t==null?fn:function(){return this.querySelectorAll(t)}}function hn(t){return function(){return un(t.apply(this,arguments))}}function pn(t){typeof t=="function"?t=hn(t):t=ke(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(r.push(t.call(c,c.__data__,l,s)),i.push(c));return new A(r,i)}function Re(t){return function(){return this.matches(t)}}function Me(t){return function(e){return e.matches(t)}}var dn=Array.prototype.find;function gn(t){return function(){return dn.call(this.children,t)}}function mn(){return this.firstElementChild}function yn(t){return this.select(t==null?mn:gn(typeof t=="function"?t:Me(t)))}var wn=Array.prototype.filter;function _n(){return Array.from(this.children)}function xn(t){return function(){return wn.call(this.children,t)}}function vn(t){return this.selectAll(t==null?_n:xn(typeof t=="function"?t:Me(t)))}function bn(t){typeof t!="function"&&(t=Re(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new A(r,this._parents)}function Be(t){return new Array(t.length)}function $n(){return new A(this._enter||this._groups.map(Be),this._parents)}function bt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}bt.prototype={constructor:bt,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 En(t){return function(){return t}}function Sn(t,e,n,r,i,o){for(var s=0,a,c=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new bt(t,o[s]);for(;s<c;++s)(a=e[s])&&(i[s]=a)}function Nn(t,e,n,r,i,o,s){var a,c,l=new Map,u=e.length,h=o.length,d=new Array(u),g;for(a=0;a<u;++a)(c=e[a])&&(d[a]=g=s.call(c,c.__data__,a,e)+"",l.has(g)?i[a]=c:l.set(g,c));for(a=0;a<h;++a)g=s.call(t,o[a],a,o)+"",(c=l.get(g))?(r[a]=c,c.__data__=o[a],l.delete(g)):n[a]=new bt(t,o[a]);for(a=0;a<u;++a)(c=e[a])&&l.get(d[a])===c&&(i[a]=c)}function An(t){return t.__data__}function Cn(t,e){if(!arguments.length)return Array.from(this,An);var n=e?Nn:Sn,r=this._parents,i=this._groups;typeof t!="function"&&(t=En(t));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],h=i[l],d=h.length,g=kn(t.call(u,u&&u.__data__,l,r)),m=g.length,x=a[l]=new Array(m),S=s[l]=new Array(m),Mt=c[l]=new Array(d);n(u,h,x,S,Mt,g,e);for(var B=0,Y=0,C,ft;B<m;++B)if(C=x[B]){for(B>=Y&&(Y=B+1);!(ft=S[Y])&&++Y<m;);C._next=ft||null}}return s=new A(s,r),s._enter=a,s._exit=c,s}function kn(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Rn(){return new A(this._exit||this._groups.map(Be),this._parents)}function Mn(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Bn(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var l=n[c],u=r[c],h=l.length,d=a[c]=new Array(h),g,m=0;m<h;++m)(g=l[m]||u[m])&&(d[m]=g);for(;c<i;++c)a[c]=n[c];return new A(a,this._parents)}function Tn(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function In(t){t||(t=On);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),o=0;o<r;++o){for(var s=n[o],a=s.length,c=i[o]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(e)}return new A(i,this._parents).order()}function On(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Pn(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Fn(){return Array.from(this)}function Xn(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function Hn(){let t=0;for(const e of this)++t;return t}function Ln(){return!this.node()}function Yn(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function Dn(t){return function(){this.removeAttribute(t)}}function qn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Vn(t,e){return function(){this.setAttribute(t,e)}}function zn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Un(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Zn(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 Kn(t,e){var n=Ct(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?qn:Dn:typeof e=="function"?n.local?Zn:Un:n.local?zn:Vn)(n,e))}function Te(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Wn(t){return function(){this.style.removeProperty(t)}}function Gn(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Jn(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Qn(t,e,n){return arguments.length>1?this.each((e==null?Wn:typeof e=="function"?Jn:Gn)(t,e,n??"")):G(this.node(),t)}function G(t,e){return t.style.getPropertyValue(e)||Te(t).getComputedStyle(t,null).getPropertyValue(e)}function jn(t){return function(){delete this[t]}}function tr(t,e){return function(){this[t]=e}}function er(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function nr(t,e){return arguments.length>1?this.each((e==null?jn:typeof e=="function"?er:tr)(t,e)):this.node()[t]}function Ie(t){return t.trim().split(/^|\s+/)}function Qt(t){return t.classList||new Oe(t)}function Oe(t){this._node=t,this._names=Ie(t.getAttribute("class")||"")}Oe.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 Pe(t,e){for(var n=Qt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Fe(t,e){for(var n=Qt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function rr(t){return function(){Pe(this,t)}}function ir(t){return function(){Fe(this,t)}}function or(t,e){return function(){(e.apply(this,arguments)?Pe:Fe)(this,t)}}function sr(t,e){var n=Ie(t+"");if(arguments.length<2){for(var r=Qt(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?or:e?rr:ir)(n,e))}function ar(){this.textContent=""}function cr(t){return function(){this.textContent=t}}function lr(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function ur(t){return arguments.length?this.each(t==null?ar:(typeof t=="function"?lr:cr)(t)):this.node().textContent}function fr(){this.innerHTML=""}function hr(t){return function(){this.innerHTML=t}}function pr(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function dr(t){return arguments.length?this.each(t==null?fr:(typeof t=="function"?pr:hr)(t)):this.node().innerHTML}function gr(){this.nextSibling&&this.parentNode.appendChild(this)}function mr(){return this.each(gr)}function yr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function wr(){return this.each(yr)}function _r(t){var e=typeof t=="function"?t:Ce(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function xr(){return null}function vr(t,e){var n=typeof t=="function"?t:Ce(t),r=e==null?xr:typeof e=="function"?e:Jt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function br(){var t=this.parentNode;t&&t.removeChild(this)}function $r(){return this.each(br)}function Er(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Sr(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Nr(t){return this.select(t?Sr:Er)}function Ar(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Cr(t){return function(e){t.call(this,e,this.__data__)}}function kr(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 Rr(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function Mr(t,e,n){return function(){var r=this.__on,i,o=Cr(e);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Br(t,e,n){var r=kr(t+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(i=0,u=a[c];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?Mr:Rr,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function Xe(t,e,n){var r=Te(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 Tr(t,e){return function(){return Xe(this,t,e)}}function Ir(t,e){return function(){return Xe(this,t,e.apply(this,arguments))}}function Or(t,e){return this.each((typeof e=="function"?Ir:Tr)(t,e))}function*Pr(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var He=[null];function A(t,e){this._groups=t,this._parents=e}function lt(){return new A([[document.documentElement]],He)}function Fr(){return this}A.prototype=lt.prototype={constructor:A,select:ln,selectAll:pn,selectChild:yn,selectChildren:vn,filter:bn,data:Cn,enter:$n,exit:Rn,join:Mn,merge:Bn,selection:Fr,order:Tn,sort:In,call:Pn,nodes:Fn,node:Xn,size:Hn,empty:Ln,each:Yn,attr:Kn,style:Qn,property:nr,classed:sr,text:ur,html:dr,raise:mr,lower:wr,append:_r,insert:vr,remove:$r,clone:Nr,datum:Ar,on:Br,dispatch:Or,[Symbol.iterator]:Pr};function Ft(t){return typeof t=="string"?new A([[document.querySelector(t)]],[document.documentElement]):new A([[t]],He)}function jt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Le(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ut(){}var ot=.7,$t=1/ot,K="\\s*([+-]?\\d+)\\s*",st="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",I="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xr=/^#([0-9a-f]{3,8})$/,Hr=new RegExp(`^rgb\\(${K},${K},${K}\\)$`),Lr=new RegExp(`^rgb\\(${I},${I},${I}\\)$`),Yr=new RegExp(`^rgba\\(${K},${K},${K},${st}\\)$`),Dr=new RegExp(`^rgba\\(${I},${I},${I},${st}\\)$`),qr=new RegExp(`^hsl\\(${st},${I},${I}\\)$`),Vr=new RegExp(`^hsla\\(${st},${I},${I},${st}\\)$`),pe={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};jt(ut,at,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:de,formatHex:de,formatHex8:zr,formatHsl:Ur,formatRgb:ge,toString:ge});function de(){return this.rgb().formatHex()}function zr(){return this.rgb().formatHex8()}function Ur(){return Ye(this).formatHsl()}function ge(){return this.rgb().formatRgb()}function at(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Xr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?me(e):n===3?new N(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?mt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?mt(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=Hr.exec(t))?new N(e[1],e[2],e[3],1):(e=Lr.exec(t))?new N(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Yr.exec(t))?mt(e[1],e[2],e[3],e[4]):(e=Dr.exec(t))?mt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=qr.exec(t))?_e(e[1],e[2]/100,e[3]/100,1):(e=Vr.exec(t))?_e(e[1],e[2]/100,e[3]/100,e[4]):pe.hasOwnProperty(t)?me(pe[t]):t==="transparent"?new N(NaN,NaN,NaN,0):null}function me(t){return new N(t>>16&255,t>>8&255,t&255,1)}function mt(t,e,n,r){return r<=0&&(t=e=n=NaN),new N(t,e,n,r)}function Zr(t){return t instanceof ut||(t=at(t)),t?(t=t.rgb(),new N(t.r,t.g,t.b,t.opacity)):new N}function Dt(t,e,n,r){return arguments.length===1?Zr(t):new N(t,e,n,r??1)}function N(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}jt(N,Dt,Le(ut,{brighter(t){return t=t==null?$t:Math.pow($t,t),new N(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ot:Math.pow(ot,t),new N(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new N(z(this.r),z(this.g),z(this.b),Et(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:ye,formatHex:ye,formatHex8:Kr,formatRgb:we,toString:we}));function ye(){return`#${V(this.r)}${V(this.g)}${V(this.b)}`}function Kr(){return`#${V(this.r)}${V(this.g)}${V(this.b)}${V((isNaN(this.opacity)?1:this.opacity)*255)}`}function we(){const t=Et(this.opacity);return`${t===1?"rgb(":"rgba("}${z(this.r)}, ${z(this.g)}, ${z(this.b)}${t===1?")":`, ${t})`}`}function Et(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function z(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function V(t){return t=z(t),(t<16?"0":"")+t.toString(16)}function _e(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new R(t,e,n,r)}function Ye(t){if(t instanceof R)return new R(t.h,t.s,t.l,t.opacity);if(t instanceof ut||(t=at(t)),!t)return new R;if(t instanceof R)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(e===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-e)/a+2:s=(e-n)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new R(s,a,c,t.opacity)}function Wr(t,e,n,r){return arguments.length===1?Ye(t):new R(t,e,n,r??1)}function R(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}jt(R,Wr,Le(ut,{brighter(t){return t=t==null?$t:Math.pow($t,t),new R(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ot:Math.pow(ot,t),new R(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 N(Xt(t>=240?t-240:t+120,i,r),Xt(t,i,r),Xt(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new R(xe(this.h),yt(this.s),yt(this.l),Et(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=Et(this.opacity);return`${t===1?"hsl(":"hsla("}${xe(this.h)}, ${yt(this.s)*100}%, ${yt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function xe(t){return t=(t||0)%360,t<0?t+360:t}function yt(t){return Math.max(0,Math.min(1,t||0))}function Xt(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 De=t=>()=>t;function Gr(t,e){return function(n){return t+n*e}}function Jr(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 Qr(t){return(t=+t)==1?qe:function(e,n){return n-e?Jr(e,n,t):De(isNaN(e)?n:e)}}function qe(t,e){var n=e-t;return n?Gr(t,n):De(isNaN(t)?e:t)}const ve=(function t(e){var n=Qr(e);function r(i,o){var s=n((i=Dt(i)).r,(o=Dt(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=qe(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=t,r})(1);function L(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var qt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ht=new RegExp(qt.source,"g");function jr(t){return function(){return t}}function ti(t){return function(e){return t(e)+""}}function ei(t,e){var n=qt.lastIndex=Ht.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=qt.exec(t))&&(i=Ht.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:L(r,i)})),n=Ht.lastIndex;return n<e.length&&(o=e.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?ti(c[0].x):jr(e):(e=c.length,function(l){for(var u=0,h;u<e;++u)a[(h=c[u]).i]=h.x(l);return a.join("")})}var be=180/Math.PI,Vt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ve(t,e,n,r,i,o){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*be,skewX:Math.atan(c)*be,scaleX:s,scaleY:a}}var wt;function ni(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Vt:Ve(e.a,e.b,e.c,e.d,e.e,e.f)}function ri(t){return t==null||(wt||(wt=document.createElementNS("http://www.w3.org/2000/svg","g")),wt.setAttribute("transform",t),!(t=wt.transform.baseVal.consolidate()))?Vt:(t=t.matrix,Ve(t.a,t.b,t.c,t.d,t.e,t.f))}function ze(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,h,d,g,m){if(l!==h||u!==d){var x=g.push("translate(",null,e,null,n);m.push({i:x-4,x:L(l,h)},{i:x-2,x:L(u,d)})}else(h||d)&&g.push("translate("+h+e+d+n)}function s(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:L(l,u)})):u&&h.push(i(h)+"rotate("+u+r)}function a(l,u,h,d){l!==u?d.push({i:h.push(i(h)+"skewX(",null,r)-2,x:L(l,u)}):u&&h.push(i(h)+"skewX("+u+r)}function c(l,u,h,d,g,m){if(l!==h||u!==d){var x=g.push(i(g)+"scale(",null,",",null,")");m.push({i:x-4,x:L(l,h)},{i:x-2,x:L(u,d)})}else(h!==1||d!==1)&&g.push(i(g)+"scale("+h+","+d+")")}return function(l,u){var h=[],d=[];return l=t(l),u=t(u),o(l.translateX,l.translateY,u.translateX,u.translateY,h,d),s(l.rotate,u.rotate,h,d),a(l.skewX,u.skewX,h,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,h,d),l=u=null,function(g){for(var m=-1,x=d.length,S;++m<x;)h[(S=d[m]).i]=S.x(g);return h.join("")}}}var ii=ze(ni,"px, ","px)","deg)"),oi=ze(ri,", ",")",")"),J=0,et=0,tt=0,Ue=1e3,St,nt,Nt=0,U=0,kt=0,ct=typeof performance=="object"&&performance.now?performance:Date,Ze=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function te(){return U||(Ze(si),U=ct.now()+kt)}function si(){U=0}function At(){this._call=this._time=this._next=null}At.prototype=Ke.prototype={constructor:At,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?te():+n)+(e==null?0:+e),!this._next&&nt!==this&&(nt?nt._next=this:St=this,nt=this),this._call=t,this._time=n,zt()},stop:function(){this._call&&(this._call=null,this._time=1/0,zt())}};function Ke(t,e,n){var r=new At;return r.restart(t,e,n),r}function ai(){te(),++J;for(var t=St,e;t;)(e=U-t._time)>=0&&t._call.call(void 0,e),t=t._next;--J}function $e(){U=(Nt=ct.now())+kt,J=et=0;try{ai()}finally{J=0,li(),U=0}}function ci(){var t=ct.now(),e=t-Nt;e>Ue&&(kt-=e,Nt=t)}function li(){for(var t,e=St,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:St=n);nt=t,zt(r)}function zt(t){if(!J){et&&(et=clearTimeout(et));var e=t-U;e>24?(t<1/0&&(et=setTimeout($e,t-ct.now()-kt)),tt&&(tt=clearInterval(tt))):(tt||(Nt=ct.now(),tt=setInterval(ci,Ue)),J=1,Ze($e))}}function Ee(t,e,n){var r=new At;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var ui=Ae("start","end","cancel","interrupt"),fi=[],We=0,Se=1,Ut=2,xt=3,Ne=4,Zt=5,vt=6;function Rt(t,e,n,r,i,o){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;hi(t,n,{name:e,index:r,group:i,on:ui,tween:fi,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:We})}function ee(t,e){var n=M(t,e);if(n.state>We)throw new Error("too late; already scheduled");return n}function O(t,e){var n=M(t,e);if(n.state>xt)throw new Error("too late; already running");return n}function M(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function hi(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Ke(o,0,n.time);function o(l){n.state=Se,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,h,d,g;if(n.state!==Se)return c();for(u in r)if(g=r[u],g.name===n.name){if(g.state===xt)return Ee(s);g.state===Ne?(g.state=vt,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete r[u]):+u<e&&(g.state=vt,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete r[u])}if(Ee(function(){n.state===xt&&(n.state=Ne,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Ut,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Ut){for(n.state=xt,i=new Array(d=n.tween.length),u=0,h=-1;u<d;++u)(g=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=g);i.length=h+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Zt,1),h=-1,d=i.length;++h<d;)i[h].call(t,u);n.state===Zt&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=vt,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function pi(t,e){var n=t.__transition,r,i,o=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){o=!1;continue}i=r.state>Ut&&r.state<Zt,r.state=vt,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}o&&delete t.__transition}}function di(t){return this.each(function(){pi(this,t)})}function gi(t,e){var n,r;return function(){var i=O(this,t),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function mi(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=O(this,t),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:e,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===e){i[c]=a;break}c===l&&i.push(a)}o.tween=i}}function yi(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=M(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===t)return s.value;return null}return this.each((e==null?gi:mi)(n,t,e))}function ne(t,e,n){var r=t._id;return t.each(function(){var i=O(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return M(i,r).value[e]}}function Ge(t,e){var n;return(typeof e=="number"?L:e instanceof at?ve:(n=at(e))?(e=n,ve):ei)(t,e)}function wi(t){return function(){this.removeAttribute(t)}}function _i(t){return function(){this.removeAttributeNS(t.space,t.local)}}function xi(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttribute(t);return s===i?null:s===r?o:o=e(r=s,n)}}function vi(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===r?o:o=e(r=s,n)}}function bi(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function $i(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function Ei(t,e){var n=Ct(t),r=n==="transform"?oi:Ge;return this.attrTween(t,typeof e=="function"?(n.local?$i:bi)(n,r,ne(this,"attr."+t,e)):e==null?(n.local?_i:wi)(n):(n.local?vi:xi)(n,r,e))}function Si(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Ni(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Ai(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Ni(t,o)),n}return i._value=e,i}function Ci(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Si(t,o)),n}return i._value=e,i}function ki(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=Ct(t);return this.tween(n,(r.local?Ai:Ci)(r,e))}function Ri(t,e){return function(){ee(this,t).delay=+e.apply(this,arguments)}}function Mi(t,e){return e=+e,function(){ee(this,t).delay=e}}function Bi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ri:Mi)(e,t)):M(this.node(),e).delay}function Ti(t,e){return function(){O(this,t).duration=+e.apply(this,arguments)}}function Ii(t,e){return e=+e,function(){O(this,t).duration=e}}function Oi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ti:Ii)(e,t)):M(this.node(),e).duration}function Pi(t,e){if(typeof e!="function")throw new Error;return function(){O(this,t).ease=e}}function Fi(t){var e=this._id;return arguments.length?this.each(Pi(e,t)):M(this.node(),e).ease}function Xi(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;O(this,t).ease=n}}function Hi(t){if(typeof t!="function")throw new Error;return this.each(Xi(this._id,t))}function Li(t){typeof t!="function"&&(t=Re(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new X(r,this._parents,this._name,this._id)}function Yi(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=e[a],l=n[a],u=c.length,h=s[a]=new Array(u),d,g=0;g<u;++g)(d=c[g]||l[g])&&(h[g]=d);for(;a<r;++a)s[a]=e[a];return new X(s,this._parents,this._name,this._id)}function Di(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 qi(t,e,n){var r,i,o=Di(e)?ee:O;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}function Vi(t,e){var n=this._id;return arguments.length<2?M(this.node(),n).on.on(t):this.each(qi(n,t,e))}function zi(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Ui(){return this.on("end.remove",zi(this._id))}function Zi(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Jt(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],c=a.length,l=o[s]=new Array(c),u,h,d=0;d<c;++d)(u=a[d])&&(h=t.call(u,u.__data__,d,a))&&("__data__"in u&&(h.__data__=u.__data__),l[d]=h,Rt(l[d],e,n,d,l,M(u,n)));return new X(o,this._parents,e,n)}function Ki(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ke(t));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],l=c.length,u,h=0;h<l;++h)if(u=c[h]){for(var d=t.call(u,u.__data__,h,c),g,m=M(u,n),x=0,S=d.length;x<S;++x)(g=d[x])&&Rt(g,e,n,x,d,m);o.push(d),s.push(u)}return new X(o,s,e,n)}var Wi=lt.prototype.constructor;function Gi(){return new Wi(this._groups,this._parents)}function Ji(t,e){var n,r,i;return function(){var o=G(this,t),s=(this.style.removeProperty(t),G(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}function Je(t){return function(){this.style.removeProperty(t)}}function Qi(t,e,n){var r,i=n+"",o;return function(){var s=G(this,t);return s===i?null:s===r?o:o=e(r=s,n)}}function ji(t,e,n){var r,i,o;return function(){var s=G(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),G(this,t))),s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a))}}function to(t,e){var n,r,i,o="style."+e,s="end."+o,a;return function(){var c=O(this,t),l=c.on,u=c.value[o]==null?a||(a=Je(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function eo(t,e,n){var r=(t+="")=="transform"?ii:Ge;return e==null?this.styleTween(t,Ji(t,r)).on("end.style."+t,Je(t)):typeof e=="function"?this.styleTween(t,ji(t,r,ne(this,"style."+t,e))).each(to(this._id,t)):this.styleTween(t,Qi(t,r,e),n).on("end.style."+t,null)}function no(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function ro(t,e,n){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&no(t,s,n)),r}return o._value=e,o}function io(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,ro(t,e,n??""))}function oo(t){return function(){this.textContent=t}}function so(t){return function(){var e=t(this);this.textContent=e??""}}function ao(t){return this.tween("text",typeof t=="function"?so(ne(this,"text",t)):oo(t==null?"":t+""))}function co(t){return function(e){this.textContent=t.call(this,e)}}function lo(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&co(i)),e}return r._value=t,r}function uo(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,lo(t))}function fo(){for(var t=this._name,e=this._id,n=Qe(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=M(c,e);Rt(c,t,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new X(r,this._parents,t,n)}function ho(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var l=O(this,r),u=l.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),l.on=e}),i===0&&o()})}var po=0;function X(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Qe(){return++po}var F=lt.prototype;X.prototype={constructor:X,select:Zi,selectAll:Ki,selectChild:F.selectChild,selectChildren:F.selectChildren,filter:Li,merge:Yi,selection:Gi,transition:fo,call:F.call,nodes:F.nodes,node:F.node,size:F.size,empty:F.empty,each:F.each,on:Vi,attr:Ei,attrTween:ki,style:eo,styleTween:io,text:ao,textTween:uo,remove:Ui,tween:yi,delay:Bi,duration:Oi,ease:Fi,easeVarying:Hi,end:ho,[Symbol.iterator]:F[Symbol.iterator]};function go(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var mo={time:null,delay:0,duration:250,ease:go};function yo(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 wo(t){var e,n;t instanceof X?(e=t._id,t=t._name):(e=Qe(),(n=mo).time=te(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&Rt(c,t,e,l,s,n||yo(c,e));return new X(r,this._parents,t,e)}lt.prototype.interrupt=di;lt.prototype.transition=wo;function rt(t,e,n){this.k=t,this.x=e,this.y=n}rt.prototype={constructor:rt,scale:function(t){return t===1?this:new rt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new rt(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+")"}};rt.prototype;let k=[],it=[],Kt=[],W=new Map,Lt="",q=1,Wt={};async function _o(){const t=await window.gitopo.git.exec("rev-parse --show-toplevel");if(t.success){const e=t.output.trim();return e.split("/").pop()||e}return"Unknown Repository"}async function xo(){const t=await window.gitopo.config.get();return t.success?t.config:(console.error("Failed to fetch config:",t.error),{})}async function vo(){const t=await window.gitopo.gh.exec("pr list --state open --json number,title,headRefName,headRefOid");if(!t.success)return console.error("Failed to fetch pull requests:",t.error),[];try{return JSON.parse(t.output).map(n=>({number:n.number,title:n.title,branch:n.headRefName,headCommit:n.headRefOid}))}catch(e){return console.error("Failed to parse PR data:",e),[]}}async function bo(){const t=await window.gitopo.git.exec('log --all --format="%H|%P|%ct|%s" --date-order -1000');if(!t.success)return console.error("Failed to fetch commits:",t.error),[];const e=[],n=t.output.trim().split(`
2
+ `);for(const r of n){const i=r.split("|");if(i.length>=4){const o=i[0],s=i[1],a=parseInt(i[2],10),c=i.slice(3).join("|"),l=s.trim()?s.trim().split(" "):[];e.push({hash:o,parents:l,timestamp:a,message:c})}}return e.sort((r,i)=>i.timestamp-r.timestamp),e}async function $o(){const t=await window.gitopo.git.exec('branch -a --format="%(refname:short) %(objectname)"');if(!t.success)return console.error("Failed to fetch branches:",t.error),[];const e=[],n=t.output.trim().split(`
3
+ `);for(const r of n){const i=r.trim().split(" ");if(i.length>=2){const o=i[0],s=i[1];e.push({name:o,hash:s})}}return e}function Eo(t){const e=["branch1","branch2","branch3"],n=Wt.keyBranches||[],r=t.find(i=>i.name==="main"||i.name==="master");e.forEach((i,o)=>{const s=document.getElementById(i);s.innerHTML="";const a=document.createElement("option");if(a.value="",a.textContent="----",s.appendChild(a),t.forEach(c=>{const l=document.createElement("option");l.value=c.name,l.textContent=c.name,s.appendChild(l)}),n[o]){const c=t.find(l=>l.name===n[o]);c&&(s.value=c.name)}else o===0&&r&&(s.value=r.name);s.addEventListener("change",()=>Gt())})}function So(t){const e=it.find(i=>i.name===t);if(!e)return new Set;const n=new Set;let r=e.hash;for(;r;){n.add(r);const i=W.get(r);if(i&&i.parents.length>0)r=i.parents[0];else break}return n}function No(t,e=new Set){const n=[],r=new Set,i=new Map;for(const c of k)for(const l of c.parents)i.has(l)||i.set(l,[]),i.get(l).push(c.hash);function o(c){const l=new Set,u=[c];for(;u.length>0;){const h=u.pop();if(l.has(h)||t.has(h)||e.has(h)||r.has(h))continue;const d=W.get(h);if(!d)continue;l.add(h);for(const m of d.parents)!t.has(m)&&!e.has(m)&&!l.has(m)&&u.push(m);const g=i.get(h)||[];for(const m of g)!t.has(m)&&!e.has(m)&&!l.has(m)&&u.push(m)}return l}function s(c){for(const l of c){const u=W.get(l);if(u){for(const h of u.parents)if(!t.has(h)&&!c.has(h))return!1}}return!0}function a(c){for(const l of t){const u=W.get(l);if(!(!u||u.parents.length<2)){for(let h=1;h<u.parents.length;h++)if(c.has(u.parents[h]))return l}}return null}for(const c of k){if(t.has(c.hash)||e.has(c.hash)||r.has(c.hash))continue;const l=o(c.hash);l.size>0&&s(l)&&(l.forEach(u=>r.add(u)),n.push({mergeCommit:a(l),commits:l}))}return n}function Ao(){const t=[];return["branch1","branch2","branch3"].forEach(e=>{const n=document.getElementById(e);n&&n.value&&t.push(n.value)}),t}function Gt(){const t=Ft("#graph");t.selectAll("*").remove();const e=Ft("#app");e.selectAll(".tooltip").remove();const n=document.getElementById("controls").offsetHeight,r=window.innerWidth,i=window.innerHeight-n;t.attr("width",r).attr("height",i);const o=6,s=30,a=150,c=30,l=50,u=50,d=Ao().map(f=>({name:f,lineage:So(f)})),g=new Set;d.forEach(({lineage:f})=>{f.forEach(p=>g.add(p))});const m=d.map(({name:f,lineage:p})=>{const y=new Set;d.forEach(_=>{_.name!==f&&_.lineage.forEach(v=>y.add(v))});const w=No(p,y);return{name:f,lineage:p,subBranches:w}}),x=new Map;it.forEach(f=>{x.has(f.hash)||x.set(f.hash,[]),x.get(f.hash).push(f.name)});const S=new Map;k.forEach(f=>{S.set(f.hash,{mainCol:m.length,subOffset:0,isSubBranch:!1})}),m.forEach((f,p)=>{for(const y of f.lineage)S.set(y,{mainCol:p,subOffset:0,isSubBranch:!1})});let Mt=0;m.forEach((f,p)=>{const y=new Map;f.subBranches.forEach(w=>{const _=`sb-${Mt++}`,v=[];w.commits.forEach($=>{const T=k.findIndex(D=>D.hash===$);T>=0&&v.push(T)});let b=1,E=!0;for(;E;){E=!1;for(const $ of v)if((y.get($)||new Set).has(b)){E=!0,b++;break}}for(const $ of v)y.has($)||y.set($,new Set),y.get($).add(b);w.commits.forEach($=>{S.set($,{mainCol:p,subOffset:b,isSubBranch:!0,subBranchId:_})})})});const B=new Map;let Y=u;for(let f=0;f<=m.length;f++)if(B.set(f,Y),f<m.length){let p=0;k.forEach(y=>{const w=S.get(y.hash);w.mainCol===f&&w.subOffset>p&&(p=w.subOffset)}),Y+=a+p*c}const C=new Map;k.forEach((f,p)=>{const y=S.get(f.hash),_=B.get(y.mainCol)+y.subOffset*c;C.set(f.hash,{col:y.mainCol,subOffset:y.subOffset,row:p,x:_,y:l+p*s,isSubBranch:y.isSubBranch,subBranchId:y.subBranchId||null})});const ft=Array.from(S.values()).some(f=>f.mainCol===m.length),P=t.append("g").attr("class","main-group"),Bt=e.append("div").attr("class","tooltip").style("opacity",0),ht=["#4CAF50","#2196F3","#FF9800"];m.forEach((f,p)=>{P.append("text").attr("x",B.get(p)).attr("y",25).attr("fill",ht[p]||"#888").attr("font-size","14px").attr("font-weight","bold").text(f.name)}),ft&&P.append("text").attr("x",B.get(m.length)).attr("y",25).attr("fill","#888").attr("font-size","14px").text("Other"),k.forEach(f=>{const p=C.get(f.hash);p&&f.parents.forEach(y=>{const w=C.get(y);if(w){const _=p.col===m.length||w.col===m.length,v=p.x,b=p.y*q,E=w.x,$=w.y*q;let T;if(v===E)T=`M ${v} ${b} L ${E} ${$}`;else{const gt=(b+$)/2;T=`M ${v} ${b} C ${v} ${gt}, ${E} ${gt}, ${E} ${$}`}const D=p.subBranchId||w.subBranchId||null,Ot=p.isSubBranch||w.isSubBranch,tn=!Ot&&!_&&p.col<m.length;let Pt="#666";_?Pt="#444":p.col<m.length&&(Pt=ht[p.col]||"#666");let j=1.5;_?j=1:tn?j=3:Ot&&(j=1.5);const en=P.append("path").attr("d",T).attr("fill","none").attr("stroke",Pt).attr("stroke-width",j).attr("stroke-opacity",_?.4:Ot?.5:.8).attr("stroke-dasharray",_?"4,4":"none").attr("class",D?`edge edge-${D}`:"edge").attr("data-source",f.hash).attr("data-target",y);if(D){const gt=j;en.style("cursor","pointer").on("mouseenter",()=>{P.selectAll(`.edge-${D}`).attr("stroke-width",3).attr("stroke-opacity",.9)}).on("mouseleave",()=>{P.selectAll(`.edge-${D}`).attr("stroke-width",gt).attr("stroke-opacity",.5)})}}})});const Q=new Map;Kt.forEach(f=>{Q.set(f.headCommit,f)});const Tt=P.selectAll("g.node").data(k).enter().append("g").attr("class","node").attr("transform",f=>{const p=C.get(f.hash);return p?`translate(${p.x}, ${p.y*q})`:"translate(-100, -100)"});Tt.filter(f=>Q.has(f.hash)).append("circle").attr("r",o+6).attr("fill","none").attr("stroke","#888").attr("stroke-width",2).attr("stroke-dasharray","3,2"),Tt.append("circle").attr("r",f=>{const p=C.get(f.hash);return p.isSubBranch?o*.6:p.col<m.length?o:o*.7}).attr("fill",f=>{const p=C.get(f.hash);return p.col<m.length?ht[p.col]||"#fff":p.isSubBranch?"#a0a0a0":"#888"}).attr("stroke",f=>{const p=C.get(f.hash);return p.col<m.length&&ht[p.col]||"#333"}).attr("stroke-width",f=>{const p=C.get(f.hash);return p.isSubBranch?1:p.col<m.length?2:1}).style("cursor","pointer").on("mouseenter",(f,p)=>{const y=x.get(p.hash),w=y?`[${y.join(", ")}]<br/>`:"",_=Q.get(p.hash),v=_?`<span class="pr-info">PR #${_.number}: ${_.title}</span><br/>`:"",b=new Date(p.timestamp*1e3).toLocaleString();Bt.html(`<strong>${p.hash.substring(0,7)}</strong><br/>${v}${w}${p.message}<br/><span class="date">${b}</span>`).style("left",f.pageX+15+"px").style("top",f.pageY-10+"px").style("opacity",1)}).on("mousemove",f=>{Bt.style("left",f.pageX+15+"px").style("top",f.pageY-10+"px")}).on("mouseleave",()=>{Bt.style("opacity",0)}),Tt.filter(f=>Q.has(f.hash)).append("text").attr("x",o+10).attr("y",4).attr("fill","#ccc").attr("font-size","11px").text(f=>{const p=Q.get(f.hash);return`PR #${p.number}: ${p.title.substring(0,30)}${p.title.length>30?"...":""}`});let Z=0,H=0,pt=!1,re=0,ie=0,oe=0,se=0;function It(f){return f*q}function dt(){P.attr("transform",`translate(${Z}, ${H})`)}function je(){P.selectAll("g.node").attr("transform",f=>{const p=hashToPosition.get(f.hash);return p?`translate(${p.x}, ${It(p.y)})`:"translate(-100, -100)"}),P.selectAll("path.edge").attr("d",function(){const f=Ft(this),p=f.attr("data-source"),y=f.attr("data-target"),w=hashToPosition.get(p),_=hashToPosition.get(y);if(!w||!_)return"";const v=w.x,b=It(w.y),E=_.x,$=It(_.y);if(v===E)return`M ${v} ${b} L ${E} ${$}`;{const T=(b+$)/2;return`M ${v} ${b} C ${v} ${T}, ${E} ${T}, ${E} ${$}`}})}t.on("wheel",f=>{if(f.preventDefault(),f.metaKey||f.ctrlKey){const p=f.deltaY>0?.9:1.1,_=Math.max(.1,Math.min(5,q*p)),v=t.node().getBoundingClientRect(),b=f.clientY-v.top,E=b-H;H=b-E*(_/q),q=_,je(),dt()}else Z-=f.deltaX,H-=f.deltaY,dt()}),t.on("mousedown",f=>{f.button===0&&(pt=!0,re=f.clientX,ie=f.clientY,oe=Z,se=H,f.preventDefault())}),t.on("mousemove",f=>{pt&&(Z=oe+(f.clientX-re),H=se+(f.clientY-ie),dt())}),t.on("mouseup",f=>{f.button===0&&(pt=!1)}),t.on("mouseleave",()=>{pt=!1});let ae=0,ce=0,le=0,ue=0;t.on("touchstart",f=>{if(f.touches.length===1){const p=f.touches[0];ae=p.clientX,ce=p.clientY,le=Z,ue=H}}),t.on("touchmove",f=>{if(f.touches.length===1){f.preventDefault();const p=f.touches[0];Z=le+(p.clientX-ae),H=ue+(p.clientY-ce),dt()}}),t.on("contextmenu",f=>{f.preventDefault()})}async function Co(){[k,it,Lt,Kt,Wt]=await Promise.all([bo(),$o(),_o(),vo(),xo()]),document.getElementById("repo-name").textContent=Lt,W.clear(),k.forEach(t=>W.set(t.hash,t)),console.log("Repository:",Lt),console.log("Commits:",k.length),console.log("Branches:",it.length),console.log("Open PRs:",Kt.length),console.log("Config:",Wt),Eo(it),Gt(),window.addEventListener("resize",()=>{Gt()})}Co();
@@ -0,0 +1 @@
1
+ *{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:#1a1a2e;color:#eee;overflow:hidden}#app{width:100vw;height:100vh;position:relative}#graph{width:100%;height:100%}.tooltip{position:absolute;background:#1e1e32f2;border:1px solid #4fc3f7;border-radius:6px;padding:10px 14px;font-size:13px;line-height:1.5;max-width:400px;pointer-events:none;z-index:1000;box-shadow:0 4px 12px #0006;transition:opacity .15s ease}.tooltip strong{color:#4fc3f7;font-family:SF Mono,Monaco,Courier New,monospace}.tooltip .date{color:#888;font-size:11px}
@@ -0,0 +1,3 @@
1
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function e(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=e(i);fetch(i.href,s)}})();var Yn={value:()=>{}};function gn(){for(var t=0,n=arguments.length,e={},r;t<n;++t){if(!(r=arguments[t]+"")||r in e||/[\s.]/.test(r))throw new Error("illegal type: "+r);e[r]=[]}return new ht(e)}function ht(t){this._=t}function qn(t,n){return t.trim().split(/^|\s+/).map(function(e){var r="",i=e.indexOf(".");if(i>=0&&(r=e.slice(i+1),e=e.slice(0,i)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}})}ht.prototype=gn.prototype={constructor:ht,on:function(t,n){var e=this._,r=qn(t+"",e),i,s=-1,o=r.length;if(arguments.length<2){for(;++s<o;)if((i=(t=r[s]).type)&&(i=Vn(e[i],t.name)))return i;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++s<o;)if(i=(t=r[s]).type)e[i]=Qt(e[i],t.name,n);else if(n==null)for(i in e)e[i]=Qt(e[i],t.name,null);return this},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new ht(t)},call:function(t,n){if((i=arguments.length-2)>0)for(var e=new Array(i),r=0,i,s;r<i;++r)e[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],r=0,i=s.length;r<i;++r)s[r].value.apply(n,e)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,s=r.length;i<s;++i)r[i].value.apply(n,e)}};function Vn(t,n){for(var e=0,r=t.length,i;e<r;++e)if((i=t[e]).name===n)return i.value}function Qt(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=Yn,t=t.slice(0,r).concat(t.slice(r+1));break}return e!=null&&t.push({name:n,value:e}),t}var Ct="http://www.w3.org/1999/xhtml";const Zt={svg:"http://www.w3.org/2000/svg",xhtml:Ct,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function vt(t){var n=t+="",e=n.indexOf(":");return e>=0&&(n=t.slice(0,e))!=="xmlns"&&(t=t.slice(e+1)),Zt.hasOwnProperty(n)?{space:Zt[n],local:t}:t}function zn(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===Ct&&n.documentElement.namespaceURI===Ct?n.createElement(t):n.createElementNS(e,t)}}function Un(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function mn(t){var n=vt(t);return(n.local?Un:zn)(n)}function Gn(){}function Xt(t){return t==null?Gn:function(){return this.querySelector(t)}}function Kn(t){typeof t!="function"&&(t=Xt(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var s=n[i],o=s.length,a=r[i]=new Array(o),c,u,f=0;f<o;++f)(c=s[f])&&(u=t.call(c,c.__data__,f,s))&&("__data__"in c&&(u.__data__=c.__data__),a[f]=u);return new $(r,this._parents)}function Wn(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Jn(){return[]}function _n(t){return t==null?Jn:function(){return this.querySelectorAll(t)}}function Qn(t){return function(){return Wn(t.apply(this,arguments))}}function Zn(t){typeof t=="function"?t=Qn(t):t=_n(t);for(var n=this._groups,e=n.length,r=[],i=[],s=0;s<e;++s)for(var o=n[s],a=o.length,c,u=0;u<a;++u)(c=o[u])&&(r.push(t.call(c,c.__data__,u,o)),i.push(c));return new $(r,i)}function wn(t){return function(){return this.matches(t)}}function yn(t){return function(n){return n.matches(t)}}var jn=Array.prototype.find;function te(t){return function(){return jn.call(this.children,t)}}function ne(){return this.firstElementChild}function ee(t){return this.select(t==null?ne:te(typeof t=="function"?t:yn(t)))}var re=Array.prototype.filter;function ie(){return Array.from(this.children)}function se(t){return function(){return re.call(this.children,t)}}function oe(t){return this.selectAll(t==null?ie:se(typeof t=="function"?t:yn(t)))}function ae(t){typeof t!="function"&&(t=wn(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var s=n[i],o=s.length,a=r[i]=[],c,u=0;u<o;++u)(c=s[u])&&t.call(c,c.__data__,u,s)&&a.push(c);return new $(r,this._parents)}function xn(t){return new Array(t.length)}function ce(){return new $(this._enter||this._groups.map(xn),this._parents)}function gt(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}gt.prototype={constructor:gt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function ue(t){return function(){return t}}function fe(t,n,e,r,i,s){for(var o=0,a,c=n.length,u=s.length;o<u;++o)(a=n[o])?(a.__data__=s[o],r[o]=a):e[o]=new gt(t,s[o]);for(;o<c;++o)(a=n[o])&&(i[o]=a)}function le(t,n,e,r,i,s,o){var a,c,u=new Map,f=n.length,p=s.length,h=new Array(f),d;for(a=0;a<f;++a)(c=n[a])&&(h[a]=d=o.call(c,c.__data__,a,n)+"",u.has(d)?i[a]=c:u.set(d,c));for(a=0;a<p;++a)d=o.call(t,s[a],a,s)+"",(c=u.get(d))?(r[a]=c,c.__data__=s[a],u.delete(d)):e[a]=new gt(t,s[a]);for(a=0;a<f;++a)(c=n[a])&&u.get(h[a])===c&&(i[a]=c)}function he(t){return t.__data__}function pe(t,n){if(!arguments.length)return Array.from(this,he);var e=n?le:fe,r=this._parents,i=this._groups;typeof t!="function"&&(t=ue(t));for(var s=i.length,o=new Array(s),a=new Array(s),c=new Array(s),u=0;u<s;++u){var f=r[u],p=i[u],h=p.length,d=de(t.call(f,f&&f.__data__,u,r)),m=d.length,w=a[u]=new Array(m),S=o[u]=new Array(m),at=c[u]=new Array(h);e(f,p,w,S,at,d,n);for(var v=0,Y=0,A,q;v<m;++v)if(A=w[v]){for(v>=Y&&(Y=v+1);!(q=S[Y])&&++Y<m;);A._next=q||null}}return o=new $(o,r),o._enter=a,o._exit=c,o}function de(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ge(){return new $(this._exit||this._groups.map(xn),this._parents)}function me(t,n,e){var r=this.enter(),i=this,s=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),n!=null&&(i=n(i),i&&(i=i.selection())),e==null?s.remove():e(s),r&&i?r.merge(i).order():i}function _e(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,s=r.length,o=Math.min(i,s),a=new Array(i),c=0;c<o;++c)for(var u=e[c],f=r[c],p=u.length,h=a[c]=new Array(p),d,m=0;m<p;++m)(d=u[m]||f[m])&&(h[m]=d);for(;c<i;++c)a[c]=e[c];return new $(a,this._parents)}function we(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r=t[n],i=r.length-1,s=r[i],o;--i>=0;)(o=r[i])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function ye(t){t||(t=xe);function n(p,h){return p&&h?t(p.__data__,h.__data__):!p-!h}for(var e=this._groups,r=e.length,i=new Array(r),s=0;s<r;++s){for(var o=e[s],a=o.length,c=i[s]=new Array(a),u,f=0;f<a;++f)(u=o[f])&&(c[f]=u);c.sort(n)}return new $(i,this._parents).order()}function xe(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function ve(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function be(){return Array.from(this)}function $e(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,s=r.length;i<s;++i){var o=r[i];if(o)return o}return null}function Se(){let t=0;for(const n of this)++t;return t}function Ne(){return!this.node()}function Ee(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i=n[e],s=0,o=i.length,a;s<o;++s)(a=i[s])&&t.call(a,a.__data__,s,i);return this}function Ae(t){return function(){this.removeAttribute(t)}}function Ce(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ke(t,n){return function(){this.setAttribute(t,n)}}function Be(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Me(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}}function Te(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Ie(t,n){var e=vt(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((n==null?e.local?Ce:Ae:typeof n=="function"?e.local?Te:Me:e.local?Be:ke)(e,n))}function vn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Re(t){return function(){this.style.removeProperty(t)}}function Oe(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Xe(t,n,e){return function(){var r=n.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function He(t,n,e){return arguments.length>1?this.each((n==null?Re:typeof n=="function"?Xe:Oe)(t,n,e??"")):K(this.node(),t)}function K(t,n){return t.style.getPropertyValue(n)||vn(t).getComputedStyle(t,null).getPropertyValue(n)}function Pe(t){return function(){delete this[t]}}function Fe(t,n){return function(){this[t]=n}}function Le(t,n){return function(){var e=n.apply(this,arguments);e==null?delete this[t]:this[t]=e}}function De(t,n){return arguments.length>1?this.each((n==null?Pe:typeof n=="function"?Le:Fe)(t,n)):this.node()[t]}function bn(t){return t.trim().split(/^|\s+/)}function Ht(t){return t.classList||new $n(t)}function $n(t){this._node=t,this._names=bn(t.getAttribute("class")||"")}$n.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Sn(t,n){for(var e=Ht(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function Nn(t,n){for(var e=Ht(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function Ye(t){return function(){Sn(this,t)}}function qe(t){return function(){Nn(this,t)}}function Ve(t,n){return function(){(n.apply(this,arguments)?Sn:Nn)(this,t)}}function ze(t,n){var e=bn(t+"");if(arguments.length<2){for(var r=Ht(this.node()),i=-1,s=e.length;++i<s;)if(!r.contains(e[i]))return!1;return!0}return this.each((typeof n=="function"?Ve:n?Ye:qe)(e,n))}function Ue(){this.textContent=""}function Ge(t){return function(){this.textContent=t}}function Ke(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function We(t){return arguments.length?this.each(t==null?Ue:(typeof t=="function"?Ke:Ge)(t)):this.node().textContent}function Je(){this.innerHTML=""}function Qe(t){return function(){this.innerHTML=t}}function Ze(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function je(t){return arguments.length?this.each(t==null?Je:(typeof t=="function"?Ze:Qe)(t)):this.node().innerHTML}function tr(){this.nextSibling&&this.parentNode.appendChild(this)}function nr(){return this.each(tr)}function er(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rr(){return this.each(er)}function ir(t){var n=typeof t=="function"?t:mn(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function sr(){return null}function or(t,n){var e=typeof t=="function"?t:mn(t),r=n==null?sr:typeof n=="function"?n:Xt(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function ar(){var t=this.parentNode;t&&t.removeChild(this)}function cr(){return this.each(ar)}function ur(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function fr(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function lr(t){return this.select(t?fr:ur)}function hr(t){return arguments.length?this.property("__data__",t):this.node().__data__}function pr(t){return function(n){t.call(this,n,this.__data__)}}function dr(t){return t.trim().split(/^|\s+/).map(function(n){var e="",r=n.indexOf(".");return r>=0&&(e=n.slice(r+1),n=n.slice(0,r)),{type:n,name:e}})}function gr(t){return function(){var n=this.__on;if(n){for(var e=0,r=-1,i=n.length,s;e<i;++e)s=n[e],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):n[++r]=s;++r?n.length=r:delete this.__on}}}function mr(t,n,e){return function(){var r=this.__on,i,s=pr(n);if(r){for(var o=0,a=r.length;o<a;++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=s,i.options=e),i.value=n;return}}this.addEventListener(t.type,s,e),i={type:t.type,name:t.name,value:n,listener:s,options:e},r?r.push(i):this.__on=[i]}}function _r(t,n,e){var r=dr(t+""),i,s=r.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,u=a.length,f;c<u;++c)for(i=0,f=a[c];i<s;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(a=n?mr:gr,i=0;i<s;++i)this.each(a(r[i],n,e));return this}function En(t,n,e){var r=vn(t),i=r.CustomEvent;typeof i=="function"?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function wr(t,n){return function(){return En(this,t,n)}}function yr(t,n){return function(){return En(this,t,n.apply(this,arguments))}}function xr(t,n){return this.each((typeof n=="function"?yr:wr)(t,n))}function*vr(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,s=r.length,o;i<s;++i)(o=r[i])&&(yield o)}var An=[null];function $(t,n){this._groups=t,this._parents=n}function st(){return new $([[document.documentElement]],An)}function br(){return this}$.prototype=st.prototype={constructor:$,select:Kn,selectAll:Zn,selectChild:ee,selectChildren:oe,filter:ae,data:pe,enter:ce,exit:ge,join:me,merge:_e,selection:br,order:we,sort:ye,call:ve,nodes:be,node:$e,size:Se,empty:Ne,each:Ee,attr:Ie,style:He,property:De,classed:ze,text:We,html:je,raise:nr,lower:rr,append:ir,insert:or,remove:cr,clone:lr,datum:hr,on:_r,dispatch:xr,[Symbol.iterator]:vr};function jt(t){return typeof t=="string"?new $([[document.querySelector(t)]],[document.documentElement]):new $([[t]],An)}function Pt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Cn(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function ot(){}var nt=.7,mt=1/nt,U="\\s*([+-]?\\d+)\\s*",et="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",B="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$r=/^#([0-9a-f]{3,8})$/,Sr=new RegExp(`^rgb\\(${U},${U},${U}\\)$`),Nr=new RegExp(`^rgb\\(${B},${B},${B}\\)$`),Er=new RegExp(`^rgba\\(${U},${U},${U},${et}\\)$`),Ar=new RegExp(`^rgba\\(${B},${B},${B},${et}\\)$`),Cr=new RegExp(`^hsl\\(${et},${B},${B}\\)$`),kr=new RegExp(`^hsla\\(${et},${B},${B},${et}\\)$`),tn={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};Pt(ot,rt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:nn,formatHex:nn,formatHex8:Br,formatHsl:Mr,formatRgb:en,toString:en});function nn(){return this.rgb().formatHex()}function Br(){return this.rgb().formatHex8()}function Mr(){return kn(this).formatHsl()}function en(){return this.rgb().formatRgb()}function rt(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=$r.exec(t))?(e=n[1].length,n=parseInt(n[1],16),e===6?rn(n):e===3?new x(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):e===8?ut(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):e===4?ut(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=Sr.exec(t))?new x(n[1],n[2],n[3],1):(n=Nr.exec(t))?new x(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=Er.exec(t))?ut(n[1],n[2],n[3],n[4]):(n=Ar.exec(t))?ut(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=Cr.exec(t))?an(n[1],n[2]/100,n[3]/100,1):(n=kr.exec(t))?an(n[1],n[2]/100,n[3]/100,n[4]):tn.hasOwnProperty(t)?rn(tn[t]):t==="transparent"?new x(NaN,NaN,NaN,0):null}function rn(t){return new x(t>>16&255,t>>8&255,t&255,1)}function ut(t,n,e,r){return r<=0&&(t=n=e=NaN),new x(t,n,e,r)}function Tr(t){return t instanceof ot||(t=rt(t)),t?(t=t.rgb(),new x(t.r,t.g,t.b,t.opacity)):new x}function kt(t,n,e,r){return arguments.length===1?Tr(t):new x(t,n,e,r??1)}function x(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}Pt(x,kt,Cn(ot,{brighter(t){return t=t==null?mt:Math.pow(mt,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?nt:Math.pow(nt,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new x(L(this.r),L(this.g),L(this.b),_t(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:sn,formatHex:sn,formatHex8:Ir,formatRgb:on,toString:on}));function sn(){return`#${F(this.r)}${F(this.g)}${F(this.b)}`}function Ir(){return`#${F(this.r)}${F(this.g)}${F(this.b)}${F((isNaN(this.opacity)?1:this.opacity)*255)}`}function on(){const t=_t(this.opacity);return`${t===1?"rgb(":"rgba("}${L(this.r)}, ${L(this.g)}, ${L(this.b)}${t===1?")":`, ${t})`}`}function _t(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function L(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function F(t){return t=L(t),(t<16?"0":"")+t.toString(16)}function an(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new N(t,n,e,r)}function kn(t){if(t instanceof N)return new N(t.h,t.s,t.l,t.opacity);if(t instanceof ot||(t=rt(t)),!t)return new N;if(t instanceof N)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),s=Math.max(n,e,r),o=NaN,a=s-i,c=(s+i)/2;return a?(n===s?o=(e-r)/a+(e<r)*6:e===s?o=(r-n)/a+2:o=(n-e)/a+4,a/=c<.5?s+i:2-s-i,o*=60):a=c>0&&c<1?0:o,new N(o,a,c,t.opacity)}function Rr(t,n,e,r){return arguments.length===1?kn(t):new N(t,n,e,r??1)}function N(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}Pt(N,Rr,Cn(ot,{brighter(t){return t=t==null?mt:Math.pow(mt,t),new N(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?nt:Math.pow(nt,t),new N(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new x(Et(t>=240?t-240:t+120,i,r),Et(t,i,r),Et(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new N(cn(this.h),ft(this.s),ft(this.l),_t(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=_t(this.opacity);return`${t===1?"hsl(":"hsla("}${cn(this.h)}, ${ft(this.s)*100}%, ${ft(this.l)*100}%${t===1?")":`, ${t})`}`}}));function cn(t){return t=(t||0)%360,t<0?t+360:t}function ft(t){return Math.max(0,Math.min(1,t||0))}function Et(t,n,e){return(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)*255}const Bn=t=>()=>t;function Or(t,n){return function(e){return t+e*n}}function Xr(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function Hr(t){return(t=+t)==1?Mn:function(n,e){return e-n?Xr(n,e,t):Bn(isNaN(n)?e:n)}}function Mn(t,n){var e=n-t;return e?Or(t,e):Bn(isNaN(t)?n:t)}const un=(function t(n){var e=Hr(n);function r(i,s){var o=e((i=kt(i)).r,(s=kt(s)).r),a=e(i.g,s.g),c=e(i.b,s.b),u=Mn(i.opacity,s.opacity);return function(f){return i.r=o(f),i.g=a(f),i.b=c(f),i.opacity=u(f),i+""}}return r.gamma=t,r})(1);function X(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var Bt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,At=new RegExp(Bt.source,"g");function Pr(t){return function(){return t}}function Fr(t){return function(n){return t(n)+""}}function Lr(t,n){var e=Bt.lastIndex=At.lastIndex=0,r,i,s,o=-1,a=[],c=[];for(t=t+"",n=n+"";(r=Bt.exec(t))&&(i=At.exec(n));)(s=i.index)>e&&(s=n.slice(e,s),a[o]?a[o]+=s:a[++o]=s),(r=r[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,c.push({i:o,x:X(r,i)})),e=At.lastIndex;return e<n.length&&(s=n.slice(e),a[o]?a[o]+=s:a[++o]=s),a.length<2?c[0]?Fr(c[0].x):Pr(n):(n=c.length,function(u){for(var f=0,p;f<n;++f)a[(p=c[f]).i]=p.x(u);return a.join("")})}var fn=180/Math.PI,Mt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tn(t,n,e,r,i,s){var o,a,c;return(o=Math.sqrt(t*t+n*n))&&(t/=o,n/=o),(c=t*e+n*r)&&(e-=t*c,r-=n*c),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,c/=a),t*r<n*e&&(t=-t,n=-n,c=-c,o=-o),{translateX:i,translateY:s,rotate:Math.atan2(n,t)*fn,skewX:Math.atan(c)*fn,scaleX:o,scaleY:a}}var lt;function Dr(t){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?Mt:Tn(n.a,n.b,n.c,n.d,n.e,n.f)}function Yr(t){return t==null||(lt||(lt=document.createElementNS("http://www.w3.org/2000/svg","g")),lt.setAttribute("transform",t),!(t=lt.transform.baseVal.consolidate()))?Mt:(t=t.matrix,Tn(t.a,t.b,t.c,t.d,t.e,t.f))}function In(t,n,e,r){function i(u){return u.length?u.pop()+" ":""}function s(u,f,p,h,d,m){if(u!==p||f!==h){var w=d.push("translate(",null,n,null,e);m.push({i:w-4,x:X(u,p)},{i:w-2,x:X(f,h)})}else(p||h)&&d.push("translate("+p+n+h+e)}function o(u,f,p,h){u!==f?(u-f>180?f+=360:f-u>180&&(u+=360),h.push({i:p.push(i(p)+"rotate(",null,r)-2,x:X(u,f)})):f&&p.push(i(p)+"rotate("+f+r)}function a(u,f,p,h){u!==f?h.push({i:p.push(i(p)+"skewX(",null,r)-2,x:X(u,f)}):f&&p.push(i(p)+"skewX("+f+r)}function c(u,f,p,h,d,m){if(u!==p||f!==h){var w=d.push(i(d)+"scale(",null,",",null,")");m.push({i:w-4,x:X(u,p)},{i:w-2,x:X(f,h)})}else(p!==1||h!==1)&&d.push(i(d)+"scale("+p+","+h+")")}return function(u,f){var p=[],h=[];return u=t(u),f=t(f),s(u.translateX,u.translateY,f.translateX,f.translateY,p,h),o(u.rotate,f.rotate,p,h),a(u.skewX,f.skewX,p,h),c(u.scaleX,u.scaleY,f.scaleX,f.scaleY,p,h),u=f=null,function(d){for(var m=-1,w=h.length,S;++m<w;)p[(S=h[m]).i]=S.x(d);return p.join("")}}}var qr=In(Dr,"px, ","px)","deg)"),Vr=In(Yr,", ",")",")"),W=0,Q=0,J=0,Rn=1e3,wt,Z,yt=0,D=0,bt=0,it=typeof performance=="object"&&performance.now?performance:Date,On=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ft(){return D||(On(zr),D=it.now()+bt)}function zr(){D=0}function xt(){this._call=this._time=this._next=null}xt.prototype=Xn.prototype={constructor:xt,restart:function(t,n,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?Ft():+e)+(n==null?0:+n),!this._next&&Z!==this&&(Z?Z._next=this:wt=this,Z=this),this._call=t,this._time=e,Tt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tt())}};function Xn(t,n,e){var r=new xt;return r.restart(t,n,e),r}function Ur(){Ft(),++W;for(var t=wt,n;t;)(n=D-t._time)>=0&&t._call.call(void 0,n),t=t._next;--W}function ln(){D=(yt=it.now())+bt,W=Q=0;try{Ur()}finally{W=0,Kr(),D=0}}function Gr(){var t=it.now(),n=t-yt;n>Rn&&(bt-=n,yt=t)}function Kr(){for(var t,n=wt,e,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:wt=e);Z=t,Tt(r)}function Tt(t){if(!W){Q&&(Q=clearTimeout(Q));var n=t-D;n>24?(t<1/0&&(Q=setTimeout(ln,t-it.now()-bt)),J&&(J=clearInterval(J))):(J||(yt=it.now(),J=setInterval(Gr,Rn)),W=1,On(ln))}}function hn(t,n,e){var r=new xt;return n=n==null?0:+n,r.restart(i=>{r.stop(),t(i+n)},n,e),r}var Wr=gn("start","end","cancel","interrupt"),Jr=[],Hn=0,pn=1,It=2,pt=3,dn=4,Rt=5,dt=6;function $t(t,n,e,r,i,s){var o=t.__transition;if(!o)t.__transition={};else if(e in o)return;Qr(t,e,{name:n,index:r,group:i,on:Wr,tween:Jr,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Hn})}function Lt(t,n){var e=E(t,n);if(e.state>Hn)throw new Error("too late; already scheduled");return e}function M(t,n){var e=E(t,n);if(e.state>pt)throw new Error("too late; already running");return e}function E(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Qr(t,n,e){var r=t.__transition,i;r[n]=e,e.timer=Xn(s,0,e.time);function s(u){e.state=pn,e.timer.restart(o,e.delay,e.time),e.delay<=u&&o(u-e.delay)}function o(u){var f,p,h,d;if(e.state!==pn)return c();for(f in r)if(d=r[f],d.name===e.name){if(d.state===pt)return hn(o);d.state===dn?(d.state=dt,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<n&&(d.state=dt,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(hn(function(){e.state===pt&&(e.state=dn,e.timer.restart(a,e.delay,e.time),a(u))}),e.state=It,e.on.call("start",t,t.__data__,e.index,e.group),e.state===It){for(e.state=pt,i=new Array(h=e.tween.length),f=0,p=-1;f<h;++f)(d=e.tween[f].value.call(t,t.__data__,e.index,e.group))&&(i[++p]=d);i.length=p+1}}function a(u){for(var f=u<e.duration?e.ease.call(null,u/e.duration):(e.timer.restart(c),e.state=Rt,1),p=-1,h=i.length;++p<h;)i[p].call(t,f);e.state===Rt&&(e.on.call("end",t,t.__data__,e.index,e.group),c())}function c(){e.state=dt,e.timer.stop(),delete r[n];for(var u in r)return;delete t.__transition}}function Zr(t,n){var e=t.__transition,r,i,s=!0,o;if(e){n=n==null?null:n+"";for(o in e){if((r=e[o]).name!==n){s=!1;continue}i=r.state>It&&r.state<Rt,r.state=dt,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete e[o]}s&&delete t.__transition}}function jr(t){return this.each(function(){Zr(this,t)})}function ti(t,n){var e,r;return function(){var i=M(this,t),s=i.tween;if(s!==e){r=e=s;for(var o=0,a=r.length;o<a;++o)if(r[o].name===n){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function ni(t,n,e){var r,i;if(typeof e!="function")throw new Error;return function(){var s=M(this,t),o=s.tween;if(o!==r){i=(r=o).slice();for(var a={name:n,value:e},c=0,u=i.length;c<u;++c)if(i[c].name===n){i[c]=a;break}c===u&&i.push(a)}s.tween=i}}function ei(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r=E(this.node(),e).tween,i=0,s=r.length,o;i<s;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((n==null?ti:ni)(e,t,n))}function Dt(t,n,e){var r=t._id;return t.each(function(){var i=M(this,r);(i.value||(i.value={}))[n]=e.apply(this,arguments)}),function(i){return E(i,r).value[n]}}function Pn(t,n){var e;return(typeof n=="number"?X:n instanceof rt?un:(e=rt(n))?(n=e,un):Lr)(t,n)}function ri(t){return function(){this.removeAttribute(t)}}function ii(t){return function(){this.removeAttributeNS(t.space,t.local)}}function si(t,n,e){var r,i=e+"",s;return function(){var o=this.getAttribute(t);return o===i?null:o===r?s:s=n(r=o,e)}}function oi(t,n,e){var r,i=e+"",s;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?s:s=n(r=o,e)}}function ai(t,n,e){var r,i,s;return function(){var o,a=e(this),c;return a==null?void this.removeAttribute(t):(o=this.getAttribute(t),c=a+"",o===c?null:o===r&&c===i?s:(i=c,s=n(r=o,a)))}}function ci(t,n,e){var r,i,s;return function(){var o,a=e(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),c=a+"",o===c?null:o===r&&c===i?s:(i=c,s=n(r=o,a)))}}function ui(t,n){var e=vt(t),r=e==="transform"?Vr:Pn;return this.attrTween(t,typeof n=="function"?(e.local?ci:ai)(e,r,Dt(this,"attr."+t,n)):n==null?(e.local?ii:ri)(e):(e.local?oi:si)(e,r,n))}function fi(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function li(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function hi(t,n){var e,r;function i(){var s=n.apply(this,arguments);return s!==r&&(e=(r=s)&&li(t,s)),e}return i._value=n,i}function pi(t,n){var e,r;function i(){var s=n.apply(this,arguments);return s!==r&&(e=(r=s)&&fi(t,s)),e}return i._value=n,i}function di(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;var r=vt(t);return this.tween(e,(r.local?hi:pi)(r,n))}function gi(t,n){return function(){Lt(this,t).delay=+n.apply(this,arguments)}}function mi(t,n){return n=+n,function(){Lt(this,t).delay=n}}function _i(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?gi:mi)(n,t)):E(this.node(),n).delay}function wi(t,n){return function(){M(this,t).duration=+n.apply(this,arguments)}}function yi(t,n){return n=+n,function(){M(this,t).duration=n}}function xi(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?wi:yi)(n,t)):E(this.node(),n).duration}function vi(t,n){if(typeof n!="function")throw new Error;return function(){M(this,t).ease=n}}function bi(t){var n=this._id;return arguments.length?this.each(vi(n,t)):E(this.node(),n).ease}function $i(t,n){return function(){var e=n.apply(this,arguments);if(typeof e!="function")throw new Error;M(this,t).ease=e}}function Si(t){if(typeof t!="function")throw new Error;return this.each($i(this._id,t))}function Ni(t){typeof t!="function"&&(t=wn(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var s=n[i],o=s.length,a=r[i]=[],c,u=0;u<o;++u)(c=s[u])&&t.call(c,c.__data__,u,s)&&a.push(c);return new O(r,this._parents,this._name,this._id)}function Ei(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,s=Math.min(r,i),o=new Array(r),a=0;a<s;++a)for(var c=n[a],u=e[a],f=c.length,p=o[a]=new Array(f),h,d=0;d<f;++d)(h=c[d]||u[d])&&(p[d]=h);for(;a<r;++a)o[a]=n[a];return new O(o,this._parents,this._name,this._id)}function Ai(t){return(t+"").trim().split(/^|\s+/).every(function(n){var e=n.indexOf(".");return e>=0&&(n=n.slice(0,e)),!n||n==="start"})}function Ci(t,n,e){var r,i,s=Ai(n)?Lt:M;return function(){var o=s(this,t),a=o.on;a!==r&&(i=(r=a).copy()).on(n,e),o.on=i}}function ki(t,n){var e=this._id;return arguments.length<2?E(this.node(),e).on.on(t):this.each(Ci(e,t,n))}function Bi(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function Mi(){return this.on("end.remove",Bi(this._id))}function Ti(t){var n=this._name,e=this._id;typeof t!="function"&&(t=Xt(t));for(var r=this._groups,i=r.length,s=new Array(i),o=0;o<i;++o)for(var a=r[o],c=a.length,u=s[o]=new Array(c),f,p,h=0;h<c;++h)(f=a[h])&&(p=t.call(f,f.__data__,h,a))&&("__data__"in f&&(p.__data__=f.__data__),u[h]=p,$t(u[h],n,e,h,u,E(f,e)));return new O(s,this._parents,n,e)}function Ii(t){var n=this._name,e=this._id;typeof t!="function"&&(t=_n(t));for(var r=this._groups,i=r.length,s=[],o=[],a=0;a<i;++a)for(var c=r[a],u=c.length,f,p=0;p<u;++p)if(f=c[p]){for(var h=t.call(f,f.__data__,p,c),d,m=E(f,e),w=0,S=h.length;w<S;++w)(d=h[w])&&$t(d,n,e,w,h,m);s.push(h),o.push(f)}return new O(s,o,n,e)}var Ri=st.prototype.constructor;function Oi(){return new Ri(this._groups,this._parents)}function Xi(t,n){var e,r,i;return function(){var s=K(this,t),o=(this.style.removeProperty(t),K(this,t));return s===o?null:s===e&&o===r?i:i=n(e=s,r=o)}}function Fn(t){return function(){this.style.removeProperty(t)}}function Hi(t,n,e){var r,i=e+"",s;return function(){var o=K(this,t);return o===i?null:o===r?s:s=n(r=o,e)}}function Pi(t,n,e){var r,i,s;return function(){var o=K(this,t),a=e(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),K(this,t))),o===c?null:o===r&&c===i?s:(i=c,s=n(r=o,a))}}function Fi(t,n){var e,r,i,s="style."+n,o="end."+s,a;return function(){var c=M(this,t),u=c.on,f=c.value[s]==null?a||(a=Fn(n)):void 0;(u!==e||i!==f)&&(r=(e=u).copy()).on(o,i=f),c.on=r}}function Li(t,n,e){var r=(t+="")=="transform"?qr:Pn;return n==null?this.styleTween(t,Xi(t,r)).on("end.style."+t,Fn(t)):typeof n=="function"?this.styleTween(t,Pi(t,r,Dt(this,"style."+t,n))).each(Fi(this._id,t)):this.styleTween(t,Hi(t,r,n),e).on("end.style."+t,null)}function Di(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function Yi(t,n,e){var r,i;function s(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&Di(t,o,e)),r}return s._value=n,s}function qi(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;return this.tween(r,Yi(t,n,e??""))}function Vi(t){return function(){this.textContent=t}}function zi(t){return function(){var n=t(this);this.textContent=n??""}}function Ui(t){return this.tween("text",typeof t=="function"?zi(Dt(this,"text",t)):Vi(t==null?"":t+""))}function Gi(t){return function(n){this.textContent=t.call(this,n)}}function Ki(t){var n,e;function r(){var i=t.apply(this,arguments);return i!==e&&(n=(e=i)&&Gi(i)),n}return r._value=t,r}function Wi(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,Ki(t))}function Ji(){for(var t=this._name,n=this._id,e=Ln(),r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,c,u=0;u<a;++u)if(c=o[u]){var f=E(c,n);$t(c,t,e,u,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new O(r,this._parents,t,e)}function Qi(){var t,n,e=this,r=e._id,i=e.size();return new Promise(function(s,o){var a={value:o},c={value:function(){--i===0&&s()}};e.each(function(){var u=M(this,r),f=u.on;f!==t&&(n=(t=f).copy(),n._.cancel.push(a),n._.interrupt.push(a),n._.end.push(c)),u.on=n}),i===0&&s()})}var Zi=0;function O(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Ln(){return++Zi}var R=st.prototype;O.prototype={constructor:O,select:Ti,selectAll:Ii,selectChild:R.selectChild,selectChildren:R.selectChildren,filter:Ni,merge:Ei,selection:Oi,transition:Ji,call:R.call,nodes:R.nodes,node:R.node,size:R.size,empty:R.empty,each:R.each,on:ki,attr:ui,attrTween:di,style:Li,styleTween:qi,text:Ui,textTween:Wi,remove:Mi,tween:ei,delay:_i,duration:xi,ease:bi,easeVarying:Si,end:Qi,[Symbol.iterator]:R[Symbol.iterator]};function ji(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var ts={time:null,delay:0,duration:250,ease:ji};function ns(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}function es(t){var n,e;t instanceof O?(n=t._id,t=t._name):(n=Ln(),(e=ts).time=Ft(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,c,u=0;u<a;++u)(c=o[u])&&$t(c,t,n,u,o,e||ns(c,n));return new O(r,this._parents,t,n)}st.prototype.interrupt=jr;st.prototype.transition=es;function j(t,n,e){this.k=t,this.x=n,this.y=e}j.prototype={constructor:j,scale:function(t){return t===1?this:new j(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new j(this.k,this.x+this.k*t,this.y+this.k*n)},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+")"}};j.prototype;let k=[],tt=[],G=new Map;async function rs(){const t=await window.gitopo.git.exec('log --all --format="%H|%P|%ct|%s" --date-order -1000');if(!t.success)return console.error("Failed to fetch commits:",t.error),[];const n=[],e=t.output.trim().split(`
2
+ `);for(const r of e){const i=r.split("|");if(i.length>=4){const s=i[0],o=i[1],a=parseInt(i[2],10),c=i.slice(3).join("|"),u=o.trim()?o.trim().split(" "):[];n.push({hash:s,parents:u,timestamp:a,message:c})}}return n.sort((r,i)=>i.timestamp-r.timestamp),n}async function is(){const t=await window.gitopo.git.exec('branch -a --format="%(refname:short) %(objectname)"');if(!t.success)return console.error("Failed to fetch branches:",t.error),[];const n=[],e=t.output.trim().split(`
3
+ `);for(const r of e){const i=r.trim().split(" ");if(i.length>=2){const s=i[0],o=i[1];n.push({name:s,hash:o})}}return n}function ss(t){const n=["branch1","branch2","branch3"],e=t.find(r=>r.name==="main"||r.name==="master");n.forEach((r,i)=>{const s=document.getElementById(r);s.innerHTML="";const o=document.createElement("option");o.value="",o.textContent="----",s.appendChild(o),t.forEach(a=>{const c=document.createElement("option");c.value=a.name,c.textContent=a.name,s.appendChild(c)}),i===0&&e&&(s.value=e.name),s.addEventListener("change",()=>Ot())})}function os(t){const n=tt.find(i=>i.name===t);if(!n)return new Set;const e=new Set;let r=n.hash;for(;r;){e.add(r);const i=G.get(r);if(i&&i.parents.length>0)r=i.parents[0];else break}return e}function as(t){const n=[],e=new Set;function r(s){const o=new Set,a=[s];for(;a.length>0;){const c=a.pop();if(o.has(c)||t.has(c)||e.has(c))continue;const u=G.get(c);if(u){o.add(c);for(const f of u.parents)!t.has(f)&&!o.has(f)&&a.push(f)}}return o}function i(s){for(const o of s){const a=G.get(o);if(a){for(const c of a.parents)if(!t.has(c)&&!s.has(c))return!1}}return!0}for(const s of t){const o=G.get(s);if(!(!o||o.parents.length<2))for(let a=1;a<o.parents.length;a++){const c=o.parents[a];if(e.has(c))continue;const u=r(c);u.size>0&&i(u)&&(u.forEach(f=>e.add(f)),n.push({mergeCommit:s,commits:u}))}}for(const s of k){if(t.has(s.hash)||e.has(s.hash)||!s.parents.some(c=>t.has(c)))continue;const a=r(s.hash);a.size>0&&i(a)&&(a.forEach(c=>e.add(c)),n.push({mergeCommit:null,commits:a}))}return n}function cs(){const t=[];return["branch1","branch2","branch3"].forEach(n=>{const e=document.getElementById(n);e&&e.value&&t.push(e.value)}),t}function Ot(){const t=jt("#graph");t.selectAll("*").remove();const n=jt("#app");n.selectAll(".tooltip").remove();const e=document.getElementById("controls").offsetHeight,r=window.innerWidth,i=window.innerHeight-e;t.attr("width",r).attr("height",i);const s=6,o=30,a=150,c=30,u=50,f=50,h=cs().map(l=>{const g=os(l),_=as(g);return{name:l,lineage:g,subBranches:_}}),d=new Map;tt.forEach(l=>{d.has(l.hash)||d.set(l.hash,[]),d.get(l.hash).push(l.name)});const m=new Map;k.forEach(l=>{m.set(l.hash,{mainCol:h.length,subOffset:0,isSubBranch:!1})}),h.forEach((l,g)=>{for(const _ of l.lineage)m.set(_,{mainCol:g,subOffset:0,isSubBranch:!1})});let w=0;h.forEach((l,g)=>{const _=new Map;l.subBranches.forEach(y=>{const C=`sb-${w++}`,H=[];y.commits.forEach(b=>{const I=k.findIndex(Nt=>Nt.hash===b);I>=0&&H.push(I)});let T=1,P=!0;for(;P;){P=!1;for(const b of H)if((_.get(b)||new Set).has(T)){P=!0,T++;break}}for(const b of H)_.has(b)||_.set(b,new Set),_.get(b).add(T);y.commits.forEach(b=>{m.set(b,{mainCol:g,subOffset:T,isSubBranch:!0,subBranchId:C})})})});const S=new Map;let at=f;for(let l=0;l<=h.length;l++)if(S.set(l,at),l<h.length){let g=0;k.forEach(_=>{const y=m.get(_.hash);y.mainCol===l&&y.subOffset>g&&(g=y.subOffset)}),at+=a+g*c}const v=new Map;k.forEach((l,g)=>{const _=m.get(l.hash),C=S.get(_.mainCol)+_.subOffset*c;v.set(l.hash,{col:_.mainCol,subOffset:_.subOffset,row:g,x:C,y:u+g*o,isSubBranch:_.isSubBranch,subBranchId:_.subBranchId||null})});const Y=Array.from(m.values()).some(l=>l.mainCol===h.length),A=t.append("g").attr("class","main-group"),q=n.append("div").attr("class","tooltip").style("opacity",0);h.forEach((l,g)=>{A.append("text").attr("x",S.get(g)).attr("y",25).attr("fill","#4fc3f7").attr("font-size","14px").attr("font-weight","bold").text(l.name)}),Y&&A.append("text").attr("x",S.get(h.length)).attr("y",25).attr("fill","#888").attr("font-size","14px").text("Other"),k.forEach(l=>{const g=v.get(l.hash);g&&l.parents.forEach(_=>{const y=v.get(_);if(y){if(g.col===h.length||y.col===h.length)return;const C=g.x,H=g.y,T=y.x,P=y.y;let b;if(C===T)b=`M ${C} ${H} L ${T} ${P}`;else{const Jt=(H+P)/2;b=`M ${C} ${H} C ${C} ${Jt}, ${T} ${Jt}, ${T} ${P}`}const I=g.subBranchId||y.subBranchId||null,Nt=g.isSubBranch||y.isSubBranch,Dn=A.append("path").attr("d",b).attr("fill","none").attr("stroke",Nt?"#555":"#666").attr("stroke-width",g.isSubBranch&&y.isSubBranch?1:1.5).attr("stroke-opacity",.6).attr("class",I?`edge edge-${I}`:"edge");I&&Dn.style("cursor","pointer").on("mouseenter",()=>{A.selectAll(`.edge-${I}`).attr("stroke","#4fc3f7").attr("stroke-width",2.5).attr("stroke-opacity",1)}).on("mouseleave",()=>{A.selectAll(`.edge-${I}`).attr("stroke","#555").attr("stroke-width",1).attr("stroke-opacity",.6)})}})}),A.selectAll("g.node").data(k).enter().append("g").attr("class","node").attr("transform",l=>{const g=v.get(l.hash);return g?`translate(${g.x}, ${g.y})`:"translate(-100, -100)"}).append("circle").attr("r",l=>{const g=v.get(l.hash);return g.isSubBranch?s*.6:g.col<h.length?s:s*.7}).attr("fill",l=>{const g=v.get(l.hash);return g.isSubBranch?"#a0a0a0":g.col<h.length?d.has(l.hash)?"#4fc3f7":"#fff":"#888"}).attr("stroke","#333").attr("stroke-width",l=>{const g=v.get(l.hash);return g.isSubBranch?1:g.col<h.length?2:1}).style("cursor","pointer").on("mouseenter",(l,g)=>{const _=d.get(g.hash),y=_?`[${_.join(", ")}]<br/>`:"",C=new Date(g.timestamp*1e3).toLocaleString();q.html(`<strong>${g.hash.substring(0,7)}</strong><br/>${y}${g.message}<br/><span class="date">${C}</span>`).style("left",l.pageX+15+"px").style("top",l.pageY-10+"px").style("opacity",1)}).on("mousemove",l=>{q.style("left",l.pageX+15+"px").style("top",l.pageY-10+"px")}).on("mouseleave",()=>{q.style("opacity",0)});let V=0,z=0,ct=!1,Yt=0,qt=0,Vt=0,zt=0;function St(){A.attr("transform",`translate(${V}, ${z})`)}t.on("wheel",l=>{l.preventDefault(),V-=l.deltaX,z-=l.deltaY,St()}),t.on("mousedown",l=>{l.button===0&&(ct=!0,Yt=l.clientX,qt=l.clientY,Vt=V,zt=z,l.preventDefault())}),t.on("mousemove",l=>{ct&&(V=Vt+(l.clientX-Yt),z=zt+(l.clientY-qt),St())}),t.on("mouseup",l=>{l.button===0&&(ct=!1)}),t.on("mouseleave",()=>{ct=!1});let Ut=0,Gt=0,Kt=0,Wt=0;t.on("touchstart",l=>{if(l.touches.length===1){const g=l.touches[0];Ut=g.clientX,Gt=g.clientY,Kt=V,Wt=z}}),t.on("touchmove",l=>{if(l.touches.length===1){l.preventDefault();const g=l.touches[0];V=Kt+(g.clientX-Ut),z=Wt+(g.clientY-Gt),St()}}),t.on("contextmenu",l=>{l.preventDefault()})}async function us(){[k,tt]=await Promise.all([rs(),is()]),G.clear(),k.forEach(t=>G.set(t.hash,t)),console.log("Commits:",k.length),console.log("Branches:",tt.length),ss(tt),Ot(),window.addEventListener("resize",()=>{Ot()})}us();
@@ -0,0 +1,3 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var cn={value:()=>{}};function Re(){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 vt(n)}function vt(t){this._=t}function ln(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}})}vt.prototype=Re.prototype={constructor:vt,on:function(t,e){var n=this._,r=ln(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=un(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=ge(n[i],t.name,e);else if(e==null)for(i in n)n[i]=ge(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 vt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function un(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function ge(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=cn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var qt="http://www.w3.org/1999/xhtml";const me={svg:"http://www.w3.org/2000/svg",xhtml:qt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Bt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),me.hasOwnProperty(e)?{space:me[e],local:t}:t}function fn(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===qt&&e.documentElement.namespaceURI===qt?e.createElement(t):e.createElementNS(n,t)}}function hn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Me(t){var e=Bt(t);return(e.local?hn:fn)(e)}function pn(){}function jt(t){return t==null?pn:function(){return this.querySelector(t)}}function dn(t){typeof t!="function"&&(t=jt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=new Array(s),c,l,u=0;u<s;++u)(c=o[u])&&(l=t.call(c,c.__data__,u,o))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new B(r,this._parents)}function gn(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function mn(){return[]}function Te(t){return t==null?mn:function(){return this.querySelectorAll(t)}}function wn(t){return function(){return gn(t.apply(this,arguments))}}function yn(t){typeof t=="function"?t=wn(t):t=Te(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(r.push(t.call(c,c.__data__,l,s)),i.push(c));return new B(r,i)}function Ie(t){return function(){return this.matches(t)}}function Oe(t){return function(e){return e.matches(t)}}var _n=Array.prototype.find;function xn(t){return function(){return _n.call(this.children,t)}}function vn(){return this.firstElementChild}function bn(t){return this.select(t==null?vn:xn(typeof t=="function"?t:Oe(t)))}var $n=Array.prototype.filter;function En(){return Array.from(this.children)}function Sn(t){return function(){return $n.call(this.children,t)}}function Nn(t){return this.selectAll(t==null?En:Sn(typeof t=="function"?t:Oe(t)))}function Cn(t){typeof t!="function"&&(t=Ie(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new B(r,this._parents)}function Pe(t){return new Array(t.length)}function An(){return new B(this._enter||this._groups.map(Pe),this._parents)}function Et(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Et.prototype={constructor:Et,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 kn(t){return function(){return t}}function Bn(t,e,n,r,i,o){for(var s=0,a,c=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new Et(t,o[s]);for(;s<c;++s)(a=e[s])&&(i[s]=a)}function Rn(t,e,n,r,i,o,s){var a,c,l=new Map,u=e.length,p=o.length,d=new Array(u),g;for(a=0;a<u;++a)(c=e[a])&&(d[a]=g=s.call(c,c.__data__,a,e)+"",l.has(g)?i[a]=c:l.set(g,c));for(a=0;a<p;++a)g=s.call(t,o[a],a,o)+"",(c=l.get(g))?(r[a]=c,c.__data__=o[a],l.delete(g)):n[a]=new Et(t,o[a]);for(a=0;a<u;++a)(c=e[a])&&l.get(d[a])===c&&(i[a]=c)}function Mn(t){return t.__data__}function Tn(t,e){if(!arguments.length)return Array.from(this,Mn);var n=e?Rn:Bn,r=this._parents,i=this._groups;typeof t!="function"&&(t=kn(t));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],p=i[l],d=p.length,g=In(t.call(u,u&&u.__data__,l,r)),m=g.length,E=a[l]=new Array(m),A=s[l]=new Array(m),Tt=c[l]=new Array(d);n(u,p,E,A,Tt,g,e);for(var I=0,q=0,N,ht;I<m;++I)if(N=E[I]){for(I>=q&&(q=I+1);!(ht=A[q])&&++q<m;);N._next=ht||null}}return s=new B(s,r),s._enter=a,s._exit=c,s}function In(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function On(){return new B(this._exit||this._groups.map(Pe),this._parents)}function Pn(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Fn(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var l=n[c],u=r[c],p=l.length,d=a[c]=new Array(p),g,m=0;m<p;++m)(g=l[m]||u[m])&&(d[m]=g);for(;c<i;++c)a[c]=n[c];return new B(a,this._parents)}function Xn(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function Ln(t){t||(t=Yn);function e(p,d){return p&&d?t(p.__data__,d.__data__):!p-!d}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,c=i[o]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(e)}return new B(i,this._parents).order()}function Yn(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Hn(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Dn(){return Array.from(this)}function qn(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function Vn(){let t=0;for(const e of this)++t;return t}function zn(){return!this.node()}function Un(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function Zn(t){return function(){this.removeAttribute(t)}}function Kn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Gn(t,e){return function(){this.setAttribute(t,e)}}function Wn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Jn(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Qn(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 jn(t,e){var n=Bt(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?Kn:Zn:typeof e=="function"?n.local?Qn:Jn:n.local?Wn:Gn)(n,e))}function Fe(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function tr(t){return function(){this.style.removeProperty(t)}}function er(t,e,n){return function(){this.style.setProperty(t,e,n)}}function nr(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function rr(t,e,n){return arguments.length>1?this.each((e==null?tr:typeof e=="function"?nr:er)(t,e,n??"")):W(this.node(),t)}function W(t,e){return t.style.getPropertyValue(e)||Fe(t).getComputedStyle(t,null).getPropertyValue(e)}function ir(t){return function(){delete this[t]}}function or(t,e){return function(){this[t]=e}}function sr(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function ar(t,e){return arguments.length>1?this.each((e==null?ir:typeof e=="function"?sr:or)(t,e)):this.node()[t]}function Xe(t){return t.trim().split(/^|\s+/)}function te(t){return t.classList||new Le(t)}function Le(t){this._node=t,this._names=Xe(t.getAttribute("class")||"")}Le.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 Ye(t,e){for(var n=te(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function He(t,e){for(var n=te(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function cr(t){return function(){Ye(this,t)}}function lr(t){return function(){He(this,t)}}function ur(t,e){return function(){(e.apply(this,arguments)?Ye:He)(this,t)}}function fr(t,e){var n=Xe(t+"");if(arguments.length<2){for(var r=te(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?ur:e?cr:lr)(n,e))}function hr(){this.textContent=""}function pr(t){return function(){this.textContent=t}}function dr(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function gr(t){return arguments.length?this.each(t==null?hr:(typeof t=="function"?dr:pr)(t)):this.node().textContent}function mr(){this.innerHTML=""}function wr(t){return function(){this.innerHTML=t}}function yr(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function _r(t){return arguments.length?this.each(t==null?mr:(typeof t=="function"?yr:wr)(t)):this.node().innerHTML}function xr(){this.nextSibling&&this.parentNode.appendChild(this)}function vr(){return this.each(xr)}function br(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $r(){return this.each(br)}function Er(t){var e=typeof t=="function"?t:Me(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Sr(){return null}function Nr(t,e){var n=typeof t=="function"?t:Me(t),r=e==null?Sr:typeof e=="function"?e:jt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Cr(){var t=this.parentNode;t&&t.removeChild(this)}function Ar(){return this.each(Cr)}function kr(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Br(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Rr(t){return this.select(t?Br:kr)}function Mr(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Tr(t){return function(e){t.call(this,e,this.__data__)}}function Ir(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 Or(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function Pr(t,e,n){return function(){var r=this.__on,i,o=Tr(e);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Fr(t,e,n){var r=Ir(t+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(i=0,u=a[c];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?Pr:Or,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function De(t,e,n){var r=Fe(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 Xr(t,e){return function(){return De(this,t,e)}}function Lr(t,e){return function(){return De(this,t,e.apply(this,arguments))}}function Yr(t,e){return this.each((typeof e=="function"?Lr:Xr)(t,e))}function*Hr(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var qe=[null];function B(t,e){this._groups=t,this._parents=e}function ut(){return new B([[document.documentElement]],qe)}function Dr(){return this}B.prototype=ut.prototype={constructor:B,select:dn,selectAll:yn,selectChild:bn,selectChildren:Nn,filter:Cn,data:Tn,enter:An,exit:On,join:Pn,merge:Fn,selection:Dr,order:Xn,sort:Ln,call:Hn,nodes:Dn,node:qn,size:Vn,empty:zn,each:Un,attr:jn,style:rr,property:ar,classed:fr,text:gr,html:_r,raise:vr,lower:$r,append:Er,insert:Nr,remove:Ar,clone:Rr,datum:Mr,on:Fr,dispatch:Yr,[Symbol.iterator]:Hr};function Lt(t){return typeof t=="string"?new B([[document.querySelector(t)]],[document.documentElement]):new B([[t]],qe)}function ee(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ve(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ft(){}var st=.7,St=1/st,G="\\s*([+-]?\\d+)\\s*",at="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",O="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qr=/^#([0-9a-f]{3,8})$/,Vr=new RegExp(`^rgb\\(${G},${G},${G}\\)$`),zr=new RegExp(`^rgb\\(${O},${O},${O}\\)$`),Ur=new RegExp(`^rgba\\(${G},${G},${G},${at}\\)$`),Zr=new RegExp(`^rgba\\(${O},${O},${O},${at}\\)$`),Kr=new RegExp(`^hsl\\(${at},${O},${O}\\)$`),Gr=new RegExp(`^hsla\\(${at},${O},${O},${at}\\)$`),we={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ee(ft,ct,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ye,formatHex:ye,formatHex8:Wr,formatHsl:Jr,formatRgb:_e,toString:_e});function ye(){return this.rgb().formatHex()}function Wr(){return this.rgb().formatHex8()}function Jr(){return ze(this).formatHsl()}function _e(){return this.rgb().formatRgb()}function ct(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=qr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?xe(e):n===3?new k(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?yt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?yt(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=Vr.exec(t))?new k(e[1],e[2],e[3],1):(e=zr.exec(t))?new k(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ur.exec(t))?yt(e[1],e[2],e[3],e[4]):(e=Zr.exec(t))?yt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Kr.exec(t))?$e(e[1],e[2]/100,e[3]/100,1):(e=Gr.exec(t))?$e(e[1],e[2]/100,e[3]/100,e[4]):we.hasOwnProperty(t)?xe(we[t]):t==="transparent"?new k(NaN,NaN,NaN,0):null}function xe(t){return new k(t>>16&255,t>>8&255,t&255,1)}function yt(t,e,n,r){return r<=0&&(t=e=n=NaN),new k(t,e,n,r)}function Qr(t){return t instanceof ft||(t=ct(t)),t?(t=t.rgb(),new k(t.r,t.g,t.b,t.opacity)):new k}function Vt(t,e,n,r){return arguments.length===1?Qr(t):new k(t,e,n,r??1)}function k(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ee(k,Vt,Ve(ft,{brighter(t){return t=t==null?St:Math.pow(St,t),new k(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?st:Math.pow(st,t),new k(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new k(Z(this.r),Z(this.g),Z(this.b),Nt(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:ve,formatHex:ve,formatHex8:jr,formatRgb:be,toString:be}));function ve(){return`#${U(this.r)}${U(this.g)}${U(this.b)}`}function jr(){return`#${U(this.r)}${U(this.g)}${U(this.b)}${U((isNaN(this.opacity)?1:this.opacity)*255)}`}function be(){const t=Nt(this.opacity);return`${t===1?"rgb(":"rgba("}${Z(this.r)}, ${Z(this.g)}, ${Z(this.b)}${t===1?")":`, ${t})`}`}function Nt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Z(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function U(t){return t=Z(t),(t<16?"0":"")+t.toString(16)}function $e(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new M(t,e,n,r)}function ze(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);if(t instanceof ft||(t=ct(t)),!t)return new M;if(t instanceof M)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(e===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-e)/a+2:s=(e-n)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new M(s,a,c,t.opacity)}function ti(t,e,n,r){return arguments.length===1?ze(t):new M(t,e,n,r??1)}function M(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ee(M,ti,Ve(ft,{brighter(t){return t=t==null?St:Math.pow(St,t),new M(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?st:Math.pow(st,t),new M(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 k(Yt(t>=240?t-240:t+120,i,r),Yt(t,i,r),Yt(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new M(Ee(this.h),_t(this.s),_t(this.l),Nt(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=Nt(this.opacity);return`${t===1?"hsl(":"hsla("}${Ee(this.h)}, ${_t(this.s)*100}%, ${_t(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ee(t){return t=(t||0)%360,t<0?t+360:t}function _t(t){return Math.max(0,Math.min(1,t||0))}function Yt(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 Ue=t=>()=>t;function ei(t,e){return function(n){return t+n*e}}function ni(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 ri(t){return(t=+t)==1?Ze:function(e,n){return n-e?ni(e,n,t):Ue(isNaN(e)?n:e)}}function Ze(t,e){var n=e-t;return n?ei(t,n):Ue(isNaN(t)?e:t)}const Se=(function t(e){var n=ri(e);function r(i,o){var s=n((i=Vt(i)).r,(o=Vt(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=Ze(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=t,r})(1);function H(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var zt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ht=new RegExp(zt.source,"g");function ii(t){return function(){return t}}function oi(t){return function(e){return t(e)+""}}function si(t,e){var n=zt.lastIndex=Ht.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=zt.exec(t))&&(i=Ht.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:H(r,i)})),n=Ht.lastIndex;return n<e.length&&(o=e.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?oi(c[0].x):ii(e):(e=c.length,function(l){for(var u=0,p;u<e;++u)a[(p=c[u]).i]=p.x(l);return a.join("")})}var Ne=180/Math.PI,Ut={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ke(t,e,n,r,i,o){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*Ne,skewX:Math.atan(c)*Ne,scaleX:s,scaleY:a}}var xt;function ai(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ut:Ke(e.a,e.b,e.c,e.d,e.e,e.f)}function ci(t){return t==null||(xt||(xt=document.createElementNS("http://www.w3.org/2000/svg","g")),xt.setAttribute("transform",t),!(t=xt.transform.baseVal.consolidate()))?Ut:(t=t.matrix,Ke(t.a,t.b,t.c,t.d,t.e,t.f))}function Ge(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,p,d,g,m){if(l!==p||u!==d){var E=g.push("translate(",null,e,null,n);m.push({i:E-4,x:H(l,p)},{i:E-2,x:H(u,d)})}else(p||d)&&g.push("translate("+p+e+d+n)}function s(l,u,p,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:p.push(i(p)+"rotate(",null,r)-2,x:H(l,u)})):u&&p.push(i(p)+"rotate("+u+r)}function a(l,u,p,d){l!==u?d.push({i:p.push(i(p)+"skewX(",null,r)-2,x:H(l,u)}):u&&p.push(i(p)+"skewX("+u+r)}function c(l,u,p,d,g,m){if(l!==p||u!==d){var E=g.push(i(g)+"scale(",null,",",null,")");m.push({i:E-4,x:H(l,p)},{i:E-2,x:H(u,d)})}else(p!==1||d!==1)&&g.push(i(g)+"scale("+p+","+d+")")}return function(l,u){var p=[],d=[];return l=t(l),u=t(u),o(l.translateX,l.translateY,u.translateX,u.translateY,p,d),s(l.rotate,u.rotate,p,d),a(l.skewX,u.skewX,p,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,p,d),l=u=null,function(g){for(var m=-1,E=d.length,A;++m<E;)p[(A=d[m]).i]=A.x(g);return p.join("")}}}var li=Ge(ai,"px, ","px)","deg)"),ui=Ge(ci,", ",")",")"),J=0,nt=0,et=0,We=1e3,Ct,rt,At=0,K=0,Rt=0,lt=typeof performance=="object"&&performance.now?performance:Date,Je=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ne(){return K||(Je(fi),K=lt.now()+Rt)}function fi(){K=0}function kt(){this._call=this._time=this._next=null}kt.prototype=Qe.prototype={constructor:kt,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?ne():+n)+(e==null?0:+e),!this._next&&rt!==this&&(rt?rt._next=this:Ct=this,rt=this),this._call=t,this._time=n,Zt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zt())}};function Qe(t,e,n){var r=new kt;return r.restart(t,e,n),r}function hi(){ne(),++J;for(var t=Ct,e;t;)(e=K-t._time)>=0&&t._call.call(void 0,e),t=t._next;--J}function Ce(){K=(At=lt.now())+Rt,J=nt=0;try{hi()}finally{J=0,di(),K=0}}function pi(){var t=lt.now(),e=t-At;e>We&&(Rt-=e,At=t)}function di(){for(var t,e=Ct,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:Ct=n);rt=t,Zt(r)}function Zt(t){if(!J){nt&&(nt=clearTimeout(nt));var e=t-K;e>24?(t<1/0&&(nt=setTimeout(Ce,t-lt.now()-Rt)),et&&(et=clearInterval(et))):(et||(At=lt.now(),et=setInterval(pi,We)),J=1,Je(Ce))}}function Ae(t,e,n){var r=new kt;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var gi=Re("start","end","cancel","interrupt"),mi=[],je=0,ke=1,Kt=2,bt=3,Be=4,Gt=5,$t=6;function Mt(t,e,n,r,i,o){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;wi(t,n,{name:e,index:r,group:i,on:gi,tween:mi,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:je})}function re(t,e){var n=T(t,e);if(n.state>je)throw new Error("too late; already scheduled");return n}function P(t,e){var n=T(t,e);if(n.state>bt)throw new Error("too late; already running");return n}function T(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function wi(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Qe(o,0,n.time);function o(l){n.state=ke,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,p,d,g;if(n.state!==ke)return c();for(u in r)if(g=r[u],g.name===n.name){if(g.state===bt)return Ae(s);g.state===Be?(g.state=$t,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete r[u]):+u<e&&(g.state=$t,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete r[u])}if(Ae(function(){n.state===bt&&(n.state=Be,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Kt,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Kt){for(n.state=bt,i=new Array(d=n.tween.length),u=0,p=-1;u<d;++u)(g=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++p]=g);i.length=p+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Gt,1),p=-1,d=i.length;++p<d;)i[p].call(t,u);n.state===Gt&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=$t,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function yi(t,e){var n=t.__transition,r,i,o=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){o=!1;continue}i=r.state>Kt&&r.state<Gt,r.state=$t,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}o&&delete t.__transition}}function _i(t){return this.each(function(){yi(this,t)})}function xi(t,e){var n,r;return function(){var i=P(this,t),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function vi(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=P(this,t),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:e,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===e){i[c]=a;break}c===l&&i.push(a)}o.tween=i}}function bi(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=T(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===t)return s.value;return null}return this.each((e==null?xi:vi)(n,t,e))}function ie(t,e,n){var r=t._id;return t.each(function(){var i=P(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return T(i,r).value[e]}}function tn(t,e){var n;return(typeof e=="number"?H:e instanceof ct?Se:(n=ct(e))?(e=n,Se):si)(t,e)}function $i(t){return function(){this.removeAttribute(t)}}function Ei(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Si(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttribute(t);return s===i?null:s===r?o:o=e(r=s,n)}}function Ni(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===r?o:o=e(r=s,n)}}function Ci(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function Ai(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function ki(t,e){var n=Bt(t),r=n==="transform"?ui:tn;return this.attrTween(t,typeof e=="function"?(n.local?Ai:Ci)(n,r,ie(this,"attr."+t,e)):e==null?(n.local?Ei:$i)(n):(n.local?Ni:Si)(n,r,e))}function Bi(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Ri(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Mi(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Ri(t,o)),n}return i._value=e,i}function Ti(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Bi(t,o)),n}return i._value=e,i}function Ii(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=Bt(t);return this.tween(n,(r.local?Mi:Ti)(r,e))}function Oi(t,e){return function(){re(this,t).delay=+e.apply(this,arguments)}}function Pi(t,e){return e=+e,function(){re(this,t).delay=e}}function Fi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Oi:Pi)(e,t)):T(this.node(),e).delay}function Xi(t,e){return function(){P(this,t).duration=+e.apply(this,arguments)}}function Li(t,e){return e=+e,function(){P(this,t).duration=e}}function Yi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Xi:Li)(e,t)):T(this.node(),e).duration}function Hi(t,e){if(typeof e!="function")throw new Error;return function(){P(this,t).ease=e}}function Di(t){var e=this._id;return arguments.length?this.each(Hi(e,t)):T(this.node(),e).ease}function qi(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;P(this,t).ease=n}}function Vi(t){if(typeof t!="function")throw new Error;return this.each(qi(this._id,t))}function zi(t){typeof t!="function"&&(t=Ie(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new L(r,this._parents,this._name,this._id)}function Ui(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=e[a],l=n[a],u=c.length,p=s[a]=new Array(u),d,g=0;g<u;++g)(d=c[g]||l[g])&&(p[g]=d);for(;a<r;++a)s[a]=e[a];return new L(s,this._parents,this._name,this._id)}function Zi(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 Ki(t,e,n){var r,i,o=Zi(e)?re:P;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}function Gi(t,e){var n=this._id;return arguments.length<2?T(this.node(),n).on.on(t):this.each(Ki(n,t,e))}function Wi(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Ji(){return this.on("end.remove",Wi(this._id))}function Qi(t){var e=this._name,n=this._id;typeof t!="function"&&(t=jt(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],c=a.length,l=o[s]=new Array(c),u,p,d=0;d<c;++d)(u=a[d])&&(p=t.call(u,u.__data__,d,a))&&("__data__"in u&&(p.__data__=u.__data__),l[d]=p,Mt(l[d],e,n,d,l,T(u,n)));return new L(o,this._parents,e,n)}function ji(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Te(t));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],l=c.length,u,p=0;p<l;++p)if(u=c[p]){for(var d=t.call(u,u.__data__,p,c),g,m=T(u,n),E=0,A=d.length;E<A;++E)(g=d[E])&&Mt(g,e,n,E,d,m);o.push(d),s.push(u)}return new L(o,s,e,n)}var to=ut.prototype.constructor;function eo(){return new to(this._groups,this._parents)}function no(t,e){var n,r,i;return function(){var o=W(this,t),s=(this.style.removeProperty(t),W(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}function en(t){return function(){this.style.removeProperty(t)}}function ro(t,e,n){var r,i=n+"",o;return function(){var s=W(this,t);return s===i?null:s===r?o:o=e(r=s,n)}}function io(t,e,n){var r,i,o;return function(){var s=W(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),W(this,t))),s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a))}}function oo(t,e){var n,r,i,o="style."+e,s="end."+o,a;return function(){var c=P(this,t),l=c.on,u=c.value[o]==null?a||(a=en(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function so(t,e,n){var r=(t+="")=="transform"?li:tn;return e==null?this.styleTween(t,no(t,r)).on("end.style."+t,en(t)):typeof e=="function"?this.styleTween(t,io(t,r,ie(this,"style."+t,e))).each(oo(this._id,t)):this.styleTween(t,ro(t,r,e),n).on("end.style."+t,null)}function ao(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function co(t,e,n){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&ao(t,s,n)),r}return o._value=e,o}function lo(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,co(t,e,n??""))}function uo(t){return function(){this.textContent=t}}function fo(t){return function(){var e=t(this);this.textContent=e??""}}function ho(t){return this.tween("text",typeof t=="function"?fo(ie(this,"text",t)):uo(t==null?"":t+""))}function po(t){return function(e){this.textContent=t.call(this,e)}}function go(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&po(i)),e}return r._value=t,r}function mo(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,go(t))}function wo(){for(var t=this._name,e=this._id,n=nn(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=T(c,e);Mt(c,t,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new L(r,this._parents,t,n)}function yo(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var l=P(this,r),u=l.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),l.on=e}),i===0&&o()})}var _o=0;function L(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function nn(){return++_o}var X=ut.prototype;L.prototype={constructor:L,select:Qi,selectAll:ji,selectChild:X.selectChild,selectChildren:X.selectChildren,filter:zi,merge:Ui,selection:eo,transition:wo,call:X.call,nodes:X.nodes,node:X.node,size:X.size,empty:X.empty,each:X.each,on:Gi,attr:ki,attrTween:Ii,style:so,styleTween:lo,text:ho,textTween:mo,remove:Ji,tween:bi,delay:Fi,duration:Yi,ease:Di,easeVarying:Vi,end:yo,[Symbol.iterator]:X[Symbol.iterator]};function xo(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var vo={time:null,delay:0,duration:250,ease:xo};function bo(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 $o(t){var e,n;t instanceof L?(e=t._id,t=t._name):(e=nn(),(n=vo).time=ne(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&Mt(c,t,e,l,s,n||bo(c,e));return new L(r,this._parents,t,e)}ut.prototype.interrupt=_i;ut.prototype.transition=$o;function it(t,e,n){this.k=t,this.x=e,this.y=n}it.prototype={constructor:it,scale:function(t){return t===1?this:new it(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new it(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+")"}};it.prototype;let R=[],ot=[],Wt=[],D=new Map,Dt="",z=1,Jt={};async function Eo(){const t=await window.gitopo.git.exec("rev-parse --show-toplevel");if(t.success){const e=t.output.trim();return e.split("/").pop()||e}return"Unknown Repository"}async function So(){const t=await window.gitopo.config.get();return t.success?t.config:(console.error("Failed to fetch config:",t.error),{})}async function No(){const t=await window.gitopo.gh.exec("pr list --state open --json number,title,headRefName,headRefOid");if(!t.success)return console.error("Failed to fetch pull requests:",t.error),[];try{return JSON.parse(t.output).map(n=>({number:n.number,title:n.title,branch:n.headRefName,headCommit:n.headRefOid}))}catch(e){return console.error("Failed to parse PR data:",e),[]}}async function Co(){const t=await window.gitopo.git.exec('log --all --format="%H|%P|%ct|%s" --date-order -1000');if(!t.success)return console.error("Failed to fetch commits:",t.error),[];const e=[],n=t.output.trim().split(`
2
+ `);for(const r of n){const i=r.split("|");if(i.length>=4){const o=i[0],s=i[1],a=parseInt(i[2],10),c=i.slice(3).join("|"),l=s.trim()?s.trim().split(" "):[];e.push({hash:o,parents:l,timestamp:a,message:c})}}return e.sort((r,i)=>i.timestamp-r.timestamp),e}async function Ao(){const t=await window.gitopo.git.exec('branch -a --format="%(refname:short) %(objectname)"');if(!t.success)return console.error("Failed to fetch branches:",t.error),[];const e=[],n=t.output.trim().split(`
3
+ `);for(const r of n){const i=r.trim().split(" ");if(i.length>=2){const o=i[0],s=i[1];e.push({name:o,hash:s})}}return e}function ko(t){const e=["branch1","branch2","branch3"],n=Jt.keyBranches||[],r=t.find(i=>i.name==="main"||i.name==="master");e.forEach((i,o)=>{const s=document.getElementById(i);s.innerHTML="";const a=document.createElement("option");if(a.value="",a.textContent="----",s.appendChild(a),t.forEach(c=>{const l=document.createElement("option");l.value=c.name,l.textContent=c.name,s.appendChild(l)}),n[o]){const c=t.find(l=>l.name===n[o]);c&&(s.value=c.name)}else o===0&&r&&(s.value=r.name);s.addEventListener("change",()=>Qt())})}function Bo(t){const e=ot.find(i=>i.name===t);if(!e)return new Set;const n=new Set;let r=e.hash;for(;r;){n.add(r);const i=D.get(r);if(i&&i.parents.length>0)r=i.parents[0];else break}return n}function Ro(t,e=new Set){const n=[],r=new Set,i=new Map;for(const c of R)for(const l of c.parents)i.has(l)||i.set(l,[]),i.get(l).push(c.hash);function o(c){const l=new Set,u=[c];for(;u.length>0;){const p=u.pop();if(l.has(p)||t.has(p)||e.has(p)||r.has(p))continue;const d=D.get(p);if(!d)continue;l.add(p);for(const m of d.parents)!t.has(m)&&!e.has(m)&&!l.has(m)&&u.push(m);const g=i.get(p)||[];for(const m of g)!t.has(m)&&!e.has(m)&&!l.has(m)&&u.push(m)}return l}function s(c){for(const l of c){const u=D.get(l);if(u){for(const p of u.parents)if(!t.has(p)&&!c.has(p))return!1}}return!0}function a(c){for(const l of t){const u=D.get(l);if(!(!u||u.parents.length<2)){for(let p=1;p<u.parents.length;p++)if(c.has(u.parents[p]))return l}}return null}for(const c of R){if(t.has(c.hash)||e.has(c.hash)||r.has(c.hash))continue;const l=o(c.hash);l.size>0&&s(l)&&(l.forEach(u=>r.add(u)),n.push({mergeCommit:a(l),commits:l}))}return n}function Mo(){const t=[];return["branch1","branch2","branch3"].forEach(e=>{const n=document.getElementById(e);n&&n.value&&t.push(n.value)}),t}function Qt(){const t=Lt("#graph");t.selectAll("*").remove();const e=Lt("#app");e.selectAll(".tooltip").remove();const n=document.getElementById("controls").offsetHeight,r=window.innerWidth,i=window.innerHeight-n;t.attr("width",r).attr("height",i);const o=6,s=30,a=150,c=30,l=50,u=50,d=Mo().map(f=>({name:f,lineage:Bo(f)})),g=new Set;d.forEach(({lineage:f})=>{f.forEach(h=>g.add(h))});const m=d.map(({name:f,lineage:h})=>{const w=new Set;d.forEach(y=>{y.name!==f&&y.lineage.forEach(_=>w.add(_))});const v=Ro(h,w);return{name:f,lineage:h,subBranches:v}}),E=new Map;ot.forEach(f=>{E.has(f.hash)||E.set(f.hash,[]),E.get(f.hash).push(f.name)});const A=new Map;R.forEach(f=>{A.set(f.hash,{mainCol:m.length,subOffset:0,isSubBranch:!1})}),m.forEach((f,h)=>{for(const w of f.lineage)A.set(w,{mainCol:h,subOffset:0,isSubBranch:!1})});let Tt=0;m.forEach((f,h)=>{const w=new Map;[...f.subBranches].sort((y,_)=>{const $=x=>{let b=1/0;return x.commits.forEach(S=>{const C=D.get(S);C&&C.timestamp<b&&(b=C.timestamp)}),b};return $(y)-$(_)}).forEach(y=>{const _=`sb-${Tt++}`,$=[];y.commits.forEach(S=>{const C=R.findIndex(j=>j.hash===S);C>=0&&$.push(C)});let x=1,b=!0;for(;b;){b=!1;for(const S of $)if((w.get(S)||new Set).has(x)){b=!0,x++;break}}for(const S of $)w.has(S)||w.set(S,new Set),w.get(S).add(x);y.commits.forEach(S=>{A.set(S,{mainCol:h,subOffset:x,isSubBranch:!0,subBranchId:_})})})});const I=new Map;let q=u;for(let f=0;f<=m.length;f++)if(I.set(f,q),f<m.length){let h=0;R.forEach(w=>{const v=A.get(w.hash);v.mainCol===f&&v.subOffset>h&&(h=v.subOffset)}),q+=a+h*c}const N=new Map;R.forEach((f,h)=>{const w=A.get(f.hash),y=I.get(w.mainCol)+w.subOffset*c;N.set(f.hash,{col:w.mainCol,subOffset:w.subOffset,row:h,x:y,y:l+h*s,isSubBranch:w.isSubBranch,subBranchId:w.subBranchId||null})});const ht=Array.from(A.values()).some(f=>f.mainCol===m.length),F=t.append("g").attr("class","main-group"),It=t.append("g").attr("class","header-group"),Ot=e.append("div").attr("class","tooltip").style("opacity",0),pt=["#4CAF50","#2196F3","#FF9800"],oe=20;m.forEach((f,h)=>{It.append("text").attr("x",I.get(h)).attr("y",oe).attr("text-anchor","middle").attr("fill",pt[h]||"#888").attr("font-size","14px").attr("font-weight","bold").text(f.name)}),ht&&It.append("text").attr("x",I.get(m.length)).attr("y",oe).attr("text-anchor","middle").attr("fill","#888").attr("font-size","14px").text("Other");const dt=new Map;R.forEach(f=>{f.parents.forEach(h=>{dt.has(h)||dt.set(h,[]),dt.get(h).push(f.hash)})});const rn=new Set;m.forEach(f=>{f.lineage.forEach(h=>rn.add(h))});function se(f){const h=[],w=new Set;function v(_){if(w.has(_))return;w.add(_);const $=D.get(_);$&&$.parents.forEach(x=>{h.push({source:_,target:x});const b=N.get(x);b&&b.col===m.length&&!b.isSubBranch&&v(x)})}function y(_){if(w.has(_))return;w.add(_),(dt.get(_)||[]).forEach(x=>{h.push({source:x,target:_});const b=N.get(x);b&&b.col===m.length&&!b.isSubBranch&&y(x)})}return v(f),w.delete(f),y(f),h}R.forEach(f=>{const h=N.get(f.hash);h&&f.parents.forEach(w=>{const v=N.get(w);if(v){const y=h.col===m.length||v.col===m.length,_=h.x,$=h.y*z,x=v.x,b=v.y*z;let S;if(_===x)S=`M ${_} ${$} L ${x} ${b}`;else{const wt=($+b)/2;S=`M ${_} ${$} C ${_} ${wt}, ${x} ${wt}, ${x} ${b}`}const C=h.subBranchId||v.subBranchId||null,j=h.isSubBranch||v.isSubBranch,sn=!j&&!y&&h.col<m.length;let Xt="#666";y?Xt="#444":h.col<m.length&&(Xt=pt[h.col]||"#666");let tt=1.5;y?tt=1:sn?tt=3:j&&(tt=1.5);const an=F.append("path").attr("d",S).attr("fill","none").attr("stroke",Xt).attr("stroke-width",tt).attr("stroke-opacity",y?.4:j?.5:.8).attr("stroke-dasharray",y?"4,4":"none").attr("class",C?`edge edge-${C}`:"edge").attr("data-source",f.hash).attr("data-target",w);if(C){const wt=tt;an.style("cursor","pointer").on("mouseenter",()=>{F.selectAll(`.edge-${C}`).attr("stroke-width",3).attr("stroke-opacity",.9)}).on("mouseleave",()=>{F.selectAll(`.edge-${C}`).attr("stroke-width",wt).attr("stroke-opacity",.5)})}}})});const Q=new Map;Wt.forEach(f=>{Q.set(f.headCommit,f)});const Pt=F.selectAll("g.node").data(R).enter().append("g").attr("class","node").attr("transform",f=>{const h=N.get(f.hash);return h?`translate(${h.x}, ${h.y*z})`:"translate(-100, -100)"});Pt.filter(f=>Q.has(f.hash)).append("circle").attr("r",o+6).attr("fill","none").attr("stroke","#888").attr("stroke-width",2).attr("stroke-dasharray","3,2"),Pt.append("circle").attr("r",f=>{const h=N.get(f.hash);return h.isSubBranch?o*.6:h.col<m.length?o:o*.7}).attr("fill",f=>{const h=N.get(f.hash);return h.col<m.length?pt[h.col]||"#fff":h.isSubBranch?"#a0a0a0":"#888"}).attr("stroke",f=>{const h=N.get(f.hash);return h.col<m.length&&pt[h.col]||"#333"}).attr("stroke-width",f=>{const h=N.get(f.hash);return h.isSubBranch?1:h.col<m.length?2:1}).style("cursor","pointer").on("mouseenter",(f,h)=>{const w=E.get(h.hash),v=w?`[${w.join(", ")}]<br/>`:"",y=Q.get(h.hash),_=y?`<span class="pr-info">PR #${y.number}: ${y.title}</span><br/>`:"",$=new Date(h.timestamp*1e3).toLocaleString();Ot.html(`<strong>${h.hash.substring(0,7)}</strong><br/>${_}${v}${h.message}<br/><span class="date">${$}</span>`).style("left",f.pageX+15+"px").style("top",f.pageY-10+"px").style("opacity",1);const x=N.get(h.hash);x&&x.col===m.length&&!x.isSubBranch&&se(h.hash).forEach(({source:S,target:C})=>{F.selectAll(`path.edge[data-source="${S}"][data-target="${C}"]`).attr("stroke-width",3).attr("stroke-opacity",.9)})}).on("mousemove",f=>{Ot.style("left",f.pageX+15+"px").style("top",f.pageY-10+"px")}).on("mouseleave",(f,h)=>{Ot.style("opacity",0);const w=N.get(h.hash);w&&w.col===m.length&&!w.isSubBranch&&se(h.hash).forEach(({source:y,target:_})=>{F.selectAll(`path.edge[data-source="${y}"][data-target="${_}"]`).attr("stroke-width",1).attr("stroke-opacity",.4)})}),Pt.filter(f=>Q.has(f.hash)).append("text").attr("x",o+10).attr("y",4).attr("fill","#ccc").attr("font-size","11px").text(f=>{const h=Q.get(f.hash);return`PR #${h.number}: ${h.title.substring(0,30)}${h.title.length>30?"...":""}`});let V=0,Y=0,gt=!1,ae=0,ce=0,le=0,ue=0;function Ft(f){return f*z}function mt(){F.attr("transform",`translate(${V}, ${Y})`),It.attr("transform",`translate(${V}, 0)`)}function on(){F.selectAll("g.node").attr("transform",f=>{const h=N.get(f.hash);return h?`translate(${h.x}, ${Ft(h.y)})`:"translate(-100, -100)"}),F.selectAll("path.edge").attr("d",function(){const f=Lt(this),h=f.attr("data-source"),w=f.attr("data-target"),v=N.get(h),y=N.get(w);if(!v||!y)return"";const _=v.x,$=Ft(v.y),x=y.x,b=Ft(y.y);if(_===x)return`M ${_} ${$} L ${x} ${b}`;{const S=($+b)/2;return`M ${_} ${$} C ${_} ${S}, ${x} ${S}, ${x} ${b}`}})}t.on("wheel",f=>{if(f.preventDefault(),f.ctrlKey||f.metaKey){const h=f.deltaY>0?.9:1.1,y=Math.max(.1,Math.min(5,z*h)),_=t.node().getBoundingClientRect(),$=f.clientY-_.top,x=$-Y;Y=$-x*(y/z),z=y,on(),mt()}else V-=f.deltaX,Y-=f.deltaY,mt()}),t.on("mousedown",f=>{f.button===0&&(gt=!0,ae=f.clientX,ce=f.clientY,le=V,ue=Y,f.preventDefault())}),t.on("mousemove",f=>{gt&&(V=le+(f.clientX-ae),Y=ue+(f.clientY-ce),mt())}),t.on("mouseup",f=>{f.button===0&&(gt=!1)}),t.on("mouseleave",()=>{gt=!1});let fe=0,he=0,pe=0,de=0;t.on("touchstart",f=>{if(f.touches.length===1){const h=f.touches[0];fe=h.clientX,he=h.clientY,pe=V,de=Y}}),t.on("touchmove",f=>{if(f.touches.length===1){f.preventDefault();const h=f.touches[0];V=pe+(h.clientX-fe),Y=de+(h.clientY-he),mt()}}),t.on("contextmenu",f=>{f.preventDefault()})}async function To(){[R,ot,Dt,Wt,Jt]=await Promise.all([Co(),Ao(),Eo(),No(),So()]),document.getElementById("repo-name").textContent=Dt,D.clear(),R.forEach(t=>D.set(t.hash,t)),console.log("Repository:",Dt),console.log("Commits:",R.length),console.log("Branches:",ot.length),console.log("Open PRs:",Wt.length),console.log("Config:",Jt),ko(ot),Qt(),window.addEventListener("resize",()=>{Qt()})}To();
@@ -0,0 +1 @@
1
+ *{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:#1a1a2e;color:#eee;overflow:hidden}#app{width:100vw;height:100vh;position:relative;display:flex;flex-direction:column}#controls{display:flex;align-items:center;gap:20px;padding:12px 20px;background:#16213e;border-bottom:1px solid #333;flex-shrink:0}#repo-name{font-size:16px;font-weight:700;color:#fff;margin-right:20px;padding-right:20px;border-right:1px solid #444}.branch-selector{display:flex;align-items:center;gap:8px}.branch-selector label{font-size:13px;color:#888}.branch-selector select{padding:6px 12px;font-size:13px;background:#1a1a2e;color:#eee;border:1px solid #444;border-radius:4px;min-width:150px;cursor:pointer}.branch-selector select:hover{border-color:#4fc3f7}.branch-selector select:focus{outline:none;border-color:#4fc3f7}#graph{flex:1;width:100%}.tooltip{position:absolute;background:#1e1e32f2;border:1px solid #4fc3f7;border-radius:6px;padding:10px 14px;font-size:13px;line-height:1.5;max-width:400px;pointer-events:none;z-index:1000;box-shadow:0 4px 12px #0006;transition:opacity .15s ease}.tooltip strong{color:#4fc3f7;font-family:SF Mono,Monaco,Courier New,monospace}.tooltip .date{color:#888;font-size:11px}