git-history-ui 3.2.1 → 4.0.0

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 (44) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/build/frontend/{chunk-TQVUSJBM.js → chunk-3KK6F5JX.js} +1 -1
  3. package/build/frontend/{chunk-3FFYILBL.js → chunk-6VRZZB3T.js} +1 -1
  4. package/build/frontend/chunk-AWMYL3YU.js +1 -0
  5. package/build/frontend/{chunk-36NFLS3P.js → chunk-CFCRPNUQ.js} +1 -1
  6. package/build/frontend/chunk-EZUFC4CQ.js +1 -0
  7. package/build/frontend/chunk-GRG6HTLW.js +9 -0
  8. package/build/frontend/{chunk-N7UHDKJ7.js → chunk-I4VBIHH2.js} +1 -1
  9. package/build/frontend/chunk-L4LXF744.js +2 -0
  10. package/build/frontend/chunk-OBPR2XVH.js +5 -0
  11. package/build/frontend/{chunk-YSTG766K.js → chunk-UHWTLUOW.js} +1 -1
  12. package/build/frontend/{chunk-ITIFFECZ.js → chunk-UIWFTWLF.js} +1 -1
  13. package/build/frontend/{chunk-R33W2FKN.js → chunk-UNROVCUZ.js} +2 -2
  14. package/build/frontend/chunk-VHEMN3MU.js +1 -0
  15. package/build/frontend/index.html +2 -2
  16. package/build/frontend/main-6PSVVDXD.js +1 -0
  17. package/build/frontend/styles-DUWPKHDX.css +1 -0
  18. package/dist/backend/cache/sqliteIndex.d.ts +10 -2
  19. package/dist/backend/cache/sqliteIndex.js +58 -14
  20. package/dist/backend/cache/sqliteIndex.js.map +1 -1
  21. package/dist/backend/gitService.d.ts +28 -1
  22. package/dist/backend/gitService.js +210 -25
  23. package/dist/backend/gitService.js.map +1 -1
  24. package/dist/backend/grouping/prGrouping.d.ts +1 -0
  25. package/dist/backend/grouping/prGrouping.js +1 -0
  26. package/dist/backend/grouping/prGrouping.js.map +1 -1
  27. package/dist/backend/insights.d.ts +2 -0
  28. package/dist/backend/insights.js +38 -9
  29. package/dist/backend/insights.js.map +1 -1
  30. package/dist/backend/search/nlSearch.d.ts +5 -0
  31. package/dist/backend/search/nlSearch.js +5 -3
  32. package/dist/backend/search/nlSearch.js.map +1 -1
  33. package/dist/backend/server.d.ts +3 -1
  34. package/dist/backend/server.js +30 -6
  35. package/dist/backend/server.js.map +1 -1
  36. package/package.json +3 -1
  37. package/build/frontend/chunk-B7ZU76GM.js +0 -1
  38. package/build/frontend/chunk-HQV5AEMT.js +0 -3
  39. package/build/frontend/chunk-NDC3FSO4.js +0 -2
  40. package/build/frontend/chunk-NUMLL3OZ.js +0 -1
  41. package/build/frontend/chunk-QUDEGJKI.js +0 -1
  42. package/build/frontend/chunk-TQE5NWMZ.js +0 -5
  43. package/build/frontend/main-AW2YOC32.js +0 -1
  44. package/build/frontend/styles-BOEVKAI2.css +0 -1
