dsg-gtimeline
Version:
Google-like timeline chart with DSG-specific enhancements
1 lines • 99.3 kB
JavaScript
(function(q,xt){typeof exports=="object"&&typeof module<"u"?xt(exports):typeof define=="function"&&define.amd?define(["exports"],xt):(q=typeof globalThis<"u"?globalThis:q||self,xt(q.d3=q.d3||{}))})(this,function(q){"use strict";function xt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function hi(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ue(t){let e,n,r;t.length!==2?(e=xt,n=(u,c)=>xt(t(u),c),r=(u,c)=>t(u)-c):(e=t===xt||t===hi?t:di,n=t,r=t);function i(u,c,s=0,l=u.length){if(s<l){if(e(c,c)!==0)return l;do{const f=s+l>>>1;n(u[f],c)<0?s=f+1:l=f}while(s<l)}return s}function o(u,c,s=0,l=u.length){if(s<l){if(e(c,c)!==0)return l;do{const f=s+l>>>1;n(u[f],c)<=0?s=f+1:l=f}while(s<l)}return s}function a(u,c,s=0,l=u.length){const f=i(u,c,s,l-1);return f>s&&r(u[f-1],c)>-r(u[f],c)?f-1:f}return{left:i,center:a,right:o}}function di(){return 0}function gi(t){return t===null?NaN:+t}const mi=Ue(xt).right;Ue(gi).center;function Sn(t,e){let n,r;if(e===void 0)for(const i of t)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class An extends Map{constructor(e,n=wi){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(Cn(this,e))}has(e){return super.has(Cn(this,e))}set(e,n){return super.set(pi(this,e),n)}delete(e){return super.delete(yi(this,e))}}function Cn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function pi({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function yi({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function wi(t){return t!==null&&typeof t=="object"?t.valueOf():t}const xi=Math.sqrt(50),vi=Math.sqrt(10),_i=Math.sqrt(2);function ne(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=xi?10:o>=vi?5:o>=_i?2:1;let u,c,s;return i<0?(s=Math.pow(10,-i)/a,u=Math.round(t*s),c=Math.round(e*s),u/s<t&&++u,c/s>e&&--c,s=-s):(s=Math.pow(10,i)*a,u=Math.round(t/s),c=Math.round(e/s),u*s<t&&++u,c*s>e&&--c),c<u&&.5<=n&&n<2?ne(t,e,n*2):[u,c,s]}function Mi(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?ne(e,t,n):ne(t,e,n);if(!(o>=i))return[];const u=o-i+1,c=new Array(u);if(r)if(a<0)for(let s=0;s<u;++s)c[s]=(o-s)/-a;else for(let s=0;s<u;++s)c[s]=(o-s)*a;else if(a<0)for(let s=0;s<u;++s)c[s]=(i+s)/-a;else for(let s=0;s<u;++s)c[s]=(i+s)*a;return c}function Ye(t,e,n){return e=+e,t=+t,n=+n,ne(t,e,n)[2]}function Ee(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Ye(e,t,n):Ye(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function He(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Dn(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function bi(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}function Nn(t,e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");if(typeof e!="function")throw new TypeError("mapper is not a function");return Array.from(t,(n,r)=>e(n,r,t))}function $i(t){return t}var Oe=1,re=2,Re=3,It=4,Fn=1e-6;function Ti(t){return"translate("+t+",0)"}function ki(t){return"translate(0,"+t+")"}function Si(t){return e=>+t(e)}function Ai(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function Ci(){return!this.__axis}function Ie(t,e){var n=[],r=null,i=null,o=6,a=6,u=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,s=t===Oe||t===It?-1:1,l=t===It||t===re?"x":"y",f=t===Oe||t===Re?Ti:ki;function h(d){var T=r??(e.ticks?e.ticks.apply(e,n):e.domain()),E=i??(e.tickFormat?e.tickFormat.apply(e,n):$i),Y=Math.max(o,0)+u,L=e.range(),C=+L[0]+c,S=+L[L.length-1]+c,p=(e.bandwidth?Ai:Si)(e.copy(),c),b=d.selection?d.selection():d,g=b.selectAll(".domain").data([null]),y=b.selectAll(".tick").data(T,e).order(),w=y.exit(),N=y.enter().append("g").attr("class","tick"),A=y.select("line"),m=y.select("text");g=g.merge(g.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),y=y.merge(N),A=A.merge(N.append("line").attr("stroke","currentColor").attr(l+"2",s*o)),m=m.merge(N.append("text").attr("fill","currentColor").attr(l,s*Y).attr("dy",t===Oe?"0em":t===Re?"0.71em":"0.32em")),d!==b&&(g=g.transition(d),y=y.transition(d),A=A.transition(d),m=m.transition(d),w=w.transition(d).attr("opacity",Fn).attr("transform",function(H){return isFinite(H=p(H))?f(H+c):this.getAttribute("transform")}),N.attr("opacity",Fn).attr("transform",function(H){var P=this.parentNode.__axis;return f((P&&isFinite(P=P(H))?P:p(H))+c)})),w.remove(),g.attr("d",t===It||t===re?a?"M"+s*a+","+C+"H"+c+"V"+S+"H"+s*a:"M"+c+","+C+"V"+S:a?"M"+C+","+s*a+"V"+c+"H"+S+"V"+s*a:"M"+C+","+c+"H"+S),y.attr("opacity",1).attr("transform",function(H){return f(p(H)+c)}),A.attr(l+"2",s*o),m.attr(l,s*Y).text(E),b.filter(Ci).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===re?"start":t===It?"end":"middle"),b.each(function(){this.__axis=p})}return h.scale=function(d){return arguments.length?(e=d,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),h):n.slice()},h.tickValues=function(d){return arguments.length?(r=d==null?null:Array.from(d),h):r&&r.slice()},h.tickFormat=function(d){return arguments.length?(i=d,h):i},h.tickSize=function(d){return arguments.length?(o=a=+d,h):o},h.tickSizeInner=function(d){return arguments.length?(o=+d,h):o},h.tickSizeOuter=function(d){return arguments.length?(a=+d,h):a},h.tickPadding=function(d){return arguments.length?(u=+d,h):u},h.offset=function(d){return arguments.length?(c=+d,h):c},h}function Di(t){return Ie(re,t)}function Le(t){return Ie(Re,t)}function Ni(t){return Ie(It,t)}function Pe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Un(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Lt(){}var Pt=.7,ie=1/Pt,Ct="\\s*([+-]?\\d+)\\s*",Wt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Fi=/^#([0-9a-f]{3,8})$/,Ui=new RegExp(`^rgb\\(${Ct},${Ct},${Ct}\\)$`),Yi=new RegExp(`^rgb\\(${ut},${ut},${ut}\\)$`),Ei=new RegExp(`^rgba\\(${Ct},${Ct},${Ct},${Wt}\\)$`),Hi=new RegExp(`^rgba\\(${ut},${ut},${ut},${Wt}\\)$`),Oi=new RegExp(`^hsl\\(${Wt},${ut},${ut}\\)$`),Ri=new RegExp(`^hsla\\(${Wt},${ut},${ut},${Wt}\\)$`),Yn={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};Pe(Lt,vt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:En,formatHex:En,formatHex8:Ii,formatHsl:Li,formatRgb:Hn,toString:Hn});function En(){return this.rgb().formatHex()}function Ii(){return this.rgb().formatHex8()}function Li(){return Pn(this).formatHsl()}function Hn(){return this.rgb().formatRgb()}function vt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Fi.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?On(e):n===3?new et(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?oe(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?oe(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=Ui.exec(t))?new et(e[1],e[2],e[3],1):(e=Yi.exec(t))?new et(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ei.exec(t))?oe(e[1],e[2],e[3],e[4]):(e=Hi.exec(t))?oe(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Oi.exec(t))?Ln(e[1],e[2]/100,e[3]/100,1):(e=Ri.exec(t))?Ln(e[1],e[2]/100,e[3]/100,e[4]):Yn.hasOwnProperty(t)?On(Yn[t]):t==="transparent"?new et(NaN,NaN,NaN,0):null}function On(t){return new et(t>>16&255,t>>8&255,t&255,1)}function oe(t,e,n,r){return r<=0&&(t=e=n=NaN),new et(t,e,n,r)}function Pi(t){return t instanceof Lt||(t=vt(t)),t?(t=t.rgb(),new et(t.r,t.g,t.b,t.opacity)):new et}function We(t,e,n,r){return arguments.length===1?Pi(t):new et(t,e,n,r??1)}function et(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Pe(et,We,Un(Lt,{brighter(t){return t=t==null?ie:Math.pow(ie,t),new et(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Pt:Math.pow(Pt,t),new et(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new et(_t(this.r),_t(this.g),_t(this.b),ae(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:Rn,formatHex:Rn,formatHex8:Wi,formatRgb:In,toString:In}));function Rn(){return`#${Mt(this.r)}${Mt(this.g)}${Mt(this.b)}`}function Wi(){return`#${Mt(this.r)}${Mt(this.g)}${Mt(this.b)}${Mt((isNaN(this.opacity)?1:this.opacity)*255)}`}function In(){const t=ae(this.opacity);return`${t===1?"rgb(":"rgba("}${_t(this.r)}, ${_t(this.g)}, ${_t(this.b)}${t===1?")":`, ${t})`}`}function ae(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function _t(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Mt(t){return t=_t(t),(t<16?"0":"")+t.toString(16)}function Ln(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ot(t,e,n,r)}function Pn(t){if(t instanceof ot)return new ot(t.h,t.s,t.l,t.opacity);if(t instanceof Lt||(t=vt(t)),!t)return new ot;if(t instanceof ot)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,c=(o+i)/2;return u?(e===o?a=(n-r)/u+(n<r)*6:n===o?a=(r-e)/u+2:a=(e-n)/u+4,u/=c<.5?o+i:2-o-i,a*=60):u=c>0&&c<1?0:a,new ot(a,u,c,t.opacity)}function zi(t,e,n,r){return arguments.length===1?Pn(t):new ot(t,e,n,r??1)}function ot(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Pe(ot,zi,Un(Lt,{brighter(t){return t=t==null?ie:Math.pow(ie,t),new ot(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Pt:Math.pow(Pt,t),new ot(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new et(ze(t>=240?t-240:t+120,i,r),ze(t,i,r),ze(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new ot(Wn(this.h),se(this.s),se(this.l),ae(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ae(this.opacity);return`${t===1?"hsl(":"hsla("}${Wn(this.h)}, ${se(this.s)*100}%, ${se(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Wn(t){return t=(t||0)%360,t<0?t+360:t}function se(t){return Math.max(0,Math.min(1,t||0))}function ze(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var qi={value:()=>{}};function qe(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ue(n)}function ue(t){this._=t}function Vi(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ue.prototype=qe.prototype={constructor:ue,on:function(t,e){var n=this._,r=Vi(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=Bi(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=zn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=zn(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ue(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function Bi(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function zn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=qi,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Ve="http://www.w3.org/1999/xhtml";const qn={svg:"http://www.w3.org/2000/svg",xhtml:Ve,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ce(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),qn.hasOwnProperty(e)?{space:qn[e],local:t}:t}function Xi(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Ve&&e.documentElement.namespaceURI===Ve?e.createElement(t):e.createElementNS(n,t)}}function Zi(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Vn(t){var e=ce(t);return(e.local?Zi:Xi)(e)}function Gi(){}function Be(t){return t==null?Gi:function(){return this.querySelector(t)}}function Ji(t){typeof t!="function"&&(t=Be(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,u=r[i]=new Array(a),c,s,l=0;l<a;++l)(c=o[l])&&(s=t.call(c,c.__data__,l,o))&&("__data__"in c&&(s.__data__=c.__data__),u[l]=s);return new K(r,this._parents)}function Bn(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Qi(){return[]}function Xn(t){return t==null?Qi:function(){return this.querySelectorAll(t)}}function ji(t){return function(){return Bn(t.apply(this,arguments))}}function Ki(t){typeof t=="function"?t=ji(t):t=Xn(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],u=a.length,c,s=0;s<u;++s)(c=a[s])&&(r.push(t.call(c,c.__data__,s,a)),i.push(c));return new K(r,i)}function Zn(t){return function(){return this.matches(t)}}function Gn(t){return function(e){return e.matches(t)}}var to=Array.prototype.find;function eo(t){return function(){return to.call(this.children,t)}}function no(){return this.firstElementChild}function ro(t){return this.select(t==null?no:eo(typeof t=="function"?t:Gn(t)))}var io=Array.prototype.filter;function oo(){return Array.from(this.children)}function ao(t){return function(){return io.call(this.children,t)}}function so(t){return this.selectAll(t==null?oo:ao(typeof t=="function"?t:Gn(t)))}function uo(t){typeof t!="function"&&(t=Zn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,u=r[i]=[],c,s=0;s<a;++s)(c=o[s])&&t.call(c,c.__data__,s,o)&&u.push(c);return new K(r,this._parents)}function Jn(t){return new Array(t.length)}function co(){return new K(this._enter||this._groups.map(Jn),this._parents)}function le(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}le.prototype={constructor:le,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 lo(t){return function(){return t}}function fo(t,e,n,r,i,o){for(var a=0,u,c=e.length,s=o.length;a<s;++a)(u=e[a])?(u.__data__=o[a],r[a]=u):n[a]=new le(t,o[a]);for(;a<c;++a)(u=e[a])&&(i[a]=u)}function ho(t,e,n,r,i,o,a){var u,c,s=new Map,l=e.length,f=o.length,h=new Array(l),d;for(u=0;u<l;++u)(c=e[u])&&(h[u]=d=a.call(c,c.__data__,u,e)+"",s.has(d)?i[u]=c:s.set(d,c));for(u=0;u<f;++u)d=a.call(t,o[u],u,o)+"",(c=s.get(d))?(r[u]=c,c.__data__=o[u],s.delete(d)):n[u]=new le(t,o[u]);for(u=0;u<l;++u)(c=e[u])&&s.get(h[u])===c&&(i[u]=c)}function go(t){return t.__data__}function mo(t,e){if(!arguments.length)return Array.from(this,go);var n=e?ho:fo,r=this._parents,i=this._groups;typeof t!="function"&&(t=lo(t));for(var o=i.length,a=new Array(o),u=new Array(o),c=new Array(o),s=0;s<o;++s){var l=r[s],f=i[s],h=f.length,d=po(t.call(l,l&&l.__data__,s,r)),T=d.length,E=u[s]=new Array(T),Y=a[s]=new Array(T),L=c[s]=new Array(h);n(l,f,E,Y,L,d,e);for(var C=0,S=0,p,b;C<T;++C)if(p=E[C]){for(C>=S&&(S=C+1);!(b=Y[S])&&++S<T;);p._next=b||null}}return a=new K(a,r),a._enter=u,a._exit=c,a}function po(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function yo(){return new K(this._exit||this._groups.map(Jn),this._parents)}function wo(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function xo(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),u=new Array(i),c=0;c<a;++c)for(var s=n[c],l=r[c],f=s.length,h=u[c]=new Array(f),d,T=0;T<f;++T)(d=s[T]||l[T])&&(h[T]=d);for(;c<i;++c)u[c]=n[c];return new K(u,this._parents)}function vo(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function _o(t){t||(t=Mo);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],u=a.length,c=i[o]=new Array(u),s,l=0;l<u;++l)(s=a[l])&&(c[l]=s);c.sort(e)}return new K(i,this._parents).order()}function Mo(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function bo(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function $o(){return Array.from(this)}function To(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function ko(){let t=0;for(const e of this)++t;return t}function So(){return!this.node()}function Ao(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,u;o<a;++o)(u=i[o])&&t.call(u,u.__data__,o,i);return this}function Co(t){return function(){this.removeAttribute(t)}}function Do(t){return function(){this.removeAttributeNS(t.space,t.local)}}function No(t,e){return function(){this.setAttribute(t,e)}}function Fo(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Uo(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Yo(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Eo(t,e){var n=ce(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Do:Co:typeof e=="function"?n.local?Yo:Uo:n.local?Fo:No)(n,e))}function Qn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Ho(t){return function(){this.style.removeProperty(t)}}function Oo(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Ro(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Io(t,e,n){return arguments.length>1?this.each((e==null?Ho:typeof e=="function"?Ro:Oo)(t,e,n??"")):Dt(this.node(),t)}function Dt(t,e){return t.style.getPropertyValue(e)||Qn(t).getComputedStyle(t,null).getPropertyValue(e)}function Lo(t){return function(){delete this[t]}}function Po(t,e){return function(){this[t]=e}}function Wo(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function zo(t,e){return arguments.length>1?this.each((e==null?Lo:typeof e=="function"?Wo:Po)(t,e)):this.node()[t]}function jn(t){return t.trim().split(/^|\s+/)}function Xe(t){return t.classList||new Kn(t)}function Kn(t){this._node=t,this._names=jn(t.getAttribute("class")||"")}Kn.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 tr(t,e){for(var n=Xe(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function er(t,e){for(var n=Xe(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function qo(t){return function(){tr(this,t)}}function Vo(t){return function(){er(this,t)}}function Bo(t,e){return function(){(e.apply(this,arguments)?tr:er)(this,t)}}function Xo(t,e){var n=jn(t+"");if(arguments.length<2){for(var r=Xe(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Bo:e?qo:Vo)(n,e))}function Zo(){this.textContent=""}function Go(t){return function(){this.textContent=t}}function Jo(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Qo(t){return arguments.length?this.each(t==null?Zo:(typeof t=="function"?Jo:Go)(t)):this.node().textContent}function jo(){this.innerHTML=""}function Ko(t){return function(){this.innerHTML=t}}function ta(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function ea(t){return arguments.length?this.each(t==null?jo:(typeof t=="function"?ta:Ko)(t)):this.node().innerHTML}function na(){this.nextSibling&&this.parentNode.appendChild(this)}function ra(){return this.each(na)}function ia(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function oa(){return this.each(ia)}function aa(t){var e=typeof t=="function"?t:Vn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function sa(){return null}function ua(t,e){var n=typeof t=="function"?t:Vn(t),r=e==null?sa:typeof e=="function"?e:Be(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ca(){var t=this.parentNode;t&&t.removeChild(this)}function la(){return this.each(ca)}function fa(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ha(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function da(t){return this.select(t?ha:fa)}function ga(t){return arguments.length?this.property("__data__",t):this.node().__data__}function ma(t){return function(e){t.call(this,e,this.__data__)}}function pa(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function ya(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function wa(t,e,n){return function(){var r=this.__on,i,o=ma(e);if(r){for(var a=0,u=r.length;a<u;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function xa(t,e,n){var r=pa(t+""),i,o=r.length,a;if(arguments.length<2){var u=this.node().__on;if(u){for(var c=0,s=u.length,l;c<s;++c)for(i=0,l=u[c];i<o;++i)if((a=r[i]).type===l.type&&a.name===l.name)return l.value}return}for(u=e?wa:ya,i=0;i<o;++i)this.each(u(r[i],e,n));return this}function nr(t,e,n){var r=Qn(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function va(t,e){return function(){return nr(this,t,e)}}function _a(t,e){return function(){return nr(this,t,e.apply(this,arguments))}}function Ma(t,e){return this.each((typeof e=="function"?_a:va)(t,e))}function*ba(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var Ze=[null];function K(t,e){this._groups=t,this._parents=e}function zt(){return new K([[document.documentElement]],Ze)}function $a(){return this}K.prototype=zt.prototype={constructor:K,select:Ji,selectAll:Ki,selectChild:ro,selectChildren:so,filter:uo,data:mo,enter:co,exit:yo,join:wo,merge:xo,selection:$a,order:vo,sort:_o,call:bo,nodes:$o,node:To,size:ko,empty:So,each:Ao,attr:Eo,style:Io,property:zo,classed:Xo,text:Qo,html:ea,raise:ra,lower:oa,append:aa,insert:ua,remove:la,clone:da,datum:ga,on:xa,dispatch:Ma,[Symbol.iterator]:ba};function R(t){return typeof t=="string"?new K([[document.querySelector(t)]],[document.documentElement]):new K([[t]],Ze)}function Ta(t){let e;for(;e=t.sourceEvent;)t=e;return t}function rr(t,e){if(t=Ta(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}function ct(t){return typeof t=="string"?new K([document.querySelectorAll(t)],[document.documentElement]):new K([Bn(t)],Ze)}const ka={passive:!1},qt={capture:!0,passive:!1};function Ge(t){t.stopImmediatePropagation()}function Nt(t){t.preventDefault(),t.stopImmediatePropagation()}function Sa(t){var e=t.document.documentElement,n=R(t).on("dragstart.drag",Nt,qt);"onselectstart"in e?n.on("selectstart.drag",Nt,qt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Aa(t,e){var n=t.document.documentElement,r=R(t).on("dragstart.drag",null);e&&(r.on("click.drag",Nt,qt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const fe=t=>()=>t;function Je(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:u,dx:c,dy:s,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:s,enumerable:!0,configurable:!0},_:{value:l}})}Je.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Ca(t){return!t.ctrlKey&&!t.button}function Da(){return this.parentNode}function Na(t,e){return e??{x:t.x,y:t.y}}function Fa(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ua(){var t=Ca,e=Da,n=Na,r=Fa,i={},o=qe("start","drag","end"),a=0,u,c,s,l,f=0;function h(p){p.on("mousedown.drag",d).filter(r).on("touchstart.drag",Y).on("touchmove.drag",L,ka).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(p,b){if(!(l||!t.call(this,p,b))){var g=S(this,e.call(this,p,b),p,b,"mouse");g&&(R(p.view).on("mousemove.drag",T,qt).on("mouseup.drag",E,qt),Sa(p.view),Ge(p),s=!1,u=p.clientX,c=p.clientY,g("start",p))}}function T(p){if(Nt(p),!s){var b=p.clientX-u,g=p.clientY-c;s=b*b+g*g>f}i.mouse("drag",p)}function E(p){R(p.view).on("mousemove.drag mouseup.drag",null),Aa(p.view,s),Nt(p),i.mouse("end",p)}function Y(p,b){if(t.call(this,p,b)){var g=p.changedTouches,y=e.call(this,p,b),w=g.length,N,A;for(N=0;N<w;++N)(A=S(this,y,p,b,g[N].identifier,g[N]))&&(Ge(p),A("start",p,g[N]))}}function L(p){var b=p.changedTouches,g=b.length,y,w;for(y=0;y<g;++y)(w=i[b[y].identifier])&&(Nt(p),w("drag",p,b[y]))}function C(p){var b=p.changedTouches,g=b.length,y,w;for(l&&clearTimeout(l),l=setTimeout(function(){l=null},500),y=0;y<g;++y)(w=i[b[y].identifier])&&(Ge(p),w("end",p,b[y]))}function S(p,b,g,y,w,N){var A=o.copy(),m=rr(N||g,b),H,P,k;if((k=n.call(p,new Je("beforestart",{sourceEvent:g,target:h,identifier:w,active:a,x:m[0],y:m[1],dx:0,dy:0,dispatch:A}),y))!=null)return H=k.x-m[0]||0,P=k.y-m[1]||0,function _(M,D,$){var F=m,O;switch(M){case"start":i[w]=_,O=a++;break;case"end":delete i[w],--a;case"drag":m=rr($||D,b),O=a;break}A.call(M,p,new Je(M,{sourceEvent:D,subject:k,target:h,identifier:w,active:O,x:m[0]+H,y:m[1]+P,dx:m[0]-F[0],dy:m[1]-F[1],dispatch:A}),y)}}return h.filter=function(p){return arguments.length?(t=typeof p=="function"?p:fe(!!p),h):t},h.container=function(p){return arguments.length?(e=typeof p=="function"?p:fe(p),h):e},h.subject=function(p){return arguments.length?(n=typeof p=="function"?p:fe(p),h):n},h.touchable=function(p){return arguments.length?(r=typeof p=="function"?p:fe(!!p),h):r},h.on=function(){var p=o.on.apply(o,arguments);return p===o?h:p},h.clickDistance=function(p){return arguments.length?(f=(p=+p)*p,h):Math.sqrt(f)},h}function he(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const ir=Symbol("implicit");function bt(){var t=new An,e=[],n=[],r=ir;function i(o){let a=t.get(o);if(a===void 0){if(r!==ir)return r;t.set(o,a=e.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new An;for(const a of o)t.has(a)||t.set(a,e.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return bt(e,n).unknown(r)},he.apply(i,arguments),i}function Qe(){var t=bt().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,a,u=!1,c=0,s=0,l=.5;delete t.unknown;function f(){var h=e().length,d=i<r,T=d?i:r,E=d?r:i;o=(E-T)/Math.max(1,h-c+s*2),u&&(o=Math.floor(o)),T+=(E-T-o*(h-c))*l,a=o*(1-c),u&&(T=Math.round(T),a=Math.round(a));var Y=bi(h).map(function(L){return T+o*L});return n(d?Y.reverse():Y)}return t.domain=function(h){return arguments.length?(e(h),f()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,u=!0,f()},t.bandwidth=function(){return a},t.step=function(){return o},t.round=function(h){return arguments.length?(u=!!h,f()):u},t.padding=function(h){return arguments.length?(c=Math.min(1,s=+h),f()):c},t.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},t.paddingOuter=function(h){return arguments.length?(s=+h,f()):s},t.align=function(h){return arguments.length?(l=Math.max(0,Math.min(1,h)),f()):l},t.copy=function(){return Qe(e(),[r,i]).round(u).paddingInner(c).paddingOuter(s).align(l)},he.apply(f(),arguments)}const je=t=>()=>t;function Ya(t,e){return function(n){return t+n*e}}function Ea(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Ha(t){return(t=+t)==1?or:function(e,n){return n-e?Ea(e,n,t):je(isNaN(e)?n:e)}}function or(t,e){var n=e-t;return n?Ya(t,n):je(isNaN(t)?e:t)}const de=function t(e){var n=Ha(e);function r(i,o){var a=n((i=We(i)).r,(o=We(o)).r),u=n(i.g,o.g),c=n(i.b,o.b),s=or(i.opacity,o.opacity);return function(l){return i.r=a(l),i.g=u(l),i.b=c(l),i.opacity=s(l),i+""}}return r.gamma=t,r}(1);function Oa(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function Ra(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ia(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=en(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(u){for(a=0;a<r;++a)o[a]=i[a](u);return o}}function La(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function at(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Pa(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=en(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Ke=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tn=new RegExp(Ke.source,"g");function Wa(t){return function(){return t}}function za(t){return function(e){return t(e)+""}}function ar(t,e){var n=Ke.lastIndex=tn.lastIndex=0,r,i,o,a=-1,u=[],c=[];for(t=t+"",e=e+"";(r=Ke.exec(t))&&(i=tn.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(i=i[0])?u[a]?u[a]+=i:u[++a]=i:(u[++a]=null,c.push({i:a,x:at(r,i)})),n=tn.lastIndex;return n<e.length&&(o=e.slice(n),u[a]?u[a]+=o:u[++a]=o),u.length<2?c[0]?za(c[0].x):Wa(e):(e=c.length,function(s){for(var l=0,f;l<e;++l)u[(f=c[l]).i]=f.x(s);return u.join("")})}function en(t,e){var n=typeof e,r;return e==null||n==="boolean"?je(e):(n==="number"?at:n==="string"?(r=vt(e))?(e=r,de):ar:e instanceof vt?de:e instanceof Date?La:Ra(e)?Oa:Array.isArray(e)?Ia:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Pa:at)(t,e)}function qa(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var sr=180/Math.PI,nn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ur(t,e,n,r,i,o){var a,u,c;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,c/=u),t*r<e*n&&(t=-t,e=-e,c=-c,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*sr,skewX:Math.atan(c)*sr,scaleX:a,scaleY:u}}var ge;function Va(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?nn:ur(e.a,e.b,e.c,e.d,e.e,e.f)}function Ba(t){return t==null||(ge||(ge=document.createElementNS("http://www.w3.org/2000/svg","g")),ge.setAttribute("transform",t),!(t=ge.transform.baseVal.consolidate()))?nn:(t=t.matrix,ur(t.a,t.b,t.c,t.d,t.e,t.f))}function cr(t,e,n,r){function i(s){return s.length?s.pop()+" ":""}function o(s,l,f,h,d,T){if(s!==f||l!==h){var E=d.push("translate(",null,e,null,n);T.push({i:E-4,x:at(s,f)},{i:E-2,x:at(l,h)})}else(f||h)&&d.push("translate("+f+e+h+n)}function a(s,l,f,h){s!==l?(s-l>180?l+=360:l-s>180&&(s+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:at(s,l)})):l&&f.push(i(f)+"rotate("+l+r)}function u(s,l,f,h){s!==l?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:at(s,l)}):l&&f.push(i(f)+"skewX("+l+r)}function c(s,l,f,h,d,T){if(s!==f||l!==h){var E=d.push(i(d)+"scale(",null,",",null,")");T.push({i:E-4,x:at(s,f)},{i:E-2,x:at(l,h)})}else(f!==1||h!==1)&&d.push(i(d)+"scale("+f+","+h+")")}return function(s,l){var f=[],h=[];return s=t(s),l=t(l),o(s.translateX,s.translateY,l.translateX,l.translateY,f,h),a(s.rotate,l.rotate,f,h),u(s.skewX,l.skewX,f,h),c(s.scaleX,s.scaleY,l.scaleX,l.scaleY,f,h),s=l=null,function(d){for(var T=-1,E=h.length,Y;++T<E;)f[(Y=h[T]).i]=Y.x(d);return f.join("")}}}var Xa=cr(Va,"px, ","px)","deg)"),Za=cr(Ba,", ",")",")");function Ga(t){return function(){return t}}function Ja(t){return+t}var lr=[0,1];function Ft(t){return t}function rn(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Ga(isNaN(e)?NaN:.5)}function Qa(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function ja(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=rn(i,r),o=n(a,o)):(r=rn(r,i),o=n(o,a)),function(u){return o(r(u))}}function Ka(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=rn(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(u){var c=mi(t,u,1,r)-1;return o[c](i[c](u))}}function fr(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function ts(){var t=lr,e=lr,n=en,r,i,o,a=Ft,u,c,s;function l(){var h=Math.min(t.length,e.length);return a!==Ft&&(a=Qa(t[0],t[h-1])),u=h>2?Ka:ja,c=s=null,f}function f(h){return h==null||isNaN(h=+h)?o:(c||(c=u(t.map(r),e,n)))(r(a(h)))}return f.invert=function(h){return a(i((s||(s=u(e,t.map(r),at)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,Ja),l()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),l()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=qa,l()},f.clamp=function(h){return arguments.length?(a=h?!0:Ft,l()):a!==Ft},f.interpolate=function(h){return arguments.length?(n=h,l()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,d){return r=h,i=d,l()}}function hr(){return ts()(Ft,Ft)}function es(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function me(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Ut(t){return t=me(Math.abs(t)),t?t[1]:NaN}function ns(t,e){return function(n,r){for(var i=n.length,o=[],a=0,u=t[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(n.substring(i-=u,i+u)),!((c+=u+1)>r));)u=t[a=(a+1)%t.length];return o.reverse().join(e)}}function rs(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var is=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pe(t){if(!(e=is.exec(t)))throw new Error("invalid format: "+t);var e;return new on({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]})}pe.prototype=on.prototype;function on(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+""}on.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 os(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var dr;function as(t,e){var n=me(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(dr=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+me(t,Math.max(0,e+o-1))[0]}function gr(t,e){var n=me(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const mr={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:es,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)=>gr(t*100,e),r:gr,s:as,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function pr(t){return t}var yr=Array.prototype.map,wr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ss(t){var e=t.grouping===void 0||t.thousands===void 0?pr:ns(yr.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?pr:rs(yr.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function s(f){f=pe(f);var h=f.fill,d=f.align,T=f.sign,E=f.symbol,Y=f.zero,L=f.width,C=f.comma,S=f.precision,p=f.trim,b=f.type;b==="n"?(C=!0,b="g"):mr[b]||(S===void 0&&(S=12),p=!0,b="g"),(Y||h==="0"&&d==="=")&&(Y=!0,h="0",d="=");var g=E==="$"?n:E==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",y=E==="$"?r:/[%p]/.test(b)?a:"",w=mr[b],N=/[defgprs%]/.test(b);S=S===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function A(m){var H=g,P=y,k,_,M;if(b==="c")P=w(m)+P,m="";else{m=+m;var D=m<0||1/m<0;if(m=isNaN(m)?c:w(Math.abs(m),S),p&&(m=os(m)),D&&+m==0&&T!=="+"&&(D=!1),H=(D?T==="("?T:u:T==="-"||T==="("?"":T)+H,P=(b==="s"?wr[8+dr/3]:"")+P+(D&&T==="("?")":""),N){for(k=-1,_=m.length;++k<_;)if(M=m.charCodeAt(k),48>M||M>57){P=(M===46?i+m.slice(k+1):m.slice(k))+P,m=m.slice(0,k);break}}}C&&!Y&&(m=e(m,1/0));var $=H.length+m.length+P.length,F=$<L?new Array(L-$+1).join(h):"";switch(C&&Y&&(m=e(F+m,F.length?L-P.length:1/0),F=""),d){case"<":m=H+m+P+F;break;case"=":m=H+F+m+P;break;case"^":m=F.slice(0,$=F.length>>1)+H+m+P+F.slice($);break;default:m=F+H+m+P;break}return o(m)}return A.toString=function(){return f+""},A}function l(f,h){var d=s((f=pe(f),f.type="f",f)),T=Math.max(-8,Math.min(8,Math.floor(Ut(h)/3)))*3,E=Math.pow(10,-T),Y=wr[8+T/3];return function(L){return d(E*L)+Y}}return{format:s,formatPrefix:l}}var ye,xr,vr;us({thousands:",",grouping:[3],currency:["$",""]});function us(t){return ye=ss(t),xr=ye.format,vr=ye.formatPrefix,ye}function cs(t){return Math.max(0,-Ut(Math.abs(t)))}function ls(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ut(e)/3)))*3-Ut(Math.abs(t)))}function fs(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ut(e)-Ut(t))+1}function hs(t,e,n,r){var i=Ee(t,e,n),o;switch(r=pe(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=ls(i,a))&&(r.precision=o),vr(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=fs(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=cs(i))&&(r.precision=o-(r.type==="%")*2);break}}return xr(r)}function ds(t){var e=t.domain;return t.ticks=function(n){var r=e();return Mi(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return hs(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],u=r[o],c,s,l=10;for(u<a&&(s=a,a=u,u=s,s=i,i=o,o=s);l-- >0;){if(s=Ye(a,u,n),s===c)return r[i]=a,r[o]=u,e(r);if(s>0)a=Math.floor(a/s)*s,u=Math.ceil(u/s)*s;else if(s<0)a=Math.ceil(a*s)/s,u=Math.floor(u*s)/s;else break;c=s}return t},t}function _r(){var t=hr();return t.copy=function(){return fr(t,_r())},he.apply(t,arguments),ds(t)}function gs(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return o<i&&(a=n,n=r,r=a,a=i,i=o,o=a),t[n]=e.floor(i),t[r]=e.ceil(o),t}const an=new Date,sn=new Date;function J(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const a=i(o),u=i.ceil(o);return o-a<u-o?a:u},i.offset=(o,a)=>(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,u)=>{const c=[];if(o=i.ceil(o),u=u==null?1:Math.floor(u),!(o<a)||!(u>0))return c;let s;do c.push(s=new Date(+o)),e(o,u),t(o);while(s<o&&o<a);return c},i.filter=o=>J(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,u)=>{if(a>=a)if(u<0)for(;++u<=0;)for(;e(a,-1),!o(a););else for(;--u>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(an.setTime(+o),sn.setTime(+a),t(an),t(sn),Math.floor(n(an,sn))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const we=J(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);we.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?J(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):we),we.range;const gt=1e3,it=gt*60,mt=it*60,pt=mt*24,un=pt*7,Mr=pt*30,cn=pt*365,Yt=J(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCSeconds());Yt.range;const ln=J(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gt)},(t,e)=>{t.setTime(+t+e*it)},(t,e)=>(e-t)/it,t=>t.getMinutes());ln.range,J(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*it)},(t,e)=>(e-t)/it,t=>t.getUTCMinutes()).range;const fn=J(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gt-t.getMinutes()*it)},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getHours());fn.range,J(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCHours()).range;const Vt=J(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*it)/pt,t=>t.getDate()-1);Vt.range;const hn=J(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/pt,t=>t.getUTCDate()-1);hn.range,J(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/pt,t=>Math.floor(t/pt)).range;function $t(t){return J(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*it)/un)}const xe=$t(0),ve=$t(1),ms=$t(2),ps=$t(3),Et=$t(4),ys=$t(5),ws=$t(6);xe.range,ve.range,ms.range,ps.range,Et.range,ys.range,ws.range;function Tt(t){return J(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/un)}const br=Tt(0),_e=Tt(1),xs=Tt(2),vs=Tt(3),Ht=Tt(4),_s=Tt(5),Ms=Tt(6);br.range,_e.range,xs.range,vs.range,Ht.range,_s.range,Ms.range;const dn=J(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());dn.range,J(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()).range;const yt=J(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());yt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:J(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)}),yt.range;const kt=J(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());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:J(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)}),kt.range;function bs(t,e,n,r,i,o){const a=[[Yt,1,gt],[Yt,5,5*gt],[Yt,15,15*gt],[Yt,30,30*gt],[o,1,it],[o,5,5*it],[o,15,15*it],[o,30,30*it],[i,1,mt],[i,3,3*mt],[i,6,6*mt],[i,12,12*mt],[r,1,pt],[r,2,2*pt],[n,1,un],[e,1,Mr],[e,3,3*Mr],[t,1,cn]];function u(s,l,f){const h=l<s;h&&([s,l]=[l,s]);const d=f&&typeof f.range=="function"?f:c(s,l,f),T=d?d.range(s,+l+1):[];return h?T.reverse():T}function c(s,l,f){const h=Math.abs(l-s)/f,d=Ue(([,,Y])=>Y).right(a,h);if(d===a.length)return t.every(Ee(s/cn,l/cn,f));if(d===0)return we.every(Math.max(Ee(s,l,f),1));const[T,E]=a[h/a[d-1][2]<a[d][2]/h?d-1:d];return T.every(E)}return[u,c]}const[$s,Ts]=bs(yt,dn,xe,Vt,fn,ln);function gn(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 mn(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 Bt(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function ks(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,c=t.shortMonths,s=Xt(i),l=Zt(i),f=Xt(o),h=Zt(o),d=Xt(a),T=Zt(a),E=Xt(u),Y=Zt(u),L=Xt(c),C=Zt(c),S={a:D,A:$,b:F,B:O,c:null,d:Cr,e:Cr,f:Gs,g:ou,G:su,H:Bs,I:Xs,j:Zs,L:Dr,m:Js,M:Qs,p:W,q:B,Q:Hr,s:Or,S:js,u:Ks,U:tu,V:eu,w:nu,W:ru,x:null,X:null,y:iu,Y:au,Z:uu,"%":Er},p={a:Z,A:G,b:tt,B:h