@uwdata/mosaic-plot 0.12.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- var XC=Object.create;var eb=Object.defineProperty;var WC=Object.getOwnPropertyDescriptor;var GC=Object.getOwnPropertyNames;var VC=Object.getPrototypeOf,HC=Object.prototype.hasOwnProperty;var Z3=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),QC=(t,e)=>{for(var n in e)eb(t,n,{get:e[n],enumerable:!0})},ZC=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of GC(e))!HC.call(t,o)&&o!==n&&eb(t,o,{get:()=>e[o],enumerable:!(r=WC(e,o))||r.enumerable});return t};var KC=(t,e,n)=>(n=t!=null?XC(VC(t)):{},ZC(e||!t||!t.__esModule?eb(n,"default",{value:t,enumerable:!0}):n,t));var MI=Z3((TIt,_I)=>{"use strict";function hY(t,e,n,r,o){for(var i=o+1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c>=0?(i=s,o=s-1):r=s+1}return i}function dY(t,e,n,r,o){for(var i=o+1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c>0?(i=s,o=s-1):r=s+1}return i}function mY(t,e,n,r,o){for(var i=r-1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c<0?(i=s,r=s+1):o=s-1}return i}function gY(t,e,n,r,o){for(var i=r-1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c<=0?(i=s,r=s+1):o=s-1}return i}function yY(t,e,n,r,o){for(;r<=o;){var i=r+o>>>1,s=t[i],a=n!==void 0?n(s,e):s-e;if(a===0)return i;a<=0?r=i+1:o=i-1}return-1}function jh(t,e,n,r,o,i){return typeof n=="function"?i(t,e,n,r===void 0?0:r|0,o===void 0?t.length-1:o|0):i(t,e,void 0,n===void 0?0:n|0,r===void 0?t.length-1:r|0)}_I.exports={ge:function(t,e,n,r,o){return jh(t,e,n,r,o,hY)},gt:function(t,e,n,r,o){return jh(t,e,n,r,o,dY)},lt:function(t,e,n,r,o){return jh(t,e,n,r,o,mY)},le:function(t,e,n,r,o){return jh(t,e,n,r,o,gY)},eq:function(t,e,n,r,o){return jh(t,e,n,r,o,yY)}}});var kI=Z3((IIt,NI)=>{"use strict";var N1=MI(),iu=0,tc=1,C1=2;NI.exports=bY;function p3(t,e,n,r,o){this.mid=t,this.left=e,this.right=n,this.leftPoints=r,this.rightPoints=o,this.count=(e?e.count:0)+(n?n.count:0)+r.length}var Xh=p3.prototype;function u3(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function EI(t,e){var n=su(e);t.mid=n.mid,t.left=n.left,t.right=n.right,t.leftPoints=n.leftPoints,t.rightPoints=n.rightPoints,t.count=n.count}function SI(t,e){var n=t.intervals([]);n.push(e),EI(t,n)}function AI(t,e){var n=t.intervals([]),r=n.indexOf(e);return r<0?iu:(n.splice(r,1),EI(t,n),tc)}Xh.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t};Xh.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?SI(this,t):this.left.insert(t):this.left=su([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?SI(this,t):this.right.insert(t):this.right=su([t]);else{var n=N1.ge(this.leftPoints,t,h3),r=N1.ge(this.rightPoints,t,d3);this.leftPoints.splice(n,0,t),this.rightPoints.splice(r,0,t)}};Xh.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){if(!this.left)return iu;var n=this.right?this.right.count:0;if(4*n>3*(e-1))return AI(this,t);var r=this.left.remove(t);return r===C1?(this.left=null,this.count-=1,tc):(r===tc&&(this.count-=1),r)}else if(t[0]>this.mid){if(!this.right)return iu;var o=this.left?this.left.count:0;if(4*o>3*(e-1))return AI(this,t);var r=this.right.remove(t);return r===C1?(this.right=null,this.count-=1,tc):(r===tc&&(this.count-=1),r)}else{if(this.count===1)return this.leftPoints[0]===t?C1:iu;if(this.leftPoints.length===1&&this.leftPoints[0]===t){if(this.left&&this.right){for(var i=this,s=this.left;s.right;)i=s,s=s.right;if(i===this)s.right=this.right;else{var a=this.left,r=this.right;i.count-=s.count,i.right=s.left,s.left=a,s.right=r}u3(this,s),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?u3(this,this.left):u3(this,this.right);return tc}for(var a=N1.ge(this.leftPoints,t,h3);a<this.leftPoints.length&&this.leftPoints[a][0]===t[0];++a)if(this.leftPoints[a]===t){this.count-=1,this.leftPoints.splice(a,1);for(var r=N1.ge(this.rightPoints,t,d3);r<this.rightPoints.length&&this.rightPoints[r][1]===t[1];++r)if(this.rightPoints[r]===t)return this.rightPoints.splice(r,1),tc}return iu}};function TI(t,e,n){for(var r=0;r<t.length&&t[r][0]<=e;++r){var o=n(t[r]);if(o)return o}}function II(t,e,n){for(var r=t.length-1;r>=0&&t[r][1]>=e;--r){var o=n(t[r]);if(o)return o}}function CI(t,e){for(var n=0;n<t.length;++n){var r=e(t[n]);if(r)return r}}Xh.queryPoint=function(t,e){if(t<this.mid){if(this.left){var n=this.left.queryPoint(t,e);if(n)return n}return TI(this.leftPoints,t,e)}else if(t>this.mid){if(this.right){var n=this.right.queryPoint(t,e);if(n)return n}return II(this.rightPoints,t,e)}else return CI(this.leftPoints,e)};Xh.queryInterval=function(t,e,n){if(t<this.mid&&this.left){var r=this.left.queryInterval(t,e,n);if(r)return r}if(e>this.mid&&this.right){var r=this.right.queryInterval(t,e,n);if(r)return r}return e<this.mid?TI(this.leftPoints,e,n):t>this.mid?II(this.rightPoints,t,n):CI(this.leftPoints,n)};function xY(t,e){return t-e}function h3(t,e){var n=t[0]-e[0];return n||t[1]-e[1]}function d3(t,e){var n=t[1]-e[1];return n||t[0]-e[0]}function su(t){if(t.length===0)return null;for(var e=[],n=0;n<t.length;++n)e.push(t[n][0],t[n][1]);e.sort(xY);for(var r=e[e.length>>1],o=[],i=[],s=[],n=0;n<t.length;++n){var a=t[n];a[1]<r?o.push(a):r<a[0]?i.push(a):s.push(a)}var c=s,f=s.slice();return c.sort(h3),f.sort(d3),new p3(r,su(o),su(i),c,f)}function l3(t){this.root=t}var au=l3.prototype;au.insert=function(t){this.root?this.root.insert(t):this.root=new p3(t[0],null,null,[t],[t])};au.remove=function(t){if(this.root){var e=this.root.remove(t);return e===C1&&(this.root=null),e!==iu}return!1};au.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)};au.queryInterval=function(t,e,n){if(t<=e&&this.root)return this.root.queryInterval(t,e,n)};Object.defineProperty(au,"count",{get:function(){return this.root?this.root.count:0}});Object.defineProperty(au,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function bY(t){return!t||t.length===0?new l3(null):new l3(su(t))}});var Li=Symbol("Fixed"),Ye=Symbol("Transient"),pu=Symbol("Transform");var K3={};function hu(t,e=!1){let n,r,o=K3;function i(f){n=t(f).catch(()=>{}).finally(()=>{if(r){let{value:u}=r;r=null,i(u)}else n=null})}function s(f){r={event:f}}function a(f){n?s(f):i(f)}function c(f){o!==f&&requestAnimationFrame(()=>{let u=o;o=K3,a(u)}),o=f}return e?c:a}var du=class{constructor(e){this._filterBy=e,this._requestUpdate=hu(()=>this.requestQuery(),!0),this._coordinator=null}get coordinator(){return this._coordinator}set coordinator(e){this._coordinator=e}get filterBy(){return this._filterBy}get filterStable(){return!0}fields(){return null}fieldInfo(e){return this}query(e){return null}queryPending(){return this}queryResult(e){return this}queryError(e){return this}requestQuery(e){let n=e||this.query(this.filterBy?.predicate(this));return this._coordinator.requestQuery(this,n)}requestUpdate(){this._requestUpdate()}initialize(){return this._coordinator.initializeClient(this)}update(){return this}};var mu=Uint8Array.of(65,82,82,79,87,49),or={V1:0,V2:1,V3:2,V4:3,V5:4};var ir={NONE:0,Schema:1,DictionaryBatch:2,RecordBatch:3,Tensor:4,SparseTensor:5},B={Dictionary:-1,NONE:0,Null:1,Int:2,Float:3,Binary:4,Utf8:5,Bool:6,Decimal:7,Date:8,Time:9,Timestamp:10,Interval:11,List:12,Struct:13,Union:14,FixedSizeBinary:15,FixedSizeList:16,Map:17,Duration:18,LargeBinary:19,LargeUtf8:20,LargeList:21,RunEndEncoded:22,BinaryView:23,Utf8View:24,ListView:25,LargeListView:26},ic={HALF:0,SINGLE:1,DOUBLE:2},Fo={DAY:0,MILLISECOND:1},Ce={SECOND:0,MILLISECOND:1,MICROSECOND:2,NANOSECOND:3},sr={YEAR_MONTH:0,DAY_TIME:1,MONTH_DAY_NANO:2},Po={Sparse:0,Dense:1};var sc=Uint8Array,ad=Uint16Array,cd=Uint32Array,fd=BigUint64Array,gu=Int8Array,J3=Int16Array,Ln=Int32Array,zn=BigInt64Array,nb=Float32Array,Oi=Float64Array;function t4(t,e){let n=Math.log2(t)-3;return(e?[gu,J3,Ln,zn]:[sc,ad,cd,fd])[n]}var tj=Object.getPrototypeOf(Int8Array);function ac(t,e){let n=0,r=t.length;if(r<=2147483648)do{let o=n+r>>>1;t[o]<=e?n=o+1:r=o}while(n<r);else do{let o=Math.trunc((n+r)/2);t[o]<=e?n=o+1:r=o}while(n<r);return n}function ud(t,e,n){if(e(t))return t;throw new Error(n(t))}function On(t,e,n){return e=Array.isArray(e)?e:Object.values(e),ud(t,r=>e.includes(r),n??(()=>`${t} must be one of ${e}`))}function ld(t,e){for(let[n,r]of Object.entries(t))if(r===e)return n;return"<Unknown>"}var qo=t=>`Unsupported data type: "${ld(B,t)}" (id ${t})`,yu=(t,e,n=!0,r=null)=>({name:t,type:e,nullable:n,metadata:r});function e4(t){return Object.hasOwn(t,"name")&&n4(t.type)}function n4(t){return typeof t?.typeId=="number"}function $i(t,e="",n=!0){return e4(t)?t:yu(e,ud(t,n4,()=>"Data type expected."),n)}var pd=(t,e,n=!1,r=-1)=>({typeId:B.Dictionary,id:r,dictionary:t,indices:e||cc(),ordered:n});var hd=(t=32,e=!0)=>({typeId:B.Int,bitWidth:On(t,[8,16,32,64]),signed:e,values:t4(t,e)});var cc=()=>hd(32);var rb=(t=2)=>({typeId:B.Float,precision:On(t,ic),values:[ad,nb,Oi][t]});var ob=()=>({typeId:B.Binary,offsets:Ln}),dd=()=>({typeId:B.Utf8,offsets:Ln});var ib=(t,e,n=128)=>({typeId:B.Decimal,precision:t,scale:e,bitWidth:On(n,[128,256]),values:fd}),sb=t=>({typeId:B.Date,unit:On(t,Fo),values:t===Fo.DAY?Ln:zn});var ab=(t=Ce.MILLISECOND,e=32)=>({typeId:B.Time,unit:On(t,Ce),bitWidth:On(e,[32,64]),values:e===32?Ln:zn});var md=(t=Ce.MILLISECOND,e=null)=>({typeId:B.Timestamp,unit:On(t,Ce),timezone:e,values:zn}),cb=(t=sr.MONTH_DAY_NANO)=>({typeId:B.Interval,unit:On(t,sr),values:t===sr.MONTH_DAY_NANO?void 0:Ln}),gd=t=>({typeId:B.List,children:[$i(t)],offsets:Ln}),yd=t=>({typeId:B.Struct,children:Array.isArray(t)&&e4(t[0])?t:Object.entries(t).map(([e,n])=>yu(e,n))}),fb=(t,e,n,r)=>(n??=e.map((o,i)=>i),{typeId:B.Union,mode:On(t,Po),typeIds:n,typeMap:n.reduce((o,i,s)=>(o[i]=s,o),{}),children:e.map((o,i)=>$i(o,`_${i}`)),typeIdForValue:r,offsets:Ln}),ub=t=>({typeId:B.FixedSizeBinary,stride:t}),xd=(t,e)=>({typeId:B.FixedSizeList,stride:e,children:[$i(t)]}),r4=(t,e)=>({typeId:B.Map,keysSorted:t,children:[e],offsets:Ln});var lb=(t=Ce.MILLISECOND)=>({typeId:B.Duration,unit:On(t,Ce),values:zn}),pb=()=>({typeId:B.LargeBinary,offsets:zn}),hb=()=>({typeId:B.LargeUtf8,offsets:zn}),db=t=>({typeId:B.LargeList,children:[$i(t)],offsets:zn}),mb=(t,e)=>({typeId:B.RunEndEncoded,children:[ud($i(t,"run_ends"),n=>n.type.typeId===B.Int,()=>"Run-ends must have an integer type."),$i(e,"values")]});var gb=t=>({typeId:B.ListView,children:[$i(t,"value")],offsets:Ln}),yb=t=>({typeId:B.LargeListView,children:[$i(t,"value")],offsets:zn});var JC=new Oi(2),bd=JC.buffer,fj=new zn(bd),uj=new cd(bd),lj=new Ln(bd),pj=new sc(bd);function jr(t){if(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)throw Error(`BigInt exceeds integer number representation: ${t}`);return Number(t)}function wd(t,e){return Number(t/e)+Number(t%e)/Number(e)}var fc=t=>BigInt.asUintN(64,t);function i4(t,e){let n=e<<1,r;return BigInt.asIntN(64,t[n+1])<0?(r=fc(~t[n])|fc(~t[n+1])<<64n,r=-(r+1n)):r=t[n]|t[n+1]<<64n,r}function s4(t,e){let n=e<<2,r;return BigInt.asIntN(64,t[n+3])<0?(r=fc(~t[n])|fc(~t[n+1])<<64n|fc(~t[n+2])<<128n|fc(~t[n+3])<<192n,r=-(r+1n)):r=t[n]|t[n+1]<<64n|t[n+2]<<128n|t[n+3]<<192n,r}var eN=new TextDecoder("utf-8"),yj=new TextEncoder;function uc(t){return eN.decode(t)}var Ps=4;function xb(t,e){return(t[e>>3]&1<<e%8)!==0}function tn(t,e){let n=e+Bt(t,e),r=n-Bt(t,n),o=Ue(t,r);return(i,s,a=null)=>{if(i<o){let c=Ue(t,r+i);if(c)return s(t,n+c)}return a}}function Mr(t,e){return e}function Di(t,e){return!!nN(t,e)}function nN(t,e){return xu(t,e)<<24>>24}function xu(t,e){return t[e]}function Ue(t,e){return rN(t,e)<<16>>16}function rN(t,e){return t[e]|t[e+1]<<8}function Bt(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function a4(t,e){return Bt(t,e)>>>0}function Ne(t,e){return jr(BigInt.asIntN(64,BigInt(a4(t,e))+(BigInt(a4(t,e+Ps))<<32n)))}function qs(t,e){let n=e+Bt(t,e),r=Bt(t,n);return n+=Ps,uc(t.subarray(n,n+r))}function Yn(t,e,n,r){if(!e)return[];let o=e+Bt(t,e);return Array.from({length:Bt(t,o)},(i,s)=>r(t,o+Ps+s*n))}var bb=Symbol("rowIndex");function bu(t,e){class n{constructor(i){this[bb]=i}toJSON(){return c4(t,e,this[bb])}}let r=n.prototype;for(let o=0;o<t.length;++o){if(Object.hasOwn(r,t[o]))continue;let i=e[o];Object.defineProperty(r,t[o],{get(){return i.at(this[bb])},enumerable:!0})}return o=>new n(o)}function vd(t,e){return n=>c4(t,e,n)}function c4(t,e,n){let r={};for(let o=0;o<t.length;++o)r[t[o]]=e[o].at(n);return r}function f4(t){return t instanceof Fi}var Bs=class{static ArrayType=null;constructor({length:e,nullCount:n,type:r,validity:o,values:i,offsets:s,sizes:a,children:c}){this.length=e,this.nullCount=n,this.type=r,this.validity=o,this.values=i,this.offsets=s,this.sizes=a,this.children=c,(!n||!this.validity)&&(this.at=f=>this.value(f))}get[Symbol.toStringTag](){return"Batch"}at(e){return this.isValid(e)?this.value(e):null}isValid(e){return xb(this.validity,e)}value(e){return this.values[e]}slice(e,n){let r=n-e,o=Array(r);for(let i=0;i<r;++i)o[i]=this.at(e+i);return o}*[Symbol.iterator](){for(let e=0;e<this.length;++e)yield this.at(e)}},Fi=class extends Bs{constructor(e){super(e);let{length:n,values:r}=this;this.values=r.subarray(0,n)}slice(e,n){return this.nullCount?super.slice(e,n):this.values.subarray(e,n)}[Symbol.iterator](){return this.nullCount?super[Symbol.iterator]():this.values[Symbol.iterator]()}},wu=class extends Bs{static ArrayType=Oi},ee=class extends Bs{static ArrayType=Array},vu=class extends ee{value(e){return null}},Xr=class extends wu{value(e){return jr(this.values[e])}},_d=class extends wu{value(e){let n=this.values[e],r=(n&31744)>>10,o=(n&1023)/1024,i=(-1)**((n&32768)>>15);switch(r){case 31:return i*(o?Number.NaN:1/0);case 0:return i*(o?6103515625e-14*o:0)}return i*2**(r-15)*(1+o)}},Md=class extends ee{value(e){return xb(this.values,e)}},Sd=class extends Bs{constructor(e){super(e);let{bitWidth:n,scale:r}=this.type;this.decimal=n===128?i4:s4,this.scale=10n**BigInt(r)}},Ad=class extends Sd{static ArrayType=Oi;value(e){return wd(this.decimal(this.values,e),this.scale)}},Ed=class extends Sd{static ArrayType=Array;value(e){return this.decimal(this.values,e)}},_u=class extends ee{constructor(e){super(e),this.source=e}value(e){return new Date(this.source.value(e))}},Td=class extends wu{value(e){return 864e5*this.values[e]}},u4=Xr,Id=class extends Xr{value(e){return super.value(e)*1e3}},l4=Xr,Cd=class extends Xr{value(e){return wd(this.values[e],1000n)}},Nd=class extends Xr{value(e){return wd(this.values[e],1000000n)}},kd=class extends ee{value(e){return this.values.subarray(e<<1,e+1<<1)}},Rd=class extends ee{value(e){let n=this.values,r=e<<4;return Float64Array.of(Bt(n,r),Bt(n,r+4),Ne(n,r+8))}},p4=({values:t,offsets:e},n)=>t.subarray(e[n],e[n+1]),h4=({values:t,offsets:e},n)=>t.subarray(jr(e[n]),jr(e[n+1])),Ld=class extends ee{value(e){return p4(this,e)}},Od=class extends ee{value(e){return h4(this,e)}},$d=class extends ee{value(e){return uc(p4(this,e))}},Dd=class extends ee{value(e){return uc(h4(this,e))}},Fd=class extends ee{value(e){let n=this.offsets;return this.children[0].slice(n[e],n[e+1])}},Pd=class extends ee{value(e){let n=this.offsets;return this.children[0].slice(jr(n[e]),jr(n[e+1]))}},qd=class extends ee{value(e){let n=this.offsets[e],r=n+this.sizes[e];return this.children[0].slice(n,r)}},Bd=class extends ee{value(e){let n=this.offsets[e],r=n+this.sizes[e];return this.children[0].slice(jr(n),jr(r))}},zd=class extends ee{constructor(e){super(e),this.stride=this.type.stride}},Yd=class extends zd{value(e){let{stride:n,values:r}=this;return r.subarray(e*n,(e+1)*n)}},Ud=class extends zd{value(e){let{children:n,stride:r}=this;return n[0].slice(e*r,(e+1)*r)}};function d4({children:t,offsets:e},n){let[r,o]=t[0].children,i=e[n],s=e[n+1],a=[];for(let c=i;c<s;++c)a.push([r.at(c),o.at(c)]);return a}var jd=class extends ee{value(e){return d4(this,e)}},Xd=class extends ee{value(e){return new Map(d4(this,e))}},Mu=class extends ee{constructor({typeIds:e,...n}){super(n),this.typeIds=e,this.typeMap=this.type.typeMap}value(e,n=e){let{typeIds:r,children:o,typeMap:i}=this;return o[i[r[e]]].at(n)}},Wd=class extends Mu{value(e){return super.value(e,this.offsets[e])}},Su=class extends ee{constructor(e,n=vd){super(e),this.names=this.type.children.map(r=>r.name),this.factory=n(this.names,this.children)}value(e){return this.factory(e)}},Gd=class extends Su{constructor(e){super(e,bu)}},Vd=class extends ee{value(e){let[{values:n},r]=this.children;return r.at(ac(n,e))}},Hd=class extends ee{setDictionary(e){return this.dictionary=e,this.cache=e.cache(),this}value(e){return this.cache[this.key(e)]}key(e){return this.values[e]}},Qd=class extends ee{constructor({data:e,...n}){super(n),this.data=e}view(e){let{values:n,data:r}=this,o=e<<4,i=o+4,s=n,a=Bt(s,o);return a>12&&(i=Bt(s,o+12),s=r[Bt(s,o+8)]),s.subarray(i,i+a)}},Zd=class extends Qd{value(e){return this.view(e)}},Kd=class extends Qd{value(e){return uc(this.view(e))}};function wb(t){let e=[];return{add(n){return e.push(n),this},clear:()=>e=[],done:()=>new zs(e,t)}}var zs=class{constructor(e,n=e[0]?.type){this.type=n,this.length=e.reduce((i,s)=>i+s.length,0),this.nullCount=e.reduce((i,s)=>i+s.nullCount,0),this.data=e;let r=e.length,o=new Int32Array(r+1);if(r===1){let[i]=e;o[1]=i.length,this.at=s=>i.at(s)}else for(let i=0,s=0;i<r;++i)o[i+1]=s+=e[i].length;this.offsets=o}get[Symbol.toStringTag](){return"Column"}[Symbol.iterator](){let e=this.data;return e.length===1?e[0][Symbol.iterator]():oN(e)}at(e){let{data:n,offsets:r}=this,o=ac(r,e)-1;return n[o]?.at(e-r[o])}get(e){return this.at(e)}toArray(){let{length:e,nullCount:n,data:r}=this,o=!n&&f4(r[0]),i=r.length;if(o&&i===1)return r[0].values;let s=!i||n>0?Array:r[0].constructor.ArrayType??r[0].values.constructor,a=new s(e);return o?iN(a,r):sN(a,r)}cache(){return this._cache??(this._cache=this.toArray())}};function*oN(t){for(let e=0;e<t.length;++e){let n=t[e][Symbol.iterator]();for(let r=n.next();!r.done;r=n.next())yield r.value}}function iN(t,e){for(let n=0,r=0;n<e.length;++n){let{values:o}=e[n];t.set(o,r),r+=o.length}return t}function sN(t,e){let n=-1;for(let r=0;r<e.length;++r){let o=e[r];for(let i=0;i<o.length;++i)t[++n]=o.at(i)}return t}var lc=class t{constructor(e,n,r=!1){let o=e.fields.map(s=>s.name);this.schema=e,this.names=o,this.children=n,this.factory=r?bu:vd;let i=[];this.getFactory=s=>i[s]??(i[s]=this.factory(o,n.map(a=>a.data[s])))}get[Symbol.toStringTag](){return"Table"}get numCols(){return this.names.length}get numRows(){return this.children[0]?.length??0}getChildAt(e){return this.children[e]}getChild(e){let n=this.names.findIndex(r=>r===e);return n>-1?this.children[n]:void 0}selectAt(e,n=[]){let{children:r,factory:o,schema:i}=this,{fields:s}=i;return new t({...i,fields:e.map((a,c)=>aN(s[a],n[c]))},e.map(a=>r[a]),o===bu)}select(e,n){let r=this.names,o=e.map(i=>r.indexOf(i));return this.selectAt(o,n)}toColumns(){let{children:e,names:n}=this,r={};return n.forEach((o,i)=>r[o]=e[i]?.toArray()??[]),r}toArray(){let{children:e,getFactory:n,numRows:r}=this,o=e[0]?.data??[],i=Array(r);for(let s=0,a=-1;s<o.length;++s){let c=n(s);for(let f=0;f<o[s].length;++f)i[++a]=c(f)}return i}*[Symbol.iterator](){let{children:e,getFactory:n}=this,r=e[0]?.data??[];for(let o=0;o<r.length;++o){let i=n(o);for(let s=0;s<r[o].length;++s)yield i(s)}}at(e){let{children:n,getFactory:r,numRows:o}=this;if(e<0||e>=o)return null;let[{offsets:i}]=n,s=ac(i,e)-1;return r(s)(e-i[s])}get(e){return this.at(e)}};function aN(t,e){return e!=null&&e!==t.name?{...t,name:e}:t}function Au(t,e={}){let{typeId:n,bitWidth:r,precision:o,unit:i}=t,{useBigInt:s,useDate:a,useDecimalBigInt:c,useMap:f,useProxy:u}=e;switch(n){case B.Null:return vu;case B.Bool:return Md;case B.Int:case B.Time:case B.Duration:return s||r<64?Fi:Xr;case B.Float:return o?Fi:_d;case B.Date:return m4(i===Fo.DAY?Td:u4,a&&_u);case B.Timestamp:return m4(i===Ce.SECOND?Id:i===Ce.MILLISECOND?l4:i===Ce.MICROSECOND?Cd:Nd,a&&_u);case B.Decimal:return c?Ed:Ad;case B.Interval:return i===sr.DAY_TIME?kd:i===sr.YEAR_MONTH?Fi:Rd;case B.FixedSizeBinary:return Yd;case B.Utf8:return $d;case B.LargeUtf8:return Dd;case B.Binary:return Ld;case B.LargeBinary:return Od;case B.BinaryView:return Zd;case B.Utf8View:return Kd;case B.List:return Fd;case B.LargeList:return Pd;case B.Map:return f?Xd:jd;case B.ListView:return qd;case B.LargeListView:return Bd;case B.FixedSizeList:return Ud;case B.Struct:return u?Gd:Su;case B.RunEndEncoded:return Vd;case B.Dictionary:return Hd;case B.Union:return t.mode?Wd:Mu}throw new Error(qo(n))}function m4(t,e){return e?class extends e{constructor(r){super(new t(r))}}:t}function cN(t,e){return{offset:Ne(t,e),metadataLength:Bt(t,e+8),bodyLength:Ne(t,e+16)}}function vb(t,e){return Yn(t,e,24,cN)}function Jd(t,e,n){let r=tn(t,e);if(r(10,Mr,0))throw new Error("Record batch compression not implemented");let o=n<or.V4?8:0;return{length:r(4,Ne,0),nodes:Yn(t,r(6,Mr),16,(i,s)=>({length:Ne(i,s),nullCount:Ne(i,s+8)})),regions:Yn(t,r(8,Mr),16+o,(i,s)=>({offset:Ne(i,s+o),length:Ne(i,s+o+8)})),variadic:Yn(t,r(12,Mr),8,Ne)}}function g4(t,e,n){let r=tn(t,e);return{id:r(4,Ne,0),data:r(6,(o,i)=>Jd(o,i,n)),isDelta:r(8,Di,!1)}}function _b(t,e,n,r){On(n,B,qo);let o=tn(t,e);switch(n){case B.Binary:return ob();case B.Utf8:return dd();case B.LargeBinary:return pb();case B.LargeUtf8:return hb();case B.List:return gd(r[0]);case B.ListView:return gb(r[0]);case B.LargeList:return db(r[0]);case B.LargeListView:return yb(r[0]);case B.Struct:return yd(r);case B.RunEndEncoded:return mb(r[0],r[1]);case B.Int:return hd(o(4,Bt,0),o(6,Di,!1));case B.Float:return rb(o(4,Ue,ic.HALF));case B.Decimal:return ib(o(4,Bt,0),o(6,Bt,0),o(8,Bt,128));case B.Date:return sb(o(4,Ue,Fo.MILLISECOND));case B.Time:return ab(o(4,Ue,Ce.MILLISECOND),o(6,Bt,32));case B.Timestamp:return md(o(4,Ue,Ce.SECOND),o(6,qs));case B.Interval:return cb(o(4,Ue,sr.YEAR_MONTH));case B.Duration:return lb(o(4,Ue,Ce.MILLISECOND));case B.FixedSizeBinary:return ub(o(4,Bt,0));case B.FixedSizeList:return xd(r[0],o(4,Bt,0));case B.Map:return r4(o(4,Di,!1),r[0]);case B.Union:return fb(o(4,Ue,Po.Sparse),r,Yn(t,o(6,Mr),4,Bt))}return{typeId:n}}function Eu(t,e){let n=Yn(t,e,4,(r,o)=>{let i=tn(r,o);return[i(4,qs),i(6,qs)]});return n.length?new Map(n):null}function tm(t,e,n){let r=tn(t,e);return{version:n,endianness:r(4,Ue,0),fields:r(6,fN,[]),metadata:r(8,Eu)}}function fN(t,e){return Yn(t,e,4,y4)}function y4(t,e){let n=tn(t,e),r=n(8,xu,B.NONE),o=n(10,Mr,0),i=n(12,lN),s=n(14,(c,f)=>uN(c,f)),a=_b(t,o,r,s);return i&&(i.dictionary=a,a=i),{name:n(4,qs),type:a,nullable:n(6,Di,!1),metadata:n(16,Eu)}}function uN(t,e){let n=Yn(t,e,4,y4);return n.length?n:null}function lN(t,e){if(!e)return null;let n=tn(t,e);return pd(null,n(6,pN,cc()),n(8,Di,!1),n(4,Ne,0))}function pN(t,e){return _b(t,e,B.Int)}var hN=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,dN=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`,mN=t=>`Unsupported message type: ${t} (${ld(ir,t)})`;function em(t,e){let n=Bt(t,e)||0;if(e+=Ps,n===-1&&(n=Bt(t,e)||0,e+=Ps),n===0)return null;let r=t.subarray(e,e+=n);if(r.byteLength<n)throw new Error(hN(n,r.byteLength));let o=tn(r,0),i=o(4,Ue,or.V1),s=o(6,xu,ir.NONE),a=o(8,Mr,0),c=o(10,Ne,0),f;if(a){let u=s===ir.Schema?tm:s===ir.DictionaryBatch?g4:s===ir.RecordBatch?Jd:null;if(!u)throw new Error(mN(s));if(f=u(r,a,i),c>0){let p=t.subarray(e,e+=c);if(p.byteLength<c)throw new Error(dN(c,p.byteLength));f.body=p}}return{version:i,type:s,index:e,content:f}}function x4(t){let e=t instanceof ArrayBuffer?new Uint8Array(t):t;return e instanceof Uint8Array&&gN(e)?xN(e):yN(e)}function gN(t){if(!t||t.length<4)return!1;for(let e=0;e<6;++e)if(mu[e]!==t[e])return!1;return!0}function yN(t){let e=[t].flat(),n,r=[],o=[];for(let i of e){if(!(i instanceof Uint8Array))throw new Error("IPC data batch was not a Uint8Array.");let s=0;for(;;){let a=em(i,s);if(a===null)break;if(s=a.index,!!a.content)switch(a.type){case ir.Schema:n||(n=a.content);break;case ir.RecordBatch:r.push(a.content);break;case ir.DictionaryBatch:o.push(a.content);break}}}return{schema:n,dictionaries:o,records:r,metadata:null}}function xN(t){let e=t.byteLength-(mu.length+4),n=Bt(t,e),r=tn(t,e-n),o=r(4,Ue,or.V1),i=r(8,vb,[]),s=r(10,vb,[]);return{schema:r(6,(a,c)=>tm(a,c,o)),dictionaries:i.map(({offset:a})=>em(t,a).content),records:s.map(({offset:a})=>em(t,a).content),metadata:r(12,Eu)}}function Sb(t,e){return bN(x4(t),e)}function bN(t,e={}){let{schema:n={fields:[]},dictionaries:r,records:o}=t,{version:i,fields:s}=n,a=new Map,c=vN(e,i,a),f=new Map;wN(n,l=>{let h=l.type;h.typeId===B.Dictionary&&f.set(h.id,h.dictionary)});let u=new Map;for(let l of r){let{id:h,data:d,isDelta:m,body:g}=l,y=f.get(h),x=Mb(y,c({...d,body:g}));if(u.has(h)){let b=u.get(h);m||b.clear(),b.add(x)}else{if(m)throw new Error("Delta update can not be first dictionary batch.");u.set(h,wb(y).add(x))}}u.forEach((l,h)=>a.set(h,l.done()));let p=s.map(l=>wb(l.type));for(let l of o){let h=c(l);s.forEach((d,m)=>p[m].add(Mb(d.type,h)))}return new lc(n,p.map(l=>l.done()),e.useProxy)}function wN(t,e){t.fields.forEach(function n(r){e(r),r.type.dictionary?.children?.forEach(n),r.type.children?.forEach(n)})}function vN(t,e,n){let r={version:e,options:t,dictionary:o=>n.get(o)};return o=>{let{length:i,nodes:s,regions:a,variadic:c,body:f}=o,u=-1,p=-1,l=-1;return{...r,length:i,node:()=>s[++u],buffer:h=>{let{length:d,offset:m}=a[++p];return h?new h(f.buffer,f.byteOffset+m,d/h.BYTES_PER_ELEMENT):f.subarray(m,m+d)},variadic:()=>c[++l],visit(h){return h.map(d=>Mb(d.type,this))}}}}function Mb(t,e){let{typeId:n}=t,{length:r,options:o,node:i,buffer:s,variadic:a,version:c}=e,f=Au(t,o);if(n===B.Null)return new f({length:r,nullCount:r,type:t});let u={...i(),type:t};switch(n){case B.Bool:case B.Int:case B.Time:case B.Duration:case B.Float:case B.Decimal:case B.Date:case B.Timestamp:case B.Interval:case B.FixedSizeBinary:return new f({...u,validity:s(),values:s(t.values)});case B.Utf8:case B.LargeUtf8:case B.Binary:case B.LargeBinary:return new f({...u,validity:s(),offsets:s(t.offsets),values:s()});case B.BinaryView:case B.Utf8View:return new f({...u,validity:s(),values:s(),data:Array.from({length:a()},()=>s())});case B.List:case B.LargeList:case B.Map:return new f({...u,validity:s(),offsets:s(t.offsets),children:e.visit(t.children)});case B.ListView:case B.LargeListView:return new f({...u,validity:s(),offsets:s(t.offsets),sizes:s(t.offsets),children:e.visit(t.children)});case B.FixedSizeList:case B.Struct:return new f({...u,validity:s(),children:e.visit(t.children)});case B.RunEndEncoded:return new f({...u,children:e.visit(t.children)});case B.Dictionary:{let{id:p,indices:l}=t;return new f({...u,validity:s(),values:s(l.values)}).setDictionary(e.dictionary(p))}case B.Union:return c<or.V5&&s(),new f({...u,typeIds:s(gu),offsets:t.mode===Po.Sparse?null:s(t.offsets),children:e.visit(t.children)});default:throw new Error(qo(n))}}var WX=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;function Tu(t){return Sb(t,{useDate:!0})}function Ab(t="ws://localhost:3000/"){let e=[],n=!1,r=null,o,i={open(){n=!0,c()},close(){for(n=!1,r=null,o=null;e.length;)e.shift().reject("Socket closed")},error(f){if(r){let{reject:u}=r;r=null,c(),u(f)}else console.error("WebSocket error: ",f)},message({data:f}){if(r){let{query:u,resolve:p,reject:l}=r;if(r=null,c(),typeof f=="string"){let h=JSON.parse(f);h.error?l(h.error):p(h)}else if(u.type==="exec")p();else if(u.type==="arrow")p(Tu(f));else throw new Error(`Unexpected socket data: ${f}`)}else console.log("WebSocket message: ",f)}};function s(){o=new WebSocket(t),o.binaryType="arraybuffer";for(let f in i)o.addEventListener(f,i[f])}function a(f,u,p){o==null&&s(),e.push({query:f,resolve:u,reject:p}),n&&!r&&c()}function c(){e.length&&(r=e.shift(),o.send(JSON.stringify(r.query)))}return{get connected(){return n},query(f){return new Promise((u,p)=>a(f,u,p))}}}var pc="COLUMN_REF",nm="COLUMN_PARAM",A4="TABLE_REF",E4="LITERAL",T4="INTERVAL",rm="ORDER_BY",om="CAST",im="CASE",sm="WHEN",Eb="UNARY",I4="UNARY_POSTFIX",am="BINARY",cm="BETWEEN",fm="NOT_BETWEEN",um="LOGICAL_OPERATOR",lm="IN",pm="FUNCTION",Us="AGGREGATE",hc="WINDOW",hm="WINDOW_DEF",dm="WINDOW_FRAME",C4="EXPRESSION",dc="FRAGMENT",mm="VERBATIM",mc="PARAM",N4="WITH_CLAUSE",gm="SELECT_CLAUSE",ym="FROM_CLAUSE";var k4="SAMPLE_CLAUSE";var xm="WINDOW_CLAUSE";var bm="SELECT_QUERY",wm="DESCRIBE_QUERY",vm="SET_OPERATION";function en(t){return t instanceof fe}var fe=class{constructor(e){this.type=e}},xt=class extends fe{};var js=class extends xt{constructor(e){super(E4),this.value=e}toString(){return Tb(this.value)}};function Tb(t){switch(typeof t){case"number":return Number.isFinite(t)?`${t}`:"NULL";case"string":return`'${t.replace("'","''")}'`;case"boolean":return t?"TRUE":"FALSE";default:if(t==null)return"NULL";if(t instanceof Date){let e=+t;if(Number.isNaN(e))return"NULL";let n=t.getUTCFullYear(),r=t.getUTCMonth(),o=t.getUTCDate();return e===Date.UTC(n,r,o)?`DATE '${n}-${r+1}-${o}'`:`epoch_ms(${e})`}else return t instanceof RegExp?`'${t.source}'`:`${t}`}}var Sr=class extends xt{constructor(e){super(mc),this.param=e}get value(){return this.param.value}toString(){return Tb(this.value)}};function Ib(t){return t.split(".")}function Ar(t){return`"${t}"`}function _m(t){return t&&jN(t)?t.slice(1,-1):t}function jN(t){return t[0]==='"'&&t[t.length-1]==='"'}function Pi(t){return t instanceof gc}var gc=class extends xt{constructor(e){super(A4),this.table=[e].flat()}get name(){return this.table[this.table.length-1]}toString(){return this.table.map(e=>Ar(e)).join(".")}};var Xs=class extends xt{constructor(e,n=[]){super(pm),this.name=e,this.args=n}toString(){let{name:e,args:n}=this;return`${e}(${n.join(", ")})`}};function je(t,...e){return new Xs(t,Mm(e).map(Tt))}function nn(t,...e){return new Cu(t,Mm(e).map(Tt))}function R4(t,...e){return new Ws(new Iu(t,Mm(e).map(Tt)))}function $n(t,e=Tt){return t.flat().filter(n=>n!=null).map(n=>e(n))}function Mm(t){let e=t.length,n=e;for(;n>0&&t[n-1]===void 0;--n);return n<e?t.slice(0,n):t}function ar(t){return typeof t=="string"}function Nu(t){return Array.isArray(t)}function Er(t){return t&&typeof t.addEventListener=="function"&&t.dynamic!==!1&&"value"in t}var Ru=class extends fe{constructor(e,n){super(xm),this.name=e,this.def=n}toString(){return`${Ar(this.name)} AS ${this.def}`}},Ws=class t extends xt{constructor(e,n=new Gs){super(hc),this.func=e,this.def=n}over(e){return new t(this.func,this.def.over(e))}partitionby(...e){return new t(this.func,this.def.partitionby(...e))}orderby(...e){return new t(this.func,this.def.orderby(...e))}rows(e){return new t(this.func,this.def.rows(e))}range(e){return new t(this.func,this.def.range(e))}toString(){return`${this.func} OVER ${this.def}`}},Iu=class extends Xs{constructor(e,n){super(e,n)}},Gs=class extends fe{constructor(e,n,r,o){super(hm),this.name=e,this.partition=n,this.order=r,this.frame=o}over(e){return ku(this,{name:e})}partitionby(...e){return ku(this,{partition:$n(e)})}orderby(...e){return ku(this,{order:$n(e)})}rows(e){return ku(this,{frame:new Lu(e)})}range(e){return ku(this,{frame:new Lu(e,!0)})}toString(){let{name:e,partition:n,order:r,frame:o}=this,i=e&&Ar(e),s=[i,n?.length&&`PARTITION BY ${n.join(", ")}`,r?.length&&`ORDER BY ${r.join(", ")}`,o].filter(a=>a);return i&&s.length<2?i:`(${s.join(" ")})`}},Lu=class extends fe{constructor(e,n=!1,r=void 0){super(dm),this.extent=Er(e)?new Sr(e):e,this.range=n,this.exclude=r}toString(){let{range:e,exclude:n,extent:r}=this,o=e?"RANGE":"ROWS",[i,s]=en(r)?r.value:r,a=L4(i,"PRECEDING"),c=L4(s,"FOLLOWING");return`${o} BETWEEN ${a} AND ${c}${n?` ${n}`:""}`}};function ku(t,e){return new Gs(e.name??t.name,e.partition??t.partition,e.order??t.order,e.frame??t.frame)}function L4(t,e){return t===0?"CURRENT ROW":Number.isFinite(t)?`${Math.abs(t)} ${e}`:`UNBOUNDED ${e}`}function qi(t){return t instanceof zo}var zo=class extends xt{constructor(e,n){super(e),this.table=n}get column(){return null}toString(){let{column:e,table:n}=this,r=`${n??""}`,o=e==="*"?"*":Ar(e);return(r?r+".":"")+o}},Ou=class extends zo{constructor(e,n){super(pc,n),this.name=e}get column(){return this.name}};var $u=class extends zo{constructor(e,n){super(nm,n),this.param=e}get column(){return`${this.param.value}`}};function Du(t,e){let n=Vs(e);return Er(t)?new $u(new Sr(t),n):new Ou(t,n)}var Hs=class extends xt{constructor(e){super(mm),this.value=e}toString(){return this.value}};function mn(t){return new js(t)}function O4(t){return new Hs(t)}function Sm(...t){let e=$n(t,String);return e?.length?new gc(e):void 0}function Tt(t){return ar(t)?XN(t):Fu(t)}function Qs(t){return ar(t)?O4(t):Fu(t)}function Fu(t){return t instanceof xt?t:Er(t)?new Sr(t):mn(t)}function Vs(t){return ar(t)?WN(t):Nu(t)?Sm(t):t}function XN(t){let e=Ib(t);return Du(e.pop(),Sm(e))}function WN(t){return Sm(Ib(t))}function Cb(){return new Gs}var Cu=class t extends xt{constructor(e,n,r,o){super(Us),this.name=e,this.args=n,this.isDistinct=r,this.filter=o}distinct(e=!0){return new t(this.name,this.args,e,this.filter)}where(e){return ar(e)&&(e=Qs(e)),new t(this.name,this.args,this.isDistinct,e)}window(){return new Ws(this)}partitionby(...e){return this.window().partitionby(...e)}orderby(...e){return this.window().orderby(...e)}toString(){let{name:e,args:n,isDistinct:r,filter:o}=this,i=r?"DISTINCT ":"",s=n?.length?n.join(", "):"*",a=o?` FILTER (WHERE ${o})`:"";return`${e}(${i}${s})${a}`}},$4=["any_value","approx_count_distinct","approx_quantile","arbitrary","arg_max","arg_max_null","arg_min","arg_min_null","array_agg","avg","bit_and","bit_or","bit_xor","bitstring_agg","bool_and","bool_or","corr","count","covar_pop","covar_samp","entropy","favg","first","fsum","geomean","kurtosis_pop","kurtosis","last","mad","max","max_by","median","min","min_by","mode","product","quantile","quantile_cont","quantile_disc","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_sxx","regr_sxy","regr_syy","regr_slope","reservoir_quantile","skewness","stddev","stddev_pop","stddev_samp","string_agg","sum","variance","var_pop","var_samp"];var Am=class extends xt{constructor(e,n,r){super(e),this.expr=n,this.extent=r}toSQL(e){let{extent:n,expr:r}=this;return n?`(${r} ${e} ${n[0]} AND ${n[1]})`:""}},Zs=class extends Am{constructor(e,n){super(cm,e,n)}toString(){return super.toSQL("BETWEEN")}},Pu=class extends Am{constructor(e,n){super(fm,e,n)}toString(){return super.toSQL("NOT BETWEEN")}};var qu=class extends xt{constructor(e,n,r){super(am),this.op=e,this.left=n,this.right=r}toString(){return`(${this.left} ${this.op} ${this.right})`}};var yc=class t extends xt{constructor(e=void 0,n=[],r=void 0){super(im),this.expr=e,this._when=n,this._else=r}when(e,n){return new t(this.expr,this._when.concat(new xc(Tt(e),Tt(n))),this._else)}else(e){return new t(this.expr,this._when,Tt(e))}toString(){return"CASE "+(this.expr?`${this.expr} `:"")+this._when.join(" ")+(this._else?` ELSE ${this._else}`:"")+" END"}},xc=class extends fe{constructor(e,n){super(sm),this.when=e,this.then=n}toString(){return`WHEN ${this.when} THEN ${this.then}`}};var Bu=class extends xt{constructor(e,n){super(om),this.expr=e,this.cast=n}toString(){return`(${this.expr})::${this.cast}`}};var zu=class extends xt{constructor(e){super(dc),this.spans=e}toString(){return this.spans.join("")}};var Yu=class extends fe{constructor(e,n=!1,r=void 0,o=void 0){super(k4),this.size=e,this.perc=n,this.method=r,this.seed=o}toString(){let{size:e,perc:n,method:r,seed:o}=this,i=n?"%":" ROWS",s=o!=null?`, ${o}`:"";return`${e}${i}${r?` (${r}${s})`:""}`}};var Uu=class extends fe{constructor(e,n){super(gm),this.expr=e,this.alias=n}toString(){let{expr:e,alias:n}=this;return!n||GN(e,n)?`${e}`:`${e} AS ${Ar(n)}`}};function GN(t,e){return t instanceof zo&&t.table==null&&t.column===e}var ju=class extends fe{constructor(e,n){super(N4),this.name=e,this.query=n}toString(){return`"${this.name}" AS (${this.query})`}};function Em(t){return t instanceof yt}function Bi(t){return t instanceof Js}function Nb(t){return t instanceof Xu}var yt=class extends xt{static select(...e){return new Js().select(...e)}static from(...e){return new Js().from(...e)}static with(...e){return new Js().with(...e)}static union(...e){return new Ks("UNION",e.flat())}static unionAll(...e){return new Ks("UNION ALL",e.flat())}static intersect(...e){return new Ks("INTERSECT",e.flat())}static except(...e){return new Ks("EXCEPT",e.flat())}static describe(e){return new Xu(e)}constructor(e){super(e),this._orderby=[],this._limit=void 0,this._offset=void 0,this.cteFor=null}get subqueries(){return[]}clone(){return this}orderby(...e){return this._orderby=this._orderby.concat($n(e)),this}limit(e){return this._limit=Number.isFinite(e)?e:void 0,this}offset(e){return this._offset=Number.isFinite(e)?e:void 0,this}},Js=class t extends yt{constructor(){super(bm),this._with=[],this._select=[],this._from=[],this._where=[],this._sample=void 0,this._groupby=[],this._having=[],this._window=[],this._qualify=[]}get subqueries(){let e=this.cteFor||this,r=(e instanceof t?e._with:[]).reduce((i,s)=>(i[s.name]=s.query,i),{}),o=[];return this._from.forEach(({expr:i})=>{if(Em(i))o.push(i);else if(Pi(i)){let s=r[i.name];s&&o.push(s)}}),o}clone(){return Object.assign(new t,this)}with(...e){let n=[],r=(o,i)=>{let s=i.clone();s.cteFor=this,n.push(new ju(o,s))};return e.flat().forEach(o=>{if(o!=null)for(let i in o)r(i,o[i])}),this._with=this._with.concat(n),this}select(...e){let n=[],r=(i,s)=>n.push(new Uu(i==null?i:Tt(i),_m(s)));e.flat().forEach(i=>{if(i!=null)if(ar(i))r(i,i);else if(qi(i))r(i,i.column);else if(Nu(i))r(i[1],i[0]);else for(let s in i)r(i[s],s)});let o=new Set(n.map(i=>i.alias));return this._select=this._select.filter(i=>!o.has(i.alias)).concat(n.filter(i=>i.expr)),this}setSelect(...e){return this._select=[],this.select(...e)}distinct(e=!0){return this._distinct=!!e,this}from(...e){let n=[],r=(o,i)=>n.push(new Wu(Vs(o),_m(i)));return e.flat().forEach(o=>{if(o!=null)if(ar(o))r(o,o);else if(Pi(o))r(o,o.name);else if(en(o))r(o);else if(Nu(o))r(o[1],o[0]);else for(let i in o)r(o[i],i)}),this._from=this._from.concat(n),this}setFrom(...e){return this._from=[],this.from(...e)}sample(e,n,r){let o;if(typeof e=="number"){let i=e>0&&e<1,s=i?e*100:Math.floor(e);o=new Yu(s,i,n,r)}else o=e;return this._sample=o,this}where(...e){return this._where=this._where.concat($n(e,Qs)),this}setWhere(...e){return this._where=[],this.where(...e)}groupby(...e){return this._groupby=this._groupby.concat($n(e)),this}setGroupby(...e){return this._groupby=[],this.groupby(...e)}having(...e){return this._having=this._having.concat($n(e,Qs)),this}window(...e){let n=[];return e.flat().forEach(r=>{if(r!=null)for(let o in r)n.push(new Ru(_m(o),r[o]))}),this._window=this._window.concat(n),this}qualify(...e){return this._qualify=this._qualify.concat($n(e,Qs)),this}toString(){let{_with:e,_select:n,_distinct:r,_from:o,_sample:i,_where:s,_groupby:a,_having:c,_window:f,_qualify:u,_orderby:p,_limit:l,_offset:h}=this,d=[];if(e.length&&d.push(`WITH ${e.join(", ")}`),d.push(`SELECT${r?" DISTINCT":""} ${n.join(", ")}`),o.length&&d.push(`FROM ${o.join(", ")}`),s.length){let m=s.map(String).filter(g=>g).join(" AND ");m&&d.push(`WHERE ${m}`)}if(i&&d.push(`USING SAMPLE ${i}`),a.length&&d.push(`GROUP BY ${a.join(", ")}`),c.length){let m=c.map(String).filter(g=>g).join(" AND ");m&&d.push(`HAVING ${m}`)}if(f.length&&d.push(`WINDOW ${f.join(", ")}`),u.length){let m=u.map(String).filter(g=>g).join(" AND ");m&&d.push(`QUALIFY ${m}`)}return p.length&&d.push(`ORDER BY ${p.join(", ")}`),Number.isFinite(l)&&d.push(`LIMIT ${l}`),Number.isFinite(h)&&d.push(`OFFSET ${h}`),d.join(" ")}},Xu=class t extends fe{constructor(e){super(wm),this.query=e}clone(){return new t(this.query.clone())}toString(){return`DESCRIBE ${this.query}`}},Ks=class t extends yt{constructor(e,n){super(vm),this.op=e,this.queries=n}get subqueries(){let{queries:e,cteFor:n}=this;return n&&e.forEach(r=>r.cteFor=n),e}clone(){let{op:e,queries:n,...r}=this;return Object.assign(new t(e,n),r)}toString(){let{op:e,queries:n,_orderby:r,_limit:o,_offset:i}=this,s=[n.join(` ${e} `)];return r.length&&s.push(`ORDER BY ${r.join(", ")}`),Number.isFinite(o)&&s.push(`LIMIT ${o}`),Number.isFinite(i)&&s.push(`OFFSET ${i}`),s.join(" ")}};var Wu=class extends fe{constructor(e,n){super(ym),this.expr=e,this.alias=n}toString(){let{expr:e,alias:n}=this,r=Em(e)?`(${e})`:`${e}`;return n&&!(Pi(e)&&e.table.join(".")===n)?`${r} AS ${Ar(n)}`:`${r}`}};var Gu=class extends xt{constructor(e,n){super(lm),this.expr=e,this.values=n}toString(){return`(${this.expr} IN (${this.values.join(", ")}))`}};var Vu=class extends xt{constructor(e,n=1){super(T4),this.name=e,this.steps=n}toString(){return`INTERVAL ${this.steps} ${this.name}`}};var Tm=class extends xt{constructor(e,n){super(um),this.op=e,this.clauses=n}toString(){let e=this.clauses;return e.length===0?"":e.length===1?`${e[0]}`:`(${e.join(` ${this.op} `)})`}},Hu=class extends Tm{constructor(e){super("AND",e)}},Qu=class extends Tm{constructor(e){super("OR",e)}};var Zu=class extends xt{constructor(e,n,r){super(rm),this.expr=e,this.desc=n,this.nullsFirst=r}toString(){let{expr:e,desc:n,nullsFirst:r}=this;return`${e}${n?" DESC":n===!1?" ASC":""}${r?" NULLS FIRST":r===!1?" NULLS LAST":""}`}};var kb=class extends xt{constructor(e,n,r){super(e),this.op=n,this.expr=r}};var Ku=class extends kb{constructor(e,n){super(I4,e,n)}toString(){return`(${this.expr} ${this.op})`}};function bc(t,e){return nn("arg_max",t,e)}function wc(t,e){return nn("arg_min",t,e)}function Rb(t){return nn("avg",t)}function rn(t){return nn("count",t)}function Un(t){return nn("max",t)}function Wr(t){return nn("min",t)}function Ju(t,e){return nn("regr_avgx",t,e)}function Lb(t,e){return nn("regr_avgy",t,e)}function tl(t,e){return nn("regr_count",t,e)}function Ob(t,e){return nn("regr_intercept",t,e)}function $b(t,e){return nn("regr_sxx",t,e)}function Db(t,e){return nn("regr_syy",t,e)}function Fb(t,e){return nn("regr_slope",t,e)}function Pb(t){return nn("stddev",t)}function zt(t){return nn("sum",t)}function Yo(t,e,n){return t?new yc(void 0,[new xc(Tt(t),Tt(e))],Tt(n)):new yc}function qb(t,e){return new Bu(Tt(t),e)}function Ht(t){return qb(t,"INTEGER")}function de(t){return qb(t,"DOUBLE")}function Im(t,e){return new Vu(t,e)}function Bb(t){return je("epoch_ms",t)}function zb(t,e,n=1){return je("time_bucket",Im(e,n),t)}function Yb(...t){return je("greatest",...t)}function Cm(t){return je("exp",t)}function Ub(t){return je("log",t)}function vc(t){return je("ln",t)}function Tr(t){return je("sign",t)}function ke(t){return je("abs",t)}function Uo(t){return je("sqrt",t)}function jb(t){return je("ceil",t)}function Re(t){return je("floor",t)}function jo(t,e){return je("round",t,e)}function D4(t,e){return new Ku(t,Tt(e))}function Ir(t,e,n){return new qu(t,Tt(e),Tt(n))}function HN(t,e,n=!1){let r=n?Pu:Zs;return new r(Tt(t),e?.map(Tt))}function Dn(...t){return new Hu($n(t))}function Gr(...t){return new Qu($n(t))}function el(t){return D4("IS NULL",t)}function Vr(t){return D4("IS NOT NULL",t)}function nl(t,e){return Ir("&",t,e)}function Nt(t,e){return Ir("+",t,e)}function ut(t,e){return Ir("-",t,e)}function pt(t,e){return Ir("*",t,e)}function Lt(t,e){return Ir("/",t,e)}function me(t,e){return Ir("**",t,e)}function Xo(t,e){return Ir("<>",t,e)}function ue(t,e){return Ir("<",t,e)}function Hr(t,e){return Ir(">",t,e)}function Cr(t,e){return Ir("<=",t,e)}function Nm(t,e){return Ir("IS NOT DISTINCT FROM",t,e)}function gn(t,e){return HN(t,e,!1)}function Xb(t,e){return new Gu(Tt(t),e.map(Tt))}function Wb(t,e){return new Zu(Tt(t),!1,e)}function Gb(t){return je("st_asgeojson",t)}function Ae(t,...e){return new zu(QN(t,e))}function QN(t,e){let n=[t[0]],r=e.length;for(let o=0,i=0;o<r;){let s=e[o];en(s)?n[++i]=s:Er(s)?n[++i]=new Sr(s):n[i]+=ar(s)?s:mn(s);let a=t[++o];en(n[i])?n[++i]=a:n[i]+=a}return n.filter(o=>o).map(o=>ar(o)?new Hs(o):o)}function km(t,e,n){return R4("lead",t,e,n)}var Rm={[Us]:["args","filter"],[cm]:["expr","extent"],[am]:["left","right"],[im]:["expr","_when","_else"],[om]:["expr"],[nm]:["param","table"],[pc]:["table"],[wm]:["query"],[C4]:["node"],[dc]:["spans"],[ym]:["expr"],[pm]:["args"],[lm]:["expr","values"],[um]:["clauses"],[fm]:["expr","extent"],[rm]:["expr"],[mc]:["value"],[gm]:["expr"],[bm]:["_with","_select","_from","_where","_sample","_groupby","_having","_window","_qualify","_orderby"],[vm]:["subqueries","_orderby"],[Eb]:["expr"],[sm]:["when","then"],[hc]:["func","def"],[xm]:["def"],[hm]:["partition","order","frame"],[dm]:["extent"]};function rl(t,e){if(e.has(t))return e.get(t);if(en(t)){let n=Rm[t.type],r=n?.length??0;for(let o=0;o<r;++o){let i=n[o],s=t[i];if(Array.isArray(s)){let a=s.length;for(let c=0;c<a;++c)s[c]=rl(s[c],e)}else s&&(t[i]=rl(s,e))}}return t}function Qr(t,e){if(!en(t))return;let n=e(t);if(n)return n;let r=Rm[t.type],o=r?.length??0;for(let i=0;i<o;++i){let s=t[r[i]];if(Array.isArray(s)){let a=s.length;for(let c=0;c<a;++c)if(s[c]&&+Qr(s[c],e)<0)return n}else if(s&&+Qr(s,e)<0)return-1}}var ZN=new RegExp(`^(${$4.join("|")})$`),KN=/(\\'|\\"|"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\w+\()/g;function JN(t){return t.split(KN).some(e=>e.endsWith("(")&&ZN.test(e.slice(0,-1)))}function jn(t){let e=0;return Qr(t,n=>{switch(n.type){case hc:return-1;case Us:return e|=1,-1;case dc:case mm:{let r=`${n}`.toLowerCase(),o=r.indexOf("(select ");return o>=0&&(r=r.slice(0,o)),r.includes(") over ")?-1:JN(r)?(e|=2,-1):1}}}),e}function Vb(t){let e=new Set;return Qr(t,n=>{n.type===Us&&e.add(n)}),Array.from(e)}function _c(t){let e={};return Qr(t,n=>{n.type===pc&&(e[n]=n)}),Object.values(e)}function Hb(t){let e=new Set;return Qr(t,n=>{n.type===mc&&e.add(n.param)}),Array.from(e)}function Lm(t,e,{replace:n=!1,temp:r=!1,view:o=!1}={}){return"CREATE"+(n?" OR REPLACE ":" ")+(r?"TEMP ":"")+(o?"VIEW":"TABLE")+(n?" ":" IF NOT EXISTS ")+t+" AS "+e}function Qb(t,e,n,r,o){let i=o?ut(n,de(t)):ut(de(t),e),s=n===e?0:r/(n-e);return s?pt(i,de(s)):i}function Zb(t,e,n,r,o,i){return t.select({index:Nt(Ht(Re(e)),pt(Ht(Re(n)),o)),...r}).groupby("index",i)}function Kb(t,e,n){let r=n?s=>pt(s,n):s=>s,o=Re(e),i=Nt(o,1);return yt.from(yt.unionAll(t.clone().select({i:Ht(o),w:r(ut(i,e))}),t.clone().select({i:Ht(i),w:r(ut(e,o))}))).select({index:"i",density:zt("w")}).groupby("index").having(Xo("density",0))}function tk(t){return t}function Jb(t,e,n,r,o,i){let s=r?y=>pt(y,r):tk,a=(y,x)=>t.clone().select({xp:e,yp:n,i:y,w:x}),c=(y,x)=>Nt(y,pt(x,o)),f=Ht(Re(e)),u=Ht(Re(n)),p=Nt(f,1),l=Nt(u,1),h=ut(e,f),d=ut(p,e),m=ut(n,u),g=ut(l,n);return yt.from(yt.unionAll(a(c(f,u),s(pt(d,g))),a(c(f,l),s(pt(d,m))),a(c(p,u),s(pt(h,g))),a(c(p,l),s(pt(h,m))))).select({index:"i",density:zt("w")},i).groupby("index",i).having(Xo("density",0))}function t2(t,e,n,r,o,i,s=[],a=!0){t.select({x:Ht(Re(e)),y:Ht(Re(n))});let c=s.concat(r),f=yt.from(t).select(c,{x0:"x",y0:"y",dx:ut(km("x").over("sw"),"x"),dy:ut(km("y").over("sw"),"y")}).window({sw:Cb().partitionby(c).orderby(Wb("x"))}).qualify([Gr(ue("x0",o),ue(Nt("x0","dx"),o)),Gr(ue("y0",i),ue(Nt("y0","dy"),i)),Gr(Hr("x0",0),Hr(Nt("x0","dx"),0)),Gr(Hr("y0",0),Hr(Nt("y0","dy"),0))]),u=yt.select({x:Yb(Un(ke("dx")),Un(ke("dy")))}).from("pairs"),p=yt.select({i:Ht(Ae`UNNEST(range((${u})))`)}),l=yt.unionAll(yt.select(c,{x:Nt("x0","i"),y:Nt("y0",Ht(jo(Lt(pt("i","dy"),"dx"))))}).from("pairs","indices").where([Cr(ke("dy"),ke("dx")),ue("i",ke("dx"))]),yt.select(c,{x:Nt("x0",Ht(jo(Lt(pt(pt(Tr("dy"),"i"),"dx"),"dy")))),y:Nt("y0",pt(Tr("dy"),"i"))}).from("pairs","indices").where([Hr(ke("dy"),ke("dx")),ue("i",ke("dy"))]),yt.select(c,{x:"x0",y:"y0"}).from("pairs").where(el("dx"))),h=yt.from("raster").select(c,"x","y",a?{w:Lt(1,rn().partitionby(["x"].concat(c)))}:null).where([Cr(0,"x"),ue("x",o),Cr(0,"y"),ue("y",i)]);return yt.with({pairs:f,indices:p,raster:l,points:h}).from("points").select(s,{index:Nt("x",pt("y",Ht(o))),density:a?zt("w"):rn()}).groupby("index",s)}function e2(t,e,n,r,o=[]){let i=Ht(Re(e)),s=a=>yt.from(t).select(a).groupby(i,o);return yt.union(s([{[n]:Wr(n),[r]:wc(r,n)},...o]),s([{[n]:Un(n),[r]:bc(r,n)},...o]),s([{[n]:wc(n,r),[r]:Wr(r)},...o]),s([{[n]:bc(n,r),[r]:Un(r)},...o])).orderby(o,n)}var Om=t=>t;function F4(){return{apply:Om,invert:Om,sqlApply:Tt,sqlInvert:Om}}function ek({base:t=null}={}){if(t==null||t===Math.E)return{apply:Math.log,invert:Math.exp,sqlApply:e=>vc(e),sqlInvert:e=>Cm(e)};if(t===10)return{apply:Math.log10,invert:e=>Math.pow(10,e),sqlApply:e=>Ub(e),sqlInvert:e=>me(10,e)};{let e=+t;return{apply:n=>Math.log(n)/Math.log(e),invert:n=>Math.pow(e,n),sqlApply:n=>Lt(vc(n),vc(e)),sqlInvert:n=>me(e,n)}}}function nk({constant:t=1}={}){let e=+t;return{apply:n=>Math.sign(n)*Math.log1p(Math.abs(n)),invert:n=>Math.sign(n)*Math.exp(Math.abs(n)-e),sqlApply:n=>(n=Tt(n),pt(Tr(n),vc(Nt(e,ke(n))))),sqlInvert:n=>pt(Tr(n),ut(Cm(ke(n)),e))}}function rk(){return{apply:t=>Math.sign(t)*Math.sqrt(Math.abs(t)),invert:t=>Math.sign(t)*t*t,sqlApply:t=>(t=Tt(t),pt(Tr(t),Uo(ke(t)))),sqlInvert:t=>pt(Tr(t),me(t,2))}}function ok({exponent:t=1}={}){let e=+t;return{apply:n=>Math.sign(n)*Math.pow(Math.abs(n),e),invert:n=>Math.sign(n)*Math.pow(Math.abs(n),1/e),sqlApply:n=>(n=Tt(n),pt(Tr(n),me(ke(n),e))),sqlInvert:n=>pt(Tr(n),me(ke(n),Lt(1,e)))}}function P4(){return{apply:t=>+t,invert:t=>new Date(t),sqlApply:t=>t instanceof Date?mn(+t):sk(t)?mn(+t.value):Bb(t),sqlInvert:Om}}var ik={identity:F4,linear:F4,log:ek,symlog:nk,sqrt:rk,pow:ok,time:P4,utc:P4};function ol(t){let e=ik[t.type];return e?{...t,...e(t)}:null}function sk(t){return t instanceof js&&t.value instanceof Date}function $m(t){let e=2166136261;for(let n=0,r=t.length;n<r;++n){let o=t.charCodeAt(n),i=o&65280;i&&(e=q4(e^i>>8)),e=q4(e^o&255)}return lk(e)>>>0}function q4(t){return t+(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)}function lk(t){return t+=t<<13,t^=t>>>7,t+=t<<3,t^=t>>>17,t+=t<<5,t&4294967295}function z4(t,e,n){switch(t.name){case"count":case"sum":return pk(e,t);case"avg":return hk(e,t);case"arg_max":return dk(e,t);case"arg_min":return mk(e,t);case"variance":case"var_samp":return Dm(e,t,n);case"var_pop":return Dm(e,t,n,!1);case"stddev":case"stddev_samp":return Uo(Dm(e,t,n));case"stddev_pop":return Uo(Dm(e,t,n,!1));case"covar_samp":return Fm(e,t,n);case"covar_pop":return Fm(e,t,n,!1);case"corr":return B4(e,t,n);case"regr_count":return Mc(e,t).expr;case"regr_avgx":return X4(e,t);case"regr_avgy":return W4(e,t);case"regr_syy":return r2(e,0,t,n);case"regr_sxx":return r2(e,1,t,n);case"regr_sxy":return Fm(e,t,n,null);case"regr_slope":return G4(e,t,n);case"regr_intercept":return gk(e,t,n);case"regr_r2":return me(B4(e,t,n),2);case"max":case"min":case"bit_and":case"bit_or":case"bit_xor":case"bool_and":case"bool_or":case"product":{let r=Y4(t);return e[r]=t,Ae`${t.name}("${r}")`}default:return null}}function Y4(t){return"pre_"+$m(`${t}`).toString(16)}function yn(t,e,n){let r=n?.filter;r&&(e=e.filter?e.where(Dn(r,e.filter)):e.where(r));let o=Y4(e);return t[o]=e,o}function U4(t,e){let n=yn(t,rn(e.args[0]),e);return{expr:zt(n),name:n}}function pk(t,e){return zt(yn(t,e))}function hk(t,e){let n=yn(t,e),{expr:r,name:o}=U4(t,e);return Lt(zt(pt(n,o)),r)}function dk(t,e){let n=yn(t,e),r=yn(t,Un(e.args[1]),e);return bc(n,r)}function mk(t,e){let n=yn(t,e),r=yn(t,Wr(e.args[1]),e);return wc(n,r)}function Dm(t,e,n,r=!0){let o=e.args[0],{expr:i}=U4(t,e),s=ut(o,n(o)),a=yn(t,zt(me(s,2)),e),c=yn(t,zt(s),e),f=r?ut(i,1):i;return Lt(ut(zt(a),Lt(me(zt(c),2),i)),f)}function Fm(t,e,n,r=!0){let{expr:o}=Mc(t,e),i=j4(t,e,n),s=il(t,1,e,n),a=il(t,0,e,n),c=ut(i,Lt(pt(s,a),o));return r===null?c:r?Lt(c,ut(o,1)):Lt(c,o)}function B4(t,e,n){let{expr:r}=Mc(t,e),o=j4(t,e,n),i=n2(t,1,e,n),s=n2(t,0,e,n),a=il(t,1,e,n),c=il(t,0,e,n),f=ut(i,Lt(me(a,2),r)),u=ut(s,Lt(me(c,2),r));return Lt(ut(o,Lt(pt(a,c),r)),Uo(pt(f,u)))}function Mc(t,e){let[n,r]=e.args,o=yn(t,tl(n,r),e);return{expr:zt(o),name:o}}function il(t,e,n,r){let o=n.args,i=o[e],s=o[1-e],a=zt(ut(i,r(i))).where(Vr(s));return zt(yn(t,a,n))}function n2(t,e,n,r){let o=n.args,i=o[e],s=o[1-e],a=zt(me(ut(i,r(i)),2)).where(Vr(s));return zt(yn(t,a,n))}function j4(t,e,n){let[r,o]=e.args,i=zt(pt(ut(o,n(o)),ut(r,n(r))));return zt(yn(t,i,e))}function X4(t,e){let[n,r]=e.args,{expr:o,name:i}=Mc(t,e),s=yn(t,Ju(n,r),e);return Lt(zt(pt(s,i)),o)}function W4(t,e){let[n,r]=e.args,{expr:o,name:i}=Mc(t,e),s=yn(t,Lb(n,r),e);return Lt(zt(pt(s,i)),o)}function r2(t,e,n,r){let{expr:o}=Mc(t,n),i=il(t,e,n,r),s=n2(t,e,n,r);return ut(s,Lt(me(i,2),o))}function G4(t,e,n){let r=Fm(t,e,n,null),o=r2(t,1,e,n);return Lt(r,o)}function gk(t,e,n){let r=X4(t,e),o=W4(t,e),i=G4(t,e,n);return ut(o,pt(i,r))}function V4(t){if(!t.filterStable)return null;let e=t.query();if(!Bi(e))return null;let n=Pm(e,c=>{let f=c._from[0]?.expr;return Pi(f)?f.name:f});if(typeof n!="string")return null;let r=new Map,o={},i={},s=[],a=c=>{let f=c.column,u=Pm(e,p=>p._select.find(l=>l.alias===f)?.expr);return Ae`(SELECT avg(${u??c}) FROM "${n}")`};for(let{alias:c,expr:f}of e._select){if(jn(f)>1)return null;let u=Vb(f);if(u.length===0)s.push(c),o[c]=f;else{for(let p of u){if(p.isDistinct)return null;let l=z4(p,o,a);if(!l)return null;r.set(p,l)}i[c]=rl(f,r)}}return r.size?{group:s,preagg:o,output:i}:null}function Pm(t,e){let n=t.subqueries;if(Bi(t)&&n.length===0)return e(t);let r=Pm(n[0],e);for(let o=1;o<n.length;++o){let i=Pm(n[o],e);if(i!==void 0&&i!==r)return NaN}return r}var yk={skip:!0,result:null},qm=class{constructor(e,{schema:n="mosaic",enabled:r=!0}={}){this.entries=new Map,this.active=null,this.mc=e,this._schema=n,this._enabled=r}set enabled(e){this._enabled!==e&&(e||this.clear(),this._enabled=e)}get enabled(){return this._enabled}set schema(e){this._schema!==e&&(this.clear(),this._schema=e)}get schema(){return this._schema}dropSchema(){return this.clear(),this.mc.exec(`DROP SCHEMA IF EXISTS "${this.schema}" CASCADE`)}clear(){this.entries.clear(),this.active=null}request(e,n,r){if(!this.enabled)return null;let{entries:o,mc:i,schema:s}=this,{source:a}=r;if(!a||this.active&&(this.active.source!==a&&this.clear(),this.active?.source===null))return null;let{active:c}=this;if(!c&&(this.active=c=xk(r),c.source===null))return null;if(o.has(e))return o.get(e);let f=V4(e),u;if(!f)u=null;else if(n.skip(e,r))u=yk;else{let p=n.remove(a).predicate(e);u=vk(e.query(p),c,f,s),u.result=i.exec([`CREATE SCHEMA IF NOT EXISTS ${s}`,Lm(u.table,u.create,{temp:!1})]),u.result.catch(l=>i.logger().error(l))}return o.set(e,u),u}};function xk(t){let{source:e,meta:n}=t,r=t.predicate,o=_c(r).map(p=>p.column),i,s;if(!n||!o)return{source:null,columns:s,predicate:i};let{type:a,scales:c,bin:f,pixelSize:u=1}=n;if(a==="point")i=p=>p,s=Object.fromEntries(o.map(p=>[`${p}`,Tt(p)]));else if(a==="interval"&&c){let p=c.map(l=>wk(l,u,f));p.some(l=>!l)||(p.length===1?(i=l=>l?gn("active0",l.extent.map(p[0])):[],s={active0:p[0](r.expr)}):(i=l=>l?Dn(l.clauses.map((h,d)=>gn(`active${d}`,h.extent.map(p[d])))):[],s=Object.fromEntries(r.clauses.map((l,h)=>[`active${h}`,p[h](l.expr)]))))}return{source:s?e:null,columns:s,predicate:i}}var bk={ceil:jb,round:jo};function wk(t,e,n){let{type:r,domain:o,range:i,apply:s,sqlApply:a}=ol(t);if(!s)return;let c=bk[`${n}`.toLowerCase()]||Re,f=s(Math.min(...o)),u=s(Math.max(...o)),p=(r==="identity"?1:Math.abs(i[1]-i[0])/(u-f))/e,l=p===1?d=>d:d=>pt(de(p),d),h=f===0?d=>d:d=>ut(d,de(f));return d=>Ht(c(l(h(a(d)))))}function vk(t,e,n,r){let{group:o,output:i,preagg:s}=n,{columns:a}=e,c=t.setSelect({...s,...a}).groupby(Object.keys(a)),[f]=c.subqueries;if(f){let g=Object.values(a).flatMap(y=>_c(y).map(x=>x.column));_k(f,g)}let u=c._having,p=c._orderby;c._having=[],c._orderby=[];let l=c.toString(),h=($m(l)>>>0).toString(16),d=`${r}.preagg_${h}`,m=yt.select(o,i).from(d).groupby(o).having(u).orderby(p);return new o2({table:d,create:l,active:e,select:m})}function _k(t,e){let n=new Set,r=o=>{n.has(o)||(n.add(o),Bi(o)&&o._from.length&&o.select(e),o.subqueries.forEach(r))};r(t)}var o2=class{constructor({table:e,create:n,active:r,select:o}){this.table=e,this.create=n,this.result=null,this.active=r,this.select=o,this.skip=!1}query(e){return this.select.clone().where(this.active.predicate(e))}};function i2(t){switch(t){case"BIGINT":case"HUGEINT":case"INTEGER":case"SMALLINT":case"TINYINT":case"UBIGINT":case"UINTEGER":case"USMALLINT":case"UTINYINT":case"DOUBLE":case"FLOAT":case"REAL":return"number";case"DATE":case"TIMESTAMP":case"TIMESTAMPTZ":case"TIMESTAMP WITH TIME ZONE":case"TIME":case"TIMESTAMP_NS":return"date";case"BOOLEAN":return"boolean";case"VARCHAR":case"UUID":case"JSON":return"string";case"ARRAY":case"LIST":return"array";case"BLOB":case"STRUCT":case"MAP":case"GEOMETRY":return"object";default:if(t.startsWith("DECIMAL"))return"number";if(t.startsWith("STRUCT")||t.startsWith("MAP"))return"object";if(t.endsWith("]"))return"array";throw new Error(`Unsupported type: ${t}`)}}var Mk="count",Sk="nulls",Ak="max",Ek="min",Tk="distinct";var Ik={[Mk]:rn,[Tk]:t=>rn(t).distinct(),[Ak]:Un,[Ek]:Wr,[Sk]:t=>rn().where(el(t))};function Ck(t,e,n){return yt.from(t).select(Array.from(n,r=>({[r]:Ik[r](e)})))}async function H4(t,e){return e.length===1&&e[0].column==="*"?kk(t,e[0].table):(await Promise.all(e.map(n=>Nk(t,n)))).filter(n=>n)}async function Nk(t,{table:e,column:n,stats:r}){let o=yt.from({source:e}).select({column:n}).groupby(n.aggregate?Ae`ALL`:[]),[i]=Array.from(await t.query(yt.describe(o))),s={table:e,column:`${n}`,sqlType:i.column_type,type:i2(i.column_type),nullable:i.null==="YES"};if(!(r?.length||r?.size))return s;let[a]=await t.query(Ck(e,n,r),{persist:!0});return Object.assign(s,a)}async function kk(t,e){let n=await t.query(`DESCRIBE ${Vs(e)}`);return Array.from(n).map(r=>({table:e,column:r.column_name,sqlType:r.column_type,type:i2(r.column_type),nullable:r.null==="YES"}))}var zi=Object.freeze({pending:Symbol("pending"),ready:Symbol("ready"),error:Symbol("error"),done:Symbol("done")}),ta=class extends Promise{constructor(){let e,n;super((r,o)=>{e=r,n=o}),this._resolve=e,this._reject=n,this._state=zi.pending,this._value=void 0}fulfill(e){if(this._value!==void 0){if(e!==void 0)throw Error("Promise is ready and fulfill has a provided value");this._resolve(this._value)}else{if(e===void 0)throw Error("Promise is neither ready nor has provided value");this._resolve(e)}return this._state=zi.done,this}ready(e){return this._state=zi.ready,this._value=e,this}reject(e){return this._state=zi.error,this._reject(e),this}get state(){return this._state}};ta.prototype.constructor=Promise;function Bm(){return{debug(...t){},info(...t){},log(...t){},warn(...t){},error(...t){}}}function Rk(t){return(typeof requestAnimationFrame<"u"?requestAnimationFrame:typeof setImmediate<"u"?setImmediate:setTimeout)(t)}function Q4(t,e){let n=[],r=0;function o(){let i=Lk(n,e);n=[],r=0;for(let s of i)$k(s,t),Pk(s,e)}return{add(i,s){i.request.type==="arrow"?(r=r||Rk(()=>o()),n.push({entry:i,priority:s,index:n.length})):t(i,s)}}}function Lk(t,e){let n=[],r=new Map;for(let o of t){let{entry:{request:i}}=o,s=Ok(i.query,e);if(!r.has(s)){let a=[];n.push(a),r.set(s,a)}r.get(s).push(o)}return n}function Ok(t,e){let n=`${t}`;if(Bi(t)&&!e.get(n)){if(t._orderby.length||t._where.length||t._qualify.length||t._having.length)return n;let r=t.clone().setSelect("*"),o=t._groupby;if(o.length){let i={};t._select.forEach(({alias:s,expr:a})=>i[s]=a),r.setGroupby(o.map(s=>qi(s)&&i[s.column]||s))}else t._select.some(i=>jn(i.expr))&&r.setGroupby("ALL");return`${r}`}else return n}function $k(t,e){if(Dk(t))e({request:{type:"arrow",cache:!1,query:t.query=Fk(t)},result:t.result=new ta});else for(let{entry:n,priority:r}of t)e(n,r)}function Dk(t){if(t.length>1){let e=`${t[0].entry.request.query}`;for(let n=1;n<t.length;++n)if(e!==`${t[n].entry.request.query}`)return!0}return!1}function Fk(t){let e=t.maps=[],n=new Map;for(let i of t){let{query:s}=i.entry.request,a=[];e.push(a);for(let{alias:c,expr:f}of s._select){let u=`${f}`;n.has(u)||n.set(u,[`col${n.size}`,f]);let[p]=n.get(u);a.push([p,c])}}let r=t[0].entry.request.query.clone(),o=r._groupby;if(o.length){let i={};t.maps[0].forEach(([s,a])=>i[a]=s),r.setGroupby(o.map(s=>qi(s)&&i[s.column]||s))}return r.setSelect(Array.from(n.values()))}async function Pk(t,e){let{maps:n,query:r,result:o}=t;if(!n)return;let i;try{i=await o}catch(a){for(let{entry:c}of t)c.result.reject(a);return}let s=Nb(r);t.forEach(({entry:a},c)=>{let{request:f,result:u}=a,p=n[c],l=s&&p?Bk(i,p):p?qk(i,p):i;f.cache&&e.set(String(f.query),l),u.fulfill(l)})}function qk(t,e){return t.select(e.map(n=>n[0]),e.map(n=>n[1]))}function Bk(t,e){let n=new Map(e),r=[];for(let o of t)n.has(o.column_name)&&r.push({...o,column_name:n.get(o.column_name)});return r}var zk=typeof requestIdleCallback<"u"?requestIdleCallback:setTimeout,Z4=()=>({get:()=>{},set:(t,e)=>e,clear:()=>{}});function K4({max:t=1e3,ttl:e=3*60*60*1e3}={}){let n=new Map;function r(){let o=performance.now()-e,i=null,s=1/0;for(let[a,c]of n){let{last:f}=c;f<s&&(i=a,s=f),o>f&&n.delete(a)}i&&n.delete(i)}return{get(o){let i=n.get(o);if(i)return i.last=performance.now(),i.value},set(o,i){return n.set(o,{last:performance.now(),value:i}),n.size>t&&zk(r),i},clear(){n=new Map}}}var zm=class{constructor(e){this.queue=Array.from({length:e},()=>({head:null,tail:null}))}isEmpty(){return this.queue.every(e=>!e.head)}insert(e,n){let r=this.queue[n];if(!r)throw new Error(`Invalid queue priority rank: ${n}`);let o={item:e,next:null};r.head===null?r.head=r.tail=o:r.tail=r.tail.next=o}remove(e){for(let n of this.queue){let{head:r,tail:o}=n;for(let i=null,s=r;s;i=s,s=s.next)e(s.item)&&(s===r?r=s.next:i.next=s.next,s===o&&(o=i||r));n.head=r,n.tail=o}}next(){for(let e of this.queue){let{head:n}=e;if(n!==null)return e.head=n.next,e.tail===n&&(e.tail=null),n.item}}};var Zr=Object.freeze({High:0,Normal:1,Low:2}),Ym=class{constructor(e=32){this.queue=new zm(3),this.db=null,this.clientCache=null,this._logger=Bm(),this._logQueries=!1,this._consolidate=null,this.pendingResults=[],this.maxConcurrentRequests=e,this.pendingExec=!1}next(){if(this.queue.isEmpty()||this.pendingResults.length>this.maxConcurrentRequests||this.pendingExec)return;let{request:e,result:n}=this.queue.next();this.pendingResults.push(n),e.type==="exec"&&(this.pendingExec=!0),this.submit(e,n).finally(()=>{for(;this.pendingResults.length&&this.pendingResults[0].state!==zi.pending;){let r=this.pendingResults.shift();r.state===zi.ready?r.fulfill():r.state===zi.done&&this._logger.warn("Found resolved query in pending results.")}e.type==="exec"&&(this.pendingExec=!1),this.next()})}enqueue(e,n=Zr.Normal){this.queue.insert(e,n),this.next()}async submit(e,n){try{let{query:r,type:o,cache:i=!1,options:s}=e,a=r?`${r}`:null;if(i){let p=this.clientCache.get(a);if(p){let l=await p;this._logger.debug("Cache"),n.ready(l);return}}let c=performance.now();this._logQueries&&this._logger.debug("Query",{type:o,sql:a,...s});let f=this.db.query({type:o,sql:a,...s});i&&this.clientCache.set(a,f);let u=await f;i&&this.clientCache.set(a,u),this._logger.debug(`Request: ${(performance.now()-c).toFixed(1)}`),n.ready(o==="exec"?null:u)}catch(r){n.reject(r)}}cache(e){return e!==void 0?this.clientCache=e===!0?K4():e||Z4():this.clientCache}logger(e){return e?this._logger=e:this._logger}logQueries(e){return e!==void 0?this._logQueries=!!e:this._logQueries}connector(e){return e?this.db=e:this.db}consolidate(e){e&&!this._consolidate?this._consolidate=Q4(this.enqueue.bind(this),this.clientCache):!e&&this._consolidate&&(this._consolidate=null)}request(e,n=Zr.Normal){let r=new ta,o={request:e,result:r};return this._consolidate?this._consolidate.add(o,n):this.enqueue(o,n),r}cancel(e){let n=new Set(e);if(n.size){this.queue.remove(({result:r})=>n.has(r)?(r.reject("Canceled"),!0):!1);for(let r of this.pendingResults)n.has(r)&&r.reject("Canceled")}}clear(){this.queue.remove(({result:e})=>(e.reject("Cleared"),!0));for(let e of this.pendingResults)e.reject("Cleared");this.pendingResults=[]}};var Um;function s2(t){return t?Um=t:Um==null&&(Um=new jm),Um}var jm=class{constructor(e=Ab(),{logger:n=console,manager:r=new Ym,cache:o=!0,consolidate:i=!0,preagg:s={}}={}){this.manager=r,this.manager.cache(o),this.manager.consolidate(i),this.databaseConnector(e),this.logger(n),this.clear(),this.preaggregator=new qm(this,s)}clear({clients:e=!0,cache:n=!0}={}){this.manager.clear(),e&&(this.filterGroups?.forEach(r=>r.disconnect()),this.filterGroups=new Map,this.clients?.forEach(r=>this.disconnect(r)),this.clients=new Set),n&&this.manager.cache().clear()}databaseConnector(e){return this.manager.connector(e)}logger(e){return arguments.length&&(this._logger=e||Bm(),this.manager.logger(this._logger)),this._logger}cancel(e){this.manager.cancel(e)}exec(e,{priority:n=Zr.Normal}={}){return e=Array.isArray(e)?e.filter(r=>r).join(`;
2
- `):e,this.manager.request({type:"exec",query:e},n)}query(e,{type:n="arrow",cache:r=!0,priority:o=Zr.Normal,...i}={}){return this.manager.request({type:n,query:e,cache:r,options:i},o)}prefetch(e,n={}){return this.query(e,{...n,cache:!0,priority:Zr.Low})}createBundle(e,n,r=Zr.Low){let o={name:e,queries:n.map(i=>typeof i=="string"?{sql:i}:i)};return this.manager.request({type:"create-bundle",options:o},r)}loadBundle(e,n=Zr.High){let r={name:e};return this.manager.request({type:"load-bundle",options:r},n)}updateClient(e,n,r=Zr.Normal){return e.queryPending(),this.query(n,{priority:r}).then(o=>e.queryResult(o).update(),o=>{this._logger.error(o),e.queryError(o)}).catch(o=>this._logger.error(o))}requestQuery(e,n){return this.preaggregator.clear(),n?this.updateClient(e,n):Promise.resolve(e.update())}async connect(e){let{clients:n}=this;if(n.has(e))throw new Error("Client already connected.");n.add(e),e.coordinator=this,this.initializeClient(e),Yk(this,e.filterBy,e)}async initializeClient(e){let n=e.fields();return n?.length&&e.fieldInfo(await H4(this,n)),e.requestQuery()}disconnect(e){let{clients:n,filterGroups:r}=this;if(!n.has(e))return;n.delete(e),e.coordinator=null;let o=r.get(e.filterBy);o&&o.clients.delete(e)}};function Yk(t,e,n){if(!e)return;let r=t.filterGroups.get(e);if(!r){let o=s=>Uk(t,e,s),i=()=>jk(t,e);e.addEventListener("activate",o),e.addEventListener("value",i),r={selection:e,clients:new Set,disconnect(){e.removeEventListener("activate",o),e.removeEventListener("value",i)}},t.filterGroups.set(e,r)}r.clients.add(n)}function Uk(t,e,n){let{preaggregator:r,filterGroups:o}=t,{clients:i}=o.get(e);for(let s of i)r.request(s,e,n)}function jk(t,e){let{preaggregator:n,filterGroups:r}=t,{clients:o}=r.get(e),{active:i}=e;return Promise.allSettled(Array.from(o,s=>{let a=n.request(s,e,i),c=a?null:e.predicate(s);if(a?.skip||!a&&!c)return;let f=a?.query(i.predicate)??s.query(c);return t.updateClient(s,f)}))}var Xm=class{constructor(){this._callbacks=new Map}addEventListener(e,n){this._callbacks.has(e)||this._callbacks.set(e,{callbacks:new Set,pending:null,queue:new a2}),this._callbacks.get(e).callbacks.add(n)}removeEventListener(e,n){let r=this._callbacks.get(e);r&&r.callbacks.delete(n)}willEmit(e,n){return n}emitQueueFilter(e,n){return null}cancel(e){this._callbacks.get(e)?.queue.clear()}async pending(e){await this._callbacks.get(e)?.pending}emit(e,n){let r=this._callbacks.get(e)||{};if(r.pending)r.queue.enqueue(n,this.emitQueueFilter(e,n));else{let o=this.willEmit(e,n),{callbacks:i,queue:s}=r;if(i?.size){let a=Array.from(i,c=>c(o));r.pending=Promise.allSettled(a).then(()=>{r.pending=null,s.isEmpty()||this.emit(e,s.dequeue())})}}}},a2=class{constructor(){this.clear()}clear(){this.next=null}isEmpty(){return!this.next}enqueue(e,n){let r={value:e};if(n&&this.next){let o=this;for(;o.next;)n(o.next.value)?o=o.next:o.next=o.next.next;o.next=r}else this.next=r}dequeue(){let{next:e}=this;return this.next=e?.next,e?.value}};function sl(t,e){return t===e?!1:t instanceof Date&&e instanceof Date?+t!=+e:Array.isArray(t)&&Array.isArray(e)?Xk(t,e):!0}function Xk(t,e){if(t.length!==e.length)return!0;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!0;return!1}function Wo(t){return t instanceof Sc}var Sc=class t extends Xm{constructor(e){super(),this._value=e}static value(e){return new t(e)}static array(e){if(e.some(n=>Wo(n))){let n=new t,r=()=>{n.update(e.map(o=>Wo(o)?o.value:o))};return r(),e.forEach(o=>Wo(o)?o.addEventListener("value",r):0),n}return new t(e)}get value(){return this._value}update(e,{force:n}={}){return sl(this._value,e)||n?this.emit("value",e):this.cancel("value"),this}willEmit(e,n){return e==="value"&&(this._value=n),n}};function c2(t){return t instanceof Yi}function Wm(t,e){return new Yi(new Gm(t),e&&[e].flat())}var Yi=class t extends Sc{static intersect({cross:e=!1,empty:n=!1,include:r=[]}={}){return Wm({cross:e,empty:n},r)}static union({cross:e=!1,empty:n=!1,include:r=[]}={}){return Wm({cross:e,empty:n,union:!0},r)}static single({cross:e=!1,empty:n=!1,include:r=[]}={}){return Wm({cross:e,empty:n,single:!0},r)}static crossfilter({empty:e=!1,include:n=[]}={}){return Wm({cross:!0,empty:e},n)}constructor(e=new Gm,n=[]){if(super([]),this._resolved=this._value,this._resolver=e,this._relay=new Set,Array.isArray(n))for(let r of n)r._relay.add(this)}clone(){let e=new t(this._resolver);return e._value=e._resolved=this._value,e}remove(e){let n=this.clone();return n._value=n._resolved=n._resolver.resolve(this._resolved,{source:e}),n._value.active={source:e},n}get resolver(){return this._resolver}get single(){return this._resolver.single}get clauses(){return super.value}get active(){return this.clauses.active}get value(){return this.active?.value}valueFor(e){return this.clauses.find(n=>n.source===e)?.value}activate(e){this.emit("activate",e),this._relay.forEach(n=>n.activate(e))}update(e){return this._resolved=this._resolver.resolve(this._resolved,e,!0),this._resolved.active=e,this._relay.forEach(n=>n.update(e)),super.update(this._resolved)}willEmit(e,n){return e==="value"?(this._value=n,this.value):n}emitQueueFilter(e,n){return e==="value"?this._resolver.queueFilter(n):null}skip(e,n){return this._resolver.skip(e,n)}predicate(e,n=!1){let{clauses:r}=this,o=n?null:r.active;return this._resolver.predicate(r,o,e)}},Gm=class{constructor({union:e,cross:n,single:r,empty:o}={}){this.union=!!e,this.cross=!!n,this.single=!!r,this.empty=!!o}resolve(e,n,r=!1){let{source:o,predicate:i}=n,s=e.filter(c=>o!==c.source),a=this.single?[]:s;return this.single&&r&&s.forEach(c=>c.source?.reset?.()),i&&a.push(n),a}skip(e,n){return this.cross&&n?.clients?.has(e)}predicate(e,n,r){let{empty:o,union:i}=this;if(o&&!e.length)return[mn(!1)];if(this.skip(r,n))return;let s=e.filter(a=>!this.skip(r,a)).map(a=>a.predicate);return i&&s.length>1?Gr(s):s}queueFilter(e){if(this.cross){let n=e.active?.source;return r=>r.active?.source!==n}return null}};function f2(t,e,{source:n,clients:r=n?new Set([n]):void 0}){let o=e!==void 0?Nm(t,mn(e)):null;return{meta:{type:"point"},source:n,clients:r,value:e,predicate:o}}function ea(t,e,{source:n,clients:r=n?new Set([n]):void 0}){let o=null;if(e){let i=e.length&&t.length===1?[Xb(t[0],e.map(s=>mn(s[0])))]:e.map(s=>Dn(s.map((a,c)=>Nm(t[c],mn(a)))));o=e.length===0?mn(!1):i.length>1?Gr(i):i[0]}return{meta:{type:"point"},source:n,clients:r,value:e,predicate:o}}function al(t,e,{source:n,clients:r=n?new Set([n]):void 0,bin:o,scale:i,pixelSize:s=1}){let a=e!=null?gn(t,e):null;return{meta:{type:"interval",scales:i&&[i],bin:o,pixelSize:s},source:n,clients:r,value:e,predicate:a}}function u2(t,e,{source:n,clients:r=n?new Set([n]):void 0,bin:o,scales:i=[],pixelSize:s=1}){let a=e!=null?Dn(t.map((f,u)=>gn(f,e[u]))):null;return{meta:{type:"interval",scales:i,bin:o,pixelSize:s},source:n,clients:r,value:e,predicate:a}}function l2(t){return typeof t?.getChild=="function"}function p2(){let t=new Set,e,n=new Promise(r=>e=r);return{pending(r){t.add(r)},ready(r){return t.delete(r),t.size===0},resolve(){n=new Promise(r=>{e(),e=r})},get promise(){return n}}}function cr(t){return l2(t)?Wk(t):Gk(t)}function Wk(t){let{numRows:e}=t;return{numRows:e,columns:t.toColumns()}}function Gk(t){let e=t.length;if(typeof t[0]=="object"){let n=e?Object.keys(t[0]):[],r={};return n.length>0&&n.forEach(o=>{r[o]=t.map(i=>i[o])}),{numRows:e,columns:r}}else return{numRows:e,values:t}}var y3={};QC(y3,{Area:()=>Ga,Arrow:()=>Mh,BarX:()=>Va,BarY:()=>Ha,Cell:()=>Qa,Contour:()=>Oh,Density:()=>Fh,Dot:()=>Za,Frame:()=>gh,Geo:()=>Ph,Hexgrid:()=>qh,Image:()=>Bh,Line:()=>Ka,Link:()=>vh,Mark:()=>ft,Raster:()=>Nh,Rect:()=>Wa,RuleX:()=>ah,RuleY:()=>ch,Text:()=>Ua,TickX:()=>Eh,TickY:()=>Th,Tip:()=>yh,Vector:()=>Xa,WaffleX:()=>Yh,WaffleY:()=>Uh,area:()=>wh,areaX:()=>Ns,areaY:()=>Ni,arrow:()=>QT,auto:()=>a9,autoSpec:()=>Y6,axisFx:()=>Vx,axisFy:()=>Gx,axisX:()=>uh,axisY:()=>fh,barX:()=>ko,barY:()=>Ro,bin:()=>Ci,binX:()=>Co,binY:()=>No,bollinger:()=>Os,bollingerX:()=>h9,bollingerY:()=>d9,boxX:()=>m9,boxY:()=>g9,cell:()=>ks,cellX:()=>KT,cellY:()=>JT,centroid:()=>v1,circle:()=>n9,cluster:()=>dI,column:()=>qe,contour:()=>A9,crosshair:()=>I9,crosshairX:()=>C9,crosshairY:()=>N9,delaunayLink:()=>L9,delaunayMesh:()=>O9,density:()=>q9,differenceX:()=>Y9,differenceY:()=>U9,dodgeX:()=>OI,dodgeY:()=>$I,dot:()=>_r,dotX:()=>t9,dotY:()=>e9,filter:()=>c7,find:()=>y7,formatIsoDate:()=>h6,formatMonth:()=>_E,formatNumber:()=>p6,formatWeekday:()=>ME,frame:()=>Wf,geo:()=>_1,geoCentroid:()=>X9,graticule:()=>G9,gridFx:()=>Kx,gridFy:()=>Qx,gridX:()=>Zx,gridY:()=>Hx,group:()=>Jp,groupX:()=>ms,groupY:()=>gs,groupZ:()=>Kp,hexagon:()=>r9,hexbin:()=>V9,hexgrid:()=>H9,hull:()=>$9,identity:()=>X,image:()=>Z9,indexOf:()=>Xt,initializer:()=>Gt,interpolateNearest:()=>Rh,interpolateNone:()=>w1,interpolatorBarycentric:()=>kh,interpolatorRandomWalk:()=>Lh,legend:()=>xT,line:()=>Ja,lineX:()=>Rs,lineY:()=>Ls,linearRegressionX:()=>tI,linearRegressionY:()=>eI,link:()=>l1,map:()=>qn,mapX:()=>Kf,mapY:()=>Jf,marks:()=>Se,normalize:()=>k1,normalizeX:()=>qI,normalizeY:()=>BI,numberInterval:()=>N_,plot:()=>Gf,pointer:()=>_s,pointerX:()=>Ms,pointerY:()=>Ti,raster:()=>v9,rect:()=>mh,rectX:()=>jf,rectY:()=>Xf,reverse:()=>f7,ruleX:()=>er,ruleY:()=>nr,scale:()=>ys,select:()=>jI,selectFirst:()=>Wh,selectLast:()=>Gh,selectMaxX:()=>$1,selectMaxY:()=>D1,selectMinX:()=>L1,selectMinY:()=>O1,shiftX:()=>zI,shiftY:()=>YI,shuffle:()=>u7,sort:()=>mx,sphere:()=>W9,spike:()=>KE,stackX:()=>k6,stackX1:()=>ST,stackX2:()=>AT,stackY:()=>R6,stackY1:()=>ET,stackY2:()=>TT,text:()=>Io,textX:()=>Bx,textY:()=>zx,tickX:()=>y1,tickY:()=>x1,timeInterval:()=>Wp,tip:()=>i1,transform:()=>Me,tree:()=>c3,treeLink:()=>T1,treeNode:()=>zh,utcInterval:()=>La,valueof:()=>ct,vector:()=>I6,vectorX:()=>jx,vectorY:()=>Xx,voronoi:()=>D9,voronoiMesh:()=>F9,waffleX:()=>wI,waffleY:()=>vI,window:()=>tu,windowX:()=>c9,windowY:()=>f9});function dt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function xn(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Nr(t){let e,n,r;t.length!==2?(e=dt,n=(a,c)=>dt(t(a),c),r=(a,c)=>t(a)-c):(e=t===dt||t===xn?t:Vk,n=t,r=t);function o(a,c,f=0,u=a.length){if(f<u){if(e(c,c)!==0)return u;do{let p=f+u>>>1;n(a[p],c)<0?f=p+1:u=p}while(f<u)}return f}function i(a,c,f=0,u=a.length){if(f<u){if(e(c,c)!==0)return u;do{let p=f+u>>>1;n(a[p],c)<=0?f=p+1:u=p}while(f<u)}return f}function s(a,c,f=0,u=a.length){let p=o(a,c,f,u-1);return p>f&&r(a[p-1],c)>-r(a[p],c)?p-1:p}return{left:o,center:s,right:i}}function Vk(){return 0}function cl(t){return t===null?NaN:+t}function*J4(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}var t5=Nr(dt),e5=t5.right,Hk=t5.left,Qk=Nr(cl).center,Go=e5;var fl=n5(r5),h2=n5(Zk);function n5(t){return function(e,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:o,width:i,height:s}=e;if(!((i=Math.floor(i))>=0))throw new RangeError("invalid width");if(!((s=Math.floor(s!==void 0?s:o.length/i))>=0))throw new RangeError("invalid height");if(!i||!s||!n&&!r)return e;let a=n&&t(n),c=r&&t(r),f=o.slice();return a&&c?(Ac(a,f,o,i,s),Ac(a,o,f,i,s),Ac(a,f,o,i,s),Ec(c,o,f,i,s),Ec(c,f,o,i,s),Ec(c,o,f,i,s)):a?(Ac(a,o,f,i,s),Ac(a,f,o,i,s),Ac(a,o,f,i,s)):c&&(Ec(c,o,f,i,s),Ec(c,f,o,i,s),Ec(c,o,f,i,s)),e}}function Ac(t,e,n,r,o){for(let i=0,s=r*o;i<s;)t(e,n,i,i+=r,1)}function Ec(t,e,n,r,o){for(let i=0,s=r*o;i<r;++i)t(e,n,i,i+s,r)}function Zk(t){let e=r5(t);return(n,r,o,i,s)=>{o<<=2,i<<=2,s<<=2,e(n,r,o+0,i+0,s),e(n,r,o+1,i+1,s),e(n,r,o+2,i+2,s),e(n,r,o+3,i+3,s)}}function r5(t){let e=Math.floor(t);if(e===t)return Kk(t);let n=t-e,r=2*t+1;return(o,i,s,a,c)=>{if(!((a-=c)>=s))return;let f=e*i[s],u=c*e,p=u+c;for(let l=s,h=s+u;l<h;l+=c)f+=i[Math.min(a,l)];for(let l=s,h=a;l<=h;l+=c)f+=i[Math.min(a,l+u)],o[l]=(f+n*(i[Math.max(s,l-p)]+i[Math.min(a,l+p)]))/r,f-=i[Math.max(s,l-u)]}}function Kk(t){let e=2*t+1;return(n,r,o,i,s)=>{if(!((i-=s)>=o))return;let a=t*r[o],c=s*t;for(let f=o,u=o+c;f<u;f+=s)a+=r[Math.min(i,f)];for(let f=o,u=i;f<=u;f+=s)a+=r[Math.min(i,f+c)],n[f]=a/e,a-=r[Math.max(o,f-c)]}}function Kr(t,e){let n=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(o=+o)>=o&&++n}return n}function Jk(t){return t.length|0}function tR(t){return!(t>0)}function eR(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function nR(t){return e=>t(...e)}function Vm(...t){let e=typeof t[t.length-1]=="function"&&nR(t.pop());t=t.map(eR);let n=t.map(Jk),r=t.length-1,o=new Array(r+1).fill(0),i=[];if(r<0||n.some(tR))return i;for(;;){i.push(o.map((a,c)=>t[c][a]));let s=r;for(;++o[s]===n[s];){if(s===0)return e?i.map(e):i;o[s--]=0}}}function Hm(t,e){var n=0,r=0;return Float64Array.from(t,e===void 0?o=>n+=+o||0:o=>n+=+e(o,r++,t)||0)}function Ui(t,e){let n=0,r,o=0,i=0;if(e===void 0)for(let s of t)s!=null&&(s=+s)>=s&&(r=s-o,o+=r/++n,i+=r*(s-o));else{let s=-1;for(let a of t)(a=e(a,++s,t))!=null&&(a=+a)>=a&&(r=a-o,o+=r/++n,i+=r*(a-o))}if(n>1)return i/(n-1)}function fr(t,e){let n=Ui(t,e);return n&&Math.sqrt(n)}function Ot(t,e){let n,r;if(e===void 0)for(let o of t)o!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)));else{let o=-1;for(let i of t)(i=e(i,++o,t))!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}var Xe=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){let n=this._partials,r=0;for(let o=0;o<this._n&&o<32;o++){let i=n[o],s=e+i,a=Math.abs(e)<Math.abs(i)?e-(s-i):i-(s-e);a&&(n[r++]=a),e=s}return n[r]=e,this._n=r+1,this}valueOf(){let e=this._partials,n=this._n,r,o,i,s=0;if(n>0){for(s=e[--n];n>0&&(r=s,o=e[--n],s=r+o,i=o-(s-r),!i););n>0&&(i<0&&e[n-1]<0||i>0&&e[n-1]>0)&&(o=i*2,r=s+o,o==r-s&&(s=r))}return s}};var bn=class extends Map{constructor(e,n=s5){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let[r,o]of e)this.set(r,o)}get(e){return super.get(d2(this,e))}has(e){return super.has(d2(this,e))}set(e,n){return super.set(o5(this,e),n)}delete(e){return super.delete(i5(this,e))}},wn=class extends Set{constructor(e,n=s5){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let r of e)this.add(r)}has(e){return super.has(d2(this,e))}add(e){return super.add(o5(this,e))}delete(e){return super.delete(i5(this,e))}};function d2({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):n}function o5({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function i5({_intern:t,_key:e},n){let r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function s5(t){return t!==null&&typeof t=="object"?t.valueOf():t}function ul(t){return t}function We(t,...e){return g2(t,ul,ul,e)}function kr(t,e,...n){return g2(t,ul,e,n)}function m2(t,e,...n){return g2(t,Array.from,e,n)}function g2(t,e,n,r){return function o(i,s){if(s>=r.length)return n(i);let a=new bn,c=r[s++],f=-1;for(let u of i){let p=c(u,++f,i),l=a.get(p);l?l.push(u):a.set(p,[u])}for(let[u,p]of a)a.set(u,o(p,s));return e(a)}(t,0)}function y2(t,e){return Array.from(e,n=>t[n])}function Vo(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){let r=Uint32Array.from(t,(o,i)=>i);return e.length>1?(e=e.map(o=>t.map(o)),r.sort((o,i)=>{for(let s of e){let a=na(s[o],s[i]);if(a)return a}})):(n=t.map(n),r.sort((o,i)=>na(n[o],n[i]))),y2(t,r)}return t.sort(ll(n))}function ll(t=dt){if(t===dt)return na;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{let r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function na(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}function Tc(t,e,n){return(e.length!==2?Vo(kr(t,e,n),([r,o],[i,s])=>dt(o,s)||dt(r,i)):Vo(We(t,n),([r,o],[i,s])=>e(o,s)||dt(r,i))).map(([r])=>r)}var rR=Math.sqrt(50),oR=Math.sqrt(10),iR=Math.sqrt(2);function Qm(t,e,n){let r=(e-t)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),s=i>=rR?10:i>=oR?5:i>=iR?2:1,a,c,f;return o<0?(f=Math.pow(10,-o)/s,a=Math.round(t*f),c=Math.round(e*f),a/f<t&&++a,c/f>e&&--c,f=-f):(f=Math.pow(10,o)*s,a=Math.round(t/f),c=Math.round(e/f),a*f<t&&++a,c*f>e&&--c),c<a&&.5<=n&&n<2?Qm(t,e,n*2):[a,c,f]}function Ge(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];let r=e<t,[o,i,s]=r?Qm(e,t,n):Qm(t,e,n);if(!(i>=o))return[];let a=i-o+1,c=new Array(a);if(r)if(s<0)for(let f=0;f<a;++f)c[f]=(i-f)/-s;else for(let f=0;f<a;++f)c[f]=(i-f)*s;else if(s<0)for(let f=0;f<a;++f)c[f]=(o+f)/-s;else for(let f=0;f<a;++f)c[f]=(o+f)*s;return c}function Ho(t,e,n){return e=+e,t=+t,n=+n,Qm(t,e,n)[2]}function Ic(t,e,n){e=+e,t=+t,n=+n;let r=e<t,o=r?Ho(e,t,n):Ho(t,e,n);return(r?-1:1)*(o<0?1/-o:o)}function Cc(t,e,n){let r;for(;;){let o=Ho(t,e,n);if(o===r||o===0||!isFinite(o))return[t,e];o>0?(t=Math.floor(t/o)*o,e=Math.ceil(e/o)*o):o<0&&(t=Math.ceil(t*o)/o,e=Math.floor(e*o)/o),r=o}}function ji(t){return Math.max(1,Math.ceil(Math.log(Kr(t))/Math.LN2)+1)}function It(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o)}return n}function Zm(t,e){let n,r=-1,o=-1;if(e===void 0)for(let i of t)++o,i!=null&&(n<i||n===void 0&&i>=i)&&(n=i,r=o);else for(let i of t)(i=e(i,++o,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i,r=o);return r}function St(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function Km(t,e){let n,r=-1,o=-1;if(e===void 0)for(let i of t)++o,i!=null&&(n>i||n===void 0&&i>=i)&&(n=i,r=o);else for(let i of t)(i=e(i,++o,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i,r=o);return r}function Jm(t,e,n=0,r=1/0,o){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(o=o===void 0?na:ll(o);r>n;){if(r-n>600){let c=r-n+1,f=e-n+1,u=Math.log(c),p=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*p*(c-p)/c)*(f-c/2<0?-1:1),h=Math.max(n,Math.floor(e-f*p/c+l)),d=Math.min(r,Math.floor(e+(c-f)*p/c+l));Jm(t,e,h,d,o)}let i=t[e],s=n,a=r;for(pl(t,n,e),o(t[r],i)>0&&pl(t,n,r);s<a;){for(pl(t,s,a),++s,--a;o(t[s],i)<0;)++s;for(;o(t[a],i)>0;)--a}o(t[n],i)===0?pl(t,n,a):(++a,pl(t,a,r)),a<=e&&(n=a+1),e<=a&&(r=a-1)}return t}function pl(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}function ra(t,e=dt){let n,r=!1;if(e.length===1){let o;for(let i of t){let s=e(i);(r?dt(s,o)>0:dt(s,s)===0)&&(n=i,o=s,r=!0)}}else for(let o of t)(r?e(o,n)>0:e(o,o)===0)&&(n=o,r=!0);return n}function vn(t,e,n){if(t=Float64Array.from(J4(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return St(t);if(e>=1)return It(t);var r,o=(r-1)*e,i=Math.floor(o),s=It(Jm(t,i).subarray(0,i+1)),a=St(t.subarray(i+1));return s+(a-s)*(o-i)}}function x2(t,e,n=cl){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,o=(r-1)*e,i=Math.floor(o),s=+n(t[i],i,t),a=+n(t[i+1],i+1,t);return s+(a-s)*(o-i)}}function t0(t,e,n){let r=Kr(t),o=vn(t,.75)-vn(t,.25);return r&&o?Math.ceil((n-e)/(2*o*Math.pow(r,-1/3))):1}function hl(t,e,n){let r=Kr(t),o=fr(t);return r&&o?Math.ceil((n-e)*Math.cbrt(r)/(3.49*o)):1}function Qo(t,e){let n=0,r=0;if(e===void 0)for(let o of t)o!=null&&(o=+o)>=o&&(++n,r+=o);else{let o=-1;for(let i of t)(i=e(i,++o,t))!=null&&(i=+i)>=i&&(++n,r+=i)}if(n)return r/n}function Rr(t,e){return vn(t,.5,e)}function*aR(t){for(let e of t)yield*e}function Nc(t){return Array.from(aR(t))}function kc(t,e){let n=new bn;if(e===void 0)for(let i of t)i!=null&&i>=i&&n.set(i,(n.get(i)||0)+1);else{let i=-1;for(let s of t)(s=e(s,++i,t))!=null&&s>=s&&n.set(s,(n.get(s)||0)+1)}let r,o=0;for(let[i,s]of n)s>o&&(o=s,r=i);return r}function e0(t,e=cR){let n=[],r,o=!1;for(let i of t)o&&n.push(e(r,i)),r=i,o=!0;return n}function cR(t,e){return[t,e]}function le(t,e,n){t=+t,e=+e,n=(o=arguments.length)<2?(e=t,t=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((e-t)/n))|0,i=new Array(o);++r<o;)i[r]=t+r*n;return i}function dl(t,e=dt){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(t),r=new Float64Array(n.length);e.length!==2&&(n=n.map(e),e=dt);let o=(a,c)=>e(n[a],n[c]),i,s;return t=Uint32Array.from(n,(a,c)=>c),t.sort(e===dt?(a,c)=>na(n[a],n[c]):ll(o)),t.forEach((a,c)=>{let f=o(a,i===void 0?a:i);f>=0?((i===void 0||f>0)&&(i=a,s=c),r[a]=s):r[a]=NaN}),r}function n0(t,e=dt){let n,r=!1;if(e.length===1){let o;for(let i of t){let s=e(i);(r?dt(s,o)<0:dt(s,s)===0)&&(n=i,o=s,r=!0)}}else for(let o of t)(r?e(o,n)<0:e(o,o)===0)&&(n=o,r=!0);return n}function Ve(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let o of t)(o=+e(o,++r,t))&&(n+=o)}return n}function Xi(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function a5(t){return t}var b2=1,w2=2,v2=3,r0=4,c5=1e-6;function fR(t){return"translate("+t+",0)"}function uR(t){return"translate(0,"+t+")"}function lR(t){return e=>+t(e)}function pR(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function hR(){return!this.__axis}function dR(t,e){var n=[],r=null,o=null,i=6,s=6,a=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,f=t===b2||t===r0?-1:1,u=t===r0||t===w2?"x":"y",p=t===b2||t===v2?fR:uR;function l(h){var d=r??(e.ticks?e.ticks.apply(e,n):e.domain()),m=o??(e.tickFormat?e.tickFormat.apply(e,n):a5),g=Math.max(i,0)+a,y=e.range(),x=+y[0]+c,b=+y[y.length-1]+c,w=(e.bandwidth?pR:lR)(e.copy(),c),_=h.selection?h.selection():h,v=_.selectAll(".domain").data([null]),A=_.selectAll(".tick").data(d,e).order(),E=A.exit(),T=A.enter().append("g").attr("class","tick"),C=A.select("line"),S=A.select("text");v=v.merge(v.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(T),C=C.merge(T.append("line").attr("stroke","currentColor").attr(u+"2",f*i)),S=S.merge(T.append("text").attr("fill","currentColor").attr(u,f*g).attr("dy",t===b2?"0em":t===v2?"0.71em":"0.32em")),h!==_&&(v=v.transition(h),A=A.transition(h),C=C.transition(h),S=S.transition(h),E=E.transition(h).attr("opacity",c5).attr("transform",function(k){return isFinite(k=w(k))?p(k+c):this.getAttribute("transform")}),T.attr("opacity",c5).attr("transform",function(k){var L=this.parentNode.__axis;return p((L&&isFinite(L=L(k))?L:w(k))+c)})),E.remove(),v.attr("d",t===r0||t===w2?s?"M"+f*s+","+x+"H"+c+"V"+b+"H"+f*s:"M"+c+","+x+"V"+b:s?"M"+x+","+f*s+"V"+c+"H"+b+"V"+f*s:"M"+x+","+c+"H"+b),A.attr("opacity",1).attr("transform",function(k){return p(w(k)+c)}),C.attr(u+"2",f*i),S.attr(u,f*g).text(m),_.filter(hR).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===w2?"start":t===r0?"end":"middle"),_.each(function(){this.__axis=w})}return l.scale=function(h){return arguments.length?(e=h,l):e},l.ticks=function(){return n=Array.from(arguments),l},l.tickArguments=function(h){return arguments.length?(n=h==null?[]:Array.from(h),l):n.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?(o=h,l):o},l.tickSize=function(h){return arguments.length?(i=s=+h,l):i},l.tickSizeInner=function(h){return arguments.length?(i=+h,l):i},l.tickSizeOuter=function(h){return arguments.length?(s=+h,l):s},l.tickPadding=function(h){return arguments.length?(a=+h,l):a},l.offset=function(h){return arguments.length?(c=+h,l):c},l}function _2(t){return dR(v2,t)}var mR={value:()=>{}};function u5(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new o0(n)}function o0(t){this._=t}function gR(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}o0.prototype=u5.prototype={constructor:o0,on:function(t,e){var n=this._,r=gR(t+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(t=r[i]).type)&&(o=yR(n[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<s;)if(o=(t=r[i]).type)n[o]=f5(n[o],t.name,e);else if(e==null)for(o in n)n[o]=f5(n[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new o0(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};function yR(t,e){for(var n=0,r=t.length,o;n<r;++n)if((o=t[n]).name===e)return o.value}function f5(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=mR,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var oa=u5;var i0="http://www.w3.org/1999/xhtml",_n={svg:"http://www.w3.org/2000/svg",xhtml:i0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zo(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),_n.hasOwnProperty(e)?{space:_n[e],local:t}:t}function xR(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===i0&&e.documentElement.namespaceURI===i0?e.createElement(t):e.createElementNS(n,t)}}function bR(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ko(t){var e=Zo(t);return(e.local?bR:xR)(e)}function wR(){}function ia(t){return t==null?wR:function(){return this.querySelector(t)}}function l5(t){typeof t!="function"&&(t=ia(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],s=i.length,a=r[o]=new Array(s),c,f,u=0;u<s;++u)(c=i[u])&&(f=t.call(c,c.__data__,u,i))&&("__data__"in c&&(f.__data__=c.__data__),a[u]=f);return new se(r,this._parents)}function M2(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function vR(){return[]}function ml(t){return t==null?vR:function(){return this.querySelectorAll(t)}}function _R(t){return function(){return M2(t.apply(this,arguments))}}function p5(t){typeof t=="function"?t=_R(t):t=ml(t);for(var e=this._groups,n=e.length,r=[],o=[],i=0;i<n;++i)for(var s=e[i],a=s.length,c,f=0;f<a;++f)(c=s[f])&&(r.push(t.call(c,c.__data__,f,s)),o.push(c));return new se(r,o)}function gl(t){return function(){return this.matches(t)}}function s0(t){return function(e){return e.matches(t)}}var MR=Array.prototype.find;function SR(t){return function(){return MR.call(this.children,t)}}function AR(){return this.firstElementChild}function h5(t){return this.select(t==null?AR:SR(typeof t=="function"?t:s0(t)))}var ER=Array.prototype.filter;function TR(){return Array.from(this.children)}function IR(t){return function(){return ER.call(this.children,t)}}function d5(t){return this.selectAll(t==null?TR:IR(typeof t=="function"?t:s0(t)))}function m5(t){typeof t!="function"&&(t=gl(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],s=i.length,a=r[o]=[],c,f=0;f<s;++f)(c=i[f])&&t.call(c,c.__data__,f,i)&&a.push(c);return new se(r,this._parents)}function a0(t){return new Array(t.length)}function g5(){return new se(this._enter||this._groups.map(a0),this._parents)}function yl(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}yl.prototype={constructor:yl,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function y5(t){return function(){return t}}function CR(t,e,n,r,o,i){for(var s=0,a,c=e.length,f=i.length;s<f;++s)(a=e[s])?(a.__data__=i[s],r[s]=a):n[s]=new yl(t,i[s]);for(;s<c;++s)(a=e[s])&&(o[s]=a)}function NR(t,e,n,r,o,i,s){var a,c,f=new Map,u=e.length,p=i.length,l=new Array(u),h;for(a=0;a<u;++a)(c=e[a])&&(l[a]=h=s.call(c,c.__data__,a,e)+"",f.has(h)?o[a]=c:f.set(h,c));for(a=0;a<p;++a)h=s.call(t,i[a],a,i)+"",(c=f.get(h))?(r[a]=c,c.__data__=i[a],f.delete(h)):n[a]=new yl(t,i[a]);for(a=0;a<u;++a)(c=e[a])&&f.get(l[a])===c&&(o[a]=c)}function kR(t){return t.__data__}function x5(t,e){if(!arguments.length)return Array.from(this,kR);var n=e?NR:CR,r=this._parents,o=this._groups;typeof t!="function"&&(t=y5(t));for(var i=o.length,s=new Array(i),a=new Array(i),c=new Array(i),f=0;f<i;++f){var u=r[f],p=o[f],l=p.length,h=RR(t.call(u,u&&u.__data__,f,r)),d=h.length,m=a[f]=new Array(d),g=s[f]=new Array(d),y=c[f]=new Array(l);n(u,p,m,g,y,h,e);for(var x=0,b=0,w,_;x<d;++x)if(w=m[x]){for(x>=b&&(b=x+1);!(_=g[b])&&++b<d;);w._next=_||null}}return s=new se(s,r),s._enter=a,s._exit=c,s}function RR(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function b5(){return new se(this._exit||this._groups.map(a0),this._parents)}function w5(t,e,n){var r=this.enter(),o=this,i=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function v5(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),c=0;c<s;++c)for(var f=n[c],u=r[c],p=f.length,l=a[c]=new Array(p),h,d=0;d<p;++d)(h=f[d]||u[d])&&(l[d]=h);for(;c<o;++c)a[c]=n[c];return new se(a,this._parents)}function _5(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function M5(t){t||(t=LR);function e(p,l){return p&&l?t(p.__data__,l.__data__):!p-!l}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,c=o[i]=new Array(a),f,u=0;u<a;++u)(f=s[u])&&(c[u]=f);c.sort(e)}return new se(o,this._parents).order()}function LR(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function S5(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function A5(){return Array.from(this)}function E5(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function T5(){let t=0;for(let e of this)++t;return t}function I5(){return!this.node()}function C5(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o=e[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&t.call(a,a.__data__,i,o);return this}function OR(t){return function(){this.removeAttribute(t)}}function $R(t){return function(){this.removeAttributeNS(t.space,t.local)}}function DR(t,e){return function(){this.setAttribute(t,e)}}function FR(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function PR(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function qR(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function N5(t,e){var n=Zo(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?$R:OR:typeof e=="function"?n.local?qR:PR:n.local?FR:DR)(n,e))}function c0(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function BR(t){return function(){this.style.removeProperty(t)}}function zR(t,e,n){return function(){this.style.setProperty(t,e,n)}}function YR(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function k5(t,e,n){return arguments.length>1?this.each((e==null?BR:typeof e=="function"?YR:zR)(t,e,n??"")):Wi(this.node(),t)}function Wi(t,e){return t.style.getPropertyValue(e)||c0(t).getComputedStyle(t,null).getPropertyValue(e)}function UR(t){return function(){delete this[t]}}function jR(t,e){return function(){this[t]=e}}function XR(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function R5(t,e){return arguments.length>1?this.each((e==null?UR:typeof e=="function"?XR:jR)(t,e)):this.node()[t]}function L5(t){return t.trim().split(/^|\s+/)}function S2(t){return t.classList||new O5(t)}function O5(t){this._node=t,this._names=L5(t.getAttribute("class")||"")}O5.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function $5(t,e){for(var n=S2(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function D5(t,e){for(var n=S2(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function WR(t){return function(){$5(this,t)}}function GR(t){return function(){D5(this,t)}}function VR(t,e){return function(){(e.apply(this,arguments)?$5:D5)(this,t)}}function F5(t,e){var n=L5(t+"");if(arguments.length<2){for(var r=S2(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof e=="function"?VR:e?WR:GR)(n,e))}function HR(){this.textContent=""}function QR(t){return function(){this.textContent=t}}function ZR(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function P5(t){return arguments.length?this.each(t==null?HR:(typeof t=="function"?ZR:QR)(t)):this.node().textContent}function KR(){this.innerHTML=""}function JR(t){return function(){this.innerHTML=t}}function tL(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function q5(t){return arguments.length?this.each(t==null?KR:(typeof t=="function"?tL:JR)(t)):this.node().innerHTML}function eL(){this.nextSibling&&this.parentNode.appendChild(this)}function B5(){return this.each(eL)}function nL(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function z5(){return this.each(nL)}function Y5(t){var e=typeof t=="function"?t:Ko(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function rL(){return null}function U5(t,e){var n=typeof t=="function"?t:Ko(t),r=e==null?rL:typeof e=="function"?e:ia(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function oL(){var t=this.parentNode;t&&t.removeChild(this)}function j5(){return this.each(oL)}function iL(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function sL(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function X5(t){return this.select(t?sL:iL)}function W5(t){return arguments.length?this.property("__data__",t):this.node().__data__}function aL(t){return function(e){t.call(this,e,this.__data__)}}function cL(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function fL(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,o=e.length,i;n<o;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++r]=i;++r?e.length=r:delete this.__on}}}function uL(t,e,n){return function(){var r=this.__on,o,i=aL(e);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=e;return}}this.addEventListener(t.type,i,n),o={type:t.type,name:t.name,value:e,listener:i,options:n},r?r.push(o):this.__on=[o]}}function G5(t,e,n){var r=cL(t+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,f=a.length,u;c<f;++c)for(o=0,u=a[c];o<i;++o)if((s=r[o]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?uL:fL,o=0;o<i;++o)this.each(a(r[o],e,n));return this}function V5(t,e,n){var r=c0(t),o=r.CustomEvent;typeof o=="function"?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function lL(t,e){return function(){return V5(this,t,e)}}function pL(t,e){return function(){return V5(this,t,e.apply(this,arguments))}}function H5(t,e){return this.each((typeof e=="function"?pL:lL)(t,e))}function*Q5(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var A2=[null];function se(t,e){this._groups=t,this._parents=e}function Z5(){return new se([[document.documentElement]],A2)}function hL(){return this}se.prototype=Z5.prototype={constructor:se,select:l5,selectAll:p5,selectChild:h5,selectChildren:d5,filter:m5,data:x5,enter:g5,exit:b5,join:w5,merge:v5,selection:hL,order:_5,sort:M5,call:S5,nodes:A5,node:E5,size:T5,empty:I5,each:C5,attr:N5,style:k5,property:R5,classed:F5,text:P5,html:q5,raise:B5,lower:z5,append:Y5,insert:U5,remove:j5,clone:X5,datum:W5,on:G5,dispatch:H5,[Symbol.iterator]:Q5};var Jo=Z5;function At(t){return typeof t=="string"?new se([[document.querySelector(t)]],[document.documentElement]):new se([[t]],A2)}function K5(t){let e;for(;e=t.sourceEvent;)t=e;return t}function on(t,e){if(t=K5(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}var f0={capture:!0,passive:!1};function u0(t){t.preventDefault(),t.stopImmediatePropagation()}function xl(t){var e=t.document.documentElement,n=At(t).on("dragstart.drag",u0,f0);"onselectstart"in e?n.on("selectstart.drag",u0,f0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function bl(t,e){var n=t.document.documentElement,r=At(t).on("dragstart.drag",null);e&&(r.on("click.drag",u0,f0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function ti(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Gi(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function to(){}var Vi=.7,ca=1/Vi,Rc="\\s*([+-]?\\d+)\\s*",wl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dL=/^#([0-9a-f]{3,8})$/,mL=new RegExp(`^rgb\\(${Rc},${Rc},${Rc}\\)$`),gL=new RegExp(`^rgb\\(${Jr},${Jr},${Jr}\\)$`),yL=new RegExp(`^rgba\\(${Rc},${Rc},${Rc},${wl}\\)$`),xL=new RegExp(`^rgba\\(${Jr},${Jr},${Jr},${wl}\\)$`),bL=new RegExp(`^hsl\\(${wl},${Jr},${Jr}\\)$`),wL=new RegExp(`^hsla\\(${wl},${Jr},${Jr},${wl}\\)$`),J5={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};ti(to,Xn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:tM,formatHex:tM,formatHex8:vL,formatHsl:_L,formatRgb:eM,toString:eM});function tM(){return this.rgb().formatHex()}function vL(){return this.rgb().formatHex8()}function _L(){return aM(this).formatHsl()}function eM(){return this.rgb().formatRgb()}function Xn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=dL.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?nM(e):n===3?new ge(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?l0(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?l0(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=mL.exec(t))?new ge(e[1],e[2],e[3],1):(e=gL.exec(t))?new ge(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=yL.exec(t))?l0(e[1],e[2],e[3],e[4]):(e=xL.exec(t))?l0(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=bL.exec(t))?iM(e[1],e[2]/100,e[3]/100,1):(e=wL.exec(t))?iM(e[1],e[2]/100,e[3]/100,e[4]):J5.hasOwnProperty(t)?nM(J5[t]):t==="transparent"?new ge(NaN,NaN,NaN,0):null}function nM(t){return new ge(t>>16&255,t>>8&255,t&255,1)}function l0(t,e,n,r){return r<=0&&(t=e=n=NaN),new ge(t,e,n,r)}function vl(t){return t instanceof to||(t=Xn(t)),t?(t=t.rgb(),new ge(t.r,t.g,t.b,t.opacity)):new ge}function Ee(t,e,n,r){return arguments.length===1?vl(t):new ge(t,e,n,r??1)}function ge(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ti(ge,Ee,Gi(to,{brighter(t){return t=t==null?ca:Math.pow(ca,t),new ge(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Vi:Math.pow(Vi,t),new ge(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ge(aa(this.r),aa(this.g),aa(this.b),h0(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:rM,formatHex:rM,formatHex8:ML,formatRgb:oM,toString:oM}));function rM(){return`#${sa(this.r)}${sa(this.g)}${sa(this.b)}`}function ML(){return`#${sa(this.r)}${sa(this.g)}${sa(this.b)}${sa((isNaN(this.opacity)?1:this.opacity)*255)}`}function oM(){let t=h0(this.opacity);return`${t===1?"rgb(":"rgba("}${aa(this.r)}, ${aa(this.g)}, ${aa(this.b)}${t===1?")":`, ${t})`}`}function h0(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function aa(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function sa(t){return t=aa(t),(t<16?"0":"")+t.toString(16)}function iM(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Lr(t,e,n,r)}function aM(t){if(t instanceof Lr)return new Lr(t.h,t.s,t.l,t.opacity);if(t instanceof to||(t=Xn(t)),!t)return new Lr;if(t instanceof Lr)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),s=NaN,a=i-o,c=(i+o)/2;return a?(e===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-e)/a+2:s=(e-n)/a+4,a/=c<.5?i+o:2-i-o,s*=60):a=c>0&&c<1?0:s,new Lr(s,a,c,t.opacity)}function _l(t,e,n,r){return arguments.length===1?aM(t):new Lr(t,e,n,r??1)}function Lr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ti(Lr,_l,Gi(to,{brighter(t){return t=t==null?ca:Math.pow(ca,t),new Lr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Vi:Math.pow(Vi,t),new Lr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new ge(E2(t>=240?t-240:t+120,o,r),E2(t,o,r),E2(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new Lr(sM(this.h),p0(this.s),p0(this.l),h0(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=h0(this.opacity);return`${t===1?"hsl(":"hsla("}${sM(this.h)}, ${p0(this.s)*100}%, ${p0(this.l)*100}%${t===1?")":`, ${t})`}`}}));function sM(t){return t=(t||0)%360,t<0?t+360:t}function p0(t){return Math.max(0,Math.min(1,t||0))}function E2(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var d0=Math.PI/180,m0=180/Math.PI;var g0=18,cM=.96422,fM=1,uM=.82521,lM=4/29,Lc=6/29,pM=3*Lc*Lc,SL=Lc*Lc*Lc;function hM(t){if(t instanceof eo)return new eo(t.l,t.a,t.b,t.opacity);if(t instanceof ei)return dM(t);t instanceof ge||(t=vl(t));var e=N2(t.r),n=N2(t.g),r=N2(t.b),o=T2((.2225045*e+.7168786*n+.0606169*r)/fM),i,s;return e===n&&n===r?i=s=o:(i=T2((.4360747*e+.3850649*n+.1430804*r)/cM),s=T2((.0139322*e+.0971045*n+.7141733*r)/uM)),new eo(116*o-16,500*(i-o),200*(o-s),t.opacity)}function Oc(t,e,n,r){return arguments.length===1?hM(t):new eo(t,e,n,r??1)}function eo(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}ti(eo,Oc,Gi(to,{brighter(t){return new eo(this.l+g0*(t??1),this.a,this.b,this.opacity)},darker(t){return new eo(this.l-g0*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=cM*I2(e),t=fM*I2(t),n=uM*I2(n),new ge(C2(3.1338561*e-1.6168667*t-.4906146*n),C2(-.9787684*e+1.9161415*t+.033454*n),C2(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function T2(t){return t>SL?Math.pow(t,1/3):t/pM+lM}function I2(t){return t>Lc?t*t*t:pM*(t-lM)}function C2(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function N2(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function AL(t){if(t instanceof ei)return new ei(t.h,t.c,t.l,t.opacity);if(t instanceof eo||(t=hM(t)),t.a===0&&t.b===0)return new ei(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*m0;return new ei(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Ml(t,e,n,r){return arguments.length===1?AL(t):new ei(t,e,n,r??1)}function ei(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function dM(t){if(isNaN(t.h))return new eo(t.l,0,0,t.opacity);var e=t.h*d0;return new eo(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}ti(ei,Ml,Gi(to,{brighter(t){return new ei(this.h,this.c,this.l+g0*(t??1),this.opacity)},darker(t){return new ei(this.h,this.c,this.l-g0*(t??1),this.opacity)},rgb(){return dM(this).rgb()}}));var xM=-.14861,k2=1.78277,R2=-.29227,y0=-.90649,Sl=1.97294,mM=Sl*y0,gM=Sl*k2,yM=k2*R2-y0*xM;function EL(t){if(t instanceof fa)return new fa(t.h,t.s,t.l,t.opacity);t instanceof ge||(t=vl(t));var e=t.r/255,n=t.g/255,r=t.b/255,o=(yM*r+mM*e-gM*n)/(yM+mM-gM),i=r-o,s=(Sl*(n-o)-R2*i)/y0,a=Math.sqrt(s*s+i*i)/(Sl*o*(1-o)),c=a?Math.atan2(s,i)*m0-120:NaN;return new fa(c<0?c+360:c,a,o,t.opacity)}function Mn(t,e,n,r){return arguments.length===1?EL(t):new fa(t,e,n,r??1)}function fa(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ti(fa,Mn,Gi(to,{brighter(t){return t=t==null?ca:Math.pow(ca,t),new fa(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Vi:Math.pow(Vi,t),new fa(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*d0,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),o=Math.sin(t);return new ge(255*(e+n*(xM*r+k2*o)),255*(e+n*(R2*r+y0*o)),255*(e+n*(Sl*r)),this.opacity)}}));function L2(t,e,n,r,o){var i=t*t,s=i*t;return((1-3*t+3*i-s)*e+(4-6*i+3*s)*n+(1+3*t+3*i-3*s)*r+s*o)/6}function bM(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],s=r>0?t[r-1]:2*o-i,a=r<e-1?t[r+2]:2*i-o;return L2((n-r/e)*e,s,o,i,a)}}function wM(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],i=t[r%e],s=t[(r+1)%e],a=t[(r+2)%e];return L2((n-r/e)*e,o,i,s,a)}}var $c=t=>()=>t;function vM(t,e){return function(n){return t+n*e}}function TL(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Dc(t,e){var n=e-t;return n?vM(t,n>180||n<-180?n-360*Math.round(n/360):n):$c(isNaN(t)?e:t)}function _M(t){return(t=+t)==1?Kt:function(e,n){return n-e?TL(e,n,t):$c(isNaN(e)?n:e)}}function Kt(t,e){var n=e-t;return n?vM(t,n):$c(isNaN(t)?e:t)}var ur=function t(e){var n=_M(e);function r(o,i){var s=n((o=Ee(o)).r,(i=Ee(i)).r),a=n(o.g,i.g),c=n(o.b,i.b),f=Kt(o.opacity,i.opacity);return function(u){return o.r=s(u),o.g=a(u),o.b=c(u),o.opacity=f(u),o+""}}return r.gamma=t,r}(1);function MM(t){return function(e){var n=e.length,r=new Array(n),o=new Array(n),i=new Array(n),s,a;for(s=0;s<n;++s)a=Ee(e[s]),r[s]=a.r||0,o[s]=a.g||0,i[s]=a.b||0;return r=t(r),o=t(o),i=t(i),a.opacity=1,function(c){return a.r=r(c),a.g=o(c),a.b=i(c),a+""}}}var O2=MM(bM),IL=MM(wM);function SM(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=t[o]*(1-i)+e[o]*i;return r}}function AM(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function EM(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=Wn(t[s],e[s]);for(;s<n;++s)i[s]=e[s];return function(a){for(s=0;s<r;++s)i[s]=o[s](a);return i}}function TM(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Qt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function IM(t,e){var n={},r={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?n[o]=Wn(t[o],e[o]):r[o]=e[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var D2=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$2=new RegExp(D2.source,"g");function CL(t){return function(){return t}}function NL(t){return function(e){return t(e)+""}}function Al(t,e){var n=D2.lastIndex=$2.lastIndex=0,r,o,i,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=D2.exec(t))&&(o=$2.exec(e));)(i=o.index)>n&&(i=e.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,c.push({i:s,x:Qt(r,o)})),n=$2.lastIndex;return n<e.length&&(i=e.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?c[0]?NL(c[0].x):CL(e):(e=c.length,function(f){for(var u=0,p;u<e;++u)a[(p=c[u]).i]=p.x(f);return a.join("")})}function Wn(t,e){var n=typeof e,r;return e==null||n==="boolean"?$c(e):(n==="number"?Qt:n==="string"?(r=Xn(e))?(e=r,ur):Al:e instanceof Xn?ur:e instanceof Date?TM:AM(e)?SM:Array.isArray(e)?EM:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?IM:Qt)(t,e)}function ua(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var CM=180/Math.PI,x0={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function F2(t,e,n,r,o,i){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*CM,skewX:Math.atan(c)*CM,scaleX:s,scaleY:a}}var b0;function NM(t){let e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?x0:F2(e.a,e.b,e.c,e.d,e.e,e.f)}function kM(t){return t==null?x0:(b0||(b0=document.createElementNS("http://www.w3.org/2000/svg","g")),b0.setAttribute("transform",t),(t=b0.transform.baseVal.consolidate())?(t=t.matrix,F2(t.a,t.b,t.c,t.d,t.e,t.f)):x0)}function RM(t,e,n,r){function o(f){return f.length?f.pop()+" ":""}function i(f,u,p,l,h,d){if(f!==p||u!==l){var m=h.push("translate(",null,e,null,n);d.push({i:m-4,x:Qt(f,p)},{i:m-2,x:Qt(u,l)})}else(p||l)&&h.push("translate("+p+e+l+n)}function s(f,u,p,l){f!==u?(f-u>180?u+=360:u-f>180&&(f+=360),l.push({i:p.push(o(p)+"rotate(",null,r)-2,x:Qt(f,u)})):u&&p.push(o(p)+"rotate("+u+r)}function a(f,u,p,l){f!==u?l.push({i:p.push(o(p)+"skewX(",null,r)-2,x:Qt(f,u)}):u&&p.push(o(p)+"skewX("+u+r)}function c(f,u,p,l,h,d){if(f!==p||u!==l){var m=h.push(o(h)+"scale(",null,",",null,")");d.push({i:m-4,x:Qt(f,p)},{i:m-2,x:Qt(u,l)})}else(p!==1||l!==1)&&h.push(o(h)+"scale("+p+","+l+")")}return function(f,u){var p=[],l=[];return f=t(f),u=t(u),i(f.translateX,f.translateY,u.translateX,u.translateY,p,l),s(f.rotate,u.rotate,p,l),a(f.skewX,u.skewX,p,l),c(f.scaleX,f.scaleY,u.scaleX,u.scaleY,p,l),f=u=null,function(h){for(var d=-1,m=l.length,g;++d<m;)p[(g=l[d]).i]=g.x(h);return p.join("")}}}var P2=RM(NM,"px, ","px)","deg)"),q2=RM(kM,", ",")",")");var kL=1e-12;function LM(t){return((t=Math.exp(t))+1/t)/2}function RL(t){return((t=Math.exp(t))-1/t)/2}function LL(t){return((t=Math.exp(2*t))-1)/(t+1)}var B2=function t(e,n,r){function o(i,s){var a=i[0],c=i[1],f=i[2],u=s[0],p=s[1],l=s[2],h=u-a,d=p-c,m=h*h+d*d,g,y;if(m<kL)y=Math.log(l/f)/e,g=function(A){return[a+A*h,c+A*d,f*Math.exp(e*A*y)]};else{var x=Math.sqrt(m),b=(l*l-f*f+r*m)/(2*f*n*x),w=(l*l-f*f-r*m)/(2*l*n*x),_=Math.log(Math.sqrt(b*b+1)-b),v=Math.log(Math.sqrt(w*w+1)-w);y=(v-_)/e,g=function(A){var E=A*y,T=LM(_),C=f/(n*x)*(T*LL(e*E+_)-RL(_));return[a+C*h,c+C*d,f*T/LM(e*E+_)]}}return g.duration=y*1e3*e/Math.SQRT2,g}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return t(s,a,c)},o}(Math.SQRT2,2,4);function OM(t){return function(e,n){var r=t((e=_l(e)).h,(n=_l(n)).h),o=Kt(e.s,n.s),i=Kt(e.l,n.l),s=Kt(e.opacity,n.opacity);return function(a){return e.h=r(a),e.s=o(a),e.l=i(a),e.opacity=s(a),e+""}}}var z2=OM(Dc),OL=OM(Kt);function w0(t,e){var n=Kt((t=Oc(t)).l,(e=Oc(e)).l),r=Kt(t.a,e.a),o=Kt(t.b,e.b),i=Kt(t.opacity,e.opacity);return function(s){return t.l=n(s),t.a=r(s),t.b=o(s),t.opacity=i(s),t+""}}function $M(t){return function(e,n){var r=t((e=Ml(e)).h,(n=Ml(n)).h),o=Kt(e.c,n.c),i=Kt(e.l,n.l),s=Kt(e.opacity,n.opacity);return function(a){return e.h=r(a),e.c=o(a),e.l=i(a),e.opacity=s(a),e+""}}}var Y2=$M(Dc),$L=$M(Kt);function DM(t){return function e(n){n=+n;function r(o,i){var s=t((o=Mn(o)).h,(i=Mn(i)).h),a=Kt(o.s,i.s),c=Kt(o.l,i.l),f=Kt(o.opacity,i.opacity);return function(u){return o.h=s(u),o.s=a(u),o.l=c(Math.pow(u,n)),o.opacity=f(u),o+""}}return r.gamma=e,r}(1)}var DL=DM(Dc),Fc=DM(Kt);function no(t,e){e===void 0&&(e=t,t=Wn);for(var n=0,r=e.length-1,o=e[0],i=new Array(r<0?0:r);n<r;)i[n]=t(o,o=e[++n]);return function(s){var a=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return i[a](s-a)}}function sn(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}var Pc=0,Tl=0,El=0,PM=1e3,v0,Il,_0=0,la=0,M0=0,Cl=typeof performance=="object"&&performance.now?performance:Date,qM=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function kl(){return la||(qM(FL),la=Cl.now()+M0)}function FL(){la=0}function Nl(){this._call=this._time=this._next=null}Nl.prototype=S0.prototype={constructor:Nl,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?kl():+n)+(e==null?0:+e),!this._next&&Il!==this&&(Il?Il._next=this:v0=this,Il=this),this._call=t,this._time=n,U2()},stop:function(){this._call&&(this._call=null,this._time=1/0,U2())}};function S0(t,e,n){var r=new Nl;return r.restart(t,e,n),r}function BM(){kl(),++Pc;for(var t=v0,e;t;)(e=la-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Pc}function FM(){la=(_0=Cl.now())+M0,Pc=Tl=0;try{BM()}finally{Pc=0,qL(),la=0}}function PL(){var t=Cl.now(),e=t-_0;e>PM&&(M0-=e,_0=t)}function qL(){for(var t,e=v0,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:v0=n);Il=t,U2(r)}function U2(t){if(!Pc){Tl&&(Tl=clearTimeout(Tl));var e=t-la;e>24?(t<1/0&&(Tl=setTimeout(FM,t-Cl.now()-M0)),El&&(El=clearInterval(El))):(El||(_0=Cl.now(),El=setInterval(PL,PM)),Pc=1,qM(FM))}}function A0(t,e,n){var r=new Nl;return e=e==null?0:+e,r.restart(o=>{r.stop(),t(o+e)},e,n),r}var BL=oa("start","end","cancel","interrupt"),zL=[],UM=0,zM=1,T0=2,E0=3,YM=4,I0=5,Rl=6;function Hi(t,e,n,r,o,i){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;YL(t,n,{name:e,index:r,group:o,on:BL,tween:zL,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:UM})}function Ll(t,e){var n=Te(t,e);if(n.state>UM)throw new Error("too late; already scheduled");return n}function He(t,e){var n=Te(t,e);if(n.state>E0)throw new Error("too late; already running");return n}function Te(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function YL(t,e,n){var r=t.__transition,o;r[e]=n,n.timer=S0(i,0,n.time);function i(f){n.state=zM,n.timer.restart(s,n.delay,n.time),n.delay<=f&&s(f-n.delay)}function s(f){var u,p,l,h;if(n.state!==zM)return c();for(u in r)if(h=r[u],h.name===n.name){if(h.state===E0)return A0(s);h.state===YM?(h.state=Rl,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete r[u]):+u<e&&(h.state=Rl,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete r[u])}if(A0(function(){n.state===E0&&(n.state=YM,n.timer.restart(a,n.delay,n.time),a(f))}),n.state=T0,n.on.call("start",t,t.__data__,n.index,n.group),n.state===T0){for(n.state=E0,o=new Array(l=n.tween.length),u=0,p=-1;u<l;++u)(h=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(o[++p]=h);o.length=p+1}}function a(f){for(var u=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=I0,1),p=-1,l=o.length;++p<l;)o[p].call(t,u);n.state===I0&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=Rl,n.timer.stop(),delete r[e];for(var f in r)return;delete t.__transition}}function ro(t,e){var n=t.__transition,r,o,i=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){i=!1;continue}o=r.state>T0&&r.state<I0,r.state=Rl,r.timer.stop(),r.on.call(o?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}i&&delete t.__transition}}function jM(t){return this.each(function(){ro(this,t)})}function UL(t,e){var n,r;return function(){var o=He(this,t),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function jL(t,e,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=He(this,t),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:e,value:n},c=0,f=o.length;c<f;++c)if(o[c].name===e){o[c]=a;break}c===f&&o.push(a)}i.tween=o}}function XM(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Te(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===t)return s.value;return null}return this.each((e==null?UL:jL)(n,t,e))}function qc(t,e,n){var r=t._id;return t.each(function(){var o=He(this,r);(o.value||(o.value={}))[e]=n.apply(this,arguments)}),function(o){return Te(o,r).value[e]}}function C0(t,e){var n;return(typeof e=="number"?Qt:e instanceof Xn?ur:(n=Xn(e))?(e=n,ur):Al)(t,e)}function XL(t){return function(){this.removeAttribute(t)}}function WL(t){return function(){this.removeAttributeNS(t.space,t.local)}}function GL(t,e,n){var r,o=n+"",i;return function(){var s=this.getAttribute(t);return s===o?null:s===r?i:i=e(r=s,n)}}function VL(t,e,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===r?i:i=e(r=s,n)}}function HL(t,e,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=e(r=s,a)))}}function QL(t,e,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=e(r=s,a)))}}function WM(t,e){var n=Zo(t),r=n==="transform"?q2:C0;return this.attrTween(t,typeof e=="function"?(n.local?QL:HL)(n,r,qc(this,"attr."+t,e)):e==null?(n.local?WL:XL)(n):(n.local?VL:GL)(n,r,e))}function ZL(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function KL(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function JL(t,e){var n,r;function o(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&KL(t,i)),n}return o._value=e,o}function tO(t,e){var n,r;function o(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&ZL(t,i)),n}return o._value=e,o}function GM(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Zo(t);return this.tween(n,(r.local?JL:tO)(r,e))}function eO(t,e){return function(){Ll(this,t).delay=+e.apply(this,arguments)}}function nO(t,e){return e=+e,function(){Ll(this,t).delay=e}}function VM(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?eO:nO)(e,t)):Te(this.node(),e).delay}function rO(t,e){return function(){He(this,t).duration=+e.apply(this,arguments)}}function oO(t,e){return e=+e,function(){He(this,t).duration=e}}function HM(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?rO:oO)(e,t)):Te(this.node(),e).duration}function iO(t,e){if(typeof e!="function")throw new Error;return function(){He(this,t).ease=e}}function QM(t){var e=this._id;return arguments.length?this.each(iO(e,t)):Te(this.node(),e).ease}function sO(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;He(this,t).ease=n}}function ZM(t){if(typeof t!="function")throw new Error;return this.each(sO(this._id,t))}function KM(t){typeof t!="function"&&(t=gl(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],s=i.length,a=r[o]=[],c,f=0;f<s;++f)(c=i[f])&&t.call(c,c.__data__,f,i)&&a.push(c);return new Sn(r,this._parents,this._name,this._id)}function JM(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var c=e[a],f=n[a],u=c.length,p=s[a]=new Array(u),l,h=0;h<u;++h)(l=c[h]||f[h])&&(p[h]=l);for(;a<r;++a)s[a]=e[a];return new Sn(s,this._parents,this._name,this._id)}function aO(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function cO(t,e,n){var r,o,i=aO(e)?Ll:He;return function(){var s=i(this,t),a=s.on;a!==r&&(o=(r=a).copy()).on(e,n),s.on=o}}function t8(t,e){var n=this._id;return arguments.length<2?Te(this.node(),n).on.on(t):this.each(cO(n,t,e))}function fO(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function e8(){return this.on("end.remove",fO(this._id))}function n8(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ia(t));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],c=a.length,f=i[s]=new Array(c),u,p,l=0;l<c;++l)(u=a[l])&&(p=t.call(u,u.__data__,l,a))&&("__data__"in u&&(p.__data__=u.__data__),f[l]=p,Hi(f[l],e,n,l,f,Te(u,n)));return new Sn(i,this._parents,e,n)}function r8(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ml(t));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var c=r[a],f=c.length,u,p=0;p<f;++p)if(u=c[p]){for(var l=t.call(u,u.__data__,p,c),h,d=Te(u,n),m=0,g=l.length;m<g;++m)(h=l[m])&&Hi(h,e,n,m,l,d);i.push(l),s.push(u)}return new Sn(i,s,e,n)}var uO=Jo.prototype.constructor;function o8(){return new uO(this._groups,this._parents)}function lO(t,e){var n,r,o;return function(){var i=Wi(this,t),s=(this.style.removeProperty(t),Wi(this,t));return i===s?null:i===n&&s===r?o:o=e(n=i,r=s)}}function i8(t){return function(){this.style.removeProperty(t)}}function pO(t,e,n){var r,o=n+"",i;return function(){var s=Wi(this,t);return s===o?null:s===r?i:i=e(r=s,n)}}function hO(t,e,n){var r,o,i;return function(){var s=Wi(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),Wi(this,t))),s===c?null:s===r&&c===o?i:(o=c,i=e(r=s,a))}}function dO(t,e){var n,r,o,i="style."+e,s="end."+i,a;return function(){var c=He(this,t),f=c.on,u=c.value[i]==null?a||(a=i8(e)):void 0;(f!==n||o!==u)&&(r=(n=f).copy()).on(s,o=u),c.on=r}}function s8(t,e,n){var r=(t+="")=="transform"?P2:C0;return e==null?this.styleTween(t,lO(t,r)).on("end.style."+t,i8(t)):typeof e=="function"?this.styleTween(t,hO(t,r,qc(this,"style."+t,e))).each(dO(this._id,t)):this.styleTween(t,pO(t,r,e),n).on("end.style."+t,null)}function mO(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function gO(t,e,n){var r,o;function i(){var s=e.apply(this,arguments);return s!==o&&(r=(o=s)&&mO(t,s,n)),r}return i._value=e,i}function a8(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,gO(t,e,n??""))}function yO(t){return function(){this.textContent=t}}function xO(t){return function(){var e=t(this);this.textContent=e??""}}function c8(t){return this.tween("text",typeof t=="function"?xO(qc(this,"text",t)):yO(t==null?"":t+""))}function bO(t){return function(e){this.textContent=t.call(this,e)}}function wO(t){var e,n;function r(){var o=t.apply(this,arguments);return o!==n&&(e=(n=o)&&bO(o)),e}return r._value=t,r}function f8(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,wO(t))}function u8(){for(var t=this._name,e=this._id,n=N0(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,f=0;f<a;++f)if(c=s[f]){var u=Te(c,e);Hi(c,t,n,f,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Sn(r,this._parents,t,n)}function l8(){var t,e,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},c={value:function(){--o===0&&i()}};n.each(function(){var f=He(this,r),u=f.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),f.on=e}),o===0&&i()})}var vO=0;function Sn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function p8(t){return Jo().transition(t)}function N0(){return++vO}var ni=Jo.prototype;Sn.prototype=p8.prototype={constructor:Sn,select:n8,selectAll:r8,selectChild:ni.selectChild,selectChildren:ni.selectChildren,filter:KM,merge:JM,selection:o8,transition:u8,call:ni.call,nodes:ni.nodes,node:ni.node,size:ni.size,empty:ni.empty,each:ni.each,on:t8,attr:WM,attrTween:GM,style:s8,styleTween:a8,text:c8,textTween:f8,remove:e8,tween:XM,delay:VM,duration:HM,ease:QM,easeVarying:ZM,end:l8,[Symbol.iterator]:ni[Symbol.iterator]};function k0(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var _O={time:null,delay:0,duration:250,ease:k0};function MO(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function h8(t){var e,n;t instanceof Sn?(e=t._id,t=t._name):(e=N0(),(n=_O).time=kl(),t=t==null?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,f=0;f<a;++f)(c=s[f])&&Hi(c,t,e,f,s,n||MO(c,e));return new Sn(r,this._parents,t,e)}Jo.prototype.interrupt=jM;Jo.prototype.transition=h8;var R0=t=>()=>t;function j2(t,{sourceEvent:e,target:n,selection:r,mode:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function d8(t){t.stopImmediatePropagation()}function L0(t){t.preventDefault(),t.stopImmediatePropagation()}var m8={name:"drag"},X2={name:"space"},Bc={name:"handle"},zc={name:"center"},{abs:g8,max:an,min:cn}=Math;function y8(t){return[+t[0],+t[1]]}function G2(t){return[y8(t[0]),y8(t[1])]}var O0={name:"x",handles:["w","e"].map(Ol),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},$0={name:"y",handles:["n","s"].map(Ol),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},SO={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ol),input:function(t){return t==null?null:G2(t)},output:function(t){return t}},ri={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},x8={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},b8={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},AO={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},EO={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ol(t){return{type:t}}function TO(t){return!t.ctrlKey&&!t.button}function IO(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function CO(){return navigator.maxTouchPoints||"ontouchstart"in this}function W2(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function NO(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function V2(){return Z2(O0)}function H2(){return Z2($0)}function Q2(){return Z2(SO)}function Z2(t){var e=IO,n=TO,r=CO,o=!0,i=oa("start","brush","end"),s=6,a;function c(g){var y=g.property("__brush",m).selectAll(".overlay").data([Ol("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",ri.overlay).merge(y).each(function(){var b=W2(this).extent;At(this).attr("x",b[0][0]).attr("y",b[0][1]).attr("width",b[1][0]-b[0][0]).attr("height",b[1][1]-b[0][1])}),g.selectAll(".selection").data([Ol("selection")]).enter().append("rect").attr("class","selection").attr("cursor",ri.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var x=g.selectAll(".handle").data(t.handles,function(b){return b.type});x.exit().remove(),x.enter().append("rect").attr("class",function(b){return"handle handle--"+b.type}).attr("cursor",function(b){return ri[b.type]}),g.each(f).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",l).filter(r).on("touchstart.brush",l).on("touchmove.brush",h).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(g,y,x){g.tween?g.on("start.brush",function(b){u(this,arguments).beforestart().start(b)}).on("interrupt.brush end.brush",function(b){u(this,arguments).end(b)}).tween("brush",function(){var b=this,w=b.__brush,_=u(b,arguments),v=w.selection,A=t.input(typeof y=="function"?y.apply(this,arguments):y,w.extent),E=Wn(v,A);function T(C){w.selection=C===1&&A===null?null:E(C),f.call(b),_.brush()}return v!==null&&A!==null?T:T(1)}):g.each(function(){var b=this,w=arguments,_=b.__brush,v=t.input(typeof y=="function"?y.apply(b,w):y,_.extent),A=u(b,w).beforestart();ro(b),_.selection=v===null?null:v,f.call(b),A.start(x).brush(x).end(x)})},c.clear=function(g,y){c.move(g,null,y)};function f(){var g=At(this),y=W2(this).selection;y?(g.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),g.selectAll(".handle").style("display",null).attr("x",function(x){return x.type[x.type.length-1]==="e"?y[1][0]-s/2:y[0][0]-s/2}).attr("y",function(x){return x.type[0]==="s"?y[1][1]-s/2:y[0][1]-s/2}).attr("width",function(x){return x.type==="n"||x.type==="s"?y[1][0]-y[0][0]+s:s}).attr("height",function(x){return x.type==="e"||x.type==="w"?y[1][1]-y[0][1]+s:s})):g.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(g,y,x){var b=g.__brush.emitter;return b&&(!x||!b.clean)?b:new p(g,y,x)}function p(g,y,x){this.that=g,this.args=y,this.state=g.__brush,this.active=0,this.clean=x}p.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(g,y){return this.starting?(this.starting=!1,this.emit("start",g,y)):this.emit("brush",g),this},brush:function(g,y){return this.emit("brush",g,y),this},end:function(g,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",g,y)),this},emit:function(g,y,x){var b=At(this.that).datum();i.call(g,this.that,new j2(g,{sourceEvent:y,target:c,selection:t.output(this.state.selection),mode:x,dispatch:i}),b)}};function l(g){if(a&&!g.touches||!n.apply(this,arguments))return;var y=this,x=g.target.__data__.type,b=(o&&g.metaKey?x="overlay":x)==="selection"?m8:o&&g.altKey?zc:Bc,w=t===$0?null:AO[x],_=t===O0?null:EO[x],v=W2(y),A=v.extent,E=v.selection,T=A[0][0],C,S,k=A[0][1],L,M,I=A[1][0],N,R,$=A[1][1],O,D,F=0,P=0,W,K=w&&_&&o&&g.shiftKey,tt,nt,U=Array.from(g.touches||[g],Q=>{let qt=Q.identifier;return Q=on(Q,y),Q.point0=Q.slice(),Q.identifier=qt,Q});ro(y);var et=u(y,arguments,!0).beforestart();if(x==="overlay"){E&&(W=!0);let Q=[U[0],U[1]||U[0]];v.selection=E=[[C=t===$0?T:cn(Q[0][0],Q[1][0]),L=t===O0?k:cn(Q[0][1],Q[1][1])],[N=t===$0?I:an(Q[0][0],Q[1][0]),O=t===O0?$:an(Q[0][1],Q[1][1])]],U.length>1&&bt(g)}else C=E[0][0],L=E[0][1],N=E[1][0],O=E[1][1];S=C,M=L,R=N,D=O;var z=At(y).attr("pointer-events","none"),G=z.selectAll(".overlay").attr("cursor",ri[x]);if(g.touches)et.moved=q,et.ended=st;else{var J=At(g.view).on("mousemove.brush",q,!0).on("mouseup.brush",st,!0);o&&J.on("keydown.brush",Et,!0).on("keyup.brush",Ct,!0),xl(g.view)}f.call(y),et.start(g,b.name);function q(Q){for(let qt of Q.changedTouches||[Q])for(let Bn of U)Bn.identifier===qt.identifier&&(Bn.cur=on(qt,y));if(K&&!tt&&!nt&&U.length===1){let qt=U[0];g8(qt.cur[0]-qt[0])>g8(qt.cur[1]-qt[1])?nt=!0:tt=!0}for(let qt of U)qt.cur&&(qt[0]=qt.cur[0],qt[1]=qt.cur[1]);W=!0,L0(Q),bt(Q)}function bt(Q){let qt=U[0],Bn=qt.point0;var Yr;switch(F=qt[0]-Bn[0],P=qt[1]-Bn[1],b){case X2:case m8:{w&&(F=an(T-C,cn(I-N,F)),S=C+F,R=N+F),_&&(P=an(k-L,cn($-O,P)),M=L+P,D=O+P);break}case Bc:{U[1]?(w&&(S=an(T,cn(I,U[0][0])),R=an(T,cn(I,U[1][0])),w=1),_&&(M=an(k,cn($,U[0][1])),D=an(k,cn($,U[1][1])),_=1)):(w<0?(F=an(T-C,cn(I-C,F)),S=C+F,R=N):w>0&&(F=an(T-N,cn(I-N,F)),S=C,R=N+F),_<0?(P=an(k-L,cn($-L,P)),M=L+P,D=O):_>0&&(P=an(k-O,cn($-O,P)),M=L,D=O+P));break}case zc:{w&&(S=an(T,cn(I,C-F*w)),R=an(T,cn(I,N+F*w))),_&&(M=an(k,cn($,L-P*_)),D=an(k,cn($,O+P*_)));break}}R<S&&(w*=-1,Yr=C,C=N,N=Yr,Yr=S,S=R,R=Yr,x in x8&&G.attr("cursor",ri[x=x8[x]])),D<M&&(_*=-1,Yr=L,L=O,O=Yr,Yr=M,M=D,D=Yr,x in b8&&G.attr("cursor",ri[x=b8[x]])),v.selection&&(E=v.selection),tt&&(S=E[0][0],R=E[1][0]),nt&&(M=E[0][1],D=E[1][1]),(E[0][0]!==S||E[0][1]!==M||E[1][0]!==R||E[1][1]!==D)&&(v.selection=[[S,M],[R,D]],f.call(y),et.brush(Q,b.name))}function st(Q){if(d8(Q),Q.touches){if(Q.touches.length)return;a&&clearTimeout(a),a=setTimeout(function(){a=null},500)}else bl(Q.view,W),J.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);z.attr("pointer-events","all"),G.attr("cursor",ri.overlay),v.selection&&(E=v.selection),NO(E)&&(v.selection=null,f.call(y)),et.end(Q,b.name)}function Et(Q){switch(Q.keyCode){case 16:{K=w&&_;break}case 18:{b===Bc&&(w&&(N=R-F*w,C=S+F*w),_&&(O=D-P*_,L=M+P*_),b=zc,bt(Q));break}case 32:{(b===Bc||b===zc)&&(w<0?N=R-F:w>0&&(C=S-F),_<0?O=D-P:_>0&&(L=M-P),b=X2,G.attr("cursor",ri.selection),bt(Q));break}default:return}L0(Q)}function Ct(Q){switch(Q.keyCode){case 16:{K&&(tt=nt=K=!1,bt(Q));break}case 18:{b===zc&&(w<0?N=R:w>0&&(C=S),_<0?O=D:_>0&&(L=M),b=Bc,bt(Q));break}case 32:{b===X2&&(Q.altKey?(w&&(N=R-F*w,C=S+F*w),_&&(O=D-P*_,L=M+P*_),b=zc):(w<0?N=R:w>0&&(C=S),_<0?O=D:_>0&&(L=M),b=Bc),G.attr("cursor",ri[x]),bt(Q));break}default:return}L0(Q)}}function h(g){u(this,arguments).moved(g)}function d(g){u(this,arguments).ended(g)}function m(){var g=this.__brush||{selection:null};return g.extent=G2(e.apply(this,arguments)),g.dim=t,g}return c.extent=function(g){return arguments.length?(e=typeof g=="function"?g:R0(G2(g)),c):e},c.filter=function(g){return arguments.length?(n=typeof g=="function"?g:R0(!!g),c):n},c.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:R0(!!g),c):r},c.handleSize=function(g){return arguments.length?(s=+g,c):s},c.keyModifiers=function(g){return arguments.length?(o=!!g,c):o},c.on=function(){var g=i.on.apply(i,arguments);return g===i?c:g},c}var K2=Math.PI,J2=2*K2,pa=1e-6,kO=J2-pa;function w8(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function RO(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return w8;let n=10**e;return function(r){this._+=r[0];for(let o=1,i=r.length;o<i;++o)this._+=Math.round(arguments[o]*n)/n+r[o]}}var Qi=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?w8:RO(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,o){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+o}`}bezierCurveTo(e,n,r,o,i,s){this._append`C${+e},${+n},${+r},${+o},${this._x1=+i},${this._y1=+s}`}arcTo(e,n,r,o,i){if(e=+e,n=+n,r=+r,o=+o,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,a=this._y1,c=r-e,f=o-n,u=s-e,p=a-n,l=u*u+p*p;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(l>pa)if(!(Math.abs(p*c-f*u)>pa)||!i)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-s,d=o-a,m=c*c+f*f,g=h*h+d*d,y=Math.sqrt(m),x=Math.sqrt(l),b=i*Math.tan((K2-Math.acos((m+l-g)/(2*y*x)))/2),w=b/x,_=b/y;Math.abs(w-1)>pa&&this._append`L${e+w*u},${n+w*p}`,this._append`A${i},${i},0,0,${+(p*h>u*d)},${this._x1=e+_*c},${this._y1=n+_*f}`}}arc(e,n,r,o,i,s){if(e=+e,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(o),c=r*Math.sin(o),f=e+a,u=n+c,p=1^s,l=s?o-i:i-o;this._x1===null?this._append`M${f},${u}`:(Math.abs(this._x1-f)>pa||Math.abs(this._y1-u)>pa)&&this._append`L${f},${u}`,r&&(l<0&&(l=l%J2+J2),l>kO?this._append`A${r},${r},0,1,${p},${e-a},${n-c}A${r},${r},0,1,${p},${this._x1=f},${this._y1=u}`:l>pa&&this._append`A${r},${r},0,${+(l>=K2)},${p},${this._x1=e+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(e,n,r,o){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+o}h${-r}Z`}toString(){return this._}};function v8(){return new Qi}v8.prototype=Qi.prototype;function An(t=3){return new Qi(+t)}var LO=Array.prototype,D0=LO.slice;function _8(t,e){return t-e}function M8(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}var oo=t=>()=>t;function S8(t,e){for(var n=-1,r=e.length,o;++n<r;)if(o=OO(t,e[n]))return o;return 0}function OO(t,e){for(var n=e[0],r=e[1],o=-1,i=0,s=t.length,a=s-1;i<s;a=i++){var c=t[i],f=c[0],u=c[1],p=t[a],l=p[0],h=p[1];if($O(c,p,e))return 0;u>r!=h>r&&n<(l-f)*(r-u)/(h-u)+f&&(o=-o)}return o}function $O(t,e,n){var r;return DO(t,e,n)&&FO(t[r=+(t[0]===e[0])],n[r],e[r])}function DO(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function FO(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function A8(){}var oi=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Zi(){var t=1,e=1,n=ji,r=c;function o(f){var u=n(f);if(Array.isArray(u))u=u.slice().sort(_8);else{let p=Ot(f,PO);for(u=Ge(...Cc(p[0],p[1],u),u);u[u.length-1]>=p[1];)u.pop();for(;u[1]<p[0];)u.shift()}return u.map(p=>i(f,p))}function i(f,u){let p=u==null?NaN:+u;if(isNaN(p))throw new Error(`invalid value: ${u}`);var l=[],h=[];return s(f,p,function(d){r(d,f,p),M8(d)>0?l.push([d]):h.push(d)}),h.forEach(function(d){for(var m=0,g=l.length,y;m<g;++m)if(S8((y=l[m])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:u,coordinates:l}}function s(f,u,p){var l=new Array,h=new Array,d,m,g,y,x,b;for(d=m=-1,y=ha(f[0],u),oi[y<<1].forEach(w);++d<t-1;)g=y,y=ha(f[d+1],u),oi[g|y<<1].forEach(w);for(oi[y<<0].forEach(w);++m<e-1;){for(d=-1,y=ha(f[m*t+t],u),x=ha(f[m*t],u),oi[y<<1|x<<2].forEach(w);++d<t-1;)g=y,y=ha(f[m*t+t+d+1],u),b=x,x=ha(f[m*t+d+1],u),oi[g|y<<1|x<<2|b<<3].forEach(w);oi[y|x<<3].forEach(w)}for(d=-1,x=f[m*t]>=u,oi[x<<2].forEach(w);++d<t-1;)b=x,x=ha(f[m*t+d+1],u),oi[x<<2|b<<3].forEach(w);oi[x<<3].forEach(w);function w(_){var v=[_[0][0]+d,_[0][1]+m],A=[_[1][0]+d,_[1][1]+m],E=a(v),T=a(A),C,S;(C=h[E])?(S=l[T])?(delete h[C.end],delete l[S.start],C===S?(C.ring.push(A),p(C.ring)):l[C.start]=h[S.end]={start:C.start,end:S.end,ring:C.ring.concat(S.ring)}):(delete h[C.end],C.ring.push(A),h[C.end=T]=C):(C=l[T])?(S=h[E])?(delete l[C.start],delete h[S.end],C===S?(C.ring.push(A),p(C.ring)):l[S.start]=h[C.end]={start:S.start,end:C.end,ring:S.ring.concat(C.ring)}):(delete l[C.start],C.ring.unshift(v),l[C.start=E]=C):l[E]=h[T]={start:E,end:T,ring:[v,A]}}}function a(f){return f[0]*2+f[1]*(t+1)*4}function c(f,u,p){f.forEach(function(l){var h=l[0],d=l[1],m=h|0,g=d|0,y=tw(u[g*t+m]);h>0&&h<t&&m===h&&(l[0]=E8(h,tw(u[g*t+m-1]),y,p)),d>0&&d<e&&g===d&&(l[1]=E8(d,tw(u[(g-1)*t+m]),y,p))})}return o.contour=i,o.size=function(f){if(!arguments.length)return[t,e];var u=Math.floor(f[0]),p=Math.floor(f[1]);if(!(u>=0&&p>=0))throw new Error("invalid size");return t=u,e=p,o},o.thresholds=function(f){return arguments.length?(n=typeof f=="function"?f:Array.isArray(f)?oo(D0.call(f)):oo(f),o):n},o.smooth=function(f){return arguments.length?(r=f?c:A8,o):r===c},o}function PO(t){return isFinite(t)?t:NaN}function ha(t,e){return t==null?!1:+t>=e}function tw(t){return t==null||isNaN(t=+t)?-1/0:t}function E8(t,e,n,r){let o=r-e,i=n-e,s=isFinite(o)||isFinite(i)?o/i:Math.sign(o)/Math.sign(i);return isNaN(s)?t:t+s-.5}function qO(t){return t[0]}function BO(t){return t[1]}function zO(){return 1}function ew(){var t=qO,e=BO,n=zO,r=960,o=500,i=20,s=2,a=i*3,c=r+a*2>>s,f=o+a*2>>s,u=oo(20);function p(x){var b=new Float32Array(c*f),w=Math.pow(2,-s),_=-1;for(let L of x){var v=(t(L,++_,x)+a)*w,A=(e(L,_,x)+a)*w,E=+n(L,_,x);if(E&&v>=0&&v<c&&A>=0&&A<f){var T=Math.floor(v),C=Math.floor(A),S=v-T-.5,k=A-C-.5;b[T+C*c]+=(1-S)*(1-k)*E,b[T+1+C*c]+=S*(1-k)*E,b[T+1+(C+1)*c]+=S*k*E,b[T+(C+1)*c]+=(1-S)*k*E}}return fl({data:b,width:c,height:f},i*w),b}function l(x){var b=p(x),w=u(b),_=Math.pow(2,2*s);return Array.isArray(w)||(w=Ge(Number.MIN_VALUE,It(b)/_,w)),Zi().size([c,f]).thresholds(w.map(v=>v*_))(b).map((v,A)=>(v.value=+w[A],h(v)))}l.contours=function(x){var b=p(x),w=Zi().size([c,f]),_=Math.pow(2,2*s),v=A=>{A=+A;var E=h(w.contour(b,A*_));return E.value=A,E};return Object.defineProperty(v,"max",{get:()=>It(b)/_}),v};function h(x){return x.coordinates.forEach(d),x}function d(x){x.forEach(m)}function m(x){x.forEach(g)}function g(x){x[0]=x[0]*Math.pow(2,s)-a,x[1]=x[1]*Math.pow(2,s)-a}function y(){return a=i*3,c=r+a*2>>s,f=o+a*2>>s,l}return l.x=function(x){return arguments.length?(t=typeof x=="function"?x:oo(+x),l):t},l.y=function(x){return arguments.length?(e=typeof x=="function"?x:oo(+x),l):e},l.weight=function(x){return arguments.length?(n=typeof x=="function"?x:oo(+x),l):n},l.size=function(x){if(!arguments.length)return[r,o];var b=+x[0],w=+x[1];if(!(b>=0&&w>=0))throw new Error("invalid size");return r=b,o=w,y()},l.cellSize=function(x){if(!arguments.length)return 1<<s;if(!((x=+x)>=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(x)/Math.LN2),y()},l.thresholds=function(x){return arguments.length?(u=typeof x=="function"?x:Array.isArray(x)?oo(D0.call(x)):oo(x),l):u},l.bandwidth=function(x){if(!arguments.length)return Math.sqrt(i*(i+1));if(!((x=+x)>=0))throw new Error("invalid bandwidth");return i=(Math.sqrt(4*x*x+1)-1)/2,y()},l}var kt=11102230246251565e-32,ye=134217729,$l=(3+8*kt)*kt;function da(t,e,n,r,o){let i,s,a,c,f=e[0],u=r[0],p=0,l=0;u>f==u>-f?(i=f,f=e[++p]):(i=u,u=r[++l]);let h=0;if(p<t&&l<n)for(u>f==u>-f?(s=f+i,a=i-(s-f),f=e[++p]):(s=u+i,a=i-(s-u),u=r[++l]),i=s,a!==0&&(o[h++]=a);p<t&&l<n;)u>f==u>-f?(s=i+f,c=s-i,a=i-(s-c)+(f-c),f=e[++p]):(s=i+u,c=s-i,a=i-(s-c)+(u-c),u=r[++l]),i=s,a!==0&&(o[h++]=a);for(;p<t;)s=i+f,c=s-i,a=i-(s-c)+(f-c),f=e[++p],i=s,a!==0&&(o[h++]=a);for(;l<n;)s=i+u,c=s-i,a=i-(s-c)+(u-c),u=r[++l],i=s,a!==0&&(o[h++]=a);return(i!==0||h===0)&&(o[h++]=i),h}function Dl(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function Y(t){return new Float64Array(t)}var YO=(3+16*kt)*kt,UO=(2+12*kt)*kt,jO=(9+64*kt)*kt*kt,Yc=Y(4),T8=Y(8),I8=Y(12),C8=Y(16),En=Y(4);function XO(t,e,n,r,o,i,s){let a,c,f,u,p,l,h,d,m,g,y,x,b,w,_,v,A,E,T=t-o,C=n-o,S=e-i,k=r-i;w=T*k,l=ye*T,h=l-(l-T),d=T-h,l=ye*k,m=l-(l-k),g=k-m,_=d*g-(w-h*m-d*m-h*g),v=S*C,l=ye*S,h=l-(l-S),d=S-h,l=ye*C,m=l-(l-C),g=C-m,A=d*g-(v-h*m-d*m-h*g),y=_-A,p=_-y,Yc[0]=_-(y+p)+(p-A),x=w+y,p=x-w,b=w-(x-p)+(y-p),y=b-v,p=b-y,Yc[1]=b-(y+p)+(p-v),E=x+y,p=E-x,Yc[2]=x-(E-p)+(y-p),Yc[3]=E;let L=Dl(4,Yc),M=UO*s;if(L>=M||-L>=M||(p=t-T,a=t-(T+p)+(p-o),p=n-C,f=n-(C+p)+(p-o),p=e-S,c=e-(S+p)+(p-i),p=r-k,u=r-(k+p)+(p-i),a===0&&c===0&&f===0&&u===0)||(M=jO*s+$l*Math.abs(L),L+=T*u+k*a-(S*f+C*c),L>=M||-L>=M))return L;w=a*k,l=ye*a,h=l-(l-a),d=a-h,l=ye*k,m=l-(l-k),g=k-m,_=d*g-(w-h*m-d*m-h*g),v=c*C,l=ye*c,h=l-(l-c),d=c-h,l=ye*C,m=l-(l-C),g=C-m,A=d*g-(v-h*m-d*m-h*g),y=_-A,p=_-y,En[0]=_-(y+p)+(p-A),x=w+y,p=x-w,b=w-(x-p)+(y-p),y=b-v,p=b-y,En[1]=b-(y+p)+(p-v),E=x+y,p=E-x,En[2]=x-(E-p)+(y-p),En[3]=E;let I=da(4,Yc,4,En,T8);w=T*u,l=ye*T,h=l-(l-T),d=T-h,l=ye*u,m=l-(l-u),g=u-m,_=d*g-(w-h*m-d*m-h*g),v=S*f,l=ye*S,h=l-(l-S),d=S-h,l=ye*f,m=l-(l-f),g=f-m,A=d*g-(v-h*m-d*m-h*g),y=_-A,p=_-y,En[0]=_-(y+p)+(p-A),x=w+y,p=x-w,b=w-(x-p)+(y-p),y=b-v,p=b-y,En[1]=b-(y+p)+(p-v),E=x+y,p=E-x,En[2]=x-(E-p)+(y-p),En[3]=E;let N=da(I,T8,4,En,I8);w=a*u,l=ye*a,h=l-(l-a),d=a-h,l=ye*u,m=l-(l-u),g=u-m,_=d*g-(w-h*m-d*m-h*g),v=c*f,l=ye*c,h=l-(l-c),d=c-h,l=ye*f,m=l-(l-f),g=f-m,A=d*g-(v-h*m-d*m-h*g),y=_-A,p=_-y,En[0]=_-(y+p)+(p-A),x=w+y,p=x-w,b=w-(x-p)+(y-p),y=b-v,p=b-y,En[1]=b-(y+p)+(p-v),E=x+y,p=E-x,En[2]=x-(E-p)+(y-p),En[3]=E;let R=da(N,I8,4,En,C8);return C8[R-1]}function Uc(t,e,n,r,o,i){let s=(e-i)*(n-o),a=(t-o)*(r-i),c=s-a,f=Math.abs(s+a);return Math.abs(c)>=YO*f?c:-XO(t,e,n,r,o,i,f)}var fht=(7+56*kt)*kt,uht=(3+28*kt)*kt,lht=(26+288*kt)*kt*kt,pht=Y(4),hht=Y(4),dht=Y(4),mht=Y(4),ght=Y(4),yht=Y(4),xht=Y(4),bht=Y(4),wht=Y(4),vht=Y(8),_ht=Y(8),Mht=Y(8),Sht=Y(4),Aht=Y(8),Eht=Y(8),Tht=Y(8),Iht=Y(12),Cht=Y(192),Nht=Y(192);var Lht=(10+96*kt)*kt,Oht=(4+48*kt)*kt,$ht=(44+576*kt)*kt*kt,Dht=Y(4),Fht=Y(4),Pht=Y(4),qht=Y(4),Bht=Y(4),zht=Y(4),Yht=Y(4),Uht=Y(4),jht=Y(8),Xht=Y(8),Wht=Y(8),Ght=Y(8),Vht=Y(8),Hht=Y(8),Qht=Y(8),Zht=Y(8),Kht=Y(8),Jht=Y(4),tdt=Y(4),edt=Y(4),ndt=Y(8),rdt=Y(16),odt=Y(16),idt=Y(16),sdt=Y(32),adt=Y(32),cdt=Y(48),fdt=Y(64),udt=Y(1152),ldt=Y(1152);var mdt=(16+224*kt)*kt,gdt=(5+72*kt)*kt,ydt=(71+1408*kt)*kt*kt,xdt=Y(4),bdt=Y(4),wdt=Y(4),vdt=Y(4),_dt=Y(4),Mdt=Y(4),Sdt=Y(4),Adt=Y(4),Edt=Y(4),Tdt=Y(4),Idt=Y(24),Cdt=Y(24),Ndt=Y(24),kdt=Y(24),Rdt=Y(24),Ldt=Y(24),Odt=Y(24),$dt=Y(24),Ddt=Y(24),Fdt=Y(24),Pdt=Y(1152),qdt=Y(1152),Bdt=Y(1152),zdt=Y(1152),Ydt=Y(1152),Udt=Y(2304),jdt=Y(2304),Xdt=Y(3456),Wdt=Y(5760),Gdt=Y(8),Vdt=Y(8),Hdt=Y(8),Qdt=Y(16),Zdt=Y(24),Kdt=Y(48),Jdt=Y(48),tmt=Y(96),emt=Y(192),nmt=Y(384),rmt=Y(384),omt=Y(384),imt=Y(768);var smt=Y(96),amt=Y(96),cmt=Y(96),fmt=Y(1152);var k8=Math.pow(2,-52),F0=new Uint32Array(512),Xc=class t{static from(e,n=ZO,r=KO){let o=e.length,i=new Float64Array(o*2);for(let s=0;s<o;s++){let a=e[s];i[2*s]=n(a),i[2*s+1]=r(a)}return new t(i)}constructor(e){let n=e.length>>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;let r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){let{coords:e,_hullPrev:n,_hullNext:r,_hullTri:o,_hullHash:i}=this,s=e.length>>1,a=1/0,c=1/0,f=-1/0,u=-1/0;for(let T=0;T<s;T++){let C=e[2*T],S=e[2*T+1];C<a&&(a=C),S<c&&(c=S),C>f&&(f=C),S>u&&(u=S),this._ids[T]=T}let p=(a+f)/2,l=(c+u)/2,h,d,m;for(let T=0,C=1/0;T<s;T++){let S=nw(p,l,e[2*T],e[2*T+1]);S<C&&(h=T,C=S)}let g=e[2*h],y=e[2*h+1];for(let T=0,C=1/0;T<s;T++){if(T===h)continue;let S=nw(g,y,e[2*T],e[2*T+1]);S<C&&S>0&&(d=T,C=S)}let x=e[2*d],b=e[2*d+1],w=1/0;for(let T=0;T<s;T++){if(T===h||T===d)continue;let C=HO(g,y,x,b,e[2*T],e[2*T+1]);C<w&&(m=T,w=C)}let _=e[2*m],v=e[2*m+1];if(w===1/0){for(let S=0;S<s;S++)this._dists[S]=e[2*S]-e[0]||e[2*S+1]-e[1];jc(this._ids,this._dists,0,s-1);let T=new Uint32Array(s),C=0;for(let S=0,k=-1/0;S<s;S++){let L=this._ids[S],M=this._dists[L];M>k&&(T[C++]=L,k=M)}this.hull=T.subarray(0,C),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Uc(g,y,x,b,_,v)<0){let T=d,C=x,S=b;d=m,x=_,b=v,m=T,_=C,v=S}let A=QO(g,y,x,b,_,v);this._cx=A.x,this._cy=A.y;for(let T=0;T<s;T++)this._dists[T]=nw(e[2*T],e[2*T+1],A.x,A.y);jc(this._ids,this._dists,0,s-1),this._hullStart=h;let E=3;r[h]=n[m]=d,r[d]=n[h]=m,r[m]=n[d]=h,o[h]=0,o[d]=1,o[m]=2,i.fill(-1),i[this._hashKey(g,y)]=h,i[this._hashKey(x,b)]=d,i[this._hashKey(_,v)]=m,this.trianglesLen=0,this._addTriangle(h,d,m,-1,-1,-1);for(let T=0,C,S;T<this._ids.length;T++){let k=this._ids[T],L=e[2*k],M=e[2*k+1];if(T>0&&Math.abs(L-C)<=k8&&Math.abs(M-S)<=k8||(C=L,S=M,k===h||k===d||k===m))continue;let I=0;for(let D=0,F=this._hashKey(L,M);D<this._hashSize&&(I=i[(F+D)%this._hashSize],!(I!==-1&&I!==r[I]));D++);I=n[I];let N=I,R;for(;R=r[N],Uc(L,M,e[2*N],e[2*N+1],e[2*R],e[2*R+1])>=0;)if(N=R,N===I){N=-1;break}if(N===-1)continue;let $=this._addTriangle(N,k,r[N],-1,-1,o[N]);o[k]=this._legalize($+2),o[N]=$,E++;let O=r[N];for(;R=r[O],Uc(L,M,e[2*O],e[2*O+1],e[2*R],e[2*R+1])<0;)$=this._addTriangle(O,k,R,o[k],-1,o[O]),o[k]=this._legalize($+2),r[O]=O,E--,O=R;if(N===I)for(;R=n[N],Uc(L,M,e[2*R],e[2*R+1],e[2*N],e[2*N+1])<0;)$=this._addTriangle(R,k,N,-1,o[N],o[R]),this._legalize($+2),o[R]=$,r[N]=N,E--,N=R;this._hullStart=n[k]=N,r[N]=n[O]=k,r[k]=O,i[this._hashKey(L,M)]=k,i[this._hashKey(e[2*N],e[2*N+1])]=N}this.hull=new Uint32Array(E);for(let T=0,C=this._hullStart;T<E;T++)this.hull[T]=C,C=r[C];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,n){return Math.floor(GO(e-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(e){let{_triangles:n,_halfedges:r,coords:o}=this,i=0,s=0;for(;;){let a=r[e],c=e-e%3;if(s=c+(e+2)%3,a===-1){if(i===0)break;e=F0[--i];continue}let f=a-a%3,u=c+(e+1)%3,p=f+(a+2)%3,l=n[s],h=n[e],d=n[u],m=n[p];if(VO(o[2*l],o[2*l+1],o[2*h],o[2*h+1],o[2*d],o[2*d+1],o[2*m],o[2*m+1])){n[e]=m,n[a]=l;let y=r[p];if(y===-1){let b=this._hullStart;do{if(this._hullTri[b]===p){this._hullTri[b]=e;break}b=this._hullPrev[b]}while(b!==this._hullStart)}this._link(e,y),this._link(a,r[s]),this._link(s,p);let x=f+(a+1)%3;i<F0.length&&(F0[i++]=x)}else{if(i===0)break;e=F0[--i]}}return s}_link(e,n){this._halfedges[e]=n,n!==-1&&(this._halfedges[n]=e)}_addTriangle(e,n,r,o,i,s){let a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=n,this._triangles[a+2]=r,this._link(a,o),this._link(a+1,i),this._link(a+2,s),this.trianglesLen+=3,a}};function GO(t,e){let n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}function nw(t,e,n,r){let o=t-n,i=e-r;return o*o+i*i}function VO(t,e,n,r,o,i,s,a){let c=t-s,f=e-a,u=n-s,p=r-a,l=o-s,h=i-a,d=c*c+f*f,m=u*u+p*p,g=l*l+h*h;return c*(p*g-m*h)-f*(u*g-m*l)+d*(u*h-p*l)<0}function HO(t,e,n,r,o,i){let s=n-t,a=r-e,c=o-t,f=i-e,u=s*s+a*a,p=c*c+f*f,l=.5/(s*f-a*c),h=(f*u-a*p)*l,d=(s*p-c*u)*l;return h*h+d*d}function QO(t,e,n,r,o,i){let s=n-t,a=r-e,c=o-t,f=i-e,u=s*s+a*a,p=c*c+f*f,l=.5/(s*f-a*c),h=t+(f*u-a*p)*l,d=e+(s*p-c*u)*l;return{x:h,y:d}}function jc(t,e,n,r){if(r-n<=20)for(let o=n+1;o<=r;o++){let i=t[o],s=e[i],a=o-1;for(;a>=n&&e[t[a]]>s;)t[a+1]=t[a--];t[a+1]=i}else{let o=n+r>>1,i=n+1,s=r;Fl(t,o,i),e[t[n]]>e[t[r]]&&Fl(t,n,r),e[t[i]]>e[t[r]]&&Fl(t,i,r),e[t[n]]>e[t[i]]&&Fl(t,n,i);let a=t[i],c=e[a];for(;;){do i++;while(e[t[i]]<c);do s--;while(e[t[s]]>c);if(s<i)break;Fl(t,i,s)}t[n+1]=t[s],t[s]=a,r-i+1>=s-n?(jc(t,e,i,r),jc(t,e,n,s-1)):(jc(t,e,n,s-1),jc(t,e,i,r))}}function Fl(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}function ZO(t){return t[0]}function KO(t){return t[1]}var lr=class{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;let o=e+r,i=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${o},${i}`:(Math.abs(this._x1-o)>1e-6||Math.abs(this._y1-i)>1e-6)&&(this._+="L"+o+","+i),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=o},${this._y1=i}`)}rect(e,n,r,o){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+o}h${-r}Z`}value(){return this._||null}};var Ki=class{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}};var Pl=class{constructor(e,[n,r,o,i]=[0,0,960,500]){if(!((o=+o)>=(n=+n))||!((i=+i)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=o,this.xmin=n,this.ymax=i,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let{delaunay:{points:e,hull:n,triangles:r},vectors:o}=this,i,s,a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let m=0,g=0,y=r.length,x,b;m<y;m+=3,g+=2){let w=r[m]*2,_=r[m+1]*2,v=r[m+2]*2,A=e[w],E=e[w+1],T=e[_],C=e[_+1],S=e[v],k=e[v+1],L=T-A,M=C-E,I=S-A,N=k-E,R=(L*N-M*I)*2;if(Math.abs(R)<1e-9){if(i===void 0){i=s=0;for(let O of n)i+=e[O*2],s+=e[O*2+1];i/=n.length,s/=n.length}let $=1e9*Math.sign((i-A)*N-(s-E)*I);x=(A+S)/2-$*N,b=(E+k)/2+$*I}else{let $=1/R,O=L*L+M*M,D=I*I+N*N;x=A+(N*O-M*D)*$,b=E+(L*D-I*O)*$}a[g]=x,a[g+1]=b}let c=n[n.length-1],f,u=c*4,p,l=e[2*c],h,d=e[2*c+1];o.fill(0);for(let m=0;m<n.length;++m)c=n[m],f=u,p=l,h=d,u=c*4,l=e[2*c],d=e[2*c+1],o[f+2]=o[u]=h-d,o[f+3]=o[u+1]=l-p}render(e){let n=e==null?e=new lr:void 0,{delaunay:{halfedges:r,inedges:o,hull:i},circumcenters:s,vectors:a}=this;if(i.length<=1)return null;for(let u=0,p=r.length;u<p;++u){let l=r[u];if(l<u)continue;let h=Math.floor(u/3)*2,d=Math.floor(l/3)*2,m=s[h],g=s[h+1],y=s[d],x=s[d+1];this._renderSegment(m,g,y,x,e)}let c,f=i[i.length-1];for(let u=0;u<i.length;++u){c=f,f=i[u];let p=Math.floor(o[f]/3)*2,l=s[p],h=s[p+1],d=c*4,m=this._project(l,h,a[d+2],a[d+3]);m&&this._renderSegment(l,h,m[0],m[1],e)}return n&&n.value()}renderBounds(e){let n=e==null?e=new lr:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(e,n){let r=n==null?n=new lr:void 0,o=this._clip(e);if(o===null||!o.length)return;n.moveTo(o[0],o[1]);let i=o.length;for(;o[0]===o[i-2]&&o[1]===o[i-1]&&i>1;)i-=2;for(let s=2;s<i;s+=2)(o[s]!==o[s-2]||o[s+1]!==o[s-1])&&n.lineTo(o[s],o[s+1]);return n.closePath(),r&&r.value()}*cellPolygons(){let{delaunay:{points:e}}=this;for(let n=0,r=e.length/2;n<r;++n){let o=this.cellPolygon(n);o&&(o.index=n,yield o)}}cellPolygon(e){let n=new Ki;return this.renderCell(e,n),n.value()}_renderSegment(e,n,r,o,i){let s,a=this._regioncode(e,n),c=this._regioncode(r,o);a===0&&c===0?(i.moveTo(e,n),i.lineTo(r,o)):(s=this._clipSegment(e,n,r,o,a,c))&&(i.moveTo(s[0],s[1]),i.lineTo(s[2],s[3]))}contains(e,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(e,n,r)===e}*neighbors(e){let n=this._clip(e);if(n)for(let r of this.delaunay.neighbors(e)){let o=this._clip(r);if(o){t:for(let i=0,s=n.length;i<s;i+=2)for(let a=0,c=o.length;a<c;a+=2)if(n[i]===o[a]&&n[i+1]===o[a+1]&&n[(i+2)%s]===o[(a+c-2)%c]&&n[(i+3)%s]===o[(a+c-1)%c]){yield r;break t}}}}_cell(e){let{circumcenters:n,delaunay:{inedges:r,halfedges:o,triangles:i}}=this,s=r[e];if(s===-1)return null;let a=[],c=s;do{let f=Math.floor(c/3);if(a.push(n[f*2],n[f*2+1]),c=c%3===2?c-2:c+1,i[c]!==e)break;c=o[c]}while(c!==s&&c!==-1);return a}_clip(e){if(e===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];let n=this._cell(e);if(n===null)return null;let{vectors:r}=this,o=e*4;return this._simplify(r[o]||r[o+1]?this._clipInfinite(e,n,r[o],r[o+1],r[o+2],r[o+3]):this._clipFinite(e,n))}_clipFinite(e,n){let r=n.length,o=null,i,s,a=n[r-2],c=n[r-1],f,u=this._regioncode(a,c),p,l=0;for(let h=0;h<r;h+=2)if(i=a,s=c,a=n[h],c=n[h+1],f=u,u=this._regioncode(a,c),f===0&&u===0)p=l,l=0,o?o.push(a,c):o=[a,c];else{let d,m,g,y,x;if(f===0){if((d=this._clipSegment(i,s,a,c,f,u))===null)continue;[m,g,y,x]=d}else{if((d=this._clipSegment(a,c,i,s,u,f))===null)continue;[y,x,m,g]=d,p=l,l=this._edgecode(m,g),p&&l&&this._edge(e,p,l,o,o.length),o?o.push(m,g):o=[m,g]}p=l,l=this._edgecode(y,x),p&&l&&this._edge(e,p,l,o,o.length),o?o.push(y,x):o=[y,x]}if(o)p=l,l=this._edgecode(o[0],o[1]),p&&l&&this._edge(e,p,l,o,o.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return o}_clipSegment(e,n,r,o,i,s){let a=i<s;for(a&&([e,n,r,o,i,s]=[r,o,e,n,s,i]);;){if(i===0&&s===0)return a?[r,o,e,n]:[e,n,r,o];if(i&s)return null;let c,f,u=i||s;u&8?(c=e+(r-e)*(this.ymax-n)/(o-n),f=this.ymax):u&4?(c=e+(r-e)*(this.ymin-n)/(o-n),f=this.ymin):u&2?(f=n+(o-n)*(this.xmax-e)/(r-e),c=this.xmax):(f=n+(o-n)*(this.xmin-e)/(r-e),c=this.xmin),i?(e=c,n=f,i=this._regioncode(e,n)):(r=c,o=f,s=this._regioncode(r,o))}}_clipInfinite(e,n,r,o,i,s){let a=Array.from(n),c;if((c=this._project(a[0],a[1],r,o))&&a.unshift(c[0],c[1]),(c=this._project(a[a.length-2],a[a.length-1],i,s))&&a.push(c[0],c[1]),a=this._clipFinite(e,a))for(let f=0,u=a.length,p,l=this._edgecode(a[u-2],a[u-1]);f<u;f+=2)p=l,l=this._edgecode(a[f],a[f+1]),p&&l&&(f=this._edge(e,p,l,a,f),u=a.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(e,n,r,o,i){for(;n!==r;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(o[i]!==s||o[i+1]!==a)&&this.contains(e,s,a)&&(o.splice(i,0,s,a),i+=2)}return i}_project(e,n,r,o){let i=1/0,s,a,c;if(o<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/o)<i&&(c=this.ymin,a=e+(i=s)*r)}else if(o>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/o)<i&&(c=this.ymax,a=e+(i=s)*r)}if(r>0){if(e>=this.xmax)return null;(s=(this.xmax-e)/r)<i&&(a=this.xmax,c=n+(i=s)*o)}else if(r<0){if(e<=this.xmin)return null;(s=(this.xmin-e)/r)<i&&(a=this.xmin,c=n+(i=s)*o)}return[a,c]}_edgecode(e,n){return(e===this.xmin?1:e===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(e,n){return(e<this.xmin?1:e>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n<e.length;n+=2){let r=(n+2)%e.length,o=(n+4)%e.length;(e[n]===e[r]&&e[r]===e[o]||e[n+1]===e[r+1]&&e[r+1]===e[o+1])&&(e.splice(r,2),n-=2)}e.length||(e=null)}return e}};var JO=2*Math.PI,Wc=Math.pow;function t$(t){return t[0]}function e$(t){return t[1]}function n$(t){let{triangles:e,coords:n}=t;for(let r=0;r<e.length;r+=3){let o=2*e[r],i=2*e[r+1],s=2*e[r+2];if((n[s]-n[o])*(n[i+1]-n[o+1])-(n[i]-n[o])*(n[s+1]-n[o+1])>1e-10)return!1}return!0}function r$(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}var pr=class t{static from(e,n=t$,r=e$,o){return new t("length"in e?o$(e,n,r,o):Float64Array.from(i$(e,n,r,o)))}constructor(e){this._delaunator=new Xc(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){let e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&n$(e)){this.collinear=Int32Array.from({length:n.length/2},(l,h)=>h).sort((l,h)=>n[2*l]-n[2*h]||n[2*l+1]-n[2*h+1]);let c=this.collinear[0],f=this.collinear[this.collinear.length-1],u=[n[2*c],n[2*c+1],n[2*f],n[2*f+1]],p=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let l=0,h=n.length/2;l<h;++l){let d=r$(n[2*l],n[2*l+1],p);n[2*l]=d[0],n[2*l+1]=d[1]}this._delaunator=new Xc(n)}else delete this.collinear;let r=this.halfedges=this._delaunator.halfedges,o=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let c=0,f=r.length;c<f;++c){let u=i[c%3===2?c-2:c+1];(r[c]===-1||s[u]===-1)&&(s[u]=c)}for(let c=0,f=o.length;c<f;++c)a[o[c]]=c;o.length<=2&&o.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=o[0],s[o[0]]=1,o.length===2&&(s[o[1]]=0,this.triangles[1]=o[1],this.triangles[2]=o[1]))}voronoi(e){return new Pl(this,e)}*neighbors(e){let{inedges:n,hull:r,_hullIndex:o,halfedges:i,triangles:s,collinear:a}=this;if(a){let p=a.indexOf(e);p>0&&(yield a[p-1]),p<a.length-1&&(yield a[p+1]);return}let c=n[e];if(c===-1)return;let f=c,u=-1;do{if(yield u=s[f],f=f%3===2?f-2:f+1,s[f]!==e)return;if(f=i[f],f===-1){let p=r[(o[e]+1)%r.length];p!==u&&(yield p);return}}while(f!==c)}find(e,n,r=0){if(e=+e,e!==e||(n=+n,n!==n))return-1;let o=r,i;for(;(i=this._step(r,e,n))>=0&&i!==r&&i!==o;)r=i;return i}_step(e,n,r){let{inedges:o,hull:i,_hullIndex:s,halfedges:a,triangles:c,points:f}=this;if(o[e]===-1||!f.length)return(e+1)%(f.length>>1);let u=e,p=Wc(n-f[e*2],2)+Wc(r-f[e*2+1],2),l=o[e],h=l;do{let d=c[h],m=Wc(n-f[d*2],2)+Wc(r-f[d*2+1],2);if(m<p&&(p=m,u=d),h=h%3===2?h-2:h+1,c[h]!==e)break;if(h=a[h],h===-1){if(h=i[(s[e]+1)%i.length],h!==d&&Wc(n-f[h*2],2)+Wc(r-f[h*2+1],2)<p)return h;break}}while(h!==l);return u}render(e){let n=e==null?e=new lr:void 0,{points:r,halfedges:o,triangles:i}=this;for(let s=0,a=o.length;s<a;++s){let c=o[s];if(c<s)continue;let f=i[s]*2,u=i[c]*2;e.moveTo(r[f],r[f+1]),e.lineTo(r[u],r[u+1])}return this.renderHull(e),n&&n.value()}renderPoints(e,n){n===void 0&&(!e||typeof e.moveTo!="function")&&(n=e,e=null),n=n==null?2:+n;let r=e==null?e=new lr:void 0,{points:o}=this;for(let i=0,s=o.length;i<s;i+=2){let a=o[i],c=o[i+1];e.moveTo(a+n,c),e.arc(a,c,n,0,JO)}return r&&r.value()}renderHull(e){let n=e==null?e=new lr:void 0,{hull:r,points:o}=this,i=r[0]*2,s=r.length;e.moveTo(o[i],o[i+1]);for(let a=1;a<s;++a){let c=2*r[a];e.lineTo(o[c],o[c+1])}return e.closePath(),n&&n.value()}hullPolygon(){let e=new Ki;return this.renderHull(e),e.value()}renderTriangle(e,n){let r=n==null?n=new lr:void 0,{points:o,triangles:i}=this,s=i[e*=3]*2,a=i[e+1]*2,c=i[e+2]*2;return n.moveTo(o[s],o[s+1]),n.lineTo(o[a],o[a+1]),n.lineTo(o[c],o[c+1]),n.closePath(),r&&r.value()}*trianglePolygons(){let{triangles:e}=this;for(let n=0,r=e.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(e){let n=new Ki;return this.renderTriangle(e,n),n.value()}};function o$(t,e,n,r){let o=t.length,i=new Float64Array(o*2);for(let s=0;s<o;++s){let a=t[s];i[s*2]=e.call(r,a,s,t),i[s*2+1]=n.call(r,a,s,t)}return i}function*i$(t,e,n,r){let o=0;for(let i of t)yield e.call(r,i,o,t),yield n.call(r,i,o,t),++o}function R8(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ma(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function io(t){return t=ma(Math.abs(t)),t?t[1]:NaN}function L8(t,e){return function(n,r){for(var o=n.length,i=[],s=0,a=t[0],c=0;o>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),i.push(n.substring(o-=a,o+a)),!((c+=a+1)>r));)a=t[s=(s+1)%t.length];return i.reverse().join(e)}}function O8(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var s$=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function so(t){if(!(e=s$.exec(t)))throw new Error("invalid format: "+t);var e;return new P0({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}so.prototype=P0.prototype;function P0(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+""}P0.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 $8(t){t:for(var e=t.length,n=1,r=-1,o;n<e;++n)switch(t[n]){case".":r=o=n;break;case"0":r===0&&(r=n),o=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(o+1):t}var rw;function D8(t,e){var n=ma(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(rw=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,s=r.length;return i===s?r:i>s?r+new Array(i-s+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+ma(t,Math.max(0,e+i-1))[0]}function ow(t,e){var n=ma(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}var iw={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:R8,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ow(t*100,e),r:ow,s:D8,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function sw(t){return t}var F8=Array.prototype.map,P8=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function q8(t){var e=t.grouping===void 0||t.thousands===void 0?sw:L8(F8.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",o=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?sw:O8(F8.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"\u2212":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function f(p){p=so(p);var l=p.fill,h=p.align,d=p.sign,m=p.symbol,g=p.zero,y=p.width,x=p.comma,b=p.precision,w=p.trim,_=p.type;_==="n"?(x=!0,_="g"):iw[_]||(b===void 0&&(b=12),w=!0,_="g"),(g||l==="0"&&h==="=")&&(g=!0,l="0",h="=");var v=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",A=m==="$"?r:/[%p]/.test(_)?s:"",E=iw[_],T=/[defgprs%]/.test(_);b=b===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function C(S){var k=v,L=A,M,I,N;if(_==="c")L=E(S)+L,S="";else{S=+S;var R=S<0||1/S<0;if(S=isNaN(S)?c:E(Math.abs(S),b),w&&(S=$8(S)),R&&+S==0&&d!=="+"&&(R=!1),k=(R?d==="("?d:a:d==="-"||d==="("?"":d)+k,L=(_==="s"?P8[8+rw/3]:"")+L+(R&&d==="("?")":""),T){for(M=-1,I=S.length;++M<I;)if(N=S.charCodeAt(M),48>N||N>57){L=(N===46?o+S.slice(M+1):S.slice(M))+L,S=S.slice(0,M);break}}}x&&!g&&(S=e(S,1/0));var $=k.length+S.length+L.length,O=$<y?new Array(y-$+1).join(l):"";switch(x&&g&&(S=e(O+S,O.length?y-L.length:1/0),O=""),h){case"<":S=k+S+L+O;break;case"=":S=k+O+S+L;break;case"^":S=O.slice(0,$=O.length>>1)+k+S+L+O.slice($);break;default:S=O+k+S+L;break}return i(S)}return C.toString=function(){return p+""},C}function u(p,l){var h=f((p=so(p),p.type="f",p)),d=Math.max(-8,Math.min(8,Math.floor(io(l)/3)))*3,m=Math.pow(10,-d),g=P8[8+d/3];return function(y){return h(m*y)+g}}return{format:f,formatPrefix:u}}var q0,hr,B0;aw({thousands:",",grouping:[3],currency:["$",""]});function aw(t){return q0=q8(t),hr=q0.format,B0=q0.formatPrefix,q0}function cw(t){return Math.max(0,-io(Math.abs(t)))}function fw(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(io(e)/3)))*3-io(Math.abs(t)))}function uw(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,io(e)-io(t))+1}var Z=1e-6,ga=1e-12,mt=Math.PI,Ut=mt/2,lw=mt/4,Le=mt*2,ae=180/mt,vt=mt/180,wt=Math.abs,dr=Math.atan,xe=Math.atan2,H=Math.cos,ql=Math.ceil,z0=Math.exp;var Y0=Math.hypot,ya=Math.log,U0=Math.pow,V=Math.sin,fn=Math.sign||function(t){return t>0?1:t<0?-1:0},jt=Math.sqrt,Gc=Math.tan;function j0(t){return t>1?0:t<-1?mt:Math.acos(t)}function Zt(t){return t>1?Ut:t<-1?-Ut:Math.asin(t)}function be(){}function X0(t,e){t&&z8.hasOwnProperty(t.type)&&z8[t.type](t,e)}var B8={Feature:function(t,e){X0(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,o=n.length;++r<o;)X0(n[r].geometry,e)}},z8={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){pw(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)pw(n[r],e,0)},Polygon:function(t,e){Y8(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)Y8(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,o=n.length;++r<o;)X0(n[r],e)}};function pw(t,e,n){var r=-1,o=t.length-n,i;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function Y8(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)pw(t[n],e,1);e.polygonEnd()}function Gn(t,e){t&&B8.hasOwnProperty(t.type)?B8[t.type](t,e):X0(t,e)}function Bl(t){return[xe(t[1],t[0]),Zt(t[2])]}function ao(t){var e=t[0],n=t[1],r=H(n);return[r*H(e),r*V(e),V(n)]}function zl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Vc(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function W0(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Yl(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ul(t){var e=jt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var jl,G0,V0,H0,Q0,Z0,K0,J0,hw,dw,mw,X8,W8,Tn,In,Cn,Or={sphere:be,point:gw,lineStart:U8,lineEnd:j8,polygonStart:function(){Or.lineStart=f$,Or.lineEnd=u$},polygonEnd:function(){Or.lineStart=U8,Or.lineEnd=j8}};function gw(t,e){t*=vt,e*=vt;var n=H(e);Xl(n*H(t),n*V(t),V(e))}function Xl(t,e,n){++jl,V0+=(t-V0)/jl,H0+=(e-H0)/jl,Q0+=(n-Q0)/jl}function U8(){Or.point=a$}function a$(t,e){t*=vt,e*=vt;var n=H(e);Tn=n*H(t),In=n*V(t),Cn=V(e),Or.point=c$,Xl(Tn,In,Cn)}function c$(t,e){t*=vt,e*=vt;var n=H(e),r=n*H(t),o=n*V(t),i=V(e),s=xe(jt((s=In*i-Cn*o)*s+(s=Cn*r-Tn*i)*s+(s=Tn*o-In*r)*s),Tn*r+In*o+Cn*i);G0+=s,Z0+=s*(Tn+(Tn=r)),K0+=s*(In+(In=o)),J0+=s*(Cn+(Cn=i)),Xl(Tn,In,Cn)}function j8(){Or.point=gw}function f$(){Or.point=l$}function u$(){G8(X8,W8),Or.point=gw}function l$(t,e){X8=t,W8=e,t*=vt,e*=vt,Or.point=G8;var n=H(e);Tn=n*H(t),In=n*V(t),Cn=V(e),Xl(Tn,In,Cn)}function G8(t,e){t*=vt,e*=vt;var n=H(e),r=n*H(t),o=n*V(t),i=V(e),s=In*i-Cn*o,a=Cn*r-Tn*i,c=Tn*o-In*r,f=Y0(s,a,c),u=Zt(f),p=f&&-u/f;hw.add(p*s),dw.add(p*a),mw.add(p*c),G0+=u,Z0+=u*(Tn+(Tn=r)),K0+=u*(In+(In=o)),J0+=u*(Cn+(Cn=i)),Xl(Tn,In,Cn)}function yw(t){jl=G0=V0=H0=Q0=Z0=K0=J0=0,hw=new Xe,dw=new Xe,mw=new Xe,Gn(t,Or);var e=+hw,n=+dw,r=+mw,o=Y0(e,n,r);return o<ga&&(e=Z0,n=K0,r=J0,G0<Z&&(e=V0,n=H0,r=Q0),o=Y0(e,n,r),o<ga)?[NaN,NaN]:[xe(n,e)*ae,Zt(r/o)*ae]}function Wl(t,e){function n(r,o){return r=t(r,o),e(r[0],r[1])}return t.invert&&e.invert&&(n.invert=function(r,o){return r=e.invert(r,o),r&&t.invert(r[0],r[1])}),n}function xw(t,e){return wt(t)>mt&&(t-=Math.round(t/Le)*Le),[t,e]}xw.invert=xw;function bw(t,e,n){return(t%=Le)?e||n?Wl(H8(t),Q8(e,n)):H8(t):e||n?Q8(e,n):xw}function V8(t){return function(e,n){return e+=t,wt(e)>mt&&(e-=Math.round(e/Le)*Le),[e,n]}}function H8(t){var e=V8(t);return e.invert=V8(-t),e}function Q8(t,e){var n=H(t),r=V(t),o=H(e),i=V(e);function s(a,c){var f=H(c),u=H(a)*f,p=V(a)*f,l=V(c),h=l*n+u*r;return[xe(p*o-h*i,u*n-l*r),Zt(h*o+p*i)]}return s.invert=function(a,c){var f=H(c),u=H(a)*f,p=V(a)*f,l=V(c),h=l*o-p*i;return[xe(p*o+l*i,u*n+h*r),Zt(h*n-u*r)]},s}function Z8(t){t=bw(t[0]*vt,t[1]*vt,t.length>2?t[2]*vt:0);function e(n){return n=t(n[0]*vt,n[1]*vt),n[0]*=ae,n[1]*=ae,n}return e.invert=function(n){return n=t.invert(n[0]*vt,n[1]*vt),n[0]*=ae,n[1]*=ae,n},e}function J8(t,e,n,r,o,i){if(n){var s=H(e),a=V(e),c=r*n;o==null?(o=e+r*Le,i=e-c/2):(o=K8(s,o),i=K8(s,i),(r>0?o<i:o>i)&&(o+=r*Le));for(var f,u=o;r>0?u>i:u<i;u-=c)f=Bl([s,-a*H(u),-a*V(u)]),t.point(f[0],f[1])}}function K8(t,e){e=ao(e),e[0]-=t,Ul(e);var n=j0(-e[1]);return((-e[2]<0?-n:n)+Le-Z)%Le}function tg(){var t=[],e;return{point:function(n,r,o){e.push([n,r,o])},lineStart:function(){t.push(e=[])},lineEnd:be,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Hc(t,e){return wt(t[0]-e[0])<Z&&wt(t[1]-e[1])<Z}function eg(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function ng(t,e,n,r,o){var i=[],s=[],a,c;if(t.forEach(function(d){if(!((m=d.length-1)<=0)){var m,g=d[0],y=d[m],x;if(Hc(g,y)){if(!g[2]&&!y[2]){for(o.lineStart(),a=0;a<m;++a)o.point((g=d[a])[0],g[1]);o.lineEnd();return}y[0]+=2*Z}i.push(x=new eg(g,d,null,!0)),s.push(x.o=new eg(g,null,x,!1)),i.push(x=new eg(y,d,null,!1)),s.push(x.o=new eg(y,null,x,!0))}}),!!i.length){for(s.sort(e),tS(i),tS(s),a=0,c=s.length;a<c;++a)s[a].e=n=!n;for(var f=i[0],u,p;;){for(var l=f,h=!0;l.v;)if((l=l.n)===f)return;u=l.z,o.lineStart();do{if(l.v=l.o.v=!0,l.e){if(h)for(a=0,c=u.length;a<c;++a)o.point((p=u[a])[0],p[1]);else r(l.x,l.n.x,1,o);l=l.n}else{if(h)for(u=l.p.z,a=u.length-1;a>=0;--a)o.point((p=u[a])[0],p[1]);else r(l.x,l.p.x,-1,o);l=l.p}l=l.o,u=l.z,h=!h}while(!l.v);o.lineEnd()}}}function tS(t){if(e=t.length){for(var e,n=0,r=t[0],o;++n<e;)r.n=o=t[n],o.p=r,r=o;r.n=o=t[0],o.p=r}}function ww(t){return wt(t[0])<=mt?t[0]:fn(t[0])*((wt(t[0])+mt)%Le-mt)}function eS(t,e){var n=ww(e),r=e[1],o=V(r),i=[V(n),-H(n),0],s=0,a=0,c=new Xe;o===1?r=Ut+Z:o===-1&&(r=-Ut-Z);for(var f=0,u=t.length;f<u;++f)if(l=(p=t[f]).length)for(var p,l,h=p[l-1],d=ww(h),m=h[1]/2+lw,g=V(m),y=H(m),x=0;x<l;++x,d=w,g=v,y=A,h=b){var b=p[x],w=ww(b),_=b[1]/2+lw,v=V(_),A=H(_),E=w-d,T=E>=0?1:-1,C=T*E,S=C>mt,k=g*v;if(c.add(xe(k*T*V(C),y*A+k*H(C))),s+=S?E+T*Le:E,S^d>=n^w>=n){var L=Vc(ao(h),ao(b));Ul(L);var M=Vc(i,L);Ul(M);var I=(S^E>=0?-1:1)*Zt(M[2]);(r>I||r===I&&(L[0]||L[1]))&&(a+=S^E>=0?1:-1)}}return(s<-Z||s<Z&&c<-ga)^a&1}function rg(t,e,n,r){return function(o){var i=e(o),s=tg(),a=e(s),c=!1,f,u,p,l={point:h,lineStart:m,lineEnd:g,polygonStart:function(){l.point=y,l.lineStart=x,l.lineEnd=b,u=[],f=[]},polygonEnd:function(){l.point=h,l.lineStart=m,l.lineEnd=g,u=Nc(u);var w=eS(f,r);u.length?(c||(o.polygonStart(),c=!0),ng(u,h$,w,n,o)):w&&(c||(o.polygonStart(),c=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),c&&(o.polygonEnd(),c=!1),u=f=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function h(w,_){t(w,_)&&o.point(w,_)}function d(w,_){i.point(w,_)}function m(){l.point=d,i.lineStart()}function g(){l.point=h,i.lineEnd()}function y(w,_){p.push([w,_]),a.point(w,_)}function x(){a.lineStart(),p=[]}function b(){y(p[0][0],p[0][1]),a.lineEnd();var w=a.clean(),_=s.result(),v,A=_.length,E,T,C;if(p.pop(),f.push(p),p=null,!!A){if(w&1){if(T=_[0],(E=T.length-1)>0){for(c||(o.polygonStart(),c=!0),o.lineStart(),v=0;v<E;++v)o.point((C=T[v])[0],C[1]);o.lineEnd()}return}A>1&&w&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(p$))}}return l}}function p$(t){return t.length>1}function h$(t,e){return((t=t.x)[0]<0?t[1]-Ut-Z:Ut-t[1])-((e=e.x)[0]<0?e[1]-Ut-Z:Ut-e[1])}var vw=rg(function(){return!0},d$,g$,[-mt,-Ut]);function d$(t){var e=NaN,n=NaN,r=NaN,o;return{lineStart:function(){t.lineStart(),o=1},point:function(i,s){var a=i>0?mt:-mt,c=wt(i-e);wt(c-mt)<Z?(t.point(e,n=(n+s)/2>0?Ut:-Ut),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),t.point(i,n),o=0):r!==a&&c>=mt&&(wt(e-r)<Z&&(e-=r*Z),wt(i-a)<Z&&(i-=a*Z),n=m$(e,n,i,s),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),o=0),t.point(e=i,n=s),r=a},lineEnd:function(){t.lineEnd(),e=n=NaN},clean:function(){return 2-o}}}function m$(t,e,n,r){var o,i,s=V(t-n);return wt(s)>Z?dr((V(e)*(i=H(r))*V(n)-V(r)*(o=H(e))*V(t))/(o*i*s)):(e+r)/2}function g$(t,e,n,r){var o;if(t==null)o=n*Ut,r.point(-mt,o),r.point(0,o),r.point(mt,o),r.point(mt,0),r.point(mt,-o),r.point(0,-o),r.point(-mt,-o),r.point(-mt,0),r.point(-mt,o);else if(wt(t[0]-e[0])>Z){var i=t[0]<e[0]?mt:-mt;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(e[0],e[1])}function nS(t){var e=H(t),n=2*vt,r=e>0,o=wt(e)>Z;function i(u,p,l,h){J8(h,t,n,l,u,p)}function s(u,p){return H(u)*H(p)>e}function a(u){var p,l,h,d,m;return{lineStart:function(){d=h=!1,m=1},point:function(g,y){var x=[g,y],b,w=s(g,y),_=r?w?0:f(g,y):w?f(g+(g<0?mt:-mt),y):0;if(!p&&(d=h=w)&&u.lineStart(),w!==h&&(b=c(p,x),(!b||Hc(p,b)||Hc(x,b))&&(x[2]=1)),w!==h)m=0,w?(u.lineStart(),b=c(x,p),u.point(b[0],b[1])):(b=c(p,x),u.point(b[0],b[1],2),u.lineEnd()),p=b;else if(o&&p&&r^w){var v;!(_&l)&&(v=c(x,p,!0))&&(m=0,r?(u.lineStart(),u.point(v[0][0],v[0][1]),u.point(v[1][0],v[1][1]),u.lineEnd()):(u.point(v[1][0],v[1][1]),u.lineEnd(),u.lineStart(),u.point(v[0][0],v[0][1],3)))}w&&(!p||!Hc(p,x))&&u.point(x[0],x[1]),p=x,h=w,l=_},lineEnd:function(){h&&u.lineEnd(),p=null},clean:function(){return m|(d&&h)<<1}}}function c(u,p,l){var h=ao(u),d=ao(p),m=[1,0,0],g=Vc(h,d),y=zl(g,g),x=g[0],b=y-x*x;if(!b)return!l&&u;var w=e*y/b,_=-e*x/b,v=Vc(m,g),A=Yl(m,w),E=Yl(g,_);W0(A,E);var T=v,C=zl(A,T),S=zl(T,T),k=C*C-S*(zl(A,A)-1);if(!(k<0)){var L=jt(k),M=Yl(T,(-C-L)/S);if(W0(M,A),M=Bl(M),!l)return M;var I=u[0],N=p[0],R=u[1],$=p[1],O;N<I&&(O=I,I=N,N=O);var D=N-I,F=wt(D-mt)<Z,P=F||D<Z;if(!F&&$<R&&(O=R,R=$,$=O),P?F?R+$>0^M[1]<(wt(M[0]-I)<Z?R:$):R<=M[1]&&M[1]<=$:D>mt^(I<=M[0]&&M[0]<=N)){var W=Yl(T,(-C+L)/S);return W0(W,A),[M,Bl(W)]}}}function f(u,p){var l=r?t:mt-t,h=0;return u<-l?h|=1:u>l&&(h|=2),p<-l?h|=4:p>l&&(h|=8),h}return rg(s,a,i,r?[0,-t]:[-mt,t-mt])}function rS(t,e,n,r,o,i){var s=t[0],a=t[1],c=e[0],f=e[1],u=0,p=1,l=c-s,h=f-a,d;if(d=n-s,!(!l&&d>0)){if(d/=l,l<0){if(d<u)return;d<p&&(p=d)}else if(l>0){if(d>p)return;d>u&&(u=d)}if(d=o-s,!(!l&&d<0)){if(d/=l,l<0){if(d>p)return;d>u&&(u=d)}else if(l>0){if(d<u)return;d<p&&(p=d)}if(d=r-a,!(!h&&d>0)){if(d/=h,h<0){if(d<u)return;d<p&&(p=d)}else if(h>0){if(d>p)return;d>u&&(u=d)}if(d=i-a,!(!h&&d<0)){if(d/=h,h<0){if(d>p)return;d>u&&(u=d)}else if(h>0){if(d<u)return;d<p&&(p=d)}return u>0&&(t[0]=s+u*l,t[1]=a+u*h),p<1&&(e[0]=s+p*l,e[1]=a+p*h),!0}}}}}var Gl=1e9,og=-Gl;function Qc(t,e,n,r){function o(f,u){return t<=f&&f<=n&&e<=u&&u<=r}function i(f,u,p,l){var h=0,d=0;if(f==null||(h=s(f,p))!==(d=s(u,p))||c(f,u)<0^p>0)do l.point(h===0||h===3?t:n,h>1?r:e);while((h=(h+p+4)%4)!==d);else l.point(u[0],u[1])}function s(f,u){return wt(f[0]-t)<Z?u>0?0:3:wt(f[0]-n)<Z?u>0?2:1:wt(f[1]-e)<Z?u>0?1:0:u>0?3:2}function a(f,u){return c(f.x,u.x)}function c(f,u){var p=s(f,1),l=s(u,1);return p!==l?p-l:p===0?u[1]-f[1]:p===1?f[0]-u[0]:p===2?f[1]-u[1]:u[0]-f[0]}return function(f){var u=f,p=tg(),l,h,d,m,g,y,x,b,w,_,v,A={point:E,lineStart:k,lineEnd:L,polygonStart:C,polygonEnd:S};function E(I,N){o(I,N)&&u.point(I,N)}function T(){for(var I=0,N=0,R=h.length;N<R;++N)for(var $=h[N],O=1,D=$.length,F=$[0],P,W,K=F[0],tt=F[1];O<D;++O)P=K,W=tt,F=$[O],K=F[0],tt=F[1],W<=r?tt>r&&(K-P)*(r-W)>(tt-W)*(t-P)&&++I:tt<=r&&(K-P)*(r-W)<(tt-W)*(t-P)&&--I;return I}function C(){u=p,l=[],h=[],v=!0}function S(){var I=T(),N=v&&I,R=(l=Nc(l)).length;(N||R)&&(f.polygonStart(),N&&(f.lineStart(),i(null,null,1,f),f.lineEnd()),R&&ng(l,a,I,i,f),f.polygonEnd()),u=f,l=h=d=null}function k(){A.point=M,h&&h.push(d=[]),_=!0,w=!1,x=b=NaN}function L(){l&&(M(m,g),y&&w&&p.rejoin(),l.push(p.result())),A.point=E,w&&u.lineEnd()}function M(I,N){var R=o(I,N);if(h&&d.push([I,N]),_)m=I,g=N,y=R,_=!1,R&&(u.lineStart(),u.point(I,N));else if(R&&w)u.point(I,N);else{var $=[x=Math.max(og,Math.min(Gl,x)),b=Math.max(og,Math.min(Gl,b))],O=[I=Math.max(og,Math.min(Gl,I)),N=Math.max(og,Math.min(Gl,N))];rS($,O,t,e,n,r)?(w||(u.lineStart(),u.point($[0],$[1])),u.point(O[0],O[1]),R||u.lineEnd(),v=!1):R&&(u.lineStart(),u.point(I,N),v=!1)}x=I,b=N,w=R}return A}}function oS(t,e,n){var r=le(t,e-Z,n).concat(e);return function(o){return r.map(function(i){return[o,i]})}}function iS(t,e,n){var r=le(t,e-Z,n).concat(e);return function(o){return r.map(function(i){return[i,o]})}}function _w(){var t,e,n,r,o,i,s,a,c=10,f=c,u=90,p=360,l,h,d,m,g=2.5;function y(){return{type:"MultiLineString",coordinates:x()}}function x(){return le(ql(r/u)*u,n,u).map(d).concat(le(ql(a/p)*p,s,p).map(m)).concat(le(ql(e/c)*c,t,c).filter(function(b){return wt(b%u)>Z}).map(l)).concat(le(ql(i/f)*f,o,f).filter(function(b){return wt(b%p)>Z}).map(h))}return y.lines=function(){return x().map(function(b){return{type:"LineString",coordinates:b}})},y.outline=function(){return{type:"Polygon",coordinates:[d(r).concat(m(s).slice(1),d(n).reverse().slice(1),m(a).reverse().slice(1))]}},y.extent=function(b){return arguments.length?y.extentMajor(b).extentMinor(b):y.extentMinor()},y.extentMajor=function(b){return arguments.length?(r=+b[0][0],n=+b[1][0],a=+b[0][1],s=+b[1][1],r>n&&(b=r,r=n,n=b),a>s&&(b=a,a=s,s=b),y.precision(g)):[[r,a],[n,s]]},y.extentMinor=function(b){return arguments.length?(e=+b[0][0],t=+b[1][0],i=+b[0][1],o=+b[1][1],e>t&&(b=e,e=t,t=b),i>o&&(b=i,i=o,o=b),y.precision(g)):[[e,i],[t,o]]},y.step=function(b){return arguments.length?y.stepMajor(b).stepMinor(b):y.stepMinor()},y.stepMajor=function(b){return arguments.length?(u=+b[0],p=+b[1],y):[u,p]},y.stepMinor=function(b){return arguments.length?(c=+b[0],f=+b[1],y):[c,f]},y.precision=function(b){return arguments.length?(g=+b,l=oS(i,o,90),h=iS(e,t,g),d=oS(a,s,90),m=iS(r,n,g),y):g},y.extentMajor([[-180,-90+Z],[180,90-Z]]).extentMinor([[-180,-80-Z],[180,80+Z]])}function Mw(){return _w()()}var Vl=t=>t;var Sw=new Xe,Aw=new Xe,sS,aS,Ew,Tw,Ji={point:be,lineStart:be,lineEnd:be,polygonStart:function(){Ji.lineStart=y$,Ji.lineEnd=b$},polygonEnd:function(){Ji.lineStart=Ji.lineEnd=Ji.point=be,Sw.add(wt(Aw)),Aw=new Xe},result:function(){var t=Sw/2;return Sw=new Xe,t}};function y$(){Ji.point=x$}function x$(t,e){Ji.point=cS,sS=Ew=t,aS=Tw=e}function cS(t,e){Aw.add(Tw*t-Ew*e),Ew=t,Tw=e}function b$(){cS(sS,aS)}var Iw=Ji;var Zc=1/0,ig=Zc,Hl=-Zc,sg=Hl,w$={point:v$,lineStart:be,lineEnd:be,polygonStart:be,polygonEnd:be,result:function(){var t=[[Zc,ig],[Hl,sg]];return Hl=sg=-(ig=Zc=1/0),t}};function v$(t,e){t<Zc&&(Zc=t),t>Hl&&(Hl=t),e<ig&&(ig=e),e>sg&&(sg=e)}var Kc=w$;var Cw=0,Nw=0,Ql=0,ag=0,cg=0,Jc=0,kw=0,Rw=0,Zl=0,lS,pS,co,fo,$r={point:xa,lineStart:fS,lineEnd:uS,polygonStart:function(){$r.lineStart=S$,$r.lineEnd=A$},polygonEnd:function(){$r.point=xa,$r.lineStart=fS,$r.lineEnd=uS},result:function(){var t=Zl?[kw/Zl,Rw/Zl]:Jc?[ag/Jc,cg/Jc]:Ql?[Cw/Ql,Nw/Ql]:[NaN,NaN];return Cw=Nw=Ql=ag=cg=Jc=kw=Rw=Zl=0,t}};function xa(t,e){Cw+=t,Nw+=e,++Ql}function fS(){$r.point=_$}function _$(t,e){$r.point=M$,xa(co=t,fo=e)}function M$(t,e){var n=t-co,r=e-fo,o=jt(n*n+r*r);ag+=o*(co+t)/2,cg+=o*(fo+e)/2,Jc+=o,xa(co=t,fo=e)}function uS(){$r.point=xa}function S$(){$r.point=E$}function A$(){hS(lS,pS)}function E$(t,e){$r.point=hS,xa(lS=co=t,pS=fo=e)}function hS(t,e){var n=t-co,r=e-fo,o=jt(n*n+r*r);ag+=o*(co+t)/2,cg+=o*(fo+e)/2,Jc+=o,o=fo*t-co*e,kw+=o*(co+t),Rw+=o*(fo+e),Zl+=o*3,xa(co=t,fo=e)}var Lw=$r;function fg(t){this._context=t}fg.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,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Le);break}}},result:be};var $w=new Xe,Ow,dS,mS,Kl,Jl,ug={point:be,lineStart:function(){ug.point=T$},lineEnd:function(){Ow&&gS(dS,mS),ug.point=be},polygonStart:function(){Ow=!0},polygonEnd:function(){Ow=null},result:function(){var t=+$w;return $w=new Xe,t}};function T$(t,e){ug.point=gS,dS=Kl=t,mS=Jl=e}function gS(t,e){Kl-=t,Jl-=e,$w.add(jt(Kl*Kl+Jl*Jl)),Kl=t,Jl=e}var Dw=ug;var yS,lg,xS,bS,tf=class{constructor(e){this._append=e==null?wS:I$(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==xS||this._append!==lg){let r=this._radius,o=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`,xS=r,lg=this._append,bS=this._,this._=o}this._+=bS;break}}}result(){let e=this._;return this._="",e.length?e:null}};function wS(t){let e=1;this._+=t[0];for(let n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function I$(t){let e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return wS;if(e!==yS){let n=10**e;yS=e,lg=function(o){let i=1;this._+=o[0];for(let s=o.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return lg}function Oe(t,e){let n=3,r=4.5,o,i;function s(a){return a&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),Gn(a,o(i))),i.result()}return s.area=function(a){return Gn(a,o(Iw)),Iw.result()},s.measure=function(a){return Gn(a,o(Dw)),Dw.result()},s.bounds=function(a){return Gn(a,o(Kc)),Kc.result()},s.centroid=function(a){return Gn(a,o(Lw)),Lw.result()},s.projection=function(a){return arguments.length?(o=a==null?(t=null,Vl):(t=a).stream,s):t},s.context=function(a){return arguments.length?(i=a==null?(e=null,new tf(n)):new fg(e=a),typeof r!="function"&&i.pointRadius(r),s):e},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(i.pointRadius(+a),+a),s):r},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{let c=Math.floor(a);if(!(c>=0))throw new RangeError(`invalid digits: ${a}`);n=c}return e===null&&(i=new tf(n)),s},s.projection(t).digits(n).context(e)}function ba(t){return{stream:ef(t)}}function ef(t){return function(e){var n=new Fw;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Fw(){}Fw.prototype={constructor:Fw,point:function(t,e){this.stream.point(t,e)},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 Pw(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),Gn(n,t.stream(Kc)),e(Kc.result()),r!=null&&t.clipExtent(r),t}function tp(t,e,n){return Pw(t,function(r){var o=e[1][0]-e[0][0],i=e[1][1]-e[0][1],s=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),a=+e[0][0]+(o-s*(r[1][0]+r[0][0]))/2,c=+e[0][1]+(i-s*(r[1][1]+r[0][1]))/2;t.scale(150*s).translate([a,c])},n)}function pg(t,e,n){return tp(t,[[0,0],e],n)}function hg(t,e,n){return Pw(t,function(r){var o=+e,i=o/(r[1][0]-r[0][0]),s=(o-i*(r[1][0]+r[0][0]))/2,a=-i*r[0][1];t.scale(150*i).translate([s,a])},n)}function dg(t,e,n){return Pw(t,function(r){var o=+e,i=o/(r[1][1]-r[0][1]),s=-i*r[0][0],a=(o-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([s,a])},n)}var vS=16,C$=H(30*vt);function qw(t,e){return+e?k$(t,e):N$(t)}function N$(t){return ef({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function k$(t,e){function n(r,o,i,s,a,c,f,u,p,l,h,d,m,g){var y=f-r,x=u-o,b=y*y+x*x;if(b>4*e&&m--){var w=s+l,_=a+h,v=c+d,A=jt(w*w+_*_+v*v),E=Zt(v/=A),T=wt(wt(v)-1)<Z||wt(i-p)<Z?(i+p)/2:xe(_,w),C=t(T,E),S=C[0],k=C[1],L=S-r,M=k-o,I=x*L-y*M;(I*I/b>e||wt((y*L+x*M)/b-.5)>.3||s*l+a*h+c*d<C$)&&(n(r,o,i,s,a,c,S,k,T,w/=A,_/=A,v,m,g),g.point(S,k),n(S,k,T,w,_,v,f,u,p,l,h,d,m,g))}}return function(r){var o,i,s,a,c,f,u,p,l,h,d,m,g={point:y,lineStart:x,lineEnd:w,polygonStart:function(){r.polygonStart(),g.lineStart=_},polygonEnd:function(){r.polygonEnd(),g.lineStart=x}};function y(E,T){E=t(E,T),r.point(E[0],E[1])}function x(){p=NaN,g.point=b,r.lineStart()}function b(E,T){var C=ao([E,T]),S=t(E,T);n(p,l,u,h,d,m,p=S[0],l=S[1],u=E,h=C[0],d=C[1],m=C[2],vS,r),r.point(p,l)}function w(){g.point=y,r.lineEnd()}function _(){x(),g.point=v,g.lineEnd=A}function v(E,T){b(o=E,T),i=p,s=l,a=h,c=d,f=m,g.point=b}function A(){n(p,l,u,h,d,m,i,s,o,a,c,f,vS,r),g.lineEnd=w,w()}return g}}var R$=ef({point:function(t,e){this.stream.point(t*vt,e*vt)}});function L$(t){return ef({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}function O$(t,e,n,r,o){function i(s,a){return s*=r,a*=o,[e+t*s,n-t*a]}return i.invert=function(s,a){return[(s-e)/t*r,(n-a)/t*o]},i}function _S(t,e,n,r,o,i){if(!i)return O$(t,e,n,r,o);var s=H(i),a=V(i),c=s*t,f=a*t,u=s/t,p=a/t,l=(a*n-s*e)/t,h=(a*e+s*n)/t;function d(m,g){return m*=r,g*=o,[c*m-f*g+e,n-f*m-c*g]}return d.invert=function(m,g){return[r*(u*m-p*g+l),o*(h-p*m-u*g)]},d}function Qe(t){return Bw(function(){return t})()}function Bw(t){var e,n=150,r=480,o=250,i=0,s=0,a=0,c=0,f=0,u,p=0,l=1,h=1,d=null,m=vw,g=null,y,x,b,w=Vl,_=.5,v,A,E,T,C;function S(I){return E(I[0]*vt,I[1]*vt)}function k(I){return I=E.invert(I[0],I[1]),I&&[I[0]*ae,I[1]*ae]}S.stream=function(I){return T&&C===I?T:T=R$(L$(u)(m(v(w(C=I)))))},S.preclip=function(I){return arguments.length?(m=I,d=void 0,M()):m},S.postclip=function(I){return arguments.length?(w=I,g=y=x=b=null,M()):w},S.clipAngle=function(I){return arguments.length?(m=+I?nS(d=I*vt):(d=null,vw),M()):d*ae},S.clipExtent=function(I){return arguments.length?(w=I==null?(g=y=x=b=null,Vl):Qc(g=+I[0][0],y=+I[0][1],x=+I[1][0],b=+I[1][1]),M()):g==null?null:[[g,y],[x,b]]},S.scale=function(I){return arguments.length?(n=+I,L()):n},S.translate=function(I){return arguments.length?(r=+I[0],o=+I[1],L()):[r,o]},S.center=function(I){return arguments.length?(i=I[0]%360*vt,s=I[1]%360*vt,L()):[i*ae,s*ae]},S.rotate=function(I){return arguments.length?(a=I[0]%360*vt,c=I[1]%360*vt,f=I.length>2?I[2]%360*vt:0,L()):[a*ae,c*ae,f*ae]},S.angle=function(I){return arguments.length?(p=I%360*vt,L()):p*ae},S.reflectX=function(I){return arguments.length?(l=I?-1:1,L()):l<0},S.reflectY=function(I){return arguments.length?(h=I?-1:1,L()):h<0},S.precision=function(I){return arguments.length?(v=qw(A,_=I*I),M()):jt(_)},S.fitExtent=function(I,N){return tp(S,I,N)},S.fitSize=function(I,N){return pg(S,I,N)},S.fitWidth=function(I,N){return hg(S,I,N)},S.fitHeight=function(I,N){return dg(S,I,N)};function L(){var I=_S(n,0,0,l,h,p).apply(null,e(i,s)),N=_S(n,r-I[0],o-I[1],l,h,p);return u=bw(a,c,f),A=Wl(e,N),E=Wl(u,A),v=qw(A,_),M()}function M(){return T=C=null,S}return function(){return e=t.apply(this,arguments),S.invert=e.invert&&k,L()}}function nf(t){var e=0,n=mt/3,r=Bw(t),o=r(e,n);return o.parallels=function(i){return arguments.length?r(e=i[0]*vt,n=i[1]*vt):[e*ae,n*ae]},o}function MS(t){var e=H(t);function n(r,o){return[r*e,V(o)/e]}return n.invert=function(r,o){return[r/e,Zt(o*e)]},n}function SS(t,e){var n=V(t),r=(n+V(e))/2;if(wt(r)<Z)return MS(t);var o=1+n*(2*r-n),i=jt(o)/r;function s(a,c){var f=jt(o-2*r*V(c))/r;return[f*V(a*=r),i-f*H(a)]}return s.invert=function(a,c){var f=i-c,u=xe(a,wt(f))*fn(f);return f*r<0&&(u-=mt*fn(a)*fn(f)),[u/r,Zt((o-(a*a+f*f)*r*r)/(2*r))]},s}function ts(){return nf(SS).scale(155.424).center([0,33.6442])}function ep(){return ts().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function $$(t){var e=t.length;return{point:function(n,r){for(var o=-1;++o<e;)t[o].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function zw(){var t,e,n=ep(),r,o=ts().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,s=ts().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,c,f={point:function(l,h){c=[l,h]}};function u(l){var h=l[0],d=l[1];return c=null,r.point(h,d),c||(i.point(h,d),c)||(a.point(h,d),c)}u.invert=function(l){var h=n.scale(),d=n.translate(),m=(l[0]-d[0])/h,g=(l[1]-d[1])/h;return(g>=.12&&g<.234&&m>=-.425&&m<-.214?o:g>=.166&&g<.234&&m>=-.214&&m<-.115?s:n).invert(l)},u.stream=function(l){return t&&e===l?t:t=$$([n.stream(e=l),o.stream(l),s.stream(l)])},u.precision=function(l){return arguments.length?(n.precision(l),o.precision(l),s.precision(l),p()):n.precision()},u.scale=function(l){return arguments.length?(n.scale(l),o.scale(l*.35),s.scale(l),u.translate(n.translate())):n.scale()},u.translate=function(l){if(!arguments.length)return n.translate();var h=n.scale(),d=+l[0],m=+l[1];return r=n.translate(l).clipExtent([[d-.455*h,m-.238*h],[d+.455*h,m+.238*h]]).stream(f),i=o.translate([d-.307*h,m+.201*h]).clipExtent([[d-.425*h+Z,m+.12*h+Z],[d-.214*h-Z,m+.234*h-Z]]).stream(f),a=s.translate([d-.205*h,m+.212*h]).clipExtent([[d-.214*h+Z,m+.166*h+Z],[d-.115*h-Z,m+.234*h-Z]]).stream(f),p()},u.fitExtent=function(l,h){return tp(u,l,h)},u.fitSize=function(l,h){return pg(u,l,h)},u.fitWidth=function(l,h){return hg(u,l,h)},u.fitHeight=function(l,h){return dg(u,l,h)};function p(){return t=e=null,u}return u.scale(1070)}function mg(t){return function(e,n){var r=H(e),o=H(n),i=t(r*o);return i===1/0?[2,0]:[i*o*V(e),i*V(n)]}}function uo(t){return function(e,n){var r=jt(e*e+n*n),o=t(r),i=V(o),s=H(o);return[xe(e*i,r*s),Zt(r&&n*i/r)]}}var Yw=mg(function(t){return jt(2/(1+t))});Yw.invert=uo(function(t){return 2*Zt(t/2)});function Uw(){return Qe(Yw).scale(124.75).clipAngle(180-.001)}var jw=mg(function(t){return(t=j0(t))&&t/V(t)});jw.invert=uo(function(t){return t});function Xw(){return Qe(jw).scale(79.4188).clipAngle(180-.001)}function rf(t,e){return[t,ya(Gc((Ut+e)/2))]}rf.invert=function(t,e){return[t,2*dr(z0(e))-Ut]};function Ww(){return Gw(rf).scale(961/Le)}function Gw(t){var e=Qe(t),n=e.center,r=e.scale,o=e.translate,i=e.clipExtent,s=null,a,c,f;e.scale=function(p){return arguments.length?(r(p),u()):r()},e.translate=function(p){return arguments.length?(o(p),u()):o()},e.center=function(p){return arguments.length?(n(p),u()):n()},e.clipExtent=function(p){return arguments.length?(p==null?s=a=c=f=null:(s=+p[0][0],a=+p[0][1],c=+p[1][0],f=+p[1][1]),u()):s==null?null:[[s,a],[c,f]]};function u(){var p=mt*r(),l=e(Z8(e.rotate()).invert([0,0]));return i(s==null?[[l[0]-p,l[1]-p],[l[0]+p,l[1]+p]]:t===rf?[[Math.max(l[0]-p,s),a],[Math.min(l[0]+p,c),f]]:[[s,Math.max(l[1]-p,a)],[c,Math.min(l[1]+p,f)]])}return u()}function gg(t){return Gc((Ut+t)/2)}function AS(t,e){var n=H(t),r=t===e?V(t):ya(n/H(e))/ya(gg(e)/gg(t)),o=n*U0(gg(t),r)/r;if(!r)return rf;function i(s,a){o>0?a<-Ut+Z&&(a=-Ut+Z):a>Ut-Z&&(a=Ut-Z);var c=o/U0(gg(a),r);return[c*V(r*s),o-c*H(r*s)]}return i.invert=function(s,a){var c=o-a,f=fn(r)*jt(s*s+c*c),u=xe(s,wt(c))*fn(c);return c*r<0&&(u-=mt*fn(s)*fn(c)),[u/r,2*dr(U0(o/f,1/r))-Ut]},i}function Vw(){return nf(AS).scale(109.5).parallels([30,30])}function of(t,e){return[t,e]}of.invert=of;function Hw(){return Qe(of).scale(152.63)}function ES(t,e){var n=H(t),r=t===e?V(t):(n-H(e))/(e-t),o=n/r+t;if(wt(r)<Z)return of;function i(s,a){var c=o-a,f=r*s;return[c*V(f),o-c*H(f)]}return i.invert=function(s,a){var c=o-a,f=xe(s,wt(c))*fn(c);return c*r<0&&(f-=mt*fn(s)*fn(c)),[f/r,o-fn(r)*jt(s*s+c*c)]},i}function Qw(){return nf(ES).scale(131.154).center([0,13.9389])}var np=1.340264,rp=-.081106,op=893e-6,ip=.003796,yg=jt(3)/2,D$=12;function Zw(t,e){var n=Zt(yg*V(e)),r=n*n,o=r*r*r;return[t*H(n)/(yg*(np+3*rp*r+o*(7*op+9*ip*r))),n*(np+rp*r+o*(op+ip*r))]}Zw.invert=function(t,e){for(var n=e,r=n*n,o=r*r*r,i=0,s,a,c;i<D$&&(a=n*(np+rp*r+o*(op+ip*r))-e,c=np+3*rp*r+o*(7*op+9*ip*r),n-=s=a/c,r=n*n,o=r*r*r,!(wt(s)<ga));++i);return[yg*t*(np+3*rp*r+o*(7*op+9*ip*r))/H(n),Zt(V(n)/yg)]};function Kw(){return Qe(Zw).scale(177.158)}function Jw(t,e){var n=H(e),r=H(t)*n;return[n*V(t)/r,V(e)/r]}Jw.invert=uo(dr);function tv(){return Qe(Jw).scale(144.049).clipAngle(60)}function ev(t,e){return[H(e)*V(t),V(e)]}ev.invert=uo(Zt);function nv(){return Qe(ev).scale(249.5).clipAngle(90+Z)}function rv(t,e){var n=H(e),r=1+H(t)*n;return[n*V(t)/r,V(e)/r]}rv.invert=uo(function(t){return 2*dr(t)});function ov(){return Qe(rv).scale(250).clipAngle(142)}function iv(t,e){return[ya(Gc((Ut+e)/2)),-t]}iv.invert=function(t,e){return[-e,2*dr(z0(t))-Ut]};function sv(){var t=Gw(iv),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function F$(t,e){return t.parent===e.parent?1:2}function P$(t){return t.reduce(q$,0)/t.length}function q$(t,e){return t+e.x}function B$(t){return 1+t.reduce(z$,0)}function z$(t,e){return Math.max(t,e.y)}function Y$(t){for(var e;e=t.children;)t=e[0];return t}function U$(t){for(var e;e=t.children;)t=e[e.length-1];return t}function xg(){var t=F$,e=1,n=1,r=!1;function o(i){var s,a=0;i.eachAfter(function(l){var h=l.children;h?(l.x=P$(h),l.y=B$(h)):(l.x=s?a+=t(l,s):0,l.y=0,s=l)});var c=Y$(i),f=U$(i),u=c.x-t(c,f)/2,p=f.x+t(f,c)/2;return i.eachAfter(r?function(l){l.x=(l.x-i.x)*e,l.y=(i.y-l.y)*n}:function(l){l.x=(l.x-u)/(p-u)*e,l.y=(1-(i.y?l.y/i.y:1))*n})}return o.separation=function(i){return arguments.length?(t=i,o):t},o.size=function(i){return arguments.length?(r=!1,e=+i[0],n=+i[1],o):r?null:[e,n]},o.nodeSize=function(i){return arguments.length?(r=!0,e=+i[0],n=+i[1],o):r?[e,n]:null},o}function j$(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function TS(){return this.eachAfter(j$)}function IS(t,e){let n=-1;for(let r of this)t.call(e,r,++n,this);return this}function CS(t,e){for(var n=this,r=[n],o,i,s=-1;n=r.pop();)if(t.call(e,n,++s,this),o=n.children)for(i=o.length-1;i>=0;--i)r.push(o[i]);return this}function NS(t,e){for(var n=this,r=[n],o=[],i,s,a,c=-1;n=r.pop();)if(o.push(n),i=n.children)for(s=0,a=i.length;s<a;++s)r.push(i[s]);for(;n=o.pop();)t.call(e,n,++c,this);return this}function kS(t,e){let n=-1;for(let r of this)if(t.call(e,r,++n,this))return r}function RS(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,o=r&&r.length;--o>=0;)n+=r[o].value;e.value=n})}function LS(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function OS(t){for(var e=this,n=X$(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function X$(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),o=null;for(t=n.pop(),e=r.pop();t===e;)o=t,t=n.pop(),e=r.pop();return o}function $S(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function DS(){return Array.from(this)}function FS(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function PS(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*qS(){var t=this,e,n=[t],r,o,i;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(o=0,i=r.length;o<i;++o)n.push(r[o]);while(n.length)}function av(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=V$)):e===void 0&&(e=G$);for(var n=new es(t),r,o=[n],i,s,a,c;r=o.pop();)if((s=e(r.data))&&(c=(s=Array.from(s)).length))for(r.children=s,a=c-1;a>=0;--a)o.push(i=s[a]=new es(s[a])),i.parent=r,i.depth=r.depth+1;return n.eachBefore(cv)}function W$(){return av(this).eachBefore(H$)}function G$(t){return t.children}function V$(t){return Array.isArray(t)?t[1]:null}function H$(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function cv(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function es(t){this.data=t,this.depth=this.height=0,this.parent=null}es.prototype=av.prototype={constructor:es,count:TS,each:IS,eachAfter:NS,eachBefore:CS,find:kS,sum:RS,sort:LS,path:OS,ancestors:$S,descendants:DS,leaves:FS,links:PS,copy:W$,[Symbol.iterator]:qS};function bg(t){return t==null?null:Q$(t)}function Q$(t){if(typeof t!="function")throw new Error;return t}var Z$={depth:-1},BS={},fv={};function K$(t){return t.id}function J$(t){return t.parentId}function wg(){var t=K$,e=J$,n;function r(o){var i=Array.from(o),s=t,a=e,c,f,u,p,l,h,d,m,g=new Map;if(n!=null){let y=i.map((w,_)=>tD(n(w,_,o))),x=y.map(zS),b=new Set(y).add("");for(let w of x)b.has(w)||(b.add(w),y.push(w),x.push(zS(w)),i.push(fv));s=(w,_)=>y[_],a=(w,_)=>x[_]}for(u=0,c=i.length;u<c;++u)f=i[u],h=i[u]=new es(f),(d=s(f,u,o))!=null&&(d+="")&&(m=h.id=d,g.set(m,g.has(m)?BS:h)),(d=a(f,u,o))!=null&&(d+="")&&(h.parent=d);for(u=0;u<c;++u)if(h=i[u],d=h.parent){if(l=g.get(d),!l)throw new Error("missing: "+d);if(l===BS)throw new Error("ambiguous: "+d);l.children?l.children.push(h):l.children=[h],h.parent=l}else{if(p)throw new Error("multiple roots");p=h}if(!p)throw new Error("no root");if(n!=null){for(;p.data===fv&&p.children.length===1;)p=p.children[0],--c;for(let y=i.length-1;y>=0&&(h=i[y],h.data===fv);--y)h.data=null}if(p.parent=Z$,p.eachBefore(function(y){y.depth=y.parent.depth+1,--c}).eachBefore(cv),p.parent=null,c>0)throw new Error("cycle");return p}return r.id=function(o){return arguments.length?(t=bg(o),r):t},r.parentId=function(o){return arguments.length?(e=bg(o),r):e},r.path=function(o){return arguments.length?(n=bg(o),r):n},r}function tD(t){t=`${t}`;let e=t.length;return uv(t,e-1)&&!uv(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function zS(t){let e=t.length;if(e<2)return"";for(;--e>1&&!uv(t,e););return t.slice(0,e)}function uv(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function eD(t,e){return t.parent===e.parent?1:2}function lv(t){var e=t.children;return e?e[0]:t.t}function pv(t){var e=t.children;return e?e[e.length-1]:t.t}function nD(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function rD(t){for(var e=0,n=0,r=t.children,o=r.length,i;--o>=0;)i=r[o],i.z+=e,i.m+=e,e+=i.s+(n+=i.c)}function oD(t,e,n){return t.a.parent===e.parent?t.a:n}function vg(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}vg.prototype=Object.create(es.prototype);function iD(t){for(var e=new vg(t,0),n,r=[e],o,i,s,a;n=r.pop();)if(i=n._.children)for(n.children=new Array(a=i.length),s=a-1;s>=0;--s)r.push(o=n.children[s]=new vg(i[s],s)),o.parent=n;return(e.parent=new vg(null,0)).children=[e],e}function wa(){var t=eD,e=1,n=1,r=null;function o(f){var u=iD(f);if(u.eachAfter(i),u.parent.m=-u.z,u.eachBefore(s),r)f.eachBefore(c);else{var p=f,l=f,h=f;f.eachBefore(function(x){x.x<p.x&&(p=x),x.x>l.x&&(l=x),x.depth>h.depth&&(h=x)});var d=p===l?1:t(p,l)/2,m=d-p.x,g=e/(l.x+d+m),y=n/(h.depth||1);f.eachBefore(function(x){x.x=(x.x+m)*g,x.y=x.depth*y})}return f}function i(f){var u=f.children,p=f.parent.children,l=f.i?p[f.i-1]:null;if(u){rD(f);var h=(u[0].z+u[u.length-1].z)/2;l?(f.z=l.z+t(f._,l._),f.m=f.z-h):f.z=h}else l&&(f.z=l.z+t(f._,l._));f.parent.A=a(f,l,f.parent.A||p[0])}function s(f){f._.x=f.z+f.parent.m,f.m+=f.parent.m}function a(f,u,p){if(u){for(var l=f,h=f,d=u,m=l.parent.children[0],g=l.m,y=h.m,x=d.m,b=m.m,w;d=pv(d),l=lv(l),d&&l;)m=lv(m),h=pv(h),h.a=f,w=d.z+x-l.z-g+t(d._,l._),w>0&&(nD(oD(d,f,p),f,w),g+=w,y+=w),x+=d.m,g+=l.m,b+=m.m,y+=h.m;d&&!pv(h)&&(h.t=d,h.m+=x-y),l&&!lv(m)&&(m.t=l,m.m+=g-b,p=f)}return p}function c(f){f.x*=e,f.y=f.depth*n}return o.separation=function(f){return arguments.length?(t=f,o):t},o.size=function(f){return arguments.length?(r=!1,e=+f[0],n=+f[1],o):r?null:[e,n]},o.nodeSize=function(f){return arguments.length?(r=!0,e=+f[0],n=+f[1],o):r?[e,n]:null},o}var YS=23283064365386963e-26;function va(t=Math.random()){let e=(0<=t&&t<1?t/YS:Math.abs(t))|0;return()=>(e=1664525*e+1013904223|0,YS*(e>>>0))}function we(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function sp(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}var ap=Symbol("implicit");function _a(){var t=new bn,e=[],n=[],r=ap;function o(i){let s=t.get(i);if(s===void 0){if(r!==ap)return r;t.set(i,s=e.push(i)-1)}return n[s%n.length]}return o.domain=function(i){if(!arguments.length)return e.slice();e=[],t=new bn;for(let s of i)t.has(s)||t.set(s,e.push(s)-1);return o},o.range=function(i){return arguments.length?(n=Array.from(i),o):n.slice()},o.unknown=function(i){return arguments.length?(r=i,o):r},o.copy=function(){return _a(e,n).unknown(r)},we.apply(o,arguments),o}function ns(){var t=_a().unknown(void 0),e=t.domain,n=t.range,r=0,o=1,i,s,a=!1,c=0,f=0,u=.5;delete t.unknown;function p(){var l=e().length,h=o<r,d=h?o:r,m=h?r:o;i=(m-d)/Math.max(1,l-c+f*2),a&&(i=Math.floor(i)),d+=(m-d-i*(l-c))*u,s=i*(1-c),a&&(d=Math.round(d),s=Math.round(s));var g=le(l).map(function(y){return d+i*y});return n(h?g.reverse():g)}return t.domain=function(l){return arguments.length?(e(l),p()):e()},t.range=function(l){return arguments.length?([r,o]=l,r=+r,o=+o,p()):[r,o]},t.rangeRound=function(l){return[r,o]=l,r=+r,o=+o,a=!0,p()},t.bandwidth=function(){return s},t.step=function(){return i},t.round=function(l){return arguments.length?(a=!!l,p()):a},t.padding=function(l){return arguments.length?(c=Math.min(1,f=+l),p()):c},t.paddingInner=function(l){return arguments.length?(c=Math.min(1,l),p()):c},t.paddingOuter=function(l){return arguments.length?(f=+l,p()):f},t.align=function(l){return arguments.length?(u=Math.max(0,Math.min(1,l)),p()):u},t.copy=function(){return ns(e(),[r,o]).round(a).paddingInner(c).paddingOuter(f).align(u)},we.apply(p(),arguments)}function US(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return US(e())},t}function hv(){return US(ns.apply(null,arguments).paddingInner(1))}function dv(t){return function(){return t}}function sf(t){return+t}var jS=[0,1];function Fn(t){return t}function mv(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:dv(isNaN(e)?NaN:.5)}function sD(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function aD(t,e,n){var r=t[0],o=t[1],i=e[0],s=e[1];return o<r?(r=mv(o,r),i=n(s,i)):(r=mv(r,o),i=n(i,s)),function(a){return i(r(a))}}function cD(t,e,n){var r=Math.min(t.length,e.length)-1,o=new Array(r),i=new Array(r),s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)o[s]=mv(t[s],t[s+1]),i[s]=n(e[s],e[s+1]);return function(a){var c=Go(t,a,1,r)-1;return i[c](o[c](a))}}function lo(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Ma(){var t=jS,e=jS,n=Wn,r,o,i,s=Fn,a,c,f;function u(){var l=Math.min(t.length,e.length);return s!==Fn&&(s=sD(t[0],t[l-1])),a=l>2?cD:aD,c=f=null,p}function p(l){return l==null||isNaN(l=+l)?i:(c||(c=a(t.map(r),e,n)))(r(s(l)))}return p.invert=function(l){return s(o((f||(f=a(e,t.map(r),Qt)))(l)))},p.domain=function(l){return arguments.length?(t=Array.from(l,sf),u()):t.slice()},p.range=function(l){return arguments.length?(e=Array.from(l),u()):e.slice()},p.rangeRound=function(l){return e=Array.from(l),n=ua,u()},p.clamp=function(l){return arguments.length?(s=l?!0:Fn,u()):s!==Fn},p.interpolate=function(l){return arguments.length?(n=l,u()):n},p.unknown=function(l){return arguments.length?(i=l,p):i},function(l,h){return r=l,o=h,u()}}function cp(){return Ma()(Fn,Fn)}function gv(t,e,n,r){var o=Ic(t,e,n),i;switch(r=so(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(i=fw(o,s))&&(r.precision=i),B0(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=uw(o,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=cw(o))&&(r.precision=i-(r.type==="%")*2);break}}return hr(r)}function ii(t){var e=t.domain;return t.ticks=function(n){var r=e();return Ge(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var o=e();return gv(o[0],o[o.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),o=0,i=r.length-1,s=r[o],a=r[i],c,f,u=10;for(a<s&&(f=s,s=a,a=f,f=o,o=i,i=f);u-- >0;){if(f=Ho(s,a,n),f===c)return r[o]=s,r[i]=a,e(r);if(f>0)s=Math.floor(s/f)*f,a=Math.ceil(a/f)*f;else if(f<0)s=Math.ceil(s*f)/f,a=Math.floor(a*f)/f;else break;c=f}return t},t}function si(){var t=cp();return t.copy=function(){return lo(t,si())},we.apply(t,arguments),ii(t)}function fp(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,sf),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return fp(t).unknown(e)},t=arguments.length?Array.from(t,sf):[0,1],ii(n)}function up(t,e){t=t.slice();var n=0,r=t.length-1,o=t[n],i=t[r],s;return i<o&&(s=n,n=r,r=s,s=o,o=i,i=s),t[n]=e.floor(o),t[r]=e.ceil(i),t}function XS(t){return Math.log(t)}function WS(t){return Math.exp(t)}function fD(t){return-Math.log(-t)}function uD(t){return-Math.exp(-t)}function lD(t){return isFinite(t)?+("1e"+t):t<0?0:t}function pD(t){return t===10?lD:t===Math.E?Math.exp:e=>Math.pow(t,e)}function hD(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function GS(t){return(e,n)=>-t(-e,n)}function yv(t){let e=t(XS,WS),n=e.domain,r=10,o,i;function s(){return o=hD(r),i=pD(r),n()[0]<0?(o=GS(o),i=GS(i),t(fD,uD)):t(XS,WS),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{let c=n(),f=c[0],u=c[c.length-1],p=u<f;p&&([f,u]=[u,f]);let l=o(f),h=o(u),d,m,g=a==null?10:+a,y=[];if(!(r%1)&&h-l<g){if(l=Math.floor(l),h=Math.ceil(h),f>0){for(;l<=h;++l)for(d=1;d<r;++d)if(m=l<0?d/i(-l):d*i(l),!(m<f)){if(m>u)break;y.push(m)}}else for(;l<=h;++l)for(d=r-1;d>=1;--d)if(m=l>0?d/i(-l):d*i(l),!(m<f)){if(m>u)break;y.push(m)}y.length*2<g&&(y=Ge(f,u,g))}else y=Ge(l,h,Math.min(h-l,g)).map(i);return p?y.reverse():y},e.tickFormat=(a,c)=>{if(a==null&&(a=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=so(c)).precision==null&&(c.trim=!0),c=hr(c)),a===1/0)return c;let f=Math.max(1,r*a/e.ticks().length);return u=>{let p=u/i(Math.round(o(u)));return p*r<r-.5&&(p*=r),p<=f?c(u):""}},e.nice=()=>n(up(n(),{floor:a=>i(Math.floor(o(a))),ceil:a=>i(Math.ceil(o(a)))})),e}function lp(){let t=yv(Ma()).domain([1,10]);return t.copy=()=>lo(t,lp()).base(t.base()),we.apply(t,arguments),t}function VS(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function HS(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function xv(t){var e=1,n=t(VS(e),HS(e));return n.constant=function(r){return arguments.length?t(VS(e=+r),HS(e)):e},ii(n)}function pp(){var t=xv(Ma());return t.copy=function(){return lo(t,pp()).constant(t.constant())},we.apply(t,arguments)}function QS(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function dD(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function mD(t){return t<0?-t*t:t*t}function bv(t){var e=t(Fn,Fn),n=1;function r(){return n===1?t(Fn,Fn):n===.5?t(dD,mD):t(QS(n),QS(1/n))}return e.exponent=function(o){return arguments.length?(n=+o,r()):n},ii(e)}function hp(){var t=bv(Ma());return t.copy=function(){return lo(t,hp()).exponent(t.exponent())},we.apply(t,arguments),t}function dp(){var t=[],e=[],n=[],r;function o(){var s=0,a=Math.max(1,e.length);for(n=new Array(a-1);++s<a;)n[s-1]=x2(t,s/a);return i}function i(s){return s==null||isNaN(s=+s)?r:e[Go(n,s)]}return i.invertExtent=function(s){var a=e.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:t[0],a<n.length?n[a]:t[t.length-1]]},i.domain=function(s){if(!arguments.length)return t.slice();t=[];for(let a of s)a!=null&&!isNaN(a=+a)&&t.push(a);return t.sort(dt),o()},i.range=function(s){return arguments.length?(e=Array.from(s),o()):e.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return dp().domain(t).range(e).unknown(r)},we.apply(i,arguments)}function mp(){var t=[.5],e=[0,1],n,r=1;function o(i){return i!=null&&i<=i?e[Go(t,i,0,r)]:n}return o.domain=function(i){return arguments.length?(t=Array.from(i),r=Math.min(t.length,e.length-1),o):t.slice()},o.range=function(i){return arguments.length?(e=Array.from(i),r=Math.min(t.length,e.length-1),o):e.slice()},o.invertExtent=function(i){var s=e.indexOf(i);return[t[s-1],t[s]]},o.unknown=function(i){return arguments.length?(n=i,o):n},o.copy=function(){return mp().domain(t).range(e).unknown(n)},we.apply(o,arguments)}var wv=new Date,vv=new Date;function Wt(t,e,n,r){function o(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(t(i=new Date(+i)),i),o.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),o.round=i=>{let s=o(i),a=o.ceil(i);return i-s<a-i?s:a},o.offset=(i,s)=>(e(i=new Date(+i),s==null?1:Math.floor(s)),i),o.range=(i,s,a)=>{let c=[];if(i=o.ceil(i),a=a==null?1:Math.floor(a),!(i<s)||!(a>0))return c;let f;do c.push(f=new Date(+i)),e(i,a),t(i);while(f<i&&i<s);return c},o.filter=i=>Wt(s=>{if(s>=s)for(;t(s),!i(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!i(s););else for(;--a>=0;)for(;e(s,1),!i(s););}),n&&(o.count=(i,s)=>(wv.setTime(+i),vv.setTime(+s),t(wv),t(vv),Math.floor(n(wv,vv))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(r?s=>r(s)%i===0:s=>o.count(0,s)%i===0):o)),o}var gp=Wt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);gp.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Wt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):gp);var bbt=gp.range;var $e=Wt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),ZS=$e.range;var ai=Wt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),gD=ai.range,ci=Wt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),yD=ci.range;var fi=Wt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),xD=fi.range,ui=Wt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),bD=ui.range;var mr=Wt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),wD=mr.range,Ea=Wt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),vD=Ea.range,Ta=Wt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),_D=Ta.range;function Ia(t){return Wt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var Vn=Ia(0),rs=Ia(1),_g=Ia(2),Mg=Ia(3),ho=Ia(4),Sg=Ia(5),Ag=Ia(6),JS=Vn.range,MD=rs.range,SD=_g.range,AD=Mg.range,ED=ho.range,TD=Sg.range,ID=Ag.range;function Ca(t){return Wt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/6048e5)}var Hn=Ca(0),os=Ca(1),Eg=Ca(2),Tg=Ca(3),mo=Ca(4),Ig=Ca(5),Cg=Ca(6),tA=Hn.range,CD=os.range,ND=Eg.range,kD=Tg.range,RD=mo.range,LD=Ig.range,OD=Cg.range;var li=Wt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),$D=li.range,pi=Wt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),DD=pi.range;var un=Wt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());un.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Wt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});var FD=un.range,ln=Wt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());ln.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Wt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});var PD=ln.range;function nA(t,e,n,r,o,i){let s=[[$e,1,1e3],[$e,5,5*1e3],[$e,15,15*1e3],[$e,30,30*1e3],[i,1,6e4],[i,5,5*6e4],[i,15,15*6e4],[i,30,30*6e4],[o,1,36e5],[o,3,3*36e5],[o,6,6*36e5],[o,12,12*36e5],[r,1,864e5],[r,2,2*864e5],[n,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function a(f,u,p){let l=u<f;l&&([f,u]=[u,f]);let h=p&&typeof p.range=="function"?p:c(f,u,p),d=h?h.range(f,+u+1):[];return l?d.reverse():d}function c(f,u,p){let l=Math.abs(u-f)/p,h=Nr(([,,g])=>g).right(s,l);if(h===s.length)return t.every(Ic(f/31536e6,u/31536e6,p));if(h===0)return gp.every(Math.max(Ic(f,u,p),1));let[d,m]=s[l/s[h-1][2]<s[h][2]/l?h-1:h];return d.every(m)}return[a,c]}var[_v,xp]=nA(ln,pi,Hn,Ta,ui,ci),[Mv,Sv]=nA(un,li,Vn,mr,fi,ai);function Av(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Ev(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function bp(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Tv(t){var e=t.dateTime,n=t.date,r=t.time,o=t.periods,i=t.days,s=t.shortDays,a=t.months,c=t.shortMonths,f=wp(o),u=vp(o),p=wp(i),l=vp(i),h=wp(s),d=vp(s),m=wp(a),g=vp(a),y=wp(c),x=vp(c),b={a:R,A:$,b:O,B:D,c:null,d:cA,e:cA,f:cF,g:xF,G:wF,H:iF,I:sF,j:aF,L:hA,m:fF,M:uF,p:F,q:P,Q:lA,s:pA,S:lF,u:pF,U:hF,V:dF,w:mF,W:gF,x:null,X:null,y:yF,Y:bF,Z:vF,"%":uA},w={a:W,A:K,b:tt,B:nt,c:null,d:fA,e:fA,f:AF,g:$F,G:FF,H:_F,I:MF,j:SF,L:mA,m:EF,M:TF,p:U,q:et,Q:lA,s:pA,S:IF,u:CF,U:NF,V:kF,w:RF,W:LF,x:null,X:null,y:OF,Y:DF,Z:PF,"%":uA},_={a:C,A:S,b:k,B:L,c:M,d:sA,e:sA,f:eF,g:iA,G:oA,H:aA,I:aA,j:ZD,L:tF,m:QD,M:KD,p:T,q:HD,Q:rF,s:oF,S:JD,u:jD,U:XD,V:WD,w:UD,W:GD,x:I,X:N,y:iA,Y:oA,Z:VD,"%":nF};b.x=v(n,b),b.X=v(r,b),b.c=v(e,b),w.x=v(n,w),w.X=v(r,w),w.c=v(e,w);function v(z,G){return function(J){var q=[],bt=-1,st=0,Et=z.length,Ct,Q,qt;for(J instanceof Date||(J=new Date(+J));++bt<Et;)z.charCodeAt(bt)===37&&(q.push(z.slice(st,bt)),(Q=rA[Ct=z.charAt(++bt)])!=null?Ct=z.charAt(++bt):Q=Ct==="e"?" ":"0",(qt=G[Ct])&&(Ct=qt(J,Q)),q.push(Ct),st=bt+1);return q.push(z.slice(st,bt)),q.join("")}}function A(z,G){return function(J){var q=bp(1900,void 0,1),bt=E(q,z,J+="",0),st,Et;if(bt!=J.length)return null;if("Q"in q)return new Date(q.Q);if("s"in q)return new Date(q.s*1e3+("L"in q?q.L:0));if(G&&!("Z"in q)&&(q.Z=0),"p"in q&&(q.H=q.H%12+q.p*12),q.m===void 0&&(q.m="q"in q?q.q:0),"V"in q){if(q.V<1||q.V>53)return null;"w"in q||(q.w=1),"Z"in q?(st=Ev(bp(q.y,0,1)),Et=st.getUTCDay(),st=Et>4||Et===0?os.ceil(st):os(st),st=Ea.offset(st,(q.V-1)*7),q.y=st.getUTCFullYear(),q.m=st.getUTCMonth(),q.d=st.getUTCDate()+(q.w+6)%7):(st=Av(bp(q.y,0,1)),Et=st.getDay(),st=Et>4||Et===0?rs.ceil(st):rs(st),st=mr.offset(st,(q.V-1)*7),q.y=st.getFullYear(),q.m=st.getMonth(),q.d=st.getDate()+(q.w+6)%7)}else("W"in q||"U"in q)&&("w"in q||(q.w="u"in q?q.u%7:"W"in q?1:0),Et="Z"in q?Ev(bp(q.y,0,1)).getUTCDay():Av(bp(q.y,0,1)).getDay(),q.m=0,q.d="W"in q?(q.w+6)%7+q.W*7-(Et+5)%7:q.w+q.U*7-(Et+6)%7);return"Z"in q?(q.H+=q.Z/100|0,q.M+=q.Z%100,Ev(q)):Av(q)}}function E(z,G,J,q){for(var bt=0,st=G.length,Et=J.length,Ct,Q;bt<st;){if(q>=Et)return-1;if(Ct=G.charCodeAt(bt++),Ct===37){if(Ct=G.charAt(bt++),Q=_[Ct in rA?G.charAt(bt++):Ct],!Q||(q=Q(z,J,q))<0)return-1}else if(Ct!=J.charCodeAt(q++))return-1}return q}function T(z,G,J){var q=f.exec(G.slice(J));return q?(z.p=u.get(q[0].toLowerCase()),J+q[0].length):-1}function C(z,G,J){var q=h.exec(G.slice(J));return q?(z.w=d.get(q[0].toLowerCase()),J+q[0].length):-1}function S(z,G,J){var q=p.exec(G.slice(J));return q?(z.w=l.get(q[0].toLowerCase()),J+q[0].length):-1}function k(z,G,J){var q=y.exec(G.slice(J));return q?(z.m=x.get(q[0].toLowerCase()),J+q[0].length):-1}function L(z,G,J){var q=m.exec(G.slice(J));return q?(z.m=g.get(q[0].toLowerCase()),J+q[0].length):-1}function M(z,G,J){return E(z,e,G,J)}function I(z,G,J){return E(z,n,G,J)}function N(z,G,J){return E(z,r,G,J)}function R(z){return s[z.getDay()]}function $(z){return i[z.getDay()]}function O(z){return c[z.getMonth()]}function D(z){return a[z.getMonth()]}function F(z){return o[+(z.getHours()>=12)]}function P(z){return 1+~~(z.getMonth()/3)}function W(z){return s[z.getUTCDay()]}function K(z){return i[z.getUTCDay()]}function tt(z){return c[z.getUTCMonth()]}function nt(z){return a[z.getUTCMonth()]}function U(z){return o[+(z.getUTCHours()>=12)]}function et(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var G=v(z+="",b);return G.toString=function(){return z},G},parse:function(z){var G=A(z+="",!1);return G.toString=function(){return z},G},utcFormat:function(z){var G=v(z+="",w);return G.toString=function(){return z},G},utcParse:function(z){var G=A(z+="",!0);return G.toString=function(){return z},G}}}var rA={"-":"",_:" ",0:"0"},De=/^\s*\d+/,BD=/^%/,zD=/[\\^$*+?|[\]().{}]/g;function $t(t,e,n){var r=t<0?"-":"",o=(r?-t:t)+"",i=o.length;return r+(i<n?new Array(n-i+1).join(e)+o:o)}function YD(t){return t.replace(zD,"\\$&")}function wp(t){return new RegExp("^(?:"+t.map(YD).join("|")+")","i")}function vp(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function UD(t,e,n){var r=De.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function jD(t,e,n){var r=De.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function XD(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function WD(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function GD(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function oA(t,e,n){var r=De.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function iA(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function VD(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function HD(t,e,n){var r=De.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function QD(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function sA(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ZD(t,e,n){var r=De.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function aA(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function KD(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function JD(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function tF(t,e,n){var r=De.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function eF(t,e,n){var r=De.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function nF(t,e,n){var r=BD.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function rF(t,e,n){var r=De.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function oF(t,e,n){var r=De.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function cA(t,e){return $t(t.getDate(),e,2)}function iF(t,e){return $t(t.getHours(),e,2)}function sF(t,e){return $t(t.getHours()%12||12,e,2)}function aF(t,e){return $t(1+mr.count(un(t),t),e,3)}function hA(t,e){return $t(t.getMilliseconds(),e,3)}function cF(t,e){return hA(t,e)+"000"}function fF(t,e){return $t(t.getMonth()+1,e,2)}function uF(t,e){return $t(t.getMinutes(),e,2)}function lF(t,e){return $t(t.getSeconds(),e,2)}function pF(t){var e=t.getDay();return e===0?7:e}function hF(t,e){return $t(Vn.count(un(t)-1,t),e,2)}function dA(t){var e=t.getDay();return e>=4||e===0?ho(t):ho.ceil(t)}function dF(t,e){return t=dA(t),$t(ho.count(un(t),t)+(un(t).getDay()===4),e,2)}function mF(t){return t.getDay()}function gF(t,e){return $t(rs.count(un(t)-1,t),e,2)}function yF(t,e){return $t(t.getFullYear()%100,e,2)}function xF(t,e){return t=dA(t),$t(t.getFullYear()%100,e,2)}function bF(t,e){return $t(t.getFullYear()%1e4,e,4)}function wF(t,e){var n=t.getDay();return t=n>=4||n===0?ho(t):ho.ceil(t),$t(t.getFullYear()%1e4,e,4)}function vF(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+$t(e/60|0,"0",2)+$t(e%60,"0",2)}function fA(t,e){return $t(t.getUTCDate(),e,2)}function _F(t,e){return $t(t.getUTCHours(),e,2)}function MF(t,e){return $t(t.getUTCHours()%12||12,e,2)}function SF(t,e){return $t(1+Ea.count(ln(t),t),e,3)}function mA(t,e){return $t(t.getUTCMilliseconds(),e,3)}function AF(t,e){return mA(t,e)+"000"}function EF(t,e){return $t(t.getUTCMonth()+1,e,2)}function TF(t,e){return $t(t.getUTCMinutes(),e,2)}function IF(t,e){return $t(t.getUTCSeconds(),e,2)}function CF(t){var e=t.getUTCDay();return e===0?7:e}function NF(t,e){return $t(Hn.count(ln(t)-1,t),e,2)}function gA(t){var e=t.getUTCDay();return e>=4||e===0?mo(t):mo.ceil(t)}function kF(t,e){return t=gA(t),$t(mo.count(ln(t),t)+(ln(t).getUTCDay()===4),e,2)}function RF(t){return t.getUTCDay()}function LF(t,e){return $t(os.count(ln(t)-1,t),e,2)}function OF(t,e){return $t(t.getUTCFullYear()%100,e,2)}function $F(t,e){return t=gA(t),$t(t.getUTCFullYear()%100,e,2)}function DF(t,e){return $t(t.getUTCFullYear()%1e4,e,4)}function FF(t,e){var n=t.getUTCDay();return t=n>=4||n===0?mo(t):mo.ceil(t),$t(t.getUTCFullYear()%1e4,e,4)}function PF(){return"+0000"}function uA(){return"%"}function lA(t){return+t}function pA(t){return Math.floor(+t/1e3)}var af,cf,yA,go,xA;Iv({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 Iv(t){return af=Tv(t),cf=af.format,yA=af.parse,go=af.utcFormat,xA=af.utcParse,af}function qF(t){return new Date(t)}function BF(t){return t instanceof Date?+t:+new Date(+t)}function Ng(t,e,n,r,o,i,s,a,c,f){var u=cp(),p=u.invert,l=u.domain,h=f(".%L"),d=f(":%S"),m=f("%I:%M"),g=f("%I %p"),y=f("%a %d"),x=f("%b %d"),b=f("%B"),w=f("%Y");function _(v){return(c(v)<v?h:a(v)<v?d:s(v)<v?m:i(v)<v?g:r(v)<v?o(v)<v?y:x:n(v)<v?b:w)(v)}return u.invert=function(v){return new Date(p(v))},u.domain=function(v){return arguments.length?l(Array.from(v,BF)):l().map(qF)},u.ticks=function(v){var A=l();return t(A[0],A[A.length-1],v??10)},u.tickFormat=function(v,A){return A==null?_:f(A)},u.nice=function(v){var A=l();return(!v||typeof v.range!="function")&&(v=e(A[0],A[A.length-1],v??10)),v?l(up(A,v)):u},u.copy=function(){return lo(u,Ng(t,e,n,r,o,i,s,a,c,f))},u}function kg(){return we.apply(Ng(Mv,Sv,un,li,Vn,mr,fi,ai,$e,cf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Rg(){return we.apply(Ng(_v,xp,ln,pi,Hn,Ea,ui,ci,$e,go).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function _p(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Lg(){var t=0,e=.5,n=1,r=1,o,i,s,a,c,f=Fn,u,p=!1,l;function h(m){return isNaN(m=+m)?l:(m=.5+((m=+u(m))-i)*(r*m<r*i?a:c),f(p?Math.max(0,Math.min(1,m)):m))}h.domain=function(m){return arguments.length?([t,e,n]=m,o=u(t=+t),i=u(e=+e),s=u(n=+n),a=o===i?0:.5/(i-o),c=i===s?0:.5/(s-i),r=i<o?-1:1,h):[t,e,n]},h.clamp=function(m){return arguments.length?(p=!!m,h):p},h.interpolator=function(m){return arguments.length?(f=m,h):f};function d(m){return function(g){var y,x,b;return arguments.length?([y,x,b]=g,f=no(m,[y,x,b]),h):[f(0),f(.5),f(1)]}}return h.range=d(Wn),h.rangeRound=d(ua),h.unknown=function(m){return arguments.length?(l=m,h):l},function(m){return u=m,o=m(t),i=m(e),s=m(n),a=o===i?0:.5/(i-o),c=i===s?0:.5/(s-i),r=i<o?-1:1,h}}function Mp(){var t=ii(Lg()(Fn));return t.copy=function(){return _p(t,Mp())},sp.apply(t,arguments)}function Og(){var t=yv(Lg()).domain([.1,1,10]);return t.copy=function(){return _p(t,Og()).base(t.base())},sp.apply(t,arguments)}function $g(){var t=xv(Lg());return t.copy=function(){return _p(t,$g()).constant(t.constant())},sp.apply(t,arguments)}function Dg(){var t=bv(Lg());return t.copy=function(){return _p(t,Dg()).exponent(t.exponent())},sp.apply(t,arguments)}function j(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(r*6,++r*6);return n}var Cv=j("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var Nv=j("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");var kv=j("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");var Rv=j("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0");var Lv=j("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");var Ov=j("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");var $v=j("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");var Dv=j("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");var Fv=j("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");var Pv=j("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var qv=j("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var at=t=>O2(t[t.length-1]);var Fg=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(j),Pg=at(Fg);var qg=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(j),Bg=at(qg);var zg=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(j),Yg=at(zg);var Ug=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(j),jg=at(Ug);var Sp=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(j),ff=at(Sp);var Xg=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(j),Wg=at(Xg);var Ap=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(j),uf=at(Ap);var Gg=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(j),Vg=at(Gg);var Hg=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(j),Qg=at(Hg);var Zg=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(j),Kg=at(Zg);var Jg=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(j),ty=at(Jg);var ey=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(j),ny=at(ey);var ry=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(j),oy=at(ry);var iy=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(j),sy=at(iy);var ay=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(j),cy=at(ay);var fy=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(j),uy=at(fy);var ly=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(j),py=at(ly);var hy=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(j),dy=at(hy);var my=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(j),gy=at(my);var yy=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(j),xy=at(yy);var by=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(j),wy=at(by);var vy=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(j),_y=at(vy);var My=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(j),Sy=at(My);var Ay=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(j),Ey=at(Ay);var Ty=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(j),Iy=at(Ty);var Cy=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(j),Ny=at(Cy);var ky=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(j),Ry=at(ky);function Ly(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 Oy=Fc(Mn(300,.5,0),Mn(-240,.5,1));var Dy=Fc(Mn(-100,.75,.35),Mn(80,1.5,.8)),Fy=Fc(Mn(260,.75,.35),Mn(80,1.5,.8)),$y=Mn();function Py(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return $y.h=360*t-100,$y.s=1.5-1.5*e,$y.l=.8-.9*e,$y+""}var qy=Ee(),zF=Math.PI/3,YF=Math.PI*2/3;function By(t){var e;return t=(.5-t)*Math.PI,qy.r=255*(e=Math.sin(t))*e,qy.g=255*(e=Math.sin(t+zF))*e,qy.b=255*(e=Math.sin(t+YF))*e,qy+""}function zy(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 Yy(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var Uy=Yy(j("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),jy=Yy(j("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Xy=Yy(j("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Wy=Yy(j("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function ve(t){return function(){return t}}var Bv=Math.cos;var lf=Math.min,Ep=Math.sin,Dt=Math.sqrt,zv=1e-12,Na=Math.PI,j_t=Na/2,pf=2*Na;function Gy(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{let r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Qi(e)}var V_t=Array.prototype.slice;function Vy(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function bA(t){this._context=t}bA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function hi(t){return new bA(t)}function Hy(t){return t[0]}function Qy(t){return t[1]}function Tp(t,e){var n=ve(!0),r=null,o=hi,i=null,s=Gy(a);t=typeof t=="function"?t:t===void 0?Hy:ve(t),e=typeof e=="function"?e:e===void 0?Qy:ve(e);function a(c){var f,u=(c=Vy(c)).length,p,l=!1,h;for(r==null&&(i=o(h=s())),f=0;f<=u;++f)!(f<u&&n(p=c[f],f,c))===l&&((l=!l)?i.lineStart():i.lineEnd()),l&&i.point(+t(p,f,c),+e(p,f,c));if(h)return i=null,h+""||null}return a.x=function(c){return arguments.length?(t=typeof c=="function"?c:ve(+c),a):t},a.y=function(c){return arguments.length?(e=typeof c=="function"?c:ve(+c),a):e},a.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ve(!!c),a):n},a.curve=function(c){return arguments.length?(o=c,r!=null&&(i=o(r)),a):o},a.context=function(c){return arguments.length?(c==null?r=i=null:i=o(r=c),a):r},a}function hf(t,e,n){var r=null,o=ve(!0),i=null,s=hi,a=null,c=Gy(f);t=typeof t=="function"?t:t===void 0?Hy:ve(+t),e=typeof e=="function"?e:e===void 0?ve(0):ve(+e),n=typeof n=="function"?n:n===void 0?Qy:ve(+n);function f(p){var l,h,d,m=(p=Vy(p)).length,g,y=!1,x,b=new Array(m),w=new Array(m);for(i==null&&(a=s(x=c())),l=0;l<=m;++l){if(!(l<m&&o(g=p[l],l,p))===y)if(y=!y)h=l,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),d=l-1;d>=h;--d)a.point(b[d],w[d]);a.lineEnd(),a.areaEnd()}y&&(b[l]=+t(g,l,p),w[l]=+e(g,l,p),a.point(r?+r(g,l,p):b[l],n?+n(g,l,p):w[l]))}if(x)return a=null,x+""||null}function u(){return Tp().defined(o).curve(s).context(i)}return f.x=function(p){return arguments.length?(t=typeof p=="function"?p:ve(+p),r=null,f):t},f.x0=function(p){return arguments.length?(t=typeof p=="function"?p:ve(+p),f):t},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:ve(+p),f):r},f.y=function(p){return arguments.length?(e=typeof p=="function"?p:ve(+p),n=null,f):e},f.y0=function(p){return arguments.length?(e=typeof p=="function"?p:ve(+p),f):e},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:ve(+p),f):n},f.lineX0=f.lineY0=function(){return u().x(t).y(e)},f.lineY1=function(){return u().x(t).y(n)},f.lineX1=function(){return u().x(r).y(e)},f.defined=function(p){return arguments.length?(o=typeof p=="function"?p:ve(!!p),f):o},f.curve=function(p){return arguments.length?(s=p,i!=null&&(a=s(i)),f):s},f.context=function(p){return arguments.length?(p==null?i=a=null:a=s(i=p),f):i},f}var Zy=class{constructor(e,n){this._context=e,this._x=n}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(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}};function Yv(t){return new Zy(t,!0)}function Uv(t){return new Zy(t,!1)}var UF=Dt(3),Ip={draw(t,e){let n=Dt(e+lf(e/28,.75))*.59436,r=n/2,o=r*UF;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-o,-r),t.lineTo(o,r),t.moveTo(-o,r),t.lineTo(o,-r)}};var di={draw(t,e){let n=Dt(e/Na);t.moveTo(n,0),t.arc(0,0,n,0,pf)}};var Cp={draw(t,e){let n=Dt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}};var wA=Dt(1/3),jF=wA*2,Np={draw(t,e){let n=Dt(e/jF),r=n*wA;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}};var kp={draw(t,e){let n=Dt(e)*.62625;t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}};var Rp={draw(t,e){let n=Dt(e-lf(e/7,2))*.87559;t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}};var Lp={draw(t,e){let n=Dt(e),r=-n/2;t.rect(r,r,n,n)}};var Op={draw(t,e){let n=Dt(e)*.4431;t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}};var XF=.8908130915292852,vA=Ep(Na/10)/Ep(7*Na/10),WF=Ep(pf/10)*vA,GF=-Bv(pf/10)*vA,$p={draw(t,e){let n=Dt(e*XF),r=WF*n,o=GF*n;t.moveTo(0,-n),t.lineTo(r,o);for(let i=1;i<5;++i){let s=pf*i/5,a=Bv(s),c=Ep(s);t.lineTo(c*n,-a*n),t.lineTo(a*r-c*o,c*r+a*o)}t.closePath()}};var jv=Dt(3),Dp={draw(t,e){let n=-Dt(e/(jv*3));t.moveTo(0,n*2),t.lineTo(-jv*n,-n),t.lineTo(jv*n,-n),t.closePath()}};var VF=Dt(3),Fp={draw(t,e){let n=Dt(e)*.6824,r=n/2,o=n*VF/2;t.moveTo(0,-n),t.lineTo(o,r),t.lineTo(-o,r),t.closePath()}};var gr=-.5,yr=Dt(3)/2,Xv=1/Dt(12),HF=(Xv/2+1)*3,Pp={draw(t,e){let n=Dt(e/HF),r=n/2,o=n*Xv,i=r,s=n*Xv+n,a=-i,c=s;t.moveTo(r,o),t.lineTo(i,s),t.lineTo(a,c),t.lineTo(gr*r-yr*o,yr*r+gr*o),t.lineTo(gr*i-yr*s,yr*i+gr*s),t.lineTo(gr*a-yr*c,yr*a+gr*c),t.lineTo(gr*r+yr*o,gr*o-yr*r),t.lineTo(gr*i+yr*s,gr*s-yr*i),t.lineTo(gr*a+yr*c,gr*c-yr*a),t.closePath()}};var df={draw(t,e){let n=Dt(e-lf(e/6,1.7))*.6189;t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}};var Ky=[di,Cp,Np,Lp,$p,Dp,Pp],Wv=[di,Rp,df,Fp,Ip,Op,kp];function xr(){}function mf(t,e,n){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+e)/6,(t._y0+4*t._y1+n)/6)}function qp(t){this._context=t}qp.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:mf(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,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:mf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Gv(t){return new qp(t)}function _A(t){this._context=t}_A.prototype={areaStart:xr,areaEnd:xr,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,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:mf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Vv(t){return new _A(t)}function MA(t){this._context=t}MA.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,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:mf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Hv(t){return new MA(t)}function SA(t,e){this._basis=new qp(t),this._beta=e}SA.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],o=e[0],i=t[n]-r,s=e[n]-o,a=-1,c;++a<=n;)c=a/n,this._basis.point(this._beta*t[a]+(1-this._beta)*(r+c*i),this._beta*e[a]+(1-this._beta)*(o+c*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var Qv=function t(e){function n(r){return e===1?new qp(r):new SA(r,e)}return n.beta=function(r){return t(+r)},n}(.85);function gf(t,e,n){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-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Jy(t,e){this._context=t,this._k=(1-e)/6}Jy.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:gf(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,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:gf(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Zv=function t(e){function n(r){return new Jy(r,e)}return n.tension=function(r){return t(+r)},n}(0);function tx(t,e){this._context=t,this._k=(1-e)/6}tx.prototype={areaStart:xr,areaEnd:xr,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,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:gf(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Kv=function t(e){function n(r){return new tx(r,e)}return n.tension=function(r){return t(+r)},n}(0);function ex(t,e){this._context=t,this._k=(1-e)/6}ex.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,e){switch(t=+t,e=+e,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:gf(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Jv=function t(e){function n(r){return new ex(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Bp(t,e,n){var r=t._x1,o=t._y1,i=t._x2,s=t._y2;if(t._l01_a>zv){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,o=(o*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>zv){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*f+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*f+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,o,i,s,t._x2,t._y2)}function AA(t,e){this._context=t,this._alpha=e}AA.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,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Bp(this,t,e);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=e}};var t_=function t(e){function n(r){return e?new AA(r,e):new Jy(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function EA(t,e){this._context=t,this._alpha=e}EA.prototype={areaStart:xr,areaEnd:xr,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,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Bp(this,t,e);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=e}};var e_=function t(e){function n(r){return e?new EA(r,e):new tx(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function TA(t,e){this._context=t,this._alpha=e}TA.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,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+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:Bp(this,t,e);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=e}};var n_=function t(e){function n(r){return e?new TA(r,e):new ex(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function IA(t){this._context=t}IA.prototype={areaStart:xr,areaEnd:xr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function r_(t){return new IA(t)}function CA(t){return t<0?-1:1}function NA(t,e,n){var r=t._x1-t._x0,o=e-t._x1,i=(t._y1-t._y0)/(r||o<0&&-0),s=(n-t._y1)/(o||r<0&&-0),a=(i*o+s*r)/(r+o);return(CA(i)+CA(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(a))||0}function kA(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function o_(t,e,n){var r=t._x0,o=t._y0,i=t._x1,s=t._y1,a=(i-r)/3;t._context.bezierCurveTo(r+a,o+a*e,i-a,s-a*n,i,s)}function nx(t){this._context=t}nx.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:o_(this,this._t0,kA(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,o_(this,kA(this,n=NA(this,t,e)),n);break;default:o_(this,this._t0,n=NA(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function RA(t){this._context=new LA(t)}(RA.prototype=Object.create(nx.prototype)).point=function(t,e){nx.prototype.point.call(this,e,t)};function LA(t){this._context=t}LA.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,o,i){this._context.bezierCurveTo(e,t,r,n,i,o)}};function i_(t){return new nx(t)}function s_(t){return new RA(t)}function $A(t){this._context=t}$A.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=OA(t),o=OA(e),i=0,s=1;s<n;++i,++s)this._context.bezierCurveTo(r[0][i],o[0][i],r[1][i],o[1][i],t[s],e[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function OA(t){var e,n=t.length-1,r,o=new Array(n),i=new Array(n),s=new Array(n);for(o[0]=0,i[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)o[e]=1,i[e]=4,s[e]=4*t[e]+2*t[e+1];for(o[n-1]=2,i[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=o[e]/i[e-1],i[e]-=r,s[e]-=r*s[e-1];for(o[n-1]=s[n-1]/i[n-1],e=n-2;e>=0;--e)o[e]=(s[e]-o[e+1])/i[e];for(i[n-1]=(t[n]+o[n-1])/2,e=0;e<n-1;++e)i[e]=2*t[e+1]-o[e+1];return[o,i]}function a_(t){return new $A(t)}function rx(t,e){this._context=t,this._t=e}rx.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,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function c_(t){return new rx(t,.5)}function f_(t){return new rx(t,0)}function u_(t){return new rx(t,1)}var zp=t=>()=>t;function l_(t,{sourceEvent:e,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Qn(t,e,n){this.k=t,this.x=e,this.y=n}Qn.prototype={constructor:Qn,scale:function(t){return t===1?this:new Qn(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Qn(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Yp=new Qn(1,0,0);p_.prototype=Qn.prototype;function p_(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Yp;return t.__zoom}function ox(t){t.stopImmediatePropagation()}function yf(t){t.preventDefault(),t.stopImmediatePropagation()}function QF(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function ZF(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function DA(){return this.__zoom||Yp}function KF(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function JF(){return navigator.maxTouchPoints||"ontouchstart"in this}function tP(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function h_(){var t=QF,e=ZF,n=tP,r=KF,o=JF,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=B2,f=oa("start","zoom","end"),u,p,l,h=500,d=150,m=0,g=10;function y(M){M.property("__zoom",DA).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",C).filter(o).on("touchstart.zoom",S).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(M,I,N,R){var $=M.selection?M.selection():M;$.property("__zoom",DA),M!==$?_(M,I,N,R):$.interrupt().each(function(){v(this,arguments).event(R).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(M,I,N,R){y.scaleTo(M,function(){var $=this.__zoom.k,O=typeof I=="function"?I.apply(this,arguments):I;return $*O},N,R)},y.scaleTo=function(M,I,N,R){y.transform(M,function(){var $=e.apply(this,arguments),O=this.__zoom,D=N==null?w($):typeof N=="function"?N.apply(this,arguments):N,F=O.invert(D),P=typeof I=="function"?I.apply(this,arguments):I;return n(b(x(O,P),D,F),$,s)},N,R)},y.translateBy=function(M,I,N,R){y.transform(M,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof N=="function"?N.apply(this,arguments):N),e.apply(this,arguments),s)},null,R)},y.translateTo=function(M,I,N,R,$){y.transform(M,function(){var O=e.apply(this,arguments),D=this.__zoom,F=R==null?w(O):typeof R=="function"?R.apply(this,arguments):R;return n(Yp.translate(F[0],F[1]).scale(D.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof N=="function"?-N.apply(this,arguments):-N),O,s)},R,$)};function x(M,I){return I=Math.max(i[0],Math.min(i[1],I)),I===M.k?M:new Qn(I,M.x,M.y)}function b(M,I,N){var R=I[0]-N[0]*M.k,$=I[1]-N[1]*M.k;return R===M.x&&$===M.y?M:new Qn(M.k,R,$)}function w(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function _(M,I,N,R){M.on("start.zoom",function(){v(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){v(this,arguments).event(R).end()}).tween("zoom",function(){var $=this,O=arguments,D=v($,O).event(R),F=e.apply($,O),P=N==null?w(F):typeof N=="function"?N.apply($,O):N,W=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),K=$.__zoom,tt=typeof I=="function"?I.apply($,O):I,nt=c(K.invert(P).concat(W/K.k),tt.invert(P).concat(W/tt.k));return function(U){if(U===1)U=tt;else{var et=nt(U),z=W/et[2];U=new Qn(z,P[0]-et[0]*z,P[1]-et[1]*z)}D.zoom(null,U)}})}function v(M,I,N){return!N&&M.__zooming||new A(M,I)}function A(M,I){this.that=M,this.args=I,this.active=0,this.sourceEvent=null,this.extent=e.apply(M,I),this.taps=0}A.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,I){return this.mouse&&M!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var I=At(this.that).datum();f.call(M,this.that,new l_(M,{sourceEvent:this.sourceEvent,target:y,type:M,transform:this.that.__zoom,dispatch:f}),I)}};function E(M,...I){if(!t.apply(this,arguments))return;var N=v(this,I).event(M),R=this.__zoom,$=Math.max(i[0],Math.min(i[1],R.k*Math.pow(2,r.apply(this,arguments)))),O=on(M);if(N.wheel)(N.mouse[0][0]!==O[0]||N.mouse[0][1]!==O[1])&&(N.mouse[1]=R.invert(N.mouse[0]=O)),clearTimeout(N.wheel);else{if(R.k===$)return;N.mouse=[O,R.invert(O)],ro(this),N.start()}yf(M),N.wheel=setTimeout(D,d),N.zoom("mouse",n(b(x(R,$),N.mouse[0],N.mouse[1]),N.extent,s));function D(){N.wheel=null,N.end()}}function T(M,...I){if(l||!t.apply(this,arguments))return;var N=M.currentTarget,R=v(this,I,!0).event(M),$=At(M.view).on("mousemove.zoom",P,!0).on("mouseup.zoom",W,!0),O=on(M,N),D=M.clientX,F=M.clientY;xl(M.view),ox(M),R.mouse=[O,this.__zoom.invert(O)],ro(this),R.start();function P(K){if(yf(K),!R.moved){var tt=K.clientX-D,nt=K.clientY-F;R.moved=tt*tt+nt*nt>m}R.event(K).zoom("mouse",n(b(R.that.__zoom,R.mouse[0]=on(K,N),R.mouse[1]),R.extent,s))}function W(K){$.on("mousemove.zoom mouseup.zoom",null),bl(K.view,R.moved),yf(K),R.event(K).end()}}function C(M,...I){if(t.apply(this,arguments)){var N=this.__zoom,R=on(M.changedTouches?M.changedTouches[0]:M,this),$=N.invert(R),O=N.k*(M.shiftKey?.5:2),D=n(b(x(N,O),R,$),e.apply(this,I),s);yf(M),a>0?At(this).transition().duration(a).call(_,D,R,M):At(this).call(y.transform,D,R,M)}}function S(M,...I){if(t.apply(this,arguments)){var N=M.touches,R=N.length,$=v(this,I,M.changedTouches.length===R).event(M),O,D,F,P;for(ox(M),D=0;D<R;++D)F=N[D],P=on(F,this),P=[P,this.__zoom.invert(P),F.identifier],$.touch0?!$.touch1&&$.touch0[2]!==P[2]&&($.touch1=P,$.taps=0):($.touch0=P,O=!0,$.taps=1+!!u);u&&(u=clearTimeout(u)),O&&($.taps<2&&(p=P[0],u=setTimeout(function(){u=null},h)),ro(this),$.start())}}function k(M,...I){if(this.__zooming){var N=v(this,I).event(M),R=M.changedTouches,$=R.length,O,D,F,P;for(yf(M),O=0;O<$;++O)D=R[O],F=on(D,this),N.touch0&&N.touch0[2]===D.identifier?N.touch0[0]=F:N.touch1&&N.touch1[2]===D.identifier&&(N.touch1[0]=F);if(D=N.that.__zoom,N.touch1){var W=N.touch0[0],K=N.touch0[1],tt=N.touch1[0],nt=N.touch1[1],U=(U=tt[0]-W[0])*U+(U=tt[1]-W[1])*U,et=(et=nt[0]-K[0])*et+(et=nt[1]-K[1])*et;D=x(D,Math.sqrt(U/et)),F=[(W[0]+tt[0])/2,(W[1]+tt[1])/2],P=[(K[0]+nt[0])/2,(K[1]+nt[1])/2]}else if(N.touch0)F=N.touch0[0],P=N.touch0[1];else return;N.zoom("touch",n(b(D,F,P),N.extent,s))}}function L(M,...I){if(this.__zooming){var N=v(this,I).event(M),R=M.changedTouches,$=R.length,O,D;for(ox(M),l&&clearTimeout(l),l=setTimeout(function(){l=null},h),O=0;O<$;++O)D=R[O],N.touch0&&N.touch0[2]===D.identifier?delete N.touch0:N.touch1&&N.touch1[2]===D.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(D=on(D,this),Math.hypot(p[0]-D[0],p[1]-D[1])<g)){var F=At(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return y.wheelDelta=function(M){return arguments.length?(r=typeof M=="function"?M:zp(+M),y):r},y.filter=function(M){return arguments.length?(t=typeof M=="function"?M:zp(!!M),y):t},y.touchable=function(M){return arguments.length?(o=typeof M=="function"?M:zp(!!M),y):o},y.extent=function(M){return arguments.length?(e=typeof M=="function"?M:zp([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),y):e},y.scaleExtent=function(M){return arguments.length?(i[0]=+M[0],i[1]=+M[1],y):[i[0],i[1]]},y.translateExtent=function(M){return arguments.length?(s[0][0]=+M[0][0],s[1][0]=+M[1][0],s[0][1]=+M[0][1],s[1][1]=+M[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(M){return arguments.length?(n=M,y):n},y.duration=function(M){return arguments.length?(a=+M,y):a},y.interpolate=function(M){return arguments.length?(c=M,y):c},y.on=function(){var M=f.on.apply(f,arguments);return M===f?y:M},y.clickDistance=function(M){return arguments.length?(m=(M=+M)*M,y):Math.sqrt(m)},y.tapDistance=function(M){return arguments.length?(g=+M,y):g},y}function Jt(t){return t!=null&&!Number.isNaN(t)}function Fe(t,e){return+Jt(e)-+Jt(t)||dt(t,e)}function ka(t,e){return+Jt(e)-+Jt(t)||xn(t,e)}function Up(t){return t!=null&&`${t}`!=""}function xf(t){return isFinite(t)?t:NaN}function Nn(t){return t>0&&isFinite(t)?t:NaN}function is(t){return t<0&&isFinite(t)?t:NaN}function ix(t,e){if(t instanceof Date||(t=new Date(+t)),isNaN(t))return typeof e=="function"?e(t):e;let n=t.getUTCHours(),r=t.getUTCMinutes(),o=t.getUTCSeconds(),i=t.getUTCMilliseconds();return`${eP(t.getUTCFullYear(),4)}-${mi(t.getUTCMonth()+1,2)}-${mi(t.getUTCDate(),2)}${n||r||o||i?`T${mi(n,2)}:${mi(r,2)}${o||i?`:${mi(o,2)}${i?`.${mi(i,3)}`:""}`:""}Z`:""}`}function eP(t){return t<0?`-${mi(-t,6)}`:t>9999?`+${mi(t,6)}`:mi(t,4)}function mi(t,e){return`${t}`.padStart(e,"0")}var nP=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function jp(t,e){return nP.test(t+="")?new Date(t):typeof e=="function"?e(t):e}function gi(t){if(t==null)return;let e=t[0],n=t[t.length-1];return xn(e,n)}var wf=1e3,as=wf*60,cs=as*60,xo=cs*24,yo=xo*7,Ra=xo*30,ss=xo*365,d_=[["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",wf],["5 seconds",5*wf],["15 seconds",15*wf],["30 seconds",30*wf],["minute",as],["5 minutes",5*as],["15 minutes",15*as],["30 minutes",30*as],["hour",cs],["3 hours",3*cs],["6 hours",6*cs],["12 hours",12*cs],["day",xo],["2 days",2*xo],["week",yo],["2 weeks",2*yo],["month",Ra],["3 months",3*Ra],["6 months",6*Ra],["year",ss],["2 years",2*ss],["5 years",5*ss],["10 years",10*ss],["20 years",20*ss],["50 years",50*ss],["100 years",100*ss]],m_=new Map([["second",wf],["minute",as],["hour",cs],["day",xo],["monday",yo],["tuesday",yo],["wednesday",yo],["thursday",yo],["friday",yo],["saturday",yo],["sunday",yo],["week",yo],["month",Ra],["year",ss]]),PA=new Map([["second",$e],["minute",ai],["hour",fi],["day",mr],["monday",rs],["tuesday",_g],["wednesday",Mg],["thursday",ho],["friday",Sg],["saturday",Ag],["sunday",Vn],["week",Vn],["month",li],["year",un]]),g_=new Map([["second",$e],["minute",ci],["hour",ui],["day",Ta],["monday",os],["tuesday",Eg],["wednesday",Tg],["thursday",mo],["friday",Ig],["saturday",Cg],["sunday",Hn],["week",Hn],["month",pi],["year",ln]]),vf=Symbol("intervalDuration"),ax=Symbol("intervalType");for(let[t,e]of PA)e[vf]=m_.get(t),e[ax]="time";for(let[t,e]of g_)e[vf]=m_.get(t),e[ax]="utc";var Xp=[["year",ln,"utc"],["month",pi,"utc"],["day",Ta,"utc",6*Ra],["hour",ui,"utc",3*xo],["minute",ci,"utc",6*cs],["second",$e,"utc",30*as]],sx=[["year",un,"time"],["month",li,"time"],["day",mr,"time",6*Ra],["hour",fi,"time",3*xo],["minute",ai,"time",6*cs],["second",$e,"time",30*as]],rP=[Xp[0],sx[0],Xp[1],sx[1],Xp[2],sx[2],...Xp.slice(3)];function cx(t){let e=`${t}`.toLowerCase();e.endsWith("s")&&(e=e.slice(0,-1));let n=1,r=/^(?:(\d+)\s+)/.exec(e);switch(r&&(e=e.slice(r[0].length),n=+r[1]),e){case"quarter":e="month",n*=3;break;case"half":e="month",n*=6;break}let o=g_.get(e);if(!o)throw new Error(`unknown interval: ${t}`);if(n>1&&!o.every)throw new Error(`non-periodic interval: ${e}`);return[e,n]}function Wp(t){return qA(cx(t),"time")}function La(t){return qA(cx(t),"utc")}function qA([t,e],n){let r=(n==="time"?PA:g_).get(t);return e>1&&(r=r.every(e),r[vf]=m_.get(t)*e,r[ax]=n),r}function y_(t,e){if(!(e>1))return;let n=t[vf];if(!d_.some(([,o])=>o===n)||n%xo===0&&xo<n&&n<Ra)return;let[r]=d_[Nr(([,o])=>Math.log(o)).center(d_,Math.log(n*e))];return(t[ax]==="time"?Wp:La)(r)}function FA(t,e,n){let r=e==="time"?cf:go;if(n==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 o=oP(n);switch(t){case"millisecond":return bf(r(".%L"),r(":%M:%S"),o);case"second":return bf(r(":%S"),r("%-I:%M"),o);case"minute":return bf(r("%-I:%M"),r("%p"),o);case"hour":return bf(r("%-I %p"),r("%b %-d"),o);case"day":return bf(r("%-d"),r("%b"),o);case"month":return bf(r("%b"),r("%Y"),o);case"year":return r("%Y")}throw new Error("unable to format time ticks")}function oP(t){return t==="left"||t==="right"?(e,n)=>`
1
+ var XC=Object.create;var eb=Object.defineProperty;var WC=Object.getOwnPropertyDescriptor;var GC=Object.getOwnPropertyNames;var VC=Object.getPrototypeOf,HC=Object.prototype.hasOwnProperty;var Z3=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),QC=(t,e)=>{for(var n in e)eb(t,n,{get:e[n],enumerable:!0})},ZC=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of GC(e))!HC.call(t,o)&&o!==n&&eb(t,o,{get:()=>e[o],enumerable:!(r=WC(e,o))||r.enumerable});return t};var KC=(t,e,n)=>(n=t!=null?XC(VC(t)):{},ZC(e||!t||!t.__esModule?eb(n,"default",{value:t,enumerable:!0}):n,t));var MI=Z3((TIt,_I)=>{"use strict";function hY(t,e,n,r,o){for(var i=o+1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c>=0?(i=s,o=s-1):r=s+1}return i}function dY(t,e,n,r,o){for(var i=o+1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c>0?(i=s,o=s-1):r=s+1}return i}function mY(t,e,n,r,o){for(var i=r-1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c<0?(i=s,r=s+1):o=s-1}return i}function gY(t,e,n,r,o){for(var i=r-1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c<=0?(i=s,r=s+1):o=s-1}return i}function yY(t,e,n,r,o){for(;r<=o;){var i=r+o>>>1,s=t[i],a=n!==void 0?n(s,e):s-e;if(a===0)return i;a<=0?r=i+1:o=i-1}return-1}function jh(t,e,n,r,o,i){return typeof n=="function"?i(t,e,n,r===void 0?0:r|0,o===void 0?t.length-1:o|0):i(t,e,void 0,n===void 0?0:n|0,r===void 0?t.length-1:r|0)}_I.exports={ge:function(t,e,n,r,o){return jh(t,e,n,r,o,hY)},gt:function(t,e,n,r,o){return jh(t,e,n,r,o,dY)},lt:function(t,e,n,r,o){return jh(t,e,n,r,o,mY)},le:function(t,e,n,r,o){return jh(t,e,n,r,o,gY)},eq:function(t,e,n,r,o){return jh(t,e,n,r,o,yY)}}});var kI=Z3((IIt,NI)=>{"use strict";var N1=MI(),iu=0,tc=1,C1=2;NI.exports=bY;function p3(t,e,n,r,o){this.mid=t,this.left=e,this.right=n,this.leftPoints=r,this.rightPoints=o,this.count=(e?e.count:0)+(n?n.count:0)+r.length}var Xh=p3.prototype;function u3(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function EI(t,e){var n=su(e);t.mid=n.mid,t.left=n.left,t.right=n.right,t.leftPoints=n.leftPoints,t.rightPoints=n.rightPoints,t.count=n.count}function SI(t,e){var n=t.intervals([]);n.push(e),EI(t,n)}function AI(t,e){var n=t.intervals([]),r=n.indexOf(e);return r<0?iu:(n.splice(r,1),EI(t,n),tc)}Xh.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t};Xh.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?SI(this,t):this.left.insert(t):this.left=su([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?SI(this,t):this.right.insert(t):this.right=su([t]);else{var n=N1.ge(this.leftPoints,t,h3),r=N1.ge(this.rightPoints,t,d3);this.leftPoints.splice(n,0,t),this.rightPoints.splice(r,0,t)}};Xh.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){if(!this.left)return iu;var n=this.right?this.right.count:0;if(4*n>3*(e-1))return AI(this,t);var r=this.left.remove(t);return r===C1?(this.left=null,this.count-=1,tc):(r===tc&&(this.count-=1),r)}else if(t[0]>this.mid){if(!this.right)return iu;var o=this.left?this.left.count:0;if(4*o>3*(e-1))return AI(this,t);var r=this.right.remove(t);return r===C1?(this.right=null,this.count-=1,tc):(r===tc&&(this.count-=1),r)}else{if(this.count===1)return this.leftPoints[0]===t?C1:iu;if(this.leftPoints.length===1&&this.leftPoints[0]===t){if(this.left&&this.right){for(var i=this,s=this.left;s.right;)i=s,s=s.right;if(i===this)s.right=this.right;else{var a=this.left,r=this.right;i.count-=s.count,i.right=s.left,s.left=a,s.right=r}u3(this,s),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?u3(this,this.left):u3(this,this.right);return tc}for(var a=N1.ge(this.leftPoints,t,h3);a<this.leftPoints.length&&this.leftPoints[a][0]===t[0];++a)if(this.leftPoints[a]===t){this.count-=1,this.leftPoints.splice(a,1);for(var r=N1.ge(this.rightPoints,t,d3);r<this.rightPoints.length&&this.rightPoints[r][1]===t[1];++r)if(this.rightPoints[r]===t)return this.rightPoints.splice(r,1),tc}return iu}};function TI(t,e,n){for(var r=0;r<t.length&&t[r][0]<=e;++r){var o=n(t[r]);if(o)return o}}function II(t,e,n){for(var r=t.length-1;r>=0&&t[r][1]>=e;--r){var o=n(t[r]);if(o)return o}}function CI(t,e){for(var n=0;n<t.length;++n){var r=e(t[n]);if(r)return r}}Xh.queryPoint=function(t,e){if(t<this.mid){if(this.left){var n=this.left.queryPoint(t,e);if(n)return n}return TI(this.leftPoints,t,e)}else if(t>this.mid){if(this.right){var n=this.right.queryPoint(t,e);if(n)return n}return II(this.rightPoints,t,e)}else return CI(this.leftPoints,e)};Xh.queryInterval=function(t,e,n){if(t<this.mid&&this.left){var r=this.left.queryInterval(t,e,n);if(r)return r}if(e>this.mid&&this.right){var r=this.right.queryInterval(t,e,n);if(r)return r}return e<this.mid?TI(this.leftPoints,e,n):t>this.mid?II(this.rightPoints,t,n):CI(this.leftPoints,n)};function xY(t,e){return t-e}function h3(t,e){var n=t[0]-e[0];return n||t[1]-e[1]}function d3(t,e){var n=t[1]-e[1];return n||t[0]-e[0]}function su(t){if(t.length===0)return null;for(var e=[],n=0;n<t.length;++n)e.push(t[n][0],t[n][1]);e.sort(xY);for(var r=e[e.length>>1],o=[],i=[],s=[],n=0;n<t.length;++n){var a=t[n];a[1]<r?o.push(a):r<a[0]?i.push(a):s.push(a)}var c=s,f=s.slice();return c.sort(h3),f.sort(d3),new p3(r,su(o),su(i),c,f)}function l3(t){this.root=t}var au=l3.prototype;au.insert=function(t){this.root?this.root.insert(t):this.root=new p3(t[0],null,null,[t],[t])};au.remove=function(t){if(this.root){var e=this.root.remove(t);return e===C1&&(this.root=null),e!==iu}return!1};au.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)};au.queryInterval=function(t,e,n){if(t<=e&&this.root)return this.root.queryInterval(t,e,n)};Object.defineProperty(au,"count",{get:function(){return this.root?this.root.count:0}});Object.defineProperty(au,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function bY(t){return!t||t.length===0?new l3(null):new l3(su(t))}});var Li=Symbol("Fixed"),Ye=Symbol("Transient"),pu=Symbol("Transform");var K3={};function hu(t,e=!1){let n,r,o=K3;function i(f){n=t(f).catch(()=>{}).finally(()=>{if(r){let{value:u}=r;r=null,i(u)}else n=null})}function s(f){r={event:f}}function a(f){n?s(f):i(f)}function c(f){o!==f&&requestAnimationFrame(()=>{let u=o;o=K3,a(u)}),o=f}return e?c:a}var du=class{constructor(e){this._filterBy=e,this._requestUpdate=hu(()=>this.requestQuery(),!0),this._coordinator=null}get coordinator(){return this._coordinator}set coordinator(e){this._coordinator=e}get filterBy(){return this._filterBy}get filterStable(){return!0}fields(){return null}fieldInfo(e){return this}query(e){return null}queryPending(){return this}queryResult(e){return this}queryError(e){return this}requestQuery(e){let n=e||this.query(this.filterBy?.predicate(this));return this._coordinator.requestQuery(this,n)}requestUpdate(){this._requestUpdate()}initialize(){return this._coordinator.initializeClient(this)}update(){return this}};var mu=Uint8Array.of(65,82,82,79,87,49),or={V1:0,V2:1,V3:2,V4:3,V5:4};var ir={NONE:0,Schema:1,DictionaryBatch:2,RecordBatch:3,Tensor:4,SparseTensor:5},B={Dictionary:-1,NONE:0,Null:1,Int:2,Float:3,Binary:4,Utf8:5,Bool:6,Decimal:7,Date:8,Time:9,Timestamp:10,Interval:11,List:12,Struct:13,Union:14,FixedSizeBinary:15,FixedSizeList:16,Map:17,Duration:18,LargeBinary:19,LargeUtf8:20,LargeList:21,RunEndEncoded:22,BinaryView:23,Utf8View:24,ListView:25,LargeListView:26},ic={HALF:0,SINGLE:1,DOUBLE:2},Fo={DAY:0,MILLISECOND:1},Ce={SECOND:0,MILLISECOND:1,MICROSECOND:2,NANOSECOND:3},sr={YEAR_MONTH:0,DAY_TIME:1,MONTH_DAY_NANO:2},Po={Sparse:0,Dense:1};var sc=Uint8Array,ad=Uint16Array,cd=Uint32Array,fd=BigUint64Array,gu=Int8Array,J3=Int16Array,Ln=Int32Array,zn=BigInt64Array,nb=Float32Array,Oi=Float64Array;function t4(t,e){let n=Math.log2(t)-3;return(e?[gu,J3,Ln,zn]:[sc,ad,cd,fd])[n]}var tj=Object.getPrototypeOf(Int8Array);function ac(t,e){let n=0,r=t.length;if(r<=2147483648)do{let o=n+r>>>1;t[o]<=e?n=o+1:r=o}while(n<r);else do{let o=Math.trunc((n+r)/2);t[o]<=e?n=o+1:r=o}while(n<r);return n}function ud(t,e,n){if(e(t))return t;throw new Error(n(t))}function On(t,e,n){return e=Array.isArray(e)?e:Object.values(e),ud(t,r=>e.includes(r),n??(()=>`${t} must be one of ${e}`))}function ld(t,e){for(let[n,r]of Object.entries(t))if(r===e)return n;return"<Unknown>"}var qo=t=>`Unsupported data type: "${ld(B,t)}" (id ${t})`,yu=(t,e,n=!0,r=null)=>({name:t,type:e,nullable:n,metadata:r});function e4(t){return Object.hasOwn(t,"name")&&n4(t.type)}function n4(t){return typeof t?.typeId=="number"}function $i(t,e="",n=!0){return e4(t)?t:yu(e,ud(t,n4,()=>"Data type expected."),n)}var pd=(t,e,n=!1,r=-1)=>({typeId:B.Dictionary,id:r,dictionary:t,indices:e||cc(),ordered:n});var hd=(t=32,e=!0)=>({typeId:B.Int,bitWidth:On(t,[8,16,32,64]),signed:e,values:t4(t,e)});var cc=()=>hd(32);var rb=(t=2)=>({typeId:B.Float,precision:On(t,ic),values:[ad,nb,Oi][t]});var ob=()=>({typeId:B.Binary,offsets:Ln}),dd=()=>({typeId:B.Utf8,offsets:Ln});var ib=(t,e,n=128)=>({typeId:B.Decimal,precision:t,scale:e,bitWidth:On(n,[128,256]),values:fd}),sb=t=>({typeId:B.Date,unit:On(t,Fo),values:t===Fo.DAY?Ln:zn});var ab=(t=Ce.MILLISECOND,e=32)=>({typeId:B.Time,unit:On(t,Ce),bitWidth:On(e,[32,64]),values:e===32?Ln:zn});var md=(t=Ce.MILLISECOND,e=null)=>({typeId:B.Timestamp,unit:On(t,Ce),timezone:e,values:zn}),cb=(t=sr.MONTH_DAY_NANO)=>({typeId:B.Interval,unit:On(t,sr),values:t===sr.MONTH_DAY_NANO?void 0:Ln}),gd=t=>({typeId:B.List,children:[$i(t)],offsets:Ln}),yd=t=>({typeId:B.Struct,children:Array.isArray(t)&&e4(t[0])?t:Object.entries(t).map(([e,n])=>yu(e,n))}),fb=(t,e,n,r)=>(n??=e.map((o,i)=>i),{typeId:B.Union,mode:On(t,Po),typeIds:n,typeMap:n.reduce((o,i,s)=>(o[i]=s,o),{}),children:e.map((o,i)=>$i(o,`_${i}`)),typeIdForValue:r,offsets:Ln}),ub=t=>({typeId:B.FixedSizeBinary,stride:t}),xd=(t,e)=>({typeId:B.FixedSizeList,stride:e,children:[$i(t)]}),r4=(t,e)=>({typeId:B.Map,keysSorted:t,children:[e],offsets:Ln});var lb=(t=Ce.MILLISECOND)=>({typeId:B.Duration,unit:On(t,Ce),values:zn}),pb=()=>({typeId:B.LargeBinary,offsets:zn}),hb=()=>({typeId:B.LargeUtf8,offsets:zn}),db=t=>({typeId:B.LargeList,children:[$i(t)],offsets:zn}),mb=(t,e)=>({typeId:B.RunEndEncoded,children:[ud($i(t,"run_ends"),n=>n.type.typeId===B.Int,()=>"Run-ends must have an integer type."),$i(e,"values")]});var gb=t=>({typeId:B.ListView,children:[$i(t,"value")],offsets:Ln}),yb=t=>({typeId:B.LargeListView,children:[$i(t,"value")],offsets:zn});var JC=new Oi(2),bd=JC.buffer,fj=new zn(bd),uj=new cd(bd),lj=new Ln(bd),pj=new sc(bd);function jr(t){if(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)throw Error(`BigInt exceeds integer number representation: ${t}`);return Number(t)}function wd(t,e){return Number(t/e)+Number(t%e)/Number(e)}var fc=t=>BigInt.asUintN(64,t);function i4(t,e){let n=e<<1,r;return BigInt.asIntN(64,t[n+1])<0?(r=fc(~t[n])|fc(~t[n+1])<<64n,r=-(r+1n)):r=t[n]|t[n+1]<<64n,r}function s4(t,e){let n=e<<2,r;return BigInt.asIntN(64,t[n+3])<0?(r=fc(~t[n])|fc(~t[n+1])<<64n|fc(~t[n+2])<<128n|fc(~t[n+3])<<192n,r=-(r+1n)):r=t[n]|t[n+1]<<64n|t[n+2]<<128n|t[n+3]<<192n,r}var eN=new TextDecoder("utf-8"),yj=new TextEncoder;function uc(t){return eN.decode(t)}var Ps=4;function xb(t,e){return(t[e>>3]&1<<e%8)!==0}function tn(t,e){let n=e+Bt(t,e),r=n-Bt(t,n),o=Ue(t,r);return(i,s,a=null)=>{if(i<o){let c=Ue(t,r+i);if(c)return s(t,n+c)}return a}}function Mr(t,e){return e}function Di(t,e){return!!nN(t,e)}function nN(t,e){return xu(t,e)<<24>>24}function xu(t,e){return t[e]}function Ue(t,e){return rN(t,e)<<16>>16}function rN(t,e){return t[e]|t[e+1]<<8}function Bt(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function a4(t,e){return Bt(t,e)>>>0}function Ne(t,e){return jr(BigInt.asIntN(64,BigInt(a4(t,e))+(BigInt(a4(t,e+Ps))<<32n)))}function qs(t,e){let n=e+Bt(t,e),r=Bt(t,n);return n+=Ps,uc(t.subarray(n,n+r))}function Yn(t,e,n,r){if(!e)return[];let o=e+Bt(t,e);return Array.from({length:Bt(t,o)},(i,s)=>r(t,o+Ps+s*n))}var bb=Symbol("rowIndex");function bu(t,e){class n{constructor(i){this[bb]=i}toJSON(){return c4(t,e,this[bb])}}let r=n.prototype;for(let o=0;o<t.length;++o){if(Object.hasOwn(r,t[o]))continue;let i=e[o];Object.defineProperty(r,t[o],{get(){return i.at(this[bb])},enumerable:!0})}return o=>new n(o)}function vd(t,e){return n=>c4(t,e,n)}function c4(t,e,n){let r={};for(let o=0;o<t.length;++o)r[t[o]]=e[o].at(n);return r}function f4(t){return t instanceof Fi}var Bs=class{static ArrayType=null;constructor({length:e,nullCount:n,type:r,validity:o,values:i,offsets:s,sizes:a,children:c}){this.length=e,this.nullCount=n,this.type=r,this.validity=o,this.values=i,this.offsets=s,this.sizes=a,this.children=c,(!n||!this.validity)&&(this.at=f=>this.value(f))}get[Symbol.toStringTag](){return"Batch"}at(e){return this.isValid(e)?this.value(e):null}isValid(e){return xb(this.validity,e)}value(e){return this.values[e]}slice(e,n){let r=n-e,o=Array(r);for(let i=0;i<r;++i)o[i]=this.at(e+i);return o}*[Symbol.iterator](){for(let e=0;e<this.length;++e)yield this.at(e)}},Fi=class extends Bs{constructor(e){super(e);let{length:n,values:r}=this;this.values=r.subarray(0,n)}slice(e,n){return this.nullCount?super.slice(e,n):this.values.subarray(e,n)}[Symbol.iterator](){return this.nullCount?super[Symbol.iterator]():this.values[Symbol.iterator]()}},wu=class extends Bs{static ArrayType=Oi},ee=class extends Bs{static ArrayType=Array},vu=class extends ee{value(e){return null}},Xr=class extends wu{value(e){return jr(this.values[e])}},_d=class extends wu{value(e){let n=this.values[e],r=(n&31744)>>10,o=(n&1023)/1024,i=(-1)**((n&32768)>>15);switch(r){case 31:return i*(o?Number.NaN:1/0);case 0:return i*(o?6103515625e-14*o:0)}return i*2**(r-15)*(1+o)}},Md=class extends ee{value(e){return xb(this.values,e)}},Sd=class extends Bs{constructor(e){super(e);let{bitWidth:n,scale:r}=this.type;this.decimal=n===128?i4:s4,this.scale=10n**BigInt(r)}},Ad=class extends Sd{static ArrayType=Oi;value(e){return wd(this.decimal(this.values,e),this.scale)}},Ed=class extends Sd{static ArrayType=Array;value(e){return this.decimal(this.values,e)}},_u=class extends ee{constructor(e){super(e),this.source=e}value(e){return new Date(this.source.value(e))}},Td=class extends wu{value(e){return 864e5*this.values[e]}},u4=Xr,Id=class extends Xr{value(e){return super.value(e)*1e3}},l4=Xr,Cd=class extends Xr{value(e){return wd(this.values[e],1000n)}},Nd=class extends Xr{value(e){return wd(this.values[e],1000000n)}},kd=class extends ee{value(e){return this.values.subarray(e<<1,e+1<<1)}},Rd=class extends ee{value(e){let n=this.values,r=e<<4;return Float64Array.of(Bt(n,r),Bt(n,r+4),Ne(n,r+8))}},p4=({values:t,offsets:e},n)=>t.subarray(e[n],e[n+1]),h4=({values:t,offsets:e},n)=>t.subarray(jr(e[n]),jr(e[n+1])),Ld=class extends ee{value(e){return p4(this,e)}},Od=class extends ee{value(e){return h4(this,e)}},$d=class extends ee{value(e){return uc(p4(this,e))}},Dd=class extends ee{value(e){return uc(h4(this,e))}},Fd=class extends ee{value(e){let n=this.offsets;return this.children[0].slice(n[e],n[e+1])}},Pd=class extends ee{value(e){let n=this.offsets;return this.children[0].slice(jr(n[e]),jr(n[e+1]))}},qd=class extends ee{value(e){let n=this.offsets[e],r=n+this.sizes[e];return this.children[0].slice(n,r)}},Bd=class extends ee{value(e){let n=this.offsets[e],r=n+this.sizes[e];return this.children[0].slice(jr(n),jr(r))}},zd=class extends ee{constructor(e){super(e),this.stride=this.type.stride}},Yd=class extends zd{value(e){let{stride:n,values:r}=this;return r.subarray(e*n,(e+1)*n)}},Ud=class extends zd{value(e){let{children:n,stride:r}=this;return n[0].slice(e*r,(e+1)*r)}};function d4({children:t,offsets:e},n){let[r,o]=t[0].children,i=e[n],s=e[n+1],a=[];for(let c=i;c<s;++c)a.push([r.at(c),o.at(c)]);return a}var jd=class extends ee{value(e){return d4(this,e)}},Xd=class extends ee{value(e){return new Map(d4(this,e))}},Mu=class extends ee{constructor({typeIds:e,...n}){super(n),this.typeIds=e,this.typeMap=this.type.typeMap}value(e,n=e){let{typeIds:r,children:o,typeMap:i}=this;return o[i[r[e]]].at(n)}},Wd=class extends Mu{value(e){return super.value(e,this.offsets[e])}},Su=class extends ee{constructor(e,n=vd){super(e),this.names=this.type.children.map(r=>r.name),this.factory=n(this.names,this.children)}value(e){return this.factory(e)}},Gd=class extends Su{constructor(e){super(e,bu)}},Vd=class extends ee{value(e){let[{values:n},r]=this.children;return r.at(ac(n,e))}},Hd=class extends ee{setDictionary(e){return this.dictionary=e,this.cache=e.cache(),this}value(e){return this.cache[this.key(e)]}key(e){return this.values[e]}},Qd=class extends ee{constructor({data:e,...n}){super(n),this.data=e}view(e){let{values:n,data:r}=this,o=e<<4,i=o+4,s=n,a=Bt(s,o);return a>12&&(i=Bt(s,o+12),s=r[Bt(s,o+8)]),s.subarray(i,i+a)}},Zd=class extends Qd{value(e){return this.view(e)}},Kd=class extends Qd{value(e){return uc(this.view(e))}};function wb(t){let e=[];return{add(n){return e.push(n),this},clear:()=>e=[],done:()=>new zs(e,t)}}var zs=class{constructor(e,n=e[0]?.type){this.type=n,this.length=e.reduce((i,s)=>i+s.length,0),this.nullCount=e.reduce((i,s)=>i+s.nullCount,0),this.data=e;let r=e.length,o=new Int32Array(r+1);if(r===1){let[i]=e;o[1]=i.length,this.at=s=>i.at(s)}else for(let i=0,s=0;i<r;++i)o[i+1]=s+=e[i].length;this.offsets=o}get[Symbol.toStringTag](){return"Column"}[Symbol.iterator](){let e=this.data;return e.length===1?e[0][Symbol.iterator]():oN(e)}at(e){let{data:n,offsets:r}=this,o=ac(r,e)-1;return n[o]?.at(e-r[o])}get(e){return this.at(e)}toArray(){let{length:e,nullCount:n,data:r}=this,o=!n&&f4(r[0]),i=r.length;if(o&&i===1)return r[0].values;let s=!i||n>0?Array:r[0].constructor.ArrayType??r[0].values.constructor,a=new s(e);return o?iN(a,r):sN(a,r)}cache(){return this._cache??(this._cache=this.toArray())}};function*oN(t){for(let e=0;e<t.length;++e){let n=t[e][Symbol.iterator]();for(let r=n.next();!r.done;r=n.next())yield r.value}}function iN(t,e){for(let n=0,r=0;n<e.length;++n){let{values:o}=e[n];t.set(o,r),r+=o.length}return t}function sN(t,e){let n=-1;for(let r=0;r<e.length;++r){let o=e[r];for(let i=0;i<o.length;++i)t[++n]=o.at(i)}return t}var lc=class t{constructor(e,n,r=!1){let o=e.fields.map(s=>s.name);this.schema=e,this.names=o,this.children=n,this.factory=r?bu:vd;let i=[];this.getFactory=s=>i[s]??(i[s]=this.factory(o,n.map(a=>a.data[s])))}get[Symbol.toStringTag](){return"Table"}get numCols(){return this.names.length}get numRows(){return this.children[0]?.length??0}getChildAt(e){return this.children[e]}getChild(e){let n=this.names.findIndex(r=>r===e);return n>-1?this.children[n]:void 0}selectAt(e,n=[]){let{children:r,factory:o,schema:i}=this,{fields:s}=i;return new t({...i,fields:e.map((a,c)=>aN(s[a],n[c]))},e.map(a=>r[a]),o===bu)}select(e,n){let r=this.names,o=e.map(i=>r.indexOf(i));return this.selectAt(o,n)}toColumns(){let{children:e,names:n}=this,r={};return n.forEach((o,i)=>r[o]=e[i]?.toArray()??[]),r}toArray(){let{children:e,getFactory:n,numRows:r}=this,o=e[0]?.data??[],i=Array(r);for(let s=0,a=-1;s<o.length;++s){let c=n(s);for(let f=0;f<o[s].length;++f)i[++a]=c(f)}return i}*[Symbol.iterator](){let{children:e,getFactory:n}=this,r=e[0]?.data??[];for(let o=0;o<r.length;++o){let i=n(o);for(let s=0;s<r[o].length;++s)yield i(s)}}at(e){let{children:n,getFactory:r,numRows:o}=this;if(e<0||e>=o)return null;let[{offsets:i}]=n,s=ac(i,e)-1;return r(s)(e-i[s])}get(e){return this.at(e)}};function aN(t,e){return e!=null&&e!==t.name?{...t,name:e}:t}function Au(t,e={}){let{typeId:n,bitWidth:r,precision:o,unit:i}=t,{useBigInt:s,useDate:a,useDecimalBigInt:c,useMap:f,useProxy:u}=e;switch(n){case B.Null:return vu;case B.Bool:return Md;case B.Int:case B.Time:case B.Duration:return s||r<64?Fi:Xr;case B.Float:return o?Fi:_d;case B.Date:return m4(i===Fo.DAY?Td:u4,a&&_u);case B.Timestamp:return m4(i===Ce.SECOND?Id:i===Ce.MILLISECOND?l4:i===Ce.MICROSECOND?Cd:Nd,a&&_u);case B.Decimal:return c?Ed:Ad;case B.Interval:return i===sr.DAY_TIME?kd:i===sr.YEAR_MONTH?Fi:Rd;case B.FixedSizeBinary:return Yd;case B.Utf8:return $d;case B.LargeUtf8:return Dd;case B.Binary:return Ld;case B.LargeBinary:return Od;case B.BinaryView:return Zd;case B.Utf8View:return Kd;case B.List:return Fd;case B.LargeList:return Pd;case B.Map:return f?Xd:jd;case B.ListView:return qd;case B.LargeListView:return Bd;case B.FixedSizeList:return Ud;case B.Struct:return u?Gd:Su;case B.RunEndEncoded:return Vd;case B.Dictionary:return Hd;case B.Union:return t.mode?Wd:Mu}throw new Error(qo(n))}function m4(t,e){return e?class extends e{constructor(r){super(new t(r))}}:t}function cN(t,e){return{offset:Ne(t,e),metadataLength:Bt(t,e+8),bodyLength:Ne(t,e+16)}}function vb(t,e){return Yn(t,e,24,cN)}function Jd(t,e,n){let r=tn(t,e);if(r(10,Mr,0))throw new Error("Record batch compression not implemented");let o=n<or.V4?8:0;return{length:r(4,Ne,0),nodes:Yn(t,r(6,Mr),16,(i,s)=>({length:Ne(i,s),nullCount:Ne(i,s+8)})),regions:Yn(t,r(8,Mr),16+o,(i,s)=>({offset:Ne(i,s+o),length:Ne(i,s+o+8)})),variadic:Yn(t,r(12,Mr),8,Ne)}}function g4(t,e,n){let r=tn(t,e);return{id:r(4,Ne,0),data:r(6,(o,i)=>Jd(o,i,n)),isDelta:r(8,Di,!1)}}function _b(t,e,n,r){On(n,B,qo);let o=tn(t,e);switch(n){case B.Binary:return ob();case B.Utf8:return dd();case B.LargeBinary:return pb();case B.LargeUtf8:return hb();case B.List:return gd(r[0]);case B.ListView:return gb(r[0]);case B.LargeList:return db(r[0]);case B.LargeListView:return yb(r[0]);case B.Struct:return yd(r);case B.RunEndEncoded:return mb(r[0],r[1]);case B.Int:return hd(o(4,Bt,0),o(6,Di,!1));case B.Float:return rb(o(4,Ue,ic.HALF));case B.Decimal:return ib(o(4,Bt,0),o(6,Bt,0),o(8,Bt,128));case B.Date:return sb(o(4,Ue,Fo.MILLISECOND));case B.Time:return ab(o(4,Ue,Ce.MILLISECOND),o(6,Bt,32));case B.Timestamp:return md(o(4,Ue,Ce.SECOND),o(6,qs));case B.Interval:return cb(o(4,Ue,sr.YEAR_MONTH));case B.Duration:return lb(o(4,Ue,Ce.MILLISECOND));case B.FixedSizeBinary:return ub(o(4,Bt,0));case B.FixedSizeList:return xd(r[0],o(4,Bt,0));case B.Map:return r4(o(4,Di,!1),r[0]);case B.Union:return fb(o(4,Ue,Po.Sparse),r,Yn(t,o(6,Mr),4,Bt))}return{typeId:n}}function Eu(t,e){let n=Yn(t,e,4,(r,o)=>{let i=tn(r,o);return[i(4,qs),i(6,qs)]});return n.length?new Map(n):null}function tm(t,e,n){let r=tn(t,e);return{version:n,endianness:r(4,Ue,0),fields:r(6,fN,[]),metadata:r(8,Eu)}}function fN(t,e){return Yn(t,e,4,y4)}function y4(t,e){let n=tn(t,e),r=n(8,xu,B.NONE),o=n(10,Mr,0),i=n(12,lN),s=n(14,(c,f)=>uN(c,f)),a=_b(t,o,r,s);return i&&(i.dictionary=a,a=i),{name:n(4,qs),type:a,nullable:n(6,Di,!1),metadata:n(16,Eu)}}function uN(t,e){let n=Yn(t,e,4,y4);return n.length?n:null}function lN(t,e){if(!e)return null;let n=tn(t,e);return pd(null,n(6,pN,cc()),n(8,Di,!1),n(4,Ne,0))}function pN(t,e){return _b(t,e,B.Int)}var hN=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,dN=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`,mN=t=>`Unsupported message type: ${t} (${ld(ir,t)})`;function em(t,e){let n=Bt(t,e)||0;if(e+=Ps,n===-1&&(n=Bt(t,e)||0,e+=Ps),n===0)return null;let r=t.subarray(e,e+=n);if(r.byteLength<n)throw new Error(hN(n,r.byteLength));let o=tn(r,0),i=o(4,Ue,or.V1),s=o(6,xu,ir.NONE),a=o(8,Mr,0),c=o(10,Ne,0),f;if(a){let u=s===ir.Schema?tm:s===ir.DictionaryBatch?g4:s===ir.RecordBatch?Jd:null;if(!u)throw new Error(mN(s));if(f=u(r,a,i),c>0){let p=t.subarray(e,e+=c);if(p.byteLength<c)throw new Error(dN(c,p.byteLength));f.body=p}}return{version:i,type:s,index:e,content:f}}function x4(t){let e=t instanceof ArrayBuffer?new Uint8Array(t):t;return e instanceof Uint8Array&&gN(e)?xN(e):yN(e)}function gN(t){if(!t||t.length<4)return!1;for(let e=0;e<6;++e)if(mu[e]!==t[e])return!1;return!0}function yN(t){let e=[t].flat(),n,r=[],o=[];for(let i of e){if(!(i instanceof Uint8Array))throw new Error("IPC data batch was not a Uint8Array.");let s=0;for(;;){let a=em(i,s);if(a===null)break;if(s=a.index,!!a.content)switch(a.type){case ir.Schema:n||(n=a.content);break;case ir.RecordBatch:r.push(a.content);break;case ir.DictionaryBatch:o.push(a.content);break}}}return{schema:n,dictionaries:o,records:r,metadata:null}}function xN(t){let e=t.byteLength-(mu.length+4),n=Bt(t,e),r=tn(t,e-n),o=r(4,Ue,or.V1),i=r(8,vb,[]),s=r(10,vb,[]);return{schema:r(6,(a,c)=>tm(a,c,o)),dictionaries:i.map(({offset:a})=>em(t,a).content),records:s.map(({offset:a})=>em(t,a).content),metadata:r(12,Eu)}}function Sb(t,e){return bN(x4(t),e)}function bN(t,e={}){let{schema:n={fields:[]},dictionaries:r,records:o}=t,{version:i,fields:s}=n,a=new Map,c=vN(e,i,a),f=new Map;wN(n,l=>{let h=l.type;h.typeId===B.Dictionary&&f.set(h.id,h.dictionary)});let u=new Map;for(let l of r){let{id:h,data:d,isDelta:m,body:g}=l,y=f.get(h),x=Mb(y,c({...d,body:g}));if(u.has(h)){let b=u.get(h);m||b.clear(),b.add(x)}else{if(m)throw new Error("Delta update can not be first dictionary batch.");u.set(h,wb(y).add(x))}}u.forEach((l,h)=>a.set(h,l.done()));let p=s.map(l=>wb(l.type));for(let l of o){let h=c(l);s.forEach((d,m)=>p[m].add(Mb(d.type,h)))}return new lc(n,p.map(l=>l.done()),e.useProxy)}function wN(t,e){t.fields.forEach(function n(r){e(r),r.type.dictionary?.children?.forEach(n),r.type.children?.forEach(n)})}function vN(t,e,n){let r={version:e,options:t,dictionary:o=>n.get(o)};return o=>{let{length:i,nodes:s,regions:a,variadic:c,body:f}=o,u=-1,p=-1,l=-1;return{...r,length:i,node:()=>s[++u],buffer:h=>{let{length:d,offset:m}=a[++p];return h?new h(f.buffer,f.byteOffset+m,d/h.BYTES_PER_ELEMENT):f.subarray(m,m+d)},variadic:()=>c[++l],visit(h){return h.map(d=>Mb(d.type,this))}}}}function Mb(t,e){let{typeId:n}=t,{length:r,options:o,node:i,buffer:s,variadic:a,version:c}=e,f=Au(t,o);if(n===B.Null)return new f({length:r,nullCount:r,type:t});let u={...i(),type:t};switch(n){case B.Bool:case B.Int:case B.Time:case B.Duration:case B.Float:case B.Decimal:case B.Date:case B.Timestamp:case B.Interval:case B.FixedSizeBinary:return new f({...u,validity:s(),values:s(t.values)});case B.Utf8:case B.LargeUtf8:case B.Binary:case B.LargeBinary:return new f({...u,validity:s(),offsets:s(t.offsets),values:s()});case B.BinaryView:case B.Utf8View:return new f({...u,validity:s(),values:s(),data:Array.from({length:a()},()=>s())});case B.List:case B.LargeList:case B.Map:return new f({...u,validity:s(),offsets:s(t.offsets),children:e.visit(t.children)});case B.ListView:case B.LargeListView:return new f({...u,validity:s(),offsets:s(t.offsets),sizes:s(t.offsets),children:e.visit(t.children)});case B.FixedSizeList:case B.Struct:return new f({...u,validity:s(),children:e.visit(t.children)});case B.RunEndEncoded:return new f({...u,children:e.visit(t.children)});case B.Dictionary:{let{id:p,indices:l}=t;return new f({...u,validity:s(),values:s(l.values)}).setDictionary(e.dictionary(p))}case B.Union:return c<or.V5&&s(),new f({...u,typeIds:s(gu),offsets:t.mode===Po.Sparse?null:s(t.offsets),children:e.visit(t.children)});default:throw new Error(qo(n))}}var WX=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;function Tu(t){return Sb(t,{useDate:!0})}function Ab(t="ws://localhost:3000/"){let e=[],n=!1,r=null,o,i={open(){n=!0,c()},close(){for(n=!1,r=null,o=null;e.length;)e.shift().reject("Socket closed")},error(f){if(r){let{reject:u}=r;r=null,c(),u(f)}else console.error("WebSocket error: ",f)},message({data:f}){if(r){let{query:u,resolve:p,reject:l}=r;if(r=null,c(),typeof f=="string"){let h=JSON.parse(f);h.error?l(h.error):p(h)}else if(u.type==="exec")p();else if(u.type==="arrow")p(Tu(f));else throw new Error(`Unexpected socket data: ${f}`)}else console.log("WebSocket message: ",f)}};function s(){o=new WebSocket(t),o.binaryType="arraybuffer";for(let f in i)o.addEventListener(f,i[f])}function a(f,u,p){o==null&&s(),e.push({query:f,resolve:u,reject:p}),n&&!r&&c()}function c(){e.length&&(r=e.shift(),o.send(JSON.stringify(r.query)))}return{get connected(){return n},query(f){return new Promise((u,p)=>a(f,u,p))}}}var pc="COLUMN_REF",nm="COLUMN_PARAM",A4="TABLE_REF",E4="LITERAL",T4="INTERVAL",rm="ORDER_BY",om="CAST",im="CASE",sm="WHEN",Eb="UNARY",I4="UNARY_POSTFIX",am="BINARY",cm="BETWEEN",fm="NOT_BETWEEN",um="LOGICAL_OPERATOR",lm="IN",pm="FUNCTION",Us="AGGREGATE",hc="WINDOW",hm="WINDOW_DEF",dm="WINDOW_FRAME",C4="EXPRESSION",dc="FRAGMENT",mm="VERBATIM",mc="PARAM",N4="WITH_CLAUSE",gm="SELECT_CLAUSE",ym="FROM_CLAUSE";var k4="SAMPLE_CLAUSE";var xm="WINDOW_CLAUSE";var bm="SELECT_QUERY",wm="DESCRIBE_QUERY",vm="SET_OPERATION";function en(t){return t instanceof fe}var fe=class{constructor(e){this.type=e}},xt=class extends fe{};var js=class extends xt{constructor(e){super(E4),this.value=e}toString(){return Tb(this.value)}};function Tb(t){switch(typeof t){case"number":return Number.isFinite(t)?`${t}`:"NULL";case"string":return`'${t.replace("'","''")}'`;case"boolean":return t?"TRUE":"FALSE";default:if(t==null)return"NULL";if(t instanceof Date){let e=+t;if(Number.isNaN(e))return"NULL";let n=t.getUTCFullYear(),r=t.getUTCMonth(),o=t.getUTCDate();return e===Date.UTC(n,r,o)?`DATE '${n}-${r+1}-${o}'`:`epoch_ms(${e})`}else return t instanceof RegExp?`'${t.source}'`:`${t}`}}var Sr=class extends xt{constructor(e){super(mc),this.param=e}get value(){return this.param.value}toString(){return Tb(this.value)}};function Ib(t){return t.split(".")}function Ar(t){return`"${t}"`}function _m(t){return t&&jN(t)?t.slice(1,-1):t}function jN(t){return t[0]==='"'&&t[t.length-1]==='"'}function Pi(t){return t instanceof gc}var gc=class extends xt{constructor(e){super(A4),this.table=[e].flat()}get name(){return this.table[this.table.length-1]}toString(){return this.table.map(e=>Ar(e)).join(".")}};var Xs=class extends xt{constructor(e,n=[]){super(pm),this.name=e,this.args=n}toString(){let{name:e,args:n}=this;return`${e}(${n.join(", ")})`}};function je(t,...e){return new Xs(t,Mm(e).map(Tt))}function nn(t,...e){return new Cu(t,Mm(e).map(Tt))}function R4(t,...e){return new Ws(new Iu(t,Mm(e).map(Tt)))}function $n(t,e=Tt){return t.flat().filter(n=>n!=null).map(n=>e(n))}function Mm(t){let e=t.length,n=e;for(;n>0&&t[n-1]===void 0;--n);return n<e?t.slice(0,n):t}function ar(t){return typeof t=="string"}function Nu(t){return Array.isArray(t)}function Er(t){return t&&typeof t.addEventListener=="function"&&t.dynamic!==!1&&"value"in t}var Ru=class extends fe{constructor(e,n){super(xm),this.name=e,this.def=n}toString(){return`${Ar(this.name)} AS ${this.def}`}},Ws=class t extends xt{constructor(e,n=new Gs){super(hc),this.func=e,this.def=n}over(e){return new t(this.func,this.def.over(e))}partitionby(...e){return new t(this.func,this.def.partitionby(...e))}orderby(...e){return new t(this.func,this.def.orderby(...e))}rows(e){return new t(this.func,this.def.rows(e))}range(e){return new t(this.func,this.def.range(e))}toString(){return`${this.func} OVER ${this.def}`}},Iu=class extends Xs{constructor(e,n){super(e,n)}},Gs=class extends fe{constructor(e,n,r,o){super(hm),this.name=e,this.partition=n,this.order=r,this.frame=o}over(e){return ku(this,{name:e})}partitionby(...e){return ku(this,{partition:$n(e)})}orderby(...e){return ku(this,{order:$n(e)})}rows(e){return ku(this,{frame:new Lu(e)})}range(e){return ku(this,{frame:new Lu(e,!0)})}toString(){let{name:e,partition:n,order:r,frame:o}=this,i=e&&Ar(e),s=[i,n?.length&&`PARTITION BY ${n.join(", ")}`,r?.length&&`ORDER BY ${r.join(", ")}`,o].filter(a=>a);return i&&s.length<2?i:`(${s.join(" ")})`}},Lu=class extends fe{constructor(e,n=!1,r=void 0){super(dm),this.extent=Er(e)?new Sr(e):e,this.range=n,this.exclude=r}toString(){let{range:e,exclude:n,extent:r}=this,o=e?"RANGE":"ROWS",[i,s]=en(r)?r.value:r,a=L4(i,"PRECEDING"),c=L4(s,"FOLLOWING");return`${o} BETWEEN ${a} AND ${c}${n?` ${n}`:""}`}};function ku(t,e){return new Gs(e.name??t.name,e.partition??t.partition,e.order??t.order,e.frame??t.frame)}function L4(t,e){return t===0?"CURRENT ROW":Number.isFinite(t)?`${Math.abs(t)} ${e}`:`UNBOUNDED ${e}`}function qi(t){return t instanceof zo}var zo=class extends xt{constructor(e,n){super(e),this.table=n}get column(){return null}toString(){let{column:e,table:n}=this,r=`${n??""}`,o=e==="*"?"*":Ar(e);return(r?r+".":"")+o}},Ou=class extends zo{constructor(e,n){super(pc,n),this.name=e}get column(){return this.name}};var $u=class extends zo{constructor(e,n){super(nm,n),this.param=e}get column(){return`${this.param.value}`}};function Du(t,e){let n=Vs(e);return Er(t)?new $u(new Sr(t),n):new Ou(t,n)}var Hs=class extends xt{constructor(e){super(mm),this.value=e}toString(){return this.value}};function mn(t){return new js(t)}function O4(t){return new Hs(t)}function Sm(...t){let e=$n(t,String);return e?.length?new gc(e):void 0}function Tt(t){return ar(t)?XN(t):Fu(t)}function Qs(t){return ar(t)?O4(t):Fu(t)}function Fu(t){return t instanceof xt?t:Er(t)?new Sr(t):mn(t)}function Vs(t){return ar(t)?WN(t):Nu(t)?Sm(t):t}function XN(t){let e=Ib(t);return Du(e.pop(),Sm(e))}function WN(t){return Sm(Ib(t))}function Cb(){return new Gs}var Cu=class t extends xt{constructor(e,n,r,o){super(Us),this.name=e,this.args=n,this.isDistinct=r,this.filter=o}distinct(e=!0){return new t(this.name,this.args,e,this.filter)}where(e){return ar(e)&&(e=Qs(e)),new t(this.name,this.args,this.isDistinct,e)}window(){return new Ws(this)}partitionby(...e){return this.window().partitionby(...e)}orderby(...e){return this.window().orderby(...e)}toString(){let{name:e,args:n,isDistinct:r,filter:o}=this,i=r?"DISTINCT ":"",s=n?.length?n.join(", "):"*",a=o?` FILTER (WHERE ${o})`:"";return`${e}(${i}${s})${a}`}},$4=["any_value","approx_count_distinct","approx_quantile","arbitrary","arg_max","arg_max_null","arg_min","arg_min_null","array_agg","avg","bit_and","bit_or","bit_xor","bitstring_agg","bool_and","bool_or","corr","count","covar_pop","covar_samp","entropy","favg","first","fsum","geomean","kurtosis_pop","kurtosis","last","mad","max","max_by","median","min","min_by","mode","product","quantile","quantile_cont","quantile_disc","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_sxx","regr_sxy","regr_syy","regr_slope","reservoir_quantile","skewness","stddev","stddev_pop","stddev_samp","string_agg","sum","variance","var_pop","var_samp"];var Am=class extends xt{constructor(e,n,r){super(e),this.expr=n,this.extent=r}toSQL(e){let{extent:n,expr:r}=this;return n?`(${r} ${e} ${n[0]} AND ${n[1]})`:""}},Zs=class extends Am{constructor(e,n){super(cm,e,n)}toString(){return super.toSQL("BETWEEN")}},Pu=class extends Am{constructor(e,n){super(fm,e,n)}toString(){return super.toSQL("NOT BETWEEN")}};var qu=class extends xt{constructor(e,n,r){super(am),this.op=e,this.left=n,this.right=r}toString(){return`(${this.left} ${this.op} ${this.right})`}};var yc=class t extends xt{constructor(e=void 0,n=[],r=void 0){super(im),this.expr=e,this._when=n,this._else=r}when(e,n){return new t(this.expr,this._when.concat(new xc(Tt(e),Tt(n))),this._else)}else(e){return new t(this.expr,this._when,Tt(e))}toString(){return"CASE "+(this.expr?`${this.expr} `:"")+this._when.join(" ")+(this._else?` ELSE ${this._else}`:"")+" END"}},xc=class extends fe{constructor(e,n){super(sm),this.when=e,this.then=n}toString(){return`WHEN ${this.when} THEN ${this.then}`}};var Bu=class extends xt{constructor(e,n){super(om),this.expr=e,this.cast=n}toString(){return`(${this.expr})::${this.cast}`}};var zu=class extends xt{constructor(e){super(dc),this.spans=e}toString(){return this.spans.join("")}};var Yu=class extends fe{constructor(e,n=!1,r=void 0,o=void 0){super(k4),this.size=e,this.perc=n,this.method=r,this.seed=o}toString(){let{size:e,perc:n,method:r,seed:o}=this,i=n?"%":" ROWS",s=o!=null?`, ${o}`:"";return`${e}${i}${r?` (${r}${s})`:""}`}};var Uu=class extends fe{constructor(e,n){super(gm),this.expr=e,this.alias=n}toString(){let{expr:e,alias:n}=this;return!n||GN(e,n)?`${e}`:`${e} AS ${Ar(n)}`}};function GN(t,e){return t instanceof zo&&t.table==null&&t.column===e}var ju=class extends fe{constructor(e,n){super(N4),this.name=e,this.query=n}toString(){return`"${this.name}" AS (${this.query})`}};function Em(t){return t instanceof yt}function Bi(t){return t instanceof Js}function Nb(t){return t instanceof Xu}var yt=class extends xt{static select(...e){return new Js().select(...e)}static from(...e){return new Js().from(...e)}static with(...e){return new Js().with(...e)}static union(...e){return new Ks("UNION",e.flat())}static unionAll(...e){return new Ks("UNION ALL",e.flat())}static intersect(...e){return new Ks("INTERSECT",e.flat())}static except(...e){return new Ks("EXCEPT",e.flat())}static describe(e){return new Xu(e)}constructor(e){super(e),this._orderby=[],this._limit=void 0,this._offset=void 0,this.cteFor=null}get subqueries(){return[]}clone(){return this}orderby(...e){return this._orderby=this._orderby.concat($n(e)),this}limit(e){return this._limit=Number.isFinite(e)?e:void 0,this}offset(e){return this._offset=Number.isFinite(e)?e:void 0,this}},Js=class t extends yt{constructor(){super(bm),this._with=[],this._select=[],this._from=[],this._where=[],this._sample=void 0,this._groupby=[],this._having=[],this._window=[],this._qualify=[]}get subqueries(){let e=this.cteFor||this,r=(e instanceof t?e._with:[]).reduce((i,s)=>(i[s.name]=s.query,i),{}),o=[];return this._from.forEach(({expr:i})=>{if(Em(i))o.push(i);else if(Pi(i)){let s=r[i.name];s&&o.push(s)}}),o}clone(){return Object.assign(new t,this)}with(...e){let n=[],r=(o,i)=>{let s=i.clone();s.cteFor=this,n.push(new ju(o,s))};return e.flat().forEach(o=>{if(o!=null)for(let i in o)r(i,o[i])}),this._with=this._with.concat(n),this}select(...e){let n=[],r=(i,s)=>n.push(new Uu(i==null?i:Tt(i),_m(s)));e.flat().forEach(i=>{if(i!=null)if(ar(i))r(i,i);else if(qi(i))r(i,i.column);else if(Nu(i))r(i[1],i[0]);else for(let s in i)r(i[s],s)});let o=new Set(n.map(i=>i.alias));return this._select=this._select.filter(i=>!o.has(i.alias)).concat(n.filter(i=>i.expr)),this}setSelect(...e){return this._select=[],this.select(...e)}distinct(e=!0){return this._distinct=!!e,this}from(...e){let n=[],r=(o,i)=>n.push(new Wu(Vs(o),_m(i)));return e.flat().forEach(o=>{if(o!=null)if(ar(o))r(o,o);else if(Pi(o))r(o,o.name);else if(en(o))r(o);else if(Nu(o))r(o[1],o[0]);else for(let i in o)r(o[i],i)}),this._from=this._from.concat(n),this}setFrom(...e){return this._from=[],this.from(...e)}sample(e,n,r){let o;if(typeof e=="number"){let i=e>0&&e<1,s=i?e*100:Math.floor(e);o=new Yu(s,i,n,r)}else o=e;return this._sample=o,this}where(...e){return this._where=this._where.concat($n(e,Qs)),this}setWhere(...e){return this._where=[],this.where(...e)}groupby(...e){return this._groupby=this._groupby.concat($n(e)),this}setGroupby(...e){return this._groupby=[],this.groupby(...e)}having(...e){return this._having=this._having.concat($n(e,Qs)),this}window(...e){let n=[];return e.flat().forEach(r=>{if(r!=null)for(let o in r)n.push(new Ru(_m(o),r[o]))}),this._window=this._window.concat(n),this}qualify(...e){return this._qualify=this._qualify.concat($n(e,Qs)),this}toString(){let{_with:e,_select:n,_distinct:r,_from:o,_sample:i,_where:s,_groupby:a,_having:c,_window:f,_qualify:u,_orderby:p,_limit:l,_offset:h}=this,d=[];if(e.length&&d.push(`WITH ${e.join(", ")}`),d.push(`SELECT${r?" DISTINCT":""} ${n.join(", ")}`),o.length&&d.push(`FROM ${o.join(", ")}`),s.length){let m=s.map(String).filter(g=>g).join(" AND ");m&&d.push(`WHERE ${m}`)}if(i&&d.push(`USING SAMPLE ${i}`),a.length&&d.push(`GROUP BY ${a.join(", ")}`),c.length){let m=c.map(String).filter(g=>g).join(" AND ");m&&d.push(`HAVING ${m}`)}if(f.length&&d.push(`WINDOW ${f.join(", ")}`),u.length){let m=u.map(String).filter(g=>g).join(" AND ");m&&d.push(`QUALIFY ${m}`)}return p.length&&d.push(`ORDER BY ${p.join(", ")}`),Number.isFinite(l)&&d.push(`LIMIT ${l}`),Number.isFinite(h)&&d.push(`OFFSET ${h}`),d.join(" ")}},Xu=class t extends fe{constructor(e){super(wm),this.query=e}clone(){return new t(this.query.clone())}toString(){return`DESCRIBE ${this.query}`}},Ks=class t extends yt{constructor(e,n){super(vm),this.op=e,this.queries=n}get subqueries(){let{queries:e,cteFor:n}=this;return n&&e.forEach(r=>r.cteFor=n),e}clone(){let{op:e,queries:n,...r}=this;return Object.assign(new t(e,n),r)}toString(){let{op:e,queries:n,_orderby:r,_limit:o,_offset:i}=this,s=[n.join(` ${e} `)];return r.length&&s.push(`ORDER BY ${r.join(", ")}`),Number.isFinite(o)&&s.push(`LIMIT ${o}`),Number.isFinite(i)&&s.push(`OFFSET ${i}`),s.join(" ")}};var Wu=class extends fe{constructor(e,n){super(ym),this.expr=e,this.alias=n}toString(){let{expr:e,alias:n}=this,r=Em(e)?`(${e})`:`${e}`;return n&&!(Pi(e)&&e.table.join(".")===n)?`${r} AS ${Ar(n)}`:`${r}`}};var Gu=class extends xt{constructor(e,n){super(lm),this.expr=e,this.values=n}toString(){return`(${this.expr} IN (${this.values.join(", ")}))`}};var Vu=class extends xt{constructor(e,n=1){super(T4),this.name=e,this.steps=n}toString(){return`INTERVAL ${this.steps} ${this.name}`}};var Tm=class extends xt{constructor(e,n){super(um),this.op=e,this.clauses=n}toString(){let e=this.clauses;return e.length===0?"":e.length===1?`${e[0]}`:`(${e.join(` ${this.op} `)})`}},Hu=class extends Tm{constructor(e){super("AND",e)}},Qu=class extends Tm{constructor(e){super("OR",e)}};var Zu=class extends xt{constructor(e,n,r){super(rm),this.expr=e,this.desc=n,this.nullsFirst=r}toString(){let{expr:e,desc:n,nullsFirst:r}=this;return`${e}${n?" DESC":n===!1?" ASC":""}${r?" NULLS FIRST":r===!1?" NULLS LAST":""}`}};var kb=class extends xt{constructor(e,n,r){super(e),this.op=n,this.expr=r}};var Ku=class extends kb{constructor(e,n){super(I4,e,n)}toString(){return`(${this.expr} ${this.op})`}};function bc(t,e){return nn("arg_max",t,e)}function wc(t,e){return nn("arg_min",t,e)}function Rb(t){return nn("avg",t)}function rn(t){return nn("count",t)}function Un(t){return nn("max",t)}function Wr(t){return nn("min",t)}function Ju(t,e){return nn("regr_avgx",t,e)}function Lb(t,e){return nn("regr_avgy",t,e)}function tl(t,e){return nn("regr_count",t,e)}function Ob(t,e){return nn("regr_intercept",t,e)}function $b(t,e){return nn("regr_sxx",t,e)}function Db(t,e){return nn("regr_syy",t,e)}function Fb(t,e){return nn("regr_slope",t,e)}function Pb(t){return nn("stddev",t)}function zt(t){return nn("sum",t)}function Yo(t,e,n){return t?new yc(void 0,[new xc(Tt(t),Tt(e))],Tt(n)):new yc}function qb(t,e){return new Bu(Tt(t),e)}function Ht(t){return qb(t,"INTEGER")}function de(t){return qb(t,"DOUBLE")}function Im(t,e){return new Vu(t,e)}function Bb(t){return je("epoch_ms",t)}function zb(t,e,n=1){return je("time_bucket",Im(e,n),t)}function Yb(...t){return je("greatest",...t)}function Cm(t){return je("exp",t)}function Ub(t){return je("log",t)}function vc(t){return je("ln",t)}function Tr(t){return je("sign",t)}function ke(t){return je("abs",t)}function Uo(t){return je("sqrt",t)}function jb(t){return je("ceil",t)}function Re(t){return je("floor",t)}function jo(t,e){return je("round",t,e)}function D4(t,e){return new Ku(t,Tt(e))}function Ir(t,e,n){return new qu(t,Tt(e),Tt(n))}function HN(t,e,n=!1){let r=n?Pu:Zs;return new r(Tt(t),e?.map(Tt))}function Dn(...t){return new Hu($n(t))}function Gr(...t){return new Qu($n(t))}function el(t){return D4("IS NULL",t)}function Vr(t){return D4("IS NOT NULL",t)}function nl(t,e){return Ir("&",t,e)}function Nt(t,e){return Ir("+",t,e)}function ut(t,e){return Ir("-",t,e)}function pt(t,e){return Ir("*",t,e)}function Lt(t,e){return Ir("/",t,e)}function me(t,e){return Ir("**",t,e)}function Xo(t,e){return Ir("<>",t,e)}function ue(t,e){return Ir("<",t,e)}function Hr(t,e){return Ir(">",t,e)}function Cr(t,e){return Ir("<=",t,e)}function Xb(t,e){return Ir("IS NOT DISTINCT FROM",t,e)}function gn(t,e){return HN(t,e,!1)}function Nm(t,e){return new Gu(Tt(t),e.map(Tt))}function Wb(t,e){return new Zu(Tt(t),!1,e)}function Gb(t){return je("st_asgeojson",t)}function Ae(t,...e){return new zu(QN(t,e))}function QN(t,e){let n=[t[0]],r=e.length;for(let o=0,i=0;o<r;){let s=e[o];en(s)?n[++i]=s:Er(s)?n[++i]=new Sr(s):n[i]+=ar(s)?s:mn(s);let a=t[++o];en(n[i])?n[++i]=a:n[i]+=a}return n.filter(o=>o).map(o=>ar(o)?new Hs(o):o)}function km(t,e,n){return R4("lead",t,e,n)}var Rm={[Us]:["args","filter"],[cm]:["expr","extent"],[am]:["left","right"],[im]:["expr","_when","_else"],[om]:["expr"],[nm]:["param","table"],[pc]:["table"],[wm]:["query"],[C4]:["node"],[dc]:["spans"],[ym]:["expr"],[pm]:["args"],[lm]:["expr","values"],[um]:["clauses"],[fm]:["expr","extent"],[rm]:["expr"],[mc]:["value"],[gm]:["expr"],[bm]:["_with","_select","_from","_where","_sample","_groupby","_having","_window","_qualify","_orderby"],[vm]:["subqueries","_orderby"],[Eb]:["expr"],[sm]:["when","then"],[hc]:["func","def"],[xm]:["def"],[hm]:["partition","order","frame"],[dm]:["extent"]};function rl(t,e){if(e.has(t))return e.get(t);if(en(t)){let n=Rm[t.type],r=n?.length??0;for(let o=0;o<r;++o){let i=n[o],s=t[i];if(Array.isArray(s)){let a=s.length;for(let c=0;c<a;++c)s[c]=rl(s[c],e)}else s&&(t[i]=rl(s,e))}}return t}function Qr(t,e){if(!en(t))return;let n=e(t);if(n)return n;let r=Rm[t.type],o=r?.length??0;for(let i=0;i<o;++i){let s=t[r[i]];if(Array.isArray(s)){let a=s.length;for(let c=0;c<a;++c)if(s[c]&&+Qr(s[c],e)<0)return n}else if(s&&+Qr(s,e)<0)return-1}}var ZN=new RegExp(`^(${$4.join("|")})$`),KN=/(\\'|\\"|"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\w+\()/g;function JN(t){return t.split(KN).some(e=>e.endsWith("(")&&ZN.test(e.slice(0,-1)))}function jn(t){let e=0;return Qr(t,n=>{switch(n.type){case hc:return-1;case Us:return e|=1,-1;case dc:case mm:{let r=`${n}`.toLowerCase(),o=r.indexOf("(select ");return o>=0&&(r=r.slice(0,o)),r.includes(") over ")?-1:JN(r)?(e|=2,-1):1}}}),e}function Vb(t){let e=new Set;return Qr(t,n=>{n.type===Us&&e.add(n)}),Array.from(e)}function _c(t){let e={};return Qr(t,n=>{n.type===pc&&(e[n]=n)}),Object.values(e)}function Hb(t){let e=new Set;return Qr(t,n=>{n.type===mc&&e.add(n.param)}),Array.from(e)}function Lm(t,e,{replace:n=!1,temp:r=!1,view:o=!1}={}){return"CREATE"+(n?" OR REPLACE ":" ")+(r?"TEMP ":"")+(o?"VIEW":"TABLE")+(n?" ":" IF NOT EXISTS ")+t+" AS "+e}function Qb(t,e,n,r,o){let i=o?ut(n,de(t)):ut(de(t),e),s=n===e?0:r/(n-e);return s?pt(i,de(s)):i}function Zb(t,e,n,r,o,i){return t.select({index:Nt(Ht(Re(e)),pt(Ht(Re(n)),o)),...r}).groupby("index",i)}function Kb(t,e,n){let r=n?s=>pt(s,n):s=>s,o=Re(e),i=Nt(o,1);return yt.from(yt.unionAll(t.clone().select({i:Ht(o),w:r(ut(i,e))}),t.clone().select({i:Ht(i),w:r(ut(e,o))}))).select({index:"i",density:zt("w")}).groupby("index").having(Xo("density",0))}function tk(t){return t}function Jb(t,e,n,r,o,i){let s=r?y=>pt(y,r):tk,a=(y,x)=>t.clone().select({xp:e,yp:n,i:y,w:x}),c=(y,x)=>Nt(y,pt(x,o)),f=Ht(Re(e)),u=Ht(Re(n)),p=Nt(f,1),l=Nt(u,1),h=ut(e,f),d=ut(p,e),m=ut(n,u),g=ut(l,n);return yt.from(yt.unionAll(a(c(f,u),s(pt(d,g))),a(c(f,l),s(pt(d,m))),a(c(p,u),s(pt(h,g))),a(c(p,l),s(pt(h,m))))).select({index:"i",density:zt("w")},i).groupby("index",i).having(Xo("density",0))}function t2(t,e,n,r,o,i,s=[],a=!0){t.select({x:Ht(Re(e)),y:Ht(Re(n))});let c=s.concat(r),f=yt.from(t).select(c,{x0:"x",y0:"y",dx:ut(km("x").over("sw"),"x"),dy:ut(km("y").over("sw"),"y")}).window({sw:Cb().partitionby(c).orderby(Wb("x"))}).qualify([Gr(ue("x0",o),ue(Nt("x0","dx"),o)),Gr(ue("y0",i),ue(Nt("y0","dy"),i)),Gr(Hr("x0",0),Hr(Nt("x0","dx"),0)),Gr(Hr("y0",0),Hr(Nt("y0","dy"),0))]),u=yt.select({x:Yb(Un(ke("dx")),Un(ke("dy")))}).from("pairs"),p=yt.select({i:Ht(Ae`UNNEST(range((${u})))`)}),l=yt.unionAll(yt.select(c,{x:Nt("x0","i"),y:Nt("y0",Ht(jo(Lt(pt("i","dy"),"dx"))))}).from("pairs","indices").where([Cr(ke("dy"),ke("dx")),ue("i",ke("dx"))]),yt.select(c,{x:Nt("x0",Ht(jo(Lt(pt(pt(Tr("dy"),"i"),"dx"),"dy")))),y:Nt("y0",pt(Tr("dy"),"i"))}).from("pairs","indices").where([Hr(ke("dy"),ke("dx")),ue("i",ke("dy"))]),yt.select(c,{x:"x0",y:"y0"}).from("pairs").where(el("dx"))),h=yt.from("raster").select(c,"x","y",a?{w:Lt(1,rn().partitionby(["x"].concat(c)))}:null).where([Cr(0,"x"),ue("x",o),Cr(0,"y"),ue("y",i)]);return yt.with({pairs:f,indices:p,raster:l,points:h}).from("points").select(s,{index:Nt("x",pt("y",Ht(o))),density:a?zt("w"):rn()}).groupby("index",s)}function e2(t,e,n,r,o=[]){let i=Ht(Re(e)),s=a=>yt.from(t).select(a).groupby(i,o);return yt.union(s([{[n]:Wr(n),[r]:wc(r,n)},...o]),s([{[n]:Un(n),[r]:bc(r,n)},...o]),s([{[n]:wc(n,r),[r]:Wr(r)},...o]),s([{[n]:bc(n,r),[r]:Un(r)},...o])).orderby(o,n)}var Om=t=>t;function F4(){return{apply:Om,invert:Om,sqlApply:Tt,sqlInvert:Om}}function ek({base:t=null}={}){if(t==null||t===Math.E)return{apply:Math.log,invert:Math.exp,sqlApply:e=>vc(e),sqlInvert:e=>Cm(e)};if(t===10)return{apply:Math.log10,invert:e=>Math.pow(10,e),sqlApply:e=>Ub(e),sqlInvert:e=>me(10,e)};{let e=+t;return{apply:n=>Math.log(n)/Math.log(e),invert:n=>Math.pow(e,n),sqlApply:n=>Lt(vc(n),vc(e)),sqlInvert:n=>me(e,n)}}}function nk({constant:t=1}={}){let e=+t;return{apply:n=>Math.sign(n)*Math.log1p(Math.abs(n)),invert:n=>Math.sign(n)*Math.exp(Math.abs(n)-e),sqlApply:n=>(n=Tt(n),pt(Tr(n),vc(Nt(e,ke(n))))),sqlInvert:n=>pt(Tr(n),ut(Cm(ke(n)),e))}}function rk(){return{apply:t=>Math.sign(t)*Math.sqrt(Math.abs(t)),invert:t=>Math.sign(t)*t*t,sqlApply:t=>(t=Tt(t),pt(Tr(t),Uo(ke(t)))),sqlInvert:t=>pt(Tr(t),me(t,2))}}function ok({exponent:t=1}={}){let e=+t;return{apply:n=>Math.sign(n)*Math.pow(Math.abs(n),e),invert:n=>Math.sign(n)*Math.pow(Math.abs(n),1/e),sqlApply:n=>(n=Tt(n),pt(Tr(n),me(ke(n),e))),sqlInvert:n=>pt(Tr(n),me(ke(n),Lt(1,e)))}}function P4(){return{apply:t=>+t,invert:t=>new Date(t),sqlApply:t=>t instanceof Date?mn(+t):sk(t)?mn(+t.value):Bb(t),sqlInvert:Om}}var ik={identity:F4,linear:F4,log:ek,symlog:nk,sqrt:rk,pow:ok,time:P4,utc:P4};function ol(t){let e=ik[t.type];return e?{...t,...e(t)}:null}function sk(t){return t instanceof js&&t.value instanceof Date}function $m(t){let e=2166136261;for(let n=0,r=t.length;n<r;++n){let o=t.charCodeAt(n),i=o&65280;i&&(e=q4(e^i>>8)),e=q4(e^o&255)}return lk(e)>>>0}function q4(t){return t+(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)}function lk(t){return t+=t<<13,t^=t>>>7,t+=t<<3,t^=t>>>17,t+=t<<5,t&4294967295}function z4(t,e,n){switch(t.name){case"count":case"sum":return pk(e,t);case"avg":return hk(e,t);case"arg_max":return dk(e,t);case"arg_min":return mk(e,t);case"variance":case"var_samp":return Dm(e,t,n);case"var_pop":return Dm(e,t,n,!1);case"stddev":case"stddev_samp":return Uo(Dm(e,t,n));case"stddev_pop":return Uo(Dm(e,t,n,!1));case"covar_samp":return Fm(e,t,n);case"covar_pop":return Fm(e,t,n,!1);case"corr":return B4(e,t,n);case"regr_count":return Mc(e,t).expr;case"regr_avgx":return X4(e,t);case"regr_avgy":return W4(e,t);case"regr_syy":return r2(e,0,t,n);case"regr_sxx":return r2(e,1,t,n);case"regr_sxy":return Fm(e,t,n,null);case"regr_slope":return G4(e,t,n);case"regr_intercept":return gk(e,t,n);case"regr_r2":return me(B4(e,t,n),2);case"max":case"min":case"bit_and":case"bit_or":case"bit_xor":case"bool_and":case"bool_or":case"product":{let r=Y4(t);return e[r]=t,Ae`${t.name}("${r}")`}default:return null}}function Y4(t){return"pre_"+$m(`${t}`).toString(16)}function yn(t,e,n){let r=n?.filter;r&&(e=e.filter?e.where(Dn(r,e.filter)):e.where(r));let o=Y4(e);return t[o]=e,o}function U4(t,e){let n=yn(t,rn(e.args[0]),e);return{expr:zt(n),name:n}}function pk(t,e){return zt(yn(t,e))}function hk(t,e){let n=yn(t,e),{expr:r,name:o}=U4(t,e);return Lt(zt(pt(n,o)),r)}function dk(t,e){let n=yn(t,e),r=yn(t,Un(e.args[1]),e);return bc(n,r)}function mk(t,e){let n=yn(t,e),r=yn(t,Wr(e.args[1]),e);return wc(n,r)}function Dm(t,e,n,r=!0){let o=e.args[0],{expr:i}=U4(t,e),s=ut(o,n(o)),a=yn(t,zt(me(s,2)),e),c=yn(t,zt(s),e),f=r?ut(i,1):i;return Lt(ut(zt(a),Lt(me(zt(c),2),i)),f)}function Fm(t,e,n,r=!0){let{expr:o}=Mc(t,e),i=j4(t,e,n),s=il(t,1,e,n),a=il(t,0,e,n),c=ut(i,Lt(pt(s,a),o));return r===null?c:r?Lt(c,ut(o,1)):Lt(c,o)}function B4(t,e,n){let{expr:r}=Mc(t,e),o=j4(t,e,n),i=n2(t,1,e,n),s=n2(t,0,e,n),a=il(t,1,e,n),c=il(t,0,e,n),f=ut(i,Lt(me(a,2),r)),u=ut(s,Lt(me(c,2),r));return Lt(ut(o,Lt(pt(a,c),r)),Uo(pt(f,u)))}function Mc(t,e){let[n,r]=e.args,o=yn(t,tl(n,r),e);return{expr:zt(o),name:o}}function il(t,e,n,r){let o=n.args,i=o[e],s=o[1-e],a=zt(ut(i,r(i))).where(Vr(s));return zt(yn(t,a,n))}function n2(t,e,n,r){let o=n.args,i=o[e],s=o[1-e],a=zt(me(ut(i,r(i)),2)).where(Vr(s));return zt(yn(t,a,n))}function j4(t,e,n){let[r,o]=e.args,i=zt(pt(ut(o,n(o)),ut(r,n(r))));return zt(yn(t,i,e))}function X4(t,e){let[n,r]=e.args,{expr:o,name:i}=Mc(t,e),s=yn(t,Ju(n,r),e);return Lt(zt(pt(s,i)),o)}function W4(t,e){let[n,r]=e.args,{expr:o,name:i}=Mc(t,e),s=yn(t,Lb(n,r),e);return Lt(zt(pt(s,i)),o)}function r2(t,e,n,r){let{expr:o}=Mc(t,n),i=il(t,e,n,r),s=n2(t,e,n,r);return ut(s,Lt(me(i,2),o))}function G4(t,e,n){let r=Fm(t,e,n,null),o=r2(t,1,e,n);return Lt(r,o)}function gk(t,e,n){let r=X4(t,e),o=W4(t,e),i=G4(t,e,n);return ut(o,pt(i,r))}function V4(t){if(!t.filterStable)return null;let e=t.query();if(!Bi(e))return null;let n=Pm(e,c=>{let f=c._from[0]?.expr;return Pi(f)?f.name:f});if(typeof n!="string")return null;let r=new Map,o={},i={},s=[],a=c=>{let f=c.column,u=Pm(e,p=>p._select.find(l=>l.alias===f)?.expr);return Ae`(SELECT avg(${u??c}) FROM "${n}")`};for(let{alias:c,expr:f}of e._select){if(jn(f)>1)return null;let u=Vb(f);if(u.length===0)s.push(c),o[c]=f;else{for(let p of u){if(p.isDistinct)return null;let l=z4(p,o,a);if(!l)return null;r.set(p,l)}i[c]=rl(f,r)}}return r.size?{group:s,preagg:o,output:i}:null}function Pm(t,e){let n=t.subqueries;if(Bi(t)&&n.length===0)return e(t);let r=Pm(n[0],e);for(let o=1;o<n.length;++o){let i=Pm(n[o],e);if(i!==void 0&&i!==r)return NaN}return r}var yk={skip:!0,result:null},qm=class{constructor(e,{schema:n="mosaic",enabled:r=!0}={}){this.entries=new Map,this.active=null,this.mc=e,this._schema=n,this._enabled=r}set enabled(e){this._enabled!==e&&(e||this.clear(),this._enabled=e)}get enabled(){return this._enabled}set schema(e){this._schema!==e&&(this.clear(),this._schema=e)}get schema(){return this._schema}dropSchema(){return this.clear(),this.mc.exec(`DROP SCHEMA IF EXISTS "${this.schema}" CASCADE`)}clear(){this.entries.clear(),this.active=null}request(e,n,r){if(!this.enabled)return null;let{entries:o,mc:i,schema:s}=this,{source:a}=r;if(!a||this.active&&(this.active.source!==a&&this.clear(),this.active?.source===null))return null;let{active:c}=this;if(!c&&(this.active=c=xk(r),c.source===null))return null;if(o.has(e))return o.get(e);let f=V4(e),u;if(!f)u=null;else if(n.skip(e,r))u=yk;else{let p=n.remove(a).predicate(e);u=vk(e.query(p),c,f,s),u.result=i.exec([`CREATE SCHEMA IF NOT EXISTS ${s}`,Lm(u.table,u.create,{temp:!1})]),u.result.catch(l=>i.logger().error(l))}return o.set(e,u),u}};function xk(t){let{source:e,meta:n}=t,r=t.predicate,o=_c(r).map(p=>p.column),i,s;if(!n||!o)return{source:null,columns:s,predicate:i};let{type:a,scales:c,bin:f,pixelSize:u=1}=n;if(a==="point")i=p=>p,s=Object.fromEntries(o.map(p=>[`${p}`,Tt(p)]));else if(a==="interval"&&c){let p=c.map(l=>wk(l,u,f));p.some(l=>!l)||(p.length===1?(i=l=>l?gn("active0",l.extent.map(p[0])):[],s={active0:p[0](r.expr)}):(i=l=>l?Dn(l.clauses.map((h,d)=>gn(`active${d}`,h.extent.map(p[d])))):[],s=Object.fromEntries(r.clauses.map((l,h)=>[`active${h}`,p[h](l.expr)]))))}return{source:s?e:null,columns:s,predicate:i}}var bk={ceil:jb,round:jo};function wk(t,e,n){let{type:r,domain:o,range:i,apply:s,sqlApply:a}=ol(t);if(!s)return;let c=bk[`${n}`.toLowerCase()]||Re,f=s(Math.min(...o)),u=s(Math.max(...o)),p=(r==="identity"?1:Math.abs(i[1]-i[0])/(u-f))/e,l=p===1?d=>d:d=>pt(de(p),d),h=f===0?d=>d:d=>ut(d,de(f));return d=>Ht(c(l(h(a(d)))))}function vk(t,e,n,r){let{group:o,output:i,preagg:s}=n,{columns:a}=e,c=t.setSelect({...s,...a}).groupby(Object.keys(a)),[f]=c.subqueries;if(f){let g=Object.values(a).flatMap(y=>_c(y).map(x=>x.column));_k(f,g)}let u=c._having,p=c._orderby;c._having=[],c._orderby=[];let l=c.toString(),h=($m(l)>>>0).toString(16),d=`${r}.preagg_${h}`,m=yt.select(o,i).from(d).groupby(o).having(u).orderby(p);return new o2({table:d,create:l,active:e,select:m})}function _k(t,e){let n=new Set,r=o=>{n.has(o)||(n.add(o),Bi(o)&&o._from.length&&o.select(e),o.subqueries.forEach(r))};r(t)}var o2=class{constructor({table:e,create:n,active:r,select:o}){this.table=e,this.create=n,this.result=null,this.active=r,this.select=o,this.skip=!1}query(e){return this.select.clone().where(this.active.predicate(e))}};function i2(t){switch(t){case"BIGINT":case"HUGEINT":case"INTEGER":case"SMALLINT":case"TINYINT":case"UBIGINT":case"UINTEGER":case"USMALLINT":case"UTINYINT":case"DOUBLE":case"FLOAT":case"REAL":return"number";case"DATE":case"TIMESTAMP":case"TIMESTAMPTZ":case"TIMESTAMP WITH TIME ZONE":case"TIME":case"TIMESTAMP_NS":return"date";case"BOOLEAN":return"boolean";case"VARCHAR":case"UUID":case"JSON":return"string";case"ARRAY":case"LIST":return"array";case"BLOB":case"STRUCT":case"MAP":case"GEOMETRY":return"object";default:if(t.startsWith("DECIMAL"))return"number";if(t.startsWith("STRUCT")||t.startsWith("MAP"))return"object";if(t.endsWith("]"))return"array";throw new Error(`Unsupported type: ${t}`)}}var Mk="count",Sk="nulls",Ak="max",Ek="min",Tk="distinct";var Ik={[Mk]:rn,[Tk]:t=>rn(t).distinct(),[Ak]:Un,[Ek]:Wr,[Sk]:t=>rn().where(el(t))};function Ck(t,e,n){return yt.from(t).select(Array.from(n,r=>({[r]:Ik[r](e)})))}async function H4(t,e){return e.length===1&&e[0].column==="*"?kk(t,e[0].table):(await Promise.all(e.map(n=>Nk(t,n)))).filter(n=>n)}async function Nk(t,{table:e,column:n,stats:r}){let o=yt.from({source:e}).select({column:n}).groupby(n.aggregate?Ae`ALL`:[]),[i]=Array.from(await t.query(yt.describe(o))),s={table:e,column:`${n}`,sqlType:i.column_type,type:i2(i.column_type),nullable:i.null==="YES"};if(!(r?.length||r?.size))return s;let[a]=await t.query(Ck(e,n,r),{persist:!0});return Object.assign(s,a)}async function kk(t,e){let n=await t.query(`DESCRIBE ${Vs(e)}`);return Array.from(n).map(r=>({table:e,column:r.column_name,sqlType:r.column_type,type:i2(r.column_type),nullable:r.null==="YES"}))}var zi=Object.freeze({pending:Symbol("pending"),ready:Symbol("ready"),error:Symbol("error"),done:Symbol("done")}),ta=class extends Promise{constructor(){let e,n;super((r,o)=>{e=r,n=o}),this._resolve=e,this._reject=n,this._state=zi.pending,this._value=void 0}fulfill(e){if(this._value!==void 0){if(e!==void 0)throw Error("Promise is ready and fulfill has a provided value");this._resolve(this._value)}else{if(e===void 0)throw Error("Promise is neither ready nor has provided value");this._resolve(e)}return this._state=zi.done,this}ready(e){return this._state=zi.ready,this._value=e,this}reject(e){return this._state=zi.error,this._reject(e),this}get state(){return this._state}};ta.prototype.constructor=Promise;function Bm(){return{debug(...t){},info(...t){},log(...t){},warn(...t){},error(...t){}}}function Rk(t){return(typeof requestAnimationFrame<"u"?requestAnimationFrame:typeof setImmediate<"u"?setImmediate:setTimeout)(t)}function Q4(t,e){let n=[],r=0;function o(){let i=Lk(n,e);n=[],r=0;for(let s of i)$k(s,t),Pk(s,e)}return{add(i,s){i.request.type==="arrow"?(r=r||Rk(()=>o()),n.push({entry:i,priority:s,index:n.length})):t(i,s)}}}function Lk(t,e){let n=[],r=new Map;for(let o of t){let{entry:{request:i}}=o,s=Ok(i.query,e);if(!r.has(s)){let a=[];n.push(a),r.set(s,a)}r.get(s).push(o)}return n}function Ok(t,e){let n=`${t}`;if(Bi(t)&&!e.get(n)){if(t._orderby.length||t._where.length||t._qualify.length||t._having.length)return n;let r=t.clone().setSelect("*"),o=t._groupby;if(o.length){let i={};t._select.forEach(({alias:s,expr:a})=>i[s]=a),r.setGroupby(o.map(s=>qi(s)&&i[s.column]||s))}else t._select.some(i=>jn(i.expr))&&r.setGroupby("ALL");return`${r}`}else return n}function $k(t,e){if(Dk(t))e({request:{type:"arrow",cache:!1,query:t.query=Fk(t)},result:t.result=new ta});else for(let{entry:n,priority:r}of t)e(n,r)}function Dk(t){if(t.length>1){let e=`${t[0].entry.request.query}`;for(let n=1;n<t.length;++n)if(e!==`${t[n].entry.request.query}`)return!0}return!1}function Fk(t){let e=t.maps=[],n=new Map;for(let i of t){let{query:s}=i.entry.request,a=[];e.push(a);for(let{alias:c,expr:f}of s._select){let u=`${f}`;n.has(u)||n.set(u,[`col${n.size}`,f]);let[p]=n.get(u);a.push([p,c])}}let r=t[0].entry.request.query.clone(),o=r._groupby;if(o.length){let i={};t.maps[0].forEach(([s,a])=>i[a]=s),r.setGroupby(o.map(s=>qi(s)&&i[s.column]||s))}return r.setSelect(Array.from(n.values()))}async function Pk(t,e){let{maps:n,query:r,result:o}=t;if(!n)return;let i;try{i=await o}catch(a){for(let{entry:c}of t)c.result.reject(a);return}let s=Nb(r);t.forEach(({entry:a},c)=>{let{request:f,result:u}=a,p=n[c],l=s&&p?Bk(i,p):p?qk(i,p):i;f.cache&&e.set(String(f.query),l),u.fulfill(l)})}function qk(t,e){return t.select(e.map(n=>n[0]),e.map(n=>n[1]))}function Bk(t,e){let n=new Map(e),r=[];for(let o of t)n.has(o.column_name)&&r.push({...o,column_name:n.get(o.column_name)});return r}var zk=typeof requestIdleCallback<"u"?requestIdleCallback:setTimeout,Z4=()=>({get:()=>{},set:(t,e)=>e,clear:()=>{}});function K4({max:t=1e3,ttl:e=3*60*60*1e3}={}){let n=new Map;function r(){let o=performance.now()-e,i=null,s=1/0;for(let[a,c]of n){let{last:f}=c;f<s&&(i=a,s=f),o>f&&n.delete(a)}i&&n.delete(i)}return{get(o){let i=n.get(o);if(i)return i.last=performance.now(),i.value},set(o,i){return n.set(o,{last:performance.now(),value:i}),n.size>t&&zk(r),i},clear(){n=new Map}}}var zm=class{constructor(e){this.queue=Array.from({length:e},()=>({head:null,tail:null}))}isEmpty(){return this.queue.every(e=>!e.head)}insert(e,n){let r=this.queue[n];if(!r)throw new Error(`Invalid queue priority rank: ${n}`);let o={item:e,next:null};r.head===null?r.head=r.tail=o:r.tail=r.tail.next=o}remove(e){for(let n of this.queue){let{head:r,tail:o}=n;for(let i=null,s=r;s;i=s,s=s.next)e(s.item)&&(s===r?r=s.next:i.next=s.next,s===o&&(o=i||r));n.head=r,n.tail=o}}next(){for(let e of this.queue){let{head:n}=e;if(n!==null)return e.head=n.next,e.tail===n&&(e.tail=null),n.item}}};var Zr=Object.freeze({High:0,Normal:1,Low:2}),Ym=class{constructor(e=32){this.queue=new zm(3),this.db=null,this.clientCache=null,this._logger=Bm(),this._logQueries=!1,this._consolidate=null,this.pendingResults=[],this.maxConcurrentRequests=e,this.pendingExec=!1}next(){if(this.queue.isEmpty()||this.pendingResults.length>this.maxConcurrentRequests||this.pendingExec)return;let{request:e,result:n}=this.queue.next();this.pendingResults.push(n),e.type==="exec"&&(this.pendingExec=!0),this.submit(e,n).finally(()=>{for(;this.pendingResults.length&&this.pendingResults[0].state!==zi.pending;){let r=this.pendingResults.shift();r.state===zi.ready?r.fulfill():r.state===zi.done&&this._logger.warn("Found resolved query in pending results.")}e.type==="exec"&&(this.pendingExec=!1),this.next()})}enqueue(e,n=Zr.Normal){this.queue.insert(e,n),this.next()}async submit(e,n){try{let{query:r,type:o,cache:i=!1,options:s}=e,a=r?`${r}`:null;if(i){let p=this.clientCache.get(a);if(p){let l=await p;this._logger.debug("Cache"),n.ready(l);return}}let c=performance.now();this._logQueries&&this._logger.debug("Query",{type:o,sql:a,...s});let f=this.db.query({type:o,sql:a,...s});i&&this.clientCache.set(a,f);let u=await f;i&&this.clientCache.set(a,u),this._logger.debug(`Request: ${(performance.now()-c).toFixed(1)}`),n.ready(o==="exec"?null:u)}catch(r){n.reject(r)}}cache(e){return e!==void 0?this.clientCache=e===!0?K4():e||Z4():this.clientCache}logger(e){return e?this._logger=e:this._logger}logQueries(e){return e!==void 0?this._logQueries=!!e:this._logQueries}connector(e){return e?this.db=e:this.db}consolidate(e){e&&!this._consolidate?this._consolidate=Q4(this.enqueue.bind(this),this.clientCache):!e&&this._consolidate&&(this._consolidate=null)}request(e,n=Zr.Normal){let r=new ta,o={request:e,result:r};return this._consolidate?this._consolidate.add(o,n):this.enqueue(o,n),r}cancel(e){let n=new Set(e);if(n.size){this.queue.remove(({result:r})=>n.has(r)?(r.reject("Canceled"),!0):!1);for(let r of this.pendingResults)n.has(r)&&r.reject("Canceled")}}clear(){this.queue.remove(({result:e})=>(e.reject("Cleared"),!0));for(let e of this.pendingResults)e.reject("Cleared");this.pendingResults=[]}};var Um;function s2(t){return t?Um=t:Um==null&&(Um=new jm),Um}var jm=class{constructor(e=Ab(),{logger:n=console,manager:r=new Ym,cache:o=!0,consolidate:i=!0,preagg:s={}}={}){this.manager=r,this.manager.cache(o),this.manager.consolidate(i),this.databaseConnector(e),this.logger(n),this.clear(),this.preaggregator=new qm(this,s)}clear({clients:e=!0,cache:n=!0}={}){this.manager.clear(),e&&(this.filterGroups?.forEach(r=>r.disconnect()),this.filterGroups=new Map,this.clients?.forEach(r=>this.disconnect(r)),this.clients=new Set),n&&this.manager.cache().clear()}databaseConnector(e){return this.manager.connector(e)}logger(e){return arguments.length&&(this._logger=e||Bm(),this.manager.logger(this._logger)),this._logger}cancel(e){this.manager.cancel(e)}exec(e,{priority:n=Zr.Normal}={}){return e=Array.isArray(e)?e.filter(r=>r).join(`;
2
+ `):e,this.manager.request({type:"exec",query:e},n)}query(e,{type:n="arrow",cache:r=!0,priority:o=Zr.Normal,...i}={}){return this.manager.request({type:n,query:e,cache:r,options:i},o)}prefetch(e,n={}){return this.query(e,{...n,cache:!0,priority:Zr.Low})}createBundle(e,n,r=Zr.Low){let o={name:e,queries:n.map(i=>typeof i=="string"?{sql:i}:i)};return this.manager.request({type:"create-bundle",options:o},r)}loadBundle(e,n=Zr.High){let r={name:e};return this.manager.request({type:"load-bundle",options:r},n)}updateClient(e,n,r=Zr.Normal){return e.queryPending(),this.query(n,{priority:r}).then(o=>e.queryResult(o).update(),o=>{this._logger.error(o),e.queryError(o)}).catch(o=>this._logger.error(o))}requestQuery(e,n){return this.preaggregator.clear(),n?this.updateClient(e,n):Promise.resolve(e.update())}async connect(e){let{clients:n}=this;if(n.has(e))throw new Error("Client already connected.");n.add(e),e.coordinator=this,this.initializeClient(e),Yk(this,e.filterBy,e)}async initializeClient(e){let n=e.fields();return n?.length&&e.fieldInfo(await H4(this,n)),e.requestQuery()}disconnect(e){let{clients:n,filterGroups:r}=this;if(!n.has(e))return;n.delete(e),e.coordinator=null;let o=r.get(e.filterBy);o&&o.clients.delete(e)}};function Yk(t,e,n){if(!e)return;let r=t.filterGroups.get(e);if(!r){let o=s=>Uk(t,e,s),i=()=>jk(t,e);e.addEventListener("activate",o),e.addEventListener("value",i),r={selection:e,clients:new Set,disconnect(){e.removeEventListener("activate",o),e.removeEventListener("value",i)}},t.filterGroups.set(e,r)}r.clients.add(n)}function Uk(t,e,n){let{preaggregator:r,filterGroups:o}=t,{clients:i}=o.get(e);for(let s of i)r.request(s,e,n)}function jk(t,e){let{preaggregator:n,filterGroups:r}=t,{clients:o}=r.get(e),{active:i}=e;return Promise.allSettled(Array.from(o,s=>{let a=n.request(s,e,i),c=a?null:e.predicate(s);if(a?.skip||!a&&!c)return;let f=a?.query(i.predicate)??s.query(c);return t.updateClient(s,f)}))}var Xm=class{constructor(){this._callbacks=new Map}addEventListener(e,n){this._callbacks.has(e)||this._callbacks.set(e,{callbacks:new Set,pending:null,queue:new a2}),this._callbacks.get(e).callbacks.add(n)}removeEventListener(e,n){let r=this._callbacks.get(e);r&&r.callbacks.delete(n)}willEmit(e,n){return n}emitQueueFilter(e,n){return null}cancel(e){this._callbacks.get(e)?.queue.clear()}async pending(e){await this._callbacks.get(e)?.pending}emit(e,n){let r=this._callbacks.get(e)||{};if(r.pending)r.queue.enqueue(n,this.emitQueueFilter(e,n));else{let o=this.willEmit(e,n),{callbacks:i,queue:s}=r;if(i?.size){let a=Array.from(i,c=>c(o));r.pending=Promise.allSettled(a).then(()=>{r.pending=null,s.isEmpty()||this.emit(e,s.dequeue())})}}}},a2=class{constructor(){this.clear()}clear(){this.next=null}isEmpty(){return!this.next}enqueue(e,n){let r={value:e};if(n&&this.next){let o=this;for(;o.next;)n(o.next.value)?o=o.next:o.next=o.next.next;o.next=r}else this.next=r}dequeue(){let{next:e}=this;return this.next=e?.next,e?.value}};function sl(t,e){return t===e?!1:t instanceof Date&&e instanceof Date?+t!=+e:Array.isArray(t)&&Array.isArray(e)?Xk(t,e):!0}function Xk(t,e){if(t.length!==e.length)return!0;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!0;return!1}function Wo(t){return t instanceof Sc}var Sc=class t extends Xm{constructor(e){super(),this._value=e}static value(e){return new t(e)}static array(e){if(e.some(n=>Wo(n))){let n=new t,r=()=>{n.update(e.map(o=>Wo(o)?o.value:o))};return r(),e.forEach(o=>Wo(o)?o.addEventListener("value",r):0),n}return new t(e)}get value(){return this._value}update(e,{force:n}={}){return sl(this._value,e)||n?this.emit("value",e):this.cancel("value"),this}willEmit(e,n){return e==="value"&&(this._value=n),n}};function c2(t){return t instanceof Yi}function Wm(t,e){return new Yi(new Gm(t),e&&[e].flat())}var Yi=class t extends Sc{static intersect({cross:e=!1,empty:n=!1,include:r=[]}={}){return Wm({cross:e,empty:n},r)}static union({cross:e=!1,empty:n=!1,include:r=[]}={}){return Wm({cross:e,empty:n,union:!0},r)}static single({cross:e=!1,empty:n=!1,include:r=[]}={}){return Wm({cross:e,empty:n,single:!0},r)}static crossfilter({empty:e=!1,include:n=[]}={}){return Wm({cross:!0,empty:e},n)}constructor(e=new Gm,n=[]){if(super([]),this._resolved=this._value,this._resolver=e,this._relay=new Set,Array.isArray(n))for(let r of n)r._relay.add(this)}clone(){let e=new t(this._resolver);return e._value=e._resolved=this._value,e}remove(e){let n=this.clone();return n._value=n._resolved=n._resolver.resolve(this._resolved,{source:e}),n._value.active={source:e},n}get resolver(){return this._resolver}get single(){return this._resolver.single}get clauses(){return super.value}get active(){return this.clauses.active}get value(){return this.active?.value}valueFor(e){return this.clauses.find(n=>n.source===e)?.value}activate(e){this.emit("activate",e),this._relay.forEach(n=>n.activate(e))}update(e){return this._resolved=this._resolver.resolve(this._resolved,e,!0),this._resolved.active=e,this._relay.forEach(n=>n.update(e)),super.update(this._resolved)}willEmit(e,n){return e==="value"?(this._value=n,this.value):n}emitQueueFilter(e,n){return e==="value"?this._resolver.queueFilter(n):null}skip(e,n){return this._resolver.skip(e,n)}predicate(e,n=!1){let{clauses:r}=this,o=n?null:r.active;return this._resolver.predicate(r,o,e)}},Gm=class{constructor({union:e,cross:n,single:r,empty:o}={}){this.union=!!e,this.cross=!!n,this.single=!!r,this.empty=!!o}resolve(e,n,r=!1){let{source:o,predicate:i}=n,s=e.filter(c=>o!==c.source),a=this.single?[]:s;return this.single&&r&&s.forEach(c=>c.source?.reset?.()),i&&a.push(n),a}skip(e,n){return this.cross&&n?.clients?.has(e)}predicate(e,n,r){let{empty:o,union:i}=this;if(o&&!e.length)return[mn(!1)];if(this.skip(r,n))return;let s=e.filter(a=>!this.skip(r,a)).map(a=>a.predicate);return i&&s.length>1?Gr(s):s}queueFilter(e){if(this.cross){let n=e.active?.source;return r=>r.active?.source!==n}return null}};function f2(t,e,{source:n,clients:r=n?new Set([n]):void 0}){let o=e!==void 0?Nm(t,[mn(e)]):null;return{meta:{type:"point"},source:n,clients:r,value:e,predicate:o}}function ea(t,e,{source:n,clients:r=n?new Set([n]):void 0}){let o=null;if(e){let i=e.length&&t.length===1?[Nm(t[0],e.map(s=>mn(s[0])))]:e.map(s=>Dn(s.map((a,c)=>Xb(t[c],mn(a)))));o=e.length===0?mn(!1):i.length>1?Gr(i):i[0]}return{meta:{type:"point"},source:n,clients:r,value:e,predicate:o}}function al(t,e,{source:n,clients:r=n?new Set([n]):void 0,bin:o,scale:i,pixelSize:s=1}){let a=e!=null?gn(t,e):null;return{meta:{type:"interval",scales:i&&[i],bin:o,pixelSize:s},source:n,clients:r,value:e,predicate:a}}function u2(t,e,{source:n,clients:r=n?new Set([n]):void 0,bin:o,scales:i=[],pixelSize:s=1}){let a=e!=null?Dn(t.map((f,u)=>gn(f,e[u]))):null;return{meta:{type:"interval",scales:i,bin:o,pixelSize:s},source:n,clients:r,value:e,predicate:a}}function l2(t){return typeof t?.getChild=="function"}function p2(){let t=new Set,e,n=new Promise(r=>e=r);return{pending(r){t.add(r)},ready(r){return t.delete(r),t.size===0},resolve(){n=new Promise(r=>{e(),e=r})},get promise(){return n}}}function cr(t){return l2(t)?Wk(t):Gk(t)}function Wk(t){let{numRows:e}=t;return{numRows:e,columns:t.toColumns()}}function Gk(t){let e=t.length;if(typeof t[0]=="object"){let n=e?Object.keys(t[0]):[],r={};return n.length>0&&n.forEach(o=>{r[o]=t.map(i=>i[o])}),{numRows:e,columns:r}}else return{numRows:e,values:t}}var y3={};QC(y3,{Area:()=>Ga,Arrow:()=>Mh,BarX:()=>Va,BarY:()=>Ha,Cell:()=>Qa,Contour:()=>Oh,Density:()=>Fh,Dot:()=>Za,Frame:()=>gh,Geo:()=>Ph,Hexgrid:()=>qh,Image:()=>Bh,Line:()=>Ka,Link:()=>vh,Mark:()=>ft,Raster:()=>Nh,Rect:()=>Wa,RuleX:()=>ah,RuleY:()=>ch,Text:()=>Ua,TickX:()=>Eh,TickY:()=>Th,Tip:()=>yh,Vector:()=>Xa,WaffleX:()=>Yh,WaffleY:()=>Uh,area:()=>wh,areaX:()=>Ns,areaY:()=>Ni,arrow:()=>QT,auto:()=>a9,autoSpec:()=>Y6,axisFx:()=>Vx,axisFy:()=>Gx,axisX:()=>uh,axisY:()=>fh,barX:()=>ko,barY:()=>Ro,bin:()=>Ci,binX:()=>Co,binY:()=>No,bollinger:()=>Os,bollingerX:()=>h9,bollingerY:()=>d9,boxX:()=>m9,boxY:()=>g9,cell:()=>ks,cellX:()=>KT,cellY:()=>JT,centroid:()=>v1,circle:()=>n9,cluster:()=>dI,column:()=>qe,contour:()=>A9,crosshair:()=>I9,crosshairX:()=>C9,crosshairY:()=>N9,delaunayLink:()=>L9,delaunayMesh:()=>O9,density:()=>q9,differenceX:()=>Y9,differenceY:()=>U9,dodgeX:()=>OI,dodgeY:()=>$I,dot:()=>_r,dotX:()=>t9,dotY:()=>e9,filter:()=>c7,find:()=>y7,formatIsoDate:()=>h6,formatMonth:()=>_E,formatNumber:()=>p6,formatWeekday:()=>ME,frame:()=>Wf,geo:()=>_1,geoCentroid:()=>X9,graticule:()=>G9,gridFx:()=>Kx,gridFy:()=>Qx,gridX:()=>Zx,gridY:()=>Hx,group:()=>Jp,groupX:()=>ms,groupY:()=>gs,groupZ:()=>Kp,hexagon:()=>r9,hexbin:()=>V9,hexgrid:()=>H9,hull:()=>$9,identity:()=>X,image:()=>Z9,indexOf:()=>Xt,initializer:()=>Gt,interpolateNearest:()=>Rh,interpolateNone:()=>w1,interpolatorBarycentric:()=>kh,interpolatorRandomWalk:()=>Lh,legend:()=>xT,line:()=>Ja,lineX:()=>Rs,lineY:()=>Ls,linearRegressionX:()=>tI,linearRegressionY:()=>eI,link:()=>l1,map:()=>qn,mapX:()=>Kf,mapY:()=>Jf,marks:()=>Se,normalize:()=>k1,normalizeX:()=>qI,normalizeY:()=>BI,numberInterval:()=>N_,plot:()=>Gf,pointer:()=>_s,pointerX:()=>Ms,pointerY:()=>Ti,raster:()=>v9,rect:()=>mh,rectX:()=>jf,rectY:()=>Xf,reverse:()=>f7,ruleX:()=>er,ruleY:()=>nr,scale:()=>ys,select:()=>jI,selectFirst:()=>Wh,selectLast:()=>Gh,selectMaxX:()=>$1,selectMaxY:()=>D1,selectMinX:()=>L1,selectMinY:()=>O1,shiftX:()=>zI,shiftY:()=>YI,shuffle:()=>u7,sort:()=>mx,sphere:()=>W9,spike:()=>KE,stackX:()=>k6,stackX1:()=>ST,stackX2:()=>AT,stackY:()=>R6,stackY1:()=>ET,stackY2:()=>TT,text:()=>Io,textX:()=>Bx,textY:()=>zx,tickX:()=>y1,tickY:()=>x1,timeInterval:()=>Wp,tip:()=>i1,transform:()=>Me,tree:()=>c3,treeLink:()=>T1,treeNode:()=>zh,utcInterval:()=>La,valueof:()=>ct,vector:()=>I6,vectorX:()=>jx,vectorY:()=>Xx,voronoi:()=>D9,voronoiMesh:()=>F9,waffleX:()=>wI,waffleY:()=>vI,window:()=>tu,windowX:()=>c9,windowY:()=>f9});function dt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function xn(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Nr(t){let e,n,r;t.length!==2?(e=dt,n=(a,c)=>dt(t(a),c),r=(a,c)=>t(a)-c):(e=t===dt||t===xn?t:Vk,n=t,r=t);function o(a,c,f=0,u=a.length){if(f<u){if(e(c,c)!==0)return u;do{let p=f+u>>>1;n(a[p],c)<0?f=p+1:u=p}while(f<u)}return f}function i(a,c,f=0,u=a.length){if(f<u){if(e(c,c)!==0)return u;do{let p=f+u>>>1;n(a[p],c)<=0?f=p+1:u=p}while(f<u)}return f}function s(a,c,f=0,u=a.length){let p=o(a,c,f,u-1);return p>f&&r(a[p-1],c)>-r(a[p],c)?p-1:p}return{left:o,center:s,right:i}}function Vk(){return 0}function cl(t){return t===null?NaN:+t}function*J4(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}var t5=Nr(dt),e5=t5.right,Hk=t5.left,Qk=Nr(cl).center,Go=e5;var fl=n5(r5),h2=n5(Zk);function n5(t){return function(e,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:o,width:i,height:s}=e;if(!((i=Math.floor(i))>=0))throw new RangeError("invalid width");if(!((s=Math.floor(s!==void 0?s:o.length/i))>=0))throw new RangeError("invalid height");if(!i||!s||!n&&!r)return e;let a=n&&t(n),c=r&&t(r),f=o.slice();return a&&c?(Ac(a,f,o,i,s),Ac(a,o,f,i,s),Ac(a,f,o,i,s),Ec(c,o,f,i,s),Ec(c,f,o,i,s),Ec(c,o,f,i,s)):a?(Ac(a,o,f,i,s),Ac(a,f,o,i,s),Ac(a,o,f,i,s)):c&&(Ec(c,o,f,i,s),Ec(c,f,o,i,s),Ec(c,o,f,i,s)),e}}function Ac(t,e,n,r,o){for(let i=0,s=r*o;i<s;)t(e,n,i,i+=r,1)}function Ec(t,e,n,r,o){for(let i=0,s=r*o;i<r;++i)t(e,n,i,i+s,r)}function Zk(t){let e=r5(t);return(n,r,o,i,s)=>{o<<=2,i<<=2,s<<=2,e(n,r,o+0,i+0,s),e(n,r,o+1,i+1,s),e(n,r,o+2,i+2,s),e(n,r,o+3,i+3,s)}}function r5(t){let e=Math.floor(t);if(e===t)return Kk(t);let n=t-e,r=2*t+1;return(o,i,s,a,c)=>{if(!((a-=c)>=s))return;let f=e*i[s],u=c*e,p=u+c;for(let l=s,h=s+u;l<h;l+=c)f+=i[Math.min(a,l)];for(let l=s,h=a;l<=h;l+=c)f+=i[Math.min(a,l+u)],o[l]=(f+n*(i[Math.max(s,l-p)]+i[Math.min(a,l+p)]))/r,f-=i[Math.max(s,l-u)]}}function Kk(t){let e=2*t+1;return(n,r,o,i,s)=>{if(!((i-=s)>=o))return;let a=t*r[o],c=s*t;for(let f=o,u=o+c;f<u;f+=s)a+=r[Math.min(i,f)];for(let f=o,u=i;f<=u;f+=s)a+=r[Math.min(i,f+c)],n[f]=a/e,a-=r[Math.max(o,f-c)]}}function Kr(t,e){let n=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(o=+o)>=o&&++n}return n}function Jk(t){return t.length|0}function tR(t){return!(t>0)}function eR(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function nR(t){return e=>t(...e)}function Vm(...t){let e=typeof t[t.length-1]=="function"&&nR(t.pop());t=t.map(eR);let n=t.map(Jk),r=t.length-1,o=new Array(r+1).fill(0),i=[];if(r<0||n.some(tR))return i;for(;;){i.push(o.map((a,c)=>t[c][a]));let s=r;for(;++o[s]===n[s];){if(s===0)return e?i.map(e):i;o[s--]=0}}}function Hm(t,e){var n=0,r=0;return Float64Array.from(t,e===void 0?o=>n+=+o||0:o=>n+=+e(o,r++,t)||0)}function Ui(t,e){let n=0,r,o=0,i=0;if(e===void 0)for(let s of t)s!=null&&(s=+s)>=s&&(r=s-o,o+=r/++n,i+=r*(s-o));else{let s=-1;for(let a of t)(a=e(a,++s,t))!=null&&(a=+a)>=a&&(r=a-o,o+=r/++n,i+=r*(a-o))}if(n>1)return i/(n-1)}function fr(t,e){let n=Ui(t,e);return n&&Math.sqrt(n)}function Ot(t,e){let n,r;if(e===void 0)for(let o of t)o!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)));else{let o=-1;for(let i of t)(i=e(i,++o,t))!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}var Xe=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){let n=this._partials,r=0;for(let o=0;o<this._n&&o<32;o++){let i=n[o],s=e+i,a=Math.abs(e)<Math.abs(i)?e-(s-i):i-(s-e);a&&(n[r++]=a),e=s}return n[r]=e,this._n=r+1,this}valueOf(){let e=this._partials,n=this._n,r,o,i,s=0;if(n>0){for(s=e[--n];n>0&&(r=s,o=e[--n],s=r+o,i=o-(s-r),!i););n>0&&(i<0&&e[n-1]<0||i>0&&e[n-1]>0)&&(o=i*2,r=s+o,o==r-s&&(s=r))}return s}};var bn=class extends Map{constructor(e,n=s5){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let[r,o]of e)this.set(r,o)}get(e){return super.get(d2(this,e))}has(e){return super.has(d2(this,e))}set(e,n){return super.set(o5(this,e),n)}delete(e){return super.delete(i5(this,e))}},wn=class extends Set{constructor(e,n=s5){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let r of e)this.add(r)}has(e){return super.has(d2(this,e))}add(e){return super.add(o5(this,e))}delete(e){return super.delete(i5(this,e))}};function d2({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):n}function o5({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function i5({_intern:t,_key:e},n){let r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function s5(t){return t!==null&&typeof t=="object"?t.valueOf():t}function ul(t){return t}function We(t,...e){return g2(t,ul,ul,e)}function kr(t,e,...n){return g2(t,ul,e,n)}function m2(t,e,...n){return g2(t,Array.from,e,n)}function g2(t,e,n,r){return function o(i,s){if(s>=r.length)return n(i);let a=new bn,c=r[s++],f=-1;for(let u of i){let p=c(u,++f,i),l=a.get(p);l?l.push(u):a.set(p,[u])}for(let[u,p]of a)a.set(u,o(p,s));return e(a)}(t,0)}function y2(t,e){return Array.from(e,n=>t[n])}function Vo(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){let r=Uint32Array.from(t,(o,i)=>i);return e.length>1?(e=e.map(o=>t.map(o)),r.sort((o,i)=>{for(let s of e){let a=na(s[o],s[i]);if(a)return a}})):(n=t.map(n),r.sort((o,i)=>na(n[o],n[i]))),y2(t,r)}return t.sort(ll(n))}function ll(t=dt){if(t===dt)return na;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{let r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function na(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}function Tc(t,e,n){return(e.length!==2?Vo(kr(t,e,n),([r,o],[i,s])=>dt(o,s)||dt(r,i)):Vo(We(t,n),([r,o],[i,s])=>e(o,s)||dt(r,i))).map(([r])=>r)}var rR=Math.sqrt(50),oR=Math.sqrt(10),iR=Math.sqrt(2);function Qm(t,e,n){let r=(e-t)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),s=i>=rR?10:i>=oR?5:i>=iR?2:1,a,c,f;return o<0?(f=Math.pow(10,-o)/s,a=Math.round(t*f),c=Math.round(e*f),a/f<t&&++a,c/f>e&&--c,f=-f):(f=Math.pow(10,o)*s,a=Math.round(t/f),c=Math.round(e/f),a*f<t&&++a,c*f>e&&--c),c<a&&.5<=n&&n<2?Qm(t,e,n*2):[a,c,f]}function Ge(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];let r=e<t,[o,i,s]=r?Qm(e,t,n):Qm(t,e,n);if(!(i>=o))return[];let a=i-o+1,c=new Array(a);if(r)if(s<0)for(let f=0;f<a;++f)c[f]=(i-f)/-s;else for(let f=0;f<a;++f)c[f]=(i-f)*s;else if(s<0)for(let f=0;f<a;++f)c[f]=(o+f)/-s;else for(let f=0;f<a;++f)c[f]=(o+f)*s;return c}function Ho(t,e,n){return e=+e,t=+t,n=+n,Qm(t,e,n)[2]}function Ic(t,e,n){e=+e,t=+t,n=+n;let r=e<t,o=r?Ho(e,t,n):Ho(t,e,n);return(r?-1:1)*(o<0?1/-o:o)}function Cc(t,e,n){let r;for(;;){let o=Ho(t,e,n);if(o===r||o===0||!isFinite(o))return[t,e];o>0?(t=Math.floor(t/o)*o,e=Math.ceil(e/o)*o):o<0&&(t=Math.ceil(t*o)/o,e=Math.floor(e*o)/o),r=o}}function ji(t){return Math.max(1,Math.ceil(Math.log(Kr(t))/Math.LN2)+1)}function It(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o)}return n}function Zm(t,e){let n,r=-1,o=-1;if(e===void 0)for(let i of t)++o,i!=null&&(n<i||n===void 0&&i>=i)&&(n=i,r=o);else for(let i of t)(i=e(i,++o,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i,r=o);return r}function St(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function Km(t,e){let n,r=-1,o=-1;if(e===void 0)for(let i of t)++o,i!=null&&(n>i||n===void 0&&i>=i)&&(n=i,r=o);else for(let i of t)(i=e(i,++o,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i,r=o);return r}function Jm(t,e,n=0,r=1/0,o){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(o=o===void 0?na:ll(o);r>n;){if(r-n>600){let c=r-n+1,f=e-n+1,u=Math.log(c),p=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*p*(c-p)/c)*(f-c/2<0?-1:1),h=Math.max(n,Math.floor(e-f*p/c+l)),d=Math.min(r,Math.floor(e+(c-f)*p/c+l));Jm(t,e,h,d,o)}let i=t[e],s=n,a=r;for(pl(t,n,e),o(t[r],i)>0&&pl(t,n,r);s<a;){for(pl(t,s,a),++s,--a;o(t[s],i)<0;)++s;for(;o(t[a],i)>0;)--a}o(t[n],i)===0?pl(t,n,a):(++a,pl(t,a,r)),a<=e&&(n=a+1),e<=a&&(r=a-1)}return t}function pl(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}function ra(t,e=dt){let n,r=!1;if(e.length===1){let o;for(let i of t){let s=e(i);(r?dt(s,o)>0:dt(s,s)===0)&&(n=i,o=s,r=!0)}}else for(let o of t)(r?e(o,n)>0:e(o,o)===0)&&(n=o,r=!0);return n}function vn(t,e,n){if(t=Float64Array.from(J4(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return St(t);if(e>=1)return It(t);var r,o=(r-1)*e,i=Math.floor(o),s=It(Jm(t,i).subarray(0,i+1)),a=St(t.subarray(i+1));return s+(a-s)*(o-i)}}function x2(t,e,n=cl){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,o=(r-1)*e,i=Math.floor(o),s=+n(t[i],i,t),a=+n(t[i+1],i+1,t);return s+(a-s)*(o-i)}}function t0(t,e,n){let r=Kr(t),o=vn(t,.75)-vn(t,.25);return r&&o?Math.ceil((n-e)/(2*o*Math.pow(r,-1/3))):1}function hl(t,e,n){let r=Kr(t),o=fr(t);return r&&o?Math.ceil((n-e)*Math.cbrt(r)/(3.49*o)):1}function Qo(t,e){let n=0,r=0;if(e===void 0)for(let o of t)o!=null&&(o=+o)>=o&&(++n,r+=o);else{let o=-1;for(let i of t)(i=e(i,++o,t))!=null&&(i=+i)>=i&&(++n,r+=i)}if(n)return r/n}function Rr(t,e){return vn(t,.5,e)}function*aR(t){for(let e of t)yield*e}function Nc(t){return Array.from(aR(t))}function kc(t,e){let n=new bn;if(e===void 0)for(let i of t)i!=null&&i>=i&&n.set(i,(n.get(i)||0)+1);else{let i=-1;for(let s of t)(s=e(s,++i,t))!=null&&s>=s&&n.set(s,(n.get(s)||0)+1)}let r,o=0;for(let[i,s]of n)s>o&&(o=s,r=i);return r}function e0(t,e=cR){let n=[],r,o=!1;for(let i of t)o&&n.push(e(r,i)),r=i,o=!0;return n}function cR(t,e){return[t,e]}function le(t,e,n){t=+t,e=+e,n=(o=arguments.length)<2?(e=t,t=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((e-t)/n))|0,i=new Array(o);++r<o;)i[r]=t+r*n;return i}function dl(t,e=dt){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(t),r=new Float64Array(n.length);e.length!==2&&(n=n.map(e),e=dt);let o=(a,c)=>e(n[a],n[c]),i,s;return t=Uint32Array.from(n,(a,c)=>c),t.sort(e===dt?(a,c)=>na(n[a],n[c]):ll(o)),t.forEach((a,c)=>{let f=o(a,i===void 0?a:i);f>=0?((i===void 0||f>0)&&(i=a,s=c),r[a]=s):r[a]=NaN}),r}function n0(t,e=dt){let n,r=!1;if(e.length===1){let o;for(let i of t){let s=e(i);(r?dt(s,o)<0:dt(s,s)===0)&&(n=i,o=s,r=!0)}}else for(let o of t)(r?e(o,n)<0:e(o,o)===0)&&(n=o,r=!0);return n}function Ve(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let o of t)(o=+e(o,++r,t))&&(n+=o)}return n}function Xi(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function a5(t){return t}var b2=1,w2=2,v2=3,r0=4,c5=1e-6;function fR(t){return"translate("+t+",0)"}function uR(t){return"translate(0,"+t+")"}function lR(t){return e=>+t(e)}function pR(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function hR(){return!this.__axis}function dR(t,e){var n=[],r=null,o=null,i=6,s=6,a=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,f=t===b2||t===r0?-1:1,u=t===r0||t===w2?"x":"y",p=t===b2||t===v2?fR:uR;function l(h){var d=r??(e.ticks?e.ticks.apply(e,n):e.domain()),m=o??(e.tickFormat?e.tickFormat.apply(e,n):a5),g=Math.max(i,0)+a,y=e.range(),x=+y[0]+c,b=+y[y.length-1]+c,w=(e.bandwidth?pR:lR)(e.copy(),c),_=h.selection?h.selection():h,v=_.selectAll(".domain").data([null]),A=_.selectAll(".tick").data(d,e).order(),E=A.exit(),T=A.enter().append("g").attr("class","tick"),C=A.select("line"),S=A.select("text");v=v.merge(v.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(T),C=C.merge(T.append("line").attr("stroke","currentColor").attr(u+"2",f*i)),S=S.merge(T.append("text").attr("fill","currentColor").attr(u,f*g).attr("dy",t===b2?"0em":t===v2?"0.71em":"0.32em")),h!==_&&(v=v.transition(h),A=A.transition(h),C=C.transition(h),S=S.transition(h),E=E.transition(h).attr("opacity",c5).attr("transform",function(k){return isFinite(k=w(k))?p(k+c):this.getAttribute("transform")}),T.attr("opacity",c5).attr("transform",function(k){var L=this.parentNode.__axis;return p((L&&isFinite(L=L(k))?L:w(k))+c)})),E.remove(),v.attr("d",t===r0||t===w2?s?"M"+f*s+","+x+"H"+c+"V"+b+"H"+f*s:"M"+c+","+x+"V"+b:s?"M"+x+","+f*s+"V"+c+"H"+b+"V"+f*s:"M"+x+","+c+"H"+b),A.attr("opacity",1).attr("transform",function(k){return p(w(k)+c)}),C.attr(u+"2",f*i),S.attr(u,f*g).text(m),_.filter(hR).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===w2?"start":t===r0?"end":"middle"),_.each(function(){this.__axis=w})}return l.scale=function(h){return arguments.length?(e=h,l):e},l.ticks=function(){return n=Array.from(arguments),l},l.tickArguments=function(h){return arguments.length?(n=h==null?[]:Array.from(h),l):n.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?(o=h,l):o},l.tickSize=function(h){return arguments.length?(i=s=+h,l):i},l.tickSizeInner=function(h){return arguments.length?(i=+h,l):i},l.tickSizeOuter=function(h){return arguments.length?(s=+h,l):s},l.tickPadding=function(h){return arguments.length?(a=+h,l):a},l.offset=function(h){return arguments.length?(c=+h,l):c},l}function _2(t){return dR(v2,t)}var mR={value:()=>{}};function u5(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new o0(n)}function o0(t){this._=t}function gR(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}o0.prototype=u5.prototype={constructor:o0,on:function(t,e){var n=this._,r=gR(t+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(t=r[i]).type)&&(o=yR(n[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<s;)if(o=(t=r[i]).type)n[o]=f5(n[o],t.name,e);else if(e==null)for(o in n)n[o]=f5(n[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new o0(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};function yR(t,e){for(var n=0,r=t.length,o;n<r;++n)if((o=t[n]).name===e)return o.value}function f5(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=mR,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var oa=u5;var i0="http://www.w3.org/1999/xhtml",_n={svg:"http://www.w3.org/2000/svg",xhtml:i0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zo(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),_n.hasOwnProperty(e)?{space:_n[e],local:t}:t}function xR(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===i0&&e.documentElement.namespaceURI===i0?e.createElement(t):e.createElementNS(n,t)}}function bR(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ko(t){var e=Zo(t);return(e.local?bR:xR)(e)}function wR(){}function ia(t){return t==null?wR:function(){return this.querySelector(t)}}function l5(t){typeof t!="function"&&(t=ia(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],s=i.length,a=r[o]=new Array(s),c,f,u=0;u<s;++u)(c=i[u])&&(f=t.call(c,c.__data__,u,i))&&("__data__"in c&&(f.__data__=c.__data__),a[u]=f);return new se(r,this._parents)}function M2(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function vR(){return[]}function ml(t){return t==null?vR:function(){return this.querySelectorAll(t)}}function _R(t){return function(){return M2(t.apply(this,arguments))}}function p5(t){typeof t=="function"?t=_R(t):t=ml(t);for(var e=this._groups,n=e.length,r=[],o=[],i=0;i<n;++i)for(var s=e[i],a=s.length,c,f=0;f<a;++f)(c=s[f])&&(r.push(t.call(c,c.__data__,f,s)),o.push(c));return new se(r,o)}function gl(t){return function(){return this.matches(t)}}function s0(t){return function(e){return e.matches(t)}}var MR=Array.prototype.find;function SR(t){return function(){return MR.call(this.children,t)}}function AR(){return this.firstElementChild}function h5(t){return this.select(t==null?AR:SR(typeof t=="function"?t:s0(t)))}var ER=Array.prototype.filter;function TR(){return Array.from(this.children)}function IR(t){return function(){return ER.call(this.children,t)}}function d5(t){return this.selectAll(t==null?TR:IR(typeof t=="function"?t:s0(t)))}function m5(t){typeof t!="function"&&(t=gl(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],s=i.length,a=r[o]=[],c,f=0;f<s;++f)(c=i[f])&&t.call(c,c.__data__,f,i)&&a.push(c);return new se(r,this._parents)}function a0(t){return new Array(t.length)}function g5(){return new se(this._enter||this._groups.map(a0),this._parents)}function yl(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}yl.prototype={constructor:yl,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function y5(t){return function(){return t}}function CR(t,e,n,r,o,i){for(var s=0,a,c=e.length,f=i.length;s<f;++s)(a=e[s])?(a.__data__=i[s],r[s]=a):n[s]=new yl(t,i[s]);for(;s<c;++s)(a=e[s])&&(o[s]=a)}function NR(t,e,n,r,o,i,s){var a,c,f=new Map,u=e.length,p=i.length,l=new Array(u),h;for(a=0;a<u;++a)(c=e[a])&&(l[a]=h=s.call(c,c.__data__,a,e)+"",f.has(h)?o[a]=c:f.set(h,c));for(a=0;a<p;++a)h=s.call(t,i[a],a,i)+"",(c=f.get(h))?(r[a]=c,c.__data__=i[a],f.delete(h)):n[a]=new yl(t,i[a]);for(a=0;a<u;++a)(c=e[a])&&f.get(l[a])===c&&(o[a]=c)}function kR(t){return t.__data__}function x5(t,e){if(!arguments.length)return Array.from(this,kR);var n=e?NR:CR,r=this._parents,o=this._groups;typeof t!="function"&&(t=y5(t));for(var i=o.length,s=new Array(i),a=new Array(i),c=new Array(i),f=0;f<i;++f){var u=r[f],p=o[f],l=p.length,h=RR(t.call(u,u&&u.__data__,f,r)),d=h.length,m=a[f]=new Array(d),g=s[f]=new Array(d),y=c[f]=new Array(l);n(u,p,m,g,y,h,e);for(var x=0,b=0,w,_;x<d;++x)if(w=m[x]){for(x>=b&&(b=x+1);!(_=g[b])&&++b<d;);w._next=_||null}}return s=new se(s,r),s._enter=a,s._exit=c,s}function RR(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function b5(){return new se(this._exit||this._groups.map(a0),this._parents)}function w5(t,e,n){var r=this.enter(),o=this,i=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function v5(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),c=0;c<s;++c)for(var f=n[c],u=r[c],p=f.length,l=a[c]=new Array(p),h,d=0;d<p;++d)(h=f[d]||u[d])&&(l[d]=h);for(;c<o;++c)a[c]=n[c];return new se(a,this._parents)}function _5(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function M5(t){t||(t=LR);function e(p,l){return p&&l?t(p.__data__,l.__data__):!p-!l}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,c=o[i]=new Array(a),f,u=0;u<a;++u)(f=s[u])&&(c[u]=f);c.sort(e)}return new se(o,this._parents).order()}function LR(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function S5(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function A5(){return Array.from(this)}function E5(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function T5(){let t=0;for(let e of this)++t;return t}function I5(){return!this.node()}function C5(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o=e[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&t.call(a,a.__data__,i,o);return this}function OR(t){return function(){this.removeAttribute(t)}}function $R(t){return function(){this.removeAttributeNS(t.space,t.local)}}function DR(t,e){return function(){this.setAttribute(t,e)}}function FR(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function PR(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function qR(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function N5(t,e){var n=Zo(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?$R:OR:typeof e=="function"?n.local?qR:PR:n.local?FR:DR)(n,e))}function c0(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function BR(t){return function(){this.style.removeProperty(t)}}function zR(t,e,n){return function(){this.style.setProperty(t,e,n)}}function YR(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function k5(t,e,n){return arguments.length>1?this.each((e==null?BR:typeof e=="function"?YR:zR)(t,e,n??"")):Wi(this.node(),t)}function Wi(t,e){return t.style.getPropertyValue(e)||c0(t).getComputedStyle(t,null).getPropertyValue(e)}function UR(t){return function(){delete this[t]}}function jR(t,e){return function(){this[t]=e}}function XR(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function R5(t,e){return arguments.length>1?this.each((e==null?UR:typeof e=="function"?XR:jR)(t,e)):this.node()[t]}function L5(t){return t.trim().split(/^|\s+/)}function S2(t){return t.classList||new O5(t)}function O5(t){this._node=t,this._names=L5(t.getAttribute("class")||"")}O5.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function $5(t,e){for(var n=S2(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function D5(t,e){for(var n=S2(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function WR(t){return function(){$5(this,t)}}function GR(t){return function(){D5(this,t)}}function VR(t,e){return function(){(e.apply(this,arguments)?$5:D5)(this,t)}}function F5(t,e){var n=L5(t+"");if(arguments.length<2){for(var r=S2(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof e=="function"?VR:e?WR:GR)(n,e))}function HR(){this.textContent=""}function QR(t){return function(){this.textContent=t}}function ZR(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function P5(t){return arguments.length?this.each(t==null?HR:(typeof t=="function"?ZR:QR)(t)):this.node().textContent}function KR(){this.innerHTML=""}function JR(t){return function(){this.innerHTML=t}}function tL(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function q5(t){return arguments.length?this.each(t==null?KR:(typeof t=="function"?tL:JR)(t)):this.node().innerHTML}function eL(){this.nextSibling&&this.parentNode.appendChild(this)}function B5(){return this.each(eL)}function nL(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function z5(){return this.each(nL)}function Y5(t){var e=typeof t=="function"?t:Ko(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function rL(){return null}function U5(t,e){var n=typeof t=="function"?t:Ko(t),r=e==null?rL:typeof e=="function"?e:ia(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function oL(){var t=this.parentNode;t&&t.removeChild(this)}function j5(){return this.each(oL)}function iL(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function sL(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function X5(t){return this.select(t?sL:iL)}function W5(t){return arguments.length?this.property("__data__",t):this.node().__data__}function aL(t){return function(e){t.call(this,e,this.__data__)}}function cL(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function fL(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,o=e.length,i;n<o;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++r]=i;++r?e.length=r:delete this.__on}}}function uL(t,e,n){return function(){var r=this.__on,o,i=aL(e);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=e;return}}this.addEventListener(t.type,i,n),o={type:t.type,name:t.name,value:e,listener:i,options:n},r?r.push(o):this.__on=[o]}}function G5(t,e,n){var r=cL(t+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,f=a.length,u;c<f;++c)for(o=0,u=a[c];o<i;++o)if((s=r[o]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?uL:fL,o=0;o<i;++o)this.each(a(r[o],e,n));return this}function V5(t,e,n){var r=c0(t),o=r.CustomEvent;typeof o=="function"?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function lL(t,e){return function(){return V5(this,t,e)}}function pL(t,e){return function(){return V5(this,t,e.apply(this,arguments))}}function H5(t,e){return this.each((typeof e=="function"?pL:lL)(t,e))}function*Q5(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var A2=[null];function se(t,e){this._groups=t,this._parents=e}function Z5(){return new se([[document.documentElement]],A2)}function hL(){return this}se.prototype=Z5.prototype={constructor:se,select:l5,selectAll:p5,selectChild:h5,selectChildren:d5,filter:m5,data:x5,enter:g5,exit:b5,join:w5,merge:v5,selection:hL,order:_5,sort:M5,call:S5,nodes:A5,node:E5,size:T5,empty:I5,each:C5,attr:N5,style:k5,property:R5,classed:F5,text:P5,html:q5,raise:B5,lower:z5,append:Y5,insert:U5,remove:j5,clone:X5,datum:W5,on:G5,dispatch:H5,[Symbol.iterator]:Q5};var Jo=Z5;function At(t){return typeof t=="string"?new se([[document.querySelector(t)]],[document.documentElement]):new se([[t]],A2)}function K5(t){let e;for(;e=t.sourceEvent;)t=e;return t}function on(t,e){if(t=K5(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}var f0={capture:!0,passive:!1};function u0(t){t.preventDefault(),t.stopImmediatePropagation()}function xl(t){var e=t.document.documentElement,n=At(t).on("dragstart.drag",u0,f0);"onselectstart"in e?n.on("selectstart.drag",u0,f0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function bl(t,e){var n=t.document.documentElement,r=At(t).on("dragstart.drag",null);e&&(r.on("click.drag",u0,f0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function ti(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Gi(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function to(){}var Vi=.7,ca=1/Vi,Rc="\\s*([+-]?\\d+)\\s*",wl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dL=/^#([0-9a-f]{3,8})$/,mL=new RegExp(`^rgb\\(${Rc},${Rc},${Rc}\\)$`),gL=new RegExp(`^rgb\\(${Jr},${Jr},${Jr}\\)$`),yL=new RegExp(`^rgba\\(${Rc},${Rc},${Rc},${wl}\\)$`),xL=new RegExp(`^rgba\\(${Jr},${Jr},${Jr},${wl}\\)$`),bL=new RegExp(`^hsl\\(${wl},${Jr},${Jr}\\)$`),wL=new RegExp(`^hsla\\(${wl},${Jr},${Jr},${wl}\\)$`),J5={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};ti(to,Xn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:tM,formatHex:tM,formatHex8:vL,formatHsl:_L,formatRgb:eM,toString:eM});function tM(){return this.rgb().formatHex()}function vL(){return this.rgb().formatHex8()}function _L(){return aM(this).formatHsl()}function eM(){return this.rgb().formatRgb()}function Xn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=dL.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?nM(e):n===3?new ge(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?l0(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?l0(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=mL.exec(t))?new ge(e[1],e[2],e[3],1):(e=gL.exec(t))?new ge(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=yL.exec(t))?l0(e[1],e[2],e[3],e[4]):(e=xL.exec(t))?l0(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=bL.exec(t))?iM(e[1],e[2]/100,e[3]/100,1):(e=wL.exec(t))?iM(e[1],e[2]/100,e[3]/100,e[4]):J5.hasOwnProperty(t)?nM(J5[t]):t==="transparent"?new ge(NaN,NaN,NaN,0):null}function nM(t){return new ge(t>>16&255,t>>8&255,t&255,1)}function l0(t,e,n,r){return r<=0&&(t=e=n=NaN),new ge(t,e,n,r)}function vl(t){return t instanceof to||(t=Xn(t)),t?(t=t.rgb(),new ge(t.r,t.g,t.b,t.opacity)):new ge}function Ee(t,e,n,r){return arguments.length===1?vl(t):new ge(t,e,n,r??1)}function ge(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ti(ge,Ee,Gi(to,{brighter(t){return t=t==null?ca:Math.pow(ca,t),new ge(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Vi:Math.pow(Vi,t),new ge(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ge(aa(this.r),aa(this.g),aa(this.b),h0(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:rM,formatHex:rM,formatHex8:ML,formatRgb:oM,toString:oM}));function rM(){return`#${sa(this.r)}${sa(this.g)}${sa(this.b)}`}function ML(){return`#${sa(this.r)}${sa(this.g)}${sa(this.b)}${sa((isNaN(this.opacity)?1:this.opacity)*255)}`}function oM(){let t=h0(this.opacity);return`${t===1?"rgb(":"rgba("}${aa(this.r)}, ${aa(this.g)}, ${aa(this.b)}${t===1?")":`, ${t})`}`}function h0(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function aa(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function sa(t){return t=aa(t),(t<16?"0":"")+t.toString(16)}function iM(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Lr(t,e,n,r)}function aM(t){if(t instanceof Lr)return new Lr(t.h,t.s,t.l,t.opacity);if(t instanceof to||(t=Xn(t)),!t)return new Lr;if(t instanceof Lr)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),s=NaN,a=i-o,c=(i+o)/2;return a?(e===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-e)/a+2:s=(e-n)/a+4,a/=c<.5?i+o:2-i-o,s*=60):a=c>0&&c<1?0:s,new Lr(s,a,c,t.opacity)}function _l(t,e,n,r){return arguments.length===1?aM(t):new Lr(t,e,n,r??1)}function Lr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ti(Lr,_l,Gi(to,{brighter(t){return t=t==null?ca:Math.pow(ca,t),new Lr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Vi:Math.pow(Vi,t),new Lr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new ge(E2(t>=240?t-240:t+120,o,r),E2(t,o,r),E2(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new Lr(sM(this.h),p0(this.s),p0(this.l),h0(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=h0(this.opacity);return`${t===1?"hsl(":"hsla("}${sM(this.h)}, ${p0(this.s)*100}%, ${p0(this.l)*100}%${t===1?")":`, ${t})`}`}}));function sM(t){return t=(t||0)%360,t<0?t+360:t}function p0(t){return Math.max(0,Math.min(1,t||0))}function E2(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var d0=Math.PI/180,m0=180/Math.PI;var g0=18,cM=.96422,fM=1,uM=.82521,lM=4/29,Lc=6/29,pM=3*Lc*Lc,SL=Lc*Lc*Lc;function hM(t){if(t instanceof eo)return new eo(t.l,t.a,t.b,t.opacity);if(t instanceof ei)return dM(t);t instanceof ge||(t=vl(t));var e=N2(t.r),n=N2(t.g),r=N2(t.b),o=T2((.2225045*e+.7168786*n+.0606169*r)/fM),i,s;return e===n&&n===r?i=s=o:(i=T2((.4360747*e+.3850649*n+.1430804*r)/cM),s=T2((.0139322*e+.0971045*n+.7141733*r)/uM)),new eo(116*o-16,500*(i-o),200*(o-s),t.opacity)}function Oc(t,e,n,r){return arguments.length===1?hM(t):new eo(t,e,n,r??1)}function eo(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}ti(eo,Oc,Gi(to,{brighter(t){return new eo(this.l+g0*(t??1),this.a,this.b,this.opacity)},darker(t){return new eo(this.l-g0*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=cM*I2(e),t=fM*I2(t),n=uM*I2(n),new ge(C2(3.1338561*e-1.6168667*t-.4906146*n),C2(-.9787684*e+1.9161415*t+.033454*n),C2(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function T2(t){return t>SL?Math.pow(t,1/3):t/pM+lM}function I2(t){return t>Lc?t*t*t:pM*(t-lM)}function C2(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function N2(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function AL(t){if(t instanceof ei)return new ei(t.h,t.c,t.l,t.opacity);if(t instanceof eo||(t=hM(t)),t.a===0&&t.b===0)return new ei(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*m0;return new ei(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Ml(t,e,n,r){return arguments.length===1?AL(t):new ei(t,e,n,r??1)}function ei(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function dM(t){if(isNaN(t.h))return new eo(t.l,0,0,t.opacity);var e=t.h*d0;return new eo(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}ti(ei,Ml,Gi(to,{brighter(t){return new ei(this.h,this.c,this.l+g0*(t??1),this.opacity)},darker(t){return new ei(this.h,this.c,this.l-g0*(t??1),this.opacity)},rgb(){return dM(this).rgb()}}));var xM=-.14861,k2=1.78277,R2=-.29227,y0=-.90649,Sl=1.97294,mM=Sl*y0,gM=Sl*k2,yM=k2*R2-y0*xM;function EL(t){if(t instanceof fa)return new fa(t.h,t.s,t.l,t.opacity);t instanceof ge||(t=vl(t));var e=t.r/255,n=t.g/255,r=t.b/255,o=(yM*r+mM*e-gM*n)/(yM+mM-gM),i=r-o,s=(Sl*(n-o)-R2*i)/y0,a=Math.sqrt(s*s+i*i)/(Sl*o*(1-o)),c=a?Math.atan2(s,i)*m0-120:NaN;return new fa(c<0?c+360:c,a,o,t.opacity)}function Mn(t,e,n,r){return arguments.length===1?EL(t):new fa(t,e,n,r??1)}function fa(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ti(fa,Mn,Gi(to,{brighter(t){return t=t==null?ca:Math.pow(ca,t),new fa(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Vi:Math.pow(Vi,t),new fa(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*d0,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),o=Math.sin(t);return new ge(255*(e+n*(xM*r+k2*o)),255*(e+n*(R2*r+y0*o)),255*(e+n*(Sl*r)),this.opacity)}}));function L2(t,e,n,r,o){var i=t*t,s=i*t;return((1-3*t+3*i-s)*e+(4-6*i+3*s)*n+(1+3*t+3*i-3*s)*r+s*o)/6}function bM(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],s=r>0?t[r-1]:2*o-i,a=r<e-1?t[r+2]:2*i-o;return L2((n-r/e)*e,s,o,i,a)}}function wM(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],i=t[r%e],s=t[(r+1)%e],a=t[(r+2)%e];return L2((n-r/e)*e,o,i,s,a)}}var $c=t=>()=>t;function vM(t,e){return function(n){return t+n*e}}function TL(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Dc(t,e){var n=e-t;return n?vM(t,n>180||n<-180?n-360*Math.round(n/360):n):$c(isNaN(t)?e:t)}function _M(t){return(t=+t)==1?Kt:function(e,n){return n-e?TL(e,n,t):$c(isNaN(e)?n:e)}}function Kt(t,e){var n=e-t;return n?vM(t,n):$c(isNaN(t)?e:t)}var ur=function t(e){var n=_M(e);function r(o,i){var s=n((o=Ee(o)).r,(i=Ee(i)).r),a=n(o.g,i.g),c=n(o.b,i.b),f=Kt(o.opacity,i.opacity);return function(u){return o.r=s(u),o.g=a(u),o.b=c(u),o.opacity=f(u),o+""}}return r.gamma=t,r}(1);function MM(t){return function(e){var n=e.length,r=new Array(n),o=new Array(n),i=new Array(n),s,a;for(s=0;s<n;++s)a=Ee(e[s]),r[s]=a.r||0,o[s]=a.g||0,i[s]=a.b||0;return r=t(r),o=t(o),i=t(i),a.opacity=1,function(c){return a.r=r(c),a.g=o(c),a.b=i(c),a+""}}}var O2=MM(bM),IL=MM(wM);function SM(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=t[o]*(1-i)+e[o]*i;return r}}function AM(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function EM(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=Wn(t[s],e[s]);for(;s<n;++s)i[s]=e[s];return function(a){for(s=0;s<r;++s)i[s]=o[s](a);return i}}function TM(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Qt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function IM(t,e){var n={},r={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?n[o]=Wn(t[o],e[o]):r[o]=e[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var D2=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$2=new RegExp(D2.source,"g");function CL(t){return function(){return t}}function NL(t){return function(e){return t(e)+""}}function Al(t,e){var n=D2.lastIndex=$2.lastIndex=0,r,o,i,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=D2.exec(t))&&(o=$2.exec(e));)(i=o.index)>n&&(i=e.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,c.push({i:s,x:Qt(r,o)})),n=$2.lastIndex;return n<e.length&&(i=e.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?c[0]?NL(c[0].x):CL(e):(e=c.length,function(f){for(var u=0,p;u<e;++u)a[(p=c[u]).i]=p.x(f);return a.join("")})}function Wn(t,e){var n=typeof e,r;return e==null||n==="boolean"?$c(e):(n==="number"?Qt:n==="string"?(r=Xn(e))?(e=r,ur):Al:e instanceof Xn?ur:e instanceof Date?TM:AM(e)?SM:Array.isArray(e)?EM:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?IM:Qt)(t,e)}function ua(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var CM=180/Math.PI,x0={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function F2(t,e,n,r,o,i){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*CM,skewX:Math.atan(c)*CM,scaleX:s,scaleY:a}}var b0;function NM(t){let e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?x0:F2(e.a,e.b,e.c,e.d,e.e,e.f)}function kM(t){return t==null?x0:(b0||(b0=document.createElementNS("http://www.w3.org/2000/svg","g")),b0.setAttribute("transform",t),(t=b0.transform.baseVal.consolidate())?(t=t.matrix,F2(t.a,t.b,t.c,t.d,t.e,t.f)):x0)}function RM(t,e,n,r){function o(f){return f.length?f.pop()+" ":""}function i(f,u,p,l,h,d){if(f!==p||u!==l){var m=h.push("translate(",null,e,null,n);d.push({i:m-4,x:Qt(f,p)},{i:m-2,x:Qt(u,l)})}else(p||l)&&h.push("translate("+p+e+l+n)}function s(f,u,p,l){f!==u?(f-u>180?u+=360:u-f>180&&(f+=360),l.push({i:p.push(o(p)+"rotate(",null,r)-2,x:Qt(f,u)})):u&&p.push(o(p)+"rotate("+u+r)}function a(f,u,p,l){f!==u?l.push({i:p.push(o(p)+"skewX(",null,r)-2,x:Qt(f,u)}):u&&p.push(o(p)+"skewX("+u+r)}function c(f,u,p,l,h,d){if(f!==p||u!==l){var m=h.push(o(h)+"scale(",null,",",null,")");d.push({i:m-4,x:Qt(f,p)},{i:m-2,x:Qt(u,l)})}else(p!==1||l!==1)&&h.push(o(h)+"scale("+p+","+l+")")}return function(f,u){var p=[],l=[];return f=t(f),u=t(u),i(f.translateX,f.translateY,u.translateX,u.translateY,p,l),s(f.rotate,u.rotate,p,l),a(f.skewX,u.skewX,p,l),c(f.scaleX,f.scaleY,u.scaleX,u.scaleY,p,l),f=u=null,function(h){for(var d=-1,m=l.length,g;++d<m;)p[(g=l[d]).i]=g.x(h);return p.join("")}}}var P2=RM(NM,"px, ","px)","deg)"),q2=RM(kM,", ",")",")");var kL=1e-12;function LM(t){return((t=Math.exp(t))+1/t)/2}function RL(t){return((t=Math.exp(t))-1/t)/2}function LL(t){return((t=Math.exp(2*t))-1)/(t+1)}var B2=function t(e,n,r){function o(i,s){var a=i[0],c=i[1],f=i[2],u=s[0],p=s[1],l=s[2],h=u-a,d=p-c,m=h*h+d*d,g,y;if(m<kL)y=Math.log(l/f)/e,g=function(A){return[a+A*h,c+A*d,f*Math.exp(e*A*y)]};else{var x=Math.sqrt(m),b=(l*l-f*f+r*m)/(2*f*n*x),w=(l*l-f*f-r*m)/(2*l*n*x),_=Math.log(Math.sqrt(b*b+1)-b),v=Math.log(Math.sqrt(w*w+1)-w);y=(v-_)/e,g=function(A){var E=A*y,T=LM(_),C=f/(n*x)*(T*LL(e*E+_)-RL(_));return[a+C*h,c+C*d,f*T/LM(e*E+_)]}}return g.duration=y*1e3*e/Math.SQRT2,g}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return t(s,a,c)},o}(Math.SQRT2,2,4);function OM(t){return function(e,n){var r=t((e=_l(e)).h,(n=_l(n)).h),o=Kt(e.s,n.s),i=Kt(e.l,n.l),s=Kt(e.opacity,n.opacity);return function(a){return e.h=r(a),e.s=o(a),e.l=i(a),e.opacity=s(a),e+""}}}var z2=OM(Dc),OL=OM(Kt);function w0(t,e){var n=Kt((t=Oc(t)).l,(e=Oc(e)).l),r=Kt(t.a,e.a),o=Kt(t.b,e.b),i=Kt(t.opacity,e.opacity);return function(s){return t.l=n(s),t.a=r(s),t.b=o(s),t.opacity=i(s),t+""}}function $M(t){return function(e,n){var r=t((e=Ml(e)).h,(n=Ml(n)).h),o=Kt(e.c,n.c),i=Kt(e.l,n.l),s=Kt(e.opacity,n.opacity);return function(a){return e.h=r(a),e.c=o(a),e.l=i(a),e.opacity=s(a),e+""}}}var Y2=$M(Dc),$L=$M(Kt);function DM(t){return function e(n){n=+n;function r(o,i){var s=t((o=Mn(o)).h,(i=Mn(i)).h),a=Kt(o.s,i.s),c=Kt(o.l,i.l),f=Kt(o.opacity,i.opacity);return function(u){return o.h=s(u),o.s=a(u),o.l=c(Math.pow(u,n)),o.opacity=f(u),o+""}}return r.gamma=e,r}(1)}var DL=DM(Dc),Fc=DM(Kt);function no(t,e){e===void 0&&(e=t,t=Wn);for(var n=0,r=e.length-1,o=e[0],i=new Array(r<0?0:r);n<r;)i[n]=t(o,o=e[++n]);return function(s){var a=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return i[a](s-a)}}function sn(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}var Pc=0,Tl=0,El=0,PM=1e3,v0,Il,_0=0,la=0,M0=0,Cl=typeof performance=="object"&&performance.now?performance:Date,qM=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function kl(){return la||(qM(FL),la=Cl.now()+M0)}function FL(){la=0}function Nl(){this._call=this._time=this._next=null}Nl.prototype=S0.prototype={constructor:Nl,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?kl():+n)+(e==null?0:+e),!this._next&&Il!==this&&(Il?Il._next=this:v0=this,Il=this),this._call=t,this._time=n,U2()},stop:function(){this._call&&(this._call=null,this._time=1/0,U2())}};function S0(t,e,n){var r=new Nl;return r.restart(t,e,n),r}function BM(){kl(),++Pc;for(var t=v0,e;t;)(e=la-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Pc}function FM(){la=(_0=Cl.now())+M0,Pc=Tl=0;try{BM()}finally{Pc=0,qL(),la=0}}function PL(){var t=Cl.now(),e=t-_0;e>PM&&(M0-=e,_0=t)}function qL(){for(var t,e=v0,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:v0=n);Il=t,U2(r)}function U2(t){if(!Pc){Tl&&(Tl=clearTimeout(Tl));var e=t-la;e>24?(t<1/0&&(Tl=setTimeout(FM,t-Cl.now()-M0)),El&&(El=clearInterval(El))):(El||(_0=Cl.now(),El=setInterval(PL,PM)),Pc=1,qM(FM))}}function A0(t,e,n){var r=new Nl;return e=e==null?0:+e,r.restart(o=>{r.stop(),t(o+e)},e,n),r}var BL=oa("start","end","cancel","interrupt"),zL=[],UM=0,zM=1,T0=2,E0=3,YM=4,I0=5,Rl=6;function Hi(t,e,n,r,o,i){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;YL(t,n,{name:e,index:r,group:o,on:BL,tween:zL,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:UM})}function Ll(t,e){var n=Te(t,e);if(n.state>UM)throw new Error("too late; already scheduled");return n}function He(t,e){var n=Te(t,e);if(n.state>E0)throw new Error("too late; already running");return n}function Te(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function YL(t,e,n){var r=t.__transition,o;r[e]=n,n.timer=S0(i,0,n.time);function i(f){n.state=zM,n.timer.restart(s,n.delay,n.time),n.delay<=f&&s(f-n.delay)}function s(f){var u,p,l,h;if(n.state!==zM)return c();for(u in r)if(h=r[u],h.name===n.name){if(h.state===E0)return A0(s);h.state===YM?(h.state=Rl,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete r[u]):+u<e&&(h.state=Rl,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete r[u])}if(A0(function(){n.state===E0&&(n.state=YM,n.timer.restart(a,n.delay,n.time),a(f))}),n.state=T0,n.on.call("start",t,t.__data__,n.index,n.group),n.state===T0){for(n.state=E0,o=new Array(l=n.tween.length),u=0,p=-1;u<l;++u)(h=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(o[++p]=h);o.length=p+1}}function a(f){for(var u=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=I0,1),p=-1,l=o.length;++p<l;)o[p].call(t,u);n.state===I0&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=Rl,n.timer.stop(),delete r[e];for(var f in r)return;delete t.__transition}}function ro(t,e){var n=t.__transition,r,o,i=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){i=!1;continue}o=r.state>T0&&r.state<I0,r.state=Rl,r.timer.stop(),r.on.call(o?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}i&&delete t.__transition}}function jM(t){return this.each(function(){ro(this,t)})}function UL(t,e){var n,r;return function(){var o=He(this,t),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function jL(t,e,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=He(this,t),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:e,value:n},c=0,f=o.length;c<f;++c)if(o[c].name===e){o[c]=a;break}c===f&&o.push(a)}i.tween=o}}function XM(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Te(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===t)return s.value;return null}return this.each((e==null?UL:jL)(n,t,e))}function qc(t,e,n){var r=t._id;return t.each(function(){var o=He(this,r);(o.value||(o.value={}))[e]=n.apply(this,arguments)}),function(o){return Te(o,r).value[e]}}function C0(t,e){var n;return(typeof e=="number"?Qt:e instanceof Xn?ur:(n=Xn(e))?(e=n,ur):Al)(t,e)}function XL(t){return function(){this.removeAttribute(t)}}function WL(t){return function(){this.removeAttributeNS(t.space,t.local)}}function GL(t,e,n){var r,o=n+"",i;return function(){var s=this.getAttribute(t);return s===o?null:s===r?i:i=e(r=s,n)}}function VL(t,e,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===r?i:i=e(r=s,n)}}function HL(t,e,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=e(r=s,a)))}}function QL(t,e,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=e(r=s,a)))}}function WM(t,e){var n=Zo(t),r=n==="transform"?q2:C0;return this.attrTween(t,typeof e=="function"?(n.local?QL:HL)(n,r,qc(this,"attr."+t,e)):e==null?(n.local?WL:XL)(n):(n.local?VL:GL)(n,r,e))}function ZL(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function KL(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function JL(t,e){var n,r;function o(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&KL(t,i)),n}return o._value=e,o}function tO(t,e){var n,r;function o(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&ZL(t,i)),n}return o._value=e,o}function GM(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Zo(t);return this.tween(n,(r.local?JL:tO)(r,e))}function eO(t,e){return function(){Ll(this,t).delay=+e.apply(this,arguments)}}function nO(t,e){return e=+e,function(){Ll(this,t).delay=e}}function VM(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?eO:nO)(e,t)):Te(this.node(),e).delay}function rO(t,e){return function(){He(this,t).duration=+e.apply(this,arguments)}}function oO(t,e){return e=+e,function(){He(this,t).duration=e}}function HM(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?rO:oO)(e,t)):Te(this.node(),e).duration}function iO(t,e){if(typeof e!="function")throw new Error;return function(){He(this,t).ease=e}}function QM(t){var e=this._id;return arguments.length?this.each(iO(e,t)):Te(this.node(),e).ease}function sO(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;He(this,t).ease=n}}function ZM(t){if(typeof t!="function")throw new Error;return this.each(sO(this._id,t))}function KM(t){typeof t!="function"&&(t=gl(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],s=i.length,a=r[o]=[],c,f=0;f<s;++f)(c=i[f])&&t.call(c,c.__data__,f,i)&&a.push(c);return new Sn(r,this._parents,this._name,this._id)}function JM(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var c=e[a],f=n[a],u=c.length,p=s[a]=new Array(u),l,h=0;h<u;++h)(l=c[h]||f[h])&&(p[h]=l);for(;a<r;++a)s[a]=e[a];return new Sn(s,this._parents,this._name,this._id)}function aO(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function cO(t,e,n){var r,o,i=aO(e)?Ll:He;return function(){var s=i(this,t),a=s.on;a!==r&&(o=(r=a).copy()).on(e,n),s.on=o}}function t8(t,e){var n=this._id;return arguments.length<2?Te(this.node(),n).on.on(t):this.each(cO(n,t,e))}function fO(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function e8(){return this.on("end.remove",fO(this._id))}function n8(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ia(t));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],c=a.length,f=i[s]=new Array(c),u,p,l=0;l<c;++l)(u=a[l])&&(p=t.call(u,u.__data__,l,a))&&("__data__"in u&&(p.__data__=u.__data__),f[l]=p,Hi(f[l],e,n,l,f,Te(u,n)));return new Sn(i,this._parents,e,n)}function r8(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ml(t));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var c=r[a],f=c.length,u,p=0;p<f;++p)if(u=c[p]){for(var l=t.call(u,u.__data__,p,c),h,d=Te(u,n),m=0,g=l.length;m<g;++m)(h=l[m])&&Hi(h,e,n,m,l,d);i.push(l),s.push(u)}return new Sn(i,s,e,n)}var uO=Jo.prototype.constructor;function o8(){return new uO(this._groups,this._parents)}function lO(t,e){var n,r,o;return function(){var i=Wi(this,t),s=(this.style.removeProperty(t),Wi(this,t));return i===s?null:i===n&&s===r?o:o=e(n=i,r=s)}}function i8(t){return function(){this.style.removeProperty(t)}}function pO(t,e,n){var r,o=n+"",i;return function(){var s=Wi(this,t);return s===o?null:s===r?i:i=e(r=s,n)}}function hO(t,e,n){var r,o,i;return function(){var s=Wi(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),Wi(this,t))),s===c?null:s===r&&c===o?i:(o=c,i=e(r=s,a))}}function dO(t,e){var n,r,o,i="style."+e,s="end."+i,a;return function(){var c=He(this,t),f=c.on,u=c.value[i]==null?a||(a=i8(e)):void 0;(f!==n||o!==u)&&(r=(n=f).copy()).on(s,o=u),c.on=r}}function s8(t,e,n){var r=(t+="")=="transform"?P2:C0;return e==null?this.styleTween(t,lO(t,r)).on("end.style."+t,i8(t)):typeof e=="function"?this.styleTween(t,hO(t,r,qc(this,"style."+t,e))).each(dO(this._id,t)):this.styleTween(t,pO(t,r,e),n).on("end.style."+t,null)}function mO(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function gO(t,e,n){var r,o;function i(){var s=e.apply(this,arguments);return s!==o&&(r=(o=s)&&mO(t,s,n)),r}return i._value=e,i}function a8(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,gO(t,e,n??""))}function yO(t){return function(){this.textContent=t}}function xO(t){return function(){var e=t(this);this.textContent=e??""}}function c8(t){return this.tween("text",typeof t=="function"?xO(qc(this,"text",t)):yO(t==null?"":t+""))}function bO(t){return function(e){this.textContent=t.call(this,e)}}function wO(t){var e,n;function r(){var o=t.apply(this,arguments);return o!==n&&(e=(n=o)&&bO(o)),e}return r._value=t,r}function f8(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,wO(t))}function u8(){for(var t=this._name,e=this._id,n=N0(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,f=0;f<a;++f)if(c=s[f]){var u=Te(c,e);Hi(c,t,n,f,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Sn(r,this._parents,t,n)}function l8(){var t,e,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},c={value:function(){--o===0&&i()}};n.each(function(){var f=He(this,r),u=f.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),f.on=e}),o===0&&i()})}var vO=0;function Sn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function p8(t){return Jo().transition(t)}function N0(){return++vO}var ni=Jo.prototype;Sn.prototype=p8.prototype={constructor:Sn,select:n8,selectAll:r8,selectChild:ni.selectChild,selectChildren:ni.selectChildren,filter:KM,merge:JM,selection:o8,transition:u8,call:ni.call,nodes:ni.nodes,node:ni.node,size:ni.size,empty:ni.empty,each:ni.each,on:t8,attr:WM,attrTween:GM,style:s8,styleTween:a8,text:c8,textTween:f8,remove:e8,tween:XM,delay:VM,duration:HM,ease:QM,easeVarying:ZM,end:l8,[Symbol.iterator]:ni[Symbol.iterator]};function k0(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var _O={time:null,delay:0,duration:250,ease:k0};function MO(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function h8(t){var e,n;t instanceof Sn?(e=t._id,t=t._name):(e=N0(),(n=_O).time=kl(),t=t==null?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,f=0;f<a;++f)(c=s[f])&&Hi(c,t,e,f,s,n||MO(c,e));return new Sn(r,this._parents,t,e)}Jo.prototype.interrupt=jM;Jo.prototype.transition=h8;var R0=t=>()=>t;function j2(t,{sourceEvent:e,target:n,selection:r,mode:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function d8(t){t.stopImmediatePropagation()}function L0(t){t.preventDefault(),t.stopImmediatePropagation()}var m8={name:"drag"},X2={name:"space"},Bc={name:"handle"},zc={name:"center"},{abs:g8,max:an,min:cn}=Math;function y8(t){return[+t[0],+t[1]]}function G2(t){return[y8(t[0]),y8(t[1])]}var O0={name:"x",handles:["w","e"].map(Ol),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},$0={name:"y",handles:["n","s"].map(Ol),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},SO={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ol),input:function(t){return t==null?null:G2(t)},output:function(t){return t}},ri={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},x8={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},b8={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},AO={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},EO={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ol(t){return{type:t}}function TO(t){return!t.ctrlKey&&!t.button}function IO(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function CO(){return navigator.maxTouchPoints||"ontouchstart"in this}function W2(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function NO(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function V2(){return Z2(O0)}function H2(){return Z2($0)}function Q2(){return Z2(SO)}function Z2(t){var e=IO,n=TO,r=CO,o=!0,i=oa("start","brush","end"),s=6,a;function c(g){var y=g.property("__brush",m).selectAll(".overlay").data([Ol("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",ri.overlay).merge(y).each(function(){var b=W2(this).extent;At(this).attr("x",b[0][0]).attr("y",b[0][1]).attr("width",b[1][0]-b[0][0]).attr("height",b[1][1]-b[0][1])}),g.selectAll(".selection").data([Ol("selection")]).enter().append("rect").attr("class","selection").attr("cursor",ri.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var x=g.selectAll(".handle").data(t.handles,function(b){return b.type});x.exit().remove(),x.enter().append("rect").attr("class",function(b){return"handle handle--"+b.type}).attr("cursor",function(b){return ri[b.type]}),g.each(f).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",l).filter(r).on("touchstart.brush",l).on("touchmove.brush",h).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(g,y,x){g.tween?g.on("start.brush",function(b){u(this,arguments).beforestart().start(b)}).on("interrupt.brush end.brush",function(b){u(this,arguments).end(b)}).tween("brush",function(){var b=this,w=b.__brush,_=u(b,arguments),v=w.selection,A=t.input(typeof y=="function"?y.apply(this,arguments):y,w.extent),E=Wn(v,A);function T(C){w.selection=C===1&&A===null?null:E(C),f.call(b),_.brush()}return v!==null&&A!==null?T:T(1)}):g.each(function(){var b=this,w=arguments,_=b.__brush,v=t.input(typeof y=="function"?y.apply(b,w):y,_.extent),A=u(b,w).beforestart();ro(b),_.selection=v===null?null:v,f.call(b),A.start(x).brush(x).end(x)})},c.clear=function(g,y){c.move(g,null,y)};function f(){var g=At(this),y=W2(this).selection;y?(g.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),g.selectAll(".handle").style("display",null).attr("x",function(x){return x.type[x.type.length-1]==="e"?y[1][0]-s/2:y[0][0]-s/2}).attr("y",function(x){return x.type[0]==="s"?y[1][1]-s/2:y[0][1]-s/2}).attr("width",function(x){return x.type==="n"||x.type==="s"?y[1][0]-y[0][0]+s:s}).attr("height",function(x){return x.type==="e"||x.type==="w"?y[1][1]-y[0][1]+s:s})):g.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(g,y,x){var b=g.__brush.emitter;return b&&(!x||!b.clean)?b:new p(g,y,x)}function p(g,y,x){this.that=g,this.args=y,this.state=g.__brush,this.active=0,this.clean=x}p.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(g,y){return this.starting?(this.starting=!1,this.emit("start",g,y)):this.emit("brush",g),this},brush:function(g,y){return this.emit("brush",g,y),this},end:function(g,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",g,y)),this},emit:function(g,y,x){var b=At(this.that).datum();i.call(g,this.that,new j2(g,{sourceEvent:y,target:c,selection:t.output(this.state.selection),mode:x,dispatch:i}),b)}};function l(g){if(a&&!g.touches||!n.apply(this,arguments))return;var y=this,x=g.target.__data__.type,b=(o&&g.metaKey?x="overlay":x)==="selection"?m8:o&&g.altKey?zc:Bc,w=t===$0?null:AO[x],_=t===O0?null:EO[x],v=W2(y),A=v.extent,E=v.selection,T=A[0][0],C,S,k=A[0][1],L,M,I=A[1][0],N,R,$=A[1][1],O,D,F=0,P=0,W,K=w&&_&&o&&g.shiftKey,tt,nt,U=Array.from(g.touches||[g],Q=>{let qt=Q.identifier;return Q=on(Q,y),Q.point0=Q.slice(),Q.identifier=qt,Q});ro(y);var et=u(y,arguments,!0).beforestart();if(x==="overlay"){E&&(W=!0);let Q=[U[0],U[1]||U[0]];v.selection=E=[[C=t===$0?T:cn(Q[0][0],Q[1][0]),L=t===O0?k:cn(Q[0][1],Q[1][1])],[N=t===$0?I:an(Q[0][0],Q[1][0]),O=t===O0?$:an(Q[0][1],Q[1][1])]],U.length>1&&bt(g)}else C=E[0][0],L=E[0][1],N=E[1][0],O=E[1][1];S=C,M=L,R=N,D=O;var z=At(y).attr("pointer-events","none"),G=z.selectAll(".overlay").attr("cursor",ri[x]);if(g.touches)et.moved=q,et.ended=st;else{var J=At(g.view).on("mousemove.brush",q,!0).on("mouseup.brush",st,!0);o&&J.on("keydown.brush",Et,!0).on("keyup.brush",Ct,!0),xl(g.view)}f.call(y),et.start(g,b.name);function q(Q){for(let qt of Q.changedTouches||[Q])for(let Bn of U)Bn.identifier===qt.identifier&&(Bn.cur=on(qt,y));if(K&&!tt&&!nt&&U.length===1){let qt=U[0];g8(qt.cur[0]-qt[0])>g8(qt.cur[1]-qt[1])?nt=!0:tt=!0}for(let qt of U)qt.cur&&(qt[0]=qt.cur[0],qt[1]=qt.cur[1]);W=!0,L0(Q),bt(Q)}function bt(Q){let qt=U[0],Bn=qt.point0;var Yr;switch(F=qt[0]-Bn[0],P=qt[1]-Bn[1],b){case X2:case m8:{w&&(F=an(T-C,cn(I-N,F)),S=C+F,R=N+F),_&&(P=an(k-L,cn($-O,P)),M=L+P,D=O+P);break}case Bc:{U[1]?(w&&(S=an(T,cn(I,U[0][0])),R=an(T,cn(I,U[1][0])),w=1),_&&(M=an(k,cn($,U[0][1])),D=an(k,cn($,U[1][1])),_=1)):(w<0?(F=an(T-C,cn(I-C,F)),S=C+F,R=N):w>0&&(F=an(T-N,cn(I-N,F)),S=C,R=N+F),_<0?(P=an(k-L,cn($-L,P)),M=L+P,D=O):_>0&&(P=an(k-O,cn($-O,P)),M=L,D=O+P));break}case zc:{w&&(S=an(T,cn(I,C-F*w)),R=an(T,cn(I,N+F*w))),_&&(M=an(k,cn($,L-P*_)),D=an(k,cn($,O+P*_)));break}}R<S&&(w*=-1,Yr=C,C=N,N=Yr,Yr=S,S=R,R=Yr,x in x8&&G.attr("cursor",ri[x=x8[x]])),D<M&&(_*=-1,Yr=L,L=O,O=Yr,Yr=M,M=D,D=Yr,x in b8&&G.attr("cursor",ri[x=b8[x]])),v.selection&&(E=v.selection),tt&&(S=E[0][0],R=E[1][0]),nt&&(M=E[0][1],D=E[1][1]),(E[0][0]!==S||E[0][1]!==M||E[1][0]!==R||E[1][1]!==D)&&(v.selection=[[S,M],[R,D]],f.call(y),et.brush(Q,b.name))}function st(Q){if(d8(Q),Q.touches){if(Q.touches.length)return;a&&clearTimeout(a),a=setTimeout(function(){a=null},500)}else bl(Q.view,W),J.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);z.attr("pointer-events","all"),G.attr("cursor",ri.overlay),v.selection&&(E=v.selection),NO(E)&&(v.selection=null,f.call(y)),et.end(Q,b.name)}function Et(Q){switch(Q.keyCode){case 16:{K=w&&_;break}case 18:{b===Bc&&(w&&(N=R-F*w,C=S+F*w),_&&(O=D-P*_,L=M+P*_),b=zc,bt(Q));break}case 32:{(b===Bc||b===zc)&&(w<0?N=R-F:w>0&&(C=S-F),_<0?O=D-P:_>0&&(L=M-P),b=X2,G.attr("cursor",ri.selection),bt(Q));break}default:return}L0(Q)}function Ct(Q){switch(Q.keyCode){case 16:{K&&(tt=nt=K=!1,bt(Q));break}case 18:{b===zc&&(w<0?N=R:w>0&&(C=S),_<0?O=D:_>0&&(L=M),b=Bc,bt(Q));break}case 32:{b===X2&&(Q.altKey?(w&&(N=R-F*w,C=S+F*w),_&&(O=D-P*_,L=M+P*_),b=zc):(w<0?N=R:w>0&&(C=S),_<0?O=D:_>0&&(L=M),b=Bc),G.attr("cursor",ri[x]),bt(Q));break}default:return}L0(Q)}}function h(g){u(this,arguments).moved(g)}function d(g){u(this,arguments).ended(g)}function m(){var g=this.__brush||{selection:null};return g.extent=G2(e.apply(this,arguments)),g.dim=t,g}return c.extent=function(g){return arguments.length?(e=typeof g=="function"?g:R0(G2(g)),c):e},c.filter=function(g){return arguments.length?(n=typeof g=="function"?g:R0(!!g),c):n},c.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:R0(!!g),c):r},c.handleSize=function(g){return arguments.length?(s=+g,c):s},c.keyModifiers=function(g){return arguments.length?(o=!!g,c):o},c.on=function(){var g=i.on.apply(i,arguments);return g===i?c:g},c}var K2=Math.PI,J2=2*K2,pa=1e-6,kO=J2-pa;function w8(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function RO(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return w8;let n=10**e;return function(r){this._+=r[0];for(let o=1,i=r.length;o<i;++o)this._+=Math.round(arguments[o]*n)/n+r[o]}}var Qi=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?w8:RO(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,o){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+o}`}bezierCurveTo(e,n,r,o,i,s){this._append`C${+e},${+n},${+r},${+o},${this._x1=+i},${this._y1=+s}`}arcTo(e,n,r,o,i){if(e=+e,n=+n,r=+r,o=+o,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,a=this._y1,c=r-e,f=o-n,u=s-e,p=a-n,l=u*u+p*p;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(l>pa)if(!(Math.abs(p*c-f*u)>pa)||!i)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-s,d=o-a,m=c*c+f*f,g=h*h+d*d,y=Math.sqrt(m),x=Math.sqrt(l),b=i*Math.tan((K2-Math.acos((m+l-g)/(2*y*x)))/2),w=b/x,_=b/y;Math.abs(w-1)>pa&&this._append`L${e+w*u},${n+w*p}`,this._append`A${i},${i},0,0,${+(p*h>u*d)},${this._x1=e+_*c},${this._y1=n+_*f}`}}arc(e,n,r,o,i,s){if(e=+e,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(o),c=r*Math.sin(o),f=e+a,u=n+c,p=1^s,l=s?o-i:i-o;this._x1===null?this._append`M${f},${u}`:(Math.abs(this._x1-f)>pa||Math.abs(this._y1-u)>pa)&&this._append`L${f},${u}`,r&&(l<0&&(l=l%J2+J2),l>kO?this._append`A${r},${r},0,1,${p},${e-a},${n-c}A${r},${r},0,1,${p},${this._x1=f},${this._y1=u}`:l>pa&&this._append`A${r},${r},0,${+(l>=K2)},${p},${this._x1=e+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(e,n,r,o){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+o}h${-r}Z`}toString(){return this._}};function v8(){return new Qi}v8.prototype=Qi.prototype;function An(t=3){return new Qi(+t)}var LO=Array.prototype,D0=LO.slice;function _8(t,e){return t-e}function M8(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}var oo=t=>()=>t;function S8(t,e){for(var n=-1,r=e.length,o;++n<r;)if(o=OO(t,e[n]))return o;return 0}function OO(t,e){for(var n=e[0],r=e[1],o=-1,i=0,s=t.length,a=s-1;i<s;a=i++){var c=t[i],f=c[0],u=c[1],p=t[a],l=p[0],h=p[1];if($O(c,p,e))return 0;u>r!=h>r&&n<(l-f)*(r-u)/(h-u)+f&&(o=-o)}return o}function $O(t,e,n){var r;return DO(t,e,n)&&FO(t[r=+(t[0]===e[0])],n[r],e[r])}function DO(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function FO(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function A8(){}var oi=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Zi(){var t=1,e=1,n=ji,r=c;function o(f){var u=n(f);if(Array.isArray(u))u=u.slice().sort(_8);else{let p=Ot(f,PO);for(u=Ge(...Cc(p[0],p[1],u),u);u[u.length-1]>=p[1];)u.pop();for(;u[1]<p[0];)u.shift()}return u.map(p=>i(f,p))}function i(f,u){let p=u==null?NaN:+u;if(isNaN(p))throw new Error(`invalid value: ${u}`);var l=[],h=[];return s(f,p,function(d){r(d,f,p),M8(d)>0?l.push([d]):h.push(d)}),h.forEach(function(d){for(var m=0,g=l.length,y;m<g;++m)if(S8((y=l[m])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:u,coordinates:l}}function s(f,u,p){var l=new Array,h=new Array,d,m,g,y,x,b;for(d=m=-1,y=ha(f[0],u),oi[y<<1].forEach(w);++d<t-1;)g=y,y=ha(f[d+1],u),oi[g|y<<1].forEach(w);for(oi[y<<0].forEach(w);++m<e-1;){for(d=-1,y=ha(f[m*t+t],u),x=ha(f[m*t],u),oi[y<<1|x<<2].forEach(w);++d<t-1;)g=y,y=ha(f[m*t+t+d+1],u),b=x,x=ha(f[m*t+d+1],u),oi[g|y<<1|x<<2|b<<3].forEach(w);oi[y|x<<3].forEach(w)}for(d=-1,x=f[m*t]>=u,oi[x<<2].forEach(w);++d<t-1;)b=x,x=ha(f[m*t+d+1],u),oi[x<<2|b<<3].forEach(w);oi[x<<3].forEach(w);function w(_){var v=[_[0][0]+d,_[0][1]+m],A=[_[1][0]+d,_[1][1]+m],E=a(v),T=a(A),C,S;(C=h[E])?(S=l[T])?(delete h[C.end],delete l[S.start],C===S?(C.ring.push(A),p(C.ring)):l[C.start]=h[S.end]={start:C.start,end:S.end,ring:C.ring.concat(S.ring)}):(delete h[C.end],C.ring.push(A),h[C.end=T]=C):(C=l[T])?(S=h[E])?(delete l[C.start],delete h[S.end],C===S?(C.ring.push(A),p(C.ring)):l[S.start]=h[C.end]={start:S.start,end:C.end,ring:S.ring.concat(C.ring)}):(delete l[C.start],C.ring.unshift(v),l[C.start=E]=C):l[E]=h[T]={start:E,end:T,ring:[v,A]}}}function a(f){return f[0]*2+f[1]*(t+1)*4}function c(f,u,p){f.forEach(function(l){var h=l[0],d=l[1],m=h|0,g=d|0,y=tw(u[g*t+m]);h>0&&h<t&&m===h&&(l[0]=E8(h,tw(u[g*t+m-1]),y,p)),d>0&&d<e&&g===d&&(l[1]=E8(d,tw(u[(g-1)*t+m]),y,p))})}return o.contour=i,o.size=function(f){if(!arguments.length)return[t,e];var u=Math.floor(f[0]),p=Math.floor(f[1]);if(!(u>=0&&p>=0))throw new Error("invalid size");return t=u,e=p,o},o.thresholds=function(f){return arguments.length?(n=typeof f=="function"?f:Array.isArray(f)?oo(D0.call(f)):oo(f),o):n},o.smooth=function(f){return arguments.length?(r=f?c:A8,o):r===c},o}function PO(t){return isFinite(t)?t:NaN}function ha(t,e){return t==null?!1:+t>=e}function tw(t){return t==null||isNaN(t=+t)?-1/0:t}function E8(t,e,n,r){let o=r-e,i=n-e,s=isFinite(o)||isFinite(i)?o/i:Math.sign(o)/Math.sign(i);return isNaN(s)?t:t+s-.5}function qO(t){return t[0]}function BO(t){return t[1]}function zO(){return 1}function ew(){var t=qO,e=BO,n=zO,r=960,o=500,i=20,s=2,a=i*3,c=r+a*2>>s,f=o+a*2>>s,u=oo(20);function p(x){var b=new Float32Array(c*f),w=Math.pow(2,-s),_=-1;for(let L of x){var v=(t(L,++_,x)+a)*w,A=(e(L,_,x)+a)*w,E=+n(L,_,x);if(E&&v>=0&&v<c&&A>=0&&A<f){var T=Math.floor(v),C=Math.floor(A),S=v-T-.5,k=A-C-.5;b[T+C*c]+=(1-S)*(1-k)*E,b[T+1+C*c]+=S*(1-k)*E,b[T+1+(C+1)*c]+=S*k*E,b[T+(C+1)*c]+=(1-S)*k*E}}return fl({data:b,width:c,height:f},i*w),b}function l(x){var b=p(x),w=u(b),_=Math.pow(2,2*s);return Array.isArray(w)||(w=Ge(Number.MIN_VALUE,It(b)/_,w)),Zi().size([c,f]).thresholds(w.map(v=>v*_))(b).map((v,A)=>(v.value=+w[A],h(v)))}l.contours=function(x){var b=p(x),w=Zi().size([c,f]),_=Math.pow(2,2*s),v=A=>{A=+A;var E=h(w.contour(b,A*_));return E.value=A,E};return Object.defineProperty(v,"max",{get:()=>It(b)/_}),v};function h(x){return x.coordinates.forEach(d),x}function d(x){x.forEach(m)}function m(x){x.forEach(g)}function g(x){x[0]=x[0]*Math.pow(2,s)-a,x[1]=x[1]*Math.pow(2,s)-a}function y(){return a=i*3,c=r+a*2>>s,f=o+a*2>>s,l}return l.x=function(x){return arguments.length?(t=typeof x=="function"?x:oo(+x),l):t},l.y=function(x){return arguments.length?(e=typeof x=="function"?x:oo(+x),l):e},l.weight=function(x){return arguments.length?(n=typeof x=="function"?x:oo(+x),l):n},l.size=function(x){if(!arguments.length)return[r,o];var b=+x[0],w=+x[1];if(!(b>=0&&w>=0))throw new Error("invalid size");return r=b,o=w,y()},l.cellSize=function(x){if(!arguments.length)return 1<<s;if(!((x=+x)>=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(x)/Math.LN2),y()},l.thresholds=function(x){return arguments.length?(u=typeof x=="function"?x:Array.isArray(x)?oo(D0.call(x)):oo(x),l):u},l.bandwidth=function(x){if(!arguments.length)return Math.sqrt(i*(i+1));if(!((x=+x)>=0))throw new Error("invalid bandwidth");return i=(Math.sqrt(4*x*x+1)-1)/2,y()},l}var kt=11102230246251565e-32,ye=134217729,$l=(3+8*kt)*kt;function da(t,e,n,r,o){let i,s,a,c,f=e[0],u=r[0],p=0,l=0;u>f==u>-f?(i=f,f=e[++p]):(i=u,u=r[++l]);let h=0;if(p<t&&l<n)for(u>f==u>-f?(s=f+i,a=i-(s-f),f=e[++p]):(s=u+i,a=i-(s-u),u=r[++l]),i=s,a!==0&&(o[h++]=a);p<t&&l<n;)u>f==u>-f?(s=i+f,c=s-i,a=i-(s-c)+(f-c),f=e[++p]):(s=i+u,c=s-i,a=i-(s-c)+(u-c),u=r[++l]),i=s,a!==0&&(o[h++]=a);for(;p<t;)s=i+f,c=s-i,a=i-(s-c)+(f-c),f=e[++p],i=s,a!==0&&(o[h++]=a);for(;l<n;)s=i+u,c=s-i,a=i-(s-c)+(u-c),u=r[++l],i=s,a!==0&&(o[h++]=a);return(i!==0||h===0)&&(o[h++]=i),h}function Dl(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function Y(t){return new Float64Array(t)}var YO=(3+16*kt)*kt,UO=(2+12*kt)*kt,jO=(9+64*kt)*kt*kt,Yc=Y(4),T8=Y(8),I8=Y(12),C8=Y(16),En=Y(4);function XO(t,e,n,r,o,i,s){let a,c,f,u,p,l,h,d,m,g,y,x,b,w,_,v,A,E,T=t-o,C=n-o,S=e-i,k=r-i;w=T*k,l=ye*T,h=l-(l-T),d=T-h,l=ye*k,m=l-(l-k),g=k-m,_=d*g-(w-h*m-d*m-h*g),v=S*C,l=ye*S,h=l-(l-S),d=S-h,l=ye*C,m=l-(l-C),g=C-m,A=d*g-(v-h*m-d*m-h*g),y=_-A,p=_-y,Yc[0]=_-(y+p)+(p-A),x=w+y,p=x-w,b=w-(x-p)+(y-p),y=b-v,p=b-y,Yc[1]=b-(y+p)+(p-v),E=x+y,p=E-x,Yc[2]=x-(E-p)+(y-p),Yc[3]=E;let L=Dl(4,Yc),M=UO*s;if(L>=M||-L>=M||(p=t-T,a=t-(T+p)+(p-o),p=n-C,f=n-(C+p)+(p-o),p=e-S,c=e-(S+p)+(p-i),p=r-k,u=r-(k+p)+(p-i),a===0&&c===0&&f===0&&u===0)||(M=jO*s+$l*Math.abs(L),L+=T*u+k*a-(S*f+C*c),L>=M||-L>=M))return L;w=a*k,l=ye*a,h=l-(l-a),d=a-h,l=ye*k,m=l-(l-k),g=k-m,_=d*g-(w-h*m-d*m-h*g),v=c*C,l=ye*c,h=l-(l-c),d=c-h,l=ye*C,m=l-(l-C),g=C-m,A=d*g-(v-h*m-d*m-h*g),y=_-A,p=_-y,En[0]=_-(y+p)+(p-A),x=w+y,p=x-w,b=w-(x-p)+(y-p),y=b-v,p=b-y,En[1]=b-(y+p)+(p-v),E=x+y,p=E-x,En[2]=x-(E-p)+(y-p),En[3]=E;let I=da(4,Yc,4,En,T8);w=T*u,l=ye*T,h=l-(l-T),d=T-h,l=ye*u,m=l-(l-u),g=u-m,_=d*g-(w-h*m-d*m-h*g),v=S*f,l=ye*S,h=l-(l-S),d=S-h,l=ye*f,m=l-(l-f),g=f-m,A=d*g-(v-h*m-d*m-h*g),y=_-A,p=_-y,En[0]=_-(y+p)+(p-A),x=w+y,p=x-w,b=w-(x-p)+(y-p),y=b-v,p=b-y,En[1]=b-(y+p)+(p-v),E=x+y,p=E-x,En[2]=x-(E-p)+(y-p),En[3]=E;let N=da(I,T8,4,En,I8);w=a*u,l=ye*a,h=l-(l-a),d=a-h,l=ye*u,m=l-(l-u),g=u-m,_=d*g-(w-h*m-d*m-h*g),v=c*f,l=ye*c,h=l-(l-c),d=c-h,l=ye*f,m=l-(l-f),g=f-m,A=d*g-(v-h*m-d*m-h*g),y=_-A,p=_-y,En[0]=_-(y+p)+(p-A),x=w+y,p=x-w,b=w-(x-p)+(y-p),y=b-v,p=b-y,En[1]=b-(y+p)+(p-v),E=x+y,p=E-x,En[2]=x-(E-p)+(y-p),En[3]=E;let R=da(N,I8,4,En,C8);return C8[R-1]}function Uc(t,e,n,r,o,i){let s=(e-i)*(n-o),a=(t-o)*(r-i),c=s-a,f=Math.abs(s+a);return Math.abs(c)>=YO*f?c:-XO(t,e,n,r,o,i,f)}var fht=(7+56*kt)*kt,uht=(3+28*kt)*kt,lht=(26+288*kt)*kt*kt,pht=Y(4),hht=Y(4),dht=Y(4),mht=Y(4),ght=Y(4),yht=Y(4),xht=Y(4),bht=Y(4),wht=Y(4),vht=Y(8),_ht=Y(8),Mht=Y(8),Sht=Y(4),Aht=Y(8),Eht=Y(8),Tht=Y(8),Iht=Y(12),Cht=Y(192),Nht=Y(192);var Lht=(10+96*kt)*kt,Oht=(4+48*kt)*kt,$ht=(44+576*kt)*kt*kt,Dht=Y(4),Fht=Y(4),Pht=Y(4),qht=Y(4),Bht=Y(4),zht=Y(4),Yht=Y(4),Uht=Y(4),jht=Y(8),Xht=Y(8),Wht=Y(8),Ght=Y(8),Vht=Y(8),Hht=Y(8),Qht=Y(8),Zht=Y(8),Kht=Y(8),Jht=Y(4),tdt=Y(4),edt=Y(4),ndt=Y(8),rdt=Y(16),odt=Y(16),idt=Y(16),sdt=Y(32),adt=Y(32),cdt=Y(48),fdt=Y(64),udt=Y(1152),ldt=Y(1152);var mdt=(16+224*kt)*kt,gdt=(5+72*kt)*kt,ydt=(71+1408*kt)*kt*kt,xdt=Y(4),bdt=Y(4),wdt=Y(4),vdt=Y(4),_dt=Y(4),Mdt=Y(4),Sdt=Y(4),Adt=Y(4),Edt=Y(4),Tdt=Y(4),Idt=Y(24),Cdt=Y(24),Ndt=Y(24),kdt=Y(24),Rdt=Y(24),Ldt=Y(24),Odt=Y(24),$dt=Y(24),Ddt=Y(24),Fdt=Y(24),Pdt=Y(1152),qdt=Y(1152),Bdt=Y(1152),zdt=Y(1152),Ydt=Y(1152),Udt=Y(2304),jdt=Y(2304),Xdt=Y(3456),Wdt=Y(5760),Gdt=Y(8),Vdt=Y(8),Hdt=Y(8),Qdt=Y(16),Zdt=Y(24),Kdt=Y(48),Jdt=Y(48),tmt=Y(96),emt=Y(192),nmt=Y(384),rmt=Y(384),omt=Y(384),imt=Y(768);var smt=Y(96),amt=Y(96),cmt=Y(96),fmt=Y(1152);var k8=Math.pow(2,-52),F0=new Uint32Array(512),Xc=class t{static from(e,n=ZO,r=KO){let o=e.length,i=new Float64Array(o*2);for(let s=0;s<o;s++){let a=e[s];i[2*s]=n(a),i[2*s+1]=r(a)}return new t(i)}constructor(e){let n=e.length>>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;let r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){let{coords:e,_hullPrev:n,_hullNext:r,_hullTri:o,_hullHash:i}=this,s=e.length>>1,a=1/0,c=1/0,f=-1/0,u=-1/0;for(let T=0;T<s;T++){let C=e[2*T],S=e[2*T+1];C<a&&(a=C),S<c&&(c=S),C>f&&(f=C),S>u&&(u=S),this._ids[T]=T}let p=(a+f)/2,l=(c+u)/2,h,d,m;for(let T=0,C=1/0;T<s;T++){let S=nw(p,l,e[2*T],e[2*T+1]);S<C&&(h=T,C=S)}let g=e[2*h],y=e[2*h+1];for(let T=0,C=1/0;T<s;T++){if(T===h)continue;let S=nw(g,y,e[2*T],e[2*T+1]);S<C&&S>0&&(d=T,C=S)}let x=e[2*d],b=e[2*d+1],w=1/0;for(let T=0;T<s;T++){if(T===h||T===d)continue;let C=HO(g,y,x,b,e[2*T],e[2*T+1]);C<w&&(m=T,w=C)}let _=e[2*m],v=e[2*m+1];if(w===1/0){for(let S=0;S<s;S++)this._dists[S]=e[2*S]-e[0]||e[2*S+1]-e[1];jc(this._ids,this._dists,0,s-1);let T=new Uint32Array(s),C=0;for(let S=0,k=-1/0;S<s;S++){let L=this._ids[S],M=this._dists[L];M>k&&(T[C++]=L,k=M)}this.hull=T.subarray(0,C),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Uc(g,y,x,b,_,v)<0){let T=d,C=x,S=b;d=m,x=_,b=v,m=T,_=C,v=S}let A=QO(g,y,x,b,_,v);this._cx=A.x,this._cy=A.y;for(let T=0;T<s;T++)this._dists[T]=nw(e[2*T],e[2*T+1],A.x,A.y);jc(this._ids,this._dists,0,s-1),this._hullStart=h;let E=3;r[h]=n[m]=d,r[d]=n[h]=m,r[m]=n[d]=h,o[h]=0,o[d]=1,o[m]=2,i.fill(-1),i[this._hashKey(g,y)]=h,i[this._hashKey(x,b)]=d,i[this._hashKey(_,v)]=m,this.trianglesLen=0,this._addTriangle(h,d,m,-1,-1,-1);for(let T=0,C,S;T<this._ids.length;T++){let k=this._ids[T],L=e[2*k],M=e[2*k+1];if(T>0&&Math.abs(L-C)<=k8&&Math.abs(M-S)<=k8||(C=L,S=M,k===h||k===d||k===m))continue;let I=0;for(let D=0,F=this._hashKey(L,M);D<this._hashSize&&(I=i[(F+D)%this._hashSize],!(I!==-1&&I!==r[I]));D++);I=n[I];let N=I,R;for(;R=r[N],Uc(L,M,e[2*N],e[2*N+1],e[2*R],e[2*R+1])>=0;)if(N=R,N===I){N=-1;break}if(N===-1)continue;let $=this._addTriangle(N,k,r[N],-1,-1,o[N]);o[k]=this._legalize($+2),o[N]=$,E++;let O=r[N];for(;R=r[O],Uc(L,M,e[2*O],e[2*O+1],e[2*R],e[2*R+1])<0;)$=this._addTriangle(O,k,R,o[k],-1,o[O]),o[k]=this._legalize($+2),r[O]=O,E--,O=R;if(N===I)for(;R=n[N],Uc(L,M,e[2*R],e[2*R+1],e[2*N],e[2*N+1])<0;)$=this._addTriangle(R,k,N,-1,o[N],o[R]),this._legalize($+2),o[R]=$,r[N]=N,E--,N=R;this._hullStart=n[k]=N,r[N]=n[O]=k,r[k]=O,i[this._hashKey(L,M)]=k,i[this._hashKey(e[2*N],e[2*N+1])]=N}this.hull=new Uint32Array(E);for(let T=0,C=this._hullStart;T<E;T++)this.hull[T]=C,C=r[C];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,n){return Math.floor(GO(e-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(e){let{_triangles:n,_halfedges:r,coords:o}=this,i=0,s=0;for(;;){let a=r[e],c=e-e%3;if(s=c+(e+2)%3,a===-1){if(i===0)break;e=F0[--i];continue}let f=a-a%3,u=c+(e+1)%3,p=f+(a+2)%3,l=n[s],h=n[e],d=n[u],m=n[p];if(VO(o[2*l],o[2*l+1],o[2*h],o[2*h+1],o[2*d],o[2*d+1],o[2*m],o[2*m+1])){n[e]=m,n[a]=l;let y=r[p];if(y===-1){let b=this._hullStart;do{if(this._hullTri[b]===p){this._hullTri[b]=e;break}b=this._hullPrev[b]}while(b!==this._hullStart)}this._link(e,y),this._link(a,r[s]),this._link(s,p);let x=f+(a+1)%3;i<F0.length&&(F0[i++]=x)}else{if(i===0)break;e=F0[--i]}}return s}_link(e,n){this._halfedges[e]=n,n!==-1&&(this._halfedges[n]=e)}_addTriangle(e,n,r,o,i,s){let a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=n,this._triangles[a+2]=r,this._link(a,o),this._link(a+1,i),this._link(a+2,s),this.trianglesLen+=3,a}};function GO(t,e){let n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}function nw(t,e,n,r){let o=t-n,i=e-r;return o*o+i*i}function VO(t,e,n,r,o,i,s,a){let c=t-s,f=e-a,u=n-s,p=r-a,l=o-s,h=i-a,d=c*c+f*f,m=u*u+p*p,g=l*l+h*h;return c*(p*g-m*h)-f*(u*g-m*l)+d*(u*h-p*l)<0}function HO(t,e,n,r,o,i){let s=n-t,a=r-e,c=o-t,f=i-e,u=s*s+a*a,p=c*c+f*f,l=.5/(s*f-a*c),h=(f*u-a*p)*l,d=(s*p-c*u)*l;return h*h+d*d}function QO(t,e,n,r,o,i){let s=n-t,a=r-e,c=o-t,f=i-e,u=s*s+a*a,p=c*c+f*f,l=.5/(s*f-a*c),h=t+(f*u-a*p)*l,d=e+(s*p-c*u)*l;return{x:h,y:d}}function jc(t,e,n,r){if(r-n<=20)for(let o=n+1;o<=r;o++){let i=t[o],s=e[i],a=o-1;for(;a>=n&&e[t[a]]>s;)t[a+1]=t[a--];t[a+1]=i}else{let o=n+r>>1,i=n+1,s=r;Fl(t,o,i),e[t[n]]>e[t[r]]&&Fl(t,n,r),e[t[i]]>e[t[r]]&&Fl(t,i,r),e[t[n]]>e[t[i]]&&Fl(t,n,i);let a=t[i],c=e[a];for(;;){do i++;while(e[t[i]]<c);do s--;while(e[t[s]]>c);if(s<i)break;Fl(t,i,s)}t[n+1]=t[s],t[s]=a,r-i+1>=s-n?(jc(t,e,i,r),jc(t,e,n,s-1)):(jc(t,e,n,s-1),jc(t,e,i,r))}}function Fl(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}function ZO(t){return t[0]}function KO(t){return t[1]}var lr=class{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;let o=e+r,i=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${o},${i}`:(Math.abs(this._x1-o)>1e-6||Math.abs(this._y1-i)>1e-6)&&(this._+="L"+o+","+i),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=o},${this._y1=i}`)}rect(e,n,r,o){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+o}h${-r}Z`}value(){return this._||null}};var Ki=class{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}};var Pl=class{constructor(e,[n,r,o,i]=[0,0,960,500]){if(!((o=+o)>=(n=+n))||!((i=+i)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=o,this.xmin=n,this.ymax=i,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let{delaunay:{points:e,hull:n,triangles:r},vectors:o}=this,i,s,a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let m=0,g=0,y=r.length,x,b;m<y;m+=3,g+=2){let w=r[m]*2,_=r[m+1]*2,v=r[m+2]*2,A=e[w],E=e[w+1],T=e[_],C=e[_+1],S=e[v],k=e[v+1],L=T-A,M=C-E,I=S-A,N=k-E,R=(L*N-M*I)*2;if(Math.abs(R)<1e-9){if(i===void 0){i=s=0;for(let O of n)i+=e[O*2],s+=e[O*2+1];i/=n.length,s/=n.length}let $=1e9*Math.sign((i-A)*N-(s-E)*I);x=(A+S)/2-$*N,b=(E+k)/2+$*I}else{let $=1/R,O=L*L+M*M,D=I*I+N*N;x=A+(N*O-M*D)*$,b=E+(L*D-I*O)*$}a[g]=x,a[g+1]=b}let c=n[n.length-1],f,u=c*4,p,l=e[2*c],h,d=e[2*c+1];o.fill(0);for(let m=0;m<n.length;++m)c=n[m],f=u,p=l,h=d,u=c*4,l=e[2*c],d=e[2*c+1],o[f+2]=o[u]=h-d,o[f+3]=o[u+1]=l-p}render(e){let n=e==null?e=new lr:void 0,{delaunay:{halfedges:r,inedges:o,hull:i},circumcenters:s,vectors:a}=this;if(i.length<=1)return null;for(let u=0,p=r.length;u<p;++u){let l=r[u];if(l<u)continue;let h=Math.floor(u/3)*2,d=Math.floor(l/3)*2,m=s[h],g=s[h+1],y=s[d],x=s[d+1];this._renderSegment(m,g,y,x,e)}let c,f=i[i.length-1];for(let u=0;u<i.length;++u){c=f,f=i[u];let p=Math.floor(o[f]/3)*2,l=s[p],h=s[p+1],d=c*4,m=this._project(l,h,a[d+2],a[d+3]);m&&this._renderSegment(l,h,m[0],m[1],e)}return n&&n.value()}renderBounds(e){let n=e==null?e=new lr:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(e,n){let r=n==null?n=new lr:void 0,o=this._clip(e);if(o===null||!o.length)return;n.moveTo(o[0],o[1]);let i=o.length;for(;o[0]===o[i-2]&&o[1]===o[i-1]&&i>1;)i-=2;for(let s=2;s<i;s+=2)(o[s]!==o[s-2]||o[s+1]!==o[s-1])&&n.lineTo(o[s],o[s+1]);return n.closePath(),r&&r.value()}*cellPolygons(){let{delaunay:{points:e}}=this;for(let n=0,r=e.length/2;n<r;++n){let o=this.cellPolygon(n);o&&(o.index=n,yield o)}}cellPolygon(e){let n=new Ki;return this.renderCell(e,n),n.value()}_renderSegment(e,n,r,o,i){let s,a=this._regioncode(e,n),c=this._regioncode(r,o);a===0&&c===0?(i.moveTo(e,n),i.lineTo(r,o)):(s=this._clipSegment(e,n,r,o,a,c))&&(i.moveTo(s[0],s[1]),i.lineTo(s[2],s[3]))}contains(e,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(e,n,r)===e}*neighbors(e){let n=this._clip(e);if(n)for(let r of this.delaunay.neighbors(e)){let o=this._clip(r);if(o){t:for(let i=0,s=n.length;i<s;i+=2)for(let a=0,c=o.length;a<c;a+=2)if(n[i]===o[a]&&n[i+1]===o[a+1]&&n[(i+2)%s]===o[(a+c-2)%c]&&n[(i+3)%s]===o[(a+c-1)%c]){yield r;break t}}}}_cell(e){let{circumcenters:n,delaunay:{inedges:r,halfedges:o,triangles:i}}=this,s=r[e];if(s===-1)return null;let a=[],c=s;do{let f=Math.floor(c/3);if(a.push(n[f*2],n[f*2+1]),c=c%3===2?c-2:c+1,i[c]!==e)break;c=o[c]}while(c!==s&&c!==-1);return a}_clip(e){if(e===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];let n=this._cell(e);if(n===null)return null;let{vectors:r}=this,o=e*4;return this._simplify(r[o]||r[o+1]?this._clipInfinite(e,n,r[o],r[o+1],r[o+2],r[o+3]):this._clipFinite(e,n))}_clipFinite(e,n){let r=n.length,o=null,i,s,a=n[r-2],c=n[r-1],f,u=this._regioncode(a,c),p,l=0;for(let h=0;h<r;h+=2)if(i=a,s=c,a=n[h],c=n[h+1],f=u,u=this._regioncode(a,c),f===0&&u===0)p=l,l=0,o?o.push(a,c):o=[a,c];else{let d,m,g,y,x;if(f===0){if((d=this._clipSegment(i,s,a,c,f,u))===null)continue;[m,g,y,x]=d}else{if((d=this._clipSegment(a,c,i,s,u,f))===null)continue;[y,x,m,g]=d,p=l,l=this._edgecode(m,g),p&&l&&this._edge(e,p,l,o,o.length),o?o.push(m,g):o=[m,g]}p=l,l=this._edgecode(y,x),p&&l&&this._edge(e,p,l,o,o.length),o?o.push(y,x):o=[y,x]}if(o)p=l,l=this._edgecode(o[0],o[1]),p&&l&&this._edge(e,p,l,o,o.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return o}_clipSegment(e,n,r,o,i,s){let a=i<s;for(a&&([e,n,r,o,i,s]=[r,o,e,n,s,i]);;){if(i===0&&s===0)return a?[r,o,e,n]:[e,n,r,o];if(i&s)return null;let c,f,u=i||s;u&8?(c=e+(r-e)*(this.ymax-n)/(o-n),f=this.ymax):u&4?(c=e+(r-e)*(this.ymin-n)/(o-n),f=this.ymin):u&2?(f=n+(o-n)*(this.xmax-e)/(r-e),c=this.xmax):(f=n+(o-n)*(this.xmin-e)/(r-e),c=this.xmin),i?(e=c,n=f,i=this._regioncode(e,n)):(r=c,o=f,s=this._regioncode(r,o))}}_clipInfinite(e,n,r,o,i,s){let a=Array.from(n),c;if((c=this._project(a[0],a[1],r,o))&&a.unshift(c[0],c[1]),(c=this._project(a[a.length-2],a[a.length-1],i,s))&&a.push(c[0],c[1]),a=this._clipFinite(e,a))for(let f=0,u=a.length,p,l=this._edgecode(a[u-2],a[u-1]);f<u;f+=2)p=l,l=this._edgecode(a[f],a[f+1]),p&&l&&(f=this._edge(e,p,l,a,f),u=a.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(e,n,r,o,i){for(;n!==r;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(o[i]!==s||o[i+1]!==a)&&this.contains(e,s,a)&&(o.splice(i,0,s,a),i+=2)}return i}_project(e,n,r,o){let i=1/0,s,a,c;if(o<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/o)<i&&(c=this.ymin,a=e+(i=s)*r)}else if(o>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/o)<i&&(c=this.ymax,a=e+(i=s)*r)}if(r>0){if(e>=this.xmax)return null;(s=(this.xmax-e)/r)<i&&(a=this.xmax,c=n+(i=s)*o)}else if(r<0){if(e<=this.xmin)return null;(s=(this.xmin-e)/r)<i&&(a=this.xmin,c=n+(i=s)*o)}return[a,c]}_edgecode(e,n){return(e===this.xmin?1:e===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(e,n){return(e<this.xmin?1:e>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n<e.length;n+=2){let r=(n+2)%e.length,o=(n+4)%e.length;(e[n]===e[r]&&e[r]===e[o]||e[n+1]===e[r+1]&&e[r+1]===e[o+1])&&(e.splice(r,2),n-=2)}e.length||(e=null)}return e}};var JO=2*Math.PI,Wc=Math.pow;function t$(t){return t[0]}function e$(t){return t[1]}function n$(t){let{triangles:e,coords:n}=t;for(let r=0;r<e.length;r+=3){let o=2*e[r],i=2*e[r+1],s=2*e[r+2];if((n[s]-n[o])*(n[i+1]-n[o+1])-(n[i]-n[o])*(n[s+1]-n[o+1])>1e-10)return!1}return!0}function r$(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}var pr=class t{static from(e,n=t$,r=e$,o){return new t("length"in e?o$(e,n,r,o):Float64Array.from(i$(e,n,r,o)))}constructor(e){this._delaunator=new Xc(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){let e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&n$(e)){this.collinear=Int32Array.from({length:n.length/2},(l,h)=>h).sort((l,h)=>n[2*l]-n[2*h]||n[2*l+1]-n[2*h+1]);let c=this.collinear[0],f=this.collinear[this.collinear.length-1],u=[n[2*c],n[2*c+1],n[2*f],n[2*f+1]],p=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let l=0,h=n.length/2;l<h;++l){let d=r$(n[2*l],n[2*l+1],p);n[2*l]=d[0],n[2*l+1]=d[1]}this._delaunator=new Xc(n)}else delete this.collinear;let r=this.halfedges=this._delaunator.halfedges,o=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let c=0,f=r.length;c<f;++c){let u=i[c%3===2?c-2:c+1];(r[c]===-1||s[u]===-1)&&(s[u]=c)}for(let c=0,f=o.length;c<f;++c)a[o[c]]=c;o.length<=2&&o.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=o[0],s[o[0]]=1,o.length===2&&(s[o[1]]=0,this.triangles[1]=o[1],this.triangles[2]=o[1]))}voronoi(e){return new Pl(this,e)}*neighbors(e){let{inedges:n,hull:r,_hullIndex:o,halfedges:i,triangles:s,collinear:a}=this;if(a){let p=a.indexOf(e);p>0&&(yield a[p-1]),p<a.length-1&&(yield a[p+1]);return}let c=n[e];if(c===-1)return;let f=c,u=-1;do{if(yield u=s[f],f=f%3===2?f-2:f+1,s[f]!==e)return;if(f=i[f],f===-1){let p=r[(o[e]+1)%r.length];p!==u&&(yield p);return}}while(f!==c)}find(e,n,r=0){if(e=+e,e!==e||(n=+n,n!==n))return-1;let o=r,i;for(;(i=this._step(r,e,n))>=0&&i!==r&&i!==o;)r=i;return i}_step(e,n,r){let{inedges:o,hull:i,_hullIndex:s,halfedges:a,triangles:c,points:f}=this;if(o[e]===-1||!f.length)return(e+1)%(f.length>>1);let u=e,p=Wc(n-f[e*2],2)+Wc(r-f[e*2+1],2),l=o[e],h=l;do{let d=c[h],m=Wc(n-f[d*2],2)+Wc(r-f[d*2+1],2);if(m<p&&(p=m,u=d),h=h%3===2?h-2:h+1,c[h]!==e)break;if(h=a[h],h===-1){if(h=i[(s[e]+1)%i.length],h!==d&&Wc(n-f[h*2],2)+Wc(r-f[h*2+1],2)<p)return h;break}}while(h!==l);return u}render(e){let n=e==null?e=new lr:void 0,{points:r,halfedges:o,triangles:i}=this;for(let s=0,a=o.length;s<a;++s){let c=o[s];if(c<s)continue;let f=i[s]*2,u=i[c]*2;e.moveTo(r[f],r[f+1]),e.lineTo(r[u],r[u+1])}return this.renderHull(e),n&&n.value()}renderPoints(e,n){n===void 0&&(!e||typeof e.moveTo!="function")&&(n=e,e=null),n=n==null?2:+n;let r=e==null?e=new lr:void 0,{points:o}=this;for(let i=0,s=o.length;i<s;i+=2){let a=o[i],c=o[i+1];e.moveTo(a+n,c),e.arc(a,c,n,0,JO)}return r&&r.value()}renderHull(e){let n=e==null?e=new lr:void 0,{hull:r,points:o}=this,i=r[0]*2,s=r.length;e.moveTo(o[i],o[i+1]);for(let a=1;a<s;++a){let c=2*r[a];e.lineTo(o[c],o[c+1])}return e.closePath(),n&&n.value()}hullPolygon(){let e=new Ki;return this.renderHull(e),e.value()}renderTriangle(e,n){let r=n==null?n=new lr:void 0,{points:o,triangles:i}=this,s=i[e*=3]*2,a=i[e+1]*2,c=i[e+2]*2;return n.moveTo(o[s],o[s+1]),n.lineTo(o[a],o[a+1]),n.lineTo(o[c],o[c+1]),n.closePath(),r&&r.value()}*trianglePolygons(){let{triangles:e}=this;for(let n=0,r=e.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(e){let n=new Ki;return this.renderTriangle(e,n),n.value()}};function o$(t,e,n,r){let o=t.length,i=new Float64Array(o*2);for(let s=0;s<o;++s){let a=t[s];i[s*2]=e.call(r,a,s,t),i[s*2+1]=n.call(r,a,s,t)}return i}function*i$(t,e,n,r){let o=0;for(let i of t)yield e.call(r,i,o,t),yield n.call(r,i,o,t),++o}function R8(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ma(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function io(t){return t=ma(Math.abs(t)),t?t[1]:NaN}function L8(t,e){return function(n,r){for(var o=n.length,i=[],s=0,a=t[0],c=0;o>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),i.push(n.substring(o-=a,o+a)),!((c+=a+1)>r));)a=t[s=(s+1)%t.length];return i.reverse().join(e)}}function O8(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var s$=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function so(t){if(!(e=s$.exec(t)))throw new Error("invalid format: "+t);var e;return new P0({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}so.prototype=P0.prototype;function P0(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+""}P0.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 $8(t){t:for(var e=t.length,n=1,r=-1,o;n<e;++n)switch(t[n]){case".":r=o=n;break;case"0":r===0&&(r=n),o=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(o+1):t}var rw;function D8(t,e){var n=ma(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(rw=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,s=r.length;return i===s?r:i>s?r+new Array(i-s+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+ma(t,Math.max(0,e+i-1))[0]}function ow(t,e){var n=ma(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}var iw={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:R8,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ow(t*100,e),r:ow,s:D8,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function sw(t){return t}var F8=Array.prototype.map,P8=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function q8(t){var e=t.grouping===void 0||t.thousands===void 0?sw:L8(F8.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",o=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?sw:O8(F8.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"\u2212":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function f(p){p=so(p);var l=p.fill,h=p.align,d=p.sign,m=p.symbol,g=p.zero,y=p.width,x=p.comma,b=p.precision,w=p.trim,_=p.type;_==="n"?(x=!0,_="g"):iw[_]||(b===void 0&&(b=12),w=!0,_="g"),(g||l==="0"&&h==="=")&&(g=!0,l="0",h="=");var v=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",A=m==="$"?r:/[%p]/.test(_)?s:"",E=iw[_],T=/[defgprs%]/.test(_);b=b===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function C(S){var k=v,L=A,M,I,N;if(_==="c")L=E(S)+L,S="";else{S=+S;var R=S<0||1/S<0;if(S=isNaN(S)?c:E(Math.abs(S),b),w&&(S=$8(S)),R&&+S==0&&d!=="+"&&(R=!1),k=(R?d==="("?d:a:d==="-"||d==="("?"":d)+k,L=(_==="s"?P8[8+rw/3]:"")+L+(R&&d==="("?")":""),T){for(M=-1,I=S.length;++M<I;)if(N=S.charCodeAt(M),48>N||N>57){L=(N===46?o+S.slice(M+1):S.slice(M))+L,S=S.slice(0,M);break}}}x&&!g&&(S=e(S,1/0));var $=k.length+S.length+L.length,O=$<y?new Array(y-$+1).join(l):"";switch(x&&g&&(S=e(O+S,O.length?y-L.length:1/0),O=""),h){case"<":S=k+S+L+O;break;case"=":S=k+O+S+L;break;case"^":S=O.slice(0,$=O.length>>1)+k+S+L+O.slice($);break;default:S=O+k+S+L;break}return i(S)}return C.toString=function(){return p+""},C}function u(p,l){var h=f((p=so(p),p.type="f",p)),d=Math.max(-8,Math.min(8,Math.floor(io(l)/3)))*3,m=Math.pow(10,-d),g=P8[8+d/3];return function(y){return h(m*y)+g}}return{format:f,formatPrefix:u}}var q0,hr,B0;aw({thousands:",",grouping:[3],currency:["$",""]});function aw(t){return q0=q8(t),hr=q0.format,B0=q0.formatPrefix,q0}function cw(t){return Math.max(0,-io(Math.abs(t)))}function fw(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(io(e)/3)))*3-io(Math.abs(t)))}function uw(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,io(e)-io(t))+1}var Z=1e-6,ga=1e-12,mt=Math.PI,Ut=mt/2,lw=mt/4,Le=mt*2,ae=180/mt,vt=mt/180,wt=Math.abs,dr=Math.atan,xe=Math.atan2,H=Math.cos,ql=Math.ceil,z0=Math.exp;var Y0=Math.hypot,ya=Math.log,U0=Math.pow,V=Math.sin,fn=Math.sign||function(t){return t>0?1:t<0?-1:0},jt=Math.sqrt,Gc=Math.tan;function j0(t){return t>1?0:t<-1?mt:Math.acos(t)}function Zt(t){return t>1?Ut:t<-1?-Ut:Math.asin(t)}function be(){}function X0(t,e){t&&z8.hasOwnProperty(t.type)&&z8[t.type](t,e)}var B8={Feature:function(t,e){X0(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,o=n.length;++r<o;)X0(n[r].geometry,e)}},z8={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){pw(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)pw(n[r],e,0)},Polygon:function(t,e){Y8(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)Y8(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,o=n.length;++r<o;)X0(n[r],e)}};function pw(t,e,n){var r=-1,o=t.length-n,i;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function Y8(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)pw(t[n],e,1);e.polygonEnd()}function Gn(t,e){t&&B8.hasOwnProperty(t.type)?B8[t.type](t,e):X0(t,e)}function Bl(t){return[xe(t[1],t[0]),Zt(t[2])]}function ao(t){var e=t[0],n=t[1],r=H(n);return[r*H(e),r*V(e),V(n)]}function zl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Vc(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function W0(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Yl(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ul(t){var e=jt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var jl,G0,V0,H0,Q0,Z0,K0,J0,hw,dw,mw,X8,W8,Tn,In,Cn,Or={sphere:be,point:gw,lineStart:U8,lineEnd:j8,polygonStart:function(){Or.lineStart=f$,Or.lineEnd=u$},polygonEnd:function(){Or.lineStart=U8,Or.lineEnd=j8}};function gw(t,e){t*=vt,e*=vt;var n=H(e);Xl(n*H(t),n*V(t),V(e))}function Xl(t,e,n){++jl,V0+=(t-V0)/jl,H0+=(e-H0)/jl,Q0+=(n-Q0)/jl}function U8(){Or.point=a$}function a$(t,e){t*=vt,e*=vt;var n=H(e);Tn=n*H(t),In=n*V(t),Cn=V(e),Or.point=c$,Xl(Tn,In,Cn)}function c$(t,e){t*=vt,e*=vt;var n=H(e),r=n*H(t),o=n*V(t),i=V(e),s=xe(jt((s=In*i-Cn*o)*s+(s=Cn*r-Tn*i)*s+(s=Tn*o-In*r)*s),Tn*r+In*o+Cn*i);G0+=s,Z0+=s*(Tn+(Tn=r)),K0+=s*(In+(In=o)),J0+=s*(Cn+(Cn=i)),Xl(Tn,In,Cn)}function j8(){Or.point=gw}function f$(){Or.point=l$}function u$(){G8(X8,W8),Or.point=gw}function l$(t,e){X8=t,W8=e,t*=vt,e*=vt,Or.point=G8;var n=H(e);Tn=n*H(t),In=n*V(t),Cn=V(e),Xl(Tn,In,Cn)}function G8(t,e){t*=vt,e*=vt;var n=H(e),r=n*H(t),o=n*V(t),i=V(e),s=In*i-Cn*o,a=Cn*r-Tn*i,c=Tn*o-In*r,f=Y0(s,a,c),u=Zt(f),p=f&&-u/f;hw.add(p*s),dw.add(p*a),mw.add(p*c),G0+=u,Z0+=u*(Tn+(Tn=r)),K0+=u*(In+(In=o)),J0+=u*(Cn+(Cn=i)),Xl(Tn,In,Cn)}function yw(t){jl=G0=V0=H0=Q0=Z0=K0=J0=0,hw=new Xe,dw=new Xe,mw=new Xe,Gn(t,Or);var e=+hw,n=+dw,r=+mw,o=Y0(e,n,r);return o<ga&&(e=Z0,n=K0,r=J0,G0<Z&&(e=V0,n=H0,r=Q0),o=Y0(e,n,r),o<ga)?[NaN,NaN]:[xe(n,e)*ae,Zt(r/o)*ae]}function Wl(t,e){function n(r,o){return r=t(r,o),e(r[0],r[1])}return t.invert&&e.invert&&(n.invert=function(r,o){return r=e.invert(r,o),r&&t.invert(r[0],r[1])}),n}function xw(t,e){return wt(t)>mt&&(t-=Math.round(t/Le)*Le),[t,e]}xw.invert=xw;function bw(t,e,n){return(t%=Le)?e||n?Wl(H8(t),Q8(e,n)):H8(t):e||n?Q8(e,n):xw}function V8(t){return function(e,n){return e+=t,wt(e)>mt&&(e-=Math.round(e/Le)*Le),[e,n]}}function H8(t){var e=V8(t);return e.invert=V8(-t),e}function Q8(t,e){var n=H(t),r=V(t),o=H(e),i=V(e);function s(a,c){var f=H(c),u=H(a)*f,p=V(a)*f,l=V(c),h=l*n+u*r;return[xe(p*o-h*i,u*n-l*r),Zt(h*o+p*i)]}return s.invert=function(a,c){var f=H(c),u=H(a)*f,p=V(a)*f,l=V(c),h=l*o-p*i;return[xe(p*o+l*i,u*n+h*r),Zt(h*n-u*r)]},s}function Z8(t){t=bw(t[0]*vt,t[1]*vt,t.length>2?t[2]*vt:0);function e(n){return n=t(n[0]*vt,n[1]*vt),n[0]*=ae,n[1]*=ae,n}return e.invert=function(n){return n=t.invert(n[0]*vt,n[1]*vt),n[0]*=ae,n[1]*=ae,n},e}function J8(t,e,n,r,o,i){if(n){var s=H(e),a=V(e),c=r*n;o==null?(o=e+r*Le,i=e-c/2):(o=K8(s,o),i=K8(s,i),(r>0?o<i:o>i)&&(o+=r*Le));for(var f,u=o;r>0?u>i:u<i;u-=c)f=Bl([s,-a*H(u),-a*V(u)]),t.point(f[0],f[1])}}function K8(t,e){e=ao(e),e[0]-=t,Ul(e);var n=j0(-e[1]);return((-e[2]<0?-n:n)+Le-Z)%Le}function tg(){var t=[],e;return{point:function(n,r,o){e.push([n,r,o])},lineStart:function(){t.push(e=[])},lineEnd:be,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Hc(t,e){return wt(t[0]-e[0])<Z&&wt(t[1]-e[1])<Z}function eg(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function ng(t,e,n,r,o){var i=[],s=[],a,c;if(t.forEach(function(d){if(!((m=d.length-1)<=0)){var m,g=d[0],y=d[m],x;if(Hc(g,y)){if(!g[2]&&!y[2]){for(o.lineStart(),a=0;a<m;++a)o.point((g=d[a])[0],g[1]);o.lineEnd();return}y[0]+=2*Z}i.push(x=new eg(g,d,null,!0)),s.push(x.o=new eg(g,null,x,!1)),i.push(x=new eg(y,d,null,!1)),s.push(x.o=new eg(y,null,x,!0))}}),!!i.length){for(s.sort(e),tS(i),tS(s),a=0,c=s.length;a<c;++a)s[a].e=n=!n;for(var f=i[0],u,p;;){for(var l=f,h=!0;l.v;)if((l=l.n)===f)return;u=l.z,o.lineStart();do{if(l.v=l.o.v=!0,l.e){if(h)for(a=0,c=u.length;a<c;++a)o.point((p=u[a])[0],p[1]);else r(l.x,l.n.x,1,o);l=l.n}else{if(h)for(u=l.p.z,a=u.length-1;a>=0;--a)o.point((p=u[a])[0],p[1]);else r(l.x,l.p.x,-1,o);l=l.p}l=l.o,u=l.z,h=!h}while(!l.v);o.lineEnd()}}}function tS(t){if(e=t.length){for(var e,n=0,r=t[0],o;++n<e;)r.n=o=t[n],o.p=r,r=o;r.n=o=t[0],o.p=r}}function ww(t){return wt(t[0])<=mt?t[0]:fn(t[0])*((wt(t[0])+mt)%Le-mt)}function eS(t,e){var n=ww(e),r=e[1],o=V(r),i=[V(n),-H(n),0],s=0,a=0,c=new Xe;o===1?r=Ut+Z:o===-1&&(r=-Ut-Z);for(var f=0,u=t.length;f<u;++f)if(l=(p=t[f]).length)for(var p,l,h=p[l-1],d=ww(h),m=h[1]/2+lw,g=V(m),y=H(m),x=0;x<l;++x,d=w,g=v,y=A,h=b){var b=p[x],w=ww(b),_=b[1]/2+lw,v=V(_),A=H(_),E=w-d,T=E>=0?1:-1,C=T*E,S=C>mt,k=g*v;if(c.add(xe(k*T*V(C),y*A+k*H(C))),s+=S?E+T*Le:E,S^d>=n^w>=n){var L=Vc(ao(h),ao(b));Ul(L);var M=Vc(i,L);Ul(M);var I=(S^E>=0?-1:1)*Zt(M[2]);(r>I||r===I&&(L[0]||L[1]))&&(a+=S^E>=0?1:-1)}}return(s<-Z||s<Z&&c<-ga)^a&1}function rg(t,e,n,r){return function(o){var i=e(o),s=tg(),a=e(s),c=!1,f,u,p,l={point:h,lineStart:m,lineEnd:g,polygonStart:function(){l.point=y,l.lineStart=x,l.lineEnd=b,u=[],f=[]},polygonEnd:function(){l.point=h,l.lineStart=m,l.lineEnd=g,u=Nc(u);var w=eS(f,r);u.length?(c||(o.polygonStart(),c=!0),ng(u,h$,w,n,o)):w&&(c||(o.polygonStart(),c=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),c&&(o.polygonEnd(),c=!1),u=f=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function h(w,_){t(w,_)&&o.point(w,_)}function d(w,_){i.point(w,_)}function m(){l.point=d,i.lineStart()}function g(){l.point=h,i.lineEnd()}function y(w,_){p.push([w,_]),a.point(w,_)}function x(){a.lineStart(),p=[]}function b(){y(p[0][0],p[0][1]),a.lineEnd();var w=a.clean(),_=s.result(),v,A=_.length,E,T,C;if(p.pop(),f.push(p),p=null,!!A){if(w&1){if(T=_[0],(E=T.length-1)>0){for(c||(o.polygonStart(),c=!0),o.lineStart(),v=0;v<E;++v)o.point((C=T[v])[0],C[1]);o.lineEnd()}return}A>1&&w&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(p$))}}return l}}function p$(t){return t.length>1}function h$(t,e){return((t=t.x)[0]<0?t[1]-Ut-Z:Ut-t[1])-((e=e.x)[0]<0?e[1]-Ut-Z:Ut-e[1])}var vw=rg(function(){return!0},d$,g$,[-mt,-Ut]);function d$(t){var e=NaN,n=NaN,r=NaN,o;return{lineStart:function(){t.lineStart(),o=1},point:function(i,s){var a=i>0?mt:-mt,c=wt(i-e);wt(c-mt)<Z?(t.point(e,n=(n+s)/2>0?Ut:-Ut),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),t.point(i,n),o=0):r!==a&&c>=mt&&(wt(e-r)<Z&&(e-=r*Z),wt(i-a)<Z&&(i-=a*Z),n=m$(e,n,i,s),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),o=0),t.point(e=i,n=s),r=a},lineEnd:function(){t.lineEnd(),e=n=NaN},clean:function(){return 2-o}}}function m$(t,e,n,r){var o,i,s=V(t-n);return wt(s)>Z?dr((V(e)*(i=H(r))*V(n)-V(r)*(o=H(e))*V(t))/(o*i*s)):(e+r)/2}function g$(t,e,n,r){var o;if(t==null)o=n*Ut,r.point(-mt,o),r.point(0,o),r.point(mt,o),r.point(mt,0),r.point(mt,-o),r.point(0,-o),r.point(-mt,-o),r.point(-mt,0),r.point(-mt,o);else if(wt(t[0]-e[0])>Z){var i=t[0]<e[0]?mt:-mt;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(e[0],e[1])}function nS(t){var e=H(t),n=2*vt,r=e>0,o=wt(e)>Z;function i(u,p,l,h){J8(h,t,n,l,u,p)}function s(u,p){return H(u)*H(p)>e}function a(u){var p,l,h,d,m;return{lineStart:function(){d=h=!1,m=1},point:function(g,y){var x=[g,y],b,w=s(g,y),_=r?w?0:f(g,y):w?f(g+(g<0?mt:-mt),y):0;if(!p&&(d=h=w)&&u.lineStart(),w!==h&&(b=c(p,x),(!b||Hc(p,b)||Hc(x,b))&&(x[2]=1)),w!==h)m=0,w?(u.lineStart(),b=c(x,p),u.point(b[0],b[1])):(b=c(p,x),u.point(b[0],b[1],2),u.lineEnd()),p=b;else if(o&&p&&r^w){var v;!(_&l)&&(v=c(x,p,!0))&&(m=0,r?(u.lineStart(),u.point(v[0][0],v[0][1]),u.point(v[1][0],v[1][1]),u.lineEnd()):(u.point(v[1][0],v[1][1]),u.lineEnd(),u.lineStart(),u.point(v[0][0],v[0][1],3)))}w&&(!p||!Hc(p,x))&&u.point(x[0],x[1]),p=x,h=w,l=_},lineEnd:function(){h&&u.lineEnd(),p=null},clean:function(){return m|(d&&h)<<1}}}function c(u,p,l){var h=ao(u),d=ao(p),m=[1,0,0],g=Vc(h,d),y=zl(g,g),x=g[0],b=y-x*x;if(!b)return!l&&u;var w=e*y/b,_=-e*x/b,v=Vc(m,g),A=Yl(m,w),E=Yl(g,_);W0(A,E);var T=v,C=zl(A,T),S=zl(T,T),k=C*C-S*(zl(A,A)-1);if(!(k<0)){var L=jt(k),M=Yl(T,(-C-L)/S);if(W0(M,A),M=Bl(M),!l)return M;var I=u[0],N=p[0],R=u[1],$=p[1],O;N<I&&(O=I,I=N,N=O);var D=N-I,F=wt(D-mt)<Z,P=F||D<Z;if(!F&&$<R&&(O=R,R=$,$=O),P?F?R+$>0^M[1]<(wt(M[0]-I)<Z?R:$):R<=M[1]&&M[1]<=$:D>mt^(I<=M[0]&&M[0]<=N)){var W=Yl(T,(-C+L)/S);return W0(W,A),[M,Bl(W)]}}}function f(u,p){var l=r?t:mt-t,h=0;return u<-l?h|=1:u>l&&(h|=2),p<-l?h|=4:p>l&&(h|=8),h}return rg(s,a,i,r?[0,-t]:[-mt,t-mt])}function rS(t,e,n,r,o,i){var s=t[0],a=t[1],c=e[0],f=e[1],u=0,p=1,l=c-s,h=f-a,d;if(d=n-s,!(!l&&d>0)){if(d/=l,l<0){if(d<u)return;d<p&&(p=d)}else if(l>0){if(d>p)return;d>u&&(u=d)}if(d=o-s,!(!l&&d<0)){if(d/=l,l<0){if(d>p)return;d>u&&(u=d)}else if(l>0){if(d<u)return;d<p&&(p=d)}if(d=r-a,!(!h&&d>0)){if(d/=h,h<0){if(d<u)return;d<p&&(p=d)}else if(h>0){if(d>p)return;d>u&&(u=d)}if(d=i-a,!(!h&&d<0)){if(d/=h,h<0){if(d>p)return;d>u&&(u=d)}else if(h>0){if(d<u)return;d<p&&(p=d)}return u>0&&(t[0]=s+u*l,t[1]=a+u*h),p<1&&(e[0]=s+p*l,e[1]=a+p*h),!0}}}}}var Gl=1e9,og=-Gl;function Qc(t,e,n,r){function o(f,u){return t<=f&&f<=n&&e<=u&&u<=r}function i(f,u,p,l){var h=0,d=0;if(f==null||(h=s(f,p))!==(d=s(u,p))||c(f,u)<0^p>0)do l.point(h===0||h===3?t:n,h>1?r:e);while((h=(h+p+4)%4)!==d);else l.point(u[0],u[1])}function s(f,u){return wt(f[0]-t)<Z?u>0?0:3:wt(f[0]-n)<Z?u>0?2:1:wt(f[1]-e)<Z?u>0?1:0:u>0?3:2}function a(f,u){return c(f.x,u.x)}function c(f,u){var p=s(f,1),l=s(u,1);return p!==l?p-l:p===0?u[1]-f[1]:p===1?f[0]-u[0]:p===2?f[1]-u[1]:u[0]-f[0]}return function(f){var u=f,p=tg(),l,h,d,m,g,y,x,b,w,_,v,A={point:E,lineStart:k,lineEnd:L,polygonStart:C,polygonEnd:S};function E(I,N){o(I,N)&&u.point(I,N)}function T(){for(var I=0,N=0,R=h.length;N<R;++N)for(var $=h[N],O=1,D=$.length,F=$[0],P,W,K=F[0],tt=F[1];O<D;++O)P=K,W=tt,F=$[O],K=F[0],tt=F[1],W<=r?tt>r&&(K-P)*(r-W)>(tt-W)*(t-P)&&++I:tt<=r&&(K-P)*(r-W)<(tt-W)*(t-P)&&--I;return I}function C(){u=p,l=[],h=[],v=!0}function S(){var I=T(),N=v&&I,R=(l=Nc(l)).length;(N||R)&&(f.polygonStart(),N&&(f.lineStart(),i(null,null,1,f),f.lineEnd()),R&&ng(l,a,I,i,f),f.polygonEnd()),u=f,l=h=d=null}function k(){A.point=M,h&&h.push(d=[]),_=!0,w=!1,x=b=NaN}function L(){l&&(M(m,g),y&&w&&p.rejoin(),l.push(p.result())),A.point=E,w&&u.lineEnd()}function M(I,N){var R=o(I,N);if(h&&d.push([I,N]),_)m=I,g=N,y=R,_=!1,R&&(u.lineStart(),u.point(I,N));else if(R&&w)u.point(I,N);else{var $=[x=Math.max(og,Math.min(Gl,x)),b=Math.max(og,Math.min(Gl,b))],O=[I=Math.max(og,Math.min(Gl,I)),N=Math.max(og,Math.min(Gl,N))];rS($,O,t,e,n,r)?(w||(u.lineStart(),u.point($[0],$[1])),u.point(O[0],O[1]),R||u.lineEnd(),v=!1):R&&(u.lineStart(),u.point(I,N),v=!1)}x=I,b=N,w=R}return A}}function oS(t,e,n){var r=le(t,e-Z,n).concat(e);return function(o){return r.map(function(i){return[o,i]})}}function iS(t,e,n){var r=le(t,e-Z,n).concat(e);return function(o){return r.map(function(i){return[i,o]})}}function _w(){var t,e,n,r,o,i,s,a,c=10,f=c,u=90,p=360,l,h,d,m,g=2.5;function y(){return{type:"MultiLineString",coordinates:x()}}function x(){return le(ql(r/u)*u,n,u).map(d).concat(le(ql(a/p)*p,s,p).map(m)).concat(le(ql(e/c)*c,t,c).filter(function(b){return wt(b%u)>Z}).map(l)).concat(le(ql(i/f)*f,o,f).filter(function(b){return wt(b%p)>Z}).map(h))}return y.lines=function(){return x().map(function(b){return{type:"LineString",coordinates:b}})},y.outline=function(){return{type:"Polygon",coordinates:[d(r).concat(m(s).slice(1),d(n).reverse().slice(1),m(a).reverse().slice(1))]}},y.extent=function(b){return arguments.length?y.extentMajor(b).extentMinor(b):y.extentMinor()},y.extentMajor=function(b){return arguments.length?(r=+b[0][0],n=+b[1][0],a=+b[0][1],s=+b[1][1],r>n&&(b=r,r=n,n=b),a>s&&(b=a,a=s,s=b),y.precision(g)):[[r,a],[n,s]]},y.extentMinor=function(b){return arguments.length?(e=+b[0][0],t=+b[1][0],i=+b[0][1],o=+b[1][1],e>t&&(b=e,e=t,t=b),i>o&&(b=i,i=o,o=b),y.precision(g)):[[e,i],[t,o]]},y.step=function(b){return arguments.length?y.stepMajor(b).stepMinor(b):y.stepMinor()},y.stepMajor=function(b){return arguments.length?(u=+b[0],p=+b[1],y):[u,p]},y.stepMinor=function(b){return arguments.length?(c=+b[0],f=+b[1],y):[c,f]},y.precision=function(b){return arguments.length?(g=+b,l=oS(i,o,90),h=iS(e,t,g),d=oS(a,s,90),m=iS(r,n,g),y):g},y.extentMajor([[-180,-90+Z],[180,90-Z]]).extentMinor([[-180,-80-Z],[180,80+Z]])}function Mw(){return _w()()}var Vl=t=>t;var Sw=new Xe,Aw=new Xe,sS,aS,Ew,Tw,Ji={point:be,lineStart:be,lineEnd:be,polygonStart:function(){Ji.lineStart=y$,Ji.lineEnd=b$},polygonEnd:function(){Ji.lineStart=Ji.lineEnd=Ji.point=be,Sw.add(wt(Aw)),Aw=new Xe},result:function(){var t=Sw/2;return Sw=new Xe,t}};function y$(){Ji.point=x$}function x$(t,e){Ji.point=cS,sS=Ew=t,aS=Tw=e}function cS(t,e){Aw.add(Tw*t-Ew*e),Ew=t,Tw=e}function b$(){cS(sS,aS)}var Iw=Ji;var Zc=1/0,ig=Zc,Hl=-Zc,sg=Hl,w$={point:v$,lineStart:be,lineEnd:be,polygonStart:be,polygonEnd:be,result:function(){var t=[[Zc,ig],[Hl,sg]];return Hl=sg=-(ig=Zc=1/0),t}};function v$(t,e){t<Zc&&(Zc=t),t>Hl&&(Hl=t),e<ig&&(ig=e),e>sg&&(sg=e)}var Kc=w$;var Cw=0,Nw=0,Ql=0,ag=0,cg=0,Jc=0,kw=0,Rw=0,Zl=0,lS,pS,co,fo,$r={point:xa,lineStart:fS,lineEnd:uS,polygonStart:function(){$r.lineStart=S$,$r.lineEnd=A$},polygonEnd:function(){$r.point=xa,$r.lineStart=fS,$r.lineEnd=uS},result:function(){var t=Zl?[kw/Zl,Rw/Zl]:Jc?[ag/Jc,cg/Jc]:Ql?[Cw/Ql,Nw/Ql]:[NaN,NaN];return Cw=Nw=Ql=ag=cg=Jc=kw=Rw=Zl=0,t}};function xa(t,e){Cw+=t,Nw+=e,++Ql}function fS(){$r.point=_$}function _$(t,e){$r.point=M$,xa(co=t,fo=e)}function M$(t,e){var n=t-co,r=e-fo,o=jt(n*n+r*r);ag+=o*(co+t)/2,cg+=o*(fo+e)/2,Jc+=o,xa(co=t,fo=e)}function uS(){$r.point=xa}function S$(){$r.point=E$}function A$(){hS(lS,pS)}function E$(t,e){$r.point=hS,xa(lS=co=t,pS=fo=e)}function hS(t,e){var n=t-co,r=e-fo,o=jt(n*n+r*r);ag+=o*(co+t)/2,cg+=o*(fo+e)/2,Jc+=o,o=fo*t-co*e,kw+=o*(co+t),Rw+=o*(fo+e),Zl+=o*3,xa(co=t,fo=e)}var Lw=$r;function fg(t){this._context=t}fg.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,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Le);break}}},result:be};var $w=new Xe,Ow,dS,mS,Kl,Jl,ug={point:be,lineStart:function(){ug.point=T$},lineEnd:function(){Ow&&gS(dS,mS),ug.point=be},polygonStart:function(){Ow=!0},polygonEnd:function(){Ow=null},result:function(){var t=+$w;return $w=new Xe,t}};function T$(t,e){ug.point=gS,dS=Kl=t,mS=Jl=e}function gS(t,e){Kl-=t,Jl-=e,$w.add(jt(Kl*Kl+Jl*Jl)),Kl=t,Jl=e}var Dw=ug;var yS,lg,xS,bS,tf=class{constructor(e){this._append=e==null?wS:I$(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==xS||this._append!==lg){let r=this._radius,o=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`,xS=r,lg=this._append,bS=this._,this._=o}this._+=bS;break}}}result(){let e=this._;return this._="",e.length?e:null}};function wS(t){let e=1;this._+=t[0];for(let n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function I$(t){let e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return wS;if(e!==yS){let n=10**e;yS=e,lg=function(o){let i=1;this._+=o[0];for(let s=o.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return lg}function Oe(t,e){let n=3,r=4.5,o,i;function s(a){return a&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),Gn(a,o(i))),i.result()}return s.area=function(a){return Gn(a,o(Iw)),Iw.result()},s.measure=function(a){return Gn(a,o(Dw)),Dw.result()},s.bounds=function(a){return Gn(a,o(Kc)),Kc.result()},s.centroid=function(a){return Gn(a,o(Lw)),Lw.result()},s.projection=function(a){return arguments.length?(o=a==null?(t=null,Vl):(t=a).stream,s):t},s.context=function(a){return arguments.length?(i=a==null?(e=null,new tf(n)):new fg(e=a),typeof r!="function"&&i.pointRadius(r),s):e},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(i.pointRadius(+a),+a),s):r},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{let c=Math.floor(a);if(!(c>=0))throw new RangeError(`invalid digits: ${a}`);n=c}return e===null&&(i=new tf(n)),s},s.projection(t).digits(n).context(e)}function ba(t){return{stream:ef(t)}}function ef(t){return function(e){var n=new Fw;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Fw(){}Fw.prototype={constructor:Fw,point:function(t,e){this.stream.point(t,e)},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 Pw(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),Gn(n,t.stream(Kc)),e(Kc.result()),r!=null&&t.clipExtent(r),t}function tp(t,e,n){return Pw(t,function(r){var o=e[1][0]-e[0][0],i=e[1][1]-e[0][1],s=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),a=+e[0][0]+(o-s*(r[1][0]+r[0][0]))/2,c=+e[0][1]+(i-s*(r[1][1]+r[0][1]))/2;t.scale(150*s).translate([a,c])},n)}function pg(t,e,n){return tp(t,[[0,0],e],n)}function hg(t,e,n){return Pw(t,function(r){var o=+e,i=o/(r[1][0]-r[0][0]),s=(o-i*(r[1][0]+r[0][0]))/2,a=-i*r[0][1];t.scale(150*i).translate([s,a])},n)}function dg(t,e,n){return Pw(t,function(r){var o=+e,i=o/(r[1][1]-r[0][1]),s=-i*r[0][0],a=(o-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([s,a])},n)}var vS=16,C$=H(30*vt);function qw(t,e){return+e?k$(t,e):N$(t)}function N$(t){return ef({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function k$(t,e){function n(r,o,i,s,a,c,f,u,p,l,h,d,m,g){var y=f-r,x=u-o,b=y*y+x*x;if(b>4*e&&m--){var w=s+l,_=a+h,v=c+d,A=jt(w*w+_*_+v*v),E=Zt(v/=A),T=wt(wt(v)-1)<Z||wt(i-p)<Z?(i+p)/2:xe(_,w),C=t(T,E),S=C[0],k=C[1],L=S-r,M=k-o,I=x*L-y*M;(I*I/b>e||wt((y*L+x*M)/b-.5)>.3||s*l+a*h+c*d<C$)&&(n(r,o,i,s,a,c,S,k,T,w/=A,_/=A,v,m,g),g.point(S,k),n(S,k,T,w,_,v,f,u,p,l,h,d,m,g))}}return function(r){var o,i,s,a,c,f,u,p,l,h,d,m,g={point:y,lineStart:x,lineEnd:w,polygonStart:function(){r.polygonStart(),g.lineStart=_},polygonEnd:function(){r.polygonEnd(),g.lineStart=x}};function y(E,T){E=t(E,T),r.point(E[0],E[1])}function x(){p=NaN,g.point=b,r.lineStart()}function b(E,T){var C=ao([E,T]),S=t(E,T);n(p,l,u,h,d,m,p=S[0],l=S[1],u=E,h=C[0],d=C[1],m=C[2],vS,r),r.point(p,l)}function w(){g.point=y,r.lineEnd()}function _(){x(),g.point=v,g.lineEnd=A}function v(E,T){b(o=E,T),i=p,s=l,a=h,c=d,f=m,g.point=b}function A(){n(p,l,u,h,d,m,i,s,o,a,c,f,vS,r),g.lineEnd=w,w()}return g}}var R$=ef({point:function(t,e){this.stream.point(t*vt,e*vt)}});function L$(t){return ef({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}function O$(t,e,n,r,o){function i(s,a){return s*=r,a*=o,[e+t*s,n-t*a]}return i.invert=function(s,a){return[(s-e)/t*r,(n-a)/t*o]},i}function _S(t,e,n,r,o,i){if(!i)return O$(t,e,n,r,o);var s=H(i),a=V(i),c=s*t,f=a*t,u=s/t,p=a/t,l=(a*n-s*e)/t,h=(a*e+s*n)/t;function d(m,g){return m*=r,g*=o,[c*m-f*g+e,n-f*m-c*g]}return d.invert=function(m,g){return[r*(u*m-p*g+l),o*(h-p*m-u*g)]},d}function Qe(t){return Bw(function(){return t})()}function Bw(t){var e,n=150,r=480,o=250,i=0,s=0,a=0,c=0,f=0,u,p=0,l=1,h=1,d=null,m=vw,g=null,y,x,b,w=Vl,_=.5,v,A,E,T,C;function S(I){return E(I[0]*vt,I[1]*vt)}function k(I){return I=E.invert(I[0],I[1]),I&&[I[0]*ae,I[1]*ae]}S.stream=function(I){return T&&C===I?T:T=R$(L$(u)(m(v(w(C=I)))))},S.preclip=function(I){return arguments.length?(m=I,d=void 0,M()):m},S.postclip=function(I){return arguments.length?(w=I,g=y=x=b=null,M()):w},S.clipAngle=function(I){return arguments.length?(m=+I?nS(d=I*vt):(d=null,vw),M()):d*ae},S.clipExtent=function(I){return arguments.length?(w=I==null?(g=y=x=b=null,Vl):Qc(g=+I[0][0],y=+I[0][1],x=+I[1][0],b=+I[1][1]),M()):g==null?null:[[g,y],[x,b]]},S.scale=function(I){return arguments.length?(n=+I,L()):n},S.translate=function(I){return arguments.length?(r=+I[0],o=+I[1],L()):[r,o]},S.center=function(I){return arguments.length?(i=I[0]%360*vt,s=I[1]%360*vt,L()):[i*ae,s*ae]},S.rotate=function(I){return arguments.length?(a=I[0]%360*vt,c=I[1]%360*vt,f=I.length>2?I[2]%360*vt:0,L()):[a*ae,c*ae,f*ae]},S.angle=function(I){return arguments.length?(p=I%360*vt,L()):p*ae},S.reflectX=function(I){return arguments.length?(l=I?-1:1,L()):l<0},S.reflectY=function(I){return arguments.length?(h=I?-1:1,L()):h<0},S.precision=function(I){return arguments.length?(v=qw(A,_=I*I),M()):jt(_)},S.fitExtent=function(I,N){return tp(S,I,N)},S.fitSize=function(I,N){return pg(S,I,N)},S.fitWidth=function(I,N){return hg(S,I,N)},S.fitHeight=function(I,N){return dg(S,I,N)};function L(){var I=_S(n,0,0,l,h,p).apply(null,e(i,s)),N=_S(n,r-I[0],o-I[1],l,h,p);return u=bw(a,c,f),A=Wl(e,N),E=Wl(u,A),v=qw(A,_),M()}function M(){return T=C=null,S}return function(){return e=t.apply(this,arguments),S.invert=e.invert&&k,L()}}function nf(t){var e=0,n=mt/3,r=Bw(t),o=r(e,n);return o.parallels=function(i){return arguments.length?r(e=i[0]*vt,n=i[1]*vt):[e*ae,n*ae]},o}function MS(t){var e=H(t);function n(r,o){return[r*e,V(o)/e]}return n.invert=function(r,o){return[r/e,Zt(o*e)]},n}function SS(t,e){var n=V(t),r=(n+V(e))/2;if(wt(r)<Z)return MS(t);var o=1+n*(2*r-n),i=jt(o)/r;function s(a,c){var f=jt(o-2*r*V(c))/r;return[f*V(a*=r),i-f*H(a)]}return s.invert=function(a,c){var f=i-c,u=xe(a,wt(f))*fn(f);return f*r<0&&(u-=mt*fn(a)*fn(f)),[u/r,Zt((o-(a*a+f*f)*r*r)/(2*r))]},s}function ts(){return nf(SS).scale(155.424).center([0,33.6442])}function ep(){return ts().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function $$(t){var e=t.length;return{point:function(n,r){for(var o=-1;++o<e;)t[o].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function zw(){var t,e,n=ep(),r,o=ts().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,s=ts().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,c,f={point:function(l,h){c=[l,h]}};function u(l){var h=l[0],d=l[1];return c=null,r.point(h,d),c||(i.point(h,d),c)||(a.point(h,d),c)}u.invert=function(l){var h=n.scale(),d=n.translate(),m=(l[0]-d[0])/h,g=(l[1]-d[1])/h;return(g>=.12&&g<.234&&m>=-.425&&m<-.214?o:g>=.166&&g<.234&&m>=-.214&&m<-.115?s:n).invert(l)},u.stream=function(l){return t&&e===l?t:t=$$([n.stream(e=l),o.stream(l),s.stream(l)])},u.precision=function(l){return arguments.length?(n.precision(l),o.precision(l),s.precision(l),p()):n.precision()},u.scale=function(l){return arguments.length?(n.scale(l),o.scale(l*.35),s.scale(l),u.translate(n.translate())):n.scale()},u.translate=function(l){if(!arguments.length)return n.translate();var h=n.scale(),d=+l[0],m=+l[1];return r=n.translate(l).clipExtent([[d-.455*h,m-.238*h],[d+.455*h,m+.238*h]]).stream(f),i=o.translate([d-.307*h,m+.201*h]).clipExtent([[d-.425*h+Z,m+.12*h+Z],[d-.214*h-Z,m+.234*h-Z]]).stream(f),a=s.translate([d-.205*h,m+.212*h]).clipExtent([[d-.214*h+Z,m+.166*h+Z],[d-.115*h-Z,m+.234*h-Z]]).stream(f),p()},u.fitExtent=function(l,h){return tp(u,l,h)},u.fitSize=function(l,h){return pg(u,l,h)},u.fitWidth=function(l,h){return hg(u,l,h)},u.fitHeight=function(l,h){return dg(u,l,h)};function p(){return t=e=null,u}return u.scale(1070)}function mg(t){return function(e,n){var r=H(e),o=H(n),i=t(r*o);return i===1/0?[2,0]:[i*o*V(e),i*V(n)]}}function uo(t){return function(e,n){var r=jt(e*e+n*n),o=t(r),i=V(o),s=H(o);return[xe(e*i,r*s),Zt(r&&n*i/r)]}}var Yw=mg(function(t){return jt(2/(1+t))});Yw.invert=uo(function(t){return 2*Zt(t/2)});function Uw(){return Qe(Yw).scale(124.75).clipAngle(180-.001)}var jw=mg(function(t){return(t=j0(t))&&t/V(t)});jw.invert=uo(function(t){return t});function Xw(){return Qe(jw).scale(79.4188).clipAngle(180-.001)}function rf(t,e){return[t,ya(Gc((Ut+e)/2))]}rf.invert=function(t,e){return[t,2*dr(z0(e))-Ut]};function Ww(){return Gw(rf).scale(961/Le)}function Gw(t){var e=Qe(t),n=e.center,r=e.scale,o=e.translate,i=e.clipExtent,s=null,a,c,f;e.scale=function(p){return arguments.length?(r(p),u()):r()},e.translate=function(p){return arguments.length?(o(p),u()):o()},e.center=function(p){return arguments.length?(n(p),u()):n()},e.clipExtent=function(p){return arguments.length?(p==null?s=a=c=f=null:(s=+p[0][0],a=+p[0][1],c=+p[1][0],f=+p[1][1]),u()):s==null?null:[[s,a],[c,f]]};function u(){var p=mt*r(),l=e(Z8(e.rotate()).invert([0,0]));return i(s==null?[[l[0]-p,l[1]-p],[l[0]+p,l[1]+p]]:t===rf?[[Math.max(l[0]-p,s),a],[Math.min(l[0]+p,c),f]]:[[s,Math.max(l[1]-p,a)],[c,Math.min(l[1]+p,f)]])}return u()}function gg(t){return Gc((Ut+t)/2)}function AS(t,e){var n=H(t),r=t===e?V(t):ya(n/H(e))/ya(gg(e)/gg(t)),o=n*U0(gg(t),r)/r;if(!r)return rf;function i(s,a){o>0?a<-Ut+Z&&(a=-Ut+Z):a>Ut-Z&&(a=Ut-Z);var c=o/U0(gg(a),r);return[c*V(r*s),o-c*H(r*s)]}return i.invert=function(s,a){var c=o-a,f=fn(r)*jt(s*s+c*c),u=xe(s,wt(c))*fn(c);return c*r<0&&(u-=mt*fn(s)*fn(c)),[u/r,2*dr(U0(o/f,1/r))-Ut]},i}function Vw(){return nf(AS).scale(109.5).parallels([30,30])}function of(t,e){return[t,e]}of.invert=of;function Hw(){return Qe(of).scale(152.63)}function ES(t,e){var n=H(t),r=t===e?V(t):(n-H(e))/(e-t),o=n/r+t;if(wt(r)<Z)return of;function i(s,a){var c=o-a,f=r*s;return[c*V(f),o-c*H(f)]}return i.invert=function(s,a){var c=o-a,f=xe(s,wt(c))*fn(c);return c*r<0&&(f-=mt*fn(s)*fn(c)),[f/r,o-fn(r)*jt(s*s+c*c)]},i}function Qw(){return nf(ES).scale(131.154).center([0,13.9389])}var np=1.340264,rp=-.081106,op=893e-6,ip=.003796,yg=jt(3)/2,D$=12;function Zw(t,e){var n=Zt(yg*V(e)),r=n*n,o=r*r*r;return[t*H(n)/(yg*(np+3*rp*r+o*(7*op+9*ip*r))),n*(np+rp*r+o*(op+ip*r))]}Zw.invert=function(t,e){for(var n=e,r=n*n,o=r*r*r,i=0,s,a,c;i<D$&&(a=n*(np+rp*r+o*(op+ip*r))-e,c=np+3*rp*r+o*(7*op+9*ip*r),n-=s=a/c,r=n*n,o=r*r*r,!(wt(s)<ga));++i);return[yg*t*(np+3*rp*r+o*(7*op+9*ip*r))/H(n),Zt(V(n)/yg)]};function Kw(){return Qe(Zw).scale(177.158)}function Jw(t,e){var n=H(e),r=H(t)*n;return[n*V(t)/r,V(e)/r]}Jw.invert=uo(dr);function tv(){return Qe(Jw).scale(144.049).clipAngle(60)}function ev(t,e){return[H(e)*V(t),V(e)]}ev.invert=uo(Zt);function nv(){return Qe(ev).scale(249.5).clipAngle(90+Z)}function rv(t,e){var n=H(e),r=1+H(t)*n;return[n*V(t)/r,V(e)/r]}rv.invert=uo(function(t){return 2*dr(t)});function ov(){return Qe(rv).scale(250).clipAngle(142)}function iv(t,e){return[ya(Gc((Ut+e)/2)),-t]}iv.invert=function(t,e){return[-e,2*dr(z0(t))-Ut]};function sv(){var t=Gw(iv),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function F$(t,e){return t.parent===e.parent?1:2}function P$(t){return t.reduce(q$,0)/t.length}function q$(t,e){return t+e.x}function B$(t){return 1+t.reduce(z$,0)}function z$(t,e){return Math.max(t,e.y)}function Y$(t){for(var e;e=t.children;)t=e[0];return t}function U$(t){for(var e;e=t.children;)t=e[e.length-1];return t}function xg(){var t=F$,e=1,n=1,r=!1;function o(i){var s,a=0;i.eachAfter(function(l){var h=l.children;h?(l.x=P$(h),l.y=B$(h)):(l.x=s?a+=t(l,s):0,l.y=0,s=l)});var c=Y$(i),f=U$(i),u=c.x-t(c,f)/2,p=f.x+t(f,c)/2;return i.eachAfter(r?function(l){l.x=(l.x-i.x)*e,l.y=(i.y-l.y)*n}:function(l){l.x=(l.x-u)/(p-u)*e,l.y=(1-(i.y?l.y/i.y:1))*n})}return o.separation=function(i){return arguments.length?(t=i,o):t},o.size=function(i){return arguments.length?(r=!1,e=+i[0],n=+i[1],o):r?null:[e,n]},o.nodeSize=function(i){return arguments.length?(r=!0,e=+i[0],n=+i[1],o):r?[e,n]:null},o}function j$(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function TS(){return this.eachAfter(j$)}function IS(t,e){let n=-1;for(let r of this)t.call(e,r,++n,this);return this}function CS(t,e){for(var n=this,r=[n],o,i,s=-1;n=r.pop();)if(t.call(e,n,++s,this),o=n.children)for(i=o.length-1;i>=0;--i)r.push(o[i]);return this}function NS(t,e){for(var n=this,r=[n],o=[],i,s,a,c=-1;n=r.pop();)if(o.push(n),i=n.children)for(s=0,a=i.length;s<a;++s)r.push(i[s]);for(;n=o.pop();)t.call(e,n,++c,this);return this}function kS(t,e){let n=-1;for(let r of this)if(t.call(e,r,++n,this))return r}function RS(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,o=r&&r.length;--o>=0;)n+=r[o].value;e.value=n})}function LS(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function OS(t){for(var e=this,n=X$(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function X$(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),o=null;for(t=n.pop(),e=r.pop();t===e;)o=t,t=n.pop(),e=r.pop();return o}function $S(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function DS(){return Array.from(this)}function FS(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function PS(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*qS(){var t=this,e,n=[t],r,o,i;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(o=0,i=r.length;o<i;++o)n.push(r[o]);while(n.length)}function av(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=V$)):e===void 0&&(e=G$);for(var n=new es(t),r,o=[n],i,s,a,c;r=o.pop();)if((s=e(r.data))&&(c=(s=Array.from(s)).length))for(r.children=s,a=c-1;a>=0;--a)o.push(i=s[a]=new es(s[a])),i.parent=r,i.depth=r.depth+1;return n.eachBefore(cv)}function W$(){return av(this).eachBefore(H$)}function G$(t){return t.children}function V$(t){return Array.isArray(t)?t[1]:null}function H$(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function cv(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function es(t){this.data=t,this.depth=this.height=0,this.parent=null}es.prototype=av.prototype={constructor:es,count:TS,each:IS,eachAfter:NS,eachBefore:CS,find:kS,sum:RS,sort:LS,path:OS,ancestors:$S,descendants:DS,leaves:FS,links:PS,copy:W$,[Symbol.iterator]:qS};function bg(t){return t==null?null:Q$(t)}function Q$(t){if(typeof t!="function")throw new Error;return t}var Z$={depth:-1},BS={},fv={};function K$(t){return t.id}function J$(t){return t.parentId}function wg(){var t=K$,e=J$,n;function r(o){var i=Array.from(o),s=t,a=e,c,f,u,p,l,h,d,m,g=new Map;if(n!=null){let y=i.map((w,_)=>tD(n(w,_,o))),x=y.map(zS),b=new Set(y).add("");for(let w of x)b.has(w)||(b.add(w),y.push(w),x.push(zS(w)),i.push(fv));s=(w,_)=>y[_],a=(w,_)=>x[_]}for(u=0,c=i.length;u<c;++u)f=i[u],h=i[u]=new es(f),(d=s(f,u,o))!=null&&(d+="")&&(m=h.id=d,g.set(m,g.has(m)?BS:h)),(d=a(f,u,o))!=null&&(d+="")&&(h.parent=d);for(u=0;u<c;++u)if(h=i[u],d=h.parent){if(l=g.get(d),!l)throw new Error("missing: "+d);if(l===BS)throw new Error("ambiguous: "+d);l.children?l.children.push(h):l.children=[h],h.parent=l}else{if(p)throw new Error("multiple roots");p=h}if(!p)throw new Error("no root");if(n!=null){for(;p.data===fv&&p.children.length===1;)p=p.children[0],--c;for(let y=i.length-1;y>=0&&(h=i[y],h.data===fv);--y)h.data=null}if(p.parent=Z$,p.eachBefore(function(y){y.depth=y.parent.depth+1,--c}).eachBefore(cv),p.parent=null,c>0)throw new Error("cycle");return p}return r.id=function(o){return arguments.length?(t=bg(o),r):t},r.parentId=function(o){return arguments.length?(e=bg(o),r):e},r.path=function(o){return arguments.length?(n=bg(o),r):n},r}function tD(t){t=`${t}`;let e=t.length;return uv(t,e-1)&&!uv(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function zS(t){let e=t.length;if(e<2)return"";for(;--e>1&&!uv(t,e););return t.slice(0,e)}function uv(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function eD(t,e){return t.parent===e.parent?1:2}function lv(t){var e=t.children;return e?e[0]:t.t}function pv(t){var e=t.children;return e?e[e.length-1]:t.t}function nD(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function rD(t){for(var e=0,n=0,r=t.children,o=r.length,i;--o>=0;)i=r[o],i.z+=e,i.m+=e,e+=i.s+(n+=i.c)}function oD(t,e,n){return t.a.parent===e.parent?t.a:n}function vg(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}vg.prototype=Object.create(es.prototype);function iD(t){for(var e=new vg(t,0),n,r=[e],o,i,s,a;n=r.pop();)if(i=n._.children)for(n.children=new Array(a=i.length),s=a-1;s>=0;--s)r.push(o=n.children[s]=new vg(i[s],s)),o.parent=n;return(e.parent=new vg(null,0)).children=[e],e}function wa(){var t=eD,e=1,n=1,r=null;function o(f){var u=iD(f);if(u.eachAfter(i),u.parent.m=-u.z,u.eachBefore(s),r)f.eachBefore(c);else{var p=f,l=f,h=f;f.eachBefore(function(x){x.x<p.x&&(p=x),x.x>l.x&&(l=x),x.depth>h.depth&&(h=x)});var d=p===l?1:t(p,l)/2,m=d-p.x,g=e/(l.x+d+m),y=n/(h.depth||1);f.eachBefore(function(x){x.x=(x.x+m)*g,x.y=x.depth*y})}return f}function i(f){var u=f.children,p=f.parent.children,l=f.i?p[f.i-1]:null;if(u){rD(f);var h=(u[0].z+u[u.length-1].z)/2;l?(f.z=l.z+t(f._,l._),f.m=f.z-h):f.z=h}else l&&(f.z=l.z+t(f._,l._));f.parent.A=a(f,l,f.parent.A||p[0])}function s(f){f._.x=f.z+f.parent.m,f.m+=f.parent.m}function a(f,u,p){if(u){for(var l=f,h=f,d=u,m=l.parent.children[0],g=l.m,y=h.m,x=d.m,b=m.m,w;d=pv(d),l=lv(l),d&&l;)m=lv(m),h=pv(h),h.a=f,w=d.z+x-l.z-g+t(d._,l._),w>0&&(nD(oD(d,f,p),f,w),g+=w,y+=w),x+=d.m,g+=l.m,b+=m.m,y+=h.m;d&&!pv(h)&&(h.t=d,h.m+=x-y),l&&!lv(m)&&(m.t=l,m.m+=g-b,p=f)}return p}function c(f){f.x*=e,f.y=f.depth*n}return o.separation=function(f){return arguments.length?(t=f,o):t},o.size=function(f){return arguments.length?(r=!1,e=+f[0],n=+f[1],o):r?null:[e,n]},o.nodeSize=function(f){return arguments.length?(r=!0,e=+f[0],n=+f[1],o):r?[e,n]:null},o}var YS=23283064365386963e-26;function va(t=Math.random()){let e=(0<=t&&t<1?t/YS:Math.abs(t))|0;return()=>(e=1664525*e+1013904223|0,YS*(e>>>0))}function we(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function sp(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}var ap=Symbol("implicit");function _a(){var t=new bn,e=[],n=[],r=ap;function o(i){let s=t.get(i);if(s===void 0){if(r!==ap)return r;t.set(i,s=e.push(i)-1)}return n[s%n.length]}return o.domain=function(i){if(!arguments.length)return e.slice();e=[],t=new bn;for(let s of i)t.has(s)||t.set(s,e.push(s)-1);return o},o.range=function(i){return arguments.length?(n=Array.from(i),o):n.slice()},o.unknown=function(i){return arguments.length?(r=i,o):r},o.copy=function(){return _a(e,n).unknown(r)},we.apply(o,arguments),o}function ns(){var t=_a().unknown(void 0),e=t.domain,n=t.range,r=0,o=1,i,s,a=!1,c=0,f=0,u=.5;delete t.unknown;function p(){var l=e().length,h=o<r,d=h?o:r,m=h?r:o;i=(m-d)/Math.max(1,l-c+f*2),a&&(i=Math.floor(i)),d+=(m-d-i*(l-c))*u,s=i*(1-c),a&&(d=Math.round(d),s=Math.round(s));var g=le(l).map(function(y){return d+i*y});return n(h?g.reverse():g)}return t.domain=function(l){return arguments.length?(e(l),p()):e()},t.range=function(l){return arguments.length?([r,o]=l,r=+r,o=+o,p()):[r,o]},t.rangeRound=function(l){return[r,o]=l,r=+r,o=+o,a=!0,p()},t.bandwidth=function(){return s},t.step=function(){return i},t.round=function(l){return arguments.length?(a=!!l,p()):a},t.padding=function(l){return arguments.length?(c=Math.min(1,f=+l),p()):c},t.paddingInner=function(l){return arguments.length?(c=Math.min(1,l),p()):c},t.paddingOuter=function(l){return arguments.length?(f=+l,p()):f},t.align=function(l){return arguments.length?(u=Math.max(0,Math.min(1,l)),p()):u},t.copy=function(){return ns(e(),[r,o]).round(a).paddingInner(c).paddingOuter(f).align(u)},we.apply(p(),arguments)}function US(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return US(e())},t}function hv(){return US(ns.apply(null,arguments).paddingInner(1))}function dv(t){return function(){return t}}function sf(t){return+t}var jS=[0,1];function Fn(t){return t}function mv(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:dv(isNaN(e)?NaN:.5)}function sD(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function aD(t,e,n){var r=t[0],o=t[1],i=e[0],s=e[1];return o<r?(r=mv(o,r),i=n(s,i)):(r=mv(r,o),i=n(i,s)),function(a){return i(r(a))}}function cD(t,e,n){var r=Math.min(t.length,e.length)-1,o=new Array(r),i=new Array(r),s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)o[s]=mv(t[s],t[s+1]),i[s]=n(e[s],e[s+1]);return function(a){var c=Go(t,a,1,r)-1;return i[c](o[c](a))}}function lo(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Ma(){var t=jS,e=jS,n=Wn,r,o,i,s=Fn,a,c,f;function u(){var l=Math.min(t.length,e.length);return s!==Fn&&(s=sD(t[0],t[l-1])),a=l>2?cD:aD,c=f=null,p}function p(l){return l==null||isNaN(l=+l)?i:(c||(c=a(t.map(r),e,n)))(r(s(l)))}return p.invert=function(l){return s(o((f||(f=a(e,t.map(r),Qt)))(l)))},p.domain=function(l){return arguments.length?(t=Array.from(l,sf),u()):t.slice()},p.range=function(l){return arguments.length?(e=Array.from(l),u()):e.slice()},p.rangeRound=function(l){return e=Array.from(l),n=ua,u()},p.clamp=function(l){return arguments.length?(s=l?!0:Fn,u()):s!==Fn},p.interpolate=function(l){return arguments.length?(n=l,u()):n},p.unknown=function(l){return arguments.length?(i=l,p):i},function(l,h){return r=l,o=h,u()}}function cp(){return Ma()(Fn,Fn)}function gv(t,e,n,r){var o=Ic(t,e,n),i;switch(r=so(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(i=fw(o,s))&&(r.precision=i),B0(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=uw(o,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=cw(o))&&(r.precision=i-(r.type==="%")*2);break}}return hr(r)}function ii(t){var e=t.domain;return t.ticks=function(n){var r=e();return Ge(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var o=e();return gv(o[0],o[o.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),o=0,i=r.length-1,s=r[o],a=r[i],c,f,u=10;for(a<s&&(f=s,s=a,a=f,f=o,o=i,i=f);u-- >0;){if(f=Ho(s,a,n),f===c)return r[o]=s,r[i]=a,e(r);if(f>0)s=Math.floor(s/f)*f,a=Math.ceil(a/f)*f;else if(f<0)s=Math.ceil(s*f)/f,a=Math.floor(a*f)/f;else break;c=f}return t},t}function si(){var t=cp();return t.copy=function(){return lo(t,si())},we.apply(t,arguments),ii(t)}function fp(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,sf),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return fp(t).unknown(e)},t=arguments.length?Array.from(t,sf):[0,1],ii(n)}function up(t,e){t=t.slice();var n=0,r=t.length-1,o=t[n],i=t[r],s;return i<o&&(s=n,n=r,r=s,s=o,o=i,i=s),t[n]=e.floor(o),t[r]=e.ceil(i),t}function XS(t){return Math.log(t)}function WS(t){return Math.exp(t)}function fD(t){return-Math.log(-t)}function uD(t){return-Math.exp(-t)}function lD(t){return isFinite(t)?+("1e"+t):t<0?0:t}function pD(t){return t===10?lD:t===Math.E?Math.exp:e=>Math.pow(t,e)}function hD(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function GS(t){return(e,n)=>-t(-e,n)}function yv(t){let e=t(XS,WS),n=e.domain,r=10,o,i;function s(){return o=hD(r),i=pD(r),n()[0]<0?(o=GS(o),i=GS(i),t(fD,uD)):t(XS,WS),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{let c=n(),f=c[0],u=c[c.length-1],p=u<f;p&&([f,u]=[u,f]);let l=o(f),h=o(u),d,m,g=a==null?10:+a,y=[];if(!(r%1)&&h-l<g){if(l=Math.floor(l),h=Math.ceil(h),f>0){for(;l<=h;++l)for(d=1;d<r;++d)if(m=l<0?d/i(-l):d*i(l),!(m<f)){if(m>u)break;y.push(m)}}else for(;l<=h;++l)for(d=r-1;d>=1;--d)if(m=l>0?d/i(-l):d*i(l),!(m<f)){if(m>u)break;y.push(m)}y.length*2<g&&(y=Ge(f,u,g))}else y=Ge(l,h,Math.min(h-l,g)).map(i);return p?y.reverse():y},e.tickFormat=(a,c)=>{if(a==null&&(a=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=so(c)).precision==null&&(c.trim=!0),c=hr(c)),a===1/0)return c;let f=Math.max(1,r*a/e.ticks().length);return u=>{let p=u/i(Math.round(o(u)));return p*r<r-.5&&(p*=r),p<=f?c(u):""}},e.nice=()=>n(up(n(),{floor:a=>i(Math.floor(o(a))),ceil:a=>i(Math.ceil(o(a)))})),e}function lp(){let t=yv(Ma()).domain([1,10]);return t.copy=()=>lo(t,lp()).base(t.base()),we.apply(t,arguments),t}function VS(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function HS(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function xv(t){var e=1,n=t(VS(e),HS(e));return n.constant=function(r){return arguments.length?t(VS(e=+r),HS(e)):e},ii(n)}function pp(){var t=xv(Ma());return t.copy=function(){return lo(t,pp()).constant(t.constant())},we.apply(t,arguments)}function QS(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function dD(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function mD(t){return t<0?-t*t:t*t}function bv(t){var e=t(Fn,Fn),n=1;function r(){return n===1?t(Fn,Fn):n===.5?t(dD,mD):t(QS(n),QS(1/n))}return e.exponent=function(o){return arguments.length?(n=+o,r()):n},ii(e)}function hp(){var t=bv(Ma());return t.copy=function(){return lo(t,hp()).exponent(t.exponent())},we.apply(t,arguments),t}function dp(){var t=[],e=[],n=[],r;function o(){var s=0,a=Math.max(1,e.length);for(n=new Array(a-1);++s<a;)n[s-1]=x2(t,s/a);return i}function i(s){return s==null||isNaN(s=+s)?r:e[Go(n,s)]}return i.invertExtent=function(s){var a=e.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:t[0],a<n.length?n[a]:t[t.length-1]]},i.domain=function(s){if(!arguments.length)return t.slice();t=[];for(let a of s)a!=null&&!isNaN(a=+a)&&t.push(a);return t.sort(dt),o()},i.range=function(s){return arguments.length?(e=Array.from(s),o()):e.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return dp().domain(t).range(e).unknown(r)},we.apply(i,arguments)}function mp(){var t=[.5],e=[0,1],n,r=1;function o(i){return i!=null&&i<=i?e[Go(t,i,0,r)]:n}return o.domain=function(i){return arguments.length?(t=Array.from(i),r=Math.min(t.length,e.length-1),o):t.slice()},o.range=function(i){return arguments.length?(e=Array.from(i),r=Math.min(t.length,e.length-1),o):e.slice()},o.invertExtent=function(i){var s=e.indexOf(i);return[t[s-1],t[s]]},o.unknown=function(i){return arguments.length?(n=i,o):n},o.copy=function(){return mp().domain(t).range(e).unknown(n)},we.apply(o,arguments)}var wv=new Date,vv=new Date;function Wt(t,e,n,r){function o(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(t(i=new Date(+i)),i),o.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),o.round=i=>{let s=o(i),a=o.ceil(i);return i-s<a-i?s:a},o.offset=(i,s)=>(e(i=new Date(+i),s==null?1:Math.floor(s)),i),o.range=(i,s,a)=>{let c=[];if(i=o.ceil(i),a=a==null?1:Math.floor(a),!(i<s)||!(a>0))return c;let f;do c.push(f=new Date(+i)),e(i,a),t(i);while(f<i&&i<s);return c},o.filter=i=>Wt(s=>{if(s>=s)for(;t(s),!i(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!i(s););else for(;--a>=0;)for(;e(s,1),!i(s););}),n&&(o.count=(i,s)=>(wv.setTime(+i),vv.setTime(+s),t(wv),t(vv),Math.floor(n(wv,vv))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(r?s=>r(s)%i===0:s=>o.count(0,s)%i===0):o)),o}var gp=Wt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);gp.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Wt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):gp);var bbt=gp.range;var $e=Wt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),ZS=$e.range;var ai=Wt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),gD=ai.range,ci=Wt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),yD=ci.range;var fi=Wt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),xD=fi.range,ui=Wt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),bD=ui.range;var mr=Wt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),wD=mr.range,Ea=Wt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),vD=Ea.range,Ta=Wt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),_D=Ta.range;function Ia(t){return Wt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var Vn=Ia(0),rs=Ia(1),_g=Ia(2),Mg=Ia(3),ho=Ia(4),Sg=Ia(5),Ag=Ia(6),JS=Vn.range,MD=rs.range,SD=_g.range,AD=Mg.range,ED=ho.range,TD=Sg.range,ID=Ag.range;function Ca(t){return Wt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/6048e5)}var Hn=Ca(0),os=Ca(1),Eg=Ca(2),Tg=Ca(3),mo=Ca(4),Ig=Ca(5),Cg=Ca(6),tA=Hn.range,CD=os.range,ND=Eg.range,kD=Tg.range,RD=mo.range,LD=Ig.range,OD=Cg.range;var li=Wt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),$D=li.range,pi=Wt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),DD=pi.range;var un=Wt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());un.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Wt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});var FD=un.range,ln=Wt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());ln.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Wt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});var PD=ln.range;function nA(t,e,n,r,o,i){let s=[[$e,1,1e3],[$e,5,5*1e3],[$e,15,15*1e3],[$e,30,30*1e3],[i,1,6e4],[i,5,5*6e4],[i,15,15*6e4],[i,30,30*6e4],[o,1,36e5],[o,3,3*36e5],[o,6,6*36e5],[o,12,12*36e5],[r,1,864e5],[r,2,2*864e5],[n,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function a(f,u,p){let l=u<f;l&&([f,u]=[u,f]);let h=p&&typeof p.range=="function"?p:c(f,u,p),d=h?h.range(f,+u+1):[];return l?d.reverse():d}function c(f,u,p){let l=Math.abs(u-f)/p,h=Nr(([,,g])=>g).right(s,l);if(h===s.length)return t.every(Ic(f/31536e6,u/31536e6,p));if(h===0)return gp.every(Math.max(Ic(f,u,p),1));let[d,m]=s[l/s[h-1][2]<s[h][2]/l?h-1:h];return d.every(m)}return[a,c]}var[_v,xp]=nA(ln,pi,Hn,Ta,ui,ci),[Mv,Sv]=nA(un,li,Vn,mr,fi,ai);function Av(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Ev(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function bp(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Tv(t){var e=t.dateTime,n=t.date,r=t.time,o=t.periods,i=t.days,s=t.shortDays,a=t.months,c=t.shortMonths,f=wp(o),u=vp(o),p=wp(i),l=vp(i),h=wp(s),d=vp(s),m=wp(a),g=vp(a),y=wp(c),x=vp(c),b={a:R,A:$,b:O,B:D,c:null,d:cA,e:cA,f:cF,g:xF,G:wF,H:iF,I:sF,j:aF,L:hA,m:fF,M:uF,p:F,q:P,Q:lA,s:pA,S:lF,u:pF,U:hF,V:dF,w:mF,W:gF,x:null,X:null,y:yF,Y:bF,Z:vF,"%":uA},w={a:W,A:K,b:tt,B:nt,c:null,d:fA,e:fA,f:AF,g:$F,G:FF,H:_F,I:MF,j:SF,L:mA,m:EF,M:TF,p:U,q:et,Q:lA,s:pA,S:IF,u:CF,U:NF,V:kF,w:RF,W:LF,x:null,X:null,y:OF,Y:DF,Z:PF,"%":uA},_={a:C,A:S,b:k,B:L,c:M,d:sA,e:sA,f:eF,g:iA,G:oA,H:aA,I:aA,j:ZD,L:tF,m:QD,M:KD,p:T,q:HD,Q:rF,s:oF,S:JD,u:jD,U:XD,V:WD,w:UD,W:GD,x:I,X:N,y:iA,Y:oA,Z:VD,"%":nF};b.x=v(n,b),b.X=v(r,b),b.c=v(e,b),w.x=v(n,w),w.X=v(r,w),w.c=v(e,w);function v(z,G){return function(J){var q=[],bt=-1,st=0,Et=z.length,Ct,Q,qt;for(J instanceof Date||(J=new Date(+J));++bt<Et;)z.charCodeAt(bt)===37&&(q.push(z.slice(st,bt)),(Q=rA[Ct=z.charAt(++bt)])!=null?Ct=z.charAt(++bt):Q=Ct==="e"?" ":"0",(qt=G[Ct])&&(Ct=qt(J,Q)),q.push(Ct),st=bt+1);return q.push(z.slice(st,bt)),q.join("")}}function A(z,G){return function(J){var q=bp(1900,void 0,1),bt=E(q,z,J+="",0),st,Et;if(bt!=J.length)return null;if("Q"in q)return new Date(q.Q);if("s"in q)return new Date(q.s*1e3+("L"in q?q.L:0));if(G&&!("Z"in q)&&(q.Z=0),"p"in q&&(q.H=q.H%12+q.p*12),q.m===void 0&&(q.m="q"in q?q.q:0),"V"in q){if(q.V<1||q.V>53)return null;"w"in q||(q.w=1),"Z"in q?(st=Ev(bp(q.y,0,1)),Et=st.getUTCDay(),st=Et>4||Et===0?os.ceil(st):os(st),st=Ea.offset(st,(q.V-1)*7),q.y=st.getUTCFullYear(),q.m=st.getUTCMonth(),q.d=st.getUTCDate()+(q.w+6)%7):(st=Av(bp(q.y,0,1)),Et=st.getDay(),st=Et>4||Et===0?rs.ceil(st):rs(st),st=mr.offset(st,(q.V-1)*7),q.y=st.getFullYear(),q.m=st.getMonth(),q.d=st.getDate()+(q.w+6)%7)}else("W"in q||"U"in q)&&("w"in q||(q.w="u"in q?q.u%7:"W"in q?1:0),Et="Z"in q?Ev(bp(q.y,0,1)).getUTCDay():Av(bp(q.y,0,1)).getDay(),q.m=0,q.d="W"in q?(q.w+6)%7+q.W*7-(Et+5)%7:q.w+q.U*7-(Et+6)%7);return"Z"in q?(q.H+=q.Z/100|0,q.M+=q.Z%100,Ev(q)):Av(q)}}function E(z,G,J,q){for(var bt=0,st=G.length,Et=J.length,Ct,Q;bt<st;){if(q>=Et)return-1;if(Ct=G.charCodeAt(bt++),Ct===37){if(Ct=G.charAt(bt++),Q=_[Ct in rA?G.charAt(bt++):Ct],!Q||(q=Q(z,J,q))<0)return-1}else if(Ct!=J.charCodeAt(q++))return-1}return q}function T(z,G,J){var q=f.exec(G.slice(J));return q?(z.p=u.get(q[0].toLowerCase()),J+q[0].length):-1}function C(z,G,J){var q=h.exec(G.slice(J));return q?(z.w=d.get(q[0].toLowerCase()),J+q[0].length):-1}function S(z,G,J){var q=p.exec(G.slice(J));return q?(z.w=l.get(q[0].toLowerCase()),J+q[0].length):-1}function k(z,G,J){var q=y.exec(G.slice(J));return q?(z.m=x.get(q[0].toLowerCase()),J+q[0].length):-1}function L(z,G,J){var q=m.exec(G.slice(J));return q?(z.m=g.get(q[0].toLowerCase()),J+q[0].length):-1}function M(z,G,J){return E(z,e,G,J)}function I(z,G,J){return E(z,n,G,J)}function N(z,G,J){return E(z,r,G,J)}function R(z){return s[z.getDay()]}function $(z){return i[z.getDay()]}function O(z){return c[z.getMonth()]}function D(z){return a[z.getMonth()]}function F(z){return o[+(z.getHours()>=12)]}function P(z){return 1+~~(z.getMonth()/3)}function W(z){return s[z.getUTCDay()]}function K(z){return i[z.getUTCDay()]}function tt(z){return c[z.getUTCMonth()]}function nt(z){return a[z.getUTCMonth()]}function U(z){return o[+(z.getUTCHours()>=12)]}function et(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var G=v(z+="",b);return G.toString=function(){return z},G},parse:function(z){var G=A(z+="",!1);return G.toString=function(){return z},G},utcFormat:function(z){var G=v(z+="",w);return G.toString=function(){return z},G},utcParse:function(z){var G=A(z+="",!0);return G.toString=function(){return z},G}}}var rA={"-":"",_:" ",0:"0"},De=/^\s*\d+/,BD=/^%/,zD=/[\\^$*+?|[\]().{}]/g;function $t(t,e,n){var r=t<0?"-":"",o=(r?-t:t)+"",i=o.length;return r+(i<n?new Array(n-i+1).join(e)+o:o)}function YD(t){return t.replace(zD,"\\$&")}function wp(t){return new RegExp("^(?:"+t.map(YD).join("|")+")","i")}function vp(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function UD(t,e,n){var r=De.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function jD(t,e,n){var r=De.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function XD(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function WD(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function GD(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function oA(t,e,n){var r=De.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function iA(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function VD(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function HD(t,e,n){var r=De.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function QD(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function sA(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ZD(t,e,n){var r=De.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function aA(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function KD(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function JD(t,e,n){var r=De.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function tF(t,e,n){var r=De.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function eF(t,e,n){var r=De.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function nF(t,e,n){var r=BD.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function rF(t,e,n){var r=De.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function oF(t,e,n){var r=De.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function cA(t,e){return $t(t.getDate(),e,2)}function iF(t,e){return $t(t.getHours(),e,2)}function sF(t,e){return $t(t.getHours()%12||12,e,2)}function aF(t,e){return $t(1+mr.count(un(t),t),e,3)}function hA(t,e){return $t(t.getMilliseconds(),e,3)}function cF(t,e){return hA(t,e)+"000"}function fF(t,e){return $t(t.getMonth()+1,e,2)}function uF(t,e){return $t(t.getMinutes(),e,2)}function lF(t,e){return $t(t.getSeconds(),e,2)}function pF(t){var e=t.getDay();return e===0?7:e}function hF(t,e){return $t(Vn.count(un(t)-1,t),e,2)}function dA(t){var e=t.getDay();return e>=4||e===0?ho(t):ho.ceil(t)}function dF(t,e){return t=dA(t),$t(ho.count(un(t),t)+(un(t).getDay()===4),e,2)}function mF(t){return t.getDay()}function gF(t,e){return $t(rs.count(un(t)-1,t),e,2)}function yF(t,e){return $t(t.getFullYear()%100,e,2)}function xF(t,e){return t=dA(t),$t(t.getFullYear()%100,e,2)}function bF(t,e){return $t(t.getFullYear()%1e4,e,4)}function wF(t,e){var n=t.getDay();return t=n>=4||n===0?ho(t):ho.ceil(t),$t(t.getFullYear()%1e4,e,4)}function vF(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+$t(e/60|0,"0",2)+$t(e%60,"0",2)}function fA(t,e){return $t(t.getUTCDate(),e,2)}function _F(t,e){return $t(t.getUTCHours(),e,2)}function MF(t,e){return $t(t.getUTCHours()%12||12,e,2)}function SF(t,e){return $t(1+Ea.count(ln(t),t),e,3)}function mA(t,e){return $t(t.getUTCMilliseconds(),e,3)}function AF(t,e){return mA(t,e)+"000"}function EF(t,e){return $t(t.getUTCMonth()+1,e,2)}function TF(t,e){return $t(t.getUTCMinutes(),e,2)}function IF(t,e){return $t(t.getUTCSeconds(),e,2)}function CF(t){var e=t.getUTCDay();return e===0?7:e}function NF(t,e){return $t(Hn.count(ln(t)-1,t),e,2)}function gA(t){var e=t.getUTCDay();return e>=4||e===0?mo(t):mo.ceil(t)}function kF(t,e){return t=gA(t),$t(mo.count(ln(t),t)+(ln(t).getUTCDay()===4),e,2)}function RF(t){return t.getUTCDay()}function LF(t,e){return $t(os.count(ln(t)-1,t),e,2)}function OF(t,e){return $t(t.getUTCFullYear()%100,e,2)}function $F(t,e){return t=gA(t),$t(t.getUTCFullYear()%100,e,2)}function DF(t,e){return $t(t.getUTCFullYear()%1e4,e,4)}function FF(t,e){var n=t.getUTCDay();return t=n>=4||n===0?mo(t):mo.ceil(t),$t(t.getUTCFullYear()%1e4,e,4)}function PF(){return"+0000"}function uA(){return"%"}function lA(t){return+t}function pA(t){return Math.floor(+t/1e3)}var af,cf,yA,go,xA;Iv({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 Iv(t){return af=Tv(t),cf=af.format,yA=af.parse,go=af.utcFormat,xA=af.utcParse,af}function qF(t){return new Date(t)}function BF(t){return t instanceof Date?+t:+new Date(+t)}function Ng(t,e,n,r,o,i,s,a,c,f){var u=cp(),p=u.invert,l=u.domain,h=f(".%L"),d=f(":%S"),m=f("%I:%M"),g=f("%I %p"),y=f("%a %d"),x=f("%b %d"),b=f("%B"),w=f("%Y");function _(v){return(c(v)<v?h:a(v)<v?d:s(v)<v?m:i(v)<v?g:r(v)<v?o(v)<v?y:x:n(v)<v?b:w)(v)}return u.invert=function(v){return new Date(p(v))},u.domain=function(v){return arguments.length?l(Array.from(v,BF)):l().map(qF)},u.ticks=function(v){var A=l();return t(A[0],A[A.length-1],v??10)},u.tickFormat=function(v,A){return A==null?_:f(A)},u.nice=function(v){var A=l();return(!v||typeof v.range!="function")&&(v=e(A[0],A[A.length-1],v??10)),v?l(up(A,v)):u},u.copy=function(){return lo(u,Ng(t,e,n,r,o,i,s,a,c,f))},u}function kg(){return we.apply(Ng(Mv,Sv,un,li,Vn,mr,fi,ai,$e,cf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Rg(){return we.apply(Ng(_v,xp,ln,pi,Hn,Ea,ui,ci,$e,go).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function _p(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Lg(){var t=0,e=.5,n=1,r=1,o,i,s,a,c,f=Fn,u,p=!1,l;function h(m){return isNaN(m=+m)?l:(m=.5+((m=+u(m))-i)*(r*m<r*i?a:c),f(p?Math.max(0,Math.min(1,m)):m))}h.domain=function(m){return arguments.length?([t,e,n]=m,o=u(t=+t),i=u(e=+e),s=u(n=+n),a=o===i?0:.5/(i-o),c=i===s?0:.5/(s-i),r=i<o?-1:1,h):[t,e,n]},h.clamp=function(m){return arguments.length?(p=!!m,h):p},h.interpolator=function(m){return arguments.length?(f=m,h):f};function d(m){return function(g){var y,x,b;return arguments.length?([y,x,b]=g,f=no(m,[y,x,b]),h):[f(0),f(.5),f(1)]}}return h.range=d(Wn),h.rangeRound=d(ua),h.unknown=function(m){return arguments.length?(l=m,h):l},function(m){return u=m,o=m(t),i=m(e),s=m(n),a=o===i?0:.5/(i-o),c=i===s?0:.5/(s-i),r=i<o?-1:1,h}}function Mp(){var t=ii(Lg()(Fn));return t.copy=function(){return _p(t,Mp())},sp.apply(t,arguments)}function Og(){var t=yv(Lg()).domain([.1,1,10]);return t.copy=function(){return _p(t,Og()).base(t.base())},sp.apply(t,arguments)}function $g(){var t=xv(Lg());return t.copy=function(){return _p(t,$g()).constant(t.constant())},sp.apply(t,arguments)}function Dg(){var t=bv(Lg());return t.copy=function(){return _p(t,Dg()).exponent(t.exponent())},sp.apply(t,arguments)}function j(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(r*6,++r*6);return n}var Cv=j("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var Nv=j("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");var kv=j("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");var Rv=j("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0");var Lv=j("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");var Ov=j("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");var $v=j("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");var Dv=j("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");var Fv=j("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");var Pv=j("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var qv=j("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var at=t=>O2(t[t.length-1]);var Fg=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(j),Pg=at(Fg);var qg=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(j),Bg=at(qg);var zg=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(j),Yg=at(zg);var Ug=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(j),jg=at(Ug);var Sp=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(j),ff=at(Sp);var Xg=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(j),Wg=at(Xg);var Ap=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(j),uf=at(Ap);var Gg=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(j),Vg=at(Gg);var Hg=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(j),Qg=at(Hg);var Zg=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(j),Kg=at(Zg);var Jg=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(j),ty=at(Jg);var ey=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(j),ny=at(ey);var ry=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(j),oy=at(ry);var iy=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(j),sy=at(iy);var ay=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(j),cy=at(ay);var fy=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(j),uy=at(fy);var ly=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(j),py=at(ly);var hy=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(j),dy=at(hy);var my=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(j),gy=at(my);var yy=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(j),xy=at(yy);var by=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(j),wy=at(by);var vy=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(j),_y=at(vy);var My=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(j),Sy=at(My);var Ay=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(j),Ey=at(Ay);var Ty=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(j),Iy=at(Ty);var Cy=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(j),Ny=at(Cy);var ky=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(j),Ry=at(ky);function Ly(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 Oy=Fc(Mn(300,.5,0),Mn(-240,.5,1));var Dy=Fc(Mn(-100,.75,.35),Mn(80,1.5,.8)),Fy=Fc(Mn(260,.75,.35),Mn(80,1.5,.8)),$y=Mn();function Py(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return $y.h=360*t-100,$y.s=1.5-1.5*e,$y.l=.8-.9*e,$y+""}var qy=Ee(),zF=Math.PI/3,YF=Math.PI*2/3;function By(t){var e;return t=(.5-t)*Math.PI,qy.r=255*(e=Math.sin(t))*e,qy.g=255*(e=Math.sin(t+zF))*e,qy.b=255*(e=Math.sin(t+YF))*e,qy+""}function zy(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 Yy(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var Uy=Yy(j("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),jy=Yy(j("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Xy=Yy(j("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Wy=Yy(j("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function ve(t){return function(){return t}}var Bv=Math.cos;var lf=Math.min,Ep=Math.sin,Dt=Math.sqrt,zv=1e-12,Na=Math.PI,j_t=Na/2,pf=2*Na;function Gy(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{let r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Qi(e)}var V_t=Array.prototype.slice;function Vy(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function bA(t){this._context=t}bA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function hi(t){return new bA(t)}function Hy(t){return t[0]}function Qy(t){return t[1]}function Tp(t,e){var n=ve(!0),r=null,o=hi,i=null,s=Gy(a);t=typeof t=="function"?t:t===void 0?Hy:ve(t),e=typeof e=="function"?e:e===void 0?Qy:ve(e);function a(c){var f,u=(c=Vy(c)).length,p,l=!1,h;for(r==null&&(i=o(h=s())),f=0;f<=u;++f)!(f<u&&n(p=c[f],f,c))===l&&((l=!l)?i.lineStart():i.lineEnd()),l&&i.point(+t(p,f,c),+e(p,f,c));if(h)return i=null,h+""||null}return a.x=function(c){return arguments.length?(t=typeof c=="function"?c:ve(+c),a):t},a.y=function(c){return arguments.length?(e=typeof c=="function"?c:ve(+c),a):e},a.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ve(!!c),a):n},a.curve=function(c){return arguments.length?(o=c,r!=null&&(i=o(r)),a):o},a.context=function(c){return arguments.length?(c==null?r=i=null:i=o(r=c),a):r},a}function hf(t,e,n){var r=null,o=ve(!0),i=null,s=hi,a=null,c=Gy(f);t=typeof t=="function"?t:t===void 0?Hy:ve(+t),e=typeof e=="function"?e:e===void 0?ve(0):ve(+e),n=typeof n=="function"?n:n===void 0?Qy:ve(+n);function f(p){var l,h,d,m=(p=Vy(p)).length,g,y=!1,x,b=new Array(m),w=new Array(m);for(i==null&&(a=s(x=c())),l=0;l<=m;++l){if(!(l<m&&o(g=p[l],l,p))===y)if(y=!y)h=l,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),d=l-1;d>=h;--d)a.point(b[d],w[d]);a.lineEnd(),a.areaEnd()}y&&(b[l]=+t(g,l,p),w[l]=+e(g,l,p),a.point(r?+r(g,l,p):b[l],n?+n(g,l,p):w[l]))}if(x)return a=null,x+""||null}function u(){return Tp().defined(o).curve(s).context(i)}return f.x=function(p){return arguments.length?(t=typeof p=="function"?p:ve(+p),r=null,f):t},f.x0=function(p){return arguments.length?(t=typeof p=="function"?p:ve(+p),f):t},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:ve(+p),f):r},f.y=function(p){return arguments.length?(e=typeof p=="function"?p:ve(+p),n=null,f):e},f.y0=function(p){return arguments.length?(e=typeof p=="function"?p:ve(+p),f):e},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:ve(+p),f):n},f.lineX0=f.lineY0=function(){return u().x(t).y(e)},f.lineY1=function(){return u().x(t).y(n)},f.lineX1=function(){return u().x(r).y(e)},f.defined=function(p){return arguments.length?(o=typeof p=="function"?p:ve(!!p),f):o},f.curve=function(p){return arguments.length?(s=p,i!=null&&(a=s(i)),f):s},f.context=function(p){return arguments.length?(p==null?i=a=null:a=s(i=p),f):i},f}var Zy=class{constructor(e,n){this._context=e,this._x=n}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(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}};function Yv(t){return new Zy(t,!0)}function Uv(t){return new Zy(t,!1)}var UF=Dt(3),Ip={draw(t,e){let n=Dt(e+lf(e/28,.75))*.59436,r=n/2,o=r*UF;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-o,-r),t.lineTo(o,r),t.moveTo(-o,r),t.lineTo(o,-r)}};var di={draw(t,e){let n=Dt(e/Na);t.moveTo(n,0),t.arc(0,0,n,0,pf)}};var Cp={draw(t,e){let n=Dt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}};var wA=Dt(1/3),jF=wA*2,Np={draw(t,e){let n=Dt(e/jF),r=n*wA;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}};var kp={draw(t,e){let n=Dt(e)*.62625;t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}};var Rp={draw(t,e){let n=Dt(e-lf(e/7,2))*.87559;t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}};var Lp={draw(t,e){let n=Dt(e),r=-n/2;t.rect(r,r,n,n)}};var Op={draw(t,e){let n=Dt(e)*.4431;t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}};var XF=.8908130915292852,vA=Ep(Na/10)/Ep(7*Na/10),WF=Ep(pf/10)*vA,GF=-Bv(pf/10)*vA,$p={draw(t,e){let n=Dt(e*XF),r=WF*n,o=GF*n;t.moveTo(0,-n),t.lineTo(r,o);for(let i=1;i<5;++i){let s=pf*i/5,a=Bv(s),c=Ep(s);t.lineTo(c*n,-a*n),t.lineTo(a*r-c*o,c*r+a*o)}t.closePath()}};var jv=Dt(3),Dp={draw(t,e){let n=-Dt(e/(jv*3));t.moveTo(0,n*2),t.lineTo(-jv*n,-n),t.lineTo(jv*n,-n),t.closePath()}};var VF=Dt(3),Fp={draw(t,e){let n=Dt(e)*.6824,r=n/2,o=n*VF/2;t.moveTo(0,-n),t.lineTo(o,r),t.lineTo(-o,r),t.closePath()}};var gr=-.5,yr=Dt(3)/2,Xv=1/Dt(12),HF=(Xv/2+1)*3,Pp={draw(t,e){let n=Dt(e/HF),r=n/2,o=n*Xv,i=r,s=n*Xv+n,a=-i,c=s;t.moveTo(r,o),t.lineTo(i,s),t.lineTo(a,c),t.lineTo(gr*r-yr*o,yr*r+gr*o),t.lineTo(gr*i-yr*s,yr*i+gr*s),t.lineTo(gr*a-yr*c,yr*a+gr*c),t.lineTo(gr*r+yr*o,gr*o-yr*r),t.lineTo(gr*i+yr*s,gr*s-yr*i),t.lineTo(gr*a+yr*c,gr*c-yr*a),t.closePath()}};var df={draw(t,e){let n=Dt(e-lf(e/6,1.7))*.6189;t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}};var Ky=[di,Cp,Np,Lp,$p,Dp,Pp],Wv=[di,Rp,df,Fp,Ip,Op,kp];function xr(){}function mf(t,e,n){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+e)/6,(t._y0+4*t._y1+n)/6)}function qp(t){this._context=t}qp.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:mf(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,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:mf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Gv(t){return new qp(t)}function _A(t){this._context=t}_A.prototype={areaStart:xr,areaEnd:xr,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,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:mf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Vv(t){return new _A(t)}function MA(t){this._context=t}MA.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,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:mf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Hv(t){return new MA(t)}function SA(t,e){this._basis=new qp(t),this._beta=e}SA.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],o=e[0],i=t[n]-r,s=e[n]-o,a=-1,c;++a<=n;)c=a/n,this._basis.point(this._beta*t[a]+(1-this._beta)*(r+c*i),this._beta*e[a]+(1-this._beta)*(o+c*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var Qv=function t(e){function n(r){return e===1?new qp(r):new SA(r,e)}return n.beta=function(r){return t(+r)},n}(.85);function gf(t,e,n){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-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Jy(t,e){this._context=t,this._k=(1-e)/6}Jy.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:gf(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,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:gf(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Zv=function t(e){function n(r){return new Jy(r,e)}return n.tension=function(r){return t(+r)},n}(0);function tx(t,e){this._context=t,this._k=(1-e)/6}tx.prototype={areaStart:xr,areaEnd:xr,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,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:gf(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Kv=function t(e){function n(r){return new tx(r,e)}return n.tension=function(r){return t(+r)},n}(0);function ex(t,e){this._context=t,this._k=(1-e)/6}ex.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,e){switch(t=+t,e=+e,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:gf(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Jv=function t(e){function n(r){return new ex(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Bp(t,e,n){var r=t._x1,o=t._y1,i=t._x2,s=t._y2;if(t._l01_a>zv){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,o=(o*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>zv){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*f+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*f+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,o,i,s,t._x2,t._y2)}function AA(t,e){this._context=t,this._alpha=e}AA.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,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Bp(this,t,e);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=e}};var t_=function t(e){function n(r){return e?new AA(r,e):new Jy(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function EA(t,e){this._context=t,this._alpha=e}EA.prototype={areaStart:xr,areaEnd:xr,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,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Bp(this,t,e);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=e}};var e_=function t(e){function n(r){return e?new EA(r,e):new tx(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function TA(t,e){this._context=t,this._alpha=e}TA.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,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+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:Bp(this,t,e);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=e}};var n_=function t(e){function n(r){return e?new TA(r,e):new ex(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function IA(t){this._context=t}IA.prototype={areaStart:xr,areaEnd:xr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function r_(t){return new IA(t)}function CA(t){return t<0?-1:1}function NA(t,e,n){var r=t._x1-t._x0,o=e-t._x1,i=(t._y1-t._y0)/(r||o<0&&-0),s=(n-t._y1)/(o||r<0&&-0),a=(i*o+s*r)/(r+o);return(CA(i)+CA(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(a))||0}function kA(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function o_(t,e,n){var r=t._x0,o=t._y0,i=t._x1,s=t._y1,a=(i-r)/3;t._context.bezierCurveTo(r+a,o+a*e,i-a,s-a*n,i,s)}function nx(t){this._context=t}nx.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:o_(this,this._t0,kA(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,o_(this,kA(this,n=NA(this,t,e)),n);break;default:o_(this,this._t0,n=NA(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function RA(t){this._context=new LA(t)}(RA.prototype=Object.create(nx.prototype)).point=function(t,e){nx.prototype.point.call(this,e,t)};function LA(t){this._context=t}LA.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,o,i){this._context.bezierCurveTo(e,t,r,n,i,o)}};function i_(t){return new nx(t)}function s_(t){return new RA(t)}function $A(t){this._context=t}$A.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=OA(t),o=OA(e),i=0,s=1;s<n;++i,++s)this._context.bezierCurveTo(r[0][i],o[0][i],r[1][i],o[1][i],t[s],e[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function OA(t){var e,n=t.length-1,r,o=new Array(n),i=new Array(n),s=new Array(n);for(o[0]=0,i[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)o[e]=1,i[e]=4,s[e]=4*t[e]+2*t[e+1];for(o[n-1]=2,i[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=o[e]/i[e-1],i[e]-=r,s[e]-=r*s[e-1];for(o[n-1]=s[n-1]/i[n-1],e=n-2;e>=0;--e)o[e]=(s[e]-o[e+1])/i[e];for(i[n-1]=(t[n]+o[n-1])/2,e=0;e<n-1;++e)i[e]=2*t[e+1]-o[e+1];return[o,i]}function a_(t){return new $A(t)}function rx(t,e){this._context=t,this._t=e}rx.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,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function c_(t){return new rx(t,.5)}function f_(t){return new rx(t,0)}function u_(t){return new rx(t,1)}var zp=t=>()=>t;function l_(t,{sourceEvent:e,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Qn(t,e,n){this.k=t,this.x=e,this.y=n}Qn.prototype={constructor:Qn,scale:function(t){return t===1?this:new Qn(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Qn(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Yp=new Qn(1,0,0);p_.prototype=Qn.prototype;function p_(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Yp;return t.__zoom}function ox(t){t.stopImmediatePropagation()}function yf(t){t.preventDefault(),t.stopImmediatePropagation()}function QF(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function ZF(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function DA(){return this.__zoom||Yp}function KF(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function JF(){return navigator.maxTouchPoints||"ontouchstart"in this}function tP(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function h_(){var t=QF,e=ZF,n=tP,r=KF,o=JF,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=B2,f=oa("start","zoom","end"),u,p,l,h=500,d=150,m=0,g=10;function y(M){M.property("__zoom",DA).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",C).filter(o).on("touchstart.zoom",S).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(M,I,N,R){var $=M.selection?M.selection():M;$.property("__zoom",DA),M!==$?_(M,I,N,R):$.interrupt().each(function(){v(this,arguments).event(R).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(M,I,N,R){y.scaleTo(M,function(){var $=this.__zoom.k,O=typeof I=="function"?I.apply(this,arguments):I;return $*O},N,R)},y.scaleTo=function(M,I,N,R){y.transform(M,function(){var $=e.apply(this,arguments),O=this.__zoom,D=N==null?w($):typeof N=="function"?N.apply(this,arguments):N,F=O.invert(D),P=typeof I=="function"?I.apply(this,arguments):I;return n(b(x(O,P),D,F),$,s)},N,R)},y.translateBy=function(M,I,N,R){y.transform(M,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof N=="function"?N.apply(this,arguments):N),e.apply(this,arguments),s)},null,R)},y.translateTo=function(M,I,N,R,$){y.transform(M,function(){var O=e.apply(this,arguments),D=this.__zoom,F=R==null?w(O):typeof R=="function"?R.apply(this,arguments):R;return n(Yp.translate(F[0],F[1]).scale(D.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof N=="function"?-N.apply(this,arguments):-N),O,s)},R,$)};function x(M,I){return I=Math.max(i[0],Math.min(i[1],I)),I===M.k?M:new Qn(I,M.x,M.y)}function b(M,I,N){var R=I[0]-N[0]*M.k,$=I[1]-N[1]*M.k;return R===M.x&&$===M.y?M:new Qn(M.k,R,$)}function w(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function _(M,I,N,R){M.on("start.zoom",function(){v(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){v(this,arguments).event(R).end()}).tween("zoom",function(){var $=this,O=arguments,D=v($,O).event(R),F=e.apply($,O),P=N==null?w(F):typeof N=="function"?N.apply($,O):N,W=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),K=$.__zoom,tt=typeof I=="function"?I.apply($,O):I,nt=c(K.invert(P).concat(W/K.k),tt.invert(P).concat(W/tt.k));return function(U){if(U===1)U=tt;else{var et=nt(U),z=W/et[2];U=new Qn(z,P[0]-et[0]*z,P[1]-et[1]*z)}D.zoom(null,U)}})}function v(M,I,N){return!N&&M.__zooming||new A(M,I)}function A(M,I){this.that=M,this.args=I,this.active=0,this.sourceEvent=null,this.extent=e.apply(M,I),this.taps=0}A.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,I){return this.mouse&&M!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var I=At(this.that).datum();f.call(M,this.that,new l_(M,{sourceEvent:this.sourceEvent,target:y,type:M,transform:this.that.__zoom,dispatch:f}),I)}};function E(M,...I){if(!t.apply(this,arguments))return;var N=v(this,I).event(M),R=this.__zoom,$=Math.max(i[0],Math.min(i[1],R.k*Math.pow(2,r.apply(this,arguments)))),O=on(M);if(N.wheel)(N.mouse[0][0]!==O[0]||N.mouse[0][1]!==O[1])&&(N.mouse[1]=R.invert(N.mouse[0]=O)),clearTimeout(N.wheel);else{if(R.k===$)return;N.mouse=[O,R.invert(O)],ro(this),N.start()}yf(M),N.wheel=setTimeout(D,d),N.zoom("mouse",n(b(x(R,$),N.mouse[0],N.mouse[1]),N.extent,s));function D(){N.wheel=null,N.end()}}function T(M,...I){if(l||!t.apply(this,arguments))return;var N=M.currentTarget,R=v(this,I,!0).event(M),$=At(M.view).on("mousemove.zoom",P,!0).on("mouseup.zoom",W,!0),O=on(M,N),D=M.clientX,F=M.clientY;xl(M.view),ox(M),R.mouse=[O,this.__zoom.invert(O)],ro(this),R.start();function P(K){if(yf(K),!R.moved){var tt=K.clientX-D,nt=K.clientY-F;R.moved=tt*tt+nt*nt>m}R.event(K).zoom("mouse",n(b(R.that.__zoom,R.mouse[0]=on(K,N),R.mouse[1]),R.extent,s))}function W(K){$.on("mousemove.zoom mouseup.zoom",null),bl(K.view,R.moved),yf(K),R.event(K).end()}}function C(M,...I){if(t.apply(this,arguments)){var N=this.__zoom,R=on(M.changedTouches?M.changedTouches[0]:M,this),$=N.invert(R),O=N.k*(M.shiftKey?.5:2),D=n(b(x(N,O),R,$),e.apply(this,I),s);yf(M),a>0?At(this).transition().duration(a).call(_,D,R,M):At(this).call(y.transform,D,R,M)}}function S(M,...I){if(t.apply(this,arguments)){var N=M.touches,R=N.length,$=v(this,I,M.changedTouches.length===R).event(M),O,D,F,P;for(ox(M),D=0;D<R;++D)F=N[D],P=on(F,this),P=[P,this.__zoom.invert(P),F.identifier],$.touch0?!$.touch1&&$.touch0[2]!==P[2]&&($.touch1=P,$.taps=0):($.touch0=P,O=!0,$.taps=1+!!u);u&&(u=clearTimeout(u)),O&&($.taps<2&&(p=P[0],u=setTimeout(function(){u=null},h)),ro(this),$.start())}}function k(M,...I){if(this.__zooming){var N=v(this,I).event(M),R=M.changedTouches,$=R.length,O,D,F,P;for(yf(M),O=0;O<$;++O)D=R[O],F=on(D,this),N.touch0&&N.touch0[2]===D.identifier?N.touch0[0]=F:N.touch1&&N.touch1[2]===D.identifier&&(N.touch1[0]=F);if(D=N.that.__zoom,N.touch1){var W=N.touch0[0],K=N.touch0[1],tt=N.touch1[0],nt=N.touch1[1],U=(U=tt[0]-W[0])*U+(U=tt[1]-W[1])*U,et=(et=nt[0]-K[0])*et+(et=nt[1]-K[1])*et;D=x(D,Math.sqrt(U/et)),F=[(W[0]+tt[0])/2,(W[1]+tt[1])/2],P=[(K[0]+nt[0])/2,(K[1]+nt[1])/2]}else if(N.touch0)F=N.touch0[0],P=N.touch0[1];else return;N.zoom("touch",n(b(D,F,P),N.extent,s))}}function L(M,...I){if(this.__zooming){var N=v(this,I).event(M),R=M.changedTouches,$=R.length,O,D;for(ox(M),l&&clearTimeout(l),l=setTimeout(function(){l=null},h),O=0;O<$;++O)D=R[O],N.touch0&&N.touch0[2]===D.identifier?delete N.touch0:N.touch1&&N.touch1[2]===D.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(D=on(D,this),Math.hypot(p[0]-D[0],p[1]-D[1])<g)){var F=At(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return y.wheelDelta=function(M){return arguments.length?(r=typeof M=="function"?M:zp(+M),y):r},y.filter=function(M){return arguments.length?(t=typeof M=="function"?M:zp(!!M),y):t},y.touchable=function(M){return arguments.length?(o=typeof M=="function"?M:zp(!!M),y):o},y.extent=function(M){return arguments.length?(e=typeof M=="function"?M:zp([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),y):e},y.scaleExtent=function(M){return arguments.length?(i[0]=+M[0],i[1]=+M[1],y):[i[0],i[1]]},y.translateExtent=function(M){return arguments.length?(s[0][0]=+M[0][0],s[1][0]=+M[1][0],s[0][1]=+M[0][1],s[1][1]=+M[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(M){return arguments.length?(n=M,y):n},y.duration=function(M){return arguments.length?(a=+M,y):a},y.interpolate=function(M){return arguments.length?(c=M,y):c},y.on=function(){var M=f.on.apply(f,arguments);return M===f?y:M},y.clickDistance=function(M){return arguments.length?(m=(M=+M)*M,y):Math.sqrt(m)},y.tapDistance=function(M){return arguments.length?(g=+M,y):g},y}function Jt(t){return t!=null&&!Number.isNaN(t)}function Fe(t,e){return+Jt(e)-+Jt(t)||dt(t,e)}function ka(t,e){return+Jt(e)-+Jt(t)||xn(t,e)}function Up(t){return t!=null&&`${t}`!=""}function xf(t){return isFinite(t)?t:NaN}function Nn(t){return t>0&&isFinite(t)?t:NaN}function is(t){return t<0&&isFinite(t)?t:NaN}function ix(t,e){if(t instanceof Date||(t=new Date(+t)),isNaN(t))return typeof e=="function"?e(t):e;let n=t.getUTCHours(),r=t.getUTCMinutes(),o=t.getUTCSeconds(),i=t.getUTCMilliseconds();return`${eP(t.getUTCFullYear(),4)}-${mi(t.getUTCMonth()+1,2)}-${mi(t.getUTCDate(),2)}${n||r||o||i?`T${mi(n,2)}:${mi(r,2)}${o||i?`:${mi(o,2)}${i?`.${mi(i,3)}`:""}`:""}Z`:""}`}function eP(t){return t<0?`-${mi(-t,6)}`:t>9999?`+${mi(t,6)}`:mi(t,4)}function mi(t,e){return`${t}`.padStart(e,"0")}var nP=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function jp(t,e){return nP.test(t+="")?new Date(t):typeof e=="function"?e(t):e}function gi(t){if(t==null)return;let e=t[0],n=t[t.length-1];return xn(e,n)}var wf=1e3,as=wf*60,cs=as*60,xo=cs*24,yo=xo*7,Ra=xo*30,ss=xo*365,d_=[["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",wf],["5 seconds",5*wf],["15 seconds",15*wf],["30 seconds",30*wf],["minute",as],["5 minutes",5*as],["15 minutes",15*as],["30 minutes",30*as],["hour",cs],["3 hours",3*cs],["6 hours",6*cs],["12 hours",12*cs],["day",xo],["2 days",2*xo],["week",yo],["2 weeks",2*yo],["month",Ra],["3 months",3*Ra],["6 months",6*Ra],["year",ss],["2 years",2*ss],["5 years",5*ss],["10 years",10*ss],["20 years",20*ss],["50 years",50*ss],["100 years",100*ss]],m_=new Map([["second",wf],["minute",as],["hour",cs],["day",xo],["monday",yo],["tuesday",yo],["wednesday",yo],["thursday",yo],["friday",yo],["saturday",yo],["sunday",yo],["week",yo],["month",Ra],["year",ss]]),PA=new Map([["second",$e],["minute",ai],["hour",fi],["day",mr],["monday",rs],["tuesday",_g],["wednesday",Mg],["thursday",ho],["friday",Sg],["saturday",Ag],["sunday",Vn],["week",Vn],["month",li],["year",un]]),g_=new Map([["second",$e],["minute",ci],["hour",ui],["day",Ta],["monday",os],["tuesday",Eg],["wednesday",Tg],["thursday",mo],["friday",Ig],["saturday",Cg],["sunday",Hn],["week",Hn],["month",pi],["year",ln]]),vf=Symbol("intervalDuration"),ax=Symbol("intervalType");for(let[t,e]of PA)e[vf]=m_.get(t),e[ax]="time";for(let[t,e]of g_)e[vf]=m_.get(t),e[ax]="utc";var Xp=[["year",ln,"utc"],["month",pi,"utc"],["day",Ta,"utc",6*Ra],["hour",ui,"utc",3*xo],["minute",ci,"utc",6*cs],["second",$e,"utc",30*as]],sx=[["year",un,"time"],["month",li,"time"],["day",mr,"time",6*Ra],["hour",fi,"time",3*xo],["minute",ai,"time",6*cs],["second",$e,"time",30*as]],rP=[Xp[0],sx[0],Xp[1],sx[1],Xp[2],sx[2],...Xp.slice(3)];function cx(t){let e=`${t}`.toLowerCase();e.endsWith("s")&&(e=e.slice(0,-1));let n=1,r=/^(?:(\d+)\s+)/.exec(e);switch(r&&(e=e.slice(r[0].length),n=+r[1]),e){case"quarter":e="month",n*=3;break;case"half":e="month",n*=6;break}let o=g_.get(e);if(!o)throw new Error(`unknown interval: ${t}`);if(n>1&&!o.every)throw new Error(`non-periodic interval: ${e}`);return[e,n]}function Wp(t){return qA(cx(t),"time")}function La(t){return qA(cx(t),"utc")}function qA([t,e],n){let r=(n==="time"?PA:g_).get(t);return e>1&&(r=r.every(e),r[vf]=m_.get(t)*e,r[ax]=n),r}function y_(t,e){if(!(e>1))return;let n=t[vf];if(!d_.some(([,o])=>o===n)||n%xo===0&&xo<n&&n<Ra)return;let[r]=d_[Nr(([,o])=>Math.log(o)).center(d_,Math.log(n*e))];return(t[ax]==="time"?Wp:La)(r)}function FA(t,e,n){let r=e==="time"?cf:go;if(n==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 o=oP(n);switch(t){case"millisecond":return bf(r(".%L"),r(":%M:%S"),o);case"second":return bf(r(":%S"),r("%-I:%M"),o);case"minute":return bf(r("%-I:%M"),r("%p"),o);case"hour":return bf(r("%-I %p"),r("%b %-d"),o);case"day":return bf(r("%-d"),r("%b"),o);case"month":return bf(r("%b"),r("%Y"),o);case"year":return r("%Y")}throw new Error("unable to format time ticks")}function oP(t){return t==="left"||t==="right"?(e,n)=>`
3
3
  ${e}
4
4
  ${n}`:t==="top"?(e,n)=>`${n}
5
5
  ${e}`:(e,n)=>`${e}
@@ -57,4 +57,4 @@ ${m}`)).style("margin-left",f?`${+f}px`:null).style("width",l===void 0?null:`${+
57
57
  :where(.${c} text),
58
58
  :where(.${c} tspan) {
59
59
  white-space: pre;
60
- }`)).call(Df,n);for(let O of f){let{channels:D,values:F,facets:P}=m.get(O);if(d===void 0||O.facet==="super"){let W=null;if(P&&(W=P[0],W=O.filter(W,D,F),W.length===0))continue;let K=O.render(W,x,F,v,A);if(K==null)continue;T.appendChild(K)}else{let W;for(let K of d){if(!(O.facetAnchor?.(d,k,K)??!K.empty))continue;let tt=null;if(P){let U=p.has(O);if(tt=P[U?K.i:0],tt=O.filter(tt,D,F),tt.length===0)continue;!U&&tt===P[0]&&(tt=bi(tt)),tt.fx=K.x,tt.fy=K.y,tt.fi=K.i}let nt=O.render(tt,x,F,_,A);if(nt!=null){(W??=At(T).append("g")).append(()=>nt).datum(K);for(let U of["aria-label","aria-description","aria-hidden","transform"])nt.hasAttribute(U)&&(W.attr(U,nt.getAttribute(U)),nt.removeAttribute(U))}}W?.selectChildren().attr("transform",L)}}let N=vT(g,A,t),{figure:R=r!=null||o!=null||i!=null||N.length>0}=t;R&&(C=E.createElement("figure"),C.className=`${c}-figure`,C.style.maxWidth="initial",r!=null&&C.append(DT(E,r,"h2")),o!=null&&C.append(DT(E,o,"h3")),C.append(...N,T),i!=null&&C.append(vB(E,i)),"value"in T&&(C.value=T.value,delete T.value)),C.scale=cE(x.scales),C.legend=bT(g,A,t);let $=q7();return $>0&&At(T).append("text").attr("x",M).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("\u26A0\uFE0F").append("title").text(`${$.toLocaleString("en-US")} warning${$===1?"":"s"}. Please check the console.`),C}function DT(t,e,n){if(e.ownerDocument)return e;let r=t.createElement(n);return r.append(e),r}function vB(t,e){let n=t.createElement("figcaption");return n.append(e),n}function FT(t){return t.flat(1/0).filter(e=>e!=null).map(_B)}function _B(t){return typeof t.render=="function"?t:new $6(t)}var $6=class extends ft{constructor(e){if(typeof e!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=e}render(){}};function D6(t,e){for(let n in t)zT(t[n],e);return t}function zT(t,e){let{scale:n,transform:r=!0}=t;if(n==null||!r)return;let{type:o,percent:i,interval:s,transform:a=i?c=>c==null?NaN:c*100:C_(s,o)}=e[n]??{};a!=null&&(t.value=Mt(t.value,a),t.transform=!1)}function MB(t){for(let e in t)X_(e,t[e])}function xh(t,e,n,r=jA){for(let{channels:o}of e.values())for(let i in o){let s=o[i],{scale:a}=s;if(a!=null&&r(a))if(a==="projection"){if(!bE(n)){let c=n.x?.domain===void 0,f=n.y?.domain===void 0;if(c||f){let[u,p]=vE(s);c&&O6(t,"x",u),f&&O6(t,"y",p)}}}else O6(t,a,s)}return t}function O6(t,e,n){let r=t.get(e);r!==void 0?r.push(n):t.set(e,[n])}function SB(t,e){if(t==null)return;let{x:n,y:r}=t;if(n==null&&r==null)return;let o=yi(t.data);if(o==null)throw new Error("missing facet data");let i={};n!=null&&(i.fx=Cf(o,{value:n,scale:"fx"})),r!=null&&(i.fy=Cf(o,{value:r,scale:"fy"})),D6(i,e);let s=Cx(o,i);return{channels:i,groups:s,data:t.data}}function PT(t,e,n){if(t.facet===null||t.facet==="super")return;let{fx:r,fy:o}=t;if(r!=null||o!=null){let c=yi(t.data??r??o);if(c===void 0)throw new Error(`missing facet data in ${t.ariaLabel}`);if(c===null)return;let f={};return r!=null&&(f.fx=Cf(c,{value:r,scale:"fx"})),o!=null&&(f.fy=Cf(c,{value:o,scale:"fy"})),D6(f,n),{channels:f,groups:Cx(c,f)}}if(e===void 0)return;let{channels:i,groups:s,data:a}=e;if(t.facet!=="auto"||t.data===a)return{channels:i,groups:s};a.length>0&&(s.size>1||s.size===1&&i.fx&&i.fy&&[...s][0][1].size>1)&&ps(yi(t.data))===ps(a)&&hn(`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 AB(t,e={}){return Gt({...e,x:null,y:null},(n,r,o,i,s,a)=>a.getMarkState(t))}function EB(t){let e=[];for(let n of t){let r=n.tip;if(r){r===!0?r={}:typeof r=="string"&&(r={pointer:r});let{pointer:o,preferredAnchor:i}=r;o=/^x$/i.test(o)?Ms:/^y$/i.test(o)?Ti:_s,r=o(AB(n,r)),r.title=null,i===void 0&&(r.preferredAnchor=o===Ti?"left":"bottom");let s=i1(n.data,r);s.facet=n.facet,s.facetAnchor=n.facetAnchor,e.push(s)}}return e}function TB(t,e,n){let{projection:r,x:o={},y:i={},fx:s={},fy:a={},axis:c,grid:f,facet:u={},facet:{axis:p=c,grid:l}=u,x:{axis:h=c,grid:d=h===null?null:f}=o,y:{axis:m=c,grid:g=m===null?null:f}=i,fx:{axis:y=p,grid:x=y===null?null:l}=s,fy:{axis:b=p,grid:w=b===null?null:l}=a}=n;(r||!bo(o)&&!qT("x",t))&&(h=d=null),(r||!bo(i)&&!qT("y",t))&&(m=g=null),e.has("fx")||(y=x=null),e.has("fy")||(b=w=null),h===void 0&&(h=!c1(t,"x")),m===void 0&&(m=!c1(t,"y")),y===void 0&&(y=!c1(t,"fx")),b===void 0&&(b=!c1(t,"fy")),h===!0&&(h="bottom"),m===!0&&(m="left"),y===!0&&(y=h==="top"||h===null?"bottom":"top"),b===!0&&(b=m==="right"||m===null?"left":"right");let _=[];return a1(_,w,Qx,a),s1(_,b,Gx,"right","left",u,a),a1(_,x,Kx,s),s1(_,y,Vx,"top","bottom",u,s),a1(_,g,Hx,i),s1(_,m,fh,"left","right",n,i),a1(_,d,Zx,o),s1(_,h,uh,"bottom","top",n,o),_}function s1(t,e,n,r,o,i,s){if(!e)return;let a=IB(e);s=CB(a?r:e,i,s);let{line:c}=s;(n===fh||n===uh)&&c&&!vi(c)&&t.push(Wf(NB(s))),t.push(n(s)),a&&t.push(n({...s,anchor:o,label:null}))}function a1(t,e,n,r){!e||vi(e)||t.push(n(kB(e,r)))}function IB(t){return/^\s*both\s*$/i.test(t)}function CB(t,e,{line:n=e.line,ticks:r,tickSize:o,tickSpacing:i,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:f,ariaLabel:u,ariaDescription:p,label:l=e.label,labelAnchor:h,labelArrow:d=e.labelArrow,labelOffset:m}){return{anchor:t,line:n,ticks:r,tickSize:o,tickSpacing:i,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:f,ariaLabel:u,ariaDescription:p,label:l,labelAnchor:h,labelArrow:d,labelOffset:m}}function NB(t){let{anchor:e,line:n}=t;return{anchor:e,facetAnchor:e+"-empty",stroke:n===!0?void 0:n}}function kB(t,{stroke:e=ds(t)?t:void 0,ticks:n=RB(t)?t:void 0,tickSpacing:r,ariaLabel:o,ariaDescription:i}){return{stroke:e,ticks:n,tickSpacing:r,ariaLabel:o,ariaDescription:i}}function RB(t){switch(typeof t){case"number":return!0;case"string":return!ds(t)}return Rn(t)||typeof t?.range=="function"}function c1(t,e){let n=`${e}-axis `;return t.some(r=>r.ariaLabel?.startsWith(n))}function qT(t,e){for(let n of e)for(let r in n.channels){let{scale:o}=n.channels[r];if(o===t||o==="projection")return!0}return!1}function LB(t,e){for(let n in t){let r=t[n],o=e[n];r.label===void 0&&o&&(r.label=o.label)}return t}function OB({fx:t,fy:e},n){let{marginTop:r,marginRight:o,marginBottom:i,marginLeft:s,width:a,height:c}=Ex(n),f=t&&BT(t),u=e&&BT(e);return{marginTop:e?u[0]:r,marginRight:t?a-f[1]:o,marginBottom:e?c-u[1]:i,marginLeft:t?f[0]:s,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:a,height:c}}function BT(t){let e=t.domain();if(e.length===0)return[0,t.bandwidth()];let n=t(e[0]),r=t(e[e.length-1]);return r<n&&([n,r]=[r,n]),[n,r+t.bandwidth()]}var $B=new Map([["basis",Gv],["basis-closed",Vv],["basis-open",Hv],["bundle",Qv],["bump-x",Yv],["bump-y",Uv],["cardinal",Zv],["cardinal-closed",Kv],["cardinal-open",Jv],["catmull-rom",t_],["catmull-rom-closed",e_],["catmull-rom-open",n_],["linear",hi],["linear-closed",r_],["monotone-x",i_],["monotone-y",s_],["natural",a_],["step",c_],["step-after",u_],["step-before",f_]]);function bh(t=hi,e){if(typeof t=="function")return t;let n=$B.get(`${t}`.toLowerCase());if(!n)throw new Error(`unknown curve: ${t}`);if(e!==void 0){if("beta"in n)return n.beta(e);if("tension"in n)return n.tension(e);if("alpha"in n)return n.alpha(e)}return n}function f1(t=Cs,e){return typeof t!="function"&&`${t}`.toLowerCase()==="auto"?Cs:bh(t,e)}function Cs(t){return hi(t)}function Co(t={y:"count"},e={}){[t,e]=P6(t,e);let{x:n,y:r}=e;return F6(u1(n,e,X),null,null,r,t,Ba(e))}function No(t={x:"count"},e={}){[t,e]=P6(t,e);let{x:n,y:r}=e;return F6(null,u1(r,e,X),n,null,t,za(e))}function Ci(t={fill:"count"},e={}){[t,e]=P6(t,e);let{x:n,y:r}=DB(e);return F6(n,r,null,null,t,Ba(za(e)))}function jT(t,e,n={}){if(n?.interval==null)return n;let{reduce:r=wx}=n,o={filter:null};return n[e]!=null&&(o[e]=r),n[`${e}1`]!=null&&(o[`${e}1`]=r),n[`${e}2`]!=null&&(o[`${e}2`]=r),t(o,n)}function Vf(t={}){return jT(Co,"y",Fr(t,"x"))}function Hf(t={}){return jT(No,"x",Fr(t,"y"))}function F6(t,e,n,r,{data:o=bx,filter:i=Zp,sort:s,reverse:a,...c}={},f={}){t=YT(t),e=YT(e),c=FB(c,f),o=GT(o,X),s=s==null?void 0:XT("sort",s,f),i=i==null?void 0:WT("filter",i,f),n!=null&&So(c,"x","x1","x2")&&(n=null),r!=null&&So(c,"y","y1","y2")&&(r=null);let[u,p]=Ze(t),[l,h]=Ze(t),[d,m]=Ze(e),[g,y]=Ze(e),[x,b]=n!=null?[n,"x"]:r!=null?[r,"y"]:[],[w,_]=Ze(x),{x:v,y:A,z:E,fill:T,stroke:C,x1:S,x2:k,y1:L,y2:M,domain:I,cumulative:N,thresholds:R,interval:$,...O}=f,[D,F]=Ze(E),[P]=ne(T),[W]=ne(C),[K,tt]=Ze(P),[nt,U]=Ze(W);return{..."z"in f&&{z:D||E},..."fill"in f&&{fill:K||T},..."stroke"in f&&{stroke:nt||C},...Me(O,(et,z,G)=>{let J=$a(ct(et,x),G?.[b]),q=ct(et,E),bt=ct(et,P),st=ct(et,W),Et=th(c,{z:q,fill:bt,stroke:st}),Ct=[],Q=[],qt=J&&_([]),Bn=q&&F([]),Yr=bt&&tt([]),FC=st&&U([]),V3=t&&p([]),PC=t&&h([]),H3=e&&m([]),qC=e&&y([]),BC=BB(t,e,et),zC=0;for(let rc of c)rc.initialize(et);s&&s.initialize(et),i&&i.initialize(et);for(let rc of z){let Q3=[];for(let oc of c)oc.scope("facet",rc);s&&s.scope("facet",rc),i&&i.scope("facet",rc);for(let[oc,YC]of Mo(rc,Et))for(let[UC,sd]of Mo(YC,J))for(let[Ur,Do]of BC(sd))if(Et&&(Do.z=oc),!(i&&!i.reduce(Ur,Do))){Q3.push(zC++),Q.push(o.reduceIndex(Ur,et,Do)),J&&qt.push(UC),q&&Bn.push(Et===q?oc:q[(Ur.length>0?Ur:sd)[0]]),bt&&Yr.push(Et===bt?oc:bt[(Ur.length>0?Ur:sd)[0]]),st&&FC.push(Et===st?oc:st[(Ur.length>0?Ur:sd)[0]]),V3&&(V3.push(Do.x1),PC.push(Do.x2)),H3&&(H3.push(Do.y1),qC.push(Do.y2));for(let jC of c)jC.reduce(Ur,Do);s&&s.reduce(Ur,Do)}Ct.push(Q3)}return Y_(Ct,s,a),{data:Q,facets:Ct}}),...!So(c,"x")&&(u?{x1:u,x2:l,x:Sf(u,l)}:{x:v,x1:S,x2:k}),...!So(c,"y")&&(d?{y1:d,y2:g,y:Sf(d,g)}:{y:A,y1:L,y2:M}),...w&&{[b]:w},...Object.fromEntries(c.map(({name:et,output:z})=>[et,z]))}}function P6({cumulative:t,domain:e,thresholds:n,interval:r,...o},i){return[o,{cumulative:t,domain:e,thresholds:n,interval:r,...i}]}function u1(t,{cumulative:e,domain:n,thresholds:r,interval:o},i){return t={...wr(t)},t.domain===void 0&&(t.domain=n),t.cumulative===void 0&&(t.cumulative=e),t.thresholds===void 0&&(t.thresholds=r),t.interval===void 0&&(t.interval=o),t.value===void 0&&(t.value=i),t.thresholds=q6(t.thresholds,t.interval),t}function DB(t){let{x:e,y:n}=t;return e=u1(e,t),n=u1(n,t),[e.value,n.value]=ce(e.value,n.value),{x:e,y:n}}function YT(t){if(t==null)return;let{value:e,cumulative:n,domain:r=Ot,thresholds:o}=t,i=s=>{let a=ct(s,e),c;if(re(a)||qB(o)){a=Mt(a,S_,Float64Array);let[u,p]=typeof r=="function"?r(a):r,l=typeof o=="function"&&!hs(o)?o(a,u,p):o;typeof l=="number"&&(l=xp(u,p,l)),hs(l)&&(r===Ot&&(u=l.floor(u),p=l.offset(l.floor(p))),l=l.range(u,l.offset(p))),c=l}else{a=_e(a);let[u,p]=typeof r=="function"?r(a):r,l=typeof o=="function"&&!hs(o)?o(a,u,p):o;if(typeof l=="number")if(r===Ot){let h=Ho(u,p,l);if(isFinite(h))if(h>0){let d=Math.round(u/h),m=Math.round(p/h);d*h<=u||--d,m*h>p||++m;let g=m-d+1;l=new Float64Array(g);for(let y=0;y<g;++y)l[y]=(d+y)*h}else if(h<0){h=-h;let d=Math.round(u*h),m=Math.round(p*h);d/h<=u||--d,m/h>p||++m;let g=m-d+1;l=new Float64Array(g);for(let y=0;y<g;++y)l[y]=(d+y)/h}else l=[u];else l=[u]}else l=Ge(u,p,l);else hs(l)&&(r===Ot&&(u=l.floor(u),p=l.offset(l.floor(p))),l=l.range(u,l.offset(p)));c=l}let f=[];if(c.length===1)f.push([c[0],c[0]]);else for(let u=1;u<c.length;++u)f.push([c[u-1],c[u]]);return f.bin=(n<0?YB:n>0?zB:B6)(f,c,a),f};return i.label=Ke(e),i}function q6(t,e,n=UT){if(t===void 0)return e===void 0?n:vo(e);if(typeof t=="string"){switch(t.toLowerCase()){case"freedman-diaconis":return t0;case"scott":return hl;case"sturges":return ji;case"auto":return UT}return La(t)}return t}function FB(t,e){return B_(t,e,XT)}function XT(t,e,n){return yx(t,e,n,WT)}function WT(t,e,n){return xx(t,e,n,GT)}function GT(t,e){return If(t,e,PB)}function PB(t){switch(`${t}`.toLowerCase()){case"x":return UB;case"x1":return XB;case"x2":return WB;case"y":return jB;case"y1":return GB;case"y2":return VB;case"z":return U_}throw new Error(`invalid bin reduce: ${t}`)}function UT(t,e,n){return Math.min(200,hl(t,e,n))}function qB(t){return GA(t)||Rn(t)&&re(t)}function BB(t,e,n){let r=t?.(n),o=e?.(n);return r&&o?function*(i){let s=r.bin(i);for(let[a,[c,f]]of r.entries()){let u=o.bin(s[a]);for(let[p,[l,h]]of o.entries())yield[u[p],{data:n,x1:c,y1:l,x2:f,y2:h}]}}:r?function*(i){let s=r.bin(i);for(let[a,[c,f]]of r.entries())yield[s[a],{data:n,x1:c,x2:f}]}:function*(i){let s=o.bin(i);for(let[a,[c,f]]of o.entries())yield[s[a],{data:n,y1:c,y2:f}]}}function B6(t,e,n){return e=_e(e),r=>{let o=t.map(()=>[]);for(let i of r)o[Go(e,n[i])-1]?.push(i);return o}}function zB(t,e,n){let r=B6(t,e,n);return o=>{let i=r(o);for(let s=1,a=i.length;s<a;++s){let c=i[s-1],f=i[s];for(let u of c)f.push(u)}return i}}function YB(t,e,n){let r=B6(t,e,n);return o=>{let i=r(o);for(let s=i.length-2;s>=0;--s){let a=i[s+1],c=i[s];for(let f of a)c.push(f)}return i}}function VT(t,e){let n=(+t+ +e)/2;return t instanceof Date?new Date(n):n}var UB={reduceIndex(t,e,{x1:n,x2:r}){return VT(n,r)}},jB={reduceIndex(t,e,{y1:n,y2:r}){return VT(n,r)}},XB={reduceIndex(t,e,{x1:n}){return n}},WB={reduceIndex(t,e,{x2:n}){return n}},GB={reduceIndex(t,e,{y1:n}){return n}},VB={reduceIndex(t,e,{y2:n}){return n}};var HB={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Ga=class extends ft{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s,z:a,curve:c,tension:f}=n;super(e,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0},z:{value:pn(n),optional:!0}},n,HB),this.z=a,this.curve=bh(c,f)}filter(e){return e}render(e,n,r,o,i){let{x1:s,y1:a,x2:c=s,y2:f=a}=r;return rt("svg:g",i).call(gt,this,o,i).call(ht,this,n,0,0).call(u=>u.selectAll().data($x(e,[s,a,c,f],this,r)).enter().append("path").call(lt,this).call(qa,this,r).attr("d",hf().curve(this.curve).defined(p=>p>=0).x0(p=>s[p]).y0(p=>a[p]).x1(p=>c[p]).y1(p=>f[p]))).node()}};function wh(t,e){return e===void 0?Ni(t,{x:Oa,y:us}):new Ga(t,e)}function Ns(t,e){let{y:n=Xt,...r}=Hf(e);return new Ga(t,Ts(As({...r,y1:n,y2:void 0})))}function Ni(t,e){let{x:n=Xt,...r}=Vf(e);return new Ga(t,Is(Es({...r,x1:n,x2:void 0})))}var QB={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},vh=class extends ft{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s,curve:a,tension:c}=n;super(e,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,QB),this.curve=f1(a,c),Pr(this,n)}project(e,n,r){this.curve!==Cs&&super.project(e,n,r)}render(e,n,r,o,i){let{x1:s,y1:a,x2:c=s,y2:f=a}=r,{curve:u}=this;return rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(p=>p.selectAll().data(e).enter().append("path").call(lt,this).attr("d",u===Cs&&i.projection?ZB(i.projection,s,a,c,f):l=>{let h=An(),d=u(h);return d.lineStart(),d.point(s[l],a[l]),d.point(c[l],f[l]),d.lineEnd(),h}).call(_t,this,r).call(Ii,this,r,i)).node()}};function ZB(t,e,n,r,o){let i=Oe(t);return e=_e(e),n=_e(n),r=_e(r),o=_e(o),s=>i({type:"LineString",coordinates:[[e[s],n[s]],[r[s],o[s]]]})}function l1(t,{x:e,x1:n,x2:r,y:o,y1:i,y2:s,...a}={}){return[n,r]=_h(e,n,r),[i,s]=_h(o,i,s),new vh(t,{...a,x1:n,x2:r,y1:i,y2:s})}function _h(t,e,n){if(t===void 0){if(e===void 0){if(n!==void 0)return[n]}else if(n===void 0)return[e]}else{if(e===void 0)return n===void 0?[t]:[t,n];if(n===void 0)return[t,e]}return[e,n]}var KB={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5},Mh=class extends ft{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s,bend:a=0,headAngle:c=60,headLength:f=8,inset:u=0,insetStart:p=u,insetEnd:l=u,sweep:h}=n;super(e,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,KB),this.bend=a===!0?22.5:Math.max(-90,Math.min(90,a)),this.headAngle=+c,this.headLength=+f,this.insetStart=+p,this.insetEnd=+l,this.sweep=JB(h)}render(e,n,r,o,i){let{x1:s,y1:a,x2:c=s,y2:f=a,SW:u}=r,{strokeWidth:p,bend:l,headAngle:h,headLength:d,insetStart:m,insetEnd:g}=this,y=u?w=>u[w]:oe(p===void 0?1:p),x=h*Ff/2,b=d/1.5;return rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(w=>w.selectAll().data(e).enter().append("path").call(lt,this).attr("d",_=>{let v=s[_],A=a[_],E=c[_],T=f[_],C=Math.hypot(E-v,T-A);if(C<=m+g)return null;let S=Math.atan2(T-A,E-v),k=Math.min(b*y(_),C/3),L=this.sweep(v,A,E,T)*l*Ff,M=Math.hypot(C/Math.tan(L),C)/2;if(m||g)if(M<1e5){let K=Math.sign(L),[tt,nt]=tz([v,A],[E,T],M,K);if(m&&([v,A]=HT([tt,nt,M],[v,A,m],-K*Math.sign(m))),g){let[U,et]=HT([tt,nt,M],[E,T,g],K*Math.sign(g));S+=Math.atan2(et-nt,U-tt)-Math.atan2(T-nt,E-tt),E=U,T=et}}else{let K=E-v,tt=T-A,nt=Math.hypot(K,tt);m&&(v+=K/nt*m,A+=tt/nt*m),g&&(E-=K/nt*g,T-=tt/nt*g)}let I=S+L,N=I+x,R=I-x,$=E-k*Math.cos(N),O=T-k*Math.sin(N),D=E-k*Math.cos(R),F=T-k*Math.sin(R),P=M<1e5?`A${M},${M} 0,0,${L>0?1:0} `:"L",W=k?`M${$},${O}L${E},${T}L${D},${F}`:"";return`M${v},${A}${P}${E},${T}${W}`}).call(_t,this,r)).node()}};function JB(t=1){if(typeof t=="number")return oe(Math.sign(t));if(typeof t=="function")return(e,n,r,o)=>Math.sign(t(e,n,r,o));switch(Ie(t,"sweep",["+x","-x","+y","-y"])){case"+x":return(e,n,r)=>dt(e,r);case"-x":return(e,n,r)=>xn(e,r);case"+y":return(e,n,r,o)=>dt(n,o);case"-y":return(e,n,r,o)=>xn(n,o)}}function tz([t,e],[n,r],o,i){let s=n-t,a=r-e,c=Math.hypot(s,a),f=i*Math.sqrt(o*o-c*c/4)/c;return[(t+n)/2-a*f,(e+r)/2+s*f]}function HT([t,e,n],[r,o,i],s){let a=r-t,c=o-e,f=Math.hypot(a,c),u=(a*a+c*c-i*i+n*n)/(2*f),p=s*Math.sqrt(n*n-u*u);return[t+(a*u+c*p)/f,e+(c*u-a*p)/f]}function QT(t,{x:e,x1:n,x2:r,y:o,y1:i,y2:s,...a}={}){return[n,r]=_h(e,n,r),[i,s]=_h(o,i,s),new Mh(t,{...a,x1:n,x2:r,y1:i,y2:s})}var ez={ariaLabel:"bar"},Qf=class extends ft{constructor(e,n,r={},o=ez){super(e,n,r,o),ph(this,r),hh(this,r)}render(e,n,r,o,i){let{rx:s,ry:a,rx1y1:c,rx1y2:f,rx2y1:u,rx2y2:p}=this,l=this._x(n,r,o),h=this._y(n,r,o),d=this._width(n,r,o),m=this._height(n,r,o);return rt("svg:g",i).call(gt,this,o,i).call(this._transform,this,n).call(g=>g.selectAll().data(e).enter().call(c||f||u||p?y=>y.append("path").call(lt,this).call(dh,l,h,ZT(l,d),ZT(h,m),this).call(_t,this,r):y=>y.append("rect").call(lt,this).attr("x",l).attr("width",d).attr("y",h).attr("height",m).call(ot,"rx",s).call(ot,"ry",a).call(_t,this,r))).node()}_x(e,{x:n},{marginLeft:r}){let{insetLeft:o}=this;return n?i=>n[i]+o:r+o}_y(e,{y:n},{marginTop:r}){let{insetTop:o}=this;return n?i=>n[i]+o:r+o}_width({x:e},{x:n},{marginRight:r,marginLeft:o,width:i}){let{insetLeft:s,insetRight:a}=this,c=n&&e?e.bandwidth():i-r-o;return Math.max(0,c-s-a)}_height({y:e},{y:n},{marginTop:r,marginBottom:o,height:i}){let{insetTop:s,insetBottom:a}=this,c=n&&e?e.bandwidth():i-r-o;return Math.max(0,c-s-a)}};function ZT(t,e){return typeof t=="function"&&typeof e=="function"?n=>t(n)+e(n):typeof t=="function"?n=>t(n)+e:typeof e=="function"?n=>t+e(n):t+e}var Va=class extends Qf{constructor(e,n={},r){let{x1:o,x2:i,y:s}=n;super(e,{x1:{value:o,scale:"x"},x2:{value:i,scale:"x"},y:{value:s,scale:"y",type:"band",optional:!0}},n,r)}_transform(e,n,{x:r}){e.call(ht,n,{x:r},0,0)}_x({x:e},{x1:n,x2:r},{marginLeft:o}){let{insetLeft:i}=this;return tr(e)?o+i:s=>Math.min(n[s],r[s])+i}_width({x:e},{x1:n,x2:r},{marginRight:o,marginLeft:i,width:s}){let{insetLeft:a,insetRight:c}=this;return tr(e)?s-o-i-a-c:f=>Math.max(0,Math.abs(r[f]-n[f])-a-c)}},Ha=class extends Qf{constructor(e,n={},r){let{x:o,y1:i,y2:s}=n;super(e,{y1:{value:i,scale:"y"},y2:{value:s,scale:"y"},x:{value:o,scale:"x",type:"band",optional:!0}},n,r)}_transform(e,n,{y:r}){e.call(ht,n,{y:r},0,0)}_y({y:e},{y1:n,y2:r},{marginTop:o}){let{insetTop:i}=this;return tr(e)?o+i:s=>Math.min(n[s],r[s])+i}_height({y:e},{y1:n,y2:r},{marginTop:o,marginBottom:i,height:s}){let{insetTop:a,insetBottom:c}=this;return tr(e)?s-o-i-a-c:f=>Math.max(0,Math.abs(r[f]-n[f])-a-c)}};function ko(t,e={}){return xi(e)||(e={...e,y:Xt,x2:X}),new Va(t,Ts(Pf(As(e))))}function Ro(t,e={}){return xi(e)||(e={...e,x:Xt,y2:X}),new Ha(t,Is(qf(Es(e))))}var nz={ariaLabel:"cell"},Qa=class extends Qf{constructor(e,{x:n,y:r,...o}={}){super(e,{x:{value:n,scale:"x",type:"band",optional:!0},y:{value:r,scale:"y",type:"band",optional:!0}},o,nz)}_transform(e,n){e.call(ht,n,{},0,0)}};function ks(t,{x:e,y:n,...r}={}){return[e,n]=ce(e,n),new Qa(t,{...r,x:e,y:n})}function KT(t,{x:e=Xt,fill:n,stroke:r,...o}={}){return n===void 0&&ne(r)[0]===void 0&&(n=X),new Qa(t,{...o,x:e,fill:n,stroke:r})}function JT(t,{y:e=Xt,fill:n,stroke:r,...o}={}){return n===void 0&&ne(r)[0]===void 0&&(n=X),new Qa(t,{...o,y:e,fill:n,stroke:r})}var rz={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function Sh(t){return t.sort===void 0&&t.reverse===void 0?mx({channel:"-r"},t):t}var Za=class extends ft{constructor(e,n={}){let{x:r,y:o,r:i,rotate:s,symbol:a=di,frameAnchor:c}=n,[f,u]=Pt(s,0),[p,l]=a7(a),[h,d]=Pt(i,p==null?3:4.5);super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},r:{value:h,scale:"r",filter:Nn,optional:!0},rotate:{value:f,optional:!0},symbol:{value:p,scale:"auto",optional:!0}},Sh(n),rz),this.r=d,this.rotate=u,this.symbol=l,this.frameAnchor=_o(c);let{channels:m}=this,{symbol:g}=m;if(g){let{fill:y,stroke:x}=m;g.hint={fill:y?y.value===g.value?"color":"currentColor":this.fill??"currentColor",stroke:x?x.value===g.value?"color":"currentColor":this.stroke??"none"}}}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,r:u,rotate:p,symbol:l}=r,{r:h,rotate:d,symbol:m}=this,[g,y]=ze(this,o),x=m===di,b=u?void 0:h*h*Math.PI;return is(h)&&(e=[]),rt("svg:g",i).call(gt,this,o,i).call(ht,this,{x:c&&s,y:f&&a}).call(w=>w.selectAll().data(e).enter().append(x?"circle":"path").call(lt,this).call(x?_=>{_.attr("cx",c?v=>c[v]:g).attr("cy",f?v=>f[v]:y).attr("r",u?v=>u[v]:h)}:_=>{_.attr("transform",qr`translate(${c?v=>c[v]:g},${f?v=>f[v]:y})${p?v=>` rotate(${p[v]})`:d?` rotate(${d})`:""}`).attr("d",u&&l?v=>{let A=An();return l[v].draw(A,u[v]*u[v]*Math.PI),A}:u?v=>{let A=An();return m.draw(A,u[v]*u[v]*Math.PI),A}:l?v=>{let A=An();return l[v].draw(A,b),A}:(()=>{let v=An();return m.draw(v,b),v})())}).call(_t,this,r)).node()}};function _r(t,{x:e,y:n,...r}={}){return r.frameAnchor===void 0&&([e,n]=ce(e,n)),new Za(t,{...r,x:e,y:n})}function t9(t,{x:e=X,...n}={}){return new Za(t,qx({...n,x:e}))}function e9(t,{y:e=X,...n}={}){return new Za(t,Px({...n,y:e}))}function n9(t,e){return _r(t,{...e,symbol:"circle"})}function r9(t,e){return _r(t,{...e,symbol:"hexagon"})}var oz={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Ka=class extends ft{constructor(e,n={}){let{x:r,y:o,z:i,curve:s,tension:a}=n;super(e,{x:{value:r,scale:"x"},y:{value:o,scale:"y"},z:{value:pn(n),optional:!0}},n,oz),this.z=i,this.curve=f1(s,a),Pr(this,n)}filter(e){return e}project(e,n,r){this.curve!==Cs&&super.project(e,n,r)}render(e,n,r,o,i){let{x:s,y:a}=r,{curve:c}=this;return rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(f=>f.selectAll().data($x(e,[s,a],this,r)).enter().append("path").call(lt,this).call(qa,this,r).call(LE,this,r,i).attr("d",c===Cs&&i.projection?iz(i.projection,s,a):Tp().curve(c).defined(u=>u>=0).x(u=>s[u]).y(u=>a[u]))).node()}};function iz(t,e,n){let r=Oe(t);return e=_e(e),n=_e(n),o=>{let i=[],s=[i];for(let a of o)a===-1?(i=[],s.push(i)):i.push([e[a],n[a]]);return r({type:"MultiLineString",coordinates:s})}}function Ja(t,{x:e,y:n,...r}={}){return[e,n]=ce(e,n),new Ka(t,{...r,x:e,y:n})}function Rs(t,{x:e=X,y:n=Xt,...r}={}){return new Ka(t,Hf({...r,x:e,y:n}))}function Ls(t,{x:e=Xt,y:n=X,...r}={}){return new Ka(t,Vf({...r,x:e,y:n}))}function Y6(t,e){e=sz(e);let{x:n,y:r,color:o,size:i}=e,s=p1(t,n),a=p1(t,r),c=p1(t,o),f=p1(t,i),{fx:u,fy:p,x:{value:l,reduce:h,zero:d,...m},y:{value:g,reduce:y,zero:x,...b},color:{value:w,color:_,reduce:v},size:{value:A,reduce:E},mark:T}=e;if(h===void 0&&(h=y==null&&l==null&&A==null&&g!=null?"count":null),y===void 0&&(y=h==null&&g==null&&A==null&&l!=null?"count":null),E===void 0&&A==null&&v==null&&h==null&&y==null&&(l==null||te(s))&&(g==null||te(a))&&(E="count"),d===void 0&&(d=h1(h)?!0:void 0),x===void 0&&(x=h1(y)?!0:void 0),l==null&&g==null)throw new Error("must specify x or y");if(h!=null&&g==null)throw new Error("reducing x requires y");if(y!=null&&l==null)throw new Error("reducing y requires x");T===void 0&&(T=A!=null||E!=null?"dot":h1(h)||h1(y)||v!=null?"bar":l!=null&&g!=null?te(s)||te(a)||h==null&&y==null&&!Ah(s)&&!Ah(a)?"dot":"line":l!=null||g!=null?"rule":null);let C,S,k;switch(T){case"dot":k=_r,S="stroke";break;case"line":k=s&&a||h!=null||y!=null?x||y!=null||s&&Ah(s)?Ls:d||h!=null||a&&Ah(a)?Rs:Ja:s?Rs:Ls,S="stroke",i9(c)&&(C=null);break;case"area":k=!(x||y!=null)&&(d||h!=null||a&&Ah(a))?Ns:Ni,S="fill",i9(c)&&(C=null);break;case"rule":k=s?er:nr,S="stroke";break;case"bar":k=h!=null?te(a)?o9(h)&&s&&te(s)?ks:ko:jf:y!=null?te(s)?o9(y)&&a&&te(a)?ks:Ro:Xf:v!=null||E!=null?s&&te(s)&&a&&te(a)?ks:s&&te(s)?Ro:a&&te(a)?ko:mh:s&&wi(s)&&!(a&&wi(a))?ko:a&&wi(a)&&!(s&&wi(s))?Ro:ks,S="fill";break;default:throw new Error(`invalid mark: ${T}`)}let L={fx:u,fy:p,x:s??void 0,y:a??void 0,[S]:c??_,z:C,r:f??void 0,tip:!0},M,I={[S]:v??void 0,r:E??void 0};if(h!=null&&y!=null)throw new Error("cannot reduce both x and y");return y!=null?(I.y=y,M=te(s)?ms:Co):h!=null?(I.x=h,M=te(a)?gs:No):(v!=null||E!=null)&&(s&&a?M=te(s)&&te(a)?Jp:te(s)?No:te(a)?Co:Ci:s?M=te(s)?ms:Co:a&&(M=te(a)?gs:No)),(M===Ci||M===Co)&&(L.x={value:s,...m}),(M===Ci||M===No)&&(L.y={value:a,...b}),d===void 0&&(d=s&&!(M===Ci||M===Co)&&(k===ko||k===Ns||k===jf||k===nr)),x===void 0&&(x=a&&!(M===Ci||M===No)&&(k===Ro||k===Ni||k===Xf||k===er)),{fx:u??null,fy:p??null,x:{value:l??null,reduce:h??null,zero:!!d,...m},y:{value:g??null,reduce:y??null,zero:!!x,...b},color:{value:w??null,reduce:v??null,..._!==void 0&&{color:_}},size:{value:A??null,reduce:E??null},mark:T,markImpl:s9[k],markOptions:L,transformImpl:s9[M],transformOptions:I,colorMode:S}}function a9(t,e){let n=Y6(t,e),{fx:r,fy:o,x:{zero:i},y:{zero:s},markOptions:a,transformOptions:c,colorMode:f}=n,u=z6[n.markImpl],p=z6[n.transformImpl],l=r!=null||o!=null?Wf({strokeOpacity:.1}):null,h=[i?er([0]):null,s?nr([0]):null],d=u(t,p?p(c,a):a);return f==="stroke"?Se(l,h,d):Se(l,d,h)}function Ah(t){let e,n;for(let r of t){if(r==null)continue;if(e===void 0){e=r;continue}let o=Math.sign(dt(e,r));if(o){if(n!==void 0&&o!==n)return!1;e=r,n=o}}return!0}function sz({x:t,y:e,color:n,size:r,fx:o,fy:i,mark:s}={}){return Kn(t)||(t=Zf(t)),Kn(e)||(e=Zf(e)),Kn(n)||(n=ds(n)?{color:n}:Zf(n)),Kn(r)||(r=Zf(r)),Kn(o)&&({value:o}=Zf(o)),Kn(i)&&({value:i}=Zf(i)),s!=null&&(s=`${s}`.toLowerCase()),{x:t,y:e,color:n,size:r,fx:o,fy:i,mark:s}}function p1(t,e){let n=ct(t,e.value);return n&&(n.label=Ke(e.value)),n}function Zf(t){return az(t)?{reduce:t}:{value:t}}function h1(t){return/^(?:distinct|count|sum|proportion)$/i.test(t)}function o9(t){return/^(?:first|last|mode)$/i.test(t)}function az(t){if(t==null)return!1;if(typeof t.reduceIndex=="function"||typeof t.reduce=="function"&&Pe(t)||/^p\d{2}$/i.test(t))return!0;switch(`${t}`.toLowerCase()){case"first":case"last":case"count":case"distinct":case"sum":case"proportion":case"proportion-facet":case"deviation":case"min":case"min-index":case"max":case"max-index":case"mean":case"median":case"variance":case"mode":return!0}return!1}function i9(t){return t?new wn(t).size>t.length>>1:!1}var z6={dot:_r,line:Ja,lineX:Rs,lineY:Ls,areaX:Ns,areaY:Ni,ruleX:er,ruleY:nr,barX:ko,barY:Ro,rect:mh,rectX:jf,rectY:Xf,cell:ks,bin:Ci,binX:Co,binY:No,group:Jp,groupX:ms,groupY:gs},s9=Object.fromEntries(Object.entries(z6).map(([t,e])=>[e,t]));function Kf(t,e={}){let{x:n,x1:r,x2:o}=e;n===void 0&&r===void 0&&o===void 0&&(e={...e,x:n=X});let i={};return n!=null&&(i.x=t),r!=null&&(i.x1=t),o!=null&&(i.x2=t),qn(i,e)}function Jf(t,e={}){let{y:n,y1:r,y2:o}=e;n===void 0&&r===void 0&&o===void 0&&(e={...e,y:n=X});let i={};return n!=null&&(i.y=t),r!=null&&(i.y1=t),o!=null&&(i.y2=t),qn(i,e)}function qn(t={},e={}){let n=pn(e),r=Object.entries(t).map(([o,i])=>{let s=fx(o,e);if(s==null)throw new Error(`missing channel: ${o}`);let[a,c]=qe(s);return{key:o,input:s,output:a,setOutput:c,map:cz(i)}});return{...Me(e,(o,i)=>{let s=ct(o,n),a=r.map(({input:f})=>ct(o,f)),c=r.map(({setOutput:f})=>f(new Array(o.length)));for(let f of i)for(let u of s?We(f,p=>s[p]).values():[f])r.forEach(({map:p},l)=>p.mapIndex(u,a[l],c[l]));return{data:o,facets:i}}),...Object.fromEntries(r.map(({key:o,output:i})=>[o,i]))}}function cz(t){if(t==null)throw new Error("missing map");if(typeof t.mapIndex=="function")return t;if(typeof t.map=="function"&&Pe(t))return fz(t);if(typeof t=="function")return U6(Mf(t));switch(`${t}`.toLowerCase()){case"cumsum":return lz;case"rank":return U6((e,n)=>dl(e,r=>n[r]));case"quantile":return U6((e,n)=>uz(e,r=>n[r]))}throw new Error(`invalid map: ${t}`)}function fz(t){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:t.map.bind(t)}}function uz(t,e){let n=Kr(t,e)-1;return dl(t,e).map(r=>r/n)}function U6(t){return{mapIndex(e,n,r){let o=t(e,n);if(o.length!==e.length)throw new Error("map function returned a mismatched length");for(let i=0,s=e.length;i<s;++i)r[e[i]]=o[i]}}}var lz={mapIndex(t,e,n){let r=0;for(let o of t)n[o]=r+=e[o]}};function c9(t={},e){return arguments.length===1&&(e=t),Kf(tu(t),e)}function f9(t={},e){return arguments.length===1&&(e=t),Jf(tu(t),e)}function tu(t={}){typeof t=="number"&&(t={k:t});let{k:e,reduce:n,shift:r,anchor:o,strict:i}=t;if(o===void 0&&r!==void 0&&(o=hz(r),hn(`Warning: the shift option is deprecated; please use anchor "${o}" instead.`)),!((e=Math.floor(e))>0))throw new Error(`invalid k: ${e}`);return dz(n)(e,pz(o,e),i)}function pz(t="middle",e){switch(`${t}`.toLowerCase()){case"middle":return e-1>>1;case"start":return 0;case"end":return e-1}throw new Error(`invalid anchor: ${t}`)}function hz(t){switch(`${t}`.toLowerCase()){case"centered":return"middle";case"leading":return"start";case"trailing":return"end"}throw new Error(`invalid shift: ${t}`)}function dz(t="mean"){if(typeof t=="string"){if(/^p\d{2}$/i.test(t))return d1(_f(t));switch(t.toLowerCase()){case"deviation":return d1(fr);case"max":return m1((e,n)=>It(e,r=>n[r]));case"mean":return mz;case"median":return d1(Rr);case"min":return m1((e,n)=>St(e,r=>n[r]));case"mode":return m1((e,n)=>kc(e,r=>n[r]));case"sum":return u9;case"variance":return d1(Ui);case"difference":return xz;case"ratio":return bz;case"first":return wz;case"last":return vz}}if(typeof t!="function")throw new Error(`invalid reduce: ${t}`);return m1(Mf(t))}function d1(t){return(e,n,r)=>r?{mapIndex(o,i,s){let a=f=>i[f]==null?NaN:+i[f],c=0;for(let f=0;f<e-1;++f)isNaN(a(f))&&++c;for(let f=0,u=o.length-e+1;f<u;++f)isNaN(a(f+e-1))&&++c,s[o[f+n]]=c===0?t(bi(o,f,f+e),a):NaN,isNaN(a(f))&&--c}}:{mapIndex(o,i,s){let a=c=>i[c]==null?NaN:+i[c];for(let c=-n;c<0;++c)s[o[c+n]]=t(bi(o,0,c+e),a);for(let c=0,f=o.length-n;c<f;++c)s[o[c+n]]=t(bi(o,c,c+e),a)}}}function m1(t){return(e,n,r)=>r?{mapIndex(o,i,s){let a=0;for(let c=0;c<e-1;++c)a+=Jt(i[o[c]]);for(let c=0,f=o.length-e+1;c<f;++c)a+=Jt(i[o[c+e-1]]),a===e&&(s[o[c+n]]=t(bi(o,c,c+e),i)),a-=Jt(i[o[c]])}}:{mapIndex(o,i,s){for(let a=-n;a<0;++a)s[o[a+n]]=t(bi(o,0,a+e),i);for(let a=0,c=o.length-n;a<c;++a)s[o[a+n]]=t(bi(o,a,a+e),i)}}}function u9(t,e,n){return n?{mapIndex(r,o,i){let s=0,a=0;for(let c=0;c<t-1;++c){let f=o[r[c]];f===null||isNaN(f)?++s:a+=+f}for(let c=0,f=r.length-t+1;c<f;++c){let u=o[r[c]],p=o[r[c+t-1]];p===null||isNaN(p)?++s:a+=+p,i[r[c+e]]=s===0?a:NaN,u===null||isNaN(u)?--s:a-=+u}}}:{mapIndex(r,o,i){let s=0,a=r.length;for(let c=0,f=Math.min(a,t-e-1);c<f;++c)s+=+o[r[c]]||0;for(let c=-e,f=a-e;c<f;++c)s+=+o[r[c+t-1]]||0,i[r[c+e]]=s,s-=+o[r[c]]||0}}}function mz(t,e,n){if(n){let r=u9(t,e,n);return{mapIndex(o,i,s){r.mapIndex(o,i,s);for(let a=0,c=o.length-t+1;a<c;++a)s[o[a+e]]/=t}}}else return{mapIndex(r,o,i){let s=0,a=0,c=r.length;for(let f=0,u=Math.min(c,t-e-1);f<u;++f){let p=o[r[f]];p!==null&&!isNaN(p=+p)&&(s+=p,++a)}for(let f=-e,u=c-e;f<u;++f){let p=o[r[f+t-1]],l=o[r[f]];p!==null&&!isNaN(p=+p)&&(s+=p,++a),i[r[f+e]]=s/a,l!==null&&!isNaN(l=+l)&&(s-=l,--a)}}}}function gz(t,e,n,r){for(let o=n+r;n<o;++n){let i=t[e[n]];if(Jt(i))return i}}function yz(t,e,n,r){for(let o=n+r-1;o>=n;--o){let i=t[e[o]];if(Jt(i))return i}}function l9(t,e,n,r){for(let o=n+r;n<o;++n){let i=t[e[n]];if(i!==null&&!isNaN(i=+i))return i}}function p9(t,e,n,r){for(let o=n+r-1;o>=n;--o){let i=t[e[o]];if(i!==null&&!isNaN(i=+i))return i}}function xz(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s){let c=o[r[s]],f=o[r[s+t-1]];i[r[s+e]]=c===null||f===null?NaN:f-c}}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=p9(o,r,s,t)-l9(o,r,s,t)}}}function bz(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s){let c=o[r[s]],f=o[r[s+t-1]];i[r[s+e]]=c===null||f===null?NaN:f/c}}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=p9(o,r,s,t)/l9(o,r,s,t)}}}function wz(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s)i[r[s+e]]=o[r[s]]}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=gz(o,r,s,t)}}}function vz(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s)i[r[s+e]]=o[r[s+t-1]]}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=yz(o,r,s,t)}}}var ki={n:20,k:2,color:"currentColor",opacity:.2,strict:!0,anchor:"end"};function h9(t,{x:e=X,y:n,k:r=ki.k,color:o=ki.color,opacity:i=ki.opacity,fill:s=o,fillOpacity:a=i,stroke:c=o,strokeOpacity:f,strokeWidth:u,...p}={}){return Se(Ft(s)?null:Ns(t,qn({x1:Os({k:-r,...p}),x2:Os({k:r,...p})},{x1:e,x2:e,y:n,fill:s,fillOpacity:a,...p})),Ft(c)?null:Rs(t,qn({x:Os(p)},{x:e,y:n,stroke:c,strokeOpacity:f,strokeWidth:u,...p})))}function d9(t,{x:e,y:n=X,k:r=ki.k,color:o=ki.color,opacity:i=ki.opacity,fill:s=o,fillOpacity:a=i,stroke:c=o,strokeOpacity:f,strokeWidth:u,...p}={}){return Se(Ft(s)?null:Ni(t,qn({y1:Os({k:-r,...p}),y2:Os({k:r,...p})},{x:e,y1:n,y2:n,fill:s,fillOpacity:a,...p})),Ft(c)?null:Ls(t,qn({y:Os(p)},{x:e,y:n,stroke:c,strokeOpacity:f,strokeWidth:u,...p})))}function Os({n:t=ki.n,k:e=0,strict:n=ki.strict,anchor:r=ki.anchor}={}){return tu({k:t,reduce:o=>Qo(o)+e*(fr(o)||0),strict:n,anchor:r})}var _z={ariaLabel:"tick",fill:null,stroke:"currentColor"},g1=class extends ft{constructor(e,n,r){super(e,n,r,_z),Pr(this,r)}render(e,n,r,o,i){return rt("svg:g",i).call(gt,this,o,i).call(this._transform,this,n).call(s=>s.selectAll().data(e).enter().append("line").call(lt,this).attr("x1",this._x1(n,r,o)).attr("x2",this._x2(n,r,o)).attr("y1",this._y1(n,r,o)).attr("y2",this._y2(n,r,o)).call(_t,this,r).call(Ii,this,r,i)).node()}},Eh=class extends g1{constructor(e,n={}){let{x:r,y:o,inset:i=0,insetTop:s=i,insetBottom:a=i}=n;super(e,{x:{value:r,scale:"x"},y:{value:o,scale:"y",type:"band",optional:!0}},n),this.insetTop=Rt(s),this.insetBottom=Rt(a)}_transform(e,n,{x:r}){e.call(ht,n,{x:r},ie,0)}_x1(e,{x:n}){return r=>n[r]}_x2(e,{x:n}){return r=>n[r]}_y1({y:e},{y:n},{marginTop:r}){let{insetTop:o}=this;return n&&e?i=>n[i]+o:r+o}_y2({y:e},{y:n},{height:r,marginBottom:o}){let{insetBottom:i}=this;return n&&e?s=>n[s]+e.bandwidth()-i:r-o-i}},Th=class extends g1{constructor(e,n={}){let{x:r,y:o,inset:i=0,insetRight:s=i,insetLeft:a=i}=n;super(e,{y:{value:o,scale:"y"},x:{value:r,scale:"x",type:"band",optional:!0}},n),this.insetRight=Rt(s),this.insetLeft=Rt(a)}_transform(e,n,{y:r}){e.call(ht,n,{y:r},0,ie)}_x1({x:e},{x:n},{marginLeft:r}){let{insetLeft:o}=this;return n&&e?i=>n[i]+o:r+o}_x2({x:e},{x:n},{width:r,marginRight:o}){let{insetRight:i}=this;return n&&e?s=>n[s]+e.bandwidth()-i:r-o-i}_y1(e,{y:n}){return r=>n[r]}_y2(e,{y:n}){return r=>n[r]}};function y1(t,{x:e=X,...n}={}){return new Eh(t,{...n,x:e})}function x1(t,{y:e=X,...n}={}){return new Th(t,{...n,y:e})}function m9(t,{x:e=X,y:n=null,r,fill:o="#ccc",fillOpacity:i,stroke:s="currentColor",strokeOpacity:a,strokeWidth:c=2,sort:f,...u}={}){let p=n!=null?gs:Kp;return Se(nr(t,p({x1:j6,x2:X6},{x:e,y:n,stroke:s,strokeOpacity:a,...u})),ko(t,p({x1:"p25",x2:"p75"},{x:e,y:n,fill:o,fillOpacity:i,...u})),y1(t,p({x:"p50"},{x:e,y:n,stroke:s,strokeOpacity:a,strokeWidth:c,sort:f,...u})),_r(t,qn({x:y9},{x:e,y:n,z:n,r,stroke:s,strokeOpacity:a,...u})))}function g9(t,{y:e=X,x:n=null,r,fill:o="#ccc",fillOpacity:i,stroke:s="currentColor",strokeOpacity:a,strokeWidth:c=2,sort:f,...u}={}){let p=n!=null?ms:Kp;return Se(er(t,p({y1:j6,y2:X6},{x:n,y:e,stroke:s,strokeOpacity:a,...u})),Ro(t,p({y1:"p25",y2:"p75"},{x:n,y:e,fill:o,fillOpacity:i,...u})),x1(t,p({y:"p50"},{x:n,y:e,stroke:s,strokeOpacity:a,strokeWidth:c,sort:f,...u})),_r(t,qn({y:y9},{x:n,y:e,z:n,r,stroke:s,strokeOpacity:a,...u})))}function y9(t){let e=j6(t),n=X6(t);return t.map(r=>r<e||r>n?r:NaN)}function j6(t){let e=x9(t)*2.5-b9(t)*1.5;return St(t,n=>n>=e?n:NaN)}function X6(t){let e=b9(t)*2.5-x9(t)*1.5;return It(t,n=>n<=e?n:NaN)}function x9(t){return vn(t,.25)}function b9(t){return vn(t,.75)}var Mz={ariaLabel:"raster",stroke:null,pixelSize:1};function eu(t,e){let n=+t;if(isNaN(n))throw new Error(`invalid ${e}: ${t}`);return n}function w9(t,e){let n=Math.floor(t);if(isNaN(n))throw new Error(`invalid ${e}: ${t}`);return n}var Ch=class extends ft{constructor(e,n,r={},o){let{width:i,height:s,x:a,y:c,x1:f=a==null?0:void 0,y1:u=c==null?0:void 0,x2:p=a==null?i:void 0,y2:l=c==null?s:void 0,pixelSize:h=o.pixelSize,blur:d=0,interpolate:m}=r;if(i!=null&&(i=w9(i,"width")),s!=null&&(s=w9(s,"height")),f!=null&&(f=eu(f,"x1")),u!=null&&(u=eu(u,"y1")),p!=null&&(p=eu(p,"x2")),l!=null&&(l=eu(l,"y2")),a==null&&(f==null||p==null))throw new Error("missing x");if(c==null&&(u==null||l==null))throw new Error("missing y");e!=null&&i!=null&&s!=null&&(a===void 0&&f!=null&&p!=null&&(a=kz(f,p,i,s)),c===void 0&&u!=null&&l!=null&&(c=Rz(u,l,i,s))),super(e,{x:{value:a,scale:"x",optional:!0},y:{value:c,scale:"y",optional:!0},x1:{value:f==null?null:[f],scale:"x",optional:!0,filter:null},y1:{value:u==null?null:[u],scale:"y",optional:!0,filter:null},x2:{value:p==null?null:[p],scale:"x",optional:!0,filter:null},y2:{value:l==null?null:[l],scale:"y",optional:!0,filter:null},...n},r,o),this.width=i,this.height=s,this.pixelSize=eu(h,"pixelSize"),this.blur=eu(d,"blur"),this.interpolate=a==null||c==null?null:Sz(m)}},Nh=class extends Ch{constructor(e,n={}){let{imageRendering:r}=n;if(e==null){let{fill:o,fillOpacity:i}=n;Pt(i)[0]!==void 0&&(n=b1("fillOpacity",n)),ne(o)[0]!==void 0&&(n=b1("fill",n))}super(e,void 0,n,Mz),this.imageRendering=Vt(r,"auto")}scale(e,{color:n,...r},o){return super.scale(e,r,o)}render(e,n,r,o,i){let s=n[r.channels.fill?.scale]??(I=>I),{x:a,y:c}=r,{document:f}=i,[u,p,l,h]=_9(r,o,i),d=l-u,m=h-p,{pixelSize:g,width:y=Math.round(Math.abs(d)/g),height:x=Math.round(Math.abs(m)/g)}=this,b=y*x,{fill:w,fillOpacity:_}=r,v=0;if(this.interpolate){let I=y/d,N=x/m,R=Mt(a,O=>(O-u)*I,Float64Array),$=Mt(c,O=>(O-p)*N,Float64Array);w&&(w=this.interpolate(e,y,x,R,$,w)),_&&(_=this.interpolate(e,y,x,R,$,_))}else this.data==null&&e&&(v=e.fi*b);let A=f.createElement("canvas");A.width=y,A.height=x;let E=A.getContext("2d"),T=E.createImageData(y,x),C=T.data,{r:S,g:k,b:L}=Ee(this.fill)??{r:0,g:0,b:0},M=(this.fillOpacity??1)*255;for(let I=0;I<b;++I){let N=I<<2;if(w){let R=s(w[I+v]);if(R==null){C[N+3]=0;continue}({r:S,g:k,b:L}=Ee(R))}_&&(M=_[I+v]*255),C[N+0]=S,C[N+1]=k,C[N+2]=L,C[N+3]=M}return this.blur>0&&h2(T,this.blur),E.putImageData(T,0,0),rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(I=>I.append("image").attr("transform",`translate(${u},${p}) scale(${Math.sign(l-u)},${Math.sign(h-p)})`).attr("width",Math.abs(d)).attr("height",Math.abs(m)).attr("preserveAspectRatio","none").call(ot,"image-rendering",this.imageRendering).call(lt,this).attr("xlink:href",A.toDataURL())).node()}};function W6(t,e,n){arguments.length<3&&(n=e,e=null);let{x:r,y:o,[t]:i,...s}=n;return r===void 0&&o===void 0&&HA(e)&&(r=Oa,o=us,i===void 0&&(i=XA)),[e,{...s,x:r,y:o,[t]:i}]}function v9(){let[t,e]=W6("fill",...arguments);return new Nh(t,t==null||e.fill!==void 0||e.fillOpacity!==void 0?e:{...e,fill:X})}function _9({x1:t,y1:e,x2:n,y2:r},o,{projection:i}){let{width:s,height:a,marginTop:c,marginRight:f,marginBottom:u,marginLeft:p}=o;return[t&&i==null?t[0]:p,e&&i==null?e[0]:c,n&&i==null?n[0]:s-f,r&&i==null?r[0]:a-u]}function G6({x1:t,y1:e,x2:n,y2:r},o,i,s){let a={};return t&&(a.x1=t),e&&(a.y1=e),n&&(a.x2=n),r&&(a.y2=r),_9(Nf(a,o),i,s)}function b1(t,e={}){let{[t]:n}=e;if(typeof n!="function")throw new Error(`invalid ${t}: not a function`);return Gt({...e,[t]:void 0},function(r,o,i,s,a,c){let{x:f,y:u}=s;if(!f)throw new Error("missing scale: x");if(!u)throw new Error("missing scale: y");let[p,l,h,d]=G6(i,s,a,c),m=h-p,g=d-l,{pixelSize:y}=this,{width:x=Math.round(Math.abs(m)/y),height:b=Math.round(Math.abs(g)/y)}=e,w=new Array(x*b*(o?o.length:1)),_=m/x,v=g/b,A=0;for(let E of o??[void 0])for(let T=.5;T<b;++T)for(let C=.5;C<x;++C,++A)w[A]=n(f.invert(p+C*_),u.invert(l+T*v),E);return{data:w,facets:o,channels:{[t]:{value:w,scale:"auto"}}}})}function Sz(t){if(typeof t=="function")return t;if(t==null)return w1;switch(`${t}`.toLowerCase()){case"none":return w1;case"nearest":return Rh;case"barycentric":return kh();case"random-walk":return Lh()}throw new Error(`invalid interpolate: ${t}`)}function w1(t,e,n,r,o,i){let s=new Array(e*n);for(let a of t)r[a]<0||r[a]>=e||o[a]<0||o[a]>=n||(s[Math.floor(o[a])*e+Math.floor(r[a])]=i[a]);return s}function kh({random:t=va(42)}={}){return(e,n,r,o,i,s)=>{let{points:a,triangles:c,hull:f}=pr.from(e,h=>o[h],h=>i[h]),u=new s.constructor(n*r).fill(NaN),p=new Uint8Array(n*r),l=Nz(s,t);for(let h=0;h<c.length;h+=3){let d=c[h],m=c[h+1],g=c[h+2],y=a[2*d],x=a[2*m],b=a[2*g],w=a[2*d+1],_=a[2*m+1],v=a[2*g+1],A=Math.min(y,x,b),E=Math.max(y,x,b),T=Math.min(w,_,v),C=Math.max(w,_,v),S=(_-v)*(y-b)+(w-v)*(b-x);if(!S)continue;let k=s[e[d]],L=s[e[m]],M=s[e[g]];for(let I=Math.floor(A);I<E;++I)for(let N=Math.floor(T);N<C;++N){if(I<0||I>=n||N<0||N>=r)continue;let R=I+.5,$=N+.5,O=Math.sign(S),D=(_-v)*(R-b)+($-v)*(b-x);if(D*O<0)continue;let F=(v-w)*(R-b)+($-v)*(y-b);if(F*O<0)continue;let P=S-(D+F);if(P*O<0)continue;let W=I+n*N;u[W]=l(k,D/S,L,F/S,M,P/S,I,N),p[W]=1}}return Az(u,p,o,i,s,n,r,f,e,l),u}}function Az(t,e,n,r,o,i,s,a,c,f){n=Float64Array.from(a,h=>n[c[h]]),r=Float64Array.from(a,h=>r[c[h]]),o=Array.from(a,h=>o[c[h]]);let u=n.length,p=Array.from({length:u},(h,d)=>Tz(d,n,r)),l=0;for(let h=0;h<s;++h){let d=h+.5;for(let m=0;m<i;++m){let g=m+i*h;if(!e[g]){let y=m+.5;for(let x=0;x<u;++x){let b=(u+l+(x%2?(x+1)/2:-x/2))%u;if(p[b](y,d)){let w=Ez(n.at(b-1),r.at(b-1),n[b],r[b],y,d);t[g]=f(o.at(b-1),w,o[b],1-w,o[b],0,m,h),l=b;break}}}}}}function Ez(t,e,n,r,o,i){let s=n-t,a=r-e,c=s*(n-o)+a*(r-i),f=s*(o-t)+a*(i-e);return c>0&&f>0?c/(c+f):+(c>f)}function Ih(t,e,n,r){return t*r-n*e}function Tz(t,e,n){let r=e.length,o=e.at(t-2),i=n.at(t-2),s=e.at(t-1),a=n.at(t-1),c=e[t],f=n[t],u=e.at(t+1-r),p=n.at(t+1-r),l=s-c,h=a-f,d=o-s,m=i-a,g=c-u,y=f-p,x=Math.hypot(l,h),b=Math.hypot(d,m),w=Math.hypot(g,y);return(_,v)=>{let A=_-s,E=v-a,T=_-c,C=v-f;return Ih(A,E,T,C)>-1e-6&&Ih(A,E,l,h)*b-Ih(A,E,d,m)*x>-1e-6&&Ih(T,C,g,y)*x-Ih(T,C,l,h)*w<=0}}function Rh(t,e,n,r,o,i){let s=new i.constructor(e*n),a=pr.from(t,u=>r[u],u=>o[u]),c,f;for(let u=.5,p=0;u<n;++u){f=c;for(let l=.5;l<e;++l,++p)f=a.find(l,u,f),l===.5&&(c=f),s[p]=i[t[f]]}return s}function Lh({random:t=va(42),minDistance:e=.5,maxSteps:n=2}={}){return(r,o,i,s,a,c)=>{let f=new c.constructor(o*i),u=pr.from(r,d=>s[d],d=>a[d]),p,l,h;for(let d=.5,m=0;d<i;++d){l=p;for(let g=.5;g<o;++g,++m){let y=g,x=d;h=l=u.find(y,x,l),g===.5&&(p=l);let b,w=0;for(;(b=Math.hypot(s[r[h]]-y,a[r[h]]-x))>e&&w<n;){let _=t(g,d,w)*2*Math.PI;y+=Math.cos(_)*b,x+=Math.sin(_)*b,h=u.find(y,x,h),++w}f[m]=c[r[h]]}}return f}}function Iz(t,e,n,r,o,i){return e*t+r*n+i*o}function Cz(t){return(e,n,r,o,i,s,a,c)=>{let f=t(a,c);return f<n?e:f<n+o?r:i}}function Nz(t,e){return wi(t)||re(t)?Iz:Cz(e)}function kz(t,e,n){return{transform(r){let o=r.length,i=new Float64Array(o),s=(e-t)/n,a=t+s/2;for(let c=0;c<o;++c)i[c]=c%n*s+a;return i}}}function Rz(t,e,n,r){return{transform(o){let i=o.length,s=new Float64Array(i),a=(e-t)/r,c=t+a/2;for(let f=0;f<i;++f)s[f]=Math.floor(f/n)%r*a+c;return s}}}var M9={ariaLabel:"contour",fill:"none",stroke:"currentColor",strokeMiterlimit:1,pixelSize:2},Oh=class extends Ch{constructor(e,{smooth:n=!0,value:r,...o}={}){let i=Ox({},o,M9);if(r===void 0){for(let a in i)if(i[a].value!=null){if(r!==void 0)throw new Error("ambiguous contour value");r=o[a],o[a]="value"}}if(r!=null){let a={transform:c=>c.map(f=>f.value),label:Ke(r)};for(let c in i)o[c]==="value"&&(o[c]=a)}if(e==null){if(r==null)throw new Error("missing contour value");o=b1("value",{value:r,...o}),r=null}else{let{interpolate:a}=o;r===void 0&&(r=X),a===void 0&&(o.interpolate="nearest")}super(e,{value:{value:r,optional:!0}},Lz(o),M9);let s={geometry:{value:X}};for(let a in this.channels){let c=this.channels[a],{scale:f}=c;f==="x"||f==="y"||a==="value"||(s[a]=c,delete this.channels[a])}this.contourChannels=s,this.smooth=!!n}filter(e,{x:n,y:r,value:o,...i},s){return super.filter(e,i,s)}render(e,n,r,o,i){let{geometry:s}=r,a=Oe();return rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(c=>{c.selectAll().data(e).enter().append("path").call(lt,this).attr("d",f=>a(s[f])).call(_t,this,r)}).node()}};function Lz({thresholds:t,interval:e,...n}){return t=q6(t,e,ji),Gt(n,function(r,o,i,s,a,c){let[f,u,p,l]=G6(i,s,a,c),h=p-f,d=l-u,{pixelSize:m,width:g=Math.round(Math.abs(h)/m),height:y=Math.round(Math.abs(d)/m)}=this,x=g/h,b=y/d,w=i.value.value,_=[];if(this.interpolate){let{x:C,y:S}=Eo(i,s,c),k=Mt(C,N=>(N-f)*x,Float64Array),L=Mt(S,N=>(N-u)*b,Float64Array),M=[i.x,i.y,i.value],I=[k,L,w];for(let N of o){let R=this.filter(N,M,I);_.push(this.interpolate(R,g,y,k,L,w))}}else if(o){let C=g*y,S=o.length;for(let k=0;k<S;++k)_.push(w.slice(k*C,k*C+C))}else _.push(w);if(this.blur>0)for(let C of _)fl({data:C,width:g,height:y},this.blur);let v=Oz(t,w,...$z(_));if(v===null)throw new Error(`unsupported thresholds: ${t}`);let{contour:A}=Zi().size([g,y]).smooth(this.smooth),E=[],T=[];for(let C of _)T.push(le(E.length,E.push(...Mt(v,S=>A(C,S)))));for(let{coordinates:C}of E)for(let S of C)for(let k of S)for(let L of k)L[0]=L[0]/x+f,L[1]=L[1]/b+u;return{data:E,facets:T,channels:vx(this.contourChannels,E)}})}function Oz(t,e,n,r){if(typeof t?.range=="function")return t.range(t.floor(n),r);if(typeof t=="function"&&(t=t(e,n,r)),typeof t!="number")return Zn(t);let o=Ge(...Cc(n,r,t),t);for(;o[o.length-1]>=r;)o.pop();for(;o[1]<n;)o.shift();return o}function A9(){return new Oh(...W6("value",...arguments))}function $z(t){return[St(t,e=>St(e,S9)),It(t,e=>It(e,S9))]}function S9(t){return isFinite(t)?t:NaN}function I9(t,e){return V6(_s,t,e)}function C9(t,e={}){return V6(Ms,t,e)}function N9(t,e={}){return V6(Ti,t,e)}function V6(t,e,n={}){let{x:r,y:o,maxRadius:i}=n,s=t({px:r,py:o,maxRadius:i}),a=[];r!=null&&a.push(er(e,E9("x",{...s,inset:-6},n))),o!=null&&a.push(nr(e,E9("y",{...s,inset:-6},n))),r!=null&&a.push(Io(e,T9("x",{...s,dy:9,frameAnchor:"bottom",lineAnchor:"top"},n))),o!=null&&a.push(Io(e,T9("y",{...s,dx:-9,frameAnchor:"left",textAnchor:"end"},n)));for(let c of a)c.ariaLabel=`crosshair ${c.ariaLabel}`;return Se(...a)}function k9(t,{channels:e,...n},{facet:r,facetAnchor:o,fx:i,fy:s,[t]:a,channels:c,transform:f,initializer:u}){return{...n,facet:r,facetAnchor:o,fx:i,fy:s,[t]:a,channels:{...e,...c},transform:f,initializer:Dz(t,u)}}function Dz(t,e){return e==null?e:function(n,r,{x:o,y:i,px:s,py:a,...c},...f){let{channels:{x:u,y:p,...l}={},...h}=e.call(this,n,r,{...c,x:s,y:a},...f);return{channels:{...l,...u&&{px:u,...t==="x"&&{x:u}},...p&&{py:p,...t==="y"&&{y:p}}},...h}}}function E9(t,e,n){let{color:r="currentColor",opacity:o=.2,ruleStroke:i=r,ruleStrokeOpacity:s=o,ruleStrokeWidth:a}=n;return{...k9(t,e,n),stroke:i,strokeOpacity:s,strokeWidth:a}}function T9(t,e,n){let{color:r="currentColor",textFill:o=r,textFillOpacity:i,textStroke:s="var(--plot-background)",textStrokeOpacity:a,textStrokeWidth:c=5}=n;return{...k9(t,e,Fz(t,n)),fill:o,fillOpacity:i,stroke:s,strokeOpacity:a,strokeWidth:c}}function Fz(t,e){return Gt(e,(n,r,o)=>({channels:{text:{value:eh(o,t)?.value}}}))}var Pz={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},qz={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},Bz={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},zz={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Yz={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},H6=class extends ft{constructor(e,n={}){let{x:r,y:o,z:i,curve:s,tension:a}=n;super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},z:{value:i,optional:!0}},n,Pz),this.curve=bh(s,a),Pr(this,n)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,z:u}=r,{curve:p}=this,[l,h]=ze(this,o),d=c?x=>c[x]:oe(l),m=f?x=>f[x]:oe(h),g=this;function y(x){let b=-1,w=[],_={};for(let M in r)_[M]=[];let v=[],A=[],E=[],T=[];function C(M,I){M=x[M],I=x[I],w.push(++b),v[b]=d(M),E[b]=m(M),A[b]=d(I),T[b]=m(I);for(let N in r)_[N].push(r[N][I])}let{halfedges:S,hull:k,triangles:L}=pr.from(x,d,m);for(let M=0;M<S.length;++M){let I=S[M];I>M&&C(L[M],L[I])}for(let M=0;M<k.length;++M)C(k[M],k[(M+1)%k.length]);At(this).selectAll().data(w).enter().append("path").call(lt,g).attr("d",M=>{let I=An(),N=p(I);return N.lineStart(),N.point(v[M],E[M]),N.point(A[M],T[M]),N.lineEnd(),I}).call(_t,g,_).call(Ii,g,_,i)}return rt("svg:g",i).call(gt,this,o,i).call(ht,this,{x:c&&s,y:f&&a}).call(u?x=>x.selectAll().data(We(e,b=>u[b]).values()).enter().append("g").each(y):x=>x.datum(e).each(y)).node()}},$h=class extends ft{constructor(e,n={},r,o=({z:i})=>i){let{x:i,y:s}=n;super(e,{x:{value:i,scale:"x",optional:!0},y:{value:s,scale:"y",optional:!0},z:{value:o(n),optional:!0}},n,r)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,z:u}=r,[p,l]=ze(this,o),h=c?y=>c[y]:oe(p),d=f?y=>f[y]:oe(l),m=this;function g(y){let x=pr.from(y,h,d);At(this).append("path").datum(y[0]).call(lt,m).attr("d",m._render(x,o)).call(_t,m,r)}return rt("svg:g",i).call(gt,this,o,i).call(ht,this,{x:c&&s,y:f&&a}).call(u?y=>y.selectAll().data(We(e,x=>u[x]).values()).enter().append("g").each(g):y=>y.datum(e).each(g)).node()}},Q6=class extends $h{constructor(e,n={}){super(e,n,qz),this.fill="none"}_render(e){return e.render()}},Z6=class extends $h{constructor(e,n={}){super(e,n,Bz,pn)}_render(e){return e.renderHull()}},K6=class extends ft{constructor(e,n={}){let{x:r,y:o,z:i}=n;super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},z:{value:i,optional:!0}},Gt(n,function(s,a,c,f,u,p){let{x:l,y:h,z:d}=c;({x:l,y:h}=Eo(c,f,p)),d=d?.value;let m=new Array((l??h).length).fill(null),[g,y]=ze(this,u),x=l?w=>l[w]:oe(g),b=h?w=>h[w]:oe(y);for(let w of a){l&&(w=w.filter(_=>Jt(x(_)))),h&&(w=w.filter(_=>Jt(b(_))));for(let[,_]of Mo(w,d)){let v=pr.from(_,x,b),A=R9(v,u);for(let E=0,T=_.length;E<T;++E)m[_[E]]=A.renderCell(E)}}return{data:s,facets:a,channels:{cells:{value:m}}}}),zz)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,cells:u}=r;return rt("svg:g",i).call(gt,this,o,i).call(ht,this,{x:c&&s,y:f&&a}).call(p=>{p.selectAll().data(e).enter().append("path").call(lt,this).attr("d",l=>u[l]).call(_t,this,r)}).node()}},J6=class extends $h{constructor(e,n){super(e,n,Yz),this.fill="none"}_render(e,n){return R9(e,n).render()}};function R9(t,e){let{width:n,height:r,marginTop:o,marginRight:i,marginBottom:s,marginLeft:a}=e;return t.voronoi([a,o,n-i,r-s])}function Dh(t,e,{x:n,y:r,...o}={}){return[n,r]=ce(n,r),new t(e,{...o,x:n,y:r})}function L9(t,e){return Dh(H6,t,e)}function O9(t,e){return Dh(Q6,t,e)}function $9(t,e){return Dh(Z6,t,e)}function D9(t,{x:e,y:n,initializer:r,...o}={}){return Dh(K6,t,{...Me({...o,x:e,y:n},t1),initializer:r})}function F9(t,e){return Dh(J6,t,e)}var Uz={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Fh=class extends ft{constructor(e,{x:n,y:r,z:o,weight:i,fill:s,stroke:a,...c}={}){let f=P9(s)&&(s="currentColor",!0),u=P9(a)&&(a="currentColor",!0);super(e,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:pn({z:o,fill:s,stroke:a}),optional:!0},weight:{value:i,optional:!0}},Xz({...c,fill:s,stroke:a},f,u),Uz),f&&(this.fill=void 0),u&&(this.stroke=void 0),this.z=o}filter(e){return e}render(e,n,r,o,i){let{contours:s}=r,a=Oe();return rt("svg:g",i).call(gt,this,o,i).call(ht,this,{}).call(c=>c.selectAll().data(e).enter().append("path").call(lt,this).call(_t,this,r).attr("d",f=>a(s[f]))).node()}};function q9(t,{x:e,y:n,...r}={}){return[e,n]=ce(e,n),new Fh(t,{...r,x:e,y:n})}var jz=new Set(["x","y","z","weight"]);function Xz(t,e,n){let{bandwidth:o,thresholds:i}=t;return o=o===void 0?20:+o,i=i===void 0?20:typeof i?.[Symbol.iterator]=="function"?_e(i):+i,Gt(t,function(s,a,c,f,u,p){let l=c.weight?_e(c.weight.value):null,h=c.z?.value,{z:d}=this,[m,g]=ze(this,u),{width:y,height:x}=u,{x:b,y:w}=Eo(c,f,p),_=Object.fromEntries(Object.entries(c).filter(([L])=>!jz.has(L)).map(([L,M])=>[L,{...M,value:[]}])),v=e&&[],A=n&&[],E=ew().x(b?L=>b[L]:m).y(w?L=>w[L]:g).weight(l?L=>l[L]:1).size([y,x]).bandwidth(o),T=[];for(let L of a){let M=[];T.push(M);for(let I of h?sh(L,h,d):[L]){let N=E.contours(I);M.push([I,N])}}let C=i;if(!(C instanceof Gp)){let L=0;for(let M of T)for(let[,I]of M){let N=I.max;N>L&&(L=N)}C=Float64Array.from({length:i-1},(M,I)=>L*100*(I+1)/i)}let S=[],k=[];for(let L of T){let M=[];S.push(M);for(let[I,N]of L)for(let R of C){M.push(k.length),k.push(N(R/100)),v&&v.push(R),A&&A.push(R);for(let $ in _)_[$].value.push(c[$].value[I[0]])}}return v&&v.push(0),A&&A.push(0),{data:s,facets:S,channels:{..._,...v&&{fill:{value:v,scale:"color"}},...A&&{stroke:{value:A,scale:"color"}},contours:{value:k}}}})}function P9(t){return/^density$/i.test(t)}function Y9(t,e){return j9("x",t,e)}function U9(t,e){return j9("y",t,e)}function j9(t,e,{x1:n,x2:r,y1:o,y2:i,x:s=n===void 0&&r===void 0?t==="y"?Xt:X:void 0,y:a=o===void 0&&i===void 0?t==="x"?Xt:X:void 0,fill:c,positiveFill:f="#3ca951",negativeFill:u="#4269d0",fillOpacity:p=1,positiveFillOpacity:l=p,negativeFillOpacity:h=p,stroke:d,strokeOpacity:m,z:g=ne(d)[0],clip:y,tip:x,render:b,...w}={}){return[n,r]=B9(s,n,r),[o,i]=B9(a,o,i),n===r&&o===i&&(t==="y"?o=Ri(0):n=Ri(0)),{tip:x}=Fr({tip:x},t==="y"?"x":"y"),Se(Ft(f)?null:Object.assign(wh(e,{x1:n,x2:r,y1:o,y2:i,z:g,fill:f,fillOpacity:l,render:Ei(b,z9(t,!0)),clip:y,...w}),{ariaLabel:"positive difference"}),Ft(u)?null:Object.assign(wh(e,{x1:n,x2:r,y1:o,y2:i,z:g,fill:u,fillOpacity:h,render:Ei(b,z9(t,!1)),clip:y,...w}),{ariaLabel:"negative difference"}),Ja(e,{x:r,y:i,z:g,stroke:d,strokeOpacity:m,tip:x,clip:!0,...w}))}function B9(t,e,n){return e===void 0&&n===void 0?e=n=Ri(t):e===void 0?(n=Ri(n),e=t===void 0?n:Ri(t)):n===void 0?(e=Ri(e),n=t===void 0?e:Ri(t)):(e=Ri(e),n=Ri(n)),[e,n]}function Ri(t){let e,{value:n,label:r=Ke(n)}=wr(t);return{transform:o=>e||(e=ct(o,n)),label:r}}function z9(t,e){let n=t==="x"?"y":"x",r=`${n}1`,o=`${n}2`,i=`${t}1`,s=`${t}2`;return(a,c,f,u,p,l)=>{let{[r]:h,[o]:d}=f,m=new Float32Array(h.length),g=new Float32Array(d.length),y=u[t==="y"?"height":"width"];(e===Ax(c[t])<0?m:g).fill(y);let x=l(a,c,{...f,[o]:h,[s]:g},u,p),b=l(a,c,{...f,[r]:d,[i]:m},u,p),w=x.querySelector("g")??x,_=b.querySelector("g")??b;for(let v=0;w.firstChild;v+=2){let A=d6(),E=rt("svg:clipPath",p).attr("id",A).node();E.appendChild(w.firstChild),_.childNodes[v].setAttribute("clip-path",`url(#${A})`),_.insertBefore(E,_.childNodes[v])}return b}}function v1({geometry:t=X,...e}={}){let n=ws(r=>ct(r,t));return Gt({...e,x:null,y:null,geometry:{transform:n}},(r,o,i,s,a,{projection:c})=>{let f=n(r),u=f.length,p=new Float64Array(u),l=new Float64Array(u),h=Oe(c);for(let d=0;d<u;++d)[p[d],l[d]]=h.centroid(f[d]);return{data:r,facets:o,channels:{x:{value:p,scale:c==null?"x":null,source:null},y:{value:l,scale:c==null?"y":null,source:null}}}})}function X9({geometry:t=X,...e}={}){let n=ws(o=>ct(o,t)),r=ws(o=>ct(n(o),yw));return{...e,x:{transform:o=>Float64Array.from(r(o),([i])=>i)},y:{transform:o=>Float64Array.from(r(o),([,i])=>i)},geometry:{transform:n}}}var Wz={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Ph=class extends ft{constructor(e,n={}){let[r,o]=Pt(n.r,3);super(e,{x:{value:n.tip?n.x:null,scale:"x",optional:!0},y:{value:n.tip?n.y:null,scale:"y",optional:!0},r:{value:r,scale:"r",filter:Nn,optional:!0},geometry:{value:n.geometry,scale:"projection"}},Sh(n),Wz),this.r=o}render(e,n,r,o,i){let{geometry:s,r:a}=r,c=Oe(i.projection??Gz(n)),{r:f}=this;return is(f)?e=[]:f!==void 0&&c.pointRadius(f),rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(u=>{u.selectAll().data(e).enter().append("path").call(lt,this).attr("d",a?p=>c.pointRadius(a[p])(s[p]):p=>c(s[p])).call(_t,this,r)}).node()}};function Gz({x:t,y:e}){if(t||e)return t??=n=>n,e??=n=>n,ba({point(n,r){this.stream.point(t(n),e(r))}})}function _1(t,e={}){return e.tip&&e.x===void 0&&e.y===void 0?e=v1(e):e.geometry===void 0&&(e={...e,geometry:X}),new Ph(t,e)}function W9({strokeWidth:t=1.5,...e}={}){return _1({type:"Sphere"},{strokeWidth:t,...e})}function G9({strokeOpacity:t=.1,...e}={}){return _1(Mw(),{strokeOpacity:t,...e})}var nu=.5,ru=0;function V9(t={fill:"count"},{binWidth:e,...n}={}){let{z:r}=n;return e=e===void 0?20:Rt(e),t=z_(t,n),So(t,"fill")&&(n.channels={...n.channels,fill:{value:[]}}),n.symbol===void 0&&(n.symbol="hexagon"),n.r===void 0&&!So(t,"r")&&(n.r=e/2),Gt(n,(o,i,s,a,c,f)=>{let{x:u,y:p,z:l,fill:h,stroke:d,symbol:m}=s;if(u===void 0)throw new Error("missing channel: x");if(p===void 0)throw new Error("missing channel: y");({x:u,y:p}=Eo(s,a,f)),l=l?l.value:ct(o,r),h=h?.value,d=d?.value,m=m?.value;let g=th(t,{z:l,fill:h,stroke:d,symbol:m}),y=l&&[],x=h&&[],b=d&&[],w=m&&[],_=[],v=[],A=[],E=-1;for(let k of t)k.initialize(o);for(let k of i){let L=[];for(let M of t)M.scope("facet",k);for(let[M,I]of Mo(k,g))for(let{index:N,extent:R}of Vz(o,I,u,p,e)){L.push(++E),v.push(R.x),A.push(R.y),l&&y.push(g===l?M:l[N[0]]),h&&x.push(g===h?M:h[N[0]]),d&&b.push(g===d?M:d[N[0]]),m&&w.push(g===m?M:m[N[0]]);for(let $ of t)$.reduce(N,R)}_.push(L)}let T=s.x.scale,C=s.y.scale,S={x:{value:v,source:a[T]?{value:Mt(v,a[T].invert),scale:T}:null},y:{value:A,source:a[C]?{value:Mt(A,a[C].invert),scale:C}:null},...l&&{z:{value:y}},...h&&{fill:{value:x,scale:"auto"}},...d&&{stroke:{value:b,scale:"auto"}},...m&&{symbol:{value:w,scale:"auto"}},...Object.fromEntries(t.map(({name:k,output:L})=>[k,{scale:"auto",label:L.label,radius:k==="r"?e/2:void 0,value:L.transform()}]))};return{data:o,facets:_,channels:S}})}function Vz(t,e,n,r,o){let i=o*(1.5/k_),s=new Map;for(let a of e){let c=n[a],f=r[a];if(isNaN(c)||isNaN(f))continue;let u=Math.round(f=(f-ru)/i),p=Math.round(c=(c-nu)/o-(u&1)/2),l=f-u;if(Math.abs(l)*3>1){let m=c-p,g=p+(c<p?-1:1)/2,y=u+(f<u?-1:1),x=c-g,b=f-y;m*m+l*l>x*x+b*b&&(p=g+(u&1?1:-1)/2,u=y)}let h=`${p},${u}`,d=s.get(h);d===void 0&&(d={index:[],extent:{data:t,x:(p+(u&1)/2)*o+nu,y:u*i+ru}},s.set(h,d)),d.index.push(a)}return s.values()}var Hz={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};function H9(t){return new qh(t)}var qh=class extends ft{constructor({binWidth:e=20,clip:n=!0,...r}={}){super(fs,void 0,{clip:n,...r},Hz),this.binWidth=Rt(e)}render(e,n,r,o,i){let{binWidth:s}=this,{marginTop:a,marginRight:c,marginBottom:f,marginLeft:u,width:p,height:l}=o,h=u-nu,d=p-c-nu,m=a-ru,g=l-f-ru,y=s/2,x=y*R_,b=x/2,w=y*2,_=x*1.5,v=Math.floor(h/w),A=Math.ceil(d/w),E=Math.floor((m+b)/_),T=Math.ceil((g-b)/_)+1,C=`m0,${$s(-x)}l${$s(y)},${$s(b)}v${$s(x)}l${$s(-y)},${$s(b)}`,S=C;for(let k=E;k<T;++k)for(let L=v;L<A;++L)S+=`M${$s(L*w+(k&1)*y)},${$s(k*_)}${C}`;return rt("svg:g",i).datum(0).call(gt,this,o,i).call(ht,this,{},ie+nu,ie+ru).call(k=>k.append("path").call(lt,this).call(_t,this,r).attr("d",S)).node()}};function $s(t){return Math.round(t*1e3)/1e3}var Qz={ariaLabel:"image",fill:null,stroke:null};function Zz(t){return/^\.*\//.test(t)}function Kz(t){return/^(blob|data|file|http|https):/i.test(t)}function Jz(t){return typeof t=="string"&&(Zz(t)||Kz(t))?[void 0,t]:[t,void 0]}var Bh=class extends ft{constructor(e,n={}){let{x:r,y:o,r:i,width:s,height:a,rotate:c,src:f,preserveAspectRatio:u,crossOrigin:p,frameAnchor:l,imageRendering:h}=n;i==null&&(i=void 0),i===void 0&&s===void 0&&a===void 0?s=a=16:s===void 0&&a!==void 0?s=a:a===void 0&&s!==void 0&&(a=s);let[d,m]=Jz(f),[g,y]=Pt(i),[x,b]=Pt(s,y!==void 0?y*2:void 0),[w,_]=Pt(a,y!==void 0?y*2:void 0),[v,A]=Pt(c,0);super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},r:{value:g,scale:"r",filter:Nn,optional:!0},width:{value:x,filter:Nn,optional:!0},height:{value:w,filter:Nn,optional:!0},rotate:{value:v,optional:!0},src:{value:d,optional:!0}},Sh(n),Qz),this.src=m,this.width=b,this.rotate=A,this.height=_,this.r=y,this.preserveAspectRatio=Vt(u,"xMidYMid"),this.crossOrigin=pe(p),this.frameAnchor=_o(l),this.imageRendering=Vt(h,"auto")}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,width:u,height:p,r:l,rotate:h,src:d}=r,{r:m,width:g,height:y,rotate:x}=this,[b,w]=ze(this,o);return rt("svg:g",i).call(gt,this,o,i).call(ht,this,{x:c&&s,y:f&&a}).call(_=>_.selectAll().data(e).enter().append("image").call(lt,this).attr("x",Q9(c,u,l,b,g,m)).attr("y",Q9(f,p,l,w,y,m)).attr("width",u?v=>u[v]:g!==void 0?g:l?v=>l[v]*2:m*2).attr("height",p?v=>p[v]:y!==void 0?y:l?v=>l[v]*2:m*2).attr("transform",h?v=>`rotate(${h[v]})`:x?`rotate(${x})`:null).attr("transform-origin",h||x?qr`${c?v=>c[v]:b}px ${f?v=>f[v]:w}px`:null).call(ot,"href",d?v=>d[v]:this.src).call(ot,"preserveAspectRatio",this.preserveAspectRatio).call(ot,"crossorigin",this.crossOrigin).call(ot,"image-rendering",this.imageRendering).call(ot,"clip-path",l?v=>`circle(${l[v]}px)`:m!==void 0?`circle(${m}px)`:null).call(_t,this,r)).node()}};function Q9(t,e,n,r,o,i){return e&&t?s=>t[s]-e[s]/2:e?s=>r-e[s]/2:t&&o!==void 0?s=>t[s]-o/2:o!==void 0?r-o/2:n&&t?s=>t[s]-n[s]:n?s=>r-n[s]:t?s=>t[s]-i:r-i}function Z9(t,{x:e,y:n,...r}={}){return r.frameAnchor===void 0&&([e,n]=ce(e,n)),new Bh(t,{...r,x:e,y:n})}function tY(t,e,n){var r=1e-8,o=e-1,i=n-1,s=0,a,c,f,u,p,l,h,d,m,g,y;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&n>=1?(f=t<.5?t:1-t,u=Math.sqrt(-2*Math.log(f)),h=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,t<.5&&(h=-h),d=(h*h-3)/6,m=2/(1/(2*e-1)+1/(2*n-1)),g=h*Math.sqrt(d+m)/m-(1/(2*n-1)-1/(2*e-1))*(d+5/6-2/(3*m)),h=e/(e+n*Math.exp(2*g))):(a=Math.log(e/(e+n)),c=Math.log(n/(e+n)),u=Math.exp(e*a)/e,p=Math.exp(n*c)/n,g=u+p,t<u/g?h=Math.pow(e*g*t,1/e):h=1-Math.pow(n*g*(1-t),1/n)),y=-ou(e)-ou(n)+ou(e+n);s<10;s++){if(h===0||h===1)return h;if(l=eY(h,e,n)-t,u=Math.exp(o*Math.log(h)+i*Math.log(1-h)+y),p=l/u,h-=u=p/(1-.5*Math.min(1,p*(o/h-i/(1-h)))),h<=0&&(h=.5*(h+u)),h>=1&&(h=.5*(h+u+1)),Math.abs(u)<r*h&&s>0)break}return h}function eY(t,e,n){var r=t===0||t===1?0:Math.exp(ou(e+n)-ou(e)-ou(n)+e*Math.log(t)+n*Math.log(1-t));return t<0||t>1?!1:t<(e+1)/(e+n+2)?r*K9(t,e,n)/e:1-r*K9(1-t,n,e)/n}function K9(t,e,n){var r=1e-30,o=1,i=e+n,s=e+1,a=e-1,c=1,f=1-i*t/s,u,p,l,h;for(Math.abs(f)<r&&(f=r),f=1/f,h=f;o<=100&&(u=2*o,p=o*(n-o)*t/((a+u)*(e+u)),f=1+p*f,Math.abs(f)<r&&(f=r),c=1+p/c,Math.abs(c)<r&&(c=r),f=1/f,h*=f*c,p=-(e+o)*(i+o)*t/((e+u)*(s+u)),f=1+p*f,Math.abs(f)<r&&(f=r),c=1+p/c,Math.abs(c)<r&&(c=r),f=1/f,l=f*c,h*=l,!(Math.abs(l-1)<3e-7));o++);return h}function ou(t){var e=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,o,i,s;for(s=(i=o=t)+5.5,s-=(o+.5)*Math.log(s);e<6;e++)r+=n[e]/++i;return Math.log(2.506628274631*r/o)-s}function J9(t,e){var n=tY(2*Math.min(t,1-t),.5*e,.5);return n=Math.sqrt(e*(1-n)/n),t>.5?n:-n}var nY={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},M1=class extends ft{constructor(e,n={}){let{x:r,y:o,z:i,ci:s=.95,precision:a=4}=n;if(super(e,{x:{value:r,scale:"x"},y:{value:o,scale:"y"},z:{value:pn(n),optional:!0}},n,nY),this.z=i,this.ci=+s,this.precision=+a,!(0<=this.ci&&this.ci<1))throw new Error(`invalid ci; not in [0, 1): ${s}`);if(!(this.precision>0))throw new Error(`invalid precision: ${a}`)}render(e,n,r,o,i){let{x:s,y:a,z:c}=r,{ci:f}=this;return rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(u=>u.selectAll().data(c?sh(e,c,this.z):[e]).enter().call(p=>p.append("path").attr("fill","none").call(lt,this).call(qa,this,{...r,fill:null,fillOpacity:null}).attr("d",l=>this._renderLine(l,s,a)).call(f&&!vi(this.fill)?l=>l.select(rY).attr("stroke","none").call(lt,this).call(qa,this,{...r,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",h=>this._renderBand(h,s,a)):()=>{}))).node()}};function rY(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(_n.svg,"path"),this)}var t3=class extends M1{constructor(e,n){super(e,n)}_renderBand(e,n,r){let{ci:o,precision:i}=this,[s,a]=Ot(e,u=>r[u]),c=S1(e,r,n),f=nI(e,r,n,(1-o)/2,c);return hf().y(u=>u).x0(u=>f(u,-1)).x1(u=>f(u,1))(le(s,a-i/2,i).concat(a))}_renderLine(e,n,r){let[o,i]=Ot(e,a=>r[a]),s=S1(e,r,n);return`M${s(o)},${o}L${s(i)},${i}`}},e3=class extends M1{constructor(e,n){super(e,n)}_renderBand(e,n,r){let{ci:o,precision:i}=this,[s,a]=Ot(e,u=>n[u]),c=S1(e,n,r),f=nI(e,n,r,(1-o)/2,c);return hf().x(u=>u).y0(u=>f(u,-1)).y1(u=>f(u,1))(le(s,a-i/2,i).concat(a))}_renderLine(e,n,r){let[o,i]=Ot(e,a=>n[a]),s=S1(e,n,r);return`M${o},${s(o)}L${i},${s(i)}`}};function tI(t,{y:e=Xt,x:n=X,stroke:r,fill:o=Ft(r)?"currentColor":r,...i}={}){return new t3(t,Hf({...i,x:n,y:e,fill:o,stroke:r}))}function eI(t,{x:e=Xt,y:n=X,stroke:r,fill:o=Ft(r)?"currentColor":r,...i}={}){return new e3(t,Vf({...i,x:e,y:n,fill:o,stroke:r}))}function S1(t,e,n){let r=0,o=0,i=0,s=0;for(let u of t){let p=e[u],l=n[u];r+=p,o+=l,i+=p*l,s+=p*p}let a=t.length,c=(a*i-r*o)/(a*s-r*r),f=(o-c*r)/a;return u=>c*u+f}function nI(t,e,n,r,o){let i=Ve(t,u=>e[u])/t.length,s=0,a=0;for(let u of t)s+=(e[u]-i)**2,a+=(n[u]-o(e[u]))**2;let c=Math.sqrt(a/(t.length-2)),f=J9(r,t.length-2);return(u,p)=>{let l=o(u),h=c*Math.sqrt(1/t.length+(u-i)**2/s);return l+p*f*h}}function zh({path:t=X,delimiter:e,frameAnchor:n,treeLayout:r=wa,treeSort:o,treeSeparation:i,treeAnchor:s,treeFilter:a,...c}={}){s=I1(s),o=iI(o),a!=null&&(a=r3(a)),n===void 0&&(n=s.frameAnchor);let f=sI(e),u=hI(c,r3),[p,l]=qe(),[h,d]=qe();return{x:p,y:h,frameAnchor:n,...Me(c,(m,g)=>{let y=f(ct(m,t)),x=l([]),b=d([]),w=-1,_=[],v=[],A=wg().path(C=>y[C]),E=Pn(m)?C=>C.data=m[C.data]:C=>C.data=m.get(C.data),T=r();T.nodeSize&&T.nodeSize([1,1]),T.separation&&i!==void 0&&T.separation(i??Vp);for(let C of u)C[E1]=C[lI]([]);for(let C of g){let S=[],k=A(C.filter(L=>y[L]!=null)).each(E);o!=null&&k.sort(o),T(k);for(let L of k.descendants())if(!(a!=null&&!a(L))){S.push(++w),_[w]=L.data,s.position(L,w,x,b);for(let M of u)M[E1][w]=M[pI](L)}v.push(S)}return{data:_,facets:v}}),...Object.fromEntries(u)}}function T1({path:t=X,delimiter:e,curve:n="bump-x",stroke:r="#555",strokeWidth:o=1.5,strokeOpacity:i=.5,treeLayout:s=wa,treeSort:a,treeSeparation:c,treeAnchor:f,treeFilter:u,...p}={}){f=I1(f),a=iI(a),u!=null&&(u=oI(u)),p={curve:n,stroke:r,strokeWidth:o,strokeOpacity:i,...p};let l=sI(e),h=hI(p,oI),[d,m]=qe(),[g,y]=qe(),[x,b]=qe(),[w,_]=qe();return{x1:d,x2:g,y1:x,y2:w,...Me(p,(v,A)=>{let E=l(ct(v,t)),T=m([]),C=y([]),S=b([]),k=_([]),L=-1,M=[],I=[],N=wg().path($=>E[$]),R=s();R.nodeSize&&R.nodeSize([1,1]),R.separation&&c!==void 0&&R.separation(c??Vp);for(let $ of h)$[E1]=$[lI]([]);for(let $ of A){let O=[],D=N($.filter(F=>E[F]!=null)).each(F=>F.data=v[F.data]);a!=null&&D.sort(a),R(D);for(let{source:F,target:P}of D.links())if(!(u!=null&&!u(P,F))){O.push(++L),M[L]=P.data,f.position(F,L,T,S),f.position(P,L,C,k);for(let W of h)W[E1][L]=W[pI](P,F)}I.push(O)}return{data:M,facets:I}}),...Object.fromEntries(h)}}function I1(t="left"){switch(`${t}`.trim().toLowerCase()){case"left":return oY;case"right":return iY}throw new Error(`invalid tree anchor: ${t}`)}var oY={frameAnchor:"left",dx:6,position({x:t,y:e},n,r,o){r[n]=e,o[n]=-t}},iY={frameAnchor:"right",dx:-6,position({x:t,y:e},n,r,o){r[n]=-e,o[n]=-t}};function iI(t){return t==null||typeof t=="function"?t:`${t}`.trim().toLowerCase().startsWith("node:")?rI(r3(t)):rI(sY(t))}function rI(t){return(e,n)=>Fe(t(e),t(n))}function sY(t){return e=>e.data?.[t]}function sI(t="/"){if(t=`${t}`,t==="/")return n=>n;if(t.length!==1)throw new Error("delimiter must be exactly one character");let e=t.charCodeAt(0);return n=>n.map(r=>aY(r,e))}var n3=92,aI=47;function aY(t,e){if(e===n3)throw new Error("delimiter cannot be backslash");let n=!1;for(let r=0,o=t.length;r<o;++r){switch(t.charCodeAt(r)){case n3:if(!n){n=!0;continue}break;case e:n?(t=t.slice(0,r-1)+t.slice(r),--r,--o):t=t.slice(0,r)+"/"+t.slice(r+1);break;case aI:n?(t=t.slice(0,r)+"\\\\"+t.slice(r),r+=2,o+=2):(t=t.slice(0,r)+"\\"+t.slice(r),++r,++o);break}n=!1}return t}function cY(t){let e=!1;for(let n=0,r=t.length;n<r;++n){switch(t.charCodeAt(n)){case n3:if(!e){e=!0;continue}case aI:e&&(t=t.slice(0,n-1)+t.slice(n),--n,--r);break}e=!1}return t}function cI(t){return Pe(t)&&typeof t.node=="function"}function fY(t){return Pe(t)&&typeof t.link=="function"}function r3(t){if(cI(t))return t.node;if(t=`${t}`.trim().toLowerCase(),!!t.startsWith("node:")){switch(t){case"node:name":return i3;case"node:path":return o3;case"node:internal":return fI;case"node:external":return uI;case"node:depth":return s3;case"node:height":return a3}throw new Error(`invalid node value: ${t}`)}}function oI(t){if(cI(t))return t.node;if(fY(t))return t.link;if(t=`${t}`.trim().toLowerCase(),!(!t.startsWith("node:")&&!t.startsWith("parent:"))){switch(t){case"parent:name":return A1(i3);case"parent:path":return A1(o3);case"parent:depth":return A1(s3);case"parent:height":return A1(a3);case"node:name":return i3;case"node:path":return o3;case"node:internal":return fI;case"node:external":return uI;case"node:depth":return s3;case"node:height":return a3}throw new Error(`invalid link value: ${t}`)}}function o3(t){return t.id}function i3(t){return uY(t.id)}function s3(t){return t.depth}function a3(t){return t.height}function fI(t){return!!t.children}function uI(t){return!t.children}function A1(t){return(e,n)=>n==null?void 0:t(n)}function uY(t){let e=t.length;for(;--e>0&&!lY(t,e););return cY(t.slice(e+1))}function lY(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}var lI=2,pI=3,E1=4;function hI(t,e){let n=[];for(let r in t){let o=t[r],i=e(o);i!==void 0&&n.push([r,...qe(o),i])}return n}function c3(t,{fill:e,stroke:n,strokeWidth:r,strokeOpacity:o,strokeLinejoin:i,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:f,marker:u,markerStart:p=u,markerEnd:l=u,dot:h=Ft(p)&&Ft(l),text:d="node:name",textStroke:m="var(--plot-background)",title:g="node:path",dx:y,dy:x,textAnchor:b,treeLayout:w=wa,textLayout:_=w===wa||w===xg?"mirrored":"normal",tip:v,...A}={}){if(y===void 0&&(y=I1(A.treeAnchor).dx),b!==void 0)throw new Error("textAnchor is not a configurable tree option");_=Ie(_,"textLayout",["mirrored","normal"]);function E(T){return Io(t,zh({treeLayout:w,text:d,fill:e===void 0?"currentColor":e,stroke:m,dx:y,dy:x,title:g,...T,...A}))}return Se(l1(t,T1({treeLayout:w,markerStart:p,markerEnd:l,stroke:n!==void 0?n:e===void 0?"node:internal":e,strokeWidth:r,strokeOpacity:o,strokeLinejoin:i,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:f,...A})),h?_r(t,zh({treeLayout:w,fill:e===void 0?"node:internal":e,title:g,tip:v,...A})):null,d!=null?_==="mirrored"?[E({textAnchor:"start",treeFilter:"node:external"}),E({textAnchor:"end",treeFilter:"node:internal",dx:-y})]:E():null)}function dI(t,e){return c3(t,{...e,treeLayout:xg})}var gI={ariaLabel:"waffle"},Yh=class extends Va{constructor(e,{unit:n=1,gap:r=1,round:o,render:i,multiple:s,...a}={}){super(e,{...a,render:Ei(i,yI("x"))},gI),this.unit=Math.max(0,n),this.gap=+r,this.round=xI(o),this.multiple=bI(s)}},Uh=class extends Ha{constructor(e,{unit:n=1,gap:r=1,round:o,render:i,multiple:s,...a}={}){super(e,{...a,render:Ei(i,yI("y"))},gI),this.unit=Math.max(0,n),this.gap=+r,this.round=xI(o),this.multiple=bI(s)}};function yI(t){return function(e,n,r,o,i){let{unit:s,gap:a,rx:c,ry:f,round:u}=this,{document:p}=i,l=r.channels[`${t}1`].value,h=r.channels[`${t}2`].value,d=this[t==="y"?"_width":"_height"](n,r,o),m=this[t==="y"?"_x":"_y"](n,r,o),g=s*pY(n.scales[t]),{multiple:y=Math.max(1,Math.floor(Math.sqrt(d/g)))}=this,x=Math.min(d/y,g*y),b=g*y,w=t==="y"?([S,k])=>[S*x,-k*b]:([S,k])=>[k*b,S*x],_=(d-y*x)/2,v=typeof m=="function"?S=>m(S)+_:m+_,A=n[t](0),E=SE(),T=p.createElementNS(_n.svg,"pattern");T.setAttribute("width",t==="y"?x:b),T.setAttribute("height",t==="y"?b:x),T.setAttribute("patternUnits","userSpaceOnUse");let C=T.appendChild(p.createElementNS(_n.svg,"rect"));return C.setAttribute("x",a/2),C.setAttribute("y",a/2),C.setAttribute("width",(t==="y"?x:b)-a),C.setAttribute("height",(t==="y"?b:x)-a),c!=null&&C.setAttribute("rx",c),f!=null&&C.setAttribute("ry",f),rt("svg:g",i).call(gt,this,o,i).call(this._transform,this,n).call(S=>S.selectAll().data(e).enter().append(()=>T.cloneNode(!0)).attr("id",k=>`${E}-${k}`).select("rect").call(lt,this).call(_t,this,r)).call(S=>S.selectAll().data(e).enter().append("path").attr("transform",t==="y"?qr`translate(${v},${A})`:qr`translate(${A},${v})`).attr("d",k=>`M${f3(u(l[k]/s),u(h[k]/s),y).map(w).join("L")}Z`).attr("fill",k=>`url(#${E}-${k})`).attr("stroke",this.stroke==null?null:k=>`url(#${E}-${k})`)).node()}}function f3(t,e,n){if(t<0||e<0){let r=Math.ceil(-Math.min(t,e)/n);return f3(t+r*n,e+r*n,n).map(([o,i])=>[o,i-r])}return e<t?f3(e,t,n):[[0,Math.ceil(t/n)],[Math.floor(t%n),Math.ceil(t/n)],[Math.floor(t%n),Math.floor(t/n)+t%1],[Math.ceil(t%n),Math.floor(t/n)+t%1],...t%n>n-1?[]:[[Math.ceil(t%n),Math.floor(t/n)],[n,Math.floor(t/n)]],[n,Math.floor(e/n)],[Math.ceil(e%n),Math.floor(e/n)],[Math.ceil(e%n),Math.floor(e/n)+e%1],[Math.floor(e%n),Math.floor(e/n)+e%1],...e%n<1?[]:[[Math.floor(e%n),Math.ceil(e/n)],[0,Math.ceil(e/n)]]]}function xI(t){if(t===void 0||t===!1)return Number;if(t===!0)return Math.round;if(typeof t!="function")throw new Error(`invalid round: ${t}`);return t}function bI(t){return t===void 0?void 0:Math.max(1,Math.floor(t))}function pY({domain:t,range:e}){return mI(e)/mI(t)}function mI(t){let[e,n]=Ot(t);return n-e}function wI(t,e={}){return xi(e)||(e={...e,y:Xt,x2:X}),new Yh(t,Ts(Pf(As(e))))}function vI(t,e={}){return xi(e)||(e={...e,x:Xt,y2:X}),new Uh(t,Is(qf(Es(e))))}var RI=KC(kI(),1);var wY=({marginLeft:t})=>[1,t],vY=({width:t,marginRight:e})=>[-1,t-e],_Y=({width:t,marginLeft:e,marginRight:n})=>[0,(e+t-n)/2],MY=({marginTop:t})=>[1,t],SY=({height:t,marginBottom:e})=>[-1,t-e],AY=({height:t,marginTop:e,marginBottom:n})=>[0,(e+t-n)/2];function LI(t){return typeof t=="string"?{anchor:t}:t}function OI(t={},e={}){arguments.length===1&&([t,e]=DI(t));let{anchor:n="left",padding:r=1,r:o=e.r}=LI(t);switch(`${n}`.toLowerCase()){case"left":n=wY;break;case"right":n=vY;break;case"middle":n=_Y;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return FI("x","y",n,Rt(r),o,e)}function $I(t={},e={}){arguments.length===1&&([t,e]=DI(t));let{anchor:n="bottom",padding:r=1,r:o=e.r}=LI(t);switch(`${n}`.toLowerCase()){case"top":n=MY;break;case"bottom":n=SY;break;case"middle":n=AY;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return FI("y","x",n,Rt(r),o,e)}function DI(t){let{anchor:e,padding:n,...r}=t,{r:o}=r;return[{anchor:e,padding:n,r:o},r]}function FI(t,e,n,r,o,i){if(o!=null&&typeof o!="number"){let{channels:s,sort:a,reverse:c}=i;s=Qp(s),s?.r===void 0&&(i={...i,channels:{...s,r:{value:o,scale:"r"}}}),a===void 0&&c===void 0&&(i.sort={channel:"-r"})}return Gt(i,function(s,a,c,f,u,p){let{[e]:l,r:h}=c;if(!c[e])throw new Error(`missing channel: ${e}`);({[e]:l}=Eo(c,f,p));let d=h?void 0:o!==void 0?Rt(o):this.r!==void 0?this.r:3;h&&(h=ct(h.value,f[h.scale]||X,Float64Array));let[m,g]=n(u),y=m?TY:EY,x=new Float64Array(l.length),b=h?w=>h[w]:()=>d;for(let w of a){let _=(0,RI.default)();w=w.filter(h?A=>xf(l[A])&&Nn(h[A]):A=>xf(l[A]));let v=new Float64Array(2*w.length+2);for(let A of w){let E=b(A),T=m?E+r:0,C=l[A]-E,S=l[A]+E,k=2;_.queryInterval(C-r,S+r,([,,M])=>{let I=x[M]-T,N=l[A]-l[M],R=r+(h?h[A]+h[M]:2*d),$=Math.sqrt(R*R-N*N);v[k++]=I-$,v[k++]=I+$});let L=v.slice(0,k);m&&(L=L.filter(M=>M>=0));t:for(let M of L.sort(y)){for(let I=0;I<k;I+=2)if(v[I]+1e-6<M&&M<v[I+1]-1e-6)continue t;x[A]=M+T;break}_.insert([C,S,A])}}m||(m=1);for(let w of a)for(let _ of w)x[_]=x[_]*m+g;return{data:s,facets:a,channels:{[t]:{value:x,source:null},[e]:{value:l,source:c[e]},...h&&{r:{value:h,source:c.r}}}}})}function EY(t,e){return Math.abs(t)-Math.abs(e)}function TY(t,e){return t-e}function qI(t,e){return arguments.length===1&&({basis:t,...e}=t),Kf(k1(t),e)}function BI(t,e){return arguments.length===1&&({basis:t,...e}=t),Jf(k1(t),e)}function k1(t){if(t===void 0)return PI;if(typeof t=="function")return R1(Mf(t));if(/^p\d{2}$/i.test(t))return cu(_f(t));switch(`${t}`.toLowerCase()){case"deviation":return NY;case"first":return PI;case"last":return CY;case"max":return kY;case"mean":return RY;case"median":return LY;case"min":return OY;case"sum":return $Y;case"extent":return IY}throw new Error(`invalid basis: ${t}`)}function R1(t){return{mapIndex(e,n,r){let o=+t(e,n);for(let i of e)r[i]=n[i]===null?NaN:n[i]/o}}}function cu(t){return R1((e,n)=>t(e,r=>n[r]))}var IY={mapIndex(t,e,n){let[r,o]=Ot(t,s=>e[s]),i=o-r;for(let s of t)n[s]=e[s]===null?NaN:(e[s]-r)/i}},PI=R1((t,e)=>{for(let n=0;n<t.length;++n){let r=e[t[n]];if(Jt(r))return r}}),CY=R1((t,e)=>{for(let n=t.length-1;n>=0;--n){let r=e[t[n]];if(Jt(r))return r}}),NY={mapIndex(t,e,n){let r=Qo(t,i=>e[i]),o=fr(t,i=>e[i]);for(let i of t)n[i]=e[i]===null?NaN:o?(e[i]-r)/o:0}},kY=cu(It),RY=cu(Qo),LY=cu(Rr),OY=cu(St),$Y=cu(Ve);function zI(t,e){return UI("x",t,e)}function YI(t,e){return UI("y",t,e)}function UI(t,e,n={}){let r,o=1;if(typeof e=="number")o=e,r=(f,u)=>+f+u;else{if(typeof e=="string"){let f=e.startsWith("-")?-1:1;[e,o]=cx(e.replace(/^[+-]/,"")),o*=f}e=Af(e),r=(f,u)=>e.offset(f,u)}let i=`${t}1`,s=`${t}2`,a=qn({[i]:f=>f.map(u=>r(u,o)),[s]:f=>f},n),c=a[s].transform;return a[s].transform=()=>{let f=c(),[u,p]=Ot(f);return f.domain=o<0?[u,r(p,o)]:[r(u,o),p],f},a}function jI(t,e={}){if(typeof t=="string")switch(t.toLowerCase()){case"first":return Wh(e);case"last":return Gh(e)}if(typeof t=="function")return Ds(null,t,e);let n,r;for(n in t){if(r!==void 0)throw new Error("ambiguous selector; multiple inputs");r=DY(t[n])}if(r===void 0)throw new Error(`invalid selector: ${t}`);return Ds(n,r,e)}function DY(t){if(typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"min":return m3;case"max":return g3}throw new Error(`unknown selector: ${t}`)}function Wh(t){return Ds(null,FY,t)}function Gh(t){return Ds(null,PY,t)}function L1(t){return Ds("x",m3,t)}function O1(t){return Ds("y",m3,t)}function $1(t){return Ds("x",g3,t)}function D1(t){return Ds("y",g3,t)}function*FY(t){yield t[0]}function*PY(t){yield t[t.length-1]}function*m3(t,e){yield n0(t,n=>e[n])}function*g3(t,e){yield ra(t,n=>e[n])}function Ds(t,e,n){if(t!=null){if(n[t]==null)throw new Error(`missing channel: ${t}`);t=n[t]}let r=pn(n);return Me(n,(o,i)=>{let s=ct(o,r),a=ct(o,t),c=[];for(let f of i){let u=[];for(let p of s?We(f,l=>s[l]).values():[f])for(let l of e(p,a))u.push(l);c.push(u)}return{data:o,facets:c}})}ft.prototype.plot=function({marks:t=[],...e}={}){return Gf({...e,marks:[...t,this]})};var qY=new Map([["style","style"],["width","width"],["height","height"],["margin","margin"],["marginLeft","marginLeft"],["marginRight","marginRight"],["marginTop","marginTop"],["marginBottom","marginBottom"],["align","align"],["aspectRatio","aspectRatio"],["axis","axis"],["inset","inset"],["grid","grid"],["label","label"],["padding","padding"],["xScale","x.type"],["xDomain","x.domain"],["xRange","x.range"],["xNice","x.nice"],["xInset","x.inset"],["xInsetLeft","x.insetLeft"],["xInsetRight","x.insetRight"],["xClamp","x.clamp"],["xRound","x.round"],["xAlign","x.align"],["xPadding","x.padding"],["xPaddingInner","x.paddingInner"],["xPaddingOuter","x.paddingOuter"],["xAxis","x.axis"],["xTicks","x.ticks"],["xTickSize","x.tickSize"],["xTickSpacing","x.tickSpacing"],["xTickPadding","x.tickPadding"],["xTickFormat","x.tickFormat"],["xTickRotate","x.tickRotate"],["xGrid","x.grid"],["xLine","x.line"],["xLabel","x.label"],["xLabelAnchor","x.labelAnchor"],["xLabelArrow","x.labelArrow"],["xLabelOffset","x.labelOffset"],["xFontVariant","x.fontVariant"],["xAriaLabel","x.ariaLabel"],["xAriaDescription","x.ariaDescription"],["xPercent","x.percent"],["xReverse","x.reverse"],["xZero","x.zero"],["xBase","x.base"],["xExponent","x.exponent"],["xConstant","x.constant"],["yScale","y.type"],["yDomain","y.domain"],["yRange","y.range"],["yNice","y.nice"],["yInset","y.inset"],["yInsetTop","y.insetTop"],["yInsetBottom","y.insetBottom"],["yClamp","y.clamp"],["yRound","y.round"],["yAlign","y.align"],["yPadding","y.padding"],["yPaddingInner","y.paddingInner"],["yPaddingOuter","y.paddingOuter"],["yAxis","y.axis"],["yTicks","y.ticks"],["yTickSize","y.tickSize"],["yTickSpacing","y.tickSpacing"],["yTickPadding","y.tickPadding"],["yTickFormat","y.tickFormat"],["yTickRotate","y.tickRotate"],["yGrid","y.grid"],["yLine","y.line"],["yLabel","y.label"],["yLabelAnchor","y.labelAnchor"],["yLabelArrow","y.labelArrow"],["yLabelOffset","y.labelOffset"],["yFontVariant","y.fontVariant"],["yAriaLabel","y.ariaLabel"],["yAriaDescription","y.ariaDescription"],["yPercent","y.percent"],["yReverse","y.reverse"],["yZero","y.zero"],["yBase","y.base"],["yExponent","y.exponent"],["yConstant","y.constant"],["facetMargin","facet.margin"],["facetMarginTop","facet.marginTop"],["facetMarginBottom","facet.marginBottom"],["facetMarginLeft","facet.marginLeft"],["facetMarginRight","facet.marginRight"],["facetGrid","facet.grid"],["facetLabel","facet.label"],["fxDomain","fx.domain"],["fxRange","fx.range"],["fxInset","fx.inset"],["fxInsetLeft","fx.insetLeft"],["fxInsetRight","fx.insetRight"],["fxRound","fx.round"],["fxAlign","fx.align"],["fxPadding","fx.padding"],["fxPaddingInner","fx.paddingInner"],["fxPaddingOuter","fx.paddingOuter"],["fxAxis","fx.axis"],["fxTicks","fx.ticks"],["fxTickSize","fx.tickSize"],["fxTickSpacing","fx.tickSpacing"],["fxTickPadding","fx.tickPadding"],["fxTickFormat","fx.tickFormat"],["fxTickRotate","fx.tickRotate"],["fxGrid","fx.grid"],["fxLine","fx.line"],["fxLabel","fx.label"],["fxLabelAnchor","fx.labelAnchor"],["fxLabelOffset","fx.labelOffset"],["fxFontVariant","fx.fontVariant"],["fxAriaLabel","fx.ariaLabel"],["fxAriaDescription","fx.ariaDescription"],["fxReverse","fx.reverse"],["fyDomain","fy.domain"],["fyRange","fy.range"],["fyInset","fy,inset"],["fyInsetTop","fy.insetTop"],["fyInsetBottom","fy.insetBottom"],["fyRound","fy.round"],["fyAlign","fy.align"],["fyPadding","fy.padding"],["fyPaddingInner","fy.paddingInner"],["fyPaddingOuter","fy.paddingOuter"],["fyAxis","fy.axis"],["fyTicks","fy.ticks"],["fyTickSize","fy.tickSize"],["fyTickSpacing","fy.tickSpacing"],["fyTickPadding","fy.tickPadding"],["fyTickFormat","fy.tickFormat"],["fyTickRotate","fy.tickRotate"],["fyGrid","fy.grid"],["fyLine","fy.line"],["fyLabel","fy.label"],["fyLabelAnchor","fy.labelAnchor"],["fyLabelOffset","fy.labelOffset"],["fyFontVariant","fy.fontVariant"],["fyAriaLabel","fy.ariaLabel"],["fyAriaDescription","fy.ariaDescription"],["fyReverse","fy.reverse"],["colorScale","color.type"],["colorDomain","color.domain"],["colorRange","color.range"],["colorClamp","color.clamp"],["colorN","color.n"],["colorNice","color.nice"],["colorScheme","color.scheme"],["colorInterpolate","color.interpolate"],["colorPivot","color.pivot"],["colorSymmetric","color.symmetric"],["colorLabel","color.label"],["colorPercent","color.percent"],["colorReverse","color.reverse"],["colorZero","color.zero"],["colorTickFormat","color.tickFormat"],["colorBase","color.base"],["colorExponent","color.exponent"],["colorConstant","color.constant"],["opacityScale","opacity.type"],["opacityDomain","opacity.domain"],["opacityRange","opacity.range"],["opacityClamp","opacity.clamp"],["opacityNice","opacity.nice"],["opacityLabel","opacity.label"],["opacityPercent","opacity.percent"],["opacityReverse","opacity.reverse"],["opacityZero","opacity.zero"],["opacityTickFormat","opacity.tickFormat"],["opacityBase","opacity.base"],["opacityExponent","opacity.exponent"],["opacityConstant","opacity.constant"],["symbolScale","symbol.type"],["symbolDomain","symbol.domain"],["symbolRange","symbol.range"],["rScale","r.type"],["rDomain","r.domain"],["rRange","r.range"],["rClamp","r.clamp"],["rNice","r.nice"],["rLabel","r.label"],["rPercent","r.percent"],["rZero","r.zero"],["rBase","r.base"],["rExponent","r.exponent"],["rConstant","r.constant"],["lengthScale","length.type"],["lengthDomain","length.domain"],["lengthRange","length.range"],["lengthClamp","length.clamp"],["lengthNice","length.nice"],["lengthPercent","length.percent"],["lengthZero","length.zero"],["lengthBase","length.base"],["lengthExponent","length.exponent"],["lengthConstant","length.constant"],["projectionType","projection.type"],["projectionParallels","projection.parallels"],["projectionPrecision","projection.precision"],["projectionRotate","projection.rotate"],["projectionDomain","projection.domain"],["projectionInset","projection.inset"],["projectionInsetLeft","projection.insetLeft"],["projectionInsetRight","projection.insetRight"],["projectionInsetTop","projection.insetTop"],["projectionInsetBottom","projection.insetBottom"],["projectionClip","projection.clip"]]);function BY(t,e,n){for(let r=0;r<e.length;++r){let o=e[r];r===e.length-1?t[o]=n:t=t[o]||(t[o]={})}}function XI(t,e,n){for(let r in t){let o=qY.get(r);if(o==null)throw new Error(`Unrecognized plot attribute: ${r}`);let i=t[r];typeof i=="symbol"?n.push(r):i!==void 0&&BY(e,o.split("."),i)}}var zY=new Set(["frame","hexgrid","sphere","graticule"]),YY=new Map([["first",Wh],["last",Gh],["maxX",$1],["maxY",D1],["minX",L1],["minY",O1],["nearest",_s],["nearestX",Ms],["nearestXY",Ti]]);async function WI(t){let e={marks:[]},n=[],{attributes:r,marks:o}=t;XI(r,e,n);let i=[];for(let a of o)for(let{type:c,data:f,options:u}of a.plotSpecs()){let{select:p,...l}=u,h=YY.get(p)?.(l)??l,d=zY.has(c)?[h]:[f,h];e.marks.push(y3[c](...d)),i.push(a.index)}jY(e,t);let s=Gf(e);WY(s,i),UY(t,s,r,n);for(let a of t.interactors)await a.init(s);return s}function UY(t,e,n,r){r.forEach(o=>{let i=n[o];if(i===Li){if(!o.endsWith("Domain"))throw new Error(`Unsupported fixed attribute: ${o}`);let s=o.slice(0,-6),a=e.scale(s);a?.domain&&t.setAttribute(o,n[`${s}Reverse`]?a.domain.slice().reverse():a.domain)}else throw new Error(`Unrecognized symbol: ${i}`)})}function jY(t,e){let{marks:n}=e;F1("x",t,n),F1("y",t,n),F1("fx",t,n),F1("fy",t,n)}function F1(t,e,n){let r=e[t]||{};if(r.axis===null||r.label!==void 0)return;let o=n.map(s=>s.channelField(t)?.field);if(o.every(s=>s==null))return;let i;for(let s=0;s<o.length;++s){let a=GI(o[s]);a!==void 0&&(i===void 0?i=a:i!==a&&(i=void 0))}i!==void 0&&(e[t]={...r,label:i})}function GI(t){if(t){switch(t.type){case"COLUMN_REF":return t.column;case"CAST":return GI(t.expr);case"FUNCTION":if(t.name==="make_date")return"date";break}return XY(t)}}function XY(t){let e=`${t}`.replaceAll('"',"").replaceAll("(*)","()");return e.endsWith("()")?e.slice(0,-2):e}function WY(t,e){let n=-1;for(let r of t.children){let o=r.getAttribute("aria-label")||"";r.nodeName==="style"||o.includes("-axis")||o.includes("-grid")||r.setAttribute("data-index",e[++n])}}var GY={width:640,marginLeft:40,marginRight:20,marginTop:20,marginBottom:30},x3=class{constructor(e){this.attributes={...GY},this.listeners=null,this.interactors=[],this.legends=[],this.marks=[],this.markset=null,this.element=e||document.createElement("div"),this.element.setAttribute("class","plot"),this.element.style.display="flex",this.element.value=this,this.params=new Map,this.synch=p2()}margins(){return{left:this.getAttribute("marginLeft"),top:this.getAttribute("marginTop"),bottom:this.getAttribute("marginBottom"),right:this.getAttribute("marginRight")}}innerWidth(){let{left:e,right:n}=this.margins();return this.getAttribute("width")-e-n}innerHeight(e=400){let{top:n,bottom:r}=this.margins(),o=this.getAttribute("height");return o==null&&(o=VY(this,n,r)||e,this.setAttribute("height",o,{silent:!0})),o-n-r}pending(e){this.synch.pending(e)}update(e){return this.synch.ready(e)&&!this.pendingRender&&(this.pendingRender=!0,requestAnimationFrame(()=>this.render())),this.synch.promise}async render(){this.pendingRender=!1;let e=await WI(this),n=this.legends.flatMap(({legend:r,include:o})=>{let i=r.init(e);return o?i:[]});this.element.replaceChildren(e,...n),this.synch.resolve()}getAttribute(e){return this.attributes[e]}setAttribute(e,n,r){return sl(this.attributes[e],n)?(n===void 0?delete this.attributes[e]:this.attributes[e]=n,r?.silent||this.listeners?.get(e)?.forEach(o=>o(e,n)),!0):!1}addAttributeListener(e,n){let r=this.listeners||(this.listeners=new Map);return r.has(e)||r.set(e,new Set),r.get(e).add(n),this}removeAttributeListener(e,n){return this.listeners?.get(e)?.delete(n)}addParams(e,n){let{params:r}=this;for(let o of n)r.has(o)?r.get(o).push(e):(r.set(o,[e]),o.addEventListener("value",()=>Promise.allSettled(r.get(o).map(i=>i.initialize()))))}addMark(e){return e.setPlot(this,this.marks.length),this.marks.push(e),this.markset=null,this}get markSet(){return this.markset||(this.markset=new Set(this.marks))}addInteractor(e){return this.interactors.push(e),this}addLegend(e,n=!0){e.setPlot(this),this.legends.push({legend:e,include:n})}};function VY(t,e,n){let r=t.getAttribute("aspectRatio");if(r==null)return;let o=t.getAttribute("xDomain"),i=t.getAttribute("yDomain");if(!o||!i)return;let s=Math.abs(o[1]-o[0]);return Math.abs(i[1]-i[0])*t.innerWidth()/(r*s)+e+n}function P1(t){return typeof t!="string"?!1:(t=t.toLowerCase().trim(),t==="none"||t==="currentcolor"||t.startsWith("url(")&&t.endsWith(")")||t.startsWith("var(")&&t.endsWith(")")||Xn(t)!==null)}var HY=new Set(["order","sort","label","anchor","curve","tension","marker","markerStart","markerMid","markerEnd","textAnchor","lineAnchor","lineHeight","textOverflow","monospace","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","frameAnchor","strokeLinejoin","strokeLinecap","strokeMiterlimit","strokeDasharray","strokeDashoffset","mixBlendMode","shapeRendering","imageRendering","preserveAspectRatio","interpolate","crossOrigin","paintOrder","pointerEvents","target","select"]);function VI(t){return HY.has(t)}var QY=new Set(["asterisk","circle","cross","diamond","diamond2","hexagon","plus","square","square2","star","times","triangle","triangle2","wye"]);function HI(t){return QY.has(`${t}`.toLowerCase())}var QI=t=>t==="stroke"||t==="fill",ZY=t=>/opacity$/i.test(t),KY=t=>t==="symbol",JY=(t,e)=>t!=="sort"&&t!=="tip"&&e!=null&&!Array.isArray(e),b3=(t,e)=>({channel:t,field:e,as:qi(e)?e.column:t}),w3=(t,e)=>({channel:t,value:e}),q1=t=>Array.isArray(t),Je=class extends du{constructor(e,n,r,o={}){super(n?.options?.filterBy),this.type=e,this.reqs=o,this.source=n;let i=this.channels=[],s=this.detail=new Set,a=this.params=new Set;q1(n)?this.data=cr(n):Wo(n?.table)&&a.add(n.table);let c=(f,u)=>{let p=typeof u;if(f==="channels")for(let l in u)s.add(l),c(l,u[l]);else if(p==="function"&&u[pu]){let l=u(this,f);for(let h in l)c(h,l[h])}else if(p==="string")VI(f)||QI(f)&&P1(u)||KY(f)&&HI(u)?i.push(w3(f,u)):i.push(b3(f,Du(u)));else if(Er(u)){let l=w3(f,u.value);i.push(l),u.addEventListener("value",h=>(l.value=h,this.update()))}else en(u)?(Hb(u).forEach(l=>a.add(l)),i.push(b3(f,u))):p==="object"&&JY(f,u)?i.push(b3(f,u)):u!==void 0&&i.push(w3(f,u))};for(let f in r)c(f,r[f])}setPlot(e,n){this.plot=e,this.index=n,e.addParams(this,this.params),this.source?.table&&this.queryPending()}sourceTable(){let e=this.source?.table;return e?Wo(e)?e.value:e:null}hasOwnData(){return this.source==null||q1(this.source)}hasFieldInfo(){return!!this._fieldInfo}channel(e){return this.channels.find(n=>n.channel===e)}channelField(e,{exact:n=!1}={}){let r=n?this.channel(e):this.channels.find(o=>o.channel.startsWith(e));return r?.field?r:null}fields(){if(this.hasOwnData())return null;let{channels:e,reqs:n}=this,r=new Map;for(let{channel:i,field:s}of e){if(!s)continue;let a=s.stats?.stats||[],c=s.stats?.column??s,f=r.get(c)??r.set(c,new Set).get(c);a.forEach(u=>f.add(u)),n[i]?.forEach(u=>f.add(u))}let o=this.sourceTable();return Array.from(r,([i,s])=>({table:o,column:i,stats:s}))}fieldInfo(e){let n=Object.fromEntries(e.map(r=>[r.column,r]));for(let r of this.channels){let{field:o}=r;o&&Object.assign(r,n[o.stats?.column??o])}return this._fieldInfo=!0,this}query(e=[]){return this.hasOwnData()?null:Vh(this.channels,this.sourceTable()).where(e)}queryPending(){return this.plot.pending(this),this}queryResult(e){return this.data=cr(e),this}update(){return this.plot.update(this)}plotSpecs(){let{type:e,data:n,detail:r,channels:o}=this;return v3(e,r,o,n)}};function dn(t,e){let n=e?.[t.as]??t.as;return Object.hasOwn(t,"value")?t.value:QI(t.channel)?{value:n,scale:"color"}:ZY(t.channel)?{value:n,scale:"opacity"}:n}function Vh(t,e,n=[]){let r=yt.from({source:e}),o=new Set,i=!1;for(let s of t){let{channel:a,field:c,as:f}=s;if(!n.includes(a)){if(a==="orderby")r.orderby(s.value);else if(c){if(jn(c))i=!0;else{if(o.has(f))continue;o.add(f)}r.select({[f]:c})}}}return i&&r.groupby(Array.from(o)),r}function v3(t,e,n,r,o={}){let{numRows:i,values:s,columns:a}=r??{},c={};for(let p of n){let l=e.has(p.channel)?c:o;l[p.channel]=dn(p,a)}return e.size&&(o.channels=c),[{type:t,data:s??(r?{length:i}:null),options:o}]}function ec(t,e){let{plot:n}=t,r=n.getAttribute(`${e}Scale`);if(!r){let{type:i}=t.channelField(e);r=i==="date"?"time":"linear"}let o={type:r};switch(r){case"log":o.base=n.getAttribute(`${e}Base`)??10;break;case"pow":o.exponent=n.getAttribute(`${e}Exponent`)??1;break;case"symlog":o.constant=n.getAttribute(`${e}Constant`)??1;break}return ol(o)}function rr(t,e,n,r,o=1,i){let{field:s}=t.channelField(e);i=i??s;let{type:a,apply:c,sqlApply:f}=ec(t,e),u=!!t.plot.getAttribute(`${e}Reverse`),[p,l]=r.map(m=>c(m)),h=f(i),d=a==="time"||a==="utc"?h:i;return[Qb(h,p,l,n-o,u),d]}var _3={x:["min","max"]},M3={y:["min","max"]},B1={..._3,...M3};function ZI(t,e,n,r,o){let{plot:i}=t,s=i.getAttribute(r),a=i.getAttribute(o);if(Array.isArray(s)&&!s[Ye])return s;{let{column:c,min:f,max:u}=t.channelField(n),p=S3(e,c)||(a?si().domain([f,u]).nice().domain():[f,u]);return s!==Li&&(p[Ye]=!0),i.setAttribute(r,p,{silent:!0}),p}}function Lo(t,e){return ZI(t,e,"x","xDomain","xNice")}function Oo(t,e){return ZI(t,e,"y","yDomain","yNice")}function S3(t,e){if(!t)return;let n,r;return[t].flat().forEach(o=>Qr(o,i=>{if(i instanceof Zs&&`${i.expr}`===e){let s=(i.extent??[]).map(a=>a?.value??a);(n==null||s[0]<n)&&(n=s[0]),(r==null||s[1]>r)&&(r=s[1])}})),n!=null&&r!=null&&n!==r?[n,r]:void 0}var A3=class extends Je{constructor(e,n,r){let o=e.endsWith("X")?"y":e.endsWith("Y")?"x":null,i=o?{[o]:["count","min","max"]}:void 0;super(e,n,r,i),this.dim=o}query(e=[]){let{plot:n,dim:r,source:o}=this,i=o.options?.optimize,s=super.query(e);if(!r)return s;let a=r==="x"?"y":"x",c=this.channelField(a,{exact:!0})?.as,{field:f,as:u,type:p,count:l,min:h,max:d}=this.channelField(r),m=p==="date"||p==="number",g=r==="x"?n.innerWidth():n.innerHeight();if(i??=l/g>10,i&&m&&c){let[y,x]=S3(e,f)||[h,d],[b]=rr(this,r,g,[y,x],1,u),w=s._select.map(_=>_.alias).filter(_=>_!==u&&_!==c);return e2(s,b,u,c,w)}else return s.orderby(f)}};function KI(t,e=[]){return new e.constructor(t)}function JI(t,e,n){let r=KI(t,n),o=n.length;for(let i=0;i<o;++i)r[e[i]]=n[i];return r}function tC(t,e,n,r,o,i,s){let a=n.length,c=t*e,f=o.map(h=>r[h]),u={},p=[],l=new Int32Array(a);if(i?.length){let h=i.map(m=>r[m]),d={};for(let m=0;m<a;++m){let g=h.map(y=>y[m]);l[m]=d[g]??=p.push(g)-1}for(let m=0;m<i.length;++m)u[i[m]]=p.map(g=>g[m])}else p.push([]);if(s){let h=n.map(g=>g%t),d=n.map(g=>Math.floor(g/t)),m=p.map(()=>[]);for(let g=0;g<a;++g)m[l[g]].push(g);o.forEach((g,y)=>{let x=f[y];u[g]=p.map((b,w)=>s(m[w],t,e,h,d,x))})}else o.forEach((h,d)=>{let m=f[d],g=u[h]=p.map(()=>KI(c,m));for(let y=0;y<a;++y)g[l[y]][n[y]]=m[y]});return{numRows:p.length,columns:u}}function Hh(t){let e=1/0,n=-1/0;return t.forEach(r=>{let o=r.length;for(let i=0;i<o;++i){let s=r[i];s<e&&(e=s),s>n&&(n=s)}}),Number.isFinite(e)&&Number.isFinite(n)?[e,n]:[0,1]}function eC(t){let e=new wn;return t.forEach(n=>{let r=n.length;for(let o=0;o<r;++o)e.add(n[o])}),Array.from(e).sort(dt)}function he(t,e){return Wo(t)?(t.addEventListener("value",e),t.value):t}function Qh(t,e=!1){let n=new Float64Array(5),r=new Float64Array(4);tU(n,r,t);let o=Float64Array.of(0,r[1]-n[1]*r[0],r[2]-n[2]*r[0],r[3]-n[3]*r[0],-n[4]*r[0]),i=1+n[1]+n[2]+n[3]+n[4],s=(r[0]+r[1]+r[2]+r[3])/i,a=(o[1]+o[2]+o[3]+o[4])/i;return{sigma:t,negative:e,a:n,b_causal:r,b_anticausal:o,sum_causal:s,sum_anticausal:a}}function tU(t,e,n){let o=Float64Array.of(.84,1.8675,.84,-1.8675,-.34015,-.1299,-.34015,.1299),i=Math.exp(-1.783/n),s=Math.exp(-1.723/n),a=.6318/n,c=1.997/n,f=Float64Array.of(-i*Math.cos(a),i*Math.sin(a),-i*Math.cos(-a),i*Math.sin(-a),-s*Math.cos(c),s*Math.sin(c),-s*Math.cos(-c),s*Math.sin(-c)),u=n*2.5066282746310007,p=Float64Array.of(o[0],o[1],0,0,0,0,0,0),l=Float64Array.of(1,0,f[0],f[1],0,0,0,0,0,0),h,d;for(d=2;d<8;d+=2){for(p[d]=f[d]*p[d-2]-f[d+1]*p[d-1],p[d+1]=f[d]*p[d-1]+f[d+1]*p[d-2],h=d-2;h>0;h-=2)p[h]+=f[d]*p[h-2]-f[d+1]*p[h-1],p[h+1]+=f[d]*p[h-1]+f[d+1]*p[h-2];for(h=0;h<=d;h+=2)p[h]+=o[d]*l[h]-o[d+1]*l[h+1],p[h+1]+=o[d]*l[h+1]+o[d+1]*l[h];for(l[d+2]=f[d]*l[d]-f[d+1]*l[d+1],l[d+3]=f[d]*l[d+1]+f[d+1]*l[d],h=d;h>0;h-=2)l[h]+=f[d]*l[h-2]-f[d+1]*l[h-1],l[h+1]+=f[d]*l[h-1]+f[d+1]*l[h-2]}for(d=0;d<4;++d)h=d<<1,e[d]=p[h]/u,t[d+1]=l[h+2]}function nC(t,e,n,[r,o]){let i=new Float64Array(Math.max(r,o)),s=new Float64Array(Math.max(r,o)),a=new Float64Array(5),c=new Float64Array(n.length);for(let f=0,u=0;f<o;++f,u+=r){let p=c.subarray(u);z1(t,n.subarray(u),r,1,i,s,a,p)}for(let f=0;f<r;++f){let u=c.subarray(f);z1(e,u,o,r,i,s,a,u)}return c}function z1(t,e,n,r=1,o=new Float64Array(n),i=new Float64Array(n),s=new Float64Array(5),a=o,c=eU){let f=r*2,u=r*3,p=r*4,l=r*n,h,d;for(c(o,e,n,r,t.b_causal,3,t.a,4,t.sum_causal,s,t.sigma),d=4,h=p;d<n;++d,h+=r)o[d]=t.b_causal[0]*e[h]+t.b_causal[1]*e[h-r]+t.b_causal[2]*e[h-f]+t.b_causal[3]*e[h-u]-t.a[1]*o[d-1]-t.a[2]*o[d-2]-t.a[3]*o[d-3]-t.a[4]*o[d-4];for(c(i,e,n,-r,t.b_anticausal,4,t.a,4,t.sum_anticausal,s,t.sigma),d=4,h=l-r*5;d<n;++d,h-=r)i[d]=t.b_anticausal[1]*e[h+r]+t.b_anticausal[2]*e[h+f]+t.b_anticausal[3]*e[h+u]+t.b_anticausal[4]*e[h+p]-t.a[1]*i[d-1]-t.a[2]*i[d-2]-t.a[3]*i[d-3]-t.a[4]*i[d-4];if(t.negative)for(d=0,h=0;d<n;++d,h+=r)a[h]=o[d]+i[n-d-1];else for(d=0,h=0;d<n;++d,h+=r)a[h]=Math.max(0,o[d]+i[n-d-1]);return a}function eU(t,e,n,r,o,i,s,a,c,f,u,p=.5){let l=Math.abs(r)*n,h=r<0?l+r:0,d,m,g;for(m=0;m<=a;++m)for(f[m]=m<=i?o[m]:0,g=1;g<=a&&g<=m;++g)f[m]-=s[g]*f[m-g];for(g=0;g<a;++g)for(t[g]=0,m=1;m<=g;++m)d=h+r*m,d>=0&&d<l&&(t[g]+=f[g-m]*e[d]);let y=e[h],x=Math.ceil(u*10);for(m=0;m<x;++m){for(g=0;g<a;++g)t[g]+=f[g]*y;if(c-=Math.abs(f[0]),c<=p)break;for(f[a]=m+a<=i?o[m+a]:0,g=1;g<=a;++g)f[a]-=s[g]*f[a-g];for(g=0;g<a;++g)f[g]=f[g+1]}}var Br="density",zr=class extends Je{constructor(e,n,r){let{bandwidth:o=0,interpolate:i="none",pixelSize:s=1,pad:a=1,width:c,height:f,...u}=r,p=nU(u);super(e,n,u,B1),this.densityMap=p,this.bandwidth=he(o,l=>(this.bandwidth=l,this.grids?this.convolve().update():null)),this.interpolate=he(i,l=>(this.interpolate=l,this.requestUpdate())),this.pixelSize=he(s,l=>(this.pixelSize=l,this.requestUpdate())),this.pad=he(a,l=>(this.pad=l,this.requestUpdate())),this.width=he(c,l=>(this.width=l,this.requestUpdate())),this.height=he(f,l=>(this.height=l,this.requestUpdate()))}setPlot(e,n){let r=()=>{this.hasFieldInfo()&&this.requestUpdate()};e.addAttributeListener("xDomain",r),e.addAttributeListener("yDomain",r),super.setPlot(e,n)}get filterStable(){let e=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return e&&n&&!e[Ye]&&!n[Ye]}query(e=[]){let{interpolate:n,pad:r,channels:o,densityMap:i}=this,[s,a]=this.extentX=Lo(this,e),[c,f]=this.extentY=Oo(this,e),[u,p]=this.bins=this.binDimensions(),[l,h]=rr(this,"x",u,[s,a],r),[d,m]=rr(this,"y",p,[c,f],r),g=r?[gn(h,[+s,+a]),gn(m,[+c,+f])]:[Cr(+s,h),ue(h,+a),Cr(+c,m),ue(m,+f)],y=yt.from(this.sourceTable()).where(e.concat(g)),x=this.groupby=[],b={};for(let _ of o)if(Object.hasOwn(_,"field")){let{as:v,channel:A,field:E}=_;jn(E)?(b[A]=E,i[A]=!0):A==="weight"?b[Br]=zt(E):A!=="x"&&A!=="y"&&(y.select({[v]:E}),x.push(v))}let w=this.aggr=Object.keys(b);if(b.density&&w.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(w.length||(w.push(Br),b[Br]=rn()),n==="linear"){if(w.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!b[Br])throw new Error("Linear binning not applicable to custom aggregates.");let _=_c(b[Br])[0];return Jb(y,l,d,_,u,x)}else return Zb(y,l,d,b,u,x)}binDimensions(){let{plot:e,pixelSize:n,width:r,height:o}=this;return[r??Math.round(e.innerWidth()/n),o??Math.round(e.innerHeight()/n)]}queryResult(e){let[n,r]=this.bins,o=rU(this.interpolate),{columns:i}=cr(e);return this.grids0=tC(n,r,i.index,i,this.aggr,this.groupby,o),this.convolve()}convolve(){let{aggr:e,bandwidth:n,bins:r,grids0:o,plot:i}=this;if(this.grids=o,n>0){let s=e.length===1?e[0]:e.includes(Br)?Br:null;if(!s)return console.warn("No compatible grid found for smoothing."),this;let a=o.columns[s],c=i.innerWidth(),f=i.innerHeight(),[u,p]=r,l=a.some(m=>m.some(g=>g<0)),h=Qh(n*(u-1)/c,l),d=Qh(n*(p-1)/f,l);this.grids={numRows:o.numRows,columns:{...o.columns,[s]:a.map(m=>nC(h,d,m,r))}}}return this}};function nU(t){let e={};for(let n in t)t[n]==="density"&&(delete t[n],e[n]=!0);return e}function rU(t="none"){if(typeof t=="function")return t;switch(t.toLowerCase()){case"none":case"linear":return;case"nearest":return Rh;case"barycentric":return kh();case"random-walk":return Lh()}throw new Error(`invalid interpolate: ${t}`)}var E3=class extends zr{constructor(e,n){let{thresholds:r=10,...o}=n;super("geo",e,{bandwidth:20,interpolate:"linear",pixelSize:2,...o}),this.thresholds=he(r,i=>(this.thresholds=i,this.grids?this.contours().update():null))}convolve(){return super.convolve().contours()}contours(){let{bins:e,densityMap:n,grids:r,thresholds:o,plot:i}=this,{numRows:s,columns:a}=r,c=o,f;if(Array.isArray(c))f=c;else{let[,S]=Hh(a.density);f=Array.from({length:c-1},(k,L)=>S*(L+1)/c)}(n.fill||n.stroke)&&this.plot.getAttribute("colorScale")!=="log"&&this.plot.setAttribute("colorZero",!0);let[u,p]=e,[l,h]=i.getAttribute("xDomain"),[d,m]=i.getAttribute("yDomain"),g=(h-l)/u,y=(m-d)/p,x=+l,b=+d,w=S=>x+S*g,_=S=>b+S*y,v=Zi().size(e),A=this.contourData=Array(s*f.length),{density:E,...T}=a,C=Object.entries(T);for(let S=0,k=0;S<s;++S){let L=E[S],M=C.reduce((I,[N,R])=>(I[N]=R[S],I),{});for(let I=0;I<f.length;++I,++k)A[k]=Object.assign(oU(v.contour(L,f[I]),w,_),M)}return this}plotSpecs(){let{type:e,channels:n,densityMap:r,contourData:o}=this,i={};for(let s of n){let{channel:a}=s;a!=="x"&&a!=="y"&&(i[a]=dn(s))}for(let s in r)r[s]&&(i[s]=dn({channel:s,as:"value"}));return[{type:e,data:o,options:i}]}};function oU(t,e,n){function r(s){s.forEach(o)}function o(s){s.forEach(i)}function i(s){s[0]=e(s[0]),s[1]=n(s[1])}return t.coordinates.forEach(r),t}function Zh(t){return Array.from({length:t},(e,n)=>n)}function Y1(t,e){let n=e.reduce((o,i,s)=>(o[i]=s,o),{}),r=Zh(t.length);return r.sort((o,i)=>n[t[o]]-n[t[i]]),r}function U1(t,e){if(typeof document<"u"){let n=document.createElement("canvas");return n.setAttribute("width",t),n.setAttribute("height",e),n}throw new Error("Can not create a canvas instance.")}function rC(t=1){let e=255*t|0;return(n,r,o)=>{for(let i=0,s=0;i<o;++i)for(let a=0;a<r;++a,s+=4)n[s+3]=e}}function oC(t){let{apply:e}=t;return(n,r,o,i)=>{for(let s=0,a=0;s<o;++s)for(let c=0,f=(o-s-1)*r;c<r;++c,a+=4)n[a+3]=255*e(i[c+f])|0}}function iC(t={}){let{r:e=0,g:n=0,b:r=0,opacity:o=1}=typeof t=="string"?Ee(t):t,i=new Uint8ClampedArray([e,n,r,255*o|0]);return(s,a,c)=>{for(let f=0,u=0;f<c;++f)for(let p=0;p<a;++p,u+=4)s[u+0]=i[0],s[u+1]=i[1],s[u+2]=i[2],s[u+3]=i[3]}}function sC(t){let{domain:e,range:n}=t,r=Object.create(null),o=new Uint8ClampedArray(4*e.length),i=e.length-1,s=n.length;for(let a=0;a<=i;++a){let c=n[a%s],{r:f,g:u,b:p,opacity:l=1}=typeof c=="string"?Ee(c):c,h=a<<2;o[h+0]=f,o[h+1]=u,o[h+2]=p,o[h+3]=255*l|0,r[e[a]]=h}return(a,c,f,u)=>{if(u.map)for(let p=0,l=0;p<f;++p)for(let h=0,d=(f-p-1)*c;h<c;++h,l+=4){let m=r[u[h+d]];a[l+0]=o[m+0],a[l+1]=o[m+1],a[l+2]=o[m+2],a[l+3]=o[m+3]}else{let p=r[u];for(let l=0,h=0;l<f;++l)for(let d=0;d<c;++d,h+=4)a[h+0]=o[p+0],a[h+1]=o[p+1],a[h+2]=o[p+2],a[h+3]=o[p+3]}}}function aC(t,e,n){let{interpolate:r}=e,o=new Uint8ClampedArray(4*t),i=t-1;for(let s=0;s<=i;++s){let a=r(s/i),{r:c,g:f,b:u,opacity:p=1}=typeof a=="string"?Ee(a):a,l=s<<2;o[l+0]=c,o[l+1]=f,o[l+2]=u,o[l+3]=255*p|0}return(s,a,c,f)=>{for(let u=0,p=0;u<c;++u)for(let l=0,h=(c-u-1)*a;l<a;++l,p+=4){let d=i*n(f[l+h])<<2;s[p+0]=o[d+0],s[p+1]=o[d+1],s[p+2]=o[d+2],s[p+3]=o[d+3]}}}var fu=class extends zr{constructor(e,n){super("image",e,n),this.image=null}setPlot(e,n){let r=()=>{this.hasFieldInfo()&&this.rasterize()};e.addAttributeListener("schemeColor",r),super.setPlot(e,n)}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:e,grids:n}=this,[r,o]=e,{numRows:i,columns:s}=n,{canvas:a,ctx:c,img:f}=cU(this,r,o),{alpha:u,alphaProp:p,color:l,colorProp:h}=I3(this),d=s[p]??[],m=s[h]??[],g=i>1&&h&&this.groupby?.includes(h)?Y1(m,this.plot.getAttribute("colorDomain")):Zh(i);return this.data={numRows:i,columns:{src:Array.from({length:i},(y,x)=>(l?.(f.data,r,o,m[g[x]]),u?.(f.data,r,o,d[g[x]]),c.putImageData(f,0,0),a.toDataURL()))}},this}plotSpecs(){let{type:e,plot:n,data:{numRows:r,columns:o}}=this,i={src:o.src,width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:e,data:{length:r},options:i}]}},T3=class extends fu{constructor(e,n){super(e,{bandwidth:20,interpolate:"linear",pixelSize:2,...n})}};function I3(t){let{aggr:e,densityMap:n,groupby:r,plot:o}=t,i=e.includes(Br),s=e.includes("fillOpacity"),a=t.channel("fill"),c=t.channel("fillOpacity");if(e.length>2||i&&s)throw new Error("Invalid raster encodings. Try dropping an aggregate?");if(r.includes(c?.as))throw new Error("Raster fillOpacity must be an aggregate or constant.");let f=n.fill||e.includes("fill")?"grid":r.includes(a?.as)?"group":P1(a?.value)?a.value:i&&o.getAttribute("colorScheme")?"grid":void 0,u=n.fillOpacity||e.includes("fillOpacity")?"grid":typeof c?.value=="number"?c.value:i&&f!=="grid"?"grid":void 0;if(f!=="grid"&&u!=="grid")throw new Error("Raster mark missing density values.");let p=a?.as??(f==="grid"?Br:null),l=c?.as??(u==="grid"?Br:null),h=f!=="grid"&&f!=="group"?iC(f):sU(t,p),d=u!=="grid"?rC(u):iU(t,l);return{alphaProp:l,colorProp:p,alpha:d,color:h}}function iU(t,e){let{plot:n,grids:r}=t,o=n.getAttribute("opacityDomain"),i=o===Li,s=o?.[Ye],a=!i&&!s&&o||Hh(r.columns[e]);(i||s||!o)&&(i||(a[Ye]=!0),n.setAttribute("opacityDomain",a));let c=ys({opacity:{type:n.getAttribute("opacityScale"),domain:a,range:n.getAttribute("opacityRange"),clamp:n.getAttribute("opacityClamp"),nice:n.getAttribute("opacityNice"),reverse:n.getAttribute("opacityReverse"),zero:n.getAttribute("opacityZero"),base:n.getAttribute("opacityBase"),exponent:n.getAttribute("opacityExponent"),constant:n.getAttribute("opacityConstant")}});return oC(c)}function sU(t,e){let{plot:n,grids:r}=t,o=r.columns[e],i=!o[0]?.map,s=i||Array.isArray(o[0]),a=n.getAttribute("colorDomain"),c=a===Li,f=a?.[Ye],u=!c&&!f&&a||(i?o.slice().sort(dt):s?eC(o):Hh(o));(c||f||!a)&&(c||(u[Ye]=!0),n.setAttribute("colorDomain",u));let p=ys({color:{type:n.getAttribute("colorScale"),domain:u,range:n.getAttribute("colorRange"),clamp:n.getAttribute("colorClamp"),n:n.getAttribute("colorN"),nice:n.getAttribute("colorNice"),reverse:n.getAttribute("colorReverse"),scheme:n.getAttribute("colorScheme"),interpolate:n.getAttribute("colorInterpolate"),pivot:n.getAttribute("colorPivot"),symmetric:n.getAttribute("colorSymmetric"),zero:n.getAttribute("colorZero"),base:n.getAttribute("colorBase"),exponent:n.getAttribute("colorExponent"),constant:n.getAttribute("colorConstant")}});if(s)return sC(p);{let l=ys({x:{type:aU(p.type),domain:p.domain,reverse:p.reverse,range:[0,1],clamp:p.clamp,base:p.base,exponent:p.exponent,constant:p.constant}});return aC(1024,p,l.apply)}}function aU(t){return t.endsWith("symlog")?"symlog":t.endsWith("log")?"log":t.endsWith("pow")?"pow":t.endsWith("sqrt")?"sqrt":t==="diverging"?"linear":t}function cU(t,e,n){if(!t.image||t.image.w!==e||t.image.h!==n){let r=U1(e,n),o=r.getContext("2d",{willReadFrequently:!0}),i=o.getImageData(0,0,e,n);t.image={canvas:r,ctx:o,img:i,w:e,h:n}}return t.image}var C3=class extends fu{constructor(e,n){let{normalize:r=!0,...o}=n;super(e,o),this.normalize=he(r,i=>(this.normalize=i,this.requestUpdate()))}query(e=[]){let{channels:n,normalize:r,pad:o}=this,[i,s]=this.bins=this.binDimensions(),[a]=rr(this,"x",i,Lo(this,e),o),[c]=rr(this,"y",s,Oo(this,e),o),f=yt.from(this.sourceTable()).where(fU(this,e));this.aggr=["density"];let u=this.groupby=[],p=[];for(let l of n)if(Object.hasOwn(l,"field")){let{channel:h,field:d}=l;h==="z"?(f.select({[h]:d}),p.push("z")):h!=="x"&&h!=="y"&&(f.select({[h]:d}),u.push(h))}return t2(f,a,c,p,i,s,u,r)}};function fU(t,e){if(Array.isArray(e)&&!e.length)return e;let n=t.channelField("x").column,r=t.channelField("y").column,o=s=>{let a=`${s.expr}`;return s.type!=="BETWEEN"||a!==n&&a!==r},i=s=>s.op==="AND"?Dn(s.clauses.filter(a=>o(a))):s;return Array.isArray(e)?e.filter(s=>o(s)).map(s=>i(s)):i(e)}var N3=class extends Je{constructor(e,n,r){let{bins:o=1024,bandwidth:i=20,...s}=r,a=e.endsWith("X")?"y":"x";super(e,n,s,a==="x"?_3:M3),this.dim=a,this.bins=he(o,c=>(this.bins=c,this.requestUpdate())),this.bandwidth=he(i,c=>(this.bandwidth=c,this.grid?this.convolve().update():null))}get filterStable(){let e=this.dim==="x"?"xDomain":"yDomain",n=this.plot.getAttribute(e);return n&&!n[Ye]}query(e=[]){if(this.hasOwnData())throw new Error("Density1DMark requires a data source");let{bins:n,channels:r,dim:o}=this,i=this.extent=(o==="x"?Lo:Oo)(this,e),[s,a]=rr(this,o,n,i),c=Vh(r,this.sourceTable(),[o]).where(e.concat(gn(a,i))),f=this.channelField("weight")?"weight":null;return Kb(c,s,f)}queryResult(e){let{columns:{index:n,density:r}}=cr(e);return this.grid=JI(this.bins,n,r),this.convolve()}convolve(){let{bins:e,bandwidth:n,dim:r,grid:o,plot:i,extent:[s,a]}=this,c=o.some(b=>b<0),f=r==="x"?i.innerWidth():i.innerHeight(),u=Qh(n*(e-1)/f,c),p=z1(u,o,e),l=r==="x"?"y":"x",h=this.channelField(r).as,d=+s,m=(a-d)/(e-1),g=1/m,y=new Float64Array(e),x=new Float64Array(e);for(let b=0;b<e;++b)y[b]=d+b*m,x[b]=p[b]*g;return this.data={numRows:e,columns:{[h]:y,[l]:x}},this}plotSpecs(){let{type:e,data:{numRows:n,columns:r},channels:o,dim:i}=this,s=i==="x"?{y:r.y}:{x:r.x};for(let a of o)s[a.channel]=dn(a,r);return[{type:e,data:{length:n},options:s}]}};var k3=class extends zr{constructor(e,n){let{type:r="dot",...o}=n;super(r,e,{bandwidth:20,interpolate:"linear",pad:0,pixelSize:2,...o})}convolve(){super.convolve();let{bins:e,pad:n,extentX:r,extentY:o}=this,[i,s]=e,a=ec(this,"x"),c=ec(this,"y"),[f,u]=r.map(g=>a.apply(g)),[p,l]=o.map(g=>c.apply(g)),h=(u-f)/(i-n),d=(l-p)/(s-n),m=n?0:.5;return this.data=uU(this.grids,e,f,p,h,d,a.invert,c.invert,m),this}plotSpecs(){let{type:e,channels:n,densityMap:r,data:{numRows:o,columns:i}}=this,s={};for(let a of n){let{channel:c}=a;s[c]=c==="x"||c==="y"?i[c]:dn(a,i)}for(let a in r)r[a]&&(s[a]=i.density);return[{type:e,data:{length:o},options:s}]}};function uU(t,e,n,r,o,i,s,a,c){let f=1/(o*i),[u,p]=e,l=u*p,h=l*t.numRows,d=new Float64Array(h),m=new Float64Array(h),g=new Float64Array(h),y={x:d,y:m,density:g},{density:x,...b}=t.columns;for(let _ in b)y[_]=new b[_].constructor(h);let w=0;for(let _=0;_<t.numRows;++_){for(let A in b)y[A].fill(b[A][_],w,w+l);let v=x[_];for(let A=0,E=0;E<p;++E)for(let T=0;T<u;++T,++w,++A)d[w]=s(n+(T+c)*o),m[w]=a(r+(E+c)*i),g[w]=v[A]*f}return{numRows:h,columns:y}}function lU(t,e,n){var r=1e-8,o=e-1,i=n-1,s=0,a,c,f,u,p,l,h,d,m,g,y;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&n>=1?(f=t<.5?t:1-t,u=Math.sqrt(-2*Math.log(f)),h=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,t<.5&&(h=-h),d=(h*h-3)/6,m=2/(1/(2*e-1)+1/(2*n-1)),g=h*Math.sqrt(d+m)/m-(1/(2*n-1)-1/(2*e-1))*(d+5/6-2/(3*m)),h=e/(e+n*Math.exp(2*g))):(a=Math.log(e/(e+n)),c=Math.log(n/(e+n)),u=Math.exp(e*a)/e,p=Math.exp(n*c)/n,g=u+p,t<u/g?h=Math.pow(e*g*t,1/e):h=1-Math.pow(n*g*(1-t),1/n)),y=-uu(e)-uu(n)+uu(e+n);s<10;s++){if(h===0||h===1)return h;if(l=pU(h,e,n)-t,u=Math.exp(o*Math.log(h)+i*Math.log(1-h)+y),p=l/u,h-=u=p/(1-.5*Math.min(1,p*(o/h-i/(1-h)))),h<=0&&(h=.5*(h+u)),h>=1&&(h=.5*(h+u+1)),Math.abs(u)<r*h&&s>0)break}return h}function pU(t,e,n){var r=t===0||t===1?0:Math.exp(uu(e+n)-uu(e)-uu(n)+e*Math.log(t)+n*Math.log(1-t));return t<0||t>1?0:t<(e+1)/(e+n+2)?r*cC(t,e,n)/e:1-r*cC(1-t,n,e)/n}function cC(t,e,n){var r=1e-30,o=1,i=e+n,s=e+1,a=e-1,c=1,f=1-i*t/s,u,p,l,h;for(Math.abs(f)<r&&(f=r),f=1/f,h=f;o<=100&&(u=2*o,p=o*(n-o)*t/((a+u)*(e+u)),f=1+p*f,Math.abs(f)<r&&(f=r),c=1+p/c,Math.abs(c)<r&&(c=r),f=1/f,h*=f*c,p=-(e+o)*(i+o)*t/((e+u)*(s+u)),f=1+p*f,Math.abs(f)<r&&(f=r),c=1+p/c,Math.abs(c)<r&&(c=r),f=1/f,l=f*c,h*=l,!(Math.abs(l-1)<3e-7));o++);return h}function uu(t){var e=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,o,i,s;for(s=(i=o=t)+5.5,s-=(o+.5)*Math.log(s);e<6;e++)r+=n[e]/++i;return Math.log(2.506628274631*r/o)-s}function fC(t,e){var n=lU(2*Math.min(t,1-t),.5*e,.5);return n=Math.sqrt(e*(1-n)/n),t>.5?n:-n}function uC(t){let e=-Math.log((1-t)*(1+t)),n;return e<6.25?(e-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*e,n=128584807152564e-32+n*e,n=11157877678025181e-33+n*e,n=-1333171662854621e-31+n*e,n=20972767875968562e-33+n*e,n=6637638134358324e-30+n*e,n=-4054566272975207e-29+n*e,n=-8151934197605472e-29+n*e,n=26335093153082323e-28+n*e,n=-12975133253453532e-27+n*e,n=-5415412054294628e-26+n*e,n=10512122733215323e-25+n*e,n=-4112633980346984e-24+n*e,n=-29070369957882005e-24+n*e,n=42347877827932404e-23+n*e,n=-13654692000834679e-22+n*e,n=-13882523362786469e-21+n*e,n=.00018673420803405714+n*e,n=-.000740702534166267+n*e,n=-.006033670871430149+n*e,n=.24015818242558962+n*e,n=1.6536545626831027+n*e):e<16?(e=Math.sqrt(e)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*e,n=-27517406297064545e-23+n*e,n=18239629214389228e-24+n*e,n=15027403968909828e-22+n*e,n=-4013867526981546e-21+n*e,n=29234449089955446e-22+n*e,n=12475304481671779e-21+n*e,n=-47318229009055734e-21+n*e,n=6828485145957318e-20+n*e,n=24031110387097894e-21+n*e,n=-.0003550375203628475+n*e,n=.0009532893797373805+n*e,n=-.0016882755560235047+n*e,n=.002491442096107851+n*e,n=-.003751208507569241+n*e,n=.005370914553590064+n*e,n=1.0052589676941592+n*e,n=3.0838856104922208+n*e):Number.isFinite(e)?(e=Math.sqrt(e)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*e,n=15076572693500548e-25+n*e,n=-3789465440126737e-24+n*e,n=761570120807834e-23+n*e,n=-1496002662714924e-23+n*e,n=2914795345090108e-23+n*e,n=-6771199775845234e-23+n*e,n=22900482228026655e-23+n*e,n=-99298272942317e-20+n*e,n=4526062597223154e-21+n*e,n=-1968177810553167e-20+n*e,n=7599527703001776e-20+n*e,n=-.00021503011930044477+n*e,n=-.00013871931833623122+n*e,n=1.0103004648645344+n*e,n=4.849906401408584+n*e):n=1/0,n*t}var R3=class extends Je{constructor(e,n,r){let o=e.endsWith("X")?"y":"x",{ci:i=.95,...s}=r;super(e,n,s),this.dim=o,this.field=this.channelField(o).field,this.channels=this.channels.filter(a=>a.channel!==o),this.ci=he(i,a=>(this.ci=a,this.update()))}query(e=[]){let{channels:n,field:r}=this,o=n.concat([{field:Rb(r),as:"__avg__"},{field:Lt(Pb(r),Uo(rn(r))),as:"__se__"}]);return Vh(o,this.sourceTable()).where(e)}queryResult(e){return this.data=cr(e),this}plotSpecs(){let{type:e,dim:n,detail:r,data:o,ci:i,channels:s}=this,a=Math.SQRT2*uC(i),{columns:{__avg__:c,__se__:f}}=o,u={[`${n}1`]:c.map((p,l)=>p-a*f[l]),[`${n}2`]:c.map((p,l)=>p+a*f[l])};return v3(e,r,s,o,u)}};var hU="geom",L3=class extends Je{constructor(e,n={},r){!q1(e)&&!n?.geometry&&(n.geometry=Gb(hU)),super("geo",e,n,r)}queryResult(e){super.queryResult(e);let n=this.channelField("geometry")?.as;if(n){let{columns:r}=this.data;typeof r[n][0]=="string"&&(r[n]=r[n].map(o=>JSON.parse(o)))}return this}};var O3=class extends Je{constructor(e,n){let{type:r="hexagon",binWidth:o=20,...i}=n;super(r,e,{r:o/2,clip:!0,...i},B1),this.binWidth=he(o,s=>(this.binWidth=s,this.requestUpdate()))}get filterStable(){let e=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return e&&n&&!e[Ye]&&!n[Ye]}query(e=[]){if(this.hasOwnData())return null;let{plot:n,binWidth:r,channels:o}=this,i,s,a=new Set,c={};for(let C of o)if(C.channel!=="orderby"){if(C.channel==="x")i=C;else if(C.channel==="y")s=C;else if(Object.hasOwn(C,"field")){let{as:S,field:k}=C;c[S]=k,jn(k)||a.add(S)}}let[f,u]=Lo(this,e),[p,l]=Oo(this,e),h=.5-n.getAttribute("marginLeft"),d=0-n.getAttribute("marginTop"),m=de(r),g=de(r*(1.5/Math.sqrt(3))),y=de(n.innerWidth()/(u-f)),x=de(n.innerHeight()/(l-p)),b="_x",w="_y",_="_px",v="_py",A="_pi",E="_pj",T="_tt";return yt.select({[i.as]:Nt(de(f),Lt(Nt(pt(Nt(b,pt(.5,nl(w,1))),m),h),y)),[s.as]:ut(de(l),Lt(Nt(pt(w,g),d),x)),...c}).groupby(b,w,...a).from(yt.select({[v]:Lt(pt(x,ut(ut(l,s.field),d)),g),[E]:Ht(jo(v)),[_]:ut(Lt(ut(pt(y,ut(i.field,f)),h),m),pt(.5,nl(E,1))),[A]:Ht(jo(_)),[T]:Dn(Hr(pt(ke(ut(v,E)),3),1),Hr(Nt(me(ut(_,A),2),me(ut(v,E),2)),Nt(me(ut(ut(_,A),pt(.5,Yo(ue(_,A),-1,1))),2),me(ut(ut(v,E),Yo(ue(v,E),-1,1)),2)))),[b]:Yo(T,Ht(Nt(Nt(A,Yo(ue(_,A),-.5,.5)),Yo(Xo(nl(E,1),0),.5,-.5))),A),[w]:Yo(T,Ht(Nt(E,Yo(ue(v,E),-1,1))),E)},"*").from(this.sourceTable()).where(Vr(i.field),Vr(s.field),e))}};var $3=class extends zr{constructor(e,n){let{origin:r=[0,0],dim:o="xy",...i}=n;super("image",e,i),this.image=null,this.origin=r,this.tileX=o.toLowerCase().includes("x"),this.tileY=o.toLowerCase().includes("y")}setPlot(e,n){let r=()=>{this.hasFieldInfo()&&this.rasterize()};e.addAttributeListener("schemeColor",r),super.setPlot(e,n)}requestQuery(){return this.requestTiles()}query(e=[]){return this._filter=e,null}tileQuery(e){let{interpolate:n,pad:r,channels:o,densityMap:i}=this,[[s,a],[c,f]]=e,[u,p]=this.bins,[l,h]=rr(this,"x",u,[s,a],r),[d,m]=rr(this,"y",p,[c,f],r),g=r?[gn(h,[+s,+a]),gn(m,[+c,+f])]:[Cr(+s,h),ue(h,+a),Cr(+c,m),ue(m,+f)],y=yt.from(this.sourceTable()).where(g),x=this.groupby=[],b={};for(let _ of o)if(Object.hasOwn(_,"field")){let{as:v,channel:A,field:E}=_;E.aggregate?(b[A]=E,i[A]=!0):A==="weight"?b.density=zt(E):A!=="x"&&A!=="y"&&(y.select({[v]:E}),x.push(v))}let w=this.aggr=Object.keys(b);if(b.density&&w.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(w.length||(w.push("density"),b.density=rn()),n==="linear"){if(w.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!b.density)throw new Error("Linear binning not applicable to custom aggregates.");return xU(y,l,d,b.density,u,x)}else return yU(y,l,d,b,u,x)}async requestTiles(){let e=s2();this.prefetch&&e.cancel(this.prefetch);let{pad:n,tileX:r,tileY:o,origin:[i,s]}=this,[a,c]=this.bins=this.binDimensions(),[f,u]=Lo(this,this._filter),[p,l]=Oo(this,this._filter),h=u-f,d=l-p,m=Math.floor((f-i)*(a-n)/h),g=Math.floor((p-s)*(c-n)/d),y=(S,k)=>[[i+S*h,i+(S+1)*h],[s+k*d,s+(k+1)*d]],x=Math.floor((f-i)/h),b=r?lC((u-i)/h):x,w=Math.floor((p-s)/d),_=o?lC((l-s)/d):w,v=[];for(let S=x;S<=b;++S)for(let k=w;k<=_;++k)v.push([S,k]);let A=v.map(([S,k])=>e.query(this.tileQuery(y(S,k)))),E=[];if(r)for(let S=w;S<=_;++S)E.push([b+1,S]),E.push([x-1,S]);if(o){let S=r?x-1:x,k=r?b+1:b;for(let L=S;L<=k;++L)E.push([L,_+1]),E.push([L,w-1])}this.prefetch=E.map(([S,k])=>e.prefetch(this.tileQuery(y(S,k))));let T=await Promise.all(A),C=dU(a,c,m,g,v,T);this.grids0={numRows:C.length,columns:{density:[C]}},this.convolve().update()}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:e,grids:n}=this,[r,o]=e,{numRows:i,columns:s}=n,{canvas:a,ctx:c,img:f}=gU(this,r,o),{alpha:u,alphaProp:p,color:l,colorProp:h}=I3(this),d=s[p]??[],m=s[h]??[],g=i>1&&h&&this.groupby?.includes(h)?Y1(m,this.plot.getAttribute("colorDomain")):Zh(i);return this.data={numRows:i,columns:{src:Array.from({length:i},(y,x)=>(l?.(f.data,r,o,m[g[x]]),u?.(f.data,r,o,d[g[x]]),c.putImageData(f,0,0),a.toDataURL()))}},this}plotSpecs(){let{type:e,plot:n,data:{numRows:r,columns:o}}=this,i={src:o.src,width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:e,data:{length:r},options:i}]}};function dU(t,e,n,r,o,i){let s=new Float64Array(t*e);return i.forEach((a,c)=>{let[f,u]=o[c],p=f*t-n,l=u*e-r;mU(t,e,s,a,p,l)}),s}function mU(t,e,n,r,o,i){let s=r.numRows;if(s===0)return;let a=r.getChild("index").toArray(),c=r.getChild("density").toArray();for(let f=0;f<s;++f){let u=a[f],p=o+u%t,l=i+Math.floor(u/t);0<=p&&p<t&&0<=l&&l<e&&(n[p+l*t]=c[f])}}function gU(t,e,n){if(!t.image||t.image.w!==e||t.image.h!==n){let r=U1(e,n),o=r.getContext("2d",{willReadFrequently:!0}),i=o.getImageData(0,0,e,n);t.image={canvas:r,ctx:o,img:i,w:e,h:n}}return t.image}function yU(t,e,n,r,o,i){return t.select({index:Ae`FLOOR(${e})::INTEGER + FLOOR(${n})::INTEGER * ${o}`,...r}).groupby("index",i)}function xU(t,e,n,r,o,i){let s=r.column?`* ${r.column}`:"",a=(l,h)=>t.clone().select({xp:e,yp:n,i:l,w:h}),c=a(Ae`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${o}`,Ae`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(Ae`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${o}`,Ae`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(Ae`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${o}`,Ae`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),p=a(Ae`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${o}`,Ae`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return yt.from(yt.unionAll(c,f,u,p)).select({index:"i",density:zt("w")},i).groupby("index",i).having(Xo("density",0))}function lC(t){let e=Math.floor(t);return e===t?e-1:e}var F3=class extends Je{constructor(e,n){let{ci:r=.95,precision:o=4,...i}=n;super("line",e,i);let s=()=>this.modelFit?this.confidenceBand().update():null;this.ci=he(r,a=>(this.ci=a,s())),this.precision=he(o,a=>(this.precision=a,s()))}query(e=[]){let n=this.channelField("x").as,r=this.channelField("y").as,o=Array.from(new Set(["stroke","z","fx","fy"].flatMap(i=>this.channelField(i)?.as||[])));return yt.from(super.query(e)).select({intercept:Ob(r,n),slope:Fb(r,n),n:tl(r,n),ssy:Db(r,n),ssx:$b(r,n),xm:Ju(r,n),x0:de(Wr(n).where(Vr(r))),x1:de(Un(n).where(Vr(r)))}).select(o).groupby(o)}queryResult(e){return this.modelFit=cr(e),this.lineData=bU(this.modelFit),this.confidenceBand()}confidenceBand(){let{ci:e,modelFit:n,precision:r,plot:o}=this,i=o.innerWidth();return this.areaData=e?wU(n,e,r,i):null,this}plotSpecs(){let{lineData:e,areaData:n,channels:r,ci:o}=this,i=e.columns,s=o?n.columns:{},a={x:i.x,y:i.y},c={x:s.x,y1:s.y1,y2:s.y2,fillOpacity:.1};for(let f of r)switch(f.channel){case"x":case"y":case"fill":break;case"tip":c.tip=dn(f,s);break;case"stroke":a.stroke=dn(f,i),c.fill=dn(f,s);break;case"strokeOpacity":a.strokeOpacity=dn(f,i);break;case"fillOpacity":c.fillOpacity=dn(f,s);break;default:a[f.channel]=dn(f,i),c[f.channel]=dn(f,s);break}return[...o?[{type:"areaY",data:{length:n.numRows},options:c}]:[],{type:"line",data:{length:e.numRows},options:a}]}};function D3(t,e){if(t.concat)return t.concat(e);let n=new t.constructor(t.length+e.length);return n.set(t,0),n.set(e,t.length),n}function bU(t){let{x0:e=[],x1:n=[],xm:r,intercept:o,slope:i,n:s,ssx:a,ssy:c,...f}=t.columns,u=(h,d)=>o[d]+h*i[d],p=D3(e,n),l=D3(e.map(u),n.map(u));for(let h in f)f[h]=D3(f[h],f[h]);return{numRows:p.length,columns:{x:p,y:l,...f}}}function wU(t,e,n,r){let o=t.numRows,{x0:i,x1:s,xm:a,intercept:c,slope:f,n:u,ssx:p,ssy:l,...h}=t.columns,d=Object.keys(h),m={x:[],y1:[],y2:[]};d.forEach(g=>m[g]=[]);for(let g=0;g<o;++g){let y=n*(s[g]-i[g])/r,x=fC((1-e)/2,u[g]-2)*Math.sqrt(l[g]/(u[g]-2));le(i[g],s[g]-y/2,y).concat(s[g]).forEach(b=>{let w=c[g]+b*f[g],_=x*Math.sqrt(1/u[g]+(b-a[g])**2/p[g]);m.x.push(b),m.y1.push(w-_),m.y2.push(w+_),d.forEach(v=>m[v].push(h[v][g]))})}return{numRows:m.x.length,columns:m}}function lu(t){t.tagName==="a"&&(t=t.children[0]);let e=t.__data__;return Array.isArray(e)?e[0]:e}function pC(t){let e=t.toLowerCase(),n=t.length,r="";for(let o=0;o<n;++o)r+=(t[o]!==e[o]?"-":"")+e[o];return r}function Fs(t){let e={};for(let n in t)e[pC(n)]=t[n];return e}function vU(t){let{channels:e}=t,n=new Set,r=!1,o=!1;for(let i of e){let{channel:s,field:a,as:c}=i;if(s==="orderby")r=!0;else if(a)if(jn(a))o=!0;else{if(n.has(c))continue;n.add(c)}}return!r&&o&&n.size&&t.channels.push({channel:"orderby",value:Array.from(n)}),t}var P3=class{constructor(e,{selection:n,channels:r={}}){this.mark=vU(e),this.selection=n;let o=Object.entries(Fs(r));this.channels=o.length?o:[["opacity",.2]],this.selection.addEventListener("value",hu(()=>this.update()))}init(e){this.svg=e;let n=this.values=[],o=`g[data-index="${this.mark.index}"]`,i=`${o} > *:not(g), ${o} > g > *`,s=this.nodes=e.querySelectorAll(i),{channels:a}=this;for(let c=0;c<s.length;++c){let f=s[c];n.push(a.map(u=>f.getAttribute(u[0])))}return this.update()}async update(){let{svg:e,nodes:n,channels:r,values:o,mark:i,selection:s}=this;if(!e)return;let a=await _U(i,s);for(let c=0;c<n.length;++c){let f=n[c],u=o[c],p=a(lu(f));for(let l=0;l<r.length;++l){let[h,d]=r[l];f.setAttribute(h,p?u[l]:d)}}}};async function _U(t,e){let n=e?.predicate(t);if(!n||n.length===0)return()=>!0;let r=t.filterBy?.predicate(t,!0),o={__:Dn(n)},i=t.query(r);(i.queries||[i]).forEach(c=>{c._groupby.length?c.select(o):c.setSelect(o)});let s=await t.coordinator.query(i),a=s.getChild?.("__");return s.numRows||s.length?a?c=>a.at(c):c=>s[c].__:()=>!1}function j1(){let t=this,e=t.getScreenCTM,n;t.getScreenCTM=()=>t.isConnected?n=e.call(t):n}function q3(t){let e=t.on,n=!0;function r(o){n=!1,o(),n=!0}return t.reset=(...o)=>{r(()=>t.clear(...o))},t.moveSilent=(...o)=>{r(()=>t.move(...o))},t.on=(...o)=>{if(o.length>1&&o[1]){let i=o[1];o[1]=(...s)=>n&&i(...s)}return e(...o)},t}function X1(){return q3(Q2())}function hC(){return q3(V2())}function dC(){return q3(H2())}function W1(t,e,n,r,o){let i=At(e??t).append("g").attr("class",o),s=t.scale("fx"),a=t.scale("fy");if(s||a){let c=s?.domain.map(u=>s.apply(u)-n),f=a?.domain.map(u=>a.apply(u)-r);if(c&&f)for(let u=0;u<c.length;++u)for(let p=0;p<f.length;++p)i.append("g").attr("transform",`translate(${c[u]}, ${f[p]})`);else if(c)for(let u=0;u<c.length;++u)i.append("g").attr("transform",`translate(${c[u]}, 0})`);else if(f)for(let u=0;u<f.length;++u)i.append("g").attr("transform",`translate(0, ${f[u]})`);i=i.selectAll("g")}return i.each(j1)}function Kh(t,e){return t===e||t&&e&&Math.abs(t[0]-e[0])<1e-12&&Math.abs(t[1]-e[1])<1e-12||!1}function mC(t){if(en(t)){if(t.type==="COLUMN_REF")return t.column;if(t.type==="AGGREGATE")return t.args[0]??t}return t}function $o(t,e){return mC(t.channelField(e)?.field)}function gC(t,e){let n=[],r=[];return e.forEach(o=>{let i=o==="color"?["color","fill","stroke"]:o==="x"?["x","x1","x2"]:o==="y"?["y","y1","y2"]:[o];for(let s=0;s<i.length;++s){let a=t.channelField(i[s],{exact:!0});if(a){n.push(mC(a.field)),r.push(a.as);return}}throw new Error(`Missing channel: ${o}`)}),{fields:n,as:r}}function Jh(t,e,n=1){return e.invert(n*Math.floor(t/n))}var td=class{constructor(e,{channel:n,selection:r,field:o=void 0,pixelSize:i=1,peers:s=!0,brush:a}){this.mark=e,this.channel=n,this.pixelSize=i||1,this.selection=r,this.peers=s,this.field=o||$o(e,n),this.style=a&&Fs(a),this.brush=n==="y"?dC():hC(),this.brush.on("brush end",({selection:c})=>this.publish(c))}reset(){this.value=void 0,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause(this.value||[0,1]))}publish(e){let n;e&&(n=e.map(r=>Jh(r,this.scale,this.pixelSize)).sort((r,o)=>r-o)),Kh(n,this.value)||(this.value=n,this.g.call(this.brush.moveSilent,e),this.selection.update(this.clause(n)))}clause(e){let{mark:n,pixelSize:r,field:o,scale:i}=this;return al(o,e,{source:this,clients:this.peers?n.plot.markSet:new Set().add(n),scale:i,pixelSize:r})}init(e,n){let{brush:r,channel:o,style:i}=this;this.scale=e.scale(o);let s=this.value?.map(this.scale.apply).sort(dt),a=e.scale("x").range,c=e.scale("y").range;if(r.extent([[St(a),St(c)],[It(a),It(c)]]),this.g=W1(e,n,St(a),St(c),`interval-${o}`).call(r).call(r.moveSilent,s),i){let f=this.g.selectAll("rect.selection");for(let u in i)f.attr(u,i[u])}e.addEventListener("pointerenter",f=>{f.buttons||this.activate()})}};var B3=class{constructor(e,{selection:n,xfield:r,yfield:o,pixelSize:i=1,peers:s=!0,brush:a}){this.mark=e,this.pixelSize=i||1,this.selection=n,this.peers=s,this.xfield=r||$o(e,"x"),this.yfield=o||$o(e,"y"),this.style=a&&Fs(a),this.brush=X1(),this.brush.on("brush end",({selection:c})=>this.publish(c))}reset(){this.value=void 0,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause(this.value||[[0,1],[0,1]]))}publish(e){let{value:n,pixelSize:r,xscale:o,yscale:i}=this,s,a;if(e){let[c,f]=e;s=[c[0],f[0]].map(u=>Jh(u,o,r)).sort(dt),a=[c[1],f[1]].map(u=>Jh(u,i,r)).sort(dt)}(!Kh(s,n?.[0])||!Kh(a,n?.[1]))&&(this.value=e?[s,a]:void 0,this.g.call(this.brush.moveSilent,e),this.selection.update(this.clause(this.value)))}clause(e){let{mark:n,pixelSize:r,xfield:o,yfield:i,xscale:s,yscale:a}=this;return u2([o,i],e,{source:this,clients:this.peers?n.plot.markSet:new Set().add(n),scales:[s,a],pixelSize:r})}init(e){let{brush:n,style:r,value:o}=this,i=this.xscale=e.scale("x"),s=this.yscale=e.scale("y"),a=i.range,c=s.range;if(n.extent([[St(a),St(c)],[It(a),It(c)]]),this.g=W1(e,null,St(a),St(c),"interval-xy").call(n),r){let f=this.g.selectAll("rect.selection");for(let u in r)f.attr(u,r[u])}if(o){let[f,u]=o[0].map(i.apply).sort(dt),[p,l]=o[1].map(s.apply).sort(dt);this.g.call(n.moveSilent,[[f,p],[u,l]])}e.addEventListener("pointerenter",f=>{f.buttons||this.activate()})}};var z3=class{constructor(e,{selection:n,pointer:r,channels:o,fields:i,maxRadius:s=40}){this.mark=e,this.selection=n,this.clients=new Set().add(e),this.pointer=r,this.channels=o||(r==="x"?["x"]:r==="y"?["y"]:["x","y"]),this.fields=i||this.channels.map(a=>$o(e,[a])),this.maxRadius=s,this.valueIndex=-1}clause(e){let{clients:n,fields:r}=this,o={source:this,clients:n};return r.length>1?ea(r,e&&[e],o):f2(r[0],e?.[0],o)}init(e){let n=this,{mark:r,channels:o,selection:i,maxRadius:s}=this,{data:{columns:a}}=r,c=o.map(m=>r.channelField(m).as),f=!c2(i),[u,p]=MU(e,r),l=this.pointer==="y"?.01:1,h=this.pointer==="x"?.01:1,d=At(e);d.on("pointerenter pointerdown pointermove",function(m){let[g,y]=on(m,this),x=SU(u,p,g,y,l,h,s);if(x!==this.valueIndex){this.valueIndex=x;let b=x<0?void 0:c.map(w=>a[w][x]);i.update(f?!b||b.length>1?b:b[0]:n.clause(b))}}),!f&&(d.on("pointerleave",()=>{i.update(n.clause(void 0))}),e.addEventListener("pointerenter",m=>{if(!m.buttons){let g=this.channels.map(()=>0);i.activate(this.clause(g))}}))}};function MU(t,e){let{data:{columns:n}}=e,r=p=>n[e.channelField(p)?.as],o=p=>t.scale(p),i=t.scale("x"),s=t.scale("y"),a=o("fx")?.apply,c=o("fy")?.apply,f=Array.from(r("x"),i.apply),u=Array.from(r("y"),s.apply);if(a){let p=St(i.range),l=r("fx");for(let h=0;h<l.length;++h)f[h]+=a(l[h])-p}if(c){let p=St(s.range),l=r("fy");for(let h=0;h<l.length;++h)u[h]+=c(l[h])-p}return[f,u]}function SU(t,e,n,r,o,i,s){let a=s*s,c=-1;for(let f=0;f<t.length;++f){let u=o*(t[f]-n),p=i*(e[f]-r),l=u*u+p*p;l<=a&&(a=l,c=f)}return c}var yC=(t,e)=>t-e,U3=class{constructor(e,{x:n=new Yi,y:r=new Yi,xfield:o,yfield:i,zoom:s=!0,panx:a=!0,pany:c=!0}){this.mark=e,this.xsel=n,this.ysel=r,this.xfield=o||$o(e,"x"),this.yfield=i||$o(e,"y"),this.zoom=Y3(s,[0,1/0],[1,1]),this.panx=this.xsel&&a,this.pany=this.ysel&&c;let{plot:f}=e;a&&this.xsel.addEventListener("value",u=>{f.setAttribute("xDomain",u)&&f.update()}),c&&this.ysel.addEventListener("value",u=>{f.setAttribute("yDomain",u)&&f.update()})}publish(e){if(this.panx){let n=AU(e,this.xscale);this.xsel.update(this.clause(n,this.xfield,this.xscale))}if(this.pany){let n=EU(e,this.yscale);this.ysel.update(this.clause(n,this.yfield,this.yscale))}}clause(e,n,r){return al(n,e,{source:this,clients:this.mark.plot.markSet,scale:r})}init(e){if(this.svg=e,this.initialized)return;this.initialized=!0;let{panx:n,pany:r,mark:{plot:{element:o}},xsel:i,ysel:s}=this;this.xscale=e.scale("x"),this.yscale=e.scale("y");let a=this.xscale.range.slice().sort(yC),c=this.yscale.range.slice().sort(yC),f=Y3(n,[-1/0,1/0],a),u=Y3(r,[-1/0,1/0],c),p=h_().extent([[a[0],c[0]],[a[1],c[1]]]).scaleExtent(this.zoom).translateExtent([[f[0],u[0]],[f[1],u[1]]]).on("start",()=>{this.xscale=this.svg.scale("x"),this.yscale=this.svg.scale("y")}).on("end",()=>o.__zoom=new Qn(1,0,0)).on("zoom",({transform:l})=>this.publish(l));if(At(o).call(p),n||r){let l=!1;o.addEventListener("pointerenter",h=>{if(!l&&(l=!0,!h.buttons)){if(n){let{xscale:d,xfield:m}=this;i.activate(this.clause(d.domain,m,d))}if(r){let{yscale:d,yfield:m}=this;s.activate(this.clause(d.domain,m,d))}}}),o.addEventListener("pointerleave",()=>l=!1)}}};function Y3(t,e,n){return t?Array.isArray(t)?t:e:n}function AU(t,e){return e.range.map(t.invertX,t).map(e.invert,e)}function EU(t,e){return e.range.map(t.invertY,t).map(e.invert,e)}var TU={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},IU=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,CU=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,NU=/^((\s+,?\s*)|(,\s*))/,kU=/^[01]/,xC=t=>`Invalid SVG path, incorrect parameter ${t}`;function bC(t){let e=[];return(t.match(IU)||[]).forEach(r=>{let o=r[0],i=o.toLowerCase(),s=TU[i],a=RU(i,s,r.slice(1).trim()),c=a.length;if(c<s||c&&c%s!==0)throw new Error(xC("count"));if(e.push([o,...a.slice(0,s)]),c!==s){i==="m"&&(o=o==="M"?"L":"l");for(let f=s;f<c;f+=s)e.push([o,...a.slice(f,f+s)])}}),e}function RU(t,e,n){let r=[];for(let o=0;e&&o<n.length;)for(let i=0;i<e;++i){let s=t==="a"&&(i===3||i===4)?kU:CU,a=n.slice(o).match(s);if(a===null)throw new Error(xC("type"));o+=a[0].length,r.push(+a[0]);let c=n.slice(o).match(NU);c!==null&&(o+=c[0].length)}return r}function SC(t,e,n){let{x:r,y:o}=t.getBoundingClientRect(),i=t.createSVGMatrix(),s=[];for(let a of e.children)if(a.tagName==="g"){let c=AC(a)??i;for(let f of a.children)wC(n,r,o,f,c)&&s.push(f)}else wC(n,r,o,a,i)&&s.push(a);return s}function wC(t,e,n,r,o){let[[i,s],[a,c]]=t,{e:f,f:u}=o,p=r.getBoundingClientRect(),l=p.left-e,h=p.right-e,d=p.top-n,m=p.bottom-n;if(l>=i&&h<=a&&d>=s&&m<=c)return!0;if(l<=a&&h>=i&&d<=c&&m>=s){let g=r.tagName;if(g==="a"&&(r=r.children[0],g=r.tagName),g==="rect"||g==="text"||g==="image")return!0;switch(i-=f,s-=u,a-=f,c-=u,g){case"circle":return EC(i,s,a,c,nc(r.cx),nc(r.cy),nc(r.r));case"line":return TC(i,s,a,c,nc(r.x1),nc(r.y1),nc(r.x2),nc(r.y2));case"path":return LU(i,s,a,c,r)}}return!1}function nc(t){return t.baseVal.value}function AC(t){let e=t.transform.baseVal,n=e.length,r=e[0]?.matrix;for(let o=1;o<n;++o)r=r.multiply(e[o].matrix);return r}function EC(t,e,n,r,o,i,s){let a=t<=o&&o<=n,c=e<=i&&i<=r;if(a&&c)return!0;let f=Math.min(Math.abs(t-o),Math.abs(n-o));if(c&&f<=s)return!0;let u=Math.min(Math.abs(e-i),Math.abs(r-i));return a&&u<=s||f*f+u*u<=s*s}function TC(t,e,n,r,o,i,s,a){let c=Math.max(Math.min(o,s),t),f=Math.min(Math.max(o,s),n);if(c>f)return!1;let u=i,p=a,l=s-o;if(Math.abs(l)>1e-8){let m=(a-i)/l,g=i-m*o;u=m*c+g,p=m*f+g}let h=Math.max(Math.min(u,p),e),d=Math.min(Math.max(u,p),r);return h<=d}function LU(t,e,n,r,o){let i=o.__path__||(o.__path__=bC(o.getAttribute("d"))),s=0,a=0,c=0,f=0,u=!1,p=[0,0],l=2,h=AC(o),d=(x,b)=>{p.length=l=2,p[0]=c=s=x,p[1]=f=a=b},m=h?(x,b)=>d(vC(h,x,b),_C(h,x,b)):(x,b)=>d(x,b),g=(x,b)=>(p[l]=x,p[l+1]=b,l+=2,TC(t,e,n,r,p[l-4],p[l-3],x,b)),y=h?(x,b)=>{u=g(vC(h,c=x,f=b),_C(h,x,b))}:(x,b)=>{u=g(c=x,f=b)};for(let x=0;x<i.length;++x){let b=i[x];switch(b[0]){case"M":m(b[1],b[2]);break;case"m":m(c+b[1],f+b[2]);break;case"L":case"T":y(b[1],b[2]);break;case"H":y(b[1],f);break;case"V":y(c,b[1]);break;case"l":case"t":y(c+b[1],f+b[2]);break;case"h":y(c+b[1],f);break;case"v":y(c,f+b[1]);break;case"C":y(b[5],b[6]);break;case"c":y(c+b[5],f+b[6]);break;case"S":case"Q":y(b[3],b[4]);break;case"s":case"q":y(c+b[3],f+b[4]);break;case"A":y(b[6],b[7]);break;case"a":if(OU(i,x))return EC(t,e,n,r,c,f-b[2],b[2]);y(c+b[6],c+b[7]);break;case"z":case"Z":if(y(s,a),$U(t,e,p)>0)return!0;m(s,a);break;default:return console.warn("SVG path command not supported: ",b[0]),!1}if(u)return!0}return!1}function vC(t,e,n){return t.a*e+t.c*n+t.e}function _C(t,e,n){return t.b*e+t.d*n+t.f}function OU(t,e){let n=t[e],r=t[e+1];return r&&r[0]==="a"&&t[e+2]?.[0]==="z"&&n[1]===n[2]&&r[1]===r[2]&&n[1]===r[1]&&n[7]===-r[7]}function $U(t,e,n){let r=0,o=n.length-2;for(let i=0;i<o;i+=2)n[i+1]<=e?n[i+3]>e&&MC(t,e,n,i)>0&&++r:n[i+3]<=e&&MC(t,e,n[i])<0&&--r;return r}function MC(t,e,n,r){return(n[r+2]-n[r])*(e-n[r+1])-(t-n[r])*(n[r+3]-n[r+1])}function G1(t,e){return t==null||e==null?t!=null||e!=null:t.length!==e.length||t.some((n,r)=>V1(n,e[r]))}function V1(t,e){let n=t.length;if(e.length!==n)return!0;for(let r=0;r<n;++r)if(t[r]!==e[r])return!0;return!1}var j3=class{constructor(e,{channels:n,selection:r,peers:o=!0,brush:i={fill:"none",stroke:"currentColor",strokeDasharray:"1,1"}}){this.mark=e,this.selection=r,this.peers=o,this.style=i&&Fs(i),this.brush=X1(),this.brush.on("brush end",c=>this.publish(c.selection)),this.extent=null,this.groups=null;let{fields:s,as:a}=gC(e,n);this.fields=s,this.as=a}reset(){this.value=void 0,this.extent=null,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause([this.fields.map(()=>0)]))}clause(e){let{fields:n,mark:r}=this;return ea(n,e,{source:this,clients:this.peers?r.plot.markSet:new Set().add(r)})}publish(e){let{as:n,group:r,mark:o,svg:i}=this,s;if(e){let{data:{columns:a={}}={}}=o,c=new Map;SC(i,r,e).forEach(f=>{let u=lu(f),p=n.map(l=>a[l][u]);c.set(p.join("|"),p)}),s=Array.from(c.values())}this.extent=e,G1(s,this.value)&&(this.value=s,this.selection.update(this.clause(s)))}init(e){let{brush:n,extent:r,mark:o,style:i}=this;this.svg=e;let s=e.width.baseVal.value,a=e.height.baseVal.value;if(n.extent([[0,0],[s,a]]),this.group=e.querySelector(`[data-index="${o.index}"]`),this.g=At(e).append("g").attr("class","region-xy").each(j1).call(n).call(n.moveSilent,r),i){let c=this.g.selectAll("rect.selection");for(let f in i)c.attr(f,i[f])}e.addEventListener("pointerenter",c=>{c.buttons||this.activate()})}};var ed=class{constructor(e,{selection:n,channels:r,peers:o=!0}){this.value=null,this.mark=e,this.selection=n,this.peers=o;let i=this.fields=[],s=this.as=[];r.forEach(a=>{let c=a==="color"?["color","fill","stroke"]:a==="x"?["x","x1","x2"]:a==="y"?["y","y1","y2"]:[a];for(let f=0;f<c.length;++f){let u=e.channelField(c[f],{exact:!0});if(u){i.push(u.field?.basis||u.field),s.push(u.as);return}}throw new Error(`Missing channel: ${a}`)})}clause(e){let{fields:n,mark:r}=this;return ea(n,e,{source:this,clients:this.peers?r.plot.markSet:new Set().add(r)})}init(e,n,r){let{mark:o,as:i,selection:s}=this,{data:{columns:a={}}={}}=o;r??=f=>i.map(u=>a[u][lu(f)]),n??=`[data-index="${o.index}"]`;let c=Array.from(e.querySelectorAll(n));e.addEventListener("pointerdown",f=>{let u=s.single?s.value:this.value,p=f.target,l=null;if(DU(c,p)){let h=r(p);(f.shiftKey||f.metaKey)&&u?.length?(l=u.filter(d=>V1(d,h)),l.length===u.length&&l.push(h)):u?.length===1&&!V1(u[0],h)?l=null:l=[h]}this.value=l,G1(u,l)&&s.update(this.clause(l))}),e.addEventListener("pointerenter",f=>{f.buttons||this.selection.activate(this.clause([this.fields.map(()=>0)]))})}};function DU(t,e){return t.some(n=>n.contains(e))}var CC=":scope > div, :scope > span",H1="swatch",IC="ramp",X3=class{constructor(e,n){let{as:r,field:o,...i}=n;this.channel=e,this.options=i,this.type=null,this.handler=null,this.selection=r,this.field=o,this.legend=null,this.element=document.createElement("div"),this.element.setAttribute("class","legend"),Object.defineProperty(this.element,"value",{value:this})}setPlot(e){this.plot=e}init(e){let n=FU(this,e);return this.element.replaceChildren(n),this.element}update(){if(!this.legend)return;let{selection:e,handler:n}=this,{single:r,value:o}=e,i=r?o:e.valueFor(n),s=i&&i.length?new Set(i.map(c=>c[0])):null,a=this.legend.querySelectorAll(CC);for(let c of a){let f=s?s.has(c.__data__):!0;c.style.opacity=f?1:.2}}};function FU(t,e){let{channel:n,plot:r,selection:o}=t,i=e.scale(n),s=i.type==="ordinal"?H1:IC,a={label:r.getAttribute(`${n}Label`)??null,...t.options},c=s===H1?a:a.label?{tickSize:2,...a}:{tickSize:2,marginTop:1,height:29,...a},f=e.legend(n,c);t.legend=f;let u=!!o;if(u&&s===IC){let p=c.width??240,l=zU(i,p);l?f.scale=function(h){return h==="x"?{range:[0,p]}:h==="y"?{range:[-10,0]}:h===n?l:void 0}:u=!1}if(u){let p=PU(t,s);s===H1?(p.init(f,CC,l=>[l.__data__]),t.update()):p.init(f,f.querySelector("g:last-of-type"))}return f}function PU(t,e){let{channel:n,handler:r,selection:o}=t;if(r)return r;let i=qU(t);return e===H1?(t.handler=new ed(i,{selection:o,channels:[n],peers:!1}),o.addEventListener("value",()=>t.update())):t.handler=new td(i,{selection:o,channel:n,brush:{fill:"none",stroke:"currentColor"},peers:!1}),t.handler}function qU(t){let{channel:e,plot:n}=t,r=t.field??BU(n.marks,e)??"value";if(r){let o={field:r};return{plot:n,channelField:i=>e===i?o:void 0}}}function BU(t,e){let n=e==="color"?["fill","stroke"]:e==="opacity"?["opacity","fillOpacity","strokeOpacity"]:null;if(n==null)return null;for(let r=t.length-1;r>-1;--r)for(let o of n){let i=t[r].channelField(o,{exact:!0});if(i)return i.field}return null}function zU(t,e){let{apply:n,invert:r,interpolate:o,...i}=t,s=t.type;s.startsWith("diverging-")&&(s=s.slice(11));let a;switch(s){case"log":case"pow":case"sqrt":case"symlog":a=s;break;case"threshold":case"quantize":case"quantile":return console.warn(`Legends do not yet support ${s} scales.`),null;default:a="linear"}return ys({x:{...i,type:a,range:[0,e]}})}function Q1(t,e,n=0,r=Math.LN10){let o,i=Math.ceil(Math.log(e)/r),s=Math.max(n,Math.pow(10,Math.round(Math.log(t)/r)-i));for(;Math.ceil(t/s)>e;)s*=10;let a=[5,2];for(let c=0,f=a.length;c<f;++c)o=s/a[c],o>=n&&t/o<=e&&(s=o);return s}function NC(t,e,n){let{step:r,steps:o,minstep:i=0,nice:s=!0}=n;if(s!==!1){let a=e-t,c=Math.LN10;r=r||Q1(a,o||25,i,c);let f=Math.log(r),u=f>=0?0:~~(-f/c)+1,p=Math.pow(10,-u-1);f=Math.floor(t/r+p)*r,t=t<f?f-r:f,e=Math.ceil(e/r)*r,o=Math.round((e-t)/r)}return{min:t,max:e,steps:o}}var OC="year",kC="month",RC="day",Z1="hour",K1="minute",J1="second",YU="millisecond",rd=1e3,od=rd*60,id=od*60,tb=id*24,UU=tb*7,LC=tb*30,$C=tb*365,nd=[[J1,1,rd],[J1,5,5*rd],[J1,15,15*rd],[J1,30,30*rd],[K1,1,od],[K1,5,5*od],[K1,15,15*od],[K1,30,30*od],[Z1,1,id],[Z1,3,3*id],[Z1,6,6*id],[Z1,12,12*id],[RC,1,tb],[RC,7,UU],[kC,1,LC],[kC,3,3*LC],[OC,1,$C]];function DC(t,e,n){let r=e-t,o=r/n,i=Nr(s=>s[2]).right(nd,o);return i===nd.length?{interval:OC,step:Q1(r/$C,n)}:i?(i=nd[o/nd[i-1][2]<nd[i][2]/o?i-1:i],{interval:i[0],step:i[1]}):{interval:YU,step:Q1(r,n,1)}}var jU=new Set(["rectY-x","rectX-y","rect-x","rect-y","ruleY-x","ruleX-y"]);function XU(t,e){return jU.has(`${t.type}-${e}`)}function WU(t,e={}){let n=(r,o)=>XU(r,o)?{[`${o}1`]:W3(r,o,t,e),[`${o}2`]:W3(r,o,t,{...e,offset:1})}:{[o]:W3(r,o,t,e)};return n[pu]=!0,n}function W3(t,e,n,r){return new G3(n,t,e,r)}function GU(t,e){let n=t.plot.getAttribute(`${e}Scale`);return n==="utc"||n==="time"}var G3=class extends xt{constructor(e,n,r,o){super("COLUMN_REF"),this.column=e,this.mark=n,this.channel=r,this.options=o}get stats(){return{column:this.column,stats:["min","max"]}}toString(){let{mark:e,channel:n,column:r,options:o}=this,{type:i,min:s,max:a}=e.channelField(n),{interval:c,steps:f,offset:u=0}=o,p=c??(i==="date"||GU(e,n)?"date":"number"),l;if(p==="number"){let{apply:h,sqlApply:d,sqlInvert:m}=ec(e,n),g=NC(h(s),h(a),o),y=d(r),x=de((g.max-g.min)/g.steps),b=Re(Lt(g.min===0?y:ut(y,g.min),x)),w=Nt(g.min,pt(x,u?Nt(u,b):b));l=m(w)}else{let{interval:h,step:d=1}=p==="date"?DC(s,a,f||40):o,m=zb(r,h,d);l=u?Nt(m,Im(h,u*d)):m}return`${l}`}};export{A3 as ConnectedMark,E3 as ContourMark,C3 as DenseLineMark,N3 as Density1DMark,k3 as Density2DMark,R3 as ErrorBarMark,Li as Fixed,L3 as GeoMark,zr as Grid2DMark,T3 as HeatmapMark,O3 as HexbinMark,P3 as Highlight,td as Interval1D,B3 as Interval2D,X3 as Legend,Je as Mark,z3 as Nearest,U3 as PanZoom,x3 as Plot,fu as RasterMark,$3 as RasterTileMark,j3 as Region,F3 as RegressionMark,ed as Toggle,pu as Transform,Ye as Transient,WU as bin};
60
+ }`)).call(Df,n);for(let O of f){let{channels:D,values:F,facets:P}=m.get(O);if(d===void 0||O.facet==="super"){let W=null;if(P&&(W=P[0],W=O.filter(W,D,F),W.length===0))continue;let K=O.render(W,x,F,v,A);if(K==null)continue;T.appendChild(K)}else{let W;for(let K of d){if(!(O.facetAnchor?.(d,k,K)??!K.empty))continue;let tt=null;if(P){let U=p.has(O);if(tt=P[U?K.i:0],tt=O.filter(tt,D,F),tt.length===0)continue;!U&&tt===P[0]&&(tt=bi(tt)),tt.fx=K.x,tt.fy=K.y,tt.fi=K.i}let nt=O.render(tt,x,F,_,A);if(nt!=null){(W??=At(T).append("g")).append(()=>nt).datum(K);for(let U of["aria-label","aria-description","aria-hidden","transform"])nt.hasAttribute(U)&&(W.attr(U,nt.getAttribute(U)),nt.removeAttribute(U))}}W?.selectChildren().attr("transform",L)}}let N=vT(g,A,t),{figure:R=r!=null||o!=null||i!=null||N.length>0}=t;R&&(C=E.createElement("figure"),C.className=`${c}-figure`,C.style.maxWidth="initial",r!=null&&C.append(DT(E,r,"h2")),o!=null&&C.append(DT(E,o,"h3")),C.append(...N,T),i!=null&&C.append(vB(E,i)),"value"in T&&(C.value=T.value,delete T.value)),C.scale=cE(x.scales),C.legend=bT(g,A,t);let $=q7();return $>0&&At(T).append("text").attr("x",M).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("\u26A0\uFE0F").append("title").text(`${$.toLocaleString("en-US")} warning${$===1?"":"s"}. Please check the console.`),C}function DT(t,e,n){if(e.ownerDocument)return e;let r=t.createElement(n);return r.append(e),r}function vB(t,e){let n=t.createElement("figcaption");return n.append(e),n}function FT(t){return t.flat(1/0).filter(e=>e!=null).map(_B)}function _B(t){return typeof t.render=="function"?t:new $6(t)}var $6=class extends ft{constructor(e){if(typeof e!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=e}render(){}};function D6(t,e){for(let n in t)zT(t[n],e);return t}function zT(t,e){let{scale:n,transform:r=!0}=t;if(n==null||!r)return;let{type:o,percent:i,interval:s,transform:a=i?c=>c==null?NaN:c*100:C_(s,o)}=e[n]??{};a!=null&&(t.value=Mt(t.value,a),t.transform=!1)}function MB(t){for(let e in t)X_(e,t[e])}function xh(t,e,n,r=jA){for(let{channels:o}of e.values())for(let i in o){let s=o[i],{scale:a}=s;if(a!=null&&r(a))if(a==="projection"){if(!bE(n)){let c=n.x?.domain===void 0,f=n.y?.domain===void 0;if(c||f){let[u,p]=vE(s);c&&O6(t,"x",u),f&&O6(t,"y",p)}}}else O6(t,a,s)}return t}function O6(t,e,n){let r=t.get(e);r!==void 0?r.push(n):t.set(e,[n])}function SB(t,e){if(t==null)return;let{x:n,y:r}=t;if(n==null&&r==null)return;let o=yi(t.data);if(o==null)throw new Error("missing facet data");let i={};n!=null&&(i.fx=Cf(o,{value:n,scale:"fx"})),r!=null&&(i.fy=Cf(o,{value:r,scale:"fy"})),D6(i,e);let s=Cx(o,i);return{channels:i,groups:s,data:t.data}}function PT(t,e,n){if(t.facet===null||t.facet==="super")return;let{fx:r,fy:o}=t;if(r!=null||o!=null){let c=yi(t.data??r??o);if(c===void 0)throw new Error(`missing facet data in ${t.ariaLabel}`);if(c===null)return;let f={};return r!=null&&(f.fx=Cf(c,{value:r,scale:"fx"})),o!=null&&(f.fy=Cf(c,{value:o,scale:"fy"})),D6(f,n),{channels:f,groups:Cx(c,f)}}if(e===void 0)return;let{channels:i,groups:s,data:a}=e;if(t.facet!=="auto"||t.data===a)return{channels:i,groups:s};a.length>0&&(s.size>1||s.size===1&&i.fx&&i.fy&&[...s][0][1].size>1)&&ps(yi(t.data))===ps(a)&&hn(`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 AB(t,e={}){return Gt({...e,x:null,y:null},(n,r,o,i,s,a)=>a.getMarkState(t))}function EB(t){let e=[];for(let n of t){let r=n.tip;if(r){r===!0?r={}:typeof r=="string"&&(r={pointer:r});let{pointer:o,preferredAnchor:i}=r;o=/^x$/i.test(o)?Ms:/^y$/i.test(o)?Ti:_s,r=o(AB(n,r)),r.title=null,i===void 0&&(r.preferredAnchor=o===Ti?"left":"bottom");let s=i1(n.data,r);s.facet=n.facet,s.facetAnchor=n.facetAnchor,e.push(s)}}return e}function TB(t,e,n){let{projection:r,x:o={},y:i={},fx:s={},fy:a={},axis:c,grid:f,facet:u={},facet:{axis:p=c,grid:l}=u,x:{axis:h=c,grid:d=h===null?null:f}=o,y:{axis:m=c,grid:g=m===null?null:f}=i,fx:{axis:y=p,grid:x=y===null?null:l}=s,fy:{axis:b=p,grid:w=b===null?null:l}=a}=n;(r||!bo(o)&&!qT("x",t))&&(h=d=null),(r||!bo(i)&&!qT("y",t))&&(m=g=null),e.has("fx")||(y=x=null),e.has("fy")||(b=w=null),h===void 0&&(h=!c1(t,"x")),m===void 0&&(m=!c1(t,"y")),y===void 0&&(y=!c1(t,"fx")),b===void 0&&(b=!c1(t,"fy")),h===!0&&(h="bottom"),m===!0&&(m="left"),y===!0&&(y=h==="top"||h===null?"bottom":"top"),b===!0&&(b=m==="right"||m===null?"left":"right");let _=[];return a1(_,w,Qx,a),s1(_,b,Gx,"right","left",u,a),a1(_,x,Kx,s),s1(_,y,Vx,"top","bottom",u,s),a1(_,g,Hx,i),s1(_,m,fh,"left","right",n,i),a1(_,d,Zx,o),s1(_,h,uh,"bottom","top",n,o),_}function s1(t,e,n,r,o,i,s){if(!e)return;let a=IB(e);s=CB(a?r:e,i,s);let{line:c}=s;(n===fh||n===uh)&&c&&!vi(c)&&t.push(Wf(NB(s))),t.push(n(s)),a&&t.push(n({...s,anchor:o,label:null}))}function a1(t,e,n,r){!e||vi(e)||t.push(n(kB(e,r)))}function IB(t){return/^\s*both\s*$/i.test(t)}function CB(t,e,{line:n=e.line,ticks:r,tickSize:o,tickSpacing:i,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:f,ariaLabel:u,ariaDescription:p,label:l=e.label,labelAnchor:h,labelArrow:d=e.labelArrow,labelOffset:m}){return{anchor:t,line:n,ticks:r,tickSize:o,tickSpacing:i,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:f,ariaLabel:u,ariaDescription:p,label:l,labelAnchor:h,labelArrow:d,labelOffset:m}}function NB(t){let{anchor:e,line:n}=t;return{anchor:e,facetAnchor:e+"-empty",stroke:n===!0?void 0:n}}function kB(t,{stroke:e=ds(t)?t:void 0,ticks:n=RB(t)?t:void 0,tickSpacing:r,ariaLabel:o,ariaDescription:i}){return{stroke:e,ticks:n,tickSpacing:r,ariaLabel:o,ariaDescription:i}}function RB(t){switch(typeof t){case"number":return!0;case"string":return!ds(t)}return Rn(t)||typeof t?.range=="function"}function c1(t,e){let n=`${e}-axis `;return t.some(r=>r.ariaLabel?.startsWith(n))}function qT(t,e){for(let n of e)for(let r in n.channels){let{scale:o}=n.channels[r];if(o===t||o==="projection")return!0}return!1}function LB(t,e){for(let n in t){let r=t[n],o=e[n];r.label===void 0&&o&&(r.label=o.label)}return t}function OB({fx:t,fy:e},n){let{marginTop:r,marginRight:o,marginBottom:i,marginLeft:s,width:a,height:c}=Ex(n),f=t&&BT(t),u=e&&BT(e);return{marginTop:e?u[0]:r,marginRight:t?a-f[1]:o,marginBottom:e?c-u[1]:i,marginLeft:t?f[0]:s,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:a,height:c}}function BT(t){let e=t.domain();if(e.length===0)return[0,t.bandwidth()];let n=t(e[0]),r=t(e[e.length-1]);return r<n&&([n,r]=[r,n]),[n,r+t.bandwidth()]}var $B=new Map([["basis",Gv],["basis-closed",Vv],["basis-open",Hv],["bundle",Qv],["bump-x",Yv],["bump-y",Uv],["cardinal",Zv],["cardinal-closed",Kv],["cardinal-open",Jv],["catmull-rom",t_],["catmull-rom-closed",e_],["catmull-rom-open",n_],["linear",hi],["linear-closed",r_],["monotone-x",i_],["monotone-y",s_],["natural",a_],["step",c_],["step-after",u_],["step-before",f_]]);function bh(t=hi,e){if(typeof t=="function")return t;let n=$B.get(`${t}`.toLowerCase());if(!n)throw new Error(`unknown curve: ${t}`);if(e!==void 0){if("beta"in n)return n.beta(e);if("tension"in n)return n.tension(e);if("alpha"in n)return n.alpha(e)}return n}function f1(t=Cs,e){return typeof t!="function"&&`${t}`.toLowerCase()==="auto"?Cs:bh(t,e)}function Cs(t){return hi(t)}function Co(t={y:"count"},e={}){[t,e]=P6(t,e);let{x:n,y:r}=e;return F6(u1(n,e,X),null,null,r,t,Ba(e))}function No(t={x:"count"},e={}){[t,e]=P6(t,e);let{x:n,y:r}=e;return F6(null,u1(r,e,X),n,null,t,za(e))}function Ci(t={fill:"count"},e={}){[t,e]=P6(t,e);let{x:n,y:r}=DB(e);return F6(n,r,null,null,t,Ba(za(e)))}function jT(t,e,n={}){if(n?.interval==null)return n;let{reduce:r=wx}=n,o={filter:null};return n[e]!=null&&(o[e]=r),n[`${e}1`]!=null&&(o[`${e}1`]=r),n[`${e}2`]!=null&&(o[`${e}2`]=r),t(o,n)}function Vf(t={}){return jT(Co,"y",Fr(t,"x"))}function Hf(t={}){return jT(No,"x",Fr(t,"y"))}function F6(t,e,n,r,{data:o=bx,filter:i=Zp,sort:s,reverse:a,...c}={},f={}){t=YT(t),e=YT(e),c=FB(c,f),o=GT(o,X),s=s==null?void 0:XT("sort",s,f),i=i==null?void 0:WT("filter",i,f),n!=null&&So(c,"x","x1","x2")&&(n=null),r!=null&&So(c,"y","y1","y2")&&(r=null);let[u,p]=Ze(t),[l,h]=Ze(t),[d,m]=Ze(e),[g,y]=Ze(e),[x,b]=n!=null?[n,"x"]:r!=null?[r,"y"]:[],[w,_]=Ze(x),{x:v,y:A,z:E,fill:T,stroke:C,x1:S,x2:k,y1:L,y2:M,domain:I,cumulative:N,thresholds:R,interval:$,...O}=f,[D,F]=Ze(E),[P]=ne(T),[W]=ne(C),[K,tt]=Ze(P),[nt,U]=Ze(W);return{..."z"in f&&{z:D||E},..."fill"in f&&{fill:K||T},..."stroke"in f&&{stroke:nt||C},...Me(O,(et,z,G)=>{let J=$a(ct(et,x),G?.[b]),q=ct(et,E),bt=ct(et,P),st=ct(et,W),Et=th(c,{z:q,fill:bt,stroke:st}),Ct=[],Q=[],qt=J&&_([]),Bn=q&&F([]),Yr=bt&&tt([]),FC=st&&U([]),V3=t&&p([]),PC=t&&h([]),H3=e&&m([]),qC=e&&y([]),BC=BB(t,e,et),zC=0;for(let rc of c)rc.initialize(et);s&&s.initialize(et),i&&i.initialize(et);for(let rc of z){let Q3=[];for(let oc of c)oc.scope("facet",rc);s&&s.scope("facet",rc),i&&i.scope("facet",rc);for(let[oc,YC]of Mo(rc,Et))for(let[UC,sd]of Mo(YC,J))for(let[Ur,Do]of BC(sd))if(Et&&(Do.z=oc),!(i&&!i.reduce(Ur,Do))){Q3.push(zC++),Q.push(o.reduceIndex(Ur,et,Do)),J&&qt.push(UC),q&&Bn.push(Et===q?oc:q[(Ur.length>0?Ur:sd)[0]]),bt&&Yr.push(Et===bt?oc:bt[(Ur.length>0?Ur:sd)[0]]),st&&FC.push(Et===st?oc:st[(Ur.length>0?Ur:sd)[0]]),V3&&(V3.push(Do.x1),PC.push(Do.x2)),H3&&(H3.push(Do.y1),qC.push(Do.y2));for(let jC of c)jC.reduce(Ur,Do);s&&s.reduce(Ur,Do)}Ct.push(Q3)}return Y_(Ct,s,a),{data:Q,facets:Ct}}),...!So(c,"x")&&(u?{x1:u,x2:l,x:Sf(u,l)}:{x:v,x1:S,x2:k}),...!So(c,"y")&&(d?{y1:d,y2:g,y:Sf(d,g)}:{y:A,y1:L,y2:M}),...w&&{[b]:w},...Object.fromEntries(c.map(({name:et,output:z})=>[et,z]))}}function P6({cumulative:t,domain:e,thresholds:n,interval:r,...o},i){return[o,{cumulative:t,domain:e,thresholds:n,interval:r,...i}]}function u1(t,{cumulative:e,domain:n,thresholds:r,interval:o},i){return t={...wr(t)},t.domain===void 0&&(t.domain=n),t.cumulative===void 0&&(t.cumulative=e),t.thresholds===void 0&&(t.thresholds=r),t.interval===void 0&&(t.interval=o),t.value===void 0&&(t.value=i),t.thresholds=q6(t.thresholds,t.interval),t}function DB(t){let{x:e,y:n}=t;return e=u1(e,t),n=u1(n,t),[e.value,n.value]=ce(e.value,n.value),{x:e,y:n}}function YT(t){if(t==null)return;let{value:e,cumulative:n,domain:r=Ot,thresholds:o}=t,i=s=>{let a=ct(s,e),c;if(re(a)||qB(o)){a=Mt(a,S_,Float64Array);let[u,p]=typeof r=="function"?r(a):r,l=typeof o=="function"&&!hs(o)?o(a,u,p):o;typeof l=="number"&&(l=xp(u,p,l)),hs(l)&&(r===Ot&&(u=l.floor(u),p=l.offset(l.floor(p))),l=l.range(u,l.offset(p))),c=l}else{a=_e(a);let[u,p]=typeof r=="function"?r(a):r,l=typeof o=="function"&&!hs(o)?o(a,u,p):o;if(typeof l=="number")if(r===Ot){let h=Ho(u,p,l);if(isFinite(h))if(h>0){let d=Math.round(u/h),m=Math.round(p/h);d*h<=u||--d,m*h>p||++m;let g=m-d+1;l=new Float64Array(g);for(let y=0;y<g;++y)l[y]=(d+y)*h}else if(h<0){h=-h;let d=Math.round(u*h),m=Math.round(p*h);d/h<=u||--d,m/h>p||++m;let g=m-d+1;l=new Float64Array(g);for(let y=0;y<g;++y)l[y]=(d+y)/h}else l=[u];else l=[u]}else l=Ge(u,p,l);else hs(l)&&(r===Ot&&(u=l.floor(u),p=l.offset(l.floor(p))),l=l.range(u,l.offset(p)));c=l}let f=[];if(c.length===1)f.push([c[0],c[0]]);else for(let u=1;u<c.length;++u)f.push([c[u-1],c[u]]);return f.bin=(n<0?YB:n>0?zB:B6)(f,c,a),f};return i.label=Ke(e),i}function q6(t,e,n=UT){if(t===void 0)return e===void 0?n:vo(e);if(typeof t=="string"){switch(t.toLowerCase()){case"freedman-diaconis":return t0;case"scott":return hl;case"sturges":return ji;case"auto":return UT}return La(t)}return t}function FB(t,e){return B_(t,e,XT)}function XT(t,e,n){return yx(t,e,n,WT)}function WT(t,e,n){return xx(t,e,n,GT)}function GT(t,e){return If(t,e,PB)}function PB(t){switch(`${t}`.toLowerCase()){case"x":return UB;case"x1":return XB;case"x2":return WB;case"y":return jB;case"y1":return GB;case"y2":return VB;case"z":return U_}throw new Error(`invalid bin reduce: ${t}`)}function UT(t,e,n){return Math.min(200,hl(t,e,n))}function qB(t){return GA(t)||Rn(t)&&re(t)}function BB(t,e,n){let r=t?.(n),o=e?.(n);return r&&o?function*(i){let s=r.bin(i);for(let[a,[c,f]]of r.entries()){let u=o.bin(s[a]);for(let[p,[l,h]]of o.entries())yield[u[p],{data:n,x1:c,y1:l,x2:f,y2:h}]}}:r?function*(i){let s=r.bin(i);for(let[a,[c,f]]of r.entries())yield[s[a],{data:n,x1:c,x2:f}]}:function*(i){let s=o.bin(i);for(let[a,[c,f]]of o.entries())yield[s[a],{data:n,y1:c,y2:f}]}}function B6(t,e,n){return e=_e(e),r=>{let o=t.map(()=>[]);for(let i of r)o[Go(e,n[i])-1]?.push(i);return o}}function zB(t,e,n){let r=B6(t,e,n);return o=>{let i=r(o);for(let s=1,a=i.length;s<a;++s){let c=i[s-1],f=i[s];for(let u of c)f.push(u)}return i}}function YB(t,e,n){let r=B6(t,e,n);return o=>{let i=r(o);for(let s=i.length-2;s>=0;--s){let a=i[s+1],c=i[s];for(let f of a)c.push(f)}return i}}function VT(t,e){let n=(+t+ +e)/2;return t instanceof Date?new Date(n):n}var UB={reduceIndex(t,e,{x1:n,x2:r}){return VT(n,r)}},jB={reduceIndex(t,e,{y1:n,y2:r}){return VT(n,r)}},XB={reduceIndex(t,e,{x1:n}){return n}},WB={reduceIndex(t,e,{x2:n}){return n}},GB={reduceIndex(t,e,{y1:n}){return n}},VB={reduceIndex(t,e,{y2:n}){return n}};var HB={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Ga=class extends ft{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s,z:a,curve:c,tension:f}=n;super(e,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0},z:{value:pn(n),optional:!0}},n,HB),this.z=a,this.curve=bh(c,f)}filter(e){return e}render(e,n,r,o,i){let{x1:s,y1:a,x2:c=s,y2:f=a}=r;return rt("svg:g",i).call(gt,this,o,i).call(ht,this,n,0,0).call(u=>u.selectAll().data($x(e,[s,a,c,f],this,r)).enter().append("path").call(lt,this).call(qa,this,r).attr("d",hf().curve(this.curve).defined(p=>p>=0).x0(p=>s[p]).y0(p=>a[p]).x1(p=>c[p]).y1(p=>f[p]))).node()}};function wh(t,e){return e===void 0?Ni(t,{x:Oa,y:us}):new Ga(t,e)}function Ns(t,e){let{y:n=Xt,...r}=Hf(e);return new Ga(t,Ts(As({...r,y1:n,y2:void 0})))}function Ni(t,e){let{x:n=Xt,...r}=Vf(e);return new Ga(t,Is(Es({...r,x1:n,x2:void 0})))}var QB={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},vh=class extends ft{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s,curve:a,tension:c}=n;super(e,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,QB),this.curve=f1(a,c),Pr(this,n)}project(e,n,r){this.curve!==Cs&&super.project(e,n,r)}render(e,n,r,o,i){let{x1:s,y1:a,x2:c=s,y2:f=a}=r,{curve:u}=this;return rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(p=>p.selectAll().data(e).enter().append("path").call(lt,this).attr("d",u===Cs&&i.projection?ZB(i.projection,s,a,c,f):l=>{let h=An(),d=u(h);return d.lineStart(),d.point(s[l],a[l]),d.point(c[l],f[l]),d.lineEnd(),h}).call(_t,this,r).call(Ii,this,r,i)).node()}};function ZB(t,e,n,r,o){let i=Oe(t);return e=_e(e),n=_e(n),r=_e(r),o=_e(o),s=>i({type:"LineString",coordinates:[[e[s],n[s]],[r[s],o[s]]]})}function l1(t,{x:e,x1:n,x2:r,y:o,y1:i,y2:s,...a}={}){return[n,r]=_h(e,n,r),[i,s]=_h(o,i,s),new vh(t,{...a,x1:n,x2:r,y1:i,y2:s})}function _h(t,e,n){if(t===void 0){if(e===void 0){if(n!==void 0)return[n]}else if(n===void 0)return[e]}else{if(e===void 0)return n===void 0?[t]:[t,n];if(n===void 0)return[t,e]}return[e,n]}var KB={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5},Mh=class extends ft{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s,bend:a=0,headAngle:c=60,headLength:f=8,inset:u=0,insetStart:p=u,insetEnd:l=u,sweep:h}=n;super(e,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,KB),this.bend=a===!0?22.5:Math.max(-90,Math.min(90,a)),this.headAngle=+c,this.headLength=+f,this.insetStart=+p,this.insetEnd=+l,this.sweep=JB(h)}render(e,n,r,o,i){let{x1:s,y1:a,x2:c=s,y2:f=a,SW:u}=r,{strokeWidth:p,bend:l,headAngle:h,headLength:d,insetStart:m,insetEnd:g}=this,y=u?w=>u[w]:oe(p===void 0?1:p),x=h*Ff/2,b=d/1.5;return rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(w=>w.selectAll().data(e).enter().append("path").call(lt,this).attr("d",_=>{let v=s[_],A=a[_],E=c[_],T=f[_],C=Math.hypot(E-v,T-A);if(C<=m+g)return null;let S=Math.atan2(T-A,E-v),k=Math.min(b*y(_),C/3),L=this.sweep(v,A,E,T)*l*Ff,M=Math.hypot(C/Math.tan(L),C)/2;if(m||g)if(M<1e5){let K=Math.sign(L),[tt,nt]=tz([v,A],[E,T],M,K);if(m&&([v,A]=HT([tt,nt,M],[v,A,m],-K*Math.sign(m))),g){let[U,et]=HT([tt,nt,M],[E,T,g],K*Math.sign(g));S+=Math.atan2(et-nt,U-tt)-Math.atan2(T-nt,E-tt),E=U,T=et}}else{let K=E-v,tt=T-A,nt=Math.hypot(K,tt);m&&(v+=K/nt*m,A+=tt/nt*m),g&&(E-=K/nt*g,T-=tt/nt*g)}let I=S+L,N=I+x,R=I-x,$=E-k*Math.cos(N),O=T-k*Math.sin(N),D=E-k*Math.cos(R),F=T-k*Math.sin(R),P=M<1e5?`A${M},${M} 0,0,${L>0?1:0} `:"L",W=k?`M${$},${O}L${E},${T}L${D},${F}`:"";return`M${v},${A}${P}${E},${T}${W}`}).call(_t,this,r)).node()}};function JB(t=1){if(typeof t=="number")return oe(Math.sign(t));if(typeof t=="function")return(e,n,r,o)=>Math.sign(t(e,n,r,o));switch(Ie(t,"sweep",["+x","-x","+y","-y"])){case"+x":return(e,n,r)=>dt(e,r);case"-x":return(e,n,r)=>xn(e,r);case"+y":return(e,n,r,o)=>dt(n,o);case"-y":return(e,n,r,o)=>xn(n,o)}}function tz([t,e],[n,r],o,i){let s=n-t,a=r-e,c=Math.hypot(s,a),f=i*Math.sqrt(o*o-c*c/4)/c;return[(t+n)/2-a*f,(e+r)/2+s*f]}function HT([t,e,n],[r,o,i],s){let a=r-t,c=o-e,f=Math.hypot(a,c),u=(a*a+c*c-i*i+n*n)/(2*f),p=s*Math.sqrt(n*n-u*u);return[t+(a*u+c*p)/f,e+(c*u-a*p)/f]}function QT(t,{x:e,x1:n,x2:r,y:o,y1:i,y2:s,...a}={}){return[n,r]=_h(e,n,r),[i,s]=_h(o,i,s),new Mh(t,{...a,x1:n,x2:r,y1:i,y2:s})}var ez={ariaLabel:"bar"},Qf=class extends ft{constructor(e,n,r={},o=ez){super(e,n,r,o),ph(this,r),hh(this,r)}render(e,n,r,o,i){let{rx:s,ry:a,rx1y1:c,rx1y2:f,rx2y1:u,rx2y2:p}=this,l=this._x(n,r,o),h=this._y(n,r,o),d=this._width(n,r,o),m=this._height(n,r,o);return rt("svg:g",i).call(gt,this,o,i).call(this._transform,this,n).call(g=>g.selectAll().data(e).enter().call(c||f||u||p?y=>y.append("path").call(lt,this).call(dh,l,h,ZT(l,d),ZT(h,m),this).call(_t,this,r):y=>y.append("rect").call(lt,this).attr("x",l).attr("width",d).attr("y",h).attr("height",m).call(ot,"rx",s).call(ot,"ry",a).call(_t,this,r))).node()}_x(e,{x:n},{marginLeft:r}){let{insetLeft:o}=this;return n?i=>n[i]+o:r+o}_y(e,{y:n},{marginTop:r}){let{insetTop:o}=this;return n?i=>n[i]+o:r+o}_width({x:e},{x:n},{marginRight:r,marginLeft:o,width:i}){let{insetLeft:s,insetRight:a}=this,c=n&&e?e.bandwidth():i-r-o;return Math.max(0,c-s-a)}_height({y:e},{y:n},{marginTop:r,marginBottom:o,height:i}){let{insetTop:s,insetBottom:a}=this,c=n&&e?e.bandwidth():i-r-o;return Math.max(0,c-s-a)}};function ZT(t,e){return typeof t=="function"&&typeof e=="function"?n=>t(n)+e(n):typeof t=="function"?n=>t(n)+e:typeof e=="function"?n=>t+e(n):t+e}var Va=class extends Qf{constructor(e,n={},r){let{x1:o,x2:i,y:s}=n;super(e,{x1:{value:o,scale:"x"},x2:{value:i,scale:"x"},y:{value:s,scale:"y",type:"band",optional:!0}},n,r)}_transform(e,n,{x:r}){e.call(ht,n,{x:r},0,0)}_x({x:e},{x1:n,x2:r},{marginLeft:o}){let{insetLeft:i}=this;return tr(e)?o+i:s=>Math.min(n[s],r[s])+i}_width({x:e},{x1:n,x2:r},{marginRight:o,marginLeft:i,width:s}){let{insetLeft:a,insetRight:c}=this;return tr(e)?s-o-i-a-c:f=>Math.max(0,Math.abs(r[f]-n[f])-a-c)}},Ha=class extends Qf{constructor(e,n={},r){let{x:o,y1:i,y2:s}=n;super(e,{y1:{value:i,scale:"y"},y2:{value:s,scale:"y"},x:{value:o,scale:"x",type:"band",optional:!0}},n,r)}_transform(e,n,{y:r}){e.call(ht,n,{y:r},0,0)}_y({y:e},{y1:n,y2:r},{marginTop:o}){let{insetTop:i}=this;return tr(e)?o+i:s=>Math.min(n[s],r[s])+i}_height({y:e},{y1:n,y2:r},{marginTop:o,marginBottom:i,height:s}){let{insetTop:a,insetBottom:c}=this;return tr(e)?s-o-i-a-c:f=>Math.max(0,Math.abs(r[f]-n[f])-a-c)}};function ko(t,e={}){return xi(e)||(e={...e,y:Xt,x2:X}),new Va(t,Ts(Pf(As(e))))}function Ro(t,e={}){return xi(e)||(e={...e,x:Xt,y2:X}),new Ha(t,Is(qf(Es(e))))}var nz={ariaLabel:"cell"},Qa=class extends Qf{constructor(e,{x:n,y:r,...o}={}){super(e,{x:{value:n,scale:"x",type:"band",optional:!0},y:{value:r,scale:"y",type:"band",optional:!0}},o,nz)}_transform(e,n){e.call(ht,n,{},0,0)}};function ks(t,{x:e,y:n,...r}={}){return[e,n]=ce(e,n),new Qa(t,{...r,x:e,y:n})}function KT(t,{x:e=Xt,fill:n,stroke:r,...o}={}){return n===void 0&&ne(r)[0]===void 0&&(n=X),new Qa(t,{...o,x:e,fill:n,stroke:r})}function JT(t,{y:e=Xt,fill:n,stroke:r,...o}={}){return n===void 0&&ne(r)[0]===void 0&&(n=X),new Qa(t,{...o,y:e,fill:n,stroke:r})}var rz={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function Sh(t){return t.sort===void 0&&t.reverse===void 0?mx({channel:"-r"},t):t}var Za=class extends ft{constructor(e,n={}){let{x:r,y:o,r:i,rotate:s,symbol:a=di,frameAnchor:c}=n,[f,u]=Pt(s,0),[p,l]=a7(a),[h,d]=Pt(i,p==null?3:4.5);super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},r:{value:h,scale:"r",filter:Nn,optional:!0},rotate:{value:f,optional:!0},symbol:{value:p,scale:"auto",optional:!0}},Sh(n),rz),this.r=d,this.rotate=u,this.symbol=l,this.frameAnchor=_o(c);let{channels:m}=this,{symbol:g}=m;if(g){let{fill:y,stroke:x}=m;g.hint={fill:y?y.value===g.value?"color":"currentColor":this.fill??"currentColor",stroke:x?x.value===g.value?"color":"currentColor":this.stroke??"none"}}}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,r:u,rotate:p,symbol:l}=r,{r:h,rotate:d,symbol:m}=this,[g,y]=ze(this,o),x=m===di,b=u?void 0:h*h*Math.PI;return is(h)&&(e=[]),rt("svg:g",i).call(gt,this,o,i).call(ht,this,{x:c&&s,y:f&&a}).call(w=>w.selectAll().data(e).enter().append(x?"circle":"path").call(lt,this).call(x?_=>{_.attr("cx",c?v=>c[v]:g).attr("cy",f?v=>f[v]:y).attr("r",u?v=>u[v]:h)}:_=>{_.attr("transform",qr`translate(${c?v=>c[v]:g},${f?v=>f[v]:y})${p?v=>` rotate(${p[v]})`:d?` rotate(${d})`:""}`).attr("d",u&&l?v=>{let A=An();return l[v].draw(A,u[v]*u[v]*Math.PI),A}:u?v=>{let A=An();return m.draw(A,u[v]*u[v]*Math.PI),A}:l?v=>{let A=An();return l[v].draw(A,b),A}:(()=>{let v=An();return m.draw(v,b),v})())}).call(_t,this,r)).node()}};function _r(t,{x:e,y:n,...r}={}){return r.frameAnchor===void 0&&([e,n]=ce(e,n)),new Za(t,{...r,x:e,y:n})}function t9(t,{x:e=X,...n}={}){return new Za(t,qx({...n,x:e}))}function e9(t,{y:e=X,...n}={}){return new Za(t,Px({...n,y:e}))}function n9(t,e){return _r(t,{...e,symbol:"circle"})}function r9(t,e){return _r(t,{...e,symbol:"hexagon"})}var oz={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Ka=class extends ft{constructor(e,n={}){let{x:r,y:o,z:i,curve:s,tension:a}=n;super(e,{x:{value:r,scale:"x"},y:{value:o,scale:"y"},z:{value:pn(n),optional:!0}},n,oz),this.z=i,this.curve=f1(s,a),Pr(this,n)}filter(e){return e}project(e,n,r){this.curve!==Cs&&super.project(e,n,r)}render(e,n,r,o,i){let{x:s,y:a}=r,{curve:c}=this;return rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(f=>f.selectAll().data($x(e,[s,a],this,r)).enter().append("path").call(lt,this).call(qa,this,r).call(LE,this,r,i).attr("d",c===Cs&&i.projection?iz(i.projection,s,a):Tp().curve(c).defined(u=>u>=0).x(u=>s[u]).y(u=>a[u]))).node()}};function iz(t,e,n){let r=Oe(t);return e=_e(e),n=_e(n),o=>{let i=[],s=[i];for(let a of o)a===-1?(i=[],s.push(i)):i.push([e[a],n[a]]);return r({type:"MultiLineString",coordinates:s})}}function Ja(t,{x:e,y:n,...r}={}){return[e,n]=ce(e,n),new Ka(t,{...r,x:e,y:n})}function Rs(t,{x:e=X,y:n=Xt,...r}={}){return new Ka(t,Hf({...r,x:e,y:n}))}function Ls(t,{x:e=Xt,y:n=X,...r}={}){return new Ka(t,Vf({...r,x:e,y:n}))}function Y6(t,e){e=sz(e);let{x:n,y:r,color:o,size:i}=e,s=p1(t,n),a=p1(t,r),c=p1(t,o),f=p1(t,i),{fx:u,fy:p,x:{value:l,reduce:h,zero:d,...m},y:{value:g,reduce:y,zero:x,...b},color:{value:w,color:_,reduce:v},size:{value:A,reduce:E},mark:T}=e;if(h===void 0&&(h=y==null&&l==null&&A==null&&g!=null?"count":null),y===void 0&&(y=h==null&&g==null&&A==null&&l!=null?"count":null),E===void 0&&A==null&&v==null&&h==null&&y==null&&(l==null||te(s))&&(g==null||te(a))&&(E="count"),d===void 0&&(d=h1(h)?!0:void 0),x===void 0&&(x=h1(y)?!0:void 0),l==null&&g==null)throw new Error("must specify x or y");if(h!=null&&g==null)throw new Error("reducing x requires y");if(y!=null&&l==null)throw new Error("reducing y requires x");T===void 0&&(T=A!=null||E!=null?"dot":h1(h)||h1(y)||v!=null?"bar":l!=null&&g!=null?te(s)||te(a)||h==null&&y==null&&!Ah(s)&&!Ah(a)?"dot":"line":l!=null||g!=null?"rule":null);let C,S,k;switch(T){case"dot":k=_r,S="stroke";break;case"line":k=s&&a||h!=null||y!=null?x||y!=null||s&&Ah(s)?Ls:d||h!=null||a&&Ah(a)?Rs:Ja:s?Rs:Ls,S="stroke",i9(c)&&(C=null);break;case"area":k=!(x||y!=null)&&(d||h!=null||a&&Ah(a))?Ns:Ni,S="fill",i9(c)&&(C=null);break;case"rule":k=s?er:nr,S="stroke";break;case"bar":k=h!=null?te(a)?o9(h)&&s&&te(s)?ks:ko:jf:y!=null?te(s)?o9(y)&&a&&te(a)?ks:Ro:Xf:v!=null||E!=null?s&&te(s)&&a&&te(a)?ks:s&&te(s)?Ro:a&&te(a)?ko:mh:s&&wi(s)&&!(a&&wi(a))?ko:a&&wi(a)&&!(s&&wi(s))?Ro:ks,S="fill";break;default:throw new Error(`invalid mark: ${T}`)}let L={fx:u,fy:p,x:s??void 0,y:a??void 0,[S]:c??_,z:C,r:f??void 0,tip:!0},M,I={[S]:v??void 0,r:E??void 0};if(h!=null&&y!=null)throw new Error("cannot reduce both x and y");return y!=null?(I.y=y,M=te(s)?ms:Co):h!=null?(I.x=h,M=te(a)?gs:No):(v!=null||E!=null)&&(s&&a?M=te(s)&&te(a)?Jp:te(s)?No:te(a)?Co:Ci:s?M=te(s)?ms:Co:a&&(M=te(a)?gs:No)),(M===Ci||M===Co)&&(L.x={value:s,...m}),(M===Ci||M===No)&&(L.y={value:a,...b}),d===void 0&&(d=s&&!(M===Ci||M===Co)&&(k===ko||k===Ns||k===jf||k===nr)),x===void 0&&(x=a&&!(M===Ci||M===No)&&(k===Ro||k===Ni||k===Xf||k===er)),{fx:u??null,fy:p??null,x:{value:l??null,reduce:h??null,zero:!!d,...m},y:{value:g??null,reduce:y??null,zero:!!x,...b},color:{value:w??null,reduce:v??null,..._!==void 0&&{color:_}},size:{value:A??null,reduce:E??null},mark:T,markImpl:s9[k],markOptions:L,transformImpl:s9[M],transformOptions:I,colorMode:S}}function a9(t,e){let n=Y6(t,e),{fx:r,fy:o,x:{zero:i},y:{zero:s},markOptions:a,transformOptions:c,colorMode:f}=n,u=z6[n.markImpl],p=z6[n.transformImpl],l=r!=null||o!=null?Wf({strokeOpacity:.1}):null,h=[i?er([0]):null,s?nr([0]):null],d=u(t,p?p(c,a):a);return f==="stroke"?Se(l,h,d):Se(l,d,h)}function Ah(t){let e,n;for(let r of t){if(r==null)continue;if(e===void 0){e=r;continue}let o=Math.sign(dt(e,r));if(o){if(n!==void 0&&o!==n)return!1;e=r,n=o}}return!0}function sz({x:t,y:e,color:n,size:r,fx:o,fy:i,mark:s}={}){return Kn(t)||(t=Zf(t)),Kn(e)||(e=Zf(e)),Kn(n)||(n=ds(n)?{color:n}:Zf(n)),Kn(r)||(r=Zf(r)),Kn(o)&&({value:o}=Zf(o)),Kn(i)&&({value:i}=Zf(i)),s!=null&&(s=`${s}`.toLowerCase()),{x:t,y:e,color:n,size:r,fx:o,fy:i,mark:s}}function p1(t,e){let n=ct(t,e.value);return n&&(n.label=Ke(e.value)),n}function Zf(t){return az(t)?{reduce:t}:{value:t}}function h1(t){return/^(?:distinct|count|sum|proportion)$/i.test(t)}function o9(t){return/^(?:first|last|mode)$/i.test(t)}function az(t){if(t==null)return!1;if(typeof t.reduceIndex=="function"||typeof t.reduce=="function"&&Pe(t)||/^p\d{2}$/i.test(t))return!0;switch(`${t}`.toLowerCase()){case"first":case"last":case"count":case"distinct":case"sum":case"proportion":case"proportion-facet":case"deviation":case"min":case"min-index":case"max":case"max-index":case"mean":case"median":case"variance":case"mode":return!0}return!1}function i9(t){return t?new wn(t).size>t.length>>1:!1}var z6={dot:_r,line:Ja,lineX:Rs,lineY:Ls,areaX:Ns,areaY:Ni,ruleX:er,ruleY:nr,barX:ko,barY:Ro,rect:mh,rectX:jf,rectY:Xf,cell:ks,bin:Ci,binX:Co,binY:No,group:Jp,groupX:ms,groupY:gs},s9=Object.fromEntries(Object.entries(z6).map(([t,e])=>[e,t]));function Kf(t,e={}){let{x:n,x1:r,x2:o}=e;n===void 0&&r===void 0&&o===void 0&&(e={...e,x:n=X});let i={};return n!=null&&(i.x=t),r!=null&&(i.x1=t),o!=null&&(i.x2=t),qn(i,e)}function Jf(t,e={}){let{y:n,y1:r,y2:o}=e;n===void 0&&r===void 0&&o===void 0&&(e={...e,y:n=X});let i={};return n!=null&&(i.y=t),r!=null&&(i.y1=t),o!=null&&(i.y2=t),qn(i,e)}function qn(t={},e={}){let n=pn(e),r=Object.entries(t).map(([o,i])=>{let s=fx(o,e);if(s==null)throw new Error(`missing channel: ${o}`);let[a,c]=qe(s);return{key:o,input:s,output:a,setOutput:c,map:cz(i)}});return{...Me(e,(o,i)=>{let s=ct(o,n),a=r.map(({input:f})=>ct(o,f)),c=r.map(({setOutput:f})=>f(new Array(o.length)));for(let f of i)for(let u of s?We(f,p=>s[p]).values():[f])r.forEach(({map:p},l)=>p.mapIndex(u,a[l],c[l]));return{data:o,facets:i}}),...Object.fromEntries(r.map(({key:o,output:i})=>[o,i]))}}function cz(t){if(t==null)throw new Error("missing map");if(typeof t.mapIndex=="function")return t;if(typeof t.map=="function"&&Pe(t))return fz(t);if(typeof t=="function")return U6(Mf(t));switch(`${t}`.toLowerCase()){case"cumsum":return lz;case"rank":return U6((e,n)=>dl(e,r=>n[r]));case"quantile":return U6((e,n)=>uz(e,r=>n[r]))}throw new Error(`invalid map: ${t}`)}function fz(t){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:t.map.bind(t)}}function uz(t,e){let n=Kr(t,e)-1;return dl(t,e).map(r=>r/n)}function U6(t){return{mapIndex(e,n,r){let o=t(e,n);if(o.length!==e.length)throw new Error("map function returned a mismatched length");for(let i=0,s=e.length;i<s;++i)r[e[i]]=o[i]}}}var lz={mapIndex(t,e,n){let r=0;for(let o of t)n[o]=r+=e[o]}};function c9(t={},e){return arguments.length===1&&(e=t),Kf(tu(t),e)}function f9(t={},e){return arguments.length===1&&(e=t),Jf(tu(t),e)}function tu(t={}){typeof t=="number"&&(t={k:t});let{k:e,reduce:n,shift:r,anchor:o,strict:i}=t;if(o===void 0&&r!==void 0&&(o=hz(r),hn(`Warning: the shift option is deprecated; please use anchor "${o}" instead.`)),!((e=Math.floor(e))>0))throw new Error(`invalid k: ${e}`);return dz(n)(e,pz(o,e),i)}function pz(t="middle",e){switch(`${t}`.toLowerCase()){case"middle":return e-1>>1;case"start":return 0;case"end":return e-1}throw new Error(`invalid anchor: ${t}`)}function hz(t){switch(`${t}`.toLowerCase()){case"centered":return"middle";case"leading":return"start";case"trailing":return"end"}throw new Error(`invalid shift: ${t}`)}function dz(t="mean"){if(typeof t=="string"){if(/^p\d{2}$/i.test(t))return d1(_f(t));switch(t.toLowerCase()){case"deviation":return d1(fr);case"max":return m1((e,n)=>It(e,r=>n[r]));case"mean":return mz;case"median":return d1(Rr);case"min":return m1((e,n)=>St(e,r=>n[r]));case"mode":return m1((e,n)=>kc(e,r=>n[r]));case"sum":return u9;case"variance":return d1(Ui);case"difference":return xz;case"ratio":return bz;case"first":return wz;case"last":return vz}}if(typeof t!="function")throw new Error(`invalid reduce: ${t}`);return m1(Mf(t))}function d1(t){return(e,n,r)=>r?{mapIndex(o,i,s){let a=f=>i[f]==null?NaN:+i[f],c=0;for(let f=0;f<e-1;++f)isNaN(a(f))&&++c;for(let f=0,u=o.length-e+1;f<u;++f)isNaN(a(f+e-1))&&++c,s[o[f+n]]=c===0?t(bi(o,f,f+e),a):NaN,isNaN(a(f))&&--c}}:{mapIndex(o,i,s){let a=c=>i[c]==null?NaN:+i[c];for(let c=-n;c<0;++c)s[o[c+n]]=t(bi(o,0,c+e),a);for(let c=0,f=o.length-n;c<f;++c)s[o[c+n]]=t(bi(o,c,c+e),a)}}}function m1(t){return(e,n,r)=>r?{mapIndex(o,i,s){let a=0;for(let c=0;c<e-1;++c)a+=Jt(i[o[c]]);for(let c=0,f=o.length-e+1;c<f;++c)a+=Jt(i[o[c+e-1]]),a===e&&(s[o[c+n]]=t(bi(o,c,c+e),i)),a-=Jt(i[o[c]])}}:{mapIndex(o,i,s){for(let a=-n;a<0;++a)s[o[a+n]]=t(bi(o,0,a+e),i);for(let a=0,c=o.length-n;a<c;++a)s[o[a+n]]=t(bi(o,a,a+e),i)}}}function u9(t,e,n){return n?{mapIndex(r,o,i){let s=0,a=0;for(let c=0;c<t-1;++c){let f=o[r[c]];f===null||isNaN(f)?++s:a+=+f}for(let c=0,f=r.length-t+1;c<f;++c){let u=o[r[c]],p=o[r[c+t-1]];p===null||isNaN(p)?++s:a+=+p,i[r[c+e]]=s===0?a:NaN,u===null||isNaN(u)?--s:a-=+u}}}:{mapIndex(r,o,i){let s=0,a=r.length;for(let c=0,f=Math.min(a,t-e-1);c<f;++c)s+=+o[r[c]]||0;for(let c=-e,f=a-e;c<f;++c)s+=+o[r[c+t-1]]||0,i[r[c+e]]=s,s-=+o[r[c]]||0}}}function mz(t,e,n){if(n){let r=u9(t,e,n);return{mapIndex(o,i,s){r.mapIndex(o,i,s);for(let a=0,c=o.length-t+1;a<c;++a)s[o[a+e]]/=t}}}else return{mapIndex(r,o,i){let s=0,a=0,c=r.length;for(let f=0,u=Math.min(c,t-e-1);f<u;++f){let p=o[r[f]];p!==null&&!isNaN(p=+p)&&(s+=p,++a)}for(let f=-e,u=c-e;f<u;++f){let p=o[r[f+t-1]],l=o[r[f]];p!==null&&!isNaN(p=+p)&&(s+=p,++a),i[r[f+e]]=s/a,l!==null&&!isNaN(l=+l)&&(s-=l,--a)}}}}function gz(t,e,n,r){for(let o=n+r;n<o;++n){let i=t[e[n]];if(Jt(i))return i}}function yz(t,e,n,r){for(let o=n+r-1;o>=n;--o){let i=t[e[o]];if(Jt(i))return i}}function l9(t,e,n,r){for(let o=n+r;n<o;++n){let i=t[e[n]];if(i!==null&&!isNaN(i=+i))return i}}function p9(t,e,n,r){for(let o=n+r-1;o>=n;--o){let i=t[e[o]];if(i!==null&&!isNaN(i=+i))return i}}function xz(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s){let c=o[r[s]],f=o[r[s+t-1]];i[r[s+e]]=c===null||f===null?NaN:f-c}}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=p9(o,r,s,t)-l9(o,r,s,t)}}}function bz(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s){let c=o[r[s]],f=o[r[s+t-1]];i[r[s+e]]=c===null||f===null?NaN:f/c}}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=p9(o,r,s,t)/l9(o,r,s,t)}}}function wz(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s)i[r[s+e]]=o[r[s]]}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=gz(o,r,s,t)}}}function vz(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s)i[r[s+e]]=o[r[s+t-1]]}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=yz(o,r,s,t)}}}var ki={n:20,k:2,color:"currentColor",opacity:.2,strict:!0,anchor:"end"};function h9(t,{x:e=X,y:n,k:r=ki.k,color:o=ki.color,opacity:i=ki.opacity,fill:s=o,fillOpacity:a=i,stroke:c=o,strokeOpacity:f,strokeWidth:u,...p}={}){return Se(Ft(s)?null:Ns(t,qn({x1:Os({k:-r,...p}),x2:Os({k:r,...p})},{x1:e,x2:e,y:n,fill:s,fillOpacity:a,...p})),Ft(c)?null:Rs(t,qn({x:Os(p)},{x:e,y:n,stroke:c,strokeOpacity:f,strokeWidth:u,...p})))}function d9(t,{x:e,y:n=X,k:r=ki.k,color:o=ki.color,opacity:i=ki.opacity,fill:s=o,fillOpacity:a=i,stroke:c=o,strokeOpacity:f,strokeWidth:u,...p}={}){return Se(Ft(s)?null:Ni(t,qn({y1:Os({k:-r,...p}),y2:Os({k:r,...p})},{x:e,y1:n,y2:n,fill:s,fillOpacity:a,...p})),Ft(c)?null:Ls(t,qn({y:Os(p)},{x:e,y:n,stroke:c,strokeOpacity:f,strokeWidth:u,...p})))}function Os({n:t=ki.n,k:e=0,strict:n=ki.strict,anchor:r=ki.anchor}={}){return tu({k:t,reduce:o=>Qo(o)+e*(fr(o)||0),strict:n,anchor:r})}var _z={ariaLabel:"tick",fill:null,stroke:"currentColor"},g1=class extends ft{constructor(e,n,r){super(e,n,r,_z),Pr(this,r)}render(e,n,r,o,i){return rt("svg:g",i).call(gt,this,o,i).call(this._transform,this,n).call(s=>s.selectAll().data(e).enter().append("line").call(lt,this).attr("x1",this._x1(n,r,o)).attr("x2",this._x2(n,r,o)).attr("y1",this._y1(n,r,o)).attr("y2",this._y2(n,r,o)).call(_t,this,r).call(Ii,this,r,i)).node()}},Eh=class extends g1{constructor(e,n={}){let{x:r,y:o,inset:i=0,insetTop:s=i,insetBottom:a=i}=n;super(e,{x:{value:r,scale:"x"},y:{value:o,scale:"y",type:"band",optional:!0}},n),this.insetTop=Rt(s),this.insetBottom=Rt(a)}_transform(e,n,{x:r}){e.call(ht,n,{x:r},ie,0)}_x1(e,{x:n}){return r=>n[r]}_x2(e,{x:n}){return r=>n[r]}_y1({y:e},{y:n},{marginTop:r}){let{insetTop:o}=this;return n&&e?i=>n[i]+o:r+o}_y2({y:e},{y:n},{height:r,marginBottom:o}){let{insetBottom:i}=this;return n&&e?s=>n[s]+e.bandwidth()-i:r-o-i}},Th=class extends g1{constructor(e,n={}){let{x:r,y:o,inset:i=0,insetRight:s=i,insetLeft:a=i}=n;super(e,{y:{value:o,scale:"y"},x:{value:r,scale:"x",type:"band",optional:!0}},n),this.insetRight=Rt(s),this.insetLeft=Rt(a)}_transform(e,n,{y:r}){e.call(ht,n,{y:r},0,ie)}_x1({x:e},{x:n},{marginLeft:r}){let{insetLeft:o}=this;return n&&e?i=>n[i]+o:r+o}_x2({x:e},{x:n},{width:r,marginRight:o}){let{insetRight:i}=this;return n&&e?s=>n[s]+e.bandwidth()-i:r-o-i}_y1(e,{y:n}){return r=>n[r]}_y2(e,{y:n}){return r=>n[r]}};function y1(t,{x:e=X,...n}={}){return new Eh(t,{...n,x:e})}function x1(t,{y:e=X,...n}={}){return new Th(t,{...n,y:e})}function m9(t,{x:e=X,y:n=null,r,fill:o="#ccc",fillOpacity:i,stroke:s="currentColor",strokeOpacity:a,strokeWidth:c=2,sort:f,...u}={}){let p=n!=null?gs:Kp;return Se(nr(t,p({x1:j6,x2:X6},{x:e,y:n,stroke:s,strokeOpacity:a,...u})),ko(t,p({x1:"p25",x2:"p75"},{x:e,y:n,fill:o,fillOpacity:i,...u})),y1(t,p({x:"p50"},{x:e,y:n,stroke:s,strokeOpacity:a,strokeWidth:c,sort:f,...u})),_r(t,qn({x:y9},{x:e,y:n,z:n,r,stroke:s,strokeOpacity:a,...u})))}function g9(t,{y:e=X,x:n=null,r,fill:o="#ccc",fillOpacity:i,stroke:s="currentColor",strokeOpacity:a,strokeWidth:c=2,sort:f,...u}={}){let p=n!=null?ms:Kp;return Se(er(t,p({y1:j6,y2:X6},{x:n,y:e,stroke:s,strokeOpacity:a,...u})),Ro(t,p({y1:"p25",y2:"p75"},{x:n,y:e,fill:o,fillOpacity:i,...u})),x1(t,p({y:"p50"},{x:n,y:e,stroke:s,strokeOpacity:a,strokeWidth:c,sort:f,...u})),_r(t,qn({y:y9},{x:n,y:e,z:n,r,stroke:s,strokeOpacity:a,...u})))}function y9(t){let e=j6(t),n=X6(t);return t.map(r=>r<e||r>n?r:NaN)}function j6(t){let e=x9(t)*2.5-b9(t)*1.5;return St(t,n=>n>=e?n:NaN)}function X6(t){let e=b9(t)*2.5-x9(t)*1.5;return It(t,n=>n<=e?n:NaN)}function x9(t){return vn(t,.25)}function b9(t){return vn(t,.75)}var Mz={ariaLabel:"raster",stroke:null,pixelSize:1};function eu(t,e){let n=+t;if(isNaN(n))throw new Error(`invalid ${e}: ${t}`);return n}function w9(t,e){let n=Math.floor(t);if(isNaN(n))throw new Error(`invalid ${e}: ${t}`);return n}var Ch=class extends ft{constructor(e,n,r={},o){let{width:i,height:s,x:a,y:c,x1:f=a==null?0:void 0,y1:u=c==null?0:void 0,x2:p=a==null?i:void 0,y2:l=c==null?s:void 0,pixelSize:h=o.pixelSize,blur:d=0,interpolate:m}=r;if(i!=null&&(i=w9(i,"width")),s!=null&&(s=w9(s,"height")),f!=null&&(f=eu(f,"x1")),u!=null&&(u=eu(u,"y1")),p!=null&&(p=eu(p,"x2")),l!=null&&(l=eu(l,"y2")),a==null&&(f==null||p==null))throw new Error("missing x");if(c==null&&(u==null||l==null))throw new Error("missing y");e!=null&&i!=null&&s!=null&&(a===void 0&&f!=null&&p!=null&&(a=kz(f,p,i,s)),c===void 0&&u!=null&&l!=null&&(c=Rz(u,l,i,s))),super(e,{x:{value:a,scale:"x",optional:!0},y:{value:c,scale:"y",optional:!0},x1:{value:f==null?null:[f],scale:"x",optional:!0,filter:null},y1:{value:u==null?null:[u],scale:"y",optional:!0,filter:null},x2:{value:p==null?null:[p],scale:"x",optional:!0,filter:null},y2:{value:l==null?null:[l],scale:"y",optional:!0,filter:null},...n},r,o),this.width=i,this.height=s,this.pixelSize=eu(h,"pixelSize"),this.blur=eu(d,"blur"),this.interpolate=a==null||c==null?null:Sz(m)}},Nh=class extends Ch{constructor(e,n={}){let{imageRendering:r}=n;if(e==null){let{fill:o,fillOpacity:i}=n;Pt(i)[0]!==void 0&&(n=b1("fillOpacity",n)),ne(o)[0]!==void 0&&(n=b1("fill",n))}super(e,void 0,n,Mz),this.imageRendering=Vt(r,"auto")}scale(e,{color:n,...r},o){return super.scale(e,r,o)}render(e,n,r,o,i){let s=n[r.channels.fill?.scale]??(I=>I),{x:a,y:c}=r,{document:f}=i,[u,p,l,h]=_9(r,o,i),d=l-u,m=h-p,{pixelSize:g,width:y=Math.round(Math.abs(d)/g),height:x=Math.round(Math.abs(m)/g)}=this,b=y*x,{fill:w,fillOpacity:_}=r,v=0;if(this.interpolate){let I=y/d,N=x/m,R=Mt(a,O=>(O-u)*I,Float64Array),$=Mt(c,O=>(O-p)*N,Float64Array);w&&(w=this.interpolate(e,y,x,R,$,w)),_&&(_=this.interpolate(e,y,x,R,$,_))}else this.data==null&&e&&(v=e.fi*b);let A=f.createElement("canvas");A.width=y,A.height=x;let E=A.getContext("2d"),T=E.createImageData(y,x),C=T.data,{r:S,g:k,b:L}=Ee(this.fill)??{r:0,g:0,b:0},M=(this.fillOpacity??1)*255;for(let I=0;I<b;++I){let N=I<<2;if(w){let R=s(w[I+v]);if(R==null){C[N+3]=0;continue}({r:S,g:k,b:L}=Ee(R))}_&&(M=_[I+v]*255),C[N+0]=S,C[N+1]=k,C[N+2]=L,C[N+3]=M}return this.blur>0&&h2(T,this.blur),E.putImageData(T,0,0),rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(I=>I.append("image").attr("transform",`translate(${u},${p}) scale(${Math.sign(l-u)},${Math.sign(h-p)})`).attr("width",Math.abs(d)).attr("height",Math.abs(m)).attr("preserveAspectRatio","none").call(ot,"image-rendering",this.imageRendering).call(lt,this).attr("xlink:href",A.toDataURL())).node()}};function W6(t,e,n){arguments.length<3&&(n=e,e=null);let{x:r,y:o,[t]:i,...s}=n;return r===void 0&&o===void 0&&HA(e)&&(r=Oa,o=us,i===void 0&&(i=XA)),[e,{...s,x:r,y:o,[t]:i}]}function v9(){let[t,e]=W6("fill",...arguments);return new Nh(t,t==null||e.fill!==void 0||e.fillOpacity!==void 0?e:{...e,fill:X})}function _9({x1:t,y1:e,x2:n,y2:r},o,{projection:i}){let{width:s,height:a,marginTop:c,marginRight:f,marginBottom:u,marginLeft:p}=o;return[t&&i==null?t[0]:p,e&&i==null?e[0]:c,n&&i==null?n[0]:s-f,r&&i==null?r[0]:a-u]}function G6({x1:t,y1:e,x2:n,y2:r},o,i,s){let a={};return t&&(a.x1=t),e&&(a.y1=e),n&&(a.x2=n),r&&(a.y2=r),_9(Nf(a,o),i,s)}function b1(t,e={}){let{[t]:n}=e;if(typeof n!="function")throw new Error(`invalid ${t}: not a function`);return Gt({...e,[t]:void 0},function(r,o,i,s,a,c){let{x:f,y:u}=s;if(!f)throw new Error("missing scale: x");if(!u)throw new Error("missing scale: y");let[p,l,h,d]=G6(i,s,a,c),m=h-p,g=d-l,{pixelSize:y}=this,{width:x=Math.round(Math.abs(m)/y),height:b=Math.round(Math.abs(g)/y)}=e,w=new Array(x*b*(o?o.length:1)),_=m/x,v=g/b,A=0;for(let E of o??[void 0])for(let T=.5;T<b;++T)for(let C=.5;C<x;++C,++A)w[A]=n(f.invert(p+C*_),u.invert(l+T*v),E);return{data:w,facets:o,channels:{[t]:{value:w,scale:"auto"}}}})}function Sz(t){if(typeof t=="function")return t;if(t==null)return w1;switch(`${t}`.toLowerCase()){case"none":return w1;case"nearest":return Rh;case"barycentric":return kh();case"random-walk":return Lh()}throw new Error(`invalid interpolate: ${t}`)}function w1(t,e,n,r,o,i){let s=new Array(e*n);for(let a of t)r[a]<0||r[a]>=e||o[a]<0||o[a]>=n||(s[Math.floor(o[a])*e+Math.floor(r[a])]=i[a]);return s}function kh({random:t=va(42)}={}){return(e,n,r,o,i,s)=>{let{points:a,triangles:c,hull:f}=pr.from(e,h=>o[h],h=>i[h]),u=new s.constructor(n*r).fill(NaN),p=new Uint8Array(n*r),l=Nz(s,t);for(let h=0;h<c.length;h+=3){let d=c[h],m=c[h+1],g=c[h+2],y=a[2*d],x=a[2*m],b=a[2*g],w=a[2*d+1],_=a[2*m+1],v=a[2*g+1],A=Math.min(y,x,b),E=Math.max(y,x,b),T=Math.min(w,_,v),C=Math.max(w,_,v),S=(_-v)*(y-b)+(w-v)*(b-x);if(!S)continue;let k=s[e[d]],L=s[e[m]],M=s[e[g]];for(let I=Math.floor(A);I<E;++I)for(let N=Math.floor(T);N<C;++N){if(I<0||I>=n||N<0||N>=r)continue;let R=I+.5,$=N+.5,O=Math.sign(S),D=(_-v)*(R-b)+($-v)*(b-x);if(D*O<0)continue;let F=(v-w)*(R-b)+($-v)*(y-b);if(F*O<0)continue;let P=S-(D+F);if(P*O<0)continue;let W=I+n*N;u[W]=l(k,D/S,L,F/S,M,P/S,I,N),p[W]=1}}return Az(u,p,o,i,s,n,r,f,e,l),u}}function Az(t,e,n,r,o,i,s,a,c,f){n=Float64Array.from(a,h=>n[c[h]]),r=Float64Array.from(a,h=>r[c[h]]),o=Array.from(a,h=>o[c[h]]);let u=n.length,p=Array.from({length:u},(h,d)=>Tz(d,n,r)),l=0;for(let h=0;h<s;++h){let d=h+.5;for(let m=0;m<i;++m){let g=m+i*h;if(!e[g]){let y=m+.5;for(let x=0;x<u;++x){let b=(u+l+(x%2?(x+1)/2:-x/2))%u;if(p[b](y,d)){let w=Ez(n.at(b-1),r.at(b-1),n[b],r[b],y,d);t[g]=f(o.at(b-1),w,o[b],1-w,o[b],0,m,h),l=b;break}}}}}}function Ez(t,e,n,r,o,i){let s=n-t,a=r-e,c=s*(n-o)+a*(r-i),f=s*(o-t)+a*(i-e);return c>0&&f>0?c/(c+f):+(c>f)}function Ih(t,e,n,r){return t*r-n*e}function Tz(t,e,n){let r=e.length,o=e.at(t-2),i=n.at(t-2),s=e.at(t-1),a=n.at(t-1),c=e[t],f=n[t],u=e.at(t+1-r),p=n.at(t+1-r),l=s-c,h=a-f,d=o-s,m=i-a,g=c-u,y=f-p,x=Math.hypot(l,h),b=Math.hypot(d,m),w=Math.hypot(g,y);return(_,v)=>{let A=_-s,E=v-a,T=_-c,C=v-f;return Ih(A,E,T,C)>-1e-6&&Ih(A,E,l,h)*b-Ih(A,E,d,m)*x>-1e-6&&Ih(T,C,g,y)*x-Ih(T,C,l,h)*w<=0}}function Rh(t,e,n,r,o,i){let s=new i.constructor(e*n),a=pr.from(t,u=>r[u],u=>o[u]),c,f;for(let u=.5,p=0;u<n;++u){f=c;for(let l=.5;l<e;++l,++p)f=a.find(l,u,f),l===.5&&(c=f),s[p]=i[t[f]]}return s}function Lh({random:t=va(42),minDistance:e=.5,maxSteps:n=2}={}){return(r,o,i,s,a,c)=>{let f=new c.constructor(o*i),u=pr.from(r,d=>s[d],d=>a[d]),p,l,h;for(let d=.5,m=0;d<i;++d){l=p;for(let g=.5;g<o;++g,++m){let y=g,x=d;h=l=u.find(y,x,l),g===.5&&(p=l);let b,w=0;for(;(b=Math.hypot(s[r[h]]-y,a[r[h]]-x))>e&&w<n;){let _=t(g,d,w)*2*Math.PI;y+=Math.cos(_)*b,x+=Math.sin(_)*b,h=u.find(y,x,h),++w}f[m]=c[r[h]]}}return f}}function Iz(t,e,n,r,o,i){return e*t+r*n+i*o}function Cz(t){return(e,n,r,o,i,s,a,c)=>{let f=t(a,c);return f<n?e:f<n+o?r:i}}function Nz(t,e){return wi(t)||re(t)?Iz:Cz(e)}function kz(t,e,n){return{transform(r){let o=r.length,i=new Float64Array(o),s=(e-t)/n,a=t+s/2;for(let c=0;c<o;++c)i[c]=c%n*s+a;return i}}}function Rz(t,e,n,r){return{transform(o){let i=o.length,s=new Float64Array(i),a=(e-t)/r,c=t+a/2;for(let f=0;f<i;++f)s[f]=Math.floor(f/n)%r*a+c;return s}}}var M9={ariaLabel:"contour",fill:"none",stroke:"currentColor",strokeMiterlimit:1,pixelSize:2},Oh=class extends Ch{constructor(e,{smooth:n=!0,value:r,...o}={}){let i=Ox({},o,M9);if(r===void 0){for(let a in i)if(i[a].value!=null){if(r!==void 0)throw new Error("ambiguous contour value");r=o[a],o[a]="value"}}if(r!=null){let a={transform:c=>c.map(f=>f.value),label:Ke(r)};for(let c in i)o[c]==="value"&&(o[c]=a)}if(e==null){if(r==null)throw new Error("missing contour value");o=b1("value",{value:r,...o}),r=null}else{let{interpolate:a}=o;r===void 0&&(r=X),a===void 0&&(o.interpolate="nearest")}super(e,{value:{value:r,optional:!0}},Lz(o),M9);let s={geometry:{value:X}};for(let a in this.channels){let c=this.channels[a],{scale:f}=c;f==="x"||f==="y"||a==="value"||(s[a]=c,delete this.channels[a])}this.contourChannels=s,this.smooth=!!n}filter(e,{x:n,y:r,value:o,...i},s){return super.filter(e,i,s)}render(e,n,r,o,i){let{geometry:s}=r,a=Oe();return rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(c=>{c.selectAll().data(e).enter().append("path").call(lt,this).attr("d",f=>a(s[f])).call(_t,this,r)}).node()}};function Lz({thresholds:t,interval:e,...n}){return t=q6(t,e,ji),Gt(n,function(r,o,i,s,a,c){let[f,u,p,l]=G6(i,s,a,c),h=p-f,d=l-u,{pixelSize:m,width:g=Math.round(Math.abs(h)/m),height:y=Math.round(Math.abs(d)/m)}=this,x=g/h,b=y/d,w=i.value.value,_=[];if(this.interpolate){let{x:C,y:S}=Eo(i,s,c),k=Mt(C,N=>(N-f)*x,Float64Array),L=Mt(S,N=>(N-u)*b,Float64Array),M=[i.x,i.y,i.value],I=[k,L,w];for(let N of o){let R=this.filter(N,M,I);_.push(this.interpolate(R,g,y,k,L,w))}}else if(o){let C=g*y,S=o.length;for(let k=0;k<S;++k)_.push(w.slice(k*C,k*C+C))}else _.push(w);if(this.blur>0)for(let C of _)fl({data:C,width:g,height:y},this.blur);let v=Oz(t,w,...$z(_));if(v===null)throw new Error(`unsupported thresholds: ${t}`);let{contour:A}=Zi().size([g,y]).smooth(this.smooth),E=[],T=[];for(let C of _)T.push(le(E.length,E.push(...Mt(v,S=>A(C,S)))));for(let{coordinates:C}of E)for(let S of C)for(let k of S)for(let L of k)L[0]=L[0]/x+f,L[1]=L[1]/b+u;return{data:E,facets:T,channels:vx(this.contourChannels,E)}})}function Oz(t,e,n,r){if(typeof t?.range=="function")return t.range(t.floor(n),r);if(typeof t=="function"&&(t=t(e,n,r)),typeof t!="number")return Zn(t);let o=Ge(...Cc(n,r,t),t);for(;o[o.length-1]>=r;)o.pop();for(;o[1]<n;)o.shift();return o}function A9(){return new Oh(...W6("value",...arguments))}function $z(t){return[St(t,e=>St(e,S9)),It(t,e=>It(e,S9))]}function S9(t){return isFinite(t)?t:NaN}function I9(t,e){return V6(_s,t,e)}function C9(t,e={}){return V6(Ms,t,e)}function N9(t,e={}){return V6(Ti,t,e)}function V6(t,e,n={}){let{x:r,y:o,maxRadius:i}=n,s=t({px:r,py:o,maxRadius:i}),a=[];r!=null&&a.push(er(e,E9("x",{...s,inset:-6},n))),o!=null&&a.push(nr(e,E9("y",{...s,inset:-6},n))),r!=null&&a.push(Io(e,T9("x",{...s,dy:9,frameAnchor:"bottom",lineAnchor:"top"},n))),o!=null&&a.push(Io(e,T9("y",{...s,dx:-9,frameAnchor:"left",textAnchor:"end"},n)));for(let c of a)c.ariaLabel=`crosshair ${c.ariaLabel}`;return Se(...a)}function k9(t,{channels:e,...n},{facet:r,facetAnchor:o,fx:i,fy:s,[t]:a,channels:c,transform:f,initializer:u}){return{...n,facet:r,facetAnchor:o,fx:i,fy:s,[t]:a,channels:{...e,...c},transform:f,initializer:Dz(t,u)}}function Dz(t,e){return e==null?e:function(n,r,{x:o,y:i,px:s,py:a,...c},...f){let{channels:{x:u,y:p,...l}={},...h}=e.call(this,n,r,{...c,x:s,y:a},...f);return{channels:{...l,...u&&{px:u,...t==="x"&&{x:u}},...p&&{py:p,...t==="y"&&{y:p}}},...h}}}function E9(t,e,n){let{color:r="currentColor",opacity:o=.2,ruleStroke:i=r,ruleStrokeOpacity:s=o,ruleStrokeWidth:a}=n;return{...k9(t,e,n),stroke:i,strokeOpacity:s,strokeWidth:a}}function T9(t,e,n){let{color:r="currentColor",textFill:o=r,textFillOpacity:i,textStroke:s="var(--plot-background)",textStrokeOpacity:a,textStrokeWidth:c=5}=n;return{...k9(t,e,Fz(t,n)),fill:o,fillOpacity:i,stroke:s,strokeOpacity:a,strokeWidth:c}}function Fz(t,e){return Gt(e,(n,r,o)=>({channels:{text:{value:eh(o,t)?.value}}}))}var Pz={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},qz={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},Bz={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},zz={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Yz={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},H6=class extends ft{constructor(e,n={}){let{x:r,y:o,z:i,curve:s,tension:a}=n;super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},z:{value:i,optional:!0}},n,Pz),this.curve=bh(s,a),Pr(this,n)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,z:u}=r,{curve:p}=this,[l,h]=ze(this,o),d=c?x=>c[x]:oe(l),m=f?x=>f[x]:oe(h),g=this;function y(x){let b=-1,w=[],_={};for(let M in r)_[M]=[];let v=[],A=[],E=[],T=[];function C(M,I){M=x[M],I=x[I],w.push(++b),v[b]=d(M),E[b]=m(M),A[b]=d(I),T[b]=m(I);for(let N in r)_[N].push(r[N][I])}let{halfedges:S,hull:k,triangles:L}=pr.from(x,d,m);for(let M=0;M<S.length;++M){let I=S[M];I>M&&C(L[M],L[I])}for(let M=0;M<k.length;++M)C(k[M],k[(M+1)%k.length]);At(this).selectAll().data(w).enter().append("path").call(lt,g).attr("d",M=>{let I=An(),N=p(I);return N.lineStart(),N.point(v[M],E[M]),N.point(A[M],T[M]),N.lineEnd(),I}).call(_t,g,_).call(Ii,g,_,i)}return rt("svg:g",i).call(gt,this,o,i).call(ht,this,{x:c&&s,y:f&&a}).call(u?x=>x.selectAll().data(We(e,b=>u[b]).values()).enter().append("g").each(y):x=>x.datum(e).each(y)).node()}},$h=class extends ft{constructor(e,n={},r,o=({z:i})=>i){let{x:i,y:s}=n;super(e,{x:{value:i,scale:"x",optional:!0},y:{value:s,scale:"y",optional:!0},z:{value:o(n),optional:!0}},n,r)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,z:u}=r,[p,l]=ze(this,o),h=c?y=>c[y]:oe(p),d=f?y=>f[y]:oe(l),m=this;function g(y){let x=pr.from(y,h,d);At(this).append("path").datum(y[0]).call(lt,m).attr("d",m._render(x,o)).call(_t,m,r)}return rt("svg:g",i).call(gt,this,o,i).call(ht,this,{x:c&&s,y:f&&a}).call(u?y=>y.selectAll().data(We(e,x=>u[x]).values()).enter().append("g").each(g):y=>y.datum(e).each(g)).node()}},Q6=class extends $h{constructor(e,n={}){super(e,n,qz),this.fill="none"}_render(e){return e.render()}},Z6=class extends $h{constructor(e,n={}){super(e,n,Bz,pn)}_render(e){return e.renderHull()}},K6=class extends ft{constructor(e,n={}){let{x:r,y:o,z:i}=n;super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},z:{value:i,optional:!0}},Gt(n,function(s,a,c,f,u,p){let{x:l,y:h,z:d}=c;({x:l,y:h}=Eo(c,f,p)),d=d?.value;let m=new Array((l??h).length).fill(null),[g,y]=ze(this,u),x=l?w=>l[w]:oe(g),b=h?w=>h[w]:oe(y);for(let w of a){l&&(w=w.filter(_=>Jt(x(_)))),h&&(w=w.filter(_=>Jt(b(_))));for(let[,_]of Mo(w,d)){let v=pr.from(_,x,b),A=R9(v,u);for(let E=0,T=_.length;E<T;++E)m[_[E]]=A.renderCell(E)}}return{data:s,facets:a,channels:{cells:{value:m}}}}),zz)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,cells:u}=r;return rt("svg:g",i).call(gt,this,o,i).call(ht,this,{x:c&&s,y:f&&a}).call(p=>{p.selectAll().data(e).enter().append("path").call(lt,this).attr("d",l=>u[l]).call(_t,this,r)}).node()}},J6=class extends $h{constructor(e,n){super(e,n,Yz),this.fill="none"}_render(e,n){return R9(e,n).render()}};function R9(t,e){let{width:n,height:r,marginTop:o,marginRight:i,marginBottom:s,marginLeft:a}=e;return t.voronoi([a,o,n-i,r-s])}function Dh(t,e,{x:n,y:r,...o}={}){return[n,r]=ce(n,r),new t(e,{...o,x:n,y:r})}function L9(t,e){return Dh(H6,t,e)}function O9(t,e){return Dh(Q6,t,e)}function $9(t,e){return Dh(Z6,t,e)}function D9(t,{x:e,y:n,initializer:r,...o}={}){return Dh(K6,t,{...Me({...o,x:e,y:n},t1),initializer:r})}function F9(t,e){return Dh(J6,t,e)}var Uz={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Fh=class extends ft{constructor(e,{x:n,y:r,z:o,weight:i,fill:s,stroke:a,...c}={}){let f=P9(s)&&(s="currentColor",!0),u=P9(a)&&(a="currentColor",!0);super(e,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:pn({z:o,fill:s,stroke:a}),optional:!0},weight:{value:i,optional:!0}},Xz({...c,fill:s,stroke:a},f,u),Uz),f&&(this.fill=void 0),u&&(this.stroke=void 0),this.z=o}filter(e){return e}render(e,n,r,o,i){let{contours:s}=r,a=Oe();return rt("svg:g",i).call(gt,this,o,i).call(ht,this,{}).call(c=>c.selectAll().data(e).enter().append("path").call(lt,this).call(_t,this,r).attr("d",f=>a(s[f]))).node()}};function q9(t,{x:e,y:n,...r}={}){return[e,n]=ce(e,n),new Fh(t,{...r,x:e,y:n})}var jz=new Set(["x","y","z","weight"]);function Xz(t,e,n){let{bandwidth:o,thresholds:i}=t;return o=o===void 0?20:+o,i=i===void 0?20:typeof i?.[Symbol.iterator]=="function"?_e(i):+i,Gt(t,function(s,a,c,f,u,p){let l=c.weight?_e(c.weight.value):null,h=c.z?.value,{z:d}=this,[m,g]=ze(this,u),{width:y,height:x}=u,{x:b,y:w}=Eo(c,f,p),_=Object.fromEntries(Object.entries(c).filter(([L])=>!jz.has(L)).map(([L,M])=>[L,{...M,value:[]}])),v=e&&[],A=n&&[],E=ew().x(b?L=>b[L]:m).y(w?L=>w[L]:g).weight(l?L=>l[L]:1).size([y,x]).bandwidth(o),T=[];for(let L of a){let M=[];T.push(M);for(let I of h?sh(L,h,d):[L]){let N=E.contours(I);M.push([I,N])}}let C=i;if(!(C instanceof Gp)){let L=0;for(let M of T)for(let[,I]of M){let N=I.max;N>L&&(L=N)}C=Float64Array.from({length:i-1},(M,I)=>L*100*(I+1)/i)}let S=[],k=[];for(let L of T){let M=[];S.push(M);for(let[I,N]of L)for(let R of C){M.push(k.length),k.push(N(R/100)),v&&v.push(R),A&&A.push(R);for(let $ in _)_[$].value.push(c[$].value[I[0]])}}return v&&v.push(0),A&&A.push(0),{data:s,facets:S,channels:{..._,...v&&{fill:{value:v,scale:"color"}},...A&&{stroke:{value:A,scale:"color"}},contours:{value:k}}}})}function P9(t){return/^density$/i.test(t)}function Y9(t,e){return j9("x",t,e)}function U9(t,e){return j9("y",t,e)}function j9(t,e,{x1:n,x2:r,y1:o,y2:i,x:s=n===void 0&&r===void 0?t==="y"?Xt:X:void 0,y:a=o===void 0&&i===void 0?t==="x"?Xt:X:void 0,fill:c,positiveFill:f="#3ca951",negativeFill:u="#4269d0",fillOpacity:p=1,positiveFillOpacity:l=p,negativeFillOpacity:h=p,stroke:d,strokeOpacity:m,z:g=ne(d)[0],clip:y,tip:x,render:b,...w}={}){return[n,r]=B9(s,n,r),[o,i]=B9(a,o,i),n===r&&o===i&&(t==="y"?o=Ri(0):n=Ri(0)),{tip:x}=Fr({tip:x},t==="y"?"x":"y"),Se(Ft(f)?null:Object.assign(wh(e,{x1:n,x2:r,y1:o,y2:i,z:g,fill:f,fillOpacity:l,render:Ei(b,z9(t,!0)),clip:y,...w}),{ariaLabel:"positive difference"}),Ft(u)?null:Object.assign(wh(e,{x1:n,x2:r,y1:o,y2:i,z:g,fill:u,fillOpacity:h,render:Ei(b,z9(t,!1)),clip:y,...w}),{ariaLabel:"negative difference"}),Ja(e,{x:r,y:i,z:g,stroke:d,strokeOpacity:m,tip:x,clip:!0,...w}))}function B9(t,e,n){return e===void 0&&n===void 0?e=n=Ri(t):e===void 0?(n=Ri(n),e=t===void 0?n:Ri(t)):n===void 0?(e=Ri(e),n=t===void 0?e:Ri(t)):(e=Ri(e),n=Ri(n)),[e,n]}function Ri(t){let e,{value:n,label:r=Ke(n)}=wr(t);return{transform:o=>e||(e=ct(o,n)),label:r}}function z9(t,e){let n=t==="x"?"y":"x",r=`${n}1`,o=`${n}2`,i=`${t}1`,s=`${t}2`;return(a,c,f,u,p,l)=>{let{[r]:h,[o]:d}=f,m=new Float32Array(h.length),g=new Float32Array(d.length),y=u[t==="y"?"height":"width"];(e===Ax(c[t])<0?m:g).fill(y);let x=l(a,c,{...f,[o]:h,[s]:g},u,p),b=l(a,c,{...f,[r]:d,[i]:m},u,p),w=x.querySelector("g")??x,_=b.querySelector("g")??b;for(let v=0;w.firstChild;v+=2){let A=d6(),E=rt("svg:clipPath",p).attr("id",A).node();E.appendChild(w.firstChild),_.childNodes[v].setAttribute("clip-path",`url(#${A})`),_.insertBefore(E,_.childNodes[v])}return b}}function v1({geometry:t=X,...e}={}){let n=ws(r=>ct(r,t));return Gt({...e,x:null,y:null,geometry:{transform:n}},(r,o,i,s,a,{projection:c})=>{let f=n(r),u=f.length,p=new Float64Array(u),l=new Float64Array(u),h=Oe(c);for(let d=0;d<u;++d)[p[d],l[d]]=h.centroid(f[d]);return{data:r,facets:o,channels:{x:{value:p,scale:c==null?"x":null,source:null},y:{value:l,scale:c==null?"y":null,source:null}}}})}function X9({geometry:t=X,...e}={}){let n=ws(o=>ct(o,t)),r=ws(o=>ct(n(o),yw));return{...e,x:{transform:o=>Float64Array.from(r(o),([i])=>i)},y:{transform:o=>Float64Array.from(r(o),([,i])=>i)},geometry:{transform:n}}}var Wz={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Ph=class extends ft{constructor(e,n={}){let[r,o]=Pt(n.r,3);super(e,{x:{value:n.tip?n.x:null,scale:"x",optional:!0},y:{value:n.tip?n.y:null,scale:"y",optional:!0},r:{value:r,scale:"r",filter:Nn,optional:!0},geometry:{value:n.geometry,scale:"projection"}},Sh(n),Wz),this.r=o}render(e,n,r,o,i){let{geometry:s,r:a}=r,c=Oe(i.projection??Gz(n)),{r:f}=this;return is(f)?e=[]:f!==void 0&&c.pointRadius(f),rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(u=>{u.selectAll().data(e).enter().append("path").call(lt,this).attr("d",a?p=>c.pointRadius(a[p])(s[p]):p=>c(s[p])).call(_t,this,r)}).node()}};function Gz({x:t,y:e}){if(t||e)return t??=n=>n,e??=n=>n,ba({point(n,r){this.stream.point(t(n),e(r))}})}function _1(t,e={}){return e.tip&&e.x===void 0&&e.y===void 0?e=v1(e):e.geometry===void 0&&(e={...e,geometry:X}),new Ph(t,e)}function W9({strokeWidth:t=1.5,...e}={}){return _1({type:"Sphere"},{strokeWidth:t,...e})}function G9({strokeOpacity:t=.1,...e}={}){return _1(Mw(),{strokeOpacity:t,...e})}var nu=.5,ru=0;function V9(t={fill:"count"},{binWidth:e,...n}={}){let{z:r}=n;return e=e===void 0?20:Rt(e),t=z_(t,n),So(t,"fill")&&(n.channels={...n.channels,fill:{value:[]}}),n.symbol===void 0&&(n.symbol="hexagon"),n.r===void 0&&!So(t,"r")&&(n.r=e/2),Gt(n,(o,i,s,a,c,f)=>{let{x:u,y:p,z:l,fill:h,stroke:d,symbol:m}=s;if(u===void 0)throw new Error("missing channel: x");if(p===void 0)throw new Error("missing channel: y");({x:u,y:p}=Eo(s,a,f)),l=l?l.value:ct(o,r),h=h?.value,d=d?.value,m=m?.value;let g=th(t,{z:l,fill:h,stroke:d,symbol:m}),y=l&&[],x=h&&[],b=d&&[],w=m&&[],_=[],v=[],A=[],E=-1;for(let k of t)k.initialize(o);for(let k of i){let L=[];for(let M of t)M.scope("facet",k);for(let[M,I]of Mo(k,g))for(let{index:N,extent:R}of Vz(o,I,u,p,e)){L.push(++E),v.push(R.x),A.push(R.y),l&&y.push(g===l?M:l[N[0]]),h&&x.push(g===h?M:h[N[0]]),d&&b.push(g===d?M:d[N[0]]),m&&w.push(g===m?M:m[N[0]]);for(let $ of t)$.reduce(N,R)}_.push(L)}let T=s.x.scale,C=s.y.scale,S={x:{value:v,source:a[T]?{value:Mt(v,a[T].invert),scale:T}:null},y:{value:A,source:a[C]?{value:Mt(A,a[C].invert),scale:C}:null},...l&&{z:{value:y}},...h&&{fill:{value:x,scale:"auto"}},...d&&{stroke:{value:b,scale:"auto"}},...m&&{symbol:{value:w,scale:"auto"}},...Object.fromEntries(t.map(({name:k,output:L})=>[k,{scale:"auto",label:L.label,radius:k==="r"?e/2:void 0,value:L.transform()}]))};return{data:o,facets:_,channels:S}})}function Vz(t,e,n,r,o){let i=o*(1.5/k_),s=new Map;for(let a of e){let c=n[a],f=r[a];if(isNaN(c)||isNaN(f))continue;let u=Math.round(f=(f-ru)/i),p=Math.round(c=(c-nu)/o-(u&1)/2),l=f-u;if(Math.abs(l)*3>1){let m=c-p,g=p+(c<p?-1:1)/2,y=u+(f<u?-1:1),x=c-g,b=f-y;m*m+l*l>x*x+b*b&&(p=g+(u&1?1:-1)/2,u=y)}let h=`${p},${u}`,d=s.get(h);d===void 0&&(d={index:[],extent:{data:t,x:(p+(u&1)/2)*o+nu,y:u*i+ru}},s.set(h,d)),d.index.push(a)}return s.values()}var Hz={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};function H9(t){return new qh(t)}var qh=class extends ft{constructor({binWidth:e=20,clip:n=!0,...r}={}){super(fs,void 0,{clip:n,...r},Hz),this.binWidth=Rt(e)}render(e,n,r,o,i){let{binWidth:s}=this,{marginTop:a,marginRight:c,marginBottom:f,marginLeft:u,width:p,height:l}=o,h=u-nu,d=p-c-nu,m=a-ru,g=l-f-ru,y=s/2,x=y*R_,b=x/2,w=y*2,_=x*1.5,v=Math.floor(h/w),A=Math.ceil(d/w),E=Math.floor((m+b)/_),T=Math.ceil((g-b)/_)+1,C=`m0,${$s(-x)}l${$s(y)},${$s(b)}v${$s(x)}l${$s(-y)},${$s(b)}`,S=C;for(let k=E;k<T;++k)for(let L=v;L<A;++L)S+=`M${$s(L*w+(k&1)*y)},${$s(k*_)}${C}`;return rt("svg:g",i).datum(0).call(gt,this,o,i).call(ht,this,{},ie+nu,ie+ru).call(k=>k.append("path").call(lt,this).call(_t,this,r).attr("d",S)).node()}};function $s(t){return Math.round(t*1e3)/1e3}var Qz={ariaLabel:"image",fill:null,stroke:null};function Zz(t){return/^\.*\//.test(t)}function Kz(t){return/^(blob|data|file|http|https):/i.test(t)}function Jz(t){return typeof t=="string"&&(Zz(t)||Kz(t))?[void 0,t]:[t,void 0]}var Bh=class extends ft{constructor(e,n={}){let{x:r,y:o,r:i,width:s,height:a,rotate:c,src:f,preserveAspectRatio:u,crossOrigin:p,frameAnchor:l,imageRendering:h}=n;i==null&&(i=void 0),i===void 0&&s===void 0&&a===void 0?s=a=16:s===void 0&&a!==void 0?s=a:a===void 0&&s!==void 0&&(a=s);let[d,m]=Jz(f),[g,y]=Pt(i),[x,b]=Pt(s,y!==void 0?y*2:void 0),[w,_]=Pt(a,y!==void 0?y*2:void 0),[v,A]=Pt(c,0);super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},r:{value:g,scale:"r",filter:Nn,optional:!0},width:{value:x,filter:Nn,optional:!0},height:{value:w,filter:Nn,optional:!0},rotate:{value:v,optional:!0},src:{value:d,optional:!0}},Sh(n),Qz),this.src=m,this.width=b,this.rotate=A,this.height=_,this.r=y,this.preserveAspectRatio=Vt(u,"xMidYMid"),this.crossOrigin=pe(p),this.frameAnchor=_o(l),this.imageRendering=Vt(h,"auto")}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,width:u,height:p,r:l,rotate:h,src:d}=r,{r:m,width:g,height:y,rotate:x}=this,[b,w]=ze(this,o);return rt("svg:g",i).call(gt,this,o,i).call(ht,this,{x:c&&s,y:f&&a}).call(_=>_.selectAll().data(e).enter().append("image").call(lt,this).attr("x",Q9(c,u,l,b,g,m)).attr("y",Q9(f,p,l,w,y,m)).attr("width",u?v=>u[v]:g!==void 0?g:l?v=>l[v]*2:m*2).attr("height",p?v=>p[v]:y!==void 0?y:l?v=>l[v]*2:m*2).attr("transform",h?v=>`rotate(${h[v]})`:x?`rotate(${x})`:null).attr("transform-origin",h||x?qr`${c?v=>c[v]:b}px ${f?v=>f[v]:w}px`:null).call(ot,"href",d?v=>d[v]:this.src).call(ot,"preserveAspectRatio",this.preserveAspectRatio).call(ot,"crossorigin",this.crossOrigin).call(ot,"image-rendering",this.imageRendering).call(ot,"clip-path",l?v=>`circle(${l[v]}px)`:m!==void 0?`circle(${m}px)`:null).call(_t,this,r)).node()}};function Q9(t,e,n,r,o,i){return e&&t?s=>t[s]-e[s]/2:e?s=>r-e[s]/2:t&&o!==void 0?s=>t[s]-o/2:o!==void 0?r-o/2:n&&t?s=>t[s]-n[s]:n?s=>r-n[s]:t?s=>t[s]-i:r-i}function Z9(t,{x:e,y:n,...r}={}){return r.frameAnchor===void 0&&([e,n]=ce(e,n)),new Bh(t,{...r,x:e,y:n})}function tY(t,e,n){var r=1e-8,o=e-1,i=n-1,s=0,a,c,f,u,p,l,h,d,m,g,y;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&n>=1?(f=t<.5?t:1-t,u=Math.sqrt(-2*Math.log(f)),h=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,t<.5&&(h=-h),d=(h*h-3)/6,m=2/(1/(2*e-1)+1/(2*n-1)),g=h*Math.sqrt(d+m)/m-(1/(2*n-1)-1/(2*e-1))*(d+5/6-2/(3*m)),h=e/(e+n*Math.exp(2*g))):(a=Math.log(e/(e+n)),c=Math.log(n/(e+n)),u=Math.exp(e*a)/e,p=Math.exp(n*c)/n,g=u+p,t<u/g?h=Math.pow(e*g*t,1/e):h=1-Math.pow(n*g*(1-t),1/n)),y=-ou(e)-ou(n)+ou(e+n);s<10;s++){if(h===0||h===1)return h;if(l=eY(h,e,n)-t,u=Math.exp(o*Math.log(h)+i*Math.log(1-h)+y),p=l/u,h-=u=p/(1-.5*Math.min(1,p*(o/h-i/(1-h)))),h<=0&&(h=.5*(h+u)),h>=1&&(h=.5*(h+u+1)),Math.abs(u)<r*h&&s>0)break}return h}function eY(t,e,n){var r=t===0||t===1?0:Math.exp(ou(e+n)-ou(e)-ou(n)+e*Math.log(t)+n*Math.log(1-t));return t<0||t>1?!1:t<(e+1)/(e+n+2)?r*K9(t,e,n)/e:1-r*K9(1-t,n,e)/n}function K9(t,e,n){var r=1e-30,o=1,i=e+n,s=e+1,a=e-1,c=1,f=1-i*t/s,u,p,l,h;for(Math.abs(f)<r&&(f=r),f=1/f,h=f;o<=100&&(u=2*o,p=o*(n-o)*t/((a+u)*(e+u)),f=1+p*f,Math.abs(f)<r&&(f=r),c=1+p/c,Math.abs(c)<r&&(c=r),f=1/f,h*=f*c,p=-(e+o)*(i+o)*t/((e+u)*(s+u)),f=1+p*f,Math.abs(f)<r&&(f=r),c=1+p/c,Math.abs(c)<r&&(c=r),f=1/f,l=f*c,h*=l,!(Math.abs(l-1)<3e-7));o++);return h}function ou(t){var e=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,o,i,s;for(s=(i=o=t)+5.5,s-=(o+.5)*Math.log(s);e<6;e++)r+=n[e]/++i;return Math.log(2.506628274631*r/o)-s}function J9(t,e){var n=tY(2*Math.min(t,1-t),.5*e,.5);return n=Math.sqrt(e*(1-n)/n),t>.5?n:-n}var nY={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},M1=class extends ft{constructor(e,n={}){let{x:r,y:o,z:i,ci:s=.95,precision:a=4}=n;if(super(e,{x:{value:r,scale:"x"},y:{value:o,scale:"y"},z:{value:pn(n),optional:!0}},n,nY),this.z=i,this.ci=+s,this.precision=+a,!(0<=this.ci&&this.ci<1))throw new Error(`invalid ci; not in [0, 1): ${s}`);if(!(this.precision>0))throw new Error(`invalid precision: ${a}`)}render(e,n,r,o,i){let{x:s,y:a,z:c}=r,{ci:f}=this;return rt("svg:g",i).call(gt,this,o,i).call(ht,this,n).call(u=>u.selectAll().data(c?sh(e,c,this.z):[e]).enter().call(p=>p.append("path").attr("fill","none").call(lt,this).call(qa,this,{...r,fill:null,fillOpacity:null}).attr("d",l=>this._renderLine(l,s,a)).call(f&&!vi(this.fill)?l=>l.select(rY).attr("stroke","none").call(lt,this).call(qa,this,{...r,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",h=>this._renderBand(h,s,a)):()=>{}))).node()}};function rY(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(_n.svg,"path"),this)}var t3=class extends M1{constructor(e,n){super(e,n)}_renderBand(e,n,r){let{ci:o,precision:i}=this,[s,a]=Ot(e,u=>r[u]),c=S1(e,r,n),f=nI(e,r,n,(1-o)/2,c);return hf().y(u=>u).x0(u=>f(u,-1)).x1(u=>f(u,1))(le(s,a-i/2,i).concat(a))}_renderLine(e,n,r){let[o,i]=Ot(e,a=>r[a]),s=S1(e,r,n);return`M${s(o)},${o}L${s(i)},${i}`}},e3=class extends M1{constructor(e,n){super(e,n)}_renderBand(e,n,r){let{ci:o,precision:i}=this,[s,a]=Ot(e,u=>n[u]),c=S1(e,n,r),f=nI(e,n,r,(1-o)/2,c);return hf().x(u=>u).y0(u=>f(u,-1)).y1(u=>f(u,1))(le(s,a-i/2,i).concat(a))}_renderLine(e,n,r){let[o,i]=Ot(e,a=>n[a]),s=S1(e,n,r);return`M${o},${s(o)}L${i},${s(i)}`}};function tI(t,{y:e=Xt,x:n=X,stroke:r,fill:o=Ft(r)?"currentColor":r,...i}={}){return new t3(t,Hf({...i,x:n,y:e,fill:o,stroke:r}))}function eI(t,{x:e=Xt,y:n=X,stroke:r,fill:o=Ft(r)?"currentColor":r,...i}={}){return new e3(t,Vf({...i,x:e,y:n,fill:o,stroke:r}))}function S1(t,e,n){let r=0,o=0,i=0,s=0;for(let u of t){let p=e[u],l=n[u];r+=p,o+=l,i+=p*l,s+=p*p}let a=t.length,c=(a*i-r*o)/(a*s-r*r),f=(o-c*r)/a;return u=>c*u+f}function nI(t,e,n,r,o){let i=Ve(t,u=>e[u])/t.length,s=0,a=0;for(let u of t)s+=(e[u]-i)**2,a+=(n[u]-o(e[u]))**2;let c=Math.sqrt(a/(t.length-2)),f=J9(r,t.length-2);return(u,p)=>{let l=o(u),h=c*Math.sqrt(1/t.length+(u-i)**2/s);return l+p*f*h}}function zh({path:t=X,delimiter:e,frameAnchor:n,treeLayout:r=wa,treeSort:o,treeSeparation:i,treeAnchor:s,treeFilter:a,...c}={}){s=I1(s),o=iI(o),a!=null&&(a=r3(a)),n===void 0&&(n=s.frameAnchor);let f=sI(e),u=hI(c,r3),[p,l]=qe(),[h,d]=qe();return{x:p,y:h,frameAnchor:n,...Me(c,(m,g)=>{let y=f(ct(m,t)),x=l([]),b=d([]),w=-1,_=[],v=[],A=wg().path(C=>y[C]),E=Pn(m)?C=>C.data=m[C.data]:C=>C.data=m.get(C.data),T=r();T.nodeSize&&T.nodeSize([1,1]),T.separation&&i!==void 0&&T.separation(i??Vp);for(let C of u)C[E1]=C[lI]([]);for(let C of g){let S=[],k=A(C.filter(L=>y[L]!=null)).each(E);o!=null&&k.sort(o),T(k);for(let L of k.descendants())if(!(a!=null&&!a(L))){S.push(++w),_[w]=L.data,s.position(L,w,x,b);for(let M of u)M[E1][w]=M[pI](L)}v.push(S)}return{data:_,facets:v}}),...Object.fromEntries(u)}}function T1({path:t=X,delimiter:e,curve:n="bump-x",stroke:r="#555",strokeWidth:o=1.5,strokeOpacity:i=.5,treeLayout:s=wa,treeSort:a,treeSeparation:c,treeAnchor:f,treeFilter:u,...p}={}){f=I1(f),a=iI(a),u!=null&&(u=oI(u)),p={curve:n,stroke:r,strokeWidth:o,strokeOpacity:i,...p};let l=sI(e),h=hI(p,oI),[d,m]=qe(),[g,y]=qe(),[x,b]=qe(),[w,_]=qe();return{x1:d,x2:g,y1:x,y2:w,...Me(p,(v,A)=>{let E=l(ct(v,t)),T=m([]),C=y([]),S=b([]),k=_([]),L=-1,M=[],I=[],N=wg().path($=>E[$]),R=s();R.nodeSize&&R.nodeSize([1,1]),R.separation&&c!==void 0&&R.separation(c??Vp);for(let $ of h)$[E1]=$[lI]([]);for(let $ of A){let O=[],D=N($.filter(F=>E[F]!=null)).each(F=>F.data=v[F.data]);a!=null&&D.sort(a),R(D);for(let{source:F,target:P}of D.links())if(!(u!=null&&!u(P,F))){O.push(++L),M[L]=P.data,f.position(F,L,T,S),f.position(P,L,C,k);for(let W of h)W[E1][L]=W[pI](P,F)}I.push(O)}return{data:M,facets:I}}),...Object.fromEntries(h)}}function I1(t="left"){switch(`${t}`.trim().toLowerCase()){case"left":return oY;case"right":return iY}throw new Error(`invalid tree anchor: ${t}`)}var oY={frameAnchor:"left",dx:6,position({x:t,y:e},n,r,o){r[n]=e,o[n]=-t}},iY={frameAnchor:"right",dx:-6,position({x:t,y:e},n,r,o){r[n]=-e,o[n]=-t}};function iI(t){return t==null||typeof t=="function"?t:`${t}`.trim().toLowerCase().startsWith("node:")?rI(r3(t)):rI(sY(t))}function rI(t){return(e,n)=>Fe(t(e),t(n))}function sY(t){return e=>e.data?.[t]}function sI(t="/"){if(t=`${t}`,t==="/")return n=>n;if(t.length!==1)throw new Error("delimiter must be exactly one character");let e=t.charCodeAt(0);return n=>n.map(r=>aY(r,e))}var n3=92,aI=47;function aY(t,e){if(e===n3)throw new Error("delimiter cannot be backslash");let n=!1;for(let r=0,o=t.length;r<o;++r){switch(t.charCodeAt(r)){case n3:if(!n){n=!0;continue}break;case e:n?(t=t.slice(0,r-1)+t.slice(r),--r,--o):t=t.slice(0,r)+"/"+t.slice(r+1);break;case aI:n?(t=t.slice(0,r)+"\\\\"+t.slice(r),r+=2,o+=2):(t=t.slice(0,r)+"\\"+t.slice(r),++r,++o);break}n=!1}return t}function cY(t){let e=!1;for(let n=0,r=t.length;n<r;++n){switch(t.charCodeAt(n)){case n3:if(!e){e=!0;continue}case aI:e&&(t=t.slice(0,n-1)+t.slice(n),--n,--r);break}e=!1}return t}function cI(t){return Pe(t)&&typeof t.node=="function"}function fY(t){return Pe(t)&&typeof t.link=="function"}function r3(t){if(cI(t))return t.node;if(t=`${t}`.trim().toLowerCase(),!!t.startsWith("node:")){switch(t){case"node:name":return i3;case"node:path":return o3;case"node:internal":return fI;case"node:external":return uI;case"node:depth":return s3;case"node:height":return a3}throw new Error(`invalid node value: ${t}`)}}function oI(t){if(cI(t))return t.node;if(fY(t))return t.link;if(t=`${t}`.trim().toLowerCase(),!(!t.startsWith("node:")&&!t.startsWith("parent:"))){switch(t){case"parent:name":return A1(i3);case"parent:path":return A1(o3);case"parent:depth":return A1(s3);case"parent:height":return A1(a3);case"node:name":return i3;case"node:path":return o3;case"node:internal":return fI;case"node:external":return uI;case"node:depth":return s3;case"node:height":return a3}throw new Error(`invalid link value: ${t}`)}}function o3(t){return t.id}function i3(t){return uY(t.id)}function s3(t){return t.depth}function a3(t){return t.height}function fI(t){return!!t.children}function uI(t){return!t.children}function A1(t){return(e,n)=>n==null?void 0:t(n)}function uY(t){let e=t.length;for(;--e>0&&!lY(t,e););return cY(t.slice(e+1))}function lY(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}var lI=2,pI=3,E1=4;function hI(t,e){let n=[];for(let r in t){let o=t[r],i=e(o);i!==void 0&&n.push([r,...qe(o),i])}return n}function c3(t,{fill:e,stroke:n,strokeWidth:r,strokeOpacity:o,strokeLinejoin:i,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:f,marker:u,markerStart:p=u,markerEnd:l=u,dot:h=Ft(p)&&Ft(l),text:d="node:name",textStroke:m="var(--plot-background)",title:g="node:path",dx:y,dy:x,textAnchor:b,treeLayout:w=wa,textLayout:_=w===wa||w===xg?"mirrored":"normal",tip:v,...A}={}){if(y===void 0&&(y=I1(A.treeAnchor).dx),b!==void 0)throw new Error("textAnchor is not a configurable tree option");_=Ie(_,"textLayout",["mirrored","normal"]);function E(T){return Io(t,zh({treeLayout:w,text:d,fill:e===void 0?"currentColor":e,stroke:m,dx:y,dy:x,title:g,...T,...A}))}return Se(l1(t,T1({treeLayout:w,markerStart:p,markerEnd:l,stroke:n!==void 0?n:e===void 0?"node:internal":e,strokeWidth:r,strokeOpacity:o,strokeLinejoin:i,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:f,...A})),h?_r(t,zh({treeLayout:w,fill:e===void 0?"node:internal":e,title:g,tip:v,...A})):null,d!=null?_==="mirrored"?[E({textAnchor:"start",treeFilter:"node:external"}),E({textAnchor:"end",treeFilter:"node:internal",dx:-y})]:E():null)}function dI(t,e){return c3(t,{...e,treeLayout:xg})}var gI={ariaLabel:"waffle"},Yh=class extends Va{constructor(e,{unit:n=1,gap:r=1,round:o,render:i,multiple:s,...a}={}){super(e,{...a,render:Ei(i,yI("x"))},gI),this.unit=Math.max(0,n),this.gap=+r,this.round=xI(o),this.multiple=bI(s)}},Uh=class extends Ha{constructor(e,{unit:n=1,gap:r=1,round:o,render:i,multiple:s,...a}={}){super(e,{...a,render:Ei(i,yI("y"))},gI),this.unit=Math.max(0,n),this.gap=+r,this.round=xI(o),this.multiple=bI(s)}};function yI(t){return function(e,n,r,o,i){let{unit:s,gap:a,rx:c,ry:f,round:u}=this,{document:p}=i,l=r.channels[`${t}1`].value,h=r.channels[`${t}2`].value,d=this[t==="y"?"_width":"_height"](n,r,o),m=this[t==="y"?"_x":"_y"](n,r,o),g=s*pY(n.scales[t]),{multiple:y=Math.max(1,Math.floor(Math.sqrt(d/g)))}=this,x=Math.min(d/y,g*y),b=g*y,w=t==="y"?([S,k])=>[S*x,-k*b]:([S,k])=>[k*b,S*x],_=(d-y*x)/2,v=typeof m=="function"?S=>m(S)+_:m+_,A=n[t](0),E=SE(),T=p.createElementNS(_n.svg,"pattern");T.setAttribute("width",t==="y"?x:b),T.setAttribute("height",t==="y"?b:x),T.setAttribute("patternUnits","userSpaceOnUse");let C=T.appendChild(p.createElementNS(_n.svg,"rect"));return C.setAttribute("x",a/2),C.setAttribute("y",a/2),C.setAttribute("width",(t==="y"?x:b)-a),C.setAttribute("height",(t==="y"?b:x)-a),c!=null&&C.setAttribute("rx",c),f!=null&&C.setAttribute("ry",f),rt("svg:g",i).call(gt,this,o,i).call(this._transform,this,n).call(S=>S.selectAll().data(e).enter().append(()=>T.cloneNode(!0)).attr("id",k=>`${E}-${k}`).select("rect").call(lt,this).call(_t,this,r)).call(S=>S.selectAll().data(e).enter().append("path").attr("transform",t==="y"?qr`translate(${v},${A})`:qr`translate(${A},${v})`).attr("d",k=>`M${f3(u(l[k]/s),u(h[k]/s),y).map(w).join("L")}Z`).attr("fill",k=>`url(#${E}-${k})`).attr("stroke",this.stroke==null?null:k=>`url(#${E}-${k})`)).node()}}function f3(t,e,n){if(t<0||e<0){let r=Math.ceil(-Math.min(t,e)/n);return f3(t+r*n,e+r*n,n).map(([o,i])=>[o,i-r])}return e<t?f3(e,t,n):[[0,Math.ceil(t/n)],[Math.floor(t%n),Math.ceil(t/n)],[Math.floor(t%n),Math.floor(t/n)+t%1],[Math.ceil(t%n),Math.floor(t/n)+t%1],...t%n>n-1?[]:[[Math.ceil(t%n),Math.floor(t/n)],[n,Math.floor(t/n)]],[n,Math.floor(e/n)],[Math.ceil(e%n),Math.floor(e/n)],[Math.ceil(e%n),Math.floor(e/n)+e%1],[Math.floor(e%n),Math.floor(e/n)+e%1],...e%n<1?[]:[[Math.floor(e%n),Math.ceil(e/n)],[0,Math.ceil(e/n)]]]}function xI(t){if(t===void 0||t===!1)return Number;if(t===!0)return Math.round;if(typeof t!="function")throw new Error(`invalid round: ${t}`);return t}function bI(t){return t===void 0?void 0:Math.max(1,Math.floor(t))}function pY({domain:t,range:e}){return mI(e)/mI(t)}function mI(t){let[e,n]=Ot(t);return n-e}function wI(t,e={}){return xi(e)||(e={...e,y:Xt,x2:X}),new Yh(t,Ts(Pf(As(e))))}function vI(t,e={}){return xi(e)||(e={...e,x:Xt,y2:X}),new Uh(t,Is(qf(Es(e))))}var RI=KC(kI(),1);var wY=({marginLeft:t})=>[1,t],vY=({width:t,marginRight:e})=>[-1,t-e],_Y=({width:t,marginLeft:e,marginRight:n})=>[0,(e+t-n)/2],MY=({marginTop:t})=>[1,t],SY=({height:t,marginBottom:e})=>[-1,t-e],AY=({height:t,marginTop:e,marginBottom:n})=>[0,(e+t-n)/2];function LI(t){return typeof t=="string"?{anchor:t}:t}function OI(t={},e={}){arguments.length===1&&([t,e]=DI(t));let{anchor:n="left",padding:r=1,r:o=e.r}=LI(t);switch(`${n}`.toLowerCase()){case"left":n=wY;break;case"right":n=vY;break;case"middle":n=_Y;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return FI("x","y",n,Rt(r),o,e)}function $I(t={},e={}){arguments.length===1&&([t,e]=DI(t));let{anchor:n="bottom",padding:r=1,r:o=e.r}=LI(t);switch(`${n}`.toLowerCase()){case"top":n=MY;break;case"bottom":n=SY;break;case"middle":n=AY;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return FI("y","x",n,Rt(r),o,e)}function DI(t){let{anchor:e,padding:n,...r}=t,{r:o}=r;return[{anchor:e,padding:n,r:o},r]}function FI(t,e,n,r,o,i){if(o!=null&&typeof o!="number"){let{channels:s,sort:a,reverse:c}=i;s=Qp(s),s?.r===void 0&&(i={...i,channels:{...s,r:{value:o,scale:"r"}}}),a===void 0&&c===void 0&&(i.sort={channel:"-r"})}return Gt(i,function(s,a,c,f,u,p){let{[e]:l,r:h}=c;if(!c[e])throw new Error(`missing channel: ${e}`);({[e]:l}=Eo(c,f,p));let d=h?void 0:o!==void 0?Rt(o):this.r!==void 0?this.r:3;h&&(h=ct(h.value,f[h.scale]||X,Float64Array));let[m,g]=n(u),y=m?TY:EY,x=new Float64Array(l.length),b=h?w=>h[w]:()=>d;for(let w of a){let _=(0,RI.default)();w=w.filter(h?A=>xf(l[A])&&Nn(h[A]):A=>xf(l[A]));let v=new Float64Array(2*w.length+2);for(let A of w){let E=b(A),T=m?E+r:0,C=l[A]-E,S=l[A]+E,k=2;_.queryInterval(C-r,S+r,([,,M])=>{let I=x[M]-T,N=l[A]-l[M],R=r+(h?h[A]+h[M]:2*d),$=Math.sqrt(R*R-N*N);v[k++]=I-$,v[k++]=I+$});let L=v.slice(0,k);m&&(L=L.filter(M=>M>=0));t:for(let M of L.sort(y)){for(let I=0;I<k;I+=2)if(v[I]+1e-6<M&&M<v[I+1]-1e-6)continue t;x[A]=M+T;break}_.insert([C,S,A])}}m||(m=1);for(let w of a)for(let _ of w)x[_]=x[_]*m+g;return{data:s,facets:a,channels:{[t]:{value:x,source:null},[e]:{value:l,source:c[e]},...h&&{r:{value:h,source:c.r}}}}})}function EY(t,e){return Math.abs(t)-Math.abs(e)}function TY(t,e){return t-e}function qI(t,e){return arguments.length===1&&({basis:t,...e}=t),Kf(k1(t),e)}function BI(t,e){return arguments.length===1&&({basis:t,...e}=t),Jf(k1(t),e)}function k1(t){if(t===void 0)return PI;if(typeof t=="function")return R1(Mf(t));if(/^p\d{2}$/i.test(t))return cu(_f(t));switch(`${t}`.toLowerCase()){case"deviation":return NY;case"first":return PI;case"last":return CY;case"max":return kY;case"mean":return RY;case"median":return LY;case"min":return OY;case"sum":return $Y;case"extent":return IY}throw new Error(`invalid basis: ${t}`)}function R1(t){return{mapIndex(e,n,r){let o=+t(e,n);for(let i of e)r[i]=n[i]===null?NaN:n[i]/o}}}function cu(t){return R1((e,n)=>t(e,r=>n[r]))}var IY={mapIndex(t,e,n){let[r,o]=Ot(t,s=>e[s]),i=o-r;for(let s of t)n[s]=e[s]===null?NaN:(e[s]-r)/i}},PI=R1((t,e)=>{for(let n=0;n<t.length;++n){let r=e[t[n]];if(Jt(r))return r}}),CY=R1((t,e)=>{for(let n=t.length-1;n>=0;--n){let r=e[t[n]];if(Jt(r))return r}}),NY={mapIndex(t,e,n){let r=Qo(t,i=>e[i]),o=fr(t,i=>e[i]);for(let i of t)n[i]=e[i]===null?NaN:o?(e[i]-r)/o:0}},kY=cu(It),RY=cu(Qo),LY=cu(Rr),OY=cu(St),$Y=cu(Ve);function zI(t,e){return UI("x",t,e)}function YI(t,e){return UI("y",t,e)}function UI(t,e,n={}){let r,o=1;if(typeof e=="number")o=e,r=(f,u)=>+f+u;else{if(typeof e=="string"){let f=e.startsWith("-")?-1:1;[e,o]=cx(e.replace(/^[+-]/,"")),o*=f}e=Af(e),r=(f,u)=>e.offset(f,u)}let i=`${t}1`,s=`${t}2`,a=qn({[i]:f=>f.map(u=>r(u,o)),[s]:f=>f},n),c=a[s].transform;return a[s].transform=()=>{let f=c(),[u,p]=Ot(f);return f.domain=o<0?[u,r(p,o)]:[r(u,o),p],f},a}function jI(t,e={}){if(typeof t=="string")switch(t.toLowerCase()){case"first":return Wh(e);case"last":return Gh(e)}if(typeof t=="function")return Ds(null,t,e);let n,r;for(n in t){if(r!==void 0)throw new Error("ambiguous selector; multiple inputs");r=DY(t[n])}if(r===void 0)throw new Error(`invalid selector: ${t}`);return Ds(n,r,e)}function DY(t){if(typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"min":return m3;case"max":return g3}throw new Error(`unknown selector: ${t}`)}function Wh(t){return Ds(null,FY,t)}function Gh(t){return Ds(null,PY,t)}function L1(t){return Ds("x",m3,t)}function O1(t){return Ds("y",m3,t)}function $1(t){return Ds("x",g3,t)}function D1(t){return Ds("y",g3,t)}function*FY(t){yield t[0]}function*PY(t){yield t[t.length-1]}function*m3(t,e){yield n0(t,n=>e[n])}function*g3(t,e){yield ra(t,n=>e[n])}function Ds(t,e,n){if(t!=null){if(n[t]==null)throw new Error(`missing channel: ${t}`);t=n[t]}let r=pn(n);return Me(n,(o,i)=>{let s=ct(o,r),a=ct(o,t),c=[];for(let f of i){let u=[];for(let p of s?We(f,l=>s[l]).values():[f])for(let l of e(p,a))u.push(l);c.push(u)}return{data:o,facets:c}})}ft.prototype.plot=function({marks:t=[],...e}={}){return Gf({...e,marks:[...t,this]})};var qY=new Map([["style","style"],["width","width"],["height","height"],["margin","margin"],["marginLeft","marginLeft"],["marginRight","marginRight"],["marginTop","marginTop"],["marginBottom","marginBottom"],["align","align"],["aspectRatio","aspectRatio"],["axis","axis"],["inset","inset"],["grid","grid"],["label","label"],["padding","padding"],["xScale","x.type"],["xDomain","x.domain"],["xRange","x.range"],["xNice","x.nice"],["xInset","x.inset"],["xInsetLeft","x.insetLeft"],["xInsetRight","x.insetRight"],["xClamp","x.clamp"],["xRound","x.round"],["xAlign","x.align"],["xPadding","x.padding"],["xPaddingInner","x.paddingInner"],["xPaddingOuter","x.paddingOuter"],["xAxis","x.axis"],["xTicks","x.ticks"],["xTickSize","x.tickSize"],["xTickSpacing","x.tickSpacing"],["xTickPadding","x.tickPadding"],["xTickFormat","x.tickFormat"],["xTickRotate","x.tickRotate"],["xGrid","x.grid"],["xLine","x.line"],["xLabel","x.label"],["xLabelAnchor","x.labelAnchor"],["xLabelArrow","x.labelArrow"],["xLabelOffset","x.labelOffset"],["xFontVariant","x.fontVariant"],["xAriaLabel","x.ariaLabel"],["xAriaDescription","x.ariaDescription"],["xPercent","x.percent"],["xReverse","x.reverse"],["xZero","x.zero"],["xBase","x.base"],["xExponent","x.exponent"],["xConstant","x.constant"],["yScale","y.type"],["yDomain","y.domain"],["yRange","y.range"],["yNice","y.nice"],["yInset","y.inset"],["yInsetTop","y.insetTop"],["yInsetBottom","y.insetBottom"],["yClamp","y.clamp"],["yRound","y.round"],["yAlign","y.align"],["yPadding","y.padding"],["yPaddingInner","y.paddingInner"],["yPaddingOuter","y.paddingOuter"],["yAxis","y.axis"],["yTicks","y.ticks"],["yTickSize","y.tickSize"],["yTickSpacing","y.tickSpacing"],["yTickPadding","y.tickPadding"],["yTickFormat","y.tickFormat"],["yTickRotate","y.tickRotate"],["yGrid","y.grid"],["yLine","y.line"],["yLabel","y.label"],["yLabelAnchor","y.labelAnchor"],["yLabelArrow","y.labelArrow"],["yLabelOffset","y.labelOffset"],["yFontVariant","y.fontVariant"],["yAriaLabel","y.ariaLabel"],["yAriaDescription","y.ariaDescription"],["yPercent","y.percent"],["yReverse","y.reverse"],["yZero","y.zero"],["yBase","y.base"],["yExponent","y.exponent"],["yConstant","y.constant"],["facetMargin","facet.margin"],["facetMarginTop","facet.marginTop"],["facetMarginBottom","facet.marginBottom"],["facetMarginLeft","facet.marginLeft"],["facetMarginRight","facet.marginRight"],["facetGrid","facet.grid"],["facetLabel","facet.label"],["fxDomain","fx.domain"],["fxRange","fx.range"],["fxInset","fx.inset"],["fxInsetLeft","fx.insetLeft"],["fxInsetRight","fx.insetRight"],["fxRound","fx.round"],["fxAlign","fx.align"],["fxPadding","fx.padding"],["fxPaddingInner","fx.paddingInner"],["fxPaddingOuter","fx.paddingOuter"],["fxAxis","fx.axis"],["fxTicks","fx.ticks"],["fxTickSize","fx.tickSize"],["fxTickSpacing","fx.tickSpacing"],["fxTickPadding","fx.tickPadding"],["fxTickFormat","fx.tickFormat"],["fxTickRotate","fx.tickRotate"],["fxGrid","fx.grid"],["fxLine","fx.line"],["fxLabel","fx.label"],["fxLabelAnchor","fx.labelAnchor"],["fxLabelOffset","fx.labelOffset"],["fxFontVariant","fx.fontVariant"],["fxAriaLabel","fx.ariaLabel"],["fxAriaDescription","fx.ariaDescription"],["fxReverse","fx.reverse"],["fyDomain","fy.domain"],["fyRange","fy.range"],["fyInset","fy,inset"],["fyInsetTop","fy.insetTop"],["fyInsetBottom","fy.insetBottom"],["fyRound","fy.round"],["fyAlign","fy.align"],["fyPadding","fy.padding"],["fyPaddingInner","fy.paddingInner"],["fyPaddingOuter","fy.paddingOuter"],["fyAxis","fy.axis"],["fyTicks","fy.ticks"],["fyTickSize","fy.tickSize"],["fyTickSpacing","fy.tickSpacing"],["fyTickPadding","fy.tickPadding"],["fyTickFormat","fy.tickFormat"],["fyTickRotate","fy.tickRotate"],["fyGrid","fy.grid"],["fyLine","fy.line"],["fyLabel","fy.label"],["fyLabelAnchor","fy.labelAnchor"],["fyLabelOffset","fy.labelOffset"],["fyFontVariant","fy.fontVariant"],["fyAriaLabel","fy.ariaLabel"],["fyAriaDescription","fy.ariaDescription"],["fyReverse","fy.reverse"],["colorScale","color.type"],["colorDomain","color.domain"],["colorRange","color.range"],["colorClamp","color.clamp"],["colorN","color.n"],["colorNice","color.nice"],["colorScheme","color.scheme"],["colorInterpolate","color.interpolate"],["colorPivot","color.pivot"],["colorSymmetric","color.symmetric"],["colorLabel","color.label"],["colorPercent","color.percent"],["colorReverse","color.reverse"],["colorZero","color.zero"],["colorTickFormat","color.tickFormat"],["colorBase","color.base"],["colorExponent","color.exponent"],["colorConstant","color.constant"],["opacityScale","opacity.type"],["opacityDomain","opacity.domain"],["opacityRange","opacity.range"],["opacityClamp","opacity.clamp"],["opacityNice","opacity.nice"],["opacityLabel","opacity.label"],["opacityPercent","opacity.percent"],["opacityReverse","opacity.reverse"],["opacityZero","opacity.zero"],["opacityTickFormat","opacity.tickFormat"],["opacityBase","opacity.base"],["opacityExponent","opacity.exponent"],["opacityConstant","opacity.constant"],["symbolScale","symbol.type"],["symbolDomain","symbol.domain"],["symbolRange","symbol.range"],["rScale","r.type"],["rDomain","r.domain"],["rRange","r.range"],["rClamp","r.clamp"],["rNice","r.nice"],["rLabel","r.label"],["rPercent","r.percent"],["rZero","r.zero"],["rBase","r.base"],["rExponent","r.exponent"],["rConstant","r.constant"],["lengthScale","length.type"],["lengthDomain","length.domain"],["lengthRange","length.range"],["lengthClamp","length.clamp"],["lengthNice","length.nice"],["lengthPercent","length.percent"],["lengthZero","length.zero"],["lengthBase","length.base"],["lengthExponent","length.exponent"],["lengthConstant","length.constant"],["projectionType","projection.type"],["projectionParallels","projection.parallels"],["projectionPrecision","projection.precision"],["projectionRotate","projection.rotate"],["projectionDomain","projection.domain"],["projectionInset","projection.inset"],["projectionInsetLeft","projection.insetLeft"],["projectionInsetRight","projection.insetRight"],["projectionInsetTop","projection.insetTop"],["projectionInsetBottom","projection.insetBottom"],["projectionClip","projection.clip"]]);function BY(t,e,n){for(let r=0;r<e.length;++r){let o=e[r];r===e.length-1?t[o]=n:t=t[o]||(t[o]={})}}function XI(t,e,n){for(let r in t){let o=qY.get(r);if(o==null)throw new Error(`Unrecognized plot attribute: ${r}`);let i=t[r];typeof i=="symbol"?n.push(r):i!==void 0&&BY(e,o.split("."),i)}}var zY=new Set(["frame","hexgrid","sphere","graticule"]),YY=new Map([["first",Wh],["last",Gh],["maxX",$1],["maxY",D1],["minX",L1],["minY",O1],["nearest",_s],["nearestX",Ms],["nearestXY",Ti]]);async function WI(t){let e={marks:[]},n=[],{attributes:r,marks:o}=t;XI(r,e,n);let i=[];for(let a of o)for(let{type:c,data:f,options:u}of a.plotSpecs()){let{select:p,...l}=u,h=YY.get(p)?.(l)??l,d=zY.has(c)?[h]:[f,h];e.marks.push(y3[c](...d)),i.push(a.index)}jY(e,t);let s=Gf(e);WY(s,i),UY(t,s,r,n);for(let a of t.interactors)await a.init(s);return s}function UY(t,e,n,r){r.forEach(o=>{let i=n[o];if(i===Li){if(!o.endsWith("Domain"))throw new Error(`Unsupported fixed attribute: ${o}`);let s=o.slice(0,-6),a=e.scale(s);a?.domain&&t.setAttribute(o,n[`${s}Reverse`]?a.domain.slice().reverse():a.domain)}else throw new Error(`Unrecognized symbol: ${i}`)})}function jY(t,e){let{marks:n}=e;F1("x",t,n),F1("y",t,n),F1("fx",t,n),F1("fy",t,n)}function F1(t,e,n){let r=e[t]||{};if(r.axis===null||r.label!==void 0)return;let o=n.map(s=>s.channelField(t)?.field);if(o.every(s=>s==null))return;let i;for(let s=0;s<o.length;++s){let a=GI(o[s]);a!==void 0&&(i===void 0?i=a:i!==a&&(i=void 0))}i!==void 0&&(e[t]={...r,label:i})}function GI(t){if(t){switch(t.type){case"COLUMN_REF":return t.column;case"CAST":return GI(t.expr);case"FUNCTION":if(t.name==="make_date")return"date";break}return XY(t)}}function XY(t){let e=`${t}`.replaceAll('"',"").replaceAll("(*)","()");return e.endsWith("()")?e.slice(0,-2):e}function WY(t,e){let n=-1;for(let r of t.children){let o=r.getAttribute("aria-label")||"";r.nodeName==="style"||o.includes("-axis")||o.includes("-grid")||r.setAttribute("data-index",e[++n])}}var GY={width:640,marginLeft:40,marginRight:20,marginTop:20,marginBottom:30},x3=class{constructor(e){this.attributes={...GY},this.listeners=null,this.interactors=[],this.legends=[],this.marks=[],this.markset=null,this.element=e||document.createElement("div"),this.element.setAttribute("class","plot"),this.element.style.display="flex",this.element.value=this,this.params=new Map,this.synch=p2()}margins(){return{left:this.getAttribute("marginLeft"),top:this.getAttribute("marginTop"),bottom:this.getAttribute("marginBottom"),right:this.getAttribute("marginRight")}}innerWidth(){let{left:e,right:n}=this.margins();return this.getAttribute("width")-e-n}innerHeight(e=400){let{top:n,bottom:r}=this.margins(),o=this.getAttribute("height");return o==null&&(o=VY(this,n,r)||e,this.setAttribute("height",o,{silent:!0})),o-n-r}pending(e){this.synch.pending(e)}update(e){return this.synch.ready(e)&&!this.pendingRender&&(this.pendingRender=!0,requestAnimationFrame(()=>this.render())),this.synch.promise}async render(){this.pendingRender=!1;let e=await WI(this),n=this.legends.flatMap(({legend:r,include:o})=>{let i=r.init(e);return o?i:[]});this.element.replaceChildren(e,...n),this.synch.resolve()}getAttribute(e){return this.attributes[e]}setAttribute(e,n,r){return sl(this.attributes[e],n)?(n===void 0?delete this.attributes[e]:this.attributes[e]=n,r?.silent||this.listeners?.get(e)?.forEach(o=>o(e,n)),!0):!1}addAttributeListener(e,n){let r=this.listeners||(this.listeners=new Map);return r.has(e)||r.set(e,new Set),r.get(e).add(n),this}removeAttributeListener(e,n){return this.listeners?.get(e)?.delete(n)}addParams(e,n){let{params:r}=this;for(let o of n)r.has(o)?r.get(o).push(e):(r.set(o,[e]),o.addEventListener("value",()=>Promise.allSettled(r.get(o).map(i=>i.initialize()))))}addMark(e){return e.setPlot(this,this.marks.length),this.marks.push(e),this.markset=null,this}get markSet(){return this.markset||(this.markset=new Set(this.marks))}addInteractor(e){return this.interactors.push(e),this}addLegend(e,n=!0){e.setPlot(this),this.legends.push({legend:e,include:n})}};function VY(t,e,n){let r=t.getAttribute("aspectRatio");if(r==null)return;let o=t.getAttribute("xDomain"),i=t.getAttribute("yDomain");if(!o||!i)return;let s=Math.abs(o[1]-o[0]);return Math.abs(i[1]-i[0])*t.innerWidth()/(r*s)+e+n}function P1(t){return typeof t!="string"?!1:(t=t.toLowerCase().trim(),t==="none"||t==="currentcolor"||t.startsWith("url(")&&t.endsWith(")")||t.startsWith("var(")&&t.endsWith(")")||Xn(t)!==null)}var HY=new Set(["order","sort","label","anchor","curve","tension","marker","markerStart","markerMid","markerEnd","textAnchor","lineAnchor","lineHeight","textOverflow","monospace","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","frameAnchor","strokeLinejoin","strokeLinecap","strokeMiterlimit","strokeDasharray","strokeDashoffset","mixBlendMode","shapeRendering","imageRendering","preserveAspectRatio","interpolate","crossOrigin","paintOrder","pointerEvents","target","select"]);function VI(t){return HY.has(t)}var QY=new Set(["asterisk","circle","cross","diamond","diamond2","hexagon","plus","square","square2","star","times","triangle","triangle2","wye"]);function HI(t){return QY.has(`${t}`.toLowerCase())}var QI=t=>t==="stroke"||t==="fill",ZY=t=>/opacity$/i.test(t),KY=t=>t==="symbol",JY=(t,e)=>t!=="sort"&&t!=="tip"&&e!=null&&!Array.isArray(e),b3=(t,e)=>({channel:t,field:e,as:qi(e)?e.column:t}),w3=(t,e)=>({channel:t,value:e}),q1=t=>Array.isArray(t),Je=class extends du{constructor(e,n,r,o={}){super(n?.options?.filterBy),this.type=e,this.reqs=o,this.source=n;let i=this.channels=[],s=this.detail=new Set,a=this.params=new Set;q1(n)?this.data=cr(n):Wo(n?.table)&&a.add(n.table);let c=(f,u)=>{let p=typeof u;if(f==="channels")for(let l in u)s.add(l),c(l,u[l]);else if(p==="function"&&u[pu]){let l=u(this,f);for(let h in l)c(h,l[h])}else if(p==="string")VI(f)||QI(f)&&P1(u)||KY(f)&&HI(u)?i.push(w3(f,u)):i.push(b3(f,Du(u)));else if(Er(u)){let l=w3(f,u.value);i.push(l),u.addEventListener("value",h=>(l.value=h,this.update()))}else en(u)?(Hb(u).forEach(l=>a.add(l)),i.push(b3(f,u))):p==="object"&&JY(f,u)?i.push(b3(f,u)):u!==void 0&&i.push(w3(f,u))};for(let f in r)c(f,r[f])}setPlot(e,n){this.plot=e,this.index=n,e.addParams(this,this.params),this.source?.table&&this.queryPending()}sourceTable(){let e=this.source?.table;return e?Wo(e)?e.value:e:null}hasOwnData(){return this.source==null||q1(this.source)}hasFieldInfo(){return!!this._fieldInfo}channel(e){return this.channels.find(n=>n.channel===e)}channelField(e,{exact:n=!1}={}){let r=n?this.channel(e):this.channels.find(o=>o.channel.startsWith(e));return r?.field?r:null}fields(){if(this.hasOwnData())return null;let{channels:e,reqs:n}=this,r=new Map;for(let{channel:i,field:s}of e){if(!s)continue;let a=s.stats?.stats||[],c=s.stats?.column??s,f=r.get(c)??r.set(c,new Set).get(c);a.forEach(u=>f.add(u)),n[i]?.forEach(u=>f.add(u))}let o=this.sourceTable();return Array.from(r,([i,s])=>({table:o,column:i,stats:s}))}fieldInfo(e){let n=Object.fromEntries(e.map(r=>[r.column,r]));for(let r of this.channels){let{field:o}=r;o&&Object.assign(r,n[o.stats?.column??o])}return this._fieldInfo=!0,this}query(e=[]){return this.hasOwnData()?null:Vh(this.channels,this.sourceTable()).where(e)}queryPending(){return this.plot.pending(this),this}queryResult(e){return this.data=cr(e),this}update(){return this.plot.update(this)}plotSpecs(){let{type:e,data:n,detail:r,channels:o}=this;return v3(e,r,o,n)}};function dn(t,e){let n=e?.[t.as]??t.as;return Object.hasOwn(t,"value")?t.value:QI(t.channel)?{value:n,scale:"color"}:ZY(t.channel)?{value:n,scale:"opacity"}:n}function Vh(t,e,n=[]){let r=yt.from({source:e}),o=new Set,i=!1;for(let s of t){let{channel:a,field:c,as:f}=s;if(!n.includes(a)){if(a==="orderby")r.orderby(s.value);else if(c){if(jn(c))i=!0;else{if(o.has(f))continue;o.add(f)}r.select({[f]:c})}}}return i&&r.groupby(Array.from(o)),r}function v3(t,e,n,r,o={}){let{numRows:i,values:s,columns:a}=r??{},c={};for(let p of n){let l=e.has(p.channel)?c:o;l[p.channel]=dn(p,a)}return e.size&&(o.channels=c),[{type:t,data:s??(r?{length:i}:null),options:o}]}function ec(t,e){let{plot:n}=t,r=n.getAttribute(`${e}Scale`);if(!r){let{type:i}=t.channelField(e);r=i==="date"?"time":"linear"}let o={type:r};switch(r){case"log":o.base=n.getAttribute(`${e}Base`)??10;break;case"pow":o.exponent=n.getAttribute(`${e}Exponent`)??1;break;case"symlog":o.constant=n.getAttribute(`${e}Constant`)??1;break}return ol(o)}function rr(t,e,n,r,o=1,i){let{field:s}=t.channelField(e);i=i??s;let{type:a,apply:c,sqlApply:f}=ec(t,e),u=!!t.plot.getAttribute(`${e}Reverse`),[p,l]=r.map(m=>c(m)),h=f(i),d=a==="time"||a==="utc"?h:i;return[Qb(h,p,l,n-o,u),d]}var _3={x:["min","max"]},M3={y:["min","max"]},B1={..._3,...M3};function ZI(t,e,n,r,o){let{plot:i}=t,s=i.getAttribute(r),a=i.getAttribute(o);if(Array.isArray(s)&&!s[Ye])return s;{let{column:c,min:f,max:u}=t.channelField(n),p=S3(e,c)||(a?si().domain([f,u]).nice().domain():[f,u]);return s!==Li&&(p[Ye]=!0),i.setAttribute(r,p,{silent:!0}),p}}function Lo(t,e){return ZI(t,e,"x","xDomain","xNice")}function Oo(t,e){return ZI(t,e,"y","yDomain","yNice")}function S3(t,e){if(!t)return;let n,r;return[t].flat().forEach(o=>Qr(o,i=>{if(i instanceof Zs&&`${i.expr}`===e){let s=(i.extent??[]).map(a=>a?.value??a);(n==null||s[0]<n)&&(n=s[0]),(r==null||s[1]>r)&&(r=s[1])}})),n!=null&&r!=null&&n!==r?[n,r]:void 0}var A3=class extends Je{constructor(e,n,r){let o=e.endsWith("X")?"y":e.endsWith("Y")?"x":null,i=o?{[o]:["count","min","max"]}:void 0;super(e,n,r,i),this.dim=o}query(e=[]){let{plot:n,dim:r,source:o}=this,i=o.options?.optimize,s=super.query(e);if(!r)return s;let a=r==="x"?"y":"x",c=this.channelField(a,{exact:!0})?.as,{field:f,as:u,type:p,count:l,min:h,max:d}=this.channelField(r),m=p==="date"||p==="number",g=r==="x"?n.innerWidth():n.innerHeight();if(i??=l/g>10,i&&m&&c){let[y,x]=S3(e,f)||[h,d],[b]=rr(this,r,g,[y,x],1,u),w=s._select.map(_=>_.alias).filter(_=>_!==u&&_!==c);return e2(s,b,u,c,w)}else return s.orderby(f)}};function KI(t,e=[]){return new e.constructor(t)}function JI(t,e,n){let r=KI(t,n),o=n.length;for(let i=0;i<o;++i)r[e[i]]=n[i];return r}function tC(t,e,n,r,o,i,s){let a=n.length,c=t*e,f=o.map(h=>r[h]),u={},p=[],l=new Int32Array(a);if(i?.length){let h=i.map(m=>r[m]),d={};for(let m=0;m<a;++m){let g=h.map(y=>y[m]);l[m]=d[g]??=p.push(g)-1}for(let m=0;m<i.length;++m)u[i[m]]=p.map(g=>g[m])}else p.push([]);if(s){let h=n.map(g=>g%t),d=n.map(g=>Math.floor(g/t)),m=p.map(()=>[]);for(let g=0;g<a;++g)m[l[g]].push(g);o.forEach((g,y)=>{let x=f[y];u[g]=p.map((b,w)=>s(m[w],t,e,h,d,x))})}else o.forEach((h,d)=>{let m=f[d],g=u[h]=p.map(()=>KI(c,m));for(let y=0;y<a;++y)g[l[y]][n[y]]=m[y]});return{numRows:p.length,columns:u}}function Hh(t){let e=1/0,n=-1/0;return t.forEach(r=>{let o=r.length;for(let i=0;i<o;++i){let s=r[i];s<e&&(e=s),s>n&&(n=s)}}),Number.isFinite(e)&&Number.isFinite(n)?[e,n]:[0,1]}function eC(t){let e=new wn;return t.forEach(n=>{let r=n.length;for(let o=0;o<r;++o)e.add(n[o])}),Array.from(e).sort(dt)}function he(t,e){return Wo(t)?(t.addEventListener("value",e),t.value):t}function Qh(t,e=!1){let n=new Float64Array(5),r=new Float64Array(4);tU(n,r,t);let o=Float64Array.of(0,r[1]-n[1]*r[0],r[2]-n[2]*r[0],r[3]-n[3]*r[0],-n[4]*r[0]),i=1+n[1]+n[2]+n[3]+n[4],s=(r[0]+r[1]+r[2]+r[3])/i,a=(o[1]+o[2]+o[3]+o[4])/i;return{sigma:t,negative:e,a:n,b_causal:r,b_anticausal:o,sum_causal:s,sum_anticausal:a}}function tU(t,e,n){let o=Float64Array.of(.84,1.8675,.84,-1.8675,-.34015,-.1299,-.34015,.1299),i=Math.exp(-1.783/n),s=Math.exp(-1.723/n),a=.6318/n,c=1.997/n,f=Float64Array.of(-i*Math.cos(a),i*Math.sin(a),-i*Math.cos(-a),i*Math.sin(-a),-s*Math.cos(c),s*Math.sin(c),-s*Math.cos(-c),s*Math.sin(-c)),u=n*2.5066282746310007,p=Float64Array.of(o[0],o[1],0,0,0,0,0,0),l=Float64Array.of(1,0,f[0],f[1],0,0,0,0,0,0),h,d;for(d=2;d<8;d+=2){for(p[d]=f[d]*p[d-2]-f[d+1]*p[d-1],p[d+1]=f[d]*p[d-1]+f[d+1]*p[d-2],h=d-2;h>0;h-=2)p[h]+=f[d]*p[h-2]-f[d+1]*p[h-1],p[h+1]+=f[d]*p[h-1]+f[d+1]*p[h-2];for(h=0;h<=d;h+=2)p[h]+=o[d]*l[h]-o[d+1]*l[h+1],p[h+1]+=o[d]*l[h+1]+o[d+1]*l[h];for(l[d+2]=f[d]*l[d]-f[d+1]*l[d+1],l[d+3]=f[d]*l[d+1]+f[d+1]*l[d],h=d;h>0;h-=2)l[h]+=f[d]*l[h-2]-f[d+1]*l[h-1],l[h+1]+=f[d]*l[h-1]+f[d+1]*l[h-2]}for(d=0;d<4;++d)h=d<<1,e[d]=p[h]/u,t[d+1]=l[h+2]}function nC(t,e,n,[r,o]){let i=new Float64Array(Math.max(r,o)),s=new Float64Array(Math.max(r,o)),a=new Float64Array(5),c=new Float64Array(n.length);for(let f=0,u=0;f<o;++f,u+=r){let p=c.subarray(u);z1(t,n.subarray(u),r,1,i,s,a,p)}for(let f=0;f<r;++f){let u=c.subarray(f);z1(e,u,o,r,i,s,a,u)}return c}function z1(t,e,n,r=1,o=new Float64Array(n),i=new Float64Array(n),s=new Float64Array(5),a=o,c=eU){let f=r*2,u=r*3,p=r*4,l=r*n,h,d;for(c(o,e,n,r,t.b_causal,3,t.a,4,t.sum_causal,s,t.sigma),d=4,h=p;d<n;++d,h+=r)o[d]=t.b_causal[0]*e[h]+t.b_causal[1]*e[h-r]+t.b_causal[2]*e[h-f]+t.b_causal[3]*e[h-u]-t.a[1]*o[d-1]-t.a[2]*o[d-2]-t.a[3]*o[d-3]-t.a[4]*o[d-4];for(c(i,e,n,-r,t.b_anticausal,4,t.a,4,t.sum_anticausal,s,t.sigma),d=4,h=l-r*5;d<n;++d,h-=r)i[d]=t.b_anticausal[1]*e[h+r]+t.b_anticausal[2]*e[h+f]+t.b_anticausal[3]*e[h+u]+t.b_anticausal[4]*e[h+p]-t.a[1]*i[d-1]-t.a[2]*i[d-2]-t.a[3]*i[d-3]-t.a[4]*i[d-4];if(t.negative)for(d=0,h=0;d<n;++d,h+=r)a[h]=o[d]+i[n-d-1];else for(d=0,h=0;d<n;++d,h+=r)a[h]=Math.max(0,o[d]+i[n-d-1]);return a}function eU(t,e,n,r,o,i,s,a,c,f,u,p=.5){let l=Math.abs(r)*n,h=r<0?l+r:0,d,m,g;for(m=0;m<=a;++m)for(f[m]=m<=i?o[m]:0,g=1;g<=a&&g<=m;++g)f[m]-=s[g]*f[m-g];for(g=0;g<a;++g)for(t[g]=0,m=1;m<=g;++m)d=h+r*m,d>=0&&d<l&&(t[g]+=f[g-m]*e[d]);let y=e[h],x=Math.ceil(u*10);for(m=0;m<x;++m){for(g=0;g<a;++g)t[g]+=f[g]*y;if(c-=Math.abs(f[0]),c<=p)break;for(f[a]=m+a<=i?o[m+a]:0,g=1;g<=a;++g)f[a]-=s[g]*f[a-g];for(g=0;g<a;++g)f[g]=f[g+1]}}var Br="density",zr=class extends Je{constructor(e,n,r){let{bandwidth:o=0,interpolate:i="none",pixelSize:s=1,pad:a=1,width:c,height:f,...u}=r,p=nU(u);super(e,n,u,B1),this.densityMap=p,this.bandwidth=he(o,l=>(this.bandwidth=l,this.grids?this.convolve().update():null)),this.interpolate=he(i,l=>(this.interpolate=l,this.requestUpdate())),this.pixelSize=he(s,l=>(this.pixelSize=l,this.requestUpdate())),this.pad=he(a,l=>(this.pad=l,this.requestUpdate())),this.width=he(c,l=>(this.width=l,this.requestUpdate())),this.height=he(f,l=>(this.height=l,this.requestUpdate()))}setPlot(e,n){let r=()=>{this.hasFieldInfo()&&this.requestUpdate()};e.addAttributeListener("xDomain",r),e.addAttributeListener("yDomain",r),super.setPlot(e,n)}get filterStable(){let e=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return e&&n&&!e[Ye]&&!n[Ye]}query(e=[]){let{interpolate:n,pad:r,channels:o,densityMap:i}=this,[s,a]=this.extentX=Lo(this,e),[c,f]=this.extentY=Oo(this,e),[u,p]=this.bins=this.binDimensions(),[l,h]=rr(this,"x",u,[s,a],r),[d,m]=rr(this,"y",p,[c,f],r),g=r?[gn(h,[+s,+a]),gn(m,[+c,+f])]:[Cr(+s,h),ue(h,+a),Cr(+c,m),ue(m,+f)],y=yt.from(this.sourceTable()).where(e.concat(g)),x=this.groupby=[],b={};for(let _ of o)if(Object.hasOwn(_,"field")){let{as:v,channel:A,field:E}=_;jn(E)?(b[A]=E,i[A]=!0):A==="weight"?b[Br]=zt(E):A!=="x"&&A!=="y"&&(y.select({[v]:E}),x.push(v))}let w=this.aggr=Object.keys(b);if(b.density&&w.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(w.length||(w.push(Br),b[Br]=rn()),n==="linear"){if(w.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!b[Br])throw new Error("Linear binning not applicable to custom aggregates.");let _=_c(b[Br])[0];return Jb(y,l,d,_,u,x)}else return Zb(y,l,d,b,u,x)}binDimensions(){let{plot:e,pixelSize:n,width:r,height:o}=this;return[r??Math.round(e.innerWidth()/n),o??Math.round(e.innerHeight()/n)]}queryResult(e){let[n,r]=this.bins,o=rU(this.interpolate),{columns:i}=cr(e);return this.grids0=tC(n,r,i.index,i,this.aggr,this.groupby,o),this.convolve()}convolve(){let{aggr:e,bandwidth:n,bins:r,grids0:o,plot:i}=this;if(this.grids=o,n>0){let s=e.length===1?e[0]:e.includes(Br)?Br:null;if(!s)return console.warn("No compatible grid found for smoothing."),this;let a=o.columns[s],c=i.innerWidth(),f=i.innerHeight(),[u,p]=r,l=a.some(m=>m.some(g=>g<0)),h=Qh(n*(u-1)/c,l),d=Qh(n*(p-1)/f,l);this.grids={numRows:o.numRows,columns:{...o.columns,[s]:a.map(m=>nC(h,d,m,r))}}}return this}};function nU(t){let e={};for(let n in t)t[n]==="density"&&(delete t[n],e[n]=!0);return e}function rU(t="none"){if(typeof t=="function")return t;switch(t.toLowerCase()){case"none":case"linear":return;case"nearest":return Rh;case"barycentric":return kh();case"random-walk":return Lh()}throw new Error(`invalid interpolate: ${t}`)}var E3=class extends zr{constructor(e,n){let{thresholds:r=10,...o}=n;super("geo",e,{bandwidth:20,interpolate:"linear",pixelSize:2,...o}),this.thresholds=he(r,i=>(this.thresholds=i,this.grids?this.contours().update():null))}convolve(){return super.convolve().contours()}contours(){let{bins:e,densityMap:n,grids:r,thresholds:o,plot:i}=this,{numRows:s,columns:a}=r,c=o,f;if(Array.isArray(c))f=c;else{let[,S]=Hh(a.density);f=Array.from({length:c-1},(k,L)=>S*(L+1)/c)}(n.fill||n.stroke)&&this.plot.getAttribute("colorScale")!=="log"&&this.plot.setAttribute("colorZero",!0);let[u,p]=e,[l,h]=i.getAttribute("xDomain"),[d,m]=i.getAttribute("yDomain"),g=(h-l)/u,y=(m-d)/p,x=+l,b=+d,w=S=>x+S*g,_=S=>b+S*y,v=Zi().size(e),A=this.contourData=Array(s*f.length),{density:E,...T}=a,C=Object.entries(T);for(let S=0,k=0;S<s;++S){let L=E[S],M=C.reduce((I,[N,R])=>(I[N]=R[S],I),{});for(let I=0;I<f.length;++I,++k)A[k]=Object.assign(oU(v.contour(L,f[I]),w,_),M)}return this}plotSpecs(){let{type:e,channels:n,densityMap:r,contourData:o}=this,i={};for(let s of n){let{channel:a}=s;a!=="x"&&a!=="y"&&(i[a]=dn(s))}for(let s in r)r[s]&&(i[s]=dn({channel:s,as:"value"}));return[{type:e,data:o,options:i}]}};function oU(t,e,n){function r(s){s.forEach(o)}function o(s){s.forEach(i)}function i(s){s[0]=e(s[0]),s[1]=n(s[1])}return t.coordinates.forEach(r),t}function Zh(t){return Array.from({length:t},(e,n)=>n)}function Y1(t,e){let n=e.reduce((o,i,s)=>(o[i]=s,o),{}),r=Zh(t.length);return r.sort((o,i)=>n[t[o]]-n[t[i]]),r}function U1(t,e){if(typeof document<"u"){let n=document.createElement("canvas");return n.setAttribute("width",t),n.setAttribute("height",e),n}throw new Error("Can not create a canvas instance.")}function rC(t=1){let e=255*t|0;return(n,r,o)=>{for(let i=0,s=0;i<o;++i)for(let a=0;a<r;++a,s+=4)n[s+3]=e}}function oC(t){let{apply:e}=t;return(n,r,o,i)=>{for(let s=0,a=0;s<o;++s)for(let c=0,f=(o-s-1)*r;c<r;++c,a+=4)n[a+3]=255*e(i[c+f])|0}}function iC(t={}){let{r:e=0,g:n=0,b:r=0,opacity:o=1}=typeof t=="string"?Ee(t):t,i=new Uint8ClampedArray([e,n,r,255*o|0]);return(s,a,c)=>{for(let f=0,u=0;f<c;++f)for(let p=0;p<a;++p,u+=4)s[u+0]=i[0],s[u+1]=i[1],s[u+2]=i[2],s[u+3]=i[3]}}function sC(t){let{domain:e,range:n}=t,r=Object.create(null),o=new Uint8ClampedArray(4*e.length),i=e.length-1,s=n.length;for(let a=0;a<=i;++a){let c=n[a%s],{r:f,g:u,b:p,opacity:l=1}=typeof c=="string"?Ee(c):c,h=a<<2;o[h+0]=f,o[h+1]=u,o[h+2]=p,o[h+3]=255*l|0,r[e[a]]=h}return(a,c,f,u)=>{if(u.map)for(let p=0,l=0;p<f;++p)for(let h=0,d=(f-p-1)*c;h<c;++h,l+=4){let m=r[u[h+d]];a[l+0]=o[m+0],a[l+1]=o[m+1],a[l+2]=o[m+2],a[l+3]=o[m+3]}else{let p=r[u];for(let l=0,h=0;l<f;++l)for(let d=0;d<c;++d,h+=4)a[h+0]=o[p+0],a[h+1]=o[p+1],a[h+2]=o[p+2],a[h+3]=o[p+3]}}}function aC(t,e,n){let{interpolate:r}=e,o=new Uint8ClampedArray(4*t),i=t-1;for(let s=0;s<=i;++s){let a=r(s/i),{r:c,g:f,b:u,opacity:p=1}=typeof a=="string"?Ee(a):a,l=s<<2;o[l+0]=c,o[l+1]=f,o[l+2]=u,o[l+3]=255*p|0}return(s,a,c,f)=>{for(let u=0,p=0;u<c;++u)for(let l=0,h=(c-u-1)*a;l<a;++l,p+=4){let d=i*n(f[l+h])<<2;s[p+0]=o[d+0],s[p+1]=o[d+1],s[p+2]=o[d+2],s[p+3]=o[d+3]}}}var fu=class extends zr{constructor(e,n){super("image",e,n),this.image=null}setPlot(e,n){let r=()=>{this.hasFieldInfo()&&this.rasterize()};e.addAttributeListener("schemeColor",r),super.setPlot(e,n)}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:e,grids:n}=this,[r,o]=e,{numRows:i,columns:s}=n,{canvas:a,ctx:c,img:f}=cU(this,r,o),{alpha:u,alphaProp:p,color:l,colorProp:h}=I3(this),d=s[p]??[],m=s[h]??[],g=i>1&&h&&this.groupby?.includes(h)?Y1(m,this.plot.getAttribute("colorDomain")):Zh(i);return this.data={numRows:i,columns:{src:Array.from({length:i},(y,x)=>(l?.(f.data,r,o,m[g[x]]),u?.(f.data,r,o,d[g[x]]),c.putImageData(f,0,0),a.toDataURL()))}},this}plotSpecs(){let{type:e,plot:n,data:{numRows:r,columns:o}}=this,i={src:o.src,width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:e,data:{length:r},options:i}]}},T3=class extends fu{constructor(e,n){super(e,{bandwidth:20,interpolate:"linear",pixelSize:2,...n})}};function I3(t){let{aggr:e,densityMap:n,groupby:r,plot:o}=t,i=e.includes(Br),s=e.includes("fillOpacity"),a=t.channel("fill"),c=t.channel("fillOpacity");if(e.length>2||i&&s)throw new Error("Invalid raster encodings. Try dropping an aggregate?");if(r.includes(c?.as))throw new Error("Raster fillOpacity must be an aggregate or constant.");let f=n.fill||e.includes("fill")?"grid":r.includes(a?.as)?"group":P1(a?.value)?a.value:i&&o.getAttribute("colorScheme")?"grid":void 0,u=n.fillOpacity||e.includes("fillOpacity")?"grid":typeof c?.value=="number"?c.value:i&&f!=="grid"?"grid":void 0;if(f!=="grid"&&u!=="grid")throw new Error("Raster mark missing density values.");let p=a?.as??(f==="grid"?Br:null),l=c?.as??(u==="grid"?Br:null),h=f!=="grid"&&f!=="group"?iC(f):sU(t,p),d=u!=="grid"?rC(u):iU(t,l);return{alphaProp:l,colorProp:p,alpha:d,color:h}}function iU(t,e){let{plot:n,grids:r}=t,o=n.getAttribute("opacityDomain"),i=o===Li,s=o?.[Ye],a=!i&&!s&&o||Hh(r.columns[e]);(i||s||!o)&&(i||(a[Ye]=!0),n.setAttribute("opacityDomain",a));let c=ys({opacity:{type:n.getAttribute("opacityScale"),domain:a,range:n.getAttribute("opacityRange"),clamp:n.getAttribute("opacityClamp"),nice:n.getAttribute("opacityNice"),reverse:n.getAttribute("opacityReverse"),zero:n.getAttribute("opacityZero"),base:n.getAttribute("opacityBase"),exponent:n.getAttribute("opacityExponent"),constant:n.getAttribute("opacityConstant")}});return oC(c)}function sU(t,e){let{plot:n,grids:r}=t,o=r.columns[e],i=!o[0]?.map,s=i||Array.isArray(o[0]),a=n.getAttribute("colorDomain"),c=a===Li,f=a?.[Ye],u=!c&&!f&&a||(i?o.slice().sort(dt):s?eC(o):Hh(o));(c||f||!a)&&(c||(u[Ye]=!0),n.setAttribute("colorDomain",u));let p=ys({color:{type:n.getAttribute("colorScale"),domain:u,range:n.getAttribute("colorRange"),clamp:n.getAttribute("colorClamp"),n:n.getAttribute("colorN"),nice:n.getAttribute("colorNice"),reverse:n.getAttribute("colorReverse"),scheme:n.getAttribute("colorScheme"),interpolate:n.getAttribute("colorInterpolate"),pivot:n.getAttribute("colorPivot"),symmetric:n.getAttribute("colorSymmetric"),zero:n.getAttribute("colorZero"),base:n.getAttribute("colorBase"),exponent:n.getAttribute("colorExponent"),constant:n.getAttribute("colorConstant")}});if(s)return sC(p);{let l=ys({x:{type:aU(p.type),domain:p.domain,reverse:p.reverse,range:[0,1],clamp:p.clamp,base:p.base,exponent:p.exponent,constant:p.constant}});return aC(1024,p,l.apply)}}function aU(t){return t.endsWith("symlog")?"symlog":t.endsWith("log")?"log":t.endsWith("pow")?"pow":t.endsWith("sqrt")?"sqrt":t==="diverging"?"linear":t}function cU(t,e,n){if(!t.image||t.image.w!==e||t.image.h!==n){let r=U1(e,n),o=r.getContext("2d",{willReadFrequently:!0}),i=o.getImageData(0,0,e,n);t.image={canvas:r,ctx:o,img:i,w:e,h:n}}return t.image}var C3=class extends fu{constructor(e,n){let{normalize:r=!0,...o}=n;super(e,o),this.normalize=he(r,i=>(this.normalize=i,this.requestUpdate()))}query(e=[]){let{channels:n,normalize:r,pad:o}=this,[i,s]=this.bins=this.binDimensions(),[a]=rr(this,"x",i,Lo(this,e),o),[c]=rr(this,"y",s,Oo(this,e),o),f=yt.from(this.sourceTable()).where(fU(this,e));this.aggr=["density"];let u=this.groupby=[],p=[];for(let l of n)if(Object.hasOwn(l,"field")){let{channel:h,field:d}=l;h==="z"?(f.select({[h]:d}),p.push("z")):h!=="x"&&h!=="y"&&(f.select({[h]:d}),u.push(h))}return t2(f,a,c,p,i,s,u,r)}};function fU(t,e){if(Array.isArray(e)&&!e.length)return e;let n=t.channelField("x").column,r=t.channelField("y").column,o=s=>{let a=`${s.expr}`;return s.type!=="BETWEEN"||a!==n&&a!==r},i=s=>s.op==="AND"?Dn(s.clauses.filter(a=>o(a))):s;return Array.isArray(e)?e.filter(s=>o(s)).map(s=>i(s)):i(e)}var N3=class extends Je{constructor(e,n,r){let{bins:o=1024,bandwidth:i=20,...s}=r,a=e.endsWith("X")?"y":"x";super(e,n,s,a==="x"?_3:M3),this.dim=a,this.bins=he(o,c=>(this.bins=c,this.requestUpdate())),this.bandwidth=he(i,c=>(this.bandwidth=c,this.grid?this.convolve().update():null))}get filterStable(){let e=this.dim==="x"?"xDomain":"yDomain",n=this.plot.getAttribute(e);return n&&!n[Ye]}query(e=[]){if(this.hasOwnData())throw new Error("Density1DMark requires a data source");let{bins:n,channels:r,dim:o}=this,i=this.extent=(o==="x"?Lo:Oo)(this,e),[s,a]=rr(this,o,n,i),c=Vh(r,this.sourceTable(),[o]).where(e.concat(gn(a,i))),f=this.channelField("weight")?"weight":null;return Kb(c,s,f)}queryResult(e){let{columns:{index:n,density:r}}=cr(e);return this.grid=JI(this.bins,n,r),this.convolve()}convolve(){let{bins:e,bandwidth:n,dim:r,grid:o,plot:i,extent:[s,a]}=this,c=o.some(b=>b<0),f=r==="x"?i.innerWidth():i.innerHeight(),u=Qh(n*(e-1)/f,c),p=z1(u,o,e),l=r==="x"?"y":"x",h=this.channelField(r).as,d=+s,m=(a-d)/(e-1),g=1/m,y=new Float64Array(e),x=new Float64Array(e);for(let b=0;b<e;++b)y[b]=d+b*m,x[b]=p[b]*g;return this.data={numRows:e,columns:{[h]:y,[l]:x}},this}plotSpecs(){let{type:e,data:{numRows:n,columns:r},channels:o,dim:i}=this,s=i==="x"?{y:r.y}:{x:r.x};for(let a of o)s[a.channel]=dn(a,r);return[{type:e,data:{length:n},options:s}]}};var k3=class extends zr{constructor(e,n){let{type:r="dot",...o}=n;super(r,e,{bandwidth:20,interpolate:"linear",pad:0,pixelSize:2,...o})}convolve(){super.convolve();let{bins:e,pad:n,extentX:r,extentY:o}=this,[i,s]=e,a=ec(this,"x"),c=ec(this,"y"),[f,u]=r.map(g=>a.apply(g)),[p,l]=o.map(g=>c.apply(g)),h=(u-f)/(i-n),d=(l-p)/(s-n),m=n?0:.5;return this.data=uU(this.grids,e,f,p,h,d,a.invert,c.invert,m),this}plotSpecs(){let{type:e,channels:n,densityMap:r,data:{numRows:o,columns:i}}=this,s={};for(let a of n){let{channel:c}=a;s[c]=c==="x"||c==="y"?i[c]:dn(a,i)}for(let a in r)r[a]&&(s[a]=i.density);return[{type:e,data:{length:o},options:s}]}};function uU(t,e,n,r,o,i,s,a,c){let f=1/(o*i),[u,p]=e,l=u*p,h=l*t.numRows,d=new Float64Array(h),m=new Float64Array(h),g=new Float64Array(h),y={x:d,y:m,density:g},{density:x,...b}=t.columns;for(let _ in b)y[_]=new b[_].constructor(h);let w=0;for(let _=0;_<t.numRows;++_){for(let A in b)y[A].fill(b[A][_],w,w+l);let v=x[_];for(let A=0,E=0;E<p;++E)for(let T=0;T<u;++T,++w,++A)d[w]=s(n+(T+c)*o),m[w]=a(r+(E+c)*i),g[w]=v[A]*f}return{numRows:h,columns:y}}function lU(t,e,n){var r=1e-8,o=e-1,i=n-1,s=0,a,c,f,u,p,l,h,d,m,g,y;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&n>=1?(f=t<.5?t:1-t,u=Math.sqrt(-2*Math.log(f)),h=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,t<.5&&(h=-h),d=(h*h-3)/6,m=2/(1/(2*e-1)+1/(2*n-1)),g=h*Math.sqrt(d+m)/m-(1/(2*n-1)-1/(2*e-1))*(d+5/6-2/(3*m)),h=e/(e+n*Math.exp(2*g))):(a=Math.log(e/(e+n)),c=Math.log(n/(e+n)),u=Math.exp(e*a)/e,p=Math.exp(n*c)/n,g=u+p,t<u/g?h=Math.pow(e*g*t,1/e):h=1-Math.pow(n*g*(1-t),1/n)),y=-uu(e)-uu(n)+uu(e+n);s<10;s++){if(h===0||h===1)return h;if(l=pU(h,e,n)-t,u=Math.exp(o*Math.log(h)+i*Math.log(1-h)+y),p=l/u,h-=u=p/(1-.5*Math.min(1,p*(o/h-i/(1-h)))),h<=0&&(h=.5*(h+u)),h>=1&&(h=.5*(h+u+1)),Math.abs(u)<r*h&&s>0)break}return h}function pU(t,e,n){var r=t===0||t===1?0:Math.exp(uu(e+n)-uu(e)-uu(n)+e*Math.log(t)+n*Math.log(1-t));return t<0||t>1?0:t<(e+1)/(e+n+2)?r*cC(t,e,n)/e:1-r*cC(1-t,n,e)/n}function cC(t,e,n){var r=1e-30,o=1,i=e+n,s=e+1,a=e-1,c=1,f=1-i*t/s,u,p,l,h;for(Math.abs(f)<r&&(f=r),f=1/f,h=f;o<=100&&(u=2*o,p=o*(n-o)*t/((a+u)*(e+u)),f=1+p*f,Math.abs(f)<r&&(f=r),c=1+p/c,Math.abs(c)<r&&(c=r),f=1/f,h*=f*c,p=-(e+o)*(i+o)*t/((e+u)*(s+u)),f=1+p*f,Math.abs(f)<r&&(f=r),c=1+p/c,Math.abs(c)<r&&(c=r),f=1/f,l=f*c,h*=l,!(Math.abs(l-1)<3e-7));o++);return h}function uu(t){var e=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,o,i,s;for(s=(i=o=t)+5.5,s-=(o+.5)*Math.log(s);e<6;e++)r+=n[e]/++i;return Math.log(2.506628274631*r/o)-s}function fC(t,e){var n=lU(2*Math.min(t,1-t),.5*e,.5);return n=Math.sqrt(e*(1-n)/n),t>.5?n:-n}function uC(t){let e=-Math.log((1-t)*(1+t)),n;return e<6.25?(e-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*e,n=128584807152564e-32+n*e,n=11157877678025181e-33+n*e,n=-1333171662854621e-31+n*e,n=20972767875968562e-33+n*e,n=6637638134358324e-30+n*e,n=-4054566272975207e-29+n*e,n=-8151934197605472e-29+n*e,n=26335093153082323e-28+n*e,n=-12975133253453532e-27+n*e,n=-5415412054294628e-26+n*e,n=10512122733215323e-25+n*e,n=-4112633980346984e-24+n*e,n=-29070369957882005e-24+n*e,n=42347877827932404e-23+n*e,n=-13654692000834679e-22+n*e,n=-13882523362786469e-21+n*e,n=.00018673420803405714+n*e,n=-.000740702534166267+n*e,n=-.006033670871430149+n*e,n=.24015818242558962+n*e,n=1.6536545626831027+n*e):e<16?(e=Math.sqrt(e)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*e,n=-27517406297064545e-23+n*e,n=18239629214389228e-24+n*e,n=15027403968909828e-22+n*e,n=-4013867526981546e-21+n*e,n=29234449089955446e-22+n*e,n=12475304481671779e-21+n*e,n=-47318229009055734e-21+n*e,n=6828485145957318e-20+n*e,n=24031110387097894e-21+n*e,n=-.0003550375203628475+n*e,n=.0009532893797373805+n*e,n=-.0016882755560235047+n*e,n=.002491442096107851+n*e,n=-.003751208507569241+n*e,n=.005370914553590064+n*e,n=1.0052589676941592+n*e,n=3.0838856104922208+n*e):Number.isFinite(e)?(e=Math.sqrt(e)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*e,n=15076572693500548e-25+n*e,n=-3789465440126737e-24+n*e,n=761570120807834e-23+n*e,n=-1496002662714924e-23+n*e,n=2914795345090108e-23+n*e,n=-6771199775845234e-23+n*e,n=22900482228026655e-23+n*e,n=-99298272942317e-20+n*e,n=4526062597223154e-21+n*e,n=-1968177810553167e-20+n*e,n=7599527703001776e-20+n*e,n=-.00021503011930044477+n*e,n=-.00013871931833623122+n*e,n=1.0103004648645344+n*e,n=4.849906401408584+n*e):n=1/0,n*t}var R3=class extends Je{constructor(e,n,r){let o=e.endsWith("X")?"y":"x",{ci:i=.95,...s}=r;super(e,n,s),this.dim=o,this.field=this.channelField(o).field,this.channels=this.channels.filter(a=>a.channel!==o),this.ci=he(i,a=>(this.ci=a,this.update()))}query(e=[]){let{channels:n,field:r}=this,o=n.concat([{field:Rb(r),as:"__avg__"},{field:Lt(Pb(r),Uo(rn(r))),as:"__se__"}]);return Vh(o,this.sourceTable()).where(e)}queryResult(e){return this.data=cr(e),this}plotSpecs(){let{type:e,dim:n,detail:r,data:o,ci:i,channels:s}=this,a=Math.SQRT2*uC(i),{columns:{__avg__:c,__se__:f}}=o,u={[`${n}1`]:c.map((p,l)=>p-a*f[l]),[`${n}2`]:c.map((p,l)=>p+a*f[l])};return v3(e,r,s,o,u)}};var hU="geom",L3=class extends Je{constructor(e,n={},r){!q1(e)&&!n?.geometry&&(n.geometry=Gb(hU)),super("geo",e,n,r)}queryResult(e){super.queryResult(e);let n=this.channelField("geometry")?.as;if(n){let{columns:r}=this.data;typeof r[n][0]=="string"&&(r[n]=r[n].map(o=>JSON.parse(o)))}return this}};var O3=class extends Je{constructor(e,n){let{type:r="hexagon",binWidth:o=20,...i}=n;super(r,e,{r:o/2,clip:!0,...i},B1),this.binWidth=he(o,s=>(this.binWidth=s,this.requestUpdate()))}get filterStable(){let e=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return e&&n&&!e[Ye]&&!n[Ye]}query(e=[]){if(this.hasOwnData())return null;let{plot:n,binWidth:r,channels:o}=this,i,s,a=new Set,c={};for(let C of o)if(C.channel!=="orderby"){if(C.channel==="x")i=C;else if(C.channel==="y")s=C;else if(Object.hasOwn(C,"field")){let{as:S,field:k}=C;c[S]=k,jn(k)||a.add(S)}}let[f,u]=Lo(this,e),[p,l]=Oo(this,e),h=.5-n.getAttribute("marginLeft"),d=0-n.getAttribute("marginTop"),m=de(r),g=de(r*(1.5/Math.sqrt(3))),y=de(n.innerWidth()/(u-f)),x=de(n.innerHeight()/(l-p)),b="_x",w="_y",_="_px",v="_py",A="_pi",E="_pj",T="_tt";return yt.select({[i.as]:Nt(de(f),Lt(Nt(pt(Nt(b,pt(.5,nl(w,1))),m),h),y)),[s.as]:ut(de(l),Lt(Nt(pt(w,g),d),x)),...c}).groupby(b,w,...a).from(yt.select({[v]:Lt(ut(pt(x,ut(l,s.field)),d),g),[E]:Ht(jo(v)),[_]:ut(Lt(ut(pt(y,ut(i.field,f)),h),m),pt(.5,nl(E,1))),[A]:Ht(jo(_)),[T]:Dn(Hr(pt(ke(ut(v,E)),3),1),Hr(Nt(me(ut(_,A),2),me(ut(v,E),2)),Nt(me(ut(ut(_,A),pt(.5,Yo(ue(_,A),-1,1))),2),me(ut(ut(v,E),Yo(ue(v,E),-1,1)),2)))),[b]:Yo(T,Ht(Nt(Nt(A,Yo(ue(_,A),-.5,.5)),Yo(Xo(nl(E,1),0),.5,-.5))),A),[w]:Yo(T,Ht(Nt(E,Yo(ue(v,E),-1,1))),E)},"*").from(this.sourceTable()).where(Vr(i.field),Vr(s.field),e))}};var $3=class extends zr{constructor(e,n){let{origin:r=[0,0],dim:o="xy",...i}=n;super("image",e,i),this.image=null,this.origin=r,this.tileX=o.toLowerCase().includes("x"),this.tileY=o.toLowerCase().includes("y")}setPlot(e,n){let r=()=>{this.hasFieldInfo()&&this.rasterize()};e.addAttributeListener("schemeColor",r),super.setPlot(e,n)}requestQuery(){return this.requestTiles()}query(e=[]){return this._filter=e,null}tileQuery(e){let{interpolate:n,pad:r,channels:o,densityMap:i}=this,[[s,a],[c,f]]=e,[u,p]=this.bins,[l,h]=rr(this,"x",u,[s,a],r),[d,m]=rr(this,"y",p,[c,f],r),g=r?[gn(h,[+s,+a]),gn(m,[+c,+f])]:[Cr(+s,h),ue(h,+a),Cr(+c,m),ue(m,+f)],y=yt.from(this.sourceTable()).where(g),x=this.groupby=[],b={};for(let _ of o)if(Object.hasOwn(_,"field")){let{as:v,channel:A,field:E}=_;E.aggregate?(b[A]=E,i[A]=!0):A==="weight"?b.density=zt(E):A!=="x"&&A!=="y"&&(y.select({[v]:E}),x.push(v))}let w=this.aggr=Object.keys(b);if(b.density&&w.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(w.length||(w.push("density"),b.density=rn()),n==="linear"){if(w.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!b.density)throw new Error("Linear binning not applicable to custom aggregates.");return xU(y,l,d,b.density,u,x)}else return yU(y,l,d,b,u,x)}async requestTiles(){let e=s2();this.prefetch&&e.cancel(this.prefetch);let{pad:n,tileX:r,tileY:o,origin:[i,s]}=this,[a,c]=this.bins=this.binDimensions(),[f,u]=Lo(this,this._filter),[p,l]=Oo(this,this._filter),h=u-f,d=l-p,m=Math.floor((f-i)*(a-n)/h),g=Math.floor((p-s)*(c-n)/d),y=(S,k)=>[[i+S*h,i+(S+1)*h],[s+k*d,s+(k+1)*d]],x=Math.floor((f-i)/h),b=r?lC((u-i)/h):x,w=Math.floor((p-s)/d),_=o?lC((l-s)/d):w,v=[];for(let S=x;S<=b;++S)for(let k=w;k<=_;++k)v.push([S,k]);let A=v.map(([S,k])=>e.query(this.tileQuery(y(S,k)))),E=[];if(r)for(let S=w;S<=_;++S)E.push([b+1,S]),E.push([x-1,S]);if(o){let S=r?x-1:x,k=r?b+1:b;for(let L=S;L<=k;++L)E.push([L,_+1]),E.push([L,w-1])}this.prefetch=E.map(([S,k])=>e.prefetch(this.tileQuery(y(S,k))));let T=await Promise.all(A),C=dU(a,c,m,g,v,T);this.grids0={numRows:C.length,columns:{density:[C]}},this.convolve().update()}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:e,grids:n}=this,[r,o]=e,{numRows:i,columns:s}=n,{canvas:a,ctx:c,img:f}=gU(this,r,o),{alpha:u,alphaProp:p,color:l,colorProp:h}=I3(this),d=s[p]??[],m=s[h]??[],g=i>1&&h&&this.groupby?.includes(h)?Y1(m,this.plot.getAttribute("colorDomain")):Zh(i);return this.data={numRows:i,columns:{src:Array.from({length:i},(y,x)=>(l?.(f.data,r,o,m[g[x]]),u?.(f.data,r,o,d[g[x]]),c.putImageData(f,0,0),a.toDataURL()))}},this}plotSpecs(){let{type:e,plot:n,data:{numRows:r,columns:o}}=this,i={src:o.src,width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:e,data:{length:r},options:i}]}};function dU(t,e,n,r,o,i){let s=new Float64Array(t*e);return i.forEach((a,c)=>{let[f,u]=o[c],p=f*t-n,l=u*e-r;mU(t,e,s,a,p,l)}),s}function mU(t,e,n,r,o,i){let s=r.numRows;if(s===0)return;let a=r.getChild("index").toArray(),c=r.getChild("density").toArray();for(let f=0;f<s;++f){let u=a[f],p=o+u%t,l=i+Math.floor(u/t);0<=p&&p<t&&0<=l&&l<e&&(n[p+l*t]=c[f])}}function gU(t,e,n){if(!t.image||t.image.w!==e||t.image.h!==n){let r=U1(e,n),o=r.getContext("2d",{willReadFrequently:!0}),i=o.getImageData(0,0,e,n);t.image={canvas:r,ctx:o,img:i,w:e,h:n}}return t.image}function yU(t,e,n,r,o,i){return t.select({index:Ae`FLOOR(${e})::INTEGER + FLOOR(${n})::INTEGER * ${o}`,...r}).groupby("index",i)}function xU(t,e,n,r,o,i){let s=r.column?`* ${r.column}`:"",a=(l,h)=>t.clone().select({xp:e,yp:n,i:l,w:h}),c=a(Ae`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${o}`,Ae`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(Ae`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${o}`,Ae`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(Ae`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${o}`,Ae`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),p=a(Ae`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${o}`,Ae`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return yt.from(yt.unionAll(c,f,u,p)).select({index:"i",density:zt("w")},i).groupby("index",i).having(Xo("density",0))}function lC(t){let e=Math.floor(t);return e===t?e-1:e}var F3=class extends Je{constructor(e,n){let{ci:r=.95,precision:o=4,...i}=n;super("line",e,i);let s=()=>this.modelFit?this.confidenceBand().update():null;this.ci=he(r,a=>(this.ci=a,s())),this.precision=he(o,a=>(this.precision=a,s()))}query(e=[]){let n=this.channelField("x").as,r=this.channelField("y").as,o=Array.from(new Set(["stroke","z","fx","fy"].flatMap(i=>this.channelField(i)?.as||[])));return yt.from(super.query(e)).select({intercept:Ob(r,n),slope:Fb(r,n),n:tl(r,n),ssy:Db(r,n),ssx:$b(r,n),xm:Ju(r,n),x0:de(Wr(n).where(Vr(r))),x1:de(Un(n).where(Vr(r)))}).select(o).groupby(o)}queryResult(e){return this.modelFit=cr(e),this.lineData=bU(this.modelFit),this.confidenceBand()}confidenceBand(){let{ci:e,modelFit:n,precision:r,plot:o}=this,i=o.innerWidth();return this.areaData=e?wU(n,e,r,i):null,this}plotSpecs(){let{lineData:e,areaData:n,channels:r,ci:o}=this,i=e.columns,s=o?n.columns:{},a={x:i.x,y:i.y},c={x:s.x,y1:s.y1,y2:s.y2,fillOpacity:.1};for(let f of r)switch(f.channel){case"x":case"y":case"fill":break;case"tip":c.tip=dn(f,s);break;case"stroke":a.stroke=dn(f,i),c.fill=dn(f,s);break;case"strokeOpacity":a.strokeOpacity=dn(f,i);break;case"fillOpacity":c.fillOpacity=dn(f,s);break;default:a[f.channel]=dn(f,i),c[f.channel]=dn(f,s);break}return[...o?[{type:"areaY",data:{length:n.numRows},options:c}]:[],{type:"line",data:{length:e.numRows},options:a}]}};function D3(t,e){if(t.concat)return t.concat(e);let n=new t.constructor(t.length+e.length);return n.set(t,0),n.set(e,t.length),n}function bU(t){let{x0:e=[],x1:n=[],xm:r,intercept:o,slope:i,n:s,ssx:a,ssy:c,...f}=t.columns,u=(h,d)=>o[d]+h*i[d],p=D3(e,n),l=D3(e.map(u),n.map(u));for(let h in f)f[h]=D3(f[h],f[h]);return{numRows:p.length,columns:{x:p,y:l,...f}}}function wU(t,e,n,r){let o=t.numRows,{x0:i,x1:s,xm:a,intercept:c,slope:f,n:u,ssx:p,ssy:l,...h}=t.columns,d=Object.keys(h),m={x:[],y1:[],y2:[]};d.forEach(g=>m[g]=[]);for(let g=0;g<o;++g){let y=n*(s[g]-i[g])/r,x=fC((1-e)/2,u[g]-2)*Math.sqrt(l[g]/(u[g]-2));le(i[g],s[g]-y/2,y).concat(s[g]).forEach(b=>{let w=c[g]+b*f[g],_=x*Math.sqrt(1/u[g]+(b-a[g])**2/p[g]);m.x.push(b),m.y1.push(w-_),m.y2.push(w+_),d.forEach(v=>m[v].push(h[v][g]))})}return{numRows:m.x.length,columns:m}}function lu(t){t.tagName==="a"&&(t=t.children[0]);let e=t.__data__;return Array.isArray(e)?e[0]:e}function pC(t){let e=t.toLowerCase(),n=t.length,r="";for(let o=0;o<n;++o)r+=(t[o]!==e[o]?"-":"")+e[o];return r}function Fs(t){let e={};for(let n in t)e[pC(n)]=t[n];return e}function vU(t){let{channels:e}=t,n=new Set,r=!1,o=!1;for(let i of e){let{channel:s,field:a,as:c}=i;if(s==="orderby")r=!0;else if(a)if(jn(a))o=!0;else{if(n.has(c))continue;n.add(c)}}return!r&&o&&n.size&&t.channels.push({channel:"orderby",value:Array.from(n)}),t}var P3=class{constructor(e,{selection:n,channels:r={}}){this.mark=vU(e),this.selection=n;let o=Object.entries(Fs(r));this.channels=o.length?o:[["opacity",.2]],this.selection.addEventListener("value",hu(()=>this.update()))}init(e){this.svg=e;let n=this.values=[],o=`g[data-index="${this.mark.index}"]`,i=`${o} > *:not(g), ${o} > g > *`,s=this.nodes=e.querySelectorAll(i),{channels:a}=this;for(let c=0;c<s.length;++c){let f=s[c];n.push(a.map(u=>f.getAttribute(u[0])))}return this.update()}async update(){let{svg:e,nodes:n,channels:r,values:o,mark:i,selection:s}=this;if(!e)return;let a=await _U(i,s);for(let c=0;c<n.length;++c){let f=n[c],u=o[c],p=a(lu(f));for(let l=0;l<r.length;++l){let[h,d]=r[l];f.setAttribute(h,p?u[l]:d)}}}};async function _U(t,e){let n=e?.predicate(t);if(!n||n.length===0)return()=>!0;let r=t.filterBy?.predicate(t,!0),o={__:Dn(n)},i=t.query(r);(i.queries||[i]).forEach(c=>{c._groupby.length?c.select(o):c.setSelect(o)});let s=await t.coordinator.query(i),a=s.getChild?.("__");return s.numRows||s.length?a?c=>a.at(c):c=>s[c].__:()=>!1}function j1(){let t=this,e=t.getScreenCTM,n;t.getScreenCTM=()=>t.isConnected?n=e.call(t):n}function q3(t){let e=t.on,n=!0;function r(o){n=!1,o(),n=!0}return t.reset=(...o)=>{r(()=>t.clear(...o))},t.moveSilent=(...o)=>{r(()=>t.move(...o))},t.on=(...o)=>{if(o.length>1&&o[1]){let i=o[1];o[1]=(...s)=>n&&i(...s)}return e(...o)},t}function X1(){return q3(Q2())}function hC(){return q3(V2())}function dC(){return q3(H2())}function W1(t,e,n,r,o){let i=At(e??t).append("g").attr("class",o),s=t.scale("fx"),a=t.scale("fy");if(s||a){let c=s?.domain.map(u=>s.apply(u)-n),f=a?.domain.map(u=>a.apply(u)-r);if(c&&f)for(let u=0;u<c.length;++u)for(let p=0;p<f.length;++p)i.append("g").attr("transform",`translate(${c[u]}, ${f[p]})`);else if(c)for(let u=0;u<c.length;++u)i.append("g").attr("transform",`translate(${c[u]}, 0})`);else if(f)for(let u=0;u<f.length;++u)i.append("g").attr("transform",`translate(0, ${f[u]})`);i=i.selectAll("g")}return i.each(j1)}function Kh(t,e){return t===e||t&&e&&Math.abs(t[0]-e[0])<1e-12&&Math.abs(t[1]-e[1])<1e-12||!1}function mC(t){if(en(t)){if(t.type==="COLUMN_REF")return t.column;if(t.type==="AGGREGATE")return t.args[0]??t}return t}function $o(t,e){return mC(t.channelField(e)?.field)}function gC(t,e){let n=[],r=[];return e.forEach(o=>{let i=o==="color"?["color","fill","stroke"]:o==="x"?["x","x1","x2"]:o==="y"?["y","y1","y2"]:[o];for(let s=0;s<i.length;++s){let a=t.channelField(i[s],{exact:!0});if(a){n.push(mC(a.field)),r.push(a.as);return}}throw new Error(`Missing channel: ${o}`)}),{fields:n,as:r}}function Jh(t,e,n=1){return e.invert(n*Math.floor(t/n))}var td=class{constructor(e,{channel:n,selection:r,field:o=void 0,pixelSize:i=1,peers:s=!0,brush:a}){this.mark=e,this.channel=n,this.pixelSize=i||1,this.selection=r,this.peers=s,this.field=o||$o(e,n),this.style=a&&Fs(a),this.brush=n==="y"?dC():hC(),this.brush.on("brush end",({selection:c})=>this.publish(c))}reset(){this.value=void 0,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause(this.value||[0,1]))}publish(e){let n;e&&(n=e.map(r=>Jh(r,this.scale,this.pixelSize)).sort((r,o)=>r-o)),Kh(n,this.value)||(this.value=n,this.g.call(this.brush.moveSilent,e),this.selection.update(this.clause(n)))}clause(e){let{mark:n,pixelSize:r,field:o,scale:i}=this;return al(o,e,{source:this,clients:this.peers?n.plot.markSet:new Set().add(n),scale:i,pixelSize:r})}init(e,n){let{brush:r,channel:o,style:i}=this;this.scale=e.scale(o);let s=this.value?.map(this.scale.apply).sort(dt),a=e.scale("x").range,c=e.scale("y").range;if(r.extent([[St(a),St(c)],[It(a),It(c)]]),this.g=W1(e,n,St(a),St(c),`interval-${o}`).call(r).call(r.moveSilent,s),i){let f=this.g.selectAll("rect.selection");for(let u in i)f.attr(u,i[u])}e.addEventListener("pointerenter",f=>{f.buttons||this.activate()})}};var B3=class{constructor(e,{selection:n,xfield:r,yfield:o,pixelSize:i=1,peers:s=!0,brush:a}){this.mark=e,this.pixelSize=i||1,this.selection=n,this.peers=s,this.xfield=r||$o(e,"x"),this.yfield=o||$o(e,"y"),this.style=a&&Fs(a),this.brush=X1(),this.brush.on("brush end",({selection:c})=>this.publish(c))}reset(){this.value=void 0,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause(this.value||[[0,1],[0,1]]))}publish(e){let{value:n,pixelSize:r,xscale:o,yscale:i}=this,s,a;if(e){let[c,f]=e;s=[c[0],f[0]].map(u=>Jh(u,o,r)).sort(dt),a=[c[1],f[1]].map(u=>Jh(u,i,r)).sort(dt)}(!Kh(s,n?.[0])||!Kh(a,n?.[1]))&&(this.value=e?[s,a]:void 0,this.g.call(this.brush.moveSilent,e),this.selection.update(this.clause(this.value)))}clause(e){let{mark:n,pixelSize:r,xfield:o,yfield:i,xscale:s,yscale:a}=this;return u2([o,i],e,{source:this,clients:this.peers?n.plot.markSet:new Set().add(n),scales:[s,a],pixelSize:r})}init(e){let{brush:n,style:r,value:o}=this,i=this.xscale=e.scale("x"),s=this.yscale=e.scale("y"),a=i.range,c=s.range;if(n.extent([[St(a),St(c)],[It(a),It(c)]]),this.g=W1(e,null,St(a),St(c),"interval-xy").call(n),r){let f=this.g.selectAll("rect.selection");for(let u in r)f.attr(u,r[u])}if(o){let[f,u]=o[0].map(i.apply).sort(dt),[p,l]=o[1].map(s.apply).sort(dt);this.g.call(n.moveSilent,[[f,p],[u,l]])}e.addEventListener("pointerenter",f=>{f.buttons||this.activate()})}};var z3=class{constructor(e,{selection:n,pointer:r,channels:o,fields:i,maxRadius:s=40}){this.mark=e,this.selection=n,this.clients=new Set().add(e),this.pointer=r,this.channels=o||(r==="x"?["x"]:r==="y"?["y"]:["x","y"]),this.fields=i||this.channels.map(a=>$o(e,[a])),this.maxRadius=s,this.valueIndex=-1}clause(e){let{clients:n,fields:r}=this,o={source:this,clients:n};return r.length>1?ea(r,e&&[e],o):f2(r[0],e?.[0],o)}init(e){let n=this,{mark:r,channels:o,selection:i,maxRadius:s}=this,{data:{columns:a}}=r,c=o.map(m=>r.channelField(m).as),f=!c2(i),[u,p]=MU(e,r),l=this.pointer==="y"?.01:1,h=this.pointer==="x"?.01:1,d=At(e);d.on("pointerenter pointerdown pointermove",function(m){let[g,y]=on(m,this),x=SU(u,p,g,y,l,h,s);if(x!==this.valueIndex){this.valueIndex=x;let b=x<0?void 0:c.map(w=>a[w][x]);i.update(f?!b||b.length>1?b:b[0]:n.clause(b))}}),!f&&(d.on("pointerleave",()=>{i.update(n.clause(void 0))}),e.addEventListener("pointerenter",m=>{if(!m.buttons){let g=this.channels.map(()=>0);i.activate(this.clause(g))}}))}};function MU(t,e){let{data:{columns:n}}=e,r=p=>n[e.channelField(p)?.as],o=p=>t.scale(p),i=t.scale("x"),s=t.scale("y"),a=o("fx")?.apply,c=o("fy")?.apply,f=Array.from(r("x"),i.apply),u=Array.from(r("y"),s.apply);if(a){let p=St(i.range),l=r("fx");for(let h=0;h<l.length;++h)f[h]+=a(l[h])-p}if(c){let p=St(s.range),l=r("fy");for(let h=0;h<l.length;++h)u[h]+=c(l[h])-p}return[f,u]}function SU(t,e,n,r,o,i,s){let a=s*s,c=-1;for(let f=0;f<t.length;++f){let u=o*(t[f]-n),p=i*(e[f]-r),l=u*u+p*p;l<=a&&(a=l,c=f)}return c}var yC=(t,e)=>t-e,U3=class{constructor(e,{x:n=new Yi,y:r=new Yi,xfield:o,yfield:i,zoom:s=!0,panx:a=!0,pany:c=!0}){this.mark=e,this.xsel=n,this.ysel=r,this.xfield=o||$o(e,"x"),this.yfield=i||$o(e,"y"),this.zoom=Y3(s,[0,1/0],[1,1]),this.panx=this.xsel&&a,this.pany=this.ysel&&c;let{plot:f}=e;a&&this.xsel.addEventListener("value",u=>{f.setAttribute("xDomain",u)&&f.update()}),c&&this.ysel.addEventListener("value",u=>{f.setAttribute("yDomain",u)&&f.update()})}publish(e){if(this.panx){let n=AU(e,this.xscale);this.xsel.update(this.clause(n,this.xfield,this.xscale))}if(this.pany){let n=EU(e,this.yscale);this.ysel.update(this.clause(n,this.yfield,this.yscale))}}clause(e,n,r){return al(n,e,{source:this,clients:this.mark.plot.markSet,scale:r})}init(e){if(this.svg=e,this.initialized)return;this.initialized=!0;let{panx:n,pany:r,mark:{plot:{element:o}},xsel:i,ysel:s}=this;this.xscale=e.scale("x"),this.yscale=e.scale("y");let a=this.xscale.range.slice().sort(yC),c=this.yscale.range.slice().sort(yC),f=Y3(n,[-1/0,1/0],a),u=Y3(r,[-1/0,1/0],c),p=h_().extent([[a[0],c[0]],[a[1],c[1]]]).scaleExtent(this.zoom).translateExtent([[f[0],u[0]],[f[1],u[1]]]).on("start",()=>{this.xscale=this.svg.scale("x"),this.yscale=this.svg.scale("y")}).on("end",()=>o.__zoom=new Qn(1,0,0)).on("zoom",({transform:l})=>this.publish(l));if(At(o).call(p),n||r){let l=!1;o.addEventListener("pointerenter",h=>{if(!l&&(l=!0,!h.buttons)){if(n){let{xscale:d,xfield:m}=this;i.activate(this.clause(d.domain,m,d))}if(r){let{yscale:d,yfield:m}=this;s.activate(this.clause(d.domain,m,d))}}}),o.addEventListener("pointerleave",()=>l=!1)}}};function Y3(t,e,n){return t?Array.isArray(t)?t:e:n}function AU(t,e){return e.range.map(t.invertX,t).map(e.invert,e)}function EU(t,e){return e.range.map(t.invertY,t).map(e.invert,e)}var TU={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},IU=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,CU=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,NU=/^((\s+,?\s*)|(,\s*))/,kU=/^[01]/,xC=t=>`Invalid SVG path, incorrect parameter ${t}`;function bC(t){let e=[];return(t.match(IU)||[]).forEach(r=>{let o=r[0],i=o.toLowerCase(),s=TU[i],a=RU(i,s,r.slice(1).trim()),c=a.length;if(c<s||c&&c%s!==0)throw new Error(xC("count"));if(e.push([o,...a.slice(0,s)]),c!==s){i==="m"&&(o=o==="M"?"L":"l");for(let f=s;f<c;f+=s)e.push([o,...a.slice(f,f+s)])}}),e}function RU(t,e,n){let r=[];for(let o=0;e&&o<n.length;)for(let i=0;i<e;++i){let s=t==="a"&&(i===3||i===4)?kU:CU,a=n.slice(o).match(s);if(a===null)throw new Error(xC("type"));o+=a[0].length,r.push(+a[0]);let c=n.slice(o).match(NU);c!==null&&(o+=c[0].length)}return r}function SC(t,e,n){let{x:r,y:o}=t.getBoundingClientRect(),i=t.createSVGMatrix(),s=[];for(let a of e.children)if(a.tagName==="g"){let c=AC(a)??i;for(let f of a.children)wC(n,r,o,f,c)&&s.push(f)}else wC(n,r,o,a,i)&&s.push(a);return s}function wC(t,e,n,r,o){let[[i,s],[a,c]]=t,{e:f,f:u}=o,p=r.getBoundingClientRect(),l=p.left-e,h=p.right-e,d=p.top-n,m=p.bottom-n;if(l>=i&&h<=a&&d>=s&&m<=c)return!0;if(l<=a&&h>=i&&d<=c&&m>=s){let g=r.tagName;if(g==="a"&&(r=r.children[0],g=r.tagName),g==="rect"||g==="text"||g==="image")return!0;switch(i-=f,s-=u,a-=f,c-=u,g){case"circle":return EC(i,s,a,c,nc(r.cx),nc(r.cy),nc(r.r));case"line":return TC(i,s,a,c,nc(r.x1),nc(r.y1),nc(r.x2),nc(r.y2));case"path":return LU(i,s,a,c,r)}}return!1}function nc(t){return t.baseVal.value}function AC(t){let e=t.transform.baseVal,n=e.length,r=e[0]?.matrix;for(let o=1;o<n;++o)r=r.multiply(e[o].matrix);return r}function EC(t,e,n,r,o,i,s){let a=t<=o&&o<=n,c=e<=i&&i<=r;if(a&&c)return!0;let f=Math.min(Math.abs(t-o),Math.abs(n-o));if(c&&f<=s)return!0;let u=Math.min(Math.abs(e-i),Math.abs(r-i));return a&&u<=s||f*f+u*u<=s*s}function TC(t,e,n,r,o,i,s,a){let c=Math.max(Math.min(o,s),t),f=Math.min(Math.max(o,s),n);if(c>f)return!1;let u=i,p=a,l=s-o;if(Math.abs(l)>1e-8){let m=(a-i)/l,g=i-m*o;u=m*c+g,p=m*f+g}let h=Math.max(Math.min(u,p),e),d=Math.min(Math.max(u,p),r);return h<=d}function LU(t,e,n,r,o){let i=o.__path__||(o.__path__=bC(o.getAttribute("d"))),s=0,a=0,c=0,f=0,u=!1,p=[0,0],l=2,h=AC(o),d=(x,b)=>{p.length=l=2,p[0]=c=s=x,p[1]=f=a=b},m=h?(x,b)=>d(vC(h,x,b),_C(h,x,b)):(x,b)=>d(x,b),g=(x,b)=>(p[l]=x,p[l+1]=b,l+=2,TC(t,e,n,r,p[l-4],p[l-3],x,b)),y=h?(x,b)=>{u=g(vC(h,c=x,f=b),_C(h,x,b))}:(x,b)=>{u=g(c=x,f=b)};for(let x=0;x<i.length;++x){let b=i[x];switch(b[0]){case"M":m(b[1],b[2]);break;case"m":m(c+b[1],f+b[2]);break;case"L":case"T":y(b[1],b[2]);break;case"H":y(b[1],f);break;case"V":y(c,b[1]);break;case"l":case"t":y(c+b[1],f+b[2]);break;case"h":y(c+b[1],f);break;case"v":y(c,f+b[1]);break;case"C":y(b[5],b[6]);break;case"c":y(c+b[5],f+b[6]);break;case"S":case"Q":y(b[3],b[4]);break;case"s":case"q":y(c+b[3],f+b[4]);break;case"A":y(b[6],b[7]);break;case"a":if(OU(i,x))return EC(t,e,n,r,c,f-b[2],b[2]);y(c+b[6],c+b[7]);break;case"z":case"Z":if(y(s,a),$U(t,e,p)>0)return!0;m(s,a);break;default:return console.warn("SVG path command not supported: ",b[0]),!1}if(u)return!0}return!1}function vC(t,e,n){return t.a*e+t.c*n+t.e}function _C(t,e,n){return t.b*e+t.d*n+t.f}function OU(t,e){let n=t[e],r=t[e+1];return r&&r[0]==="a"&&t[e+2]?.[0]==="z"&&n[1]===n[2]&&r[1]===r[2]&&n[1]===r[1]&&n[7]===-r[7]}function $U(t,e,n){let r=0,o=n.length-2;for(let i=0;i<o;i+=2)n[i+1]<=e?n[i+3]>e&&MC(t,e,n,i)>0&&++r:n[i+3]<=e&&MC(t,e,n[i])<0&&--r;return r}function MC(t,e,n,r){return(n[r+2]-n[r])*(e-n[r+1])-(t-n[r])*(n[r+3]-n[r+1])}function G1(t,e){return t==null||e==null?t!=null||e!=null:t.length!==e.length||t.some((n,r)=>V1(n,e[r]))}function V1(t,e){let n=t.length;if(e.length!==n)return!0;for(let r=0;r<n;++r)if(t[r]!==e[r])return!0;return!1}var j3=class{constructor(e,{channels:n,selection:r,peers:o=!0,brush:i={fill:"none",stroke:"currentColor",strokeDasharray:"1,1"}}){this.mark=e,this.selection=r,this.peers=o,this.style=i&&Fs(i),this.brush=X1(),this.brush.on("brush end",c=>this.publish(c.selection)),this.extent=null,this.groups=null;let{fields:s,as:a}=gC(e,n);this.fields=s,this.as=a}reset(){this.value=void 0,this.extent=null,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause([this.fields.map(()=>0)]))}clause(e){let{fields:n,mark:r}=this;return ea(n,e,{source:this,clients:this.peers?r.plot.markSet:new Set().add(r)})}publish(e){let{as:n,group:r,mark:o,svg:i}=this,s;if(e){let{data:{columns:a={}}={}}=o,c=new Map;SC(i,r,e).forEach(f=>{let u=lu(f),p=n.map(l=>a[l][u]);c.set(p.join("|"),p)}),s=Array.from(c.values())}this.extent=e,G1(s,this.value)&&(this.value=s,this.selection.update(this.clause(s)))}init(e){let{brush:n,extent:r,mark:o,style:i}=this;this.svg=e;let s=e.width.baseVal.value,a=e.height.baseVal.value;if(n.extent([[0,0],[s,a]]),this.group=e.querySelector(`[data-index="${o.index}"]`),this.g=At(e).append("g").attr("class","region-xy").each(j1).call(n).call(n.moveSilent,r),i){let c=this.g.selectAll("rect.selection");for(let f in i)c.attr(f,i[f])}e.addEventListener("pointerenter",c=>{c.buttons||this.activate()})}};var ed=class{constructor(e,{selection:n,channels:r,peers:o=!0}){this.value=null,this.mark=e,this.selection=n,this.peers=o;let i=this.fields=[],s=this.as=[];r.forEach(a=>{let c=a==="color"?["color","fill","stroke"]:a==="x"?["x","x1","x2"]:a==="y"?["y","y1","y2"]:[a];for(let f=0;f<c.length;++f){let u=e.channelField(c[f],{exact:!0});if(u){i.push(u.field?.basis||u.field),s.push(u.as);return}}throw new Error(`Missing channel: ${a}`)})}clause(e){let{fields:n,mark:r}=this;return ea(n,e,{source:this,clients:this.peers?r.plot.markSet:new Set().add(r)})}init(e,n,r){let{mark:o,as:i,selection:s}=this,{data:{columns:a={}}={}}=o;r??=f=>i.map(u=>a[u][lu(f)]),n??=`[data-index="${o.index}"]`;let c=Array.from(e.querySelectorAll(n));e.addEventListener("pointerdown",f=>{let u=s.single?s.value:this.value,p=f.target,l=null;if(DU(c,p)){let h=r(p);(f.shiftKey||f.metaKey)&&u?.length?(l=u.filter(d=>V1(d,h)),l.length===u.length&&l.push(h)):u?.length===1&&!V1(u[0],h)?l=null:l=[h]}this.value=l,G1(u,l)&&s.update(this.clause(l))}),e.addEventListener("pointerenter",f=>{f.buttons||this.selection.activate(this.clause([this.fields.map(()=>0)]))})}};function DU(t,e){return t.some(n=>n.contains(e))}var CC=":scope > div, :scope > span",H1="swatch",IC="ramp",X3=class{constructor(e,n){let{as:r,field:o,...i}=n;this.channel=e,this.options=i,this.type=null,this.handler=null,this.selection=r,this.field=o,this.legend=null,this.element=document.createElement("div"),this.element.setAttribute("class","legend"),Object.defineProperty(this.element,"value",{value:this})}setPlot(e){this.plot=e}init(e){let n=FU(this,e);return this.element.replaceChildren(n),this.element}update(){if(!this.legend)return;let{selection:e,handler:n}=this,{single:r,value:o}=e,i=r?o:e.valueFor(n),s=i&&i.length?new Set(i.map(c=>c[0])):null,a=this.legend.querySelectorAll(CC);for(let c of a){let f=s?s.has(c.__data__):!0;c.style.opacity=f?1:.2}}};function FU(t,e){let{channel:n,plot:r,selection:o}=t,i=e.scale(n),s=i.type==="ordinal"?H1:IC,a={label:r.getAttribute(`${n}Label`)??null,...t.options},c=s===H1?a:a.label?{tickSize:2,...a}:{tickSize:2,marginTop:1,height:29,...a},f=e.legend(n,c);t.legend=f;let u=!!o;if(u&&s===IC){let p=c.width??240,l=zU(i,p);l?f.scale=function(h){return h==="x"?{range:[0,p]}:h==="y"?{range:[-10,0]}:h===n?l:void 0}:u=!1}if(u){let p=PU(t,s);s===H1?(p.init(f,CC,l=>[l.__data__]),t.update()):p.init(f,f.querySelector("g:last-of-type"))}return f}function PU(t,e){let{channel:n,handler:r,selection:o}=t;if(r)return r;let i=qU(t);return e===H1?(t.handler=new ed(i,{selection:o,channels:[n],peers:!1}),o.addEventListener("value",()=>t.update())):t.handler=new td(i,{selection:o,channel:n,brush:{fill:"none",stroke:"currentColor"},peers:!1}),t.handler}function qU(t){let{channel:e,plot:n}=t,r=t.field??BU(n.marks,e)??"value";if(r){let o={field:r};return{plot:n,channelField:i=>e===i?o:void 0}}}function BU(t,e){let n=e==="color"?["fill","stroke"]:e==="opacity"?["opacity","fillOpacity","strokeOpacity"]:null;if(n==null)return null;for(let r=t.length-1;r>-1;--r)for(let o of n){let i=t[r].channelField(o,{exact:!0});if(i)return i.field}return null}function zU(t,e){let{apply:n,invert:r,interpolate:o,...i}=t,s=t.type;s.startsWith("diverging-")&&(s=s.slice(11));let a;switch(s){case"log":case"pow":case"sqrt":case"symlog":a=s;break;case"threshold":case"quantize":case"quantile":return console.warn(`Legends do not yet support ${s} scales.`),null;default:a="linear"}return ys({x:{...i,type:a,range:[0,e]}})}function Q1(t,e,n=0,r=Math.LN10){let o,i=Math.ceil(Math.log(e)/r),s=Math.max(n,Math.pow(10,Math.round(Math.log(t)/r)-i));for(;Math.ceil(t/s)>e;)s*=10;let a=[5,2];for(let c=0,f=a.length;c<f;++c)o=s/a[c],o>=n&&t/o<=e&&(s=o);return s}function NC(t,e,n){let{step:r,steps:o,minstep:i=0,nice:s=!0}=n;if(s!==!1){let a=e-t,c=Math.LN10;r=r||Q1(a,o||25,i,c);let f=Math.log(r),u=f>=0?0:~~(-f/c)+1,p=Math.pow(10,-u-1);f=Math.floor(t/r+p)*r,t=t<f?f-r:f,e=Math.ceil(e/r)*r,o=Math.round((e-t)/r)}return{min:t,max:e,steps:o}}var OC="year",kC="month",RC="day",Z1="hour",K1="minute",J1="second",YU="millisecond",rd=1e3,od=rd*60,id=od*60,tb=id*24,UU=tb*7,LC=tb*30,$C=tb*365,nd=[[J1,1,rd],[J1,5,5*rd],[J1,15,15*rd],[J1,30,30*rd],[K1,1,od],[K1,5,5*od],[K1,15,15*od],[K1,30,30*od],[Z1,1,id],[Z1,3,3*id],[Z1,6,6*id],[Z1,12,12*id],[RC,1,tb],[RC,7,UU],[kC,1,LC],[kC,3,3*LC],[OC,1,$C]];function DC(t,e,n){let r=e-t,o=r/n,i=Nr(s=>s[2]).right(nd,o);return i===nd.length?{interval:OC,step:Q1(r/$C,n)}:i?(i=nd[o/nd[i-1][2]<nd[i][2]/o?i-1:i],{interval:i[0],step:i[1]}):{interval:YU,step:Q1(r,n,1)}}var jU=new Set(["rectY-x","rectX-y","rect-x","rect-y","ruleY-x","ruleX-y"]);function XU(t,e){return jU.has(`${t.type}-${e}`)}function WU(t,e={}){let n=(r,o)=>XU(r,o)?{[`${o}1`]:W3(r,o,t,e),[`${o}2`]:W3(r,o,t,{...e,offset:1})}:{[o]:W3(r,o,t,e)};return n[pu]=!0,n}function W3(t,e,n,r){return new G3(n,t,e,r)}function GU(t,e){let n=t.plot.getAttribute(`${e}Scale`);return n==="utc"||n==="time"}var G3=class extends xt{constructor(e,n,r,o){super("COLUMN_REF"),this.column=e,this.mark=n,this.channel=r,this.options=o}get stats(){return{column:this.column,stats:["min","max"]}}toString(){let{mark:e,channel:n,column:r,options:o}=this,{type:i,min:s,max:a}=e.channelField(n),{interval:c,steps:f,offset:u=0}=o,p=c??(i==="date"||GU(e,n)?"date":"number"),l;if(p==="number"){let{apply:h,sqlApply:d,sqlInvert:m}=ec(e,n),g=NC(h(s),h(a),o),y=d(r),x=de((g.max-g.min)/g.steps),b=Re(Lt(g.min===0?y:ut(y,g.min),x)),w=Nt(g.min,pt(x,u?Nt(u,b):b));l=m(w)}else{let{interval:h,step:d=1}=p==="date"?DC(s,a,f||40):o,m=zb(r,h,d);l=u?Nt(m,Im(h,u*d)):m}return`${l}`}};export{A3 as ConnectedMark,E3 as ContourMark,C3 as DenseLineMark,N3 as Density1DMark,k3 as Density2DMark,R3 as ErrorBarMark,Li as Fixed,L3 as GeoMark,zr as Grid2DMark,T3 as HeatmapMark,O3 as HexbinMark,P3 as Highlight,td as Interval1D,B3 as Interval2D,X3 as Legend,Je as Mark,z3 as Nearest,U3 as PanZoom,x3 as Plot,fu as RasterMark,$3 as RasterTileMark,j3 as Region,F3 as RegressionMark,ed as Toggle,pu as Transform,Ye as Transient,WU as bin};