@liggi/figkit 0.3.0 → 0.4.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.
- package/GUIDE.md +104 -5
- package/README.md +4 -4
- package/bin/fig.mjs +3 -3
- package/dist/viz.iife.js +14 -14
- package/examples/charts/bars-range.json +6 -0
- package/examples/charts/dots.json +6 -0
- package/examples/charts/scatter.json +6 -0
- package/examples/charts/sequence.json +67 -0
- package/examples/charts/series-range.json +6 -0
- package/examples/charts/units.json +4 -0
- package/package.json +1 -1
- package/runtime/fig.css +56 -0
- package/runtime/fig.js +7 -0
- package/viz/build.mjs +1 -1
- package/viz/draw.js +289 -18
- package/viz/sequence-spec.js +60 -0
- package/viz/sequence.js +171 -0
- package/viz/spec.js +145 -7
package/dist/viz.iife.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
var figkitViz=(()=>{var Xa=Object.defineProperty;var qy=Object.getOwnPropertyDescriptor;var Yy=Object.getOwnPropertyNames;var Wy=Object.prototype.hasOwnProperty;var Uy=(t,n)=>{for(var e in n)Xa(t,e,{get:n[e],enumerable:!0})},Gy=(t,n,e,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Yy(n))!Wy.call(t,i)&&i!==e&&Xa(t,i,{get:()=>n[i],enumerable:!(r=qy(n,i))||r.enumerable});return t};var Hy=t=>Gy(Xa({},"__esModule",{value:!0}),t);var m7={};Uy(m7,{drawBars:()=>ky,drawChange:()=>Ay,drawDumbbell:()=>Ty,drawGroups:()=>Ol,drawHeatmap:()=>Ry,drawLines:()=>zl,drawPanels:()=>Ny,drawSeries:()=>Cy,drawSpec:()=>p7,drawSplit:()=>Sy,placeRecords:()=>Ey});function At(t,n){return t==null||n==null?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function Qe(t,n){return t==null||n==null?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function Je(t){let n,e,r;t.length!==2?(n=At,e=(c,u)=>At(t(c),u),r=(c,u)=>t(c)-u):(n=t===At||t===Qe?t:Xy,e=t,r=t);function i(c,u,f=0,s=c.length){if(f<s){if(n(u,u)!==0)return s;do{let d=f+s>>>1;e(c[d],u)<0?f=d+1:s=d}while(f<s)}return f}function o(c,u,f=0,s=c.length){if(f<s){if(n(u,u)!==0)return s;do{let d=f+s>>>1;e(c[d],u)<=0?f=d+1:s=d}while(f<s)}return f}function a(c,u,f=0,s=c.length){let d=i(c,u,f,s-1);return d>f&&r(c[d-1],u)>-r(c[d],u)?d-1:d}return{left:i,center:a,right:o}}function Xy(){return 0}function Yl(t){return t===null?NaN:+t}function*Vy(t,n){if(n===void 0)for(let e of t)e!=null&&(e=+e)>=e&&(yield e);else{let e=-1;for(let r of t)(r=n(r,++e,t))!=null&&(r=+r)>=r&&(yield r)}}var Wl=Je(At),tr=Wl.right,y7=Wl.left,b7=Je(Yl).center;var jy=Ul(Gl),Zy=Ul(Ky);function Ul(t){return function(n,e,r=e){if(!((e=+e)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=n;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(a!==void 0?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!e&&!r)return n;let c=e&&t(e),u=r&&t(r),f=i.slice();return c&&u?(je(c,f,i,o,a),je(c,i,f,o,a),je(c,f,i,o,a),Ze(u,i,f,o,a),Ze(u,f,i,o,a),Ze(u,i,f,o,a)):c?(je(c,i,f,o,a),je(c,f,i,o,a),je(c,i,f,o,a)):u&&(Ze(u,i,f,o,a),Ze(u,f,i,o,a),Ze(u,i,f,o,a)),n}}function je(t,n,e,r,i){for(let o=0,a=r*i;o<a;)t(n,e,o,o+=r,1)}function Ze(t,n,e,r,i){for(let o=0,a=r*i;o<r;++o)t(n,e,o,o+a,r)}function Ky(t){let n=Gl(t);return(e,r,i,o,a)=>{i<<=2,o<<=2,a<<=2,n(e,r,i+0,o+0,a),n(e,r,i+1,o+1,a),n(e,r,i+2,o+2,a),n(e,r,i+3,o+3,a)}}function Gl(t){let n=Math.floor(t);if(n===t)return Qy(t);let e=t-n,r=2*t+1;return(i,o,a,c,u)=>{if(!((c-=u)>=a))return;let f=n*o[a],s=u*n,d=s+u;for(let l=a,h=a+s;l<h;l+=u)f+=o[Math.min(c,l)];for(let l=a,h=c;l<=h;l+=u)f+=o[Math.min(c,l+s)],i[l]=(f+e*(o[Math.max(a,l-d)]+o[Math.min(c,l+d)]))/r,f-=o[Math.max(a,l-s)]}}function Qy(t){let n=2*t+1;return(e,r,i,o,a)=>{if(!((o-=a)>=i))return;let c=t*r[i],u=a*t;for(let f=i,s=i+u;f<s;f+=a)c+=r[Math.min(o,f)];for(let f=i,s=o;f<=s;f+=a)c+=r[Math.min(o,f+u)],e[f]=c/n,c-=r[Math.max(i,f-u)]}}function Ji(t,n){let e=0;if(n===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++e;else{let r=-1;for(let i of t)(i=n(i,++r,t))!=null&&(i=+i)>=i&&++e}return e}function Jy(t){return t.length|0}function tb(t){return!(t>0)}function nb(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function eb(t){return n=>t(...n)}function Hl(...t){let n=typeof t[t.length-1]=="function"&&eb(t.pop());t=t.map(nb);let e=t.map(Jy),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||e.some(tb))return o;for(;;){o.push(i.map((c,u)=>t[u][c]));let a=r;for(;++i[a]===e[a];){if(a===0)return n?o.map(n):o;i[a--]=0}}}function Xl(t,n){var e=0,r=0;return Float64Array.from(t,n===void 0?i=>e+=+i||0:i=>e+=+n(i,r++,t)||0)}function Za(t,n){let e=0,r,i=0,o=0;if(n===void 0)for(let a of t)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++e,o+=r*(a-i));else{let a=-1;for(let c of t)(c=n(c,++a,t))!=null&&(c=+c)>=c&&(r=c-i,i+=r/++e,o+=r*(c-i))}if(e>1)return o/(e-1)}function Ka(t,n){let e=Za(t,n);return e&&Math.sqrt(e)}function Wt(t,n){let e,r;if(n===void 0)for(let i of t)i!=null&&(e===void 0?i>=i&&(e=r=i):(e>i&&(e=i),r<i&&(r=i)));else{let i=-1;for(let o of t)(o=n(o,++i,t))!=null&&(e===void 0?o>=o&&(e=r=o):(e>o&&(e=o),r<o&&(r=o)))}return[e,r]}var Vt=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(n){let e=this._partials,r=0;for(let i=0;i<this._n&&i<32;i++){let o=e[i],a=n+o,c=Math.abs(n)<Math.abs(o)?n-(a-o):o-(a-n);c&&(e[r++]=c),n=a}return e[r]=n,this._n=r+1,this}valueOf(){let n=this._partials,e=this._n,r,i,o,a=0;if(e>0){for(a=n[--e];e>0&&(r=a,i=n[--e],a=r+i,o=i-(a-r),!o););e>0&&(o<0&&n[e-1]<0||o>0&&n[e-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}};var an=class extends Map{constructor(n,e=Zl){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),n!=null)for(let[r,i]of n)this.set(r,i)}get(n){return super.get(Va(this,n))}has(n){return super.has(Va(this,n))}set(n,e){return super.set(Vl(this,n),e)}delete(n){return super.delete(jl(this,n))}},ge=class extends Set{constructor(n,e=Zl){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),n!=null)for(let r of n)this.add(r)}has(n){return super.has(Va(this,n))}add(n){return super.add(Vl(this,n))}delete(n){return super.delete(jl(this,n))}};function Va({_intern:t,_key:n},e){let r=n(e);return t.has(r)?t.get(r):e}function Vl({_intern:t,_key:n},e){let r=n(e);return t.has(r)?t.get(r):(t.set(r,e),e)}function jl({_intern:t,_key:n},e){let r=n(e);return t.has(r)&&(e=t.get(r),t.delete(r)),e}function Zl(t){return t!==null&&typeof t=="object"?t.valueOf():t}function ja(t){return t}function Br(t,...n){return Qa(t,ja,ja,n)}function ye(t,n,...e){return Qa(t,ja,n,e)}function Kl(t,n,...e){return Qa(t,Array.from,n,e)}function Qa(t,n,e,r){return(function i(o,a){if(a>=r.length)return e(o);let c=new an,u=r[a++],f=-1;for(let s of o){let d=u(s,++f,o),l=c.get(d);l?l.push(s):c.set(d,[s])}for(let[s,d]of c)c.set(s,i(d,a));return n(c)})(t,0)}function rb(t,n){return Array.from(n,e=>t[e])}function Fr(t,...n){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[e]=n;if(e&&e.length!==2||n.length>1){let r=Uint32Array.from(t,(i,o)=>o);return n.length>1?(n=n.map(i=>t.map(i)),r.sort((i,o)=>{for(let a of n){let c=Ki(a[i],a[o]);if(c)return c}})):(e=t.map(e),r.sort((i,o)=>Ki(e[i],e[o]))),rb(t,r)}return t.sort(Ql(e))}function Ql(t=At){if(t===At)return Ki;if(typeof t!="function")throw new TypeError("compare is not a function");return(n,e)=>{let r=t(n,e);return r||r===0?r:(t(e,e)===0)-(t(n,n)===0)}}function Ki(t,n){return(t==null||!(t>=t))-(n==null||!(n>=n))||(t<n?-1:t>n?1:0)}function to(t,n,e){return(n.length!==2?Fr(ye(t,n,e),(([r,i],[o,a])=>At(i,a)||At(r,o))):Fr(Br(t,e),(([r,i],[o,a])=>n(i,a)||At(r,o)))).map(([r])=>r)}var ib=Array.prototype,w7=ib.slice;var ob=Math.sqrt(50),ab=Math.sqrt(10),cb=Math.sqrt(2);function Qi(t,n,e){let r=(n-t)/Math.max(0,e),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=ob?10:o>=ab?5:o>=cb?2:1,c,u,f;return i<0?(f=Math.pow(10,-i)/a,c=Math.round(t*f),u=Math.round(n*f),c/f<t&&++c,u/f>n&&--u,f=-f):(f=Math.pow(10,i)*a,c=Math.round(t/f),u=Math.round(n/f),c*f<t&&++c,u*f>n&&--u),u<c&&.5<=e&&e<2?Qi(t,n,e*2):[c,u,f]}function be(t,n,e){if(n=+n,t=+t,e=+e,!(e>0))return[];if(t===n)return[t];let r=n<t,[i,o,a]=r?Qi(n,t,e):Qi(t,n,e);if(!(o>=i))return[];let c=o-i+1,u=new Array(c);if(r)if(a<0)for(let f=0;f<c;++f)u[f]=(o-f)/-a;else for(let f=0;f<c;++f)u[f]=(o-f)*a;else if(a<0)for(let f=0;f<c;++f)u[f]=(i+f)/-a;else for(let f=0;f<c;++f)u[f]=(i+f)*a;return u}function Ke(t,n,e){return n=+n,t=+t,e=+e,Qi(t,n,e)[2]}function qr(t,n,e){n=+n,t=+t,e=+e;let r=n<t,i=r?Ke(n,t,e):Ke(t,n,e);return(r?-1:1)*(i<0?1/-i:i)}function Jl(t){return Math.max(1,Math.ceil(Math.log(Ji(t))/Math.LN2)+1)}function Yt(t,n){let e;if(n===void 0)for(let r of t)r!=null&&(e<r||e===void 0&&r>=r)&&(e=r);else{let r=-1;for(let i of t)(i=n(i,++r,t))!=null&&(e<i||e===void 0&&i>=i)&&(e=i)}return e}function td(t,n){let e,r=-1,i=-1;if(n===void 0)for(let o of t)++i,o!=null&&(e<o||e===void 0&&o>=o)&&(e=o,r=i);else for(let o of t)(o=n(o,++i,t))!=null&&(e<o||e===void 0&&o>=o)&&(e=o,r=i);return r}function cn(t,n){let e;if(n===void 0)for(let r of t)r!=null&&(e>r||e===void 0&&r>=r)&&(e=r);else{let r=-1;for(let i of t)(i=n(i,++r,t))!=null&&(e>i||e===void 0&&i>=i)&&(e=i)}return e}function nd(t,n){let e,r=-1,i=-1;if(n===void 0)for(let o of t)++i,o!=null&&(e>o||e===void 0&&o>=o)&&(e=o,r=i);else for(let o of t)(o=n(o,++i,t))!=null&&(e>o||e===void 0&&o>=o)&&(e=o,r=i);return r}function ed(t,n,e=0,r=1/0,i){if(n=Math.floor(n),e=Math.floor(Math.max(0,e)),r=Math.floor(Math.min(t.length-1,r)),!(e<=n&&n<=r))return t;for(i=i===void 0?Ki:Ql(i);r>e;){if(r-e>600){let u=r-e+1,f=n-e+1,s=Math.log(u),d=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*d*(u-d)/u)*(f-u/2<0?-1:1),h=Math.max(e,Math.floor(n-f*d/u+l)),m=Math.min(r,Math.floor(n+(u-f)*d/u+l));ed(t,n,h,m,i)}let o=t[n],a=e,c=r;for(zr(t,e,n),i(t[r],o)>0&&zr(t,e,r);a<c;){for(zr(t,a,c),++a,--c;i(t[a],o)<0;)++a;for(;i(t[c],o)>0;)--c}i(t[e],o)===0?zr(t,e,c):(++c,zr(t,c,r)),c<=n&&(e=c+1),n<=c&&(r=c-1)}return t}function zr(t,n,e){let r=t[n];t[n]=t[e],t[e]=r}function Ja(t,n=At){let e,r=!1;if(n.length===1){let i;for(let o of t){let a=n(o);(r?At(a,i)>0:At(a,a)===0)&&(e=o,i=a,r=!0)}}else for(let i of t)(r?n(i,e)>0:n(i,i)===0)&&(e=i,r=!0);return e}function Jn(t,n,e){if(t=Float64Array.from(Vy(t,e)),!(!(r=t.length)||isNaN(n=+n))){if(n<=0||r<2)return cn(t);if(n>=1)return Yt(t);var r,i=(r-1)*n,o=Math.floor(i),a=Yt(ed(t,o).subarray(0,o+1)),c=cn(t.subarray(o+1));return a+(c-a)*(i-o)}}function rd(t,n,e=Yl){if(!(!(r=t.length)||isNaN(n=+n))){if(n<=0||r<2)return+e(t[0],0,t);if(n>=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),a=+e(t[o],o,t),c=+e(t[o+1],o+1,t);return a+(c-a)*(i-o)}}function id(t,n,e){let r=Ji(t),i=Jn(t,.75)-Jn(t,.25);return r&&i?Math.ceil((e-n)/(2*i*Math.pow(r,-1/3))):1}function tc(t,n,e){let r=Ji(t),i=Ka(t);return r&&i?Math.ceil((e-n)*Math.cbrt(r)/(3.49*i)):1}function nc(t,n){let e=0,r=0;if(n===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++e,r+=i);else{let i=-1;for(let o of t)(o=n(o,++i,t))!=null&&(o=+o)>=o&&(++e,r+=o)}if(e)return r/e}function Yr(t,n){return Jn(t,.5,n)}function*ub(t){for(let n of t)yield*n}function ec(t){return Array.from(ub(t))}function od(t,n){let e=new an;if(n===void 0)for(let o of t)o!=null&&o>=o&&e.set(o,(e.get(o)||0)+1);else{let o=-1;for(let a of t)(a=n(a,++o,t))!=null&&a>=a&&e.set(a,(e.get(a)||0)+1)}let r,i=0;for(let[o,a]of e)a>i&&(i=a,r=o);return r}function ad(t,n=fb){let e=[],r,i=!1;for(let o of t)i&&e.push(n(r,o)),r=o,i=!0;return e}function fb(t,n){return[t,n]}function nr(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=Math.max(0,Math.ceil((n-t)/e))|0,o=new Array(i);++r<i;)o[r]=t+r*e;return o}var x7=sb(Math.random);function sb(t){return function(e,r=0,i=e.length){let o=i-(r=+r);for(;o;){let a=t()*o--|0,c=e[o+r];e[o+r]=e[a+r],e[a+r]=c}return e}}function mn(t,n){let e=0;if(n===void 0)for(let r of t)(r=+r)&&(e+=r);else{let r=-1;for(let i of t)(i=+n(i,++r,t))&&(e+=i)}return e}function Wr(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function lb(t){return t}var rc=1,ic=2,oc=3,no=4,cd=1e-6;function db(t){return"translate("+t+",0)"}function hb(t){return"translate(0,"+t+")"}function pb(t){return n=>+t(n)}function mb(t,n){return n=Math.max(0,t.bandwidth()-n*2)/2,t.round()&&(n=Math.round(n)),e=>+t(e)+n}function gb(){return!this.__axis}function yb(t,n){var e=[],r=null,i=null,o=6,a=6,c=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,f=t===rc||t===no?-1:1,s=t===no||t===ic?"x":"y",d=t===rc||t===oc?db:hb;function l(h){var m=r??(n.ticks?n.ticks.apply(n,e):n.domain()),g=i??(n.tickFormat?n.tickFormat.apply(n,e):lb),x=Math.max(o,0)+c,v=n.range(),w=+v[0]+u,$=+v[v.length-1]+u,p=(n.bandwidth?mb:pb)(n.copy(),u),b=h.selection?h.selection():h,y=b.selectAll(".domain").data([null]),_=b.selectAll(".tick").data(m,n).order(),M=_.exit(),S=_.enter().append("g").attr("class","tick"),C=_.select("line"),k=_.select("text");y=y.merge(y.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),_=_.merge(S),C=C.merge(S.append("line").attr("stroke","currentColor").attr(s+"2",f*o)),k=k.merge(S.append("text").attr("fill","currentColor").attr(s,f*x).attr("dy",t===rc?"0em":t===oc?"0.71em":"0.32em")),h!==b&&(y=y.transition(h),_=_.transition(h),C=C.transition(h),k=k.transition(h),M=M.transition(h).attr("opacity",cd).attr("transform",function(T){return isFinite(T=p(T))?d(T+u):this.getAttribute("transform")}),S.attr("opacity",cd).attr("transform",function(T){var D=this.parentNode.__axis;return d((D&&isFinite(D=D(T))?D:p(T))+u)})),M.remove(),y.attr("d",t===no||t===ic?a?"M"+f*a+","+w+"H"+u+"V"+$+"H"+f*a:"M"+u+","+w+"V"+$:a?"M"+w+","+f*a+"V"+u+"H"+$+"V"+f*a:"M"+w+","+u+"H"+$),_.attr("opacity",1).attr("transform",function(T){return d(p(T)+u)}),C.attr(s+"2",f*o),k.attr(s,f*x).text(g),b.filter(gb).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===ic?"start":t===no?"end":"middle"),b.each(function(){this.__axis=p})}return l.scale=function(h){return arguments.length?(n=h,l):n},l.ticks=function(){return e=Array.from(arguments),l},l.tickArguments=function(h){return arguments.length?(e=h==null?[]:Array.from(h),l):e.slice()},l.tickValues=function(h){return arguments.length?(r=h==null?null:Array.from(h),l):r&&r.slice()},l.tickFormat=function(h){return arguments.length?(i=h,l):i},l.tickSize=function(h){return arguments.length?(o=a=+h,l):o},l.tickSizeInner=function(h){return arguments.length?(o=+h,l):o},l.tickSizeOuter=function(h){return arguments.length?(a=+h,l):a},l.tickPadding=function(h){return arguments.length?(c=+h,l):c},l.offset=function(h){return arguments.length?(u=+h,l):u},l}function ud(t){return yb(oc,t)}var ac="http://www.w3.org/1999/xhtml",we={svg:"http://www.w3.org/2000/svg",xhtml:ac,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function fd(t){var n=t+="",e=n.indexOf(":");return e>=0&&(n=t.slice(0,e))!=="xmlns"&&(t=t.slice(e+1)),we.hasOwnProperty(n)?{space:we[n],local:t}:t}function bb(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===ac&&n.documentElement.namespaceURI===ac?n.createElement(t):n.createElementNS(e,t)}}function wb(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ur(t){var n=fd(t);return(n.local?wb:bb)(n)}function xb(){}function sd(t){return t==null?xb:function(){return this.querySelector(t)}}function vb(t){typeof t!="function"&&(t=sd(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],a=o.length,c=r[i]=new Array(a),u,f,s=0;s<a;++s)(u=o[s])&&(f=t.call(u,u.__data__,s,o))&&("__data__"in u&&(f.__data__=u.__data__),c[s]=f);return new Ut(r,this._parents)}function _b(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Mb(){return[]}function $b(t){return t==null?Mb:function(){return this.querySelectorAll(t)}}function Sb(t){return function(){return _b(t.apply(this,arguments))}}function kb(t){typeof t=="function"?t=Sb(t):t=$b(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a=n[o],c=a.length,u,f=0;f<c;++f)(u=a[f])&&(r.push(t.call(u,u.__data__,f,a)),i.push(u));return new Ut(r,i)}function Ab(t){return function(){return this.matches(t)}}function ld(t){return function(n){return n.matches(t)}}var Tb=Array.prototype.find;function Cb(t){return function(){return Tb.call(this.children,t)}}function Eb(){return this.firstElementChild}function Nb(t){return this.select(t==null?Eb:Cb(typeof t=="function"?t:ld(t)))}var Rb=Array.prototype.filter;function Lb(){return Array.from(this.children)}function Pb(t){return function(){return Rb.call(this.children,t)}}function Db(t){return this.selectAll(t==null?Lb:Pb(typeof t=="function"?t:ld(t)))}function Ib(t){typeof t!="function"&&(t=Ab(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],a=o.length,c=r[i]=[],u,f=0;f<a;++f)(u=o[f])&&t.call(u,u.__data__,f,o)&&c.push(u);return new Ut(r,this._parents)}function dd(t){return new Array(t.length)}function Ob(){return new Ut(this._enter||this._groups.map(dd),this._parents)}function eo(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}eo.prototype={constructor:eo,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function zb(t){return function(){return t}}function Fb(t,n,e,r,i,o){for(var a=0,c,u=n.length,f=o.length;a<f;++a)(c=n[a])?(c.__data__=o[a],r[a]=c):e[a]=new eo(t,o[a]);for(;a<u;++a)(c=n[a])&&(i[a]=c)}function Bb(t,n,e,r,i,o,a){var c,u,f=new Map,s=n.length,d=o.length,l=new Array(s),h;for(c=0;c<s;++c)(u=n[c])&&(l[c]=h=a.call(u,u.__data__,c,n)+"",f.has(h)?i[c]=u:f.set(h,u));for(c=0;c<d;++c)h=a.call(t,o[c],c,o)+"",(u=f.get(h))?(r[c]=u,u.__data__=o[c],f.delete(h)):e[c]=new eo(t,o[c]);for(c=0;c<s;++c)(u=n[c])&&f.get(l[c])===u&&(i[c]=u)}function qb(t){return t.__data__}function Yb(t,n){if(!arguments.length)return Array.from(this,qb);var e=n?Bb:Fb,r=this._parents,i=this._groups;typeof t!="function"&&(t=zb(t));for(var o=i.length,a=new Array(o),c=new Array(o),u=new Array(o),f=0;f<o;++f){var s=r[f],d=i[f],l=d.length,h=Wb(t.call(s,s&&s.__data__,f,r)),m=h.length,g=c[f]=new Array(m),x=a[f]=new Array(m),v=u[f]=new Array(l);e(s,d,g,x,v,h,n);for(var w=0,$=0,p,b;w<m;++w)if(p=g[w]){for(w>=$&&($=w+1);!(b=x[$])&&++$<m;);p._next=b||null}}return a=new Ut(a,r),a._enter=c,a._exit=u,a}function Wb(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Ub(){return new Ut(this._exit||this._groups.map(dd),this._parents)}function Gb(t,n,e){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),n!=null&&(i=n(i),i&&(i=i.selection())),e==null?o.remove():e(o),r&&i?r.merge(i).order():i}function Hb(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,a=Math.min(i,o),c=new Array(i),u=0;u<a;++u)for(var f=e[u],s=r[u],d=f.length,l=c[u]=new Array(d),h,m=0;m<d;++m)(h=f[m]||s[m])&&(l[m]=h);for(;u<i;++u)c[u]=e[u];return new Ut(c,this._parents)}function Xb(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r=t[n],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 Vb(t){t||(t=jb);function n(d,l){return d&&l?t(d.__data__,l.__data__):!d-!l}for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a=e[o],c=a.length,u=i[o]=new Array(c),f,s=0;s<c;++s)(f=a[s])&&(u[s]=f);u.sort(n)}return new Ut(i,this._parents).order()}function jb(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function Zb(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Kb(){return Array.from(this)}function Qb(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function Jb(){let t=0;for(let n of this)++t;return t}function t2(){return!this.node()}function n2(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i=n[e],o=0,a=i.length,c;o<a;++o)(c=i[o])&&t.call(c,c.__data__,o,i);return this}function e2(t){return function(){this.removeAttribute(t)}}function r2(t){return function(){this.removeAttributeNS(t.space,t.local)}}function i2(t,n){return function(){this.setAttribute(t,n)}}function o2(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function a2(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}}function c2(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function u2(t,n){var e=fd(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((n==null?e.local?r2:e2:typeof n=="function"?e.local?c2:a2:e.local?o2:i2)(e,n))}function hd(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function f2(t){return function(){this.style.removeProperty(t)}}function s2(t,n,e){return function(){this.style.setProperty(t,n,e)}}function l2(t,n,e){return function(){var r=n.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function d2(t,n,e){return arguments.length>1?this.each((n==null?f2:typeof n=="function"?l2:s2)(t,n,e??"")):h2(this.node(),t)}function h2(t,n){return t.style.getPropertyValue(n)||hd(t).getComputedStyle(t,null).getPropertyValue(n)}function p2(t){return function(){delete this[t]}}function m2(t,n){return function(){this[t]=n}}function g2(t,n){return function(){var e=n.apply(this,arguments);e==null?delete this[t]:this[t]=e}}function y2(t,n){return arguments.length>1?this.each((n==null?p2:typeof n=="function"?g2:m2)(t,n)):this.node()[t]}function pd(t){return t.trim().split(/^|\s+/)}function uc(t){return t.classList||new md(t)}function md(t){this._node=t,this._names=pd(t.getAttribute("class")||"")}md.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function gd(t,n){for(var e=uc(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function yd(t,n){for(var e=uc(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function b2(t){return function(){gd(this,t)}}function w2(t){return function(){yd(this,t)}}function x2(t,n){return function(){(n.apply(this,arguments)?gd:yd)(this,t)}}function v2(t,n){var e=pd(t+"");if(arguments.length<2){for(var r=uc(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each((typeof n=="function"?x2:n?b2:w2)(e,n))}function _2(){this.textContent=""}function M2(t){return function(){this.textContent=t}}function $2(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function S2(t){return arguments.length?this.each(t==null?_2:(typeof t=="function"?$2:M2)(t)):this.node().textContent}function k2(){this.innerHTML=""}function A2(t){return function(){this.innerHTML=t}}function T2(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function C2(t){return arguments.length?this.each(t==null?k2:(typeof t=="function"?T2:A2)(t)):this.node().innerHTML}function E2(){this.nextSibling&&this.parentNode.appendChild(this)}function N2(){return this.each(E2)}function R2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function L2(){return this.each(R2)}function P2(t){var n=typeof t=="function"?t:Ur(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function D2(){return null}function I2(t,n){var e=typeof t=="function"?t:Ur(t),r=n==null?D2:typeof n=="function"?n:sd(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function O2(){var t=this.parentNode;t&&t.removeChild(this)}function z2(){return this.each(O2)}function F2(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function B2(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function q2(t){return this.select(t?B2:F2)}function Y2(t){return arguments.length?this.property("__data__",t):this.node().__data__}function W2(t){return function(n){t.call(this,n,this.__data__)}}function U2(t){return t.trim().split(/^|\s+/).map(function(n){var e="",r=n.indexOf(".");return r>=0&&(e=n.slice(r+1),n=n.slice(0,r)),{type:n,name:e}})}function G2(t){return function(){var n=this.__on;if(n){for(var e=0,r=-1,i=n.length,o;e<i;++e)o=n[e],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):n[++r]=o;++r?n.length=r:delete this.__on}}}function H2(t,n,e){return function(){var r=this.__on,i,o=W2(n);if(r){for(var a=0,c=r.length;a<c;++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=e),i.value=n;return}}this.addEventListener(t.type,o,e),i={type:t.type,name:t.name,value:n,listener:o,options:e},r?r.push(i):this.__on=[i]}}function X2(t,n,e){var r=U2(t+""),i,o=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,f=c.length,s;u<f;++u)for(i=0,s=c[u];i<o;++i)if((a=r[i]).type===s.type&&a.name===s.name)return s.value}return}for(c=n?H2:G2,i=0;i<o;++i)this.each(c(r[i],n,e));return this}function bd(t,n,e){var r=hd(t),i=r.CustomEvent;typeof i=="function"?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function V2(t,n){return function(){return bd(this,t,n)}}function j2(t,n){return function(){return bd(this,t,n.apply(this,arguments))}}function Z2(t,n){return this.each((typeof n=="function"?j2:V2)(t,n))}function*K2(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var wd=[null];function Ut(t,n){this._groups=t,this._parents=n}function Q2(){return new Ut([[document.documentElement]],wd)}function J2(){return this}Ut.prototype=Q2.prototype={constructor:Ut,select:vb,selectAll:kb,selectChild:Nb,selectChildren:Db,filter:Ib,data:Yb,enter:Ob,exit:Ub,join:Gb,merge:Hb,selection:J2,order:Xb,sort:Vb,call:Zb,nodes:Kb,node:Qb,size:Jb,empty:t2,each:n2,attr:u2,style:d2,property:y2,classed:v2,text:S2,html:C2,raise:N2,lower:L2,append:P2,insert:I2,remove:z2,clone:q2,datum:Y2,on:X2,dispatch:Z2,[Symbol.iterator]:K2};function Rn(t){return typeof t=="string"?new Ut([[document.querySelector(t)]],[document.documentElement]):new Ut([[t]],wd)}var tw=0;function nw(){return new cc}function cc(){this._="@"+(++tw).toString(36)}cc.prototype=nw.prototype={constructor:cc,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};function ew(t){let n;for(;n=t.sourceEvent;)t=n;return t}function xd(t,n){if(t=ew(t),n===void 0&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]}function or(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Xr(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function te(){}var Me=.7,ir=1/Me,er="\\s*([+-]?\\d+)\\s*",Gr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rw=/^#([0-9a-f]{3,8})$/,iw=new RegExp(`^rgb\\(${er},${er},${er}\\)$`),ow=new RegExp(`^rgb\\(${gn},${gn},${gn}\\)$`),aw=new RegExp(`^rgba\\(${er},${er},${er},${Gr}\\)$`),cw=new RegExp(`^rgba\\(${gn},${gn},${gn},${Gr}\\)$`),uw=new RegExp(`^hsl\\(${Gr},${gn},${gn}\\)$`),fw=new RegExp(`^hsla\\(${Gr},${gn},${gn},${Gr}\\)$`),vd={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};or(te,ar,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:_d,formatHex:_d,formatHex8:sw,formatHsl:lw,formatRgb:Md,toString:Md});function _d(){return this.rgb().formatHex()}function sw(){return this.rgb().formatHex8()}function lw(){return Rd(this).formatHsl()}function Md(){return this.rgb().formatRgb()}function ar(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=rw.exec(t))?(e=n[1].length,n=parseInt(n[1],16),e===6?$d(n):e===3?new wt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):e===8?ro(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):e===4?ro(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=iw.exec(t))?new wt(n[1],n[2],n[3],1):(n=ow.exec(t))?new wt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=aw.exec(t))?ro(n[1],n[2],n[3],n[4]):(n=cw.exec(t))?ro(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=uw.exec(t))?Ad(n[1],n[2]/100,n[3]/100,1):(n=fw.exec(t))?Ad(n[1],n[2]/100,n[3]/100,n[4]):vd.hasOwnProperty(t)?$d(vd[t]):t==="transparent"?new wt(NaN,NaN,NaN,0):null}function $d(t){return new wt(t>>16&255,t>>8&255,t&255,1)}function ro(t,n,e,r){return r<=0&&(t=n=e=NaN),new wt(t,n,e,r)}function pc(t){return t instanceof te||(t=ar(t)),t?(t=t.rgb(),new wt(t.r,t.g,t.b,t.opacity)):new wt}function $e(t,n,e,r){return arguments.length===1?pc(t):new wt(t,n,e,r??1)}function wt(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}or(wt,$e,Xr(te,{brighter(t){return t=t==null?ir:Math.pow(ir,t),new wt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Me:Math.pow(Me,t),new wt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new wt(ve(this.r),ve(this.g),ve(this.b),oo(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:Sd,formatHex:Sd,formatHex8:dw,formatRgb:kd,toString:kd}));function Sd(){return`#${xe(this.r)}${xe(this.g)}${xe(this.b)}`}function dw(){return`#${xe(this.r)}${xe(this.g)}${xe(this.b)}${xe((isNaN(this.opacity)?1:this.opacity)*255)}`}function kd(){let t=oo(this.opacity);return`${t===1?"rgb(":"rgba("}${ve(this.r)}, ${ve(this.g)}, ${ve(this.b)}${t===1?")":`, ${t})`}`}function oo(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ve(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function xe(t){return t=ve(t),(t<16?"0":"")+t.toString(16)}function Ad(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new un(t,n,e,r)}function Rd(t){if(t instanceof un)return new un(t.h,t.s,t.l,t.opacity);if(t instanceof te||(t=ar(t)),!t)return new un;if(t instanceof un)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,c=o-i,u=(o+i)/2;return c?(n===o?a=(e-r)/c+(e<r)*6:e===o?a=(r-n)/c+2:a=(n-e)/c+4,c/=u<.5?o+i:2-o-i,a*=60):c=u>0&&u<1?0:a,new un(a,c,u,t.opacity)}function co(t,n,e,r){return arguments.length===1?Rd(t):new un(t,n,e,r??1)}function un(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}or(un,co,Xr(te,{brighter(t){return t=t==null?ir:Math.pow(ir,t),new un(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Me:Math.pow(Me,t),new un(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new wt(fc(t>=240?t-240:t+120,i,r),fc(t,i,r),fc(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new un(Td(this.h),io(this.s),io(this.l),oo(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=oo(this.opacity);return`${t===1?"hsl(":"hsla("}${Td(this.h)}, ${io(this.s)*100}%, ${io(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Td(t){return t=(t||0)%360,t<0?t+360:t}function io(t){return Math.max(0,Math.min(1,t||0))}function fc(t,n,e){return(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)*255}var Ld=Math.PI/180,Pd=180/Math.PI,ao=18,Dd=.96422,Id=1,Od=.82521,zd=4/29,rr=6/29,Fd=3*rr*rr,hw=rr*rr*rr;function Bd(t){if(t instanceof yn)return new yn(t.l,t.a,t.b,t.opacity);if(t instanceof Ln)return qd(t);t instanceof wt||(t=pc(t));var n=hc(t.r),e=hc(t.g),r=hc(t.b),i=sc((.2225045*n+.7168786*e+.0606169*r)/Id),o,a;return n===e&&e===r?o=a=i:(o=sc((.4360747*n+.3850649*e+.1430804*r)/Dd),a=sc((.0139322*n+.0971045*e+.7141733*r)/Od)),new yn(116*i-16,500*(o-i),200*(i-a),t.opacity)}function uo(t,n,e,r){return arguments.length===1?Bd(t):new yn(t,n,e,r??1)}function yn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}or(yn,uo,Xr(te,{brighter(t){return new yn(this.l+ao*(t??1),this.a,this.b,this.opacity)},darker(t){return new yn(this.l-ao*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return n=Dd*lc(n),t=Id*lc(t),e=Od*lc(e),new wt(dc(3.1338561*n-1.6168667*t-.4906146*e),dc(-.9787684*n+1.9161415*t+.033454*e),dc(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}}));function sc(t){return t>hw?Math.pow(t,1/3):t/Fd+zd}function lc(t){return t>rr?t*t*t:Fd*(t-zd)}function dc(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function hc(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pw(t){if(t instanceof Ln)return new Ln(t.h,t.c,t.l,t.opacity);if(t instanceof yn||(t=Bd(t)),t.a===0&&t.b===0)return new Ln(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*Pd;return new Ln(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function fo(t,n,e,r){return arguments.length===1?pw(t):new Ln(t,n,e,r??1)}function Ln(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function qd(t){if(isNaN(t.h))return new yn(t.l,0,0,t.opacity);var n=t.h*Ld;return new yn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}or(Ln,fo,Xr(te,{brighter(t){return new Ln(this.h,this.c,this.l+ao*(t??1),this.opacity)},darker(t){return new Ln(this.h,this.c,this.l-ao*(t??1),this.opacity)},rgb(){return qd(this).rgb()}}));var Yd=-.14861,mc=1.78277,gc=-.29227,so=-.90649,Hr=1.97294,Cd=Hr*so,Ed=Hr*mc,Nd=mc*gc-so*Yd;function mw(t){if(t instanceof _e)return new _e(t.h,t.s,t.l,t.opacity);t instanceof wt||(t=pc(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Nd*r+Cd*n-Ed*e)/(Nd+Cd-Ed),o=r-i,a=(Hr*(e-i)-gc*o)/so,c=Math.sqrt(a*a+o*o)/(Hr*i*(1-i)),u=c?Math.atan2(a,o)*Pd-120:NaN;return new _e(u<0?u+360:u,c,i,t.opacity)}function jt(t,n,e,r){return arguments.length===1?mw(t):new _e(t,n,e,r??1)}function _e(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}or(_e,jt,Xr(te,{brighter(t){return t=t==null?ir:Math.pow(ir,t),new _e(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Me:Math.pow(Me,t),new _e(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Ld,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new wt(255*(n+e*(Yd*r+mc*i)),255*(n+e*(gc*r+so*i)),255*(n+e*(Hr*r)),this.opacity)}}));function Gd(t,n,e,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*n+(4-6*o+3*a)*e+(1+3*t+3*o-3*a)*r+a*i)/6}function gw(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,c=r<n-1?t[r+2]:2*o-i;return Gd((e-r/n)*n,a,i,o,c)}}function yw(t){var n=t.length;return function(e){var r=Math.floor(((e%=1)<0?++e:e)*n),i=t[(r+n-1)%n],o=t[r%n],a=t[(r+1)%n],c=t[(r+2)%n];return Gd((e-r/n)*n,i,o,a,c)}}var ho=t=>()=>t;function Hd(t,n){return function(e){return t+e*n}}function bw(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function xc(t,n){var e=n-t;return e?Hd(t,e>180||e<-180?e-360*Math.round(e/360):e):ho(isNaN(t)?n:t)}function ww(t){return(t=+t)==1?xt:function(n,e){return e-n?bw(n,e,t):ho(isNaN(n)?e:n)}}function xt(t,n){var e=n-t;return e?Hd(t,e):ho(isNaN(t)?n:t)}var cr=(function t(n){var e=ww(n);function r(i,o){var a=e((i=$e(i)).r,(o=$e(o)).r),c=e(i.g,o.g),u=e(i.b,o.b),f=xt(i.opacity,o.opacity);return function(s){return i.r=a(s),i.g=c(s),i.b=u(s),i.opacity=f(s),i+""}}return r.gamma=t,r})(1);function Xd(t){return function(n){var e=n.length,r=new Array(e),i=new Array(e),o=new Array(e),a,c;for(a=0;a<e;++a)c=$e(n[a]),r[a]=c.r||0,i[a]=c.g||0,o[a]=c.b||0;return r=t(r),i=t(i),o=t(o),c.opacity=1,function(u){return c.r=r(u),c.g=i(u),c.b=o(u),c+""}}}var Vd=Xd(gw),k7=Xd(yw);function xw(t,n){n||(n=[]);var e=t?Math.min(n.length,t.length):0,r=n.slice(),i;return function(o){for(i=0;i<e;++i)r[i]=t[i]*(1-o)+n[i]*o;return r}}function vw(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function _w(t,n){var e=n?n.length:0,r=t?Math.min(e,t.length):0,i=new Array(r),o=new Array(e),a;for(a=0;a<r;++a)i[a]=ur(t[a],n[a]);for(;a<e;++a)o[a]=n[a];return function(c){for(a=0;a<r;++a)o[a]=i[a](c);return o}}function Mw(t,n){var e=new Date;return t=+t,n=+n,function(r){return e.setTime(t*(1-r)+n*r),e}}function $t(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function $w(t,n){var e={},r={},i;(t===null||typeof t!="object")&&(t={}),(n===null||typeof n!="object")&&(n={});for(i in n)i in t?e[i]=ur(t[i],n[i]):r[i]=n[i];return function(o){for(i in e)r[i]=e[i](o);return r}}var bc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yc=new RegExp(bc.source,"g");function Sw(t){return function(){return t}}function kw(t){return function(n){return t(n)+""}}function Aw(t,n){var e=bc.lastIndex=yc.lastIndex=0,r,i,o,a=-1,c=[],u=[];for(t=t+"",n=n+"";(r=bc.exec(t))&&(i=yc.exec(n));)(o=i.index)>e&&(o=n.slice(e,o),c[a]?c[a]+=o:c[++a]=o),(r=r[0])===(i=i[0])?c[a]?c[a]+=i:c[++a]=i:(c[++a]=null,u.push({i:a,x:$t(r,i)})),e=yc.lastIndex;return e<n.length&&(o=n.slice(e),c[a]?c[a]+=o:c[++a]=o),c.length<2?u[0]?kw(u[0].x):Sw(n):(n=u.length,function(f){for(var s=0,d;s<n;++s)c[(d=u[s]).i]=d.x(f);return c.join("")})}function ur(t,n){var e=typeof n,r;return n==null||e==="boolean"?ho(n):(e==="number"?$t:e==="string"?(r=ar(n))?(n=r,cr):Aw:n instanceof ar?cr:n instanceof Date?Mw:vw(n)?xw:Array.isArray(n)?_w:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?$w:$t)(t,n)}function Vr(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}var Wd=180/Math.PI,wc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function jd(t,n,e,r,i,o){var a,c,u;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(u=t*e+n*r)&&(e-=t*u,r-=n*u),(c=Math.sqrt(e*e+r*r))&&(e/=c,r/=c,u/=c),t*r<n*e&&(t=-t,n=-n,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Wd,skewX:Math.atan(u)*Wd,scaleX:a,scaleY:c}}var lo;function Tw(t){let n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?wc:jd(n.a,n.b,n.c,n.d,n.e,n.f)}function Cw(t){return t==null||(lo||(lo=document.createElementNS("http://www.w3.org/2000/svg","g")),lo.setAttribute("transform",t),!(t=lo.transform.baseVal.consolidate()))?wc:(t=t.matrix,jd(t.a,t.b,t.c,t.d,t.e,t.f))}function Zd(t,n,e,r){function i(f){return f.length?f.pop()+" ":""}function o(f,s,d,l,h,m){if(f!==d||s!==l){var g=h.push("translate(",null,n,null,e);m.push({i:g-4,x:$t(f,d)},{i:g-2,x:$t(s,l)})}else(d||l)&&h.push("translate("+d+n+l+e)}function a(f,s,d,l){f!==s?(f-s>180?s+=360:s-f>180&&(f+=360),l.push({i:d.push(i(d)+"rotate(",null,r)-2,x:$t(f,s)})):s&&d.push(i(d)+"rotate("+s+r)}function c(f,s,d,l){f!==s?l.push({i:d.push(i(d)+"skewX(",null,r)-2,x:$t(f,s)}):s&&d.push(i(d)+"skewX("+s+r)}function u(f,s,d,l,h,m){if(f!==d||s!==l){var g=h.push(i(h)+"scale(",null,",",null,")");m.push({i:g-4,x:$t(f,d)},{i:g-2,x:$t(s,l)})}else(d!==1||l!==1)&&h.push(i(h)+"scale("+d+","+l+")")}return function(f,s){var d=[],l=[];return f=t(f),s=t(s),o(f.translateX,f.translateY,s.translateX,s.translateY,d,l),a(f.rotate,s.rotate,d,l),c(f.skewX,s.skewX,d,l),u(f.scaleX,f.scaleY,s.scaleX,s.scaleY,d,l),f=s=null,function(h){for(var m=-1,g=l.length,x;++m<g;)d[(x=l[m]).i]=x.x(h);return d.join("")}}}var A7=Zd(Tw,"px, ","px)","deg)"),T7=Zd(Cw,", ",")",")"),Ew=1e-12;function Ud(t){return((t=Math.exp(t))+1/t)/2}function Nw(t){return((t=Math.exp(t))-1/t)/2}function Rw(t){return((t=Math.exp(2*t))-1)/(t+1)}var C7=(function t(n,e,r){function i(o,a){var c=o[0],u=o[1],f=o[2],s=a[0],d=a[1],l=a[2],h=s-c,m=d-u,g=h*h+m*m,x,v;if(g<Ew)v=Math.log(l/f)/n,x=function(_){return[c+_*h,u+_*m,f*Math.exp(n*_*v)]};else{var w=Math.sqrt(g),$=(l*l-f*f+r*g)/(2*f*e*w),p=(l*l-f*f-r*g)/(2*l*e*w),b=Math.log(Math.sqrt($*$+1)-$),y=Math.log(Math.sqrt(p*p+1)-p);v=(y-b)/n,x=function(_){var M=_*v,S=Ud(b),C=f/(e*w)*(S*Rw(n*M+b)-Nw(b));return[c+C*h,u+C*m,f*S/Ud(n*M+b)]}}return x.duration=Math.abs(v)*1e3*n/Math.SQRT2,x}return i.rho=function(o){var a=Math.max(.001,+o),c=a*a,u=c*c;return t(a,c,u)},i})(Math.SQRT2,2,4);function Kd(t){return function(n,e){var r=t((n=co(n)).h,(e=co(e)).h),i=xt(n.s,e.s),o=xt(n.l,e.l),a=xt(n.opacity,e.opacity);return function(c){return n.h=r(c),n.s=i(c),n.l=o(c),n.opacity=a(c),n+""}}}var Qd=Kd(xc),E7=Kd(xt);function Jd(t,n){var e=xt((t=uo(t)).l,(n=uo(n)).l),r=xt(t.a,n.a),i=xt(t.b,n.b),o=xt(t.opacity,n.opacity);return function(a){return t.l=e(a),t.a=r(a),t.b=i(a),t.opacity=o(a),t+""}}function th(t){return function(n,e){var r=t((n=fo(n)).h,(e=fo(e)).h),i=xt(n.c,e.c),o=xt(n.l,e.l),a=xt(n.opacity,e.opacity);return function(c){return n.h=r(c),n.c=i(c),n.l=o(c),n.opacity=a(c),n+""}}}var nh=th(xc),N7=th(xt);function eh(t){return(function n(e){e=+e;function r(i,o){var a=t((i=jt(i)).h,(o=jt(o)).h),c=xt(i.s,o.s),u=xt(i.l,o.l),f=xt(i.opacity,o.opacity);return function(s){return i.h=a(s),i.s=c(s),i.l=u(Math.pow(s,e)),i.opacity=f(s),i+""}}return r.gamma=n,r})(1)}var R7=eh(xc),po=eh(xt);function fr(t,n){n===void 0&&(n=t,t=ur);for(var e=0,r=n.length-1,i=n[0],o=new Array(r<0?0:r);e<r;)o[e]=t(i,i=n[++e]);return function(a){var c=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[c](a-c)}}function Gt(t,n){for(var e=new Array(n),r=0;r<n;++r)e[r]=t(r/(n-1));return e}var jr=Math.PI,vc=2*jr,Se=1e-6,Lw=vc-Se;function rh(t){this._+=t[0];for(let n=1,e=t.length;n<e;++n)this._+=arguments[n]+t[n]}function Pw(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return rh;let e=10**n;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*e)/e+r[i]}}function ih(t,n,e,r){return t===e&&n===r}function Dw(t){let n=Math.floor(t);if(!(n<=15))return ih;let e=10**n,r=function(i){return Math.round(i*e)};return function(i,o,a,c){return r(i)===r(a)&&r(o)===r(c)}}var ke=class{constructor(n){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=n==null?rh:Pw(n),this._equal=n==null?ih:Dw(n)}moveTo(n,e){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(n,e){this._append`L${this._x1=+n},${this._y1=+e}`}quadraticCurveTo(n,e,r,i){this._append`Q${+n},${+e},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(n,e,r,i,o,a){this._append`C${+n},${+e},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(n,e,r,i,o){if(n=+n,e=+e,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,c=this._y1,u=r-n,f=i-e,s=a-n,d=c-e,l=s*s+d*d;if(this._x1===null)this._append`M${this._x1=n},${this._y1=e}`;else if(l>Se)if(!(Math.abs(d*u-f*s)>Se)||!o)this._append`L${this._x1=n},${this._y1=e}`;else{let h=r-a,m=i-c,g=u*u+f*f,x=h*h+m*m,v=Math.sqrt(g),w=Math.sqrt(l),$=o*Math.tan((jr-Math.acos((g+l-x)/(2*v*w)))/2),p=$/w,b=$/v;Math.abs(p-1)>Se&&this._append`L${n+p*s},${e+p*d}`,this._append`A${o},${o},0,0,${+(d*h>s*m)},${this._x1=n+b*u},${this._y1=e+b*f}`}}arc(n,e,r,i,o,a){if(n=+n,e=+e,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),u=r*Math.sin(i),f=n+c,s=e+u,d=1^a,l=a?i-o:o-i;if(this._x1===null?this._append`M${f},${s}`:(Math.abs(this._x1-f)>Se||Math.abs(this._y1-s)>Se)&&this._append`L${f},${s}`,!!r){if(l<0&&(l=l%vc+vc),l>Lw)this._append`A${r},${r},0,1,${d},${n-c},${e-u}A${r},${r},0,1,${d},${this._x1=f},${this._y1=s}`;else if(l>Se){let h=n+r*Math.cos(o),m=e+r*Math.sin(o);if(l>=jr&&this._equal(f,s,h,m)){l/=2;let g=i+l;this._append`A${r},${r},0,${+(l>=jr)},${d},${n+r*Math.cos(g)},${e+r*Math.sin(g)}`}this._append`A${r},${r},0,${+(l>=jr)},${d},${this._x1=h},${this._y1=m}`}}}rect(n,e,r,i){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Iw(){return new ke}Iw.prototype=ke.prototype;function Pn(t=3){return new ke(+t)}function Ow(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function go(t,n){if(!isFinite(t)||t===0)return null;var e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"),r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function sr(t){return t=go(Math.abs(t)),t?t[1]:NaN}function zw(t,n){return function(e,r){for(var i=e.length,o=[],a=0,c=t[0],u=0;i>0&&c>0&&(u+c+1>r&&(c=Math.max(1,r-u)),o.push(e.substring(i-=c,i+c)),!((u+=c+1)>r));)c=t[a=(a+1)%t.length];return o.reverse().join(n)}}function Fw(t){return function(n){return n.replace(/[0-9]/g,function(e){return t[+e]})}}var Bw=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function lr(t){if(!(n=Bw.exec(t)))throw new Error("invalid format: "+t);var n;return new _c({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}lr.prototype=_c.prototype;function _c(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+""}_c.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 qw(t){t:for(var n=t.length,e=1,r=-1,i;e<n;++e)switch(t[e]){case".":r=i=e;break;case"0":r===0&&(r=e),i=e;break;default:if(!+t[e])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var yo;function Yw(t,n){var e=go(t,n);if(!e)return yo=void 0,t.toPrecision(n);var r=e[0],i=e[1],o=i-(yo=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")+go(t,Math.max(0,n+o-1))[0]}function oh(t,n){var e=go(t,n);if(!e)return t+"";var r=e[0],i=e[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")}var ah={"%":(t,n)=>(t*100).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Ow,e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>oh(t*100,n),r:oh,s:Yw,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ch(t){return t}var uh=Array.prototype.map,fh=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Ww(t){var n=t.grouping===void 0||t.thousands===void 0?ch:zw(uh.call(t.grouping,Number),t.thousands+""),e=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?ch:Fw(uh.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",c=t.minus===void 0?"\u2212":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function f(d,l){d=lr(d);var h=d.fill,m=d.align,g=d.sign,x=d.symbol,v=d.zero,w=d.width,$=d.comma,p=d.precision,b=d.trim,y=d.type;y==="n"?($=!0,y="g"):ah[y]||(p===void 0&&(p=12),b=!0,y="g"),(v||h==="0"&&m==="=")&&(v=!0,h="0",m="=");var _=(l&&l.prefix!==void 0?l.prefix:"")+(x==="$"?e:x==="#"&&/[boxX]/.test(y)?"0"+y.toLowerCase():""),M=(x==="$"?r:/[%p]/.test(y)?a:"")+(l&&l.suffix!==void 0?l.suffix:""),S=ah[y],C=/[defgprs%]/.test(y);p=p===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p));function k(T){var D=_,P=M,A,O,R;if(y==="c")P=S(T)+P,T="";else{T=+T;var W=T<0||1/T<0;if(T=isNaN(T)?u:S(Math.abs(T),p),b&&(T=qw(T)),W&&+T==0&&g!=="+"&&(W=!1),D=(W?g==="("?g:c:g==="-"||g==="("?"":g)+D,P=(y==="s"&&!isNaN(T)&&yo!==void 0?fh[8+yo/3]:"")+P+(W&&g==="("?")":""),C){for(A=-1,O=T.length;++A<O;)if(R=T.charCodeAt(A),48>R||R>57){P=(R===46?i+T.slice(A+1):T.slice(A))+P,T=T.slice(0,A);break}}}$&&!v&&(T=n(T,1/0));var L=D.length+T.length+P.length,I=L<w?new Array(w-L+1).join(h):"";switch($&&v&&(T=n(I+T,I.length?w-P.length:1/0),I=""),m){case"<":T=D+T+P+I;break;case"=":T=D+I+T+P;break;case"^":T=I.slice(0,L=I.length>>1)+D+T+P+I.slice(L);break;default:T=I+D+T+P;break}return o(T)}return k.toString=function(){return d+""},k}function s(d,l){var h=Math.max(-8,Math.min(8,Math.floor(sr(l)/3)))*3,m=Math.pow(10,-h),g=f((d=lr(d),d.type="f",d),{suffix:fh[8+h/3]});return function(x){return g(m*x)}}return{format:f,formatPrefix:s}}var mo,ne,Mc;Uw({thousands:",",grouping:[3],currency:["$",""]});function Uw(t){return mo=Ww(t),ne=mo.format,Mc=mo.formatPrefix,mo}function sh(t){return Math.max(0,-sr(Math.abs(t)))}function lh(t,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(sr(n)/3)))*3-sr(Math.abs(t)))}function dh(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,sr(n)-sr(t))+1}var V=1e-6,Nh=1e-12,tt=Math.PI,dt=tt/2,hh=tt/4,Ht=tt*2,Nt=180/tt,lt=tt/180,ot=Math.abs,mr=Math.atan,In=Math.atan2,Q=Math.cos;var Rh=Math.exp;var $o=Math.log,$c=Math.pow,j=Math.sin,Kt=Math.sign||function(t){return t>0?1:t<0?-1:0},It=Math.sqrt,Uc=Math.tan;function Lh(t){return t>1?0:t<-1?tt:Math.acos(t)}function Jt(t){return t>1?dt:t<-1?-dt:Math.asin(t)}function Qt(){}function So(t,n){t&&mh.hasOwnProperty(t.type)&&mh[t.type](t,n)}var ph={Feature:function(t,n){So(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)So(e[r].geometry,n)}},mh={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){Cc(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)Cc(e[r],n,0)},Polygon:function(t,n){gh(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)gh(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)So(e[r],n)}};function Cc(t,n,e){var r=-1,i=t.length-e,o;for(n.lineStart();++r<i;)o=t[r],n.point(o[0],o[1],o[2]);n.lineEnd()}function gh(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)Cc(t[e],n,1);n.polygonEnd()}function ee(t,n){t&&ph.hasOwnProperty(t.type)?ph[t.type](t,n):So(t,n)}var O7=new Vt,z7=new Vt;function Ec(t){return[In(t[1],t[0]),Jt(t[2])]}function hr(t){var n=t[0],e=t[1],r=Q(e);return[r*Q(n),r*j(n),j(e)]}function bo(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function ko(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Sc(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function wo(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function Nc(t){var n=It(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function Rc(t,n){function e(r,i){return r=t(r,i),n(r[0],r[1])}return t.invert&&n.invert&&(e.invert=function(r,i){return r=n.invert(r,i),r&&t.invert(r[0],r[1])}),e}function Lc(t,n){return ot(t)>tt&&(t-=Math.round(t/Ht)*Ht),[t,n]}Lc.invert=Lc;function Ph(t,n,e){return(t%=Ht)?n||e?Rc(bh(t),wh(n,e)):bh(t):n||e?wh(n,e):Lc}function yh(t){return function(n,e){return n+=t,ot(n)>tt&&(n-=Math.round(n/Ht)*Ht),[n,e]}}function bh(t){var n=yh(t);return n.invert=yh(-t),n}function wh(t,n){var e=Q(t),r=j(t),i=Q(n),o=j(n);function a(c,u){var f=Q(u),s=Q(c)*f,d=j(c)*f,l=j(u),h=l*e+s*r;return[In(d*i-h*o,s*e-l*r),Jt(h*i+d*o)]}return a.invert=function(c,u){var f=Q(u),s=Q(c)*f,d=j(c)*f,l=j(u),h=l*i-d*o;return[In(d*i+l*o,s*e+h*r),Jt(h*e-s*r)]},a}function Gw(t){t=Ph(t[0]*lt,t[1]*lt,t.length>2?t[2]*lt:0);function n(e){return e=t(e[0]*lt,e[1]*lt),e[0]*=Nt,e[1]*=Nt,e}return n.invert=function(e){return e=t.invert(e[0]*lt,e[1]*lt),e[0]*=Nt,e[1]*=Nt,e},n}function Hw(t,n,e,r,i,o){if(e){var a=Q(n),c=j(n),u=r*e;i==null?(i=n+r*Ht,o=n-u/2):(i=xh(a,i),o=xh(a,o),(r>0?i<o:i>o)&&(i+=r*Ht));for(var f,s=i;r>0?s>o:s<o;s-=u)f=Ec([a,-c*Q(s),-c*j(s)]),t.point(f[0],f[1])}}function xh(t,n){n=hr(n),n[0]-=t,Nc(n);var e=Lh(-n[1]);return((-n[2]<0?-e:e)+Ht-V)%Ht}function Dh(){var t=[],n;return{point:function(e,r,i){n.push([e,r,i])},lineStart:function(){t.push(n=[])},lineEnd:Qt,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var e=t;return t=[],n=null,e}}}function Mo(t,n){return ot(t[0]-n[0])<V&&ot(t[1]-n[1])<V}function xo(t,n,e,r){this.x=t,this.z=n,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Ih(t,n,e,r,i){var o=[],a=[],c,u;if(t.forEach(function(m){if(!((g=m.length-1)<=0)){var g,x=m[0],v=m[g],w;if(Mo(x,v)){if(!x[2]&&!v[2]){for(i.lineStart(),c=0;c<g;++c)i.point((x=m[c])[0],x[1]);i.lineEnd();return}v[0]+=2*V}o.push(w=new xo(x,m,null,!0)),a.push(w.o=new xo(x,null,w,!1)),o.push(w=new xo(v,m,null,!1)),a.push(w.o=new xo(v,null,w,!0))}}),!!o.length){for(a.sort(n),vh(o),vh(a),c=0,u=a.length;c<u;++c)a[c].e=e=!e;for(var f=o[0],s,d;;){for(var l=f,h=!0;l.v;)if((l=l.n)===f)return;s=l.z,i.lineStart();do{if(l.v=l.o.v=!0,l.e){if(h)for(c=0,u=s.length;c<u;++c)i.point((d=s[c])[0],d[1]);else r(l.x,l.n.x,1,i);l=l.n}else{if(h)for(s=l.p.z,c=s.length-1;c>=0;--c)i.point((d=s[c])[0],d[1]);else r(l.x,l.p.x,-1,i);l=l.p}l=l.o,s=l.z,h=!h}while(!l.v);i.lineEnd()}}}function vh(t){if(n=t.length){for(var n,e=0,r=t[0],i;++e<n;)r.n=i=t[e],i.p=r,r=i;r.n=i=t[0],i.p=r}}function kc(t){return ot(t[0])<=tt?t[0]:Kt(t[0])*((ot(t[0])+tt)%Ht-tt)}function Xw(t,n){var e=kc(n),r=n[1],i=j(r),o=[j(e),-Q(e),0],a=0,c=0,u=new Vt;i===1?r=dt+V:i===-1&&(r=-dt-V);for(var f=0,s=t.length;f<s;++f)if(l=(d=t[f]).length)for(var d,l,h=d[l-1],m=kc(h),g=h[1]/2+hh,x=j(g),v=Q(g),w=0;w<l;++w,m=p,x=y,v=_,h=$){var $=d[w],p=kc($),b=$[1]/2+hh,y=j(b),_=Q(b),M=p-m,S=M>=0?1:-1,C=S*M,k=C>tt,T=x*y;if(u.add(In(T*S*j(C),v*_+T*Q(C))),a+=k?M+S*Ht:M,k^m>=e^p>=e){var D=ko(hr(h),hr($));Nc(D);var P=ko(o,D);Nc(P);var A=(k^M>=0?-1:1)*Jt(P[2]);(r>A||r===A&&(D[0]||D[1]))&&(c+=k^M>=0?1:-1)}}return(a<-V||a<V&&u<-Nh)^c&1}function Oh(t,n,e,r){return function(i){var o=n(i),a=Dh(),c=n(a),u=!1,f,s,d,l={point:h,lineStart:g,lineEnd:x,polygonStart:function(){l.point=v,l.lineStart=w,l.lineEnd=$,s=[],f=[]},polygonEnd:function(){l.point=h,l.lineStart=g,l.lineEnd=x,s=ec(s);var p=Xw(f,r);s.length?(u||(i.polygonStart(),u=!0),Ih(s,jw,p,e,i)):p&&(u||(i.polygonStart(),u=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),u&&(i.polygonEnd(),u=!1),s=f=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(p,b){t(p,b)&&i.point(p,b)}function m(p,b){o.point(p,b)}function g(){l.point=m,o.lineStart()}function x(){l.point=h,o.lineEnd()}function v(p,b){d.push([p,b]),c.point(p,b)}function w(){c.lineStart(),d=[]}function $(){v(d[0][0],d[0][1]),c.lineEnd();var p=c.clean(),b=a.result(),y,_=b.length,M,S,C;if(d.pop(),f.push(d),d=null,!!_){if(p&1){if(S=b[0],(M=S.length-1)>0){for(u||(i.polygonStart(),u=!0),i.lineStart(),y=0;y<M;++y)i.point((C=S[y])[0],C[1]);i.lineEnd()}return}_>1&&p&2&&b.push(b.pop().concat(b.shift())),s.push(b.filter(Vw))}}return l}}function Vw(t){return t.length>1}function jw(t,n){return((t=t.x)[0]<0?t[1]-dt-V:dt-t[1])-((n=n.x)[0]<0?n[1]-dt-V:dt-n[1])}var _h=Oh(function(){return!0},Zw,Qw,[-tt,-dt]);function Zw(t){var n=NaN,e=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,a){var c=o>0?tt:-tt,u=ot(o-n);ot(u-tt)<V?(t.point(n,e=(e+a)/2>0?dt:-dt),t.point(r,e),t.lineEnd(),t.lineStart(),t.point(c,e),t.point(o,e),i=0):r!==c&&u>=tt&&(ot(n-r)<V&&(n-=r*V),ot(o-c)<V&&(o-=c*V),e=Kw(n,e,o,a),t.point(r,e),t.lineEnd(),t.lineStart(),t.point(c,e),i=0),t.point(n=o,e=a),r=c},lineEnd:function(){t.lineEnd(),n=e=NaN},clean:function(){return 2-i}}}function Kw(t,n,e,r){var i,o,a=j(t-e);return ot(a)>V?mr((j(n)*(o=Q(r))*j(e)-j(r)*(i=Q(n))*j(t))/(i*o*a)):(n+r)/2}function Qw(t,n,e,r){var i;if(t==null)i=e*dt,r.point(-tt,i),r.point(0,i),r.point(tt,i),r.point(tt,0),r.point(tt,-i),r.point(0,-i),r.point(-tt,-i),r.point(-tt,0),r.point(-tt,i);else if(ot(t[0]-n[0])>V){var o=t[0]<n[0]?tt:-tt;i=e*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(n[0],n[1])}function Jw(t){var n=Q(t),e=2*lt,r=n>0,i=ot(n)>V;function o(s,d,l,h){Hw(h,t,e,l,s,d)}function a(s,d){return Q(s)*Q(d)>n}function c(s){var d,l,h,m,g;return{lineStart:function(){m=h=!1,g=1},point:function(x,v){var w=[x,v],$,p=a(x,v),b=r?p?0:f(x,v):p?f(x+(x<0?tt:-tt),v):0;if(!d&&(m=h=p)&&s.lineStart(),p!==h&&($=u(d,w),(!$||Mo(d,$)||Mo(w,$))&&(w[2]=1)),p!==h)g=0,p?(s.lineStart(),$=u(w,d),s.point($[0],$[1])):($=u(d,w),s.point($[0],$[1],2),s.lineEnd()),d=$;else if(i&&d&&r^p){var y;!(b&l)&&(y=u(w,d,!0))&&(g=0,r?(s.lineStart(),s.point(y[0][0],y[0][1]),s.point(y[1][0],y[1][1]),s.lineEnd()):(s.point(y[1][0],y[1][1]),s.lineEnd(),s.lineStart(),s.point(y[0][0],y[0][1],3)))}p&&(!d||!Mo(d,w))&&s.point(w[0],w[1]),d=w,h=p,l=b},lineEnd:function(){h&&s.lineEnd(),d=null},clean:function(){return g|(m&&h)<<1}}}function u(s,d,l){var h=hr(s),m=hr(d),g=[1,0,0],x=ko(h,m),v=bo(x,x),w=x[0],$=v-w*w;if(!$)return!l&&s;var p=n*v/$,b=-n*w/$,y=ko(g,x),_=wo(g,p),M=wo(x,b);Sc(_,M);var S=y,C=bo(_,S),k=bo(S,S),T=C*C-k*(bo(_,_)-1);if(!(T<0)){var D=It(T),P=wo(S,(-C-D)/k);if(Sc(P,_),P=Ec(P),!l)return P;var A=s[0],O=d[0],R=s[1],W=d[1],L;O<A&&(L=A,A=O,O=L);var I=O-A,q=ot(I-tt)<V,U=q||I<V;if(!q&&W<R&&(L=R,R=W,W=L),U?q?R+W>0^P[1]<(ot(P[0]-A)<V?R:W):R<=P[1]&&P[1]<=W:I>tt^(A<=P[0]&&P[0]<=O)){var F=wo(S,(-C+D)/k);return Sc(F,_),[P,Ec(F)]}}}function f(s,d){var l=r?t:tt-t,h=0;return s<-l?h|=1:s>l&&(h|=2),d<-l?h|=4:d>l&&(h|=8),h}return Oh(a,c,o,r?[0,-t]:[-tt,t-tt])}function tx(t,n,e,r,i,o){var a=t[0],c=t[1],u=n[0],f=n[1],s=0,d=1,l=u-a,h=f-c,m;if(m=e-a,!(!l&&m>0)){if(m/=l,l<0){if(m<s)return;m<d&&(d=m)}else if(l>0){if(m>d)return;m>s&&(s=m)}if(m=i-a,!(!l&&m<0)){if(m/=l,l<0){if(m>d)return;m>s&&(s=m)}else if(l>0){if(m<s)return;m<d&&(d=m)}if(m=r-c,!(!h&&m>0)){if(m/=h,h<0){if(m<s)return;m<d&&(d=m)}else if(h>0){if(m>d)return;m>s&&(s=m)}if(m=o-c,!(!h&&m<0)){if(m/=h,h<0){if(m>d)return;m>s&&(s=m)}else if(h>0){if(m<s)return;m<d&&(d=m)}return s>0&&(t[0]=a+s*l,t[1]=c+s*h),d<1&&(n[0]=a+d*l,n[1]=c+d*h),!0}}}}}var Zr=1e9,vo=-Zr;function Gc(t,n,e,r){function i(f,s){return t<=f&&f<=e&&n<=s&&s<=r}function o(f,s,d,l){var h=0,m=0;if(f==null||(h=a(f,d))!==(m=a(s,d))||u(f,s)<0^d>0)do l.point(h===0||h===3?t:e,h>1?r:n);while((h=(h+d+4)%4)!==m);else l.point(s[0],s[1])}function a(f,s){return ot(f[0]-t)<V?s>0?0:3:ot(f[0]-e)<V?s>0?2:1:ot(f[1]-n)<V?s>0?1:0:s>0?3:2}function c(f,s){return u(f.x,s.x)}function u(f,s){var d=a(f,1),l=a(s,1);return d!==l?d-l:d===0?s[1]-f[1]:d===1?f[0]-s[0]:d===2?f[1]-s[1]:s[0]-f[0]}return function(f){var s=f,d=Dh(),l,h,m,g,x,v,w,$,p,b,y,_={point:M,lineStart:T,lineEnd:D,polygonStart:C,polygonEnd:k};function M(A,O){i(A,O)&&s.point(A,O)}function S(){for(var A=0,O=0,R=h.length;O<R;++O)for(var W=h[O],L=1,I=W.length,q=W[0],U,F,K=q[0],et=q[1];L<I;++L)U=K,F=et,q=W[L],K=q[0],et=q[1],F<=r?et>r&&(K-U)*(r-F)>(et-F)*(t-U)&&++A:et<=r&&(K-U)*(r-F)<(et-F)*(t-U)&&--A;return A}function C(){s=d,l=[],h=[],y=!0}function k(){var A=S(),O=y&&A,R=(l=ec(l)).length;(O||R)&&(f.polygonStart(),O&&(f.lineStart(),o(null,null,1,f),f.lineEnd()),R&&Ih(l,c,A,o,f),f.polygonEnd()),s=f,l=h=m=null}function T(){_.point=P,h&&h.push(m=[]),b=!0,p=!1,w=$=NaN}function D(){l&&(P(g,x),v&&p&&d.rejoin(),l.push(d.result())),_.point=M,p&&s.lineEnd()}function P(A,O){var R=i(A,O);if(h&&m.push([A,O]),b)g=A,x=O,v=R,b=!1,R&&(s.lineStart(),s.point(A,O));else if(R&&p)s.point(A,O);else{var W=[w=Math.max(vo,Math.min(Zr,w)),$=Math.max(vo,Math.min(Zr,$))],L=[A=Math.max(vo,Math.min(Zr,A)),O=Math.max(vo,Math.min(Zr,O))];tx(W,L,t,n,e,r)?(p||(s.lineStart(),s.point(W[0],W[1])),s.point(L[0],L[1]),R||s.lineEnd(),y=!1):R&&(s.lineStart(),s.point(A,O),y=!1)}w=A,$=O,p=R}return _}}var Pc=t=>t,Ac=new Vt,Dc=new Vt,zh,Fh,Ic,Oc,Dn={point:Qt,lineStart:Qt,lineEnd:Qt,polygonStart:function(){Dn.lineStart=nx,Dn.lineEnd=rx},polygonEnd:function(){Dn.lineStart=Dn.lineEnd=Dn.point=Qt,Ac.add(ot(Dc)),Dc=new Vt},result:function(){var t=Ac/2;return Ac=new Vt,t}};function nx(){Dn.point=ex}function ex(t,n){Dn.point=Bh,zh=Ic=t,Fh=Oc=n}function Bh(t,n){Dc.add(Oc*t-Ic*n),Ic=t,Oc=n}function rx(){Bh(zh,Fh)}var pr=1/0,Ao=pr,oi=-pr,To=oi,Co={point:ix,lineStart:Qt,lineEnd:Qt,polygonStart:Qt,polygonEnd:Qt,result:function(){var t=[[pr,Ao],[oi,To]];return oi=To=-(Ao=pr=1/0),t}};function ix(t,n){t<pr&&(pr=t),t>oi&&(oi=t),n<Ao&&(Ao=n),n>To&&(To=n)}var zc=0,Fc=0,Kr=0,Eo=0,No=0,dr=0,Bc=0,qc=0,Qr=0,qh,Yh,bn,wn,Zt={point:Ae,lineStart:Mh,lineEnd:$h,polygonStart:function(){Zt.lineStart=cx,Zt.lineEnd=ux},polygonEnd:function(){Zt.point=Ae,Zt.lineStart=Mh,Zt.lineEnd=$h},result:function(){var t=Qr?[Bc/Qr,qc/Qr]:dr?[Eo/dr,No/dr]:Kr?[zc/Kr,Fc/Kr]:[NaN,NaN];return zc=Fc=Kr=Eo=No=dr=Bc=qc=Qr=0,t}};function Ae(t,n){zc+=t,Fc+=n,++Kr}function Mh(){Zt.point=ox}function ox(t,n){Zt.point=ax,Ae(bn=t,wn=n)}function ax(t,n){var e=t-bn,r=n-wn,i=It(e*e+r*r);Eo+=i*(bn+t)/2,No+=i*(wn+n)/2,dr+=i,Ae(bn=t,wn=n)}function $h(){Zt.point=Ae}function cx(){Zt.point=fx}function ux(){Wh(qh,Yh)}function fx(t,n){Zt.point=Wh,Ae(qh=bn=t,Yh=wn=n)}function Wh(t,n){var e=t-bn,r=n-wn,i=It(e*e+r*r);Eo+=i*(bn+t)/2,No+=i*(wn+n)/2,dr+=i,i=wn*t-bn*n,Bc+=i*(bn+t),qc+=i*(wn+n),Qr+=i*3,Ae(bn=t,wn=n)}function Uh(t){this._context=t}Uh.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:{this._context.moveTo(t,n),this._point=1;break}case 1:{this._context.lineTo(t,n);break}default:{this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,Ht);break}}},result:Qt};var Yc=new Vt,Tc,Gh,Hh,Jr,ti,ai={point:Qt,lineStart:function(){ai.point=sx},lineEnd:function(){Tc&&Xh(Gh,Hh),ai.point=Qt},polygonStart:function(){Tc=!0},polygonEnd:function(){Tc=null},result:function(){var t=+Yc;return Yc=new Vt,t}};function sx(t,n){ai.point=Xh,Gh=Jr=t,Hh=ti=n}function Xh(t,n){Jr-=t,ti-=n,Yc.add(It(Jr*Jr+ti*ti)),Jr=t,ti=n}var Sh,Ro,kh,Ah,Lo=class{constructor(n){this._append=n==null?Vh:lx(n),this._radius=4.5,this._=""}pointRadius(n){return this._radius=+n,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(n,e){switch(this._point){case 0:{this._append`M${n},${e}`,this._point=1;break}case 1:{this._append`L${n},${e}`;break}default:{if(this._append`M${n},${e}`,this._radius!==kh||this._append!==Ro){let r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,kh=r,Ro=this._append,Ah=this._,this._=i}this._+=Ah;break}}}result(){let n=this._;return this._="",n.length?n:null}};function Vh(t){let n=1;this._+=t[0];for(let e=t.length;n<e;++n)this._+=arguments[n]+t[n]}function lx(t){let n=Math.floor(t);if(!(n>=0))throw new RangeError(`invalid digits: ${t}`);if(n>15)return Vh;if(n!==Sh){let e=10**n;Sh=n,Ro=function(i){let o=1;this._+=i[0];for(let a=i.length;o<a;++o)this._+=Math.round(arguments[o]*e)/e+i[o]}}return Ro}function Io(t,n){let e=3,r=4.5,i,o;function a(c){return c&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),ee(c,i(o))),o.result()}return a.area=function(c){return ee(c,i(Dn)),Dn.result()},a.measure=function(c){return ee(c,i(ai)),ai.result()},a.bounds=function(c){return ee(c,i(Co)),Co.result()},a.centroid=function(c){return ee(c,i(Zt)),Zt.result()},a.projection=function(c){return arguments.length?(i=c==null?(t=null,Pc):(t=c).stream,a):t},a.context=function(c){return arguments.length?(o=c==null?(n=null,new Lo(e)):new Uh(n=c),typeof r!="function"&&o.pointRadius(r),a):n},a.pointRadius=function(c){return arguments.length?(r=typeof c=="function"?c:(o.pointRadius(+c),+c),a):r},a.digits=function(c){if(!arguments.length)return e;if(c==null)e=null;else{let u=Math.floor(c);if(!(u>=0))throw new RangeError(`invalid digits: ${c}`);e=u}return n===null&&(o=new Lo(e)),a},a.projection(t).digits(e).context(n)}function ui(t){return{stream:Oo(t)}}function Oo(t){return function(n){var e=new Wc;for(var r in t)e[r]=t[r];return e.stream=n,e}}function Wc(){}Wc.prototype={constructor:Wc,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Hc(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),ee(e,t.stream(Co)),n(Co.result()),r!=null&&t.clipExtent(r),t}function Xc(t,n,e){return Hc(t,function(r){var i=n[1][0]-n[0][0],o=n[1][1]-n[0][1],a=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),c=+n[0][0]+(i-a*(r[1][0]+r[0][0]))/2,u=+n[0][1]+(o-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([c,u])},e)}function jh(t,n,e){return Xc(t,[[0,0],n],e)}function Zh(t,n,e){return Hc(t,function(r){var i=+n,o=i/(r[1][0]-r[0][0]),a=(i-o*(r[1][0]+r[0][0]))/2,c=-o*r[0][1];t.scale(150*o).translate([a,c])},e)}function Kh(t,n,e){return Hc(t,function(r){var i=+n,o=i/(r[1][1]-r[0][1]),a=-o*r[0][0],c=(i-o*(r[1][1]+r[0][1]))/2;t.scale(150*o).translate([a,c])},e)}var Th=16,dx=Q(30*lt);function Ch(t,n){return+n?px(t,n):hx(t)}function hx(t){return Oo({point:function(n,e){n=t(n,e),this.stream.point(n[0],n[1])}})}function px(t,n){function e(r,i,o,a,c,u,f,s,d,l,h,m,g,x){var v=f-r,w=s-i,$=v*v+w*w;if($>4*n&&g--){var p=a+l,b=c+h,y=u+m,_=It(p*p+b*b+y*y),M=Jt(y/=_),S=ot(ot(y)-1)<V||ot(o-d)<V?(o+d)/2:In(b,p),C=t(S,M),k=C[0],T=C[1],D=k-r,P=T-i,A=w*D-v*P;(A*A/$>n||ot((v*D+w*P)/$-.5)>.3||a*l+c*h+u*m<dx)&&(e(r,i,o,a,c,u,k,T,S,p/=_,b/=_,y,g,x),x.point(k,T),e(k,T,S,p,b,y,f,s,d,l,h,m,g,x))}}return function(r){var i,o,a,c,u,f,s,d,l,h,m,g,x={point:v,lineStart:w,lineEnd:p,polygonStart:function(){r.polygonStart(),x.lineStart=b},polygonEnd:function(){r.polygonEnd(),x.lineStart=w}};function v(M,S){M=t(M,S),r.point(M[0],M[1])}function w(){d=NaN,x.point=$,r.lineStart()}function $(M,S){var C=hr([M,S]),k=t(M,S);e(d,l,s,h,m,g,d=k[0],l=k[1],s=M,h=C[0],m=C[1],g=C[2],Th,r),r.point(d,l)}function p(){x.point=v,r.lineEnd()}function b(){w(),x.point=y,x.lineEnd=_}function y(M,S){$(i=M,S),o=d,a=l,c=h,u=m,f=g,x.point=$}function _(){e(d,l,s,h,m,g,o,a,i,c,u,f,Th,r),x.lineEnd=p,p()}return x}}var mx=Oo({point:function(t,n){this.stream.point(t*lt,n*lt)}});function gx(t){return Oo({point:function(n,e){var r=t(n,e);return this.stream.point(r[0],r[1])}})}function yx(t,n,e,r,i){function o(a,c){return a*=r,c*=i,[n+t*a,e-t*c]}return o.invert=function(a,c){return[(a-n)/t*r,(e-c)/t*i]},o}function Eh(t,n,e,r,i,o){if(!o)return yx(t,n,e,r,i);var a=Q(o),c=j(o),u=a*t,f=c*t,s=a/t,d=c/t,l=(c*e-a*n)/t,h=(c*n+a*e)/t;function m(g,x){return g*=r,x*=i,[u*g-f*x+n,e-f*g-u*x]}return m.invert=function(g,x){return[r*(s*g-d*x+l),i*(h-d*g-s*x)]},m}function re(t){return Qh(function(){return t})()}function Qh(t){var n,e=150,r=480,i=250,o=0,a=0,c=0,u=0,f=0,s,d=0,l=1,h=1,m=null,g=_h,x=null,v,w,$,p=Pc,b=.5,y,_,M,S,C;function k(A){return M(A[0]*lt,A[1]*lt)}function T(A){return A=M.invert(A[0],A[1]),A&&[A[0]*Nt,A[1]*Nt]}k.stream=function(A){return S&&C===A?S:S=mx(gx(s)(g(y(p(C=A)))))},k.preclip=function(A){return arguments.length?(g=A,m=void 0,P()):g},k.postclip=function(A){return arguments.length?(p=A,x=v=w=$=null,P()):p},k.clipAngle=function(A){return arguments.length?(g=+A?Jw(m=A*lt):(m=null,_h),P()):m*Nt},k.clipExtent=function(A){return arguments.length?(p=A==null?(x=v=w=$=null,Pc):Gc(x=+A[0][0],v=+A[0][1],w=+A[1][0],$=+A[1][1]),P()):x==null?null:[[x,v],[w,$]]},k.scale=function(A){return arguments.length?(e=+A,D()):e},k.translate=function(A){return arguments.length?(r=+A[0],i=+A[1],D()):[r,i]},k.center=function(A){return arguments.length?(o=A[0]%360*lt,a=A[1]%360*lt,D()):[o*Nt,a*Nt]},k.rotate=function(A){return arguments.length?(c=A[0]%360*lt,u=A[1]%360*lt,f=A.length>2?A[2]%360*lt:0,D()):[c*Nt,u*Nt,f*Nt]},k.angle=function(A){return arguments.length?(d=A%360*lt,D()):d*Nt},k.reflectX=function(A){return arguments.length?(l=A?-1:1,D()):l<0},k.reflectY=function(A){return arguments.length?(h=A?-1:1,D()):h<0},k.precision=function(A){return arguments.length?(y=Ch(_,b=A*A),P()):It(b)},k.fitExtent=function(A,O){return Xc(k,A,O)},k.fitSize=function(A,O){return jh(k,A,O)},k.fitWidth=function(A,O){return Zh(k,A,O)},k.fitHeight=function(A,O){return Kh(k,A,O)};function D(){var A=Eh(e,0,0,l,h,d).apply(null,n(o,a)),O=Eh(e,r-A[0],i-A[1],l,h,d);return s=Ph(c,u,f),_=Rc(n,O),M=Rc(s,_),y=Ch(_,b),P()}function P(){return S=C=null,k}return function(){return n=t.apply(this,arguments),k.invert=n.invert&&T,D()}}function Vc(t){var n=0,e=tt/3,r=Qh(t),i=r(n,e);return i.parallels=function(o){return arguments.length?r(n=o[0]*lt,e=o[1]*lt):[n*Nt,e*Nt]},i}function bx(t){var n=Q(t);function e(r,i){return[r*n,j(i)/n]}return e.invert=function(r,i){return[r/n,Jt(i*n)]},e}function wx(t,n){var e=j(t),r=(e+j(n))/2;if(ot(r)<V)return bx(t);var i=1+e*(2*r-e),o=It(i)/r;function a(c,u){var f=It(i-2*r*j(u))/r;return[f*j(c*=r),o-f*Q(c)]}return a.invert=function(c,u){var f=o-u,s=In(c,ot(f))*Kt(f);return f*r<0&&(s-=tt*Kt(c)*Kt(f)),[s/r,Jt((i-(c*c+f*f)*r*r)/(2*r))]},a}function ci(){return Vc(wx).scale(155.424).center([0,33.6442])}function jc(){return ci().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function xx(t){var n=t.length;return{point:function(e,r){for(var i=-1;++i<n;)t[i].point(e,r)},sphere:function(){for(var e=-1;++e<n;)t[e].sphere()},lineStart:function(){for(var e=-1;++e<n;)t[e].lineStart()},lineEnd:function(){for(var e=-1;++e<n;)t[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<n;)t[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<n;)t[e].polygonEnd()}}}function Jh(){var t,n,e=jc(),r,i=ci().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=ci().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c,u,f={point:function(l,h){u=[l,h]}};function s(l){var h=l[0],m=l[1];return u=null,r.point(h,m),u||(o.point(h,m),u)||(c.point(h,m),u)}s.invert=function(l){var h=e.scale(),m=e.translate(),g=(l[0]-m[0])/h,x=(l[1]-m[1])/h;return(x>=.12&&x<.234&&g>=-.425&&g<-.214?i:x>=.166&&x<.234&&g>=-.214&&g<-.115?a:e).invert(l)},s.stream=function(l){return t&&n===l?t:t=xx([e.stream(n=l),i.stream(l),a.stream(l)])},s.precision=function(l){return arguments.length?(e.precision(l),i.precision(l),a.precision(l),d()):e.precision()},s.scale=function(l){return arguments.length?(e.scale(l),i.scale(l*.35),a.scale(l),s.translate(e.translate())):e.scale()},s.translate=function(l){if(!arguments.length)return e.translate();var h=e.scale(),m=+l[0],g=+l[1];return r=e.translate(l).clipExtent([[m-.455*h,g-.238*h],[m+.455*h,g+.238*h]]).stream(f),o=i.translate([m-.307*h,g+.201*h]).clipExtent([[m-.425*h+V,g+.12*h+V],[m-.214*h-V,g+.234*h-V]]).stream(f),c=a.translate([m-.205*h,g+.212*h]).clipExtent([[m-.214*h+V,g+.166*h+V],[m-.115*h-V,g+.234*h-V]]).stream(f),d()},s.fitExtent=function(l,h){return Xc(s,l,h)},s.fitSize=function(l,h){return jh(s,l,h)},s.fitWidth=function(l,h){return Zh(s,l,h)},s.fitHeight=function(l,h){return Kh(s,l,h)};function d(){return t=n=null,s}return s.scale(1070)}function t0(t){return function(n,e){var r=Q(n),i=Q(e),o=t(r*i);return o===1/0?[2,0]:[o*i*j(n),o*j(e)]}}function fi(t){return function(n,e){var r=It(n*n+e*e),i=t(r),o=j(i),a=Q(i);return[In(n*o,r*a),Jt(r&&e*o/r)]}}var n0=t0(function(t){return It(2/(1+t))});n0.invert=fi(function(t){return 2*Jt(t/2)});function e0(){return re(n0).scale(124.75).clipAngle(180-.001)}var r0=t0(function(t){return(t=Lh(t))&&t/j(t)});r0.invert=fi(function(t){return t});function i0(){return re(r0).scale(79.4188).clipAngle(180-.001)}function zo(t,n){return[t,$o(Uc((dt+n)/2))]}zo.invert=function(t,n){return[t,2*mr(Rh(n))-dt]};function o0(){return a0(zo).scale(961/Ht)}function a0(t){var n=re(t),e=n.center,r=n.scale,i=n.translate,o=n.clipExtent,a=null,c,u,f;n.scale=function(d){return arguments.length?(r(d),s()):r()},n.translate=function(d){return arguments.length?(i(d),s()):i()},n.center=function(d){return arguments.length?(e(d),s()):e()},n.clipExtent=function(d){return arguments.length?(d==null?a=c=u=f=null:(a=+d[0][0],c=+d[0][1],u=+d[1][0],f=+d[1][1]),s()):a==null?null:[[a,c],[u,f]]};function s(){var d=tt*r(),l=n(Gw(n.rotate()).invert([0,0]));return o(a==null?[[l[0]-d,l[1]-d],[l[0]+d,l[1]+d]]:t===zo?[[Math.max(l[0]-d,a),c],[Math.min(l[0]+d,u),f]]:[[a,Math.max(l[1]-d,c)],[u,Math.min(l[1]+d,f)]])}return s()}function _o(t){return Uc((dt+t)/2)}function vx(t,n){var e=Q(t),r=t===n?j(t):$o(e/Q(n))/$o(_o(n)/_o(t)),i=e*$c(_o(t),r)/r;if(!r)return zo;function o(a,c){i>0?c<-dt+V&&(c=-dt+V):c>dt-V&&(c=dt-V);var u=i/$c(_o(c),r);return[u*j(r*a),i-u*Q(r*a)]}return o.invert=function(a,c){var u=i-c,f=Kt(r)*It(a*a+u*u),s=In(a,ot(u))*Kt(u);return u*r<0&&(s-=tt*Kt(a)*Kt(u)),[s/r,2*mr($c(i/f,1/r))-dt]},o}function c0(){return Vc(vx).scale(109.5).parallels([30,30])}function Po(t,n){return[t,n]}Po.invert=Po;function u0(){return re(Po).scale(152.63)}function _x(t,n){var e=Q(t),r=t===n?j(t):(e-Q(n))/(n-t),i=e/r+t;if(ot(r)<V)return Po;function o(a,c){var u=i-c,f=r*a;return[u*j(f),i-u*Q(f)]}return o.invert=function(a,c){var u=i-c,f=In(a,ot(u))*Kt(u);return u*r<0&&(f-=tt*Kt(a)*Kt(u)),[f/r,i-Kt(r)*It(a*a+u*u)]},o}function f0(){return Vc(_x).scale(131.154).center([0,13.9389])}var ni=1.340264,ei=-.081106,ri=893e-6,ii=.003796,Do=It(3)/2,Mx=12;function s0(t,n){var e=Jt(Do*j(n)),r=e*e,i=r*r*r;return[t*Q(e)/(Do*(ni+3*ei*r+i*(7*ri+9*ii*r))),e*(ni+ei*r+i*(ri+ii*r))]}s0.invert=function(t,n){for(var e=n,r=e*e,i=r*r*r,o=0,a,c,u;o<Mx&&(c=e*(ni+ei*r+i*(ri+ii*r))-n,u=ni+3*ei*r+i*(7*ri+9*ii*r),e-=a=c/u,r=e*e,i=r*r*r,!(ot(a)<Nh));++o);return[Do*t*(ni+3*ei*r+i*(7*ri+9*ii*r))/Q(e),Jt(j(e)/Do)]};function l0(){return re(s0).scale(177.158)}function d0(t,n){var e=Q(n),r=Q(t)*e;return[e*j(t)/r,j(n)/r]}d0.invert=fi(mr);function h0(){return re(d0).scale(144.049).clipAngle(60)}function $x(t,n){var e=n*n,r=e*e;return[t*(.8707-.131979*e+r*(-.013791+r*(.003971*e-.001529*r))),n*(1.007226+e*(.015085+r*(-.044475+.028874*e-.005916*r)))]}$x.invert=function(t,n){var e=n,r=25,i;do{var o=e*e,a=o*o;e-=i=(e*(1.007226+o*(.015085+a*(-.044475+.028874*o-.005916*a)))-n)/(1.007226+o*(.015085*3+a*(-.044475*7+.028874*9*o-.005916*11*a)))}while(ot(i)>V&&--r>0);return[t/(.8707+(o=e*e)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),e]};function p0(t,n){return[Q(n)*j(t),j(n)]}p0.invert=fi(Jt);function m0(){return re(p0).scale(249.5).clipAngle(90+V)}function g0(t,n){var e=Q(n),r=1+Q(t)*e;return[e*j(t)/r,j(n)/r]}g0.invert=fi(function(t){return 2*mr(t)});function y0(){return re(g0).scale(250).clipAngle(142)}function b0(t,n){return[$o(Uc((dt+n)/2)),-t]}b0.invert=function(t,n){return[-n,2*mr(Rh(t))-dt]};function w0(){var t=a0(b0),n=t.center,e=t.rotate;return t.center=function(r){return arguments.length?n([-r[1],r[0]]):(r=n(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?e([r[0],r[1],r.length>2?r[2]+90:90]):(r=e(),[r[0],r[1],r[2]-90])},e([0,0,90]).scale(159.155)}var Zc=new Date,Kc=new Date;function gt(t,n,e,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)),n(o,1),t(o),o),i.round=o=>{let a=i(o),c=i.ceil(o);return o-a<c-o?a:c},i.offset=(o,a)=>(n(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,c)=>{let u=[];if(o=i.ceil(o),c=c==null?1:Math.floor(c),!(o<a)||!(c>0))return u;let f;do u.push(f=new Date(+o)),n(o,c),t(o);while(f<o&&o<a);return u},i.filter=o=>gt(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,c)=>{if(a>=a)if(c<0)for(;++c<=0;)for(;n(a,-1),!o(a););else for(;--c>=0;)for(;n(a,1),!o(a););}),e&&(i.count=(o,a)=>(Zc.setTime(+o),Kc.setTime(+a),t(Zc),t(Kc),Math.floor(e(Zc,Kc))),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}var Fo=gt(()=>{},(t,n)=>{t.setTime(+t+n)},(t,n)=>n-t);Fo.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?gt(n=>{n.setTime(Math.floor(n/t)*t)},(n,e)=>{n.setTime(+n+e*t)},(n,e)=>(e-n)/t):Fo);var q7=Fo.range,On=1e3,tn=On*60,zn=tn*60,Fn=zn*24,Jc=Fn*7,x0=Fn*30,Qc=Fn*365,Rt=gt(t=>{t.setTime(t-t.getMilliseconds())},(t,n)=>{t.setTime(+t+n*On)},(t,n)=>(n-t)/On,t=>t.getUTCSeconds()),Y7=Rt.range,Te=gt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*On)},(t,n)=>{t.setTime(+t+n*tn)},(t,n)=>(n-t)/tn,t=>t.getMinutes()),W7=Te.range,Ce=gt(t=>{t.setUTCSeconds(0,0)},(t,n)=>{t.setTime(+t+n*tn)},(t,n)=>(n-t)/tn,t=>t.getUTCMinutes()),U7=Ce.range,Ee=gt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*On-t.getMinutes()*tn)},(t,n)=>{t.setTime(+t+n*zn)},(t,n)=>(n-t)/zn,t=>t.getHours()),G7=Ee.range,Ne=gt(t=>{t.setUTCMinutes(0,0,0)},(t,n)=>{t.setTime(+t+n*zn)},(t,n)=>(n-t)/zn,t=>t.getUTCHours()),H7=Ne.range,xn=gt(t=>t.setHours(0,0,0,0),(t,n)=>t.setDate(t.getDate()+n),(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*tn)/Fn,t=>t.getDate()-1),X7=xn.range,gr=gt(t=>{t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n)},(t,n)=>(n-t)/Fn,t=>t.getUTCDate()-1),V7=gr.range,si=gt(t=>{t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n)},(t,n)=>(n-t)/Fn,t=>Math.floor(t/Fn)),j7=si.range;function Re(t){return gt(n=>{n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},(n,e)=>{n.setDate(n.getDate()+e*7)},(n,e)=>(e-n-(e.getTimezoneOffset()-n.getTimezoneOffset())*tn)/Jc)}var vn=Re(0),Le=Re(1),tu=Re(2),nu=Re(3),Bn=Re(4),eu=Re(5),ru=Re(6),Z7=vn.range,K7=Le.range,Q7=tu.range,J7=nu.range,t_=Bn.range,n_=eu.range,e_=ru.range;function Pe(t){return gt(n=>{n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCDate(n.getUTCDate()+e*7)},(n,e)=>(e-n)/Jc)}var _n=Pe(0),De=Pe(1),iu=Pe(2),ou=Pe(3),qn=Pe(4),au=Pe(5),cu=Pe(6),r_=_n.range,i_=De.range,o_=iu.range,a_=ou.range,c_=qn.range,u_=au.range,f_=cu.range,Ie=gt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,n)=>{t.setMonth(t.getMonth()+n)},(t,n)=>n.getMonth()-t.getMonth()+(n.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),s_=Ie.range,Oe=gt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCMonth(t.getUTCMonth()+n)},(t,n)=>n.getUTCMonth()-t.getUTCMonth()+(n.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),l_=Oe.range,Ot=gt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n)},(t,n)=>n.getFullYear()-t.getFullYear(),t=>t.getFullYear());Ot.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:gt(n=>{n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},(n,e)=>{n.setFullYear(n.getFullYear()+e*t)});var d_=Ot.range,zt=gt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n)},(t,n)=>n.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());zt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:gt(n=>{n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCFullYear(n.getUTCFullYear()+e*t)});var h_=zt.range;function v0(t,n,e,r,i,o){let a=[[Rt,1,On],[Rt,5,5*On],[Rt,15,15*On],[Rt,30,30*On],[o,1,tn],[o,5,5*tn],[o,15,15*tn],[o,30,30*tn],[i,1,zn],[i,3,3*zn],[i,6,6*zn],[i,12,12*zn],[r,1,Fn],[r,2,2*Fn],[e,1,Jc],[n,1,x0],[n,3,3*x0],[t,1,Qc]];function c(f,s,d){let l=s<f;l&&([f,s]=[s,f]);let h=d&&typeof d.range=="function"?d:u(f,s,d),m=h?h.range(f,+s+1):[];return l?m.reverse():m}function u(f,s,d){let l=Math.abs(s-f)/d,h=Je(([,,x])=>x).right(a,l);if(h===a.length)return t.every(qr(f/Qc,s/Qc,d));if(h===0)return Fo.every(Math.max(qr(f,s,d),1));let[m,g]=a[l/a[h-1][2]<a[h][2]/l?h-1:h];return m.every(g)}return[c,u]}var[_0,Bo]=v0(zt,Oe,_n,si,Ne,Ce),[M0,$0]=v0(Ot,Ie,vn,xn,Ee,Te);function uu(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function fu(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function li(t,n,e){return{y:t,m:n,d:e,H:0,M:0,S:0,L:0}}function Sx(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,c=t.months,u=t.shortMonths,f=di(i),s=hi(i),d=di(o),l=hi(o),h=di(a),m=hi(a),g=di(c),x=hi(c),v=di(u),w=hi(u),$={a:R,A:W,b:L,B:I,c:null,d:E0,e:E0,f:Vx,g:iv,G:av,H:Gx,I:Hx,j:Xx,L:D0,m:jx,M:Zx,p:q,q:U,Q:L0,s:P0,S:Kx,u:Qx,U:Jx,V:tv,w:nv,W:ev,x:null,X:null,y:rv,Y:ov,Z:cv,"%":R0},p={a:F,A:K,b:et,B:at,c:null,d:N0,e:N0,f:lv,g:vv,G:Mv,H:uv,I:fv,j:sv,L:O0,m:dv,M:hv,p:B,q:G,Q:L0,s:P0,S:pv,u:mv,U:gv,V:yv,w:bv,W:wv,x:null,X:null,y:xv,Y:_v,Z:$v,"%":R0},b={a:C,A:k,b:T,B:D,c:P,d:T0,e:T0,f:qx,g:A0,G:k0,H:C0,I:C0,j:Ox,L:Bx,m:Ix,M:zx,p:S,q:Dx,Q:Wx,s:Ux,S:Fx,u:Ex,U:Nx,V:Rx,w:Cx,W:Lx,x:A,X:O,y:A0,Y:k0,Z:Px,"%":Yx};$.x=y(e,$),$.X=y(r,$),$.c=y(n,$),p.x=y(e,p),p.X=y(r,p),p.c=y(n,p);function y(N,z){return function(Y){var E=[],nt=-1,H=0,J=N.length,rt,ut,En;for(Y instanceof Date||(Y=new Date(+Y));++nt<J;)N.charCodeAt(nt)===37&&(E.push(N.slice(H,nt)),(ut=S0[rt=N.charAt(++nt)])!=null?rt=N.charAt(++nt):ut=rt==="e"?" ":"0",(En=z[rt])&&(rt=En(Y,ut)),E.push(rt),H=nt+1);return E.push(N.slice(H,nt)),E.join("")}}function _(N,z){return function(Y){var E=li(1900,void 0,1),nt=M(E,N,Y+="",0),H,J;if(nt!=Y.length)return null;if("Q"in E)return new Date(E.Q);if("s"in E)return new Date(E.s*1e3+("L"in E?E.L:0));if(z&&!("Z"in E)&&(E.Z=0),"p"in E&&(E.H=E.H%12+E.p*12),E.m===void 0&&(E.m="q"in E?E.q:0),"V"in E){if(E.V<1||E.V>53)return null;"w"in E||(E.w=1),"Z"in E?(H=fu(li(E.y,0,1)),J=H.getUTCDay(),H=J>4||J===0?De.ceil(H):De(H),H=gr.offset(H,(E.V-1)*7),E.y=H.getUTCFullYear(),E.m=H.getUTCMonth(),E.d=H.getUTCDate()+(E.w+6)%7):(H=uu(li(E.y,0,1)),J=H.getDay(),H=J>4||J===0?Le.ceil(H):Le(H),H=xn.offset(H,(E.V-1)*7),E.y=H.getFullYear(),E.m=H.getMonth(),E.d=H.getDate()+(E.w+6)%7)}else("W"in E||"U"in E)&&("w"in E||(E.w="u"in E?E.u%7:"W"in E?1:0),J="Z"in E?fu(li(E.y,0,1)).getUTCDay():uu(li(E.y,0,1)).getDay(),E.m=0,E.d="W"in E?(E.w+6)%7+E.W*7-(J+5)%7:E.w+E.U*7-(J+6)%7);return"Z"in E?(E.H+=E.Z/100|0,E.M+=E.Z%100,fu(E)):uu(E)}}function M(N,z,Y,E){for(var nt=0,H=z.length,J=Y.length,rt,ut;nt<H;){if(E>=J)return-1;if(rt=z.charCodeAt(nt++),rt===37){if(rt=z.charAt(nt++),ut=b[rt in S0?z.charAt(nt++):rt],!ut||(E=ut(N,Y,E))<0)return-1}else if(rt!=Y.charCodeAt(E++))return-1}return E}function S(N,z,Y){var E=f.exec(z.slice(Y));return E?(N.p=s.get(E[0].toLowerCase()),Y+E[0].length):-1}function C(N,z,Y){var E=h.exec(z.slice(Y));return E?(N.w=m.get(E[0].toLowerCase()),Y+E[0].length):-1}function k(N,z,Y){var E=d.exec(z.slice(Y));return E?(N.w=l.get(E[0].toLowerCase()),Y+E[0].length):-1}function T(N,z,Y){var E=v.exec(z.slice(Y));return E?(N.m=w.get(E[0].toLowerCase()),Y+E[0].length):-1}function D(N,z,Y){var E=g.exec(z.slice(Y));return E?(N.m=x.get(E[0].toLowerCase()),Y+E[0].length):-1}function P(N,z,Y){return M(N,n,z,Y)}function A(N,z,Y){return M(N,e,z,Y)}function O(N,z,Y){return M(N,r,z,Y)}function R(N){return a[N.getDay()]}function W(N){return o[N.getDay()]}function L(N){return u[N.getMonth()]}function I(N){return c[N.getMonth()]}function q(N){return i[+(N.getHours()>=12)]}function U(N){return 1+~~(N.getMonth()/3)}function F(N){return a[N.getUTCDay()]}function K(N){return o[N.getUTCDay()]}function et(N){return u[N.getUTCMonth()]}function at(N){return c[N.getUTCMonth()]}function B(N){return i[+(N.getUTCHours()>=12)]}function G(N){return 1+~~(N.getUTCMonth()/3)}return{format:function(N){var z=y(N+="",$);return z.toString=function(){return N},z},parse:function(N){var z=_(N+="",!1);return z.toString=function(){return N},z},utcFormat:function(N){var z=y(N+="",p);return z.toString=function(){return N},z},utcParse:function(N){var z=_(N+="",!0);return z.toString=function(){return N},z}}}var S0={"-":"",_:" ",0:"0"},vt=/^\s*\d+/,kx=/^%/,Ax=/[\\^$*+?|[\]().{}]/g;function it(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<e?new Array(e-o+1).join(n)+i:i)}function Tx(t){return t.replace(Ax,"\\$&")}function di(t){return new RegExp("^(?:"+t.map(Tx).join("|")+")","i")}function hi(t){return new Map(t.map((n,e)=>[n.toLowerCase(),e]))}function Cx(t,n,e){var r=vt.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function Ex(t,n,e){var r=vt.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function Nx(t,n,e){var r=vt.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function Rx(t,n,e){var r=vt.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function Lx(t,n,e){var r=vt.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function k0(t,n,e){var r=vt.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function A0(t,n,e){var r=vt.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function Px(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Dx(t,n,e){var r=vt.exec(n.slice(e,e+1));return r?(t.q=r[0]*3-3,e+r[0].length):-1}function Ix(t,n,e){var r=vt.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function T0(t,n,e){var r=vt.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Ox(t,n,e){var r=vt.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function C0(t,n,e){var r=vt.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function zx(t,n,e){var r=vt.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Fx(t,n,e){var r=vt.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function Bx(t,n,e){var r=vt.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function qx(t,n,e){var r=vt.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Yx(t,n,e){var r=kx.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Wx(t,n,e){var r=vt.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function Ux(t,n,e){var r=vt.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function E0(t,n){return it(t.getDate(),n,2)}function Gx(t,n){return it(t.getHours(),n,2)}function Hx(t,n){return it(t.getHours()%12||12,n,2)}function Xx(t,n){return it(1+xn.count(Ot(t),t),n,3)}function D0(t,n){return it(t.getMilliseconds(),n,3)}function Vx(t,n){return D0(t,n)+"000"}function jx(t,n){return it(t.getMonth()+1,n,2)}function Zx(t,n){return it(t.getMinutes(),n,2)}function Kx(t,n){return it(t.getSeconds(),n,2)}function Qx(t){var n=t.getDay();return n===0?7:n}function Jx(t,n){return it(vn.count(Ot(t)-1,t),n,2)}function I0(t){var n=t.getDay();return n>=4||n===0?Bn(t):Bn.ceil(t)}function tv(t,n){return t=I0(t),it(Bn.count(Ot(t),t)+(Ot(t).getDay()===4),n,2)}function nv(t){return t.getDay()}function ev(t,n){return it(Le.count(Ot(t)-1,t),n,2)}function rv(t,n){return it(t.getFullYear()%100,n,2)}function iv(t,n){return t=I0(t),it(t.getFullYear()%100,n,2)}function ov(t,n){return it(t.getFullYear()%1e4,n,4)}function av(t,n){var e=t.getDay();return t=e>=4||e===0?Bn(t):Bn.ceil(t),it(t.getFullYear()%1e4,n,4)}function cv(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+it(n/60|0,"0",2)+it(n%60,"0",2)}function N0(t,n){return it(t.getUTCDate(),n,2)}function uv(t,n){return it(t.getUTCHours(),n,2)}function fv(t,n){return it(t.getUTCHours()%12||12,n,2)}function sv(t,n){return it(1+gr.count(zt(t),t),n,3)}function O0(t,n){return it(t.getUTCMilliseconds(),n,3)}function lv(t,n){return O0(t,n)+"000"}function dv(t,n){return it(t.getUTCMonth()+1,n,2)}function hv(t,n){return it(t.getUTCMinutes(),n,2)}function pv(t,n){return it(t.getUTCSeconds(),n,2)}function mv(t){var n=t.getUTCDay();return n===0?7:n}function gv(t,n){return it(_n.count(zt(t)-1,t),n,2)}function z0(t){var n=t.getUTCDay();return n>=4||n===0?qn(t):qn.ceil(t)}function yv(t,n){return t=z0(t),it(qn.count(zt(t),t)+(zt(t).getUTCDay()===4),n,2)}function bv(t){return t.getUTCDay()}function wv(t,n){return it(De.count(zt(t)-1,t),n,2)}function xv(t,n){return it(t.getUTCFullYear()%100,n,2)}function vv(t,n){return t=z0(t),it(t.getUTCFullYear()%100,n,2)}function _v(t,n){return it(t.getUTCFullYear()%1e4,n,4)}function Mv(t,n){var e=t.getUTCDay();return t=e>=4||e===0?qn(t):qn.ceil(t),it(t.getUTCFullYear()%1e4,n,4)}function $v(){return"+0000"}function R0(){return"%"}function L0(t){return+t}function P0(t){return Math.floor(+t/1e3)}var yr,pi,Sv,ie,F0;kv({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 kv(t){return yr=Sx(t),pi=yr.format,Sv=yr.parse,ie=yr.utcFormat,F0=yr.utcParse,yr}var B0="%Y-%m-%dT%H:%M:%S.%LZ";function Av(t){return t.toISOString()}var g_=Date.prototype.toISOString?Av:ie(B0);function Tv(t){var n=new Date(t);return isNaN(n)?null:n}var y_=+new Date("2000-01-01T00:00:00.000Z")?Tv:F0(B0);function Mn(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t);break}return this}function Yo(t,n){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof n=="function"?this.interpolator(n):this.range(n);break}}return this}var qo=Symbol("implicit");function Wo(){var t=new an,n=[],e=[],r=qo;function i(o){let a=t.get(o);if(a===void 0){if(r!==qo)return r;t.set(o,a=n.push(o)-1)}return e[a%e.length]}return i.domain=function(o){if(!arguments.length)return n.slice();n=[],t=new an;for(let a of o)t.has(a)||t.set(a,n.push(a)-1);return i},i.range=function(o){return arguments.length?(e=Array.from(o),i):e.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Wo(n,e).unknown(r)},Mn.apply(i,arguments),i}function mi(){var t=Wo().unknown(void 0),n=t.domain,e=t.range,r=0,i=1,o,a,c=!1,u=0,f=0,s=.5;delete t.unknown;function d(){var l=n().length,h=i<r,m=h?i:r,g=h?r:i;o=(g-m)/Math.max(1,l-u+f*2),c&&(o=Math.floor(o)),m+=(g-m-o*(l-u))*s,a=o*(1-u),c&&(m=Math.round(m),a=Math.round(a));var x=nr(l).map(function(v){return m+o*v});return e(h?x.reverse():x)}return t.domain=function(l){return arguments.length?(n(l),d()):n()},t.range=function(l){return arguments.length?([r,i]=l,r=+r,i=+i,d()):[r,i]},t.rangeRound=function(l){return[r,i]=l,r=+r,i=+i,c=!0,d()},t.bandwidth=function(){return a},t.step=function(){return o},t.round=function(l){return arguments.length?(c=!!l,d()):c},t.padding=function(l){return arguments.length?(u=Math.min(1,f=+l),d()):u},t.paddingInner=function(l){return arguments.length?(u=Math.min(1,l),d()):u},t.paddingOuter=function(l){return arguments.length?(f=+l,d()):f},t.align=function(l){return arguments.length?(s=Math.max(0,Math.min(1,l)),d()):s},t.copy=function(){return mi(n(),[r,i]).round(c).paddingInner(u).paddingOuter(f).align(s)},Mn.apply(d(),arguments)}function V0(t){var n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return V0(n())},t}function j0(){return V0(mi.apply(null,arguments).paddingInner(1))}function Cv(t){return function(){return t}}function su(t){return+t}var q0=[0,1];function nn(t){return t}function lu(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:Cv(isNaN(n)?NaN:.5)}function Ev(t,n){var e;return t>n&&(e=t,t=n,n=e),function(r){return Math.max(t,Math.min(n,r))}}function Nv(t,n,e){var r=t[0],i=t[1],o=n[0],a=n[1];return i<r?(r=lu(i,r),o=e(a,o)):(r=lu(r,i),o=e(o,a)),function(c){return o(r(c))}}function Rv(t,n,e){var r=Math.min(t.length,n.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<r;)i[a]=lu(t[a],t[a+1]),o[a]=e(n[a],n[a+1]);return function(c){var u=tr(t,c,1,r)-1;return o[u](i[u](c))}}function gi(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Uo(){var t=q0,n=q0,e=ur,r,i,o,a=nn,c,u,f;function s(){var l=Math.min(t.length,n.length);return a!==nn&&(a=Ev(t[0],t[l-1])),c=l>2?Rv:Nv,u=f=null,d}function d(l){return l==null||isNaN(l=+l)?o:(u||(u=c(t.map(r),n,e)))(r(a(l)))}return d.invert=function(l){return a(i((f||(f=c(n,t.map(r),$t)))(l)))},d.domain=function(l){return arguments.length?(t=Array.from(l,su),s()):t.slice()},d.range=function(l){return arguments.length?(n=Array.from(l),s()):n.slice()},d.rangeRound=function(l){return n=Array.from(l),e=Vr,s()},d.clamp=function(l){return arguments.length?(a=l?!0:nn,s()):a!==nn},d.interpolate=function(l){return arguments.length?(e=l,s()):e},d.unknown=function(l){return arguments.length?(o=l,d):o},function(l,h){return r=l,i=h,s()}}function Z0(){return Uo()(nn,nn)}function Lv(t,n,e,r){var i=qr(t,n,e),o;switch(r=lr(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(n));return r.precision==null&&!isNaN(o=lh(i,a))&&(r.precision=o),Mc(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=dh(i,Math.max(Math.abs(t),Math.abs(n))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=sh(i))&&(r.precision=o-(r.type==="%")*2);break}}return ne(r)}function yi(t){var n=t.domain;return t.ticks=function(e){var r=n();return be(r[0],r[r.length-1],e??10)},t.tickFormat=function(e,r){var i=n();return Lv(i[0],i[i.length-1],e??10,r)},t.nice=function(e){e==null&&(e=10);var r=n(),i=0,o=r.length-1,a=r[i],c=r[o],u,f,s=10;for(c<a&&(f=a,a=c,c=f,f=i,i=o,o=f);s-- >0;){if(f=Ke(a,c,e),f===u)return r[i]=a,r[o]=c,n(r);if(f>0)a=Math.floor(a/f)*f,c=Math.ceil(c/f)*f;else if(f<0)a=Math.ceil(a*f)/f,c=Math.floor(c*f)/f;else break;u=f}return t},t}function Go(){var t=Z0();return t.copy=function(){return gi(t,Go())},Mn.apply(t,arguments),yi(t)}function du(t){var n;function e(r){return r==null||isNaN(r=+r)?n:r}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=Array.from(r,su),e):t.slice()},e.unknown=function(r){return arguments.length?(n=r,e):n},e.copy=function(){return du(t).unknown(n)},t=arguments.length?Array.from(t,su):[0,1],yi(e)}function K0(t,n){t=t.slice();var e=0,r=t.length-1,i=t[e],o=t[r],a;return o<i&&(a=e,e=r,r=a,a=i,i=o,o=a),t[e]=n.floor(i),t[r]=n.ceil(o),t}function Y0(t){return Math.log(t)}function W0(t){return Math.exp(t)}function Pv(t){return-Math.log(-t)}function Dv(t){return-Math.exp(-t)}function Iv(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Ov(t){return t===10?Iv:t===Math.E?Math.exp:n=>Math.pow(t,n)}function zv(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),n=>Math.log(n)/t)}function U0(t){return(n,e)=>-t(-n,e)}function Q0(t){let n=t(Y0,W0),e=n.domain,r=10,i,o;function a(){return i=zv(r),o=Ov(r),e()[0]<0?(i=U0(i),o=U0(o),t(Pv,Dv)):t(Y0,W0),n}return n.base=function(c){return arguments.length?(r=+c,a()):r},n.domain=function(c){return arguments.length?(e(c),a()):e()},n.ticks=c=>{let u=e(),f=u[0],s=u[u.length-1],d=s<f;d&&([f,s]=[s,f]);let l=i(f),h=i(s),m,g,x=c==null?10:+c,v=[];if(!(r%1)&&h-l<x){if(l=Math.floor(l),h=Math.ceil(h),f>0){for(;l<=h;++l)for(m=1;m<r;++m)if(g=l<0?m/o(-l):m*o(l),!(g<f)){if(g>s)break;v.push(g)}}else for(;l<=h;++l)for(m=r-1;m>=1;--m)if(g=l>0?m/o(-l):m*o(l),!(g<f)){if(g>s)break;v.push(g)}v.length*2<x&&(v=be(f,s,x))}else v=be(l,h,Math.min(h-l,x)).map(o);return d?v.reverse():v},n.tickFormat=(c,u)=>{if(c==null&&(c=10),u==null&&(u=r===10?"s":","),typeof u!="function"&&(!(r%1)&&(u=lr(u)).precision==null&&(u.trim=!0),u=ne(u)),c===1/0)return u;let f=Math.max(1,r*c/n.ticks().length);return s=>{let d=s/o(Math.round(i(s)));return d*r<r-.5&&(d*=r),d<=f?u(s):""}},n.nice=()=>e(K0(e(),{floor:c=>o(Math.floor(i(c))),ceil:c=>o(Math.ceil(i(c)))})),n}function hu(){let t=Q0(Uo()).domain([1,10]);return t.copy=()=>gi(t,hu()).base(t.base()),Mn.apply(t,arguments),t}function G0(t){return function(n){return Math.sign(n)*Math.log1p(Math.abs(n/t))}}function H0(t){return function(n){return Math.sign(n)*Math.expm1(Math.abs(n))*t}}function J0(t){var n=1,e=t(G0(n),H0(n));return e.constant=function(r){return arguments.length?t(G0(n=+r),H0(n)):n},yi(e)}function pu(){var t=J0(Uo());return t.copy=function(){return gi(t,pu()).constant(t.constant())},Mn.apply(t,arguments)}function X0(t){return function(n){return n<0?-Math.pow(-n,t):Math.pow(n,t)}}function Fv(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Bv(t){return t<0?-t*t:t*t}function tp(t){var n=t(nn,nn),e=1;function r(){return e===1?t(nn,nn):e===.5?t(Fv,Bv):t(X0(e),X0(1/e))}return n.exponent=function(i){return arguments.length?(e=+i,r()):e},yi(n)}function mu(){var t=tp(Uo());return t.copy=function(){return gi(t,mu()).exponent(t.exponent())},Mn.apply(t,arguments),t}function gu(){var t=[],n=[],e=[],r;function i(){var a=0,c=Math.max(1,n.length);for(e=new Array(c-1);++a<c;)e[a-1]=rd(t,a/c);return o}function o(a){return a==null||isNaN(a=+a)?r:n[tr(e,a)]}return o.invertExtent=function(a){var c=n.indexOf(a);return c<0?[NaN,NaN]:[c>0?e[c-1]:t[0],c<e.length?e[c]:t[t.length-1]]},o.domain=function(a){if(!arguments.length)return t.slice();t=[];for(let c of a)c!=null&&!isNaN(c=+c)&&t.push(c);return t.sort(At),i()},o.range=function(a){return arguments.length?(n=Array.from(a),i()):n.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.quantiles=function(){return e.slice()},o.copy=function(){return gu().domain(t).range(n).unknown(r)},Mn.apply(o,arguments)}function yu(){var t=[.5],n=[0,1],e,r=1;function i(o){return o!=null&&o<=o?n[tr(t,o,0,r)]:e}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(o){return arguments.length?(n=Array.from(o),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(o){var a=n.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(e=o,i):e},i.copy=function(){return yu().domain(t).range(n).unknown(e)},Mn.apply(i,arguments)}function qv(t){return new Date(t)}function Yv(t){return t instanceof Date?+t:Math.round(t)}function bu(t,n,e,r,i,o,a,c,u,f){var s=Z0(),d=s.invert,l=s.domain,h=f(".%L"),m=f(":%S"),g=f("%I:%M"),x=f("%I %p"),v=f("%a %d"),w=f("%b %d"),$=f("%B"),p=f("%Y");function b(y){return(u(y)<y?h:c(y)<y?m:a(y)<y?g:o(y)<y?x:r(y)<y?i(y)<y?v:w:e(y)<y?$:p)(y)}return s.invert=function(y){return new Date(Math.round(d(y)))},s.domain=function(y){return arguments.length?l(Array.from(y,Yv)):l().map(qv)},s.ticks=function(y){var _=l();return t(_[0],_[_.length-1],y??10)},s.tickFormat=function(y,_){return _==null?b:f(_)},s.nice=function(y){var _=l();return(!y||typeof y.range!="function")&&(y=n(_[0],_[_.length-1],y??10)),y?l(K0(_,y)):s},s.copy=function(){return gi(s,bu(t,n,e,r,i,o,a,c,u,f))},s}function np(){return Mn.apply(bu(M0,$0,Ot,Ie,vn,xn,Ee,Te,Rt,pi).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ep(){return Mn.apply(bu(_0,Bo,zt,Oe,_n,gr,Ne,Ce,Rt,ie).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ho(t,n){return n.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Xo(){var t=0,n=.5,e=1,r=1,i,o,a,c,u,f=nn,s,d=!1,l;function h(g){return g==null||isNaN(g=+g)?l:(g=.5+((g=+s(g))-o)*(r*g<r*o?c:u),f(d?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([t,n,e]=g,i=s(t=+t),o=s(n=+n),a=s(e=+e),c=i===o?0:.5/(o-i),u=o===a?0:.5/(a-o),r=o<i?-1:1,h):[t,n,e]},h.clamp=function(g){return arguments.length?(d=!!g,h):d},h.interpolator=function(g){return arguments.length?(f=g,h):f};function m(g){return function(x){var v,w,$;return arguments.length?([v,w,$]=x,f=fr(g,[v,w,$]),h):[f(0),f(.5),f(1)]}}return h.range=m(ur),h.rangeRound=m(Vr),h.unknown=function(g){return arguments.length?(l=g,h):l},function(g){return s=g,i=g(t),o=g(n),a=g(e),c=i===o?0:.5/(o-i),u=o===a?0:.5/(a-o),r=o<i?-1:1,h}}function wu(){var t=yi(Xo()(nn));return t.copy=function(){return Ho(t,wu())},Yo.apply(t,arguments)}function xu(){var t=Q0(Xo()).domain([.1,1,10]);return t.copy=function(){return Ho(t,xu()).base(t.base())},Yo.apply(t,arguments)}function vu(){var t=J0(Xo());return t.copy=function(){return Ho(t,vu()).constant(t.constant())},Yo.apply(t,arguments)}function _u(){var t=tp(Xo());return t.copy=function(){return Ho(t,_u()).exponent(t.exponent())},Yo.apply(t,arguments)}function Z(t){for(var n=t.length/6|0,e=new Array(n),r=0;r<n;)e[r]="#"+t.slice(r*6,++r*6);return e}var rp=Z("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),ip=Z("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),op=Z("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),ap=Z("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),cp=Z("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),up=Z("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),fp=Z("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),sp=Z("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),lp=Z("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),dp=Z("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),hp=Z("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),ct=t=>Vd(t[t.length-1]),Mu=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Z),$u=ct(Mu),Su=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Z),ku=ct(Su),Au=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Z),Tu=ct(Au),Cu=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Z),Eu=ct(Cu),Zo=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Z),bi=ct(Zo),Nu=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Z),Ru=ct(Nu),Ko=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Z),wi=ct(Ko),Lu=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Z),Pu=ct(Lu),Du=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Z),Iu=ct(Du),Ou=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Z),zu=ct(Ou),Fu=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Z),Bu=ct(Fu),qu=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Z),Yu=ct(qu),Wu=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Z),Uu=ct(Wu),Gu=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Z),Hu=ct(Gu),Xu=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Z),Vu=ct(Xu),ju=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Z),Zu=ct(ju),Ku=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Z),Qu=ct(Ku),Ju=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Z),tf=ct(Ju),nf=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Z),ef=ct(nf),rf=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Z),of=ct(rf),af=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Z),cf=ct(af),uf=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Z),ff=ct(uf),sf=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Z),lf=ct(sf),df=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Z),hf=ct(df),pf=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Z),mf=ct(pf),gf=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Z),yf=ct(gf),bf=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Z),wf=ct(bf);function xf(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}var vf=po(jt(300,.5,0),jt(-240,.5,1)),_f=po(jt(-100,.75,.35),jt(80,1.5,.8)),Mf=po(jt(260,.75,.35),jt(80,1.5,.8)),Vo=jt();function $f(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return Vo.h=360*t-100,Vo.s=1.5-1.5*n,Vo.l=.8-.9*n,Vo+""}var jo=$e(),Wv=Math.PI/3,Uv=Math.PI*2/3;function Sf(t){var n;return t=(.5-t)*Math.PI,jo.r=255*(n=Math.sin(t))*n,jo.g=255*(n=Math.sin(t+Wv))*n,jo.b=255*(n=Math.sin(t+Uv))*n,jo+""}function kf(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function Qo(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var Af=Qo(Z("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Tf=Qo(Z("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Cf=Qo(Z("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Ef=Qo(Z("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function _t(t){return function(){return t}}var wp=Math.cos;var Pf=Math.min,Jo=Math.sin,yt=Math.sqrt,pp=1e-12,xi=Math.PI,C_=xi/2,ia=2*xi;function xp(t){let n=3;return t.digits=function(e){if(!arguments.length)return n;if(e==null)n=null;else{let r=Math.floor(e);if(!(r>=0))throw new RangeError(`invalid digits: ${e}`);n=r}return t},()=>new ke(n)}var E_=Array.prototype.slice;function vp(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function _p(t){this._context=t}_p.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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n);break}}};function ze(t){return new _p(t)}function Mp(t){return t[0]}function $p(t){return t[1]}function oa(t,n){var e=_t(!0),r=null,i=ze,o=null,a=xp(c);t=typeof t=="function"?t:t===void 0?Mp:_t(t),n=typeof n=="function"?n:n===void 0?$p:_t(n);function c(u){var f,s=(u=vp(u)).length,d,l=!1,h;for(r==null&&(o=i(h=a())),f=0;f<=s;++f)!(f<s&&e(d=u[f],f,u))===l&&((l=!l)?o.lineStart():o.lineEnd()),l&&o.point(+t(d,f,u),+n(d,f,u));if(h)return o=null,h+""||null}return c.x=function(u){return arguments.length?(t=typeof u=="function"?u:_t(+u),c):t},c.y=function(u){return arguments.length?(n=typeof u=="function"?u:_t(+u),c):n},c.defined=function(u){return arguments.length?(e=typeof u=="function"?u:_t(!!u),c):e},c.curve=function(u){return arguments.length?(i=u,r!=null&&(o=i(r)),c):i},c.context=function(u){return arguments.length?(u==null?r=o=null:o=i(r=u),c):r},c}function Df(t,n,e){var r=null,i=_t(!0),o=null,a=ze,c=null,u=xp(f);t=typeof t=="function"?t:t===void 0?Mp:_t(+t),n=typeof n=="function"?n:_t(n===void 0?0:+n),e=typeof e=="function"?e:e===void 0?$p:_t(+e);function f(d){var l,h,m,g=(d=vp(d)).length,x,v=!1,w,$=new Array(g),p=new Array(g);for(o==null&&(c=a(w=u())),l=0;l<=g;++l){if(!(l<g&&i(x=d[l],l,d))===v)if(v=!v)h=l,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),m=l-1;m>=h;--m)c.point($[m],p[m]);c.lineEnd(),c.areaEnd()}v&&($[l]=+t(x,l,d),p[l]=+n(x,l,d),c.point(r?+r(x,l,d):$[l],e?+e(x,l,d):p[l]))}if(w)return c=null,w+""||null}function s(){return oa().defined(i).curve(a).context(o)}return f.x=function(d){return arguments.length?(t=typeof d=="function"?d:_t(+d),r=null,f):t},f.x0=function(d){return arguments.length?(t=typeof d=="function"?d:_t(+d),f):t},f.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:_t(+d),f):r},f.y=function(d){return arguments.length?(n=typeof d=="function"?d:_t(+d),e=null,f):n},f.y0=function(d){return arguments.length?(n=typeof d=="function"?d:_t(+d),f):n},f.y1=function(d){return arguments.length?(e=d==null?null:typeof d=="function"?d:_t(+d),f):e},f.lineX0=f.lineY0=function(){return s().x(t).y(n)},f.lineY1=function(){return s().x(t).y(e)},f.lineX1=function(){return s().x(r).y(n)},f.defined=function(d){return arguments.length?(i=typeof d=="function"?d:_t(!!d),f):i},f.curve=function(d){return arguments.length?(a=d,o!=null&&(c=a(o)),f):a},f.context=function(d){return arguments.length?(d==null?o=c=null:c=a(o=d),f):o},f}var N_=Gv(ze);function Sp(t){this._curve=t}Sp.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};function Gv(t){function n(e){return new Sp(t(e))}return n._curve=t,n}var ta=class{constructor(n,e){this._context=n,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(n,e){switch(n=+n,e=+e,this._point){case 0:{this._point=1,this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+n)/2,this._y0,this._x0,e,n,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,n,this._y0,n,e);break}}this._x0=n,this._y0=e}};function kp(t){return new ta(t,!0)}function Ap(t){return new ta(t,!1)}var Hv=yt(3),If={draw(t,n){let e=yt(n+Pf(n/28,.75))*.59436,r=e/2,i=r*Hv;t.moveTo(0,e),t.lineTo(0,-e),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},br={draw(t,n){let e=yt(n/xi);t.moveTo(e,0),t.arc(0,0,e,0,ia)}},Of={draw(t,n){let e=yt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},Tp=yt(1/3),Xv=Tp*2,zf={draw(t,n){let e=yt(n/Xv),r=e*Tp;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},Ff={draw(t,n){let e=yt(n)*.62625;t.moveTo(0,-e),t.lineTo(e,0),t.lineTo(0,e),t.lineTo(-e,0),t.closePath()}},Bf={draw(t,n){let e=yt(n-Pf(n/7,2))*.87559;t.moveTo(-e,0),t.lineTo(e,0),t.moveTo(0,e),t.lineTo(0,-e)}},qf={draw(t,n){let e=yt(n),r=-e/2;t.rect(r,r,e,e)}},Yf={draw(t,n){let e=yt(n)*.4431;t.moveTo(e,e),t.lineTo(e,-e),t.lineTo(-e,-e),t.lineTo(-e,e),t.closePath()}},Vv=.8908130915292852,Cp=Jo(xi/10)/Jo(7*xi/10),jv=Jo(ia/10)*Cp,Zv=-wp(ia/10)*Cp,Wf={draw(t,n){let e=yt(n*Vv),r=jv*e,i=Zv*e;t.moveTo(0,-e),t.lineTo(r,i);for(let o=1;o<5;++o){let a=ia*o/5,c=wp(a),u=Jo(a);t.lineTo(u*e,-c*e),t.lineTo(c*r-u*i,u*r+c*i)}t.closePath()}},Nf=yt(3),Uf={draw(t,n){let e=-yt(n/(Nf*3));t.moveTo(0,e*2),t.lineTo(-Nf*e,-e),t.lineTo(Nf*e,-e),t.closePath()}},Kv=yt(3),Gf={draw(t,n){let e=yt(n)*.6824,r=e/2,i=e*Kv/2;t.moveTo(0,-e),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},en=-.5,rn=yt(3)/2,Lf=1/yt(12),Qv=(Lf/2+1)*3,Hf={draw(t,n){let e=yt(n/Qv),r=e/2,i=e*Lf,o=r,a=e*Lf+e,c=-o,u=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(c,u),t.lineTo(en*r-rn*i,rn*r+en*i),t.lineTo(en*o-rn*a,rn*o+en*a),t.lineTo(en*c-rn*u,rn*c+en*u),t.lineTo(en*r+rn*i,en*i-rn*r),t.lineTo(en*o+rn*a,en*a-rn*o),t.lineTo(en*c+rn*u,en*u-rn*c),t.closePath()}},Xf={draw(t,n){let e=yt(n-Pf(n/6,1.7))*.6189;t.moveTo(-e,-e),t.lineTo(e,e),t.moveTo(-e,e),t.lineTo(e,-e)}},Ep=[br,Of,zf,qf,Wf,Uf,Hf],Np=[br,Bf,Xf,Gf,If,Yf,Ff];function oe(){}function na(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function aa(t){this._context=t}aa.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:na(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:na(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Rp(t){return new aa(t)}function Lp(t){this._context=t}Lp.prototype={areaStart:oe,areaEnd:oe,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:na(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Pp(t){return new Lp(t)}function Dp(t){this._context=t}Dp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:na(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Ip(t){return new Dp(t)}function Op(t,n){this._basis=new aa(t),this._beta=n}Op.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r=t[0],i=n[0],o=t[e]-r,a=n[e]-i,c=-1,u;++c<=e;)u=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(r+u*o),this._beta*n[c]+(1-this._beta)*(i+u*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var zp=(function t(n){function e(r){return n===1?new aa(r):new Op(r,n)}return e.beta=function(r){return t(+r)},e})(.85);function ea(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function Vf(t,n){this._context=t,this._k=(1-n)/6}Vf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ea(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:ea(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Fp=(function t(n){function e(r){return new Vf(r,n)}return e.tension=function(r){return t(+r)},e})(0);function jf(t,n){this._context=t,this._k=(1-n)/6}jf.prototype={areaStart:oe,areaEnd:oe,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:ea(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Bp=(function t(n){function e(r){return new jf(r,n)}return e.tension=function(r){return t(+r)},e})(0);function Zf(t,n){this._context=t,this._k=(1-n)/6}Zf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ea(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var qp=(function t(n){function e(r){return new Zf(r,n)}return e.tension=function(r){return t(+r)},e})(0);function Kf(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>pp){var c=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*c-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*c-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>pp){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*f+t._x1*t._l23_2a-n*t._l12_2a)/s,a=(a*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Yp(t,n){this._context=t,this._alpha=n}Yp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Kf(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Wp=(function t(n){function e(r){return n?new Yp(r,n):new Vf(r,0)}return e.alpha=function(r){return t(+r)},e})(.5);function Up(t,n){this._context=t,this._alpha=n}Up.prototype={areaStart:oe,areaEnd:oe,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Kf(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Gp=(function t(n){function e(r){return n?new Up(r,n):new jf(r,0)}return e.alpha=function(r){return t(+r)},e})(.5);function Hp(t,n){this._context=t,this._alpha=n}Hp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Kf(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Xp=(function t(n){function e(r){return n?new Hp(r,n):new Zf(r,0)}return e.alpha=function(r){return t(+r)},e})(.5);function Vp(t){this._context=t}Vp.prototype={areaStart:oe,areaEnd:oe,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};function jp(t){return new Vp(t)}function mp(t){return t<0?-1:1}function gp(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),c=(o*i+a*r)/(r+i);return(mp(o)+mp(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(c))||0}function yp(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Rf(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,c=(o-r)/3;t._context.bezierCurveTo(r+c,i+c*n,o-c,a-c*e,o,a)}function ra(t){this._context=t}ra.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:Rf(this,this._t0,yp(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(t=+t,n=+n,!(t===this._x1&&n===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,Rf(this,yp(this,e=gp(this,t,n)),e);break;default:Rf(this,this._t0,e=gp(this,t,n));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}};function Zp(t){this._context=new Kp(t)}(Zp.prototype=Object.create(ra.prototype)).point=function(t,n){ra.prototype.point.call(this,n,t)};function Kp(t){this._context=t}Kp.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,r,i,o){this._context.bezierCurveTo(n,t,r,e,o,i)}};function Qp(t){return new ra(t)}function Jp(t){return new Zp(t)}function t1(t){this._context=t}t1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,e=t.length;if(e)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),e===2)this._context.lineTo(t[1],n[1]);else for(var r=bp(t),i=bp(n),o=0,a=1;a<e;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],n[a]);(this._line||this._line!==0&&e===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}};function bp(t){var n,e=t.length-1,r,i=new Array(e),o=new Array(e),a=new Array(e);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n<e-1;++n)i[n]=1,o[n]=4,a[n]=4*t[n]+2*t[n+1];for(i[e-1]=2,o[e-1]=7,a[e-1]=8*t[e-1]+t[e],n=1;n<e;++n)r=i[n]/o[n-1],o[n]-=r,a[n]-=r*a[n-1];for(i[e-1]=a[e-1]/o[e-1],n=e-2;n>=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[e-1]=(t[e]+i[e-1])/2,n=0;n<e-1;++n)o[n]=2*t[n+1]-i[n+1];return[i,o]}function n1(t){return new t1(t)}function ca(t,n){this._context=t,this._t=n}ca.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}break}}this._x=t,this._y=n}};function e1(t){return new ca(t,.5)}function r1(t){return new ca(t,0)}function i1(t){return new ca(t,1)}function An(t){return t!=null&&!Number.isNaN(t)}function sn(t,n){return+An(n)-+An(t)||At(t,n)}function wa(t,n){return+An(n)-+An(t)||Qe(t,n)}function Fs(t){return t!=null&&`${t}`!=""}function em(t){return isFinite(t)?t:NaN}function Ca(t){return t>0&&isFinite(t)?t:NaN}function Bs(t){return t<0&&isFinite(t)?t:NaN}function Jv(t,n){if(t instanceof Date||(t=new Date(+t)),isNaN(t))return typeof n=="function"?n(t):n;let e=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),o=t.getUTCMilliseconds();return`${t6(t.getUTCFullYear())}-${Hn(t.getUTCMonth()+1,2)}-${Hn(t.getUTCDate(),2)}${e||r||i||o?`T${Hn(e,2)}:${Hn(r,2)}${i||o?`:${Hn(i,2)}${o?`.${Hn(o,3)}`:""}`:""}Z`:""}`}function t6(t){return t<0?`-${Hn(-t,6)}`:t>9999?`+${Hn(t,6)}`:Hn(t,4)}function Hn(t,n){return`${t}`.padStart(n,"0")}var n6=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function rm(t,n){return n6.test(t+="")?new Date(t):typeof n=="function"?n(t):n}function Sr(t){if(t==null)return;let n=t[0],e=t[t.length-1];return Qe(n,e)}var vr=1e3,ce=vr*60,ue=ce*60,Tn=ue*24,$n=Tn*7,Fe=Tn*30,ae=Tn*365,Qf=[["millisecond",1],["2 milliseconds",2],["5 milliseconds",5],["10 milliseconds",10],["20 milliseconds",20],["50 milliseconds",50],["100 milliseconds",100],["200 milliseconds",200],["500 milliseconds",500],["second",vr],["5 seconds",5*vr],["15 seconds",15*vr],["30 seconds",30*vr],["minute",ce],["5 minutes",5*ce],["15 minutes",15*ce],["30 minutes",30*ce],["hour",ue],["3 hours",3*ue],["6 hours",6*ue],["12 hours",12*ue],["day",Tn],["2 days",2*Tn],["week",$n],["2 weeks",2*$n],["month",Fe],["3 months",3*Fe],["6 months",6*Fe],["year",ae],["2 years",2*ae],["5 years",5*ae],["10 years",10*ae],["20 years",20*ae],["50 years",50*ae],["100 years",100*ae]],qs=new Map([["second",vr],["minute",ce],["hour",ue],["day",Tn],["monday",$n],["tuesday",$n],["wednesday",$n],["thursday",$n],["friday",$n],["saturday",$n],["sunday",$n],["week",$n],["month",Fe],["year",ae]]),im=new Map([["second",Rt],["minute",Te],["hour",Ee],["day",xn],["monday",Le],["tuesday",tu],["wednesday",nu],["thursday",Bn],["friday",eu],["saturday",ru],["sunday",vn],["week",vn],["month",Ie],["year",Ot]]),Ys=new Map([["second",Rt],["minute",Ce],["hour",Ne],["day",si],["monday",De],["tuesday",iu],["wednesday",ou],["thursday",qn],["friday",au],["saturday",cu],["sunday",_n],["week",_n],["month",Oe],["year",zt]]),Di=Symbol("intervalDuration"),Ea=Symbol("intervalType");for(let[t,n]of im)n[Di]=qs.get(t),n[Ea]="time";for(let[t,n]of Ys)n[Di]=qs.get(t),n[Ea]="utc";var Mi=[["year",zt,"utc"],["month",Oe,"utc"],["day",si,"utc",6*Fe],["hour",Ne,"utc",3*Tn],["minute",Ce,"utc",6*ue],["second",Rt,"utc",30*ce]],ga=[["year",Ot,"time"],["month",Ie,"time"],["day",xn,"time",6*Fe],["hour",Ee,"time",3*Tn],["minute",Te,"time",6*ue],["second",Rt,"time",30*ce]],e6=[Mi[0],ga[0],Mi[1],ga[1],Mi[2],ga[2],...Mi.slice(3)];function om(t){let n=`${t}`.toLowerCase();n.endsWith("s")&&(n=n.slice(0,-1));let e=1,r=/^(?:(\d+)\s+)/.exec(n);switch(r&&(n=n.slice(r[0].length),e=+r[1]),n){case"quarter":n="month",e*=3;break;case"half":n="month",e*=6;break}let i=Ys.get(n);if(!i)throw new Error(`unknown interval: ${t}`);if(e>1&&!i.every)throw new Error(`non-periodic interval: ${n}`);return[n,e]}function am(t){return cm(om(t),"time")}function Ws(t){return cm(om(t),"utc")}function cm([t,n],e){let r=(e==="time"?im:Ys).get(t);return n>1&&(r=r.every(n),r[Di]=qs.get(t)*n,r[Ea]=e),r}function o1(t,n){if(!(n>1))return;let e=t[Di];if(!Qf.some(([,i])=>i===e)||e%Tn===0&&Tn<e&&e<Fe)return;let[r]=Qf[Je(([,i])=>Math.log(i)).center(Qf,Math.log(e*n))];return(t[Ea]==="time"?am:Ws)(r)}function a1(t,n,e){let r=n==="time"?pi:ie;if(e==null)return r(t==="year"?"%Y":t==="month"?"%Y-%m":t==="day"?"%Y-%m-%d":t==="hour"||t==="minute"?"%Y-%m-%dT%H:%M":t==="second"?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M:%S.%L");let i=r6(e);switch(t){case"millisecond":return wr(r(".%L"),r(":%M:%S"),i);case"second":return wr(r(":%S"),r("%-I:%M"),i);case"minute":return wr(r("%-I:%M"),r("%p"),i);case"hour":return wr(r("%-I %p"),r("%b %-d"),i);case"day":return wr(r("%-d"),r("%b"),i);case"month":return wr(r("%b"),r("%Y"),i);case"year":return r("%Y")}throw new Error("unable to format time ticks")}function r6(t){return t==="left"||t==="right"?(n,e)=>`
|
|
1
|
+
var figkitViz=(()=>{var Qa=Object.defineProperty;var eb=Object.getOwnPropertyDescriptor;var rb=Object.getOwnPropertyNames;var ib=Object.prototype.hasOwnProperty;var ob=(t,n)=>{for(var e in n)Qa(t,e,{get:n[e],enumerable:!0})},ab=(t,n,e,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of rb(n))!ib.call(t,i)&&i!==e&&Qa(t,i,{get:()=>n[i],enumerable:!(r=eb(n,i))||r.enumerable});return t};var cb=t=>ab(Qa({},"__esModule",{value:!0}),t);var CM={};ob(CM,{drawBars:()=>Oy,drawChange:()=>Iy,drawDots:()=>Uy,drawDumbbell:()=>zy,drawGroups:()=>Ul,drawHeatmap:()=>Yy,drawLines:()=>Gl,drawPanels:()=>By,drawScatter:()=>Gy,drawSeries:()=>Fy,drawSpec:()=>AM,drawSplit:()=>Dy,drawUnits:()=>Xy,placeRecords:()=>qy,swarm:()=>Wy});function Et(t,n){return t==null||n==null?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function rr(t,n){return t==null||n==null?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function ir(t){let n,e,r;t.length!==2?(n=Et,e=(c,u)=>Et(t(c),u),r=(c,u)=>t(c)-u):(n=t===Et||t===rr?t:ub,e=t,r=t);function i(c,u,s=0,f=c.length){if(s<f){if(n(u,u)!==0)return f;do{let d=s+f>>>1;e(c[d],u)<0?s=d+1:f=d}while(s<f)}return s}function o(c,u,s=0,f=c.length){if(s<f){if(n(u,u)!==0)return f;do{let d=s+f>>>1;e(c[d],u)<=0?s=d+1:f=d}while(s<f)}return s}function a(c,u,s=0,f=c.length){let d=i(c,u,s,f-1);return d>s&&r(c[d-1],u)>-r(c[d],u)?d-1:d}return{left:i,center:a,right:o}}function ub(){return 0}function Zl(t){return t===null?NaN:+t}function*sb(t,n){if(n===void 0)for(let e of t)e!=null&&(e=+e)>=e&&(yield e);else{let e=-1;for(let r of t)(r=n(r,++e,t))!=null&&(r=+r)>=r&&(yield r)}}var Kl=ir(Et),or=Kl.right,NM=Kl.left,LM=ir(Zl).center;var fb=Ql(Jl),lb=Ql(db);function Ql(t){return function(n,e,r=e){if(!((e=+e)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=n;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(a!==void 0?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!e&&!r)return n;let c=e&&t(e),u=r&&t(r),s=i.slice();return c&&u?(tr(c,s,i,o,a),tr(c,i,s,o,a),tr(c,s,i,o,a),nr(u,i,s,o,a),nr(u,s,i,o,a),nr(u,i,s,o,a)):c?(tr(c,i,s,o,a),tr(c,s,i,o,a),tr(c,i,s,o,a)):u&&(nr(u,i,s,o,a),nr(u,s,i,o,a),nr(u,i,s,o,a)),n}}function tr(t,n,e,r,i){for(let o=0,a=r*i;o<a;)t(n,e,o,o+=r,1)}function nr(t,n,e,r,i){for(let o=0,a=r*i;o<r;++o)t(n,e,o,o+a,r)}function db(t){let n=Jl(t);return(e,r,i,o,a)=>{i<<=2,o<<=2,a<<=2,n(e,r,i+0,o+0,a),n(e,r,i+1,o+1,a),n(e,r,i+2,o+2,a),n(e,r,i+3,o+3,a)}}function Jl(t){let n=Math.floor(t);if(n===t)return hb(t);let e=t-n,r=2*t+1;return(i,o,a,c,u)=>{if(!((c-=u)>=a))return;let s=n*o[a],f=u*n,d=f+u;for(let l=a,h=a+f;l<h;l+=u)s+=o[Math.min(c,l)];for(let l=a,h=c;l<=h;l+=u)s+=o[Math.min(c,l+f)],i[l]=(s+e*(o[Math.max(a,l-d)]+o[Math.min(c,l+d)]))/r,s-=o[Math.max(a,l-f)]}}function hb(t){let n=2*t+1;return(e,r,i,o,a)=>{if(!((o-=a)>=i))return;let c=t*r[i],u=a*t;for(let s=i,f=i+u;s<f;s+=a)c+=r[Math.min(o,s)];for(let s=i,f=o;s<=f;s+=a)c+=r[Math.min(o,s+u)],e[s]=c/n,c-=r[Math.max(i,s-u)]}}function ro(t,n){let e=0;if(n===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++e;else{let r=-1;for(let i of t)(i=n(i,++r,t))!=null&&(i=+i)>=i&&++e}return e}function mb(t){return t.length|0}function pb(t){return!(t>0)}function gb(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function yb(t){return n=>t(...n)}function td(...t){let n=typeof t[t.length-1]=="function"&&yb(t.pop());t=t.map(gb);let e=t.map(mb),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||e.some(pb))return o;for(;;){o.push(i.map((c,u)=>t[u][c]));let a=r;for(;++i[a]===e[a];){if(a===0)return n?o.map(n):o;i[a--]=0}}}function nd(t,n){var e=0,r=0;return Float64Array.from(t,n===void 0?i=>e+=+i||0:i=>e+=+n(i,r++,t)||0)}function nc(t,n){let e=0,r,i=0,o=0;if(n===void 0)for(let a of t)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++e,o+=r*(a-i));else{let a=-1;for(let c of t)(c=n(c,++a,t))!=null&&(c=+c)>=c&&(r=c-i,i+=r/++e,o+=r*(c-i))}if(e>1)return o/(e-1)}function ec(t,n){let e=nc(t,n);return e&&Math.sqrt(e)}function Xt(t,n){let e,r;if(n===void 0)for(let i of t)i!=null&&(e===void 0?i>=i&&(e=r=i):(e>i&&(e=i),r<i&&(r=i)));else{let i=-1;for(let o of t)(o=n(o,++i,t))!=null&&(e===void 0?o>=o&&(e=r=o):(e>o&&(e=o),r<o&&(r=o)))}return[e,r]}var Qt=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(n){let e=this._partials,r=0;for(let i=0;i<this._n&&i<32;i++){let o=e[i],a=n+o,c=Math.abs(n)<Math.abs(o)?n-(a-o):o-(a-n);c&&(e[r++]=c),n=a}return e[r]=n,this._n=r+1,this}valueOf(){let n=this._partials,e=this._n,r,i,o,a=0;if(e>0){for(a=n[--e];e>0&&(r=a,i=n[--e],a=r+i,o=i-(a-r),!o););e>0&&(o<0&&n[e-1]<0||o>0&&n[e-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}};var sn=class extends Map{constructor(n,e=id){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),n!=null)for(let[r,i]of n)this.set(r,i)}get(n){return super.get(Ja(this,n))}has(n){return super.has(Ja(this,n))}set(n,e){return super.set(ed(this,n),e)}delete(n){return super.delete(rd(this,n))}},xe=class extends Set{constructor(n,e=id){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),n!=null)for(let r of n)this.add(r)}has(n){return super.has(Ja(this,n))}add(n){return super.add(ed(this,n))}delete(n){return super.delete(rd(this,n))}};function Ja({_intern:t,_key:n},e){let r=n(e);return t.has(r)?t.get(r):e}function ed({_intern:t,_key:n},e){let r=n(e);return t.has(r)?t.get(r):(t.set(r,e),e)}function rd({_intern:t,_key:n},e){let r=n(e);return t.has(r)&&(e=t.get(r),t.delete(r)),e}function id(t){return t!==null&&typeof t=="object"?t.valueOf():t}function tc(t){return t}function Ur(t,...n){return rc(t,tc,tc,n)}function we(t,n,...e){return rc(t,tc,n,e)}function od(t,n,...e){return rc(t,Array.from,n,e)}function rc(t,n,e,r){return(function i(o,a){if(a>=r.length)return e(o);let c=new sn,u=r[a++],s=-1;for(let f of o){let d=u(f,++s,o),l=c.get(d);l?l.push(f):c.set(d,[f])}for(let[f,d]of c)c.set(f,i(d,a));return n(c)})(t,0)}function bb(t,n){return Array.from(n,e=>t[e])}function Hr(t,...n){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[e]=n;if(e&&e.length!==2||n.length>1){let r=Uint32Array.from(t,(i,o)=>o);return n.length>1?(n=n.map(i=>t.map(i)),r.sort((i,o)=>{for(let a of n){let c=no(a[i],a[o]);if(c)return c}})):(e=t.map(e),r.sort((i,o)=>no(e[i],e[o]))),bb(t,r)}return t.sort(ad(e))}function ad(t=Et){if(t===Et)return no;if(typeof t!="function")throw new TypeError("compare is not a function");return(n,e)=>{let r=t(n,e);return r||r===0?r:(t(e,e)===0)-(t(n,n)===0)}}function no(t,n){return(t==null||!(t>=t))-(n==null||!(n>=n))||(t<n?-1:t>n?1:0)}function io(t,n,e){return(n.length!==2?Hr(we(t,n,e),(([r,i],[o,a])=>Et(i,a)||Et(r,o))):Hr(Ur(t,e),(([r,i],[o,a])=>n(i,a)||Et(r,o)))).map(([r])=>r)}var xb=Array.prototype,PM=xb.slice;var wb=Math.sqrt(50),vb=Math.sqrt(10),Mb=Math.sqrt(2);function eo(t,n,e){let r=(n-t)/Math.max(0,e),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=wb?10:o>=vb?5:o>=Mb?2:1,c,u,s;return i<0?(s=Math.pow(10,-i)/a,c=Math.round(t*s),u=Math.round(n*s),c/s<t&&++c,u/s>n&&--u,s=-s):(s=Math.pow(10,i)*a,c=Math.round(t/s),u=Math.round(n/s),c*s<t&&++c,u*s>n&&--u),u<c&&.5<=e&&e<2?eo(t,n,e*2):[c,u,s]}function ve(t,n,e){if(n=+n,t=+t,e=+e,!(e>0))return[];if(t===n)return[t];let r=n<t,[i,o,a]=r?eo(n,t,e):eo(t,n,e);if(!(o>=i))return[];let c=o-i+1,u=new Array(c);if(r)if(a<0)for(let s=0;s<c;++s)u[s]=(o-s)/-a;else for(let s=0;s<c;++s)u[s]=(o-s)*a;else if(a<0)for(let s=0;s<c;++s)u[s]=(i+s)/-a;else for(let s=0;s<c;++s)u[s]=(i+s)*a;return u}function er(t,n,e){return n=+n,t=+t,e=+e,eo(t,n,e)[2]}function Gr(t,n,e){n=+n,t=+t,e=+e;let r=n<t,i=r?er(n,t,e):er(t,n,e);return(r?-1:1)*(i<0?1/-i:i)}function cd(t){return Math.max(1,Math.ceil(Math.log(ro(t))/Math.LN2)+1)}function Gt(t,n){let e;if(n===void 0)for(let r of t)r!=null&&(e<r||e===void 0&&r>=r)&&(e=r);else{let r=-1;for(let i of t)(i=n(i,++r,t))!=null&&(e<i||e===void 0&&i>=i)&&(e=i)}return e}function ud(t,n){let e,r=-1,i=-1;if(n===void 0)for(let o of t)++i,o!=null&&(e<o||e===void 0&&o>=o)&&(e=o,r=i);else for(let o of t)(o=n(o,++i,t))!=null&&(e<o||e===void 0&&o>=o)&&(e=o,r=i);return r}function fn(t,n){let e;if(n===void 0)for(let r of t)r!=null&&(e>r||e===void 0&&r>=r)&&(e=r);else{let r=-1;for(let i of t)(i=n(i,++r,t))!=null&&(e>i||e===void 0&&i>=i)&&(e=i)}return e}function sd(t,n){let e,r=-1,i=-1;if(n===void 0)for(let o of t)++i,o!=null&&(e>o||e===void 0&&o>=o)&&(e=o,r=i);else for(let o of t)(o=n(o,++i,t))!=null&&(e>o||e===void 0&&o>=o)&&(e=o,r=i);return r}function fd(t,n,e=0,r=1/0,i){if(n=Math.floor(n),e=Math.floor(Math.max(0,e)),r=Math.floor(Math.min(t.length-1,r)),!(e<=n&&n<=r))return t;for(i=i===void 0?no:ad(i);r>e;){if(r-e>600){let u=r-e+1,s=n-e+1,f=Math.log(u),d=.5*Math.exp(2*f/3),l=.5*Math.sqrt(f*d*(u-d)/u)*(s-u/2<0?-1:1),h=Math.max(e,Math.floor(n-s*d/u+l)),p=Math.min(r,Math.floor(n+(u-s)*d/u+l));fd(t,n,h,p,i)}let o=t[n],a=e,c=r;for(Wr(t,e,n),i(t[r],o)>0&&Wr(t,e,r);a<c;){for(Wr(t,a,c),++a,--c;i(t[a],o)<0;)++a;for(;i(t[c],o)>0;)--c}i(t[e],o)===0?Wr(t,e,c):(++c,Wr(t,c,r)),c<=n&&(e=c+1),n<=c&&(r=c-1)}return t}function Wr(t,n,e){let r=t[n];t[n]=t[e],t[e]=r}function ic(t,n=Et){let e,r=!1;if(n.length===1){let i;for(let o of t){let a=n(o);(r?Et(a,i)>0:Et(a,a)===0)&&(e=o,i=a,r=!0)}}else for(let i of t)(r?n(i,e)>0:n(i,i)===0)&&(e=i,r=!0);return e}function te(t,n,e){if(t=Float64Array.from(sb(t,e)),!(!(r=t.length)||isNaN(n=+n))){if(n<=0||r<2)return fn(t);if(n>=1)return Gt(t);var r,i=(r-1)*n,o=Math.floor(i),a=Gt(fd(t,o).subarray(0,o+1)),c=fn(t.subarray(o+1));return a+(c-a)*(i-o)}}function ld(t,n,e=Zl){if(!(!(r=t.length)||isNaN(n=+n))){if(n<=0||r<2)return+e(t[0],0,t);if(n>=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),a=+e(t[o],o,t),c=+e(t[o+1],o+1,t);return a+(c-a)*(i-o)}}function dd(t,n,e){let r=ro(t),i=te(t,.75)-te(t,.25);return r&&i?Math.ceil((e-n)/(2*i*Math.pow(r,-1/3))):1}function oc(t,n,e){let r=ro(t),i=ec(t);return r&&i?Math.ceil((e-n)*Math.cbrt(r)/(3.49*i)):1}function ac(t,n){let e=0,r=0;if(n===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++e,r+=i);else{let i=-1;for(let o of t)(o=n(o,++i,t))!=null&&(o=+o)>=o&&(++e,r+=o)}if(e)return r/e}function Xr(t,n){return te(t,.5,n)}function*_b(t){for(let n of t)yield*n}function cc(t){return Array.from(_b(t))}function hd(t,n){let e=new sn;if(n===void 0)for(let o of t)o!=null&&o>=o&&e.set(o,(e.get(o)||0)+1);else{let o=-1;for(let a of t)(a=n(a,++o,t))!=null&&a>=a&&e.set(a,(e.get(a)||0)+1)}let r,i=0;for(let[o,a]of e)a>i&&(i=a,r=o);return r}function md(t,n=$b){let e=[],r,i=!1;for(let o of t)i&&e.push(n(r,o)),r=o,i=!0;return e}function $b(t,n){return[t,n]}function ar(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=Math.max(0,Math.ceil((n-t)/e))|0,o=new Array(i);++r<i;)o[r]=t+r*e;return o}var RM=Sb(Math.random);function Sb(t){return function(e,r=0,i=e.length){let o=i-(r=+r);for(;o;){let a=t()*o--|0,c=e[o+r];e[o+r]=e[a+r],e[a+r]=c}return e}}function bn(t,n){let e=0;if(n===void 0)for(let r of t)(r=+r)&&(e+=r);else{let r=-1;for(let i of t)(i=+n(i,++r,t))&&(e+=i)}return e}function Vr(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function kb(t){return t}var uc=1,sc=2,fc=3,oo=4,pd=1e-6;function Ab(t){return"translate("+t+",0)"}function Tb(t){return"translate(0,"+t+")"}function Cb(t){return n=>+t(n)}function Eb(t,n){return n=Math.max(0,t.bandwidth()-n*2)/2,t.round()&&(n=Math.round(n)),e=>+t(e)+n}function Nb(){return!this.__axis}function Lb(t,n){var e=[],r=null,i=null,o=6,a=6,c=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,s=t===uc||t===oo?-1:1,f=t===oo||t===sc?"x":"y",d=t===uc||t===fc?Ab:Tb;function l(h){var p=r??(n.ticks?n.ticks.apply(n,e):n.domain()),g=i??(n.tickFormat?n.tickFormat.apply(n,e):kb),b=Math.max(o,0)+c,v=n.range(),w=+v[0]+u,S=+v[v.length-1]+u,m=(n.bandwidth?Eb:Cb)(n.copy(),u),x=h.selection?h.selection():h,y=x.selectAll(".domain").data([null]),M=x.selectAll(".tick").data(p,n).order(),_=M.exit(),$=M.enter().append("g").attr("class","tick"),A=M.select("line"),k=M.select("text");y=y.merge(y.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),M=M.merge($),A=A.merge($.append("line").attr("stroke","currentColor").attr(f+"2",s*o)),k=k.merge($.append("text").attr("fill","currentColor").attr(f,s*b).attr("dy",t===uc?"0em":t===fc?"0.71em":"0.32em")),h!==x&&(y=y.transition(h),M=M.transition(h),A=A.transition(h),k=k.transition(h),_=_.transition(h).attr("opacity",pd).attr("transform",function(C){return isFinite(C=m(C))?d(C+u):this.getAttribute("transform")}),$.attr("opacity",pd).attr("transform",function(C){var z=this.parentNode.__axis;return d((z&&isFinite(z=z(C))?z:m(C))+u)})),_.remove(),y.attr("d",t===oo||t===sc?a?"M"+s*a+","+w+"H"+u+"V"+S+"H"+s*a:"M"+u+","+w+"V"+S:a?"M"+w+","+s*a+"V"+u+"H"+S+"V"+s*a:"M"+w+","+u+"H"+S),M.attr("opacity",1).attr("transform",function(C){return d(m(C)+u)}),A.attr(f+"2",s*o),k.attr(f,s*b).text(g),x.filter(Nb).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===sc?"start":t===oo?"end":"middle"),x.each(function(){this.__axis=m})}return l.scale=function(h){return arguments.length?(n=h,l):n},l.ticks=function(){return e=Array.from(arguments),l},l.tickArguments=function(h){return arguments.length?(e=h==null?[]:Array.from(h),l):e.slice()},l.tickValues=function(h){return arguments.length?(r=h==null?null:Array.from(h),l):r&&r.slice()},l.tickFormat=function(h){return arguments.length?(i=h,l):i},l.tickSize=function(h){return arguments.length?(o=a=+h,l):o},l.tickSizeInner=function(h){return arguments.length?(o=+h,l):o},l.tickSizeOuter=function(h){return arguments.length?(a=+h,l):a},l.tickPadding=function(h){return arguments.length?(c=+h,l):c},l.offset=function(h){return arguments.length?(u=+h,l):u},l}function gd(t){return Lb(fc,t)}var lc="http://www.w3.org/1999/xhtml",Me={svg:"http://www.w3.org/2000/svg",xhtml:lc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function yd(t){var n=t+="",e=n.indexOf(":");return e>=0&&(n=t.slice(0,e))!=="xmlns"&&(t=t.slice(e+1)),Me.hasOwnProperty(n)?{space:Me[n],local:t}:t}function Pb(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===lc&&n.documentElement.namespaceURI===lc?n.createElement(t):n.createElementNS(e,t)}}function Rb(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function jr(t){var n=yd(t);return(n.local?Rb:Pb)(n)}function Db(){}function bd(t){return t==null?Db:function(){return this.querySelector(t)}}function Ob(t){typeof t!="function"&&(t=bd(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],a=o.length,c=r[i]=new Array(a),u,s,f=0;f<a;++f)(u=o[f])&&(s=t.call(u,u.__data__,f,o))&&("__data__"in u&&(s.__data__=u.__data__),c[f]=s);return new Vt(r,this._parents)}function Ib(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function zb(){return[]}function Fb(t){return t==null?zb:function(){return this.querySelectorAll(t)}}function qb(t){return function(){return Ib(t.apply(this,arguments))}}function Bb(t){typeof t=="function"?t=qb(t):t=Fb(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a=n[o],c=a.length,u,s=0;s<c;++s)(u=a[s])&&(r.push(t.call(u,u.__data__,s,a)),i.push(u));return new Vt(r,i)}function Yb(t){return function(){return this.matches(t)}}function xd(t){return function(n){return n.matches(t)}}var Wb=Array.prototype.find;function Hb(t){return function(){return Wb.call(this.children,t)}}function Ub(){return this.firstElementChild}function Gb(t){return this.select(t==null?Ub:Hb(typeof t=="function"?t:xd(t)))}var Xb=Array.prototype.filter;function Vb(){return Array.from(this.children)}function jb(t){return function(){return Xb.call(this.children,t)}}function Zb(t){return this.selectAll(t==null?Vb:jb(typeof t=="function"?t:xd(t)))}function Kb(t){typeof t!="function"&&(t=Yb(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],a=o.length,c=r[i]=[],u,s=0;s<a;++s)(u=o[s])&&t.call(u,u.__data__,s,o)&&c.push(u);return new Vt(r,this._parents)}function wd(t){return new Array(t.length)}function Qb(){return new Vt(this._enter||this._groups.map(wd),this._parents)}function ao(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}ao.prototype={constructor:ao,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Jb(t){return function(){return t}}function t2(t,n,e,r,i,o){for(var a=0,c,u=n.length,s=o.length;a<s;++a)(c=n[a])?(c.__data__=o[a],r[a]=c):e[a]=new ao(t,o[a]);for(;a<u;++a)(c=n[a])&&(i[a]=c)}function n2(t,n,e,r,i,o,a){var c,u,s=new Map,f=n.length,d=o.length,l=new Array(f),h;for(c=0;c<f;++c)(u=n[c])&&(l[c]=h=a.call(u,u.__data__,c,n)+"",s.has(h)?i[c]=u:s.set(h,u));for(c=0;c<d;++c)h=a.call(t,o[c],c,o)+"",(u=s.get(h))?(r[c]=u,u.__data__=o[c],s.delete(h)):e[c]=new ao(t,o[c]);for(c=0;c<f;++c)(u=n[c])&&s.get(l[c])===u&&(i[c]=u)}function e2(t){return t.__data__}function r2(t,n){if(!arguments.length)return Array.from(this,e2);var e=n?n2:t2,r=this._parents,i=this._groups;typeof t!="function"&&(t=Jb(t));for(var o=i.length,a=new Array(o),c=new Array(o),u=new Array(o),s=0;s<o;++s){var f=r[s],d=i[s],l=d.length,h=i2(t.call(f,f&&f.__data__,s,r)),p=h.length,g=c[s]=new Array(p),b=a[s]=new Array(p),v=u[s]=new Array(l);e(f,d,g,b,v,h,n);for(var w=0,S=0,m,x;w<p;++w)if(m=g[w]){for(w>=S&&(S=w+1);!(x=b[S])&&++S<p;);m._next=x||null}}return a=new Vt(a,r),a._enter=c,a._exit=u,a}function i2(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function o2(){return new Vt(this._exit||this._groups.map(wd),this._parents)}function a2(t,n,e){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),n!=null&&(i=n(i),i&&(i=i.selection())),e==null?o.remove():e(o),r&&i?r.merge(i).order():i}function c2(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,a=Math.min(i,o),c=new Array(i),u=0;u<a;++u)for(var s=e[u],f=r[u],d=s.length,l=c[u]=new Array(d),h,p=0;p<d;++p)(h=s[p]||f[p])&&(l[p]=h);for(;u<i;++u)c[u]=e[u];return new Vt(c,this._parents)}function u2(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r=t[n],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 s2(t){t||(t=f2);function n(d,l){return d&&l?t(d.__data__,l.__data__):!d-!l}for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a=e[o],c=a.length,u=i[o]=new Array(c),s,f=0;f<c;++f)(s=a[f])&&(u[f]=s);u.sort(n)}return new Vt(i,this._parents).order()}function f2(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function l2(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function d2(){return Array.from(this)}function h2(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function m2(){let t=0;for(let n of this)++t;return t}function p2(){return!this.node()}function g2(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i=n[e],o=0,a=i.length,c;o<a;++o)(c=i[o])&&t.call(c,c.__data__,o,i);return this}function y2(t){return function(){this.removeAttribute(t)}}function b2(t){return function(){this.removeAttributeNS(t.space,t.local)}}function x2(t,n){return function(){this.setAttribute(t,n)}}function w2(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function v2(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}}function M2(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function _2(t,n){var e=yd(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((n==null?e.local?b2:y2:typeof n=="function"?e.local?M2:v2:e.local?w2:x2)(e,n))}function vd(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function $2(t){return function(){this.style.removeProperty(t)}}function S2(t,n,e){return function(){this.style.setProperty(t,n,e)}}function k2(t,n,e){return function(){var r=n.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function A2(t,n,e){return arguments.length>1?this.each((n==null?$2:typeof n=="function"?k2:S2)(t,n,e??"")):T2(this.node(),t)}function T2(t,n){return t.style.getPropertyValue(n)||vd(t).getComputedStyle(t,null).getPropertyValue(n)}function C2(t){return function(){delete this[t]}}function E2(t,n){return function(){this[t]=n}}function N2(t,n){return function(){var e=n.apply(this,arguments);e==null?delete this[t]:this[t]=e}}function L2(t,n){return arguments.length>1?this.each((n==null?C2:typeof n=="function"?N2:E2)(t,n)):this.node()[t]}function Md(t){return t.trim().split(/^|\s+/)}function hc(t){return t.classList||new _d(t)}function _d(t){this._node=t,this._names=Md(t.getAttribute("class")||"")}_d.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function $d(t,n){for(var e=hc(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function Sd(t,n){for(var e=hc(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function P2(t){return function(){$d(this,t)}}function R2(t){return function(){Sd(this,t)}}function D2(t,n){return function(){(n.apply(this,arguments)?$d:Sd)(this,t)}}function O2(t,n){var e=Md(t+"");if(arguments.length<2){for(var r=hc(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each((typeof n=="function"?D2:n?P2:R2)(e,n))}function I2(){this.textContent=""}function z2(t){return function(){this.textContent=t}}function F2(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function q2(t){return arguments.length?this.each(t==null?I2:(typeof t=="function"?F2:z2)(t)):this.node().textContent}function B2(){this.innerHTML=""}function Y2(t){return function(){this.innerHTML=t}}function W2(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function H2(t){return arguments.length?this.each(t==null?B2:(typeof t=="function"?W2:Y2)(t)):this.node().innerHTML}function U2(){this.nextSibling&&this.parentNode.appendChild(this)}function G2(){return this.each(U2)}function X2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function V2(){return this.each(X2)}function j2(t){var n=typeof t=="function"?t:jr(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function Z2(){return null}function K2(t,n){var e=typeof t=="function"?t:jr(t),r=n==null?Z2:typeof n=="function"?n:bd(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function Q2(){var t=this.parentNode;t&&t.removeChild(this)}function J2(){return this.each(Q2)}function tx(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function nx(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ex(t){return this.select(t?nx:tx)}function rx(t){return arguments.length?this.property("__data__",t):this.node().__data__}function ix(t){return function(n){t.call(this,n,this.__data__)}}function ox(t){return t.trim().split(/^|\s+/).map(function(n){var e="",r=n.indexOf(".");return r>=0&&(e=n.slice(r+1),n=n.slice(0,r)),{type:n,name:e}})}function ax(t){return function(){var n=this.__on;if(n){for(var e=0,r=-1,i=n.length,o;e<i;++e)o=n[e],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):n[++r]=o;++r?n.length=r:delete this.__on}}}function cx(t,n,e){return function(){var r=this.__on,i,o=ix(n);if(r){for(var a=0,c=r.length;a<c;++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=e),i.value=n;return}}this.addEventListener(t.type,o,e),i={type:t.type,name:t.name,value:n,listener:o,options:e},r?r.push(i):this.__on=[i]}}function ux(t,n,e){var r=ox(t+""),i,o=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,s=c.length,f;u<s;++u)for(i=0,f=c[u];i<o;++i)if((a=r[i]).type===f.type&&a.name===f.name)return f.value}return}for(c=n?cx:ax,i=0;i<o;++i)this.each(c(r[i],n,e));return this}function kd(t,n,e){var r=vd(t),i=r.CustomEvent;typeof i=="function"?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function sx(t,n){return function(){return kd(this,t,n)}}function fx(t,n){return function(){return kd(this,t,n.apply(this,arguments))}}function lx(t,n){return this.each((typeof n=="function"?fx:sx)(t,n))}function*dx(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var Ad=[null];function Vt(t,n){this._groups=t,this._parents=n}function hx(){return new Vt([[document.documentElement]],Ad)}function mx(){return this}Vt.prototype=hx.prototype={constructor:Vt,select:Ob,selectAll:Bb,selectChild:Gb,selectChildren:Zb,filter:Kb,data:r2,enter:Qb,exit:o2,join:a2,merge:c2,selection:mx,order:u2,sort:s2,call:l2,nodes:d2,node:h2,size:m2,empty:p2,each:g2,attr:_2,style:A2,property:L2,classed:O2,text:q2,html:H2,raise:G2,lower:V2,append:j2,insert:K2,remove:J2,clone:ex,datum:rx,on:ux,dispatch:lx,[Symbol.iterator]:dx};function Dn(t){return typeof t=="string"?new Vt([[document.querySelector(t)]],[document.documentElement]):new Vt([[t]],Ad)}var px=0;function gx(){return new dc}function dc(){this._="@"+(++px).toString(36)}dc.prototype=gx.prototype={constructor:dc,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};function yx(t){let n;for(;n=t.sourceEvent;)t=n;return t}function Td(t,n){if(t=yx(t),n===void 0&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]}function fr(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Qr(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function ne(){}var ke=.7,sr=1/ke,cr="\\s*([+-]?\\d+)\\s*",Zr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bx=/^#([0-9a-f]{3,8})$/,xx=new RegExp(`^rgb\\(${cr},${cr},${cr}\\)$`),wx=new RegExp(`^rgb\\(${xn},${xn},${xn}\\)$`),vx=new RegExp(`^rgba\\(${cr},${cr},${cr},${Zr}\\)$`),Mx=new RegExp(`^rgba\\(${xn},${xn},${xn},${Zr}\\)$`),_x=new RegExp(`^hsl\\(${Zr},${xn},${xn}\\)$`),$x=new RegExp(`^hsla\\(${Zr},${xn},${xn},${Zr}\\)$`),Cd={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};fr(ne,lr,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ed,formatHex:Ed,formatHex8:Sx,formatHsl:kx,formatRgb:Nd,toString:Nd});function Ed(){return this.rgb().formatHex()}function Sx(){return this.rgb().formatHex8()}function kx(){return qd(this).formatHsl()}function Nd(){return this.rgb().formatRgb()}function lr(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=bx.exec(t))?(e=n[1].length,n=parseInt(n[1],16),e===6?Ld(n):e===3?new vt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):e===8?co(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):e===4?co(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=xx.exec(t))?new vt(n[1],n[2],n[3],1):(n=wx.exec(t))?new vt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=vx.exec(t))?co(n[1],n[2],n[3],n[4]):(n=Mx.exec(t))?co(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=_x.exec(t))?Dd(n[1],n[2]/100,n[3]/100,1):(n=$x.exec(t))?Dd(n[1],n[2]/100,n[3]/100,n[4]):Cd.hasOwnProperty(t)?Ld(Cd[t]):t==="transparent"?new vt(NaN,NaN,NaN,0):null}function Ld(t){return new vt(t>>16&255,t>>8&255,t&255,1)}function co(t,n,e,r){return r<=0&&(t=n=e=NaN),new vt(t,n,e,r)}function xc(t){return t instanceof ne||(t=lr(t)),t?(t=t.rgb(),new vt(t.r,t.g,t.b,t.opacity)):new vt}function Ae(t,n,e,r){return arguments.length===1?xc(t):new vt(t,n,e,r??1)}function vt(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}fr(vt,Ae,Qr(ne,{brighter(t){return t=t==null?sr:Math.pow(sr,t),new vt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ke:Math.pow(ke,t),new vt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new vt($e(this.r),$e(this.g),$e(this.b),so(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:Pd,formatHex:Pd,formatHex8:Ax,formatRgb:Rd,toString:Rd}));function Pd(){return`#${_e(this.r)}${_e(this.g)}${_e(this.b)}`}function Ax(){return`#${_e(this.r)}${_e(this.g)}${_e(this.b)}${_e((isNaN(this.opacity)?1:this.opacity)*255)}`}function Rd(){let t=so(this.opacity);return`${t===1?"rgb(":"rgba("}${$e(this.r)}, ${$e(this.g)}, ${$e(this.b)}${t===1?")":`, ${t})`}`}function so(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function $e(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _e(t){return t=$e(t),(t<16?"0":"")+t.toString(16)}function Dd(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new ln(t,n,e,r)}function qd(t){if(t instanceof ln)return new ln(t.h,t.s,t.l,t.opacity);if(t instanceof ne||(t=lr(t)),!t)return new ln;if(t instanceof ln)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,c=o-i,u=(o+i)/2;return c?(n===o?a=(e-r)/c+(e<r)*6:e===o?a=(r-n)/c+2:a=(n-e)/c+4,c/=u<.5?o+i:2-o-i,a*=60):c=u>0&&u<1?0:a,new ln(a,c,u,t.opacity)}function lo(t,n,e,r){return arguments.length===1?qd(t):new ln(t,n,e,r??1)}function ln(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}fr(ln,lo,Qr(ne,{brighter(t){return t=t==null?sr:Math.pow(sr,t),new ln(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ke:Math.pow(ke,t),new ln(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new vt(mc(t>=240?t-240:t+120,i,r),mc(t,i,r),mc(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new ln(Od(this.h),uo(this.s),uo(this.l),so(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=so(this.opacity);return`${t===1?"hsl(":"hsla("}${Od(this.h)}, ${uo(this.s)*100}%, ${uo(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Od(t){return t=(t||0)%360,t<0?t+360:t}function uo(t){return Math.max(0,Math.min(1,t||0))}function mc(t,n,e){return(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)*255}var Bd=Math.PI/180,Yd=180/Math.PI,fo=18,Wd=.96422,Hd=1,Ud=.82521,Gd=4/29,ur=6/29,Xd=3*ur*ur,Tx=ur*ur*ur;function Vd(t){if(t instanceof wn)return new wn(t.l,t.a,t.b,t.opacity);if(t instanceof On)return jd(t);t instanceof vt||(t=xc(t));var n=bc(t.r),e=bc(t.g),r=bc(t.b),i=pc((.2225045*n+.7168786*e+.0606169*r)/Hd),o,a;return n===e&&e===r?o=a=i:(o=pc((.4360747*n+.3850649*e+.1430804*r)/Wd),a=pc((.0139322*n+.0971045*e+.7141733*r)/Ud)),new wn(116*i-16,500*(o-i),200*(i-a),t.opacity)}function ho(t,n,e,r){return arguments.length===1?Vd(t):new wn(t,n,e,r??1)}function wn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}fr(wn,ho,Qr(ne,{brighter(t){return new wn(this.l+fo*(t??1),this.a,this.b,this.opacity)},darker(t){return new wn(this.l-fo*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return n=Wd*gc(n),t=Hd*gc(t),e=Ud*gc(e),new vt(yc(3.1338561*n-1.6168667*t-.4906146*e),yc(-.9787684*n+1.9161415*t+.033454*e),yc(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}}));function pc(t){return t>Tx?Math.pow(t,1/3):t/Xd+Gd}function gc(t){return t>ur?t*t*t:Xd*(t-Gd)}function yc(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function bc(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Cx(t){if(t instanceof On)return new On(t.h,t.c,t.l,t.opacity);if(t instanceof wn||(t=Vd(t)),t.a===0&&t.b===0)return new On(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*Yd;return new On(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function mo(t,n,e,r){return arguments.length===1?Cx(t):new On(t,n,e,r??1)}function On(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function jd(t){if(isNaN(t.h))return new wn(t.l,0,0,t.opacity);var n=t.h*Bd;return new wn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}fr(On,mo,Qr(ne,{brighter(t){return new On(this.h,this.c,this.l+fo*(t??1),this.opacity)},darker(t){return new On(this.h,this.c,this.l-fo*(t??1),this.opacity)},rgb(){return jd(this).rgb()}}));var Zd=-.14861,wc=1.78277,vc=-.29227,po=-.90649,Kr=1.97294,Id=Kr*po,zd=Kr*wc,Fd=wc*vc-po*Zd;function Ex(t){if(t instanceof Se)return new Se(t.h,t.s,t.l,t.opacity);t instanceof vt||(t=xc(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Fd*r+Id*n-zd*e)/(Fd+Id-zd),o=r-i,a=(Kr*(e-i)-vc*o)/po,c=Math.sqrt(a*a+o*o)/(Kr*i*(1-i)),u=c?Math.atan2(a,o)*Yd-120:NaN;return new Se(u<0?u+360:u,c,i,t.opacity)}function Jt(t,n,e,r){return arguments.length===1?Ex(t):new Se(t,n,e,r??1)}function Se(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}fr(Se,Jt,Qr(ne,{brighter(t){return t=t==null?sr:Math.pow(sr,t),new Se(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ke:Math.pow(ke,t),new Se(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Bd,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new vt(255*(n+e*(Zd*r+wc*i)),255*(n+e*(vc*r+po*i)),255*(n+e*(Kr*r)),this.opacity)}}));function Jd(t,n,e,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*n+(4-6*o+3*a)*e+(1+3*t+3*o-3*a)*r+a*i)/6}function Nx(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,c=r<n-1?t[r+2]:2*o-i;return Jd((e-r/n)*n,a,i,o,c)}}function Lx(t){var n=t.length;return function(e){var r=Math.floor(((e%=1)<0?++e:e)*n),i=t[(r+n-1)%n],o=t[r%n],a=t[(r+1)%n],c=t[(r+2)%n];return Jd((e-r/n)*n,i,o,a,c)}}var yo=t=>()=>t;function th(t,n){return function(e){return t+e*n}}function Px(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function Sc(t,n){var e=n-t;return e?th(t,e>180||e<-180?e-360*Math.round(e/360):e):yo(isNaN(t)?n:t)}function Rx(t){return(t=+t)==1?Mt:function(n,e){return e-n?Px(n,e,t):yo(isNaN(n)?e:n)}}function Mt(t,n){var e=n-t;return e?th(t,e):yo(isNaN(t)?n:t)}var dr=(function t(n){var e=Rx(n);function r(i,o){var a=e((i=Ae(i)).r,(o=Ae(o)).r),c=e(i.g,o.g),u=e(i.b,o.b),s=Mt(i.opacity,o.opacity);return function(f){return i.r=a(f),i.g=c(f),i.b=u(f),i.opacity=s(f),i+""}}return r.gamma=t,r})(1);function nh(t){return function(n){var e=n.length,r=new Array(e),i=new Array(e),o=new Array(e),a,c;for(a=0;a<e;++a)c=Ae(n[a]),r[a]=c.r||0,i[a]=c.g||0,o[a]=c.b||0;return r=t(r),i=t(i),o=t(o),c.opacity=1,function(u){return c.r=r(u),c.g=i(u),c.b=o(u),c+""}}}var eh=nh(Nx),qM=nh(Lx);function Dx(t,n){n||(n=[]);var e=t?Math.min(n.length,t.length):0,r=n.slice(),i;return function(o){for(i=0;i<e;++i)r[i]=t[i]*(1-o)+n[i]*o;return r}}function Ox(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ix(t,n){var e=n?n.length:0,r=t?Math.min(e,t.length):0,i=new Array(r),o=new Array(e),a;for(a=0;a<r;++a)i[a]=hr(t[a],n[a]);for(;a<e;++a)o[a]=n[a];return function(c){for(a=0;a<r;++a)o[a]=i[a](c);return o}}function zx(t,n){var e=new Date;return t=+t,n=+n,function(r){return e.setTime(t*(1-r)+n*r),e}}function kt(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function Fx(t,n){var e={},r={},i;(t===null||typeof t!="object")&&(t={}),(n===null||typeof n!="object")&&(n={});for(i in n)i in t?e[i]=hr(t[i],n[i]):r[i]=n[i];return function(o){for(i in e)r[i]=e[i](o);return r}}var _c=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mc=new RegExp(_c.source,"g");function qx(t){return function(){return t}}function Bx(t){return function(n){return t(n)+""}}function Yx(t,n){var e=_c.lastIndex=Mc.lastIndex=0,r,i,o,a=-1,c=[],u=[];for(t=t+"",n=n+"";(r=_c.exec(t))&&(i=Mc.exec(n));)(o=i.index)>e&&(o=n.slice(e,o),c[a]?c[a]+=o:c[++a]=o),(r=r[0])===(i=i[0])?c[a]?c[a]+=i:c[++a]=i:(c[++a]=null,u.push({i:a,x:kt(r,i)})),e=Mc.lastIndex;return e<n.length&&(o=n.slice(e),c[a]?c[a]+=o:c[++a]=o),c.length<2?u[0]?Bx(u[0].x):qx(n):(n=u.length,function(s){for(var f=0,d;f<n;++f)c[(d=u[f]).i]=d.x(s);return c.join("")})}function hr(t,n){var e=typeof n,r;return n==null||e==="boolean"?yo(n):(e==="number"?kt:e==="string"?(r=lr(n))?(n=r,dr):Yx:n instanceof lr?dr:n instanceof Date?zx:Ox(n)?Dx:Array.isArray(n)?Ix:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?Fx:kt)(t,n)}function Jr(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}var Kd=180/Math.PI,$c={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function rh(t,n,e,r,i,o){var a,c,u;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(u=t*e+n*r)&&(e-=t*u,r-=n*u),(c=Math.sqrt(e*e+r*r))&&(e/=c,r/=c,u/=c),t*r<n*e&&(t=-t,n=-n,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Kd,skewX:Math.atan(u)*Kd,scaleX:a,scaleY:c}}var go;function Wx(t){let n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?$c:rh(n.a,n.b,n.c,n.d,n.e,n.f)}function Hx(t){return t==null||(go||(go=document.createElementNS("http://www.w3.org/2000/svg","g")),go.setAttribute("transform",t),!(t=go.transform.baseVal.consolidate()))?$c:(t=t.matrix,rh(t.a,t.b,t.c,t.d,t.e,t.f))}function ih(t,n,e,r){function i(s){return s.length?s.pop()+" ":""}function o(s,f,d,l,h,p){if(s!==d||f!==l){var g=h.push("translate(",null,n,null,e);p.push({i:g-4,x:kt(s,d)},{i:g-2,x:kt(f,l)})}else(d||l)&&h.push("translate("+d+n+l+e)}function a(s,f,d,l){s!==f?(s-f>180?f+=360:f-s>180&&(s+=360),l.push({i:d.push(i(d)+"rotate(",null,r)-2,x:kt(s,f)})):f&&d.push(i(d)+"rotate("+f+r)}function c(s,f,d,l){s!==f?l.push({i:d.push(i(d)+"skewX(",null,r)-2,x:kt(s,f)}):f&&d.push(i(d)+"skewX("+f+r)}function u(s,f,d,l,h,p){if(s!==d||f!==l){var g=h.push(i(h)+"scale(",null,",",null,")");p.push({i:g-4,x:kt(s,d)},{i:g-2,x:kt(f,l)})}else(d!==1||l!==1)&&h.push(i(h)+"scale("+d+","+l+")")}return function(s,f){var d=[],l=[];return s=t(s),f=t(f),o(s.translateX,s.translateY,f.translateX,f.translateY,d,l),a(s.rotate,f.rotate,d,l),c(s.skewX,f.skewX,d,l),u(s.scaleX,s.scaleY,f.scaleX,f.scaleY,d,l),s=f=null,function(h){for(var p=-1,g=l.length,b;++p<g;)d[(b=l[p]).i]=b.x(h);return d.join("")}}}var BM=ih(Wx,"px, ","px)","deg)"),YM=ih(Hx,", ",")",")"),Ux=1e-12;function Qd(t){return((t=Math.exp(t))+1/t)/2}function Gx(t){return((t=Math.exp(t))-1/t)/2}function Xx(t){return((t=Math.exp(2*t))-1)/(t+1)}var WM=(function t(n,e,r){function i(o,a){var c=o[0],u=o[1],s=o[2],f=a[0],d=a[1],l=a[2],h=f-c,p=d-u,g=h*h+p*p,b,v;if(g<Ux)v=Math.log(l/s)/n,b=function(M){return[c+M*h,u+M*p,s*Math.exp(n*M*v)]};else{var w=Math.sqrt(g),S=(l*l-s*s+r*g)/(2*s*e*w),m=(l*l-s*s-r*g)/(2*l*e*w),x=Math.log(Math.sqrt(S*S+1)-S),y=Math.log(Math.sqrt(m*m+1)-m);v=(y-x)/n,b=function(M){var _=M*v,$=Qd(x),A=s/(e*w)*($*Xx(n*_+x)-Gx(x));return[c+A*h,u+A*p,s*$/Qd(n*_+x)]}}return b.duration=Math.abs(v)*1e3*n/Math.SQRT2,b}return i.rho=function(o){var a=Math.max(.001,+o),c=a*a,u=c*c;return t(a,c,u)},i})(Math.SQRT2,2,4);function oh(t){return function(n,e){var r=t((n=lo(n)).h,(e=lo(e)).h),i=Mt(n.s,e.s),o=Mt(n.l,e.l),a=Mt(n.opacity,e.opacity);return function(c){return n.h=r(c),n.s=i(c),n.l=o(c),n.opacity=a(c),n+""}}}var ah=oh(Sc),HM=oh(Mt);function ch(t,n){var e=Mt((t=ho(t)).l,(n=ho(n)).l),r=Mt(t.a,n.a),i=Mt(t.b,n.b),o=Mt(t.opacity,n.opacity);return function(a){return t.l=e(a),t.a=r(a),t.b=i(a),t.opacity=o(a),t+""}}function uh(t){return function(n,e){var r=t((n=mo(n)).h,(e=mo(e)).h),i=Mt(n.c,e.c),o=Mt(n.l,e.l),a=Mt(n.opacity,e.opacity);return function(c){return n.h=r(c),n.c=i(c),n.l=o(c),n.opacity=a(c),n+""}}}var sh=uh(Sc),UM=uh(Mt);function fh(t){return(function n(e){e=+e;function r(i,o){var a=t((i=Jt(i)).h,(o=Jt(o)).h),c=Mt(i.s,o.s),u=Mt(i.l,o.l),s=Mt(i.opacity,o.opacity);return function(f){return i.h=a(f),i.s=c(f),i.l=u(Math.pow(f,e)),i.opacity=s(f),i+""}}return r.gamma=n,r})(1)}var GM=fh(Sc),bo=fh(Mt);function mr(t,n){n===void 0&&(n=t,t=hr);for(var e=0,r=n.length-1,i=n[0],o=new Array(r<0?0:r);e<r;)o[e]=t(i,i=n[++e]);return function(a){var c=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[c](a-c)}}function jt(t,n){for(var e=new Array(n),r=0;r<n;++r)e[r]=t(r/(n-1));return e}var ti=Math.PI,kc=2*ti,Te=1e-6,Vx=kc-Te;function lh(t){this._+=t[0];for(let n=1,e=t.length;n<e;++n)this._+=arguments[n]+t[n]}function jx(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return lh;let e=10**n;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*e)/e+r[i]}}function dh(t,n,e,r){return t===e&&n===r}function Zx(t){let n=Math.floor(t);if(!(n<=15))return dh;let e=10**n,r=function(i){return Math.round(i*e)};return function(i,o,a,c){return r(i)===r(a)&&r(o)===r(c)}}var Ce=class{constructor(n){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=n==null?lh:jx(n),this._equal=n==null?dh:Zx(n)}moveTo(n,e){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(n,e){this._append`L${this._x1=+n},${this._y1=+e}`}quadraticCurveTo(n,e,r,i){this._append`Q${+n},${+e},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(n,e,r,i,o,a){this._append`C${+n},${+e},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(n,e,r,i,o){if(n=+n,e=+e,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,c=this._y1,u=r-n,s=i-e,f=a-n,d=c-e,l=f*f+d*d;if(this._x1===null)this._append`M${this._x1=n},${this._y1=e}`;else if(l>Te)if(!(Math.abs(d*u-s*f)>Te)||!o)this._append`L${this._x1=n},${this._y1=e}`;else{let h=r-a,p=i-c,g=u*u+s*s,b=h*h+p*p,v=Math.sqrt(g),w=Math.sqrt(l),S=o*Math.tan((ti-Math.acos((g+l-b)/(2*v*w)))/2),m=S/w,x=S/v;Math.abs(m-1)>Te&&this._append`L${n+m*f},${e+m*d}`,this._append`A${o},${o},0,0,${+(d*h>f*p)},${this._x1=n+x*u},${this._y1=e+x*s}`}}arc(n,e,r,i,o,a){if(n=+n,e=+e,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),u=r*Math.sin(i),s=n+c,f=e+u,d=1^a,l=a?i-o:o-i;if(this._x1===null?this._append`M${s},${f}`:(Math.abs(this._x1-s)>Te||Math.abs(this._y1-f)>Te)&&this._append`L${s},${f}`,!!r){if(l<0&&(l=l%kc+kc),l>Vx)this._append`A${r},${r},0,1,${d},${n-c},${e-u}A${r},${r},0,1,${d},${this._x1=s},${this._y1=f}`;else if(l>Te){let h=n+r*Math.cos(o),p=e+r*Math.sin(o);if(l>=ti&&this._equal(s,f,h,p)){l/=2;let g=i+l;this._append`A${r},${r},0,${+(l>=ti)},${d},${n+r*Math.cos(g)},${e+r*Math.sin(g)}`}this._append`A${r},${r},0,${+(l>=ti)},${d},${this._x1=h},${this._y1=p}`}}}rect(n,e,r,i){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Kx(){return new Ce}Kx.prototype=Ce.prototype;function In(t=3){return new Ce(+t)}function Qx(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function wo(t,n){if(!isFinite(t)||t===0)return null;var e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"),r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function pr(t){return t=wo(Math.abs(t)),t?t[1]:NaN}function Jx(t,n){return function(e,r){for(var i=e.length,o=[],a=0,c=t[0],u=0;i>0&&c>0&&(u+c+1>r&&(c=Math.max(1,r-u)),o.push(e.substring(i-=c,i+c)),!((u+=c+1)>r));)c=t[a=(a+1)%t.length];return o.reverse().join(n)}}function tw(t){return function(n){return n.replace(/[0-9]/g,function(e){return t[+e]})}}var nw=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function gr(t){if(!(n=nw.exec(t)))throw new Error("invalid format: "+t);var n;return new Ac({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}gr.prototype=Ac.prototype;function Ac(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+""}Ac.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 ew(t){t:for(var n=t.length,e=1,r=-1,i;e<n;++e)switch(t[e]){case".":r=i=e;break;case"0":r===0&&(r=e),i=e;break;default:if(!+t[e])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var vo;function rw(t,n){var e=wo(t,n);if(!e)return vo=void 0,t.toPrecision(n);var r=e[0],i=e[1],o=i-(vo=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")+wo(t,Math.max(0,n+o-1))[0]}function hh(t,n){var e=wo(t,n);if(!e)return t+"";var r=e[0],i=e[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")}var mh={"%":(t,n)=>(t*100).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Qx,e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>hh(t*100,n),r:hh,s:rw,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ph(t){return t}var gh=Array.prototype.map,yh=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function iw(t){var n=t.grouping===void 0||t.thousands===void 0?ph:Jx(gh.call(t.grouping,Number),t.thousands+""),e=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?ph:tw(gh.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",c=t.minus===void 0?"\u2212":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function s(d,l){d=gr(d);var h=d.fill,p=d.align,g=d.sign,b=d.symbol,v=d.zero,w=d.width,S=d.comma,m=d.precision,x=d.trim,y=d.type;y==="n"?(S=!0,y="g"):mh[y]||(m===void 0&&(m=12),x=!0,y="g"),(v||h==="0"&&p==="=")&&(v=!0,h="0",p="=");var M=(l&&l.prefix!==void 0?l.prefix:"")+(b==="$"?e:b==="#"&&/[boxX]/.test(y)?"0"+y.toLowerCase():""),_=(b==="$"?r:/[%p]/.test(y)?a:"")+(l&&l.suffix!==void 0?l.suffix:""),$=mh[y],A=/[defgprs%]/.test(y);m=m===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m));function k(C){var z=M,L=_,T,B,D;if(y==="c")L=$(C)+L,C="";else{C=+C;var H=C<0||1/C<0;if(C=isNaN(C)?u:$(Math.abs(C),m),x&&(C=ew(C)),H&&+C==0&&g!=="+"&&(H=!1),z=(H?g==="("?g:c:g==="-"||g==="("?"":g)+z,L=(y==="s"&&!isNaN(C)&&vo!==void 0?yh[8+vo/3]:"")+L+(H&&g==="("?")":""),A){for(T=-1,B=C.length;++T<B;)if(D=C.charCodeAt(T),48>D||D>57){L=(D===46?i+C.slice(T+1):C.slice(T))+L,C=C.slice(0,T);break}}}S&&!v&&(C=n(C,1/0));var O=z.length+C.length+L.length,Y=O<w?new Array(w-O+1).join(h):"";switch(S&&v&&(C=n(Y+C,Y.length?w-L.length:1/0),Y=""),p){case"<":C=z+C+L+Y;break;case"=":C=z+Y+C+L;break;case"^":C=Y.slice(0,O=Y.length>>1)+z+C+L+Y.slice(O);break;default:C=Y+z+C+L;break}return o(C)}return k.toString=function(){return d+""},k}function f(d,l){var h=Math.max(-8,Math.min(8,Math.floor(pr(l)/3)))*3,p=Math.pow(10,-h),g=s((d=gr(d),d.type="f",d),{suffix:yh[8+h/3]});return function(b){return g(p*b)}}return{format:s,formatPrefix:f}}var xo,ee,Tc;ow({thousands:",",grouping:[3],currency:["$",""]});function ow(t){return xo=iw(t),ee=xo.format,Tc=xo.formatPrefix,xo}function bh(t){return Math.max(0,-pr(Math.abs(t)))}function xh(t,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(pr(n)/3)))*3-pr(Math.abs(t)))}function wh(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,pr(n)-pr(t))+1}var Q=1e-6,Fh=1e-12,rt=Math.PI,ht=rt/2,vh=rt/4,Zt=rt*2,Rt=180/rt,dt=rt/180,ut=Math.abs,wr=Math.atan,Fn=Math.atan2,et=Math.cos;var qh=Math.exp;var To=Math.log,Cc=Math.pow,J=Math.sin,nn=Math.sign||function(t){return t>0?1:t<0?-1:0},Ft=Math.sqrt,jc=Math.tan;function Bh(t){return t>1?0:t<-1?rt:Math.acos(t)}function rn(t){return t>1?ht:t<-1?-ht:Math.asin(t)}function en(){}function Co(t,n){t&&_h.hasOwnProperty(t.type)&&_h[t.type](t,n)}var Mh={Feature:function(t,n){Co(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)Co(e[r].geometry,n)}},_h={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){Rc(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)Rc(e[r],n,0)},Polygon:function(t,n){$h(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)$h(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)Co(e[r],n)}};function Rc(t,n,e){var r=-1,i=t.length-e,o;for(n.lineStart();++r<i;)o=t[r],n.point(o[0],o[1],o[2]);n.lineEnd()}function $h(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)Rc(t[e],n,1);n.polygonEnd()}function re(t,n){t&&Mh.hasOwnProperty(t.type)?Mh[t.type](t,n):Co(t,n)}var KM=new Qt,QM=new Qt;function Dc(t){return[Fn(t[1],t[0]),rn(t[2])]}function br(t){var n=t[0],e=t[1],r=et(e);return[r*et(n),r*J(n),J(e)]}function Mo(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Eo(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Ec(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function _o(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function Oc(t){var n=Ft(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function Ic(t,n){function e(r,i){return r=t(r,i),n(r[0],r[1])}return t.invert&&n.invert&&(e.invert=function(r,i){return r=n.invert(r,i),r&&t.invert(r[0],r[1])}),e}function zc(t,n){return ut(t)>rt&&(t-=Math.round(t/Zt)*Zt),[t,n]}zc.invert=zc;function Yh(t,n,e){return(t%=Zt)?n||e?Ic(kh(t),Ah(n,e)):kh(t):n||e?Ah(n,e):zc}function Sh(t){return function(n,e){return n+=t,ut(n)>rt&&(n-=Math.round(n/Zt)*Zt),[n,e]}}function kh(t){var n=Sh(t);return n.invert=Sh(-t),n}function Ah(t,n){var e=et(t),r=J(t),i=et(n),o=J(n);function a(c,u){var s=et(u),f=et(c)*s,d=J(c)*s,l=J(u),h=l*e+f*r;return[Fn(d*i-h*o,f*e-l*r),rn(h*i+d*o)]}return a.invert=function(c,u){var s=et(u),f=et(c)*s,d=J(c)*s,l=J(u),h=l*i-d*o;return[Fn(d*i+l*o,f*e+h*r),rn(h*e-f*r)]},a}function aw(t){t=Yh(t[0]*dt,t[1]*dt,t.length>2?t[2]*dt:0);function n(e){return e=t(e[0]*dt,e[1]*dt),e[0]*=Rt,e[1]*=Rt,e}return n.invert=function(e){return e=t.invert(e[0]*dt,e[1]*dt),e[0]*=Rt,e[1]*=Rt,e},n}function cw(t,n,e,r,i,o){if(e){var a=et(n),c=J(n),u=r*e;i==null?(i=n+r*Zt,o=n-u/2):(i=Th(a,i),o=Th(a,o),(r>0?i<o:i>o)&&(i+=r*Zt));for(var s,f=i;r>0?f>o:f<o;f-=u)s=Dc([a,-c*et(f),-c*J(f)]),t.point(s[0],s[1])}}function Th(t,n){n=br(n),n[0]-=t,Oc(n);var e=Bh(-n[1]);return((-n[2]<0?-e:e)+Zt-Q)%Zt}function Wh(){var t=[],n;return{point:function(e,r,i){n.push([e,r,i])},lineStart:function(){t.push(n=[])},lineEnd:en,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var e=t;return t=[],n=null,e}}}function Ao(t,n){return ut(t[0]-n[0])<Q&&ut(t[1]-n[1])<Q}function $o(t,n,e,r){this.x=t,this.z=n,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Hh(t,n,e,r,i){var o=[],a=[],c,u;if(t.forEach(function(p){if(!((g=p.length-1)<=0)){var g,b=p[0],v=p[g],w;if(Ao(b,v)){if(!b[2]&&!v[2]){for(i.lineStart(),c=0;c<g;++c)i.point((b=p[c])[0],b[1]);i.lineEnd();return}v[0]+=2*Q}o.push(w=new $o(b,p,null,!0)),a.push(w.o=new $o(b,null,w,!1)),o.push(w=new $o(v,p,null,!1)),a.push(w.o=new $o(v,null,w,!0))}}),!!o.length){for(a.sort(n),Ch(o),Ch(a),c=0,u=a.length;c<u;++c)a[c].e=e=!e;for(var s=o[0],f,d;;){for(var l=s,h=!0;l.v;)if((l=l.n)===s)return;f=l.z,i.lineStart();do{if(l.v=l.o.v=!0,l.e){if(h)for(c=0,u=f.length;c<u;++c)i.point((d=f[c])[0],d[1]);else r(l.x,l.n.x,1,i);l=l.n}else{if(h)for(f=l.p.z,c=f.length-1;c>=0;--c)i.point((d=f[c])[0],d[1]);else r(l.x,l.p.x,-1,i);l=l.p}l=l.o,f=l.z,h=!h}while(!l.v);i.lineEnd()}}}function Ch(t){if(n=t.length){for(var n,e=0,r=t[0],i;++e<n;)r.n=i=t[e],i.p=r,r=i;r.n=i=t[0],i.p=r}}function Nc(t){return ut(t[0])<=rt?t[0]:nn(t[0])*((ut(t[0])+rt)%Zt-rt)}function uw(t,n){var e=Nc(n),r=n[1],i=J(r),o=[J(e),-et(e),0],a=0,c=0,u=new Qt;i===1?r=ht+Q:i===-1&&(r=-ht-Q);for(var s=0,f=t.length;s<f;++s)if(l=(d=t[s]).length)for(var d,l,h=d[l-1],p=Nc(h),g=h[1]/2+vh,b=J(g),v=et(g),w=0;w<l;++w,p=m,b=y,v=M,h=S){var S=d[w],m=Nc(S),x=S[1]/2+vh,y=J(x),M=et(x),_=m-p,$=_>=0?1:-1,A=$*_,k=A>rt,C=b*y;if(u.add(Fn(C*$*J(A),v*M+C*et(A))),a+=k?_+$*Zt:_,k^p>=e^m>=e){var z=Eo(br(h),br(S));Oc(z);var L=Eo(o,z);Oc(L);var T=(k^_>=0?-1:1)*rn(L[2]);(r>T||r===T&&(z[0]||z[1]))&&(c+=k^_>=0?1:-1)}}return(a<-Q||a<Q&&u<-Fh)^c&1}function Uh(t,n,e,r){return function(i){var o=n(i),a=Wh(),c=n(a),u=!1,s,f,d,l={point:h,lineStart:g,lineEnd:b,polygonStart:function(){l.point=v,l.lineStart=w,l.lineEnd=S,f=[],s=[]},polygonEnd:function(){l.point=h,l.lineStart=g,l.lineEnd=b,f=cc(f);var m=uw(s,r);f.length?(u||(i.polygonStart(),u=!0),Hh(f,fw,m,e,i)):m&&(u||(i.polygonStart(),u=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),u&&(i.polygonEnd(),u=!1),f=s=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(m,x){t(m,x)&&i.point(m,x)}function p(m,x){o.point(m,x)}function g(){l.point=p,o.lineStart()}function b(){l.point=h,o.lineEnd()}function v(m,x){d.push([m,x]),c.point(m,x)}function w(){c.lineStart(),d=[]}function S(){v(d[0][0],d[0][1]),c.lineEnd();var m=c.clean(),x=a.result(),y,M=x.length,_,$,A;if(d.pop(),s.push(d),d=null,!!M){if(m&1){if($=x[0],(_=$.length-1)>0){for(u||(i.polygonStart(),u=!0),i.lineStart(),y=0;y<_;++y)i.point((A=$[y])[0],A[1]);i.lineEnd()}return}M>1&&m&2&&x.push(x.pop().concat(x.shift())),f.push(x.filter(sw))}}return l}}function sw(t){return t.length>1}function fw(t,n){return((t=t.x)[0]<0?t[1]-ht-Q:ht-t[1])-((n=n.x)[0]<0?n[1]-ht-Q:ht-n[1])}var Eh=Uh(function(){return!0},lw,hw,[-rt,-ht]);function lw(t){var n=NaN,e=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,a){var c=o>0?rt:-rt,u=ut(o-n);ut(u-rt)<Q?(t.point(n,e=(e+a)/2>0?ht:-ht),t.point(r,e),t.lineEnd(),t.lineStart(),t.point(c,e),t.point(o,e),i=0):r!==c&&u>=rt&&(ut(n-r)<Q&&(n-=r*Q),ut(o-c)<Q&&(o-=c*Q),e=dw(n,e,o,a),t.point(r,e),t.lineEnd(),t.lineStart(),t.point(c,e),i=0),t.point(n=o,e=a),r=c},lineEnd:function(){t.lineEnd(),n=e=NaN},clean:function(){return 2-i}}}function dw(t,n,e,r){var i,o,a=J(t-e);return ut(a)>Q?wr((J(n)*(o=et(r))*J(e)-J(r)*(i=et(n))*J(t))/(i*o*a)):(n+r)/2}function hw(t,n,e,r){var i;if(t==null)i=e*ht,r.point(-rt,i),r.point(0,i),r.point(rt,i),r.point(rt,0),r.point(rt,-i),r.point(0,-i),r.point(-rt,-i),r.point(-rt,0),r.point(-rt,i);else if(ut(t[0]-n[0])>Q){var o=t[0]<n[0]?rt:-rt;i=e*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(n[0],n[1])}function mw(t){var n=et(t),e=2*dt,r=n>0,i=ut(n)>Q;function o(f,d,l,h){cw(h,t,e,l,f,d)}function a(f,d){return et(f)*et(d)>n}function c(f){var d,l,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(b,v){var w=[b,v],S,m=a(b,v),x=r?m?0:s(b,v):m?s(b+(b<0?rt:-rt),v):0;if(!d&&(p=h=m)&&f.lineStart(),m!==h&&(S=u(d,w),(!S||Ao(d,S)||Ao(w,S))&&(w[2]=1)),m!==h)g=0,m?(f.lineStart(),S=u(w,d),f.point(S[0],S[1])):(S=u(d,w),f.point(S[0],S[1],2),f.lineEnd()),d=S;else if(i&&d&&r^m){var y;!(x&l)&&(y=u(w,d,!0))&&(g=0,r?(f.lineStart(),f.point(y[0][0],y[0][1]),f.point(y[1][0],y[1][1]),f.lineEnd()):(f.point(y[1][0],y[1][1]),f.lineEnd(),f.lineStart(),f.point(y[0][0],y[0][1],3)))}m&&(!d||!Ao(d,w))&&f.point(w[0],w[1]),d=w,h=m,l=x},lineEnd:function(){h&&f.lineEnd(),d=null},clean:function(){return g|(p&&h)<<1}}}function u(f,d,l){var h=br(f),p=br(d),g=[1,0,0],b=Eo(h,p),v=Mo(b,b),w=b[0],S=v-w*w;if(!S)return!l&&f;var m=n*v/S,x=-n*w/S,y=Eo(g,b),M=_o(g,m),_=_o(b,x);Ec(M,_);var $=y,A=Mo(M,$),k=Mo($,$),C=A*A-k*(Mo(M,M)-1);if(!(C<0)){var z=Ft(C),L=_o($,(-A-z)/k);if(Ec(L,M),L=Dc(L),!l)return L;var T=f[0],B=d[0],D=f[1],H=d[1],O;B<T&&(O=T,T=B,B=O);var Y=B-T,E=ut(Y-rt)<Q,R=E||Y<Q;if(!E&&H<D&&(O=D,D=H,H=O),R?E?D+H>0^L[1]<(ut(L[0]-T)<Q?D:H):D<=L[1]&&L[1]<=H:Y>rt^(T<=L[0]&&L[0]<=B)){var F=_o($,(-A+z)/k);return Ec(F,M),[L,Dc(F)]}}}function s(f,d){var l=r?t:rt-t,h=0;return f<-l?h|=1:f>l&&(h|=2),d<-l?h|=4:d>l&&(h|=8),h}return Uh(a,c,o,r?[0,-t]:[-rt,t-rt])}function pw(t,n,e,r,i,o){var a=t[0],c=t[1],u=n[0],s=n[1],f=0,d=1,l=u-a,h=s-c,p;if(p=e-a,!(!l&&p>0)){if(p/=l,l<0){if(p<f)return;p<d&&(d=p)}else if(l>0){if(p>d)return;p>f&&(f=p)}if(p=i-a,!(!l&&p<0)){if(p/=l,l<0){if(p>d)return;p>f&&(f=p)}else if(l>0){if(p<f)return;p<d&&(d=p)}if(p=r-c,!(!h&&p>0)){if(p/=h,h<0){if(p<f)return;p<d&&(d=p)}else if(h>0){if(p>d)return;p>f&&(f=p)}if(p=o-c,!(!h&&p<0)){if(p/=h,h<0){if(p>d)return;p>f&&(f=p)}else if(h>0){if(p<f)return;p<d&&(d=p)}return f>0&&(t[0]=a+f*l,t[1]=c+f*h),d<1&&(n[0]=a+d*l,n[1]=c+d*h),!0}}}}}var ni=1e9,So=-ni;function Zc(t,n,e,r){function i(s,f){return t<=s&&s<=e&&n<=f&&f<=r}function o(s,f,d,l){var h=0,p=0;if(s==null||(h=a(s,d))!==(p=a(f,d))||u(s,f)<0^d>0)do l.point(h===0||h===3?t:e,h>1?r:n);while((h=(h+d+4)%4)!==p);else l.point(f[0],f[1])}function a(s,f){return ut(s[0]-t)<Q?f>0?0:3:ut(s[0]-e)<Q?f>0?2:1:ut(s[1]-n)<Q?f>0?1:0:f>0?3:2}function c(s,f){return u(s.x,f.x)}function u(s,f){var d=a(s,1),l=a(f,1);return d!==l?d-l:d===0?f[1]-s[1]:d===1?s[0]-f[0]:d===2?s[1]-f[1]:f[0]-s[0]}return function(s){var f=s,d=Wh(),l,h,p,g,b,v,w,S,m,x,y,M={point:_,lineStart:C,lineEnd:z,polygonStart:A,polygonEnd:k};function _(T,B){i(T,B)&&f.point(T,B)}function $(){for(var T=0,B=0,D=h.length;B<D;++B)for(var H=h[B],O=1,Y=H.length,E=H[0],R,F,G=E[0],Z=E[1];O<Y;++O)R=G,F=Z,E=H[O],G=E[0],Z=E[1],F<=r?Z>r&&(G-R)*(r-F)>(Z-F)*(t-R)&&++T:Z<=r&&(G-R)*(r-F)<(Z-F)*(t-R)&&--T;return T}function A(){f=d,l=[],h=[],y=!0}function k(){var T=$(),B=y&&T,D=(l=cc(l)).length;(B||D)&&(s.polygonStart(),B&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),D&&Hh(l,c,T,o,s),s.polygonEnd()),f=s,l=h=p=null}function C(){M.point=L,h&&h.push(p=[]),x=!0,m=!1,w=S=NaN}function z(){l&&(L(g,b),v&&m&&d.rejoin(),l.push(d.result())),M.point=_,m&&f.lineEnd()}function L(T,B){var D=i(T,B);if(h&&p.push([T,B]),x)g=T,b=B,v=D,x=!1,D&&(f.lineStart(),f.point(T,B));else if(D&&m)f.point(T,B);else{var H=[w=Math.max(So,Math.min(ni,w)),S=Math.max(So,Math.min(ni,S))],O=[T=Math.max(So,Math.min(ni,T)),B=Math.max(So,Math.min(ni,B))];pw(H,O,t,n,e,r)?(m||(f.lineStart(),f.point(H[0],H[1])),f.point(O[0],O[1]),D||f.lineEnd(),y=!1):D&&(f.lineStart(),f.point(T,B),y=!1)}w=T,S=B,m=D}return M}}var Fc=t=>t,Lc=new Qt,qc=new Qt,Gh,Xh,Bc,Yc,zn={point:en,lineStart:en,lineEnd:en,polygonStart:function(){zn.lineStart=gw,zn.lineEnd=bw},polygonEnd:function(){zn.lineStart=zn.lineEnd=zn.point=en,Lc.add(ut(qc)),qc=new Qt},result:function(){var t=Lc/2;return Lc=new Qt,t}};function gw(){zn.point=yw}function yw(t,n){zn.point=Vh,Gh=Bc=t,Xh=Yc=n}function Vh(t,n){qc.add(Yc*t-Bc*n),Bc=t,Yc=n}function bw(){Vh(Gh,Xh)}var xr=1/0,No=xr,fi=-xr,Lo=fi,Po={point:xw,lineStart:en,lineEnd:en,polygonStart:en,polygonEnd:en,result:function(){var t=[[xr,No],[fi,Lo]];return fi=Lo=-(No=xr=1/0),t}};function xw(t,n){t<xr&&(xr=t),t>fi&&(fi=t),n<No&&(No=n),n>Lo&&(Lo=n)}var Wc=0,Hc=0,ei=0,Ro=0,Do=0,yr=0,Uc=0,Gc=0,ri=0,jh,Zh,vn,Mn,tn={point:Ee,lineStart:Nh,lineEnd:Lh,polygonStart:function(){tn.lineStart=Mw,tn.lineEnd=_w},polygonEnd:function(){tn.point=Ee,tn.lineStart=Nh,tn.lineEnd=Lh},result:function(){var t=ri?[Uc/ri,Gc/ri]:yr?[Ro/yr,Do/yr]:ei?[Wc/ei,Hc/ei]:[NaN,NaN];return Wc=Hc=ei=Ro=Do=yr=Uc=Gc=ri=0,t}};function Ee(t,n){Wc+=t,Hc+=n,++ei}function Nh(){tn.point=ww}function ww(t,n){tn.point=vw,Ee(vn=t,Mn=n)}function vw(t,n){var e=t-vn,r=n-Mn,i=Ft(e*e+r*r);Ro+=i*(vn+t)/2,Do+=i*(Mn+n)/2,yr+=i,Ee(vn=t,Mn=n)}function Lh(){tn.point=Ee}function Mw(){tn.point=$w}function _w(){Kh(jh,Zh)}function $w(t,n){tn.point=Kh,Ee(jh=vn=t,Zh=Mn=n)}function Kh(t,n){var e=t-vn,r=n-Mn,i=Ft(e*e+r*r);Ro+=i*(vn+t)/2,Do+=i*(Mn+n)/2,yr+=i,i=Mn*t-vn*n,Uc+=i*(vn+t),Gc+=i*(Mn+n),ri+=i*3,Ee(vn=t,Mn=n)}function Qh(t){this._context=t}Qh.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:{this._context.moveTo(t,n),this._point=1;break}case 1:{this._context.lineTo(t,n);break}default:{this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,Zt);break}}},result:en};var Xc=new Qt,Pc,Jh,t0,ii,oi,li={point:en,lineStart:function(){li.point=Sw},lineEnd:function(){Pc&&n0(Jh,t0),li.point=en},polygonStart:function(){Pc=!0},polygonEnd:function(){Pc=null},result:function(){var t=+Xc;return Xc=new Qt,t}};function Sw(t,n){li.point=n0,Jh=ii=t,t0=oi=n}function n0(t,n){ii-=t,oi-=n,Xc.add(Ft(ii*ii+oi*oi)),ii=t,oi=n}var Ph,Oo,Rh,Dh,Io=class{constructor(n){this._append=n==null?e0:kw(n),this._radius=4.5,this._=""}pointRadius(n){return this._radius=+n,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(n,e){switch(this._point){case 0:{this._append`M${n},${e}`,this._point=1;break}case 1:{this._append`L${n},${e}`;break}default:{if(this._append`M${n},${e}`,this._radius!==Rh||this._append!==Oo){let r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,Rh=r,Oo=this._append,Dh=this._,this._=i}this._+=Dh;break}}}result(){let n=this._;return this._="",n.length?n:null}};function e0(t){let n=1;this._+=t[0];for(let e=t.length;n<e;++n)this._+=arguments[n]+t[n]}function kw(t){let n=Math.floor(t);if(!(n>=0))throw new RangeError(`invalid digits: ${t}`);if(n>15)return e0;if(n!==Ph){let e=10**n;Ph=n,Oo=function(i){let o=1;this._+=i[0];for(let a=i.length;o<a;++o)this._+=Math.round(arguments[o]*e)/e+i[o]}}return Oo}function qo(t,n){let e=3,r=4.5,i,o;function a(c){return c&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),re(c,i(o))),o.result()}return a.area=function(c){return re(c,i(zn)),zn.result()},a.measure=function(c){return re(c,i(li)),li.result()},a.bounds=function(c){return re(c,i(Po)),Po.result()},a.centroid=function(c){return re(c,i(tn)),tn.result()},a.projection=function(c){return arguments.length?(i=c==null?(t=null,Fc):(t=c).stream,a):t},a.context=function(c){return arguments.length?(o=c==null?(n=null,new Io(e)):new Qh(n=c),typeof r!="function"&&o.pointRadius(r),a):n},a.pointRadius=function(c){return arguments.length?(r=typeof c=="function"?c:(o.pointRadius(+c),+c),a):r},a.digits=function(c){if(!arguments.length)return e;if(c==null)e=null;else{let u=Math.floor(c);if(!(u>=0))throw new RangeError(`invalid digits: ${c}`);e=u}return n===null&&(o=new Io(e)),a},a.projection(t).digits(e).context(n)}function hi(t){return{stream:Bo(t)}}function Bo(t){return function(n){var e=new Vc;for(var r in t)e[r]=t[r];return e.stream=n,e}}function Vc(){}Vc.prototype={constructor:Vc,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Kc(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),re(e,t.stream(Po)),n(Po.result()),r!=null&&t.clipExtent(r),t}function Qc(t,n,e){return Kc(t,function(r){var i=n[1][0]-n[0][0],o=n[1][1]-n[0][1],a=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),c=+n[0][0]+(i-a*(r[1][0]+r[0][0]))/2,u=+n[0][1]+(o-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([c,u])},e)}function r0(t,n,e){return Qc(t,[[0,0],n],e)}function i0(t,n,e){return Kc(t,function(r){var i=+n,o=i/(r[1][0]-r[0][0]),a=(i-o*(r[1][0]+r[0][0]))/2,c=-o*r[0][1];t.scale(150*o).translate([a,c])},e)}function o0(t,n,e){return Kc(t,function(r){var i=+n,o=i/(r[1][1]-r[0][1]),a=-o*r[0][0],c=(i-o*(r[1][1]+r[0][1]))/2;t.scale(150*o).translate([a,c])},e)}var Oh=16,Aw=et(30*dt);function Ih(t,n){return+n?Cw(t,n):Tw(t)}function Tw(t){return Bo({point:function(n,e){n=t(n,e),this.stream.point(n[0],n[1])}})}function Cw(t,n){function e(r,i,o,a,c,u,s,f,d,l,h,p,g,b){var v=s-r,w=f-i,S=v*v+w*w;if(S>4*n&&g--){var m=a+l,x=c+h,y=u+p,M=Ft(m*m+x*x+y*y),_=rn(y/=M),$=ut(ut(y)-1)<Q||ut(o-d)<Q?(o+d)/2:Fn(x,m),A=t($,_),k=A[0],C=A[1],z=k-r,L=C-i,T=w*z-v*L;(T*T/S>n||ut((v*z+w*L)/S-.5)>.3||a*l+c*h+u*p<Aw)&&(e(r,i,o,a,c,u,k,C,$,m/=M,x/=M,y,g,b),b.point(k,C),e(k,C,$,m,x,y,s,f,d,l,h,p,g,b))}}return function(r){var i,o,a,c,u,s,f,d,l,h,p,g,b={point:v,lineStart:w,lineEnd:m,polygonStart:function(){r.polygonStart(),b.lineStart=x},polygonEnd:function(){r.polygonEnd(),b.lineStart=w}};function v(_,$){_=t(_,$),r.point(_[0],_[1])}function w(){d=NaN,b.point=S,r.lineStart()}function S(_,$){var A=br([_,$]),k=t(_,$);e(d,l,f,h,p,g,d=k[0],l=k[1],f=_,h=A[0],p=A[1],g=A[2],Oh,r),r.point(d,l)}function m(){b.point=v,r.lineEnd()}function x(){w(),b.point=y,b.lineEnd=M}function y(_,$){S(i=_,$),o=d,a=l,c=h,u=p,s=g,b.point=S}function M(){e(d,l,f,h,p,g,o,a,i,c,u,s,Oh,r),b.lineEnd=m,m()}return b}}var Ew=Bo({point:function(t,n){this.stream.point(t*dt,n*dt)}});function Nw(t){return Bo({point:function(n,e){var r=t(n,e);return this.stream.point(r[0],r[1])}})}function Lw(t,n,e,r,i){function o(a,c){return a*=r,c*=i,[n+t*a,e-t*c]}return o.invert=function(a,c){return[(a-n)/t*r,(e-c)/t*i]},o}function zh(t,n,e,r,i,o){if(!o)return Lw(t,n,e,r,i);var a=et(o),c=J(o),u=a*t,s=c*t,f=a/t,d=c/t,l=(c*e-a*n)/t,h=(c*n+a*e)/t;function p(g,b){return g*=r,b*=i,[u*g-s*b+n,e-s*g-u*b]}return p.invert=function(g,b){return[r*(f*g-d*b+l),i*(h-d*g-f*b)]},p}function ie(t){return a0(function(){return t})()}function a0(t){var n,e=150,r=480,i=250,o=0,a=0,c=0,u=0,s=0,f,d=0,l=1,h=1,p=null,g=Eh,b=null,v,w,S,m=Fc,x=.5,y,M,_,$,A;function k(T){return _(T[0]*dt,T[1]*dt)}function C(T){return T=_.invert(T[0],T[1]),T&&[T[0]*Rt,T[1]*Rt]}k.stream=function(T){return $&&A===T?$:$=Ew(Nw(f)(g(y(m(A=T)))))},k.preclip=function(T){return arguments.length?(g=T,p=void 0,L()):g},k.postclip=function(T){return arguments.length?(m=T,b=v=w=S=null,L()):m},k.clipAngle=function(T){return arguments.length?(g=+T?mw(p=T*dt):(p=null,Eh),L()):p*Rt},k.clipExtent=function(T){return arguments.length?(m=T==null?(b=v=w=S=null,Fc):Zc(b=+T[0][0],v=+T[0][1],w=+T[1][0],S=+T[1][1]),L()):b==null?null:[[b,v],[w,S]]},k.scale=function(T){return arguments.length?(e=+T,z()):e},k.translate=function(T){return arguments.length?(r=+T[0],i=+T[1],z()):[r,i]},k.center=function(T){return arguments.length?(o=T[0]%360*dt,a=T[1]%360*dt,z()):[o*Rt,a*Rt]},k.rotate=function(T){return arguments.length?(c=T[0]%360*dt,u=T[1]%360*dt,s=T.length>2?T[2]%360*dt:0,z()):[c*Rt,u*Rt,s*Rt]},k.angle=function(T){return arguments.length?(d=T%360*dt,z()):d*Rt},k.reflectX=function(T){return arguments.length?(l=T?-1:1,z()):l<0},k.reflectY=function(T){return arguments.length?(h=T?-1:1,z()):h<0},k.precision=function(T){return arguments.length?(y=Ih(M,x=T*T),L()):Ft(x)},k.fitExtent=function(T,B){return Qc(k,T,B)},k.fitSize=function(T,B){return r0(k,T,B)},k.fitWidth=function(T,B){return i0(k,T,B)},k.fitHeight=function(T,B){return o0(k,T,B)};function z(){var T=zh(e,0,0,l,h,d).apply(null,n(o,a)),B=zh(e,r-T[0],i-T[1],l,h,d);return f=Yh(c,u,s),M=Ic(n,B),_=Ic(f,M),y=Ih(M,x),L()}function L(){return $=A=null,k}return function(){return n=t.apply(this,arguments),k.invert=n.invert&&C,z()}}function Jc(t){var n=0,e=rt/3,r=a0(t),i=r(n,e);return i.parallels=function(o){return arguments.length?r(n=o[0]*dt,e=o[1]*dt):[n*Rt,e*Rt]},i}function Pw(t){var n=et(t);function e(r,i){return[r*n,J(i)/n]}return e.invert=function(r,i){return[r/n,rn(i*n)]},e}function Rw(t,n){var e=J(t),r=(e+J(n))/2;if(ut(r)<Q)return Pw(t);var i=1+e*(2*r-e),o=Ft(i)/r;function a(c,u){var s=Ft(i-2*r*J(u))/r;return[s*J(c*=r),o-s*et(c)]}return a.invert=function(c,u){var s=o-u,f=Fn(c,ut(s))*nn(s);return s*r<0&&(f-=rt*nn(c)*nn(s)),[f/r,rn((i-(c*c+s*s)*r*r)/(2*r))]},a}function di(){return Jc(Rw).scale(155.424).center([0,33.6442])}function tu(){return di().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Dw(t){var n=t.length;return{point:function(e,r){for(var i=-1;++i<n;)t[i].point(e,r)},sphere:function(){for(var e=-1;++e<n;)t[e].sphere()},lineStart:function(){for(var e=-1;++e<n;)t[e].lineStart()},lineEnd:function(){for(var e=-1;++e<n;)t[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<n;)t[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<n;)t[e].polygonEnd()}}}function c0(){var t,n,e=tu(),r,i=di().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=di().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c,u,s={point:function(l,h){u=[l,h]}};function f(l){var h=l[0],p=l[1];return u=null,r.point(h,p),u||(o.point(h,p),u)||(c.point(h,p),u)}f.invert=function(l){var h=e.scale(),p=e.translate(),g=(l[0]-p[0])/h,b=(l[1]-p[1])/h;return(b>=.12&&b<.234&&g>=-.425&&g<-.214?i:b>=.166&&b<.234&&g>=-.214&&g<-.115?a:e).invert(l)},f.stream=function(l){return t&&n===l?t:t=Dw([e.stream(n=l),i.stream(l),a.stream(l)])},f.precision=function(l){return arguments.length?(e.precision(l),i.precision(l),a.precision(l),d()):e.precision()},f.scale=function(l){return arguments.length?(e.scale(l),i.scale(l*.35),a.scale(l),f.translate(e.translate())):e.scale()},f.translate=function(l){if(!arguments.length)return e.translate();var h=e.scale(),p=+l[0],g=+l[1];return r=e.translate(l).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(s),o=i.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+Q,g+.12*h+Q],[p-.214*h-Q,g+.234*h-Q]]).stream(s),c=a.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+Q,g+.166*h+Q],[p-.115*h-Q,g+.234*h-Q]]).stream(s),d()},f.fitExtent=function(l,h){return Qc(f,l,h)},f.fitSize=function(l,h){return r0(f,l,h)},f.fitWidth=function(l,h){return i0(f,l,h)},f.fitHeight=function(l,h){return o0(f,l,h)};function d(){return t=n=null,f}return f.scale(1070)}function u0(t){return function(n,e){var r=et(n),i=et(e),o=t(r*i);return o===1/0?[2,0]:[o*i*J(n),o*J(e)]}}function mi(t){return function(n,e){var r=Ft(n*n+e*e),i=t(r),o=J(i),a=et(i);return[Fn(n*o,r*a),rn(r&&e*o/r)]}}var s0=u0(function(t){return Ft(2/(1+t))});s0.invert=mi(function(t){return 2*rn(t/2)});function f0(){return ie(s0).scale(124.75).clipAngle(180-.001)}var l0=u0(function(t){return(t=Bh(t))&&t/J(t)});l0.invert=mi(function(t){return t});function d0(){return ie(l0).scale(79.4188).clipAngle(180-.001)}function Yo(t,n){return[t,To(jc((ht+n)/2))]}Yo.invert=function(t,n){return[t,2*wr(qh(n))-ht]};function h0(){return m0(Yo).scale(961/Zt)}function m0(t){var n=ie(t),e=n.center,r=n.scale,i=n.translate,o=n.clipExtent,a=null,c,u,s;n.scale=function(d){return arguments.length?(r(d),f()):r()},n.translate=function(d){return arguments.length?(i(d),f()):i()},n.center=function(d){return arguments.length?(e(d),f()):e()},n.clipExtent=function(d){return arguments.length?(d==null?a=c=u=s=null:(a=+d[0][0],c=+d[0][1],u=+d[1][0],s=+d[1][1]),f()):a==null?null:[[a,c],[u,s]]};function f(){var d=rt*r(),l=n(aw(n.rotate()).invert([0,0]));return o(a==null?[[l[0]-d,l[1]-d],[l[0]+d,l[1]+d]]:t===Yo?[[Math.max(l[0]-d,a),c],[Math.min(l[0]+d,u),s]]:[[a,Math.max(l[1]-d,c)],[u,Math.min(l[1]+d,s)]])}return f()}function ko(t){return jc((ht+t)/2)}function Ow(t,n){var e=et(t),r=t===n?J(t):To(e/et(n))/To(ko(n)/ko(t)),i=e*Cc(ko(t),r)/r;if(!r)return Yo;function o(a,c){i>0?c<-ht+Q&&(c=-ht+Q):c>ht-Q&&(c=ht-Q);var u=i/Cc(ko(c),r);return[u*J(r*a),i-u*et(r*a)]}return o.invert=function(a,c){var u=i-c,s=nn(r)*Ft(a*a+u*u),f=Fn(a,ut(u))*nn(u);return u*r<0&&(f-=rt*nn(a)*nn(u)),[f/r,2*wr(Cc(i/s,1/r))-ht]},o}function p0(){return Jc(Ow).scale(109.5).parallels([30,30])}function zo(t,n){return[t,n]}zo.invert=zo;function g0(){return ie(zo).scale(152.63)}function Iw(t,n){var e=et(t),r=t===n?J(t):(e-et(n))/(n-t),i=e/r+t;if(ut(r)<Q)return zo;function o(a,c){var u=i-c,s=r*a;return[u*J(s),i-u*et(s)]}return o.invert=function(a,c){var u=i-c,s=Fn(a,ut(u))*nn(u);return u*r<0&&(s-=rt*nn(a)*nn(u)),[s/r,i-nn(r)*Ft(a*a+u*u)]},o}function y0(){return Jc(Iw).scale(131.154).center([0,13.9389])}var ai=1.340264,ci=-.081106,ui=893e-6,si=.003796,Fo=Ft(3)/2,zw=12;function b0(t,n){var e=rn(Fo*J(n)),r=e*e,i=r*r*r;return[t*et(e)/(Fo*(ai+3*ci*r+i*(7*ui+9*si*r))),e*(ai+ci*r+i*(ui+si*r))]}b0.invert=function(t,n){for(var e=n,r=e*e,i=r*r*r,o=0,a,c,u;o<zw&&(c=e*(ai+ci*r+i*(ui+si*r))-n,u=ai+3*ci*r+i*(7*ui+9*si*r),e-=a=c/u,r=e*e,i=r*r*r,!(ut(a)<Fh));++o);return[Fo*t*(ai+3*ci*r+i*(7*ui+9*si*r))/et(e),rn(J(e)/Fo)]};function x0(){return ie(b0).scale(177.158)}function w0(t,n){var e=et(n),r=et(t)*e;return[e*J(t)/r,J(n)/r]}w0.invert=mi(wr);function v0(){return ie(w0).scale(144.049).clipAngle(60)}function Fw(t,n){var e=n*n,r=e*e;return[t*(.8707-.131979*e+r*(-.013791+r*(.003971*e-.001529*r))),n*(1.007226+e*(.015085+r*(-.044475+.028874*e-.005916*r)))]}Fw.invert=function(t,n){var e=n,r=25,i;do{var o=e*e,a=o*o;e-=i=(e*(1.007226+o*(.015085+a*(-.044475+.028874*o-.005916*a)))-n)/(1.007226+o*(.015085*3+a*(-.044475*7+.028874*9*o-.005916*11*a)))}while(ut(i)>Q&&--r>0);return[t/(.8707+(o=e*e)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),e]};function M0(t,n){return[et(n)*J(t),J(n)]}M0.invert=mi(rn);function _0(){return ie(M0).scale(249.5).clipAngle(90+Q)}function $0(t,n){var e=et(n),r=1+et(t)*e;return[e*J(t)/r,J(n)/r]}$0.invert=mi(function(t){return 2*wr(t)});function S0(){return ie($0).scale(250).clipAngle(142)}function k0(t,n){return[To(jc((ht+n)/2)),-t]}k0.invert=function(t,n){return[-n,2*wr(qh(t))-ht]};function A0(){var t=m0(k0),n=t.center,e=t.rotate;return t.center=function(r){return arguments.length?n([-r[1],r[0]]):(r=n(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?e([r[0],r[1],r.length>2?r[2]+90:90]):(r=e(),[r[0],r[1],r[2]-90])},e([0,0,90]).scale(159.155)}var nu=new Date,eu=new Date;function xt(t,n,e,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)),n(o,1),t(o),o),i.round=o=>{let a=i(o),c=i.ceil(o);return o-a<c-o?a:c},i.offset=(o,a)=>(n(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,c)=>{let u=[];if(o=i.ceil(o),c=c==null?1:Math.floor(c),!(o<a)||!(c>0))return u;let s;do u.push(s=new Date(+o)),n(o,c),t(o);while(s<o&&o<a);return u},i.filter=o=>xt(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,c)=>{if(a>=a)if(c<0)for(;++c<=0;)for(;n(a,-1),!o(a););else for(;--c>=0;)for(;n(a,1),!o(a););}),e&&(i.count=(o,a)=>(nu.setTime(+o),eu.setTime(+a),t(nu),t(eu),Math.floor(e(nu,eu))),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}var Wo=xt(()=>{},(t,n)=>{t.setTime(+t+n)},(t,n)=>n-t);Wo.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?xt(n=>{n.setTime(Math.floor(n/t)*t)},(n,e)=>{n.setTime(+n+e*t)},(n,e)=>(e-n)/t):Wo);var n7=Wo.range,qn=1e3,on=qn*60,Bn=on*60,Yn=Bn*24,iu=Yn*7,T0=Yn*30,ru=Yn*365,Dt=xt(t=>{t.setTime(t-t.getMilliseconds())},(t,n)=>{t.setTime(+t+n*qn)},(t,n)=>(n-t)/qn,t=>t.getUTCSeconds()),e7=Dt.range,Ne=xt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qn)},(t,n)=>{t.setTime(+t+n*on)},(t,n)=>(n-t)/on,t=>t.getMinutes()),r7=Ne.range,Le=xt(t=>{t.setUTCSeconds(0,0)},(t,n)=>{t.setTime(+t+n*on)},(t,n)=>(n-t)/on,t=>t.getUTCMinutes()),i7=Le.range,Pe=xt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qn-t.getMinutes()*on)},(t,n)=>{t.setTime(+t+n*Bn)},(t,n)=>(n-t)/Bn,t=>t.getHours()),o7=Pe.range,Re=xt(t=>{t.setUTCMinutes(0,0,0)},(t,n)=>{t.setTime(+t+n*Bn)},(t,n)=>(n-t)/Bn,t=>t.getUTCHours()),a7=Re.range,_n=xt(t=>t.setHours(0,0,0,0),(t,n)=>t.setDate(t.getDate()+n),(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*on)/Yn,t=>t.getDate()-1),c7=_n.range,vr=xt(t=>{t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n)},(t,n)=>(n-t)/Yn,t=>t.getUTCDate()-1),u7=vr.range,pi=xt(t=>{t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n)},(t,n)=>(n-t)/Yn,t=>Math.floor(t/Yn)),s7=pi.range;function De(t){return xt(n=>{n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},(n,e)=>{n.setDate(n.getDate()+e*7)},(n,e)=>(e-n-(e.getTimezoneOffset()-n.getTimezoneOffset())*on)/iu)}var $n=De(0),Oe=De(1),ou=De(2),au=De(3),Wn=De(4),cu=De(5),uu=De(6),f7=$n.range,l7=Oe.range,d7=ou.range,h7=au.range,m7=Wn.range,p7=cu.range,g7=uu.range;function Ie(t){return xt(n=>{n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCDate(n.getUTCDate()+e*7)},(n,e)=>(e-n)/iu)}var Sn=Ie(0),ze=Ie(1),su=Ie(2),fu=Ie(3),Hn=Ie(4),lu=Ie(5),du=Ie(6),y7=Sn.range,b7=ze.range,x7=su.range,w7=fu.range,v7=Hn.range,M7=lu.range,_7=du.range,Fe=xt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,n)=>{t.setMonth(t.getMonth()+n)},(t,n)=>n.getMonth()-t.getMonth()+(n.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),$7=Fe.range,qe=xt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCMonth(t.getUTCMonth()+n)},(t,n)=>n.getUTCMonth()-t.getUTCMonth()+(n.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),S7=qe.range,qt=xt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n)},(t,n)=>n.getFullYear()-t.getFullYear(),t=>t.getFullYear());qt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:xt(n=>{n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},(n,e)=>{n.setFullYear(n.getFullYear()+e*t)});var k7=qt.range,Bt=xt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n)},(t,n)=>n.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Bt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:xt(n=>{n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCFullYear(n.getUTCFullYear()+e*t)});var A7=Bt.range;function C0(t,n,e,r,i,o){let a=[[Dt,1,qn],[Dt,5,5*qn],[Dt,15,15*qn],[Dt,30,30*qn],[o,1,on],[o,5,5*on],[o,15,15*on],[o,30,30*on],[i,1,Bn],[i,3,3*Bn],[i,6,6*Bn],[i,12,12*Bn],[r,1,Yn],[r,2,2*Yn],[e,1,iu],[n,1,T0],[n,3,3*T0],[t,1,ru]];function c(s,f,d){let l=f<s;l&&([s,f]=[f,s]);let h=d&&typeof d.range=="function"?d:u(s,f,d),p=h?h.range(s,+f+1):[];return l?p.reverse():p}function u(s,f,d){let l=Math.abs(f-s)/d,h=ir(([,,b])=>b).right(a,l);if(h===a.length)return t.every(Gr(s/ru,f/ru,d));if(h===0)return Wo.every(Math.max(Gr(s,f,d),1));let[p,g]=a[l/a[h-1][2]<a[h][2]/l?h-1:h];return p.every(g)}return[c,u]}var[E0,Ho]=C0(Bt,qe,Sn,pi,Re,Le),[N0,L0]=C0(qt,Fe,$n,_n,Pe,Ne);function hu(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function mu(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function gi(t,n,e){return{y:t,m:n,d:e,H:0,M:0,S:0,L:0}}function qw(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,c=t.months,u=t.shortMonths,s=yi(i),f=bi(i),d=yi(o),l=bi(o),h=yi(a),p=bi(a),g=yi(c),b=bi(c),v=yi(u),w=bi(u),S={a:D,A:H,b:O,B:Y,c:null,d:z0,e:z0,f:sv,g:xv,G:vv,H:av,I:cv,j:uv,L:W0,m:fv,M:lv,p:E,q:R,Q:B0,s:Y0,S:dv,u:hv,U:mv,V:pv,w:gv,W:yv,x:null,X:null,y:bv,Y:wv,Z:Mv,"%":q0},m={a:F,A:G,b:Z,B:it,c:null,d:F0,e:F0,f:kv,g:Ov,G:zv,H:_v,I:$v,j:Sv,L:U0,m:Av,M:Tv,p:I,q:U,Q:B0,s:Y0,S:Cv,u:Ev,U:Nv,V:Lv,w:Pv,W:Rv,x:null,X:null,y:Dv,Y:Iv,Z:Fv,"%":q0},x={a:A,A:k,b:C,B:z,c:L,d:O0,e:O0,f:ev,g:D0,G:R0,H:I0,I:I0,j:Qw,L:nv,m:Kw,M:Jw,p:$,q:Zw,Q:iv,s:ov,S:tv,u:Uw,U:Gw,V:Xw,w:Hw,W:Vw,x:T,X:B,y:D0,Y:R0,Z:jw,"%":rv};S.x=y(e,S),S.X=y(r,S),S.c=y(n,S),m.x=y(e,m),m.X=y(r,m),m.c=y(n,m);function y(P,q){return function(W){var N=[],K=-1,X=0,V=P.length,nt,ct,yt;for(W instanceof Date||(W=new Date(+W));++K<V;)P.charCodeAt(K)===37&&(N.push(P.slice(X,K)),(ct=P0[nt=P.charAt(++K)])!=null?nt=P.charAt(++K):ct=nt==="e"?" ":"0",(yt=q[nt])&&(nt=yt(W,ct)),N.push(nt),X=K+1);return N.push(P.slice(X,K)),N.join("")}}function M(P,q){return function(W){var N=gi(1900,void 0,1),K=_(N,P,W+="",0),X,V;if(K!=W.length)return null;if("Q"in N)return new Date(N.Q);if("s"in N)return new Date(N.s*1e3+("L"in N?N.L:0));if(q&&!("Z"in N)&&(N.Z=0),"p"in N&&(N.H=N.H%12+N.p*12),N.m===void 0&&(N.m="q"in N?N.q:0),"V"in N){if(N.V<1||N.V>53)return null;"w"in N||(N.w=1),"Z"in N?(X=mu(gi(N.y,0,1)),V=X.getUTCDay(),X=V>4||V===0?ze.ceil(X):ze(X),X=vr.offset(X,(N.V-1)*7),N.y=X.getUTCFullYear(),N.m=X.getUTCMonth(),N.d=X.getUTCDate()+(N.w+6)%7):(X=hu(gi(N.y,0,1)),V=X.getDay(),X=V>4||V===0?Oe.ceil(X):Oe(X),X=_n.offset(X,(N.V-1)*7),N.y=X.getFullYear(),N.m=X.getMonth(),N.d=X.getDate()+(N.w+6)%7)}else("W"in N||"U"in N)&&("w"in N||(N.w="u"in N?N.u%7:"W"in N?1:0),V="Z"in N?mu(gi(N.y,0,1)).getUTCDay():hu(gi(N.y,0,1)).getDay(),N.m=0,N.d="W"in N?(N.w+6)%7+N.W*7-(V+5)%7:N.w+N.U*7-(V+6)%7);return"Z"in N?(N.H+=N.Z/100|0,N.M+=N.Z%100,mu(N)):hu(N)}}function _(P,q,W,N){for(var K=0,X=q.length,V=W.length,nt,ct;K<X;){if(N>=V)return-1;if(nt=q.charCodeAt(K++),nt===37){if(nt=q.charAt(K++),ct=x[nt in P0?q.charAt(K++):nt],!ct||(N=ct(P,W,N))<0)return-1}else if(nt!=W.charCodeAt(N++))return-1}return N}function $(P,q,W){var N=s.exec(q.slice(W));return N?(P.p=f.get(N[0].toLowerCase()),W+N[0].length):-1}function A(P,q,W){var N=h.exec(q.slice(W));return N?(P.w=p.get(N[0].toLowerCase()),W+N[0].length):-1}function k(P,q,W){var N=d.exec(q.slice(W));return N?(P.w=l.get(N[0].toLowerCase()),W+N[0].length):-1}function C(P,q,W){var N=v.exec(q.slice(W));return N?(P.m=w.get(N[0].toLowerCase()),W+N[0].length):-1}function z(P,q,W){var N=g.exec(q.slice(W));return N?(P.m=b.get(N[0].toLowerCase()),W+N[0].length):-1}function L(P,q,W){return _(P,n,q,W)}function T(P,q,W){return _(P,e,q,W)}function B(P,q,W){return _(P,r,q,W)}function D(P){return a[P.getDay()]}function H(P){return o[P.getDay()]}function O(P){return u[P.getMonth()]}function Y(P){return c[P.getMonth()]}function E(P){return i[+(P.getHours()>=12)]}function R(P){return 1+~~(P.getMonth()/3)}function F(P){return a[P.getUTCDay()]}function G(P){return o[P.getUTCDay()]}function Z(P){return u[P.getUTCMonth()]}function it(P){return c[P.getUTCMonth()]}function I(P){return i[+(P.getUTCHours()>=12)]}function U(P){return 1+~~(P.getUTCMonth()/3)}return{format:function(P){var q=y(P+="",S);return q.toString=function(){return P},q},parse:function(P){var q=M(P+="",!1);return q.toString=function(){return P},q},utcFormat:function(P){var q=y(P+="",m);return q.toString=function(){return P},q},utcParse:function(P){var q=M(P+="",!0);return q.toString=function(){return P},q}}}var P0={"-":"",_:" ",0:"0"},_t=/^\s*\d+/,Bw=/^%/,Yw=/[\\^$*+?|[\]().{}]/g;function ot(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<e?new Array(e-o+1).join(n)+i:i)}function Ww(t){return t.replace(Yw,"\\$&")}function yi(t){return new RegExp("^(?:"+t.map(Ww).join("|")+")","i")}function bi(t){return new Map(t.map((n,e)=>[n.toLowerCase(),e]))}function Hw(t,n,e){var r=_t.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function Uw(t,n,e){var r=_t.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function Gw(t,n,e){var r=_t.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function Xw(t,n,e){var r=_t.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function Vw(t,n,e){var r=_t.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function R0(t,n,e){var r=_t.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function D0(t,n,e){var r=_t.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function jw(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Zw(t,n,e){var r=_t.exec(n.slice(e,e+1));return r?(t.q=r[0]*3-3,e+r[0].length):-1}function Kw(t,n,e){var r=_t.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function O0(t,n,e){var r=_t.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Qw(t,n,e){var r=_t.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function I0(t,n,e){var r=_t.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function Jw(t,n,e){var r=_t.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function tv(t,n,e){var r=_t.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function nv(t,n,e){var r=_t.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function ev(t,n,e){var r=_t.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function rv(t,n,e){var r=Bw.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function iv(t,n,e){var r=_t.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function ov(t,n,e){var r=_t.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function z0(t,n){return ot(t.getDate(),n,2)}function av(t,n){return ot(t.getHours(),n,2)}function cv(t,n){return ot(t.getHours()%12||12,n,2)}function uv(t,n){return ot(1+_n.count(qt(t),t),n,3)}function W0(t,n){return ot(t.getMilliseconds(),n,3)}function sv(t,n){return W0(t,n)+"000"}function fv(t,n){return ot(t.getMonth()+1,n,2)}function lv(t,n){return ot(t.getMinutes(),n,2)}function dv(t,n){return ot(t.getSeconds(),n,2)}function hv(t){var n=t.getDay();return n===0?7:n}function mv(t,n){return ot($n.count(qt(t)-1,t),n,2)}function H0(t){var n=t.getDay();return n>=4||n===0?Wn(t):Wn.ceil(t)}function pv(t,n){return t=H0(t),ot(Wn.count(qt(t),t)+(qt(t).getDay()===4),n,2)}function gv(t){return t.getDay()}function yv(t,n){return ot(Oe.count(qt(t)-1,t),n,2)}function bv(t,n){return ot(t.getFullYear()%100,n,2)}function xv(t,n){return t=H0(t),ot(t.getFullYear()%100,n,2)}function wv(t,n){return ot(t.getFullYear()%1e4,n,4)}function vv(t,n){var e=t.getDay();return t=e>=4||e===0?Wn(t):Wn.ceil(t),ot(t.getFullYear()%1e4,n,4)}function Mv(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+ot(n/60|0,"0",2)+ot(n%60,"0",2)}function F0(t,n){return ot(t.getUTCDate(),n,2)}function _v(t,n){return ot(t.getUTCHours(),n,2)}function $v(t,n){return ot(t.getUTCHours()%12||12,n,2)}function Sv(t,n){return ot(1+vr.count(Bt(t),t),n,3)}function U0(t,n){return ot(t.getUTCMilliseconds(),n,3)}function kv(t,n){return U0(t,n)+"000"}function Av(t,n){return ot(t.getUTCMonth()+1,n,2)}function Tv(t,n){return ot(t.getUTCMinutes(),n,2)}function Cv(t,n){return ot(t.getUTCSeconds(),n,2)}function Ev(t){var n=t.getUTCDay();return n===0?7:n}function Nv(t,n){return ot(Sn.count(Bt(t)-1,t),n,2)}function G0(t){var n=t.getUTCDay();return n>=4||n===0?Hn(t):Hn.ceil(t)}function Lv(t,n){return t=G0(t),ot(Hn.count(Bt(t),t)+(Bt(t).getUTCDay()===4),n,2)}function Pv(t){return t.getUTCDay()}function Rv(t,n){return ot(ze.count(Bt(t)-1,t),n,2)}function Dv(t,n){return ot(t.getUTCFullYear()%100,n,2)}function Ov(t,n){return t=G0(t),ot(t.getUTCFullYear()%100,n,2)}function Iv(t,n){return ot(t.getUTCFullYear()%1e4,n,4)}function zv(t,n){var e=t.getUTCDay();return t=e>=4||e===0?Hn(t):Hn.ceil(t),ot(t.getUTCFullYear()%1e4,n,4)}function Fv(){return"+0000"}function q0(){return"%"}function B0(t){return+t}function Y0(t){return Math.floor(+t/1e3)}var Mr,xi,qv,oe,X0;Bv({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 Bv(t){return Mr=qw(t),xi=Mr.format,qv=Mr.parse,oe=Mr.utcFormat,X0=Mr.utcParse,Mr}var V0="%Y-%m-%dT%H:%M:%S.%LZ";function Yv(t){return t.toISOString()}var E7=Date.prototype.toISOString?Yv:oe(V0);function Wv(t){var n=new Date(t);return isNaN(n)?null:n}var N7=+new Date("2000-01-01T00:00:00.000Z")?Wv:X0(V0);function kn(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t);break}return this}function Go(t,n){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof n=="function"?this.interpolator(n):this.range(n);break}}return this}var Uo=Symbol("implicit");function Xo(){var t=new sn,n=[],e=[],r=Uo;function i(o){let a=t.get(o);if(a===void 0){if(r!==Uo)return r;t.set(o,a=n.push(o)-1)}return e[a%e.length]}return i.domain=function(o){if(!arguments.length)return n.slice();n=[],t=new sn;for(let a of o)t.has(a)||t.set(a,n.push(a)-1);return i},i.range=function(o){return arguments.length?(e=Array.from(o),i):e.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Xo(n,e).unknown(r)},kn.apply(i,arguments),i}function wi(){var t=Xo().unknown(void 0),n=t.domain,e=t.range,r=0,i=1,o,a,c=!1,u=0,s=0,f=.5;delete t.unknown;function d(){var l=n().length,h=i<r,p=h?i:r,g=h?r:i;o=(g-p)/Math.max(1,l-u+s*2),c&&(o=Math.floor(o)),p+=(g-p-o*(l-u))*f,a=o*(1-u),c&&(p=Math.round(p),a=Math.round(a));var b=ar(l).map(function(v){return p+o*v});return e(h?b.reverse():b)}return t.domain=function(l){return arguments.length?(n(l),d()):n()},t.range=function(l){return arguments.length?([r,i]=l,r=+r,i=+i,d()):[r,i]},t.rangeRound=function(l){return[r,i]=l,r=+r,i=+i,c=!0,d()},t.bandwidth=function(){return a},t.step=function(){return o},t.round=function(l){return arguments.length?(c=!!l,d()):c},t.padding=function(l){return arguments.length?(u=Math.min(1,s=+l),d()):u},t.paddingInner=function(l){return arguments.length?(u=Math.min(1,l),d()):u},t.paddingOuter=function(l){return arguments.length?(s=+l,d()):s},t.align=function(l){return arguments.length?(f=Math.max(0,Math.min(1,l)),d()):f},t.copy=function(){return wi(n(),[r,i]).round(c).paddingInner(u).paddingOuter(s).align(f)},kn.apply(d(),arguments)}function em(t){var n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return em(n())},t}function rm(){return em(wi.apply(null,arguments).paddingInner(1))}function Hv(t){return function(){return t}}function pu(t){return+t}var j0=[0,1];function an(t){return t}function gu(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:Hv(isNaN(n)?NaN:.5)}function Uv(t,n){var e;return t>n&&(e=t,t=n,n=e),function(r){return Math.max(t,Math.min(n,r))}}function Gv(t,n,e){var r=t[0],i=t[1],o=n[0],a=n[1];return i<r?(r=gu(i,r),o=e(a,o)):(r=gu(r,i),o=e(o,a)),function(c){return o(r(c))}}function Xv(t,n,e){var r=Math.min(t.length,n.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<r;)i[a]=gu(t[a],t[a+1]),o[a]=e(n[a],n[a+1]);return function(c){var u=or(t,c,1,r)-1;return o[u](i[u](c))}}function vi(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Vo(){var t=j0,n=j0,e=hr,r,i,o,a=an,c,u,s;function f(){var l=Math.min(t.length,n.length);return a!==an&&(a=Uv(t[0],t[l-1])),c=l>2?Xv:Gv,u=s=null,d}function d(l){return l==null||isNaN(l=+l)?o:(u||(u=c(t.map(r),n,e)))(r(a(l)))}return d.invert=function(l){return a(i((s||(s=c(n,t.map(r),kt)))(l)))},d.domain=function(l){return arguments.length?(t=Array.from(l,pu),f()):t.slice()},d.range=function(l){return arguments.length?(n=Array.from(l),f()):n.slice()},d.rangeRound=function(l){return n=Array.from(l),e=Jr,f()},d.clamp=function(l){return arguments.length?(a=l?!0:an,f()):a!==an},d.interpolate=function(l){return arguments.length?(e=l,f()):e},d.unknown=function(l){return arguments.length?(o=l,d):o},function(l,h){return r=l,i=h,f()}}function im(){return Vo()(an,an)}function Vv(t,n,e,r){var i=Gr(t,n,e),o;switch(r=gr(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(n));return r.precision==null&&!isNaN(o=xh(i,a))&&(r.precision=o),Tc(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=wh(i,Math.max(Math.abs(t),Math.abs(n))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=bh(i))&&(r.precision=o-(r.type==="%")*2);break}}return ee(r)}function Mi(t){var n=t.domain;return t.ticks=function(e){var r=n();return ve(r[0],r[r.length-1],e??10)},t.tickFormat=function(e,r){var i=n();return Vv(i[0],i[i.length-1],e??10,r)},t.nice=function(e){e==null&&(e=10);var r=n(),i=0,o=r.length-1,a=r[i],c=r[o],u,s,f=10;for(c<a&&(s=a,a=c,c=s,s=i,i=o,o=s);f-- >0;){if(s=er(a,c,e),s===u)return r[i]=a,r[o]=c,n(r);if(s>0)a=Math.floor(a/s)*s,c=Math.ceil(c/s)*s;else if(s<0)a=Math.ceil(a*s)/s,c=Math.floor(c*s)/s;else break;u=s}return t},t}function jo(){var t=im();return t.copy=function(){return vi(t,jo())},kn.apply(t,arguments),Mi(t)}function yu(t){var n;function e(r){return r==null||isNaN(r=+r)?n:r}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=Array.from(r,pu),e):t.slice()},e.unknown=function(r){return arguments.length?(n=r,e):n},e.copy=function(){return yu(t).unknown(n)},t=arguments.length?Array.from(t,pu):[0,1],Mi(e)}function om(t,n){t=t.slice();var e=0,r=t.length-1,i=t[e],o=t[r],a;return o<i&&(a=e,e=r,r=a,a=i,i=o,o=a),t[e]=n.floor(i),t[r]=n.ceil(o),t}function Z0(t){return Math.log(t)}function K0(t){return Math.exp(t)}function jv(t){return-Math.log(-t)}function Zv(t){return-Math.exp(-t)}function Kv(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Qv(t){return t===10?Kv:t===Math.E?Math.exp:n=>Math.pow(t,n)}function Jv(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),n=>Math.log(n)/t)}function Q0(t){return(n,e)=>-t(-n,e)}function am(t){let n=t(Z0,K0),e=n.domain,r=10,i,o;function a(){return i=Jv(r),o=Qv(r),e()[0]<0?(i=Q0(i),o=Q0(o),t(jv,Zv)):t(Z0,K0),n}return n.base=function(c){return arguments.length?(r=+c,a()):r},n.domain=function(c){return arguments.length?(e(c),a()):e()},n.ticks=c=>{let u=e(),s=u[0],f=u[u.length-1],d=f<s;d&&([s,f]=[f,s]);let l=i(s),h=i(f),p,g,b=c==null?10:+c,v=[];if(!(r%1)&&h-l<b){if(l=Math.floor(l),h=Math.ceil(h),s>0){for(;l<=h;++l)for(p=1;p<r;++p)if(g=l<0?p/o(-l):p*o(l),!(g<s)){if(g>f)break;v.push(g)}}else for(;l<=h;++l)for(p=r-1;p>=1;--p)if(g=l>0?p/o(-l):p*o(l),!(g<s)){if(g>f)break;v.push(g)}v.length*2<b&&(v=ve(s,f,b))}else v=ve(l,h,Math.min(h-l,b)).map(o);return d?v.reverse():v},n.tickFormat=(c,u)=>{if(c==null&&(c=10),u==null&&(u=r===10?"s":","),typeof u!="function"&&(!(r%1)&&(u=gr(u)).precision==null&&(u.trim=!0),u=ee(u)),c===1/0)return u;let s=Math.max(1,r*c/n.ticks().length);return f=>{let d=f/o(Math.round(i(f)));return d*r<r-.5&&(d*=r),d<=s?u(f):""}},n.nice=()=>e(om(e(),{floor:c=>o(Math.floor(i(c))),ceil:c=>o(Math.ceil(i(c)))})),n}function bu(){let t=am(Vo()).domain([1,10]);return t.copy=()=>vi(t,bu()).base(t.base()),kn.apply(t,arguments),t}function J0(t){return function(n){return Math.sign(n)*Math.log1p(Math.abs(n/t))}}function tm(t){return function(n){return Math.sign(n)*Math.expm1(Math.abs(n))*t}}function cm(t){var n=1,e=t(J0(n),tm(n));return e.constant=function(r){return arguments.length?t(J0(n=+r),tm(n)):n},Mi(e)}function xu(){var t=cm(Vo());return t.copy=function(){return vi(t,xu()).constant(t.constant())},kn.apply(t,arguments)}function nm(t){return function(n){return n<0?-Math.pow(-n,t):Math.pow(n,t)}}function t6(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function n6(t){return t<0?-t*t:t*t}function um(t){var n=t(an,an),e=1;function r(){return e===1?t(an,an):e===.5?t(t6,n6):t(nm(e),nm(1/e))}return n.exponent=function(i){return arguments.length?(e=+i,r()):e},Mi(n)}function wu(){var t=um(Vo());return t.copy=function(){return vi(t,wu()).exponent(t.exponent())},kn.apply(t,arguments),t}function vu(){var t=[],n=[],e=[],r;function i(){var a=0,c=Math.max(1,n.length);for(e=new Array(c-1);++a<c;)e[a-1]=ld(t,a/c);return o}function o(a){return a==null||isNaN(a=+a)?r:n[or(e,a)]}return o.invertExtent=function(a){var c=n.indexOf(a);return c<0?[NaN,NaN]:[c>0?e[c-1]:t[0],c<e.length?e[c]:t[t.length-1]]},o.domain=function(a){if(!arguments.length)return t.slice();t=[];for(let c of a)c!=null&&!isNaN(c=+c)&&t.push(c);return t.sort(Et),i()},o.range=function(a){return arguments.length?(n=Array.from(a),i()):n.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.quantiles=function(){return e.slice()},o.copy=function(){return vu().domain(t).range(n).unknown(r)},kn.apply(o,arguments)}function Mu(){var t=[.5],n=[0,1],e,r=1;function i(o){return o!=null&&o<=o?n[or(t,o,0,r)]:e}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(o){return arguments.length?(n=Array.from(o),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(o){var a=n.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(e=o,i):e},i.copy=function(){return Mu().domain(t).range(n).unknown(e)},kn.apply(i,arguments)}function e6(t){return new Date(t)}function r6(t){return t instanceof Date?+t:Math.round(t)}function _u(t,n,e,r,i,o,a,c,u,s){var f=im(),d=f.invert,l=f.domain,h=s(".%L"),p=s(":%S"),g=s("%I:%M"),b=s("%I %p"),v=s("%a %d"),w=s("%b %d"),S=s("%B"),m=s("%Y");function x(y){return(u(y)<y?h:c(y)<y?p:a(y)<y?g:o(y)<y?b:r(y)<y?i(y)<y?v:w:e(y)<y?S:m)(y)}return f.invert=function(y){return new Date(Math.round(d(y)))},f.domain=function(y){return arguments.length?l(Array.from(y,r6)):l().map(e6)},f.ticks=function(y){var M=l();return t(M[0],M[M.length-1],y??10)},f.tickFormat=function(y,M){return M==null?x:s(M)},f.nice=function(y){var M=l();return(!y||typeof y.range!="function")&&(y=n(M[0],M[M.length-1],y??10)),y?l(om(M,y)):f},f.copy=function(){return vi(f,_u(t,n,e,r,i,o,a,c,u,s))},f}function sm(){return kn.apply(_u(N0,L0,qt,Fe,$n,_n,Pe,Ne,Dt,xi).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function fm(){return kn.apply(_u(E0,Ho,Bt,qe,Sn,vr,Re,Le,Dt,oe).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Zo(t,n){return n.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Ko(){var t=0,n=.5,e=1,r=1,i,o,a,c,u,s=an,f,d=!1,l;function h(g){return g==null||isNaN(g=+g)?l:(g=.5+((g=+f(g))-o)*(r*g<r*o?c:u),s(d?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([t,n,e]=g,i=f(t=+t),o=f(n=+n),a=f(e=+e),c=i===o?0:.5/(o-i),u=o===a?0:.5/(a-o),r=o<i?-1:1,h):[t,n,e]},h.clamp=function(g){return arguments.length?(d=!!g,h):d},h.interpolator=function(g){return arguments.length?(s=g,h):s};function p(g){return function(b){var v,w,S;return arguments.length?([v,w,S]=b,s=mr(g,[v,w,S]),h):[s(0),s(.5),s(1)]}}return h.range=p(hr),h.rangeRound=p(Jr),h.unknown=function(g){return arguments.length?(l=g,h):l},function(g){return f=g,i=g(t),o=g(n),a=g(e),c=i===o?0:.5/(o-i),u=o===a?0:.5/(a-o),r=o<i?-1:1,h}}function $u(){var t=Mi(Ko()(an));return t.copy=function(){return Zo(t,$u())},Go.apply(t,arguments)}function Su(){var t=am(Ko()).domain([.1,1,10]);return t.copy=function(){return Zo(t,Su()).base(t.base())},Go.apply(t,arguments)}function ku(){var t=cm(Ko());return t.copy=function(){return Zo(t,ku()).constant(t.constant())},Go.apply(t,arguments)}function Au(){var t=um(Ko());return t.copy=function(){return Zo(t,Au()).exponent(t.exponent())},Go.apply(t,arguments)}function tt(t){for(var n=t.length/6|0,e=new Array(n),r=0;r<n;)e[r]="#"+t.slice(r*6,++r*6);return e}var lm=tt("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),dm=tt("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),hm=tt("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),mm=tt("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),pm=tt("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),gm=tt("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),ym=tt("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),bm=tt("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),xm=tt("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),wm=tt("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),vm=tt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),st=t=>eh(t[t.length-1]),Tu=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(tt),Cu=st(Tu),Eu=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(tt),Nu=st(Eu),Lu=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(tt),Pu=st(Lu),Ru=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(tt),Du=st(Ru),ta=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(tt),_i=st(ta),Ou=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(tt),Iu=st(Ou),na=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(tt),$i=st(na),zu=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(tt),Fu=st(zu),qu=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(tt),Bu=st(qu),Yu=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(tt),Wu=st(Yu),Hu=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(tt),Uu=st(Hu),Gu=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(tt),Xu=st(Gu),Vu=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(tt),ju=st(Vu),Zu=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(tt),Ku=st(Zu),Qu=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(tt),Ju=st(Qu),ts=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(tt),ns=st(ts),es=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(tt),rs=st(es),is=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(tt),os=st(is),as=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(tt),cs=st(as),us=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(tt),ss=st(us),fs=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(tt),ls=st(fs),ds=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(tt),hs=st(ds),ms=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(tt),ps=st(ms),gs=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(tt),ys=st(gs),bs=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(tt),xs=st(bs),ws=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(tt),vs=st(ws),Ms=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(tt),_s=st(Ms);function $s(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}var Ss=bo(Jt(300,.5,0),Jt(-240,.5,1)),ks=bo(Jt(-100,.75,.35),Jt(80,1.5,.8)),As=bo(Jt(260,.75,.35),Jt(80,1.5,.8)),Qo=Jt();function Ts(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return Qo.h=360*t-100,Qo.s=1.5-1.5*n,Qo.l=.8-.9*n,Qo+""}var Jo=Ae(),i6=Math.PI/3,o6=Math.PI*2/3;function Cs(t){var n;return t=(.5-t)*Math.PI,Jo.r=255*(n=Math.sin(t))*n,Jo.g=255*(n=Math.sin(t+i6))*n,Jo.b=255*(n=Math.sin(t+o6))*n,Jo+""}function Es(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function ea(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var Ns=ea(tt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Ls=ea(tt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Ps=ea(tt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Rs=ea(tt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function $t(t){return function(){return t}}var Am=Math.cos;var zs=Math.min,ra=Math.sin,wt=Math.sqrt,Mm=1e-12,Si=Math.PI,W7=Si/2,ua=2*Si;function Tm(t){let n=3;return t.digits=function(e){if(!arguments.length)return n;if(e==null)n=null;else{let r=Math.floor(e);if(!(r>=0))throw new RangeError(`invalid digits: ${e}`);n=r}return t},()=>new Ce(n)}var H7=Array.prototype.slice;function Cm(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Em(t){this._context=t}Em.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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n);break}}};function Be(t){return new Em(t)}function Nm(t){return t[0]}function Lm(t){return t[1]}function sa(t,n){var e=$t(!0),r=null,i=Be,o=null,a=Tm(c);t=typeof t=="function"?t:t===void 0?Nm:$t(t),n=typeof n=="function"?n:n===void 0?Lm:$t(n);function c(u){var s,f=(u=Cm(u)).length,d,l=!1,h;for(r==null&&(o=i(h=a())),s=0;s<=f;++s)!(s<f&&e(d=u[s],s,u))===l&&((l=!l)?o.lineStart():o.lineEnd()),l&&o.point(+t(d,s,u),+n(d,s,u));if(h)return o=null,h+""||null}return c.x=function(u){return arguments.length?(t=typeof u=="function"?u:$t(+u),c):t},c.y=function(u){return arguments.length?(n=typeof u=="function"?u:$t(+u),c):n},c.defined=function(u){return arguments.length?(e=typeof u=="function"?u:$t(!!u),c):e},c.curve=function(u){return arguments.length?(i=u,r!=null&&(o=i(r)),c):i},c.context=function(u){return arguments.length?(u==null?r=o=null:o=i(r=u),c):r},c}function Fs(t,n,e){var r=null,i=$t(!0),o=null,a=Be,c=null,u=Tm(s);t=typeof t=="function"?t:t===void 0?Nm:$t(+t),n=typeof n=="function"?n:$t(n===void 0?0:+n),e=typeof e=="function"?e:e===void 0?Lm:$t(+e);function s(d){var l,h,p,g=(d=Cm(d)).length,b,v=!1,w,S=new Array(g),m=new Array(g);for(o==null&&(c=a(w=u())),l=0;l<=g;++l){if(!(l<g&&i(b=d[l],l,d))===v)if(v=!v)h=l,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),p=l-1;p>=h;--p)c.point(S[p],m[p]);c.lineEnd(),c.areaEnd()}v&&(S[l]=+t(b,l,d),m[l]=+n(b,l,d),c.point(r?+r(b,l,d):S[l],e?+e(b,l,d):m[l]))}if(w)return c=null,w+""||null}function f(){return sa().defined(i).curve(a).context(o)}return s.x=function(d){return arguments.length?(t=typeof d=="function"?d:$t(+d),r=null,s):t},s.x0=function(d){return arguments.length?(t=typeof d=="function"?d:$t(+d),s):t},s.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:$t(+d),s):r},s.y=function(d){return arguments.length?(n=typeof d=="function"?d:$t(+d),e=null,s):n},s.y0=function(d){return arguments.length?(n=typeof d=="function"?d:$t(+d),s):n},s.y1=function(d){return arguments.length?(e=d==null?null:typeof d=="function"?d:$t(+d),s):e},s.lineX0=s.lineY0=function(){return f().x(t).y(n)},s.lineY1=function(){return f().x(t).y(e)},s.lineX1=function(){return f().x(r).y(n)},s.defined=function(d){return arguments.length?(i=typeof d=="function"?d:$t(!!d),s):i},s.curve=function(d){return arguments.length?(a=d,o!=null&&(c=a(o)),s):a},s.context=function(d){return arguments.length?(d==null?o=c=null:c=a(o=d),s):o},s}var U7=a6(Be);function Pm(t){this._curve=t}Pm.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};function a6(t){function n(e){return new Pm(t(e))}return n._curve=t,n}var ia=class{constructor(n,e){this._context=n,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(n,e){switch(n=+n,e=+e,this._point){case 0:{this._point=1,this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+n)/2,this._y0,this._x0,e,n,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,n,this._y0,n,e);break}}this._x0=n,this._y0=e}};function Rm(t){return new ia(t,!0)}function Dm(t){return new ia(t,!1)}var c6=wt(3),qs={draw(t,n){let e=wt(n+zs(n/28,.75))*.59436,r=e/2,i=r*c6;t.moveTo(0,e),t.lineTo(0,-e),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},_r={draw(t,n){let e=wt(n/Si);t.moveTo(e,0),t.arc(0,0,e,0,ua)}},Bs={draw(t,n){let e=wt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},Om=wt(1/3),u6=Om*2,Ys={draw(t,n){let e=wt(n/u6),r=e*Om;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},Ws={draw(t,n){let e=wt(n)*.62625;t.moveTo(0,-e),t.lineTo(e,0),t.lineTo(0,e),t.lineTo(-e,0),t.closePath()}},Hs={draw(t,n){let e=wt(n-zs(n/7,2))*.87559;t.moveTo(-e,0),t.lineTo(e,0),t.moveTo(0,e),t.lineTo(0,-e)}},Us={draw(t,n){let e=wt(n),r=-e/2;t.rect(r,r,e,e)}},Gs={draw(t,n){let e=wt(n)*.4431;t.moveTo(e,e),t.lineTo(e,-e),t.lineTo(-e,-e),t.lineTo(-e,e),t.closePath()}},s6=.8908130915292852,Im=ra(Si/10)/ra(7*Si/10),f6=ra(ua/10)*Im,l6=-Am(ua/10)*Im,Xs={draw(t,n){let e=wt(n*s6),r=f6*e,i=l6*e;t.moveTo(0,-e),t.lineTo(r,i);for(let o=1;o<5;++o){let a=ua*o/5,c=Am(a),u=ra(a);t.lineTo(u*e,-c*e),t.lineTo(c*r-u*i,u*r+c*i)}t.closePath()}},Ds=wt(3),Vs={draw(t,n){let e=-wt(n/(Ds*3));t.moveTo(0,e*2),t.lineTo(-Ds*e,-e),t.lineTo(Ds*e,-e),t.closePath()}},d6=wt(3),js={draw(t,n){let e=wt(n)*.6824,r=e/2,i=e*d6/2;t.moveTo(0,-e),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},cn=-.5,un=wt(3)/2,Is=1/wt(12),h6=(Is/2+1)*3,Zs={draw(t,n){let e=wt(n/h6),r=e/2,i=e*Is,o=r,a=e*Is+e,c=-o,u=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(c,u),t.lineTo(cn*r-un*i,un*r+cn*i),t.lineTo(cn*o-un*a,un*o+cn*a),t.lineTo(cn*c-un*u,un*c+cn*u),t.lineTo(cn*r+un*i,cn*i-un*r),t.lineTo(cn*o+un*a,cn*a-un*o),t.lineTo(cn*c+un*u,cn*u-un*c),t.closePath()}},Ks={draw(t,n){let e=wt(n-zs(n/6,1.7))*.6189;t.moveTo(-e,-e),t.lineTo(e,e),t.moveTo(-e,e),t.lineTo(e,-e)}},zm=[_r,Bs,Ys,Us,Xs,Vs,Zs],Fm=[_r,Hs,Ks,js,qs,Gs,Ws];function ae(){}function oa(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function fa(t){this._context=t}fa.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:oa(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:oa(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function qm(t){return new fa(t)}function Bm(t){this._context=t}Bm.prototype={areaStart:ae,areaEnd:ae,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:oa(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Ym(t){return new Bm(t)}function Wm(t){this._context=t}Wm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:oa(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Hm(t){return new Wm(t)}function Um(t,n){this._basis=new fa(t),this._beta=n}Um.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r=t[0],i=n[0],o=t[e]-r,a=n[e]-i,c=-1,u;++c<=e;)u=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(r+u*o),this._beta*n[c]+(1-this._beta)*(i+u*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Gm=(function t(n){function e(r){return n===1?new fa(r):new Um(r,n)}return e.beta=function(r){return t(+r)},e})(.85);function aa(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function Qs(t,n){this._context=t,this._k=(1-n)/6}Qs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:aa(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:aa(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Xm=(function t(n){function e(r){return new Qs(r,n)}return e.tension=function(r){return t(+r)},e})(0);function Js(t,n){this._context=t,this._k=(1-n)/6}Js.prototype={areaStart:ae,areaEnd:ae,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:aa(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Vm=(function t(n){function e(r){return new Js(r,n)}return e.tension=function(r){return t(+r)},e})(0);function tf(t,n){this._context=t,this._k=(1-n)/6}tf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:aa(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var jm=(function t(n){function e(r){return new tf(r,n)}return e.tension=function(r){return t(+r)},e})(0);function nf(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Mm){var c=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*c-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*c-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>Mm){var s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-n*t._l12_2a)/f,a=(a*s+t._y1*t._l23_2a-e*t._l12_2a)/f}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Zm(t,n){this._context=t,this._alpha=n}Zm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:nf(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Km=(function t(n){function e(r){return n?new Zm(r,n):new Qs(r,0)}return e.alpha=function(r){return t(+r)},e})(.5);function Qm(t,n){this._context=t,this._alpha=n}Qm.prototype={areaStart:ae,areaEnd:ae,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:nf(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Jm=(function t(n){function e(r){return n?new Qm(r,n):new Js(r,0)}return e.alpha=function(r){return t(+r)},e})(.5);function tp(t,n){this._context=t,this._alpha=n}tp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:nf(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var np=(function t(n){function e(r){return n?new tp(r,n):new tf(r,0)}return e.alpha=function(r){return t(+r)},e})(.5);function ep(t){this._context=t}ep.prototype={areaStart:ae,areaEnd:ae,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};function rp(t){return new ep(t)}function _m(t){return t<0?-1:1}function $m(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),c=(o*i+a*r)/(r+i);return(_m(o)+_m(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(c))||0}function Sm(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Os(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,c=(o-r)/3;t._context.bezierCurveTo(r+c,i+c*n,o-c,a-c*e,o,a)}function ca(t){this._context=t}ca.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:Os(this,this._t0,Sm(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(t=+t,n=+n,!(t===this._x1&&n===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,Os(this,Sm(this,e=$m(this,t,n)),e);break;default:Os(this,this._t0,e=$m(this,t,n));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}};function ip(t){this._context=new op(t)}(ip.prototype=Object.create(ca.prototype)).point=function(t,n){ca.prototype.point.call(this,n,t)};function op(t){this._context=t}op.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,r,i,o){this._context.bezierCurveTo(n,t,r,e,o,i)}};function ap(t){return new ca(t)}function cp(t){return new ip(t)}function up(t){this._context=t}up.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,e=t.length;if(e)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),e===2)this._context.lineTo(t[1],n[1]);else for(var r=km(t),i=km(n),o=0,a=1;a<e;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],n[a]);(this._line||this._line!==0&&e===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}};function km(t){var n,e=t.length-1,r,i=new Array(e),o=new Array(e),a=new Array(e);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n<e-1;++n)i[n]=1,o[n]=4,a[n]=4*t[n]+2*t[n+1];for(i[e-1]=2,o[e-1]=7,a[e-1]=8*t[e-1]+t[e],n=1;n<e;++n)r=i[n]/o[n-1],o[n]-=r,a[n]-=r*a[n-1];for(i[e-1]=a[e-1]/o[e-1],n=e-2;n>=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[e-1]=(t[e]+i[e-1])/2,n=0;n<e-1;++n)o[n]=2*t[n+1]-i[n+1];return[i,o]}function sp(t){return new up(t)}function la(t,n){this._context=t,this._t=n}la.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}break}}this._x=t,this._y=n}};function fp(t){return new la(t,.5)}function lp(t){return new la(t,0)}function dp(t){return new la(t,1)}function En(t){return t!=null&&!Number.isNaN(t)}function hn(t,n){return+En(n)-+En(t)||Et(t,n)}function _a(t,n){return+En(n)-+En(t)||rr(t,n)}function Hf(t){return t!=null&&`${t}`!=""}function f1(t){return isFinite(t)?t:NaN}function Pa(t){return t>0&&isFinite(t)?t:NaN}function Uf(t){return t<0&&isFinite(t)?t:NaN}function m6(t,n){if(t instanceof Date||(t=new Date(+t)),isNaN(t))return typeof n=="function"?n(t):n;let e=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),o=t.getUTCMilliseconds();return`${p6(t.getUTCFullYear())}-${jn(t.getUTCMonth()+1,2)}-${jn(t.getUTCDate(),2)}${e||r||i||o?`T${jn(e,2)}:${jn(r,2)}${i||o?`:${jn(i,2)}${o?`.${jn(o,3)}`:""}`:""}Z`:""}`}function p6(t){return t<0?`-${jn(-t,6)}`:t>9999?`+${jn(t,6)}`:jn(t,4)}function jn(t,n){return`${t}`.padStart(n,"0")}var g6=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function l1(t,n){return g6.test(t+="")?new Date(t):typeof n=="function"?n(t):n}function Er(t){if(t==null)return;let n=t[0],e=t[t.length-1];return rr(n,e)}var kr=1e3,ue=kr*60,se=ue*60,Nn=se*24,An=Nn*7,Ye=Nn*30,ce=Nn*365,ef=[["millisecond",1],["2 milliseconds",2],["5 milliseconds",5],["10 milliseconds",10],["20 milliseconds",20],["50 milliseconds",50],["100 milliseconds",100],["200 milliseconds",200],["500 milliseconds",500],["second",kr],["5 seconds",5*kr],["15 seconds",15*kr],["30 seconds",30*kr],["minute",ue],["5 minutes",5*ue],["15 minutes",15*ue],["30 minutes",30*ue],["hour",se],["3 hours",3*se],["6 hours",6*se],["12 hours",12*se],["day",Nn],["2 days",2*Nn],["week",An],["2 weeks",2*An],["month",Ye],["3 months",3*Ye],["6 months",6*Ye],["year",ce],["2 years",2*ce],["5 years",5*ce],["10 years",10*ce],["20 years",20*ce],["50 years",50*ce],["100 years",100*ce]],Gf=new Map([["second",kr],["minute",ue],["hour",se],["day",Nn],["monday",An],["tuesday",An],["wednesday",An],["thursday",An],["friday",An],["saturday",An],["sunday",An],["week",An],["month",Ye],["year",ce]]),d1=new Map([["second",Dt],["minute",Ne],["hour",Pe],["day",_n],["monday",Oe],["tuesday",ou],["wednesday",au],["thursday",Wn],["friday",cu],["saturday",uu],["sunday",$n],["week",$n],["month",Fe],["year",qt]]),Xf=new Map([["second",Dt],["minute",Le],["hour",Re],["day",pi],["monday",ze],["tuesday",su],["wednesday",fu],["thursday",Hn],["friday",lu],["saturday",du],["sunday",Sn],["week",Sn],["month",qe],["year",Bt]]),qi=Symbol("intervalDuration"),Ra=Symbol("intervalType");for(let[t,n]of d1)n[qi]=Gf.get(t),n[Ra]="time";for(let[t,n]of Xf)n[qi]=Gf.get(t),n[Ra]="utc";var Ti=[["year",Bt,"utc"],["month",qe,"utc"],["day",pi,"utc",6*Ye],["hour",Re,"utc",3*Nn],["minute",Le,"utc",6*se],["second",Dt,"utc",30*ue]],wa=[["year",qt,"time"],["month",Fe,"time"],["day",_n,"time",6*Ye],["hour",Pe,"time",3*Nn],["minute",Ne,"time",6*se],["second",Dt,"time",30*ue]],y6=[Ti[0],wa[0],Ti[1],wa[1],Ti[2],wa[2],...Ti.slice(3)];function h1(t){let n=`${t}`.toLowerCase();n.endsWith("s")&&(n=n.slice(0,-1));let e=1,r=/^(?:(\d+)\s+)/.exec(n);switch(r&&(n=n.slice(r[0].length),e=+r[1]),n){case"quarter":n="month",e*=3;break;case"half":n="month",e*=6;break}let i=Xf.get(n);if(!i)throw new Error(`unknown interval: ${t}`);if(e>1&&!i.every)throw new Error(`non-periodic interval: ${n}`);return[n,e]}function m1(t){return p1(h1(t),"time")}function Vf(t){return p1(h1(t),"utc")}function p1([t,n],e){let r=(e==="time"?d1:Xf).get(t);return n>1&&(r=r.every(n),r[qi]=Gf.get(t)*n,r[Ra]=e),r}function hp(t,n){if(!(n>1))return;let e=t[qi];if(!ef.some(([,i])=>i===e)||e%Nn===0&&Nn<e&&e<Ye)return;let[r]=ef[ir(([,i])=>Math.log(i)).center(ef,Math.log(e*n))];return(t[Ra]==="time"?m1:Vf)(r)}function mp(t,n,e){let r=n==="time"?xi:oe;if(e==null)return r(t==="year"?"%Y":t==="month"?"%Y-%m":t==="day"?"%Y-%m-%d":t==="hour"||t==="minute"?"%Y-%m-%dT%H:%M":t==="second"?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M:%S.%L");let i=b6(e);switch(t){case"millisecond":return $r(r(".%L"),r(":%M:%S"),i);case"second":return $r(r(":%S"),r("%-I:%M"),i);case"minute":return $r(r("%-I:%M"),r("%p"),i);case"hour":return $r(r("%-I %p"),r("%b %-d"),i);case"day":return $r(r("%-d"),r("%b"),i);case"month":return $r(r("%b"),r("%Y"),i);case"year":return r("%Y")}throw new Error("unable to format time ticks")}function b6(t){return t==="left"||t==="right"?(n,e)=>`
|
|
2
2
|
${n}
|
|
3
3
|
${e}`:t==="top"?(n,e)=>`${e}
|
|
4
4
|
${n}`:(n,e)=>`${n}
|
|
5
|
-
${e}`}function i6(t){return t==="time"?ga:t==="utc"?Mi:e6}function o6(t,n,e){let r=Yt(ad(n,(i,o)=>Math.abs(o-i)));if(r<1e3)return a1("millisecond","utc",e);for(let[i,o,a,c]of i6(t)){if(r>c||i==="hour"&&!r)break;if(n.every(u=>o.floor(u)>=u))return a1(i,a,e)}}function wr(t,n,e){return(r,i,o)=>{let a=t(r,i),c=n(r,i),u=i-Sr(o);return i!==u&&o[u]!==void 0&&c===n(o[u],u)?a:e(a,c)}}var Us=Object.getPrototypeOf(Uint8Array),a6=Object.prototype.toString;function Be(t){return t instanceof Array||t instanceof Us}function um(t){return t instanceof Us&&!c6(t)}function fm(t){return t?.prototype instanceof Us&&!u6(t)}function c6(t){return t instanceof BigInt64Array||t instanceof BigUint64Array}function u6(t){return t===BigInt64Array||t===BigUint64Array}var sm=Symbol("reindex");function st(t,n,e){let r=typeof n;return r==="string"?km(t)?Gs(t.getChild(n),e):c1(t,lm(n),e):r==="function"?c1(t,n,e):r==="number"||n instanceof Date||r==="boolean"?mt(t,Xn(n),e):typeof n?.transform=="function"?gs(n.transform(t),e):f6(gs(n,e),t?.[sm])}function f6(t,n){return t!=null&&n?Vs(t,n):t}function c1(t,n,e){return mt(t,fm(e)?(r,i)=>Hs(n(r,i)):n,e)}function gs(t,n){return n===void 0?Ye(t):Am(t)?Gs(t,n):t instanceof n?t:n.from(t,fm(n)&&!um(t)?Hs:void 0)}function Gs(t,n){return t==null?t:(n===void 0||n===Array)&&A6(t.type)?hm(u1(t)):gs(u1(t),n)}function u1(t){return t.nullCount?t.toJSON():t.toArray()}var ya=[null],lm=t=>n=>{let e=n[t];return e===void 0&&n.type==="Feature"?n.properties?.[t]:e},qe={transform:jn},ht={transform:t=>t},s6=()=>1,l6=()=>!0,Tt=t=>t==null?t:`${t}`,Ct=t=>t==null?t:+t,dm=t=>t?t[0]:void 0,ys=t=>t?t[1]:void 0;var Xn=t=>()=>t;function d6(t){let n=+`${t}`.slice(1)/100;return(e,r)=>Jn(e,n,r)}function Sn(t){return um(t)?t:mt(t,Hs,Float64Array)}function Hs(t){return t==null?NaN:Number(t)}function hm(t){return mt(t,pm)}function pm(t){return t instanceof Date&&!isNaN(t)?t:typeof t=="string"?rm(t):t==null||isNaN(t=Number(t))?void 0:new Date(t)}function ln(t,n){return t===void 0&&(t=n),t===null?[void 0,"none"]:La(t)?[void 0,t]:[t,void 0]}function Lt(t,n){return t===void 0&&(t=n),t===null||typeof t=="number"?[void 0,t]:[t,void 0]}function mm(t,n,e){if(t!=null)return hn(t,n,e)}function hn(t,n,e){let r=`${t}`.toLowerCase();if(!e.includes(r))throw new Error(`invalid ${n}: ${t}`);return r}function kr(t){return km(t)?t:Ye(t)}function Ye(t){if(t==null||Be(t))return t;if(Am(t))return Gs(t);if(gm(t))switch(t.type){case"FeatureCollection":return t.features;case"GeometryCollection":return t.geometries;default:return[t]}return Array.from(t)}function gm(t){switch(t?.type){case"FeatureCollection":case"GeometryCollection":case"Feature":case"LineString":case"MultiLineString":case"MultiPoint":case"MultiPolygon":case"Point":case"Polygon":case"Sphere":return!0;default:return!1}}function mt(t,n,e=Array){return t==null?t:t instanceof e?t.map(n):e.from(t,n)}function Si(t,n=Array){return t instanceof n?t.slice():n.from(t)}function ym(t){return t?.x!==void 0||t?.x1!==void 0||t?.x2!==void 0}function bm(t){return t?.y!==void 0||t?.y1!==void 0||t?.y2!==void 0}function Na(t){return ym(t)||bm(t)||t?.interval!==void 0}function se(t){return t?.toString===a6}function xa(t){return se(t)&&(t.type!==void 0||t.domain!==void 0)}function Ra(t){return se(t)&&typeof t.transform!="function"}function Ar(t){return Ra(t)&&t.value===void 0&&t.channel===void 0}function wm(t,n,e,r=ht){return n===void 0&&e===void 0?(n=0,e=t===void 0?r:t):n===void 0?n=t===void 0?0:t:e===void 0&&(e=t===void 0?0:t),[n,e]}function We(t,n){return t===void 0&&n===void 0?[dm,ys]:[t,n]}function Xs({z:t,fill:n,stroke:e}={}){return t===void 0&&([t]=ln(n)),t===void 0&&([t]=ln(e)),t}function ki(t){return Be(t)?t.length:t?.numRows}function jn(t){let n=ki(t),e=new Uint32Array(n);for(let r=0;r<n;++r)e[r]=r;return e}function Vs(t,n){return Be(t)?mt(n,e=>t[e],t.constructor):mt(n,e=>t.at(e))}function h6(t,n,e){return t.subarray?t.subarray(n,e):t.slice(n,e)}function Vn(t){return t!==null&&typeof t=="object"?t.valueOf():t}function p6(t,n){if(n[t]!==void 0)return n[t];switch(t){case"x1":case"x2":t="x";break;case"y1":case"y2":t="y";break}return n[t]}function va(t){let n;return[{transform:()=>n,label:Ue(t)},e=>n=e]}function Ft(t){return t==null?[t]:va(t)}function Ue(t,n){return typeof t=="string"?t:t&&t.label!==void 0?t.label:n}function _a(t,n){return{transform(e){let r=t.transform(e),i=n.transform(e);return qt(r)||qt(i)?mt(r,(o,a)=>new Date((+r[a]+ +i[a])/2)):mt(r,(o,a)=>(+r[a]+ +i[a])/2,Float64Array)},label:t.label}}function Ma(t,n){let e=xm(n?.interval,n?.type);return e?mt(t,e):t}function xm(t,n){let e=js(t,n);return e&&(r=>An(r)?e.floor(r):r)}function js(t,n){if(t!=null){if(typeof t=="number")return m6(t);if(typeof t=="string")return(n==="time"?am:Ws)(t);if(typeof t.floor!="function")throw new Error("invalid interval; missing floor method");if(typeof t.offset!="function")throw new Error("invalid interval; missing offset method");return t}}function m6(t){t=+t,0<t&&t<1&&Number.isInteger(1/t)&&(t=-1/t);let n=Math.abs(t);return t<0?{floor:e=>Math.floor(e*n)/n,offset:(e,r=1)=>(e*n+Math.floor(r))/n,range:(e,r)=>nr(Math.ceil(e*n),r*n).map(i=>i/n)}:{floor:e=>Math.floor(e/n)*n,offset:(e,r=1)=>e+n*Math.floor(r),range:(e,r)=>nr(Math.ceil(e/n),r/n).map(i=>i*n)}}function Rr(t,n){if(t=js(t,n),t&&typeof t.range!="function")throw new Error("invalid interval: missing range method");return t}function g6(t,n){if(t=Rr(t,n),t&&typeof t.ceil!="function")throw new Error("invalid interval: missing ceil method");return t}function y6(t){return _r(t)&&typeof t?.floor=="function"&&t.floor()instanceof Date}function _r(t){return typeof t?.range=="function"}function Ii(t){return t===void 0||Ra(t)?t:{value:t}}function b6(t){return t==null?null:{transform:n=>st(n,t,Float64Array),label:Ue(t)}}function le(t){return t&&typeof t[Symbol.iterator]=="function"}function vm(t){for(let n of t)if(n!=null)return typeof n!="object"||n instanceof Date}function f1(t){for(let n of t){if(n==null)continue;let e=typeof n;return e==="string"||e==="boolean"}}function qt(t){for(let n of t)if(n!=null)return n instanceof Date}function w6(t){for(let n of t)if(n!=null)return typeof n=="string"&&isNaN(n)&&rm(n)}function x6(t){for(let n of t)if(n!=null){if(typeof n!="string")return!1;if(n.trim())return!isNaN(n)}}function v6(t){for(let n of t)if(n!=null)return typeof n=="number"}function _m(t){return ba(t,_6)}function _6(t){return typeof t=="number"&&Number.isInteger(t)&&1500<=t&&t<=2500}function ba(t,n){let e;for(let r of t)if(r!=null){if(!n(r))return!1;e=!0}return e}var M6=new Set("none,currentcolor,transparent,aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow".split(","));function La(t){return typeof t!="string"?!1:(t=t.toLowerCase().trim(),/^#[0-9a-f]{3,8}$/.test(t)||/^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(.*\)$/.test(t)||M6.has(t))}function $6(t){return typeof t=="number"&&(0<=t&&t<=1||isNaN(t))}function Bt(t){return t==null||Ai(t)}function Ai(t){return/^\s*none\s*$/i.test(t)}function S6(t){return/^\s*round\s*$/i.test(t)}function bs(t,n){return mm(t,n,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function Pa(t="middle"){return bs(t,"frameAnchor")}function Mm(t={},...n){let e=t;for(let r of n)for(let i in r)if(e[i]===void 0){let o=r[i];e===t?e={...e,[i]:o}:e[i]=o}return e}function k6(t){console.warn("named iterables are deprecated; please use an object instead");let n=new Set;return Object.fromEntries(Array.from(t,e=>{let{name:r}=e;if(r==null)throw new Error("missing name");let i=`${r}`;if(i==="__proto__")throw new Error(`illegal name: ${i}`);if(n.has(i))throw new Error(`duplicate name: ${i}`);return n.add(i),[r,e]}))}function $m(t){return le(t)?k6(t):t}function Sm(t){return t===!0?t="frame":t===!1?t=null:!gm(t)&&t!=null&&(t=hn(t,"clip",["frame","sphere"]),t==="sphere"&&(t={type:"Sphere"})),t}function km(t){return t&&typeof t.getChild=="function"&&typeof t.toArray=="function"&&t.schema&&Array.isArray(t.schema.fields)}function Am(t){return t&&typeof t.toArray=="function"&&t.type}function A6(t){return t&&(t.typeId===8||t.typeId===10)&&t.unit===1}var kn=Symbol("position"),Zn=Symbol("color"),Oi=Symbol("radius"),zi=Symbol("length"),Lr=Symbol("opacity"),Da=Symbol("symbol"),Tm=Symbol("projection"),ft=new Map([["x",kn],["y",kn],["fx",kn],["fy",kn],["r",Oi],["color",Zn],["opacity",Lr],["symbol",Da],["length",zi],["projection",Tm]]);function T6(t){return t===kn||t===Tm}function C6(t){return t===kn||t===Oi||t===zi||t===Lr}var E6=Math.sqrt(3),N6=2/E6,R6={draw(t,n){let e=Math.sqrt(n/Math.PI),r=e*N6,i=r/2;t.moveTo(0,r),t.lineTo(e,i),t.lineTo(e,-i),t.lineTo(0,-r),t.lineTo(-e,-i),t.lineTo(-e,i),t.closePath()}},Zs=new Map([["asterisk",If],["circle",br],["cross",Of],["diamond",zf],["diamond2",Ff],["hexagon",R6],["plus",Bf],["square",qf],["square2",Yf],["star",Wf],["times",Xf],["triangle",Uf],["triangle2",Gf],["wye",Hf]]);function Ks(t){return t&&typeof t.draw=="function"}function L6(t){return Ks(t)?!0:typeof t!="string"?!1:Zs.has(t.toLowerCase())}function Qs(t){if(t==null||Ks(t))return t;let n=Zs.get(`${t}`.toLowerCase());if(n)return n;throw new Error(`invalid symbol: ${t}`)}function P6(t){if(t==null||Ks(t))return[void 0,t];if(typeof t=="string"){let n=Zs.get(`${t}`.toLowerCase());if(n)return[void 0,n]}return[t,void 0]}function Fi({filter:t,sort:n,reverse:e,transform:r,initializer:i,...o}={},a){if(r===void 0&&(t!=null&&(r=Cm(t)),n!=null&&!Ar(n)&&(r=Jf(r,Js(n))),e&&(r=Jf(r,Em))),a!=null&&i!=null)throw new Error("transforms cannot be applied after initializers");return{...o,...(n===null||Ar(n))&&{sort:n},transform:Jf(r,a)}}function Tr({filter:t,sort:n,reverse:e,initializer:r,...i}={},o){return r===void 0&&(t!=null&&(r=Cm(t)),n!=null&&!Ar(n)&&(r=ts(r,Js(n))),e&&(r=ts(r,Em))),{...i,...(n===null||Ar(n))&&{sort:n},initializer:ts(r,o)}}function Jf(t,n){return t==null?n===null?void 0:n:n==null?t===null?void 0:t:function(e,r,i){return{data:e,facets:r}=t.call(this,e,r,i),n.call(this,kr(e),r,i)}}function ts(t,n){return t==null?n===null?void 0:n:n==null?t===null?void 0:t:function(e,r,i,...o){let a,c,u,f,s,d;return{data:c=e,facets:u=r,channels:a}=t.call(this,e,r,i,...o),{data:s=c,facets:d=u,channels:f}=n.call(this,c,u,{...i,...a},...o),{data:s,facets:d,channels:{...a,...f}}}}function D6(t,n){return(t.initializer!=null?Tr:Fi)(t,n)}function Cm(t){return(n,e)=>{let r=st(n,t);return{data:n,facets:e.map(i=>i.filter(o=>r[o]))}}}function Em(t,n){return{data:t,facets:n.map(e=>e.slice().reverse())}}function I6(t,{sort:n,...e}={}){return{...(Ra(t)&&t.channel!==void 0?Tr:D6)(e,Js(t)),sort:Ar(n)?n:null}}function Js(t){return(typeof t=="function"&&t.length!==1?O6:z6)(t)}function O6(t){return(n,e)=>{let r=Be(n)?(i,o)=>t(n[i],n[o]):(i,o)=>t(n.get(i),n.get(o));return{data:n,facets:e.map(i=>i.slice().sort(r))}}}function z6(t){let n,e;({channel:n,value:t,order:e}={...Ii(t)});let r=n?.startsWith("-");if(r&&(n=n.slice(1)),e===void 0&&(e=r?wa:sn),typeof e!="function")switch(`${e}`.toLowerCase()){case"ascending":e=sn;break;case"descending":e=wa;break;default:throw new Error(`invalid order: ${e}`)}return(i,o,a)=>{let c;if(n===void 0)c=st(i,t);else{if(a===void 0)throw new Error("channel sort requires an initializer");if(c=a[n],!c)return{};c=c.value}let u=(f,s)=>e(c[f],c[s]);return{data:i,facets:o.map(f=>f.slice().sort(u))}}}function F6(t={y:"count"},n={}){let{x:e=ht}=n;if(e==null)throw new Error("missing channel: x");return tl(e,null,t,n)}function B6(t={x:"count"},n={}){let{y:e=ht}=n;if(e==null)throw new Error("missing channel: y");return tl(null,e,t,n)}function q6(t={fill:"count"},n={}){let{x:e,y:r}=n;if([e,r]=We(e,r),e==null)throw new Error("missing channel: x");if(r==null)throw new Error("missing channel: y");return tl(e,r,t,n)}function tl(t,n,{data:e=rl,filter:r,sort:i,reverse:o,...a}={},c={}){a=U6(a,c),e=Pm(e,ht),i=i==null?void 0:Rm("sort",i,c),r=r==null?void 0:Lm("filter",r,c);let[u,f]=Ft(t),[s,d]=Ft(n),{z:l,fill:h,stroke:m,x1:g,x2:x,y1:v,y2:w,...$}=c,[p,b]=Ft(l),[y]=ln(h),[_]=ln(m),[M,S]=Ft(y),[C,k]=Ft(_);return{..."z"in c&&{z:p||l},..."fill"in c&&{fill:M||h},..."stroke"in c&&{stroke:C||m},...Fi($,(T,D,P)=>{let A=Ma(st(T,t),P?.x),O=Ma(st(T,n),P?.y),R=st(T,l),W=st(T,y),L=st(T,_),I=Dm(a,{z:R,fill:W,stroke:L}),q=[],U=[],F=A&&f([]),K=O&&d([]),et=R&&b([]),at=W&&S([]),B=L&&k([]),G=0;for(let N of a)N.initialize(T);i&&i.initialize(T),r&&r.initialize(T);for(let N of D){let z=[];for(let Y of a)Y.scope("facet",N);i&&i.scope("facet",N),r&&r.scope("facet",N);for(let[Y,E]of $i(N,I))for(let[nt,H]of $i(E,O))for(let[J,rt]of $i(H,A)){let ut={data:T};if(A&&(ut.x=J),O&&(ut.y=nt),I&&(ut.z=Y),!(r&&!r.reduce(rt,ut))){z.push(G++),U.push(e.reduceIndex(rt,T,ut)),A&&F.push(J),O&&K.push(nt),R&&et.push(I===R?Y:R[rt[0]]),W&&at.push(I===W?Y:W[rt[0]]),L&&B.push(I===L?Y:L[rt[0]]);for(let En of a)En.reduce(rt,ut);i&&i.reduce(rt,ut)}}q.push(z)}return Im(q,i,o),{data:U,facets:q}}),...!Mr(a,"x")&&(u?{x:u}:{x1:g,x2:x}),...!Mr(a,"y")&&(s?{y:s}:{y1:v,y2:w}),...Object.fromEntries(a.map(({name:T,output:D})=>[T,D]))}}function Mr(t,...n){for(let{name:e}of t)if(n.includes(e))return!0;return!1}function Nm(t,n,e=nl){let r=Object.entries(t);return n.title!=null&&t.title===void 0&&r.push(["title",V6]),n.href!=null&&t.href===void 0&&r.push(["href",il]),r.filter(([,i])=>i!==void 0).map(([i,o])=>o===null?Y6(i):e(i,o,n))}function nl(t,n,e,r=el){let i;se(n)&&"reduce"in n&&(i=n.scale,n=n.reduce);let o=r(t,n,e),[a,c]=va(o.label),u;return{name:t,output:i===void 0?a:{value:a,scale:i},initialize(f){o.initialize(f),u=c([])},scope(f,s){o.scope(f,s)},reduce(f,s){u.push(o.reduce(f,s))}}}function Y6(t){return{name:t,initialize(){},scope(){},reduce(){}}}function el(t,n,e,r=Ia){let i=p6(t,e),o=r(n,i),a,c;return{label:Ue(o===$a?null:i,o.label),initialize(u){a=i===void 0?u:st(u,i),o.scope==="data"&&(c=o.reduceIndex(jn(u),a))},scope(u,f){o.scope===u&&(c=o.reduceIndex(f,a))},reduce(u,f){return o.scope==null?o.reduceIndex(u,a,f):o.reduceIndex(u,a,c,f)}}}function $i(t,n){return n?Br(t,e=>n[e]):[[,t]]}function Ia(t,n,e=W6){if(t==null)return e(t);if(typeof t.reduceIndex=="function")return t;if(typeof t.reduce=="function"&&se(t))return H6(t);if(typeof t=="function")return X6(t);if(/^p\d{2}$/i.test(t))return Gn(d6(t));switch(`${t}`.toLowerCase()){case"first":return il;case"last":return j6;case"identity":return rl;case"count":return $a;case"distinct":return Z6;case"sum":return n==null?$a:K6;case"proportion":return l1(n,"data");case"proportion-facet":return l1(n,"facet");case"deviation":return Gn(Ka);case"min":return Gn(cn);case"min-index":return Gn(nd);case"max":return Gn(Yt);case"max-index":return Gn(td);case"mean":return s1(nc);case"median":return s1(Yr);case"variance":return Gn(Za);case"mode":return Gn(od)}return e(t)}function W6(t){throw new Error(`invalid reduce: ${t}`)}function U6(t,n){return Nm(t,n,Rm)}function Rm(t,n,e){return nl(t,n,e,Lm)}function Lm(t,n,e){return el(t,n,e,Pm)}function Pm(t,n){return Ia(t,n,G6)}function G6(t){switch(`${t}`.toLowerCase()){case"x":return Q6;case"y":return J6;case"z":return Om}throw new Error(`invalid group reduce: ${t}`)}function Dm(t,n){for(let e in n){let r=n[e];if(r!==void 0&&!t.some(i=>i.name===e))return r}}function Im(t,n,e){if(n){let r=n.output.transform(),i=(o,a)=>sn(r[o],r[a]);t.forEach(o=>o.sort(i))}e&&t.forEach(r=>r.reverse())}function H6(t){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...t,reduceIndex:t.reduce.bind(t)}}function X6(t){return{reduceIndex(n,e,r){return t(Vs(e,n),r)}}}function Gn(t){return{reduceIndex(n,e){return t(n,r=>e[r])}}}function s1(t){return{reduceIndex(n,e){let r=t(n,i=>e[i]);return qt(e)?new Date(r):r}}}var rl={reduceIndex(t,n){return Vs(n,t)}},il={reduceIndex(t,n){return n[t[0]]}},V6={reduceIndex(t,n){let r=Fr(ye(t,o=>o.length,o=>n[o]),ys),i=r.slice(-5).reverse();if(i.length<r.length){let o=r.slice(0,-4);i[4]=[`\u2026 ${o.length.toLocaleString("en-US")} more`,mn(o,ys)]}return i.map(([o,a])=>`${o} (${a.toLocaleString("en-US")})`).join(`
|
|
6
|
-
`)}},j6={reduceIndex(t,n){return n[t[t.length-1]]}},$a={label:"Frequency",reduceIndex(t){return t.length}},Z6={label:"Distinct",reduceIndex(t,n){let e=new ge;for(let r of t)e.add(n[r]);return e.size}},K6=Gn(mn);function l1(t,n){return t==null?{scope:n,label:"Frequency",reduceIndex:(e,r,i=1)=>e.length/i}:{scope:n,reduceIndex:(e,r,i=1)=>mn(e,o=>r[o])/i}}var Q6={reduceIndex(t,n,{x:e}){return e}},J6={reduceIndex(t,n,{y:e}){return e}},Om={reduceIndex(t,n,{z:e}){return e}};function Ti(t,{scale:n,type:e,value:r,filter:i,hint:o,label:a=Ue(r)},c){return o===void 0&&typeof r?.transform=="function"&&(o=r.hint),zm(c,{scale:n,type:e,value:st(t,r),label:a,filter:i,hint:o})}function t5(t,n){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e,Ti(n,r,e)]))}function n5(t,n){let e=Object.fromEntries(Object.entries(t).map(([r,{scale:i,value:o}])=>{let a=i==null?null:n[i];return[r,a==null?o:mt(o,a)]}));return e.channels=t,e}function zm(t,n){let{scale:e,value:r}=n;if(e===!0||e==="auto")switch(t){case"fill":case"stroke":case"color":n.scale=e!==!0&&ba(r,La)?null:"color",n.defaultScale="color";break;case"fillOpacity":case"strokeOpacity":case"opacity":n.scale=e!==!0&&ba(r,$6)?null:"opacity",n.defaultScale="opacity";break;case"symbol":e!==!0&&ba(r,L6)?(n.scale=null,n.value=mt(r,Qs)):n.scale="symbol",n.defaultScale="symbol";break;default:n.scale=ft.has(t)?t:null;break}else if(e===!1)n.scale=null;else if(e!=null&&!ft.has(e))throw new Error(`unknown scale: ${e}`);return n}function e5(t,n,e,r,i){let{order:o,reverse:a,reduce:c=!0,limit:u}=i;for(let f in i){if(!ft.has(f))continue;let{value:s,order:d=o,reverse:l=a,reduce:h=c,limit:m=u}=Ii(i[f]),g=s?.startsWith("-");if(g&&(s=s.slice(1)),d=d===void 0?g!==(s==="width"||s==="height")?Bm:Fm:o5(d),h==null||h===!1)continue;let x=f==="fx"||f==="fy"?i5(n,r[f]):r5(e,f);if(!x)throw new Error(`missing channel for scale: ${f}`);let v=x.value,[w=0,$=1/0]=le(m)?m:m<0?[m]:[0,m];if(s==null)x.domain=()=>{let p=Array.from(new ge(v));return l&&(p=p.reverse()),(w!==0||$!==1/0)&&(p=p.slice(w,$)),p};else{let p=s==="data"?t:s==="height"?d1(e,"y1","y2"):s==="width"?d1(e,"x1","x2"):ws(e,s,s==="y"?"y2":s==="x"?"x2":void 0),b=Ia(h===!0?"max":h,p);x.domain=()=>{let y=Kl(jn(v),_=>b.reduceIndex(_,p),_=>v[_]);return d&&y.sort(d),l&&y.reverse(),(w!==0||$!==1/0)&&(y=y.slice(w,$)),y.map(dm)}}}}function r5(t,n){for(let e in t){let r=t[e];if(r.scale===n)return r}}function i5(t,n){let e=t.original;if(e===t)return n;let r=n.value,i=n.value=[];for(let o=0;o<e.length;++o){let a=r[e[o][0]];for(let c of t[o])i[c]=a}return n}function d1(t,n,e){let r=ws(t,n),i=ws(t,e);return mt(i,(o,a)=>Math.abs(o-r[a]),Float64Array)}function ws(t,n,e){let r=t[n];if(!r&&e!==void 0&&(r=t[e]),r)return r.value;throw new Error(`missing channel: ${n}`)}function o5(t){if(t==null||typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"ascending":return Fm;case"descending":return Bm}throw new Error(`invalid order: ${t}`)}function Fm([t,n],[e,r]){return sn(n,r)||sn(t,e)}function Bm([t,n],[e,r]){return wa(n,r)||sn(t,e)}function h1(t,n){let e=t[n];if(e){for(;e.source;)e=e.source;return e.source===null?null:e}}function ol(t={}){let{document:n=typeof window<"u"?window.document:void 0,clip:e}=t;return{document:n,clip:Sm(e)}}function pt(t,{document:n}){return Rn(Ur(t).call(n.documentElement))}var xs=0,vs;function a5(){let t=xs;return xs=0,vs=void 0,t}function fe(t){t!==vs&&(vs=t,console.warn(t),++xs)}var qm=Math.PI,Yn=2*qm,ns=.618;function c5({projection:t,inset:n=0,insetTop:e=n,insetRight:r=n,insetBottom:i=n,insetLeft:o=n}={},a){if(t==null)return;if(typeof t.stream=="function")return u5(t);let c,u,f="frame";if(se(t)){let y;if({type:t,domain:u,inset:y,insetTop:e=y!==void 0?y:e,insetRight:r=y!==void 0?y:r,insetBottom:i=y!==void 0?y:i,insetLeft:o=y!==void 0?y:o,clip:f=f,...c}=t,t==null)return}typeof t!="function"&&({type:t}=_s(t));let{width:s,height:d,marginLeft:l,marginRight:h,marginTop:m,marginBottom:g}=a,x=s-l-h-o-r,v=d-m-g-e-i;if(t=t?.({width:x,height:v,clip:f,...c}),t==null)return;f=f5(f,l,m,s-h,d-g);let w=l+o,$=m+e,p,b=1;if(u!=null){let[[y,_],[M,S]]=Io(t).bounds(u);b=Math.min(x/(M-y),v/(S-_)),b>0?(w-=(b*(y+M)-x)/2,$-=(b*(_+S)-v)/2,p=l5(b,w,$)):fe("Warning: the projection could not be fit to the specified domain; using the default scale.")}return p??=Wm(w,$),{stream(y){return t.stream(p.stream(f(y)))},apply(y){let _=null;return this.stream({point:(...M)=>_=M}).point(...y),_},...t.invert&&{invert(y){return t.invert(p.invert(y))}}}}function u5(t){return typeof t=="function"?{stream:n=>t.stream(n),apply:n=>t(n),...t.invert&&{invert:n=>t.invert(n)}}:t}function _s(t){switch(`${t}`.toLowerCase()){case"albers-usa":return fn(Jh,.7463,.4673);case"albers":return ua(jc,.7463,.4673);case"azimuthal-equal-area":return fn(e0,4,4);case"azimuthal-equidistant":return fn(i0,Yn,Yn);case"conic-conformal":return ua(c0,Yn,Yn);case"conic-equal-area":return ua(ci,6.1702,2.9781);case"conic-equidistant":return ua(f0,7.312,3.6282);case"equal-earth":return fn(l0,5.4133,2.6347);case"equirectangular":return fn(u0,Yn,qm);case"gnomonic":return fn(h0,3.4641,3.4641);case"identity":return{type:Ym};case"reflect-y":return{type:s5};case"mercator":return fn(o0,Yn,Yn);case"orthographic":return fn(m0,2,2);case"stereographic":return fn(y0,2,2);case"transverse-mercator":return fn(w0,Yn,Yn);default:throw new Error(`unknown projection type: ${t}`)}}function f5(t,n,e,r,i){if(t===!1||t==null||typeof t=="number")return o=>o;if(t===!0&&(t="frame"),`${t}`.toLowerCase()==="frame")return Gc(n,e,r,i);throw new Error(`unknown projection clip type: ${t}`)}function fn(t,n,e){return{type:({width:r,height:i,rotate:o,precision:a=.15,clip:c})=>{let u=t();return a!=null&&u.precision?.(a),o!=null&&u.rotate?.(o),typeof c=="number"&&u.clipAngle?.(c),r!=null&&(u.scale(Math.min(r/n,i/e)),u.translate([r/2,i/2])),u},aspectRatio:e/n}}function ua(t,n,e){let{type:r,aspectRatio:i}=fn(t,n,e);return{type:o=>{let{parallels:a,domain:c,width:u,height:f}=o,s=r(o);return a!=null&&(s.parallels(a),c===void 0&&u!=null&&s.fitSize([u,f],{type:"Sphere"})),s},aspectRatio:i}}var Ym=Xn({stream:t=>t,invert:t=>t}),s5=Xn({...ui({point(t,n){this.stream.point(t,-n)}}),invert:([t,n])=>[t,-n]});function Wm(t,n){return t===0&&n===0?Ym():{...ui({point(e,r){this.stream.point(e+t,r+n)}}),invert:([e,r])=>[e-t,r-n]}}function l5(t,n,e){return t===1?Wm(n,e):{...ui({point(r,i){this.stream.point(r*t+n,i*t+e)}}),invert:([r,i])=>[(r-n)/t,(i-e)/t]}}function d5(t,n,e,r){let i=e[t],o=e[n],a=i.length,c=e[t]=new Float64Array(a).fill(NaN),u=e[n]=new Float64Array(a).fill(NaN),f,s=r.stream({point(d,l){c[f]=d,u[f]=l}});for(f=0;f<a;++f)s.point(i[f],o[f])}function h5({projection:t}={}){return t==null?!1:typeof t.stream=="function"?!0:(se(t)&&(t=t.type),t!=null)}function p5(t){if(typeof t?.stream=="function")return ns;if(se(t)){let n,e;if({domain:n,type:t,...e}=t,n!=null&&t!=null){let r=typeof t=="string"?_s(t).type:t,[[i,o],[a,c]]=Io(r({...e,width:100,height:100})).bounds(n),u=(c-o)/(a-i);return u&&isFinite(u)?u<.2?.2:u>5?5:u:ns}}if(t!=null){if(typeof t!="function"){let{aspectRatio:n}=_s(t);if(n)return n}return ns}}function m5(t){let n=[],e=[],r={scale:"x",value:n},i={scale:"y",value:e},o={point(a,c){n.push(a),e.push(c)},lineStart(){},lineEnd(){},polygonStart(){},polygonEnd(){},sphere(){}};for(let a of t.value)ee(a,o);return[r,i]}function g5({x:t,y:n}){if(t||n)return t??=e=>e,n??=e=>e,ui({point(e,r){this.stream.point(t(e),n(r))}})}var Um=new Map([["accent",ip],["category10",rp],["dark2",op],["observable10",ap],["paired",cp],["pastel1",up],["pastel2",fp],["set1",sp],["set2",lp],["set3",dp],["tableau10",hp]]);function y5(t){return t!=null&&Um.has(`${t}`.toLowerCase())}var p1=new Map([...Um,["brbg",Wn(Mu,$u)],["prgn",Wn(Su,ku)],["piyg",Wn(Au,Tu)],["puor",Wn(Cu,Eu)],["rdbu",Wn(Zo,bi)],["rdgy",Wn(Nu,Ru)],["rdylbu",Wn(Ko,wi)],["rdylgn",Wn(Lu,Pu)],["spectral",Wn(Du,Iu)],["burd",m1(Zo,bi)],["buylrd",m1(Ko,wi)],["blues",Mt(uf,ff)],["greens",Mt(sf,lf)],["greys",Mt(df,hf)],["oranges",Mt(bf,wf)],["purples",Mt(pf,mf)],["reds",Mt(gf,yf)],["turbo",Un(kf)],["viridis",Un(Af)],["magma",Un(Tf)],["inferno",Un(Cf)],["plasma",Un(Ef)],["cividis",Un(xf)],["cubehelix",Un(vf)],["warm",Un(_f)],["cool",Un(Mf)],["bugn",Mt(Ou,zu)],["bupu",Mt(Fu,Bu)],["gnbu",Mt(qu,Yu)],["orrd",Mt(Wu,Uu)],["pubu",Mt(Xu,Vu)],["pubugn",Mt(Gu,Hu)],["purd",Mt(ju,Zu)],["rdpu",Mt(Ku,Qu)],["ylgn",Mt(nf,ef)],["ylgnbu",Mt(Ju,tf)],["ylorbr",Mt(rf,of)],["ylorrd",Mt(af,cf)],["rainbow",g1($f)],["sinebow",g1(Sf)]]);function Mt(t,n){return({length:e})=>e===1?[t[3][1]]:e===2?[t[3][1],t[3][2]]:(e=Math.max(3,Math.floor(e)),e>9?Gt(n,e):t[e])}function Wn(t,n){return({length:e})=>e===2?[t[3][0],t[3][2]]:(e=Math.max(3,Math.floor(e)),e>11?Gt(n,e):t[e])}function m1(t,n){return({length:e})=>e===2?[t[3][2],t[3][0]]:(e=Math.max(3,Math.floor(e)),e>11?Gt(r=>n(1-r),e):t[e].slice().reverse())}function Un(t){return({length:n})=>Gt(t,Math.max(2,Math.floor(n)))}function g1(t){return({length:n})=>Gt(t,Math.floor(n)+1).slice(0,-1)}function Gm(t){let n=`${t}`.toLowerCase();if(!p1.has(n))throw new Error(`unknown ordinal scheme: ${n}`);return p1.get(n)}function Oa(t,n){let e=Gm(t),r=typeof e=="function"?e({length:n}):e;return r.length!==n?r.slice(0,n):r}function b5(t,n="greys"){let e=new Set,[r,i]=Oa(n,2);for(let o of t)if(o!=null)if(o===!0)e.add(i);else if(o===!1)e.add(r);else return;return[...e]}var y1=new Map([["brbg",$u],["prgn",ku],["piyg",Tu],["puor",Eu],["rdbu",bi],["rdgy",Ru],["rdylbu",wi],["rdylgn",Pu],["spectral",Iu],["burd",t=>bi(1-t)],["buylrd",t=>wi(1-t)],["blues",ff],["greens",lf],["greys",hf],["purples",mf],["reds",yf],["oranges",wf],["turbo",kf],["viridis",Af],["magma",Tf],["inferno",Cf],["plasma",Ef],["cividis",xf],["cubehelix",vf],["warm",_f],["cool",Mf],["bugn",zu],["bupu",Bu],["gnbu",Yu],["orrd",Uu],["pubugn",Hu],["pubu",Vu],["purd",Zu],["rdpu",Qu],["ylgnbu",tf],["ylgn",ef],["ylorbr",of],["ylorrd",cf],["rainbow",$f],["sinebow",Sf]]);function al(t){let n=`${t}`.toLowerCase();if(!y1.has(n))throw new Error(`unknown quantitative scheme: ${n}`);return y1.get(n)}var w5=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function x5(t){return t!=null&&w5.has(`${t}`.toLowerCase())}var Hm=t=>n=>t(1-n),es=[0,1],b1=new Map([["number",$t],["rgb",cr],["hsl",Qd],["hcl",nh],["lab",Jd]]);function Xm(t){let n=`${t}`.toLowerCase();if(!b1.has(n))throw new Error(`unknown interpolator: ${n}`);return b1.get(n)}function Bi(t,n,e,{type:r,nice:i,clamp:o,zero:a,domain:c=jm(t,e),unknown:u,round:f,scheme:s,interval:d,range:l=ft.get(t)===Oi?N5(e,c):ft.get(t)===zi?R5(e,c):ft.get(t)===Lr?es:void 0,interpolate:h=ft.get(t)===Zn?s==null&&l!==void 0?cr:al(s!==void 0?s:r==="cyclical"?"rainbow":"turbo"):f?Vr:$t,reverse:m}){if(c=w1(c),d=Rr(d,r),(r==="cyclical"||r==="sequential")&&(r="linear"),typeof h!="function"&&(h=Xm(h)),m=!!m,l!==void 0){let g=c.length,x=(l=w1(l)).length;if(g!==x){if(h.length===1)throw new Error("invalid piecewise interpolator");h=fr(h,l),l=void 0}}if(h.length===1?(m&&(h=Hm(h),m=!1),l===void 0&&(l=Float64Array.from(c,(g,x)=>x/(c.length-1)),l.length===2&&(l=es)),n.interpolate((l===es?Xn:ul)(h))):n.interpolate(h),a){let[g,x]=Wt(c);(g>0||x<0)&&(c=Si(c),(Sr(c)||1)===Math.sign(g)?c[0]=0:c[c.length-1]=0)}return m&&(c=Wr(c)),n.domain(c).unknown(u),i&&(n.nice(v5(i,r)),c=n.domain()),l!==void 0&&n.range(l),o&&n.clamp(o),{type:r,domain:c,range:l,scale:n,interpolate:h,interval:d}}function w1(t){return t=Ye(t),t.length>=2?t:[t[0],t[0]]}function v5(t,n){return t===!0?void 0:typeof t=="number"?t:g6(t,n)}function _5(t,n,e){return Bi(t,Go(),n,e)}function M5(t,n,e){return Vm(t,n,{...e,exponent:.5})}function Vm(t,n,{exponent:e=1,...r}){return Bi(t,mu().exponent(e),n,{...r,type:"pow"})}function $5(t,n,{base:e=10,domain:r=L5(n),...i}){return Bi(t,hu().base(e),n,{...i,domain:r})}function S5(t,n,{constant:e=1,...r}){return Bi(t,pu().constant(e),n,r)}function k5(t,n,{range:e,quantiles:r=e===void 0?5:(e=[...e]).length,n:i=r,scheme:o="rdylbu",domain:a=P5(n),unknown:c,interpolate:u,reverse:f}){return e===void 0&&(e=u!==void 0?Gt(u,i):ft.get(t)===Zn?Oa(o,i):void 0),a.length>0&&(a=gu(a,e===void 0?{length:i}:e).quantiles()),cl(t,n,{domain:a,range:e,reverse:f,unknown:c})}function A5(t,n,{range:e,n:r=e===void 0?5:(e=[...e]).length,scheme:i="rdylbu",domain:o=jm(t,n),unknown:a,interpolate:c,reverse:u}){let[f,s]=Wt(o),d;return e===void 0?(d=be(f,s,r),d[0]<=f&&d.splice(0,1),d[d.length-1]>=s&&d.pop(),r=d.length+1,e=c!==void 0?Gt(c,r):ft.get(t)===Zn?Oa(i,r):void 0):(d=Gt($t(f,s),r+1).slice(1,-1),f instanceof Date&&(d=d.map(l=>new Date(l)))),Sr(Ye(o))<0&&d.reverse(),cl(t,n,{domain:d,range:e,reverse:u,unknown:a})}function cl(t,n,{domain:e=[0],unknown:r,scheme:i="rdylbu",interpolate:o,range:a=o!==void 0?Gt(o,e.length+1):ft.get(t)===Zn?Oa(i,e.length+1):void 0,reverse:c}){e=Ye(e);let u=Sr(e);if(!isNaN(u)&&!T5(e,u))throw new Error(`the ${t} scale has a non-monotonic domain`);return c&&(a=Wr(a)),{type:"threshold",scale:yu(u<0?Wr(e):e,a===void 0?[]:a).unknown(r),domain:e,range:a}}function T5(t,n){for(let e=1,r=t.length,i=t[0];e<r;++e){let o=Qe(i,i=t[e]);if(o!==0&&o!==n)return!1}return!0}function C5(t){return{type:"identity",scale:C6(ft.get(t))?du():n=>n}}function Ci(t,n=em){return t.length?[cn(t,({value:e})=>e===void 0?e:cn(e,n)),Yt(t,({value:e})=>e===void 0?e:Yt(e,n))]:[0,1]}function jm(t,n){let e=ft.get(t);return(e===Oi||e===Lr||e===zi?E5:Ci)(n)}function E5(t){return[0,t.length?Yt(t,({value:n})=>n===void 0?n:Yt(n,em)):1]}function N5(t,n){let e=t.find(({radius:a})=>a!==void 0);if(e!==void 0)return[0,e.radius];let r=Jn(t,.5,({value:a})=>a===void 0?NaN:Jn(a,.25,Ca)),i=n.map(a=>3*Math.sqrt(a/r)),o=30/Yt(i);return o<1?i.map(a=>a*o):i}function R5(t,n){let e=Yr(t,({value:o})=>o===void 0?NaN:Yr(o,Math.abs)),r=n.map(o=>12*o/e),i=60/Yt(r);return i<1?r.map(o=>o*i):r}function L5(t){for(let{value:n}of t)if(n!==void 0)for(let e of n){if(e>0)return Ci(t,Ca);if(e<0)return Ci(t,Bs)}return[1,10]}function P5(t){let n=[];for(let{value:e}of t)if(e!==void 0)for(let r of e)n.push(r);return n}function ul(t){return(n,e)=>r=>t(n+r*(e-n))}function za(t,n,e,r,{type:i,nice:o,clamp:a,domain:c=Ci(r),unknown:u,pivot:f=0,scheme:s,range:d,symmetric:l=!0,interpolate:h=ft.get(t)===Zn?s==null&&d!==void 0?cr:al(s!==void 0?s:"rdbu"):$t,reverse:m}){f=+f,c=Ye(c);let[g,x]=c;if(c.length>2&&fe(`Warning: the diverging ${t} scale domain contains extra elements.`),Qe(g,x)<0&&([g,x]=[x,g],m=!m),g=Math.min(g,f),x=Math.max(x,f),typeof h!="function"&&(h=Xm(h)),d!==void 0&&(h=h.length===1?ul(h)(...d):fr(h,d)),m&&(h=Hm(h)),l){let v=e.apply(f),w=v-e.apply(g),$=e.apply(x)-v;w<$?g=e.invert(v-$):w>$&&(x=e.invert(v+w))}return n.domain([g,f,x]).unknown(u).interpolator(h),a&&n.clamp(a),o&&n.nice(o),{type:i,domain:[g,x],pivot:f,interpolate:h,scale:n}}function D5(t,n,e){return za(t,wu(),F5,n,e)}function I5(t,n,e){return Zm(t,n,{...e,exponent:.5})}function Zm(t,n,{exponent:e=1,...r}){return za(t,_u().exponent(e=+e),Y5(e),n,{...r,type:"diverging-pow"})}function O5(t,n,{base:e=10,pivot:r=1,domain:i=Ci(n,r<0?Bs:Ca),...o}){return za(t,xu().base(e=+e),B5,n,{domain:i,pivot:r,...o})}function z5(t,n,{constant:e=1,...r}){return za(t,vu().constant(e=+e),W5(e),n,r)}var F5={apply(t){return t},invert(t){return t}},B5={apply:Math.log,invert:Math.exp},q5={apply(t){return Math.sign(t)*Math.sqrt(Math.abs(t))},invert(t){return Math.sign(t)*(t*t)}};function Y5(t){return t===.5?q5:{apply(n){return Math.sign(n)*Math.pow(Math.abs(n),t)},invert(n){return Math.sign(n)*Math.pow(Math.abs(n),1/t)}}}function W5(t){return{apply(n){return Math.sign(n)*Math.log1p(Math.abs(n/t))},invert(n){return Math.sign(n)*Math.expm1(Math.abs(n))*t}}}function Km(t,n,e,r){return Bi(t,n,e,r)}function U5(t,n,e){return Km(t,np(),n,e)}function G5(t,n,e){return Km(t,ep(),n,e)}var qi=Symbol("ordinal");function Qm(t,n,e,{type:r,interval:i,domain:o,range:a,reverse:c,hint:u}){return i=Rr(i,r),o===void 0&&(o=tg(e,i,t)),(r==="categorical"||r===qi)&&(r="ordinal"),c&&(o=Wr(o)),o=n.domain(o).domain(),a!==void 0&&(typeof a=="function"&&(a=a(o)),n.range(a)),{type:r,domain:o,range:a,scale:n,hint:u,interval:i}}function H5(t,n,{type:e,interval:r,domain:i,range:o,scheme:a,unknown:c,...u}){r=Rr(r,e),i===void 0&&(i=tg(n,r,t));let f;if(ft.get(t)===Da)f=j5(n),o=o===void 0?Z5(f):mt(o,Qs);else if(ft.get(t)===Zn){if(o===void 0&&(e==="ordinal"||e===qi)&&(o=b5(i,a),o!==void 0&&(a=void 0)),a===void 0&&o===void 0&&(a=e==="ordinal"?"turbo":"observable10"),a!==void 0)if(o!==void 0){let s=al(a),d=o[0],l=o[1]-o[0];o=({length:h})=>Gt(m=>s(d+l*m),h)}else o=Gm(a)}else ft.get(t)===Lr&&o===void 0&&(o=({length:s})=>Gt(d=>d,s));if(c===qo)throw new Error(`implicit unknown on ${t} scale is not supported`);return Qm(t,Wo().unknown(c),n,{...u,type:e,domain:i,range:o,hint:f})}function X5(t,n,{align:e=.5,padding:r=.5,...i}){return Jm(j0().align(e).padding(r),n,i,t)}function V5(t,n,{align:e=.5,padding:r=.1,paddingInner:i=r,paddingOuter:o=t==="fx"||t==="fy"?0:r,...a}){return Jm(mi().align(e).paddingInner(i).paddingOuter(o),n,a,t)}function Jm(t,n,e,r){let{round:i}=e;return i!==void 0&&t.round(i=!!i),t=Qm(r,t,n,e),t.round=i,t}function tg(t,n,e){let r=new ge;for(let{value:i,domain:o}of t){if(o!==void 0)return o();if(i!==void 0)for(let a of i)r.add(a)}if(e==="opacity"&&r.add(0),n!==void 0){let[i,o]=Wt(r).map(n.floor,n);return n.range(i,n.offset(o))}if(r.size>1e4&&ft.get(e)===kn)throw new Error(`implicit ordinal domain of ${e} scale has more than 10,000 values`);return Fr(r,sn)}function x1(t,n){let e;for(let{hint:r}of t){let i=r?.[n];if(i!==void 0){if(e===void 0)e=i;else if(e!==i)return}}return e}function j5(t){return{fill:x1(t,"fill"),stroke:x1(t,"stroke")}}function Z5(t){return Bt(t.fill)?Np:Ep}function Ms(t,{label:n,inset:e=0,insetTop:r=e,insetRight:i=e,insetBottom:o=e,insetLeft:a=e,round:c,nice:u,clamp:f,zero:s,align:d,padding:l,projection:h,facet:{label:m=n}={},...g}={}){let x={};for(let[v,w]of t){let $=g[v],p=ig(v,w,{round:ft.get(v)===kn?c:void 0,nice:u,clamp:f,zero:s,align:d,padding:l,projection:h,...$});if(p){let{label:b=v==="fx"||v==="fy"?m:n,percent:y,transform:_,inset:M,insetTop:S=M!==void 0?M:v==="y"?r:0,insetRight:C=M!==void 0?M:v==="x"?i:0,insetBottom:k=M!==void 0?M:v==="y"?o:0,insetLeft:T=M!==void 0?M:v==="x"?a:0}=$||{};if(_==null)_=void 0;else if(typeof _!="function")throw new Error("invalid scale transform; not a function");p.percent=!!y,p.label=b===void 0?Q5(w,p):b,p.transform=_,v==="x"||v==="fx"?(p.insetLeft=+T,p.insetRight=+C):(v==="y"||v==="fy")&&(p.insetTop=+S,p.insetBottom=+k),x[v]=p}}return x}function v1(t){let n={},e={scales:n};for(let[r,i]of Object.entries(t)){let{scale:o,type:a,interval:c,label:u}=i;n[r]=cg(i),e[r]=o,o.type=a,c!=null&&(o.interval=c),u!=null&&(o.label=u)}return e}function K5(t,n){let{x:e,y:r,fx:i,fy:o}=t,a=i||o?fl(n):n;i&&_1(i,a),o&&M1(o,a);let c=i||o?ng(t,n):n;e&&_1(e,c),r&&M1(r,c)}function Q5(t=[],n){let e;for(let{label:r}of t)if(r!==void 0){if(e===void 0)e=r;else if(e!==r)return}if(e!==void 0)return!Ge(n)&&n.percent&&(e=`${e} (%)`),{inferred:!0,toString:()=>e}}function J5(t){return Math.sign(Sr(t.domain()))*Math.sign(Sr(t.range()))}function fl(t){let{marginTop:n,marginRight:e,marginBottom:r,marginLeft:i,width:o,height:a,facet:{marginTop:c,marginRight:u,marginBottom:f,marginLeft:s}}=t;return{marginTop:Math.max(n,c),marginRight:Math.max(e,u),marginBottom:Math.max(r,f),marginLeft:Math.max(i,s),width:o,height:a}}function ng({fx:t,fy:n},e){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:a,width:c,height:u}=fl(e);return{marginTop:r,marginRight:i,marginBottom:o,marginLeft:a,width:t?t.scale.bandwidth()+a+i:c,height:n?n.scale.bandwidth()+r+o:u,facet:{width:c,height:u}}}function _1(t,n){if(t.range===void 0){let{insetLeft:e,insetRight:r}=t,{width:i,marginLeft:o=0,marginRight:a=0}=n,c=o+e,u=i-a-r;t.range=[c,Math.max(c,u)],Ge(t)||(t.range=rg(t)),t.scale.range(t.range)}eg(t)}function M1(t,n){if(t.range===void 0){let{insetTop:e,insetBottom:r}=t,{height:i,marginTop:o=0,marginBottom:a=0}=n,c=o+e,u=i-a-r;t.range=[Math.max(c,u),c],Ge(t)?t.range.reverse():t.range=rg(t),t.scale.range(t.range)}eg(t)}function eg(t){t.round===void 0&&r3(t)&&t3(t)<=30&&t.scale.round(!0)}function t3({scale:t}){let n=t.domain().length,[e,r]=t.range(),i=t.paddingInner?t.paddingInner():1,o=t.paddingOuter?t.paddingOuter():t.padding(),a=n-i,c=Math.abs(r-e)/Math.max(1,a+o*2);return(c-Math.floor(c))*a}function rg(t){let n=t.scale.domain().length+og(t);if(!(n>2))return t.range;let[e,r]=t.range;return Array.from({length:n},(i,o)=>e+o/(n-1)*(r-e))}function n3(t,n,e){return ig(t,e===void 0?void 0:[{hint:e}],{...n})}function ig(t,n=[],e={}){let r=e3(t,n,e);if(e.type===void 0&&e.domain===void 0&&e.range===void 0&&e.interval==null&&t!=="fx"&&t!=="fy"&&Ge({type:r})){let i=n.map(({value:o})=>o).filter(o=>o!==void 0);i.some(qt)?fe(`Warning: some data associated with the ${t} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${xr(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${t} scale to "${xr(r)}".`):i.some(w6)?fe(`Warning: some data associated with the ${t} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${xr(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${t} scale to "${xr(r)}".`):i.some(x6)&&fe(`Warning: some data associated with the ${t} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${xr(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${t} scale to "${xr(r)}".`)}switch(e.type=r,r){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":e=fa(n,e,Sn);break;case"identity":switch(ft.get(t)){case kn:e=fa(n,e,Sn);break;case Da:e=fa(n,e,i3);break}break;case"utc":case"time":e=fa(n,e,hm);break}switch(r){case"diverging":return D5(t,n,e);case"diverging-sqrt":return I5(t,n,e);case"diverging-pow":return Zm(t,n,e);case"diverging-log":return O5(t,n,e);case"diverging-symlog":return z5(t,n,e);case"categorical":case"ordinal":case qi:return H5(t,n,e);case"cyclical":case"sequential":case"linear":return _5(t,n,e);case"sqrt":return M5(t,n,e);case"threshold":return cl(t,n,e);case"quantile":return k5(t,n,e);case"quantize":return A5(t,n,e);case"pow":return Vm(t,n,e);case"log":return $5(t,n,e);case"symlog":return S5(t,n,e);case"utc":return G5(t,n,e);case"time":return U5(t,n,e);case"point":return X5(t,n,e);case"band":return V5(t,n,e);case"identity":return C5(t);case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function xr(t){return typeof t=="symbol"?t.description:t}function $1(t){return typeof t=="string"?`${t}`.toLowerCase():t}var S1={toString:()=>"projection"};function e3(t,n,{type:e,domain:r,range:i,scheme:o,pivot:a,projection:c}){if(e=$1(e),t==="fx"||t==="fy")return"band";(t==="x"||t==="y")&&c!=null&&(e=S1);for(let s of n){let d=$1(s.type);if(d!==void 0){if(e===void 0)e=d;else if(e!==d)throw new Error(`scale incompatible with channel: ${e} !== ${d}`)}}if(e===S1)return;if(e!==void 0)return e;if(r===void 0&&!n.some(({value:s})=>s!==void 0))return;let u=ft.get(t);if(u===Oi)return"sqrt";if(u===Lr||u===zi)return"linear";if(u===Da)return"ordinal";let f=(r??i)?.length;if(f<2||f>2)return rs(u);if(r!==void 0){if(f1(r))return rs(u);if(qt(r))return"utc"}else{let s=n.map(({value:d})=>d).filter(d=>d!==void 0);if(s.some(f1))return rs(u);if(s.some(qt))return"utc"}if(u===Zn){if(a!=null||x5(o))return"diverging";if(y5(o))return"categorical"}return"linear"}function rs(t){switch(t){case kn:return"point";case Zn:return qi;default:return"ordinal"}}function Ge({type:t}){return t==="ordinal"||t==="point"||t==="band"||t===qi}function og({type:t}){return t==="threshold"}function r3({type:t}){return t==="point"||t==="band"}function Cn(t){if(t===void 0)return!0;let n=t.domain(),e=t(n[0]);for(let r=1,i=n.length;r<i;++r)if(t(n[r])-e)return!1;return!0}function fa(t,{domain:n,...e},r){for(let i of t)i.value!==void 0&&(n===void 0&&(n=i.value?.domain),i.value=r(i.value));return{domain:n===void 0?n:r(n),...e}}function i3(t){return mt(t,Qs)}function ag(t={}){let n;for(let e in t)if(ft.has(e)&&xa(t[e])){if(n!==void 0)throw new Error("ambiguous scale definition; multiple scales found");n=cg(n3(e,t[e]))}if(n===void 0)throw new Error("invalid scale definition; no scale found");return n}function o3(t,n){return e=>{if(!ft.has(e=`${e}`))throw new Error(`unknown scale: ${e}`);return(e==="projection"?n:t)[e]}}function cg({scale:t,type:n,domain:e,range:r,interpolate:i,interval:o,transform:a,percent:c,pivot:u}){if(n==="identity")return{type:"identity",apply:s=>s,invert:s=>s};let f=t.unknown?t.unknown():void 0;return{type:n,domain:Si(e),...r!==void 0&&{range:Si(r)},...a!==void 0&&{transform:a},...c&&{percent:c},...f!==void 0&&{unknown:f},...o!==void 0&&{interval:o},...i!==void 0&&{interpolate:i},...t.clamp&&{clamp:t.clamp()},...u!==void 0&&{pivot:u,symmetric:!1},...t.base&&{base:t.base()},...t.exponent&&{exponent:t.exponent()},...t.constant&&{constant:t.constant()},...t.align&&{align:t.align(),round:t.round()},...t.padding&&(t.paddingInner?{paddingInner:t.paddingInner(),paddingOuter:t.paddingOuter()}:{padding:t.padding()}),...t.bandwidth&&{bandwidth:t.bandwidth(),step:t.step()},apply:s=>t(s),...t.invert&&{invert:s=>t.invert(s)}}}var $s=Symbol("unset");function sl(t){return(t.length===1?a3:c3)(t)}function a3(t){let n,e=$s;return r=>(Object.is(e,r)||(e=r,n=t(r)),n)}function c3(t){let n,e;return(...r)=>((e?.length!==r.length||e.some((i,o)=>!Object.is(i,r[o])))&&(e=r,n=t(...r)),n)}var u3=sl(t=>new Intl.NumberFormat(t)),H_=sl((t,n)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...n&&{month:n}})),X_=sl((t,n)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...n&&{weekday:n}}));function f3(t="en-US"){let n=u3(t);return e=>e!=null&&!isNaN(e)?n.format(e):void 0}function s3(t){return Jv(t,"Invalid Date")}function l3(t="en-US"){let n=f3(t);return e=>(e instanceof Date?s3:typeof e=="number"?n:Tt)(e)}var Cr=l3(),kt=typeof window<"u"&&!(window.devicePixelRatio>1)?.5:0,d3=0,h3=0;function ug(){return`plot-clip-${++d3}`}function p3(){return`plot-filter-${++h3}`}function m3(t,{title:n,href:e,ariaLabel:r,ariaDescription:i,ariaHidden:o,target:a,fill:c,fillOpacity:u,stroke:f,strokeWidth:s,strokeOpacity:d,strokeLinejoin:l,strokeLinecap:h,strokeMiterlimit:m,strokeDasharray:g,strokeDashoffset:x,opacity:v,mixBlendMode:w,imageFilter:$,paintOrder:p,pointerEvents:b,shapeRendering:y,channels:_},{ariaLabel:M,fill:S="currentColor",fillOpacity:C,stroke:k="none",strokeOpacity:T,strokeWidth:D,strokeLinecap:P,strokeLinejoin:A,strokeMiterlimit:O,paintOrder:R}){S===null&&(c=null,u=null),k===null&&(f=null,d=null),Bt(S)?!Bt(k)&&(!Bt(c)||_?.fill)&&(k="none"):Bt(k)&&(!Bt(f)||_?.stroke)&&(S="none");let[W,L]=ln(c,S),[I,q]=Lt(u,C),[U,F]=ln(f,k),[K,et]=Lt(d,T),[at,B]=Lt(v);Ai(F)||(s===void 0&&(s=D),h===void 0&&(h=P),l===void 0&&(l=A),m===void 0&&!S6(l)&&(m=O),!Ai(L)&&p===void 0&&(p=R));let[G,N]=Lt(s);return S!==null&&(t.fill=St(L,"currentColor"),t.fillOpacity=vi(q,1)),k!==null&&(t.stroke=St(F,"none"),t.strokeWidth=vi(N,1),t.strokeOpacity=vi(et,1),t.strokeLinejoin=St(l,"miter"),t.strokeLinecap=St(h,"butt"),t.strokeMiterlimit=vi(m,4),t.strokeDasharray=St(g,"none"),t.strokeDashoffset=St(x,"0")),t.target=Tt(a),t.ariaLabel=Tt(M),t.ariaDescription=Tt(i),t.ariaHidden=Tt(o),t.opacity=vi(B,1),t.mixBlendMode=St(w,"normal"),t.imageFilter=St($,"none"),t.paintOrder=St(p,"normal"),t.pointerEvents=St(b,"auto"),t.shapeRendering=St(y,"auto"),{title:{value:n,optional:!0,filter:null},href:{value:e,optional:!0,filter:null},ariaLabel:{value:r,optional:!0,filter:null},fill:{value:W,scale:"auto",optional:!0},fillOpacity:{value:I,scale:"auto",optional:!0},stroke:{value:U,scale:"auto",optional:!0},strokeOpacity:{value:K,scale:"auto",optional:!0},strokeWidth:{value:G,optional:!0},opacity:{value:at,scale:"auto",optional:!0}}}function g3(t,n){n&&t.filter(e=>Fs(n[e])).append("title").call(b3,n)}function y3(t,n){n&&t.filter(([e])=>Fs(n[e])).append("title").call(w3,n)}function b3(t,n){n&&t.text(e=>Cr(n[e]))}function w3(t,n){n&&t.text(([e])=>Cr(n[e]))}function dn(t,{target:n,tip:e},{ariaLabel:r,title:i,fill:o,fillOpacity:a,stroke:c,strokeOpacity:u,strokeWidth:f,opacity:s,href:d}){r&&X(t,"aria-label",l=>r[l]),o&&X(t,"fill",l=>o[l]),a&&X(t,"fill-opacity",l=>a[l]),c&&X(t,"stroke",l=>c[l]),u&&X(t,"stroke-opacity",l=>u[l]),f&&X(t,"stroke-width",l=>f[l]),s&&X(t,"opacity",l=>s[l]),d&&fg(t,l=>d[l],n),e||g3(t,i)}function ll(t,{target:n,tip:e},{ariaLabel:r,title:i,fill:o,fillOpacity:a,stroke:c,strokeOpacity:u,strokeWidth:f,opacity:s,href:d}){r&&X(t,"aria-label",([l])=>r[l]),o&&X(t,"fill",([l])=>o[l]),a&&X(t,"fill-opacity",([l])=>a[l]),c&&X(t,"stroke",([l])=>c[l]),u&&X(t,"stroke-opacity",([l])=>u[l]),f&&X(t,"stroke-width",([l])=>f[l]),s&&X(t,"opacity",([l])=>s[l]),d&&fg(t,([l])=>d[l],n),e||y3(t,i)}function x3({ariaLabel:t,title:n,fill:e,fillOpacity:r,stroke:i,strokeOpacity:o,strokeWidth:a,opacity:c,href:u},{tip:f}){return[t,f?void 0:n,e,r,i,o,a,c,u].filter(s=>s!==void 0)}function v3(t,n,e){let r=Br(t,i=>n[i]);return e===void 0&&r.size>1+t.length>>1&&fe("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),r.values()}function*dl(t,n,e,r){let{z:i}=e,{z:o}=r,a=x3(r,e),c=[...n,...a];for(let u of o?v3(t,o,i):[t]){let f,s;t:for(let d of u){for(let l of c)if(!An(l[d])){s&&s.push(-1);continue t}if(f===void 0){s&&(yield s),f=a.map(l=>Vn(l[d])),s=[d];continue}s.push(d);for(let l=0;l<a.length;++l)if(Vn(a[l][d])!==f[l]){yield s,f=a.map(m=>Vn(m[d])),s=[d];continue t}}s&&(yield s)}}function _3(t,n,e,r){let i,{clip:o=r.clip}=n;o==="frame"?(t=pt("svg:g",r).each(function(){this.appendChild(t.node()),t.node=()=>this}),i=$3(r,e)):o&&(i=k3(o,r)),X(t,"aria-label",n.ariaLabel),X(t,"aria-description",n.ariaDescription),X(t,"aria-hidden",n.ariaHidden),X(t,"clip-path",i)}function M3(t){let n=new WeakMap;return(e,r)=>{let i=n.get(e);if(!i){let o=ug();Rn(e.ownerSVGElement).append("clipPath").attr("id",o).call(t,e,r),n.set(e,i=`url(#${o})`)}return i}}var $3=M3((t,n,e)=>{let{width:r,height:i,marginLeft:o,marginRight:a,marginTop:c,marginBottom:u}=e;t.append("rect").attr("x",o).attr("y",c).attr("width",r-a-o).attr("height",i-c-u)}),k1=new WeakMap,S3={type:"Sphere"};function k3(t,n){let e,r;if((e=k1.get(n))||k1.set(n,e=new WeakMap),t.type==="Sphere"&&(t=S3),!(r=e.get(t))){let i=ug();Rn(n.ownerSVGElement).append("clipPath").attr("id",i).append("path").attr("d",n.path()(t)),e.set(t,r=`url(#${i})`)}return r}function Xt(t,n,e,r){_3(t,n,e,r),X(t,"class",n.className),X(t,"fill",n.fill),X(t,"fill-opacity",n.fillOpacity),X(t,"stroke",n.stroke),X(t,"stroke-width",n.strokeWidth),X(t,"stroke-opacity",n.strokeOpacity),X(t,"stroke-linejoin",n.strokeLinejoin),X(t,"stroke-linecap",n.strokeLinecap),X(t,"stroke-miterlimit",n.strokeMiterlimit),X(t,"stroke-dasharray",n.strokeDasharray),X(t,"stroke-dashoffset",n.strokeDashoffset),X(t,"shape-rendering",n.shapeRendering),X(t,"filter",n.imageFilter),X(t,"paint-order",n.paintOrder);let{pointerEvents:i=r.pointerSticky===!1?"none":void 0}=n;X(t,"pointer-events",i)}function Pt(t,n){A3(t,"mix-blend-mode",n.mixBlendMode),X(t,"opacity",n.opacity)}function fg(t,n,e){t.each(function(r){let i=n(r);if(i!=null){let o=this.ownerDocument.createElementNS(we.svg,"a");o.setAttribute("fill","inherit"),o.setAttributeNS(we.xlink,"href",i),e!=null&&o.setAttribute("target",e),this.parentNode.insertBefore(o,this).appendChild(this)}})}function X(t,n,e){e!=null&&t.attr(n,e)}function A3(t,n,e){e!=null&&t.style(n,e)}function Dt(t,n,{x:e,y:r},i=kt,o=kt){i+=n.dx,o+=n.dy,e?.bandwidth&&(i+=e.bandwidth()/2),r?.bandwidth&&(o+=r.bandwidth()/2),(i||o)&&t.attr("transform",`translate(${i},${o})`)}function St(t,n){if((t=Tt(t))!==n)return t}function vi(t,n){if((t=Ct(t))!==n)return t}var T3=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function hl(t){if(t===void 0)return"plot-d6a7b5";if(t=`${t}`,!T3.test(t))throw new Error(`invalid class name: ${t}`);return t}function pl(t,n){if(typeof n=="string")t.property("style",n);else if(n!=null)for(let e of t)Object.assign(e.style,n)}function Yi({frameAnchor:t},{width:n,height:e,marginTop:r,marginRight:i,marginBottom:o,marginLeft:a}){return[/left$/.test(t)?a:/right$/.test(t)?n-i:(a+n-i)/2,/^top/.test(t)?r:/^bottom/.test(t)?e-o:(r+e-o)/2]}function C3(t,n,e={}){let r=.5-kt,i=.5+kt,o=.5+kt,a=.5-kt;for(let{marginTop:g,marginRight:x,marginBottom:v,marginLeft:w}of n)g>r&&(r=g),x>i&&(i=x),v>o&&(o=v),w>a&&(a=w);let{margin:c,marginTop:u=c!==void 0?c:r,marginRight:f=c!==void 0?c:i,marginBottom:s=c!==void 0?c:o,marginLeft:d=c!==void 0?c:a}=e;u=+u,f=+f,s=+s,d=+d;let{width:l=640,height:h=E3(t,e,{width:l,marginTopDefault:r,marginRightDefault:i,marginBottomDefault:o,marginLeftDefault:a})+Math.max(0,u-r+s-o)}=e;l=+l,h=+h;let m={width:l,height:h,marginTop:u,marginRight:f,marginBottom:s,marginLeft:d};if(t.fx||t.fy){let{margin:g,marginTop:x=g!==void 0?g:u,marginRight:v=g!==void 0?g:f,marginBottom:w=g!==void 0?g:s,marginLeft:$=g!==void 0?g:d}=e.facet??{};x=+x,v=+v,w=+w,$=+$,m.facet={marginTop:x,marginRight:v,marginBottom:w,marginLeft:$}}return m}function E3({x:t,y:n,fy:e,fx:r},{projection:i,aspectRatio:o},{width:a,marginTopDefault:c,marginRightDefault:u,marginBottomDefault:f,marginLeftDefault:s}){let d=e&&e.scale.domain().length||1,l=p5(i);if(l){let m=r?r.scale.domain().length:1,g=(1.1*d-.1)/(1.1*m-.1)*l,x=Math.max(.1,Math.min(10,g));return Math.round((a-s-u)*x+c+f)}let h=n?Ge(n)?n.scale.domain().length||1:Math.max(7,17/d):1;if(o!=null){if(o=+o,!(isFinite(o)&&o>0))throw new Error(`invalid aspectRatio: ${o}`);let m=A1("y",n)/(A1("x",t)*o),g=r?r.scale.bandwidth():1,x=e?e.scale.bandwidth():1,v=g*(a-s-u)-t.insetLeft-t.insetRight;return(m*v+n.insetTop+n.insetBottom)/x+c+f}return!!(n||e)*Math.max(1,Math.min(60,h*d))*20+!!r*30+60}function A1(t,n){if(!n)throw new Error(`aspectRatio requires ${t} scale`);let{type:e,domain:r}=n,i;switch(e){case"linear":case"utc":case"time":i=Number;break;case"pow":{let c=n.scale.exponent();i=u=>Math.pow(u,c);break}case"log":i=Math.log;break;case"point":case"band":return r.length;default:throw new Error(`unsupported ${t} scale for aspectRatio: ${e}`)}let[o,a]=Wt(r);return Math.abs(i(a)-i(o))}function N3(t,n){let{fx:e,fy:r}=Ms(t,n),i=e?.scale.domain(),o=r?.scale.domain();return i&&o?Hl(i,o).map(([a,c],u)=>({x:a,y:c,i:u})):i?i.map((a,c)=>({x:a,i:c})):o?o.map((a,c)=>({y:a,i:c})):void 0}function R3(t,{x:n,y:e}){return n&&=Ss(n),e&&=Ss(e),t.filter(n&&e?r=>n.has(r.x)&&e.has(r.y):n?r=>n.has(r.x):r=>e.has(r.y)).sort(n&&e?(r,i)=>n.get(r.x)-n.get(i.x)||e.get(r.y)-e.get(i.y):n?(r,i)=>n.get(r.x)-n.get(i.x):(r,i)=>e.get(r.y)-e.get(i.y))}function ml(t,{fx:n,fy:e}){let r=jn(t),i=n?.value,o=e?.value;return n&&e?ye(r,a=>(a.fx=i[a[0]],a.fy=o[a[0]],a),a=>i[a],a=>o[a]):n?ye(r,a=>(a.fx=i[a[0]],a),a=>i[a]):ye(r,a=>(a.fy=o[a[0]],a),a=>o[a])}function L3(t,n,{marginTop:e,marginLeft:r}){let i=t?({x:a})=>t(a)-r:()=>0,o=n?({y:a})=>n(a)-e:()=>0;return function(a){this.tagName==="svg"?(this.setAttribute("x",i(a)),this.setAttribute("y",o(a))):this.setAttribute("transform",`translate(${i(a)},${o(a)})`)}}function P3(t){let n=[],e=new Uint32Array(mn(t,r=>r.length));for(let r of t){let i=0;for(let o of t)r!==o&&(e.set(o,i),i+=o.length);n.push(e.slice(0,i))}return n}var D3=new Map([["top",is],["right",cs],["bottom",os],["left",as],["top-left",sa(is,as)],["top-right",sa(is,cs)],["bottom-left",sa(os,as)],["bottom-right",sa(os,cs)],["top-empty",z3],["right-empty",q3],["bottom-empty",F3],["left-empty",B3],["empty",Y3]]);function I3(t){if(t==null)return null;let n=D3.get(`${t}`.toLowerCase());if(n)return n;throw new Error(`invalid facet anchor: ${t}`)}var T1=new WeakMap;function Ss(t){let n=T1.get(t);return n||T1.set(t,n=new an(mt(t,(e,r)=>[e,r]))),n}function de(t,n){return Ss(t).get(n)}function O3(t,n,e){return n=Vn(n),e=Vn(e),t.find(r=>Object.is(Vn(r.x),n)&&Object.is(Vn(r.y),e))}function Fa(t,n,e){return O3(t,n,e)?.empty}function is(t,{y:n},{y:e}){return n?de(n,e)===0:!0}function os(t,{y:n},{y:e}){return n?de(n,e)===n.length-1:!0}function as(t,{x:n},{x:e}){return n?de(n,e)===0:!0}function cs(t,{x:n},{x:e}){return n?de(n,e)===n.length-1:!0}function z3(t,{y:n},{x:e,y:r,empty:i}){if(i)return!1;if(!n)return;let o=de(n,r);if(o>0)return Fa(t,e,n[o-1])}function F3(t,{y:n},{x:e,y:r,empty:i}){if(i)return!1;if(!n)return;let o=de(n,r);if(o<n.length-1)return Fa(t,e,n[o+1])}function B3(t,{x:n},{x:e,y:r,empty:i}){if(i)return!1;if(!n)return;let o=de(n,e);if(o>0)return Fa(t,n[o-1],r)}function q3(t,{x:n},{x:e,y:r,empty:i}){if(i)return!1;if(!n)return;let o=de(n,e);if(o<n.length-1)return Fa(t,n[o+1],r)}function Y3(t,n,{empty:e}){return e}function sa(t,n){return function(){return t.apply(null,arguments)&&n.apply(null,arguments)}}function us(t,{channels:{fx:n,fy:e},groups:r}){return n&&e?t.map(({x:i,y:o})=>r.get(i)?.get(o)??[]):n?t.map(({x:i})=>r.get(i)??[]):t.map(({y:i})=>r.get(i)??[])}var Et=class{constructor(n,e={},r={},i){let{facet:o="auto",facetAnchor:a,fx:c,fy:u,sort:f,dx:s=0,dy:d=0,margin:l=0,marginTop:h=l,marginRight:m=l,marginBottom:g=l,marginLeft:x=l,className:v,clip:w=i?.clip,channels:$,tip:p,pool:b=i?.pool,render:y}=r;if(this.data=n,this.sort=Ar(f)?f:null,this.initializer=Tr(r).initializer,this.transform=this.initializer?r.transform:Fi(r).transform,o===null||o===!1?this.facet=null:(this.facet=hn(o===!0?"include":o,"facet",["auto","include","exclude","super"]),this.fx=n===ya&&typeof c=="string"?[c]:c,this.fy=n===ya&&typeof u=="string"?[u]:u),this.facetAnchor=I3(a),e=$m(e),$!==void 0&&(e={...W3($),...e}),i!==void 0&&(e={...m3(this,r,i),...e}),this.channels=Object.fromEntries(Object.entries(e).map(([_,M])=>{if(Ra(M.value)){let{value:S,label:C=M.label,scale:k=M.scale}=M.value;M={...M,label:C,scale:k,value:S}}if(n===ya&&typeof M.value=="string"){let{value:S}=M;M={...M,value:[S]}}return[_,M]}).filter(([_,{value:M,optional:S}])=>{if(M!=null)return!0;if(S)return!1;throw new Error(`missing channel value: ${_}`)})),this.dx=+s,this.dy=+d,this.marginTop=+h,this.marginRight=+m,this.marginBottom=+g,this.marginLeft=+x,this.clip=Sm(w),this.tip=U3(p),this.pool=!!b,this.className=Tt(v),this.facet==="super"){if(c||u)throw new Error("super-faceting cannot use fx or fy");for(let _ in this.channels){let{scale:M}=e[_];if(!(M!=="x"&&M!=="y"))throw new Error("super-faceting cannot use x or y")}}y!=null&&(this.render=lg(y,this.render))}initialize(n,e,r){let i=kr(this.data);n===void 0&&i!=null&&(n=[jn(i)]);let o=n;this.transform!=null&&({facets:n,data:i}=this.transform(i,n,r),i=kr(i)),n!==void 0&&(n.original=o);let a=t5(this.channels,i);return this.sort!=null&&e5(i,n,a,e,this.sort),{data:i,facets:n,channels:a}}filter(n,e,r){for(let i in e){let{filter:o=An}=e[i];if(o!==null){let a=r[i];n=n.filter(c=>o(a[c]))}}return n}project(n,e,r){for(let i in n)if(n[i].scale==="x"&&/^x|x$/.test(i)){let o=i.replace(/^x|x$/,"y");o in n&&n[o].scale==="y"&&d5(i,o,e,r.projection)}}scale(n,e,r){let i=n5(n,e);return r.projection&&this.project(n,i,r),i}plot({marks:n=[],...e}={}){return Cl({...e,marks:[...n,this]})}};function sg(...t){return t.plot=Et.prototype.plot,t}function lg(t,n){if(t==null)return n===null?void 0:n;if(n==null)return t===null?void 0:t;if(typeof t!="function")throw new TypeError(`invalid render transform: ${t}`);if(typeof n!="function")throw new TypeError(`invalid render transform: ${n}`);return function(e,r,i,o,a,c){return t.call(this,e,r,i,o,a,(u,f,s,d,l)=>n.call(this,u,f,s,d,l,c))}}function W3(t){return Object.fromEntries(Object.entries($m(t)).map(([n,e])=>(e=typeof e=="string"?{value:e,label:n}:Ii(e),e.filter===void 0&&e.scale==null&&(e={...e,filter:null}),[n,e])))}function U3(t){return t===!0?"xy":t===!1||t==null?null:typeof t=="string"?hn(t,"tip",["x","y","xy"]):t}function Pr(t,n){return t?.tip===!0?{...t,tip:n}:se(t?.tip)&&t.tip.pointer===void 0?{...t,tip:{...t.tip,pointer:n}}:t}var C1=new WeakMap,E1=new WeakSet;function gl(t,n,{x:e,y:r,px:i,py:o,maxRadius:a=40,channels:c,render:u,...f}={}){return a=+a,i!=null&&(e??=null,c={...c,px:{value:i,scale:"x"}}),o!=null&&(r??=null,c={...c,py:{value:o,scale:"y"}}),{x:e,y:r,channels:c,...f,render:lg(function(s,d,l,h,m,g){m={...m,pointerSticky:!1};let x=m.ownerSVGElement,{data:v}=m.getMarkState(this),w=C1.get(x);w||(w={sticky:!1,roots:[],renders:[],pool:this.pool?{map:new Map}:null},C1.set(x,w));let $=w.renders.push(F)-1,{x:p,y:b,fx:y,fy:_}=d,M=y?y(s.fx)-h.marginLeft:0,S=_?_(s.fy)-h.marginTop:0;p?.bandwidth&&(M+=p.bandwidth()/2),b?.bandwidth&&(S+=b.bandwidth()/2);let C=s.fi!=null,k;if(C){let B=w.facetPools;B||(w.facetPools=B=new Map),k=B.get(this),k||B.set(this,k={map:new Map})}let[T,D]=Yi(this,h),{px:P,py:A}=l,O=P?B=>P[B]:dg(l,T),R=A?B=>A[B]:hg(l,D),W,L,I,q=w.pool??k;function U(B,G){if(!q)return void F(B);B==null&&F(B),q.map.set($,{ii:B,ri:G,render:F}),q.frame!==void 0&&cancelAnimationFrame(q.frame),q.frame=requestAnimationFrame(()=>{q.frame=void 0;let N=null;for(let z of q.map.values())(!N||z.ri<N.ri)&&(N=z);for(let z of q.map.values())z.render(z===N?z.ii:null)})}function F(B){if(W===B&&I===w.sticky)return;W=B,I=m.pointerSticky=w.sticky;let G=W==null?[]:[W];C&&(G.fx=s.fx,G.fy=s.fy,G.fi=s.fi);let N=g(G,d,l,h,m);if(L){if(C){let z=L.parentNode,Y=L.getAttribute("transform"),E=N.getAttribute("transform");Y?N.setAttribute("transform",Y):N.removeAttribute("transform"),E?z.setAttribute("transform",E):z.removeAttribute("transform"),N.removeAttribute("aria-label"),N.removeAttribute("aria-description"),N.removeAttribute("aria-hidden")}L.replaceWith(N)}if(w.roots[$]=L=N,!(W==null&&k?.map.size>1)){let z=W==null?null:Be(v)?v[W]:v.get(W);m.dispatchValue(z)}return N}function K(B){if(w.sticky||B.pointerType==="mouse"&&B.buttons===1)return;let[G,N]=xd(B);G-=M,N-=S;let z=G<h.marginLeft||G>h.width-h.marginRight?1:t,Y=N<h.marginTop||N>h.height-h.marginBottom?1:n,E=null,nt=a*a;for(let H of s){let J=z*(O(H)-G),rt=Y*(R(H)-N),ut=J*J+rt*rt;ut<=nt&&(E=H,nt=ut)}if(E!=null&&(t!==1||n!==1)){let H=O(E)-G,J=R(E)-N;nt=H*H+J*J}U(E,nt)}function et(B){E1.has(B)||(E1.add(B),B.pointerType==="mouse"&&W!=null&&(w.sticky&&w.roots.some(G=>G?.contains(B.target))||(w.sticky?(w.sticky=!1,w.renders.forEach(G=>G(null))):(w.sticky=!0,F(W)))))}function at(B){B.pointerType==="mouse"&&(w.sticky||U(null))}return x.addEventListener("pointerenter",K),x.addEventListener("pointermove",K),x.addEventListener("pointerdown",et),x.addEventListener("pointerleave",at),F(null)},u)}}function G3(t){return gl(1,1,t)}function H3(t){return gl(1,.01,t)}function N1(t){return gl(.01,1,t)}function dg({x1:t,x2:n,x:e=t},r){return t&&n?i=>(t[i]+n[i])/2:e?i=>e[i]:()=>r}function hg({y1:t,y2:n,y:e=t},r){return t&&n?i=>(t[i]+n[i])/2:e?i=>e[i]:()=>r}function pg(t){return Ge(t)&&t.interval===void 0?void 0:"tabular-nums"}function mg(t,n){let{label:e=t.label,tickSize:r=6,width:i=240,height:o=44+r,marginTop:a=18,marginRight:c=0,marginBottom:u=16+r,marginLeft:f=0,style:s,ticks:d=(i-f-c)/64,tickFormat:l,fontVariant:h=pg(t),round:m=!0,opacity:g,className:x}=n,v=ol(n);x=hl(x),g=Lt(g)[1],l===null&&(l=()=>null);let w=pt("svg",v).attr("class",`${x}-ramp`).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",i).attr("height",o).attr("viewBox",`0 0 ${i} ${o}`).call(T=>T.append("style").text(`:where(.${x}-ramp) {
|
|
5
|
+
${e}`}function x6(t){return t==="time"?wa:t==="utc"?Ti:y6}function w6(t,n,e){let r=Gt(md(n,(i,o)=>Math.abs(o-i)));if(r<1e3)return mp("millisecond","utc",e);for(let[i,o,a,c]of x6(t)){if(r>c||i==="hour"&&!r)break;if(n.every(u=>o.floor(u)>=u))return mp(i,a,e)}}function $r(t,n,e){return(r,i,o)=>{let a=t(r,i),c=n(r,i),u=i-Er(o);return i!==u&&o[u]!==void 0&&c===n(o[u],u)?a:e(a,c)}}var jf=Object.getPrototypeOf(Uint8Array),v6=Object.prototype.toString;function We(t){return t instanceof Array||t instanceof jf}function g1(t){return t instanceof jf&&!M6(t)}function y1(t){return t?.prototype instanceof jf&&!_6(t)}function M6(t){return t instanceof BigInt64Array||t instanceof BigUint64Array}function _6(t){return t===BigInt64Array||t===BigUint64Array}var b1=Symbol("reindex");function lt(t,n,e){let r=typeof n;return r==="string"?R1(t)?Zf(t.getChild(n),e):pp(t,x1(n),e):r==="function"?pp(t,n,e):r==="number"||n instanceof Date||r==="boolean"?bt(t,Zn(n),e):typeof n?.transform=="function"?vf(n.transform(t),e):$6(vf(n,e),t?.[b1])}function $6(t,n){return t!=null&&n?Jf(t,n):t}function pp(t,n,e){return bt(t,y1(e)?(r,i)=>Kf(n(r,i)):n,e)}function vf(t,n){return n===void 0?Ue(t):D1(t)?Zf(t,n):t instanceof n?t:n.from(t,y1(n)&&!g1(t)?Kf:void 0)}function Zf(t,n){return t==null?t:(n===void 0||n===Array)&&Y6(t.type)?v1(gp(t)):vf(gp(t),n)}function gp(t){return t.nullCount?t.toJSON():t.toArray()}var va=[null],x1=t=>n=>{let e=n[t];return e===void 0&&n.type==="Feature"?n.properties?.[t]:e},He={transform:Qn},mt={transform:t=>t},S6=()=>1,k6=()=>!0,Nt=t=>t==null?t:`${t}`,Lt=t=>t==null?t:+t,w1=t=>t?t[0]:void 0,Mf=t=>t?t[1]:void 0;var Zn=t=>()=>t;function A6(t){let n=+`${t}`.slice(1)/100;return(e,r)=>te(e,n,r)}function Tn(t){return g1(t)?t:bt(t,Kf,Float64Array)}function Kf(t){return t==null?NaN:Number(t)}function v1(t){return bt(t,M1)}function M1(t){return t instanceof Date&&!isNaN(t)?t:typeof t=="string"?l1(t):t==null||isNaN(t=Number(t))?void 0:new Date(t)}function mn(t,n){return t===void 0&&(t=n),t===null?[void 0,"none"]:Ia(t)?[void 0,t]:[t,void 0]}function Ot(t,n){return t===void 0&&(t=n),t===null||typeof t=="number"?[void 0,t]:[t,void 0]}function _1(t,n,e){if(t!=null)return gn(t,n,e)}function gn(t,n,e){let r=`${t}`.toLowerCase();if(!e.includes(r))throw new Error(`invalid ${n}: ${t}`);return r}function Nr(t){return R1(t)?t:Ue(t)}function Ue(t){if(t==null||We(t))return t;if(D1(t))return Zf(t);if($1(t))switch(t.type){case"FeatureCollection":return t.features;case"GeometryCollection":return t.geometries;default:return[t]}return Array.from(t)}function $1(t){switch(t?.type){case"FeatureCollection":case"GeometryCollection":case"Feature":case"LineString":case"MultiLineString":case"MultiPoint":case"MultiPolygon":case"Point":case"Polygon":case"Sphere":return!0;default:return!1}}function bt(t,n,e=Array){return t==null?t:t instanceof e?t.map(n):e.from(t,n)}function Ei(t,n=Array){return t instanceof n?t.slice():n.from(t)}function S1(t){return t?.x!==void 0||t?.x1!==void 0||t?.x2!==void 0}function k1(t){return t?.y!==void 0||t?.y1!==void 0||t?.y2!==void 0}function Da(t){return S1(t)||k1(t)||t?.interval!==void 0}function le(t){return t?.toString===v6}function $a(t){return le(t)&&(t.type!==void 0||t.domain!==void 0)}function Oa(t){return le(t)&&typeof t.transform!="function"}function Lr(t){return Oa(t)&&t.value===void 0&&t.channel===void 0}function A1(t,n,e,r=mt){return n===void 0&&e===void 0?(n=0,e=t===void 0?r:t):n===void 0?n=t===void 0?0:t:e===void 0&&(e=t===void 0?0:t),[n,e]}function Ge(t,n){return t===void 0&&n===void 0?[w1,Mf]:[t,n]}function Qf({z:t,fill:n,stroke:e}={}){return t===void 0&&([t]=mn(n)),t===void 0&&([t]=mn(e)),t}function Ni(t){return We(t)?t.length:t?.numRows}function Qn(t){let n=Ni(t),e=new Uint32Array(n);for(let r=0;r<n;++r)e[r]=r;return e}function Jf(t,n){return We(t)?bt(n,e=>t[e],t.constructor):bt(n,e=>t.at(e))}function T6(t,n,e){return t.subarray?t.subarray(n,e):t.slice(n,e)}function Kn(t){return t!==null&&typeof t=="object"?t.valueOf():t}function C6(t,n){if(n[t]!==void 0)return n[t];switch(t){case"x1":case"x2":t="x";break;case"y1":case"y2":t="y";break}return n[t]}function Sa(t){let n;return[{transform:()=>n,label:Xe(t)},e=>n=e]}function Yt(t){return t==null?[t]:Sa(t)}function Xe(t,n){return typeof t=="string"?t:t&&t.label!==void 0?t.label:n}function ka(t,n){return{transform(e){let r=t.transform(e),i=n.transform(e);return Ht(r)||Ht(i)?bt(r,(o,a)=>new Date((+r[a]+ +i[a])/2)):bt(r,(o,a)=>(+r[a]+ +i[a])/2,Float64Array)},label:t.label}}function Aa(t,n){let e=T1(n?.interval,n?.type);return e?bt(t,e):t}function T1(t,n){let e=tl(t,n);return e&&(r=>En(r)?e.floor(r):r)}function tl(t,n){if(t!=null){if(typeof t=="number")return E6(t);if(typeof t=="string")return(n==="time"?m1:Vf)(t);if(typeof t.floor!="function")throw new Error("invalid interval; missing floor method");if(typeof t.offset!="function")throw new Error("invalid interval; missing offset method");return t}}function E6(t){t=+t,0<t&&t<1&&Number.isInteger(1/t)&&(t=-1/t);let n=Math.abs(t);return t<0?{floor:e=>Math.floor(e*n)/n,offset:(e,r=1)=>(e*n+Math.floor(r))/n,range:(e,r)=>ar(Math.ceil(e*n),r*n).map(i=>i/n)}:{floor:e=>Math.floor(e/n)*n,offset:(e,r=1)=>e+n*Math.floor(r),range:(e,r)=>ar(Math.ceil(e/n),r/n).map(i=>i*n)}}function Ir(t,n){if(t=tl(t,n),t&&typeof t.range!="function")throw new Error("invalid interval: missing range method");return t}function N6(t,n){if(t=Ir(t,n),t&&typeof t.ceil!="function")throw new Error("invalid interval: missing ceil method");return t}function L6(t){return Ar(t)&&typeof t?.floor=="function"&&t.floor()instanceof Date}function Ar(t){return typeof t?.range=="function"}function Bi(t){return t===void 0||Oa(t)?t:{value:t}}function P6(t){return t==null?null:{transform:n=>lt(n,t,Float64Array),label:Xe(t)}}function de(t){return t&&typeof t[Symbol.iterator]=="function"}function C1(t){for(let n of t)if(n!=null)return typeof n!="object"||n instanceof Date}function yp(t){for(let n of t){if(n==null)continue;let e=typeof n;return e==="string"||e==="boolean"}}function Ht(t){for(let n of t)if(n!=null)return n instanceof Date}function R6(t){for(let n of t)if(n!=null)return typeof n=="string"&&isNaN(n)&&l1(n)}function D6(t){for(let n of t)if(n!=null){if(typeof n!="string")return!1;if(n.trim())return!isNaN(n)}}function O6(t){for(let n of t)if(n!=null)return typeof n=="number"}function E1(t){return Ma(t,I6)}function I6(t){return typeof t=="number"&&Number.isInteger(t)&&1500<=t&&t<=2500}function Ma(t,n){let e;for(let r of t)if(r!=null){if(!n(r))return!1;e=!0}return e}var z6=new Set("none,currentcolor,transparent,aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow".split(","));function Ia(t){return typeof t!="string"?!1:(t=t.toLowerCase().trim(),/^#[0-9a-f]{3,8}$/.test(t)||/^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(.*\)$/.test(t)||z6.has(t))}function F6(t){return typeof t=="number"&&(0<=t&&t<=1||isNaN(t))}function Wt(t){return t==null||Li(t)}function Li(t){return/^\s*none\s*$/i.test(t)}function q6(t){return/^\s*round\s*$/i.test(t)}function _f(t,n){return _1(t,n,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function za(t="middle"){return _f(t,"frameAnchor")}function N1(t={},...n){let e=t;for(let r of n)for(let i in r)if(e[i]===void 0){let o=r[i];e===t?e={...e,[i]:o}:e[i]=o}return e}function B6(t){console.warn("named iterables are deprecated; please use an object instead");let n=new Set;return Object.fromEntries(Array.from(t,e=>{let{name:r}=e;if(r==null)throw new Error("missing name");let i=`${r}`;if(i==="__proto__")throw new Error(`illegal name: ${i}`);if(n.has(i))throw new Error(`duplicate name: ${i}`);return n.add(i),[r,e]}))}function L1(t){return de(t)?B6(t):t}function P1(t){return t===!0?t="frame":t===!1?t=null:!$1(t)&&t!=null&&(t=gn(t,"clip",["frame","sphere"]),t==="sphere"&&(t={type:"Sphere"})),t}function R1(t){return t&&typeof t.getChild=="function"&&typeof t.toArray=="function"&&t.schema&&Array.isArray(t.schema.fields)}function D1(t){return t&&typeof t.toArray=="function"&&t.type}function Y6(t){return t&&(t.typeId===8||t.typeId===10)&&t.unit===1}var Cn=Symbol("position"),Jn=Symbol("color"),Yi=Symbol("radius"),Wi=Symbol("length"),zr=Symbol("opacity"),Fa=Symbol("symbol"),O1=Symbol("projection"),ft=new Map([["x",Cn],["y",Cn],["fx",Cn],["fy",Cn],["r",Yi],["color",Jn],["opacity",zr],["symbol",Fa],["length",Wi],["projection",O1]]);function W6(t){return t===Cn||t===O1}function H6(t){return t===Cn||t===Yi||t===Wi||t===zr}var U6=Math.sqrt(3),G6=2/U6,X6={draw(t,n){let e=Math.sqrt(n/Math.PI),r=e*G6,i=r/2;t.moveTo(0,r),t.lineTo(e,i),t.lineTo(e,-i),t.lineTo(0,-r),t.lineTo(-e,-i),t.lineTo(-e,i),t.closePath()}},nl=new Map([["asterisk",qs],["circle",_r],["cross",Bs],["diamond",Ys],["diamond2",Ws],["hexagon",X6],["plus",Hs],["square",Us],["square2",Gs],["star",Xs],["times",Ks],["triangle",Vs],["triangle2",js],["wye",Zs]]);function el(t){return t&&typeof t.draw=="function"}function V6(t){return el(t)?!0:typeof t!="string"?!1:nl.has(t.toLowerCase())}function rl(t){if(t==null||el(t))return t;let n=nl.get(`${t}`.toLowerCase());if(n)return n;throw new Error(`invalid symbol: ${t}`)}function j6(t){if(t==null||el(t))return[void 0,t];if(typeof t=="string"){let n=nl.get(`${t}`.toLowerCase());if(n)return[void 0,n]}return[t,void 0]}function Hi({filter:t,sort:n,reverse:e,transform:r,initializer:i,...o}={},a){if(r===void 0&&(t!=null&&(r=I1(t)),n!=null&&!Lr(n)&&(r=rf(r,il(n))),e&&(r=rf(r,z1))),a!=null&&i!=null)throw new Error("transforms cannot be applied after initializers");return{...o,...(n===null||Lr(n))&&{sort:n},transform:rf(r,a)}}function Pr({filter:t,sort:n,reverse:e,initializer:r,...i}={},o){return r===void 0&&(t!=null&&(r=I1(t)),n!=null&&!Lr(n)&&(r=of(r,il(n))),e&&(r=of(r,z1))),{...i,...(n===null||Lr(n))&&{sort:n},initializer:of(r,o)}}function rf(t,n){return t==null?n===null?void 0:n:n==null?t===null?void 0:t:function(e,r,i){return{data:e,facets:r}=t.call(this,e,r,i),n.call(this,Nr(e),r,i)}}function of(t,n){return t==null?n===null?void 0:n:n==null?t===null?void 0:t:function(e,r,i,...o){let a,c,u,s,f,d;return{data:c=e,facets:u=r,channels:a}=t.call(this,e,r,i,...o),{data:f=c,facets:d=u,channels:s}=n.call(this,c,u,{...i,...a},...o),{data:f,facets:d,channels:{...a,...s}}}}function Z6(t,n){return(t.initializer!=null?Pr:Hi)(t,n)}function I1(t){return(n,e)=>{let r=lt(n,t);return{data:n,facets:e.map(i=>i.filter(o=>r[o]))}}}function z1(t,n){return{data:t,facets:n.map(e=>e.slice().reverse())}}function K6(t,{sort:n,...e}={}){return{...(Oa(t)&&t.channel!==void 0?Pr:Z6)(e,il(t)),sort:Lr(n)?n:null}}function il(t){return(typeof t=="function"&&t.length!==1?Q6:J6)(t)}function Q6(t){return(n,e)=>{let r=We(n)?(i,o)=>t(n[i],n[o]):(i,o)=>t(n.get(i),n.get(o));return{data:n,facets:e.map(i=>i.slice().sort(r))}}}function J6(t){let n,e;({channel:n,value:t,order:e}={...Bi(t)});let r=n?.startsWith("-");if(r&&(n=n.slice(1)),e===void 0&&(e=r?_a:hn),typeof e!="function")switch(`${e}`.toLowerCase()){case"ascending":e=hn;break;case"descending":e=_a;break;default:throw new Error(`invalid order: ${e}`)}return(i,o,a)=>{let c;if(n===void 0)c=lt(i,t);else{if(a===void 0)throw new Error("channel sort requires an initializer");if(c=a[n],!c)return{};c=c.value}let u=(s,f)=>e(c[s],c[f]);return{data:i,facets:o.map(s=>s.slice().sort(u))}}}function t5(t={y:"count"},n={}){let{x:e=mt}=n;if(e==null)throw new Error("missing channel: x");return ol(e,null,t,n)}function n5(t={x:"count"},n={}){let{y:e=mt}=n;if(e==null)throw new Error("missing channel: y");return ol(null,e,t,n)}function e5(t={fill:"count"},n={}){let{x:e,y:r}=n;if([e,r]=Ge(e,r),e==null)throw new Error("missing channel: x");if(r==null)throw new Error("missing channel: y");return ol(e,r,t,n)}function ol(t,n,{data:e=ul,filter:r,sort:i,reverse:o,...a}={},c={}){a=o5(a,c),e=Y1(e,mt),i=i==null?void 0:q1("sort",i,c),r=r==null?void 0:B1("filter",r,c);let[u,s]=Yt(t),[f,d]=Yt(n),{z:l,fill:h,stroke:p,x1:g,x2:b,y1:v,y2:w,...S}=c,[m,x]=Yt(l),[y]=mn(h),[M]=mn(p),[_,$]=Yt(y),[A,k]=Yt(M);return{..."z"in c&&{z:m||l},..."fill"in c&&{fill:_||h},..."stroke"in c&&{stroke:A||p},...Hi(S,(C,z,L)=>{let T=Aa(lt(C,t),L?.x),B=Aa(lt(C,n),L?.y),D=lt(C,l),H=lt(C,y),O=lt(C,M),Y=W1(a,{z:D,fill:H,stroke:O}),E=[],R=[],F=T&&s([]),G=B&&d([]),Z=D&&x([]),it=H&&$([]),I=O&&k([]),U=0;for(let P of a)P.initialize(C);i&&i.initialize(C),r&&r.initialize(C);for(let P of z){let q=[];for(let W of a)W.scope("facet",P);i&&i.scope("facet",P),r&&r.scope("facet",P);for(let[W,N]of Ci(P,Y))for(let[K,X]of Ci(N,B))for(let[V,nt]of Ci(X,T)){let ct={data:C};if(T&&(ct.x=V),B&&(ct.y=K),Y&&(ct.z=W),!(r&&!r.reduce(nt,ct))){q.push(U++),R.push(e.reduceIndex(nt,C,ct)),T&&F.push(V),B&&G.push(K),D&&Z.push(Y===D?W:D[nt[0]]),H&&it.push(Y===H?W:H[nt[0]]),O&&I.push(Y===O?W:O[nt[0]]);for(let yt of a)yt.reduce(nt,ct);i&&i.reduce(nt,ct)}}E.push(q)}return H1(E,i,o),{data:R,facets:E}}),...!Tr(a,"x")&&(u?{x:u}:{x1:g,x2:b}),...!Tr(a,"y")&&(f?{y:f}:{y1:v,y2:w}),...Object.fromEntries(a.map(({name:C,output:z})=>[C,z]))}}function Tr(t,...n){for(let{name:e}of t)if(n.includes(e))return!0;return!1}function F1(t,n,e=al){let r=Object.entries(t);return n.title!=null&&t.title===void 0&&r.push(["title",s5]),n.href!=null&&t.href===void 0&&r.push(["href",sl]),r.filter(([,i])=>i!==void 0).map(([i,o])=>o===null?r5(i):e(i,o,n))}function al(t,n,e,r=cl){let i;le(n)&&"reduce"in n&&(i=n.scale,n=n.reduce);let o=r(t,n,e),[a,c]=Sa(o.label),u;return{name:t,output:i===void 0?a:{value:a,scale:i},initialize(s){o.initialize(s),u=c([])},scope(s,f){o.scope(s,f)},reduce(s,f){u.push(o.reduce(s,f))}}}function r5(t){return{name:t,initialize(){},scope(){},reduce(){}}}function cl(t,n,e,r=qa){let i=C6(t,e),o=r(n,i),a,c;return{label:Xe(o===Ta?null:i,o.label),initialize(u){a=i===void 0?u:lt(u,i),o.scope==="data"&&(c=o.reduceIndex(Qn(u),a))},scope(u,s){o.scope===u&&(c=o.reduceIndex(s,a))},reduce(u,s){return o.scope==null?o.reduceIndex(u,a,s):o.reduceIndex(u,a,c,s)}}}function Ci(t,n){return n?Ur(t,e=>n[e]):[[,t]]}function qa(t,n,e=i5){if(t==null)return e(t);if(typeof t.reduceIndex=="function")return t;if(typeof t.reduce=="function"&&le(t))return c5(t);if(typeof t=="function")return u5(t);if(/^p\d{2}$/i.test(t))return Vn(A6(t));switch(`${t}`.toLowerCase()){case"first":return sl;case"last":return f5;case"identity":return ul;case"count":return Ta;case"distinct":return l5;case"sum":return n==null?Ta:d5;case"proportion":return xp(n,"data");case"proportion-facet":return xp(n,"facet");case"deviation":return Vn(ec);case"min":return Vn(fn);case"min-index":return Vn(sd);case"max":return Vn(Gt);case"max-index":return Vn(ud);case"mean":return bp(ac);case"median":return bp(Xr);case"variance":return Vn(nc);case"mode":return Vn(hd)}return e(t)}function i5(t){throw new Error(`invalid reduce: ${t}`)}function o5(t,n){return F1(t,n,q1)}function q1(t,n,e){return al(t,n,e,B1)}function B1(t,n,e){return cl(t,n,e,Y1)}function Y1(t,n){return qa(t,n,a5)}function a5(t){switch(`${t}`.toLowerCase()){case"x":return h5;case"y":return m5;case"z":return U1}throw new Error(`invalid group reduce: ${t}`)}function W1(t,n){for(let e in n){let r=n[e];if(r!==void 0&&!t.some(i=>i.name===e))return r}}function H1(t,n,e){if(n){let r=n.output.transform(),i=(o,a)=>hn(r[o],r[a]);t.forEach(o=>o.sort(i))}e&&t.forEach(r=>r.reverse())}function c5(t){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...t,reduceIndex:t.reduce.bind(t)}}function u5(t){return{reduceIndex(n,e,r){return t(Jf(e,n),r)}}}function Vn(t){return{reduceIndex(n,e){return t(n,r=>e[r])}}}function bp(t){return{reduceIndex(n,e){let r=t(n,i=>e[i]);return Ht(e)?new Date(r):r}}}var ul={reduceIndex(t,n){return Jf(n,t)}},sl={reduceIndex(t,n){return n[t[0]]}},s5={reduceIndex(t,n){let r=Hr(we(t,o=>o.length,o=>n[o]),Mf),i=r.slice(-5).reverse();if(i.length<r.length){let o=r.slice(0,-4);i[4]=[`\u2026 ${o.length.toLocaleString("en-US")} more`,bn(o,Mf)]}return i.map(([o,a])=>`${o} (${a.toLocaleString("en-US")})`).join(`
|
|
6
|
+
`)}},f5={reduceIndex(t,n){return n[t[t.length-1]]}},Ta={label:"Frequency",reduceIndex(t){return t.length}},l5={label:"Distinct",reduceIndex(t,n){let e=new xe;for(let r of t)e.add(n[r]);return e.size}},d5=Vn(bn);function xp(t,n){return t==null?{scope:n,label:"Frequency",reduceIndex:(e,r,i=1)=>e.length/i}:{scope:n,reduceIndex:(e,r,i=1)=>bn(e,o=>r[o])/i}}var h5={reduceIndex(t,n,{x:e}){return e}},m5={reduceIndex(t,n,{y:e}){return e}},U1={reduceIndex(t,n,{z:e}){return e}};function Pi(t,{scale:n,type:e,value:r,filter:i,hint:o,label:a=Xe(r)},c){return o===void 0&&typeof r?.transform=="function"&&(o=r.hint),G1(c,{scale:n,type:e,value:lt(t,r),label:a,filter:i,hint:o})}function p5(t,n){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e,Pi(n,r,e)]))}function g5(t,n){let e=Object.fromEntries(Object.entries(t).map(([r,{scale:i,value:o}])=>{let a=i==null?null:n[i];return[r,a==null?o:bt(o,a)]}));return e.channels=t,e}function G1(t,n){let{scale:e,value:r}=n;if(e===!0||e==="auto")switch(t){case"fill":case"stroke":case"color":n.scale=e!==!0&&Ma(r,Ia)?null:"color",n.defaultScale="color";break;case"fillOpacity":case"strokeOpacity":case"opacity":n.scale=e!==!0&&Ma(r,F6)?null:"opacity",n.defaultScale="opacity";break;case"symbol":e!==!0&&Ma(r,V6)?(n.scale=null,n.value=bt(r,rl)):n.scale="symbol",n.defaultScale="symbol";break;default:n.scale=ft.has(t)?t:null;break}else if(e===!1)n.scale=null;else if(e!=null&&!ft.has(e))throw new Error(`unknown scale: ${e}`);return n}function y5(t,n,e,r,i){let{order:o,reverse:a,reduce:c=!0,limit:u}=i;for(let s in i){if(!ft.has(s))continue;let{value:f,order:d=o,reverse:l=a,reduce:h=c,limit:p=u}=Bi(i[s]),g=f?.startsWith("-");if(g&&(f=f.slice(1)),d=d===void 0?g!==(f==="width"||f==="height")?V1:X1:w5(d),h==null||h===!1)continue;let b=s==="fx"||s==="fy"?x5(n,r[s]):b5(e,s);if(!b)throw new Error(`missing channel for scale: ${s}`);let v=b.value,[w=0,S=1/0]=de(p)?p:p<0?[p]:[0,p];if(f==null)b.domain=()=>{let m=Array.from(new xe(v));return l&&(m=m.reverse()),(w!==0||S!==1/0)&&(m=m.slice(w,S)),m};else{let m=f==="data"?t:f==="height"?wp(e,"y1","y2"):f==="width"?wp(e,"x1","x2"):$f(e,f,f==="y"?"y2":f==="x"?"x2":void 0),x=qa(h===!0?"max":h,m);b.domain=()=>{let y=od(Qn(v),M=>x.reduceIndex(M,m),M=>v[M]);return d&&y.sort(d),l&&y.reverse(),(w!==0||S!==1/0)&&(y=y.slice(w,S)),y.map(w1)}}}}function b5(t,n){for(let e in t){let r=t[e];if(r.scale===n)return r}}function x5(t,n){let e=t.original;if(e===t)return n;let r=n.value,i=n.value=[];for(let o=0;o<e.length;++o){let a=r[e[o][0]];for(let c of t[o])i[c]=a}return n}function wp(t,n,e){let r=$f(t,n),i=$f(t,e);return bt(i,(o,a)=>Math.abs(o-r[a]),Float64Array)}function $f(t,n,e){let r=t[n];if(!r&&e!==void 0&&(r=t[e]),r)return r.value;throw new Error(`missing channel: ${n}`)}function w5(t){if(t==null||typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"ascending":return X1;case"descending":return V1}throw new Error(`invalid order: ${t}`)}function X1([t,n],[e,r]){return hn(n,r)||hn(t,e)}function V1([t,n],[e,r]){return _a(n,r)||hn(t,e)}function vp(t,n){let e=t[n];if(e){for(;e.source;)e=e.source;return e.source===null?null:e}}function fl(t={}){let{document:n=typeof window<"u"?window.document:void 0,clip:e}=t;return{document:n,clip:P1(e)}}function gt(t,{document:n}){return Dn(jr(t).call(n.documentElement))}var Sf=0,kf;function v5(){let t=Sf;return Sf=0,kf=void 0,t}function fe(t){t!==kf&&(kf=t,console.warn(t),++Sf)}var j1=Math.PI,Un=2*j1,af=.618;function M5({projection:t,inset:n=0,insetTop:e=n,insetRight:r=n,insetBottom:i=n,insetLeft:o=n}={},a){if(t==null)return;if(typeof t.stream=="function")return _5(t);let c,u,s="frame";if(le(t)){let y;if({type:t,domain:u,inset:y,insetTop:e=y!==void 0?y:e,insetRight:r=y!==void 0?y:r,insetBottom:i=y!==void 0?y:i,insetLeft:o=y!==void 0?y:o,clip:s=s,...c}=t,t==null)return}typeof t!="function"&&({type:t}=Af(t));let{width:f,height:d,marginLeft:l,marginRight:h,marginTop:p,marginBottom:g}=a,b=f-l-h-o-r,v=d-p-g-e-i;if(t=t?.({width:b,height:v,clip:s,...c}),t==null)return;s=$5(s,l,p,f-h,d-g);let w=l+o,S=p+e,m,x=1;if(u!=null){let[[y,M],[_,$]]=qo(t).bounds(u);x=Math.min(b/(_-y),v/($-M)),x>0?(w-=(x*(y+_)-b)/2,S-=(x*(M+$)-v)/2,m=k5(x,w,S)):fe("Warning: the projection could not be fit to the specified domain; using the default scale.")}return m??=K1(w,S),{stream(y){return t.stream(m.stream(s(y)))},apply(y){let M=null;return this.stream({point:(..._)=>M=_}).point(...y),M},...t.invert&&{invert(y){return t.invert(m.invert(y))}}}}function _5(t){return typeof t=="function"?{stream:n=>t.stream(n),apply:n=>t(n),...t.invert&&{invert:n=>t.invert(n)}}:t}function Af(t){switch(`${t}`.toLowerCase()){case"albers-usa":return dn(c0,.7463,.4673);case"albers":return da(tu,.7463,.4673);case"azimuthal-equal-area":return dn(f0,4,4);case"azimuthal-equidistant":return dn(d0,Un,Un);case"conic-conformal":return da(p0,Un,Un);case"conic-equal-area":return da(di,6.1702,2.9781);case"conic-equidistant":return da(y0,7.312,3.6282);case"equal-earth":return dn(x0,5.4133,2.6347);case"equirectangular":return dn(g0,Un,j1);case"gnomonic":return dn(v0,3.4641,3.4641);case"identity":return{type:Z1};case"reflect-y":return{type:S5};case"mercator":return dn(h0,Un,Un);case"orthographic":return dn(_0,2,2);case"stereographic":return dn(S0,2,2);case"transverse-mercator":return dn(A0,Un,Un);default:throw new Error(`unknown projection type: ${t}`)}}function $5(t,n,e,r,i){if(t===!1||t==null||typeof t=="number")return o=>o;if(t===!0&&(t="frame"),`${t}`.toLowerCase()==="frame")return Zc(n,e,r,i);throw new Error(`unknown projection clip type: ${t}`)}function dn(t,n,e){return{type:({width:r,height:i,rotate:o,precision:a=.15,clip:c})=>{let u=t();return a!=null&&u.precision?.(a),o!=null&&u.rotate?.(o),typeof c=="number"&&u.clipAngle?.(c),r!=null&&(u.scale(Math.min(r/n,i/e)),u.translate([r/2,i/2])),u},aspectRatio:e/n}}function da(t,n,e){let{type:r,aspectRatio:i}=dn(t,n,e);return{type:o=>{let{parallels:a,domain:c,width:u,height:s}=o,f=r(o);return a!=null&&(f.parallels(a),c===void 0&&u!=null&&f.fitSize([u,s],{type:"Sphere"})),f},aspectRatio:i}}var Z1=Zn({stream:t=>t,invert:t=>t}),S5=Zn({...hi({point(t,n){this.stream.point(t,-n)}}),invert:([t,n])=>[t,-n]});function K1(t,n){return t===0&&n===0?Z1():{...hi({point(e,r){this.stream.point(e+t,r+n)}}),invert:([e,r])=>[e-t,r-n]}}function k5(t,n,e){return t===1?K1(n,e):{...hi({point(r,i){this.stream.point(r*t+n,i*t+e)}}),invert:([r,i])=>[(r-n)/t,(i-e)/t]}}function A5(t,n,e,r){let i=e[t],o=e[n],a=i.length,c=e[t]=new Float64Array(a).fill(NaN),u=e[n]=new Float64Array(a).fill(NaN),s,f=r.stream({point(d,l){c[s]=d,u[s]=l}});for(s=0;s<a;++s)f.point(i[s],o[s])}function T5({projection:t}={}){return t==null?!1:typeof t.stream=="function"?!0:(le(t)&&(t=t.type),t!=null)}function C5(t){if(typeof t?.stream=="function")return af;if(le(t)){let n,e;if({domain:n,type:t,...e}=t,n!=null&&t!=null){let r=typeof t=="string"?Af(t).type:t,[[i,o],[a,c]]=qo(r({...e,width:100,height:100})).bounds(n),u=(c-o)/(a-i);return u&&isFinite(u)?u<.2?.2:u>5?5:u:af}}if(t!=null){if(typeof t!="function"){let{aspectRatio:n}=Af(t);if(n)return n}return af}}function E5(t){let n=[],e=[],r={scale:"x",value:n},i={scale:"y",value:e},o={point(a,c){n.push(a),e.push(c)},lineStart(){},lineEnd(){},polygonStart(){},polygonEnd(){},sphere(){}};for(let a of t.value)re(a,o);return[r,i]}function N5({x:t,y:n}){if(t||n)return t??=e=>e,n??=e=>e,hi({point(e,r){this.stream.point(t(e),n(r))}})}var Q1=new Map([["accent",dm],["category10",lm],["dark2",hm],["observable10",mm],["paired",pm],["pastel1",gm],["pastel2",ym],["set1",bm],["set2",xm],["set3",wm],["tableau10",vm]]);function L5(t){return t!=null&&Q1.has(`${t}`.toLowerCase())}var Mp=new Map([...Q1,["brbg",Gn(Tu,Cu)],["prgn",Gn(Eu,Nu)],["piyg",Gn(Lu,Pu)],["puor",Gn(Ru,Du)],["rdbu",Gn(ta,_i)],["rdgy",Gn(Ou,Iu)],["rdylbu",Gn(na,$i)],["rdylgn",Gn(zu,Fu)],["spectral",Gn(qu,Bu)],["burd",_p(ta,_i)],["buylrd",_p(na,$i)],["blues",St(ds,hs)],["greens",St(ms,ps)],["greys",St(gs,ys)],["oranges",St(Ms,_s)],["purples",St(bs,xs)],["reds",St(ws,vs)],["turbo",Xn(Es)],["viridis",Xn(Ns)],["magma",Xn(Ls)],["inferno",Xn(Ps)],["plasma",Xn(Rs)],["cividis",Xn($s)],["cubehelix",Xn(Ss)],["warm",Xn(ks)],["cool",Xn(As)],["bugn",St(Yu,Wu)],["bupu",St(Hu,Uu)],["gnbu",St(Gu,Xu)],["orrd",St(Vu,ju)],["pubu",St(Qu,Ju)],["pubugn",St(Zu,Ku)],["purd",St(ts,ns)],["rdpu",St(es,rs)],["ylgn",St(as,cs)],["ylgnbu",St(is,os)],["ylorbr",St(us,ss)],["ylorrd",St(fs,ls)],["rainbow",$p(Ts)],["sinebow",$p(Cs)]]);function St(t,n){return({length:e})=>e===1?[t[3][1]]:e===2?[t[3][1],t[3][2]]:(e=Math.max(3,Math.floor(e)),e>9?jt(n,e):t[e])}function Gn(t,n){return({length:e})=>e===2?[t[3][0],t[3][2]]:(e=Math.max(3,Math.floor(e)),e>11?jt(n,e):t[e])}function _p(t,n){return({length:e})=>e===2?[t[3][2],t[3][0]]:(e=Math.max(3,Math.floor(e)),e>11?jt(r=>n(1-r),e):t[e].slice().reverse())}function Xn(t){return({length:n})=>jt(t,Math.max(2,Math.floor(n)))}function $p(t){return({length:n})=>jt(t,Math.floor(n)+1).slice(0,-1)}function J1(t){let n=`${t}`.toLowerCase();if(!Mp.has(n))throw new Error(`unknown ordinal scheme: ${n}`);return Mp.get(n)}function Ba(t,n){let e=J1(t),r=typeof e=="function"?e({length:n}):e;return r.length!==n?r.slice(0,n):r}function P5(t,n="greys"){let e=new Set,[r,i]=Ba(n,2);for(let o of t)if(o!=null)if(o===!0)e.add(i);else if(o===!1)e.add(r);else return;return[...e]}var Sp=new Map([["brbg",Cu],["prgn",Nu],["piyg",Pu],["puor",Du],["rdbu",_i],["rdgy",Iu],["rdylbu",$i],["rdylgn",Fu],["spectral",Bu],["burd",t=>_i(1-t)],["buylrd",t=>$i(1-t)],["blues",hs],["greens",ps],["greys",ys],["purples",xs],["reds",vs],["oranges",_s],["turbo",Es],["viridis",Ns],["magma",Ls],["inferno",Ps],["plasma",Rs],["cividis",$s],["cubehelix",Ss],["warm",ks],["cool",As],["bugn",Wu],["bupu",Uu],["gnbu",Xu],["orrd",ju],["pubugn",Ku],["pubu",Ju],["purd",ns],["rdpu",rs],["ylgnbu",os],["ylgn",cs],["ylorbr",ss],["ylorrd",ls],["rainbow",Ts],["sinebow",Cs]]);function ll(t){let n=`${t}`.toLowerCase();if(!Sp.has(n))throw new Error(`unknown quantitative scheme: ${n}`);return Sp.get(n)}var R5=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function D5(t){return t!=null&&R5.has(`${t}`.toLowerCase())}var tg=t=>n=>t(1-n),cf=[0,1],kp=new Map([["number",kt],["rgb",dr],["hsl",ah],["hcl",sh],["lab",ch]]);function ng(t){let n=`${t}`.toLowerCase();if(!kp.has(n))throw new Error(`unknown interpolator: ${n}`);return kp.get(n)}function Ui(t,n,e,{type:r,nice:i,clamp:o,zero:a,domain:c=rg(t,e),unknown:u,round:s,scheme:f,interval:d,range:l=ft.get(t)===Yi?G5(e,c):ft.get(t)===Wi?X5(e,c):ft.get(t)===zr?cf:void 0,interpolate:h=ft.get(t)===Jn?f==null&&l!==void 0?dr:ll(f!==void 0?f:r==="cyclical"?"rainbow":"turbo"):s?Jr:kt,reverse:p}){if(c=Ap(c),d=Ir(d,r),(r==="cyclical"||r==="sequential")&&(r="linear"),typeof h!="function"&&(h=ng(h)),p=!!p,l!==void 0){let g=c.length,b=(l=Ap(l)).length;if(g!==b){if(h.length===1)throw new Error("invalid piecewise interpolator");h=mr(h,l),l=void 0}}if(h.length===1?(p&&(h=tg(h),p=!1),l===void 0&&(l=Float64Array.from(c,(g,b)=>b/(c.length-1)),l.length===2&&(l=cf)),n.interpolate((l===cf?Zn:hl)(h))):n.interpolate(h),a){let[g,b]=Xt(c);(g>0||b<0)&&(c=Ei(c),(Er(c)||1)===Math.sign(g)?c[0]=0:c[c.length-1]=0)}return p&&(c=Vr(c)),n.domain(c).unknown(u),i&&(n.nice(O5(i,r)),c=n.domain()),l!==void 0&&n.range(l),o&&n.clamp(o),{type:r,domain:c,range:l,scale:n,interpolate:h,interval:d}}function Ap(t){return t=Ue(t),t.length>=2?t:[t[0],t[0]]}function O5(t,n){return t===!0?void 0:typeof t=="number"?t:N6(t,n)}function I5(t,n,e){return Ui(t,jo(),n,e)}function z5(t,n,e){return eg(t,n,{...e,exponent:.5})}function eg(t,n,{exponent:e=1,...r}){return Ui(t,wu().exponent(e),n,{...r,type:"pow"})}function F5(t,n,{base:e=10,domain:r=V5(n),...i}){return Ui(t,bu().base(e),n,{...i,domain:r})}function q5(t,n,{constant:e=1,...r}){return Ui(t,xu().constant(e),n,r)}function B5(t,n,{range:e,quantiles:r=e===void 0?5:(e=[...e]).length,n:i=r,scheme:o="rdylbu",domain:a=j5(n),unknown:c,interpolate:u,reverse:s}){return e===void 0&&(e=u!==void 0?jt(u,i):ft.get(t)===Jn?Ba(o,i):void 0),a.length>0&&(a=vu(a,e===void 0?{length:i}:e).quantiles()),dl(t,n,{domain:a,range:e,reverse:s,unknown:c})}function Y5(t,n,{range:e,n:r=e===void 0?5:(e=[...e]).length,scheme:i="rdylbu",domain:o=rg(t,n),unknown:a,interpolate:c,reverse:u}){let[s,f]=Xt(o),d;return e===void 0?(d=ve(s,f,r),d[0]<=s&&d.splice(0,1),d[d.length-1]>=f&&d.pop(),r=d.length+1,e=c!==void 0?jt(c,r):ft.get(t)===Jn?Ba(i,r):void 0):(d=jt(kt(s,f),r+1).slice(1,-1),s instanceof Date&&(d=d.map(l=>new Date(l)))),Er(Ue(o))<0&&d.reverse(),dl(t,n,{domain:d,range:e,reverse:u,unknown:a})}function dl(t,n,{domain:e=[0],unknown:r,scheme:i="rdylbu",interpolate:o,range:a=o!==void 0?jt(o,e.length+1):ft.get(t)===Jn?Ba(i,e.length+1):void 0,reverse:c}){e=Ue(e);let u=Er(e);if(!isNaN(u)&&!W5(e,u))throw new Error(`the ${t} scale has a non-monotonic domain`);return c&&(a=Vr(a)),{type:"threshold",scale:Mu(u<0?Vr(e):e,a===void 0?[]:a).unknown(r),domain:e,range:a}}function W5(t,n){for(let e=1,r=t.length,i=t[0];e<r;++e){let o=rr(i,i=t[e]);if(o!==0&&o!==n)return!1}return!0}function H5(t){return{type:"identity",scale:H6(ft.get(t))?yu():n=>n}}function Ri(t,n=f1){return t.length?[fn(t,({value:e})=>e===void 0?e:fn(e,n)),Gt(t,({value:e})=>e===void 0?e:Gt(e,n))]:[0,1]}function rg(t,n){let e=ft.get(t);return(e===Yi||e===zr||e===Wi?U5:Ri)(n)}function U5(t){return[0,t.length?Gt(t,({value:n})=>n===void 0?n:Gt(n,f1)):1]}function G5(t,n){let e=t.find(({radius:a})=>a!==void 0);if(e!==void 0)return[0,e.radius];let r=te(t,.5,({value:a})=>a===void 0?NaN:te(a,.25,Pa)),i=n.map(a=>3*Math.sqrt(a/r)),o=30/Gt(i);return o<1?i.map(a=>a*o):i}function X5(t,n){let e=Xr(t,({value:o})=>o===void 0?NaN:Xr(o,Math.abs)),r=n.map(o=>12*o/e),i=60/Gt(r);return i<1?r.map(o=>o*i):r}function V5(t){for(let{value:n}of t)if(n!==void 0)for(let e of n){if(e>0)return Ri(t,Pa);if(e<0)return Ri(t,Uf)}return[1,10]}function j5(t){let n=[];for(let{value:e}of t)if(e!==void 0)for(let r of e)n.push(r);return n}function hl(t){return(n,e)=>r=>t(n+r*(e-n))}function Ya(t,n,e,r,{type:i,nice:o,clamp:a,domain:c=Ri(r),unknown:u,pivot:s=0,scheme:f,range:d,symmetric:l=!0,interpolate:h=ft.get(t)===Jn?f==null&&d!==void 0?dr:ll(f!==void 0?f:"rdbu"):kt,reverse:p}){s=+s,c=Ue(c);let[g,b]=c;if(c.length>2&&fe(`Warning: the diverging ${t} scale domain contains extra elements.`),rr(g,b)<0&&([g,b]=[b,g],p=!p),g=Math.min(g,s),b=Math.max(b,s),typeof h!="function"&&(h=ng(h)),d!==void 0&&(h=h.length===1?hl(h)(...d):mr(h,d)),p&&(h=tg(h)),l){let v=e.apply(s),w=v-e.apply(g),S=e.apply(b)-v;w<S?g=e.invert(v-S):w>S&&(b=e.invert(v+w))}return n.domain([g,s,b]).unknown(u).interpolator(h),a&&n.clamp(a),o&&n.nice(o),{type:i,domain:[g,b],pivot:s,interpolate:h,scale:n}}function Z5(t,n,e){return Ya(t,$u(),t3,n,e)}function K5(t,n,e){return ig(t,n,{...e,exponent:.5})}function ig(t,n,{exponent:e=1,...r}){return Ya(t,Au().exponent(e=+e),r3(e),n,{...r,type:"diverging-pow"})}function Q5(t,n,{base:e=10,pivot:r=1,domain:i=Ri(n,r<0?Uf:Pa),...o}){return Ya(t,Su().base(e=+e),n3,n,{domain:i,pivot:r,...o})}function J5(t,n,{constant:e=1,...r}){return Ya(t,ku().constant(e=+e),i3(e),n,r)}var t3={apply(t){return t},invert(t){return t}},n3={apply:Math.log,invert:Math.exp},e3={apply(t){return Math.sign(t)*Math.sqrt(Math.abs(t))},invert(t){return Math.sign(t)*(t*t)}};function r3(t){return t===.5?e3:{apply(n){return Math.sign(n)*Math.pow(Math.abs(n),t)},invert(n){return Math.sign(n)*Math.pow(Math.abs(n),1/t)}}}function i3(t){return{apply(n){return Math.sign(n)*Math.log1p(Math.abs(n/t))},invert(n){return Math.sign(n)*Math.expm1(Math.abs(n))*t}}}function og(t,n,e,r){return Ui(t,n,e,r)}function o3(t,n,e){return og(t,sm(),n,e)}function a3(t,n,e){return og(t,fm(),n,e)}var Gi=Symbol("ordinal");function ag(t,n,e,{type:r,interval:i,domain:o,range:a,reverse:c,hint:u}){return i=Ir(i,r),o===void 0&&(o=ug(e,i,t)),(r==="categorical"||r===Gi)&&(r="ordinal"),c&&(o=Vr(o)),o=n.domain(o).domain(),a!==void 0&&(typeof a=="function"&&(a=a(o)),n.range(a)),{type:r,domain:o,range:a,scale:n,hint:u,interval:i}}function c3(t,n,{type:e,interval:r,domain:i,range:o,scheme:a,unknown:c,...u}){r=Ir(r,e),i===void 0&&(i=ug(n,r,t));let s;if(ft.get(t)===Fa)s=f3(n),o=o===void 0?l3(s):bt(o,rl);else if(ft.get(t)===Jn){if(o===void 0&&(e==="ordinal"||e===Gi)&&(o=P5(i,a),o!==void 0&&(a=void 0)),a===void 0&&o===void 0&&(a=e==="ordinal"?"turbo":"observable10"),a!==void 0)if(o!==void 0){let f=ll(a),d=o[0],l=o[1]-o[0];o=({length:h})=>jt(p=>f(d+l*p),h)}else o=J1(a)}else ft.get(t)===zr&&o===void 0&&(o=({length:f})=>jt(d=>d,f));if(c===Uo)throw new Error(`implicit unknown on ${t} scale is not supported`);return ag(t,Xo().unknown(c),n,{...u,type:e,domain:i,range:o,hint:s})}function u3(t,n,{align:e=.5,padding:r=.5,...i}){return cg(rm().align(e).padding(r),n,i,t)}function s3(t,n,{align:e=.5,padding:r=.1,paddingInner:i=r,paddingOuter:o=t==="fx"||t==="fy"?0:r,...a}){return cg(wi().align(e).paddingInner(i).paddingOuter(o),n,a,t)}function cg(t,n,e,r){let{round:i}=e;return i!==void 0&&t.round(i=!!i),t=ag(r,t,n,e),t.round=i,t}function ug(t,n,e){let r=new xe;for(let{value:i,domain:o}of t){if(o!==void 0)return o();if(i!==void 0)for(let a of i)r.add(a)}if(e==="opacity"&&r.add(0),n!==void 0){let[i,o]=Xt(r).map(n.floor,n);return n.range(i,n.offset(o))}if(r.size>1e4&&ft.get(e)===Cn)throw new Error(`implicit ordinal domain of ${e} scale has more than 10,000 values`);return Hr(r,hn)}function Tp(t,n){let e;for(let{hint:r}of t){let i=r?.[n];if(i!==void 0){if(e===void 0)e=i;else if(e!==i)return}}return e}function f3(t){return{fill:Tp(t,"fill"),stroke:Tp(t,"stroke")}}function l3(t){return Wt(t.fill)?Fm:zm}function Tf(t,{label:n,inset:e=0,insetTop:r=e,insetRight:i=e,insetBottom:o=e,insetLeft:a=e,round:c,nice:u,clamp:s,zero:f,align:d,padding:l,projection:h,facet:{label:p=n}={},...g}={}){let b={};for(let[v,w]of t){let S=g[v],m=dg(v,w,{round:ft.get(v)===Cn?c:void 0,nice:u,clamp:s,zero:f,align:d,padding:l,projection:h,...S});if(m){let{label:x=v==="fx"||v==="fy"?p:n,percent:y,transform:M,inset:_,insetTop:$=_!==void 0?_:v==="y"?r:0,insetRight:A=_!==void 0?_:v==="x"?i:0,insetBottom:k=_!==void 0?_:v==="y"?o:0,insetLeft:C=_!==void 0?_:v==="x"?a:0}=S||{};if(M==null)M=void 0;else if(typeof M!="function")throw new Error("invalid scale transform; not a function");m.percent=!!y,m.label=x===void 0?h3(w,m):x,m.transform=M,v==="x"||v==="fx"?(m.insetLeft=+C,m.insetRight=+A):(v==="y"||v==="fy")&&(m.insetTop=+$,m.insetBottom=+k),b[v]=m}}return b}function Cp(t){let n={},e={scales:n};for(let[r,i]of Object.entries(t)){let{scale:o,type:a,interval:c,label:u}=i;n[r]=mg(i),e[r]=o,o.type=a,c!=null&&(o.interval=c),u!=null&&(o.label=u)}return e}function d3(t,n){let{x:e,y:r,fx:i,fy:o}=t,a=i||o?ml(n):n;i&&Ep(i,a),o&&Np(o,a);let c=i||o?sg(t,n):n;e&&Ep(e,c),r&&Np(r,c)}function h3(t=[],n){let e;for(let{label:r}of t)if(r!==void 0){if(e===void 0)e=r;else if(e!==r)return}if(e!==void 0)return!Ve(n)&&n.percent&&(e=`${e} (%)`),{inferred:!0,toString:()=>e}}function m3(t){return Math.sign(Er(t.domain()))*Math.sign(Er(t.range()))}function ml(t){let{marginTop:n,marginRight:e,marginBottom:r,marginLeft:i,width:o,height:a,facet:{marginTop:c,marginRight:u,marginBottom:s,marginLeft:f}}=t;return{marginTop:Math.max(n,c),marginRight:Math.max(e,u),marginBottom:Math.max(r,s),marginLeft:Math.max(i,f),width:o,height:a}}function sg({fx:t,fy:n},e){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:a,width:c,height:u}=ml(e);return{marginTop:r,marginRight:i,marginBottom:o,marginLeft:a,width:t?t.scale.bandwidth()+a+i:c,height:n?n.scale.bandwidth()+r+o:u,facet:{width:c,height:u}}}function Ep(t,n){if(t.range===void 0){let{insetLeft:e,insetRight:r}=t,{width:i,marginLeft:o=0,marginRight:a=0}=n,c=o+e,u=i-a-r;t.range=[c,Math.max(c,u)],Ve(t)||(t.range=lg(t)),t.scale.range(t.range)}fg(t)}function Np(t,n){if(t.range===void 0){let{insetTop:e,insetBottom:r}=t,{height:i,marginTop:o=0,marginBottom:a=0}=n,c=o+e,u=i-a-r;t.range=[Math.max(c,u),c],Ve(t)?t.range.reverse():t.range=lg(t),t.scale.range(t.range)}fg(t)}function fg(t){t.round===void 0&&b3(t)&&p3(t)<=30&&t.scale.round(!0)}function p3({scale:t}){let n=t.domain().length,[e,r]=t.range(),i=t.paddingInner?t.paddingInner():1,o=t.paddingOuter?t.paddingOuter():t.padding(),a=n-i,c=Math.abs(r-e)/Math.max(1,a+o*2);return(c-Math.floor(c))*a}function lg(t){let n=t.scale.domain().length+hg(t);if(!(n>2))return t.range;let[e,r]=t.range;return Array.from({length:n},(i,o)=>e+o/(n-1)*(r-e))}function g3(t,n,e){return dg(t,e===void 0?void 0:[{hint:e}],{...n})}function dg(t,n=[],e={}){let r=y3(t,n,e);if(e.type===void 0&&e.domain===void 0&&e.range===void 0&&e.interval==null&&t!=="fx"&&t!=="fy"&&Ve({type:r})){let i=n.map(({value:o})=>o).filter(o=>o!==void 0);i.some(Ht)?fe(`Warning: some data associated with the ${t} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${Sr(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${t} scale to "${Sr(r)}".`):i.some(R6)?fe(`Warning: some data associated with the ${t} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${Sr(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${t} scale to "${Sr(r)}".`):i.some(D6)&&fe(`Warning: some data associated with the ${t} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${Sr(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${t} scale to "${Sr(r)}".`)}switch(e.type=r,r){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":e=ha(n,e,Tn);break;case"identity":switch(ft.get(t)){case Cn:e=ha(n,e,Tn);break;case Fa:e=ha(n,e,x3);break}break;case"utc":case"time":e=ha(n,e,v1);break}switch(r){case"diverging":return Z5(t,n,e);case"diverging-sqrt":return K5(t,n,e);case"diverging-pow":return ig(t,n,e);case"diverging-log":return Q5(t,n,e);case"diverging-symlog":return J5(t,n,e);case"categorical":case"ordinal":case Gi:return c3(t,n,e);case"cyclical":case"sequential":case"linear":return I5(t,n,e);case"sqrt":return z5(t,n,e);case"threshold":return dl(t,n,e);case"quantile":return B5(t,n,e);case"quantize":return Y5(t,n,e);case"pow":return eg(t,n,e);case"log":return F5(t,n,e);case"symlog":return q5(t,n,e);case"utc":return a3(t,n,e);case"time":return o3(t,n,e);case"point":return u3(t,n,e);case"band":return s3(t,n,e);case"identity":return H5(t);case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function Sr(t){return typeof t=="symbol"?t.description:t}function Lp(t){return typeof t=="string"?`${t}`.toLowerCase():t}var Pp={toString:()=>"projection"};function y3(t,n,{type:e,domain:r,range:i,scheme:o,pivot:a,projection:c}){if(e=Lp(e),t==="fx"||t==="fy")return"band";(t==="x"||t==="y")&&c!=null&&(e=Pp);for(let f of n){let d=Lp(f.type);if(d!==void 0){if(e===void 0)e=d;else if(e!==d)throw new Error(`scale incompatible with channel: ${e} !== ${d}`)}}if(e===Pp)return;if(e!==void 0)return e;if(r===void 0&&!n.some(({value:f})=>f!==void 0))return;let u=ft.get(t);if(u===Yi)return"sqrt";if(u===zr||u===Wi)return"linear";if(u===Fa)return"ordinal";let s=(r??i)?.length;if(s<2||s>2)return uf(u);if(r!==void 0){if(yp(r))return uf(u);if(Ht(r))return"utc"}else{let f=n.map(({value:d})=>d).filter(d=>d!==void 0);if(f.some(yp))return uf(u);if(f.some(Ht))return"utc"}if(u===Jn){if(a!=null||D5(o))return"diverging";if(L5(o))return"categorical"}return"linear"}function uf(t){switch(t){case Cn:return"point";case Jn:return Gi;default:return"ordinal"}}function Ve({type:t}){return t==="ordinal"||t==="point"||t==="band"||t===Gi}function hg({type:t}){return t==="threshold"}function b3({type:t}){return t==="point"||t==="band"}function Ln(t){if(t===void 0)return!0;let n=t.domain(),e=t(n[0]);for(let r=1,i=n.length;r<i;++r)if(t(n[r])-e)return!1;return!0}function ha(t,{domain:n,...e},r){for(let i of t)i.value!==void 0&&(n===void 0&&(n=i.value?.domain),i.value=r(i.value));return{domain:n===void 0?n:r(n),...e}}function x3(t){return bt(t,rl)}function pl(t={}){let n;for(let e in t)if(ft.has(e)&&$a(t[e])){if(n!==void 0)throw new Error("ambiguous scale definition; multiple scales found");n=mg(g3(e,t[e]))}if(n===void 0)throw new Error("invalid scale definition; no scale found");return n}function w3(t,n){return e=>{if(!ft.has(e=`${e}`))throw new Error(`unknown scale: ${e}`);return(e==="projection"?n:t)[e]}}function mg({scale:t,type:n,domain:e,range:r,interpolate:i,interval:o,transform:a,percent:c,pivot:u}){if(n==="identity")return{type:"identity",apply:f=>f,invert:f=>f};let s=t.unknown?t.unknown():void 0;return{type:n,domain:Ei(e),...r!==void 0&&{range:Ei(r)},...a!==void 0&&{transform:a},...c&&{percent:c},...s!==void 0&&{unknown:s},...o!==void 0&&{interval:o},...i!==void 0&&{interpolate:i},...t.clamp&&{clamp:t.clamp()},...u!==void 0&&{pivot:u,symmetric:!1},...t.base&&{base:t.base()},...t.exponent&&{exponent:t.exponent()},...t.constant&&{constant:t.constant()},...t.align&&{align:t.align(),round:t.round()},...t.padding&&(t.paddingInner?{paddingInner:t.paddingInner(),paddingOuter:t.paddingOuter()}:{padding:t.padding()}),...t.bandwidth&&{bandwidth:t.bandwidth(),step:t.step()},apply:f=>t(f),...t.invert&&{invert:f=>t.invert(f)}}}var Cf=Symbol("unset");function gl(t){return(t.length===1?v3:M3)(t)}function v3(t){let n,e=Cf;return r=>(Object.is(e,r)||(e=r,n=t(r)),n)}function M3(t){let n,e;return(...r)=>((e?.length!==r.length||e.some((i,o)=>!Object.is(i,r[o])))&&(e=r,n=t(...r)),n)}var _3=gl(t=>new Intl.NumberFormat(t)),a_=gl((t,n)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...n&&{month:n}})),c_=gl((t,n)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...n&&{weekday:n}}));function $3(t="en-US"){let n=_3(t);return e=>e!=null&&!isNaN(e)?n.format(e):void 0}function S3(t){return m6(t,"Invalid Date")}function k3(t="en-US"){let n=$3(t);return e=>(e instanceof Date?S3:typeof e=="number"?n:Nt)(e)}var Rr=k3(),Tt=typeof window<"u"&&!(window.devicePixelRatio>1)?.5:0,A3=0,T3=0;function pg(){return`plot-clip-${++A3}`}function C3(){return`plot-filter-${++T3}`}function E3(t,{title:n,href:e,ariaLabel:r,ariaDescription:i,ariaHidden:o,target:a,fill:c,fillOpacity:u,stroke:s,strokeWidth:f,strokeOpacity:d,strokeLinejoin:l,strokeLinecap:h,strokeMiterlimit:p,strokeDasharray:g,strokeDashoffset:b,opacity:v,mixBlendMode:w,imageFilter:S,paintOrder:m,pointerEvents:x,shapeRendering:y,channels:M},{ariaLabel:_,fill:$="currentColor",fillOpacity:A,stroke:k="none",strokeOpacity:C,strokeWidth:z,strokeLinecap:L,strokeLinejoin:T,strokeMiterlimit:B,paintOrder:D}){$===null&&(c=null,u=null),k===null&&(s=null,d=null),Wt($)?!Wt(k)&&(!Wt(c)||M?.fill)&&(k="none"):Wt(k)&&(!Wt(s)||M?.stroke)&&($="none");let[H,O]=mn(c,$),[Y,E]=Ot(u,A),[R,F]=mn(s,k),[G,Z]=Ot(d,C),[it,I]=Ot(v);Li(F)||(f===void 0&&(f=z),h===void 0&&(h=L),l===void 0&&(l=T),p===void 0&&!q6(l)&&(p=B),!Li(O)&&m===void 0&&(m=D));let[U,P]=Ot(f);return $!==null&&(t.fill=At(O,"currentColor"),t.fillOpacity=ki(E,1)),k!==null&&(t.stroke=At(F,"none"),t.strokeWidth=ki(P,1),t.strokeOpacity=ki(Z,1),t.strokeLinejoin=At(l,"miter"),t.strokeLinecap=At(h,"butt"),t.strokeMiterlimit=ki(p,4),t.strokeDasharray=At(g,"none"),t.strokeDashoffset=At(b,"0")),t.target=Nt(a),t.ariaLabel=Nt(_),t.ariaDescription=Nt(i),t.ariaHidden=Nt(o),t.opacity=ki(I,1),t.mixBlendMode=At(w,"normal"),t.imageFilter=At(S,"none"),t.paintOrder=At(m,"normal"),t.pointerEvents=At(x,"auto"),t.shapeRendering=At(y,"auto"),{title:{value:n,optional:!0,filter:null},href:{value:e,optional:!0,filter:null},ariaLabel:{value:r,optional:!0,filter:null},fill:{value:H,scale:"auto",optional:!0},fillOpacity:{value:Y,scale:"auto",optional:!0},stroke:{value:R,scale:"auto",optional:!0},strokeOpacity:{value:G,scale:"auto",optional:!0},strokeWidth:{value:U,optional:!0},opacity:{value:it,scale:"auto",optional:!0}}}function N3(t,n){n&&t.filter(e=>Hf(n[e])).append("title").call(P3,n)}function L3(t,n){n&&t.filter(([e])=>Hf(n[e])).append("title").call(R3,n)}function P3(t,n){n&&t.text(e=>Rr(n[e]))}function R3(t,n){n&&t.text(([e])=>Rr(n[e]))}function pn(t,{target:n,tip:e},{ariaLabel:r,title:i,fill:o,fillOpacity:a,stroke:c,strokeOpacity:u,strokeWidth:s,opacity:f,href:d}){r&&j(t,"aria-label",l=>r[l]),o&&j(t,"fill",l=>o[l]),a&&j(t,"fill-opacity",l=>a[l]),c&&j(t,"stroke",l=>c[l]),u&&j(t,"stroke-opacity",l=>u[l]),s&&j(t,"stroke-width",l=>s[l]),f&&j(t,"opacity",l=>f[l]),d&&gg(t,l=>d[l],n),e||N3(t,i)}function yl(t,{target:n,tip:e},{ariaLabel:r,title:i,fill:o,fillOpacity:a,stroke:c,strokeOpacity:u,strokeWidth:s,opacity:f,href:d}){r&&j(t,"aria-label",([l])=>r[l]),o&&j(t,"fill",([l])=>o[l]),a&&j(t,"fill-opacity",([l])=>a[l]),c&&j(t,"stroke",([l])=>c[l]),u&&j(t,"stroke-opacity",([l])=>u[l]),s&&j(t,"stroke-width",([l])=>s[l]),f&&j(t,"opacity",([l])=>f[l]),d&&gg(t,([l])=>d[l],n),e||L3(t,i)}function D3({ariaLabel:t,title:n,fill:e,fillOpacity:r,stroke:i,strokeOpacity:o,strokeWidth:a,opacity:c,href:u},{tip:s}){return[t,s?void 0:n,e,r,i,o,a,c,u].filter(f=>f!==void 0)}function O3(t,n,e){let r=Ur(t,i=>n[i]);return e===void 0&&r.size>1+t.length>>1&&fe("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),r.values()}function*bl(t,n,e,r){let{z:i}=e,{z:o}=r,a=D3(r,e),c=[...n,...a];for(let u of o?O3(t,o,i):[t]){let s,f;t:for(let d of u){for(let l of c)if(!En(l[d])){f&&f.push(-1);continue t}if(s===void 0){f&&(yield f),s=a.map(l=>Kn(l[d])),f=[d];continue}f.push(d);for(let l=0;l<a.length;++l)if(Kn(a[l][d])!==s[l]){yield f,s=a.map(p=>Kn(p[d])),f=[d];continue t}}f&&(yield f)}}function I3(t,n,e,r){let i,{clip:o=r.clip}=n;o==="frame"?(t=gt("svg:g",r).each(function(){this.appendChild(t.node()),t.node=()=>this}),i=F3(r,e)):o&&(i=B3(o,r)),j(t,"aria-label",n.ariaLabel),j(t,"aria-description",n.ariaDescription),j(t,"aria-hidden",n.ariaHidden),j(t,"clip-path",i)}function z3(t){let n=new WeakMap;return(e,r)=>{let i=n.get(e);if(!i){let o=pg();Dn(e.ownerSVGElement).append("clipPath").attr("id",o).call(t,e,r),n.set(e,i=`url(#${o})`)}return i}}var F3=z3((t,n,e)=>{let{width:r,height:i,marginLeft:o,marginRight:a,marginTop:c,marginBottom:u}=e;t.append("rect").attr("x",o).attr("y",c).attr("width",r-a-o).attr("height",i-c-u)}),Rp=new WeakMap,q3={type:"Sphere"};function B3(t,n){let e,r;if((e=Rp.get(n))||Rp.set(n,e=new WeakMap),t.type==="Sphere"&&(t=q3),!(r=e.get(t))){let i=pg();Dn(n.ownerSVGElement).append("clipPath").attr("id",i).append("path").attr("d",n.path()(t)),e.set(t,r=`url(#${i})`)}return r}function Kt(t,n,e,r){I3(t,n,e,r),j(t,"class",n.className),j(t,"fill",n.fill),j(t,"fill-opacity",n.fillOpacity),j(t,"stroke",n.stroke),j(t,"stroke-width",n.strokeWidth),j(t,"stroke-opacity",n.strokeOpacity),j(t,"stroke-linejoin",n.strokeLinejoin),j(t,"stroke-linecap",n.strokeLinecap),j(t,"stroke-miterlimit",n.strokeMiterlimit),j(t,"stroke-dasharray",n.strokeDasharray),j(t,"stroke-dashoffset",n.strokeDashoffset),j(t,"shape-rendering",n.shapeRendering),j(t,"filter",n.imageFilter),j(t,"paint-order",n.paintOrder);let{pointerEvents:i=r.pointerSticky===!1?"none":void 0}=n;j(t,"pointer-events",i)}function It(t,n){Y3(t,"mix-blend-mode",n.mixBlendMode),j(t,"opacity",n.opacity)}function gg(t,n,e){t.each(function(r){let i=n(r);if(i!=null){let o=this.ownerDocument.createElementNS(Me.svg,"a");o.setAttribute("fill","inherit"),o.setAttributeNS(Me.xlink,"href",i),e!=null&&o.setAttribute("target",e),this.parentNode.insertBefore(o,this).appendChild(this)}})}function j(t,n,e){e!=null&&t.attr(n,e)}function Y3(t,n,e){e!=null&&t.style(n,e)}function zt(t,n,{x:e,y:r},i=Tt,o=Tt){i+=n.dx,o+=n.dy,e?.bandwidth&&(i+=e.bandwidth()/2),r?.bandwidth&&(o+=r.bandwidth()/2),(i||o)&&t.attr("transform",`translate(${i},${o})`)}function At(t,n){if((t=Nt(t))!==n)return t}function ki(t,n){if((t=Lt(t))!==n)return t}var W3=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function xl(t){if(t===void 0)return"plot-d6a7b5";if(t=`${t}`,!W3.test(t))throw new Error(`invalid class name: ${t}`);return t}function wl(t,n){if(typeof n=="string")t.property("style",n);else if(n!=null)for(let e of t)Object.assign(e.style,n)}function Xi({frameAnchor:t},{width:n,height:e,marginTop:r,marginRight:i,marginBottom:o,marginLeft:a}){return[/left$/.test(t)?a:/right$/.test(t)?n-i:(a+n-i)/2,/^top/.test(t)?r:/^bottom/.test(t)?e-o:(r+e-o)/2]}function H3(t,n,e={}){let r=.5-Tt,i=.5+Tt,o=.5+Tt,a=.5-Tt;for(let{marginTop:g,marginRight:b,marginBottom:v,marginLeft:w}of n)g>r&&(r=g),b>i&&(i=b),v>o&&(o=v),w>a&&(a=w);let{margin:c,marginTop:u=c!==void 0?c:r,marginRight:s=c!==void 0?c:i,marginBottom:f=c!==void 0?c:o,marginLeft:d=c!==void 0?c:a}=e;u=+u,s=+s,f=+f,d=+d;let{width:l=640,height:h=U3(t,e,{width:l,marginTopDefault:r,marginRightDefault:i,marginBottomDefault:o,marginLeftDefault:a})+Math.max(0,u-r+f-o)}=e;l=+l,h=+h;let p={width:l,height:h,marginTop:u,marginRight:s,marginBottom:f,marginLeft:d};if(t.fx||t.fy){let{margin:g,marginTop:b=g!==void 0?g:u,marginRight:v=g!==void 0?g:s,marginBottom:w=g!==void 0?g:f,marginLeft:S=g!==void 0?g:d}=e.facet??{};b=+b,v=+v,w=+w,S=+S,p.facet={marginTop:b,marginRight:v,marginBottom:w,marginLeft:S}}return p}function U3({x:t,y:n,fy:e,fx:r},{projection:i,aspectRatio:o},{width:a,marginTopDefault:c,marginRightDefault:u,marginBottomDefault:s,marginLeftDefault:f}){let d=e&&e.scale.domain().length||1,l=C5(i);if(l){let p=r?r.scale.domain().length:1,g=(1.1*d-.1)/(1.1*p-.1)*l,b=Math.max(.1,Math.min(10,g));return Math.round((a-f-u)*b+c+s)}let h=n?Ve(n)?n.scale.domain().length||1:Math.max(7,17/d):1;if(o!=null){if(o=+o,!(isFinite(o)&&o>0))throw new Error(`invalid aspectRatio: ${o}`);let p=Dp("y",n)/(Dp("x",t)*o),g=r?r.scale.bandwidth():1,b=e?e.scale.bandwidth():1,v=g*(a-f-u)-t.insetLeft-t.insetRight;return(p*v+n.insetTop+n.insetBottom)/b+c+s}return!!(n||e)*Math.max(1,Math.min(60,h*d))*20+!!r*30+60}function Dp(t,n){if(!n)throw new Error(`aspectRatio requires ${t} scale`);let{type:e,domain:r}=n,i;switch(e){case"linear":case"utc":case"time":i=Number;break;case"pow":{let c=n.scale.exponent();i=u=>Math.pow(u,c);break}case"log":i=Math.log;break;case"point":case"band":return r.length;default:throw new Error(`unsupported ${t} scale for aspectRatio: ${e}`)}let[o,a]=Xt(r);return Math.abs(i(a)-i(o))}function G3(t,n){let{fx:e,fy:r}=Tf(t,n),i=e?.scale.domain(),o=r?.scale.domain();return i&&o?td(i,o).map(([a,c],u)=>({x:a,y:c,i:u})):i?i.map((a,c)=>({x:a,i:c})):o?o.map((a,c)=>({y:a,i:c})):void 0}function X3(t,{x:n,y:e}){return n&&=Ef(n),e&&=Ef(e),t.filter(n&&e?r=>n.has(r.x)&&e.has(r.y):n?r=>n.has(r.x):r=>e.has(r.y)).sort(n&&e?(r,i)=>n.get(r.x)-n.get(i.x)||e.get(r.y)-e.get(i.y):n?(r,i)=>n.get(r.x)-n.get(i.x):(r,i)=>e.get(r.y)-e.get(i.y))}function vl(t,{fx:n,fy:e}){let r=Qn(t),i=n?.value,o=e?.value;return n&&e?we(r,a=>(a.fx=i[a[0]],a.fy=o[a[0]],a),a=>i[a],a=>o[a]):n?we(r,a=>(a.fx=i[a[0]],a),a=>i[a]):we(r,a=>(a.fy=o[a[0]],a),a=>o[a])}function V3(t,n,{marginTop:e,marginLeft:r}){let i=t?({x:a})=>t(a)-r:()=>0,o=n?({y:a})=>n(a)-e:()=>0;return function(a){this.tagName==="svg"?(this.setAttribute("x",i(a)),this.setAttribute("y",o(a))):this.setAttribute("transform",`translate(${i(a)},${o(a)})`)}}function j3(t){let n=[],e=new Uint32Array(bn(t,r=>r.length));for(let r of t){let i=0;for(let o of t)r!==o&&(e.set(o,i),i+=o.length);n.push(e.slice(0,i))}return n}var Z3=new Map([["top",sf],["right",df],["bottom",ff],["left",lf],["top-left",ma(sf,lf)],["top-right",ma(sf,df)],["bottom-left",ma(ff,lf)],["bottom-right",ma(ff,df)],["top-empty",J3],["right-empty",e8],["bottom-empty",t8],["left-empty",n8],["empty",r8]]);function K3(t){if(t==null)return null;let n=Z3.get(`${t}`.toLowerCase());if(n)return n;throw new Error(`invalid facet anchor: ${t}`)}var Op=new WeakMap;function Ef(t){let n=Op.get(t);return n||Op.set(t,n=new sn(bt(t,(e,r)=>[e,r]))),n}function he(t,n){return Ef(t).get(n)}function Q3(t,n,e){return n=Kn(n),e=Kn(e),t.find(r=>Object.is(Kn(r.x),n)&&Object.is(Kn(r.y),e))}function Wa(t,n,e){return Q3(t,n,e)?.empty}function sf(t,{y:n},{y:e}){return n?he(n,e)===0:!0}function ff(t,{y:n},{y:e}){return n?he(n,e)===n.length-1:!0}function lf(t,{x:n},{x:e}){return n?he(n,e)===0:!0}function df(t,{x:n},{x:e}){return n?he(n,e)===n.length-1:!0}function J3(t,{y:n},{x:e,y:r,empty:i}){if(i)return!1;if(!n)return;let o=he(n,r);if(o>0)return Wa(t,e,n[o-1])}function t8(t,{y:n},{x:e,y:r,empty:i}){if(i)return!1;if(!n)return;let o=he(n,r);if(o<n.length-1)return Wa(t,e,n[o+1])}function n8(t,{x:n},{x:e,y:r,empty:i}){if(i)return!1;if(!n)return;let o=he(n,e);if(o>0)return Wa(t,n[o-1],r)}function e8(t,{x:n},{x:e,y:r,empty:i}){if(i)return!1;if(!n)return;let o=he(n,e);if(o<n.length-1)return Wa(t,n[o+1],r)}function r8(t,n,{empty:e}){return e}function ma(t,n){return function(){return t.apply(null,arguments)&&n.apply(null,arguments)}}function hf(t,{channels:{fx:n,fy:e},groups:r}){return n&&e?t.map(({x:i,y:o})=>r.get(i)?.get(o)??[]):n?t.map(({x:i})=>r.get(i)??[]):t.map(({y:i})=>r.get(i)??[])}var Pt=class{constructor(n,e={},r={},i){let{facet:o="auto",facetAnchor:a,fx:c,fy:u,sort:s,dx:f=0,dy:d=0,margin:l=0,marginTop:h=l,marginRight:p=l,marginBottom:g=l,marginLeft:b=l,className:v,clip:w=i?.clip,channels:S,tip:m,pool:x=i?.pool,render:y}=r;if(this.data=n,this.sort=Lr(s)?s:null,this.initializer=Pr(r).initializer,this.transform=this.initializer?r.transform:Hi(r).transform,o===null||o===!1?this.facet=null:(this.facet=gn(o===!0?"include":o,"facet",["auto","include","exclude","super"]),this.fx=n===va&&typeof c=="string"?[c]:c,this.fy=n===va&&typeof u=="string"?[u]:u),this.facetAnchor=K3(a),e=L1(e),S!==void 0&&(e={...i8(S),...e}),i!==void 0&&(e={...E3(this,r,i),...e}),this.channels=Object.fromEntries(Object.entries(e).map(([M,_])=>{if(Oa(_.value)){let{value:$,label:A=_.label,scale:k=_.scale}=_.value;_={..._,label:A,scale:k,value:$}}if(n===va&&typeof _.value=="string"){let{value:$}=_;_={..._,value:[$]}}return[M,_]}).filter(([M,{value:_,optional:$}])=>{if(_!=null)return!0;if($)return!1;throw new Error(`missing channel value: ${M}`)})),this.dx=+f,this.dy=+d,this.marginTop=+h,this.marginRight=+p,this.marginBottom=+g,this.marginLeft=+b,this.clip=P1(w),this.tip=o8(m),this.pool=!!x,this.className=Nt(v),this.facet==="super"){if(c||u)throw new Error("super-faceting cannot use fx or fy");for(let M in this.channels){let{scale:_}=e[M];if(!(_!=="x"&&_!=="y"))throw new Error("super-faceting cannot use x or y")}}y!=null&&(this.render=bg(y,this.render))}initialize(n,e,r){let i=Nr(this.data);n===void 0&&i!=null&&(n=[Qn(i)]);let o=n;this.transform!=null&&({facets:n,data:i}=this.transform(i,n,r),i=Nr(i)),n!==void 0&&(n.original=o);let a=p5(this.channels,i);return this.sort!=null&&y5(i,n,a,e,this.sort),{data:i,facets:n,channels:a}}filter(n,e,r){for(let i in e){let{filter:o=En}=e[i];if(o!==null){let a=r[i];n=n.filter(c=>o(a[c]))}}return n}project(n,e,r){for(let i in n)if(n[i].scale==="x"&&/^x|x$/.test(i)){let o=i.replace(/^x|x$/,"y");o in n&&n[o].scale==="y"&&A5(i,o,e,r.projection)}}scale(n,e,r){let i=g5(n,e);return r.projection&&this.project(n,i,r),i}plot({marks:n=[],...e}={}){return Il({...e,marks:[...n,this]})}};function yg(...t){return t.plot=Pt.prototype.plot,t}function bg(t,n){if(t==null)return n===null?void 0:n;if(n==null)return t===null?void 0:t;if(typeof t!="function")throw new TypeError(`invalid render transform: ${t}`);if(typeof n!="function")throw new TypeError(`invalid render transform: ${n}`);return function(e,r,i,o,a,c){return t.call(this,e,r,i,o,a,(u,s,f,d,l)=>n.call(this,u,s,f,d,l,c))}}function i8(t){return Object.fromEntries(Object.entries(L1(t)).map(([n,e])=>(e=typeof e=="string"?{value:e,label:n}:Bi(e),e.filter===void 0&&e.scale==null&&(e={...e,filter:null}),[n,e])))}function o8(t){return t===!0?"xy":t===!1||t==null?null:typeof t=="string"?gn(t,"tip",["x","y","xy"]):t}function Fr(t,n){return t?.tip===!0?{...t,tip:n}:le(t?.tip)&&t.tip.pointer===void 0?{...t,tip:{...t.tip,pointer:n}}:t}var Ip=new WeakMap,zp=new WeakSet;function Ml(t,n,{x:e,y:r,px:i,py:o,maxRadius:a=40,channels:c,render:u,...s}={}){return a=+a,i!=null&&(e??=null,c={...c,px:{value:i,scale:"x"}}),o!=null&&(r??=null,c={...c,py:{value:o,scale:"y"}}),{x:e,y:r,channels:c,...s,render:bg(function(f,d,l,h,p,g){p={...p,pointerSticky:!1};let b=p.ownerSVGElement,{data:v}=p.getMarkState(this),w=Ip.get(b);w||(w={sticky:!1,roots:[],renders:[],pool:this.pool?{map:new Map}:null},Ip.set(b,w));let S=w.renders.push(F)-1,{x:m,y:x,fx:y,fy:M}=d,_=y?y(f.fx)-h.marginLeft:0,$=M?M(f.fy)-h.marginTop:0;m?.bandwidth&&(_+=m.bandwidth()/2),x?.bandwidth&&($+=x.bandwidth()/2);let A=f.fi!=null,k;if(A){let I=w.facetPools;I||(w.facetPools=I=new Map),k=I.get(this),k||I.set(this,k={map:new Map})}let[C,z]=Xi(this,h),{px:L,py:T}=l,B=L?I=>L[I]:xg(l,C),D=T?I=>T[I]:wg(l,z),H,O,Y,E=w.pool??k;function R(I,U){if(!E)return void F(I);I==null&&F(I),E.map.set(S,{ii:I,ri:U,render:F}),E.frame!==void 0&&cancelAnimationFrame(E.frame),E.frame=requestAnimationFrame(()=>{E.frame=void 0;let P=null;for(let q of E.map.values())(!P||q.ri<P.ri)&&(P=q);for(let q of E.map.values())q.render(q===P?q.ii:null)})}function F(I){if(H===I&&Y===w.sticky)return;H=I,Y=p.pointerSticky=w.sticky;let U=H==null?[]:[H];A&&(U.fx=f.fx,U.fy=f.fy,U.fi=f.fi);let P=g(U,d,l,h,p);if(O){if(A){let q=O.parentNode,W=O.getAttribute("transform"),N=P.getAttribute("transform");W?P.setAttribute("transform",W):P.removeAttribute("transform"),N?q.setAttribute("transform",N):q.removeAttribute("transform"),P.removeAttribute("aria-label"),P.removeAttribute("aria-description"),P.removeAttribute("aria-hidden")}O.replaceWith(P)}if(w.roots[S]=O=P,!(H==null&&k?.map.size>1)){let q=H==null?null:We(v)?v[H]:v.get(H);p.dispatchValue(q)}return P}function G(I){if(w.sticky||I.pointerType==="mouse"&&I.buttons===1)return;let[U,P]=Td(I);U-=_,P-=$;let q=U<h.marginLeft||U>h.width-h.marginRight?1:t,W=P<h.marginTop||P>h.height-h.marginBottom?1:n,N=null,K=a*a;for(let X of f){let V=q*(B(X)-U),nt=W*(D(X)-P),ct=V*V+nt*nt;ct<=K&&(N=X,K=ct)}if(N!=null&&(t!==1||n!==1)){let X=B(N)-U,V=D(N)-P;K=X*X+V*V}R(N,K)}function Z(I){zp.has(I)||(zp.add(I),I.pointerType==="mouse"&&H!=null&&(w.sticky&&w.roots.some(U=>U?.contains(I.target))||(w.sticky?(w.sticky=!1,w.renders.forEach(U=>U(null))):(w.sticky=!0,F(H)))))}function it(I){I.pointerType==="mouse"&&(w.sticky||R(null))}return b.addEventListener("pointerenter",G),b.addEventListener("pointermove",G),b.addEventListener("pointerdown",Z),b.addEventListener("pointerleave",it),F(null)},u)}}function a8(t){return Ml(1,1,t)}function c8(t){return Ml(1,.01,t)}function Fp(t){return Ml(.01,1,t)}function xg({x1:t,x2:n,x:e=t},r){return t&&n?i=>(t[i]+n[i])/2:e?i=>e[i]:()=>r}function wg({y1:t,y2:n,y:e=t},r){return t&&n?i=>(t[i]+n[i])/2:e?i=>e[i]:()=>r}function vg(t){return Ve(t)&&t.interval===void 0?void 0:"tabular-nums"}function Mg(t,n){let{label:e=t.label,tickSize:r=6,width:i=240,height:o=44+r,marginTop:a=18,marginRight:c=0,marginBottom:u=16+r,marginLeft:s=0,style:f,ticks:d=(i-s-c)/64,tickFormat:l,fontVariant:h=vg(t),round:p=!0,opacity:g,className:b}=n,v=fl(n);b=xl(b),g=Ot(g)[1],l===null&&(l=()=>null);let w=gt("svg",v).attr("class",`${b}-ramp`).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",i).attr("height",o).attr("viewBox",`0 0 ${i} ${o}`).call(C=>C.append("style").text(`:where(.${b}-ramp) {
|
|
7
7
|
display: block;
|
|
8
8
|
height: auto;
|
|
9
9
|
height: intrinsic;
|
|
10
10
|
max-width: 100%;
|
|
11
11
|
overflow: visible;
|
|
12
12
|
}
|
|
13
|
-
:where(.${
|
|
13
|
+
:where(.${b}-ramp text) {
|
|
14
14
|
white-space: pre;
|
|
15
|
-
}`)).call(pl,s),$=T=>T.selectAll(".tick line").attr("y1",a+u-o),p,b=m?(T,D)=>T.rangeRound(D):(T,D)=>T.range(D),{type:y,domain:_,range:M,interpolate:S,scale:C,pivot:k}=t;if(S){let T=M===void 0?S:fr(S.length===1?ul(S):S,M);p=b(C.copy(),Gt($t(f,i-c),Math.min(_.length+(k!==void 0),M===void 0?1/0:M.length)));let D=256,P=v.document.createElement("canvas");P.width=D,P.height=1;let A=P.getContext("2d",{colorSpace:"display-p3"}),O=t.key==="opacity"?"globalAlpha":"fillStyle";for(let R=0,W=D-1;R<D;++R)A[O]=T(R/W),A.fillRect(R,0,1,1);w.append("image").attr("opacity",g).attr("x",f).attr("y",a).attr("width",i-f-c).attr("height",o-a-u).attr("preserveAspectRatio","none").attr("xlink:href",P.toDataURL())}else if(y==="threshold"){let T=_,D=l===void 0?P=>P:typeof l=="string"?ne(l):l;p=b(Go().domain([-1,M.length-1]),[f,i-c]),w.append("g").attr("fill",t.key==="opacity"?t.color:null).attr("fill-opacity",g).selectAll().data(M).enter().append("rect").attr("x",(P,A)=>p(A-1)).attr("y",a).attr("width",(P,A)=>p(A)-p(A-1)).attr("height",o-a-u).attr(t.key==="opacity"?"fill-opacity":"fill",P=>P),d=mt(T,(P,A)=>A),l=P=>D(T[P],P)}else p=b(mi().domain(_),[f,i-c]),w.append("g").attr("fill",t.key==="opacity"?t.color:null).attr("fill-opacity",g).selectAll().data(_).enter().append("rect").attr("x",p).attr("y",a).attr("width",Math.max(0,p.bandwidth()-1)).attr("height",o-a-u).attr(t.key==="opacity"?"fill-opacity":"fill",C),$=()=>{};return w.append("g").attr("transform",`translate(0,${o-u})`).call(ud(p).ticks(Array.isArray(d)?null:d,typeof l=="string"?l:void 0).tickFormat(typeof l=="function"?l:void 0).tickSize(r).tickValues(Array.isArray(d)?d:null).offset(kt)).attr("font-size",null).attr("font-family",null).attr("font-variant",St(h,"normal")).call($).call(T=>T.select(".domain").remove()),e!==void 0&&w.append("text").attr("x",f).attr("y",a-6).attr("fill","currentColor").attr("font-weight","bold").text(e),w.node()}var gg=Math.PI/180;function Wi(t,{marker:n,markerStart:e=n,markerMid:r=n,markerEnd:i=n}={}){t.markerStart=fs(e),t.markerMid=fs(r),t.markerEnd=fs(i)}function fs(t){if(t==null||t===!1)return null;if(t===!0)return L1;if(typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"none":return null;case"arrow":return R1("auto");case"arrow-reverse":return R1("auto-start-reverse");case"dot":return X3;case"circle":case"circle-fill":return L1;case"circle-stroke":return V3;case"tick":return ss("auto");case"tick-x":return ss(90);case"tick-y":return ss(0)}throw new Error(`invalid marker: ${t}`)}function R1(t){return(n,e)=>pt("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient",t).attr("fill","none").attr("stroke",n).attr("stroke-dasharray","none").attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call(r=>r.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function X3(t,n){return pt("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","none").call(e=>e.append("circle").attr("r",2.5)).node()}function L1(t,n){return pt("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","var(--plot-background)").attr("stroke-dasharray","none").attr("stroke-width",1.5).call(e=>e.append("circle").attr("r",3)).node()}function V3(t,n){return pt("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","var(--plot-background)").attr("stroke",t).attr("stroke-dasharray","none").attr("stroke-width",1.5).call(e=>e.append("circle").attr("r",3)).node()}function ss(t){return(n,e)=>pt("svg:marker",e).attr("viewBox","-3 -3 6 6").attr("markerWidth",6).attr("markerHeight",6).attr("orient",t).attr("stroke",n).attr("stroke-dasharray","none").call(r=>r.append("path").attr("d","M0,-3v6")).node()}var j3=0;function yl(t,n,{stroke:e},r){return wg(t,n,e&&(i=>e[i]),null,r)}function yg(t,n,{stroke:e,z:r},i){return wg(t,n,e&&(([o])=>e[o]),r,i)}var ks=1,bg=2;function Z3(t,n){let e=new Uint8Array(n.length),r=t.data().filter(o=>o.length>1),i=r.length;for(let o=0,a=$s;o<i;++o){let c=r[o];if(c.length>1){let u=c[0];a!==(a=Vn(n[u]))&&(e[u]|=ks)}}for(let o=i-1,a=$s;o>=0;--o){let c=r[o];if(c.length>1){let u=c[0];a!==(a=Vn(n[u]))&&(e[u]|=bg)}}return([o])=>e[o]}function wg(t,{markerStart:n,markerMid:e,markerEnd:r,stroke:i},o=()=>i,a,c){if(!n&&!e&&!r)return;let u=new Map,f=a&&Z3(t,a);function s(d,l,h){return function(m){if(h&&!h(m))return;let g=o(m),x=u.get(l);x||u.set(l,x=new Map);let v=x.get(g);if(!v){let w=this.parentNode.insertBefore(l(g,c),this),$=`plot-marker-${++j3}`;w.setAttribute("id",$),x.set(g,v=`url(#${$})`)}this.setAttribute(d,v)}}n&&t.each(s("marker-start",n,f&&(d=>f(d)&ks))),e&&f&&t.each(s("marker-start",e,d=>!(f(d)&ks))),e&&t.each(s("marker-mid",e)),r&&t.each(s("marker-end",r,f&&(d=>f(d)&bg)))}function Ui({inset:t,insetLeft:n,insetRight:e,...r}={}){return[n,e]=xg(t,n,e),{inset:t,insetLeft:n,insetRight:e,...r}}function Gi({inset:t,insetTop:n,insetBottom:e,...r}={}){return[n,e]=xg(t,n,e),{inset:t,insetTop:n,insetBottom:e,...r}}function xg(t,n,e){return t===void 0&&n===void 0&&e===void 0?kt?[1,0]:[.5,.5]:[n,e]}function vg(t,{interval:n}){return t={...Ii(t)},t.interval=js(t.interval===void 0?n:t.interval),t}function Ba(t,n,e,r){let{[t]:i,[`${t}1`]:o,[`${t}2`]:a}=e,{value:c,interval:u}=vg(i,e);if(c==null||u==null&&!r)return e;let f=Ue(i);if(u==null){let h,m={transform:g=>h||(h=st(g,c)),label:f};return{...e,[t]:void 0,[`${t}1`]:o===void 0?m:o,[`${t}2`]:a===void 0&&!(o===a&&r)?m:a}}let s,d;function l(h){return d!==void 0&&h===s?d:d=mt(st(s=h,c),m=>u.floor(m))}return n({...e,[t]:void 0,[`${t}1`]:o===void 0?{transform:l,label:f}:o,[`${t}2`]:a===void 0?{transform:h=>l(h).map(m=>u.offset(m)),label:f}:a})}function _g(t,n,e){let{[t]:r}=e,{value:i,interval:o}=vg(r,e);return i==null||o==null?e:n({...e,[t]:{label:Ue(r),transform:a=>{let c=mt(st(a,i),f=>o.floor(f)),u=c.map(f=>o.offset(f));return c.map(qt(c)?(f,s)=>f==null||isNaN(f=+f)||(s=u[s],s==null)||isNaN(s=+s)?void 0:new Date((f+s)/2):(f,s)=>f==null||(s=u[s],s==null)?NaN:(+f+ +s)/2)}}})}function Mg(t={}){return Ba("x",Ui,t,!0)}function $g(t={}){return Ba("y",Gi,t,!0)}function Sg(t={}){return Ba("x",Ui,t)}function kg(t={}){return Ba("y",Gi,t)}function K3(t={}){return _g("x",Ui,t)}function Q3(t={}){return _g("y",Gi,t)}var Ag={ariaLabel:"rule",fill:null,stroke:"currentColor"},As=class extends Et{constructor(n,e={}){let{x:r,y1:i,y2:o,inset:a=0,insetTop:c=a,insetBottom:u=a}=e;super(n,{x:{value:r,scale:"x",optional:!0},y1:{value:i,scale:"y",optional:!0},y2:{value:o,scale:"y",optional:!0}},Pr(e,"x"),Ag),this.insetTop=Ct(c),this.insetBottom=Ct(u),Wi(this,e)}render(n,e,r,i,o){let{x:a,y:c}=e,{x:u,y1:f,y2:s}=r,{width:d,height:l,marginTop:h,marginRight:m,marginLeft:g,marginBottom:x}=i,{insetTop:v,insetBottom:w}=this;return pt("svg:g",o).call(Xt,this,i,o).call(Dt,this,{x:u&&a},kt,0).call($=>$.selectAll().data(n).enter().append("line").call(Pt,this).attr("x1",u?p=>u[p]:(g+d-m)/2).attr("x2",u?p=>u[p]:(g+d-m)/2).attr("y1",f&&!Cn(c)?p=>f[p]+v:h+v).attr("y2",s&&!Cn(c)?c.bandwidth?p=>s[p]+c.bandwidth()-w:p=>s[p]-w:l-x-w).call(dn,this,r).call(yl,this,r,o)).node()}},Ts=class extends Et{constructor(n,e={}){let{x1:r,x2:i,y:o,inset:a=0,insetRight:c=a,insetLeft:u=a}=e;super(n,{y:{value:o,scale:"y",optional:!0},x1:{value:r,scale:"x",optional:!0},x2:{value:i,scale:"x",optional:!0}},Pr(e,"y"),Ag),this.insetRight=Ct(c),this.insetLeft=Ct(u),Wi(this,e)}render(n,e,r,i,o){let{x:a,y:c}=e,{y:u,x1:f,x2:s}=r,{width:d,height:l,marginTop:h,marginRight:m,marginLeft:g,marginBottom:x}=i,{insetLeft:v,insetRight:w}=this;return pt("svg:g",o).call(Xt,this,i,o).call(Dt,this,{y:u&&c},0,kt).call($=>$.selectAll().data(n).enter().append("line").call(Pt,this).attr("x1",f&&!Cn(a)?p=>f[p]+v:g+v).attr("x2",s&&!Cn(a)?a.bandwidth?p=>s[p]+a.bandwidth()-w:p=>s[p]-w:d-m-w).attr("y1",u?p=>u[p]:(h+l-x)/2).attr("y2",u?p=>u[p]:(h+l-x)/2).call(dn,this,r).call(yl,this,r,o)).node()}};function qa(t,n){let{x:e=ht,y:r,y1:i,y2:o,...a}=kg(n);return[i,o]=Tg(r,i,o),new As(t,{...a,x:e,y1:i,y2:o})}function Hi(t,n){let{y:e=ht,x:r,x1:i,x2:o,...a}=Sg(n);return[i,o]=Tg(r,i,o),new Ts(t,{...a,y:e,x1:i,x2:o})}function Tg(t,n,e){if(t==null){if(n===void 0){if(e!==void 0)return[0,e]}else if(e===void 0)return[0,n]}else{if(n===void 0)return e===void 0?[0,t]:[t,e];if(e===void 0)return[t,n]}return[n,e]}function bl(t,...n){let e=n.length;for(let r=0,i=!0;r<e;++r)typeof n[r]!="function"&&(i&&(t=t.slice(),i=!1),t.splice(r,2,t[r]+n[r]+t[r+1]),n.splice(r,1),--r,--e);return r=>{let i=t[0];for(let o=0;o<e;++o)i+=n[o](r)+t[o+1];return i}}var J3={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"},Cg="\xAD",Ei=class extends Et{constructor(n,e={}){let{x:r,y:i,text:o=le(n)&&vm(n)?ht:qe,frameAnchor:a,textAnchor:c=/right$/i.test(a)?"end":/left$/i.test(a)?"start":"middle",lineAnchor:u=/^top/i.test(a)?"top":/^bottom/i.test(a)?"bottom":"middle",lineHeight:f=1,lineWidth:s=1/0,textOverflow:d,monospace:l,fontFamily:h=l?"ui-monospace, monospace":void 0,fontSize:m,fontStyle:g,fontVariant:x,fontWeight:v,rotate:w}=e,[$,p]=Lt(w,0),[b,y]=o8(m);if(super(n,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},fontSize:{value:b,optional:!0},rotate:{value:b6($),optional:!0},text:{value:o,filter:Fs,optional:!0}},e,J3),this.rotate=p,this.textAnchor=St(c,"middle"),this.lineAnchor=hn(u,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+f,this.lineWidth=+s,this.textOverflow=Eg(d),this.monospace=!!l,this.fontFamily=Tt(h),this.fontSize=y,this.fontStyle=Tt(g),this.fontVariant=Tt(x),this.fontWeight=Tt(v),this.frameAnchor=Pa(a),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${s}`);this.splitLines=Rg(this),this.clipLine=Lg(this)}render(n,e,r,i,o){let{x:a,y:c}=e,{x:u,y:f,rotate:s,text:d,title:l,fontSize:h}=r,{rotate:m}=this,[g,x]=Yi(this,i);return pt("svg:g",o).call(Xt,this,i,o).call(Ng,this,d,i).call(Dt,this,{x:u&&a,y:f&&c}).call(v=>v.selectAll().data(n).enter().append("text").call(Pt,this).call(t8,this,d,l).attr("transform",bl`translate(${u?w=>u[w]:g},${f?w=>f[w]:x})${s?w=>` rotate(${s[w]})`:m?` rotate(${m})`:""}`).call(X,"font-size",h&&(w=>h[w])).call(dn,this,r)).node()}};function Eg(t){return t==null?null:hn(t,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function t8(t,n,e,r){if(!e)return;let{lineAnchor:i,lineHeight:o,textOverflow:a,splitLines:c,clipLine:u}=n;t.each(function(f){let s=c(Cr(e[f])??"").map(u),d=s.length,l=i==="top"?.71:i==="bottom"?1-d:(164-d*100)/200;if(d>1){let h=0;for(let m=0;m<d;++m){if(++h,!s[m])continue;let g=this.ownerDocument.createElementNS(we.svg,"tspan");g.setAttribute("x",0),m===h-1?g.setAttribute("y",`${(l+m)*o}em`):g.setAttribute("dy",`${h*o}em`),g.textContent=s[m],this.appendChild(g),h=0}}else l&&this.setAttribute("y",`${l*o}em`),this.textContent=s[0];if(a&&!r&&s[0]!==e[f]){let h=this.ownerDocument.createElementNS(we.svg,"title");h.textContent=e[f],this.appendChild(h)}})}function on(t,{x:n,y:e,...r}={}){return r.frameAnchor===void 0&&([n,e]=We(n,e)),new Ei(t,{...r,x:n,y:e})}function n8(t,{x:n=ht,...e}={}){return new Ei(t,Q3({...e,x:n}))}function e8(t,{y:n=ht,...e}={}){return new Ei(t,K3({...e,y:n}))}function Ng(t,n,e){X(t,"text-anchor",n.textAnchor),X(t,"font-family",n.fontFamily),X(t,"font-size",n.fontSize),X(t,"font-style",n.fontStyle),X(t,"font-variant",n.fontVariant===void 0?r8(e):n.fontVariant),X(t,"font-weight",n.fontWeight)}function r8(t){return t&&(v6(t)||qt(t))?"tabular-nums":void 0}var i8=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function o8(t){return t==null||typeof t=="number"?[void 0,t]:typeof t!="string"?[t,void 0]:(t=t.trim().toLowerCase(),i8.has(t)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(t)?[void 0,t]:[t,void 0])}function a8(t,n,e){let r=[],i,o=0;for(let[a,c,u]of c8(t)){if(i===void 0&&(i=a),o>i&&e(t,i,c)>n&&(r.push(t.slice(i,o)+(t[o-1]===Cg?"-":"")),i=a),u){r.push(t.slice(i,c)),i=void 0;continue}o=c}return r}function*c8(t){let n=0,e=0,r=t.length;for(;e<r;){let i=1;switch(t[e]){case Cg:case"-":++e,yield[n,e,!1],n=e;break;case" ":for(yield[n,e,!1];t[++e]===" ";);n=e;break;case"\r":t[e+1]===`
|
|
15
|
+
}`)).call(wl,f),S=C=>C.selectAll(".tick line").attr("y1",a+u-o),m,x=p?(C,z)=>C.rangeRound(z):(C,z)=>C.range(z),{type:y,domain:M,range:_,interpolate:$,scale:A,pivot:k}=t;if($){let C=_===void 0?$:mr($.length===1?hl($):$,_);m=x(A.copy(),jt(kt(s,i-c),Math.min(M.length+(k!==void 0),_===void 0?1/0:_.length)));let z=256,L=v.document.createElement("canvas");L.width=z,L.height=1;let T=L.getContext("2d",{colorSpace:"display-p3"}),B=t.key==="opacity"?"globalAlpha":"fillStyle";for(let D=0,H=z-1;D<z;++D)T[B]=C(D/H),T.fillRect(D,0,1,1);w.append("image").attr("opacity",g).attr("x",s).attr("y",a).attr("width",i-s-c).attr("height",o-a-u).attr("preserveAspectRatio","none").attr("xlink:href",L.toDataURL())}else if(y==="threshold"){let C=M,z=l===void 0?L=>L:typeof l=="string"?ee(l):l;m=x(jo().domain([-1,_.length-1]),[s,i-c]),w.append("g").attr("fill",t.key==="opacity"?t.color:null).attr("fill-opacity",g).selectAll().data(_).enter().append("rect").attr("x",(L,T)=>m(T-1)).attr("y",a).attr("width",(L,T)=>m(T)-m(T-1)).attr("height",o-a-u).attr(t.key==="opacity"?"fill-opacity":"fill",L=>L),d=bt(C,(L,T)=>T),l=L=>z(C[L],L)}else m=x(wi().domain(M),[s,i-c]),w.append("g").attr("fill",t.key==="opacity"?t.color:null).attr("fill-opacity",g).selectAll().data(M).enter().append("rect").attr("x",m).attr("y",a).attr("width",Math.max(0,m.bandwidth()-1)).attr("height",o-a-u).attr(t.key==="opacity"?"fill-opacity":"fill",A),S=()=>{};return w.append("g").attr("transform",`translate(0,${o-u})`).call(gd(m).ticks(Array.isArray(d)?null:d,typeof l=="string"?l:void 0).tickFormat(typeof l=="function"?l:void 0).tickSize(r).tickValues(Array.isArray(d)?d:null).offset(Tt)).attr("font-size",null).attr("font-family",null).attr("font-variant",At(h,"normal")).call(S).call(C=>C.select(".domain").remove()),e!==void 0&&w.append("text").attr("x",s).attr("y",a-6).attr("fill","currentColor").attr("font-weight","bold").text(e),w.node()}var _g=Math.PI/180;function Vi(t,{marker:n,markerStart:e=n,markerMid:r=n,markerEnd:i=n}={}){t.markerStart=mf(e),t.markerMid=mf(r),t.markerEnd=mf(i)}function mf(t){if(t==null||t===!1)return null;if(t===!0)return Bp;if(typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"none":return null;case"arrow":return qp("auto");case"arrow-reverse":return qp("auto-start-reverse");case"dot":return u8;case"circle":case"circle-fill":return Bp;case"circle-stroke":return s8;case"tick":return pf("auto");case"tick-x":return pf(90);case"tick-y":return pf(0)}throw new Error(`invalid marker: ${t}`)}function qp(t){return(n,e)=>gt("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient",t).attr("fill","none").attr("stroke",n).attr("stroke-dasharray","none").attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call(r=>r.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function u8(t,n){return gt("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","none").call(e=>e.append("circle").attr("r",2.5)).node()}function Bp(t,n){return gt("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","var(--plot-background)").attr("stroke-dasharray","none").attr("stroke-width",1.5).call(e=>e.append("circle").attr("r",3)).node()}function s8(t,n){return gt("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","var(--plot-background)").attr("stroke",t).attr("stroke-dasharray","none").attr("stroke-width",1.5).call(e=>e.append("circle").attr("r",3)).node()}function pf(t){return(n,e)=>gt("svg:marker",e).attr("viewBox","-3 -3 6 6").attr("markerWidth",6).attr("markerHeight",6).attr("orient",t).attr("stroke",n).attr("stroke-dasharray","none").call(r=>r.append("path").attr("d","M0,-3v6")).node()}var f8=0;function _l(t,n,{stroke:e},r){return kg(t,n,e&&(i=>e[i]),null,r)}function $g(t,n,{stroke:e,z:r},i){return kg(t,n,e&&(([o])=>e[o]),r,i)}var Nf=1,Sg=2;function l8(t,n){let e=new Uint8Array(n.length),r=t.data().filter(o=>o.length>1),i=r.length;for(let o=0,a=Cf;o<i;++o){let c=r[o];if(c.length>1){let u=c[0];a!==(a=Kn(n[u]))&&(e[u]|=Nf)}}for(let o=i-1,a=Cf;o>=0;--o){let c=r[o];if(c.length>1){let u=c[0];a!==(a=Kn(n[u]))&&(e[u]|=Sg)}}return([o])=>e[o]}function kg(t,{markerStart:n,markerMid:e,markerEnd:r,stroke:i},o=()=>i,a,c){if(!n&&!e&&!r)return;let u=new Map,s=a&&l8(t,a);function f(d,l,h){return function(p){if(h&&!h(p))return;let g=o(p),b=u.get(l);b||u.set(l,b=new Map);let v=b.get(g);if(!v){let w=this.parentNode.insertBefore(l(g,c),this),S=`plot-marker-${++f8}`;w.setAttribute("id",S),b.set(g,v=`url(#${S})`)}this.setAttribute(d,v)}}n&&t.each(f("marker-start",n,s&&(d=>s(d)&Nf))),e&&s&&t.each(f("marker-start",e,d=>!(s(d)&Nf))),e&&t.each(f("marker-mid",e)),r&&t.each(f("marker-end",r,s&&(d=>s(d)&Sg)))}function ji({inset:t,insetLeft:n,insetRight:e,...r}={}){return[n,e]=Ag(t,n,e),{inset:t,insetLeft:n,insetRight:e,...r}}function Zi({inset:t,insetTop:n,insetBottom:e,...r}={}){return[n,e]=Ag(t,n,e),{inset:t,insetTop:n,insetBottom:e,...r}}function Ag(t,n,e){return t===void 0&&n===void 0&&e===void 0?Tt?[1,0]:[.5,.5]:[n,e]}function Tg(t,{interval:n}){return t={...Bi(t)},t.interval=tl(t.interval===void 0?n:t.interval),t}function Ha(t,n,e,r){let{[t]:i,[`${t}1`]:o,[`${t}2`]:a}=e,{value:c,interval:u}=Tg(i,e);if(c==null||u==null&&!r)return e;let s=Xe(i);if(u==null){let h,p={transform:g=>h||(h=lt(g,c)),label:s};return{...e,[t]:void 0,[`${t}1`]:o===void 0?p:o,[`${t}2`]:a===void 0&&!(o===a&&r)?p:a}}let f,d;function l(h){return d!==void 0&&h===f?d:d=bt(lt(f=h,c),p=>u.floor(p))}return n({...e,[t]:void 0,[`${t}1`]:o===void 0?{transform:l,label:s}:o,[`${t}2`]:a===void 0?{transform:h=>l(h).map(p=>u.offset(p)),label:s}:a})}function Cg(t,n,e){let{[t]:r}=e,{value:i,interval:o}=Tg(r,e);return i==null||o==null?e:n({...e,[t]:{label:Xe(r),transform:a=>{let c=bt(lt(a,i),s=>o.floor(s)),u=c.map(s=>o.offset(s));return c.map(Ht(c)?(s,f)=>s==null||isNaN(s=+s)||(f=u[f],f==null)||isNaN(f=+f)?void 0:new Date((s+f)/2):(s,f)=>s==null||(f=u[f],f==null)?NaN:(+s+ +f)/2)}}})}function Eg(t={}){return Ha("x",ji,t,!0)}function Ng(t={}){return Ha("y",Zi,t,!0)}function Lg(t={}){return Ha("x",ji,t)}function Pg(t={}){return Ha("y",Zi,t)}function d8(t={}){return Cg("x",ji,t)}function h8(t={}){return Cg("y",Zi,t)}var Rg={ariaLabel:"rule",fill:null,stroke:"currentColor"},Lf=class extends Pt{constructor(n,e={}){let{x:r,y1:i,y2:o,inset:a=0,insetTop:c=a,insetBottom:u=a}=e;super(n,{x:{value:r,scale:"x",optional:!0},y1:{value:i,scale:"y",optional:!0},y2:{value:o,scale:"y",optional:!0}},Fr(e,"x"),Rg),this.insetTop=Lt(c),this.insetBottom=Lt(u),Vi(this,e)}render(n,e,r,i,o){let{x:a,y:c}=e,{x:u,y1:s,y2:f}=r,{width:d,height:l,marginTop:h,marginRight:p,marginLeft:g,marginBottom:b}=i,{insetTop:v,insetBottom:w}=this;return gt("svg:g",o).call(Kt,this,i,o).call(zt,this,{x:u&&a},Tt,0).call(S=>S.selectAll().data(n).enter().append("line").call(It,this).attr("x1",u?m=>u[m]:(g+d-p)/2).attr("x2",u?m=>u[m]:(g+d-p)/2).attr("y1",s&&!Ln(c)?m=>s[m]+v:h+v).attr("y2",f&&!Ln(c)?c.bandwidth?m=>f[m]+c.bandwidth()-w:m=>f[m]-w:l-b-w).call(pn,this,r).call(_l,this,r,o)).node()}},Pf=class extends Pt{constructor(n,e={}){let{x1:r,x2:i,y:o,inset:a=0,insetRight:c=a,insetLeft:u=a}=e;super(n,{y:{value:o,scale:"y",optional:!0},x1:{value:r,scale:"x",optional:!0},x2:{value:i,scale:"x",optional:!0}},Fr(e,"y"),Rg),this.insetRight=Lt(c),this.insetLeft=Lt(u),Vi(this,e)}render(n,e,r,i,o){let{x:a,y:c}=e,{y:u,x1:s,x2:f}=r,{width:d,height:l,marginTop:h,marginRight:p,marginLeft:g,marginBottom:b}=i,{insetLeft:v,insetRight:w}=this;return gt("svg:g",o).call(Kt,this,i,o).call(zt,this,{y:u&&c},0,Tt).call(S=>S.selectAll().data(n).enter().append("line").call(It,this).attr("x1",s&&!Ln(a)?m=>s[m]+v:g+v).attr("x2",f&&!Ln(a)?a.bandwidth?m=>f[m]+a.bandwidth()-w:m=>f[m]-w:d-p-w).attr("y1",u?m=>u[m]:(h+l-b)/2).attr("y2",u?m=>u[m]:(h+l-b)/2).call(pn,this,r).call(_l,this,r,o)).node()}};function Ki(t,n){let{x:e=mt,y:r,y1:i,y2:o,...a}=Pg(n);return[i,o]=Dg(r,i,o),new Lf(t,{...a,x:e,y1:i,y2:o})}function je(t,n){let{y:e=mt,x:r,x1:i,x2:o,...a}=Lg(n);return[i,o]=Dg(r,i,o),new Pf(t,{...a,y:e,x1:i,x2:o})}function Dg(t,n,e){if(t==null){if(n===void 0){if(e!==void 0)return[0,e]}else if(e===void 0)return[0,n]}else{if(n===void 0)return e===void 0?[0,t]:[t,e];if(e===void 0)return[t,n]}return[n,e]}function $l(t,...n){let e=n.length;for(let r=0,i=!0;r<e;++r)typeof n[r]!="function"&&(i&&(t=t.slice(),i=!1),t.splice(r,2,t[r]+n[r]+t[r+1]),n.splice(r,1),--r,--e);return r=>{let i=t[0];for(let o=0;o<e;++o)i+=n[o](r)+t[o+1];return i}}var m8={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"},Og="\xAD",Di=class extends Pt{constructor(n,e={}){let{x:r,y:i,text:o=de(n)&&C1(n)?mt:He,frameAnchor:a,textAnchor:c=/right$/i.test(a)?"end":/left$/i.test(a)?"start":"middle",lineAnchor:u=/^top/i.test(a)?"top":/^bottom/i.test(a)?"bottom":"middle",lineHeight:s=1,lineWidth:f=1/0,textOverflow:d,monospace:l,fontFamily:h=l?"ui-monospace, monospace":void 0,fontSize:p,fontStyle:g,fontVariant:b,fontWeight:v,rotate:w}=e,[S,m]=Ot(w,0),[x,y]=w8(p);if(super(n,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},fontSize:{value:x,optional:!0},rotate:{value:P6(S),optional:!0},text:{value:o,filter:Hf,optional:!0}},e,m8),this.rotate=m,this.textAnchor=At(c,"middle"),this.lineAnchor=gn(u,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+s,this.lineWidth=+f,this.textOverflow=Ig(d),this.monospace=!!l,this.fontFamily=Nt(h),this.fontSize=y,this.fontStyle=Nt(g),this.fontVariant=Nt(b),this.fontWeight=Nt(v),this.frameAnchor=za(a),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${f}`);this.splitLines=Fg(this),this.clipLine=qg(this)}render(n,e,r,i,o){let{x:a,y:c}=e,{x:u,y:s,rotate:f,text:d,title:l,fontSize:h}=r,{rotate:p}=this,[g,b]=Xi(this,i);return gt("svg:g",o).call(Kt,this,i,o).call(zg,this,d,i).call(zt,this,{x:u&&a,y:s&&c}).call(v=>v.selectAll().data(n).enter().append("text").call(It,this).call(p8,this,d,l).attr("transform",$l`translate(${u?w=>u[w]:g},${s?w=>s[w]:b})${f?w=>` rotate(${f[w]})`:p?` rotate(${p})`:""}`).call(j,"font-size",h&&(w=>h[w])).call(pn,this,r)).node()}};function Ig(t){return t==null?null:gn(t,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function p8(t,n,e,r){if(!e)return;let{lineAnchor:i,lineHeight:o,textOverflow:a,splitLines:c,clipLine:u}=n;t.each(function(s){let f=c(Rr(e[s])??"").map(u),d=f.length,l=i==="top"?.71:i==="bottom"?1-d:(164-d*100)/200;if(d>1){let h=0;for(let p=0;p<d;++p){if(++h,!f[p])continue;let g=this.ownerDocument.createElementNS(Me.svg,"tspan");g.setAttribute("x",0),p===h-1?g.setAttribute("y",`${(l+p)*o}em`):g.setAttribute("dy",`${h*o}em`),g.textContent=f[p],this.appendChild(g),h=0}}else l&&this.setAttribute("y",`${l*o}em`),this.textContent=f[0];if(a&&!r&&f[0]!==e[s]){let h=this.ownerDocument.createElementNS(Me.svg,"title");h.textContent=e[s],this.appendChild(h)}})}function pt(t,{x:n,y:e,...r}={}){return r.frameAnchor===void 0&&([n,e]=Ge(n,e)),new Di(t,{...r,x:n,y:e})}function g8(t,{x:n=mt,...e}={}){return new Di(t,h8({...e,x:n}))}function y8(t,{y:n=mt,...e}={}){return new Di(t,d8({...e,y:n}))}function zg(t,n,e){j(t,"text-anchor",n.textAnchor),j(t,"font-family",n.fontFamily),j(t,"font-size",n.fontSize),j(t,"font-style",n.fontStyle),j(t,"font-variant",n.fontVariant===void 0?b8(e):n.fontVariant),j(t,"font-weight",n.fontWeight)}function b8(t){return t&&(O6(t)||Ht(t))?"tabular-nums":void 0}var x8=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function w8(t){return t==null||typeof t=="number"?[void 0,t]:typeof t!="string"?[t,void 0]:(t=t.trim().toLowerCase(),x8.has(t)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(t)?[void 0,t]:[t,void 0])}function v8(t,n,e){let r=[],i,o=0;for(let[a,c,u]of M8(t)){if(i===void 0&&(i=a),o>i&&e(t,i,c)>n&&(r.push(t.slice(i,o)+(t[o-1]===Og?"-":"")),i=a),u){r.push(t.slice(i,c)),i=void 0;continue}o=c}return r}function*M8(t){let n=0,e=0,r=t.length;for(;e<r;){let i=1;switch(t[e]){case Og:case"-":++e,yield[n,e,!1],n=e;break;case" ":for(yield[n,e,!1];t[++e]===" ";);n=e;break;case"\r":t[e+1]===`
|
|
16
16
|
`&&++i;case`
|
|
17
|
-
`:yield[n,e,!0],e+=i,n=e;break;default:++e;break}}yield[n,e,!0]}var P1={a:56,b:63,c:57,d:63,e:58,f:37,g:62,h:60,i:26,j:26,k:55,l:26,m:88,n:60,o:60,p:62,q:62,r:39,s:54,t:38,u:60,v:55,w:79,x:54,y:55,z:55,A:69,B:67,C:73,D:74,E:61,F:58,G:76,H:75,I:28,J:55,K:67,L:58,M:89,N:75,O:78,P:65,Q:78,R:67,S:65,T:65,U:75,V:69,W:98,X:69,Y:67,Z:67,0:64,1:48,2:62,3:64,4:66,5:63,6:65,7:58,8:65,9:65," ":29,"!":32,'"':49,"'":31,"(":39,")":39,",":31,"-":48,".":31,"/":32,":":31,";":31,"?":52,"\u2018":31,"\u2019":31,"\u201C":47,"\u201D":47,"\u2026":82};function wl(t,n=0,e=t.length){let r=0;for(let i=n;i<e;i=Dr(t,i))r+=P1[t[i]]??(Dg(t,i)?120:P1.e);return r}function xl(t,n=0,e=t.length){let r=0;for(let i=n;i<e;i=Dr(t,i))r+=Dg(t,i)?126:63;return r}function Rg({monospace:t,lineWidth:n,textOverflow:e}){if(e!=null||n==1/0)return o=>o.split(/\r\n?|\n/g);let r=t?xl:wl,i=n*100;return o=>a8(o,i,r)}function Lg({monospace:t,lineWidth:n,textOverflow:e}){if(e==null||n==1/0)return o=>o;let r=t?xl:wl,i=n*100;switch(e){case"clip-start":return o=>I1(o,i,r,"");case"clip-end":return o=>D1(o,i,r,"");case"ellipsis-start":return o=>I1(o,i,r,$r);case"ellipsis-middle":return o=>u8(o,i,r,$r);case"ellipsis-end":return o=>D1(o,i,r,$r)}}var $r="\u2026";function Er(t,n,e,r){let i=[],o=0;for(let a=0,c=0,u=t.length;a<u;a=c){c=Dr(t,a);let f=e(t,a,c);if(o+f>n){for(o+=r;o>n&&a>0;)c=a,a=i.pop(),o-=e(t,a,c);return[a,n-o]}o+=f,i.push(a)}return[-1,0]}function D1(t,n,e,r){t=t.trim();let i=e(r),[o]=Er(t,n,e,i);return o<0?t:t.slice(0,o).trimEnd()+r}function u8(t,n,e,r){t=t.trim();let i=e(t);if(i<=n)return t;let o=e(r)/2,[a,c]=Er(t,n/2,e,o),[u]=Er(t,i-n/2-c+o,e,-o);return u<0?r:t.slice(0,a).trimEnd()+r+t.slice(Dr(t,u)).trimStart()}function I1(t,n,e,r){t=t.trim();let i=e(t);if(i<=n)return t;let o=e(r),[a]=Er(t,i-n+o,e,-o);return a<0?r:r+t.slice(Dr(t,a)).trimStart()}var Cs=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,O1=/\p{Extended_Pictographic}/uy;function Dr(t,n){return n+=f8(t,n)?2:1,l8(t,n)&&(n=Cs.lastIndex),s8(t,n)?Dr(t,n+1):n}function Pg(t,n){return t.charCodeAt(n)<128}function f8(t,n){let e=t.charCodeAt(n);if(e>=55296&&e<56320){let r=t.charCodeAt(n+1);return r>=56320&&r<57344}return!1}function s8(t,n){return t.charCodeAt(n)===8205}function l8(t,n){return Pg(t,n)?!1:(Cs.lastIndex=n,Cs.test(t))}function Dg(t,n){return Pg(t,n)?!1:(O1.lastIndex=n,O1.test(t))}var d8={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},Ig=3.5,h8=Ig*5,Og={draw(t,n,e){let r=n*e/h8;t.moveTo(0,0),t.lineTo(0,-n),t.moveTo(-r,r-n),t.lineTo(0,-n),t.lineTo(r,r-n)}},p8={draw(t,n,e){t.moveTo(-e,0),t.lineTo(0,-n),t.lineTo(e,0)}},m8=new Map([["arrow",Og],["spike",p8]]);function g8(t){return t&&typeof t.draw=="function"}function y8(t){if(g8(t))return t;let n=m8.get(`${t}`.toLowerCase());if(n)return n;throw new Error(`invalid shape: ${t}`)}var Sa=class extends Et{constructor(n,e={}){let{x:r,y:i,r:o=Ig,length:a,rotate:c,shape:u=Og,anchor:f="middle",frameAnchor:s}=e,[d,l]=Lt(a,12),[h,m]=Lt(c,0);super(n,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},length:{value:d,scale:"length",optional:!0},rotate:{value:h,optional:!0}},e,d8),this.r=+o,this.length=l,this.rotate=m,this.shape=y8(u),this.anchor=hn(f,"anchor",["start","middle","end"]),this.frameAnchor=Pa(s)}render(n,e,r,i,o){let{x:a,y:c}=e,{x:u,y:f,length:s,rotate:d}=r,{length:l,rotate:h,anchor:m,shape:g,r:x}=this,[v,w]=Yi(this,i);return pt("svg:g",o).call(Xt,this,i,o).call(Dt,this,{x:u&&a,y:f&&c}).call($=>$.selectAll().data(n).enter().append("path").call(Pt,this).attr("transform",bl`translate(${u?p=>u[p]:v},${f?p=>f[p]:w})${d?p=>` rotate(${d[p]})`:h?` rotate(${h})`:""}${m==="start"?"":m==="end"?s?p=>` translate(0,${s[p]})`:` translate(0,${l})`:s?p=>` translate(0,${s[p]/2})`:` translate(0,${l/2})`}`).attr("d",s?p=>{let b=Pn();return g.draw(b,s[p],x),b}:(()=>{let p=Pn();return g.draw(p,l,x),p})()).call(dn,this,r)).node()}};function b8(t,n={}){let{x:e=ht,...r}=n;return new Sa(t,{...r,x:e})}function w8(t,n={}){let{y:e=ht,...r}=n;return new Sa(t,{...r,y:e})}function he(t,n){return arguments.length<2&&!le(t)&&(n=t,t=null),n===void 0&&(n={}),[t,n]}function Ya({anchor:t}={},n){return t===void 0?n[0]:hn(t,"anchor",n)}function zg(t){return Ya(t,["left","right"])}function Fg(t){return Ya(t,["right","left"])}function Bg(t){return Ya(t,["bottom","top"])}function qg(t){return Ya(t,["top","bottom"])}function Yg(){let[t,n]=he(...arguments);return Ug("y",zg(n),t,n)}function x8(){let[t,n]=he(...arguments);return Ug("fy",Fg(n),t,n)}function Wg(){let[t,n]=he(...arguments);return Gg("x",Bg(n),t,n)}function v8(){let[t,n]=he(...arguments);return Gg("fx",qg(n),t,n)}function Ug(t,n,e,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:a=i,strokeWidth:c=1,fill:u=r,fillOpacity:f=i,textAnchor:s,textStroke:d,textStrokeOpacity:l,textStrokeWidth:h,tickSize:m=t==="y"?6:0,tickPadding:g,tickRotate:x,x:v,margin:w,marginTop:$=w===void 0?20:w,marginRight:p=w===void 0?n==="right"?40:0:w,marginBottom:b=w===void 0?20:w,marginLeft:y=w===void 0?n==="left"?40:0:w,label:_,labelAnchor:M,labelArrow:S,labelOffset:C,ariaLabel:k=`${t}-axis`,...T}){return m=Ct(m),g=Ct(g),x=Ct(x),M!==void 0&&(M=hn(M,"labelAnchor",["center","top","bottom"])),S=Jg(S),sg(m&&!Bt(o)?_8(t,n,e,{stroke:o,strokeOpacity:a,strokeWidth:c,tickSize:m,tickPadding:g,tickRotate:x,x:v,ariaLabel:k,...T}):null,Bt(u)?null:$8(t,n,e,{fill:u,fillOpacity:f,stroke:d,strokeOpacity:l,strokeWidth:h,textAnchor:s,tickSize:m,tickPadding:g,tickRotate:x,x:v,marginTop:$,marginRight:p,marginBottom:b,marginLeft:y,ariaLabel:k,...T}),!Bt(u)&&_!==null?on([],jg({fill:u,fillOpacity:f,...T},function(D,P,A,O,R){let W=O[t],{marginTop:L,marginRight:I,marginBottom:q,marginLeft:U}=t==="y"&&R.inset||R,F=M??(W.bandwidth?"center":"top"),K=C??(n==="right"?I:U)-3;return F==="center"?(this.textAnchor=void 0,this.lineAnchor=n==="right"?"bottom":"top",this.frameAnchor=n,this.rotate=-90):(this.textAnchor=n==="right"?"end":"start",this.lineAnchor=F,this.frameAnchor=`${F}-${n}`,this.rotate=0),this.dy=F==="top"?3-L:F==="bottom"?q-3:0,this.dx=n==="right"?K:-K,this.ariaLabel=`${k} label`,{facets:[[0]],channels:{text:{value:[Qg(t,W,{anchor:n,label:_,labelAnchor:F,labelArrow:S})]}}}})):null)}function Gg(t,n,e,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:a=i,strokeWidth:c=1,fill:u=r,fillOpacity:f=i,textAnchor:s,textStroke:d,textStrokeOpacity:l,textStrokeWidth:h,tickSize:m=t==="x"?6:0,tickPadding:g,tickRotate:x,y:v,margin:w,marginTop:$=w===void 0?n==="top"?30:0:w,marginRight:p=w===void 0?20:w,marginBottom:b=w===void 0?n==="bottom"?30:0:w,marginLeft:y=w===void 0?20:w,label:_,labelAnchor:M,labelArrow:S,labelOffset:C,ariaLabel:k=`${t}-axis`,...T}){return m=Ct(m),g=Ct(g),x=Ct(x),M!==void 0&&(M=hn(M,"labelAnchor",["center","left","right"])),S=Jg(S),sg(m&&!Bt(o)?M8(t,n,e,{stroke:o,strokeOpacity:a,strokeWidth:c,tickSize:m,tickPadding:g,tickRotate:x,y:v,ariaLabel:k,...T}):null,Bt(u)?null:S8(t,n,e,{fill:u,fillOpacity:f,stroke:d,strokeOpacity:l,strokeWidth:h,textAnchor:s,tickSize:m,tickPadding:g,tickRotate:x,y:v,marginTop:$,marginRight:p,marginBottom:b,marginLeft:y,ariaLabel:k,...T}),!Bt(u)&&_!==null?on([],jg({fill:u,fillOpacity:f,...T},function(D,P,A,O,R){let W=O[t],{marginTop:L,marginRight:I,marginBottom:q,marginLeft:U}=t==="x"&&R.inset||R,F=M??(W.bandwidth?"center":"right"),K=C??(n==="top"?L:q)-3;return F==="center"?(this.frameAnchor=n,this.textAnchor=void 0):(this.frameAnchor=`${n}-${F}`,this.textAnchor=F==="right"?"end":"start"),this.lineAnchor=n,this.dy=n==="top"?-K:K,this.dx=F==="right"?I-3:F==="left"?3-U:0,this.ariaLabel=`${k} label`,{facets:[[0]],channels:{text:{value:[Qg(t,W,{anchor:n,label:_,labelAnchor:F,labelArrow:S})]}}}})):null)}function _8(t,n,e,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:a=n+(t==="y"?"-empty":""),frameAnchor:c=n,tickSize:u,inset:f=0,insetLeft:s=f,insetRight:d=f,dx:l=0,y:h=t==="y"?void 0:null,ariaLabel:m,...g}){return Ir(w8,t,e,{ariaLabel:`${m} tick`,ariaHidden:!0},{strokeWidth:r,strokeLinecap:i,strokeLinejoin:o,facetAnchor:a,frameAnchor:c,y:h,...g,dx:n==="left"?+l-kt+ +s:+l+kt-d,anchor:"start",length:u,shape:n==="left"?L8:P8})}function M8(t,n,e,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:a=n+(t==="x"?"-empty":""),frameAnchor:c=n,tickSize:u,inset:f=0,insetTop:s=f,insetBottom:d=f,dy:l=0,x:h=t==="x"?void 0:null,ariaLabel:m,...g}){return Ir(b8,t,e,{ariaLabel:`${m} tick`,ariaHidden:!0},{strokeWidth:r,strokeLinejoin:o,strokeLinecap:i,facetAnchor:a,frameAnchor:c,x:h,...g,dy:n==="bottom"?+l-kt-d:+l+kt+ +s,anchor:"start",length:u,shape:n==="bottom"?N8:R8})}function $8(t,n,e,{facetAnchor:r=n+(t==="y"?"-empty":""),frameAnchor:i=n,tickSize:o,tickRotate:a=0,tickPadding:c=Math.max(3,9-o)+(Math.abs(a)>60?4*Math.cos(a*gg):0),text:u,textAnchor:f=Math.abs(a)>60?"middle":n==="left"?"end":"start",lineAnchor:s=a>60?"top":a<-60?"bottom":"middle",fontVariant:d,inset:l=0,insetLeft:h=l,insetRight:m=l,dx:g=0,ariaLabel:x,y:v=t==="y"?void 0:null,...w}){return Ir(e8,t,e,{ariaLabel:`${x} tick label`},{facetAnchor:r,frameAnchor:i,text:u,textAnchor:f,lineAnchor:s,fontVariant:d,rotate:a,y:v,...w,dx:n==="left"?+g-o-c+ +h:+g+ +o+ +c-m},function($,p,b,y,_){d===void 0&&(this.fontVariant=Kg($)),u===void 0&&(_.text=Zg($,p,b,y,n))})}function S8(t,n,e,{facetAnchor:r=n+(t==="x"?"-empty":""),frameAnchor:i=n,tickSize:o,tickRotate:a=0,tickPadding:c=Math.max(3,9-o)+(Math.abs(a)>=10?4*Math.cos(a*gg):0),text:u,textAnchor:f=Math.abs(a)>=10?a<0^n==="bottom"?"start":"end":"middle",lineAnchor:s=Math.abs(a)>=10?"middle":n==="bottom"?"top":"bottom",fontVariant:d,inset:l=0,insetTop:h=l,insetBottom:m=l,dy:g=0,x=t==="x"?void 0:null,ariaLabel:v,...w}){return Ir(n8,t,e,{ariaLabel:`${v} tick label`},{facetAnchor:r,frameAnchor:i,text:u===void 0?null:u,textAnchor:f,lineAnchor:s,fontVariant:d,rotate:a,x,...w,dy:n==="bottom"?+g+ +o+ +c-m:+g-o-c+ +h},function($,p,b,y,_){d===void 0&&(this.fontVariant=Kg($)),u===void 0&&(_.text=Zg($,p,b,y,n))})}function k8(){let[t,n]=he(...arguments);return Hg("y",zg(n),t,n)}function A8(){let[t,n]=he(...arguments);return Hg("fy",Fg(n),t,n)}function T8(){let[t,n]=he(...arguments);return Xg("x",Bg(n),t,n)}function C8(){let[t,n]=he(...arguments);return Xg("fx",qg(n),t,n)}function Hg(t,n,e,{y:r=t==="y"?void 0:null,x:i=null,x1:o=n==="left"?i:null,x2:a=n==="right"?i:null,ariaLabel:c=`${t}-grid`,ariaHidden:u=!0,...f}){return Ir(Hi,t,e,{ariaLabel:c,ariaHidden:u},{y:r,x1:o,x2:a,...Vg(f)})}function Xg(t,n,e,{x:r=t==="x"?void 0:null,y:i=null,y1:o=n==="top"?i:null,y2:a=n==="bottom"?i:null,ariaLabel:c=`${t}-grid`,ariaHidden:u=!0,...f}){return Ir(qa,t,e,{ariaLabel:c,ariaHidden:u},{x:r,y1:o,y2:a,...Vg(f)})}function Vg({color:t="currentColor",opacity:n=.1,stroke:e=t,strokeOpacity:r=n,strokeWidth:i=1,...o}){return{stroke:e,strokeOpacity:r,strokeWidth:i,...o}}function jg({fill:t,fillOpacity:n,fontFamily:e,fontSize:r,fontStyle:i,fontVariant:o,fontWeight:a,monospace:c,pointerEvents:u,shapeRendering:f,clip:s=!1},d){return[,t]=ln(t),[,n]=Lt(n),{facet:"super",x:null,y:null,fill:t,fillOpacity:n,fontFamily:e,fontSize:r,fontStyle:i,fontVariant:o,fontWeight:a,monospace:c,pointerEvents:u,shapeRendering:f,clip:s,initializer:d}}function Ir(t,n,e,r,i,o){let a;function c(s,d,l,h,m,g){let x=s==null&&(n==="fx"||n==="fy"),{[n]:v}=h;if(!v)throw new Error(`missing scale: ${n}`);let w=v.domain(),{interval:$,ticks:p,tickFormat:b,tickSpacing:y=n==="x"?80:35}=i;if(typeof p=="string"&&ty(v)&&($=p,p=void 0),p===void 0&&(p=Rr($,v.type)??E8(v,y)),s==null){if(le(p))s=Ye(p);else if(_r(p))s=ls(p,...Wt(w));else if(v.interval){let M=v.interval;if(v.ticks){let[S,C]=Wt(w),k=(C-S)/M[Di];M=o1(M,k/p)??M,s=ls(M,S,C)}else{s=w;let S=s.length;M=o1(M,S/p)??M,M!==v.interval&&(s=ls(M,...Wt(s)))}if(M===v.interval){let S=Math.round(s.length/p);S>1&&(s=s.filter((C,k)=>k%S===0))}}else v.ticks?s=v.ticks(p):s=w;if(!v.ticks&&s.length&&s!==w){let M=new ge(w);s=s.filter(S=>M.has(S)),s.length||fe(`Warning: the ${n}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}n==="y"||n==="x"?d=[jn(s)]:a[n]={scale:n,value:ht}}o?.call(this,v,s,p,b,a);let _=Object.fromEntries(Object.entries(a).map(([M,S])=>[M,{...S,value:st(s,S.value)}]));return x&&(d=g.filterFacets(s,_)),{data:s,facets:d,channels:_}}let u=Tr(i).initializer,f=t(e,Tr({...i,initializer:c},u));return e==null?(a=f.channels,f.channels={}):a={},r!==void 0&&Object.assign(f,r),f.clip===void 0&&(f.clip=!1),f}function E8(t,n){let[e,r]=Wt(t.range());return(r-e)/n}function Zg(t,n,e,r,i){return{value:vl(t,n,e,r,i)}}function vl(t,n,e,r,i){return typeof r=="function"&&!(t.type==="log"&&t.tickFormat)?r:r===void 0&&n&&qt(n)?o6(t.type,n,i)??Cr:r===void 0&&n&&_m(n)?String:t.tickFormat?t.tickFormat(typeof e=="number"?e:null,r):typeof r=="string"&&t.domain().length>0?(qt(t.domain())?ie:ne)(r):r===void 0?Cr:Xn(r)}function ls(t,n,e){return t.range(n,t.offset(t.floor(e)))}var N8={draw(t,n){t.moveTo(0,0),t.lineTo(0,n)}},R8={draw(t,n){t.moveTo(0,0),t.lineTo(0,-n)}},L8={draw(t,n){t.moveTo(0,0),t.lineTo(-n,0)}},P8={draw(t,n){t.moveTo(0,0),t.lineTo(n,0)}};function Kg(t){return t.bandwidth&&!t.interval?void 0:"tabular-nums"}function Qg(t,n,{anchor:e,label:r=n.label,labelAnchor:i,labelArrow:o}={}){if(!(r==null||r.inferred&&ty(n)&&/^(date|time|year)$/i.test(r))){if(r=String(r),o==="auto"&&(o=(!n.bandwidth||n.interval)&&!/[↑↓→←]/.test(r)),!o)return r;if(o===!0){let a=J5(n);a&&(o=/x$/.test(t)||i==="center"?/x$/.test(t)===a<0?"left":"right":a<0?"up":"down")}switch(o){case"left":return`\u2190 ${r}`;case"right":return`${r} \u2192`;case"up":return e==="right"?`${r} \u2191`:`\u2191 ${r}`;case"down":return e==="right"?`${r} \u2193`:`\u2193 ${r}`}return r}}function Jg(t="auto"){return Bt(t)?!1:typeof t=="boolean"?t:hn(t,"labelArrow",["auto","up","right","down","left"])}function ty(t){return qt(t.domain())}function z1(t,n){if(n==null)return n;let e=t(n);if(!e)throw new Error(`scale not found: ${n}`);return e}function ny(t,{opacity:n,...e}={}){if(!Ge(t)&&!og(t))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${t.type})`);return ry(t,e,(r,i,o,a)=>r.append("svg").attr("width",o).attr("height",a).attr("fill",t.key==="opacity"?t.color:null).attr("fill-opacity",Lt(n)[1]).attr(t.key==="opacity"?"fill-opacity":"fill",i.scale).append("rect").attr("width","100%").attr("height","100%"))}var ey=new WeakSet;function D8(t,{fill:n=t.hint?.fill!==void 0?t.hint.fill:"none",fillOpacity:e=1,stroke:r=t.hint?.stroke!==void 0?t.hint.stroke:Bt(n)?"currentColor":"none",strokeOpacity:i=1,strokeWidth:o=1.5,r:a=4.5,...c}={},u){let[f,s]=ln(n),[d,l]=ln(r),h=z1(u,f),m=z1(u,d),g=a*a*Math.PI;e=Lt(e)[1],i=Lt(i)[1],o=Lt(o)[1];let x=ry(t,c,(v,w,$,p)=>v.append("svg").attr("viewBox","-8 -8 16 16").attr("width",$).attr("height",p).attr("fill",f==="color"?b=>h.scale(b):s).attr("fill-opacity",e).attr("stroke",d==="color"?b=>m.scale(b):l).attr("stroke-opacity",i).attr("stroke-width",o).append("path").attr("d",b=>{let y=Pn();return t.scale(b).draw(y,g),y}));return(f==="color"||d==="color")&&ey.add(x),x}function I8(t){return ey.has(t)}function ry(t,n={},e){let{columns:r,tickFormat:i,fontVariant:o=pg(t),swatchSize:a=15,swatchWidth:c=a,swatchHeight:u=a,marginLeft:f=0,className:s,style:d,width:l}=n,h=ol(n);s=hl(s),i=vl(t.scale,t.domain,void 0,i);let m=pt("div",h).attr("class",`${s}-swatches ${s}-swatches-${r!=null?"columns":"wrap"}`),g;return r!=null?(g=`:where(.${s}-swatches-columns .${s}-swatch) {
|
|
17
|
+
`:yield[n,e,!0],e+=i,n=e;break;default:++e;break}}yield[n,e,!0]}var Yp={a:56,b:63,c:57,d:63,e:58,f:37,g:62,h:60,i:26,j:26,k:55,l:26,m:88,n:60,o:60,p:62,q:62,r:39,s:54,t:38,u:60,v:55,w:79,x:54,y:55,z:55,A:69,B:67,C:73,D:74,E:61,F:58,G:76,H:75,I:28,J:55,K:67,L:58,M:89,N:75,O:78,P:65,Q:78,R:67,S:65,T:65,U:75,V:69,W:98,X:69,Y:67,Z:67,0:64,1:48,2:62,3:64,4:66,5:63,6:65,7:58,8:65,9:65," ":29,"!":32,'"':49,"'":31,"(":39,")":39,",":31,"-":48,".":31,"/":32,":":31,";":31,"?":52,"\u2018":31,"\u2019":31,"\u201C":47,"\u201D":47,"\u2026":82};function Sl(t,n=0,e=t.length){let r=0;for(let i=n;i<e;i=qr(t,i))r+=Yp[t[i]]??(Yg(t,i)?120:Yp.e);return r}function kl(t,n=0,e=t.length){let r=0;for(let i=n;i<e;i=qr(t,i))r+=Yg(t,i)?126:63;return r}function Fg({monospace:t,lineWidth:n,textOverflow:e}){if(e!=null||n==1/0)return o=>o.split(/\r\n?|\n/g);let r=t?kl:Sl,i=n*100;return o=>v8(o,i,r)}function qg({monospace:t,lineWidth:n,textOverflow:e}){if(e==null||n==1/0)return o=>o;let r=t?kl:Sl,i=n*100;switch(e){case"clip-start":return o=>Hp(o,i,r,"");case"clip-end":return o=>Wp(o,i,r,"");case"ellipsis-start":return o=>Hp(o,i,r,Cr);case"ellipsis-middle":return o=>_8(o,i,r,Cr);case"ellipsis-end":return o=>Wp(o,i,r,Cr)}}var Cr="\u2026";function Dr(t,n,e,r){let i=[],o=0;for(let a=0,c=0,u=t.length;a<u;a=c){c=qr(t,a);let s=e(t,a,c);if(o+s>n){for(o+=r;o>n&&a>0;)c=a,a=i.pop(),o-=e(t,a,c);return[a,n-o]}o+=s,i.push(a)}return[-1,0]}function Wp(t,n,e,r){t=t.trim();let i=e(r),[o]=Dr(t,n,e,i);return o<0?t:t.slice(0,o).trimEnd()+r}function _8(t,n,e,r){t=t.trim();let i=e(t);if(i<=n)return t;let o=e(r)/2,[a,c]=Dr(t,n/2,e,o),[u]=Dr(t,i-n/2-c+o,e,-o);return u<0?r:t.slice(0,a).trimEnd()+r+t.slice(qr(t,u)).trimStart()}function Hp(t,n,e,r){t=t.trim();let i=e(t);if(i<=n)return t;let o=e(r),[a]=Dr(t,i-n+o,e,-o);return a<0?r:r+t.slice(qr(t,a)).trimStart()}var Rf=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,Up=/\p{Extended_Pictographic}/uy;function qr(t,n){return n+=$8(t,n)?2:1,k8(t,n)&&(n=Rf.lastIndex),S8(t,n)?qr(t,n+1):n}function Bg(t,n){return t.charCodeAt(n)<128}function $8(t,n){let e=t.charCodeAt(n);if(e>=55296&&e<56320){let r=t.charCodeAt(n+1);return r>=56320&&r<57344}return!1}function S8(t,n){return t.charCodeAt(n)===8205}function k8(t,n){return Bg(t,n)?!1:(Rf.lastIndex=n,Rf.test(t))}function Yg(t,n){return Bg(t,n)?!1:(Up.lastIndex=n,Up.test(t))}var A8={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},Wg=3.5,T8=Wg*5,Hg={draw(t,n,e){let r=n*e/T8;t.moveTo(0,0),t.lineTo(0,-n),t.moveTo(-r,r-n),t.lineTo(0,-n),t.lineTo(r,r-n)}},C8={draw(t,n,e){t.moveTo(-e,0),t.lineTo(0,-n),t.lineTo(e,0)}},E8=new Map([["arrow",Hg],["spike",C8]]);function N8(t){return t&&typeof t.draw=="function"}function L8(t){if(N8(t))return t;let n=E8.get(`${t}`.toLowerCase());if(n)return n;throw new Error(`invalid shape: ${t}`)}var Ca=class extends Pt{constructor(n,e={}){let{x:r,y:i,r:o=Wg,length:a,rotate:c,shape:u=Hg,anchor:s="middle",frameAnchor:f}=e,[d,l]=Ot(a,12),[h,p]=Ot(c,0);super(n,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},length:{value:d,scale:"length",optional:!0},rotate:{value:h,optional:!0}},e,A8),this.r=+o,this.length=l,this.rotate=p,this.shape=L8(u),this.anchor=gn(s,"anchor",["start","middle","end"]),this.frameAnchor=za(f)}render(n,e,r,i,o){let{x:a,y:c}=e,{x:u,y:s,length:f,rotate:d}=r,{length:l,rotate:h,anchor:p,shape:g,r:b}=this,[v,w]=Xi(this,i);return gt("svg:g",o).call(Kt,this,i,o).call(zt,this,{x:u&&a,y:s&&c}).call(S=>S.selectAll().data(n).enter().append("path").call(It,this).attr("transform",$l`translate(${u?m=>u[m]:v},${s?m=>s[m]:w})${d?m=>` rotate(${d[m]})`:h?` rotate(${h})`:""}${p==="start"?"":p==="end"?f?m=>` translate(0,${f[m]})`:` translate(0,${l})`:f?m=>` translate(0,${f[m]/2})`:` translate(0,${l/2})`}`).attr("d",f?m=>{let x=In();return g.draw(x,f[m],b),x}:(()=>{let m=In();return g.draw(m,l,b),m})()).call(pn,this,r)).node()}};function P8(t,n={}){let{x:e=mt,...r}=n;return new Ca(t,{...r,x:e})}function R8(t,n={}){let{y:e=mt,...r}=n;return new Ca(t,{...r,y:e})}function me(t,n){return arguments.length<2&&!de(t)&&(n=t,t=null),n===void 0&&(n={}),[t,n]}function Ua({anchor:t}={},n){return t===void 0?n[0]:gn(t,"anchor",n)}function Ug(t){return Ua(t,["left","right"])}function Gg(t){return Ua(t,["right","left"])}function Xg(t){return Ua(t,["bottom","top"])}function Vg(t){return Ua(t,["top","bottom"])}function jg(){let[t,n]=me(...arguments);return Kg("y",Ug(n),t,n)}function D8(){let[t,n]=me(...arguments);return Kg("fy",Gg(n),t,n)}function Zg(){let[t,n]=me(...arguments);return Qg("x",Xg(n),t,n)}function O8(){let[t,n]=me(...arguments);return Qg("fx",Vg(n),t,n)}function Kg(t,n,e,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:a=i,strokeWidth:c=1,fill:u=r,fillOpacity:s=i,textAnchor:f,textStroke:d,textStrokeOpacity:l,textStrokeWidth:h,tickSize:p=t==="y"?6:0,tickPadding:g,tickRotate:b,x:v,margin:w,marginTop:S=w===void 0?20:w,marginRight:m=w===void 0?n==="right"?40:0:w,marginBottom:x=w===void 0?20:w,marginLeft:y=w===void 0?n==="left"?40:0:w,label:M,labelAnchor:_,labelArrow:$,labelOffset:A,ariaLabel:k=`${t}-axis`,...C}){return p=Lt(p),g=Lt(g),b=Lt(b),_!==void 0&&(_=gn(_,"labelAnchor",["center","top","bottom"])),$=ay($),yg(p&&!Wt(o)?I8(t,n,e,{stroke:o,strokeOpacity:a,strokeWidth:c,tickSize:p,tickPadding:g,tickRotate:b,x:v,ariaLabel:k,...C}):null,Wt(u)?null:F8(t,n,e,{fill:u,fillOpacity:s,stroke:d,strokeOpacity:l,strokeWidth:h,textAnchor:f,tickSize:p,tickPadding:g,tickRotate:b,x:v,marginTop:S,marginRight:m,marginBottom:x,marginLeft:y,ariaLabel:k,...C}),!Wt(u)&&M!==null?pt([],ey({fill:u,fillOpacity:s,...C},function(z,L,T,B,D){let H=B[t],{marginTop:O,marginRight:Y,marginBottom:E,marginLeft:R}=t==="y"&&D.inset||D,F=_??(H.bandwidth?"center":"top"),G=A??(n==="right"?Y:R)-3;return F==="center"?(this.textAnchor=void 0,this.lineAnchor=n==="right"?"bottom":"top",this.frameAnchor=n,this.rotate=-90):(this.textAnchor=n==="right"?"end":"start",this.lineAnchor=F,this.frameAnchor=`${F}-${n}`,this.rotate=0),this.dy=F==="top"?3-O:F==="bottom"?E-3:0,this.dx=n==="right"?G:-G,this.ariaLabel=`${k} label`,{facets:[[0]],channels:{text:{value:[oy(t,H,{anchor:n,label:M,labelAnchor:F,labelArrow:$})]}}}})):null)}function Qg(t,n,e,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:a=i,strokeWidth:c=1,fill:u=r,fillOpacity:s=i,textAnchor:f,textStroke:d,textStrokeOpacity:l,textStrokeWidth:h,tickSize:p=t==="x"?6:0,tickPadding:g,tickRotate:b,y:v,margin:w,marginTop:S=w===void 0?n==="top"?30:0:w,marginRight:m=w===void 0?20:w,marginBottom:x=w===void 0?n==="bottom"?30:0:w,marginLeft:y=w===void 0?20:w,label:M,labelAnchor:_,labelArrow:$,labelOffset:A,ariaLabel:k=`${t}-axis`,...C}){return p=Lt(p),g=Lt(g),b=Lt(b),_!==void 0&&(_=gn(_,"labelAnchor",["center","left","right"])),$=ay($),yg(p&&!Wt(o)?z8(t,n,e,{stroke:o,strokeOpacity:a,strokeWidth:c,tickSize:p,tickPadding:g,tickRotate:b,y:v,ariaLabel:k,...C}):null,Wt(u)?null:q8(t,n,e,{fill:u,fillOpacity:s,stroke:d,strokeOpacity:l,strokeWidth:h,textAnchor:f,tickSize:p,tickPadding:g,tickRotate:b,y:v,marginTop:S,marginRight:m,marginBottom:x,marginLeft:y,ariaLabel:k,...C}),!Wt(u)&&M!==null?pt([],ey({fill:u,fillOpacity:s,...C},function(z,L,T,B,D){let H=B[t],{marginTop:O,marginRight:Y,marginBottom:E,marginLeft:R}=t==="x"&&D.inset||D,F=_??(H.bandwidth?"center":"right"),G=A??(n==="top"?O:E)-3;return F==="center"?(this.frameAnchor=n,this.textAnchor=void 0):(this.frameAnchor=`${n}-${F}`,this.textAnchor=F==="right"?"end":"start"),this.lineAnchor=n,this.dy=n==="top"?-G:G,this.dx=F==="right"?Y-3:F==="left"?3-R:0,this.ariaLabel=`${k} label`,{facets:[[0]],channels:{text:{value:[oy(t,H,{anchor:n,label:M,labelAnchor:F,labelArrow:$})]}}}})):null)}function I8(t,n,e,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:a=n+(t==="y"?"-empty":""),frameAnchor:c=n,tickSize:u,inset:s=0,insetLeft:f=s,insetRight:d=s,dx:l=0,y:h=t==="y"?void 0:null,ariaLabel:p,...g}){return Br(R8,t,e,{ariaLabel:`${p} tick`,ariaHidden:!0},{strokeWidth:r,strokeLinecap:i,strokeLinejoin:o,facetAnchor:a,frameAnchor:c,y:h,...g,dx:n==="left"?+l-Tt+ +f:+l+Tt-d,anchor:"start",length:u,shape:n==="left"?X8:V8})}function z8(t,n,e,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:a=n+(t==="x"?"-empty":""),frameAnchor:c=n,tickSize:u,inset:s=0,insetTop:f=s,insetBottom:d=s,dy:l=0,x:h=t==="x"?void 0:null,ariaLabel:p,...g}){return Br(P8,t,e,{ariaLabel:`${p} tick`,ariaHidden:!0},{strokeWidth:r,strokeLinejoin:o,strokeLinecap:i,facetAnchor:a,frameAnchor:c,x:h,...g,dy:n==="bottom"?+l-Tt-d:+l+Tt+ +f,anchor:"start",length:u,shape:n==="bottom"?U8:G8})}function F8(t,n,e,{facetAnchor:r=n+(t==="y"?"-empty":""),frameAnchor:i=n,tickSize:o,tickRotate:a=0,tickPadding:c=Math.max(3,9-o)+(Math.abs(a)>60?4*Math.cos(a*_g):0),text:u,textAnchor:s=Math.abs(a)>60?"middle":n==="left"?"end":"start",lineAnchor:f=a>60?"top":a<-60?"bottom":"middle",fontVariant:d,inset:l=0,insetLeft:h=l,insetRight:p=l,dx:g=0,ariaLabel:b,y:v=t==="y"?void 0:null,...w}){return Br(y8,t,e,{ariaLabel:`${b} tick label`},{facetAnchor:r,frameAnchor:i,text:u,textAnchor:s,lineAnchor:f,fontVariant:d,rotate:a,y:v,...w,dx:n==="left"?+g-o-c+ +h:+g+ +o+ +c-p},function(S,m,x,y,M){d===void 0&&(this.fontVariant=iy(S)),u===void 0&&(M.text=ry(S,m,x,y,n))})}function q8(t,n,e,{facetAnchor:r=n+(t==="x"?"-empty":""),frameAnchor:i=n,tickSize:o,tickRotate:a=0,tickPadding:c=Math.max(3,9-o)+(Math.abs(a)>=10?4*Math.cos(a*_g):0),text:u,textAnchor:s=Math.abs(a)>=10?a<0^n==="bottom"?"start":"end":"middle",lineAnchor:f=Math.abs(a)>=10?"middle":n==="bottom"?"top":"bottom",fontVariant:d,inset:l=0,insetTop:h=l,insetBottom:p=l,dy:g=0,x:b=t==="x"?void 0:null,ariaLabel:v,...w}){return Br(g8,t,e,{ariaLabel:`${v} tick label`},{facetAnchor:r,frameAnchor:i,text:u===void 0?null:u,textAnchor:s,lineAnchor:f,fontVariant:d,rotate:a,x:b,...w,dy:n==="bottom"?+g+ +o+ +c-p:+g-o-c+ +h},function(S,m,x,y,M){d===void 0&&(this.fontVariant=iy(S)),u===void 0&&(M.text=ry(S,m,x,y,n))})}function B8(){let[t,n]=me(...arguments);return Jg("y",Ug(n),t,n)}function Y8(){let[t,n]=me(...arguments);return Jg("fy",Gg(n),t,n)}function Al(){let[t,n]=me(...arguments);return ty("x",Xg(n),t,n)}function W8(){let[t,n]=me(...arguments);return ty("fx",Vg(n),t,n)}function Jg(t,n,e,{y:r=t==="y"?void 0:null,x:i=null,x1:o=n==="left"?i:null,x2:a=n==="right"?i:null,ariaLabel:c=`${t}-grid`,ariaHidden:u=!0,...s}){return Br(je,t,e,{ariaLabel:c,ariaHidden:u},{y:r,x1:o,x2:a,...ny(s)})}function ty(t,n,e,{x:r=t==="x"?void 0:null,y:i=null,y1:o=n==="top"?i:null,y2:a=n==="bottom"?i:null,ariaLabel:c=`${t}-grid`,ariaHidden:u=!0,...s}){return Br(Ki,t,e,{ariaLabel:c,ariaHidden:u},{x:r,y1:o,y2:a,...ny(s)})}function ny({color:t="currentColor",opacity:n=.1,stroke:e=t,strokeOpacity:r=n,strokeWidth:i=1,...o}){return{stroke:e,strokeOpacity:r,strokeWidth:i,...o}}function ey({fill:t,fillOpacity:n,fontFamily:e,fontSize:r,fontStyle:i,fontVariant:o,fontWeight:a,monospace:c,pointerEvents:u,shapeRendering:s,clip:f=!1},d){return[,t]=mn(t),[,n]=Ot(n),{facet:"super",x:null,y:null,fill:t,fillOpacity:n,fontFamily:e,fontSize:r,fontStyle:i,fontVariant:o,fontWeight:a,monospace:c,pointerEvents:u,shapeRendering:s,clip:f,initializer:d}}function Br(t,n,e,r,i,o){let a;function c(f,d,l,h,p,g){let b=f==null&&(n==="fx"||n==="fy"),{[n]:v}=h;if(!v)throw new Error(`missing scale: ${n}`);let w=v.domain(),{interval:S,ticks:m,tickFormat:x,tickSpacing:y=n==="x"?80:35}=i;if(typeof m=="string"&&cy(v)&&(S=m,m=void 0),m===void 0&&(m=Ir(S,v.type)??H8(v,y)),f==null){if(de(m))f=Ue(m);else if(Ar(m))f=gf(m,...Xt(w));else if(v.interval){let _=v.interval;if(v.ticks){let[$,A]=Xt(w),k=(A-$)/_[qi];_=hp(_,k/m)??_,f=gf(_,$,A)}else{f=w;let $=f.length;_=hp(_,$/m)??_,_!==v.interval&&(f=gf(_,...Xt(f)))}if(_===v.interval){let $=Math.round(f.length/m);$>1&&(f=f.filter((A,k)=>k%$===0))}}else v.ticks?f=v.ticks(m):f=w;if(!v.ticks&&f.length&&f!==w){let _=new xe(w);f=f.filter($=>_.has($)),f.length||fe(`Warning: the ${n}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}n==="y"||n==="x"?d=[Qn(f)]:a[n]={scale:n,value:mt}}o?.call(this,v,f,m,x,a);let M=Object.fromEntries(Object.entries(a).map(([_,$])=>[_,{...$,value:lt(f,$.value)}]));return b&&(d=g.filterFacets(f,M)),{data:f,facets:d,channels:M}}let u=Pr(i).initializer,s=t(e,Pr({...i,initializer:c},u));return e==null?(a=s.channels,s.channels={}):a={},r!==void 0&&Object.assign(s,r),s.clip===void 0&&(s.clip=!1),s}function H8(t,n){let[e,r]=Xt(t.range());return(r-e)/n}function ry(t,n,e,r,i){return{value:Tl(t,n,e,r,i)}}function Tl(t,n,e,r,i){return typeof r=="function"&&!(t.type==="log"&&t.tickFormat)?r:r===void 0&&n&&Ht(n)?w6(t.type,n,i)??Rr:r===void 0&&n&&E1(n)?String:t.tickFormat?t.tickFormat(typeof e=="number"?e:null,r):typeof r=="string"&&t.domain().length>0?(Ht(t.domain())?oe:ee)(r):r===void 0?Rr:Zn(r)}function gf(t,n,e){return t.range(n,t.offset(t.floor(e)))}var U8={draw(t,n){t.moveTo(0,0),t.lineTo(0,n)}},G8={draw(t,n){t.moveTo(0,0),t.lineTo(0,-n)}},X8={draw(t,n){t.moveTo(0,0),t.lineTo(-n,0)}},V8={draw(t,n){t.moveTo(0,0),t.lineTo(n,0)}};function iy(t){return t.bandwidth&&!t.interval?void 0:"tabular-nums"}function oy(t,n,{anchor:e,label:r=n.label,labelAnchor:i,labelArrow:o}={}){if(!(r==null||r.inferred&&cy(n)&&/^(date|time|year)$/i.test(r))){if(r=String(r),o==="auto"&&(o=(!n.bandwidth||n.interval)&&!/[↑↓→←]/.test(r)),!o)return r;if(o===!0){let a=m3(n);a&&(o=/x$/.test(t)||i==="center"?/x$/.test(t)===a<0?"left":"right":a<0?"up":"down")}switch(o){case"left":return`\u2190 ${r}`;case"right":return`${r} \u2192`;case"up":return e==="right"?`${r} \u2191`:`\u2191 ${r}`;case"down":return e==="right"?`${r} \u2193`:`\u2193 ${r}`}return r}}function ay(t="auto"){return Wt(t)?!1:typeof t=="boolean"?t:gn(t,"labelArrow",["auto","up","right","down","left"])}function cy(t){return Ht(t.domain())}function Gp(t,n){if(n==null)return n;let e=t(n);if(!e)throw new Error(`scale not found: ${n}`);return e}function uy(t,{opacity:n,...e}={}){if(!Ve(t)&&!hg(t))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${t.type})`);return fy(t,e,(r,i,o,a)=>r.append("svg").attr("width",o).attr("height",a).attr("fill",t.key==="opacity"?t.color:null).attr("fill-opacity",Ot(n)[1]).attr(t.key==="opacity"?"fill-opacity":"fill",i.scale).append("rect").attr("width","100%").attr("height","100%"))}var sy=new WeakSet;function j8(t,{fill:n=t.hint?.fill!==void 0?t.hint.fill:"none",fillOpacity:e=1,stroke:r=t.hint?.stroke!==void 0?t.hint.stroke:Wt(n)?"currentColor":"none",strokeOpacity:i=1,strokeWidth:o=1.5,r:a=4.5,...c}={},u){let[s,f]=mn(n),[d,l]=mn(r),h=Gp(u,s),p=Gp(u,d),g=a*a*Math.PI;e=Ot(e)[1],i=Ot(i)[1],o=Ot(o)[1];let b=fy(t,c,(v,w,S,m)=>v.append("svg").attr("viewBox","-8 -8 16 16").attr("width",S).attr("height",m).attr("fill",s==="color"?x=>h.scale(x):f).attr("fill-opacity",e).attr("stroke",d==="color"?x=>p.scale(x):l).attr("stroke-opacity",i).attr("stroke-width",o).append("path").attr("d",x=>{let y=In();return t.scale(x).draw(y,g),y}));return(s==="color"||d==="color")&&sy.add(b),b}function Z8(t){return sy.has(t)}function fy(t,n={},e){let{columns:r,tickFormat:i,fontVariant:o=vg(t),swatchSize:a=15,swatchWidth:c=a,swatchHeight:u=a,marginLeft:s=0,className:f,style:d,width:l}=n,h=fl(n);f=xl(f),i=Tl(t.scale,t.domain,void 0,i);let p=gt("div",h).attr("class",`${f}-swatches ${f}-swatches-${r!=null?"columns":"wrap"}`),g;return r!=null?(g=`:where(.${f}-swatches-columns .${f}-swatch) {
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
20
|
break-inside: avoid;
|
|
21
21
|
padding-bottom: 1px;
|
|
22
22
|
}
|
|
23
|
-
:where(.${
|
|
23
|
+
:where(.${f}-swatches-columns .${f}-swatch::before) {
|
|
24
24
|
flex-shrink: 0;
|
|
25
25
|
}
|
|
26
|
-
:where(.${
|
|
26
|
+
:where(.${f}-swatches-columns .${f}-swatch-label) {
|
|
27
27
|
white-space: nowrap;
|
|
28
28
|
overflow: hidden;
|
|
29
29
|
text-overflow: ellipsis;
|
|
30
|
-
}`,
|
|
30
|
+
}`,p.style("columns",r).selectAll().data(t.domain).enter().append("div").attr("class",`${f}-swatch`).call(e,t,c,u).call(b=>b.append("div").attr("class",`${f}-swatch-label`).attr("title",i).text(i))):(g=`:where(.${f}-swatches-wrap) {
|
|
31
31
|
display: flex;
|
|
32
32
|
align-items: center;
|
|
33
33
|
min-height: 33px;
|
|
34
34
|
flex-wrap: wrap;
|
|
35
35
|
}
|
|
36
|
-
:where(.${
|
|
36
|
+
:where(.${f}-swatches-wrap .${f}-swatch) {
|
|
37
37
|
display: inline-flex;
|
|
38
38
|
align-items: center;
|
|
39
39
|
margin-right: 1em;
|
|
40
|
-
}`,
|
|
40
|
+
}`,p.selectAll().data(t.domain).enter().append("span").attr("class",`${f}-swatch`).call(e,t,c,u).append(function(){return this.ownerDocument.createTextNode(i.apply(this,arguments))})),p.call(b=>b.insert("style","*").text(`:where(.${f}-swatches) {
|
|
41
41
|
font-family: system-ui, sans-serif;
|
|
42
42
|
font-size: 10px;
|
|
43
43
|
margin-bottom: 0.5em;
|
|
44
44
|
}
|
|
45
|
-
:where(.${
|
|
45
|
+
:where(.${f}-swatch > svg) {
|
|
46
46
|
margin-right: 0.5em;
|
|
47
47
|
overflow: visible;
|
|
48
48
|
}
|
|
49
|
-
${g}`)).style("margin-left",f?`${+f}px`:null).style("width",l===void 0?null:`${+l}px`).style("font-variant",St(o,"normal")).call(pl,d).node()}var Es=new Map([["symbol",D8],["color",z8],["opacity",F8]]);function O8(t,n,e={}){return(r,i)=>{if(!Es.has(r))throw new Error(`unknown legend type: ${r}`);if(r in t)return Es.get(r)(t[r],iy(n,e[r],i),o=>t[o])}}function iy({className:t,...n},{label:e,ticks:r,tickFormat:i}={},o){return Mm(o,{className:t,...n},{label:e,ticks:r,tickFormat:i})}function z8(t,{legend:n=!0,...e}){if(n===!0&&(n=t.type==="ordinal"?"swatches":"ramp"),t.domain!==void 0)switch(`${n}`.toLowerCase()){case"swatches":return ny(t,e);case"ramp":return mg(t,e);default:throw new Error(`unknown color legend type: ${n}`)}}function F8(t,{legend:n=!0,color:e="currentColor",...r}){switch(n===!0&&(n=t.type==="ordinal"?"swatches":"ramp"),t={...t,color:e,key:"opacity"},`${n}`.toLowerCase()){case"swatches":return ny(t,r);case"ramp":{let i=mg(t,r),o=p3(),a=Rn(i);a.select("image").attr("filter",`url(#${o})`);let c=a.append("filter").attr("id",o);return c.append("feFlood").attr("flood-color",e),c.append("feComposite").attr("in2","SourceGraphic").attr("operator","in"),i}default:throw new Error(`unknown opacity legend type: ${n}`)}}function B8(t,n,e){let r=[],i=!1;for(let[o,a]of Es){if(!(o in t)||o==="color"&&i)continue;let c=Mm(e[o],{legend:e.legend});if(!c.legend)continue;let u=a(t[o],iy(n,t[o],c),f=>t[f]);u!=null&&(o==="symbol"&&I8(u)&&(i=!0),r.push(u))}return r}function _l(t){return ym(t)?t:{...t,x:ht}}function Ml(t){return bm(t)?t:{...t,y:ht}}function q8(t,n){if(n.length===1)return{data:t,facets:n};let e=ki(t),r=new Uint8Array(e),i=0;for(let c of n)for(let u of c)r[u]&&++i,r[u]=1;if(i===0)return{data:t,facets:n};t=Si(t);let o=t[sm]=new Uint32Array(e+i);n=n.map(c=>Si(c,Uint32Array));let a=e;r.fill(0);for(let c of n)for(let u=0,f=c.length;u<f;++u){let s=c[u];r[s]?(c[u]=a,t[a]=t[s],o[a]=s,++a):o[s]=s,r[s]=1}return{data:t,facets:n}}function Y8(t={},n={}){arguments.length===1&&([t,n]=oy(t));let{y1:e,y:r=e,x:i,...o}=n,[a,c,u,f]=ay(r,i,"y","x",t,o);return{...a,y1:e,y:c,x1:u,x2:f,x:_a(u,f)}}function W8(t={},n={}){arguments.length===1&&([t,n]=oy(t));let{x1:e,x:r=e,y:i,...o}=n,[a,c,u,f]=ay(r,i,"x","y",t,o);return{...a,x1:e,x:c,y1:u,y2:f,y:_a(u,f)}}function $l({x:t,x1:n,x2:e,...r}={}){return r=Pr(r,"y"),n===void 0&&e===void 0?Y8({x:t,...r}):([n,e]=wm(t,n,e),{...r,x1:n,x2:e})}function Sl({y:t,y1:n,y2:e,...r}={}){return r=Pr(r,"x"),n===void 0&&e===void 0?W8({y:t,...r}):([n,e]=wm(t,n,e),{...r,y1:n,y2:e})}function oy(t){let{offset:n,order:e,reverse:r,...i}=t;return[{offset:n,order:e,reverse:r},i]}var U8={length:!0};function ay(t,n=s6,e,r,{offset:i,order:o,reverse:a},c){if(n===null)throw new Error(`stack requires ${r}`);let u=Xs(c),[f,s]=Ft(t),[d,l]=va(n),[h,m]=va(n);return d.hint=h.hint=U8,i=G8(i),o=V8(o,i,r),[Fi(c,(g,x,v)=>{({data:g,facets:x}=q8(g,x));let w=t==null?void 0:s(Ma(st(g,t),v?.[e])),$=st(g,n,Float64Array),p=st(g,u),b=o&&o(g,w,$,p),y=ki(g),_=l(new Float64Array(y).fill(NaN)),M=m(new Float64Array(y).fill(NaN)),S=[];for(let C of x){let k=w?Array.from(Br(C,T=>w[T]).values()):[C];if(b)for(let T of k)T.sort(b);for(let T of k){let D=0,P=0;a&&T.reverse();for(let A of T){let O=$[A];O<0?D=M[A]=(_[A]=D)+O:O>=0&&(P=M[A]=(_[A]=P)+O)}}S.push(k)}return i&&i(S,_,M,p),{data:g,facets:x}}),f,d,h]}function G8(t){if(t!=null){if(typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"expand":case"normalize":return H8;case"center":case"silhouette":return X8;case"wiggle":return uy}throw new Error(`unknown offset: ${t}`)}}function cy(t,n){let e=0,r=0;for(let i of t){let o=n[i];o<e&&(e=o),o>r&&(r=o)}return[e,r]}function H8(t,n,e){for(let r of t)for(let i of r){let[o,a]=cy(i,e);for(let c of i){let u=1/(a-o||1);n[c]=u*(n[c]-o),e[c]=u*(e[c]-o)}}}function X8(t,n,e){for(let r of t){for(let i of r){let[o,a]=cy(i,e);for(let c of i){let u=(a+o)/2;n[c]-=u,e[c]-=u}}fy(r,n,e)}sy(t,n,e)}function uy(t,n,e,r){for(let i of t){let o=new an,a=0;for(let c of i){let u=-1,f=c.map(h=>Math.abs(e[h]-n[h])),s=c.map(h=>{u=r?r[h]:++u;let m=e[h]-n[h],g=o.has(u)?m-o.get(u):0;return o.set(u,m),g}),d=[0,...Xl(s)];for(let h of c)n[h]+=a,e[h]+=a;let l=mn(f);l&&(a-=mn(f,(h,m)=>(s[m]/2+d[m])*h)/l)}fy(i,n,e)}sy(t,n,e)}function fy(t,n,e){let r=cn(t,i=>cn(i,o=>n[o]));for(let i of t)for(let o of i)n[o]-=r,e[o]-=r}function sy(t,n,e){let r=t.length;if(r===1)return;let i=t.map(c=>c.flat()),o=i.map(c=>(cn(c,u=>n[u])+Yt(c,u=>e[u]))/2),a=cn(o);for(let c=0;c<r;c++){let u=a-o[c];for(let f of i[c])n[f]+=u,e[f]+=u}}function V8(t,n,e){if(t===void 0&&n===uy)return F1(sn);if(t!=null){if(typeof t=="string"){let r=t.startsWith("-"),i=r?wa:sn;switch((r?t.slice(1):t).toLowerCase()){case"value":case e:return j8(i);case"z":return Z8(i);case"sum":return K8(i);case"appearance":return Q8(i);case"inside-out":return F1(i)}return B1(lm(t))}if(typeof t=="function")return(t.length===1?B1:J8)(t);if(Be(t))return t4(t);throw new Error(`invalid order: ${t}`)}}function j8(t){return(n,e,r)=>(i,o)=>t(r[i],r[o])}function Z8(t){return(n,e,r,i)=>(o,a)=>t(i[o],i[a])}function K8(t){return Wa(t,(n,e,r,i)=>to(jn(n),o=>mn(o,a=>r[a]),o=>i[o]))}function Q8(t){return Wa(t,(n,e,r,i)=>to(jn(n),o=>e[Ja(o,a=>r[a])],o=>i[o]))}function F1(t){return Wa(t,(n,e,r,i)=>{let o=jn(n),a=to(o,d=>e[Ja(d,l=>r[l])],d=>i[d]),c=ye(o,d=>mn(d,l=>r[l]),d=>i[d]),u=[],f=[],s=0;for(let d of a)s<0?(s+=c.get(d),u.push(d)):(s-=c.get(d),f.push(d));return f.reverse().concat(u)})}function B1(t){return n=>{let e=st(n,t);return(r,i)=>sn(e[r],e[i])}}function J8(t){return n=>Be(n)?(e,r)=>t(n[e],n[r]):(e,r)=>t(n.get(e),n.get(r))}function t4(t){return Wa(sn,()=>t)}function Wa(t,n){return(e,r,i,o)=>{if(!o)throw new Error("missing channel: z");let a=new an(n(e,r,i,o).map((c,u)=>[c,u]));return(c,u)=>t(a.get(o[c]),a.get(o[u]))}}var n4={ariaLabel:"rect"},Ni=class extends Et{constructor(n,e={}){let{x1:r,y1:i,x2:o,y2:a}=e;super(n,{x1:{value:r,scale:"x",type:r!=null&&o==null?"band":void 0,optional:!0},y1:{value:i,scale:"y",type:i!=null&&a==null?"band":void 0,optional:!0},x2:{value:o,scale:"x",optional:!0},y2:{value:a,scale:"y",optional:!0}},e,n4),kl(this,e),Al(this,e)}render(n,e,r,i,o){let{x:a,y:c}=e,{x1:u,y1:f,x2:s,y2:d}=r,{marginTop:l,marginRight:h,marginBottom:m,marginLeft:g,width:x,height:v}=i,{projection:w}=o,{insetTop:$,insetRight:p,insetBottom:b,insetLeft:y}=this,{rx:_,ry:M,rx1y1:S,rx1y2:C,rx2y1:k,rx2y2:T}=this;(u||s)&&!w&&Cn(a)&&(u=s=null),(f||d)&&!w&&Cn(c)&&(f=d=null);let D=a?.bandwidth?a.bandwidth():0,P=c?.bandwidth?c.bandwidth():0;return pt("svg:g",o).call(Xt,this,i,o).call(Dt,this,{},0,0).call(A=>A.selectAll().data(n).enter().call(S||C||k||T?O=>O.append("path").call(Pt,this).call(Tl,u&&s?R=>u[R]+(s[R]<u[R]?-p:y):u?R=>u[R]+y:g+y,f&&d?R=>f[R]+(d[R]<f[R]?-b:$):f?R=>f[R]+$:l+$,u&&s?R=>s[R]-(s[R]<u[R]?-y:p):u?R=>u[R]+D-p:x-h-p,f&&d?R=>d[R]-(d[R]<f[R]?-$:b):f?R=>f[R]+P-b:v-m-b,this).call(dn,this,r):O=>O.append("rect").call(Pt,this).attr("x",u?s?R=>Math.min(u[R],s[R])+y:R=>u[R]+y:g+y).attr("y",f?d?R=>Math.min(f[R],d[R])+$:R=>f[R]+$:l+$).attr("width",u?s?R=>Math.max(0,Math.abs(s[R]-u[R])+D-y-p):D-y-p:x-h-g-p-y).attr("height",f?d?R=>Math.max(0,Math.abs(f[R]-d[R])+P-$-b):P-$-b:v-l-m-$-b).call(X,"rx",_).call(X,"ry",M).call(dn,this,r))).node()}};function kl(t,{inset:n=0,insetTop:e=n,insetRight:r=n,insetBottom:i=n,insetLeft:o=n}={}){t.insetTop=Ct(e),t.insetRight=Ct(r),t.insetBottom=Ct(i),t.insetLeft=Ct(o)}function Al(t,{r:n,rx:e,ry:r,rx1:i=n,ry1:o=n,rx2:a=n,ry2:c=n,rx1y1:u=i!==void 0?+i:o!==void 0?+o:0,rx1y2:f=i!==void 0?+i:c!==void 0?+c:0,rx2y1:s=a!==void 0?+a:o!==void 0?+o:0,rx2y2:d=a!==void 0?+a:c!==void 0?+c:0}={}){u||f||s||d?(t.rx1y1=u,t.rx1y2=f,t.rx2y1=s,t.rx2y2=d):(t.rx=St(e,"auto"),t.ry=St(r,"auto"))}function Tl(t,n,e,r,i,o){let{rx1y1:a,rx1y2:c,rx2y1:u,rx2y2:f}=o;typeof n!="function"&&(n=Xn(n)),typeof e!="function"&&(e=Xn(e)),typeof r!="function"&&(r=Xn(r)),typeof i!="function"&&(i=Xn(i));let s=Math.max(Math.abs(a+u),Math.abs(c+f)),d=Math.max(Math.abs(a+c),Math.abs(u+f));t.attr("d",l=>{let h=n(l),m=e(l),g=r(l),x=i(l),v=h>g,w=m>x,$=v?g:h,p=v?h:g,b=w?x:m,y=w?m:x,_=Math.min(1,(p-$)/s,(y-b)/d),M=_*(v?w?f:u:w?c:a),S=_*(v?w?c:a:w?f:u),C=_*(v?w?a:c:w?u:f),k=_*(v?w?u:f:w?a:c);return`M${$},${b+da(M,k)}A${M},${M} 0 0 ${M<0?0:1} ${$+la(M,k)},${b}H${p-la(S,C)}A${S},${S} 0 0 ${S<0?0:1} ${p},${b+da(S,C)}V${y-da(C,S)}A${C},${C} 0 0 ${C<0?0:1} ${p-la(C,S)},${y}H${$+la(k,M)}A${k},${k} 0 0 ${k<0?0:1} ${$},${y-da(k,M)}Z`})}function la(t,n){return n<0?t:Math.abs(t)}function da(t,n){return n<0?Math.abs(t):t}function e4(t,n){return new Ni(t,Mg($g(n)))}function r4(t,n={}){return Na(n)||(n={...n,y:qe,x2:ht,interval:1}),new Ni(t,$l($g(_l(n))))}function i4(t,n={}){return Na(n)||(n={...n,x:qe,y2:ht,interval:1}),new Ni(t,Sl(Mg(Ml(n))))}var o4={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},a4={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1},Ns=class extends Et{constructor(n={}){let{anchor:e=null}=n;super(ya,void 0,n,e==null?o4:a4),this.anchor=mm(e,"anchor",["top","right","bottom","left"]),kl(this,n),e||Al(this,n)}render(n,e,r,i,o){let{marginTop:a,marginRight:c,marginBottom:u,marginLeft:f,width:s,height:d}=i,{anchor:l,insetTop:h,insetRight:m,insetBottom:g,insetLeft:x}=this,{rx:v,ry:w,rx1y1:$,rx1y2:p,rx2y1:b,rx2y2:y}=this,_=f+x,M=s-c-m,S=a+h,C=d-u-g;return pt(l?"svg:line":$||p||b||y?"svg:path":"svg:rect",o).datum(0).call(Xt,this,i,o).call(Pt,this).call(dn,this,r).call(Dt,this,{}).call(l==="left"?k=>k.attr("x1",_).attr("x2",_).attr("y1",S).attr("y2",C):l==="right"?k=>k.attr("x1",M).attr("x2",M).attr("y1",S).attr("y2",C):l==="top"?k=>k.attr("x1",_).attr("x2",M).attr("y1",S).attr("y2",S):l==="bottom"?k=>k.attr("x1",_).attr("x2",M).attr("y1",C).attr("y2",C):$||p||b||y?k=>k.call(Tl,_,S,M,C,this):k=>k.attr("x",_).attr("y",S).attr("width",M-_).attr("height",C-S).attr("rx",v).attr("ry",w)).node()}};function c4(t){return new Ns(t)}var ds={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor",pool:!0},u4=new Set(["geometry","href","src","ariaLabel","scales","contours"]),Rs=class extends Et{constructor(n,e={}){e.tip&&(e={...e,tip:!1}),e.title===void 0&&le(n)&&vm(n)&&(e={...e,title:ht});let{x:r,y:i,x1:o,x2:a,y1:c,y2:u,anchor:f,preferredAnchor:s="bottom",monospace:d,fontFamily:l=d?"ui-monospace, monospace":void 0,fontSize:h,fontStyle:m,fontVariant:g,fontWeight:x,lineHeight:v=1,lineWidth:w=20,frameAnchor:$,format:p,textAnchor:b="start",textOverflow:y,textPadding:_=8,title:M,pointerSize:S=12,pathFilter:C="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=e;super(n,{x:{value:o!=null&&a!=null?null:r,scale:"x",optional:!0},y:{value:c!=null&&u!=null?null:i,scale:"y",optional:!0},x1:{value:o,scale:"x",optional:a==null},y1:{value:c,scale:"y",optional:u==null},x2:{value:a,scale:"x",optional:o==null},y2:{value:u,scale:"y",optional:c==null},title:{value:M,optional:!0}},e,ds),this.anchor=bs(f,"anchor"),this.preferredAnchor=bs(s,"preferredAnchor"),this.frameAnchor=Pa($),this.textAnchor=St(b,"middle"),this.textPadding=+_,this.pointerSize=+S,this.pathFilter=Tt(C),this.lineHeight=+v,this.lineWidth=+w,this.textOverflow=Eg(y),this.monospace=!!d,this.fontFamily=Tt(l),this.fontSize=Ct(h),this.fontStyle=Tt(m),this.fontVariant=Tt(g),this.fontWeight=Tt(x);for(let k in ds)k in this.channels&&(this[k]=ds[k]);this.splitLines=Rg(this),this.clipLine=Lg(this),this.format=typeof p=="string"||typeof p=="function"?{title:p}:{...p}}render(n,e,r,i,o){let a=this,{x:c,y:u,fx:f,fy:s}=e,{ownerSVGElement:d,document:l}=o,{anchor:h,monospace:m,lineHeight:g,lineWidth:x}=this,{textPadding:v,pointerSize:w,pathFilter:$}=this,{marginTop:p,marginLeft:b}=i,{x1:y,y1:_,x2:M,y2:S,x:C=y??M,y:k=_??S}=r,T=f?f(n.fx)-b:0,D=s?s(n.fy)-p:0,[P,A]=Yi(this,i),O=dg(r,P),R=hg(r,A),W=m?xl:wl,L=W($r),I,q;"title"in r?(I=q1.call(this,{title:r.channels.title},e),q=h4):(I=q1.call(this,r.channels,e),q=p4);let U=new Array(n.length);for(let at of n)U[at]=q.call(a,at,n,I,e,r);n=n.filter(at=>U[at]!=null);let F=pt("svg:g",o).call(Xt,this,i,o).call(Ng,this).call(Dt,this,{x:C&&c,y:k&&u}).call(at=>at.selectAll().data(n).enter().append("g").attr("transform",B=>`translate(${Math.round(O(B))},${Math.round(R(B))})`).call(Pt,this).call(B=>B.append("path").attr("filter",$)).call(B=>B.append("text").each(function(G){let N=Rn(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");let z=U[G];if(typeof z=="string")for(let Y of a.splitLines(z))K(N,{value:a.clipLine(Y)});else{let Y=new Set;for(let E of z){let{label:nt=""}=E;nt&&Y.has(nt)||(Y.add(nt),K(N,E))}}})));function K(at,{label:B,value:G,color:N,opacity:z}){B??="",G??="";let Y=N!=null||z!=null,E,nt=x*100,[H]=Er(B,nt,W,L);if(H>=0)B=B.slice(0,H).trimEnd()+$r,E=G.trim(),G="";else{(B||!G&&!Y)&&(G=" "+G);let[rt]=Er(G,nt-W(B),W,L);rt>=0&&(E=G.trim(),G=G.slice(0,rt).trimEnd()+$r)}let J=at.append("tspan").attr("x",0).attr("dy",`${g}em`).text("\u200B");B&&J.append("tspan").attr("font-weight","bold").text(B),G&&J.append(()=>l.createTextNode(G)),Y&&J.append("tspan").text(" \u25A0").attr("fill",N).attr("fill-opacity",z).style("user-select","none"),E&&J.append("title").text(E)}function et(){let{width:at,height:B}=i.facet??i;F.selectChildren().each(function(G){let{x:N,width:z,height:Y}=this.getBBox();z=Math.round(z),Y=Math.round(Y);let E=h;if(E===void 0){let J=O(G)+T,rt=R(G)+D,ut=J+z+w+v*2<at,En=J-z-w-v*2>0,Or=rt+Y+w+v*2<B,me=rt-Y-w-v*2>0;E=ut&&En?Or&&me?a.preferredAnchor:me?"bottom":"top":Or&&me?ut?"left":"right":(ut||En)&&(Or||me)?`${me?"bottom":"top"}-${ut?"left":"right"}`:a.preferredAnchor}let nt=this.firstChild,H=this.lastChild;if(nt.setAttribute("d",d4(E,w,v,z,Y)),N)for(let J of H.childNodes)J.setAttribute("x",-N);H.setAttribute("y",`${+s4(E,H.childNodes.length,g).toFixed(6)}em`),H.setAttribute("transform",`translate(${l4(E,w,v,z,Y)})`)}),F.attr("visibility",null)}return n.length&&(F.attr("visibility","hidden"),d.isConnected?Promise.resolve().then(et):typeof requestAnimationFrame<"u"&&requestAnimationFrame(et)),F.node()}};function f4(t,{x:n,y:e,...r}={}){return r.frameAnchor===void 0&&([n,e]=We(n,e)),new Rs(t,{...r,x:n,y:e})}function s4(t,n,e){return/^top(?:-|$)/.test(t)?.94-e:-.29-n*e}function l4(t,n,e,r,i){switch(t){case"middle":return[-r/2,i/2];case"top-left":return[e,n/2+e];case"top":return[-r/2,n/2+e];case"top-right":return[-r-e,n/2+e];case"right":return[-n/2-r-e,i/2];case"bottom-left":return[e,-n/2-e];case"bottom":return[-r/2,-n/2-e];case"bottom-right":return[-r-e,-n/2-e];case"left":return[e+n/2,i/2]}}function d4(t,n,e,r,i){let o=r+e*2,a=i+e*2;switch(t){case"middle":return`M${-o/2},${-a/2}h${o}v${a}h${-o}z`;case"top-left":return`M0,0l${n/2},${n/2}h${o-n/2}v${a}h${-o}z`;case"top":return`M0,0l${n/2},${n/2}h${(o-n)/2}v${a}h${-o}v${-a}h${(o-n)/2}z`;case"top-right":return`M0,0l${-n/2},${n/2}h${n/2-o}v${a}h${o}z`;case"right":return`M0,0l${-n/2},${-n/2}v${n/2-a/2}h${-o}v${a}h${o}v${n/2-a/2}z`;case"bottom-left":return`M0,0l${n/2},${-n/2}h${o-n/2}v${-a}h${-o}z`;case"bottom":return`M0,0l${n/2},${-n/2}h${(o-n)/2}v${-a}h${-o}v${a}h${(o-n)/2}z`;case"bottom-right":return`M0,0l${-n/2},${-n/2}h${n/2-o}v${-a}h${o}z`;case"left":return`M0,0l${n/2},${-n/2}v${n/2-a/2}h${o}v${a}h${-o}v${n/2-a/2}z`}}function q1(t,n){let e={},r=this.format;r=Y1(r,t,"x"),r=Y1(r,t,"y"),this.format=r;for(let i in r){let o=r[i];if(!(o===null||o===!1))if(i==="fx"||i==="fy")e[i]=!0;else{let a=h1(t,i);a&&(e[i]=a)}}for(let i in t){if(i in e||i in r||u4.has(i)||(i==="x"||i==="y")&&t.geometry)continue;let o=h1(t,i);if(o){if(o.scale==null&&o.defaultScale)continue;e[i]=o}}this.facet&&(n.fx&&!("fx"in r)&&(e.fx=!0),n.fy&&!("fy"in r)&&(e.fy=!0));for(let i in e){let o=this.format[i],a=n[i],c=e[i]?.value??a?.domain()??[];typeof o=="string"?this.format[i]=(qt(c)?ie:ne)(o):(o===void 0||o===!0)&&(this.format[i]=a?.bandwidth?vl(a,a.domain()):_m(c)?String:Cr)}return e}function Y1(t,n,e){if(!(e in t))return t;let r=`${e}1`,i=`${e}2`;if((r in t||!(r in n))&&(i in t||!(i in n)))return t;let o=Object.entries(t),a=t[e];return o.splice(o.findIndex(([c])=>c===e)+1,0,[r,a],[i,a]),Object.fromEntries(o)}function h4(t,n,{title:e}){return this.format.title(e.value[t],t)}function*p4(t,n,e,r,i){for(let o in e){if(o==="fx"||o==="fy"){yield{label:ka(r,e,o),value:this.format[o](n[o],t)};continue}if(o==="x1"&&"x2"in e||o==="y1"&&"y2"in e)continue;let a=e[o];if(o==="x2"&&"x1"in e)yield{label:U1(r,e,"x"),value:W1(this.format.x2,e.x1,a,t)};else if(o==="y2"&&"y1"in e)yield{label:U1(r,e,"y"),value:W1(this.format.y2,e.y1,a,t)};else{let c=a.value[t],u=a.scale;if(!An(c)&&u==null)continue;yield{label:ka(r,e,o),value:this.format[o](c,t),color:u==="color"?i[o][t]:null,opacity:u==="opacity"?i[o][t]:null}}}}function W1(t,n,e,r){return e.hint?.length?`${t(e.value[r]-n.value[r],r)}`:`${t(n.value[r],r)}\u2013${t(e.value[r],r)}`}function U1(t,n,e){let r=ka(t,n,`${e}1`,e),i=ka(t,n,`${e}2`,e);return r===i?r:`${r}\u2013${i}`}function ka(t,n,e,r=e){let i=n[e],o=t[i?.scale??e];return String(o?.label??i?.label??r)}function Cl(t={}){let{facet:n,style:e,title:r,subtitle:i,caption:o,ariaLabel:a,ariaDescription:c}=t,u=hl(t.className),f=t.marks===void 0?[]:H1(t.marks);f.push(...x4(f));let s=b4(n,t),d=new Map;for(let L of f){let I=X1(L,s,t);I&&d.set(L,I)}let l=new Map;s&&_i(l,[s],t),_i(l,d,t);let h=H1(v4(f,l,t));for(let L of h){let I=X1(L,s,t);I&&d.set(L,I)}f.unshift(...h);let m=N3(l,t);if(m!==void 0){let L=s?us(m,s):void 0;for(let q of f){if(q.facet===null||q.facet==="super")continue;let U=d.get(q);U!==void 0&&(U.facetsIndex=q.fx!=null||q.fy!=null?us(m,U):L)}let I=new Set;for(let{facetsIndex:q}of d.values())q?.forEach((U,F)=>{U?.length>0&&I.add(F)});m.forEach(0<I.size&&I.size<m.length?(q,U)=>q.empty=!I.has(U):q=>q.empty=!1);for(let q of f)if(q.facet==="exclude"){let U=d.get(q);U!==void 0&&(U.facetsIndex=P3(U.facetsIndex))}}for(let L of ft.keys())xa(t[L])&&L!=="fx"&&L!=="fy"&&l.set(L,[]);let g=new Map;for(let L of f){if(g.has(L))throw new Error("duplicate mark; each mark must be unique");let{facetsIndex:I,channels:q}=d.get(L)??{},{data:U,facets:F,channels:K}=L.initialize(I,q,t);El(K,t),g.set(L,{data:U,facets:F,channels:K})}let x=Ms(_i(l,g,t),t),v=C3(x,f,t);K5(x,v);let w=v1(x),{fx:$,fy:p}=w,b=$||p?ng(x,v):v,y=$||p?T4(w,v):v,_=ol(t),M=_.document,S=Ur("svg").call(M.documentElement),C=S;_.ownerSVGElement=S,_.className=u,_.projection=c5(t,b),_.path=function(){return Io(this.projection??g5(w))},_.filterFacets=(L,I)=>us(m,{channels:I,groups:ml(L,I)}),_.getMarkState=L=>{let I=g.get(L),q=d.get(L);return{...I,channels:{...I.channels,...q?.channels}}},_.dispatchValue=L=>{C.value!==L&&(C.value=L,C.dispatchEvent(new _.document.defaultView.Event("input",{bubbles:!0})))};let k=new Set;for(let[L,I]of g)if(L.initializer!=null){let q=L.facet==="super"?y:b,U=L.initializer(I.data,I.facets,I.channels,w,q,_);if(U.data!==void 0&&(I.data=U.data),U.facets!==void 0&&(I.facets=U.facets),U.channels!==void 0){let{fx:F,fy:K,...et}=U.channels;y4(et),Object.assign(I.channels,et);for(let at of Object.values(et)){let{scale:B}=at;B!=null&&!T6(ft.get(B))&&(ly(at,t),k.add(B))}(F!=null||K!=null)&&d.set(L,!0)}}if(k.size){let L=new Map;_i(L,g,t,F=>k.has(F)),_i(l,g,t,F=>k.has(F));let I=A4(Ms(L,t),x),{scales:q,...U}=v1(I);Object.assign(x,I),Object.assign(w,U),Object.assign(w.scales,q)}let T,D;m!==void 0&&(T={x:$?.domain(),y:p?.domain()},m=R3(m,T),D=L3($,p,v));for(let[L,I]of g)I.values=L.scale(I.channels,w,_);let{width:P,height:A}=v;Rn(S).attr("class",u).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",P).attr("height",A).attr("viewBox",`0 0 ${P} ${A}`).attr("aria-label",a).attr("aria-description",c).call(L=>L.append("style").text(`:where(.${u}) {
|
|
49
|
+
${g}`)).style("margin-left",s?`${+s}px`:null).style("width",l===void 0?null:`${+l}px`).style("font-variant",At(o,"normal")).call(wl,d).node()}var Df=new Map([["symbol",j8],["color",Q8],["opacity",J8]]);function K8(t,n,e={}){return(r,i)=>{if(!Df.has(r))throw new Error(`unknown legend type: ${r}`);if(r in t)return Df.get(r)(t[r],ly(n,e[r],i),o=>t[o])}}function ly({className:t,...n},{label:e,ticks:r,tickFormat:i}={},o){return N1(o,{className:t,...n},{label:e,ticks:r,tickFormat:i})}function Q8(t,{legend:n=!0,...e}){if(n===!0&&(n=t.type==="ordinal"?"swatches":"ramp"),t.domain!==void 0)switch(`${n}`.toLowerCase()){case"swatches":return uy(t,e);case"ramp":return Mg(t,e);default:throw new Error(`unknown color legend type: ${n}`)}}function J8(t,{legend:n=!0,color:e="currentColor",...r}){switch(n===!0&&(n=t.type==="ordinal"?"swatches":"ramp"),t={...t,color:e,key:"opacity"},`${n}`.toLowerCase()){case"swatches":return uy(t,r);case"ramp":{let i=Mg(t,r),o=C3(),a=Dn(i);a.select("image").attr("filter",`url(#${o})`);let c=a.append("filter").attr("id",o);return c.append("feFlood").attr("flood-color",e),c.append("feComposite").attr("in2","SourceGraphic").attr("operator","in"),i}default:throw new Error(`unknown opacity legend type: ${n}`)}}function t4(t,n,e){let r=[],i=!1;for(let[o,a]of Df){if(!(o in t)||o==="color"&&i)continue;let c=N1(e[o],{legend:e.legend});if(!c.legend)continue;let u=a(t[o],ly(n,t[o],c),s=>t[s]);u!=null&&(o==="symbol"&&Z8(u)&&(i=!0),r.push(u))}return r}function Cl(t){return S1(t)?t:{...t,x:mt}}function El(t){return k1(t)?t:{...t,y:mt}}function n4(t,n){if(n.length===1)return{data:t,facets:n};let e=Ni(t),r=new Uint8Array(e),i=0;for(let c of n)for(let u of c)r[u]&&++i,r[u]=1;if(i===0)return{data:t,facets:n};t=Ei(t);let o=t[b1]=new Uint32Array(e+i);n=n.map(c=>Ei(c,Uint32Array));let a=e;r.fill(0);for(let c of n)for(let u=0,s=c.length;u<s;++u){let f=c[u];r[f]?(c[u]=a,t[a]=t[f],o[a]=f,++a):o[f]=f,r[f]=1}return{data:t,facets:n}}function e4(t={},n={}){arguments.length===1&&([t,n]=dy(t));let{y1:e,y:r=e,x:i,...o}=n,[a,c,u,s]=hy(r,i,"y","x",t,o);return{...a,y1:e,y:c,x1:u,x2:s,x:ka(u,s)}}function r4(t={},n={}){arguments.length===1&&([t,n]=dy(t));let{x1:e,x:r=e,y:i,...o}=n,[a,c,u,s]=hy(r,i,"x","y",t,o);return{...a,x1:e,x:c,y1:u,y2:s,y:ka(u,s)}}function Nl({x:t,x1:n,x2:e,...r}={}){return r=Fr(r,"y"),n===void 0&&e===void 0?e4({x:t,...r}):([n,e]=A1(t,n,e),{...r,x1:n,x2:e})}function Ll({y:t,y1:n,y2:e,...r}={}){return r=Fr(r,"x"),n===void 0&&e===void 0?r4({y:t,...r}):([n,e]=A1(t,n,e),{...r,y1:n,y2:e})}function dy(t){let{offset:n,order:e,reverse:r,...i}=t;return[{offset:n,order:e,reverse:r},i]}var i4={length:!0};function hy(t,n=S6,e,r,{offset:i,order:o,reverse:a},c){if(n===null)throw new Error(`stack requires ${r}`);let u=Qf(c),[s,f]=Yt(t),[d,l]=Sa(n),[h,p]=Sa(n);return d.hint=h.hint=i4,i=o4(i),o=u4(o,i,r),[Hi(c,(g,b,v)=>{({data:g,facets:b}=n4(g,b));let w=t==null?void 0:f(Aa(lt(g,t),v?.[e])),S=lt(g,n,Float64Array),m=lt(g,u),x=o&&o(g,w,S,m),y=Ni(g),M=l(new Float64Array(y).fill(NaN)),_=p(new Float64Array(y).fill(NaN)),$=[];for(let A of b){let k=w?Array.from(Ur(A,C=>w[C]).values()):[A];if(x)for(let C of k)C.sort(x);for(let C of k){let z=0,L=0;a&&C.reverse();for(let T of C){let B=S[T];B<0?z=_[T]=(M[T]=z)+B:B>=0&&(L=_[T]=(M[T]=L)+B)}}$.push(k)}return i&&i($,M,_,m),{data:g,facets:b}}),s,d,h]}function o4(t){if(t!=null){if(typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"expand":case"normalize":return a4;case"center":case"silhouette":return c4;case"wiggle":return py}throw new Error(`unknown offset: ${t}`)}}function my(t,n){let e=0,r=0;for(let i of t){let o=n[i];o<e&&(e=o),o>r&&(r=o)}return[e,r]}function a4(t,n,e){for(let r of t)for(let i of r){let[o,a]=my(i,e);for(let c of i){let u=1/(a-o||1);n[c]=u*(n[c]-o),e[c]=u*(e[c]-o)}}}function c4(t,n,e){for(let r of t){for(let i of r){let[o,a]=my(i,e);for(let c of i){let u=(a+o)/2;n[c]-=u,e[c]-=u}}gy(r,n,e)}yy(t,n,e)}function py(t,n,e,r){for(let i of t){let o=new sn,a=0;for(let c of i){let u=-1,s=c.map(h=>Math.abs(e[h]-n[h])),f=c.map(h=>{u=r?r[h]:++u;let p=e[h]-n[h],g=o.has(u)?p-o.get(u):0;return o.set(u,p),g}),d=[0,...nd(f)];for(let h of c)n[h]+=a,e[h]+=a;let l=bn(s);l&&(a-=bn(s,(h,p)=>(f[p]/2+d[p])*h)/l)}gy(i,n,e)}yy(t,n,e)}function gy(t,n,e){let r=fn(t,i=>fn(i,o=>n[o]));for(let i of t)for(let o of i)n[o]-=r,e[o]-=r}function yy(t,n,e){let r=t.length;if(r===1)return;let i=t.map(c=>c.flat()),o=i.map(c=>(fn(c,u=>n[u])+Gt(c,u=>e[u]))/2),a=fn(o);for(let c=0;c<r;c++){let u=a-o[c];for(let s of i[c])n[s]+=u,e[s]+=u}}function u4(t,n,e){if(t===void 0&&n===py)return Xp(hn);if(t!=null){if(typeof t=="string"){let r=t.startsWith("-"),i=r?_a:hn;switch((r?t.slice(1):t).toLowerCase()){case"value":case e:return s4(i);case"z":return f4(i);case"sum":return l4(i);case"appearance":return d4(i);case"inside-out":return Xp(i)}return Vp(x1(t))}if(typeof t=="function")return(t.length===1?Vp:h4)(t);if(We(t))return m4(t);throw new Error(`invalid order: ${t}`)}}function s4(t){return(n,e,r)=>(i,o)=>t(r[i],r[o])}function f4(t){return(n,e,r,i)=>(o,a)=>t(i[o],i[a])}function l4(t){return Ga(t,(n,e,r,i)=>io(Qn(n),o=>bn(o,a=>r[a]),o=>i[o]))}function d4(t){return Ga(t,(n,e,r,i)=>io(Qn(n),o=>e[ic(o,a=>r[a])],o=>i[o]))}function Xp(t){return Ga(t,(n,e,r,i)=>{let o=Qn(n),a=io(o,d=>e[ic(d,l=>r[l])],d=>i[d]),c=we(o,d=>bn(d,l=>r[l]),d=>i[d]),u=[],s=[],f=0;for(let d of a)f<0?(f+=c.get(d),u.push(d)):(f-=c.get(d),s.push(d));return s.reverse().concat(u)})}function Vp(t){return n=>{let e=lt(n,t);return(r,i)=>hn(e[r],e[i])}}function h4(t){return n=>We(n)?(e,r)=>t(n[e],n[r]):(e,r)=>t(n.get(e),n.get(r))}function m4(t){return Ga(hn,()=>t)}function Ga(t,n){return(e,r,i,o)=>{if(!o)throw new Error("missing channel: z");let a=new sn(n(e,r,i,o).map((c,u)=>[c,u]));return(c,u)=>t(a.get(o[c]),a.get(o[u]))}}var p4={ariaLabel:"rect"},Oi=class extends Pt{constructor(n,e={}){let{x1:r,y1:i,x2:o,y2:a}=e;super(n,{x1:{value:r,scale:"x",type:r!=null&&o==null?"band":void 0,optional:!0},y1:{value:i,scale:"y",type:i!=null&&a==null?"band":void 0,optional:!0},x2:{value:o,scale:"x",optional:!0},y2:{value:a,scale:"y",optional:!0}},e,p4),Pl(this,e),Rl(this,e)}render(n,e,r,i,o){let{x:a,y:c}=e,{x1:u,y1:s,x2:f,y2:d}=r,{marginTop:l,marginRight:h,marginBottom:p,marginLeft:g,width:b,height:v}=i,{projection:w}=o,{insetTop:S,insetRight:m,insetBottom:x,insetLeft:y}=this,{rx:M,ry:_,rx1y1:$,rx1y2:A,rx2y1:k,rx2y2:C}=this;(u||f)&&!w&&Ln(a)&&(u=f=null),(s||d)&&!w&&Ln(c)&&(s=d=null);let z=a?.bandwidth?a.bandwidth():0,L=c?.bandwidth?c.bandwidth():0;return gt("svg:g",o).call(Kt,this,i,o).call(zt,this,{},0,0).call(T=>T.selectAll().data(n).enter().call($||A||k||C?B=>B.append("path").call(It,this).call(Dl,u&&f?D=>u[D]+(f[D]<u[D]?-m:y):u?D=>u[D]+y:g+y,s&&d?D=>s[D]+(d[D]<s[D]?-x:S):s?D=>s[D]+S:l+S,u&&f?D=>f[D]-(f[D]<u[D]?-y:m):u?D=>u[D]+z-m:b-h-m,s&&d?D=>d[D]-(d[D]<s[D]?-S:x):s?D=>s[D]+L-x:v-p-x,this).call(pn,this,r):B=>B.append("rect").call(It,this).attr("x",u?f?D=>Math.min(u[D],f[D])+y:D=>u[D]+y:g+y).attr("y",s?d?D=>Math.min(s[D],d[D])+S:D=>s[D]+S:l+S).attr("width",u?f?D=>Math.max(0,Math.abs(f[D]-u[D])+z-y-m):z-y-m:b-h-g-m-y).attr("height",s?d?D=>Math.max(0,Math.abs(s[D]-d[D])+L-S-x):L-S-x:v-l-p-S-x).call(j,"rx",M).call(j,"ry",_).call(pn,this,r))).node()}};function Pl(t,{inset:n=0,insetTop:e=n,insetRight:r=n,insetBottom:i=n,insetLeft:o=n}={}){t.insetTop=Lt(e),t.insetRight=Lt(r),t.insetBottom=Lt(i),t.insetLeft=Lt(o)}function Rl(t,{r:n,rx:e,ry:r,rx1:i=n,ry1:o=n,rx2:a=n,ry2:c=n,rx1y1:u=i!==void 0?+i:o!==void 0?+o:0,rx1y2:s=i!==void 0?+i:c!==void 0?+c:0,rx2y1:f=a!==void 0?+a:o!==void 0?+o:0,rx2y2:d=a!==void 0?+a:c!==void 0?+c:0}={}){u||s||f||d?(t.rx1y1=u,t.rx1y2=s,t.rx2y1=f,t.rx2y2=d):(t.rx=At(e,"auto"),t.ry=At(r,"auto"))}function Dl(t,n,e,r,i,o){let{rx1y1:a,rx1y2:c,rx2y1:u,rx2y2:s}=o;typeof n!="function"&&(n=Zn(n)),typeof e!="function"&&(e=Zn(e)),typeof r!="function"&&(r=Zn(r)),typeof i!="function"&&(i=Zn(i));let f=Math.max(Math.abs(a+u),Math.abs(c+s)),d=Math.max(Math.abs(a+c),Math.abs(u+s));t.attr("d",l=>{let h=n(l),p=e(l),g=r(l),b=i(l),v=h>g,w=p>b,S=v?g:h,m=v?h:g,x=w?b:p,y=w?p:b,M=Math.min(1,(m-S)/f,(y-x)/d),_=M*(v?w?s:u:w?c:a),$=M*(v?w?c:a:w?s:u),A=M*(v?w?a:c:w?u:s),k=M*(v?w?u:s:w?a:c);return`M${S},${x+ga(_,k)}A${_},${_} 0 0 ${_<0?0:1} ${S+pa(_,k)},${x}H${m-pa($,A)}A${$},${$} 0 0 ${$<0?0:1} ${m},${x+ga($,A)}V${y-ga(A,$)}A${A},${A} 0 0 ${A<0?0:1} ${m-pa(A,$)},${y}H${S+pa(k,_)}A${k},${k} 0 0 ${k<0?0:1} ${S},${y-ga(k,_)}Z`})}function pa(t,n){return n<0?t:Math.abs(t)}function ga(t,n){return n<0?Math.abs(t):t}function Ol(t,n){return new Oi(t,Eg(Ng(n)))}function g4(t,n={}){return Da(n)||(n={...n,y:He,x2:mt,interval:1}),new Oi(t,Nl(Ng(Cl(n))))}function y4(t,n={}){return Da(n)||(n={...n,x:He,y2:mt,interval:1}),new Oi(t,Ll(Eg(El(n))))}var b4={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},x4={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1},Of=class extends Pt{constructor(n={}){let{anchor:e=null}=n;super(va,void 0,n,e==null?b4:x4),this.anchor=_1(e,"anchor",["top","right","bottom","left"]),Pl(this,n),e||Rl(this,n)}render(n,e,r,i,o){let{marginTop:a,marginRight:c,marginBottom:u,marginLeft:s,width:f,height:d}=i,{anchor:l,insetTop:h,insetRight:p,insetBottom:g,insetLeft:b}=this,{rx:v,ry:w,rx1y1:S,rx1y2:m,rx2y1:x,rx2y2:y}=this,M=s+b,_=f-c-p,$=a+h,A=d-u-g;return gt(l?"svg:line":S||m||x||y?"svg:path":"svg:rect",o).datum(0).call(Kt,this,i,o).call(It,this).call(pn,this,r).call(zt,this,{}).call(l==="left"?k=>k.attr("x1",M).attr("x2",M).attr("y1",$).attr("y2",A):l==="right"?k=>k.attr("x1",_).attr("x2",_).attr("y1",$).attr("y2",A):l==="top"?k=>k.attr("x1",M).attr("x2",_).attr("y1",$).attr("y2",$):l==="bottom"?k=>k.attr("x1",M).attr("x2",_).attr("y1",A).attr("y2",A):S||m||x||y?k=>k.call(Dl,M,$,_,A,this):k=>k.attr("x",M).attr("y",$).attr("width",_-M).attr("height",A-$).attr("rx",v).attr("ry",w)).node()}};function w4(t){return new Of(t)}var yf={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor",pool:!0},v4=new Set(["geometry","href","src","ariaLabel","scales","contours"]),If=class extends Pt{constructor(n,e={}){e.tip&&(e={...e,tip:!1}),e.title===void 0&&de(n)&&C1(n)&&(e={...e,title:mt});let{x:r,y:i,x1:o,x2:a,y1:c,y2:u,anchor:s,preferredAnchor:f="bottom",monospace:d,fontFamily:l=d?"ui-monospace, monospace":void 0,fontSize:h,fontStyle:p,fontVariant:g,fontWeight:b,lineHeight:v=1,lineWidth:w=20,frameAnchor:S,format:m,textAnchor:x="start",textOverflow:y,textPadding:M=8,title:_,pointerSize:$=12,pathFilter:A="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=e;super(n,{x:{value:o!=null&&a!=null?null:r,scale:"x",optional:!0},y:{value:c!=null&&u!=null?null:i,scale:"y",optional:!0},x1:{value:o,scale:"x",optional:a==null},y1:{value:c,scale:"y",optional:u==null},x2:{value:a,scale:"x",optional:o==null},y2:{value:u,scale:"y",optional:c==null},title:{value:_,optional:!0}},e,yf),this.anchor=_f(s,"anchor"),this.preferredAnchor=_f(f,"preferredAnchor"),this.frameAnchor=za(S),this.textAnchor=At(x,"middle"),this.textPadding=+M,this.pointerSize=+$,this.pathFilter=Nt(A),this.lineHeight=+v,this.lineWidth=+w,this.textOverflow=Ig(y),this.monospace=!!d,this.fontFamily=Nt(l),this.fontSize=Lt(h),this.fontStyle=Nt(p),this.fontVariant=Nt(g),this.fontWeight=Nt(b);for(let k in yf)k in this.channels&&(this[k]=yf[k]);this.splitLines=Fg(this),this.clipLine=qg(this),this.format=typeof m=="string"||typeof m=="function"?{title:m}:{...m}}render(n,e,r,i,o){let a=this,{x:c,y:u,fx:s,fy:f}=e,{ownerSVGElement:d,document:l}=o,{anchor:h,monospace:p,lineHeight:g,lineWidth:b}=this,{textPadding:v,pointerSize:w,pathFilter:S}=this,{marginTop:m,marginLeft:x}=i,{x1:y,y1:M,x2:_,y2:$,x:A=y??_,y:k=M??$}=r,C=s?s(n.fx)-x:0,z=f?f(n.fy)-m:0,[L,T]=Xi(this,i),B=xg(r,L),D=wg(r,T),H=p?kl:Sl,O=H(Cr),Y,E;"title"in r?(Y=jp.call(this,{title:r.channels.title},e),E=k4):(Y=jp.call(this,r.channels,e),E=A4);let R=new Array(n.length);for(let it of n)R[it]=E.call(a,it,n,Y,e,r);n=n.filter(it=>R[it]!=null);let F=gt("svg:g",o).call(Kt,this,i,o).call(zg,this).call(zt,this,{x:A&&c,y:k&&u}).call(it=>it.selectAll().data(n).enter().append("g").attr("transform",I=>`translate(${Math.round(B(I))},${Math.round(D(I))})`).call(It,this).call(I=>I.append("path").attr("filter",S)).call(I=>I.append("text").each(function(U){let P=Dn(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");let q=R[U];if(typeof q=="string")for(let W of a.splitLines(q))G(P,{value:a.clipLine(W)});else{let W=new Set;for(let N of q){let{label:K=""}=N;K&&W.has(K)||(W.add(K),G(P,N))}}})));function G(it,{label:I,value:U,color:P,opacity:q}){I??="",U??="";let W=P!=null||q!=null,N,K=b*100,[X]=Dr(I,K,H,O);if(X>=0)I=I.slice(0,X).trimEnd()+Cr,N=U.trim(),U="";else{(I||!U&&!W)&&(U=" "+U);let[nt]=Dr(U,K-H(I),H,O);nt>=0&&(N=U.trim(),U=U.slice(0,nt).trimEnd()+Cr)}let V=it.append("tspan").attr("x",0).attr("dy",`${g}em`).text("\u200B");I&&V.append("tspan").attr("font-weight","bold").text(I),U&&V.append(()=>l.createTextNode(U)),W&&V.append("tspan").text(" \u25A0").attr("fill",P).attr("fill-opacity",q).style("user-select","none"),N&&V.append("title").text(N)}function Z(){let{width:it,height:I}=i.facet??i;F.selectChildren().each(function(U){let{x:P,width:q,height:W}=this.getBBox();q=Math.round(q),W=Math.round(W);let N=h;if(N===void 0){let V=B(U)+C,nt=D(U)+z,ct=V+q+w+v*2<it,yt=V-q-w-v*2>0,ye=nt+W+w+v*2<I,be=nt-W-w-v*2>0;N=ct&&yt?ye&&be?a.preferredAnchor:be?"bottom":"top":ye&&be?ct?"left":"right":(ct||yt)&&(ye||be)?`${be?"bottom":"top"}-${ct?"left":"right"}`:a.preferredAnchor}let K=this.firstChild,X=this.lastChild;if(K.setAttribute("d",S4(N,w,v,q,W)),P)for(let V of X.childNodes)V.setAttribute("x",-P);X.setAttribute("y",`${+_4(N,X.childNodes.length,g).toFixed(6)}em`),X.setAttribute("transform",`translate(${$4(N,w,v,q,W)})`)}),F.attr("visibility",null)}return n.length&&(F.attr("visibility","hidden"),d.isConnected?Promise.resolve().then(Z):typeof requestAnimationFrame<"u"&&requestAnimationFrame(Z)),F.node()}};function M4(t,{x:n,y:e,...r}={}){return r.frameAnchor===void 0&&([n,e]=Ge(n,e)),new If(t,{...r,x:n,y:e})}function _4(t,n,e){return/^top(?:-|$)/.test(t)?.94-e:-.29-n*e}function $4(t,n,e,r,i){switch(t){case"middle":return[-r/2,i/2];case"top-left":return[e,n/2+e];case"top":return[-r/2,n/2+e];case"top-right":return[-r-e,n/2+e];case"right":return[-n/2-r-e,i/2];case"bottom-left":return[e,-n/2-e];case"bottom":return[-r/2,-n/2-e];case"bottom-right":return[-r-e,-n/2-e];case"left":return[e+n/2,i/2]}}function S4(t,n,e,r,i){let o=r+e*2,a=i+e*2;switch(t){case"middle":return`M${-o/2},${-a/2}h${o}v${a}h${-o}z`;case"top-left":return`M0,0l${n/2},${n/2}h${o-n/2}v${a}h${-o}z`;case"top":return`M0,0l${n/2},${n/2}h${(o-n)/2}v${a}h${-o}v${-a}h${(o-n)/2}z`;case"top-right":return`M0,0l${-n/2},${n/2}h${n/2-o}v${a}h${o}z`;case"right":return`M0,0l${-n/2},${-n/2}v${n/2-a/2}h${-o}v${a}h${o}v${n/2-a/2}z`;case"bottom-left":return`M0,0l${n/2},${-n/2}h${o-n/2}v${-a}h${-o}z`;case"bottom":return`M0,0l${n/2},${-n/2}h${(o-n)/2}v${-a}h${-o}v${a}h${(o-n)/2}z`;case"bottom-right":return`M0,0l${-n/2},${-n/2}h${n/2-o}v${-a}h${o}z`;case"left":return`M0,0l${n/2},${-n/2}v${n/2-a/2}h${o}v${a}h${-o}v${n/2-a/2}z`}}function jp(t,n){let e={},r=this.format;r=Zp(r,t,"x"),r=Zp(r,t,"y"),this.format=r;for(let i in r){let o=r[i];if(!(o===null||o===!1))if(i==="fx"||i==="fy")e[i]=!0;else{let a=vp(t,i);a&&(e[i]=a)}}for(let i in t){if(i in e||i in r||v4.has(i)||(i==="x"||i==="y")&&t.geometry)continue;let o=vp(t,i);if(o){if(o.scale==null&&o.defaultScale)continue;e[i]=o}}this.facet&&(n.fx&&!("fx"in r)&&(e.fx=!0),n.fy&&!("fy"in r)&&(e.fy=!0));for(let i in e){let o=this.format[i],a=n[i],c=e[i]?.value??a?.domain()??[];typeof o=="string"?this.format[i]=(Ht(c)?oe:ee)(o):(o===void 0||o===!0)&&(this.format[i]=a?.bandwidth?Tl(a,a.domain()):E1(c)?String:Rr)}return e}function Zp(t,n,e){if(!(e in t))return t;let r=`${e}1`,i=`${e}2`;if((r in t||!(r in n))&&(i in t||!(i in n)))return t;let o=Object.entries(t),a=t[e];return o.splice(o.findIndex(([c])=>c===e)+1,0,[r,a],[i,a]),Object.fromEntries(o)}function k4(t,n,{title:e}){return this.format.title(e.value[t],t)}function*A4(t,n,e,r,i){for(let o in e){if(o==="fx"||o==="fy"){yield{label:Ea(r,e,o),value:this.format[o](n[o],t)};continue}if(o==="x1"&&"x2"in e||o==="y1"&&"y2"in e)continue;let a=e[o];if(o==="x2"&&"x1"in e)yield{label:Qp(r,e,"x"),value:Kp(this.format.x2,e.x1,a,t)};else if(o==="y2"&&"y1"in e)yield{label:Qp(r,e,"y"),value:Kp(this.format.y2,e.y1,a,t)};else{let c=a.value[t],u=a.scale;if(!En(c)&&u==null)continue;yield{label:Ea(r,e,o),value:this.format[o](c,t),color:u==="color"?i[o][t]:null,opacity:u==="opacity"?i[o][t]:null}}}}function Kp(t,n,e,r){return e.hint?.length?`${t(e.value[r]-n.value[r],r)}`:`${t(n.value[r],r)}\u2013${t(e.value[r],r)}`}function Qp(t,n,e){let r=Ea(t,n,`${e}1`,e),i=Ea(t,n,`${e}2`,e);return r===i?r:`${r}\u2013${i}`}function Ea(t,n,e,r=e){let i=n[e],o=t[i?.scale??e];return String(o?.label??i?.label??r)}function Il(t={}){let{facet:n,style:e,title:r,subtitle:i,caption:o,ariaLabel:a,ariaDescription:c}=t,u=xl(t.className),s=t.marks===void 0?[]:t1(t.marks);s.push(...P4(s));let f=N4(n,t),d=new Map;for(let O of s){let Y=n1(O,f,t);Y&&d.set(O,Y)}let l=new Map;f&&Ai(l,[f],t),Ai(l,d,t);let h=t1(R4(s,l,t));for(let O of h){let Y=n1(O,f,t);Y&&d.set(O,Y)}s.unshift(...h);let p=G3(l,t);if(p!==void 0){let O=f?hf(p,f):void 0;for(let E of s){if(E.facet===null||E.facet==="super")continue;let R=d.get(E);R!==void 0&&(R.facetsIndex=E.fx!=null||E.fy!=null?hf(p,R):O)}let Y=new Set;for(let{facetsIndex:E}of d.values())E?.forEach((R,F)=>{R?.length>0&&Y.add(F)});p.forEach(0<Y.size&&Y.size<p.length?(E,R)=>E.empty=!Y.has(R):E=>E.empty=!1);for(let E of s)if(E.facet==="exclude"){let R=d.get(E);R!==void 0&&(R.facetsIndex=j3(R.facetsIndex))}}for(let O of ft.keys())$a(t[O])&&O!=="fx"&&O!=="fy"&&l.set(O,[]);let g=new Map;for(let O of s){if(g.has(O))throw new Error("duplicate mark; each mark must be unique");let{facetsIndex:Y,channels:E}=d.get(O)??{},{data:R,facets:F,channels:G}=O.initialize(Y,E,t);zl(G,t),g.set(O,{data:R,facets:F,channels:G})}let b=Tf(Ai(l,g,t),t),v=H3(b,s,t);d3(b,v);let w=Cp(b),{fx:S,fy:m}=w,x=S||m?sg(b,v):v,y=S||m?B4(w,v):v,M=fl(t),_=M.document,$=jr("svg").call(_.documentElement),A=$;M.ownerSVGElement=$,M.className=u,M.projection=M5(t,x),M.path=function(){return qo(this.projection??N5(w))},M.filterFacets=(O,Y)=>hf(p,{channels:Y,groups:vl(O,Y)}),M.getMarkState=O=>{let Y=g.get(O),E=d.get(O);return{...Y,channels:{...Y.channels,...E?.channels}}},M.dispatchValue=O=>{A.value!==O&&(A.value=O,A.dispatchEvent(new M.document.defaultView.Event("input",{bubbles:!0})))};let k=new Set;for(let[O,Y]of g)if(O.initializer!=null){let E=O.facet==="super"?y:x,R=O.initializer(Y.data,Y.facets,Y.channels,w,E,M);if(R.data!==void 0&&(Y.data=R.data),R.facets!==void 0&&(Y.facets=R.facets),R.channels!==void 0){let{fx:F,fy:G,...Z}=R.channels;E4(Z),Object.assign(Y.channels,Z);for(let it of Object.values(Z)){let{scale:I}=it;I!=null&&!W6(ft.get(I))&&(by(it,t),k.add(I))}(F!=null||G!=null)&&d.set(O,!0)}}if(k.size){let O=new Map;Ai(O,g,t,F=>k.has(F)),Ai(l,g,t,F=>k.has(F));let Y=q4(Tf(O,t),b),{scales:E,...R}=Cp(Y);Object.assign(b,Y),Object.assign(w,R),Object.assign(w.scales,E)}let C,z;p!==void 0&&(C={x:S?.domain(),y:m?.domain()},p=X3(p,C),z=V3(S,m,v));for(let[O,Y]of g)Y.values=O.scale(Y.channels,w,M);let{width:L,height:T}=v;Dn($).attr("class",u).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",L).attr("height",T).attr("viewBox",`0 0 ${L} ${T}`).attr("aria-label",a).attr("aria-description",c).call(O=>O.append("style").text(`:where(.${u}) {
|
|
50
50
|
--plot-background: white;
|
|
51
51
|
display: block;
|
|
52
52
|
height: auto;
|
|
@@ -56,4 +56,4 @@ ${g}`)).style("margin-left",f?`${+f}px`:null).style("width",l===void 0?null:`${+
|
|
|
56
56
|
:where(.${u} text),
|
|
57
57
|
:where(.${u} tspan) {
|
|
58
58
|
white-space: pre;
|
|
59
|
-
}`)).call(pl,e);for(let L of f){let{channels:I,values:q,facets:U}=g.get(L);if(m===void 0||L.facet==="super"){let F=null;if(U&&(F=U[0],F=L.filter(F,I,q),F.length===0))continue;let K=L.render(F,w,q,y,_);if(K==null)continue;S.appendChild(K)}else{let F;for(let K of m){if(!(L.facetAnchor?.(m,T,K)??!K.empty))continue;let et=null;if(U){let B=d.has(L);if(et=U[B?K.i:0],et=L.filter(et,I,q),et.length===0)continue;!B&&et===U[0]&&(et=h6(et)),et.fx=K.x,et.fy=K.y,et.fi=K.i}let at=L.render(et,w,q,b,_);if(at!=null){(F??=Rn(S).append("g")).append(()=>at).datum(K);for(let B of["aria-label","aria-description","aria-hidden","transform"])at.hasAttribute(B)&&(F.attr(B,at.getAttribute(B)),at.removeAttribute(B))}}F?.selectChildren().each(D)}}let O=B8(x,_,t),{figure:R=r!=null||i!=null||o!=null||O.length>0}=t;R&&(C=M.createElement("figure"),C.className=`${u}-figure`,C.style.maxWidth="initial",r!=null&&C.append(G1(M,r,"h2")),i!=null&&C.append(G1(M,i,"h3")),C.append(...O,S),o!=null&&C.append(m4(M,o)),"value"in S&&(C.value=S.value,delete S.value)),C.scale=o3(w.scales,_),C.legend=O8(x,_,t);let W=a5();return W>0&&Rn(S).append("text").attr("x",P).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("\u26A0\uFE0F").append("title").text(`${W.toLocaleString("en-US")} warning${W===1?"":"s"}. Please check the console.`),C}function G1(t,n,e){if(n.ownerDocument)return n;let r=t.createElement(e);return r.append(n),r}function m4(t,n){let e=t.createElement("figcaption");return e.append(n),e}function H1(t){return t.flat(1/0).filter(n=>n!=null).map(g4)}function g4(t){return typeof t.render=="function"?t:new Ls(t)}var Ls=class extends Et{constructor(n){if(typeof n!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=n}render(){}};function El(t,n){for(let e in t)ly(t[e],n);return t}function ly(t,n){let{scale:e,transform:r=!0}=t;if(e==null||!r)return;let{type:i,percent:o,interval:a,transform:c=o?u=>u==null?NaN:u*100:xm(a,i)}=n[e]??{};c!=null&&(t.value=mt(t.value,c),t.transform=!1)}function y4(t){for(let n in t)zm(n,t[n])}function _i(t,n,e,r=l6){for(let{channels:i}of n.values())for(let o in i){let a=i[o],{scale:c}=a;if(c!=null&&r(c))if(c==="projection"){if(!h5(e)){let u=e.x?.domain===void 0,f=e.y?.domain===void 0;if(u||f){let[s,d]=m5(a);u&&hs(t,"x",s),f&&hs(t,"y",d)}}}else hs(t,c,a)}return t}function hs(t,n,e){let r=t.get(n);r!==void 0?r.push(e):t.set(n,[e])}function b4(t,n){if(t==null)return;let{x:e,y:r}=t;if(e==null&&r==null)return;let i=kr(t.data);if(i==null)throw new Error("missing facet data");let o={};e!=null&&(o.fx=Ti(i,{value:e,scale:"fx"})),r!=null&&(o.fy=Ti(i,{value:r,scale:"fy"})),El(o,n);let a=ml(i,o);return{channels:o,groups:a,data:t.data}}function X1(t,n,e){if(t.facet===null||t.facet==="super")return;let{fx:r,fy:i}=t;if(r!=null||i!=null){let u=kr(t.data??r??i);if(u===void 0)throw new Error(`missing facet data in ${t.ariaLabel}`);if(u===null)return;let f={};return r!=null&&(f.fx=Ti(u,{value:r,scale:"fx"})),i!=null&&(f.fy=Ti(u,{value:i,scale:"fy"})),El(f,e),{channels:f,groups:ml(u,f)}}if(n===void 0)return;let{channels:o,groups:a,data:c}=n;if(t.facet!=="auto"||t.data===c)return{channels:o,groups:a};c.length>0&&(a.size>1||a.size===1&&o.fx&&o.fy&&[...a][0][1].size>1)&&ki(kr(t.data))===ki(c)&&fe(`Warning: the ${t.ariaLabel} mark appears to use faceted data, but isn\u2019t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function w4(t,n={}){return Tr({...n,x:null,y:null},(e,r,i,o,a,c)=>c.getMarkState(t))}function x4(t){let n=[];for(let e of t){let r=e.tip;if(r){r===!0?r={}:typeof r=="string"&&(r={pointer:r});let{pointer:i,preferredAnchor:o}=r;i=/^x$/i.test(i)?H3:/^y$/i.test(i)?N1:G3,r=i(w4(e,r)),r.title=null,o===void 0&&(r.preferredAnchor=i===N1?"left":"bottom");let a=f4(e.data,r);a.facet=e.facet,a.facetAnchor=e.facetAnchor,n.push(a)}}return n}function v4(t,n,e){let{projection:r,x:i={},y:o={},fx:a={},fy:c={},axis:u,grid:f,facet:s={},facet:{axis:d=u,grid:l}=s,x:{axis:h=u,grid:m=h===null?null:f}=i,y:{axis:g=u,grid:x=g===null?null:f}=o,fx:{axis:v=d,grid:w=v===null?null:l}=a,fy:{axis:$=d,grid:p=$===null?null:l}=c}=e;(r||!xa(i)&&!V1("x",t))&&(h=m=null),(r||!xa(o)&&!V1("y",t))&&(g=x=null),n.has("fx")||(v=w=null),n.has("fy")||($=p=null),h===void 0&&(h=!ma(t,"x")),g===void 0&&(g=!ma(t,"y")),v===void 0&&(v=!ma(t,"fx")),$===void 0&&($=!ma(t,"fy")),h===!0&&(h="bottom"),g===!0&&(g="left"),v===!0&&(v=h==="top"||h===null?"bottom":"top"),$===!0&&($=g==="right"||g===null?"left":"right");let b=[];return pa(b,p,A8,c),ha(b,$,x8,"right","left",s,c),pa(b,w,C8,a),ha(b,v,v8,"top","bottom",s,a),pa(b,x,k8,o),ha(b,g,Yg,"left","right",e,o),pa(b,m,T8,i),ha(b,h,Wg,"bottom","top",e,i),b}function ha(t,n,e,r,i,o,a){if(!n)return;let c=_4(n);a=M4(c?r:n,o,a);let{line:u}=a;(e===Yg||e===Wg)&&u&&!Ai(u)&&t.push(c4($4(a))),t.push(e(a)),c&&t.push(e({...a,anchor:i,label:null}))}function pa(t,n,e,r){!n||Ai(n)||t.push(e(S4(n,r)))}function _4(t){return/^\s*both\s*$/i.test(t)}function M4(t,n,{line:e=n.line,ticks:r,tickSize:i,tickSpacing:o,tickPadding:a,tickFormat:c,tickRotate:u,fontVariant:f,ariaLabel:s,ariaDescription:d,label:l=n.label,labelAnchor:h,labelArrow:m=n.labelArrow,labelOffset:g}){return{anchor:t,line:e,ticks:r,tickSize:i,tickSpacing:o,tickPadding:a,tickFormat:c,tickRotate:u,fontVariant:f,ariaLabel:s,ariaDescription:d,label:l,labelAnchor:h,labelArrow:m,labelOffset:g}}function $4(t){let{anchor:n,line:e}=t;return{anchor:n,facetAnchor:n+"-empty",stroke:e===!0?void 0:e}}function S4(t,{stroke:n=La(t)?t:void 0,ticks:e=k4(t)?t:void 0,tickSpacing:r,ariaLabel:i,ariaDescription:o}){return{stroke:n,ticks:e,tickSpacing:r,ariaLabel:i,ariaDescription:o}}function k4(t){switch(typeof t){case"number":return!0;case"string":return!La(t)}return le(t)||typeof t?.range=="function"}function ma(t,n){let e=`${n}-axis `;return t.some(r=>r.ariaLabel?.startsWith(e))}function V1(t,n){for(let e of n)for(let r in e.channels){let{scale:i}=e.channels[r];if(i===t||i==="projection")return!0}return!1}function A4(t,n){for(let e in t){let r=t[e],i=n[e];r.label===void 0&&i&&(r.label=i.label)}return t}function T4({fx:t,fy:n},e){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:a,width:c,height:u}=fl(e),f=t&&j1(t),s=n&&j1(n);return{marginTop:n?s[0]:r,marginRight:t?c-f[1]:i,marginBottom:n?u-s[1]:o,marginLeft:t?f[0]:a,inset:{marginTop:e.marginTop,marginRight:e.marginRight,marginBottom:e.marginBottom,marginLeft:e.marginLeft},width:c,height:u}}function j1(t){let n=t.domain();if(n.length===0)return[0,t.bandwidth()];let e=t(n[0]),r=t(n[n.length-1]);return r<e&&([e,r]=[r,e]),[e,r+t.bandwidth()]}var C4=new Map([["basis",Rp],["basis-closed",Pp],["basis-open",Ip],["bundle",zp],["bump-x",kp],["bump-y",Ap],["cardinal",Fp],["cardinal-closed",Bp],["cardinal-open",qp],["catmull-rom",Wp],["catmull-rom-closed",Gp],["catmull-rom-open",Xp],["linear",ze],["linear-closed",jp],["monotone-x",Qp],["monotone-y",Jp],["natural",n1],["step",e1],["step-after",i1],["step-before",r1]]);function dy(t=ze,n){if(typeof t=="function")return t;let e=C4.get(`${t}`.toLowerCase());if(!e)throw new Error(`unknown curve: ${t}`);if(n!==void 0){if("beta"in e)return e.beta(n);if("tension"in e)return e.tension(n);if("alpha"in e)return e.alpha(n)}return e}function hy(t=Nr,n){return typeof t!="function"&&`${t}`.toLowerCase()==="auto"?Nr:dy(t,n)}function Nr(t){return ze(t)}function py(t={y:"count"},n={}){[t,n]=Rl(t,n);let{x:e,y:r}=n;return Nl(Aa(e,n,ht),null,null,r,t,Ui(n))}function my(t={x:"count"},n={}){[t,n]=Rl(t,n);let{x:e,y:r}=n;return Nl(null,Aa(r,n,ht),e,null,t,Gi(n))}function E4(t={fill:"count"},n={}){[t,n]=Rl(t,n);let{x:e,y:r}=N4(n);return Nl(e,r,null,null,t,Ui(Gi(n)))}function gy(t,n,e={}){if(e?.interval==null)return e;let{reduce:r=il}=e,i={filter:null};return e[n]!=null&&(i[n]=r),e[`${n}1`]!=null&&(i[`${n}1`]=r),e[`${n}2`]!=null&&(i[`${n}2`]=r),t(i,e)}function yy({x:t=qe,...n}={}){return gy(py,"y",Pr({x:t,...Ml(n)},"x"))}function by({y:t=qe,...n}={}){return gy(my,"x",Pr({y:t,..._l(n)},"y"))}function Nl(t,n,e,r,{data:i=rl,filter:o=$a,sort:a,reverse:c,...u}={},f={}){t=Z1(t),n=Z1(n),u=L4(u,f),i=vy(i,ht),a=a==null?void 0:wy("sort",a,f),o=o==null?void 0:xy("filter",o,f),e!=null&&Mr(u,"x","x1","x2")&&(e=null),r!=null&&Mr(u,"y","y1","y2")&&(r=null);let[s,d]=Ft(t),[l,h]=Ft(t),[m,g]=Ft(n),[x,v]=Ft(n),[w,$]=e!=null?[e,"x"]:r!=null?[r,"y"]:[],[p,b]=Ft(w),{x:y,y:_,z:M,fill:S,stroke:C,x1:k,x2:T,y1:D,y2:P,domain:A,cumulative:O,thresholds:R,interval:W,...L}=f,[I,q]=Ft(M),[U]=ln(S),[F]=ln(C),[K,et]=Ft(U),[at,B]=Ft(F);return{..."z"in f&&{z:I||M},..."fill"in f&&{fill:K||S},..."stroke"in f&&{stroke:at||C},...Fi(L,(G,N,z)=>{let Y=Ma(st(G,w),z?.[$]),E=st(G,M),nt=st(G,U),H=st(G,F),J=Dm(u,{z:E,fill:nt,stroke:H}),rt=[],ut=[],En=Y&&b([]),Or=E&&q([]),me=nt&&et([]),Ly=H&&B([]),Fl=t&&d([]),Py=t&&h([]),Bl=n&&g([]),Dy=n&&v([]),Iy=I4(t,n,G),Oy=0;for(let Xe of u)Xe.initialize(G);a&&a.initialize(G),o&&o.initialize(G);for(let Xe of N){let ql=[];for(let Ve of u)Ve.scope("facet",Xe);a&&a.scope("facet",Xe),o&&o.scope("facet",Xe);for(let[Ve,zy]of $i(Xe,J))for(let[Fy,Zi]of $i(zy,Y))for(let[pn,Nn]of Iy(Zi))if(J&&(Nn.z=Ve),!(o&&!o.reduce(pn,Nn))){ql.push(Oy++),ut.push(i.reduceIndex(pn,G,Nn)),Y&&En.push(Fy),E&&Or.push(J===E?Ve:E[(pn.length>0?pn:Zi)[0]]),nt&&me.push(J===nt?Ve:nt[(pn.length>0?pn:Zi)[0]]),H&&Ly.push(J===H?Ve:H[(pn.length>0?pn:Zi)[0]]),Fl&&(Fl.push(Nn.x1),Py.push(Nn.x2)),Bl&&(Bl.push(Nn.y1),Dy.push(Nn.y2));for(let By of u)By.reduce(pn,Nn);a&&a.reduce(pn,Nn)}rt.push(ql)}return Im(rt,a,c),{data:ut,facets:rt}}),...!Mr(u,"x")&&(s?{x1:s,x2:l,x:_a(s,l)}:{x:y,x1:k,x2:T}),...!Mr(u,"y")&&(m?{y1:m,y2:x,y:_a(m,x)}:{y:_,y1:D,y2:P}),...p&&{[$]:p},...Object.fromEntries(u.map(({name:G,output:N})=>[G,N]))}}function Rl({cumulative:t,domain:n,thresholds:e,interval:r,...i},o){return[i,{cumulative:t,domain:n,thresholds:e,interval:r,...o}]}function Aa(t,{cumulative:n,domain:e,thresholds:r,interval:i},o){return t={...Ii(t)},t.domain===void 0&&(t.domain=e),t.cumulative===void 0&&(t.cumulative=n),t.thresholds===void 0&&(t.thresholds=r),t.interval===void 0&&(t.interval=i),t.value===void 0&&(t.value=o),t.thresholds=R4(t.thresholds,t.interval),t}function N4(t){let{x:n,y:e}=t;return n=Aa(n,t),e=Aa(e,t),[n.value,e.value]=We(n.value,e.value),{x:n,y:e}}function Z1(t){if(t==null)return;let{value:n,cumulative:e,domain:r=Wt,thresholds:i}=t,o=a=>{let c=st(a,n),u;if(qt(c)||D4(i)){c=mt(c,pm,Float64Array);let[s,d]=typeof r=="function"?r(c):r,l=typeof i=="function"&&!_r(i)?i(c,s,d):i;typeof l=="number"&&(l=Bo(s,d,l)),_r(l)&&(r===Wt&&(s=l.floor(s),d=l.offset(l.floor(d))),l=l.range(s,l.offset(d))),u=l}else{c=Sn(c);let[s,d]=typeof r=="function"?r(c):r,l=typeof i=="function"&&!_r(i)?i(c,s,d):i;if(typeof l=="number")if(r===Wt){let h=Ke(s,d,l);if(isFinite(h))if(h>0){let m=Math.round(s/h),g=Math.round(d/h);m*h<=s||--m,g*h>d||++g;let x=g-m+1;l=new Float64Array(x);for(let v=0;v<x;++v)l[v]=(m+v)*h}else if(h<0){h=-h;let m=Math.round(s*h),g=Math.round(d*h);m/h<=s||--m,g/h>d||++g;let x=g-m+1;l=new Float64Array(x);for(let v=0;v<x;++v)l[v]=(m+v)/h}else l=[s];else l=[s]}else l=be(s,d,l);else _r(l)&&(r===Wt&&(s=l.floor(s),d=l.offset(l.floor(d))),l=l.range(s,l.offset(d)));u=l}let f=[];if(u.length===1)f.push([u[0],u[0]]);else for(let s=1;s<u.length;++s)f.push([u[s-1],u[s]]);return f.bin=(e<0?z4:e>0?O4:Ll)(f,u,c),f};return o.label=Ue(n),o}function R4(t,n,e=K1){if(t===void 0)return n===void 0?e:Rr(n);if(typeof t=="string"){switch(t.toLowerCase()){case"freedman-diaconis":return id;case"scott":return tc;case"sturges":return Jl;case"auto":return K1}return Ws(t)}return t}function L4(t,n){return Nm(t,n,wy)}function wy(t,n,e){return nl(t,n,e,xy)}function xy(t,n,e){return el(t,n,e,vy)}function vy(t,n){return Ia(t,n,P4)}function P4(t){switch(`${t}`.toLowerCase()){case"x":return F4;case"x1":return q4;case"x2":return Y4;case"y":return B4;case"y1":return W4;case"y2":return U4;case"z":return Om}throw new Error(`invalid bin reduce: ${t}`)}function K1(t,n,e){return Math.min(200,tc(t,n,e))}function D4(t){return y6(t)||le(t)&&qt(t)}function I4(t,n,e){let r=t?.(e),i=n?.(e);return r&&i?function*(o){let a=r.bin(o);for(let[c,[u,f]]of r.entries()){let s=i.bin(a[c]);for(let[d,[l,h]]of i.entries())yield[s[d],{data:e,x1:u,y1:l,x2:f,y2:h}]}}:r?function*(o){let a=r.bin(o);for(let[c,[u,f]]of r.entries())yield[a[c],{data:e,x1:u,x2:f}]}:function*(o){let a=i.bin(o);for(let[c,[u,f]]of i.entries())yield[a[c],{data:e,y1:u,y2:f}]}}function Ll(t,n,e){return n=Sn(n),r=>{let i=t.map(()=>[]);for(let o of r)i[tr(n,e[o])-1]?.push(o);return i}}function O4(t,n,e){let r=Ll(t,n,e);return i=>{let o=r(i);for(let a=1,c=o.length;a<c;++a){let u=o[a-1],f=o[a];for(let s of u)f.push(s)}return o}}function z4(t,n,e){let r=Ll(t,n,e);return i=>{let o=r(i);for(let a=o.length-2;a>=0;--a){let c=o[a+1],u=o[a];for(let f of c)u.push(f)}return o}}function _y(t,n){let e=(+t+ +n)/2;return t instanceof Date?new Date(e):e}var F4={reduceIndex(t,n,{x1:e,x2:r}){return _y(e,r)}},B4={reduceIndex(t,n,{y1:e,y2:r}){return _y(e,r)}},q4={reduceIndex(t,n,{x1:e}){return e}},Y4={reduceIndex(t,n,{x2:e}){return e}},W4={reduceIndex(t,n,{y1:e}){return e}},U4={reduceIndex(t,n,{y2:e}){return e}},G4={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},H4={ariaLabel:"area-line",fillOpacity:.3,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Ri=class extends Et{constructor(n,e={},r=G4){let{x1:i,y1:o,x2:a,y2:c,z:u,curve:f,tension:s}=e;super(n,{x1:{value:i,scale:"x"},y1:{value:o,scale:"y"},x2:{value:a,scale:"x",optional:!0},y2:{value:c,scale:"y",optional:!0},z:{value:Xs(e),optional:!0}},e,r),this.z=u,this.curve=dy(f,s)}filter(n){return n}render(n,e,r,i,o){let{x1:a,y1:c,x2:u=a,y2:f=c}=r;return pt("svg:g",o).call(Xt,this,i,o).call(Dt,this,e,0,0).call(s=>s.selectAll().data(dl(n,[a,c,u,f],this,r)).enter().append("path").call(Pt,this).call(ll,this,r).attr("d",Df().curve(this.curve).defined(d=>d>=0).x0(d=>a[d]).y0(d=>c[d]).x1(d=>u[d]).y1(d=>f[d]))).node()}},Ta=class extends Ri{constructor(n,e={}){super(n,e,H4),Wi(this,e)}render(n,e,r,i,o){let{x1:a,y1:c,x2:u=a,y2:f=c}=r;return pt("svg:g",o).call(Xt,this,i,o).call(Dt,this,e,0,0).call(s=>s.selectAll().data(dl(n,[a,c,u,f],this,r)).enter().append("g").call(Pt,this).call(ll,this,r).call(d=>d.append("path").attr("stroke","none").attr("d",Df().curve(this.curve).defined(l=>l>=0).x0(l=>a[l]).y0(l=>c[l]).x1(l=>u[l]).y1(l=>f[l]))).call(d=>d.append("path").call(yg,this,r,o).attr("fill","none").attr("transform",kt?`translate(${kt},${kt})`:null).attr("d",oa().curve(this.curve).defined(l=>l>=0).x(l=>u[l]).y(l=>f[l])))).node()}};function X4(t,n){let{x:e,y:r,line:i,color:o,stroke:a=o,fill:c=o,z:u=e===c||e===a?null:void 0,...f}=by(n);return new(i?Ta:Ri)(t,$l({...f,x:e,y1:r,y2:void 0,z:u,stroke:a,fill:c}))}function V4(t,n){let{x:e,y:r,line:i,color:o,stroke:a=o,fill:c=o,z:u=r===c||r===a?null:void 0,...f}=yy(n);return new(i?Ta:Ri)(t,Sl({...f,x1:e,x2:void 0,y:r,z:u,stroke:a,fill:c}))}var j4={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Ps=class extends Et{constructor(n,e={}){let{x1:r,y1:i,x2:o,y2:a,curve:c,tension:u}=e;super(n,{x1:{value:r,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:a,scale:"y",optional:!0}},e,j4),this.curve=hy(c,u),Wi(this,e)}project(n,e,r){this.curve!==Nr&&super.project(n,e,r)}render(n,e,r,i,o){let{x1:a,y1:c,x2:u=a,y2:f=c}=r,{curve:s}=this;return pt("svg:g",o).call(Xt,this,i,o).call(Dt,this,e).call(d=>d.selectAll().data(n).enter().append("path").call(Pt,this).attr("d",s===Nr&&o.projection?Z4(o.path(),a,c,u,f):l=>{let h=Pn(),m=s(h);return m.lineStart(),m.point(a[l],c[l]),m.point(u[l],f[l]),m.lineEnd(),h}).call(dn,this,r).call(yl,this,r,o)).node()}};function Z4(t,n,e,r,i){return n=Sn(n),e=Sn(e),r=Sn(r),i=Sn(i),o=>t({type:"LineString",coordinates:[[n[o],e[o]],[r[o],i[o]]]})}function My(t,{x:n,x1:e,x2:r,y:i,y1:o,y2:a,...c}={}){return[e,r]=Q1(n,e,r),[o,a]=Q1(i,o,a),new Ps(t,{...c,x1:e,x2:r,y1:o,y2:a})}function Q1(t,n,e){if(t===void 0){if(n===void 0){if(e!==void 0)return[e]}else if(e===void 0)return[n]}else{if(n===void 0)return e===void 0?[t]:[t,e];if(e===void 0)return[t,n]}return[n,e]}var K4={ariaLabel:"bar"},Li=class extends Et{constructor(n,e,r={},i=K4){super(n,e,r,i),kl(this,r),Al(this,r)}render(n,e,r,i,o){let{rx:a,ry:c,rx1y1:u,rx1y2:f,rx2y1:s,rx2y2:d}=this,l=this._x(e,r,i),h=this._y(e,r,i),m=this._width(e,r,i),g=this._height(e,r,i);return pt("svg:g",o).call(Xt,this,i,o).call(this._transform,this,e).call(x=>x.selectAll().data(n).enter().call(u||f||s||d?v=>v.append("path").call(Pt,this).call(Tl,l,h,J1(l,m),J1(h,g),this).call(dn,this,r):v=>v.append("rect").call(Pt,this).attr("x",l).attr("width",m).attr("y",h).attr("height",g).call(X,"rx",a).call(X,"ry",c).call(dn,this,r))).node()}_x(n,{x:e},{marginLeft:r}){let{insetLeft:i}=this;return e?o=>e[o]+i:r+i}_y(n,{y:e},{marginTop:r}){let{insetTop:i}=this;return e?o=>e[o]+i:r+i}_width({x:n},{x:e},{marginRight:r,marginLeft:i,width:o}){let{insetLeft:a,insetRight:c}=this,u=e&&n?n.bandwidth():o-r-i;return Math.max(0,u-a-c)}_height({y:n},{y:e},{marginTop:r,marginBottom:i,height:o}){let{insetTop:a,insetBottom:c}=this,u=e&&n?n.bandwidth():o-r-i;return Math.max(0,u-a-c)}};function J1(t,n){return typeof t=="function"&&typeof n=="function"?e=>t(e)+n(e):typeof t=="function"?e=>t(e)+n:typeof n=="function"?e=>t+n(e):t+n}var Ds=class extends Li{constructor(n,e={},r){let{x1:i,x2:o,y:a}=e;super(n,{x1:{value:i,scale:"x"},x2:{value:o,scale:"x"},y:{value:a,scale:"y",type:"band",optional:!0}},e,r)}_transform(n,e,{x:r}){n.call(Dt,e,{x:r},0,0)}_x({x:n},{x1:e,x2:r},{marginLeft:i}){let{insetLeft:o}=this;return Cn(n)?i+o:a=>Math.min(e[a],r[a])+o}_width({x:n},{x1:e,x2:r},{marginRight:i,marginLeft:o,width:a}){let{insetLeft:c,insetRight:u}=this;return Cn(n)?a-i-o-c-u:f=>Math.max(0,Math.abs(r[f]-e[f])-c-u)}},Is=class extends Li{constructor(n,e={},r){let{x:i,y1:o,y2:a}=e;super(n,{y1:{value:o,scale:"y"},y2:{value:a,scale:"y"},x:{value:i,scale:"x",type:"band",optional:!0}},e,r)}_transform(n,e,{y:r}){n.call(Dt,e,{y:r},0,0)}_y({y:n},{y1:e,y2:r},{marginTop:i}){let{insetTop:o}=this;return Cn(n)?i+o:a=>Math.min(e[a],r[a])+o}_height({y:n},{y1:e,y2:r},{marginTop:i,marginBottom:o,height:a}){let{insetTop:c,insetBottom:u}=this;return Cn(n)?a-i-o-c-u:f=>Math.max(0,Math.abs(r[f]-e[f])-c-u)}};function Pl(t,n={}){return Na(n)||(n={...n,y:qe,x2:ht}),new Ds(t,$l(Sg(_l(n))))}function Q4(t,n={}){return Na(n)||(n={...n,x:qe,y2:ht}),new Is(t,Sl(kg(Ml(n))))}var J4={ariaLabel:"cell"},Os=class extends Li{constructor(n,{x:e,y:r,...i}={}){super(n,{x:{value:e,scale:"x",type:"band",optional:!0},y:{value:r,scale:"y",type:"band",optional:!0}},i,J4)}_transform(n,e){n.call(Dt,e,{},0,0)}};function Ua(t,{x:n,y:e,...r}={}){return[n,e]=We(n,e),new Os(t,{...r,x:n,y:e})}var t7={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function n7(t){return t.sort===void 0&&t.reverse===void 0?I6({channel:"-r"},t):t}var zs=class extends Et{constructor(n,e={}){let{x:r,y:i,r:o,rotate:a,symbol:c=br,frameAnchor:u}=e,[f,s]=Lt(a,0),[d,l]=P6(c),[h,m]=Lt(o,d==null?3:4.5);super(n,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:h,scale:"r",filter:Ca,optional:!0},rotate:{value:f,optional:!0},symbol:{value:d,scale:"auto",optional:!0}},n7(e),t7),this.r=m,this.rotate=s,this.symbol=l,this.frameAnchor=Pa(u);let{channels:g}=this,{symbol:x}=g;if(x){let{fill:v,stroke:w}=g;x.hint={fill:v?v.value===x.value?"color":"currentColor":this.fill??"currentColor",stroke:w?w.value===x.value?"color":"currentColor":this.stroke??"none"}}}render(n,e,r,i,o){let{x:a,y:c}=e,{x:u,y:f,r:s,rotate:d,symbol:l}=r,{r:h,rotate:m,symbol:g}=this,[x,v]=Yi(this,i),w=g===br,$=s?void 0:h*h*Math.PI;return Bs(h)&&(n=[]),pt("svg:g",o).call(Xt,this,i,o).call(Dt,this,{x:u&&a,y:f&&c}).call(p=>p.selectAll().data(n).enter().append(w?"circle":"path").call(Pt,this).call(w?b=>{b.attr("cx",u?y=>u[y]:x).attr("cy",f?y=>f[y]:v).attr("r",s?y=>s[y]:h)}:b=>{b.attr("transform",bl`translate(${u?y=>u[y]:x},${f?y=>f[y]:v})${d?y=>` rotate(${d[y]})`:m?` rotate(${m})`:""}`).attr("d",s&&l?y=>{let _=Pn();return l[y].draw(_,s[y]*s[y]*Math.PI),_}:s?y=>{let _=Pn();return g.draw(_,s[y]*s[y]*Math.PI),_}:l?y=>{let _=Pn();return l[y].draw(_,$),_}:(()=>{let y=Pn();return g.draw(y,$),y})())}).call(dn,this,r)).node()}};function He(t,{x:n,y:e,...r}={}){return r.frameAnchor===void 0&&([n,e]=We(n,e)),new zs(t,{...r,x:n,y:e})}var e7={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Pi=class extends Et{constructor(n,e={}){let{x:r,y:i,z:o,curve:a,tension:c}=e;super(n,{x:{value:r,scale:"x"},y:{value:i,scale:"y"},z:{value:Xs(e),optional:!0}},e,e7),this.z=o,this.curve=hy(a,c),Wi(this,e)}filter(n){return n}project(n,e,r){this.curve!==Nr&&super.project(n,e,r)}render(n,e,r,i,o){let{x:a,y:c}=r,{curve:u}=this;return pt("svg:g",o).call(Xt,this,i,o).call(Dt,this,e).call(f=>f.selectAll().data(dl(n,[a,c],this,r)).enter().append("path").call(Pt,this).call(ll,this,r).call(yg,this,r,o).attr("d",u===Nr&&o.projection?r7(o.path(),a,c):oa().curve(u).defined(s=>s>=0).x(s=>a[s]).y(s=>c[s]))).node()}};function r7(t,n,e){return n=Sn(n),e=Sn(e),r=>{let i=[],o=[i];for(let a of r)a===-1?(i=[],o.push(i)):i.push([n[a],e[a]]);return t({type:"MultiLineString",coordinates:o})}}function i7(t,{x:n,y:e,...r}={}){return[n,e]=We(n,e),new Pi(t,{...r,x:n,y:e})}function o7(t,n){let{x:e,y:r,stroke:i,z:o=i===e?null:void 0,...a}=by(n);return new Pi(t,{...a,x:e,y:r,z:o,stroke:i})}function Ga(t,n){let{x:e,y:r,stroke:i,z:o=i===r?null:void 0,...a}=yy(n);return new Pi(t,{...a,x:e,y:r,z:o,stroke:i})}var a7={dot:He,line:i7,lineX:o7,lineY:Ga,areaX:X4,areaY:V4,ruleX:qa,ruleY:Hi,barX:Pl,barY:Q4,rect:e4,rectX:r4,rectY:i4,cell:Ua,bin:E4,binX:py,binY:my,group:q6,groupX:F6,groupY:B6},V_=Object.fromEntries(Object.entries(a7).map(([t,n])=>[n,t]));var j_=new Uint8ClampedArray(4);var ps,tm;function c7(){if(tm)return ps;tm=1;function t(a,c,u,f,s){for(var d=s+1;f<=s;){var l=f+s>>>1,h=a[l],m=u!==void 0?u(h,c):h-c;m>=0?(d=l,s=l-1):f=l+1}return d}function n(a,c,u,f,s){for(var d=s+1;f<=s;){var l=f+s>>>1,h=a[l],m=u!==void 0?u(h,c):h-c;m>0?(d=l,s=l-1):f=l+1}return d}function e(a,c,u,f,s){for(var d=f-1;f<=s;){var l=f+s>>>1,h=a[l],m=u!==void 0?u(h,c):h-c;m<0?(d=l,f=l+1):s=l-1}return d}function r(a,c,u,f,s){for(var d=f-1;f<=s;){var l=f+s>>>1,h=a[l],m=u!==void 0?u(h,c):h-c;m<=0?(d=l,f=l+1):s=l-1}return d}function i(a,c,u,f,s){for(;f<=s;){var d=f+s>>>1,l=a[d],h=u!==void 0?u(l,c):l-c;if(h===0)return d;h<=0?f=d+1:s=d-1}return-1}function o(a,c,u,f,s,d){return typeof u=="function"?d(a,c,u,f===void 0?0:f|0,s===void 0?a.length-1:s|0):d(a,c,void 0,u===void 0?0:u|0,f===void 0?a.length-1:f|0)}return ps={ge:function(a,c,u,f,s){return o(a,c,u,f,s,t)},gt:function(a,c,u,f,s){return o(a,c,u,f,s,n)},lt:function(a,c,u,f,s){return o(a,c,u,f,s,e)},le:function(a,c,u,f,s){return o(a,c,u,f,s,r)},eq:function(a,c,u,f,s){return o(a,c,u,f,s,i)}},ps}var ms,nm;function u7(){if(nm)return ms;nm=1;var t=c7(),n=0,e=1,r=2;ms=$;function i(p,b,y,_,M){this.mid=p,this.left=b,this.right=y,this.leftPoints=_,this.rightPoints=M,this.count=(b?b.count:0)+(y?y.count:0)+_.length}var o=i.prototype;function a(p,b){p.mid=b.mid,p.left=b.left,p.right=b.right,p.leftPoints=b.leftPoints,p.rightPoints=b.rightPoints,p.count=b.count}function c(p,b){var y=x(b);p.mid=y.mid,p.left=y.left,p.right=y.right,p.leftPoints=y.leftPoints,p.rightPoints=y.rightPoints,p.count=y.count}function u(p,b){var y=p.intervals([]);y.push(b),c(p,y)}function f(p,b){var y=p.intervals([]),_=y.indexOf(b);return _<0?n:(y.splice(_,1),c(p,y),e)}o.intervals=function(p){return p.push.apply(p,this.leftPoints),this.left&&this.left.intervals(p),this.right&&this.right.intervals(p),p},o.insert=function(p){var b=this.count-this.leftPoints.length;if(this.count+=1,p[1]<this.mid)this.left?4*(this.left.count+1)>3*(b+1)?u(this,p):this.left.insert(p):this.left=x([p]);else if(p[0]>this.mid)this.right?4*(this.right.count+1)>3*(b+1)?u(this,p):this.right.insert(p):this.right=x([p]);else{var y=t.ge(this.leftPoints,p,m),_=t.ge(this.rightPoints,p,g);this.leftPoints.splice(y,0,p),this.rightPoints.splice(_,0,p)}},o.remove=function(p){var b=this.count-this.leftPoints;if(p[1]<this.mid){if(!this.left)return n;var y=this.right?this.right.count:0;if(4*y>3*(b-1))return f(this,p);var _=this.left.remove(p);return _===r?(this.left=null,this.count-=1,e):(_===e&&(this.count-=1),_)}else if(p[0]>this.mid){if(!this.right)return n;var M=this.left?this.left.count:0;if(4*M>3*(b-1))return f(this,p);var _=this.right.remove(p);return _===r?(this.right=null,this.count-=1,e):(_===e&&(this.count-=1),_)}else{if(this.count===1)return this.leftPoints[0]===p?r:n;if(this.leftPoints.length===1&&this.leftPoints[0]===p){if(this.left&&this.right){for(var S=this,C=this.left;C.right;)S=C,C=C.right;if(S===this)C.right=this.right;else{var k=this.left,_=this.right;S.count-=C.count,S.right=C.left,C.left=k,C.right=_}a(this,C),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?a(this,this.left):a(this,this.right);return e}for(var k=t.ge(this.leftPoints,p,m);k<this.leftPoints.length&&this.leftPoints[k][0]===p[0];++k)if(this.leftPoints[k]===p){this.count-=1,this.leftPoints.splice(k,1);for(var _=t.ge(this.rightPoints,p,g);_<this.rightPoints.length&&this.rightPoints[_][1]===p[1];++_)if(this.rightPoints[_]===p)return this.rightPoints.splice(_,1),e}return n}};function s(p,b,y){for(var _=0;_<p.length&&p[_][0]<=b;++_){var M=y(p[_]);if(M)return M}}function d(p,b,y){for(var _=p.length-1;_>=0&&p[_][1]>=b;--_){var M=y(p[_]);if(M)return M}}function l(p,b){for(var y=0;y<p.length;++y){var _=b(p[y]);if(_)return _}}o.queryPoint=function(p,b){if(p<this.mid){if(this.left){var y=this.left.queryPoint(p,b);if(y)return y}return s(this.leftPoints,p,b)}else if(p>this.mid){if(this.right){var y=this.right.queryPoint(p,b);if(y)return y}return d(this.rightPoints,p,b)}else return l(this.leftPoints,b)},o.queryInterval=function(p,b,y){if(p<this.mid&&this.left){var _=this.left.queryInterval(p,b,y);if(_)return _}if(b>this.mid&&this.right){var _=this.right.queryInterval(p,b,y);if(_)return _}return b<this.mid?s(this.leftPoints,b,y):p>this.mid?d(this.rightPoints,p,y):l(this.leftPoints,y)};function h(p,b){return p-b}function m(p,b){var y=p[0]-b[0];return y||p[1]-b[1]}function g(p,b){var y=p[1]-b[1];return y||p[0]-b[0]}function x(p){if(p.length===0)return null;for(var b=[],y=0;y<p.length;++y)b.push(p[y][0],p[y][1]);b.sort(h);for(var _=b[b.length>>1],M=[],S=[],C=[],y=0;y<p.length;++y){var k=p[y];k[1]<_?M.push(k):_<k[0]?S.push(k):C.push(k)}var T=C,D=C.slice();return T.sort(m),D.sort(g),new i(_,x(M),x(S),T,D)}function v(p){this.root=p}var w=v.prototype;w.insert=function(p){this.root?this.root.insert(p):this.root=new i(p[0],null,null,[p],[p])},w.remove=function(p){if(this.root){var b=this.root.remove(p);return b===r&&(this.root=null),b!==n}return!1},w.queryPoint=function(p,b){if(this.root)return this.root.queryPoint(p,b)},w.queryInterval=function(p,b,y){if(p<=b&&this.root)return this.root.queryInterval(p,b,y)},Object.defineProperty(w,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(w,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function $(p){return!p||p.length===0?new v(null):new v(x(p))}return ms}var Z_=u7();function Dl(t){return{mapIndex(n,e,r){let i=+t(n,e);for(let o of n)r[o]=e[o]===null?NaN:e[o]/i}}}function Xi(t){return Dl((n,e)=>t(n,r=>e[r]))}var K_=Dl((t,n)=>{for(let e=0;e<t.length;++e){let r=n[t[e]];if(An(r))return r}}),Q_=Dl((t,n)=>{for(let e=t.length-1;e>=0;--e){let r=n[t[e]];if(An(r))return r}});var J_=Xi(Yt),tM=Xi(nc),nM=Xi(Yr),eM=Xi(cn),rM=Xi(mn);var $y="http://www.w3.org/2000/svg",bt=t=>String(t).replace(/[&<>"]/g,n=>({"&":"&","<":"<",">":">",'"':"""})[n]),Ha=(t,n)=>t.show??t.text+(n??"");function Sy(t,n,e){let r=n.reduce((b,y)=>b+y.value,0);t.innerHTML="";let i=Object.assign(document.createElement("div"),{className:"fs-bar"}),o=Object.assign(document.createElement("div"),{className:"fs-rest"});t.append(i,o);let c=n.map(b=>{let y=document.createElement("div");return y.className="fs-seg"+(b.tone?" "+b.tone:""),y.style.flex=`${b.value/r} 1 0`,y.innerHTML=`<b>${bt(Ha(b,e))}</b><span>${b.label}</span>`,i.appendChild(y),{p:b,seg:y}}).filter(b=>b.seg.scrollWidth>b.seg.clientWidth+1);if(!c.length){o.remove();return}let u=t.getBoundingClientRect();for(let b of c)b.seg.classList.add("fs-out"),b.item=document.createElement("span"),b.item.innerHTML=`<b>${bt(Ha(b.p,e))}</b> ${b.p.label}`,b.item.style.cssText="position: absolute; white-space: nowrap;",o.appendChild(b.item);let f=u.width,s=22;for(let b of c){let y=b.seg.getBoundingClientRect();b.cx=y.left-u.left+y.width/2,b.w=b.item.offsetWidth}let d=getComputedStyle(t).getPropertyValue("--line").trim(),l=[],h;for(let b of c)b.x=Math.max(0,Math.min(f-b.w,b.cx-b.w/2));for(let b=1;b<c.length;b++)c[b].x=Math.max(c[b].x,c[b-1].x+c[b-1].w+s);for(let b=c.length-1;b>=0;b--){let y=b===c.length-1?f-c[b].w:c[b+1].x-s-c[b].w;c[b].x=Math.min(c[b].x,y)}let m=28,g=Math.max(...c.map(b=>b.w)),x=Math.min(...c.map(b=>b.cx)),v=Math.max(...c.map(b=>b.cx)),w=x-m>=g?"left":f-v-m>=g?"right":null;if(!c.some(b=>c.some(y=>y!==b&&y.cx>b.x&&y.cx<b.x+b.w))||!w){for(let y of c){y.y=26;let _=Math.max(y.x+8,Math.min(y.x+y.w-8,y.cx));l.push(`M${y.cx},-8 V${26/2-4} H${_} V23`)}h=26+c[0].item.offsetHeight}else{let y=c[0].item.offsetHeight+8,_=w==="left",M=[...c].sort((S,C)=>_?S.cx-C.cx:C.cx-S.cx);M.forEach((S,C)=>{S.y=14+C*y;let k=S.y+S.item.offsetHeight/2;if(_){let T=x-m;S.right=f-T,l.push(`M${S.cx},-8 V${k} H${T+6}`)}else{let T=v+m;S.x=T,l.push(`M${S.cx},-8 V${k} H${T-6}`)}}),h=14+M.length*y-8}o.style.cssText=`position: relative; display: block; height: ${h}px;`;let p=document.createElementNS($y,"svg");p.setAttribute("width",f),p.setAttribute("height",h),p.setAttribute("style","position:absolute;left:0;top:0;overflow:visible"),o.appendChild(p);for(let b of c)b.item.style.cssText=`position: absolute; ${b.right===void 0?`left: ${b.x}`:`right: ${b.right}`}px; top: ${b.y}px; white-space: nowrap;`;for(let b of l){let y=document.createElementNS($y,"path");for(let[_,M]of Object.entries({d:b,fill:"none",stroke:d,"stroke-width":1.5}))y.setAttribute(_,M);p.appendChild(y)}}function ky(t,n,e,r){let i=r??Math.max(...n.map(c=>c.value));t.innerHTML="";let o=n.map(c=>{let u=Object.assign(document.createElement("div"),{className:"fb-label",innerHTML:c.label}),f=Object.assign(document.createElement("div"),{className:"fb-track"}),s=c.tone?" "+c.tone:"";return f.innerHTML=`<div class="fb-bar${s}"></div><div class="fb-val${c.tone?" lead "+c.tone:""}">${bt(Ha(c,e))}${c.note?`<span class="fb-sub">${bt(c.note)}</span>`:""}</div>`,t.append(u,f),{bar:f.firstChild,ratio:i>0?Math.max(0,c.value)/i:0}}),a=Math.max(...[...t.querySelectorAll(".fb-val")].map(c=>c.offsetWidth))+12;for(let c of o)c.bar.style.width=`calc((100% - ${a}px) * ${c.ratio})`}var s7='<svg width="56" height="24" viewBox="0 0 56 24" aria-hidden="true"><path d="M2 12 H48 M38 3 L50 12 L38 21" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>';function Ay(t,n){let e=n.max??Math.max(n.before.value,n.after.value),r=n.after.tone??"accent",i=(o,a)=>`<div class="fc-side ${a}"><span class="fc-when">${bt(o.label)}</span><b class="fc-num">${bt(Ha({...o,text:String(o.value)},n.unit))}</b><div class="fc-bar" style="width:${e>0?100*o.value/e:0}%"></div></div>`;t.innerHTML=i(n.before,"before")+`<div class="fc-arrow">${s7}</div>`+i(n.after,"after "+r)}var Vi=t=>{let n=e=>getComputedStyle(t).getPropertyValue(e).trim();return{css:n,ink:n("--ink"),muted:n("--muted"),soft:n("--soft"),fill:n("--fill"),fill2:n("--fill2"),hair:n("--hair"),paper:n("--paper"),line:n("--line"),accent:n("--accent"),second:n("--second"),good:n("--good"),bad:n("--bad"),small:parseFloat(n("--small"))||15,body:parseFloat(n("--body"))||16,sans:n("--sans")}},pe=t=>typeof t=="number"?t:new Date(t),Qn=t=>(Math.abs(t)>=100?Math.round(t):Math.round(t*10)/10).toLocaleString("en-GB");function l7(t,n){let e=Math.abs(n-t)/864e5;return e<1?`${Qn(e*24)} hours`:`${Qn(e)} ${e===1?"day":"days"}`}function Kn(t,n,e,r=400){let i=document.createElement("span");i.style.cssText=`position:absolute;visibility:hidden;white-space:nowrap;font-size:${e}px;font-weight:${r}`,t.appendChild(i);let o=Math.max(...n.map(a=>(i.textContent=a,i.getBoundingClientRect().width)));return i.remove(),o}function ji(t,n,e){t.classList.add("chart"),t.innerHTML="",t.appendChild(Cl({...e,style:{background:"transparent",color:n.muted,fontFamily:n.sans,fontSize:n.small+"px",overflow:"visible"}}))}function Ty(t,n){let e=Vi(t),r=Math.floor(t.clientWidth)||640,i=typeof n.rows[0].from=="string",o=n.rows.map(h=>({...h,a:pe(h.from),b:pe(h.to)}));for(let h of o)h.text=h.gap??(i?l7(h.a,h.b):Qn(Math.abs(h.b-h.a))+(n.unit??"")),h.mid=i?new Date((+h.a+ +h.b)/2):(h.a+h.b)/2,h.color=e[h.tone??"accent"];let a=o.flatMap(h=>[+h.a,+h.b]),c=Math.min(...a),u=Math.max(...a),f=(u-c||1)*.08,s=i?[new Date(c-f),new Date(u+f)]:[c-f,u+f],d=Kn(t,o.map(h=>h.label),e.body);ji(t,e,{width:r,height:o.length*92+50,marginLeft:Math.ceil(d)+28,marginRight:24,marginTop:0,marginBottom:40,x:{domain:s,ticks:r<600?4:5,label:null,tickFormat:i?void 0:h=>Qn(h)+(n.unit??"")},y:{domain:o.map(h=>h.label),axis:null,padding:.5},marks:[on(o,{y:"label",text:"label",frameAnchor:"left",dx:-(Math.ceil(d)+28),textAnchor:"start",fill:e.ink,fontSize:e.body}),My(o,{x1:"a",x2:"b",y1:"label",y2:"label",stroke:"color",strokeWidth:3}),He(o,{x:"a",y:"label",r:6.5,fill:e.fill}),He(o.filter(h=>h.b>=h.a),{x:"b",y:"label",symbol:"triangle2",r:7.5,dx:-5,fill:"color",rotate:90}),He(o.filter(h=>h.b<h.a),{x:"b",y:"label",symbol:"triangle2",r:7.5,dx:5,fill:"color",rotate:-90}),on(o,{x:"mid",y:"label",text:"text",dy:-22,fill:e.ink,fontWeight:600,fontSize:e.small})]});let l=document.createElement("p");l.className="fd-key",l.innerHTML=`<span class="fd-from"><i></i>${bt(n.fromLabel)}</span><span class="fd-to${o.every(h=>h.b<h.a)?" back":""}" style="color:${e.accent}"><i></i>${bt(n.toLabel)}</span>`,l.style.marginLeft=d+"px",t.prepend(l)}function Cy(t,n){let e=Vi(t),r=Math.floor(t.clientWidth)||640,i=n.points.map(b=>({x:pe(b.x),y:b.y})),o=i.findIndex(b=>+b.x==+pe(n.mark.x)),a=i[o],c=i.slice(Math.max(0,o-3),o+4).map(b=>b.y),u=a.y>=c.reduce((b,y)=>b+y,0)/c.length,f=i.map(b=>b.y),s=n.zero??!0,d=Math.max(...f),l=s?Math.min(0,...f):Math.min(...f),h=b=>Qn(b)+(n.unit??""),m=Kn(t,[h(d),h(l)],e.small),g=Math.ceil(m)+14,x=r-g-20,w=g+x*((+a.x-+i[0].x)/(+i[i.length-1].x-+i[0].x))+14+Kn(t,[n.mark.label],e.body,600)<=r-20,$=s?(a.y-l)/(d*1.04-l)*270:1/0,p=u?-12:Math.min(0,$-18);ji(t,e,{width:r,height:340,marginLeft:g,marginRight:20,marginTop:30,marginBottom:40,x:{label:null,ticks:r<600?4:5,insetLeft:18},y:{label:null,grid:!0,ticks:4,tickSize:0,domain:s?[l,d*1.04]:void 0,tickFormat:h},marks:[s?Hi([0],{stroke:e.line}):null,Ga(i,{x:"x",y:"y",stroke:e.fill,strokeWidth:2.5}),He([a],{x:"x",y:"y",r:6.5,fill:e.accent}),on([a],{x:"x",y:"y",text:()=>n.mark.label,dx:w?14:-14,dy:p,textAnchor:w?"start":"end",fill:e.accent,fontWeight:600,fontSize:e.body})]})}function Ey(t,n,e){let r=t.length,i=[];for(let d=1;d<=3;d++)for(let l=1;l<=(e?2:3);l++)d*l>=r&&d*l-r<Math.min(d,l)&&i.push([d,l]);let o=new Map(t.map((d,l)=>[d.id,l])),a=n.map(d=>[o.get(d.from),o.get(d.to)]),c=(d,l,h,m)=>{let g=(x,v,w)=>Math.sign((v[0]-x[0])*(w[1]-x[1])-(v[1]-x[1])*(w[0]-x[0]));return g(d,l,h)*g(d,l,m)<0&&g(h,m,d)*g(h,m,l)<0},u=([d,l])=>[l*1.6,d],f=(d,l,h)=>{let[m,g]=u(d),[x,v]=u(l),[w,$]=u(h),p=.55,b=.32;for(let y=.04;y<1;y+=.04){let _=m+(x-m)*y,M=g+(v-g)*y;if(Math.abs(_-w)<p&&Math.abs(M-$)<b)return!0}return!1},s=null;for(let[d,l]of i){let h=[];for(let w=0;w<d;w++)for(let $=0;$<l;$++)h.push([w,$]);let m=new Array(h.length).fill(!1),g=new Array(r),x=()=>{let w=d*.6+l*.3,$=g.map(p=>h[p]);a.forEach(([p,b],y)=>{let _=$[p],M=$[b],[S,C]=u(_),[k,T]=u(M);w+=Math.hypot(k-S,T-C)*1.2,_[0]!==M[0]&&_[1]!==M[1]&&(w+=1.5),_[0]<M[0]&&(w+=3),$.forEach((D,P)=>{P!==p&&P!==b&&f(_,M,D)&&(w+=12)});for(let[D,P]of a.slice(y+1))D!==p&&D!==b&&P!==p&&P!==b&&c(u(_),u(M),u($[D]),u($[P]))&&(w+=8)});for(let p=0;p<d;p++)for(let b=1;b<l-1;b++)!$.some(y=>y[0]===p&&y[1]===b)&&$.some(y=>y[0]===p)&&(w+=4);return w},v=w=>{if(w===r){let $=x();(!s||$<s.s-1e-9)&&(s={s:$,rows:d,cols:l,pos:g.map(p=>h[p])});return}for(let $=0;$<h.length;$++)m[$]||(m[$]=!0,g[w]=$,v(w+1),m[$]=!1)};v(0)}return s}function d7(t,n){let e=n.classList.contains("phone"),{rows:r,cols:i,pos:o}=Ey(t.records,t.refs,e),a=document.createElement("div");a.className="entities",a.style.cssText=`grid-template-columns: repeat(${i}, minmax(0, 1fr)); grid-template-rows: repeat(${r}, auto);`,t.records.forEach((c,u)=>{let f=c.fields??[],s=document.createElement("div");s.className="node record"+(c.tone?" accent":""),s.id="rec-"+c.id,s.style.gridArea=`${o[u][0]+1} / ${o[u][1]+1}`,s.innerHTML=`<h3>${bt(c.name)}</h3>${f.length?`<ul>${f.map(d=>`<li>${bt(d)}</li>`).join("")}</ul>`:""}`,a.appendChild(s)}),n.appendChild(a);for(let c of t.refs){let u=document.createElement("fig-arrow");u.setAttribute("from","rec-"+c.from),u.setAttribute("to","rec-"+c.to),u.setAttribute("ref",c.count),c.optional&&u.setAttribute("dashed",""),n.appendChild(u)}}var h7={split:"fig-split",bars:"fig-bars","before-after":"fig-change",dumbbell:"div",series:"div",groups:"div",lines:"div",panels:"div",heatmap:"div"};function p7(t,n){let e=document.createElement("header");if(e.innerHTML=`<h1>${bt(t.title)}</h1>${t.note?`<p class="read">${bt(t.note)}</p>`:""}`,t.type==="entities"){if(n.append(e),d7(t,n),t.source){let o=document.createElement("footer");o.innerHTML=`<p>${bt(t.source)}</p>`,n.append(o)}return{chart:n.querySelector(".entities"),draw:()=>{}}}let r=document.createElement(h7[t.type]);if(n.append(e,r),t.source){let o=document.createElement("footer");o.innerHTML=`<p>${bt(t.source)}</p>`,n.append(o)}let i=()=>{if(t.type==="before-after")return Ay(r,t);if(t.type==="dumbbell")return Ty(r,t);if(t.type==="series")return Cy(r,t);if(t.type==="groups")return Ol(r,t,{unit:t.unit,max:t.max});if(t.type==="lines")return zl(r,t,{unit:t.unit,xTicks:t.xTicks});if(t.type==="panels")return Ny(r,t);if(t.type==="heatmap")return Ry(r,t);let o=(t.parts??t.bars).map(a=>({...a,text:String(a.value),label:bt(a.label)}));t.type==="split"?Sy(r,o,t.unit):ky(r,o,t.unit,t.max)};return i(),{chart:r,draw:i}}var Il=t=>!!t.closest(".phone");function Ol(t,n,e={}){let r=Vi(t),i=Math.floor(t.clientWidth)||640,o=Il(t)||i<420,{series:a,groups:c,accent:u}=n,f=r[u.tone??"accent"],s=c.flatMap(p=>a.map((b,y)=>({g:p.label,s:b,v:p.values[y],hi:(u.series===void 0||u.series===b)&&(u.group===void 0||u.group===p.label)}))),d=p=>Qn(p)+(e.unit??""),l=e.max??Math.max(...s.map(p=>p.v)),h=0,m=Math.ceil(Math.max(Kn(t,a,r.body)+h,Kn(t,c.map(p=>p.label),r.body,600)))+14,g=Math.ceil(Kn(t,s.map(p=>d(p.v)),r.body,600))+12,x=Math.max(o?34:38,Math.ceil(r.body*1.75)),v=Math.max(30,Math.ceil(r.body*1.7)),w=22,$=a.length*x+v+w;ji(t,r,{width:i,height:c.length*$-w+8,marginLeft:m,marginRight:g,marginTop:v,marginBottom:8,x:{domain:[0,l],axis:null},y:{domain:a,axis:null,padding:.18},fy:{domain:c.map(p=>p.label),axis:null,paddingInner:(v+w)/$,paddingOuter:0},marks:[qa([0],{stroke:r.line}),Pl(s,{x:"v",y:"s",fy:"g",fill:p=>p.hi?f:r.fill,rx:2}),on(s,{x:"v",y:"s",fy:"g",text:p=>d(p.v),dx:6,textAnchor:"start",fill:p=>p.hi?f:r.ink,fontWeight:p=>p.hi?600:400,fontSize:r.body}),on(s,{x:0,y:"s",fy:"g",text:"s",dx:-m+h,textAnchor:"start",fill:r.ink,fontSize:r.body}),on(c.map(p=>p.label),{fy:p=>p,frameAnchor:"top-left",dx:-m,dy:-v+2,text:p=>p,textAnchor:"start",lineAnchor:"top",fill:e.quietGroups?r.muted:r.ink,fontWeight:600,fontSize:r.body*1.06})]})}function zl(t,n,e={}){let r=Vi(t),i=Math.floor(t.clientWidth)||640,o=Il(t)||i<420,a=[r.fill2,r.fill],c=n.series.map(M=>({...M,pts:M.points.map(S=>({x:pe(S.x),y:S.y,s:M.label}))})),u=c.filter(M=>M.label!==n.accent);u.forEach((M,S)=>{M.color=a[S%2],M.w=2.25});let f=c.find(M=>M.label===n.accent);f.color=r.accent,f.w=3.25;let s=c.flatMap(M=>M.pts.map(S=>S.y)),d=n.zero??!0,l=e.domain??[d?Math.min(0,...s):Math.min(...s),Math.max(...s)*1.04],h=M=>Qn(M)+(e.unit??""),m=o?260:300,g=n.mark?28:10,x=36,v=[...u,f].map(M=>({l:M,last:M.pts[M.pts.length-1]})),w=Math.ceil(Kn(t,v.map(M=>M.l.label),r.small,600))+14,$=M=>g+(1-(M-l[0])/(l[1]-l[0]))*(m-g-x),p=v.map(M=>({...M,y:$(M.last.y)})).sort((M,S)=>M.y-S.y),b=r.small*1.3;for(let M=1;M<p.length;M++)p[M].y=Math.max(p[M].y,p[M-1].y+b);for(let M=p.length-2;M>=0;M--)p[M].y=Math.min(p[M].y,p[M+1].y-b);let y=Math.ceil(Kn(t,[h(l[1]),h(l[0])],r.small))+12,_=n.mark&&f.pts.find(M=>+M.x==+pe(n.mark.x));ji(t,r,{width:i,height:m,marginLeft:y,marginRight:w,marginTop:g,marginBottom:x,x:e.xTicks?{label:null,insetLeft:18,ticks:e.xTicks.map(M=>pe(M.x)),tickFormat:M=>e.xTicks.find(S=>+pe(S.x)==+M)?.label??""}:{label:null,insetLeft:18,ticks:i<520?3:5,tickFormat:typeof c[0].pts[0].x=="number"?M=>Qn(M):void 0},y:{domain:l,nice:!1,label:null,grid:!0,ticks:4,tickSize:0,tickFormat:h},marks:[d?Hi([0],{stroke:r.line}):null,...[...u,f].map(M=>Ga(M.pts,{x:"x",y:"y",stroke:M.color,strokeWidth:M.w})),on(p,{x:M=>M.last.x,y:M=>l[0]+(1-(M.y-g)/(m-g-x))*(l[1]-l[0]),text:M=>M.l.label,dx:8,textAnchor:"start",fill:M=>M.l===f?r.accent:r.muted,fontWeight:600,fontSize:r.small}),_?He([_],{x:"x",y:"y",r:6,fill:r.accent}):null,_?on([_],{x:"x",y:"y",text:()=>n.mark.label,dy:-16,fill:r.accent,fontWeight:600,fontSize:r.small}):null]})}function Ny(t,n){t.className="panels",t.innerHTML="";let e=n.panels.map(r=>{let i=document.createElement("div");i.className="panel",i.innerHTML=`<h2>${bt(r.label)}</h2>`;let o=document.createElement("div");return i.appendChild(o),t.appendChild(i),{p:r,chart:o}});if(n.chart==="groups"){let r=n.max??Math.max(...n.panels.flatMap(i=>i.groups.flatMap(o=>o.values)));for(let{p:i,chart:o}of e){let a=n.accent.group&&!i.groups.some(c=>c.label===n.accent.group)?{...n.accent,series:"\0"}:n.accent;Ol(o,{series:n.series,groups:i.groups,accent:a},{unit:n.unit,max:r,quietGroups:!0})}}else{let r=n.panels.flatMap(a=>a.series.flatMap(c=>c.points.map(u=>u.y))),i=n.zero??!0,o=[i?Math.min(0,...r):Math.min(...r),Math.max(...r)*1.04];for(let{p:a,chart:c}of e)zl(c,{series:a.series,accent:n.accent,zero:i},{unit:n.unit,domain:o,xTicks:n.xTicks})}}function Ry(t,n){let e=Vi(t),r=Math.floor(t.clientWidth)||640,i=Il(t)||r<420,o=n.rows.flatMap((_,M)=>n.columns.map((S,C)=>({r:String(_),c:String(S),v:n.values[M][C]}))),a=o.map(_=>_.v),c=Math.min(...a),u=Math.max(...a),f=ag({color:{type:"linear",scheme:"blues",domain:[c-(u-c)*.08,u]}}),s=_=>f.apply(_),d=[0,.25,.5,.75,1].map(_=>s(c+(u-c)*_)).join(", "),l=_=>Qn(_)+(n.unit??""),h=n.columns.map(String),m=n.rows.map(String),g=Math.ceil(Kn(t,m,e.small))+12,v=(r-g-8)/h.length>=48&&o.length<=72,w=i?5:9,$=[1,2,3,4,5,6,8,10,12].filter(_=>h.length/_<=w),p=$.find(_=>h.length%_===0)??$[0]??Math.ceil(h.length/w),b=i?30:36,y=document.createElement("p");y.className="hm-key",y.innerHTML=`<span>${bt(l(c))}</span><i style="background:linear-gradient(90deg, ${d})"></i><span>${bt(l(u))}</span>`+(n.mark?`<span style="margin-left:14px;white-space:nowrap;display:inline-flex;align-items:center;gap:8px;color:${e.ink};font-weight:600"><i style="width:16px;height:16px;border:2.5px solid ${e.accent};border-radius:2px;background:none"></i>${bt(n.mark.label)}</span>`:""),ji(t,e,{width:r,height:m.length*b+36,marginLeft:g,marginRight:8,marginTop:0,marginBottom:36,x:{domain:h,label:null,tickSize:0,tickFormat:(_,M)=>M%p===0?_:"",padding:.06},y:{domain:m,label:null,tickSize:0,padding:.08},marks:[Ua(o,{x:"c",y:"r",fill:_=>s(_.v),inset:.5}),v?on(o,{x:"c",y:"r",text:_=>l(_.v),fill:_=>(_.v-c)/(u-c||1)>.55?"#ffffff":e.ink,fontSize:e.small}):null,n.mark?Ua([{r:String(n.mark.row),c:String(n.mark.column)}],{x:"c",y:"r",fill:"none",stroke:e.accent,strokeWidth:2.5}):null]}),y.style.marginLeft=g+"px",t.prepend(y)}return Hy(m7);})();
|
|
59
|
+
}`)).call(wl,e);for(let O of s){let{channels:Y,values:E,facets:R}=g.get(O);if(p===void 0||O.facet==="super"){let F=null;if(R&&(F=R[0],F=O.filter(F,Y,E),F.length===0))continue;let G=O.render(F,w,E,y,M);if(G==null)continue;$.appendChild(G)}else{let F;for(let G of p){if(!(O.facetAnchor?.(p,C,G)??!G.empty))continue;let Z=null;if(R){let I=d.has(O);if(Z=R[I?G.i:0],Z=O.filter(Z,Y,E),Z.length===0)continue;!I&&Z===R[0]&&(Z=T6(Z)),Z.fx=G.x,Z.fy=G.y,Z.fi=G.i}let it=O.render(Z,w,E,x,M);if(it!=null){(F??=Dn($).append("g")).append(()=>it).datum(G);for(let I of["aria-label","aria-description","aria-hidden","transform"])it.hasAttribute(I)&&(F.attr(I,it.getAttribute(I)),it.removeAttribute(I))}}F?.selectChildren().each(z)}}let B=t4(b,M,t),{figure:D=r!=null||i!=null||o!=null||B.length>0}=t;D&&(A=_.createElement("figure"),A.className=`${u}-figure`,A.style.maxWidth="initial",r!=null&&A.append(Jp(_,r,"h2")),i!=null&&A.append(Jp(_,i,"h3")),A.append(...B,$),o!=null&&A.append(T4(_,o)),"value"in $&&(A.value=$.value,delete $.value)),A.scale=w3(w.scales,M),A.legend=K8(b,M,t);let H=v5();return H>0&&Dn($).append("text").attr("x",L).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("\u26A0\uFE0F").append("title").text(`${H.toLocaleString("en-US")} warning${H===1?"":"s"}. Please check the console.`),A}function Jp(t,n,e){if(n.ownerDocument)return n;let r=t.createElement(e);return r.append(n),r}function T4(t,n){let e=t.createElement("figcaption");return e.append(n),e}function t1(t){return t.flat(1/0).filter(n=>n!=null).map(C4)}function C4(t){return typeof t.render=="function"?t:new zf(t)}var zf=class extends Pt{constructor(n){if(typeof n!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=n}render(){}};function zl(t,n){for(let e in t)by(t[e],n);return t}function by(t,n){let{scale:e,transform:r=!0}=t;if(e==null||!r)return;let{type:i,percent:o,interval:a,transform:c=o?u=>u==null?NaN:u*100:T1(a,i)}=n[e]??{};c!=null&&(t.value=bt(t.value,c),t.transform=!1)}function E4(t){for(let n in t)G1(n,t[n])}function Ai(t,n,e,r=k6){for(let{channels:i}of n.values())for(let o in i){let a=i[o],{scale:c}=a;if(c!=null&&r(c))if(c==="projection"){if(!T5(e)){let u=e.x?.domain===void 0,s=e.y?.domain===void 0;if(u||s){let[f,d]=E5(a);u&&bf(t,"x",f),s&&bf(t,"y",d)}}}else bf(t,c,a)}return t}function bf(t,n,e){let r=t.get(n);r!==void 0?r.push(e):t.set(n,[e])}function N4(t,n){if(t==null)return;let{x:e,y:r}=t;if(e==null&&r==null)return;let i=Nr(t.data);if(i==null)throw new Error("missing facet data");let o={};e!=null&&(o.fx=Pi(i,{value:e,scale:"fx"})),r!=null&&(o.fy=Pi(i,{value:r,scale:"fy"})),zl(o,n);let a=vl(i,o);return{channels:o,groups:a,data:t.data}}function n1(t,n,e){if(t.facet===null||t.facet==="super")return;let{fx:r,fy:i}=t;if(r!=null||i!=null){let u=Nr(t.data??r??i);if(u===void 0)throw new Error(`missing facet data in ${t.ariaLabel}`);if(u===null)return;let s={};return r!=null&&(s.fx=Pi(u,{value:r,scale:"fx"})),i!=null&&(s.fy=Pi(u,{value:i,scale:"fy"})),zl(s,e),{channels:s,groups:vl(u,s)}}if(n===void 0)return;let{channels:o,groups:a,data:c}=n;if(t.facet!=="auto"||t.data===c)return{channels:o,groups:a};c.length>0&&(a.size>1||a.size===1&&o.fx&&o.fy&&[...a][0][1].size>1)&&Ni(Nr(t.data))===Ni(c)&&fe(`Warning: the ${t.ariaLabel} mark appears to use faceted data, but isn\u2019t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function L4(t,n={}){return Pr({...n,x:null,y:null},(e,r,i,o,a,c)=>c.getMarkState(t))}function P4(t){let n=[];for(let e of t){let r=e.tip;if(r){r===!0?r={}:typeof r=="string"&&(r={pointer:r});let{pointer:i,preferredAnchor:o}=r;i=/^x$/i.test(i)?c8:/^y$/i.test(i)?Fp:a8,r=i(L4(e,r)),r.title=null,o===void 0&&(r.preferredAnchor=i===Fp?"left":"bottom");let a=M4(e.data,r);a.facet=e.facet,a.facetAnchor=e.facetAnchor,n.push(a)}}return n}function R4(t,n,e){let{projection:r,x:i={},y:o={},fx:a={},fy:c={},axis:u,grid:s,facet:f={},facet:{axis:d=u,grid:l}=f,x:{axis:h=u,grid:p=h===null?null:s}=i,y:{axis:g=u,grid:b=g===null?null:s}=o,fx:{axis:v=d,grid:w=v===null?null:l}=a,fy:{axis:S=d,grid:m=S===null?null:l}=c}=e;(r||!$a(i)&&!e1("x",t))&&(h=p=null),(r||!$a(o)&&!e1("y",t))&&(g=b=null),n.has("fx")||(v=w=null),n.has("fy")||(S=m=null),h===void 0&&(h=!xa(t,"x")),g===void 0&&(g=!xa(t,"y")),v===void 0&&(v=!xa(t,"fx")),S===void 0&&(S=!xa(t,"fy")),h===!0&&(h="bottom"),g===!0&&(g="left"),v===!0&&(v=h==="top"||h===null?"bottom":"top"),S===!0&&(S=g==="right"||g===null?"left":"right");let x=[];return ba(x,m,Y8,c),ya(x,S,D8,"right","left",f,c),ba(x,w,W8,a),ya(x,v,O8,"top","bottom",f,a),ba(x,b,B8,o),ya(x,g,jg,"left","right",e,o),ba(x,p,Al,i),ya(x,h,Zg,"bottom","top",e,i),x}function ya(t,n,e,r,i,o,a){if(!n)return;let c=D4(n);a=O4(c?r:n,o,a);let{line:u}=a;(e===jg||e===Zg)&&u&&!Li(u)&&t.push(w4(I4(a))),t.push(e(a)),c&&t.push(e({...a,anchor:i,label:null}))}function ba(t,n,e,r){!n||Li(n)||t.push(e(z4(n,r)))}function D4(t){return/^\s*both\s*$/i.test(t)}function O4(t,n,{line:e=n.line,ticks:r,tickSize:i,tickSpacing:o,tickPadding:a,tickFormat:c,tickRotate:u,fontVariant:s,ariaLabel:f,ariaDescription:d,label:l=n.label,labelAnchor:h,labelArrow:p=n.labelArrow,labelOffset:g}){return{anchor:t,line:e,ticks:r,tickSize:i,tickSpacing:o,tickPadding:a,tickFormat:c,tickRotate:u,fontVariant:s,ariaLabel:f,ariaDescription:d,label:l,labelAnchor:h,labelArrow:p,labelOffset:g}}function I4(t){let{anchor:n,line:e}=t;return{anchor:n,facetAnchor:n+"-empty",stroke:e===!0?void 0:e}}function z4(t,{stroke:n=Ia(t)?t:void 0,ticks:e=F4(t)?t:void 0,tickSpacing:r,ariaLabel:i,ariaDescription:o}){return{stroke:n,ticks:e,tickSpacing:r,ariaLabel:i,ariaDescription:o}}function F4(t){switch(typeof t){case"number":return!0;case"string":return!Ia(t)}return de(t)||typeof t?.range=="function"}function xa(t,n){let e=`${n}-axis `;return t.some(r=>r.ariaLabel?.startsWith(e))}function e1(t,n){for(let e of n)for(let r in e.channels){let{scale:i}=e.channels[r];if(i===t||i==="projection")return!0}return!1}function q4(t,n){for(let e in t){let r=t[e],i=n[e];r.label===void 0&&i&&(r.label=i.label)}return t}function B4({fx:t,fy:n},e){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:a,width:c,height:u}=ml(e),s=t&&r1(t),f=n&&r1(n);return{marginTop:n?f[0]:r,marginRight:t?c-s[1]:i,marginBottom:n?u-f[1]:o,marginLeft:t?s[0]:a,inset:{marginTop:e.marginTop,marginRight:e.marginRight,marginBottom:e.marginBottom,marginLeft:e.marginLeft},width:c,height:u}}function r1(t){let n=t.domain();if(n.length===0)return[0,t.bandwidth()];let e=t(n[0]),r=t(n[n.length-1]);return r<e&&([e,r]=[r,e]),[e,r+t.bandwidth()]}var Y4=new Map([["basis",qm],["basis-closed",Ym],["basis-open",Hm],["bundle",Gm],["bump-x",Rm],["bump-y",Dm],["cardinal",Xm],["cardinal-closed",Vm],["cardinal-open",jm],["catmull-rom",Km],["catmull-rom-closed",Jm],["catmull-rom-open",np],["linear",Be],["linear-closed",rp],["monotone-x",ap],["monotone-y",cp],["natural",sp],["step",fp],["step-after",dp],["step-before",lp]]);function xy(t=Be,n){if(typeof t=="function")return t;let e=Y4.get(`${t}`.toLowerCase());if(!e)throw new Error(`unknown curve: ${t}`);if(n!==void 0){if("beta"in e)return e.beta(n);if("tension"in e)return e.tension(n);if("alpha"in e)return e.alpha(n)}return e}function wy(t=Or,n){return typeof t!="function"&&`${t}`.toLowerCase()==="auto"?Or:xy(t,n)}function Or(t){return Be(t)}function vy(t={y:"count"},n={}){[t,n]=ql(t,n);let{x:e,y:r}=n;return Fl(Na(e,n,mt),null,null,r,t,ji(n))}function My(t={x:"count"},n={}){[t,n]=ql(t,n);let{x:e,y:r}=n;return Fl(null,Na(r,n,mt),e,null,t,Zi(n))}function W4(t={fill:"count"},n={}){[t,n]=ql(t,n);let{x:e,y:r}=H4(n);return Fl(e,r,null,null,t,ji(Zi(n)))}function _y(t,n,e={}){if(e?.interval==null)return e;let{reduce:r=sl}=e,i={filter:null};return e[n]!=null&&(i[n]=r),e[`${n}1`]!=null&&(i[`${n}1`]=r),e[`${n}2`]!=null&&(i[`${n}2`]=r),t(i,e)}function $y({x:t=He,...n}={}){return _y(vy,"y",Fr({x:t,...El(n)},"x"))}function Sy({y:t=He,...n}={}){return _y(My,"x",Fr({y:t,...Cl(n)},"y"))}function Fl(t,n,e,r,{data:i=ul,filter:o=Ta,sort:a,reverse:c,...u}={},s={}){t=i1(t),n=i1(n),u=G4(u,s),i=Ty(i,mt),a=a==null?void 0:ky("sort",a,s),o=o==null?void 0:Ay("filter",o,s),e!=null&&Tr(u,"x","x1","x2")&&(e=null),r!=null&&Tr(u,"y","y1","y2")&&(r=null);let[f,d]=Yt(t),[l,h]=Yt(t),[p,g]=Yt(n),[b,v]=Yt(n),[w,S]=e!=null?[e,"x"]:r!=null?[r,"y"]:[],[m,x]=Yt(w),{x:y,y:M,z:_,fill:$,stroke:A,x1:k,x2:C,y1:z,y2:L,domain:T,cumulative:B,thresholds:D,interval:H,...O}=s,[Y,E]=Yt(_),[R]=mn($),[F]=mn(A),[G,Z]=Yt(R),[it,I]=Yt(F);return{..."z"in s&&{z:Y||_},..."fill"in s&&{fill:G||$},..."stroke"in s&&{stroke:it||A},...Hi(O,(U,P,q)=>{let W=Aa(lt(U,w),q?.[S]),N=lt(U,_),K=lt(U,R),X=lt(U,F),V=W1(u,{z:N,fill:K,stroke:X}),nt=[],ct=[],yt=W&&x([]),ye=N&&E([]),be=K&&Z([]),Vy=X&&I([]),Xl=t&&d([]),jy=t&&h([]),Vl=n&&g([]),Zy=n&&v([]),Ky=j4(t,n,U),Qy=0;for(let Qe of u)Qe.initialize(U);a&&a.initialize(U),o&&o.initialize(U);for(let Qe of P){let jl=[];for(let Je of u)Je.scope("facet",Qe);a&&a.scope("facet",Qe),o&&o.scope("facet",Qe);for(let[Je,Jy]of Ci(Qe,V))for(let[tb,to]of Ci(Jy,W))for(let[yn,Rn]of Ky(to))if(V&&(Rn.z=Je),!(o&&!o.reduce(yn,Rn))){jl.push(Qy++),ct.push(i.reduceIndex(yn,U,Rn)),W&&yt.push(tb),N&&ye.push(V===N?Je:N[(yn.length>0?yn:to)[0]]),K&&be.push(V===K?Je:K[(yn.length>0?yn:to)[0]]),X&&Vy.push(V===X?Je:X[(yn.length>0?yn:to)[0]]),Xl&&(Xl.push(Rn.x1),jy.push(Rn.x2)),Vl&&(Vl.push(Rn.y1),Zy.push(Rn.y2));for(let nb of u)nb.reduce(yn,Rn);a&&a.reduce(yn,Rn)}nt.push(jl)}return H1(nt,a,c),{data:ct,facets:nt}}),...!Tr(u,"x")&&(f?{x1:f,x2:l,x:ka(f,l)}:{x:y,x1:k,x2:C}),...!Tr(u,"y")&&(p?{y1:p,y2:b,y:ka(p,b)}:{y:M,y1:z,y2:L}),...m&&{[S]:m},...Object.fromEntries(u.map(({name:U,output:P})=>[U,P]))}}function ql({cumulative:t,domain:n,thresholds:e,interval:r,...i},o){return[i,{cumulative:t,domain:n,thresholds:e,interval:r,...o}]}function Na(t,{cumulative:n,domain:e,thresholds:r,interval:i},o){return t={...Bi(t)},t.domain===void 0&&(t.domain=e),t.cumulative===void 0&&(t.cumulative=n),t.thresholds===void 0&&(t.thresholds=r),t.interval===void 0&&(t.interval=i),t.value===void 0&&(t.value=o),t.thresholds=U4(t.thresholds,t.interval),t}function H4(t){let{x:n,y:e}=t;return n=Na(n,t),e=Na(e,t),[n.value,e.value]=Ge(n.value,e.value),{x:n,y:e}}function i1(t){if(t==null)return;let{value:n,cumulative:e,domain:r=Xt,thresholds:i}=t,o=a=>{let c=lt(a,n),u;if(Ht(c)||V4(i)){c=bt(c,M1,Float64Array);let[f,d]=typeof r=="function"?r(c):r,l=typeof i=="function"&&!Ar(i)?i(c,f,d):i;typeof l=="number"&&(l=Ho(f,d,l)),Ar(l)&&(r===Xt&&(f=l.floor(f),d=l.offset(l.floor(d))),l=l.range(f,l.offset(d))),u=l}else{c=Tn(c);let[f,d]=typeof r=="function"?r(c):r,l=typeof i=="function"&&!Ar(i)?i(c,f,d):i;if(typeof l=="number")if(r===Xt){let h=er(f,d,l);if(isFinite(h))if(h>0){let p=Math.round(f/h),g=Math.round(d/h);p*h<=f||--p,g*h>d||++g;let b=g-p+1;l=new Float64Array(b);for(let v=0;v<b;++v)l[v]=(p+v)*h}else if(h<0){h=-h;let p=Math.round(f*h),g=Math.round(d*h);p/h<=f||--p,g/h>d||++g;let b=g-p+1;l=new Float64Array(b);for(let v=0;v<b;++v)l[v]=(p+v)/h}else l=[f];else l=[f]}else l=ve(f,d,l);else Ar(l)&&(r===Xt&&(f=l.floor(f),d=l.offset(l.floor(d))),l=l.range(f,l.offset(d)));u=l}let s=[];if(u.length===1)s.push([u[0],u[0]]);else for(let f=1;f<u.length;++f)s.push([u[f-1],u[f]]);return s.bin=(e<0?K4:e>0?Z4:Bl)(s,u,c),s};return o.label=Xe(n),o}function U4(t,n,e=o1){if(t===void 0)return n===void 0?e:Ir(n);if(typeof t=="string"){switch(t.toLowerCase()){case"freedman-diaconis":return dd;case"scott":return oc;case"sturges":return cd;case"auto":return o1}return Vf(t)}return t}function G4(t,n){return F1(t,n,ky)}function ky(t,n,e){return al(t,n,e,Ay)}function Ay(t,n,e){return cl(t,n,e,Ty)}function Ty(t,n){return qa(t,n,X4)}function X4(t){switch(`${t}`.toLowerCase()){case"x":return Q4;case"x1":return tM;case"x2":return nM;case"y":return J4;case"y1":return eM;case"y2":return rM;case"z":return U1}throw new Error(`invalid bin reduce: ${t}`)}function o1(t,n,e){return Math.min(200,oc(t,n,e))}function V4(t){return L6(t)||de(t)&&Ht(t)}function j4(t,n,e){let r=t?.(e),i=n?.(e);return r&&i?function*(o){let a=r.bin(o);for(let[c,[u,s]]of r.entries()){let f=i.bin(a[c]);for(let[d,[l,h]]of i.entries())yield[f[d],{data:e,x1:u,y1:l,x2:s,y2:h}]}}:r?function*(o){let a=r.bin(o);for(let[c,[u,s]]of r.entries())yield[a[c],{data:e,x1:u,x2:s}]}:function*(o){let a=i.bin(o);for(let[c,[u,s]]of i.entries())yield[a[c],{data:e,y1:u,y2:s}]}}function Bl(t,n,e){return n=Tn(n),r=>{let i=t.map(()=>[]);for(let o of r)i[or(n,e[o])-1]?.push(o);return i}}function Z4(t,n,e){let r=Bl(t,n,e);return i=>{let o=r(i);for(let a=1,c=o.length;a<c;++a){let u=o[a-1],s=o[a];for(let f of u)s.push(f)}return o}}function K4(t,n,e){let r=Bl(t,n,e);return i=>{let o=r(i);for(let a=o.length-2;a>=0;--a){let c=o[a+1],u=o[a];for(let s of c)u.push(s)}return o}}function Cy(t,n){let e=(+t+ +n)/2;return t instanceof Date?new Date(e):e}var Q4={reduceIndex(t,n,{x1:e,x2:r}){return Cy(e,r)}},J4={reduceIndex(t,n,{y1:e,y2:r}){return Cy(e,r)}},tM={reduceIndex(t,n,{x1:e}){return e}},nM={reduceIndex(t,n,{x2:e}){return e}},eM={reduceIndex(t,n,{y1:e}){return e}},rM={reduceIndex(t,n,{y2:e}){return e}},iM={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},oM={ariaLabel:"area-line",fillOpacity:.3,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Ii=class extends Pt{constructor(n,e={},r=iM){let{x1:i,y1:o,x2:a,y2:c,z:u,curve:s,tension:f}=e;super(n,{x1:{value:i,scale:"x"},y1:{value:o,scale:"y"},x2:{value:a,scale:"x",optional:!0},y2:{value:c,scale:"y",optional:!0},z:{value:Qf(e),optional:!0}},e,r),this.z=u,this.curve=xy(s,f)}filter(n){return n}render(n,e,r,i,o){let{x1:a,y1:c,x2:u=a,y2:s=c}=r;return gt("svg:g",o).call(Kt,this,i,o).call(zt,this,e,0,0).call(f=>f.selectAll().data(bl(n,[a,c,u,s],this,r)).enter().append("path").call(It,this).call(yl,this,r).attr("d",Fs().curve(this.curve).defined(d=>d>=0).x0(d=>a[d]).y0(d=>c[d]).x1(d=>u[d]).y1(d=>s[d]))).node()}},La=class extends Ii{constructor(n,e={}){super(n,e,oM),Vi(this,e)}render(n,e,r,i,o){let{x1:a,y1:c,x2:u=a,y2:s=c}=r;return gt("svg:g",o).call(Kt,this,i,o).call(zt,this,e,0,0).call(f=>f.selectAll().data(bl(n,[a,c,u,s],this,r)).enter().append("g").call(It,this).call(yl,this,r).call(d=>d.append("path").attr("stroke","none").attr("d",Fs().curve(this.curve).defined(l=>l>=0).x0(l=>a[l]).y0(l=>c[l]).x1(l=>u[l]).y1(l=>s[l]))).call(d=>d.append("path").call($g,this,r,o).attr("fill","none").attr("transform",Tt?`translate(${Tt},${Tt})`:null).attr("d",sa().curve(this.curve).defined(l=>l>=0).x(l=>u[l]).y(l=>s[l])))).node()}};function aM(t,n){let{x:e,y:r,line:i,color:o,stroke:a=o,fill:c=o,z:u=e===c||e===a?null:void 0,...s}=Sy(n);return new(i?La:Ii)(t,Nl({...s,x:e,y1:r,y2:void 0,z:u,stroke:a,fill:c}))}function Xa(t,n){let{x:e,y:r,line:i,color:o,stroke:a=o,fill:c=o,z:u=r===c||r===a?null:void 0,...s}=$y(n);return new(i?La:Ii)(t,Ll({...s,x1:e,x2:void 0,y:r,z:u,stroke:a,fill:c}))}var cM={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Ff=class extends Pt{constructor(n,e={}){let{x1:r,y1:i,x2:o,y2:a,curve:c,tension:u}=e;super(n,{x1:{value:r,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:a,scale:"y",optional:!0}},e,cM),this.curve=wy(c,u),Vi(this,e)}project(n,e,r){this.curve!==Or&&super.project(n,e,r)}render(n,e,r,i,o){let{x1:a,y1:c,x2:u=a,y2:s=c}=r,{curve:f}=this;return gt("svg:g",o).call(Kt,this,i,o).call(zt,this,e).call(d=>d.selectAll().data(n).enter().append("path").call(It,this).attr("d",f===Or&&o.projection?uM(o.path(),a,c,u,s):l=>{let h=In(),p=f(h);return p.lineStart(),p.point(a[l],c[l]),p.point(u[l],s[l]),p.lineEnd(),h}).call(pn,this,r).call(_l,this,r,o)).node()}};function uM(t,n,e,r,i){return n=Tn(n),e=Tn(e),r=Tn(r),i=Tn(i),o=>t({type:"LineString",coordinates:[[n[o],e[o]],[r[o],i[o]]]})}function Ey(t,{x:n,x1:e,x2:r,y:i,y1:o,y2:a,...c}={}){return[e,r]=a1(n,e,r),[o,a]=a1(i,o,a),new Ff(t,{...c,x1:e,x2:r,y1:o,y2:a})}function a1(t,n,e){if(t===void 0){if(n===void 0){if(e!==void 0)return[e]}else if(e===void 0)return[n]}else{if(n===void 0)return e===void 0?[t]:[t,e];if(e===void 0)return[t,n]}return[n,e]}var sM={ariaLabel:"bar"},zi=class extends Pt{constructor(n,e,r={},i=sM){super(n,e,r,i),Pl(this,r),Rl(this,r)}render(n,e,r,i,o){let{rx:a,ry:c,rx1y1:u,rx1y2:s,rx2y1:f,rx2y2:d}=this,l=this._x(e,r,i),h=this._y(e,r,i),p=this._width(e,r,i),g=this._height(e,r,i);return gt("svg:g",o).call(Kt,this,i,o).call(this._transform,this,e).call(b=>b.selectAll().data(n).enter().call(u||s||f||d?v=>v.append("path").call(It,this).call(Dl,l,h,c1(l,p),c1(h,g),this).call(pn,this,r):v=>v.append("rect").call(It,this).attr("x",l).attr("width",p).attr("y",h).attr("height",g).call(j,"rx",a).call(j,"ry",c).call(pn,this,r))).node()}_x(n,{x:e},{marginLeft:r}){let{insetLeft:i}=this;return e?o=>e[o]+i:r+i}_y(n,{y:e},{marginTop:r}){let{insetTop:i}=this;return e?o=>e[o]+i:r+i}_width({x:n},{x:e},{marginRight:r,marginLeft:i,width:o}){let{insetLeft:a,insetRight:c}=this,u=e&&n?n.bandwidth():o-r-i;return Math.max(0,u-a-c)}_height({y:n},{y:e},{marginTop:r,marginBottom:i,height:o}){let{insetTop:a,insetBottom:c}=this,u=e&&n?n.bandwidth():o-r-i;return Math.max(0,u-a-c)}};function c1(t,n){return typeof t=="function"&&typeof n=="function"?e=>t(e)+n(e):typeof t=="function"?e=>t(e)+n:typeof n=="function"?e=>t+n(e):t+n}var qf=class extends zi{constructor(n,e={},r){let{x1:i,x2:o,y:a}=e;super(n,{x1:{value:i,scale:"x"},x2:{value:o,scale:"x"},y:{value:a,scale:"y",type:"band",optional:!0}},e,r)}_transform(n,e,{x:r}){n.call(zt,e,{x:r},0,0)}_x({x:n},{x1:e,x2:r},{marginLeft:i}){let{insetLeft:o}=this;return Ln(n)?i+o:a=>Math.min(e[a],r[a])+o}_width({x:n},{x1:e,x2:r},{marginRight:i,marginLeft:o,width:a}){let{insetLeft:c,insetRight:u}=this;return Ln(n)?a-i-o-c-u:s=>Math.max(0,Math.abs(r[s]-e[s])-c-u)}},Bf=class extends zi{constructor(n,e={},r){let{x:i,y1:o,y2:a}=e;super(n,{y1:{value:o,scale:"y"},y2:{value:a,scale:"y"},x:{value:i,scale:"x",type:"band",optional:!0}},e,r)}_transform(n,e,{y:r}){n.call(zt,e,{y:r},0,0)}_y({y:n},{y1:e,y2:r},{marginTop:i}){let{insetTop:o}=this;return Ln(n)?i+o:a=>Math.min(e[a],r[a])+o}_height({y:n},{y1:e,y2:r},{marginTop:i,marginBottom:o,height:a}){let{insetTop:c,insetBottom:u}=this;return Ln(n)?a-i-o-c-u:s=>Math.max(0,Math.abs(r[s]-e[s])-c-u)}};function Yl(t,n={}){return Da(n)||(n={...n,y:He,x2:mt}),new qf(t,Nl(Lg(Cl(n))))}function fM(t,n={}){return Da(n)||(n={...n,x:He,y2:mt}),new Bf(t,Ll(Pg(El(n))))}var lM={ariaLabel:"cell"},Yf=class extends zi{constructor(n,{x:e,y:r,...i}={}){super(n,{x:{value:e,scale:"x",type:"band",optional:!0},y:{value:r,scale:"y",type:"band",optional:!0}},i,lM)}_transform(n,e){n.call(zt,e,{},0,0)}};function Va(t,{x:n,y:e,...r}={}){return[n,e]=Ge(n,e),new Yf(t,{...r,x:n,y:e})}var dM={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function hM(t){return t.sort===void 0&&t.reverse===void 0?K6({channel:"-r"},t):t}var Wf=class extends Pt{constructor(n,e={}){let{x:r,y:i,r:o,rotate:a,symbol:c=_r,frameAnchor:u}=e,[s,f]=Ot(a,0),[d,l]=j6(c),[h,p]=Ot(o,d==null?3:4.5);super(n,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:h,scale:"r",filter:Pa,optional:!0},rotate:{value:s,optional:!0},symbol:{value:d,scale:"auto",optional:!0}},hM(e),dM),this.r=p,this.rotate=f,this.symbol=l,this.frameAnchor=za(u);let{channels:g}=this,{symbol:b}=g;if(b){let{fill:v,stroke:w}=g;b.hint={fill:v?v.value===b.value?"color":"currentColor":this.fill??"currentColor",stroke:w?w.value===b.value?"color":"currentColor":this.stroke??"none"}}}render(n,e,r,i,o){let{x:a,y:c}=e,{x:u,y:s,r:f,rotate:d,symbol:l}=r,{r:h,rotate:p,symbol:g}=this,[b,v]=Xi(this,i),w=g===_r,S=f?void 0:h*h*Math.PI;return Uf(h)&&(n=[]),gt("svg:g",o).call(Kt,this,i,o).call(zt,this,{x:u&&a,y:s&&c}).call(m=>m.selectAll().data(n).enter().append(w?"circle":"path").call(It,this).call(w?x=>{x.attr("cx",u?y=>u[y]:b).attr("cy",s?y=>s[y]:v).attr("r",f?y=>f[y]:h)}:x=>{x.attr("transform",$l`translate(${u?y=>u[y]:b},${s?y=>s[y]:v})${d?y=>` rotate(${d[y]})`:p?` rotate(${p})`:""}`).attr("d",f&&l?y=>{let M=In();return l[y].draw(M,f[y]*f[y]*Math.PI),M}:f?y=>{let M=In();return g.draw(M,f[y]*f[y]*Math.PI),M}:l?y=>{let M=In();return l[y].draw(M,S),M}:(()=>{let y=In();return g.draw(y,S),y})())}).call(pn,this,r)).node()}};function Pn(t,{x:n,y:e,...r}={}){return r.frameAnchor===void 0&&([n,e]=Ge(n,e)),new Wf(t,{...r,x:n,y:e})}var mM={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Fi=class extends Pt{constructor(n,e={}){let{x:r,y:i,z:o,curve:a,tension:c}=e;super(n,{x:{value:r,scale:"x"},y:{value:i,scale:"y"},z:{value:Qf(e),optional:!0}},e,mM),this.z=o,this.curve=wy(a,c),Vi(this,e)}filter(n){return n}project(n,e,r){this.curve!==Or&&super.project(n,e,r)}render(n,e,r,i,o){let{x:a,y:c}=r,{curve:u}=this;return gt("svg:g",o).call(Kt,this,i,o).call(zt,this,e).call(s=>s.selectAll().data(bl(n,[a,c],this,r)).enter().append("path").call(It,this).call(yl,this,r).call($g,this,r,o).attr("d",u===Or&&o.projection?pM(o.path(),a,c):sa().curve(u).defined(f=>f>=0).x(f=>a[f]).y(f=>c[f]))).node()}};function pM(t,n,e){return n=Tn(n),e=Tn(e),r=>{let i=[],o=[i];for(let a of r)a===-1?(i=[],o.push(i)):i.push([n[a],e[a]]);return t({type:"MultiLineString",coordinates:o})}}function gM(t,{x:n,y:e,...r}={}){return[n,e]=Ge(n,e),new Fi(t,{...r,x:n,y:e})}function yM(t,n){let{x:e,y:r,stroke:i,z:o=i===e?null:void 0,...a}=Sy(n);return new Fi(t,{...a,x:e,y:r,z:o,stroke:i})}function ja(t,n){let{x:e,y:r,stroke:i,z:o=i===r?null:void 0,...a}=$y(n);return new Fi(t,{...a,x:e,y:r,z:o,stroke:i})}var bM={dot:Pn,line:gM,lineX:yM,lineY:ja,areaX:aM,areaY:Xa,ruleX:Ki,ruleY:je,barX:Yl,barY:fM,rect:Ol,rectX:g4,rectY:y4,cell:Va,bin:W4,binX:vy,binY:My,group:e5,groupX:t5,groupY:n5},u_=Object.fromEntries(Object.entries(bM).map(([t,n])=>[n,t]));var s_=new Uint8ClampedArray(4);var xf,u1;function xM(){if(u1)return xf;u1=1;function t(a,c,u,s,f){for(var d=f+1;s<=f;){var l=s+f>>>1,h=a[l],p=u!==void 0?u(h,c):h-c;p>=0?(d=l,f=l-1):s=l+1}return d}function n(a,c,u,s,f){for(var d=f+1;s<=f;){var l=s+f>>>1,h=a[l],p=u!==void 0?u(h,c):h-c;p>0?(d=l,f=l-1):s=l+1}return d}function e(a,c,u,s,f){for(var d=s-1;s<=f;){var l=s+f>>>1,h=a[l],p=u!==void 0?u(h,c):h-c;p<0?(d=l,s=l+1):f=l-1}return d}function r(a,c,u,s,f){for(var d=s-1;s<=f;){var l=s+f>>>1,h=a[l],p=u!==void 0?u(h,c):h-c;p<=0?(d=l,s=l+1):f=l-1}return d}function i(a,c,u,s,f){for(;s<=f;){var d=s+f>>>1,l=a[d],h=u!==void 0?u(l,c):l-c;if(h===0)return d;h<=0?s=d+1:f=d-1}return-1}function o(a,c,u,s,f,d){return typeof u=="function"?d(a,c,u,s===void 0?0:s|0,f===void 0?a.length-1:f|0):d(a,c,void 0,u===void 0?0:u|0,s===void 0?a.length-1:s|0)}return xf={ge:function(a,c,u,s,f){return o(a,c,u,s,f,t)},gt:function(a,c,u,s,f){return o(a,c,u,s,f,n)},lt:function(a,c,u,s,f){return o(a,c,u,s,f,e)},le:function(a,c,u,s,f){return o(a,c,u,s,f,r)},eq:function(a,c,u,s,f){return o(a,c,u,s,f,i)}},xf}var wf,s1;function wM(){if(s1)return wf;s1=1;var t=xM(),n=0,e=1,r=2;wf=S;function i(m,x,y,M,_){this.mid=m,this.left=x,this.right=y,this.leftPoints=M,this.rightPoints=_,this.count=(x?x.count:0)+(y?y.count:0)+M.length}var o=i.prototype;function a(m,x){m.mid=x.mid,m.left=x.left,m.right=x.right,m.leftPoints=x.leftPoints,m.rightPoints=x.rightPoints,m.count=x.count}function c(m,x){var y=b(x);m.mid=y.mid,m.left=y.left,m.right=y.right,m.leftPoints=y.leftPoints,m.rightPoints=y.rightPoints,m.count=y.count}function u(m,x){var y=m.intervals([]);y.push(x),c(m,y)}function s(m,x){var y=m.intervals([]),M=y.indexOf(x);return M<0?n:(y.splice(M,1),c(m,y),e)}o.intervals=function(m){return m.push.apply(m,this.leftPoints),this.left&&this.left.intervals(m),this.right&&this.right.intervals(m),m},o.insert=function(m){var x=this.count-this.leftPoints.length;if(this.count+=1,m[1]<this.mid)this.left?4*(this.left.count+1)>3*(x+1)?u(this,m):this.left.insert(m):this.left=b([m]);else if(m[0]>this.mid)this.right?4*(this.right.count+1)>3*(x+1)?u(this,m):this.right.insert(m):this.right=b([m]);else{var y=t.ge(this.leftPoints,m,p),M=t.ge(this.rightPoints,m,g);this.leftPoints.splice(y,0,m),this.rightPoints.splice(M,0,m)}},o.remove=function(m){var x=this.count-this.leftPoints;if(m[1]<this.mid){if(!this.left)return n;var y=this.right?this.right.count:0;if(4*y>3*(x-1))return s(this,m);var M=this.left.remove(m);return M===r?(this.left=null,this.count-=1,e):(M===e&&(this.count-=1),M)}else if(m[0]>this.mid){if(!this.right)return n;var _=this.left?this.left.count:0;if(4*_>3*(x-1))return s(this,m);var M=this.right.remove(m);return M===r?(this.right=null,this.count-=1,e):(M===e&&(this.count-=1),M)}else{if(this.count===1)return this.leftPoints[0]===m?r:n;if(this.leftPoints.length===1&&this.leftPoints[0]===m){if(this.left&&this.right){for(var $=this,A=this.left;A.right;)$=A,A=A.right;if($===this)A.right=this.right;else{var k=this.left,M=this.right;$.count-=A.count,$.right=A.left,A.left=k,A.right=M}a(this,A),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?a(this,this.left):a(this,this.right);return e}for(var k=t.ge(this.leftPoints,m,p);k<this.leftPoints.length&&this.leftPoints[k][0]===m[0];++k)if(this.leftPoints[k]===m){this.count-=1,this.leftPoints.splice(k,1);for(var M=t.ge(this.rightPoints,m,g);M<this.rightPoints.length&&this.rightPoints[M][1]===m[1];++M)if(this.rightPoints[M]===m)return this.rightPoints.splice(M,1),e}return n}};function f(m,x,y){for(var M=0;M<m.length&&m[M][0]<=x;++M){var _=y(m[M]);if(_)return _}}function d(m,x,y){for(var M=m.length-1;M>=0&&m[M][1]>=x;--M){var _=y(m[M]);if(_)return _}}function l(m,x){for(var y=0;y<m.length;++y){var M=x(m[y]);if(M)return M}}o.queryPoint=function(m,x){if(m<this.mid){if(this.left){var y=this.left.queryPoint(m,x);if(y)return y}return f(this.leftPoints,m,x)}else if(m>this.mid){if(this.right){var y=this.right.queryPoint(m,x);if(y)return y}return d(this.rightPoints,m,x)}else return l(this.leftPoints,x)},o.queryInterval=function(m,x,y){if(m<this.mid&&this.left){var M=this.left.queryInterval(m,x,y);if(M)return M}if(x>this.mid&&this.right){var M=this.right.queryInterval(m,x,y);if(M)return M}return x<this.mid?f(this.leftPoints,x,y):m>this.mid?d(this.rightPoints,m,y):l(this.leftPoints,y)};function h(m,x){return m-x}function p(m,x){var y=m[0]-x[0];return y||m[1]-x[1]}function g(m,x){var y=m[1]-x[1];return y||m[0]-x[0]}function b(m){if(m.length===0)return null;for(var x=[],y=0;y<m.length;++y)x.push(m[y][0],m[y][1]);x.sort(h);for(var M=x[x.length>>1],_=[],$=[],A=[],y=0;y<m.length;++y){var k=m[y];k[1]<M?_.push(k):M<k[0]?$.push(k):A.push(k)}var C=A,z=A.slice();return C.sort(p),z.sort(g),new i(M,b(_),b($),C,z)}function v(m){this.root=m}var w=v.prototype;w.insert=function(m){this.root?this.root.insert(m):this.root=new i(m[0],null,null,[m],[m])},w.remove=function(m){if(this.root){var x=this.root.remove(m);return x===r&&(this.root=null),x!==n}return!1},w.queryPoint=function(m,x){if(this.root)return this.root.queryPoint(m,x)},w.queryInterval=function(m,x,y){if(m<=x&&this.root)return this.root.queryInterval(m,x,y)},Object.defineProperty(w,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(w,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function S(m){return!m||m.length===0?new v(null):new v(b(m))}return wf}var f_=wM();function Wl(t){return{mapIndex(n,e,r){let i=+t(n,e);for(let o of n)r[o]=e[o]===null?NaN:e[o]/i}}}function Qi(t){return Wl((n,e)=>t(n,r=>e[r]))}var l_=Wl((t,n)=>{for(let e=0;e<t.length;++e){let r=n[t[e]];if(En(r))return r}}),d_=Wl((t,n)=>{for(let e=t.length-1;e>=0;--e){let r=n[t[e]];if(En(r))return r}});var h_=Qi(Gt),m_=Qi(ac),p_=Qi(Xr),g_=Qi(fn),y_=Qi(bn);var Hl="http://www.w3.org/2000/svg",Za=t=>String(t).replace(/[&<>"]/g,n=>({"&":"&","<":"<",">":">",'"':"""})[n]);function Ji(t,n,e){let r=document.createElementNS(Hl,t);for(let[i,o]of Object.entries(n))r.setAttribute(i,o);return e.appendChild(r),r}function Ny(t,n){let e=n.classList.contains("phone"),r=document.createElement("div");r.className="sequence",n.appendChild(r);let i=E=>getComputedStyle(r).getPropertyValue(E).trim(),o={line:i("--line"),soft:i("--soft"),accent:i("--accent"),hair:i("--hair"),muted:i("--muted")},a=document.createElement("div");a.className="seq-lanes",r.appendChild(a);let c=document.createElementNS(Hl,"svg");r.prepend(c);let u=r.clientWidth,s=t.participants.length,f=e?12:24,d=t.participants.map(E=>{let R=document.createElement("div");return R.className="node seq-who"+(E.tone?" accent":""),R.id="who-"+E.id,R.innerHTML=`<h3>${Za(E.name)}</h3>${E.kind?`<p>${Za(E.kind)}</p>`:""}`,a.appendChild(R),R}),l=(E,R,F)=>Object.assign(E.style,{left:R+"px",width:F+"px"}),h=t.participants.map((E,R)=>u/s*R).concat(u),p=()=>d.forEach((E,R)=>l(E,h[R]+f/2,h[R+1]-h[R]-f)),g=()=>d.some(E=>E.scrollWidth>E.clientWidth+1),b=()=>{let E=d.map(F=>(F.style.width="min-content",F.offsetWidth+f)),R=u-E.reduce((F,G)=>F+G,0);return R<0?!1:(h=[0],E.forEach(F=>h.push(h[h.length-1]+F+R/s)),!0)};p();let v=!1;g()&&(b()||(a.classList.add("tight"),b()||(h=t.participants.map((E,R)=>u/s*R).concat(u),v=s>2)),p(),v&&d.forEach((E,R)=>{let F=R>0?(h[R-1]+h[R])/2+f/2:0,G=R<s-1?(h[R+1]+h[R+2])/2-f/2:u;l(E,F,G-F)}));let w={};t.participants.forEach((E,R)=>{w[E.id]=(h[R]+h[R+1])/2});let S=Math.min(...t.participants.map((E,R)=>h[R+1]-h[R])),m=Math.max(...d.map(E=>E.offsetHeight)),x=m+(e?14:18),y={};d.forEach((E,R)=>{let F=v&&R%2===1;Object.assign(E.style,{height:m+"px",top:(F?x:0)+"px"}),y[t.participants[R].id]=(F?x:0)+m});let M=Math.max(...Object.values(y));a.style.height=M+"px";let _=e?20:24,$=8,A=e?26:32,k=10,C=t.repeats??[],z=[],L=M+(e?26:30),T=(E,R)=>{let F=document.createElement("div");return F.className="seq-msg"+(E.reply?" reply":"")+(E.tone?" accent":""),F.innerHTML=`<span class="seq-n"><span class="seq-ink">${R+1}</span></span><span class="seq-text"><span class="seq-ink">${Za(E.label)}</span>${E.note?`<span class="seq-note"><span class="seq-ink">${Za(E.note)}</span></span>`:""}</span>`,r.appendChild(F),F},B=(E,R)=>(E.style.maxWidth=Math.max(80,Math.floor(R))+"px",E.style.left="0px",E.offsetWidth);t.messages.forEach((E,R)=>{let F=C.find(I=>I.from===R+1);if(F){let I=document.createElement("div");I.className="seq-frame-label",I.textContent=F.label,r.appendChild(I);let U=t.messages.slice(F.from-1,F.to).flatMap(P=>[P.from,P.to]).map(P=>t.participants.findIndex(q=>q.id===P));I.style.top=L+"px",z.push({rep:F,tab:I,top:L+I.offsetHeight/2,lo:w[t.participants[Math.min(...U)].id],hi:w[t.participants[Math.max(...U)].id],labels:[]}),L+=I.offsetHeight+10}let G=T(E,R),Z=E.tone?o.accent:E.reply?o.soft:o.line;if(E.from===E.to){let I=w[E.from],U=u-(I+A+14),P=I-A-14,q=U>=Math.min(P,260)||U>=200,W=t.participants.map(yt=>w[yt.id]),N=q?Math.min(...W.filter(yt=>yt>I),1/0)-(I+A+14)-10:I-A-14-Math.max(...W.filter(yt=>yt<I),-1/0)-10,K=B(G,Math.min(q?U:P,N>=(e?130:150)?N:1/0)),X=G.offsetHeight,V=Math.max(X,30);G.style.left=(q?I+A+14:I-A-14-K)+"px",G.style.top=L+(V-X)/2+"px";let nt=q?1:-1,ct=I+nt*A;Ji("path",{d:`M${I},${L} H${ct} V${L+V} H${I+nt*(k+2)}`,fill:"none",stroke:Z,"stroke-width":2.25,"stroke-linejoin":"round"},c),Y(I,L+V,-nt,Z),L+=V+_}else{let I=w[E.from],U=w[E.to],P=Math.sign(U-I),q=Math.min(I,U),W=Math.max(I,U),N=e?150:180,K=Math.min(...Object.values(w).filter(ye=>ye>W),1/0),V=W-q-14>=(e?160:140)?W-q-14:Math.max(N,(K===1/0?u:(W+K)/2-6)-(q+6)),nt=B(G,Math.min(u,V)),ct=Math.max(0,Math.min(u-nt,q+6));G.style.left=ct+"px",G.style.top=L+"px";let yt=L+G.offsetHeight+$;Ji("line",{x1:I,y1:yt,x2:U-P*(k+1),y2:yt,stroke:Z,"stroke-width":2.25,...E.reply?{"stroke-dasharray":"7 6"}:{}},c),Y(U,yt,P,Z),L=yt+_}for(let I of z)R+1>=I.rep.from&&R+1<=I.rep.to&&I.labels.push(G);let it=z.find(I=>I.rep.to===R+1);it&&(it.bottom=L-_+14,L+=14)});let D=L-_+24;r.style.height=D+"px",c.setAttribute("width",u),c.setAttribute("height",D);let H=document.createElementNS(Hl,"g");c.prepend(H);let O=Math.min(S/2-4,40);for(let E of z)for(let R of E.labels)O=Math.max(O,E.lo-R.offsetLeft+8,R.offsetLeft+R.offsetWidth+8-E.hi);for(let E of z)E.left=Math.max(1,E.lo-O),E.right=Math.min(u-1,E.hi+O),E.tab.style.left=Math.max(E.left+14,Math.min(E.lo+6,E.right-14-E.tab.offsetWidth))+"px";for(let E of z)Ji("rect",{x:E.left,y:E.top,width:E.right-E.left,height:E.bottom-E.top,rx:10,fill:"none",stroke:o.muted,"stroke-opacity":.55,"stroke-width":1.5,"stroke-dasharray":"6 6"},H);for(let E of t.participants)Ji("line",{x1:w[E.id],y1:y[E.id],x2:w[E.id],y2:D,stroke:o.hair,"stroke-width":2},H);function Y(E,R,F,G){let Z=E-F*(k+2);Ji("path",{d:`M${E-F*1},${R} L${Z},${R-6.5} L${Z},${R+6.5} Z`,fill:G},c)}return r}var Ly="http://www.w3.org/2000/svg",at=t=>String(t).replace(/[&<>"]/g,n=>({"&":"&","<":"<",">":">",'"':"""})[n]),Ka=(t,n)=>t.show??t.text+(n??"");function Dy(t,n,e){let r=n.reduce((x,y)=>x+y.value,0);t.innerHTML="";let i=Object.assign(document.createElement("div"),{className:"fs-bar"}),o=Object.assign(document.createElement("div"),{className:"fs-rest"});t.append(i,o);let c=n.map(x=>{let y=document.createElement("div");return y.className="fs-seg"+(x.tone?" "+x.tone:""),y.style.flex=`${x.value/r} 1 0`,y.innerHTML=`<b>${at(Ka(x,e))}</b><span>${x.label}</span>`,i.appendChild(y),{p:x,seg:y}}).filter(x=>x.seg.scrollWidth>x.seg.clientWidth+1);if(!c.length){o.remove();return}let u=t.getBoundingClientRect();for(let x of c)x.seg.classList.add("fs-out"),x.item=document.createElement("span"),x.item.innerHTML=`<b>${at(Ka(x.p,e))}</b> ${x.p.label}`,x.item.style.cssText="position: absolute; white-space: nowrap;",o.appendChild(x.item);let s=u.width,f=22;for(let x of c){let y=x.seg.getBoundingClientRect();x.cx=y.left-u.left+y.width/2,x.w=x.item.offsetWidth}let d=getComputedStyle(t).getPropertyValue("--line").trim(),l=[],h;for(let x of c)x.x=Math.max(0,Math.min(s-x.w,x.cx-x.w/2));for(let x=1;x<c.length;x++)c[x].x=Math.max(c[x].x,c[x-1].x+c[x-1].w+f);for(let x=c.length-1;x>=0;x--){let y=x===c.length-1?s-c[x].w:c[x+1].x-f-c[x].w;c[x].x=Math.min(c[x].x,y)}let p=28,g=Math.max(...c.map(x=>x.w)),b=Math.min(...c.map(x=>x.cx)),v=Math.max(...c.map(x=>x.cx)),w=b-p>=g?"left":s-v-p>=g?"right":null;if(!c.some(x=>c.some(y=>y!==x&&y.cx>x.x&&y.cx<x.x+x.w))||!w){for(let y of c){y.y=26;let M=Math.max(y.x+8,Math.min(y.x+y.w-8,y.cx));l.push(`M${y.cx},-8 V${26/2-4} H${M} V23`)}h=26+c[0].item.offsetHeight}else{let y=c[0].item.offsetHeight+8,M=w==="left",_=[...c].sort(($,A)=>M?$.cx-A.cx:A.cx-$.cx);_.forEach(($,A)=>{$.y=14+A*y;let k=$.y+$.item.offsetHeight/2;if(M){let C=b-p;$.right=s-C,l.push(`M${$.cx},-8 V${k} H${C+6}`)}else{let C=v+p;$.x=C,l.push(`M${$.cx},-8 V${k} H${C-6}`)}}),h=14+_.length*y-8}o.style.cssText=`position: relative; display: block; height: ${h}px;`;let m=document.createElementNS(Ly,"svg");m.setAttribute("width",s),m.setAttribute("height",h),m.setAttribute("style","position:absolute;left:0;top:0;overflow:visible"),o.appendChild(m);for(let x of c)x.item.style.cssText=`position: absolute; ${x.right===void 0?`left: ${x.x}`:`right: ${x.right}`}px; top: ${x.y}px; white-space: nowrap;`;for(let x of l){let y=document.createElementNS(Ly,"path");for(let[M,_]of Object.entries({d:x,fill:"none",stroke:d,"stroke-width":1.5}))y.setAttribute(M,_);m.appendChild(y)}}function Oy(t,n,e,r,i){let o=r??Math.max(...n.map(s=>Math.max(s.value,s.high??0)));t.innerHTML="";let a=n.map(s=>{let f=Object.assign(document.createElement("div"),{className:"fb-label",innerHTML:s.label+(s.n!==void 0?`<span class="fb-n">${i?`${at(s.n.toLocaleString("en-GB"))} ${at(i)}`:`n = ${at(s.n.toLocaleString("en-GB"))}`}</span>`:"")}),d=Object.assign(document.createElement("div"),{className:"fb-track"}),l=s.tone?" "+s.tone:"",h=s.low!==void 0,p=h?`<span class="fb-sub">${at(Ut(s.low))}\u2013${at(Ut(s.high))}${at(e??"")}</span>`:"";d.innerHTML=`<div class="fb-bar${l}${h?" dim":""}"></div>${h?`<div class="fb-range${l}"></div>`:""}<div class="fb-val${s.tone?" lead "+s.tone:""}">${at(Ka(s,e))}${p}${s.note?`<span class="fb-sub">${at(s.note)}</span>`:""}</div>`,t.append(f,d);let g=b=>o>0?Math.max(0,b)/o:0;return{b:s,bar:d.firstChild,range:d.querySelector(".fb-range"),val:d.querySelector(".fb-val"),ratio:g(s.value),lo:g(s.low??0),hi:g(s.high??0)}}),c=Math.max(...[...t.querySelectorAll(".fb-val")].map(s=>s.offsetWidth))+12,u=s=>`calc((100% - ${c}px) * ${s})`;for(let s of a)s.bar.style.width=u(s.ratio),s.range&&(s.range.style.left=u(s.lo),s.range.style.width=u(s.hi-s.lo),s.val.style.marginLeft=`max(0px, calc((100% - ${c}px) * ${s.hi-s.ratio} - 3px))`)}function MM(t){let n=document.createElement("p");return n.className="range-key",n.innerHTML=(t.range?`<span><i class="${t.type==="bars"?"whisker":"band"}"></i>${at(t.range)}</span>`:"")+(t.ref?`<span><i class="dash"></i>${at(t.ref.label)}</span>`:""),n}var _M='<svg width="56" height="24" viewBox="0 0 56 24" aria-hidden="true"><path d="M2 12 H48 M38 3 L50 12 L38 21" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>';function Iy(t,n){let e=n.max??Math.max(n.before.value,n.after.value),r=n.after.tone??"accent",i=(o,a)=>`<div class="fc-side ${a}"><span class="fc-when">${at(o.label)}</span><b class="fc-num">${at(Ka({...o,text:String(o.value)},n.unit))}</b><div class="fc-bar" style="width:${e>0?100*o.value/e:0}%"></div></div>`;t.innerHTML=i(n.before,"before")+`<div class="fc-arrow">${_M}</div>`+i(n.after,"after "+r)}var ge=t=>{let n=e=>getComputedStyle(t).getPropertyValue(e).trim();return{css:n,ink:n("--ink"),muted:n("--muted"),soft:n("--soft"),fill:n("--fill"),fill2:n("--fill2"),hair:n("--hair"),paper:n("--paper"),line:n("--line"),accent:n("--accent"),second:n("--second"),good:n("--good"),bad:n("--bad"),small:parseFloat(n("--small"))||15,body:parseFloat(n("--body"))||16,sans:n("--sans")}},pe=t=>typeof t=="number"?t:new Date(t),Ut=t=>(Math.abs(t)>=100?Math.round(t):Math.round(t*10)/10).toLocaleString("en-GB");function $M(t,n){let e=Math.abs(n-t)/864e5;return e<1?`${Ut(e*24)} hours`:`${Ut(e)} ${e===1?"day":"days"}`}function Ct(t,n,e,r=400){let i=document.createElement("span");i.style.cssText=`position:absolute;visibility:hidden;white-space:nowrap;font-size:${e}px;font-weight:${r}`,t.appendChild(i);let o=Math.max(...n.map(a=>(i.textContent=a,i.getBoundingClientRect().width)));return i.remove(),o}function Ke(t,n,e){t.classList.add("chart"),t.innerHTML="",t.appendChild(Il({...e,style:{background:"transparent",color:n.muted,fontFamily:n.sans,fontSize:n.small+"px",overflow:"visible"}}))}function zy(t,n){let e=ge(t),r=Math.floor(t.clientWidth)||640,i=typeof n.rows[0].from=="string",o=n.rows.map(h=>({...h,a:pe(h.from),b:pe(h.to)}));for(let h of o)h.text=h.gap??(i?$M(h.a,h.b):Ut(Math.abs(h.b-h.a))+(n.unit??"")),h.mid=i?new Date((+h.a+ +h.b)/2):(h.a+h.b)/2,h.color=e[h.tone??"accent"];let a=o.flatMap(h=>[+h.a,+h.b]),c=Math.min(...a),u=Math.max(...a),s=(u-c||1)*.08,f=i?[new Date(c-s),new Date(u+s)]:[c-s,u+s],d=Ct(t,o.map(h=>h.label),e.body);Ke(t,e,{width:r,height:o.length*92+50,marginLeft:Math.ceil(d)+28,marginRight:24,marginTop:0,marginBottom:40,x:{domain:f,ticks:r<600?4:5,label:null,tickFormat:i?void 0:h=>Ut(h)+(n.unit??"")},y:{domain:o.map(h=>h.label),axis:null,padding:.5},marks:[pt(o,{y:"label",text:"label",frameAnchor:"left",dx:-(Math.ceil(d)+28),textAnchor:"start",fill:e.ink,fontSize:e.body}),Ey(o,{x1:"a",x2:"b",y1:"label",y2:"label",stroke:"color",strokeWidth:3}),Pn(o,{x:"a",y:"label",r:6.5,fill:e.fill}),Pn(o.filter(h=>h.b>=h.a),{x:"b",y:"label",symbol:"triangle2",r:7.5,dx:-5,fill:"color",rotate:90}),Pn(o.filter(h=>h.b<h.a),{x:"b",y:"label",symbol:"triangle2",r:7.5,dx:5,fill:"color",rotate:-90}),pt(o,{x:"mid",y:"label",text:"text",dy:-22,fill:e.ink,fontWeight:600,fontSize:e.small})]});let l=document.createElement("p");l.className="fd-key",l.innerHTML=`<span class="fd-from"><i></i>${at(n.fromLabel)}</span><span class="fd-to${o.every(h=>h.b<h.a)?" back":""}" style="color:${e.accent}"><i></i>${at(n.toLabel)}</span>`,l.style.marginLeft=d+"px",t.prepend(l)}function Fy(t,n){let e=ge(t),r=Math.floor(t.clientWidth)||640,i=n.points.map(M=>({x:pe(M.x),y:M.y,low:M.low,high:M.high})),o=i[0].low!==void 0,a=i.findIndex(M=>+M.x==+pe(n.mark.x)),c=i[a],u=i.slice(Math.max(0,a-3),a+4).map(M=>M.y),s=c.y>=u.reduce((M,_)=>M+_,0)/u.length,f=[...i.flatMap(M=>o?[M.y,M.low,M.high]:[M.y]),...n.ref?[n.ref.y]:[]],d=n.zero??!0,l=Math.max(...f),h=d?Math.min(0,...f):Math.min(...f),p=M=>Ut(M)+(n.unit??""),g=Ct(t,[p(l),p(h)],e.small),b=Math.ceil(g)+14,v=r-b-20,S=b+v*((+c.x-+i[0].x)/(+i[i.length-1].x-+i[0].x))+14+Ct(t,[n.mark.label],e.body,600)<=r-20,m=d?(c.y-h)/(l*1.04-h)*270:1/0,x=s?-12:Math.min(0,m-18);!S&&a>0&&(x=i[a-1].y<=c.y?-18:20);let y=S?14:a>0?8:-14;Ke(t,e,{width:r,height:340,marginLeft:b,marginRight:20,marginTop:30,marginBottom:40,x:{label:null,ticks:r<600?4:5,insetLeft:18},y:{label:null,grid:!0,ticks:4,tickSize:0,domain:d?[h,l*1.04]:void 0,tickFormat:p},marks:[d?je([0],{stroke:e.line}):null,o?Xa(i,{x:"x",y1:"low",y2:"high",fill:e.fill,fillOpacity:.3}):null,n.ref?je([n.ref.y],{stroke:e.soft,strokeWidth:1.5,strokeDasharray:"5,4"}):null,ja(i,{x:"x",y:"y",stroke:o?e.muted:e.fill,strokeWidth:2.5}),Pn([c],{x:"x",y:"y",r:6.5,fill:e.accent}),pt([c],{x:"x",y:"y",text:()=>n.mark.label,dx:y,dy:x,textAnchor:S?"start":"end",fill:e.accent,fontWeight:600,fontSize:e.body})]})}function qy(t,n,e){let r=t.length,i=[];for(let d=1;d<=3;d++)for(let l=1;l<=(e?2:3);l++)d*l>=r&&d*l-r<Math.min(d,l)&&i.push([d,l]);let o=new Map(t.map((d,l)=>[d.id,l])),a=n.map(d=>[o.get(d.from),o.get(d.to)]),c=(d,l,h,p)=>{let g=(b,v,w)=>Math.sign((v[0]-b[0])*(w[1]-b[1])-(v[1]-b[1])*(w[0]-b[0]));return g(d,l,h)*g(d,l,p)<0&&g(h,p,d)*g(h,p,l)<0},u=([d,l])=>[l*1.6,d],s=(d,l,h)=>{let[p,g]=u(d),[b,v]=u(l),[w,S]=u(h),m=.55,x=.32;for(let y=.04;y<1;y+=.04){let M=p+(b-p)*y,_=g+(v-g)*y;if(Math.abs(M-w)<m&&Math.abs(_-S)<x)return!0}return!1},f=null;for(let[d,l]of i){let h=[];for(let w=0;w<d;w++)for(let S=0;S<l;S++)h.push([w,S]);let p=new Array(h.length).fill(!1),g=new Array(r),b=()=>{let w=d*.6+l*.3,S=g.map(m=>h[m]);a.forEach(([m,x],y)=>{let M=S[m],_=S[x],[$,A]=u(M),[k,C]=u(_);w+=Math.hypot(k-$,C-A)*1.2,M[0]!==_[0]&&M[1]!==_[1]&&(w+=1.5),M[0]<_[0]&&(w+=3),S.forEach((z,L)=>{L!==m&&L!==x&&s(M,_,z)&&(w+=12)});for(let[z,L]of a.slice(y+1))z!==m&&z!==x&&L!==m&&L!==x&&c(u(M),u(_),u(S[z]),u(S[L]))&&(w+=8)});for(let m=0;m<d;m++)for(let x=1;x<l-1;x++)!S.some(y=>y[0]===m&&y[1]===x)&&S.some(y=>y[0]===m)&&(w+=4);return w},v=w=>{if(w===r){let S=b();(!f||S<f.s-1e-9)&&(f={s:S,rows:d,cols:l,pos:g.map(m=>h[m])});return}for(let S=0;S<h.length;S++)p[S]||(p[S]=!0,g[w]=S,v(w+1),p[S]=!1)};v(0)}return f}function SM(t,n){let e=n.classList.contains("phone"),{rows:r,cols:i,pos:o}=qy(t.records,t.refs,e),a=document.createElement("div");a.className="entities",a.style.cssText=`grid-template-columns: repeat(${i}, minmax(0, 1fr)); grid-template-rows: repeat(${r}, auto);`,t.records.forEach((c,u)=>{let s=c.fields??[],f=document.createElement("div");f.className="node record"+(c.tone?" accent":""),f.id="rec-"+c.id,f.style.gridArea=`${o[u][0]+1} / ${o[u][1]+1}`,f.innerHTML=`<h3>${at(c.name)}</h3>${s.length?`<ul>${s.map(d=>`<li>${at(d)}</li>`).join("")}</ul>`:""}`,a.appendChild(f)}),n.appendChild(a);for(let c of t.refs){let u=document.createElement("fig-arrow");u.setAttribute("from","rec-"+c.from),u.setAttribute("to","rec-"+c.to),u.setAttribute("ref",c.count),c.optional&&u.setAttribute("dashed",""),n.appendChild(u)}}var kM={split:"fig-split",bars:"fig-bars","before-after":"fig-change",dumbbell:"div",series:"div",groups:"div",lines:"div",panels:"div",heatmap:"div",dots:"div",scatter:"div",units:"div"};function AM(t,n){let e=document.createElement("header");if(e.innerHTML=`<h1>${at(t.title)}</h1>${t.note?`<p class="read">${at(t.note)}</p>`:""}`,(t.range||t.ref)&&e.appendChild(MM(t)),t.type==="entities"){if(n.append(e),SM(t,n),t.source){let o=document.createElement("footer");o.innerHTML=`<p>${at(t.source)}</p>`,n.append(o)}return{chart:n.querySelector(".entities"),draw:()=>{}}}if(t.type==="sequence"){n.append(e);let o=Ny(t,n);if(t.source){let a=document.createElement("footer");a.innerHTML=`<p>${at(t.source)}</p>`,n.append(a)}return{chart:o,draw:()=>{}}}let r=document.createElement(kM[t.type]);if(n.append(e,r),t.source){let o=document.createElement("footer");o.innerHTML=`<p>${at(t.source)}</p>`,n.append(o)}let i=()=>{if(t.type==="before-after")return Iy(r,t);if(t.type==="dumbbell")return zy(r,t);if(t.type==="series")return Fy(r,t);if(t.type==="groups")return Ul(r,t,{unit:t.unit,max:t.max});if(t.type==="lines")return Gl(r,t,{unit:t.unit,xTicks:t.xTicks});if(t.type==="panels")return By(r,t);if(t.type==="heatmap")return Yy(r,t);if(t.type==="dots")return Uy(r,t);if(t.type==="scatter")return Gy(r,t);if(t.type==="units")return Xy(r,t);let o=(t.parts??t.bars).map(a=>({...a,text:String(a.value),label:at(a.label)}));t.type==="split"?Dy(r,o,t.unit):Oy(r,o,t.unit,t.max,t.each)};return i(),{chart:r,draw:i}}var Yr=t=>!!t.closest(".phone");function Ul(t,n,e={}){let r=ge(t),i=Math.floor(t.clientWidth)||640,o=Yr(t)||i<420,{series:a,groups:c,accent:u}=n,s=r[u.tone??"accent"],f=c.flatMap(m=>a.map((x,y)=>({g:m.label,s:x,v:m.values[y],hi:(u.series===void 0||u.series===x)&&(u.group===void 0||u.group===m.label)}))),d=m=>Ut(m)+(e.unit??""),l=e.max??Math.max(...f.map(m=>m.v)),h=0,p=Math.ceil(Math.max(Ct(t,a,r.body)+h,Ct(t,c.map(m=>m.label),r.body,600)))+14,g=Math.ceil(Ct(t,f.map(m=>d(m.v)),r.body,600))+12,b=Math.max(o?34:38,Math.ceil(r.body*1.75)),v=Math.max(30,Math.ceil(r.body*1.7)),w=22,S=a.length*b+v+w;Ke(t,r,{width:i,height:c.length*S-w+8,marginLeft:p,marginRight:g,marginTop:v,marginBottom:8,x:{domain:[0,l],axis:null},y:{domain:a,axis:null,padding:.18},fy:{domain:c.map(m=>m.label),axis:null,paddingInner:(v+w)/S,paddingOuter:0},marks:[Ki([0],{stroke:r.line}),Yl(f,{x:"v",y:"s",fy:"g",fill:m=>m.hi?s:r.fill,rx:2}),pt(f,{x:"v",y:"s",fy:"g",text:m=>d(m.v),dx:6,textAnchor:"start",fill:m=>m.hi?s:r.ink,fontWeight:m=>m.hi?600:400,fontSize:r.body}),pt(f,{x:0,y:"s",fy:"g",text:"s",dx:-p+h,textAnchor:"start",fill:r.ink,fontSize:r.body}),pt(c.map(m=>m.label),{fy:m=>m,frameAnchor:"top-left",dx:-p,dy:-v+2,text:m=>m,textAnchor:"start",lineAnchor:"top",fill:e.quietGroups?r.muted:r.ink,fontWeight:600,fontSize:r.body*1.06})]})}function Gl(t,n,e={}){let r=ge(t),i=Math.floor(t.clientWidth)||640,o=Yr(t)||i<420,a=[r.fill2,r.fill],c=n.series.map(_=>({..._,band:_.points[0].low!==void 0,pts:_.points.map($=>({x:pe($.x),y:$.y,low:$.low,high:$.high,s:_.label}))})),u=c.filter(_=>_.label!==n.accent);u.forEach((_,$)=>{_.color=a[$%2],_.w=2.25});let s=c.find(_=>_.label===n.accent);s.color=r.accent,s.w=3.25;let f=c.flatMap(_=>_.pts.flatMap($=>_.band?[$.y,$.low,$.high]:[$.y])),d=n.zero??!0,l=e.domain??[d?Math.min(0,...f):Math.min(...f),Math.max(...f)*1.04],h=_=>Ut(_)+(e.unit??""),p=o?260:300,g=n.mark?28:10,b=36,v=[...u,s].map(_=>({l:_,last:_.pts[_.pts.length-1]})),w=Math.ceil(Ct(t,v.map(_=>_.l.label),r.small,600))+14,S=_=>g+(1-(_-l[0])/(l[1]-l[0]))*(p-g-b),m=v.map(_=>({..._,y:S(_.last.y)})).sort((_,$)=>_.y-$.y),x=r.small*1.3;for(let _=1;_<m.length;_++)m[_].y=Math.max(m[_].y,m[_-1].y+x);for(let _=m.length-2;_>=0;_--)m[_].y=Math.min(m[_].y,m[_+1].y-x);let y=Math.ceil(Ct(t,[h(l[1]),h(l[0])],r.small))+12,M=n.mark&&s.pts.find(_=>+_.x==+pe(n.mark.x));Ke(t,r,{width:i,height:p,marginLeft:y,marginRight:w,marginTop:g,marginBottom:b,x:e.xTicks?{label:null,insetLeft:18,ticks:e.xTicks.map(_=>pe(_.x)),tickFormat:_=>e.xTicks.find($=>+pe($.x)==+_)?.label??""}:{label:null,insetLeft:18,ticks:i<520?3:5,tickFormat:typeof c[0].pts[0].x=="number"?_=>Ut(_):void 0},y:{domain:l,nice:!1,label:null,grid:!0,ticks:4,tickSize:0,tickFormat:h},marks:[d?je([0],{stroke:r.line}):null,...[...u,s].filter(_=>_.band).map(_=>Xa(_.pts,{x:"x",y1:"low",y2:"high",fill:_.color,fillOpacity:_===s?.22:.18})),...[...u,s].map(_=>ja(_.pts,{x:"x",y:"y",stroke:_.color,strokeWidth:_.w})),pt(m,{x:_=>_.last.x,y:_=>l[0]+(1-(_.y-g)/(p-g-b))*(l[1]-l[0]),text:_=>_.l.label,dx:8,textAnchor:"start",fill:_=>_.l===s?r.accent:r.muted,fontWeight:600,fontSize:r.small}),M?Pn([M],{x:"x",y:"y",r:6,fill:r.accent}):null,M?pt([M],{x:"x",y:"y",text:()=>n.mark.label,dy:-16,fill:r.accent,fontWeight:600,fontSize:r.small}):null]})}function By(t,n){t.className="panels",t.innerHTML="";let e=n.panels.map(r=>{let i=document.createElement("div");i.className="panel",i.innerHTML=`<h2>${at(r.label)}</h2>`;let o=document.createElement("div");return i.appendChild(o),t.appendChild(i),{p:r,chart:o}});if(n.chart==="groups"){let r=n.max??Math.max(...n.panels.flatMap(i=>i.groups.flatMap(o=>o.values)));for(let{p:i,chart:o}of e){let a=n.accent.group&&!i.groups.some(c=>c.label===n.accent.group)?{...n.accent,series:"\0"}:n.accent;Ul(o,{series:n.series,groups:i.groups,accent:a},{unit:n.unit,max:r,quietGroups:!0})}}else{let r=n.panels.flatMap(a=>a.series.flatMap(c=>c.points.flatMap(u=>u.low!==void 0?[u.y,u.low,u.high]:[u.y]))),i=n.zero??!0,o=[i?Math.min(0,...r):Math.min(...r),Math.max(...r)*1.04];for(let{p:a,chart:c}of e)Gl(c,{series:a.series,accent:n.accent,zero:i},{unit:n.unit,domain:o,xTicks:n.xTicks})}}function Yy(t,n){let e=ge(t),r=Math.floor(t.clientWidth)||640,i=Yr(t)||r<420,o=n.rows.flatMap((M,_)=>n.columns.map(($,A)=>({r:String(M),c:String($),v:n.values[_][A]}))),a=o.map(M=>M.v),c=Math.min(...a),u=Math.max(...a),s=pl({color:{type:"linear",scheme:"blues",domain:[c-(u-c)*.08,u]}}),f=M=>s.apply(M),d=[0,.25,.5,.75,1].map(M=>f(c+(u-c)*M)).join(", "),l=M=>Ut(M)+(n.unit??""),h=n.columns.map(String),p=n.rows.map(String),g=Math.ceil(Ct(t,p,e.small))+12,v=(r-g-8)/h.length>=48&&o.length<=72,w=i?5:9,S=[1,2,3,4,5,6,8,10,12].filter(M=>h.length/M<=w),m=S.find(M=>h.length%M===0)??S[0]??Math.ceil(h.length/w),x=i?30:36,y=document.createElement("p");y.className="hm-key",y.innerHTML=`<span>${at(l(c))}</span><i style="background:linear-gradient(90deg, ${d})"></i><span>${at(l(u))}</span>`+(n.mark?`<span style="margin-left:14px;white-space:nowrap;display:inline-flex;align-items:center;gap:8px;color:${e.ink};font-weight:600"><i style="width:16px;height:16px;border:2.5px solid ${e.accent};border-radius:2px;background:none"></i>${at(n.mark.label)}</span>`:""),Ke(t,e,{width:r,height:p.length*x+36,marginLeft:g,marginRight:8,marginTop:0,marginBottom:36,x:{domain:h,label:null,tickSize:0,tickFormat:(M,_)=>_%m===0?M:"",padding:.06},y:{domain:p,label:null,tickSize:0,padding:.08},marks:[Va(o,{x:"c",y:"r",fill:M=>f(M.v),inset:.5}),v?pt(o,{x:"c",y:"r",text:M=>l(M.v),fill:M=>(M.v-c)/(u-c||1)>.55?"#ffffff":e.ink,fontSize:e.small}):null,n.mark?Va([{r:String(n.mark.row),c:String(n.mark.column)}],{x:"c",y:"r",fill:"none",stroke:e.accent,strokeWidth:2.5}):null]}),y.style.marginLeft=g+"px",t.prepend(y)}function Wy(t,n){let e=2*n+1,r=t.map((a,c)=>c).sort((a,c)=>t[a]-t[c]),i=new Array(t.length),o=[];for(let a of r){let c=t[a],u=o.filter(l=>Math.abs(l.x-c)<e),s=l=>u.every(h=>(h.x-c)**2+(h.y-l)**2>=e*e-1e-6),d=[0,...u.flatMap(l=>{let h=Math.sqrt(Math.max(0,e*e-(l.x-c)**2));return[l.y+h,l.y-h]})].sort((l,h)=>Math.abs(l)-Math.abs(h)||h-l).find(s)??0;i[a]=d,o.push({x:c,y:d})}return i}var Hy=t=>{let n=[...t].sort((r,i)=>r-i),e=n.length>>1;return n.length%2?n[e]:(n[e-1]+n[e])/2};function Uy(t,n){let e=ge(t),r=Math.floor(t.clientWidth)||640,i=Yr(t)||r<460,o=k=>Ut(k)+(n.unit??""),a=n.groups.flatMap(k=>k.values),c=n.zero?0:Math.min(...a),u=n.max??Math.max(...a),s=n.groups.map(k=>n.each?`${k.values.length.toLocaleString("en-GB")} ${n.each}`:`n = ${k.values.length.toLocaleString("en-GB")}`),f=n.groups.length>1,d=i||!f?0:Math.ceil(Math.max(Ct(t,n.groups.map(k=>k.label),e.body,600),Ct(t,s,e.small)))+24,l=Math.max(d+10,Math.ceil(Ct(t,[o(c)],e.small)/2)+2),h=18,p=pl({x:{domain:[c,u===c?c+1:u],range:[l,r-h],nice:!0}}),g=Math.max(2,Math.min(6,Math.floor((r-l-h)/(Ct(t,p.domain.map(o),e.small)+32)))),b=i?56:64,v=i?6:7.5,w;for(;w=n.groups.map(C=>Wy(C.values.map(z=>p.apply(z)),v)),!(Math.max(...w.flat().map(Math.abs))<=b||v<=2.5);)v-=.5;let S=n.summary,m=[],x=[],y=(i&&f?Math.ceil(e.small*2.7):0)+(S?Math.ceil(e.small*1.6):0),M=6;n.groups.forEach((k,C)=>{let z=Math.max(...w[C].map(Math.abs))+v,L=M+y,T=L+z,B=S==="mean"?k.values.reduce((H,O)=>H+O,0)/k.values.length:S?Hy(k.values):null,D=k.tone?e[k.tone]:e.fill;k.values.forEach((H,O)=>m.push({v:H,y:T+w[C][O],colour:D,g:k.label})),x.push({g:k,top:L,mid:T,bottom:T+z,s:B,label:k.label,count:s[C],colour:D,tone:k.tone}),M=T+z+(i?22:26)});let _=M-(i?22:26)+8+40,$=n.mark&&m.find(k=>k.g===n.mark.group&&k.v===n.mark.value),A=$&&p.apply($.v)+Ct(t,[n.mark.label],e.small,600)>r-h;if(Ke(t,e,{width:r,height:_,marginLeft:l,marginRight:h,marginTop:0,marginBottom:40,x:{domain:p.domain,nice:!1,label:null,ticks:g,tickFormat:o},y:{type:"identity",axis:null},marks:[Al({ticks:g,stroke:e.hair,strokeOpacity:1,y1:0,y2:_-40}),S?Ki(x,{x:"s",y1:k=>k.top-6,y2:k=>k.bottom+6,stroke:e.ink,strokeWidth:2.5}):null,Pn(m,{x:"v",y:"y",r:v,fill:"colour",stroke:e.paper,strokeWidth:1}),S?pt(x,{x:"s",y:k=>k.top-10,text:k=>`${S} ${o(k.s)}`,lineAnchor:"bottom",fill:e.muted,fontSize:e.small,stroke:e.paper,strokeWidth:6,paintOrder:"stroke"}):null,f&&!i?pt(x,{frameAnchor:"left",y:k=>k.mid-e.small*.6,text:"label",textAnchor:"start",dx:-l,fill:k=>k.tone?e[k.tone]:e.ink,fontWeight:600,fontSize:e.body}):null,f&&!i?pt(x,{frameAnchor:"left",y:k=>k.mid+e.small*.7,text:"count",textAnchor:"start",dx:-l,fill:e.muted,fontSize:e.small}):null,f&&i?pt(x,{frameAnchor:"left",y:k=>k.top-y+2,text:"label",textAnchor:"start",lineAnchor:"top",dx:-l,fill:k=>k.tone?e[k.tone]:e.ink,fontWeight:600,fontSize:e.small,stroke:e.paper,strokeWidth:6,paintOrder:"stroke"}):null,f&&i?pt(x,{frameAnchor:"left",y:k=>k.top-y+2+e.small*1.3,text:"count",textAnchor:"start",lineAnchor:"top",dx:-l,fill:e.muted,fontSize:e.small,stroke:e.paper,strokeWidth:6,paintOrder:"stroke"}):null,$?Pn([$],{x:"v",y:"y",r:v+3.5,stroke:e.accent,strokeWidth:2.5,fill:"none"}):null,$?pt([$],{x:"v",y:k=>k.y-v-9,text:()=>n.mark.label,dx:A?v+3.5:-(v+3.5),lineAnchor:"bottom",textAnchor:A?"end":"start",fill:e.accent,fontWeight:600,fontSize:e.small}):null]}),!f){let k=document.createElement("p");k.className="dots-n",k.textContent=s[0],t.prepend(k)}}var TM={seconds:1,minutes:60,hours:3600,days:86400},Ze=[[1,"1 s",1],[10,"10 s",2],[60,"1 min",1],[600,"10 min",2],[3600,"1 h",1],[21600,"6 h",2],[86400,"1 day",1],[604800,"1 wk",1],[2592e3,"1 mo",1],[31536e3,"1 yr",1]];function Py(t){let n=(e,r)=>`${Ut(e)} ${r}`;return t===0?"0":t<60?n(t,"s"):t<3600?n(t/60,"min"):t<172800?n(t/3600,"h"):n(t/86400,"days")}function Ry(t,n,e,r,i){let o=Math.min(...n),a=Math.max(...n),c=t.time?TM[t.time]:1,u=t.time?d=>Py(d*c):d=>(Math.abs(d)>0&&Math.abs(d)<1?String(+d.toPrecision(2)):Ut(d))+(t.unit??"");if(t.log&&t.time){let d=o*c,l=a*c,h=[...Ze].reverse().find(([b])=>b<=d)??Ze[0],p=Ze.find(([b])=>b>=l)??Ze[Ze.length-1],g=Ze.filter(([b])=>b>=h[0]&&b<=p[0]);return g.length>7&&(g=g.filter(b=>b[2]===1||b===h||b===p)),{type:"log",domain:[h[0]/c,p[0]/c],ticks:g.map(([b])=>b/c),fmt:b=>Ze.find(([v])=>Math.abs(v-b*c)<1e-6)?.[1]??Py(b*c)}}if(t.log){let d=Math.floor(Math.log10(o)),l=Math.ceil(Math.log10(a)),h=l-d>3?[1]:[1,3],p=[];for(let g=d;g<=l;g++)for(let b of h)b*10**g<=10**l&&p.push(b*10**g);return{type:"log",domain:[10**d,10**l],ticks:p,fmt:u}}let s=t.zero?[Math.min(0,o),a]:[o,a],f=Math.max(2,Math.min(6,Math.floor(i/(Ct(e,s.map(u),r.small)+32))));return{type:"linear",domain:s,ticks:f,fmt:u,nice:!0}}function Gy(t,n){let e=ge(t),r=Math.floor(t.clientWidth)||640,i=Yr(t)||r<460,o=[...n.points].sort(($,A)=>($.tone||$.label?1:0)-(A.tone||A.label?1:0)),a=Ry(n.y,o.map($=>$.y),t,e,300),c=Math.ceil(Ct(t,(Array.isArray(a.ticks)?a.ticks:a.domain).map(a.fmt),e.small))+14,u=Ry(n.x,o.map($=>$.x),t,e,r-c-16),s=$=>$.type==="log"?{...$,type:"linear",domain:$.domain.map(Math.log10),ticks:$.ticks.map(Math.log10),fmt:A=>$.fmt(10**A),at:Math.log10}:{...$,at:A=>A},f=s(u),d=s(a),l=o.map($=>({...$,px:f.at($.x),py:d.at($.y)})),h=i?340:420,p=(o.length>300?3.5:o.length>80?4.5:6)*(i?.8:1),g=o.length>150?.45:.7,b=$=>u.type==="log"?Math.log10($):$,[v,w]=u.domain.map(b),S=$=>b($.x)>(v+w)/2,m=[];if(n.medians){let $=u.type==="log"?Array.from({length:Math.round(w-v)+1},(A,k)=>10**(v+k)):Array.from({length:6},(A,k)=>u.domain[0]+(u.domain[1]-u.domain[0])*k/5);for(let A=0;A+1<$.length;A++){let k=o.filter(L=>L.x>=$[A]&&(A+2===$.length?L.x<=$[A+1]:L.x<$[A+1]));if(k.length<5)continue;let C=k.map(L=>L.y).sort((L,T)=>L-T),z=L=>C[Math.min(C.length-1,Math.max(0,Math.round(L*(C.length-1))))];m.push({a:Math.min(...k.map(L=>L.x)),b:Math.max(...k.map(L=>L.x)),m:Hy(C),q1:z(.25),q3:z(.75)})}}let x=Math.ceil(e.small*1.4)+20,y=Math.ceil(e.small*2.6)+14,M=Array.isArray(f.ticks)?f.fmt(f.ticks[f.ticks.length-1]):f.fmt(f.domain[1]),_=Math.max(16,Math.ceil(Ct(t,[M],e.small)/2)-p-4);if(Ke(t,e,{width:r,height:h,marginLeft:c,marginRight:_,marginTop:x,marginBottom:y,x:{domain:f.domain,nice:f.nice??!1,inset:p+6,label:null,ticks:f.ticks,tickFormat:f.fmt},y:{domain:d.domain,nice:d.nice??!1,inset:p+6,label:null,grid:!0,ticks:d.ticks,tickSize:0,tickFormat:d.fmt},marks:[Pn(l,{x:"px",y:"py",r:p,fill:$=>$.tone?e[$.tone]:e.fill,fillOpacity:$=>$.tone?1:g}),m.length?Ol(m,{x1:$=>f.at($.a),x2:$=>f.at($.b),y1:$=>d.at($.q1),y2:$=>d.at($.q3),fill:e.accent,fillOpacity:.14,insetLeft:2,insetRight:2}):null,m.length?je(m,{y:$=>d.at($.m),x1:$=>f.at($.a),x2:$=>f.at($.b),stroke:e.accent,strokeWidth:4,insetLeft:2,insetRight:2}):null,pt(l.filter($=>$.label&&!S($)),{x:"px",y:"py",text:"label",dx:p+8,textAnchor:"start",fill:$=>$.tone?e[$.tone]:e.ink,fontWeight:600,fontSize:e.small}),pt(l.filter($=>$.label&&S($)),{x:"px",y:"py",text:"label",dx:-(p+8),textAnchor:"end",fill:$=>$.tone?e[$.tone]:e.ink,fontWeight:600,fontSize:e.small}),pt([n.y.label],{frameAnchor:"top-left",dx:-c,dy:-x+2,text:$=>$,textAnchor:"start",lineAnchor:"top",fill:e.muted,fontWeight:600,fontSize:e.small}),pt([n.x.label],{frameAnchor:"bottom-right",dy:y-4,text:$=>$,textAnchor:"end",lineAnchor:"bottom",fill:e.muted,fontWeight:600,fontSize:e.small})]}),m.length){let $=document.createElement("p");$.className="range-key",$.innerHTML=`<span><i class="median" style="background:${e.accent}"></i>median of each band of ${at(n.x.label.toLowerCase())}</span><span><i class="band" style="background:${e.accent};opacity:.3"></i>its middle half</span>`,$.style.marginBottom="14px",t.prepend($)}}function Xy(t,n){let e=ge(t),r=Math.floor(t.clientWidth)||640,i=Yr(t)||r<460,o=Math.min(10,n.total),a=Math.ceil(n.total/o),c=i?5:7,u=Math.min(i?34:48,Math.floor((r-c*(o-1))/o)),s=[e.fill,e.fill2],f=0,d=n.parts.map((b,v)=>({...b,colour:b.tone?e[b.tone]:v===0?e.accent:s[f++%2]}));t.className="units",t.innerHTML="";let l=document.createElement("div");l.className="un-grid",l.style.cssText=`grid-template-columns: repeat(${o}, ${u}px); grid-template-rows: repeat(${a}, ${u}px); grid-auto-flow: column; gap: ${c}px; --un: ${u}px;`;let h=d.flatMap(b=>Array(b.count).fill(b.colour));for(let b=0;b<n.total;b++){let v=document.createElement("i");h[b]?v.style.background=h[b]:v.className="empty",l.appendChild(v)}let p=n.total-h.length,g=document.createElement("div");g.className="un-key",g.innerHTML=d.map(b=>`<span><i style="background:${b.colour}"></i><b style="color:${b.colour===e.accent||b.tone?b.colour:e.ink}">${b.count}</b>${at(b.label)}</span>`).join("")+`<span><i class="empty"></i><b style="color:${e.muted}">${p}</b>${at(n.rest)}</span>`,t.append(l,g)}return cb(CM);})();
|