@@ -0,0 +1 @@
1
+ function St(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Dr(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ct(t){let e,r,n;t.length!==2?(e=St,r=(s,f)=>St(t(s),f),n=(s,f)=>t(s)-f):(e=t===St||t===Dr?t:wu,r=t,n=t);function o(s,f,u=0,c=s.length){if(u<c){if(e(f,f)!==0)return c;do{let h=u+c>>>1;r(s[h],f)<0?u=h+1:c=h}while(u<c)}return u}function i(s,f,u=0,c=s.length){if(u<c){if(e(f,f)!==0)return c;do{let h=u+c>>>1;r(s[h],f)<=0?u=h+1:c=h}while(u<c)}return u}function a(s,f,u=0,c=s.length){let h=o(s,f,u,c-1);return h>u&&n(s[h-1],f)>-n(s[h],f)?h-1:h}return{left:o,center:a,right:i}}function wu(){return 0}function An(t,e){let r,n;if(e===void 0)for(let o of t)o!=null&&(r===void 0?o>=o&&(r=n=o):(r>o&&(r=o),n<o&&(n=o)));else{let o=-1;for(let i of t)(i=e(i,++o,t))!=null&&(r===void 0?i>=i&&(r=n=i):(r>i&&(r=i),n<i&&(n=i)))}return[r,n]}function Dn(t,e){let r;if(e===void 0)for(let n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let o of t)(o=e(o,++n,t))!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}return r}function Ir(t){return t===null?NaN:+t}var In=Ct(St),En=In.right,_u=In.left,bu=Ct(Ir).center,Er=En;var Mu=Math.sqrt(50),Tu=Math.sqrt(10),ku=Math.sqrt(2);function Ue(t,e,r){let n=(e-t)/Math.max(0,r),o=Math.floor(Math.log10(n)),i=n/Math.pow(10,o),a=i>=Mu?10:i>=Tu?5:i>=ku?2:1,s,f,u;return o<0?(u=Math.pow(10,-o)/a,s=Math.round(t*u),f=Math.round(e*u),s/u<t&&++s,f/u>e&&--f,u=-u):(u=Math.pow(10,o)*a,s=Math.round(t/u),f=Math.round(e/u),s*u<t&&++s,f*u>e&&--f),f<s&&.5<=r&&r<2?Ue(t,e,r*2):[s,f,u]}function Ye(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];let n=e<t,[o,i,a]=n?Ue(e,t,r):Ue(t,e,r);if(!(i>=o))return[];let s=i-o+1,f=new Array(s);if(n)if(a<0)for(let u=0;u<s;++u)f[u]=(i-u)/-a;else for(let u=0;u<s;++u)f[u]=(i-u)*a;else if(a<0)for(let u=0;u<s;++u)f[u]=(o+u)/-a;else for(let u=0;u<s;++u)f[u]=(o+u)*a;return f}function ue(t,e,r){return e=+e,t=+t,r=+r,Ue(t,e,r)[2]}function Wt(t,e,r){e=+e,t=+t,r=+r;let n=e<t,o=n?ue(e,t,r):ue(t,e,r);return(n?-1:1)*(o<0?1/-o:o)}function Fn(t){return t}var Fr=1,$e=2,zr=3,se=4,zn=1e-6;function Su(t){return"translate("+t+",0)"}function Cu(t){return"translate(0,"+t+")"}function Nu(t){return e=>+t(e)}function Au(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Du(){return!this.__axis}function Or(t,e){var r=[],n=null,o=null,i=6,a=6,s=3,f=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===Fr||t===se?-1:1,c=t===se||t===$e?"x":"y",h=t===Fr||t===zr?Su:Cu;function l(m){var x=n??(e.ticks?e.ticks.apply(e,r):e.domain()),g=o??(e.tickFormat?e.tickFormat.apply(e,r):Fn),d=Math.max(i,0)+s,y=e.range(),_=+y[0]+f,M=+y[y.length-1]+f,p=(e.bandwidth?Au:Nu)(e.copy(),f),b=m.selection?m.selection():m,v=b.selectAll(".domain").data([null]),S=b.selectAll(".tick").data(x,e).order(),C=S.exit(),z=S.enter().append("g").attr("class","tick"),N=S.select("line"),k=S.select("text");v=v.merge(v.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),S=S.merge(z),N=N.merge(z.append("line").attr("stroke","currentColor").attr(c+"2",u*i)),k=k.merge(z.append("text").attr("fill","currentColor").attr(c,u*d).attr("dy",t===Fr?"0em":t===zr?"0.71em":"0.32em")),m!==b&&(v=v.transition(m),S=S.transition(m),N=N.transition(m),k=k.transition(m),C=C.transition(m).attr("opacity",zn).attr("transform",function(F){return isFinite(F=p(F))?h(F+f):this.getAttribute("transform")}),z.attr("opacity",zn).attr("transform",function(F){var D=this.parentNode.__axis;return h((D&&isFinite(D=D(F))?D:p(F))+f)})),C.remove(),v.attr("d",t===se||t===$e?a?"M"+u*a+","+_+"H"+f+"V"+M+"H"+u*a:"M"+f+","+_+"V"+M:a?"M"+_+","+u*a+"V"+f+"H"+M+"V"+u*a:"M"+_+","+f+"H"+M),S.attr("opacity",1).attr("transform",function(F){return h(p(F)+f)}),N.attr(c+"2",u*i),k.attr(c,u*d).text(g),b.filter(Du).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===$e?"start":t===se?"end":"middle"),b.each(function(){this.__axis=p})}return l.scale=function(m){return arguments.length?(e=m,l):e},l.ticks=function(){return r=Array.from(arguments),l},l.tickArguments=function(m){return arguments.length?(r=m==null?[]:Array.from(m),l):r.slice()},l.tickValues=function(m){return arguments.length?(n=m==null?null:Array.from(m),l):n&&n.slice()},l.tickFormat=function(m){return arguments.length?(o=m,l):o},l.tickSize=function(m){return arguments.length?(i=a=+m,l):i},l.tickSizeInner=function(m){return arguments.length?(i=+m,l):i},l.tickSizeOuter=function(m){return arguments.length?(a=+m,l):a},l.tickPadding=function(m){return arguments.length?(s=+m,l):s},l.offset=function(m){return arguments.length?(f=+m,l):f},l}function Iu(t){return Or($e,t)}function Eu(t){return Or(zr,t)}function Fu(t){return Or(se,t)}function zu(){}function Nt(t){return t==null?zu:function(){return this.querySelector(t)}}function On(t){typeof t!="function"&&(t=Nt(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var i=e[o],a=i.length,s=n[o]=new Array(a),f,u,c=0;c<a;++c)(f=i[c])&&(u=t.call(f,f.__data__,c,i))&&("__data__"in f&&(u.__data__=f.__data__),s[c]=u);return new Y(n,this._parents)}function Ur(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Ou(){return[]}function fe(t){return t==null?Ou:function(){return this.querySelectorAll(t)}}function Uu(t){return function(){return Ur(t.apply(this,arguments))}}function Un(t){typeof t=="function"?t=Uu(t):t=fe(t);for(var e=this._groups,r=e.length,n=[],o=[],i=0;i<r;++i)for(var a=e[i],s=a.length,f,u=0;u<s;++u)(f=a[u])&&(n.push(t.call(f,f.__data__,u,a)),o.push(f));return new Y(n,o)}function le(t){return function(){return this.matches(t)}}function Re(t){return function(e){return e.matches(t)}}var Yu=Array.prototype.find;function $u(t){return function(){return Yu.call(this.children,t)}}function Ru(){return this.firstElementChild}function Yn(t){return this.select(t==null?Ru:$u(typeof t=="function"?t:Re(t)))}var Lu=Array.prototype.filter;function Pu(){return Array.from(this.children)}function Hu(t){return function(){return Lu.call(this.children,t)}}function $n(t){return this.selectAll(t==null?Pu:Hu(typeof t=="function"?t:Re(t)))}function Rn(t){typeof t!="function"&&(t=le(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var i=e[o],a=i.length,s=n[o]=[],f,u=0;u<a;++u)(f=i[u])&&t.call(f,f.__data__,u,i)&&s.push(f);return new Y(n,this._parents)}function Le(t){return new Array(t.length)}function Ln(){return new Y(this._enter||this._groups.map(Le),this._parents)}function ce(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ce.prototype={constructor:ce,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 Pn(t){return function(){return t}}function qu(t,e,r,n,o,i){for(var a=0,s,f=e.length,u=i.length;a<u;++a)(s=e[a])?(s.__data__=i[a],n[a]=s):r[a]=new ce(t,i[a]);for(;a<f;++a)(s=e[a])&&(o[a]=s)}function Bu(t,e,r,n,o,i,a){var s,f,u=new Map,c=e.length,h=i.length,l=new Array(c),m;for(s=0;s<c;++s)(f=e[s])&&(l[s]=m=a.call(f,f.__data__,s,e)+"",u.has(m)?o[s]=f:u.set(m,f));for(s=0;s<h;++s)m=a.call(t,i[s],s,i)+"",(f=u.get(m))?(n[s]=f,f.__data__=i[s],u.delete(m)):r[s]=new ce(t,i[s]);for(s=0;s<c;++s)(f=e[s])&&u.get(l[s])===f&&(o[s]=f)}function Xu(t){return t.__data__}function Hn(t,e){if(!arguments.length)return Array.from(this,Xu);var r=e?Bu:qu,n=this._parents,o=this._groups;typeof t!="function"&&(t=Pn(t));for(var i=o.length,a=new Array(i),s=new Array(i),f=new Array(i),u=0;u<i;++u){var c=n[u],h=o[u],l=h.length,m=Wu(t.call(c,c&&c.__data__,u,n)),x=m.length,g=s[u]=new Array(x),d=a[u]=new Array(x),y=f[u]=new Array(l);r(c,h,g,d,y,m,e);for(var _=0,M=0,p,b;_<x;++_)if(p=g[_]){for(_>=M&&(M=_+1);!(b=d[M])&&++M<x;);p._next=b||null}}return a=new Y(a,n),a._enter=s,a._exit=f,a}function Wu(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function qn(){return new Y(this._exit||this._groups.map(Le),this._parents)}function Bn(t,e,r){var n=this.enter(),o=this,i=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),r==null?i.remove():r(i),n&&o?n.merge(o).order():o}function Xn(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,o=r.length,i=n.length,a=Math.min(o,i),s=new Array(o),f=0;f<a;++f)for(var u=r[f],c=n[f],h=u.length,l=s[f]=new Array(h),m,x=0;x<h;++x)(m=u[x]||c[x])&&(l[x]=m);for(;f<o;++f)s[f]=r[f];return new Y(s,this._parents)}function Wn(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n=t[e],o=n.length-1,i=n[o],a;--o>=0;)(a=n[o])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function Vn(t){t||(t=Vu);function e(h,l){return h&&l?t(h.__data__,l.__data__):!h-!l}for(var r=this._groups,n=r.length,o=new Array(n),i=0;i<n;++i){for(var a=r[i],s=a.length,f=o[i]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(f[c]=u);f.sort(e)}return new Y(o,this._parents).order()}function Vu(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Zn(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Qn(){return Array.from(this)}function Gn(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],o=0,i=n.length;o<i;++o){var a=n[o];if(a)return a}return null}function Kn(){let t=0;for(let e of this)++t;return t}function Jn(){return!this.node()}function jn(t){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var o=e[r],i=0,a=o.length,s;i<a;++i)(s=o[i])&&t.call(s,s.__data__,i,o);return this}var Pe="http://www.w3.org/1999/xhtml",Yr={svg:"http://www.w3.org/2000/svg",xhtml:Pe,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function lt(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),Yr.hasOwnProperty(e)?{space:Yr[e],local:t}:t}function Zu(t){return function(){this.removeAttribute(t)}}function Qu(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Gu(t,e){return function(){this.setAttribute(t,e)}}function Ku(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ju(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function ju(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function to(t,e){var r=lt(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((e==null?r.local?Qu:Zu:typeof e=="function"?r.local?ju:Ju:r.local?Ku:Gu)(r,e))}function He(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ts(t){return function(){this.style.removeProperty(t)}}function es(t,e,r){return function(){this.style.setProperty(t,e,r)}}function rs(t,e,r){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function eo(t,e,r){return arguments.length>1?this.each((e==null?ts:typeof e=="function"?rs:es)(t,e,r??"")):yt(this.node(),t)}function yt(t,e){return t.style.getPropertyValue(e)||He(t).getComputedStyle(t,null).getPropertyValue(e)}function ns(t){return function(){delete this[t]}}function os(t,e){return function(){this[t]=e}}function is(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function ro(t,e){return arguments.length>1?this.each((e==null?ns:typeof e=="function"?is:os)(t,e)):this.node()[t]}function no(t){return t.trim().split(/^|\s+/)}function $r(t){return t.classList||new oo(t)}function oo(t){this._node=t,this._names=no(t.getAttribute("class")||"")}oo.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 io(t,e){for(var r=$r(t),n=-1,o=e.length;++n<o;)r.add(e[n])}function ao(t,e){for(var r=$r(t),n=-1,o=e.length;++n<o;)r.remove(e[n])}function as(t){return function(){io(this,t)}}function us(t){return function(){ao(this,t)}}function ss(t,e){return function(){(e.apply(this,arguments)?io:ao)(this,t)}}function uo(t,e){var r=no(t+"");if(arguments.length<2){for(var n=$r(this.node()),o=-1,i=r.length;++o<i;)if(!n.contains(r[o]))return!1;return!0}return this.each((typeof e=="function"?ss:e?as:us)(r,e))}function fs(){this.textContent=""}function ls(t){return function(){this.textContent=t}}function cs(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function so(t){return arguments.length?this.each(t==null?fs:(typeof t=="function"?cs:ls)(t)):this.node().textContent}function hs(){this.innerHTML=""}function ms(t){return function(){this.innerHTML=t}}function ps(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function fo(t){return arguments.length?this.each(t==null?hs:(typeof t=="function"?ps:ms)(t)):this.node().innerHTML}function ds(){this.nextSibling&&this.parentNode.appendChild(this)}function lo(){return this.each(ds)}function gs(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function co(){return this.each(gs)}function xs(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Pe&&e.documentElement.namespaceURI===Pe?e.createElement(t):e.createElementNS(r,t)}}function ys(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function qe(t){var e=lt(t);return(e.local?ys:xs)(e)}function ho(t){var e=typeof t=="function"?t:qe(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function vs(){return null}function mo(t,e){var r=typeof t=="function"?t:qe(t),n=e==null?vs:typeof e=="function"?e:Nt(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function ws(){var t=this.parentNode;t&&t.removeChild(this)}function po(){return this.each(ws)}function _s(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function bs(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function go(t){return this.select(t?bs:_s)}function xo(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ms(t){return function(e){t.call(this,e,this.__data__)}}function Ts(t){return t.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");return n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function ks(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,o=e.length,i;r<o;++r)i=e[r],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++n]=i;++n?e.length=n:delete this.__on}}}function Ss(t,e,r){return function(){var n=this.__on,o,i=Ms(e);if(n){for(var a=0,s=n.length;a<s;++a)if((o=n[a]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=r),o.value=e;return}}this.addEventListener(t.type,i,r),o={type:t.type,name:t.name,value:e,listener:i,options:r},n?n.push(o):this.__on=[o]}}function yo(t,e,r){var n=Ts(t+""),o,i=n.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var f=0,u=s.length,c;f<u;++f)for(o=0,c=s[f];o<i;++o)if((a=n[o]).type===c.type&&a.name===c.name)return c.value}return}for(s=e?Ss:ks,o=0;o<i;++o)this.each(s(n[o],e,r));return this}function vo(t,e,r){var n=He(t),o=n.CustomEvent;typeof o=="function"?o=new o(e,r):(o=n.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function Cs(t,e){return function(){return vo(this,t,e)}}function Ns(t,e){return function(){return vo(this,t,e.apply(this,arguments))}}function wo(t,e){return this.each((typeof e=="function"?Ns:Cs)(t,e))}function*_o(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],o=0,i=n.length,a;o<i;++o)(a=n[o])&&(yield a)}var Rr=[null];function Y(t,e){this._groups=t,this._parents=e}function bo(){return new Y([[document.documentElement]],Rr)}function As(){return this}Y.prototype=bo.prototype={constructor:Y,select:On,selectAll:Un,selectChild:Yn,selectChildren:$n,filter:Rn,data:Hn,enter:Ln,exit:qn,join:Bn,merge:Xn,selection:As,order:Wn,sort:Vn,call:Zn,nodes:Qn,node:Gn,size:Kn,empty:Jn,each:jn,attr:to,style:eo,property:ro,classed:uo,text:so,html:fo,raise:lo,lower:co,append:ho,insert:mo,remove:po,clone:go,datum:xo,on:yo,dispatch:wo,[Symbol.iterator]:_o};var ct=bo;function At(t){return typeof t=="string"?new Y([[document.querySelector(t)]],[document.documentElement]):new Y([[t]],Rr)}function Mo(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Be(t,e){if(t=Mo(t),e===void 0&&(e=t.currentTarget),e){var r=e.ownerSVGElement||e;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}function Xe(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function Lr(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function pe(){}var he=.7,Ze=1/he,Vt="\\s*([+-]?\\d+)\\s*",me="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ot="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ds=/^#([0-9a-f]{3,8})$/,Is=new RegExp(`^rgb\\(${Vt},${Vt},${Vt}\\)$`),Es=new RegExp(`^rgb\\(${ot},${ot},${ot}\\)$`),Fs=new RegExp(`^rgba\\(${Vt},${Vt},${Vt},${me}\\)$`),zs=new RegExp(`^rgba\\(${ot},${ot},${ot},${me}\\)$`),Os=new RegExp(`^hsl\\(${me},${ot},${ot}\\)$`),Us=new RegExp(`^hsla\\(${me},${ot},${ot},${me}\\)$`),To={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Xe(pe,tt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ko,formatHex:ko,formatHex8:Ys,formatHsl:$s,formatRgb:So,toString:So});function ko(){return this.rgb().formatHex()}function Ys(){return this.rgb().formatHex8()}function $s(){return Eo(this).formatHsl()}function So(){return this.rgb().formatRgb()}function tt(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Ds.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?Co(e):r===3?new Z(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?We(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?We(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=Is.exec(t))?new Z(e[1],e[2],e[3],1):(e=Es.exec(t))?new Z(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Fs.exec(t))?We(e[1],e[2],e[3],e[4]):(e=zs.exec(t))?We(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Os.exec(t))?Do(e[1],e[2]/100,e[3]/100,1):(e=Us.exec(t))?Do(e[1],e[2]/100,e[3]/100,e[4]):To.hasOwnProperty(t)?Co(To[t]):t==="transparent"?new Z(NaN,NaN,NaN,0):null}function Co(t){return new Z(t>>16&255,t>>8&255,t&255,1)}function We(t,e,r,n){return n<=0&&(t=e=r=NaN),new Z(t,e,r,n)}function Rs(t){return t instanceof pe||(t=tt(t)),t?(t=t.rgb(),new Z(t.r,t.g,t.b,t.opacity)):new Z}function Zt(t,e,r,n){return arguments.length===1?Rs(t):new Z(t,e,r,n??1)}function Z(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}Xe(Z,Zt,Lr(pe,{brighter(t){return t=t==null?Ze:Math.pow(Ze,t),new Z(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?he:Math.pow(he,t),new Z(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Z(It(this.r),It(this.g),It(this.b),Qe(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:No,formatHex:No,formatHex8:Ls,formatRgb:Ao,toString:Ao}));function No(){return`#${Dt(this.r)}${Dt(this.g)}${Dt(this.b)}`}function Ls(){return`#${Dt(this.r)}${Dt(this.g)}${Dt(this.b)}${Dt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ao(){let t=Qe(this.opacity);return`${t===1?"rgb(":"rgba("}${It(this.r)}, ${It(this.g)}, ${It(this.b)}${t===1?")":`, ${t})`}`}function Qe(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function It(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Dt(t){return t=It(t),(t<16?"0":"")+t.toString(16)}function Do(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new j(t,e,r,n)}function Eo(t){if(t instanceof j)return new j(t.h,t.s,t.l,t.opacity);if(t instanceof pe||(t=tt(t)),!t)return new j;if(t instanceof j)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),i=Math.max(e,r,n),a=NaN,s=i-o,f=(i+o)/2;return s?(e===i?a=(r-n)/s+(r<n)*6:r===i?a=(n-e)/s+2:a=(e-r)/s+4,s/=f<.5?i+o:2-i-o,a*=60):s=f>0&&f<1?0:a,new j(a,s,f,t.opacity)}function Fo(t,e,r,n){return arguments.length===1?Eo(t):new j(t,e,r,n??1)}function j(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}Xe(j,Fo,Lr(pe,{brighter(t){return t=t==null?Ze:Math.pow(Ze,t),new j(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?he:Math.pow(he,t),new j(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,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new Z(Pr(t>=240?t-240:t+120,o,n),Pr(t,o,n),Pr(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new j(Io(this.h),Ve(this.s),Ve(this.l),Qe(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(){let t=Qe(this.opacity);return`${t===1?"hsl(":"hsla("}${Io(this.h)}, ${Ve(this.s)*100}%, ${Ve(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Io(t){return t=(t||0)%360,t<0?t+360:t}function Ve(t){return Math.max(0,Math.min(1,t||0))}function Pr(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function Hr(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+a*o)/6}function zo(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,s=n<e-1?t[n+2]:2*i-o;return Hr((r-n/e)*e,a,o,i,s)}}function Oo(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),o=t[(n+e-1)%e],i=t[n%e],a=t[(n+1)%e],s=t[(n+2)%e];return Hr((r-n/e)*e,o,i,a,s)}}var de=t=>()=>t;function Ps(t,e){return function(r){return t+r*e}}function Hs(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function Uo(t){return(t=+t)==1?Ge:function(e,r){return r-e?Hs(e,r,t):de(isNaN(e)?r:e)}}function Ge(t,e){var r=e-t;return r?Ps(t,r):de(isNaN(t)?e:t)}var Et=(function t(e){var r=Uo(e);function n(o,i){var a=r((o=Zt(o)).r,(i=Zt(i)).r),s=r(o.g,i.g),f=r(o.b,i.b),u=Ge(o.opacity,i.opacity);return function(c){return o.r=a(c),o.g=s(c),o.b=f(c),o.opacity=u(c),o+""}}return n.gamma=t,n})(1);function Yo(t){return function(e){var r=e.length,n=new Array(r),o=new Array(r),i=new Array(r),a,s;for(a=0;a<r;++a)s=Zt(e[a]),n[a]=s.r||0,o[a]=s.g||0,i[a]=s.b||0;return n=t(n),o=t(o),i=t(i),s.opacity=1,function(f){return s.r=n(f),s.g=o(f),s.b=i(f),s+""}}}var qs=Yo(zo),Bs=Yo(Oo);function $o(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),o;return function(i){for(o=0;o<r;++o)n[o]=t[o]*(1-i)+e[o]*i;return n}}function Ro(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Lo(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,o=new Array(n),i=new Array(r),a;for(a=0;a<n;++a)o[a]=ht(t[a],e[a]);for(;a<r;++a)i[a]=e[a];return function(s){for(a=0;a<n;++a)i[a]=o[a](s);return i}}function Po(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function H(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ho(t,e){var r={},n={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?r[o]=ht(t[o],e[o]):n[o]=e[o];return function(i){for(o in r)n[o]=r[o](i);return n}}var Br=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qr=new RegExp(Br.source,"g");function Xs(t){return function(){return t}}function Ws(t){return function(e){return t(e)+""}}function ge(t,e){var r=Br.lastIndex=qr.lastIndex=0,n,o,i,a=-1,s=[],f=[];for(t=t+"",e=e+"";(n=Br.exec(t))&&(o=qr.exec(e));)(i=o.index)>r&&(i=e.slice(r,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,f.push({i:a,x:H(n,o)})),r=qr.lastIndex;return r<e.length&&(i=e.slice(r),s[a]?s[a]+=i:s[++a]=i),s.length<2?f[0]?Ws(f[0].x):Xs(e):(e=f.length,function(u){for(var c=0,h;c<e;++c)s[(h=f[c]).i]=h.x(u);return s.join("")})}function ht(t,e){var r=typeof e,n;return e==null||r==="boolean"?de(e):(r==="number"?H:r==="string"?(n=tt(e))?(e=n,Et):ge:e instanceof tt?Et:e instanceof Date?Po:Ro(e)?$o:Array.isArray(e)?Lo:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Ho:H)(t,e)}function xe(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}var qo=180/Math.PI,Ke={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xr(t,e,r,n,o,i){var a,s,f;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(f=t*r+e*n)&&(r-=t*f,n-=e*f),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,f/=s),t*n<e*r&&(t=-t,e=-e,f=-f,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*qo,skewX:Math.atan(f)*qo,scaleX:a,scaleY:s}}var Je;function Bo(t){let e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ke:Xr(e.a,e.b,e.c,e.d,e.e,e.f)}function Xo(t){return t==null?Ke:(Je||(Je=document.createElementNS("http://www.w3.org/2000/svg","g")),Je.setAttribute("transform",t),(t=Je.transform.baseVal.consolidate())?(t=t.matrix,Xr(t.a,t.b,t.c,t.d,t.e,t.f)):Ke)}function Wo(t,e,r,n){function o(u){return u.length?u.pop()+" ":""}function i(u,c,h,l,m,x){if(u!==h||c!==l){var g=m.push("translate(",null,e,null,r);x.push({i:g-4,x:H(u,h)},{i:g-2,x:H(c,l)})}else(h||l)&&m.push("translate("+h+e+l+r)}function a(u,c,h,l){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),l.push({i:h.push(o(h)+"rotate(",null,n)-2,x:H(u,c)})):c&&h.push(o(h)+"rotate("+c+n)}function s(u,c,h,l){u!==c?l.push({i:h.push(o(h)+"skewX(",null,n)-2,x:H(u,c)}):c&&h.push(o(h)+"skewX("+c+n)}function f(u,c,h,l,m,x){if(u!==h||c!==l){var g=m.push(o(m)+"scale(",null,",",null,")");x.push({i:g-4,x:H(u,h)},{i:g-2,x:H(c,l)})}else(h!==1||l!==1)&&m.push(o(m)+"scale("+h+","+l+")")}return function(u,c){var h=[],l=[];return u=t(u),c=t(c),i(u.translateX,u.translateY,c.translateX,c.translateY,h,l),a(u.rotate,c.rotate,h,l),s(u.skewX,c.skewX,h,l),f(u.scaleX,u.scaleY,c.scaleX,c.scaleY,h,l),u=c=null,function(m){for(var x=-1,g=l.length,d;++x<g;)h[(d=l[x]).i]=d.x(m);return h.join("")}}}var Wr=Wo(Bo,"px, ","px)","deg)"),Vr=Wo(Xo,", ",")",")");function Vo(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Ft(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function it(t){return t=Ft(Math.abs(t)),t?t[1]:NaN}function Zo(t,e){return function(r,n){for(var o=r.length,i=[],a=0,s=t[0],f=0;o>0&&s>0&&(f+s+1>n&&(s=Math.max(1,n-f)),i.push(r.substring(o-=s,o+s)),!((f+=s+1)>n));)s=t[a=(a+1)%t.length];return i.reverse().join(e)}}function Qo(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var Vs=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vt(t){if(!(e=Vs.exec(t)))throw new Error("invalid format: "+t);var e;return new je({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}vt.prototype=je.prototype;function je(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}je.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Go(t){t:for(var e=t.length,r=1,n=-1,o;r<e;++r)switch(t[r]){case".":n=o=r;break;case"0":n===0&&(n=r),o=r;break;default:if(!+t[r])break t;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(o+1):t}var Zr;function Ko(t,e){var r=Ft(t,e);if(!r)return t+"";var n=r[0],o=r[1],i=o-(Zr=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,a=n.length;return i===a?n:i>a?n+new Array(i-a+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Ft(t,Math.max(0,e+i-1))[0]}function Qr(t,e){var r=Ft(t,e);if(!r)return t+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}var Gr={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Vo,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Qr(t*100,e),r:Qr,s:Ko,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Kr(t){return t}var Jo=Array.prototype.map,jo=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function ti(t){var e=t.grouping===void 0||t.thousands===void 0?Kr:Zo(Jo.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",o=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?Kr:Qo(Jo.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"\u2212":t.minus+"",f=t.nan===void 0?"NaN":t.nan+"";function u(h){h=vt(h);var l=h.fill,m=h.align,x=h.sign,g=h.symbol,d=h.zero,y=h.width,_=h.comma,M=h.precision,p=h.trim,b=h.type;b==="n"?(_=!0,b="g"):Gr[b]||(M===void 0&&(M=12),p=!0,b="g"),(d||l==="0"&&m==="=")&&(d=!0,l="0",m="=");var v=g==="$"?r:g==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",S=g==="$"?n:/[%p]/.test(b)?a:"",C=Gr[b],z=/[defgprs%]/.test(b);M=M===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function N(k){var F=v,D=S,Q,Xt,nt;if(b==="c")D=C(k)+D,k="";else{k=+k;var ft=k<0||1/k<0;if(k=isNaN(k)?f:C(Math.abs(k),M),p&&(k=Go(k)),ft&&+k==0&&x!=="+"&&(ft=!1),F=(ft?x==="("?x:s:x==="-"||x==="("?"":x)+F,D=(b==="s"?jo[8+Zr/3]:"")+D+(ft&&x==="("?")":""),z){for(Q=-1,Xt=k.length;++Q<Xt;)if(nt=k.charCodeAt(Q),48>nt||nt>57){D=(nt===46?o+k.slice(Q+1):k.slice(Q))+D,k=k.slice(0,Q);break}}}_&&!d&&(k=e(k,1/0));var xt=F.length+k.length+D.length,W=xt<y?new Array(y-xt+1).join(l):"";switch(_&&d&&(k=e(W+k,W.length?y-D.length:1/0),W=""),m){case"<":k=F+k+D+W;break;case"=":k=F+W+k+D;break;case"^":k=W.slice(0,xt=W.length>>1)+F+k+D+W.slice(xt);break;default:k=W+F+k+D;break}return i(k)}return N.toString=function(){return h+""},N}function c(h,l){var m=u((h=vt(h),h.type="f",h)),x=Math.max(-8,Math.min(8,Math.floor(it(l)/3)))*3,g=Math.pow(10,-x),d=jo[8+x/3];return function(y){return m(g*y)+d}}return{format:u,formatPrefix:c}}var tr,er,rr;Jr({thousands:",",grouping:[3],currency:["$",""]});function Jr(t){return tr=ti(t),er=tr.format,rr=tr.formatPrefix,tr}function jr(t){return Math.max(0,-it(Math.abs(t)))}function tn(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(it(e)/3)))*3-it(Math.abs(t)))}function en(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,it(e)-it(t))+1}function Zs(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function ei(){return this.eachAfter(Zs)}function ri(t,e){let r=-1;for(let n of this)t.call(e,n,++r,this);return this}function ni(t,e){for(var r=this,n=[r],o,i,a=-1;r=n.pop();)if(t.call(e,r,++a,this),o=r.children)for(i=o.length-1;i>=0;--i)n.push(o[i]);return this}function oi(t,e){for(var r=this,n=[r],o=[],i,a,s,f=-1;r=n.pop();)if(o.push(r),i=r.children)for(a=0,s=i.length;a<s;++a)n.push(i[a]);for(;r=o.pop();)t.call(e,r,++f,this);return this}function ii(t,e){let r=-1;for(let n of this)if(t.call(e,n,++r,this))return n}function ai(t){return this.eachAfter(function(e){for(var r=+t(e.data)||0,n=e.children,o=n&&n.length;--o>=0;)r+=n[o].value;e.value=r})}function ui(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function si(t){for(var e=this,r=Qs(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var o=n.length;t!==r;)n.splice(o,0,t),t=t.parent;return n}function Qs(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),o=null;for(t=r.pop(),e=n.pop();t===e;)o=t,t=r.pop(),e=n.pop();return o}function fi(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function li(){return Array.from(this)}function ci(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function hi(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*mi(){var t=this,e,r=[t],n,o,i;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(o=0,i=n.length;o<i;++o)r.push(n[o]);while(r.length)}function nr(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=Js)):e===void 0&&(e=Ks);for(var r=new ye(t),n,o=[r],i,a,s,f;n=o.pop();)if((a=e(n.data))&&(f=(a=Array.from(a)).length))for(n.children=a,s=f-1;s>=0;--s)o.push(i=a[s]=new ye(a[s])),i.parent=n,i.depth=n.depth+1;return r.eachBefore(tf)}function Gs(){return nr(this).eachBefore(js)}function Ks(t){return t.children}function Js(t){return Array.isArray(t)?t[1]:null}function js(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function tf(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function ye(t){this.data=t,this.depth=this.height=0,this.parent=null}ye.prototype=nr.prototype={constructor:ye,count:ei,each:ri,eachAfter:oi,eachBefore:ni,find:ii,sum:ai,sort:ui,path:si,ancestors:fi,descendants:li,leaves:ci,links:hi,copy:Gs,[Symbol.iterator]:mi};function pi(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function di(t,e,r,n,o){for(var i=t.children,a,s=-1,f=i.length,u=t.value&&(n-e)/t.value;++s<f;)a=i[s],a.y0=r,a.y1=o,a.x0=e,a.x1=e+=a.value*u}function gi(t,e,r,n,o){for(var i=t.children,a,s=-1,f=i.length,u=t.value&&(o-r)/t.value;++s<f;)a=i[s],a.x0=e,a.x1=n,a.y0=r,a.y1=r+=a.value*u}var ef=(1+Math.sqrt(5))/2;function rf(t,e,r,n,o,i){for(var a=[],s=e.children,f,u,c=0,h=0,l=s.length,m,x,g=e.value,d,y,_,M,p,b,v;c<l;){m=o-r,x=i-n;do d=s[h++].value;while(!d&&h<l);for(y=_=d,b=Math.max(x/m,m/x)/(g*t),v=d*d*b,p=Math.max(_/v,v/y);h<l;++h){if(d+=u=s[h].value,u<y&&(y=u),u>_&&(_=u),v=d*d*b,M=Math.max(_/v,v/y),M>p){d-=u;break}p=M}a.push(f={value:d,dice:m<x,children:s.slice(c,h)}),f.dice?di(f,r,n,o,g?n+=x*d/g:i):gi(f,r,n,g?r+=m*d/g:o,i),g-=d,c=h}return a}var xi=(function t(e){function r(n,o,i,a,s){rf(e,n,o,i,a,s)}return r.ratio=function(n){return t((n=+n)>1?n:1)},r})(ef);function yi(t){if(typeof t!="function")throw new Error;return t}function Qt(){return 0}function Gt(t){return function(){return t}}function nf(){var t=xi,e=!1,r=1,n=1,o=[0],i=Qt,a=Qt,s=Qt,f=Qt,u=Qt;function c(l){return l.x0=l.y0=0,l.x1=r,l.y1=n,l.eachBefore(h),o=[0],e&&l.eachBefore(pi),l}function h(l){var m=o[l.depth],x=l.x0+m,g=l.y0+m,d=l.x1-m,y=l.y1-m;d<x&&(x=d=(x+d)/2),y<g&&(g=y=(g+y)/2),l.x0=x,l.y0=g,l.x1=d,l.y1=y,l.children&&(m=o[l.depth+1]=i(l)/2,x+=u(l)-m,g+=a(l)-m,d-=s(l)-m,y-=f(l)-m,d<x&&(x=d=(x+d)/2),y<g&&(g=y=(g+y)/2),t(l,x,g,d,y))}return c.round=function(l){return arguments.length?(e=!!l,c):e},c.size=function(l){return arguments.length?(r=+l[0],n=+l[1],c):[r,n]},c.tile=function(l){return arguments.length?(t=yi(l),c):t},c.padding=function(l){return arguments.length?c.paddingInner(l).paddingOuter(l):c.paddingInner()},c.paddingInner=function(l){return arguments.length?(i=typeof l=="function"?l:Gt(+l),c):i},c.paddingOuter=function(l){return arguments.length?c.paddingTop(l).paddingRight(l).paddingBottom(l).paddingLeft(l):c.paddingTop()},c.paddingTop=function(l){return arguments.length?(a=typeof l=="function"?l:Gt(+l),c):a},c.paddingRight=function(l){return arguments.length?(s=typeof l=="function"?l:Gt(+l),c):s},c.paddingBottom=function(l){return arguments.length?(f=typeof l=="function"?l:Gt(+l),c):f},c.paddingLeft=function(l){return arguments.length?(u=typeof l=="function"?l:Gt(+l),c):u},c}function rn(t){return function(){return t}}function nn(t){return+t}var vi=[0,1];function mt(t){return t}function on(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:rn(isNaN(e)?NaN:.5)}function of(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function af(t,e,r){var n=t[0],o=t[1],i=e[0],a=e[1];return o<n?(n=on(o,n),i=r(a,i)):(n=on(n,o),i=r(i,a)),function(s){return i(n(s))}}function uf(t,e,r){var n=Math.min(t.length,e.length)-1,o=new Array(n),i=new Array(n),a=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<n;)o[a]=on(t[a],t[a+1]),i[a]=r(e[a],e[a+1]);return function(s){var f=Er(t,s,1,n)-1;return i[f](o[f](s))}}function or(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function sf(){var t=vi,e=vi,r=ht,n,o,i,a=mt,s,f,u;function c(){var l=Math.min(t.length,e.length);return a!==mt&&(a=of(t[0],t[l-1])),s=l>2?uf:af,f=u=null,h}function h(l){return l==null||isNaN(l=+l)?i:(f||(f=s(t.map(n),e,r)))(n(a(l)))}return h.invert=function(l){return a(o((u||(u=s(e,t.map(n),H)))(l)))},h.domain=function(l){return arguments.length?(t=Array.from(l,nn),c()):t.slice()},h.range=function(l){return arguments.length?(e=Array.from(l),c()):e.slice()},h.rangeRound=function(l){return e=Array.from(l),r=xe,c()},h.clamp=function(l){return arguments.length?(a=l?!0:mt,c()):a!==mt},h.interpolate=function(l){return arguments.length?(r=l,c()):r},h.unknown=function(l){return arguments.length?(i=l,h):i},function(l,m){return n=l,o=m,c()}}function ve(){return sf()(mt,mt)}function ir(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function wi(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}function an(t,e,r,n){var o=Wt(t,e,r),i;switch(n=vt(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(i=tn(o,a))&&(n.precision=i),rr(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=en(o,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=jr(o))&&(n.precision=i-(n.type==="%")*2);break}}return er(n)}function un(t){var e=t.domain;return t.ticks=function(r){var n=e();return Ye(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var o=e();return an(o[0],o[o.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),o=0,i=n.length-1,a=n[o],s=n[i],f,u,c=10;for(s<a&&(u=a,a=s,s=u,u=o,o=i,i=u);c-- >0;){if(u=ue(a,s,r),u===f)return n[o]=a,n[i]=s,e(n);if(u>0)a=Math.floor(a/u)*u,s=Math.ceil(s/u)*u;else if(u<0)a=Math.ceil(a*u)/u,s=Math.floor(s*u)/u;else break;f=u}return t},t}function sn(){var t=ve();return t.copy=function(){return or(t,sn())},ir.apply(t,arguments),un(t)}var fn=new Date,ln=new Date;function O(t,e,r,n){function o(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(t(i=new Date(+i)),i),o.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),o.round=i=>{let a=o(i),s=o.ceil(i);return i-a<s-i?a:s},o.offset=(i,a)=>(e(i=new Date(+i),a==null?1:Math.floor(a)),i),o.range=(i,a,s)=>{let f=[];if(i=o.ceil(i),s=s==null?1:Math.floor(s),!(i<a)||!(s>0))return f;let u;do f.push(u=new Date(+i)),e(i,s),t(i);while(u<i&&i<a);return f},o.filter=i=>O(a=>{if(a>=a)for(;t(a),!i(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!i(a););else for(;--s>=0;)for(;e(a,1),!i(a););}),r&&(o.count=(i,a)=>(fn.setTime(+i),ln.setTime(+a),t(fn),t(ln),Math.floor(r(fn,ln))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(n?a=>n(a)%i===0:a=>o.count(0,a)%i===0):o)),o}var we=O(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);we.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?O(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):we);var vg=we.range;var at=O(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),_i=at.range;var Kt=O(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),ff=Kt.range,ar=O(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),lf=ar.range;var Jt=O(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),cf=Jt.range,ur=O(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),hf=ur.range;var pt=O(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),mf=pt.range,be=O(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),pf=be.range,sr=O(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),df=sr.range;function Ut(t){return O(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var dt=Ut(0),jt=Ut(1),Mi=Ut(2),Ti=Ut(3),wt=Ut(4),ki=Ut(5),Si=Ut(6),Ci=dt.range,gf=jt.range,xf=Mi.range,yf=Ti.range,vf=wt.range,wf=ki.range,_f=Si.range;function Yt(t){return O(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var $t=Yt(0),te=Yt(1),Ni=Yt(2),Ai=Yt(3),_t=Yt(4),Di=Yt(5),Ii=Yt(6),Ei=$t.range,bf=te.range,Mf=Ni.range,Tf=Ai.range,kf=_t.range,Sf=Di.range,Cf=Ii.range;var ee=O(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),Nf=ee.range,fr=O(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),Af=fr.range;var J=O(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());J.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:O(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});var Df=J.range,et=O(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());et.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:O(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});var If=et.range;function zi(t,e,r,n,o,i){let a=[[at,1,1e3],[at,5,5*1e3],[at,15,15*1e3],[at,30,30*1e3],[i,1,6e4],[i,5,5*6e4],[i,15,15*6e4],[i,30,30*6e4],[o,1,36e5],[o,3,3*36e5],[o,6,6*36e5],[o,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function s(u,c,h){let l=c<u;l&&([u,c]=[c,u]);let m=h&&typeof h.range=="function"?h:f(u,c,h),x=m?m.range(u,+c+1):[];return l?x.reverse():x}function f(u,c,h){let l=Math.abs(c-u)/h,m=Ct(([,,d])=>d).right(a,l);if(m===a.length)return t.every(Wt(u/31536e6,c/31536e6,h));if(m===0)return we.every(Math.max(Wt(u,c,h),1));let[x,g]=a[l/a[m-1][2]<a[m][2]/l?m-1:m];return x.every(g)}return[s,f]}var[Ff,zf]=zi(et,fr,$t,sr,ur,ar),[cn,hn]=zi(J,ee,dt,pt,Jt,Kt);function mn(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function pn(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Me(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function dn(t){var e=t.dateTime,r=t.date,n=t.time,o=t.periods,i=t.days,a=t.shortDays,s=t.months,f=t.shortMonths,u=Te(o),c=ke(o),h=Te(i),l=ke(i),m=Te(a),x=ke(a),g=Te(s),d=ke(s),y=Te(f),_=ke(f),M={a:ft,A:xt,b:W,B:ae,c:null,d:Li,e:Li,f:nl,g:ml,G:dl,H:tl,I:el,j:rl,L:Xi,m:ol,M:il,p:hu,q:mu,Q:qi,s:Bi,S:al,u:ul,U:sl,V:fl,w:ll,W:cl,x:null,X:null,y:hl,Y:pl,Z:gl,"%":Hi},p={a:pu,A:du,b:gu,B:xu,c:null,d:Pi,e:Pi,f:wl,g:Dl,G:El,H:xl,I:yl,j:vl,L:Vi,m:_l,M:bl,p:yu,q:vu,Q:qi,s:Bi,S:Ml,u:Tl,U:kl,V:Sl,w:Cl,W:Nl,x:null,X:null,y:Al,Y:Il,Z:Fl,"%":Hi},b={a:N,A:k,b:F,B:D,c:Q,d:$i,e:$i,f:Gf,g:Yi,G:Ui,H:Ri,I:Ri,j:Wf,L:Qf,m:Xf,M:Vf,p:z,q:Bf,Q:Jf,s:jf,S:Zf,u:Rf,U:Lf,V:Pf,w:$f,W:Hf,x:Xt,X:nt,y:Yi,Y:Ui,Z:qf,"%":Kf};M.x=v(r,M),M.X=v(n,M),M.c=v(e,M),p.x=v(r,p),p.X=v(n,p),p.c=v(e,p);function v(T,A){return function(I){var w=[],V=-1,U=0,G=T.length,K,kt,Nn;for(I instanceof Date||(I=new Date(+I));++V<G;)T.charCodeAt(V)===37&&(w.push(T.slice(U,V)),(kt=Oi[K=T.charAt(++V)])!=null?K=T.charAt(++V):kt=K==="e"?" ":"0",(Nn=A[K])&&(K=Nn(I,kt)),w.push(K),U=V+1);return w.push(T.slice(U,V)),w.join("")}}function S(T,A){return function(I){var w=Me(1900,void 0,1),V=C(w,T,I+="",0),U,G;if(V!=I.length)return null;if("Q"in w)return new Date(w.Q);if("s"in w)return new Date(w.s*1e3+("L"in w?w.L:0));if(A&&!("Z"in w)&&(w.Z=0),"p"in w&&(w.H=w.H%12+w.p*12),w.m===void 0&&(w.m="q"in w?w.q:0),"V"in w){if(w.V<1||w.V>53)return null;"w"in w||(w.w=1),"Z"in w?(U=pn(Me(w.y,0,1)),G=U.getUTCDay(),U=G>4||G===0?te.ceil(U):te(U),U=be.offset(U,(w.V-1)*7),w.y=U.getUTCFullYear(),w.m=U.getUTCMonth(),w.d=U.getUTCDate()+(w.w+6)%7):(U=mn(Me(w.y,0,1)),G=U.getDay(),U=G>4||G===0?jt.ceil(U):jt(U),U=pt.offset(U,(w.V-1)*7),w.y=U.getFullYear(),w.m=U.getMonth(),w.d=U.getDate()+(w.w+6)%7)}else("W"in w||"U"in w)&&("w"in w||(w.w="u"in w?w.u%7:"W"in w?1:0),G="Z"in w?pn(Me(w.y,0,1)).getUTCDay():mn(Me(w.y,0,1)).getDay(),w.m=0,w.d="W"in w?(w.w+6)%7+w.W*7-(G+5)%7:w.w+w.U*7-(G+6)%7);return"Z"in w?(w.H+=w.Z/100|0,w.M+=w.Z%100,pn(w)):mn(w)}}function C(T,A,I,w){for(var V=0,U=A.length,G=I.length,K,kt;V<U;){if(w>=G)return-1;if(K=A.charCodeAt(V++),K===37){if(K=A.charAt(V++),kt=b[K in Oi?A.charAt(V++):K],!kt||(w=kt(T,I,w))<0)return-1}else if(K!=I.charCodeAt(w++))return-1}return w}function z(T,A,I){var w=u.exec(A.slice(I));return w?(T.p=c.get(w[0].toLowerCase()),I+w[0].length):-1}function N(T,A,I){var w=m.exec(A.slice(I));return w?(T.w=x.get(w[0].toLowerCase()),I+w[0].length):-1}function k(T,A,I){var w=h.exec(A.slice(I));return w?(T.w=l.get(w[0].toLowerCase()),I+w[0].length):-1}function F(T,A,I){var w=y.exec(A.slice(I));return w?(T.m=_.get(w[0].toLowerCase()),I+w[0].length):-1}function D(T,A,I){var w=g.exec(A.slice(I));return w?(T.m=d.get(w[0].toLowerCase()),I+w[0].length):-1}function Q(T,A,I){return C(T,e,A,I)}function Xt(T,A,I){return C(T,r,A,I)}function nt(T,A,I){return C(T,n,A,I)}function ft(T){return a[T.getDay()]}function xt(T){return i[T.getDay()]}function W(T){return f[T.getMonth()]}function ae(T){return s[T.getMonth()]}function hu(T){return o[+(T.getHours()>=12)]}function mu(T){return 1+~~(T.getMonth()/3)}function pu(T){return a[T.getUTCDay()]}function du(T){return i[T.getUTCDay()]}function gu(T){return f[T.getUTCMonth()]}function xu(T){return s[T.getUTCMonth()]}function yu(T){return o[+(T.getUTCHours()>=12)]}function vu(T){return 1+~~(T.getUTCMonth()/3)}return{format:function(T){var A=v(T+="",M);return A.toString=function(){return T},A},parse:function(T){var A=S(T+="",!1);return A.toString=function(){return T},A},utcFormat:function(T){var A=v(T+="",p);return A.toString=function(){return T},A},utcParse:function(T){var A=S(T+="",!0);return A.toString=function(){return T},A}}}var Oi={"-":"",_:" ",0:"0"},L=/^\s*\d+/,Of=/^%/,Uf=/[\\^$*+?|[\]().{}]/g;function E(t,e,r){var n=t<0?"-":"",o=(n?-t:t)+"",i=o.length;return n+(i<r?new Array(r-i+1).join(e)+o:o)}function Yf(t){return t.replace(Uf,"\\$&")}function Te(t){return new RegExp("^(?:"+t.map(Yf).join("|")+")","i")}function ke(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function $f(t,e,r){var n=L.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Rf(t,e,r){var n=L.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function Lf(t,e,r){var n=L.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Pf(t,e,r){var n=L.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Hf(t,e,r){var n=L.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Ui(t,e,r){var n=L.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Yi(t,e,r){var n=L.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function qf(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Bf(t,e,r){var n=L.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Xf(t,e,r){var n=L.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function $i(t,e,r){var n=L.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Wf(t,e,r){var n=L.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Ri(t,e,r){var n=L.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Vf(t,e,r){var n=L.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Zf(t,e,r){var n=L.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Qf(t,e,r){var n=L.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Gf(t,e,r){var n=L.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Kf(t,e,r){var n=Of.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Jf(t,e,r){var n=L.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function jf(t,e,r){var n=L.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Li(t,e){return E(t.getDate(),e,2)}function tl(t,e){return E(t.getHours(),e,2)}function el(t,e){return E(t.getHours()%12||12,e,2)}function rl(t,e){return E(1+pt.count(J(t),t),e,3)}function Xi(t,e){return E(t.getMilliseconds(),e,3)}function nl(t,e){return Xi(t,e)+"000"}function ol(t,e){return E(t.getMonth()+1,e,2)}function il(t,e){return E(t.getMinutes(),e,2)}function al(t,e){return E(t.getSeconds(),e,2)}function ul(t){var e=t.getDay();return e===0?7:e}function sl(t,e){return E(dt.count(J(t)-1,t),e,2)}function Wi(t){var e=t.getDay();return e>=4||e===0?wt(t):wt.ceil(t)}function fl(t,e){return t=Wi(t),E(wt.count(J(t),t)+(J(t).getDay()===4),e,2)}function ll(t){return t.getDay()}function cl(t,e){return E(jt.count(J(t)-1,t),e,2)}function hl(t,e){return E(t.getFullYear()%100,e,2)}function ml(t,e){return t=Wi(t),E(t.getFullYear()%100,e,2)}function pl(t,e){return E(t.getFullYear()%1e4,e,4)}function dl(t,e){var r=t.getDay();return t=r>=4||r===0?wt(t):wt.ceil(t),E(t.getFullYear()%1e4,e,4)}function gl(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+E(e/60|0,"0",2)+E(e%60,"0",2)}function Pi(t,e){return E(t.getUTCDate(),e,2)}function xl(t,e){return E(t.getUTCHours(),e,2)}function yl(t,e){return E(t.getUTCHours()%12||12,e,2)}function vl(t,e){return E(1+be.count(et(t),t),e,3)}function Vi(t,e){return E(t.getUTCMilliseconds(),e,3)}function wl(t,e){return Vi(t,e)+"000"}function _l(t,e){return E(t.getUTCMonth()+1,e,2)}function bl(t,e){return E(t.getUTCMinutes(),e,2)}function Ml(t,e){return E(t.getUTCSeconds(),e,2)}function Tl(t){var e=t.getUTCDay();return e===0?7:e}function kl(t,e){return E($t.count(et(t)-1,t),e,2)}function Zi(t){var e=t.getUTCDay();return e>=4||e===0?_t(t):_t.ceil(t)}function Sl(t,e){return t=Zi(t),E(_t.count(et(t),t)+(et(t).getUTCDay()===4),e,2)}function Cl(t){return t.getUTCDay()}function Nl(t,e){return E(te.count(et(t)-1,t),e,2)}function Al(t,e){return E(t.getUTCFullYear()%100,e,2)}function Dl(t,e){return t=Zi(t),E(t.getUTCFullYear()%100,e,2)}function Il(t,e){return E(t.getUTCFullYear()%1e4,e,4)}function El(t,e){var r=t.getUTCDay();return t=r>=4||r===0?_t(t):_t.ceil(t),E(t.getUTCFullYear()%1e4,e,4)}function Fl(){return"+0000"}function Hi(){return"%"}function qi(t){return+t}function Bi(t){return Math.floor(+t/1e3)}var re,lr,Qi,Gi,Ki;gn({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function gn(t){return re=dn(t),lr=re.format,Qi=re.parse,Gi=re.utcFormat,Ki=re.utcParse,re}function xn(t,e){t=t.slice();var r=0,n=t.length-1,o=t[r],i=t[n],a;return i<o&&(a=r,r=n,n=a,a=o,o=i,i=a),t[r]=e.floor(o),t[n]=e.ceil(i),t}function zl(t){return new Date(t)}function Ol(t){return t instanceof Date?+t:+new Date(+t)}function Ji(t,e,r,n,o,i,a,s,f,u){var c=ve(),h=c.invert,l=c.domain,m=u(".%L"),x=u(":%S"),g=u("%I:%M"),d=u("%I %p"),y=u("%a %d"),_=u("%b %d"),M=u("%B"),p=u("%Y");function b(v){return(f(v)<v?m:s(v)<v?x:a(v)<v?g:i(v)<v?d:n(v)<v?o(v)<v?y:_:r(v)<v?M:p)(v)}return c.invert=function(v){return new Date(h(v))},c.domain=function(v){return arguments.length?l(Array.from(v,Ol)):l().map(zl)},c.ticks=function(v){var S=l();return t(S[0],S[S.length-1],v??10)},c.tickFormat=function(v,S){return S==null?b:u(S)},c.nice=function(v){var S=l();return(!v||typeof v.range!="function")&&(v=e(S[0],S[S.length-1],v??10)),v?l(xn(S,v)):c},c.copy=function(){return or(c,Ji(t,e,r,n,o,i,a,s,f,u))},c}function ji(){return ir.apply(Ji(cn,hn,J,ee,dt,pt,Jt,Kt,at,lr).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Ul(){var t=0,e=1,r,n,o,i,a=mt,s=!1,f;function u(h){return h==null||isNaN(h=+h)?f:a(o===0?.5:(h=(i(h)-r)*o,s?Math.max(0,Math.min(1,h)):h))}u.domain=function(h){return arguments.length?([t,e]=h,r=i(t=+t),n=i(e=+e),o=r===n?0:1/(n-r),u):[t,e]},u.clamp=function(h){return arguments.length?(s=!!h,u):s},u.interpolator=function(h){return arguments.length?(a=h,u):a};function c(h){return function(l){var m,x;return arguments.length?([m,x]=l,a=h(m,x),u):[a(0),a(1)]}}return u.range=c(ht),u.rangeRound=c(xe),u.unknown=function(h){return arguments.length?(f=h,u):f},function(h){return i=h,r=h(t),n=h(e),o=r===n?0:1/(n-r),u}}function Yl(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function yn(){var t=un(Ul()(mt));return t.copy=function(){return Yl(t,yn())},wi.apply(t,arguments)}var Sx=Array.prototype.slice;function cr(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function $(t){return function(){return t}}function ta(t){this._context=t}ta.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function hr(t){return new ta(t)}var vn=Math.PI,wn=2*vn,Rt=1e-6,$l=wn-Rt;function ea(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function Rl(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return ea;let r=10**e;return function(n){this._+=n[0];for(let o=1,i=n.length;o<i;++o)this._+=Math.round(arguments[o]*r)/r+n[o]}}var Lt=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?ea:Rl(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,o){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+o}`}bezierCurveTo(e,r,n,o,i,a){this._append`C${+e},${+r},${+n},${+o},${this._x1=+i},${this._y1=+a}`}arcTo(e,r,n,o,i){if(e=+e,r=+r,n=+n,o=+o,i=+i,i<0)throw new Error(`negative radius: ${i}`);let a=this._x1,s=this._y1,f=n-e,u=o-r,c=a-e,h=s-r,l=c*c+h*h;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(l>Rt)if(!(Math.abs(h*f-u*c)>Rt)||!i)this._append`L${this._x1=e},${this._y1=r}`;else{let m=n-a,x=o-s,g=f*f+u*u,d=m*m+x*x,y=Math.sqrt(g),_=Math.sqrt(l),M=i*Math.tan((vn-Math.acos((g+l-d)/(2*y*_)))/2),p=M/_,b=M/y;Math.abs(p-1)>Rt&&this._append`L${e+p*c},${r+p*h}`,this._append`A${i},${i},0,0,${+(h*m>c*x)},${this._x1=e+b*f},${this._y1=r+b*u}`}}arc(e,r,n,o,i,a){if(e=+e,r=+r,n=+n,a=!!a,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(o),f=n*Math.sin(o),u=e+s,c=r+f,h=1^a,l=a?o-i:i-o;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>Rt||Math.abs(this._y1-c)>Rt)&&this._append`L${u},${c}`,n&&(l<0&&(l=l%wn+wn),l>$l?this._append`A${n},${n},0,1,${h},${e-s},${r-f}A${n},${n},0,1,${h},${this._x1=u},${this._y1=c}`:l>Rt&&this._append`A${n},${n},0,${+(l>=vn)},${h},${this._x1=e+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(e,r,n,o){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+o}h${-n}Z`}toString(){return this._}};function ra(){return new Lt}ra.prototype=Lt.prototype;function mr(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{let n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new Lt(e)}function pr(t){return t[0]}function dr(t){return t[1]}function _n(t,e){var r=$(!0),n=null,o=hr,i=null,a=mr(s);t=typeof t=="function"?t:t===void 0?pr:$(t),e=typeof e=="function"?e:e===void 0?dr:$(e);function s(f){var u,c=(f=cr(f)).length,h,l=!1,m;for(n==null&&(i=o(m=a())),u=0;u<=c;++u)!(u<c&&r(h=f[u],u,f))===l&&((l=!l)?i.lineStart():i.lineEnd()),l&&i.point(+t(h,u,f),+e(h,u,f));if(m)return i=null,m+""||null}return s.x=function(f){return arguments.length?(t=typeof f=="function"?f:$(+f),s):t},s.y=function(f){return arguments.length?(e=typeof f=="function"?f:$(+f),s):e},s.defined=function(f){return arguments.length?(r=typeof f=="function"?f:$(!!f),s):r},s.curve=function(f){return arguments.length?(o=f,n!=null&&(i=o(n)),s):o},s.context=function(f){return arguments.length?(f==null?n=i=null:i=o(n=f),s):n},s}function Ll(t,e,r){var n=null,o=$(!0),i=null,a=hr,s=null,f=mr(u);t=typeof t=="function"?t:t===void 0?pr:$(+t),e=typeof e=="function"?e:e===void 0?$(0):$(+e),r=typeof r=="function"?r:r===void 0?dr:$(+r);function u(h){var l,m,x,g=(h=cr(h)).length,d,y=!1,_,M=new Array(g),p=new Array(g);for(i==null&&(s=a(_=f())),l=0;l<=g;++l){if(!(l<g&&o(d=h[l],l,h))===y)if(y=!y)m=l,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),x=l-1;x>=m;--x)s.point(M[x],p[x]);s.lineEnd(),s.areaEnd()}y&&(M[l]=+t(d,l,h),p[l]=+e(d,l,h),s.point(n?+n(d,l,h):M[l],r?+r(d,l,h):p[l]))}if(_)return s=null,_+""||null}function c(){return _n().defined(o).curve(a).context(i)}return u.x=function(h){return arguments.length?(t=typeof h=="function"?h:$(+h),n=null,u):t},u.x0=function(h){return arguments.length?(t=typeof h=="function"?h:$(+h),u):t},u.x1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:$(+h),u):n},u.y=function(h){return arguments.length?(e=typeof h=="function"?h:$(+h),r=null,u):e},u.y0=function(h){return arguments.length?(e=typeof h=="function"?h:$(+h),u):e},u.y1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:$(+h),u):r},u.lineX0=u.lineY0=function(){return c().x(t).y(e)},u.lineY1=function(){return c().x(t).y(r)},u.lineX1=function(){return c().x(n).y(e)},u.defined=function(h){return arguments.length?(o=typeof h=="function"?h:$(!!h),u):o},u.curve=function(h){return arguments.length?(a=h,i!=null&&(s=a(i)),u):a},u.context=function(h){return arguments.length?(h==null?i=s=null:s=a(i=h),u):i},u}function na(t){return t<0?-1:1}function oa(t,e,r){var n=t._x1-t._x0,o=e-t._x1,i=(t._y1-t._y0)/(n||o<0&&-0),a=(r-t._y1)/(o||n<0&&-0),s=(i*o+a*n)/(n+o);return(na(i)+na(a))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs(s))||0}function ia(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function bn(t,e,r){var n=t._x0,o=t._y0,i=t._x1,a=t._y1,s=(i-n)/3;t._context.bezierCurveTo(n+s,o+s*e,i-s,a-s*r,i,a)}function gr(t){this._context=t}gr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:bn(this,this._t0,ia(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,bn(this,ia(this,r=oa(this,t,e)),r);break;default:bn(this,this._t0,r=oa(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function Pl(t){this._context=new aa(t)}(Pl.prototype=Object.create(gr.prototype)).point=function(t,e){gr.prototype.point.call(this,e,t)};function aa(t){this._context=t}aa.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,o,i){this._context.bezierCurveTo(e,t,n,r,i,o)}};function Hl(t){return new gr(t)}var ql={value:()=>{}};function sa(){for(var t=0,e=arguments.length,r={},n;t<e;++t){if(!(n=arguments[t]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new xr(r)}function xr(t){this._=t}function Bl(t,e){return t.trim().split(/^|\s+/).map(function(r){var n="",o=r.indexOf(".");if(o>=0&&(n=r.slice(o+1),r=r.slice(0,o)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}xr.prototype=sa.prototype={constructor:xr,on:function(t,e){var r=this._,n=Bl(t+"",r),o,i=-1,a=n.length;if(arguments.length<2){for(;++i<a;)if((o=(t=n[i]).type)&&(o=Xl(r[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<a;)if(o=(t=n[i]).type)r[o]=ua(r[o],t.name,e);else if(e==null)for(o in r)r[o]=ua(r[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new xr(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var r=new Array(o),n=0,o,i;n<o;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],n=0,o=i.length;n<o;++n)i[n].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],o=0,i=n.length;o<i;++o)n[o].value.apply(e,r)}};function Xl(t,e){for(var r=0,n=t.length,o;r<n;++r)if((o=t[r]).name===e)return o.value}function ua(t,e,r){for(var n=0,o=t.length;n<o;++n)if(t[n].name===e){t[n]=ql,t=t.slice(0,n).concat(t.slice(n+1));break}return r!=null&&t.push({name:e,value:r}),t}var Pt=sa;var fa={passive:!1},Ht={capture:!0,passive:!1};function yr(t){t.stopImmediatePropagation()}function bt(t){t.preventDefault(),t.stopImmediatePropagation()}function la(t){var e=t.document.documentElement,r=At(t).on("dragstart.drag",bt,Ht);"onselectstart"in e?r.on("selectstart.drag",bt,Ht):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function ca(t,e){var r=t.document.documentElement,n=At(t).on("dragstart.drag",null);e&&(n.on("click.drag",bt,Ht),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}var Se=t=>()=>t;function Ce(t,{sourceEvent:e,subject:r,target:n,identifier:o,active:i,x:a,y:s,dx:f,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Ce.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Wl(t){return!t.ctrlKey&&!t.button}function Vl(){return this.parentNode}function Zl(t,e){return e??{x:t.x,y:t.y}}function Ql(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gl(){var t=Wl,e=Vl,r=Zl,n=Ql,o={},i=Pt("start","drag","end"),a=0,s,f,u,c,h=0;function l(p){p.on("mousedown.drag",m).filter(n).on("touchstart.drag",d).on("touchmove.drag",y,fa).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(p,b){if(!(c||!t.call(this,p,b))){var v=M(this,e.call(this,p,b),p,b,"mouse");v&&(At(p.view).on("mousemove.drag",x,Ht).on("mouseup.drag",g,Ht),la(p.view),yr(p),u=!1,s=p.clientX,f=p.clientY,v("start",p))}}function x(p){if(bt(p),!u){var b=p.clientX-s,v=p.clientY-f;u=b*b+v*v>h}o.mouse("drag",p)}function g(p){At(p.view).on("mousemove.drag mouseup.drag",null),ca(p.view,u),bt(p),o.mouse("end",p)}function d(p,b){if(t.call(this,p,b)){var v=p.changedTouches,S=e.call(this,p,b),C=v.length,z,N;for(z=0;z<C;++z)(N=M(this,S,p,b,v[z].identifier,v[z]))&&(yr(p),N("start",p,v[z]))}}function y(p){var b=p.changedTouches,v=b.length,S,C;for(S=0;S<v;++S)(C=o[b[S].identifier])&&(bt(p),C("drag",p,b[S]))}function _(p){var b=p.changedTouches,v=b.length,S,C;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),S=0;S<v;++S)(C=o[b[S].identifier])&&(yr(p),C("end",p,b[S]))}function M(p,b,v,S,C,z){var N=i.copy(),k=Be(z||v,b),F,D,Q;if((Q=r.call(p,new Ce("beforestart",{sourceEvent:v,target:l,identifier:C,active:a,x:k[0],y:k[1],dx:0,dy:0,dispatch:N}),S))!=null)return F=Q.x-k[0]||0,D=Q.y-k[1]||0,function Xt(nt,ft,xt){var W=k,ae;switch(nt){case"start":o[C]=Xt,ae=a++;break;case"end":delete o[C],--a;case"drag":k=Be(xt||ft,b),ae=a;break}N.call(nt,p,new Ce(nt,{sourceEvent:ft,subject:Q,target:l,identifier:C,active:ae,x:k[0]+F,y:k[1]+D,dx:k[0]-W[0],dy:k[1]-W[1],dispatch:N}),S)}}return l.filter=function(p){return arguments.length?(t=typeof p=="function"?p:Se(!!p),l):t},l.container=function(p){return arguments.length?(e=typeof p=="function"?p:Se(p),l):e},l.subject=function(p){return arguments.length?(r=typeof p=="function"?p:Se(p),l):r},l.touchable=function(p){return arguments.length?(n=typeof p=="function"?p:Se(!!p),l):n},l.on=function(){var p=i.on.apply(i,arguments);return p===i?l:p},l.clickDistance=function(p){return arguments.length?(h=(p=+p)*p,l):Math.sqrt(h)},l}var ne=0,Ae=0,Ne=0,ma=1e3,vr,De,wr=0,qt=0,_r=0,Ie=typeof performance=="object"&&performance.now?performance:Date,pa=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Fe(){return qt||(pa(Kl),qt=Ie.now()+_r)}function Kl(){qt=0}function Ee(){this._call=this._time=this._next=null}Ee.prototype=oe.prototype={constructor:Ee,restart:function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?Fe():+r)+(e==null?0:+e),!this._next&&De!==this&&(De?De._next=this:vr=this,De=this),this._call=t,this._time=r,Mn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Mn())}};function oe(t,e,r){var n=new Ee;return n.restart(t,e,r),n}function da(){Fe(),++ne;for(var t=vr,e;t;)(e=qt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ne}function ha(){qt=(wr=Ie.now())+_r,ne=Ae=0;try{da()}finally{ne=0,jl(),qt=0}}function Jl(){var t=Ie.now(),e=t-wr;e>ma&&(_r-=e,wr=t)}function jl(){for(var t,e=vr,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:vr=r);De=t,Mn(n)}function Mn(t){if(!ne){Ae&&(Ae=clearTimeout(Ae));var e=t-qt;e>24?(t<1/0&&(Ae=setTimeout(ha,t-Ie.now()-_r)),Ne&&(Ne=clearInterval(Ne))):(Ne||(wr=Ie.now(),Ne=setInterval(Jl,ma)),ne=1,pa(ha))}}function br(t,e,r){var n=new Ee;return e=e==null?0:+e,n.restart(o=>{n.stop(),t(o+e)},e,r),n}var tc=Pt("start","end","cancel","interrupt"),ec=[],ya=0,ga=1,Tr=2,Mr=3,xa=4,kr=5,ze=6;function Mt(t,e,r,n,o,i){var a=t.__transition;if(!a)t.__transition={};else if(r in a)return;rc(t,r,{name:e,index:n,group:o,on:tc,tween:ec,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:ya})}function Oe(t,e){var r=R(t,e);if(r.state>ya)throw new Error("too late; already scheduled");return r}function q(t,e){var r=R(t,e);if(r.state>Mr)throw new Error("too late; already running");return r}function R(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function rc(t,e,r){var n=t.__transition,o;n[e]=r,r.timer=oe(i,0,r.time);function i(u){r.state=ga,r.timer.restart(a,r.delay,r.time),r.delay<=u&&a(u-r.delay)}function a(u){var c,h,l,m;if(r.state!==ga)return f();for(c in n)if(m=n[c],m.name===r.name){if(m.state===Mr)return br(a);m.state===xa?(m.state=ze,m.timer.stop(),m.on.call("interrupt",t,t.__data__,m.index,m.group),delete n[c]):+c<e&&(m.state=ze,m.timer.stop(),m.on.call("cancel",t,t.__data__,m.index,m.group),delete n[c])}if(br(function(){r.state===Mr&&(r.state=xa,r.timer.restart(s,r.delay,r.time),s(u))}),r.state=Tr,r.on.call("start",t,t.__data__,r.index,r.group),r.state===Tr){for(r.state=Mr,o=new Array(l=r.tween.length),c=0,h=-1;c<l;++c)(m=r.tween[c].value.call(t,t.__data__,r.index,r.group))&&(o[++h]=m);o.length=h+1}}function s(u){for(var c=u<r.duration?r.ease.call(null,u/r.duration):(r.timer.restart(f),r.state=kr,1),h=-1,l=o.length;++h<l;)o[h].call(t,c);r.state===kr&&(r.on.call("end",t,t.__data__,r.index,r.group),f())}function f(){r.state=ze,r.timer.stop(),delete n[e];for(var u in n)return;delete t.__transition}}function Sr(t,e){var r=t.__transition,n,o,i=!0,a;if(r){e=e==null?null:e+"";for(a in r){if((n=r[a]).name!==e){i=!1;continue}o=n.state>Tr&&n.state<kr,n.state=ze,n.timer.stop(),n.on.call(o?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[a]}i&&delete t.__transition}}function va(t){return this.each(function(){Sr(this,t)})}function nc(t,e){var r,n;return function(){var o=q(this,t),i=o.tween;if(i!==r){n=r=i;for(var a=0,s=n.length;a<s;++a)if(n[a].name===e){n=n.slice(),n.splice(a,1);break}}o.tween=n}}function oc(t,e,r){var n,o;if(typeof r!="function")throw new Error;return function(){var i=q(this,t),a=i.tween;if(a!==n){o=(n=a).slice();for(var s={name:e,value:r},f=0,u=o.length;f<u;++f)if(o[f].name===e){o[f]=s;break}f===u&&o.push(s)}i.tween=o}}function wa(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n=R(this.node(),r).tween,o=0,i=n.length,a;o<i;++o)if((a=n[o]).name===t)return a.value;return null}return this.each((e==null?nc:oc)(r,t,e))}function ie(t,e,r){var n=t._id;return t.each(function(){var o=q(this,n);(o.value||(o.value={}))[e]=r.apply(this,arguments)}),function(o){return R(o,n).value[e]}}function Cr(t,e){var r;return(typeof e=="number"?H:e instanceof tt?Et:(r=tt(e))?(e=r,Et):ge)(t,e)}function ic(t){return function(){this.removeAttribute(t)}}function ac(t){return function(){this.removeAttributeNS(t.space,t.local)}}function uc(t,e,r){var n,o=r+"",i;return function(){var a=this.getAttribute(t);return a===o?null:a===n?i:i=e(n=a,r)}}function sc(t,e,r){var n,o=r+"",i;return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===n?i:i=e(n=a,r)}}function fc(t,e,r){var n,o,i;return function(){var a,s=r(this),f;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),f=s+"",a===f?null:a===n&&f===o?i:(o=f,i=e(n=a,s)))}}function lc(t,e,r){var n,o,i;return function(){var a,s=r(this),f;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),f=s+"",a===f?null:a===n&&f===o?i:(o=f,i=e(n=a,s)))}}function _a(t,e){var r=lt(t),n=r==="transform"?Vr:Cr;return this.attrTween(t,typeof e=="function"?(r.local?lc:fc)(r,n,ie(this,"attr."+t,e)):e==null?(r.local?ac:ic)(r):(r.local?sc:uc)(r,n,e))}function cc(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function hc(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function mc(t,e){var r,n;function o(){var i=e.apply(this,arguments);return i!==n&&(r=(n=i)&&hc(t,i)),r}return o._value=e,o}function pc(t,e){var r,n;function o(){var i=e.apply(this,arguments);return i!==n&&(r=(n=i)&&cc(t,i)),r}return o._value=e,o}function ba(t,e){var r="attr."+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;var n=lt(t);return this.tween(r,(n.local?mc:pc)(n,e))}function dc(t,e){return function(){Oe(this,t).delay=+e.apply(this,arguments)}}function gc(t,e){return e=+e,function(){Oe(this,t).delay=e}}function Ma(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?dc:gc)(e,t)):R(this.node(),e).delay}function xc(t,e){return function(){q(this,t).duration=+e.apply(this,arguments)}}function yc(t,e){return e=+e,function(){q(this,t).duration=e}}function Ta(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?xc:yc)(e,t)):R(this.node(),e).duration}function vc(t,e){if(typeof e!="function")throw new Error;return function(){q(this,t).ease=e}}function ka(t){var e=this._id;return arguments.length?this.each(vc(e,t)):R(this.node(),e).ease}function wc(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;q(this,t).ease=r}}function Sa(t){if(typeof t!="function")throw new Error;return this.each(wc(this._id,t))}function Ca(t){typeof t!="function"&&(t=le(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var i=e[o],a=i.length,s=n[o]=[],f,u=0;u<a;++u)(f=i[u])&&t.call(f,f.__data__,u,i)&&s.push(f);return new B(n,this._parents,this._name,this._id)}function Na(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,o=r.length,i=Math.min(n,o),a=new Array(n),s=0;s<i;++s)for(var f=e[s],u=r[s],c=f.length,h=a[s]=new Array(c),l,m=0;m<c;++m)(l=f[m]||u[m])&&(h[m]=l);for(;s<n;++s)a[s]=e[s];return new B(a,this._parents,this._name,this._id)}function _c(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function bc(t,e,r){var n,o,i=_c(e)?Oe:q;return function(){var a=i(this,t),s=a.on;s!==n&&(o=(n=s).copy()).on(e,r),a.on=o}}function Aa(t,e){var r=this._id;return arguments.length<2?R(this.node(),r).on.on(t):this.each(bc(r,t,e))}function Mc(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function Da(){return this.on("end.remove",Mc(this._id))}function Ia(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Nt(t));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var s=n[a],f=s.length,u=i[a]=new Array(f),c,h,l=0;l<f;++l)(c=s[l])&&(h=t.call(c,c.__data__,l,s))&&("__data__"in c&&(h.__data__=c.__data__),u[l]=h,Mt(u[l],e,r,l,u,R(c,r)));return new B(i,this._parents,e,r)}function Ea(t){var e=this._name,r=this._id;typeof t!="function"&&(t=fe(t));for(var n=this._groups,o=n.length,i=[],a=[],s=0;s<o;++s)for(var f=n[s],u=f.length,c,h=0;h<u;++h)if(c=f[h]){for(var l=t.call(c,c.__data__,h,f),m,x=R(c,r),g=0,d=l.length;g<d;++g)(m=l[g])&&Mt(m,e,r,g,l,x);i.push(l),a.push(c)}return new B(i,a,e,r)}var Tc=ct.prototype.constructor;function Fa(){return new Tc(this._groups,this._parents)}function kc(t,e){var r,n,o;return function(){var i=yt(this,t),a=(this.style.removeProperty(t),yt(this,t));return i===a?null:i===r&&a===n?o:o=e(r=i,n=a)}}function za(t){return function(){this.style.removeProperty(t)}}function Sc(t,e,r){var n,o=r+"",i;return function(){var a=yt(this,t);return a===o?null:a===n?i:i=e(n=a,r)}}function Cc(t,e,r){var n,o,i;return function(){var a=yt(this,t),s=r(this),f=s+"";return s==null&&(f=s=(this.style.removeProperty(t),yt(this,t))),a===f?null:a===n&&f===o?i:(o=f,i=e(n=a,s))}}function Nc(t,e){var r,n,o,i="style."+e,a="end."+i,s;return function(){var f=q(this,t),u=f.on,c=f.value[i]==null?s||(s=za(e)):void 0;(u!==r||o!==c)&&(n=(r=u).copy()).on(a,o=c),f.on=n}}function Oa(t,e,r){var n=(t+="")=="transform"?Wr:Cr;return e==null?this.styleTween(t,kc(t,n)).on("end.style."+t,za(t)):typeof e=="function"?this.styleTween(t,Cc(t,n,ie(this,"style."+t,e))).each(Nc(this._id,t)):this.styleTween(t,Sc(t,n,e),r).on("end.style."+t,null)}function Ac(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function Dc(t,e,r){var n,o;function i(){var a=e.apply(this,arguments);return a!==o&&(n=(o=a)&&Ac(t,a,r)),n}return i._value=e,i}function Ua(t,e,r){var n="style."+(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;return this.tween(n,Dc(t,e,r??""))}function Ic(t){return function(){this.textContent=t}}function Ec(t){return function(){var e=t(this);this.textContent=e??""}}function Ya(t){return this.tween("text",typeof t=="function"?Ec(ie(this,"text",t)):Ic(t==null?"":t+""))}function Fc(t){return function(e){this.textContent=t.call(this,e)}}function zc(t){var e,r;function n(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&Fc(o)),e}return n._value=t,n}function $a(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,zc(t))}function Ra(){for(var t=this._name,e=this._id,r=Nr(),n=this._groups,o=n.length,i=0;i<o;++i)for(var a=n[i],s=a.length,f,u=0;u<s;++u)if(f=a[u]){var c=R(f,e);Mt(f,t,r,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new B(n,this._parents,t,r)}function La(){var t,e,r=this,n=r._id,o=r.size();return new Promise(function(i,a){var s={value:a},f={value:function(){--o===0&&i()}};r.each(function(){var u=q(this,n),c=u.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(f)),u.on=e}),o===0&&i()})}var Oc=0;function B(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function Pa(t){return ct().transition(t)}function Nr(){return++Oc}var gt=ct.prototype;B.prototype=Pa.prototype={constructor:B,select:Ia,selectAll:Ea,selectChild:gt.selectChild,selectChildren:gt.selectChildren,filter:Ca,merge:Na,selection:Fa,transition:Ra,call:gt.call,nodes:gt.nodes,node:gt.node,size:gt.size,empty:gt.empty,each:gt.each,on:Aa,attr:_a,attrTween:ba,style:Oa,styleTween:Ua,text:Ya,textTween:$a,remove:Da,tween:wa,delay:Ma,duration:Ta,ease:ka,easeVarying:Sa,end:La,[Symbol.iterator]:gt[Symbol.iterator]};function Ar(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Uc={time:null,delay:0,duration:250,ease:Ar};function Yc(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function Ha(t){var e,r;t instanceof B?(e=t._id,t=t._name):(e=Nr(),(r=Uc).time=Fe(),t=t==null?null:t+"");for(var n=this._groups,o=n.length,i=0;i<o;++i)for(var a=n[i],s=a.length,f,u=0;u<s;++u)(f=a[u])&&Mt(f,t,e,u,a,r||Yc(f,e));return new B(n,this._parents,t,e)}ct.prototype.interrupt=va;ct.prototype.transition=Ha;var{abs:Sv,max:Cv,min:Nv}=Math;function qa(t){return[+t[0],+t[1]]}function $c(t){return[qa(t[0]),qa(t[1])]}var Av={name:"x",handles:["w","e"].map(Tn),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Dv={name:"y",handles:["n","s"].map(Tn),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Iv={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Tn),input:function(t){return t==null?null:$c(t)},output:function(t){return t}};function Tn(t){return{type:t}}function Rc(t,e){var r,n=1;t==null&&(t=0),e==null&&(e=0);function o(){var i,a=r.length,s,f=0,u=0;for(i=0;i<a;++i)s=r[i],f+=s.x,u+=s.y;for(f=(f/a-t)*n,u=(u/a-e)*n,i=0;i<a;++i)s=r[i],s.x-=f,s.y-=u}return o.initialize=function(i){r=i},o.x=function(i){return arguments.length?(t=+i,o):t},o.y=function(i){return arguments.length?(e=+i,o):e},o.strength=function(i){return arguments.length?(n=+i,o):n},o}function Ba(t){let e=+this._x.call(null,t),r=+this._y.call(null,t);return Xa(this.cover(e,r),e,r,t)}function Xa(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var o,i=t._root,a={data:n},s=t._x0,f=t._y0,u=t._x1,c=t._y1,h,l,m,x,g,d,y,_;if(!i)return t._root=a,t;for(;i.length;)if((g=e>=(h=(s+u)/2))?s=h:u=h,(d=r>=(l=(f+c)/2))?f=l:c=l,o=i,!(i=i[y=d<<1|g]))return o[y]=a,t;if(m=+t._x.call(null,i.data),x=+t._y.call(null,i.data),e===m&&r===x)return a.next=i,o?o[y]=a:t._root=a,t;do o=o?o[y]=new Array(4):t._root=new Array(4),(g=e>=(h=(s+u)/2))?s=h:u=h,(d=r>=(l=(f+c)/2))?f=l:c=l;while((y=d<<1|g)===(_=(x>=l)<<1|m>=h));return o[_]=i,o[y]=a,t}function Wa(t){var e,r,n=t.length,o,i,a=new Array(n),s=new Array(n),f=1/0,u=1/0,c=-1/0,h=-1/0;for(r=0;r<n;++r)isNaN(o=+this._x.call(null,e=t[r]))||isNaN(i=+this._y.call(null,e))||(a[r]=o,s[r]=i,o<f&&(f=o),o>c&&(c=o),i<u&&(u=i),i>h&&(h=i));if(f>c||u>h)return this;for(this.cover(f,u).cover(c,h),r=0;r<n;++r)Xa(this,a[r],s[r],t[r]);return this}function Va(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var r=this._x0,n=this._y0,o=this._x1,i=this._y1;if(isNaN(r))o=(r=Math.floor(t))+1,i=(n=Math.floor(e))+1;else{for(var a=o-r||1,s=this._root,f,u;r>t||t>=o||n>e||e>=i;)switch(u=(e<n)<<1|t<r,f=new Array(4),f[u]=s,s=f,a*=2,u){case 0:o=r+a,i=n+a;break;case 1:r=o-a,i=n+a;break;case 2:o=r+a,n=i-a;break;case 3:r=o-a,n=i-a;break}this._root&&this._root.length&&(this._root=s)}return this._x0=r,this._y0=n,this._x1=o,this._y1=i,this}function Za(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function Qa(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function P(t,e,r,n,o){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=o}function Ga(t,e,r){var n,o=this._x0,i=this._y0,a,s,f,u,c=this._x1,h=this._y1,l=[],m=this._root,x,g;for(m&&l.push(new P(m,o,i,c,h)),r==null?r=1/0:(o=t-r,i=e-r,c=t+r,h=e+r,r*=r);x=l.pop();)if(!(!(m=x.node)||(a=x.x0)>c||(s=x.y0)>h||(f=x.x1)<o||(u=x.y1)<i))if(m.length){var d=(a+f)/2,y=(s+u)/2;l.push(new P(m[3],d,y,f,u),new P(m[2],a,y,d,u),new P(m[1],d,s,f,y),new P(m[0],a,s,d,y)),(g=(e>=y)<<1|t>=d)&&(x=l[l.length-1],l[l.length-1]=l[l.length-1-g],l[l.length-1-g]=x)}else{var _=t-+this._x.call(null,m.data),M=e-+this._y.call(null,m.data),p=_*_+M*M;if(p<r){var b=Math.sqrt(r=p);o=t-b,i=e-b,c=t+b,h=e+b,n=m.data}}return n}function Ka(t){if(isNaN(c=+this._x.call(null,t))||isNaN(h=+this._y.call(null,t)))return this;var e,r=this._root,n,o,i,a=this._x0,s=this._y0,f=this._x1,u=this._y1,c,h,l,m,x,g,d,y;if(!r)return this;if(r.length)for(;;){if((x=c>=(l=(a+f)/2))?a=l:f=l,(g=h>=(m=(s+u)/2))?s=m:u=m,e=r,!(r=r[d=g<<1|x]))return this;if(!r.length)break;(e[d+1&3]||e[d+2&3]||e[d+3&3])&&(n=e,y=d)}for(;r.data!==t;)if(o=r,!(r=r.next))return this;return(i=r.next)&&delete r.next,o?(i?o.next=i:delete o.next,this):e?(i?e[d]=i:delete e[d],(r=e[0]||e[1]||e[2]||e[3])&&r===(e[3]||e[2]||e[1]||e[0])&&!r.length&&(n?n[y]=r:this._root=r),this):(this._root=i,this)}function Ja(t){for(var e=0,r=t.length;e<r;++e)this.remove(t[e]);return this}function ja(){return this._root}function tu(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function eu(t){var e=[],r,n=this._root,o,i,a,s,f;for(n&&e.push(new P(n,this._x0,this._y0,this._x1,this._y1));r=e.pop();)if(!t(n=r.node,i=r.x0,a=r.y0,s=r.x1,f=r.y1)&&n.length){var u=(i+s)/2,c=(a+f)/2;(o=n[3])&&e.push(new P(o,u,c,s,f)),(o=n[2])&&e.push(new P(o,i,c,u,f)),(o=n[1])&&e.push(new P(o,u,a,s,c)),(o=n[0])&&e.push(new P(o,i,a,u,c))}return this}function ru(t){var e=[],r=[],n;for(this._root&&e.push(new P(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var o=n.node;if(o.length){var i,a=n.x0,s=n.y0,f=n.x1,u=n.y1,c=(a+f)/2,h=(s+u)/2;(i=o[0])&&e.push(new P(i,a,s,c,h)),(i=o[1])&&e.push(new P(i,c,s,f,h)),(i=o[2])&&e.push(new P(i,a,h,c,u)),(i=o[3])&&e.push(new P(i,c,h,f,u))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this}function nu(t){return t[0]}function ou(t){return arguments.length?(this._x=t,this):this._x}function iu(t){return t[1]}function au(t){return arguments.length?(this._y=t,this):this._y}function Bt(t,e,r){var n=new kn(e??nu,r??iu,NaN,NaN,NaN,NaN);return t==null?n:n.addAll(t)}function kn(t,e,r,n,o,i){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=o,this._y1=i,this._root=void 0}function uu(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var X=Bt.prototype=kn.prototype;X.copy=function(){var t=new kn(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,r,n;if(!e)return t;if(!e.length)return t._root=uu(e),t;for(r=[{source:e,target:t._root=new Array(4)}];e=r.pop();)for(var o=0;o<4;++o)(n=e.source[o])&&(n.length?r.push({source:n,target:e.target[o]=new Array(4)}):e.target[o]=uu(n));return t};X.add=Ba;X.addAll=Wa;X.cover=Va;X.data=Za;X.extent=Qa;X.find=Ga;X.remove=Ka;X.removeAll=Ja;X.root=ja;X.size=tu;X.visit=eu;X.visitAfter=ru;X.x=ou;X.y=au;function st(t){return function(){return t}}function rt(t){return(t()-.5)*1e-6}function Lc(t){return t.x+t.vx}function Pc(t){return t.y+t.vy}function Hc(t){var e,r,n,o=1,i=1;typeof t!="function"&&(t=st(t==null?1:+t));function a(){for(var u,c=e.length,h,l,m,x,g,d,y=0;y<i;++y)for(h=Bt(e,Lc,Pc).visitAfter(s),u=0;u<c;++u)l=e[u],g=r[l.index],d=g*g,m=l.x+l.vx,x=l.y+l.vy,h.visit(_);function _(M,p,b,v,S){var C=M.data,z=M.r,N=g+z;if(C){if(C.index>l.index){var k=m-C.x-C.vx,F=x-C.y-C.vy,D=k*k+F*F;D<N*N&&(k===0&&(k=rt(n),D+=k*k),F===0&&(F=rt(n),D+=F*F),D=(N-(D=Math.sqrt(D)))/D*o,l.vx+=(k*=D)*(N=(z*=z)/(d+z)),l.vy+=(F*=D)*N,C.vx-=k*(N=1-N),C.vy-=F*N)}return}return p>m+N||v<m-N||b>x+N||S<x-N}}function s(u){if(u.data)return u.r=r[u.data.index];for(var c=u.r=0;c<4;++c)u[c]&&u[c].r>u.r&&(u.r=u[c].r)}function f(){if(e){var u,c=e.length,h;for(r=new Array(c),u=0;u<c;++u)h=e[u],r[h.index]=+t(h,u,e)}}return a.initialize=function(u,c){e=u,n=c,f()},a.iterations=function(u){return arguments.length?(i=+u,a):i},a.strength=function(u){return arguments.length?(o=+u,a):o},a.radius=function(u){return arguments.length?(t=typeof u=="function"?u:st(+u),f(),a):t},a}function qc(t){return t.index}function su(t,e){var r=t.get(e);if(!r)throw new Error("node not found: "+e);return r}function Bc(t){var e=qc,r=h,n,o=st(30),i,a,s,f,u,c=1;t==null&&(t=[]);function h(d){return 1/Math.min(s[d.source.index],s[d.target.index])}function l(d){for(var y=0,_=t.length;y<c;++y)for(var M=0,p,b,v,S,C,z,N;M<_;++M)p=t[M],b=p.source,v=p.target,S=v.x+v.vx-b.x-b.vx||rt(u),C=v.y+v.vy-b.y-b.vy||rt(u),z=Math.sqrt(S*S+C*C),z=(z-i[M])/z*d*n[M],S*=z,C*=z,v.vx-=S*(N=f[M]),v.vy-=C*N,b.vx+=S*(N=1-N),b.vy+=C*N}function m(){if(a){var d,y=a.length,_=t.length,M=new Map(a.map((b,v)=>[e(b,v,a),b])),p;for(d=0,s=new Array(y);d<_;++d)p=t[d],p.index=d,typeof p.source!="object"&&(p.source=su(M,p.source)),typeof p.target!="object"&&(p.target=su(M,p.target)),s[p.source.index]=(s[p.source.index]||0)+1,s[p.target.index]=(s[p.target.index]||0)+1;for(d=0,f=new Array(_);d<_;++d)p=t[d],f[d]=s[p.source.index]/(s[p.source.index]+s[p.target.index]);n=new Array(_),x(),i=new Array(_),g()}}function x(){if(a)for(var d=0,y=t.length;d<y;++d)n[d]=+r(t[d],d,t)}function g(){if(a)for(var d=0,y=t.length;d<y;++d)i[d]=+o(t[d],d,t)}return l.initialize=function(d,y){a=d,u=y,m()},l.links=function(d){return arguments.length?(t=d,m(),l):t},l.id=function(d){return arguments.length?(e=d,l):e},l.iterations=function(d){return arguments.length?(c=+d,l):c},l.strength=function(d){return arguments.length?(r=typeof d=="function"?d:st(+d),x(),l):r},l.distance=function(d){return arguments.length?(o=typeof d=="function"?d:st(+d),g(),l):o},l}function fu(){let t=1;return()=>(t=(1664525*t+1013904223)%4294967296)/4294967296}function lu(t){return t.x}function cu(t){return t.y}var Xc=10,Wc=Math.PI*(3-Math.sqrt(5));function Vc(t){var e,r=1,n=.001,o=1-Math.pow(n,1/300),i=0,a=.6,s=new Map,f=oe(h),u=Pt("tick","end"),c=fu();t==null&&(t=[]);function h(){l(),u.call("tick",e),r<n&&(f.stop(),u.call("end",e))}function l(g){var d,y=t.length,_;g===void 0&&(g=1);for(var M=0;M<g;++M)for(r+=(i-r)*o,s.forEach(function(p){p(r)}),d=0;d<y;++d)_=t[d],_.fx==null?_.x+=_.vx*=a:(_.x=_.fx,_.vx=0),_.fy==null?_.y+=_.vy*=a:(_.y=_.fy,_.vy=0);return e}function m(){for(var g=0,d=t.length,y;g<d;++g){if(y=t[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var _=Xc*Math.sqrt(.5+g),M=g*Wc;y.x=_*Math.cos(M),y.y=_*Math.sin(M)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function x(g){return g.initialize&&g.initialize(t,c),g}return m(),e={tick:l,restart:function(){return f.restart(h),e},stop:function(){return f.stop(),e},nodes:function(g){return arguments.length?(t=g,m(),s.forEach(x),e):t},alpha:function(g){return arguments.length?(r=+g,e):r},alphaMin:function(g){return arguments.length?(n=+g,e):n},alphaDecay:function(g){return arguments.length?(o=+g,e):+o},alphaTarget:function(g){return arguments.length?(i=+g,e):i},velocityDecay:function(g){return arguments.length?(a=1-g,e):1-a},randomSource:function(g){return arguments.length?(c=g,s.forEach(x),e):c},force:function(g,d){return arguments.length>1?(d==null?s.delete(g):s.set(g,x(d)),e):s.get(g)},find:function(g,d,y){var _=0,M=t.length,p,b,v,S,C;for(y==null?y=1/0:y*=y,_=0;_<M;++_)S=t[_],p=g-S.x,b=d-S.y,v=p*p+b*b,v<y&&(C=S,y=v);return C},on:function(g,d){return arguments.length>1?(u.on(g,d),e):u.on(g)}}}function Zc(){var t,e,r,n,o=st(-30),i,a=1,s=1/0,f=.81;function u(m){var x,g=t.length,d=Bt(t,lu,cu).visitAfter(h);for(n=m,x=0;x<g;++x)e=t[x],d.visit(l)}function c(){if(t){var m,x=t.length,g;for(i=new Array(x),m=0;m<x;++m)g=t[m],i[g.index]=+o(g,m,t)}}function h(m){var x=0,g,d,y=0,_,M,p;if(m.length){for(_=M=p=0;p<4;++p)(g=m[p])&&(d=Math.abs(g.value))&&(x+=g.value,y+=d,_+=d*g.x,M+=d*g.y);m.x=_/y,m.y=M/y}else{g=m,g.x=g.data.x,g.y=g.data.y;do x+=i[g.data.index];while(g=g.next)}m.value=x}function l(m,x,g,d){if(!m.value)return!0;var y=m.x-e.x,_=m.y-e.y,M=d-x,p=y*y+_*_;if(M*M/f<p)return p<s&&(y===0&&(y=rt(r),p+=y*y),_===0&&(_=rt(r),p+=_*_),p<a&&(p=Math.sqrt(a*p)),e.vx+=y*m.value*n/p,e.vy+=_*m.value*n/p),!0;if(m.length||p>=s)return;(m.data!==e||m.next)&&(y===0&&(y=rt(r),p+=y*y),_===0&&(_=rt(r),p+=_*_),p<a&&(p=Math.sqrt(a*p)));do m.data!==e&&(M=i[m.data.index]*n/p,e.vx+=y*M,e.vy+=_*M);while(m=m.next)}return u.initialize=function(m,x){t=m,r=x,c()},u.strength=function(m){return arguments.length?(o=typeof m=="function"?m:st(+m),c(),u):o},u.distanceMin=function(m){return arguments.length?(a=m*m,u):Math.sqrt(a)},u.distanceMax=function(m){return arguments.length?(s=m*m,u):Math.sqrt(s)},u.theta=function(m){return arguments.length?(f=m*m,u):Math.sqrt(f)},u}function Tt(t,e,r){this.k=t,this.x=e,this.y=r}Tt.prototype={constructor:Tt,scale:function(t){return t===1?this:new Tt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Tt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Sn=new Tt(1,0,0);Cn.prototype=Tt.prototype;function Cn(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Sn;return t.__zoom}export{Ct as a,An as b,Dn as c,Iu as d,Eu as e,Fu as f,At as g,Be as h,Gl as i,Et as j,Rc as k,Hc as l,Bc as m,Vc as n,Zc as o,er as p,nr as q,nf as r,sn as s,ji as t,yn as u,_n as v,Ll as w,Hl as x};
@@ -0,0 +1,9 @@
1
+ import{a as Ct,b as _t,c as Q,d as wt,e as Mt,f as ot,g as A,h as kt,j as Ot,p as Pt,q as It,r as St,s as st,t as Et,u as Tt,v as Dt,w as zt,x as lt}from"./chunk-EZUFC4CQ.js";import{d as bt}from"./chunk-6VRZZB3T.js";import{a as yt}from"./chunk-UIWFTWLF.js";import{$ as nt,Ab as f,Cb as K,Ga as c,Kb as rt,Mb as at,Pa as z,Sb as ht,Ta as O,Va as ft,ab as U,cc as xt,db as v,dc as Y,ea as E,eb as r,fa as T,fb as a,fc as vt,ga as W,gb as R,gc as $,ha as ut,hb as F,ib as N,jb as V,mb as J,nb as H,oa as D,ob as P,sa as X,sb as B,tb as G,ub as L,wb as it,zb as o}from"./chunk-OBPR2XVH.js";var Lt=["svg"],Qt=["tooltip"],Z=class n{data=[];height=200;svgRef;tooltipRef;hideTimer=null;ngAfterViewInit(){this.render()}ngOnChanges(){this.render()}ngOnDestroy(){this.hideTimer&&clearTimeout(this.hideTimer)}render(){if(!this.svgRef)return;let e=this.svgRef.nativeElement,t=this.tooltipRef?.nativeElement,d=e.clientWidth||600,l={top:14,right:46,bottom:28,left:42},m=Math.max(0,d-l.left-l.right),h=Math.max(0,this.height-l.top-l.bottom),b=getComputedStyle(e),g={accent:_(b,"--chart-line","#818cf8"),success:_(b,"--chart-add","#4ade80"),danger:_(b,"--chart-del","#f87171"),muted:_(b,"--fg-muted","#94a3b8"),primary:_(b,"--fg-primary","#f8fafc"),border:_(b,"--border-soft","#334155"),grid:_(b,"--graph-guide","rgba(148, 163, 184, 0.22)"),surface:_(b,"--bg-surface","#111827"),elevated:_(b,"--bg-elevated","#1f2937")},I=A(e);if(I.selectAll("*").remove(),dt(t),this.data.length===0||m<=0||h<=0)return;let u=this.data.map(i=>({date:new Date(i.date),label:i.date,commits:i.commits,additions:i.additions,deletions:i.deletions,churn:i.additions+i.deletions})).filter(i=>!Number.isNaN(i.date.getTime()));if(!u.length)return;let w=_t(u,i=>i.date);+w[0]==+w[1]&&(w[0]=new Date(+w[0]-720*60*1e3),w[1]=new Date(+w[1]+720*60*1e3));let y=Et().domain(w).range([0,m]),C=st().domain([0,Q(u,i=>i.churn)??1]).nice().range([h,0]),q=st().domain([0,Q(u,i=>i.commits)??1]).nice().range([h,0]),s=I.append("defs").append("linearGradient").attr("id","churn-area-gradient").attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%");s.append("stop").attr("offset","0%").attr("stop-color",g.accent).attr("stop-opacity",.24),s.append("stop").attr("offset","100%").attr("stop-color",g.accent).attr("stop-opacity",.02);let p=I.append("g").attr("transform",`translate(${l.left},${l.top})`),M=Pt(",");p.append("g").attr("class","grid").call(ot(C).ticks(4).tickSize(-m).tickFormat(()=>"")).call(i=>i.select(".domain").remove()).call(i=>i.selectAll("line").attr("stroke",g.grid));let x=Math.max(2,Math.min(14,m/Math.max(1,u.length)*.45));p.append("g").selectAll("line.additions").data(u).join("line").attr("class","additions").attr("x1",i=>y(i.date)-x/3).attr("x2",i=>y(i.date)-x/3).attr("y1",h).attr("y2",i=>C(i.additions)).attr("stroke",g.success).attr("stroke-width",x).attr("stroke-linecap","round").attr("opacity",.75),p.append("g").selectAll("line.deletions").data(u).join("line").attr("class","deletions").attr("x1",i=>y(i.date)+x/3).attr("x2",i=>y(i.date)+x/3).attr("y1",h).attr("y2",i=>C(i.deletions)).attr("stroke",g.danger).attr("stroke-width",x).attr("stroke-linecap","round").attr("opacity",.62);let At=zt().x(i=>y(i.date)).y0(h).y1(i=>C(i.churn)).curve(lt);p.append("path").datum(u).attr("d",At).attr("fill","url(#churn-area-gradient)");let Ft=Dt().x(i=>y(i.date)).y(i=>q(i.commits)).curve(lt);p.append("path").datum(u).attr("d",Ft).attr("stroke",g.accent).attr("stroke-width",2).attr("fill","none");let S=p.append("g").attr("display","none");S.append("line").attr("y1",0).attr("y2",h).attr("stroke",g.primary).attr("stroke-opacity",.25).attr("stroke-dasharray","3,3"),S.append("circle").attr("r",4).attr("fill",g.accent).attr("stroke",g.surface).attr("stroke-width",2),p.append("g").attr("class","axis").attr("transform",`translate(0,${h})`).call(Mt(y).ticks(Math.min(8,Math.max(3,Math.floor(m/90)))).tickSizeOuter(0)).call(ct(g)),p.append("g").attr("class","axis").call(ot(C).ticks(4).tickSizeOuter(0)).call(ct(g)),p.append("g").attr("class","axis").attr("transform",`translate(${m},0)`).call(wt(q).ticks(4).tickSizeOuter(0)).call(ct(g)),p.append("text").attr("x",0).attr("y",-4).attr("fill",g.muted).attr("font-size",10).text("churn"),p.append("text").attr("x",m).attr("y",-4).attr("text-anchor","end").attr("fill",g.muted).attr("font-size",10).text("commits");let Nt=Ct(i=>i.date).center;I.attr("tabindex",0).on("pointermove",i=>{let[et,pt]=kt(i,p.node());if(et<0||et>m||pt<0||pt>h){dt(t),S.attr("display","none");return}let Bt=y.invert(et),k=u[Nt(u,Bt)];if(!k)return;let mt=y(k.date),gt=q(k.commits);S.attr("display",null).attr("transform",`translate(${mt},0)`),S.select("circle").attr("cy",gt),jt(t,{x:l.left+mt,y:l.top+Math.min(gt,h-20),date:k.label,commits:M(k.commits),additions:M(k.additions),deletions:M(k.deletions),churn:M(k.churn)})}).on("pointerleave blur",()=>{S.attr("display","none"),this.hideTimer&&clearTimeout(this.hideTimer),this.hideTimer=setTimeout(()=>dt(t),80)})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=z({type:n,selectors:[["app-churn-chart"]],viewQuery:function(t,d){if(t&1&&(B(Lt,7),B(Qt,7)),t&2){let l;G(l=L())&&(d.svgRef=l.first),G(l=L())&&(d.tooltipRef=l.first)}},inputs:{data:"data",height:"height"},features:[X],decls:16,vars:1,consts:[["svg",""],["tooltip",""],[1,"chart-shell"],["aria-hidden","true",1,"legend"],[1,"swatch","commits"],[1,"swatch","additions"],[1,"swatch","deletions"],[1,"chart-wrap"],["width","100%","aria-label","Interactive churn over time"],["hidden","",1,"tooltip"]],template:function(t,d){t&1&&(F(0,"div",2)(1,"div",3)(2,"span"),V(3,"i",4),o(4," commits"),N(),F(5,"span"),V(6,"i",5),o(7," additions"),N(),F(8,"span"),V(9,"i",6),o(10," deletions"),N()(),F(11,"div",7),W(),V(12,"svg",8,0),ut(),V(14,"div",9,1),N()()),t&2&&(c(12),U("height",d.height))},dependencies:[$],styles:["[_nghost-%COMP%]{display:block}.chart-shell[_ngcontent-%COMP%]{display:grid;gap:.45rem}.legend[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;color:var(--fg-muted);font-size:11px}.legend[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex;gap:.35rem;align-items:center}.swatch[_ngcontent-%COMP%]{display:inline-block;width:9px;height:9px;border-radius:999px}.swatch.commits[_ngcontent-%COMP%]{background:var(--chart-line)}.swatch.additions[_ngcontent-%COMP%]{background:var(--chart-add)}.swatch.deletions[_ngcontent-%COMP%]{background:var(--chart-del)}.chart-wrap[_ngcontent-%COMP%]{position:relative;overflow:hidden;border:1px solid var(--border-soft);border-radius:var(--radius-md);background:radial-gradient(circle at 12% 0%,var(--chart-fill),transparent 34%),linear-gradient(180deg,color-mix(in oklab,var(--bg-surface-2) 58%,transparent),transparent 70%),var(--bg-surface-2)}svg[_ngcontent-%COMP%]{display:block;outline:none}[_nghost-%COMP%] .axis text{font-size:10px;font-family:var(--font-mono, monospace)}[_nghost-%COMP%] .axis path, [_nghost-%COMP%] .axis line{shape-rendering:crispEdges}.tooltip[_ngcontent-%COMP%]{position:absolute;z-index:2;min-width:150px;max-width:240px;padding:.5rem .6rem;border:1px solid var(--border-soft);border-radius:var(--radius-sm);background:var(--bg-elevated);color:var(--fg-primary);box-shadow:var(--shadow-md);font-size:11px;line-height:1.35;pointer-events:none;transform:translate(-50%,calc(-100% - 12px))}.tooltip[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-bottom:.25rem;font-size:12px}.tooltip[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;color:var(--fg-muted);font-variant-numeric:tabular-nums}.tooltip[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{color:var(--fg-primary)}"],changeDetection:0})};function ct(n){return e=>{e.selectAll("text").attr("fill",n.muted),e.selectAll("path,line").attr("stroke",n.border)}}function jt(n,e){n&&(n.hidden=!1,n.style.left=`${e.x}px`,n.style.top=`${e.y}px`,n.innerHTML=`
2
+ <strong>${qt(e.date)}</strong>
3
+ <div class="row"><span>Commits</span><span class="value">${e.commits}</span></div>
4
+ <div class="row"><span>Additions</span><span class="value">+${e.additions}</span></div>
5
+ <div class="row"><span>Deletions</span><span class="value">-${e.deletions}</span></div>
6
+ <div class="row"><span>Total churn</span><span class="value">${e.churn}</span></div>
7
+ `)}function dt(n){n&&(n.hidden=!0)}function _(n,e,t){return n.getPropertyValue(e).trim()||t}function qt(n){return n.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]??e)}var Xt=["svg"];function Ut(n,e){n&1&&(r(0,"div",4),o(1,"No hotspots in the current window."),a())}var tt=class n{data=[];height=320;fileClick=new ft;svgRef;ngAfterViewInit(){this.render()}ngOnChanges(){this.render()}render(){if(!this.svgRef)return;let e=this.svgRef.nativeElement,t=e.clientWidth||600,d=A(e);if(d.selectAll("*").remove(),this.data.length===0)return;let l=getComputedStyle(e),m=j(l,"--accent","#4f46e5"),h=j(l,"--fg-muted","#64748b"),b=j(l,"--fg-primary","#0f172a"),g=j(l,"--bg-surface-2","#f3f4f6"),I=j(l,"--border-soft","#e5e7eb"),u=It({name:"root",children:this.data}).sum(s=>s.commits??0).sort((s,p)=>(p.value??0)-(s.value??0));St().size([t,this.height]).padding(2).round(!0)(u);let y=Tt().domain([0,Q(this.data,s=>s.commits)??1]).interpolator(Ot(g,m)),C=d.selectAll("g").data(u.leaves()).join("g").attr("class","cell").attr("transform",s=>`translate(${s.x0},${s.y0})`).on("click",(s,p)=>this.fileClick.emit(p.data.file)).on("mouseenter",function(){A(this).select("rect").attr("stroke-width",2.5).attr("filter","url(#hotspot-glow)")}).on("mouseleave",function(){A(this).select("rect").attr("stroke-width",1).attr("filter",null)});d.append("defs").append("filter").attr("id","hotspot-glow").attr("x","-20%").attr("y","-20%").attr("width","140%").attr("height","140%").append("feDropShadow").attr("dx",0).attr("dy",4).attr("stdDeviation",4).attr("flood-color",m).attr("flood-opacity",.28),C.append("rect").attr("width",s=>s.x1-s.x0).attr("height",s=>s.y1-s.y0).attr("fill",s=>y(s.data.commits)).attr("stroke",I).attr("stroke-width",1),C.append("title").text(s=>{let p=s.data;return`${p.file}
8
+ ${p.commits} commits, ${p.authors} authors
9
+ +${p.additions} -${p.deletions}`}),C.append("text").attr("class","cell-label").attr("x",4).attr("y",12).attr("font-size",10).attr("font-family","var(--font-mono, monospace)").attr("fill",b).attr("stroke",g).attr("stroke-width",2).attr("paint-order","stroke").attr("pointer-events","none").text(s=>{let p=s.x1-s.x0,M=s.y1-s.y0;if(p<40||M<18)return"";let x=s.data.file;return x.split("/").pop()??x}),C.append("text").attr("x",4).attr("y",26).attr("font-size",9).attr("fill",h).attr("pointer-events","none").text(s=>{let p=s.x1-s.x0,M=s.y1-s.y0;if(p<70||M<34)return"";let x=s.data;return`${x.commits} commits \xB7 ${x.authors} authors`})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=z({type:n,selectors:[["app-hotspots-treemap"]],viewQuery:function(t,d){if(t&1&&B(Xt,7),t&2){let l;G(l=L())&&(d.svgRef=l.first)}},inputs:{data:"data",height:"height"},outputs:{fileClick:"fileClick"},features:[X],decls:4,vars:2,consts:[["svg",""],[1,"treemap-wrap"],["width","100%","aria-label","Hotspots treemap"],["class","empty",4,"ngIf"],[1,"empty"]],template:function(t,d){t&1&&(r(0,"div",1),W(),R(1,"svg",2,0),O(3,Ut,2,0,"div",3),a()),t&2&&(c(),U("height",d.height),c(2),v("ngIf",d.data.length===0))},dependencies:[$,Y],styles:["[_nghost-%COMP%]{display:block}.treemap-wrap[_ngcontent-%COMP%]{position:relative;overflow:hidden;border:1px solid var(--border-soft);border-radius:var(--radius-md);background:radial-gradient(circle at 15% 0%,color-mix(in oklab,var(--accent) 12%,transparent),transparent 38%),var(--bg-surface-2)}svg[_ngcontent-%COMP%]{display:block}.empty[_ngcontent-%COMP%]{position:absolute;inset:0;display:grid;place-items:center;color:var(--fg-muted);font-size:12px}"],changeDetection:0})};function j(n,e,t){return n.getPropertyValue(e).trim()||t}function Jt(n,e){if(n&1&&(r(0,"p",7),o(1),rt(2,"slice"),rt(3,"slice"),a()),n&2){let t=e.ngIf;c(),K(" ",at(2,2,t.windowStart,0,10)," \u2192 ",at(3,6,t.windowEnd,0,10)," ")}}function Kt(n,e){n&1&&(r(0,"div",8),o(1,"Computing insights (this may take a few seconds)\u2026"),a())}function Yt(n,e){if(n&1&&(r(0,"div",9),o(1),a()),n&2){let t=e.ngIf;c(),f(t)}}function Zt(n,e){if(n&1&&(r(0,"li")(1,"div",26)(2,"span",27),o(3),a(),r(4,"span",28),o(5),a()(),r(6,"div",29),R(7,"div",30),a()()),n&2){let t=e.$implicit,d=P(2);c(3),f(t.author),c(2),f(t.commits),c(2),it("width",d.barPct(t.commits,d.maxAuthorCommits()),"%")}}function te(n,e){if(n&1){let t=J();r(0,"li")(1,"a",31),H("click",function(){let l=E(t).$implicit,m=P(2);return T(m.openFile(l.file))}),o(2),a(),r(3,"span",32),o(4),a(),r(5,"span",33),o(6),a()()}if(n&2){let t=e.$implicit;c(2),f(t.file),c(2),K("",t.commits,"c \xB7 ",t.authors,"a"),c(2),K("+",t.additions," \u2212",t.deletions)}}function ee(n,e){if(n&1){let t=J();r(0,"li")(1,"a",31),H("click",function(){let l=E(t).$implicit,m=P(2);return T(m.openFile(l.file))}),o(2),a(),r(3,"div",34),R(4,"div",35),r(5,"span",36),o(6),a()(),r(7,"span",37),o(8),a()()}if(n&2){let t=e.$implicit;c(2),f(t.file),c(2),it("width",t.riskScore*100,"%"),c(2),f((t.riskScore*100).toFixed(0)),c(2),f(t.reason)}}function ne(n,e){if(n&1){let t=J();r(0,"div",10)(1,"section",11)(2,"button",12)(3,"span",13),o(4,"Commits analyzed"),a(),r(5,"strong"),o(6),a(),r(7,"span",14),o(8,"current insight window"),a()(),r(9,"button",12)(10,"span",13),o(11,"Contributors"),a(),r(12,"strong"),o(13),a(),r(14,"span",14),o(15),a()(),r(16,"button",15),H("click",function(){let l=E(t).ngIf,m=P();return T(m.openTopHotspot(l))}),r(17,"span",13),o(18,"Hotspots"),a(),r(19,"strong"),o(20),a(),r(21,"span",14),o(22,"click to open the top file"),a()(),r(23,"button",15),H("click",function(){let l=E(t).ngIf,m=P();return T(m.openTopRisk(l))}),r(24,"span",13),o(25,"Risk alerts"),a(),r(26,"strong"),o(27),a(),r(28,"span",14),o(29,"highest churn and ownership risk"),a()()(),r(30,"section",16)(31,"h3"),o(32,"Top contributors"),a(),r(33,"ul",17),O(34,Zt,8,4,"li",18),a()(),r(35,"section",19)(36,"h3"),o(37,"Hotspots "),r(38,"span",20),o(39,"(treemap sized by commit count \u2014 click to drill in)"),a()(),r(40,"app-hotspots-treemap",21),H("fileClick",function(l){E(t);let m=P();return T(m.openFile(l))}),a(),r(41,"ul",22),O(42,te,7,5,"li",18),a()(),r(43,"section",16)(44,"h3"),o(45,"Risky files "),r(46,"span",20),o(47,"(churn \xD7 authors \xD7 recency)"),a()(),r(48,"ul",23),O(49,ee,9,5,"li",18),a()(),r(50,"section",24)(51,"h3"),o(52,"Churn over time"),a(),R(53,"app-churn-chart",25),a()()}if(n&2){let t=e.ngIf,d=P();c(6),f(t.totalCommits),c(7),f(t.totalAuthors),c(2),f(d.topContributor(t)),c(5),f(t.hotspots.length),c(7),f(t.riskyFiles.length),c(7),v("ngForOf",t.topContributors),c(6),v("data",t.hotspots),c(2),v("ngForOf",t.hotspots.slice(0,5)),c(7),v("ngForOf",t.riskyFiles),c(4),v("data",t.churnByDay)}}var Ht=class n{insightsApi=nt(yt);router=nt(bt);bundle=D(null);loading=D(!1);error=D(null);maxAuthorCommits=D(0);maxDayCommits=D(0);constructor(){ht(()=>{this.load()})}trackByDate(e,t){return t.date}barPct(e,t){return t>0?Math.round(e/t*100):0}dayPct(e,t){return t>0?Math.max(2,Math.round(e/t*100)):0}shouldShowLabel(e){return e.endsWith("-01")}openFile(e){this.router.navigate(["/file",encodeURIComponent(e)])}topContributor(e){let t=e.topContributors[0];return t?t.author:"No author data"}openTopHotspot(e){let t=e.hotspots[0]?.file;t&&this.openFile(t)}openTopRisk(e){let t=e.riskyFiles[0]?.file;t&&this.openFile(t)}load(){this.loading.set(!0),this.error.set(null),this.insightsApi.bundle({maxCommits:500}).subscribe({next:e=>{this.bundle.set(e),this.maxAuthorCommits.set(e.topContributors[0]?.commits??0),this.maxDayCommits.set(Math.max(0,...e.churnByDay.map(t=>t.commits))),this.loading.set(!1)},error:e=>{this.error.set(e?.error?.error??"Failed to load insights"),this.loading.set(!1)}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=z({type:n,selectors:[["app-insights"]],decls:11,vars:4,consts:[[1,"page"],[1,"head"],[1,"eyebrow"],["class","sub",4,"ngIf"],["class","empty",4,"ngIf"],["class","empty error",4,"ngIf"],["class","grid",4,"ngIf"],[1,"sub"],[1,"empty"],[1,"empty","error"],[1,"grid"],[1,"kpis"],[1,"kpi"],[1,"label"],[1,"hint"],[1,"kpi",3,"click"],[1,"card"],[1,"bars"],[4,"ngFor","ngForOf"],[1,"card","wide","hotspot-card"],[1,"card-sub"],[3,"fileClick","data"],[1,"hot-list","compact"],[1,"risk-list"],[1,"card","wide","chart-card"],[3,"data"],[1,"bar-row"],[1,"bar-label"],[1,"bar-value"],[1,"bar-track"],[1,"bar-fill"],[1,"path",3,"click"],[1,"count"],[1,"churn"],[1,"risk-bar"],[1,"risk-fill"],[1,"risk-score"],[1,"reason"]],template:function(t,d){t&1&&(r(0,"div",0)(1,"header",1)(2,"div")(3,"p",2),o(4,"Repository intelligence"),a(),r(5,"h2"),o(6,"Insights"),a()(),O(7,Jt,4,10,"p",3),a(),O(8,Kt,2,0,"div",4)(9,Yt,2,1,"div",5)(10,ne,54,10,"div",6),a()),t&2&&(c(7),v("ngIf",d.bundle()),c(),v("ngIf",d.loading()),c(),v("ngIf",d.error()),c(),v("ngIf",d.bundle()))},dependencies:[$,xt,Y,tt,Z,vt],styles:["[_nghost-%COMP%]{display:block;flex:1;min-height:0;overflow-y:auto}.page[_ngcontent-%COMP%]{padding:1.1rem 1.25rem 1.4rem;max-width:1320px;margin:0 auto}.head[_ngcontent-%COMP%]{display:flex;align-items:end;justify-content:space-between;gap:1rem;margin-bottom:1rem}.eyebrow[_ngcontent-%COMP%]{margin:0 0 .2rem;color:var(--accent);font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.head[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:clamp(20px,2vw,28px);letter-spacing:-.03em}.head[_ngcontent-%COMP%] .sub[_ngcontent-%COMP%]{margin:0;color:var(--fg-muted);font-size:13px}.empty[_ngcontent-%COMP%]{padding:2rem;color:var(--fg-muted);text-align:center}.empty.error[_ngcontent-%COMP%]{color:var(--danger)}.grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:1rem}.kpis[_ngcontent-%COMP%]{grid-column:1 / -1;display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.75rem}.kpi[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.25rem;padding:.85rem 1rem;color:var(--fg-primary);background:radial-gradient(circle at 85% 0%,color-mix(in oklab,var(--accent) 16%,transparent),transparent 44%),var(--bg-panel);border:1px solid var(--border-soft);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);cursor:pointer;text-align:left}.kpi[_ngcontent-%COMP%]:hover{border-color:color-mix(in oklab,var(--accent) 36%,var(--border-soft));box-shadow:var(--shadow-md)}.kpi[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{color:var(--fg-muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em}.kpi[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:24px;letter-spacing:-.04em}.kpi[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{color:var(--fg-muted);font-size:11px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card[_ngcontent-%COMP%]{background:var(--bg-panel);border:1px solid var(--border-soft);border-radius:var(--radius-lg);padding:1rem 1.25rem;box-shadow:var(--shadow-sm)}.card.wide[_ngcontent-%COMP%]{grid-column:1 / -1}.card[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:14px}.card-sub[_ngcontent-%COMP%]{font-size:11px;color:var(--fg-muted);font-weight:400;margin-left:.4rem}.bars[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:grid;gap:.6rem}.bar-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;font-size:12px;margin-bottom:3px}.bar-label[_ngcontent-%COMP%]{color:var(--fg-primary)}.bar-value[_ngcontent-%COMP%]{color:var(--fg-muted);font-variant-numeric:tabular-nums}.bar-track[_ngcontent-%COMP%]{height:7px;background:var(--bg-surface-2);border-radius:999px;overflow:hidden}.bar-fill[_ngcontent-%COMP%]{height:100%;background:linear-gradient(90deg,var(--accent),#06b6d4);border-radius:999px}.hot-list[_ngcontent-%COMP%], .risk-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}.hot-list.compact[_ngcontent-%COMP%]{margin-top:.5rem;max-height:130px;overflow-y:auto}.hot-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%], .risk-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr auto auto;gap:.6rem;align-items:center;padding:.4rem 0;border-bottom:1px solid color-mix(in oklab,var(--border-soft) 50%,transparent);font-size:12px}.hot-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child, .risk-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child{border-bottom:0}.path[_ngcontent-%COMP%]{font-family:var(--font-mono, monospace);color:var(--accent);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.path[_ngcontent-%COMP%]:hover{text-decoration:underline}.count[_ngcontent-%COMP%], .churn[_ngcontent-%COMP%]{color:var(--fg-muted);font-size:11px}.risk-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{grid-template-columns:minmax(0,1.5fr) 100px minmax(0,1.5fr)}.risk-bar[_ngcontent-%COMP%]{position:relative;height:16px;background:var(--bg-surface-2);border-radius:999px;overflow:hidden}.risk-fill[_ngcontent-%COMP%]{height:100%;background:linear-gradient(90deg,#10b981,#f59e0b,#ef4444)}.risk-score[_ngcontent-%COMP%]{position:absolute;inset:0;display:grid;place-items:center;font-size:10px;font-weight:600;color:var(--fg-primary);mix-blend-mode:difference}.reason[_ngcontent-%COMP%]{color:var(--fg-muted);font-size:11px}.churn-chart[_ngcontent-%COMP%]{display:flex;align-items:flex-end;height:120px;gap:1px;padding:.5rem 0}.day[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;position:relative}.day-bar[_ngcontent-%COMP%]{width:100%;background:var(--accent);border-radius:2px 2px 0 0;min-height:1px;opacity:.85}.day[_ngcontent-%COMP%]:hover .day-bar[_ngcontent-%COMP%]{opacity:1}.day-label[_ngcontent-%COMP%]{font-size:9px;color:var(--fg-muted);position:absolute;bottom:-16px;transform:rotate(-30deg);transform-origin:top left;white-space:nowrap}"],changeDetection:0})};export{Ht as InsightsComponent};
@@ -1 +1 @@
1
- import{Sb as g,W as i,a as l,b as d,oa as e}from"./chunk-TQE5NWMZ.js";var u=class a{filters=e({page:1,pageSize:100});commits=e([]);total=e(0);page=e(1);pageSize=e(100);loading=e(!1);error=e(null);authors=e([]);branches=e([]);tags=e([]);selectedHash=e(null);selected=g(()=>{let t=this.selectedHash();return t?this.commits().find(n=>n.hash===t)??null:null});paletteOpen=e(!1);shortcutsOpen=e(!1);graphVisible=e(!0);viewMode=e("flat");searchMode=e("classic");nlInterpretation=e(null);patchFilters(t){this.filters.update(n=>d(l(l({},n),t),{page:t.page??1}))}selectHash(t){this.selectedHash.set(t)}selectByOffset(t){let n=this.commits();if(n.length===0)return;let s=this.selectedHash(),r=s?n.findIndex(m=>m.hash===s):-1,o=r===-1?t>0?0:n.length-1:r+t;o=Math.max(0,Math.min(n.length-1,o)),this.selectedHash.set(n[o].hash)}static \u0275fac=function(n){return new(n||a)};static \u0275prov=i({token:a,factory:a.\u0275fac,providedIn:"root"})};export{u as a};
1
+ import{Rb as g,W as i,a as l,b as d,oa as e}from"./chunk-OBPR2XVH.js";var u=class a{filters=e({page:1,pageSize:100});commits=e([]);total=e(0);page=e(1);pageSize=e(100);loading=e(!1);error=e(null);authors=e([]);branches=e([]);tags=e([]);selectedHash=e(null);selected=g(()=>{let t=this.selectedHash();return t?this.commits().find(n=>n.hash===t)??null:null});paletteOpen=e(!1);shortcutsOpen=e(!1);graphVisible=e(!0);viewMode=e("flat");searchMode=e("classic");nlInterpretation=e(null);patchFilters(t){this.filters.update(n=>d(l(l({},n),t),{page:t.page??1}))}selectHash(t){this.selectedHash.set(t)}selectByOffset(t){let n=this.commits();if(n.length===0)return;let s=this.selectedHash(),r=s?n.findIndex(m=>m.hash===s):-1,o=r===-1?t>0?0:n.length-1:r+t;o=Math.max(0,Math.min(n.length-1,o)),this.selectedHash.set(n[o].hash)}static \u0275fac=function(n){return new(n||a)};static \u0275prov=i({token:a,factory:a.\u0275fac,providedIn:"root"})};export{u as a};
@@ -0,0 +1,2 @@
1
+ import{a as Jt,b as en,c as pn}from"./chunk-CFCRPNUQ.js";import{a as rn}from"./chunk-UNROVCUZ.js";import{a as Zt,b as Qt,c as Kt,h as Xt}from"./chunk-UHWTLUOW.js";import{a as tn}from"./chunk-AWMYL3YU.js";import{a as G}from"./chunk-I4VBIHH2.js";import{g as on,i as an,k as sn,l as ln,m as cn,n as dn,o as mn}from"./chunk-EZUFC4CQ.js";import{d as Yt}from"./chunk-6VRZZB3T.js";import{a as nn}from"./chunk-UIWFTWLF.js";import{$ as g,$a as Nt,Ab as v,B as _t,Bb as j,C as ke,Cb as Ve,D as vt,Db as jt,Ea as Ie,Eb as nt,Fb as it,Ga as s,Gb as rt,I as Ct,Ia as Dt,Ib as he,Ja as et,Ka as Pt,Kb as ue,Lb as _e,Ma as It,N as bt,Nb as Fe,P as xt,Pa as D,Q as Je,Qa as pe,Qb as Ht,R as Oe,Ra as se,Rb as ie,S as Ee,Sa as tt,Sb as H,Ta as b,V as wt,Va as Rt,Vb as Gt,W as N,Wa as fe,Wb as Wt,X as de,Xa as Tt,Yb as $t,Z as X,ab as ge,cc as Z,db as h,dc as I,e as ft,ea as k,eb as l,ec as ze,fa as O,fb as a,g as Xe,ga as yt,gb as y,gc as R,hb as Vt,i as gt,ib as Ft,j as T,ja as St,jb as zt,ka as De,kb as Re,kc as Ut,la as Mt,lb as Te,lc as qt,m as ht,mb as V,mc as Le,n as ut,nb as S,oa as w,ob as x,pb as Lt,q as Y,qa as kt,qb as At,ra as Ot,s as Me,sa as Pe,sb as J,tb as ee,ub as te,va as me,vb as Ne,wb as ne,xb as F,yb as Bt,za as Et,zb as c}from"./chunk-OBPR2XVH.js";var Ae=class i{http=g(Le);base="/api";list(n){return this.http.get(`${this.base}/annotations/${n}`)}add(n,e,t){return this.http.post(`${this.base}/annotations/${n}`,{author:e,body:t})}remove(n,e){return this.http.delete(`${this.base}/annotations/${n}/${e}`)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"})};var On=["svg"];function En(i,n){i&1&&(l(0,"div",8),c(1,"No graph data \u2014 changed files have no detectable internal imports."),a())}var Be=class i{impact=null;svgRef;simulation=null;hasData=!1;ngAfterViewInit(){this.render()}ngOnChanges(){this.render()}ngOnDestroy(){this.simulation?.stop()}render(){if(!this.svgRef)return;let n=this.svgRef.nativeElement,e=on(n);e.selectAll("*").remove();let t=this.impact;if(!t||t.dependencyRipple.length===0&&t.modules.length===0){this.hasData=!1;return}this.hasData=!0;let r=n.clientWidth||600,o=280,d=getComputedStyle(n),u=fn(d,"--fg-secondary","#cbd5e1"),m=fn(d,"--bg-surface-2","#0b1020"),_=new Map,p=(f,q,Q)=>{let C=_.get(f);return C||(C={id:f,group:q,label:Q},_.set(f,C)),C};for(let f of t.files)p(`f:${f}`,"changed",ot(f));for(let f of t.modules)p(`m:${f}`,"module",f);for(let f of t.dependencyRipple)p(`f:${f.from}`,"changed",ot(f.from)),p(`f:${f.to}`,"imported",ot(f.to));let M=[];for(let f of t.dependencyRipple)M.push({source:`f:${f.from}`,target:`f:${f.to}`,type:"imports"});for(let f of t.files){let q=Dn(f);t.modules.includes(q)&&M.push({source:`f:${f}`,target:`m:${q}`,type:"in-module"})}let A=Array.from(_.values()),U=e.append("g").attr("stroke","var(--border-strong)").attr("stroke-opacity",.5).selectAll("line").data(M).join("line").attr("stroke-dasharray",f=>f.type==="in-module"?"2,3":null),W=e.append("g").selectAll("circle").data(A).join("circle").attr("r",f=>f.group==="module"?7:5).attr("fill",f=>f.group==="changed"?"var(--accent)":f.group==="imported"?"#f59e0b":"#8b5cf6").attr("stroke","var(--bg-surface-2)").attr("stroke-width",1.5).call(Se());W.append("title").text(f=>f.id.slice(2));let B=e.append("g").selectAll("text").data(A).join("text").attr("class","node-label").attr("dx",8).attr("dy",3).attr("fill",u).attr("stroke",m).attr("stroke-width",2).attr("paint-order","stroke").text(f=>f.label);this.simulation?.stop(),this.simulation=dn(A).force("link",cn(M).id(f=>f.id).distance(60).strength(.4)).force("charge",mn().strength(-160)).force("center",sn(r/2,o/2)).force("collide",ln(14)).on("tick",()=>{U.attr("x1",f=>f.source.x??0).attr("y1",f=>f.source.y??0).attr("x2",f=>f.target.x??0).attr("y2",f=>f.target.y??0),W.attr("cx",f=>f.x??0).attr("cy",f=>f.y??0),B.attr("x",f=>f.x??0).attr("y",f=>f.y??0)});function Se(){function f(C,E){C.active||window.__impactSim?.alphaTarget?.(.3).restart(),E.fx=E.x,E.fy=E.y}function q(C,E){E.fx=C.x,E.fy=C.y}function Q(C,E){C.active||window.__impactSim?.alphaTarget?.(0),E.fx=null,E.fy=null}return an().on("start",f).on("drag",q).on("end",Q)}window.__impactSim=this.simulation}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-impact-graph"]],viewQuery:function(e,t){if(e&1&&J(On,7),e&2){let r;ee(r=te())&&(t.svgRef=r.first)}},inputs:{impact:"impact"},features:[Pe],decls:11,vars:1,consts:[["svg",""],[1,"legend"],[1,"dot","dot-changed"],[1,"dot","dot-imported"],[1,"dot","dot-module"],[1,"canvas-wrap"],["width","100%","height","280","aria-label","Commit impact graph"],["class","empty",4,"ngIf"],[1,"empty"]],template:function(e,t){e&1&&(l(0,"div",1),y(1,"span",2),c(2," changed "),y(3,"span",3),c(4," imports "),y(5,"span",4),c(6," module "),a(),l(7,"div",5),yt(),y(8,"svg",6,0),b(10,En,2,0,"div",7),a()),e&2&&(s(10),h("ngIf",!t.hasData))},dependencies:[R,I],styles:["[_nghost-%COMP%]{display:block}.legend[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;font-size:11px;color:var(--fg-muted);margin-bottom:.4rem}.dot[_ngcontent-%COMP%]{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:4px}.dot-changed[_ngcontent-%COMP%]{background:var(--accent)}.dot-imported[_ngcontent-%COMP%]{background:#f59e0b}.dot-module[_ngcontent-%COMP%]{background:#8b5cf6}.canvas-wrap[_ngcontent-%COMP%]{position:relative;background:radial-gradient(circle at 20% 0%,color-mix(in oklab,var(--accent) 12%,transparent),transparent 34%),var(--bg-surface-2);border-radius:var(--radius-md);border:1px solid var(--border-soft);overflow:hidden}.empty[_ngcontent-%COMP%]{position:absolute;inset:0;display:grid;place-items:center;color:var(--fg-muted);font-size:11px;pointer-events:none}[_nghost-%COMP%] .node-label{font-size:9px;fill:var(--fg-secondary);font-family:var(--font-mono, monospace);pointer-events:none;paint-order:stroke;stroke:var(--bg-app);stroke-width:2px;stroke-linejoin:round}"],changeDetection:0})};function ot(i){let n=i.split("/");return n[n.length-1]}function Dn(i){let n=i.split("/");return n.length===1?"(root)":n.slice(0,Math.min(n.length-1,3)).join("/")}function fn(i,n,e){return i.getPropertyValue(n).trim()||e}function Pn(i,n){if(i&1&&(l(0,"span",36),c(1),a()),i&2){let e=n.$implicit;s(),v(e)}}function In(i,n){if(i&1&&(l(0,"span",37),c(1),a()),i&2){let e=n.$implicit;s(),v(e)}}function Rn(i,n){i&1&&(l(0,"span",38),c(1,"merge"),a())}function Tn(i,n){if(i&1&&(l(0,"pre",39),c(1),a()),i&2){let e=x().ngIf;s(),v(e.body)}}function Nn(i,n){if(i&1){let e=V();l(0,"div",40)(1,"span",41),c(2,"AI"),a(),l(3,"span",42),c(4),a(),l(5,"button",43),S("click",function(){k(e);let r=x(2);return O(r.explanation.set(null))}),c(6,"\xD7"),a()()}if(i&2){let e=n.ngIf;s(4),v(e)}}function Vn(i,n){if(i&1&&(l(0,"div",44),c(1),a()),i&2){let e=n.ngIf;s(),v(e)}}function Fn(i,n){if(i&1&&(l(0,"li"),c(1),a()),i&2){let e=n.$implicit;s(),v(e)}}function zn(i,n){if(i&1){let e=V();l(0,"li",28),S("click",function(){let r=k(e).$implicit,o=x(3);return O(o.state.selectHash(r.hash))}),l(1,"code"),c(2),a(),l(3,"span"),c(4),a()()}if(i&2){let e=n.$implicit;s(2),v(e.hash.slice(0,7)),s(2),v(e.subject)}}function Ln(i,n){if(i&1&&(l(0,"div",45)(1,"div",46)(2,"span"),c(3,"Impact"),a(),l(4,"span",47),c(5),a()(),y(6,"app-impact-graph",48),l(7,"div",49)(8,"div")(9,"h4"),c(10,"Modules"),a(),l(11,"ul",50),b(12,Fn,2,1,"li",51),a()(),l(13,"div")(14,"h4"),c(15,"Related commits"),a(),l(16,"ul",52),b(17,zn,5,2,"li",53),a()()()()),i&2){let e=n.ngIf;s(5),jt(" ",e.files.length," files \xB7 ",e.modules.length," modules \xB7 ",e.relatedCommits.length," related commits "),s(),h("impact",e),s(6),h("ngForOf",e.modules),s(5),h("ngForOf",e.relatedCommits)}}function An(i,n){if(i&1&&(l(0,"span",54),c(1),a()),i&2){let e=x(2);s(),v(e.files().length)}}function Bn(i,n){if(i&1&&(l(0,"span",63),c(1),a()),i&2){let e=x().$implicit;s(),j("+",e.additions)}}function jn(i,n){if(i&1&&(l(0,"span",64),c(1),a()),i&2){let e=x().$implicit;s(),j("\u2212",e.deletions)}}function Hn(i,n){if(i&1){let e=V();l(0,"div",55)(1,"button",56),S("click",function(){let r=k(e).$implicit,o=x(2);return O(o.selectFile(r))}),y(2,"span",57),l(3,"span",58),c(4),a(),l(5,"span",59),b(6,Bn,2,1,"span",60)(7,jn,2,1,"span",61),a()(),l(8,"button",62),S("click",function(){let r=k(e).$implicit,o=x(2);return O(o.openFileHistory(r.file))}),c(9," \u23F1 "),a()()}if(i&2){let e,t=n.$implicit,r=x(2);s(),F("selected",t.file===((e=r.activeFile())==null?null:e.file)),s(),ge("data-status",t.status),s(),h("title",t.file),s(),v(t.file),s(2),h("ngIf",t.additions),s(),h("ngIf",t.deletions)}}function Gn(i,n){i&1&&(l(0,"div",65),c(1," No files changed. "),a())}function Wn(i,n){i&1&&(l(0,"div",65),c(1,"Loading\u2026"),a())}function $n(i,n){if(i&1){let e=V();l(0,"div",66)(1,"div",67)(2,"strong"),c(3),a(),l(4,"span",68),c(5),ue(6,"date"),a(),l(7,"button",69),S("click",function(){let r=k(e).$implicit,o=x(2);return O(o.deleteComment(r.id))}),c(8,"\xD7"),a()(),l(9,"p",70),c(10),a()()}if(i&2){let e=n.$implicit;s(3),v(e.author),s(2),v(_e(6,3,e.createdAt,"short")),s(5),v(e.body)}}function Un(i,n){if(i&1){let e=V();Re(0),l(1,"header",2)(2,"div",3)(3,"span",4),c(4),a(),l(5,"span",5),b(6,Pn,2,1,"span",6)(7,In,2,1,"span",7)(8,Rn,2,0,"span",8),a()(),l(9,"h2",9),c(10),a(),l(11,"div",10)(12,"span"),c(13),a(),l(14,"span",11),c(15,"\u2022"),a(),l(16,"span"),c(17),ue(18,"date"),a()(),b(19,Tn,2,1,"pre",12),l(20,"div",13)(21,"button",14),S("click",function(){k(e);let r=x();return O(r.onExplain())}),c(22),a(),l(23,"button",14),S("click",function(){k(e);let r=x();return O(r.onLoadImpact())}),c(24),a(),l(25,"button",15),S("click",function(){k(e);let r=x();return O(r.copyShareLink())}),c(26),a()(),b(27,Nn,7,1,"div",16)(28,Vn,2,1,"div",17),a(),b(29,Ln,18,6,"div",18),l(30,"div",19)(31,"aside",20)(32,"div",21)(33,"span"),c(34,"Files"),a(),b(35,An,2,1,"span",22),a(),l(36,"div",23),b(37,Hn,10,7,"div",24)(38,Gn,2,0,"div",25)(39,Wn,2,0,"div",25),a()(),l(40,"section",26)(41,"details",27)(42,"summary",28),S("click",function(r){k(e);let o=x();return O(o.toggleAnnotations(r))}),c(43),a(),l(44,"div",29),b(45,$n,11,6,"div",30),l(46,"div",31)(47,"input",32),rt("ngModelChange",function(r){k(e);let o=x();return it(o.commentAuthor,r)||(o.commentAuthor=r),O(r)}),a(),l(48,"textarea",33),rt("ngModelChange",function(r){k(e);let o=x();return it(o.commentDraft,r)||(o.commentDraft=r),O(r)}),a(),l(49,"button",34),S("click",function(){k(e);let r=x();return O(r.addComment())}),c(50,"Post"),a()()()(),y(51,"app-diff-viewer",35),a()(),Te()}if(i&2){let e=n.ngIf,t=x();s(4),v(e.shortHash),s(2),h("ngForOf",e.tags),s(),h("ngForOf",e.branches),s(),h("ngIf",e.isMerge),s(2),v(e.subject),s(3),Ve("",e.author," <",e.authorEmail,">"),s(4),v(_e(18,29,e.date,"medium")),s(2),h("ngIf",e.body),s(2),h("disabled",t.explaining()),s(),j(" ",t.explaining()?"...":"\u2728 Explain change"," "),s(),h("disabled",t.loadingImpact()),s(),j(" ",t.loadingImpact()?"...":t.impact()?"Refresh impact":"Show impact"," "),s(2),j(" ",t.shareCopied()?"Copied!":"\u{1F517} Share"," "),s(),h("ngIf",t.explanation()),s(),h("ngIf",t.explainError()),s(),h("ngIf",t.impact()),s(6),h("ngIf",t.files().length),s(2),h("ngForOf",t.files())("ngForTrackBy",t.trackByFile),s(),h("ngIf",!t.files().length&&!t.loading()),s(),h("ngIf",t.loading()),s(2),h("open",t.annotationsOpen()),s(2),j(" \u{1F4AC} Notes (",t.comments().length,") "),s(2),h("ngForOf",t.comments()),s(2),nt("ngModel",t.commentAuthor),s(),nt("ngModel",t.commentDraft),s(),h("disabled",!t.commentDraft.trim()),s(2),h("fileInput",t.activeFile())}}function qn(i,n){i&1&&(l(0,"div",71)(1,"p",72),c(2,"No commit selected"),a(),l(3,"p",73),c(4," Pick a commit from the list, or press "),l(5,"kbd",74),c(6,"\u2318K"),a(),c(7," to open the command palette. "),a()())}var je=class i{state=g(G);git=g(tn);insightsApi=g(nn);annotationsApi=g(Ae);router=g(Yt);commit=this.state.selected;impact=w(null);loadingImpact=w(!1);explanation=w(null);explainError=w(null);explaining=w(!1);comments=w([]);annotationsOpen=w(!1);shareCopied=w(!1);commentDraft="";commentAuthor="me";loading=w(!1);files=en(Jt(this.commit).pipe(Oe(n=>n?(this.loading.set(!0),this.git.getDiff(n.hash).pipe(vt(()=>Y([])))):(this.loading.set(!1),Y([])))),{initialValue:[]});activeFileIndex=w(0);activeFile=ie(()=>{let n=this.files();if(!n.length)return null;let e=Math.min(this.activeFileIndex(),n.length-1);return n[e]});constructor(){H(()=>{this.files(),this.activeFileIndex.set(0),this.loading.set(!1)}),H(()=>{let n=this.commit();if(this.impact.set(null),this.explanation.set(null),this.explainError.set(null),this.shareCopied.set(!1),!n){this.comments.set([]);return}this.annotationsApi.list(n.hash).subscribe({next:e=>this.comments.set(e),error:()=>this.comments.set([])})})}trackByFile(n,e){return e.file}selectFile(n){let e=this.files().findIndex(t=>t.file===n.file);e>=0&&this.activeFileIndex.set(e)}openFileHistory(n){this.router.navigate(["/file",encodeURIComponent(n)])}shortPath(n){if(n.length<=32)return n;let e=n.split("/");return e.length<=2?n:e[0]+"/.../"+e.slice(-2).join("/")}onLoadImpact(){let n=this.commit();n&&(this.loadingImpact.set(!0),this.insightsApi.impact(n.hash).subscribe({next:e=>{this.impact.set(e),this.loadingImpact.set(!1)},error:()=>this.loadingImpact.set(!1)}))}onExplain(){let n=this.commit();!n||this.explaining()||(this.explaining.set(!0),this.explainError.set(null),this.insightsApi.explainCommit(n.hash).subscribe({next:e=>{this.explanation.set(e.summary),this.explaining.set(!1)},error:e=>{this.explainError.set(e?.error?.error??"AI explanation unavailable. Set ANTHROPIC_API_KEY or OPENAI_API_KEY."),this.explaining.set(!1)}}))}copyShareLink(){let n=this.commit();if(!n)return;let e=`${window.location.origin}/?commit=${n.hash}`;navigator.clipboard?.writeText(e).then(()=>{this.shareCopied.set(!0),setTimeout(()=>this.shareCopied.set(!1),1500)}).catch(()=>{this.shareCopied.set(!1)})}toggleAnnotations(n){setTimeout(()=>this.annotationsOpen.set(!this.annotationsOpen()),0)}addComment(){let n=this.commit();!n||!this.commentDraft.trim()||this.annotationsApi.add(n.hash,this.commentAuthor||"anonymous",this.commentDraft.trim()).subscribe({next:e=>{this.comments.set([...this.comments(),e]),this.commentDraft=""}})}deleteComment(n){let e=this.commit();e&&this.annotationsApi.remove(e.hash,n).subscribe({next:()=>this.comments.set(this.comments().filter(t=>t.id!==n))})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-commit-detail"]],decls:3,vars:2,consts:[["empty",""],[4,"ngIf","ngIfElse"],[1,"head"],[1,"row"],[1,"hash"],[1,"badges"],["class","badge tag",4,"ngFor","ngForOf"],["class","badge branch",4,"ngFor","ngForOf"],["class","badge merge",4,"ngIf"],[1,"subject"],[1,"meta"],[1,"dot"],["class","body",4,"ngIf"],[1,"actions"],[1,"btn","btn-ghost","btn-sm",3,"click","disabled"],[1,"btn","btn-ghost","btn-sm",3,"click"],["class","ai-card",4,"ngIf"],["class","ai-card error",4,"ngIf"],["class","impact-card",4,"ngIf"],[1,"split"],[1,"files"],[1,"files-header"],["class","count",4,"ngIf"],[1,"files-list"],["class","file-row",4,"ngFor","ngForOf","ngForTrackBy"],["class","files-empty",4,"ngIf"],[1,"diff"],[1,"annotations",3,"open"],[3,"click"],[1,"annot-body"],["class","comment",4,"ngFor","ngForOf"],[1,"comment-form"],["placeholder","Your name",1,"input",3,"ngModelChange","ngModel"],["placeholder","Add a note for your team\u2026",1,"input",3,"ngModelChange","ngModel"],[1,"btn",3,"click","disabled"],[3,"fileInput"],[1,"badge","tag"],[1,"badge","branch"],[1,"badge","merge"],[1,"body"],[1,"ai-card"],[1,"ai-pill"],[1,"ai-text"],[1,"btn","btn-ghost","btn-icon","close",3,"click"],[1,"ai-card","error"],[1,"impact-card"],[1,"impact-head"],[1,"impact-meta"],[3,"impact"],[1,"impact-body"],[1,"modules"],[4,"ngFor","ngForOf"],[1,"related"],[3,"click",4,"ngFor","ngForOf"],[1,"count"],[1,"file-row"],[1,"file",3,"click"],[1,"status-dot"],[1,"path",3,"title"],[1,"counts"],["class","add",4,"ngIf"],["class","del",4,"ngIf"],["title","View file history",1,"file-history",3,"click"],[1,"add"],[1,"del"],[1,"files-empty"],[1,"comment"],[1,"comment-head"],[1,"comment-date"],["title","Delete",1,"btn","btn-ghost","btn-icon",3,"click"],[1,"comment-body"],[1,"placeholder"],[1,"title"],[1,"hint"],[1,"kbd"]],template:function(e,t){if(e&1&&b(0,Un,52,32,"ng-container",1)(1,qn,8,0,"ng-template",null,0,Fe),e&2){let r=Ne(2);h("ngIf",t.commit())("ngIfElse",r)}},dependencies:[R,Z,I,Xt,Zt,Qt,Kt,rn,Be,ze],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0;background:transparent}.head[_ngcontent-%COMP%]{position:sticky;top:0;z-index:3;padding:.9rem 1rem .8rem;border-bottom:1px solid var(--border-soft);background:color-mix(in oklab,var(--bg-glass) 95%,transparent);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-bottom:.4rem}.hash[_ngcontent-%COMP%]{font-family:var(--font-mono);font-size:12px;color:var(--fg-muted);padding:2px 6px;background:color-mix(in oklab,var(--bg-surface-2) 78%,transparent);border:1px solid var(--border-soft);border-radius:999px}.badges[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:4px;max-height:44px;overflow:hidden}.badge[_ngcontent-%COMP%]{font-size:10px;font-weight:600;padding:2px 7px;border-radius:999px;border:1px solid transparent;max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.badge.tag[_ngcontent-%COMP%]{background:#d9770626;color:var(--warning);border-color:color-mix(in oklab,var(--warning) 24%,transparent)}.badge.branch[_ngcontent-%COMP%]{background:var(--accent-soft);color:var(--accent);border-color:color-mix(in oklab,var(--accent) 24%,transparent)}.badge.merge[_ngcontent-%COMP%]{background:#8b5cf62e;color:#8b5cf6}.subject[_ngcontent-%COMP%]{font-size:clamp(17px,1.6vw,22px);margin:0 0 4px;font-weight:600}.meta[_ngcontent-%COMP%]{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--fg-muted)}.meta[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{opacity:.5}.body[_ngcontent-%COMP%]{white-space:pre-wrap;font-family:var(--font-mono);font-size:12px;color:var(--fg-secondary);background:var(--bg-surface-2);border:1px solid var(--border-soft);border-radius:var(--radius-sm);padding:.5rem .75rem;margin-top:.5rem;max-height:160px;overflow:auto}.split[_ngcontent-%COMP%]{flex:1;display:grid;grid-template-columns:minmax(240px,300px) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:.75rem;padding:.75rem;min-height:0;overflow:hidden}.files[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:0;background:var(--bg-panel);border:1px solid var(--border-soft);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);overflow:hidden}.files-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding:.6rem .85rem;font-size:12px;color:var(--fg-muted);border-bottom:1px solid var(--border-soft);background:color-mix(in oklab,var(--bg-surface) 82%,transparent)}.count[_ngcontent-%COMP%]{background:var(--bg-surface-2);padding:0 6px;border-radius:999px;font-size:11px}.files-list[_ngcontent-%COMP%]{overflow:auto;flex:1;min-height:0}.file[_ngcontent-%COMP%]{display:grid;grid-template-columns:10px 1fr auto;gap:.5rem;align-items:center;width:100%;padding:.5rem .75rem;border:0;background:transparent;color:inherit;cursor:pointer;text-align:left;border-bottom:1px solid var(--border-soft);font-size:12px}.file[_ngcontent-%COMP%]:hover{background:color-mix(in oklab,var(--bg-hover) 74%,transparent)}.file.selected[_ngcontent-%COMP%]{background:color-mix(in oklab,var(--accent) 15%,transparent);box-shadow:inset 3px 0 0 var(--accent)}.file[_ngcontent-%COMP%] .path[_ngcontent-%COMP%]{font-family:var(--font-mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:rtl;text-align:left}.status-dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background:var(--accent)}.status-dot[data-status=added][_ngcontent-%COMP%]{background:var(--success)}.status-dot[data-status=deleted][_ngcontent-%COMP%]{background:var(--danger)}.status-dot[data-status=renamed][_ngcontent-%COMP%], .status-dot[data-status=copied][_ngcontent-%COMP%]{background:var(--warning)}.status-dot[data-status=binary][_ngcontent-%COMP%]{background:var(--fg-muted)}.counts[_ngcontent-%COMP%]{display:flex;gap:6px;font-family:var(--font-mono);font-size:11px}.counts[_ngcontent-%COMP%] .add[_ngcontent-%COMP%]{color:var(--success)}.counts[_ngcontent-%COMP%] .del[_ngcontent-%COMP%]{color:var(--danger)}.files-empty[_ngcontent-%COMP%]{padding:1rem;color:var(--fg-muted);font-size:12px;text-align:center}.diff[_ngcontent-%COMP%]{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-radius:var(--radius-md);background:var(--bg-panel);border:1px solid var(--border-soft);box-shadow:var(--shadow-sm)}.placeholder[_ngcontent-%COMP%]{flex:1;display:grid;place-items:center;text-align:center;color:var(--fg-muted)}.placeholder[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;margin-bottom:4px;color:var(--fg-secondary)}.placeholder[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{font-size:13px}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.6rem}.btn-sm[_ngcontent-%COMP%]{font-size:11px;padding:.3rem .65rem}.ai-card[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.55rem .75rem;margin-top:.5rem;background:color-mix(in oklab,var(--accent) 12%,transparent);border-radius:var(--radius-sm);font-size:12px;color:var(--fg-secondary)}.ai-card.error[_ngcontent-%COMP%]{background:#ef44441f;color:var(--danger)}.ai-pill[_ngcontent-%COMP%]{flex-shrink:0;font-size:10px;font-weight:700;letter-spacing:.04em;background:var(--accent);color:var(--accent-fg);padding:1px 5px;border-radius:4px}.ai-text[_ngcontent-%COMP%]{flex:1;line-height:1.5}.ai-card[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{font-size:14px;line-height:1;padding:0 6px}.impact-card[_ngcontent-%COMP%]{margin:.6rem 1rem;background:var(--bg-panel);border:1px solid var(--border-soft);border-radius:var(--radius-lg);padding:.75rem 1rem;box-shadow:var(--shadow-sm)}.impact-head[_ngcontent-%COMP%]{display:flex;justify-content:space-between;font-weight:600;margin-bottom:.5rem;font-size:13px}.impact-meta[_ngcontent-%COMP%]{color:var(--fg-muted);font-weight:400;font-size:11px}.impact-body[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.75rem;font-size:12px}.impact-body[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 .4rem;font-size:11px;color:var(--fg-muted);text-transform:uppercase;letter-spacing:.04em}.impact-body[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}.impact-body[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding:2px 0;word-break:break-all}.modules[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{font-family:var(--font-mono, monospace)}.ripple[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{font-size:11px;color:var(--fg-secondary)}.related[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{cursor:pointer;display:flex;gap:.4rem}.related[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover{color:var(--accent)}.related[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--font-mono, monospace);color:var(--fg-muted);flex-shrink:0}.impact-body[_ngcontent-%COMP%] .muted[_ngcontent-%COMP%]{color:var(--fg-muted);font-style:italic;margin:0;font-size:11px}.file-row[_ngcontent-%COMP%]{display:flex}.file-row[_ngcontent-%COMP%] .file[_ngcontent-%COMP%]{flex:1}.file-history[_ngcontent-%COMP%]{background:transparent;border:0;border-bottom:1px solid var(--border-soft);cursor:pointer;color:var(--fg-muted);padding:0 .6rem;font-size:12px}.file-history[_ngcontent-%COMP%]:hover{background:var(--bg-elevated);color:var(--accent)}.annotations[_ngcontent-%COMP%]{margin:.5rem;background:var(--bg-surface);border:1px solid var(--border-soft);border-radius:var(--radius-sm)}.annotations[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]{padding:.4rem .7rem;cursor:pointer;font-size:12px;color:var(--fg-secondary);-webkit-user-select:none;user-select:none}.annotations[open][_ngcontent-%COMP%] summary[_ngcontent-%COMP%]{border-bottom:1px solid var(--border-soft)}.annot-body[_ngcontent-%COMP%]{padding:.5rem .7rem}.comment[_ngcontent-%COMP%]{padding:.4rem 0;border-bottom:1px dashed var(--border-soft);font-size:12px}.comment[_ngcontent-%COMP%]:last-of-type{border-bottom:0}.comment-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.comment-date[_ngcontent-%COMP%]{color:var(--fg-muted);font-size:11px;flex:1}.comment-body[_ngcontent-%COMP%]{margin:.2rem 0 0;line-height:1.4;white-space:pre-wrap}.comment-form[_ngcontent-%COMP%]{display:flex;gap:.4rem;flex-direction:column;margin-top:.5rem}.comment-form[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{width:100%;padding:.35rem .5rem;background:var(--bg-app);border:1px solid var(--border-soft);border-radius:var(--radius-sm);color:var(--fg-primary);font-family:inherit;font-size:12px}.comment-form[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{min-height:60px;resize:vertical}.comment-form[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{align-self:flex-end}"],changeDetection:0})};var Yn=["canvas"],Zn=["scroll"];function Qn(i,n){if(i&1&&y(0,"span",11),i&2){let e=n.$implicit;ne("background",e)}}function Kn(i,n){i&1&&(l(0,"div",12),c(1," No commits to draw. "),a())}var P=34,be=24,He=5.5,at=16,xe=16,st=["#4f46e5","#06b6d4","#f59e0b","#ef4444","#10b981","#8b5cf6","#ec4899","#0ea5e9"],Ge=class i{state=g(G);theme=g(pn);legendColors=st.slice(0,5);graphSummary=ie(()=>{let n=this.state.commits().length,e=this.laneCount;return n?`${n.toLocaleString()} commits across ${e} lane${e===1?"":"s"}`:"Swim-lane visualization"});contentHeight=ie(()=>{let n=this.state.commits().length;return n?xe*2+n*P:0});canvasRef;scrollRef;nodes=[];rowByHash=new Map;laneCount=1;hoverRow=-1;layoutToken=0;idleHandle=null;canvasSize={width:0,height:0,dpr:0};canvasTransform="";onCanvasClick=n=>this.onClick(n);onCanvasMove=n=>this.onMouseMove(n);onCanvasLeave=()=>this.onMouseLeave();scrollRaf=0;onScroll=()=>{this.scrollRaf||(this.scrollRaf=requestAnimationFrame(()=>{this.scrollRaf=0,this.draw()}))};constructor(){H(()=>{this.scheduleLayout(this.state.commits())}),H(()=>{this.state.selectedHash(),this.theme.resolved(),this.draw()})}ngAfterViewInit(){let n=this.canvasRef.nativeElement;n.addEventListener("click",this.onCanvasClick),n.addEventListener("mousemove",this.onCanvasMove),n.addEventListener("mouseleave",this.onCanvasLeave),this.scrollRef?.nativeElement.addEventListener("scroll",this.onScroll,{passive:!0}),this.draw()}ngOnDestroy(){let n=this.canvasRef?.nativeElement;n?.removeEventListener("click",this.onCanvasClick),n?.removeEventListener("mousemove",this.onCanvasMove),n?.removeEventListener("mouseleave",this.onCanvasLeave),this.scrollRef?.nativeElement.removeEventListener("scroll",this.onScroll),this.scrollRaf&&cancelAnimationFrame(this.scrollRaf),this.cancelIdleLayout()}onResize(){this.draw()}scheduleLayout(n){let e=++this.layoutToken;if(this.cancelIdleLayout(),this.nodes=[],this.rowByHash.clear(),this.hoverRow=-1,!n.length){this.laneCount=1,this.draw();return}let t=[],r=m=>{let _=t.indexOf(m);if(_>=0)return _;let p=t.indexOf(null);return p>=0?(t[p]=m,p):(t.push(m),t.length-1)},o=m=>{let _=n[m],p=r(_.hash),M={commit:_,row:m,lane:p};this.nodes.push(M),this.rowByHash.set(_.hash,M);let[A,...U]=_.parents;t[p]=A??null;for(let W of U)if(t.indexOf(W)===-1){let B=t.indexOf(null);B>=0?t[B]=W:t.push(W)}for(;t.length&&t[t.length-1]===null;)t.pop();p+1>this.laneCount&&(this.laneCount=p+1)};if(this.laneCount=1,n.length<=5e3){for(let m=0;m<n.length;m++)o(m);this.draw();return}let d=0,u=m=>{if(e!==this.layoutToken)return;let _=performance.now();for(;d<n.length;){o(d++);let p=m?.timeRemaining?.()??0;if(d%250===0&&p<=1&&performance.now()-_>8)break}this.draw(),d<n.length&&e===this.layoutToken&&(this.idleHandle=this.requestIdle(u))};this.idleHandle=this.requestIdle(u)}draw(){let n=this.canvasRef?.nativeElement;if(!n)return;let e=this.scrollRef?.nativeElement,t=window.devicePixelRatio||1,r=at*2+this.laneCount*be,o=e?.scrollTop??0,d=e?.clientHeight??0,u=Math.max(r,e?.clientWidth??r),m=Math.max(d||P*8,P);this.ensureCanvasSize(n,u,m,t);let _=`translateY(${o}px)`;this.canvasTransform!==_&&(this.canvasTransform=_,n.style.transform=_);let p=n.getContext("2d"),M=this.readTheme(n);if(p.setTransform(t,0,0,t,0,-o*t),p.clearRect(0,o,u,m),p.fillStyle=M.surface,p.fillRect(0,o,u,m),!this.nodes.length)return;let A=C=>at+C*be+be/2,U=C=>xe+C*P+P/2,W=C=>st[C%st.length],B=this.state.selectedHash(),Se=P*4,f=Math.max(0,Math.floor((o-xe-Se)/P)),q=Math.min(this.nodes.length-1,Math.ceil((o+m-xe+Se)/P)),Q=this.nodes.slice(f,q+1);this.drawRows(p,u,A,U,M,B,Q),this.drawGuides(p,o,m,M),p.lineCap="round",p.lineJoin="round";for(let C of Q)for(let E of C.commit.parents){let $=this.rowByHash.get(E);if(!$)continue;let oe=A(C.lane),K=U(C.row),ce=A($.lane),ae=U($.row);p.strokeStyle=M.shadow,p.lineWidth=4,p.globalAlpha=.35,this.drawEdge(p,oe,K,ce,ae),p.strokeStyle=W($.lane),p.lineWidth=C.commit.isMerge?2.6:2.2,p.globalAlpha=B&&B!==C.commit.hash&&B!==$.commit.hash?.55:.9,this.drawEdge(p,oe,K,ce,ae),p.globalAlpha=1}for(let C of Q){let E=A(C.lane),$=U(C.row),oe=W(C.lane),K=C.commit.hash===B,ce=C.row===this.hoverRow,ae=K?He+2:ce?He+1:He;p.beginPath(),p.arc(E,$,ae+3,0,Math.PI*2),p.fillStyle=M.nodeRing,p.fill(),p.beginPath(),p.arc(E,$,ae,0,Math.PI*2),p.fillStyle=C.commit.isMerge?M.surface:oe,p.fill(),p.lineWidth=C.commit.isMerge||K?2.5:1.75,p.strokeStyle=oe,p.stroke(),(K||ce)&&(p.beginPath(),p.arc(E,$,ae+5,0,Math.PI*2),p.strokeStyle=oe,p.globalAlpha=K?.42:.24,p.lineWidth=2,p.stroke(),p.globalAlpha=1)}}drawRows(n,e,t,r,o,d,u=this.nodes){for(let m of u){let _=r(m.row)-P/2;if(m.row%2===1&&(n.fillStyle=o.rowAlt,n.fillRect(0,_,e,P)),(m.row===this.hoverRow||m.commit.hash===d)&&(n.fillStyle=m.commit.hash===d?o.rowSelected:o.rowHover,this.roundRect(n,6,_+3,e-12,P-6,8),n.fill()),m.commit.branches.length||m.commit.tags.length){let p=t(m.lane)+He+8;this.drawRefPill(n,p,r(m.row),m.commit,o)}}}drawGuides(n,e,t,r){n.save(),n.strokeStyle=r.guide,n.lineWidth=1,n.setLineDash([3,5]);let o=e,d=e+t;for(let u=0;u<this.laneCount;u++){let m=at+u*be+be/2;n.beginPath(),n.moveTo(m,o),n.lineTo(m,d),n.stroke()}n.restore()}ensureCanvasSize(n,e,t,r){let o=Math.floor(e*r),d=Math.floor(t*r);this.canvasSize.width===o&&this.canvasSize.height===d&&this.canvasSize.dpr===r||(this.canvasSize={width:o,height:d,dpr:r},n.width=o,n.height=d,n.style.width=`${e}px`,n.style.height=`${t}px`)}requestIdle(n){let e=window.requestIdleCallback;return e?e(n,{timeout:100}):window.setTimeout(()=>n(),16)}cancelIdleLayout(){this.idleHandle!==null&&(window.cancelIdleCallback?window.cancelIdleCallback(this.idleHandle):clearTimeout(this.idleHandle),this.idleHandle=null)}drawEdge(n,e,t,r,o){if(n.beginPath(),n.moveTo(e,t),e===r)n.lineTo(r,o);else{let d=t+Math.min(P*.75,Math.max(12,(o-t)*.36));n.bezierCurveTo(e,d,r,d,r,o)}n.stroke()}drawRefPill(n,e,t,r,o){let d=r.tags[0]??r.branches.find(M=>!Xn(M));if(!d)return;let u=Math.max(0,n.canvas.clientWidth-e-8);if(u<28)return;let m=Jn(d,u>72?12:8);n.font="600 10px ui-sans-serif, system-ui, sans-serif";let _=Math.min(u,72,n.measureText(m).width+14),p=18;n.fillStyle=r.tags.length?o.warningSoft:o.accentSoft,this.roundRect(n,e,t-p/2,_,p,999),n.fill(),n.fillStyle=r.tags.length?o.warning:o.accent,n.fillText(m,e+7,t+3.5)}onClick(n){let e=this.nodeFromEvent(n);e&&this.state.selectHash(e.commit.hash)}onMouseMove(n){let e=this.nodeFromEvent(n),t=e?.row??-1;t!==this.hoverRow&&(this.hoverRow=t,this.canvasRef.nativeElement.style.cursor=e?"pointer":"default",this.draw())}onMouseLeave(){this.hoverRow!==-1&&(this.hoverRow=-1,this.canvasRef.nativeElement.style.cursor="default",this.draw())}nodeFromEvent(n){let e=this.scrollRef?.nativeElement,t=e?.getBoundingClientRect();if(!t)return;let r=n.clientY-t.top+(e?.scrollTop??0),o=Math.floor((r-xe)/P);return this.nodes[o]}readTheme(n){let e=getComputedStyle(n);return{accent:this.css(e,"--accent","#4f46e5"),accentSoft:this.css(e,"--accent-soft","#eef2ff"),guide:this.css(e,"--graph-guide","rgba(148, 163, 184, 0.28)"),nodeRing:this.css(e,"--graph-node-ring","#ffffff"),rowAlt:this.css(e,"--graph-row-alt","rgba(15, 23, 42, 0.025)"),rowHover:this.css(e,"--graph-row-hover","rgba(79, 70, 229, 0.08)"),rowSelected:this.css(e,"--graph-row-selected","rgba(79, 70, 229, 0.14)"),shadow:this.css(e,"--graph-shadow","rgba(15, 23, 42, 0.12)"),surface:this.css(e,"--bg-panel","#ffffff"),warning:this.css(e,"--warning","#d97706"),warningSoft:"rgba(217, 119, 6, 0.15)"}}css(n,e,t){return n.getPropertyValue(e).trim()||t}roundRect(n,e,t,r,o,d){let u=Math.min(d,r/2,o/2);n.beginPath(),n.moveTo(e+u,t),n.arcTo(e+r,t,e+r,t+o,u),n.arcTo(e+r,t+o,e,t+o,u),n.arcTo(e,t+o,e,t,u),n.arcTo(e,t,e+r,t,u),n.closePath()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-commit-graph"]],viewQuery:function(e,t){if(e&1&&(J(Yn,7),J(Zn,7)),e&2){let r;ee(r=te())&&(t.canvasRef=r.first),ee(r=te())&&(t.scrollRef=r.first)}},hostBindings:function(e,t){e&1&&S("resize",function(){return t.onResize()},Ie)},decls:14,vars:5,consts:[["scroll",""],["canvas",""],[1,"header"],[1,"title"],[1,"hint"],["aria-hidden","true",1,"legend"],["class","swatch",3,"background",4,"ngFor","ngForOf"],[1,"scroll"],[1,"phantom"],["aria-label","Commit graph","role","img"],["class","empty",4,"ngIf"],[1,"swatch"],[1,"empty"]],template:function(e,t){e&1&&(l(0,"div",2)(1,"div",3)(2,"span"),c(3,"Graph"),a(),l(4,"span",4),c(5),a()(),l(6,"div",5),b(7,Qn,1,2,"span",6),a()(),l(8,"div",7,0),y(10,"div",8)(11,"canvas",9,1),b(13,Kn,2,0,"div",10),a()),e&2&&(s(5),v(t.graphSummary()),s(2),h("ngForOf",t.legendColors),s(3),ne("height",t.contentHeight(),"px"),s(3),h("ngIf",!t.state.commits().length&&!t.state.loading()))},dependencies:[R,Z,I],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0;background:transparent}.header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.65rem .85rem;border-bottom:1px solid var(--border-soft);font-size:12px;color:var(--fg-muted);background:color-mix(in oklab,var(--bg-surface) 88%,transparent)}.title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1px;min-width:0}.title[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:first-child{color:var(--fg-primary);font-size:13px;font-weight:600}.hint[_ngcontent-%COMP%]{white-space:nowrap}.legend[_ngcontent-%COMP%]{display:flex;gap:4px;align-items:center;flex:0 0 auto}.swatch[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:999px;box-shadow:0 0 0 2px var(--bg-surface)}.scroll[_ngcontent-%COMP%]{position:relative;flex:1;overflow:auto;min-height:0;background:radial-gradient(circle at 24px 24px,var(--graph-row-alt) 0 1px,transparent 1px 100%),linear-gradient(180deg,color-mix(in oklab,var(--bg-surface) 92%,transparent),color-mix(in oklab,var(--bg-surface-2) 76%,transparent));background-size:24px 24px}.phantom[_ngcontent-%COMP%]{width:1px;pointer-events:none}canvas[_ngcontent-%COMP%]{display:block;position:absolute;top:0;left:0;pointer-events:auto;will-change:transform}.empty[_ngcontent-%COMP%]{position:absolute;inset:0;display:grid;place-items:center;padding:1rem;color:var(--fg-muted);font-size:12px;text-align:center}"],changeDetection:0})};function Xn(i){return i.startsWith("origin/")||i.includes("/origin/")}function Jn(i,n){return i.length>n?`${i.slice(0,Math.max(1,n-1))}...`:i}function we(i,n=0){return ei(i)?Number(i):arguments.length===2?n:0}function ei(i){return!isNaN(parseFloat(i))&&!isNaN(Number(i))}function gn(i){return i instanceof me?i.nativeElement:i}var lt;try{lt=typeof Intl<"u"&&Intl.v8BreakIterator}catch{lt=!1}var We=(()=>{class i{_platformId=g(Et);isBrowser=this._platformId?Ut(this._platformId):typeof document=="object"&&!!document;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!!(window.chrome||lt)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(){}static \u0275fac=function(t){return new(t||i)};static \u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var ti=new X("cdk-dir-doc",{providedIn:"root",factory:ni});function ni(){return g(De)}var ii=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function ri(i){let n=i?.toLowerCase()||"";return n==="auto"&&typeof navigator<"u"&&navigator?.language?ii.test(navigator.language)?"rtl":"ltr":n==="rtl"?"rtl":"ltr"}var hn=(()=>{class i{get value(){return this.valueSignal()}valueSignal=w("ltr");change=new Rt;constructor(){let e=g(ti,{optional:!0});if(e){let t=e.body?e.body.dir:null,r=e.documentElement?e.documentElement.dir:null;this.valueSignal.set(ri(t||r||"ltr"))}}ngOnDestroy(){this.change.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var L=(function(i){return i[i.NORMAL=0]="NORMAL",i[i.NEGATED=1]="NEGATED",i[i.INVERTED=2]="INVERTED",i})(L||{}),$e,re;function un(){if(re==null){if(typeof document!="object"||!document||typeof Element!="function"||!Element)return re=!1,re;if(document.documentElement?.style&&"scrollBehavior"in document.documentElement.style)re=!0;else{let i=Element.prototype.scrollTo;i?re=!/\{\s*\[native code\]\s*\}/.test(i.toString()):re=!1}}return re}function le(){if(typeof document!="object"||!document)return L.NORMAL;if($e==null){let i=document.createElement("div"),n=i.style;i.dir="rtl",n.width="1px",n.overflow="auto",n.visibility="hidden",n.pointerEvents="none",n.position="absolute";let e=document.createElement("div"),t=e.style;t.width="2px",t.height="1px",i.appendChild(e),document.body.appendChild(i),$e=L.NORMAL,i.scrollLeft===0&&(i.scrollLeft=1,$e=i.scrollLeft===0?L.NEGATED:L.INVERTED),i.remove()}return $e}var ct=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=pe({type:i});static \u0275inj=de({})}return i})();var Ue=class{};function _n(i){return i&&typeof i.connect=="function"&&!(i instanceof gt)}var qe=class extends Ue{_data;constructor(n){super(),this._data=n}connect(){return Me(this._data)?this._data:Y(this._data)}disconnect(){}},ye=(function(i){return i[i.REPLACED=0]="REPLACED",i[i.INSERTED=1]="INSERTED",i[i.MOVED=2]="MOVED",i[i.REMOVED=3]="REMOVED",i})(ye||{}),dt=new X("_ViewRepeater"),Ye=class{viewCacheSize=20;_viewCache=[];applyChanges(n,e,t,r,o){n.forEachOperation((d,u,m)=>{let _,p;if(d.previousIndex==null){let M=()=>t(d,u,m);_=this._insertView(M,m,e,r(d)),p=_?ye.INSERTED:ye.REPLACED}else m==null?(this._detachAndCacheView(u,e),p=ye.REMOVED):(_=this._moveView(u,m,e,r(d)),p=ye.MOVED);o&&o({context:_?.context,operation:p,record:d})})}detach(){for(let n of this._viewCache)n.destroy();this._viewCache=[]}_insertView(n,e,t,r){let o=this._insertViewFromCache(e,t);if(o){o.context.$implicit=r;return}let d=n();return t.createEmbeddedView(d.templateRef,d.context,d.index)}_detachAndCacheView(n,e){let t=e.detach(n);this._maybeCacheView(t,e)}_moveView(n,e,t,r){let o=t.get(n);return t.move(o,e),o.context.$implicit=r,o}_maybeCacheView(n,e){if(this._viewCache.length<this.viewCacheSize)this._viewCache.push(n);else{let t=e.indexOf(n);t===-1?n.destroy():e.remove(t)}}_insertViewFromCache(n,e){let t=this._viewCache.pop();return t&&e.insert(t,n),t||null}};var oi=["contentWrapper"],ai=["*"],xn=new X("VIRTUAL_SCROLL_STRATEGY"),mt=class{_scrolledIndexChange=new T;scrolledIndexChange=this._scrolledIndexChange.pipe(Ct());_viewport=null;_itemSize;_minBufferPx;_maxBufferPx;constructor(n,e,t){this._itemSize=n,this._minBufferPx=e,this._maxBufferPx=t}attach(n){this._viewport=n,this._updateTotalContentSize(),this._updateRenderedRange()}detach(){this._scrolledIndexChange.complete(),this._viewport=null}updateItemAndBufferSize(n,e,t){t<e,this._itemSize=n,this._minBufferPx=e,this._maxBufferPx=t,this._updateTotalContentSize(),this._updateRenderedRange()}onContentScrolled(){this._updateRenderedRange()}onDataLengthChanged(){this._updateTotalContentSize(),this._updateRenderedRange()}onContentRendered(){}onRenderedOffsetChanged(){}scrollToIndex(n,e){this._viewport&&this._viewport.scrollToOffset(n*this._itemSize,e)}_updateTotalContentSize(){this._viewport&&this._viewport.setTotalContentSize(this._viewport.getDataLength()*this._itemSize)}_updateRenderedRange(){if(!this._viewport)return;let n=this._viewport.getRenderedRange(),e={start:n.start,end:n.end},t=this._viewport.getViewportSize(),r=this._viewport.getDataLength(),o=this._viewport.measureScrollOffset(),d=this._itemSize>0?o/this._itemSize:0;if(e.end>r){let m=Math.ceil(t/this._itemSize),_=Math.max(0,Math.min(d,r-m));d!=_&&(d=_,o=_*this._itemSize,e.start=Math.floor(d)),e.end=Math.max(0,Math.min(r,e.start+m))}let u=o-e.start*this._itemSize;if(u<this._minBufferPx&&e.start!=0){let m=Math.ceil((this._maxBufferPx-u)/this._itemSize);e.start=Math.max(0,e.start-m),e.end=Math.min(r,Math.ceil(d+(t+this._minBufferPx)/this._itemSize))}else{let m=e.end*this._itemSize-(o+t);if(m<this._minBufferPx&&e.end!=r){let _=Math.ceil((this._maxBufferPx-m)/this._itemSize);_>0&&(e.end=Math.min(r,e.end+_),e.start=Math.max(0,Math.floor(d-this._minBufferPx/this._itemSize)))}}this._viewport.setRenderedRange(e),this._viewport.setRenderedContentOffset(Math.round(this._itemSize*e.start)),this._scrolledIndexChange.next(Math.floor(d))}};function si(i){return i._scrollStrategy}var wn=(()=>{class i{get itemSize(){return this._itemSize}set itemSize(e){this._itemSize=we(e)}_itemSize=20;get minBufferPx(){return this._minBufferPx}set minBufferPx(e){this._minBufferPx=we(e)}_minBufferPx=100;get maxBufferPx(){return this._maxBufferPx}set maxBufferPx(e){this._maxBufferPx=we(e)}_maxBufferPx=200;_scrollStrategy=new mt(this.itemSize,this.minBufferPx,this.maxBufferPx);ngOnChanges(){this._scrollStrategy.updateItemAndBufferSize(this.itemSize,this.minBufferPx,this.maxBufferPx)}static \u0275fac=function(t){return new(t||i)};static \u0275dir=se({type:i,selectors:[["cdk-virtual-scroll-viewport","itemSize",""]],inputs:{itemSize:"itemSize",minBufferPx:"minBufferPx",maxBufferPx:"maxBufferPx"},features:[he([{provide:xn,useFactory:si,deps:[wt(()=>i)]}]),Pe]})}return i})(),li=20,ci=(()=>{class i{_ngZone=g(fe);_platform=g(We);_renderer=g(et).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new T;_scrolledCount=0;scrollContainers=new Map;register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){let t=this.scrollContainers.get(e);t&&(t.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=li){return this._platform.isBrowser?new Xe(t=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let r=e>0?this._scrolled.pipe(ke(e)).subscribe(t):this._scrolled.subscribe(t);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):Y()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,t)=>this.deregister(t)),this._scrolled.complete()}ancestorScrolled(e,t){let r=this.getAncestorScrollContainers(e);return this.scrolled(t).pipe(_t(o=>!o||r.indexOf(o)>-1))}getAncestorScrollContainers(e){let t=[];return this.scrollContainers.forEach((r,o)=>{this._scrollableContainsElement(o,e)&&t.push(o)}),t}_scrollableContainsElement(e,t){let r=gn(t),o=e.getElementRef().nativeElement;do if(r==o)return!0;while(r=r.parentElement);return!1}static \u0275fac=function(t){return new(t||i)};static \u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),yn=(()=>{class i{elementRef=g(me);scrollDispatcher=g(ci);ngZone=g(fe);dir=g(hn,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new T;_renderer=g(Pt);_cleanupScroll;_elementScrolled=new T;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",e=>this._elementScrolled.next(e))),this.scrollDispatcher.register(this)}ngOnDestroy(){this._cleanupScroll?.(),this._elementScrolled.complete(),this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(e){let t=this.elementRef.nativeElement,r=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=r?e.end:e.start),e.right==null&&(e.right=r?e.start:e.end),e.bottom!=null&&(e.top=t.scrollHeight-t.clientHeight-e.bottom),r&&le()!=L.NORMAL?(e.left!=null&&(e.right=t.scrollWidth-t.clientWidth-e.left),le()==L.INVERTED?e.left=e.right:le()==L.NEGATED&&(e.left=e.right?-e.right:e.right)):e.right!=null&&(e.left=t.scrollWidth-t.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){let t=this.elementRef.nativeElement;un()?t.scrollTo(e):(e.top!=null&&(t.scrollTop=e.top),e.left!=null&&(t.scrollLeft=e.left))}measureScrollOffset(e){let t="left",r="right",o=this.elementRef.nativeElement;if(e=="top")return o.scrollTop;if(e=="bottom")return o.scrollHeight-o.clientHeight-o.scrollTop;let d=this.dir&&this.dir.value=="rtl";return e=="start"?e=d?r:t:e=="end"&&(e=d?t:r),d&&le()==L.INVERTED?e==t?o.scrollWidth-o.clientWidth-o.scrollLeft:o.scrollLeft:d&&le()==L.NEGATED?e==t?o.scrollLeft+o.scrollWidth-o.clientWidth:-o.scrollLeft:e==t?o.scrollLeft:o.scrollWidth-o.clientWidth-o.scrollLeft}static \u0275fac=function(t){return new(t||i)};static \u0275dir=se({type:i,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return i})(),di=20,mi=(()=>{class i{_platform=g(We);_listeners;_viewportSize;_change=new T;_document=g(De);constructor(){let e=g(fe),t=g(et).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let r=o=>this._change.next(o);this._listeners=[t.listen("window","resize",r),t.listen("window","orientationchange",r)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:t,height:r}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+r,right:e.left+t,height:r,width:t}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,t=this._getWindow(),r=e.documentElement,o=r.getBoundingClientRect(),d=-o.top||e.body.scrollTop||t.scrollY||r.scrollTop||0,u=-o.left||e.body.scrollLeft||t.scrollX||r.scrollLeft||0;return{top:d,left:u}}change(e=di){return e>0?this._change.pipe(ke(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),vn=new X("VIRTUAL_SCROLLABLE"),pi=(()=>{class i extends yn{constructor(){super()}measureViewportSize(e){let t=this.elementRef.nativeElement;return e==="horizontal"?t.clientWidth:t.clientHeight}static \u0275fac=function(t){return new(t||i)};static \u0275dir=se({type:i,features:[tt]})}return i})();function fi(i,n){return i.start==n.start&&i.end==n.end}var gi=typeof requestAnimationFrame<"u"?ut:ht,pt=(()=>{class i extends pi{elementRef=g(me);_changeDetectorRef=g(Gt);_scrollStrategy=g(xn,{optional:!0});scrollable=g(vn,{optional:!0});_platform=g(We);_detachedSubject=new T;_renderedRangeSubject=new T;get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this._calculateSpacerSize())}_orientation="vertical";appendOnly=!1;scrolledIndexChange=new Xe(e=>this._scrollStrategy.scrolledIndexChange.subscribe(t=>Promise.resolve().then(()=>this.ngZone.run(()=>e.next(t)))));_contentWrapper;renderedRangeStream=this._renderedRangeSubject;_totalContentSize=0;_totalContentWidth=w("");_totalContentHeight=w("");_renderedContentTransform;_renderedRange={start:0,end:0};_dataLength=0;_viewportSize=0;_forOf;_renderedContentOffset=0;_renderedContentOffsetNeedsRewrite=!1;_changeDetectionNeeded=w(!1);_runAfterChangeDetection=[];_viewportChanges=ft.EMPTY;_injector=g(St);_isDestroyed=!1;constructor(){super();let e=g(mi);this._scrollStrategy,this._viewportChanges=e.change().subscribe(()=>{this.checkViewportSize()}),this.scrollable||(this.elementRef.nativeElement.classList.add("cdk-virtual-scrollable"),this.scrollable=this);let t=H(()=>{this._changeDetectionNeeded()&&this._doChangeDetection()},{injector:g(Nt).injector});g(Mt).onDestroy(()=>void t.destroy())}ngOnInit(){this._platform.isBrowser&&(this.scrollable===this&&super.ngOnInit(),this.ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>{this._measureViewportSize(),this._scrollStrategy.attach(this),this.scrollable.elementScrolled().pipe(Je(null),ke(0,gi),Ee(this._destroyed)).subscribe(()=>this._scrollStrategy.onContentScrolled()),this._markChangeDetectionNeeded()})))}ngOnDestroy(){this.detach(),this._scrollStrategy.detach(),this._renderedRangeSubject.complete(),this._detachedSubject.complete(),this._viewportChanges.unsubscribe(),this._isDestroyed=!0,super.ngOnDestroy()}attach(e){this._forOf,this.ngZone.runOutsideAngular(()=>{this._forOf=e,this._forOf.dataStream.pipe(Ee(this._detachedSubject)).subscribe(t=>{let r=t.length;r!==this._dataLength&&(this._dataLength=r,this._scrollStrategy.onDataLengthChanged()),this._doChangeDetection()})})}detach(){this._forOf=null,this._detachedSubject.next()}getDataLength(){return this._dataLength}getViewportSize(){return this._viewportSize}getRenderedRange(){return this._renderedRange}measureBoundingClientRectWithScrollOffset(e){return this.getElementRef().nativeElement.getBoundingClientRect()[e]}setTotalContentSize(e){this._totalContentSize!==e&&(this._totalContentSize=e,this._calculateSpacerSize(),this._markChangeDetectionNeeded())}setRenderedRange(e){fi(this._renderedRange,e)||(this.appendOnly&&(e={start:0,end:Math.max(this._renderedRange.end,e.end)}),this._renderedRangeSubject.next(this._renderedRange=e),this._markChangeDetectionNeeded(()=>this._scrollStrategy.onContentRendered()))}getOffsetToRenderedContentStart(){return this._renderedContentOffsetNeedsRewrite?null:this._renderedContentOffset}setRenderedContentOffset(e,t="to-start"){e=this.appendOnly&&t==="to-start"?0:e;let r=this.dir&&this.dir.value=="rtl",o=this.orientation=="horizontal",d=o?"X":"Y",m=`translate${d}(${Number((o&&r?-1:1)*e)}px)`;this._renderedContentOffset=e,t==="to-end"&&(m+=` translate${d}(-100%)`,this._renderedContentOffsetNeedsRewrite=!0),this._renderedContentTransform!=m&&(this._renderedContentTransform=m,this._markChangeDetectionNeeded(()=>{this._renderedContentOffsetNeedsRewrite?(this._renderedContentOffset-=this.measureRenderedContentSize(),this._renderedContentOffsetNeedsRewrite=!1,this.setRenderedContentOffset(this._renderedContentOffset)):this._scrollStrategy.onRenderedOffsetChanged()}))}scrollToOffset(e,t="auto"){let r={behavior:t};this.orientation==="horizontal"?r.start=e:r.top=e,this.scrollable.scrollTo(r)}scrollToIndex(e,t="auto"){this._scrollStrategy.scrollToIndex(e,t)}measureScrollOffset(e){let t;return this.scrollable==this?t=r=>super.measureScrollOffset(r):t=r=>this.scrollable.measureScrollOffset(r),Math.max(0,t(e??(this.orientation==="horizontal"?"start":"top"))-this.measureViewportOffset())}measureViewportOffset(e){let t,r="left",o="right",d=this.dir?.value=="rtl";e=="start"?t=d?o:r:e=="end"?t=d?r:o:e?t=e:t=this.orientation==="horizontal"?"left":"top";let u=this.scrollable.measureBoundingClientRectWithScrollOffset(t);return this.elementRef.nativeElement.getBoundingClientRect()[t]-u}measureRenderedContentSize(){let e=this._contentWrapper.nativeElement;return this.orientation==="horizontal"?e.offsetWidth:e.offsetHeight}measureRangeSize(e){return this._forOf?this._forOf.measureRangeSize(e,this.orientation):0}checkViewportSize(){this._measureViewportSize(),this._scrollStrategy.onDataLengthChanged()}_measureViewportSize(){this._viewportSize=this.scrollable.measureViewportSize(this.orientation)}_markChangeDetectionNeeded(e){e&&this._runAfterChangeDetection.push(e),!Ht(this._changeDetectionNeeded)&&this.ngZone.runOutsideAngular(()=>{Promise.resolve().then(()=>{this.ngZone.run(()=>{this._changeDetectionNeeded.set(!0)})})})}_doChangeDetection(){this._isDestroyed||this.ngZone.run(()=>{this._changeDetectorRef.markForCheck(),this._contentWrapper.nativeElement.style.transform=this._renderedContentTransform,Tt(()=>{this._changeDetectionNeeded.set(!1);let e=this._runAfterChangeDetection;this._runAfterChangeDetection=[];for(let t of e)t()},{injector:this._injector})})}_calculateSpacerSize(){this._totalContentHeight.set(this.orientation==="horizontal"?"":`${this._totalContentSize}px`),this._totalContentWidth.set(this.orientation==="horizontal"?`${this._totalContentSize}px`:"")}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=D({type:i,selectors:[["cdk-virtual-scroll-viewport"]],viewQuery:function(t,r){if(t&1&&J(oi,7),t&2){let o;ee(o=te())&&(r._contentWrapper=o.first)}},hostAttrs:[1,"cdk-virtual-scroll-viewport"],hostVars:4,hostBindings:function(t,r){t&2&&F("cdk-virtual-scroll-orientation-horizontal",r.orientation==="horizontal")("cdk-virtual-scroll-orientation-vertical",r.orientation!=="horizontal")},inputs:{orientation:"orientation",appendOnly:[2,"appendOnly","appendOnly",$t]},outputs:{scrolledIndexChange:"scrolledIndexChange"},features:[he([{provide:yn,useFactory:(e,t)=>e||t,deps:[[new Ot,new kt(vn)],i]}]),tt],ngContentSelectors:ai,decls:4,vars:4,consts:[["contentWrapper",""],[1,"cdk-virtual-scroll-content-wrapper"],[1,"cdk-virtual-scroll-spacer"]],template:function(t,r){t&1&&(Lt(),Vt(0,"div",1,0),At(2),Ft(),zt(3,"div",2)),t&2&&(s(3),ne("width",r._totalContentWidth())("height",r._totalContentHeight()))},styles:[`cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}
2
+ `],encapsulation:2,changeDetection:0})}return i})();function Cn(i,n,e){let t=e;if(!t.getBoundingClientRect)return 0;let r=t.getBoundingClientRect();return i==="horizontal"?n==="start"?r.left:r.right:n==="start"?r.top:r.bottom}var Sn=(()=>{class i{_viewContainerRef=g(It);_template=g(Dt);_differs=g(Wt);_viewRepeater=g(dt);_viewport=g(pt,{skipSelf:!0});viewChange=new T;_dataSourceChanges=new T;get cdkVirtualForOf(){return this._cdkVirtualForOf}set cdkVirtualForOf(e){this._cdkVirtualForOf=e,_n(e)?this._dataSourceChanges.next(e):this._dataSourceChanges.next(new qe(Me(e)?e:Array.from(e||[])))}_cdkVirtualForOf;get cdkVirtualForTrackBy(){return this._cdkVirtualForTrackBy}set cdkVirtualForTrackBy(e){this._needsUpdate=!0,this._cdkVirtualForTrackBy=e?(t,r)=>e(t+(this._renderedRange?this._renderedRange.start:0),r):void 0}_cdkVirtualForTrackBy;set cdkVirtualForTemplate(e){e&&(this._needsUpdate=!0,this._template=e)}get cdkVirtualForTemplateCacheSize(){return this._viewRepeater.viewCacheSize}set cdkVirtualForTemplateCacheSize(e){this._viewRepeater.viewCacheSize=we(e)}dataStream=this._dataSourceChanges.pipe(Je(null),bt(),Oe(([e,t])=>this._changeDataSource(e,t)),xt(1));_differ=null;_data;_renderedItems;_renderedRange;_needsUpdate=!1;_destroyed=new T;constructor(){let e=g(fe);this.dataStream.subscribe(t=>{this._data=t,this._onRenderedDataChange()}),this._viewport.renderedRangeStream.pipe(Ee(this._destroyed)).subscribe(t=>{this._renderedRange=t,this.viewChange.observers.length&&e.run(()=>this.viewChange.next(this._renderedRange)),this._onRenderedDataChange()}),this._viewport.attach(this)}measureRangeSize(e,t){if(e.start>=e.end)return 0;e.start<this._renderedRange.start||e.end>this._renderedRange.end;let r=e.start-this._renderedRange.start,o=e.end-e.start,d,u;for(let m=0;m<o;m++){let _=this._viewContainerRef.get(m+r);if(_&&_.rootNodes.length){d=u=_.rootNodes[0];break}}for(let m=o-1;m>-1;m--){let _=this._viewContainerRef.get(m+r);if(_&&_.rootNodes.length){u=_.rootNodes[_.rootNodes.length-1];break}}return d&&u?Cn(t,"end",u)-Cn(t,"start",d):0}ngDoCheck(){if(this._differ&&this._needsUpdate){let e=this._differ.diff(this._renderedItems);e?this._applyChanges(e):this._updateContext(),this._needsUpdate=!1}}ngOnDestroy(){this._viewport.detach(),this._dataSourceChanges.next(void 0),this._dataSourceChanges.complete(),this.viewChange.complete(),this._destroyed.next(),this._destroyed.complete(),this._viewRepeater.detach()}_onRenderedDataChange(){this._renderedRange&&(this._renderedItems=this._data.slice(this._renderedRange.start,this._renderedRange.end),this._differ||(this._differ=this._differs.find(this._renderedItems).create((e,t)=>this.cdkVirtualForTrackBy?this.cdkVirtualForTrackBy(e,t):t)),this._needsUpdate=!0)}_changeDataSource(e,t){return e&&e.disconnect(this),this._needsUpdate=!0,t?t.connect(this):Y()}_updateContext(){let e=this._data.length,t=this._viewContainerRef.length;for(;t--;){let r=this._viewContainerRef.get(t);r.context.index=this._renderedRange.start+t,r.context.count=e,this._updateComputedContextProperties(r.context),r.detectChanges()}}_applyChanges(e){this._viewRepeater.applyChanges(e,this._viewContainerRef,(o,d,u)=>this._getEmbeddedViewArgs(o,u),o=>o.item),e.forEachIdentityChange(o=>{let d=this._viewContainerRef.get(o.currentIndex);d.context.$implicit=o.item});let t=this._data.length,r=this._viewContainerRef.length;for(;r--;){let o=this._viewContainerRef.get(r);o.context.index=this._renderedRange.start+r,o.context.count=t,this._updateComputedContextProperties(o.context)}}_updateComputedContextProperties(e){e.first=e.index===0,e.last=e.index===e.count-1,e.even=e.index%2===0,e.odd=!e.even}_getEmbeddedViewArgs(e,t){return{templateRef:this._template,context:{$implicit:e.item,cdkVirtualForOf:this._cdkVirtualForOf,index:-1,count:-1,first:!1,last:!1,odd:!1,even:!1},index:t}}static ngTemplateContextGuard(e,t){return!0}static \u0275fac=function(t){return new(t||i)};static \u0275dir=se({type:i,selectors:[["","cdkVirtualFor","","cdkVirtualForOf",""]],inputs:{cdkVirtualForOf:"cdkVirtualForOf",cdkVirtualForTrackBy:"cdkVirtualForTrackBy",cdkVirtualForTemplate:"cdkVirtualForTemplate",cdkVirtualForTemplateCacheSize:"cdkVirtualForTemplateCacheSize"},features:[he([{provide:dt,useClass:Ye}])]})}return i})();var bn=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=pe({type:i});static \u0275inj=de({})}return i})(),Mn=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=pe({type:i});static \u0275inj=de({imports:[ct,bn,ct,bn]})}return i})();function ui(i,n){i&1&&y(0,"span",19)}function _i(i,n){if(i&1&&(l(0,"span",23),c(1),a()),i&2){let e=n.$implicit;s(),v(e)}}function vi(i,n){if(i&1&&(l(0,"span",24),c(1),a()),i&2){let e=n.$implicit;s(),v(e)}}function Ci(i,n){if(i&1&&(l(0,"span",20),b(1,_i,2,1,"span",21)(2,vi,2,1,"span",22),a()),i&2){let e=x().$implicit;s(),h("ngForOf",e.tags),s(),h("ngForOf",e.branches)}}function bi(i,n){if(i&1){let e=V();l(0,"button",7),S("click",function(){let r=k(e).$implicit,o=x();return O(o.select(r))}),l(1,"span",8),y(2,"span",9),b(3,ui,1,0,"span",10),a(),l(4,"span",11)(5,"span",12),c(6),a(),l(7,"span",13)(8,"span",14),c(9),a(),l(10,"span",15),c(11,"\u2022"),a(),l(12,"span",16),c(13),a(),l(14,"span",15),c(15,"\u2022"),a(),l(16,"span",17),c(17),ue(18,"date"),a()()(),b(19,Ci,3,2,"span",18),a()}if(i&2){let e=n.$implicit,t=n.index,r=x();F("selected",e.hash===r.selectedHash()),ge("aria-current",e.hash===r.selectedHash()?"true":null),s(2),ne("background",r.laneColor(e)),F("merge",e.isMerge),s(),h("ngIf",t<r.commits().length-1),s(2),h("title",e.subject),s(),v(e.subject),s(3),v(e.shortHash),s(4),v(e.author),s(4),v(_e(18,14,e.date,"MMM d, y, h:mm a")),s(2),h("ngIf",e.branches.length||e.tags.length)}}function xi(i,n){i&1&&(l(0,"div",25)(1,"p"),c(2,"No commits match your filters."),a()())}var Ze=class i{state=g(G);commits=this.state.commits;selectedHash=this.state.selectedHash;trackByHash(n,e){return e.hash}select(n){this.state.selectHash(n.hash)}laneColors=["#4f46e5","#06b6d4","#f59e0b","#ef4444","#10b981","#8b5cf6"];laneColor(n){let e=0,t=n.branches[0]??n.parents[0]??n.hash;for(let r=0;r<t.length;r++)e=e*31+t.charCodeAt(r)>>>0;return this.laneColors[e%this.laneColors.length]}onKey(n){if(!this.isTyping(n.target)){if(n.key==="j")n.preventDefault(),this.state.selectByOffset(1);else if(n.key==="k")n.preventDefault(),this.state.selectByOffset(-1);else if(n.key==="g"){n.preventDefault();let e=this.state.commits();e.length&&this.state.selectHash(e[0].hash)}else if(n.key==="G"){n.preventDefault();let e=this.state.commits();e.length&&this.state.selectHash(e[e.length-1].hash)}}}isTyping(n){return n instanceof HTMLElement?["INPUT","TEXTAREA","SELECT"].includes(n.tagName)||n.isContentEditable:!1}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-commit-list"]],hostBindings:function(e,t){e&1&&S("keydown",function(o){return t.onKey(o)},Ie)},decls:13,vars:6,consts:[[1,"header"],[1,"count"],[1,"hint"],[1,"kbd"],["minBufferPx","640","maxBufferPx","1280",1,"viewport",3,"itemSize"],["class","row",3,"selected","click",4,"cdkVirtualFor","cdkVirtualForOf","cdkVirtualForTrackBy"],["class","empty",4,"ngIf"],[1,"row",3,"click"],[1,"lane"],[1,"dot"],["class","line",4,"ngIf"],[1,"content"],[1,"subject",3,"title"],[1,"meta"],[1,"hash"],[1,"dot-sep"],[1,"author"],[1,"date"],["class","badges",4,"ngIf"],[1,"line"],[1,"badges"],["class","badge tag",4,"ngFor","ngForOf"],["class","badge branch",4,"ngFor","ngForOf"],[1,"badge","tag"],[1,"badge","branch"],[1,"empty"]],template:function(e,t){e&1&&(l(0,"div",0)(1,"span",1),c(2),a(),l(3,"span",2)(4,"kbd",3),c(5,"j"),a(),c(6,"/"),l(7,"kbd",3),c(8,"k"),a(),c(9," navigate "),a()(),l(10,"cdk-virtual-scroll-viewport",4),b(11,bi,20,17,"button",5)(12,xi,3,0,"div",6),a()),e&2&&(s(2),Ve("",t.commits().length," of ",t.state.total()),s(8),h("itemSize",58),s(),h("cdkVirtualForOf",t.commits())("cdkVirtualForTrackBy",t.trackByHash),s(),h("ngIf",!t.commits().length&&!t.state.loading()))},dependencies:[R,Z,I,Mn,wn,Sn,pt,ze],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0;background:transparent}.header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:.6rem .85rem;border-bottom:1px solid var(--border-soft);font-size:12px;color:var(--fg-muted);background:color-mix(in oklab,var(--bg-surface) 92%,transparent)}.viewport[_ngcontent-%COMP%]{flex:1;min-height:0}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:24px 1fr auto;gap:.5rem;align-items:center;width:100%;height:58px;padding:.38rem .7rem;background:transparent;border:0;border-bottom:1px solid var(--border-soft);border-left:3px solid transparent;color:inherit;text-align:left;cursor:pointer;transition:background .1s,border-color .1s,transform 80ms}.row[_ngcontent-%COMP%]:hover{background:color-mix(in oklab,var(--bg-hover) 70%,transparent);border-left-color:color-mix(in oklab,var(--accent) 48%,transparent)}.row.selected[_ngcontent-%COMP%]{background:linear-gradient(90deg,color-mix(in oklab,var(--accent) 18%,transparent),transparent 70%);border-left-color:var(--accent)}.row.selected[_ngcontent-%COMP%] .subject[_ngcontent-%COMP%]{color:var(--fg-primary)}.lane[_ngcontent-%COMP%]{position:relative;width:24px;height:100%;display:flex;align-items:center;justify-content:center}.dot[_ngcontent-%COMP%]{width:9px;height:9px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 2px var(--bg-surface);z-index:1}.dot.merge[_ngcontent-%COMP%]{background:transparent;border:2px solid var(--accent)}.line[_ngcontent-%COMP%]{position:absolute;top:50%;left:50%;width:2px;height:50%;background:var(--border-strong);transform:translate(-50%)}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;gap:2px}.subject[_ngcontent-%COMP%]{font-weight:500;font-size:13px;color:var(--fg-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.meta[_ngcontent-%COMP%]{display:flex;gap:6px;font-size:11px;color:var(--fg-muted);align-items:center}.hash[_ngcontent-%COMP%]{font-family:var(--font-mono)}.dot-sep[_ngcontent-%COMP%]{opacity:.5}.badges[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end;max-width:150px;overflow:hidden;max-height:42px}.badge[_ngcontent-%COMP%]{font-size:10px;font-weight:600;padding:2px 7px;border-radius:999px;letter-spacing:.02em;border:1px solid transparent;max-width:128px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.badge.tag[_ngcontent-%COMP%]{background:#d9770626;color:var(--warning);border-color:color-mix(in oklab,var(--warning) 24%,transparent)}.badge.branch[_ngcontent-%COMP%]{background:var(--accent-soft);color:var(--accent);border-color:color-mix(in oklab,var(--accent) 24%,transparent)}.empty[_ngcontent-%COMP%]{padding:2rem 1rem;text-align:center;color:var(--fg-muted)}"],changeDetection:0})};var Qe=class i{http=g(Le);base="/api";list(n={}){let e=new qt;for(let[t,r]of Object.entries(n))r&&(e=e.set(t,String(r)));return this.http.get(`${this.base}/groups`,{params:e})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"})};function wi(i,n){if(i&1&&(l(0,"span",7),c(1),a()),i&2){let e=n.ngIf;s(),j("",e," groups")}}function yi(i,n){i&1&&(l(0,"div",8),c(1,"Loading groups\u2026"),a())}function Si(i,n){if(i&1&&(l(0,"div",9),c(1),a()),i&2){let e=n.ngIf;s(),v(e)}}function Mi(i,n){i&1&&(l(0,"div",8),c(1," No groups detected. Try the flat view. "),a())}function ki(i,n){if(i&1&&(l(0,"span",18),c(1),a()),i&2){let e=x().$implicit;s(),j("#",e.prNumber)}}function Oi(i,n){if(i&1){let e=V();l(0,"li",21),S("click",function(){let r=k(e).$implicit,o=x(3);return O(o.state.selectHash(r))}),l(1,"code",22),c(2),a(),l(3,"span",23),c(4),a()()}if(i&2){let e=n.$implicit,t=x(3);F("selected",e===t.state.selectedHash()),s(2),v(t.shortHash(e)),s(2),v(t.subjectFor(e))}}function Ei(i,n){if(i&1&&(l(0,"ul",19),b(1,Oi,5,4,"li",20),a()),i&2){let e=x().$implicit;s(),h("ngForOf",e.commits)}}function Di(i,n){if(i&1){let e=V();l(0,"li",10)(1,"button",11),S("click",function(){let r=k(e).$implicit,o=x();return O(o.toggle(r.id))}),l(2,"span",12),c(3,"\u25B8"),a(),l(4,"span",13),c(5),a(),b(6,ki,2,1,"span",14),l(7,"span",15),c(8),a(),l(9,"span",16),c(10),a()(),b(11,Ei,2,1,"ul",17),a()}if(i&2){let e=n.$implicit,t=x();F("expanded",t.isExpanded(e.id)),s(2),F("open",t.isExpanded(e.id)),s(2),Bt("src-"+e.source),s(),v(t.sourceLabel(e.source)),s(),h("ngIf",e.prNumber),s(2),v(e.title),s(2),v(e.commits.length),s(),h("ngIf",t.isExpanded(e.id))}}var Ke=class i{state=g(G);groupsApi=g(Qe);groups=w(null);loading=w(!1);error=w(null);expanded=w(new Set);subjectMap=ie(()=>{let n=new Map;for(let e of this.state.commits())n.set(e.hash,e.subject);return n});constructor(){H(()=>{let n=this.state.filters();this.load(n.since,n.until,n.author,n.branch)})}isExpanded(n){return this.expanded().has(n)}toggle(n){let e=new Set(this.expanded());e.has(n)?e.delete(n):e.add(n),this.expanded.set(e)}shortHash(n){return n.slice(0,7)}subjectFor(n){return this.subjectMap().get(n)??n.slice(0,7)}sourceLabel(n){switch(n){case"merge":return"PR";case"squash":return"PR (sq)";case"conventional":return"Feat";case"standalone":return"commit"}}load(n,e,t,r){this.loading.set(!0),this.error.set(null),this.groupsApi.list({since:n,until:e,author:t,branch:r}).subscribe({next:o=>{this.groups.set(o),this.loading.set(!1);let d=o.find(u=>u.prNumber);d&&this.expanded.set(new Set([d.id]))},error:o=>{this.error.set(this.errMsg(o)),this.loading.set(!1)}})}errMsg(n){if(n&&typeof n=="object"&&"error"in n){let e=n.error;if(e?.error)return e.error}return n instanceof Error?n.message:"Failed to load groups"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-grouped-list"]],decls:9,vars:5,consts:[[1,"head"],[1,"title"],["class","meta",4,"ngIf"],["class","empty",4,"ngIf"],["class","empty error",4,"ngIf"],[1,"groups"],["class","group",3,"expanded",4,"ngFor","ngForOf"],[1,"meta"],[1,"empty"],[1,"empty","error"],[1,"group"],[1,"group-head",3,"click"],[1,"caret"],[1,"badge"],["class","pr",4,"ngIf"],[1,"g-title"],[1,"count"],["class","commits",4,"ngIf"],[1,"pr"],[1,"commits"],["class","commit",3,"selected","click",4,"ngFor","ngForOf"],[1,"commit",3,"click"],[1,"hash"],[1,"subject"]],template:function(e,t){if(e&1&&(l(0,"div",0)(1,"span",1),c(2,"PR / feature groups"),a(),b(3,wi,2,1,"span",2),a(),b(4,yi,2,0,"div",3)(5,Si,2,1,"div",4)(6,Mi,2,0,"div",3),l(7,"ul",5),b(8,Di,12,11,"li",6),a()),e&2){let r,o;s(3),h("ngIf",(r=t.groups())==null?null:r.length),s(),h("ngIf",t.loading()),s(),h("ngIf",t.error()),s(),h("ngIf",!t.loading()&&!t.error()&&(((o=t.groups())==null?null:o.length)??0)===0),s(2),h("ngForOf",t.groups())}},dependencies:[R,Z,I],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden}.head[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding:.6rem .85rem;border-bottom:1px solid var(--border-soft);background:color-mix(in oklab,var(--bg-surface) 92%,transparent)}.title[_ngcontent-%COMP%]{font-weight:600;font-size:13px}.meta[_ngcontent-%COMP%]{font-size:11px;color:var(--fg-muted)}.empty[_ngcontent-%COMP%]{padding:1rem .85rem;color:var(--fg-muted);font-size:12px}.empty.error[_ngcontent-%COMP%]{color:var(--danger)}.groups[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;overflow-y:auto;flex:1}.group[_ngcontent-%COMP%]{border-bottom:1px solid var(--border-soft);transition:background .12s}.group.expanded[_ngcontent-%COMP%]{background:color-mix(in oklab,var(--accent) 5%,transparent)}.group-head[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;gap:.5rem;padding:.58rem .85rem;background:transparent;border:0;color:var(--fg-primary);cursor:pointer;text-align:left}.group-head[_ngcontent-%COMP%]:hover{background:color-mix(in oklab,var(--bg-hover) 72%,transparent)}.caret[_ngcontent-%COMP%]{display:inline-block;width:10px;transition:transform .15s ease;color:var(--fg-muted)}.caret.open[_ngcontent-%COMP%]{transform:rotate(90deg)}.badge[_ngcontent-%COMP%]{font-size:10px;letter-spacing:.04em;padding:1px 6px;border-radius:999px;background:var(--bg-surface-2);color:var(--fg-secondary);text-transform:uppercase}.badge.src-merge[_ngcontent-%COMP%]{background:#6366f12e;color:var(--accent)}.badge.src-squash[_ngcontent-%COMP%]{background:#10b9812e;color:#10b981}.badge.src-conventional[_ngcontent-%COMP%]{background:#f59e0b2e;color:#d97706}.pr[_ngcontent-%COMP%]{font-size:11px;color:var(--fg-muted)}.g-title[_ngcontent-%COMP%]{flex:1;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.count[_ngcontent-%COMP%]{font-size:11px;color:var(--fg-muted);background:var(--bg-surface-2);border:1px solid var(--border-soft);padding:1px 6px;border-radius:999px}.commits[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0 0 .4rem;background:color-mix(in oklab,var(--bg-surface-2) 72%,transparent)}.commit[_ngcontent-%COMP%]{display:flex;gap:.6rem;align-items:center;padding:.34rem .85rem .34rem 2rem;cursor:pointer;font-size:12px}.commit[_ngcontent-%COMP%]:hover{background:var(--bg-hover)}.commit.selected[_ngcontent-%COMP%]{background:color-mix(in oklab,var(--accent) 18%,transparent);box-shadow:inset 3px 0 0 var(--accent)}.commit[_ngcontent-%COMP%] .hash[_ngcontent-%COMP%]{font-family:var(--font-mono, monospace);font-size:11px;color:var(--fg-muted)}.commit[_ngcontent-%COMP%] .subject[_ngcontent-%COMP%]{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"],changeDetection:0})};function Pi(i,n){i&1&&(Re(0),y(1,"app-grouped-list"),Te())}function Ii(i,n){i&1&&y(0,"app-commit-list")}var kn=class i{state=g(G);static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-home-shell"]],decls:11,vars:2,consts:[["flat",""],[1,"layout"],[1,"pane","graph"],[1,"pane","list"],[1,"pane-shell"],[4,"ngIf","ngIfElse"],[1,"pane","detail"],[1,"pane-shell","detail-shell"]],template:function(e,t){if(e&1&&(l(0,"main",1)(1,"aside",2),y(2,"app-commit-graph"),a(),l(3,"section",3)(4,"div",4),b(5,Pi,2,0,"ng-container",5)(6,Ii,1,0,"ng-template",null,0,Fe),a()(),l(8,"section",6)(9,"div",7),y(10,"app-commit-detail"),a()()()),e&2){let r=Ne(7);s(5),h("ngIf",t.state.viewMode()==="grouped")("ngIfElse",r)}},dependencies:[R,I,Ge,Ze,je,Ke],styles:["[_nghost-%COMP%]{display:block;flex:1;min-height:0}.layout[_ngcontent-%COMP%]{height:100%;display:grid;grid-template-columns:minmax(180px,230px) minmax(320px,390px) minmax(0,1fr);gap:.75rem;padding:.75rem;min-height:0;background:transparent}.pane[_ngcontent-%COMP%]{min-width:0;min-height:0;overflow:hidden;border-radius:var(--radius-lg);background:var(--bg-panel);border:1px solid color-mix(in oklab,var(--border-soft) 86%,transparent);box-shadow:var(--shadow-md)}.pane.graph[_ngcontent-%COMP%]{background:color-mix(in oklab,var(--bg-panel) 86%,transparent)}.pane-shell[_ngcontent-%COMP%]{height:100%;min-height:0;overflow:hidden;border-radius:inherit}.detail-shell[_ngcontent-%COMP%]{background:color-mix(in oklab,var(--bg-surface) 82%,transparent)}@media (max-width: 1100px){.layout[_ngcontent-%COMP%]{grid-template-columns:320px 1fr}.pane.graph[_ngcontent-%COMP%]{display:none}}@media (max-width: 720px){.layout[_ngcontent-%COMP%]{grid-template-columns:1fr}.pane.list[_ngcontent-%COMP%]{display:none}}"],changeDetection:0})};export{kn as HomeShellComponent};