@uwdata/mosaic-plot 0.6.0 → 0.6.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.
- package/dist/mosaic-plot.js +5886 -5651
- package/dist/mosaic-plot.min.js +11 -11
- package/package.json +3 -3
- package/src/marks/Grid2DMark.js +22 -2
- package/src/marks/util/arrow.js +30 -0
- package/src/marks/util/density.js +26 -7
- package/src/marks/util/grid.js +42 -48
- package/src/marks/util/interpolate.js +196 -0
- package/src/plot.js +7 -2
package/dist/mosaic-plot.min.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var tC=Object.create;var Tw=Object.defineProperty;var eC=Object.getOwnPropertyDescriptor;var nC=Object.getOwnPropertyNames;var rC=Object.getPrototypeOf,iC=Object.prototype.hasOwnProperty;var S3=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),zs=(e,t)=>{for(var n in t)Tw(e,n,{get:t[n],enumerable:!0})},oC=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of nC(t))!iC.call(e,i)&&i!==n&&Tw(e,i,{get:()=>t[i],enumerable:!(r=eC(t,i))||r.enumerable});return e};var sC=(e,t,n)=>(n=e!=null?tC(rC(e)):{},oC(t||!e||!e.__esModule?Tw(n,"default",{value:e,enumerable:!0}):n,e));var HB=S3((zOt,XB)=>{"use strict";function OW(e,t,n,r,i){for(var o=i+1;r<=i;){var s=r+i>>>1,a=e[s],c=n!==void 0?n(a,t):a-t;c>=0?(o=s,i=s-1):r=s+1}return o}function BW(e,t,n,r,i){for(var o=i+1;r<=i;){var s=r+i>>>1,a=e[s],c=n!==void 0?n(a,t):a-t;c>0?(o=s,i=s-1):r=s+1}return o}function FW(e,t,n,r,i){for(var o=r-1;r<=i;){var s=r+i>>>1,a=e[s],c=n!==void 0?n(a,t):a-t;c<0?(o=s,r=s+1):i=s-1}return o}function CW(e,t,n,r,i){for(var o=r-1;r<=i;){var s=r+i>>>1,a=e[s],c=n!==void 0?n(a,t):a-t;c<=0?(o=s,r=s+1):i=s-1}return o}function LW(e,t,n,r,i){for(;r<=i;){var o=r+i>>>1,s=e[o],a=n!==void 0?n(s,t):s-t;if(a===0)return o;a<=0?r=o+1:i=o-1}return-1}function Cm(e,t,n,r,i,o){return typeof n=="function"?o(e,t,n,r===void 0?0:r|0,i===void 0?e.length-1:i|0):o(e,t,void 0,n===void 0?0:n|0,r===void 0?e.length-1:r|0)}XB.exports={ge:function(e,t,n,r,i){return Cm(e,t,n,r,i,OW)},gt:function(e,t,n,r,i){return Cm(e,t,n,r,i,BW)},lt:function(e,t,n,r,i){return Cm(e,t,n,r,i,FW)},le:function(e,t,n,r,i){return Cm(e,t,n,r,i,CW)},eq:function(e,t,n,r,i){return Cm(e,t,n,r,i,LW)}}});var rF=S3((qOt,nF)=>{"use strict";var pw=HB(),kf=0,xl=1,dw=2;nF.exports=RW;function $M(e,t,n,r,i){this.mid=e,this.left=t,this.right=n,this.leftPoints=r,this.rightPoints=i,this.count=(t?t.count:0)+(n?n.count:0)+r.length}var Lm=$M.prototype;function kM(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function QB(e,t){var n=Rf(t);e.mid=n.mid,e.left=n.left,e.right=n.right,e.leftPoints=n.leftPoints,e.rightPoints=n.rightPoints,e.count=n.count}function ZB(e,t){var n=e.intervals([]);n.push(t),QB(e,n)}function KB(e,t){var n=e.intervals([]),r=n.indexOf(t);return r<0?kf:(n.splice(r,1),QB(e,n),xl)}Lm.intervals=function(e){return e.push.apply(e,this.leftPoints),this.left&&this.left.intervals(e),this.right&&this.right.intervals(e),e};Lm.insert=function(e){var t=this.count-this.leftPoints.length;if(this.count+=1,e[1]<this.mid)this.left?4*(this.left.count+1)>3*(t+1)?ZB(this,e):this.left.insert(e):this.left=Rf([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?ZB(this,e):this.right.insert(e):this.right=Rf([e]);else{var n=pw.ge(this.leftPoints,e,PM),r=pw.ge(this.rightPoints,e,UM);this.leftPoints.splice(n,0,e),this.rightPoints.splice(r,0,e)}};Lm.remove=function(e){var t=this.count-this.leftPoints;if(e[1]<this.mid){if(!this.left)return kf;var n=this.right?this.right.count:0;if(4*n>3*(t-1))return KB(this,e);var r=this.left.remove(e);return r===dw?(this.left=null,this.count-=1,xl):(r===xl&&(this.count-=1),r)}else if(e[0]>this.mid){if(!this.right)return kf;var i=this.left?this.left.count:0;if(4*i>3*(t-1))return KB(this,e);var r=this.right.remove(e);return r===dw?(this.right=null,this.count-=1,xl):(r===xl&&(this.count-=1),r)}else{if(this.count===1)return this.leftPoints[0]===e?dw:kf;if(this.leftPoints.length===1&&this.leftPoints[0]===e){if(this.left&&this.right){for(var o=this,s=this.left;s.right;)o=s,s=s.right;if(o===this)s.right=this.right;else{var a=this.left,r=this.right;o.count-=s.count,o.right=s.left,s.left=a,s.right=r}kM(this,s),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?kM(this,this.left):kM(this,this.right);return xl}for(var a=pw.ge(this.leftPoints,e,PM);a<this.leftPoints.length&&this.leftPoints[a][0]===e[0];++a)if(this.leftPoints[a]===e){this.count-=1,this.leftPoints.splice(a,1);for(var r=pw.ge(this.rightPoints,e,UM);r<this.rightPoints.length&&this.rightPoints[r][1]===e[1];++r)if(this.rightPoints[r]===e)return this.rightPoints.splice(r,1),xl}return kf}};function JB(e,t,n){for(var r=0;r<e.length&&e[r][0]<=t;++r){var i=n(e[r]);if(i)return i}}function tF(e,t,n){for(var r=e.length-1;r>=0&&e[r][1]>=t;--r){var i=n(e[r]);if(i)return i}}function eF(e,t){for(var n=0;n<e.length;++n){var r=t(e[n]);if(r)return r}}Lm.queryPoint=function(e,t){if(e<this.mid){if(this.left){var n=this.left.queryPoint(e,t);if(n)return n}return JB(this.leftPoints,e,t)}else if(e>this.mid){if(this.right){var n=this.right.queryPoint(e,t);if(n)return n}return tF(this.rightPoints,e,t)}else return eF(this.leftPoints,t)};Lm.queryInterval=function(e,t,n){if(e<this.mid&&this.left){var r=this.left.queryInterval(e,t,n);if(r)return r}if(t>this.mid&&this.right){var r=this.right.queryInterval(e,t,n);if(r)return r}return t<this.mid?JB(this.leftPoints,t,n):e>this.mid?tF(this.rightPoints,e,n):eF(this.leftPoints,n)};function kW(e,t){return e-t}function PM(e,t){var n=e[0]-t[0];return n||e[1]-t[1]}function UM(e,t){var n=e[1]-t[1];return n||e[0]-t[0]}function Rf(e){if(e.length===0)return null;for(var t=[],n=0;n<e.length;++n)t.push(e[n][0],e[n][1]);t.sort(kW);for(var r=t[t.length>>1],i=[],o=[],s=[],n=0;n<e.length;++n){var a=e[n];a[1]<r?i.push(a):r<a[0]?o.push(a):s.push(a)}var c=s,l=s.slice();return c.sort(PM),l.sort(UM),new $M(r,Rf(i),Rf(o),c,l)}function RM(e){this.root=e}var $f=RM.prototype;$f.insert=function(e){this.root?this.root.insert(e):this.root=new $M(e[0],null,null,[e],[e])};$f.remove=function(e){if(this.root){var t=this.root.remove(e);return t===dw&&(this.root=null),t!==kf}return!1};$f.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)};$f.queryInterval=function(e,t,n){if(e<=t&&this.root)return this.root.queryInterval(e,t,n)};Object.defineProperty($f,"count",{get:function(){return this.root?this.root.count:0}});Object.defineProperty($f,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function RW(e){return!e||e.length===0?new RM(null):new RM(Rf(e))}});var qs=Symbol("Fixed"),dn=Symbol("Transient"),Yf=Symbol("Transform");var I3={};function Wf(e,t=!1){let n,r,i=I3;function o(l){n=e(l).then(()=>{if(r){let{value:u}=r;r=null,o(u)}else n=null})}function s(l){r={event:l}}function a(l){n?s(l):o(l)}function c(l){i!==l&&requestAnimationFrame(()=>{let u=i;i=I3,a(u)}),i=l}return t?c:a}var Gf=class{constructor(t){this._filterBy=t,this._requestUpdate=Wf(()=>this.requestQuery(),!0),this._coordinator=null}get coordinator(){return this._coordinator}set coordinator(t){this._coordinator=t}get filterBy(){return this._filterBy}get filterIndexable(){return!0}fields(){return null}fieldInfo(){return this}query(){return null}queryPending(){return this}queryResult(){return this}queryError(t){return console.error(t),this}requestQuery(t){let n=t||this.query(this.filterBy?.predicate(this));return this._coordinator.requestQuery(this,n)}requestUpdate(){this._requestUpdate()}update(){return this}};function A3(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function H(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(f){s(f)}}function c(u){try{l(r.throw(u))}catch(f){s(f)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})}function M3(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ft(e){return this instanceof Ft?(this.v=e,this):new Ft(e)}function mr(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){r[h]&&(i[h]=function(d){return new Promise(function(p,m){o.push([h,d,p,m])>1||a(h,d)})})}function a(h,d){try{c(r[h](d))}catch(p){f(o[0][3],p)}}function c(h){h.value instanceof Ft?Promise.resolve(h.value.v).then(l,u):f(o[0][2],h)}function l(h){a("next",h)}function u(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function vl(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,o){t[i]=e[i]?function(s){return(n=!n)?{value:Ft(e[i](s)),done:!1}:o?o(s):s}:o}}function ii(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof M3=="function"?M3(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),i(a,c,s.done,s.value)})}}function i(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}var Fw={};zs(Fw,{compareArrayLike:()=>Bw,joinUint8Arrays:()=>gr,memcpy:()=>Sl,rebaseValueOffsets:()=>Xm,toArrayBufferView:()=>kt,toArrayBufferViewAsyncIterator:()=>si,toArrayBufferViewIterator:()=>Ri,toBigInt64Array:()=>dC,toBigUint64Array:()=>yC,toFloat32Array:()=>gC,toFloat32ArrayAsyncIterator:()=>FC,toFloat32ArrayIterator:()=>MC,toFloat64Array:()=>bC,toFloat64ArrayAsyncIterator:()=>CC,toFloat64ArrayIterator:()=>AC,toInt16Array:()=>hC,toInt16ArrayAsyncIterator:()=>DC,toInt16ArrayIterator:()=>_C,toInt32Array:()=>Qa,toInt32ArrayAsyncIterator:()=>NC,toInt32ArrayIterator:()=>vC,toInt8Array:()=>fC,toInt8ArrayAsyncIterator:()=>EC,toInt8ArrayIterator:()=>wC,toUint16Array:()=>pC,toUint16ArrayAsyncIterator:()=>OC,toUint16ArrayIterator:()=>SC,toUint32Array:()=>mC,toUint32ArrayAsyncIterator:()=>BC,toUint32ArrayIterator:()=>IC,toUint8Array:()=>Et,toUint8ArrayAsyncIterator:()=>Ow,toUint8ArrayIterator:()=>Nw,toUint8ClampedArray:()=>xC,toUint8ClampedArrayAsyncIterator:()=>LC,toUint8ClampedArrayIterator:()=>TC});var aC=new TextDecoder("utf-8"),Xf=e=>aC.decode(e),cC=new TextEncoder,Vs=e=>cC.encode(e);var lC=e=>typeof e=="number",T3=e=>typeof e=="boolean",Ke=e=>typeof e=="function",$n=e=>e!=null&&Object(e)===e,yr=e=>$n(e)&&Ke(e.then);var oi=e=>$n(e)&&Ke(e[Symbol.iterator]),Rr=e=>$n(e)&&Ke(e[Symbol.asyncIterator]),qm=e=>$n(e)&&$n(e.schema);var Vm=e=>$n(e)&&"done"in e&&"value"in e;var jm=e=>$n(e)&&Ke(e.stat)&&lC(e.fd);var Ym=e=>$n(e)&&Hf(e.body),Wm=e=>"_getDOMStream"in e&&"_getNodeStream"in e,E3=e=>$n(e)&&Ke(e.abort)&&Ke(e.getWriter)&&!Wm(e),Hf=e=>$n(e)&&Ke(e.cancel)&&Ke(e.getReader)&&!Wm(e),D3=e=>$n(e)&&Ke(e.end)&&Ke(e.write)&&T3(e.writable)&&!Wm(e),Gm=e=>$n(e)&&Ke(e.read)&&Ke(e.pipe)&&T3(e.readable)&&!Wm(e),N3=e=>$n(e)&&Ke(e.clear)&&Ke(e.bytes)&&Ke(e.position)&&Ke(e.setPosition)&&Ke(e.capacity)&&Ke(e.getBufferIdentifier)&&Ke(e.createLong);var Dw=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function uC(e){let t=e[0]?[e[0]]:[],n,r,i,o;for(let s,a,c=0,l=0,u=e.length;++c<u;){if(s=t[l],a=e[c],!s||!a||s.buffer!==a.buffer||a.byteOffset<s.byteOffset){a&&(t[++l]=a);continue}if({byteOffset:n,byteLength:i}=s,{byteOffset:r,byteLength:o}=a,n+i<r||r+o<n){a&&(t[++l]=a);continue}t[l]=new Uint8Array(s.buffer,n,r-n+o)}return t}function Sl(e,t,n=0,r=t.byteLength){let i=e.byteLength,o=new Uint8Array(e.buffer,e.byteOffset,i),s=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,i));return o.set(s,n),e}function gr(e,t){let n=uC(e),r=n.reduce((u,f)=>u+f.byteLength,0),i,o,s,a=0,c=-1,l=Math.min(t||Number.POSITIVE_INFINITY,r);for(let u=n.length;++c<u;){if(i=n[c],o=i.subarray(0,Math.min(i.length,l-a)),l<=a+o.length){o.length<i.length?n[c]=i.subarray(o.length):o.length===i.length&&c++,s?Sl(s,o,a):s=o;break}Sl(s||(s=new Uint8Array(l)),o,a),a+=o.length}return[s||new Uint8Array(0),n.slice(c),r-(s?s.byteLength:0)]}function kt(e,t){let n=Vm(t)?t.value:t;return n instanceof e?e===Uint8Array?new e(n.buffer,n.byteOffset,n.byteLength):n:n?(typeof n=="string"&&(n=Vs(n)),n instanceof ArrayBuffer?new e(n):n instanceof Dw?new e(n):N3(n)?kt(e,n.bytes()):ArrayBuffer.isView(n)?n.byteLength<=0?new e(0):new e(n.buffer,n.byteOffset,n.byteLength/e.BYTES_PER_ELEMENT):e.from(n)):new e(0)}var fC=e=>kt(Int8Array,e),hC=e=>kt(Int16Array,e),Qa=e=>kt(Int32Array,e),dC=e=>kt(BigInt64Array,e),Et=e=>kt(Uint8Array,e),pC=e=>kt(Uint16Array,e),mC=e=>kt(Uint32Array,e),yC=e=>kt(BigUint64Array,e),gC=e=>kt(Float32Array,e),bC=e=>kt(Float64Array,e),xC=e=>kt(Uint8ClampedArray,e),Ew=e=>(e.next(),e);function*Ri(e,t){let n=function*(i){yield i},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Dw?n(t):oi(t)?t:n(t);return yield*Ew(function*(i){let o=null;do o=i.next(yield kt(e,o));while(!o.done)}(r[Symbol.iterator]())),new e}var wC=e=>Ri(Int8Array,e),_C=e=>Ri(Int16Array,e),vC=e=>Ri(Int32Array,e),Nw=e=>Ri(Uint8Array,e),SC=e=>Ri(Uint16Array,e),IC=e=>Ri(Uint32Array,e),MC=e=>Ri(Float32Array,e),AC=e=>Ri(Float64Array,e),TC=e=>Ri(Uint8ClampedArray,e);function si(e,t){return mr(this,arguments,function*(){if(yr(t))return yield Ft(yield Ft(yield*vl(ii(si(e,yield Ft(t))))));let r=function(s){return mr(this,arguments,function*(){yield yield Ft(yield Ft(s))})},i=function(s){return mr(this,arguments,function*(){yield Ft(yield*vl(ii(Ew(function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)}(s[Symbol.iterator]())))))})},o=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Dw?r(t):oi(t)?i(t):Rr(t)?t:r(t);return yield Ft(yield*vl(ii(Ew(function(s){return mr(this,arguments,function*(){let a=null;do a=yield Ft(s.next(yield yield Ft(kt(e,a))));while(!a.done)})}(o[Symbol.asyncIterator]()))))),yield Ft(new e)})}var EC=e=>si(Int8Array,e),DC=e=>si(Int16Array,e),NC=e=>si(Int32Array,e),Ow=e=>si(Uint8Array,e),OC=e=>si(Uint16Array,e),BC=e=>si(Uint32Array,e),FC=e=>si(Float32Array,e),CC=e=>si(Float64Array,e),LC=e=>si(Uint8ClampedArray,e);function Xm(e,t,n){if(e!==0){n=n.slice(0,t);for(let r=-1,i=n.length;++r<i;)n[r]+=e}return n.subarray(0,t)}function Bw(e,t){let n=0,r=e.length;if(r!==t.length)return!1;if(r>0)do if(e[n]!==t[n])return!1;while(++n<r);return!0}var pn={fromIterable(e){return Hm(kC(e))},fromAsyncIterable(e){return Hm(RC(e))},fromDOMStream(e){return Hm($C(e))},fromNodeStream(e){return Hm(PC(e))},toDOMStream(e,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(e,t){throw new Error('"toNodeStream" not available in this environment')}},Hm=e=>(e.next(),e);function*kC(e){let t,n=!1,r=[],i,o,s,a=0;function c(){return o==="peek"?gr(r,s)[0]:([i,r,a]=gr(r,s),i)}({cmd:o,size:s}=yield null);let l=Nw(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(s-a)?l.next():l.next(s-a),!t&&i.byteLength>0&&(r.push(i),a+=i.byteLength),t||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!t)}catch(u){(n=!0)&&typeof l.throw=="function"&&l.throw(u)}finally{n===!1&&typeof l.return=="function"&&l.return(null)}return null}function RC(e){return mr(this,arguments,function*(){let n,r=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?gr(i,a)[0]:([o,i,c]=gr(i,a),o)}({cmd:s,size:a}=yield yield Ft(null));let u=Ow(e)[Symbol.asyncIterator]();try{do if({done:n,value:o}=Number.isNaN(a-c)?yield Ft(u.next()):yield Ft(u.next(a-c)),!n&&o.byteLength>0&&(i.push(o),c+=o.byteLength),n||a<=c)do({cmd:s,size:a}=yield yield Ft(l()));while(a<c);while(!n)}catch(f){(r=!0)&&typeof u.throw=="function"&&(yield Ft(u.throw(f)))}finally{r===!1&&typeof u.return=="function"&&(yield Ft(u.return(new Uint8Array(0))))}return yield Ft(null)})}function $C(e){return mr(this,arguments,function*(){let n=!1,r=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?gr(i,a)[0]:([o,i,c]=gr(i,a),o)}({cmd:s,size:a}=yield yield Ft(null));let u=new Lw(e);try{do if({done:n,value:o}=Number.isNaN(a-c)?yield Ft(u.read()):yield Ft(u.read(a-c)),!n&&o.byteLength>0&&(i.push(Et(o)),c+=o.byteLength),n||a<=c)do({cmd:s,size:a}=yield yield Ft(l()));while(a<c);while(!n)}catch(f){(r=!0)&&(yield Ft(u.cancel(f)))}finally{r===!1?yield Ft(u.cancel()):e.locked&&u.releaseLock()}return yield Ft(null)})}var Lw=class{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return H(this,void 0,void 0,function*(){let{reader:n,source:r}=this;n&&(yield n.cancel(t).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(t){return H(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let n=yield this.reader.read();return!n.done&&(n.value=Et(n)),n})}},Cw=(e,t)=>{let n=i=>r([t,i]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function PC(e){return mr(this,arguments,function*(){let n=[],r="error",i=!1,o=null,s,a,c=0,l=[],u;function f(){return s==="peek"?gr(l,a)[0]:([u,l,c]=gr(l,a),u)}if({cmd:s,size:a}=yield yield Ft(null),e.isTTY)return yield yield Ft(new Uint8Array(0)),yield Ft(null);try{n[0]=Cw(e,"end"),n[1]=Cw(e,"error");do{if(n[2]=Cw(e,"readable"),[r,o]=yield Ft(Promise.race(n.map(d=>d[2]))),r==="error")break;if((i=r==="end")||(Number.isFinite(a-c)?(u=Et(e.read(a-c)),u.byteLength<a-c&&(u=Et(e.read()))):u=Et(e.read()),u.byteLength>0&&(l.push(u),c+=u.byteLength)),i||a<=c)do({cmd:s,size:a}=yield yield Ft(f()));while(a<c)}while(!i)}finally{yield Ft(h(n,r==="error"?o:null))}return yield Ft(null);function h(d,p){return u=l=null,new Promise((m,g)=>{for(let[y,b]of d)e.off(y,b);try{let y=e.destroy;y&&y.call(e,p),p=void 0}catch(y){p=y||p}finally{p!=null?g(p):m()}})}})}var Ie;(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(Ie||(Ie={}));var me;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(me||(me={}));var we;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(we||(we={}));var Tn;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(Tn||(Tn={}));var pt;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(pt||(pt={}));var rr;(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(rr||(rr={}));var Ht;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(Ht||(Ht={}));var F;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e[e.DurationSecond=-27]="DurationSecond",e[e.DurationMillisecond=-28]="DurationMillisecond",e[e.DurationMicrosecond=-29]="DurationMicrosecond",e[e.DurationNanosecond=-30]="DurationNanosecond"})(F||(F={}));var ai;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(ai||(ai={}));var t_={};zs(t_,{clampIndex:()=>NL,clampRange:()=>Jf,createElementComparator:()=>Ws});var kw={};zs(kw,{valueToString:()=>ci});function ci(e){if(e===null)return"null";if(e===void 0)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(t=>ci(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,n)=>typeof n=="bigint"?`${n}`:n)}var $w={};zs($w,{BN:()=>Kf,bigNumToBigInt:()=>F3,bigNumToString:()=>Al,isArrowBigNumSymbol:()=>O3});var O3=Symbol.for("isArrowBigNum");function li(e,...t){return t.length===0?Object.setPrototypeOf(kt(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}li.prototype[O3]=!0;li.prototype.toJSON=function(){return`"${Al(this)}"`};li.prototype.valueOf=function(){return B3(this)};li.prototype.toString=function(){return Al(this)};li.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return B3(this);case"string":return Al(this);case"default":return F3(this)}return Al(this)};function Il(...e){return li.apply(this,e)}function Ml(...e){return li.apply(this,e)}function Zf(...e){return li.apply(this,e)}Object.setPrototypeOf(Il.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Ml.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Zf.prototype,Object.create(Uint32Array.prototype));Object.assign(Il.prototype,li.prototype,{constructor:Il,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Ml.prototype,li.prototype,{constructor:Ml,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Zf.prototype,li.prototype,{constructor:Zf,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});function B3(e){let{buffer:t,byteOffset:n,length:r,signed:i}=e,o=new BigUint64Array(t,n,r),s=i&&o.at(-1)&BigInt(1)<<BigInt(63),a=BigInt(s?1:0),c=BigInt(0);if(s){for(let l of o)a+=~l*(BigInt(1)<<BigInt(32)*c++);a*=BigInt(-1)}else for(let l of o)a+=l*(BigInt(1)<<BigInt(32)*c++);return a}var Al=e=>{if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return Rw(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return Rw(e);t=t.slice();let r=1;for(let o=0;o<t.length;o++){let s=t[o],a=~s+r;t[o]=a,r&=s===0?1:0}return`-${Rw(t)}`},F3=e=>e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:Al(e);function Rw(e){let t="",n=new Uint32Array(2),r=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),i=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),o=-1,s=r.length-1;do{for(n[0]=r[o=0];o<s;)r[o++]=n[1]=n[0]/10,n[0]=(n[0]-n[1]*10<<16)+r[o];r[o]=n[1]=n[0]/10,n[0]=n[0]-n[1]*10,t=`${n[0]}${t}`}while(i[0]||i[1]||i[2]||i[3]);return t??"0"}var Kf=class e{static new(t,n){switch(n){case!0:return new Il(t);case!1:return new Ml(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Il(t)}return t.byteLength===16?new Zf(t):new Ml(t)}static signed(t){return new Il(t)}static unsigned(t){return new Ml(t)}static decimal(t){return new Zf(t)}constructor(t,n){return e.new(t,n)}};function ir(e){if(typeof e=="bigint"&&(e<Number.MIN_SAFE_INTEGER||e>Number.MAX_SAFE_INTEGER))throw new TypeError(`${e} is not safe to convert to a number.`);return Number(e)}var C3,L3,k3,R3,$3,P3,U3,z3,q3,V3,j3,Y3,W3,G3,X3,H3,Z3,K3,Q3,J3,st=class e{static isNull(t){return t?.typeId===F.Null}static isInt(t){return t?.typeId===F.Int}static isFloat(t){return t?.typeId===F.Float}static isBinary(t){return t?.typeId===F.Binary}static isUtf8(t){return t?.typeId===F.Utf8}static isBool(t){return t?.typeId===F.Bool}static isDecimal(t){return t?.typeId===F.Decimal}static isDate(t){return t?.typeId===F.Date}static isTime(t){return t?.typeId===F.Time}static isTimestamp(t){return t?.typeId===F.Timestamp}static isInterval(t){return t?.typeId===F.Interval}static isDuration(t){return t?.typeId===F.Duration}static isList(t){return t?.typeId===F.List}static isStruct(t){return t?.typeId===F.Struct}static isUnion(t){return t?.typeId===F.Union}static isFixedSizeBinary(t){return t?.typeId===F.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===F.FixedSizeList}static isMap(t){return t?.typeId===F.Map}static isDictionary(t){return t?.typeId===F.Dictionary}static isDenseUnion(t){return e.isUnion(t)&&t.mode===me.Dense}static isSparseUnion(t){return e.isUnion(t)&&t.mode===me.Sparse}get typeId(){return F.NONE}};C3=Symbol.toStringTag;st[C3]=(e=>(e.children=null,e.ArrayType=Array,e[Symbol.toStringTag]="DataType"))(st.prototype);var Pn=class extends st{toString(){return"Null"}get typeId(){return F.Null}};L3=Symbol.toStringTag;Pn[L3]=(e=>e[Symbol.toStringTag]="Null")(Pn.prototype);var Le=class extends st{constructor(t,n){super(),this.isSigned=t,this.bitWidth=n}get typeId(){return F.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};k3=Symbol.toStringTag;Le[k3]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(Le.prototype);var Zm=class extends Le{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Km=class extends Le{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},$i=class extends Le{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Qm=class extends Le{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Jm=class extends Le{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},ty=class extends Le{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},ey=class extends Le{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},ny=class extends Le{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Zm.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Km.prototype,"ArrayType",{value:Int16Array});Object.defineProperty($i.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Qm.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Jm.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(ty.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(ey.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(ny.prototype,"ArrayType",{value:BigUint64Array});var or=class extends st{constructor(t){super(),this.precision=t}get typeId(){return F.Float}get ArrayType(){switch(this.precision){case we.HALF:return Uint16Array;case we.SINGLE:return Float32Array;case we.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};R3=Symbol.toStringTag;or[R3]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(or.prototype);var ry=class extends or{constructor(){super(we.HALF)}},iy=class extends or{constructor(){super(we.SINGLE)}},oy=class extends or{constructor(){super(we.DOUBLE)}};Object.defineProperty(ry.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(iy.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(oy.prototype,"ArrayType",{value:Float64Array});var Oo=class extends st{constructor(){super()}get typeId(){return F.Binary}toString(){return"Binary"}};$3=Symbol.toStringTag;Oo[$3]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(Oo.prototype);var Bo=class extends st{constructor(){super()}get typeId(){return F.Utf8}toString(){return"Utf8"}};P3=Symbol.toStringTag;Bo[P3]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(Bo.prototype);var Fo=class extends st{constructor(){super()}get typeId(){return F.Bool}toString(){return"Bool"}};U3=Symbol.toStringTag;Fo[U3]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(Fo.prototype);var Co=class extends st{constructor(t,n,r=128){super(),this.scale=t,this.precision=n,this.bitWidth=r}get typeId(){return F.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};z3=Symbol.toStringTag;Co[z3]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(Co.prototype);var Lo=class extends st{constructor(t){super(),this.unit=t}get typeId(){return F.Date}toString(){return`Date${(this.unit+1)*32}<${Tn[this.unit]}>`}};q3=Symbol.toStringTag;Lo[q3]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Date"))(Lo.prototype);var ui=class extends st{constructor(t,n){super(),this.unit=t,this.bitWidth=n}get typeId(){return F.Time}toString(){return`Time${this.bitWidth}<${pt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};V3=Symbol.toStringTag;ui[V3]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(ui.prototype);var ko=class extends st{constructor(t,n){super(),this.unit=t,this.timezone=n}get typeId(){return F.Timestamp}toString(){return`Timestamp<${pt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};j3=Symbol.toStringTag;ko[j3]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Timestamp"))(ko.prototype);var Ro=class extends st{constructor(t){super(),this.unit=t}get typeId(){return F.Interval}toString(){return`Interval<${rr[this.unit]}>`}};Y3=Symbol.toStringTag;Ro[Y3]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(Ro.prototype);var $o=class extends st{constructor(t){super(),this.unit=t}get typeId(){return F.Duration}toString(){return`Duration<${pt[this.unit]}>`}};W3=Symbol.toStringTag;$o[W3]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))($o.prototype);var fi=class extends st{constructor(t){super(),this.children=[t]}get typeId(){return F.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};G3=Symbol.toStringTag;fi[G3]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(fi.prototype);var he=class extends st{constructor(t){super(),this.children=t}get typeId(){return F.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};X3=Symbol.toStringTag;he[X3]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(he.prototype);var hi=class extends st{constructor(t,n,r){super(),this.mode=t,this.children=r,this.typeIds=n=Int32Array.from(n),this.typeIdToChildIndex=n.reduce((i,o,s)=>(i[o]=s)&&i||i,Object.create(null))}get typeId(){return F.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};H3=Symbol.toStringTag;hi[H3]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(hi.prototype);var Po=class extends st{constructor(t){super(),this.byteWidth=t}get typeId(){return F.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Z3=Symbol.toStringTag;Po[Z3]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(Po.prototype);var di=class extends st{constructor(t,n){super(),this.listSize=t,this.children=[n]}get typeId(){return F.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};K3=Symbol.toStringTag;di[K3]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(di.prototype);var pi=class extends st{constructor(t,n=!1){var r,i,o;if(super(),this.children=[t],this.keysSorted=n,t&&(t.name="entries",!((r=t?.type)===null||r===void 0)&&r.children)){let s=(i=t?.type)===null||i===void 0?void 0:i.children[0];s&&(s.name="key");let a=(o=t?.type)===null||o===void 0?void 0:o.children[1];a&&(a.name="value")}}get typeId(){return F.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};Q3=Symbol.toStringTag;pi[Q3]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(pi.prototype);var UC=(e=>()=>++e)(-1),br=class extends st{constructor(t,n,r,i){super(),this.indices=n,this.dictionary=t,this.isOrdered=i||!1,this.id=r==null?UC():ir(r)}get typeId(){return F.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};J3=Symbol.toStringTag;br[J3]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(br.prototype);function xr(e){let t=e;switch(e.typeId){case F.Decimal:return e.bitWidth/32;case F.Timestamp:return 2;case F.Date:return 1+t.unit;case F.Interval:return 1+t.unit;case F.FixedSizeList:return t.listSize;case F.FixedSizeBinary:return t.byteWidth;default:return 1}}var lt=class{visitMany(t,...n){return t.map((r,i)=>this.visit(r,...n.map(o=>o[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,n=!0){return zC(this,t,n)}getVisitFnByTypeId(t,n=!0){return Tl(this,t,n)}visitNull(t,...n){return null}visitBool(t,...n){return null}visitInt(t,...n){return null}visitFloat(t,...n){return null}visitUtf8(t,...n){return null}visitBinary(t,...n){return null}visitFixedSizeBinary(t,...n){return null}visitDate(t,...n){return null}visitTimestamp(t,...n){return null}visitTime(t,...n){return null}visitDecimal(t,...n){return null}visitList(t,...n){return null}visitStruct(t,...n){return null}visitUnion(t,...n){return null}visitDictionary(t,...n){return null}visitInterval(t,...n){return null}visitDuration(t,...n){return null}visitFixedSizeList(t,...n){return null}visitMap(t,...n){return null}};function zC(e,t,n=!0){return typeof t=="number"?Tl(e,t,n):typeof t=="string"&&t in F?Tl(e,F[t],n):t&&t instanceof st?Tl(e,t6(t),n):t?.type&&t.type instanceof st?Tl(e,t6(t.type),n):Tl(e,F.NONE,n)}function Tl(e,t,n=!0){let r=null;switch(t){case F.Null:r=e.visitNull;break;case F.Bool:r=e.visitBool;break;case F.Int:r=e.visitInt;break;case F.Int8:r=e.visitInt8||e.visitInt;break;case F.Int16:r=e.visitInt16||e.visitInt;break;case F.Int32:r=e.visitInt32||e.visitInt;break;case F.Int64:r=e.visitInt64||e.visitInt;break;case F.Uint8:r=e.visitUint8||e.visitInt;break;case F.Uint16:r=e.visitUint16||e.visitInt;break;case F.Uint32:r=e.visitUint32||e.visitInt;break;case F.Uint64:r=e.visitUint64||e.visitInt;break;case F.Float:r=e.visitFloat;break;case F.Float16:r=e.visitFloat16||e.visitFloat;break;case F.Float32:r=e.visitFloat32||e.visitFloat;break;case F.Float64:r=e.visitFloat64||e.visitFloat;break;case F.Utf8:r=e.visitUtf8;break;case F.Binary:r=e.visitBinary;break;case F.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case F.Date:r=e.visitDate;break;case F.DateDay:r=e.visitDateDay||e.visitDate;break;case F.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case F.Timestamp:r=e.visitTimestamp;break;case F.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case F.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case F.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case F.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case F.Time:r=e.visitTime;break;case F.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case F.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case F.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case F.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case F.Decimal:r=e.visitDecimal;break;case F.List:r=e.visitList;break;case F.Struct:r=e.visitStruct;break;case F.Union:r=e.visitUnion;break;case F.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case F.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case F.Dictionary:r=e.visitDictionary;break;case F.Interval:r=e.visitInterval;break;case F.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case F.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case F.Duration:r=e.visitDuration;break;case F.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case F.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case F.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case F.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case F.FixedSizeList:r=e.visitFixedSizeList;break;case F.Map:r=e.visitMap;break}if(typeof r=="function")return r;if(!n)return()=>null;throw new Error(`Unrecognized type '${F[t]}'`)}function t6(e){switch(e.typeId){case F.Null:return F.Null;case F.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?F.Int8:F.Uint8;case 16:return n?F.Int16:F.Uint16;case 32:return n?F.Int32:F.Uint32;case 64:return n?F.Int64:F.Uint64}return F.Int}case F.Float:switch(e.precision){case we.HALF:return F.Float16;case we.SINGLE:return F.Float32;case we.DOUBLE:return F.Float64}return F.Float;case F.Binary:return F.Binary;case F.Utf8:return F.Utf8;case F.Bool:return F.Bool;case F.Decimal:return F.Decimal;case F.Time:switch(e.unit){case pt.SECOND:return F.TimeSecond;case pt.MILLISECOND:return F.TimeMillisecond;case pt.MICROSECOND:return F.TimeMicrosecond;case pt.NANOSECOND:return F.TimeNanosecond}return F.Time;case F.Timestamp:switch(e.unit){case pt.SECOND:return F.TimestampSecond;case pt.MILLISECOND:return F.TimestampMillisecond;case pt.MICROSECOND:return F.TimestampMicrosecond;case pt.NANOSECOND:return F.TimestampNanosecond}return F.Timestamp;case F.Date:switch(e.unit){case Tn.DAY:return F.DateDay;case Tn.MILLISECOND:return F.DateMillisecond}return F.Date;case F.Interval:switch(e.unit){case rr.DAY_TIME:return F.IntervalDayTime;case rr.YEAR_MONTH:return F.IntervalYearMonth}return F.Interval;case F.Duration:switch(e.unit){case pt.SECOND:return F.DurationSecond;case pt.MILLISECOND:return F.DurationMillisecond;case pt.MICROSECOND:return F.DurationMicrosecond;case pt.NANOSECOND:return F.DurationNanosecond}return F.Duration;case F.Map:return F.Map;case F.List:return F.List;case F.Struct:return F.Struct;case F.Union:switch(e.mode){case me.Dense:return F.DenseUnion;case me.Sparse:return F.SparseUnion}return F.Union;case F.FixedSizeBinary:return F.FixedSizeBinary;case F.FixedSizeList:return F.FixedSizeList;case F.Dictionary:return F.Dictionary}throw new Error(`Unrecognized type '${F[e.typeId]}'`)}lt.prototype.visitInt8=null;lt.prototype.visitInt16=null;lt.prototype.visitInt32=null;lt.prototype.visitInt64=null;lt.prototype.visitUint8=null;lt.prototype.visitUint16=null;lt.prototype.visitUint32=null;lt.prototype.visitUint64=null;lt.prototype.visitFloat16=null;lt.prototype.visitFloat32=null;lt.prototype.visitFloat64=null;lt.prototype.visitDateDay=null;lt.prototype.visitDateMillisecond=null;lt.prototype.visitTimestampSecond=null;lt.prototype.visitTimestampMillisecond=null;lt.prototype.visitTimestampMicrosecond=null;lt.prototype.visitTimestampNanosecond=null;lt.prototype.visitTimeSecond=null;lt.prototype.visitTimeMillisecond=null;lt.prototype.visitTimeMicrosecond=null;lt.prototype.visitTimeNanosecond=null;lt.prototype.visitDenseUnion=null;lt.prototype.visitSparseUnion=null;lt.prototype.visitIntervalDayTime=null;lt.prototype.visitIntervalYearMonth=null;lt.prototype.visitDuration=null;lt.prototype.visitDurationSecond=null;lt.prototype.visitDurationMillisecond=null;lt.prototype.visitDurationMicrosecond=null;lt.prototype.visitDurationNanosecond=null;var Pw={};zs(Pw,{float64ToUint16:()=>Qf,uint16ToFloat64:()=>sy});var e6=new Float64Array(1),El=new Uint32Array(e6.buffer);function sy(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return r*(n?Number.NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*Math.pow(2,t-15)*(1+n)}function Qf(e){if(e!==e)return 32256;e6[0]=e;let t=(El[1]&2147483648)>>16&65535,n=El[1]&2146435072,r=0;return n>=1089470464?El[0]>0?n=31744:(n=(n&2080374784)>>16,r=(El[1]&1048575)>>10):n<=1056964608?(r=1048576+(El[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(El[1]&1048575)+512>>10),t|n|r&65535}var wt=class extends lt{};function It(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}var qC=(e,t,n)=>{e[t]=Math.trunc(n/864e5)},Uw=(e,t,n)=>{e[t]=Math.trunc(n%4294967296),e[t+1]=Math.trunc(n/4294967296)},VC=(e,t,n)=>{e[t]=Math.trunc(n*1e3%4294967296),e[t+1]=Math.trunc(n*1e3/4294967296)},jC=(e,t,n)=>{e[t]=Math.trunc(n*1e6%4294967296),e[t+1]=Math.trunc(n*1e6/4294967296)},n6=(e,t,n,r)=>{if(n+1<t.length){let{[n]:i,[n+1]:o}=t;e.set(r.subarray(0,o-i),i)}},YC=({offset:e,values:t},n,r)=>{let i=e+n;r?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},Uo=({values:e},t,n)=>{e[t]=n},zw=({values:e},t,n)=>{e[t]=n},r6=({values:e},t,n)=>{e[t]=Qf(n)},WC=(e,t,n)=>{switch(e.type.precision){case we.HALF:return r6(e,t,n);case we.SINGLE:case we.DOUBLE:return zw(e,t,n)}},ay=({values:e},t,n)=>{qC(e,t,n.valueOf())},cy=({values:e},t,n)=>{Uw(e,t*2,n.valueOf())},qw=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},GC=({values:e,valueOffsets:t},n,r)=>n6(e,t,n,r),XC=({values:e,valueOffsets:t},n,r)=>{n6(e,t,n,Vs(r))},Vw=(e,t,n)=>{e.type.unit===Tn.DAY?ay(e,t,n):cy(e,t,n)},ly=({values:e},t,n)=>Uw(e,t*2,n/1e3),uy=({values:e},t,n)=>Uw(e,t*2,n),fy=({values:e},t,n)=>VC(e,t*2,n),hy=({values:e},t,n)=>jC(e,t*2,n),jw=(e,t,n)=>{switch(e.type.unit){case pt.SECOND:return ly(e,t,n);case pt.MILLISECOND:return uy(e,t,n);case pt.MICROSECOND:return fy(e,t,n);case pt.NANOSECOND:return hy(e,t,n)}},dy=({values:e},t,n)=>{e[t]=n},py=({values:e},t,n)=>{e[t]=n},my=({values:e},t,n)=>{e[t]=n},yy=({values:e},t,n)=>{e[t]=n},Yw=(e,t,n)=>{switch(e.type.unit){case pt.SECOND:return dy(e,t,n);case pt.MILLISECOND:return py(e,t,n);case pt.MICROSECOND:return my(e,t,n);case pt.NANOSECOND:return yy(e,t,n)}},Ww=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},HC=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,o=mn.getVisitFn(r);if(Array.isArray(n))for(let s=-1,a=i[t],c=i[t+1];a<c;)o(r,a++,n[++s]);else for(let s=-1,a=i[t],c=i[t+1];a<c;)o(r,a++,n.get(++s))},ZC=(e,t,n)=>{let r=e.children[0],{valueOffsets:i}=e,o=mn.getVisitFn(r),{[t]:s,[t+1]:a}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let l of c)if(o(r,s,l),++s>=a)break},KC=(e,t)=>(n,r,i,o)=>r&&n(r,e,t[o]),QC=(e,t)=>(n,r,i,o)=>r&&n(r,e,t.get(o)),JC=(e,t)=>(n,r,i,o)=>r&&n(r,e,t.get(i.name)),tL=(e,t)=>(n,r,i,o)=>r&&n(r,e,t[i.name]),eL=(e,t,n)=>{let r=e.type.children.map(o=>mn.getVisitFn(o.type)),i=n instanceof Map?JC(t,n):n instanceof zt?QC(t,n):Array.isArray(n)?KC(t,n):tL(t,n);e.type.children.forEach((o,s)=>i(r[s],e.children[s],o,s))},nL=(e,t,n)=>{e.type.mode===me.Dense?i6(e,t,n):o6(e,t,n)},i6=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];mn.visit(i,e.valueOffsets[t],n)},o6=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];mn.visit(i,t,n)},rL=(e,t,n)=>{var r;(r=e.dictionary)===null||r===void 0||r.set(e.values[t],n)},Gw=(e,t,n)=>{e.type.unit===rr.DAY_TIME?gy(e,t,n):by(e,t,n)},gy=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},by=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},xy=({values:e},t,n)=>{e[t]=n},wy=({values:e},t,n)=>{e[t]=n},_y=({values:e},t,n)=>{e[t]=n},vy=({values:e},t,n)=>{e[t]=n},Xw=(e,t,n)=>{switch(e.type.unit){case pt.SECOND:return xy(e,t,n);case pt.MILLISECOND:return wy(e,t,n);case pt.MICROSECOND:return _y(e,t,n);case pt.NANOSECOND:return vy(e,t,n)}},iL=(e,t,n)=>{let{stride:r}=e,i=e.children[0],o=mn.getVisitFn(i);if(Array.isArray(n))for(let s=-1,a=t*r;++s<r;)o(i,a+s,n[s]);else for(let s=-1,a=t*r;++s<r;)o(i,a+s,n.get(s))};wt.prototype.visitBool=It(YC);wt.prototype.visitInt=It(Uo);wt.prototype.visitInt8=It(Uo);wt.prototype.visitInt16=It(Uo);wt.prototype.visitInt32=It(Uo);wt.prototype.visitInt64=It(Uo);wt.prototype.visitUint8=It(Uo);wt.prototype.visitUint16=It(Uo);wt.prototype.visitUint32=It(Uo);wt.prototype.visitUint64=It(Uo);wt.prototype.visitFloat=It(WC);wt.prototype.visitFloat16=It(r6);wt.prototype.visitFloat32=It(zw);wt.prototype.visitFloat64=It(zw);wt.prototype.visitUtf8=It(XC);wt.prototype.visitBinary=It(GC);wt.prototype.visitFixedSizeBinary=It(qw);wt.prototype.visitDate=It(Vw);wt.prototype.visitDateDay=It(ay);wt.prototype.visitDateMillisecond=It(cy);wt.prototype.visitTimestamp=It(jw);wt.prototype.visitTimestampSecond=It(ly);wt.prototype.visitTimestampMillisecond=It(uy);wt.prototype.visitTimestampMicrosecond=It(fy);wt.prototype.visitTimestampNanosecond=It(hy);wt.prototype.visitTime=It(Yw);wt.prototype.visitTimeSecond=It(dy);wt.prototype.visitTimeMillisecond=It(py);wt.prototype.visitTimeMicrosecond=It(my);wt.prototype.visitTimeNanosecond=It(yy);wt.prototype.visitDecimal=It(Ww);wt.prototype.visitList=It(HC);wt.prototype.visitStruct=It(eL);wt.prototype.visitUnion=It(nL);wt.prototype.visitDenseUnion=It(i6);wt.prototype.visitSparseUnion=It(o6);wt.prototype.visitDictionary=It(rL);wt.prototype.visitInterval=It(Gw);wt.prototype.visitIntervalDayTime=It(gy);wt.prototype.visitIntervalYearMonth=It(by);wt.prototype.visitDuration=It(Xw);wt.prototype.visitDurationSecond=It(xy);wt.prototype.visitDurationMillisecond=It(wy);wt.prototype.visitDurationMicrosecond=It(_y);wt.prototype.visitDurationNanosecond=It(vy);wt.prototype.visitFixedSizeList=It(iL);wt.prototype.visitMap=It(ZC);var mn=new wt;var mi=Symbol.for("parent"),Dl=Symbol.for("rowIndex"),js=class{constructor(t,n){return this[mi]=t,this[Dl]=n,new Proxy(this,new Zw)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Dl],n=this[mi],r=n.type.children,i={};for(let o=-1,s=r.length;++o<s;)i[r[o].name]=Ue.visit(n.children[o],t);return i}toString(){return`{${[...this].map(([t,n])=>`${ci(t)}: ${ci(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Hw(this[mi],this[Dl])}},Hw=class{constructor(t,n){this.childIndex=0,this.children=t.children,this.rowIndex=n,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,Ue.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(js.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[mi]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Dl]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var Zw=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[mi].type.children.map(n=>n.name)}has(t,n){return t[mi].type.children.findIndex(r=>r.name===n)!==-1}getOwnPropertyDescriptor(t,n){if(t[mi].type.children.findIndex(r=>r.name===n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];let r=t[mi].type.children.findIndex(i=>i.name===n);if(r!==-1){let i=Ue.visit(t[mi].children[r],t[Dl]);return Reflect.set(t,n,i),i}}set(t,n,r){let i=t[mi].type.children.findIndex(o=>o.name===n);return i!==-1?(mn.visit(t[mi].children[i],t[Dl],r),Reflect.set(t,n,r)):Reflect.has(t,n)||typeof n=="symbol"?Reflect.set(t,n,r):!1}};var mt=class extends lt{};function vt(e){return(t,n)=>t.getValid(n)?e(t,n):null}var oL=(e,t)=>864e5*e[t],Kw=(e,t)=>4294967296*e[t+1]+(e[t]>>>0),sL=(e,t)=>4294967296*(e[t+1]/1e3)+(e[t]>>>0)/1e3,aL=(e,t)=>4294967296*(e[t+1]/1e6)+(e[t]>>>0)/1e6,s6=e=>new Date(e),cL=(e,t)=>s6(oL(e,t)),lL=(e,t)=>s6(Kw(e,t)),uL=(e,t)=>null,a6=(e,t,n)=>{if(n+1>=t.length)return null;let r=t[n],i=t[n+1];return e.subarray(r,i)},fL=({offset:e,values:t},n)=>{let r=e+n;return(t[r>>3]&1<<r%8)!==0},c6=({values:e},t)=>cL(e,t),l6=({values:e},t)=>lL(e,t*2),Ys=({stride:e,values:t},n)=>t[e*n],hL=({stride:e,values:t},n)=>sy(t[e*n]),u6=({values:e},t)=>e[t],dL=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),pL=({values:e,valueOffsets:t},n)=>a6(e,t,n),mL=({values:e,valueOffsets:t},n)=>{let r=a6(e,t,n);return r!==null?Xf(r):null},yL=({values:e},t)=>e[t],gL=({type:e,values:t},n)=>e.precision!==we.HALF?t[n]:sy(t[n]),bL=(e,t)=>e.type.unit===Tn.DAY?c6(e,t):l6(e,t),f6=({values:e},t)=>1e3*Kw(e,t*2),h6=({values:e},t)=>Kw(e,t*2),d6=({values:e},t)=>sL(e,t*2),p6=({values:e},t)=>aL(e,t*2),xL=(e,t)=>{switch(e.type.unit){case pt.SECOND:return f6(e,t);case pt.MILLISECOND:return h6(e,t);case pt.MICROSECOND:return d6(e,t);case pt.NANOSECOND:return p6(e,t)}},m6=({values:e},t)=>e[t],y6=({values:e},t)=>e[t],g6=({values:e},t)=>e[t],b6=({values:e},t)=>e[t],wL=(e,t)=>{switch(e.type.unit){case pt.SECOND:return m6(e,t);case pt.MILLISECOND:return y6(e,t);case pt.MICROSECOND:return g6(e,t);case pt.NANOSECOND:return b6(e,t)}},_L=({values:e,stride:t},n)=>Kf.decimal(e.subarray(t*n,t*(n+1))),vL=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:o,[t*r+1]:s}=n,c=i[0].slice(o,s-o);return new zt([c])},SL=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:o}=n,s=r[0];return new Pi(s.slice(i,o-i))},IL=(e,t)=>new js(e,t),ML=(e,t)=>e.type.mode===me.Dense?x6(e,t):w6(e,t),x6=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Ue.visit(r,e.valueOffsets[t])},w6=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Ue.visit(r,t)},AL=(e,t)=>{var n;return(n=e.dictionary)===null||n===void 0?void 0:n.get(e.values[t])},TL=(e,t)=>e.type.unit===rr.DAY_TIME?_6(e,t):v6(e,t),_6=({values:e},t)=>e.subarray(2*t,2*(t+1)),v6=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},S6=({values:e},t)=>e[t],I6=({values:e},t)=>e[t],M6=({values:e},t)=>e[t],A6=({values:e},t)=>e[t],EL=(e,t)=>{switch(e.type.unit){case pt.SECOND:return S6(e,t);case pt.MILLISECOND:return I6(e,t);case pt.MICROSECOND:return M6(e,t);case pt.NANOSECOND:return A6(e,t)}},DL=(e,t)=>{let{stride:n,children:r}=e,o=r[0].slice(t*n,n);return new zt([o])};mt.prototype.visitNull=vt(uL);mt.prototype.visitBool=vt(fL);mt.prototype.visitInt=vt(yL);mt.prototype.visitInt8=vt(Ys);mt.prototype.visitInt16=vt(Ys);mt.prototype.visitInt32=vt(Ys);mt.prototype.visitInt64=vt(u6);mt.prototype.visitUint8=vt(Ys);mt.prototype.visitUint16=vt(Ys);mt.prototype.visitUint32=vt(Ys);mt.prototype.visitUint64=vt(u6);mt.prototype.visitFloat=vt(gL);mt.prototype.visitFloat16=vt(hL);mt.prototype.visitFloat32=vt(Ys);mt.prototype.visitFloat64=vt(Ys);mt.prototype.visitUtf8=vt(mL);mt.prototype.visitBinary=vt(pL);mt.prototype.visitFixedSizeBinary=vt(dL);mt.prototype.visitDate=vt(bL);mt.prototype.visitDateDay=vt(c6);mt.prototype.visitDateMillisecond=vt(l6);mt.prototype.visitTimestamp=vt(xL);mt.prototype.visitTimestampSecond=vt(f6);mt.prototype.visitTimestampMillisecond=vt(h6);mt.prototype.visitTimestampMicrosecond=vt(d6);mt.prototype.visitTimestampNanosecond=vt(p6);mt.prototype.visitTime=vt(wL);mt.prototype.visitTimeSecond=vt(m6);mt.prototype.visitTimeMillisecond=vt(y6);mt.prototype.visitTimeMicrosecond=vt(g6);mt.prototype.visitTimeNanosecond=vt(b6);mt.prototype.visitDecimal=vt(_L);mt.prototype.visitList=vt(vL);mt.prototype.visitStruct=vt(IL);mt.prototype.visitUnion=vt(ML);mt.prototype.visitDenseUnion=vt(x6);mt.prototype.visitSparseUnion=vt(w6);mt.prototype.visitDictionary=vt(AL);mt.prototype.visitInterval=vt(TL);mt.prototype.visitIntervalDayTime=vt(_6);mt.prototype.visitIntervalYearMonth=vt(v6);mt.prototype.visitDuration=vt(EL);mt.prototype.visitDurationSecond=vt(S6);mt.prototype.visitDurationMillisecond=vt(I6);mt.prototype.visitDurationMicrosecond=vt(M6);mt.prototype.visitDurationNanosecond=vt(A6);mt.prototype.visitFixedSizeList=vt(DL);mt.prototype.visitMap=vt(SL);var Ue=new mt;var $r=Symbol.for("keys"),Nl=Symbol.for("vals"),Pi=class{constructor(t){return this[$r]=new zt([t.children[0]]).memoize(),this[Nl]=t.children[1],new Proxy(this,new Jw)}[Symbol.iterator](){return new Qw(this[$r],this[Nl])}get size(){return this[$r].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[$r],n=this[Nl],r={};for(let i=-1,o=t.length;++i<o;)r[t.get(i)]=Ue.visit(n,i);return r}toString(){return`{${[...this].map(([t,n])=>`${ci(t)}: ${ci(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Qw=class{constructor(t,n){this.keys=t,this.vals=n,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){let t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),Ue.visit(this.vals,t)]})}},Jw=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[$r].toArray().map(String)}has(t,n){return t[$r].includes(n)}getOwnPropertyDescriptor(t,n){if(t[$r].indexOf(n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];let r=t[$r].indexOf(n);if(r!==-1){let i=Ue.visit(Reflect.get(t,Nl),r);return Reflect.set(t,n,i),i}}set(t,n,r){let i=t[$r].indexOf(n);return i!==-1?(mn.visit(Reflect.get(t,Nl),i,r),Reflect.set(t,n,r)):Reflect.has(t,n)?Reflect.set(t,n,r):!1}};Object.defineProperties(Pi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[$r]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Nl]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function NL(e,t,n){let r=e.length,i=t>-1?t:r+t%r;return n?n(e,i):i}var T6;function Jf(e,t,n,r){let{length:i=0}=e,o=typeof t!="number"?0:t,s=typeof n!="number"?i:n;return o<0&&(o=(o%i+i)%i),s<0&&(s=(s%i+i)%i),s<o&&(T6=o,o=s,s=T6),s>i&&(s=i),r?r(e,o,s):[o,s]}var E6=e=>e!==e;function Ws(e){if(typeof e!=="object"||e===null)return E6(e)?E6:n=>n===e;if(e instanceof Date){let n=e.valueOf();return r=>r instanceof Date?r.valueOf()===n:!1}return ArrayBuffer.isView(e)?n=>n?Bw(e,n):!1:e instanceof Map?BL(e):Array.isArray(e)?OL(e):e instanceof zt?FL(e):CL(e,!0)}function OL(e){let t=[];for(let n=-1,r=e.length;++n<r;)t[n]=Ws(e[n]);return Sy(t)}function BL(e){let t=-1,n=[];for(let r of e.values())n[++t]=Ws(r);return Sy(n)}function FL(e){let t=[];for(let n=-1,r=e.length;++n<r;)t[n]=Ws(e.get(n));return Sy(t)}function CL(e,t=!1){let n=Object.keys(e);if(!t&&n.length===0)return()=>!1;let r=[];for(let i=-1,o=n.length;++i<o;)r[i]=Ws(e[n[i]]);return Sy(r,n)}function Sy(e,t){return n=>{if(!n||typeof n!="object")return!1;switch(n.constructor){case Array:return LL(e,n);case Map:return D6(e,n,n.keys());case Pi:case js:case Object:case void 0:return D6(e,n,t||Object.keys(n))}return n instanceof zt?kL(e,n):!1}}function LL(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r<n;)if(!e[r](t[r]))return!1;return!0}function kL(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r<n;)if(!e[r](t.get(r)))return!1;return!0}function D6(e,t,n){let r=n[Symbol.iterator](),i=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),s=0,a=e.length,c=o.next(),l=r.next(),u=i.next();for(;s<a&&!l.done&&!u.done&&!c.done&&!(l.value!==u.value||!e[s](c.value));++s,l=r.next(),u=i.next(),c=o.next());return s===a&&l.done&&u.done&&c.done?!0:(r.return&&r.return(),i.return&&i.return(),o.return&&o.return(),!1)}var e_={};zs(e_,{BitIterator:()=>Ja,getBit:()=>N6,getBool:()=>My,packBools:()=>ec,popcnt_array:()=>O6,popcnt_bit_range:()=>th,popcnt_uint32:()=>Iy,setBool:()=>RL,truncateBitmap:()=>tc});function My(e,t,n,r){return(n&1<<r)!==0}function N6(e,t,n,r){return(n&1<<r)>>r}function RL(e,t,n){return n?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function tc(e,t,n){let r=n.byteLength+7&-8;if(e>0||n.byteLength<r){let i=new Uint8Array(r);return i.set(e%8===0?n.subarray(e>>3):ec(new Ja(n,e,t,null,My)).subarray(0,r)),i}return n}function ec(e){let t=[],n=0,r=0,i=0;for(let s of e)s&&(i|=1<<r),++r===8&&(t[n++]=i,i=r=0);(n===0||r>0)&&(t[n++]=i);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}var Ja=class{constructor(t,n,r,i,o){this.bytes=t,this.length=r,this.context=i,this.get=o,this.bit=n%8,this.byteIndex=n>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}};function th(e,t,n){if(n-t<=0)return 0;if(n-t<8){let o=0;for(let s of new Ja(e,t,n-t,e,N6))o+=s;return o}let r=n>>3<<3,i=t+(t%8===0?0:8-t%8);return th(e,t,i)+th(e,r,n)+O6(e,i>>3,r-i>>3)}function O6(e,t,n){let r=0,i=Math.trunc(t),o=new DataView(e.buffer,e.byteOffset,e.byteLength),s=n===void 0?e.byteLength:i+n;for(;s-i>=4;)r+=Iy(o.getUint32(i)),i+=4;for(;s-i>=2;)r+=Iy(o.getUint16(i)),i+=2;for(;s-i>=1;)r+=Iy(o.getUint8(i)),i+=1;return r}function Iy(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var $L=-1,re=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:t}=this;return st.isSparseUnion(t)?this.children.some(n=>n.nullable):st.isDenseUnion(t)?this.children.some(n=>n.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:n,values:r,nullBitmap:i,typeIds:o}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),this.children.reduce((s,a)=>s+a.byteLength,t)}get nullCount(){if(st.isUnion(this.type))return this.children.reduce((r,i)=>r+i.nullCount,0);let t=this._nullCount,n;return t<=$L&&(n=this.nullBitmap)&&(this._nullCount=t=this.length-th(n,this.offset,this.offset+this.length)),t}constructor(t,n,r,i,o,s=[],a){this.type=t,this.children=s,this.dictionary=a,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;o instanceof e?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=xr(t),o&&((c=o[0])&&(this.valueOffsets=c),(c=o[1])&&(this.values=c),(c=o[2])&&(this.nullBitmap=c),(c=o[3])&&(this.typeIds=c)))}getValid(t){let{type:n}=this;if(st.isUnion(n)){let r=n,i=this.children[r.typeIdToChildIndex[this.typeIds[t]]],o=r.mode===me.Dense?this.valueOffsets[t]:t;return i.getValid(o)}if(this.nullable&&this.nullCount>0){let r=this.offset+t;return(this.nullBitmap[r>>3]&1<<r%8)!==0}return!0}setValid(t,n){let r,{type:i}=this;if(st.isUnion(i)){let o=i,s=this.children[o.typeIdToChildIndex[this.typeIds[t]]],a=o.mode===me.Dense?this.valueOffsets[t]:t;r=s.getValid(a),s.setValid(a,n)}else{let{nullBitmap:o}=this,{offset:s,length:a}=this,c=s+t,l=1<<c%8,u=c>>3;(!o||o.byteLength<=u)&&(o=new Uint8Array((s+a+63&-64)>>3).fill(255),this.nullCount>0&&o.set(tc(s,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:o,_nullCount:-1}));let f=o[u];r=(f&l)!==0,n?o[u]=f|l:o[u]=f&~l}return r!==!!n&&(this._nullCount=this.nullCount+(n?-1:1)),n}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,o=this,s=this.children){return new e(t,n,r,i,o,s,this.dictionary)}slice(t,n){let{stride:r,typeId:i,children:o}=this,s=+(this._nullCount===0)-1,a=i===16?r:1,c=this._sliceBuffers(t,n,r,i);return this.clone(this.type,this.offset+t,n,s,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*t,a*n))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===F.Null)return this.clone(this.type,0,t,0);let{length:n,nullCount:r}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,n>>3);i[n>>3]=(1<<n-(n&-8))-1,r>0&&i.set(tc(this.offset,n,this.nullBitmap),0);let o=this.buffers;return o[ai.VALIDITY]=i,this.clone(this.type,0,t,r+(t-n),o)}_sliceBuffers(t,n,r,i){let o,{buffers:s}=this;return(o=s[ai.TYPE])&&(s[ai.TYPE]=o.subarray(t,t+n)),(o=s[ai.OFFSET])&&(s[ai.OFFSET]=o.subarray(t,t+n+1))||(o=s[ai.DATA])&&(s[ai.DATA]=i===6?o:o.subarray(r*t,r*(t+n))),s}_sliceChildren(t,n,r){return t.map(i=>i.slice(n,r))}};re.prototype.children=Object.freeze([]);var n_=class e extends lt{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:n,["offset"]:r=0,["length"]:i=0}=t;return new re(n,r,i,i)}visitBool(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new re(n,r,s,a,[void 0,o,i])}visitInt(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new re(n,r,s,a,[void 0,o,i])}visitFloat(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new re(n,r,s,a,[void 0,o,i])}visitUtf8(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.data),o=Et(t.nullBitmap),s=Qa(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new re(n,r,a,c,[s,i,o])}visitBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.data),o=Et(t.nullBitmap),s=Qa(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new re(n,r,a,c,[s,i,o])}visitFixedSizeBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/xr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new re(n,r,s,a,[void 0,o,i])}visitDate(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/xr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new re(n,r,s,a,[void 0,o,i])}visitTimestamp(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/xr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new re(n,r,s,a,[void 0,o,i])}visitTime(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/xr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new re(n,r,s,a,[void 0,o,i])}visitDecimal(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/xr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new re(n,r,s,a,[void 0,o,i])}visitList(t){let{["type"]:n,["offset"]:r=0,["child"]:i}=t,o=Et(t.nullBitmap),s=Qa(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new re(n,r,a,c,[s,void 0,o],[i])}visitStruct(t){let{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,o=Et(t.nullBitmap),{length:s=i.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new re(n,r,s,a,[void 0,void 0,o],i)}visitUnion(t){let{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,o=kt(n.ArrayType,t.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=t;if(st.isSparseUnion(n))return new re(n,r,s,a,[void 0,void 0,void 0,o],i);let c=Qa(t.valueOffsets);return new re(n,r,s,a,[c,void 0,void 0,o],i)}visitDictionary(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.nullBitmap),o=kt(n.indices.ArrayType,t.data),{["dictionary"]:s=new zt([new e().visit({type:n.dictionary})])}=t,{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new re(n,r,a,c,[void 0,o,i],[],s)}visitInterval(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/xr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new re(n,r,s,a,[void 0,o,i])}visitDuration(t){let{["type"]:n,["offset"]:r=0}=t,i=Et(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new re(n,r,s,a,[void 0,o,i])}visitFixedSizeList(t){let{["type"]:n,["offset"]:r=0,["child"]:i=new e().visit({type:n.valueType})}=t,o=Et(t.nullBitmap),{["length"]:s=i.length/xr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new re(n,r,s,a,[void 0,void 0,o],[i])}visitMap(t){let{["type"]:n,["offset"]:r=0,["child"]:i=new e().visit({type:n.childType})}=t,o=Et(t.nullBitmap),s=Qa(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new re(n,r,a,c,[s,void 0,o],[i])}},PL=new n_;function Dt(e){return PL.visit(e)}var eh=class{constructor(t=0,n){this.numChunks=t,this.getChunkIterator=n,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}};function Ay(e){return e.reduce((t,n)=>t+n.nullCount,0)}function Ty(e){return e.reduce((t,n,r)=>(t[r+1]=t[r]+n.length,t),new Uint32Array(e.length+1))}function Ey(e,t,n,r){let i=[];for(let o=-1,s=e.length;++o<s;){let a=e[o],c=t[o],{length:l}=a;if(c>=r)break;if(n>=c+l)continue;if(c>=n&&c+l<=r){i.push(a);continue}let u=Math.max(0,n-c),f=Math.min(r-c,l);i.push(a.slice(u,f-u))}return i.length===0&&i.push(e[0].slice(0,0)),i}function r_(e,t,n,r){let i=0,o=0,s=t.length-1;do{if(i>=s-1)return n<t[s]?r(e,i,n-t[i]):null;o=i+Math.trunc((s-i)*.5),n<t[o]?s=o:i=o}while(i<s)}function nh(e,t){return e.getValid(t)}function Gs(e){function t(n,r,i){return e(n[r],i)}return function(n){let r=this.data;return r_(r,this._offsets,n,t)}}function Dy(e){let t;function n(r,i,o){return e(r[i],o,t)}return function(r,i){let o=this.data;t=i;let s=r_(o,this._offsets,r,n);return t=void 0,s}}function Ny(e){let t;function n(r,i,o){let s=o,a=0,c=0;for(let l=i-1,u=r.length;++l<u;){let f=r[l];if(~(a=e(f,t,s)))return c+a;s=0,c+=f.length}return-1}return function(r,i){t=r;let o=this.data,s=typeof i!="number"?n(o,0,0):r_(o,this._offsets,i,n);return t=void 0,s}}var yt=class extends lt{};function UL(e,t){return t===null&&e.length>0?0:-1}function zL(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new Ja(n,e.offset+(t||0),e.length,n,My)){if(!i)return r;++r}return-1}function Nt(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case F.Union:break;case F.Dictionary:break;default:return zL(e,n)}let r=Ue.getVisitFn(e),i=Ws(t);for(let o=(n||0)-1,s=e.length;++o<s;)if(i(r(e,o)))return o;return-1}function B6(e,t,n){let r=Ue.getVisitFn(e),i=Ws(t);for(let o=(n||0)-1,s=e.length;++o<s;)if(i(r(e,o)))return o;return-1}yt.prototype.visitNull=UL;yt.prototype.visitBool=Nt;yt.prototype.visitInt=Nt;yt.prototype.visitInt8=Nt;yt.prototype.visitInt16=Nt;yt.prototype.visitInt32=Nt;yt.prototype.visitInt64=Nt;yt.prototype.visitUint8=Nt;yt.prototype.visitUint16=Nt;yt.prototype.visitUint32=Nt;yt.prototype.visitUint64=Nt;yt.prototype.visitFloat=Nt;yt.prototype.visitFloat16=Nt;yt.prototype.visitFloat32=Nt;yt.prototype.visitFloat64=Nt;yt.prototype.visitUtf8=Nt;yt.prototype.visitBinary=Nt;yt.prototype.visitFixedSizeBinary=Nt;yt.prototype.visitDate=Nt;yt.prototype.visitDateDay=Nt;yt.prototype.visitDateMillisecond=Nt;yt.prototype.visitTimestamp=Nt;yt.prototype.visitTimestampSecond=Nt;yt.prototype.visitTimestampMillisecond=Nt;yt.prototype.visitTimestampMicrosecond=Nt;yt.prototype.visitTimestampNanosecond=Nt;yt.prototype.visitTime=Nt;yt.prototype.visitTimeSecond=Nt;yt.prototype.visitTimeMillisecond=Nt;yt.prototype.visitTimeMicrosecond=Nt;yt.prototype.visitTimeNanosecond=Nt;yt.prototype.visitDecimal=Nt;yt.prototype.visitList=Nt;yt.prototype.visitStruct=Nt;yt.prototype.visitUnion=Nt;yt.prototype.visitDenseUnion=B6;yt.prototype.visitSparseUnion=B6;yt.prototype.visitDictionary=Nt;yt.prototype.visitInterval=Nt;yt.prototype.visitIntervalDayTime=Nt;yt.prototype.visitIntervalYearMonth=Nt;yt.prototype.visitDuration=Nt;yt.prototype.visitDurationSecond=Nt;yt.prototype.visitDurationMillisecond=Nt;yt.prototype.visitDurationMicrosecond=Nt;yt.prototype.visitDurationNanosecond=Nt;yt.prototype.visitFixedSizeList=Nt;yt.prototype.visitMap=Nt;var nc=new yt;var gt=class extends lt{};function St(e){let{type:t}=e;if(e.nullCount===0&&e.stride===1&&(t.typeId===F.Timestamp||t instanceof Le&&t.bitWidth!==64||t instanceof ui&&t.bitWidth!==64||t instanceof or&&t.precision!==we.HALF))return new eh(e.data.length,r=>{let i=e.data[r];return i.values.subarray(0,i.length)[Symbol.iterator]()});let n=0;return new eh(e.data.length,r=>{let o=e.data[r].length,s=e.slice(n,n+o);return n+=o,new i_(s)})}var i_=class{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};gt.prototype.visitNull=St;gt.prototype.visitBool=St;gt.prototype.visitInt=St;gt.prototype.visitInt8=St;gt.prototype.visitInt16=St;gt.prototype.visitInt32=St;gt.prototype.visitInt64=St;gt.prototype.visitUint8=St;gt.prototype.visitUint16=St;gt.prototype.visitUint32=St;gt.prototype.visitUint64=St;gt.prototype.visitFloat=St;gt.prototype.visitFloat16=St;gt.prototype.visitFloat32=St;gt.prototype.visitFloat64=St;gt.prototype.visitUtf8=St;gt.prototype.visitBinary=St;gt.prototype.visitFixedSizeBinary=St;gt.prototype.visitDate=St;gt.prototype.visitDateDay=St;gt.prototype.visitDateMillisecond=St;gt.prototype.visitTimestamp=St;gt.prototype.visitTimestampSecond=St;gt.prototype.visitTimestampMillisecond=St;gt.prototype.visitTimestampMicrosecond=St;gt.prototype.visitTimestampNanosecond=St;gt.prototype.visitTime=St;gt.prototype.visitTimeSecond=St;gt.prototype.visitTimeMillisecond=St;gt.prototype.visitTimeMicrosecond=St;gt.prototype.visitTimeNanosecond=St;gt.prototype.visitDecimal=St;gt.prototype.visitList=St;gt.prototype.visitStruct=St;gt.prototype.visitUnion=St;gt.prototype.visitDenseUnion=St;gt.prototype.visitSparseUnion=St;gt.prototype.visitDictionary=St;gt.prototype.visitInterval=St;gt.prototype.visitIntervalDayTime=St;gt.prototype.visitIntervalYearMonth=St;gt.prototype.visitDuration=St;gt.prototype.visitDurationSecond=St;gt.prototype.visitDurationMillisecond=St;gt.prototype.visitDurationMicrosecond=St;gt.prototype.visitDurationNanosecond=St;gt.prototype.visitFixedSizeList=St;gt.prototype.visitMap=St;var Ol=new gt;var qL=(e,t)=>e+t,Ui=class extends lt{visitNull(t,n){return 0}visitInt(t,n){return t.type.bitWidth/8}visitFloat(t,n){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,n){return 1/8}visitDecimal(t,n){return t.type.bitWidth/8}visitDate(t,n){return(t.type.unit+1)*4}visitTime(t,n){return t.type.bitWidth/8}visitTimestamp(t,n){return t.type.unit===pt.SECOND?4:8}visitInterval(t,n){return(t.type.unit+1)*4}visitDuration(t,n){return 8}visitStruct(t,n){return t.children.reduce((r,i)=>r+wr.visit(i,n),0)}visitFixedSizeBinary(t,n){return t.type.byteWidth}visitMap(t,n){return 8+t.children.reduce((r,i)=>r+wr.visit(i,n),0)}visitDictionary(t,n){var r;return t.type.indices.bitWidth/8+(((r=t.dictionary)===null||r===void 0?void 0:r.getByteLength(t.values[n]))||0)}},VL=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),jL=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),YL=({valueOffsets:e,stride:t,children:n},r)=>{let i=n[0],{[r*t]:o}=e,{[r*t+1]:s}=e,a=wr.getVisitFn(i.type),c=i.slice(o,s-o),l=8;for(let u=-1,f=s-o;++u<f;)l+=a(c,u);return l},WL=({stride:e,children:t},n)=>{let r=t[0],i=r.slice(n*e,e),o=wr.getVisitFn(r.type),s=0;for(let a=-1,c=i.length;++a<c;)s+=o(i,a);return s},GL=(e,t)=>e.type.mode===me.Dense?F6(e,t):C6(e,t),F6=({type:e,children:t,typeIds:n,valueOffsets:r},i)=>{let o=e.typeIdToChildIndex[n[i]];return 8+wr.visit(t[o],r[i])},C6=({children:e},t)=>4+wr.visitMany(e,e.map(()=>t)).reduce(qL,0);Ui.prototype.visitUtf8=VL;Ui.prototype.visitBinary=jL;Ui.prototype.visitList=YL;Ui.prototype.visitFixedSizeList=WL;Ui.prototype.visitUnion=GL;Ui.prototype.visitDenseUnion=F6;Ui.prototype.visitSparseUnion=C6;var wr=new Ui;var L6,k6={},R6={},zt=class e{constructor(t){var n,r,i;let o=t[0]instanceof e?t.flatMap(a=>a.data):t;if(o.length===0||o.some(a=>!(a instanceof re)))throw new TypeError("Vector constructor expects an Array of Data instances.");let s=(n=o[0])===null||n===void 0?void 0:n.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:l,byteLength:u}=k6[s.typeId],f=o[0];this.isValid=h=>nh(f,h),this.get=h=>a(f,h),this.set=(h,d)=>c(f,h,d),this.indexOf=h=>l(f,h),this.getByteLength=h=>u(f,h),this._offsets=[0,f.length];break}default:Object.setPrototypeOf(this,R6[s.typeId]),this._offsets=Ty(o);break}this.data=o,this.type=s,this.stride=xr(s),this.numChildren=(i=(r=s.children)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,n)=>t+n.byteLength,0)}get nullCount(){return Ay(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${F[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,n){}indexOf(t,n){return-1}includes(t,n){return this.indexOf(t,n)>-1}getByteLength(t){return 0}[Symbol.iterator](){return Ol.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(n=>n.data).flat(Number.POSITIVE_INFINITY)))}slice(t,n){return new e(Jf(this,t,n,({data:r,_offsets:i},o,s)=>Ey(r,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:t,data:n,length:r,stride:i,ArrayType:o}=this;switch(t.typeId){case F.Int:case F.Float:case F.Decimal:case F.Time:case F.Timestamp:switch(n.length){case 0:return new o;case 1:return n[0].values.subarray(0,r*i);default:return n.reduce((s,{values:a,length:c})=>(s.array.set(a.subarray(0,c*i),s.offset),s.offset+=c*i,s),{array:new o(r*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var n;return this.getChildAt((n=this.type.children)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new e(this.data.map(({children:n})=>n[t])):null}get isMemoized(){return st.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(st.isDictionary(this.type)){let t=new Oy(this.data[0].dictionary),n=this.data.map(r=>{let i=r.clone();return i.dictionary=t,i});return new e(n)}return new Oy(this)}unmemoize(){if(st.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(r=>{let i=r.clone();return i.dictionary=t,i});return new e(n)}return this}};L6=Symbol.toStringTag;zt[L6]=(e=>{e.type=st.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(F).map(n=>F[n]).filter(n=>typeof n=="number"&&n!==F.NONE);for(let n of t){let r=Ue.getVisitFnByTypeId(n),i=mn.getVisitFnByTypeId(n),o=nc.getVisitFnByTypeId(n),s=wr.getVisitFnByTypeId(n);k6[n]={get:r,set:i,indexOf:o,byteLength:s},R6[n]=Object.create(e,{isValid:{value:Gs(nh)},get:{value:Gs(Ue.getVisitFnByTypeId(n))},set:{value:Dy(mn.getVisitFnByTypeId(n))},indexOf:{value:Ny(nc.getVisitFnByTypeId(n))},getByteLength:{value:Gs(wr.getVisitFnByTypeId(n))}})}return"Vector"})(zt.prototype);var Oy=class e extends zt{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(s){let a=o[s];if(a!==void 0)return a;let c=n.call(this,s);return o[s]=c,c}}),Object.defineProperty(this,"set",{value(s,a){r.call(this,s,a),o[s]=a}}),Object.defineProperty(this,"slice",{value:(s,a)=>new e(i.call(this,s,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new zt(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function $6(e){if(!e||e.length<=0)return function(i){return!0};let t="",n=e.filter(r=>r===r);return n.length>0&&(t=`
|
|
1
|
+
var lF=Object.create;var Ew=Object.defineProperty;var uF=Object.getOwnPropertyDescriptor;var fF=Object.getOwnPropertyNames;var hF=Object.getPrototypeOf,dF=Object.prototype.hasOwnProperty;var S3=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Vs=(e,t)=>{for(var n in t)Ew(e,n,{get:t[n],enumerable:!0})},pF=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fF(t))!dF.call(e,i)&&i!==n&&Ew(e,i,{get:()=>t[i],enumerable:!(r=uF(t,i))||r.enumerable});return e};var mF=(e,t,n)=>(n=e!=null?lF(hF(e)):{},pF(t||!e||!e.__esModule?Ew(n,"default",{value:e,enumerable:!0}):n,e));var tL=S3((lOt,JO)=>{"use strict";function EW(e,t,n,r,i){for(var o=i+1;r<=i;){var s=r+i>>>1,a=e[s],c=n!==void 0?n(a,t):a-t;c>=0?(o=s,i=s-1):r=s+1}return o}function DW(e,t,n,r,i){for(var o=i+1;r<=i;){var s=r+i>>>1,a=e[s],c=n!==void 0?n(a,t):a-t;c>0?(o=s,i=s-1):r=s+1}return o}function NW(e,t,n,r,i){for(var o=r-1;r<=i;){var s=r+i>>>1,a=e[s],c=n!==void 0?n(a,t):a-t;c<0?(o=s,r=s+1):i=s-1}return o}function BW(e,t,n,r,i){for(var o=r-1;r<=i;){var s=r+i>>>1,a=e[s],c=n!==void 0?n(a,t):a-t;c<=0?(o=s,r=s+1):i=s-1}return o}function OW(e,t,n,r,i){for(;r<=i;){var o=r+i>>>1,s=e[o],a=n!==void 0?n(s,t):s-t;if(a===0)return o;a<=0?r=o+1:i=o-1}return-1}function Nm(e,t,n,r,i,o){return typeof n=="function"?o(e,t,n,r===void 0?0:r|0,i===void 0?e.length-1:i|0):o(e,t,void 0,n===void 0?0:n|0,r===void 0?e.length-1:r|0)}JO.exports={ge:function(e,t,n,r,i){return Nm(e,t,n,r,i,EW)},gt:function(e,t,n,r,i){return Nm(e,t,n,r,i,DW)},lt:function(e,t,n,r,i){return Nm(e,t,n,r,i,NW)},le:function(e,t,n,r,i){return Nm(e,t,n,r,i,BW)},eq:function(e,t,n,r,i){return Nm(e,t,n,r,i,OW)}}});var cL=S3((uOt,aL)=>{"use strict";var mw=tL(),Ff=0,gl=1,pw=2;aL.exports=FW;function UI(e,t,n,r,i){this.mid=e,this.left=t,this.right=n,this.leftPoints=r,this.rightPoints=i,this.count=(t?t.count:0)+(n?n.count:0)+r.length}var Bm=UI.prototype;function RI(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function rL(e,t){var n=Cf(t);e.mid=n.mid,e.left=n.left,e.right=n.right,e.leftPoints=n.leftPoints,e.rightPoints=n.rightPoints,e.count=n.count}function eL(e,t){var n=e.intervals([]);n.push(t),rL(e,n)}function nL(e,t){var n=e.intervals([]),r=n.indexOf(t);return r<0?Ff:(n.splice(r,1),rL(e,n),gl)}Bm.intervals=function(e){return e.push.apply(e,this.leftPoints),this.left&&this.left.intervals(e),this.right&&this.right.intervals(e),e};Bm.insert=function(e){var t=this.count-this.leftPoints.length;if(this.count+=1,e[1]<this.mid)this.left?4*(this.left.count+1)>3*(t+1)?eL(this,e):this.left.insert(e):this.left=Cf([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?eL(this,e):this.right.insert(e):this.right=Cf([e]);else{var n=mw.ge(this.leftPoints,e,PI),r=mw.ge(this.rightPoints,e,zI);this.leftPoints.splice(n,0,e),this.rightPoints.splice(r,0,e)}};Bm.remove=function(e){var t=this.count-this.leftPoints;if(e[1]<this.mid){if(!this.left)return Ff;var n=this.right?this.right.count:0;if(4*n>3*(t-1))return nL(this,e);var r=this.left.remove(e);return r===pw?(this.left=null,this.count-=1,gl):(r===gl&&(this.count-=1),r)}else if(e[0]>this.mid){if(!this.right)return Ff;var i=this.left?this.left.count:0;if(4*i>3*(t-1))return nL(this,e);var r=this.right.remove(e);return r===pw?(this.right=null,this.count-=1,gl):(r===gl&&(this.count-=1),r)}else{if(this.count===1)return this.leftPoints[0]===e?pw:Ff;if(this.leftPoints.length===1&&this.leftPoints[0]===e){if(this.left&&this.right){for(var o=this,s=this.left;s.right;)o=s,s=s.right;if(o===this)s.right=this.right;else{var a=this.left,r=this.right;o.count-=s.count,o.right=s.left,s.left=a,s.right=r}RI(this,s),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?RI(this,this.left):RI(this,this.right);return gl}for(var a=mw.ge(this.leftPoints,e,PI);a<this.leftPoints.length&&this.leftPoints[a][0]===e[0];++a)if(this.leftPoints[a]===e){this.count-=1,this.leftPoints.splice(a,1);for(var r=mw.ge(this.rightPoints,e,zI);r<this.rightPoints.length&&this.rightPoints[r][1]===e[1];++r)if(this.rightPoints[r]===e)return this.rightPoints.splice(r,1),gl}return Ff}};function iL(e,t,n){for(var r=0;r<e.length&&e[r][0]<=t;++r){var i=n(e[r]);if(i)return i}}function oL(e,t,n){for(var r=e.length-1;r>=0&&e[r][1]>=t;--r){var i=n(e[r]);if(i)return i}}function sL(e,t){for(var n=0;n<e.length;++n){var r=t(e[n]);if(r)return r}}Bm.queryPoint=function(e,t){if(e<this.mid){if(this.left){var n=this.left.queryPoint(e,t);if(n)return n}return iL(this.leftPoints,e,t)}else if(e>this.mid){if(this.right){var n=this.right.queryPoint(e,t);if(n)return n}return oL(this.rightPoints,e,t)}else return sL(this.leftPoints,t)};Bm.queryInterval=function(e,t,n){if(e<this.mid&&this.left){var r=this.left.queryInterval(e,t,n);if(r)return r}if(t>this.mid&&this.right){var r=this.right.queryInterval(e,t,n);if(r)return r}return t<this.mid?iL(this.leftPoints,t,n):e>this.mid?oL(this.rightPoints,e,n):sL(this.leftPoints,n)};function LW(e,t){return e-t}function PI(e,t){var n=e[0]-t[0];return n||e[1]-t[1]}function zI(e,t){var n=e[1]-t[1];return n||e[0]-t[0]}function Cf(e){if(e.length===0)return null;for(var t=[],n=0;n<e.length;++n)t.push(e[n][0],e[n][1]);t.sort(LW);for(var r=t[t.length>>1],i=[],o=[],s=[],n=0;n<e.length;++n){var a=e[n];a[1]<r?i.push(a):r<a[0]?o.push(a):s.push(a)}var c=s,l=s.slice();return c.sort(PI),l.sort(zI),new UI(r,Cf(i),Cf(o),c,l)}function $I(e){this.root=e}var kf=$I.prototype;kf.insert=function(e){this.root?this.root.insert(e):this.root=new UI(e[0],null,null,[e],[e])};kf.remove=function(e){if(this.root){var t=this.root.remove(e);return t===pw&&(this.root=null),t!==Ff}return!1};kf.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)};kf.queryInterval=function(e,t,n){if(e<=t&&this.root)return this.root.queryInterval(e,t,n)};Object.defineProperty(kf,"count",{get:function(){return this.root?this.root.count:0}});Object.defineProperty(kf,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function FW(e){return!e||e.length===0?new $I(null):new $I(Cf(e))}});var js=Symbol("Fixed"),yn=Symbol("Transient"),qf=Symbol("Transform");var M3={};function Vf(e,t=!1){let n,r,i=M3;function o(l){n=e(l).then(()=>{if(r){let{value:u}=r;r=null,o(u)}else n=null})}function s(l){r={event:l}}function a(l){n?s(l):o(l)}function c(l){i!==l&&requestAnimationFrame(()=>{let u=i;i=M3,a(u)}),i=l}return t?c:a}var jf=class{constructor(t){this._filterBy=t,this._requestUpdate=Vf(()=>this.requestQuery(),!0),this._coordinator=null}get coordinator(){return this._coordinator}set coordinator(t){this._coordinator=t}get filterBy(){return this._filterBy}get filterIndexable(){return!0}fields(){return null}fieldInfo(){return this}query(){return null}queryPending(){return this}queryResult(){return this}queryError(t){return console.error(t),this}requestQuery(t){let n=t||this.query(this.filterBy?.predicate(this));return this._coordinator.requestQuery(this,n)}requestUpdate(){this._requestUpdate()}update(){return this}};function A3(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function H(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(f){s(f)}}function c(u){try{l(r.throw(u))}catch(f){s(f)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})}function I3(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Lt(e){return this instanceof Lt?(this.v=e,this):new Lt(e)}function gr(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){r[h]&&(i[h]=function(d){return new Promise(function(p,m){o.push([h,d,p,m])>1||a(h,d)})})}function a(h,d){try{c(r[h](d))}catch(p){f(o[0][3],p)}}function c(h){h.value instanceof Lt?Promise.resolve(h.value.v).then(l,u):f(o[0][2],h)}function l(h){a("next",h)}function u(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function wl(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,o){t[i]=e[i]?function(s){return(n=!n)?{value:Lt(e[i](s)),done:!1}:o?o(s):s}:o}}function ii(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof I3=="function"?I3(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),i(a,c,s.done,s.value)})}}function i(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}var Fw={};Vs(Fw,{compareArrayLike:()=>Lw,joinUint8Arrays:()=>xr,memcpy:()=>Gf,rebaseValueOffsets:()=>Xm,toArrayBufferView:()=>kt,toArrayBufferViewAsyncIterator:()=>si,toArrayBufferViewIterator:()=>$i,toBigInt64Array:()=>Gm,toBigUint64Array:()=>MF,toFloat32Array:()=>IF,toFloat32ArrayAsyncIterator:()=>zF,toFloat32ArrayIterator:()=>LF,toFloat64Array:()=>AF,toFloat64ArrayAsyncIterator:()=>qF,toFloat64ArrayIterator:()=>FF,toInt16Array:()=>_F,toInt16ArrayAsyncIterator:()=>RF,toInt16ArrayIterator:()=>DF,toInt32Array:()=>Za,toInt32ArrayAsyncIterator:()=>$F,toInt32ArrayIterator:()=>NF,toInt8Array:()=>wF,toInt8ArrayAsyncIterator:()=>kF,toInt8ArrayIterator:()=>EF,toUint16Array:()=>vF,toUint16ArrayAsyncIterator:()=>UF,toUint16ArrayIterator:()=>BF,toUint32Array:()=>SF,toUint32ArrayAsyncIterator:()=>PF,toUint32ArrayIterator:()=>OF,toUint8Array:()=>wt,toUint8ArrayAsyncIterator:()=>Ow,toUint8ArrayIterator:()=>Bw,toUint8ClampedArray:()=>TF,toUint8ClampedArrayAsyncIterator:()=>VF,toUint8ClampedArrayIterator:()=>CF});var yF=new TextDecoder("utf-8"),Yf=e=>yF.decode(e),gF=new TextEncoder,Ri=e=>gF.encode(e);var bF=e=>typeof e=="number",T3=e=>typeof e=="boolean",Je=e=>typeof e=="function",zn=e=>e!=null&&Object(e)===e,br=e=>zn(e)&&Je(e.then);var oi=e=>zn(e)&&Je(e[Symbol.iterator]),$r=e=>zn(e)&&Je(e[Symbol.asyncIterator]),zm=e=>zn(e)&&zn(e.schema);var qm=e=>zn(e)&&"done"in e&&"value"in e;var Vm=e=>zn(e)&&Je(e.stat)&&bF(e.fd);var jm=e=>zn(e)&&Wf(e.body),Ym=e=>"_getDOMStream"in e&&"_getNodeStream"in e,E3=e=>zn(e)&&Je(e.abort)&&Je(e.getWriter)&&!Ym(e),Wf=e=>zn(e)&&Je(e.cancel)&&Je(e.getReader)&&!Ym(e),D3=e=>zn(e)&&Je(e.end)&&Je(e.write)&&T3(e.writable)&&!Ym(e),Wm=e=>zn(e)&&Je(e.read)&&Je(e.pipe)&&T3(e.readable)&&!Ym(e),N3=e=>zn(e)&&Je(e.clear)&&Je(e.bytes)&&Je(e.position)&&Je(e.setPosition)&&Je(e.capacity)&&Je(e.getBufferIdentifier)&&Je(e.createLong);var Nw=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function xF(e){let t=e[0]?[e[0]]:[],n,r,i,o;for(let s,a,c=0,l=0,u=e.length;++c<u;){if(s=t[l],a=e[c],!s||!a||s.buffer!==a.buffer||a.byteOffset<s.byteOffset){a&&(t[++l]=a);continue}if({byteOffset:n,byteLength:i}=s,{byteOffset:r,byteLength:o}=a,n+i<r||r+o<n){a&&(t[++l]=a);continue}t[l]=new Uint8Array(s.buffer,n,r-n+o)}return t}function Gf(e,t,n=0,r=t.byteLength){let i=e.byteLength,o=new Uint8Array(e.buffer,e.byteOffset,i),s=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,i));return o.set(s,n),e}function xr(e,t){let n=xF(e),r=n.reduce((u,f)=>u+f.byteLength,0),i,o,s,a=0,c=-1,l=Math.min(t||Number.POSITIVE_INFINITY,r);for(let u=n.length;++c<u;){if(i=n[c],o=i.subarray(0,Math.min(i.length,l-a)),l<=a+o.length){o.length<i.length?n[c]=i.subarray(o.length):o.length===i.length&&c++,s?Gf(s,o,a):s=o;break}Gf(s||(s=new Uint8Array(l)),o,a),a+=o.length}return[s||new Uint8Array(0),n.slice(c),r-(s?s.byteLength:0)]}function kt(e,t){let n=qm(t)?t.value:t;return n instanceof e?e===Uint8Array?new e(n.buffer,n.byteOffset,n.byteLength):n:n?(typeof n=="string"&&(n=Ri(n)),n instanceof ArrayBuffer?new e(n):n instanceof Nw?new e(n):N3(n)?kt(e,n.bytes()):ArrayBuffer.isView(n)?n.byteLength<=0?new e(0):new e(n.buffer,n.byteOffset,n.byteLength/e.BYTES_PER_ELEMENT):e.from(n)):new e(0)}var wF=e=>kt(Int8Array,e),_F=e=>kt(Int16Array,e),Za=e=>kt(Int32Array,e),Gm=e=>kt(BigInt64Array,e),wt=e=>kt(Uint8Array,e),vF=e=>kt(Uint16Array,e),SF=e=>kt(Uint32Array,e),MF=e=>kt(BigUint64Array,e),IF=e=>kt(Float32Array,e),AF=e=>kt(Float64Array,e),TF=e=>kt(Uint8ClampedArray,e),Dw=e=>(e.next(),e);function*$i(e,t){let n=function*(i){yield i},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Nw?n(t):oi(t)?t:n(t);return yield*Dw(function*(i){let o=null;do o=i.next(yield kt(e,o));while(!o.done)}(r[Symbol.iterator]())),new e}var EF=e=>$i(Int8Array,e),DF=e=>$i(Int16Array,e),NF=e=>$i(Int32Array,e),Bw=e=>$i(Uint8Array,e),BF=e=>$i(Uint16Array,e),OF=e=>$i(Uint32Array,e),LF=e=>$i(Float32Array,e),FF=e=>$i(Float64Array,e),CF=e=>$i(Uint8ClampedArray,e);function si(e,t){return gr(this,arguments,function*(){if(br(t))return yield Lt(yield Lt(yield*wl(ii(si(e,yield Lt(t))))));let r=function(s){return gr(this,arguments,function*(){yield yield Lt(yield Lt(s))})},i=function(s){return gr(this,arguments,function*(){yield Lt(yield*wl(ii(Dw(function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)}(s[Symbol.iterator]())))))})},o=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Nw?r(t):oi(t)?i(t):$r(t)?t:r(t);return yield Lt(yield*wl(ii(Dw(function(s){return gr(this,arguments,function*(){let a=null;do a=yield Lt(s.next(yield yield Lt(kt(e,a))));while(!a.done)})}(o[Symbol.asyncIterator]()))))),yield Lt(new e)})}var kF=e=>si(Int8Array,e),RF=e=>si(Int16Array,e),$F=e=>si(Int32Array,e),Ow=e=>si(Uint8Array,e),UF=e=>si(Uint16Array,e),PF=e=>si(Uint32Array,e),zF=e=>si(Float32Array,e),qF=e=>si(Float64Array,e),VF=e=>si(Uint8ClampedArray,e);function Xm(e,t,n){if(e!==0){n=n.slice(0,t);for(let r=-1,i=n.length;++r<i;)n[r]+=e}return n.subarray(0,t)}function Lw(e,t){let n=0,r=e.length;if(r!==t.length)return!1;if(r>0)do if(e[n]!==t[n])return!1;while(++n<r);return!0}var gn={fromIterable(e){return Hm(jF(e))},fromAsyncIterable(e){return Hm(YF(e))},fromDOMStream(e){return Hm(WF(e))},fromNodeStream(e){return Hm(GF(e))},toDOMStream(e,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(e,t){throw new Error('"toNodeStream" not available in this environment')}},Hm=e=>(e.next(),e);function*jF(e){let t,n=!1,r=[],i,o,s,a=0;function c(){return o==="peek"?xr(r,s)[0]:([i,r,a]=xr(r,s),i)}({cmd:o,size:s}=(yield null)||{cmd:"read",size:0});let l=Bw(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(s-a)?l.next():l.next(s-a),!t&&i.byteLength>0&&(r.push(i),a+=i.byteLength),t||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!t)}catch(u){(n=!0)&&typeof l.throw=="function"&&l.throw(u)}finally{n===!1&&typeof l.return=="function"&&l.return(null)}return null}function YF(e){return gr(this,arguments,function*(){let n,r=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?xr(i,a)[0]:([o,i,c]=xr(i,a),o)}({cmd:s,size:a}=(yield yield Lt(null))||{cmd:"read",size:0});let u=Ow(e)[Symbol.asyncIterator]();try{do if({done:n,value:o}=Number.isNaN(a-c)?yield Lt(u.next()):yield Lt(u.next(a-c)),!n&&o.byteLength>0&&(i.push(o),c+=o.byteLength),n||a<=c)do({cmd:s,size:a}=yield yield Lt(l()));while(a<c);while(!n)}catch(f){(r=!0)&&typeof u.throw=="function"&&(yield Lt(u.throw(f)))}finally{r===!1&&typeof u.return=="function"&&(yield Lt(u.return(new Uint8Array(0))))}return yield Lt(null)})}function WF(e){return gr(this,arguments,function*(){let n=!1,r=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?xr(i,a)[0]:([o,i,c]=xr(i,a),o)}({cmd:s,size:a}=(yield yield Lt(null))||{cmd:"read",size:0});let u=new kw(e);try{do if({done:n,value:o}=Number.isNaN(a-c)?yield Lt(u.read()):yield Lt(u.read(a-c)),!n&&o.byteLength>0&&(i.push(wt(o)),c+=o.byteLength),n||a<=c)do({cmd:s,size:a}=yield yield Lt(l()));while(a<c);while(!n)}catch(f){(r=!0)&&(yield Lt(u.cancel(f)))}finally{r===!1?yield Lt(u.cancel()):e.locked&&u.releaseLock()}return yield Lt(null)})}var kw=class{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return H(this,void 0,void 0,function*(){let{reader:n,source:r}=this;n&&(yield n.cancel(t).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(t){return H(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let n=yield this.reader.read();return!n.done&&(n.value=wt(n)),n})}},Cw=(e,t)=>{let n=i=>r([t,i]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function GF(e){return gr(this,arguments,function*(){let n=[],r="error",i=!1,o=null,s,a,c=0,l=[],u;function f(){return s==="peek"?xr(l,a)[0]:([u,l,c]=xr(l,a),u)}if({cmd:s,size:a}=(yield yield Lt(null))||{cmd:"read",size:0},e.isTTY)return yield yield Lt(new Uint8Array(0)),yield Lt(null);try{n[0]=Cw(e,"end"),n[1]=Cw(e,"error");do{if(n[2]=Cw(e,"readable"),[r,o]=yield Lt(Promise.race(n.map(d=>d[2]))),r==="error")break;if((i=r==="end")||(Number.isFinite(a-c)?(u=wt(e.read(a-c)),u.byteLength<a-c&&(u=wt(e.read()))):u=wt(e.read()),u.byteLength>0&&(l.push(u),c+=u.byteLength)),i||a<=c)do({cmd:s,size:a}=yield yield Lt(f()));while(a<c)}while(!i)}finally{yield Lt(h(n,r==="error"?o:null))}return yield Lt(null);function h(d,p){return u=l=null,new Promise((m,g)=>{for(let[y,b]of d)e.off(y,b);try{let y=e.destroy;y&&y.call(e,p),p=void 0}catch(y){p=y||p}finally{p!=null?g(p):m()}})}})}var oe;(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(oe||(oe={}));var pe;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(pe||(pe={}));var ue;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(ue||(ue={}));var ze;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(ze||(ze={}));var at;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(at||(at={}));var rn;(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(rn||(rn={}));var Ui=new Int32Array(2),Zm=new Float32Array(Ui.buffer),Km=new Float64Array(Ui.buffer),_l=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Xf;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(Xf||(Xf={}));var wr=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return Ui[0]=this.readInt32(t),Zm[0]}readFloat64(t){return Ui[_l?0:1]=this.readInt32(t),Ui[_l?1:0]=this.readInt32(t+4),Km[0]}writeInt8(t,n){this.bytes_[t]=n}writeUint8(t,n){this.bytes_[t]=n}writeInt16(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8}writeUint16(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8}writeInt32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeUint32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeInt64(t,n){this.writeInt32(t,Number(BigInt.asIntN(32,n))),this.writeInt32(t+4,Number(BigInt.asIntN(32,n>>BigInt(32))))}writeUint64(t,n){this.writeUint32(t,Number(BigInt.asUintN(32,n))),this.writeUint32(t+4,Number(BigInt.asUintN(32,n>>BigInt(32))))}writeFloat32(t,n){Zm[0]=n,this.writeInt32(t,Ui[0])}writeFloat64(t,n){Km[0]=n,this.writeInt32(t,Ui[_l?0:1]),this.writeInt32(t+4,Ui[_l?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let n=0;n<4;n++)t+=String.fromCharCode(this.readInt8(this.position_+4+n));return t}__offset(t,n){let r=t-this.readInt32(t);return n<this.readInt16(r)?this.readInt16(r+n):0}__union(t,n){return t.bb_pos=n+this.readInt32(n),t.bb=this,t}__string(t,n){t+=this.readInt32(t);let r=this.readInt32(t);t+=4;let i=this.bytes_.subarray(t,t+r);return n===Xf.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(t,n){return typeof t=="string"?this.__string(n):this.__union(t,n)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let n=0;n<4;n++)if(t.charCodeAt(n)!=this.readInt8(this.position()+4+n))return!1;return!0}createScalarList(t,n){let r=[];for(let i=0;i<n;++i){let o=t(i);o!==null&&r.push(o)}return r}createObjList(t,n){let r=[];for(let i=0;i<n;++i){let o=t(i);o!==null&&r.push(o.unpack())}return r}};var Ka=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let n;t?n=t:n=1024,this.bb=wr.allocate(n),this.space=n}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,n){t>this.minalign&&(this.minalign=t);let r=~(this.bb.capacity()-this.space+n)+1&t-1;for(;this.space<r+t+n;){let i=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(r)}pad(t){for(let n=0;n<t;n++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,n,r){(this.force_defaults||n!=r)&&(this.addInt8(n),this.slot(t))}addFieldInt16(t,n,r){(this.force_defaults||n!=r)&&(this.addInt16(n),this.slot(t))}addFieldInt32(t,n,r){(this.force_defaults||n!=r)&&(this.addInt32(n),this.slot(t))}addFieldInt64(t,n,r){(this.force_defaults||n!==r)&&(this.addInt64(n),this.slot(t))}addFieldFloat32(t,n,r){(this.force_defaults||n!=r)&&(this.addFloat32(n),this.slot(t))}addFieldFloat64(t,n,r){(this.force_defaults||n!=r)&&(this.addFloat64(n),this.slot(t))}addFieldOffset(t,n,r){(this.force_defaults||n!=r)&&(this.addOffset(n),this.slot(t))}addFieldStruct(t,n,r){n!=r&&(this.nested(n),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let n=t.capacity();if(n&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let r=n<<1,i=wr.allocate(r);return i.setPosition(r-n),i.bytes().set(t.bytes(),r-n),i}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let n=0;n<t;n++)this.vtable[n]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let t=this.offset(),n=this.vtable_in_use-1;for(;n>=0&&this.vtable[n]==0;n--);let r=n+1;for(;n>=0;n--)this.addInt16(this.vtable[n]!=0?t-this.vtable[n]:0);let i=2;this.addInt16(t-this.object_start);let o=(r+i)*2;this.addInt16(o);let s=0,a=this.space;t:for(n=0;n<this.vtables.length;n++){let c=this.bb.capacity()-this.vtables[n];if(o==this.bb.readInt16(c)){for(let l=2;l<o;l+=2)if(this.bb.readInt16(a+l)!=this.bb.readInt16(c+l))continue t;s=this.vtables[n];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,n,r){let i=r?4:0;if(n){let o=n;if(this.prep(this.minalign,8+i),o.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let s=3;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,4+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,n){this.finish(t,n,!0)}requiredField(t,n){let r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(!(n<this.bb.readInt16(i)&&this.bb.readInt16(i+n)!=0))throw new TypeError("FlatBuffers: field "+n+" must be set")}startVector(t,n,r){this.notNested(),this.vector_num_elems=n,this.prep(4,t*n),this.prep(r,t*n)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let n=this.createString(t);return this.string_maps.set(t,n),n}createString(t){if(t==null)return 0;let n;t instanceof Uint8Array?n=t:n=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,n.length,1),this.bb.setPosition(this.space-=n.length);for(let r=0,i=this.space,o=this.bb.bytes();r<n.length;r++)o[i++]=n[r];return this.endVector()}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let n=[];for(let r=0;r<t.length;++r){let i=t[r];if(i!==null)n.push(this.createObjectOffset(i));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return n}createStructOffsetList(t,n){return n(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var Hf;(function(e){e[e.BUFFER=0]="BUFFER"})(Hf||(Hf={}));var Zf;(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(Zf||(Zf={}));var Jm=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBodyCompression(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):Zf.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Hf.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,n){t.addFieldInt8(0,n,Zf.LZ4_FRAME)}static addMethod(t,n){t.addFieldInt8(1,n,Hf.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,n,r){return e.startBodyCompression(t),e.addCodec(t,n),e.addMethod(t,r),e.endBodyCompression(t)}};var vl=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,n,r){return t.prep(8,16),t.writeInt64(BigInt(r??0)),t.writeInt64(BigInt(n??0)),t.offset()}};var Sl=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,n,r){return t.prep(8,16),t.writeInt64(BigInt(r??0)),t.writeInt64(BigInt(n??0)),t.offset()}};var _r=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsRecordBatch(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new Sl).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new vl).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new Jm).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,n){t.addFieldInt64(0,n,BigInt("0"))}static addNodes(t,n){t.addFieldOffset(1,n,0)}static startNodesVector(t,n){t.startVector(16,n,8)}static addBuffers(t,n){t.addFieldOffset(2,n,0)}static startBuffersVector(t,n){t.startVector(16,n,8)}static addCompression(t,n){t.addFieldOffset(3,n,0)}static endRecordBatch(t){return t.endObject()}};var Bo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDictionaryBatch(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new _r).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,n){t.addFieldInt64(0,n,BigInt("0"))}static addData(t,n){t.addFieldOffset(1,n,0)}static addIsDelta(t,n){t.addFieldInt8(2,+n,0)}static endDictionaryBatch(t){return t.endObject()}};var Ys;(function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"})(Ys||(Ys={}));var Kf;(function(e){e[e.DenseArray=0]="DenseArray"})(Kf||(Kf={}));var ci=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsInt(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,n){t.addFieldInt32(0,n,0)}static addIsSigned(t,n){t.addFieldInt8(1,+n,0)}static endInt(t){return t.endObject()}static createInt(t,n,r){return e.startInt(t),e.addBitWidth(t,n),e.addIsSigned(t,r),e.endInt(t)}};var Pi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDictionaryEncoding(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}indexType(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new ci).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):Kf.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,n){t.addFieldInt64(0,n,BigInt("0"))}static addIndexType(t,n){t.addFieldOffset(1,n,0)}static addIsOrdered(t,n){t.addFieldInt8(2,+n,0)}static addDictionaryKind(t,n){t.addFieldInt16(3,n,Kf.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var tn=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsKeyValue(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}key(t){let n=this.bb.__offset(this.bb_pos,4);return n?this.bb.__string(this.bb_pos+n,t):null}value(t){let n=this.bb.__offset(this.bb_pos,6);return n?this.bb.__string(this.bb_pos+n,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,n){t.addFieldOffset(0,n,0)}static addValue(t,n){t.addFieldOffset(1,n,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,n,r){return e.startKeyValue(t),e.addKey(t,n),e.addValue(t,r),e.endKeyValue(t)}};var Qf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBinary(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return e.startBinary(t),e.endBinary(t)}};var Jf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBool(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return e.startBool(t),e.endBool(t)}};var Ws=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDate(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ze.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,ze.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,n){return e.startDate(t),e.addUnit(t,n),e.endDate(t)}};var zi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDecimal(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,n){t.addFieldInt32(0,n,0)}static addScale(t,n){t.addFieldInt32(1,n,0)}static addBitWidth(t,n){t.addFieldInt32(2,n,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,n,r,i){return e.startDecimal(t),e.addPrecision(t,n),e.addScale(t,r),e.addBitWidth(t,i),e.endDecimal(t)}};var Gs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDuration(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):at.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,at.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,n){return e.startDuration(t),e.addUnit(t,n),e.endDuration(t)}};var Xs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFixedSizeBinary(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,n){t.addFieldInt32(0,n,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,n){return e.startFixedSizeBinary(t),e.addByteWidth(t,n),e.endFixedSizeBinary(t)}};var Hs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFixedSizeList(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,n){t.addFieldInt32(0,n,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,n){return e.startFixedSizeList(t),e.addListSize(t,n),e.endFixedSizeList(t)}};var Zs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFloatingPoint(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ue.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,n){t.addFieldInt16(0,n,ue.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,n){return e.startFloatingPoint(t),e.addPrecision(t,n),e.endFloatingPoint(t)}};var Ks=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsInterval(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):rn.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,rn.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,n){return e.startInterval(t),e.addUnit(t,n),e.endInterval(t)}};var th=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsLargeBinary(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return e.startLargeBinary(t),e.endLargeBinary(t)}};var eh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsLargeUtf8(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return e.startLargeUtf8(t),e.endLargeUtf8(t)}};var nh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsList(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return e.startList(t),e.endList(t)}};var Qs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsMap(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,n){t.addFieldInt8(0,+n,0)}static endMap(t){return t.endObject()}static createMap(t,n){return e.startMap(t),e.addKeysSorted(t,n),e.endMap(t)}};var rh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsNull(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return e.startNull(t),e.endNull(t)}};var ih=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsStruct_(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return e.startStruct_(t),e.endStruct_(t)}};var Oo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsTime(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):at.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,n){t.addFieldInt16(0,n,at.MILLISECOND)}static addBitWidth(t,n){t.addFieldInt32(1,n,32)}static endTime(t){return t.endObject()}static createTime(t,n,r){return e.startTime(t),e.addUnit(t,n),e.addBitWidth(t,r),e.endTime(t)}};var Lo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsTimestamp(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):at.SECOND}timezone(t){let n=this.bb.__offset(this.bb_pos,6);return n?this.bb.__string(this.bb_pos+n,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,n){t.addFieldInt16(0,n,at.SECOND)}static addTimezone(t,n){t.addFieldOffset(1,n,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,n,r){return e.startTimestamp(t),e.addUnit(t,n),e.addTimezone(t,r),e.endTimestamp(t)}};var li=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsUnion(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}mode(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):pe.Sparse}typeIds(t){let n=this.bb.__offset(this.bb_pos,6);return n?this.bb.readInt32(this.bb.__vector(this.bb_pos+n)+t*4):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,n){t.addFieldInt16(0,n,pe.Sparse)}static addTypeIds(t,n){t.addFieldOffset(1,n,0)}static createTypeIdsVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addInt32(n[r]);return t.endVector()}static startTypeIdsVector(t,n){t.startVector(4,n,4)}static endUnion(t){return t.endObject()}static createUnion(t,n,r){return e.startUnion(t),e.addMode(t,n),e.addTypeIds(t,r),e.endUnion(t)}};var oh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsUtf8(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}};var fe;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.RunEndEncoded=22]="RunEndEncoded"})(fe||(fe={}));var Nn=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsField(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}name(t){let n=this.bb.__offset(this.bb_pos,4);return n?this.bb.__string(this.bb_pos+n,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):fe.NONE}type(t){let n=this.bb.__offset(this.bb_pos,10);return n?this.bb.__union(t,this.bb_pos+n):null}dictionary(t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Pi).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}children(t,n){let r=this.bb.__offset(this.bb_pos,14);return r?(n||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){let r=this.bb.__offset(this.bb_pos,16);return r?(n||new tn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,n){t.addFieldOffset(0,n,0)}static addNullable(t,n){t.addFieldInt8(1,+n,0)}static addTypeType(t,n){t.addFieldInt8(2,n,fe.NONE)}static addType(t,n){t.addFieldOffset(3,n,0)}static addDictionary(t,n){t.addFieldOffset(4,n,0)}static addChildren(t,n){t.addFieldOffset(5,n,0)}static createChildrenVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startChildrenVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(6,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endField(t){return t.endObject()}};var sr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsSchema(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ys.Little}fields(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new Nn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new tn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let n=this.bb.__offset(this.bb_pos,10);return n?this.bb.readInt64(this.bb.__vector(this.bb_pos+n)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,n){t.addFieldInt16(0,n,Ys.Little)}static addFields(t,n){t.addFieldOffset(1,n,0)}static createFieldsVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startFieldsVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(2,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static addFeatures(t,n){t.addFieldOffset(3,n,0)}static createFeaturesVector(t,n){t.startVector(8,n.length,8);for(let r=n.length-1;r>=0;r--)t.addInt64(n[r]);return t.endVector()}static startFeaturesVector(t,n){t.startVector(8,n,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,n){t.finish(n)}static finishSizePrefixedSchemaBuffer(t,n){t.finish(n,void 0,!0)}static createSchema(t,n,r,i,o){return e.startSchema(t),e.addEndianness(t,n),e.addFields(t,r),e.addCustomMetadata(t,i),e.addFeatures(t,o),e.endSchema(t)}};var Ut;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(Ut||(Ut={}));var O;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e[e.DurationSecond=-27]="DurationSecond",e[e.DurationMillisecond=-28]="DurationMillisecond",e[e.DurationMicrosecond=-29]="DurationMicrosecond",e[e.DurationNanosecond=-30]="DurationNanosecond"})(O||(O={}));var ui;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(ui||(ui={}));var e_={};Vs(e_,{clampIndex:()=>FC,clampRange:()=>lh,createElementComparator:()=>ea});var Rw={};Vs(Rw,{valueToString:()=>fi});function fi(e){if(e===null)return"null";if(e===void 0)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(t=>fi(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,n)=>typeof n=="bigint"?`${n}`:n)}var Uw={};Vs(Uw,{BN:()=>ah,bigNumToBigInt:()=>L3,bigNumToString:()=>Al,isArrowBigNumSymbol:()=>B3});var B3=Symbol.for("isArrowBigNum");function hi(e,...t){return t.length===0?Object.setPrototypeOf(kt(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}hi.prototype[B3]=!0;hi.prototype.toJSON=function(){return`"${Al(this)}"`};hi.prototype.valueOf=function(){return O3(this)};hi.prototype.toString=function(){return Al(this)};hi.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return O3(this);case"string":return Al(this);case"default":return L3(this)}return Al(this)};function Ml(...e){return hi.apply(this,e)}function Il(...e){return hi.apply(this,e)}function sh(...e){return hi.apply(this,e)}Object.setPrototypeOf(Ml.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Il.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(sh.prototype,Object.create(Uint32Array.prototype));Object.assign(Ml.prototype,hi.prototype,{constructor:Ml,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Il.prototype,hi.prototype,{constructor:Il,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(sh.prototype,hi.prototype,{constructor:sh,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});function O3(e){let{buffer:t,byteOffset:n,length:r,signed:i}=e,o=new BigUint64Array(t,n,r),s=i&&o.at(-1)&BigInt(1)<<BigInt(63),a=BigInt(s?1:0),c=BigInt(0);if(s){for(let l of o)a+=~l*(BigInt(1)<<BigInt(32)*c++);a*=BigInt(-1)}else for(let l of o)a+=l*(BigInt(1)<<BigInt(32)*c++);return a}var Al=e=>{if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return $w(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return $w(e);t=t.slice();let r=1;for(let o=0;o<t.length;o++){let s=t[o],a=~s+r;t[o]=a,r&=s===0?1:0}return`-${$w(t)}`},L3=e=>e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:Al(e);function $w(e){let t="",n=new Uint32Array(2),r=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),i=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),o=-1,s=r.length-1;do{for(n[0]=r[o=0];o<s;)r[o++]=n[1]=n[0]/10,n[0]=(n[0]-n[1]*10<<16)+r[o];r[o]=n[1]=n[0]/10,n[0]=n[0]-n[1]*10,t=`${n[0]}${t}`}while(i[0]||i[1]||i[2]||i[3]);return t??"0"}var ah=class e{static new(t,n){switch(n){case!0:return new Ml(t);case!1:return new Il(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Ml(t)}return t.byteLength===16?new sh(t):new Il(t)}static signed(t){return new Ml(t)}static unsigned(t){return new Il(t)}static decimal(t){return new sh(t)}constructor(t,n){return e.new(t,n)}};function Ae(e){if(typeof e=="bigint"&&(e<Number.MIN_SAFE_INTEGER||e>Number.MAX_SAFE_INTEGER))throw new TypeError(`${e} is not safe to convert to a number.`);return Number(e)}var F3,C3,k3,R3,$3,U3,P3,z3,q3,V3,j3,Y3,W3,G3,X3,H3,Z3,K3,Q3,J3,t6,e6,ot=class e{static isNull(t){return t?.typeId===O.Null}static isInt(t){return t?.typeId===O.Int}static isFloat(t){return t?.typeId===O.Float}static isBinary(t){return t?.typeId===O.Binary}static isLargeBinary(t){return t?.typeId===O.LargeBinary}static isUtf8(t){return t?.typeId===O.Utf8}static isLargeUtf8(t){return t?.typeId===O.LargeUtf8}static isBool(t){return t?.typeId===O.Bool}static isDecimal(t){return t?.typeId===O.Decimal}static isDate(t){return t?.typeId===O.Date}static isTime(t){return t?.typeId===O.Time}static isTimestamp(t){return t?.typeId===O.Timestamp}static isInterval(t){return t?.typeId===O.Interval}static isDuration(t){return t?.typeId===O.Duration}static isList(t){return t?.typeId===O.List}static isStruct(t){return t?.typeId===O.Struct}static isUnion(t){return t?.typeId===O.Union}static isFixedSizeBinary(t){return t?.typeId===O.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===O.FixedSizeList}static isMap(t){return t?.typeId===O.Map}static isDictionary(t){return t?.typeId===O.Dictionary}static isDenseUnion(t){return e.isUnion(t)&&t.mode===pe.Dense}static isSparseUnion(t){return e.isUnion(t)&&t.mode===pe.Sparse}constructor(t){this.typeId=t}};F3=Symbol.toStringTag;ot[F3]=(e=>(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]="DataType"))(ot.prototype);var qn=class extends ot{constructor(){super(O.Null)}toString(){return"Null"}};C3=Symbol.toStringTag;qn[C3]=(e=>e[Symbol.toStringTag]="Null")(qn.prototype);var ke=class extends ot{constructor(t,n){super(O.Int),this.isSigned=t,this.bitWidth=n}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};k3=Symbol.toStringTag;ke[k3]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(ke.prototype);var ty=class extends ke{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},ey=class extends ke{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},qi=class extends ke{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},ny=class extends ke{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},ry=class extends ke{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},iy=class extends ke{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},oy=class extends ke{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},sy=class extends ke{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(ty.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(ey.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(qi.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(ny.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(ry.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(iy.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(oy.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(sy.prototype,"ArrayType",{value:BigUint64Array});var ar=class extends ot{constructor(t){super(O.Float),this.precision=t}get ArrayType(){switch(this.precision){case ue.HALF:return Uint16Array;case ue.SINGLE:return Float32Array;case ue.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};R3=Symbol.toStringTag;ar[R3]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(ar.prototype);var ay=class extends ar{constructor(){super(ue.HALF)}},cy=class extends ar{constructor(){super(ue.SINGLE)}},ly=class extends ar{constructor(){super(ue.DOUBLE)}};Object.defineProperty(ay.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(cy.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(ly.prototype,"ArrayType",{value:Float64Array});var Fo=class extends ot{constructor(){super(O.Binary)}toString(){return"Binary"}};$3=Symbol.toStringTag;Fo[$3]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(Fo.prototype);var Co=class extends ot{constructor(){super(O.LargeBinary)}toString(){return"LargeBinary"}};U3=Symbol.toStringTag;Co[U3]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeBinary"))(Co.prototype);var ko=class extends ot{constructor(){super(O.Utf8)}toString(){return"Utf8"}};P3=Symbol.toStringTag;ko[P3]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(ko.prototype);var Ro=class extends ot{constructor(){super(O.LargeUtf8)}toString(){return"LargeUtf8"}};z3=Symbol.toStringTag;Ro[z3]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeUtf8"))(Ro.prototype);var $o=class extends ot{constructor(){super(O.Bool)}toString(){return"Bool"}};q3=Symbol.toStringTag;$o[q3]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))($o.prototype);var Uo=class extends ot{constructor(t,n,r=128){super(O.Decimal),this.scale=t,this.precision=n,this.bitWidth=r}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};V3=Symbol.toStringTag;Uo[V3]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(Uo.prototype);var Po=class extends ot{constructor(t){super(O.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${ze[this.unit]}>`}};j3=Symbol.toStringTag;Po[j3]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Date"))(Po.prototype);var di=class extends ot{constructor(t,n){super(O.Time),this.unit=t,this.bitWidth=n}toString(){return`Time${this.bitWidth}<${at[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Y3=Symbol.toStringTag;di[Y3]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(di.prototype);var zo=class extends ot{constructor(t,n){super(O.Timestamp),this.unit=t,this.timezone=n}toString(){return`Timestamp<${at[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};W3=Symbol.toStringTag;zo[W3]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Timestamp"))(zo.prototype);var qo=class extends ot{constructor(t){super(O.Interval),this.unit=t}toString(){return`Interval<${rn[this.unit]}>`}};G3=Symbol.toStringTag;qo[G3]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(qo.prototype);var Vo=class extends ot{constructor(t){super(O.Duration),this.unit=t}toString(){return`Duration<${at[this.unit]}>`}};X3=Symbol.toStringTag;Vo[X3]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(Vo.prototype);var pi=class extends ot{constructor(t){super(O.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};H3=Symbol.toStringTag;pi[H3]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(pi.prototype);var ye=class extends ot{constructor(t){super(O.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};Z3=Symbol.toStringTag;ye[Z3]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(ye.prototype);var mi=class extends ot{constructor(t,n,r){super(O.Union),this.mode=t,this.children=r,this.typeIds=n=Int32Array.from(n),this.typeIdToChildIndex=n.reduce((i,o,s)=>(i[o]=s)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};K3=Symbol.toStringTag;mi[K3]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(mi.prototype);var jo=class extends ot{constructor(t){super(O.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Q3=Symbol.toStringTag;jo[Q3]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(jo.prototype);var yi=class extends ot{constructor(t,n){super(O.FixedSizeList),this.listSize=t,this.children=[n]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};J3=Symbol.toStringTag;yi[J3]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(yi.prototype);var gi=class extends ot{constructor(t,n=!1){var r,i,o;if(super(O.Map),this.children=[t],this.keysSorted=n,t&&(t.name="entries",!((r=t?.type)===null||r===void 0)&&r.children)){let s=(i=t?.type)===null||i===void 0?void 0:i.children[0];s&&(s.name="key");let a=(o=t?.type)===null||o===void 0?void 0:o.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};t6=Symbol.toStringTag;gi[t6]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(gi.prototype);var XF=(e=>()=>++e)(-1),vr=class extends ot{constructor(t,n,r,i){super(O.Dictionary),this.indices=n,this.dictionary=t,this.isOrdered=i||!1,this.id=r==null?XF():Ae(r)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};e6=Symbol.toStringTag;vr[e6]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(vr.prototype);function Sr(e){let t=e;switch(e.typeId){case O.Decimal:return e.bitWidth/32;case O.Timestamp:return 2;case O.Date:return 1+t.unit;case O.Interval:return 1+t.unit;case O.FixedSizeList:return t.listSize;case O.FixedSizeBinary:return t.byteWidth;default:return 1}}var dt=class{visitMany(t,...n){return t.map((r,i)=>this.visit(r,...n.map(o=>o[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,n=!0){return HF(this,t,n)}getVisitFnByTypeId(t,n=!0){return Tl(this,t,n)}visitNull(t,...n){return null}visitBool(t,...n){return null}visitInt(t,...n){return null}visitFloat(t,...n){return null}visitUtf8(t,...n){return null}visitLargeUtf8(t,...n){return null}visitBinary(t,...n){return null}visitLargeBinary(t,...n){return null}visitFixedSizeBinary(t,...n){return null}visitDate(t,...n){return null}visitTimestamp(t,...n){return null}visitTime(t,...n){return null}visitDecimal(t,...n){return null}visitList(t,...n){return null}visitStruct(t,...n){return null}visitUnion(t,...n){return null}visitDictionary(t,...n){return null}visitInterval(t,...n){return null}visitDuration(t,...n){return null}visitFixedSizeList(t,...n){return null}visitMap(t,...n){return null}};function HF(e,t,n=!0){return typeof t=="number"?Tl(e,t,n):typeof t=="string"&&t in O?Tl(e,O[t],n):t&&t instanceof ot?Tl(e,n6(t),n):t?.type&&t.type instanceof ot?Tl(e,n6(t.type),n):Tl(e,O.NONE,n)}function Tl(e,t,n=!0){let r=null;switch(t){case O.Null:r=e.visitNull;break;case O.Bool:r=e.visitBool;break;case O.Int:r=e.visitInt;break;case O.Int8:r=e.visitInt8||e.visitInt;break;case O.Int16:r=e.visitInt16||e.visitInt;break;case O.Int32:r=e.visitInt32||e.visitInt;break;case O.Int64:r=e.visitInt64||e.visitInt;break;case O.Uint8:r=e.visitUint8||e.visitInt;break;case O.Uint16:r=e.visitUint16||e.visitInt;break;case O.Uint32:r=e.visitUint32||e.visitInt;break;case O.Uint64:r=e.visitUint64||e.visitInt;break;case O.Float:r=e.visitFloat;break;case O.Float16:r=e.visitFloat16||e.visitFloat;break;case O.Float32:r=e.visitFloat32||e.visitFloat;break;case O.Float64:r=e.visitFloat64||e.visitFloat;break;case O.Utf8:r=e.visitUtf8;break;case O.LargeUtf8:r=e.visitLargeUtf8;break;case O.Binary:r=e.visitBinary;break;case O.LargeBinary:r=e.visitLargeBinary;break;case O.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case O.Date:r=e.visitDate;break;case O.DateDay:r=e.visitDateDay||e.visitDate;break;case O.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case O.Timestamp:r=e.visitTimestamp;break;case O.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case O.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case O.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case O.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case O.Time:r=e.visitTime;break;case O.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case O.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case O.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case O.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case O.Decimal:r=e.visitDecimal;break;case O.List:r=e.visitList;break;case O.Struct:r=e.visitStruct;break;case O.Union:r=e.visitUnion;break;case O.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case O.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case O.Dictionary:r=e.visitDictionary;break;case O.Interval:r=e.visitInterval;break;case O.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case O.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case O.Duration:r=e.visitDuration;break;case O.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case O.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case O.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case O.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case O.FixedSizeList:r=e.visitFixedSizeList;break;case O.Map:r=e.visitMap;break}if(typeof r=="function")return r;if(!n)return()=>null;throw new Error(`Unrecognized type '${O[t]}'`)}function n6(e){switch(e.typeId){case O.Null:return O.Null;case O.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?O.Int8:O.Uint8;case 16:return n?O.Int16:O.Uint16;case 32:return n?O.Int32:O.Uint32;case 64:return n?O.Int64:O.Uint64}return O.Int}case O.Float:switch(e.precision){case ue.HALF:return O.Float16;case ue.SINGLE:return O.Float32;case ue.DOUBLE:return O.Float64}return O.Float;case O.Binary:return O.Binary;case O.LargeBinary:return O.LargeBinary;case O.Utf8:return O.Utf8;case O.LargeUtf8:return O.LargeUtf8;case O.Bool:return O.Bool;case O.Decimal:return O.Decimal;case O.Time:switch(e.unit){case at.SECOND:return O.TimeSecond;case at.MILLISECOND:return O.TimeMillisecond;case at.MICROSECOND:return O.TimeMicrosecond;case at.NANOSECOND:return O.TimeNanosecond}return O.Time;case O.Timestamp:switch(e.unit){case at.SECOND:return O.TimestampSecond;case at.MILLISECOND:return O.TimestampMillisecond;case at.MICROSECOND:return O.TimestampMicrosecond;case at.NANOSECOND:return O.TimestampNanosecond}return O.Timestamp;case O.Date:switch(e.unit){case ze.DAY:return O.DateDay;case ze.MILLISECOND:return O.DateMillisecond}return O.Date;case O.Interval:switch(e.unit){case rn.DAY_TIME:return O.IntervalDayTime;case rn.YEAR_MONTH:return O.IntervalYearMonth}return O.Interval;case O.Duration:switch(e.unit){case at.SECOND:return O.DurationSecond;case at.MILLISECOND:return O.DurationMillisecond;case at.MICROSECOND:return O.DurationMicrosecond;case at.NANOSECOND:return O.DurationNanosecond}return O.Duration;case O.Map:return O.Map;case O.List:return O.List;case O.Struct:return O.Struct;case O.Union:switch(e.mode){case pe.Dense:return O.DenseUnion;case pe.Sparse:return O.SparseUnion}return O.Union;case O.FixedSizeBinary:return O.FixedSizeBinary;case O.FixedSizeList:return O.FixedSizeList;case O.Dictionary:return O.Dictionary}throw new Error(`Unrecognized type '${O[e.typeId]}'`)}dt.prototype.visitInt8=null;dt.prototype.visitInt16=null;dt.prototype.visitInt32=null;dt.prototype.visitInt64=null;dt.prototype.visitUint8=null;dt.prototype.visitUint16=null;dt.prototype.visitUint32=null;dt.prototype.visitUint64=null;dt.prototype.visitFloat16=null;dt.prototype.visitFloat32=null;dt.prototype.visitFloat64=null;dt.prototype.visitDateDay=null;dt.prototype.visitDateMillisecond=null;dt.prototype.visitTimestampSecond=null;dt.prototype.visitTimestampMillisecond=null;dt.prototype.visitTimestampMicrosecond=null;dt.prototype.visitTimestampNanosecond=null;dt.prototype.visitTimeSecond=null;dt.prototype.visitTimeMillisecond=null;dt.prototype.visitTimeMicrosecond=null;dt.prototype.visitTimeNanosecond=null;dt.prototype.visitDenseUnion=null;dt.prototype.visitSparseUnion=null;dt.prototype.visitIntervalDayTime=null;dt.prototype.visitIntervalYearMonth=null;dt.prototype.visitDuration=null;dt.prototype.visitDurationSecond=null;dt.prototype.visitDurationMillisecond=null;dt.prototype.visitDurationMicrosecond=null;dt.prototype.visitDurationNanosecond=null;var Pw={};Vs(Pw,{float64ToUint16:()=>ch,uint16ToFloat64:()=>uy});var r6=new Float64Array(1),El=new Uint32Array(r6.buffer);function uy(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return r*(n?Number.NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*Math.pow(2,t-15)*(1+n)}function ch(e){if(e!==e)return 32256;r6[0]=e;let t=(El[1]&2147483648)>>16&65535,n=El[1]&2146435072,r=0;return n>=1089470464?El[0]>0?n=31744:(n=(n&2080374784)>>16,r=(El[1]&1048575)>>10):n<=1056964608?(r=1048576+(El[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(El[1]&1048575)+512>>10),t|n|r&65535}var xt=class extends dt{};function Mt(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}var ZF=(e,t,n)=>{e[t]=Math.trunc(n/864e5)},zw=(e,t,n)=>{e[t]=Math.trunc(n%4294967296),e[t+1]=Math.trunc(n/4294967296)},KF=(e,t,n)=>{e[t]=Math.trunc(n*1e3%4294967296),e[t+1]=Math.trunc(n*1e3/4294967296)},QF=(e,t,n)=>{e[t]=Math.trunc(n*1e6%4294967296),e[t+1]=Math.trunc(n*1e6/4294967296)},i6=(e,t,n,r)=>{if(n+1<t.length){let i=Ae(t[n]),o=Ae(t[n+1]);e.set(r.subarray(0,o-i),i)}},JF=({offset:e,values:t},n,r)=>{let i=e+n;r?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},Yo=({values:e},t,n)=>{e[t]=n},qw=({values:e},t,n)=>{e[t]=n},o6=({values:e},t,n)=>{e[t]=ch(n)},tC=(e,t,n)=>{switch(e.type.precision){case ue.HALF:return o6(e,t,n);case ue.SINGLE:case ue.DOUBLE:return qw(e,t,n)}},fy=({values:e},t,n)=>{ZF(e,t,n.valueOf())},hy=({values:e},t,n)=>{zw(e,t*2,n.valueOf())},Vw=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},s6=({values:e,valueOffsets:t},n,r)=>i6(e,t,n,r),a6=({values:e,valueOffsets:t},n,r)=>i6(e,t,n,Ri(r)),jw=(e,t,n)=>{e.type.unit===ze.DAY?fy(e,t,n):hy(e,t,n)},dy=({values:e},t,n)=>zw(e,t*2,n/1e3),py=({values:e},t,n)=>zw(e,t*2,n),my=({values:e},t,n)=>KF(e,t*2,n),yy=({values:e},t,n)=>QF(e,t*2,n),Yw=(e,t,n)=>{switch(e.type.unit){case at.SECOND:return dy(e,t,n);case at.MILLISECOND:return py(e,t,n);case at.MICROSECOND:return my(e,t,n);case at.NANOSECOND:return yy(e,t,n)}},gy=({values:e},t,n)=>{e[t]=n},by=({values:e},t,n)=>{e[t]=n},xy=({values:e},t,n)=>{e[t]=n},wy=({values:e},t,n)=>{e[t]=n},Ww=(e,t,n)=>{switch(e.type.unit){case at.SECOND:return gy(e,t,n);case at.MILLISECOND:return by(e,t,n);case at.MICROSECOND:return xy(e,t,n);case at.NANOSECOND:return wy(e,t,n)}},Gw=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},eC=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,o=bn.getVisitFn(r);if(Array.isArray(n))for(let s=-1,a=i[t],c=i[t+1];a<c;)o(r,a++,n[++s]);else for(let s=-1,a=i[t],c=i[t+1];a<c;)o(r,a++,n.get(++s))},nC=(e,t,n)=>{let r=e.children[0],{valueOffsets:i}=e,o=bn.getVisitFn(r),{[t]:s,[t+1]:a}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let l of c)if(o(r,s,l),++s>=a)break},rC=(e,t)=>(n,r,i,o)=>r&&n(r,e,t[o]),iC=(e,t)=>(n,r,i,o)=>r&&n(r,e,t.get(o)),oC=(e,t)=>(n,r,i,o)=>r&&n(r,e,t.get(i.name)),sC=(e,t)=>(n,r,i,o)=>r&&n(r,e,t[i.name]),aC=(e,t,n)=>{let r=e.type.children.map(o=>bn.getVisitFn(o.type)),i=n instanceof Map?oC(t,n):n instanceof qt?iC(t,n):Array.isArray(n)?rC(t,n):sC(t,n);e.type.children.forEach((o,s)=>i(r[s],e.children[s],o,s))},cC=(e,t,n)=>{e.type.mode===pe.Dense?c6(e,t,n):l6(e,t,n)},c6=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];bn.visit(i,e.valueOffsets[t],n)},l6=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];bn.visit(i,t,n)},lC=(e,t,n)=>{var r;(r=e.dictionary)===null||r===void 0||r.set(e.values[t],n)},Xw=(e,t,n)=>{e.type.unit===rn.DAY_TIME?_y(e,t,n):vy(e,t,n)},_y=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},vy=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},Sy=({values:e},t,n)=>{e[t]=n},My=({values:e},t,n)=>{e[t]=n},Iy=({values:e},t,n)=>{e[t]=n},Ay=({values:e},t,n)=>{e[t]=n},Hw=(e,t,n)=>{switch(e.type.unit){case at.SECOND:return Sy(e,t,n);case at.MILLISECOND:return My(e,t,n);case at.MICROSECOND:return Iy(e,t,n);case at.NANOSECOND:return Ay(e,t,n)}},uC=(e,t,n)=>{let{stride:r}=e,i=e.children[0],o=bn.getVisitFn(i);if(Array.isArray(n))for(let s=-1,a=t*r;++s<r;)o(i,a+s,n[s]);else for(let s=-1,a=t*r;++s<r;)o(i,a+s,n.get(s))};xt.prototype.visitBool=Mt(JF);xt.prototype.visitInt=Mt(Yo);xt.prototype.visitInt8=Mt(Yo);xt.prototype.visitInt16=Mt(Yo);xt.prototype.visitInt32=Mt(Yo);xt.prototype.visitInt64=Mt(Yo);xt.prototype.visitUint8=Mt(Yo);xt.prototype.visitUint16=Mt(Yo);xt.prototype.visitUint32=Mt(Yo);xt.prototype.visitUint64=Mt(Yo);xt.prototype.visitFloat=Mt(tC);xt.prototype.visitFloat16=Mt(o6);xt.prototype.visitFloat32=Mt(qw);xt.prototype.visitFloat64=Mt(qw);xt.prototype.visitUtf8=Mt(a6);xt.prototype.visitLargeUtf8=Mt(a6);xt.prototype.visitBinary=Mt(s6);xt.prototype.visitLargeBinary=Mt(s6);xt.prototype.visitFixedSizeBinary=Mt(Vw);xt.prototype.visitDate=Mt(jw);xt.prototype.visitDateDay=Mt(fy);xt.prototype.visitDateMillisecond=Mt(hy);xt.prototype.visitTimestamp=Mt(Yw);xt.prototype.visitTimestampSecond=Mt(dy);xt.prototype.visitTimestampMillisecond=Mt(py);xt.prototype.visitTimestampMicrosecond=Mt(my);xt.prototype.visitTimestampNanosecond=Mt(yy);xt.prototype.visitTime=Mt(Ww);xt.prototype.visitTimeSecond=Mt(gy);xt.prototype.visitTimeMillisecond=Mt(by);xt.prototype.visitTimeMicrosecond=Mt(xy);xt.prototype.visitTimeNanosecond=Mt(wy);xt.prototype.visitDecimal=Mt(Gw);xt.prototype.visitList=Mt(eC);xt.prototype.visitStruct=Mt(aC);xt.prototype.visitUnion=Mt(cC);xt.prototype.visitDenseUnion=Mt(c6);xt.prototype.visitSparseUnion=Mt(l6);xt.prototype.visitDictionary=Mt(lC);xt.prototype.visitInterval=Mt(Xw);xt.prototype.visitIntervalDayTime=Mt(_y);xt.prototype.visitIntervalYearMonth=Mt(vy);xt.prototype.visitDuration=Mt(Hw);xt.prototype.visitDurationSecond=Mt(Sy);xt.prototype.visitDurationMillisecond=Mt(My);xt.prototype.visitDurationMicrosecond=Mt(Iy);xt.prototype.visitDurationNanosecond=Mt(Ay);xt.prototype.visitFixedSizeList=Mt(uC);xt.prototype.visitMap=Mt(nC);var bn=new xt;var bi=Symbol.for("parent"),Dl=Symbol.for("rowIndex"),Js=class{constructor(t,n){return this[bi]=t,this[Dl]=n,new Proxy(this,new Kw)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Dl],n=this[bi],r=n.type.children,i={};for(let o=-1,s=r.length;++o<s;)i[r[o].name]=qe.visit(n.children[o],t);return i}toString(){return`{${[...this].map(([t,n])=>`${fi(t)}: ${fi(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Zw(this[bi],this[Dl])}},Zw=class{constructor(t,n){this.childIndex=0,this.children=t.children,this.rowIndex=n,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,qe.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(Js.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[bi]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Dl]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var Kw=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[bi].type.children.map(n=>n.name)}has(t,n){return t[bi].type.children.findIndex(r=>r.name===n)!==-1}getOwnPropertyDescriptor(t,n){if(t[bi].type.children.findIndex(r=>r.name===n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];let r=t[bi].type.children.findIndex(i=>i.name===n);if(r!==-1){let i=qe.visit(t[bi].children[r],t[Dl]);return Reflect.set(t,n,i),i}}set(t,n,r){let i=t[bi].type.children.findIndex(o=>o.name===n);return i!==-1?(bn.visit(t[bi].children[i],t[Dl],r),Reflect.set(t,n,r)):Reflect.has(t,n)||typeof n=="symbol"?Reflect.set(t,n,r):!1}};var pt=class extends dt{};function vt(e){return(t,n)=>t.getValid(n)?e(t,n):null}var fC=(e,t)=>864e5*e[t],Qw=(e,t)=>4294967296*e[t+1]+(e[t]>>>0),hC=(e,t)=>4294967296*(e[t+1]/1e3)+(e[t]>>>0)/1e3,dC=(e,t)=>4294967296*(e[t+1]/1e6)+(e[t]>>>0)/1e6,u6=e=>new Date(e),pC=(e,t)=>u6(fC(e,t)),mC=(e,t)=>u6(Qw(e,t)),yC=(e,t)=>null,f6=(e,t,n)=>{if(n+1>=t.length)return null;let r=Ae(t[n]),i=Ae(t[n+1]);return e.subarray(r,i)},gC=({offset:e,values:t},n)=>{let r=e+n;return(t[r>>3]&1<<r%8)!==0},h6=({values:e},t)=>pC(e,t),d6=({values:e},t)=>mC(e,t*2),ta=({stride:e,values:t},n)=>t[e*n],bC=({stride:e,values:t},n)=>uy(t[e*n]),p6=({values:e},t)=>e[t],xC=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),m6=({values:e,valueOffsets:t},n)=>f6(e,t,n),y6=({values:e,valueOffsets:t},n)=>{let r=f6(e,t,n);return r!==null?Yf(r):null},wC=({values:e},t)=>e[t],_C=({type:e,values:t},n)=>e.precision!==ue.HALF?t[n]:uy(t[n]),vC=(e,t)=>e.type.unit===ze.DAY?h6(e,t):d6(e,t),g6=({values:e},t)=>1e3*Qw(e,t*2),b6=({values:e},t)=>Qw(e,t*2),x6=({values:e},t)=>hC(e,t*2),w6=({values:e},t)=>dC(e,t*2),SC=(e,t)=>{switch(e.type.unit){case at.SECOND:return g6(e,t);case at.MILLISECOND:return b6(e,t);case at.MICROSECOND:return x6(e,t);case at.NANOSECOND:return w6(e,t)}},_6=({values:e},t)=>e[t],v6=({values:e},t)=>e[t],S6=({values:e},t)=>e[t],M6=({values:e},t)=>e[t],MC=(e,t)=>{switch(e.type.unit){case at.SECOND:return _6(e,t);case at.MILLISECOND:return v6(e,t);case at.MICROSECOND:return S6(e,t);case at.NANOSECOND:return M6(e,t)}},IC=({values:e,stride:t},n)=>ah.decimal(e.subarray(t*n,t*(n+1))),AC=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:o,[t*r+1]:s}=n,c=i[0].slice(o,s-o);return new qt([c])},TC=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:o}=n,s=r[0];return new Vi(s.slice(i,o-i))},EC=(e,t)=>new Js(e,t),DC=(e,t)=>e.type.mode===pe.Dense?I6(e,t):A6(e,t),I6=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return qe.visit(r,e.valueOffsets[t])},A6=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return qe.visit(r,t)},NC=(e,t)=>{var n;return(n=e.dictionary)===null||n===void 0?void 0:n.get(e.values[t])},BC=(e,t)=>e.type.unit===rn.DAY_TIME?T6(e,t):E6(e,t),T6=({values:e},t)=>e.subarray(2*t,2*(t+1)),E6=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},D6=({values:e},t)=>e[t],N6=({values:e},t)=>e[t],B6=({values:e},t)=>e[t],O6=({values:e},t)=>e[t],OC=(e,t)=>{switch(e.type.unit){case at.SECOND:return D6(e,t);case at.MILLISECOND:return N6(e,t);case at.MICROSECOND:return B6(e,t);case at.NANOSECOND:return O6(e,t)}},LC=(e,t)=>{let{stride:n,children:r}=e,o=r[0].slice(t*n,n);return new qt([o])};pt.prototype.visitNull=vt(yC);pt.prototype.visitBool=vt(gC);pt.prototype.visitInt=vt(wC);pt.prototype.visitInt8=vt(ta);pt.prototype.visitInt16=vt(ta);pt.prototype.visitInt32=vt(ta);pt.prototype.visitInt64=vt(p6);pt.prototype.visitUint8=vt(ta);pt.prototype.visitUint16=vt(ta);pt.prototype.visitUint32=vt(ta);pt.prototype.visitUint64=vt(p6);pt.prototype.visitFloat=vt(_C);pt.prototype.visitFloat16=vt(bC);pt.prototype.visitFloat32=vt(ta);pt.prototype.visitFloat64=vt(ta);pt.prototype.visitUtf8=vt(y6);pt.prototype.visitLargeUtf8=vt(y6);pt.prototype.visitBinary=vt(m6);pt.prototype.visitLargeBinary=vt(m6);pt.prototype.visitFixedSizeBinary=vt(xC);pt.prototype.visitDate=vt(vC);pt.prototype.visitDateDay=vt(h6);pt.prototype.visitDateMillisecond=vt(d6);pt.prototype.visitTimestamp=vt(SC);pt.prototype.visitTimestampSecond=vt(g6);pt.prototype.visitTimestampMillisecond=vt(b6);pt.prototype.visitTimestampMicrosecond=vt(x6);pt.prototype.visitTimestampNanosecond=vt(w6);pt.prototype.visitTime=vt(MC);pt.prototype.visitTimeSecond=vt(_6);pt.prototype.visitTimeMillisecond=vt(v6);pt.prototype.visitTimeMicrosecond=vt(S6);pt.prototype.visitTimeNanosecond=vt(M6);pt.prototype.visitDecimal=vt(IC);pt.prototype.visitList=vt(AC);pt.prototype.visitStruct=vt(EC);pt.prototype.visitUnion=vt(DC);pt.prototype.visitDenseUnion=vt(I6);pt.prototype.visitSparseUnion=vt(A6);pt.prototype.visitDictionary=vt(NC);pt.prototype.visitInterval=vt(BC);pt.prototype.visitIntervalDayTime=vt(T6);pt.prototype.visitIntervalYearMonth=vt(E6);pt.prototype.visitDuration=vt(OC);pt.prototype.visitDurationSecond=vt(D6);pt.prototype.visitDurationMillisecond=vt(N6);pt.prototype.visitDurationMicrosecond=vt(B6);pt.prototype.visitDurationNanosecond=vt(O6);pt.prototype.visitFixedSizeList=vt(LC);pt.prototype.visitMap=vt(TC);var qe=new pt;var Pr=Symbol.for("keys"),Nl=Symbol.for("vals"),Vi=class{constructor(t){return this[Pr]=new qt([t.children[0]]).memoize(),this[Nl]=t.children[1],new Proxy(this,new t_)}[Symbol.iterator](){return new Jw(this[Pr],this[Nl])}get size(){return this[Pr].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Pr],n=this[Nl],r={};for(let i=-1,o=t.length;++i<o;)r[t.get(i)]=qe.visit(n,i);return r}toString(){return`{${[...this].map(([t,n])=>`${fi(t)}: ${fi(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Jw=class{constructor(t,n){this.keys=t,this.vals=n,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){let t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),qe.visit(this.vals,t)]})}},t_=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Pr].toArray().map(String)}has(t,n){return t[Pr].includes(n)}getOwnPropertyDescriptor(t,n){if(t[Pr].indexOf(n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];let r=t[Pr].indexOf(n);if(r!==-1){let i=qe.visit(Reflect.get(t,Nl),r);return Reflect.set(t,n,i),i}}set(t,n,r){let i=t[Pr].indexOf(n);return i!==-1?(bn.visit(Reflect.get(t,Nl),i,r),Reflect.set(t,n,r)):Reflect.has(t,n)?Reflect.set(t,n,r):!1}};Object.defineProperties(Vi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Pr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Nl]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function FC(e,t,n){let r=e.length,i=t>-1?t:r+t%r;return n?n(e,i):i}var L6;function lh(e,t,n,r){let{length:i=0}=e,o=typeof t!="number"?0:t,s=typeof n!="number"?i:n;return o<0&&(o=(o%i+i)%i),s<0&&(s=(s%i+i)%i),s<o&&(L6=o,o=s,s=L6),s>i&&(s=i),r?r(e,o,s):[o,s]}var F6=e=>e!==e;function ea(e){if(typeof e!=="object"||e===null)return F6(e)?F6:n=>n===e;if(e instanceof Date){let n=e.valueOf();return r=>r instanceof Date?r.valueOf()===n:!1}return ArrayBuffer.isView(e)?n=>n?Lw(e,n):!1:e instanceof Map?kC(e):Array.isArray(e)?CC(e):e instanceof qt?RC(e):$C(e,!0)}function CC(e){let t=[];for(let n=-1,r=e.length;++n<r;)t[n]=ea(e[n]);return Ty(t)}function kC(e){let t=-1,n=[];for(let r of e.values())n[++t]=ea(r);return Ty(n)}function RC(e){let t=[];for(let n=-1,r=e.length;++n<r;)t[n]=ea(e.get(n));return Ty(t)}function $C(e,t=!1){let n=Object.keys(e);if(!t&&n.length===0)return()=>!1;let r=[];for(let i=-1,o=n.length;++i<o;)r[i]=ea(e[n[i]]);return Ty(r,n)}function Ty(e,t){return n=>{if(!n||typeof n!="object")return!1;switch(n.constructor){case Array:return UC(e,n);case Map:return C6(e,n,n.keys());case Vi:case Js:case Object:case void 0:return C6(e,n,t||Object.keys(n))}return n instanceof qt?PC(e,n):!1}}function UC(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r<n;)if(!e[r](t[r]))return!1;return!0}function PC(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r<n;)if(!e[r](t.get(r)))return!1;return!0}function C6(e,t,n){let r=n[Symbol.iterator](),i=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),s=0,a=e.length,c=o.next(),l=r.next(),u=i.next();for(;s<a&&!l.done&&!u.done&&!c.done&&!(l.value!==u.value||!e[s](c.value));++s,l=r.next(),u=i.next(),c=o.next());return s===a&&l.done&&u.done&&c.done?!0:(r.return&&r.return(),i.return&&i.return(),o.return&&o.return(),!1)}var n_={};Vs(n_,{BitIterator:()=>Qa,getBit:()=>k6,getBool:()=>Dy,packBools:()=>tc,popcnt_array:()=>R6,popcnt_bit_range:()=>uh,popcnt_uint32:()=>Ey,setBool:()=>zC,truncateBitmap:()=>Ja});function Dy(e,t,n,r){return(n&1<<r)!==0}function k6(e,t,n,r){return(n&1<<r)>>r}function zC(e,t,n){return n?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function Ja(e,t,n){let r=n.byteLength+7&-8;if(e>0||n.byteLength<r){let i=new Uint8Array(r);return i.set(e%8===0?n.subarray(e>>3):tc(new Qa(n,e,t,null,Dy)).subarray(0,r)),i}return n}function tc(e){let t=[],n=0,r=0,i=0;for(let s of e)s&&(i|=1<<r),++r===8&&(t[n++]=i,i=r=0);(n===0||r>0)&&(t[n++]=i);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}var Qa=class{constructor(t,n,r,i,o){this.bytes=t,this.length=r,this.context=i,this.get=o,this.bit=n%8,this.byteIndex=n>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}};function uh(e,t,n){if(n-t<=0)return 0;if(n-t<8){let o=0;for(let s of new Qa(e,t,n-t,e,k6))o+=s;return o}let r=n>>3<<3,i=t+(t%8===0?0:8-t%8);return uh(e,t,i)+uh(e,r,n)+R6(e,i>>3,r-i>>3)}function R6(e,t,n){let r=0,i=Math.trunc(t),o=new DataView(e.buffer,e.byteOffset,e.byteLength),s=n===void 0?e.byteLength:i+n;for(;s-i>=4;)r+=Ey(o.getUint32(i)),i+=4;for(;s-i>=2;)r+=Ey(o.getUint16(i)),i+=2;for(;s-i>=1;)r+=Ey(o.getUint8(i)),i+=1;return r}function Ey(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var qC=-1,Kt=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:t}=this;return ot.isSparseUnion(t)?this.children.some(n=>n.nullable):ot.isDenseUnion(t)?this.children.some(n=>n.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:n,values:r,nullBitmap:i,typeIds:o}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),this.children.reduce((s,a)=>s+a.byteLength,t)}get nullCount(){if(ot.isUnion(this.type))return this.children.reduce((r,i)=>r+i.nullCount,0);let t=this._nullCount,n;return t<=qC&&(n=this.nullBitmap)&&(this._nullCount=t=this.length-uh(n,this.offset,this.offset+this.length)),t}constructor(t,n,r,i,o,s=[],a){this.type=t,this.children=s,this.dictionary=a,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;o instanceof e?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=Sr(t),o&&((c=o[0])&&(this.valueOffsets=c),(c=o[1])&&(this.values=c),(c=o[2])&&(this.nullBitmap=c),(c=o[3])&&(this.typeIds=c)))}getValid(t){let{type:n}=this;if(ot.isUnion(n)){let r=n,i=this.children[r.typeIdToChildIndex[this.typeIds[t]]],o=r.mode===pe.Dense?this.valueOffsets[t]:t;return i.getValid(o)}if(this.nullable&&this.nullCount>0){let r=this.offset+t;return(this.nullBitmap[r>>3]&1<<r%8)!==0}return!0}setValid(t,n){let r,{type:i}=this;if(ot.isUnion(i)){let o=i,s=this.children[o.typeIdToChildIndex[this.typeIds[t]]],a=o.mode===pe.Dense?this.valueOffsets[t]:t;r=s.getValid(a),s.setValid(a,n)}else{let{nullBitmap:o}=this,{offset:s,length:a}=this,c=s+t,l=1<<c%8,u=c>>3;(!o||o.byteLength<=u)&&(o=new Uint8Array((s+a+63&-64)>>3).fill(255),this.nullCount>0&&o.set(Ja(s,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:o,_nullCount:-1}));let f=o[u];r=(f&l)!==0,n?o[u]=f|l:o[u]=f&~l}return r!==!!n&&(this._nullCount=this.nullCount+(n?-1:1)),n}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,o=this,s=this.children){return new e(t,n,r,i,o,s,this.dictionary)}slice(t,n){let{stride:r,typeId:i,children:o}=this,s=+(this._nullCount===0)-1,a=i===16?r:1,c=this._sliceBuffers(t,n,r,i);return this.clone(this.type,this.offset+t,n,s,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*t,a*n))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===O.Null)return this.clone(this.type,0,t,0);let{length:n,nullCount:r}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,n>>3);i[n>>3]=(1<<n-(n&-8))-1,r>0&&i.set(Ja(this.offset,n,this.nullBitmap),0);let o=this.buffers;return o[ui.VALIDITY]=i,this.clone(this.type,0,t,r+(t-n),o)}_sliceBuffers(t,n,r,i){let o,{buffers:s}=this;return(o=s[ui.TYPE])&&(s[ui.TYPE]=o.subarray(t,t+n)),(o=s[ui.OFFSET])&&(s[ui.OFFSET]=o.subarray(t,t+n+1))||(o=s[ui.DATA])&&(s[ui.DATA]=i===6?o:o.subarray(r*t,r*(t+n))),s}_sliceChildren(t,n,r){return t.map(i=>i.slice(n,r))}};Kt.prototype.children=Object.freeze([]);var r_=class e extends dt{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:n,["offset"]:r=0,["length"]:i=0}=t;return new Kt(n,r,i,i)}visitBool(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Kt(n,r,s,a,[void 0,o,i])}visitInt(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Kt(n,r,s,a,[void 0,o,i])}visitFloat(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Kt(n,r,s,a,[void 0,o,i])}visitUtf8(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.data),o=wt(t.nullBitmap),s=Za(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Kt(n,r,a,c,[s,i,o])}visitLargeUtf8(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.data),o=wt(t.nullBitmap),s=Gm(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Kt(n,r,a,c,[s,i,o])}visitBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.data),o=wt(t.nullBitmap),s=Za(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Kt(n,r,a,c,[s,i,o])}visitLargeBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.data),o=wt(t.nullBitmap),s=Gm(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Kt(n,r,a,c,[s,i,o])}visitFixedSizeBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/Sr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Kt(n,r,s,a,[void 0,o,i])}visitDate(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/Sr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Kt(n,r,s,a,[void 0,o,i])}visitTimestamp(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/Sr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Kt(n,r,s,a,[void 0,o,i])}visitTime(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/Sr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Kt(n,r,s,a,[void 0,o,i])}visitDecimal(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/Sr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Kt(n,r,s,a,[void 0,o,i])}visitList(t){let{["type"]:n,["offset"]:r=0,["child"]:i}=t,o=wt(t.nullBitmap),s=Za(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Kt(n,r,a,c,[s,void 0,o],[i])}visitStruct(t){let{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,o=wt(t.nullBitmap),{length:s=i.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Kt(n,r,s,a,[void 0,void 0,o],i)}visitUnion(t){let{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,o=kt(n.ArrayType,t.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=t;if(ot.isSparseUnion(n))return new Kt(n,r,s,a,[void 0,void 0,void 0,o],i);let c=Za(t.valueOffsets);return new Kt(n,r,s,a,[c,void 0,void 0,o],i)}visitDictionary(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.nullBitmap),o=kt(n.indices.ArrayType,t.data),{["dictionary"]:s=new qt([new e().visit({type:n.dictionary})])}=t,{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Kt(n,r,a,c,[void 0,o,i],[],s)}visitInterval(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/Sr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Kt(n,r,s,a,[void 0,o,i])}visitDuration(t){let{["type"]:n,["offset"]:r=0}=t,i=wt(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Kt(n,r,s,a,[void 0,o,i])}visitFixedSizeList(t){let{["type"]:n,["offset"]:r=0,["child"]:i=new e().visit({type:n.valueType})}=t,o=wt(t.nullBitmap),{["length"]:s=i.length/Sr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Kt(n,r,s,a,[void 0,void 0,o],[i])}visitMap(t){let{["type"]:n,["offset"]:r=0,["child"]:i=new e().visit({type:n.childType})}=t,o=wt(t.nullBitmap),s=Za(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Kt(n,r,a,c,[s,void 0,o],[i])}},VC=new r_;function At(e){return VC.visit(e)}var fh=class{constructor(t=0,n){this.numChunks=t,this.getChunkIterator=n,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}};function $6(e){return e.some(t=>t.nullable)}function Ny(e){return e.reduce((t,n)=>t+n.nullCount,0)}function By(e){return e.reduce((t,n,r)=>(t[r+1]=t[r]+n.length,t),new Uint32Array(e.length+1))}function Oy(e,t,n,r){let i=[];for(let o=-1,s=e.length;++o<s;){let a=e[o],c=t[o],{length:l}=a;if(c>=r)break;if(n>=c+l)continue;if(c>=n&&c+l<=r){i.push(a);continue}let u=Math.max(0,n-c),f=Math.min(r-c,l);i.push(a.slice(u,f-u))}return i.length===0&&i.push(e[0].slice(0,0)),i}function i_(e,t,n,r){let i=0,o=0,s=t.length-1;do{if(i>=s-1)return n<t[s]?r(e,i,n-t[i]):null;o=i+Math.trunc((s-i)*.5),n<t[o]?s=o:i=o}while(i<s)}function hh(e,t){return e.getValid(t)}function Bl(e){function t(n,r,i){return e(n[r],i)}return function(n){let r=this.data;return i_(r,this._offsets,n,t)}}function Ly(e){let t;function n(r,i,o){return e(r[i],o,t)}return function(r,i){let o=this.data;t=i;let s=i_(o,this._offsets,r,n);return t=void 0,s}}function Fy(e){let t;function n(r,i,o){let s=o,a=0,c=0;for(let l=i-1,u=r.length;++l<u;){let f=r[l];if(~(a=e(f,t,s)))return c+a;s=0,c+=f.length}return-1}return function(r,i){t=r;let o=this.data,s=typeof i!="number"?n(o,0,0):i_(o,this._offsets,i,n);return t=void 0,s}}var mt=class extends dt{};function jC(e,t){return t===null&&e.length>0?0:-1}function YC(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new Qa(n,e.offset+(t||0),e.length,n,Dy)){if(!i)return r;++r}return-1}function Tt(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case O.Union:break;case O.Dictionary:break;default:return YC(e,n)}let r=qe.getVisitFn(e),i=ea(t);for(let o=(n||0)-1,s=e.length;++o<s;)if(i(r(e,o)))return o;return-1}function U6(e,t,n){let r=qe.getVisitFn(e),i=ea(t);for(let o=(n||0)-1,s=e.length;++o<s;)if(i(r(e,o)))return o;return-1}mt.prototype.visitNull=jC;mt.prototype.visitBool=Tt;mt.prototype.visitInt=Tt;mt.prototype.visitInt8=Tt;mt.prototype.visitInt16=Tt;mt.prototype.visitInt32=Tt;mt.prototype.visitInt64=Tt;mt.prototype.visitUint8=Tt;mt.prototype.visitUint16=Tt;mt.prototype.visitUint32=Tt;mt.prototype.visitUint64=Tt;mt.prototype.visitFloat=Tt;mt.prototype.visitFloat16=Tt;mt.prototype.visitFloat32=Tt;mt.prototype.visitFloat64=Tt;mt.prototype.visitUtf8=Tt;mt.prototype.visitLargeUtf8=Tt;mt.prototype.visitBinary=Tt;mt.prototype.visitLargeBinary=Tt;mt.prototype.visitFixedSizeBinary=Tt;mt.prototype.visitDate=Tt;mt.prototype.visitDateDay=Tt;mt.prototype.visitDateMillisecond=Tt;mt.prototype.visitTimestamp=Tt;mt.prototype.visitTimestampSecond=Tt;mt.prototype.visitTimestampMillisecond=Tt;mt.prototype.visitTimestampMicrosecond=Tt;mt.prototype.visitTimestampNanosecond=Tt;mt.prototype.visitTime=Tt;mt.prototype.visitTimeSecond=Tt;mt.prototype.visitTimeMillisecond=Tt;mt.prototype.visitTimeMicrosecond=Tt;mt.prototype.visitTimeNanosecond=Tt;mt.prototype.visitDecimal=Tt;mt.prototype.visitList=Tt;mt.prototype.visitStruct=Tt;mt.prototype.visitUnion=Tt;mt.prototype.visitDenseUnion=U6;mt.prototype.visitSparseUnion=U6;mt.prototype.visitDictionary=Tt;mt.prototype.visitInterval=Tt;mt.prototype.visitIntervalDayTime=Tt;mt.prototype.visitIntervalYearMonth=Tt;mt.prototype.visitDuration=Tt;mt.prototype.visitDurationSecond=Tt;mt.prototype.visitDurationMillisecond=Tt;mt.prototype.visitDurationMicrosecond=Tt;mt.prototype.visitDurationNanosecond=Tt;mt.prototype.visitFixedSizeList=Tt;mt.prototype.visitMap=Tt;var ec=new mt;var yt=class extends dt{};function St(e){let{type:t}=e;if(e.nullCount===0&&e.stride===1&&(t.typeId===O.Timestamp||t instanceof ke&&t.bitWidth!==64||t instanceof di&&t.bitWidth!==64||t instanceof ar&&t.precision!==ue.HALF))return new fh(e.data.length,r=>{let i=e.data[r];return i.values.subarray(0,i.length)[Symbol.iterator]()});let n=0;return new fh(e.data.length,r=>{let o=e.data[r].length,s=e.slice(n,n+o);return n+=o,new o_(s)})}var o_=class{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};yt.prototype.visitNull=St;yt.prototype.visitBool=St;yt.prototype.visitInt=St;yt.prototype.visitInt8=St;yt.prototype.visitInt16=St;yt.prototype.visitInt32=St;yt.prototype.visitInt64=St;yt.prototype.visitUint8=St;yt.prototype.visitUint16=St;yt.prototype.visitUint32=St;yt.prototype.visitUint64=St;yt.prototype.visitFloat=St;yt.prototype.visitFloat16=St;yt.prototype.visitFloat32=St;yt.prototype.visitFloat64=St;yt.prototype.visitUtf8=St;yt.prototype.visitLargeUtf8=St;yt.prototype.visitBinary=St;yt.prototype.visitLargeBinary=St;yt.prototype.visitFixedSizeBinary=St;yt.prototype.visitDate=St;yt.prototype.visitDateDay=St;yt.prototype.visitDateMillisecond=St;yt.prototype.visitTimestamp=St;yt.prototype.visitTimestampSecond=St;yt.prototype.visitTimestampMillisecond=St;yt.prototype.visitTimestampMicrosecond=St;yt.prototype.visitTimestampNanosecond=St;yt.prototype.visitTime=St;yt.prototype.visitTimeSecond=St;yt.prototype.visitTimeMillisecond=St;yt.prototype.visitTimeMicrosecond=St;yt.prototype.visitTimeNanosecond=St;yt.prototype.visitDecimal=St;yt.prototype.visitList=St;yt.prototype.visitStruct=St;yt.prototype.visitUnion=St;yt.prototype.visitDenseUnion=St;yt.prototype.visitSparseUnion=St;yt.prototype.visitDictionary=St;yt.prototype.visitInterval=St;yt.prototype.visitIntervalDayTime=St;yt.prototype.visitIntervalYearMonth=St;yt.prototype.visitDuration=St;yt.prototype.visitDurationSecond=St;yt.prototype.visitDurationMillisecond=St;yt.prototype.visitDurationMicrosecond=St;yt.prototype.visitDurationNanosecond=St;yt.prototype.visitFixedSizeList=St;yt.prototype.visitMap=St;var Ol=new yt;var P6,z6={},q6={},qt=class e{constructor(t){var n,r,i;let o=t[0]instanceof e?t.flatMap(a=>a.data):t;if(o.length===0||o.some(a=>!(a instanceof Kt)))throw new TypeError("Vector constructor expects an Array of Data instances.");let s=(n=o[0])===null||n===void 0?void 0:n.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:l}=z6[s.typeId],u=o[0];this.isValid=f=>hh(u,f),this.get=f=>a(u,f),this.set=(f,h)=>c(u,f,h),this.indexOf=f=>l(u,f),this._offsets=[0,u.length];break}default:Object.setPrototypeOf(this,q6[s.typeId]),this._offsets=By(o);break}this.data=o,this.type=s,this.stride=Sr(s),this.numChildren=(i=(r=s.children)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,n)=>t+n.byteLength,0)}get nullable(){return $6(this.data)}get nullCount(){return Ny(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${O[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,n){}indexOf(t,n){return-1}includes(t,n){return this.indexOf(t,n)>-1}[Symbol.iterator](){return Ol.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(n=>n.data).flat(Number.POSITIVE_INFINITY)))}slice(t,n){return new e(lh(this,t,n,({data:r,_offsets:i},o,s)=>Oy(r,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:t,data:n,length:r,stride:i,ArrayType:o}=this;switch(t.typeId){case O.Int:case O.Float:case O.Decimal:case O.Time:case O.Timestamp:switch(n.length){case 0:return new o;case 1:return n[0].values.subarray(0,r*i);default:return n.reduce((s,{values:a,length:c})=>(s.array.set(a.subarray(0,c*i),s.offset),s.offset+=c*i,s),{array:new o(r*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var n;return this.getChildAt((n=this.type.children)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new e(this.data.map(({children:n})=>n[t])):null}get isMemoized(){return ot.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(ot.isDictionary(this.type)){let t=new Cy(this.data[0].dictionary),n=this.data.map(r=>{let i=r.clone();return i.dictionary=t,i});return new e(n)}return new Cy(this)}unmemoize(){if(ot.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(r=>{let i=r.clone();return i.dictionary=t,i});return new e(n)}return this}};P6=Symbol.toStringTag;qt[P6]=(e=>{e.type=ot.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(O).map(n=>O[n]).filter(n=>typeof n=="number"&&n!==O.NONE);for(let n of t){let r=qe.getVisitFnByTypeId(n),i=bn.getVisitFnByTypeId(n),o=ec.getVisitFnByTypeId(n);z6[n]={get:r,set:i,indexOf:o},q6[n]=Object.create(e,{isValid:{value:Bl(hh)},get:{value:Bl(qe.getVisitFnByTypeId(n))},set:{value:Ly(bn.getVisitFnByTypeId(n))},indexOf:{value:Fy(ec.getVisitFnByTypeId(n))}})}return"Vector"})(qt.prototype);var Cy=class e extends qt{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(s){let a=o[s];if(a!==void 0)return a;let c=n.call(this,s);return o[s]=c,c}}),Object.defineProperty(this,"set",{value(s,a){r.call(this,s,a),o[s]=a}}),Object.defineProperty(this,"slice",{value:(s,a)=>new e(i.call(this,s,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new qt(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function V6(e){if(!e||e.length<=0)return function(i){return!0};let t="",n=e.filter(r=>r===r);return n.length>0&&(t=`
|
|
2
2
|
switch (x) {${n.map(r=>`
|
|
3
|
-
case ${
|
|
3
|
+
case ${WC(r)}:`).join("")}
|
|
4
4
|
return false;
|
|
5
5
|
}`),e.length!==n.length&&(t=`if (x !== x) return false;
|
|
6
6
|
${t}`),new Function("x",`${t}
|
|
7
|
-
return true;`)}function XL(e){return typeof e!="bigint"?ci(e):`${ci(e)}n`}var o_=(e,t)=>(Math.ceil(e)*t+63&-64||64)/t,HL=(e,t=0)=>e.length>=t?e.subarray(0,t):Sl(new e.constructor(t),e,0),Xs=class{constructor(t,n=1){this.buffer=t,this.stride=n,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=Math.ceil(t.length/n))}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,n){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let n=this.stride,r=this.length*n,i=this.buffer.length;r>=i&&this._resize(i===0?o_(r*1,this.BYTES_PER_ELEMENT):o_(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=o_(t*this.stride,this.BYTES_PER_ELEMENT);let n=HL(this.buffer,t);return this.clear(),n}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=Sl(new this.ArrayType(t),this.buffer)}};Xs.prototype.offset=0;var zo=class extends Xs{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,n){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=n,this}},Bl=class extends zo{constructor(t=new Uint8Array(0)){super(t,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,n){let{buffer:r}=this.reserve(t-this.length+1),i=t>>3,o=t%8,s=r[i]>>o&1;return n?s===0&&(r[i]|=1<<o,++this.numValid):s===1&&(r[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},Fl=class extends zo{constructor(t=new Int32Array(1)){super(t,1)}append(t){return this.set(this.length-1,t)}set(t,n){let r=this.length-1,i=this.reserve(t-r+1).buffer;return r<t++&&i.fill(i[r],r,t),i[t]=i[t-1]+n,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,0),super.flush(t+1)}};var ye=class{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}constructor({type:t,nullValues:n}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=n,this.stride=xr(t),this._nulls=new Bl,n&&n.length>0&&(this._isValid=$6(n))}toVector(){return new zt([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0,{_offsets:n,_values:r,_nulls:i,_typeIds:o,children:s}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),s.reduce((a,c)=>a+c.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((n,r)=>n+r.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,n){return this.setValid(t,this.isValid(n))&&this.setValue(t,n),this}setValue(t,n){this._setValue(this,t,n)}setValid(t,n){return this.length=this._nulls.set(t,+n).length,n}addChild(t,n=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,n,r,i,{type:o,length:s,nullCount:a,_typeIds:c,_offsets:l,_values:u,_nulls:f}=this;(n=c?.flush(s))?i=l?.flush(s):(i=l?.flush(s))?t=u?.flush(l.last()):t=u?.flush(s),a>0&&(r=f?.flush(s));let h=this.children.map(d=>d.flush());return this.clear(),Dt({type:o,length:s,nullCount:a,children:h,child:h[0],data:t,typeIds:n,nullBitmap:r,valueOffsets:i})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,n,r,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(n=this._values)===null||n===void 0||n.clear(),(r=this._offsets)===null||r===void 0||r.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(let o of this.children)o.clear();return this}};ye.prototype.length=1;ye.prototype.stride=1;ye.prototype.children=null;ye.prototype.finished=!1;ye.prototype.nullValues=null;ye.prototype._isValid=()=>!0;var ze=class extends ye{constructor(t){super(t),this._values=new zo(new this.ArrayType(0),this.stride)}setValue(t,n){let r=this._values;return r.reserve(t-r.length+1),super.setValue(t,n)}},zi=class extends ye{constructor(t){super(t),this._pendingLength=0,this._offsets=new Fl}setValue(t,n){let r=this._pending||(this._pending=new Map),i=r.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=n instanceof Pi?n[$r].length:n.length,r.set(t,n)}setValid(t,n){return super.setValid(t,n)?!0:((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let t=this._pending,n=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,n),this}};var rc=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,n,r,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(r),t.writeInt64(BigInt(n??0)),t.offset()}};var qi=new Int32Array(2),By=new Float32Array(qi.buffer),Fy=new Float64Array(qi.buffer),Cl=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var rh;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(rh||(rh={}));var _r=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return qi[0]=this.readInt32(t),By[0]}readFloat64(t){return qi[Cl?0:1]=this.readInt32(t),qi[Cl?1:0]=this.readInt32(t+4),Fy[0]}writeInt8(t,n){this.bytes_[t]=n}writeUint8(t,n){this.bytes_[t]=n}writeInt16(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8}writeUint16(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8}writeInt32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeUint32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeInt64(t,n){this.writeInt32(t,Number(BigInt.asIntN(32,n))),this.writeInt32(t+4,Number(BigInt.asIntN(32,n>>BigInt(32))))}writeUint64(t,n){this.writeUint32(t,Number(BigInt.asUintN(32,n))),this.writeUint32(t+4,Number(BigInt.asUintN(32,n>>BigInt(32))))}writeFloat32(t,n){By[0]=n,this.writeInt32(t,qi[0])}writeFloat64(t,n){Fy[0]=n,this.writeInt32(t,qi[Cl?0:1]),this.writeInt32(t+4,qi[Cl?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let n=0;n<4;n++)t+=String.fromCharCode(this.readInt8(this.position_+4+n));return t}__offset(t,n){let r=t-this.readInt32(t);return n<this.readInt16(r)?this.readInt16(r+n):0}__union(t,n){return t.bb_pos=n+this.readInt32(n),t.bb=this,t}__string(t,n){t+=this.readInt32(t);let r=this.readInt32(t);t+=4;let i=this.bytes_.subarray(t,t+r);return n===rh.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(t,n){return typeof t=="string"?this.__string(n):this.__union(t,n)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let n=0;n<4;n++)if(t.charCodeAt(n)!=this.readInt8(this.position()+4+n))return!1;return!0}createScalarList(t,n){let r=[];for(let i=0;i<n;++i){let o=t(i);o!==null&&r.push(o)}return r}createObjList(t,n){let r=[];for(let i=0;i<n;++i){let o=t(i);o!==null&&r.push(o.unpack())}return r}};var ic=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let n;t?n=t:n=1024,this.bb=_r.allocate(n),this.space=n}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,n){t>this.minalign&&(this.minalign=t);let r=~(this.bb.capacity()-this.space+n)+1&t-1;for(;this.space<r+t+n;){let i=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(r)}pad(t){for(let n=0;n<t;n++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,n,r){(this.force_defaults||n!=r)&&(this.addInt8(n),this.slot(t))}addFieldInt16(t,n,r){(this.force_defaults||n!=r)&&(this.addInt16(n),this.slot(t))}addFieldInt32(t,n,r){(this.force_defaults||n!=r)&&(this.addInt32(n),this.slot(t))}addFieldInt64(t,n,r){(this.force_defaults||n!==r)&&(this.addInt64(n),this.slot(t))}addFieldFloat32(t,n,r){(this.force_defaults||n!=r)&&(this.addFloat32(n),this.slot(t))}addFieldFloat64(t,n,r){(this.force_defaults||n!=r)&&(this.addFloat64(n),this.slot(t))}addFieldOffset(t,n,r){(this.force_defaults||n!=r)&&(this.addOffset(n),this.slot(t))}addFieldStruct(t,n,r){n!=r&&(this.nested(n),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let n=t.capacity();if(n&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let r=n<<1,i=_r.allocate(r);return i.setPosition(r-n),i.bytes().set(t.bytes(),r-n),i}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let n=0;n<t;n++)this.vtable[n]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let t=this.offset(),n=this.vtable_in_use-1;for(;n>=0&&this.vtable[n]==0;n--);let r=n+1;for(;n>=0;n--)this.addInt16(this.vtable[n]!=0?t-this.vtable[n]:0);let i=2;this.addInt16(t-this.object_start);let o=(r+i)*2;this.addInt16(o);let s=0,a=this.space;t:for(n=0;n<this.vtables.length;n++){let c=this.bb.capacity()-this.vtables[n];if(o==this.bb.readInt16(c)){for(let l=2;l<o;l+=2)if(this.bb.readInt16(a+l)!=this.bb.readInt16(c+l))continue t;s=this.vtables[n];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,n,r){let i=r?4:0;if(n){let o=n;if(this.prep(this.minalign,8+i),o.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let s=3;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,4+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,n){this.finish(t,n,!0)}requiredField(t,n){let r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(!(n<this.bb.readInt16(i)&&this.bb.readInt16(i+n)!=0))throw new TypeError("FlatBuffers: field "+n+" must be set")}startVector(t,n,r){this.notNested(),this.vector_num_elems=n,this.prep(4,t*n),this.prep(r,t*n)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let n=this.createString(t);return this.string_maps.set(t,n),n}createString(t){if(t==null)return 0;let n;t instanceof Uint8Array?n=t:n=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,n.length,1),this.bb.setPosition(this.space-=n.length);for(let r=0,i=this.space,o=this.bb.bytes();r<n.length;r++)o[i++]=n[r];return this.endVector()}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let n=[];for(let r=0;r<t.length;++r){let i=t[r];if(i!==null)n.push(this.createObjectOffset(i));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return n}createStructOffsetList(t,n){return n(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var Qe=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsKeyValue(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}key(t){let n=this.bb.__offset(this.bb_pos,4);return n?this.bb.__string(this.bb_pos+n,t):null}value(t){let n=this.bb.__offset(this.bb_pos,6);return n?this.bb.__string(this.bb_pos+n,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,n){t.addFieldOffset(0,n,0)}static addValue(t,n){t.addFieldOffset(1,n,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,n,r){return e.startKeyValue(t),e.addKey(t,n),e.addValue(t,r),e.endKeyValue(t)}};var Hs;(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(Hs||(Hs={}));var Zs;(function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"})(Zs||(Zs={}));var ih;(function(e){e[e.DenseArray=0]="DenseArray"})(ih||(ih={}));var gi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsInt(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,n){t.addFieldInt32(0,n,0)}static addIsSigned(t,n){t.addFieldInt8(1,+n,0)}static endInt(t){return t.endObject()}static createInt(t,n,r){return e.startInt(t),e.addBitWidth(t,n),e.addIsSigned(t,r),e.endInt(t)}};var Vi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDictionaryEncoding(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}indexType(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new gi).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):ih.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,n){t.addFieldInt64(0,n,BigInt("0"))}static addIndexType(t,n){t.addFieldOffset(1,n,0)}static addIsOrdered(t,n){t.addFieldInt8(2,+n,0)}static addDictionaryKind(t,n){t.addFieldInt16(3,n,ih.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var oh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBinary(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return e.startBinary(t),e.endBinary(t)}};var sh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBool(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return e.startBool(t),e.endBool(t)}};var ah;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(ah||(ah={}));var Ks=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDate(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ah.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,ah.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,n){return e.startDate(t),e.addUnit(t,n),e.endDate(t)}};var ji=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDecimal(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,n){t.addFieldInt32(0,n,0)}static addScale(t,n){t.addFieldInt32(1,n,0)}static addBitWidth(t,n){t.addFieldInt32(2,n,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,n,r,i){return e.startDecimal(t),e.addPrecision(t,n),e.addScale(t,r),e.addBitWidth(t,i),e.endDecimal(t)}};var bi;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(bi||(bi={}));var Qs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDuration(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):bi.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,bi.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,n){return e.startDuration(t),e.addUnit(t,n),e.endDuration(t)}};var Js=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFixedSizeBinary(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,n){t.addFieldInt32(0,n,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,n){return e.startFixedSizeBinary(t),e.addByteWidth(t,n),e.endFixedSizeBinary(t)}};var ta=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFixedSizeList(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,n){t.addFieldInt32(0,n,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,n){return e.startFixedSizeList(t),e.addListSize(t,n),e.endFixedSizeList(t)}};var ch;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(ch||(ch={}));var ea=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFloatingPoint(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ch.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,n){t.addFieldInt16(0,n,ch.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,n){return e.startFloatingPoint(t),e.addPrecision(t,n),e.endFloatingPoint(t)}};var lh;(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(lh||(lh={}));var na=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsInterval(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):lh.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,lh.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,n){return e.startInterval(t),e.addUnit(t,n),e.endInterval(t)}};var uh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsList(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return e.startList(t),e.endList(t)}};var ra=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsMap(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,n){t.addFieldInt8(0,+n,0)}static endMap(t){return t.endObject()}static createMap(t,n){return e.startMap(t),e.addKeysSorted(t,n),e.endMap(t)}};var fh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsNull(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return e.startNull(t),e.endNull(t)}};var hh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsStruct_(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return e.startStruct_(t),e.endStruct_(t)}};var qo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsTime(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):bi.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,n){t.addFieldInt16(0,n,bi.MILLISECOND)}static addBitWidth(t,n){t.addFieldInt32(1,n,32)}static endTime(t){return t.endObject()}static createTime(t,n,r){return e.startTime(t),e.addUnit(t,n),e.addBitWidth(t,r),e.endTime(t)}};var Vo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsTimestamp(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):bi.SECOND}timezone(t){let n=this.bb.__offset(this.bb_pos,6);return n?this.bb.__string(this.bb_pos+n,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,n){t.addFieldInt16(0,n,bi.SECOND)}static addTimezone(t,n){t.addFieldOffset(1,n,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,n,r){return e.startTimestamp(t),e.addUnit(t,n),e.addTimezone(t,r),e.endTimestamp(t)}};var dh;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(dh||(dh={}));var xi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsUnion(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}mode(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):dh.Sparse}typeIds(t){let n=this.bb.__offset(this.bb_pos,6);return n?this.bb.readInt32(this.bb.__vector(this.bb_pos+n)+t*4):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,n){t.addFieldInt16(0,n,dh.Sparse)}static addTypeIds(t,n){t.addFieldOffset(1,n,0)}static createTypeIdsVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addInt32(n[r]);return t.endVector()}static startTypeIdsVector(t,n){t.startVector(4,n,4)}static endUnion(t){return t.endObject()}static createUnion(t,n,r){return e.startUnion(t),e.addMode(t,n),e.addTypeIds(t,r),e.endUnion(t)}};var ph=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsUtf8(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}};var de;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.RunEndEncoded=22]="RunEndEncoded"})(de||(de={}));var En=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsField(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}name(t){let n=this.bb.__offset(this.bb_pos,4);return n?this.bb.__string(this.bb_pos+n,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):de.NONE}type(t){let n=this.bb.__offset(this.bb_pos,10);return n?this.bb.__union(t,this.bb_pos+n):null}dictionary(t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Vi).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}children(t,n){let r=this.bb.__offset(this.bb_pos,14);return r?(n||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){let r=this.bb.__offset(this.bb_pos,16);return r?(n||new Qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,n){t.addFieldOffset(0,n,0)}static addNullable(t,n){t.addFieldInt8(1,+n,0)}static addTypeType(t,n){t.addFieldInt8(2,n,de.NONE)}static addType(t,n){t.addFieldOffset(3,n,0)}static addDictionary(t,n){t.addFieldOffset(4,n,0)}static addChildren(t,n){t.addFieldOffset(5,n,0)}static createChildrenVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startChildrenVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(6,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endField(t){return t.endObject()}};var sr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsSchema(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Zs.Little}fields(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new En).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new Qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let n=this.bb.__offset(this.bb_pos,10);return n?this.bb.readInt64(this.bb.__vector(this.bb_pos+n)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,n){t.addFieldInt16(0,n,Zs.Little)}static addFields(t,n){t.addFieldOffset(1,n,0)}static createFieldsVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startFieldsVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(2,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static addFeatures(t,n){t.addFieldOffset(3,n,0)}static createFeaturesVector(t,n){t.startVector(8,n.length,8);for(let r=n.length-1;r>=0;r--)t.addInt64(n[r]);return t.endVector()}static startFeaturesVector(t,n){t.startVector(8,n,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,n){t.finish(n)}static finishSizePrefixedSchemaBuffer(t,n){t.finish(n,void 0,!0)}static createSchema(t,n,r,i,o){return e.startSchema(t),e.addEndianness(t,n),e.addFields(t,r),e.addCustomMetadata(t,i),e.addFeatures(t,o),e.endSchema(t)}};var vr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFooter(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Hs.V1}schema(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new sr).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dictionaries(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new rc).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,n){let r=this.bb.__offset(this.bb_pos,10);return r?(n||new rc).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new Qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,n){t.addFieldInt16(0,n,Hs.V1)}static addSchema(t,n){t.addFieldOffset(1,n,0)}static addDictionaries(t,n){t.addFieldOffset(2,n,0)}static startDictionariesVector(t,n){t.startVector(24,n,8)}static addRecordBatches(t,n){t.addFieldOffset(3,n,0)}static startRecordBatchesVector(t,n){t.startVector(24,n,8)}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,n){t.finish(n)}static finishSizePrefixedFooterBuffer(t,n){t.finish(n,void 0,!0)}};var te=class e{constructor(t=[],n,r,i=Ie.V5){this.fields=t||[],this.metadata=n||new Map,r||(r=s_(t)),this.dictionaries=r,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,n)=>`${n}: ${t}`).join(", ")} }>`}select(t){let n=new Set(t),r=this.fields.filter(i=>n.has(i.name));return new e(r,this.metadata)}selectAt(t){let n=t.map(r=>this.fields[r]).filter(Boolean);return new e(n,this.metadata)}assign(...t){let n=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),r=[...this.fields],i=Ly(Ly(new Map,this.metadata),n.metadata),o=n.fields.filter(a=>{let c=r.findIndex(l=>l.name===a.name);return~c?(r[c]=a.clone({metadata:Ly(Ly(new Map,r[c].metadata),a.metadata)}))&&!1:!0}),s=s_(o,new Map);return new e([...r,...o],i,new Map([...this.dictionaries,...s]))}};te.prototype.fields=null;te.prototype.metadata=null;te.prototype.dictionaries=null;var Rt=class e{static new(...t){let[n,r,i,o]=t;return t[0]&&typeof t[0]=="object"&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),o===void 0&&(o=t[0].metadata)),new e(`${n}`,r,i,o)}constructor(t,n,r=!1,i){this.name=t,this.type=n,this.nullable=r,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[n,r,i,o]=t;return!t[0]||typeof t[0]!="object"?[n=this.name,r=this.type,i=this.nullable,o=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=t[0],e.new(n,r,i,o)}};Rt.prototype.type=null;Rt.prototype.name=null;Rt.prototype.nullable=null;Rt.prototype.metadata=null;function Ly(e,t){return new Map([...e||new Map,...t||new Map])}function s_(e,t=new Map){for(let n=-1,r=e.length;++n<r;){let o=e[n].type;if(st.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&s_(o.children,t)}return t}var ZL=ic,KL=_r,jo=class{static decode(t){t=new KL(Et(t));let n=vr.getRootAsFooter(t),r=te.decode(n.schema(),new Map,n.version());return new a_(r,n)}static encode(t){let n=new ZL,r=te.encode(n,t.schema);vr.startRecordBatchesVector(n,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())Yo.encode(n,s);let i=n.endVector();vr.startDictionariesVector(n,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())Yo.encode(n,s);let o=n.endVector();return vr.startFooter(n),vr.addSchema(n,r),vr.addVersion(n,Ie.V5),vr.addRecordBatches(n,i),vr.addDictionaries(n,o),vr.finishFooterBuffer(n,vr.endFooter(n)),n.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,n=Ie.V5,r,i){this.schema=t,this.version=n,r&&(this._recordBatches=r),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,n=-1,r=this.numRecordBatches;++n<r;)(t=this.getRecordBatch(n))&&(yield t)}*dictionaryBatches(){for(let t,n=-1,r=this.numDictionaries;++n<r;)(t=this.getDictionaryBatch(n))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}};var a_=class extends jo{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,n){super(t,n.version()),this._footer=n}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let n=this._footer.recordBatches(t);if(n)return Yo.decode(n)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let n=this._footer.dictionaries(t);if(n)return Yo.decode(n)}return null}},Yo=class e{static decode(t){return new e(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,n){let{metaDataLength:r}=n,i=BigInt(n.offset),o=BigInt(n.bodyLength);return rc.createBlock(t,i,r,o)}constructor(t,n,r){this.metaDataLength=t,this.offset=ir(r),this.bodyLength=ir(n)}};var pe=Object.freeze({done:!0,value:void 0}),mh=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},oc=class{tee(){return this._getDOMStream().tee()}pipe(t,n){return this._getNodeStream().pipe(t,n)}pipeTo(t,n){return this._getDOMStream().pipeTo(t,n)}pipeThrough(t,n){return this._getDOMStream().pipeThrough(t,n)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},ky=class extends oc{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return H(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){let{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(pe);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return pn.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return pn.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return H(this,void 0,void 0,function*(){return yield this.abort(t),pe})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),pe})}read(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((n,r)=>{this.resolvers.push({resolve:n,reject:r})}):Promise.resolve(pe)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var Yi=class extends ky{write(t){if((t=Et(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Xf(this.toUint8Array(!0)):this.toUint8Array(!1).then(Xf)}toUint8Array(t=!1){return t?gr(this._values)[0]:H(this,void 0,void 0,function*(){var n,r,i,o;let s=[],a=0;try{for(var c=!0,l=ii(this),u;u=yield l.next(),n=u.done,!n;c=!0){o=u.value,c=!1;let f=o;s.push(f),a+=f.byteLength}}catch(f){r={error:f}}finally{try{!c&&!n&&(i=l.return)&&(yield i.call(l))}finally{if(r)throw r.error}}return gr(s,a)[0]})}},Wi=class{constructor(t){t&&(this.source=new c_(pn.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},Ur=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof Yi?this.source=new Wo(pn.fromAsyncIterable(t)):Gm(t)?this.source=new Wo(pn.fromNodeStream(t)):Hf(t)?this.source=new Wo(pn.fromDOMStream(t)):Ym(t)?this.source=new Wo(pn.fromDOMStream(t.body)):oi(t)?this.source=new Wo(pn.fromIterable(t)):yr(t)?this.source=new Wo(pn.fromAsyncIterable(t)):Rr(t)&&(this.source=new Wo(pn.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},c_=class{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,n="read"){return this.source.next({cmd:n,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||pe)}return(t){return Object.create(this.source.return&&this.source.return(t)||pe)}},Wo=class{constructor(t){this.source=t,this._closedPromise=new Promise(n=>this._closedPromiseResolve=n)}cancel(t){return H(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,n="read"){return H(this,void 0,void 0,function*(){return yield this.source.next({cmd:n,size:t})})}throw(t){return H(this,void 0,void 0,function*(){let n=this.source.throw&&(yield this.source.throw(t))||pe;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}return(t){return H(this,void 0,void 0,function*(){let n=this.source.return&&(yield this.source.return(t))||pe;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}};var yh=class extends Wi{constructor(t,n){super(),this.position=0,this.buffer=Et(t),this.size=n===void 0?this.buffer.byteLength:n}readInt32(t){let{buffer:n,byteOffset:r}=this.readAt(t,4);return new DataView(n,r).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:n,size:r,position:i}=this;return n&&i<r?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(r,i+Math.min(r-i,t)),n.subarray(i,this.position)):null}readAt(t,n){let r=this.buffer,i=Math.min(this.size,t+n);return r?r.subarray(t,i):new Uint8Array(n)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}},ia=class extends Ur{constructor(t,n){super(),this.position=0,this._handle=t,typeof n=="number"?this.size=n:this._pending=H(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return H(this,void 0,void 0,function*(){let{buffer:n,byteOffset:r}=yield this.readAt(t,4);return new DataView(n,r).getInt32(0,!0)})}seek(t){return H(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return H(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:r,position:i}=this;if(n&&i<r){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=i,s=0,a=0,c=Math.min(r,o+Math.min(r-o,t)),l=new Uint8Array(Math.max(0,(this.position=c)-o));for(;(o+=a)<c&&(s+=a)<l.byteLength;)({bytesRead:a}=yield n.read(l,s,l.byteLength-s,o));return l}return null})}readAt(t,n){return H(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:i}=this;if(r&&t+n<i){let o=Math.min(i,t+n),s=new Uint8Array(o-t);return(yield r.read(s,0,n,t)).buffer}return new Uint8Array(n)})}close(){return H(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return H(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var u_={};zs(u_,{BaseInt64:()=>gh,Int128:()=>bh,Int64:()=>Go,Uint64:()=>Me});function Ll(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var kl=8,l_=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],gh=class{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let n=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),i=n[3]*r[3];this.buffer[0]=i&65535;let o=i>>>16;return i=n[2]*r[3],o+=i,i=n[3]*r[2]>>>0,o+=i,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<i?65536:0,this.buffer[1]+=o>>>16,this.buffer[1]+=n[1]*r[3]+n[2]*r[2]+n[3]*r[1],this.buffer[1]+=n[0]*r[3]+n[1]*r[2]+n[2]*r[1]+n[3]*r[0]<<16,this}_plus(t){let n=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],n<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=n}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${Ll(this.buffer[1])} ${Ll(this.buffer[0])}`}},Me=class e extends gh{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,n=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(2)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(2)){let r=t.length,i=new e(n);for(let o=0;o<r;){let s=kl<r-o?kl:r-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),c=new e(new Uint32Array([l_[s],0]));i.times(c),i.plus(a),o+=s}return i}static convertArray(t){let n=new Uint32Array(t.length*2);for(let r=-1,i=t.length;++r<i;)e.from(t[r],new Uint32Array(n.buffer,n.byteOffset+2*r*4,2));return n}static multiply(t,n){return new e(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new e(new Uint32Array(t.buffer)).plus(n)}},Go=class e extends gh{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){let n=this.buffer[1]<<0,r=t.buffer[1]<<0;return n<r||n===r&&this.buffer[0]<t.buffer[0]}static from(t,n=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(2)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(2)){let r=t.startsWith("-"),i=t.length,o=new e(n);for(let s=r?1:0;s<i;){let a=kl<i-s?kl:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),l=new e(new Uint32Array([l_[a],0]));o.times(l),o.plus(c),s+=a}return r?o.negate():o}static convertArray(t){let n=new Uint32Array(t.length*2);for(let r=-1,i=t.length;++r<i;)e.from(t[r],new Uint32Array(n.buffer,n.byteOffset+2*r*4,2));return n}static multiply(t,n){return new e(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new e(new Uint32Array(t.buffer)).plus(n)}},bh=class e{constructor(t){this.buffer=t}high(){return new Go(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Go(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(t){let n=new Me(new Uint32Array([this.buffer[3],0])),r=new Me(new Uint32Array([this.buffer[2],0])),i=new Me(new Uint32Array([this.buffer[1],0])),o=new Me(new Uint32Array([this.buffer[0],0])),s=new Me(new Uint32Array([t.buffer[3],0])),a=new Me(new Uint32Array([t.buffer[2],0])),c=new Me(new Uint32Array([t.buffer[1],0])),l=new Me(new Uint32Array([t.buffer[0],0])),u=Me.multiply(o,l);this.buffer[0]=u.low();let f=new Me(new Uint32Array([u.high(),0]));return u=Me.multiply(i,l),f.plus(u),u=Me.multiply(o,c),f.plus(u),this.buffer[1]=f.low(),this.buffer[3]=f.lessThan(u)?1:0,this.buffer[2]=f.high(),new Me(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Me.multiply(r,l)).plus(Me.multiply(i,c)).plus(Me.multiply(o,a)),this.buffer[3]+=Me.multiply(n,l).plus(Me.multiply(r,c)).plus(Me.multiply(i,a)).plus(Me.multiply(o,s)).low(),this}plus(t){let n=new Uint32Array(4);return n[3]=this.buffer[3]+t.buffer[3]>>>0,n[2]=this.buffer[2]+t.buffer[2]>>>0,n[1]=this.buffer[1]+t.buffer[1]>>>0,n[0]=this.buffer[0]+t.buffer[0]>>>0,n[0]<this.buffer[0]>>>0&&++n[1],n[1]<this.buffer[1]>>>0&&++n[2],n[2]<this.buffer[2]>>>0&&++n[3],this.buffer[3]=n[3],this.buffer[2]=n[2],this.buffer[1]=n[1],this.buffer[0]=n[0],this}hex(){return`${Ll(this.buffer[3])} ${Ll(this.buffer[2])} ${Ll(this.buffer[1])} ${Ll(this.buffer[0])}`}static multiply(t,n){return new e(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new e(new Uint32Array(t.buffer)).plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith("-"),i=t.length,o=new e(n);for(let s=r?1:0;s<i;){let a=kl<i-s?kl:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),l=new e(new Uint32Array([l_[a],0,0,0]));o.times(l),o.plus(c),s+=a}return r?o.negate():o}static convertArray(t){let n=new Uint32Array(t.length*4);for(let r=-1,i=t.length;++r<i;)e.from(t[r],new Uint32Array(n.buffer,n.byteOffset+4*4*r,4));return n}};var xh=class extends lt{constructor(t,n,r,i,o=Ie.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=n,this.buffers=r,this.dictionaries=i,this.metadataVersion=o}visit(t){return super.visit(t instanceof Rt?t.type:t)}visitNull(t,{length:n}=this.nextFieldNode()){return Dt({type:t,length:n})}visitBool(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitInt(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFloat(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitUtf8(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDate(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTimestamp(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTime(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDecimal(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitList(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),children:this.visitMany(t.children)})}visitUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return this.metadataVersion<Ie.V5&&this.readNullBitmap(t,r),t.mode===me.Sparse?this.visitSparseUnion(t,{length:n,nullCount:r}):this.visitDenseUnion(t,{length:n,nullCount:r})}visitDenseUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDuration(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFixedSizeList(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),child:this.visit(t.children[0])})}visitMap(t,{length:n,nullCount:r}=this.nextFieldNode()){return Dt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,n,r=this.nextBufferRange()){return n>0&&this.readData(t,r)||new Uint8Array(0)}readOffsets(t,n){return this.readData(t,n)}readTypeIds(t,n){return this.readData(t,n)}readData(t,{length:n,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+n)}readDictionary(t){return this.dictionaries.get(t.id)}},Ry=class extends xh{constructor(t,n,r,i,o){super(new Uint8Array(0),n,r,i,o),this.sources=t}readNullBitmap(t,n,{offset:r}=this.nextBufferRange()){return n<=0?new Uint8Array(0):ec(this.sources[r])}readOffsets(t,{offset:n}=this.nextBufferRange()){return kt(Uint8Array,kt(Int32Array,this.sources[n]))}readTypeIds(t,{offset:n}=this.nextBufferRange()){return kt(Uint8Array,kt(t.ArrayType,this.sources[n]))}readData(t,{offset:n}=this.nextBufferRange()){let{sources:r}=this;return st.isTimestamp(t)?kt(Uint8Array,Go.convertArray(r[n])):(st.isInt(t)||st.isTime(t))&&t.bitWidth===64||st.isDuration(t)?kt(Uint8Array,Go.convertArray(r[n])):st.isDate(t)&&t.unit===Tn.MILLISECOND?kt(Uint8Array,Go.convertArray(r[n])):st.isDecimal(t)?kt(Uint8Array,bh.convertArray(r[n])):st.isBinary(t)||st.isFixedSizeBinary(t)?QL(r[n]):st.isBool(t)?ec(r[n]):st.isUtf8(t)?Vs(r[n].join("")):kt(Uint8Array,kt(t.ArrayType,r[n].map(i=>+i)))}};function QL(e){let t=e.join(""),n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r>>1]=Number.parseInt(t.slice(r,r+2),16);return n}var Rl=class extends zi{constructor(t){super(t),this._values=new Xs(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,Et(n))}_flushPending(t,n){let r=this._offsets,i=this._values.reserve(n).buffer,o=0;for(let[s,a]of t)if(a===void 0)r.set(s,0);else{let c=a.length;i.set(a,o),r.set(s,c),o+=c}}};var $y=class extends ye{constructor(t){super(t),this._values=new Bl}setValue(t,n){this._values.set(t,+n)}};var sc=class extends ze{};sc.prototype._setValue=Vw;var wh=class extends sc{};wh.prototype._setValue=ay;var _h=class extends sc{};_h.prototype._setValue=cy;var vh=class extends ze{};vh.prototype._setValue=Ww;var Py=class extends ye{constructor({type:t,nullValues:n,dictionaryHashFunction:r}){super({type:new br(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=ac({type:this.type.indices,nullValues:n}),this.dictionary=ac({type:this.type.dictionary,nullValues:null}),typeof r=="function"&&(this.valueToKey=r)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,n){let r=this.indices;return n=r.setValid(t,n),this.length=r.length,n}setValue(t,n){let r=this._keysToIndices,i=this.valueToKey(n),o=r[i];return o===void 0&&(r[i]=o=this._dictionaryOffset+this.dictionary.append(n).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,n=this._dictionary,r=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=n?n.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}};var Sh=class extends ze{};Sh.prototype._setValue=qw;var Uy=class extends ye{setValue(t,n){let[r]=this.children,i=t*this.stride;for(let o=-1,s=n.length;++o<s;)r.set(i+o,n[o])}addChild(t,n="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let r=this.children.push(t);return this.type=new di(this.type.listSize,new Rt(n,t.type,!0)),r}};var cc=class extends ze{setValue(t,n){this._values.set(t,n)}},zy=class extends cc{setValue(t,n){super.setValue(t,Qf(n))}},qy=class extends cc{},Vy=class extends cc{};var lc=class extends ze{};lc.prototype._setValue=Gw;var Ih=class extends lc{};Ih.prototype._setValue=gy;var Mh=class extends lc{};Mh.prototype._setValue=by;var Xo=class extends ze{};Xo.prototype._setValue=Xw;var Ah=class extends Xo{};Ah.prototype._setValue=xy;var Th=class extends Xo{};Th.prototype._setValue=wy;var Eh=class extends Xo{};Eh.prototype._setValue=_y;var Dh=class extends Xo{};Dh.prototype._setValue=vy;var zr=class extends ze{setValue(t,n){this._values.set(t,n)}},jy=class extends zr{},Yy=class extends zr{},Wy=class extends zr{},Gy=class extends zr{},Xy=class extends zr{},Hy=class extends zr{},Zy=class extends zr{},Ky=class extends zr{};var Qy=class extends zi{constructor(t){super(t),this._offsets=new Fl}addChild(t,n="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new fi(new Rt(n,t.type,!0)),this.numChildren-1}_flushPending(t){let n=this._offsets,[r]=this.children;for(let[i,o]of t)if(typeof o>"u")n.set(i,0);else{let s=o,a=s.length,c=n.set(i,a).buffer[i];for(let l=-1;++l<a;)r.set(c+l,s[l])}}};var Jy=class extends zi{set(t,n){return super.set(t,n)}setValue(t,n){let r=n instanceof Map?n:new Map(Object.entries(n)),i=this._pending||(this._pending=new Map),o=i.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=r.size,i.set(t,r)}addChild(t,n=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new pi(new Rt(n,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let n=this._offsets,[r]=this.children;for(let[i,o]of t)if(o===void 0)n.set(i,0);else{let{[i]:s,[i+1]:a}=n.set(i,o.size).buffer;for(let c of o.entries())if(r.set(s,c),++s>=a)break}}};var t0=class extends ye{setValue(t,n){}setValid(t,n){return this.length=Math.max(t+1,this.length),n}};var e0=class extends ye{setValue(t,n){let{children:r,type:i}=this;switch(Array.isArray(n)||n.constructor){case!0:return i.children.forEach((o,s)=>r[s].set(t,n[s]));case Map:return i.children.forEach((o,s)=>r[s].set(t,n.get(o.name)));default:return i.children.forEach((o,s)=>r[s].set(t,n[o.name]))}}setValid(t,n){return super.setValid(t,n)||this.children.forEach(r=>r.setValid(t,n)),n}addChild(t,n=`${this.numChildren}`){let r=this.children.push(t);return this.type=new he([...this.type.children,new Rt(n,t.type,!0)]),r}};var Ho=class extends ze{};Ho.prototype._setValue=jw;var Nh=class extends Ho{};Nh.prototype._setValue=ly;var Oh=class extends Ho{};Oh.prototype._setValue=uy;var Bh=class extends Ho{};Bh.prototype._setValue=fy;var Fh=class extends Ho{};Fh.prototype._setValue=hy;var Zo=class extends ze{};Zo.prototype._setValue=Yw;var Ch=class extends Zo{};Ch.prototype._setValue=dy;var Lh=class extends Zo{};Lh.prototype._setValue=py;var kh=class extends Zo{};kh.prototype._setValue=my;var Rh=class extends Zo{};Rh.prototype._setValue=yy;var $l=class extends ye{constructor(t){super(t),this._typeIds=new zo(new Int8Array(0),1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,n){return this.set(this.length,t,n)}set(t,n,r){return r===void 0&&(r=this._valueToChildTypeId(this,n,t)),this.setValue(t,n,r),this}setValue(t,n,r){this._typeIds.set(t,r);let i=this.type.typeIdToChildIndex[r],o=this.children[i];o?.set(t,n)}addChild(t,n=`${this.children.length}`){let r=this.children.push(t),{type:{children:i,mode:o,typeIds:s}}=this,a=[...i,new Rt(n,t.type)];return this.type=new hi(o,[...s,r],a),r}_valueToChildTypeId(t,n,r){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},n0=class extends $l{},r0=class extends $l{constructor(t){super(t),this._offsets=new zo(new Int32Array(0))}setValue(t,n,r){let i=this._typeIds.set(t,r).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[i]),s=this._offsets.set(t,o.length).buffer[t];o?.set(s,n)}};var $h=class extends zi{constructor(t){super(t),this._values=new Xs(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,Vs(n))}_flushPending(t,n){}};$h.prototype._flushPending=Rl.prototype._flushPending;var f_=class extends lt{visitNull(){return t0}visitBool(){return $y}visitInt(){return zr}visitInt8(){return jy}visitInt16(){return Yy}visitInt32(){return Wy}visitInt64(){return Gy}visitUint8(){return Xy}visitUint16(){return Hy}visitUint32(){return Zy}visitUint64(){return Ky}visitFloat(){return cc}visitFloat16(){return zy}visitFloat32(){return qy}visitFloat64(){return Vy}visitUtf8(){return $h}visitBinary(){return Rl}visitFixedSizeBinary(){return Sh}visitDate(){return sc}visitDateDay(){return wh}visitDateMillisecond(){return _h}visitTimestamp(){return Ho}visitTimestampSecond(){return Nh}visitTimestampMillisecond(){return Oh}visitTimestampMicrosecond(){return Bh}visitTimestampNanosecond(){return Fh}visitTime(){return Zo}visitTimeSecond(){return Ch}visitTimeMillisecond(){return Lh}visitTimeMicrosecond(){return kh}visitTimeNanosecond(){return Rh}visitDecimal(){return vh}visitList(){return Qy}visitStruct(){return e0}visitUnion(){return $l}visitDenseUnion(){return r0}visitSparseUnion(){return n0}visitDictionary(){return Py}visitInterval(){return lc}visitIntervalDayTime(){return Ih}visitIntervalYearMonth(){return Mh}visitDuration(){return Xo}visitDurationSecond(){return Ah}visitDurationMillisecond(){return Th}visitDurationMicrosecond(){return Eh}visistDurationNanosecond(){return Dh}visitFixedSizeList(){return Uy}visitMap(){return Jy}},P6=new f_;var bt=class extends lt{compareSchemas(t,n){return t===n||n instanceof t.constructor&&this.compareManyFields(t.fields,n.fields)}compareManyFields(t,n){return t===n||Array.isArray(t)&&Array.isArray(n)&&t.length===n.length&&t.every((r,i)=>this.compareFields(r,n[i]))}compareFields(t,n){return t===n||n instanceof t.constructor&&t.name===n.name&&t.nullable===n.nullable&&this.visit(t.type,n.type)}};function Un(e,t){return t instanceof e.constructor}function Ph(e,t){return e===t||Un(e,t)}function Ko(e,t){return e===t||Un(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function i0(e,t){return e===t||Un(e,t)&&e.precision===t.precision}function JL(e,t){return e===t||Un(e,t)&&e.byteWidth===t.byteWidth}function h_(e,t){return e===t||Un(e,t)&&e.unit===t.unit}function Uh(e,t){return e===t||Un(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function zh(e,t){return e===t||Un(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function t7(e,t){return e===t||Un(e,t)&&e.children.length===t.children.length&&Gi.compareManyFields(e.children,t.children)}function e7(e,t){return e===t||Un(e,t)&&e.children.length===t.children.length&&Gi.compareManyFields(e.children,t.children)}function d_(e,t){return e===t||Un(e,t)&&e.mode===t.mode&&e.typeIds.every((n,r)=>n===t.typeIds[r])&&Gi.compareManyFields(e.children,t.children)}function n7(e,t){return e===t||Un(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Gi.visit(e.indices,t.indices)&&Gi.visit(e.dictionary,t.dictionary)}function p_(e,t){return e===t||Un(e,t)&&e.unit===t.unit}function qh(e,t){return e===t||Un(e,t)&&e.unit===t.unit}function r7(e,t){return e===t||Un(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Gi.compareManyFields(e.children,t.children)}function i7(e,t){return e===t||Un(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Gi.compareManyFields(e.children,t.children)}bt.prototype.visitNull=Ph;bt.prototype.visitBool=Ph;bt.prototype.visitInt=Ko;bt.prototype.visitInt8=Ko;bt.prototype.visitInt16=Ko;bt.prototype.visitInt32=Ko;bt.prototype.visitInt64=Ko;bt.prototype.visitUint8=Ko;bt.prototype.visitUint16=Ko;bt.prototype.visitUint32=Ko;bt.prototype.visitUint64=Ko;bt.prototype.visitFloat=i0;bt.prototype.visitFloat16=i0;bt.prototype.visitFloat32=i0;bt.prototype.visitFloat64=i0;bt.prototype.visitUtf8=Ph;bt.prototype.visitBinary=Ph;bt.prototype.visitFixedSizeBinary=JL;bt.prototype.visitDate=h_;bt.prototype.visitDateDay=h_;bt.prototype.visitDateMillisecond=h_;bt.prototype.visitTimestamp=Uh;bt.prototype.visitTimestampSecond=Uh;bt.prototype.visitTimestampMillisecond=Uh;bt.prototype.visitTimestampMicrosecond=Uh;bt.prototype.visitTimestampNanosecond=Uh;bt.prototype.visitTime=zh;bt.prototype.visitTimeSecond=zh;bt.prototype.visitTimeMillisecond=zh;bt.prototype.visitTimeMicrosecond=zh;bt.prototype.visitTimeNanosecond=zh;bt.prototype.visitDecimal=Ph;bt.prototype.visitList=t7;bt.prototype.visitStruct=e7;bt.prototype.visitUnion=d_;bt.prototype.visitDenseUnion=d_;bt.prototype.visitSparseUnion=d_;bt.prototype.visitDictionary=n7;bt.prototype.visitInterval=p_;bt.prototype.visitIntervalDayTime=p_;bt.prototype.visitIntervalYearMonth=p_;bt.prototype.visitDuration=qh;bt.prototype.visitDurationSecond=qh;bt.prototype.visitDurationMillisecond=qh;bt.prototype.visitDurationMicrosecond=qh;bt.prototype.visitDurationNanosecond=qh;bt.prototype.visitFixedSizeList=r7;bt.prototype.visitMap=i7;var Gi=new bt;function uc(e,t){return Gi.compareSchemas(e,t)}function U6(e,t){return Gi.compareFields(e,t)}function z6(e,t){return Gi.visit(e,t)}function ac(e){let t=e.type,n=new(P6.getVisitFn(t)())(e);if(t.children&&t.children.length>0){let r=e.children||[],i={nullValues:e.nullValues},o=Array.isArray(r)?(s,a)=>r[a]||i:({name:s})=>r[s]||i;for(let[s,a]of t.children.entries()){let{type:c}=a,l=o(a,s);n.children.push(ac(Object.assign(Object.assign({},l),{type:c})))}}return n}function o0(e,t){return o7(e,t.map(n=>n.data.concat()))}function o7(e,t){let n=[...e.fields],r=[],i={numBatches:t.reduce((f,h)=>Math.max(f,h.length),0)},o=0,s=0,a=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,a=-1;++a<c;)u[a]=l=t[a].shift(),s=Math.min(s,l?l.length:s);Number.isFinite(s)&&(u=s7(n,s,u,t,i),s>0&&(r[o++]=Dt({type:new he(n),length:s,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(f=>new De(e,f))]}function s7(e,t,n,r,i){var o;let s=(t+63&-64)>>3;for(let a=-1,c=r.length;++a<c;){let l=n[a],u=l?.length;if(u>=t)u===t?n[a]=l:(n[a]=l.slice(0,t),i.numBatches=Math.max(i.numBatches,r[a].unshift(l.slice(t,u-t))));else{let f=e[a];e[a]=f.clone({nullable:!0}),n[a]=(o=l?._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:Dt({type:f.type,length:t,nullCount:t,nullBitmap:new Uint8Array(s)})}}return n}var q6,ar=class e{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new te([]),this._offsets=[0],this;let i,o;t[0]instanceof te&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop());let s=c=>{if(c){if(c instanceof De)return[c];if(c instanceof e)return c.batches;if(c instanceof re){if(c.type instanceof he)return[new De(new te(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(l=>s(l));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(l=>s(l));if(typeof c=="object"){let l=Object.keys(c),u=l.map(d=>new zt([c[d]])),f=new te(l.map((d,p)=>new Rt(String(d),u[p].type))),[,h]=o0(f,u);return h.length===0?[new De(c)]:h}}}return[]},a=t.flatMap(c=>s(c));if(i=(r=i??((n=a[0])===null||n===void 0?void 0:n.schema))!==null&&r!==void 0?r:new te([]),!(i instanceof te))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof De))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!uc(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??Ty(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,n)=>t+n.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=Ay(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,n){}indexOf(t,n){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?Ol.visit(new zt(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
|
|
7
|
+
return true;`)}function WC(e){return typeof e!="bigint"?fi(e):`${fi(e)}n`}function s_(e,t){let n=Math.ceil(e)*t-1;return(n-n%64+64||64)/t}function j6(e,t=0){return e.length>=t?e.subarray(0,t):Gf(new e.constructor(t),e,0)}var xi=class{constructor(t,n=0,r=1){this.length=Math.ceil(n/r),this.buffer=new t(this.length),this.stride=r,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,n){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let n=this.stride,r=this.length*n,i=this.buffer.length;r>=i&&this._resize(i===0?s_(r*1,this.BYTES_PER_ELEMENT):s_(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=s_(t*this.stride,this.BYTES_PER_ELEMENT);let n=j6(this.buffer,t);return this.clear(),n}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=j6(this.buffer,t)}},Wo=class extends xi{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,n){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=n,this}},Ll=class extends Wo{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,n){let{buffer:r}=this.reserve(t-this.length+1),i=t>>3,o=t%8,s=r[i]>>o&1;return n?s===0&&(r[i]|=1<<o,++this.numValid):s===1&&(r[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},Fl=class extends Wo{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,n){let r=this.length-1,i=this.reserve(t-r+1).buffer;return r<t++&&r>=0&&i.fill(i[r],r,t),i[t]=i[t-1]+n,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(t+1)}};var be=class{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}constructor({type:t,nullValues:n}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=n,this.stride=Sr(t),this._nulls=new Ll,n&&n.length>0&&(this._isValid=V6(n))}toVector(){return new qt([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0,{_offsets:n,_values:r,_nulls:i,_typeIds:o,children:s}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),s.reduce((a,c)=>a+c.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((n,r)=>n+r.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,n){return this.setValid(t,this.isValid(n))&&this.setValue(t,n),this}setValue(t,n){this._setValue(this,t,n)}setValid(t,n){return this.length=this._nulls.set(t,+n).length,n}addChild(t,n=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,n,r,i,{type:o,length:s,nullCount:a,_typeIds:c,_offsets:l,_values:u,_nulls:f}=this;(n=c?.flush(s))?i=l?.flush(s):(i=l?.flush(s))?t=u?.flush(l.last()):t=u?.flush(s),a>0&&(r=f?.flush(s));let h=this.children.map(d=>d.flush());return this.clear(),At({type:o,length:s,nullCount:a,children:h,child:h[0],data:t,typeIds:n,nullBitmap:r,valueOffsets:i})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,n,r,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(n=this._values)===null||n===void 0||n.clear(),(r=this._offsets)===null||r===void 0||r.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(let o of this.children)o.clear();return this}};be.prototype.length=1;be.prototype.stride=1;be.prototype.children=null;be.prototype.finished=!1;be.prototype.nullValues=null;be.prototype._isValid=()=>!0;var Ve=class extends be{constructor(t){super(t),this._values=new Wo(this.ArrayType,0,this.stride)}setValue(t,n){let r=this._values;return r.reserve(t-r.length+1),super.setValue(t,n)}},cr=class extends be{constructor(t){super(t),this._pendingLength=0,this._offsets=new Fl(t.type)}setValue(t,n){let r=this._pending||(this._pending=new Map),i=r.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=n instanceof Vi?n[Pr].length:n.length,r.set(t,n)}setValid(t,n){return super.setValid(t,n)?!0:((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let t=this._pending,n=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,n),this}};var nc=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,n,r,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(r),t.writeInt64(BigInt(n??0)),t.offset()}};var Mr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFooter(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):oe.V1}schema(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new sr).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dictionaries(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new nc).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,n){let r=this.bb.__offset(this.bb_pos,10);return r?(n||new nc).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new tn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,n){t.addFieldInt16(0,n,oe.V1)}static addSchema(t,n){t.addFieldOffset(1,n,0)}static addDictionaries(t,n){t.addFieldOffset(2,n,0)}static startDictionariesVector(t,n){t.startVector(24,n,8)}static addRecordBatches(t,n){t.addFieldOffset(3,n,0)}static startRecordBatchesVector(t,n){t.startVector(24,n,8)}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,n){t.finish(n)}static finishSizePrefixedFooterBuffer(t,n){t.finish(n,void 0,!0)}};var ne=class e{constructor(t=[],n,r,i=oe.V5){this.fields=t||[],this.metadata=n||new Map,r||(r=a_(t)),this.dictionaries=r,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,n)=>`${n}: ${t}`).join(", ")} }>`}select(t){let n=new Set(t),r=this.fields.filter(i=>n.has(i.name));return new e(r,this.metadata)}selectAt(t){let n=t.map(r=>this.fields[r]).filter(Boolean);return new e(n,this.metadata)}assign(...t){let n=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),r=[...this.fields],i=ky(ky(new Map,this.metadata),n.metadata),o=n.fields.filter(a=>{let c=r.findIndex(l=>l.name===a.name);return~c?(r[c]=a.clone({metadata:ky(ky(new Map,r[c].metadata),a.metadata)}))&&!1:!0}),s=a_(o,new Map);return new e([...r,...o],i,new Map([...this.dictionaries,...s]))}};ne.prototype.fields=null;ne.prototype.metadata=null;ne.prototype.dictionaries=null;var Rt=class e{static new(...t){let[n,r,i,o]=t;return t[0]&&typeof t[0]=="object"&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),o===void 0&&(o=t[0].metadata)),new e(`${n}`,r,i,o)}constructor(t,n,r=!1,i){this.name=t,this.type=n,this.nullable=r,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[n,r,i,o]=t;return!t[0]||typeof t[0]!="object"?[n=this.name,r=this.type,i=this.nullable,o=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=t[0],e.new(n,r,i,o)}};Rt.prototype.type=null;Rt.prototype.name=null;Rt.prototype.nullable=null;Rt.prototype.metadata=null;function ky(e,t){return new Map([...e||new Map,...t||new Map])}function a_(e,t=new Map){for(let n=-1,r=e.length;++n<r;){let o=e[n].type;if(ot.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&a_(o.children,t)}return t}var GC=Ka,XC=wr,Go=class{static decode(t){t=new XC(wt(t));let n=Mr.getRootAsFooter(t),r=ne.decode(n.schema(),new Map,n.version());return new c_(r,n)}static encode(t){let n=new GC,r=ne.encode(n,t.schema);Mr.startRecordBatchesVector(n,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())Xo.encode(n,s);let i=n.endVector();Mr.startDictionariesVector(n,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())Xo.encode(n,s);let o=n.endVector();return Mr.startFooter(n),Mr.addSchema(n,r),Mr.addVersion(n,oe.V5),Mr.addRecordBatches(n,i),Mr.addDictionaries(n,o),Mr.finishFooterBuffer(n,Mr.endFooter(n)),n.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,n=oe.V5,r,i){this.schema=t,this.version=n,r&&(this._recordBatches=r),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,n=-1,r=this.numRecordBatches;++n<r;)(t=this.getRecordBatch(n))&&(yield t)}*dictionaryBatches(){for(let t,n=-1,r=this.numDictionaries;++n<r;)(t=this.getDictionaryBatch(n))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}};var c_=class extends Go{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,n){super(t,n.version()),this._footer=n}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let n=this._footer.recordBatches(t);if(n)return Xo.decode(n)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let n=this._footer.dictionaries(t);if(n)return Xo.decode(n)}return null}},Xo=class e{static decode(t){return new e(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,n){let{metaDataLength:r}=n,i=BigInt(n.offset),o=BigInt(n.bodyLength);return nc.createBlock(t,i,r,o)}constructor(t,n,r){this.metaDataLength=t,this.offset=Ae(r),this.bodyLength=Ae(n)}};var ge=Object.freeze({done:!0,value:void 0}),dh=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},rc=class{tee(){return this._getDOMStream().tee()}pipe(t,n){return this._getNodeStream().pipe(t,n)}pipeTo(t,n){return this._getDOMStream().pipeTo(t,n)}pipeThrough(t,n){return this._getDOMStream().pipeThrough(t,n)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},Ry=class extends rc{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return H(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){let{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(ge);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return gn.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return gn.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return H(this,void 0,void 0,function*(){return yield this.abort(t),ge})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),ge})}read(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((n,r)=>{this.resolvers.push({resolve:n,reject:r})}):Promise.resolve(ge)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var ji=class extends Ry{write(t){if((t=wt(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Yf(this.toUint8Array(!0)):this.toUint8Array(!1).then(Yf)}toUint8Array(t=!1){return t?xr(this._values)[0]:H(this,void 0,void 0,function*(){var n,r,i,o;let s=[],a=0;try{for(var c=!0,l=ii(this),u;u=yield l.next(),n=u.done,!n;c=!0){o=u.value,c=!1;let f=o;s.push(f),a+=f.byteLength}}catch(f){r={error:f}}finally{try{!c&&!n&&(i=l.return)&&(yield i.call(l))}finally{if(r)throw r.error}}return xr(s,a)[0]})}},Yi=class{constructor(t){t&&(this.source=new l_(gn.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},zr=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof ji?this.source=new Ho(gn.fromAsyncIterable(t)):Wm(t)?this.source=new Ho(gn.fromNodeStream(t)):Wf(t)?this.source=new Ho(gn.fromDOMStream(t)):jm(t)?this.source=new Ho(gn.fromDOMStream(t.body)):oi(t)?this.source=new Ho(gn.fromIterable(t)):br(t)?this.source=new Ho(gn.fromAsyncIterable(t)):$r(t)&&(this.source=new Ho(gn.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},l_=class{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,n="read"){return this.source.next({cmd:n,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||ge)}return(t){return Object.create(this.source.return&&this.source.return(t)||ge)}},Ho=class{constructor(t){this.source=t,this._closedPromise=new Promise(n=>this._closedPromiseResolve=n)}cancel(t){return H(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,n="read"){return H(this,void 0,void 0,function*(){return yield this.source.next({cmd:n,size:t})})}throw(t){return H(this,void 0,void 0,function*(){let n=this.source.throw&&(yield this.source.throw(t))||ge;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}return(t){return H(this,void 0,void 0,function*(){let n=this.source.return&&(yield this.source.return(t))||ge;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}};var ph=class extends Yi{constructor(t,n){super(),this.position=0,this.buffer=wt(t),this.size=n===void 0?this.buffer.byteLength:n}readInt32(t){let{buffer:n,byteOffset:r}=this.readAt(t,4);return new DataView(n,r).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:n,size:r,position:i}=this;return n&&i<r?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(r,i+Math.min(r-i,t)),n.subarray(i,this.position)):null}readAt(t,n){let r=this.buffer,i=Math.min(this.size,t+n);return r?r.subarray(t,i):new Uint8Array(n)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}},na=class extends zr{constructor(t,n){super(),this.position=0,this._handle=t,typeof n=="number"?this.size=n:this._pending=H(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return H(this,void 0,void 0,function*(){let{buffer:n,byteOffset:r}=yield this.readAt(t,4);return new DataView(n,r).getInt32(0,!0)})}seek(t){return H(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return H(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:r,position:i}=this;if(n&&i<r){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=i,s=0,a=0,c=Math.min(r,o+Math.min(r-o,t)),l=new Uint8Array(Math.max(0,(this.position=c)-o));for(;(o+=a)<c&&(s+=a)<l.byteLength;)({bytesRead:a}=yield n.read(l,s,l.byteLength-s,o));return l}return null})}readAt(t,n){return H(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:i}=this;if(r&&t+n<i){let o=Math.min(i,t+n),s=new Uint8Array(o-t);return(yield r.read(s,0,n,t)).buffer}return new Uint8Array(n)})}close(){return H(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return H(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var f_={};Vs(f_,{BaseInt64:()=>mh,Int128:()=>yh,Int64:()=>Zo,Uint64:()=>Te});function Cl(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var kl=8,u_=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],mh=class{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let n=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),i=n[3]*r[3];this.buffer[0]=i&65535;let o=i>>>16;return i=n[2]*r[3],o+=i,i=n[3]*r[2]>>>0,o+=i,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<i?65536:0,this.buffer[1]+=o>>>16,this.buffer[1]+=n[1]*r[3]+n[2]*r[2]+n[3]*r[1],this.buffer[1]+=n[0]*r[3]+n[1]*r[2]+n[2]*r[1]+n[3]*r[0]<<16,this}_plus(t){let n=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],n<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=n}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${Cl(this.buffer[1])} ${Cl(this.buffer[0])}`}},Te=class e extends mh{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,n=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(2)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(2)){let r=t.length,i=new e(n);for(let o=0;o<r;){let s=kl<r-o?kl:r-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),c=new e(new Uint32Array([u_[s],0]));i.times(c),i.plus(a),o+=s}return i}static convertArray(t){let n=new Uint32Array(t.length*2);for(let r=-1,i=t.length;++r<i;)e.from(t[r],new Uint32Array(n.buffer,n.byteOffset+2*r*4,2));return n}static multiply(t,n){return new e(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new e(new Uint32Array(t.buffer)).plus(n)}},Zo=class e extends mh{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){let n=this.buffer[1]<<0,r=t.buffer[1]<<0;return n<r||n===r&&this.buffer[0]<t.buffer[0]}static from(t,n=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(2)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(2)){let r=t.startsWith("-"),i=t.length,o=new e(n);for(let s=r?1:0;s<i;){let a=kl<i-s?kl:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),l=new e(new Uint32Array([u_[a],0]));o.times(l),o.plus(c),s+=a}return r?o.negate():o}static convertArray(t){let n=new Uint32Array(t.length*2);for(let r=-1,i=t.length;++r<i;)e.from(t[r],new Uint32Array(n.buffer,n.byteOffset+2*r*4,2));return n}static multiply(t,n){return new e(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new e(new Uint32Array(t.buffer)).plus(n)}},yh=class e{constructor(t){this.buffer=t}high(){return new Zo(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Zo(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(t){let n=new Te(new Uint32Array([this.buffer[3],0])),r=new Te(new Uint32Array([this.buffer[2],0])),i=new Te(new Uint32Array([this.buffer[1],0])),o=new Te(new Uint32Array([this.buffer[0],0])),s=new Te(new Uint32Array([t.buffer[3],0])),a=new Te(new Uint32Array([t.buffer[2],0])),c=new Te(new Uint32Array([t.buffer[1],0])),l=new Te(new Uint32Array([t.buffer[0],0])),u=Te.multiply(o,l);this.buffer[0]=u.low();let f=new Te(new Uint32Array([u.high(),0]));return u=Te.multiply(i,l),f.plus(u),u=Te.multiply(o,c),f.plus(u),this.buffer[1]=f.low(),this.buffer[3]=f.lessThan(u)?1:0,this.buffer[2]=f.high(),new Te(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Te.multiply(r,l)).plus(Te.multiply(i,c)).plus(Te.multiply(o,a)),this.buffer[3]+=Te.multiply(n,l).plus(Te.multiply(r,c)).plus(Te.multiply(i,a)).plus(Te.multiply(o,s)).low(),this}plus(t){let n=new Uint32Array(4);return n[3]=this.buffer[3]+t.buffer[3]>>>0,n[2]=this.buffer[2]+t.buffer[2]>>>0,n[1]=this.buffer[1]+t.buffer[1]>>>0,n[0]=this.buffer[0]+t.buffer[0]>>>0,n[0]<this.buffer[0]>>>0&&++n[1],n[1]<this.buffer[1]>>>0&&++n[2],n[2]<this.buffer[2]>>>0&&++n[3],this.buffer[3]=n[3],this.buffer[2]=n[2],this.buffer[1]=n[1],this.buffer[0]=n[0],this}hex(){return`${Cl(this.buffer[3])} ${Cl(this.buffer[2])} ${Cl(this.buffer[1])} ${Cl(this.buffer[0])}`}static multiply(t,n){return new e(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new e(new Uint32Array(t.buffer)).plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith("-"),i=t.length,o=new e(n);for(let s=r?1:0;s<i;){let a=kl<i-s?kl:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),l=new e(new Uint32Array([u_[a],0,0,0]));o.times(l),o.plus(c),s+=a}return r?o.negate():o}static convertArray(t){let n=new Uint32Array(t.length*4);for(let r=-1,i=t.length;++r<i;)e.from(t[r],new Uint32Array(n.buffer,n.byteOffset+4*4*r,4));return n}};var gh=class extends dt{constructor(t,n,r,i,o=oe.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=n,this.buffers=r,this.dictionaries=i,this.metadataVersion=o}visit(t){return super.visit(t instanceof Rt?t.type:t)}visitNull(t,{length:n}=this.nextFieldNode()){return At({type:t,length:n})}visitBool(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitInt(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFloat(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitUtf8(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDate(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTimestamp(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTime(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDecimal(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitList(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),children:this.visitMany(t.children)})}visitUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return this.metadataVersion<oe.V5&&this.readNullBitmap(t,r),t.mode===pe.Sparse?this.visitSparseUnion(t,{length:n,nullCount:r}):this.visitDenseUnion(t,{length:n,nullCount:r})}visitDenseUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDuration(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFixedSizeList(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),child:this.visit(t.children[0])})}visitMap(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,n,r=this.nextBufferRange()){return n>0&&this.readData(t,r)||new Uint8Array(0)}readOffsets(t,n){return this.readData(t,n)}readTypeIds(t,n){return this.readData(t,n)}readData(t,{length:n,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+n)}readDictionary(t){return this.dictionaries.get(t.id)}},$y=class extends gh{constructor(t,n,r,i,o){super(new Uint8Array(0),n,r,i,o),this.sources=t}readNullBitmap(t,n,{offset:r}=this.nextBufferRange()){return n<=0?new Uint8Array(0):tc(this.sources[r])}readOffsets(t,{offset:n}=this.nextBufferRange()){return kt(Uint8Array,kt(t.OffsetArrayType,this.sources[n]))}readTypeIds(t,{offset:n}=this.nextBufferRange()){return kt(Uint8Array,kt(t.ArrayType,this.sources[n]))}readData(t,{offset:n}=this.nextBufferRange()){let{sources:r}=this;return ot.isTimestamp(t)?kt(Uint8Array,Zo.convertArray(r[n])):(ot.isInt(t)||ot.isTime(t))&&t.bitWidth===64||ot.isDuration(t)?kt(Uint8Array,Zo.convertArray(r[n])):ot.isDate(t)&&t.unit===ze.MILLISECOND?kt(Uint8Array,Zo.convertArray(r[n])):ot.isDecimal(t)?kt(Uint8Array,yh.convertArray(r[n])):ot.isBinary(t)||ot.isLargeBinary(t)||ot.isFixedSizeBinary(t)?HC(r[n]):ot.isBool(t)?tc(r[n]):ot.isUtf8(t)||ot.isLargeUtf8(t)?Ri(r[n].join("")):kt(Uint8Array,kt(t.ArrayType,r[n].map(i=>+i)))}};function HC(e){let t=e.join(""),n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r>>1]=Number.parseInt(t.slice(r,r+2),16);return n}var Rl=class extends cr{constructor(t){super(t),this._values=new xi(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,wt(n))}_flushPending(t,n){let r=this._offsets,i=this._values.reserve(n).buffer,o=0;for(let[s,a]of t)if(a===void 0)r.set(s,0);else{let c=a.length;i.set(a,o),r.set(s,c),o+=c}}};var $l=class extends cr{constructor(t){super(t),this._values=new xi(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,wt(n))}_flushPending(t,n){let r=this._offsets,i=this._values.reserve(n).buffer,o=0;for(let[s,a]of t)if(a===void 0)r.set(s,BigInt(0));else{let c=a.length;i.set(a,o),r.set(s,BigInt(c)),o+=c}}};var Uy=class extends be{constructor(t){super(t),this._values=new Ll}setValue(t,n){this._values.set(t,+n)}};var ic=class extends Ve{};ic.prototype._setValue=jw;var bh=class extends ic{};bh.prototype._setValue=fy;var xh=class extends ic{};xh.prototype._setValue=hy;var wh=class extends Ve{};wh.prototype._setValue=Gw;var Py=class extends be{constructor({type:t,nullValues:n,dictionaryHashFunction:r}){super({type:new vr(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=oc({type:this.type.indices,nullValues:n}),this.dictionary=oc({type:this.type.dictionary,nullValues:null}),typeof r=="function"&&(this.valueToKey=r)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,n){let r=this.indices;return n=r.setValid(t,n),this.length=r.length,n}setValue(t,n){let r=this._keysToIndices,i=this.valueToKey(n),o=r[i];return o===void 0&&(r[i]=o=this._dictionaryOffset+this.dictionary.append(n).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,n=this._dictionary,r=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=n?n.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}};var _h=class extends Ve{};_h.prototype._setValue=Vw;var zy=class extends be{setValue(t,n){let[r]=this.children,i=t*this.stride;for(let o=-1,s=n.length;++o<s;)r.set(i+o,n[o])}addChild(t,n="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let r=this.children.push(t);return this.type=new yi(this.type.listSize,new Rt(n,t.type,!0)),r}};var sc=class extends Ve{setValue(t,n){this._values.set(t,n)}},qy=class extends sc{setValue(t,n){super.setValue(t,ch(n))}},Vy=class extends sc{},jy=class extends sc{};var ac=class extends Ve{};ac.prototype._setValue=Xw;var vh=class extends ac{};vh.prototype._setValue=_y;var Sh=class extends ac{};Sh.prototype._setValue=vy;var Ko=class extends Ve{};Ko.prototype._setValue=Hw;var Mh=class extends Ko{};Mh.prototype._setValue=Sy;var Ih=class extends Ko{};Ih.prototype._setValue=My;var Ah=class extends Ko{};Ah.prototype._setValue=Iy;var Th=class extends Ko{};Th.prototype._setValue=Ay;var qr=class extends Ve{setValue(t,n){this._values.set(t,n)}},Yy=class extends qr{},Wy=class extends qr{},Gy=class extends qr{},Xy=class extends qr{},Hy=class extends qr{},Zy=class extends qr{},Ky=class extends qr{},Qy=class extends qr{};var Jy=class extends cr{constructor(t){super(t),this._offsets=new Fl(t.type)}addChild(t,n="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new pi(new Rt(n,t.type,!0)),this.numChildren-1}_flushPending(t){let n=this._offsets,[r]=this.children;for(let[i,o]of t)if(typeof o>"u")n.set(i,0);else{let s=o,a=s.length,c=n.set(i,a).buffer[i];for(let l=-1;++l<a;)r.set(c+l,s[l])}}};var t0=class extends cr{set(t,n){return super.set(t,n)}setValue(t,n){let r=n instanceof Map?n:new Map(Object.entries(n)),i=this._pending||(this._pending=new Map),o=i.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=r.size,i.set(t,r)}addChild(t,n=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new gi(new Rt(n,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let n=this._offsets,[r]=this.children;for(let[i,o]of t)if(o===void 0)n.set(i,0);else{let{[i]:s,[i+1]:a}=n.set(i,o.size).buffer;for(let c of o.entries())if(r.set(s,c),++s>=a)break}}};var e0=class extends be{setValue(t,n){}setValid(t,n){return this.length=Math.max(t+1,this.length),n}};var n0=class extends be{setValue(t,n){let{children:r,type:i}=this;switch(Array.isArray(n)||n.constructor){case!0:return i.children.forEach((o,s)=>r[s].set(t,n[s]));case Map:return i.children.forEach((o,s)=>r[s].set(t,n.get(o.name)));default:return i.children.forEach((o,s)=>r[s].set(t,n[o.name]))}}setValid(t,n){return super.setValid(t,n)||this.children.forEach(r=>r.setValid(t,n)),n}addChild(t,n=`${this.numChildren}`){let r=this.children.push(t);return this.type=new ye([...this.type.children,new Rt(n,t.type,!0)]),r}};var Qo=class extends Ve{};Qo.prototype._setValue=Yw;var Eh=class extends Qo{};Eh.prototype._setValue=dy;var Dh=class extends Qo{};Dh.prototype._setValue=py;var Nh=class extends Qo{};Nh.prototype._setValue=my;var Bh=class extends Qo{};Bh.prototype._setValue=yy;var Jo=class extends Ve{};Jo.prototype._setValue=Ww;var Oh=class extends Jo{};Oh.prototype._setValue=gy;var Lh=class extends Jo{};Lh.prototype._setValue=by;var Fh=class extends Jo{};Fh.prototype._setValue=xy;var Ch=class extends Jo{};Ch.prototype._setValue=wy;var Ul=class extends be{constructor(t){super(t),this._typeIds=new Wo(Int8Array,0,1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,n){return this.set(this.length,t,n)}set(t,n,r){return r===void 0&&(r=this._valueToChildTypeId(this,n,t)),this.setValue(t,n,r),this}setValue(t,n,r){this._typeIds.set(t,r);let i=this.type.typeIdToChildIndex[r],o=this.children[i];o?.set(t,n)}addChild(t,n=`${this.children.length}`){let r=this.children.push(t),{type:{children:i,mode:o,typeIds:s}}=this,a=[...i,new Rt(n,t.type)];return this.type=new mi(o,[...s,r],a),r}_valueToChildTypeId(t,n,r){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},r0=class extends Ul{},i0=class extends Ul{constructor(t){super(t),this._offsets=new Wo(Int32Array)}setValue(t,n,r){let i=this._typeIds.set(t,r).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[i]),s=this._offsets.set(t,o.length).buffer[t];o?.set(s,n)}};var kh=class extends cr{constructor(t){super(t),this._values=new xi(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,Ri(n))}_flushPending(t,n){}};kh.prototype._flushPending=Rl.prototype._flushPending;var Rh=class extends cr{constructor(t){super(t),this._values=new xi(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,Ri(n))}_flushPending(t,n){}};Rh.prototype._flushPending=$l.prototype._flushPending;var h_=class extends dt{visitNull(){return e0}visitBool(){return Uy}visitInt(){return qr}visitInt8(){return Yy}visitInt16(){return Wy}visitInt32(){return Gy}visitInt64(){return Xy}visitUint8(){return Hy}visitUint16(){return Zy}visitUint32(){return Ky}visitUint64(){return Qy}visitFloat(){return sc}visitFloat16(){return qy}visitFloat32(){return Vy}visitFloat64(){return jy}visitUtf8(){return kh}visitLargeUtf8(){return Rh}visitBinary(){return Rl}visitLargeBinary(){return $l}visitFixedSizeBinary(){return _h}visitDate(){return ic}visitDateDay(){return bh}visitDateMillisecond(){return xh}visitTimestamp(){return Qo}visitTimestampSecond(){return Eh}visitTimestampMillisecond(){return Dh}visitTimestampMicrosecond(){return Nh}visitTimestampNanosecond(){return Bh}visitTime(){return Jo}visitTimeSecond(){return Oh}visitTimeMillisecond(){return Lh}visitTimeMicrosecond(){return Fh}visitTimeNanosecond(){return Ch}visitDecimal(){return wh}visitList(){return Jy}visitStruct(){return n0}visitUnion(){return Ul}visitDenseUnion(){return i0}visitSparseUnion(){return r0}visitDictionary(){return Py}visitInterval(){return ac}visitIntervalDayTime(){return vh}visitIntervalYearMonth(){return Sh}visitDuration(){return Ko}visitDurationSecond(){return Mh}visitDurationMillisecond(){return Ih}visitDurationMicrosecond(){return Ah}visitDurationNanosecond(){return Th}visitFixedSizeList(){return zy}visitMap(){return t0}},Y6=new h_;var gt=class extends dt{compareSchemas(t,n){return t===n||n instanceof t.constructor&&this.compareManyFields(t.fields,n.fields)}compareManyFields(t,n){return t===n||Array.isArray(t)&&Array.isArray(n)&&t.length===n.length&&t.every((r,i)=>this.compareFields(r,n[i]))}compareFields(t,n){return t===n||n instanceof t.constructor&&t.name===n.name&&t.nullable===n.nullable&&this.visit(t.type,n.type)}};function Vn(e,t){return t instanceof e.constructor}function cc(e,t){return e===t||Vn(e,t)}function ts(e,t){return e===t||Vn(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function o0(e,t){return e===t||Vn(e,t)&&e.precision===t.precision}function ZC(e,t){return e===t||Vn(e,t)&&e.byteWidth===t.byteWidth}function d_(e,t){return e===t||Vn(e,t)&&e.unit===t.unit}function $h(e,t){return e===t||Vn(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Uh(e,t){return e===t||Vn(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function KC(e,t){return e===t||Vn(e,t)&&e.children.length===t.children.length&&Wi.compareManyFields(e.children,t.children)}function QC(e,t){return e===t||Vn(e,t)&&e.children.length===t.children.length&&Wi.compareManyFields(e.children,t.children)}function p_(e,t){return e===t||Vn(e,t)&&e.mode===t.mode&&e.typeIds.every((n,r)=>n===t.typeIds[r])&&Wi.compareManyFields(e.children,t.children)}function JC(e,t){return e===t||Vn(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Wi.visit(e.indices,t.indices)&&Wi.visit(e.dictionary,t.dictionary)}function m_(e,t){return e===t||Vn(e,t)&&e.unit===t.unit}function Ph(e,t){return e===t||Vn(e,t)&&e.unit===t.unit}function tk(e,t){return e===t||Vn(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Wi.compareManyFields(e.children,t.children)}function ek(e,t){return e===t||Vn(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Wi.compareManyFields(e.children,t.children)}gt.prototype.visitNull=cc;gt.prototype.visitBool=cc;gt.prototype.visitInt=ts;gt.prototype.visitInt8=ts;gt.prototype.visitInt16=ts;gt.prototype.visitInt32=ts;gt.prototype.visitInt64=ts;gt.prototype.visitUint8=ts;gt.prototype.visitUint16=ts;gt.prototype.visitUint32=ts;gt.prototype.visitUint64=ts;gt.prototype.visitFloat=o0;gt.prototype.visitFloat16=o0;gt.prototype.visitFloat32=o0;gt.prototype.visitFloat64=o0;gt.prototype.visitUtf8=cc;gt.prototype.visitLargeUtf8=cc;gt.prototype.visitBinary=cc;gt.prototype.visitLargeBinary=cc;gt.prototype.visitFixedSizeBinary=ZC;gt.prototype.visitDate=d_;gt.prototype.visitDateDay=d_;gt.prototype.visitDateMillisecond=d_;gt.prototype.visitTimestamp=$h;gt.prototype.visitTimestampSecond=$h;gt.prototype.visitTimestampMillisecond=$h;gt.prototype.visitTimestampMicrosecond=$h;gt.prototype.visitTimestampNanosecond=$h;gt.prototype.visitTime=Uh;gt.prototype.visitTimeSecond=Uh;gt.prototype.visitTimeMillisecond=Uh;gt.prototype.visitTimeMicrosecond=Uh;gt.prototype.visitTimeNanosecond=Uh;gt.prototype.visitDecimal=cc;gt.prototype.visitList=KC;gt.prototype.visitStruct=QC;gt.prototype.visitUnion=p_;gt.prototype.visitDenseUnion=p_;gt.prototype.visitSparseUnion=p_;gt.prototype.visitDictionary=JC;gt.prototype.visitInterval=m_;gt.prototype.visitIntervalDayTime=m_;gt.prototype.visitIntervalYearMonth=m_;gt.prototype.visitDuration=Ph;gt.prototype.visitDurationSecond=Ph;gt.prototype.visitDurationMillisecond=Ph;gt.prototype.visitDurationMicrosecond=Ph;gt.prototype.visitDurationNanosecond=Ph;gt.prototype.visitFixedSizeList=tk;gt.prototype.visitMap=ek;var Wi=new gt;function lc(e,t){return Wi.compareSchemas(e,t)}function W6(e,t){return Wi.compareFields(e,t)}function G6(e,t){return Wi.visit(e,t)}function oc(e){let t=e.type,n=new(Y6.getVisitFn(t)())(e);if(t.children&&t.children.length>0){let r=e.children||[],i={nullValues:e.nullValues},o=Array.isArray(r)?(s,a)=>r[a]||i:({name:s})=>r[s]||i;for(let[s,a]of t.children.entries()){let{type:c}=a,l=o(a,s);n.children.push(oc(Object.assign(Object.assign({},l),{type:c})))}}return n}function s0(e,t){return nk(e,t.map(n=>n.data.concat()))}function nk(e,t){let n=[...e.fields],r=[],i={numBatches:t.reduce((f,h)=>Math.max(f,h.length),0)},o=0,s=0,a=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,a=-1;++a<c;)u[a]=l=t[a].shift(),s=Math.min(s,l?l.length:s);Number.isFinite(s)&&(u=rk(n,s,u,t,i),s>0&&(r[o++]=At({type:new ye(n),length:s,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(f=>new Be(e,f))]}function rk(e,t,n,r,i){var o;let s=(t+63&-64)>>3;for(let a=-1,c=r.length;++a<c;){let l=n[a],u=l?.length;if(u>=t)u===t?n[a]=l:(n[a]=l.slice(0,t),i.numBatches=Math.max(i.numBatches,r[a].unshift(l.slice(t,u-t))));else{let f=e[a];e[a]=f.clone({nullable:!0}),n[a]=(o=l?._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:At({type:f.type,length:t,nullCount:t,nullBitmap:new Uint8Array(s)})}}return n}var X6,lr=class e{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new ne([]),this._offsets=[0],this;let i,o;t[0]instanceof ne&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop());let s=c=>{if(c){if(c instanceof Be)return[c];if(c instanceof e)return c.batches;if(c instanceof Kt){if(c.type instanceof ye)return[new Be(new ne(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(l=>s(l));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(l=>s(l));if(typeof c=="object"){let l=Object.keys(c),u=l.map(d=>new qt([c[d]])),f=i??new ne(l.map((d,p)=>new Rt(String(d),u[p].type,u[p].nullable))),[,h]=s0(f,u);return h.length===0?[new Be(c)]:h}}}return[]},a=t.flatMap(c=>s(c));if(i=(r=i??((n=a[0])===null||n===void 0?void 0:n.schema))!==null&&r!==void 0?r:new ne([]),!(i instanceof ne))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof Be))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!lc(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??By(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,n)=>t+n.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=Ny(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,n){}indexOf(t,n){return-1}[Symbol.iterator](){return this.batches.length>0?Ol.visit(new qt(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
|
|
8
8
|
${this.toArray().join(`,
|
|
9
9
|
`)}
|
|
10
|
-
]`}concat(...t){let n=this.schema,r=this.data.concat(t.flatMap(({data:i})=>i));return new e(n,r.map(i=>new De(n,i)))}slice(t,n){let r=this.schema;[t,n]=Jf({length:this.numRows},t,n);let i=Ey(this.data,this._offsets,t,n);return new e(r,i.map(o=>new De(r,o)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(n=>n.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){let n=this.data.map(r=>r.children[t]);if(n.length===0){let{type:r}=this.schema.fields[t],i=Dt({type:r,length:0,nullCount:0});n.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new zt(n)}return null}setChild(t,n){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===t),n)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&t<this.numCols){n||(n=new zt([Dt({type:new Pn,length:this.numRows})]));let o=r.fields.slice(),s=o[t].clone({type:n.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[o[t],a[t]]=[s,n],[r,i]=o0(r,a)}return new e(r,i)}select(t){let n=this.schema.fields.reduce((r,i,o)=>r.set(i.name,o),new Map);return this.selectAt(t.map(r=>n.get(r)).filter(r=>r>-1))}selectAt(t){let n=this.schema.selectAt(t),r=this.batches.map(i=>i.selectAt(t));return new e(n,r)}assign(t){let n=this.schema.fields,[r,i]=t.schema.fields.reduce((a,c,l)=>{let[u,f]=a,h=n.findIndex(d=>d.name===c.name);return~h?f[h]=l:u.push(l),a},[[],[]]),o=this.schema.assign(t.schema),s=[...n.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...r.map(a=>t.getChildAt(a))].filter(Boolean);return new e(...o0(o,s))}};q6=Symbol.toStringTag;ar[q6]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=Gs(nh),e.get=Gs(Ue.getVisitFn(F.Struct)),e.set=Dy(mn.getVisitFn(F.Struct)),e.indexOf=Ny(nc.getVisitFn(F.Struct)),e.getByteLength=Gs(wr.getVisitFn(F.Struct)),"Table"))(ar.prototype);var j6,De=class e{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof te))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=Dt({nullCount:0,type:new he(this.schema.fields),children:this.schema.fields.map(n=>Dt({type:n.type,nullCount:0}))})]=t,!(this.data instanceof re))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=V6(this.schema,this.data.children);break}case 1:{let[n]=t,{fields:r,children:i,length:o}=Object.keys(n).reduce((c,l,u)=>(c.children[u]=n[l],c.length=Math.max(c.length,n[l].length),c.fields[u]=Rt.new({name:l,type:n[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),s=new te(r),a=Dt({type:new he(r),length:o,children:i,nullCount:0});[this.schema,this.data]=V6(s,a.children,o);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=Y6(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return Ue.visit(this.data,t)}set(t,n){return mn.visit(this.data,t,n)}indexOf(t,n){return nc.visit(this.data,t,n)}getByteLength(t){return wr.visit(this.data,t)}[Symbol.iterator](){return Ol.visit(new zt([this.data]))}toArray(){return[...this]}concat(...t){return new ar(this.schema,[this,...t])}slice(t,n){let[r]=new zt([this.data]).slice(t,n).data;return new e(this.schema,r)}getChild(t){var n;return this.getChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new zt([this.data.children[t]]):null}setChild(t,n){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===t),n)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&t<this.numCols){n||(n=new zt([Dt({type:new Pn,length:this.numRows})]));let o=r.fields.slice(),s=i.children.slice(),a=o[t].clone({type:n.type});[o[t],s[t]]=[a,n.data[0]],r=new te(o,new Map(this.schema.metadata)),i=Dt({type:new he(o),children:s})}return new e(r,i)}select(t){let n=this.schema.select(t),r=new he(n.fields),i=[];for(let o of t){let s=this.schema.fields.findIndex(a=>a.name===o);~s&&(i[s]=this.data.children[s])}return new e(n,Dt({type:r,length:this.numRows,children:i}))}selectAt(t){let n=this.schema.selectAt(t),r=t.map(o=>this.data.children[o]).filter(Boolean),i=Dt({type:new he(n.fields),length:this.numRows,children:r});return new e(n,i)}};j6=Symbol.toStringTag;De[j6]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(De.prototype);function V6(e,t,n=t.reduce((r,i)=>Math.max(r,i.length),0)){var r;let i=[...e.fields],o=[...t],s=(n+63&-64)>>3;for(let[a,c]of e.fields.entries()){let l=t[a];(!l||l.length!==n)&&(i[a]=c.clone({nullable:!0}),o[a]=(r=l?._changeLengthAndBackfillNullBitmap(n))!==null&&r!==void 0?r:Dt({type:c.type,length:n,nullCount:n,nullBitmap:new Uint8Array(s)}))}return[e.assign(i),Dt({type:new he(i),length:n,children:o})]}function Y6(e,t,n=new Map){var r,i;if(((r=e?.length)!==null&&r!==void 0?r:0)>0&&e?.length===t?.length)for(let o=-1,s=e.length;++o<s;){let{type:a}=e[o],c=t[o];for(let l of[c,...((i=c?.dictionary)===null||i===void 0?void 0:i.data)||[]])Y6(a.children,l?.children,n);if(st.isDictionary(a)){let{id:l}=a;if(!n.has(l))c?.dictionary&&n.set(l,c.dictionary);else if(n.get(l)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return n}var fc=class extends De{constructor(t){let n=t.fields.map(i=>Dt({type:i.type})),r=Dt({type:new he(t.fields),nullCount:0,children:n});super(t,r)}};var Vh;(function(e){e[e.BUFFER=0]="BUFFER"})(Vh||(Vh={}));var jh;(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(jh||(jh={}));var s0=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBodyCompression(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):jh.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Vh.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,n){t.addFieldInt8(0,n,jh.LZ4_FRAME)}static addMethod(t,n){t.addFieldInt8(1,n,Vh.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,n,r){return e.startBodyCompression(t),e.addCodec(t,n),e.addMethod(t,r),e.endBodyCompression(t)}};var Pl=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,n,r){return t.prep(8,16),t.writeInt64(BigInt(r??0)),t.writeInt64(BigInt(n??0)),t.offset()}};var Ul=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,n,r){return t.prep(8,16),t.writeInt64(BigInt(r??0)),t.writeInt64(BigInt(n??0)),t.offset()}};var Sr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsRecordBatch(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new Ul).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new Pl).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new s0).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,n){t.addFieldInt64(0,n,BigInt("0"))}static addNodes(t,n){t.addFieldOffset(1,n,0)}static startNodesVector(t,n){t.startVector(16,n,8)}static addBuffers(t,n){t.addFieldOffset(2,n,0)}static startBuffersVector(t,n){t.startVector(16,n,8)}static addCompression(t,n){t.addFieldOffset(3,n,0)}static endRecordBatch(t){return t.endObject()}};var Qo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDictionaryBatch(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new Sr).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,n){t.addFieldInt64(0,n,BigInt("0"))}static addData(t,n){t.addFieldOffset(1,n,0)}static addIsDelta(t,n){t.addFieldInt8(2,+n,0)}static endDictionaryBatch(t){return t.endObject()}};var zl;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(zl||(zl={}));var wi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsMessage(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Hs.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):zl.NONE}header(t){let n=this.bb.__offset(this.bb_pos,8);return n?this.bb.__union(t,this.bb_pos+n):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new Qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,n){t.addFieldInt16(0,n,Hs.V1)}static addHeaderType(t,n){t.addFieldInt8(1,n,zl.NONE)}static addHeader(t,n){t.addFieldOffset(2,n,0)}static addBodyLength(t,n){t.addFieldInt64(3,n,BigInt("0"))}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,n){t.finish(n)}static finishSizePrefixedMessageBuffer(t,n){t.finish(n,void 0,!0)}static createMessage(t,n,r,i,o,s){return e.startMessage(t),e.addVersion(t,n),e.addHeaderType(t,r),e.addHeader(t,i),e.addBodyLength(t,o),e.addCustomMetadata(t,s),e.endMessage(t)}};var m_=class extends lt{visit(t,n){return t==null||n==null?void 0:super.visit(t,n)}visitNull(t,n){return fh.startNull(n),fh.endNull(n)}visitInt(t,n){return gi.startInt(n),gi.addBitWidth(n,t.bitWidth),gi.addIsSigned(n,t.isSigned),gi.endInt(n)}visitFloat(t,n){return ea.startFloatingPoint(n),ea.addPrecision(n,t.precision),ea.endFloatingPoint(n)}visitBinary(t,n){return oh.startBinary(n),oh.endBinary(n)}visitBool(t,n){return sh.startBool(n),sh.endBool(n)}visitUtf8(t,n){return ph.startUtf8(n),ph.endUtf8(n)}visitDecimal(t,n){return ji.startDecimal(n),ji.addScale(n,t.scale),ji.addPrecision(n,t.precision),ji.addBitWidth(n,t.bitWidth),ji.endDecimal(n)}visitDate(t,n){return Ks.startDate(n),Ks.addUnit(n,t.unit),Ks.endDate(n)}visitTime(t,n){return qo.startTime(n),qo.addUnit(n,t.unit),qo.addBitWidth(n,t.bitWidth),qo.endTime(n)}visitTimestamp(t,n){let r=t.timezone&&n.createString(t.timezone)||void 0;return Vo.startTimestamp(n),Vo.addUnit(n,t.unit),r!==void 0&&Vo.addTimezone(n,r),Vo.endTimestamp(n)}visitInterval(t,n){return na.startInterval(n),na.addUnit(n,t.unit),na.endInterval(n)}visitDuration(t,n){return Qs.startDuration(n),Qs.addUnit(n,t.unit),Qs.endDuration(n)}visitList(t,n){return uh.startList(n),uh.endList(n)}visitStruct(t,n){return hh.startStruct_(n),hh.endStruct_(n)}visitUnion(t,n){xi.startTypeIdsVector(n,t.typeIds.length);let r=xi.createTypeIdsVector(n,t.typeIds);return xi.startUnion(n),xi.addMode(n,t.mode),xi.addTypeIds(n,r),xi.endUnion(n)}visitDictionary(t,n){let r=this.visit(t.indices,n);return Vi.startDictionaryEncoding(n),Vi.addId(n,BigInt(t.id)),Vi.addIsOrdered(n,t.isOrdered),r!==void 0&&Vi.addIndexType(n,r),Vi.endDictionaryEncoding(n)}visitFixedSizeBinary(t,n){return Js.startFixedSizeBinary(n),Js.addByteWidth(n,t.byteWidth),Js.endFixedSizeBinary(n)}visitFixedSizeList(t,n){return ta.startFixedSizeList(n),ta.addListSize(n,t.listSize),ta.endFixedSizeList(n)}visitMap(t,n){return ra.startMap(n),ra.addKeysSorted(n,t.keysSorted),ra.endMap(n)}},a0=new m_;function H6(e,t=new Map){return new te(c7(e,t),c0(e.metadata),t)}function y_(e){return new yn(e.count,K6(e.columns),Q6(e.columns))}function Z6(e){return new lr(y_(e.data),e.id,e.isDelta)}function c7(e,t){return(e.fields||[]).filter(Boolean).map(n=>Rt.fromJSON(n,t))}function W6(e,t){return(e.children||[]).filter(Boolean).map(n=>Rt.fromJSON(n,t))}function K6(e){return(e||[]).reduce((t,n)=>[...t,new qr(n.count,l7(n.VALIDITY)),...K6(n.children)],[])}function Q6(e,t=[]){for(let n=-1,r=(e||[]).length;++n<r;){let i=e[n];i.VALIDITY&&t.push(new cr(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new cr(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new cr(t.length,i.OFFSET.length)),i.DATA&&t.push(new cr(t.length,i.DATA.length)),t=Q6(i.children,t)}return t}function l7(e){return(e||[]).reduce((t,n)=>t+ +(n===0),0)}function J6(e,t){let n,r,i,o,s,a;return!t||!(o=e.dictionary)?(s=X6(e,W6(e,t)),i=new Rt(e.name,s,e.nullable,c0(e.metadata))):t.has(n=o.id)?(r=(r=o.indexType)?G6(r):new $i,a=new br(t.get(n),r,n,o.isOrdered),i=new Rt(e.name,a,e.nullable,c0(e.metadata))):(r=(r=o.indexType)?G6(r):new $i,t.set(n,s=X6(e,W6(e,t))),a=new br(s,r,n,o.isOrdered),i=new Rt(e.name,a,e.nullable,c0(e.metadata))),i||null}function c0(e=[]){return new Map(e.map(({key:t,value:n})=>[t,n]))}function G6(e){return new Le(e.isSigned,e.bitWidth)}function X6(e,t){let n=e.type.name;switch(n){case"NONE":return new Pn;case"null":return new Pn;case"binary":return new Oo;case"utf8":return new Bo;case"bool":return new Fo;case"list":return new fi((t||[])[0]);case"struct":return new he(t||[]);case"struct_":return new he(t||[])}switch(n){case"int":{let r=e.type;return new Le(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=e.type;return new or(we[r.precision])}case"decimal":{let r=e.type;return new Co(r.scale,r.precision,r.bitWidth)}case"date":{let r=e.type;return new Lo(Tn[r.unit])}case"time":{let r=e.type;return new ui(pt[r.unit],r.bitWidth)}case"timestamp":{let r=e.type;return new ko(pt[r.unit],r.timezone)}case"interval":{let r=e.type;return new Ro(rr[r.unit])}case"duration":{let r=e.type;return new $o(pt[r.unit])}case"union":{let r=e.type,[i,...o]=(r.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new hi(me[s],r.typeIds||[],t||[])}case"fixedsizebinary":{let r=e.type;return new Po(r.byteWidth)}case"fixedsizelist":{let r=e.type;return new di(r.listSize,(t||[])[0])}case"map":{let r=e.type;return new pi((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var u7=ic,f7=_r,ur=class e{static fromJSON(t,n){let r=new e(0,Ie.V5,n);return r._createHeader=h7(t,n),r}static decode(t){t=new f7(Et(t));let n=wi.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),o=n.headerType(),s=new e(r,i,o);return s._createHeader=d7(n,o),s}static encode(t){let n=new u7,r=-1;return t.isSchema()?r=te.encode(n,t.header()):t.isRecordBatch()?r=yn.encode(n,t.header()):t.isDictionaryBatch()&&(r=lr.encode(n,t.header())),wi.startMessage(n),wi.addVersion(n,Ie.V5),wi.addHeader(n,r),wi.addHeaderType(n,t.headerType),wi.addBodyLength(n,BigInt(t.bodyLength)),wi.finishMessageBuffer(n,wi.endMessage(n)),n.asUint8Array()}static from(t,n=0){if(t instanceof te)return new e(0,Ie.V5,Ht.Schema,t);if(t instanceof yn)return new e(n,Ie.V5,Ht.RecordBatch,t);if(t instanceof lr)return new e(n,Ie.V5,Ht.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===Ht.Schema}isRecordBatch(){return this.headerType===Ht.RecordBatch}isDictionaryBatch(){return this.headerType===Ht.DictionaryBatch}constructor(t,n,r,i){this._version=n,this._headerType=r,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=ir(t)}},yn=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,n,r){this._nodes=n,this._buffers=r,this._length=ir(t)}},lr=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,n,r=!1){this._data=t,this._isDelta=r,this._id=ir(n)}},cr=class{constructor(t,n){this.offset=ir(t),this.length=ir(n)}},qr=class{constructor(t,n){this.length=ir(t),this.nullCount=ir(n)}};function h7(e,t){return()=>{switch(t){case Ht.Schema:return te.fromJSON(e);case Ht.RecordBatch:return yn.fromJSON(e);case Ht.DictionaryBatch:return lr.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${Ht[t]}, type: ${t} }`)}}function d7(e,t){return()=>{switch(t){case Ht.Schema:return te.decode(e.header(new sr),new Map,e.version());case Ht.RecordBatch:return yn.decode(e.header(new Sr),e.version());case Ht.DictionaryBatch:return lr.decode(e.header(new Qo),e.version())}throw new Error(`Unrecognized Message type: { name: ${Ht[t]}, type: ${t} }`)}}Rt.encode=I7;Rt.decode=v7;Rt.fromJSON=J6;te.encode=S7;te.decode=p7;te.fromJSON=H6;yn.encode=M7;yn.decode=m7;yn.fromJSON=y_;lr.encode=A7;lr.decode=y7;lr.fromJSON=Z6;qr.encode=T7;qr.decode=b7;cr.encode=E7;cr.decode=g7;function p7(e,t=new Map,n=Ie.V5){let r=_7(e,t);return new te(r,l0(e),t,n)}function m7(e,t=Ie.V5){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new yn(e.length(),x7(e),w7(e,t))}function y7(e,t=Ie.V5){return new lr(yn.decode(e.data(),t),e.id(),e.isDelta())}function g7(e){return new cr(e.offset(),e.length())}function b7(e){return new qr(e.length(),e.nullCount())}function x7(e){let t=[];for(let n,r=-1,i=-1,o=e.nodesLength();++r<o;)(n=e.nodes(r))&&(t[++i]=qr.decode(n));return t}function w7(e,t){let n=[];for(let r,i=-1,o=-1,s=e.buffersLength();++i<s;)(r=e.buffers(i))&&(t<Ie.V4&&(r.bb_pos+=8*(i+1)),n[++o]=cr.decode(r));return n}function _7(e,t){let n=[];for(let r,i=-1,o=-1,s=e.fieldsLength();++i<s;)(r=e.fields(i))&&(n[++o]=Rt.decode(r,t));return n}function tA(e,t){let n=[];for(let r,i=-1,o=-1,s=e.childrenLength();++i<s;)(r=e.children(i))&&(n[++o]=Rt.decode(r,t));return n}function v7(e,t){let n,r,i,o,s,a;return!t||!(a=e.dictionary())?(i=nA(e,tA(e,t)),r=new Rt(e.name(),i,e.nullable(),l0(e))):t.has(n=ir(a.id()))?(o=(o=a.indexType())?eA(o):new $i,s=new br(t.get(n),o,n,a.isOrdered()),r=new Rt(e.name(),s,e.nullable(),l0(e))):(o=(o=a.indexType())?eA(o):new $i,t.set(n,i=nA(e,tA(e,t))),s=new br(i,o,n,a.isOrdered()),r=new Rt(e.name(),s,e.nullable(),l0(e))),r||null}function l0(e){let t=new Map;if(e)for(let n,r,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(n=e.customMetadata(i))&&(r=n.key())!=null&&t.set(r,n.value());return t}function eA(e){return new Le(e.isSigned(),e.bitWidth())}function nA(e,t){let n=e.typeType();switch(n){case de.NONE:return new Pn;case de.Null:return new Pn;case de.Binary:return new Oo;case de.Utf8:return new Bo;case de.Bool:return new Fo;case de.List:return new fi((t||[])[0]);case de.Struct_:return new he(t||[])}switch(n){case de.Int:{let r=e.type(new gi);return new Le(r.isSigned(),r.bitWidth())}case de.FloatingPoint:{let r=e.type(new ea);return new or(r.precision())}case de.Decimal:{let r=e.type(new ji);return new Co(r.scale(),r.precision(),r.bitWidth())}case de.Date:{let r=e.type(new Ks);return new Lo(r.unit())}case de.Time:{let r=e.type(new qo);return new ui(r.unit(),r.bitWidth())}case de.Timestamp:{let r=e.type(new Vo);return new ko(r.unit(),r.timezone())}case de.Interval:{let r=e.type(new na);return new Ro(r.unit())}case de.Duration:{let r=e.type(new Qs);return new $o(r.unit())}case de.Union:{let r=e.type(new xi);return new hi(r.mode(),r.typeIdsArray()||[],t||[])}case de.FixedSizeBinary:{let r=e.type(new Js);return new Po(r.byteWidth())}case de.FixedSizeList:{let r=e.type(new ta);return new di(r.listSize(),(t||[])[0])}case de.Map:{let r=e.type(new ra);return new pi((t||[])[0],r.keysSorted())}}throw new Error(`Unrecognized type: "${de[n]}" (${n})`)}function S7(e,t){let n=t.fields.map(o=>Rt.encode(e,o));sr.startFieldsVector(e,n.length);let r=sr.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?sr.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),c=e.createString(`${s}`);return Qe.startKeyValue(e),Qe.addKey(e,a),Qe.addValue(e,c),Qe.endKeyValue(e)})):-1;return sr.startSchema(e),sr.addFields(e,r),sr.addEndianness(e,D7?Zs.Little:Zs.Big),i!==-1&&sr.addCustomMetadata(e,i),sr.endSchema(e)}function I7(e,t){let n=-1,r=-1,i=-1,o=t.type,s=t.typeId;st.isDictionary(o)?(s=o.dictionary.typeId,i=a0.visit(o,e),r=a0.visit(o.dictionary,e)):r=a0.visit(o,e);let a=(o.children||[]).map(u=>Rt.encode(e,u)),c=En.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?En.createCustomMetadataVector(e,[...t.metadata].map(([u,f])=>{let h=e.createString(`${u}`),d=e.createString(`${f}`);return Qe.startKeyValue(e),Qe.addKey(e,h),Qe.addValue(e,d),Qe.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),En.startField(e),En.addType(e,r),En.addTypeType(e,s),En.addChildren(e,c),En.addNullable(e,!!t.nullable),n!==-1&&En.addName(e,n),i!==-1&&En.addDictionary(e,i),l!==-1&&En.addCustomMetadata(e,l),En.endField(e)}function M7(e,t){let n=t.nodes||[],r=t.buffers||[];Sr.startNodesVector(e,n.length);for(let s of n.slice().reverse())qr.encode(e,s);let i=e.endVector();Sr.startBuffersVector(e,r.length);for(let s of r.slice().reverse())cr.encode(e,s);let o=e.endVector();return Sr.startRecordBatch(e),Sr.addLength(e,BigInt(t.length)),Sr.addNodes(e,i),Sr.addBuffers(e,o),Sr.endRecordBatch(e)}function A7(e,t){let n=yn.encode(e,t.data);return Qo.startDictionaryBatch(e),Qo.addId(e,BigInt(t.id)),Qo.addIsDelta(e,t.isDelta),Qo.addData(e,n),Qo.endDictionaryBatch(e)}function T7(e,t){return Ul.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function E7(e,t){return Pl.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var D7=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})();var b_=e=>`Expected ${Ht[e]} Message in stream, but was null or length 0.`,x_=e=>`Header pointer of flatbuffer-encoded ${Ht[e]} Message is null or length 0.`,rA=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,iA=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,ql=class{constructor(t){this.source=t instanceof Wi?t:new Wi(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?pe:t.value===-1&&(t=this.readMetadataLength()).done?pe:(t=this.readMetadata(t.value)).done?pe:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(b_(t));return n.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let n=Et(this.source.read(t));if(n.byteLength<t)throw new Error(iA(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()}readSchema(t=!1){let n=Ht.Schema,r=this.readMessage(n),i=r?.header();if(t&&!i)throw new Error(x_(n));return i}readMetadataLength(){let t=this.source.read(u0),n=t&&new _r(t),r=n?.readInt32(0)||0;return{done:r===0,value:r}}readMetadata(t){let n=this.source.read(t);if(!n)return pe;if(n.byteLength<t)throw new Error(rA(t,n.byteLength));return{done:!1,value:ur.decode(n)}}},Yh=class{constructor(t,n){this.source=t instanceof Ur?t:jm(t)?new ia(t,n):new Ur(t)}[Symbol.asyncIterator](){return this}next(){return H(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?pe:t.value===-1&&(t=yield this.readMetadataLength()).done?pe:(t=yield this.readMetadata(t.value)).done?pe:t})}throw(t){return H(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return H(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return H(this,void 0,void 0,function*(){let n;if((n=yield this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(b_(t));return n.value})}readMessageBody(t){return H(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let n=Et(yield this.source.read(t));if(n.byteLength<t)throw new Error(iA(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()})}readSchema(t=!1){return H(this,void 0,void 0,function*(){let n=Ht.Schema,r=yield this.readMessage(n),i=r?.header();if(t&&!i)throw new Error(x_(n));return i})}readMetadataLength(){return H(this,void 0,void 0,function*(){let t=yield this.source.read(u0),n=t&&new _r(t),r=n?.readInt32(0)||0;return{done:r===0,value:r}})}readMetadata(t){return H(this,void 0,void 0,function*(){let n=yield this.source.read(t);if(!n)return pe;if(n.byteLength<t)throw new Error(rA(t,n.byteLength));return{done:!1,value:ur.decode(n)}})}},Wh=class extends ql{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof mh?t:new mh(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:ur.fromJSON(t.schema,Ht.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let n=t.dictionaries[this._dictionaryIndex++];return this._body=n.data.columns,{done:!1,value:ur.fromJSON(n,Ht.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let n=t.batches[this._batchIndex++];return this._body=n.columns,{done:!1,value:ur.fromJSON(n,Ht.RecordBatch)}}return this._body=[],pe}readMessageBody(t){return n(this._body);function n(r){return(r||[]).reduce((i,o)=>[...i,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE_ID&&[o.TYPE_ID]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...n(o.children)],[])}}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(b_(t));return n.value}readSchema(){let t=Ht.Schema,n=this.readMessage(t),r=n?.header();if(!n||!r)throw new Error(x_(t));return r}},u0=4,g_="ARROW1",Vl=new Uint8Array(g_.length);for(let e=0;e<g_.length;e+=1)Vl[e]=g_.codePointAt(e);function f0(e,t=0){for(let n=-1,r=Vl.length;++n<r;)if(Vl[n]!==e[t+n])return!1;return!0}var jl=Vl.length,w_=jl+u0,oA=jl*2+u0;var Ir=class e extends oc{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){let n=this._impl.open(t);return yr(n)?n.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return pn.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return pn.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof e?t:qm(t)?O7(t):jm(t)?C7(t):yr(t)?H(this,void 0,void 0,function*(){return yield e.from(yield t)}):Ym(t)||Hf(t)||Gm(t)||Rr(t)?F7(new Ur(t)):B7(new Wi(t))}static readAll(t){return t instanceof e?t.isSync()?sA(t):aA(t):qm(t)||ArrayBuffer.isView(t)||oi(t)||Vm(t)?sA(t):aA(t)}},Jo=class extends Ir{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return mr(this,arguments,function*(){yield Ft(yield*vl(ii(this[Symbol.iterator]())))})}},hc=class extends Ir{constructor(t){super(t),this._impl=t}readAll(){var t,n,r,i;return H(this,void 0,void 0,function*(){let o=new Array;try{for(var s=!0,a=ii(this),c;c=yield a.next(),t=c.done,!t;s=!0){i=c.value,s=!1;let l=i;o.push(l)}}catch(l){n={error:l}}finally{try{!s&&!t&&(r=a.return)&&(yield r.call(a))}finally{if(n)throw n.error}}return o})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},dc=class extends Jo{constructor(t){super(t),this._impl=t}},h0=class extends hc{constructor(t){super(t),this._impl=t}},d0=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,n){let r=this._loadVectors(t,n,this.schema.fields),i=Dt({type:new he(this.schema.fields),length:t.length,children:r});return new De(this.schema,i)}_loadDictionaryBatch(t,n){let{id:r,isDelta:i}=t,{dictionaries:o,schema:s}=this,a=o.get(r);if(i||!a){let c=s.dictionaries.get(r),l=this._loadVectors(t.data,n,[c]);return(a&&i?a.concat(new zt(l)):new zt(l)).memoize()}return a.memoize()}_loadVectors(t,n,r){return new xh(n,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},Yl=class extends d0{constructor(t,n){super(n),this._reader=qm(t)?new Wh(this._handle=t):new ql(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=cA(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):pe}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):pe}next(){if(this.closed)return pe;let t,{_reader:n}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let r=t.header(),i=n.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),i=n.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new fc(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},Wl=class extends d0{constructor(t,n){super(n),this._reader=new Yh(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return H(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return H(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=cA(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):pe})}return(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):pe})}next(){return H(this,void 0,void 0,function*(){if(this.closed)return pe;let t,{_reader:n}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let r=t.header(),i=yield n.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),i=yield n.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new fc(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},p0=class extends Yl{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,n){super(t instanceof yh?t:new yh(t),n)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var n;if(this.closed)return null;this._footer||this.open();let r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(t);if(r&&this._handle.seek(r.offset)){let i=this._reader.readMessage(Ht.RecordBatch);if(i?.isRecordBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s)}}return null}_readDictionaryBatch(t){var n;let r=(n=this._footer)===null||n===void 0?void 0:n.getDictionaryBatch(t);if(r&&this._handle.seek(r.offset)){let i=this._reader.readMessage(Ht.DictionaryBatch);if(i?.isDictionaryBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}}_readFooter(){let{_handle:t}=this,n=t.size-w_,r=t.readInt32(n),i=t.readAt(n-r,r);return jo.decode(i)}_readNextMessageAndValidate(t){var n;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(this._recordBatchIndex);if(r&&this._handle.seek(r.offset))return this._reader.readMessage(t)}return null}},__=class extends Wl{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...n){let r=typeof n[0]!="number"?n.shift():void 0,i=n[0]instanceof Map?n.shift():void 0;super(t instanceof ia?t:new ia(t,r),i)}isFile(){return!0}isAsync(){return!0}open(t){let n=Object.create(null,{open:{get:()=>super.open}});return H(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield n.open.call(this,t)})}readRecordBatch(t){var n;return H(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());let r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(t);if(r&&(yield this._handle.seek(r.offset))){let i=yield this._reader.readMessage(Ht.RecordBatch);if(i?.isRecordBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s)}}return null})}_readDictionaryBatch(t){var n;return H(this,void 0,void 0,function*(){let r=(n=this._footer)===null||n===void 0?void 0:n.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){let i=yield this._reader.readMessage(Ht.DictionaryBatch);if(i?.isDictionaryBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}})}_readFooter(){return H(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let n=t.size-w_,r=yield t.readInt32(n),i=yield t.readAt(n-r,r);return jo.decode(i)})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=this._footer.getRecordBatch(this._recordBatchIndex);if(n&&(yield this._handle.seek(n.offset)))return yield this._reader.readMessage(t)}return null})}},v_=class extends Yl{constructor(t,n){super(t,n)}_loadVectors(t,n,r){return new Ry(n,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}};function cA(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*sA(e){let t=Ir.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function aA(e){return mr(this,arguments,function*(){let n=yield Ft(Ir.from(e));try{if(!(yield Ft(n.open({autoDestroy:!1}))).closed)do yield yield Ft(n);while(!(yield Ft(n.reset().open())).closed)}finally{yield Ft(n.cancel())}})}function O7(e){return new Jo(new v_(e))}function B7(e){let t=e.peek(jl+7&-8);return t&&t.byteLength>=4?f0(t)?new dc(new p0(e.read())):new Jo(new Yl(e)):new Jo(new Yl(function*(){}()))}function F7(e){return H(this,void 0,void 0,function*(){let t=yield e.peek(jl+7&-8);return t&&t.byteLength>=4?f0(t)?new dc(new p0(yield e.read())):new hc(new Wl(e)):new hc(new Wl(function(){return mr(this,arguments,function*(){})}()))})}function C7(e){return H(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new ia(e,t);return t>=oA&&f0(yield n.readAt(0,jl+7&-8))?new h0(new __(n)):new hc(new Wl(n))})}var Ne=class e extends lt{static assemble(...t){let n=i=>i.flatMap(o=>Array.isArray(o)?n(o):o instanceof De?o.data.children:o.data),r=new e;return r.visitMany(n(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof zt)return this.visitMany(t.data),this;let{type:n}=t;if(!st.isDictionary(n)){let{length:r}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(st.isUnion(n))this.nodes.push(new qr(r,0));else{let{nullCount:i}=t;st.isNull(n)||_i.call(this,i<=0?new Uint8Array(0):tc(t.offset,r,t.nullBitmap)),this.nodes.push(new qr(r,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function _i(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new cr(this._byteLength,t)),this._byteLength+=t,this}function L7(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:o}=e;if(_i.call(this,i),n.mode===me.Sparse)return S_.call(this,e);if(n.mode===me.Dense){if(e.offset<=0)return _i.call(this,o),S_.call(this,e);{let s=new Int32Array(r),a=Object.create(null),c=Object.create(null);for(let l,u,f=-1;++f<r;)(l=i[f])!==void 0&&((u=a[l])===void 0&&(u=a[l]=o[f]),s[f]=o[f]-u,c[l]=((t=c[l])!==null&&t!==void 0?t:0)+1);_i.call(this,s),this.visitMany(e.children.map((l,u)=>{let f=n.typeIds[u],h=a[f],d=c[f];return l.slice(h,Math.min(r,d))}))}}return this}function k7(e){let t;return e.nullCount>=e.length?_i.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?_i.call(this,tc(e.offset,e.length,t)):_i.call(this,ec(e.values))}function ts(e){return _i.call(this,e.values.subarray(0,e.length*e.stride))}function lA(e){let{length:t,values:n,valueOffsets:r}=e,{[0]:i,[t]:o}=r,s=Math.min(o-i,n.byteLength-i);return _i.call(this,Xm(-i,t+1,r)),_i.call(this,n.subarray(i,i+s)),this}function I_(e){let{length:t,valueOffsets:n}=e;if(n){let{[0]:r,[t]:i}=n;return _i.call(this,Xm(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function S_(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}Ne.prototype.visitBool=k7;Ne.prototype.visitInt=ts;Ne.prototype.visitFloat=ts;Ne.prototype.visitUtf8=lA;Ne.prototype.visitBinary=lA;Ne.prototype.visitFixedSizeBinary=ts;Ne.prototype.visitDate=ts;Ne.prototype.visitTimestamp=ts;Ne.prototype.visitTime=ts;Ne.prototype.visitDecimal=ts;Ne.prototype.visitList=I_;Ne.prototype.visitStruct=S_;Ne.prototype.visitUnion=L7;Ne.prototype.visitInterval=ts;Ne.prototype.visitDuration=ts;Ne.prototype.visitFixedSizeList=I_;Ne.prototype.visitMap=I_;var pc=class extends oc{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new Yi,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,$n(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return yr(t)?t.then(n=>this.writeAll(n)):Rr(t)?A_(this,t):M_(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,n=null){return t===this._sink||t instanceof Yi?this._sink=t:(this._sink=new Yi,t&&E3(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&D3(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!n||!uc(n,this._schema))&&(n==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=n,this._writeSchema(n))),this}write(t){let n=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof ar&&!(n=t.schema))return this.finish()&&void 0;if(t instanceof De&&!(n=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(n&&!uc(n,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,n)}t instanceof De?t instanceof fc||this._writeRecordBatch(t):t instanceof ar?this.writeAll(t.batches):oi(t)&&this.writeAll(t)}_writeMessage(t,n=8){let r=n-1,i=ur.encode(t),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+r&~r,c=a-o-s;return t.headerType===Ht.RecordBatch?this._recordBatchBlocks.push(new Yo(a,t.bodyLength,this._position)):t.headerType===Ht.DictionaryBatch&&this._dictionaryBlocks.push(new Yo(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-s)),o>0&&this._write(i),this._writePadding(c)}_write(t){if(this._started){let n=Et(t);n&&n.byteLength>0&&(this._sink.write(n),this._position+=n.byteLength)}return this}_writeSchema(t){return this._writeMessage(ur.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Vl)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:n,nodes:r,bufferRegions:i,buffers:o}=Ne.assemble(t),s=new yn(t.numRows,r,i),a=ur.from(s,n);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(o)}_writeDictionaryBatch(t,n,r=!1){this._dictionaryDeltaOffsets.set(n,t.length+(this._dictionaryDeltaOffsets.get(n)||0));let{byteLength:i,nodes:o,bufferRegions:s,buffers:a}=Ne.assemble(new zt([t])),c=new yn(t.length,o,s),l=new lr(c,n,r),u=ur.from(l,i);return this._writeMessage(u)._writeBodyBuffers(a)}_writeBodyBuffers(t){let n,r,i;for(let o=-1,s=t.length;++o<s;)(n=t[o])&&(r=n.byteLength)>0&&(this._write(n),(i=(r+7&-8)-r)>0&&this._writePadding(i));return this}_writeDictionaries(t){for(let[n,r]of t.dictionaries){let i=this._dictionaryDeltaOffsets.get(n)||0;if(i===0||(r=r?.slice(i)).length>0)for(let o of r.data)this._writeDictionaryBatch(o,n,i>0),i+=o.length}return this}},Gh=class e extends pc{static writeAll(t,n){let r=new e(n);return yr(t)?t.then(i=>r.writeAll(i)):Rr(t)?A_(r,t):M_(r,t)}},Xh=class e extends pc{static writeAll(t){let n=new e;return yr(t)?t.then(r=>n.writeAll(r)):Rr(t)?A_(n,t):M_(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let n=jo.encode(new jo(t,Ie.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(n)._write(Int32Array.of(n.byteLength))._writeMagic()}};function M_(e,t){let n=t;t instanceof ar&&(n=t.batches,e.reset(void 0,t.schema));for(let r of n)e.write(r);return e.finish()}function A_(e,t){var n,r,i,o,s,a,c;return H(this,void 0,void 0,function*(){try{for(n=!0,r=ii(t);i=yield r.next(),o=i.done,!o;n=!0){c=i.value,n=!1;let l=c;e.write(l)}}catch(l){s={error:l}}finally{try{!n&&!o&&(a=r.return)&&(yield a.call(r))}finally{if(s)throw s.error}}return e.finish()})}function uA(e,t){if(Rr(e))return $7(e,t);if(oi(e))return R7(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function R7(e,t){let n=null,r=t?.type==="bytes"||!1,i=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){o(s,n||(n=e[Symbol.iterator]()))},pull(s){n?o(s,n):s.close()},cancel(){(n?.return&&n.return()||!0)&&(n=null)}}),Object.assign({highWaterMark:r?i:void 0},t));function o(s,a){let c,l=null,u=s.desiredSize||null;for(;!(l=a.next(r?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=Et(l.value))&&(u!=null&&r&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()}}function $7(e,t){let n=null,r=t?.type==="bytes"||!1,i=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){return H(this,void 0,void 0,function*(){yield o(s,n||(n=e[Symbol.asyncIterator]()))})},pull(s){return H(this,void 0,void 0,function*(){n?yield o(s,n):s.close()})},cancel(){return H(this,void 0,void 0,function*(){(n?.return&&(yield n.return())||!0)&&(n=null)})}}),Object.assign({highWaterMark:r?i:void 0},t));function o(s,a){return H(this,void 0,void 0,function*(){let c,l=null,u=s.desiredSize||null;for(;!(l=yield a.next(r?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=Et(l.value))&&(u!=null&&r&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()})}}function dA(e){return new T_(e)}var T_=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:n,["writableStrategy"]:r,["queueingStrategy"]:i="count"}=t,o=A3(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=ac(o),this._getSize=i!=="bytes"?fA:hA;let{["highWaterMark"]:s=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n),{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:s,size:i!=="bytes"?fA:hA}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(t){let n=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-n}_maybeFlush(t,n){n!=null&&(this._bufferedSize>=n.desiredSize&&++this._numChunks&&this._enqueue(n,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(n,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(n,null)))}_enqueue(t,n){this._bufferedSize=0,this._controller=null,n==null?t.close():t.enqueue(n)}},fA=e=>{var t;return(t=e?.length)!==null&&t!==void 0?t:0},hA=e=>{var t;return(t=e?.byteLength)!==null&&t!==void 0?t:0};function m0(e,t){let n=new Yi,r=null,i=new ReadableStream({cancel(){return H(this,void 0,void 0,function*(){yield n.close()})},start(a){return H(this,void 0,void 0,function*(){yield s(a,r||(r=yield o()))})},pull(a){return H(this,void 0,void 0,function*(){r?yield s(a,r):a.close()})}});return{writable:new WritableStream(n,Object.assign({highWaterMark:Math.pow(2,14)},e)),readable:i};function o(){return H(this,void 0,void 0,function*(){return yield(yield Ir.from(n)).open(t)})}function s(a,c){return H(this,void 0,void 0,function*(){let l=a.desiredSize,u=null;for(;!(u=yield c.next()).done;)if(a.enqueue(u.value),l!=null&&--l<=0)return;a.close()})}}function y0(e,t){let n=new this(e),r=new Ur(n),i=new ReadableStream({cancel(){return H(this,void 0,void 0,function*(){yield r.cancel()})},pull(s){return H(this,void 0,void 0,function*(){yield o(s)})},start(s){return H(this,void 0,void 0,function*(){yield o(s)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(n,e),readable:i};function o(s){return H(this,void 0,void 0,function*(){let a=null,c=s.desiredSize;for(;a=yield r.read(c||null);)if(s.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;s.close()})}}function Hh(e){let t=Ir.from(e);return yr(t)?t.then(n=>Hh(n)):t.isAsync()?t.readAll().then(n=>new ar(n)):new ar(t.readAll())}var U7=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},$w),u_),e_),Pw),Fw),t_),kw),{compareSchemas:uc,compareFields:U6,compareTypes:z6});pn.toDOMStream=uA;ye.throughDOM=dA;Ir.throughDOM=m0;dc.throughDOM=m0;Jo.throughDOM=m0;pc.throughDOM=y0;Xh.throughDOM=y0;Gh.throughDOM=y0;function E_(e="ws://localhost:3000/"){let t=[],n=!1,r=null,i,o={open(){n=!0,c()},close(){for(n=!1,r=null,i=null;t.length;)t.shift().reject("Socket closed")},error(l){if(r){let{reject:u}=r;r=null,c(),u(l)}else console.error("WebSocket error: ",l)},message({data:l}){if(r){let{query:u,resolve:f,reject:h}=r;if(r=null,c(),typeof l=="string"){let d=JSON.parse(l);d.error?h(d.error):f(d)}else if(u.type==="exec")f();else if(u.type==="arrow")f(Hh(l.arrayBuffer()));else throw new Error(`Unexpected socket data: ${l}`)}else console.log("WebSocket message: ",l)}};function s(){i=new WebSocket(e);for(let l in o)i.addEventListener(l,o[l])}function a(l,u,f){i==null&&s(),t.push({query:l,resolve:u,reject:f}),n&&!r&&c()}function c(){t.length&&(r=t.shift(),i.send(JSON.stringify(r.query)))}return{get connected(){return n},query(l){return new Promise((u,f)=>a(l,u,f))}}}var fr=class{constructor(t,n){t&&(this.table=String(t)),n&&(this.column=n)}get columns(){return this.column?[this.column]:[]}toString(){let{table:t,column:n}=this;if(n){let r=n.startsWith("*")?n:`"${n}"`;return`${t?`${pA(t)}.`:""}${r}`}else return t?pA(t):"NULL"}};function pA(e){return e.split(".").map(n=>`"${n}"`).join(".")}function mA(e,t){return e instanceof fr&&e.column===t}function Wt(e){return typeof e=="string"?g0(e):e}function mc(e){return typeof e=="string"?yA(e):e}function yA(e){return new fr(e)}function g0(e,t){return arguments.length===1&&(t=e,e=null),new fr(e,t)}function es(e){switch(typeof e){case"boolean":return e?"TRUE":"FALSE";case"string":return`'${e}'`;case"number":return Number.isFinite(e)?String(e):"NULL";default:if(e==null)return"NULL";if(e instanceof Date){let t=+e;if(Number.isNaN(t))return"NULL";let n=e.getUTCFullYear(),r=e.getUTCMonth(),i=e.getUTCDate();return t===Date.UTC(n,r,i)?`MAKE_DATE(${n}, ${r+1}, ${i})`:`EPOCH_MS(${t})`}else return e instanceof RegExp?`'${e.source}'`:String(e)}}var ns=e=>typeof e?.addEventListener=="function";function b0(e){return e instanceof oa}var oa=class{constructor(t,n,r){this._expr=Array.isArray(t)?t:[t],this._deps=n||[],this.annotate(r);let i=this._expr.filter(o=>ns(o));i.length>0?(this._params=Array.from(new Set(i)),this._params.forEach(o=>{o.addEventListener("value",()=>z7(this,this.map?.get("value")))})):this.addEventListener=void 0}get value(){return this}get columns(){let{_params:t,_deps:n}=this;if(t){let r=new Set(t.flatMap(i=>{let o=i.value?.columns;return Array.isArray(o)?o:[]}));if(r.size){let i=new Set(n);return r.forEach(o=>i.add(o)),Array.from(i)}}return n}get column(){return this._deps.length?this._deps[0]:this.columns[0]}annotate(...t){return Object.assign(this,...t)}toString(){return this._expr.map(t=>ns(t)&&!b0(t)?es(t.value):t).join("")}addEventListener(t,n){let r=this.map||(this.map=new Map);(r.get(t)||(r.set(t,new Set),r.get(t))).add(n)}};function z7(e,t){if(t?.size)return Promise.allSettled(Array.from(t,n=>n(e)))}function D_(e,t){let n=[e[0]],r=new Set,i=t.length;for(let o=0,s=0;o<i;){let a=t[o];ns(a)?n[++s]=a:(Array.isArray(a?.columns)&&a.columns.forEach(l=>r.add(l)),n[s]+=typeof a=="string"?a:es(a));let c=e[++o];ns(n[s])?n[++s]=c:n[s]+=c}return{spans:n,cols:Array.from(r)}}function q(e,...t){let{spans:n,cols:r}=D_(e,t);return new oa(n,r)}var Zh=e=>({value:e,toString:()=>es(e)});function Kh(e){e(this.op,this),this.children?.forEach(t=>t.visit(e))}function gA(e,t){let n=t.filter(i=>i!=null).map(Wt),r=n.map((i,o)=>o?` ${e} `:"");return n.length===1?r.push(""):n.length>1&&(r[0]="(",r.push(")")),q(r,...n).annotate({op:e,children:n,visit:Kh})}var Mr=(...e)=>gA("AND",e.flat()),Qh=(...e)=>gA("OR",e.flat()),q7=e=>t=>q`(${e} ${Wt(t)})`.annotate({op:e,a:t,visit:Kh}),V7=q7("NOT"),bA=e=>t=>q`(${Wt(t)} ${e})`.annotate({op:e,a:t,visit:Kh}),Jh=bA("IS NULL"),yc=bA("IS NOT NULL"),sa=e=>(t,n)=>q`(${Wt(t)} ${e} ${Wt(n)})`.annotate({op:e,a:t,b:n,visit:Kh}),N_=sa("="),td=sa("<>"),gc=sa("<"),O_=sa(">"),bc=sa("<="),j7=sa(">="),Y7=sa("IS DISTINCT FROM"),B_=sa("IS NOT DISTINCT FROM");function W7(e,t,n,r){t=Wt(t);let i=e.startsWith("NOT ")?"NOT ":"";return(n?r?q`${i}(${n[0]} <= ${t} AND ${t} < ${n[1]})`:q`(${t} ${e} ${n[0]} AND ${n[1]})`:q``).annotate({op:e,visit:Kh,field:t,range:n})}var Oe=(e,t,n)=>W7("BETWEEN",e,t,n);function xc(e,t){return Array.from({length:e},()=>t)}function gn(e,t){return(...n)=>{let r=n.map(Wt),i=t?`::${t}`:"";return(r.length?q([`${e}(`,...xc(r.length-1,", "),`)${i}`],...r):q`${e}()${i}`).annotate({func:e,args:r})}}var G7=gn("REGEXP_MATCHES"),X7=gn("CONTAINS"),H7=gn("PREFIX"),Z7=gn("SUFFIX"),K7=gn("LOWER"),Q7=gn("UPPER"),J7=gn("LENGTH"),tk=gn("ISNAN"),ek=gn("ISFINITE"),nk=gn("ISINF");var ed=class e extends oa{constructor(t,n,r,i,o="",s="",a=""){let c;if(i&&!(o||s||a))c=i?q`${n} OVER "${i}"`:q`${n} OVER ()`;else{let h=o&&s?" ":"",d=(o||s)&&a?" ":"";c=q`${n} OVER (${i?`"${i}" `:""}${o}${h}${s}${d}${a})`}r&&(c=q`(${c})::${r}`);let{_expr:u,_deps:f}=c;super(u,f,{window:t,func:n,type:r,name:i,group:o,order:s,frame:a})}get basis(){return this.column}get label(){let{func:t}=this;return t.label??t.toString()}over(t){let{window:n,func:r,type:i,group:o,order:s,frame:a}=this;return new e(n,r,i,t,o,s,a)}partitionby(...t){let n=t.flat().filter(u=>u).map(Wt),r=q(["PARTITION BY ",xc(n.length-1,", "),""],...n),{window:i,func:o,type:s,name:a,order:c,frame:l}=this;return new e(i,o,s,a,r,c,l)}orderby(...t){let n=t.flat().filter(u=>u).map(Wt),r=q(["ORDER BY ",xc(n.length-1,", "),""],...n),{window:i,func:o,type:s,name:a,group:c,frame:l}=this;return new e(i,o,s,a,c,r,l)}rows(t){let n=xA("ROWS",t),{window:r,func:i,type:o,name:s,group:a,order:c}=this;return new e(r,i,o,s,a,c,n)}range(t){let n=xA("RANGE",t),{window:r,func:i,type:o,name:s,group:a,order:c}=this;return new e(r,i,o,s,a,c,n)}};function xA(e,t){if(ns(t)){let n=q`${t}`;return n.toString=()=>`${e} ${wA(t.value)}`,n}return`${e} ${wA(t)}`}function wA(e){let[t,n]=e,r=t===0?"CURRENT ROW":Number.isFinite(t)?`${Math.abs(t)} PRECEDING`:"UNBOUNDED PRECEDING",i=n===0?"CURRENT ROW":Number.isFinite(n)?`${Math.abs(n)} FOLLOWING`:"UNBOUNDED FOLLOWING";return`BETWEEN ${r} AND ${i}`}function vi(e,t){return(...n)=>{let r=gn(e)(...n);return new ed(e,r,t)}}var rk=vi("ROW_NUMBER","INTEGER"),ik=vi("RANK","INTEGER"),ok=vi("DENSE_RANK","INTEGER"),sk=vi("PERCENT_RANK"),ak=vi("CUME_DIST"),ck=vi("NTILE"),lk=vi("LAG"),uk=vi("LEAD"),fk=vi("FIRST_VALUE"),hk=vi("LAST_VALUE"),dk=vi("NTH_VALUE");var F_=class e extends oa{constructor(t,n,r,i,o){n=(n||[]).map(Wt);let{strings:s,exprs:a}=pk(t,n,r,i,o),{spans:c,cols:l}=D_(s,a);super(c,l,{aggregate:t,args:n,type:r,isDistinct:i,filter:o})}get basis(){return this.column}get label(){let{aggregate:t,args:n,isDistinct:r}=this,i=r?"DISTINCT"+(n.length?" ":""):"",o=n.length?`(${i}${n.map(mk).join(", ")})`:"";return`${t.toLowerCase()}${o}`}distinct(){let{aggregate:t,args:n,type:r,filter:i}=this;return new e(t,n,r,!0,i)}where(t){let{aggregate:n,args:r,type:i,isDistinct:o}=this;return new e(n,r,i,o,t)}window(){let{aggregate:t,args:n,type:r,isDistinct:i}=this,o=new e(t,n,null,i);return new ed(t,o,r)}partitionby(...t){return this.window().partitionby(...t)}orderby(...t){return this.window().orderby(...t)}rows(t,n){return this.window().rows(t,n)}range(t,n){return this.window().range(t,n)}};function pk(e,t,n,r,i){let o=`)${n?`::${n}`:""}`,s=[`${e}(${r?"DISTINCT ":""}`],a=[];return t.length?(s=s.concat([...xc(t.length-1,", "),`${o}${i?" FILTER (WHERE ":""}`,...i?[")"]:[]]),a=[...t,...i?[i]:[]]):s[0]+="*"+o,{exprs:a,strings:s}}function mk(e){let t=es(e);return t&&t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function Gt(e,t){return(...n)=>new F_(e,n,t)}var Si=Gt("COUNT","INTEGER"),yk=Gt("AVG"),gk=Gt("AVG"),bk=Gt("MAD"),aa=Gt("MAX"),ca=Gt("MIN"),Ii=Gt("SUM","DOUBLE"),xk=Gt("PRODUCT"),wk=Gt("MEDIAN"),_k=Gt("QUANTILE"),vk=Gt("MODE"),Sk=Gt("VARIANCE"),Ik=Gt("STDDEV"),Mk=Gt("SKEWNESS"),Ak=Gt("KURTOSIS"),Tk=Gt("ENTROPY"),Ek=Gt("VAR_POP"),Dk=Gt("STDDEV_POP"),Nk=Gt("CORR"),Ok=Gt("COVAR_POP"),C_=Gt("REGR_INTERCEPT"),L_=Gt("REGR_SLOPE"),k_=Gt("REGR_COUNT"),Bk=Gt("REGR_R2"),R_=Gt("REGR_SYY"),$_=Gt("REGR_SXX"),Fk=Gt("REGR_SXY"),P_=Gt("REGR_AVGX"),Ck=Gt("REGR_AVGY"),Lk=Gt("FIRST"),kk=Gt("LAST"),x0=Gt("ARG_MIN"),w0=Gt("ARG_MAX"),Rk=Gt("STRING_AGG"),$k=Gt("ARRAY_AGG");function _A(e,t){let n=Wt(e),r=q`CAST(${n} AS ${t})`;return Object.defineProperty(r,"label",{enumerable:!0,get(){return e.label}}),Object.defineProperty(r,"aggregate",{enumerable:!0,get(){return e.aggregate||!1}}),r}var _0=e=>_A(e,"DOUBLE");var U_=e=>q`epoch_ms(${Wt(e)})`;var z_=gn("ST_AsGeoJSON"),Pk=gn("ST_X"),Uk=gn("ST_Y"),zk=gn("ST_CENTROID");var Lt=class e{static select(...t){return new e().select(...t)}static from(...t){return new e().from(...t)}static with(...t){return new e().with(...t)}static union(...t){return new wc("UNION",t.flat())}static unionAll(...t){return new wc("UNION ALL",t.flat())}static intersect(...t){return new wc("INTERSECT",t.flat())}static except(...t){return new wc("EXCEPT",t.flat())}constructor(){this.query={with:[],select:[],from:[],where:[],groupby:[],having:[],window:[],qualify:[],orderby:[]}}clone(){let t=new e;return t.query={...this.query},t}with(...t){let{query:n}=this;if(t.length===0)return n.with;{let r=[],i=(o,s)=>{let a=s.clone();a.cteFor=this,r.push({as:o,query:a})};return t.flat().forEach(o=>{if(o!=null)if(o.as&&o.query)i(o.as,o.query);else for(let s in o)i(s,o[s])}),n.with=n.with.concat(r),this}}select(...t){let{query:n}=this;if(t.length===0)return n.select;{let r=[];for(let i of t.flat())if(i!=null)if(typeof i=="string")r.push({as:i,expr:Wt(i)});else if(i instanceof fr)r.push({as:i.column,expr:i});else if(Array.isArray(i))r.push({as:i[0],expr:i[1]});else for(let o in i)r.push({as:v0(o),expr:Wt(i[o])});return n.select=n.select.concat(r),this}}$select(...t){return this.query.select=[],this.select(...t)}distinct(t=!0){return this.query.distinct=!!t,this}from(...t){let{query:n}=this;if(t.length===0)return n.from;{let r=[];return t.flat().forEach(i=>{if(i!=null)if(typeof i=="string")r.push({as:i,from:mc(i)});else if(i instanceof fr)r.push({as:i.table,from:i});else if(S0(i)||b0(i))r.push({from:i});else if(Array.isArray(i))r.push({as:v0(i[0]),from:mc(i[1])});else for(let o in i)r.push({as:v0(o),from:mc(i[o])})}),n.from=n.from.concat(r),this}}$from(...t){return this.query.from=[],this.from(...t)}sample(t,n){let{query:r}=this;if(arguments.length===0)return r.sample;{let i=t;return typeof t=="number"&&(i=t>0&&t<1?{perc:100*t,method:n}:{rows:Math.round(t),method:n}),r.sample=i,this}}where(...t){let{query:n}=this;return t.length===0?n.where:(n.where=n.where.concat(t.flat().filter(r=>r)),this)}$where(...t){return this.query.where=[],this.where(...t)}groupby(...t){let{query:n}=this;return t.length===0?n.groupby:(n.groupby=n.groupby.concat(t.flat().filter(r=>r).map(Wt)),this)}$groupby(...t){return this.query.groupby=[],this.groupby(...t)}having(...t){let{query:n}=this;return t.length===0?n.having:(n.having=n.having.concat(t.flat().filter(r=>r)),this)}window(...t){let{query:n}=this;if(t.length===0)return n.window;{let r=[];return t.flat().forEach(i=>{if(i!=null)for(let o in i)r.push({as:v0(o),expr:i[o]})}),n.window=n.window.concat(r),this}}qualify(...t){let{query:n}=this;return t.length===0?n.qualify:(n.qualify=n.qualify.concat(t.flat().filter(r=>r)),this)}orderby(...t){let{query:n}=this;return t.length===0?n.orderby:(n.orderby=n.orderby.concat(t.flat().filter(r=>r).map(Wt)),this)}limit(t){let{query:n}=this;return arguments.length===0?n.limit:(n.limit=Number.isFinite(t)?t:void 0,this)}offset(t){let{query:n}=this;return arguments.length===0?n.offset:(n.offset=Number.isFinite(t)?t:void 0,this)}get subqueries(){let{query:t,cteFor:n}=this,i=(n?.query||t).with?.reduce((s,{as:a,query:c})=>(s[a]=c,s),{}),o=[];return t.from.forEach(({from:s})=>{if(S0(s))o.push(s);else if(i[s.table]){let a=i[s.table];o.push(a)}}),o}toString(){let{select:t,distinct:n,from:r,sample:i,where:o,groupby:s,having:a,window:c,qualify:l,orderby:u,limit:f,offset:h,with:d}=this.query,p=[];if(d.length){let g=d.map(({as:y,query:b})=>`"${y}" AS (${b})`);p.push(`WITH ${g.join(", ")}`)}let m=t.map(({as:g,expr:y})=>mA(y,g)&&!y.table?`${y}`:`${y} AS "${g}"`);if(p.push(`SELECT${n?" DISTINCT":""} ${m.join(", ")}`),r.length){let g=r.map(({as:y,from:b})=>{let x=S0(b)?`(${b})`:`${b}`;return!y||y===b.table?x:`${x} AS "${y}"`});p.push(`FROM ${g.join(", ")}`)}if(o.length){let g=o.map(String).filter(y=>y).join(" AND ");g&&p.push(`WHERE ${g}`)}if(i){let{rows:g,perc:y,method:b,seed:x}=i,w=g?`${g} ROWS`:`${y} PERCENT`,v=b?` (${b}${x!=null?`, ${x}`:""})`:"";p.push(`USING SAMPLE ${w}${v}`)}if(s.length&&p.push(`GROUP BY ${s.join(", ")}`),a.length){let g=a.map(String).filter(y=>y).join(" AND ");g&&p.push(`HAVING ${g}`)}if(c.length){let g=c.map(({as:y,expr:b})=>`"${y}" AS (${b})`);p.push(`WINDOW ${g.join(", ")}`)}if(l.length){let g=l.map(String).filter(y=>y).join(" AND ");g&&p.push(`QUALIFY ${g}`)}return u.length&&p.push(`ORDER BY ${u.join(", ")}`),Number.isFinite(f)&&p.push(`LIMIT ${f}`),Number.isFinite(h)&&p.push(`OFFSET ${h}`),p.join(" ")}},wc=class e{constructor(t,n){this.op=t,this.queries=n.map(r=>r.clone()),this.query={orderby:[]}}clone(){let t=new e(this.op,this.queries);return t.query={...this.query},t}orderby(...t){let{query:n}=this;return t.length===0?n.orderby:(n.orderby=n.orderby.concat(t.flat().filter(r=>r).map(Wt)),this)}limit(t){let{query:n}=this;return arguments.length===0?n.limit:(n.limit=Number.isFinite(t)?t:void 0,this)}offset(t){let{query:n}=this;return arguments.length===0?n.offset:(n.offset=Number.isFinite(t)?t:void 0,this)}get subqueries(){let{queries:t,cteFor:n}=this;return n&&t.forEach(r=>r.cteFor=n),t}toString(){let{op:t,queries:n,query:{orderby:r,limit:i,offset:o}}=this,s=[n.join(` ${t} `)];return r.length&&s.push(`ORDER BY ${r.join(", ")}`),Number.isFinite(i)&&s.push(`LIMIT ${i}`),Number.isFinite(o)&&s.push(`OFFSET ${o}`),s.join(" ")}};function S0(e){return e instanceof Lt||e instanceof wc}function v0(e){return qk(e)?e.slice(1,-1):e}function qk(e){return e[0]==='"'&&e[e.length-1]==='"'}var I0=e=>e;function Vk(){return{apply:I0,invert:I0,sqlApply:Wt,sqlInvert:I0}}function jk({base:e}={}){if(e==null||e===Math.E)return{apply:Math.log,invert:Math.exp,sqlApply:t=>q`LN(${Wt(t)})`,sqlInvert:t=>q`EXP(${t})`};if(e===10)return{apply:Math.log10,invert:t=>Math.pow(10,t),sqlApply:t=>q`LOG(${Wt(t)})`,sqlInvert:t=>q`POW(10, ${t})`};{let t=+e;return{apply:n=>Math.log(n)/Math.log(t),invert:n=>Math.pow(t,n),sqlApply:n=>q`LN(${Wt(n)}) / LN(${t})`,sqlInvert:n=>q`POW(${t}, ${n})`}}}function Yk({constant:e=1}={}){let t=+e;return{apply:n=>Math.sign(n)*Math.log1p(Math.abs(n)),invert:n=>Math.sign(n)*Math.exp(Math.abs(n)-t),sqlApply:n=>(n=Wt(n),q`SIGN(${n}) * LN(${t} + ABS(${n}))`),sqlInvert:n=>q`SIGN(${n}) * (EXP(ABS(${n})) - ${t})`}}function Wk(){return{apply:e=>Math.sign(e)*Math.sqrt(Math.abs(e)),invert:e=>Math.sign(e)*e*e,sqlApply:e=>(e=Wt(e),q`SIGN(${e}) * SQRT(ABS(${e}))`),sqlInvert:e=>q`SIGN(${e}) * (${e}) ** 2`}}function Gk({exponent:e=1}={}){let t=+e;return{apply:n=>Math.sign(n)*Math.pow(Math.abs(n),t),invert:n=>Math.sign(n)*Math.pow(Math.abs(n),1/t),sqlApply:n=>(n=Wt(n),q`SIGN(${n}) * POW(ABS(${n}), ${t})`),sqlInvert:n=>q`SIGN(${n}) * POW(ABS(${n}), 1/${t})`}}function vA(){return{apply:e=>+e,invert:e=>new Date(e),sqlApply:e=>e instanceof Date?+e:U_(Wt(e)),sqlInvert:I0}}var Xk={linear:Vk,log:jk,symlog:Yk,sqrt:Wk,pow:Gk,time:vA,utc:vA};function nd(e){let t=Xk[e.type];return t?{...e,...t(e)}:null}function M0(e,t,{replace:n=!1,temp:r=!0,view:i=!1}={}){return"CREATE"+(n?" OR REPLACE ":" ")+(r?"TEMP ":"")+(i?"VIEW":"TABLE")+(n?" ":" IF NOT EXISTS ")+e+" AS "+t}function SA(e){switch(e){case"BIGINT":case"HUGEINT":case"INTEGER":case"SMALLINT":case"TINYINT":case"UBIGINT":case"UINTEGER":case"USMALLINT":case"UTINYINT":case"DOUBLE":case"FLOAT":case"REAL":case"DECIMAL":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":return"string";case"LIST":return"array";case"BLOB":case"STRUCT":case"MAP":return"object";default:throw new Error(`Unsupported type: ${e}`)}}var Hk="count",Zk="nulls",Kk="max",Qk="min",Jk="distinct";var tR={[Hk]:Si,[Jk]:e=>Si(e).distinct(),[Kk]:aa,[Qk]:ca,[Zk]:e=>Si().where(Jh(e))};function IA({table:e,column:t},n){return Lt.from(e).select(n.map(r=>[r,tR[r](t)]))}var MA=()=>Object.create(null),A0=class{constructor(t){this.mc=t,this.clear()}clear(){this.tables=MA()}tableInfo(t){let n=this.tables;if(n[t])return n[t];let r=eR(this.mc,t).catch(i=>{throw n[t]=null,i});return n[t]=r}async fieldInfo({table:t,column:n,stats:r}){let o=(await this.tableInfo(t))[n];if(o==null)return;if(!r?.length)return o;let s=await this.mc.query(IA(o,r),{persist:!0}),a={...o,...Array.from(s)[0]};for(let c in a){let l=a[c];typeof l=="bigint"&&(a[c]=Number(l))}return a}async queryFields(t){let n=await nR(this,t);return(await Promise.all(n.map(i=>this.fieldInfo(i)))).filter(i=>i)}};async function eR(e,t){let n=await e.query(`DESCRIBE ${mc(t)}`,{type:"json",cache:!1}),r=MA();for(let i of n)r[i.column_name]={table:t,column:i.column_name,sqlType:i.column_type,type:SA(i.column_type),nullable:i.null==="YES"};return r}async function nR(e,t){return t.length===1&&t[0].column==="*"?Object.values(await e.tableInfo(t[0].table)):t}function TA(e){let t=2166136261;for(let n=0,r=e.length;n<r;++n){let i=e.charCodeAt(n),o=i&65280;o&&(t=AA(t^o>>8)),t=AA(t^i&255)}return rR(t)}function AA(e){return e+(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}function rR(e){return e+=e<<13,e^=e>>>7,e+=e<<3,e^=e>>>17,e+=e<<5,e&4294967295}var T0=class{constructor(t,{selection:n,temp:r=!0}){this.mc=t,this.selection=n,this.temp=r,this.reset()}reset(){this.enabled=!1,this.clients=null,this.indices=null,this.activeView=null}clear(){this.indices&&(this.mc.cancel(Array.from(this.indices.values(),t=>t.result)),this.indices=null)}index(t,n){if(this.clients!==t){let l=Array.from(t,DA),u=l[0]?.from;this.enabled=l.every(f=>f&&f.from===u),this.clients=t,this.activeView=null,this.clear()}if(!this.enabled)return!1;n=n||this.selection.active;let{source:r}=n;if(r&&r===this.activeView?.source)return!0;if(this.clear(),!r)return!1;let i=this.activeView=iR(n);if(!i)return!1;this.mc.logger().warn("DATA CUBE INDEX CONSTRUCTION");let o=this.selection.remove(r),s=this.indices=new Map,{mc:a,temp:c}=this;for(let l of t){if(o.skip(l,n))continue;let u=DA(l),f=l.query(o.predicate(l)).select({...i.columns,...u.count}).groupby(Object.keys(i.columns)),[h]=f.subqueries;if(h){let b=Object.values(i.columns).map(x=>x.columns[0]);sR(h,b)}let d=f.orderby();f.query.orderby=[];let p=f.toString(),g=`cube_index_${(TA(p)>>>0).toString(16)}`,y=a.exec(M0(g,p,{temp:c}));s.set(l,{table:g,result:y,order:d,...u})}}async update(){let{clients:t,selection:n,activeView:r}=this,i=r.predicate(n.active.predicate);return Promise.all(Array.from(t).map(o=>this.updateClient(o,i)))}async updateClient(t,n){let r=this.indices.get(t);if(!r)return;n||(n=this.activeView.predicate(this.selection.active.predicate));let{table:i,dims:o,aggr:s,order:a=[]}=r,c=Lt.select(o,s).from(i).groupby(o).where(n).orderby(a);return this.mc.updateClient(t,c)}};function iR(e){let{source:t,schema:n}=e,r=e.predicate?.columns;if(!n||!r)return null;let{type:i,scales:o,pixelSize:s=1}=n,a;if(i==="interval"&&o){let c=o.map(l=>oR(l,s));if(c.some(l=>l==null))return null;c.length===1?(a=l=>l?Oe("active0",l.range.map(c[0])):[],r={active0:c[0](e.predicate.field)}):(a=l=>l?Mr(l.children.map(({range:u},f)=>Oe(`active${f}`,u.map(c[f])))):[],r=Object.fromEntries(e.predicate.children.map((l,u)=>[`active${u}`,c[u](l.field)])))}else if(i==="point")a=c=>c,r=Object.fromEntries(r.map(c=>[c.toString(),c]));else return null;return{source:t,columns:r,predicate:a}}function oR(e,t){let{apply:n,sqlApply:r}=nd(e);if(n){let{domain:i,range:o}=e,s=n(Math.min(...i)),a=n(Math.max(...i)),c=Math.abs(o[1]-o[0])/(a-s)/t,l=t===1?"":`${t}::INTEGER * `;return u=>q`${l}FLOOR(${c}::DOUBLE * (${r(u)} - ${s}::DOUBLE))::INTEGER`}}var EA={from:NaN};function DA(e){if(!e.filterIndexable)return EA;let t=e.query(),n=q_(t);if(!n||!t.groupby)return EA;let r=new Set(t.groupby().map(a=>a.column)),i=[],o=[],s;for(let{as:a,expr:{aggregate:c}}of t.select())switch(c?.toUpperCase?.()){case"COUNT":case"SUM":i.push({[a]:q`SUM("${a}")::DOUBLE`});break;case"AVG":s="_count_",i.push({[a]:q`(SUM("${a}" * ${s}) / SUM(${s}))::DOUBLE`});break;case"MAX":i.push({[a]:q`MAX("${a}")`});break;case"MIN":i.push({[a]:q`MIN("${a}")`});break;default:if(r.has(a))o.push(a);else return null}return{aggr:i,dims:o,count:s?{[s]:q`COUNT(*)`}:{},from:n}}function q_(e){let t=e.subqueries;if(e.select){let r=e.from();if(!r.length)return;if(t.length===0)return r[0].from.table}let n=q_(t[0]);for(let r=1;r<t.length;++r){let i=q_(t[r]);if(i!==void 0&&i!==n)return NaN}return n}function sR(e,t){let n=new Set,r=i=>{n.has(i)||(n.add(i),i.select&&i.from().length&&i.select(t),i.subqueries.forEach(r))};r(e)}var E0=class{constructor(t,n,r=!0){this.mc=t,this.selection=n,this.clients=new Set,this.indexer=r?new T0(this.mc,{...r,selection:n}):null;let{value:i,activate:o}=this.handlers={value:()=>this.update(),activate:s=>this.indexer?.index(this.clients,s)};n.addEventListener("value",i),n.addEventListener("activate",o)}finalize(){let{value:t,activate:n}=this.handlers;this.selection.removeEventListener("value",t),this.selection.removeEventListener("activate",n)}reset(){this.indexer?.reset()}add(t){return(this.clients=new Set(this.clients)).add(t),this}remove(t){return this.clients.has(t)&&(this.clients=new Set(this.clients)).delete(t),this}update(){let{mc:t,indexer:n,clients:r,selection:i}=this;return n?.index(r)?n.update():aR(t,r,i)}};function aR(e,t,n){return Promise.all(Array.from(t).map(r=>{let i=n.predicate(r);if(i!=null)return e.updateClient(r,r.query(i))}))}function D0(){let e,t,n=new Promise((r,i)=>{e=r,t=i});return n.fulfill=r=>(e(r),n),n.reject=r=>(t(r),n),n}function cR(e){return(typeof requestAnimationFrame<"u"?requestAnimationFrame:typeof setImmediate<"u"?setImmediate:setTimeout)(e)}function NA(e,t,n){let r=[],i=0;function o(){let s=lR(r,t);r=[],i=0;for(let a of s)fR(a,e,n),pR(a,t)}return{add(s,a){s.request.type==="arrow"?(i=i||cR(()=>o()),r.push({entry:s,priority:a,index:r.length})):e(s,a)}}}function lR(e,t){let n=[],r=new Map;for(let i of e){let{entry:{request:o}}=i,s=uR(o.query,t);if(!r.has(s)){let a=[];n.push(a),r.set(s,a)}r.get(s).push(i)}return n}function uR(e,t){let n=`${e}`;if(e instanceof Lt&&!t.get(n)){if(e.orderby().length||e.where().length||e.qualify().length||e.having().length)return n;let r=e.clone().$select("*"),i=e.groupby();if(i.length){let o={};e.select().forEach(({as:s,expr:a})=>o[s]=a),r.$groupby(i.map(s=>s instanceof fr&&o[s.column]||s))}return`${r}`}else return n}function fR(e,t,n){if(hR(e))t({request:{type:"arrow",cache:!1,record:!1,query:dR(e,n)},result:e.result=D0()});else for(let{entry:r,priority:i}of e)t(r,i)}function hR(e){if(e.length>1){let t=`${e[0].entry.request.query}`;for(let n=1;n<e.length;++n)if(t!==`${e[n].entry.request.query}`)return!0}return!1}function dR(e,t){let n=e.maps=[],r=new Map;for(let s of e){let{query:a}=s.entry.request,c=[];n.push(c);for(let{as:l,expr:u}of a.select()){let f=`${u}`;r.has(f)||r.set(f,[`col${r.size}`,u]);let[h]=r.get(f);c.push([h,l])}t(`${a}`)}let i=e[0].entry.request.query.clone(),o=i.groupby();if(o.length){let s={};e.maps[0].forEach(([a,c])=>s[c]=a),i.$groupby(o.map(a=>a instanceof fr&&s[a.column]||a))}return i.$select(Array.from(r.values()))}async function pR(e,t){let{maps:n,result:r}=e;if(!n)return;let i;try{i=await r}catch(o){for(let{entry:s}of e)s.result.reject(o);return}e.forEach(({entry:o},s)=>{let{request:a,result:c}=o,l=mR(i,n[s]);a.cache&&t.set(String(a.query),l),c.fulfill(l)})}function mR(e,t){if(t){let n={};for(let[r,i]of t)n[i]=e.getChild(r);return new e.constructor(n)}else return e}var yR=typeof requestIdleCallback<"u"?requestIdleCallback:setTimeout,OA=()=>({get:()=>{},set:(e,t)=>t,clear:()=>{}});function BA({max:e=1e3,ttl:t=3*60*60*1e3}={}){let n=new Map;function r(){let i=performance.now()-t,o=null,s=1/0;for(let[a,c]of n){let{last:l}=c;l<s&&(o=a,s=l),i>l&&n.delete(a)}o&&n.delete(o)}return{get(i){let o=n.get(i);if(o)return o.last=performance.now(),o.value},set(i,o){return n.set(i,{last:performance.now(),value:o}),n.size>e&&yR(r),o},clear(){n=new Map}}}function FA(e){let t=Array.from({length:e},()=>({head:null,tail:null}));return{isEmpty(){return t.every(n=>!n.head)},insert(n,r){let i=t[r];if(!i)throw new Error(`Invalid queue priority rank: ${r}`);let o={item:n,next:null};i.head===null?i.head=i.tail=o:i.tail=i.tail.next=o},remove(n){for(let r of t){let{head:i,tail:o}=r;for(let s=null,a=i;a;s=a,a=a.next)n(a.item)&&(a===i?i=a.next:s.next=a.next,a===o&&(o=s||i));r.head=i,r.tail=o}},next(){for(let n of t){let{head:r}=n;if(r!==null)return n.head=r.next,n.tail===r&&(n.tail=null),r.item}}}}var Xi={High:0,Normal:1,Low:2};function CA(){let e=FA(3),t,n,r,i=[],o=null,s;function a(){if(o||e.isEmpty())return;let{request:f,result:h}=e.next();o=u(f,h),o.finally(()=>{o=null,a()})}function c(f,h=Xi.Normal){e.insert(f,h),a()}function l(f){i.length&&f&&i.forEach(h=>h.add(f))}async function u(f,h){try{let{query:d,type:p,cache:m=!1,record:g=!0,options:y}=f,b=d?`${d}`:null;if(g&&l(b),m){let v=n.get(b);if(v){r.debug("Cache"),h.fulfill(v);return}}let x=performance.now(),w=await t.query({type:p,sql:b,...y});m&&n.set(b,w),r.debug(`Request: ${(performance.now()-x).toFixed(1)}`),h.fulfill(w)}catch(d){h.reject(d)}}return{cache(f){return f!==void 0?n=f===!0?BA():f||OA():n},logger(f){return f?r=f:r},connector(f){return f?t=f:t},consolidate(f){f&&!s?s=NA(c,n,l):!f&&s&&(s=null)},request(f,h=Xi.Normal){let d=D0(),p={request:f,result:d};return s?s.add(p,h):c(p,h),d},cancel(f){let h=new Set(f);e.remove(({result:d})=>h.has(d))},clear(){e.remove(({result:f})=>(f.reject("Cleared"),!0))},record(){let f=[],h={add(d){f.push(d)},reset(){f=[]},snapshot(){return f.slice()},stop(){return i=i.filter(d=>d!==h),f}};return i.push(h),h}}}function LA(){return{debug(){},info(){},log(){},warn(){},error(){}}}var N0;function V_(e){return e?N0=e:N0==null&&(N0=new O0),N0}var O0=class{constructor(t=E_(),n={}){let{logger:r=console,manager:i=CA()}=n;this.catalog=new A0(this),this.manager=i,this.logger(r),this.configure(n),this.databaseConnector(t),this.clear()}logger(t){return arguments.length&&(this._logger=t||LA(),this.manager.logger(this._logger)),this._logger}configure({cache:t=!0,consolidate:n=!0,indexes:r=!0}){this.manager.cache(t),this.manager.consolidate(n),this.indexes=r}clear({clients:t=!0,cache:n=!0,catalog:r=!1}={}){this.manager.clear(),t&&(this.clients?.forEach(i=>this.disconnect(i)),this.filterGroups?.forEach(i=>i.finalize()),this.clients=new Set,this.filterGroups=new Map),n&&this.manager.cache().clear(),r&&this.catalog.clear()}databaseConnector(t){return this.manager.connector(t)}cancel(t){this.manager.cancel(t)}exec(t,{priority:n=Xi.Normal}={}){return t=Array.isArray(t)?t.join(`;
|
|
11
|
-
`):t,this.manager.request({type:"exec",query:t},n)}query(t,{type:n="arrow",cache:r=!0,priority:i=Xi.Normal,...o}={}){return this.manager.request({type:n,query:t,cache:r,options:o},i)}prefetch(t,n={}){return this.query(t,{...n,cache:!0,priority:Xi.Low})}createBundle(t,n,r=Xi.Low){let i={name:t,queries:n};return this.manager.request({type:"create-bundle",options:i},r)}loadBundle(t,n=Xi.High){let r={name:t};return this.manager.request({type:"load-bundle",options:r},n)}updateClient(t,n,r=Xi.Normal){return t.queryPending(),this.query(n,{priority:r}).then(i=>t.queryResult(i).update(),i=>{t.queryError(i),this._logger.error(i)})}requestQuery(t,n){return this.filterGroups.get(t.filterBy)?.reset(),n?this.updateClient(t,n):t.update()}async connect(t){let{catalog:n,clients:r,filterGroups:i,indexes:o}=this;if(r.has(t))throw new Error("Client already connected.");r.add(t),t.coordinator=this;let s=t.fields();s?.length&&t.fieldInfo(await n.queryFields(s));let a=t.filterBy;if(a)if(i.has(a))i.get(a).add(t);else{let c=new E0(this,a,o);i.set(a,c.add(t))}t.requestQuery()}disconnect(t){let{clients:n,filterGroups:r}=this;n.has(t)&&(n.delete(t),r.get(t.filterBy)?.remove(t),t.coordinator=null)}};var B0=class{constructor(){this._callbacks=new Map}addEventListener(t,n){this._callbacks.has(t)||this._callbacks.set(t,{callbacks:new Set,pending:null,queue:new j_}),this._callbacks.get(t).callbacks.add(n)}removeEventListener(t,n){let r=this._callbacks.get(t);r&&r.callbacks.delete(n)}willEmit(t,n){return n}emitQueueFilter(){return null}cancel(t){this._callbacks.get(t)?.queue.clear()}emit(t,n){let r=this._callbacks.get(t)||{};if(r.pending)r.queue.enqueue(n,this.emitQueueFilter(t,n));else{let i=this.willEmit(t,n),{callbacks:o,queue:s}=r;if(o?.size){let a=Promise.allSettled(Array.from(o,c=>c(i))).then(()=>{r.pending=null,s.isEmpty()||this.emit(t,s.dequeue())});r.pending=a}}}},j_=class{constructor(){this.clear()}clear(){this.next=null}isEmpty(){return!this.next}enqueue(t,n){let r={value:t};if(n&&this.next){let i=this;for(;i.next;)n(i.next.value)?i=i.next:i.next=i.next.next;i.next=r}else this.next=r}dequeue(){let{next:t}=this;return this.next=t?.next,t?.value}};function rd(e,t){return e===t?!1:e instanceof Date&&t instanceof Date?+e!=+t:Array.isArray(e)&&Array.isArray(t)?gR(e,t):!0}function gR(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!0;return!1}function Gl(e){return e instanceof Xl}var Xl=class e extends B0{constructor(t){super(),this._value=t}static value(t){return new e(t)}static array(t){if(t.some(n=>Gl(n))){let n=new e,r=()=>n.update(t.map(i=>Gl(i)?i.value:i));return r(),t.forEach(i=>Gl(i)?i.addEventListener("value",r):0),n}return new e(t)}get value(){return this._value}update(t,{force:n}={}){return rd(this._value,t)||n?this.emit("value",t):this.cancel("value"),this}willEmit(t,n){return t==="value"&&(this._value=n),n}};function Y_(e){return e instanceof vc}var vc=class e extends Xl{static intersect({cross:t=!1}={}){return new e(new _c({cross:t}))}static union({cross:t=!1}={}){return new e(new _c({cross:t,union:!0}))}static single({cross:t=!1}={}){return new e(new _c({cross:t,single:!0}))}static crossfilter(){return new e(new _c({cross:!0}))}constructor(t=new _c){super([]),this._resolved=this._value,this._resolver=t}clone(){let t=new e(this._resolver);return t._value=t._resolved=this._value,t}remove(t){let n=this.clone();return n._value=n._resolved=n._resolver.resolve(this._resolved,{source:t}),n._value.active={source:t},n}get active(){return this.clauses.active}get value(){return this.active?.value}get clauses(){return super.value}get single(){return this._resolver.single}activate(t){this.emit("activate",t)}update(t){return this._resolved=this._resolver.resolve(this._resolved,t,!0),this._resolved.active=t,super.update(this._resolved)}willEmit(t,n){return t==="value"?(this._value=n,this.value):n}emitQueueFilter(t,n){return t==="value"?this._resolver.queueFilter(n):null}skip(t,n){return this._resolver.skip(t,n)}predicate(t,n=!1){let{clauses:r}=this,i=n?null:r.active;return this._resolver.predicate(r,i,t)}},_c=class{constructor({union:t,cross:n,single:r}={}){this.union=!!t,this.cross=!!n,this.single=!!r}resolve(t,n,r=!1){let{source:i,predicate:o}=n,s=t.filter(c=>i!==c.source),a=this.single?[]:s;return this.single&&r&&s.forEach(c=>c.source?.reset?.()),o&&a.push(n),a}skip(t,n){return this.cross&&n?.clients?.has(t)}predicate(t,n,r){let{union:i}=this;if(this.skip(r,n))return;let o=t.filter(s=>!this.skip(r,s)).map(s=>s.predicate);return i&&o.length>1?Qh(o):o}queueFilter(t){if(this.cross){let n=t.active?.source;return r=>r.active?.source!==n}}};function W_(){let e=new Set,t,n=new Promise(r=>t=r);return{pending(r){e.add(r)},ready(r){return e.delete(r),e.size===0},resolve(){n=new Promise(r=>{t(),t=r})},get promise(){return n}}}var gw={};zs(gw,{Area:()=>dl,Arrow:()=>mm,BarX:()=>ym,BarY:()=>gm,Cell:()=>pl,Contour:()=>Am,Density:()=>Dm,Dot:()=>ml,Frame:()=>am,Geo:()=>Nm,Hexgrid:()=>Om,Image:()=>Bm,Line:()=>yl,Link:()=>dm,Mark:()=>xt,Raster:()=>Mm,Rect:()=>bl,RuleX:()=>nm,RuleY:()=>rm,Text:()=>ul,TickX:()=>_m,TickY:()=>vm,Tip:()=>cm,Vector:()=>hl,area:()=>hm,areaX:()=>Va,areaY:()=>$s,arrow:()=>NO,auto:()=>zO,autoSpec:()=>hM,axisFx:()=>k1,axisFy:()=>L1,axisX:()=>om,axisY:()=>im,barX:()=>Ao,barY:()=>To,bin:()=>Rs,binX:()=>Io,binY:()=>Mo,bollinger:()=>Ga,bollingerX:()=>GO,bollingerY:()=>XO,boxX:()=>HO,boxY:()=>ZO,cell:()=>ja,cellX:()=>BO,cellY:()=>FO,centroid:()=>WB,circle:()=>kO,cluster:()=>YB,column:()=>ln,contour:()=>oB,crosshair:()=>cB,crosshairX:()=>lB,crosshairY:()=>uB,delaunayLink:()=>dB,delaunayMesh:()=>pB,density:()=>xB,differenceY:()=>vB,dodgeX:()=>sF,dodgeY:()=>aF,dot:()=>ni,dotX:()=>CO,dotY:()=>LO,filter:()=>VD,find:()=>QD,formatIsoDate:()=>_I,formatMonth:()=>r5,formatWeekday:()=>i5,frame:()=>yf,geo:()=>sw,geoCentroid:()=>GB,graticule:()=>IB,gridFx:()=>U1,gridFy:()=>$1,gridX:()=>P1,gridY:()=>R1,group:()=>Xp,groupX:()=>La,groupY:()=>ka,groupZ:()=>Gp,hexagon:()=>RO,hexbin:()=>MB,hexgrid:()=>AB,hull:()=>mB,identity:()=>W,image:()=>EB,indexOf:()=>ve,initializer:()=>xe,interpolateNearest:()=>xM,interpolateNone:()=>ow,interpolatorBarycentric:()=>bM,interpolatorRandomWalk:()=>wM,legend:()=>QN,line:()=>gl,lineX:()=>Ya,lineY:()=>Wa,linearRegressionX:()=>OB,linearRegressionY:()=>BB,link:()=>Z1,map:()=>dr,mapX:()=>Df,mapY:()=>Nf,marks:()=>Ze,normalize:()=>mw,normalizeX:()=>fF,normalizeY:()=>hF,plot:()=>um,pointer:()=>ff,pointerX:()=>hf,pointerY:()=>sl,raster:()=>eB,rect:()=>xm,rectX:()=>Af,rectY:()=>Tf,reverse:()=>jD,ruleX:()=>Cr,ruleY:()=>Lr,scale:()=>lf,select:()=>pF,selectFirst:()=>zM,selectLast:()=>qM,selectMaxX:()=>gF,selectMaxY:()=>bF,selectMinX:()=>mF,selectMinY:()=>yF,shiftX:()=>dF,shuffle:()=>YD,sort:()=>Jx,sphere:()=>SB,spike:()=>BN,stackX:()=>lM,stackX1:()=>_O,stackX2:()=>vO,stackY:()=>uM,stackY1:()=>SO,stackY2:()=>IO,text:()=>So,textX:()=>E1,textY:()=>D1,tickX:()=>nw,tickY:()=>rw,tip:()=>V1,transform:()=>un,tree:()=>LM,treeLink:()=>fw,treeNode:()=>Fm,valueof:()=>dt,vector:()=>QI,vectorX:()=>B1,vectorY:()=>F1,voronoi:()=>yB,voronoiMesh:()=>gB,window:()=>Of,windowX:()=>qO,windowY:()=>VO});function $t(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function zn(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function rs(e){let t,n,r;e.length!==2?(t=$t,n=(a,c)=>$t(e(a),c),r=(a,c)=>e(a)-c):(t=e===$t||e===zn?e:bR,n=e,r=e);function i(a,c,l=0,u=a.length){if(l<u){if(t(c,c)!==0)return u;do{let f=l+u>>>1;n(a[f],c)<0?l=f+1:u=f}while(l<u)}return l}function o(a,c,l=0,u=a.length){if(l<u){if(t(c,c)!==0)return u;do{let f=l+u>>>1;n(a[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function s(a,c,l=0,u=a.length){let f=i(a,c,l,u-1);return f>l&&r(a[f-1],c)>-r(a[f],c)?f-1:f}return{left:i,center:s,right:o}}function bR(){return 0}function id(e){return e===null?NaN:+e}function*kA(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var RA=rs($t),$A=RA.right,xR=RA.left,wR=rs(id).center,is=$A;var od=PA(UA),G_=PA(_R);function PA(e){return function(t,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:s}=t;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((s=Math.floor(s!==void 0?s:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!s||!n&&!r)return t;let a=n&&e(n),c=r&&e(r),l=i.slice();return a&&c?(Hl(a,l,i,o,s),Hl(a,i,l,o,s),Hl(a,l,i,o,s),Zl(c,i,l,o,s),Zl(c,l,i,o,s),Zl(c,i,l,o,s)):a?(Hl(a,i,l,o,s),Hl(a,l,i,o,s),Hl(a,i,l,o,s)):c&&(Zl(c,i,l,o,s),Zl(c,l,i,o,s),Zl(c,i,l,o,s)),t}}function Hl(e,t,n,r,i){for(let o=0,s=r*i;o<s;)e(t,n,o,o+=r,1)}function Zl(e,t,n,r,i){for(let o=0,s=r*i;o<r;++o)e(t,n,o,o+s,r)}function _R(e){let t=UA(e);return(n,r,i,o,s)=>{i<<=2,o<<=2,s<<=2,t(n,r,i+0,o+0,s),t(n,r,i+1,o+1,s),t(n,r,i+2,o+2,s),t(n,r,i+3,o+3,s)}}function UA(e){let t=Math.floor(e);if(t===e)return vR(e);let n=e-t,r=2*e+1;return(i,o,s,a,c)=>{if(!((a-=c)>=s))return;let l=t*o[s],u=c*t,f=u+c;for(let h=s,d=s+u;h<d;h+=c)l+=o[Math.min(a,h)];for(let h=s,d=a;h<=d;h+=c)l+=o[Math.min(a,h+u)],i[h]=(l+n*(o[Math.max(s,h-f)]+o[Math.min(a,h+f)]))/r,l-=o[Math.max(s,h-u)]}}function vR(e){let t=2*e+1;return(n,r,i,o,s)=>{if(!((o-=s)>=i))return;let a=e*r[i],c=s*e;for(let l=i,u=i+c;l<u;l+=s)a+=r[Math.min(o,l)];for(let l=i,u=o;l<=u;l+=s)a+=r[Math.min(o,l+c)],n[l]=a/t,a-=r[Math.max(i,l-c)]}}function Hi(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function SR(e){return e.length|0}function IR(e){return!(e>0)}function MR(e){return typeof e!="object"||"length"in e?e:Array.from(e)}function AR(e){return t=>e(...t)}function F0(...e){let t=typeof e[e.length-1]=="function"&&AR(e.pop());e=e.map(MR);let n=e.map(SR),r=e.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(IR))return o;for(;;){o.push(i.map((a,c)=>e[c][a]));let s=r;for(;++i[s]===n[s];){if(s===0)return t?o.map(t):o;i[s--]=0}}}function C0(e,t){var n=0,r=0;return Float64Array.from(e,t===void 0?i=>n+=+i||0:i=>n+=+t(i,r++,e)||0)}function la(e,t){let n=0,r,i=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i))}if(n>1)return o/(n-1)}function Vr(e,t){let n=la(e,t);return n&&Math.sqrt(n)}function ie(e,t){let n,r;if(t===void 0)for(let i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}var bn=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){let n=this._partials,r=0;for(let i=0;i<this._n&&i<32;i++){let o=n[i],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(n[r++]=a),t=s}return n[r]=t,this._n=r+1,this}valueOf(){let t=this._partials,n=this._n,r,i,o,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}};var qn=class extends Map{constructor(t,n=VA){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(let[r,i]of t)this.set(r,i)}get(t){return super.get(X_(this,t))}has(t){return super.has(X_(this,t))}set(t,n){return super.set(zA(this,t),n)}delete(t){return super.delete(qA(this,t))}},Vn=class extends Set{constructor(t,n=VA){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(let r of t)this.add(r)}has(t){return super.has(X_(this,t))}add(t){return super.add(zA(this,t))}delete(t){return super.delete(qA(this,t))}};function X_({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function zA({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function qA({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function VA(e){return e!==null&&typeof e=="object"?e.valueOf():e}function sd(e){return e}function en(e,...t){return Z_(e,sd,sd,t)}function Mi(e,t,...n){return Z_(e,sd,t,n)}function H_(e,t,...n){return Z_(e,Array.from,t,n)}function Z_(e,t,n,r){return function i(o,s){if(s>=r.length)return n(o);let a=new qn,c=r[s++],l=-1;for(let u of o){let f=c(u,++l,o),h=a.get(f);h?h.push(u):a.set(f,[u])}for(let[u,f]of a)a.set(u,i(f,s));return t(a)}(e,0)}function K_(e,t){return Array.from(t,n=>e[n])}function Zi(e,...t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&n.length!==2||t.length>1){let r=Uint32Array.from(e,(i,o)=>o);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,o)=>{for(let s of t){let a=Sc(s[i],s[o]);if(a)return a}})):(n=e.map(n),r.sort((i,o)=>Sc(n[i],n[o]))),K_(e,r)}return e.sort(ad(n))}function ad(e=$t){if(e===$t)return Sc;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Sc(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function Kl(e,t,n){return(t.length!==2?Zi(Mi(e,t,n),([r,i],[o,s])=>$t(i,s)||$t(r,o)):Zi(en(e,n),([r,i],[o,s])=>t(i,s)||$t(r,o))).map(([r])=>r)}var TR=Math.sqrt(50),ER=Math.sqrt(10),DR=Math.sqrt(2);function L0(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=TR?10:o>=ER?5:o>=DR?2:1,a,c,l;return i<0?(l=Math.pow(10,-i)/s,a=Math.round(e*l),c=Math.round(t*l),a/l<e&&++a,c/l>t&&--c,l=-l):(l=Math.pow(10,i)*s,a=Math.round(e/l),c=Math.round(t/l),a*l<e&&++a,c*l>t&&--c),c<a&&.5<=n&&n<2?L0(e,t,n*2):[a,c,l]}function xn(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,o,s]=r?L0(t,e,n):L0(e,t,n);if(!(o>=i))return[];let a=o-i+1,c=new Array(a);if(r)if(s<0)for(let l=0;l<a;++l)c[l]=(o-l)/-s;else for(let l=0;l<a;++l)c[l]=(o-l)*s;else if(s<0)for(let l=0;l<a;++l)c[l]=(i+l)/-s;else for(let l=0;l<a;++l)c[l]=(i+l)*s;return c}function os(e,t,n){return t=+t,e=+e,n=+n,L0(e,t,n)[2]}function Ql(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?os(t,e,n):os(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Jl(e,t,n){let r;for(;;){let i=os(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function ua(e){return Math.max(1,Math.ceil(Math.log(Hi(e))/Math.LN2)+1)}function Vt(e,t){let n;if(t===void 0)for(let r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function k0(e,t){let n,r=-1,i=-1;if(t===void 0)for(let o of e)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function oe(e,t){let n;if(t===void 0)for(let r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function R0(e,t){let n,r=-1,i=-1;if(t===void 0)for(let o of e)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function $0(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Sc:ad(i);r>n;){if(r-n>600){let c=r-n+1,l=t-n+1,u=Math.log(c),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(c-f)/c)*(l-c/2<0?-1:1),d=Math.max(n,Math.floor(t-l*f/c+h)),p=Math.min(r,Math.floor(t+(c-l)*f/c+h));$0(e,t,d,p,i)}let o=e[t],s=n,a=r;for(cd(e,n,t),i(e[r],o)>0&&cd(e,n,r);s<a;){for(cd(e,s,a),++s,--a;i(e[s],o)<0;)++s;for(;i(e[a],o)>0;)--a}i(e[n],o)===0?cd(e,n,a):(++a,cd(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function cd(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Ic(e,t=$t){let n,r=!1;if(t.length===1){let i;for(let o of e){let s=t(o);(r?$t(s,i)>0:$t(s,s)===0)&&(n=o,i=s,r=!0)}}else for(let i of e)(r?t(i,n)>0:t(i,i)===0)&&(n=i,r=!0);return n}function jn(e,t,n){if(e=Float64Array.from(kA(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return oe(e);if(t>=1)return Vt(e);var r,i=(r-1)*t,o=Math.floor(i),s=Vt($0(e,o).subarray(0,o+1)),a=oe(e.subarray(o+1));return s+(a-s)*(i-o)}}function Q_(e,t,n=id){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(i-o)}}function P0(e,t,n){let r=Hi(e),i=jn(e,.75)-jn(e,.25);return r&&i?Math.ceil((n-t)/(2*i*Math.pow(r,-1/3))):1}function ld(e,t,n){let r=Hi(e),i=Vr(e);return r&&i?Math.ceil((n-t)*Math.cbrt(r)/(3.49*i)):1}function ss(e,t){let n=0,r=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function Ai(e,t){return jn(e,.5,t)}function*OR(e){for(let t of e)yield*t}function tu(e){return Array.from(OR(e))}function eu(e,t){let n=new qn;if(t===void 0)for(let o of e)o!=null&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let s of e)(s=t(s,++o,e))!=null&&s>=s&&n.set(s,(n.get(s)||0)+1)}let r,i=0;for(let[o,s]of n)s>i&&(i=s,r=o);return r}function U0(e,t=BR){let n=[],r,i=!1;for(let o of e)i&&n.push(t(r,o)),r=o,i=!0;return n}function BR(e,t){return[e,t]}function ke(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function ud(e,t=$t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(e),r=new Float64Array(n.length);t.length!==2&&(n=n.map(t),t=$t);let i=(a,c)=>t(n[a],n[c]),o,s;return e=Uint32Array.from(n,(a,c)=>c),e.sort(t===$t?(a,c)=>Sc(n[a],n[c]):ad(i)),e.forEach((a,c)=>{let l=i(a,o===void 0?a:o);l>=0?((o===void 0||l>0)&&(o=a,s=c),r[a]=s):r[a]=NaN}),r}function z0(e,t=$t){let n,r=!1;if(t.length===1){let i;for(let o of e){let s=t(o);(r?$t(s,i)<0:$t(s,s)===0)&&(n=o,i=s,r=!0)}}else for(let i of e)(r?t(i,n)<0:t(i,i)===0)&&(n=i,r=!0);return n}function wn(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function fa(e){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(e).reverse()}function jA(e){return e}var J_=1,tv=2,ev=3,q0=4,YA=1e-6;function FR(e){return"translate("+e+",0)"}function CR(e){return"translate(0,"+e+")"}function LR(e){return t=>+e(t)}function kR(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function RR(){return!this.__axis}function $R(e,t){var n=[],r=null,i=null,o=6,s=6,a=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=e===J_||e===q0?-1:1,u=e===q0||e===tv?"x":"y",f=e===J_||e===ev?FR:CR;function h(d){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):jA),g=Math.max(o,0)+a,y=t.range(),b=+y[0]+c,x=+y[y.length-1]+c,w=(t.bandwidth?kR:LR)(t.copy(),c),v=d.selection?d.selection():d,_=v.selectAll(".domain").data([null]),M=v.selectAll(".tick").data(p,t).order(),E=M.exit(),N=M.enter().append("g").attr("class","tick"),I=M.select("line"),T=M.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),M=M.merge(N),I=I.merge(N.append("line").attr("stroke","currentColor").attr(u+"2",l*o)),T=T.merge(N.append("text").attr("fill","currentColor").attr(u,l*g).attr("dy",e===J_?"0em":e===ev?"0.71em":"0.32em")),d!==v&&(_=_.transition(d),M=M.transition(d),I=I.transition(d),T=T.transition(d),E=E.transition(d).attr("opacity",YA).attr("transform",function(O){return isFinite(O=w(O))?f(O+c):this.getAttribute("transform")}),N.attr("opacity",YA).attr("transform",function(O){var B=this.parentNode.__axis;return f((B&&isFinite(B=B(O))?B:w(O))+c)})),E.remove(),_.attr("d",e===q0||e===tv?s?"M"+l*s+","+b+"H"+c+"V"+x+"H"+l*s:"M"+c+","+b+"V"+x:s?"M"+b+","+l*s+"V"+c+"H"+x+"V"+l*s:"M"+b+","+c+"H"+x),M.attr("opacity",1).attr("transform",function(O){return f(w(O)+c)}),I.attr(u+"2",l*o),T.attr(u,l*g).text(m),v.filter(RR).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===tv?"start":e===q0?"end":"middle"),v.each(function(){this.__axis=w})}return h.scale=function(d){return arguments.length?(t=d,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),h):n.slice()},h.tickValues=function(d){return arguments.length?(r=d==null?null:Array.from(d),h):r&&r.slice()},h.tickFormat=function(d){return arguments.length?(i=d,h):i},h.tickSize=function(d){return arguments.length?(o=s=+d,h):o},h.tickSizeInner=function(d){return arguments.length?(o=+d,h):o},h.tickSizeOuter=function(d){return arguments.length?(s=+d,h):s},h.tickPadding=function(d){return arguments.length?(a=+d,h):a},h.offset=function(d){return arguments.length?(c=+d,h):c},h}function nv(e){return $R(ev,e)}var PR={value:()=>{}};function GA(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new V0(n)}function V0(e){this._=e}function UR(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}V0.prototype=GA.prototype={constructor:V0,on:function(e,t){var n=this._,r=UR(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=zR(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=WA(n[i],e.name,t);else if(t==null)for(i in n)n[i]=WA(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new V0(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function zR(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function WA(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=PR,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Mc=GA;var j0="http://www.w3.org/1999/xhtml",jr={svg:"http://www.w3.org/2000/svg",xhtml:j0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function as(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),jr.hasOwnProperty(t)?{space:jr[t],local:e}:e}function qR(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===j0&&t.documentElement.namespaceURI===j0?t.createElement(e):t.createElementNS(n,e)}}function VR(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function cs(e){var t=as(e);return(t.local?VR:qR)(t)}function jR(){}function Ac(e){return e==null?jR:function(){return this.querySelector(e)}}function XA(e){typeof e!="function"&&(e=Ac(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=new Array(s),c,l,u=0;u<s;++u)(c=o[u])&&(l=e.call(c,c.__data__,u,o))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new Be(r,this._parents)}function rv(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function YR(){return[]}function fd(e){return e==null?YR:function(){return this.querySelectorAll(e)}}function WR(e){return function(){return rv(e.apply(this,arguments))}}function HA(e){typeof e=="function"?e=WR(e):e=fd(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(r.push(e.call(c,c.__data__,l,s)),i.push(c));return new Be(r,i)}function hd(e){return function(){return this.matches(e)}}function Y0(e){return function(t){return t.matches(e)}}var GR=Array.prototype.find;function XR(e){return function(){return GR.call(this.children,e)}}function HR(){return this.firstElementChild}function ZA(e){return this.select(e==null?HR:XR(typeof e=="function"?e:Y0(e)))}var ZR=Array.prototype.filter;function KR(){return Array.from(this.children)}function QR(e){return function(){return ZR.call(this.children,e)}}function KA(e){return this.selectAll(e==null?KR:QR(typeof e=="function"?e:Y0(e)))}function QA(e){typeof e!="function"&&(e=hd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&e.call(c,c.__data__,l,o)&&a.push(c);return new Be(r,this._parents)}function W0(e){return new Array(e.length)}function JA(){return new Be(this._enter||this._groups.map(W0),this._parents)}function dd(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}dd.prototype={constructor:dd,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function tT(e){return function(){return e}}function JR(e,t,n,r,i,o){for(var s=0,a,c=t.length,l=o.length;s<l;++s)(a=t[s])?(a.__data__=o[s],r[s]=a):n[s]=new dd(e,o[s]);for(;s<c;++s)(a=t[s])&&(i[s]=a)}function t9(e,t,n,r,i,o,s){var a,c,l=new Map,u=t.length,f=o.length,h=new Array(u),d;for(a=0;a<u;++a)(c=t[a])&&(h[a]=d=s.call(c,c.__data__,a,t)+"",l.has(d)?i[a]=c:l.set(d,c));for(a=0;a<f;++a)d=s.call(e,o[a],a,o)+"",(c=l.get(d))?(r[a]=c,c.__data__=o[a],l.delete(d)):n[a]=new dd(e,o[a]);for(a=0;a<u;++a)(c=t[a])&&l.get(h[a])===c&&(i[a]=c)}function e9(e){return e.__data__}function eT(e,t){if(!arguments.length)return Array.from(this,e9);var n=t?t9:JR,r=this._parents,i=this._groups;typeof e!="function"&&(e=tT(e));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],f=i[l],h=f.length,d=n9(e.call(u,u&&u.__data__,l,r)),p=d.length,m=a[l]=new Array(p),g=s[l]=new Array(p),y=c[l]=new Array(h);n(u,f,m,g,y,d,t);for(var b=0,x=0,w,v;b<p;++b)if(w=m[b]){for(b>=x&&(x=b+1);!(v=g[x])&&++x<p;);w._next=v||null}}return s=new Be(s,r),s._enter=a,s._exit=c,s}function n9(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nT(){return new Be(this._exit||this._groups.map(W0),this._parents)}function rT(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function iT(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var l=n[c],u=r[c],f=l.length,h=a[c]=new Array(f),d,p=0;p<f;++p)(d=l[p]||u[p])&&(h[p]=d);for(;c<i;++c)a[c]=n[c];return new Be(a,this._parents)}function oT(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function sT(e){e||(e=r9);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,c=i[o]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(t)}return new Be(i,this._parents).order()}function r9(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function aT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cT(){return Array.from(this)}function lT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function uT(){let e=0;for(let t of this)++e;return e}function fT(){return!this.node()}function hT(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&e.call(a,a.__data__,o,i);return this}function i9(e){return function(){this.removeAttribute(e)}}function o9(e){return function(){this.removeAttributeNS(e.space,e.local)}}function s9(e,t){return function(){this.setAttribute(e,t)}}function a9(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function c9(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function l9(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function dT(e,t){var n=as(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?o9:i9:typeof t=="function"?n.local?l9:c9:n.local?a9:s9)(n,t))}function G0(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function u9(e){return function(){this.style.removeProperty(e)}}function f9(e,t,n){return function(){this.style.setProperty(e,t,n)}}function h9(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function pT(e,t,n){return arguments.length>1?this.each((t==null?u9:typeof t=="function"?h9:f9)(e,t,n??"")):ha(this.node(),e)}function ha(e,t){return e.style.getPropertyValue(t)||G0(e).getComputedStyle(e,null).getPropertyValue(t)}function d9(e){return function(){delete this[e]}}function p9(e,t){return function(){this[e]=t}}function m9(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function mT(e,t){return arguments.length>1?this.each((t==null?d9:typeof t=="function"?m9:p9)(e,t)):this.node()[e]}function yT(e){return e.trim().split(/^|\s+/)}function iv(e){return e.classList||new gT(e)}function gT(e){this._node=e,this._names=yT(e.getAttribute("class")||"")}gT.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function bT(e,t){for(var n=iv(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function xT(e,t){for(var n=iv(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function y9(e){return function(){bT(this,e)}}function g9(e){return function(){xT(this,e)}}function b9(e,t){return function(){(t.apply(this,arguments)?bT:xT)(this,e)}}function wT(e,t){var n=yT(e+"");if(arguments.length<2){for(var r=iv(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?b9:t?y9:g9)(n,t))}function x9(){this.textContent=""}function w9(e){return function(){this.textContent=e}}function _9(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function _T(e){return arguments.length?this.each(e==null?x9:(typeof e=="function"?_9:w9)(e)):this.node().textContent}function v9(){this.innerHTML=""}function S9(e){return function(){this.innerHTML=e}}function I9(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function vT(e){return arguments.length?this.each(e==null?v9:(typeof e=="function"?I9:S9)(e)):this.node().innerHTML}function M9(){this.nextSibling&&this.parentNode.appendChild(this)}function ST(){return this.each(M9)}function A9(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function IT(){return this.each(A9)}function MT(e){var t=typeof e=="function"?e:cs(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function T9(){return null}function AT(e,t){var n=typeof e=="function"?e:cs(e),r=t==null?T9:typeof t=="function"?t:Ac(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function E9(){var e=this.parentNode;e&&e.removeChild(this)}function TT(){return this.each(E9)}function D9(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function N9(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ET(e){return this.select(e?N9:D9)}function DT(e){return arguments.length?this.property("__data__",e):this.node().__data__}function O9(e){return function(t){e.call(this,t,this.__data__)}}function B9(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function F9(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function C9(e,t,n){return function(){var r=this.__on,i,o=O9(t);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function NT(e,t,n){var r=B9(e+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(i=0,u=a[c];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?C9:F9,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function OT(e,t,n){var r=G0(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function L9(e,t){return function(){return OT(this,e,t)}}function k9(e,t){return function(){return OT(this,e,t.apply(this,arguments))}}function BT(e,t){return this.each((typeof t=="function"?k9:L9)(e,t))}function*FT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var ov=[null];function Be(e,t){this._groups=e,this._parents=t}function CT(){return new Be([[document.documentElement]],ov)}function R9(){return this}Be.prototype=CT.prototype={constructor:Be,select:XA,selectAll:HA,selectChild:ZA,selectChildren:KA,filter:QA,data:eT,enter:JA,exit:nT,join:rT,merge:iT,selection:R9,order:oT,sort:sT,call:aT,nodes:cT,node:lT,size:uT,empty:fT,each:hT,attr:dT,style:pT,property:mT,classed:wT,text:_T,html:vT,raise:ST,lower:IT,append:MT,insert:AT,remove:TT,clone:ET,datum:DT,on:NT,dispatch:BT,[Symbol.iterator]:FT};var ls=CT;function Pt(e){return typeof e=="string"?new Be([[document.querySelector(e)]],[document.documentElement]):new Be([[e]],ov)}function LT(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Dn(e,t){if(e=LT(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var X0={capture:!0,passive:!1};function H0(e){e.preventDefault(),e.stopImmediatePropagation()}function pd(e){var t=e.document.documentElement,n=Pt(e).on("dragstart.drag",H0,X0);"onselectstart"in t?n.on("selectstart.drag",H0,X0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function md(e,t){var n=e.document.documentElement,r=Pt(e).on("dragstart.drag",null);t&&(r.on("click.drag",H0,X0),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 us(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function da(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Qi(){}var pa=.7,Dc=1/pa,nu="\\s*([+-]?\\d+)\\s*",yd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ki="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$9=/^#([0-9a-f]{3,8})$/,P9=new RegExp(`^rgb\\(${nu},${nu},${nu}\\)$`),U9=new RegExp(`^rgb\\(${Ki},${Ki},${Ki}\\)$`),z9=new RegExp(`^rgba\\(${nu},${nu},${nu},${yd}\\)$`),q9=new RegExp(`^rgba\\(${Ki},${Ki},${Ki},${yd}\\)$`),V9=new RegExp(`^hsl\\(${yd},${Ki},${Ki}\\)$`),j9=new RegExp(`^hsla\\(${yd},${Ki},${Ki},${yd}\\)$`),kT={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};us(Qi,Ar,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:RT,formatHex:RT,formatHex8:Y9,formatHsl:W9,formatRgb:$T,toString:$T});function RT(){return this.rgb().formatHex()}function Y9(){return this.rgb().formatHex8()}function W9(){return jT(this).formatHsl()}function $T(){return this.rgb().formatRgb()}function Ar(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=$9.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?PT(t):n===3?new qe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Z0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Z0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=P9.exec(e))?new qe(t[1],t[2],t[3],1):(t=U9.exec(e))?new qe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=z9.exec(e))?Z0(t[1],t[2],t[3],t[4]):(t=q9.exec(e))?Z0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=V9.exec(e))?qT(t[1],t[2]/100,t[3]/100,1):(t=j9.exec(e))?qT(t[1],t[2]/100,t[3]/100,t[4]):kT.hasOwnProperty(e)?PT(kT[e]):e==="transparent"?new qe(NaN,NaN,NaN,0):null}function PT(e){return new qe(e>>16&255,e>>8&255,e&255,1)}function Z0(e,t,n,r){return r<=0&&(e=t=n=NaN),new qe(e,t,n,r)}function gd(e){return e instanceof Qi||(e=Ar(e)),e?(e=e.rgb(),new qe(e.r,e.g,e.b,e.opacity)):new qe}function Je(e,t,n,r){return arguments.length===1?gd(e):new qe(e,t,n,r??1)}function qe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}us(qe,Je,da(Qi,{brighter(e){return e=e==null?Dc:Math.pow(Dc,e),new qe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?pa:Math.pow(pa,e),new qe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qe(Ec(this.r),Ec(this.g),Ec(this.b),Q0(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:UT,formatHex:UT,formatHex8:G9,formatRgb:zT,toString:zT}));function UT(){return`#${Tc(this.r)}${Tc(this.g)}${Tc(this.b)}`}function G9(){return`#${Tc(this.r)}${Tc(this.g)}${Tc(this.b)}${Tc((isNaN(this.opacity)?1:this.opacity)*255)}`}function zT(){let e=Q0(this.opacity);return`${e===1?"rgb(":"rgba("}${Ec(this.r)}, ${Ec(this.g)}, ${Ec(this.b)}${e===1?")":`, ${e})`}`}function Q0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ec(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tc(e){return e=Ec(e),(e<16?"0":"")+e.toString(16)}function qT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ti(e,t,n,r)}function jT(e){if(e instanceof Ti)return new Ti(e.h,e.s,e.l,e.opacity);if(e instanceof Qi||(e=Ar(e)),!e)return new Ti;if(e instanceof Ti)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new Ti(s,a,c,e.opacity)}function bd(e,t,n,r){return arguments.length===1?jT(e):new Ti(e,t,n,r??1)}function Ti(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}us(Ti,bd,da(Qi,{brighter(e){return e=e==null?Dc:Math.pow(Dc,e),new Ti(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pa:Math.pow(pa,e),new Ti(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new qe(sv(e>=240?e-240:e+120,i,r),sv(e,i,r),sv(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ti(VT(this.h),K0(this.s),K0(this.l),Q0(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 e=Q0(this.opacity);return`${e===1?"hsl(":"hsla("}${VT(this.h)}, ${K0(this.s)*100}%, ${K0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function VT(e){return e=(e||0)%360,e<0?e+360:e}function K0(e){return Math.max(0,Math.min(1,e||0))}function sv(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var J0=Math.PI/180,tg=180/Math.PI;var eg=18,YT=.96422,WT=1,GT=.82521,XT=4/29,ru=6/29,HT=3*ru*ru,X9=ru*ru*ru;function ZT(e){if(e instanceof Ji)return new Ji(e.l,e.a,e.b,e.opacity);if(e instanceof fs)return KT(e);e instanceof qe||(e=gd(e));var t=uv(e.r),n=uv(e.g),r=uv(e.b),i=av((.2225045*t+.7168786*n+.0606169*r)/WT),o,s;return t===n&&n===r?o=s=i:(o=av((.4360747*t+.3850649*n+.1430804*r)/YT),s=av((.0139322*t+.0971045*n+.7141733*r)/GT)),new Ji(116*i-16,500*(o-i),200*(i-s),e.opacity)}function iu(e,t,n,r){return arguments.length===1?ZT(e):new Ji(e,t,n,r??1)}function Ji(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}us(Ji,iu,da(Qi,{brighter(e){return new Ji(this.l+eg*(e??1),this.a,this.b,this.opacity)},darker(e){return new Ji(this.l-eg*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=YT*cv(t),e=WT*cv(e),n=GT*cv(n),new qe(lv(3.1338561*t-1.6168667*e-.4906146*n),lv(-.9787684*t+1.9161415*e+.033454*n),lv(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function av(e){return e>X9?Math.pow(e,1/3):e/HT+XT}function cv(e){return e>ru?e*e*e:HT*(e-XT)}function lv(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function uv(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function H9(e){if(e instanceof fs)return new fs(e.h,e.c,e.l,e.opacity);if(e instanceof Ji||(e=ZT(e)),e.a===0&&e.b===0)return new fs(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*tg;return new fs(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function xd(e,t,n,r){return arguments.length===1?H9(e):new fs(e,t,n,r??1)}function fs(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function KT(e){if(isNaN(e.h))return new Ji(e.l,0,0,e.opacity);var t=e.h*J0;return new Ji(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}us(fs,xd,da(Qi,{brighter(e){return new fs(this.h,this.c,this.l+eg*(e??1),this.opacity)},darker(e){return new fs(this.h,this.c,this.l-eg*(e??1),this.opacity)},rgb(){return KT(this).rgb()}}));var e4=-.14861,fv=1.78277,hv=-.29227,ng=-.90649,wd=1.97294,QT=wd*ng,JT=wd*fv,t4=fv*hv-ng*e4;function Z9(e){if(e instanceof Nc)return new Nc(e.h,e.s,e.l,e.opacity);e instanceof qe||(e=gd(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(t4*r+QT*t-JT*n)/(t4+QT-JT),o=r-i,s=(wd*(n-i)-hv*o)/ng,a=Math.sqrt(s*s+o*o)/(wd*i*(1-i)),c=a?Math.atan2(s,o)*tg-120:NaN;return new Nc(c<0?c+360:c,a,i,e.opacity)}function Yn(e,t,n,r){return arguments.length===1?Z9(e):new Nc(e,t,n,r??1)}function Nc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}us(Nc,Yn,da(Qi,{brighter(e){return e=e==null?Dc:Math.pow(Dc,e),new Nc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pa:Math.pow(pa,e),new Nc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*J0,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new qe(255*(t+n*(e4*r+fv*i)),255*(t+n*(hv*r+ng*i)),255*(t+n*(wd*r)),this.opacity)}}));function dv(e,t,n,r,i){var o=e*e,s=o*e;return((1-3*e+3*o-s)*t+(4-6*o+3*s)*n+(1+3*e+3*o-3*s)*r+s*i)/6}function n4(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],s=r>0?e[r-1]:2*i-o,a=r<t-1?e[r+2]:2*o-i;return dv((n-r/t)*t,s,i,o,a)}}function r4(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],o=e[r%t],s=e[(r+1)%t],a=e[(r+2)%t];return dv((n-r/t)*t,i,o,s,a)}}var ou=e=>()=>e;function i4(e,t){return function(n){return e+n*t}}function K9(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function su(e,t){var n=t-e;return n?i4(e,n>180||n<-180?n-360*Math.round(n/360):n):ou(isNaN(e)?t:e)}function o4(e){return(e=+e)==1?_e:function(t,n){return n-t?K9(t,n,e):ou(isNaN(t)?n:t)}}function _e(e,t){var n=t-e;return n?i4(e,n):ou(isNaN(e)?t:e)}var Yr=function e(t){var n=o4(t);function r(i,o){var s=n((i=Je(i)).r,(o=Je(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=_e(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=e,r}(1);function s4(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;s<n;++s)a=Je(t[s]),r[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return r=e(r),i=e(i),o=e(o),a.opacity=1,function(c){return a.r=r(c),a.g=i(c),a.b=o(c),a+""}}}var pv=s4(n4),Q9=s4(r4);function a4(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function c4(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function l4(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=Tr(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<r;++s)o[s]=i[s](a);return o}}function u4(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ge(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function f4(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Tr(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var yv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mv=new RegExp(yv.source,"g");function J9(e){return function(){return e}}function t$(e){return function(t){return e(t)+""}}function _d(e,t){var n=yv.lastIndex=mv.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(e=e+"",t=t+"";(r=yv.exec(e))&&(i=mv.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:ge(r,i)})),n=mv.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?t$(c[0].x):J9(t):(t=c.length,function(l){for(var u=0,f;u<t;++u)a[(f=c[u]).i]=f.x(l);return a.join("")})}function Tr(e,t){var n=typeof t,r;return t==null||n==="boolean"?ou(t):(n==="number"?ge:n==="string"?(r=Ar(t))?(t=r,Yr):_d:t instanceof Ar?Yr:t instanceof Date?u4:c4(t)?a4:Array.isArray(t)?l4:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?f4:ge)(e,t)}function Oc(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var h4=180/Math.PI,rg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gv(e,t,n,r,i,o){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*h4,skewX:Math.atan(c)*h4,scaleX:s,scaleY:a}}var ig;function d4(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?rg:gv(t.a,t.b,t.c,t.d,t.e,t.f)}function p4(e){return e==null?rg:(ig||(ig=document.createElementNS("http://www.w3.org/2000/svg","g")),ig.setAttribute("transform",e),(e=ig.transform.baseVal.consolidate())?(e=e.matrix,gv(e.a,e.b,e.c,e.d,e.e,e.f)):rg)}function m4(e,t,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,f,h,d,p){if(l!==f||u!==h){var m=d.push("translate(",null,t,null,n);p.push({i:m-4,x:ge(l,f)},{i:m-2,x:ge(u,h)})}else(f||h)&&d.push("translate("+f+t+h+n)}function s(l,u,f,h){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:ge(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(l,u,f,h){l!==u?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:ge(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(l,u,f,h,d,p){if(l!==f||u!==h){var m=d.push(i(d)+"scale(",null,",",null,")");p.push({i:m-4,x:ge(l,f)},{i:m-2,x:ge(u,h)})}else(f!==1||h!==1)&&d.push(i(d)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=e(l),u=e(u),o(l.translateX,l.translateY,u.translateX,u.translateY,f,h),s(l.rotate,u.rotate,f,h),a(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(d){for(var p=-1,m=h.length,g;++p<m;)f[(g=h[p]).i]=g.x(d);return f.join("")}}}var bv=m4(d4,"px, ","px)","deg)"),xv=m4(p4,", ",")",")");var e$=1e-12;function y4(e){return((e=Math.exp(e))+1/e)/2}function n$(e){return((e=Math.exp(e))-1/e)/2}function r$(e){return((e=Math.exp(2*e))-1)/(e+1)}var wv=function e(t,n,r){function i(o,s){var a=o[0],c=o[1],l=o[2],u=s[0],f=s[1],h=s[2],d=u-a,p=f-c,m=d*d+p*p,g,y;if(m<e$)y=Math.log(h/l)/t,g=function(M){return[a+M*d,c+M*p,l*Math.exp(t*M*y)]};else{var b=Math.sqrt(m),x=(h*h-l*l+r*m)/(2*l*n*b),w=(h*h-l*l-r*m)/(2*h*n*b),v=Math.log(Math.sqrt(x*x+1)-x),_=Math.log(Math.sqrt(w*w+1)-w);y=(_-v)/t,g=function(M){var E=M*y,N=y4(v),I=l/(n*b)*(N*r$(t*E+v)-n$(v));return[a+I*d,c+I*p,l*N/y4(t*E+v)]}}return g.duration=y*1e3*t/Math.SQRT2,g}return i.rho=function(o){var s=Math.max(.001,+o),a=s*s,c=a*a;return e(s,a,c)},i}(Math.SQRT2,2,4);function g4(e){return function(t,n){var r=e((t=bd(t)).h,(n=bd(n)).h),i=_e(t.s,n.s),o=_e(t.l,n.l),s=_e(t.opacity,n.opacity);return function(a){return t.h=r(a),t.s=i(a),t.l=o(a),t.opacity=s(a),t+""}}}var _v=g4(su),i$=g4(_e);function og(e,t){var n=_e((e=iu(e)).l,(t=iu(t)).l),r=_e(e.a,t.a),i=_e(e.b,t.b),o=_e(e.opacity,t.opacity);return function(s){return e.l=n(s),e.a=r(s),e.b=i(s),e.opacity=o(s),e+""}}function b4(e){return function(t,n){var r=e((t=xd(t)).h,(n=xd(n)).h),i=_e(t.c,n.c),o=_e(t.l,n.l),s=_e(t.opacity,n.opacity);return function(a){return t.h=r(a),t.c=i(a),t.l=o(a),t.opacity=s(a),t+""}}}var vv=b4(su),o$=b4(_e);function x4(e){return function t(n){n=+n;function r(i,o){var s=e((i=Yn(i)).h,(o=Yn(o)).h),a=_e(i.s,o.s),c=_e(i.l,o.l),l=_e(i.opacity,o.opacity);return function(u){return i.h=s(u),i.s=a(u),i.l=c(Math.pow(u,n)),i.opacity=l(u),i+""}}return r.gamma=t,r}(1)}var s$=x4(su),au=x4(_e);function to(e,t){t===void 0&&(t=e,e=Tr);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(s){var a=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return o[a](s-a)}}function Nn(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var cu=0,Sd=0,vd=0,_4=1e3,sg,Id,ag=0,Bc=0,cg=0,Md=typeof performance=="object"&&performance.now?performance:Date,v4=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Td(){return Bc||(v4(a$),Bc=Md.now()+cg)}function a$(){Bc=0}function Ad(){this._call=this._time=this._next=null}Ad.prototype=lg.prototype={constructor:Ad,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Td():+n)+(t==null?0:+t),!this._next&&Id!==this&&(Id?Id._next=this:sg=this,Id=this),this._call=e,this._time=n,Sv()},stop:function(){this._call&&(this._call=null,this._time=1/0,Sv())}};function lg(e,t,n){var r=new Ad;return r.restart(e,t,n),r}function S4(){Td(),++cu;for(var e=sg,t;e;)(t=Bc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--cu}function w4(){Bc=(ag=Md.now())+cg,cu=Sd=0;try{S4()}finally{cu=0,l$(),Bc=0}}function c$(){var e=Md.now(),t=e-ag;t>_4&&(cg-=t,ag=e)}function l$(){for(var e,t=sg,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:sg=n);Id=e,Sv(r)}function Sv(e){if(!cu){Sd&&(Sd=clearTimeout(Sd));var t=e-Bc;t>24?(e<1/0&&(Sd=setTimeout(w4,e-Md.now()-cg)),vd&&(vd=clearInterval(vd))):(vd||(ag=Md.now(),vd=setInterval(c$,_4)),cu=1,v4(w4))}}function ug(e,t,n){var r=new Ad;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var u$=Mc("start","end","cancel","interrupt"),f$=[],A4=0,I4=1,hg=2,fg=3,M4=4,dg=5,Ed=6;function ma(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;h$(e,n,{name:t,index:r,group:i,on:u$,tween:f$,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:A4})}function Dd(e,t){var n=tn(e,t);if(n.state>A4)throw new Error("too late; already scheduled");return n}function _n(e,t){var n=tn(e,t);if(n.state>fg)throw new Error("too late; already running");return n}function tn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function h$(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=lg(o,0,n.time);function o(l){n.state=I4,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,f,h,d;if(n.state!==I4)return c();for(u in r)if(d=r[u],d.name===n.name){if(d.state===fg)return ug(s);d.state===M4?(d.state=Ed,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete r[u]):+u<t&&(d.state=Ed,d.timer.stop(),d.on.call("cancel",e,e.__data__,d.index,d.group),delete r[u])}if(ug(function(){n.state===fg&&(n.state=M4,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=hg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===hg){for(n.state=fg,i=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(d=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=d);i.length=f+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=dg,1),f=-1,h=i.length;++f<h;)i[f].call(e,u);n.state===dg&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Ed,n.timer.stop(),delete r[t];for(var l in r)return;delete e.__transition}}function eo(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>hg&&r.state<dg,r.state=Ed,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function T4(e){return this.each(function(){eo(this,e)})}function d$(e,t){var n,r;return function(){var i=_n(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function p$(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=_n(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=a;break}c===l&&i.push(a)}o.tween=i}}function E4(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=tn(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?d$:p$)(n,e,t))}function lu(e,t,n){var r=e._id;return e.each(function(){var i=_n(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return tn(i,r).value[t]}}function pg(e,t){var n;return(typeof t=="number"?ge:t instanceof Ar?Yr:(n=Ar(t))?(t=n,Yr):_d)(e,t)}function m$(e){return function(){this.removeAttribute(e)}}function y$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function g$(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function b$(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function x$(e,t,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a)))}}function w$(e,t,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a)))}}function D4(e,t){var n=as(e),r=n==="transform"?xv:pg;return this.attrTween(e,typeof t=="function"?(n.local?w$:x$)(n,r,lu(this,"attr."+e,t)):t==null?(n.local?y$:m$)(n):(n.local?b$:g$)(n,r,t))}function _$(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function v$(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function S$(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&v$(e,o)),n}return i._value=t,i}function I$(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&_$(e,o)),n}return i._value=t,i}function N4(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=as(e);return this.tween(n,(r.local?S$:I$)(r,t))}function M$(e,t){return function(){Dd(this,e).delay=+t.apply(this,arguments)}}function A$(e,t){return t=+t,function(){Dd(this,e).delay=t}}function O4(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?M$:A$)(t,e)):tn(this.node(),t).delay}function T$(e,t){return function(){_n(this,e).duration=+t.apply(this,arguments)}}function E$(e,t){return t=+t,function(){_n(this,e).duration=t}}function B4(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?T$:E$)(t,e)):tn(this.node(),t).duration}function D$(e,t){if(typeof t!="function")throw new Error;return function(){_n(this,e).ease=t}}function F4(e){var t=this._id;return arguments.length?this.each(D$(t,e)):tn(this.node(),t).ease}function N$(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;_n(this,e).ease=n}}function C4(e){if(typeof e!="function")throw new Error;return this.each(N$(this._id,e))}function L4(e){typeof e!="function"&&(e=hd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&e.call(c,c.__data__,l,o)&&a.push(c);return new Wn(r,this._parents,this._name,this._id)}function k4(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=t[a],l=n[a],u=c.length,f=s[a]=new Array(u),h,d=0;d<u;++d)(h=c[d]||l[d])&&(f[d]=h);for(;a<r;++a)s[a]=t[a];return new Wn(s,this._parents,this._name,this._id)}function O$(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function B$(e,t,n){var r,i,o=O$(t)?Dd:_n;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function R4(e,t){var n=this._id;return arguments.length<2?tn(this.node(),n).on.on(e):this.each(B$(n,e,t))}function F$(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $4(){return this.on("end.remove",F$(this._id))}function P4(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ac(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],c=a.length,l=o[s]=new Array(c),u,f,h=0;h<c;++h)(u=a[h])&&(f=e.call(u,u.__data__,h,a))&&("__data__"in u&&(f.__data__=u.__data__),l[h]=f,ma(l[h],t,n,h,l,tn(u,n)));return new Wn(o,this._parents,t,n)}function U4(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fd(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],l=c.length,u,f=0;f<l;++f)if(u=c[f]){for(var h=e.call(u,u.__data__,f,c),d,p=tn(u,n),m=0,g=h.length;m<g;++m)(d=h[m])&&ma(d,t,n,m,h,p);o.push(h),s.push(u)}return new Wn(o,s,t,n)}var C$=ls.prototype.constructor;function z4(){return new C$(this._groups,this._parents)}function L$(e,t){var n,r,i;return function(){var o=ha(this,e),s=(this.style.removeProperty(e),ha(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function q4(e){return function(){this.style.removeProperty(e)}}function k$(e,t,n){var r,i=n+"",o;return function(){var s=ha(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function R$(e,t,n){var r,i,o;return function(){var s=ha(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),ha(this,e))),s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a))}}function $$(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var c=_n(this,e),l=c.on,u=c.value[o]==null?a||(a=q4(t)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function V4(e,t,n){var r=(e+="")=="transform"?bv:pg;return t==null?this.styleTween(e,L$(e,r)).on("end.style."+e,q4(e)):typeof t=="function"?this.styleTween(e,R$(e,r,lu(this,"style."+e,t))).each($$(this._id,e)):this.styleTween(e,k$(e,r,t),n).on("end.style."+e,null)}function P$(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function U$(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&P$(e,s,n)),r}return o._value=t,o}function j4(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,U$(e,t,n??""))}function z$(e){return function(){this.textContent=e}}function q$(e){return function(){var t=e(this);this.textContent=t??""}}function Y4(e){return this.tween("text",typeof e=="function"?q$(lu(this,"text",e)):z$(e==null?"":e+""))}function V$(e){return function(t){this.textContent=e.call(this,t)}}function j$(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&V$(i)),t}return r._value=e,r}function W4(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,j$(e))}function G4(){for(var e=this._name,t=this._id,n=mg(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=tn(c,t);ma(c,e,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Wn(r,this._parents,e,n)}function X4(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var l=_n(this,r),u=l.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),l.on=t}),i===0&&o()})}var Y$=0;function Wn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function H4(e){return ls().transition(e)}function mg(){return++Y$}var hs=ls.prototype;Wn.prototype=H4.prototype={constructor:Wn,select:P4,selectAll:U4,selectChild:hs.selectChild,selectChildren:hs.selectChildren,filter:L4,merge:k4,selection:z4,transition:G4,call:hs.call,nodes:hs.nodes,node:hs.node,size:hs.size,empty:hs.empty,each:hs.each,on:R4,attr:D4,attrTween:N4,style:V4,styleTween:j4,text:Y4,textTween:W4,remove:$4,tween:E4,delay:O4,duration:B4,ease:F4,easeVarying:C4,end:X4,[Symbol.iterator]:hs[Symbol.iterator]};function yg(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var W$={time:null,delay:0,duration:250,ease:yg};function G$(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Z4(e){var t,n;e instanceof Wn?(t=e._id,e=e._name):(t=mg(),(n=W$).time=Td(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&ma(c,e,t,l,s,n||G$(c,t));return new Wn(r,this._parents,e,t)}ls.prototype.interrupt=T4;ls.prototype.transition=Z4;var gg=e=>()=>e;function Iv(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function K4(e){e.stopImmediatePropagation()}function bg(e){e.preventDefault(),e.stopImmediatePropagation()}var Q4={name:"drag"},Mv={name:"space"},uu={name:"handle"},fu={name:"center"},{abs:J4,max:On,min:Bn}=Math;function t8(e){return[+e[0],+e[1]]}function Tv(e){return[t8(e[0]),t8(e[1])]}var xg={name:"x",handles:["w","e"].map(Nd),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},wg={name:"y",handles:["n","s"].map(Nd),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},X$={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Nd),input:function(e){return e==null?null:Tv(e)},output:function(e){return e}},ds={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"},e8={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},n8={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},H$={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Z$={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Nd(e){return{type:e}}function K$(e){return!e.ctrlKey&&!e.button}function Q$(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function J$(){return navigator.maxTouchPoints||"ontouchstart"in this}function Av(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function tP(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Ev(){return Ov(xg)}function Dv(){return Ov(wg)}function Nv(){return Ov(X$)}function Ov(e){var t=Q$,n=K$,r=J$,i=!0,o=Mc("start","brush","end"),s=6,a;function c(g){var y=g.property("__brush",m).selectAll(".overlay").data([Nd("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",ds.overlay).merge(y).each(function(){var x=Av(this).extent;Pt(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),g.selectAll(".selection").data([Nd("selection")]).enter().append("rect").attr("class","selection").attr("cursor",ds.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=g.selectAll(".handle").data(e.handles,function(x){return x.type});b.exit().remove(),b.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return ds[x.type]}),g.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(g,y,b){g.tween?g.on("start.brush",function(x){u(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){u(this,arguments).end(x)}).tween("brush",function(){var x=this,w=x.__brush,v=u(x,arguments),_=w.selection,M=e.input(typeof y=="function"?y.apply(this,arguments):y,w.extent),E=Tr(_,M);function N(I){w.selection=I===1&&M===null?null:E(I),l.call(x),v.brush()}return _!==null&&M!==null?N:N(1)}):g.each(function(){var x=this,w=arguments,v=x.__brush,_=e.input(typeof y=="function"?y.apply(x,w):y,v.extent),M=u(x,w).beforestart();eo(x),v.selection=_===null?null:_,l.call(x),M.start(b).brush(b).end(b)})},c.clear=function(g,y){c.move(g,null,y)};function l(){var g=Pt(this),y=Av(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(b){return b.type[b.type.length-1]==="e"?y[1][0]-s/2:y[0][0]-s/2}).attr("y",function(b){return b.type[0]==="s"?y[1][1]-s/2:y[0][1]-s/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?y[1][0]-y[0][0]+s:s}).attr("height",function(b){return b.type==="e"||b.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,b){var x=g.__brush.emitter;return x&&(!b||!x.clean)?x:new f(g,y,b)}function f(g,y,b){this.that=g,this.args=y,this.state=g.__brush,this.active=0,this.clean=b}f.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,b){var x=Pt(this.that).datum();o.call(g,this.that,new Iv(g,{sourceEvent:y,target:c,selection:e.output(this.state.selection),mode:b,dispatch:o}),x)}};function h(g){if(a&&!g.touches||!n.apply(this,arguments))return;var y=this,b=g.target.__data__.type,x=(i&&g.metaKey?b="overlay":b)==="selection"?Q4:i&&g.altKey?fu:uu,w=e===wg?null:H$[b],v=e===xg?null:Z$[b],_=Av(y),M=_.extent,E=_.selection,N=M[0][0],I,T,O=M[0][1],B,S,A=M[1][0],D,C,k=M[1][1],L,R,$=0,P=0,G,J=w&&v&&i&&g.shiftKey,et,ot,j=Array.from(g.touches||[g],tt=>{let ne=tt.identifier;return tt=Dn(tt,y),tt.point0=tt.slice(),tt.identifier=ne,tt});eo(y);var nt=u(y,arguments,!0).beforestart();if(b==="overlay"){E&&(G=!0);let tt=[j[0],j[1]||j[0]];_.selection=E=[[I=e===wg?N:Bn(tt[0][0],tt[1][0]),B=e===xg?O:Bn(tt[0][1],tt[1][1])],[D=e===wg?A:On(tt[0][0],tt[1][0]),L=e===xg?k:On(tt[0][1],tt[1][1])]],j.length>1&&Bt(g)}else I=E[0][0],B=E[0][1],D=E[1][0],L=E[1][1];T=I,S=B,C=D,R=L;var z=Pt(y).attr("pointer-events","none"),X=z.selectAll(".overlay").attr("cursor",ds[b]);if(g.touches)nt.moved=U,nt.ended=ft;else{var rt=Pt(g.view).on("mousemove.brush",U,!0).on("mouseup.brush",ft,!0);i&&rt.on("keydown.brush",jt,!0).on("keyup.brush",Yt,!0),pd(g.view)}l.call(y),nt.start(g,x.name);function U(tt){for(let ne of tt.changedTouches||[tt])for(let pr of j)pr.identifier===ne.identifier&&(pr.cur=Dn(ne,y));if(J&&!et&&!ot&&j.length===1){let ne=j[0];J4(ne.cur[0]-ne[0])>J4(ne.cur[1]-ne[1])?ot=!0:et=!0}for(let ne of j)ne.cur&&(ne[0]=ne.cur[0],ne[1]=ne.cur[1]);G=!0,bg(tt),Bt(tt)}function Bt(tt){let ne=j[0],pr=ne.point0;var Li;switch($=ne[0]-pr[0],P=ne[1]-pr[1],x){case Mv:case Q4:{w&&($=On(N-I,Bn(A-D,$)),T=I+$,C=D+$),v&&(P=On(O-B,Bn(k-L,P)),S=B+P,R=L+P);break}case uu:{j[1]?(w&&(T=On(N,Bn(A,j[0][0])),C=On(N,Bn(A,j[1][0])),w=1),v&&(S=On(O,Bn(k,j[0][1])),R=On(O,Bn(k,j[1][1])),v=1)):(w<0?($=On(N-I,Bn(A-I,$)),T=I+$,C=D):w>0&&($=On(N-D,Bn(A-D,$)),T=I,C=D+$),v<0?(P=On(O-B,Bn(k-B,P)),S=B+P,R=L):v>0&&(P=On(O-L,Bn(k-L,P)),S=B,R=L+P));break}case fu:{w&&(T=On(N,Bn(A,I-$*w)),C=On(N,Bn(A,D+$*w))),v&&(S=On(O,Bn(k,B-P*v)),R=On(O,Bn(k,L+P*v)));break}}C<T&&(w*=-1,Li=I,I=D,D=Li,Li=T,T=C,C=Li,b in e8&&X.attr("cursor",ds[b=e8[b]])),R<S&&(v*=-1,Li=B,B=L,L=Li,Li=S,S=R,R=Li,b in n8&&X.attr("cursor",ds[b=n8[b]])),_.selection&&(E=_.selection),et&&(T=E[0][0],C=E[1][0]),ot&&(S=E[0][1],R=E[1][1]),(E[0][0]!==T||E[0][1]!==S||E[1][0]!==C||E[1][1]!==R)&&(_.selection=[[T,S],[C,R]],l.call(y),nt.brush(tt,x.name))}function ft(tt){if(K4(tt),tt.touches){if(tt.touches.length)return;a&&clearTimeout(a),a=setTimeout(function(){a=null},500)}else md(tt.view,G),rt.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);z.attr("pointer-events","all"),X.attr("cursor",ds.overlay),_.selection&&(E=_.selection),tP(E)&&(_.selection=null,l.call(y)),nt.end(tt,x.name)}function jt(tt){switch(tt.keyCode){case 16:{J=w&&v;break}case 18:{x===uu&&(w&&(D=C-$*w,I=T+$*w),v&&(L=R-P*v,B=S+P*v),x=fu,Bt(tt));break}case 32:{(x===uu||x===fu)&&(w<0?D=C-$:w>0&&(I=T-$),v<0?L=R-P:v>0&&(B=S-P),x=Mv,X.attr("cursor",ds.selection),Bt(tt));break}default:return}bg(tt)}function Yt(tt){switch(tt.keyCode){case 16:{J&&(et=ot=J=!1,Bt(tt));break}case 18:{x===fu&&(w<0?D=C:w>0&&(I=T),v<0?L=R:v>0&&(B=S),x=uu,Bt(tt));break}case 32:{x===Mv&&(tt.altKey?(w&&(D=C-$*w,I=T+$*w),v&&(L=R-P*v,B=S+P*v),x=fu):(w<0?D=C:w>0&&(I=T),v<0?L=R:v>0&&(B=S),x=uu),X.attr("cursor",ds[b]),Bt(tt));break}default:return}bg(tt)}}function d(g){u(this,arguments).moved(g)}function p(g){u(this,arguments).ended(g)}function m(){var g=this.__brush||{selection:null};return g.extent=Tv(t.apply(this,arguments)),g.dim=e,g}return c.extent=function(g){return arguments.length?(t=typeof g=="function"?g:gg(Tv(g)),c):t},c.filter=function(g){return arguments.length?(n=typeof g=="function"?g:gg(!!g),c):n},c.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:gg(!!g),c):r},c.handleSize=function(g){return arguments.length?(s=+g,c):s},c.keyModifiers=function(g){return arguments.length?(i=!!g,c):i},c.on=function(){var g=o.on.apply(o,arguments);return g===o?c:g},c}var Bv=Math.PI,Fv=2*Bv,Fc=1e-6,eP=Fv-Fc;function r8(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function nP(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return r8;let n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}var ya=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?r8:nP(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,c=r-t,l=i-n,u=s-t,f=a-n,h=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Fc)if(!(Math.abs(f*c-l*u)>Fc)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let d=r-s,p=i-a,m=c*c+l*l,g=d*d+p*p,y=Math.sqrt(m),b=Math.sqrt(h),x=o*Math.tan((Bv-Math.acos((m+h-g)/(2*y*b)))/2),w=x/b,v=x/y;Math.abs(w-1)>Fc&&this._append`L${t+w*u},${n+w*f}`,this._append`A${o},${o},0,0,${+(f*d>u*p)},${this._x1=t+v*c},${this._y1=n+v*l}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),c=r*Math.sin(i),l=t+a,u=n+c,f=1^s,h=s?i-o:o-i;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>Fc||Math.abs(this._y1-u)>Fc)&&this._append`L${l},${u}`,r&&(h<0&&(h=h%Fv+Fv),h>eP?this._append`A${r},${r},0,1,${f},${t-a},${n-c}A${r},${r},0,1,${f},${this._x1=l},${this._y1=u}`:h>Fc&&this._append`A${r},${r},0,${+(h>=Bv)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function i8(){return new ya}i8.prototype=ya.prototype;function Gn(e=3){return new ya(+e)}var rP=Array.prototype,_g=rP.slice;function o8(e,t){return e-t}function s8(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r}var no=e=>()=>e;function a8(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=iP(e,t[n]))return i;return 0}function iP(e,t){for(var n=t[0],r=t[1],i=-1,o=0,s=e.length,a=s-1;o<s;a=o++){var c=e[o],l=c[0],u=c[1],f=e[a],h=f[0],d=f[1];if(oP(c,f,t))return 0;u>r!=d>r&&n<(h-l)*(r-u)/(d-u)+l&&(i=-i)}return i}function oP(e,t,n){var r;return sP(e,t,n)&&aP(e[r=+(e[0]===t[0])],n[r],t[r])}function sP(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function aP(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function c8(){}var ps=[[],[[[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 ga(){var e=1,t=1,n=ua,r=c;function i(l){var u=n(l);if(Array.isArray(u))u=u.slice().sort(o8);else{let f=ie(l,cP);for(u=xn(...Jl(f[0],f[1],u),u);u[u.length-1]>=f[1];)u.pop();for(;u[1]<f[0];)u.shift()}return u.map(f=>o(l,f))}function o(l,u){let f=u==null?NaN:+u;if(isNaN(f))throw new Error(`invalid value: ${u}`);var h=[],d=[];return s(l,f,function(p){r(p,l,f),s8(p)>0?h.push([p]):d.push(p)}),d.forEach(function(p){for(var m=0,g=h.length,y;m<g;++m)if(a8((y=h[m])[0],p)!==-1){y.push(p);return}}),{type:"MultiPolygon",value:u,coordinates:h}}function s(l,u,f){var h=new Array,d=new Array,p,m,g,y,b,x;for(p=m=-1,y=Cc(l[0],u),ps[y<<1].forEach(w);++p<e-1;)g=y,y=Cc(l[p+1],u),ps[g|y<<1].forEach(w);for(ps[y<<0].forEach(w);++m<t-1;){for(p=-1,y=Cc(l[m*e+e],u),b=Cc(l[m*e],u),ps[y<<1|b<<2].forEach(w);++p<e-1;)g=y,y=Cc(l[m*e+e+p+1],u),x=b,b=Cc(l[m*e+p+1],u),ps[g|y<<1|b<<2|x<<3].forEach(w);ps[y|b<<3].forEach(w)}for(p=-1,b=l[m*e]>=u,ps[b<<2].forEach(w);++p<e-1;)x=b,b=Cc(l[m*e+p+1],u),ps[b<<2|x<<3].forEach(w);ps[b<<3].forEach(w);function w(v){var _=[v[0][0]+p,v[0][1]+m],M=[v[1][0]+p,v[1][1]+m],E=a(_),N=a(M),I,T;(I=d[E])?(T=h[N])?(delete d[I.end],delete h[T.start],I===T?(I.ring.push(M),f(I.ring)):h[I.start]=d[T.end]={start:I.start,end:T.end,ring:I.ring.concat(T.ring)}):(delete d[I.end],I.ring.push(M),d[I.end=N]=I):(I=h[N])?(T=d[E])?(delete h[I.start],delete d[T.end],I===T?(I.ring.push(M),f(I.ring)):h[T.start]=d[I.end]={start:T.start,end:I.end,ring:T.ring.concat(I.ring)}):(delete h[I.start],I.ring.unshift(_),h[I.start=E]=I):h[E]=d[N]={start:E,end:N,ring:[_,M]}}}function a(l){return l[0]*2+l[1]*(e+1)*4}function c(l,u,f){l.forEach(function(h){var d=h[0],p=h[1],m=d|0,g=p|0,y=Cv(u[g*e+m]);d>0&&d<e&&m===d&&(h[0]=l8(d,Cv(u[g*e+m-1]),y,f)),p>0&&p<t&&g===p&&(h[1]=l8(p,Cv(u[(g-1)*e+m]),y,f))})}return i.contour=o,i.size=function(l){if(!arguments.length)return[e,t];var u=Math.floor(l[0]),f=Math.floor(l[1]);if(!(u>=0&&f>=0))throw new Error("invalid size");return e=u,t=f,i},i.thresholds=function(l){return arguments.length?(n=typeof l=="function"?l:Array.isArray(l)?no(_g.call(l)):no(l),i):n},i.smooth=function(l){return arguments.length?(r=l?c:c8,i):r===c},i}function cP(e){return isFinite(e)?e:NaN}function Cc(e,t){return e==null?!1:+e>=t}function Cv(e){return e==null||isNaN(e=+e)?-1/0:e}function l8(e,t,n,r){let i=r-t,o=n-t,s=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(s)?e:e+s-.5}function lP(e){return e[0]}function uP(e){return e[1]}function fP(){return 1}function Lv(){var e=lP,t=uP,n=fP,r=960,i=500,o=20,s=2,a=o*3,c=r+a*2>>s,l=i+a*2>>s,u=no(20);function f(b){var x=new Float32Array(c*l),w=Math.pow(2,-s),v=-1;for(let B of b){var _=(e(B,++v,b)+a)*w,M=(t(B,v,b)+a)*w,E=+n(B,v,b);if(E&&_>=0&&_<c&&M>=0&&M<l){var N=Math.floor(_),I=Math.floor(M),T=_-N-.5,O=M-I-.5;x[N+I*c]+=(1-T)*(1-O)*E,x[N+1+I*c]+=T*(1-O)*E,x[N+1+(I+1)*c]+=T*O*E,x[N+(I+1)*c]+=(1-T)*O*E}}return od({data:x,width:c,height:l},o*w),x}function h(b){var x=f(b),w=u(x),v=Math.pow(2,2*s);return Array.isArray(w)||(w=xn(Number.MIN_VALUE,Vt(x)/v,w)),ga().size([c,l]).thresholds(w.map(_=>_*v))(x).map((_,M)=>(_.value=+w[M],d(_)))}h.contours=function(b){var x=f(b),w=ga().size([c,l]),v=Math.pow(2,2*s),_=M=>{M=+M;var E=d(w.contour(x,M*v));return E.value=M,E};return Object.defineProperty(_,"max",{get:()=>Vt(x)/v}),_};function d(b){return b.coordinates.forEach(p),b}function p(b){b.forEach(m)}function m(b){b.forEach(g)}function g(b){b[0]=b[0]*Math.pow(2,s)-a,b[1]=b[1]*Math.pow(2,s)-a}function y(){return a=o*3,c=r+a*2>>s,l=i+a*2>>s,h}return h.x=function(b){return arguments.length?(e=typeof b=="function"?b:no(+b),h):e},h.y=function(b){return arguments.length?(t=typeof b=="function"?b:no(+b),h):t},h.weight=function(b){return arguments.length?(n=typeof b=="function"?b:no(+b),h):n},h.size=function(b){if(!arguments.length)return[r,i];var x=+b[0],w=+b[1];if(!(x>=0&&w>=0))throw new Error("invalid size");return r=x,i=w,y()},h.cellSize=function(b){if(!arguments.length)return 1<<s;if(!((b=+b)>=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(b)/Math.LN2),y()},h.thresholds=function(b){return arguments.length?(u=typeof b=="function"?b:Array.isArray(b)?no(_g.call(b)):no(b),h):u},h.bandwidth=function(b){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((b=+b)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*b*b+1)-1)/2,y()},h}var Zt=11102230246251565e-32,Ve=134217729,Od=(3+8*Zt)*Zt;function Lc(e,t,n,r,i){let o,s,a,c,l=t[0],u=r[0],f=0,h=0;u>l==u>-l?(o=l,l=t[++f]):(o=u,u=r[++h]);let d=0;if(f<e&&h<n)for(u>l==u>-l?(s=l+o,a=o-(s-l),l=t[++f]):(s=u+o,a=o-(s-u),u=r[++h]),o=s,a!==0&&(i[d++]=a);f<e&&h<n;)u>l==u>-l?(s=o+l,c=s-o,a=o-(s-c)+(l-c),l=t[++f]):(s=o+u,c=s-o,a=o-(s-c)+(u-c),u=r[++h]),o=s,a!==0&&(i[d++]=a);for(;f<e;)s=o+l,c=s-o,a=o-(s-c)+(l-c),l=t[++f],o=s,a!==0&&(i[d++]=a);for(;h<n;)s=o+u,c=s-o,a=o-(s-c)+(u-c),u=r[++h],o=s,a!==0&&(i[d++]=a);return(o!==0||d===0)&&(i[d++]=o),d}function Bd(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function V(e){return new Float64Array(e)}var hP=(3+16*Zt)*Zt,dP=(2+12*Zt)*Zt,pP=(9+64*Zt)*Zt*Zt,hu=V(4),u8=V(8),f8=V(12),h8=V(16),Xn=V(4);function mP(e,t,n,r,i,o,s){let a,c,l,u,f,h,d,p,m,g,y,b,x,w,v,_,M,E,N=e-i,I=n-i,T=t-o,O=r-o;w=N*O,h=Ve*N,d=h-(h-N),p=N-d,h=Ve*O,m=h-(h-O),g=O-m,v=p*g-(w-d*m-p*m-d*g),_=T*I,h=Ve*T,d=h-(h-T),p=T-d,h=Ve*I,m=h-(h-I),g=I-m,M=p*g-(_-d*m-p*m-d*g),y=v-M,f=v-y,hu[0]=v-(y+f)+(f-M),b=w+y,f=b-w,x=w-(b-f)+(y-f),y=x-_,f=x-y,hu[1]=x-(y+f)+(f-_),E=b+y,f=E-b,hu[2]=b-(E-f)+(y-f),hu[3]=E;let B=Bd(4,hu),S=dP*s;if(B>=S||-B>=S||(f=e-N,a=e-(N+f)+(f-i),f=n-I,l=n-(I+f)+(f-i),f=t-T,c=t-(T+f)+(f-o),f=r-O,u=r-(O+f)+(f-o),a===0&&c===0&&l===0&&u===0)||(S=pP*s+Od*Math.abs(B),B+=N*u+O*a-(T*l+I*c),B>=S||-B>=S))return B;w=a*O,h=Ve*a,d=h-(h-a),p=a-d,h=Ve*O,m=h-(h-O),g=O-m,v=p*g-(w-d*m-p*m-d*g),_=c*I,h=Ve*c,d=h-(h-c),p=c-d,h=Ve*I,m=h-(h-I),g=I-m,M=p*g-(_-d*m-p*m-d*g),y=v-M,f=v-y,Xn[0]=v-(y+f)+(f-M),b=w+y,f=b-w,x=w-(b-f)+(y-f),y=x-_,f=x-y,Xn[1]=x-(y+f)+(f-_),E=b+y,f=E-b,Xn[2]=b-(E-f)+(y-f),Xn[3]=E;let A=Lc(4,hu,4,Xn,u8);w=N*u,h=Ve*N,d=h-(h-N),p=N-d,h=Ve*u,m=h-(h-u),g=u-m,v=p*g-(w-d*m-p*m-d*g),_=T*l,h=Ve*T,d=h-(h-T),p=T-d,h=Ve*l,m=h-(h-l),g=l-m,M=p*g-(_-d*m-p*m-d*g),y=v-M,f=v-y,Xn[0]=v-(y+f)+(f-M),b=w+y,f=b-w,x=w-(b-f)+(y-f),y=x-_,f=x-y,Xn[1]=x-(y+f)+(f-_),E=b+y,f=E-b,Xn[2]=b-(E-f)+(y-f),Xn[3]=E;let D=Lc(A,u8,4,Xn,f8);w=a*u,h=Ve*a,d=h-(h-a),p=a-d,h=Ve*u,m=h-(h-u),g=u-m,v=p*g-(w-d*m-p*m-d*g),_=c*l,h=Ve*c,d=h-(h-c),p=c-d,h=Ve*l,m=h-(h-l),g=l-m,M=p*g-(_-d*m-p*m-d*g),y=v-M,f=v-y,Xn[0]=v-(y+f)+(f-M),b=w+y,f=b-w,x=w-(b-f)+(y-f),y=x-_,f=x-y,Xn[1]=x-(y+f)+(f-_),E=b+y,f=E-b,Xn[2]=b-(E-f)+(y-f),Xn[3]=E;let C=Lc(D,f8,4,Xn,h8);return h8[C-1]}function du(e,t,n,r,i,o){let s=(t-o)*(n-i),a=(e-i)*(r-o),c=s-a;if(s===0||a===0||s>0!=a>0)return c;let l=Math.abs(s+a);return Math.abs(c)>=hP*l?c:-mP(e,t,n,r,i,o,l)}var rmt=(7+56*Zt)*Zt,imt=(3+28*Zt)*Zt,omt=(26+288*Zt)*Zt*Zt,smt=V(4),amt=V(4),cmt=V(4),lmt=V(4),umt=V(4),fmt=V(4),hmt=V(4),dmt=V(4),pmt=V(4),mmt=V(8),ymt=V(8),gmt=V(8),bmt=V(4),xmt=V(8),wmt=V(8),_mt=V(8),vmt=V(12),Smt=V(192),Imt=V(192);var Tmt=(10+96*Zt)*Zt,Emt=(4+48*Zt)*Zt,Dmt=(44+576*Zt)*Zt*Zt,Nmt=V(4),Omt=V(4),Bmt=V(4),Fmt=V(4),Cmt=V(4),Lmt=V(4),kmt=V(4),Rmt=V(4),$mt=V(8),Pmt=V(8),Umt=V(8),zmt=V(8),qmt=V(8),Vmt=V(8),jmt=V(8),Ymt=V(8),Wmt=V(8),Gmt=V(4),Xmt=V(4),Hmt=V(4),Zmt=V(8),Kmt=V(16),Qmt=V(16),Jmt=V(16),tyt=V(32),eyt=V(32),nyt=V(48),ryt=V(64),iyt=V(1152),oyt=V(1152);var lyt=(16+224*Zt)*Zt,uyt=(5+72*Zt)*Zt,fyt=(71+1408*Zt)*Zt*Zt,hyt=V(4),dyt=V(4),pyt=V(4),myt=V(4),yyt=V(4),gyt=V(4),byt=V(4),xyt=V(4),wyt=V(4),_yt=V(4),vyt=V(24),Syt=V(24),Iyt=V(24),Myt=V(24),Ayt=V(24),Tyt=V(24),Eyt=V(24),Dyt=V(24),Nyt=V(24),Oyt=V(24),Byt=V(1152),Fyt=V(1152),Cyt=V(1152),Lyt=V(1152),kyt=V(1152),Ryt=V(2304),$yt=V(2304),Pyt=V(3456),Uyt=V(5760),zyt=V(8),qyt=V(8),Vyt=V(8),jyt=V(16),Yyt=V(24),Wyt=V(48),Gyt=V(48),Xyt=V(96),Hyt=V(192),Zyt=V(384),Kyt=V(384),Qyt=V(384),Jyt=V(768);var t0t=V(96),e0t=V(96),n0t=V(96),r0t=V(1152);var p8=Math.pow(2,-52),vg=new Uint32Array(512),mu=class e{static from(t,n=_P,r=vP){let i=t.length,o=new Float64Array(i*2);for(let s=0;s<i;s++){let a=t[s];o[2*s]=n(a),o[2*s+1]=r(a)}return new e(o)}constructor(t){let n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;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).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){let{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=t.length>>1,a=1/0,c=1/0,l=-1/0,u=-1/0;for(let I=0;I<s;I++){let T=t[2*I],O=t[2*I+1];T<a&&(a=T),O<c&&(c=O),T>l&&(l=T),O>u&&(u=O),this._ids[I]=I}let f=(a+l)/2,h=(c+u)/2,d=1/0,p,m,g;for(let I=0;I<s;I++){let T=kv(f,h,t[2*I],t[2*I+1]);T<d&&(p=I,d=T)}let y=t[2*p],b=t[2*p+1];d=1/0;for(let I=0;I<s;I++){if(I===p)continue;let T=kv(y,b,t[2*I],t[2*I+1]);T<d&&T>0&&(m=I,d=T)}let x=t[2*m],w=t[2*m+1],v=1/0;for(let I=0;I<s;I++){if(I===p||I===m)continue;let T=xP(y,b,x,w,t[2*I],t[2*I+1]);T<v&&(g=I,v=T)}let _=t[2*g],M=t[2*g+1];if(v===1/0){for(let O=0;O<s;O++)this._dists[O]=t[2*O]-t[0]||t[2*O+1]-t[1];pu(this._ids,this._dists,0,s-1);let I=new Uint32Array(s),T=0;for(let O=0,B=-1/0;O<s;O++){let S=this._ids[O];this._dists[S]>B&&(I[T++]=S,B=this._dists[S])}this.hull=I.subarray(0,T),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(du(y,b,x,w,_,M)<0){let I=m,T=x,O=w;m=g,x=_,w=M,g=I,_=T,M=O}let E=wP(y,b,x,w,_,M);this._cx=E.x,this._cy=E.y;for(let I=0;I<s;I++)this._dists[I]=kv(t[2*I],t[2*I+1],E.x,E.y);pu(this._ids,this._dists,0,s-1),this._hullStart=p;let N=3;r[p]=n[g]=m,r[m]=n[p]=g,r[g]=n[m]=p,i[p]=0,i[m]=1,i[g]=2,o.fill(-1),o[this._hashKey(y,b)]=p,o[this._hashKey(x,w)]=m,o[this._hashKey(_,M)]=g,this.trianglesLen=0,this._addTriangle(p,m,g,-1,-1,-1);for(let I=0,T,O;I<this._ids.length;I++){let B=this._ids[I],S=t[2*B],A=t[2*B+1];if(I>0&&Math.abs(S-T)<=p8&&Math.abs(A-O)<=p8||(T=S,O=A,B===p||B===m||B===g))continue;let D=0;for(let $=0,P=this._hashKey(S,A);$<this._hashSize&&(D=o[(P+$)%this._hashSize],!(D!==-1&&D!==r[D]));$++);D=n[D];let C=D,k;for(;k=r[C],du(S,A,t[2*C],t[2*C+1],t[2*k],t[2*k+1])>=0;)if(C=k,C===D){C=-1;break}if(C===-1)continue;let L=this._addTriangle(C,B,r[C],-1,-1,i[C]);i[B]=this._legalize(L+2),i[C]=L,N++;let R=r[C];for(;k=r[R],du(S,A,t[2*R],t[2*R+1],t[2*k],t[2*k+1])<0;)L=this._addTriangle(R,B,k,i[B],-1,i[R]),i[B]=this._legalize(L+2),r[R]=R,N--,R=k;if(C===D)for(;k=n[C],du(S,A,t[2*k],t[2*k+1],t[2*C],t[2*C+1])<0;)L=this._addTriangle(k,B,C,-1,i[C],i[k]),this._legalize(L+2),i[k]=L,r[C]=C,N--,C=k;this._hullStart=n[B]=C,r[C]=n[R]=B,r[B]=R,o[this._hashKey(S,A)]=B,o[this._hashKey(t[2*C],t[2*C+1])]=C}this.hull=new Uint32Array(N);for(let I=0,T=this._hullStart;I<N;I++)this.hull[I]=T,T=r[T];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(gP(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){let{_triangles:n,_halfedges:r,coords:i}=this,o=0,s=0;for(;;){let a=r[t],c=t-t%3;if(s=c+(t+2)%3,a===-1){if(o===0)break;t=vg[--o];continue}let l=a-a%3,u=c+(t+1)%3,f=l+(a+2)%3,h=n[s],d=n[t],p=n[u],m=n[f];if(bP(i[2*h],i[2*h+1],i[2*d],i[2*d+1],i[2*p],i[2*p+1],i[2*m],i[2*m+1])){n[t]=m,n[a]=h;let y=r[f];if(y===-1){let x=this._hullStart;do{if(this._hullTri[x]===f){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,y),this._link(a,r[s]),this._link(s,f);let b=l+(a+1)%3;o<vg.length&&(vg[o++]=b)}else{if(o===0)break;t=vg[--o]}}return s}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,r,i,o,s){let a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=r,this._link(a,i),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}};function gP(e,t){let n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function kv(e,t,n,r){let i=e-n,o=t-r;return i*i+o*o}function bP(e,t,n,r,i,o,s,a){let c=e-s,l=t-a,u=n-s,f=r-a,h=i-s,d=o-a,p=c*c+l*l,m=u*u+f*f,g=h*h+d*d;return c*(f*g-m*d)-l*(u*g-m*h)+p*(u*d-f*h)<0}function xP(e,t,n,r,i,o){let s=n-e,a=r-t,c=i-e,l=o-t,u=s*s+a*a,f=c*c+l*l,h=.5/(s*l-a*c),d=(l*u-a*f)*h,p=(s*f-c*u)*h;return d*d+p*p}function wP(e,t,n,r,i,o){let s=n-e,a=r-t,c=i-e,l=o-t,u=s*s+a*a,f=c*c+l*l,h=.5/(s*l-a*c),d=e+(l*u-a*f)*h,p=t+(s*f-c*u)*h;return{x:d,y:p}}function pu(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){let o=e[i],s=t[o],a=i-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{let i=n+r>>1,o=n+1,s=r;Fd(e,i,o),t[e[n]]>t[e[r]]&&Fd(e,n,r),t[e[o]]>t[e[r]]&&Fd(e,o,r),t[e[n]]>t[e[o]]&&Fd(e,n,o);let a=e[o],c=t[a];for(;;){do o++;while(t[e[o]]<c);do s--;while(t[e[s]]>c);if(s<o)break;Fd(e,o,s)}e[n+1]=e[s],e[s]=a,r-o+1>=s-n?(pu(e,t,o,r),pu(e,t,n,s-1)):(pu(e,t,n,s-1),pu(e,t,o,r))}}function Fd(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function _P(e){return e[0]}function vP(e){return e[1]}var Wr=class{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;let i=t+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>1e-6||Math.abs(this._y1-o)>1e-6)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}};var ba=class{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}};var Cd=class{constructor(t,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this,o,s,a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let m=0,g=0,y=r.length,b,x;m<y;m+=3,g+=2){let w=r[m]*2,v=r[m+1]*2,_=r[m+2]*2,M=t[w],E=t[w+1],N=t[v],I=t[v+1],T=t[_],O=t[_+1],B=N-M,S=I-E,A=T-M,D=O-E,C=(B*D-S*A)*2;if(Math.abs(C)<1e-9){if(o===void 0){o=s=0;for(let L of n)o+=t[L*2],s+=t[L*2+1];o/=n.length,s/=n.length}let k=1e9*Math.sign((o-M)*D-(s-E)*A);b=(M+T)/2-k*D,x=(E+O)/2+k*A}else{let k=1/C,L=B*B+S*S,R=A*A+D*D;b=M+(D*L-S*R)*k,x=E+(B*R-A*L)*k}a[g]=b,a[g+1]=x}let c=n[n.length-1],l,u=c*4,f,h=t[2*c],d,p=t[2*c+1];i.fill(0);for(let m=0;m<n.length;++m)c=n[m],l=u,f=h,d=p,u=c*4,h=t[2*c],p=t[2*c+1],i[l+2]=i[u]=d-p,i[l+3]=i[u+1]=h-f}render(t){let n=t==null?t=new Wr:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:s,vectors:a}=this;if(o.length<=1)return null;for(let u=0,f=r.length;u<f;++u){let h=r[u];if(h<u)continue;let d=Math.floor(u/3)*2,p=Math.floor(h/3)*2,m=s[d],g=s[d+1],y=s[p],b=s[p+1];this._renderSegment(m,g,y,b,t)}let c,l=o[o.length-1];for(let u=0;u<o.length;++u){c=l,l=o[u];let f=Math.floor(i[l]/3)*2,h=s[f],d=s[f+1],p=c*4,m=this._project(h,d,a[p+2],a[p+3]);m&&this._renderSegment(h,d,m[0],m[1],t)}return n&&n.value()}renderBounds(t){let n=t==null?t=new Wr:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){let r=n==null?n=new Wr:void 0,i=this._clip(t);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let o=i.length;for(;i[0]===i[o-2]&&i[1]===i[o-1]&&o>1;)o-=2;for(let s=2;s<o;s+=2)(i[s]!==i[s-2]||i[s+1]!==i[s-1])&&n.lineTo(i[s],i[s+1]);return n.closePath(),r&&r.value()}*cellPolygons(){let{delaunay:{points:t}}=this;for(let n=0,r=t.length/2;n<r;++n){let i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(t){let n=new ba;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,o){let s,a=this._regioncode(t,n),c=this._regioncode(r,i);a===0&&c===0?(o.moveTo(t,n),o.lineTo(r,i)):(s=this._clipSegment(t,n,r,i,a,c))&&(o.moveTo(s[0],s[1]),o.lineTo(s[2],s[3]))}contains(t,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(t,n,r)===t}*neighbors(t){let n=this._clip(t);if(n)for(let r of this.delaunay.neighbors(t)){let i=this._clip(r);if(i){t:for(let o=0,s=n.length;o<s;o+=2)for(let a=0,c=i.length;a<c;a+=2)if(n[o]===i[a]&&n[o+1]===i[a+1]&&n[(o+2)%s]===i[(a+c-2)%c]&&n[(o+3)%s]===i[(a+c-1)%c]){yield r;break t}}}}_cell(t){let{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,s=r[t];if(s===-1)return null;let a=[],c=s;do{let l=Math.floor(c/3);if(a.push(n[l*2],n[l*2+1]),c=c%3===2?c-2:c+1,o[c]!==t)break;c=i[c]}while(c!==s&&c!==-1);return a}_clip(t){if(t===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(t);if(n===null)return null;let{vectors:r}=this,i=t*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(t,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(t,n))}_clipFinite(t,n){let r=n.length,i=null,o,s,a=n[r-2],c=n[r-1],l,u=this._regioncode(a,c),f,h=0;for(let d=0;d<r;d+=2)if(o=a,s=c,a=n[d],c=n[d+1],l=u,u=this._regioncode(a,c),l===0&&u===0)f=h,h=0,i?i.push(a,c):i=[a,c];else{let p,m,g,y,b;if(l===0){if((p=this._clipSegment(o,s,a,c,l,u))===null)continue;[m,g,y,b]=p}else{if((p=this._clipSegment(a,c,o,s,u,l))===null)continue;[y,b,m,g]=p,f=h,h=this._edgecode(m,g),f&&h&&this._edge(t,f,h,i,i.length),i?i.push(m,g):i=[m,g]}f=h,h=this._edgecode(y,b),f&&h&&this._edge(t,f,h,i,i.length),i?i.push(y,b):i=[y,b]}if(i)f=h,h=this._edgecode(i[0],i[1]),f&&h&&this._edge(t,f,h,i,i.length);else if(this.contains(t,(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 i}_clipSegment(t,n,r,i,o,s){let a=o<s;for(a&&([t,n,r,i,o,s]=[r,i,t,n,s,o]);;){if(o===0&&s===0)return a?[r,i,t,n]:[t,n,r,i];if(o&s)return null;let c,l,u=o||s;u&8?(c=t+(r-t)*(this.ymax-n)/(i-n),l=this.ymax):u&4?(c=t+(r-t)*(this.ymin-n)/(i-n),l=this.ymin):u&2?(l=n+(i-n)*(this.xmax-t)/(r-t),c=this.xmax):(l=n+(i-n)*(this.xmin-t)/(r-t),c=this.xmin),o?(t=c,n=l,o=this._regioncode(t,n)):(r=c,i=l,s=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,o,s){let a=Array.from(n),c;if((c=this._project(a[0],a[1],r,i))&&a.unshift(c[0],c[1]),(c=this._project(a[a.length-2],a[a.length-1],o,s))&&a.push(c[0],c[1]),a=this._clipFinite(t,a))for(let l=0,u=a.length,f,h=this._edgecode(a[u-2],a[u-1]);l<u;l+=2)f=h,h=this._edgecode(a[l],a[l+1]),f&&h&&(l=this._edge(t,f,h,a,l),u=a.length);else this.contains(t,(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(t,n,r,i,o){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}(i[o]!==s||i[o+1]!==a)&&this.contains(t,s,a)&&(i.splice(o,0,s,a),o+=2)}return o}_project(t,n,r,i){let o=1/0,s,a,c;if(i<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/i)<o&&(c=this.ymin,a=t+(o=s)*r)}else if(i>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)<o&&(c=this.ymax,a=t+(o=s)*r)}if(r>0){if(t>=this.xmax)return null;(s=(this.xmax-t)/r)<o&&(a=this.xmax,c=n+(o=s)*i)}else if(r<0){if(t<=this.xmin)return null;(s=(this.xmin-t)/r)<o&&(a=this.xmin,c=n+(o=s)*i)}return[a,c]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){let r=(n+2)%t.length,i=(n+4)%t.length;(t[n]===t[r]&&t[r]===t[i]||t[n+1]===t[r+1]&&t[r+1]===t[i+1])&&(t.splice(r,2),n-=2)}t.length||(t=null)}return t}};var SP=2*Math.PI,yu=Math.pow;function IP(e){return e[0]}function MP(e){return e[1]}function AP(e){let{triangles:t,coords:n}=e;for(let r=0;r<t.length;r+=3){let i=2*t[r],o=2*t[r+1],s=2*t[r+2];if((n[s]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[s+1]-n[i+1])>1e-10)return!1}return!0}function TP(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}var Gr=class e{static from(t,n=IP,r=MP,i){return new e("length"in t?EP(t,n,r,i):Float64Array.from(DP(t,n,r,i)))}constructor(t){this._delaunator=new mu(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){let t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&AP(t)){this.collinear=Int32Array.from({length:n.length/2},(h,d)=>d).sort((h,d)=>n[2*h]-n[2*d]||n[2*h+1]-n[2*d+1]);let c=this.collinear[0],l=this.collinear[this.collinear.length-1],u=[n[2*c],n[2*c+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let h=0,d=n.length/2;h<d;++h){let p=TP(n[2*h],n[2*h+1],f);n[2*h]=p[0],n[2*h+1]=p[1]}this._delaunator=new mu(n)}else delete this.collinear;let r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let c=0,l=r.length;c<l;++c){let u=o[c%3===2?c-2:c+1];(r[c]===-1||s[u]===-1)&&(s[u]=c)}for(let c=0,l=i.length;c<l;++c)a[i[c]]=c;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,i.length===2&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new Cd(this,t)}*neighbors(t){let{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:s,collinear:a}=this;if(a){let f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}let c=n[t];if(c===-1)return;let l=c,u=-1;do{if(yield u=s[l],l=l%3===2?l-2:l+1,s[l]!==t)return;if(l=o[l],l===-1){let f=r[(i[t]+1)%r.length];f!==u&&(yield f);return}}while(l!==c)}find(t,n,r=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;let i=r,o;for(;(o=this._step(r,t,n))>=0&&o!==r&&o!==i;)r=o;return o}_step(t,n,r){let{inedges:i,hull:o,_hullIndex:s,halfedges:a,triangles:c,points:l}=this;if(i[t]===-1||!l.length)return(t+1)%(l.length>>1);let u=t,f=yu(n-l[t*2],2)+yu(r-l[t*2+1],2),h=i[t],d=h;do{let p=c[d],m=yu(n-l[p*2],2)+yu(r-l[p*2+1],2);if(m<f&&(f=m,u=p),d=d%3===2?d-2:d+1,c[d]!==t)break;if(d=a[d],d===-1){if(d=o[(s[t]+1)%o.length],d!==p&&yu(n-l[d*2],2)+yu(r-l[d*2+1],2)<f)return d;break}}while(d!==h);return u}render(t){let n=t==null?t=new Wr:void 0,{points:r,halfedges:i,triangles:o}=this;for(let s=0,a=i.length;s<a;++s){let c=i[s];if(c<s)continue;let l=o[s]*2,u=o[c]*2;t.moveTo(r[l],r[l+1]),t.lineTo(r[u],r[u+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;let r=t==null?t=new Wr:void 0,{points:i}=this;for(let o=0,s=i.length;o<s;o+=2){let a=i[o],c=i[o+1];t.moveTo(a+n,c),t.arc(a,c,n,0,SP)}return r&&r.value()}renderHull(t){let n=t==null?t=new Wr:void 0,{hull:r,points:i}=this,o=r[0]*2,s=r.length;t.moveTo(i[o],i[o+1]);for(let a=1;a<s;++a){let c=2*r[a];t.lineTo(i[c],i[c+1])}return t.closePath(),n&&n.value()}hullPolygon(){let t=new ba;return this.renderHull(t),t.value()}renderTriangle(t,n){let r=n==null?n=new Wr:void 0,{points:i,triangles:o}=this,s=o[t*=3]*2,a=o[t+1]*2,c=o[t+2]*2;return n.moveTo(i[s],i[s+1]),n.lineTo(i[a],i[a+1]),n.lineTo(i[c],i[c+1]),n.closePath(),r&&r.value()}*trianglePolygons(){let{triangles:t}=this;for(let n=0,r=t.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(t){let n=new ba;return this.renderTriangle(t,n),n.value()}};function EP(e,t,n,r){let i=e.length,o=new Float64Array(i*2);for(let s=0;s<i;++s){let a=e[s];o[s*2]=t.call(r,a,s,e),o[s*2+1]=n.call(r,a,s,e)}return o}function*DP(e,t,n,r){let i=0;for(let o of e)yield t.call(r,o,i,e),yield n.call(r,o,i,e),++i}function m8(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function kc(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function ro(e){return e=kc(Math.abs(e)),e?e[1]:NaN}function y8(e,t){return function(n,r){for(var i=n.length,o=[],s=0,a=e[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),o.push(n.substring(i-=a,i+a)),!((c+=a+1)>r));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function g8(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var NP=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function io(e){if(!(t=NP.exec(e)))throw new Error("invalid format: "+e);var t;return new Sg({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}io.prototype=Sg.prototype;function Sg(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Sg.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 b8(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Rv;function x8(e,t){var n=kc(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(Rv=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+kc(e,Math.max(0,t+o-1))[0]}function $v(e,t){var n=kc(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}var Pv={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:m8,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>$v(e*100,t),r:$v,s:x8,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Uv(e){return e}var w8=Array.prototype.map,_8=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function v8(e){var t=e.grouping===void 0||e.thousands===void 0?Uv:y8(w8.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Uv:g8(w8.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"\u2212":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(f){f=io(f);var h=f.fill,d=f.align,p=f.sign,m=f.symbol,g=f.zero,y=f.width,b=f.comma,x=f.precision,w=f.trim,v=f.type;v==="n"?(b=!0,v="g"):Pv[v]||(x===void 0&&(x=12),w=!0,v="g"),(g||h==="0"&&d==="=")&&(g=!0,h="0",d="=");var _=m==="$"?n:m==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",M=m==="$"?r:/[%p]/.test(v)?s:"",E=Pv[v],N=/[defgprs%]/.test(v);x=x===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function I(T){var O=_,B=M,S,A,D;if(v==="c")B=E(T)+B,T="";else{T=+T;var C=T<0||1/T<0;if(T=isNaN(T)?c:E(Math.abs(T),x),w&&(T=b8(T)),C&&+T==0&&p!=="+"&&(C=!1),O=(C?p==="("?p:a:p==="-"||p==="("?"":p)+O,B=(v==="s"?_8[8+Rv/3]:"")+B+(C&&p==="("?")":""),N){for(S=-1,A=T.length;++S<A;)if(D=T.charCodeAt(S),48>D||D>57){B=(D===46?i+T.slice(S+1):T.slice(S))+B,T=T.slice(0,S);break}}}b&&!g&&(T=t(T,1/0));var k=O.length+T.length+B.length,L=k<y?new Array(y-k+1).join(h):"";switch(b&&g&&(T=t(L+T,L.length?y-B.length:1/0),L=""),d){case"<":T=O+T+B+L;break;case"=":T=O+L+T+B;break;case"^":T=L.slice(0,k=L.length>>1)+O+T+B+L.slice(k);break;default:T=L+O+T+B;break}return o(T)}return I.toString=function(){return f+""},I}function u(f,h){var d=l((f=io(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(ro(h)/3)))*3,m=Math.pow(10,-p),g=_8[8+p/3];return function(y){return d(m*y)+g}}return{format:l,formatPrefix:u}}var Ig,Xr,Mg;zv({thousands:",",grouping:[3],currency:["$",""]});function zv(e){return Ig=v8(e),Xr=Ig.format,Mg=Ig.formatPrefix,Ig}function qv(e){return Math.max(0,-ro(Math.abs(e)))}function Vv(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ro(t)/3)))*3-ro(Math.abs(e)))}function jv(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ro(t)-ro(e))+1}var Q=1e-6,Rc=1e-12,Mt=Math.PI,le=Mt/2,Yv=Mt/4,nn=Mt*2,Fe=180/Mt,Ut=Mt/180,Ct=Math.abs,Hr=Math.atan,je=Math.atan2,K=Math.cos,Ld=Math.ceil,Ag=Math.exp;var Tg=Math.hypot,$c=Math.log,Eg=Math.pow,Z=Math.sin,Fn=Math.sign||function(e){return e>0?1:e<0?-1:0},ue=Math.sqrt,gu=Math.tan;function Dg(e){return e>1?0:e<-1?Mt:Math.acos(e)}function be(e){return e>1?le:e<-1?-le:Math.asin(e)}function Ye(){}function Ng(e,t){e&&I8.hasOwnProperty(e.type)&&I8[e.type](e,t)}var S8={Feature:function(e,t){Ng(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Ng(n[r].geometry,t)}},I8={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Wv(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Wv(n[r],t,0)},Polygon:function(e,t){M8(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)M8(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Ng(n[r],t)}};function Wv(e,t,n){var r=-1,i=e.length-n,o;for(t.lineStart();++r<i;)o=e[r],t.point(o[0],o[1],o[2]);t.lineEnd()}function M8(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Wv(e[n],t,1);t.polygonEnd()}function Er(e,t){e&&S8.hasOwnProperty(e.type)?S8[e.type](e,t):Ng(e,t)}function kd(e){return[je(e[1],e[0]),be(e[2])]}function oo(e){var t=e[0],n=e[1],r=K(n);return[r*K(t),r*Z(t),Z(n)]}function Rd(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function bu(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Og(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function $d(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Pd(e){var t=ue(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var Ud,Bg,Fg,Cg,Lg,kg,Rg,$g,Gv,Xv,Hv,E8,D8,Hn,Zn,Kn,Ei={sphere:Ye,point:Zv,lineStart:A8,lineEnd:T8,polygonStart:function(){Ei.lineStart=FP,Ei.lineEnd=CP},polygonEnd:function(){Ei.lineStart=A8,Ei.lineEnd=T8}};function Zv(e,t){e*=Ut,t*=Ut;var n=K(t);zd(n*K(e),n*Z(e),Z(t))}function zd(e,t,n){++Ud,Fg+=(e-Fg)/Ud,Cg+=(t-Cg)/Ud,Lg+=(n-Lg)/Ud}function A8(){Ei.point=OP}function OP(e,t){e*=Ut,t*=Ut;var n=K(t);Hn=n*K(e),Zn=n*Z(e),Kn=Z(t),Ei.point=BP,zd(Hn,Zn,Kn)}function BP(e,t){e*=Ut,t*=Ut;var n=K(t),r=n*K(e),i=n*Z(e),o=Z(t),s=je(ue((s=Zn*o-Kn*i)*s+(s=Kn*r-Hn*o)*s+(s=Hn*i-Zn*r)*s),Hn*r+Zn*i+Kn*o);Bg+=s,kg+=s*(Hn+(Hn=r)),Rg+=s*(Zn+(Zn=i)),$g+=s*(Kn+(Kn=o)),zd(Hn,Zn,Kn)}function T8(){Ei.point=Zv}function FP(){Ei.point=LP}function CP(){N8(E8,D8),Ei.point=Zv}function LP(e,t){E8=e,D8=t,e*=Ut,t*=Ut,Ei.point=N8;var n=K(t);Hn=n*K(e),Zn=n*Z(e),Kn=Z(t),zd(Hn,Zn,Kn)}function N8(e,t){e*=Ut,t*=Ut;var n=K(t),r=n*K(e),i=n*Z(e),o=Z(t),s=Zn*o-Kn*i,a=Kn*r-Hn*o,c=Hn*i-Zn*r,l=Tg(s,a,c),u=be(l),f=l&&-u/l;Gv.add(f*s),Xv.add(f*a),Hv.add(f*c),Bg+=u,kg+=u*(Hn+(Hn=r)),Rg+=u*(Zn+(Zn=i)),$g+=u*(Kn+(Kn=o)),zd(Hn,Zn,Kn)}function Kv(e){Ud=Bg=Fg=Cg=Lg=kg=Rg=$g=0,Gv=new bn,Xv=new bn,Hv=new bn,Er(e,Ei);var t=+Gv,n=+Xv,r=+Hv,i=Tg(t,n,r);return i<Rc&&(t=kg,n=Rg,r=$g,Bg<Q&&(t=Fg,n=Cg,r=Lg),i=Tg(t,n,r),i<Rc)?[NaN,NaN]:[je(n,t)*Fe,be(r/i)*Fe]}function qd(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function Qv(e,t){return Ct(e)>Mt&&(e-=Math.round(e/nn)*nn),[e,t]}Qv.invert=Qv;function Jv(e,t,n){return(e%=nn)?t||n?qd(B8(e),F8(t,n)):B8(e):t||n?F8(t,n):Qv}function O8(e){return function(t,n){return t+=e,Ct(t)>Mt&&(t-=Math.round(t/nn)*nn),[t,n]}}function B8(e){var t=O8(e);return t.invert=O8(-e),t}function F8(e,t){var n=K(e),r=Z(e),i=K(t),o=Z(t);function s(a,c){var l=K(c),u=K(a)*l,f=Z(a)*l,h=Z(c),d=h*n+u*r;return[je(f*i-d*o,u*n-h*r),be(d*i+f*o)]}return s.invert=function(a,c){var l=K(c),u=K(a)*l,f=Z(a)*l,h=Z(c),d=h*i-f*o;return[je(f*i+h*o,u*n+d*r),be(d*n-u*r)]},s}function C8(e){e=Jv(e[0]*Ut,e[1]*Ut,e.length>2?e[2]*Ut:0);function t(n){return n=e(n[0]*Ut,n[1]*Ut),n[0]*=Fe,n[1]*=Fe,n}return t.invert=function(n){return n=e.invert(n[0]*Ut,n[1]*Ut),n[0]*=Fe,n[1]*=Fe,n},t}function k8(e,t,n,r,i,o){if(n){var s=K(t),a=Z(t),c=r*n;i==null?(i=t+r*nn,o=t-c/2):(i=L8(s,i),o=L8(s,o),(r>0?i<o:i>o)&&(i+=r*nn));for(var l,u=i;r>0?u>o:u<o;u-=c)l=kd([s,-a*K(u),-a*Z(u)]),e.point(l[0],l[1])}}function L8(e,t){t=oo(t),t[0]-=e,Pd(t);var n=Dg(-t[1]);return((-t[2]<0?-n:n)+nn-Q)%nn}function Pg(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Ye,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function xu(e,t){return Ct(e[0]-t[0])<Q&&Ct(e[1]-t[1])<Q}function Ug(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function zg(e,t,n,r,i){var o=[],s=[],a,c;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,g=p[0],y=p[m],b;if(xu(g,y)){if(!g[2]&&!y[2]){for(i.lineStart(),a=0;a<m;++a)i.point((g=p[a])[0],g[1]);i.lineEnd();return}y[0]+=2*Q}o.push(b=new Ug(g,p,null,!0)),s.push(b.o=new Ug(g,null,b,!1)),o.push(b=new Ug(y,p,null,!1)),s.push(b.o=new Ug(y,null,b,!0))}}),!!o.length){for(s.sort(t),R8(o),R8(s),a=0,c=s.length;a<c;++a)s[a].e=n=!n;for(var l=o[0],u,f;;){for(var h=l,d=!0;h.v;)if((h=h.n)===l)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(a=0,c=u.length;a<c;++a)i.point((f=u[a])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(u=h.p.z,a=u.length-1;a>=0;--a)i.point((f=u[a])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,d=!d}while(!h.v);i.lineEnd()}}}function R8(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function t2(e){return Ct(e[0])<=Mt?e[0]:Fn(e[0])*((Ct(e[0])+Mt)%nn-Mt)}function $8(e,t){var n=t2(t),r=t[1],i=Z(r),o=[Z(n),-K(n),0],s=0,a=0,c=new bn;i===1?r=le+Q:i===-1&&(r=-le-Q);for(var l=0,u=e.length;l<u;++l)if(h=(f=e[l]).length)for(var f,h,d=f[h-1],p=t2(d),m=d[1]/2+Yv,g=Z(m),y=K(m),b=0;b<h;++b,p=w,g=_,y=M,d=x){var x=f[b],w=t2(x),v=x[1]/2+Yv,_=Z(v),M=K(v),E=w-p,N=E>=0?1:-1,I=N*E,T=I>Mt,O=g*_;if(c.add(je(O*N*Z(I),y*M+O*K(I))),s+=T?E+N*nn:E,T^p>=n^w>=n){var B=bu(oo(d),oo(x));Pd(B);var S=bu(o,B);Pd(S);var A=(T^E>=0?-1:1)*be(S[2]);(r>A||r===A&&(B[0]||B[1]))&&(a+=T^E>=0?1:-1)}}return(s<-Q||s<Q&&c<-Rc)^a&1}function qg(e,t,n,r){return function(i){var o=t(i),s=Pg(),a=t(s),c=!1,l,u,f,h={point:d,lineStart:m,lineEnd:g,polygonStart:function(){h.point=y,h.lineStart=b,h.lineEnd=x,u=[],l=[]},polygonEnd:function(){h.point=d,h.lineStart=m,h.lineEnd=g,u=tu(u);var w=$8(l,r);u.length?(c||(i.polygonStart(),c=!0),zg(u,RP,w,n,i)):w&&(c||(i.polygonStart(),c=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),c&&(i.polygonEnd(),c=!1),u=l=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(w,v){e(w,v)&&i.point(w,v)}function p(w,v){o.point(w,v)}function m(){h.point=p,o.lineStart()}function g(){h.point=d,o.lineEnd()}function y(w,v){f.push([w,v]),a.point(w,v)}function b(){a.lineStart(),f=[]}function x(){y(f[0][0],f[0][1]),a.lineEnd();var w=a.clean(),v=s.result(),_,M=v.length,E,N,I;if(f.pop(),l.push(f),f=null,!!M){if(w&1){if(N=v[0],(E=N.length-1)>0){for(c||(i.polygonStart(),c=!0),i.lineStart(),_=0;_<E;++_)i.point((I=N[_])[0],I[1]);i.lineEnd()}return}M>1&&w&2&&v.push(v.pop().concat(v.shift())),u.push(v.filter(kP))}}return h}}function kP(e){return e.length>1}function RP(e,t){return((e=e.x)[0]<0?e[1]-le-Q:le-e[1])-((t=t.x)[0]<0?t[1]-le-Q:le-t[1])}var e2=qg(function(){return!0},$P,UP,[-Mt,-le]);function $P(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?Mt:-Mt,c=Ct(o-t);Ct(c-Mt)<Q?(e.point(t,n=(n+s)/2>0?le:-le),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&c>=Mt&&(Ct(t-r)<Q&&(t-=r*Q),Ct(o-a)<Q&&(o-=a*Q),n=PP(t,n,o,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),i=0),e.point(t=o,n=s),r=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function PP(e,t,n,r){var i,o,s=Z(e-n);return Ct(s)>Q?Hr((Z(t)*(o=K(r))*Z(n)-Z(r)*(i=K(t))*Z(e))/(i*o*s)):(t+r)/2}function UP(e,t,n,r){var i;if(e==null)i=n*le,r.point(-Mt,i),r.point(0,i),r.point(Mt,i),r.point(Mt,0),r.point(Mt,-i),r.point(0,-i),r.point(-Mt,-i),r.point(-Mt,0),r.point(-Mt,i);else if(Ct(e[0]-t[0])>Q){var o=e[0]<t[0]?Mt:-Mt;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function P8(e){var t=K(e),n=6*Ut,r=t>0,i=Ct(t)>Q;function o(u,f,h,d){k8(d,e,n,h,u,f)}function s(u,f){return K(u)*K(f)>t}function a(u){var f,h,d,p,m;return{lineStart:function(){p=d=!1,m=1},point:function(g,y){var b=[g,y],x,w=s(g,y),v=r?w?0:l(g,y):w?l(g+(g<0?Mt:-Mt),y):0;if(!f&&(p=d=w)&&u.lineStart(),w!==d&&(x=c(f,b),(!x||xu(f,x)||xu(b,x))&&(b[2]=1)),w!==d)m=0,w?(u.lineStart(),x=c(b,f),u.point(x[0],x[1])):(x=c(f,b),u.point(x[0],x[1],2),u.lineEnd()),f=x;else if(i&&f&&r^w){var _;!(v&h)&&(_=c(b,f,!0))&&(m=0,r?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}w&&(!f||!xu(f,b))&&u.point(b[0],b[1]),f=b,d=w,h=v},lineEnd:function(){d&&u.lineEnd(),f=null},clean:function(){return m|(p&&d)<<1}}}function c(u,f,h){var d=oo(u),p=oo(f),m=[1,0,0],g=bu(d,p),y=Rd(g,g),b=g[0],x=y-b*b;if(!x)return!h&&u;var w=t*y/x,v=-t*b/x,_=bu(m,g),M=$d(m,w),E=$d(g,v);Og(M,E);var N=_,I=Rd(M,N),T=Rd(N,N),O=I*I-T*(Rd(M,M)-1);if(!(O<0)){var B=ue(O),S=$d(N,(-I-B)/T);if(Og(S,M),S=kd(S),!h)return S;var A=u[0],D=f[0],C=u[1],k=f[1],L;D<A&&(L=A,A=D,D=L);var R=D-A,$=Ct(R-Mt)<Q,P=$||R<Q;if(!$&&k<C&&(L=C,C=k,k=L),P?$?C+k>0^S[1]<(Ct(S[0]-A)<Q?C:k):C<=S[1]&&S[1]<=k:R>Mt^(A<=S[0]&&S[0]<=D)){var G=$d(N,(-I+B)/T);return Og(G,M),[S,kd(G)]}}}function l(u,f){var h=r?e:Mt-e,d=0;return u<-h?d|=1:u>h&&(d|=2),f<-h?d|=4:f>h&&(d|=8),d}return qg(s,a,o,r?[0,-e]:[-Mt,e-Mt])}function U8(e,t,n,r,i,o){var s=e[0],a=e[1],c=t[0],l=t[1],u=0,f=1,h=c-s,d=l-a,p;if(p=n-s,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>u&&(u=p)}if(p=i-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<f&&(f=p)}if(p=r-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>u&&(u=p)}if(p=o-a,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<f&&(f=p)}return u>0&&(e[0]=s+u*h,e[1]=a+u*d),f<1&&(t[0]=s+f*h,t[1]=a+f*d),!0}}}}}var Vd=1e9,Vg=-Vd;function wu(e,t,n,r){function i(l,u){return e<=l&&l<=n&&t<=u&&u<=r}function o(l,u,f,h){var d=0,p=0;if(l==null||(d=s(l,f))!==(p=s(u,f))||c(l,u)<0^f>0)do h.point(d===0||d===3?e:n,d>1?r:t);while((d=(d+f+4)%4)!==p);else h.point(u[0],u[1])}function s(l,u){return Ct(l[0]-e)<Q?u>0?0:3:Ct(l[0]-n)<Q?u>0?2:1:Ct(l[1]-t)<Q?u>0?1:0:u>0?3:2}function a(l,u){return c(l.x,u.x)}function c(l,u){var f=s(l,1),h=s(u,1);return f!==h?f-h:f===0?u[1]-l[1]:f===1?l[0]-u[0]:f===2?l[1]-u[1]:u[0]-l[0]}return function(l){var u=l,f=Pg(),h,d,p,m,g,y,b,x,w,v,_,M={point:E,lineStart:O,lineEnd:B,polygonStart:I,polygonEnd:T};function E(A,D){i(A,D)&&u.point(A,D)}function N(){for(var A=0,D=0,C=d.length;D<C;++D)for(var k=d[D],L=1,R=k.length,$=k[0],P,G,J=$[0],et=$[1];L<R;++L)P=J,G=et,$=k[L],J=$[0],et=$[1],G<=r?et>r&&(J-P)*(r-G)>(et-G)*(e-P)&&++A:et<=r&&(J-P)*(r-G)<(et-G)*(e-P)&&--A;return A}function I(){u=f,h=[],d=[],_=!0}function T(){var A=N(),D=_&&A,C=(h=tu(h)).length;(D||C)&&(l.polygonStart(),D&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),C&&zg(h,a,A,o,l),l.polygonEnd()),u=l,h=d=p=null}function O(){M.point=S,d&&d.push(p=[]),v=!0,w=!1,b=x=NaN}function B(){h&&(S(m,g),y&&w&&f.rejoin(),h.push(f.result())),M.point=E,w&&u.lineEnd()}function S(A,D){var C=i(A,D);if(d&&p.push([A,D]),v)m=A,g=D,y=C,v=!1,C&&(u.lineStart(),u.point(A,D));else if(C&&w)u.point(A,D);else{var k=[b=Math.max(Vg,Math.min(Vd,b)),x=Math.max(Vg,Math.min(Vd,x))],L=[A=Math.max(Vg,Math.min(Vd,A)),D=Math.max(Vg,Math.min(Vd,D))];U8(k,L,e,t,n,r)?(w||(u.lineStart(),u.point(k[0],k[1])),u.point(L[0],L[1]),C||u.lineEnd(),_=!1):C&&(u.lineStart(),u.point(A,D),_=!1)}b=A,x=D,w=C}return M}}function z8(e,t,n){var r=ke(e,t-Q,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function q8(e,t,n){var r=ke(e,t-Q,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function n2(){var e,t,n,r,i,o,s,a,c=10,l=c,u=90,f=360,h,d,p,m,g=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return ke(Ld(r/u)*u,n,u).map(p).concat(ke(Ld(a/f)*f,s,f).map(m)).concat(ke(Ld(t/c)*c,e,c).filter(function(x){return Ct(x%u)>Q}).map(h)).concat(ke(Ld(o/l)*l,i,l).filter(function(x){return Ct(x%f)>Q}).map(d))}return y.lines=function(){return b().map(function(x){return{type:"LineString",coordinates:x}})},y.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(m(s).slice(1),p(n).reverse().slice(1),m(a).reverse().slice(1))]}},y.extent=function(x){return arguments.length?y.extentMajor(x).extentMinor(x):y.extentMinor()},y.extentMajor=function(x){return arguments.length?(r=+x[0][0],n=+x[1][0],a=+x[0][1],s=+x[1][1],r>n&&(x=r,r=n,n=x),a>s&&(x=a,a=s,s=x),y.precision(g)):[[r,a],[n,s]]},y.extentMinor=function(x){return arguments.length?(t=+x[0][0],e=+x[1][0],o=+x[0][1],i=+x[1][1],t>e&&(x=t,t=e,e=x),o>i&&(x=o,o=i,i=x),y.precision(g)):[[t,o],[e,i]]},y.step=function(x){return arguments.length?y.stepMajor(x).stepMinor(x):y.stepMinor()},y.stepMajor=function(x){return arguments.length?(u=+x[0],f=+x[1],y):[u,f]},y.stepMinor=function(x){return arguments.length?(c=+x[0],l=+x[1],y):[c,l]},y.precision=function(x){return arguments.length?(g=+x,h=z8(o,i,90),d=q8(t,e,g),p=z8(a,s,90),m=q8(r,n,g),y):g},y.extentMajor([[-180,-90+Q],[180,90-Q]]).extentMinor([[-180,-80-Q],[180,80+Q]])}function r2(){return n2()()}var jd=e=>e;var i2=new bn,o2=new bn,V8,j8,s2,a2,xa={point:Ye,lineStart:Ye,lineEnd:Ye,polygonStart:function(){xa.lineStart=zP,xa.lineEnd=VP},polygonEnd:function(){xa.lineStart=xa.lineEnd=xa.point=Ye,i2.add(Ct(o2)),o2=new bn},result:function(){var e=i2/2;return i2=new bn,e}};function zP(){xa.point=qP}function qP(e,t){xa.point=Y8,V8=s2=e,j8=a2=t}function Y8(e,t){o2.add(a2*e-s2*t),s2=e,a2=t}function VP(){Y8(V8,j8)}var c2=xa;var _u=1/0,jg=_u,Yd=-_u,Yg=Yd,jP={point:YP,lineStart:Ye,lineEnd:Ye,polygonStart:Ye,polygonEnd:Ye,result:function(){var e=[[_u,jg],[Yd,Yg]];return Yd=Yg=-(jg=_u=1/0),e}};function YP(e,t){e<_u&&(_u=e),e>Yd&&(Yd=e),t<jg&&(jg=t),t>Yg&&(Yg=t)}var vu=jP;var l2=0,u2=0,Wd=0,Wg=0,Gg=0,Su=0,f2=0,h2=0,Gd=0,X8,H8,so,ao,Di={point:Pc,lineStart:W8,lineEnd:G8,polygonStart:function(){Di.lineStart=XP,Di.lineEnd=HP},polygonEnd:function(){Di.point=Pc,Di.lineStart=W8,Di.lineEnd=G8},result:function(){var e=Gd?[f2/Gd,h2/Gd]:Su?[Wg/Su,Gg/Su]:Wd?[l2/Wd,u2/Wd]:[NaN,NaN];return l2=u2=Wd=Wg=Gg=Su=f2=h2=Gd=0,e}};function Pc(e,t){l2+=e,u2+=t,++Wd}function W8(){Di.point=WP}function WP(e,t){Di.point=GP,Pc(so=e,ao=t)}function GP(e,t){var n=e-so,r=t-ao,i=ue(n*n+r*r);Wg+=i*(so+e)/2,Gg+=i*(ao+t)/2,Su+=i,Pc(so=e,ao=t)}function G8(){Di.point=Pc}function XP(){Di.point=ZP}function HP(){Z8(X8,H8)}function ZP(e,t){Di.point=Z8,Pc(X8=so=e,H8=ao=t)}function Z8(e,t){var n=e-so,r=t-ao,i=ue(n*n+r*r);Wg+=i*(so+e)/2,Gg+=i*(ao+t)/2,Su+=i,i=ao*e-so*t,f2+=i*(so+e),h2+=i*(ao+t),Gd+=i*3,Pc(so=e,ao=t)}var d2=Di;function Xg(e){this._context=e}Xg.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,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(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,nn);break}}},result:Ye};var m2=new bn,p2,K8,Q8,Xd,Hd,Hg={point:Ye,lineStart:function(){Hg.point=KP},lineEnd:function(){p2&&J8(K8,Q8),Hg.point=Ye},polygonStart:function(){p2=!0},polygonEnd:function(){p2=null},result:function(){var e=+m2;return m2=new bn,e}};function KP(e,t){Hg.point=J8,K8=Xd=e,Q8=Hd=t}function J8(e,t){Xd-=e,Hd-=t,m2.add(ue(Xd*Xd+Hd*Hd)),Xd=e,Hd=t}var y2=Hg;var tE,Zg,eE,nE,Iu=class{constructor(t){this._append=t==null?rE:QP(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==eE||this._append!==Zg){let r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,eE=r,Zg=this._append,nE=this._,this._=i}this._+=nE;break}}}result(){let t=this._;return this._="",t.length?t:null}};function rE(e){let t=1;this._+=e[0];for(let n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function QP(e){let t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return rE;if(t!==tE){let n=10**t;tE=t,Zg=function(i){let o=1;this._+=i[0];for(let s=i.length;o<s;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return Zg}function vn(e,t){let n=3,r=4.5,i,o;function s(a){return a&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),Er(a,i(o))),o.result()}return s.area=function(a){return Er(a,i(c2)),c2.result()},s.measure=function(a){return Er(a,i(y2)),y2.result()},s.bounds=function(a){return Er(a,i(vu)),vu.result()},s.centroid=function(a){return Er(a,i(d2)),d2.result()},s.projection=function(a){return arguments.length?(i=a==null?(e=null,jd):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new Iu(n)):new Xg(t=a),typeof r!="function"&&o.pointRadius(r),s):t},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(o.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 t===null&&(o=new Iu(n)),s},s.projection(e).digits(n).context(t)}function Uc(e){return{stream:Mu(e)}}function Mu(e){return function(t){var n=new g2;for(var r in e)n[r]=e[r];return n.stream=t,n}}function g2(){}g2.prototype={constructor:g2,point:function(e,t){this.stream.point(e,t)},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 b2(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Er(n,e.stream(vu)),t(vu.result()),r!=null&&e.clipExtent(r),e}function Zd(e,t,n){return b2(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,c=+t[0][1]+(o-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,c])},n)}function Kg(e,t,n){return Zd(e,[[0,0],t],n)}function Qg(e,t,n){return b2(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];e.scale(150*o).translate([s,a])},n)}function Jg(e,t,n){return b2(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var iE=16,JP=K(30*Ut);function x2(e,t){return+t?eU(e,t):tU(e)}function tU(e){return Mu({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function eU(e,t){function n(r,i,o,s,a,c,l,u,f,h,d,p,m,g){var y=l-r,b=u-i,x=y*y+b*b;if(x>4*t&&m--){var w=s+h,v=a+d,_=c+p,M=ue(w*w+v*v+_*_),E=be(_/=M),N=Ct(Ct(_)-1)<Q||Ct(o-f)<Q?(o+f)/2:je(v,w),I=e(N,E),T=I[0],O=I[1],B=T-r,S=O-i,A=b*B-y*S;(A*A/x>t||Ct((y*B+b*S)/x-.5)>.3||s*h+a*d+c*p<JP)&&(n(r,i,o,s,a,c,T,O,N,w/=M,v/=M,_,m,g),g.point(T,O),n(T,O,N,w,v,_,l,u,f,h,d,p,m,g))}}return function(r){var i,o,s,a,c,l,u,f,h,d,p,m,g={point:y,lineStart:b,lineEnd:w,polygonStart:function(){r.polygonStart(),g.lineStart=v},polygonEnd:function(){r.polygonEnd(),g.lineStart=b}};function y(E,N){E=e(E,N),r.point(E[0],E[1])}function b(){f=NaN,g.point=x,r.lineStart()}function x(E,N){var I=oo([E,N]),T=e(E,N);n(f,h,u,d,p,m,f=T[0],h=T[1],u=E,d=I[0],p=I[1],m=I[2],iE,r),r.point(f,h)}function w(){g.point=y,r.lineEnd()}function v(){b(),g.point=_,g.lineEnd=M}function _(E,N){x(i=E,N),o=f,s=h,a=d,c=p,l=m,g.point=x}function M(){n(f,h,u,d,p,m,o,s,i,a,c,l,iE,r),g.lineEnd=w,w()}return g}}var nU=Mu({point:function(e,t){this.stream.point(e*Ut,t*Ut)}});function rU(e){return Mu({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function iU(e,t,n,r,i){function o(s,a){return s*=r,a*=i,[t+e*s,n-e*a]}return o.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*i]},o}function oE(e,t,n,r,i,o){if(!o)return iU(e,t,n,r,i);var s=K(o),a=Z(o),c=s*e,l=a*e,u=s/e,f=a/e,h=(a*n-s*t)/e,d=(a*t+s*n)/e;function p(m,g){return m*=r,g*=i,[c*m-l*g+t,n-l*m-c*g]}return p.invert=function(m,g){return[r*(u*m-f*g+h),i*(d-f*m-u*g)]},p}function Sn(e){return w2(function(){return e})()}function w2(e){var t,n=150,r=480,i=250,o=0,s=0,a=0,c=0,l=0,u,f=0,h=1,d=1,p=null,m=e2,g=null,y,b,x,w=jd,v=.5,_,M,E,N,I;function T(A){return E(A[0]*Ut,A[1]*Ut)}function O(A){return A=E.invert(A[0],A[1]),A&&[A[0]*Fe,A[1]*Fe]}T.stream=function(A){return N&&I===A?N:N=nU(rU(u)(m(_(w(I=A)))))},T.preclip=function(A){return arguments.length?(m=A,p=void 0,S()):m},T.postclip=function(A){return arguments.length?(w=A,g=y=b=x=null,S()):w},T.clipAngle=function(A){return arguments.length?(m=+A?P8(p=A*Ut):(p=null,e2),S()):p*Fe},T.clipExtent=function(A){return arguments.length?(w=A==null?(g=y=b=x=null,jd):wu(g=+A[0][0],y=+A[0][1],b=+A[1][0],x=+A[1][1]),S()):g==null?null:[[g,y],[b,x]]},T.scale=function(A){return arguments.length?(n=+A,B()):n},T.translate=function(A){return arguments.length?(r=+A[0],i=+A[1],B()):[r,i]},T.center=function(A){return arguments.length?(o=A[0]%360*Ut,s=A[1]%360*Ut,B()):[o*Fe,s*Fe]},T.rotate=function(A){return arguments.length?(a=A[0]%360*Ut,c=A[1]%360*Ut,l=A.length>2?A[2]%360*Ut:0,B()):[a*Fe,c*Fe,l*Fe]},T.angle=function(A){return arguments.length?(f=A%360*Ut,B()):f*Fe},T.reflectX=function(A){return arguments.length?(h=A?-1:1,B()):h<0},T.reflectY=function(A){return arguments.length?(d=A?-1:1,B()):d<0},T.precision=function(A){return arguments.length?(_=x2(M,v=A*A),S()):ue(v)},T.fitExtent=function(A,D){return Zd(T,A,D)},T.fitSize=function(A,D){return Kg(T,A,D)},T.fitWidth=function(A,D){return Qg(T,A,D)},T.fitHeight=function(A,D){return Jg(T,A,D)};function B(){var A=oE(n,0,0,h,d,f).apply(null,t(o,s)),D=oE(n,r-A[0],i-A[1],h,d,f);return u=Jv(a,c,l),M=qd(t,D),E=qd(u,M),_=x2(M,v),S()}function S(){return N=I=null,T}return function(){return t=e.apply(this,arguments),T.invert=t.invert&&O,B()}}function Au(e){var t=0,n=Mt/3,r=w2(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*Ut,n=o[1]*Ut):[t*Fe,n*Fe]},i}function sE(e){var t=K(e);function n(r,i){return[r*t,Z(i)/t]}return n.invert=function(r,i){return[r/t,be(i*t)]},n}function aE(e,t){var n=Z(e),r=(n+Z(t))/2;if(Ct(r)<Q)return sE(e);var i=1+n*(2*r-n),o=ue(i)/r;function s(a,c){var l=ue(i-2*r*Z(c))/r;return[l*Z(a*=r),o-l*K(a)]}return s.invert=function(a,c){var l=o-c,u=je(a,Ct(l))*Fn(l);return l*r<0&&(u-=Mt*Fn(a)*Fn(l)),[u/r,be((i-(a*a+l*l)*r*r)/(2*r))]},s}function wa(){return Au(aE).scale(155.424).center([0,33.6442])}function Kd(){return wa().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function oU(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i<t;)e[i].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function _2(){var e,t,n=Kd(),r,i=wa().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=wa().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,c,l={point:function(h,d){c=[h,d]}};function u(h){var d=h[0],p=h[1];return c=null,r.point(d,p),c||(o.point(d,p),c)||(a.point(d,p),c)}u.invert=function(h){var d=n.scale(),p=n.translate(),m=(h[0]-p[0])/d,g=(h[1]-p[1])/d;return(g>=.12&&g<.234&&m>=-.425&&m<-.214?i:g>=.166&&g<.234&&m>=-.214&&m<-.115?s:n).invert(h)},u.stream=function(h){return e&&t===h?e:e=oU([n.stream(t=h),i.stream(h),s.stream(h)])},u.precision=function(h){return arguments.length?(n.precision(h),i.precision(h),s.precision(h),f()):n.precision()},u.scale=function(h){return arguments.length?(n.scale(h),i.scale(h*.35),s.scale(h),u.translate(n.translate())):n.scale()},u.translate=function(h){if(!arguments.length)return n.translate();var d=n.scale(),p=+h[0],m=+h[1];return r=n.translate(h).clipExtent([[p-.455*d,m-.238*d],[p+.455*d,m+.238*d]]).stream(l),o=i.translate([p-.307*d,m+.201*d]).clipExtent([[p-.425*d+Q,m+.12*d+Q],[p-.214*d-Q,m+.234*d-Q]]).stream(l),a=s.translate([p-.205*d,m+.212*d]).clipExtent([[p-.214*d+Q,m+.166*d+Q],[p-.115*d-Q,m+.234*d-Q]]).stream(l),f()},u.fitExtent=function(h,d){return Zd(u,h,d)},u.fitSize=function(h,d){return Kg(u,h,d)},u.fitWidth=function(h,d){return Qg(u,h,d)},u.fitHeight=function(h,d){return Jg(u,h,d)};function f(){return e=t=null,u}return u.scale(1070)}function tb(e){return function(t,n){var r=K(t),i=K(n),o=e(r*i);return o===1/0?[2,0]:[o*i*Z(t),o*Z(n)]}}function co(e){return function(t,n){var r=ue(t*t+n*n),i=e(r),o=Z(i),s=K(i);return[je(t*o,r*s),be(r&&n*o/r)]}}var v2=tb(function(e){return ue(2/(1+e))});v2.invert=co(function(e){return 2*be(e/2)});function S2(){return Sn(v2).scale(124.75).clipAngle(180-.001)}var I2=tb(function(e){return(e=Dg(e))&&e/Z(e)});I2.invert=co(function(e){return e});function M2(){return Sn(I2).scale(79.4188).clipAngle(180-.001)}function Tu(e,t){return[e,$c(gu((le+t)/2))]}Tu.invert=function(e,t){return[e,2*Hr(Ag(t))-le]};function A2(){return T2(Tu).scale(961/nn)}function T2(e){var t=Sn(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,s=null,a,c,l;t.scale=function(f){return arguments.length?(r(f),u()):r()},t.translate=function(f){return arguments.length?(i(f),u()):i()},t.center=function(f){return arguments.length?(n(f),u()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=c=l=null:(s=+f[0][0],a=+f[0][1],c=+f[1][0],l=+f[1][1]),u()):s==null?null:[[s,a],[c,l]]};function u(){var f=Mt*r(),h=t(C8(t.rotate()).invert([0,0]));return o(s==null?[[h[0]-f,h[1]-f],[h[0]+f,h[1]+f]]:e===Tu?[[Math.max(h[0]-f,s),a],[Math.min(h[0]+f,c),l]]:[[s,Math.max(h[1]-f,a)],[c,Math.min(h[1]+f,l)]])}return u()}function eb(e){return gu((le+e)/2)}function cE(e,t){var n=K(e),r=e===t?Z(e):$c(n/K(t))/$c(eb(t)/eb(e)),i=n*Eg(eb(e),r)/r;if(!r)return Tu;function o(s,a){i>0?a<-le+Q&&(a=-le+Q):a>le-Q&&(a=le-Q);var c=i/Eg(eb(a),r);return[c*Z(r*s),i-c*K(r*s)]}return o.invert=function(s,a){var c=i-a,l=Fn(r)*ue(s*s+c*c),u=je(s,Ct(c))*Fn(c);return c*r<0&&(u-=Mt*Fn(s)*Fn(c)),[u/r,2*Hr(Eg(i/l,1/r))-le]},o}function E2(){return Au(cE).scale(109.5).parallels([30,30])}function Eu(e,t){return[e,t]}Eu.invert=Eu;function D2(){return Sn(Eu).scale(152.63)}function lE(e,t){var n=K(e),r=e===t?Z(e):(n-K(t))/(t-e),i=n/r+e;if(Ct(r)<Q)return Eu;function o(s,a){var c=i-a,l=r*s;return[c*Z(l),i-c*K(l)]}return o.invert=function(s,a){var c=i-a,l=je(s,Ct(c))*Fn(c);return c*r<0&&(l-=Mt*Fn(s)*Fn(c)),[l/r,i-Fn(r)*ue(s*s+c*c)]},o}function N2(){return Au(lE).scale(131.154).center([0,13.9389])}var Qd=1.340264,Jd=-.081106,tp=893e-6,ep=.003796,nb=ue(3)/2,sU=12;function O2(e,t){var n=be(nb*Z(t)),r=n*n,i=r*r*r;return[e*K(n)/(nb*(Qd+3*Jd*r+i*(7*tp+9*ep*r))),n*(Qd+Jd*r+i*(tp+ep*r))]}O2.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,s,a,c;o<sU&&(a=n*(Qd+Jd*r+i*(tp+ep*r))-t,c=Qd+3*Jd*r+i*(7*tp+9*ep*r),n-=s=a/c,r=n*n,i=r*r*r,!(Ct(s)<Rc));++o);return[nb*e*(Qd+3*Jd*r+i*(7*tp+9*ep*r))/K(n),be(Z(n)/nb)]};function B2(){return Sn(O2).scale(177.158)}function F2(e,t){var n=K(t),r=K(e)*n;return[n*Z(e)/r,Z(t)/r]}F2.invert=co(Hr);function C2(){return Sn(F2).scale(144.049).clipAngle(60)}function L2(e,t){return[K(t)*Z(e),Z(t)]}L2.invert=co(be);function k2(){return Sn(L2).scale(249.5).clipAngle(90+Q)}function R2(e,t){var n=K(t),r=1+K(e)*n;return[n*Z(e)/r,Z(t)/r]}R2.invert=co(function(e){return 2*Hr(e)});function $2(){return Sn(R2).scale(250).clipAngle(142)}function P2(e,t){return[$c(gu((le+t)/2)),-e]}P2.invert=function(e,t){return[-t,2*Hr(Ag(e))-le]};function U2(){var e=T2(P2),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.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 aU(e,t){return e.parent===t.parent?1:2}function cU(e){return e.reduce(lU,0)/e.length}function lU(e,t){return e+t.x}function uU(e){return 1+e.reduce(fU,0)}function fU(e,t){return Math.max(e,t.y)}function hU(e){for(var t;t=e.children;)e=t[0];return e}function dU(e){for(var t;t=e.children;)e=t[t.length-1];return e}function rb(){var e=aU,t=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(h){var d=h.children;d?(h.x=cU(d),h.y=uU(d)):(h.x=s?a+=e(h,s):0,h.y=0,s=h)});var c=hU(o),l=dU(o),u=c.x-e(c,l)/2,f=l.x+e(l,c)/2;return o.eachAfter(r?function(h){h.x=(h.x-o.x)*t,h.y=(o.y-h.y)*n}:function(h){h.x=(h.x-u)/(f-u)*t,h.y=(1-(o.y?h.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(r=!1,t=+o[0],n=+o[1],i):r?null:[t,n]},i.nodeSize=function(o){return arguments.length?(r=!0,t=+o[0],n=+o[1],i):r?[t,n]:null},i}function pU(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function uE(){return this.eachAfter(pU)}function fE(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function hE(e,t){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(e.call(t,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function dE(e,t){for(var n=this,r=[n],i=[],o,s,a,c=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s<a;++s)r.push(o[s]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function pE(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function mE(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function yE(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function gE(e){for(var t=this,n=mU(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function mU(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function bE(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function xE(){return Array.from(this)}function wE(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function _E(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*vE(){var e=this,t,n=[e],r,i,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function z2(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=bU)):t===void 0&&(t=gU);for(var n=new _a(e),r,i=[n],o,s,a,c;r=i.pop();)if((s=t(r.data))&&(c=(s=Array.from(s)).length))for(r.children=s,a=c-1;a>=0;--a)i.push(o=s[a]=new _a(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(q2)}function yU(){return z2(this).eachBefore(xU)}function gU(e){return e.children}function bU(e){return Array.isArray(e)?e[1]:null}function xU(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function q2(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function _a(e){this.data=e,this.depth=this.height=0,this.parent=null}_a.prototype=z2.prototype={constructor:_a,count:uE,each:fE,eachAfter:dE,eachBefore:hE,find:pE,sum:mE,sort:yE,path:gE,ancestors:bE,descendants:xE,leaves:wE,links:_E,copy:yU,[Symbol.iterator]:vE};function ib(e){return e==null?null:wU(e)}function wU(e){if(typeof e!="function")throw new Error;return e}var _U={depth:-1},SE={},V2={};function vU(e){return e.id}function SU(e){return e.parentId}function ob(){var e=vU,t=SU,n;function r(i){var o=Array.from(i),s=e,a=t,c,l,u,f,h,d,p,m,g=new Map;if(n!=null){let y=o.map((w,v)=>IU(n(w,v,i))),b=y.map(IE),x=new Set(y).add("");for(let w of b)x.has(w)||(x.add(w),y.push(w),b.push(IE(w)),o.push(V2));s=(w,v)=>y[v],a=(w,v)=>b[v]}for(u=0,c=o.length;u<c;++u)l=o[u],d=o[u]=new _a(l),(p=s(l,u,i))!=null&&(p+="")&&(m=d.id=p,g.set(m,g.has(m)?SE:d)),(p=a(l,u,i))!=null&&(p+="")&&(d.parent=p);for(u=0;u<c;++u)if(d=o[u],p=d.parent){if(h=g.get(p),!h)throw new Error("missing: "+p);if(h===SE)throw new Error("ambiguous: "+p);h.children?h.children.push(d):h.children=[d],d.parent=h}else{if(f)throw new Error("multiple roots");f=d}if(!f)throw new Error("no root");if(n!=null){for(;f.data===V2&&f.children.length===1;)f=f.children[0],--c;for(let y=o.length-1;y>=0&&(d=o[y],d.data===V2);--y)d.data=null}if(f.parent=_U,f.eachBefore(function(y){y.depth=y.parent.depth+1,--c}).eachBefore(q2),f.parent=null,c>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(e=ib(i),r):e},r.parentId=function(i){return arguments.length?(t=ib(i),r):t},r.path=function(i){return arguments.length?(n=ib(i),r):n},r}function IU(e){e=`${e}`;let t=e.length;return j2(e,t-1)&&!j2(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function IE(e){let t=e.length;if(t<2)return"";for(;--t>1&&!j2(e,t););return e.slice(0,t)}function j2(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function MU(e,t){return e.parent===t.parent?1:2}function Y2(e){var t=e.children;return t?t[0]:e.t}function W2(e){var t=e.children;return t?t[t.length-1]:e.t}function AU(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function TU(e){for(var t=0,n=0,r=e.children,i=r.length,o;--i>=0;)o=r[i],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function EU(e,t,n){return e.a.parent===t.parent?e.a:n}function sb(e,t){this._=e,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=t}sb.prototype=Object.create(_a.prototype);function DU(e){for(var t=new sb(e,0),n,r=[t],i,o,s,a;n=r.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)r.push(i=n.children[s]=new sb(o[s],s)),i.parent=n;return(t.parent=new sb(null,0)).children=[t],t}function zc(){var e=MU,t=1,n=1,r=null;function i(l){var u=DU(l);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),r)l.eachBefore(c);else{var f=l,h=l,d=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>h.x&&(h=b),b.depth>d.depth&&(d=b)});var p=f===h?1:e(f,h)/2,m=p-f.x,g=t/(h.x+p+m),y=n/(d.depth||1);l.eachBefore(function(b){b.x=(b.x+m)*g,b.y=b.depth*y})}return l}function o(l){var u=l.children,f=l.parent.children,h=l.i?f[l.i-1]:null;if(u){TU(l);var d=(u[0].z+u[u.length-1].z)/2;h?(l.z=h.z+e(l._,h._),l.m=l.z-d):l.z=d}else h&&(l.z=h.z+e(l._,h._));l.parent.A=a(l,h,l.parent.A||f[0])}function s(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,u,f){if(u){for(var h=l,d=l,p=u,m=h.parent.children[0],g=h.m,y=d.m,b=p.m,x=m.m,w;p=W2(p),h=Y2(h),p&&h;)m=Y2(m),d=W2(d),d.a=l,w=p.z+b-h.z-g+e(p._,h._),w>0&&(AU(EU(p,l,f),l,w),g+=w,y+=w),b+=p.m,g+=h.m,x+=m.m,y+=d.m;p&&!W2(d)&&(d.t=p,d.m+=b-y),h&&!Y2(m)&&(m.t=h,m.m+=g-x,f=l)}return f}function c(l){l.x*=t,l.y=l.depth*n}return i.separation=function(l){return arguments.length?(e=l,i):e},i.size=function(l){return arguments.length?(r=!1,t=+l[0],n=+l[1],i):r?null:[t,n]},i.nodeSize=function(l){return arguments.length?(r=!0,t=+l[0],n=+l[1],i):r?[t,n]:null},i}var ME=23283064365386963e-26;function qc(e=Math.random()){let t=(0<=e&&e<1?e/ME:Math.abs(e))|0;return()=>(t=1664525*t+1013904223|0,ME*(t>>>0))}function We(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function np(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}var rp=Symbol("implicit");function Vc(){var e=new qn,t=[],n=[],r=rp;function i(o){let s=e.get(o);if(s===void 0){if(r!==rp)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new qn;for(let s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Vc(t,n).unknown(r)},We.apply(i,arguments),i}function va(){var e=Vc().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,c=0,l=0,u=.5;delete e.unknown;function f(){var h=t().length,d=i<r,p=d?i:r,m=d?r:i;o=(m-p)/Math.max(1,h-c+l*2),a&&(o=Math.floor(o)),p+=(m-p-o*(h-c))*u,s=o*(1-c),a&&(p=Math.round(p),s=Math.round(s));var g=ke(h).map(function(y){return p+o*y});return n(d?g.reverse():g)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(h){return arguments.length?(a=!!h,f()):a},e.padding=function(h){return arguments.length?(c=Math.min(1,l=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(l=+h,f()):l},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),f()):u},e.copy=function(){return va(t(),[r,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},We.apply(f(),arguments)}function AE(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return AE(t())},e}function G2(){return AE(va.apply(null,arguments).paddingInner(1))}function X2(e){return function(){return e}}function Du(e){return+e}var TE=[0,1];function hr(e){return e}function H2(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:X2(isNaN(t)?NaN:.5)}function NU(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function OU(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=H2(i,r),o=n(s,o)):(r=H2(r,i),o=n(o,s)),function(a){return o(r(a))}}function BU(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=H2(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var c=is(e,a,1,r)-1;return o[c](i[c](a))}}function lo(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function jc(){var e=TE,t=TE,n=Tr,r,i,o,s=hr,a,c,l;function u(){var h=Math.min(e.length,t.length);return s!==hr&&(s=NU(e[0],e[h-1])),a=h>2?BU:OU,c=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(c||(c=a(e.map(r),t,n)))(r(s(h)))}return f.invert=function(h){return s(i((l||(l=a(t,e.map(r),ge)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Du),u()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=Oc,u()},f.clamp=function(h){return arguments.length?(s=h?!0:hr,u()):s!==hr},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,d){return r=h,i=d,u()}}function ip(){return jc()(hr,hr)}function Z2(e,t,n,r){var i=Ql(e,t,n),o;switch(r=io(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Vv(i,s))&&(r.precision=o),Mg(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=jv(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=qv(i))&&(r.precision=o-(r.type==="%")*2);break}}return Xr(r)}function ms(e){var t=e.domain;return e.ticks=function(n){var r=t();return xn(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Z2(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],c,l,u=10;for(a<s&&(l=s,s=a,a=l,l=i,i=o,o=l);u-- >0;){if(l=os(s,a,n),l===c)return r[i]=s,r[o]=a,t(r);if(l>0)s=Math.floor(s/l)*l,a=Math.ceil(a/l)*l;else if(l<0)s=Math.ceil(s*l)/l,a=Math.floor(a*l)/l;else break;c=l}return e},e}function ys(){var e=ip();return e.copy=function(){return lo(e,ys())},We.apply(e,arguments),ms(e)}function op(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Du),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return op(e).unknown(t)},e=arguments.length?Array.from(e,Du):[0,1],ms(n)}function sp(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function EE(e){return Math.log(e)}function DE(e){return Math.exp(e)}function FU(e){return-Math.log(-e)}function CU(e){return-Math.exp(-e)}function LU(e){return isFinite(e)?+("1e"+e):e<0?0:e}function kU(e){return e===10?LU:e===Math.E?Math.exp:t=>Math.pow(e,t)}function RU(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function NE(e){return(t,n)=>-e(-t,n)}function K2(e){let t=e(EE,DE),n=t.domain,r=10,i,o;function s(){return i=RU(r),o=kU(r),n()[0]<0?(i=NE(i),o=NE(o),e(FU,CU)):e(EE,DE),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{let c=n(),l=c[0],u=c[c.length-1],f=u<l;f&&([l,u]=[u,l]);let h=i(l),d=i(u),p,m,g=a==null?10:+a,y=[];if(!(r%1)&&d-h<g){if(h=Math.floor(h),d=Math.ceil(d),l>0){for(;h<=d;++h)for(p=1;p<r;++p)if(m=h<0?p/o(-h):p*o(h),!(m<l)){if(m>u)break;y.push(m)}}else for(;h<=d;++h)for(p=r-1;p>=1;--p)if(m=h>0?p/o(-h):p*o(h),!(m<l)){if(m>u)break;y.push(m)}y.length*2<g&&(y=xn(l,u,g))}else y=xn(h,d,Math.min(d-h,g)).map(o);return f?y.reverse():y},t.tickFormat=(a,c)=>{if(a==null&&(a=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=io(c)).precision==null&&(c.trim=!0),c=Xr(c)),a===1/0)return c;let l=Math.max(1,r*a/t.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=l?c(u):""}},t.nice=()=>n(sp(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function ap(){let e=K2(jc()).domain([1,10]);return e.copy=()=>lo(e,ap()).base(e.base()),We.apply(e,arguments),e}function OE(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function BE(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Q2(e){var t=1,n=e(OE(t),BE(t));return n.constant=function(r){return arguments.length?e(OE(t=+r),BE(t)):t},ms(n)}function cp(){var e=Q2(jc());return e.copy=function(){return lo(e,cp()).constant(e.constant())},We.apply(e,arguments)}function FE(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function $U(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function PU(e){return e<0?-e*e:e*e}function J2(e){var t=e(hr,hr),n=1;function r(){return n===1?e(hr,hr):n===.5?e($U,PU):e(FE(n),FE(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ms(t)}function lp(){var e=J2(jc());return e.copy=function(){return lo(e,lp()).exponent(e.exponent())},We.apply(e,arguments),e}function up(){var e=[],t=[],n=[],r;function i(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s<a;)n[s-1]=Q_(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?r:t[is(n,s)]}return o.invertExtent=function(s){var a=t.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let a of s)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort($t),i()},o.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},o.unknown=function(s){return arguments.length?(r=s,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return up().domain(e).range(t).unknown(r)},We.apply(o,arguments)}function fp(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[is(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return fp().domain(e).range(t).unknown(n)},We.apply(i,arguments)}var tS=new Date,eS=new Date;function fe(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{let s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{let c=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return c;let l;do c.push(l=new Date(+o)),t(o,a),e(o);while(l<o&&o<s);return c},i.filter=o=>fe(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(tS.setTime(+o),eS.setTime(+s),e(tS),e(eS),Math.floor(n(tS,eS))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}var hp=fe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);hp.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?fe(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):hp);var d_t=hp.range;var rn=fe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),CE=rn.range;var gs=fe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),UU=gs.range,bs=fe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),zU=bs.range;var xs=fe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3-e.getMinutes()*6e4)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getHours()),qU=xs.range,ws=fe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),VU=ws.range;var Zr=fe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1),jU=Zr.range,Gc=fe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),YU=Gc.range,Xc=fe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),WU=Xc.range;function Hc(e){return fe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}var Dr=Hc(0),Sa=Hc(1),ab=Hc(2),cb=Hc(3),fo=Hc(4),lb=Hc(5),ub=Hc(6),kE=Dr.range,GU=Sa.range,XU=ab.range,HU=cb.range,ZU=fo.range,KU=lb.range,QU=ub.range;function Zc(e){return fe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/6048e5)}var Nr=Zc(0),Ia=Zc(1),fb=Zc(2),hb=Zc(3),ho=Zc(4),db=Zc(5),pb=Zc(6),RE=Nr.range,JU=Ia.range,tz=fb.range,ez=hb.range,nz=ho.range,rz=db.range,iz=pb.range;var _s=fe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),oz=_s.range,vs=fe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),sz=vs.range;var Cn=fe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Cn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});var az=Cn.range,Ln=fe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ln.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});var cz=Ln.range;function PE(e,t,n,r,i,o){let s=[[rn,1,1e3],[rn,5,5*1e3],[rn,15,15*1e3],[rn,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[r,1,864e5],[r,2,2*864e5],[n,1,6048e5],[t,1,2592e6],[t,3,3*2592e6],[e,1,31536e6]];function a(l,u,f){let h=u<l;h&&([l,u]=[u,l]);let d=f&&typeof f.range=="function"?f:c(l,u,f),p=d?d.range(l,+u+1):[];return h?p.reverse():p}function c(l,u,f){let h=Math.abs(u-l)/f,d=rs(([,,g])=>g).right(s,h);if(d===s.length)return e.every(Ql(l/31536e6,u/31536e6,f));if(d===0)return hp.every(Math.max(Ql(l,u,f),1));let[p,m]=s[h/s[d-1][2]<s[d][2]/h?d-1:d];return p.every(m)}return[a,c]}var[nS,pp]=PE(Ln,vs,Nr,Xc,ws,bs),[rS,iS]=PE(Cn,_s,Dr,Zr,xs,gs);function oS(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function sS(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function mp(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function aS(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,c=e.shortMonths,l=yp(i),u=gp(i),f=yp(o),h=gp(o),d=yp(s),p=gp(s),m=yp(a),g=gp(a),y=yp(c),b=gp(c),x={a:C,A:k,b:L,B:R,c:null,d:YE,e:YE,f:Bz,g:qz,G:jz,H:Dz,I:Nz,j:Oz,L:ZE,m:Fz,M:Cz,p:$,q:P,Q:XE,s:HE,S:Lz,u:kz,U:Rz,V:$z,w:Pz,W:Uz,x:null,X:null,y:zz,Y:Vz,Z:Yz,"%":GE},w={a:G,A:J,b:et,B:ot,c:null,d:WE,e:WE,f:Hz,g:oq,G:aq,H:Wz,I:Gz,j:Xz,L:QE,m:Zz,M:Kz,p:j,q:nt,Q:XE,s:HE,S:Qz,u:Jz,U:tq,V:eq,w:nq,W:rq,x:null,X:null,y:iq,Y:sq,Z:cq,"%":GE},v={a:I,A:T,b:O,B,c:S,d:VE,e:VE,f:Mz,g:qE,G:zE,H:jE,I:jE,j:_z,L:Iz,m:wz,M:vz,p:N,q:xz,Q:Tz,s:Ez,S:Sz,u:pz,U:mz,V:yz,w:dz,W:gz,x:A,X:D,y:qE,Y:zE,Z:bz,"%":Az};x.x=_(n,x),x.X=_(r,x),x.c=_(t,x),w.x=_(n,w),w.X=_(r,w),w.c=_(t,w);function _(z,X){return function(rt){var U=[],Bt=-1,ft=0,jt=z.length,Yt,tt,ne;for(rt instanceof Date||(rt=new Date(+rt));++Bt<jt;)z.charCodeAt(Bt)===37&&(U.push(z.slice(ft,Bt)),(tt=UE[Yt=z.charAt(++Bt)])!=null?Yt=z.charAt(++Bt):tt=Yt==="e"?" ":"0",(ne=X[Yt])&&(Yt=ne(rt,tt)),U.push(Yt),ft=Bt+1);return U.push(z.slice(ft,Bt)),U.join("")}}function M(z,X){return function(rt){var U=mp(1900,void 0,1),Bt=E(U,z,rt+="",0),ft,jt;if(Bt!=rt.length)return null;if("Q"in U)return new Date(U.Q);if("s"in U)return new Date(U.s*1e3+("L"in U?U.L:0));if(X&&!("Z"in U)&&(U.Z=0),"p"in U&&(U.H=U.H%12+U.p*12),U.m===void 0&&(U.m="q"in U?U.q:0),"V"in U){if(U.V<1||U.V>53)return null;"w"in U||(U.w=1),"Z"in U?(ft=sS(mp(U.y,0,1)),jt=ft.getUTCDay(),ft=jt>4||jt===0?Ia.ceil(ft):Ia(ft),ft=Gc.offset(ft,(U.V-1)*7),U.y=ft.getUTCFullYear(),U.m=ft.getUTCMonth(),U.d=ft.getUTCDate()+(U.w+6)%7):(ft=oS(mp(U.y,0,1)),jt=ft.getDay(),ft=jt>4||jt===0?Sa.ceil(ft):Sa(ft),ft=Zr.offset(ft,(U.V-1)*7),U.y=ft.getFullYear(),U.m=ft.getMonth(),U.d=ft.getDate()+(U.w+6)%7)}else("W"in U||"U"in U)&&("w"in U||(U.w="u"in U?U.u%7:"W"in U?1:0),jt="Z"in U?sS(mp(U.y,0,1)).getUTCDay():oS(mp(U.y,0,1)).getDay(),U.m=0,U.d="W"in U?(U.w+6)%7+U.W*7-(jt+5)%7:U.w+U.U*7-(jt+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,sS(U)):oS(U)}}function E(z,X,rt,U){for(var Bt=0,ft=X.length,jt=rt.length,Yt,tt;Bt<ft;){if(U>=jt)return-1;if(Yt=X.charCodeAt(Bt++),Yt===37){if(Yt=X.charAt(Bt++),tt=v[Yt in UE?X.charAt(Bt++):Yt],!tt||(U=tt(z,rt,U))<0)return-1}else if(Yt!=rt.charCodeAt(U++))return-1}return U}function N(z,X,rt){var U=l.exec(X.slice(rt));return U?(z.p=u.get(U[0].toLowerCase()),rt+U[0].length):-1}function I(z,X,rt){var U=d.exec(X.slice(rt));return U?(z.w=p.get(U[0].toLowerCase()),rt+U[0].length):-1}function T(z,X,rt){var U=f.exec(X.slice(rt));return U?(z.w=h.get(U[0].toLowerCase()),rt+U[0].length):-1}function O(z,X,rt){var U=y.exec(X.slice(rt));return U?(z.m=b.get(U[0].toLowerCase()),rt+U[0].length):-1}function B(z,X,rt){var U=m.exec(X.slice(rt));return U?(z.m=g.get(U[0].toLowerCase()),rt+U[0].length):-1}function S(z,X,rt){return E(z,t,X,rt)}function A(z,X,rt){return E(z,n,X,rt)}function D(z,X,rt){return E(z,r,X,rt)}function C(z){return s[z.getDay()]}function k(z){return o[z.getDay()]}function L(z){return c[z.getMonth()]}function R(z){return a[z.getMonth()]}function $(z){return i[+(z.getHours()>=12)]}function P(z){return 1+~~(z.getMonth()/3)}function G(z){return s[z.getUTCDay()]}function J(z){return o[z.getUTCDay()]}function et(z){return c[z.getUTCMonth()]}function ot(z){return a[z.getUTCMonth()]}function j(z){return i[+(z.getUTCHours()>=12)]}function nt(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var X=_(z+="",x);return X.toString=function(){return z},X},parse:function(z){var X=M(z+="",!1);return X.toString=function(){return z},X},utcFormat:function(z){var X=_(z+="",w);return X.toString=function(){return z},X},utcParse:function(z){var X=M(z+="",!0);return X.toString=function(){return z},X}}}var UE={"-":"",_:" ",0:"0"},on=/^\s*\d+/,uz=/^%/,fz=/[\\^$*+?|[\]().{}]/g;function Kt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function hz(e){return e.replace(fz,"\\$&")}function yp(e){return new RegExp("^(?:"+e.map(hz).join("|")+")","i")}function gp(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function dz(e,t,n){var r=on.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function pz(e,t,n){var r=on.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function mz(e,t,n){var r=on.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function yz(e,t,n){var r=on.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function gz(e,t,n){var r=on.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function zE(e,t,n){var r=on.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function qE(e,t,n){var r=on.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function bz(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function xz(e,t,n){var r=on.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function wz(e,t,n){var r=on.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function VE(e,t,n){var r=on.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function _z(e,t,n){var r=on.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function jE(e,t,n){var r=on.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function vz(e,t,n){var r=on.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Sz(e,t,n){var r=on.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Iz(e,t,n){var r=on.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Mz(e,t,n){var r=on.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Az(e,t,n){var r=uz.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Tz(e,t,n){var r=on.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ez(e,t,n){var r=on.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function YE(e,t){return Kt(e.getDate(),t,2)}function Dz(e,t){return Kt(e.getHours(),t,2)}function Nz(e,t){return Kt(e.getHours()%12||12,t,2)}function Oz(e,t){return Kt(1+Zr.count(Cn(e),e),t,3)}function ZE(e,t){return Kt(e.getMilliseconds(),t,3)}function Bz(e,t){return ZE(e,t)+"000"}function Fz(e,t){return Kt(e.getMonth()+1,t,2)}function Cz(e,t){return Kt(e.getMinutes(),t,2)}function Lz(e,t){return Kt(e.getSeconds(),t,2)}function kz(e){var t=e.getDay();return t===0?7:t}function Rz(e,t){return Kt(Dr.count(Cn(e)-1,e),t,2)}function KE(e){var t=e.getDay();return t>=4||t===0?fo(e):fo.ceil(e)}function $z(e,t){return e=KE(e),Kt(fo.count(Cn(e),e)+(Cn(e).getDay()===4),t,2)}function Pz(e){return e.getDay()}function Uz(e,t){return Kt(Sa.count(Cn(e)-1,e),t,2)}function zz(e,t){return Kt(e.getFullYear()%100,t,2)}function qz(e,t){return e=KE(e),Kt(e.getFullYear()%100,t,2)}function Vz(e,t){return Kt(e.getFullYear()%1e4,t,4)}function jz(e,t){var n=e.getDay();return e=n>=4||n===0?fo(e):fo.ceil(e),Kt(e.getFullYear()%1e4,t,4)}function Yz(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Kt(t/60|0,"0",2)+Kt(t%60,"0",2)}function WE(e,t){return Kt(e.getUTCDate(),t,2)}function Wz(e,t){return Kt(e.getUTCHours(),t,2)}function Gz(e,t){return Kt(e.getUTCHours()%12||12,t,2)}function Xz(e,t){return Kt(1+Gc.count(Ln(e),e),t,3)}function QE(e,t){return Kt(e.getUTCMilliseconds(),t,3)}function Hz(e,t){return QE(e,t)+"000"}function Zz(e,t){return Kt(e.getUTCMonth()+1,t,2)}function Kz(e,t){return Kt(e.getUTCMinutes(),t,2)}function Qz(e,t){return Kt(e.getUTCSeconds(),t,2)}function Jz(e){var t=e.getUTCDay();return t===0?7:t}function tq(e,t){return Kt(Nr.count(Ln(e)-1,e),t,2)}function JE(e){var t=e.getUTCDay();return t>=4||t===0?ho(e):ho.ceil(e)}function eq(e,t){return e=JE(e),Kt(ho.count(Ln(e),e)+(Ln(e).getUTCDay()===4),t,2)}function nq(e){return e.getUTCDay()}function rq(e,t){return Kt(Ia.count(Ln(e)-1,e),t,2)}function iq(e,t){return Kt(e.getUTCFullYear()%100,t,2)}function oq(e,t){return e=JE(e),Kt(e.getUTCFullYear()%100,t,2)}function sq(e,t){return Kt(e.getUTCFullYear()%1e4,t,4)}function aq(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ho(e):ho.ceil(e),Kt(e.getUTCFullYear()%1e4,t,4)}function cq(){return"+0000"}function GE(){return"%"}function XE(e){return+e}function HE(e){return Math.floor(+e/1e3)}var Nu,Ou,tD,po,eD;cS({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 cS(e){return Nu=aS(e),Ou=Nu.format,tD=Nu.parse,po=Nu.utcFormat,eD=Nu.utcParse,Nu}function lq(e){return new Date(e)}function uq(e){return e instanceof Date?+e:+new Date(+e)}function mb(e,t,n,r,i,o,s,a,c,l){var u=ip(),f=u.invert,h=u.domain,d=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),y=l("%a %d"),b=l("%b %d"),x=l("%B"),w=l("%Y");function v(_){return(c(_)<_?d:a(_)<_?p:s(_)<_?m:o(_)<_?g:r(_)<_?i(_)<_?y:b:n(_)<_?x:w)(_)}return u.invert=function(_){return new Date(f(_))},u.domain=function(_){return arguments.length?h(Array.from(_,uq)):h().map(lq)},u.ticks=function(_){var M=h();return e(M[0],M[M.length-1],_??10)},u.tickFormat=function(_,M){return M==null?v:l(M)},u.nice=function(_){var M=h();return(!_||typeof _.range!="function")&&(_=t(M[0],M[M.length-1],_??10)),_?h(sp(M,_)):u},u.copy=function(){return lo(u,mb(e,t,n,r,i,o,s,a,c,l))},u}function yb(){return We.apply(mb(rS,iS,Cn,_s,Dr,Zr,xs,gs,rn,Ou).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function gb(){return We.apply(mb(nS,pp,Ln,vs,Nr,Gc,ws,bs,rn,po).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function bp(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function bb(){var e=0,t=.5,n=1,r=1,i,o,s,a,c,l=hr,u,f=!1,h;function d(m){return isNaN(m=+m)?h:(m=.5+((m=+u(m))-o)*(r*m<r*o?a:c),l(f?Math.max(0,Math.min(1,m)):m))}d.domain=function(m){return arguments.length?([e,t,n]=m,i=u(e=+e),o=u(t=+t),s=u(n=+n),a=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,d):[e,t,n]},d.clamp=function(m){return arguments.length?(f=!!m,d):f},d.interpolator=function(m){return arguments.length?(l=m,d):l};function p(m){return function(g){var y,b,x;return arguments.length?([y,b,x]=g,l=to(m,[y,b,x]),d):[l(0),l(.5),l(1)]}}return d.range=p(Tr),d.rangeRound=p(Oc),d.unknown=function(m){return arguments.length?(h=m,d):h},function(m){return u=m,i=m(e),o=m(t),s=m(n),a=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,d}}function xp(){var e=ms(bb()(hr));return e.copy=function(){return bp(e,xp())},np.apply(e,arguments)}function xb(){var e=K2(bb()).domain([.1,1,10]);return e.copy=function(){return bp(e,xb()).base(e.base())},np.apply(e,arguments)}function wb(){var e=Q2(bb());return e.copy=function(){return bp(e,wb()).constant(e.constant())},np.apply(e,arguments)}function _b(){var e=J2(bb());return e.copy=function(){return bp(e,_b()).exponent(e.exponent())},np.apply(e,arguments)}function Y(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}var lS=Y("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var uS=Y("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");var fS=Y("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");var hS=Y("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");var dS=Y("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");var pS=Y("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");var mS=Y("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");var yS=Y("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");var gS=Y("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var bS=Y("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var ht=e=>pv(e[e.length-1]);var vb=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Y),Sb=ht(vb);var Ib=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Y),Mb=ht(Ib);var Ab=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Y),Tb=ht(Ab);var Eb=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Y),Db=ht(Eb);var wp=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Y),Bu=ht(wp);var Nb=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Y),Ob=ht(Nb);var _p=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Y),Fu=ht(_p);var Bb=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Y),Fb=ht(Bb);var Cb=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Y),Lb=ht(Cb);var kb=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Y),Rb=ht(kb);var $b=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Y),Pb=ht($b);var Ub=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Y),zb=ht(Ub);var qb=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Y),Vb=ht(qb);var jb=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Y),Yb=ht(jb);var Wb=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Y),Gb=ht(Wb);var Xb=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Y),Hb=ht(Xb);var Zb=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Y),Kb=ht(Zb);var Qb=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Y),Jb=ht(Qb);var tx=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Y),ex=ht(tx);var nx=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Y),rx=ht(nx);var ix=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Y),ox=ht(ix);var sx=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Y),ax=ht(sx);var cx=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Y),lx=ht(cx);var ux=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Y),fx=ht(ux);var hx=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Y),dx=ht(hx);var px=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Y),mx=ht(px);var yx=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Y),gx=ht(yx);function bx(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}var xx=au(Yn(300,.5,0),Yn(-240,.5,1));var _x=au(Yn(-100,.75,.35),Yn(80,1.5,.8)),vx=au(Yn(260,.75,.35),Yn(80,1.5,.8)),wx=Yn();function Sx(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return wx.h=360*e-100,wx.s=1.5-1.5*t,wx.l=.8-.9*t,wx+""}var Ix=Je(),fq=Math.PI/3,hq=Math.PI*2/3;function Mx(e){var t;return e=(.5-e)*Math.PI,Ix.r=255*(t=Math.sin(e))*t,Ix.g=255*(t=Math.sin(e+fq))*t,Ix.b=255*(t=Math.sin(e+hq))*t,Ix+""}function Ax(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function Tx(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var Ex=Tx(Y("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Dx=Tx(Y("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Nx=Tx(Y("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Ox=Tx(Y("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Ge(e){return function(){return e}}var xS=Math.cos;var Cu=Math.min,vp=Math.sin,Qt=Math.sqrt,wS=1e-12,Kc=Math.PI,LIt=Kc/2,Lu=2*Kc;function Bx(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new ya(t)}var PIt=Array.prototype.slice;function Fx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nD(e){this._context=e}nD.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ss(e){return new nD(e)}function Cx(e){return e[0]}function Lx(e){return e[1]}function Sp(e,t){var n=Ge(!0),r=null,i=Ss,o=null,s=Bx(a);e=typeof e=="function"?e:e===void 0?Cx:Ge(e),t=typeof t=="function"?t:t===void 0?Lx:Ge(t);function a(c){var l,u=(c=Fx(c)).length,f,h=!1,d;for(r==null&&(o=i(d=s())),l=0;l<=u;++l)!(l<u&&n(f=c[l],l,c))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(f,l,c),+t(f,l,c));if(d)return o=null,d+""||null}return a.x=function(c){return arguments.length?(e=typeof c=="function"?c:Ge(+c),a):e},a.y=function(c){return arguments.length?(t=typeof c=="function"?c:Ge(+c),a):t},a.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Ge(!!c),a):n},a.curve=function(c){return arguments.length?(i=c,r!=null&&(o=i(r)),a):i},a.context=function(c){return arguments.length?(c==null?r=o=null:o=i(r=c),a):r},a}function ku(e,t,n){var r=null,i=Ge(!0),o=null,s=Ss,a=null,c=Bx(l);e=typeof e=="function"?e:e===void 0?Cx:Ge(+e),t=typeof t=="function"?t:t===void 0?Ge(0):Ge(+t),n=typeof n=="function"?n:n===void 0?Lx:Ge(+n);function l(f){var h,d,p,m=(f=Fx(f)).length,g,y=!1,b,x=new Array(m),w=new Array(m);for(o==null&&(a=s(b=c())),h=0;h<=m;++h){if(!(h<m&&i(g=f[h],h,f))===y)if(y=!y)d=h,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=h-1;p>=d;--p)a.point(x[p],w[p]);a.lineEnd(),a.areaEnd()}y&&(x[h]=+e(g,h,f),w[h]=+t(g,h,f),a.point(r?+r(g,h,f):x[h],n?+n(g,h,f):w[h]))}if(b)return a=null,b+""||null}function u(){return Sp().defined(i).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ge(+f),r=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Ge(+f),l):e},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Ge(+f),l):r},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ge(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Ge(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Ge(+f),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Ge(!!f),l):i},l.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),l):s},l.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),l):o},l}var kx=class{constructor(t,n){this._context=t,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(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}};function _S(e){return new kx(e,!0)}function vS(e){return new kx(e,!1)}var dq=Qt(3),Ip={draw(e,t){let n=Qt(t+Cu(t/28,.75))*.59436,r=n/2,i=r*dq;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}};var Is={draw(e,t){let n=Qt(t/Kc);e.moveTo(n,0),e.arc(0,0,n,0,Lu)}};var Mp={draw(e,t){let n=Qt(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}};var rD=Qt(1/3),pq=rD*2,Ap={draw(e,t){let n=Qt(t/pq),r=n*rD;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}};var Tp={draw(e,t){let n=Qt(t)*.62625;e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}};var Ep={draw(e,t){let n=Qt(t-Cu(t/7,2))*.87559;e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}};var Dp={draw(e,t){let n=Qt(t),r=-n/2;e.rect(r,r,n,n)}};var Np={draw(e,t){let n=Qt(t)*.4431;e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}};var mq=.8908130915292852,iD=vp(Kc/10)/vp(7*Kc/10),yq=vp(Lu/10)*iD,gq=-xS(Lu/10)*iD,Op={draw(e,t){let n=Qt(t*mq),r=yq*n,i=gq*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){let s=Lu*o/5,a=xS(s),c=vp(s);e.lineTo(c*n,-a*n),e.lineTo(a*r-c*i,c*r+a*i)}e.closePath()}};var SS=Qt(3),Bp={draw(e,t){let n=-Qt(t/(SS*3));e.moveTo(0,n*2),e.lineTo(-SS*n,-n),e.lineTo(SS*n,-n),e.closePath()}};var bq=Qt(3),Fp={draw(e,t){let n=Qt(t)*.6824,r=n/2,i=n*bq/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}};var Kr=-.5,Qr=Qt(3)/2,IS=1/Qt(12),xq=(IS/2+1)*3,Cp={draw(e,t){let n=Qt(t/xq),r=n/2,i=n*IS,o=r,s=n*IS+n,a=-o,c=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(a,c),e.lineTo(Kr*r-Qr*i,Qr*r+Kr*i),e.lineTo(Kr*o-Qr*s,Qr*o+Kr*s),e.lineTo(Kr*a-Qr*c,Qr*a+Kr*c),e.lineTo(Kr*r+Qr*i,Kr*i-Qr*r),e.lineTo(Kr*o+Qr*s,Kr*s-Qr*o),e.lineTo(Kr*a+Qr*c,Kr*c-Qr*a),e.closePath()}};var Ru={draw(e,t){let n=Qt(t-Cu(t/6,1.7))*.6189;e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}};var Rx=[Is,Mp,Ap,Dp,Op,Bp,Cp],MS=[Is,Ep,Ru,Fp,Ip,Np,Tp];function Jr(){}function $u(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Lp(e){this._context=e}Lp.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:$u(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:$u(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AS(e){return new Lp(e)}function oD(e){this._context=e}oD.prototype={areaStart:Jr,areaEnd:Jr,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:$u(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function TS(e){return new oD(e)}function sD(e){this._context=e}sD.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(e,t){switch(e=+e,t=+t,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+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:$u(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ES(e){return new sD(e)}function aD(e,t){this._basis=new Lp(e),this._beta=t}aD.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],o=e[n]-r,s=t[n]-i,a=-1,c;++a<=n;)c=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(r+c*o),this._beta*t[a]+(1-this._beta)*(i+c*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var DS=function e(t){function n(r){return t===1?new Lp(r):new aD(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Pu(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function $x(e,t){this._context=e,this._k=(1-t)/6}$x.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:Pu(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Pu(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var NS=function e(t){function n(r){return new $x(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Px(e,t){this._context=e,this._k=(1-t)/6}Px.prototype={areaStart:Jr,areaEnd:Jr,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Pu(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var OS=function e(t){function n(r){return new Px(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ux(e,t){this._context=e,this._k=(1-t)/6}Ux.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(e,t){switch(e=+e,t=+t,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:Pu(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var BS=function e(t){function n(r){return new Ux(r,t)}return n.tension=function(r){return e(+r)},n}(0);function kp(e,t,n){var r=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>wS){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>wS){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,s,e._x2,e._y2)}function cD(e,t){this._context=e,this._alpha=t}cD.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;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(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:kp(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var FS=function e(t){function n(r){return t?new cD(r,t):new $x(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function lD(e,t){this._context=e,this._alpha=t}lD.prototype={areaStart:Jr,areaEnd:Jr,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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;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=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:kp(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var CS=function e(t){function n(r){return t?new lD(r,t):new Px(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function uD(e,t){this._context=e,this._alpha=t}uD.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;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:kp(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var LS=function e(t){function n(r){return t?new uD(r,t):new Ux(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function fD(e){this._context=e}fD.prototype={areaStart:Jr,areaEnd:Jr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function kS(e){return new fD(e)}function hD(e){return e<0?-1:1}function dD(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(hD(o)+hD(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function pD(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function RS(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function zx(e){this._context=e}zx.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:RS(this,this._t0,pD(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,RS(this,pD(this,n=dD(this,e,t)),n);break;default:RS(this,this._t0,n=dD(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function mD(e){this._context=new yD(e)}(mD.prototype=Object.create(zx.prototype)).point=function(e,t){zx.prototype.point.call(this,t,e)};function yD(e){this._context=e}yD.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function $S(e){return new zx(e)}function PS(e){return new mD(e)}function bD(e){this._context=e}bD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=gD(e),i=gD(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function gD(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),s=new Array(n);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function US(e){return new bD(e)}function qx(e,t){this._context=e,this._t=t}qx.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function zS(e){return new qx(e,.5)}function qS(e){return new qx(e,0)}function VS(e){return new qx(e,1)}var Rp=e=>()=>e;function jS(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Or(e,t,n){this.k=e,this.x=t,this.y=n}Or.prototype={constructor:Or,scale:function(e){return e===1?this:new Or(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Or(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var $p=new Or(1,0,0);YS.prototype=Or.prototype;function YS(e){for(;!e.__zoom;)if(!(e=e.parentNode))return $p;return e.__zoom}function Vx(e){e.stopImmediatePropagation()}function Uu(e){e.preventDefault(),e.stopImmediatePropagation()}function wq(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function _q(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function xD(){return this.__zoom||$p}function vq(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Sq(){return navigator.maxTouchPoints||"ontouchstart"in this}function Iq(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function WS(){var e=wq,t=_q,n=Iq,r=vq,i=Sq,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=wv,l=Mc("start","zoom","end"),u,f,h,d=500,p=150,m=0,g=10;function y(S){S.property("__zoom",xD).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",T).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(S,A,D,C){var k=S.selection?S.selection():S;k.property("__zoom",xD),S!==k?v(S,A,D,C):k.interrupt().each(function(){_(this,arguments).event(C).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},y.scaleBy=function(S,A,D,C){y.scaleTo(S,function(){var k=this.__zoom.k,L=typeof A=="function"?A.apply(this,arguments):A;return k*L},D,C)},y.scaleTo=function(S,A,D,C){y.transform(S,function(){var k=t.apply(this,arguments),L=this.__zoom,R=D==null?w(k):typeof D=="function"?D.apply(this,arguments):D,$=L.invert(R),P=typeof A=="function"?A.apply(this,arguments):A;return n(x(b(L,P),R,$),k,s)},D,C)},y.translateBy=function(S,A,D,C){y.transform(S,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),s)},null,C)},y.translateTo=function(S,A,D,C,k){y.transform(S,function(){var L=t.apply(this,arguments),R=this.__zoom,$=C==null?w(L):typeof C=="function"?C.apply(this,arguments):C;return n($p.translate($[0],$[1]).scale(R.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof D=="function"?-D.apply(this,arguments):-D),L,s)},C,k)};function b(S,A){return A=Math.max(o[0],Math.min(o[1],A)),A===S.k?S:new Or(A,S.x,S.y)}function x(S,A,D){var C=A[0]-D[0]*S.k,k=A[1]-D[1]*S.k;return C===S.x&&k===S.y?S:new Or(S.k,C,k)}function w(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function v(S,A,D,C){S.on("start.zoom",function(){_(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(C).end()}).tween("zoom",function(){var k=this,L=arguments,R=_(k,L).event(C),$=t.apply(k,L),P=D==null?w($):typeof D=="function"?D.apply(k,L):D,G=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),J=k.__zoom,et=typeof A=="function"?A.apply(k,L):A,ot=c(J.invert(P).concat(G/J.k),et.invert(P).concat(G/et.k));return function(j){if(j===1)j=et;else{var nt=ot(j),z=G/nt[2];j=new Or(z,P[0]-nt[0]*z,P[1]-nt[1]*z)}R.zoom(null,j)}})}function _(S,A,D){return!D&&S.__zooming||new M(S,A)}function M(S,A){this.that=S,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,A),this.taps=0}M.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,A){return this.mouse&&S!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var A=Pt(this.that).datum();l.call(S,this.that,new jS(S,{sourceEvent:this.sourceEvent,target:y,type:S,transform:this.that.__zoom,dispatch:l}),A)}};function E(S,...A){if(!e.apply(this,arguments))return;var D=_(this,A).event(S),C=this.__zoom,k=Math.max(o[0],Math.min(o[1],C.k*Math.pow(2,r.apply(this,arguments)))),L=Dn(S);if(D.wheel)(D.mouse[0][0]!==L[0]||D.mouse[0][1]!==L[1])&&(D.mouse[1]=C.invert(D.mouse[0]=L)),clearTimeout(D.wheel);else{if(C.k===k)return;D.mouse=[L,C.invert(L)],eo(this),D.start()}Uu(S),D.wheel=setTimeout(R,p),D.zoom("mouse",n(x(b(C,k),D.mouse[0],D.mouse[1]),D.extent,s));function R(){D.wheel=null,D.end()}}function N(S,...A){if(h||!e.apply(this,arguments))return;var D=S.currentTarget,C=_(this,A,!0).event(S),k=Pt(S.view).on("mousemove.zoom",P,!0).on("mouseup.zoom",G,!0),L=Dn(S,D),R=S.clientX,$=S.clientY;pd(S.view),Vx(S),C.mouse=[L,this.__zoom.invert(L)],eo(this),C.start();function P(J){if(Uu(J),!C.moved){var et=J.clientX-R,ot=J.clientY-$;C.moved=et*et+ot*ot>m}C.event(J).zoom("mouse",n(x(C.that.__zoom,C.mouse[0]=Dn(J,D),C.mouse[1]),C.extent,s))}function G(J){k.on("mousemove.zoom mouseup.zoom",null),md(J.view,C.moved),Uu(J),C.event(J).end()}}function I(S,...A){if(e.apply(this,arguments)){var D=this.__zoom,C=Dn(S.changedTouches?S.changedTouches[0]:S,this),k=D.invert(C),L=D.k*(S.shiftKey?.5:2),R=n(x(b(D,L),C,k),t.apply(this,A),s);Uu(S),a>0?Pt(this).transition().duration(a).call(v,R,C,S):Pt(this).call(y.transform,R,C,S)}}function T(S,...A){if(e.apply(this,arguments)){var D=S.touches,C=D.length,k=_(this,A,S.changedTouches.length===C).event(S),L,R,$,P;for(Vx(S),R=0;R<C;++R)$=D[R],P=Dn($,this),P=[P,this.__zoom.invert(P),$.identifier],k.touch0?!k.touch1&&k.touch0[2]!==P[2]&&(k.touch1=P,k.taps=0):(k.touch0=P,L=!0,k.taps=1+!!u);u&&(u=clearTimeout(u)),L&&(k.taps<2&&(f=P[0],u=setTimeout(function(){u=null},d)),eo(this),k.start())}}function O(S,...A){if(this.__zooming){var D=_(this,A).event(S),C=S.changedTouches,k=C.length,L,R,$,P;for(Uu(S),L=0;L<k;++L)R=C[L],$=Dn(R,this),D.touch0&&D.touch0[2]===R.identifier?D.touch0[0]=$:D.touch1&&D.touch1[2]===R.identifier&&(D.touch1[0]=$);if(R=D.that.__zoom,D.touch1){var G=D.touch0[0],J=D.touch0[1],et=D.touch1[0],ot=D.touch1[1],j=(j=et[0]-G[0])*j+(j=et[1]-G[1])*j,nt=(nt=ot[0]-J[0])*nt+(nt=ot[1]-J[1])*nt;R=b(R,Math.sqrt(j/nt)),$=[(G[0]+et[0])/2,(G[1]+et[1])/2],P=[(J[0]+ot[0])/2,(J[1]+ot[1])/2]}else if(D.touch0)$=D.touch0[0],P=D.touch0[1];else return;D.zoom("touch",n(x(R,$,P),D.extent,s))}}function B(S,...A){if(this.__zooming){var D=_(this,A).event(S),C=S.changedTouches,k=C.length,L,R;for(Vx(S),h&&clearTimeout(h),h=setTimeout(function(){h=null},d),L=0;L<k;++L)R=C[L],D.touch0&&D.touch0[2]===R.identifier?delete D.touch0:D.touch1&&D.touch1[2]===R.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(R=Dn(R,this),Math.hypot(f[0]-R[0],f[1]-R[1])<g)){var $=Pt(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return y.wheelDelta=function(S){return arguments.length?(r=typeof S=="function"?S:Rp(+S),y):r},y.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Rp(!!S),y):e},y.touchable=function(S){return arguments.length?(i=typeof S=="function"?S:Rp(!!S),y):i},y.extent=function(S){return arguments.length?(t=typeof S=="function"?S:Rp([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),y):t},y.scaleExtent=function(S){return arguments.length?(o[0]=+S[0],o[1]=+S[1],y):[o[0],o[1]]},y.translateExtent=function(S){return arguments.length?(s[0][0]=+S[0][0],s[1][0]=+S[1][0],s[0][1]=+S[0][1],s[1][1]=+S[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(S){return arguments.length?(n=S,y):n},y.duration=function(S){return arguments.length?(a=+S,y):a},y.interpolate=function(S){return arguments.length?(c=S,y):c},y.on=function(){var S=l.on.apply(l,arguments);return S===l?y:S},y.clickDistance=function(S){return arguments.length?(m=(S=+S)*S,y):Math.sqrt(m)},y.tapDistance=function(S){return arguments.length?(g=+S,y):g},y}function Re(e){return e!=null&&!Number.isNaN(e)}function sn(e,t){return+Re(t)-+Re(e)||$t(e,t)}function Qc(e,t){return+Re(t)-+Re(e)||zn(e,t)}function Pp(e){return e!=null&&`${e}`!=""}function zu(e){return isFinite(e)?e:NaN}function Qn(e){return e>0&&isFinite(e)?e:NaN}function Ma(e){return e<0&&isFinite(e)?e:NaN}function jx(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return typeof t=="function"?t(e):t;let n=e.getUTCHours(),r=e.getUTCMinutes(),i=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${Mq(e.getUTCFullYear(),4)}-${Ms(e.getUTCMonth()+1,2)}-${Ms(e.getUTCDate(),2)}${n||r||i||o?`T${Ms(n,2)}:${Ms(r,2)}${i||o?`:${Ms(i,2)}${o?`.${Ms(o,3)}`:""}`:""}Z`:""}`}function Mq(e){return e<0?`-${Ms(-e,6)}`:e>9999?`+${Ms(e,6)}`:Ms(e,4)}function Ms(e,t){return`${e}`.padStart(t,"0")}var Aq=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function Up(e,t){return Aq.test(e+="")?new Date(e):typeof t=="function"?t(e):t}var Vu=1e3,Ta=Vu*60,Ea=Ta*60,yo=Ea*24,mo=yo*7,Jc=yo*30,Aa=yo*365,GS=[["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",Vu],["5 seconds",5*Vu],["15 seconds",15*Vu],["30 seconds",30*Vu],["minute",Ta],["5 minutes",5*Ta],["15 minutes",15*Ta],["30 minutes",30*Ta],["hour",Ea],["3 hours",3*Ea],["6 hours",6*Ea],["12 hours",12*Ea],["day",yo],["2 days",2*yo],["week",mo],["2 weeks",2*mo],["month",Jc],["3 months",3*Jc],["6 months",6*Jc],["year",Aa],["2 years",2*Aa],["5 years",5*Aa],["10 years",10*Aa],["20 years",20*Aa],["50 years",50*Aa],["100 years",100*Aa]],XS=new Map([["second",Vu],["minute",Ta],["hour",Ea],["day",yo],["monday",mo],["tuesday",mo],["wednesday",mo],["thursday",mo],["friday",mo],["saturday",mo],["sunday",mo],["week",mo],["month",Jc],["year",Aa]]),_D=new Map([["second",rn],["minute",gs],["hour",xs],["day",Zr],["monday",Sa],["tuesday",ab],["wednesday",cb],["thursday",fo],["friday",lb],["saturday",ub],["sunday",Dr],["week",Dr],["month",_s],["year",Cn]]),HS=new Map([["second",rn],["minute",bs],["hour",ws],["day",Xc],["monday",Ia],["tuesday",fb],["wednesday",hb],["thursday",ho],["friday",db],["saturday",pb],["sunday",Nr],["week",Nr],["month",vs],["year",Ln]]),ju=Symbol("intervalDuration"),Wx=Symbol("intervalType");for(let[e,t]of _D)t[ju]=XS.get(e),t[Wx]="time";for(let[e,t]of HS)t[ju]=XS.get(e),t[Wx]="utc";var zp=[["year",Ln,"utc"],["month",vs,"utc"],["day",Xc,"utc",6*Jc],["hour",ws,"utc",3*yo],["minute",bs,"utc",6*Ea],["second",rn,"utc",30*Ta]],Yx=[["year",Cn,"time"],["month",_s,"time"],["day",Zr,"time",6*Jc],["hour",xs,"time",3*yo],["minute",gs,"time",6*Ea],["second",rn,"time",30*Ta]],Tq=[zp[0],Yx[0],zp[1],Yx[1],zp[2],Yx[2],...zp.slice(3)];function Gx(e){let t=`${e}`.toLowerCase();t.endsWith("s")&&(t=t.slice(0,-1));let n=1,r=/^(?:(\d+)\s+)/.exec(t);switch(r&&(t=t.slice(r[0].length),n=+r[1]),t){case"quarter":t="month",n*=3;break;case"half":t="month",n*=6;break}let i=HS.get(t);if(!i)throw new Error(`unknown interval: ${e}`);if(n>1&&!i.every)throw new Error(`non-periodic interval: ${t}`);return[t,n]}function ZS(e){return vD(Gx(e),"time")}function qp(e){return vD(Gx(e),"utc")}function vD([e,t],n){let r=(n==="time"?_D:HS).get(e);return t>1&&(r=r.every(t),r[ju]=XS.get(e)*t,r[Wx]=n),r}function KS(e,t){if(!(t>1))return;let n=e[ju];if(!GS.some(([,i])=>i===n)||n%yo===0&&yo<n&&n<Jc)return;let[r]=GS[rs(([,i])=>Math.log(i)).center(GS,Math.log(n*t))];return(e[Wx]==="time"?ZS:qp)(r)}function wD(e,t,n){let r=t==="time"?Ou:po;if(n==null)return r(e==="year"?"%Y":e==="month"?"%Y-%m":e==="day"?"%Y-%m-%d":e==="hour"||e==="minute"?"%Y-%m-%dT%H:%M":e==="second"?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M:%S.%L");let i=Eq(n);switch(e){case"millisecond":return qu(r(".%L"),r(":%M:%S"),i);case"second":return qu(r(":%S"),r("%-I:%M"),i);case"minute":return qu(r("%-I:%M"),r("%p"),i);case"hour":return qu(r("%-I %p"),r("%b %-d"),i);case"day":return qu(r("%-d"),r("%b"),i);case"month":return qu(r("%b"),r("%Y"),i);case"year":return r("%Y")}throw new Error("unable to format time ticks")}function Eq(e){return e==="left"||e==="right"?(t,n)=>`
|
|
10
|
+
]`}concat(...t){let n=this.schema,r=this.data.concat(t.flatMap(({data:i})=>i));return new e(n,r.map(i=>new Be(n,i)))}slice(t,n){let r=this.schema;[t,n]=lh({length:this.numRows},t,n);let i=Oy(this.data,this._offsets,t,n);return new e(r,i.map(o=>new Be(r,o)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(n=>n.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){let n=this.data.map(r=>r.children[t]);if(n.length===0){let{type:r}=this.schema.fields[t],i=At({type:r,length:0,nullCount:0});n.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new qt(n)}return null}setChild(t,n){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===t),n)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&t<this.numCols){n||(n=new qt([At({type:new qn,length:this.numRows})]));let o=r.fields.slice(),s=o[t].clone({type:n.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[o[t],a[t]]=[s,n],[r,i]=s0(r,a)}return new e(r,i)}select(t){let n=this.schema.fields.reduce((r,i,o)=>r.set(i.name,o),new Map);return this.selectAt(t.map(r=>n.get(r)).filter(r=>r>-1))}selectAt(t){let n=this.schema.selectAt(t),r=this.batches.map(i=>i.selectAt(t));return new e(n,r)}assign(t){let n=this.schema.fields,[r,i]=t.schema.fields.reduce((a,c,l)=>{let[u,f]=a,h=n.findIndex(d=>d.name===c.name);return~h?f[h]=l:u.push(l),a},[[],[]]),o=this.schema.assign(t.schema),s=[...n.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...r.map(a=>t.getChildAt(a))].filter(Boolean);return new e(...s0(o,s))}};X6=Symbol.toStringTag;lr[X6]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=Bl(hh),e.get=Bl(qe.getVisitFn(O.Struct)),e.set=Ly(bn.getVisitFn(O.Struct)),e.indexOf=Fy(ec.getVisitFn(O.Struct)),"Table"))(lr.prototype);var Z6,Be=class e{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof ne))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=At({nullCount:0,type:new ye(this.schema.fields),children:this.schema.fields.map(n=>At({type:n.type,nullCount:0}))})]=t,!(this.data instanceof Kt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=H6(this.schema,this.data.children);break}case 1:{let[n]=t,{fields:r,children:i,length:o}=Object.keys(n).reduce((c,l,u)=>(c.children[u]=n[l],c.length=Math.max(c.length,n[l].length),c.fields[u]=Rt.new({name:l,type:n[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),s=new ne(r),a=At({type:new ye(r),length:o,children:i,nullCount:0});[this.schema,this.data]=H6(s,a.children,o);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=K6(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return qe.visit(this.data,t)}set(t,n){return bn.visit(this.data,t,n)}indexOf(t,n){return ec.visit(this.data,t,n)}[Symbol.iterator](){return Ol.visit(new qt([this.data]))}toArray(){return[...this]}concat(...t){return new lr(this.schema,[this,...t])}slice(t,n){let[r]=new qt([this.data]).slice(t,n).data;return new e(this.schema,r)}getChild(t){var n;return this.getChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new qt([this.data.children[t]]):null}setChild(t,n){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===t),n)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&t<this.numCols){n||(n=new qt([At({type:new qn,length:this.numRows})]));let o=r.fields.slice(),s=i.children.slice(),a=o[t].clone({type:n.type});[o[t],s[t]]=[a,n.data[0]],r=new ne(o,new Map(this.schema.metadata)),i=At({type:new ye(o),children:s})}return new e(r,i)}select(t){let n=this.schema.select(t),r=new ye(n.fields),i=[];for(let o of t){let s=this.schema.fields.findIndex(a=>a.name===o);~s&&(i[s]=this.data.children[s])}return new e(n,At({type:r,length:this.numRows,children:i}))}selectAt(t){let n=this.schema.selectAt(t),r=t.map(o=>this.data.children[o]).filter(Boolean),i=At({type:new ye(n.fields),length:this.numRows,children:r});return new e(n,i)}};Z6=Symbol.toStringTag;Be[Z6]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(Be.prototype);function H6(e,t,n=t.reduce((r,i)=>Math.max(r,i.length),0)){var r;let i=[...e.fields],o=[...t],s=(n+63&-64)>>3;for(let[a,c]of e.fields.entries()){let l=t[a];(!l||l.length!==n)&&(i[a]=c.clone({nullable:!0}),o[a]=(r=l?._changeLengthAndBackfillNullBitmap(n))!==null&&r!==void 0?r:At({type:c.type,length:n,nullCount:n,nullBitmap:new Uint8Array(s)}))}return[e.assign(i),At({type:new ye(i),length:n,children:o})]}function K6(e,t,n=new Map){var r,i;if(((r=e?.length)!==null&&r!==void 0?r:0)>0&&e?.length===t?.length)for(let o=-1,s=e.length;++o<s;){let{type:a}=e[o],c=t[o];for(let l of[c,...((i=c?.dictionary)===null||i===void 0?void 0:i.data)||[]])K6(a.children,l?.children,n);if(ot.isDictionary(a)){let{id:l}=a;if(!n.has(l))c?.dictionary&&n.set(l,c.dictionary);else if(n.get(l)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return n}var uc=class extends Be{constructor(t){let n=t.fields.map(i=>At({type:i.type})),r=At({type:new ye(t.fields),nullCount:0,children:n});super(t,r)}};var wi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsMessage(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):oe.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):Ut.NONE}header(t){let n=this.bb.__offset(this.bb_pos,8);return n?this.bb.__union(t,this.bb_pos+n):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new tn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,n){t.addFieldInt16(0,n,oe.V1)}static addHeaderType(t,n){t.addFieldInt8(1,n,Ut.NONE)}static addHeader(t,n){t.addFieldOffset(2,n,0)}static addBodyLength(t,n){t.addFieldInt64(3,n,BigInt("0"))}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,n){t.finish(n)}static finishSizePrefixedMessageBuffer(t,n){t.finish(n,void 0,!0)}static createMessage(t,n,r,i,o,s){return e.startMessage(t),e.addVersion(t,n),e.addHeaderType(t,r),e.addHeader(t,i),e.addBodyLength(t,o),e.addCustomMetadata(t,s),e.endMessage(t)}};var y_=class extends dt{visit(t,n){return t==null||n==null?void 0:super.visit(t,n)}visitNull(t,n){return rh.startNull(n),rh.endNull(n)}visitInt(t,n){return ci.startInt(n),ci.addBitWidth(n,t.bitWidth),ci.addIsSigned(n,t.isSigned),ci.endInt(n)}visitFloat(t,n){return Zs.startFloatingPoint(n),Zs.addPrecision(n,t.precision),Zs.endFloatingPoint(n)}visitBinary(t,n){return Qf.startBinary(n),Qf.endBinary(n)}visitLargeBinary(t,n){return th.startLargeBinary(n),th.endLargeBinary(n)}visitBool(t,n){return Jf.startBool(n),Jf.endBool(n)}visitUtf8(t,n){return oh.startUtf8(n),oh.endUtf8(n)}visitLargeUtf8(t,n){return eh.startLargeUtf8(n),eh.endLargeUtf8(n)}visitDecimal(t,n){return zi.startDecimal(n),zi.addScale(n,t.scale),zi.addPrecision(n,t.precision),zi.addBitWidth(n,t.bitWidth),zi.endDecimal(n)}visitDate(t,n){return Ws.startDate(n),Ws.addUnit(n,t.unit),Ws.endDate(n)}visitTime(t,n){return Oo.startTime(n),Oo.addUnit(n,t.unit),Oo.addBitWidth(n,t.bitWidth),Oo.endTime(n)}visitTimestamp(t,n){let r=t.timezone&&n.createString(t.timezone)||void 0;return Lo.startTimestamp(n),Lo.addUnit(n,t.unit),r!==void 0&&Lo.addTimezone(n,r),Lo.endTimestamp(n)}visitInterval(t,n){return Ks.startInterval(n),Ks.addUnit(n,t.unit),Ks.endInterval(n)}visitDuration(t,n){return Gs.startDuration(n),Gs.addUnit(n,t.unit),Gs.endDuration(n)}visitList(t,n){return nh.startList(n),nh.endList(n)}visitStruct(t,n){return ih.startStruct_(n),ih.endStruct_(n)}visitUnion(t,n){li.startTypeIdsVector(n,t.typeIds.length);let r=li.createTypeIdsVector(n,t.typeIds);return li.startUnion(n),li.addMode(n,t.mode),li.addTypeIds(n,r),li.endUnion(n)}visitDictionary(t,n){let r=this.visit(t.indices,n);return Pi.startDictionaryEncoding(n),Pi.addId(n,BigInt(t.id)),Pi.addIsOrdered(n,t.isOrdered),r!==void 0&&Pi.addIndexType(n,r),Pi.endDictionaryEncoding(n)}visitFixedSizeBinary(t,n){return Xs.startFixedSizeBinary(n),Xs.addByteWidth(n,t.byteWidth),Xs.endFixedSizeBinary(n)}visitFixedSizeList(t,n){return Hs.startFixedSizeList(n),Hs.addListSize(n,t.listSize),Hs.endFixedSizeList(n)}visitMap(t,n){return Qs.startMap(n),Qs.addKeysSorted(n,t.keysSorted),Qs.endMap(n)}},a0=new y_;function eA(e,t=new Map){return new ne(ok(e,t),c0(e.metadata),t)}function g_(e){return new xn(e.count,rA(e.columns),iA(e.columns))}function nA(e){return new fr(g_(e.data),e.id,e.isDelta)}function ok(e,t){return(e.fields||[]).filter(Boolean).map(n=>Rt.fromJSON(n,t))}function Q6(e,t){return(e.children||[]).filter(Boolean).map(n=>Rt.fromJSON(n,t))}function rA(e){return(e||[]).reduce((t,n)=>[...t,new Vr(n.count,sk(n.VALIDITY)),...rA(n.children)],[])}function iA(e,t=[]){for(let n=-1,r=(e||[]).length;++n<r;){let i=e[n];i.VALIDITY&&t.push(new ur(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new ur(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new ur(t.length,i.OFFSET.length)),i.DATA&&t.push(new ur(t.length,i.DATA.length)),t=iA(i.children,t)}return t}function sk(e){return(e||[]).reduce((t,n)=>t+ +(n===0),0)}function oA(e,t){let n,r,i,o,s,a;return!t||!(o=e.dictionary)?(s=tA(e,Q6(e,t)),i=new Rt(e.name,s,e.nullable,c0(e.metadata))):t.has(n=o.id)?(r=(r=o.indexType)?J6(r):new qi,a=new vr(t.get(n),r,n,o.isOrdered),i=new Rt(e.name,a,e.nullable,c0(e.metadata))):(r=(r=o.indexType)?J6(r):new qi,t.set(n,s=tA(e,Q6(e,t))),a=new vr(s,r,n,o.isOrdered),i=new Rt(e.name,a,e.nullable,c0(e.metadata))),i||null}function c0(e=[]){return new Map(e.map(({key:t,value:n})=>[t,n]))}function J6(e){return new ke(e.isSigned,e.bitWidth)}function tA(e,t){let n=e.type.name;switch(n){case"NONE":return new qn;case"null":return new qn;case"binary":return new Fo;case"largebinary":return new Co;case"utf8":return new ko;case"largeutf8":return new Ro;case"bool":return new $o;case"list":return new pi((t||[])[0]);case"struct":return new ye(t||[]);case"struct_":return new ye(t||[])}switch(n){case"int":{let r=e.type;return new ke(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=e.type;return new ar(ue[r.precision])}case"decimal":{let r=e.type;return new Uo(r.scale,r.precision,r.bitWidth)}case"date":{let r=e.type;return new Po(ze[r.unit])}case"time":{let r=e.type;return new di(at[r.unit],r.bitWidth)}case"timestamp":{let r=e.type;return new zo(at[r.unit],r.timezone)}case"interval":{let r=e.type;return new qo(rn[r.unit])}case"duration":{let r=e.type;return new Vo(at[r.unit])}case"union":{let r=e.type,[i,...o]=(r.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new mi(pe[s],r.typeIds||[],t||[])}case"fixedsizebinary":{let r=e.type;return new jo(r.byteWidth)}case"fixedsizelist":{let r=e.type;return new yi(r.listSize,(t||[])[0])}case"map":{let r=e.type;return new gi((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var ak=Ka,ck=wr,hr=class e{static fromJSON(t,n){let r=new e(0,oe.V5,n);return r._createHeader=lk(t,n),r}static decode(t){t=new ck(wt(t));let n=wi.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),o=n.headerType(),s=new e(r,i,o);return s._createHeader=uk(n,o),s}static encode(t){let n=new ak,r=-1;return t.isSchema()?r=ne.encode(n,t.header()):t.isRecordBatch()?r=xn.encode(n,t.header()):t.isDictionaryBatch()&&(r=fr.encode(n,t.header())),wi.startMessage(n),wi.addVersion(n,oe.V5),wi.addHeader(n,r),wi.addHeaderType(n,t.headerType),wi.addBodyLength(n,BigInt(t.bodyLength)),wi.finishMessageBuffer(n,wi.endMessage(n)),n.asUint8Array()}static from(t,n=0){if(t instanceof ne)return new e(0,oe.V5,Ut.Schema,t);if(t instanceof xn)return new e(n,oe.V5,Ut.RecordBatch,t);if(t instanceof fr)return new e(n,oe.V5,Ut.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===Ut.Schema}isRecordBatch(){return this.headerType===Ut.RecordBatch}isDictionaryBatch(){return this.headerType===Ut.DictionaryBatch}constructor(t,n,r,i){this._version=n,this._headerType=r,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=Ae(t)}},xn=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,n,r){this._nodes=n,this._buffers=r,this._length=Ae(t)}},fr=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,n,r=!1){this._data=t,this._isDelta=r,this._id=Ae(n)}},ur=class{constructor(t,n){this.offset=Ae(t),this.length=Ae(n)}},Vr=class{constructor(t,n){this.length=Ae(t),this.nullCount=Ae(n)}};function lk(e,t){return()=>{switch(t){case Ut.Schema:return ne.fromJSON(e);case Ut.RecordBatch:return xn.fromJSON(e);case Ut.DictionaryBatch:return fr.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${Ut[t]}, type: ${t} }`)}}function uk(e,t){return()=>{switch(t){case Ut.Schema:return ne.decode(e.header(new sr),new Map,e.version());case Ut.RecordBatch:return xn.decode(e.header(new _r),e.version());case Ut.DictionaryBatch:return fr.decode(e.header(new Bo),e.version())}throw new Error(`Unrecognized Message type: { name: ${Ut[t]}, type: ${t} }`)}}Rt.encode=_k;Rt.decode=xk;Rt.fromJSON=oA;ne.encode=wk;ne.decode=fk;ne.fromJSON=eA;xn.encode=vk;xn.decode=hk;xn.fromJSON=g_;fr.encode=Sk;fr.decode=dk;fr.fromJSON=nA;Vr.encode=Mk;Vr.decode=mk;ur.encode=Ik;ur.decode=pk;function fk(e,t=new Map,n=oe.V5){let r=bk(e,t);return new ne(r,l0(e),t,n)}function hk(e,t=oe.V5){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new xn(e.length(),yk(e),gk(e,t))}function dk(e,t=oe.V5){return new fr(xn.decode(e.data(),t),e.id(),e.isDelta())}function pk(e){return new ur(e.offset(),e.length())}function mk(e){return new Vr(e.length(),e.nullCount())}function yk(e){let t=[];for(let n,r=-1,i=-1,o=e.nodesLength();++r<o;)(n=e.nodes(r))&&(t[++i]=Vr.decode(n));return t}function gk(e,t){let n=[];for(let r,i=-1,o=-1,s=e.buffersLength();++i<s;)(r=e.buffers(i))&&(t<oe.V4&&(r.bb_pos+=8*(i+1)),n[++o]=ur.decode(r));return n}function bk(e,t){let n=[];for(let r,i=-1,o=-1,s=e.fieldsLength();++i<s;)(r=e.fields(i))&&(n[++o]=Rt.decode(r,t));return n}function sA(e,t){let n=[];for(let r,i=-1,o=-1,s=e.childrenLength();++i<s;)(r=e.children(i))&&(n[++o]=Rt.decode(r,t));return n}function xk(e,t){let n,r,i,o,s,a;return!t||!(a=e.dictionary())?(i=cA(e,sA(e,t)),r=new Rt(e.name(),i,e.nullable(),l0(e))):t.has(n=Ae(a.id()))?(o=(o=a.indexType())?aA(o):new qi,s=new vr(t.get(n),o,n,a.isOrdered()),r=new Rt(e.name(),s,e.nullable(),l0(e))):(o=(o=a.indexType())?aA(o):new qi,t.set(n,i=cA(e,sA(e,t))),s=new vr(i,o,n,a.isOrdered()),r=new Rt(e.name(),s,e.nullable(),l0(e))),r||null}function l0(e){let t=new Map;if(e)for(let n,r,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(n=e.customMetadata(i))&&(r=n.key())!=null&&t.set(r,n.value());return t}function aA(e){return new ke(e.isSigned(),e.bitWidth())}function cA(e,t){let n=e.typeType();switch(n){case fe.NONE:return new qn;case fe.Null:return new qn;case fe.Binary:return new Fo;case fe.LargeBinary:return new Co;case fe.Utf8:return new ko;case fe.LargeUtf8:return new Ro;case fe.Bool:return new $o;case fe.List:return new pi((t||[])[0]);case fe.Struct_:return new ye(t||[])}switch(n){case fe.Int:{let r=e.type(new ci);return new ke(r.isSigned(),r.bitWidth())}case fe.FloatingPoint:{let r=e.type(new Zs);return new ar(r.precision())}case fe.Decimal:{let r=e.type(new zi);return new Uo(r.scale(),r.precision(),r.bitWidth())}case fe.Date:{let r=e.type(new Ws);return new Po(r.unit())}case fe.Time:{let r=e.type(new Oo);return new di(r.unit(),r.bitWidth())}case fe.Timestamp:{let r=e.type(new Lo);return new zo(r.unit(),r.timezone())}case fe.Interval:{let r=e.type(new Ks);return new qo(r.unit())}case fe.Duration:{let r=e.type(new Gs);return new Vo(r.unit())}case fe.Union:{let r=e.type(new li);return new mi(r.mode(),r.typeIdsArray()||[],t||[])}case fe.FixedSizeBinary:{let r=e.type(new Xs);return new jo(r.byteWidth())}case fe.FixedSizeList:{let r=e.type(new Hs);return new yi(r.listSize(),(t||[])[0])}case fe.Map:{let r=e.type(new Qs);return new gi((t||[])[0],r.keysSorted())}}throw new Error(`Unrecognized type: "${fe[n]}" (${n})`)}function wk(e,t){let n=t.fields.map(o=>Rt.encode(e,o));sr.startFieldsVector(e,n.length);let r=sr.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?sr.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),c=e.createString(`${s}`);return tn.startKeyValue(e),tn.addKey(e,a),tn.addValue(e,c),tn.endKeyValue(e)})):-1;return sr.startSchema(e),sr.addFields(e,r),sr.addEndianness(e,Ak?Ys.Little:Ys.Big),i!==-1&&sr.addCustomMetadata(e,i),sr.endSchema(e)}function _k(e,t){let n=-1,r=-1,i=-1,o=t.type,s=t.typeId;ot.isDictionary(o)?(s=o.dictionary.typeId,i=a0.visit(o,e),r=a0.visit(o.dictionary,e)):r=a0.visit(o,e);let a=(o.children||[]).map(u=>Rt.encode(e,u)),c=Nn.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?Nn.createCustomMetadataVector(e,[...t.metadata].map(([u,f])=>{let h=e.createString(`${u}`),d=e.createString(`${f}`);return tn.startKeyValue(e),tn.addKey(e,h),tn.addValue(e,d),tn.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),Nn.startField(e),Nn.addType(e,r),Nn.addTypeType(e,s),Nn.addChildren(e,c),Nn.addNullable(e,!!t.nullable),n!==-1&&Nn.addName(e,n),i!==-1&&Nn.addDictionary(e,i),l!==-1&&Nn.addCustomMetadata(e,l),Nn.endField(e)}function vk(e,t){let n=t.nodes||[],r=t.buffers||[];_r.startNodesVector(e,n.length);for(let s of n.slice().reverse())Vr.encode(e,s);let i=e.endVector();_r.startBuffersVector(e,r.length);for(let s of r.slice().reverse())ur.encode(e,s);let o=e.endVector();return _r.startRecordBatch(e),_r.addLength(e,BigInt(t.length)),_r.addNodes(e,i),_r.addBuffers(e,o),_r.endRecordBatch(e)}function Sk(e,t){let n=xn.encode(e,t.data);return Bo.startDictionaryBatch(e),Bo.addId(e,BigInt(t.id)),Bo.addIsDelta(e,t.isDelta),Bo.addData(e,n),Bo.endDictionaryBatch(e)}function Mk(e,t){return Sl.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function Ik(e,t){return vl.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var Ak=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})();var x_=e=>`Expected ${Ut[e]} Message in stream, but was null or length 0.`,w_=e=>`Header pointer of flatbuffer-encoded ${Ut[e]} Message is null or length 0.`,lA=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,uA=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,Pl=class{constructor(t){this.source=t instanceof Yi?t:new Yi(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?ge:t.value===-1&&(t=this.readMetadataLength()).done?ge:(t=this.readMetadata(t.value)).done?ge:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(x_(t));return n.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let n=wt(this.source.read(t));if(n.byteLength<t)throw new Error(uA(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()}readSchema(t=!1){let n=Ut.Schema,r=this.readMessage(n),i=r?.header();if(t&&!i)throw new Error(w_(n));return i}readMetadataLength(){let t=this.source.read(u0),n=t&&new wr(t),r=n?.readInt32(0)||0;return{done:r===0,value:r}}readMetadata(t){let n=this.source.read(t);if(!n)return ge;if(n.byteLength<t)throw new Error(lA(t,n.byteLength));return{done:!1,value:hr.decode(n)}}},zh=class{constructor(t,n){this.source=t instanceof zr?t:Vm(t)?new na(t,n):new zr(t)}[Symbol.asyncIterator](){return this}next(){return H(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?ge:t.value===-1&&(t=yield this.readMetadataLength()).done?ge:(t=yield this.readMetadata(t.value)).done?ge:t})}throw(t){return H(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return H(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return H(this,void 0,void 0,function*(){let n;if((n=yield this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(x_(t));return n.value})}readMessageBody(t){return H(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let n=wt(yield this.source.read(t));if(n.byteLength<t)throw new Error(uA(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()})}readSchema(t=!1){return H(this,void 0,void 0,function*(){let n=Ut.Schema,r=yield this.readMessage(n),i=r?.header();if(t&&!i)throw new Error(w_(n));return i})}readMetadataLength(){return H(this,void 0,void 0,function*(){let t=yield this.source.read(u0),n=t&&new wr(t),r=n?.readInt32(0)||0;return{done:r===0,value:r}})}readMetadata(t){return H(this,void 0,void 0,function*(){let n=yield this.source.read(t);if(!n)return ge;if(n.byteLength<t)throw new Error(lA(t,n.byteLength));return{done:!1,value:hr.decode(n)}})}},qh=class extends Pl{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof dh?t:new dh(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:hr.fromJSON(t.schema,Ut.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let n=t.dictionaries[this._dictionaryIndex++];return this._body=n.data.columns,{done:!1,value:hr.fromJSON(n,Ut.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let n=t.batches[this._batchIndex++];return this._body=n.columns,{done:!1,value:hr.fromJSON(n,Ut.RecordBatch)}}return this._body=[],ge}readMessageBody(t){return n(this._body);function n(r){return(r||[]).reduce((i,o)=>[...i,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE_ID&&[o.TYPE_ID]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...n(o.children)],[])}}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(x_(t));return n.value}readSchema(){let t=Ut.Schema,n=this.readMessage(t),r=n?.header();if(!n||!r)throw new Error(w_(t));return r}},u0=4,b_="ARROW1",zl=new Uint8Array(b_.length);for(let e=0;e<b_.length;e+=1)zl[e]=b_.codePointAt(e);function f0(e,t=0){for(let n=-1,r=zl.length;++n<r;)if(zl[n]!==e[t+n])return!1;return!0}var ql=zl.length,__=ql+u0,fA=ql*2+u0;var Ir=class e extends rc{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){let n=this._impl.open(t);return br(n)?n.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return gn.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return gn.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof e?t:zm(t)?Ek(t):Vm(t)?Bk(t):br(t)?H(this,void 0,void 0,function*(){return yield e.from(yield t)}):jm(t)||Wf(t)||Wm(t)||$r(t)?Nk(new zr(t)):Dk(new Yi(t))}static readAll(t){return t instanceof e?t.isSync()?hA(t):dA(t):zm(t)||ArrayBuffer.isView(t)||oi(t)||qm(t)?hA(t):dA(t)}},es=class extends Ir{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return gr(this,arguments,function*(){yield Lt(yield*wl(ii(this[Symbol.iterator]())))})}},fc=class extends Ir{constructor(t){super(t),this._impl=t}readAll(){var t,n,r,i;return H(this,void 0,void 0,function*(){let o=new Array;try{for(var s=!0,a=ii(this),c;c=yield a.next(),t=c.done,!t;s=!0){i=c.value,s=!1;let l=i;o.push(l)}}catch(l){n={error:l}}finally{try{!s&&!t&&(r=a.return)&&(yield r.call(a))}finally{if(n)throw n.error}}return o})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},hc=class extends es{constructor(t){super(t),this._impl=t}},h0=class extends fc{constructor(t){super(t),this._impl=t}},d0=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,n){let r=this._loadVectors(t,n,this.schema.fields),i=At({type:new ye(this.schema.fields),length:t.length,children:r});return new Be(this.schema,i)}_loadDictionaryBatch(t,n){let{id:r,isDelta:i}=t,{dictionaries:o,schema:s}=this,a=o.get(r);if(i||!a){let c=s.dictionaries.get(r),l=this._loadVectors(t.data,n,[c]);return(a&&i?a.concat(new qt(l)):new qt(l)).memoize()}return a.memoize()}_loadVectors(t,n,r){return new gh(n,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},Vl=class extends d0{constructor(t,n){super(n),this._reader=zm(t)?new qh(this._handle=t):new Pl(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=pA(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):ge}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):ge}next(){if(this.closed)return ge;let t,{_reader:n}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let r=t.header(),i=n.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),i=n.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new uc(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},jl=class extends d0{constructor(t,n){super(n),this._reader=new zh(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return H(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return H(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=pA(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):ge})}return(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):ge})}next(){return H(this,void 0,void 0,function*(){if(this.closed)return ge;let t,{_reader:n}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let r=t.header(),i=yield n.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),i=yield n.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new uc(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},p0=class extends Vl{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,n){super(t instanceof ph?t:new ph(t),n)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var n;if(this.closed)return null;this._footer||this.open();let r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(t);if(r&&this._handle.seek(r.offset)){let i=this._reader.readMessage(Ut.RecordBatch);if(i?.isRecordBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s)}}return null}_readDictionaryBatch(t){var n;let r=(n=this._footer)===null||n===void 0?void 0:n.getDictionaryBatch(t);if(r&&this._handle.seek(r.offset)){let i=this._reader.readMessage(Ut.DictionaryBatch);if(i?.isDictionaryBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}}_readFooter(){let{_handle:t}=this,n=t.size-__,r=t.readInt32(n),i=t.readAt(n-r,r);return Go.decode(i)}_readNextMessageAndValidate(t){var n;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(this._recordBatchIndex);if(r&&this._handle.seek(r.offset))return this._reader.readMessage(t)}return null}},v_=class extends jl{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...n){let r=typeof n[0]!="number"?n.shift():void 0,i=n[0]instanceof Map?n.shift():void 0;super(t instanceof na?t:new na(t,r),i)}isFile(){return!0}isAsync(){return!0}open(t){let n=Object.create(null,{open:{get:()=>super.open}});return H(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield n.open.call(this,t)})}readRecordBatch(t){var n;return H(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());let r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(t);if(r&&(yield this._handle.seek(r.offset))){let i=yield this._reader.readMessage(Ut.RecordBatch);if(i?.isRecordBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s)}}return null})}_readDictionaryBatch(t){var n;return H(this,void 0,void 0,function*(){let r=(n=this._footer)===null||n===void 0?void 0:n.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){let i=yield this._reader.readMessage(Ut.DictionaryBatch);if(i?.isDictionaryBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}})}_readFooter(){return H(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let n=t.size-__,r=yield t.readInt32(n),i=yield t.readAt(n-r,r);return Go.decode(i)})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=this._footer.getRecordBatch(this._recordBatchIndex);if(n&&(yield this._handle.seek(n.offset)))return yield this._reader.readMessage(t)}return null})}},S_=class extends Vl{constructor(t,n){super(t,n)}_loadVectors(t,n,r){return new $y(n,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}};function pA(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*hA(e){let t=Ir.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function dA(e){return gr(this,arguments,function*(){let n=yield Lt(Ir.from(e));try{if(!(yield Lt(n.open({autoDestroy:!1}))).closed)do yield yield Lt(n);while(!(yield Lt(n.reset().open())).closed)}finally{yield Lt(n.cancel())}})}function Ek(e){return new es(new S_(e))}function Dk(e){let t=e.peek(ql+7&-8);return t&&t.byteLength>=4?f0(t)?new hc(new p0(e.read())):new es(new Vl(e)):new es(new Vl(function*(){}()))}function Nk(e){return H(this,void 0,void 0,function*(){let t=yield e.peek(ql+7&-8);return t&&t.byteLength>=4?f0(t)?new hc(new p0(yield e.read())):new fc(new jl(e)):new fc(new jl(function(){return gr(this,arguments,function*(){})}()))})}function Bk(e){return H(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new na(e,t);return t>=fA&&f0(yield n.readAt(0,ql+7&-8))?new h0(new v_(n)):new fc(new jl(n))})}var ve=class e extends dt{static assemble(...t){let n=i=>i.flatMap(o=>Array.isArray(o)?n(o):o instanceof Be?o.data.children:o.data),r=new e;return r.visitMany(n(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof qt)return this.visitMany(t.data),this;let{type:n}=t;if(!ot.isDictionary(n)){let{length:r}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(ot.isUnion(n))this.nodes.push(new Vr(r,0));else{let{nullCount:i}=t;ot.isNull(n)||_i.call(this,i<=0?new Uint8Array(0):Ja(t.offset,r,t.nullBitmap)),this.nodes.push(new Vr(r,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function _i(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new ur(this._byteLength,t)),this._byteLength+=t,this}function Ok(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:o}=e;if(_i.call(this,i),n.mode===pe.Sparse)return M_.call(this,e);if(n.mode===pe.Dense){if(e.offset<=0)return _i.call(this,o),M_.call(this,e);{let s=new Int32Array(r),a=Object.create(null),c=Object.create(null);for(let l,u,f=-1;++f<r;)(l=i[f])!==void 0&&((u=a[l])===void 0&&(u=a[l]=o[f]),s[f]=o[f]-u,c[l]=((t=c[l])!==null&&t!==void 0?t:0)+1);_i.call(this,s),this.visitMany(e.children.map((l,u)=>{let f=n.typeIds[u],h=a[f],d=c[f];return l.slice(h,Math.min(r,d))}))}}return this}function Lk(e){let t;return e.nullCount>=e.length?_i.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?_i.call(this,Ja(e.offset,e.length,t)):_i.call(this,tc(e.values))}function ns(e){return _i.call(this,e.values.subarray(0,e.length*e.stride))}function m0(e){let{length:t,values:n,valueOffsets:r}=e,i=Ae(r[0]),o=Ae(r[t]),s=Math.min(o-i,n.byteLength-i);return _i.call(this,Xm(-i,t+1,r)),_i.call(this,n.subarray(i,i+s)),this}function I_(e){let{length:t,valueOffsets:n}=e;if(n){let{[0]:r,[t]:i}=n;return _i.call(this,Xm(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function M_(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}ve.prototype.visitBool=Lk;ve.prototype.visitInt=ns;ve.prototype.visitFloat=ns;ve.prototype.visitUtf8=m0;ve.prototype.visitLargeUtf8=m0;ve.prototype.visitBinary=m0;ve.prototype.visitLargeBinary=m0;ve.prototype.visitFixedSizeBinary=ns;ve.prototype.visitDate=ns;ve.prototype.visitTimestamp=ns;ve.prototype.visitTime=ns;ve.prototype.visitDecimal=ns;ve.prototype.visitList=I_;ve.prototype.visitStruct=M_;ve.prototype.visitUnion=Ok;ve.prototype.visitInterval=ns;ve.prototype.visitDuration=ns;ve.prototype.visitFixedSizeList=I_;ve.prototype.visitMap=I_;var dc=class extends rc{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new ji,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,zn(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return br(t)?t.then(n=>this.writeAll(n)):$r(t)?T_(this,t):A_(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,n=null){return t===this._sink||t instanceof ji?this._sink=t:(this._sink=new ji,t&&E3(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&D3(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!n||!lc(n,this._schema))&&(n==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=n,this._writeSchema(n))),this}write(t){let n=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof lr&&!(n=t.schema))return this.finish()&&void 0;if(t instanceof Be&&!(n=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(n&&!lc(n,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,n)}t instanceof Be?t instanceof uc||this._writeRecordBatch(t):t instanceof lr?this.writeAll(t.batches):oi(t)&&this.writeAll(t)}_writeMessage(t,n=8){let r=n-1,i=hr.encode(t),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+r&~r,c=a-o-s;return t.headerType===Ut.RecordBatch?this._recordBatchBlocks.push(new Xo(a,t.bodyLength,this._position)):t.headerType===Ut.DictionaryBatch&&this._dictionaryBlocks.push(new Xo(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-s)),o>0&&this._write(i),this._writePadding(c)}_write(t){if(this._started){let n=wt(t);n&&n.byteLength>0&&(this._sink.write(n),this._position+=n.byteLength)}return this}_writeSchema(t){return this._writeMessage(hr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(zl)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:n,nodes:r,bufferRegions:i,buffers:o}=ve.assemble(t),s=new xn(t.numRows,r,i),a=hr.from(s,n);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(o)}_writeDictionaryBatch(t,n,r=!1){this._dictionaryDeltaOffsets.set(n,t.length+(this._dictionaryDeltaOffsets.get(n)||0));let{byteLength:i,nodes:o,bufferRegions:s,buffers:a}=ve.assemble(new qt([t])),c=new xn(t.length,o,s),l=new fr(c,n,r),u=hr.from(l,i);return this._writeMessage(u)._writeBodyBuffers(a)}_writeBodyBuffers(t){let n,r,i;for(let o=-1,s=t.length;++o<s;)(n=t[o])&&(r=n.byteLength)>0&&(this._write(n),(i=(r+7&-8)-r)>0&&this._writePadding(i));return this}_writeDictionaries(t){for(let[n,r]of t.dictionaries){let i=this._dictionaryDeltaOffsets.get(n)||0;if(i===0||(r=r?.slice(i)).length>0)for(let o of r.data)this._writeDictionaryBatch(o,n,i>0),i+=o.length}return this}},Vh=class e extends dc{static writeAll(t,n){let r=new e(n);return br(t)?t.then(i=>r.writeAll(i)):$r(t)?T_(r,t):A_(r,t)}},jh=class e extends dc{static writeAll(t){let n=new e;return br(t)?t.then(r=>n.writeAll(r)):$r(t)?T_(n,t):A_(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let n=Go.encode(new Go(t,oe.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(n)._write(Int32Array.of(n.byteLength))._writeMagic()}};function A_(e,t){let n=t;t instanceof lr&&(n=t.batches,e.reset(void 0,t.schema));for(let r of n)e.write(r);return e.finish()}function T_(e,t){var n,r,i,o,s,a,c;return H(this,void 0,void 0,function*(){try{for(n=!0,r=ii(t);i=yield r.next(),o=i.done,!o;n=!0){c=i.value,n=!1;let l=c;e.write(l)}}catch(l){s={error:l}}finally{try{!n&&!o&&(a=r.return)&&(yield a.call(r))}finally{if(s)throw s.error}}return e.finish()})}function mA(e,t){if($r(e))return Ck(e,t);if(oi(e))return Fk(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function Fk(e,t){let n=null,r=t?.type==="bytes"||!1,i=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){o(s,n||(n=e[Symbol.iterator]()))},pull(s){n?o(s,n):s.close()},cancel(){(n?.return&&n.return()||!0)&&(n=null)}}),Object.assign({highWaterMark:r?i:void 0},t));function o(s,a){let c,l=null,u=s.desiredSize||null;for(;!(l=a.next(r?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=wt(l.value))&&(u!=null&&r&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()}}function Ck(e,t){let n=null,r=t?.type==="bytes"||!1,i=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){return H(this,void 0,void 0,function*(){yield o(s,n||(n=e[Symbol.asyncIterator]()))})},pull(s){return H(this,void 0,void 0,function*(){n?yield o(s,n):s.close()})},cancel(){return H(this,void 0,void 0,function*(){(n?.return&&(yield n.return())||!0)&&(n=null)})}}),Object.assign({highWaterMark:r?i:void 0},t));function o(s,a){return H(this,void 0,void 0,function*(){let c,l=null,u=s.desiredSize||null;for(;!(l=yield a.next(r?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=wt(l.value))&&(u!=null&&r&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()})}}function bA(e){return new E_(e)}var E_=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:n,["writableStrategy"]:r,["queueingStrategy"]:i="count"}=t,o=A3(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=oc(o),this._getSize=i!=="bytes"?yA:gA;let{["highWaterMark"]:s=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n),{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:s,size:i!=="bytes"?yA:gA}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(t){let n=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-n}_maybeFlush(t,n){n!=null&&(this._bufferedSize>=n.desiredSize&&++this._numChunks&&this._enqueue(n,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(n,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(n,null)))}_enqueue(t,n){this._bufferedSize=0,this._controller=null,n==null?t.close():t.enqueue(n)}},yA=e=>{var t;return(t=e?.length)!==null&&t!==void 0?t:0},gA=e=>{var t;return(t=e?.byteLength)!==null&&t!==void 0?t:0};function y0(e,t){let n=new ji,r=null,i=new ReadableStream({cancel(){return H(this,void 0,void 0,function*(){yield n.close()})},start(a){return H(this,void 0,void 0,function*(){yield s(a,r||(r=yield o()))})},pull(a){return H(this,void 0,void 0,function*(){r?yield s(a,r):a.close()})}});return{writable:new WritableStream(n,Object.assign({highWaterMark:Math.pow(2,14)},e)),readable:i};function o(){return H(this,void 0,void 0,function*(){return yield(yield Ir.from(n)).open(t)})}function s(a,c){return H(this,void 0,void 0,function*(){let l=a.desiredSize,u=null;for(;!(u=yield c.next()).done;)if(a.enqueue(u.value),l!=null&&--l<=0)return;a.close()})}}function g0(e,t){let n=new this(e),r=new zr(n),i=new ReadableStream({cancel(){return H(this,void 0,void 0,function*(){yield r.cancel()})},pull(s){return H(this,void 0,void 0,function*(){yield o(s)})},start(s){return H(this,void 0,void 0,function*(){yield o(s)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(n,e),readable:i};function o(s){return H(this,void 0,void 0,function*(){let a=null,c=s.desiredSize;for(;a=yield r.read(c||null);)if(s.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;s.close()})}}function Yh(e){let t=Ir.from(e);return br(t)?t.then(n=>Yh(n)):t.isAsync()?t.readAll().then(n=>new lr(n)):new lr(t.readAll())}var Rk=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Uw),f_),n_),Pw),Fw),e_),Rw),{compareSchemas:lc,compareFields:W6,compareTypes:G6});gn.toDOMStream=mA;be.throughDOM=bA;Ir.throughDOM=y0;hc.throughDOM=y0;es.throughDOM=y0;dc.throughDOM=g0;jh.throughDOM=g0;Vh.throughDOM=g0;function D_(e="ws://localhost:3000/"){let t=[],n=!1,r=null,i,o={open(){n=!0,c()},close(){for(n=!1,r=null,i=null;t.length;)t.shift().reject("Socket closed")},error(l){if(r){let{reject:u}=r;r=null,c(),u(l)}else console.error("WebSocket error: ",l)},message({data:l}){if(r){let{query:u,resolve:f,reject:h}=r;if(r=null,c(),typeof l=="string"){let d=JSON.parse(l);d.error?h(d.error):f(d)}else if(u.type==="exec")f();else if(u.type==="arrow")f(Yh(l.arrayBuffer()));else throw new Error(`Unexpected socket data: ${l}`)}else console.log("WebSocket message: ",l)}};function s(){i=new WebSocket(e);for(let l in o)i.addEventListener(l,o[l])}function a(l,u,f){i==null&&s(),t.push({query:l,resolve:u,reject:f}),n&&!r&&c()}function c(){t.length&&(r=t.shift(),i.send(JSON.stringify(r.query)))}return{get connected(){return n},query(l){return new Promise((u,f)=>a(l,u,f))}}}var dr=class{constructor(t,n){t&&(this.table=String(t)),n&&(this.column=n)}get columns(){return this.column?[this.column]:[]}toString(){let{table:t,column:n}=this;if(n){let r=n.startsWith("*")?n:`"${n}"`;return`${t?`${xA(t)}.`:""}${r}`}else return t?xA(t):"NULL"}};function xA(e){return e.split(".").map(n=>`"${n}"`).join(".")}function wA(e,t){return e instanceof dr&&e.column===t}function Gt(e){return typeof e=="string"?b0(e):e}function pc(e){return typeof e=="string"?_A(e):e}function _A(e){return new dr(e)}function b0(e,t){return arguments.length===1&&(t=e,e=null),new dr(e,t)}function rs(e){switch(typeof e){case"boolean":return e?"TRUE":"FALSE";case"string":return`'${e}'`;case"number":return Number.isFinite(e)?String(e):"NULL";default:if(e==null)return"NULL";if(e instanceof Date){let t=+e;if(Number.isNaN(t))return"NULL";let n=e.getUTCFullYear(),r=e.getUTCMonth(),i=e.getUTCDate();return t===Date.UTC(n,r,i)?`MAKE_DATE(${n}, ${r+1}, ${i})`:`EPOCH_MS(${t})`}else return e instanceof RegExp?`'${e.source}'`:String(e)}}var is=e=>typeof e?.addEventListener=="function";function x0(e){return e instanceof ra}var ra=class{constructor(t,n,r){this._expr=Array.isArray(t)?t:[t],this._deps=n||[],this.annotate(r);let i=this._expr.filter(o=>is(o));i.length>0?(this._params=Array.from(new Set(i)),this._params.forEach(o=>{o.addEventListener("value",()=>$k(this,this.map?.get("value")))})):this.addEventListener=void 0}get value(){return this}get columns(){let{_params:t,_deps:n}=this;if(t){let r=new Set(t.flatMap(i=>{let o=i.value?.columns;return Array.isArray(o)?o:[]}));if(r.size){let i=new Set(n);return r.forEach(o=>i.add(o)),Array.from(i)}}return n}get column(){return this._deps.length?this._deps[0]:this.columns[0]}annotate(...t){return Object.assign(this,...t)}toString(){return this._expr.map(t=>is(t)&&!x0(t)?rs(t.value):t).join("")}addEventListener(t,n){let r=this.map||(this.map=new Map);(r.get(t)||(r.set(t,new Set),r.get(t))).add(n)}};function $k(e,t){if(t?.size)return Promise.allSettled(Array.from(t,n=>n(e)))}function N_(e,t){let n=[e[0]],r=new Set,i=t.length;for(let o=0,s=0;o<i;){let a=t[o];is(a)?n[++s]=a:(Array.isArray(a?.columns)&&a.columns.forEach(l=>r.add(l)),n[s]+=typeof a=="string"?a:rs(a));let c=e[++o];is(n[s])?n[++s]=c:n[s]+=c}return{spans:n,cols:Array.from(r)}}function q(e,...t){let{spans:n,cols:r}=N_(e,t);return new ra(n,r)}var Wh=e=>({value:e,toString:()=>rs(e)});function Gh(e){e(this.op,this),this.children?.forEach(t=>t.visit(e))}function vA(e,t){let n=t.filter(i=>i!=null).map(Gt),r=n.map((i,o)=>o?` ${e} `:"");return n.length===1?r.push(""):n.length>1&&(r[0]="(",r.push(")")),q(r,...n).annotate({op:e,children:n,visit:Gh})}var Ar=(...e)=>vA("AND",e.flat()),Xh=(...e)=>vA("OR",e.flat()),Uk=e=>t=>q`(${e} ${Gt(t)})`.annotate({op:e,a:t,visit:Gh}),Pk=Uk("NOT"),SA=e=>t=>q`(${Gt(t)} ${e})`.annotate({op:e,a:t,visit:Gh}),Hh=SA("IS NULL"),mc=SA("IS NOT NULL"),ia=e=>(t,n)=>q`(${Gt(t)} ${e} ${Gt(n)})`.annotate({op:e,a:t,b:n,visit:Gh}),B_=ia("="),Zh=ia("<>"),yc=ia("<"),O_=ia(">"),gc=ia("<="),zk=ia(">="),qk=ia("IS DISTINCT FROM"),L_=ia("IS NOT DISTINCT FROM");function Vk(e,t,n,r){t=Gt(t);let i=e.startsWith("NOT ")?"NOT ":"";return(n?r?q`${i}(${n[0]} <= ${t} AND ${t} < ${n[1]})`:q`(${t} ${e} ${n[0]} AND ${n[1]})`:q``).annotate({op:e,visit:Gh,field:t,range:n})}var Oe=(e,t,n)=>Vk("BETWEEN",e,t,n);function bc(e,t){return Array.from({length:e},()=>t)}function wn(e,t){return(...n)=>{let r=n.map(Gt),i=t?`::${t}`:"";return(r.length?q([`${e}(`,...bc(r.length-1,", "),`)${i}`],...r):q`${e}()${i}`).annotate({func:e,args:r})}}var jk=wn("REGEXP_MATCHES"),Yk=wn("CONTAINS"),Wk=wn("PREFIX"),Gk=wn("SUFFIX"),Xk=wn("LOWER"),Hk=wn("UPPER"),Zk=wn("LENGTH"),Kk=wn("ISNAN"),Qk=wn("ISFINITE"),Jk=wn("ISINF");var Kh=class e extends ra{constructor(t,n,r,i,o="",s="",a=""){let c;if(i&&!(o||s||a))c=i?q`${n} OVER "${i}"`:q`${n} OVER ()`;else{let h=o&&s?" ":"",d=(o||s)&&a?" ":"";c=q`${n} OVER (${i?`"${i}" `:""}${o}${h}${s}${d}${a})`}r&&(c=q`(${c})::${r}`);let{_expr:u,_deps:f}=c;super(u,f,{window:t,func:n,type:r,name:i,group:o,order:s,frame:a})}get basis(){return this.column}get label(){let{func:t}=this;return t.label??t.toString()}over(t){let{window:n,func:r,type:i,group:o,order:s,frame:a}=this;return new e(n,r,i,t,o,s,a)}partitionby(...t){let n=t.flat().filter(u=>u).map(Gt),r=q(["PARTITION BY ",bc(n.length-1,", "),""],...n),{window:i,func:o,type:s,name:a,order:c,frame:l}=this;return new e(i,o,s,a,r,c,l)}orderby(...t){let n=t.flat().filter(u=>u).map(Gt),r=q(["ORDER BY ",bc(n.length-1,", "),""],...n),{window:i,func:o,type:s,name:a,group:c,frame:l}=this;return new e(i,o,s,a,c,r,l)}rows(t){let n=MA("ROWS",t),{window:r,func:i,type:o,name:s,group:a,order:c}=this;return new e(r,i,o,s,a,c,n)}range(t){let n=MA("RANGE",t),{window:r,func:i,type:o,name:s,group:a,order:c}=this;return new e(r,i,o,s,a,c,n)}};function MA(e,t){if(is(t)){let n=q`${t}`;return n.toString=()=>`${e} ${IA(t.value)}`,n}return`${e} ${IA(t)}`}function IA(e){let[t,n]=e,r=t===0?"CURRENT ROW":Number.isFinite(t)?`${Math.abs(t)} PRECEDING`:"UNBOUNDED PRECEDING",i=n===0?"CURRENT ROW":Number.isFinite(n)?`${Math.abs(n)} FOLLOWING`:"UNBOUNDED FOLLOWING";return`BETWEEN ${r} AND ${i}`}function vi(e,t){return(...n)=>{let r=wn(e)(...n);return new Kh(e,r,t)}}var t7=vi("ROW_NUMBER","INTEGER"),e7=vi("RANK","INTEGER"),n7=vi("DENSE_RANK","INTEGER"),r7=vi("PERCENT_RANK"),i7=vi("CUME_DIST"),o7=vi("NTILE"),s7=vi("LAG"),a7=vi("LEAD"),c7=vi("FIRST_VALUE"),l7=vi("LAST_VALUE"),u7=vi("NTH_VALUE");var F_=class e extends ra{constructor(t,n,r,i,o){n=(n||[]).map(Gt);let{strings:s,exprs:a}=f7(t,n,r,i,o),{spans:c,cols:l}=N_(s,a);super(c,l,{aggregate:t,args:n,type:r,isDistinct:i,filter:o})}get basis(){return this.column}get label(){let{aggregate:t,args:n,isDistinct:r}=this,i=r?"DISTINCT"+(n.length?" ":""):"",o=n.length?`(${i}${n.map(h7).join(", ")})`:"";return`${t.toLowerCase()}${o}`}distinct(){let{aggregate:t,args:n,type:r,filter:i}=this;return new e(t,n,r,!0,i)}where(t){let{aggregate:n,args:r,type:i,isDistinct:o}=this;return new e(n,r,i,o,t)}window(){let{aggregate:t,args:n,type:r,isDistinct:i}=this,o=new e(t,n,null,i);return new Kh(t,o,r)}partitionby(...t){return this.window().partitionby(...t)}orderby(...t){return this.window().orderby(...t)}rows(t,n){return this.window().rows(t,n)}range(t,n){return this.window().range(t,n)}};function f7(e,t,n,r,i){let o=`)${n?`::${n}`:""}`,s=[`${e}(${r?"DISTINCT ":""}`],a=[];return t.length?(s=s.concat([...bc(t.length-1,", "),`${o}${i?" FILTER (WHERE ":""}`,...i?[")"]:[]]),a=[...t,...i?[i]:[]]):s[0]+="*"+o,{exprs:a,strings:s}}function h7(e){let t=rs(e);return t&&t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function Xt(e,t){return(...n)=>new F_(e,n,t)}var Si=Xt("COUNT","INTEGER"),d7=Xt("AVG"),p7=Xt("AVG"),m7=Xt("MAD"),oa=Xt("MAX"),sa=Xt("MIN"),Mi=Xt("SUM","DOUBLE"),y7=Xt("PRODUCT"),g7=Xt("MEDIAN"),b7=Xt("QUANTILE"),x7=Xt("MODE"),w7=Xt("VARIANCE"),_7=Xt("STDDEV"),v7=Xt("SKEWNESS"),S7=Xt("KURTOSIS"),M7=Xt("ENTROPY"),I7=Xt("VAR_POP"),A7=Xt("STDDEV_POP"),T7=Xt("CORR"),E7=Xt("COVAR_POP"),C_=Xt("REGR_INTERCEPT"),k_=Xt("REGR_SLOPE"),R_=Xt("REGR_COUNT"),D7=Xt("REGR_R2"),$_=Xt("REGR_SYY"),U_=Xt("REGR_SXX"),N7=Xt("REGR_SXY"),P_=Xt("REGR_AVGX"),B7=Xt("REGR_AVGY"),O7=Xt("FIRST"),L7=Xt("LAST"),w0=Xt("ARG_MIN"),_0=Xt("ARG_MAX"),F7=Xt("STRING_AGG"),C7=Xt("ARRAY_AGG");function AA(e,t){let n=Gt(e),r=q`CAST(${n} AS ${t})`;return Object.defineProperty(r,"label",{enumerable:!0,get(){return e.label}}),Object.defineProperty(r,"aggregate",{enumerable:!0,get(){return e.aggregate||!1}}),r}var v0=e=>AA(e,"DOUBLE");var z_=e=>q`epoch_ms(${Gt(e)})`;var q_=wn("ST_AsGeoJSON"),k7=wn("ST_X"),R7=wn("ST_Y"),$7=wn("ST_CENTROID");var Ct=class e{static select(...t){return new e().select(...t)}static from(...t){return new e().from(...t)}static with(...t){return new e().with(...t)}static union(...t){return new xc("UNION",t.flat())}static unionAll(...t){return new xc("UNION ALL",t.flat())}static intersect(...t){return new xc("INTERSECT",t.flat())}static except(...t){return new xc("EXCEPT",t.flat())}constructor(){this.query={with:[],select:[],from:[],where:[],groupby:[],having:[],window:[],qualify:[],orderby:[]}}clone(){let t=new e;return t.query={...this.query},t}with(...t){let{query:n}=this;if(t.length===0)return n.with;{let r=[],i=(o,s)=>{let a=s.clone();a.cteFor=this,r.push({as:o,query:a})};return t.flat().forEach(o=>{if(o!=null)if(o.as&&o.query)i(o.as,o.query);else for(let s in o)i(s,o[s])}),n.with=n.with.concat(r),this}}select(...t){let{query:n}=this;if(t.length===0)return n.select;{let r=[];for(let i of t.flat())if(i!=null)if(typeof i=="string")r.push({as:i,expr:Gt(i)});else if(i instanceof dr)r.push({as:i.column,expr:i});else if(Array.isArray(i))r.push({as:i[0],expr:i[1]});else for(let o in i)r.push({as:S0(o),expr:Gt(i[o])});return n.select=n.select.concat(r),this}}$select(...t){return this.query.select=[],this.select(...t)}distinct(t=!0){return this.query.distinct=!!t,this}from(...t){let{query:n}=this;if(t.length===0)return n.from;{let r=[];return t.flat().forEach(i=>{if(i!=null)if(typeof i=="string")r.push({as:i,from:pc(i)});else if(i instanceof dr)r.push({as:i.table,from:i});else if(M0(i)||x0(i))r.push({from:i});else if(Array.isArray(i))r.push({as:S0(i[0]),from:pc(i[1])});else for(let o in i)r.push({as:S0(o),from:pc(i[o])})}),n.from=n.from.concat(r),this}}$from(...t){return this.query.from=[],this.from(...t)}sample(t,n){let{query:r}=this;if(arguments.length===0)return r.sample;{let i=t;return typeof t=="number"&&(i=t>0&&t<1?{perc:100*t,method:n}:{rows:Math.round(t),method:n}),r.sample=i,this}}where(...t){let{query:n}=this;return t.length===0?n.where:(n.where=n.where.concat(t.flat().filter(r=>r)),this)}$where(...t){return this.query.where=[],this.where(...t)}groupby(...t){let{query:n}=this;return t.length===0?n.groupby:(n.groupby=n.groupby.concat(t.flat().filter(r=>r).map(Gt)),this)}$groupby(...t){return this.query.groupby=[],this.groupby(...t)}having(...t){let{query:n}=this;return t.length===0?n.having:(n.having=n.having.concat(t.flat().filter(r=>r)),this)}window(...t){let{query:n}=this;if(t.length===0)return n.window;{let r=[];return t.flat().forEach(i=>{if(i!=null)for(let o in i)r.push({as:S0(o),expr:i[o]})}),n.window=n.window.concat(r),this}}qualify(...t){let{query:n}=this;return t.length===0?n.qualify:(n.qualify=n.qualify.concat(t.flat().filter(r=>r)),this)}orderby(...t){let{query:n}=this;return t.length===0?n.orderby:(n.orderby=n.orderby.concat(t.flat().filter(r=>r).map(Gt)),this)}limit(t){let{query:n}=this;return arguments.length===0?n.limit:(n.limit=Number.isFinite(t)?t:void 0,this)}offset(t){let{query:n}=this;return arguments.length===0?n.offset:(n.offset=Number.isFinite(t)?t:void 0,this)}get subqueries(){let{query:t,cteFor:n}=this,i=(n?.query||t).with?.reduce((s,{as:a,query:c})=>(s[a]=c,s),{}),o=[];return t.from.forEach(({from:s})=>{if(M0(s))o.push(s);else if(i[s.table]){let a=i[s.table];o.push(a)}}),o}toString(){let{select:t,distinct:n,from:r,sample:i,where:o,groupby:s,having:a,window:c,qualify:l,orderby:u,limit:f,offset:h,with:d}=this.query,p=[];if(d.length){let g=d.map(({as:y,query:b})=>`"${y}" AS (${b})`);p.push(`WITH ${g.join(", ")}`)}let m=t.map(({as:g,expr:y})=>wA(y,g)&&!y.table?`${y}`:`${y} AS "${g}"`);if(p.push(`SELECT${n?" DISTINCT":""} ${m.join(", ")}`),r.length){let g=r.map(({as:y,from:b})=>{let x=M0(b)?`(${b})`:`${b}`;return!y||y===b.table?x:`${x} AS "${y}"`});p.push(`FROM ${g.join(", ")}`)}if(o.length){let g=o.map(String).filter(y=>y).join(" AND ");g&&p.push(`WHERE ${g}`)}if(i){let{rows:g,perc:y,method:b,seed:x}=i,w=g?`${g} ROWS`:`${y} PERCENT`,v=b?` (${b}${x!=null?`, ${x}`:""})`:"";p.push(`USING SAMPLE ${w}${v}`)}if(s.length&&p.push(`GROUP BY ${s.join(", ")}`),a.length){let g=a.map(String).filter(y=>y).join(" AND ");g&&p.push(`HAVING ${g}`)}if(c.length){let g=c.map(({as:y,expr:b})=>`"${y}" AS (${b})`);p.push(`WINDOW ${g.join(", ")}`)}if(l.length){let g=l.map(String).filter(y=>y).join(" AND ");g&&p.push(`QUALIFY ${g}`)}return u.length&&p.push(`ORDER BY ${u.join(", ")}`),Number.isFinite(f)&&p.push(`LIMIT ${f}`),Number.isFinite(h)&&p.push(`OFFSET ${h}`),p.join(" ")}},xc=class e{constructor(t,n){this.op=t,this.queries=n.map(r=>r.clone()),this.query={orderby:[]}}clone(){let t=new e(this.op,this.queries);return t.query={...this.query},t}orderby(...t){let{query:n}=this;return t.length===0?n.orderby:(n.orderby=n.orderby.concat(t.flat().filter(r=>r).map(Gt)),this)}limit(t){let{query:n}=this;return arguments.length===0?n.limit:(n.limit=Number.isFinite(t)?t:void 0,this)}offset(t){let{query:n}=this;return arguments.length===0?n.offset:(n.offset=Number.isFinite(t)?t:void 0,this)}get subqueries(){let{queries:t,cteFor:n}=this;return n&&t.forEach(r=>r.cteFor=n),t}toString(){let{op:t,queries:n,query:{orderby:r,limit:i,offset:o}}=this,s=[n.join(` ${t} `)];return r.length&&s.push(`ORDER BY ${r.join(", ")}`),Number.isFinite(i)&&s.push(`LIMIT ${i}`),Number.isFinite(o)&&s.push(`OFFSET ${o}`),s.join(" ")}};function M0(e){return e instanceof Ct||e instanceof xc}function S0(e){return U7(e)?e.slice(1,-1):e}function U7(e){return e[0]==='"'&&e[e.length-1]==='"'}var I0=e=>e;function P7(){return{apply:I0,invert:I0,sqlApply:Gt,sqlInvert:I0}}function z7({base:e}={}){if(e==null||e===Math.E)return{apply:Math.log,invert:Math.exp,sqlApply:t=>q`LN(${Gt(t)})`,sqlInvert:t=>q`EXP(${t})`};if(e===10)return{apply:Math.log10,invert:t=>Math.pow(10,t),sqlApply:t=>q`LOG(${Gt(t)})`,sqlInvert:t=>q`POW(10, ${t})`};{let t=+e;return{apply:n=>Math.log(n)/Math.log(t),invert:n=>Math.pow(t,n),sqlApply:n=>q`LN(${Gt(n)}) / LN(${t})`,sqlInvert:n=>q`POW(${t}, ${n})`}}}function q7({constant:e=1}={}){let t=+e;return{apply:n=>Math.sign(n)*Math.log1p(Math.abs(n)),invert:n=>Math.sign(n)*Math.exp(Math.abs(n)-t),sqlApply:n=>(n=Gt(n),q`SIGN(${n}) * LN(${t} + ABS(${n}))`),sqlInvert:n=>q`SIGN(${n}) * (EXP(ABS(${n})) - ${t})`}}function V7(){return{apply:e=>Math.sign(e)*Math.sqrt(Math.abs(e)),invert:e=>Math.sign(e)*e*e,sqlApply:e=>(e=Gt(e),q`SIGN(${e}) * SQRT(ABS(${e}))`),sqlInvert:e=>q`SIGN(${e}) * (${e}) ** 2`}}function j7({exponent:e=1}={}){let t=+e;return{apply:n=>Math.sign(n)*Math.pow(Math.abs(n),t),invert:n=>Math.sign(n)*Math.pow(Math.abs(n),1/t),sqlApply:n=>(n=Gt(n),q`SIGN(${n}) * POW(ABS(${n}), ${t})`),sqlInvert:n=>q`SIGN(${n}) * POW(ABS(${n}), 1/${t})`}}function TA(){return{apply:e=>+e,invert:e=>new Date(e),sqlApply:e=>e instanceof Date?+e:z_(Gt(e)),sqlInvert:I0}}var Y7={linear:P7,log:z7,symlog:q7,sqrt:V7,pow:j7,time:TA,utc:TA};function Qh(e){let t=Y7[e.type];return t?{...e,...t(e)}:null}function A0(e,t,{replace:n=!1,temp:r=!0,view:i=!1}={}){return"CREATE"+(n?" OR REPLACE ":" ")+(r?"TEMP ":"")+(i?"VIEW":"TABLE")+(n?" ":" IF NOT EXISTS ")+e+" AS "+t}function EA(e){switch(e){case"BIGINT":case"HUGEINT":case"INTEGER":case"SMALLINT":case"TINYINT":case"UBIGINT":case"UINTEGER":case"USMALLINT":case"UTINYINT":case"DOUBLE":case"FLOAT":case"REAL":case"DECIMAL":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":return"string";case"LIST":return"array";case"BLOB":case"STRUCT":case"MAP":return"object";default:throw new Error(`Unsupported type: ${e}`)}}var W7="count",G7="nulls",X7="max",H7="min",Z7="distinct";var K7={[W7]:Si,[Z7]:e=>Si(e).distinct(),[X7]:oa,[H7]:sa,[G7]:e=>Si().where(Hh(e))};function DA({table:e,column:t},n){return Ct.from(e).select(n.map(r=>[r,K7[r](t)]))}var NA=()=>Object.create(null),T0=class{constructor(t){this.mc=t,this.clear()}clear(){this.tables=NA()}tableInfo(t){let n=this.tables;if(n[t])return n[t];let r=Q7(this.mc,t).catch(i=>{throw n[t]=null,i});return n[t]=r}async fieldInfo({table:t,column:n,stats:r}){let o=(await this.tableInfo(t))[n];if(o==null)return;if(!r?.length)return o;let s=await this.mc.query(DA(o,r),{persist:!0}),a={...o,...Array.from(s)[0]};for(let c in a){let l=a[c];typeof l=="bigint"&&(a[c]=Number(l))}return a}async queryFields(t){let n=await J7(this,t);return(await Promise.all(n.map(i=>this.fieldInfo(i)))).filter(i=>i)}};async function Q7(e,t){let n=await e.query(`DESCRIBE ${pc(t)}`,{type:"json",cache:!1}),r=NA();for(let i of n)r[i.column_name]={table:t,column:i.column_name,sqlType:i.column_type,type:EA(i.column_type),nullable:i.null==="YES"};return r}async function J7(e,t){return t.length===1&&t[0].column==="*"?Object.values(await e.tableInfo(t[0].table)):t}function OA(e){let t=2166136261;for(let n=0,r=e.length;n<r;++n){let i=e.charCodeAt(n),o=i&65280;o&&(t=BA(t^o>>8)),t=BA(t^i&255)}return tR(t)}function BA(e){return e+(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}function tR(e){return e+=e<<13,e^=e>>>7,e+=e<<3,e^=e>>>17,e+=e<<5,e&4294967295}var E0=class{constructor(t,{selection:n,temp:r=!0}){this.mc=t,this.selection=n,this.temp=r,this.reset()}reset(){this.enabled=!1,this.clients=null,this.indices=null,this.activeView=null}clear(){this.indices&&(this.mc.cancel(Array.from(this.indices.values(),t=>t.result)),this.indices=null)}index(t,n){if(this.clients!==t){let l=Array.from(t,FA),u=l[0]?.from;this.enabled=l.every(f=>f&&f.from===u),this.clients=t,this.activeView=null,this.clear()}if(!this.enabled)return!1;n=n||this.selection.active;let{source:r}=n;if(r&&r===this.activeView?.source)return!0;if(this.clear(),!r)return!1;let i=this.activeView=eR(n);if(!i)return!1;this.mc.logger().warn("DATA CUBE INDEX CONSTRUCTION");let o=this.selection.remove(r),s=this.indices=new Map,{mc:a,temp:c}=this;for(let l of t){if(o.skip(l,n))continue;let u=FA(l),f=l.query(o.predicate(l)).select({...i.columns,...u.count}).groupby(Object.keys(i.columns)),[h]=f.subqueries;if(h){let b=Object.values(i.columns).map(x=>x.columns[0]);rR(h,b)}let d=f.orderby();f.query.orderby=[];let p=f.toString(),g=`cube_index_${(OA(p)>>>0).toString(16)}`,y=a.exec(A0(g,p,{temp:c}));s.set(l,{table:g,result:y,order:d,...u})}}async update(){let{clients:t,selection:n,activeView:r}=this,i=r.predicate(n.active.predicate);return Promise.all(Array.from(t).map(o=>this.updateClient(o,i)))}async updateClient(t,n){let r=this.indices.get(t);if(!r)return;n||(n=this.activeView.predicate(this.selection.active.predicate));let{table:i,dims:o,aggr:s,order:a=[]}=r,c=Ct.select(o,s).from(i).groupby(o).where(n).orderby(a);return this.mc.updateClient(t,c)}};function eR(e){let{source:t,schema:n}=e,r=e.predicate?.columns;if(!n||!r)return null;let{type:i,scales:o,pixelSize:s=1}=n,a;if(i==="interval"&&o){let c=o.map(l=>nR(l,s));if(c.some(l=>l==null))return null;c.length===1?(a=l=>l?Oe("active0",l.range.map(c[0])):[],r={active0:c[0](e.predicate.field)}):(a=l=>l?Ar(l.children.map(({range:u},f)=>Oe(`active${f}`,u.map(c[f])))):[],r=Object.fromEntries(e.predicate.children.map((l,u)=>[`active${u}`,c[u](l.field)])))}else if(i==="point")a=c=>c,r=Object.fromEntries(r.map(c=>[c.toString(),c]));else return null;return{source:t,columns:r,predicate:a}}function nR(e,t){let{apply:n,sqlApply:r}=Qh(e);if(n){let{domain:i,range:o}=e,s=n(Math.min(...i)),a=n(Math.max(...i)),c=Math.abs(o[1]-o[0])/(a-s)/t,l=t===1?"":`${t}::INTEGER * `;return u=>q`${l}FLOOR(${c}::DOUBLE * (${r(u)} - ${s}::DOUBLE))::INTEGER`}}var LA={from:NaN};function FA(e){if(!e.filterIndexable)return LA;let t=e.query(),n=V_(t);if(!n||!t.groupby)return LA;let r=new Set(t.groupby().map(a=>a.column)),i=[],o=[],s;for(let{as:a,expr:{aggregate:c}}of t.select())switch(c?.toUpperCase?.()){case"COUNT":case"SUM":i.push({[a]:q`SUM("${a}")::DOUBLE`});break;case"AVG":s="_count_",i.push({[a]:q`(SUM("${a}" * ${s}) / SUM(${s}))::DOUBLE`});break;case"MAX":i.push({[a]:q`MAX("${a}")`});break;case"MIN":i.push({[a]:q`MIN("${a}")`});break;default:if(r.has(a))o.push(a);else return null}return{aggr:i,dims:o,count:s?{[s]:q`COUNT(*)`}:{},from:n}}function V_(e){let t=e.subqueries;if(e.select){let r=e.from();if(!r.length)return;if(t.length===0)return r[0].from.table}let n=V_(t[0]);for(let r=1;r<t.length;++r){let i=V_(t[r]);if(i!==void 0&&i!==n)return NaN}return n}function rR(e,t){let n=new Set,r=i=>{n.has(i)||(n.add(i),i.select&&i.from().length&&i.select(t),i.subqueries.forEach(r))};r(e)}var D0=class{constructor(t,n,r=!0){this.mc=t,this.selection=n,this.clients=new Set,this.indexer=r?new E0(this.mc,{...r,selection:n}):null;let{value:i,activate:o}=this.handlers={value:()=>this.update(),activate:s=>this.indexer?.index(this.clients,s)};n.addEventListener("value",i),n.addEventListener("activate",o)}finalize(){let{value:t,activate:n}=this.handlers;this.selection.removeEventListener("value",t),this.selection.removeEventListener("activate",n)}reset(){this.indexer?.reset()}add(t){return(this.clients=new Set(this.clients)).add(t),this}remove(t){return this.clients.has(t)&&(this.clients=new Set(this.clients)).delete(t),this}update(){let{mc:t,indexer:n,clients:r,selection:i}=this;return n?.index(r)?n.update():iR(t,r,i)}};function iR(e,t,n){return Promise.all(Array.from(t).map(r=>{let i=n.predicate(r);if(i!=null)return e.updateClient(r,r.query(i))}))}function N0(){let e,t,n=new Promise((r,i)=>{e=r,t=i});return n.fulfill=r=>(e(r),n),n.reject=r=>(t(r),n),n}function oR(e){return(typeof requestAnimationFrame<"u"?requestAnimationFrame:typeof setImmediate<"u"?setImmediate:setTimeout)(e)}function CA(e,t,n){let r=[],i=0;function o(){let s=sR(r,t);r=[],i=0;for(let a of s)cR(a,e,n),fR(a,t)}return{add(s,a){s.request.type==="arrow"?(i=i||oR(()=>o()),r.push({entry:s,priority:a,index:r.length})):e(s,a)}}}function sR(e,t){let n=[],r=new Map;for(let i of e){let{entry:{request:o}}=i,s=aR(o.query,t);if(!r.has(s)){let a=[];n.push(a),r.set(s,a)}r.get(s).push(i)}return n}function aR(e,t){let n=`${e}`;if(e instanceof Ct&&!t.get(n)){if(e.orderby().length||e.where().length||e.qualify().length||e.having().length)return n;let r=e.clone().$select("*"),i=e.groupby();if(i.length){let o={};e.select().forEach(({as:s,expr:a})=>o[s]=a),r.$groupby(i.map(s=>s instanceof dr&&o[s.column]||s))}return`${r}`}else return n}function cR(e,t,n){if(lR(e))t({request:{type:"arrow",cache:!1,record:!1,query:uR(e,n)},result:e.result=N0()});else for(let{entry:r,priority:i}of e)t(r,i)}function lR(e){if(e.length>1){let t=`${e[0].entry.request.query}`;for(let n=1;n<e.length;++n)if(t!==`${e[n].entry.request.query}`)return!0}return!1}function uR(e,t){let n=e.maps=[],r=new Map;for(let s of e){let{query:a}=s.entry.request,c=[];n.push(c);for(let{as:l,expr:u}of a.select()){let f=`${u}`;r.has(f)||r.set(f,[`col${r.size}`,u]);let[h]=r.get(f);c.push([h,l])}t(`${a}`)}let i=e[0].entry.request.query.clone(),o=i.groupby();if(o.length){let s={};e.maps[0].forEach(([a,c])=>s[c]=a),i.$groupby(o.map(a=>a instanceof dr&&s[a.column]||a))}return i.$select(Array.from(r.values()))}async function fR(e,t){let{maps:n,result:r}=e;if(!n)return;let i;try{i=await r}catch(o){for(let{entry:s}of e)s.result.reject(o);return}e.forEach(({entry:o},s)=>{let{request:a,result:c}=o,l=hR(i,n[s]);a.cache&&t.set(String(a.query),l),c.fulfill(l)})}function hR(e,t){if(t){let n={};for(let[r,i]of t)n[i]=e.getChild(r);return new e.constructor(n)}else return e}var dR=typeof requestIdleCallback<"u"?requestIdleCallback:setTimeout,kA=()=>({get:()=>{},set:(e,t)=>t,clear:()=>{}});function RA({max:e=1e3,ttl:t=3*60*60*1e3}={}){let n=new Map;function r(){let i=performance.now()-t,o=null,s=1/0;for(let[a,c]of n){let{last:l}=c;l<s&&(o=a,s=l),i>l&&n.delete(a)}o&&n.delete(o)}return{get(i){let o=n.get(i);if(o)return o.last=performance.now(),o.value},set(i,o){return n.set(i,{last:performance.now(),value:o}),n.size>e&&dR(r),o},clear(){n=new Map}}}function $A(e){let t=Array.from({length:e},()=>({head:null,tail:null}));return{isEmpty(){return t.every(n=>!n.head)},insert(n,r){let i=t[r];if(!i)throw new Error(`Invalid queue priority rank: ${r}`);let o={item:n,next:null};i.head===null?i.head=i.tail=o:i.tail=i.tail.next=o},remove(n){for(let r of t){let{head:i,tail:o}=r;for(let s=null,a=i;a;s=a,a=a.next)n(a.item)&&(a===i?i=a.next:s.next=a.next,a===o&&(o=s||i));r.head=i,r.tail=o}},next(){for(let n of t){let{head:r}=n;if(r!==null)return n.head=r.next,n.tail===r&&(n.tail=null),r.item}}}}var Gi={High:0,Normal:1,Low:2};function UA(){let e=$A(3),t,n,r,i=[],o=null,s;function a(){if(o||e.isEmpty())return;let{request:f,result:h}=e.next();o=u(f,h),o.finally(()=>{o=null,a()})}function c(f,h=Gi.Normal){e.insert(f,h),a()}function l(f){i.length&&f&&i.forEach(h=>h.add(f))}async function u(f,h){try{let{query:d,type:p,cache:m=!1,record:g=!0,options:y}=f,b=d?`${d}`:null;if(g&&l(b),m){let v=n.get(b);if(v){r.debug("Cache"),h.fulfill(v);return}}let x=performance.now(),w=await t.query({type:p,sql:b,...y});m&&n.set(b,w),r.debug(`Request: ${(performance.now()-x).toFixed(1)}`),h.fulfill(w)}catch(d){h.reject(d)}}return{cache(f){return f!==void 0?n=f===!0?RA():f||kA():n},logger(f){return f?r=f:r},connector(f){return f?t=f:t},consolidate(f){f&&!s?s=CA(c,n,l):!f&&s&&(s=null)},request(f,h=Gi.Normal){let d=N0(),p={request:f,result:d};return s?s.add(p,h):c(p,h),d},cancel(f){let h=new Set(f);e.remove(({result:d})=>h.has(d))},clear(){e.remove(({result:f})=>(f.reject("Cleared"),!0))},record(){let f=[],h={add(d){f.push(d)},reset(){f=[]},snapshot(){return f.slice()},stop(){return i=i.filter(d=>d!==h),f}};return i.push(h),h}}}function PA(){return{debug(){},info(){},log(){},warn(){},error(){}}}var B0;function j_(e){return e?B0=e:B0==null&&(B0=new O0),B0}var O0=class{constructor(t=D_(),n={}){let{logger:r=console,manager:i=UA()}=n;this.catalog=new T0(this),this.manager=i,this.logger(r),this.configure(n),this.databaseConnector(t),this.clear()}logger(t){return arguments.length&&(this._logger=t||PA(),this.manager.logger(this._logger)),this._logger}configure({cache:t=!0,consolidate:n=!0,indexes:r=!0}){this.manager.cache(t),this.manager.consolidate(n),this.indexes=r}clear({clients:t=!0,cache:n=!0,catalog:r=!1}={}){this.manager.clear(),t&&(this.clients?.forEach(i=>this.disconnect(i)),this.filterGroups?.forEach(i=>i.finalize()),this.clients=new Set,this.filterGroups=new Map),n&&this.manager.cache().clear(),r&&this.catalog.clear()}databaseConnector(t){return this.manager.connector(t)}cancel(t){this.manager.cancel(t)}exec(t,{priority:n=Gi.Normal}={}){return t=Array.isArray(t)?t.join(`;
|
|
11
|
+
`):t,this.manager.request({type:"exec",query:t},n)}query(t,{type:n="arrow",cache:r=!0,priority:i=Gi.Normal,...o}={}){return this.manager.request({type:n,query:t,cache:r,options:o},i)}prefetch(t,n={}){return this.query(t,{...n,cache:!0,priority:Gi.Low})}createBundle(t,n,r=Gi.Low){let i={name:t,queries:n};return this.manager.request({type:"create-bundle",options:i},r)}loadBundle(t,n=Gi.High){let r={name:t};return this.manager.request({type:"load-bundle",options:r},n)}updateClient(t,n,r=Gi.Normal){return t.queryPending(),this.query(n,{priority:r}).then(i=>t.queryResult(i).update(),i=>{t.queryError(i),this._logger.error(i)})}requestQuery(t,n){return this.filterGroups.get(t.filterBy)?.reset(),n?this.updateClient(t,n):t.update()}async connect(t){let{catalog:n,clients:r,filterGroups:i,indexes:o}=this;if(r.has(t))throw new Error("Client already connected.");r.add(t),t.coordinator=this;let s=t.fields();s?.length&&t.fieldInfo(await n.queryFields(s));let a=t.filterBy;if(a)if(i.has(a))i.get(a).add(t);else{let c=new D0(this,a,o);i.set(a,c.add(t))}t.requestQuery()}disconnect(t){let{clients:n,filterGroups:r}=this;n.has(t)&&(n.delete(t),r.get(t.filterBy)?.remove(t),t.coordinator=null)}};var L0=class{constructor(){this._callbacks=new Map}addEventListener(t,n){this._callbacks.has(t)||this._callbacks.set(t,{callbacks:new Set,pending:null,queue:new Y_}),this._callbacks.get(t).callbacks.add(n)}removeEventListener(t,n){let r=this._callbacks.get(t);r&&r.callbacks.delete(n)}willEmit(t,n){return n}emitQueueFilter(){return null}cancel(t){this._callbacks.get(t)?.queue.clear()}emit(t,n){let r=this._callbacks.get(t)||{};if(r.pending)r.queue.enqueue(n,this.emitQueueFilter(t,n));else{let i=this.willEmit(t,n),{callbacks:o,queue:s}=r;if(o?.size){let a=Promise.allSettled(Array.from(o,c=>c(i))).then(()=>{r.pending=null,s.isEmpty()||this.emit(t,s.dequeue())});r.pending=a}}}},Y_=class{constructor(){this.clear()}clear(){this.next=null}isEmpty(){return!this.next}enqueue(t,n){let r={value:t};if(n&&this.next){let i=this;for(;i.next;)n(i.next.value)?i=i.next:i.next=i.next.next;i.next=r}else this.next=r}dequeue(){let{next:t}=this;return this.next=t?.next,t?.value}};function Jh(e,t){return e===t?!1:e instanceof Date&&t instanceof Date?+e!=+t:Array.isArray(e)&&Array.isArray(t)?pR(e,t):!0}function pR(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!0;return!1}function Yl(e){return e instanceof Wl}var Wl=class e extends L0{constructor(t){super(),this._value=t}static value(t){return new e(t)}static array(t){if(t.some(n=>Yl(n))){let n=new e,r=()=>n.update(t.map(i=>Yl(i)?i.value:i));return r(),t.forEach(i=>Yl(i)?i.addEventListener("value",r):0),n}return new e(t)}get value(){return this._value}update(t,{force:n}={}){return Jh(this._value,t)||n?this.emit("value",t):this.cancel("value"),this}willEmit(t,n){return t==="value"&&(this._value=n),n}};function W_(e){return e instanceof _c}var _c=class e extends Wl{static intersect({cross:t=!1}={}){return new e(new wc({cross:t}))}static union({cross:t=!1}={}){return new e(new wc({cross:t,union:!0}))}static single({cross:t=!1}={}){return new e(new wc({cross:t,single:!0}))}static crossfilter(){return new e(new wc({cross:!0}))}constructor(t=new wc){super([]),this._resolved=this._value,this._resolver=t}clone(){let t=new e(this._resolver);return t._value=t._resolved=this._value,t}remove(t){let n=this.clone();return n._value=n._resolved=n._resolver.resolve(this._resolved,{source:t}),n._value.active={source:t},n}get active(){return this.clauses.active}get value(){return this.active?.value}get clauses(){return super.value}get single(){return this._resolver.single}activate(t){this.emit("activate",t)}update(t){return this._resolved=this._resolver.resolve(this._resolved,t,!0),this._resolved.active=t,super.update(this._resolved)}willEmit(t,n){return t==="value"?(this._value=n,this.value):n}emitQueueFilter(t,n){return t==="value"?this._resolver.queueFilter(n):null}skip(t,n){return this._resolver.skip(t,n)}predicate(t,n=!1){let{clauses:r}=this,i=n?null:r.active;return this._resolver.predicate(r,i,t)}},wc=class{constructor({union:t,cross:n,single:r}={}){this.union=!!t,this.cross=!!n,this.single=!!r}resolve(t,n,r=!1){let{source:i,predicate:o}=n,s=t.filter(c=>i!==c.source),a=this.single?[]:s;return this.single&&r&&s.forEach(c=>c.source?.reset?.()),o&&a.push(n),a}skip(t,n){return this.cross&&n?.clients?.has(t)}predicate(t,n,r){let{union:i}=this;if(this.skip(r,n))return;let o=t.filter(s=>!this.skip(r,s)).map(s=>s.predicate);return i&&o.length>1?Xh(o):o}queueFilter(t){if(this.cross){let n=t.active?.source;return r=>r.active?.source!==n}}};function G_(){let e=new Set,t,n=new Promise(r=>t=r);return{pending(r){e.add(r)},ready(r){return e.delete(r),e.size===0},resolve(){n=new Promise(r=>{t(),t=r})},get promise(){return n}}}var bw={};Vs(bw,{Area:()=>fl,Arrow:()=>fm,BarX:()=>hm,BarY:()=>dm,Cell:()=>hl,Contour:()=>vm,Density:()=>Im,Dot:()=>dl,Frame:()=>rm,Geo:()=>Am,Hexgrid:()=>Tm,Image:()=>Em,Line:()=>pl,Link:()=>lm,Mark:()=>_t,Raster:()=>_m,Rect:()=>yl,RuleX:()=>Qp,RuleY:()=>Jp,Text:()=>cl,TickX:()=>gm,TickY:()=>bm,Tip:()=>im,Vector:()=>ul,area:()=>cm,areaX:()=>za,areaY:()=>Ps,arrow:()=>CB,auto:()=>WB,autoSpec:()=>dI,axisFx:()=>R1,axisFy:()=>k1,axisX:()=>em,axisY:()=>tm,barX:()=>Ao,barY:()=>To,bin:()=>Us,binX:()=>Mo,binY:()=>Io,bollinger:()=>Ya,bollingerX:()=>QB,bollingerY:()=>JB,boxX:()=>tO,boxY:()=>eO,cell:()=>qa,cellX:()=>RB,cellY:()=>$B,centroid:()=>KO,circle:()=>zB,cluster:()=>ZO,column:()=>hn,contour:()=>uO,crosshair:()=>dO,crosshairX:()=>pO,crosshairY:()=>mO,delaunayLink:()=>bO,delaunayMesh:()=>xO,density:()=>MO,differenceY:()=>TO,dodgeX:()=>fL,dodgeY:()=>hL,dot:()=>ni,dotX:()=>UB,dotY:()=>PB,filter:()=>X5,find:()=>rD,formatIsoDate:()=>vM,formatMonth:()=>cD,formatWeekday:()=>lD,frame:()=>pf,geo:()=>aw,geoCentroid:()=>QO,graticule:()=>DO,gridFx:()=>z1,gridFy:()=>U1,gridX:()=>P1,gridY:()=>$1,group:()=>jp,groupX:()=>La,groupY:()=>Fa,groupZ:()=>Vp,hexagon:()=>qB,hexbin:()=>NO,hexgrid:()=>BO,hull:()=>wO,identity:()=>W,image:()=>LO,indexOf:()=>Me,initializer:()=>_e,interpolateNearest:()=>wI,interpolateNone:()=>sw,interpolatorBarycentric:()=>xI,interpolatorRandomWalk:()=>_I,legend:()=>rB,line:()=>ml,lineX:()=>Va,lineY:()=>ja,linearRegressionX:()=>kO,linearRegressionY:()=>RO,link:()=>K1,map:()=>mr,mapX:()=>Tf,mapY:()=>Ef,marks:()=>Qe,normalize:()=>yw,normalizeX:()=>yL,normalizeY:()=>gL,plot:()=>sm,pointer:()=>lf,pointerX:()=>uf,pointerY:()=>il,raster:()=>sO,rect:()=>mm,rectX:()=>Mf,rectY:()=>If,reverse:()=>H5,ruleX:()=>Cr,ruleY:()=>kr,scale:()=>af,select:()=>xL,selectFirst:()=>qI,selectLast:()=>VI,selectMaxX:()=>vL,selectMaxY:()=>SL,selectMinX:()=>wL,selectMinY:()=>_L,shiftX:()=>bL,shuffle:()=>Z5,sort:()=>t1,sphere:()=>EO,spike:()=>RN,stackX:()=>uI,stackX1:()=>AB,stackX2:()=>TB,stackY:()=>fI,stackY1:()=>EB,stackY2:()=>DB,text:()=>So,textX:()=>D1,textY:()=>N1,tickX:()=>rw,tickY:()=>iw,tip:()=>j1,transform:()=>dn,tree:()=>kI,treeLink:()=>hw,treeNode:()=>Dm,valueof:()=>bt,vector:()=>JM,vectorX:()=>L1,vectorY:()=>F1,voronoi:()=>_O,voronoiMesh:()=>vO,window:()=>Df,windowX:()=>GB,windowY:()=>XB});function $t(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jn(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function os(e){let t,n,r;e.length!==2?(t=$t,n=(a,c)=>$t(e(a),c),r=(a,c)=>e(a)-c):(t=e===$t||e===jn?e:mR,n=e,r=e);function i(a,c,l=0,u=a.length){if(l<u){if(t(c,c)!==0)return u;do{let f=l+u>>>1;n(a[f],c)<0?l=f+1:u=f}while(l<u)}return l}function o(a,c,l=0,u=a.length){if(l<u){if(t(c,c)!==0)return u;do{let f=l+u>>>1;n(a[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function s(a,c,l=0,u=a.length){let f=i(a,c,l,u-1);return f>l&&r(a[f-1],c)>-r(a[f],c)?f-1:f}return{left:i,center:s,right:o}}function mR(){return 0}function td(e){return e===null?NaN:+e}function*zA(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var qA=os($t),VA=qA.right,yR=qA.left,gR=os(td).center,ss=VA;var ed=jA(YA),X_=jA(bR);function jA(e){return function(t,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:s}=t;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((s=Math.floor(s!==void 0?s:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!s||!n&&!r)return t;let a=n&&e(n),c=r&&e(r),l=i.slice();return a&&c?(Gl(a,l,i,o,s),Gl(a,i,l,o,s),Gl(a,l,i,o,s),Xl(c,i,l,o,s),Xl(c,l,i,o,s),Xl(c,i,l,o,s)):a?(Gl(a,i,l,o,s),Gl(a,l,i,o,s),Gl(a,i,l,o,s)):c&&(Xl(c,i,l,o,s),Xl(c,l,i,o,s),Xl(c,i,l,o,s)),t}}function Gl(e,t,n,r,i){for(let o=0,s=r*i;o<s;)e(t,n,o,o+=r,1)}function Xl(e,t,n,r,i){for(let o=0,s=r*i;o<r;++o)e(t,n,o,o+s,r)}function bR(e){let t=YA(e);return(n,r,i,o,s)=>{i<<=2,o<<=2,s<<=2,t(n,r,i+0,o+0,s),t(n,r,i+1,o+1,s),t(n,r,i+2,o+2,s),t(n,r,i+3,o+3,s)}}function YA(e){let t=Math.floor(e);if(t===e)return xR(e);let n=e-t,r=2*e+1;return(i,o,s,a,c)=>{if(!((a-=c)>=s))return;let l=t*o[s],u=c*t,f=u+c;for(let h=s,d=s+u;h<d;h+=c)l+=o[Math.min(a,h)];for(let h=s,d=a;h<=d;h+=c)l+=o[Math.min(a,h+u)],i[h]=(l+n*(o[Math.max(s,h-f)]+o[Math.min(a,h+f)]))/r,l-=o[Math.max(s,h-u)]}}function xR(e){let t=2*e+1;return(n,r,i,o,s)=>{if(!((o-=s)>=i))return;let a=e*r[i],c=s*e;for(let l=i,u=i+c;l<u;l+=s)a+=r[Math.min(o,l)];for(let l=i,u=o;l<=u;l+=s)a+=r[Math.min(o,l+c)],n[l]=a/t,a-=r[Math.max(i,l-c)]}}function Xi(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function wR(e){return e.length|0}function _R(e){return!(e>0)}function vR(e){return typeof e!="object"||"length"in e?e:Array.from(e)}function SR(e){return t=>e(...t)}function F0(...e){let t=typeof e[e.length-1]=="function"&&SR(e.pop());e=e.map(vR);let n=e.map(wR),r=e.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(_R))return o;for(;;){o.push(i.map((a,c)=>e[c][a]));let s=r;for(;++i[s]===n[s];){if(s===0)return t?o.map(t):o;i[s--]=0}}}function C0(e,t){var n=0,r=0;return Float64Array.from(e,t===void 0?i=>n+=+i||0:i=>n+=+t(i,r++,e)||0)}function aa(e,t){let n=0,r,i=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i))}if(n>1)return o/(n-1)}function jr(e,t){let n=aa(e,t);return n&&Math.sqrt(n)}function se(e,t){let n,r;if(t===void 0)for(let i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}var _n=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){let n=this._partials,r=0;for(let i=0;i<this._n&&i<32;i++){let o=n[i],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(n[r++]=a),t=s}return n[r]=t,this._n=r+1,this}valueOf(){let t=this._partials,n=this._n,r,i,o,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}};var Yn=class extends Map{constructor(t,n=XA){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(let[r,i]of t)this.set(r,i)}get(t){return super.get(H_(this,t))}has(t){return super.has(H_(this,t))}set(t,n){return super.set(WA(this,t),n)}delete(t){return super.delete(GA(this,t))}},Wn=class extends Set{constructor(t,n=XA){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(let r of t)this.add(r)}has(t){return super.has(H_(this,t))}add(t){return super.add(WA(this,t))}delete(t){return super.delete(GA(this,t))}};function H_({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function WA({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function GA({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function XA(e){return e!==null&&typeof e=="object"?e.valueOf():e}function nd(e){return e}function on(e,...t){return K_(e,nd,nd,t)}function Ii(e,t,...n){return K_(e,nd,t,n)}function Z_(e,t,...n){return K_(e,Array.from,t,n)}function K_(e,t,n,r){return function i(o,s){if(s>=r.length)return n(o);let a=new Yn,c=r[s++],l=-1;for(let u of o){let f=c(u,++l,o),h=a.get(f);h?h.push(u):a.set(f,[u])}for(let[u,f]of a)a.set(u,i(f,s));return t(a)}(e,0)}function Q_(e,t){return Array.from(t,n=>e[n])}function Hi(e,...t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&n.length!==2||t.length>1){let r=Uint32Array.from(e,(i,o)=>o);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,o)=>{for(let s of t){let a=vc(s[i],s[o]);if(a)return a}})):(n=e.map(n),r.sort((i,o)=>vc(n[i],n[o]))),Q_(e,r)}return e.sort(rd(n))}function rd(e=$t){if(e===$t)return vc;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function vc(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function Hl(e,t,n){return(t.length!==2?Hi(Ii(e,t,n),([r,i],[o,s])=>$t(i,s)||$t(r,o)):Hi(on(e,n),([r,i],[o,s])=>t(i,s)||$t(r,o))).map(([r])=>r)}var MR=Math.sqrt(50),IR=Math.sqrt(10),AR=Math.sqrt(2);function k0(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=MR?10:o>=IR?5:o>=AR?2:1,a,c,l;return i<0?(l=Math.pow(10,-i)/s,a=Math.round(e*l),c=Math.round(t*l),a/l<e&&++a,c/l>t&&--c,l=-l):(l=Math.pow(10,i)*s,a=Math.round(e/l),c=Math.round(t/l),a*l<e&&++a,c*l>t&&--c),c<a&&.5<=n&&n<2?k0(e,t,n*2):[a,c,l]}function vn(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,o,s]=r?k0(t,e,n):k0(e,t,n);if(!(o>=i))return[];let a=o-i+1,c=new Array(a);if(r)if(s<0)for(let l=0;l<a;++l)c[l]=(o-l)/-s;else for(let l=0;l<a;++l)c[l]=(o-l)*s;else if(s<0)for(let l=0;l<a;++l)c[l]=(i+l)/-s;else for(let l=0;l<a;++l)c[l]=(i+l)*s;return c}function as(e,t,n){return t=+t,e=+e,n=+n,k0(e,t,n)[2]}function Zl(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?as(t,e,n):as(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Kl(e,t,n){let r;for(;;){let i=as(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function ca(e){return Math.max(1,Math.ceil(Math.log(Xi(e))/Math.LN2)+1)}function jt(e,t){let n;if(t===void 0)for(let r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function R0(e,t){let n,r=-1,i=-1;if(t===void 0)for(let o of e)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function ae(e,t){let n;if(t===void 0)for(let r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function $0(e,t){let n,r=-1,i=-1;if(t===void 0)for(let o of e)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function U0(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?vc:rd(i);r>n;){if(r-n>600){let c=r-n+1,l=t-n+1,u=Math.log(c),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(c-f)/c)*(l-c/2<0?-1:1),d=Math.max(n,Math.floor(t-l*f/c+h)),p=Math.min(r,Math.floor(t+(c-l)*f/c+h));U0(e,t,d,p,i)}let o=e[t],s=n,a=r;for(id(e,n,t),i(e[r],o)>0&&id(e,n,r);s<a;){for(id(e,s,a),++s,--a;i(e[s],o)<0;)++s;for(;i(e[a],o)>0;)--a}i(e[n],o)===0?id(e,n,a):(++a,id(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function id(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Sc(e,t=$t){let n,r=!1;if(t.length===1){let i;for(let o of e){let s=t(o);(r?$t(s,i)>0:$t(s,s)===0)&&(n=o,i=s,r=!0)}}else for(let i of e)(r?t(i,n)>0:t(i,i)===0)&&(n=i,r=!0);return n}function Gn(e,t,n){if(e=Float64Array.from(zA(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return ae(e);if(t>=1)return jt(e);var r,i=(r-1)*t,o=Math.floor(i),s=jt(U0(e,o).subarray(0,o+1)),a=ae(e.subarray(o+1));return s+(a-s)*(i-o)}}function J_(e,t,n=td){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(i-o)}}function P0(e,t,n){let r=Xi(e),i=Gn(e,.75)-Gn(e,.25);return r&&i?Math.ceil((n-t)/(2*i*Math.pow(r,-1/3))):1}function od(e,t,n){let r=Xi(e),i=jr(e);return r&&i?Math.ceil((n-t)*Math.cbrt(r)/(3.49*i)):1}function cs(e,t){let n=0,r=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function Ai(e,t){return Gn(e,.5,t)}function*ER(e){for(let t of e)yield*t}function Ql(e){return Array.from(ER(e))}function Jl(e,t){let n=new Yn;if(t===void 0)for(let o of e)o!=null&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let s of e)(s=t(s,++o,e))!=null&&s>=s&&n.set(s,(n.get(s)||0)+1)}let r,i=0;for(let[o,s]of n)s>i&&(i=s,r=o);return r}function z0(e,t=DR){let n=[],r,i=!1;for(let o of e)i&&n.push(t(r,o)),r=o,i=!0;return n}function DR(e,t){return[e,t]}function Re(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function sd(e,t=$t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(e),r=new Float64Array(n.length);t.length!==2&&(n=n.map(t),t=$t);let i=(a,c)=>t(n[a],n[c]),o,s;return e=Uint32Array.from(n,(a,c)=>c),e.sort(t===$t?(a,c)=>vc(n[a],n[c]):rd(i)),e.forEach((a,c)=>{let l=i(a,o===void 0?a:o);l>=0?((o===void 0||l>0)&&(o=a,s=c),r[a]=s):r[a]=NaN}),r}function q0(e,t=$t){let n,r=!1;if(t.length===1){let i;for(let o of e){let s=t(o);(r?$t(s,i)<0:$t(s,s)===0)&&(n=o,i=s,r=!0)}}else for(let i of e)(r?t(i,n)<0:t(i,i)===0)&&(n=i,r=!0);return n}function Sn(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function la(e){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(e).reverse()}function HA(e){return e}var tv=1,ev=2,nv=3,V0=4,ZA=1e-6;function NR(e){return"translate("+e+",0)"}function BR(e){return"translate(0,"+e+")"}function OR(e){return t=>+e(t)}function LR(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function FR(){return!this.__axis}function CR(e,t){var n=[],r=null,i=null,o=6,s=6,a=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=e===tv||e===V0?-1:1,u=e===V0||e===ev?"x":"y",f=e===tv||e===nv?NR:BR;function h(d){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):HA),g=Math.max(o,0)+a,y=t.range(),b=+y[0]+c,x=+y[y.length-1]+c,w=(t.bandwidth?LR:OR)(t.copy(),c),v=d.selection?d.selection():d,_=v.selectAll(".domain").data([null]),M=v.selectAll(".tick").data(p,t).order(),D=M.exit(),A=M.enter().append("g").attr("class","tick"),N=M.select("line"),T=M.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),M=M.merge(A),N=N.merge(A.append("line").attr("stroke","currentColor").attr(u+"2",l*o)),T=T.merge(A.append("text").attr("fill","currentColor").attr(u,l*g).attr("dy",e===tv?"0em":e===nv?"0.71em":"0.32em")),d!==v&&(_=_.transition(d),M=M.transition(d),N=N.transition(d),T=T.transition(d),D=D.transition(d).attr("opacity",ZA).attr("transform",function(B){return isFinite(B=w(B))?f(B+c):this.getAttribute("transform")}),A.attr("opacity",ZA).attr("transform",function(B){var L=this.parentNode.__axis;return f((L&&isFinite(L=L(B))?L:w(B))+c)})),D.remove(),_.attr("d",e===V0||e===ev?s?"M"+l*s+","+b+"H"+c+"V"+x+"H"+l*s:"M"+c+","+b+"V"+x:s?"M"+b+","+l*s+"V"+c+"H"+x+"V"+l*s:"M"+b+","+c+"H"+x),M.attr("opacity",1).attr("transform",function(B){return f(w(B)+c)}),N.attr(u+"2",l*o),T.attr(u,l*g).text(m),v.filter(FR).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===ev?"start":e===V0?"end":"middle"),v.each(function(){this.__axis=w})}return h.scale=function(d){return arguments.length?(t=d,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),h):n.slice()},h.tickValues=function(d){return arguments.length?(r=d==null?null:Array.from(d),h):r&&r.slice()},h.tickFormat=function(d){return arguments.length?(i=d,h):i},h.tickSize=function(d){return arguments.length?(o=s=+d,h):o},h.tickSizeInner=function(d){return arguments.length?(o=+d,h):o},h.tickSizeOuter=function(d){return arguments.length?(s=+d,h):s},h.tickPadding=function(d){return arguments.length?(a=+d,h):a},h.offset=function(d){return arguments.length?(c=+d,h):c},h}function rv(e){return CR(nv,e)}var kR={value:()=>{}};function QA(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new j0(n)}function j0(e){this._=e}function RR(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}j0.prototype=QA.prototype={constructor:j0,on:function(e,t){var n=this._,r=RR(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=$R(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=KA(n[i],e.name,t);else if(t==null)for(i in n)n[i]=KA(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new j0(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function $R(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function KA(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=kR,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Mc=QA;var Y0="http://www.w3.org/1999/xhtml",Yr={svg:"http://www.w3.org/2000/svg",xhtml:Y0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ls(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Yr.hasOwnProperty(t)?{space:Yr[t],local:e}:e}function UR(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Y0&&t.documentElement.namespaceURI===Y0?t.createElement(e):t.createElementNS(n,e)}}function PR(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function us(e){var t=ls(e);return(t.local?PR:UR)(t)}function zR(){}function Ic(e){return e==null?zR:function(){return this.querySelector(e)}}function JA(e){typeof e!="function"&&(e=Ic(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=new Array(s),c,l,u=0;u<s;++u)(c=o[u])&&(l=e.call(c,c.__data__,u,o))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new Le(r,this._parents)}function iv(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qR(){return[]}function ad(e){return e==null?qR:function(){return this.querySelectorAll(e)}}function VR(e){return function(){return iv(e.apply(this,arguments))}}function tT(e){typeof e=="function"?e=VR(e):e=ad(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(r.push(e.call(c,c.__data__,l,s)),i.push(c));return new Le(r,i)}function cd(e){return function(){return this.matches(e)}}function W0(e){return function(t){return t.matches(e)}}var jR=Array.prototype.find;function YR(e){return function(){return jR.call(this.children,e)}}function WR(){return this.firstElementChild}function eT(e){return this.select(e==null?WR:YR(typeof e=="function"?e:W0(e)))}var GR=Array.prototype.filter;function XR(){return Array.from(this.children)}function HR(e){return function(){return GR.call(this.children,e)}}function nT(e){return this.selectAll(e==null?XR:HR(typeof e=="function"?e:W0(e)))}function rT(e){typeof e!="function"&&(e=cd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&e.call(c,c.__data__,l,o)&&a.push(c);return new Le(r,this._parents)}function G0(e){return new Array(e.length)}function iT(){return new Le(this._enter||this._groups.map(G0),this._parents)}function ld(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ld.prototype={constructor:ld,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function oT(e){return function(){return e}}function ZR(e,t,n,r,i,o){for(var s=0,a,c=t.length,l=o.length;s<l;++s)(a=t[s])?(a.__data__=o[s],r[s]=a):n[s]=new ld(e,o[s]);for(;s<c;++s)(a=t[s])&&(i[s]=a)}function KR(e,t,n,r,i,o,s){var a,c,l=new Map,u=t.length,f=o.length,h=new Array(u),d;for(a=0;a<u;++a)(c=t[a])&&(h[a]=d=s.call(c,c.__data__,a,t)+"",l.has(d)?i[a]=c:l.set(d,c));for(a=0;a<f;++a)d=s.call(e,o[a],a,o)+"",(c=l.get(d))?(r[a]=c,c.__data__=o[a],l.delete(d)):n[a]=new ld(e,o[a]);for(a=0;a<u;++a)(c=t[a])&&l.get(h[a])===c&&(i[a]=c)}function QR(e){return e.__data__}function sT(e,t){if(!arguments.length)return Array.from(this,QR);var n=t?KR:ZR,r=this._parents,i=this._groups;typeof e!="function"&&(e=oT(e));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],f=i[l],h=f.length,d=JR(e.call(u,u&&u.__data__,l,r)),p=d.length,m=a[l]=new Array(p),g=s[l]=new Array(p),y=c[l]=new Array(h);n(u,f,m,g,y,d,t);for(var b=0,x=0,w,v;b<p;++b)if(w=m[b]){for(b>=x&&(x=b+1);!(v=g[x])&&++x<p;);w._next=v||null}}return s=new Le(s,r),s._enter=a,s._exit=c,s}function JR(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function aT(){return new Le(this._exit||this._groups.map(G0),this._parents)}function cT(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function lT(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var l=n[c],u=r[c],f=l.length,h=a[c]=new Array(f),d,p=0;p<f;++p)(d=l[p]||u[p])&&(h[p]=d);for(;c<i;++c)a[c]=n[c];return new Le(a,this._parents)}function uT(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function fT(e){e||(e=t9);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,c=i[o]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(t)}return new Le(i,this._parents).order()}function t9(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function hT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function dT(){return Array.from(this)}function pT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function mT(){let e=0;for(let t of this)++e;return e}function yT(){return!this.node()}function gT(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&e.call(a,a.__data__,o,i);return this}function e9(e){return function(){this.removeAttribute(e)}}function n9(e){return function(){this.removeAttributeNS(e.space,e.local)}}function r9(e,t){return function(){this.setAttribute(e,t)}}function i9(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function o9(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function s9(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function bT(e,t){var n=ls(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?n9:e9:typeof t=="function"?n.local?s9:o9:n.local?i9:r9)(n,t))}function X0(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function a9(e){return function(){this.style.removeProperty(e)}}function c9(e,t,n){return function(){this.style.setProperty(e,t,n)}}function l9(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function xT(e,t,n){return arguments.length>1?this.each((t==null?a9:typeof t=="function"?l9:c9)(e,t,n??"")):ua(this.node(),e)}function ua(e,t){return e.style.getPropertyValue(t)||X0(e).getComputedStyle(e,null).getPropertyValue(t)}function u9(e){return function(){delete this[e]}}function f9(e,t){return function(){this[e]=t}}function h9(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function wT(e,t){return arguments.length>1?this.each((t==null?u9:typeof t=="function"?h9:f9)(e,t)):this.node()[e]}function _T(e){return e.trim().split(/^|\s+/)}function ov(e){return e.classList||new vT(e)}function vT(e){this._node=e,this._names=_T(e.getAttribute("class")||"")}vT.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ST(e,t){for(var n=ov(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function MT(e,t){for(var n=ov(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function d9(e){return function(){ST(this,e)}}function p9(e){return function(){MT(this,e)}}function m9(e,t){return function(){(t.apply(this,arguments)?ST:MT)(this,e)}}function IT(e,t){var n=_T(e+"");if(arguments.length<2){for(var r=ov(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?m9:t?d9:p9)(n,t))}function y9(){this.textContent=""}function g9(e){return function(){this.textContent=e}}function b9(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function AT(e){return arguments.length?this.each(e==null?y9:(typeof e=="function"?b9:g9)(e)):this.node().textContent}function x9(){this.innerHTML=""}function w9(e){return function(){this.innerHTML=e}}function _9(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function TT(e){return arguments.length?this.each(e==null?x9:(typeof e=="function"?_9:w9)(e)):this.node().innerHTML}function v9(){this.nextSibling&&this.parentNode.appendChild(this)}function ET(){return this.each(v9)}function S9(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function DT(){return this.each(S9)}function NT(e){var t=typeof e=="function"?e:us(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function M9(){return null}function BT(e,t){var n=typeof e=="function"?e:us(e),r=t==null?M9:typeof t=="function"?t:Ic(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function I9(){var e=this.parentNode;e&&e.removeChild(this)}function OT(){return this.each(I9)}function A9(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function T9(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function LT(e){return this.select(e?T9:A9)}function FT(e){return arguments.length?this.property("__data__",e):this.node().__data__}function E9(e){return function(t){e.call(this,t,this.__data__)}}function D9(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function N9(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function B9(e,t,n){return function(){var r=this.__on,i,o=E9(t);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function CT(e,t,n){var r=D9(e+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(i=0,u=a[c];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?B9:N9,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function kT(e,t,n){var r=X0(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function O9(e,t){return function(){return kT(this,e,t)}}function L9(e,t){return function(){return kT(this,e,t.apply(this,arguments))}}function RT(e,t){return this.each((typeof t=="function"?L9:O9)(e,t))}function*$T(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var sv=[null];function Le(e,t){this._groups=e,this._parents=t}function UT(){return new Le([[document.documentElement]],sv)}function F9(){return this}Le.prototype=UT.prototype={constructor:Le,select:JA,selectAll:tT,selectChild:eT,selectChildren:nT,filter:rT,data:sT,enter:iT,exit:aT,join:cT,merge:lT,selection:F9,order:uT,sort:fT,call:hT,nodes:dT,node:pT,size:mT,empty:yT,each:gT,attr:bT,style:xT,property:wT,classed:IT,text:AT,html:TT,raise:ET,lower:DT,append:NT,insert:BT,remove:OT,clone:LT,datum:FT,on:CT,dispatch:RT,[Symbol.iterator]:$T};var fs=UT;function Pt(e){return typeof e=="string"?new Le([[document.querySelector(e)]],[document.documentElement]):new Le([[e]],sv)}function PT(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Bn(e,t){if(e=PT(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var H0={capture:!0,passive:!1};function Z0(e){e.preventDefault(),e.stopImmediatePropagation()}function ud(e){var t=e.document.documentElement,n=Pt(e).on("dragstart.drag",Z0,H0);"onselectstart"in t?n.on("selectstart.drag",Z0,H0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function fd(e,t){var n=e.document.documentElement,r=Pt(e).on("dragstart.drag",null);t&&(r.on("click.drag",Z0,H0),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 hs(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function fa(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ki(){}var ha=.7,Ec=1/ha,tu="\\s*([+-]?\\d+)\\s*",hd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",C9=/^#([0-9a-f]{3,8})$/,k9=new RegExp(`^rgb\\(${tu},${tu},${tu}\\)$`),R9=new RegExp(`^rgb\\(${Zi},${Zi},${Zi}\\)$`),$9=new RegExp(`^rgba\\(${tu},${tu},${tu},${hd}\\)$`),U9=new RegExp(`^rgba\\(${Zi},${Zi},${Zi},${hd}\\)$`),P9=new RegExp(`^hsl\\(${hd},${Zi},${Zi}\\)$`),z9=new RegExp(`^hsla\\(${hd},${Zi},${Zi},${hd}\\)$`),zT={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};hs(Ki,Tr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qT,formatHex:qT,formatHex8:q9,formatHsl:V9,formatRgb:VT,toString:VT});function qT(){return this.rgb().formatHex()}function q9(){return this.rgb().formatHex8()}function V9(){return HT(this).formatHsl()}function VT(){return this.rgb().formatRgb()}function Tr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=C9.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?jT(t):n===3?new je(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?K0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?K0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=k9.exec(e))?new je(t[1],t[2],t[3],1):(t=R9.exec(e))?new je(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$9.exec(e))?K0(t[1],t[2],t[3],t[4]):(t=U9.exec(e))?K0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=P9.exec(e))?GT(t[1],t[2]/100,t[3]/100,1):(t=z9.exec(e))?GT(t[1],t[2]/100,t[3]/100,t[4]):zT.hasOwnProperty(e)?jT(zT[e]):e==="transparent"?new je(NaN,NaN,NaN,0):null}function jT(e){return new je(e>>16&255,e>>8&255,e&255,1)}function K0(e,t,n,r){return r<=0&&(e=t=n=NaN),new je(e,t,n,r)}function dd(e){return e instanceof Ki||(e=Tr(e)),e?(e=e.rgb(),new je(e.r,e.g,e.b,e.opacity)):new je}function en(e,t,n,r){return arguments.length===1?dd(e):new je(e,t,n,r??1)}function je(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}hs(je,en,fa(Ki,{brighter(e){return e=e==null?Ec:Math.pow(Ec,e),new je(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ha:Math.pow(ha,e),new je(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new je(Tc(this.r),Tc(this.g),Tc(this.b),J0(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:YT,formatHex:YT,formatHex8:j9,formatRgb:WT,toString:WT}));function YT(){return`#${Ac(this.r)}${Ac(this.g)}${Ac(this.b)}`}function j9(){return`#${Ac(this.r)}${Ac(this.g)}${Ac(this.b)}${Ac((isNaN(this.opacity)?1:this.opacity)*255)}`}function WT(){let e=J0(this.opacity);return`${e===1?"rgb(":"rgba("}${Tc(this.r)}, ${Tc(this.g)}, ${Tc(this.b)}${e===1?")":`, ${e})`}`}function J0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ac(e){return e=Tc(e),(e<16?"0":"")+e.toString(16)}function GT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ti(e,t,n,r)}function HT(e){if(e instanceof Ti)return new Ti(e.h,e.s,e.l,e.opacity);if(e instanceof Ki||(e=Tr(e)),!e)return new Ti;if(e instanceof Ti)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new Ti(s,a,c,e.opacity)}function pd(e,t,n,r){return arguments.length===1?HT(e):new Ti(e,t,n,r??1)}function Ti(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}hs(Ti,pd,fa(Ki,{brighter(e){return e=e==null?Ec:Math.pow(Ec,e),new Ti(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ha:Math.pow(ha,e),new Ti(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new je(av(e>=240?e-240:e+120,i,r),av(e,i,r),av(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ti(XT(this.h),Q0(this.s),Q0(this.l),J0(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 e=J0(this.opacity);return`${e===1?"hsl(":"hsla("}${XT(this.h)}, ${Q0(this.s)*100}%, ${Q0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function XT(e){return e=(e||0)%360,e<0?e+360:e}function Q0(e){return Math.max(0,Math.min(1,e||0))}function av(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var tg=Math.PI/180,eg=180/Math.PI;var ng=18,ZT=.96422,KT=1,QT=.82521,JT=4/29,eu=6/29,t4=3*eu*eu,Y9=eu*eu*eu;function e4(e){if(e instanceof Qi)return new Qi(e.l,e.a,e.b,e.opacity);if(e instanceof ds)return n4(e);e instanceof je||(e=dd(e));var t=fv(e.r),n=fv(e.g),r=fv(e.b),i=cv((.2225045*t+.7168786*n+.0606169*r)/KT),o,s;return t===n&&n===r?o=s=i:(o=cv((.4360747*t+.3850649*n+.1430804*r)/ZT),s=cv((.0139322*t+.0971045*n+.7141733*r)/QT)),new Qi(116*i-16,500*(o-i),200*(i-s),e.opacity)}function nu(e,t,n,r){return arguments.length===1?e4(e):new Qi(e,t,n,r??1)}function Qi(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}hs(Qi,nu,fa(Ki,{brighter(e){return new Qi(this.l+ng*(e??1),this.a,this.b,this.opacity)},darker(e){return new Qi(this.l-ng*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=ZT*lv(t),e=KT*lv(e),n=QT*lv(n),new je(uv(3.1338561*t-1.6168667*e-.4906146*n),uv(-.9787684*t+1.9161415*e+.033454*n),uv(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function cv(e){return e>Y9?Math.pow(e,1/3):e/t4+JT}function lv(e){return e>eu?e*e*e:t4*(e-JT)}function uv(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function fv(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function W9(e){if(e instanceof ds)return new ds(e.h,e.c,e.l,e.opacity);if(e instanceof Qi||(e=e4(e)),e.a===0&&e.b===0)return new ds(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*eg;return new ds(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function md(e,t,n,r){return arguments.length===1?W9(e):new ds(e,t,n,r??1)}function ds(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function n4(e){if(isNaN(e.h))return new Qi(e.l,0,0,e.opacity);var t=e.h*tg;return new Qi(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}hs(ds,md,fa(Ki,{brighter(e){return new ds(this.h,this.c,this.l+ng*(e??1),this.opacity)},darker(e){return new ds(this.h,this.c,this.l-ng*(e??1),this.opacity)},rgb(){return n4(this).rgb()}}));var s4=-.14861,hv=1.78277,dv=-.29227,rg=-.90649,yd=1.97294,r4=yd*rg,i4=yd*hv,o4=hv*dv-rg*s4;function G9(e){if(e instanceof Dc)return new Dc(e.h,e.s,e.l,e.opacity);e instanceof je||(e=dd(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(o4*r+r4*t-i4*n)/(o4+r4-i4),o=r-i,s=(yd*(n-i)-dv*o)/rg,a=Math.sqrt(s*s+o*o)/(yd*i*(1-i)),c=a?Math.atan2(s,o)*eg-120:NaN;return new Dc(c<0?c+360:c,a,i,e.opacity)}function Xn(e,t,n,r){return arguments.length===1?G9(e):new Dc(e,t,n,r??1)}function Dc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}hs(Dc,Xn,fa(Ki,{brighter(e){return e=e==null?Ec:Math.pow(Ec,e),new Dc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ha:Math.pow(ha,e),new Dc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*tg,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new je(255*(t+n*(s4*r+hv*i)),255*(t+n*(dv*r+rg*i)),255*(t+n*(yd*r)),this.opacity)}}));function pv(e,t,n,r,i){var o=e*e,s=o*e;return((1-3*e+3*o-s)*t+(4-6*o+3*s)*n+(1+3*e+3*o-3*s)*r+s*i)/6}function a4(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],s=r>0?e[r-1]:2*i-o,a=r<t-1?e[r+2]:2*o-i;return pv((n-r/t)*t,s,i,o,a)}}function c4(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],o=e[r%t],s=e[(r+1)%t],a=e[(r+2)%t];return pv((n-r/t)*t,i,o,s,a)}}var ru=e=>()=>e;function l4(e,t){return function(n){return e+n*t}}function X9(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function iu(e,t){var n=t-e;return n?l4(e,n>180||n<-180?n-360*Math.round(n/360):n):ru(isNaN(e)?t:e)}function u4(e){return(e=+e)==1?Se:function(t,n){return n-t?X9(t,n,e):ru(isNaN(t)?n:t)}}function Se(e,t){var n=t-e;return n?l4(e,n):ru(isNaN(e)?t:e)}var Wr=function e(t){var n=u4(t);function r(i,o){var s=n((i=en(i)).r,(o=en(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=Se(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=e,r}(1);function f4(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;s<n;++s)a=en(t[s]),r[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return r=e(r),i=e(i),o=e(o),a.opacity=1,function(c){return a.r=r(c),a.g=i(c),a.b=o(c),a+""}}}var mv=f4(a4),H9=f4(c4);function h4(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function d4(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function p4(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=Er(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<r;++s)o[s]=i[s](a);return o}}function m4(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function y4(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Er(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var gv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yv=new RegExp(gv.source,"g");function Z9(e){return function(){return e}}function K9(e){return function(t){return e(t)+""}}function gd(e,t){var n=gv.lastIndex=yv.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(e=e+"",t=t+"";(r=gv.exec(e))&&(i=yv.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:xe(r,i)})),n=yv.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?K9(c[0].x):Z9(t):(t=c.length,function(l){for(var u=0,f;u<t;++u)a[(f=c[u]).i]=f.x(l);return a.join("")})}function Er(e,t){var n=typeof t,r;return t==null||n==="boolean"?ru(t):(n==="number"?xe:n==="string"?(r=Tr(t))?(t=r,Wr):gd:t instanceof Tr?Wr:t instanceof Date?m4:d4(t)?h4:Array.isArray(t)?p4:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?y4:xe)(e,t)}function Nc(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var g4=180/Math.PI,ig={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function bv(e,t,n,r,i,o){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*g4,skewX:Math.atan(c)*g4,scaleX:s,scaleY:a}}var og;function b4(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ig:bv(t.a,t.b,t.c,t.d,t.e,t.f)}function x4(e){return e==null?ig:(og||(og=document.createElementNS("http://www.w3.org/2000/svg","g")),og.setAttribute("transform",e),(e=og.transform.baseVal.consolidate())?(e=e.matrix,bv(e.a,e.b,e.c,e.d,e.e,e.f)):ig)}function w4(e,t,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,f,h,d,p){if(l!==f||u!==h){var m=d.push("translate(",null,t,null,n);p.push({i:m-4,x:xe(l,f)},{i:m-2,x:xe(u,h)})}else(f||h)&&d.push("translate("+f+t+h+n)}function s(l,u,f,h){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:xe(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(l,u,f,h){l!==u?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:xe(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(l,u,f,h,d,p){if(l!==f||u!==h){var m=d.push(i(d)+"scale(",null,",",null,")");p.push({i:m-4,x:xe(l,f)},{i:m-2,x:xe(u,h)})}else(f!==1||h!==1)&&d.push(i(d)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=e(l),u=e(u),o(l.translateX,l.translateY,u.translateX,u.translateY,f,h),s(l.rotate,u.rotate,f,h),a(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(d){for(var p=-1,m=h.length,g;++p<m;)f[(g=h[p]).i]=g.x(d);return f.join("")}}}var xv=w4(b4,"px, ","px)","deg)"),wv=w4(x4,", ",")",")");var Q9=1e-12;function _4(e){return((e=Math.exp(e))+1/e)/2}function J9(e){return((e=Math.exp(e))-1/e)/2}function t$(e){return((e=Math.exp(2*e))-1)/(e+1)}var _v=function e(t,n,r){function i(o,s){var a=o[0],c=o[1],l=o[2],u=s[0],f=s[1],h=s[2],d=u-a,p=f-c,m=d*d+p*p,g,y;if(m<Q9)y=Math.log(h/l)/t,g=function(M){return[a+M*d,c+M*p,l*Math.exp(t*M*y)]};else{var b=Math.sqrt(m),x=(h*h-l*l+r*m)/(2*l*n*b),w=(h*h-l*l-r*m)/(2*h*n*b),v=Math.log(Math.sqrt(x*x+1)-x),_=Math.log(Math.sqrt(w*w+1)-w);y=(_-v)/t,g=function(M){var D=M*y,A=_4(v),N=l/(n*b)*(A*t$(t*D+v)-J9(v));return[a+N*d,c+N*p,l*A/_4(t*D+v)]}}return g.duration=y*1e3*t/Math.SQRT2,g}return i.rho=function(o){var s=Math.max(.001,+o),a=s*s,c=a*a;return e(s,a,c)},i}(Math.SQRT2,2,4);function v4(e){return function(t,n){var r=e((t=pd(t)).h,(n=pd(n)).h),i=Se(t.s,n.s),o=Se(t.l,n.l),s=Se(t.opacity,n.opacity);return function(a){return t.h=r(a),t.s=i(a),t.l=o(a),t.opacity=s(a),t+""}}}var vv=v4(iu),e$=v4(Se);function sg(e,t){var n=Se((e=nu(e)).l,(t=nu(t)).l),r=Se(e.a,t.a),i=Se(e.b,t.b),o=Se(e.opacity,t.opacity);return function(s){return e.l=n(s),e.a=r(s),e.b=i(s),e.opacity=o(s),e+""}}function S4(e){return function(t,n){var r=e((t=md(t)).h,(n=md(n)).h),i=Se(t.c,n.c),o=Se(t.l,n.l),s=Se(t.opacity,n.opacity);return function(a){return t.h=r(a),t.c=i(a),t.l=o(a),t.opacity=s(a),t+""}}}var Sv=S4(iu),n$=S4(Se);function M4(e){return function t(n){n=+n;function r(i,o){var s=e((i=Xn(i)).h,(o=Xn(o)).h),a=Se(i.s,o.s),c=Se(i.l,o.l),l=Se(i.opacity,o.opacity);return function(u){return i.h=s(u),i.s=a(u),i.l=c(Math.pow(u,n)),i.opacity=l(u),i+""}}return r.gamma=t,r}(1)}var r$=M4(iu),ou=M4(Se);function Ji(e,t){t===void 0&&(t=e,e=Er);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(s){var a=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return o[a](s-a)}}function On(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var su=0,xd=0,bd=0,A4=1e3,ag,wd,cg=0,Bc=0,lg=0,_d=typeof performance=="object"&&performance.now?performance:Date,T4=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Sd(){return Bc||(T4(i$),Bc=_d.now()+lg)}function i$(){Bc=0}function vd(){this._call=this._time=this._next=null}vd.prototype=ug.prototype={constructor:vd,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Sd():+n)+(t==null?0:+t),!this._next&&wd!==this&&(wd?wd._next=this:ag=this,wd=this),this._call=e,this._time=n,Mv()},stop:function(){this._call&&(this._call=null,this._time=1/0,Mv())}};function ug(e,t,n){var r=new vd;return r.restart(e,t,n),r}function E4(){Sd(),++su;for(var e=ag,t;e;)(t=Bc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--su}function I4(){Bc=(cg=_d.now())+lg,su=xd=0;try{E4()}finally{su=0,s$(),Bc=0}}function o$(){var e=_d.now(),t=e-cg;t>A4&&(lg-=t,cg=e)}function s$(){for(var e,t=ag,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ag=n);wd=e,Mv(r)}function Mv(e){if(!su){xd&&(xd=clearTimeout(xd));var t=e-Bc;t>24?(e<1/0&&(xd=setTimeout(I4,e-_d.now()-lg)),bd&&(bd=clearInterval(bd))):(bd||(cg=_d.now(),bd=setInterval(o$,A4)),su=1,T4(I4))}}function fg(e,t,n){var r=new vd;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var a$=Mc("start","end","cancel","interrupt"),c$=[],B4=0,D4=1,dg=2,hg=3,N4=4,pg=5,Md=6;function da(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;l$(e,n,{name:t,index:r,group:i,on:a$,tween:c$,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:B4})}function Id(e,t){var n=nn(e,t);if(n.state>B4)throw new Error("too late; already scheduled");return n}function Mn(e,t){var n=nn(e,t);if(n.state>hg)throw new Error("too late; already running");return n}function nn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function l$(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=ug(o,0,n.time);function o(l){n.state=D4,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,f,h,d;if(n.state!==D4)return c();for(u in r)if(d=r[u],d.name===n.name){if(d.state===hg)return fg(s);d.state===N4?(d.state=Md,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete r[u]):+u<t&&(d.state=Md,d.timer.stop(),d.on.call("cancel",e,e.__data__,d.index,d.group),delete r[u])}if(fg(function(){n.state===hg&&(n.state=N4,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=dg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===dg){for(n.state=hg,i=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(d=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=d);i.length=f+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=pg,1),f=-1,h=i.length;++f<h;)i[f].call(e,u);n.state===pg&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Md,n.timer.stop(),delete r[t];for(var l in r)return;delete e.__transition}}function to(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>dg&&r.state<pg,r.state=Md,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function O4(e){return this.each(function(){to(this,e)})}function u$(e,t){var n,r;return function(){var i=Mn(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function f$(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Mn(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=a;break}c===l&&i.push(a)}o.tween=i}}function L4(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=nn(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?u$:f$)(n,e,t))}function au(e,t,n){var r=e._id;return e.each(function(){var i=Mn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return nn(i,r).value[t]}}function mg(e,t){var n;return(typeof t=="number"?xe:t instanceof Tr?Wr:(n=Tr(t))?(t=n,Wr):gd)(e,t)}function h$(e){return function(){this.removeAttribute(e)}}function d$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function p$(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function m$(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function y$(e,t,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a)))}}function g$(e,t,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a)))}}function F4(e,t){var n=ls(e),r=n==="transform"?wv:mg;return this.attrTween(e,typeof t=="function"?(n.local?g$:y$)(n,r,au(this,"attr."+e,t)):t==null?(n.local?d$:h$)(n):(n.local?m$:p$)(n,r,t))}function b$(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function x$(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function w$(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&x$(e,o)),n}return i._value=t,i}function _$(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&b$(e,o)),n}return i._value=t,i}function C4(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ls(e);return this.tween(n,(r.local?w$:_$)(r,t))}function v$(e,t){return function(){Id(this,e).delay=+t.apply(this,arguments)}}function S$(e,t){return t=+t,function(){Id(this,e).delay=t}}function k4(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?v$:S$)(t,e)):nn(this.node(),t).delay}function M$(e,t){return function(){Mn(this,e).duration=+t.apply(this,arguments)}}function I$(e,t){return t=+t,function(){Mn(this,e).duration=t}}function R4(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?M$:I$)(t,e)):nn(this.node(),t).duration}function A$(e,t){if(typeof t!="function")throw new Error;return function(){Mn(this,e).ease=t}}function $4(e){var t=this._id;return arguments.length?this.each(A$(t,e)):nn(this.node(),t).ease}function T$(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Mn(this,e).ease=n}}function U4(e){if(typeof e!="function")throw new Error;return this.each(T$(this._id,e))}function P4(e){typeof e!="function"&&(e=cd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&e.call(c,c.__data__,l,o)&&a.push(c);return new Hn(r,this._parents,this._name,this._id)}function z4(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=t[a],l=n[a],u=c.length,f=s[a]=new Array(u),h,d=0;d<u;++d)(h=c[d]||l[d])&&(f[d]=h);for(;a<r;++a)s[a]=t[a];return new Hn(s,this._parents,this._name,this._id)}function E$(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function D$(e,t,n){var r,i,o=E$(t)?Id:Mn;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function q4(e,t){var n=this._id;return arguments.length<2?nn(this.node(),n).on.on(e):this.each(D$(n,e,t))}function N$(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function V4(){return this.on("end.remove",N$(this._id))}function j4(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ic(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],c=a.length,l=o[s]=new Array(c),u,f,h=0;h<c;++h)(u=a[h])&&(f=e.call(u,u.__data__,h,a))&&("__data__"in u&&(f.__data__=u.__data__),l[h]=f,da(l[h],t,n,h,l,nn(u,n)));return new Hn(o,this._parents,t,n)}function Y4(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ad(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],l=c.length,u,f=0;f<l;++f)if(u=c[f]){for(var h=e.call(u,u.__data__,f,c),d,p=nn(u,n),m=0,g=h.length;m<g;++m)(d=h[m])&&da(d,t,n,m,h,p);o.push(h),s.push(u)}return new Hn(o,s,t,n)}var B$=fs.prototype.constructor;function W4(){return new B$(this._groups,this._parents)}function O$(e,t){var n,r,i;return function(){var o=ua(this,e),s=(this.style.removeProperty(e),ua(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function G4(e){return function(){this.style.removeProperty(e)}}function L$(e,t,n){var r,i=n+"",o;return function(){var s=ua(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function F$(e,t,n){var r,i,o;return function(){var s=ua(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),ua(this,e))),s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a))}}function C$(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var c=Mn(this,e),l=c.on,u=c.value[o]==null?a||(a=G4(t)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function X4(e,t,n){var r=(e+="")=="transform"?xv:mg;return t==null?this.styleTween(e,O$(e,r)).on("end.style."+e,G4(e)):typeof t=="function"?this.styleTween(e,F$(e,r,au(this,"style."+e,t))).each(C$(this._id,e)):this.styleTween(e,L$(e,r,t),n).on("end.style."+e,null)}function k$(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function R$(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&k$(e,s,n)),r}return o._value=t,o}function H4(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,R$(e,t,n??""))}function $$(e){return function(){this.textContent=e}}function U$(e){return function(){var t=e(this);this.textContent=t??""}}function Z4(e){return this.tween("text",typeof e=="function"?U$(au(this,"text",e)):$$(e==null?"":e+""))}function P$(e){return function(t){this.textContent=e.call(this,t)}}function z$(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&P$(i)),t}return r._value=e,r}function K4(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,z$(e))}function Q4(){for(var e=this._name,t=this._id,n=yg(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=nn(c,t);da(c,e,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Hn(r,this._parents,e,n)}function J4(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var l=Mn(this,r),u=l.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),l.on=t}),i===0&&o()})}var q$=0;function Hn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function t8(e){return fs().transition(e)}function yg(){return++q$}var ps=fs.prototype;Hn.prototype=t8.prototype={constructor:Hn,select:j4,selectAll:Y4,selectChild:ps.selectChild,selectChildren:ps.selectChildren,filter:P4,merge:z4,selection:W4,transition:Q4,call:ps.call,nodes:ps.nodes,node:ps.node,size:ps.size,empty:ps.empty,each:ps.each,on:q4,attr:F4,attrTween:C4,style:X4,styleTween:H4,text:Z4,textTween:K4,remove:V4,tween:L4,delay:k4,duration:R4,ease:$4,easeVarying:U4,end:J4,[Symbol.iterator]:ps[Symbol.iterator]};function gg(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var V$={time:null,delay:0,duration:250,ease:gg};function j$(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function e8(e){var t,n;e instanceof Hn?(t=e._id,e=e._name):(t=yg(),(n=V$).time=Sd(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&da(c,e,t,l,s,n||j$(c,t));return new Hn(r,this._parents,e,t)}fs.prototype.interrupt=O4;fs.prototype.transition=e8;var bg=e=>()=>e;function Iv(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function n8(e){e.stopImmediatePropagation()}function xg(e){e.preventDefault(),e.stopImmediatePropagation()}var r8={name:"drag"},Av={name:"space"},cu={name:"handle"},lu={name:"center"},{abs:i8,max:Ln,min:Fn}=Math;function o8(e){return[+e[0],+e[1]]}function Ev(e){return[o8(e[0]),o8(e[1])]}var wg={name:"x",handles:["w","e"].map(Ad),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},_g={name:"y",handles:["n","s"].map(Ad),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},Y$={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ad),input:function(e){return e==null?null:Ev(e)},output:function(e){return e}},ms={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"},s8={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},a8={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},W$={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},G$={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ad(e){return{type:e}}function X$(e){return!e.ctrlKey&&!e.button}function H$(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function Z$(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tv(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function K$(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Dv(){return Ov(wg)}function Nv(){return Ov(_g)}function Bv(){return Ov(Y$)}function Ov(e){var t=H$,n=X$,r=Z$,i=!0,o=Mc("start","brush","end"),s=6,a;function c(g){var y=g.property("__brush",m).selectAll(".overlay").data([Ad("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",ms.overlay).merge(y).each(function(){var x=Tv(this).extent;Pt(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),g.selectAll(".selection").data([Ad("selection")]).enter().append("rect").attr("class","selection").attr("cursor",ms.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=g.selectAll(".handle").data(e.handles,function(x){return x.type});b.exit().remove(),b.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return ms[x.type]}),g.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(g,y,b){g.tween?g.on("start.brush",function(x){u(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){u(this,arguments).end(x)}).tween("brush",function(){var x=this,w=x.__brush,v=u(x,arguments),_=w.selection,M=e.input(typeof y=="function"?y.apply(this,arguments):y,w.extent),D=Er(_,M);function A(N){w.selection=N===1&&M===null?null:D(N),l.call(x),v.brush()}return _!==null&&M!==null?A:A(1)}):g.each(function(){var x=this,w=arguments,v=x.__brush,_=e.input(typeof y=="function"?y.apply(x,w):y,v.extent),M=u(x,w).beforestart();to(x),v.selection=_===null?null:_,l.call(x),M.start(b).brush(b).end(b)})},c.clear=function(g,y){c.move(g,null,y)};function l(){var g=Pt(this),y=Tv(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(b){return b.type[b.type.length-1]==="e"?y[1][0]-s/2:y[0][0]-s/2}).attr("y",function(b){return b.type[0]==="s"?y[1][1]-s/2:y[0][1]-s/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?y[1][0]-y[0][0]+s:s}).attr("height",function(b){return b.type==="e"||b.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,b){var x=g.__brush.emitter;return x&&(!b||!x.clean)?x:new f(g,y,b)}function f(g,y,b){this.that=g,this.args=y,this.state=g.__brush,this.active=0,this.clean=b}f.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,b){var x=Pt(this.that).datum();o.call(g,this.that,new Iv(g,{sourceEvent:y,target:c,selection:e.output(this.state.selection),mode:b,dispatch:o}),x)}};function h(g){if(a&&!g.touches||!n.apply(this,arguments))return;var y=this,b=g.target.__data__.type,x=(i&&g.metaKey?b="overlay":b)==="selection"?r8:i&&g.altKey?lu:cu,w=e===_g?null:W$[b],v=e===wg?null:G$[b],_=Tv(y),M=_.extent,D=_.selection,A=M[0][0],N,T,B=M[0][1],L,S,I=M[1][0],E,C,k=M[1][1],F,R,$=0,U=0,G,J=w&&v&&i&&g.shiftKey,et,st,j=Array.from(g.touches||[g],tt=>{let ie=tt.identifier;return tt=Bn(tt,y),tt.point0=tt.slice(),tt.identifier=ie,tt});to(y);var nt=u(y,arguments,!0).beforestart();if(b==="overlay"){D&&(G=!0);let tt=[j[0],j[1]||j[0]];_.selection=D=[[N=e===_g?A:Fn(tt[0][0],tt[1][0]),L=e===wg?B:Fn(tt[0][1],tt[1][1])],[E=e===_g?I:Ln(tt[0][0],tt[1][0]),F=e===wg?k:Ln(tt[0][1],tt[1][1])]],j.length>1&&Ot(g)}else N=D[0][0],L=D[0][1],E=D[1][0],F=D[1][1];T=N,S=L,C=E,R=F;var z=Pt(y).attr("pointer-events","none"),X=z.selectAll(".overlay").attr("cursor",ms[b]);if(g.touches)nt.moved=P,nt.ended=ft;else{var rt=Pt(g.view).on("mousemove.brush",P,!0).on("mouseup.brush",ft,!0);i&&rt.on("keydown.brush",Yt,!0).on("keyup.brush",Wt,!0),ud(g.view)}l.call(y),nt.start(g,x.name);function P(tt){for(let ie of tt.changedTouches||[tt])for(let yr of j)yr.identifier===ie.identifier&&(yr.cur=Bn(ie,y));if(J&&!et&&!st&&j.length===1){let ie=j[0];i8(ie.cur[0]-ie[0])>i8(ie.cur[1]-ie[1])?st=!0:et=!0}for(let ie of j)ie.cur&&(ie[0]=ie.cur[0],ie[1]=ie.cur[1]);G=!0,xg(tt),Ot(tt)}function Ot(tt){let ie=j[0],yr=ie.point0;var Ci;switch($=ie[0]-yr[0],U=ie[1]-yr[1],x){case Av:case r8:{w&&($=Ln(A-N,Fn(I-E,$)),T=N+$,C=E+$),v&&(U=Ln(B-L,Fn(k-F,U)),S=L+U,R=F+U);break}case cu:{j[1]?(w&&(T=Ln(A,Fn(I,j[0][0])),C=Ln(A,Fn(I,j[1][0])),w=1),v&&(S=Ln(B,Fn(k,j[0][1])),R=Ln(B,Fn(k,j[1][1])),v=1)):(w<0?($=Ln(A-N,Fn(I-N,$)),T=N+$,C=E):w>0&&($=Ln(A-E,Fn(I-E,$)),T=N,C=E+$),v<0?(U=Ln(B-L,Fn(k-L,U)),S=L+U,R=F):v>0&&(U=Ln(B-F,Fn(k-F,U)),S=L,R=F+U));break}case lu:{w&&(T=Ln(A,Fn(I,N-$*w)),C=Ln(A,Fn(I,E+$*w))),v&&(S=Ln(B,Fn(k,L-U*v)),R=Ln(B,Fn(k,F+U*v)));break}}C<T&&(w*=-1,Ci=N,N=E,E=Ci,Ci=T,T=C,C=Ci,b in s8&&X.attr("cursor",ms[b=s8[b]])),R<S&&(v*=-1,Ci=L,L=F,F=Ci,Ci=S,S=R,R=Ci,b in a8&&X.attr("cursor",ms[b=a8[b]])),_.selection&&(D=_.selection),et&&(T=D[0][0],C=D[1][0]),st&&(S=D[0][1],R=D[1][1]),(D[0][0]!==T||D[0][1]!==S||D[1][0]!==C||D[1][1]!==R)&&(_.selection=[[T,S],[C,R]],l.call(y),nt.brush(tt,x.name))}function ft(tt){if(n8(tt),tt.touches){if(tt.touches.length)return;a&&clearTimeout(a),a=setTimeout(function(){a=null},500)}else fd(tt.view,G),rt.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);z.attr("pointer-events","all"),X.attr("cursor",ms.overlay),_.selection&&(D=_.selection),K$(D)&&(_.selection=null,l.call(y)),nt.end(tt,x.name)}function Yt(tt){switch(tt.keyCode){case 16:{J=w&&v;break}case 18:{x===cu&&(w&&(E=C-$*w,N=T+$*w),v&&(F=R-U*v,L=S+U*v),x=lu,Ot(tt));break}case 32:{(x===cu||x===lu)&&(w<0?E=C-$:w>0&&(N=T-$),v<0?F=R-U:v>0&&(L=S-U),x=Av,X.attr("cursor",ms.selection),Ot(tt));break}default:return}xg(tt)}function Wt(tt){switch(tt.keyCode){case 16:{J&&(et=st=J=!1,Ot(tt));break}case 18:{x===lu&&(w<0?E=C:w>0&&(N=T),v<0?F=R:v>0&&(L=S),x=cu,Ot(tt));break}case 32:{x===Av&&(tt.altKey?(w&&(E=C-$*w,N=T+$*w),v&&(F=R-U*v,L=S+U*v),x=lu):(w<0?E=C:w>0&&(N=T),v<0?F=R:v>0&&(L=S),x=cu),X.attr("cursor",ms[b]),Ot(tt));break}default:return}xg(tt)}}function d(g){u(this,arguments).moved(g)}function p(g){u(this,arguments).ended(g)}function m(){var g=this.__brush||{selection:null};return g.extent=Ev(t.apply(this,arguments)),g.dim=e,g}return c.extent=function(g){return arguments.length?(t=typeof g=="function"?g:bg(Ev(g)),c):t},c.filter=function(g){return arguments.length?(n=typeof g=="function"?g:bg(!!g),c):n},c.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:bg(!!g),c):r},c.handleSize=function(g){return arguments.length?(s=+g,c):s},c.keyModifiers=function(g){return arguments.length?(i=!!g,c):i},c.on=function(){var g=o.on.apply(o,arguments);return g===o?c:g},c}var Lv=Math.PI,Fv=2*Lv,Oc=1e-6,Q$=Fv-Oc;function c8(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function J$(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return c8;let n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}var pa=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?c8:J$(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,c=r-t,l=i-n,u=s-t,f=a-n,h=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Oc)if(!(Math.abs(f*c-l*u)>Oc)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let d=r-s,p=i-a,m=c*c+l*l,g=d*d+p*p,y=Math.sqrt(m),b=Math.sqrt(h),x=o*Math.tan((Lv-Math.acos((m+h-g)/(2*y*b)))/2),w=x/b,v=x/y;Math.abs(w-1)>Oc&&this._append`L${t+w*u},${n+w*f}`,this._append`A${o},${o},0,0,${+(f*d>u*p)},${this._x1=t+v*c},${this._y1=n+v*l}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),c=r*Math.sin(i),l=t+a,u=n+c,f=1^s,h=s?i-o:o-i;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>Oc||Math.abs(this._y1-u)>Oc)&&this._append`L${l},${u}`,r&&(h<0&&(h=h%Fv+Fv),h>Q$?this._append`A${r},${r},0,1,${f},${t-a},${n-c}A${r},${r},0,1,${f},${this._x1=l},${this._y1=u}`:h>Oc&&this._append`A${r},${r},0,${+(h>=Lv)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function l8(){return new pa}l8.prototype=pa.prototype;function Zn(e=3){return new pa(+e)}var tU=Array.prototype,vg=tU.slice;function u8(e,t){return e-t}function f8(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r}var eo=e=>()=>e;function h8(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=eU(e,t[n]))return i;return 0}function eU(e,t){for(var n=t[0],r=t[1],i=-1,o=0,s=e.length,a=s-1;o<s;a=o++){var c=e[o],l=c[0],u=c[1],f=e[a],h=f[0],d=f[1];if(nU(c,f,t))return 0;u>r!=d>r&&n<(h-l)*(r-u)/(d-u)+l&&(i=-i)}return i}function nU(e,t,n){var r;return rU(e,t,n)&&iU(e[r=+(e[0]===t[0])],n[r],t[r])}function rU(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function iU(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function d8(){}var ys=[[],[[[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 ma(){var e=1,t=1,n=ca,r=c;function i(l){var u=n(l);if(Array.isArray(u))u=u.slice().sort(u8);else{let f=se(l,oU);for(u=vn(...Kl(f[0],f[1],u),u);u[u.length-1]>=f[1];)u.pop();for(;u[1]<f[0];)u.shift()}return u.map(f=>o(l,f))}function o(l,u){let f=u==null?NaN:+u;if(isNaN(f))throw new Error(`invalid value: ${u}`);var h=[],d=[];return s(l,f,function(p){r(p,l,f),f8(p)>0?h.push([p]):d.push(p)}),d.forEach(function(p){for(var m=0,g=h.length,y;m<g;++m)if(h8((y=h[m])[0],p)!==-1){y.push(p);return}}),{type:"MultiPolygon",value:u,coordinates:h}}function s(l,u,f){var h=new Array,d=new Array,p,m,g,y,b,x;for(p=m=-1,y=Lc(l[0],u),ys[y<<1].forEach(w);++p<e-1;)g=y,y=Lc(l[p+1],u),ys[g|y<<1].forEach(w);for(ys[y<<0].forEach(w);++m<t-1;){for(p=-1,y=Lc(l[m*e+e],u),b=Lc(l[m*e],u),ys[y<<1|b<<2].forEach(w);++p<e-1;)g=y,y=Lc(l[m*e+e+p+1],u),x=b,b=Lc(l[m*e+p+1],u),ys[g|y<<1|b<<2|x<<3].forEach(w);ys[y|b<<3].forEach(w)}for(p=-1,b=l[m*e]>=u,ys[b<<2].forEach(w);++p<e-1;)x=b,b=Lc(l[m*e+p+1],u),ys[b<<2|x<<3].forEach(w);ys[b<<3].forEach(w);function w(v){var _=[v[0][0]+p,v[0][1]+m],M=[v[1][0]+p,v[1][1]+m],D=a(_),A=a(M),N,T;(N=d[D])?(T=h[A])?(delete d[N.end],delete h[T.start],N===T?(N.ring.push(M),f(N.ring)):h[N.start]=d[T.end]={start:N.start,end:T.end,ring:N.ring.concat(T.ring)}):(delete d[N.end],N.ring.push(M),d[N.end=A]=N):(N=h[A])?(T=d[D])?(delete h[N.start],delete d[T.end],N===T?(N.ring.push(M),f(N.ring)):h[T.start]=d[N.end]={start:T.start,end:N.end,ring:T.ring.concat(N.ring)}):(delete h[N.start],N.ring.unshift(_),h[N.start=D]=N):h[D]=d[A]={start:D,end:A,ring:[_,M]}}}function a(l){return l[0]*2+l[1]*(e+1)*4}function c(l,u,f){l.forEach(function(h){var d=h[0],p=h[1],m=d|0,g=p|0,y=Cv(u[g*e+m]);d>0&&d<e&&m===d&&(h[0]=p8(d,Cv(u[g*e+m-1]),y,f)),p>0&&p<t&&g===p&&(h[1]=p8(p,Cv(u[(g-1)*e+m]),y,f))})}return i.contour=o,i.size=function(l){if(!arguments.length)return[e,t];var u=Math.floor(l[0]),f=Math.floor(l[1]);if(!(u>=0&&f>=0))throw new Error("invalid size");return e=u,t=f,i},i.thresholds=function(l){return arguments.length?(n=typeof l=="function"?l:Array.isArray(l)?eo(vg.call(l)):eo(l),i):n},i.smooth=function(l){return arguments.length?(r=l?c:d8,i):r===c},i}function oU(e){return isFinite(e)?e:NaN}function Lc(e,t){return e==null?!1:+e>=t}function Cv(e){return e==null||isNaN(e=+e)?-1/0:e}function p8(e,t,n,r){let i=r-t,o=n-t,s=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(s)?e:e+s-.5}function sU(e){return e[0]}function aU(e){return e[1]}function cU(){return 1}function kv(){var e=sU,t=aU,n=cU,r=960,i=500,o=20,s=2,a=o*3,c=r+a*2>>s,l=i+a*2>>s,u=eo(20);function f(b){var x=new Float32Array(c*l),w=Math.pow(2,-s),v=-1;for(let L of b){var _=(e(L,++v,b)+a)*w,M=(t(L,v,b)+a)*w,D=+n(L,v,b);if(D&&_>=0&&_<c&&M>=0&&M<l){var A=Math.floor(_),N=Math.floor(M),T=_-A-.5,B=M-N-.5;x[A+N*c]+=(1-T)*(1-B)*D,x[A+1+N*c]+=T*(1-B)*D,x[A+1+(N+1)*c]+=T*B*D,x[A+(N+1)*c]+=(1-T)*B*D}}return ed({data:x,width:c,height:l},o*w),x}function h(b){var x=f(b),w=u(x),v=Math.pow(2,2*s);return Array.isArray(w)||(w=vn(Number.MIN_VALUE,jt(x)/v,w)),ma().size([c,l]).thresholds(w.map(_=>_*v))(x).map((_,M)=>(_.value=+w[M],d(_)))}h.contours=function(b){var x=f(b),w=ma().size([c,l]),v=Math.pow(2,2*s),_=M=>{M=+M;var D=d(w.contour(x,M*v));return D.value=M,D};return Object.defineProperty(_,"max",{get:()=>jt(x)/v}),_};function d(b){return b.coordinates.forEach(p),b}function p(b){b.forEach(m)}function m(b){b.forEach(g)}function g(b){b[0]=b[0]*Math.pow(2,s)-a,b[1]=b[1]*Math.pow(2,s)-a}function y(){return a=o*3,c=r+a*2>>s,l=i+a*2>>s,h}return h.x=function(b){return arguments.length?(e=typeof b=="function"?b:eo(+b),h):e},h.y=function(b){return arguments.length?(t=typeof b=="function"?b:eo(+b),h):t},h.weight=function(b){return arguments.length?(n=typeof b=="function"?b:eo(+b),h):n},h.size=function(b){if(!arguments.length)return[r,i];var x=+b[0],w=+b[1];if(!(x>=0&&w>=0))throw new Error("invalid size");return r=x,i=w,y()},h.cellSize=function(b){if(!arguments.length)return 1<<s;if(!((b=+b)>=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(b)/Math.LN2),y()},h.thresholds=function(b){return arguments.length?(u=typeof b=="function"?b:Array.isArray(b)?eo(vg.call(b)):eo(b),h):u},h.bandwidth=function(b){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((b=+b)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*b*b+1)-1)/2,y()},h}var Zt=11102230246251565e-32,Ye=134217729,Td=(3+8*Zt)*Zt;function Fc(e,t,n,r,i){let o,s,a,c,l=t[0],u=r[0],f=0,h=0;u>l==u>-l?(o=l,l=t[++f]):(o=u,u=r[++h]);let d=0;if(f<e&&h<n)for(u>l==u>-l?(s=l+o,a=o-(s-l),l=t[++f]):(s=u+o,a=o-(s-u),u=r[++h]),o=s,a!==0&&(i[d++]=a);f<e&&h<n;)u>l==u>-l?(s=o+l,c=s-o,a=o-(s-c)+(l-c),l=t[++f]):(s=o+u,c=s-o,a=o-(s-c)+(u-c),u=r[++h]),o=s,a!==0&&(i[d++]=a);for(;f<e;)s=o+l,c=s-o,a=o-(s-c)+(l-c),l=t[++f],o=s,a!==0&&(i[d++]=a);for(;h<n;)s=o+u,c=s-o,a=o-(s-c)+(u-c),u=r[++h],o=s,a!==0&&(i[d++]=a);return(o!==0||d===0)&&(i[d++]=o),d}function Ed(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function V(e){return new Float64Array(e)}var lU=(3+16*Zt)*Zt,uU=(2+12*Zt)*Zt,fU=(9+64*Zt)*Zt*Zt,uu=V(4),m8=V(8),y8=V(12),g8=V(16),Kn=V(4);function hU(e,t,n,r,i,o,s){let a,c,l,u,f,h,d,p,m,g,y,b,x,w,v,_,M,D,A=e-i,N=n-i,T=t-o,B=r-o;w=A*B,h=Ye*A,d=h-(h-A),p=A-d,h=Ye*B,m=h-(h-B),g=B-m,v=p*g-(w-d*m-p*m-d*g),_=T*N,h=Ye*T,d=h-(h-T),p=T-d,h=Ye*N,m=h-(h-N),g=N-m,M=p*g-(_-d*m-p*m-d*g),y=v-M,f=v-y,uu[0]=v-(y+f)+(f-M),b=w+y,f=b-w,x=w-(b-f)+(y-f),y=x-_,f=x-y,uu[1]=x-(y+f)+(f-_),D=b+y,f=D-b,uu[2]=b-(D-f)+(y-f),uu[3]=D;let L=Ed(4,uu),S=uU*s;if(L>=S||-L>=S||(f=e-A,a=e-(A+f)+(f-i),f=n-N,l=n-(N+f)+(f-i),f=t-T,c=t-(T+f)+(f-o),f=r-B,u=r-(B+f)+(f-o),a===0&&c===0&&l===0&&u===0)||(S=fU*s+Td*Math.abs(L),L+=A*u+B*a-(T*l+N*c),L>=S||-L>=S))return L;w=a*B,h=Ye*a,d=h-(h-a),p=a-d,h=Ye*B,m=h-(h-B),g=B-m,v=p*g-(w-d*m-p*m-d*g),_=c*N,h=Ye*c,d=h-(h-c),p=c-d,h=Ye*N,m=h-(h-N),g=N-m,M=p*g-(_-d*m-p*m-d*g),y=v-M,f=v-y,Kn[0]=v-(y+f)+(f-M),b=w+y,f=b-w,x=w-(b-f)+(y-f),y=x-_,f=x-y,Kn[1]=x-(y+f)+(f-_),D=b+y,f=D-b,Kn[2]=b-(D-f)+(y-f),Kn[3]=D;let I=Fc(4,uu,4,Kn,m8);w=A*u,h=Ye*A,d=h-(h-A),p=A-d,h=Ye*u,m=h-(h-u),g=u-m,v=p*g-(w-d*m-p*m-d*g),_=T*l,h=Ye*T,d=h-(h-T),p=T-d,h=Ye*l,m=h-(h-l),g=l-m,M=p*g-(_-d*m-p*m-d*g),y=v-M,f=v-y,Kn[0]=v-(y+f)+(f-M),b=w+y,f=b-w,x=w-(b-f)+(y-f),y=x-_,f=x-y,Kn[1]=x-(y+f)+(f-_),D=b+y,f=D-b,Kn[2]=b-(D-f)+(y-f),Kn[3]=D;let E=Fc(I,m8,4,Kn,y8);w=a*u,h=Ye*a,d=h-(h-a),p=a-d,h=Ye*u,m=h-(h-u),g=u-m,v=p*g-(w-d*m-p*m-d*g),_=c*l,h=Ye*c,d=h-(h-c),p=c-d,h=Ye*l,m=h-(h-l),g=l-m,M=p*g-(_-d*m-p*m-d*g),y=v-M,f=v-y,Kn[0]=v-(y+f)+(f-M),b=w+y,f=b-w,x=w-(b-f)+(y-f),y=x-_,f=x-y,Kn[1]=x-(y+f)+(f-_),D=b+y,f=D-b,Kn[2]=b-(D-f)+(y-f),Kn[3]=D;let C=Fc(E,y8,4,Kn,g8);return g8[C-1]}function fu(e,t,n,r,i,o){let s=(t-o)*(n-i),a=(e-i)*(r-o),c=s-a,l=Math.abs(s+a);return Math.abs(c)>=lU*l?c:-hU(e,t,n,r,i,o,l)}var Imt=(7+56*Zt)*Zt,Amt=(3+28*Zt)*Zt,Tmt=(26+288*Zt)*Zt*Zt,Emt=V(4),Dmt=V(4),Nmt=V(4),Bmt=V(4),Omt=V(4),Lmt=V(4),Fmt=V(4),Cmt=V(4),kmt=V(4),Rmt=V(8),$mt=V(8),Umt=V(8),Pmt=V(4),zmt=V(8),qmt=V(8),Vmt=V(8),jmt=V(12),Ymt=V(192),Wmt=V(192);var Hmt=(10+96*Zt)*Zt,Zmt=(4+48*Zt)*Zt,Kmt=(44+576*Zt)*Zt*Zt,Qmt=V(4),Jmt=V(4),tyt=V(4),eyt=V(4),nyt=V(4),ryt=V(4),iyt=V(4),oyt=V(4),syt=V(8),ayt=V(8),cyt=V(8),lyt=V(8),uyt=V(8),fyt=V(8),hyt=V(8),dyt=V(8),pyt=V(8),myt=V(4),yyt=V(4),gyt=V(4),byt=V(8),xyt=V(16),wyt=V(16),_yt=V(16),vyt=V(32),Syt=V(32),Myt=V(48),Iyt=V(64),Ayt=V(1152),Tyt=V(1152);var Byt=(16+224*Zt)*Zt,Oyt=(5+72*Zt)*Zt,Lyt=(71+1408*Zt)*Zt*Zt,Fyt=V(4),Cyt=V(4),kyt=V(4),Ryt=V(4),$yt=V(4),Uyt=V(4),Pyt=V(4),zyt=V(4),qyt=V(4),Vyt=V(4),jyt=V(24),Yyt=V(24),Wyt=V(24),Gyt=V(24),Xyt=V(24),Hyt=V(24),Zyt=V(24),Kyt=V(24),Qyt=V(24),Jyt=V(24),t0t=V(1152),e0t=V(1152),n0t=V(1152),r0t=V(1152),i0t=V(1152),o0t=V(2304),s0t=V(2304),a0t=V(3456),c0t=V(5760),l0t=V(8),u0t=V(8),f0t=V(8),h0t=V(16),d0t=V(24),p0t=V(48),m0t=V(48),y0t=V(96),g0t=V(192),b0t=V(384),x0t=V(384),w0t=V(384),_0t=V(768);var v0t=V(96),S0t=V(96),M0t=V(96),I0t=V(1152);var x8=Math.pow(2,-52),Sg=new Uint32Array(512),du=class e{static from(t,n=bU,r=xU){let i=t.length,o=new Float64Array(i*2);for(let s=0;s<i;s++){let a=t[s];o[2*s]=n(a),o[2*s+1]=r(a)}return new e(o)}constructor(t){let n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;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:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=t.length>>1,a=1/0,c=1/0,l=-1/0,u=-1/0;for(let A=0;A<s;A++){let N=t[2*A],T=t[2*A+1];N<a&&(a=N),T<c&&(c=T),N>l&&(l=N),T>u&&(u=T),this._ids[A]=A}let f=(a+l)/2,h=(c+u)/2,d,p,m;for(let A=0,N=1/0;A<s;A++){let T=Rv(f,h,t[2*A],t[2*A+1]);T<N&&(d=A,N=T)}let g=t[2*d],y=t[2*d+1];for(let A=0,N=1/0;A<s;A++){if(A===d)continue;let T=Rv(g,y,t[2*A],t[2*A+1]);T<N&&T>0&&(p=A,N=T)}let b=t[2*p],x=t[2*p+1],w=1/0;for(let A=0;A<s;A++){if(A===d||A===p)continue;let N=yU(g,y,b,x,t[2*A],t[2*A+1]);N<w&&(m=A,w=N)}let v=t[2*m],_=t[2*m+1];if(w===1/0){for(let T=0;T<s;T++)this._dists[T]=t[2*T]-t[0]||t[2*T+1]-t[1];hu(this._ids,this._dists,0,s-1);let A=new Uint32Array(s),N=0;for(let T=0,B=-1/0;T<s;T++){let L=this._ids[T],S=this._dists[L];S>B&&(A[N++]=L,B=S)}this.hull=A.subarray(0,N),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(fu(g,y,b,x,v,_)<0){let A=p,N=b,T=x;p=m,b=v,x=_,m=A,v=N,_=T}let M=gU(g,y,b,x,v,_);this._cx=M.x,this._cy=M.y;for(let A=0;A<s;A++)this._dists[A]=Rv(t[2*A],t[2*A+1],M.x,M.y);hu(this._ids,this._dists,0,s-1),this._hullStart=d;let D=3;r[d]=n[m]=p,r[p]=n[d]=m,r[m]=n[p]=d,i[d]=0,i[p]=1,i[m]=2,o.fill(-1),o[this._hashKey(g,y)]=d,o[this._hashKey(b,x)]=p,o[this._hashKey(v,_)]=m,this.trianglesLen=0,this._addTriangle(d,p,m,-1,-1,-1);for(let A=0,N,T;A<this._ids.length;A++){let B=this._ids[A],L=t[2*B],S=t[2*B+1];if(A>0&&Math.abs(L-N)<=x8&&Math.abs(S-T)<=x8||(N=L,T=S,B===d||B===p||B===m))continue;let I=0;for(let R=0,$=this._hashKey(L,S);R<this._hashSize&&(I=o[($+R)%this._hashSize],!(I!==-1&&I!==r[I]));R++);I=n[I];let E=I,C;for(;C=r[E],fu(L,S,t[2*E],t[2*E+1],t[2*C],t[2*C+1])>=0;)if(E=C,E===I){E=-1;break}if(E===-1)continue;let k=this._addTriangle(E,B,r[E],-1,-1,i[E]);i[B]=this._legalize(k+2),i[E]=k,D++;let F=r[E];for(;C=r[F],fu(L,S,t[2*F],t[2*F+1],t[2*C],t[2*C+1])<0;)k=this._addTriangle(F,B,C,i[B],-1,i[F]),i[B]=this._legalize(k+2),r[F]=F,D--,F=C;if(E===I)for(;C=n[E],fu(L,S,t[2*C],t[2*C+1],t[2*E],t[2*E+1])<0;)k=this._addTriangle(C,B,E,-1,i[E],i[C]),this._legalize(k+2),i[C]=k,r[E]=E,D--,E=C;this._hullStart=n[B]=E,r[E]=n[F]=B,r[B]=F,o[this._hashKey(L,S)]=B,o[this._hashKey(t[2*E],t[2*E+1])]=E}this.hull=new Uint32Array(D);for(let A=0,N=this._hullStart;A<D;A++)this.hull[A]=N,N=r[N];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(pU(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){let{_triangles:n,_halfedges:r,coords:i}=this,o=0,s=0;for(;;){let a=r[t],c=t-t%3;if(s=c+(t+2)%3,a===-1){if(o===0)break;t=Sg[--o];continue}let l=a-a%3,u=c+(t+1)%3,f=l+(a+2)%3,h=n[s],d=n[t],p=n[u],m=n[f];if(mU(i[2*h],i[2*h+1],i[2*d],i[2*d+1],i[2*p],i[2*p+1],i[2*m],i[2*m+1])){n[t]=m,n[a]=h;let y=r[f];if(y===-1){let x=this._hullStart;do{if(this._hullTri[x]===f){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,y),this._link(a,r[s]),this._link(s,f);let b=l+(a+1)%3;o<Sg.length&&(Sg[o++]=b)}else{if(o===0)break;t=Sg[--o]}}return s}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,r,i,o,s){let a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=r,this._link(a,i),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}};function pU(e,t){let n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function Rv(e,t,n,r){let i=e-n,o=t-r;return i*i+o*o}function mU(e,t,n,r,i,o,s,a){let c=e-s,l=t-a,u=n-s,f=r-a,h=i-s,d=o-a,p=c*c+l*l,m=u*u+f*f,g=h*h+d*d;return c*(f*g-m*d)-l*(u*g-m*h)+p*(u*d-f*h)<0}function yU(e,t,n,r,i,o){let s=n-e,a=r-t,c=i-e,l=o-t,u=s*s+a*a,f=c*c+l*l,h=.5/(s*l-a*c),d=(l*u-a*f)*h,p=(s*f-c*u)*h;return d*d+p*p}function gU(e,t,n,r,i,o){let s=n-e,a=r-t,c=i-e,l=o-t,u=s*s+a*a,f=c*c+l*l,h=.5/(s*l-a*c),d=e+(l*u-a*f)*h,p=t+(s*f-c*u)*h;return{x:d,y:p}}function hu(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){let o=e[i],s=t[o],a=i-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{let i=n+r>>1,o=n+1,s=r;Dd(e,i,o),t[e[n]]>t[e[r]]&&Dd(e,n,r),t[e[o]]>t[e[r]]&&Dd(e,o,r),t[e[n]]>t[e[o]]&&Dd(e,n,o);let a=e[o],c=t[a];for(;;){do o++;while(t[e[o]]<c);do s--;while(t[e[s]]>c);if(s<o)break;Dd(e,o,s)}e[n+1]=e[s],e[s]=a,r-o+1>=s-n?(hu(e,t,o,r),hu(e,t,n,s-1)):(hu(e,t,n,s-1),hu(e,t,o,r))}}function Dd(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function bU(e){return e[0]}function xU(e){return e[1]}var Gr=class{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;let i=t+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>1e-6||Math.abs(this._y1-o)>1e-6)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}};var ya=class{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}};var Nd=class{constructor(t,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this,o,s,a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let m=0,g=0,y=r.length,b,x;m<y;m+=3,g+=2){let w=r[m]*2,v=r[m+1]*2,_=r[m+2]*2,M=t[w],D=t[w+1],A=t[v],N=t[v+1],T=t[_],B=t[_+1],L=A-M,S=N-D,I=T-M,E=B-D,C=(L*E-S*I)*2;if(Math.abs(C)<1e-9){if(o===void 0){o=s=0;for(let F of n)o+=t[F*2],s+=t[F*2+1];o/=n.length,s/=n.length}let k=1e9*Math.sign((o-M)*E-(s-D)*I);b=(M+T)/2-k*E,x=(D+B)/2+k*I}else{let k=1/C,F=L*L+S*S,R=I*I+E*E;b=M+(E*F-S*R)*k,x=D+(L*R-I*F)*k}a[g]=b,a[g+1]=x}let c=n[n.length-1],l,u=c*4,f,h=t[2*c],d,p=t[2*c+1];i.fill(0);for(let m=0;m<n.length;++m)c=n[m],l=u,f=h,d=p,u=c*4,h=t[2*c],p=t[2*c+1],i[l+2]=i[u]=d-p,i[l+3]=i[u+1]=h-f}render(t){let n=t==null?t=new Gr:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:s,vectors:a}=this;if(o.length<=1)return null;for(let u=0,f=r.length;u<f;++u){let h=r[u];if(h<u)continue;let d=Math.floor(u/3)*2,p=Math.floor(h/3)*2,m=s[d],g=s[d+1],y=s[p],b=s[p+1];this._renderSegment(m,g,y,b,t)}let c,l=o[o.length-1];for(let u=0;u<o.length;++u){c=l,l=o[u];let f=Math.floor(i[l]/3)*2,h=s[f],d=s[f+1],p=c*4,m=this._project(h,d,a[p+2],a[p+3]);m&&this._renderSegment(h,d,m[0],m[1],t)}return n&&n.value()}renderBounds(t){let n=t==null?t=new Gr:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){let r=n==null?n=new Gr:void 0,i=this._clip(t);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let o=i.length;for(;i[0]===i[o-2]&&i[1]===i[o-1]&&o>1;)o-=2;for(let s=2;s<o;s+=2)(i[s]!==i[s-2]||i[s+1]!==i[s-1])&&n.lineTo(i[s],i[s+1]);return n.closePath(),r&&r.value()}*cellPolygons(){let{delaunay:{points:t}}=this;for(let n=0,r=t.length/2;n<r;++n){let i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(t){let n=new ya;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,o){let s,a=this._regioncode(t,n),c=this._regioncode(r,i);a===0&&c===0?(o.moveTo(t,n),o.lineTo(r,i)):(s=this._clipSegment(t,n,r,i,a,c))&&(o.moveTo(s[0],s[1]),o.lineTo(s[2],s[3]))}contains(t,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(t,n,r)===t}*neighbors(t){let n=this._clip(t);if(n)for(let r of this.delaunay.neighbors(t)){let i=this._clip(r);if(i){t:for(let o=0,s=n.length;o<s;o+=2)for(let a=0,c=i.length;a<c;a+=2)if(n[o]===i[a]&&n[o+1]===i[a+1]&&n[(o+2)%s]===i[(a+c-2)%c]&&n[(o+3)%s]===i[(a+c-1)%c]){yield r;break t}}}}_cell(t){let{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,s=r[t];if(s===-1)return null;let a=[],c=s;do{let l=Math.floor(c/3);if(a.push(n[l*2],n[l*2+1]),c=c%3===2?c-2:c+1,o[c]!==t)break;c=i[c]}while(c!==s&&c!==-1);return a}_clip(t){if(t===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(t);if(n===null)return null;let{vectors:r}=this,i=t*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(t,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(t,n))}_clipFinite(t,n){let r=n.length,i=null,o,s,a=n[r-2],c=n[r-1],l,u=this._regioncode(a,c),f,h=0;for(let d=0;d<r;d+=2)if(o=a,s=c,a=n[d],c=n[d+1],l=u,u=this._regioncode(a,c),l===0&&u===0)f=h,h=0,i?i.push(a,c):i=[a,c];else{let p,m,g,y,b;if(l===0){if((p=this._clipSegment(o,s,a,c,l,u))===null)continue;[m,g,y,b]=p}else{if((p=this._clipSegment(a,c,o,s,u,l))===null)continue;[y,b,m,g]=p,f=h,h=this._edgecode(m,g),f&&h&&this._edge(t,f,h,i,i.length),i?i.push(m,g):i=[m,g]}f=h,h=this._edgecode(y,b),f&&h&&this._edge(t,f,h,i,i.length),i?i.push(y,b):i=[y,b]}if(i)f=h,h=this._edgecode(i[0],i[1]),f&&h&&this._edge(t,f,h,i,i.length);else if(this.contains(t,(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 i}_clipSegment(t,n,r,i,o,s){let a=o<s;for(a&&([t,n,r,i,o,s]=[r,i,t,n,s,o]);;){if(o===0&&s===0)return a?[r,i,t,n]:[t,n,r,i];if(o&s)return null;let c,l,u=o||s;u&8?(c=t+(r-t)*(this.ymax-n)/(i-n),l=this.ymax):u&4?(c=t+(r-t)*(this.ymin-n)/(i-n),l=this.ymin):u&2?(l=n+(i-n)*(this.xmax-t)/(r-t),c=this.xmax):(l=n+(i-n)*(this.xmin-t)/(r-t),c=this.xmin),o?(t=c,n=l,o=this._regioncode(t,n)):(r=c,i=l,s=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,o,s){let a=Array.from(n),c;if((c=this._project(a[0],a[1],r,i))&&a.unshift(c[0],c[1]),(c=this._project(a[a.length-2],a[a.length-1],o,s))&&a.push(c[0],c[1]),a=this._clipFinite(t,a))for(let l=0,u=a.length,f,h=this._edgecode(a[u-2],a[u-1]);l<u;l+=2)f=h,h=this._edgecode(a[l],a[l+1]),f&&h&&(l=this._edge(t,f,h,a,l),u=a.length);else this.contains(t,(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(t,n,r,i,o){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}(i[o]!==s||i[o+1]!==a)&&this.contains(t,s,a)&&(i.splice(o,0,s,a),o+=2)}return o}_project(t,n,r,i){let o=1/0,s,a,c;if(i<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/i)<o&&(c=this.ymin,a=t+(o=s)*r)}else if(i>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)<o&&(c=this.ymax,a=t+(o=s)*r)}if(r>0){if(t>=this.xmax)return null;(s=(this.xmax-t)/r)<o&&(a=this.xmax,c=n+(o=s)*i)}else if(r<0){if(t<=this.xmin)return null;(s=(this.xmin-t)/r)<o&&(a=this.xmin,c=n+(o=s)*i)}return[a,c]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){let r=(n+2)%t.length,i=(n+4)%t.length;(t[n]===t[r]&&t[r]===t[i]||t[n+1]===t[r+1]&&t[r+1]===t[i+1])&&(t.splice(r,2),n-=2)}t.length||(t=null)}return t}};var wU=2*Math.PI,pu=Math.pow;function _U(e){return e[0]}function vU(e){return e[1]}function SU(e){let{triangles:t,coords:n}=e;for(let r=0;r<t.length;r+=3){let i=2*t[r],o=2*t[r+1],s=2*t[r+2];if((n[s]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[s+1]-n[i+1])>1e-10)return!1}return!0}function MU(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}var Cn=class e{static from(t,n=_U,r=vU,i){return new e("length"in t?IU(t,n,r,i):Float64Array.from(AU(t,n,r,i)))}constructor(t){this._delaunator=new du(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){let t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&SU(t)){this.collinear=Int32Array.from({length:n.length/2},(h,d)=>d).sort((h,d)=>n[2*h]-n[2*d]||n[2*h+1]-n[2*d+1]);let c=this.collinear[0],l=this.collinear[this.collinear.length-1],u=[n[2*c],n[2*c+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let h=0,d=n.length/2;h<d;++h){let p=MU(n[2*h],n[2*h+1],f);n[2*h]=p[0],n[2*h+1]=p[1]}this._delaunator=new du(n)}else delete this.collinear;let r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let c=0,l=r.length;c<l;++c){let u=o[c%3===2?c-2:c+1];(r[c]===-1||s[u]===-1)&&(s[u]=c)}for(let c=0,l=i.length;c<l;++c)a[i[c]]=c;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,i.length===2&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new Nd(this,t)}*neighbors(t){let{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:s,collinear:a}=this;if(a){let f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}let c=n[t];if(c===-1)return;let l=c,u=-1;do{if(yield u=s[l],l=l%3===2?l-2:l+1,s[l]!==t)return;if(l=o[l],l===-1){let f=r[(i[t]+1)%r.length];f!==u&&(yield f);return}}while(l!==c)}find(t,n,r=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;let i=r,o;for(;(o=this._step(r,t,n))>=0&&o!==r&&o!==i;)r=o;return o}_step(t,n,r){let{inedges:i,hull:o,_hullIndex:s,halfedges:a,triangles:c,points:l}=this;if(i[t]===-1||!l.length)return(t+1)%(l.length>>1);let u=t,f=pu(n-l[t*2],2)+pu(r-l[t*2+1],2),h=i[t],d=h;do{let p=c[d],m=pu(n-l[p*2],2)+pu(r-l[p*2+1],2);if(m<f&&(f=m,u=p),d=d%3===2?d-2:d+1,c[d]!==t)break;if(d=a[d],d===-1){if(d=o[(s[t]+1)%o.length],d!==p&&pu(n-l[d*2],2)+pu(r-l[d*2+1],2)<f)return d;break}}while(d!==h);return u}render(t){let n=t==null?t=new Gr:void 0,{points:r,halfedges:i,triangles:o}=this;for(let s=0,a=i.length;s<a;++s){let c=i[s];if(c<s)continue;let l=o[s]*2,u=o[c]*2;t.moveTo(r[l],r[l+1]),t.lineTo(r[u],r[u+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;let r=t==null?t=new Gr:void 0,{points:i}=this;for(let o=0,s=i.length;o<s;o+=2){let a=i[o],c=i[o+1];t.moveTo(a+n,c),t.arc(a,c,n,0,wU)}return r&&r.value()}renderHull(t){let n=t==null?t=new Gr:void 0,{hull:r,points:i}=this,o=r[0]*2,s=r.length;t.moveTo(i[o],i[o+1]);for(let a=1;a<s;++a){let c=2*r[a];t.lineTo(i[c],i[c+1])}return t.closePath(),n&&n.value()}hullPolygon(){let t=new ya;return this.renderHull(t),t.value()}renderTriangle(t,n){let r=n==null?n=new Gr:void 0,{points:i,triangles:o}=this,s=o[t*=3]*2,a=o[t+1]*2,c=o[t+2]*2;return n.moveTo(i[s],i[s+1]),n.lineTo(i[a],i[a+1]),n.lineTo(i[c],i[c+1]),n.closePath(),r&&r.value()}*trianglePolygons(){let{triangles:t}=this;for(let n=0,r=t.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(t){let n=new ya;return this.renderTriangle(t,n),n.value()}};function IU(e,t,n,r){let i=e.length,o=new Float64Array(i*2);for(let s=0;s<i;++s){let a=e[s];o[s*2]=t.call(r,a,s,e),o[s*2+1]=n.call(r,a,s,e)}return o}function*AU(e,t,n,r){let i=0;for(let o of e)yield t.call(r,o,i,e),yield n.call(r,o,i,e),++i}function w8(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Cc(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function no(e){return e=Cc(Math.abs(e)),e?e[1]:NaN}function _8(e,t){return function(n,r){for(var i=n.length,o=[],s=0,a=e[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),o.push(n.substring(i-=a,i+a)),!((c+=a+1)>r));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function v8(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var TU=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ro(e){if(!(t=TU.exec(e)))throw new Error("invalid format: "+e);var t;return new Mg({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ro.prototype=Mg.prototype;function Mg(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Mg.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 S8(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var $v;function M8(e,t){var n=Cc(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-($v=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Cc(e,Math.max(0,t+o-1))[0]}function Uv(e,t){var n=Cc(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}var Pv={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:w8,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Uv(e*100,t),r:Uv,s:M8,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function zv(e){return e}var I8=Array.prototype.map,A8=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function T8(e){var t=e.grouping===void 0||e.thousands===void 0?zv:_8(I8.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?zv:v8(I8.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"\u2212":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(f){f=ro(f);var h=f.fill,d=f.align,p=f.sign,m=f.symbol,g=f.zero,y=f.width,b=f.comma,x=f.precision,w=f.trim,v=f.type;v==="n"?(b=!0,v="g"):Pv[v]||(x===void 0&&(x=12),w=!0,v="g"),(g||h==="0"&&d==="=")&&(g=!0,h="0",d="=");var _=m==="$"?n:m==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",M=m==="$"?r:/[%p]/.test(v)?s:"",D=Pv[v],A=/[defgprs%]/.test(v);x=x===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function N(T){var B=_,L=M,S,I,E;if(v==="c")L=D(T)+L,T="";else{T=+T;var C=T<0||1/T<0;if(T=isNaN(T)?c:D(Math.abs(T),x),w&&(T=S8(T)),C&&+T==0&&p!=="+"&&(C=!1),B=(C?p==="("?p:a:p==="-"||p==="("?"":p)+B,L=(v==="s"?A8[8+$v/3]:"")+L+(C&&p==="("?")":""),A){for(S=-1,I=T.length;++S<I;)if(E=T.charCodeAt(S),48>E||E>57){L=(E===46?i+T.slice(S+1):T.slice(S))+L,T=T.slice(0,S);break}}}b&&!g&&(T=t(T,1/0));var k=B.length+T.length+L.length,F=k<y?new Array(y-k+1).join(h):"";switch(b&&g&&(T=t(F+T,F.length?y-L.length:1/0),F=""),d){case"<":T=B+T+L+F;break;case"=":T=B+F+T+L;break;case"^":T=F.slice(0,k=F.length>>1)+B+T+L+F.slice(k);break;default:T=F+B+T+L;break}return o(T)}return N.toString=function(){return f+""},N}function u(f,h){var d=l((f=ro(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(no(h)/3)))*3,m=Math.pow(10,-p),g=A8[8+p/3];return function(y){return d(m*y)+g}}return{format:l,formatPrefix:u}}var Ig,Xr,Ag;qv({thousands:",",grouping:[3],currency:["$",""]});function qv(e){return Ig=T8(e),Xr=Ig.format,Ag=Ig.formatPrefix,Ig}function Vv(e){return Math.max(0,-no(Math.abs(e)))}function jv(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(no(t)/3)))*3-no(Math.abs(e)))}function Yv(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,no(t)-no(e))+1}var Q=1e-6,kc=1e-12,Et=Math.PI,he=Et/2,Wv=Et/4,sn=Et*2,Fe=180/Et,zt=Et/180,Ft=Math.abs,Hr=Math.atan,We=Math.atan2,K=Math.cos,Bd=Math.ceil,Tg=Math.exp;var Eg=Math.hypot,Rc=Math.log,Dg=Math.pow,Z=Math.sin,kn=Math.sign||function(e){return e>0?1:e<0?-1:0},de=Math.sqrt,mu=Math.tan;function Ng(e){return e>1?0:e<-1?Et:Math.acos(e)}function we(e){return e>1?he:e<-1?-he:Math.asin(e)}function Ge(){}function Bg(e,t){e&&D8.hasOwnProperty(e.type)&&D8[e.type](e,t)}var E8={Feature:function(e,t){Bg(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Bg(n[r].geometry,t)}},D8={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Gv(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Gv(n[r],t,0)},Polygon:function(e,t){N8(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)N8(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Bg(n[r],t)}};function Gv(e,t,n){var r=-1,i=e.length-n,o;for(t.lineStart();++r<i;)o=e[r],t.point(o[0],o[1],o[2]);t.lineEnd()}function N8(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Gv(e[n],t,1);t.polygonEnd()}function Dr(e,t){e&&E8.hasOwnProperty(e.type)?E8[e.type](e,t):Bg(e,t)}function Od(e){return[We(e[1],e[0]),we(e[2])]}function io(e){var t=e[0],n=e[1],r=K(n);return[r*K(t),r*Z(t),Z(n)]}function Ld(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yu(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Og(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Fd(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Cd(e){var t=de(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var kd,Lg,Fg,Cg,kg,Rg,$g,Ug,Xv,Hv,Zv,L8,F8,Qn,Jn,tr,Ei={sphere:Ge,point:Kv,lineStart:B8,lineEnd:O8,polygonStart:function(){Ei.lineStart=NU,Ei.lineEnd=BU},polygonEnd:function(){Ei.lineStart=B8,Ei.lineEnd=O8}};function Kv(e,t){e*=zt,t*=zt;var n=K(t);Rd(n*K(e),n*Z(e),Z(t))}function Rd(e,t,n){++kd,Fg+=(e-Fg)/kd,Cg+=(t-Cg)/kd,kg+=(n-kg)/kd}function B8(){Ei.point=EU}function EU(e,t){e*=zt,t*=zt;var n=K(t);Qn=n*K(e),Jn=n*Z(e),tr=Z(t),Ei.point=DU,Rd(Qn,Jn,tr)}function DU(e,t){e*=zt,t*=zt;var n=K(t),r=n*K(e),i=n*Z(e),o=Z(t),s=We(de((s=Jn*o-tr*i)*s+(s=tr*r-Qn*o)*s+(s=Qn*i-Jn*r)*s),Qn*r+Jn*i+tr*o);Lg+=s,Rg+=s*(Qn+(Qn=r)),$g+=s*(Jn+(Jn=i)),Ug+=s*(tr+(tr=o)),Rd(Qn,Jn,tr)}function O8(){Ei.point=Kv}function NU(){Ei.point=OU}function BU(){C8(L8,F8),Ei.point=Kv}function OU(e,t){L8=e,F8=t,e*=zt,t*=zt,Ei.point=C8;var n=K(t);Qn=n*K(e),Jn=n*Z(e),tr=Z(t),Rd(Qn,Jn,tr)}function C8(e,t){e*=zt,t*=zt;var n=K(t),r=n*K(e),i=n*Z(e),o=Z(t),s=Jn*o-tr*i,a=tr*r-Qn*o,c=Qn*i-Jn*r,l=Eg(s,a,c),u=we(l),f=l&&-u/l;Xv.add(f*s),Hv.add(f*a),Zv.add(f*c),Lg+=u,Rg+=u*(Qn+(Qn=r)),$g+=u*(Jn+(Jn=i)),Ug+=u*(tr+(tr=o)),Rd(Qn,Jn,tr)}function Qv(e){kd=Lg=Fg=Cg=kg=Rg=$g=Ug=0,Xv=new _n,Hv=new _n,Zv=new _n,Dr(e,Ei);var t=+Xv,n=+Hv,r=+Zv,i=Eg(t,n,r);return i<kc&&(t=Rg,n=$g,r=Ug,Lg<Q&&(t=Fg,n=Cg,r=kg),i=Eg(t,n,r),i<kc)?[NaN,NaN]:[We(n,t)*Fe,we(r/i)*Fe]}function $d(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function Jv(e,t){return Ft(e)>Et&&(e-=Math.round(e/sn)*sn),[e,t]}Jv.invert=Jv;function t2(e,t,n){return(e%=sn)?t||n?$d(R8(e),$8(t,n)):R8(e):t||n?$8(t,n):Jv}function k8(e){return function(t,n){return t+=e,Ft(t)>Et&&(t-=Math.round(t/sn)*sn),[t,n]}}function R8(e){var t=k8(e);return t.invert=k8(-e),t}function $8(e,t){var n=K(e),r=Z(e),i=K(t),o=Z(t);function s(a,c){var l=K(c),u=K(a)*l,f=Z(a)*l,h=Z(c),d=h*n+u*r;return[We(f*i-d*o,u*n-h*r),we(d*i+f*o)]}return s.invert=function(a,c){var l=K(c),u=K(a)*l,f=Z(a)*l,h=Z(c),d=h*i-f*o;return[We(f*i+h*o,u*n+d*r),we(d*n-u*r)]},s}function U8(e){e=t2(e[0]*zt,e[1]*zt,e.length>2?e[2]*zt:0);function t(n){return n=e(n[0]*zt,n[1]*zt),n[0]*=Fe,n[1]*=Fe,n}return t.invert=function(n){return n=e.invert(n[0]*zt,n[1]*zt),n[0]*=Fe,n[1]*=Fe,n},t}function z8(e,t,n,r,i,o){if(n){var s=K(t),a=Z(t),c=r*n;i==null?(i=t+r*sn,o=t-c/2):(i=P8(s,i),o=P8(s,o),(r>0?i<o:i>o)&&(i+=r*sn));for(var l,u=i;r>0?u>o:u<o;u-=c)l=Od([s,-a*K(u),-a*Z(u)]),e.point(l[0],l[1])}}function P8(e,t){t=io(t),t[0]-=e,Cd(t);var n=Ng(-t[1]);return((-t[2]<0?-n:n)+sn-Q)%sn}function Pg(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Ge,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function gu(e,t){return Ft(e[0]-t[0])<Q&&Ft(e[1]-t[1])<Q}function zg(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function qg(e,t,n,r,i){var o=[],s=[],a,c;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,g=p[0],y=p[m],b;if(gu(g,y)){if(!g[2]&&!y[2]){for(i.lineStart(),a=0;a<m;++a)i.point((g=p[a])[0],g[1]);i.lineEnd();return}y[0]+=2*Q}o.push(b=new zg(g,p,null,!0)),s.push(b.o=new zg(g,null,b,!1)),o.push(b=new zg(y,p,null,!1)),s.push(b.o=new zg(y,null,b,!0))}}),!!o.length){for(s.sort(t),q8(o),q8(s),a=0,c=s.length;a<c;++a)s[a].e=n=!n;for(var l=o[0],u,f;;){for(var h=l,d=!0;h.v;)if((h=h.n)===l)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(a=0,c=u.length;a<c;++a)i.point((f=u[a])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(u=h.p.z,a=u.length-1;a>=0;--a)i.point((f=u[a])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,d=!d}while(!h.v);i.lineEnd()}}}function q8(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function e2(e){return Ft(e[0])<=Et?e[0]:kn(e[0])*((Ft(e[0])+Et)%sn-Et)}function V8(e,t){var n=e2(t),r=t[1],i=Z(r),o=[Z(n),-K(n),0],s=0,a=0,c=new _n;i===1?r=he+Q:i===-1&&(r=-he-Q);for(var l=0,u=e.length;l<u;++l)if(h=(f=e[l]).length)for(var f,h,d=f[h-1],p=e2(d),m=d[1]/2+Wv,g=Z(m),y=K(m),b=0;b<h;++b,p=w,g=_,y=M,d=x){var x=f[b],w=e2(x),v=x[1]/2+Wv,_=Z(v),M=K(v),D=w-p,A=D>=0?1:-1,N=A*D,T=N>Et,B=g*_;if(c.add(We(B*A*Z(N),y*M+B*K(N))),s+=T?D+A*sn:D,T^p>=n^w>=n){var L=yu(io(d),io(x));Cd(L);var S=yu(o,L);Cd(S);var I=(T^D>=0?-1:1)*we(S[2]);(r>I||r===I&&(L[0]||L[1]))&&(a+=T^D>=0?1:-1)}}return(s<-Q||s<Q&&c<-kc)^a&1}function Vg(e,t,n,r){return function(i){var o=t(i),s=Pg(),a=t(s),c=!1,l,u,f,h={point:d,lineStart:m,lineEnd:g,polygonStart:function(){h.point=y,h.lineStart=b,h.lineEnd=x,u=[],l=[]},polygonEnd:function(){h.point=d,h.lineStart=m,h.lineEnd=g,u=Ql(u);var w=V8(l,r);u.length?(c||(i.polygonStart(),c=!0),qg(u,FU,w,n,i)):w&&(c||(i.polygonStart(),c=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),c&&(i.polygonEnd(),c=!1),u=l=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(w,v){e(w,v)&&i.point(w,v)}function p(w,v){o.point(w,v)}function m(){h.point=p,o.lineStart()}function g(){h.point=d,o.lineEnd()}function y(w,v){f.push([w,v]),a.point(w,v)}function b(){a.lineStart(),f=[]}function x(){y(f[0][0],f[0][1]),a.lineEnd();var w=a.clean(),v=s.result(),_,M=v.length,D,A,N;if(f.pop(),l.push(f),f=null,!!M){if(w&1){if(A=v[0],(D=A.length-1)>0){for(c||(i.polygonStart(),c=!0),i.lineStart(),_=0;_<D;++_)i.point((N=A[_])[0],N[1]);i.lineEnd()}return}M>1&&w&2&&v.push(v.pop().concat(v.shift())),u.push(v.filter(LU))}}return h}}function LU(e){return e.length>1}function FU(e,t){return((e=e.x)[0]<0?e[1]-he-Q:he-e[1])-((t=t.x)[0]<0?t[1]-he-Q:he-t[1])}var n2=Vg(function(){return!0},CU,RU,[-Et,-he]);function CU(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?Et:-Et,c=Ft(o-t);Ft(c-Et)<Q?(e.point(t,n=(n+s)/2>0?he:-he),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&c>=Et&&(Ft(t-r)<Q&&(t-=r*Q),Ft(o-a)<Q&&(o-=a*Q),n=kU(t,n,o,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),i=0),e.point(t=o,n=s),r=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function kU(e,t,n,r){var i,o,s=Z(e-n);return Ft(s)>Q?Hr((Z(t)*(o=K(r))*Z(n)-Z(r)*(i=K(t))*Z(e))/(i*o*s)):(t+r)/2}function RU(e,t,n,r){var i;if(e==null)i=n*he,r.point(-Et,i),r.point(0,i),r.point(Et,i),r.point(Et,0),r.point(Et,-i),r.point(0,-i),r.point(-Et,-i),r.point(-Et,0),r.point(-Et,i);else if(Ft(e[0]-t[0])>Q){var o=e[0]<t[0]?Et:-Et;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function j8(e){var t=K(e),n=6*zt,r=t>0,i=Ft(t)>Q;function o(u,f,h,d){z8(d,e,n,h,u,f)}function s(u,f){return K(u)*K(f)>t}function a(u){var f,h,d,p,m;return{lineStart:function(){p=d=!1,m=1},point:function(g,y){var b=[g,y],x,w=s(g,y),v=r?w?0:l(g,y):w?l(g+(g<0?Et:-Et),y):0;if(!f&&(p=d=w)&&u.lineStart(),w!==d&&(x=c(f,b),(!x||gu(f,x)||gu(b,x))&&(b[2]=1)),w!==d)m=0,w?(u.lineStart(),x=c(b,f),u.point(x[0],x[1])):(x=c(f,b),u.point(x[0],x[1],2),u.lineEnd()),f=x;else if(i&&f&&r^w){var _;!(v&h)&&(_=c(b,f,!0))&&(m=0,r?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}w&&(!f||!gu(f,b))&&u.point(b[0],b[1]),f=b,d=w,h=v},lineEnd:function(){d&&u.lineEnd(),f=null},clean:function(){return m|(p&&d)<<1}}}function c(u,f,h){var d=io(u),p=io(f),m=[1,0,0],g=yu(d,p),y=Ld(g,g),b=g[0],x=y-b*b;if(!x)return!h&&u;var w=t*y/x,v=-t*b/x,_=yu(m,g),M=Fd(m,w),D=Fd(g,v);Og(M,D);var A=_,N=Ld(M,A),T=Ld(A,A),B=N*N-T*(Ld(M,M)-1);if(!(B<0)){var L=de(B),S=Fd(A,(-N-L)/T);if(Og(S,M),S=Od(S),!h)return S;var I=u[0],E=f[0],C=u[1],k=f[1],F;E<I&&(F=I,I=E,E=F);var R=E-I,$=Ft(R-Et)<Q,U=$||R<Q;if(!$&&k<C&&(F=C,C=k,k=F),U?$?C+k>0^S[1]<(Ft(S[0]-I)<Q?C:k):C<=S[1]&&S[1]<=k:R>Et^(I<=S[0]&&S[0]<=E)){var G=Fd(A,(-N+L)/T);return Og(G,M),[S,Od(G)]}}}function l(u,f){var h=r?e:Et-e,d=0;return u<-h?d|=1:u>h&&(d|=2),f<-h?d|=4:f>h&&(d|=8),d}return Vg(s,a,o,r?[0,-e]:[-Et,e-Et])}function Y8(e,t,n,r,i,o){var s=e[0],a=e[1],c=t[0],l=t[1],u=0,f=1,h=c-s,d=l-a,p;if(p=n-s,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>u&&(u=p)}if(p=i-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<f&&(f=p)}if(p=r-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>u&&(u=p)}if(p=o-a,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<f&&(f=p)}return u>0&&(e[0]=s+u*h,e[1]=a+u*d),f<1&&(t[0]=s+f*h,t[1]=a+f*d),!0}}}}}var Ud=1e9,jg=-Ud;function bu(e,t,n,r){function i(l,u){return e<=l&&l<=n&&t<=u&&u<=r}function o(l,u,f,h){var d=0,p=0;if(l==null||(d=s(l,f))!==(p=s(u,f))||c(l,u)<0^f>0)do h.point(d===0||d===3?e:n,d>1?r:t);while((d=(d+f+4)%4)!==p);else h.point(u[0],u[1])}function s(l,u){return Ft(l[0]-e)<Q?u>0?0:3:Ft(l[0]-n)<Q?u>0?2:1:Ft(l[1]-t)<Q?u>0?1:0:u>0?3:2}function a(l,u){return c(l.x,u.x)}function c(l,u){var f=s(l,1),h=s(u,1);return f!==h?f-h:f===0?u[1]-l[1]:f===1?l[0]-u[0]:f===2?l[1]-u[1]:u[0]-l[0]}return function(l){var u=l,f=Pg(),h,d,p,m,g,y,b,x,w,v,_,M={point:D,lineStart:B,lineEnd:L,polygonStart:N,polygonEnd:T};function D(I,E){i(I,E)&&u.point(I,E)}function A(){for(var I=0,E=0,C=d.length;E<C;++E)for(var k=d[E],F=1,R=k.length,$=k[0],U,G,J=$[0],et=$[1];F<R;++F)U=J,G=et,$=k[F],J=$[0],et=$[1],G<=r?et>r&&(J-U)*(r-G)>(et-G)*(e-U)&&++I:et<=r&&(J-U)*(r-G)<(et-G)*(e-U)&&--I;return I}function N(){u=f,h=[],d=[],_=!0}function T(){var I=A(),E=_&&I,C=(h=Ql(h)).length;(E||C)&&(l.polygonStart(),E&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),C&&qg(h,a,I,o,l),l.polygonEnd()),u=l,h=d=p=null}function B(){M.point=S,d&&d.push(p=[]),v=!0,w=!1,b=x=NaN}function L(){h&&(S(m,g),y&&w&&f.rejoin(),h.push(f.result())),M.point=D,w&&u.lineEnd()}function S(I,E){var C=i(I,E);if(d&&p.push([I,E]),v)m=I,g=E,y=C,v=!1,C&&(u.lineStart(),u.point(I,E));else if(C&&w)u.point(I,E);else{var k=[b=Math.max(jg,Math.min(Ud,b)),x=Math.max(jg,Math.min(Ud,x))],F=[I=Math.max(jg,Math.min(Ud,I)),E=Math.max(jg,Math.min(Ud,E))];Y8(k,F,e,t,n,r)?(w||(u.lineStart(),u.point(k[0],k[1])),u.point(F[0],F[1]),C||u.lineEnd(),_=!1):C&&(u.lineStart(),u.point(I,E),_=!1)}b=I,x=E,w=C}return M}}function W8(e,t,n){var r=Re(e,t-Q,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function G8(e,t,n){var r=Re(e,t-Q,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function r2(){var e,t,n,r,i,o,s,a,c=10,l=c,u=90,f=360,h,d,p,m,g=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Re(Bd(r/u)*u,n,u).map(p).concat(Re(Bd(a/f)*f,s,f).map(m)).concat(Re(Bd(t/c)*c,e,c).filter(function(x){return Ft(x%u)>Q}).map(h)).concat(Re(Bd(o/l)*l,i,l).filter(function(x){return Ft(x%f)>Q}).map(d))}return y.lines=function(){return b().map(function(x){return{type:"LineString",coordinates:x}})},y.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(m(s).slice(1),p(n).reverse().slice(1),m(a).reverse().slice(1))]}},y.extent=function(x){return arguments.length?y.extentMajor(x).extentMinor(x):y.extentMinor()},y.extentMajor=function(x){return arguments.length?(r=+x[0][0],n=+x[1][0],a=+x[0][1],s=+x[1][1],r>n&&(x=r,r=n,n=x),a>s&&(x=a,a=s,s=x),y.precision(g)):[[r,a],[n,s]]},y.extentMinor=function(x){return arguments.length?(t=+x[0][0],e=+x[1][0],o=+x[0][1],i=+x[1][1],t>e&&(x=t,t=e,e=x),o>i&&(x=o,o=i,i=x),y.precision(g)):[[t,o],[e,i]]},y.step=function(x){return arguments.length?y.stepMajor(x).stepMinor(x):y.stepMinor()},y.stepMajor=function(x){return arguments.length?(u=+x[0],f=+x[1],y):[u,f]},y.stepMinor=function(x){return arguments.length?(c=+x[0],l=+x[1],y):[c,l]},y.precision=function(x){return arguments.length?(g=+x,h=W8(o,i,90),d=G8(t,e,g),p=W8(a,s,90),m=G8(r,n,g),y):g},y.extentMajor([[-180,-90+Q],[180,90-Q]]).extentMinor([[-180,-80-Q],[180,80+Q]])}function i2(){return r2()()}var Pd=e=>e;var o2=new _n,s2=new _n,X8,H8,a2,c2,ga={point:Ge,lineStart:Ge,lineEnd:Ge,polygonStart:function(){ga.lineStart=$U,ga.lineEnd=PU},polygonEnd:function(){ga.lineStart=ga.lineEnd=ga.point=Ge,o2.add(Ft(s2)),s2=new _n},result:function(){var e=o2/2;return o2=new _n,e}};function $U(){ga.point=UU}function UU(e,t){ga.point=Z8,X8=a2=e,H8=c2=t}function Z8(e,t){s2.add(c2*e-a2*t),a2=e,c2=t}function PU(){Z8(X8,H8)}var l2=ga;var xu=1/0,Yg=xu,zd=-xu,Wg=zd,zU={point:qU,lineStart:Ge,lineEnd:Ge,polygonStart:Ge,polygonEnd:Ge,result:function(){var e=[[xu,Yg],[zd,Wg]];return zd=Wg=-(Yg=xu=1/0),e}};function qU(e,t){e<xu&&(xu=e),e>zd&&(zd=e),t<Yg&&(Yg=t),t>Wg&&(Wg=t)}var wu=zU;var u2=0,f2=0,qd=0,Gg=0,Xg=0,_u=0,h2=0,d2=0,Vd=0,J8,tE,oo,so,Di={point:$c,lineStart:K8,lineEnd:Q8,polygonStart:function(){Di.lineStart=YU,Di.lineEnd=WU},polygonEnd:function(){Di.point=$c,Di.lineStart=K8,Di.lineEnd=Q8},result:function(){var e=Vd?[h2/Vd,d2/Vd]:_u?[Gg/_u,Xg/_u]:qd?[u2/qd,f2/qd]:[NaN,NaN];return u2=f2=qd=Gg=Xg=_u=h2=d2=Vd=0,e}};function $c(e,t){u2+=e,f2+=t,++qd}function K8(){Di.point=VU}function VU(e,t){Di.point=jU,$c(oo=e,so=t)}function jU(e,t){var n=e-oo,r=t-so,i=de(n*n+r*r);Gg+=i*(oo+e)/2,Xg+=i*(so+t)/2,_u+=i,$c(oo=e,so=t)}function Q8(){Di.point=$c}function YU(){Di.point=GU}function WU(){eE(J8,tE)}function GU(e,t){Di.point=eE,$c(J8=oo=e,tE=so=t)}function eE(e,t){var n=e-oo,r=t-so,i=de(n*n+r*r);Gg+=i*(oo+e)/2,Xg+=i*(so+t)/2,_u+=i,i=so*e-oo*t,h2+=i*(oo+e),d2+=i*(so+t),Vd+=i*3,$c(oo=e,so=t)}var p2=Di;function Hg(e){this._context=e}Hg.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,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(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,sn);break}}},result:Ge};var y2=new _n,m2,nE,rE,jd,Yd,Zg={point:Ge,lineStart:function(){Zg.point=XU},lineEnd:function(){m2&&iE(nE,rE),Zg.point=Ge},polygonStart:function(){m2=!0},polygonEnd:function(){m2=null},result:function(){var e=+y2;return y2=new _n,e}};function XU(e,t){Zg.point=iE,nE=jd=e,rE=Yd=t}function iE(e,t){jd-=e,Yd-=t,y2.add(de(jd*jd+Yd*Yd)),jd=e,Yd=t}var g2=Zg;var oE,Kg,sE,aE,vu=class{constructor(t){this._append=t==null?cE:HU(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==sE||this._append!==Kg){let r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,sE=r,Kg=this._append,aE=this._,this._=i}this._+=aE;break}}}result(){let t=this._;return this._="",t.length?t:null}};function cE(e){let t=1;this._+=e[0];for(let n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function HU(e){let t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return cE;if(t!==oE){let n=10**t;oE=t,Kg=function(i){let o=1;this._+=i[0];for(let s=i.length;o<s;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return Kg}function In(e,t){let n=3,r=4.5,i,o;function s(a){return a&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),Dr(a,i(o))),o.result()}return s.area=function(a){return Dr(a,i(l2)),l2.result()},s.measure=function(a){return Dr(a,i(g2)),g2.result()},s.bounds=function(a){return Dr(a,i(wu)),wu.result()},s.centroid=function(a){return Dr(a,i(p2)),p2.result()},s.projection=function(a){return arguments.length?(i=a==null?(e=null,Pd):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new vu(n)):new Hg(t=a),typeof r!="function"&&o.pointRadius(r),s):t},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(o.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 t===null&&(o=new vu(n)),s},s.projection(e).digits(n).context(t)}function Uc(e){return{stream:Su(e)}}function Su(e){return function(t){var n=new b2;for(var r in e)n[r]=e[r];return n.stream=t,n}}function b2(){}b2.prototype={constructor:b2,point:function(e,t){this.stream.point(e,t)},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 x2(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Dr(n,e.stream(wu)),t(wu.result()),r!=null&&e.clipExtent(r),e}function Wd(e,t,n){return x2(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,c=+t[0][1]+(o-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,c])},n)}function Qg(e,t,n){return Wd(e,[[0,0],t],n)}function Jg(e,t,n){return x2(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];e.scale(150*o).translate([s,a])},n)}function tb(e,t,n){return x2(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var lE=16,ZU=K(30*zt);function w2(e,t){return+t?QU(e,t):KU(e)}function KU(e){return Su({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function QU(e,t){function n(r,i,o,s,a,c,l,u,f,h,d,p,m,g){var y=l-r,b=u-i,x=y*y+b*b;if(x>4*t&&m--){var w=s+h,v=a+d,_=c+p,M=de(w*w+v*v+_*_),D=we(_/=M),A=Ft(Ft(_)-1)<Q||Ft(o-f)<Q?(o+f)/2:We(v,w),N=e(A,D),T=N[0],B=N[1],L=T-r,S=B-i,I=b*L-y*S;(I*I/x>t||Ft((y*L+b*S)/x-.5)>.3||s*h+a*d+c*p<ZU)&&(n(r,i,o,s,a,c,T,B,A,w/=M,v/=M,_,m,g),g.point(T,B),n(T,B,A,w,v,_,l,u,f,h,d,p,m,g))}}return function(r){var i,o,s,a,c,l,u,f,h,d,p,m,g={point:y,lineStart:b,lineEnd:w,polygonStart:function(){r.polygonStart(),g.lineStart=v},polygonEnd:function(){r.polygonEnd(),g.lineStart=b}};function y(D,A){D=e(D,A),r.point(D[0],D[1])}function b(){f=NaN,g.point=x,r.lineStart()}function x(D,A){var N=io([D,A]),T=e(D,A);n(f,h,u,d,p,m,f=T[0],h=T[1],u=D,d=N[0],p=N[1],m=N[2],lE,r),r.point(f,h)}function w(){g.point=y,r.lineEnd()}function v(){b(),g.point=_,g.lineEnd=M}function _(D,A){x(i=D,A),o=f,s=h,a=d,c=p,l=m,g.point=x}function M(){n(f,h,u,d,p,m,o,s,i,a,c,l,lE,r),g.lineEnd=w,w()}return g}}var JU=Su({point:function(e,t){this.stream.point(e*zt,t*zt)}});function tP(e){return Su({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function eP(e,t,n,r,i){function o(s,a){return s*=r,a*=i,[t+e*s,n-e*a]}return o.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*i]},o}function uE(e,t,n,r,i,o){if(!o)return eP(e,t,n,r,i);var s=K(o),a=Z(o),c=s*e,l=a*e,u=s/e,f=a/e,h=(a*n-s*t)/e,d=(a*t+s*n)/e;function p(m,g){return m*=r,g*=i,[c*m-l*g+t,n-l*m-c*g]}return p.invert=function(m,g){return[r*(u*m-f*g+h),i*(d-f*m-u*g)]},p}function An(e){return _2(function(){return e})()}function _2(e){var t,n=150,r=480,i=250,o=0,s=0,a=0,c=0,l=0,u,f=0,h=1,d=1,p=null,m=n2,g=null,y,b,x,w=Pd,v=.5,_,M,D,A,N;function T(I){return D(I[0]*zt,I[1]*zt)}function B(I){return I=D.invert(I[0],I[1]),I&&[I[0]*Fe,I[1]*Fe]}T.stream=function(I){return A&&N===I?A:A=JU(tP(u)(m(_(w(N=I)))))},T.preclip=function(I){return arguments.length?(m=I,p=void 0,S()):m},T.postclip=function(I){return arguments.length?(w=I,g=y=b=x=null,S()):w},T.clipAngle=function(I){return arguments.length?(m=+I?j8(p=I*zt):(p=null,n2),S()):p*Fe},T.clipExtent=function(I){return arguments.length?(w=I==null?(g=y=b=x=null,Pd):bu(g=+I[0][0],y=+I[0][1],b=+I[1][0],x=+I[1][1]),S()):g==null?null:[[g,y],[b,x]]},T.scale=function(I){return arguments.length?(n=+I,L()):n},T.translate=function(I){return arguments.length?(r=+I[0],i=+I[1],L()):[r,i]},T.center=function(I){return arguments.length?(o=I[0]%360*zt,s=I[1]%360*zt,L()):[o*Fe,s*Fe]},T.rotate=function(I){return arguments.length?(a=I[0]%360*zt,c=I[1]%360*zt,l=I.length>2?I[2]%360*zt:0,L()):[a*Fe,c*Fe,l*Fe]},T.angle=function(I){return arguments.length?(f=I%360*zt,L()):f*Fe},T.reflectX=function(I){return arguments.length?(h=I?-1:1,L()):h<0},T.reflectY=function(I){return arguments.length?(d=I?-1:1,L()):d<0},T.precision=function(I){return arguments.length?(_=w2(M,v=I*I),S()):de(v)},T.fitExtent=function(I,E){return Wd(T,I,E)},T.fitSize=function(I,E){return Qg(T,I,E)},T.fitWidth=function(I,E){return Jg(T,I,E)},T.fitHeight=function(I,E){return tb(T,I,E)};function L(){var I=uE(n,0,0,h,d,f).apply(null,t(o,s)),E=uE(n,r-I[0],i-I[1],h,d,f);return u=t2(a,c,l),M=$d(t,E),D=$d(u,M),_=w2(M,v),S()}function S(){return A=N=null,T}return function(){return t=e.apply(this,arguments),T.invert=t.invert&&B,L()}}function Mu(e){var t=0,n=Et/3,r=_2(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*zt,n=o[1]*zt):[t*Fe,n*Fe]},i}function fE(e){var t=K(e);function n(r,i){return[r*t,Z(i)/t]}return n.invert=function(r,i){return[r/t,we(i*t)]},n}function hE(e,t){var n=Z(e),r=(n+Z(t))/2;if(Ft(r)<Q)return fE(e);var i=1+n*(2*r-n),o=de(i)/r;function s(a,c){var l=de(i-2*r*Z(c))/r;return[l*Z(a*=r),o-l*K(a)]}return s.invert=function(a,c){var l=o-c,u=We(a,Ft(l))*kn(l);return l*r<0&&(u-=Et*kn(a)*kn(l)),[u/r,we((i-(a*a+l*l)*r*r)/(2*r))]},s}function ba(){return Mu(hE).scale(155.424).center([0,33.6442])}function Gd(){return ba().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function nP(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i<t;)e[i].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function v2(){var e,t,n=Gd(),r,i=ba().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=ba().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,c,l={point:function(h,d){c=[h,d]}};function u(h){var d=h[0],p=h[1];return c=null,r.point(d,p),c||(o.point(d,p),c)||(a.point(d,p),c)}u.invert=function(h){var d=n.scale(),p=n.translate(),m=(h[0]-p[0])/d,g=(h[1]-p[1])/d;return(g>=.12&&g<.234&&m>=-.425&&m<-.214?i:g>=.166&&g<.234&&m>=-.214&&m<-.115?s:n).invert(h)},u.stream=function(h){return e&&t===h?e:e=nP([n.stream(t=h),i.stream(h),s.stream(h)])},u.precision=function(h){return arguments.length?(n.precision(h),i.precision(h),s.precision(h),f()):n.precision()},u.scale=function(h){return arguments.length?(n.scale(h),i.scale(h*.35),s.scale(h),u.translate(n.translate())):n.scale()},u.translate=function(h){if(!arguments.length)return n.translate();var d=n.scale(),p=+h[0],m=+h[1];return r=n.translate(h).clipExtent([[p-.455*d,m-.238*d],[p+.455*d,m+.238*d]]).stream(l),o=i.translate([p-.307*d,m+.201*d]).clipExtent([[p-.425*d+Q,m+.12*d+Q],[p-.214*d-Q,m+.234*d-Q]]).stream(l),a=s.translate([p-.205*d,m+.212*d]).clipExtent([[p-.214*d+Q,m+.166*d+Q],[p-.115*d-Q,m+.234*d-Q]]).stream(l),f()},u.fitExtent=function(h,d){return Wd(u,h,d)},u.fitSize=function(h,d){return Qg(u,h,d)},u.fitWidth=function(h,d){return Jg(u,h,d)},u.fitHeight=function(h,d){return tb(u,h,d)};function f(){return e=t=null,u}return u.scale(1070)}function eb(e){return function(t,n){var r=K(t),i=K(n),o=e(r*i);return o===1/0?[2,0]:[o*i*Z(t),o*Z(n)]}}function ao(e){return function(t,n){var r=de(t*t+n*n),i=e(r),o=Z(i),s=K(i);return[We(t*o,r*s),we(r&&n*o/r)]}}var S2=eb(function(e){return de(2/(1+e))});S2.invert=ao(function(e){return 2*we(e/2)});function M2(){return An(S2).scale(124.75).clipAngle(180-.001)}var I2=eb(function(e){return(e=Ng(e))&&e/Z(e)});I2.invert=ao(function(e){return e});function A2(){return An(I2).scale(79.4188).clipAngle(180-.001)}function Iu(e,t){return[e,Rc(mu((he+t)/2))]}Iu.invert=function(e,t){return[e,2*Hr(Tg(t))-he]};function T2(){return E2(Iu).scale(961/sn)}function E2(e){var t=An(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,s=null,a,c,l;t.scale=function(f){return arguments.length?(r(f),u()):r()},t.translate=function(f){return arguments.length?(i(f),u()):i()},t.center=function(f){return arguments.length?(n(f),u()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=c=l=null:(s=+f[0][0],a=+f[0][1],c=+f[1][0],l=+f[1][1]),u()):s==null?null:[[s,a],[c,l]]};function u(){var f=Et*r(),h=t(U8(t.rotate()).invert([0,0]));return o(s==null?[[h[0]-f,h[1]-f],[h[0]+f,h[1]+f]]:e===Iu?[[Math.max(h[0]-f,s),a],[Math.min(h[0]+f,c),l]]:[[s,Math.max(h[1]-f,a)],[c,Math.min(h[1]+f,l)]])}return u()}function nb(e){return mu((he+e)/2)}function dE(e,t){var n=K(e),r=e===t?Z(e):Rc(n/K(t))/Rc(nb(t)/nb(e)),i=n*Dg(nb(e),r)/r;if(!r)return Iu;function o(s,a){i>0?a<-he+Q&&(a=-he+Q):a>he-Q&&(a=he-Q);var c=i/Dg(nb(a),r);return[c*Z(r*s),i-c*K(r*s)]}return o.invert=function(s,a){var c=i-a,l=kn(r)*de(s*s+c*c),u=We(s,Ft(c))*kn(c);return c*r<0&&(u-=Et*kn(s)*kn(c)),[u/r,2*Hr(Dg(i/l,1/r))-he]},o}function D2(){return Mu(dE).scale(109.5).parallels([30,30])}function Au(e,t){return[e,t]}Au.invert=Au;function N2(){return An(Au).scale(152.63)}function pE(e,t){var n=K(e),r=e===t?Z(e):(n-K(t))/(t-e),i=n/r+e;if(Ft(r)<Q)return Au;function o(s,a){var c=i-a,l=r*s;return[c*Z(l),i-c*K(l)]}return o.invert=function(s,a){var c=i-a,l=We(s,Ft(c))*kn(c);return c*r<0&&(l-=Et*kn(s)*kn(c)),[l/r,i-kn(r)*de(s*s+c*c)]},o}function B2(){return Mu(pE).scale(131.154).center([0,13.9389])}var Xd=1.340264,Hd=-.081106,Zd=893e-6,Kd=.003796,rb=de(3)/2,rP=12;function O2(e,t){var n=we(rb*Z(t)),r=n*n,i=r*r*r;return[e*K(n)/(rb*(Xd+3*Hd*r+i*(7*Zd+9*Kd*r))),n*(Xd+Hd*r+i*(Zd+Kd*r))]}O2.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,s,a,c;o<rP&&(a=n*(Xd+Hd*r+i*(Zd+Kd*r))-t,c=Xd+3*Hd*r+i*(7*Zd+9*Kd*r),n-=s=a/c,r=n*n,i=r*r*r,!(Ft(s)<kc));++o);return[rb*e*(Xd+3*Hd*r+i*(7*Zd+9*Kd*r))/K(n),we(Z(n)/rb)]};function L2(){return An(O2).scale(177.158)}function F2(e,t){var n=K(t),r=K(e)*n;return[n*Z(e)/r,Z(t)/r]}F2.invert=ao(Hr);function C2(){return An(F2).scale(144.049).clipAngle(60)}function k2(e,t){return[K(t)*Z(e),Z(t)]}k2.invert=ao(we);function R2(){return An(k2).scale(249.5).clipAngle(90+Q)}function $2(e,t){var n=K(t),r=1+K(e)*n;return[n*Z(e)/r,Z(t)/r]}$2.invert=ao(function(e){return 2*Hr(e)});function U2(){return An($2).scale(250).clipAngle(142)}function P2(e,t){return[Rc(mu((he+t)/2)),-e]}P2.invert=function(e,t){return[-t,2*Hr(Tg(e))-he]};function z2(){var e=E2(P2),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.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 iP(e,t){return e.parent===t.parent?1:2}function oP(e){return e.reduce(sP,0)/e.length}function sP(e,t){return e+t.x}function aP(e){return 1+e.reduce(cP,0)}function cP(e,t){return Math.max(e,t.y)}function lP(e){for(var t;t=e.children;)e=t[0];return e}function uP(e){for(var t;t=e.children;)e=t[t.length-1];return e}function ib(){var e=iP,t=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(h){var d=h.children;d?(h.x=oP(d),h.y=aP(d)):(h.x=s?a+=e(h,s):0,h.y=0,s=h)});var c=lP(o),l=uP(o),u=c.x-e(c,l)/2,f=l.x+e(l,c)/2;return o.eachAfter(r?function(h){h.x=(h.x-o.x)*t,h.y=(o.y-h.y)*n}:function(h){h.x=(h.x-u)/(f-u)*t,h.y=(1-(o.y?h.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(r=!1,t=+o[0],n=+o[1],i):r?null:[t,n]},i.nodeSize=function(o){return arguments.length?(r=!0,t=+o[0],n=+o[1],i):r?[t,n]:null},i}function fP(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function mE(){return this.eachAfter(fP)}function yE(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function gE(e,t){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(e.call(t,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function bE(e,t){for(var n=this,r=[n],i=[],o,s,a,c=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s<a;++s)r.push(o[s]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function xE(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function wE(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function _E(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function vE(e){for(var t=this,n=hP(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function hP(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function SE(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function ME(){return Array.from(this)}function IE(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function AE(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*TE(){var e=this,t,n=[e],r,i,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function q2(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=mP)):t===void 0&&(t=pP);for(var n=new xa(e),r,i=[n],o,s,a,c;r=i.pop();)if((s=t(r.data))&&(c=(s=Array.from(s)).length))for(r.children=s,a=c-1;a>=0;--a)i.push(o=s[a]=new xa(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(V2)}function dP(){return q2(this).eachBefore(yP)}function pP(e){return e.children}function mP(e){return Array.isArray(e)?e[1]:null}function yP(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function V2(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function xa(e){this.data=e,this.depth=this.height=0,this.parent=null}xa.prototype=q2.prototype={constructor:xa,count:mE,each:yE,eachAfter:bE,eachBefore:gE,find:xE,sum:wE,sort:_E,path:vE,ancestors:SE,descendants:ME,leaves:IE,links:AE,copy:dP,[Symbol.iterator]:TE};function ob(e){return e==null?null:gP(e)}function gP(e){if(typeof e!="function")throw new Error;return e}var bP={depth:-1},EE={},j2={};function xP(e){return e.id}function wP(e){return e.parentId}function sb(){var e=xP,t=wP,n;function r(i){var o=Array.from(i),s=e,a=t,c,l,u,f,h,d,p,m,g=new Map;if(n!=null){let y=o.map((w,v)=>_P(n(w,v,i))),b=y.map(DE),x=new Set(y).add("");for(let w of b)x.has(w)||(x.add(w),y.push(w),b.push(DE(w)),o.push(j2));s=(w,v)=>y[v],a=(w,v)=>b[v]}for(u=0,c=o.length;u<c;++u)l=o[u],d=o[u]=new xa(l),(p=s(l,u,i))!=null&&(p+="")&&(m=d.id=p,g.set(m,g.has(m)?EE:d)),(p=a(l,u,i))!=null&&(p+="")&&(d.parent=p);for(u=0;u<c;++u)if(d=o[u],p=d.parent){if(h=g.get(p),!h)throw new Error("missing: "+p);if(h===EE)throw new Error("ambiguous: "+p);h.children?h.children.push(d):h.children=[d],d.parent=h}else{if(f)throw new Error("multiple roots");f=d}if(!f)throw new Error("no root");if(n!=null){for(;f.data===j2&&f.children.length===1;)f=f.children[0],--c;for(let y=o.length-1;y>=0&&(d=o[y],d.data===j2);--y)d.data=null}if(f.parent=bP,f.eachBefore(function(y){y.depth=y.parent.depth+1,--c}).eachBefore(V2),f.parent=null,c>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(e=ob(i),r):e},r.parentId=function(i){return arguments.length?(t=ob(i),r):t},r.path=function(i){return arguments.length?(n=ob(i),r):n},r}function _P(e){e=`${e}`;let t=e.length;return Y2(e,t-1)&&!Y2(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function DE(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Y2(e,t););return e.slice(0,t)}function Y2(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function vP(e,t){return e.parent===t.parent?1:2}function W2(e){var t=e.children;return t?t[0]:e.t}function G2(e){var t=e.children;return t?t[t.length-1]:e.t}function SP(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function MP(e){for(var t=0,n=0,r=e.children,i=r.length,o;--i>=0;)o=r[i],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function IP(e,t,n){return e.a.parent===t.parent?e.a:n}function ab(e,t){this._=e,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=t}ab.prototype=Object.create(xa.prototype);function AP(e){for(var t=new ab(e,0),n,r=[t],i,o,s,a;n=r.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)r.push(i=n.children[s]=new ab(o[s],s)),i.parent=n;return(t.parent=new ab(null,0)).children=[t],t}function Pc(){var e=vP,t=1,n=1,r=null;function i(l){var u=AP(l);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),r)l.eachBefore(c);else{var f=l,h=l,d=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>h.x&&(h=b),b.depth>d.depth&&(d=b)});var p=f===h?1:e(f,h)/2,m=p-f.x,g=t/(h.x+p+m),y=n/(d.depth||1);l.eachBefore(function(b){b.x=(b.x+m)*g,b.y=b.depth*y})}return l}function o(l){var u=l.children,f=l.parent.children,h=l.i?f[l.i-1]:null;if(u){MP(l);var d=(u[0].z+u[u.length-1].z)/2;h?(l.z=h.z+e(l._,h._),l.m=l.z-d):l.z=d}else h&&(l.z=h.z+e(l._,h._));l.parent.A=a(l,h,l.parent.A||f[0])}function s(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,u,f){if(u){for(var h=l,d=l,p=u,m=h.parent.children[0],g=h.m,y=d.m,b=p.m,x=m.m,w;p=G2(p),h=W2(h),p&&h;)m=W2(m),d=G2(d),d.a=l,w=p.z+b-h.z-g+e(p._,h._),w>0&&(SP(IP(p,l,f),l,w),g+=w,y+=w),b+=p.m,g+=h.m,x+=m.m,y+=d.m;p&&!G2(d)&&(d.t=p,d.m+=b-y),h&&!W2(m)&&(m.t=h,m.m+=g-x,f=l)}return f}function c(l){l.x*=t,l.y=l.depth*n}return i.separation=function(l){return arguments.length?(e=l,i):e},i.size=function(l){return arguments.length?(r=!1,t=+l[0],n=+l[1],i):r?null:[t,n]},i.nodeSize=function(l){return arguments.length?(r=!0,t=+l[0],n=+l[1],i):r?[t,n]:null},i}var NE=23283064365386963e-26;function co(e=Math.random()){let t=(0<=e&&e<1?e/NE:Math.abs(e))|0;return()=>(t=1664525*t+1013904223|0,NE*(t>>>0))}function Xe(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Qd(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}var Jd=Symbol("implicit");function zc(){var e=new Yn,t=[],n=[],r=Jd;function i(o){let s=e.get(o);if(s===void 0){if(r!==Jd)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Yn;for(let s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return zc(t,n).unknown(r)},Xe.apply(i,arguments),i}function wa(){var e=zc().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,c=0,l=0,u=.5;delete e.unknown;function f(){var h=t().length,d=i<r,p=d?i:r,m=d?r:i;o=(m-p)/Math.max(1,h-c+l*2),a&&(o=Math.floor(o)),p+=(m-p-o*(h-c))*u,s=o*(1-c),a&&(p=Math.round(p),s=Math.round(s));var g=Re(h).map(function(y){return p+o*y});return n(d?g.reverse():g)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(h){return arguments.length?(a=!!h,f()):a},e.padding=function(h){return arguments.length?(c=Math.min(1,l=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(l=+h,f()):l},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),f()):u},e.copy=function(){return wa(t(),[r,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},Xe.apply(f(),arguments)}function BE(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return BE(t())},e}function X2(){return BE(wa.apply(null,arguments).paddingInner(1))}function H2(e){return function(){return e}}function Tu(e){return+e}var OE=[0,1];function pr(e){return e}function Z2(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:H2(isNaN(t)?NaN:.5)}function TP(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function EP(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=Z2(i,r),o=n(s,o)):(r=Z2(r,i),o=n(o,s)),function(a){return o(r(a))}}function DP(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=Z2(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var c=ss(e,a,1,r)-1;return o[c](i[c](a))}}function lo(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function qc(){var e=OE,t=OE,n=Er,r,i,o,s=pr,a,c,l;function u(){var h=Math.min(e.length,t.length);return s!==pr&&(s=TP(e[0],e[h-1])),a=h>2?DP:EP,c=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(c||(c=a(e.map(r),t,n)))(r(s(h)))}return f.invert=function(h){return s(i((l||(l=a(t,e.map(r),xe)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Tu),u()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=Nc,u()},f.clamp=function(h){return arguments.length?(s=h?!0:pr,u()):s!==pr},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,d){return r=h,i=d,u()}}function tp(){return qc()(pr,pr)}function K2(e,t,n,r){var i=Zl(e,t,n),o;switch(r=ro(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=jv(i,s))&&(r.precision=o),Ag(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Yv(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Vv(i))&&(r.precision=o-(r.type==="%")*2);break}}return Xr(r)}function gs(e){var t=e.domain;return e.ticks=function(n){var r=t();return vn(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return K2(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],c,l,u=10;for(a<s&&(l=s,s=a,a=l,l=i,i=o,o=l);u-- >0;){if(l=as(s,a,n),l===c)return r[i]=s,r[o]=a,t(r);if(l>0)s=Math.floor(s/l)*l,a=Math.ceil(a/l)*l;else if(l<0)s=Math.ceil(s*l)/l,a=Math.floor(a*l)/l;else break;c=l}return e},e}function bs(){var e=tp();return e.copy=function(){return lo(e,bs())},Xe.apply(e,arguments),gs(e)}function ep(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Tu),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return ep(e).unknown(t)},e=arguments.length?Array.from(e,Tu):[0,1],gs(n)}function np(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function LE(e){return Math.log(e)}function FE(e){return Math.exp(e)}function NP(e){return-Math.log(-e)}function BP(e){return-Math.exp(-e)}function OP(e){return isFinite(e)?+("1e"+e):e<0?0:e}function LP(e){return e===10?OP:e===Math.E?Math.exp:t=>Math.pow(e,t)}function FP(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function CE(e){return(t,n)=>-e(-t,n)}function Q2(e){let t=e(LE,FE),n=t.domain,r=10,i,o;function s(){return i=FP(r),o=LP(r),n()[0]<0?(i=CE(i),o=CE(o),e(NP,BP)):e(LE,FE),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{let c=n(),l=c[0],u=c[c.length-1],f=u<l;f&&([l,u]=[u,l]);let h=i(l),d=i(u),p,m,g=a==null?10:+a,y=[];if(!(r%1)&&d-h<g){if(h=Math.floor(h),d=Math.ceil(d),l>0){for(;h<=d;++h)for(p=1;p<r;++p)if(m=h<0?p/o(-h):p*o(h),!(m<l)){if(m>u)break;y.push(m)}}else for(;h<=d;++h)for(p=r-1;p>=1;--p)if(m=h>0?p/o(-h):p*o(h),!(m<l)){if(m>u)break;y.push(m)}y.length*2<g&&(y=vn(l,u,g))}else y=vn(h,d,Math.min(d-h,g)).map(o);return f?y.reverse():y},t.tickFormat=(a,c)=>{if(a==null&&(a=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=ro(c)).precision==null&&(c.trim=!0),c=Xr(c)),a===1/0)return c;let l=Math.max(1,r*a/t.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=l?c(u):""}},t.nice=()=>n(np(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function rp(){let e=Q2(qc()).domain([1,10]);return e.copy=()=>lo(e,rp()).base(e.base()),Xe.apply(e,arguments),e}function kE(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function RE(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function J2(e){var t=1,n=e(kE(t),RE(t));return n.constant=function(r){return arguments.length?e(kE(t=+r),RE(t)):t},gs(n)}function ip(){var e=J2(qc());return e.copy=function(){return lo(e,ip()).constant(e.constant())},Xe.apply(e,arguments)}function $E(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function CP(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function kP(e){return e<0?-e*e:e*e}function tS(e){var t=e(pr,pr),n=1;function r(){return n===1?e(pr,pr):n===.5?e(CP,kP):e($E(n),$E(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},gs(t)}function op(){var e=tS(qc());return e.copy=function(){return lo(e,op()).exponent(e.exponent())},Xe.apply(e,arguments),e}function sp(){var e=[],t=[],n=[],r;function i(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s<a;)n[s-1]=J_(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?r:t[ss(n,s)]}return o.invertExtent=function(s){var a=t.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let a of s)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort($t),i()},o.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},o.unknown=function(s){return arguments.length?(r=s,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return sp().domain(e).range(t).unknown(r)},Xe.apply(o,arguments)}function ap(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[ss(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return ap().domain(e).range(t).unknown(n)},Xe.apply(i,arguments)}var eS=new Date,nS=new Date;function me(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{let s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{let c=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return c;let l;do c.push(l=new Date(+o)),t(o,a),e(o);while(l<o&&o<s);return c},i.filter=o=>me(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(eS.setTime(+o),nS.setTime(+s),e(eS),e(nS),Math.floor(n(eS,nS))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}var cp=me(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);cp.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?me(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):cp);var C_t=cp.range;var an=me(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),UE=an.range;var xs=me(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),RP=xs.range,ws=me(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),$P=ws.range;var _s=me(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3-e.getMinutes()*6e4)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getHours()),UP=_s.range,vs=me(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),PP=vs.range;var Zr=me(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1),zP=Zr.range,Yc=me(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),qP=Yc.range,Wc=me(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),VP=Wc.range;function Gc(e){return me(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}var Nr=Gc(0),_a=Gc(1),cb=Gc(2),lb=Gc(3),fo=Gc(4),ub=Gc(5),fb=Gc(6),zE=Nr.range,jP=_a.range,YP=cb.range,WP=lb.range,GP=fo.range,XP=ub.range,HP=fb.range;function Xc(e){return me(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/6048e5)}var Br=Xc(0),va=Xc(1),hb=Xc(2),db=Xc(3),ho=Xc(4),pb=Xc(5),mb=Xc(6),qE=Br.range,ZP=va.range,KP=hb.range,QP=db.range,JP=ho.range,tz=pb.range,ez=mb.range;var Ss=me(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),nz=Ss.range,Ms=me(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),rz=Ms.range;var Rn=me(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Rn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:me(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});var iz=Rn.range,$n=me(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());$n.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:me(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});var oz=$n.range;function jE(e,t,n,r,i,o){let s=[[an,1,1e3],[an,5,5*1e3],[an,15,15*1e3],[an,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[r,1,864e5],[r,2,2*864e5],[n,1,6048e5],[t,1,2592e6],[t,3,3*2592e6],[e,1,31536e6]];function a(l,u,f){let h=u<l;h&&([l,u]=[u,l]);let d=f&&typeof f.range=="function"?f:c(l,u,f),p=d?d.range(l,+u+1):[];return h?p.reverse():p}function c(l,u,f){let h=Math.abs(u-l)/f,d=os(([,,g])=>g).right(s,h);if(d===s.length)return e.every(Zl(l/31536e6,u/31536e6,f));if(d===0)return cp.every(Math.max(Zl(l,u,f),1));let[p,m]=s[h/s[d-1][2]<s[d][2]/h?d-1:d];return p.every(m)}return[a,c]}var[rS,up]=jE($n,Ms,Br,Wc,vs,ws),[iS,oS]=jE(Rn,Ss,Nr,Zr,_s,xs);function sS(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function aS(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function fp(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function cS(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,c=e.shortMonths,l=hp(i),u=dp(i),f=hp(o),h=dp(o),d=hp(s),p=dp(s),m=hp(a),g=dp(a),y=hp(c),b=dp(c),x={a:C,A:k,b:F,B:R,c:null,d:ZE,e:ZE,f:Dz,g:Uz,G:zz,H:Az,I:Tz,j:Ez,L:e5,m:Nz,M:Bz,p:$,q:U,Q:JE,s:t5,S:Oz,u:Lz,U:Fz,V:Cz,w:kz,W:Rz,x:null,X:null,y:$z,Y:Pz,Z:qz,"%":QE},w={a:G,A:J,b:et,B:st,c:null,d:KE,e:KE,f:Wz,g:nq,G:iq,H:Vz,I:jz,j:Yz,L:r5,m:Gz,M:Xz,p:j,q:nt,Q:JE,s:t5,S:Hz,u:Zz,U:Kz,V:Qz,w:Jz,W:tq,x:null,X:null,y:eq,Y:rq,Z:oq,"%":QE},v={a:N,A:T,b:B,B:L,c:S,d:XE,e:XE,f:vz,g:GE,G:WE,H:HE,I:HE,j:bz,L:_z,m:gz,M:xz,p:A,q:yz,Q:Mz,s:Iz,S:wz,u:fz,U:hz,V:dz,w:uz,W:pz,x:I,X:E,y:GE,Y:WE,Z:mz,"%":Sz};x.x=_(n,x),x.X=_(r,x),x.c=_(t,x),w.x=_(n,w),w.X=_(r,w),w.c=_(t,w);function _(z,X){return function(rt){var P=[],Ot=-1,ft=0,Yt=z.length,Wt,tt,ie;for(rt instanceof Date||(rt=new Date(+rt));++Ot<Yt;)z.charCodeAt(Ot)===37&&(P.push(z.slice(ft,Ot)),(tt=YE[Wt=z.charAt(++Ot)])!=null?Wt=z.charAt(++Ot):tt=Wt==="e"?" ":"0",(ie=X[Wt])&&(Wt=ie(rt,tt)),P.push(Wt),ft=Ot+1);return P.push(z.slice(ft,Ot)),P.join("")}}function M(z,X){return function(rt){var P=fp(1900,void 0,1),Ot=D(P,z,rt+="",0),ft,Yt;if(Ot!=rt.length)return null;if("Q"in P)return new Date(P.Q);if("s"in P)return new Date(P.s*1e3+("L"in P?P.L:0));if(X&&!("Z"in P)&&(P.Z=0),"p"in P&&(P.H=P.H%12+P.p*12),P.m===void 0&&(P.m="q"in P?P.q:0),"V"in P){if(P.V<1||P.V>53)return null;"w"in P||(P.w=1),"Z"in P?(ft=aS(fp(P.y,0,1)),Yt=ft.getUTCDay(),ft=Yt>4||Yt===0?va.ceil(ft):va(ft),ft=Yc.offset(ft,(P.V-1)*7),P.y=ft.getUTCFullYear(),P.m=ft.getUTCMonth(),P.d=ft.getUTCDate()+(P.w+6)%7):(ft=sS(fp(P.y,0,1)),Yt=ft.getDay(),ft=Yt>4||Yt===0?_a.ceil(ft):_a(ft),ft=Zr.offset(ft,(P.V-1)*7),P.y=ft.getFullYear(),P.m=ft.getMonth(),P.d=ft.getDate()+(P.w+6)%7)}else("W"in P||"U"in P)&&("w"in P||(P.w="u"in P?P.u%7:"W"in P?1:0),Yt="Z"in P?aS(fp(P.y,0,1)).getUTCDay():sS(fp(P.y,0,1)).getDay(),P.m=0,P.d="W"in P?(P.w+6)%7+P.W*7-(Yt+5)%7:P.w+P.U*7-(Yt+6)%7);return"Z"in P?(P.H+=P.Z/100|0,P.M+=P.Z%100,aS(P)):sS(P)}}function D(z,X,rt,P){for(var Ot=0,ft=X.length,Yt=rt.length,Wt,tt;Ot<ft;){if(P>=Yt)return-1;if(Wt=X.charCodeAt(Ot++),Wt===37){if(Wt=X.charAt(Ot++),tt=v[Wt in YE?X.charAt(Ot++):Wt],!tt||(P=tt(z,rt,P))<0)return-1}else if(Wt!=rt.charCodeAt(P++))return-1}return P}function A(z,X,rt){var P=l.exec(X.slice(rt));return P?(z.p=u.get(P[0].toLowerCase()),rt+P[0].length):-1}function N(z,X,rt){var P=d.exec(X.slice(rt));return P?(z.w=p.get(P[0].toLowerCase()),rt+P[0].length):-1}function T(z,X,rt){var P=f.exec(X.slice(rt));return P?(z.w=h.get(P[0].toLowerCase()),rt+P[0].length):-1}function B(z,X,rt){var P=y.exec(X.slice(rt));return P?(z.m=b.get(P[0].toLowerCase()),rt+P[0].length):-1}function L(z,X,rt){var P=m.exec(X.slice(rt));return P?(z.m=g.get(P[0].toLowerCase()),rt+P[0].length):-1}function S(z,X,rt){return D(z,t,X,rt)}function I(z,X,rt){return D(z,n,X,rt)}function E(z,X,rt){return D(z,r,X,rt)}function C(z){return s[z.getDay()]}function k(z){return o[z.getDay()]}function F(z){return c[z.getMonth()]}function R(z){return a[z.getMonth()]}function $(z){return i[+(z.getHours()>=12)]}function U(z){return 1+~~(z.getMonth()/3)}function G(z){return s[z.getUTCDay()]}function J(z){return o[z.getUTCDay()]}function et(z){return c[z.getUTCMonth()]}function st(z){return a[z.getUTCMonth()]}function j(z){return i[+(z.getUTCHours()>=12)]}function nt(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var X=_(z+="",x);return X.toString=function(){return z},X},parse:function(z){var X=M(z+="",!1);return X.toString=function(){return z},X},utcFormat:function(z){var X=_(z+="",w);return X.toString=function(){return z},X},utcParse:function(z){var X=M(z+="",!0);return X.toString=function(){return z},X}}}var YE={"-":"",_:" ",0:"0"},cn=/^\s*\d+/,az=/^%/,cz=/[\\^$*+?|[\]().{}]/g;function Qt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function lz(e){return e.replace(cz,"\\$&")}function hp(e){return new RegExp("^(?:"+e.map(lz).join("|")+")","i")}function dp(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function uz(e,t,n){var r=cn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function fz(e,t,n){var r=cn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function hz(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function dz(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function pz(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function WE(e,t,n){var r=cn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function GE(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function mz(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function yz(e,t,n){var r=cn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function gz(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function XE(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function bz(e,t,n){var r=cn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function HE(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function xz(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function wz(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function _z(e,t,n){var r=cn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function vz(e,t,n){var r=cn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Sz(e,t,n){var r=az.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Mz(e,t,n){var r=cn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Iz(e,t,n){var r=cn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ZE(e,t){return Qt(e.getDate(),t,2)}function Az(e,t){return Qt(e.getHours(),t,2)}function Tz(e,t){return Qt(e.getHours()%12||12,t,2)}function Ez(e,t){return Qt(1+Zr.count(Rn(e),e),t,3)}function e5(e,t){return Qt(e.getMilliseconds(),t,3)}function Dz(e,t){return e5(e,t)+"000"}function Nz(e,t){return Qt(e.getMonth()+1,t,2)}function Bz(e,t){return Qt(e.getMinutes(),t,2)}function Oz(e,t){return Qt(e.getSeconds(),t,2)}function Lz(e){var t=e.getDay();return t===0?7:t}function Fz(e,t){return Qt(Nr.count(Rn(e)-1,e),t,2)}function n5(e){var t=e.getDay();return t>=4||t===0?fo(e):fo.ceil(e)}function Cz(e,t){return e=n5(e),Qt(fo.count(Rn(e),e)+(Rn(e).getDay()===4),t,2)}function kz(e){return e.getDay()}function Rz(e,t){return Qt(_a.count(Rn(e)-1,e),t,2)}function $z(e,t){return Qt(e.getFullYear()%100,t,2)}function Uz(e,t){return e=n5(e),Qt(e.getFullYear()%100,t,2)}function Pz(e,t){return Qt(e.getFullYear()%1e4,t,4)}function zz(e,t){var n=e.getDay();return e=n>=4||n===0?fo(e):fo.ceil(e),Qt(e.getFullYear()%1e4,t,4)}function qz(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Qt(t/60|0,"0",2)+Qt(t%60,"0",2)}function KE(e,t){return Qt(e.getUTCDate(),t,2)}function Vz(e,t){return Qt(e.getUTCHours(),t,2)}function jz(e,t){return Qt(e.getUTCHours()%12||12,t,2)}function Yz(e,t){return Qt(1+Yc.count($n(e),e),t,3)}function r5(e,t){return Qt(e.getUTCMilliseconds(),t,3)}function Wz(e,t){return r5(e,t)+"000"}function Gz(e,t){return Qt(e.getUTCMonth()+1,t,2)}function Xz(e,t){return Qt(e.getUTCMinutes(),t,2)}function Hz(e,t){return Qt(e.getUTCSeconds(),t,2)}function Zz(e){var t=e.getUTCDay();return t===0?7:t}function Kz(e,t){return Qt(Br.count($n(e)-1,e),t,2)}function i5(e){var t=e.getUTCDay();return t>=4||t===0?ho(e):ho.ceil(e)}function Qz(e,t){return e=i5(e),Qt(ho.count($n(e),e)+($n(e).getUTCDay()===4),t,2)}function Jz(e){return e.getUTCDay()}function tq(e,t){return Qt(va.count($n(e)-1,e),t,2)}function eq(e,t){return Qt(e.getUTCFullYear()%100,t,2)}function nq(e,t){return e=i5(e),Qt(e.getUTCFullYear()%100,t,2)}function rq(e,t){return Qt(e.getUTCFullYear()%1e4,t,4)}function iq(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ho(e):ho.ceil(e),Qt(e.getUTCFullYear()%1e4,t,4)}function oq(){return"+0000"}function QE(){return"%"}function JE(e){return+e}function t5(e){return Math.floor(+e/1e3)}var Eu,Du,o5,po,s5;lS({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 lS(e){return Eu=cS(e),Du=Eu.format,o5=Eu.parse,po=Eu.utcFormat,s5=Eu.utcParse,Eu}function sq(e){return new Date(e)}function aq(e){return e instanceof Date?+e:+new Date(+e)}function yb(e,t,n,r,i,o,s,a,c,l){var u=tp(),f=u.invert,h=u.domain,d=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),y=l("%a %d"),b=l("%b %d"),x=l("%B"),w=l("%Y");function v(_){return(c(_)<_?d:a(_)<_?p:s(_)<_?m:o(_)<_?g:r(_)<_?i(_)<_?y:b:n(_)<_?x:w)(_)}return u.invert=function(_){return new Date(f(_))},u.domain=function(_){return arguments.length?h(Array.from(_,aq)):h().map(sq)},u.ticks=function(_){var M=h();return e(M[0],M[M.length-1],_??10)},u.tickFormat=function(_,M){return M==null?v:l(M)},u.nice=function(_){var M=h();return(!_||typeof _.range!="function")&&(_=t(M[0],M[M.length-1],_??10)),_?h(np(M,_)):u},u.copy=function(){return lo(u,yb(e,t,n,r,i,o,s,a,c,l))},u}function gb(){return Xe.apply(yb(iS,oS,Rn,Ss,Nr,Zr,_s,xs,an,Du).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function bb(){return Xe.apply(yb(rS,up,$n,Ms,Br,Yc,vs,ws,an,po).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function pp(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function xb(){var e=0,t=.5,n=1,r=1,i,o,s,a,c,l=pr,u,f=!1,h;function d(m){return isNaN(m=+m)?h:(m=.5+((m=+u(m))-o)*(r*m<r*o?a:c),l(f?Math.max(0,Math.min(1,m)):m))}d.domain=function(m){return arguments.length?([e,t,n]=m,i=u(e=+e),o=u(t=+t),s=u(n=+n),a=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,d):[e,t,n]},d.clamp=function(m){return arguments.length?(f=!!m,d):f},d.interpolator=function(m){return arguments.length?(l=m,d):l};function p(m){return function(g){var y,b,x;return arguments.length?([y,b,x]=g,l=Ji(m,[y,b,x]),d):[l(0),l(.5),l(1)]}}return d.range=p(Er),d.rangeRound=p(Nc),d.unknown=function(m){return arguments.length?(h=m,d):h},function(m){return u=m,i=m(e),o=m(t),s=m(n),a=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,d}}function mp(){var e=gs(xb()(pr));return e.copy=function(){return pp(e,mp())},Qd.apply(e,arguments)}function wb(){var e=Q2(xb()).domain([.1,1,10]);return e.copy=function(){return pp(e,wb()).base(e.base())},Qd.apply(e,arguments)}function _b(){var e=J2(xb());return e.copy=function(){return pp(e,_b()).constant(e.constant())},Qd.apply(e,arguments)}function vb(){var e=tS(xb());return e.copy=function(){return pp(e,vb()).exponent(e.exponent())},Qd.apply(e,arguments)}function Y(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}var uS=Y("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var fS=Y("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");var hS=Y("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");var dS=Y("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");var pS=Y("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");var mS=Y("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");var yS=Y("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");var gS=Y("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");var bS=Y("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var xS=Y("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var ht=e=>mv(e[e.length-1]);var Sb=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Y),Mb=ht(Sb);var Ib=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Y),Ab=ht(Ib);var Tb=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Y),Eb=ht(Tb);var Db=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Y),Nb=ht(Db);var yp=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Y),Nu=ht(yp);var Bb=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Y),Ob=ht(Bb);var gp=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Y),Bu=ht(gp);var Lb=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Y),Fb=ht(Lb);var Cb=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Y),kb=ht(Cb);var Rb=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Y),$b=ht(Rb);var Ub=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Y),Pb=ht(Ub);var zb=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Y),qb=ht(zb);var Vb=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Y),jb=ht(Vb);var Yb=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Y),Wb=ht(Yb);var Gb=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Y),Xb=ht(Gb);var Hb=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Y),Zb=ht(Hb);var Kb=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Y),Qb=ht(Kb);var Jb=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Y),tx=ht(Jb);var ex=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Y),nx=ht(ex);var rx=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Y),ix=ht(rx);var ox=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Y),sx=ht(ox);var ax=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Y),cx=ht(ax);var lx=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Y),ux=ht(lx);var fx=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Y),hx=ht(fx);var dx=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Y),px=ht(dx);var mx=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Y),yx=ht(mx);var gx=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Y),bx=ht(gx);function xx(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}var wx=ou(Xn(300,.5,0),Xn(-240,.5,1));var vx=ou(Xn(-100,.75,.35),Xn(80,1.5,.8)),Sx=ou(Xn(260,.75,.35),Xn(80,1.5,.8)),_x=Xn();function Mx(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return _x.h=360*e-100,_x.s=1.5-1.5*t,_x.l=.8-.9*t,_x+""}var Ix=en(),cq=Math.PI/3,lq=Math.PI*2/3;function Ax(e){var t;return e=(.5-e)*Math.PI,Ix.r=255*(t=Math.sin(e))*t,Ix.g=255*(t=Math.sin(e+cq))*t,Ix.b=255*(t=Math.sin(e+lq))*t,Ix+""}function Tx(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function Ex(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var Dx=Ex(Y("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Nx=Ex(Y("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Bx=Ex(Y("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Ox=Ex(Y("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function He(e){return function(){return e}}var wS=Math.cos;var Ou=Math.min,bp=Math.sin,Jt=Math.sqrt,_S=1e-12,Hc=Math.PI,rIt=Hc/2,Lu=2*Hc;function Lx(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new pa(t)}var aIt=Array.prototype.slice;function Fx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function a5(e){this._context=e}a5.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Is(e){return new a5(e)}function Cx(e){return e[0]}function kx(e){return e[1]}function xp(e,t){var n=He(!0),r=null,i=Is,o=null,s=Lx(a);e=typeof e=="function"?e:e===void 0?Cx:He(e),t=typeof t=="function"?t:t===void 0?kx:He(t);function a(c){var l,u=(c=Fx(c)).length,f,h=!1,d;for(r==null&&(o=i(d=s())),l=0;l<=u;++l)!(l<u&&n(f=c[l],l,c))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(f,l,c),+t(f,l,c));if(d)return o=null,d+""||null}return a.x=function(c){return arguments.length?(e=typeof c=="function"?c:He(+c),a):e},a.y=function(c){return arguments.length?(t=typeof c=="function"?c:He(+c),a):t},a.defined=function(c){return arguments.length?(n=typeof c=="function"?c:He(!!c),a):n},a.curve=function(c){return arguments.length?(i=c,r!=null&&(o=i(r)),a):i},a.context=function(c){return arguments.length?(c==null?r=o=null:o=i(r=c),a):r},a}function Fu(e,t,n){var r=null,i=He(!0),o=null,s=Is,a=null,c=Lx(l);e=typeof e=="function"?e:e===void 0?Cx:He(+e),t=typeof t=="function"?t:t===void 0?He(0):He(+t),n=typeof n=="function"?n:n===void 0?kx:He(+n);function l(f){var h,d,p,m=(f=Fx(f)).length,g,y=!1,b,x=new Array(m),w=new Array(m);for(o==null&&(a=s(b=c())),h=0;h<=m;++h){if(!(h<m&&i(g=f[h],h,f))===y)if(y=!y)d=h,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=h-1;p>=d;--p)a.point(x[p],w[p]);a.lineEnd(),a.areaEnd()}y&&(x[h]=+e(g,h,f),w[h]=+t(g,h,f),a.point(r?+r(g,h,f):x[h],n?+n(g,h,f):w[h]))}if(b)return a=null,b+""||null}function u(){return xp().defined(i).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:He(+f),r=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:He(+f),l):e},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:He(+f),l):r},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:He(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:He(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:He(+f),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:He(!!f),l):i},l.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),l):s},l.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),l):o},l}var Rx=class{constructor(t,n){this._context=t,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(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}};function vS(e){return new Rx(e,!0)}function SS(e){return new Rx(e,!1)}var uq=Jt(3),wp={draw(e,t){let n=Jt(t+Ou(t/28,.75))*.59436,r=n/2,i=r*uq;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}};var As={draw(e,t){let n=Jt(t/Hc);e.moveTo(n,0),e.arc(0,0,n,0,Lu)}};var _p={draw(e,t){let n=Jt(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}};var c5=Jt(1/3),fq=c5*2,vp={draw(e,t){let n=Jt(t/fq),r=n*c5;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}};var Sp={draw(e,t){let n=Jt(t)*.62625;e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}};var Mp={draw(e,t){let n=Jt(t-Ou(t/7,2))*.87559;e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}};var Ip={draw(e,t){let n=Jt(t),r=-n/2;e.rect(r,r,n,n)}};var Ap={draw(e,t){let n=Jt(t)*.4431;e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}};var hq=.8908130915292852,l5=bp(Hc/10)/bp(7*Hc/10),dq=bp(Lu/10)*l5,pq=-wS(Lu/10)*l5,Tp={draw(e,t){let n=Jt(t*hq),r=dq*n,i=pq*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){let s=Lu*o/5,a=wS(s),c=bp(s);e.lineTo(c*n,-a*n),e.lineTo(a*r-c*i,c*r+a*i)}e.closePath()}};var MS=Jt(3),Ep={draw(e,t){let n=-Jt(t/(MS*3));e.moveTo(0,n*2),e.lineTo(-MS*n,-n),e.lineTo(MS*n,-n),e.closePath()}};var mq=Jt(3),Dp={draw(e,t){let n=Jt(t)*.6824,r=n/2,i=n*mq/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}};var Kr=-.5,Qr=Jt(3)/2,IS=1/Jt(12),yq=(IS/2+1)*3,Np={draw(e,t){let n=Jt(t/yq),r=n/2,i=n*IS,o=r,s=n*IS+n,a=-o,c=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(a,c),e.lineTo(Kr*r-Qr*i,Qr*r+Kr*i),e.lineTo(Kr*o-Qr*s,Qr*o+Kr*s),e.lineTo(Kr*a-Qr*c,Qr*a+Kr*c),e.lineTo(Kr*r+Qr*i,Kr*i-Qr*r),e.lineTo(Kr*o+Qr*s,Kr*s-Qr*o),e.lineTo(Kr*a+Qr*c,Kr*c-Qr*a),e.closePath()}};var Cu={draw(e,t){let n=Jt(t-Ou(t/6,1.7))*.6189;e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}};var $x=[As,_p,vp,Ip,Tp,Ep,Np],AS=[As,Mp,Cu,Dp,wp,Ap,Sp];function Jr(){}function ku(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Bp(e){this._context=e}Bp.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:ku(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:ku(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function TS(e){return new Bp(e)}function u5(e){this._context=e}u5.prototype={areaStart:Jr,areaEnd:Jr,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ku(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ES(e){return new u5(e)}function f5(e){this._context=e}f5.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(e,t){switch(e=+e,t=+t,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+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ku(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function DS(e){return new f5(e)}function h5(e,t){this._basis=new Bp(e),this._beta=t}h5.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],o=e[n]-r,s=t[n]-i,a=-1,c;++a<=n;)c=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(r+c*o),this._beta*t[a]+(1-this._beta)*(i+c*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var NS=function e(t){function n(r){return t===1?new Bp(r):new h5(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Ru(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ux(e,t){this._context=e,this._k=(1-t)/6}Ux.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:Ru(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Ru(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var BS=function e(t){function n(r){return new Ux(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Px(e,t){this._context=e,this._k=(1-t)/6}Px.prototype={areaStart:Jr,areaEnd:Jr,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ru(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var OS=function e(t){function n(r){return new Px(r,t)}return n.tension=function(r){return e(+r)},n}(0);function zx(e,t){this._context=e,this._k=(1-t)/6}zx.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(e,t){switch(e=+e,t=+t,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:Ru(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var LS=function e(t){function n(r){return new zx(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Op(e,t,n){var r=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>_S){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>_S){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,s,e._x2,e._y2)}function d5(e,t){this._context=e,this._alpha=t}d5.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;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(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Op(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var FS=function e(t){function n(r){return t?new d5(r,t):new Ux(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function p5(e,t){this._context=e,this._alpha=t}p5.prototype={areaStart:Jr,areaEnd:Jr,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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;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=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Op(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var CS=function e(t){function n(r){return t?new p5(r,t):new Px(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function m5(e,t){this._context=e,this._alpha=t}m5.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;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:Op(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var kS=function e(t){function n(r){return t?new m5(r,t):new zx(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function y5(e){this._context=e}y5.prototype={areaStart:Jr,areaEnd:Jr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function RS(e){return new y5(e)}function g5(e){return e<0?-1:1}function b5(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(g5(o)+g5(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function x5(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function $S(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function qx(e){this._context=e}qx.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:$S(this,this._t0,x5(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,$S(this,x5(this,n=b5(this,e,t)),n);break;default:$S(this,this._t0,n=b5(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function w5(e){this._context=new _5(e)}(w5.prototype=Object.create(qx.prototype)).point=function(e,t){qx.prototype.point.call(this,t,e)};function _5(e){this._context=e}_5.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function US(e){return new qx(e)}function PS(e){return new w5(e)}function S5(e){this._context=e}S5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=v5(e),i=v5(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function v5(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),s=new Array(n);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function zS(e){return new S5(e)}function Vx(e,t){this._context=e,this._t=t}Vx.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function qS(e){return new Vx(e,.5)}function VS(e){return new Vx(e,0)}function jS(e){return new Vx(e,1)}var Lp=e=>()=>e;function YS(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Or(e,t,n){this.k=e,this.x=t,this.y=n}Or.prototype={constructor:Or,scale:function(e){return e===1?this:new Or(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Or(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fp=new Or(1,0,0);WS.prototype=Or.prototype;function WS(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fp;return e.__zoom}function jx(e){e.stopImmediatePropagation()}function $u(e){e.preventDefault(),e.stopImmediatePropagation()}function gq(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function bq(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function M5(){return this.__zoom||Fp}function xq(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function wq(){return navigator.maxTouchPoints||"ontouchstart"in this}function _q(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function GS(){var e=gq,t=bq,n=_q,r=xq,i=wq,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=_v,l=Mc("start","zoom","end"),u,f,h,d=500,p=150,m=0,g=10;function y(S){S.property("__zoom",M5).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",N).filter(i).on("touchstart.zoom",T).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(S,I,E,C){var k=S.selection?S.selection():S;k.property("__zoom",M5),S!==k?v(S,I,E,C):k.interrupt().each(function(){_(this,arguments).event(C).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(S,I,E,C){y.scaleTo(S,function(){var k=this.__zoom.k,F=typeof I=="function"?I.apply(this,arguments):I;return k*F},E,C)},y.scaleTo=function(S,I,E,C){y.transform(S,function(){var k=t.apply(this,arguments),F=this.__zoom,R=E==null?w(k):typeof E=="function"?E.apply(this,arguments):E,$=F.invert(R),U=typeof I=="function"?I.apply(this,arguments):I;return n(x(b(F,U),R,$),k,s)},E,C)},y.translateBy=function(S,I,E,C){y.transform(S,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),s)},null,C)},y.translateTo=function(S,I,E,C,k){y.transform(S,function(){var F=t.apply(this,arguments),R=this.__zoom,$=C==null?w(F):typeof C=="function"?C.apply(this,arguments):C;return n(Fp.translate($[0],$[1]).scale(R.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof E=="function"?-E.apply(this,arguments):-E),F,s)},C,k)};function b(S,I){return I=Math.max(o[0],Math.min(o[1],I)),I===S.k?S:new Or(I,S.x,S.y)}function x(S,I,E){var C=I[0]-E[0]*S.k,k=I[1]-E[1]*S.k;return C===S.x&&k===S.y?S:new Or(S.k,C,k)}function w(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function v(S,I,E,C){S.on("start.zoom",function(){_(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(C).end()}).tween("zoom",function(){var k=this,F=arguments,R=_(k,F).event(C),$=t.apply(k,F),U=E==null?w($):typeof E=="function"?E.apply(k,F):E,G=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),J=k.__zoom,et=typeof I=="function"?I.apply(k,F):I,st=c(J.invert(U).concat(G/J.k),et.invert(U).concat(G/et.k));return function(j){if(j===1)j=et;else{var nt=st(j),z=G/nt[2];j=new Or(z,U[0]-nt[0]*z,U[1]-nt[1]*z)}R.zoom(null,j)}})}function _(S,I,E){return!E&&S.__zooming||new M(S,I)}function M(S,I){this.that=S,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,I),this.taps=0}M.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,I){return this.mouse&&S!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&S!=="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(S){var I=Pt(this.that).datum();l.call(S,this.that,new YS(S,{sourceEvent:this.sourceEvent,target:y,type:S,transform:this.that.__zoom,dispatch:l}),I)}};function D(S,...I){if(!e.apply(this,arguments))return;var E=_(this,I).event(S),C=this.__zoom,k=Math.max(o[0],Math.min(o[1],C.k*Math.pow(2,r.apply(this,arguments)))),F=Bn(S);if(E.wheel)(E.mouse[0][0]!==F[0]||E.mouse[0][1]!==F[1])&&(E.mouse[1]=C.invert(E.mouse[0]=F)),clearTimeout(E.wheel);else{if(C.k===k)return;E.mouse=[F,C.invert(F)],to(this),E.start()}$u(S),E.wheel=setTimeout(R,p),E.zoom("mouse",n(x(b(C,k),E.mouse[0],E.mouse[1]),E.extent,s));function R(){E.wheel=null,E.end()}}function A(S,...I){if(h||!e.apply(this,arguments))return;var E=S.currentTarget,C=_(this,I,!0).event(S),k=Pt(S.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",G,!0),F=Bn(S,E),R=S.clientX,$=S.clientY;ud(S.view),jx(S),C.mouse=[F,this.__zoom.invert(F)],to(this),C.start();function U(J){if($u(J),!C.moved){var et=J.clientX-R,st=J.clientY-$;C.moved=et*et+st*st>m}C.event(J).zoom("mouse",n(x(C.that.__zoom,C.mouse[0]=Bn(J,E),C.mouse[1]),C.extent,s))}function G(J){k.on("mousemove.zoom mouseup.zoom",null),fd(J.view,C.moved),$u(J),C.event(J).end()}}function N(S,...I){if(e.apply(this,arguments)){var E=this.__zoom,C=Bn(S.changedTouches?S.changedTouches[0]:S,this),k=E.invert(C),F=E.k*(S.shiftKey?.5:2),R=n(x(b(E,F),C,k),t.apply(this,I),s);$u(S),a>0?Pt(this).transition().duration(a).call(v,R,C,S):Pt(this).call(y.transform,R,C,S)}}function T(S,...I){if(e.apply(this,arguments)){var E=S.touches,C=E.length,k=_(this,I,S.changedTouches.length===C).event(S),F,R,$,U;for(jx(S),R=0;R<C;++R)$=E[R],U=Bn($,this),U=[U,this.__zoom.invert(U),$.identifier],k.touch0?!k.touch1&&k.touch0[2]!==U[2]&&(k.touch1=U,k.taps=0):(k.touch0=U,F=!0,k.taps=1+!!u);u&&(u=clearTimeout(u)),F&&(k.taps<2&&(f=U[0],u=setTimeout(function(){u=null},d)),to(this),k.start())}}function B(S,...I){if(this.__zooming){var E=_(this,I).event(S),C=S.changedTouches,k=C.length,F,R,$,U;for($u(S),F=0;F<k;++F)R=C[F],$=Bn(R,this),E.touch0&&E.touch0[2]===R.identifier?E.touch0[0]=$:E.touch1&&E.touch1[2]===R.identifier&&(E.touch1[0]=$);if(R=E.that.__zoom,E.touch1){var G=E.touch0[0],J=E.touch0[1],et=E.touch1[0],st=E.touch1[1],j=(j=et[0]-G[0])*j+(j=et[1]-G[1])*j,nt=(nt=st[0]-J[0])*nt+(nt=st[1]-J[1])*nt;R=b(R,Math.sqrt(j/nt)),$=[(G[0]+et[0])/2,(G[1]+et[1])/2],U=[(J[0]+st[0])/2,(J[1]+st[1])/2]}else if(E.touch0)$=E.touch0[0],U=E.touch0[1];else return;E.zoom("touch",n(x(R,$,U),E.extent,s))}}function L(S,...I){if(this.__zooming){var E=_(this,I).event(S),C=S.changedTouches,k=C.length,F,R;for(jx(S),h&&clearTimeout(h),h=setTimeout(function(){h=null},d),F=0;F<k;++F)R=C[F],E.touch0&&E.touch0[2]===R.identifier?delete E.touch0:E.touch1&&E.touch1[2]===R.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(R=Bn(R,this),Math.hypot(f[0]-R[0],f[1]-R[1])<g)){var $=Pt(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return y.wheelDelta=function(S){return arguments.length?(r=typeof S=="function"?S:Lp(+S),y):r},y.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Lp(!!S),y):e},y.touchable=function(S){return arguments.length?(i=typeof S=="function"?S:Lp(!!S),y):i},y.extent=function(S){return arguments.length?(t=typeof S=="function"?S:Lp([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),y):t},y.scaleExtent=function(S){return arguments.length?(o[0]=+S[0],o[1]=+S[1],y):[o[0],o[1]]},y.translateExtent=function(S){return arguments.length?(s[0][0]=+S[0][0],s[1][0]=+S[1][0],s[0][1]=+S[0][1],s[1][1]=+S[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(S){return arguments.length?(n=S,y):n},y.duration=function(S){return arguments.length?(a=+S,y):a},y.interpolate=function(S){return arguments.length?(c=S,y):c},y.on=function(){var S=l.on.apply(l,arguments);return S===l?y:S},y.clickDistance=function(S){return arguments.length?(m=(S=+S)*S,y):Math.sqrt(m)},y.tapDistance=function(S){return arguments.length?(g=+S,y):g},y}function $e(e){return e!=null&&!Number.isNaN(e)}function ln(e,t){return+$e(t)-+$e(e)||$t(e,t)}function Zc(e,t){return+$e(t)-+$e(e)||jn(e,t)}function Cp(e){return e!=null&&`${e}`!=""}function Uu(e){return isFinite(e)?e:NaN}function er(e){return e>0&&isFinite(e)?e:NaN}function Sa(e){return e<0&&isFinite(e)?e:NaN}function Yx(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return typeof t=="function"?t(e):t;let n=e.getUTCHours(),r=e.getUTCMinutes(),i=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${vq(e.getUTCFullYear(),4)}-${Ts(e.getUTCMonth()+1,2)}-${Ts(e.getUTCDate(),2)}${n||r||i||o?`T${Ts(n,2)}:${Ts(r,2)}${i||o?`:${Ts(i,2)}${o?`.${Ts(o,3)}`:""}`:""}Z`:""}`}function vq(e){return e<0?`-${Ts(-e,6)}`:e>9999?`+${Ts(e,6)}`:Ts(e,4)}function Ts(e,t){return`${e}`.padStart(t,"0")}var Sq=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function kp(e,t){return Sq.test(e+="")?new Date(e):typeof t=="function"?t(e):t}var zu=1e3,Ia=zu*60,Aa=Ia*60,yo=Aa*24,mo=yo*7,Kc=yo*30,Ma=yo*365,XS=[["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",zu],["5 seconds",5*zu],["15 seconds",15*zu],["30 seconds",30*zu],["minute",Ia],["5 minutes",5*Ia],["15 minutes",15*Ia],["30 minutes",30*Ia],["hour",Aa],["3 hours",3*Aa],["6 hours",6*Aa],["12 hours",12*Aa],["day",yo],["2 days",2*yo],["week",mo],["2 weeks",2*mo],["month",Kc],["3 months",3*Kc],["6 months",6*Kc],["year",Ma],["2 years",2*Ma],["5 years",5*Ma],["10 years",10*Ma],["20 years",20*Ma],["50 years",50*Ma],["100 years",100*Ma]],HS=new Map([["second",zu],["minute",Ia],["hour",Aa],["day",yo],["monday",mo],["tuesday",mo],["wednesday",mo],["thursday",mo],["friday",mo],["saturday",mo],["sunday",mo],["week",mo],["month",Kc],["year",Ma]]),A5=new Map([["second",an],["minute",xs],["hour",_s],["day",Zr],["monday",_a],["tuesday",cb],["wednesday",lb],["thursday",fo],["friday",ub],["saturday",fb],["sunday",Nr],["week",Nr],["month",Ss],["year",Rn]]),ZS=new Map([["second",an],["minute",ws],["hour",vs],["day",Wc],["monday",va],["tuesday",hb],["wednesday",db],["thursday",ho],["friday",pb],["saturday",mb],["sunday",Br],["week",Br],["month",Ms],["year",$n]]),qu=Symbol("intervalDuration"),Gx=Symbol("intervalType");for(let[e,t]of A5)t[qu]=HS.get(e),t[Gx]="time";for(let[e,t]of ZS)t[qu]=HS.get(e),t[Gx]="utc";var Rp=[["year",$n,"utc"],["month",Ms,"utc"],["day",Wc,"utc",6*Kc],["hour",vs,"utc",3*yo],["minute",ws,"utc",6*Aa],["second",an,"utc",30*Ia]],Wx=[["year",Rn,"time"],["month",Ss,"time"],["day",Zr,"time",6*Kc],["hour",_s,"time",3*yo],["minute",xs,"time",6*Aa],["second",an,"time",30*Ia]],Mq=[Rp[0],Wx[0],Rp[1],Wx[1],Rp[2],Wx[2],...Rp.slice(3)];function Xx(e){let t=`${e}`.toLowerCase();t.endsWith("s")&&(t=t.slice(0,-1));let n=1,r=/^(?:(\d+)\s+)/.exec(t);switch(r&&(t=t.slice(r[0].length),n=+r[1]),t){case"quarter":t="month",n*=3;break;case"half":t="month",n*=6;break}let i=ZS.get(t);if(!i)throw new Error(`unknown interval: ${e}`);if(n>1&&!i.every)throw new Error(`non-periodic interval: ${t}`);return[t,n]}function KS(e){return T5(Xx(e),"time")}function $p(e){return T5(Xx(e),"utc")}function T5([e,t],n){let r=(n==="time"?A5:ZS).get(e);return t>1&&(r=r.every(t),r[qu]=HS.get(e)*t,r[Gx]=n),r}function QS(e,t){if(!(t>1))return;let n=e[qu];if(!XS.some(([,i])=>i===n)||n%yo===0&&yo<n&&n<Kc)return;let[r]=XS[os(([,i])=>Math.log(i)).center(XS,Math.log(n*t))];return(e[Gx]==="time"?KS:$p)(r)}function I5(e,t,n){let r=t==="time"?Du:po;if(n==null)return r(e==="year"?"%Y":e==="month"?"%Y-%m":e==="day"?"%Y-%m-%d":e==="hour"||e==="minute"?"%Y-%m-%dT%H:%M":e==="second"?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M:%S.%L");let i=Iq(n);switch(e){case"millisecond":return Pu(r(".%L"),r(":%M:%S"),i);case"second":return Pu(r(":%S"),r("%-I:%M"),i);case"minute":return Pu(r("%-I:%M"),r("%p"),i);case"hour":return Pu(r("%-I %p"),r("%b %-d"),i);case"day":return Pu(r("%-d"),r("%b"),i);case"month":return Pu(r("%b"),r("%Y"),i);case"year":return r("%Y")}throw new Error("unable to format time ticks")}function Iq(e){return e==="left"||e==="right"?(t,n)=>`
|
|
12
12
|
${t}
|
|
13
13
|
${n}`:e==="top"?(t,n)=>`${n}
|
|
14
14
|
${t}`:(t,n)=>`${t}
|
|
15
|
-
${n}`}function Dq(e){return e==="time"?Yx:e==="utc"?zp:Tq}function SD(e,t,n){let r=Vt(U0(t,(i,o)=>Math.abs(o-i)));if(r<1e3)return wD("millisecond","utc",n);for(let[i,o,s,a]of Dq(e)){if(r>a||i==="hour"&&!r)break;if(t.every(c=>o.floor(c)>=c))return wD(i,s,n)}}function qu(e,t,n){return(r,i,o)=>{let s=e(r,i),a=t(r,i),c=i-As(o);return i!==c&&o[c]!==void 0&&a===t(o[c],c)?s:n(s,a)}}var tl=Object.getPrototypeOf(Uint8Array),Nq=Object.prototype.toString,QS=Symbol("reindex");function dt(e,t,n){let r=typeof t;return r==="string"?ID(e,JS(t),n):r==="function"?ID(e,t,n):r==="number"||t instanceof Date||r==="boolean"?qt(e,an(t),n):typeof t?.transform=="function"?MD(t.transform(e),n):Oq(MD(t,n),e?.[QS])}function Oq(e,t){return t?jp(e,t):e}function ID(e,t,n){return qt(e,n?.prototype instanceof tl?Bq(t):t,n)}function MD(e,t){return t===void 0?Pe(e):e instanceof t?e:t.prototype instanceof tl&&!(e instanceof tl)?t.from(e,tI):t.from(e)}function Bq(e){return(t,n)=>tI(e(t,n))}var Da=[null],JS=e=>t=>t[e],ve={transform:Jn},W={transform:e=>e};var Vp=()=>1,AD=()=>!0,$e=e=>e==null?e:`${e}`,At=e=>e==null?e:+e;var Ts=e=>e?e[0]:void 0,Na=e=>e?e[1]:void 0,TD=e=>e?e[2]:void 0,an=e=>()=>e;function Yu(e){let t=+`${e}`.slice(1)/100;return(n,r)=>jn(n,t,r)}function Xe(e){return e instanceof tl?e:qt(e,tI,Float64Array)}function tI(e){return e==null?NaN:Number(e)}function ED(e){return qt(e,eI)}function eI(e){return e instanceof Date&&!isNaN(e)?e:typeof e=="string"?Up(e):e==null||isNaN(e=+e)?void 0:new Date(e)}function Ae(e,t){return e===void 0&&(e=t),e===null?[void 0,"none"]:Fa(e)?[void 0,e]:[e,void 0]}function ee(e,t){return e===void 0&&(e=t),e===null||typeof e=="number"?[void 0,e]:[e,void 0]}function nI(e,t,n){if(e!=null)return He(e,t,n)}function He(e,t,n){let r=`${e}`.toLowerCase();if(!n.includes(r))throw new Error(`invalid ${t}: ${e}`);return r}function Pe(e){return e==null||e instanceof Array||e instanceof tl?e:Array.from(e)}function qt(e,t,n=Array){return e==null?e:e instanceof n?e.map(t):n.from(e,t)}function Oa(e,t=Array){return e instanceof t?e.slice():t.from(e)}function rI({x:e,x1:t,x2:n}){return e!==void 0||t!==void 0||n!==void 0}function iI({y:e,y1:t,y2:n}){return e!==void 0||t!==void 0||n!==void 0}function Wu(e){return rI(e)||iI(e)||e.interval!==void 0}function cn(e){return e?.toString===Nq}function go(e){return cn(e)&&(e.type!==void 0||e.domain!==void 0)}function Br(e){return cn(e)&&typeof e.transform!="function"}function bo(e){return Br(e)&&e.value===void 0&&e.channel===void 0}function oI(e,t,n,r=W){return t===void 0&&n===void 0?(t=0,n=e===void 0?r:e):t===void 0?t=e===void 0?0:e:n===void 0&&(n=e===void 0?0:e),[t,n]}function Ce(e,t){return e===void 0&&t===void 0?[Ts,Na]:[e,t]}function kn({z:e,fill:t,stroke:n}={}){return e===void 0&&([e]=Ae(t)),e===void 0&&([e]=Ae(n)),e}function Jn(e){let t=e.length,n=new Uint32Array(t);for(let r=0;r<t;++r)n[r]=r;return n}function jp(e,t){return qt(t,n=>e[n],e.constructor)}function Gu(e){return e.length===1?(t,n)=>e(jp(n,t)):e}function Es(e,t,n){return e.subarray?e.subarray(t,n):e.slice(t,n)}function Ds(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Xx(e,t){if(t[e]!==void 0)return t[e];switch(e){case"x1":case"x2":e="x";break;case"y1":case"y2":e="y";break}return t[e]}function ln(e){let t;return[{transform:()=>t,label:Mn(e)},n=>t=n]}function In(e){return e==null?[e]:ln(e)}function Mn(e,t){return typeof e=="string"?e:e&&e.label!==void 0?e.label:t}function Xu(e,t){return{transform(n){let r=e.transform(n),i=t.transform(n);return Te(r)||Te(i)?qt(r,(o,s)=>new Date((+r[s]+ +i[s])/2)):qt(r,(o,s)=>(+r[s]+ +i[s])/2,Float64Array)},label:e.label}}function el(e,t){let n=sI(t?.interval,t?.type);return n?qt(e,n):e}function sI(e,t){let n=Hu(e,t);return n&&(r=>Re(r)?n.floor(r):r)}function Hu(e,t){if(e!=null){if(typeof e=="number"){0<e&&e<1&&Number.isInteger(1/e)&&(e=-1/e);let n=Math.abs(e);return e<0?{floor:r=>Math.floor(r*n)/n,offset:r=>(r*n+1)/n,range:(r,i)=>ke(Math.ceil(r*n),i*n).map(o=>o/n)}:{floor:r=>Math.floor(r/n)*n,offset:r=>r+n,range:(r,i)=>ke(Math.ceil(r/n),i/n).map(o=>o*n)}}if(typeof e=="string")return(t==="time"?ZS:qp)(e);if(typeof e.floor!="function")throw new Error("invalid interval; missing floor method");if(typeof e.offset!="function")throw new Error("invalid interval; missing offset method");return e}}function xo(e,t){if(e=Hu(e,t),e&&typeof e.range!="function")throw new Error("invalid interval: missing range method");return e}function DD(e,t){if(e=xo(e,t),e&&typeof e.ceil!="function")throw new Error("invalid interval: missing ceil method");return e}function ND(e){return Ba(e)&&typeof e?.floor=="function"&&e.floor()instanceof Date}function Ba(e){return typeof e?.range=="function"}function ti(e){return e===void 0||Br(e)?e:{value:e}}function OD(e){return e==null?null:{transform:t=>dt(t,e,Float64Array),label:Mn(e)}}function BD(e){if(!tr(e))return!1;for(let t of e)if(t!=null)return typeof t=="object"&&"0"in t&&"1"in t}function tr(e){return e&&typeof e[Symbol.iterator]=="function"}function Hx(e){for(let t of e)if(t!=null)return typeof t!="object"||t instanceof Date}function Se(e){for(let t of e){if(t==null)continue;let n=typeof t;return n==="string"||n==="boolean"}}function Te(e){for(let t of e)if(t!=null)return t instanceof Date}function FD(e){for(let t of e)if(t!=null)return typeof t=="string"&&isNaN(t)&&Up(t)}function CD(e){for(let t of e)if(t!=null){if(typeof t!="string")return!1;if(t.trim())return!isNaN(t)}}function Ns(e){for(let t of e)if(t!=null)return typeof t=="number"}function Zx(e,t){let n;for(let r of e)if(r!=null){if(!t(r))return!1;n=!0}return n}var Fq=new Set("none,currentcolor,transparent,aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow".split(","));function Fa(e){return typeof e!="string"?!1:(e=e.toLowerCase().trim(),/^#[0-9a-f]{3,8}$/.test(e)||/^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.*\)$/.test(e)||Fq.has(e))}function LD(e){return typeof e=="number"&&(0<=e&&e<=1||isNaN(e))}function Jt(e){return e==null||Os(e)}function Os(e){return/^\s*none\s*$/i.test(e)}function kD(e){return/^\s*round\s*$/i.test(e)}function Kx(e,t){return nI(e,t,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function wo(e="middle"){return Kx(e,"frameAnchor")}function As(e){if(e==null)return;let t=e[0],n=e[e.length-1];return zn(t,n)}function RD(e={},...t){let n=e;for(let r of t)for(let i in r)if(n[i]===void 0){let o=r[i];n===e?n={...n,[i]:o}:n[i]=o}return n}function Cq(e){console.warn("named iterables are deprecated; please use an object instead");let t=new Set;return Object.fromEntries(Array.from(e,n=>{let{name:r}=n;if(r==null)throw new Error("missing name");let i=`${r}`;if(i==="__proto__")throw new Error(`illegal name: ${i}`);if(t.has(i))throw new Error(`duplicate name: ${i}`);return t.add(i),[r,n]}))}function Yp(e){return tr(e)?Cq(e):e}var ei=Symbol("position"),Fr=Symbol("color"),nl=Symbol("radius"),rl=Symbol("length"),il=Symbol("opacity"),Zu=Symbol("symbol"),$D=Symbol("projection"),ce=new Map([["x",ei],["y",ei],["fx",ei],["fy",ei],["r",nl],["color",Fr],["opacity",il],["symbol",Zu],["length",rl],["projection",$D]]);function PD(e){return e===ei||e===$D}function UD(e){return e===ei||e===nl||e===rl||e===il}var aI=Math.sqrt(3),cI=2/aI,Lq={draw(e,t){let n=Math.sqrt(t/Math.PI),r=n*cI,i=r/2;e.moveTo(0,r),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(0,-r),e.lineTo(-n,-i),e.lineTo(-n,i),e.closePath()}},lI=new Map([["asterisk",Ip],["circle",Is],["cross",Mp],["diamond",Ap],["diamond2",Tp],["hexagon",Lq],["plus",Ep],["square",Dp],["square2",Np],["star",Op],["times",Ru],["triangle",Bp],["triangle2",Fp],["wye",Cp]]);function uI(e){return e&&typeof e.draw=="function"}function zD(e){return uI(e)?!0:typeof e!="string"?!1:lI.has(e.toLowerCase())}function Ku(e){if(e==null||uI(e))return e;let t=lI.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid symbol: ${e}`)}function qD(e){if(e==null||uI(e))return[void 0,e];if(typeof e=="string"){let t=lI.get(`${e}`.toLowerCase());if(t)return[void 0,t]}return[e,void 0]}function un({filter:e,sort:t,reverse:n,transform:r,initializer:i,...o}={},s){if(r===void 0&&(e!=null&&(r=dI(e)),t!=null&&!bo(t)&&(r=fI(r,mI(t))),n&&(r=fI(r,pI))),s!=null&&i!=null)throw new Error("transforms cannot be applied after initializers");return{...o,...(t===null||bo(t))&&{sort:t},transform:fI(r,s)}}function xe({filter:e,sort:t,reverse:n,initializer:r,...i}={},o){return r===void 0&&(e!=null&&(r=dI(e)),t!=null&&!bo(t)&&(r=hI(r,mI(t))),n&&(r=hI(r,pI))),{...i,...(t===null||bo(t))&&{sort:t},initializer:hI(r,o)}}function fI(e,t){return e==null?t===null?void 0:t:t==null?e===null?void 0:e:function(n,r,i){return{data:n,facets:r}=e.call(this,n,r,i),t.call(this,Pe(n),r,i)}}function hI(e,t){return e==null?t===null?void 0:t:t==null?e===null?void 0:e:function(n,r,i,...o){let s,a,c,l,u,f;return{data:a=n,facets:c=r,channels:s}=e.call(this,n,r,i,...o),{data:u=a,facets:f=c,channels:l}=t.call(this,a,c,{...i,...s},...o),{data:u,facets:f,channels:{...s,...l}}}}function Qx(e,t){return(e.initializer!=null?xe:un)(e,t)}function VD(e,t){return Qx(t,dI(e))}function dI(e){return(t,n)=>{let r=dt(t,e);return{data:t,facets:n.map(i=>i.filter(o=>r[o]))}}}function jD({sort:e,...t}={}){return{...Qx(t,pI),sort:bo(e)?e:null}}function pI(e,t){return{data:e,facets:t.map(n=>n.slice().reverse())}}function YD({seed:e,sort:t,...n}={}){return{...Qx(n,WD(e==null?Math.random:qc(e))),sort:bo(t)?t:null}}function Jx(e,{sort:t,...n}={}){return{...(Br(e)&&e.channel!==void 0?xe:Qx)(n,mI(e)),sort:bo(t)?t:null}}function mI(e){return(typeof e=="function"&&e.length!==1?kq:WD)(e)}function kq(e){return(t,n)=>{let r=(i,o)=>e(t[i],t[o]);return{data:t,facets:n.map(i=>i.slice().sort(r))}}}function WD(e){let t,n;({channel:t,value:e,order:n}={...ti(e)});let r=t?.startsWith("-");if(r&&(t=t.slice(1)),n===void 0&&(n=r?Qc:sn),typeof n!="function")switch(`${n}`.toLowerCase()){case"ascending":n=sn;break;case"descending":n=Qc;break;default:throw new Error(`invalid order: ${n}`)}return(i,o,s)=>{let a;if(t===void 0)a=dt(i,e);else{if(s===void 0)throw new Error("channel sort requires an initializer");if(a=s[t],!a)return{};a=a.value}let c=(l,u)=>n(a[l],a[u]);return{data:i,facets:o.map(l=>l.slice().sort(c))}}}function Gp(e,t){return t1(null,null,e,t)}function La(e={y:"count"},t={}){let{x:n=W}=t;if(n==null)throw new Error("missing channel: x");return t1(n,null,e,t)}function ka(e={x:"count"},t={}){let{y:n=W}=t;if(n==null)throw new Error("missing channel: y");return t1(null,n,e,t)}function Xp(e={fill:"count"},t={}){let{x:n,y:r}=t;if([n,r]=Ce(n,r),n==null)throw new Error("missing channel: x");if(r==null)throw new Error("missing channel: y");return t1(n,r,e,t)}function t1(e,t,{data:n=r1,filter:r,sort:i,reverse:o,...s}={},a={}){s=gI(s,a),n=KD(n,W),i=i==null?void 0:HD("sort",i,a),r=r==null?void 0:ZD("filter",r,a);let[c,l]=In(e),[u,f]=In(t),{z:h,fill:d,stroke:p,x1:m,x2:g,y1:y,y2:b,...x}=a,[w,v]=In(h),[_]=Ae(d),[M]=Ae(p),[E,N]=In(_),[I,T]=In(M);return{..."z"in a&&{z:w||h},..."fill"in a&&{fill:E||d},..."stroke"in a&&{stroke:I||p},...un(x,(O,B,S)=>{let A=el(dt(O,e),S?.x),D=el(dt(O,t),S?.y),C=dt(O,h),k=dt(O,_),L=dt(O,M),R=Hp(s,{z:C,fill:k,stroke:L}),$=[],P=[],G=A&&l([]),J=D&&f([]),et=C&&v([]),ot=k&&N([]),j=L&&T([]),nt=0;for(let z of s)z.initialize(O);i&&i.initialize(O),r&&r.initialize(O);for(let z of B){let X=[];for(let rt of s)rt.scope("facet",z);i&&i.scope("facet",z),r&&r.scope("facet",z);for(let[rt,U]of Ca(z,R))for(let[Bt,ft]of Ca(U,D))for(let[jt,Yt]of Ca(ft,A)){let tt={data:O};if(A&&(tt.x=jt),D&&(tt.y=Bt),!(r&&!r.reduce(Yt,tt))){X.push(nt++),P.push(n.reduceIndex(Yt,O,tt)),A&&G.push(jt),D&&J.push(Bt),C&&et.push(R===C?rt:C[Yt[0]]),k&&ot.push(R===k?rt:k[Yt[0]]),L&&j.push(R===L?rt:L[Yt[0]]);for(let ne of s)ne.reduce(Yt,tt);i&&i.reduce(Yt,tt)}}$.push(X)}return bI($,i,o),{data:P,facets:$}}),...!_o(s,"x")&&(c?{x:c}:{x1:m,x2:g}),...!_o(s,"y")&&(u?{y:u}:{y1:y,y2:b}),...Object.fromEntries(s.map(({name:O,output:B})=>[O,B]))}}function _o(e,...t){for(let{name:n}of e)if(t.includes(n))return!0;return!1}function yI(e,t,n=e1){let r=Object.entries(e);return t.title!=null&&e.title===void 0&&r.push(["title",qq]),t.href!=null&&e.href===void 0&&r.push(["href",i1]),r.filter(([,i])=>i!==void 0).map(([i,o])=>o===null?Rq(i):n(i,o,t))}function e1(e,t,n,r=n1){let i;cn(t)&&"reduce"in t&&(i=t.scale,t=t.reduce);let o=r(e,t,n),[s,a]=ln(o.label),c;return{name:e,output:i===void 0?s:{value:s,scale:i},initialize(l){o.initialize(l),c=a([])},scope(l,u){o.scope(l,u)},reduce(l,u){c.push(o.reduce(l,u))}}}function Rq(e){return{name:e,initialize(){},scope(){},reduce(){}}}function n1(e,t,n,r=Qu){let i=Xx(e,n),o=r(t,i),s,a;return{label:Mn(o===Wp?null:i,o.label),initialize(c){s=i===void 0?c:dt(c,i),o.scope==="data"&&(a=o.reduceIndex(Jn(c),s))},scope(c,l){o.scope===c&&(a=o.reduceIndex(l,s))},reduce(c,l){return o.scope==null?o.reduceIndex(c,s,l):o.reduceIndex(c,s,a,l)}}}function Ca(e,t){return t?Zi(en(e,n=>t[n]),Ts):[[,e]]}function Qu(e,t,n=$q){if(e==null)return n(e);if(typeof e.reduceIndex=="function")return e;if(typeof e.reduce=="function"&&cn(e))return Uq(e);if(typeof e=="function")return zq(e);if(/^p\d{2}$/i.test(e))return Bs(Yu(e));switch(`${e}`.toLowerCase()){case"first":return i1;case"last":return Vq;case"identity":return r1;case"count":return Wp;case"distinct":return jq;case"sum":return t==null?Wp:Yq;case"proportion":return XD(t,"data");case"proportion-facet":return XD(t,"facet");case"deviation":return Bs(Vr);case"min":return Bs(oe);case"min-index":return Bs(R0);case"max":return Bs(Vt);case"max-index":return Bs(k0);case"mean":return GD(ss);case"median":return GD(Ai);case"variance":return Bs(la);case"mode":return Bs(eu)}return n(e)}function $q(e){throw new Error(`invalid reduce: ${e}`)}function gI(e,t){return yI(e,t,HD)}function HD(e,t,n){return e1(e,t,n,ZD)}function ZD(e,t,n){return n1(e,t,n,KD)}function KD(e,t){return Qu(e,t,Pq)}function Pq(e){switch(`${e}`.toLowerCase()){case"x":return Wq;case"y":return Gq}throw new Error(`invalid group reduce: ${e}`)}function Hp(e,t){for(let n in t){let r=t[n];if(r!==void 0&&!e.some(i=>i.name===n))return r}}function bI(e,t,n){if(t){let r=t.output.transform(),i=(o,s)=>sn(r[o],r[s]);e.forEach(o=>o.sort(i))}n&&e.forEach(r=>r.reverse())}function Uq(e){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...e,reduceIndex:e.reduce.bind(e)}}function zq(e){return{reduceIndex(t,n,r){return e(jp(n,t),r)}}}function Bs(e){return{reduceIndex(t,n){return e(t,r=>n[r])}}}function GD(e){return{reduceIndex(t,n){let r=e(t,i=>n[i]);return Te(n)?new Date(r):r}}}var r1={reduceIndex(e,t){return jp(t,e)}},i1={reduceIndex(e,t){return t[e[0]]}},qq={reduceIndex(e,t){let r=Zi(Mi(e,o=>o.length,o=>t[o]),Na),i=r.slice(-5).reverse();if(i.length<r.length){let o=r.slice(0,-4);i[4]=[`\u2026 ${o.length.toLocaleString("en-US")} more`,wn(o,Na)]}return i.map(([o,s])=>`${o} (${s.toLocaleString("en-US")})`).join(`
|
|
16
|
-
`)}},Vq={reduceIndex(e,t){return t[e[e.length-1]]}},Wp={label:"Frequency",reduceIndex(e){return e.length}},jq={label:"Distinct",reduceIndex(e,t){let n=new Vn;for(let r of e)n.add(t[r]);return n.size}},Yq=Bs(wn);function XD(e,t){return e==null?{scope:t,label:"Frequency",reduceIndex:(n,r,i=1)=>n.length/i}:{scope:t,reduceIndex:(n,r,i=1)=>wn(n,o=>r[o])/i}}var Wq={reduceIndex(e,t,{x:n}){return n}},Gq={reduceIndex(e,t,{y:n}){return n}};function QD(e){if(typeof e!="function")throw new Error(`invalid test function: ${e}`);return{reduceIndex(t,n,{data:r}){return n[t.find(i=>e(r[i],i,r))]}}}function Ju(e,{scale:t,type:n,value:r,filter:i,hint:o,label:s=Mn(r)},a){return o===void 0&&typeof r?.transform=="function"&&(o=r.hint),wI(a,{scale:t,type:n,value:dt(e,r),label:s,filter:i,hint:o})}function o1(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,Ju(t,r,n)]))}function tf(e,t){let n=Object.fromEntries(Object.entries(e).map(([r,{scale:i,value:o}])=>{let s=i==null?null:t[i];return[r,s==null?o:qt(o,s)]}));return n.channels=e,n}function wI(e,t){let{scale:n,value:r}=t;if(n===!0||n==="auto")switch(e){case"fill":case"stroke":case"color":t.scale=n!==!0&&Zx(r,Fa)?null:"color";break;case"fillOpacity":case"strokeOpacity":case"opacity":t.scale=n!==!0&&Zx(r,LD)?null:"opacity";break;case"symbol":n!==!0&&Zx(r,zD)?(t.scale=null,t.value=qt(r,Ku)):t.scale="symbol";break;default:t.scale=ce.has(e)?e:null;break}else if(n===!1)t.scale=null;else if(n!=null&&!ce.has(n))throw new Error(`unknown scale: ${n}`);return t}function t5(e,t,n,r,i){let{order:o,reverse:s,reduce:a=!0,limit:c}=i;for(let l in i){if(!ce.has(l))continue;let{value:u,order:f=o,reverse:h=s,reduce:d=a,limit:p=c}=ti(i[l]),m=u?.startsWith("-");if(m&&(u=u.slice(1)),f=f===void 0?m!==(u==="width"||u==="height")?n5:e5:Zq(f),d==null||d===!1)continue;let g=l==="fx"||l==="fy"?Hq(t,r[l]):Xq(n,l);if(!g)throw new Error(`missing channel for scale: ${l}`);let y=g.value,[b=0,x=1/0]=tr(p)?p:p<0?[p]:[0,p];if(u==null)g.domain=()=>{let w=Array.from(new Vn(y));return h&&(w=w.reverse()),(b!==0||x!==1/0)&&(w=w.slice(b,x)),w};else{let w=u==="data"?e:u==="height"?JD(n,"y1","y2"):u==="width"?JD(n,"x1","x2"):xI(n,u,u==="y"?"y2":u==="x"?"x2":void 0),v=Qu(d===!0?"max":d,w);g.domain=()=>{let _=H_(Jn(y),M=>v.reduceIndex(M,w),M=>y[M]);return f&&_.sort(f),h&&_.reverse(),(b!==0||x!==1/0)&&(_=_.slice(b,x)),_.map(Ts)}}}}function Xq(e,t){for(let n in e){let r=e[n];if(r.scale===t)return r}}function Hq(e,t){let n=e.original;if(n===e)return t;let r=t.value,i=t.value=[];for(let o=0;o<n.length;++o){let s=r[n[o][0]];for(let a of e[o])i[a]=s}return t}function JD(e,t,n){let r=xI(e,t),i=xI(e,n);return qt(i,(o,s)=>Math.abs(o-r[s]),Float64Array)}function xI(e,t,n){let r=e[t];if(!r&&n!==void 0&&(r=e[n]),r)return r.value;throw new Error(`missing channel: ${t}`)}function Zq(e){if(e==null||typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"ascending":return e5;case"descending":return n5}throw new Error(`invalid order: ${e}`)}function e5([e,t],[n,r]){return sn(t,r)||sn(e,n)}function n5([e,t],[n,r]){return Qc(t,r)||sn(e,n)}function Zp(e,t){let n=e[t];if(n){for(;n.source;)n=n.source;return n.source===null?null:n}}function s1(e){let t,n;return(...r)=>((n?.length!==r.length||n.some((i,o)=>i!==r[o]))&&(n=r,t=e(...r)),t)}var Kq=s1(e=>new Intl.NumberFormat(e)),Qq=s1((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{month:t}})),Jq=s1((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{weekday:t}}));function tV(e="en-US"){let t=Kq(e);return n=>n!=null&&!isNaN(n)?t.format(n):void 0}function r5(e="en-US",t="short"){let n=Qq(e,t);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2e3,+r)))?n.format(r):void 0}function i5(e="en-US",t="short"){let n=Jq(e,t);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2001,0,+r)))?n.format(r):void 0}function _I(e){return jx(e,"Invalid Date")}function eV(e="en-US"){let t=tV(e);return n=>(n instanceof Date?_I:typeof n=="number"?t:$e)(n)}var Ni=eV();var vI=0,SI;function o5(){let e=vI;return vI=0,SI=void 0,e}function Rn(e){e!==SI&&(SI=e,console.warn(e),++vI)}var Ee=(typeof window<"u"?window.devicePixelRatio>1:typeof it>"u")?0:.5,nV=0;function a1(){return`plot-clip-${++nV}`}function c1(e,{title:t,href:n,ariaLabel:r,ariaDescription:i,ariaHidden:o,target:s,fill:a,fillOpacity:c,stroke:l,strokeWidth:u,strokeOpacity:f,strokeLinejoin:h,strokeLinecap:d,strokeMiterlimit:p,strokeDasharray:m,strokeDashoffset:g,opacity:y,mixBlendMode:b,imageFilter:x,paintOrder:w,pointerEvents:v,shapeRendering:_,channels:M},{ariaLabel:E,fill:N="currentColor",fillOpacity:I,stroke:T="none",strokeOpacity:O,strokeWidth:B,strokeLinecap:S,strokeLinejoin:A,strokeMiterlimit:D,paintOrder:C}){N===null&&(a=null,c=null),T===null&&(l=null,f=null),Jt(N)?!Jt(T)&&(!Jt(a)||M?.fill)&&(T="none"):Jt(T)&&(!Jt(l)||M?.stroke)&&(N="none");let[k,L]=Ae(a,N),[R,$]=ee(c,I),[P,G]=Ae(l,T),[J,et]=ee(f,O),[ot,j]=ee(y);Os(G)||(u===void 0&&(u=B),d===void 0&&(d=S),h===void 0&&(h=A),p===void 0&&!kD(h)&&(p=D),!Os(L)&&w===void 0&&(w=C));let[nt,z]=ee(u);return N!==null&&(e.fill=se(L,"currentColor"),e.fillOpacity=Kp($,1)),T!==null&&(e.stroke=se(G,"none"),e.strokeWidth=Kp(z,1),e.strokeOpacity=Kp(et,1),e.strokeLinejoin=se(h,"miter"),e.strokeLinecap=se(d,"butt"),e.strokeMiterlimit=Kp(p,4),e.strokeDasharray=se(m,"none"),e.strokeDashoffset=se(g,"0")),e.target=$e(s),e.ariaLabel=$e(E),e.ariaDescription=$e(i),e.ariaHidden=$e(o),e.opacity=Kp(j,1),e.mixBlendMode=se(b,"normal"),e.imageFilter=se(x,"none"),e.paintOrder=se(w,"normal"),e.pointerEvents=se(v,"auto"),e.shapeRendering=se(_,"auto"),{title:{value:t,optional:!0,filter:null},href:{value:n,optional:!0,filter:null},ariaLabel:{value:r,optional:!0,filter:null},fill:{value:k,scale:"auto",optional:!0},fillOpacity:{value:R,scale:"auto",optional:!0},stroke:{value:P,scale:"auto",optional:!0},strokeOpacity:{value:J,scale:"auto",optional:!0},strokeWidth:{value:nt,optional:!0},opacity:{value:ot,scale:"auto",optional:!0}}}function rV(e,t){t&&e.filter(n=>Pp(t[n])).append("title").call(oV,t)}function iV(e,t){t&&e.filter(([n])=>Pp(t[n])).append("title").call(sV,t)}function oV(e,t){t&&e.text(n=>Ni(t[n]))}function sV(e,t){t&&e.text(([n])=>Ni(t[n]))}function Xt(e,{target:t,tip:n},{ariaLabel:r,title:i,fill:o,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:l,opacity:u,href:f}){r&&ut(e,"aria-label",h=>r[h]),o&&ut(e,"fill",h=>o[h]),s&&ut(e,"fill-opacity",h=>s[h]),a&&ut(e,"stroke",h=>a[h]),c&&ut(e,"stroke-opacity",h=>c[h]),l&&ut(e,"stroke-width",h=>l[h]),u&&ut(e,"opacity",h=>u[h]),f&&s5(e,h=>f[h],t),n||rV(e,i)}function ol(e,{target:t,tip:n},{ariaLabel:r,title:i,fill:o,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:l,opacity:u,href:f}){r&&ut(e,"aria-label",([h])=>r[h]),o&&ut(e,"fill",([h])=>o[h]),s&&ut(e,"fill-opacity",([h])=>s[h]),a&&ut(e,"stroke",([h])=>a[h]),c&&ut(e,"stroke-opacity",([h])=>c[h]),l&&ut(e,"stroke-width",([h])=>l[h]),u&&ut(e,"opacity",([h])=>u[h]),f&&s5(e,([h])=>f[h],t),n||iV(e,i)}function aV({ariaLabel:e,title:t,fill:n,fillOpacity:r,stroke:i,strokeOpacity:o,strokeWidth:s,opacity:a,href:c},{tip:l}){return[e,l?void 0:t,n,r,i,o,s,a,c].filter(u=>u!==void 0)}function Qp(e,t,n){let r=en(e,i=>t[i]);return n===void 0&&r.size>1+e.length>>1&&Rn("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),r.values()}function*l1(e,t,n,r){let{z:i}=n,{z:o}=r,s=aV(r,n),a=[...t,...s];for(let c of o?Qp(e,o,i):[e]){let l,u;t:for(let f of c){for(let h of a)if(!Re(h[f])){u&&u.push(-1);continue t}if(l===void 0){u&&(yield u),l=s.map(h=>Ds(h[f])),u=[f];continue}u.push(f);for(let h=0;h<s.length;++h)if(Ds(s[h][f])!==l[h]){yield u,l=s.map(p=>Ds(p[f])),u=[f];continue t}}u&&(yield u)}}function u1(e){return e===!0?e="frame":e===!1?e=null:e!=null&&(e=He(e,"clip",["frame","sphere"])),e}function cV(e,t,n,r){let i,{clip:o=r.clip}=t;switch(o){case"frame":{let{width:s,height:a,marginLeft:c,marginRight:l,marginTop:u,marginBottom:f}=n,h=a1();i=`url(#${h})`,e=at("svg:g",r).call(d=>d.append("svg:clipPath").attr("id",h).append("rect").attr("x",c).attr("y",u).attr("width",s-l-c).attr("height",a-u-f)).each(function(){this.appendChild(e.node()),e.node=()=>this});break}case"sphere":{let{projection:s}=r;if(!s)throw new Error('the "sphere" clip option requires a projection');let a=a1();i=`url(#${a})`,e.append("clipPath").attr("id",a).append("path").attr("d",vn(s)({type:"Sphere"}));break}}ut(e,"aria-label",t.ariaLabel),ut(e,"aria-description",t.ariaDescription),ut(e,"aria-hidden",t.ariaHidden),ut(e,"clip-path",i)}function Ot(e,t,n,r){cV(e,t,n,r),ut(e,"fill",t.fill),ut(e,"fill-opacity",t.fillOpacity),ut(e,"stroke",t.stroke),ut(e,"stroke-width",t.strokeWidth),ut(e,"stroke-opacity",t.strokeOpacity),ut(e,"stroke-linejoin",t.strokeLinejoin),ut(e,"stroke-linecap",t.strokeLinecap),ut(e,"stroke-miterlimit",t.strokeMiterlimit),ut(e,"stroke-dasharray",t.strokeDasharray),ut(e,"stroke-dashoffset",t.strokeDashoffset),ut(e,"shape-rendering",t.shapeRendering),ut(e,"filter",t.imageFilter),ut(e,"paint-order",t.paintOrder);let{pointerEvents:i=r.pointerSticky===!1?"none":void 0}=t;ut(e,"pointer-events",i)}function Tt(e,t){lV(e,"mix-blend-mode",t.mixBlendMode),ut(e,"opacity",t.opacity)}function s5(e,t,n){e.each(function(r){let i=t(r);if(i!=null){let o=this.ownerDocument.createElementNS(jr.svg,"a");o.setAttribute("fill","inherit"),o.setAttributeNS(jr.xlink,"href",i),n!=null&&o.setAttribute("target",n),this.parentNode.insertBefore(o,this).appendChild(this)}})}function ut(e,t,n){n!=null&&e.attr(t,n)}function lV(e,t,n){n!=null&&e.style(t,n)}function _t(e,t,{x:n,y:r},i=Ee,o=Ee){i+=t.dx,o+=t.dy,n?.bandwidth&&(i+=n.bandwidth()/2),r?.bandwidth&&(o+=r.bandwidth()/2),(i||o)&&e.attr("transform",`translate(${i},${o})`)}function se(e,t){if((e=$e(e))!==t)return e}function Kp(e,t){if((e=At(e))!==t)return e}var uV=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function ef(e){if(e===void 0)return"plot-d6a7b5";if(e=`${e}`,!uV.test(e))throw new Error(`invalid class name: ${e}`);return e}function nf(e,t){if(typeof t=="string")e.property("style",t);else if(t!=null)for(let n of e)Object.assign(n.style,t)}function fn({frameAnchor:e},{width:t,height:n,marginTop:r,marginRight:i,marginBottom:o,marginLeft:s}){return[/left$/.test(e)?s:/right$/.test(e)?t-i:(s+t-i)/2,/^top/.test(e)?r:/^bottom/.test(e)?n-o:(r+n-o)/2]}function Ra(e={}){let{document:t=typeof window<"u"?window.document:void 0,clip:n}=e;return{document:t,clip:u1(n)}}function at(e,{document:t}){return Pt(cs(e).call(t.documentElement))}var c5=Math.PI,Fs=2*c5,a5=.618;function l5({projection:e,inset:t=0,insetTop:n=t,insetRight:r=t,insetBottom:i=t,insetLeft:o=t}={},s){if(e==null)return;if(typeof e.stream=="function")return e;let a,c,l="frame";if(cn(e)){let v;if({type:e,domain:c,inset:v,insetTop:n=v!==void 0?v:n,insetRight:r=v!==void 0?v:r,insetBottom:i=v!==void 0?v:i,insetLeft:o=v!==void 0?v:o,clip:l=l,...a}=e,e==null)return}typeof e!="function"&&({type:e}=u5(e));let{width:u,height:f,marginLeft:h,marginRight:d,marginTop:p,marginBottom:m}=s,g=u-h-d-o-r,y=f-p-m-n-i;if(e=e?.({width:g,height:y,clip:l,...a}),e==null)return;l=fV(l,h,p,u-d,f-m);let b=h+o,x=p+n,w;if(c!=null){let[[v,_],[M,E]]=vn(e).bounds(c),N=Math.min(g/(M-v),y/(E-_));N>0?(b-=(N*(v+M)-g)/2,x-=(N*(_+E)-y)/2,w=Object.assign(Uc({point(I,T){this.stream.point(I*N+b,T*N+x)}}),{invert:([I,T])=>[(I-b)/N,(T-x)/N]})):Rn("Warning: the projection could not be fit to the specified domain; using the default scale.")}return w??=b===0&&x===0?f5():Object.assign(Uc({point(v,_){this.stream.point(v+b,_+x)}}),{invert:([v,_])=>[v-b,_-x]}),{stream:v=>e.stream(w.stream(l(v))),invert:v=>e.invert(w.invert(v))}}function u5(e){switch(`${e}`.toLowerCase()){case"albers-usa":return Oi(_2,.7463,.4673);case"albers":return f1(Kd,.7463,.4673);case"azimuthal-equal-area":return Oi(S2,4,4);case"azimuthal-equidistant":return Oi(M2,Fs,Fs);case"conic-conformal":return f1(E2,Fs,Fs);case"conic-equal-area":return f1(wa,6.1702,2.9781);case"conic-equidistant":return f1(N2,7.312,3.6282);case"equal-earth":return Oi(B2,5.4133,2.6347);case"equirectangular":return Oi(D2,Fs,c5);case"gnomonic":return Oi(C2,3.4641,3.4641);case"identity":return{type:f5};case"reflect-y":return{type:hV};case"mercator":return Oi(A2,Fs,Fs);case"orthographic":return Oi(k2,2,2);case"stereographic":return Oi($2,2,2);case"transverse-mercator":return Oi(U2,Fs,Fs);default:throw new Error(`unknown projection type: ${e}`)}}function fV(e,t,n,r,i){if(e===!1||e==null||typeof e=="number")return o=>o;switch(e===!0&&(e="frame"),`${e}`.toLowerCase()){case"frame":return wu(t,n,r,i);default:throw new Error(`unknown projection clip type: ${e}`)}}function Oi(e,t,n){return{type:({width:r,height:i,rotate:o,precision:s=.15,clip:a})=>{let c=e();return s!=null&&c.precision?.(s),o!=null&&c.rotate?.(o),typeof a=="number"&&c.clipAngle?.(a),c.scale(Math.min(r/t,i/n)),c.translate([r/2,i/2]),c},aspectRatio:n/t}}function f1(e,t,n){let{type:r,aspectRatio:i}=Oi(e,t,n);return{type:o=>{let{parallels:s,domain:a,width:c,height:l}=o,u=r(o);return s!=null&&(u.parallels(s),a===void 0&&u.fitSize([c,l],{type:"Sphere"})),u},aspectRatio:i}}var f5=an({stream:e=>e,invert:e=>e}),hV=an(Object.assign(Uc({point(e,t){this.stream.point(e,-t)}}),{invert:([e,t])=>[e,-t]}));function II(e,t,n,r){let i=n[e],o=n[t],s=i.length,a=n[e]=new Float64Array(s).fill(NaN),c=n[t]=new Float64Array(s).fill(NaN),l,u=r.stream({point(f,h){a[l]=f,c[l]=h}});for(l=0;l<s;++l)u.point(i[l],o[l])}function h5({projection:e}={}){return e==null?!1:typeof e.stream=="function"?!0:(cn(e)&&(e=e.type),e!=null)}function d5(e){if(typeof e?.stream=="function")return a5;if(cn(e)&&(e=e.type),e!=null){if(typeof e!="function"){let{aspectRatio:t}=u5(e);if(t)return t}return a5}}function $a(e,t,{projection:n}){let{x:r,y:i}=e,o={};return r&&(o.x=r),i&&(o.y=i),o=tf(o,t),n&&r?.scale==="x"&&i?.scale==="y"&&II("x","y",o,n),r&&(o.x=Xe(o.x)),i&&(o.y=Xe(o.y)),o}function p5(e){let t=[],n=[],r={scale:"x",value:t},i={scale:"y",value:n},o={point(s,a){t.push(s),n.push(a)},lineStart(){},lineEnd(){},polygonStart(){},polygonEnd(){},sphere(){}};for(let s of e.value)Er(s,o);return[r,i]}var dV=["#4269d0","#efb118","#ff725c","#6cc5b0","#3ca951","#ff8ab7","#a463f2","#97bbf5","#9c6b4e","#9498a0"],x5=new Map([["accent",uS],["category10",lS],["dark2",fS],["observable10",dV],["paired",hS],["pastel1",dS],["pastel2",pS],["set1",mS],["set2",yS],["set3",gS],["tableau10",bS]]);function w5(e){return e!=null&&x5.has(`${e}`.toLowerCase())}var m5=new Map([...x5,["brbg",Cs(vb,Sb)],["prgn",Cs(Ib,Mb)],["piyg",Cs(Ab,Tb)],["puor",Cs(Eb,Db)],["rdbu",Cs(wp,Bu)],["rdgy",Cs(Nb,Ob)],["rdylbu",Cs(_p,Fu)],["rdylgn",Cs(Bb,Fb)],["spectral",Cs(Cb,Lb)],["burd",y5(wp,Bu)],["buylrd",y5(_p,Fu)],["blues",hn(sx,ax)],["greens",hn(cx,lx)],["greys",hn(ux,fx)],["oranges",hn(yx,gx)],["purples",hn(hx,dx)],["reds",hn(px,mx)],["turbo",Ls(Ax)],["viridis",Ls(Ex)],["magma",Ls(Dx)],["inferno",Ls(Nx)],["plasma",Ls(Ox)],["cividis",Ls(bx)],["cubehelix",Ls(xx)],["warm",Ls(_x)],["cool",Ls(vx)],["bugn",hn(kb,Rb)],["bupu",hn($b,Pb)],["gnbu",hn(Ub,zb)],["orrd",hn(qb,Vb)],["pubu",hn(Wb,Gb)],["pubugn",hn(jb,Yb)],["purd",hn(Xb,Hb)],["rdpu",hn(Zb,Kb)],["ylgn",hn(tx,ex)],["ylgnbu",hn(Qb,Jb)],["ylorbr",hn(nx,rx)],["ylorrd",hn(ix,ox)],["rainbow",g5(Sx)],["sinebow",g5(Mx)]]);function hn(e,t){return({length:n})=>n===1?[e[3][1]]:n===2?[e[3][1],e[3][2]]:(n=Math.max(3,Math.floor(n)),n>9?Nn(t,n):e[n])}function Cs(e,t){return({length:n})=>n===2?[e[3][0],e[3][2]]:(n=Math.max(3,Math.floor(n)),n>11?Nn(t,n):e[n])}function y5(e,t){return({length:n})=>n===2?[e[3][2],e[3][0]]:(n=Math.max(3,Math.floor(n)),n>11?Nn(r=>t(1-r),n):e[n].slice().reverse())}function Ls(e){return({length:t})=>Nn(e,Math.max(2,Math.floor(t)))}function g5(e){return({length:t})=>Nn(e,Math.floor(t)+1).slice(0,-1)}function MI(e){let t=`${e}`.toLowerCase();if(!m5.has(t))throw new Error(`unknown ordinal scheme: ${t}`);return m5.get(t)}function Jp(e,t){let n=MI(e),r=typeof n=="function"?n({length:t}):n;return r.length!==t?r.slice(0,t):r}function _5(e,t="greys"){let n=new Set,[r,i]=Jp(t,2);for(let o of e)if(o!=null)if(o===!0)n.add(i);else if(o===!1)n.add(r);else return;return[...n]}var b5=new Map([["brbg",Sb],["prgn",Mb],["piyg",Tb],["puor",Db],["rdbu",Bu],["rdgy",Ob],["rdylbu",Fu],["rdylgn",Fb],["spectral",Lb],["burd",e=>Bu(1-e)],["buylrd",e=>Fu(1-e)],["blues",ax],["greens",lx],["greys",fx],["purples",dx],["reds",mx],["oranges",gx],["turbo",Ax],["viridis",Ex],["magma",Dx],["inferno",Nx],["plasma",Ox],["cividis",bx],["cubehelix",xx],["warm",_x],["cool",vx],["bugn",Rb],["bupu",Pb],["gnbu",zb],["orrd",Vb],["pubugn",Yb],["pubu",Gb],["purd",Hb],["rdpu",Kb],["ylgnbu",Jb],["ylgn",ex],["ylorbr",rx],["ylorrd",ox],["rainbow",Sx],["sinebow",Mx]]);function rf(e){let t=`${e}`.toLowerCase();if(!b5.has(t))throw new Error(`unknown quantitative scheme: ${t}`);return b5.get(t)}var pV=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function v5(e){return e!=null&&pV.has(`${e}`.toLowerCase())}var TI=e=>t=>e(1-t),AI=[0,1],S5=new Map([["number",ge],["rgb",Yr],["hsl",_v],["hcl",vv],["lab",og]]);function EI(e){let t=`${e}`.toLowerCase();if(!S5.has(t))throw new Error(`unknown interpolator: ${t}`);return S5.get(t)}function sf(e,t,n,{type:r,nice:i,clamp:o,zero:s,domain:a=O5(e,n),unknown:c,round:l,scheme:u,interval:f,range:h=ce.get(e)===nl?bV(n,a):ce.get(e)===rl?xV(n,a):ce.get(e)===il?AI:void 0,interpolate:d=ce.get(e)===Fr?u==null&&h!==void 0?Yr:rf(u!==void 0?u:r==="cyclical"?"rainbow":"turbo"):l?Oc:ge,reverse:p}){if(f=xo(f,r),(r==="cyclical"||r==="sequential")&&(r="linear"),typeof d!="function"&&(d=EI(d)),p=!!p,h!==void 0){let m=(a=Pe(a)).length,g=(h=Pe(h)).length;if(m!==g){if(d.length===1)throw new Error("invalid piecewise interpolator");d=to(d,h),h=void 0}}if(d.length===1?(p&&(d=TI(d),p=!1),h===void 0&&(h=Float64Array.from(a,(m,g)=>g/(a.length-1)),h.length===2&&(h=AI)),t.interpolate((h===AI?an:tm)(d))):t.interpolate(d),s){let[m,g]=ie(a);(m>0||g<0)&&(a=Oa(a),As(a)!==Math.sign(m)?a[a.length-1]=0:a[0]=0)}return p&&(a=fa(a)),t.domain(a).unknown(c),i&&(t.nice(mV(i,r)),a=t.domain()),h!==void 0&&t.range(h),o&&t.clamp(o),{type:r,domain:a,range:h,scale:t,interpolate:d,interval:f}}function mV(e,t){return e===!0?void 0:typeof e=="number"?e:DD(e,t)}function I5(e,t,n){return sf(e,ys(),t,n)}function M5(e,t,n){return DI(e,t,{...n,exponent:.5})}function DI(e,t,{exponent:n=1,...r}){return sf(e,lp().exponent(n),t,{...r,type:"pow"})}function A5(e,t,{base:n=10,domain:r=wV(t),...i}){return sf(e,ap().base(n),t,{...i,domain:r})}function T5(e,t,{constant:n=1,...r}){return sf(e,cp().constant(n),t,r)}function E5(e,t,{range:n,quantiles:r=n===void 0?5:(n=[...n]).length,n:i=r,scheme:o="rdylbu",domain:s=_V(t),unknown:a,interpolate:c,reverse:l}){return n===void 0&&(n=c!==void 0?Nn(c,i):ce.get(e)===Fr?Jp(o,i):void 0),s.length>0&&(s=up(s,n===void 0?{length:i}:n).quantiles()),h1(e,t,{domain:s,range:n,reverse:l,unknown:a})}function D5(e,t,{range:n,n:r=n===void 0?5:(n=[...n]).length,scheme:i="rdylbu",domain:o=O5(e,t),unknown:s,interpolate:a,reverse:c}){let[l,u]=ie(o),f;return n===void 0?(f=xn(l,u,r),f[0]<=l&&f.splice(0,1),f[f.length-1]>=u&&f.pop(),r=f.length+1,n=a!==void 0?Nn(a,r):ce.get(e)===Fr?Jp(i,r):void 0):(f=Nn(ge(l,u),r+1).slice(1,-1),l instanceof Date&&(f=f.map(h=>new Date(h)))),As(Pe(o))<0&&f.reverse(),h1(e,t,{domain:f,range:n,reverse:c,unknown:s})}function h1(e,t,{domain:n=[0],unknown:r,scheme:i="rdylbu",interpolate:o,range:s=o!==void 0?Nn(o,n.length+1):ce.get(e)===Fr?Jp(i,n.length+1):void 0,reverse:a}){n=Pe(n);let c=As(n);if(!isNaN(c)&&!yV(n,c))throw new Error(`the ${e} scale has a non-monotonic domain`);return a&&(s=fa(s)),{type:"threshold",scale:fp(c<0?fa(n):n,s===void 0?[]:s).unknown(r),domain:n,range:s}}function yV(e,t){for(let n=1,r=e.length,i=e[0];n<r;++n){let o=zn(i,i=e[n]);if(o!==0&&o!==t)return!1}return!0}function N5(e){return{type:"identity",scale:UD(ce.get(e))?op():t=>t}}function of(e,t=zu){return e.length?[oe(e,({value:n})=>n===void 0?n:oe(n,t)),Vt(e,({value:n})=>n===void 0?n:Vt(n,t))]:[0,1]}function O5(e,t){let n=ce.get(e);return(n===nl||n===il||n===rl?gV:of)(t)}function gV(e){return[0,e.length?Vt(e,({value:t})=>t===void 0?t:Vt(t,zu)):1]}function bV(e,t){let n=e.find(({radius:s})=>s!==void 0);if(n!==void 0)return[0,n.radius];let r=jn(e,.5,({value:s})=>s===void 0?NaN:jn(s,.25,Qn)),i=t.map(s=>3*Math.sqrt(s/r)),o=30/Vt(i);return o<1?i.map(s=>s*o):i}function xV(e,t){let n=Ai(e,({value:o})=>o===void 0?NaN:Ai(o,Math.abs)),r=t.map(o=>12*o/n),i=60/Vt(r);return i<1?r.map(o=>o*i):r}function wV(e){for(let{value:t}of e)if(t!==void 0)for(let n of t){if(n>0)return of(e,Qn);if(n<0)return of(e,Ma)}return[1,10]}function _V(e){let t=[];for(let{value:n}of e)if(n!==void 0)for(let r of n)t.push(r);return t}function tm(e){return(t,n)=>r=>e(t+r*(n-t))}function d1(e,t,n,r,{type:i,nice:o,clamp:s,domain:a=of(r),unknown:c,pivot:l=0,scheme:u,range:f,symmetric:h=!0,interpolate:d=ce.get(e)===Fr?u==null&&f!==void 0?Yr:rf(u!==void 0?u:"rdbu"):ge,reverse:p}){l=+l,a=Pe(a);let[m,g]=a;if(a.length>2&&Rn(`Warning: the diverging ${e} scale domain contains extra elements.`),zn(m,g)<0&&([m,g]=[g,m],p=!p),m=Math.min(m,l),g=Math.max(g,l),typeof d!="function"&&(d=EI(d)),f!==void 0&&(d=d.length===1?tm(d)(...f):to(d,f)),p&&(d=TI(d)),h){let y=n.apply(l),b=y-n.apply(m),x=n.apply(g)-y;b<x?m=n.invert(y-x):b>x&&(g=n.invert(y+b))}return t.domain([m,l,g]).unknown(c).interpolator(d),s&&t.clamp(s),o&&t.nice(o),{type:i,domain:[m,g],pivot:l,interpolate:d,scale:t}}function B5(e,t,n){return d1(e,xp(),vV,t,n)}function F5(e,t,n){return NI(e,t,{...n,exponent:.5})}function NI(e,t,{exponent:n=1,...r}){return d1(e,_b().exponent(n=+n),MV(n),t,{...r,type:"diverging-pow"})}function C5(e,t,{base:n=10,pivot:r=1,domain:i=of(t,r<0?Ma:Qn),...o}){return d1(e,xb().base(n=+n),SV,t,{domain:i,pivot:r,...o})}function L5(e,t,{constant:n=1,...r}){return d1(e,wb().constant(n=+n),AV(n),t,r)}var vV={apply(e){return e},invert(e){return e}},SV={apply:Math.log,invert:Math.exp},IV={apply(e){return Math.sign(e)*Math.sqrt(Math.abs(e))},invert(e){return Math.sign(e)*(e*e)}};function MV(e){return e===.5?IV:{apply(t){return Math.sign(t)*Math.pow(Math.abs(t),e)},invert(t){return Math.sign(t)*Math.pow(Math.abs(t),1/e)}}}function AV(e){return{apply(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))},invert(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}}function k5(e,t,n,r){return sf(e,t,n,r)}function R5(e,t,n){return k5(e,yb(),t,n)}function $5(e,t,n){return k5(e,gb(),t,n)}var af=Symbol("ordinal");function U5(e,t,n,{type:r,interval:i,domain:o,range:s,reverse:a,hint:c}){return i=xo(i,r),o===void 0&&(o=Y5(n,i,e)),(r==="categorical"||r===af)&&(r="ordinal"),a&&(o=fa(o)),o=t.domain(o).domain(),s!==void 0&&(typeof s=="function"&&(s=s(o)),t.range(s)),{type:r,domain:o,range:s,scale:t,hint:c,interval:i}}function z5(e,t,{type:n,interval:r,domain:i,range:o,scheme:s,unknown:a,...c}){r=xo(r,n),i===void 0&&(i=Y5(t,r,e));let l;if(ce.get(e)===Zu)l=TV(t),o=o===void 0?EV(l):qt(o,Ku);else if(ce.get(e)===Fr&&(o===void 0&&(n==="ordinal"||n===af)&&(o=_5(i,s),o!==void 0&&(s=void 0)),s===void 0&&o===void 0&&(s=n==="ordinal"?"turbo":"observable10"),s!==void 0))if(o!==void 0){let u=rf(s),f=o[0],h=o[1]-o[0];o=({length:d})=>Nn(p=>u(f+h*p),d)}else o=MI(s);if(a===rp)throw new Error(`implicit unknown on ${e} scale is not supported`);return U5(e,Vc().unknown(a),t,{...c,type:n,domain:i,range:o,hint:l})}function q5(e,t,{align:n=.5,padding:r=.5,...i}){return j5(G2().align(n).padding(r),t,i,e)}function V5(e,t,{align:n=.5,padding:r=.1,paddingInner:i=r,paddingOuter:o=e==="fx"||e==="fy"?0:r,...s}){return j5(va().align(n).paddingInner(i).paddingOuter(o),t,s,e)}function j5(e,t,n,r){let{round:i}=n;return i!==void 0&&e.round(i=!!i),e=U5(r,e,t,n),e.round=i,e}function Y5(e,t,n){let r=new Vn;for(let{value:i,domain:o}of e){if(o!==void 0)return o();if(i!==void 0)for(let s of i)r.add(s)}if(t!==void 0){let[i,o]=ie(r).map(t.floor,t);return t.range(i,t.offset(o))}if(r.size>1e4&&ce.get(n)===ei)throw new Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return Zi(r,sn)}function P5(e,t){let n;for(let{hint:r}of e){let i=r?.[t];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}function TV(e){return{fill:P5(e,"fill"),stroke:P5(e,"stroke")}}function EV(e){return Jt(e.fill)?MS:Rx}function em(e,{label:t,inset:n=0,insetTop:r=n,insetRight:i=n,insetBottom:o=n,insetLeft:s=n,round:a,nice:c,clamp:l,zero:u,align:f,padding:h,projection:d,facet:{label:p=t}={},...m}={}){let g={};for(let[y,b]of e){let x=m[y],w=J5(y,b,{round:ce.get(y)===ei?a:void 0,nice:c,clamp:l,zero:u,align:f,padding:h,projection:d,...x});if(w){let{label:v=y==="fx"||y==="fy"?p:t,percent:_,transform:M,inset:E,insetTop:N=E!==void 0?E:y==="y"?r:0,insetRight:I=E!==void 0?E:y==="x"?i:0,insetBottom:T=E!==void 0?E:y==="y"?o:0,insetLeft:O=E!==void 0?E:y==="x"?s:0}=x||{};if(M==null)M=void 0;else if(typeof M!="function")throw new Error("invalid scale transform; not a function");w.percent=!!_,w.label=v===void 0?DV(b,w):v,w.transform=M,y==="x"||y==="fx"?(w.insetLeft=+O,w.insetRight=+I):(y==="y"||y==="fy")&&(w.insetTop=+N,w.insetBottom=+T),g[y]=w}}return g}function BI(e){let t={},n={scales:t};for(let[r,i]of Object.entries(e)){let{scale:o,type:s,interval:a,label:c}=i;t[r]=eN(i),n[r]=o,o.type=s,a!=null&&(o.interval=a),c!=null&&(o.label=c)}return n}function Z5(e,t){let{x:n,y:r,fx:i,fy:o}=e,s=i||o?y1(t):t;i&&W5(i,s),o&&G5(o,s);let a=i||o?FI(e,t):t;n&&W5(n,a),r&&G5(r,a)}function DV(e=[],t){let n;for(let{label:r}of e)if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}if(n!==void 0)return!vo(t)&&t.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function m1(e){return Math.sign(As(e.domain()))*Math.sign(As(e.range()))}function y1(e){let{marginTop:t,marginRight:n,marginBottom:r,marginLeft:i,width:o,height:s,facet:{marginTop:a,marginRight:c,marginBottom:l,marginLeft:u}}=e;return{marginTop:Math.max(t,a),marginRight:Math.max(n,c),marginBottom:Math.max(r,l),marginLeft:Math.max(i,u),width:o,height:s}}function FI({fx:e,fy:t},n){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:a,height:c}=y1(n);return{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:e?e.scale.bandwidth()+s+i:a,height:t?t.scale.bandwidth()+r+o:c,facet:{width:a,height:c}}}function W5(e,t){if(e.range===void 0){let{insetLeft:n,insetRight:r}=e,{width:i,marginLeft:o=0,marginRight:s=0}=t,a=o+n,c=i-s-r;e.range=[a,Math.max(a,c)],vo(e)||(e.range=Q5(e)),e.scale.range(e.range)}K5(e)}function G5(e,t){if(e.range===void 0){let{insetTop:n,insetBottom:r}=e,{height:i,marginTop:o=0,marginBottom:s=0}=t,a=o+n,c=i-s-r;e.range=[Math.max(a,c),a],vo(e)?e.range.reverse():e.range=Q5(e),e.scale.range(e.range)}K5(e)}function K5(e){e.round===void 0&&BV(e)&&NV(e)<=30&&e.scale.round(!0)}function NV({scale:e}){let t=e.domain().length,[n,r]=e.range(),i=e.paddingInner?e.paddingInner():1,o=e.paddingOuter?e.paddingOuter():e.padding(),s=t-i,a=Math.abs(r-n)/Math.max(1,s+o*2);return(a-Math.floor(a))*s}function Q5(e){let t=e.scale.domain().length+CI(e);if(!(t>2))return e.range;let[n,r]=e.range;return Array.from({length:t},(i,o)=>n+o/(t-1)*(r-n))}function g1(e,t,n){return J5(e,n===void 0?void 0:[{hint:n}],{...t})}function J5(e,t=[],n={}){let r=OV(e,t,n);if(n.type===void 0&&n.domain===void 0&&n.range===void 0&&n.interval==null&&e!=="fx"&&e!=="fy"&&vo({type:r})){let i=t.map(({value:o})=>o).filter(o=>o!==void 0);i.some(Te)?Rn(`Warning: some data associated with the ${e} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${cf(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${e} scale to "${cf(r)}".`):i.some(FD)?Rn(`Warning: some data associated with the ${e} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${cf(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${e} scale to "${cf(r)}".`):i.some(CD)&&Rn(`Warning: some data associated with the ${e} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${cf(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${e} scale to "${cf(r)}".`)}switch(n.type=r,r){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":n=p1(t,n,Xe);break;case"identity":switch(ce.get(e)){case ei:n=p1(t,n,Xe);break;case Zu:n=p1(t,n,FV);break}break;case"utc":case"time":n=p1(t,n,ED);break}switch(r){case"diverging":return B5(e,t,n);case"diverging-sqrt":return F5(e,t,n);case"diverging-pow":return NI(e,t,n);case"diverging-log":return C5(e,t,n);case"diverging-symlog":return L5(e,t,n);case"categorical":case"ordinal":case af:return z5(e,t,n);case"cyclical":case"sequential":case"linear":return I5(e,t,n);case"sqrt":return M5(e,t,n);case"threshold":return h1(e,t,n);case"quantile":return E5(e,t,n);case"quantize":return D5(e,t,n);case"pow":return DI(e,t,n);case"log":return A5(e,t,n);case"symlog":return T5(e,t,n);case"utc":return $5(e,t,n);case"time":return R5(e,t,n);case"point":return q5(e,t,n);case"band":return V5(e,t,n);case"identity":return N5(e);case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function cf(e){return typeof e=="symbol"?e.description:e}function X5(e){return typeof e=="string"?`${e}`.toLowerCase():e}var H5={toString:()=>"projection"};function OV(e,t,{type:n,domain:r,range:i,scheme:o,pivot:s,projection:a}){if(n=X5(n),e==="fx"||e==="fy")return"band";(e==="x"||e==="y")&&a!=null&&(n=H5);for(let l of t){let u=X5(l.type);if(u!==void 0){if(n===void 0)n=u;else if(n!==u)throw new Error(`scale incompatible with channel: ${n} !== ${u}`)}}if(n===H5)return;if(n!==void 0)return n;if(r===void 0&&!t.some(({value:l})=>l!==void 0))return;let c=ce.get(e);if(c===nl)return"sqrt";if(c===il||c===rl)return"linear";if(c===Zu)return"ordinal";if((r||i||[]).length>2)return OI(c);if(r!==void 0){if(Se(r))return OI(c);if(Te(r))return"utc"}else{let l=t.map(({value:u})=>u).filter(u=>u!==void 0);if(l.some(Se))return OI(c);if(l.some(Te))return"utc"}if(c===Fr){if(s!=null||v5(o))return"diverging";if(w5(o))return"categorical"}return"linear"}function OI(e){switch(e){case ei:return"point";case Fr:return af;default:return"ordinal"}}function vo({type:e}){return e==="ordinal"||e==="point"||e==="band"||e===af}function CI({type:e}){return e==="threshold"}function BV({type:e}){return e==="point"||e==="band"}function er(e){if(e===void 0)return!0;let t=e.domain(),n=e(t[0]);for(let r=1,i=t.length;r<i;++r)if(e(t[r])-n)return!1;return!0}function p1(e,{domain:t,...n},r){for(let i of e)i.value!==void 0&&(t===void 0&&(t=i.value?.domain),i.value=r(i.value));return{domain:t===void 0?t:r(t),...n}}function FV(e){return qt(e,Ku)}function lf(e={}){let t;for(let n in e)if(ce.has(n)&&go(e[n])){if(t!==void 0)throw new Error("ambiguous scale definition; multiple scales found");t=eN(g1(n,e[n]))}if(t===void 0)throw new Error("invalid scale definition; no scale found");return t}function tN(e){return t=>{if(!ce.has(t=`${t}`))throw new Error(`unknown scale: ${t}`);return e[t]}}function eN({scale:e,type:t,domain:n,range:r,interpolate:i,interval:o,transform:s,percent:a,pivot:c}){if(t==="identity")return{type:"identity",apply:u=>u,invert:u=>u};let l=e.unknown?e.unknown():void 0;return{type:t,domain:Oa(n),...r!==void 0&&{range:Oa(r)},...s!==void 0&&{transform:s},...a&&{percent:a},...l!==void 0&&{unknown:l},...o!==void 0&&{interval:o},...i!==void 0&&{interpolate:i},...e.clamp&&{clamp:e.clamp()},...c!==void 0&&{pivot:c,symmetric:!1},...e.base&&{base:e.base()},...e.exponent&&{exponent:e.exponent()},...e.constant&&{constant:e.constant()},...e.align&&{align:e.align(),round:e.round()},...e.padding&&(e.paddingInner?{paddingInner:e.paddingInner(),paddingOuter:e.paddingOuter()}:{padding:e.padding()}),...e.bandwidth&&{bandwidth:e.bandwidth(),step:e.step()},apply:u=>e(u),...e.invert&&{invert:u=>e.invert(u)}}}function rN(e,t,n={}){let r=.5-Ee,i=.5+Ee,o=.5+Ee,s=.5-Ee;for(let{marginTop:m,marginRight:g,marginBottom:y,marginLeft:b}of t)m>r&&(r=m),g>i&&(i=g),y>o&&(o=y),b>s&&(s=b);let{margin:a,marginTop:c=a!==void 0?a:r,marginRight:l=a!==void 0?a:i,marginBottom:u=a!==void 0?a:o,marginLeft:f=a!==void 0?a:s}=n;c=+c,l=+l,u=+u,f=+f;let{width:h=640,height:d=CV(e,n,{width:h,marginTopDefault:r,marginRightDefault:i,marginBottomDefault:o,marginLeftDefault:s})+Math.max(0,c-r+u-o)}=n;h=+h,d=+d;let p={width:h,height:d,marginTop:c,marginRight:l,marginBottom:u,marginLeft:f};if(e.fx||e.fy){let{margin:m,marginTop:g=m!==void 0?m:c,marginRight:y=m!==void 0?m:l,marginBottom:b=m!==void 0?m:u,marginLeft:x=m!==void 0?m:f}=n.facet??{};g=+g,y=+y,b=+b,x=+x,p.facet={marginTop:g,marginRight:y,marginBottom:b,marginLeft:x}}return p}function CV({x:e,y:t,fy:n,fx:r},{projection:i,aspectRatio:o},{width:s,marginTopDefault:a,marginRightDefault:c,marginBottomDefault:l,marginLeftDefault:u}){let f=n?n.scale.domain().length:1,h=d5(i);if(h){let p=r?r.scale.domain().length:1,m=(1.1*f-.1)/(1.1*p-.1)*h,g=Math.max(.1,Math.min(10,m));return Math.round((s-u-c)*g+a+l)}let d=t?vo(t)?t.scale.domain().length:Math.max(7,17/f):1;if(o!=null){if(o=+o,!(isFinite(o)&&o>0))throw new Error(`invalid aspectRatio: ${o}`);let p=nN("y",t)/(nN("x",e)*o),m=r?r.scale.bandwidth():1,g=n?n.scale.bandwidth():1,y=m*(s-u-c)-e.insetLeft-e.insetRight;return(p*y+t.insetTop+t.insetBottom)/g+a+l}return!!(t||n)*Math.max(1,Math.min(60,d*f))*20+!!r*30+60}function nN(e,t){if(!t)throw new Error(`aspectRatio requires ${e} scale`);let{type:n,domain:r}=t,i;switch(n){case"linear":case"utc":case"time":i=Number;break;case"pow":{let a=t.scale.exponent();i=c=>Math.pow(c,a);break}case"log":i=Math.log;break;case"point":case"band":return r.length;default:throw new Error(`unsupported ${e} scale for aspectRatio: ${n}`)}let[o,s]=ie(r);return Math.abs(i(s)-i(o))}function oN(e,t){let{fx:n,fy:r}=em(e,t),i=n?.scale.domain(),o=r?.scale.domain();return i&&o?F0(i,o).map(([s,a],c)=>({x:s,y:a,i:c})):i?i.map((s,a)=>({x:s,i:a})):o?o.map((s,a)=>({y:s,i:a})):void 0}function sN(e,{x:t,y:n}){return t&&=PI(t),n&&=PI(n),e.filter(t&&n?r=>t.has(r.x)&&n.has(r.y):t?r=>t.has(r.x):r=>n.has(r.y)).sort(t&&n?(r,i)=>t.get(r.x)-t.get(i.x)||n.get(r.y)-n.get(i.y):t?(r,i)=>t.get(r.x)-t.get(i.x):(r,i)=>n.get(r.y)-n.get(i.y))}function x1(e,{fx:t,fy:n}){let r=Jn(e),i=t?.value,o=n?.value;return t&&n?Mi(r,s=>(s.fx=i[s[0]],s.fy=o[s[0]],s),s=>i[s],s=>o[s]):t?Mi(r,s=>(s.fx=i[s[0]],s),s=>i[s]):Mi(r,s=>(s.fy=o[s[0]],s),s=>o[s])}function aN(e,t,{marginTop:n,marginLeft:r}){return e&&t?({x:i,y:o})=>`translate(${e(i)-r},${t(o)-n})`:e?({x:i})=>`translate(${e(i)-r},0)`:({y:i})=>`translate(0,${t(i)-n})`}function cN(e){let t=[],n=new Uint32Array(wn(e,r=>r.length));for(let r of e){let i=0;for(let o of e)r!==o&&(n.set(o,i),i+=o.length);t.push(n.slice(0,i))}return t}var LV=new Map([["top",LI],["right",$I],["bottom",kI],["left",RI],["top-left",b1(LI,RI)],["top-right",b1(LI,$I)],["bottom-left",b1(kI,RI)],["bottom-right",b1(kI,$I)],["top-empty",RV],["right-empty",UV],["bottom-empty",$V],["left-empty",PV],["empty",zV]]);function lN(e){if(e==null)return null;let t=LV.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid facet anchor: ${e}`)}var iN=new WeakMap;function PI(e){let t=iN.get(e);return t||iN.set(e,t=new qn(qt(e,(n,r)=>[n,r]))),t}function Pa(e,t){return PI(e).get(t)}function kV(e,t,n){return t=Ds(t),n=Ds(n),e.find(r=>Object.is(Ds(r.x),t)&&Object.is(Ds(r.y),n))}function w1(e,t,n){return kV(e,t,n)?.empty}function LI(e,{y:t},{y:n}){return t?Pa(t,n)===0:!0}function kI(e,{y:t},{y:n}){return t?Pa(t,n)===t.length-1:!0}function RI(e,{x:t},{x:n}){return t?Pa(t,n)===0:!0}function $I(e,{x:t},{x:n}){return t?Pa(t,n)===t.length-1:!0}function RV(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=Pa(t,r);if(o>0)return w1(e,n,t[o-1])}function $V(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=Pa(t,r);if(o<t.length-1)return w1(e,n,t[o+1])}function PV(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=Pa(t,n);if(o>0)return w1(e,t[o-1],r)}function UV(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=Pa(t,n);if(o<t.length-1)return w1(e,t[o+1],r)}function zV(e,t,{empty:n}){return n}function b1(e,t){return function(){return e.apply(null,arguments)&&t.apply(null,arguments)}}function _1(e,{channels:{fx:t,fy:n},groups:r}){return t&&n?e.map(({x:i,y:o})=>r.get(i)?.get(o)??[]):t?e.map(({x:i})=>r.get(i)??[]):e.map(({y:i})=>r.get(i)??[])}var xt=class{constructor(t,n={},r={},i){let{facet:o="auto",facetAnchor:s,fx:a,fy:c,sort:l,dx:u=0,dy:f=0,margin:h=0,marginTop:d=h,marginRight:p=h,marginBottom:m=h,marginLeft:g=h,clip:y=i?.clip,channels:b,tip:x,render:w}=r;if(this.data=t,this.sort=bo(l)?l:null,this.initializer=xe(r).initializer,this.transform=this.initializer?r.transform:un(r).transform,o===null||o===!1?this.facet=null:(this.facet=He(o===!0?"include":o,"facet",["auto","include","exclude","super"]),this.fx=t===Da&&typeof a=="string"?[a]:a,this.fy=t===Da&&typeof c=="string"?[c]:c),this.facetAnchor=lN(s),n=Yp(n),b!==void 0&&(n={...qV(b),...n}),i!==void 0&&(n={...c1(this,r,i),...n}),this.channels=Object.fromEntries(Object.entries(n).map(([v,_])=>{if(Br(_.value)){let{value:M,label:E=_.label,scale:N=_.scale}=_.value;_={..._,label:E,scale:N,value:M}}if(t===Da&&typeof _.value=="string"){let{value:M}=_;_={..._,value:[M]}}return[v,_]}).filter(([v,{value:_,optional:M}])=>{if(_!=null)return!0;if(M)return!1;throw new Error(`missing channel value: ${v}`)})),this.dx=+u,this.dy=+f,this.marginTop=+d,this.marginRight=+p,this.marginBottom=+m,this.marginLeft=+g,this.clip=u1(y),this.tip=VV(x),this.facet==="super"){if(a||c)throw new Error("super-faceting cannot use fx or fy");for(let v in this.channels){let{scale:_}=n[v];if(!(_!=="x"&&_!=="y"))throw new Error("super-faceting cannot use x or y")}}w!=null&&(this.render=uf(w,this.render))}initialize(t,n,r){let i=Pe(this.data);t===void 0&&i!=null&&(t=[Jn(i)]);let o=t;this.transform!=null&&({facets:t,data:i}=this.transform(i,t,r),i=Pe(i)),t!==void 0&&(t.original=o);let s=o1(this.channels,i);return this.sort!=null&&t5(i,t,s,n,this.sort),{data:i,facets:t,channels:s}}filter(t,n,r){for(let i in n){let{filter:o=Re}=n[i];if(o!==null){let s=r[i];t=t.filter(a=>o(s[a]))}}return t}project(t,n,r){for(let i in t)if(t[i].scale==="x"&&/^x|x$/.test(i)){let o=i.replace(/^x|x$/,"y");o in t&&t[o].scale==="y"&&II(i,o,n,r.projection)}}scale(t,n,r){let i=tf(t,n);return r.projection&&this.project(t,i,r),i}};function Ze(...e){return e.plot=xt.prototype.plot,e}function uf(e,t){if(e==null)return t===null?void 0:t;if(t==null)return e===null?void 0:e;if(typeof e!="function")throw new TypeError(`invalid render transform: ${e}`);if(typeof t!="function")throw new TypeError(`invalid render transform: ${t}`);return function(n,r,i,o,s,a){return e.call(this,n,r,i,o,s,(c,l,u,f,h)=>t.call(this,c,l,u,f,h,a))}}function qV(e){return Object.fromEntries(Object.entries(Yp(e)).map(([t,n])=>(n=typeof n=="string"?{value:n,label:t}:ti(n),n.filter===void 0&&n.scale==null&&(n={...n,filter:null}),[t,n])))}function VV(e){return e===!0?"xy":e===!1||e==null?null:typeof e=="string"?He(e,"tip",["x","y","xy"]):e}function Bi(e,t){return e?.tip===!0?{...e,tip:t}:cn(e?.tip)&&e.tip.pointer===void 0?{...e,tip:{...e.tip,pointer:t}}:e}var uN=new WeakMap;function UI(e,t,{x:n,y:r,px:i,py:o,maxRadius:s=40,channels:a,render:c,...l}={}){return s=+s,i!=null&&(n??=null,a={...a,px:{value:i,scale:"x"}}),o!=null&&(r??=null,a={...a,py:{value:o,scale:"y"}}),{x:n,y:r,channels:a,...l,render:uf(function(u,f,h,d,p,m){p={...p,pointerSticky:!1};let g=p.ownerSVGElement,{data:y}=p.getMarkState(this),b=uN.get(g);b||uN.set(g,b={sticky:!1,roots:[],renders:[]});let x=b.renders.push(G)-1,{x:w,y:v,fx:_,fy:M}=f,E=_?_(u.fx)-d.marginLeft:0,N=M?M(u.fy)-d.marginTop:0;w?.bandwidth&&(E+=w.bandwidth()/2),v?.bandwidth&&(N+=v.bandwidth()/2);let I=u.fi!=null,T;if(I){let j=b.facetStates;j||(b.facetStates=j=new Map),T=j.get(this),T||j.set(this,T=new Map)}let[O,B]=fn(this,d),{px:S,py:A}=h,D=S?j=>S[j]:zI(h,O),C=A?j=>A[j]:qI(h,B),k,L,R,$;function P(j,nt){if(I)if($&&($=cancelAnimationFrame($)),j==null)T.delete(u.fi);else{T.set(u.fi,nt),$=requestAnimationFrame(()=>{$=null;for(let[z,X]of T)if(X<nt||X===nt&&z<u.fi){j=null;break}G(j)});return}G(j)}function G(j){if(k===j&&R===b.sticky)return;k=j,R=p.pointerSticky=b.sticky;let nt=k==null?[]:[k];I&&(nt.fx=u.fx,nt.fy=u.fy,nt.fi=u.fi);let z=m(nt,f,h,d,p);if(L){if(I){let X=L.parentNode,rt=L.getAttribute("transform"),U=z.getAttribute("transform");rt?z.setAttribute("transform",rt):z.removeAttribute("transform"),U?X.setAttribute("transform",U):X.removeAttribute("transform"),z.removeAttribute("aria-label"),z.removeAttribute("aria-description"),z.removeAttribute("aria-hidden")}L.replaceWith(z)}return b.roots[x]=L=z,k==null&&T?.size>1||p.dispatchValue(k==null?null:y[k]),z}function J(j){if(b.sticky||j.pointerType==="mouse"&&j.buttons===1)return;let[nt,z]=Dn(j);nt-=E,z-=N;let X=nt<d.marginLeft||nt>d.width-d.marginRight?1:e,rt=z<d.marginTop||z>d.height-d.marginBottom?1:t,U=null,Bt=s*s;for(let ft of u){let jt=X*(D(ft)-nt),Yt=rt*(C(ft)-z),tt=jt*jt+Yt*Yt;tt<=Bt&&(U=ft,Bt=tt)}if(U!=null&&(e!==1||t!==1)){let ft=D(U)-nt,jt=C(U)-z;Bt=ft*ft+jt*jt}P(U,Bt)}function et(j){j.pointerType==="mouse"&&k!=null&&(b.sticky&&b.roots.some(nt=>nt?.contains(j.target))||(b.sticky?(b.sticky=!1,b.renders.forEach(nt=>nt(null))):(b.sticky=!0,G(k)),j.stopImmediatePropagation()))}function ot(j){j.pointerType==="mouse"&&(b.sticky||P(null))}return g.addEventListener("pointerenter",J),g.addEventListener("pointermove",J),g.addEventListener("pointerdown",et),g.addEventListener("pointerleave",ot),G(null)},c)}}function ff(e){return UI(1,1,e)}function hf(e){return UI(1,.01,e)}function sl(e){return UI(.01,1,e)}function zI({x1:e,x2:t,x:n=e},r){return e&&t?i=>(e[i]+t[i])/2:n?i=>n[i]:()=>r}function qI({y1:e,y2:t,y:n=e},r){return e&&t?i=>(e[i]+t[i])/2:n?i=>n[i]:()=>r}function v1(e){return vo(e)&&e.interval===void 0?void 0:"tabular-nums"}function fN(e,t){let{label:n=e.label,tickSize:r=6,width:i=240,height:o=44+r,marginTop:s=18,marginRight:a=0,marginBottom:c=16+r,marginLeft:l=0,style:u,ticks:f=(i-l-a)/64,tickFormat:h,fontVariant:d=v1(e),round:p=!0,opacity:m,className:g}=t,y=Ra(t);g=ef(g),m=ee(m)[1],h===null&&(h=()=>null);let b=at("svg",y).attr("class",`${g}-ramp`).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",i).attr("height",o).attr("viewBox",`0 0 ${i} ${o}`).call(O=>O.append("style").text(`:where(.${g}-ramp) {
|
|
15
|
+
${n}`}function Aq(e){return e==="time"?Wx:e==="utc"?Rp:Mq}function E5(e,t,n){let r=jt(z0(t,(i,o)=>Math.abs(o-i)));if(r<1e3)return I5("millisecond","utc",n);for(let[i,o,s,a]of Aq(e)){if(r>a||i==="hour"&&!r)break;if(t.every(c=>o.floor(c)>=c))return I5(i,s,n)}}function Pu(e,t,n){return(r,i,o)=>{let s=e(r,i),a=t(r,i),c=i-Es(o);return i!==c&&o[c]!==void 0&&a===t(o[c],c)?s:n(s,a)}}var Qc=Object.getPrototypeOf(Uint8Array),Tq=Object.prototype.toString,JS=Symbol("reindex");function bt(e,t,n){let r=typeof t;return r==="string"?D5(e,tM(t),n):r==="function"?D5(e,t,n):r==="number"||t instanceof Date||r==="boolean"?Vt(e,un(t),n):typeof t?.transform=="function"?N5(t.transform(e),n):Eq(N5(t,n),e?.[JS])}function Eq(e,t){return t?Pp(e,t):e}function D5(e,t,n){return Vt(e,n?.prototype instanceof Qc?Dq(t):t,n)}function N5(e,t){return t===void 0?Pe(e):e instanceof t?e:t.prototype instanceof Qc&&!(e instanceof Qc)?t.from(e,eM):t.from(e)}function Dq(e){return(t,n)=>eM(e(t,n))}var Ta=[null],tM=e=>t=>t[e],Me={transform:nr},W={transform:e=>e};var Up=()=>1,B5=()=>!0,Ue=e=>e==null?e:`${e}`,Dt=e=>e==null?e:+e;var Ds=e=>e?e[0]:void 0,Ea=e=>e?e[1]:void 0,O5=e=>e?e[2]:void 0,un=e=>()=>e;function Vu(e){let t=+`${e}`.slice(1)/100;return(n,r)=>Gn(n,t,r)}function Ze(e){return e instanceof Qc?e:Vt(e,eM,Float64Array)}function eM(e){return e==null?NaN:Number(e)}function L5(e){return Vt(e,nM)}function nM(e){return e instanceof Date&&!isNaN(e)?e:typeof e=="string"?kp(e):e==null||isNaN(e=+e)?void 0:new Date(e)}function Ee(e,t){return e===void 0&&(e=t),e===null?[void 0,"none"]:Ba(e)?[void 0,e]:[e,void 0]}function re(e,t){return e===void 0&&(e=t),e===null||typeof e=="number"?[void 0,e]:[e,void 0]}function rM(e,t,n){if(e!=null)return Ke(e,t,n)}function Ke(e,t,n){let r=`${e}`.toLowerCase();if(!n.includes(r))throw new Error(`invalid ${t}: ${e}`);return r}function Pe(e){return e==null||e instanceof Array||e instanceof Qc?e:Array.from(e)}function Vt(e,t,n=Array){return e==null?e:e instanceof n?e.map(t):n.from(e,t)}function Da(e,t=Array){return e instanceof t?e.slice():t.from(e)}function iM({x:e,x1:t,x2:n}){return e!==void 0||t!==void 0||n!==void 0}function oM({y:e,y1:t,y2:n}){return e!==void 0||t!==void 0||n!==void 0}function ju(e){return iM(e)||oM(e)||e.interval!==void 0}function fn(e){return e?.toString===Tq}function go(e){return fn(e)&&(e.type!==void 0||e.domain!==void 0)}function Lr(e){return fn(e)&&typeof e.transform!="function"}function bo(e){return Lr(e)&&e.value===void 0&&e.channel===void 0}function sM(e,t,n,r=W){return t===void 0&&n===void 0?(t=0,n=e===void 0?r:e):t===void 0?t=e===void 0?0:e:n===void 0&&(n=e===void 0?0:e),[t,n]}function Ce(e,t){return e===void 0&&t===void 0?[Ds,Ea]:[e,t]}function Un({z:e,fill:t,stroke:n}={}){return e===void 0&&([e]=Ee(t)),e===void 0&&([e]=Ee(n)),e}function nr(e){let t=e.length,n=new Uint32Array(t);for(let r=0;r<t;++r)n[r]=r;return n}function Pp(e,t){return Vt(t,n=>e[n],e.constructor)}function Yu(e){return e.length===1?(t,n)=>e(Pp(n,t)):e}function Ns(e,t,n){return e.subarray?e.subarray(t,n):e.slice(t,n)}function Bs(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Hx(e,t){if(t[e]!==void 0)return t[e];switch(e){case"x1":case"x2":e="x";break;case"y1":case"y2":e="y";break}return t[e]}function hn(e){let t;return[{transform:()=>t,label:En(e)},n=>t=n]}function Tn(e){return e==null?[e]:hn(e)}function En(e,t){return typeof e=="string"?e:e&&e.label!==void 0?e.label:t}function Wu(e,t){return{transform(n){let r=e.transform(n),i=t.transform(n);return De(r)||De(i)?Vt(r,(o,s)=>new Date((+r[s]+ +i[s])/2)):Vt(r,(o,s)=>(+r[s]+ +i[s])/2,Float64Array)},label:e.label}}function Jc(e,t){let n=aM(t?.interval,t?.type);return n?Vt(e,n):e}function aM(e,t){let n=Gu(e,t);return n&&(r=>$e(r)?n.floor(r):r)}function Gu(e,t){if(e!=null){if(typeof e=="number"){0<e&&e<1&&Number.isInteger(1/e)&&(e=-1/e);let n=Math.abs(e);return e<0?{floor:r=>Math.floor(r*n)/n,offset:r=>(r*n+1)/n,range:(r,i)=>Re(Math.ceil(r*n),i*n).map(o=>o/n)}:{floor:r=>Math.floor(r/n)*n,offset:r=>r+n,range:(r,i)=>Re(Math.ceil(r/n),i/n).map(o=>o*n)}}if(typeof e=="string")return(t==="time"?KS:$p)(e);if(typeof e.floor!="function")throw new Error("invalid interval; missing floor method");if(typeof e.offset!="function")throw new Error("invalid interval; missing offset method");return e}}function xo(e,t){if(e=Gu(e,t),e&&typeof e.range!="function")throw new Error("invalid interval: missing range method");return e}function F5(e,t){if(e=xo(e,t),e&&typeof e.ceil!="function")throw new Error("invalid interval: missing ceil method");return e}function C5(e){return Na(e)&&typeof e?.floor=="function"&&e.floor()instanceof Date}function Na(e){return typeof e?.range=="function"}function ti(e){return e===void 0||Lr(e)?e:{value:e}}function k5(e){return e==null?null:{transform:t=>bt(t,e,Float64Array),label:En(e)}}function R5(e){if(!rr(e))return!1;for(let t of e)if(t!=null)return typeof t=="object"&&"0"in t&&"1"in t}function rr(e){return e&&typeof e[Symbol.iterator]=="function"}function Zx(e){for(let t of e)if(t!=null)return typeof t!="object"||t instanceof Date}function Ie(e){for(let t of e){if(t==null)continue;let n=typeof t;return n==="string"||n==="boolean"}}function De(e){for(let t of e)if(t!=null)return t instanceof Date}function $5(e){for(let t of e)if(t!=null)return typeof t=="string"&&isNaN(t)&&kp(t)}function U5(e){for(let t of e)if(t!=null){if(typeof t!="string")return!1;if(t.trim())return!isNaN(t)}}function Os(e){for(let t of e)if(t!=null)return typeof t=="number"}function Kx(e,t){let n;for(let r of e)if(r!=null){if(!t(r))return!1;n=!0}return n}var Nq=new Set("none,currentcolor,transparent,aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow".split(","));function Ba(e){return typeof e!="string"?!1:(e=e.toLowerCase().trim(),/^#[0-9a-f]{3,8}$/.test(e)||/^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.*\)$/.test(e)||Nq.has(e))}function P5(e){return typeof e=="number"&&(0<=e&&e<=1||isNaN(e))}function te(e){return e==null||Ls(e)}function Ls(e){return/^\s*none\s*$/i.test(e)}function z5(e){return/^\s*round\s*$/i.test(e)}function Qx(e,t){return rM(e,t,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function wo(e="middle"){return Qx(e,"frameAnchor")}function Es(e){if(e==null)return;let t=e[0],n=e[e.length-1];return jn(t,n)}function q5(e={},...t){let n=e;for(let r of t)for(let i in r)if(n[i]===void 0){let o=r[i];n===e?n={...n,[i]:o}:n[i]=o}return n}function Bq(e){console.warn("named iterables are deprecated; please use an object instead");let t=new Set;return Object.fromEntries(Array.from(e,n=>{let{name:r}=n;if(r==null)throw new Error("missing name");let i=`${r}`;if(i==="__proto__")throw new Error(`illegal name: ${i}`);if(t.has(i))throw new Error(`duplicate name: ${i}`);return t.add(i),[r,n]}))}function zp(e){return rr(e)?Bq(e):e}var ei=Symbol("position"),Fr=Symbol("color"),tl=Symbol("radius"),el=Symbol("length"),nl=Symbol("opacity"),Xu=Symbol("symbol"),V5=Symbol("projection"),le=new Map([["x",ei],["y",ei],["fx",ei],["fy",ei],["r",tl],["color",Fr],["opacity",nl],["symbol",Xu],["length",el],["projection",V5]]);function j5(e){return e===ei||e===V5}function Y5(e){return e===ei||e===tl||e===el||e===nl}var cM=Math.sqrt(3),lM=2/cM,Oq={draw(e,t){let n=Math.sqrt(t/Math.PI),r=n*lM,i=r/2;e.moveTo(0,r),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(0,-r),e.lineTo(-n,-i),e.lineTo(-n,i),e.closePath()}},uM=new Map([["asterisk",wp],["circle",As],["cross",_p],["diamond",vp],["diamond2",Sp],["hexagon",Oq],["plus",Mp],["square",Ip],["square2",Ap],["star",Tp],["times",Cu],["triangle",Ep],["triangle2",Dp],["wye",Np]]);function fM(e){return e&&typeof e.draw=="function"}function W5(e){return fM(e)?!0:typeof e!="string"?!1:uM.has(e.toLowerCase())}function Hu(e){if(e==null||fM(e))return e;let t=uM.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid symbol: ${e}`)}function G5(e){if(e==null||fM(e))return[void 0,e];if(typeof e=="string"){let t=uM.get(`${e}`.toLowerCase());if(t)return[void 0,t]}return[e,void 0]}function dn({filter:e,sort:t,reverse:n,transform:r,initializer:i,...o}={},s){if(r===void 0&&(e!=null&&(r=pM(e)),t!=null&&!bo(t)&&(r=hM(r,yM(t))),n&&(r=hM(r,mM))),s!=null&&i!=null)throw new Error("transforms cannot be applied after initializers");return{...o,...(t===null||bo(t))&&{sort:t},transform:hM(r,s)}}function _e({filter:e,sort:t,reverse:n,initializer:r,...i}={},o){return r===void 0&&(e!=null&&(r=pM(e)),t!=null&&!bo(t)&&(r=dM(r,yM(t))),n&&(r=dM(r,mM))),{...i,...(t===null||bo(t))&&{sort:t},initializer:dM(r,o)}}function hM(e,t){return e==null?t===null?void 0:t:t==null?e===null?void 0:e:function(n,r,i){return{data:n,facets:r}=e.call(this,n,r,i),t.call(this,Pe(n),r,i)}}function dM(e,t){return e==null?t===null?void 0:t:t==null?e===null?void 0:e:function(n,r,i,...o){let s,a,c,l,u,f;return{data:a=n,facets:c=r,channels:s}=e.call(this,n,r,i,...o),{data:u=a,facets:f=c,channels:l}=t.call(this,a,c,{...i,...s},...o),{data:u,facets:f,channels:{...s,...l}}}}function Jx(e,t){return(e.initializer!=null?_e:dn)(e,t)}function X5(e,t){return Jx(t,pM(e))}function pM(e){return(t,n)=>{let r=bt(t,e);return{data:t,facets:n.map(i=>i.filter(o=>r[o]))}}}function H5({sort:e,...t}={}){return{...Jx(t,mM),sort:bo(e)?e:null}}function mM(e,t){return{data:e,facets:t.map(n=>n.slice().reverse())}}function Z5({seed:e,sort:t,...n}={}){return{...Jx(n,K5(e==null?Math.random:co(e))),sort:bo(t)?t:null}}function t1(e,{sort:t,...n}={}){return{...(Lr(e)&&e.channel!==void 0?_e:Jx)(n,yM(e)),sort:bo(t)?t:null}}function yM(e){return(typeof e=="function"&&e.length!==1?Lq:K5)(e)}function Lq(e){return(t,n)=>{let r=(i,o)=>e(t[i],t[o]);return{data:t,facets:n.map(i=>i.slice().sort(r))}}}function K5(e){let t,n;({channel:t,value:e,order:n}={...ti(e)});let r=t?.startsWith("-");if(r&&(t=t.slice(1)),n===void 0&&(n=r?Zc:ln),typeof n!="function")switch(`${n}`.toLowerCase()){case"ascending":n=ln;break;case"descending":n=Zc;break;default:throw new Error(`invalid order: ${n}`)}return(i,o,s)=>{let a;if(t===void 0)a=bt(i,e);else{if(s===void 0)throw new Error("channel sort requires an initializer");if(a=s[t],!a)return{};a=a.value}let c=(l,u)=>n(a[l],a[u]);return{data:i,facets:o.map(l=>l.slice().sort(c))}}}function Vp(e,t){return e1(null,null,e,t)}function La(e={y:"count"},t={}){let{x:n=W}=t;if(n==null)throw new Error("missing channel: x");return e1(n,null,e,t)}function Fa(e={x:"count"},t={}){let{y:n=W}=t;if(n==null)throw new Error("missing channel: y");return e1(null,n,e,t)}function jp(e={fill:"count"},t={}){let{x:n,y:r}=t;if([n,r]=Ce(n,r),n==null)throw new Error("missing channel: x");if(r==null)throw new Error("missing channel: y");return e1(n,r,e,t)}function e1(e,t,{data:n=i1,filter:r,sort:i,reverse:o,...s}={},a={}){s=bM(s,a),n=nD(n,W),i=i==null?void 0:tD("sort",i,a),r=r==null?void 0:eD("filter",r,a);let[c,l]=Tn(e),[u,f]=Tn(t),{z:h,fill:d,stroke:p,x1:m,x2:g,y1:y,y2:b,...x}=a,[w,v]=Tn(h),[_]=Ee(d),[M]=Ee(p),[D,A]=Tn(_),[N,T]=Tn(M);return{..."z"in a&&{z:w||h},..."fill"in a&&{fill:D||d},..."stroke"in a&&{stroke:N||p},...dn(x,(B,L,S)=>{let I=Jc(bt(B,e),S?.x),E=Jc(bt(B,t),S?.y),C=bt(B,h),k=bt(B,_),F=bt(B,M),R=Yp(s,{z:C,fill:k,stroke:F}),$=[],U=[],G=I&&l([]),J=E&&f([]),et=C&&v([]),st=k&&A([]),j=F&&T([]),nt=0;for(let z of s)z.initialize(B);i&&i.initialize(B),r&&r.initialize(B);for(let z of L){let X=[];for(let rt of s)rt.scope("facet",z);i&&i.scope("facet",z),r&&r.scope("facet",z);for(let[rt,P]of Oa(z,R))for(let[Ot,ft]of Oa(P,E))for(let[Yt,Wt]of Oa(ft,I)){let tt={data:B};if(I&&(tt.x=Yt),E&&(tt.y=Ot),!(r&&!r.reduce(Wt,tt))){X.push(nt++),U.push(n.reduceIndex(Wt,B,tt)),I&&G.push(Yt),E&&J.push(Ot),C&&et.push(R===C?rt:C[Wt[0]]),k&&st.push(R===k?rt:k[Wt[0]]),F&&j.push(R===F?rt:F[Wt[0]]);for(let ie of s)ie.reduce(Wt,tt);i&&i.reduce(Wt,tt)}}$.push(X)}return xM($,i,o),{data:U,facets:$}}),...!_o(s,"x")&&(c?{x:c}:{x1:m,x2:g}),...!_o(s,"y")&&(u?{y:u}:{y1:y,y2:b}),...Object.fromEntries(s.map(({name:B,output:L})=>[B,L]))}}function _o(e,...t){for(let{name:n}of e)if(t.includes(n))return!0;return!1}function gM(e,t,n=n1){let r=Object.entries(e);return t.title!=null&&e.title===void 0&&r.push(["title",Uq]),t.href!=null&&e.href===void 0&&r.push(["href",o1]),r.filter(([,i])=>i!==void 0).map(([i,o])=>o===null?Fq(i):n(i,o,t))}function n1(e,t,n,r=r1){let i;fn(t)&&"reduce"in t&&(i=t.scale,t=t.reduce);let o=r(e,t,n),[s,a]=hn(o.label),c;return{name:e,output:i===void 0?s:{value:s,scale:i},initialize(l){o.initialize(l),c=a([])},scope(l,u){o.scope(l,u)},reduce(l,u){c.push(o.reduce(l,u))}}}function Fq(e){return{name:e,initialize(){},scope(){},reduce(){}}}function r1(e,t,n,r=Zu){let i=Hx(e,n),o=r(t,i),s,a;return{label:En(o===qp?null:i,o.label),initialize(c){s=i===void 0?c:bt(c,i),o.scope==="data"&&(a=o.reduceIndex(nr(c),s))},scope(c,l){o.scope===c&&(a=o.reduceIndex(l,s))},reduce(c,l){return o.scope==null?o.reduceIndex(c,s,l):o.reduceIndex(c,s,a,l)}}}function Oa(e,t){return t?Hi(on(e,n=>t[n]),Ds):[[,e]]}function Zu(e,t,n=Cq){if(e==null)return n(e);if(typeof e.reduceIndex=="function")return e;if(typeof e.reduce=="function"&&fn(e))return Rq(e);if(typeof e=="function")return $q(e);if(/^p\d{2}$/i.test(e))return Fs(Vu(e));switch(`${e}`.toLowerCase()){case"first":return o1;case"last":return Pq;case"identity":return i1;case"count":return qp;case"distinct":return zq;case"sum":return t==null?qp:qq;case"proportion":return J5(t,"data");case"proportion-facet":return J5(t,"facet");case"deviation":return Fs(jr);case"min":return Fs(ae);case"min-index":return Fs($0);case"max":return Fs(jt);case"max-index":return Fs(R0);case"mean":return Q5(cs);case"median":return Q5(Ai);case"variance":return Fs(aa);case"mode":return Fs(Jl)}return n(e)}function Cq(e){throw new Error(`invalid reduce: ${e}`)}function bM(e,t){return gM(e,t,tD)}function tD(e,t,n){return n1(e,t,n,eD)}function eD(e,t,n){return r1(e,t,n,nD)}function nD(e,t){return Zu(e,t,kq)}function kq(e){switch(`${e}`.toLowerCase()){case"x":return Vq;case"y":return jq}throw new Error(`invalid group reduce: ${e}`)}function Yp(e,t){for(let n in t){let r=t[n];if(r!==void 0&&!e.some(i=>i.name===n))return r}}function xM(e,t,n){if(t){let r=t.output.transform(),i=(o,s)=>ln(r[o],r[s]);e.forEach(o=>o.sort(i))}n&&e.forEach(r=>r.reverse())}function Rq(e){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...e,reduceIndex:e.reduce.bind(e)}}function $q(e){return{reduceIndex(t,n,r){return e(Pp(n,t),r)}}}function Fs(e){return{reduceIndex(t,n){return e(t,r=>n[r])}}}function Q5(e){return{reduceIndex(t,n){let r=e(t,i=>n[i]);return De(n)?new Date(r):r}}}var i1={reduceIndex(e,t){return Pp(t,e)}},o1={reduceIndex(e,t){return t[e[0]]}},Uq={reduceIndex(e,t){let r=Hi(Ii(e,o=>o.length,o=>t[o]),Ea),i=r.slice(-5).reverse();if(i.length<r.length){let o=r.slice(0,-4);i[4]=[`\u2026 ${o.length.toLocaleString("en-US")} more`,Sn(o,Ea)]}return i.map(([o,s])=>`${o} (${s.toLocaleString("en-US")})`).join(`
|
|
16
|
+
`)}},Pq={reduceIndex(e,t){return t[e[e.length-1]]}},qp={label:"Frequency",reduceIndex(e){return e.length}},zq={label:"Distinct",reduceIndex(e,t){let n=new Wn;for(let r of e)n.add(t[r]);return n.size}},qq=Fs(Sn);function J5(e,t){return e==null?{scope:t,label:"Frequency",reduceIndex:(n,r,i=1)=>n.length/i}:{scope:t,reduceIndex:(n,r,i=1)=>Sn(n,o=>r[o])/i}}var Vq={reduceIndex(e,t,{x:n}){return n}},jq={reduceIndex(e,t,{y:n}){return n}};function rD(e){if(typeof e!="function")throw new Error(`invalid test function: ${e}`);return{reduceIndex(t,n,{data:r}){return n[t.find(i=>e(r[i],i,r))]}}}function Ku(e,{scale:t,type:n,value:r,filter:i,hint:o,label:s=En(r)},a){return o===void 0&&typeof r?.transform=="function"&&(o=r.hint),_M(a,{scale:t,type:n,value:bt(e,r),label:s,filter:i,hint:o})}function s1(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,Ku(t,r,n)]))}function Qu(e,t){let n=Object.fromEntries(Object.entries(e).map(([r,{scale:i,value:o}])=>{let s=i==null?null:t[i];return[r,s==null?o:Vt(o,s)]}));return n.channels=e,n}function _M(e,t){let{scale:n,value:r}=t;if(n===!0||n==="auto")switch(e){case"fill":case"stroke":case"color":t.scale=n!==!0&&Kx(r,Ba)?null:"color";break;case"fillOpacity":case"strokeOpacity":case"opacity":t.scale=n!==!0&&Kx(r,P5)?null:"opacity";break;case"symbol":n!==!0&&Kx(r,W5)?(t.scale=null,t.value=Vt(r,Hu)):t.scale="symbol";break;default:t.scale=le.has(e)?e:null;break}else if(n===!1)t.scale=null;else if(n!=null&&!le.has(n))throw new Error(`unknown scale: ${n}`);return t}function oD(e,t,n,r,i){let{order:o,reverse:s,reduce:a=!0,limit:c}=i;for(let l in i){if(!le.has(l))continue;let{value:u,order:f=o,reverse:h=s,reduce:d=a,limit:p=c}=ti(i[l]),m=u?.startsWith("-");if(m&&(u=u.slice(1)),f=f===void 0?m!==(u==="width"||u==="height")?aD:sD:Gq(f),d==null||d===!1)continue;let g=l==="fx"||l==="fy"?Wq(t,r[l]):Yq(n,l);if(!g)throw new Error(`missing channel for scale: ${l}`);let y=g.value,[b=0,x=1/0]=rr(p)?p:p<0?[p]:[0,p];if(u==null)g.domain=()=>{let w=Array.from(new Wn(y));return h&&(w=w.reverse()),(b!==0||x!==1/0)&&(w=w.slice(b,x)),w};else{let w=u==="data"?e:u==="height"?iD(n,"y1","y2"):u==="width"?iD(n,"x1","x2"):wM(n,u,u==="y"?"y2":u==="x"?"x2":void 0),v=Zu(d===!0?"max":d,w);g.domain=()=>{let _=Z_(nr(y),M=>v.reduceIndex(M,w),M=>y[M]);return f&&_.sort(f),h&&_.reverse(),(b!==0||x!==1/0)&&(_=_.slice(b,x)),_.map(Ds)}}}}function Yq(e,t){for(let n in e){let r=e[n];if(r.scale===t)return r}}function Wq(e,t){let n=e.original;if(n===e)return t;let r=t.value,i=t.value=[];for(let o=0;o<n.length;++o){let s=r[n[o][0]];for(let a of e[o])i[a]=s}return t}function iD(e,t,n){let r=wM(e,t),i=wM(e,n);return Vt(i,(o,s)=>Math.abs(o-r[s]),Float64Array)}function wM(e,t,n){let r=e[t];if(!r&&n!==void 0&&(r=e[n]),r)return r.value;throw new Error(`missing channel: ${t}`)}function Gq(e){if(e==null||typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"ascending":return sD;case"descending":return aD}throw new Error(`invalid order: ${e}`)}function sD([e,t],[n,r]){return ln(t,r)||ln(e,n)}function aD([e,t],[n,r]){return Zc(t,r)||ln(e,n)}function Wp(e,t){let n=e[t];if(n){for(;n.source;)n=n.source;return n.source===null?null:n}}function a1(e){let t,n;return(...r)=>((n?.length!==r.length||n.some((i,o)=>i!==r[o]))&&(n=r,t=e(...r)),t)}var Xq=a1(e=>new Intl.NumberFormat(e)),Hq=a1((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{month:t}})),Zq=a1((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{weekday:t}}));function Kq(e="en-US"){let t=Xq(e);return n=>n!=null&&!isNaN(n)?t.format(n):void 0}function cD(e="en-US",t="short"){let n=Hq(e,t);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2e3,+r)))?n.format(r):void 0}function lD(e="en-US",t="short"){let n=Zq(e,t);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2001,0,+r)))?n.format(r):void 0}function vM(e){return Yx(e,"Invalid Date")}function Qq(e="en-US"){let t=Kq(e);return n=>(n instanceof Date?vM:typeof n=="number"?t:Ue)(n)}var Ni=Qq();var SM=0,MM;function uD(){let e=SM;return SM=0,MM=void 0,e}function Pn(e){e!==MM&&(MM=e,console.warn(e),++SM)}var Ne=(typeof window<"u"?window.devicePixelRatio>1:typeof it>"u")?0:.5,Jq=0;function c1(){return`plot-clip-${++Jq}`}function l1(e,{title:t,href:n,ariaLabel:r,ariaDescription:i,ariaHidden:o,target:s,fill:a,fillOpacity:c,stroke:l,strokeWidth:u,strokeOpacity:f,strokeLinejoin:h,strokeLinecap:d,strokeMiterlimit:p,strokeDasharray:m,strokeDashoffset:g,opacity:y,mixBlendMode:b,imageFilter:x,paintOrder:w,pointerEvents:v,shapeRendering:_,channels:M},{ariaLabel:D,fill:A="currentColor",fillOpacity:N,stroke:T="none",strokeOpacity:B,strokeWidth:L,strokeLinecap:S,strokeLinejoin:I,strokeMiterlimit:E,paintOrder:C}){A===null&&(a=null,c=null),T===null&&(l=null,f=null),te(A)?!te(T)&&(!te(a)||M?.fill)&&(T="none"):te(T)&&(!te(l)||M?.stroke)&&(A="none");let[k,F]=Ee(a,A),[R,$]=re(c,N),[U,G]=Ee(l,T),[J,et]=re(f,B),[st,j]=re(y);Ls(G)||(u===void 0&&(u=L),d===void 0&&(d=S),h===void 0&&(h=I),p===void 0&&!z5(h)&&(p=E),!Ls(F)&&w===void 0&&(w=C));let[nt,z]=re(u);return A!==null&&(e.fill=ce(F,"currentColor"),e.fillOpacity=Gp($,1)),T!==null&&(e.stroke=ce(G,"none"),e.strokeWidth=Gp(z,1),e.strokeOpacity=Gp(et,1),e.strokeLinejoin=ce(h,"miter"),e.strokeLinecap=ce(d,"butt"),e.strokeMiterlimit=Gp(p,4),e.strokeDasharray=ce(m,"none"),e.strokeDashoffset=ce(g,"0")),e.target=Ue(s),e.ariaLabel=Ue(D),e.ariaDescription=Ue(i),e.ariaHidden=Ue(o),e.opacity=Gp(j,1),e.mixBlendMode=ce(b,"normal"),e.imageFilter=ce(x,"none"),e.paintOrder=ce(w,"normal"),e.pointerEvents=ce(v,"auto"),e.shapeRendering=ce(_,"auto"),{title:{value:t,optional:!0,filter:null},href:{value:n,optional:!0,filter:null},ariaLabel:{value:r,optional:!0,filter:null},fill:{value:k,scale:"auto",optional:!0},fillOpacity:{value:R,scale:"auto",optional:!0},stroke:{value:U,scale:"auto",optional:!0},strokeOpacity:{value:J,scale:"auto",optional:!0},strokeWidth:{value:nt,optional:!0},opacity:{value:st,scale:"auto",optional:!0}}}function tV(e,t){t&&e.filter(n=>Cp(t[n])).append("title").call(nV,t)}function eV(e,t){t&&e.filter(([n])=>Cp(t[n])).append("title").call(rV,t)}function nV(e,t){t&&e.text(n=>Ni(t[n]))}function rV(e,t){t&&e.text(([n])=>Ni(t[n]))}function Ht(e,{target:t,tip:n},{ariaLabel:r,title:i,fill:o,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:l,opacity:u,href:f}){r&&ut(e,"aria-label",h=>r[h]),o&&ut(e,"fill",h=>o[h]),s&&ut(e,"fill-opacity",h=>s[h]),a&&ut(e,"stroke",h=>a[h]),c&&ut(e,"stroke-opacity",h=>c[h]),l&&ut(e,"stroke-width",h=>l[h]),u&&ut(e,"opacity",h=>u[h]),f&&fD(e,h=>f[h],t),n||tV(e,i)}function rl(e,{target:t,tip:n},{ariaLabel:r,title:i,fill:o,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:l,opacity:u,href:f}){r&&ut(e,"aria-label",([h])=>r[h]),o&&ut(e,"fill",([h])=>o[h]),s&&ut(e,"fill-opacity",([h])=>s[h]),a&&ut(e,"stroke",([h])=>a[h]),c&&ut(e,"stroke-opacity",([h])=>c[h]),l&&ut(e,"stroke-width",([h])=>l[h]),u&&ut(e,"opacity",([h])=>u[h]),f&&fD(e,([h])=>f[h],t),n||eV(e,i)}function iV({ariaLabel:e,title:t,fill:n,fillOpacity:r,stroke:i,strokeOpacity:o,strokeWidth:s,opacity:a,href:c},{tip:l}){return[e,l?void 0:t,n,r,i,o,s,a,c].filter(u=>u!==void 0)}function Xp(e,t,n){let r=on(e,i=>t[i]);return n===void 0&&r.size>1+e.length>>1&&Pn("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),r.values()}function*u1(e,t,n,r){let{z:i}=n,{z:o}=r,s=iV(r,n),a=[...t,...s];for(let c of o?Xp(e,o,i):[e]){let l,u;t:for(let f of c){for(let h of a)if(!$e(h[f])){u&&u.push(-1);continue t}if(l===void 0){u&&(yield u),l=s.map(h=>Bs(h[f])),u=[f];continue}u.push(f);for(let h=0;h<s.length;++h)if(Bs(s[h][f])!==l[h]){yield u,l=s.map(p=>Bs(p[f])),u=[f];continue t}}u&&(yield u)}}function f1(e){return e===!0?e="frame":e===!1?e=null:e!=null&&(e=Ke(e,"clip",["frame","sphere"])),e}function oV(e,t,n,r){let i,{clip:o=r.clip}=t;switch(o){case"frame":{let{width:s,height:a,marginLeft:c,marginRight:l,marginTop:u,marginBottom:f}=n,h=c1();i=`url(#${h})`,e=lt("svg:g",r).call(d=>d.append("svg:clipPath").attr("id",h).append("rect").attr("x",c).attr("y",u).attr("width",s-l-c).attr("height",a-u-f)).each(function(){this.appendChild(e.node()),e.node=()=>this});break}case"sphere":{let{projection:s}=r;if(!s)throw new Error('the "sphere" clip option requires a projection');let a=c1();i=`url(#${a})`,e.append("clipPath").attr("id",a).append("path").attr("d",In(s)({type:"Sphere"}));break}}ut(e,"aria-label",t.ariaLabel),ut(e,"aria-description",t.ariaDescription),ut(e,"aria-hidden",t.ariaHidden),ut(e,"clip-path",i)}function Bt(e,t,n,r){oV(e,t,n,r),ut(e,"fill",t.fill),ut(e,"fill-opacity",t.fillOpacity),ut(e,"stroke",t.stroke),ut(e,"stroke-width",t.strokeWidth),ut(e,"stroke-opacity",t.strokeOpacity),ut(e,"stroke-linejoin",t.strokeLinejoin),ut(e,"stroke-linecap",t.strokeLinecap),ut(e,"stroke-miterlimit",t.strokeMiterlimit),ut(e,"stroke-dasharray",t.strokeDasharray),ut(e,"stroke-dashoffset",t.strokeDashoffset),ut(e,"shape-rendering",t.shapeRendering),ut(e,"filter",t.imageFilter),ut(e,"paint-order",t.paintOrder);let{pointerEvents:i=r.pointerSticky===!1?"none":void 0}=t;ut(e,"pointer-events",i)}function Nt(e,t){sV(e,"mix-blend-mode",t.mixBlendMode),ut(e,"opacity",t.opacity)}function fD(e,t,n){e.each(function(r){let i=t(r);if(i!=null){let o=this.ownerDocument.createElementNS(Yr.svg,"a");o.setAttribute("fill","inherit"),o.setAttributeNS(Yr.xlink,"href",i),n!=null&&o.setAttribute("target",n),this.parentNode.insertBefore(o,this).appendChild(this)}})}function ut(e,t,n){n!=null&&e.attr(t,n)}function sV(e,t,n){n!=null&&e.style(t,n)}function It(e,t,{x:n,y:r},i=Ne,o=Ne){i+=t.dx,o+=t.dy,n?.bandwidth&&(i+=n.bandwidth()/2),r?.bandwidth&&(o+=r.bandwidth()/2),(i||o)&&e.attr("transform",`translate(${i},${o})`)}function ce(e,t){if((e=Ue(e))!==t)return e}function Gp(e,t){if((e=Dt(e))!==t)return e}var aV=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function Ju(e){if(e===void 0)return"plot-d6a7b5";if(e=`${e}`,!aV.test(e))throw new Error(`invalid class name: ${e}`);return e}function tf(e,t){if(typeof t=="string")e.property("style",t);else if(t!=null)for(let n of e)Object.assign(n.style,t)}function pn({frameAnchor:e},{width:t,height:n,marginTop:r,marginRight:i,marginBottom:o,marginLeft:s}){return[/left$/.test(e)?s:/right$/.test(e)?t-i:(s+t-i)/2,/^top/.test(e)?r:/^bottom/.test(e)?n-o:(r+n-o)/2]}function Ca(e={}){let{document:t=typeof window<"u"?window.document:void 0,clip:n}=e;return{document:t,clip:f1(n)}}function lt(e,{document:t}){return Pt(us(e).call(t.documentElement))}var dD=Math.PI,Cs=2*dD,hD=.618;function pD({projection:e,inset:t=0,insetTop:n=t,insetRight:r=t,insetBottom:i=t,insetLeft:o=t}={},s){if(e==null)return;if(typeof e.stream=="function")return e;let a,c,l="frame";if(fn(e)){let v;if({type:e,domain:c,inset:v,insetTop:n=v!==void 0?v:n,insetRight:r=v!==void 0?v:r,insetBottom:i=v!==void 0?v:i,insetLeft:o=v!==void 0?v:o,clip:l=l,...a}=e,e==null)return}typeof e!="function"&&({type:e}=mD(e));let{width:u,height:f,marginLeft:h,marginRight:d,marginTop:p,marginBottom:m}=s,g=u-h-d-o-r,y=f-p-m-n-i;if(e=e?.({width:g,height:y,clip:l,...a}),e==null)return;l=cV(l,h,p,u-d,f-m);let b=h+o,x=p+n,w;if(c!=null){let[[v,_],[M,D]]=In(e).bounds(c),A=Math.min(g/(M-v),y/(D-_));A>0?(b-=(A*(v+M)-g)/2,x-=(A*(_+D)-y)/2,w=Uc({point(N,T){this.stream.point(N*A+b,T*A+x)}})):Pn("Warning: the projection could not be fit to the specified domain; using the default scale.")}return w??=b===0&&x===0?yD():Uc({point(v,_){this.stream.point(v+b,_+x)}}),{stream:v=>e.stream(w.stream(l(v)))}}function mD(e){switch(`${e}`.toLowerCase()){case"albers-usa":return Bi(v2,.7463,.4673);case"albers":return h1(Gd,.7463,.4673);case"azimuthal-equal-area":return Bi(M2,4,4);case"azimuthal-equidistant":return Bi(A2,Cs,Cs);case"conic-conformal":return h1(D2,Cs,Cs);case"conic-equal-area":return h1(ba,6.1702,2.9781);case"conic-equidistant":return h1(B2,7.312,3.6282);case"equal-earth":return Bi(L2,5.4133,2.6347);case"equirectangular":return Bi(N2,Cs,dD);case"gnomonic":return Bi(C2,3.4641,3.4641);case"identity":return{type:yD};case"reflect-y":return{type:lV};case"mercator":return Bi(T2,Cs,Cs);case"orthographic":return Bi(R2,2,2);case"stereographic":return Bi(U2,2,2);case"transverse-mercator":return Bi(z2,Cs,Cs);default:throw new Error(`unknown projection type: ${e}`)}}function cV(e,t,n,r,i){if(e===!1||e==null||typeof e=="number")return o=>o;switch(e===!0&&(e="frame"),`${e}`.toLowerCase()){case"frame":return bu(t,n,r,i);default:throw new Error(`unknown projection clip type: ${e}`)}}function Bi(e,t,n){return{type:({width:r,height:i,rotate:o,precision:s=.15,clip:a})=>{let c=e();return s!=null&&c.precision?.(s),o!=null&&c.rotate?.(o),typeof a=="number"&&c.clipAngle?.(a),c.scale(Math.min(r/t,i/n)),c.translate([r/2,i/2]),c},aspectRatio:n/t}}function h1(e,t,n){let{type:r,aspectRatio:i}=Bi(e,t,n);return{type:o=>{let{parallels:s,domain:a,width:c,height:l}=o,u=r(o);return s!=null&&(u.parallels(s),a===void 0&&u.fitSize([c,l],{type:"Sphere"})),u},aspectRatio:i}}var yD=un({stream:e=>e}),lV=un(Uc({point(e,t){this.stream.point(e,-t)}}));function IM(e,t,n,r){let i=n[e],o=n[t],s=i.length,a=n[e]=new Float64Array(s).fill(NaN),c=n[t]=new Float64Array(s).fill(NaN),l,u=r.stream({point(f,h){a[l]=f,c[l]=h}});for(l=0;l<s;++l)u.point(i[l],o[l])}function gD({projection:e}={}){return e==null?!1:typeof e.stream=="function"?!0:(fn(e)&&(e=e.type),e!=null)}function bD(e){if(typeof e?.stream=="function")return hD;if(fn(e)&&(e=e.type),e!=null){if(typeof e!="function"){let{aspectRatio:t}=mD(e);if(t)return t}return hD}}function ka(e,t,{projection:n}){let{x:r,y:i}=e,o={};return r&&(o.x=r),i&&(o.y=i),o=Qu(o,t),n&&r?.scale==="x"&&i?.scale==="y"&&IM("x","y",o,n),r&&(o.x=Ze(o.x)),i&&(o.y=Ze(o.y)),o}function xD(e){let t=[],n=[],r={scale:"x",value:t},i={scale:"y",value:n},o={point(s,a){t.push(s),n.push(a)},lineStart(){},lineEnd(){},polygonStart(){},polygonEnd(){},sphere(){}};for(let s of e.value)Dr(s,o);return[r,i]}var uV=["#4269d0","#efb118","#ff725c","#6cc5b0","#3ca951","#ff8ab7","#a463f2","#97bbf5","#9c6b4e","#9498a0"],MD=new Map([["accent",fS],["category10",uS],["dark2",hS],["observable10",uV],["paired",dS],["pastel1",pS],["pastel2",mS],["set1",yS],["set2",gS],["set3",bS],["tableau10",xS]]);function ID(e){return e!=null&&MD.has(`${e}`.toLowerCase())}var wD=new Map([...MD,["brbg",ks(Sb,Mb)],["prgn",ks(Ib,Ab)],["piyg",ks(Tb,Eb)],["puor",ks(Db,Nb)],["rdbu",ks(yp,Nu)],["rdgy",ks(Bb,Ob)],["rdylbu",ks(gp,Bu)],["rdylgn",ks(Lb,Fb)],["spectral",ks(Cb,kb)],["burd",_D(yp,Nu)],["buylrd",_D(gp,Bu)],["blues",mn(ax,cx)],["greens",mn(lx,ux)],["greys",mn(fx,hx)],["oranges",mn(gx,bx)],["purples",mn(dx,px)],["reds",mn(mx,yx)],["turbo",Rs(Tx)],["viridis",Rs(Dx)],["magma",Rs(Nx)],["inferno",Rs(Bx)],["plasma",Rs(Ox)],["cividis",Rs(xx)],["cubehelix",Rs(wx)],["warm",Rs(vx)],["cool",Rs(Sx)],["bugn",mn(Rb,$b)],["bupu",mn(Ub,Pb)],["gnbu",mn(zb,qb)],["orrd",mn(Vb,jb)],["pubu",mn(Gb,Xb)],["pubugn",mn(Yb,Wb)],["purd",mn(Hb,Zb)],["rdpu",mn(Kb,Qb)],["ylgn",mn(ex,nx)],["ylgnbu",mn(Jb,tx)],["ylorbr",mn(rx,ix)],["ylorrd",mn(ox,sx)],["rainbow",vD(Mx)],["sinebow",vD(Ax)]]);function mn(e,t){return({length:n})=>n===1?[e[3][1]]:n===2?[e[3][1],e[3][2]]:(n=Math.max(3,Math.floor(n)),n>9?On(t,n):e[n])}function ks(e,t){return({length:n})=>n===2?[e[3][0],e[3][2]]:(n=Math.max(3,Math.floor(n)),n>11?On(t,n):e[n])}function _D(e,t){return({length:n})=>n===2?[e[3][2],e[3][0]]:(n=Math.max(3,Math.floor(n)),n>11?On(r=>t(1-r),n):e[n].slice().reverse())}function Rs(e){return({length:t})=>On(e,Math.max(2,Math.floor(t)))}function vD(e){return({length:t})=>On(e,Math.floor(t)+1).slice(0,-1)}function AM(e){let t=`${e}`.toLowerCase();if(!wD.has(t))throw new Error(`unknown ordinal scheme: ${t}`);return wD.get(t)}function Hp(e,t){let n=AM(e),r=typeof n=="function"?n({length:t}):n;return r.length!==t?r.slice(0,t):r}function AD(e,t="greys"){let n=new Set,[r,i]=Hp(t,2);for(let o of e)if(o!=null)if(o===!0)n.add(i);else if(o===!1)n.add(r);else return;return[...n]}var SD=new Map([["brbg",Mb],["prgn",Ab],["piyg",Eb],["puor",Nb],["rdbu",Nu],["rdgy",Ob],["rdylbu",Bu],["rdylgn",Fb],["spectral",kb],["burd",e=>Nu(1-e)],["buylrd",e=>Bu(1-e)],["blues",cx],["greens",ux],["greys",hx],["purples",px],["reds",yx],["oranges",bx],["turbo",Tx],["viridis",Dx],["magma",Nx],["inferno",Bx],["plasma",Ox],["cividis",xx],["cubehelix",wx],["warm",vx],["cool",Sx],["bugn",$b],["bupu",Pb],["gnbu",qb],["orrd",jb],["pubugn",Wb],["pubu",Xb],["purd",Zb],["rdpu",Qb],["ylgnbu",tx],["ylgn",nx],["ylorbr",ix],["ylorrd",sx],["rainbow",Mx],["sinebow",Ax]]);function ef(e){let t=`${e}`.toLowerCase();if(!SD.has(t))throw new Error(`unknown quantitative scheme: ${t}`);return SD.get(t)}var fV=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function TD(e){return e!=null&&fV.has(`${e}`.toLowerCase())}var EM=e=>t=>e(1-t),TM=[0,1],ED=new Map([["number",xe],["rgb",Wr],["hsl",vv],["hcl",Sv],["lab",sg]]);function DM(e){let t=`${e}`.toLowerCase();if(!ED.has(t))throw new Error(`unknown interpolator: ${t}`);return ED.get(t)}function rf(e,t,n,{type:r,nice:i,clamp:o,zero:s,domain:a=kD(e,n),unknown:c,round:l,scheme:u,interval:f,range:h=le.get(e)===tl?mV(n,a):le.get(e)===el?yV(n,a):le.get(e)===nl?TM:void 0,interpolate:d=le.get(e)===Fr?u==null&&h!==void 0?Wr:ef(u!==void 0?u:r==="cyclical"?"rainbow":"turbo"):l?Nc:xe,reverse:p}){if(f=xo(f,r),(r==="cyclical"||r==="sequential")&&(r="linear"),typeof d!="function"&&(d=DM(d)),p=!!p,h!==void 0){let m=(a=Pe(a)).length,g=(h=Pe(h)).length;if(m!==g){if(d.length===1)throw new Error("invalid piecewise interpolator");d=Ji(d,h),h=void 0}}if(d.length===1?(p&&(d=EM(d),p=!1),h===void 0&&(h=Float64Array.from(a,(m,g)=>g/(a.length-1)),h.length===2&&(h=TM)),t.interpolate((h===TM?un:Zp)(d))):t.interpolate(d),s){let[m,g]=se(a);(m>0||g<0)&&(a=Da(a),Es(a)!==Math.sign(m)?a[a.length-1]=0:a[0]=0)}return p&&(a=la(a)),t.domain(a).unknown(c),i&&(t.nice(hV(i,r)),a=t.domain()),h!==void 0&&t.range(h),o&&t.clamp(o),{type:r,domain:a,range:h,scale:t,interpolate:d,interval:f}}function hV(e,t){return e===!0?void 0:typeof e=="number"?e:F5(e,t)}function DD(e,t,n){return rf(e,bs(),t,n)}function ND(e,t,n){return NM(e,t,{...n,exponent:.5})}function NM(e,t,{exponent:n=1,...r}){return rf(e,op().exponent(n),t,{...r,type:"pow"})}function BD(e,t,{base:n=10,domain:r=gV(t),...i}){return rf(e,rp().base(n),t,{...i,domain:r})}function OD(e,t,{constant:n=1,...r}){return rf(e,ip().constant(n),t,r)}function LD(e,t,{range:n,quantiles:r=n===void 0?5:(n=[...n]).length,n:i=r,scheme:o="rdylbu",domain:s=bV(t),unknown:a,interpolate:c,reverse:l}){return n===void 0&&(n=c!==void 0?On(c,i):le.get(e)===Fr?Hp(o,i):void 0),s.length>0&&(s=sp(s,n===void 0?{length:i}:n).quantiles()),d1(e,t,{domain:s,range:n,reverse:l,unknown:a})}function FD(e,t,{range:n,n:r=n===void 0?5:(n=[...n]).length,scheme:i="rdylbu",domain:o=kD(e,t),unknown:s,interpolate:a,reverse:c}){let[l,u]=se(o),f;return n===void 0?(f=vn(l,u,r),f[0]<=l&&f.splice(0,1),f[f.length-1]>=u&&f.pop(),r=f.length+1,n=a!==void 0?On(a,r):le.get(e)===Fr?Hp(i,r):void 0):(f=On(xe(l,u),r+1).slice(1,-1),l instanceof Date&&(f=f.map(h=>new Date(h)))),Es(Pe(o))<0&&f.reverse(),d1(e,t,{domain:f,range:n,reverse:c,unknown:s})}function d1(e,t,{domain:n=[0],unknown:r,scheme:i="rdylbu",interpolate:o,range:s=o!==void 0?On(o,n.length+1):le.get(e)===Fr?Hp(i,n.length+1):void 0,reverse:a}){n=Pe(n);let c=Es(n);if(!isNaN(c)&&!dV(n,c))throw new Error(`the ${e} scale has a non-monotonic domain`);return a&&(s=la(s)),{type:"threshold",scale:ap(c<0?la(n):n,s===void 0?[]:s).unknown(r),domain:n,range:s}}function dV(e,t){for(let n=1,r=e.length,i=e[0];n<r;++n){let o=jn(i,i=e[n]);if(o!==0&&o!==t)return!1}return!0}function CD(e){return{type:"identity",scale:Y5(le.get(e))?ep():t=>t}}function nf(e,t=Uu){return e.length?[ae(e,({value:n})=>n===void 0?n:ae(n,t)),jt(e,({value:n})=>n===void 0?n:jt(n,t))]:[0,1]}function kD(e,t){let n=le.get(e);return(n===tl||n===nl||n===el?pV:nf)(t)}function pV(e){return[0,e.length?jt(e,({value:t})=>t===void 0?t:jt(t,Uu)):1]}function mV(e,t){let n=e.find(({radius:s})=>s!==void 0);if(n!==void 0)return[0,n.radius];let r=Gn(e,.5,({value:s})=>s===void 0?NaN:Gn(s,.25,er)),i=t.map(s=>3*Math.sqrt(s/r)),o=30/jt(i);return o<1?i.map(s=>s*o):i}function yV(e,t){let n=Ai(e,({value:o})=>o===void 0?NaN:Ai(o,Math.abs)),r=t.map(o=>12*o/n),i=60/jt(r);return i<1?r.map(o=>o*i):r}function gV(e){for(let{value:t}of e)if(t!==void 0)for(let n of t){if(n>0)return nf(e,er);if(n<0)return nf(e,Sa)}return[1,10]}function bV(e){let t=[];for(let{value:n}of e)if(n!==void 0)for(let r of n)t.push(r);return t}function Zp(e){return(t,n)=>r=>e(t+r*(n-t))}function p1(e,t,n,r,{type:i,nice:o,clamp:s,domain:a=nf(r),unknown:c,pivot:l=0,scheme:u,range:f,symmetric:h=!0,interpolate:d=le.get(e)===Fr?u==null&&f!==void 0?Wr:ef(u!==void 0?u:"rdbu"):xe,reverse:p}){l=+l,a=Pe(a);let[m,g]=a;if(a.length>2&&Pn(`Warning: the diverging ${e} scale domain contains extra elements.`),jn(m,g)<0&&([m,g]=[g,m],p=!p),m=Math.min(m,l),g=Math.max(g,l),typeof d!="function"&&(d=DM(d)),f!==void 0&&(d=d.length===1?Zp(d)(...f):Ji(d,f)),p&&(d=EM(d)),h){let y=n.apply(l),b=y-n.apply(m),x=n.apply(g)-y;b<x?m=n.invert(y-x):b>x&&(g=n.invert(y+b))}return t.domain([m,l,g]).unknown(c).interpolator(d),s&&t.clamp(s),o&&t.nice(o),{type:i,domain:[m,g],pivot:l,interpolate:d,scale:t}}function RD(e,t,n){return p1(e,mp(),xV,t,n)}function $D(e,t,n){return BM(e,t,{...n,exponent:.5})}function BM(e,t,{exponent:n=1,...r}){return p1(e,vb().exponent(n=+n),vV(n),t,{...r,type:"diverging-pow"})}function UD(e,t,{base:n=10,pivot:r=1,domain:i=nf(t,r<0?Sa:er),...o}){return p1(e,wb().base(n=+n),wV,t,{domain:i,pivot:r,...o})}function PD(e,t,{constant:n=1,...r}){return p1(e,_b().constant(n=+n),SV(n),t,r)}var xV={apply(e){return e},invert(e){return e}},wV={apply:Math.log,invert:Math.exp},_V={apply(e){return Math.sign(e)*Math.sqrt(Math.abs(e))},invert(e){return Math.sign(e)*(e*e)}};function vV(e){return e===.5?_V:{apply(t){return Math.sign(t)*Math.pow(Math.abs(t),e)},invert(t){return Math.sign(t)*Math.pow(Math.abs(t),1/e)}}}function SV(e){return{apply(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))},invert(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}}function zD(e,t,n,r){return rf(e,t,n,r)}function qD(e,t,n){return zD(e,gb(),t,n)}function VD(e,t,n){return zD(e,bb(),t,n)}var of=Symbol("ordinal");function YD(e,t,n,{type:r,interval:i,domain:o,range:s,reverse:a,hint:c}){return i=xo(i,r),o===void 0&&(o=ZD(n,i,e)),(r==="categorical"||r===of)&&(r="ordinal"),a&&(o=la(o)),o=t.domain(o).domain(),s!==void 0&&(typeof s=="function"&&(s=s(o)),t.range(s)),{type:r,domain:o,range:s,scale:t,hint:c,interval:i}}function WD(e,t,{type:n,interval:r,domain:i,range:o,scheme:s,unknown:a,...c}){r=xo(r,n),i===void 0&&(i=ZD(t,r,e));let l;if(le.get(e)===Xu)l=MV(t),o=o===void 0?IV(l):Vt(o,Hu);else if(le.get(e)===Fr&&(o===void 0&&(n==="ordinal"||n===of)&&(o=AD(i,s),o!==void 0&&(s=void 0)),s===void 0&&o===void 0&&(s=n==="ordinal"?"turbo":"observable10"),s!==void 0))if(o!==void 0){let u=ef(s),f=o[0],h=o[1]-o[0];o=({length:d})=>On(p=>u(f+h*p),d)}else o=AM(s);if(a===Jd)throw new Error(`implicit unknown on ${e} scale is not supported`);return YD(e,zc().unknown(a),t,{...c,type:n,domain:i,range:o,hint:l})}function GD(e,t,{align:n=.5,padding:r=.5,...i}){return HD(X2().align(n).padding(r),t,i,e)}function XD(e,t,{align:n=.5,padding:r=.1,paddingInner:i=r,paddingOuter:o=e==="fx"||e==="fy"?0:r,...s}){return HD(wa().align(n).paddingInner(i).paddingOuter(o),t,s,e)}function HD(e,t,n,r){let{round:i}=n;return i!==void 0&&e.round(i=!!i),e=YD(r,e,t,n),e.round=i,e}function ZD(e,t,n){let r=new Wn;for(let{value:i,domain:o}of e){if(o!==void 0)return o();if(i!==void 0)for(let s of i)r.add(s)}if(t!==void 0){let[i,o]=se(r).map(t.floor,t);return t.range(i,t.offset(o))}if(r.size>1e4&&le.get(n)===ei)throw new Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return Hi(r,ln)}function jD(e,t){let n;for(let{hint:r}of e){let i=r?.[t];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}function MV(e){return{fill:jD(e,"fill"),stroke:jD(e,"stroke")}}function IV(e){return te(e.fill)?AS:$x}function Kp(e,{label:t,inset:n=0,insetTop:r=n,insetRight:i=n,insetBottom:o=n,insetLeft:s=n,round:a,nice:c,clamp:l,zero:u,align:f,padding:h,projection:d,facet:{label:p=t}={},...m}={}){let g={};for(let[y,b]of e){let x=m[y],w=iN(y,b,{round:le.get(y)===ei?a:void 0,nice:c,clamp:l,zero:u,align:f,padding:h,projection:d,...x});if(w){let{label:v=y==="fx"||y==="fy"?p:t,percent:_,transform:M,inset:D,insetTop:A=D!==void 0?D:y==="y"?r:0,insetRight:N=D!==void 0?D:y==="x"?i:0,insetBottom:T=D!==void 0?D:y==="y"?o:0,insetLeft:B=D!==void 0?D:y==="x"?s:0}=x||{};if(M==null)M=void 0;else if(typeof M!="function")throw new Error("invalid scale transform; not a function");w.percent=!!_,w.label=v===void 0?AV(b,w):v,w.transform=M,y==="x"||y==="fx"?(w.insetLeft=+B,w.insetRight=+N):(y==="y"||y==="fy")&&(w.insetTop=+A,w.insetBottom=+T),g[y]=w}}return g}function LM(e){let t={},n={scales:t};for(let[r,i]of Object.entries(e)){let{scale:o,type:s,interval:a,label:c}=i;t[r]=sN(i),n[r]=o,o.type=s,a!=null&&(o.interval=a),c!=null&&(o.label=c)}return n}function eN(e,t){let{x:n,y:r,fx:i,fy:o}=e,s=i||o?g1(t):t;i&&KD(i,s),o&&QD(o,s);let a=i||o?FM(e,t):t;n&&KD(n,a),r&&QD(r,a)}function AV(e=[],t){let n;for(let{label:r}of e)if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}if(n!==void 0)return!vo(t)&&t.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function y1(e){return Math.sign(Es(e.domain()))*Math.sign(Es(e.range()))}function g1(e){let{marginTop:t,marginRight:n,marginBottom:r,marginLeft:i,width:o,height:s,facet:{marginTop:a,marginRight:c,marginBottom:l,marginLeft:u}}=e;return{marginTop:Math.max(t,a),marginRight:Math.max(n,c),marginBottom:Math.max(r,l),marginLeft:Math.max(i,u),width:o,height:s}}function FM({fx:e,fy:t},n){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:a,height:c}=g1(n);return{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:e?e.scale.bandwidth()+s+i:a,height:t?t.scale.bandwidth()+r+o:c,facet:{width:a,height:c}}}function KD(e,t){if(e.range===void 0){let{insetLeft:n,insetRight:r}=e,{width:i,marginLeft:o=0,marginRight:s=0}=t,a=o+n,c=i-s-r;e.range=[a,Math.max(a,c)],vo(e)||(e.range=rN(e)),e.scale.range(e.range)}nN(e)}function QD(e,t){if(e.range===void 0){let{insetTop:n,insetBottom:r}=e,{height:i,marginTop:o=0,marginBottom:s=0}=t,a=o+n,c=i-s-r;e.range=[Math.max(a,c),a],vo(e)?e.range.reverse():e.range=rN(e),e.scale.range(e.range)}nN(e)}function nN(e){e.round===void 0&&DV(e)&&TV(e)<=30&&e.scale.round(!0)}function TV({scale:e}){let t=e.domain().length,[n,r]=e.range(),i=e.paddingInner?e.paddingInner():1,o=e.paddingOuter?e.paddingOuter():e.padding(),s=t-i,a=Math.abs(r-n)/Math.max(1,s+o*2);return(a-Math.floor(a))*s}function rN(e){let t=e.scale.domain().length+CM(e);if(!(t>2))return e.range;let[n,r]=e.range;return Array.from({length:t},(i,o)=>n+o/(t-1)*(r-n))}function b1(e,t,n){return iN(e,n===void 0?void 0:[{hint:n}],{...t})}function iN(e,t=[],n={}){let r=EV(e,t,n);if(n.type===void 0&&n.domain===void 0&&n.range===void 0&&n.interval==null&&e!=="fx"&&e!=="fy"&&vo({type:r})){let i=t.map(({value:o})=>o).filter(o=>o!==void 0);i.some(De)?Pn(`Warning: some data associated with the ${e} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${sf(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${e} scale to "${sf(r)}".`):i.some($5)?Pn(`Warning: some data associated with the ${e} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${sf(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${e} scale to "${sf(r)}".`):i.some(U5)&&Pn(`Warning: some data associated with the ${e} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${sf(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${e} scale to "${sf(r)}".`)}switch(n.type=r,r){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":n=m1(t,n,Ze);break;case"identity":switch(le.get(e)){case ei:n=m1(t,n,Ze);break;case Xu:n=m1(t,n,NV);break}break;case"utc":case"time":n=m1(t,n,L5);break}switch(r){case"diverging":return RD(e,t,n);case"diverging-sqrt":return $D(e,t,n);case"diverging-pow":return BM(e,t,n);case"diverging-log":return UD(e,t,n);case"diverging-symlog":return PD(e,t,n);case"categorical":case"ordinal":case of:return WD(e,t,n);case"cyclical":case"sequential":case"linear":return DD(e,t,n);case"sqrt":return ND(e,t,n);case"threshold":return d1(e,t,n);case"quantile":return LD(e,t,n);case"quantize":return FD(e,t,n);case"pow":return NM(e,t,n);case"log":return BD(e,t,n);case"symlog":return OD(e,t,n);case"utc":return VD(e,t,n);case"time":return qD(e,t,n);case"point":return GD(e,t,n);case"band":return XD(e,t,n);case"identity":return CD(e);case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function sf(e){return typeof e=="symbol"?e.description:e}function JD(e){return typeof e=="string"?`${e}`.toLowerCase():e}var tN={toString:()=>"projection"};function EV(e,t,{type:n,domain:r,range:i,scheme:o,pivot:s,projection:a}){if(n=JD(n),e==="fx"||e==="fy")return"band";(e==="x"||e==="y")&&a!=null&&(n=tN);for(let l of t){let u=JD(l.type);if(u!==void 0){if(n===void 0)n=u;else if(n!==u)throw new Error(`scale incompatible with channel: ${n} !== ${u}`)}}if(n===tN)return;if(n!==void 0)return n;if(r===void 0&&!t.some(({value:l})=>l!==void 0))return;let c=le.get(e);if(c===tl)return"sqrt";if(c===nl||c===el)return"linear";if(c===Xu)return"ordinal";if((r||i||[]).length>2)return OM(c);if(r!==void 0){if(Ie(r))return OM(c);if(De(r))return"utc"}else{let l=t.map(({value:u})=>u).filter(u=>u!==void 0);if(l.some(Ie))return OM(c);if(l.some(De))return"utc"}if(c===Fr){if(s!=null||TD(o))return"diverging";if(ID(o))return"categorical"}return"linear"}function OM(e){switch(e){case ei:return"point";case Fr:return of;default:return"ordinal"}}function vo({type:e}){return e==="ordinal"||e==="point"||e==="band"||e===of}function CM({type:e}){return e==="threshold"}function DV({type:e}){return e==="point"||e==="band"}function ir(e){if(e===void 0)return!0;let t=e.domain(),n=e(t[0]);for(let r=1,i=t.length;r<i;++r)if(e(t[r])-n)return!1;return!0}function m1(e,{domain:t,...n},r){for(let i of e)i.value!==void 0&&(t===void 0&&(t=i.value?.domain),i.value=r(i.value));return{domain:t===void 0?t:r(t),...n}}function NV(e){return Vt(e,Hu)}function af(e={}){let t;for(let n in e)if(le.has(n)&&go(e[n])){if(t!==void 0)throw new Error("ambiguous scale definition; multiple scales found");t=sN(b1(n,e[n]))}if(t===void 0)throw new Error("invalid scale definition; no scale found");return t}function oN(e){return t=>{if(!le.has(t=`${t}`))throw new Error(`unknown scale: ${t}`);return e[t]}}function sN({scale:e,type:t,domain:n,range:r,interpolate:i,interval:o,transform:s,percent:a,pivot:c}){if(t==="identity")return{type:"identity",apply:u=>u,invert:u=>u};let l=e.unknown?e.unknown():void 0;return{type:t,domain:Da(n),...r!==void 0&&{range:Da(r)},...s!==void 0&&{transform:s},...a&&{percent:a},...l!==void 0&&{unknown:l},...o!==void 0&&{interval:o},...i!==void 0&&{interpolate:i},...e.clamp&&{clamp:e.clamp()},...c!==void 0&&{pivot:c,symmetric:!1},...e.base&&{base:e.base()},...e.exponent&&{exponent:e.exponent()},...e.constant&&{constant:e.constant()},...e.align&&{align:e.align(),round:e.round()},...e.padding&&(e.paddingInner?{paddingInner:e.paddingInner(),paddingOuter:e.paddingOuter()}:{padding:e.padding()}),...e.bandwidth&&{bandwidth:e.bandwidth(),step:e.step()},apply:u=>e(u),...e.invert&&{invert:u=>e.invert(u)}}}function cN(e,t,n={}){let r=.5-Ne,i=.5+Ne,o=.5+Ne,s=.5-Ne;for(let{marginTop:m,marginRight:g,marginBottom:y,marginLeft:b}of t)m>r&&(r=m),g>i&&(i=g),y>o&&(o=y),b>s&&(s=b);let{margin:a,marginTop:c=a!==void 0?a:r,marginRight:l=a!==void 0?a:i,marginBottom:u=a!==void 0?a:o,marginLeft:f=a!==void 0?a:s}=n;c=+c,l=+l,u=+u,f=+f;let{width:h=640,height:d=BV(e,n,{width:h,marginTopDefault:r,marginRightDefault:i,marginBottomDefault:o,marginLeftDefault:s})+Math.max(0,c-r+u-o)}=n;h=+h,d=+d;let p={width:h,height:d,marginTop:c,marginRight:l,marginBottom:u,marginLeft:f};if(e.fx||e.fy){let{margin:m,marginTop:g=m!==void 0?m:c,marginRight:y=m!==void 0?m:l,marginBottom:b=m!==void 0?m:u,marginLeft:x=m!==void 0?m:f}=n.facet??{};g=+g,y=+y,b=+b,x=+x,p.facet={marginTop:g,marginRight:y,marginBottom:b,marginLeft:x}}return p}function BV({x:e,y:t,fy:n,fx:r},{projection:i,aspectRatio:o},{width:s,marginTopDefault:a,marginRightDefault:c,marginBottomDefault:l,marginLeftDefault:u}){let f=n?n.scale.domain().length:1,h=bD(i);if(h){let p=r?r.scale.domain().length:1,m=(1.1*f-.1)/(1.1*p-.1)*h,g=Math.max(.1,Math.min(10,m));return Math.round((s-u-c)*g+a+l)}let d=t?vo(t)?t.scale.domain().length:Math.max(7,17/f):1;if(o!=null){if(o=+o,!(isFinite(o)&&o>0))throw new Error(`invalid aspectRatio: ${o}`);let p=aN("y",t)/(aN("x",e)*o),m=r?r.scale.bandwidth():1,g=n?n.scale.bandwidth():1,y=m*(s-u-c)-e.insetLeft-e.insetRight;return(p*y+t.insetTop+t.insetBottom)/g+a+l}return!!(t||n)*Math.max(1,Math.min(60,d*f))*20+!!r*30+60}function aN(e,t){if(!t)throw new Error(`aspectRatio requires ${e} scale`);let{type:n,domain:r}=t,i;switch(n){case"linear":case"utc":case"time":i=Number;break;case"pow":{let a=t.scale.exponent();i=c=>Math.pow(c,a);break}case"log":i=Math.log;break;case"point":case"band":return r.length;default:throw new Error(`unsupported ${e} scale for aspectRatio: ${n}`)}let[o,s]=se(r);return Math.abs(i(s)-i(o))}function uN(e,t){let{fx:n,fy:r}=Kp(e,t),i=n?.scale.domain(),o=r?.scale.domain();return i&&o?F0(i,o).map(([s,a],c)=>({x:s,y:a,i:c})):i?i.map((s,a)=>({x:s,i:a})):o?o.map((s,a)=>({y:s,i:a})):void 0}function fN(e,{x:t,y:n}){return t&&=PM(t),n&&=PM(n),e.filter(t&&n?r=>t.has(r.x)&&n.has(r.y):t?r=>t.has(r.x):r=>n.has(r.y)).sort(t&&n?(r,i)=>t.get(r.x)-t.get(i.x)||n.get(r.y)-n.get(i.y):t?(r,i)=>t.get(r.x)-t.get(i.x):(r,i)=>n.get(r.y)-n.get(i.y))}function w1(e,{fx:t,fy:n}){let r=nr(e),i=t?.value,o=n?.value;return t&&n?Ii(r,s=>(s.fx=i[s[0]],s.fy=o[s[0]],s),s=>i[s],s=>o[s]):t?Ii(r,s=>(s.fx=i[s[0]],s),s=>i[s]):Ii(r,s=>(s.fy=o[s[0]],s),s=>o[s])}function hN(e,t,{marginTop:n,marginLeft:r}){return e&&t?({x:i,y:o})=>`translate(${e(i)-r},${t(o)-n})`:e?({x:i})=>`translate(${e(i)-r},0)`:({y:i})=>`translate(0,${t(i)-n})`}function dN(e){let t=[],n=new Uint32Array(Sn(e,r=>r.length));for(let r of e){let i=0;for(let o of e)r!==o&&(n.set(o,i),i+=o.length);t.push(n.slice(0,i))}return t}var OV=new Map([["top",kM],["right",UM],["bottom",RM],["left",$M],["top-left",x1(kM,$M)],["top-right",x1(kM,UM)],["bottom-left",x1(RM,$M)],["bottom-right",x1(RM,UM)],["top-empty",FV],["right-empty",RV],["bottom-empty",CV],["left-empty",kV],["empty",$V]]);function pN(e){if(e==null)return null;let t=OV.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid facet anchor: ${e}`)}var lN=new WeakMap;function PM(e){let t=lN.get(e);return t||lN.set(e,t=new Yn(Vt(e,(n,r)=>[n,r]))),t}function Ra(e,t){return PM(e).get(t)}function LV(e,t,n){return t=Bs(t),n=Bs(n),e.find(r=>Object.is(Bs(r.x),t)&&Object.is(Bs(r.y),n))}function _1(e,t,n){return LV(e,t,n)?.empty}function kM(e,{y:t},{y:n}){return t?Ra(t,n)===0:!0}function RM(e,{y:t},{y:n}){return t?Ra(t,n)===t.length-1:!0}function $M(e,{x:t},{x:n}){return t?Ra(t,n)===0:!0}function UM(e,{x:t},{x:n}){return t?Ra(t,n)===t.length-1:!0}function FV(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=Ra(t,r);if(o>0)return _1(e,n,t[o-1])}function CV(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=Ra(t,r);if(o<t.length-1)return _1(e,n,t[o+1])}function kV(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=Ra(t,n);if(o>0)return _1(e,t[o-1],r)}function RV(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=Ra(t,n);if(o<t.length-1)return _1(e,t[o+1],r)}function $V(e,t,{empty:n}){return n}function x1(e,t){return function(){return e.apply(null,arguments)&&t.apply(null,arguments)}}function v1(e,{channels:{fx:t,fy:n},groups:r}){return t&&n?e.map(({x:i,y:o})=>r.get(i)?.get(o)??[]):t?e.map(({x:i})=>r.get(i)??[]):e.map(({y:i})=>r.get(i)??[])}var _t=class{constructor(t,n={},r={},i){let{facet:o="auto",facetAnchor:s,fx:a,fy:c,sort:l,dx:u=0,dy:f=0,margin:h=0,marginTop:d=h,marginRight:p=h,marginBottom:m=h,marginLeft:g=h,clip:y=i?.clip,channels:b,tip:x,render:w}=r;if(this.data=t,this.sort=bo(l)?l:null,this.initializer=_e(r).initializer,this.transform=this.initializer?r.transform:dn(r).transform,o===null||o===!1?this.facet=null:(this.facet=Ke(o===!0?"include":o,"facet",["auto","include","exclude","super"]),this.fx=t===Ta&&typeof a=="string"?[a]:a,this.fy=t===Ta&&typeof c=="string"?[c]:c),this.facetAnchor=pN(s),n=zp(n),b!==void 0&&(n={...UV(b),...n}),i!==void 0&&(n={...l1(this,r,i),...n}),this.channels=Object.fromEntries(Object.entries(n).map(([v,_])=>{if(Lr(_.value)){let{value:M,label:D=_.label,scale:A=_.scale}=_.value;_={..._,label:D,scale:A,value:M}}if(t===Ta&&typeof _.value=="string"){let{value:M}=_;_={..._,value:[M]}}return[v,_]}).filter(([v,{value:_,optional:M}])=>{if(_!=null)return!0;if(M)return!1;throw new Error(`missing channel value: ${v}`)})),this.dx=+u,this.dy=+f,this.marginTop=+d,this.marginRight=+p,this.marginBottom=+m,this.marginLeft=+g,this.clip=f1(y),this.tip=PV(x),this.facet==="super"){if(a||c)throw new Error("super-faceting cannot use fx or fy");for(let v in this.channels){let{scale:_}=n[v];if(!(_!=="x"&&_!=="y"))throw new Error("super-faceting cannot use x or y")}}w!=null&&(this.render=cf(w,this.render))}initialize(t,n,r){let i=Pe(this.data);t===void 0&&i!=null&&(t=[nr(i)]);let o=t;this.transform!=null&&({facets:t,data:i}=this.transform(i,t,r),i=Pe(i)),t!==void 0&&(t.original=o);let s=s1(this.channels,i);return this.sort!=null&&oD(i,t,s,n,this.sort),{data:i,facets:t,channels:s}}filter(t,n,r){for(let i in n){let{filter:o=$e}=n[i];if(o!==null){let s=r[i];t=t.filter(a=>o(s[a]))}}return t}project(t,n,r){for(let i in t)if(t[i].scale==="x"&&/^x|x$/.test(i)){let o=i.replace(/^x|x$/,"y");o in t&&t[o].scale==="y"&&IM(i,o,n,r.projection)}}scale(t,n,r){let i=Qu(t,n);return r.projection&&this.project(t,i,r),i}};function Qe(...e){return e.plot=_t.prototype.plot,e}function cf(e,t){if(e==null)return t===null?void 0:t;if(t==null)return e===null?void 0:e;if(typeof e!="function")throw new TypeError(`invalid render transform: ${e}`);if(typeof t!="function")throw new TypeError(`invalid render transform: ${t}`);return function(n,r,i,o,s,a){return e.call(this,n,r,i,o,s,(c,l,u,f,h)=>t.call(this,c,l,u,f,h,a))}}function UV(e){return Object.fromEntries(Object.entries(zp(e)).map(([t,n])=>(n=typeof n=="string"?{value:n,label:t}:ti(n),n.filter===void 0&&n.scale==null&&(n={...n,filter:null}),[t,n])))}function PV(e){return e===!0?"xy":e===!1||e==null?null:typeof e=="string"?Ke(e,"tip",["x","y","xy"]):e}function Oi(e,t){return e?.tip===!0?{...e,tip:t}:fn(e?.tip)&&e.tip.pointer===void 0?{...e,tip:{...e.tip,pointer:t}}:e}var mN=new WeakMap;function zM(e,t,{x:n,y:r,px:i,py:o,maxRadius:s=40,channels:a,render:c,...l}={}){return s=+s,i!=null&&(n??=null,a={...a,px:{value:i,scale:"x"}}),o!=null&&(r??=null,a={...a,py:{value:o,scale:"y"}}),{x:n,y:r,channels:a,...l,render:cf(function(u,f,h,d,p,m){p={...p,pointerSticky:!1};let g=p.ownerSVGElement,{data:y}=p.getMarkState(this),b=mN.get(g);b||mN.set(g,b={sticky:!1,roots:[],renders:[]});let x=b.renders.push(G)-1,{x:w,y:v,fx:_,fy:M}=f,D=_?_(u.fx)-d.marginLeft:0,A=M?M(u.fy)-d.marginTop:0;w?.bandwidth&&(D+=w.bandwidth()/2),v?.bandwidth&&(A+=v.bandwidth()/2);let N=u.fi!=null,T;if(N){let j=b.facetStates;j||(b.facetStates=j=new Map),T=j.get(this),T||j.set(this,T=new Map)}let[B,L]=pn(this,d),{px:S,py:I}=h,E=S?j=>S[j]:qM(h,B),C=I?j=>I[j]:VM(h,L),k,F,R,$;function U(j,nt){if(N)if($&&($=cancelAnimationFrame($)),j==null)T.delete(u.fi);else{T.set(u.fi,nt),$=requestAnimationFrame(()=>{$=null;for(let[z,X]of T)if(X<nt||X===nt&&z<u.fi){j=null;break}G(j)});return}G(j)}function G(j){if(k===j&&R===b.sticky)return;k=j,R=p.pointerSticky=b.sticky;let nt=k==null?[]:[k];N&&(nt.fx=u.fx,nt.fy=u.fy,nt.fi=u.fi);let z=m(nt,f,h,d,p);if(F){if(N){let X=F.parentNode,rt=F.getAttribute("transform"),P=z.getAttribute("transform");rt?z.setAttribute("transform",rt):z.removeAttribute("transform"),P?X.setAttribute("transform",P):X.removeAttribute("transform"),z.removeAttribute("aria-label"),z.removeAttribute("aria-description"),z.removeAttribute("aria-hidden")}F.replaceWith(z)}return b.roots[x]=F=z,k==null&&T?.size>1||p.dispatchValue(k==null?null:y[k]),z}function J(j){if(b.sticky||j.pointerType==="mouse"&&j.buttons===1)return;let[nt,z]=Bn(j);nt-=D,z-=A;let X=nt<d.marginLeft||nt>d.width-d.marginRight?1:e,rt=z<d.marginTop||z>d.height-d.marginBottom?1:t,P=null,Ot=s*s;for(let ft of u){let Yt=X*(E(ft)-nt),Wt=rt*(C(ft)-z),tt=Yt*Yt+Wt*Wt;tt<=Ot&&(P=ft,Ot=tt)}if(P!=null&&(e!==1||t!==1)){let ft=E(P)-nt,Yt=C(P)-z;Ot=ft*ft+Yt*Yt}U(P,Ot)}function et(j){j.pointerType==="mouse"&&k!=null&&(b.sticky&&b.roots.some(nt=>nt?.contains(j.target))||(b.sticky?(b.sticky=!1,b.renders.forEach(nt=>nt(null))):(b.sticky=!0,G(k)),j.stopImmediatePropagation()))}function st(j){j.pointerType==="mouse"&&(b.sticky||U(null))}return g.addEventListener("pointerenter",J),g.addEventListener("pointermove",J),g.addEventListener("pointerdown",et),g.addEventListener("pointerleave",st),G(null)},c)}}function lf(e){return zM(1,1,e)}function uf(e){return zM(1,.01,e)}function il(e){return zM(.01,1,e)}function qM({x1:e,x2:t,x:n=e},r){return e&&t?i=>(e[i]+t[i])/2:n?i=>n[i]:()=>r}function VM({y1:e,y2:t,y:n=e},r){return e&&t?i=>(e[i]+t[i])/2:n?i=>n[i]:()=>r}function S1(e){return vo(e)&&e.interval===void 0?void 0:"tabular-nums"}function yN(e,t){let{label:n=e.label,tickSize:r=6,width:i=240,height:o=44+r,marginTop:s=18,marginRight:a=0,marginBottom:c=16+r,marginLeft:l=0,style:u,ticks:f=(i-l-a)/64,tickFormat:h,fontVariant:d=S1(e),round:p=!0,opacity:m,className:g}=t,y=Ca(t);g=Ju(g),m=re(m)[1],h===null&&(h=()=>null);let b=lt("svg",y).attr("class",`${g}-ramp`).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",i).attr("height",o).attr("viewBox",`0 0 ${i} ${o}`).call(B=>B.append("style").text(`:where(.${g}-ramp) {
|
|
17
17
|
display: block;
|
|
18
18
|
height: auto;
|
|
19
19
|
height: intrinsic;
|
|
@@ -22,9 +22,9 @@ ${n}`}function Dq(e){return e==="time"?Yx:e==="utc"?zp:Tq}function SD(e,t,n){let
|
|
|
22
22
|
}
|
|
23
23
|
:where(.${g}-ramp text) {
|
|
24
24
|
white-space: pre;
|
|
25
|
-
}`)).call(nf,u),x=O=>O.selectAll(".tick line").attr("y1",s+c-o),w,v=p?(O,B)=>O.rangeRound(B):(O,B)=>O.range(B),{type:_,domain:M,range:E,interpolate:N,scale:I,pivot:T}=e;if(N){let O=E===void 0?N:to(N.length===1?tm(N):N,E);w=v(I.copy(),Nn(ge(l,i-a),Math.min(M.length+(T!==void 0),E===void 0?1/0:E.length)));let B=256,S=y.document.createElement("canvas");S.width=B,S.height=1;let A=S.getContext("2d");for(let D=0,C=B-1;D<B;++D)A.fillStyle=O(D/C),A.fillRect(D,0,1,1);b.append("image").attr("opacity",m).attr("x",l).attr("y",s).attr("width",i-l-a).attr("height",o-s-c).attr("preserveAspectRatio","none").attr("xlink:href",S.toDataURL())}else if(_==="threshold"){let O=M,B=h===void 0?S=>S:typeof h=="string"?Xr(h):h;w=v(ys().domain([-1,E.length-1]),[l,i-a]),b.append("g").attr("fill-opacity",m).selectAll().data(E).enter().append("rect").attr("x",(S,A)=>w(A-1)).attr("y",s).attr("width",(S,A)=>w(A)-w(A-1)).attr("height",o-s-c).attr("fill",S=>S),f=qt(O,(S,A)=>A),h=S=>B(O[S],S)}else w=v(va().domain(M),[l,i-a]),b.append("g").attr("fill-opacity",m).selectAll().data(M).enter().append("rect").attr("x",w).attr("y",s).attr("width",Math.max(0,w.bandwidth()-1)).attr("height",o-s-c).attr("fill",I),x=()=>{};return b.append("g").attr("transform",`translate(0,${o-c})`).call(nv(w).ticks(Array.isArray(f)?null:f,typeof h=="string"?h:void 0).tickFormat(typeof h=="function"?h:void 0).tickSize(r).tickValues(Array.isArray(f)?f:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",se(d,"normal")).call(x).call(O=>O.select(".domain").remove()),n!==void 0&&b.append("text").attr("x",l).attr("y",s-6).attr("fill","currentColor").attr("font-weight","bold").text(n),b.node()}var df=Math.PI/180;function Fi(e,{marker:t,markerStart:n=t,markerMid:r=t,markerEnd:i=t}={}){e.markerStart=VI(n),e.markerMid=VI(r),e.markerEnd=VI(i)}function VI(e){if(e==null||e===!1)return null;if(e===!0)return dN;if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"none":return null;case"arrow":return hN("auto");case"arrow-reverse":return hN("auto-start-reverse");case"dot":return jV;case"circle":case"circle-fill":return dN;case"circle-stroke":return YV;case"tick":return jI("auto");case"tick-x":return jI(90);case"tick-y":return jI(0)}throw new Error(`invalid marker: ${e}`)}function hN(e){return(t,n)=>at("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient",e).attr("fill","none").attr("stroke",t).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call(r=>r.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function jV(e,t){return at("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","none").call(n=>n.append("circle").attr("r",2.5)).node()}function dN(e,t){return at("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","var(--plot-background)").attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function YV(e,t){return at("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","var(--plot-background)").attr("stroke",e).attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function jI(e){return(t,n)=>at("svg:marker",n).attr("viewBox","-3 -3 6 6").attr("markerWidth",6).attr("markerHeight",6).attr("orient",e).attr("stroke",t).call(r=>r.append("path").attr("d","M0,-3v6")).node()}var WV=0;function ks(e,t,{stroke:n},r){return mN(e,t,n&&(i=>n[i]),r)}function pN(e,t,{stroke:n},r){return mN(e,t,n&&(([i])=>n[i]),r)}function mN(e,{markerStart:t,markerMid:n,markerEnd:r,stroke:i},o=()=>i,s){let a=new Map;function c(l){return function(u){let f=o(u),h=a.get(l);h||a.set(l,h=new Map);let d=h.get(f);if(!d){let p=this.parentNode.insertBefore(l(f,s),this),m=`plot-marker-${++WV}`;p.setAttribute("id",m),h.set(f,d=`url(#${m})`)}return d}}t&&e.attr("marker-start",c(t)),n&&e.attr("marker-mid",c(n)),r&&e.attr("marker-end",c(r))}function al({inset:e,insetLeft:t,insetRight:n,...r}={}){return[t,n]=yN(e,t,n),{inset:e,insetLeft:t,insetRight:n,...r}}function cl({inset:e,insetTop:t,insetBottom:n,...r}={}){return[t,n]=yN(e,t,n),{inset:e,insetTop:t,insetBottom:n,...r}}function yN(e,t,n){return e===void 0&&t===void 0&&n===void 0?Ee?[1,0]:[.5,.5]:[t,n]}function gN(e,{interval:t}){return e={...ti(e)},e.interval=Hu(e.interval===void 0?t:e.interval),e}function S1(e,t,n,r){let{[e]:i,[`${e}1`]:o,[`${e}2`]:s}=n,{value:a,interval:c}=gN(i,n);if(a==null||c==null&&!r)return n;let l=Mn(i);if(c==null){let d,p={transform:m=>d||(d=dt(m,a)),label:l};return{...n,[e]:void 0,[`${e}1`]:o===void 0?p:o,[`${e}2`]:s===void 0&&!(o===s&&r)?p:s}}let u,f;function h(d){return f!==void 0&&d===u?f:f=qt(dt(u=d,a),p=>c.floor(p))}return t({...n,[e]:void 0,[`${e}1`]:o===void 0?{transform:h,label:l}:o,[`${e}2`]:s===void 0?{transform:d=>h(d).map(p=>c.offset(p)),label:l}:s})}function bN(e,t,n){let{[e]:r}=n,{value:i,interval:o}=gN(r,n);return i==null||o==null?n:t({...n,[e]:{label:Mn(r),transform:s=>{let a=qt(dt(s,i),l=>o.floor(l)),c=a.map(l=>o.offset(l));return a.map(Te(a)?(l,u)=>l==null||isNaN(l=+l)||(u=c[u],u==null)||isNaN(u=+u)?void 0:new Date((l+u)/2):(l,u)=>l==null||(u=c[u],u==null)?NaN:(+l+ +u)/2)}}})}function YI(e={}){return S1("x",al,e,!0)}function WI(e={}){return S1("y",cl,e,!0)}function I1(e={}){return S1("x",al,e)}function M1(e={}){return S1("y",cl,e)}function A1(e={}){return bN("x",al,e)}function T1(e={}){return bN("y",cl,e)}var xN={ariaLabel:"rule",fill:null,stroke:"currentColor"},nm=class extends xt{constructor(t,n={}){let{x:r,y1:i,y2:o,inset:s=0,insetTop:a=s,insetBottom:c=s}=n;super(t,{x:{value:r,scale:"x",optional:!0},y1:{value:i,scale:"y",optional:!0},y2:{value:o,scale:"y",optional:!0}},Bi(n,"x"),xN),this.insetTop=At(a),this.insetBottom=At(c),Fi(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y1:l,y2:u}=r,{width:f,height:h,marginTop:d,marginRight:p,marginLeft:m,marginBottom:g}=i,{insetTop:y,insetBottom:b}=this;return at("svg:g",o).call(Ot,this,i,o).call(_t,this,{x:c&&s},Ee,0).call(x=>x.selectAll().data(t).enter().append("line").call(Tt,this).attr("x1",c?w=>c[w]:(m+f-p)/2).attr("x2",c?w=>c[w]:(m+f-p)/2).attr("y1",l&&!er(a)?w=>l[w]+y:d+y).attr("y2",u&&!er(a)?a.bandwidth?w=>u[w]+a.bandwidth()-b:w=>u[w]-b:h-g-b).call(Xt,this,r).call(ks,this,r,o)).node()}},rm=class extends xt{constructor(t,n={}){let{x1:r,x2:i,y:o,inset:s=0,insetRight:a=s,insetLeft:c=s}=n;super(t,{y:{value:o,scale:"y",optional:!0},x1:{value:r,scale:"x",optional:!0},x2:{value:i,scale:"x",optional:!0}},Bi(n,"y"),xN),this.insetRight=At(a),this.insetLeft=At(c),Fi(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{y:c,x1:l,x2:u}=r,{width:f,height:h,marginTop:d,marginRight:p,marginLeft:m,marginBottom:g}=i,{insetLeft:y,insetRight:b}=this;return at("svg:g",o).call(Ot,this,i,o).call(_t,this,{y:c&&a},0,Ee).call(x=>x.selectAll().data(t).enter().append("line").call(Tt,this).attr("x1",l&&!er(s)?w=>l[w]+y:m+y).attr("x2",u&&!er(s)?s.bandwidth?w=>u[w]+s.bandwidth()-b:w=>u[w]-b:f-p-b).attr("y1",c?w=>c[w]:(d+h-g)/2).attr("y2",c?w=>c[w]:(d+h-g)/2).call(Xt,this,r).call(ks,this,r,o)).node()}};function Cr(e,t){let{x:n=W,y:r,y1:i,y2:o,...s}=M1(t);return[i,o]=wN(r,i,o),new nm(e,{...s,x:n,y1:i,y2:o})}function Lr(e,t){let{y:n=W,x:r,x1:i,x2:o,...s}=I1(t);return[i,o]=wN(r,i,o),new rm(e,{...s,y:n,x1:i,x2:o})}function wN(e,t,n){if(e==null){if(t===void 0){if(n!==void 0)return[0,n]}else if(n===void 0)return[0,t]}else{if(t===void 0)return n===void 0?[0,e]:[e,n];if(n===void 0)return[e,t]}return[t,n]}function Ua(e,...t){let n=t.length;for(let r=0,i=!0;r<n;++r)typeof t[r]!="function"&&(i&&(e=e.slice(),i=!1),e.splice(r,2,e[r]+t[r]+e[r+1]),t.splice(r,1),--r,--n);return r=>{let i=e[0];for(let o=0;o<n;++o)i+=t[o](r)+e[o+1];return i}}var GV={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"},MN="\xAD",ul=class extends xt{constructor(t,n={}){let{x:r,y:i,text:o=tr(t)&&Hx(t)?W:ve,frameAnchor:s,textAnchor:a=/right$/i.test(s)?"end":/left$/i.test(s)?"start":"middle",lineAnchor:c=/^top/i.test(s)?"top":/^bottom/i.test(s)?"bottom":"middle",lineHeight:l=1,lineWidth:u=1/0,textOverflow:f,monospace:h,fontFamily:d=h?"ui-monospace, monospace":void 0,fontSize:p,fontStyle:m,fontVariant:g,fontWeight:y,rotate:b}=n,[x,w]=ee(b,0),[v,_]=KV(p);if(super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},fontSize:{value:v,optional:!0},rotate:{value:OD(x),optional:!0},text:{value:o,filter:Pp,optional:!0}},n,GV),this.rotate=w,this.textAnchor=se(a,"middle"),this.lineAnchor=He(c,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+l,this.lineWidth=+u,this.textOverflow=XI(f),this.monospace=!!h,this.fontFamily=$e(d),this.fontSize=_,this.fontStyle=$e(m),this.fontVariant=$e(g),this.fontWeight=$e(y),this.frameAnchor=wo(s),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${u}`);this.splitLines=ZI(this),this.clipLine=KI(this)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,rotate:u,text:f,title:h,fontSize:d}=r,{rotate:p}=this,[m,g]=fn(this,i);return at("svg:g",o).call(Ot,this,i,o).call(HI,this,f,i).call(_t,this,{x:c&&s,y:l&&a}).call(y=>y.selectAll().data(t).enter().append("text").call(Tt,this).call(XV,this,f,h).attr("transform",Ua`translate(${c?b=>c[b]:m},${l?b=>l[b]:g})${u?b=>` rotate(${u[b]})`:p?` rotate(${p})`:""}`).call(ut,"font-size",d&&(b=>d[b])).call(Xt,this,r)).node()}};function XI(e){return e==null?null:He(e,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function XV(e,t,n,r){if(!n)return;let{lineAnchor:i,lineHeight:o,textOverflow:s,splitLines:a,clipLine:c}=t;e.each(function(l){let u=a(Ni(n[l])??"").map(c),f=u.length,h=i==="top"?.71:i==="bottom"?1-f:(164-f*100)/200;if(f>1){let d=0;for(let p=0;p<f;++p){if(++d,!u[p])continue;let m=this.ownerDocument.createElementNS(jr.svg,"tspan");m.setAttribute("x",0),p===d-1?m.setAttribute("y",`${(h+p)*o}em`):m.setAttribute("dy",`${d*o}em`),m.textContent=u[p],this.appendChild(m),d=0}}else h&&this.setAttribute("y",`${h*o}em`),this.textContent=u[0];if(s&&!r&&u[0]!==n[l]){let d=this.ownerDocument.createElementNS(jr.svg,"title");d.textContent=n[l],this.appendChild(d)}})}function So(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Ce(t,n)),new ul(e,{...r,x:t,y:n})}function E1(e,{x:t=W,...n}={}){return new ul(e,T1({...n,x:t}))}function D1(e,{y:t=W,...n}={}){return new ul(e,A1({...n,y:t}))}function HI(e,t,n){ut(e,"text-anchor",t.textAnchor),ut(e,"font-family",t.fontFamily),ut(e,"font-size",t.fontSize),ut(e,"font-style",t.fontStyle),ut(e,"font-variant",t.fontVariant===void 0?HV(n):t.fontVariant),ut(e,"font-weight",t.fontWeight)}function HV(e){return e&&(Ns(e)||Te(e))?"tabular-nums":void 0}var ZV=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function KV(e){return e==null||typeof e=="number"?[void 0,e]:typeof e!="string"?[e,void 0]:(e=e.trim().toLowerCase(),ZV.has(e)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(e)?[void 0,e]:[e,void 0])}function QV(e,t,n){let r=[],i,o=0;for(let[s,a,c]of JV(e)){if(i===void 0&&(i=s),o>i&&n(e,i,a)>t&&(r.push(e.slice(i,o)+(e[o-1]===MN?"-":"")),i=s),c){r.push(e.slice(i,a)),i=void 0;continue}o=a}return r}function*JV(e){let t=0,n=0,r=e.length;for(;n<r;){let i=1;switch(e[n]){case MN:case"-":++n,yield[t,n,!1],t=n;break;case" ":for(yield[t,n,!1];e[++n]===" ";);t=n;break;case"\r":e[n+1]===`
|
|
25
|
+
}`)).call(tf,u),x=B=>B.selectAll(".tick line").attr("y1",s+c-o),w,v=p?(B,L)=>B.rangeRound(L):(B,L)=>B.range(L),{type:_,domain:M,range:D,interpolate:A,scale:N,pivot:T}=e;if(A){let B=D===void 0?A:Ji(A.length===1?Zp(A):A,D);w=v(N.copy(),On(xe(l,i-a),Math.min(M.length+(T!==void 0),D===void 0?1/0:D.length)));let L=256,S=y.document.createElement("canvas");S.width=L,S.height=1;let I=S.getContext("2d");for(let E=0,C=L-1;E<L;++E)I.fillStyle=B(E/C),I.fillRect(E,0,1,1);b.append("image").attr("opacity",m).attr("x",l).attr("y",s).attr("width",i-l-a).attr("height",o-s-c).attr("preserveAspectRatio","none").attr("xlink:href",S.toDataURL())}else if(_==="threshold"){let B=M,L=h===void 0?S=>S:typeof h=="string"?Xr(h):h;w=v(bs().domain([-1,D.length-1]),[l,i-a]),b.append("g").attr("fill-opacity",m).selectAll().data(D).enter().append("rect").attr("x",(S,I)=>w(I-1)).attr("y",s).attr("width",(S,I)=>w(I)-w(I-1)).attr("height",o-s-c).attr("fill",S=>S),f=Vt(B,(S,I)=>I),h=S=>L(B[S],S)}else w=v(wa().domain(M),[l,i-a]),b.append("g").attr("fill-opacity",m).selectAll().data(M).enter().append("rect").attr("x",w).attr("y",s).attr("width",Math.max(0,w.bandwidth()-1)).attr("height",o-s-c).attr("fill",N),x=()=>{};return b.append("g").attr("transform",`translate(0,${o-c})`).call(rv(w).ticks(Array.isArray(f)?null:f,typeof h=="string"?h:void 0).tickFormat(typeof h=="function"?h:void 0).tickSize(r).tickValues(Array.isArray(f)?f:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",ce(d,"normal")).call(x).call(B=>B.select(".domain").remove()),n!==void 0&&b.append("text").attr("x",l).attr("y",s-6).attr("fill","currentColor").attr("font-weight","bold").text(n),b.node()}var ff=Math.PI/180;function Li(e,{marker:t,markerStart:n=t,markerMid:r=t,markerEnd:i=t}={}){e.markerStart=jM(n),e.markerMid=jM(r),e.markerEnd=jM(i)}function jM(e){if(e==null||e===!1)return null;if(e===!0)return bN;if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"none":return null;case"arrow":return gN("auto");case"arrow-reverse":return gN("auto-start-reverse");case"dot":return zV;case"circle":case"circle-fill":return bN;case"circle-stroke":return qV;case"tick":return YM("auto");case"tick-x":return YM(90);case"tick-y":return YM(0)}throw new Error(`invalid marker: ${e}`)}function gN(e){return(t,n)=>lt("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient",e).attr("fill","none").attr("stroke",t).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call(r=>r.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function zV(e,t){return lt("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","none").call(n=>n.append("circle").attr("r",2.5)).node()}function bN(e,t){return lt("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","var(--plot-background)").attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function qV(e,t){return lt("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","var(--plot-background)").attr("stroke",e).attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function YM(e){return(t,n)=>lt("svg:marker",n).attr("viewBox","-3 -3 6 6").attr("markerWidth",6).attr("markerHeight",6).attr("orient",e).attr("stroke",t).call(r=>r.append("path").attr("d","M0,-3v6")).node()}var VV=0;function $s(e,t,{stroke:n},r){return wN(e,t,n&&(i=>n[i]),r)}function xN(e,t,{stroke:n},r){return wN(e,t,n&&(([i])=>n[i]),r)}function wN(e,{markerStart:t,markerMid:n,markerEnd:r,stroke:i},o=()=>i,s){let a=new Map;function c(l){return function(u){let f=o(u),h=a.get(l);h||a.set(l,h=new Map);let d=h.get(f);if(!d){let p=this.parentNode.insertBefore(l(f,s),this),m=`plot-marker-${++VV}`;p.setAttribute("id",m),h.set(f,d=`url(#${m})`)}return d}}t&&e.attr("marker-start",c(t)),n&&e.attr("marker-mid",c(n)),r&&e.attr("marker-end",c(r))}function ol({inset:e,insetLeft:t,insetRight:n,...r}={}){return[t,n]=_N(e,t,n),{inset:e,insetLeft:t,insetRight:n,...r}}function sl({inset:e,insetTop:t,insetBottom:n,...r}={}){return[t,n]=_N(e,t,n),{inset:e,insetTop:t,insetBottom:n,...r}}function _N(e,t,n){return e===void 0&&t===void 0&&n===void 0?Ne?[1,0]:[.5,.5]:[t,n]}function vN(e,{interval:t}){return e={...ti(e)},e.interval=Gu(e.interval===void 0?t:e.interval),e}function M1(e,t,n,r){let{[e]:i,[`${e}1`]:o,[`${e}2`]:s}=n,{value:a,interval:c}=vN(i,n);if(a==null||c==null&&!r)return n;let l=En(i);if(c==null){let d,p={transform:m=>d||(d=bt(m,a)),label:l};return{...n,[e]:void 0,[`${e}1`]:o===void 0?p:o,[`${e}2`]:s===void 0&&!(o===s&&r)?p:s}}let u,f;function h(d){return f!==void 0&&d===u?f:f=Vt(bt(u=d,a),p=>c.floor(p))}return t({...n,[e]:void 0,[`${e}1`]:o===void 0?{transform:h,label:l}:o,[`${e}2`]:s===void 0?{transform:d=>h(d).map(p=>c.offset(p)),label:l}:s})}function SN(e,t,n){let{[e]:r}=n,{value:i,interval:o}=vN(r,n);return i==null||o==null?n:t({...n,[e]:{label:En(r),transform:s=>{let a=Vt(bt(s,i),l=>o.floor(l)),c=a.map(l=>o.offset(l));return a.map(De(a)?(l,u)=>l==null||isNaN(l=+l)||(u=c[u],u==null)||isNaN(u=+u)?void 0:new Date((l+u)/2):(l,u)=>l==null||(u=c[u],u==null)?NaN:(+l+ +u)/2)}}})}function WM(e={}){return M1("x",ol,e,!0)}function GM(e={}){return M1("y",sl,e,!0)}function I1(e={}){return M1("x",ol,e)}function A1(e={}){return M1("y",sl,e)}function T1(e={}){return SN("x",ol,e)}function E1(e={}){return SN("y",sl,e)}var MN={ariaLabel:"rule",fill:null,stroke:"currentColor"},Qp=class extends _t{constructor(t,n={}){let{x:r,y1:i,y2:o,inset:s=0,insetTop:a=s,insetBottom:c=s}=n;super(t,{x:{value:r,scale:"x",optional:!0},y1:{value:i,scale:"y",optional:!0},y2:{value:o,scale:"y",optional:!0}},Oi(n,"x"),MN),this.insetTop=Dt(a),this.insetBottom=Dt(c),Li(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y1:l,y2:u}=r,{width:f,height:h,marginTop:d,marginRight:p,marginLeft:m,marginBottom:g}=i,{insetTop:y,insetBottom:b}=this;return lt("svg:g",o).call(Bt,this,i,o).call(It,this,{x:c&&s},Ne,0).call(x=>x.selectAll().data(t).enter().append("line").call(Nt,this).attr("x1",c?w=>c[w]:(m+f-p)/2).attr("x2",c?w=>c[w]:(m+f-p)/2).attr("y1",l&&!ir(a)?w=>l[w]+y:d+y).attr("y2",u&&!ir(a)?a.bandwidth?w=>u[w]+a.bandwidth()-b:w=>u[w]-b:h-g-b).call(Ht,this,r).call($s,this,r,o)).node()}},Jp=class extends _t{constructor(t,n={}){let{x1:r,x2:i,y:o,inset:s=0,insetRight:a=s,insetLeft:c=s}=n;super(t,{y:{value:o,scale:"y",optional:!0},x1:{value:r,scale:"x",optional:!0},x2:{value:i,scale:"x",optional:!0}},Oi(n,"y"),MN),this.insetRight=Dt(a),this.insetLeft=Dt(c),Li(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{y:c,x1:l,x2:u}=r,{width:f,height:h,marginTop:d,marginRight:p,marginLeft:m,marginBottom:g}=i,{insetLeft:y,insetRight:b}=this;return lt("svg:g",o).call(Bt,this,i,o).call(It,this,{y:c&&a},0,Ne).call(x=>x.selectAll().data(t).enter().append("line").call(Nt,this).attr("x1",l&&!ir(s)?w=>l[w]+y:m+y).attr("x2",u&&!ir(s)?s.bandwidth?w=>u[w]+s.bandwidth()-b:w=>u[w]-b:f-p-b).attr("y1",c?w=>c[w]:(d+h-g)/2).attr("y2",c?w=>c[w]:(d+h-g)/2).call(Ht,this,r).call($s,this,r,o)).node()}};function Cr(e,t){let{x:n=W,y:r,y1:i,y2:o,...s}=A1(t);return[i,o]=IN(r,i,o),new Qp(e,{...s,x:n,y1:i,y2:o})}function kr(e,t){let{y:n=W,x:r,x1:i,x2:o,...s}=I1(t);return[i,o]=IN(r,i,o),new Jp(e,{...s,y:n,x1:i,x2:o})}function IN(e,t,n){if(e==null){if(t===void 0){if(n!==void 0)return[0,n]}else if(n===void 0)return[0,t]}else{if(t===void 0)return n===void 0?[0,e]:[e,n];if(n===void 0)return[e,t]}return[t,n]}function $a(e,...t){let n=t.length;for(let r=0,i=!0;r<n;++r)typeof t[r]!="function"&&(i&&(e=e.slice(),i=!1),e.splice(r,2,e[r]+t[r]+e[r+1]),t.splice(r,1),--r,--n);return r=>{let i=e[0];for(let o=0;o<n;++o)i+=t[o](r)+e[o+1];return i}}var jV={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"},NN="\xAD",cl=class extends _t{constructor(t,n={}){let{x:r,y:i,text:o=rr(t)&&Zx(t)?W:Me,frameAnchor:s,textAnchor:a=/right$/i.test(s)?"end":/left$/i.test(s)?"start":"middle",lineAnchor:c=/^top/i.test(s)?"top":/^bottom/i.test(s)?"bottom":"middle",lineHeight:l=1,lineWidth:u=1/0,textOverflow:f,monospace:h,fontFamily:d=h?"ui-monospace, monospace":void 0,fontSize:p,fontStyle:m,fontVariant:g,fontWeight:y,rotate:b}=n,[x,w]=re(b,0),[v,_]=XV(p);if(super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},fontSize:{value:v,optional:!0},rotate:{value:k5(x),optional:!0},text:{value:o,filter:Cp,optional:!0}},n,jV),this.rotate=w,this.textAnchor=ce(a,"middle"),this.lineAnchor=Ke(c,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+l,this.lineWidth=+u,this.textOverflow=HM(f),this.monospace=!!h,this.fontFamily=Ue(d),this.fontSize=_,this.fontStyle=Ue(m),this.fontVariant=Ue(g),this.fontWeight=Ue(y),this.frameAnchor=wo(s),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${u}`);this.splitLines=KM(this),this.clipLine=QM(this)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,rotate:u,text:f,title:h,fontSize:d}=r,{rotate:p}=this,[m,g]=pn(this,i);return lt("svg:g",o).call(Bt,this,i,o).call(ZM,this,f,i).call(It,this,{x:c&&s,y:l&&a}).call(y=>y.selectAll().data(t).enter().append("text").call(Nt,this).call(YV,this,f,h).attr("transform",$a`translate(${c?b=>c[b]:m},${l?b=>l[b]:g})${u?b=>` rotate(${u[b]})`:p?` rotate(${p})`:""}`).call(ut,"font-size",d&&(b=>d[b])).call(Ht,this,r)).node()}};function HM(e){return e==null?null:Ke(e,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function YV(e,t,n,r){if(!n)return;let{lineAnchor:i,lineHeight:o,textOverflow:s,splitLines:a,clipLine:c}=t;e.each(function(l){let u=a(Ni(n[l])??"").map(c),f=u.length,h=i==="top"?.71:i==="bottom"?1-f:(164-f*100)/200;if(f>1){let d=0;for(let p=0;p<f;++p){if(++d,!u[p])continue;let m=this.ownerDocument.createElementNS(Yr.svg,"tspan");m.setAttribute("x",0),p===d-1?m.setAttribute("y",`${(h+p)*o}em`):m.setAttribute("dy",`${d*o}em`),m.textContent=u[p],this.appendChild(m),d=0}}else h&&this.setAttribute("y",`${h*o}em`),this.textContent=u[0];if(s&&!r&&u[0]!==n[l]){let d=this.ownerDocument.createElementNS(Yr.svg,"title");d.textContent=n[l],this.appendChild(d)}})}function So(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Ce(t,n)),new cl(e,{...r,x:t,y:n})}function D1(e,{x:t=W,...n}={}){return new cl(e,E1({...n,x:t}))}function N1(e,{y:t=W,...n}={}){return new cl(e,T1({...n,y:t}))}function ZM(e,t,n){ut(e,"text-anchor",t.textAnchor),ut(e,"font-family",t.fontFamily),ut(e,"font-size",t.fontSize),ut(e,"font-style",t.fontStyle),ut(e,"font-variant",t.fontVariant===void 0?WV(n):t.fontVariant),ut(e,"font-weight",t.fontWeight)}function WV(e){return e&&(Os(e)||De(e))?"tabular-nums":void 0}var GV=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function XV(e){return e==null||typeof e=="number"?[void 0,e]:typeof e!="string"?[e,void 0]:(e=e.trim().toLowerCase(),GV.has(e)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(e)?[void 0,e]:[e,void 0])}function HV(e,t,n){let r=[],i,o=0;for(let[s,a,c]of ZV(e)){if(i===void 0&&(i=s),o>i&&n(e,i,a)>t&&(r.push(e.slice(i,o)+(e[o-1]===NN?"-":"")),i=s),c){r.push(e.slice(i,a)),i=void 0;continue}o=a}return r}function*ZV(e){let t=0,n=0,r=e.length;for(;n<r;){let i=1;switch(e[n]){case NN:case"-":++n,yield[t,n,!1],t=n;break;case" ":for(yield[t,n,!1];e[++n]===" ";);t=n;break;case"\r":e[n+1]===`
|
|
26
26
|
`&&++i;case`
|
|
27
|
-
`:yield[t,n,!0],n+=i,t=n;break;default:++n;break}}yield[t,n,!0]}var _N={a:56,b:63,c:57,d:63,e:58,f:37,g:62,h:60,i:26,j:26,k:55,l:26,m:88,n:60,o:60,p:62,q:62,r:39,s:54,t:38,u:60,v:55,w:79,x:54,y:55,z:55,A:69,B:67,C:73,D:74,E:61,F:58,G:76,H:75,I:28,J:55,K:67,L:58,M:89,N:75,O:78,P:65,Q:78,R:67,S:65,T:65,U:75,V:69,W:98,X:69,Y:67,Z:67,0:64,1:48,2:62,3:64,4:66,5:63,6:65,7:58,8:65,9:65," ":29,"!":32,'"':49,"'":31,"(":39,")":39,",":31,"-":48,".":31,"/":32,":":31,";":31,"?":52,"\u2018":31,"\u2019":31,"\u201C":47,"\u201D":47,"\u2026":82};function N1(e,t=0,n=e.length){let r=0;for(let i=t;i<n;i=pf(e,i))r+=_N[e[i]]??(TN(e,i)?120:_N.e);return r}function O1(e,t=0,n=e.length){let r=0;for(let i=t;i<n;i=pf(e,i))r+=TN(e,i)?126:63;return r}function ZI({monospace:e,lineWidth:t,textOverflow:n}){if(n!=null||t==1/0)return o=>o.split(/\r\n?|\n/g);let r=e?O1:N1,i=t*100;return o=>QV(o,i,r)}function KI({monospace:e,lineWidth:t,textOverflow:n}){if(n==null||t==1/0)return o=>o;let r=e?O1:N1,i=t*100;switch(n){case"clip-start":return o=>SN(o,i,r,"");case"clip-end":return o=>vN(o,i,r,"");case"ellipsis-start":return o=>SN(o,i,r,ll);case"ellipsis-middle":return o=>tj(o,i,r,ll);case"ellipsis-end":return o=>vN(o,i,r,ll)}}var ll="\u2026";function fl(e,t,n,r){let i=[],o=0;for(let s=0,a=0,c=e.length;s<c;s=a){a=pf(e,s);let l=n(e,s,a);if(o+l>t){for(o+=r;o>t&&s>0;)a=s,s=i.pop(),o-=n(e,s,a);return[s,t-o]}o+=l,i.push(s)}return[-1,0]}function vN(e,t,n,r){e=e.trim();let i=n(r),[o]=fl(e,t,n,i);return o<0?e:e.slice(0,o).trimEnd()+r}function tj(e,t,n,r){e=e.trim();let i=n(e);if(i<=t)return e;let o=n(r)/2,[s,a]=fl(e,t/2,n,o),[c]=fl(e,i-t/2-a+o,n,-o);return c<0?r:e.slice(0,s).trimEnd()+r+e.slice(pf(e,c)).trimStart()}function SN(e,t,n,r){e=e.trim();let i=n(e);if(i<=t)return e;let o=n(r),[s]=fl(e,i-t+o,n,-o);return s<0?r:r+e.slice(pf(e,s)).trimStart()}var GI=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,IN=/\p{Extended_Pictographic}/uy;function pf(e,t){return t+=ej(e,t)?2:1,rj(e,t)&&(t=GI.lastIndex),nj(e,t)?pf(e,t+1):t}function AN(e,t){return e.charCodeAt(t)<128}function ej(e,t){let n=e.charCodeAt(t);if(n>=55296&&n<56320){let r=e.charCodeAt(t+1);return r>=56320&&r<57344}return!1}function nj(e,t){return e.charCodeAt(t)===8205}function rj(e,t){return AN(e,t)?!1:(GI.lastIndex=t,GI.test(e))}function TN(e,t){return AN(e,t)?!1:(IN.lastIndex=t,IN.test(e))}var EN={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},DN=3.5,ij=DN*5,NN={draw(e,t,n){let r=t*n/ij;e.moveTo(0,0),e.lineTo(0,-t),e.moveTo(-r,r-t),e.lineTo(0,-t),e.lineTo(r,r-t)}},ON={draw(e,t,n){e.moveTo(-n,0),e.lineTo(0,-t),e.lineTo(n,0)}},oj=new Map([["arrow",NN],["spike",ON]]);function sj(e){return e&&typeof e.draw=="function"}function aj(e){if(sj(e))return e;let t=oj.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid shape: ${e}`)}var hl=class extends xt{constructor(t,n={}){let{x:r,y:i,r:o=DN,length:s,rotate:a,shape:c=NN,anchor:l="middle",frameAnchor:u}=n,[f,h]=ee(s,12),[d,p]=ee(a,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},length:{value:f,scale:"length",optional:!0},rotate:{value:d,optional:!0}},n,EN),this.r=+o,this.length=h,this.rotate=p,this.shape=aj(c),this.anchor=He(l,"anchor",["start","middle","end"]),this.frameAnchor=wo(u)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,length:u,rotate:f}=r,{length:h,rotate:d,anchor:p,shape:m,r:g}=this,[y,b]=fn(this,i);return at("svg:g",o).call(Ot,this,i,o).call(_t,this,{x:c&&s,y:l&&a}).call(x=>x.selectAll().data(t).enter().append("path").call(Tt,this).attr("transform",Ua`translate(${c?w=>c[w]:y},${l?w=>l[w]:b})${f?w=>` rotate(${f[w]})`:d?` rotate(${d})`:""}${p==="start"?"":p==="end"?u?w=>` translate(0,${u[w]})`:` translate(0,${h})`:u?w=>` translate(0,${u[w]/2})`:` translate(0,${h/2})`}`).attr("d",u?w=>{let v=Gn();return m.draw(v,u[w],g),v}:(()=>{let w=Gn();return m.draw(w,h,g),w})()).call(Xt,this,r)).node()}};function QI(e,t={}){let{x:n,y:r,...i}=t;return t.frameAnchor===void 0&&([n,r]=Ce(n,r)),new hl(e,{...i,x:n,y:r})}function B1(e,t={}){let{x:n=W,...r}=t;return new hl(e,{...r,x:n})}function F1(e,t={}){let{y:n=W,...r}=t;return new hl(e,{...r,y:n})}function BN(e,t={}){let{shape:n=ON,stroke:r=EN.stroke,strokeWidth:i=1,fill:o=r,fillOpacity:s=.3,anchor:a="start",...c}=t;return QI(e,{...c,shape:n,stroke:r,strokeWidth:i,fill:o,fillOpacity:s,anchor:a})}function za(e,t){return arguments.length<2&&!tr(e)&&(t=e,e=null),t===void 0&&(t={}),[e,t]}function C1({anchor:e}={},t){return e===void 0?t[0]:He(e,"anchor",t)}function FN(e){return C1(e,["left","right"])}function CN(e){return C1(e,["right","left"])}function LN(e){return C1(e,["bottom","top"])}function kN(e){return C1(e,["top","bottom"])}function im(){let[e,t]=za(...arguments);return RN("y",FN(t),e,t)}function L1(){let[e,t]=za(...arguments);return RN("fy",CN(t),e,t)}function om(){let[e,t]=za(...arguments);return $N("x",LN(t),e,t)}function k1(){let[e,t]=za(...arguments);return $N("fx",kN(t),e,t)}function RN(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:s=i,strokeWidth:a=1,fill:c=r,fillOpacity:l=i,textAnchor:u,textStroke:f,textStrokeOpacity:h,textStrokeWidth:d,tickSize:p=e==="y"?6:0,tickPadding:m,tickRotate:g,x:y,margin:b,marginTop:x=b===void 0?20:b,marginRight:w=b===void 0?t==="right"?40:0:b,marginBottom:v=b===void 0?20:b,marginLeft:_=b===void 0?t==="left"?40:0:b,label:M,labelAnchor:E,labelArrow:N,labelOffset:I,...T}){return p=At(p),m=At(m),g=At(g),E!==void 0&&(E=He(E,"labelAnchor",["center","top","bottom"])),N=WN(N),Ze(p&&!Jt(o)?cj(e,t,n,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:m,tickRotate:g,x:y,...T}):null,Jt(c)?null:uj(e,t,n,{fill:c,fillOpacity:l,stroke:f,strokeOpacity:h,strokeWidth:d,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:g,x:y,marginTop:x,marginRight:w,marginBottom:v,marginLeft:_,...T}),!Jt(c)&&M!==null?So([],qN({fill:c,fillOpacity:l,...T},function(O,B,S,A,D){let C=A[e],{marginTop:k,marginRight:L,marginBottom:R,marginLeft:$}=e==="y"&&D.inset||D,P=E??(C.bandwidth?"center":"top"),G=I??(t==="right"?L:$)-3;return P==="center"?(this.textAnchor=void 0,this.lineAnchor=t==="right"?"bottom":"top",this.frameAnchor=t,this.rotate=-90):(this.textAnchor=t==="right"?"end":"start",this.lineAnchor=P,this.frameAnchor=`${P}-${t}`,this.rotate=0),this.dy=P==="top"?3-k:P==="bottom"?R-3:0,this.dx=t==="right"?G:-G,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[YN(e,C,{anchor:t,label:M,labelAnchor:P,labelArrow:N})]}}}})):null)}function $N(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:s=i,strokeWidth:a=1,fill:c=r,fillOpacity:l=i,textAnchor:u,textStroke:f,textStrokeOpacity:h,textStrokeWidth:d,tickSize:p=e==="x"?6:0,tickPadding:m,tickRotate:g,y,margin:b,marginTop:x=b===void 0?t==="top"?30:0:b,marginRight:w=b===void 0?20:b,marginBottom:v=b===void 0?t==="bottom"?30:0:b,marginLeft:_=b===void 0?20:b,label:M,labelAnchor:E,labelArrow:N,labelOffset:I,...T}){return p=At(p),m=At(m),g=At(g),E!==void 0&&(E=He(E,"labelAnchor",["center","left","right"])),N=WN(N),Ze(p&&!Jt(o)?lj(e,t,n,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:m,tickRotate:g,y,...T}):null,Jt(c)?null:fj(e,t,n,{fill:c,fillOpacity:l,stroke:f,strokeOpacity:h,strokeWidth:d,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:g,y,marginTop:x,marginRight:w,marginBottom:v,marginLeft:_,...T}),!Jt(c)&&M!==null?So([],qN({fill:c,fillOpacity:l,...T},function(O,B,S,A,D){let C=A[e],{marginTop:k,marginRight:L,marginBottom:R,marginLeft:$}=e==="x"&&D.inset||D,P=E??(C.bandwidth?"center":"right"),G=I??(t==="top"?k:R)-3;return P==="center"?(this.frameAnchor=t,this.textAnchor=void 0):(this.frameAnchor=`${t}-${P}`,this.textAnchor=P==="right"?"end":"start"),this.lineAnchor=t,this.dy=t==="top"?-G:G,this.dx=P==="right"?L-3:P==="left"?3-$:0,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[YN(e,C,{anchor:t,label:M,labelAnchor:P,labelArrow:N})]}}}})):null)}function cj(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:s=t+(e==="y"?"-empty":""),frameAnchor:a=t,tickSize:c,inset:l=0,insetLeft:u=l,insetRight:f=l,dx:h=0,y:d=e==="y"?void 0:null,...p}){return mf(F1,e,t,`${e}-axis tick`,n,{strokeWidth:r,strokeLinecap:i,strokeLinejoin:o,facetAnchor:s,frameAnchor:a,y:d,...p,dx:t==="left"?+h-Ee+ +u:+h+Ee-f,anchor:"start",length:c,shape:t==="left"?mj:yj})}function lj(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:s=t+(e==="x"?"-empty":""),frameAnchor:a=t,tickSize:c,inset:l=0,insetTop:u=l,insetBottom:f=l,dy:h=0,x:d=e==="x"?void 0:null,...p}){return mf(B1,e,t,`${e}-axis tick`,n,{strokeWidth:r,strokeLinejoin:o,strokeLinecap:i,facetAnchor:s,frameAnchor:a,x:d,...p,dy:t==="bottom"?+h-Ee-f:+h+Ee+ +u,anchor:"start",length:c,shape:t==="bottom"?dj:pj})}function uj(e,t,n,{facetAnchor:r=t+(e==="y"?"-empty":""),frameAnchor:i=t,tickSize:o,tickRotate:s=0,tickPadding:a=Math.max(3,9-o)+(Math.abs(s)>60?4*Math.cos(s*df):0),text:c,textAnchor:l=Math.abs(s)>60?"middle":t==="left"?"end":"start",lineAnchor:u=s>60?"top":s<-60?"bottom":"middle",fontVariant:f,inset:h=0,insetLeft:d=h,insetRight:p=h,dx:m=0,y:g=e==="y"?void 0:null,...y}){return mf(D1,e,t,`${e}-axis tick label`,n,{facetAnchor:r,frameAnchor:i,text:c,textAnchor:l,lineAnchor:u,fontVariant:f,rotate:s,y:g,...y,dx:t==="left"?+m-o-a+ +d:+m+ +o+ +a-p},function(b,x,w,v,_){f===void 0&&(this.fontVariant=jN(b)),c===void 0&&(_.text=VN(b,x,w,v,t))})}function fj(e,t,n,{facetAnchor:r=t+(e==="x"?"-empty":""),frameAnchor:i=t,tickSize:o,tickRotate:s=0,tickPadding:a=Math.max(3,9-o)+(Math.abs(s)>=10?4*Math.cos(s*df):0),text:c,textAnchor:l=Math.abs(s)>=10?s<0^t==="bottom"?"start":"end":"middle",lineAnchor:u=Math.abs(s)>=10?"middle":t==="bottom"?"top":"bottom",fontVariant:f,inset:h=0,insetTop:d=h,insetBottom:p=h,dy:m=0,x:g=e==="x"?void 0:null,...y}){return mf(E1,e,t,`${e}-axis tick label`,n,{facetAnchor:r,frameAnchor:i,text:c===void 0?null:c,textAnchor:l,lineAnchor:u,fontVariant:f,rotate:s,x:g,...y,dy:t==="bottom"?+m+ +o+ +a-p:+m-o-a+ +d},function(b,x,w,v,_){f===void 0&&(this.fontVariant=jN(b)),c===void 0&&(_.text=VN(b,x,w,v,t))})}function R1(){let[e,t]=za(...arguments);return PN("y",FN(t),e,t)}function $1(){let[e,t]=za(...arguments);return PN("fy",CN(t),e,t)}function P1(){let[e,t]=za(...arguments);return UN("x",LN(t),e,t)}function U1(){let[e,t]=za(...arguments);return UN("fx",kN(t),e,t)}function PN(e,t,n,{y:r=e==="y"?void 0:null,x:i=null,x1:o=t==="left"?i:null,x2:s=t==="right"?i:null,...a}){return mf(Lr,e,t,`${e}-grid`,n,{y:r,x1:o,x2:s,...zN(a)})}function UN(e,t,n,{x:r=e==="x"?void 0:null,y:i=null,y1:o=t==="top"?i:null,y2:s=t==="bottom"?i:null,...a}){return mf(Cr,e,t,`${e}-grid`,n,{x:r,y1:o,y2:s,...zN(a)})}function zN({color:e="currentColor",opacity:t=.1,stroke:n=e,strokeOpacity:r=t,strokeWidth:i=1,...o}){return{stroke:n,strokeOpacity:r,strokeWidth:i,...o}}function qN({fill:e,fillOpacity:t,fontFamily:n,fontSize:r,fontStyle:i,fontVariant:o,fontWeight:s,monospace:a,pointerEvents:c,shapeRendering:l,clip:u=!1},f){return[,e]=Ae(e),[,t]=ee(t),{facet:"super",x:null,y:null,fill:e,fillOpacity:t,fontFamily:n,fontSize:r,fontStyle:i,fontVariant:o,fontWeight:s,monospace:a,pointerEvents:c,shapeRendering:l,clip:u,initializer:f}}function mf(e,t,n,r,i,o,s){let a;function c(f,h,d,p,m,g){let y=f==null&&(t==="fx"||t==="fy"),{[t]:b}=p;if(!b)throw new Error(`missing scale: ${t}`);let x=b.domain(),{interval:w,ticks:v,tickFormat:_,tickSpacing:M=t==="x"?80:35}=o;if(typeof v=="string"&&GN(b)&&(w=v,v=void 0),v===void 0&&(v=xo(w,b.type)??hj(b,M)),f==null){if(tr(v))f=Pe(v);else if(Ba(v))f=JI(v,...ie(x));else if(b.interval){let N=b.interval;if(b.ticks){let[I,T]=ie(x),O=(T-I)/N[ju];N=KS(N,O/v)??N,f=JI(N,I,T)}else{f=x;let I=f.length;N=KS(N,I/v)??N,N!==b.interval&&(f=JI(N,...ie(f)))}if(N===b.interval){let I=Math.round(f.length/v);I>1&&(f=f.filter((T,O)=>O%I===0))}}else b.ticks?f=b.ticks(v):f=x;if(!b.ticks&&f.length&&f!==x){let N=new Vn(x);f=f.filter(I=>N.has(I)),f.length||Rn(`Warning: the ${t}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}t==="y"||t==="x"?h=[Jn(f)]:a[t]={scale:t,value:W}}s?.call(this,b,f,v,_,a);let E=Object.fromEntries(Object.entries(a).map(([N,I])=>[N,{...I,value:dt(f,I.value)}]));return y&&(h=g.filterFacets(f,E)),{data:f,facets:h,channels:E}}let l=xe(o).initializer,u=e(i,xe({...o,initializer:c},l));return i==null?(a=u.channels,u.channels={}):a={},u.ariaLabel=r,u.clip===void 0&&(u.clip=!1),u}function hj(e,t){let[n,r]=ie(e.range());return(r-n)/t}function VN(e,t,n,r,i){return{value:sm(e,t,n,r,i)}}function sm(e,t,n,r,i){return typeof r=="function"?r:r===void 0&&t&&Te(t)?SD(e.type,t,i)??Ni:e.tickFormat?e.tickFormat(typeof n=="number"?n:null,r):r===void 0?Ni:typeof r=="string"?(Te(e.domain())?po:Xr)(r):an(r)}function JI(e,t,n){return e.range(t,e.offset(e.floor(n)))}var dj={draw(e,t){e.moveTo(0,0),e.lineTo(0,t)}},pj={draw(e,t){e.moveTo(0,0),e.lineTo(0,-t)}},mj={draw(e,t){e.moveTo(0,0),e.lineTo(-t,0)}},yj={draw(e,t){e.moveTo(0,0),e.lineTo(t,0)}};function jN(e){return e.bandwidth&&!e.interval?void 0:"tabular-nums"}function YN(e,t,{anchor:n,label:r=t.label,labelAnchor:i,labelArrow:o}={}){if(!(r==null||r.inferred&&GN(t)&&/^(date|time|year)$/i.test(r))){if(r=String(r),o==="auto"&&(o=(!t.bandwidth||t.interval)&&!/[↑↓→←]/.test(r)),!o)return r;if(o===!0){let s=m1(t);s&&(o=/x$/.test(e)||i==="center"?/x$/.test(e)===s<0?"left":"right":s<0?"up":"down")}switch(o){case"left":return`\u2190 ${r}`;case"right":return`${r} \u2192`;case"up":return n==="right"?`${r} \u2191`:`\u2191 ${r}`;case"down":return n==="right"?`${r} \u2193`:`\u2193 ${r}`}return r}}function WN(e="auto"){return Jt(e)?!1:typeof e=="boolean"?e:He(e,"labelArrow",["auto","up","right","down","left"])}function GN(e){return Te(e.domain())}function XN(e,t){if(t==null)return t;let n=e(t);if(!n)throw new Error(`scale not found: ${t}`);return n}function HN(e,{opacity:t,...n}={}){if(!vo(e)&&!CI(e))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${e.type})`);return KN(e,n,(r,i,o,s)=>r.append("svg").attr("width",o).attr("height",s).attr("fill",i.scale).attr("fill-opacity",ee(t)[1]).append("rect").attr("width","100%").attr("height","100%"))}function ZN(e,{fill:t=e.hint?.fill!==void 0?e.hint.fill:"none",fillOpacity:n=1,stroke:r=e.hint?.stroke!==void 0?e.hint.stroke:Jt(t)?"currentColor":"none",strokeOpacity:i=1,strokeWidth:o=1.5,r:s=4.5,...a}={},c){let[l,u]=Ae(t),[f,h]=Ae(r),d=XN(c,l),p=XN(c,f),m=s*s*Math.PI;return n=ee(n)[1],i=ee(i)[1],o=ee(o)[1],KN(e,a,(g,y,b,x)=>g.append("svg").attr("viewBox","-8 -8 16 16").attr("width",b).attr("height",x).attr("fill",l==="color"?w=>d.scale(w):u).attr("fill-opacity",n).attr("stroke",f==="color"?w=>p.scale(w):h).attr("stroke-opacity",i).attr("stroke-width",o).append("path").attr("d",w=>{let v=Gn();return e.scale(w).draw(v,m),v}))}function KN(e,t={},n){let{columns:r,tickFormat:i,fontVariant:o=v1(e),swatchSize:s=15,swatchWidth:a=s,swatchHeight:c=s,marginLeft:l=0,className:u,style:f,width:h}=t,d=Ra(t);u=ef(u),i=sm(e.scale,e.domain,void 0,i);let p=at("div",d).attr("class",`${u}-swatches ${u}-swatches-${r!=null?"columns":"wrap"}`),m;return r!=null?(m=`:where(.${u}-swatches-columns .${u}-swatch) {
|
|
27
|
+
`:yield[t,n,!0],n+=i,t=n;break;default:++n;break}}yield[t,n,!0]}var AN={a:56,b:63,c:57,d:63,e:58,f:37,g:62,h:60,i:26,j:26,k:55,l:26,m:88,n:60,o:60,p:62,q:62,r:39,s:54,t:38,u:60,v:55,w:79,x:54,y:55,z:55,A:69,B:67,C:73,D:74,E:61,F:58,G:76,H:75,I:28,J:55,K:67,L:58,M:89,N:75,O:78,P:65,Q:78,R:67,S:65,T:65,U:75,V:69,W:98,X:69,Y:67,Z:67,0:64,1:48,2:62,3:64,4:66,5:63,6:65,7:58,8:65,9:65," ":29,"!":32,'"':49,"'":31,"(":39,")":39,",":31,"-":48,".":31,"/":32,":":31,";":31,"?":52,"\u2018":31,"\u2019":31,"\u201C":47,"\u201D":47,"\u2026":82};function B1(e,t=0,n=e.length){let r=0;for(let i=t;i<n;i=hf(e,i))r+=AN[e[i]]??(ON(e,i)?120:AN.e);return r}function O1(e,t=0,n=e.length){let r=0;for(let i=t;i<n;i=hf(e,i))r+=ON(e,i)?126:63;return r}function KM({monospace:e,lineWidth:t,textOverflow:n}){if(n!=null||t==1/0)return o=>o.split(/\r\n?|\n/g);let r=e?O1:B1,i=t*100;return o=>HV(o,i,r)}function QM({monospace:e,lineWidth:t,textOverflow:n}){if(n==null||t==1/0)return o=>o;let r=e?O1:B1,i=t*100;switch(n){case"clip-start":return o=>EN(o,i,r,"");case"clip-end":return o=>TN(o,i,r,"");case"ellipsis-start":return o=>EN(o,i,r,al);case"ellipsis-middle":return o=>KV(o,i,r,al);case"ellipsis-end":return o=>TN(o,i,r,al)}}var al="\u2026";function ll(e,t,n,r){let i=[],o=0;for(let s=0,a=0,c=e.length;s<c;s=a){a=hf(e,s);let l=n(e,s,a);if(o+l>t){for(o+=r;o>t&&s>0;)a=s,s=i.pop(),o-=n(e,s,a);return[s,t-o]}o+=l,i.push(s)}return[-1,0]}function TN(e,t,n,r){e=e.trim();let i=n(r),[o]=ll(e,t,n,i);return o<0?e:e.slice(0,o).trimEnd()+r}function KV(e,t,n,r){e=e.trim();let i=n(e);if(i<=t)return e;let o=n(r)/2,[s,a]=ll(e,t/2,n,o),[c]=ll(e,i-t/2-a+o,n,-o);return c<0?r:e.slice(0,s).trimEnd()+r+e.slice(hf(e,c)).trimStart()}function EN(e,t,n,r){e=e.trim();let i=n(e);if(i<=t)return e;let o=n(r),[s]=ll(e,i-t+o,n,-o);return s<0?r:r+e.slice(hf(e,s)).trimStart()}var XM=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,DN=/\p{Extended_Pictographic}/uy;function hf(e,t){return t+=QV(e,t)?2:1,tj(e,t)&&(t=XM.lastIndex),JV(e,t)?hf(e,t+1):t}function BN(e,t){return e.charCodeAt(t)<128}function QV(e,t){let n=e.charCodeAt(t);if(n>=55296&&n<56320){let r=e.charCodeAt(t+1);return r>=56320&&r<57344}return!1}function JV(e,t){return e.charCodeAt(t)===8205}function tj(e,t){return BN(e,t)?!1:(XM.lastIndex=t,XM.test(e))}function ON(e,t){return BN(e,t)?!1:(DN.lastIndex=t,DN.test(e))}var LN={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},FN=3.5,ej=FN*5,CN={draw(e,t,n){let r=t*n/ej;e.moveTo(0,0),e.lineTo(0,-t),e.moveTo(-r,r-t),e.lineTo(0,-t),e.lineTo(r,r-t)}},kN={draw(e,t,n){e.moveTo(-n,0),e.lineTo(0,-t),e.lineTo(n,0)}},nj=new Map([["arrow",CN],["spike",kN]]);function rj(e){return e&&typeof e.draw=="function"}function ij(e){if(rj(e))return e;let t=nj.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid shape: ${e}`)}var ul=class extends _t{constructor(t,n={}){let{x:r,y:i,r:o=FN,length:s,rotate:a,shape:c=CN,anchor:l="middle",frameAnchor:u}=n,[f,h]=re(s,12),[d,p]=re(a,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},length:{value:f,scale:"length",optional:!0},rotate:{value:d,optional:!0}},n,LN),this.r=+o,this.length=h,this.rotate=p,this.shape=ij(c),this.anchor=Ke(l,"anchor",["start","middle","end"]),this.frameAnchor=wo(u)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,length:u,rotate:f}=r,{length:h,rotate:d,anchor:p,shape:m,r:g}=this,[y,b]=pn(this,i);return lt("svg:g",o).call(Bt,this,i,o).call(It,this,{x:c&&s,y:l&&a}).call(x=>x.selectAll().data(t).enter().append("path").call(Nt,this).attr("transform",$a`translate(${c?w=>c[w]:y},${l?w=>l[w]:b})${f?w=>` rotate(${f[w]})`:d?` rotate(${d})`:""}${p==="start"?"":p==="end"?u?w=>` translate(0,${u[w]})`:` translate(0,${h})`:u?w=>` translate(0,${u[w]/2})`:` translate(0,${h/2})`}`).attr("d",u?w=>{let v=Zn();return m.draw(v,u[w],g),v}:(()=>{let w=Zn();return m.draw(w,h,g),w})()).call(Ht,this,r)).node()}};function JM(e,t={}){let{x:n,y:r,...i}=t;return t.frameAnchor===void 0&&([n,r]=Ce(n,r)),new ul(e,{...i,x:n,y:r})}function L1(e,t={}){let{x:n=W,...r}=t;return new ul(e,{...r,x:n})}function F1(e,t={}){let{y:n=W,...r}=t;return new ul(e,{...r,y:n})}function RN(e,t={}){let{shape:n=kN,stroke:r=LN.stroke,strokeWidth:i=1,fill:o=r,fillOpacity:s=.3,anchor:a="start",...c}=t;return JM(e,{...c,shape:n,stroke:r,strokeWidth:i,fill:o,fillOpacity:s,anchor:a})}function Ua(e,t){return arguments.length<2&&!rr(e)&&(t=e,e=null),t===void 0&&(t={}),[e,t]}function C1({anchor:e}={},t){return e===void 0?t[0]:Ke(e,"anchor",t)}function $N(e){return C1(e,["left","right"])}function UN(e){return C1(e,["right","left"])}function PN(e){return C1(e,["bottom","top"])}function zN(e){return C1(e,["top","bottom"])}function tm(){let[e,t]=Ua(...arguments);return qN("y",$N(t),e,t)}function k1(){let[e,t]=Ua(...arguments);return qN("fy",UN(t),e,t)}function em(){let[e,t]=Ua(...arguments);return VN("x",PN(t),e,t)}function R1(){let[e,t]=Ua(...arguments);return VN("fx",zN(t),e,t)}function qN(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:s=i,strokeWidth:a=1,fill:c=r,fillOpacity:l=i,textAnchor:u,textStroke:f,textStrokeOpacity:h,textStrokeWidth:d,tickSize:p=e==="y"?6:0,tickPadding:m,tickRotate:g,x:y,margin:b,marginTop:x=b===void 0?20:b,marginRight:w=b===void 0?t==="right"?40:0:b,marginBottom:v=b===void 0?20:b,marginLeft:_=b===void 0?t==="left"?40:0:b,label:M,labelAnchor:D,labelArrow:A,labelOffset:N,...T}){return p=Dt(p),m=Dt(m),g=Dt(g),D!==void 0&&(D=Ke(D,"labelAnchor",["center","top","bottom"])),A=KN(A),Qe(p&&!te(o)?oj(e,t,n,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:m,tickRotate:g,x:y,...T}):null,te(c)?null:aj(e,t,n,{fill:c,fillOpacity:l,stroke:f,strokeOpacity:h,strokeWidth:d,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:g,x:y,marginTop:x,marginRight:w,marginBottom:v,marginLeft:_,...T}),!te(c)&&M!==null?So([],GN({fill:c,fillOpacity:l,...T},function(B,L,S,I,E){let C=I[e],{marginTop:k,marginRight:F,marginBottom:R,marginLeft:$}=e==="y"&&E.inset||E,U=D??(C.bandwidth?"center":"top"),G=N??(t==="right"?F:$)-3;return U==="center"?(this.textAnchor=void 0,this.lineAnchor=t==="right"?"bottom":"top",this.frameAnchor=t,this.rotate=-90):(this.textAnchor=t==="right"?"end":"start",this.lineAnchor=U,this.frameAnchor=`${U}-${t}`,this.rotate=0),this.dy=U==="top"?3-k:U==="bottom"?R-3:0,this.dx=t==="right"?G:-G,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[ZN(e,C,{anchor:t,label:M,labelAnchor:U,labelArrow:A})]}}}})):null)}function VN(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:s=i,strokeWidth:a=1,fill:c=r,fillOpacity:l=i,textAnchor:u,textStroke:f,textStrokeOpacity:h,textStrokeWidth:d,tickSize:p=e==="x"?6:0,tickPadding:m,tickRotate:g,y,margin:b,marginTop:x=b===void 0?t==="top"?30:0:b,marginRight:w=b===void 0?20:b,marginBottom:v=b===void 0?t==="bottom"?30:0:b,marginLeft:_=b===void 0?20:b,label:M,labelAnchor:D,labelArrow:A,labelOffset:N,...T}){return p=Dt(p),m=Dt(m),g=Dt(g),D!==void 0&&(D=Ke(D,"labelAnchor",["center","left","right"])),A=KN(A),Qe(p&&!te(o)?sj(e,t,n,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:m,tickRotate:g,y,...T}):null,te(c)?null:cj(e,t,n,{fill:c,fillOpacity:l,stroke:f,strokeOpacity:h,strokeWidth:d,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:g,y,marginTop:x,marginRight:w,marginBottom:v,marginLeft:_,...T}),!te(c)&&M!==null?So([],GN({fill:c,fillOpacity:l,...T},function(B,L,S,I,E){let C=I[e],{marginTop:k,marginRight:F,marginBottom:R,marginLeft:$}=e==="x"&&E.inset||E,U=D??(C.bandwidth?"center":"right"),G=N??(t==="top"?k:R)-3;return U==="center"?(this.frameAnchor=t,this.textAnchor=void 0):(this.frameAnchor=`${t}-${U}`,this.textAnchor=U==="right"?"end":"start"),this.lineAnchor=t,this.dy=t==="top"?-G:G,this.dx=U==="right"?F-3:U==="left"?3-$:0,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[ZN(e,C,{anchor:t,label:M,labelAnchor:U,labelArrow:A})]}}}})):null)}function oj(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:s=t+(e==="y"?"-empty":""),frameAnchor:a=t,tickSize:c,inset:l=0,insetLeft:u=l,insetRight:f=l,dx:h=0,y:d=e==="y"?void 0:null,...p}){return df(F1,e,t,`${e}-axis tick`,n,{strokeWidth:r,strokeLinecap:i,strokeLinejoin:o,facetAnchor:s,frameAnchor:a,y:d,...p,dx:t==="left"?+h-Ne+ +u:+h+Ne-f,anchor:"start",length:c,shape:t==="left"?hj:dj})}function sj(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:s=t+(e==="x"?"-empty":""),frameAnchor:a=t,tickSize:c,inset:l=0,insetTop:u=l,insetBottom:f=l,dy:h=0,x:d=e==="x"?void 0:null,...p}){return df(L1,e,t,`${e}-axis tick`,n,{strokeWidth:r,strokeLinejoin:o,strokeLinecap:i,facetAnchor:s,frameAnchor:a,x:d,...p,dy:t==="bottom"?+h-Ne-f:+h+Ne+ +u,anchor:"start",length:c,shape:t==="bottom"?uj:fj})}function aj(e,t,n,{facetAnchor:r=t+(e==="y"?"-empty":""),frameAnchor:i=t,tickSize:o,tickRotate:s=0,tickPadding:a=Math.max(3,9-o)+(Math.abs(s)>60?4*Math.cos(s*ff):0),text:c,textAnchor:l=Math.abs(s)>60?"middle":t==="left"?"end":"start",lineAnchor:u=s>60?"top":s<-60?"bottom":"middle",fontVariant:f,inset:h=0,insetLeft:d=h,insetRight:p=h,dx:m=0,y:g=e==="y"?void 0:null,...y}){return df(N1,e,t,`${e}-axis tick label`,n,{facetAnchor:r,frameAnchor:i,text:c,textAnchor:l,lineAnchor:u,fontVariant:f,rotate:s,y:g,...y,dx:t==="left"?+m-o-a+ +d:+m+ +o+ +a-p},function(b,x,w,v,_){f===void 0&&(this.fontVariant=HN(b)),c===void 0&&(_.text=XN(b,x,w,v,t))})}function cj(e,t,n,{facetAnchor:r=t+(e==="x"?"-empty":""),frameAnchor:i=t,tickSize:o,tickRotate:s=0,tickPadding:a=Math.max(3,9-o)+(Math.abs(s)>=10?4*Math.cos(s*ff):0),text:c,textAnchor:l=Math.abs(s)>=10?s<0^t==="bottom"?"start":"end":"middle",lineAnchor:u=Math.abs(s)>=10?"middle":t==="bottom"?"top":"bottom",fontVariant:f,inset:h=0,insetTop:d=h,insetBottom:p=h,dy:m=0,x:g=e==="x"?void 0:null,...y}){return df(D1,e,t,`${e}-axis tick label`,n,{facetAnchor:r,frameAnchor:i,text:c===void 0?null:c,textAnchor:l,lineAnchor:u,fontVariant:f,rotate:s,x:g,...y,dy:t==="bottom"?+m+ +o+ +a-p:+m-o-a+ +d},function(b,x,w,v,_){f===void 0&&(this.fontVariant=HN(b)),c===void 0&&(_.text=XN(b,x,w,v,t))})}function $1(){let[e,t]=Ua(...arguments);return jN("y",$N(t),e,t)}function U1(){let[e,t]=Ua(...arguments);return jN("fy",UN(t),e,t)}function P1(){let[e,t]=Ua(...arguments);return YN("x",PN(t),e,t)}function z1(){let[e,t]=Ua(...arguments);return YN("fx",zN(t),e,t)}function jN(e,t,n,{y:r=e==="y"?void 0:null,x:i=null,x1:o=t==="left"?i:null,x2:s=t==="right"?i:null,...a}){return df(kr,e,t,`${e}-grid`,n,{y:r,x1:o,x2:s,...WN(a)})}function YN(e,t,n,{x:r=e==="x"?void 0:null,y:i=null,y1:o=t==="top"?i:null,y2:s=t==="bottom"?i:null,...a}){return df(Cr,e,t,`${e}-grid`,n,{x:r,y1:o,y2:s,...WN(a)})}function WN({color:e="currentColor",opacity:t=.1,stroke:n=e,strokeOpacity:r=t,strokeWidth:i=1,...o}){return{stroke:n,strokeOpacity:r,strokeWidth:i,...o}}function GN({fill:e,fillOpacity:t,fontFamily:n,fontSize:r,fontStyle:i,fontVariant:o,fontWeight:s,monospace:a,pointerEvents:c,shapeRendering:l,clip:u=!1},f){return[,e]=Ee(e),[,t]=re(t),{facet:"super",x:null,y:null,fill:e,fillOpacity:t,fontFamily:n,fontSize:r,fontStyle:i,fontVariant:o,fontWeight:s,monospace:a,pointerEvents:c,shapeRendering:l,clip:u,initializer:f}}function df(e,t,n,r,i,o,s){let a;function c(f,h,d,p,m,g){let y=f==null&&(t==="fx"||t==="fy"),{[t]:b}=p;if(!b)throw new Error(`missing scale: ${t}`);let x=b.domain(),{interval:w,ticks:v,tickFormat:_,tickSpacing:M=t==="x"?80:35}=o;if(typeof v=="string"&&QN(b)&&(w=v,v=void 0),v===void 0&&(v=xo(w,b.type)??lj(b,M)),f==null){if(rr(v))f=Pe(v);else if(Na(v))f=tI(v,...se(x));else if(b.interval){let A=b.interval;if(b.ticks){let[N,T]=se(x),B=(T-N)/A[qu];A=QS(A,B/v)??A,f=tI(A,N,T)}else{f=x;let N=f.length;A=QS(A,N/v)??A,A!==b.interval&&(f=tI(A,...se(f)))}if(A===b.interval){let N=Math.round(f.length/v);N>1&&(f=f.filter((T,B)=>B%N===0))}}else b.ticks?f=b.ticks(v):f=x;if(!b.ticks&&f.length&&f!==x){let A=new Wn(x);f=f.filter(N=>A.has(N)),f.length||Pn(`Warning: the ${t}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}t==="y"||t==="x"?h=[nr(f)]:a[t]={scale:t,value:W}}s?.call(this,b,f,v,_,a);let D=Object.fromEntries(Object.entries(a).map(([A,N])=>[A,{...N,value:bt(f,N.value)}]));return y&&(h=g.filterFacets(f,D)),{data:f,facets:h,channels:D}}let l=_e(o).initializer,u=e(i,_e({...o,initializer:c},l));return i==null?(a=u.channels,u.channels={}):a={},u.ariaLabel=r,u.clip===void 0&&(u.clip=!1),u}function lj(e,t){let[n,r]=se(e.range());return(r-n)/t}function XN(e,t,n,r,i){return{value:nm(e,t,n,r,i)}}function nm(e,t,n,r,i){return typeof r=="function"?r:r===void 0&&t&&De(t)?E5(e.type,t,i)??Ni:e.tickFormat?e.tickFormat(typeof n=="number"?n:null,r):r===void 0?Ni:typeof r=="string"?(De(e.domain())?po:Xr)(r):un(r)}function tI(e,t,n){return e.range(t,e.offset(e.floor(n)))}var uj={draw(e,t){e.moveTo(0,0),e.lineTo(0,t)}},fj={draw(e,t){e.moveTo(0,0),e.lineTo(0,-t)}},hj={draw(e,t){e.moveTo(0,0),e.lineTo(-t,0)}},dj={draw(e,t){e.moveTo(0,0),e.lineTo(t,0)}};function HN(e){return e.bandwidth&&!e.interval?void 0:"tabular-nums"}function ZN(e,t,{anchor:n,label:r=t.label,labelAnchor:i,labelArrow:o}={}){if(!(r==null||r.inferred&&QN(t)&&/^(date|time|year)$/i.test(r))){if(r=String(r),o==="auto"&&(o=(!t.bandwidth||t.interval)&&!/[↑↓→←]/.test(r)),!o)return r;if(o===!0){let s=y1(t);s&&(o=/x$/.test(e)||i==="center"?/x$/.test(e)===s<0?"left":"right":s<0?"up":"down")}switch(o){case"left":return`\u2190 ${r}`;case"right":return`${r} \u2192`;case"up":return n==="right"?`${r} \u2191`:`\u2191 ${r}`;case"down":return n==="right"?`${r} \u2193`:`\u2193 ${r}`}return r}}function KN(e="auto"){return te(e)?!1:typeof e=="boolean"?e:Ke(e,"labelArrow",["auto","up","right","down","left"])}function QN(e){return De(e.domain())}function JN(e,t){if(t==null)return t;let n=e(t);if(!n)throw new Error(`scale not found: ${t}`);return n}function tB(e,{opacity:t,...n}={}){if(!vo(e)&&!CM(e))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${e.type})`);return nB(e,n,(r,i,o,s)=>r.append("svg").attr("width",o).attr("height",s).attr("fill",i.scale).attr("fill-opacity",re(t)[1]).append("rect").attr("width","100%").attr("height","100%"))}function eB(e,{fill:t=e.hint?.fill!==void 0?e.hint.fill:"none",fillOpacity:n=1,stroke:r=e.hint?.stroke!==void 0?e.hint.stroke:te(t)?"currentColor":"none",strokeOpacity:i=1,strokeWidth:o=1.5,r:s=4.5,...a}={},c){let[l,u]=Ee(t),[f,h]=Ee(r),d=JN(c,l),p=JN(c,f),m=s*s*Math.PI;return n=re(n)[1],i=re(i)[1],o=re(o)[1],nB(e,a,(g,y,b,x)=>g.append("svg").attr("viewBox","-8 -8 16 16").attr("width",b).attr("height",x).attr("fill",l==="color"?w=>d.scale(w):u).attr("fill-opacity",n).attr("stroke",f==="color"?w=>p.scale(w):h).attr("stroke-opacity",i).attr("stroke-width",o).append("path").attr("d",w=>{let v=Zn();return e.scale(w).draw(v,m),v}))}function nB(e,t={},n){let{columns:r,tickFormat:i,fontVariant:o=S1(e),swatchSize:s=15,swatchWidth:a=s,swatchHeight:c=s,marginLeft:l=0,className:u,style:f,width:h}=t,d=Ca(t);u=Ju(u),i=nm(e.scale,e.domain,void 0,i);let p=lt("div",d).attr("class",`${u}-swatches ${u}-swatches-${r!=null?"columns":"wrap"}`),m;return r!=null?(m=`:where(.${u}-swatches-columns .${u}-swatch) {
|
|
28
28
|
display: flex;
|
|
29
29
|
align-items: center;
|
|
30
30
|
break-inside: avoid;
|
|
@@ -56,7 +56,7 @@ ${n}`}function Dq(e){return e==="time"?Yx:e==="utc"?zp:Tq}function SD(e,t,n){let
|
|
|
56
56
|
margin-right: 0.5em;
|
|
57
57
|
overflow: visible;
|
|
58
58
|
}
|
|
59
|
-
${m}`)).style("margin-left",l?`${+l}px`:null).style("width",h===void 0?null:`${+h}px`).style("font-variant",se(o,"normal")).call(nf,f).node()}var z1=new Map([["symbol",ZN],["color",tO],["opacity",gj]]);function QN(e={}){for(let[t,n]of z1){let r=e[t];if(go(r)){let i=Ra(e),o;if(t==="symbol"){let{fill:s,stroke:a=s===void 0&&go(e.color)?"color":void 0}=e;o={fill:s,stroke:a}}return n(g1(t,r,o),tM(i,r,e),s=>go(e[s])?g1(s,e[s]):null)}}throw new Error("unknown legend type; no scale found")}function JN(e,t,n={}){return(r,i)=>{if(!z1.has(r))throw new Error(`unknown legend type: ${r}`);if(r in e)return z1.get(r)(e[r],tM(t,n[r],i),o=>e[o])}}function tM({className:e,...t},{label:n,ticks:r,tickFormat:i}={},o){return RD(o,{className:e,...t},{label:n,ticks:r,tickFormat:i})}function tO(e,{legend:t=!0,...n}){if(t===!0&&(t=e.type==="ordinal"?"swatches":"ramp"),e.domain!==void 0)switch(`${t}`.toLowerCase()){case"swatches":return HN(e,n);case"ramp":return fN(e,n);default:throw new Error(`unknown legend type: ${t}`)}}function gj({type:e,interpolate:t,...n},{legend:r=!0,color:i=Je(0,0,0),...o}){if(!t)throw new Error(`${e} opacity scales are not supported`);if(r===!0&&(r="ramp"),`${r}`.toLowerCase()!=="ramp")throw new Error(`${r} opacity legends are not supported`);return tO({type:e,...n,interpolate:bj(i)},{legend:r,...o})}function bj(e){let{r:t,g:n,b:r}=Je(e)||Je(0,0,0);return i=>`rgba(${t},${n},${r},${i})`}function eO(e,t,n){let r=[];for(let[i,o]of z1){let s=n[i];if(s?.legend&&i in e){let a=o(e[i],tM(t,e[i],s),c=>e[c]);a!=null&&r.push(a)}}return r}var xj={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},wj={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1},am=class extends xt{constructor(t={}){let{anchor:n=null,inset:r=0,insetTop:i=r,insetRight:o=r,insetBottom:s=r,insetLeft:a=r,rx:c,ry:l}=t;super(Da,void 0,t,n==null?xj:wj),this.anchor=nI(n,"anchor",["top","right","bottom","left"]),this.insetTop=At(i),this.insetRight=At(o),this.insetBottom=At(s),this.insetLeft=At(a),this.rx=At(c),this.ry=At(l)}render(t,n,r,i,o){let{marginTop:s,marginRight:a,marginBottom:c,marginLeft:l,width:u,height:f}=i,{anchor:h,insetTop:d,insetRight:p,insetBottom:m,insetLeft:g,rx:y,ry:b}=this,x=l+g,w=u-a-p,v=s+d,_=f-c-m;return at(h?"svg:line":"svg:rect",o).datum(0).call(Ot,this,i,o).call(Tt,this).call(Xt,this,r).call(_t,this,{}).call(h==="left"?M=>M.attr("x1",x).attr("x2",x).attr("y1",v).attr("y2",_):h==="right"?M=>M.attr("x1",w).attr("x2",w).attr("y1",v).attr("y2",_):h==="top"?M=>M.attr("x1",x).attr("x2",w).attr("y1",v).attr("y2",v):h==="bottom"?M=>M.attr("x1",x).attr("x2",w).attr("y1",_).attr("y2",_):M=>M.attr("x",x).attr("y",v).attr("width",w-x).attr("height",_-v).attr("rx",y).attr("ry",b)).node()}};function yf(e){return new am(e)}var eM={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor"},_j=new Set(["geometry","href","src","ariaLabel","scales"]),cm=class extends xt{constructor(t,n={}){n.tip&&(n={...n,tip:!1}),n.title===void 0&&tr(t)&&Hx(t)&&(n={...n,title:W});let{x:r,y:i,x1:o,x2:s,y1:a,y2:c,anchor:l,preferredAnchor:u="bottom",monospace:f,fontFamily:h=f?"ui-monospace, monospace":void 0,fontSize:d,fontStyle:p,fontVariant:m,fontWeight:g,lineHeight:y=1,lineWidth:b=20,frameAnchor:x,format:w,textAnchor:v="start",textOverflow:_,textPadding:M=8,title:E,pointerSize:N=12,pathFilter:I="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=n;super(t,{x:{value:o!=null&&s!=null?null:r,scale:"x",optional:!0},y:{value:a!=null&&c!=null?null:i,scale:"y",optional:!0},x1:{value:o,scale:"x",optional:s==null},y1:{value:a,scale:"y",optional:c==null},x2:{value:s,scale:"x",optional:o==null},y2:{value:c,scale:"y",optional:a==null},title:{value:E,optional:!0}},n,eM),this.anchor=Kx(l,"anchor"),this.preferredAnchor=Kx(u,"preferredAnchor"),this.frameAnchor=wo(x),this.textAnchor=se(v,"middle"),this.textPadding=+M,this.pointerSize=+N,this.pathFilter=$e(I),this.lineHeight=+y,this.lineWidth=+b,this.textOverflow=XI(_),this.monospace=!!f,this.fontFamily=$e(h),this.fontSize=At(d),this.fontStyle=$e(p),this.fontVariant=$e(m),this.fontWeight=$e(g);for(let T in eM)T in this.channels&&(this[T]=eM[T]);this.splitLines=ZI(this),this.clipLine=KI(this),this.format={...w}}render(t,n,r,i,o){let s=this,{x:a,y:c,fx:l,fy:u}=n,{ownerSVGElement:f,document:h}=o,{anchor:d,monospace:p,lineHeight:m,lineWidth:g}=this,{textPadding:y,pointerSize:b,pathFilter:x}=this,{marginTop:w,marginLeft:v}=i,{x1:_,y1:M,x2:E,y2:N,x:I=_??E,y:T=M??N}=r,O=l?l(t.fx)-v:0,B=u?u(t.fy)-w:0,[S,A]=fn(this,i),D=zI(r,S),C=qI(r,A),k=p?O1:N1,L=k(ll),R,$;"title"in r?(R=r.channels,$=Aj):(R=Mj.call(this,r,n),$=Tj);let P=at("svg:g",o).call(Ot,this,i,o).call(HI,this).call(_t,this,{x:I&&a,y:T&&c}).call(et=>et.selectAll().data(t).enter().append("g").attr("transform",ot=>`translate(${Math.round(D(ot))},${Math.round(C(ot))})`).call(Tt,this).call(ot=>ot.append("path").attr("filter",x)).call(ot=>ot.append("text").each(function(j){let nt=Pt(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");let z=$.call(s,j,t,R,n,r);if(typeof z=="string")for(let X of s.splitLines(z))G(nt,{value:s.clipLine(X)});else{let X=new Set;for(let rt of z){let{label:U=""}=rt;U&&X.has(U)||(X.add(U),G(nt,rt))}}})));function G(et,{label:ot,value:j,color:nt,opacity:z}){ot??="",j??="";let X=nt!=null||z!=null,rt,U=g*100,[Bt]=fl(ot,U,k,L);if(Bt>=0)ot=ot.slice(0,Bt).trimEnd()+ll,rt=j.trim(),j="";else{(ot||!j&&!X)&&(j=" "+j);let[jt]=fl(j,U-k(ot),k,L);jt>=0&&(rt=j.trim(),j=j.slice(0,jt).trimEnd()+ll)}let ft=et.append("tspan").attr("x",0).attr("dy",`${m}em`).text("\u200B");ot&&ft.append("tspan").attr("font-weight","bold").text(ot),j&&ft.append(()=>h.createTextNode(j)),X&&ft.append("tspan").text(" \u25A0").attr("fill",nt).attr("fill-opacity",z).style("user-select","none"),rt&&ft.append("title").text(rt)}function J(){let{width:et,height:ot}=i.facet??i;P.selectChildren().each(function(j){let{x:nt,width:z,height:X}=this.getBBox();z=Math.round(z),X=Math.round(X);let rt=d;if(rt===void 0){let ft=D(j)+O,jt=C(j)+B,Yt=ft+z+b+y*2<et,tt=ft-z-b-y*2>0,ne=jt+X+b+y*2<ot,pr=jt-X-b-y*2>0;rt=Yt&&tt?ne&&pr?s.preferredAnchor:pr?"bottom":"top":ne&&pr?Yt?"left":"right":(Yt||tt)&&(ne||pr)?`${pr?"bottom":"top"}-${Yt?"left":"right"}`:s.preferredAnchor}let U=this.firstChild,Bt=this.lastChild;if(U.setAttribute("d",Ij(rt,b,y,z,X)),nt)for(let ft of Bt.childNodes)ft.setAttribute("x",-nt);Bt.setAttribute("y",`${+vj(rt,Bt.childNodes.length,m).toFixed(6)}em`),Bt.setAttribute("transform",`translate(${Sj(rt,b,y,z,X)})`)}),P.attr("visibility",null)}return t.length&&(P.attr("visibility","hidden"),f.isConnected?Promise.resolve().then(J):typeof requestAnimationFrame<"u"&&requestAnimationFrame(J)),P.node()}};function V1(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Ce(t,n)),new cm(e,{...r,x:t,y:n})}function vj(e,t,n){return/^top(?:-|$)/.test(e)?.94-n:-.29-t*n}function Sj(e,t,n,r,i){switch(e){case"middle":return[-r/2,i/2];case"top-left":return[n,t+n];case"top":return[-r/2,t/2+n];case"top-right":return[-r-n,t+n];case"right":return[-t/2-r-n,i/2];case"bottom-left":return[n,-t-n];case"bottom":return[-r/2,-t/2-n];case"bottom-right":return[-r-n,-t-n];case"left":return[n+t/2,i/2]}}function Ij(e,t,n,r,i){let o=r+n*2,s=i+n*2;switch(e){case"middle":return`M${-o/2},${-s/2}h${o}v${s}h${-o}z`;case"top-left":return`M0,0l${t},${t}h${o-t}v${s}h${-o}z`;case"top":return`M0,0l${t/2},${t/2}h${(o-t)/2}v${s}h${-o}v${-s}h${(o-t)/2}z`;case"top-right":return`M0,0l${-t},${t}h${t-o}v${s}h${o}z`;case"right":return`M0,0l${-t/2},${-t/2}v${t/2-s/2}h${-o}v${s}h${o}v${t/2-s/2}z`;case"bottom-left":return`M0,0l${t},${-t}h${o-t}v${-s}h${-o}z`;case"bottom":return`M0,0l${t/2},${-t/2}h${(o-t)/2}v${-s}h${-o}v${s}h${(o-t)/2}z`;case"bottom-right":return`M0,0l${-t},${-t}h${t-o}v${-s}h${o}z`;case"left":return`M0,0l${t/2},${-t/2}v${t/2-s/2}h${o}v${s}h${-o}v${t/2-s/2}z`}}function Mj({channels:e},t){let n={},r=this.format;r=nO(r,e,"x"),r=nO(r,e,"y"),this.format=r;for(let i in r){let o=r[i];if(!(o===null||o===!1))if(i==="fx"||i==="fy")n[i]=!0;else{let s=Zp(e,i);s&&(n[i]=s)}}for(let i in e){if(i in n||i in r||_j.has(i))continue;let o=Zp(e,i);o&&(n[i]=o)}this.facet&&(t.fx&&!("fx"in r)&&(n.fx=!0),t.fy&&!("fy"in r)&&(n.fy=!0));for(let i in n){let o=this.format[i];if(typeof o=="string"){let s=n[i]?.value??t[i]?.domain()??[];this.format[i]=(Te(s)?po:Xr)(o)}else if(o===void 0||o===!0){let s=t[i];this.format[i]=s?.bandwidth?sm(s,s.domain()):Ni}}return n}function nO(e,t,n){if(!(n in e))return e;let r=`${n}1`,i=`${n}2`;if((r in e||!(r in t))&&(i in e||!(i in t)))return e;let o=Object.entries(e),s=e[n];return o.splice(o.findIndex(([a])=>a===n)+1,0,[r,s],[i,s]),Object.fromEntries(o)}function Aj(e,t,{title:n}){return Ni(n.value[e],e)}function*Tj(e,t,n,r,i){for(let o in n){if(o==="fx"||o==="fy"){yield{label:q1(r,n,o),value:this.format[o](t[o],e)};continue}if(o==="x1"&&"x2"in n||o==="y1"&&"y2"in n)continue;let s=n[o];if(o==="x2"&&"x1"in n)yield{label:iO(r,n,"x"),value:rO(this.format.x2,n.x1,s,e)};else if(o==="y2"&&"y1"in n)yield{label:iO(r,n,"y"),value:rO(this.format.y2,n.y1,s,e)};else{let a=s.value[e],c=s.scale;if(!Re(a)&&c==null)continue;yield{label:q1(r,n,o),value:this.format[o](a,e),color:c==="color"?i[o][e]:null,opacity:c==="opacity"?i[o][e]:null}}}}function rO(e,t,n,r){return n.hint?.length?`${e(n.value[r]-t.value[r],r)}`:`${e(t.value[r],r)}\u2013${e(n.value[r],r)}`}function iO(e,t,n){let r=q1(e,t,`${n}1`,n),i=q1(e,t,`${n}2`,n);return r===i?r:`${r}\u2013${i}`}function q1(e,t,n,r=n){let i=t[n],o=e[i?.scale??n];return String(o?.label??i?.label??r)}function um(e={}){let{facet:t,style:n,title:r,subtitle:i,caption:o,ariaLabel:s,ariaDescription:a}=e,c=ef(e.className),l=e.marks===void 0?[]:sO(e.marks);l.push(...Cj(l));let u=Bj(t,e),f=new Map;for(let L of l){let R=aO(L,u,e);R&&f.set(L,R)}let h=new Map;u&&lm(h,[u],e),lm(h,f,e);let d=sO(Lj(l,h,e));for(let L of d){let R=aO(L,u,e);R&&f.set(L,R)}l.unshift(...d);let p=oN(h,e);if(p!==void 0){let L=u?_1(p,u):void 0;for(let $ of l){if($.facet===null||$.facet==="super")continue;let P=f.get($);P!==void 0&&(P.facetsIndex=$.fx!=null||$.fy!=null?_1(p,P):L)}let R=new Set;for(let{facetsIndex:$}of f.values())$?.forEach((P,G)=>{P?.length>0&&R.add(G)});p.forEach(0<R.size&&R.size<p.length?($,P)=>$.empty=!R.has(P):$=>$.empty=!1);for(let $ of l)if($.facet==="exclude"){let P=f.get($);P!==void 0&&(P.facetsIndex=cN(P.facetsIndex))}}for(let L of ce.keys())go(e[L])&&L!=="fx"&&L!=="fy"&&h.set(L,[]);let m=new Map;for(let L of l){if(m.has(L))throw new Error("duplicate mark; each mark must be unique");let{facetsIndex:R,channels:$}=f.get(L)??{},{data:P,facets:G,channels:J}=L.initialize(R,$,e);iM(J,e),m.set(L,{data:P,facets:G,channels:J})}let g=em(lm(h,m,e),e),y=rN(g,l,e);Z5(g,y);let b=BI(g),{fx:x,fy:w}=b,v=x||w?FI(g,y):y,_=x||w?qj(b,y):y,M=Ra(e),E=M.document,N=cs("svg").call(E.documentElement),I=N;M.ownerSVGElement=N,M.className=c,M.projection=l5(e,v),M.filterFacets=(L,R)=>_1(p,{channels:R,groups:x1(L,R)}),M.getMarkState=L=>{let R=m.get(L),$=f.get(L);return{...R,channels:{...R.channels,...$?.channels}}},M.dispatchValue=L=>{I.value!==L&&(I.value=L,I.dispatchEvent(new Event("input",{bubbles:!0})))};let T=new Set;for(let[L,R]of m)if(L.initializer!=null){let $=L.facet==="super"?_:v,P=L.initializer(R.data,R.facets,R.channels,b,$,M);if(P.data!==void 0&&(R.data=P.data),P.facets!==void 0&&(R.facets=P.facets),P.channels!==void 0){let{fx:G,fy:J,...et}=P.channels;Oj(et),Object.assign(R.channels,et);for(let ot of Object.values(et)){let{scale:j}=ot;j!=null&&!PD(ce.get(j))&&(uO(ot,e),T.add(j))}(G!=null||J!=null)&&f.set(L,!0)}}if(T.size){let L=new Map;lm(L,m,e,G=>T.has(G)),lm(h,m,e,G=>T.has(G));let R=zj(em(L,e),g),{scales:$,...P}=BI(R);Object.assign(g,R),Object.assign(b,P),Object.assign(b.scales,$)}let O,B;p!==void 0&&(O={x:x?.domain(),y:w?.domain()},p=sN(p,O),B=aN(x,w,y));for(let[L,R]of m)R.values=L.scale(R.channels,b,M);let{width:S,height:A}=y;Pt(N).attr("class",c).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",S).attr("height",A).attr("viewBox",`0 0 ${S} ${A}`).attr("aria-label",s).attr("aria-description",a).call(L=>L.append("style").text(`:where(.${c}) {
|
|
59
|
+
${m}`)).style("margin-left",l?`${+l}px`:null).style("width",h===void 0?null:`${+h}px`).style("font-variant",ce(o,"normal")).call(tf,f).node()}var q1=new Map([["symbol",eB],["color",oB],["opacity",pj]]);function rB(e={}){for(let[t,n]of q1){let r=e[t];if(go(r)){let i=Ca(e),o;if(t==="symbol"){let{fill:s,stroke:a=s===void 0&&go(e.color)?"color":void 0}=e;o={fill:s,stroke:a}}return n(b1(t,r,o),eI(i,r,e),s=>go(e[s])?b1(s,e[s]):null)}}throw new Error("unknown legend type; no scale found")}function iB(e,t,n={}){return(r,i)=>{if(!q1.has(r))throw new Error(`unknown legend type: ${r}`);if(r in e)return q1.get(r)(e[r],eI(t,n[r],i),o=>e[o])}}function eI({className:e,...t},{label:n,ticks:r,tickFormat:i}={},o){return q5(o,{className:e,...t},{label:n,ticks:r,tickFormat:i})}function oB(e,{legend:t=!0,...n}){if(t===!0&&(t=e.type==="ordinal"?"swatches":"ramp"),e.domain!==void 0)switch(`${t}`.toLowerCase()){case"swatches":return tB(e,n);case"ramp":return yN(e,n);default:throw new Error(`unknown legend type: ${t}`)}}function pj({type:e,interpolate:t,...n},{legend:r=!0,color:i=en(0,0,0),...o}){if(!t)throw new Error(`${e} opacity scales are not supported`);if(r===!0&&(r="ramp"),`${r}`.toLowerCase()!=="ramp")throw new Error(`${r} opacity legends are not supported`);return oB({type:e,...n,interpolate:mj(i)},{legend:r,...o})}function mj(e){let{r:t,g:n,b:r}=en(e)||en(0,0,0);return i=>`rgba(${t},${n},${r},${i})`}function sB(e,t,n){let r=[];for(let[i,o]of q1){let s=n[i];if(s?.legend&&i in e){let a=o(e[i],eI(t,e[i],s),c=>e[c]);a!=null&&r.push(a)}}return r}var yj={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},gj={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1},rm=class extends _t{constructor(t={}){let{anchor:n=null,inset:r=0,insetTop:i=r,insetRight:o=r,insetBottom:s=r,insetLeft:a=r,rx:c,ry:l}=t;super(Ta,void 0,t,n==null?yj:gj),this.anchor=rM(n,"anchor",["top","right","bottom","left"]),this.insetTop=Dt(i),this.insetRight=Dt(o),this.insetBottom=Dt(s),this.insetLeft=Dt(a),this.rx=Dt(c),this.ry=Dt(l)}render(t,n,r,i,o){let{marginTop:s,marginRight:a,marginBottom:c,marginLeft:l,width:u,height:f}=i,{anchor:h,insetTop:d,insetRight:p,insetBottom:m,insetLeft:g,rx:y,ry:b}=this,x=l+g,w=u-a-p,v=s+d,_=f-c-m;return lt(h?"svg:line":"svg:rect",o).datum(0).call(Bt,this,i,o).call(Nt,this).call(Ht,this,r).call(It,this,{}).call(h==="left"?M=>M.attr("x1",x).attr("x2",x).attr("y1",v).attr("y2",_):h==="right"?M=>M.attr("x1",w).attr("x2",w).attr("y1",v).attr("y2",_):h==="top"?M=>M.attr("x1",x).attr("x2",w).attr("y1",v).attr("y2",v):h==="bottom"?M=>M.attr("x1",x).attr("x2",w).attr("y1",_).attr("y2",_):M=>M.attr("x",x).attr("y",v).attr("width",w-x).attr("height",_-v).attr("rx",y).attr("ry",b)).node()}};function pf(e){return new rm(e)}var nI={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor"},bj=new Set(["geometry","href","src","ariaLabel","scales"]),im=class extends _t{constructor(t,n={}){n.tip&&(n={...n,tip:!1}),n.title===void 0&&rr(t)&&Zx(t)&&(n={...n,title:W});let{x:r,y:i,x1:o,x2:s,y1:a,y2:c,anchor:l,preferredAnchor:u="bottom",monospace:f,fontFamily:h=f?"ui-monospace, monospace":void 0,fontSize:d,fontStyle:p,fontVariant:m,fontWeight:g,lineHeight:y=1,lineWidth:b=20,frameAnchor:x,format:w,textAnchor:v="start",textOverflow:_,textPadding:M=8,title:D,pointerSize:A=12,pathFilter:N="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=n;super(t,{x:{value:o!=null&&s!=null?null:r,scale:"x",optional:!0},y:{value:a!=null&&c!=null?null:i,scale:"y",optional:!0},x1:{value:o,scale:"x",optional:s==null},y1:{value:a,scale:"y",optional:c==null},x2:{value:s,scale:"x",optional:o==null},y2:{value:c,scale:"y",optional:a==null},title:{value:D,optional:!0}},n,nI),this.anchor=Qx(l,"anchor"),this.preferredAnchor=Qx(u,"preferredAnchor"),this.frameAnchor=wo(x),this.textAnchor=ce(v,"middle"),this.textPadding=+M,this.pointerSize=+A,this.pathFilter=Ue(N),this.lineHeight=+y,this.lineWidth=+b,this.textOverflow=HM(_),this.monospace=!!f,this.fontFamily=Ue(h),this.fontSize=Dt(d),this.fontStyle=Ue(p),this.fontVariant=Ue(m),this.fontWeight=Ue(g);for(let T in nI)T in this.channels&&(this[T]=nI[T]);this.splitLines=KM(this),this.clipLine=QM(this),this.format={...w}}render(t,n,r,i,o){let s=this,{x:a,y:c,fx:l,fy:u}=n,{ownerSVGElement:f,document:h}=o,{anchor:d,monospace:p,lineHeight:m,lineWidth:g}=this,{textPadding:y,pointerSize:b,pathFilter:x}=this,{marginTop:w,marginLeft:v}=i,{x1:_,y1:M,x2:D,y2:A,x:N=_??D,y:T=M??A}=r,B=l?l(t.fx)-v:0,L=u?u(t.fy)-w:0,[S,I]=pn(this,i),E=qM(r,S),C=VM(r,I),k=p?O1:B1,F=k(al),R,$;"title"in r?(R=r.channels,$=Sj):(R=vj.call(this,r,n),$=Mj);let U=lt("svg:g",o).call(Bt,this,i,o).call(ZM,this).call(It,this,{x:N&&a,y:T&&c}).call(et=>et.selectAll().data(t).enter().append("g").attr("transform",st=>`translate(${Math.round(E(st))},${Math.round(C(st))})`).call(Nt,this).call(st=>st.append("path").attr("filter",x)).call(st=>st.append("text").each(function(j){let nt=Pt(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");let z=$.call(s,j,t,R,n,r);if(typeof z=="string")for(let X of s.splitLines(z))G(nt,{value:s.clipLine(X)});else{let X=new Set;for(let rt of z){let{label:P=""}=rt;P&&X.has(P)||(X.add(P),G(nt,rt))}}})));function G(et,{label:st,value:j,color:nt,opacity:z}){st??="",j??="";let X=nt!=null||z!=null,rt,P=g*100,[Ot]=ll(st,P,k,F);if(Ot>=0)st=st.slice(0,Ot).trimEnd()+al,rt=j.trim(),j="";else{(st||!j&&!X)&&(j=" "+j);let[Yt]=ll(j,P-k(st),k,F);Yt>=0&&(rt=j.trim(),j=j.slice(0,Yt).trimEnd()+al)}let ft=et.append("tspan").attr("x",0).attr("dy",`${m}em`).text("\u200B");st&&ft.append("tspan").attr("font-weight","bold").text(st),j&&ft.append(()=>h.createTextNode(j)),X&&ft.append("tspan").text(" \u25A0").attr("fill",nt).attr("fill-opacity",z).style("user-select","none"),rt&&ft.append("title").text(rt)}function J(){let{width:et,height:st}=i.facet??i;U.selectChildren().each(function(j){let{x:nt,width:z,height:X}=this.getBBox();z=Math.round(z),X=Math.round(X);let rt=d;if(rt===void 0){let ft=E(j)+B,Yt=C(j)+L,Wt=ft+z+b+y*2<et,tt=ft-z-b-y*2>0,ie=Yt+X+b+y*2<st,yr=Yt-X-b-y*2>0;rt=Wt&&tt?ie&&yr?s.preferredAnchor:yr?"bottom":"top":ie&&yr?Wt?"left":"right":(Wt||tt)&&(ie||yr)?`${yr?"bottom":"top"}-${Wt?"left":"right"}`:s.preferredAnchor}let P=this.firstChild,Ot=this.lastChild;if(P.setAttribute("d",_j(rt,b,y,z,X)),nt)for(let ft of Ot.childNodes)ft.setAttribute("x",-nt);Ot.setAttribute("y",`${+xj(rt,Ot.childNodes.length,m).toFixed(6)}em`),Ot.setAttribute("transform",`translate(${wj(rt,b,y,z,X)})`)}),U.attr("visibility",null)}return t.length&&(U.attr("visibility","hidden"),f.isConnected?Promise.resolve().then(J):typeof requestAnimationFrame<"u"&&requestAnimationFrame(J)),U.node()}};function j1(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Ce(t,n)),new im(e,{...r,x:t,y:n})}function xj(e,t,n){return/^top(?:-|$)/.test(e)?.94-n:-.29-t*n}function wj(e,t,n,r,i){switch(e){case"middle":return[-r/2,i/2];case"top-left":return[n,t+n];case"top":return[-r/2,t/2+n];case"top-right":return[-r-n,t+n];case"right":return[-t/2-r-n,i/2];case"bottom-left":return[n,-t-n];case"bottom":return[-r/2,-t/2-n];case"bottom-right":return[-r-n,-t-n];case"left":return[n+t/2,i/2]}}function _j(e,t,n,r,i){let o=r+n*2,s=i+n*2;switch(e){case"middle":return`M${-o/2},${-s/2}h${o}v${s}h${-o}z`;case"top-left":return`M0,0l${t},${t}h${o-t}v${s}h${-o}z`;case"top":return`M0,0l${t/2},${t/2}h${(o-t)/2}v${s}h${-o}v${-s}h${(o-t)/2}z`;case"top-right":return`M0,0l${-t},${t}h${t-o}v${s}h${o}z`;case"right":return`M0,0l${-t/2},${-t/2}v${t/2-s/2}h${-o}v${s}h${o}v${t/2-s/2}z`;case"bottom-left":return`M0,0l${t},${-t}h${o-t}v${-s}h${-o}z`;case"bottom":return`M0,0l${t/2},${-t/2}h${(o-t)/2}v${-s}h${-o}v${s}h${(o-t)/2}z`;case"bottom-right":return`M0,0l${-t},${-t}h${t-o}v${-s}h${o}z`;case"left":return`M0,0l${t/2},${-t/2}v${t/2-s/2}h${o}v${s}h${-o}v${t/2-s/2}z`}}function vj({channels:e},t){let n={},r=this.format;r=aB(r,e,"x"),r=aB(r,e,"y"),this.format=r;for(let i in r){let o=r[i];if(!(o===null||o===!1))if(i==="fx"||i==="fy")n[i]=!0;else{let s=Wp(e,i);s&&(n[i]=s)}}for(let i in e){if(i in n||i in r||bj.has(i))continue;let o=Wp(e,i);o&&(n[i]=o)}this.facet&&(t.fx&&!("fx"in r)&&(n.fx=!0),t.fy&&!("fy"in r)&&(n.fy=!0));for(let i in n){let o=this.format[i];if(typeof o=="string"){let s=n[i]?.value??t[i]?.domain()??[];this.format[i]=(De(s)?po:Xr)(o)}else if(o===void 0||o===!0){let s=t[i];this.format[i]=s?.bandwidth?nm(s,s.domain()):Ni}}return n}function aB(e,t,n){if(!(n in e))return e;let r=`${n}1`,i=`${n}2`;if((r in e||!(r in t))&&(i in e||!(i in t)))return e;let o=Object.entries(e),s=e[n];return o.splice(o.findIndex(([a])=>a===n)+1,0,[r,s],[i,s]),Object.fromEntries(o)}function Sj(e,t,{title:n}){return Ni(n.value[e],e)}function*Mj(e,t,n,r,i){for(let o in n){if(o==="fx"||o==="fy"){yield{label:V1(r,n,o),value:this.format[o](t[o],e)};continue}if(o==="x1"&&"x2"in n||o==="y1"&&"y2"in n)continue;let s=n[o];if(o==="x2"&&"x1"in n)yield{label:lB(r,n,"x"),value:cB(this.format.x2,n.x1,s,e)};else if(o==="y2"&&"y1"in n)yield{label:lB(r,n,"y"),value:cB(this.format.y2,n.y1,s,e)};else{let a=s.value[e],c=s.scale;if(!$e(a)&&c==null)continue;yield{label:V1(r,n,o),value:this.format[o](a,e),color:c==="color"?i[o][e]:null,opacity:c==="opacity"?i[o][e]:null}}}}function cB(e,t,n,r){return n.hint?.length?`${e(n.value[r]-t.value[r],r)}`:`${e(t.value[r],r)}\u2013${e(n.value[r],r)}`}function lB(e,t,n){let r=V1(e,t,`${n}1`,n),i=V1(e,t,`${n}2`,n);return r===i?r:`${r}\u2013${i}`}function V1(e,t,n,r=n){let i=t[n],o=e[i?.scale??n];return String(o?.label??i?.label??r)}function sm(e={}){let{facet:t,style:n,title:r,subtitle:i,caption:o,ariaLabel:s,ariaDescription:a}=e,c=Ju(e.className),l=e.marks===void 0?[]:fB(e.marks);l.push(...Bj(l));let u=Dj(t,e),f=new Map;for(let F of l){let R=hB(F,u,e);R&&f.set(F,R)}let h=new Map;u&&om(h,[u],e),om(h,f,e);let d=fB(Oj(l,h,e));for(let F of d){let R=hB(F,u,e);R&&f.set(F,R)}l.unshift(...d);let p=uN(h,e);if(p!==void 0){let F=u?v1(p,u):void 0;for(let $ of l){if($.facet===null||$.facet==="super")continue;let U=f.get($);U!==void 0&&(U.facetsIndex=$.fx!=null||$.fy!=null?v1(p,U):F)}let R=new Set;for(let{facetsIndex:$}of f.values())$?.forEach((U,G)=>{U?.length>0&&R.add(G)});p.forEach(0<R.size&&R.size<p.length?($,U)=>$.empty=!R.has(U):$=>$.empty=!1);for(let $ of l)if($.facet==="exclude"){let U=f.get($);U!==void 0&&(U.facetsIndex=dN(U.facetsIndex))}}for(let F of le.keys())go(e[F])&&F!=="fx"&&F!=="fy"&&h.set(F,[]);let m=new Map;for(let F of l){if(m.has(F))throw new Error("duplicate mark; each mark must be unique");let{facetsIndex:R,channels:$}=f.get(F)??{},{data:U,facets:G,channels:J}=F.initialize(R,$,e);oI(J,e),m.set(F,{data:U,facets:G,channels:J})}let g=Kp(om(h,m,e),e),y=cN(g,l,e);eN(g,y);let b=LM(g),{fx:x,fy:w}=b,v=x||w?FM(g,y):y,_=x||w?Uj(b,y):y,M=Ca(e),D=M.document,A=us("svg").call(D.documentElement),N=A;M.ownerSVGElement=A,M.className=c,M.projection=pD(e,v),M.filterFacets=(F,R)=>v1(p,{channels:R,groups:w1(F,R)}),M.getMarkState=F=>{let R=m.get(F),$=f.get(F);return{...R,channels:{...R.channels,...$?.channels}}},M.dispatchValue=F=>{N.value!==F&&(N.value=F,N.dispatchEvent(new Event("input",{bubbles:!0})))};let T=new Set;for(let[F,R]of m)if(F.initializer!=null){let $=F.facet==="super"?_:v,U=F.initializer(R.data,R.facets,R.channels,b,$,M);if(U.data!==void 0&&(R.data=U.data),U.facets!==void 0&&(R.facets=U.facets),U.channels!==void 0){let{fx:G,fy:J,...et}=U.channels;Ej(et),Object.assign(R.channels,et);for(let st of Object.values(et)){let{scale:j}=st;j!=null&&!j5(le.get(j))&&(mB(st,e),T.add(j))}(G!=null||J!=null)&&f.set(F,!0)}}if(T.size){let F=new Map;om(F,m,e,G=>T.has(G)),om(h,m,e,G=>T.has(G));let R=$j(Kp(F,e),g),{scales:$,...U}=LM(R);Object.assign(g,R),Object.assign(b,U),Object.assign(b.scales,$)}let B,L;p!==void 0&&(B={x:x?.domain(),y:w?.domain()},p=fN(p,B),L=hN(x,w,y));for(let[F,R]of m)R.values=F.scale(R.channels,b,M);let{width:S,height:I}=y;Pt(A).attr("class",c).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",S).attr("height",I).attr("viewBox",`0 0 ${S} ${I}`).attr("aria-label",s).attr("aria-description",a).call(F=>F.append("style").text(`:where(.${c}) {
|
|
60
60
|
--plot-background: white;
|
|
61
61
|
display: block;
|
|
62
62
|
height: auto;
|
|
@@ -66,4 +66,4 @@ ${m}`)).style("margin-left",l?`${+l}px`:null).style("width",h===void 0?null:`${+
|
|
|
66
66
|
:where(.${c} text),
|
|
67
67
|
:where(.${c} tspan) {
|
|
68
68
|
white-space: pre;
|
|
69
|
-
}`)).call(nf,n);for(let L of l){let{channels:R,values:$,facets:P}=m.get(L);if(p===void 0||L.facet==="super"){let G=null;if(P&&(G=P[0],G=L.filter(G,R,$),G.length===0))continue;let J=L.render(G,b,$,_,M);if(J==null)continue;N.appendChild(J)}else{let G;for(let J of p){if(!(L.facetAnchor?.(p,O,J)??!J.empty))continue;let et=null;if(P){let j=f.has(L);if(et=P[j?J.i:0],et=L.filter(et,R,$),et.length===0)continue;!j&&et===P[0]&&(et=Es(et)),et.fx=J.x,et.fy=J.y,et.fi=J.i}let ot=L.render(et,b,$,v,M);if(ot!=null){(G??=Pt(N).append("g")).append(()=>ot).datum(J);for(let j of["aria-label","aria-description","aria-hidden","transform"])ot.hasAttribute(j)&&(G.attr(j,ot.getAttribute(j)),ot.removeAttribute(j))}}G?.selectChildren().attr("transform",B)}}let D=eO(g,M,e),{figure:C=r!=null||i!=null||o!=null||D.length>0}=e;C&&(I=E.createElement("figure"),I.className=`${c}-figure`,I.style.maxWidth="initial",r!=null&&I.append(oO(E,r,"h2")),i!=null&&I.append(oO(E,i,"h3")),I.append(...D,N),o!=null&&I.append(Ej(E,o))),I.scale=tN(b.scales),I.legend=JN(g,M,e),I.projection=M.projection;let k=o5();return k>0&&Pt(N).append("text").attr("x",S).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("\u26A0\uFE0F").append("title").text(`${k.toLocaleString("en-US")} warning${k===1?"":"s"}. Please check the console.`),I}function oO(e,t,n){if(t.ownerDocument)return t;let r=e.createElement(n);return r.append(t),r}function Ej(e,t){let n=e.createElement("figcaption");return n.append(t),n}function Dj({marks:e=[],...t}={}){return um({...t,marks:[...e,this]})}xt.prototype.plot=Dj;function sO(e){return e.flat(1/0).filter(t=>t!=null).map(Nj)}function Nj(e){return typeof e.render=="function"?e:new rM(e)}var rM=class extends xt{constructor(t){if(typeof t!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}};function iM(e,t){for(let n in e)uO(e[n],t);return e}function uO(e,t){let{scale:n,transform:r=!0}=e;if(n==null||!r)return;let{type:i,percent:o,interval:s,transform:a=o?c=>c*100:sI(s,i)}=t[n]??{};a!=null&&(e.value=qt(e.value,a),e.transform=!1)}function Oj(e){for(let t in e)wI(t,e[t])}function lm(e,t,n,r=AD){for(let{channels:i}of t.values())for(let o in i){let s=i[o],{scale:a}=s;if(a!=null&&r(a))if(a==="projection"){if(!h5(n)){let c=n.x?.domain===void 0,l=n.y?.domain===void 0;if(c||l){let[u,f]=p5(s);c&&nM(e,"x",u),l&&nM(e,"y",f)}}}else nM(e,a,s)}return e}function nM(e,t,n){let r=e.get(t);r!==void 0?r.push(n):e.set(t,[n])}function Bj(e,t){if(e==null)return;let{x:n,y:r}=e;if(n==null&&r==null)return;let i=Pe(e.data);if(i==null)throw new Error("missing facet data");let o={};n!=null&&(o.fx=Ju(i,{value:n,scale:"fx"})),r!=null&&(o.fy=Ju(i,{value:r,scale:"fy"})),iM(o,t);let s=x1(i,o);return{channels:o,groups:s,data:e.data}}function aO(e,t,n){if(e.facet===null||e.facet==="super")return;let{fx:r,fy:i}=e;if(r!=null||i!=null){let c=Pe(e.data??r??i);if(c===void 0)throw new Error(`missing facet data in ${e.ariaLabel}`);if(c===null)return;let l={};return r!=null&&(l.fx=Ju(c,{value:r,scale:"fx"})),i!=null&&(l.fy=Ju(c,{value:i,scale:"fy"})),iM(l,n),{channels:l,groups:x1(c,l)}}if(t===void 0)return;let{channels:o,groups:s,data:a}=t;if(e.facet!=="auto"||e.data===a)return{channels:o,groups:s};a.length>0&&(s.size>1||s.size===1&&o.fx&&o.fy&&[...s][0][1].size>1)&&Pe(e.data)?.length===a.length&&Rn(`Warning: the ${e.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 Fj(e,t={}){return xe({...t,x:null,y:null},(n,r,i,o,s,a)=>a.getMarkState(e))}function Cj(e){let t=[];for(let n of e){let r=n.tip;if(r){r===!0?r={}:typeof r=="string"&&(r={pointer:r});let{pointer:i,preferredAnchor:o}=r;i=/^x$/i.test(i)?hf:/^y$/i.test(i)?sl:ff,r=i(Fj(n,r)),r.title=null,o===void 0&&(r.preferredAnchor=i===sl?"left":"bottom");let s=V1(n.data,r);s.facet=n.facet,s.facetAnchor=n.facetAnchor,t.push(s)}}return t}function Lj(e,t,n){let{projection:r,x:i={},y:o={},fx:s={},fy:a={},axis:c,grid:l,facet:u={},facet:{axis:f=c,grid:h}=u,x:{axis:d=c,grid:p=d===null?null:l}=i,y:{axis:m=c,grid:g=m===null?null:l}=o,fx:{axis:y=f,grid:b=y===null?null:h}=s,fy:{axis:x=f,grid:w=x===null?null:h}=a}=n;(r||!go(i)&&!cO("x",e))&&(d=p=null),(r||!go(o)&&!cO("y",e))&&(m=g=null),t.has("fx")||(y=b=null),t.has("fy")||(x=w=null),d===void 0&&(d=!W1(e,"x")),m===void 0&&(m=!W1(e,"y")),y===void 0&&(y=!W1(e,"fx")),x===void 0&&(x=!W1(e,"fy")),d===!0&&(d="bottom"),m===!0&&(m="left"),y===!0&&(y=d==="top"||d===null?"bottom":"top"),x===!0&&(x=m==="right"||m===null?"left":"right");let v=[];return Y1(v,w,$1,a),j1(v,x,L1,"right","left",u,a),Y1(v,b,U1,s),j1(v,y,k1,"top","bottom",u,s),Y1(v,g,R1,o),j1(v,m,im,"left","right",n,o),Y1(v,p,P1,i),j1(v,d,om,"bottom","top",n,i),v}function j1(e,t,n,r,i,o,s){if(!t)return;let a=kj(t);s=Rj(a?r:t,o,s);let{line:c}=s;(n===im||n===om)&&c&&!Os(c)&&e.push(yf($j(s))),e.push(n(s)),a&&e.push(n({...s,anchor:i,label:null}))}function Y1(e,t,n,r){!t||Os(t)||e.push(n(Pj(t,r)))}function kj(e){return/^\s*both\s*$/i.test(e)}function Rj(e,t,{line:n=t.line,ticks:r,tickSize:i,tickSpacing:o,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:l,ariaLabel:u,ariaDescription:f,label:h=t.label,labelAnchor:d,labelArrow:p=t.labelArrow,labelOffset:m}){return{anchor:e,line:n,ticks:r,tickSize:i,tickSpacing:o,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:l,ariaLabel:u,ariaDescription:f,label:h,labelAnchor:d,labelArrow:p,labelOffset:m}}function $j(e){let{anchor:t,line:n}=e;return{anchor:t,facetAnchor:t+"-empty",stroke:n===!0?void 0:n}}function Pj(e,{stroke:t=Fa(e)?e:void 0,ticks:n=Uj(e)?e:void 0,tickSpacing:r,ariaLabel:i,ariaDescription:o}){return{stroke:t,ticks:n,tickSpacing:r,ariaLabel:i,ariaDescription:o}}function Uj(e){switch(typeof e){case"number":return!0;case"string":return!Fa(e)}return tr(e)||typeof e?.range=="function"}function W1(e,t){let n=`${t}-axis `;return e.some(r=>r.ariaLabel?.startsWith(n))}function cO(e,t){for(let n of t)for(let r in n.channels){let{scale:i}=n.channels[r];if(i===e||i==="projection")return!0}return!1}function zj(e,t){for(let n in e){let r=e[n],i=t[n];r.label===void 0&&i&&(r.label=i.label)}return e}function qj({fx:e,fy:t},n){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:a,height:c}=y1(n),l=e&&lO(e),u=t&&lO(t);return{marginTop:t?u[0]:r,marginRight:e?a-l[1]:i,marginBottom:t?c-u[1]:o,marginLeft:e?l[0]:s,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:a,height:c}}function lO(e){let t=e.domain(),n=e(t[0]),r=e(t[t.length-1]);return r<n&&([n,r]=[r,n]),[n,r+e.bandwidth()]}var Vj=new Map([["basis",AS],["basis-closed",TS],["basis-open",ES],["bundle",DS],["bump-x",_S],["bump-y",vS],["cardinal",NS],["cardinal-closed",OS],["cardinal-open",BS],["catmull-rom",FS],["catmull-rom-closed",CS],["catmull-rom-open",LS],["linear",Ss],["linear-closed",kS],["monotone-x",$S],["monotone-y",PS],["natural",US],["step",zS],["step-after",VS],["step-before",qS]]);function fm(e=Ss,t){if(typeof e=="function")return e;let n=Vj.get(`${e}`.toLowerCase());if(!n)throw new Error(`unknown curve: ${e}`);if(t!==void 0){if("beta"in n)return n.beta(t);if("tension"in n)return n.tension(t);if("alpha"in n)return n.alpha(t)}return n}function G1(e=qa,t){return typeof e!="function"&&`${e}`.toLowerCase()==="auto"?qa:fm(e,t)}function qa(e){return Ss(e)}function Io(e={y:"count"},t={}){[e,t]=sM(e,t);let{x:n,y:r}=t;return oM(X1(n,t,W),null,null,r,e,al(t))}function Mo(e={x:"count"},t={}){[e,t]=sM(e,t);let{x:n,y:r}=t;return oM(null,X1(r,t,W),n,null,e,cl(t))}function Rs(e={fill:"count"},t={}){[e,t]=sM(e,t);let{x:n,y:r}=jj(t);return oM(n,r,null,null,e,al(cl(t)))}function dO(e,t,n={}){if(n?.interval==null)return n;let{reduce:r=i1}=n,i={filter:null};return n[t]!=null&&(i[t]=r),n[`${t}1`]!=null&&(i[`${t}1`]=r),n[`${t}2`]!=null&&(i[`${t}2`]=r),e(i,n)}function gf(e={}){return dO(Io,"y",Bi(e,"x"))}function bf(e={}){return dO(Mo,"x",Bi(e,"y"))}function oM(e,t,n,r,{data:i=r1,filter:o=Wp,sort:s,reverse:a,...c}={},l={}){e=fO(e),t=fO(t),c=Yj(c,l),i=yO(i,W),s=s==null?void 0:pO("sort",s,l),o=o==null?void 0:mO("filter",o,l),n!=null&&_o(c,"x","x1","x2")&&(n=null),r!=null&&_o(c,"y","y1","y2")&&(r=null);let[u,f]=In(e),[h,d]=In(e),[p,m]=In(t),[g,y]=In(t),[b,x]=n!=null?[n,"x"]:r!=null?[r,"y"]:[],[w,v]=In(b),{x:_,y:M,z:E,fill:N,stroke:I,x1:T,x2:O,y1:B,y2:S,domain:A,cumulative:D,thresholds:C,interval:k,...L}=l,[R,$]=In(E),[P]=Ae(N),[G]=Ae(I),[J,et]=In(P),[ot,j]=In(G);return{..."z"in l&&{z:R||E},..."fill"in l&&{fill:J||N},..."stroke"in l&&{stroke:ot||I},...un(L,(nt,z,X)=>{let rt=el(dt(nt,b),X?.[x]),U=dt(nt,E),Bt=dt(nt,P),ft=dt(nt,G),jt=Hp(c,{z:U,fill:Bt,stroke:ft}),Yt=[],tt=[],ne=rt&&v([]),pr=U&&$([]),Li=Bt&&et([]),WF=ft&&j([]),w3=e&&f([]),GF=e&&d([]),_3=t&&m([]),XF=t&&y([]),HF=Xj(e,t,nt),ZF=0;for(let _l of c)_l.initialize(nt);s&&s.initialize(nt),o&&o.initialize(nt);for(let _l of z){let v3=[];for(let jf of c)jf.scope("facet",_l);s&&s.scope("facet",_l),o&&o.scope("facet",_l);for(let[jf,KF]of Ca(_l,jt))for(let[QF,zm]of Ca(KF,rt))for(let[ki,Ka]of HF(zm))if(!(o&&!o.reduce(ki,Ka))){v3.push(ZF++),tt.push(i.reduceIndex(ki,nt,Ka)),rt&&ne.push(QF),U&&pr.push(jt===U?jf:U[(ki.length>0?ki:zm)[0]]),Bt&&Li.push(jt===Bt?jf:Bt[(ki.length>0?ki:zm)[0]]),ft&&WF.push(jt===ft?jf:ft[(ki.length>0?ki:zm)[0]]),w3&&(w3.push(Ka.x1),GF.push(Ka.x2)),_3&&(_3.push(Ka.y1),XF.push(Ka.y2));for(let JF of c)JF.reduce(ki,Ka);s&&s.reduce(ki)}Yt.push(v3)}return bI(Yt,s,a),{data:tt,facets:Yt}}),...!_o(c,"x")&&(u?{x1:u,x2:h,x:Xu(u,h)}:{x:_,x1:T,x2:O}),...!_o(c,"y")&&(p?{y1:p,y2:g,y:Xu(p,g)}:{y:M,y1:B,y2:S}),...w&&{[x]:w},...Object.fromEntries(c.map(({name:nt,output:z})=>[nt,z]))}}function sM({cumulative:e,domain:t,thresholds:n,interval:r,...i},o){return[i,{cumulative:e,domain:t,thresholds:n,interval:r,...o}]}function X1(e,{cumulative:t,domain:n,thresholds:r,interval:i},o){return e={...ti(e)},e.domain===void 0&&(e.domain=n),e.cumulative===void 0&&(e.cumulative=t),e.thresholds===void 0&&(e.thresholds=r),e.interval===void 0&&(e.interval=i),e.value===void 0&&(e.value=o),e.thresholds=aM(e.thresholds,e.interval),e}function jj(e){let{x:t,y:n}=e;return t=X1(t,e),n=X1(n,e),[t.value,n.value]=Ce(t.value,n.value),{x:t,y:n}}function fO(e){if(e==null)return;let{value:t,cumulative:n,domain:r=ie,thresholds:i}=e,o=s=>{let a=dt(s,t),c;if(Te(a)||Gj(i)){a=qt(a,eI,Float64Array);let[u,f]=typeof r=="function"?r(a):r,h=typeof i=="function"&&!Ba(i)?i(a,u,f):i;typeof h=="number"&&(h=pp(u,f,h)),Ba(h)&&(r===ie&&(u=h.floor(u),f=h.offset(h.floor(f))),h=h.range(u,h.offset(f))),c=h}else{a=Xe(a);let[u,f]=typeof r=="function"?r(a):r,h=typeof i=="function"&&!Ba(i)?i(a,u,f):i;if(typeof h=="number")if(r===ie){let d=os(u,f,h);if(isFinite(d))if(d>0){let p=Math.round(u/d),m=Math.round(f/d);p*d<=u||--p,m*d>f||++m;let g=m-p+1;h=new Float64Array(g);for(let y=0;y<g;++y)h[y]=(p+y)*d}else if(d<0){d=-d;let p=Math.round(u*d),m=Math.round(f*d);p/d<=u||--p,m/d>f||++m;let g=m-p+1;h=new Float64Array(g);for(let y=0;y<g;++y)h[y]=(p+y)/d}else h=[u];else h=[u]}else h=xn(u,f,h);else Ba(h)&&(r===ie&&(u=h.floor(u),f=h.offset(h.floor(f))),h=h.range(u,h.offset(f)));c=h}let l=[];if(c.length===1)l.push([c[0],c[0]]);else for(let u=1;u<c.length;++u)l.push([c[u-1],c[u]]);return l.bin=(n<0?Zj:n>0?Hj:cM)(l,c,a),l};return o.label=Mn(t),o}function aM(e,t,n=hO){if(e===void 0)return t===void 0?n:xo(t);if(typeof e=="string"){switch(e.toLowerCase()){case"freedman-diaconis":return P0;case"scott":return ld;case"sturges":return ua;case"auto":return hO}return qp(e)}return e}function Yj(e,t){return yI(e,t,pO)}function pO(e,t,n){return e1(e,t,n,mO)}function mO(e,t,n){return n1(e,t,n,yO)}function yO(e,t){return Qu(e,t,Wj)}function Wj(e){switch(`${e}`.toLowerCase()){case"x":return Kj;case"x1":return Jj;case"x2":return tY;case"y":return Qj;case"y1":return eY;case"y2":return nY}throw new Error(`invalid bin reduce: ${e}`)}function hO(e,t,n){return Math.min(200,ld(e,t,n))}function Gj(e){return ND(e)||tr(e)&&Te(e)}function Xj(e,t,n){let r=e?.(n),i=t?.(n);return r&&i?function*(o){let s=r.bin(o);for(let[a,[c,l]]of r.entries()){let u=i.bin(s[a]);for(let[f,[h,d]]of i.entries())yield[u[f],{data:n,x1:c,y1:h,x2:l,y2:d}]}}:r?function*(o){let s=r.bin(o);for(let[a,[c,l]]of r.entries())yield[s[a],{data:n,x1:c,x2:l}]}:function*(o){let s=i.bin(o);for(let[a,[c,l]]of i.entries())yield[s[a],{data:n,y1:c,y2:l}]}}function cM(e,t,n){return t=Xe(t),r=>{let i=e.map(()=>[]);for(let o of r)i[is(t,n[o])-1]?.push(o);return i}}function Hj(e,t,n){let r=cM(e,t,n);return i=>{let o=r(i);for(let s=1,a=o.length;s<a;++s){let c=o[s-1],l=o[s];for(let u of c)l.push(u)}return o}}function Zj(e,t,n){let r=cM(e,t,n);return i=>{let o=r(i);for(let s=o.length-2;s>=0;--s){let a=o[s+1],c=o[s];for(let l of a)c.push(l)}return o}}function gO(e,t){let n=(+e+ +t)/2;return e instanceof Date?new Date(n):n}var Kj={reduceIndex(e,t,{x1:n,x2:r}){return gO(n,r)}},Qj={reduceIndex(e,t,{y1:n,y2:r}){return gO(n,r)}},Jj={reduceIndex(e,t,{x1:n}){return n}},tY={reduceIndex(e,t,{x2:n}){return n}},eY={reduceIndex(e,t,{y1:n}){return n}},nY={reduceIndex(e,t,{y2:n}){return n}};function xf(e={}){return rI(e)?e:{...e,x:W}}function wf(e={}){return iI(e)?e:{...e,y:W}}function bO(e,t){if(t.length===1)return{data:e,facets:t};let n=e.length,r=new Uint8Array(n),i=0;for(let a of t)for(let c of a)r[c]&&++i,r[c]=1;if(i===0)return{data:e,facets:t};e=Oa(e);let o=e[QS]=new Uint32Array(n+i);t=t.map(a=>Oa(a,Uint32Array));let s=n;r.fill(0);for(let a of t)for(let c=0,l=a.length;c<l;++c){let u=a[c];r[u]?(a[c]=s,e[s]=e[u],o[s]=u,++s):o[u]=u,r[u]=1}return{data:e,facets:t}}function lM(e={},t={}){arguments.length===1&&([e,t]=Sf(e));let{y1:n,y:r=n,x:i,...o}=t,[s,a,c,l]=If(r,i,"y","x",e,o);return{...s,y1:n,y:a,x1:c,x2:l,x:Xu(c,l)}}function _O(e={},t={}){arguments.length===1&&([e,t]=Sf(e));let{y1:n,y:r=n,x:i}=t,[o,s,a]=If(r,i,"y","x",e,t);return{...o,y1:n,y:s,x:a}}function vO(e={},t={}){arguments.length===1&&([e,t]=Sf(e));let{y1:n,y:r=n,x:i}=t,[o,s,,a]=If(r,i,"y","x",e,t);return{...o,y1:n,y:s,x:a}}function uM(e={},t={}){arguments.length===1&&([e,t]=Sf(e));let{x1:n,x:r=n,y:i,...o}=t,[s,a,c,l]=If(r,i,"x","y",e,o);return{...s,x1:n,x:a,y1:c,y2:l,y:Xu(c,l)}}function SO(e={},t={}){arguments.length===1&&([e,t]=Sf(e));let{x1:n,x:r=n,y:i}=t,[o,s,a]=If(r,i,"x","y",e,t);return{...o,x1:n,x:s,y:a}}function IO(e={},t={}){arguments.length===1&&([e,t]=Sf(e));let{x1:n,x:r=n,y:i}=t,[o,s,,a]=If(r,i,"x","y",e,t);return{...o,x1:n,x:s,y:a}}function _f({x:e,x1:t,x2:n,...r}={}){return r=Bi(r,"y"),t===void 0&&n===void 0?lM({x:e,...r}):([t,n]=oI(e,t,n),{...r,x1:t,x2:n})}function vf({y:e,y1:t,y2:n,...r}={}){return r=Bi(r,"x"),t===void 0&&n===void 0?uM({y:e,...r}):([t,n]=oI(e,t,n),{...r,y1:t,y2:n})}function Sf(e){let{offset:t,order:n,reverse:r,...i}=e;return[{offset:t,order:n,reverse:r},i]}var rY={length:!0};function If(e,t=Vp,n,r,{offset:i,order:o,reverse:s},a){if(t===null)throw new Error(`stack requires ${r}`);let c=kn(a),[l,u]=In(e),[f,h]=ln(t),[d,p]=ln(t);return f.hint=d.hint=rY,i=iY(i),o=aY(o,i,r),[un(a,(m,g,y)=>{({data:m,facets:g}=bO(m,g));let b=e==null?void 0:u(el(dt(m,e),y?.[n])),x=dt(m,t,Float64Array),w=dt(m,c),v=o&&o(m,b,x,w),_=m.length,M=h(new Float64Array(_)),E=p(new Float64Array(_)),N=[];for(let I of g){let T=b?Array.from(en(I,O=>b[O]).values()):[I];if(v)for(let O of T)O.sort(v);for(let O of T){let B=0,S=0;s&&O.reverse();for(let A of O){let D=x[A];D<0?B=E[A]=(M[A]=B)+D:D>0?S=E[A]=(M[A]=S)+D:E[A]=M[A]=S}}N.push(T)}return i&&i(N,M,E,w),{data:m,facets:g}}),l,f,d]}function iY(e){if(e!=null){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"expand":case"normalize":return oY;case"center":case"silhouette":return sY;case"wiggle":return AO}throw new Error(`unknown offset: ${e}`)}}function MO(e,t){let n=0,r=0;for(let i of e){let o=t[i];o<n&&(n=o),o>r&&(r=o)}return[n,r]}function oY(e,t,n){for(let r of e)for(let i of r){let[o,s]=MO(i,n);for(let a of i){let c=1/(s-o||1);t[a]=c*(t[a]-o),n[a]=c*(n[a]-o)}}}function sY(e,t,n){for(let r of e){for(let i of r){let[o,s]=MO(i,n);for(let a of i){let c=(s+o)/2;t[a]-=c,n[a]-=c}}TO(r,t,n)}EO(e,t,n)}function AO(e,t,n,r){for(let i of e){let o=new qn,s=0;for(let a of i){let c=-1,l=a.map(d=>Math.abs(n[d]-t[d])),u=a.map(d=>{c=r?r[d]:++c;let p=n[d]-t[d],m=o.has(c)?p-o.get(c):0;return o.set(c,p),m}),f=[0,...C0(u)];for(let d of a)t[d]+=s,n[d]+=s;let h=wn(l);h&&(s-=wn(l,(d,p)=>(u[p]/2+f[p])*d)/h)}TO(i,t,n)}EO(e,t,n)}function TO(e,t,n){let r=oe(e,i=>oe(i,o=>t[o]));for(let i of e)for(let o of i)t[o]-=r,n[o]-=r}function EO(e,t,n){let r=e.length;if(r===1)return;let i=e.map(a=>a.flat()),o=i.map(a=>(oe(a,c=>t[c])+Vt(a,c=>n[c]))/2),s=oe(o);for(let a=0;a<r;a++){let c=s-o[a];for(let l of i[a])t[l]+=c,n[l]+=c}}function aY(e,t,n){if(e===void 0&&t===AO)return xO(sn);if(e!=null){if(typeof e=="string"){let r=e.startsWith("-"),i=r?Qc:sn;switch((r?e.slice(1):e).toLowerCase()){case"value":case n:return cY(i);case"z":return lY(i);case"sum":return uY(i);case"appearance":return fY(i);case"inside-out":return xO(i)}return wO(JS(e))}if(typeof e=="function")return(e.length===1?wO:hY)(e);if(Array.isArray(e))return dY(e);throw new Error(`invalid order: ${e}`)}}function cY(e){return(t,n,r)=>(i,o)=>e(r[i],r[o])}function lY(e){return(t,n,r,i)=>(o,s)=>e(i[o],i[s])}function uY(e){return H1(e,(t,n,r,i)=>Kl(Jn(t),o=>wn(o,s=>r[s]),o=>i[o]))}function fY(e){return H1(e,(t,n,r,i)=>Kl(Jn(t),o=>n[Ic(o,s=>r[s])],o=>i[o]))}function xO(e){return H1(e,(t,n,r,i)=>{let o=Jn(t),s=Kl(o,f=>n[Ic(f,h=>r[h])],f=>i[f]),a=Mi(o,f=>wn(f,h=>r[h]),f=>i[f]),c=[],l=[],u=0;for(let f of s)u<0?(u+=a.get(f),c.push(f)):(u-=a.get(f),l.push(f));return l.reverse().concat(c)})}function wO(e){return t=>{let n=dt(t,e);return(r,i)=>sn(n[r],n[i])}}function hY(e){return t=>(n,r)=>e(t[n],t[r])}function dY(e){return H1(sn,()=>e)}function H1(e,t){return(n,r,i,o)=>{if(!o)throw new Error("missing channel: z");let s=new qn(t(n,r,i,o).map((a,c)=>[a,c]));return(a,c)=>e(s.get(o[a]),s.get(o[c]))}}var pY={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},dl=class extends xt{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,z:a,curve:c,tension:l}=n;super(t,{x1:{value:r,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0},z:{value:kn(n),optional:!0}},n,pY),this.z=a,this.curve=fm(c,l)}filter(t){return t}render(t,n,r,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a}=r;return at("svg:g",o).call(Ot,this,i,o).call(_t,this,n,0,0).call(u=>u.selectAll().data(l1(t,[s,a,c,l],this,r)).enter().append("path").call(Tt,this).call(ol,this,r).attr("d",ku().curve(this.curve).defined(f=>f>=0).x0(f=>s[f]).y0(f=>a[f]).x1(f=>c[f]).y1(f=>l[f]))).node()}};function hm(e,t){return t===void 0?$s(e,{x:Ts,y:Na}):new dl(e,t)}function Va(e,t){let{y:n=ve,...r}=bf(t);return new dl(e,_f(xf({...r,y1:n,y2:void 0})))}function $s(e,t){let{x:n=ve,...r}=gf(t);return new dl(e,vf(wf({...r,x1:n,x2:void 0})))}var mY={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},dm=class extends xt{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,curve:a,tension:c}=n;super(t,{x1:{value:r,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,mY),this.curve=G1(a,c),Fi(this,n)}project(t,n,r){this.curve!==qa&&super.project(t,n,r)}render(t,n,r,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a}=r,{curve:u}=this;return at("svg:g",o).call(Ot,this,i,o).call(_t,this,n).call(f=>f.selectAll().data(t).enter().append("path").call(Tt,this).attr("d",u===qa&&o.projection?yY(o.projection,s,a,c,l):h=>{let d=Gn(),p=u(d);return p.lineStart(),p.point(s[h],a[h]),p.point(c[h],l[h]),p.lineEnd(),d}).call(Xt,this,r).call(ks,this,r,o)).node()}};function yY(e,t,n,r,i){let o=vn(e);return t=Xe(t),n=Xe(n),r=Xe(r),i=Xe(i),s=>o({type:"LineString",coordinates:[[t[s],n[s]],[r[s],i[s]]]})}function Z1(e,{x:t,x1:n,x2:r,y:i,y1:o,y2:s,...a}={}){return[n,r]=pm(t,n,r),[o,s]=pm(i,o,s),new dm(e,{...a,x1:n,x2:r,y1:o,y2:s})}function pm(e,t,n){if(e===void 0){if(t===void 0){if(n!==void 0)return[n]}else if(n===void 0)return[t]}else{if(t===void 0)return n===void 0?[e]:[e,n];if(n===void 0)return[e,t]}return[t,n]}var gY={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5},mm=class extends xt{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,bend:a=0,headAngle:c=60,headLength:l=8,inset:u=0,insetStart:f=u,insetEnd:h=u,sweep:d}=n;super(t,{x1:{value:r,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,gY),this.bend=a===!0?22.5:Math.max(-90,Math.min(90,a)),this.headAngle=+c,this.headLength=+l,this.insetStart=+f,this.insetEnd=+h,this.sweep=bY(d)}render(t,n,r,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a,SW:u}=r,{strokeWidth:f,bend:h,headAngle:d,headLength:p,insetStart:m,insetEnd:g}=this,y=u?w=>u[w]:an(f===void 0?1:f),b=d*df/2,x=p/1.5;return at("svg:g",o).call(Ot,this,i,o).call(_t,this,n).call(w=>w.selectAll().data(t).enter().append("path").call(Tt,this).attr("d",v=>{let _=s[v],M=a[v],E=c[v],N=l[v],I=Math.hypot(E-_,N-M);if(I<=m+g)return null;let T=Math.atan2(N-M,E-_),O=Math.min(x*y(v),I/3),B=this.sweep(_,M,E,N)*h*df,S=Math.hypot(I/Math.tan(B),I)/2;if(m||g)if(S<1e5){let J=Math.sign(B),[et,ot]=xY([_,M],[E,N],S,J);if(m&&([_,M]=DO([et,ot,S],[_,M,m],-J*Math.sign(m))),g){let[j,nt]=DO([et,ot,S],[E,N,g],J*Math.sign(g));T+=Math.atan2(nt-ot,j-et)-Math.atan2(N-ot,E-et),E=j,N=nt}}else{let J=E-_,et=N-M,ot=Math.hypot(J,et);m&&(_+=J/ot*m,M+=et/ot*m),g&&(E-=J/ot*g,N-=et/ot*g)}let A=T+B,D=A+b,C=A-b,k=E-O*Math.cos(D),L=N-O*Math.sin(D),R=E-O*Math.cos(C),$=N-O*Math.sin(C),P=S<1e5?`A${S},${S} 0,0,${B>0?1:0} `:"L",G=O?`M${k},${L}L${E},${N}L${R},${$}`:"";return`M${_},${M}${P}${E},${N}${G}`}).call(Xt,this,r)).node()}};function bY(e=1){if(typeof e=="number")return an(Math.sign(e));if(typeof e=="function")return(t,n,r,i)=>Math.sign(e(t,n,r,i));switch(He(e,"sweep",["+x","-x","+y","-y"])){case"+x":return(t,n,r)=>$t(t,r);case"-x":return(t,n,r)=>zn(t,r);case"+y":return(t,n,r,i)=>$t(n,i);case"-y":return(t,n,r,i)=>zn(n,i)}}function xY([e,t],[n,r],i,o){let s=n-e,a=r-t,c=Math.hypot(s,a),l=o*Math.sqrt(i*i-c*c/4)/c;return[(e+n)/2-a*l,(t+r)/2+s*l]}function DO([e,t,n],[r,i,o],s){let a=r-e,c=i-t,l=Math.hypot(a,c),u=(a*a+c*c-o*o+n*n)/(2*l),f=s*Math.sqrt(n*n-u*u);return[e+(a*u+c*f)/l,t+(c*u-a*f)/l]}function NO(e,{x:t,x1:n,x2:r,y:i,y1:o,y2:s,...a}={}){return[n,r]=pm(t,n,r),[o,s]=pm(i,o,s),new mm(e,{...a,x1:n,x2:r,y1:o,y2:s})}var Mf=class extends xt{constructor(t,n,r={},i){super(t,n,r,i);let{inset:o=0,insetTop:s=o,insetRight:a=o,insetBottom:c=o,insetLeft:l=o,rx:u,ry:f}=r;this.insetTop=At(s),this.insetRight=At(a),this.insetBottom=At(c),this.insetLeft=At(l),this.rx=se(u,"auto"),this.ry=se(f,"auto")}render(t,n,r,i,o){let{rx:s,ry:a}=this;return at("svg:g",o).call(Ot,this,i,o).call(this._transform,this,n).call(c=>c.selectAll().data(t).enter().append("rect").call(Tt,this).attr("x",this._x(n,r,i)).attr("width",this._width(n,r,i)).attr("y",this._y(n,r,i)).attr("height",this._height(n,r,i)).call(ut,"rx",s).call(ut,"ry",a).call(Xt,this,r)).node()}_x(t,{x:n},{marginLeft:r}){let{insetLeft:i}=this;return n?o=>n[o]+i:r+i}_y(t,{y:n},{marginTop:r}){let{insetTop:i}=this;return n?o=>n[o]+i:r+i}_width({x:t},{x:n},{marginRight:r,marginLeft:i,width:o}){let{insetLeft:s,insetRight:a}=this,c=n&&t?t.bandwidth():o-r-i;return Math.max(0,c-s-a)}_height({y:t},{y:n},{marginTop:r,marginBottom:i,height:o}){let{insetTop:s,insetBottom:a}=this,c=n&&t?t.bandwidth():o-r-i;return Math.max(0,c-s-a)}},OO={ariaLabel:"bar"},ym=class extends Mf{constructor(t,n={}){let{x1:r,x2:i,y:o}=n;super(t,{x1:{value:r,scale:"x"},x2:{value:i,scale:"x"},y:{value:o,scale:"y",type:"band",optional:!0}},n,OO)}_transform(t,n,{x:r}){t.call(_t,n,{x:r},0,0)}_x({x:t},{x1:n,x2:r},{marginLeft:i}){let{insetLeft:o}=this;return er(t)?i+o:s=>Math.min(n[s],r[s])+o}_width({x:t},{x1:n,x2:r},{marginRight:i,marginLeft:o,width:s}){let{insetLeft:a,insetRight:c}=this;return er(t)?s-i-o-a-c:l=>Math.max(0,Math.abs(r[l]-n[l])-a-c)}},gm=class extends Mf{constructor(t,n={}){let{x:r,y1:i,y2:o}=n;super(t,{y1:{value:i,scale:"y"},y2:{value:o,scale:"y"},x:{value:r,scale:"x",type:"band",optional:!0}},n,OO)}_transform(t,n,{y:r}){t.call(_t,n,{y:r},0,0)}_y({y:t},{y1:n,y2:r},{marginTop:i}){let{insetTop:o}=this;return er(t)?i+o:s=>Math.min(n[s],r[s])+o}_height({y:t},{y1:n,y2:r},{marginTop:i,marginBottom:o,height:s}){let{insetTop:a,insetBottom:c}=this;return er(t)?s-i-o-a-c:l=>Math.max(0,Math.abs(r[l]-n[l])-a-c)}};function Ao(e,t={}){return Wu(t)||(t={...t,y:ve,x2:W}),new ym(e,_f(I1(xf(t))))}function To(e,t={}){return Wu(t)||(t={...t,x:ve,y2:W}),new gm(e,vf(M1(wf(t))))}var wY={ariaLabel:"cell"},pl=class extends Mf{constructor(t,{x:n,y:r,...i}={}){super(t,{x:{value:n,scale:"x",type:"band",optional:!0},y:{value:r,scale:"y",type:"band",optional:!0}},i,wY)}_transform(t,n){t.call(_t,n,{},0,0)}};function ja(e,{x:t,y:n,...r}={}){return[t,n]=Ce(t,n),new pl(e,{...r,x:t,y:n})}function BO(e,{x:t=ve,fill:n,stroke:r,...i}={}){return n===void 0&&Ae(r)[0]===void 0&&(n=W),new pl(e,{...i,x:t,fill:n,stroke:r})}function FO(e,{y:t=ve,fill:n,stroke:r,...i}={}){return n===void 0&&Ae(r)[0]===void 0&&(n=W),new pl(e,{...i,y:t,fill:n,stroke:r})}var _Y={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function bm(e){return e.sort===void 0&&e.reverse===void 0?Jx({channel:"-r"},e):e}var ml=class extends xt{constructor(t,n={}){let{x:r,y:i,r:o,rotate:s,symbol:a=Is,frameAnchor:c}=n,[l,u]=ee(s,0),[f,h]=qD(a),[d,p]=ee(o,f==null?3:4.5);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:d,scale:"r",filter:Qn,optional:!0},rotate:{value:l,optional:!0},symbol:{value:f,scale:"auto",optional:!0}},bm(n),_Y),this.r=p,this.rotate=u,this.symbol=h,this.frameAnchor=wo(c);let{channels:m}=this,{symbol:g}=m;if(g){let{fill:y,stroke:b}=m;g.hint={fill:y?y.value===g.value?"color":"currentColor":this.fill??"currentColor",stroke:b?b.value===g.value?"color":"currentColor":this.stroke??"none"}}}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,r:u,rotate:f,symbol:h}=r,{r:d,rotate:p,symbol:m}=this,[g,y]=fn(this,i),b=m===Is,x=u?void 0:d*d*Math.PI;return Ma(d)&&(t=[]),at("svg:g",o).call(Ot,this,i,o).call(_t,this,{x:c&&s,y:l&&a}).call(w=>w.selectAll().data(t).enter().append(b?"circle":"path").call(Tt,this).call(b?v=>{v.attr("cx",c?_=>c[_]:g).attr("cy",l?_=>l[_]:y).attr("r",u?_=>u[_]:d)}:v=>{v.attr("transform",Ua`translate(${c?_=>c[_]:g},${l?_=>l[_]:y})${f?_=>` rotate(${f[_]})`:p?` rotate(${p})`:""}`).attr("d",u&&h?_=>{let M=Gn();return h[_].draw(M,u[_]*u[_]*Math.PI),M}:u?_=>{let M=Gn();return m.draw(M,u[_]*u[_]*Math.PI),M}:h?_=>{let M=Gn();return h[_].draw(M,x),M}:(()=>{let _=Gn();return m.draw(_,x),_})())}).call(Xt,this,r)).node()}};function ni(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Ce(t,n)),new ml(e,{...r,x:t,y:n})}function CO(e,{x:t=W,...n}={}){return new ml(e,T1({...n,x:t}))}function LO(e,{y:t=W,...n}={}){return new ml(e,A1({...n,y:t}))}function kO(e,t){return ni(e,{...t,symbol:"circle"})}function RO(e,t){return ni(e,{...t,symbol:"hexagon"})}var vY={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},yl=class extends xt{constructor(t,n={}){let{x:r,y:i,z:o,curve:s,tension:a}=n;super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y"},z:{value:kn(n),optional:!0}},n,vY),this.z=o,this.curve=G1(s,a),Fi(this,n)}filter(t){return t}project(t,n,r){this.curve!==qa&&super.project(t,n,r)}render(t,n,r,i,o){let{x:s,y:a}=r,{curve:c}=this;return at("svg:g",o).call(Ot,this,i,o).call(_t,this,n).call(l=>l.selectAll().data(l1(t,[s,a],this,r)).enter().append("path").call(Tt,this).call(ol,this,r).call(pN,this,r,o).attr("d",c===qa&&o.projection?SY(o.projection,s,a):Sp().curve(c).defined(u=>u>=0).x(u=>s[u]).y(u=>a[u]))).node()}};function SY(e,t,n){let r=vn(e);return t=Xe(t),n=Xe(n),i=>{let o=[],s=[o];for(let a of i)a===-1?(o=[],s.push(o)):o.push([t[a],n[a]]);return r({type:"MultiLineString",coordinates:s})}}function gl(e,{x:t,y:n,...r}={}){return[t,n]=Ce(t,n),new yl(e,{...r,x:t,y:n})}function Ya(e,{x:t=W,y:n=ve,...r}={}){return new yl(e,bf({...r,x:t,y:n}))}function Wa(e,{x:t=ve,y:n=W,...r}={}){return new yl(e,gf({...r,x:t,y:n}))}var IY={ariaLabel:"rect"},bl=class extends xt{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,inset:a=0,insetTop:c=a,insetRight:l=a,insetBottom:u=a,insetLeft:f=a,rx:h,ry:d}=n;super(t,{x1:{value:r,scale:"x",type:r!=null&&o==null?"band":void 0,optional:!0},y1:{value:i,scale:"y",type:i!=null&&s==null?"band":void 0,optional:!0},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,IY),this.insetTop=At(c),this.insetRight=At(l),this.insetBottom=At(u),this.insetLeft=At(f),this.rx=se(h,"auto"),this.ry=se(d,"auto")}render(t,n,r,i,o){let{x:s,y:a}=n,{x1:c,y1:l,x2:u,y2:f}=r,{marginTop:h,marginRight:d,marginBottom:p,marginLeft:m,width:g,height:y}=i,{projection:b}=o,{insetTop:x,insetRight:w,insetBottom:v,insetLeft:_,rx:M,ry:E}=this,N=(s?.bandwidth?s.bandwidth():0)-_-w,I=(a?.bandwidth?a.bandwidth():0)-x-v;return at("svg:g",o).call(Ot,this,i,o).call(_t,this,{},0,0).call(T=>T.selectAll().data(t).enter().append("rect").call(Tt,this).attr("x",c&&(b||!er(s))?u?O=>Math.min(c[O],u[O])+_:O=>c[O]+_:m+_).attr("y",l&&(b||!er(a))?f?O=>Math.min(l[O],f[O])+x:O=>l[O]+x:h+x).attr("width",c&&(b||!er(s))?u?O=>Math.max(0,Math.abs(u[O]-c[O])+N):N:g-d-m-w-_).attr("height",l&&(b||!er(a))?f?O=>Math.max(0,Math.abs(l[O]-f[O])+I):I:y-h-p-x-v).call(ut,"rx",M).call(ut,"ry",E).call(Xt,this,r)).node()}};function xm(e,t){return new bl(e,YI(WI(t)))}function Af(e,t={}){return Wu(t)||(t={...t,y:ve,x2:W,interval:1}),new bl(e,_f(WI(xf(t))))}function Tf(e,t={}){return Wu(t)||(t={...t,x:ve,y2:W,interval:1}),new bl(e,vf(YI(wf(t))))}function hM(e,t){t=MY(t);let{x:n,y:r,color:i,size:o}=t,s=K1(e,n),a=K1(e,r),c=K1(e,i),l=K1(e,o),{fx:u,fy:f,x:{value:h,reduce:d,zero:p,...m},y:{value:g,reduce:y,zero:b,...x},color:{value:w,color:v,reduce:_},size:{value:M,reduce:E},mark:N}=t;if(d===void 0&&(d=y==null&&h==null&&M==null&&g!=null?"count":null),y===void 0&&(y=d==null&&g==null&&M==null&&h!=null?"count":null),E===void 0&&M==null&&_==null&&d==null&&y==null&&(h==null||Se(s))&&(g==null||Se(a))&&(E="count"),p===void 0&&(p=Q1(d)?!0:void 0),b===void 0&&(b=Q1(y)?!0:void 0),h==null&&g==null)throw new Error("must specify x or y");if(d!=null&&g==null)throw new Error("reducing x requires y");if(y!=null&&h==null)throw new Error("reducing y requires x");N===void 0&&(N=M!=null||E!=null?"dot":Q1(d)||Q1(y)||_!=null?"bar":h!=null&&g!=null?Se(s)||Se(a)||d==null&&y==null&&!wm(s)&&!wm(a)?"dot":"line":h!=null||g!=null?"rule":null);let I,T,O;switch(N){case"dot":O=ni,T="stroke";break;case"line":O=s&&a||d!=null||y!=null?b||y!=null||s&&wm(s)?Wa:p||d!=null||a&&wm(a)?Ya:gl:s?Ya:Wa,T="stroke",PO(c)&&(I=null);break;case"area":O=!(b||y!=null)&&(p||d!=null||a&&wm(a))?Va:$s,T="fill",PO(c)&&(I=null);break;case"rule":O=s?Cr:Lr,T="stroke";break;case"bar":O=d!=null?Se(a)?$O(d)&&s&&Se(s)?ja:Ao:Af:y!=null?Se(s)?$O(y)&&a&&Se(a)?ja:To:Tf:_!=null||E!=null?s&&Se(s)&&a&&Se(a)?ja:s&&Se(s)?To:a&&Se(a)?Ao:xm:s&&Ns(s)&&!(a&&Ns(a))?Ao:a&&Ns(a)&&!(s&&Ns(s))?To:ja,T="fill";break;default:throw new Error(`invalid mark: ${N}`)}let B={fx:u,fy:f,x:s??void 0,y:a??void 0,[T]:c??v,z:I,r:l??void 0,tip:!0},S,A={[T]:_??void 0,r:E??void 0};if(d!=null&&y!=null)throw new Error("cannot reduce both x and y");return y!=null?(A.y=y,S=Se(s)?La:Io):d!=null?(A.x=d,S=Se(a)?ka:Mo):(_!=null||E!=null)&&(s&&a?S=Se(s)&&Se(a)?Xp:Se(s)?Mo:Se(a)?Io:Rs:s?S=Se(s)?La:Io:a&&(S=Se(a)?ka:Mo)),(S===Rs||S===Io)&&(B.x={value:s,...m}),(S===Rs||S===Mo)&&(B.y={value:a,...x}),p===void 0&&(p=s&&!(S===Rs||S===Io)&&(O===Ao||O===Va||O===Af||O===Lr)),b===void 0&&(b=a&&!(S===Rs||S===Mo)&&(O===To||O===$s||O===Tf||O===Cr)),{fx:u??null,fy:f??null,x:{value:h??null,reduce:d??null,zero:!!p,...m},y:{value:g??null,reduce:y??null,zero:!!b,...x},color:{value:w??null,reduce:_??null,...v!==void 0&&{color:v}},size:{value:M??null,reduce:E??null},mark:N,markImpl:UO[O],markOptions:B,transformImpl:UO[S],transformOptions:A,colorMode:T}}function zO(e,t){let n=hM(e,t),{fx:r,fy:i,x:{zero:o},y:{zero:s},markOptions:a,transformOptions:c,colorMode:l}=n,u=fM[n.markImpl],f=fM[n.transformImpl],h=r!=null||i!=null?yf({strokeOpacity:.1}):null,d=[o?Cr([0]):null,s?Lr([0]):null],p=u(e,f?f(c,a):a);return l==="stroke"?Ze(h,d,p):Ze(h,p,d)}function wm(e){let t,n;for(let r of e){if(r==null)continue;if(t===void 0){t=r;continue}let i=Math.sign($t(t,r));if(i){if(n!==void 0&&i!==n)return!1;t=r,n=i}}return!0}function MY({x:e,y:t,color:n,size:r,fx:i,fy:o,mark:s}={}){return Br(e)||(e=Ef(e)),Br(t)||(t=Ef(t)),Br(n)||(n=Fa(n)?{color:n}:Ef(n)),Br(r)||(r=Ef(r)),Br(i)&&({value:i}=Ef(i)),Br(o)&&({value:o}=Ef(o)),s!=null&&(s=`${s}`.toLowerCase()),{x:e,y:t,color:n,size:r,fx:i,fy:o,mark:s}}function K1(e,t){let n=dt(e,t.value);return n&&(n.label=Mn(t.value)),n}function Ef(e){return AY(e)?{reduce:e}:{value:e}}function Q1(e){return/^(?:distinct|count|sum|proportion)$/i.test(e)}function $O(e){return/^(?:first|last|mode)$/i.test(e)}function AY(e){if(e==null)return!1;if(typeof e.reduceIndex=="function"||typeof e.reduce=="function"&&cn(e)||/^p\d{2}$/i.test(e))return!0;switch(`${e}`.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 PO(e){return e?new Vn(e).size>e.length>>1:!1}var fM={dot:ni,line:gl,lineX:Ya,lineY:Wa,areaX:Va,areaY:$s,ruleX:Cr,ruleY:Lr,barX:Ao,barY:To,rect:xm,rectX:Af,rectY:Tf,cell:ja,bin:Rs,binX:Io,binY:Mo,group:Xp,groupX:La,groupY:ka},UO=Object.fromEntries(Object.entries(fM).map(([e,t])=>[t,e]));function Df(e,t={}){let{x:n,x1:r,x2:i}=t;n===void 0&&r===void 0&&i===void 0&&(t={...t,x:n=W});let o={};return n!=null&&(o.x=e),r!=null&&(o.x1=e),i!=null&&(o.x2=e),dr(o,t)}function Nf(e,t={}){let{y:n,y1:r,y2:i}=t;n===void 0&&r===void 0&&i===void 0&&(t={...t,y:n=W});let o={};return n!=null&&(o.y=e),r!=null&&(o.y1=e),i!=null&&(o.y2=e),dr(o,t)}function dr(e={},t={}){let n=kn(t),r=Object.entries(e).map(([i,o])=>{let s=Xx(i,t);if(s==null)throw new Error(`missing channel: ${i}`);let[a,c]=ln(s);return{key:i,input:s,output:a,setOutput:c,map:TY(o)}});return{...un(t,(i,o)=>{let s=dt(i,n),a=r.map(({input:l})=>dt(i,l)),c=r.map(({setOutput:l})=>l(new Array(i.length)));for(let l of o)for(let u of s?en(l,f=>s[f]).values():[l])r.forEach(({map:f},h)=>f.mapIndex(u,a[h],c[h]));return{data:i,facets:o}}),...Object.fromEntries(r.map(({key:i,output:o})=>[i,o]))}}function TY(e){if(e==null)throw new Error("missing map");if(typeof e.mapIndex=="function")return e;if(typeof e.map=="function"&&cn(e))return EY(e);if(typeof e=="function")return dM(Gu(e));switch(`${e}`.toLowerCase()){case"cumsum":return NY;case"rank":return dM((t,n)=>ud(t,r=>n[r]));case"quantile":return dM((t,n)=>DY(t,r=>n[r]))}throw new Error(`invalid map: ${e}`)}function EY(e){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:e.map.bind(e)}}function DY(e,t){let n=Hi(e,t)-1;return ud(e,t).map(r=>r/n)}function dM(e){return{mapIndex(t,n,r){let i=e(t,n);if(i.length!==t.length)throw new Error("map function returned a mismatched length");for(let o=0,s=t.length;o<s;++o)r[t[o]]=i[o]}}}var NY={mapIndex(e,t,n){let r=0;for(let i of e)n[i]=r+=t[i]}};function qO(e={},t){return arguments.length===1&&(t=e),Df(Of(e),t)}function VO(e={},t){return arguments.length===1&&(t=e),Nf(Of(e),t)}function Of(e={}){typeof e=="number"&&(e={k:e});let{k:t,reduce:n,shift:r,anchor:i,strict:o}=e;if(i===void 0&&r!==void 0&&(i=BY(r),Rn(`Warning: the shift option is deprecated; please use anchor "${i}" instead.`)),!((t=Math.floor(t))>0))throw new Error(`invalid k: ${t}`);return FY(n)(t,OY(i,t),o)}function OY(e="middle",t){switch(`${e}`.toLowerCase()){case"middle":return t-1>>1;case"start":return 0;case"end":return t-1}throw new Error(`invalid anchor: ${e}`)}function BY(e){switch(`${e}`.toLowerCase()){case"centered":return"middle";case"leading":return"start";case"trailing":return"end"}throw new Error(`invalid shift: ${e}`)}function FY(e="mean"){if(typeof e=="string"){if(/^p\d{2}$/i.test(e))return J1(Yu(e));switch(e.toLowerCase()){case"deviation":return J1(Vr);case"max":return tw((t,n)=>Vt(t,r=>n[r]));case"mean":return CY;case"median":return J1(Ai);case"min":return tw((t,n)=>oe(t,r=>n[r]));case"mode":return tw((t,n)=>eu(t,r=>n[r]));case"sum":return jO;case"variance":return J1(la);case"difference":return RY;case"ratio":return $Y;case"first":return PY;case"last":return UY}}if(typeof e!="function")throw new Error(`invalid reduce: ${e}`);return tw(Gu(e))}function J1(e){return(t,n,r)=>r?{mapIndex(i,o,s){let a=l=>o[l]==null?NaN:+o[l],c=0;for(let l=0;l<t-1;++l)isNaN(a(l))&&++c;for(let l=0,u=i.length-t+1;l<u;++l)isNaN(a(l+t-1))&&++c,s[i[l+n]]=c===0?e(Es(i,l,l+t),a):NaN,isNaN(a(l))&&--c}}:{mapIndex(i,o,s){let a=c=>o[c]==null?NaN:+o[c];for(let c=-n;c<0;++c)s[i[c+n]]=e(Es(i,0,c+t),a);for(let c=0,l=i.length-n;c<l;++c)s[i[c+n]]=e(Es(i,c,c+t),a)}}}function tw(e){return(t,n,r)=>r?{mapIndex(i,o,s){let a=0;for(let c=0;c<t-1;++c)a+=Re(o[i[c]]);for(let c=0,l=i.length-t+1;c<l;++c)a+=Re(o[i[c+t-1]]),a===t&&(s[i[c+n]]=e(Es(i,c,c+t),o)),a-=Re(o[i[c]])}}:{mapIndex(i,o,s){for(let a=-n;a<0;++a)s[i[a+n]]=e(Es(i,0,a+t),o);for(let a=0,c=i.length-n;a<c;++a)s[i[a+n]]=e(Es(i,a,a+t),o)}}}function jO(e,t,n){return n?{mapIndex(r,i,o){let s=0,a=0;for(let c=0;c<e-1;++c){let l=i[r[c]];l===null||isNaN(l)?++s:a+=+l}for(let c=0,l=r.length-e+1;c<l;++c){let u=i[r[c]],f=i[r[c+e-1]];f===null||isNaN(f)?++s:a+=+f,o[r[c+t]]=s===0?a:NaN,u===null||isNaN(u)?--s:a-=+u}}}:{mapIndex(r,i,o){let s=0,a=r.length;for(let c=0,l=Math.min(a,e-t-1);c<l;++c)s+=+i[r[c]]||0;for(let c=-t,l=a-t;c<l;++c)s+=+i[r[c+e-1]]||0,o[r[c+t]]=s,s-=+i[r[c]]||0}}}function CY(e,t,n){if(n){let r=jO(e,t,n);return{mapIndex(i,o,s){r.mapIndex(i,o,s);for(let a=0,c=i.length-e+1;a<c;++a)s[i[a+t]]/=e}}}else return{mapIndex(r,i,o){let s=0,a=0,c=r.length;for(let l=0,u=Math.min(c,e-t-1);l<u;++l){let f=i[r[l]];f!==null&&!isNaN(f=+f)&&(s+=f,++a)}for(let l=-t,u=c-t;l<u;++l){let f=i[r[l+e-1]],h=i[r[l]];f!==null&&!isNaN(f=+f)&&(s+=f,++a),o[r[l+t]]=s/a,h!==null&&!isNaN(h=+h)&&(s-=h,--a)}}}}function LY(e,t,n,r){for(let i=n+r;n<i;++n){let o=e[t[n]];if(Re(o))return o}}function kY(e,t,n,r){for(let i=n+r-1;i>=n;--i){let o=e[t[i]];if(Re(o))return o}}function YO(e,t,n,r){for(let i=n+r;n<i;++n){let o=e[t[n]];if(o!==null&&!isNaN(o=+o))return o}}function WO(e,t,n,r){for(let i=n+r-1;i>=n;--i){let o=e[t[i]];if(o!==null&&!isNaN(o=+o))return o}}function RY(e,t,n){return n?{mapIndex(r,i,o){for(let s=0,a=r.length-e;s<a;++s){let c=i[r[s]],l=i[r[s+e-1]];o[r[s+t]]=c===null||l===null?NaN:l-c}}}:{mapIndex(r,i,o){for(let s=-t,a=r.length-e+t+1;s<a;++s)o[r[s+t]]=WO(i,r,s,e)-YO(i,r,s,e)}}}function $Y(e,t,n){return n?{mapIndex(r,i,o){for(let s=0,a=r.length-e;s<a;++s){let c=i[r[s]],l=i[r[s+e-1]];o[r[s+t]]=c===null||l===null?NaN:l/c}}}:{mapIndex(r,i,o){for(let s=-t,a=r.length-e+t+1;s<a;++s)o[r[s+t]]=WO(i,r,s,e)/YO(i,r,s,e)}}}function PY(e,t,n){return n?{mapIndex(r,i,o){for(let s=0,a=r.length-e;s<a;++s)o[r[s+t]]=i[r[s]]}}:{mapIndex(r,i,o){for(let s=-t,a=r.length-e+t+1;s<a;++s)o[r[s+t]]=LY(i,r,s,e)}}}function UY(e,t,n){return n?{mapIndex(r,i,o){for(let s=0,a=r.length-e;s<a;++s)o[r[s+t]]=i[r[s+e-1]]}}:{mapIndex(r,i,o){for(let s=-t,a=r.length-e+t+1;s<a;++s)o[r[s+t]]=kY(i,r,s,e)}}}var Ps={n:20,k:2,color:"currentColor",opacity:.2,strict:!0,anchor:"end"};function GO(e,{x:t=W,y:n,k:r=Ps.k,color:i=Ps.color,opacity:o=Ps.opacity,fill:s=i,fillOpacity:a=o,stroke:c=i,strokeOpacity:l,strokeWidth:u,...f}={}){return Ze(Jt(s)?null:Va(e,dr({x1:Ga({k:-r,...f}),x2:Ga({k:r,...f})},{x1:t,x2:t,y:n,fill:s,fillOpacity:a,...f})),Jt(c)?null:Ya(e,dr({x:Ga(f)},{x:t,y:n,stroke:c,strokeOpacity:l,strokeWidth:u,...f})))}function XO(e,{x:t,y:n=W,k:r=Ps.k,color:i=Ps.color,opacity:o=Ps.opacity,fill:s=i,fillOpacity:a=o,stroke:c=i,strokeOpacity:l,strokeWidth:u,...f}={}){return Ze(Jt(s)?null:$s(e,dr({y1:Ga({k:-r,...f}),y2:Ga({k:r,...f})},{x:t,y1:n,y2:n,fill:s,fillOpacity:a,...f})),Jt(c)?null:Wa(e,dr({y:Ga(f)},{x:t,y:n,stroke:c,strokeOpacity:l,strokeWidth:u,...f})))}function Ga({n:e=Ps.n,k:t=0,strict:n=Ps.strict,anchor:r=Ps.anchor}={}){return Of({k:e,reduce:i=>ss(i)+t*(Vr(i)||0),strict:n,anchor:r})}var zY={ariaLabel:"tick",fill:null,stroke:"currentColor"},ew=class extends xt{constructor(t,n,r){super(t,n,r,zY),Fi(this,r)}render(t,n,r,i,o){return at("svg:g",o).call(Ot,this,i,o).call(this._transform,this,n).call(s=>s.selectAll().data(t).enter().append("line").call(Tt,this).attr("x1",this._x1(n,r,i)).attr("x2",this._x2(n,r,i)).attr("y1",this._y1(n,r,i)).attr("y2",this._y2(n,r,i)).call(Xt,this,r).call(ks,this,r,o)).node()}},_m=class extends ew{constructor(t,n={}){let{x:r,y:i,inset:o=0,insetTop:s=o,insetBottom:a=o}=n;super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y",type:"band",optional:!0}},n),this.insetTop=At(s),this.insetBottom=At(a)}_transform(t,n,{x:r}){t.call(_t,n,{x:r},Ee,0)}_x1(t,{x:n}){return r=>n[r]}_x2(t,{x:n}){return r=>n[r]}_y1({y:t},{y:n},{marginTop:r}){let{insetTop:i}=this;return n&&t?o=>n[o]+i:r+i}_y2({y:t},{y:n},{height:r,marginBottom:i}){let{insetBottom:o}=this;return n&&t?s=>n[s]+t.bandwidth()-o:r-i-o}},vm=class extends ew{constructor(t,n={}){let{x:r,y:i,inset:o=0,insetRight:s=o,insetLeft:a=o}=n;super(t,{y:{value:i,scale:"y"},x:{value:r,scale:"x",type:"band",optional:!0}},n),this.insetRight=At(s),this.insetLeft=At(a)}_transform(t,n,{y:r}){t.call(_t,n,{y:r},0,Ee)}_x1({x:t},{x:n},{marginLeft:r}){let{insetLeft:i}=this;return n&&t?o=>n[o]+i:r+i}_x2({x:t},{x:n},{width:r,marginRight:i}){let{insetRight:o}=this;return n&&t?s=>n[s]+t.bandwidth()-o:r-i-o}_y1(t,{y:n}){return r=>n[r]}_y2(t,{y:n}){return r=>n[r]}};function nw(e,{x:t=W,...n}={}){return new _m(e,{...n,x:t})}function rw(e,{y:t=W,...n}={}){return new vm(e,{...n,y:t})}function HO(e,{x:t=W,y:n=null,fill:r="#ccc",fillOpacity:i,stroke:o="currentColor",strokeOpacity:s,strokeWidth:a=2,sort:c,...l}={}){let u=n!=null?ka:Gp;return Ze(Lr(e,u({x1:pM,x2:mM},{x:t,y:n,stroke:o,strokeOpacity:s,...l})),Ao(e,u({x1:"p25",x2:"p75"},{x:t,y:n,fill:r,fillOpacity:i,...l})),nw(e,u({x:"p50"},{x:t,y:n,stroke:o,strokeOpacity:s,strokeWidth:a,sort:c,...l})),ni(e,dr({x:KO},{x:t,y:n,z:n,stroke:o,strokeOpacity:s,...l})))}function ZO(e,{y:t=W,x:n=null,fill:r="#ccc",fillOpacity:i,stroke:o="currentColor",strokeOpacity:s,strokeWidth:a=2,sort:c,...l}={}){let u=n!=null?La:Gp;return Ze(Cr(e,u({y1:pM,y2:mM},{x:n,y:t,stroke:o,strokeOpacity:s,...l})),To(e,u({y1:"p25",y2:"p75"},{x:n,y:t,fill:r,fillOpacity:i,...l})),rw(e,u({y:"p50"},{x:n,y:t,stroke:o,strokeOpacity:s,strokeWidth:a,sort:c,...l})),ni(e,dr({y:KO},{x:n,y:t,z:n,stroke:o,strokeOpacity:s,...l})))}function KO(e){let t=pM(e),n=mM(e);return e.map(r=>r<t||r>n?r:NaN)}function pM(e){let t=QO(e)*2.5-JO(e)*1.5;return oe(e,n=>n>=t?n:NaN)}function mM(e){let t=JO(e)*2.5-QO(e)*1.5;return Vt(e,n=>n<=t?n:NaN)}function QO(e){return jn(e,.25)}function JO(e){return jn(e,.75)}var qY={ariaLabel:"raster",stroke:null,pixelSize:1};function Bf(e,t){let n=+e;if(isNaN(n))throw new Error(`invalid ${t}: ${e}`);return n}function tB(e,t){let n=Math.floor(e);if(isNaN(n))throw new Error(`invalid ${t}: ${e}`);return n}var Im=class extends xt{constructor(t,n,r={},i){let{width:o,height:s,x:a,y:c,x1:l=a==null?0:void 0,y1:u=c==null?0:void 0,x2:f=a==null?o:void 0,y2:h=c==null?s:void 0,pixelSize:d=i.pixelSize,blur:p=0,interpolate:m}=r;if(o!=null&&(o=tB(o,"width")),s!=null&&(s=tB(s,"height")),l!=null&&(l=Bf(l,"x1")),u!=null&&(u=Bf(u,"y1")),f!=null&&(f=Bf(f,"x2")),h!=null&&(h=Bf(h,"y2")),a==null&&(l==null||f==null))throw new Error("missing x");if(c==null&&(u==null||h==null))throw new Error("missing y");t!=null&&o!=null&&s!=null&&(a===void 0&&l!=null&&f!=null&&(a=ZY(l,f,o,s)),c===void 0&&u!=null&&h!=null&&(c=KY(u,h,o,s))),super(t,{x:{value:a,scale:"x",optional:!0},y:{value:c,scale:"y",optional:!0},x1:{value:l==null?null:[l],scale:"x",optional:!0,filter:null},y1:{value:u==null?null:[u],scale:"y",optional:!0,filter:null},x2:{value:f==null?null:[f],scale:"x",optional:!0,filter:null},y2:{value:h==null?null:[h],scale:"y",optional:!0,filter:null},...n},r,i),this.width=o,this.height=s,this.pixelSize=Bf(d,"pixelSize"),this.blur=Bf(p,"blur"),this.interpolate=a==null||c==null?null:VY(m)}},Mm=class extends Im{constructor(t,n={}){let{imageRendering:r}=n;if(t==null){let{fill:i,fillOpacity:o}=n;ee(o)[0]!==void 0&&(n=iw("fillOpacity",n)),Ae(i)[0]!==void 0&&(n=iw("fill",n))}super(t,void 0,n,qY),this.imageRendering=se(r,"auto")}scale(t,{color:n,...r},i){return super.scale(t,r,i)}render(t,n,r,i,o){let s=n[r.channels.fill?.scale]??(A=>A),{x:a,y:c}=r,{document:l}=o,[u,f,h,d]=nB(r,i,o),p=h-u,m=d-f,{pixelSize:g,width:y=Math.round(Math.abs(p)/g),height:b=Math.round(Math.abs(m)/g)}=this,x=y*b,{fill:w,fillOpacity:v}=r,_=0;if(this.interpolate){let A=y/p,D=b/m,C=qt(a,L=>(L-u)*A,Float64Array),k=qt(c,L=>(L-f)*D,Float64Array);w&&(w=this.interpolate(t,y,b,C,k,w)),v&&(v=this.interpolate(t,y,b,C,k,v))}else this.data==null&&t&&(_=t.fi*x);let M=l.createElement("canvas");M.width=y,M.height=b;let E=M.getContext("2d"),N=E.createImageData(y,b),I=N.data,{r:T,g:O,b:B}=Je(this.fill)??{r:0,g:0,b:0},S=(this.fillOpacity??1)*255;for(let A=0;A<x;++A){let D=A<<2;if(w){let C=s(w[A+_]);if(C==null){I[D+3]=0;continue}({r:T,g:O,b:B}=Je(C))}v&&(S=v[A+_]*255),I[D+0]=T,I[D+1]=O,I[D+2]=B,I[D+3]=S}return this.blur>0&&G_(N,this.blur),E.putImageData(N,0,0),at("svg:g",o).call(Ot,this,i,o).call(_t,this,n).call(A=>A.append("image").attr("transform",`translate(${u},${f}) scale(${Math.sign(h-u)},${Math.sign(d-f)})`).attr("width",Math.abs(p)).attr("height",Math.abs(m)).attr("preserveAspectRatio","none").call(ut,"image-rendering",this.imageRendering).call(Tt,this).attr("xlink:href",M.toDataURL())).node()}};function yM(e,t,n){arguments.length<3&&(n=t,t=null);let{x:r,y:i,[e]:o,...s}=n;return r===void 0&&i===void 0&&BD(t)&&(r=Ts,i=Na,o===void 0&&(o=TD)),[t,{...s,x:r,y:i,[e]:o}]}function eB(){let[e,t]=yM("fill",...arguments);return new Mm(e,e==null||t.fill!==void 0||t.fillOpacity!==void 0?t:{...t,fill:W})}function nB({x1:e,y1:t,x2:n,y2:r},i,{projection:o}){let{width:s,height:a,marginTop:c,marginRight:l,marginBottom:u,marginLeft:f}=i;return[e&&o==null?e[0]:f,t&&o==null?t[0]:c,n&&o==null?n[0]:s-l,r&&o==null?r[0]:a-u]}function gM({x1:e,y1:t,x2:n,y2:r},i,o,s){let a={};return e&&(a.x1=e),t&&(a.y1=t),n&&(a.x2=n),r&&(a.y2=r),nB(tf(a,i),o,s)}function iw(e,t={}){let{[e]:n}=t;if(typeof n!="function")throw new Error(`invalid ${e}: not a function`);return xe({...t,[e]:void 0},function(r,i,o,s,a,c){let{x:l,y:u}=s;if(!l)throw new Error("missing scale: x");if(!u)throw new Error("missing scale: y");let[f,h,d,p]=gM(o,s,a,c),m=d-f,g=p-h,{pixelSize:y}=this,{width:b=Math.round(Math.abs(m)/y),height:x=Math.round(Math.abs(g)/y)}=t,w=new Array(b*x*(i?i.length:1)),v=m/b,_=g/x,M=0;for(let E of i??[void 0])for(let N=.5;N<x;++N)for(let I=.5;I<b;++I,++M)w[M]=n(l.invert(f+I*v),u.invert(h+N*_),E);return{data:w,facets:i,channels:{[e]:{value:w,scale:"auto"}}}})}function VY(e){if(typeof e=="function")return e;if(e==null)return ow;switch(`${e}`.toLowerCase()){case"none":return ow;case"nearest":return xM;case"barycentric":return bM();case"random-walk":return wM()}throw new Error(`invalid interpolate: ${e}`)}function ow(e,t,n,r,i,o){let s=new Array(t*n);for(let a of e)r[a]<0||r[a]>=t||i[a]<0||i[a]>=n||(s[Math.floor(i[a])*t+Math.floor(r[a])]=o[a]);return s}function bM({random:e=qc(42)}={}){return(t,n,r,i,o,s)=>{let{points:a,triangles:c,hull:l}=Gr.from(t,d=>i[d],d=>o[d]),u=new s.constructor(n*r).fill(NaN),f=new Uint8Array(n*r),h=HY(s,e);for(let d=0;d<c.length;d+=3){let p=c[d],m=c[d+1],g=c[d+2],y=a[2*p],b=a[2*m],x=a[2*g],w=a[2*p+1],v=a[2*m+1],_=a[2*g+1],M=Math.min(y,b,x),E=Math.max(y,b,x),N=Math.min(w,v,_),I=Math.max(w,v,_),T=(v-_)*(y-x)+(w-_)*(x-b);if(!T)continue;let O=s[t[p]],B=s[t[m]],S=s[t[g]];for(let A=Math.floor(M);A<E;++A)for(let D=Math.floor(N);D<I;++D){if(A<0||A>=n||D<0||D>=r)continue;let C=A+.5,k=D+.5,L=((v-_)*(C-x)+(k-_)*(x-b))/T;if(L<0)continue;let R=((_-w)*(C-x)+(k-_)*(y-x))/T;if(R<0)continue;let $=1-L-R;if($<0)continue;let P=A+n*D;u[P]=h(O,L,B,R,S,$,A,D),f[P]=1}}return jY(u,f,i,o,s,n,r,l,t,h),u}}function jY(e,t,n,r,i,o,s,a,c,l){n=Float64Array.from(a,d=>n[c[d]]),r=Float64Array.from(a,d=>r[c[d]]),i=Array.from(a,d=>i[c[d]]);let u=n.length,f=Array.from({length:u},(d,p)=>WY(p,n,r)),h=0;for(let d=0;d<s;++d){let p=d+.5;for(let m=0;m<o;++m){let g=m+o*d;if(!t[g]){let y=m+.5;for(let b=0;b<u;++b){let x=(u+h+(b%2?(b+1)/2:-b/2))%u;if(f[x](y,p)){let w=YY(n.at(x-1),r.at(x-1),n[x],r[x],y,p);e[g]=l(i.at(x-1),w,i[x],1-w,i[x],0,m,d),h=x;break}}}}}}function YY(e,t,n,r,i,o){let s=n-e,a=r-t,c=s*(n-i)+a*(r-o),l=s*(i-e)+a*(o-t);return c>0&&l>0?c/(c+l):+(c>l)}function Sm(e,t,n,r){return e*r-n*t}function WY(e,t,n){let r=t.length,i=t.at(e-2),o=n.at(e-2),s=t.at(e-1),a=n.at(e-1),c=t[e],l=n[e],u=t.at(e+1-r),f=n.at(e+1-r),h=s-c,d=a-l,p=i-s,m=o-a,g=c-u,y=l-f,b=Math.hypot(h,d),x=Math.hypot(p,m),w=Math.hypot(g,y);return(v,_)=>{let M=v-s,E=_-a,N=v-c,I=_-l;return Sm(M,E,N,I)>-1e-6&&Sm(M,E,h,d)*x-Sm(M,E,p,m)*b>-1e-6&&Sm(N,I,g,y)*b-Sm(N,I,h,d)*w<=0}}function xM(e,t,n,r,i,o){let s=new o.constructor(t*n),a=Gr.from(e,u=>r[u],u=>i[u]),c,l;for(let u=.5,f=0;u<n;++u){l=c;for(let h=.5;h<t;++h,++f)l=a.find(h,u,l),h===.5&&(c=l),s[f]=o[e[l]]}return s}function wM({random:e=qc(42),minDistance:t=.5,maxSteps:n=2}={}){return(r,i,o,s,a,c)=>{let l=new c.constructor(i*o),u=Gr.from(r,p=>s[p],p=>a[p]),f,h,d;for(let p=.5,m=0;p<o;++p){h=f;for(let g=.5;g<i;++g,++m){let y=g,b=p;d=h=u.find(y,b,h),g===.5&&(f=h);let x,w=0;for(;(x=Math.hypot(s[r[d]]-y,a[r[d]]-b))>t&&w<n;){let v=e(g,p,w)*2*Math.PI;y+=Math.cos(v)*x,b+=Math.sin(v)*x,d=u.find(y,b,d),++w}l[m]=c[r[d]]}}return l}}function GY(e,t,n,r,i,o){return t*e+r*n+o*i}function XY(e){return(t,n,r,i,o,s,a,c)=>{let l=e(a,c);return l<n?t:l<n+i?r:o}}function HY(e,t){return Ns(e)||Te(e)?GY:XY(t)}function ZY(e,t,n){return{transform(r){let i=r.length,o=new Float64Array(i),s=(t-e)/n,a=e+s/2;for(let c=0;c<i;++c)o[c]=c%n*s+a;return o}}}function KY(e,t,n,r){return{transform(i){let o=i.length,s=new Float64Array(o),a=(t-e)/r,c=e+a/2;for(let l=0;l<o;++l)s[l]=Math.floor(l/n)%r*a+c;return s}}}var rB={ariaLabel:"contour",fill:"none",stroke:"currentColor",strokeMiterlimit:1,pixelSize:2},Am=class extends Im{constructor(t,{smooth:n=!0,value:r,...i}={}){let o=c1({},i,rB);if(r===void 0){for(let a in o)if(o[a].value!=null){if(r!==void 0)throw new Error("ambiguous contour value");r=i[a],i[a]="value"}}if(r!=null){let a={transform:c=>c.map(l=>l.value),label:Mn(r)};for(let c in o)i[c]==="value"&&(i[c]=a)}if(t==null){if(r==null)throw new Error("missing contour value");i=iw("value",{value:r,...i}),r=null}else{let{interpolate:a}=i;r===void 0&&(r=W),a===void 0&&(i.interpolate="nearest")}super(t,{value:{value:r,optional:!0}},QY(i),rB);let s={geometry:{value:W}};for(let a in this.channels){let c=this.channels[a],{scale:l}=c;l==="x"||l==="y"||a==="value"||(s[a]=c,delete this.channels[a])}this.contourChannels=s,this.smooth=!!n}filter(t,{x:n,y:r,value:i,...o},s){return super.filter(t,o,s)}render(t,n,r,i,o){let{geometry:s}=r,a=vn();return at("svg:g",o).call(Ot,this,i,o).call(_t,this,n).call(c=>{c.selectAll().data(t).enter().append("path").call(Tt,this).attr("d",l=>a(s[l])).call(Xt,this,r)}).node()}};function QY({thresholds:e,interval:t,...n}){return e=aM(e,t,ua),xe(n,function(r,i,o,s,a,c){let[l,u,f,h]=gM(o,s,a,c),d=f-l,p=h-u,{pixelSize:m,width:g=Math.round(Math.abs(d)/m),height:y=Math.round(Math.abs(p)/m)}=this,b=g/d,x=y/p,w=o.value.value,v=[];if(this.interpolate){let{x:I,y:T}=$a(o,s,c),O=qt(I,D=>(D-l)*b,Float64Array),B=qt(T,D=>(D-u)*x,Float64Array),S=[o.x,o.y,o.value],A=[O,B,w];for(let D of i){let C=this.filter(D,S,A);v.push(this.interpolate(C,g,y,O,B,w))}}else if(i){let I=g*y,T=i.length;for(let O=0;O<T;++O)v.push(w.slice(O*I,O*I+I))}else v.push(w);if(this.blur>0)for(let I of v)od({data:I,width:g,height:y},this.blur);let _=JY(e,w,...tW(v));if(_===null)throw new Error(`unsupported thresholds: ${e}`);let{contour:M}=ga().size([g,y]).smooth(this.smooth),E=[],N=[];for(let I of v)N.push(ke(E.length,E.push(...qt(_,T=>M(I,T)))));for(let{coordinates:I}of E)for(let T of I)for(let O of T)for(let B of O)B[0]=B[0]/b+l,B[1]=B[1]/x+u;return{data:E,facets:N,channels:o1(this.contourChannels,E)}})}function JY(e,t,n,r){if(typeof e?.range=="function")return e.range(e.floor(n),r);if(typeof e=="function"&&(e=e(t,n,r)),typeof e!="number")return Pe(e);let i=xn(...Jl(n,r,e),e);for(;i[i.length-1]>=r;)i.pop();for(;i[1]<n;)i.shift();return i}function oB(){return new Am(...yM("value",...arguments))}function tW(e){return[oe(e,t=>oe(t,iB)),Vt(e,t=>Vt(t,iB))]}function iB(e){return isFinite(e)?e:NaN}function cB(e,t){return _M(ff,e,t)}function lB(e,t={}){return _M(hf,e,t)}function uB(e,t={}){return _M(sl,e,t)}function _M(e,t,n={}){let{x:r,y:i,maxRadius:o}=n,s=e({px:r,py:i,maxRadius:o}),a=[];r!=null&&a.push(Cr(t,sB("x",{...s,inset:-6},n))),i!=null&&a.push(Lr(t,sB("y",{...s,inset:-6},n))),r!=null&&a.push(So(t,aB("x",{...s,dy:9,frameAnchor:"bottom",lineAnchor:"top"},n))),i!=null&&a.push(So(t,aB("y",{...s,dx:-9,frameAnchor:"left",textAnchor:"end"},n)));for(let c of a)c.ariaLabel=`crosshair ${c.ariaLabel}`;return Ze(...a)}function fB(e,{channels:t,...n},{facet:r,facetAnchor:i,fx:o,fy:s,[e]:a,channels:c,transform:l,initializer:u}){return{...n,facet:r,facetAnchor:i,fx:o,fy:s,[e]:a,channels:{...t,...c},transform:l,initializer:eW(e,u)}}function eW(e,t){return t==null?t:function(n,r,{x:i,y:o,px:s,py:a,...c},...l){let{channels:{x:u,y:f,...h}={},...d}=t.call(this,n,r,{...c,x:s,y:a},...l);return{channels:{...h,...u&&{px:u,...e==="x"&&{x:u}},...f&&{py:f,...e==="y"&&{y:f}}},...d}}}function sB(e,t,n){let{color:r="currentColor",opacity:i=.2,ruleStroke:o=r,ruleStrokeOpacity:s=i,ruleStrokeWidth:a}=n;return{...fB(e,t,n),stroke:o,strokeOpacity:s,strokeWidth:a}}function aB(e,t,n){let{color:r="currentColor",textFill:i=r,textFillOpacity:o,textStroke:s="var(--plot-background)",textStrokeOpacity:a,textStrokeWidth:c=5}=n;return{...fB(e,t,nW(e,n)),fill:i,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:c}}function nW(e,t){return xe(t,(n,r,i)=>({channels:{text:{value:Zp(i,e)?.value}}}))}var rW={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},iW={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},oW={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},sW={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},aW={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},vM=class extends xt{constructor(t,n={}){let{x:r,y:i,z:o,curve:s,tension:a}=n;super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:o,optional:!0}},n,rW),this.curve=fm(s,a),Fi(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,{curve:f}=this,[h,d]=fn(this,i),p=c?b=>c[b]:an(h),m=l?b=>l[b]:an(d),g=this;function y(b){let x=-1,w=[],v={};for(let S in r)v[S]=[];let _=[],M=[],E=[],N=[];function I(S,A){S=b[S],A=b[A],w.push(++x),_[x]=p(S),E[x]=m(S),M[x]=p(A),N[x]=m(A);for(let D in r)v[D].push(r[D][A])}let{halfedges:T,hull:O,triangles:B}=Gr.from(b,p,m);for(let S=0;S<T.length;++S){let A=T[S];A>S&&I(B[S],B[A])}for(let S=0;S<O.length;++S)I(O[S],O[(S+1)%O.length]);Pt(this).selectAll().data(w).enter().append("path").call(Tt,g).attr("d",S=>{let A=Gn(),D=f(A);return D.lineStart(),D.point(_[S],E[S]),D.point(M[S],N[S]),D.lineEnd(),A}).call(Xt,g,v).call(ks,g,v,o)}return at("svg:g",o).call(Ot,this,i,o).call(_t,this,{x:c&&s,y:l&&a}).call(u?b=>b.selectAll().data(en(t,x=>u[x]).values()).enter().append("g").each(y):b=>b.datum(t).each(y)).node()}},Tm=class extends xt{constructor(t,n={},r,i=({z:o})=>o){let{x:o,y:s}=n;super(t,{x:{value:o,scale:"x",optional:!0},y:{value:s,scale:"y",optional:!0},z:{value:i(n),optional:!0}},n,r)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,[f,h]=fn(this,i),d=c?y=>c[y]:an(f),p=l?y=>l[y]:an(h),m=this;function g(y){let b=Gr.from(y,d,p);Pt(this).append("path").datum(y[0]).call(Tt,m).attr("d",m._render(b,i)).call(Xt,m,r)}return at("svg:g",o).call(Ot,this,i,o).call(_t,this,{x:c&&s,y:l&&a}).call(u?y=>y.selectAll().data(en(t,b=>u[b]).values()).enter().append("g").each(g):y=>y.datum(t).each(g)).node()}},SM=class extends Tm{constructor(t,n={}){super(t,n,iW),this.fill="none"}_render(t){return t.render()}},IM=class extends Tm{constructor(t,n={}){super(t,n,oW,kn)}_render(t){return t.renderHull()}},MM=class extends xt{constructor(t,n={}){let{x:r,y:i,z:o}=n;super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:o,optional:!0}},n,sW)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,[f,h]=fn(this,i),d=c?y=>c[y]:an(f),p=l?y=>l[y]:an(h),m=this;function g(y){let b=Gr.from(y,d,p),x=hB(b,i);Pt(this).selectAll().data(y).enter().append("path").call(Tt,m).attr("d",(w,v)=>x.renderCell(v)).call(Xt,m,r)}return at("svg:g",o).call(Ot,this,i,o).call(_t,this,{x:c&&s,y:l&&a}).call(u?y=>y.selectAll().data(en(t,b=>u[b]).values()).enter().append("g").each(g):y=>y.datum(t).each(g)).node()}},AM=class extends Tm{constructor(t,n){super(t,n,aW),this.fill="none"}_render(t,n){return hB(t,n).render()}};function hB(e,t){let{width:n,height:r,marginTop:i,marginRight:o,marginBottom:s,marginLeft:a}=t;return e.voronoi([a,i,n-o,r-s])}function Em(e,t,{x:n,y:r,...i}={}){return[n,r]=Ce(n,r),new e(t,{...i,x:n,y:r})}function dB(e,t){return Em(vM,e,t)}function pB(e,t){return Em(SM,e,t)}function mB(e,t){return Em(IM,e,t)}function yB(e,t){return Em(MM,e,t)}function gB(e,t){return Em(AM,e,t)}var cW={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Dm=class extends xt{constructor(t,{x:n,y:r,z:i,weight:o,fill:s,stroke:a,...c}={}){let l=bB(s)&&(s="currentColor",!0),u=bB(a)&&(a="currentColor",!0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:kn({z:i,fill:s,stroke:a}),optional:!0},weight:{value:o,optional:!0}},uW({...c,fill:s,stroke:a},l,u),cW),l&&(this.fill=void 0),u&&(this.stroke=void 0),this.z=i}filter(t){return t}render(t,n,r,i,o){let{contours:s}=r,a=vn();return at("svg:g",o).call(Ot,this,i,o).call(_t,this,{}).call(c=>c.selectAll().data(t).enter().append("path").call(Tt,this).call(Xt,this,r).attr("d",l=>a(s[l]))).node()}};function xB(e,{x:t,y:n,...r}={}){return[t,n]=Ce(t,n),new Dm(e,{...r,x:t,y:n})}var lW=new Set(["x","y","z","weight"]);function uW(e,t,n){let{bandwidth:i,thresholds:o}=e;return i=i===void 0?20:+i,o=o===void 0?20:typeof o?.[Symbol.iterator]=="function"?Xe(o):+o,xe(e,function(s,a,c,l,u,f){let h=c.weight?Xe(c.weight.value):null,d=c.z?.value,{z:p}=this,[m,g]=fn(this,u),{width:y,height:b}=u,{x,y:w}=$a(c,l,f),v=Object.fromEntries(Object.entries(c).filter(([B])=>!lW.has(B)).map(([B,S])=>[B,{...S,value:[]}])),_=t&&[],M=n&&[],E=Lv().x(x?B=>x[B]:m).y(w?B=>w[B]:g).weight(h?B=>h[B]:1).size([y,b]).bandwidth(i),N=[];for(let B of a){let S=[];N.push(S);for(let A of d?Qp(B,d,p):[B]){let D=E.contours(A);S.push([A,D])}}let I=o;if(!(I instanceof tl)){let B=0;for(let S of N)for(let[,A]of S){let D=A.max;D>B&&(B=D)}I=Float64Array.from({length:o-1},(S,A)=>B*100*(A+1)/o)}let T=[],O=[];for(let B of N){let S=[];T.push(S);for(let[A,D]of B)for(let C of I){S.push(O.length),O.push(D(C/100)),_&&_.push(C),M&&M.push(C);for(let k in v)v[k].value.push(c[k].value[A[0]])}}return _&&_.push(0),M&&M.push(0),{data:s,facets:T,channels:{...v,..._&&{fill:{value:_,scale:"color"}},...M&&{stroke:{value:M,scale:"color"}},contours:{value:O}}}})}function bB(e){return/^density$/i.test(e)}function vB(e,{x1:t,x2:n,y1:r,y2:i,x:o=t===void 0&&n===void 0?ve:void 0,y:s=r===void 0&&i===void 0?W:void 0,fill:a,positiveFill:c="#3ca951",negativeFill:l="#4269d0",fillOpacity:u=1,positiveFillOpacity:f=u,negativeFillOpacity:h=u,stroke:d,strokeOpacity:p,z:m=Ae(d)[0],clip:g,tip:y,render:b,...x}={}){return[t,n]=wB(o,t,n),[r,i]=wB(s,r,i),t===n&&r===i&&(r=Xa(0)),{tip:y}=Bi({tip:y},"x"),Ze(Jt(c)?null:Object.assign(hm(e,{x1:t,x2:n,y1:r,y2:i,z:m,fill:c,fillOpacity:f,render:uf(b,_B(!0)),clip:g,...x}),{ariaLabel:"positive difference"}),Jt(l)?null:Object.assign(hm(e,{x1:t,x2:n,y1:r,y2:i,z:m,fill:l,fillOpacity:h,render:uf(b,_B(!1)),clip:g,...x}),{ariaLabel:"negative difference"}),gl(e,{x:n,y:i,z:m,stroke:d,strokeOpacity:p,tip:y,clip:!0,...x}))}function wB(e,t,n){return t===void 0&&n===void 0?t=n=Xa(e):t===void 0?(n=Xa(n),t=e===void 0?n:Xa(e)):n===void 0?(t=Xa(t),n=e===void 0?t:Xa(e)):(t=Xa(t),n=Xa(n)),[t,n]}function Xa(e){let t,{value:n,label:r=Mn(n)}=ti(e);return{transform:i=>t||(t=dt(i,n)),label:r}}function _B(e){return(t,n,r,i,o,s)=>{let{x1:a,x2:c}=r,{height:l}=i,u=new Float32Array(a.length),f=new Float32Array(c.length);(e===m1(n.y)<0?u:f).fill(l);let h=s(t,n,{...r,x2:a,y2:f},i,o),d=s(t,n,{...r,x1:c,y1:u},i,o),p=h.querySelector("g")??h,m=d.querySelector("g")??d;for(let g=0;p.firstChild;g+=2){let y=a1(),b=at("svg:clipPath",o).attr("id",y).node();b.appendChild(p.firstChild),m.childNodes[g].setAttribute("clip-path",`url(#${y})`),m.insertBefore(b,m.childNodes[g])}return d}}var fW={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Nm=class extends xt{constructor(t,n={}){let[r,i]=ee(n.r,3);super(t,{geometry:{value:n.geometry,scale:"projection"},r:{value:r,scale:"r",filter:Qn,optional:!0}},bm(n),fW),this.r=i}render(t,n,r,i,o){let{geometry:s,r:a}=r,c=vn(o.projection??hW(n)),{r:l}=this;return Ma(l)?t=[]:l!==void 0&&c.pointRadius(l),at("svg:g",o).call(Ot,this,i,o).call(_t,this,n).call(u=>{u.selectAll().data(t).enter().append("path").call(Tt,this).attr("d",a?f=>c.pointRadius(a[f])(s[f]):f=>c(s[f])).call(Xt,this,r)}).node()}};function hW({x:e,y:t}){if(e||t)return e??=n=>n,t??=n=>n,Uc({point(n,r){this.stream.point(e(n),t(r))}})}function sw(e,{geometry:t=W,...n}={}){switch(e?.type){case"FeatureCollection":e=e.features;break;case"GeometryCollection":e=e.geometries;break;case"Feature":case"LineString":case"MultiLineString":case"MultiPoint":case"MultiPolygon":case"Point":case"Polygon":case"Sphere":e=[e];break}return new Nm(e,{geometry:t,...n})}function SB({strokeWidth:e=1.5,...t}={}){return sw({type:"Sphere"},{strokeWidth:e,...t})}function IB({strokeOpacity:e=.1,...t}={}){return sw(r2(),{strokeOpacity:e,...t})}var Ff=.5,Cf=0;function MB(e={fill:"count"},{binWidth:t,...n}={}){let{z:r}=n;return t=t===void 0?20:At(t),e=gI(e,n),_o(e,"fill")&&(n.channels={...n.channels,fill:{value:[]}}),n.symbol===void 0&&(n.symbol="hexagon"),n.r===void 0&&!_o(e,"r")&&(n.r=t/2),xe(n,(i,o,s,a,c,l)=>{let{x:u,y:f,z:h,fill:d,stroke:p,symbol:m}=s;if(u===void 0)throw new Error("missing channel: x");if(f===void 0)throw new Error("missing channel: y");({x:u,y:f}=$a(s,a,l)),h=h?h.value:dt(i,r),d=d?.value,p=p?.value,m=m?.value;let g=Hp(e,{z:h,fill:d,stroke:p,symbol:m}),y=h&&[],b=d&&[],x=p&&[],w=m&&[],v=[],_=[],M=[],E=-1;for(let O of e)O.initialize(i);for(let O of o){let B=[];for(let S of e)S.scope("facet",O);for(let[S,A]of Ca(O,g))for(let{index:D,extent:C}of dW(i,A,u,f,t)){B.push(++E),_.push(C.x),M.push(C.y),h&&y.push(g===h?S:h[D[0]]),d&&b.push(g===d?S:d[D[0]]),p&&x.push(g===p?S:p[D[0]]),m&&w.push(g===m?S:m[D[0]]);for(let k of e)k.reduce(D,C)}v.push(B)}let N=s.x.scale,I=s.y.scale,T={x:{value:_,source:a[N]?{value:qt(_,a[N].invert),scale:N}:null},y:{value:M,source:a[I]?{value:qt(M,a[I].invert),scale:I}:null},...h&&{z:{value:y}},...d&&{fill:{value:b,scale:"auto"}},...p&&{stroke:{value:x,scale:"auto"}},...m&&{symbol:{value:w,scale:"auto"}},...Object.fromEntries(e.map(({name:O,output:B})=>[O,{scale:"auto",label:B.label,radius:O==="r"?t/2:void 0,value:B.transform()}]))};return{data:i,facets:v,channels:T}})}function dW(e,t,n,r,i){let o=i*(1.5/aI),s=new Map;for(let a of t){let c=n[a],l=r[a];if(isNaN(c)||isNaN(l))continue;let u=Math.round(l=(l-Cf)/o),f=Math.round(c=(c-Ff)/i-(u&1)/2),h=l-u;if(Math.abs(h)*3>1){let m=c-f,g=f+(c<f?-1:1)/2,y=u+(l<u?-1:1),b=c-g,x=l-y;m*m+h*h>b*b+x*x&&(f=g+(u&1?1:-1)/2,u=y)}let d=`${f},${u}`,p=s.get(d);p===void 0&&(p={index:[],extent:{data:e,x:(f+(u&1)/2)*i+Ff,y:u*o+Cf}},s.set(d,p)),p.index.push(a)}return s.values()}var pW={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};function AB(e){return new Om(e)}var Om=class extends xt{constructor({binWidth:t=20,clip:n=!0,...r}={}){super(Da,void 0,{clip:n,...r},pW),this.binWidth=At(t)}render(t,n,r,i,o){let{binWidth:s}=this,{marginTop:a,marginRight:c,marginBottom:l,marginLeft:u,width:f,height:h}=i,d=u-Ff,p=f-c-Ff,m=a-Cf,g=h-l-Cf,y=s/2,b=y*cI,x=b/2,w=y*2,v=b*1.5,_=Math.floor(d/w),M=Math.ceil(p/w),E=Math.floor((m+x)/v),N=Math.ceil((g-x)/v)+1,I=`m0,${Ha(-b)}l${Ha(y)},${Ha(x)}v${Ha(b)}l${Ha(-y)},${Ha(x)}`,T=I;for(let O=E;O<N;++O)for(let B=_;B<M;++B)T+=`M${Ha(B*w+(O&1)*y)},${Ha(O*v)}${I}`;return at("svg:g",o).datum(0).call(Ot,this,i,o).call(_t,this,{},Ee+Ff,Ee+Cf).call(O=>O.append("path").call(Tt,this).call(Xt,this,r).attr("d",T)).node()}};function Ha(e){return Math.round(e*1e3)/1e3}var mW={ariaLabel:"image",fill:null,stroke:null};function yW(e){return/^\.*\//.test(e)}function gW(e){return/^(blob|data|file|http|https):/i.test(e)}function bW(e){return typeof e=="string"&&(yW(e)||gW(e))?[void 0,e]:[e,void 0]}var Bm=class extends xt{constructor(t,n={}){let{x:r,y:i,r:o,width:s,height:a,rotate:c,src:l,preserveAspectRatio:u,crossOrigin:f,frameAnchor:h,imageRendering:d}=n;o==null&&(o=void 0),o===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[p,m]=bW(l),[g,y]=ee(o),[b,x]=ee(s,y!==void 0?y*2:void 0),[w,v]=ee(a,y!==void 0?y*2:void 0),[_,M]=ee(c,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:g,scale:"r",filter:Qn,optional:!0},width:{value:b,filter:Qn,optional:!0},height:{value:w,filter:Qn,optional:!0},rotate:{value:_,optional:!0},src:{value:p,optional:!0}},bm(n),mW),this.src=m,this.width=x,this.rotate=M,this.height=v,this.r=y,this.preserveAspectRatio=se(u,"xMidYMid"),this.crossOrigin=$e(f),this.frameAnchor=wo(h),this.imageRendering=se(d,"auto")}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,width:u,height:f,r:h,rotate:d,src:p}=r,{r:m,width:g,height:y,rotate:b}=this,[x,w]=fn(this,i);return at("svg:g",o).call(Ot,this,i,o).call(_t,this,{x:c&&s,y:l&&a}).call(v=>v.selectAll().data(t).enter().append("image").call(Tt,this).attr("x",TB(c,u,h,x,g,m)).attr("y",TB(l,f,h,w,y,m)).attr("width",u?_=>u[_]:g!==void 0?g:h?_=>h[_]*2:m*2).attr("height",f?_=>f[_]:y!==void 0?y:h?_=>h[_]*2:m*2).attr("transform",d?_=>`rotate(${d[_]})`:b?`rotate(${b})`:null).attr("transform-origin",d||b?Ua`${c?_=>c[_]:x}px ${l?_=>l[_]:w}px`:null).call(ut,"href",p?_=>p[_]:this.src).call(ut,"preserveAspectRatio",this.preserveAspectRatio).call(ut,"crossorigin",this.crossOrigin).call(ut,"image-rendering",this.imageRendering).call(ut,"clip-path",h?_=>`circle(${h[_]}px)`:m!==void 0?`circle(${m}px)`:null).call(Xt,this,r)).node()}};function TB(e,t,n,r,i,o){return t&&e?s=>e[s]-t[s]/2:t?s=>r-t[s]/2:e&&i!==void 0?s=>e[s]-i/2:i!==void 0?r-i/2:n&&e?s=>e[s]-n[s]:n?s=>r-n[s]:e?s=>e[s]-o:r-o}function EB(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Ce(t,n)),new Bm(e,{...r,x:t,y:n})}function xW(e,t,n){var r=1e-8,i=t-1,o=n-1,s=0,a,c,l,u,f,h,d,p,m,g,y;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&n>=1?(l=e<.5?e:1-e,u=Math.sqrt(-2*Math.log(l)),d=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(d=-d),p=(d*d-3)/6,m=2/(1/(2*t-1)+1/(2*n-1)),g=d*Math.sqrt(p+m)/m-(1/(2*n-1)-1/(2*t-1))*(p+5/6-2/(3*m)),d=t/(t+n*Math.exp(2*g))):(a=Math.log(t/(t+n)),c=Math.log(n/(t+n)),u=Math.exp(t*a)/t,f=Math.exp(n*c)/n,g=u+f,e<u/g?d=Math.pow(t*g*e,1/t):d=1-Math.pow(n*g*(1-e),1/n)),y=-Lf(t)-Lf(n)+Lf(t+n);s<10;s++){if(d===0||d===1)return d;if(h=wW(d,t,n)-e,u=Math.exp(i*Math.log(d)+o*Math.log(1-d)+y),f=h/u,d-=u=f/(1-.5*Math.min(1,f*(i/d-o/(1-d)))),d<=0&&(d=.5*(d+u)),d>=1&&(d=.5*(d+u+1)),Math.abs(u)<r*d&&s>0)break}return d}function wW(e,t,n){var r=e===0||e===1?0:Math.exp(Lf(t+n)-Lf(t)-Lf(n)+t*Math.log(e)+n*Math.log(1-e));return e<0||e>1?!1:e<(t+1)/(t+n+2)?r*DB(e,t,n)/t:1-r*DB(1-e,n,t)/n}function DB(e,t,n){var r=1e-30,i=1,o=t+n,s=t+1,a=t-1,c=1,l=1-o*e/s,u,f,h,d;for(Math.abs(l)<r&&(l=r),l=1/l,d=l;i<=100&&(u=2*i,f=i*(n-i)*e/((a+u)*(t+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,d*=l*c,f=-(t+i)*(o+i)*e/((t+u)*(s+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,h=l*c,d*=h,!(Math.abs(h-1)<3e-7));i++);return d}function Lf(e){var t=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,i,o,s;for(s=(o=i=e)+5.5,s-=(i+.5)*Math.log(s);t<6;t++)r+=n[t]/++o;return Math.log(2.506628274631*r/i)-s}function NB(e,t){var n=xW(2*Math.min(e,1-e),.5*t,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}var _W={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},aw=class extends xt{constructor(t,n={}){let{x:r,y:i,z:o,ci:s=.95,precision:a=4}=n;if(super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y"},z:{value:kn(n),optional:!0}},n,_W),this.z=o,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(t,n,r,i,o){let{x:s,y:a,z:c}=r,{ci:l}=this;return at("svg:g",o).call(Ot,this,i,o).call(_t,this,n).call(u=>u.selectAll().data(c?Qp(t,c,this.z):[t]).enter().call(f=>f.append("path").attr("fill","none").call(Tt,this).call(ol,this,{...r,fill:null,fillOpacity:null}).attr("d",h=>this._renderLine(h,s,a)).call(l&&!Os(this.fill)?h=>h.select(vW).attr("stroke","none").call(Tt,this).call(ol,this,{...r,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",d=>this._renderBand(d,s,a)):()=>{}))).node()}};function vW(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(jr.svg,"path"),this)}var TM=class extends aw{constructor(t,n){super(t,n)}_renderBand(t,n,r){let{ci:i,precision:o}=this,[s,a]=ie(t,u=>r[u]),c=cw(t,r,n),l=FB(t,r,n,(1-i)/2,c);return ku().y(u=>u).x0(u=>l(u,-1)).x1(u=>l(u,1))(ke(s,a-o/2,o).concat(a))}_renderLine(t,n,r){let[i,o]=ie(t,a=>r[a]),s=cw(t,r,n);return`M${s(i)},${i}L${s(o)},${o}`}},EM=class extends aw{constructor(t,n){super(t,n)}_renderBand(t,n,r){let{ci:i,precision:o}=this,[s,a]=ie(t,u=>n[u]),c=cw(t,n,r),l=FB(t,n,r,(1-i)/2,c);return ku().x(u=>u).y0(u=>l(u,-1)).y1(u=>l(u,1))(ke(s,a-o/2,o).concat(a))}_renderLine(t,n,r){let[i,o]=ie(t,a=>n[a]),s=cw(t,n,r);return`M${i},${s(i)}L${o},${s(o)}`}};function OB(e,{y:t=ve,x:n=W,stroke:r,fill:i=Jt(r)?"currentColor":r,...o}={}){return new TM(e,bf({...o,x:n,y:t,fill:i,stroke:r}))}function BB(e,{x:t=ve,y:n=W,stroke:r,fill:i=Jt(r)?"currentColor":r,...o}={}){return new EM(e,gf({...o,x:t,y:n,fill:i,stroke:r}))}function cw(e,t,n){let r=0,i=0,o=0,s=0;for(let u of e){let f=t[u],h=n[u];r+=f,i+=h,o+=f*h,s+=f*f}let a=e.length,c=(a*o-r*i)/(a*s-r*r),l=(i-c*r)/a;return u=>c*u+l}function FB(e,t,n,r,i){let o=wn(e,u=>t[u])/e.length,s=0,a=0;for(let u of e)s+=(t[u]-o)**2,a+=(n[u]-i(t[u]))**2;let c=Math.sqrt(a/(e.length-2)),l=NB(r,e.length-2);return(u,f)=>{let h=i(u),d=c*Math.sqrt(1/e.length+(u-o)**2/s);return h+f*l*d}}function Fm({path:e=W,delimiter:t,frameAnchor:n,treeLayout:r=zc,treeSort:i,treeSeparation:o,treeAnchor:s,treeFilter:a,...c}={}){s=hw(s),i=kB(i),a!=null&&(a=NM(a)),n===void 0&&(n=s.frameAnchor);let l=RB(t),u=jB(c,NM),[f,h]=ln(),[d,p]=ln();return{x:f,y:d,frameAnchor:n,...un(c,(m,g)=>{let y=l(dt(m,e)),b=h([]),x=p([]),w=-1,v=[],_=[],M=ob().path(N=>y[N]),E=r();E.nodeSize&&E.nodeSize([1,1]),E.separation&&o!==void 0&&E.separation(o??Vp);for(let N of u)N[uw]=N[qB]([]);for(let N of g){let I=[],T=M(N.filter(O=>y[O]!=null)).each(O=>O.data=m[O.data]);i!=null&&T.sort(i),E(T);for(let O of T.descendants())if(!(a!=null&&!a(O))){I.push(++w),v[w]=O.data,s.position(O,w,b,x);for(let B of u)B[uw][w]=B[VB](O)}_.push(I)}return{data:v,facets:_}}),...Object.fromEntries(u)}}function fw({path:e=W,delimiter:t,curve:n="bump-x",stroke:r="#555",strokeWidth:i=1.5,strokeOpacity:o=.5,treeLayout:s=zc,treeSort:a,treeSeparation:c,treeAnchor:l,treeFilter:u,...f}={}){l=hw(l),a=kB(a),u!=null&&(u=LB(u)),f={curve:n,stroke:r,strokeWidth:i,strokeOpacity:o,...f};let h=RB(t),d=jB(f,LB),[p,m]=ln(),[g,y]=ln(),[b,x]=ln(),[w,v]=ln();return{x1:p,x2:g,y1:b,y2:w,...un(f,(_,M)=>{let E=h(dt(_,e)),N=m([]),I=y([]),T=x([]),O=v([]),B=-1,S=[],A=[],D=ob().path(k=>E[k]),C=s();C.nodeSize&&C.nodeSize([1,1]),C.separation&&c!==void 0&&C.separation(c??Vp);for(let k of d)k[uw]=k[qB]([]);for(let k of M){let L=[],R=D(k.filter($=>E[$]!=null)).each($=>$.data=_[$.data]);a!=null&&R.sort(a),C(R);for(let{source:$,target:P}of R.links())if(!(u!=null&&!u(P,$))){L.push(++B),S[B]=P.data,l.position($,B,N,T),l.position(P,B,I,O);for(let G of d)G[uw][B]=G[VB](P,$)}A.push(L)}return{data:S,facets:A}}),...Object.fromEntries(d)}}function hw(e="left"){switch(`${e}`.trim().toLowerCase()){case"left":return SW;case"right":return IW}throw new Error(`invalid tree anchor: ${e}`)}var SW={frameAnchor:"left",dx:6,position({x:e,y:t},n,r,i){r[n]=t,i[n]=-e}},IW={frameAnchor:"right",dx:-6,position({x:e,y:t},n,r,i){r[n]=-t,i[n]=-e}};function kB(e){return e==null||typeof e=="function"?e:`${e}`.trim().toLowerCase().startsWith("node:")?CB(NM(e)):CB(MW(e))}function CB(e){return(t,n)=>sn(e(t),e(n))}function MW(e){return t=>t.data?.[e]}function RB(e="/"){if(e=`${e}`,e==="/")return n=>n;if(e.length!==1)throw new Error("delimiter must be exactly one character");let t=e.charCodeAt(0);return n=>n.map(r=>AW(r,t))}var DM=92,$B=47;function AW(e,t){if(t===DM)throw new Error("delimiter cannot be backslash");let n=!1;for(let r=0,i=e.length;r<i;++r){switch(e.charCodeAt(r)){case DM:if(!n){n=!0;continue}break;case t:n?(e=e.slice(0,r-1)+e.slice(r),--r,--i):e=e.slice(0,r)+"/"+e.slice(r+1);break;case $B:n?(e=e.slice(0,r)+"\\\\"+e.slice(r),r+=2,i+=2):(e=e.slice(0,r)+"\\"+e.slice(r),++r,++i);break}n=!1}return e}function TW(e){let t=!1;for(let n=0,r=e.length;n<r;++n){switch(e.charCodeAt(n)){case DM:if(!t){t=!0;continue}case $B:t&&(e=e.slice(0,n-1)+e.slice(n),--n,--r);break}t=!1}return e}function PB(e){return cn(e)&&typeof e.node=="function"}function EW(e){return cn(e)&&typeof e.link=="function"}function NM(e){if(PB(e))return e.node;if(e=`${e}`.trim().toLowerCase(),!!e.startsWith("node:")){switch(e){case"node:name":return BM;case"node:path":return OM;case"node:internal":return UB;case"node:external":return zB;case"node:depth":return FM;case"node:height":return CM}throw new Error(`invalid node value: ${e}`)}}function LB(e){if(PB(e))return e.node;if(EW(e))return e.link;if(e=`${e}`.trim().toLowerCase(),!(!e.startsWith("node:")&&!e.startsWith("parent:"))){switch(e){case"parent:name":return lw(BM);case"parent:path":return lw(OM);case"parent:depth":return lw(FM);case"parent:height":return lw(CM);case"node:name":return BM;case"node:path":return OM;case"node:internal":return UB;case"node:external":return zB;case"node:depth":return FM;case"node:height":return CM}throw new Error(`invalid link value: ${e}`)}}function OM(e){return e.id}function BM(e){return DW(e.id)}function FM(e){return e.depth}function CM(e){return e.height}function UB(e){return!!e.children}function zB(e){return!e.children}function lw(e){return(t,n)=>n==null?void 0:e(n)}function DW(e){let t=e.length;for(;--t>0&&!NW(e,t););return TW(e.slice(t+1))}function NW(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}var qB=2,VB=3,uw=4;function jB(e,t){let n=[];for(let r in e){let i=e[r],o=t(i);o!==void 0&&n.push([r,...ln(i),o])}return n}function LM(e,{fill:t,stroke:n,strokeWidth:r,strokeOpacity:i,strokeLinejoin:o,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:l,marker:u,markerStart:f=u,markerEnd:h=u,dot:d=Jt(f)&&Jt(h),text:p="node:name",textStroke:m="var(--plot-background)",title:g="node:path",dx:y,dy:b,textAnchor:x,treeLayout:w=zc,textLayout:v=w===zc||w===rb?"mirrored":"normal",tip:_,...M}={}){if(y===void 0&&(y=hw(M.treeAnchor).dx),x!==void 0)throw new Error("textAnchor is not a configurable tree option");v=He(v,"textLayout",["mirrored","normal"]);function E(N){return So(e,Fm({treeLayout:w,text:p,fill:t===void 0?"currentColor":t,stroke:m,dx:y,dy:b,title:g,...N,...M}))}return Ze(Z1(e,fw({treeLayout:w,markerStart:f,markerEnd:h,stroke:n!==void 0?n:t===void 0?"node:internal":t,strokeWidth:r,strokeOpacity:i,strokeLinejoin:o,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:l,...M})),d?ni(e,Fm({treeLayout:w,fill:t===void 0?"node:internal":t,title:g,tip:_,...M})):null,p!=null?v==="mirrored"?[E({textAnchor:"start",treeFilter:"node:external"}),E({textAnchor:"end",treeFilter:"node:internal",dx:-y})]:E():null)}function YB(e,t){return LM(e,{...t,treeLayout:rb})}function WB({geometry:e=W,...t}={}){return xe({...t,x:null,y:null},(n,r,i,o,s,{projection:a})=>{let c=dt(n,e),l=c.length,u=new Float64Array(l),f=new Float64Array(l),h=vn(a);for(let d=0;d<l;++d)[u[d],f[d]]=h.centroid(c[d]);return{data:n,facets:r,channels:{x:{value:u,scale:a==null?"x":null,source:null},y:{value:f,scale:a==null?"y":null,source:null}}}})}function GB({geometry:e=W,...t}={}){let n;return{...t,x:{transform:r=>Float64Array.from(n=dt(dt(r,e),Kv),([i])=>i)},y:{transform:()=>Float64Array.from(n,([,r])=>r)}}}var iF=sC(rF(),1);var $W=({marginLeft:e})=>[1,e],PW=({width:e,marginRight:t})=>[-1,e-t],UW=({width:e,marginLeft:t,marginRight:n})=>[0,(t+e-n)/2],zW=({marginTop:e})=>[1,e],qW=({height:e,marginBottom:t})=>[-1,e-t],VW=({height:e,marginTop:t,marginBottom:n})=>[0,(t+e-n)/2];function oF(e){return typeof e=="string"?{anchor:e}:e}function sF(e={},t={}){arguments.length===1&&([e,t]=cF(e));let{anchor:n="left",padding:r=1,r:i=t.r}=oF(e);switch(`${n}`.toLowerCase()){case"left":n=$W;break;case"right":n=PW;break;case"middle":n=UW;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return lF("x","y",n,At(r),i,t)}function aF(e={},t={}){arguments.length===1&&([e,t]=cF(e));let{anchor:n="bottom",padding:r=1,r:i=t.r}=oF(e);switch(`${n}`.toLowerCase()){case"top":n=zW;break;case"bottom":n=qW;break;case"middle":n=VW;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return lF("y","x",n,At(r),i,t)}function cF(e){let{anchor:t,padding:n,...r}=e,{r:i}=r;return[{anchor:t,padding:n,r:i},r]}function lF(e,t,n,r,i,o){if(i!=null&&typeof i!="number"){let{channels:s,sort:a,reverse:c}=o;s=Yp(s),s?.r===void 0&&(o={...o,channels:{...s,r:{value:i,scale:"r"}}}),a===void 0&&c===void 0&&(o.sort={channel:"-r"})}return xe(o,function(s,a,c,l,u,f){let{[t]:h,r:d}=c;if(!c[t])throw new Error(`missing channel: ${t}`);({[t]:h}=$a(c,l,f));let p=d?void 0:i!==void 0?At(i):this.r!==void 0?this.r:3;d&&(d=dt(d.value,l[d.scale]||W,Float64Array));let[m,g]=n(u),y=m?YW:jW,b=new Float64Array(h.length),x=d?w=>d[w]:()=>p;for(let w of a){let v=(0,iF.default)();w=w.filter(d?M=>zu(h[M])&&Qn(d[M]):M=>zu(h[M]));let _=new Float64Array(2*w.length+2);for(let M of w){let E=x(M),N=m?E+r:0,I=h[M]-E,T=h[M]+E,O=2;v.queryInterval(I-r,T+r,([,,S])=>{let A=b[S]-N,D=h[M]-h[S],C=r+(d?d[M]+d[S]:2*p),k=Math.sqrt(C*C-D*D);_[O++]=A-k,_[O++]=A+k});let B=_.slice(0,O);m&&(B=B.filter(S=>S>=0));t:for(let S of B.sort(y)){for(let A=0;A<O;A+=2)if(_[A]+1e-6<S&&S<_[A+1]-1e-6)continue t;b[M]=S+N;break}v.insert([I,T,M])}}m||(m=1);for(let w of a)for(let v of w)b[v]=b[v]*m+g;return{data:s,facets:a,channels:{[e]:{value:b,source:null},[t]:{value:h,source:c[t]},...d&&{r:{value:d,source:c.r}}}}})}function jW(e,t){return Math.abs(e)-Math.abs(t)}function YW(e,t){return e-t}function fF(e,t){return arguments.length===1&&({basis:e,...t}=e),Df(mw(e),t)}function hF(e,t){return arguments.length===1&&({basis:e,...t}=e),Nf(mw(e),t)}function mw(e){if(e===void 0)return uF;if(typeof e=="function")return yw(Gu(e));if(/^p\d{2}$/i.test(e))return Pf(Yu(e));switch(`${e}`.toLowerCase()){case"deviation":return XW;case"first":return uF;case"last":return GW;case"max":return HW;case"mean":return ZW;case"median":return KW;case"min":return QW;case"sum":return JW;case"extent":return WW}throw new Error(`invalid basis: ${e}`)}function yw(e){return{mapIndex(t,n,r){let i=+e(t,n);for(let o of t)r[o]=n[o]===null?NaN:n[o]/i}}}function Pf(e){return yw((t,n)=>e(t,r=>n[r]))}var WW={mapIndex(e,t,n){let[r,i]=ie(e,s=>t[s]),o=i-r;for(let s of e)n[s]=t[s]===null?NaN:(t[s]-r)/o}},uF=yw((e,t)=>{for(let n=0;n<e.length;++n){let r=t[e[n]];if(Re(r))return r}}),GW=yw((e,t)=>{for(let n=e.length-1;n>=0;--n){let r=t[e[n]];if(Re(r))return r}}),XW={mapIndex(e,t,n){let r=ss(e,o=>t[o]),i=Vr(e,o=>t[o]);for(let o of e)n[o]=t[o]===null?NaN:i?(t[o]-r)/i:0}},HW=Pf(Vt),ZW=Pf(ss),KW=Pf(Ai),QW=Pf(oe),JW=Pf(wn);function dF(e,t){return tG("x",e,t)}function tG(e,t,n={}){let r,i=1;if(typeof t=="number")i=t,r=(l,u)=>+l+u;else{if(typeof t=="string"){let l=t.startsWith("-")?-1:1;[t,i]=Gx(t.replace(/^[+-]/,"")),i*=l}t=Hu(t),r=(l,u)=>t.offset(l,u)}let o=`${e}1`,s=`${e}2`,a=dr({[o]:l=>l.map(u=>r(u,i)),[s]:l=>l},n),c=a[s].transform;return a[s].transform=()=>{let l=c(),[u,f]=ie(l);return l.domain=i<0?[u,r(f,i)]:[r(u,i),f],l},a}function pF(e,t={}){if(typeof e=="string")switch(e.toLowerCase()){case"first":return zM(t);case"last":return qM(t)}if(typeof e=="function")return Za(null,e,t);let n,r;for(n in e){if(r!==void 0)throw new Error("ambiguous selector; multiple inputs");r=eG(e[n])}if(r===void 0)throw new Error(`invalid selector: ${e}`);return Za(n,r,t)}function eG(e){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"min":return VM;case"max":return jM}throw new Error(`unknown selector: ${e}`)}function zM(e){return Za(null,nG,e)}function qM(e){return Za(null,rG,e)}function mF(e){return Za("x",VM,e)}function yF(e){return Za("y",VM,e)}function gF(e){return Za("x",jM,e)}function bF(e){return Za("y",jM,e)}function*nG(e){yield e[0]}function*rG(e){yield e[e.length-1]}function*VM(e,t){yield z0(e,n=>t[n])}function*jM(e,t){yield Ic(e,n=>t[n])}function Za(e,t,n){if(e!=null){if(n[e]==null)throw new Error(`missing channel: ${e}`);e=n[e]}let r=kn(n);return un(n,(i,o)=>{let s=dt(i,r),a=dt(i,e),c=[];for(let l of o){let u=[];for(let f of s?en(l,h=>s[h]).values():[l])for(let h of t(f,a))u.push(h);c.push(u)}return{data:i,facets:c}})}var iG=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"],["round","round"],["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"],["xLabelOffset","x.labelOffset"],["xFontVariant","x.fontVariant"],["xAriaLabel","x.ariaLabel"],["xAriaDescription","x.ariaDescription"],["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"],["yLabelOffset","y.labelOffset"],["yFontVariant","y.fontVariant"],["yAriaLabel","y.ariaLabel"],["yAriaDescription","y.ariaDescription"],["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"],["fxNice","fx.nice"],["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"],["fyNice","fy.mice"],["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"],["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"],["opacityReverse","opacity.reverse"],["opacityZero","opacity.zero"],["opacityTickFormat","opacity.tickFormat"],["opacityBase","opacity.base"],["opacityExponent","opacity.exponent"],["opacityConstant","opacity.constant"],["rScale","r.type"],["rDomain","r.domain"],["rRange","r.range"],["rClamp","r.clamp"],["rNice","r.nice"],["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"],["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 oG(e,t,n){for(let r=0;r<t.length;++r){let i=t[r];r===t.length-1?e[i]=n:e=e[i]||(e[i]={})}}function xF(e,t,n){for(let r in e){let i=iG.get(r);if(i==null)throw new Error(`Unrecognized plot attribute: ${r}`);let o=e[r];typeof o=="symbol"?n.push(r):o!==void 0&&oG(t,i.split("."),o)}}var sG=new Set(["frame","hexgrid","sphere","graticule"]);async function _F(e){let t={marks:[]},n=[],{attributes:r,marks:i}=e;xF(r,t,n);let o=[];for(let a of i)for(let{type:c,data:l,options:u}of a.plotSpecs())sG.has(c)?t.marks.push(gw[c](u)):t.marks.push(gw[c](l,u)),o.push(a.index);cG(t,e);let s=um(t);lG(s,o),aG(e,s,r,n);for(let a of e.interactors)await a.init(s);return s}function aG(e,t,n,r){r.forEach(i=>{let o=n[i];if(o===qs){if(!i.endsWith("Domain"))throw new Error(`Unsupported fixed attribute: ${i}`);let s=i.slice(0,-6),a=t.scale(s);a?.domain&&e.setAttribute(i,n[`${s}Reverse`]?a.domain.slice().reverse():a.domain)}else throw new Error(`Unrecognized symbol: ${o}`)})}function cG(e,t){let{marks:n}=t;bw("x",e,n,["x","x1","x2"]),bw("y",e,n,["y","y1","y2"]),bw("fx",e,n),bw("fy",e,n)}function bw(e,t,n,r=[e]){let i=t[e]||{};if(i.axis===null||i.label!==void 0)return;let o=n.map(u=>u.channelField(r)?.field);if(o.every(u=>u==null))return;let s,a,c;for(let u=0;u<o.length;++u){let{column:f,label:h}=o[u]||{};f===void 0&&h===void 0||(s===void 0&&a===void 0?(s=f,a=h,c=uG(n[u].data,r)||"number"):a!==h?a=void 0:s!==f&&(s=void 0))}let l=a||s;if(l!==void 0){if((c==="number"||c==="date")&&(e==="x"||e==="y")){i.percent&&(l=`${l} (%)`);let u=(e==="x"?1:-1)*(i.reverse?-1:1);e==="x"||i.labelAnchor==="center"?l=e==="x"==u<0?`\u2190 ${l}`:`${l} \u2192`:l=`${u<0?"\u2191 ":"\u2193 "}${l}`}t[e]={...i,label:l}}}function lG(e,t){let n=e.querySelectorAll('g[aria-label="facet"]');if(n.length)for(let r of n)wF(r,t);else wF(e,t)}function wF(e,t){let n=-1;for(let r of e.children){let i=r.getAttribute("aria-label")||"";r.nodeName==="style"||i.includes("-axis")||i.includes("-grid")||r.setAttribute("data-index",t[++n])}}function uG(e,t){for(let n of e)for(let r=0;r<t.length;++r){let i=n[t[r]];if(i!=null)return i instanceof Date?"date":typeof i}}var fG={width:640,marginLeft:40,marginRight:20,marginTop:20,marginBottom:30},YM=class{constructor(t){this.attributes={...fG},this.listeners=null,this.interactors=[],this.legends=[],this.marks=[],this.markset=null,this.element=t||document.createElement("div"),this.element.setAttribute("class","plot"),this.element.style.display="flex",this.element.value=this,this.params=new Map,this.synch=W_()}margins(){return{left:this.getAttribute("marginLeft"),top:this.getAttribute("marginTop"),bottom:this.getAttribute("marginBottom"),right:this.getAttribute("marginRight")}}innerWidth(){let{left:t,right:n}=this.margins();return this.getAttribute("width")-t-n}innerHeight(){let{top:t,bottom:n}=this.margins();return this.getAttribute("height")-t-n}pending(t){this.synch.pending(t)}update(t){return this.synch.ready(t)&&!this.pendingRender&&(this.pendingRender=!0,requestAnimationFrame(()=>this.render())),this.synch.promise}async render(){this.pendingRender=!1;let t=await _F(this),n=this.legends.flatMap(({legend:r,include:i})=>{let o=r.init(t);return i?o:[]});this.element.replaceChildren(t,...n),this.synch.resolve()}getAttribute(t){return this.attributes[t]}setAttribute(t,n,r){return rd(this.attributes[t],n)?(n===void 0?delete this.attributes[t]:this.attributes[t]=n,r?.silent||this.listeners?.get(t)?.forEach(i=>i(t,n)),!0):!1}addAttributeListener(t,n){let r=this.listeners||(this.listeners=new Map);return r.has(t)||r.set(t,new Set),r.get(t).add(n),this}removeAttributeListener(t,n){return this.listeners?.get(t)?.delete(n)}addParams(t,n){let{params:r}=this;for(let i of n)r.has(i)?r.get(i).push(t):(r.set(i,[t]),i.addEventListener("value",()=>Promise.allSettled(r.get(i).map(o=>o.requestQuery()))))}addMark(t){return t.setPlot(this,this.marks.length),this.marks.push(t),this.markset=null,this}get markSet(){return this.markset||(this.markset=new Set(this.marks))}addInteractor(t){return this.interactors.push(t),this}addLegend(t,n=!0){t.setPlot(this),this.legends.push({legend:t,include:n})}};function xw(e){return typeof e!="string"?!1:(e=e.toLowerCase().trim(),e==="none"||e==="currentcolor"||e.startsWith("url(")&&e.endsWith(")")||e.startsWith("var(")&&e.endsWith(")")||Ar(e)!==null)}var hG=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"]);function vF(e){return hG.has(e)}var dG=new Set(["asterisk","circle","cross","diamond","diamond2","hexagon","plus","square","square2","star","times","triangle","triangle2","wye"]);function SF(e){return dG.has(`${e}`.toLowerCase())}function Uf(e){return typeof e?.getChild=="function"}function IF(e){let{typeId:t}=e;return t===10?n=>n==null?n:new Date(n):t===2&&e.bitWidth>=64?n=>n==null?n:Number(n):n=>n}function ww(e){return Uf(e)?pG(e):e}function pG(e){let{batches:t,numRows:n}=e;if(!n)return[];let r=Array.from({length:n},()=>({}));for(let i=0,o=0;o<t.length;++o){let s=t[o],{schema:a,numRows:c,numCols:l}=s;for(let u=0;u<l;++u){let f=s.getChildAt(u),{name:h,type:d}=a.fields[u],p=IF(d);for(let m=i,g=0;g<c;++g,++m)r[m][h]=p(f.get(g))}i+=c}return r}var MF=e=>e==="stroke"||e==="fill",mG=e=>e==="symbol",yG=(e,t)=>e!=="sort"&&e!=="tip"&&t!=null&&!Array.isArray(t),WM=(e,t)=>({channel:e,field:t,as:t instanceof fr?t.column:e}),GM=(e,t)=>({channel:e,value:t}),_w=e=>Array.isArray(e),nr=class extends Gf{constructor(t,n,r,i={}){super(n?.options?.filterBy),this.type=t,this.reqs=i,this.source=n,_w(this.source)&&(this.data=this.source);let o=this.channels=[],s=this.detail=new Set,a=this.params=new Set,c=(l,u)=>{let f=typeof u;if(l==="channels")for(let h in u)s.add(h),c(h,u[h]);else if(f==="function"&&u[Yf]){let h=u(this,l);for(let d in h)c(d,h[d])}else if(f==="string")vF(l)||MF(l)&&xw(u)||mG(l)&&SF(u)?o.push(GM(l,u)):o.push(WM(l,g0(u)));else if(ns(u))if(Array.isArray(u.columns))o.push(WM(l,u)),a.add(u);else{let h=GM(l,u.value);o.push(h),u.addEventListener("value",d=>(h.value=d,this.update()))}else f==="object"&&yG(l,u)?o.push(WM(l,u)):u!==void 0&&o.push(GM(l,u))};for(let l in r)c(l,r[l])}setPlot(t,n){this.plot=t,this.index=n,t.addParams(this,this.params),this.source?.table&&this.queryPending()}hasOwnData(){return this.source==null||_w(this.source)}channel(t){return this.channels.find(n=>n.channel===t)}channelField(...t){let n=t.flat();for(let r of n){let i=this.channel(r);if(i?.field)return i}return null}fields(){if(this.hasOwnData())return null;let{source:{table:t},channels:n,reqs:r}=this,i=new Map;for(let{channel:o,field:s}of n){let a=s?.column;if(a){if(s.stats?.length||r[o]){i.has(a)||i.set(a,new Set);let c=i.get(a);r[o]?.forEach(l=>c.add(l)),s.stats?.forEach(l=>c.add(l))}}else continue}return Array.from(i,([o,s])=>({table:t,column:o,stats:Array.from(s)}))}fieldInfo(t){return this.stats=t.reduce((n,r)=>(n[r.column]=r,n),Object.create(null)),this}query(t=[]){if(this.hasOwnData())return null;let{channels:n,source:{table:r}}=this;return XM(n,r).where(t)}queryPending(){return this.plot.pending(this),this}queryResult(t){return this.data=ww(t),this}update(){return this.plot.update(this)}plotSpecs(){let{type:t,data:n,detail:r,channels:i}=this,o={},s={};for(let a of i){let c=r.has(a.channel)?s:o;c[a.channel]=ri(a)}return r.size&&(o.channels=s),[{type:t,data:n,options:o}]}};function ri(e){return Object.hasOwn(e,"value")?e.value:MF(e.channel)?{value:e.as,scale:"color"}:e.as}function XM(e,t,n=[]){let r=Lt.from({source:t}),i=new Set,o=!1;for(let s of e){let{channel:a,field:c,as:l}=s;if(!n.includes(a)){if(a==="orderby")r.orderby(s.value);else if(c){if(c.aggregate)o=!0;else{if(i.has(l))continue;i.add(l)}r.select({[l]:c})}}}return o&&r.groupby(Array.from(i)),r}function wl(e,t){let{plot:n}=e,r=n.getAttribute(`${t}Scale`);if(!r){let{field:o}=e.channelField(t,`${t}1`,`${t}2`),{type:s}=e.stats[o.column];r=s==="date"?"time":"linear"}let i={type:r};switch(r){case"log":i.base=n.getAttribute(`${t}Base`)??10;break;case"pow":i.exponent=n.getAttribute(`${t}Exponent`)??1;break;case"symlog":i.constant=n.getAttribute(`${t}Constant`)??1;break}return nd(i)}function kr(e,t,n,r,i=1,o){let{field:s}=e.channelField(t);o=o??s;let{type:a,apply:c,sqlApply:l}=wl(e,t),u=!!e.plot.getAttribute(`${t}Reverse`),[f,h]=r.map(b=>c(b)),d=l(o),p=a==="time"||a==="utc"?d:o,m=h===f?0:(n-i)/(h-f),g=m!==1?` * ${m}::DOUBLE`:"";return[u?q`(${h} - ${d}::DOUBLE)${g}`:q`(${d}::DOUBLE - ${f})${g}`,p]}var HM={x:["min","max"]},ZM={y:["min","max"]},vw={...HM,...ZM};function AF(e,t,n,r,i){let{plot:o,stats:s}=e,a=o.getAttribute(r),c=o.getAttribute(i);if(Array.isArray(a)&&!a[dn])return a;{let{field:l}=e.channelField(n),{column:u}=l,{min:f,max:h}=s[u],d=KM(t,u)||(c?ys().domain([f,h]).nice().domain():[f,h]);return a!==qs&&(d[dn]=!0),o.setAttribute(r,d,{silent:!0}),d}}function Eo(e,t){return AF(e,t,"x","xDomain","xNice")}function Do(e,t){return AF(e,t,"y","yDomain","yNice")}function KM(e,t){if(!e)return;let n,r,i=(o,s)=>{if(o==="BETWEEN"&&s.field.column===t){let{range:a}=s;a&&(n==null||a[0]<n)&&(n=a[0]),a&&(r==null||a[1]>r)&&(r=a[1])}};return Array.isArray(e)?e.forEach(o=>o.visit?.(i)):e.visit&&e.visit(i),n!=null&&r!=null&&n!==r?[n,r]:void 0}var QM=class extends nr{constructor(t,n,r){let i=t.endsWith("X")?"y":t.endsWith("Y")?"x":null,o={[i]:["min","max"]};super(t,n,r,o),this.dim=i}query(t=[]){let{plot:n,dim:r,source:i,stats:o}=this,{optimize:s=!0}=i.options||{},a=super.query(t);if(!r)return a;let c=r==="x"?"y":"x",l=this.channelField(c)?.as,{field:u,as:f}=this.channelField(r),{type:h}=o[u.column];if(s&&(h==="date"||h==="number")&&l){let{column:p}=u,{max:m,min:g}=o[p],y=r==="x"?n.innerWidth():n.innerHeight(),[b,x]=KM(t,p)||[g,m],[w]=kr(this,r,y,[b,x],1,f),v=a.select().map(_=>_.as).filter(_=>_!==f&&_!==l);return gG(a,w,f,l,v)}else return a.orderby(u)}};function gG(e,t,n,r,i=[]){let o=q`FLOOR(${t})::INTEGER`,s=a=>Lt.from(e).select(a).groupby(o,i);return Lt.union(s([{[n]:ca(n),[r]:x0(r,n)},...i]),s([{[n]:aa(n),[r]:w0(r,n)},...i]),s([{[n]:x0(n,r),[r]:ca(r)},...i]),s([{[n]:w0(n,r),[r]:aa(r)},...i])).orderby(i,n)}function JM(e,t="density"){if(Uf(e))switch(e.getChild(t).type.typeId){case 2:case 3:case 7:return Float64Array;default:return Array}else return typeof e[0][t]=="number"?Float64Array:Array}function TF(e,t){let n=JM(t);return DF(new n(e),t)}function EF(e,t,n,r,i=[]){if(i.length)return _G(e*t,n,r,i);{let o={};return r.forEach(s=>{let a=JM(n,s);o[s]=DF(new a(e*t),n,s)}),[o]}}function DF(e,t,n="density"){if(Uf(t)){let r=t.numRows;if(r===0)return e;let i=t.getChild("index").toArray(),o=t.getChild(n).toArray();for(let s=0;s<r;++s)e[i[s]]=o[s]}else for(let r of t)e[r.index]=r[n];return e}function _G(e,t,n,r){let i=n.map(c=>JM(t,c)),o=n.length,s={},a=c=>{let l=s[c];return l||(l=s[c]={},r.forEach((u,f)=>l[u]=c[f]),n.forEach((u,f)=>l[u]=new i[f](e))),l};if(Uf(t)){let c=t.numRows;if(c===0)return[];let l=t.getChild("index").toArray(),u=n.map(h=>t.getChild(h).toArray()),f=r.map(h=>t.getChild(h));for(let h=0;h<c;++h){let d=f.map(m=>m.get(h)),p=a(d);for(let m=0;m<o;++m)p[n[m]][l[h]]=u[m][h]}}else for(let c of t){let l=r.map(f=>c[f]),u=a(l);for(let f=0;f<o;++f)u[n[f]][c.index]=c[n[f]]}return Object.values(s)}function km(e,t){let n=0,r=0;return e.forEach(i=>{let o=i[t],s=o.length;for(let a=0;a<s;++a){let c=o[a];c<n&&(n=c),c>r&&(r=c)}}),n===0&&r===0?[0,1]:[n,r]}function NF(e,t){let n=new Vn;return e.forEach(r=>{let i=r[t],o=i.length;for(let s=0;s<o;++s)n.add(i[s])}),Array.from(n).sort($t)}function An(e,t,n,r){Gl(n)?(r=r||(()=>e.requestUpdate()),n.addEventListener("value",i=>(e[t]=i,r())),e[t]=n.value):e[t]=n}function Rm(e,t=!1){let n=new Float64Array(5),r=new Float64Array(4);vG(n,r,e);let i=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]),o=1+n[1]+n[2]+n[3]+n[4],s=(r[0]+r[1]+r[2]+r[3])/o,a=(i[1]+i[2]+i[3]+i[4])/o;return{sigma:e,negative:t,a:n,b_causal:r,b_anticausal:i,sum_causal:s,sum_anticausal:a}}function vG(e,t,n){let i=Float64Array.of(.84,1.8675,.84,-1.8675,-.34015,-.1299,-.34015,.1299),o=Math.exp(-1.783/n),s=Math.exp(-1.723/n),a=.6318/n,c=1.997/n,l=Float64Array.of(-o*Math.cos(a),o*Math.sin(a),-o*Math.cos(-a),o*Math.sin(-a),-s*Math.cos(c),s*Math.sin(c),-s*Math.cos(-c),s*Math.sin(-c)),u=n*2.5066282746310007,f=Float64Array.of(i[0],i[1],0,0,0,0,0,0),h=Float64Array.of(1,0,l[0],l[1],0,0,0,0,0,0),d,p;for(p=2;p<8;p+=2){for(f[p]=l[p]*f[p-2]-l[p+1]*f[p-1],f[p+1]=l[p]*f[p-1]+l[p+1]*f[p-2],d=p-2;d>0;d-=2)f[d]+=l[p]*f[d-2]-l[p+1]*f[d-1],f[d+1]+=l[p]*f[d-1]+l[p+1]*f[d-2];for(d=0;d<=p;d+=2)f[d]+=i[p]*h[d]-i[p+1]*h[d+1],f[d+1]+=i[p]*h[d+1]+i[p+1]*h[d];for(h[p+2]=l[p]*h[p]-l[p+1]*h[p+1],h[p+3]=l[p]*h[p+1]+l[p+1]*h[p],d=p;d>0;d-=2)h[d]+=l[p]*h[d-2]-l[p+1]*h[d-1],h[d+1]+=l[p]*h[d-1]+l[p+1]*h[d-2]}for(p=0;p<4;++p)d=p<<1,t[p]=f[d]/u,e[p+1]=h[d+2]}function OF(e,t,n,[r,i]){let o=new Float64Array(Math.max(r,i)),s=new Float64Array(Math.max(r,i)),a=new Float64Array(5),c=new Float64Array(n.length);for(let l=0,u=0;l<i;++l,u+=r){let f=c.subarray(u);Sw(e,n.subarray(u),r,1,o,s,a,f)}for(let l=0;l<r;++l){let u=c.subarray(l);Sw(t,u,i,r,o,s,a,u)}return c}function Sw(e,t,n,r=1,i=new Float64Array(n),o=new Float64Array(n),s=new Float64Array(5),a=i,c=SG){let l=r*2,u=r*3,f=r*4,h=r*n,d,p;for(c(i,t,n,r,e.b_causal,3,e.a,4,e.sum_causal,s,e.sigma),p=4,d=f;p<n;++p,d+=r)i[p]=e.b_causal[0]*t[d]+e.b_causal[1]*t[d-r]+e.b_causal[2]*t[d-l]+e.b_causal[3]*t[d-u]-e.a[1]*i[p-1]-e.a[2]*i[p-2]-e.a[3]*i[p-3]-e.a[4]*i[p-4];for(c(o,t,n,-r,e.b_anticausal,4,e.a,4,e.sum_anticausal,s,e.sigma),p=4,d=h-r*5;p<n;++p,d-=r)o[p]=e.b_anticausal[1]*t[d+r]+e.b_anticausal[2]*t[d+l]+e.b_anticausal[3]*t[d+u]+e.b_anticausal[4]*t[d+f]-e.a[1]*o[p-1]-e.a[2]*o[p-2]-e.a[3]*o[p-3]-e.a[4]*o[p-4];if(e.negative)for(p=0,d=0;p<n;++p,d+=r)a[d]=i[p]+o[n-p-1];else for(p=0,d=0;p<n;++p,d+=r)a[d]=Math.max(0,i[p]+o[n-p-1]);return a}function SG(e,t,n,r,i,o,s,a,c,l){let u=Math.abs(r)*n,f=r<0?u+r:0,h,d,p;for(d=0;d<a;++d)for(l[d]=d<=o?i[d]:0,p=1;p<=a&&p<=d;++p)l[d]-=s[p]*l[d-p];for(p=0;p<a;++p)for(e[p]=0,d=1;d<=p;++d)h=f+r*d,h>=0&&h<u&&(e[p]+=l[p-d]*t[h]);let m=t[f];if(m>0)for(p=0;p<a;++p)e[p]+=l[p]*m}var Us="density",Ci=class extends nr{constructor(t,n,r){let{bandwidth:i=0,interpolate:o="none",pixelSize:s=1,pad:a=1,width:c,height:l,...u}=r,f=IG(u);super(t,n,u,vw),this.densityMap=f,An(this,"bandwidth",i,()=>this.grids?this.convolve().update():null),An(this,"pixelSize",s),An(this,"interpolate",o),An(this,"pad",a),An(this,"width",c),An(this,"height",l)}setPlot(t,n){let r=()=>{this.stats&&this.requestUpdate()};return t.addAttributeListener("domainX",r),t.addAttributeListener("domainY",r),super.setPlot(t,n)}get filterIndexable(){let t=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return t&&n&&!t[dn]&&!n[dn]}query(t=[]){let{interpolate:n,pad:r,channels:i,densityMap:o,source:s}=this,[a,c]=this.extentX=Eo(this,t),[l,u]=this.extentY=Do(this,t),[f,h]=this.bins=this.binDimensions(this),[d,p]=kr(this,"x",f,[a,c],r),[m,g]=kr(this,"y",h,[l,u],r),y=r?[Oe(p,[+a,+c]),Oe(g,[+l,+u])]:[bc(+a,p),gc(p,+c),bc(+l,g),gc(g,+u)],b=Lt.from(s.table).where(t.concat(y)),x=this.groupby=[],w={};for(let _ of i)if(Object.hasOwn(_,"field")){let{as:M,channel:E,field:N}=_;N.aggregate?(w[E]=N,o[E]=!0):E==="weight"?w[Us]=Ii(N):E!=="x"&&E!=="y"&&(b.select({[M]:N}),x.push(M))}let v=this.aggr=Object.keys(w);if(w.density&&v.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(v.length||(v.push(Us),w.density=Si()),n==="linear"){if(v.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!w.density)throw new Error("Linear binning not applicable to custom aggregates.");return AG(b,d,m,w[Us],f,x)}else return MG(b,d,m,w,f,x)}binDimensions(){let{plot:t,pixelSize:n,width:r,height:i}=this;return[r??Math.round(t.innerWidth()/n),i??Math.round(t.innerHeight()/n)]}queryResult(t){let[n,r]=this.bins;return this.grids=EF(n,r,t,this.aggr,this.groupby),this.convolve()}convolve(){let{aggr:t,bandwidth:n,bins:r,grids:i,plot:o}=this;if(this.kde=this.grids,n>0){let s=t.length===1?t[0]:t.includes(Us)?Us:null;if(!s)return console.warn("No compatible grid found for smoothing."),this;let a=o.innerWidth(),c=o.innerHeight(),[l,u]=r,f=i.some(p=>p[s].some(m=>m<0)),h=Rm(n*(l-1)/a,f),d=Rm(n*(u-1)/c,f);this.kde=this.grids.map(p=>{let m=OF(h,d,p[s],r);return{...p,[s]:m}})}return this}plotSpecs(){throw new Error("Unimplemented. Use a Grid2D mark subclass.")}};function IG(e){let t={};for(let n in e)e[n]==="density"&&(delete e[n],t[n]=!0);return t}function MG(e,t,n,r,i,o){return e.select({index:q`FLOOR(${t})::INTEGER + FLOOR(${n})::INTEGER * ${i}`,...r}).groupby("index",o)}function AG(e,t,n,r,i,o){let s=r?.column?`* ${r.column}`:"",a=(h,d)=>e.clone().select({xp:t,yp:n,i:h,w:d}),c=a(q`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${i}`,q`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),l=a(q`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${i}`,q`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(q`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${i}`,q`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(q`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${i}`,q`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return Lt.from(Lt.unionAll(c,l,u,f)).select({index:"i",density:Ii("w")},o).groupby("index",o).having(td("density",0))}var t3=class extends Ci{constructor(t,n){let{thresholds:r=10,...i}=n;super("geo",t,{bandwidth:20,interpolate:"linear",pixelSize:2,...i}),An(this,"thresholds",r,()=>this.grids?this.contours().update():null)}convolve(){return super.convolve().contours()}contours(){let{bins:t,densityMap:n,kde:r,thresholds:i,plot:o}=this,s=i;if(!Array.isArray(s)){let[,w]=km(r,"density");s=Array.from({length:s-1},(v,_)=>w*(_+1)/s)}(n.fill||n.stroke)&&this.plot.getAttribute("colorScale")!=="log"&&this.plot.setAttribute("colorZero",!0);let[a,c]=t,[l,u]=o.getAttribute("xDomain"),[f,h]=o.getAttribute("yDomain"),d=(u-l)/a,p=(h-f)/c,m=+l,g=+f,y=w=>m+w*d,b=w=>g+w*p,x=ga().size(t);return this.data=r.flatMap(w=>s.map(v=>Object.assign(TG(x.contour(w.density,v),y,b),{...w,density:v}))),this}plotSpecs(){let{type:t,channels:n,densityMap:r,data:i}=this,o={};for(let s of n){let{channel:a}=s;a!=="x"&&a!=="y"&&(o[a]=ri(s))}return r.fill&&(o.fill="density"),r.stroke&&(o.stroke="density"),[{type:t,data:i,options:o}]}};function TG(e,t,n){function r(s){s.forEach(i)}function i(s){s.forEach(o)}function o(s){s[0]=t(s[0]),s[1]=n(s[1])}return e.coordinates.forEach(r),e}function Iw(e,t){if(typeof document<"u"){let n=document.createElement("canvas");return n.setAttribute("width",e),n.setAttribute("height",t),n}throw new Error("Can not create a canvas instance.")}function BF(e=1){let t=255*e|0;return(n,r,i)=>{for(let o=0,s=0;o<i;++o)for(let a=0;a<r;++a,s+=4)n[s+3]=t}}function FF(e){let{apply:t}=e;return(n,r,i,o)=>{for(let s=0,a=0;s<i;++s)for(let c=0,l=(i-s-1)*r;c<r;++c,a+=4)n[a+3]=255*t(o[c+l])|0}}function CF(e={}){let{r:t=0,g:n=0,b:r=0,opacity:i=1}=typeof e=="string"?Je(e):e,o=new Uint8ClampedArray([t,n,r,255*i|0]);return(s,a,c)=>{for(let l=0,u=0;l<c;++l)for(let f=0;f<a;++f,u+=4)s[u+0]=o[0],s[u+1]=o[1],s[u+2]=o[2],s[u+3]=o[3]}}function LF(e){let{domain:t,range:n}=e,r=Object.create(null),i=new Uint8ClampedArray(4*t.length),o=t.length-1,s=n.length;for(let a=0;a<=o;++a){let c=n[a%s],{r:l,g:u,b:f,opacity:h=1}=typeof c=="string"?Je(c):c,d=a<<2;i[d+0]=l,i[d+1]=u,i[d+2]=f,i[d+3]=255*h|0,r[t[a]]=d}return(a,c,l,u)=>{if(u.map)for(let f=0,h=0;f<l;++f)for(let d=0,p=(l-f-1)*c;d<c;++d,h+=4){let m=r[u[d+p]];a[h+0]=i[m+0],a[h+1]=i[m+1],a[h+2]=i[m+2],a[h+3]=i[m+3]}else{let f=r[u];for(let h=0,d=0;h<l;++h)for(let p=0;p<c;++p,d+=4)a[d+0]=i[f+0],a[d+1]=i[f+1],a[d+2]=i[f+2],a[d+3]=i[f+3]}}}function kF(e,t,n){let{interpolate:r}=t,i=new Uint8ClampedArray(4*e),o=e-1;for(let s=0;s<=o;++s){let a=r(s/o),{r:c,g:l,b:u,opacity:f=1}=typeof a=="string"?Je(a):a,h=s<<2;i[h+0]=c,i[h+1]=l,i[h+2]=u,i[h+3]=255*f|0}return(s,a,c,l)=>{for(let u=0,f=0;u<c;++u)for(let h=0,d=(c-u-1)*a;h<a;++h,f+=4){let p=o*n(l[h+d])<<2;s[f+0]=i[p+0],s[f+1]=i[p+1],s[f+2]=i[p+2],s[f+3]=i[p+3]}}}var zf=class extends Ci{constructor(t,n){super("image",t,n)}setPlot(t,n){let r=()=>{this.stats&&this.rasterize()};t.addAttributeListener("schemeColor",r),super.setPlot(t,n)}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:t,kde:n}=this,[r,i]=t,{canvas:o,ctx:s,img:a}=OG(this,r,i),{alpha:c,alphaProp:l,color:u,colorProp:f}=n3(this);return this.data=n.map(h=>(u?.(a.data,r,i,h[f]),c?.(a.data,r,i,h[l]),s.putImageData(a,0,0),{src:o.toDataURL()})),this}plotSpecs(){let{type:t,plot:n,data:r}=this,i={src:"src",width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:t,data:r,options:i}]}},e3=class extends zf{constructor(t,n){super(t,{bandwidth:20,interpolate:"linear",pixelSize:2,...n})}};function n3(e){let{aggr:t,densityMap:n,groupby:r,plot:i}=e,o=t.includes(Us),s=t.includes("fillOpacity"),a=e.channel("fill"),c=e.channel("fillOpacity");if(t.length>2||o&&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 l=n.fill||t.includes("fill")?"grid":r.includes(a?.as)?"group":xw(a?.value)?a.value:o&&i.getAttribute("colorScheme")?"grid":void 0,u=n.fillOpacity||t.includes("fillOpacity")?"grid":typeof c?.value=="number"?c.value:o&&l!=="grid"?"grid":void 0;if(l!=="grid"&&u!=="grid")throw new Error("Raster mark missing density values.");let f=a?.as??(l==="grid"?Us:null),h=c?.as??(u==="grid"?Us:null),d=l!=="grid"&&l!=="group"?CF(l):DG(e,f),p=u!=="grid"?BF(u):EG(e,h);return{alphaProp:h,colorProp:f,alpha:p,color:d}}function EG(e,t){let{plot:n,kde:r}=e,i=n.getAttribute("opacityDomain"),o=i===qs,s=i?.[dn],a=!o&&!s&&i||km(r,t);(o||s)&&(s&&(a[dn]=!0),n.setAttribute("colorDomain",a));let c=lf({opacity:{type:n.getAttribute("opacityScale"),domain:a,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 FF(c)}function DG(e,t){let{plot:n,kde:r}=e,i=!r[0][t]?.map,o=i||Array.isArray(r[0][t]),s=n.getAttribute("colorDomain"),a=s===qs,c=s?.[dn],l=!a&&!c&&s||(i?r.map(f=>f[t]).sort($t):o?NF(r,t):km(r,t));(a||c)&&(c&&(l[dn]=!0),n.setAttribute("colorDomain",l));let u=lf({color:{type:n.getAttribute("colorScale"),domain:l,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(o)return LF(u);{let f=lf({x:{type:NG(u.type),domain:u.domain,reverse:u.reverse,range:[0,1],clamp:u.clamp,base:u.base,exponent:u.exponent,constant:u.constant}});return kF(1024,u,f.apply)}}function NG(e){return e.endsWith("symlog")?"symlog":e.endsWith("log")?"log":e.endsWith("pow")?"pow":e.endsWith("sqrt")?"sqrt":e==="diverging"?"linear":e}function OG(e,t,n){if(!e.image||e.image.w!==t||e.image.h!==n){let r=Iw(t,n),i=r.getContext("2d",{willReadFrequently:!0}),o=i.getImageData(0,0,t,n);e.image={canvas:r,ctx:i,img:o,w:t,h:n}}return e.image}var r3=class extends zf{constructor(t,n){let{normalize:r=!0,...i}=n;super(t,i),An(this,"normalize",r)}query(t=[]){let{channels:n,normalize:r,source:i,binPad:o}=this,[s,a]=this.bins=this.binDimensions(this),[c]=kr(this,"x",s,Eo(this,t),o),[l]=kr(this,"y",a,Do(this,t),o),u=Lt.from(i.table).where(BG(this,t));this.aggr=["density"];let f=this.groupby=[],h=[];for(let d of n)if(Object.hasOwn(d,"field")){let{channel:p,field:m}=d;p==="z"?(u.select({[p]:m}),h.push("z")):p!=="x"&&p!=="y"&&(u.select({[p]:m}),f.push(p))}return FG(u,c,l,h,s,a,f,r)}};function BG(e,t){if(Array.isArray(t)&&!t.length)return t;let n=e.channelField("x").field.column,r=e.channelField("y").field.column,i=s=>s.op!=="BETWEEN"||s.field.column!==n&&s.field.column!==r,o=s=>s.op==="AND"?Mr(s.children.filter(a=>i(a))):s;return Array.isArray(t)?t.filter(s=>i(s)).map(s=>o(s)):o(t)}function FG(e,t,n,r,i,o,s=[],a=!0){e.select({x:q`FLOOR(${t})::INTEGER`,y:q`FLOOR(${n})::INTEGER`});let c=s.concat(r),l=c.length?`PARTITION BY ${c.join(", ")} `:"",u=Lt.from(e).select(c,{x0:"x",y0:"y",dx:q`(lead(x) OVER sw - x)`,dy:q`(lead(y) OVER sw - y)`}).window({sw:q`${l}ORDER BY x ASC`}).qualify(Mr(q`(x0 < ${i} OR x0 + dx < ${i})`,q`(y0 < ${o} OR y0 + dy < ${o})`,q`(x0 > 0 OR x0 + dx > 0)`,q`(y0 > 0 OR y0 + dy > 0)`)),f=Lt.select({x:q`GREATEST(MAX(ABS(dx)), MAX(ABS(dy)))`}).from("pairs"),h=Lt.select({i:q`UNNEST(range((${f})))::INTEGER`}),d=Lt.unionAll(Lt.select(c,{x:q`x0 + i`,y:q`y0 + ROUND(i * dy / dx::FLOAT)::INTEGER`}).from("pairs","indices").where(q`ABS(dy) <= ABS(dx) AND i < ABS(dx)`),Lt.select(c,{x:q`x0 + ROUND(SIGN(dy) * i * dx / dy::FLOAT)::INTEGER`,y:q`y0 + SIGN(dy) * i`}).from("pairs","indices").where(q`ABS(dy) > ABS(dx) AND i < ABS(dy)`),Lt.select(c,{x:"x0",y:"y0"}).from("pairs").where(Jh("dx"))),p=["x"].concat(c).join(", "),m=Lt.from("raster").select(c,"x","y",a?{w:q`1.0 / COUNT(*) OVER (PARTITION BY ${p})`}:null).where(Mr(Oe("x",[0,i],!0),Oe("y",[0,o],!0)));return Lt.with({pairs:u,indices:h,raster:d,points:m}).from("points").select(s,{index:q`x + y * ${i}::INTEGER`,density:a?Ii("w"):Si()}).groupby("index",s)}var i3=class extends nr{constructor(t,n,r){let{bins:i=1024,bandwidth:o=20,...s}=r,a=t.endsWith("X")?"y":"x";super(t,n,s,a==="x"?HM:ZM),this.dim=a,An(this,"bins",i),An(this,"bandwidth",o,()=>this.grid?this.convolve().update():null)}get filterIndexable(){let t=this.dim==="x"?"xDomain":"yDomain",n=this.plot.getAttribute(t);return n&&!n[dn]}query(t=[]){if(this.hasOwnData())throw new Error("Density1DMark requires a data source");let{bins:n,channels:r,dim:i,source:{table:o}}=this,s=this.extent=(i==="x"?Eo:Do)(this,t),[a,c]=kr(this,i,n,s),l=XM(r,o,[i]).where(t.concat(Oe(c,s))),u=this.channelField("weight")?"weight":null;return CG(l,a,u)}queryResult(t){return this.grid=TF(this.bins,t),this.convolve()}convolve(){let{bins:t,bandwidth:n,dim:r,grid:i,plot:o,extent:[s,a]}=this,c=i.some(b=>b<0),l=r==="x"?o.innerWidth():o.innerHeight(),u=Rm(n*(t-1)/l,c),f=Sw(u,i,t),h=this.data=[],d=r==="x"?"y":"x",p=this.channelField(r).as,m=+s,g=(a-m)/(t-1),y=1/g;for(let b=0;b<t;++b)h.push({[p]:m+b*g,[d]:f[b]*y});return this}plotSpecs(){let{type:t,data:n,channels:r,dim:i}=this,o=i==="x"?{y:"y"}:{x:"x"};for(let s of r)o[s.channel]=ri(s);return[{type:t,data:n,options:o}]}};function CG(e,t,n){let r=n?`* ${n}`:"",i=e.clone().select({p:t,i:q`FLOOR(p)::INTEGER`,w:q`(FLOOR(p) + 1 - p)${r}`}),o=e.clone().select({p:t,i:q`FLOOR(p)::INTEGER + 1`,w:q`(p - FLOOR(p))${r}`});return Lt.from(Lt.unionAll(i,o)).select({index:"i",density:Ii("w")}).groupby("index").having(O_("density",0))}var o3=class extends Ci{constructor(t,n){let{type:r="dot",...i}=n;super(r,t,{bandwidth:20,interpolate:"linear",pad:0,pixelSize:2,...i})}convolve(){super.convolve();let{bins:t,pad:n,extentX:r,extentY:i}=this,[o,s]=t,a=wl(this,"x"),c=wl(this,"y"),[l,u]=r.map(g=>a.apply(g)),[f,h]=i.map(g=>c.apply(g)),d=(u-l)/(o-n),p=(h-f)/(s-n),m=n?0:.5;return this.data=LG(this.kde,t,l,f,d,p,a.invert,c.invert,m),this}plotSpecs(){let{type:t,channels:n,densityMap:r,data:i}=this,o={};for(let s of n){let{channel:a}=s;o[a]=a==="x"||a==="y"?a:ri(s)}for(let s in r)r[s]&&(o[s]="density");return[{type:t,data:i,options:o}]}};function LG(e,t,n,r,i,o,s,a,c){let l=1/(i*o),[u,f]=t,h=[];for(let d of e){let p=d.density;for(let m=0,g=0;g<f;++g)for(let y=0;y<u;++y,++m)h.push({...d,x:s(n+(y+c)*i),y:a(r+(g+c)*o),density:p[m]*l})}return h}var kG="geom",s3=class extends nr{constructor(t,n={},r){!_w(t)&&!n?.geometry&&(n.geometry=z_(kG)),super("geo",t,n,r)}queryResult(t){super.queryResult(t);let n=this.channelField("geometry")?.as;return n&&this.data&&this.data.forEach(r=>{typeof r[n]=="string"&&(r[n]=JSON.parse(r[n]))}),this}};var a3=class extends nr{constructor(t,n){let{type:r="hexagon",binWidth:i=20,...o}=n;super(r,t,{r:i/2,clip:!0,...o},vw),this.binWidth=i}get filterIndexable(){let t=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return t&&n&&!t[dn]&&!n[dn]}query(t=[]){if(this.hasOwnData())return null;let{plot:n,binWidth:r,channels:i,source:o}=this,[s,a]=Eo(this,t),[c,l]=Do(this,t),u=.5-n.getAttribute("marginLeft"),f=0-n.getAttribute("marginTop"),h=`${r}::DOUBLE`,d=`${r*(1.5/Math.sqrt(3))}::DOUBLE`,p=`${n.innerWidth()/(a-s)}::DOUBLE`,m=`${n.innerHeight()/(l-c)}::DOUBLE`,g,y,b=new Set,x={};for(let E of i)E.channel==="orderby"?w.orderby(E.value):E.channel==="x"?g=E:E.channel==="y"?y=E:Object.hasOwn(E,"field")&&(x[E.as]=E.field,E.field.aggregate&&E.field.columns.forEach(N=>b.add(N)));let w=Lt.select({[g.as]:q`${s}::DOUBLE + ((x + 0.5 * (y & 1)) * ${h} + ${u})::DOUBLE / ${p}`,[y.as]:q`${l}::DOUBLE - (y * ${d} + ${f})::DOUBLE / ${m}`,...x}).groupby("x","y"),v=`${p} * (${g.field} - ${s}::DOUBLE)`,_=`${m} * (${l}::DOUBLE - ${y.field})`,M=Lt.select({py:q`(${_} - ${f}) / ${d}`,pj:q`ROUND(py)::INTEGER`,px:q`(${v} - ${u}) / ${h} - 0.5 * (pj & 1)`,pi:q`ROUND(px)::INTEGER`,tt:q`ABS(py-pj) * 3 > 1 AND (px-pi)**2 + (py-pj)**2 > (px - pi - 0.5 * CASE WHEN px < pi THEN -1 ELSE 1 END)**2 + (py - pj - CASE WHEN py < pj THEN -1 ELSE 1 END)**2`,x:q`CASE WHEN tt THEN (pi + (CASE WHEN px < pi THEN -0.5 ELSE 0.5 END) + (CASE WHEN pj & 1 <> 0 THEN 0.5 ELSE -0.5 END))::INTEGER ELSE pi END`,y:q`CASE WHEN tt THEN (pj + CASE WHEN py < pj THEN -1 ELSE 1 END)::INTEGER ELSE pj END`}).select(Array.from(b)).from(o.table).where(yc(g.field),yc(y.field),t);return w.from(M)}};var c3=class extends Ci{constructor(t,n){let{origin:r=[0,0],dim:i="xy",...o}=n;super("image",t,o),this.origin=r,this.tileX=i.toLowerCase().includes("x"),this.tileY=i.toLowerCase().includes("y")}setPlot(t,n){let r=()=>{this.stats&&this.rasterize()};t.addAttributeListener("schemeColor",r),super.setPlot(t,n)}requestQuery(){return this.requestTiles()}query(t=[]){return this._filter=t,null}tileQuery(t){let{binType:n,binPad:r,channels:i,densityMap:o,source:s}=this,[[a,c],[l,u]]=t,[f,h]=this.bins,[d,p]=kr(this,"x",f,[a,c],r),[m,g]=kr(this,"y",h,[l,u],r),y=r?[Oe(p,[+a,+c]),Oe(g,[+l,+u])]:[bc(+a,p),gc(p,+c),bc(+l,g),gc(g,+u)],b=Lt.from(s.table).where(y),x=this.groupby=[],w={};for(let _ of i)if(Object.hasOwn(_,"field")){let{as:M,channel:E,field:N}=_;N.aggregate?(w[E]=N,o[E]=!0):E==="weight"?w.density=Ii(N):E!=="x"&&E!=="y"&&(b.select({[M]:N}),x.push(M))}let v=this.aggr=Object.keys(w);if(w.density&&v.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(v.length||(v.push("density"),w.density=Si()),n==="linear"){if(v.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!w.density)throw new Error("Linear binning not applicable to custom aggregates.");return zG(b,d,m,w.density,f,x)}else return UG(b,d,m,w,f,x)}async requestTiles(){let t=V_();this.prefetch&&t.cancel(this.prefetch);let{binPad:n,tileX:r,tileY:i,origin:[o,s]}=this,[a,c]=this.bins=this.binDimensions(this),[l,u]=Eo(this,this._filter),[f,h]=Do(this,this._filter),d=u-l,p=h-f,m=Math.floor((l-o)*(a-n)/d),g=Math.floor((f-s)*(c-n)/p),y=(I,T)=>[[o+I*d,o+(I+1)*d],[s+T*p,s+(T+1)*p]],b=Math.floor((l-o)/d),x=r?RF((u-o)/d):b,w=Math.floor((f-s)/p),v=i?RF((h-s)/p):w,_=[];for(let I=b;I<=x;++I)for(let T=w;T<=v;++T)_.push([I,T]);let M=_.map(([I,T])=>t.query(this.tileQuery(y(I,T)))),E=[];if(r)for(let I=w;I<=v;++I)E.push([x+1,I]),E.push([b-1,I]);if(i){let I=r?b-1:b,T=r?x+1:x;for(let O=I;O<=T;++O)E.push([O,v+1]),E.push([O,w-1])}this.prefetch=E.map(([I,T])=>t.prefetch(this.tileQuery(y(I,T))));let N=await Promise.all(M);this.grids=[{density:RG(a,c,m,g,_,N)}],this.convolve().update()}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:t,kde:n}=this,[r,i]=t,{canvas:o,ctx:s,img:a}=PG(this,r,i),{alpha:c,alphaProp:l,color:u,colorProp:f}=n3(this);return this.data=n.map(h=>(u?.(a.data,r,i,h[f]),c?.(a.data,r,i,h[l]),s.putImageData(a,0,0),{src:o.toDataURL()})),this}plotSpecs(){let{type:t,data:n,plot:r}=this,i={src:"src",width:r.innerWidth(),height:r.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:t,data:n,options:i}]}};function RG(e,t,n,r,i,o){let s=new Float64Array(e*t);return o.forEach((a,c)=>{let[l,u]=i[c],f=l*e-n,h=u*t-r;$G(e,t,s,a,f,h)}),s}function $G(e,t,n,r,i,o){let s=r.numRows;if(s===0)return;let a=r.getChild("index").toArray(),c=r.getChild("density").toArray();for(let l=0;l<s;++l){let u=a[l],f=i+u%e,h=o+Math.floor(u/e);0<=f&&f<e&&0<=h&&h<t&&(n[f+h*e]=c[l])}}function PG(e,t,n){if(!e.image||e.image.w!==t||e.image.h!==n){let r=Iw(t,n),i=r.getContext("2d",{willReadFrequently:!0}),o=i.getImageData(0,0,t,n);e.image={canvas:r,ctx:i,img:o,w:t,h:n}}return e.image}function UG(e,t,n,r,i,o){return e.select({index:q`FLOOR(${t})::INTEGER + FLOOR(${n})::INTEGER * ${i}`,...r}).groupby("index",o)}function zG(e,t,n,r,i,o){let s=r.column?`* ${r.column}`:"",a=(h,d)=>e.clone().select({xp:t,yp:n,i:h,w:d}),c=a(q`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${i}`,q`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),l=a(q`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${i}`,q`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(q`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${i}`,q`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(q`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${i}`,q`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return Lt.from(Lt.unionAll(c,l,u,f)).select({index:"i",density:Ii("w")},o).groupby("index",o).having(td("density",0))}function RF(e){let t=Math.floor(e);return t===e?t-1:t}function qG(e,t,n){var r=1e-8,i=t-1,o=n-1,s=0,a,c,l,u,f,h,d,p,m,g,y;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&n>=1?(l=e<.5?e:1-e,u=Math.sqrt(-2*Math.log(l)),d=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(d=-d),p=(d*d-3)/6,m=2/(1/(2*t-1)+1/(2*n-1)),g=d*Math.sqrt(p+m)/m-(1/(2*n-1)-1/(2*t-1))*(p+5/6-2/(3*m)),d=t/(t+n*Math.exp(2*g))):(a=Math.log(t/(t+n)),c=Math.log(n/(t+n)),u=Math.exp(t*a)/t,f=Math.exp(n*c)/n,g=u+f,e<u/g?d=Math.pow(t*g*e,1/t):d=1-Math.pow(n*g*(1-e),1/n)),y=-qf(t)-qf(n)+qf(t+n);s<10;s++){if(d===0||d===1)return d;if(h=VG(d,t,n)-e,u=Math.exp(i*Math.log(d)+o*Math.log(1-d)+y),f=h/u,d-=u=f/(1-.5*Math.min(1,f*(i/d-o/(1-d)))),d<=0&&(d=.5*(d+u)),d>=1&&(d=.5*(d+u+1)),Math.abs(u)<r*d&&s>0)break}return d}function VG(e,t,n){var r=e===0||e===1?0:Math.exp(qf(t+n)-qf(t)-qf(n)+t*Math.log(e)+n*Math.log(1-e));return e<0||e>1?!1:e<(t+1)/(t+n+2)?r*$F(e,t,n)/t:1-r*$F(1-e,n,t)/n}function $F(e,t,n){var r=1e-30,i=1,o=t+n,s=t+1,a=t-1,c=1,l=1-o*e/s,u,f,h,d;for(Math.abs(l)<r&&(l=r),l=1/l,d=l;i<=100&&(u=2*i,f=i*(n-i)*e/((a+u)*(t+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,d*=l*c,f=-(t+i)*(o+i)*e/((t+u)*(s+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,h=l*c,d*=h,!(Math.abs(h-1)<3e-7));i++);return d}function qf(e){var t=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,i,o,s;for(s=(o=i=e)+5.5,s-=(i+.5)*Math.log(s);t<6;t++)r+=n[t]/++o;return Math.log(2.506628274631*r/i)-s}function PF(e,t){var n=qG(2*Math.min(e,1-e),.5*t,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}var l3=class extends nr{constructor(t,n){let{ci:r=.95,precision:i=4,...o}=n;super("line",t,o);let s=()=>this.modelFit?this.confidenceBand().update():null;An(this,"ci",r,s),An(this,"precision",i,s)}query(t=[]){let n=this.channelField("x").as,r=this.channelField("y").as,i=Array.from(new Set(["stroke","z","fx","fy"].flatMap(o=>this.channelField(o)?.as||[])));return Lt.from(super.query(t)).select({intercept:C_(r,n),slope:L_(r,n),n:k_(r,n),ssy:R_(r,n),ssx:$_(r,n),xm:P_(r,n),x0:_0(ca(n).where(yc(r))),x1:_0(aa(n).where(yc(r)))}).select(i).groupby(i)}queryResult(t){return this.modelFit=ww(t),this.lineData=this.modelFit.flatMap(n=>jG(n)),this.confidenceBand()}confidenceBand(){let{ci:t,modelFit:n,precision:r,plot:i}=this,o=i.innerWidth();return this.areaData=t?n.flatMap(s=>YG(t,r,s,o)):null,this}plotSpecs(){let{lineData:t,areaData:n,channels:r,ci:i}=this,o={x:"x",y:"y"},s={x:"x",y1:"y1",y2:"y2",fillOpacity:.1};for(let a of r)switch(a.channel){case"x":case"y":case"fill":break;case"stroke":o.stroke=s.fill=ri(a);break;case"strokeOpacity":o.strokeOpacity=ri(a);break;case"fillOpacity":s.fillOpacity=ri(a);break;default:o[a.channel]=s[a.channel]=ri(a);break}return[...i?[{type:"areaY",data:n,options:s}]:[],{type:"line",data:t,options:o}]}};function jG(e){let{x0:t,x1:n,xm:r,intercept:i,slope:o,n:s,ssx:a,ssy:c,...l}=e;return[{x:t,y:i+t*o,...l},{x:n,y:i+n*o,...l}]}function YG(e,t,n,r){let{x0:i,x1:o,xm:s,intercept:a,slope:c,n:l,ssx:u,ssy:f,...h}=n,d=t*(o-i)/r,p=PF((1-e)/2,l-2)*Math.sqrt(f/(l-2));return ke(i,o-d/2,d).concat(o).map(m=>{let g=a+m*c,y=p*Math.sqrt(1/l+(m-s)**2/u);return{x:m,y1:g-y,y2:g+y,...h}})}function UF(e){let t=e.toLowerCase(),n=e.length,r="";for(let i=0;i<n;++i)r+=(e[i]!==t[i]?"-":"")+t[i];return r}function Vf(e){let t={};for(let n in e)t[UF(n)]=e[n];return t}function WG(e){let{channels:t}=e,n=new Set,r=!1,i=!1;for(let o of t){let{channel:s,field:a,as:c}=o;if(s==="orderby")r=!0;else if(a)if(a.aggregate)i=!0;else{if(n.has(c))continue;n.add(c)}}return!r&&i&&n.size&&e.channels.push({channel:"orderby",value:Array.from(n)}),e}var u3=class{constructor(t,{selection:n,channels:r={}}){this.mark=WG(t),this.selection=n;let i=Object.entries(Vf(r));this.channels=i.length?i:[["opacity",.2]],this.selection.addEventListener("value",Wf(()=>this.update()))}init(t){this.svg=t;let n=this.values=[],r=this.mark.index,i=this.nodes=t.querySelectorAll(`[data-index="${r}"] > *`),{channels:o}=this;for(let s=0;s<i.length;++s){let a=i[s];n.push(o.map(c=>a.getAttribute(c[0])))}return this.update()}async update(){let{svg:t,nodes:n,channels:r,values:i,mark:o,selection:s}=this;if(!t)return;let a=await GG(o,s);for(let c=0;c<n.length;++c){let l=n[c],u=i[c],f=a(l.__data__);for(let h=0;h<r.length;++h){let[d,p]=r[h];l.setAttribute(d,f?u[h]:p)}}}};async function GG(e,t){let n=t?.predicate(e);if(!n||n.length===0)return()=>!0;let r=e.filterBy?.predicate(e,!0),i={__:Mr(n)},o=e.query(r),s=o.groupby().length?o.select(i):o.$select(i),a=await e.coordinator.query(s),c=a.getChild?.("__");return a.numRows||a.length?c?l=>c.get(l):l=>a[l].__:()=>!1}function f3(e){let t=e.on,n=!0;function r(i){n=!1,i(),n=!0}return e.reset=(...i)=>{r(()=>e.clear(...i))},e.moveSilent=(...i)=>{r(()=>e.move(...i))},e.on=(...i)=>{if(i.length>1&&i[1]){let o=i[1];i[1]=(...s)=>n&&o(...s)}return t(...i)},e}function zF(){return f3(Nv())}function qF(){return f3(Ev())}function VF(){return f3(Dv())}function $m(e,t){return e===t||e&&t&&Math.abs(e[0]-t[0])<1e-12&&Math.abs(e[1]-t[1])<1e-12||!1}function No(e,t){let n=e.channelField(t)?.field;return n?.basis||n}function Pm(e,t,n=1){return t.invert(n*Math.floor(e/n))}function Mw(){let e=this,t=e.getScreenCTM,n;e.getScreenCTM=()=>e.isConnected?n=t.call(e):n}var h3=class{constructor(t,{channel:n,selection:r,field:i,pixelSize:o=1,peers:s=!0,brush:a}){this.mark=t,this.channel=n,this.pixelSize=o||1,this.selection=r,this.peers=s,this.field=i||No(t,[n,n+"1",n+"2"]),this.style=a&&Vf(a),this.brush=n==="y"?VF():qF(),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(t){let n;t&&(n=t.map(r=>Pm(r,this.scale,this.pixelSize)).sort((r,i)=>r-i)),$m(n,this.value)||(this.value=n,this.g.call(this.brush.moveSilent,t),this.selection.update(this.clause(n)))}clause(t){let{mark:n,pixelSize:r,field:i,scale:o}=this;return{source:this,schema:{type:"interval",pixelSize:r,scales:[o]},clients:this.peers?n.plot.markSet:new Set().add(n),value:t,predicate:t?Oe(i,t):null}}init(t){let{brush:n,channel:r,style:i}=this;this.scale=t.scale(r);let o=t.scale("x").range,s=t.scale("y").range;n.extent([[oe(o),oe(s)],[Vt(o),Vt(s)]]);let a=Pt(t).selectAll('g[aria-label="facet"]'),c=a.size()?a:Pt(t);if(this.g=c.append("g").attr("class",`interval-${r}`).each(Mw).call(n).call(n.moveSilent,this.value?.map(this.scale.apply)),i){let l=this.g.selectAll("rect.selection");for(let u in i)l.attr(u,i[u])}t.addEventListener("pointerenter",()=>this.activate())}};var Aw=(e,t)=>e-t,d3=class{constructor(t,{selection:n,xfield:r,yfield:i,pixelSize:o=1,peers:s=!0,brush:a}){this.mark=t,this.pixelSize=o||1,this.selection=n,this.peers=s,this.xfield=r||No(t,["x","x1","x2"]),this.yfield=i||No(t,["y","y1","y2"]),this.style=a&&Vf(a),this.brush=zF(),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(t){let{value:n,pixelSize:r,xscale:i,yscale:o}=this,s,a;if(t){let[c,l]=t;s=[c[0],l[0]].map(u=>Pm(u,i,r)).sort(Aw),a=[c[1],l[1]].map(u=>Pm(u,o,r)).sort(Aw)}(!$m(s,n?.[0])||!$m(a,n?.[1]))&&(this.value=t?[s,a]:void 0,this.g.call(this.brush.moveSilent,t),this.selection.update(this.clause(this.value)))}clause(t){let{mark:n,pixelSize:r,xfield:i,yfield:o,xscale:s,yscale:a}=this;return{source:this,schema:{type:"interval",pixelSize:r,scales:[s,a]},clients:this.peers?n.plot.markSet:new Set().add(n),value:t,predicate:t?Mr(Oe(i,t[0]),Oe(o,t[1])):null}}init(t){let{brush:n,style:r}=this,i=this.xscale=t.scale("x"),o=this.yscale=t.scale("y"),s=i.range,a=o.range;n.extent([[oe(s),oe(a)],[Vt(s),Vt(a)]]);let c=Pt(t).selectAll('g[aria-label="facet"]'),l=c.size()?c:Pt(t);if(this.g=l.append("g").attr("class","interval-xy").each(Mw).call(n),r){let u=this.g.selectAll("rect.selection");for(let f in r)u.attr(f,r[f])}if(this.value){let[u,f]=this.value[0].map(i.apply).sort(Aw),[h,d]=this.value[1].map(o.apply).sort(Aw);this.g.call(n.moveSilent,[[u,h],[f,d]])}t.addEventListener("pointerenter",()=>this.activate())}};var p3=class{constructor(t,{selection:n,channel:r,field:i}){this.mark=t,this.selection=n,this.clients=new Set().add(t),this.channel=r,this.field=i||No(t,[r])}clause(t){let{clients:n,field:r}=this,i=t?N_(r,Zh(t)):null;return{source:this,schema:{type:"point"},clients:n,value:t,predicate:i}}init(t){let n=this,{mark:r,channel:i,selection:o}=this,{data:s}=r,a=r.channelField(i).as,c=Pt(t).selectAll('g[aria-label="facet"]'),l=c.size()?c:Pt(t),u=t.scale(i),f=!Y_(o);l.on("pointerdown pointermove",function(h){let[d,p]=Dn(h,this),m=XG(s,a,u.invert(i==="x"?d:p));o.update(f?m:n.clause(m))}),!f&&t.addEventListener("pointerenter",()=>{this.selection.activate(this.clause(0))})}};function XG(e,t,n){let r=1/0,i;return e.forEach(o=>{let s=Math.abs(o[t]-n);s<r&&(r=s,i=o[t])}),i}var jF=(e,t)=>e-t,y3=class{constructor(t,{x:n=new vc,y:r=new vc,xfield:i,yfield:o,zoom:s=!0,panx:a=!0,pany:c=!0}){this.mark=t,this.xsel=n,this.ysel=r,this.xfield=i||No(t,["x","x1","x2"]),this.yfield=o||No(t,["y","y1","y2"]),this.zoom=m3(s,[0,1/0],[1,1]),this.panx=this.xsel&&a,this.pany=this.ysel&&c;let{plot:l}=t;a&&this.xsel.addEventListener("value",u=>{l.setAttribute("xDomain",u)&&l.update()}),c&&this.ysel.addEventListener("value",u=>{l.setAttribute("yDomain",u)&&l.update()})}publish(t){if(this.panx){let n=HG(t,this.xscale);this.xsel.update(this.clause(n,this.xfield,this.xscale))}if(this.pany){let n=ZG(t,this.yscale);this.ysel.update(this.clause(n,this.yfield,this.yscale))}}clause(t,n,r){return{source:this,schema:{type:"interval",scales:[r]},clients:this.mark.plot.markSet,value:t,predicate:t?Oe(n,t):null}}init(t){if(this.svg=t,this.initialized)return;this.initialized=!0;let{panx:n,pany:r,mark:{plot:{element:i}},xsel:o,ysel:s}=this;this.xscale=t.scale("x"),this.yscale=t.scale("y");let a=this.xscale.range.slice().sort(jF),c=this.yscale.range.slice().sort(jF),l=m3(n,[-1/0,1/0],a),u=m3(r,[-1/0,1/0],c),f=WS().extent([[a[0],c[0]],[a[1],c[1]]]).scaleExtent(this.zoom).translateExtent([[l[0],u[0]],[l[1],u[1]]]).on("start",()=>{this.xscale=this.svg.scale("x"),this.yscale=this.svg.scale("y")}).on("end",()=>i.__zoom=new Or(1,0,0)).on("zoom",({transform:h})=>this.publish(h));if(Pt(i).call(f),n||r){let h=!1;i.addEventListener("mouseenter",()=>{if(!h){if(h=!0,n){let{xscale:d,xfield:p}=this;o.activate(this.clause(d.domain,p,d))}if(r){let{yscale:d,yfield:p}=this;s.activate(this.clause(d.domain,p,d))}}}),i.addEventListener("mouseleave",()=>h=!1)}}};function m3(e,t,n){return e?Array.isArray(e)?e:t:n}function HG(e,t){return t.range.map(e.invertX,e).map(t.invert,t)}function ZG(e,t){return t.range.map(e.invertY,e).map(t.invert,t)}var Um=class{constructor(t,{selection:n,channels:r,peers:i=!0}){this.value=null,this.mark=t,this.selection=n,this.peers=i,this.channels=r.map(o=>{let s=o==="color"?["fill","stroke"]:o==="x"?["x","x1","x2"]:o==="y"?["y","y1","y2"]:[o];for(let a=0;a<s.length;++a){let c=t.channelField(s[a]);if(c)return{field:c.field?.basis||c.field,as:c.as}}throw new Error(`Missing channel: ${o}`)})}clause(t){let{channels:n,mark:r}=this,i=null;if(t){let o=t.map(s=>{let a=s.map((c,l)=>B_(n[l].field,Zh(c)));return a.length>1?Mr(a):a[0]});i=o.length>1?Qh(o):o[0]}return{source:this,schema:{type:"point"},clients:this.peers?r.plot.markSet:new Set().add(r),value:t,predicate:i}}init(t,n,r){let{mark:i,channels:o,selection:s}=this,{data:a}=i;r=r||(l=>{let u=a[l.__data__];return o.map(f=>u[f.as])}),n=n||`[data-index="${i.index}"]`;let c=new Set(t.querySelectorAll(n));t.addEventListener("pointerdown",l=>{let u=s.single?s.value:this.value,f=l.target,h=null;if(KG(c,f)){let d=r(f);l.shiftKey&&u?.length?(h=u.filter(p=>g3(p,d)),h.length===u.length&&h.push(d)):u?.length===1&&!g3(u[0],d)?h=null:h=[d]}this.value=h,QG(u,h)&&s.update(this.clause(h))}),t.addEventListener("pointerenter",()=>{this.selection.activate(this.clause([this.channels.map(()=>0)]))})}};function KG(e,t){return e.has(t)||e.has(t.parentNode)||e.has(t.parentNode?.parentNode)}function QG(e,t){return e==null||t==null?e!=null||t!=null:e.length!==t.length||e.some((n,r)=>g3(n,t[r]))}function g3(e,t){let n=e.length;if(t.length!==n)return!0;for(let r=0;r<n;++r)if(e[r]!==t[r])return!0;return!1}var b3=class{constructor(t,n){let{as:r,...i}=n;this.channel=t,this.options={label:null,...i},this.selection=r,this.element=document.createElement("div"),this.element.setAttribute("class","legend"),this.element.value=this}setPlot(t){let{channel:n,selection:r}=this,i=JG(t,n);this.selection&&i&&(this.handler=new Um(i,{selection:r,channels:[n]}),this.selection.addEventListener("value",()=>this.update()))}init(t){let{channel:n,options:r,handler:i}=this,s=t.scale(n).type==="ordinal"?r:{marginTop:1,tickSize:2,height:28,...r};return this.legend=t.legend(n,s),i&&(i.init(this.legend,":scope > div",a=>[a.__data__]),this.update()),this.element.replaceChildren(this.legend),this.element}update(){if(!this.legend)return;let{value:t}=this.selection,n=t&&t.length?new Set(t.map(i=>i[0])):null,r=this.legend.querySelectorAll(":scope > div");for(let i of r){let o=n?n.has(i.__data__):!0;i.style.opacity=o?1:.2}}};function JG({marks:e},t){let n=t==="color"?["fill","stroke"]:t==="opacity"?["opacity","fillOpacity","strokeOpacity"]:null;if(n==null)return null;for(let r=e.length-1;r>-1;--r)if(e[r].channelField(n))return e[r];return null}var tX=new Set(["rectY-x","rectX-y","rect-x","rect-y"]);function YF(e,t={steps:25}){let n=(r,i)=>tX.has(`${r.type}-${i}`)?{[`${i}1`]:x3(r,i,e,t),[`${i}2`]:x3(r,i,e,{...t,offset:1})}:{[i]:x3(r,i,e,t)};return n[Yf]=!0,n}function x3(e,t,n,r){return{column:n,label:n,get stats(){return["min","max"]},get columns(){return[n]},get basis(){return n},toString(){let{apply:i,sqlApply:o,sqlInvert:s}=wl(e,t),{min:a,max:c}=e.stats[n],l=eX(i(a),i(c),r),u=o(n),f=l.min===0?u:`(${u} - ${l.min})`,h=`${(l.max-l.min)/l.steps}::DOUBLE`,d=r.offset?`${r.offset} + `:"",p=`${l.min} + ${h} * (${d}FLOOR(${f} / ${h}))`;return`${s(p)}`}}}function eX(e,t,n){let{steps:r=25,minstep:i=0,nice:o=!0}=n;if(o!==!1){let s=t-e,a=r,c=Math.LN10,l=Math.ceil(Math.log(a)/c),u=Math.max(i,Math.pow(10,Math.round(Math.log(s)/c)-l));for(;Math.ceil(s/u)>a;)u*=10;let f=[5,2],h;for(let m=0,g=f.length;m<g;++m)h=u/f[m],h>=i&&s/h<=a&&(u=h);h=Math.log(u);let d=h>=0?0:~~(-h/c)+1,p=Math.pow(10,-d-1);h=Math.floor(e/u+p)*u,e=e<h?h-u:h,t=Math.ceil(t/u)*u,r=Math.round((t-e)/u)}return{min:e,max:t,steps:r}}export{QM as ConnectedMark,t3 as ContourMark,r3 as DenseLineMark,i3 as Density1DMark,o3 as Density2DMark,qs as Fixed,s3 as GeoMark,Ci as Grid2DMark,e3 as HeatmapMark,a3 as HexbinMark,u3 as Highlight,h3 as Interval1D,d3 as Interval2D,b3 as Legend,nr as Mark,p3 as Nearest,y3 as PanZoom,YM as Plot,zf as RasterMark,c3 as RasterTileMark,l3 as RegressionMark,Um as Toggle,Yf as Transform,dn as Transient,YF as bin};
|
|
69
|
+
}`)).call(tf,n);for(let F of l){let{channels:R,values:$,facets:U}=m.get(F);if(p===void 0||F.facet==="super"){let G=null;if(U&&(G=U[0],G=F.filter(G,R,$),G.length===0))continue;let J=F.render(G,b,$,_,M);if(J==null)continue;A.appendChild(J)}else{let G;for(let J of p){if(!(F.facetAnchor?.(p,B,J)??!J.empty))continue;let et=null;if(U){let j=f.has(F);if(et=U[j?J.i:0],et=F.filter(et,R,$),et.length===0)continue;!j&&et===U[0]&&(et=Ns(et)),et.fx=J.x,et.fy=J.y,et.fi=J.i}let st=F.render(et,b,$,v,M);if(st!=null){(G??=Pt(A).append("g")).append(()=>st).datum(J);for(let j of["aria-label","aria-description","aria-hidden","transform"])st.hasAttribute(j)&&(G.attr(j,st.getAttribute(j)),st.removeAttribute(j))}}G?.selectChildren().attr("transform",L)}}let E=sB(g,M,e),{figure:C=r!=null||i!=null||o!=null||E.length>0}=e;C&&(N=D.createElement("figure"),N.className=`${c}-figure`,N.style.maxWidth="initial",r!=null&&N.append(uB(D,r,"h2")),i!=null&&N.append(uB(D,i,"h3")),N.append(...E,A),o!=null&&N.append(Ij(D,o))),N.scale=oN(b.scales),N.legend=iB(g,M,e);let k=uD();return k>0&&Pt(A).append("text").attr("x",S).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("\u26A0\uFE0F").append("title").text(`${k.toLocaleString("en-US")} warning${k===1?"":"s"}. Please check the console.`),N}function uB(e,t,n){if(t.ownerDocument)return t;let r=e.createElement(n);return r.append(t),r}function Ij(e,t){let n=e.createElement("figcaption");return n.append(t),n}function Aj({marks:e=[],...t}={}){return sm({...t,marks:[...e,this]})}_t.prototype.plot=Aj;function fB(e){return e.flat(1/0).filter(t=>t!=null).map(Tj)}function Tj(e){return typeof e.render=="function"?e:new iI(e)}var iI=class extends _t{constructor(t){if(typeof t!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}};function oI(e,t){for(let n in e)mB(e[n],t);return e}function mB(e,t){let{scale:n,transform:r=!0}=e;if(n==null||!r)return;let{type:i,percent:o,interval:s,transform:a=o?c=>c*100:aM(s,i)}=t[n]??{};a!=null&&(e.value=Vt(e.value,a),e.transform=!1)}function Ej(e){for(let t in e)_M(t,e[t])}function om(e,t,n,r=B5){for(let{channels:i}of t.values())for(let o in i){let s=i[o],{scale:a}=s;if(a!=null&&r(a))if(a==="projection"){if(!gD(n)){let c=n.x?.domain===void 0,l=n.y?.domain===void 0;if(c||l){let[u,f]=xD(s);c&&rI(e,"x",u),l&&rI(e,"y",f)}}}else rI(e,a,s)}return e}function rI(e,t,n){let r=e.get(t);r!==void 0?r.push(n):e.set(t,[n])}function Dj(e,t){if(e==null)return;let{x:n,y:r}=e;if(n==null&&r==null)return;let i=Pe(e.data);if(i==null)throw new Error("missing facet data");let o={};n!=null&&(o.fx=Ku(i,{value:n,scale:"fx"})),r!=null&&(o.fy=Ku(i,{value:r,scale:"fy"})),oI(o,t);let s=w1(i,o);return{channels:o,groups:s,data:e.data}}function hB(e,t,n){if(e.facet===null||e.facet==="super")return;let{fx:r,fy:i}=e;if(r!=null||i!=null){let c=Pe(e.data??r??i);if(c===void 0)throw new Error(`missing facet data in ${e.ariaLabel}`);if(c===null)return;let l={};return r!=null&&(l.fx=Ku(c,{value:r,scale:"fx"})),i!=null&&(l.fy=Ku(c,{value:i,scale:"fy"})),oI(l,n),{channels:l,groups:w1(c,l)}}if(t===void 0)return;let{channels:o,groups:s,data:a}=t;if(e.facet!=="auto"||e.data===a)return{channels:o,groups:s};a.length>0&&(s.size>1||s.size===1&&o.fx&&o.fy&&[...s][0][1].size>1)&&Pe(e.data)?.length===a.length&&Pn(`Warning: the ${e.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 Nj(e,t={}){return _e({...t,x:null,y:null},(n,r,i,o,s,a)=>a.getMarkState(e))}function Bj(e){let t=[];for(let n of e){let r=n.tip;if(r){r===!0?r={}:typeof r=="string"&&(r={pointer:r});let{pointer:i,preferredAnchor:o}=r;i=/^x$/i.test(i)?uf:/^y$/i.test(i)?il:lf,r=i(Nj(n,r)),r.title=null,o===void 0&&(r.preferredAnchor=i===il?"left":"bottom");let s=j1(n.data,r);s.facet=n.facet,s.facetAnchor=n.facetAnchor,t.push(s)}}return t}function Oj(e,t,n){let{projection:r,x:i={},y:o={},fx:s={},fy:a={},axis:c,grid:l,facet:u={},facet:{axis:f=c,grid:h}=u,x:{axis:d=c,grid:p=d===null?null:l}=i,y:{axis:m=c,grid:g=m===null?null:l}=o,fx:{axis:y=f,grid:b=y===null?null:h}=s,fy:{axis:x=f,grid:w=x===null?null:h}=a}=n;(r||!go(i)&&!dB("x",e))&&(d=p=null),(r||!go(o)&&!dB("y",e))&&(m=g=null),t.has("fx")||(y=b=null),t.has("fy")||(x=w=null),d===void 0&&(d=!G1(e,"x")),m===void 0&&(m=!G1(e,"y")),y===void 0&&(y=!G1(e,"fx")),x===void 0&&(x=!G1(e,"fy")),d===!0&&(d="bottom"),m===!0&&(m="left"),y===!0&&(y=d==="top"||d===null?"bottom":"top"),x===!0&&(x=m==="right"||m===null?"left":"right");let v=[];return W1(v,w,U1,a),Y1(v,x,k1,"right","left",u,a),W1(v,b,z1,s),Y1(v,y,R1,"top","bottom",u,s),W1(v,g,$1,o),Y1(v,m,tm,"left","right",n,o),W1(v,p,P1,i),Y1(v,d,em,"bottom","top",n,i),v}function Y1(e,t,n,r,i,o,s){if(!t)return;let a=Lj(t);s=Fj(a?r:t,o,s);let{line:c}=s;(n===tm||n===em)&&c&&!Ls(c)&&e.push(pf(Cj(s))),e.push(n(s)),a&&e.push(n({...s,anchor:i,label:null}))}function W1(e,t,n,r){!t||Ls(t)||e.push(n(kj(t,r)))}function Lj(e){return/^\s*both\s*$/i.test(e)}function Fj(e,t,{line:n=t.line,ticks:r,tickSize:i,tickSpacing:o,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:l,ariaLabel:u,ariaDescription:f,label:h=t.label,labelAnchor:d,labelArrow:p=t.labelArrow,labelOffset:m}){return{anchor:e,line:n,ticks:r,tickSize:i,tickSpacing:o,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:l,ariaLabel:u,ariaDescription:f,label:h,labelAnchor:d,labelArrow:p,labelOffset:m}}function Cj(e){let{anchor:t,line:n}=e;return{anchor:t,facetAnchor:t+"-empty",stroke:n===!0?void 0:n}}function kj(e,{stroke:t=Ba(e)?e:void 0,ticks:n=Rj(e)?e:void 0,tickSpacing:r,ariaLabel:i,ariaDescription:o}){return{stroke:t,ticks:n,tickSpacing:r,ariaLabel:i,ariaDescription:o}}function Rj(e){switch(typeof e){case"number":return!0;case"string":return!Ba(e)}return rr(e)||typeof e?.range=="function"}function G1(e,t){let n=`${t}-axis `;return e.some(r=>r.ariaLabel?.startsWith(n))}function dB(e,t){for(let n of t)for(let r in n.channels){let{scale:i}=n.channels[r];if(i===e||i==="projection")return!0}return!1}function $j(e,t){for(let n in e){let r=e[n],i=t[n];r.label===void 0&&i&&(r.label=i.label)}return e}function Uj({fx:e,fy:t},n){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:a,height:c}=g1(n),l=e&&pB(e),u=t&&pB(t);return{marginTop:t?u[0]:r,marginRight:e?a-l[1]:i,marginBottom:t?c-u[1]:o,marginLeft:e?l[0]:s,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:a,height:c}}function pB(e){let t=e.domain(),n=e(t[0]),r=e(t[t.length-1]);return r<n&&([n,r]=[r,n]),[n,r+e.bandwidth()]}var Pj=new Map([["basis",TS],["basis-closed",ES],["basis-open",DS],["bundle",NS],["bump-x",vS],["bump-y",SS],["cardinal",BS],["cardinal-closed",OS],["cardinal-open",LS],["catmull-rom",FS],["catmull-rom-closed",CS],["catmull-rom-open",kS],["linear",Is],["linear-closed",RS],["monotone-x",US],["monotone-y",PS],["natural",zS],["step",qS],["step-after",jS],["step-before",VS]]);function am(e=Is,t){if(typeof e=="function")return e;let n=Pj.get(`${e}`.toLowerCase());if(!n)throw new Error(`unknown curve: ${e}`);if(t!==void 0){if("beta"in n)return n.beta(t);if("tension"in n)return n.tension(t);if("alpha"in n)return n.alpha(t)}return n}function X1(e=Pa,t){return typeof e!="function"&&`${e}`.toLowerCase()==="auto"?Pa:am(e,t)}function Pa(e){return Is(e)}function Mo(e={y:"count"},t={}){[e,t]=aI(e,t);let{x:n,y:r}=t;return sI(H1(n,t,W),null,null,r,e,ol(t))}function Io(e={x:"count"},t={}){[e,t]=aI(e,t);let{x:n,y:r}=t;return sI(null,H1(r,t,W),n,null,e,sl(t))}function Us(e={fill:"count"},t={}){[e,t]=aI(e,t);let{x:n,y:r}=zj(t);return sI(n,r,null,null,e,ol(sl(t)))}function bB(e,t,n={}){if(n?.interval==null)return n;let{reduce:r=o1}=n,i={filter:null};return n[t]!=null&&(i[t]=r),n[`${t}1`]!=null&&(i[`${t}1`]=r),n[`${t}2`]!=null&&(i[`${t}2`]=r),e(i,n)}function mf(e={}){return bB(Mo,"y",Oi(e,"x"))}function yf(e={}){return bB(Io,"x",Oi(e,"y"))}function sI(e,t,n,r,{data:i=i1,filter:o=qp,sort:s,reverse:a,...c}={},l={}){e=yB(e),t=yB(t),c=qj(c,l),i=_B(i,W),s=s==null?void 0:xB("sort",s,l),o=o==null?void 0:wB("filter",o,l),n!=null&&_o(c,"x","x1","x2")&&(n=null),r!=null&&_o(c,"y","y1","y2")&&(r=null);let[u,f]=Tn(e),[h,d]=Tn(e),[p,m]=Tn(t),[g,y]=Tn(t),[b,x]=n!=null?[n,"x"]:r!=null?[r,"y"]:[],[w,v]=Tn(b),{x:_,y:M,z:D,fill:A,stroke:N,x1:T,x2:B,y1:L,y2:S,domain:I,cumulative:E,thresholds:C,interval:k,...F}=l,[R,$]=Tn(D),[U]=Ee(A),[G]=Ee(N),[J,et]=Tn(U),[st,j]=Tn(G);return{..."z"in l&&{z:R||D},..."fill"in l&&{fill:J||A},..."stroke"in l&&{stroke:st||N},...dn(F,(nt,z,X)=>{let rt=Jc(bt(nt,b),X?.[x]),P=bt(nt,D),Ot=bt(nt,U),ft=bt(nt,G),Yt=Yp(c,{z:P,fill:Ot,stroke:ft}),Wt=[],tt=[],ie=rt&&v([]),yr=P&&$([]),Ci=Ot&&et([]),eF=ft&&j([]),w3=e&&f([]),nF=e&&d([]),_3=t&&m([]),rF=t&&y([]),iF=Yj(e,t,nt),oF=0;for(let xl of c)xl.initialize(nt);s&&s.initialize(nt),o&&o.initialize(nt);for(let xl of z){let v3=[];for(let zf of c)zf.scope("facet",xl);s&&s.scope("facet",xl),o&&o.scope("facet",xl);for(let[zf,sF]of Oa(xl,Yt))for(let[aF,Pm]of Oa(sF,rt))for(let[ki,Ha]of iF(Pm))if(!(o&&!o.reduce(ki,Ha))){v3.push(oF++),tt.push(i.reduceIndex(ki,nt,Ha)),rt&&ie.push(aF),P&&yr.push(Yt===P?zf:P[(ki.length>0?ki:Pm)[0]]),Ot&&Ci.push(Yt===Ot?zf:Ot[(ki.length>0?ki:Pm)[0]]),ft&&eF.push(Yt===ft?zf:ft[(ki.length>0?ki:Pm)[0]]),w3&&(w3.push(Ha.x1),nF.push(Ha.x2)),_3&&(_3.push(Ha.y1),rF.push(Ha.y2));for(let cF of c)cF.reduce(ki,Ha);s&&s.reduce(ki)}Wt.push(v3)}return xM(Wt,s,a),{data:tt,facets:Wt}}),...!_o(c,"x")&&(u?{x1:u,x2:h,x:Wu(u,h)}:{x:_,x1:T,x2:B}),...!_o(c,"y")&&(p?{y1:p,y2:g,y:Wu(p,g)}:{y:M,y1:L,y2:S}),...w&&{[x]:w},...Object.fromEntries(c.map(({name:nt,output:z})=>[nt,z]))}}function aI({cumulative:e,domain:t,thresholds:n,interval:r,...i},o){return[i,{cumulative:e,domain:t,thresholds:n,interval:r,...o}]}function H1(e,{cumulative:t,domain:n,thresholds:r,interval:i},o){return e={...ti(e)},e.domain===void 0&&(e.domain=n),e.cumulative===void 0&&(e.cumulative=t),e.thresholds===void 0&&(e.thresholds=r),e.interval===void 0&&(e.interval=i),e.value===void 0&&(e.value=o),e.thresholds=cI(e.thresholds,e.interval),e}function zj(e){let{x:t,y:n}=e;return t=H1(t,e),n=H1(n,e),[t.value,n.value]=Ce(t.value,n.value),{x:t,y:n}}function yB(e){if(e==null)return;let{value:t,cumulative:n,domain:r=se,thresholds:i}=e,o=s=>{let a=bt(s,t),c;if(De(a)||jj(i)){a=Vt(a,nM,Float64Array);let[u,f]=typeof r=="function"?r(a):r,h=typeof i=="function"&&!Na(i)?i(a,u,f):i;typeof h=="number"&&(h=up(u,f,h)),Na(h)&&(r===se&&(u=h.floor(u),f=h.offset(h.floor(f))),h=h.range(u,h.offset(f))),c=h}else{a=Ze(a);let[u,f]=typeof r=="function"?r(a):r,h=typeof i=="function"&&!Na(i)?i(a,u,f):i;if(typeof h=="number")if(r===se){let d=as(u,f,h);if(isFinite(d))if(d>0){let p=Math.round(u/d),m=Math.round(f/d);p*d<=u||--p,m*d>f||++m;let g=m-p+1;h=new Float64Array(g);for(let y=0;y<g;++y)h[y]=(p+y)*d}else if(d<0){d=-d;let p=Math.round(u*d),m=Math.round(f*d);p/d<=u||--p,m/d>f||++m;let g=m-p+1;h=new Float64Array(g);for(let y=0;y<g;++y)h[y]=(p+y)/d}else h=[u];else h=[u]}else h=vn(u,f,h);else Na(h)&&(r===se&&(u=h.floor(u),f=h.offset(h.floor(f))),h=h.range(u,h.offset(f)));c=h}let l=[];if(c.length===1)l.push([c[0],c[0]]);else for(let u=1;u<c.length;++u)l.push([c[u-1],c[u]]);return l.bin=(n<0?Gj:n>0?Wj:lI)(l,c,a),l};return o.label=En(t),o}function cI(e,t,n=gB){if(e===void 0)return t===void 0?n:xo(t);if(typeof e=="string"){switch(e.toLowerCase()){case"freedman-diaconis":return P0;case"scott":return od;case"sturges":return ca;case"auto":return gB}return $p(e)}return e}function qj(e,t){return gM(e,t,xB)}function xB(e,t,n){return n1(e,t,n,wB)}function wB(e,t,n){return r1(e,t,n,_B)}function _B(e,t){return Zu(e,t,Vj)}function Vj(e){switch(`${e}`.toLowerCase()){case"x":return Xj;case"x1":return Zj;case"x2":return Kj;case"y":return Hj;case"y1":return Qj;case"y2":return Jj}throw new Error(`invalid bin reduce: ${e}`)}function gB(e,t,n){return Math.min(200,od(e,t,n))}function jj(e){return C5(e)||rr(e)&&De(e)}function Yj(e,t,n){let r=e?.(n),i=t?.(n);return r&&i?function*(o){let s=r.bin(o);for(let[a,[c,l]]of r.entries()){let u=i.bin(s[a]);for(let[f,[h,d]]of i.entries())yield[u[f],{data:n,x1:c,y1:h,x2:l,y2:d}]}}:r?function*(o){let s=r.bin(o);for(let[a,[c,l]]of r.entries())yield[s[a],{data:n,x1:c,x2:l}]}:function*(o){let s=i.bin(o);for(let[a,[c,l]]of i.entries())yield[s[a],{data:n,y1:c,y2:l}]}}function lI(e,t,n){return t=Ze(t),r=>{let i=e.map(()=>[]);for(let o of r)i[ss(t,n[o])-1]?.push(o);return i}}function Wj(e,t,n){let r=lI(e,t,n);return i=>{let o=r(i);for(let s=1,a=o.length;s<a;++s){let c=o[s-1],l=o[s];for(let u of c)l.push(u)}return o}}function Gj(e,t,n){let r=lI(e,t,n);return i=>{let o=r(i);for(let s=o.length-2;s>=0;--s){let a=o[s+1],c=o[s];for(let l of a)c.push(l)}return o}}function vB(e,t){let n=(+e+ +t)/2;return e instanceof Date?new Date(n):n}var Xj={reduceIndex(e,t,{x1:n,x2:r}){return vB(n,r)}},Hj={reduceIndex(e,t,{y1:n,y2:r}){return vB(n,r)}},Zj={reduceIndex(e,t,{x1:n}){return n}},Kj={reduceIndex(e,t,{x2:n}){return n}},Qj={reduceIndex(e,t,{y1:n}){return n}},Jj={reduceIndex(e,t,{y2:n}){return n}};function gf(e={}){return iM(e)?e:{...e,x:W}}function bf(e={}){return oM(e)?e:{...e,y:W}}function SB(e,t){if(t.length===1)return{data:e,facets:t};let n=e.length,r=new Uint8Array(n),i=0;for(let a of t)for(let c of a)r[c]&&++i,r[c]=1;if(i===0)return{data:e,facets:t};e=Da(e);let o=e[JS]=new Uint32Array(n+i);t=t.map(a=>Da(a,Uint32Array));let s=n;r.fill(0);for(let a of t)for(let c=0,l=a.length;c<l;++c){let u=a[c];r[u]?(a[c]=s,e[s]=e[u],o[s]=u,++s):o[u]=u,r[u]=1}return{data:e,facets:t}}function uI(e={},t={}){arguments.length===1&&([e,t]=_f(e));let{y1:n,y:r=n,x:i,...o}=t,[s,a,c,l]=vf(r,i,"y","x",e,o);return{...s,y1:n,y:a,x1:c,x2:l,x:Wu(c,l)}}function AB(e={},t={}){arguments.length===1&&([e,t]=_f(e));let{y1:n,y:r=n,x:i}=t,[o,s,a]=vf(r,i,"y","x",e,t);return{...o,y1:n,y:s,x:a}}function TB(e={},t={}){arguments.length===1&&([e,t]=_f(e));let{y1:n,y:r=n,x:i}=t,[o,s,,a]=vf(r,i,"y","x",e,t);return{...o,y1:n,y:s,x:a}}function fI(e={},t={}){arguments.length===1&&([e,t]=_f(e));let{x1:n,x:r=n,y:i,...o}=t,[s,a,c,l]=vf(r,i,"x","y",e,o);return{...s,x1:n,x:a,y1:c,y2:l,y:Wu(c,l)}}function EB(e={},t={}){arguments.length===1&&([e,t]=_f(e));let{x1:n,x:r=n,y:i}=t,[o,s,a]=vf(r,i,"x","y",e,t);return{...o,x1:n,x:s,y:a}}function DB(e={},t={}){arguments.length===1&&([e,t]=_f(e));let{x1:n,x:r=n,y:i}=t,[o,s,,a]=vf(r,i,"x","y",e,t);return{...o,x1:n,x:s,y:a}}function xf({x:e,x1:t,x2:n,...r}={}){return r=Oi(r,"y"),t===void 0&&n===void 0?uI({x:e,...r}):([t,n]=sM(e,t,n),{...r,x1:t,x2:n})}function wf({y:e,y1:t,y2:n,...r}={}){return r=Oi(r,"x"),t===void 0&&n===void 0?fI({y:e,...r}):([t,n]=sM(e,t,n),{...r,y1:t,y2:n})}function _f(e){let{offset:t,order:n,reverse:r,...i}=e;return[{offset:t,order:n,reverse:r},i]}var tY={length:!0};function vf(e,t=Up,n,r,{offset:i,order:o,reverse:s},a){if(t===null)throw new Error(`stack requires ${r}`);let c=Un(a),[l,u]=Tn(e),[f,h]=hn(t),[d,p]=hn(t);return f.hint=d.hint=tY,i=eY(i),o=iY(o,i,r),[dn(a,(m,g,y)=>{({data:m,facets:g}=SB(m,g));let b=e==null?void 0:u(Jc(bt(m,e),y?.[n])),x=bt(m,t,Float64Array),w=bt(m,c),v=o&&o(m,b,x,w),_=m.length,M=h(new Float64Array(_)),D=p(new Float64Array(_)),A=[];for(let N of g){let T=b?Array.from(on(N,B=>b[B]).values()):[N];if(v)for(let B of T)B.sort(v);for(let B of T){let L=0,S=0;s&&B.reverse();for(let I of B){let E=x[I];E<0?L=D[I]=(M[I]=L)+E:E>0?S=D[I]=(M[I]=S)+E:D[I]=M[I]=S}}A.push(T)}return i&&i(A,M,D,w),{data:m,facets:g}}),l,f,d]}function eY(e){if(e!=null){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"expand":case"normalize":return nY;case"center":case"silhouette":return rY;case"wiggle":return BB}throw new Error(`unknown offset: ${e}`)}}function NB(e,t){let n=0,r=0;for(let i of e){let o=t[i];o<n&&(n=o),o>r&&(r=o)}return[n,r]}function nY(e,t,n){for(let r of e)for(let i of r){let[o,s]=NB(i,n);for(let a of i){let c=1/(s-o||1);t[a]=c*(t[a]-o),n[a]=c*(n[a]-o)}}}function rY(e,t,n){for(let r of e){for(let i of r){let[o,s]=NB(i,n);for(let a of i){let c=(s+o)/2;t[a]-=c,n[a]-=c}}OB(r,t,n)}LB(e,t,n)}function BB(e,t,n,r){for(let i of e){let o=new Yn,s=0;for(let a of i){let c=-1,l=a.map(d=>Math.abs(n[d]-t[d])),u=a.map(d=>{c=r?r[d]:++c;let p=n[d]-t[d],m=o.has(c)?p-o.get(c):0;return o.set(c,p),m}),f=[0,...C0(u)];for(let d of a)t[d]+=s,n[d]+=s;let h=Sn(l);h&&(s-=Sn(l,(d,p)=>(u[p]/2+f[p])*d)/h)}OB(i,t,n)}LB(e,t,n)}function OB(e,t,n){let r=ae(e,i=>ae(i,o=>t[o]));for(let i of e)for(let o of i)t[o]-=r,n[o]-=r}function LB(e,t,n){let r=e.length;if(r===1)return;let i=e.map(a=>a.flat()),o=i.map(a=>(ae(a,c=>t[c])+jt(a,c=>n[c]))/2),s=ae(o);for(let a=0;a<r;a++){let c=s-o[a];for(let l of i[a])t[l]+=c,n[l]+=c}}function iY(e,t,n){if(e===void 0&&t===BB)return MB(ln);if(e!=null){if(typeof e=="string"){let r=e.startsWith("-"),i=r?Zc:ln;switch((r?e.slice(1):e).toLowerCase()){case"value":case n:return oY(i);case"z":return sY(i);case"sum":return aY(i);case"appearance":return cY(i);case"inside-out":return MB(i)}return IB(tM(e))}if(typeof e=="function")return(e.length===1?IB:lY)(e);if(Array.isArray(e))return uY(e);throw new Error(`invalid order: ${e}`)}}function oY(e){return(t,n,r)=>(i,o)=>e(r[i],r[o])}function sY(e){return(t,n,r,i)=>(o,s)=>e(i[o],i[s])}function aY(e){return Z1(e,(t,n,r,i)=>Hl(nr(t),o=>Sn(o,s=>r[s]),o=>i[o]))}function cY(e){return Z1(e,(t,n,r,i)=>Hl(nr(t),o=>n[Sc(o,s=>r[s])],o=>i[o]))}function MB(e){return Z1(e,(t,n,r,i)=>{let o=nr(t),s=Hl(o,f=>n[Sc(f,h=>r[h])],f=>i[f]),a=Ii(o,f=>Sn(f,h=>r[h]),f=>i[f]),c=[],l=[],u=0;for(let f of s)u<0?(u+=a.get(f),c.push(f)):(u-=a.get(f),l.push(f));return l.reverse().concat(c)})}function IB(e){return t=>{let n=bt(t,e);return(r,i)=>ln(n[r],n[i])}}function lY(e){return t=>(n,r)=>e(t[n],t[r])}function uY(e){return Z1(ln,()=>e)}function Z1(e,t){return(n,r,i,o)=>{if(!o)throw new Error("missing channel: z");let s=new Yn(t(n,r,i,o).map((a,c)=>[a,c]));return(a,c)=>e(s.get(o[a]),s.get(o[c]))}}var fY={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},fl=class extends _t{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,z:a,curve:c,tension:l}=n;super(t,{x1:{value:r,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0},z:{value:Un(n),optional:!0}},n,fY),this.z=a,this.curve=am(c,l)}filter(t){return t}render(t,n,r,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a}=r;return lt("svg:g",o).call(Bt,this,i,o).call(It,this,n,0,0).call(u=>u.selectAll().data(u1(t,[s,a,c,l],this,r)).enter().append("path").call(Nt,this).call(rl,this,r).attr("d",Fu().curve(this.curve).defined(f=>f>=0).x0(f=>s[f]).y0(f=>a[f]).x1(f=>c[f]).y1(f=>l[f]))).node()}};function cm(e,t){return t===void 0?Ps(e,{x:Ds,y:Ea}):new fl(e,t)}function za(e,t){let{y:n=Me,...r}=yf(t);return new fl(e,xf(gf({...r,y1:n,y2:void 0})))}function Ps(e,t){let{x:n=Me,...r}=mf(t);return new fl(e,wf(bf({...r,x1:n,x2:void 0})))}var hY={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},lm=class extends _t{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,curve:a,tension:c}=n;super(t,{x1:{value:r,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,hY),this.curve=X1(a,c),Li(this,n)}project(t,n,r){this.curve!==Pa&&super.project(t,n,r)}render(t,n,r,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a}=r,{curve:u}=this;return lt("svg:g",o).call(Bt,this,i,o).call(It,this,n).call(f=>f.selectAll().data(t).enter().append("path").call(Nt,this).attr("d",u===Pa&&o.projection?dY(o.projection,s,a,c,l):h=>{let d=Zn(),p=u(d);return p.lineStart(),p.point(s[h],a[h]),p.point(c[h],l[h]),p.lineEnd(),d}).call(Ht,this,r).call($s,this,r,o)).node()}};function dY(e,t,n,r,i){let o=In(e);return t=Ze(t),n=Ze(n),r=Ze(r),i=Ze(i),s=>o({type:"LineString",coordinates:[[t[s],n[s]],[r[s],i[s]]]})}function K1(e,{x:t,x1:n,x2:r,y:i,y1:o,y2:s,...a}={}){return[n,r]=um(t,n,r),[o,s]=um(i,o,s),new lm(e,{...a,x1:n,x2:r,y1:o,y2:s})}function um(e,t,n){if(e===void 0){if(t===void 0){if(n!==void 0)return[n]}else if(n===void 0)return[t]}else{if(t===void 0)return n===void 0?[e]:[e,n];if(n===void 0)return[e,t]}return[t,n]}var pY={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5},fm=class extends _t{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,bend:a=0,headAngle:c=60,headLength:l=8,inset:u=0,insetStart:f=u,insetEnd:h=u,sweep:d}=n;super(t,{x1:{value:r,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,pY),this.bend=a===!0?22.5:Math.max(-90,Math.min(90,a)),this.headAngle=+c,this.headLength=+l,this.insetStart=+f,this.insetEnd=+h,this.sweep=mY(d)}render(t,n,r,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a,SW:u}=r,{strokeWidth:f,bend:h,headAngle:d,headLength:p,insetStart:m,insetEnd:g}=this,y=u?w=>u[w]:un(f===void 0?1:f),b=d*ff/2,x=p/1.5;return lt("svg:g",o).call(Bt,this,i,o).call(It,this,n).call(w=>w.selectAll().data(t).enter().append("path").call(Nt,this).attr("d",v=>{let _=s[v],M=a[v],D=c[v],A=l[v],N=Math.hypot(D-_,A-M);if(N<=m+g)return null;let T=Math.atan2(A-M,D-_),B=Math.min(x*y(v),N/3),L=this.sweep(_,M,D,A)*h*ff,S=Math.hypot(N/Math.tan(L),N)/2;if(m||g)if(S<1e5){let J=Math.sign(L),[et,st]=yY([_,M],[D,A],S,J);if(m&&([_,M]=FB([et,st,S],[_,M,m],-J*Math.sign(m))),g){let[j,nt]=FB([et,st,S],[D,A,g],J*Math.sign(g));T+=Math.atan2(nt-st,j-et)-Math.atan2(A-st,D-et),D=j,A=nt}}else{let J=D-_,et=A-M,st=Math.hypot(J,et);m&&(_+=J/st*m,M+=et/st*m),g&&(D-=J/st*g,A-=et/st*g)}let I=T+L,E=I+b,C=I-b,k=D-B*Math.cos(E),F=A-B*Math.sin(E),R=D-B*Math.cos(C),$=A-B*Math.sin(C),U=S<1e5?`A${S},${S} 0,0,${L>0?1:0} `:"L",G=B?`M${k},${F}L${D},${A}L${R},${$}`:"";return`M${_},${M}${U}${D},${A}${G}`}).call(Ht,this,r)).node()}};function mY(e=1){if(typeof e=="number")return un(Math.sign(e));if(typeof e=="function")return(t,n,r,i)=>Math.sign(e(t,n,r,i));switch(Ke(e,"sweep",["+x","-x","+y","-y"])){case"+x":return(t,n,r)=>$t(t,r);case"-x":return(t,n,r)=>jn(t,r);case"+y":return(t,n,r,i)=>$t(n,i);case"-y":return(t,n,r,i)=>jn(n,i)}}function yY([e,t],[n,r],i,o){let s=n-e,a=r-t,c=Math.hypot(s,a),l=o*Math.sqrt(i*i-c*c/4)/c;return[(e+n)/2-a*l,(t+r)/2+s*l]}function FB([e,t,n],[r,i,o],s){let a=r-e,c=i-t,l=Math.hypot(a,c),u=(a*a+c*c-o*o+n*n)/(2*l),f=s*Math.sqrt(n*n-u*u);return[e+(a*u+c*f)/l,t+(c*u-a*f)/l]}function CB(e,{x:t,x1:n,x2:r,y:i,y1:o,y2:s,...a}={}){return[n,r]=um(t,n,r),[o,s]=um(i,o,s),new fm(e,{...a,x1:n,x2:r,y1:o,y2:s})}var Sf=class extends _t{constructor(t,n,r={},i){super(t,n,r,i);let{inset:o=0,insetTop:s=o,insetRight:a=o,insetBottom:c=o,insetLeft:l=o,rx:u,ry:f}=r;this.insetTop=Dt(s),this.insetRight=Dt(a),this.insetBottom=Dt(c),this.insetLeft=Dt(l),this.rx=ce(u,"auto"),this.ry=ce(f,"auto")}render(t,n,r,i,o){let{rx:s,ry:a}=this;return lt("svg:g",o).call(Bt,this,i,o).call(this._transform,this,n).call(c=>c.selectAll().data(t).enter().append("rect").call(Nt,this).attr("x",this._x(n,r,i)).attr("width",this._width(n,r,i)).attr("y",this._y(n,r,i)).attr("height",this._height(n,r,i)).call(ut,"rx",s).call(ut,"ry",a).call(Ht,this,r)).node()}_x(t,{x:n},{marginLeft:r}){let{insetLeft:i}=this;return n?o=>n[o]+i:r+i}_y(t,{y:n},{marginTop:r}){let{insetTop:i}=this;return n?o=>n[o]+i:r+i}_width({x:t},{x:n},{marginRight:r,marginLeft:i,width:o}){let{insetLeft:s,insetRight:a}=this,c=n&&t?t.bandwidth():o-r-i;return Math.max(0,c-s-a)}_height({y:t},{y:n},{marginTop:r,marginBottom:i,height:o}){let{insetTop:s,insetBottom:a}=this,c=n&&t?t.bandwidth():o-r-i;return Math.max(0,c-s-a)}},kB={ariaLabel:"bar"},hm=class extends Sf{constructor(t,n={}){let{x1:r,x2:i,y:o}=n;super(t,{x1:{value:r,scale:"x"},x2:{value:i,scale:"x"},y:{value:o,scale:"y",type:"band",optional:!0}},n,kB)}_transform(t,n,{x:r}){t.call(It,n,{x:r},0,0)}_x({x:t},{x1:n,x2:r},{marginLeft:i}){let{insetLeft:o}=this;return ir(t)?i+o:s=>Math.min(n[s],r[s])+o}_width({x:t},{x1:n,x2:r},{marginRight:i,marginLeft:o,width:s}){let{insetLeft:a,insetRight:c}=this;return ir(t)?s-i-o-a-c:l=>Math.max(0,Math.abs(r[l]-n[l])-a-c)}},dm=class extends Sf{constructor(t,n={}){let{x:r,y1:i,y2:o}=n;super(t,{y1:{value:i,scale:"y"},y2:{value:o,scale:"y"},x:{value:r,scale:"x",type:"band",optional:!0}},n,kB)}_transform(t,n,{y:r}){t.call(It,n,{y:r},0,0)}_y({y:t},{y1:n,y2:r},{marginTop:i}){let{insetTop:o}=this;return ir(t)?i+o:s=>Math.min(n[s],r[s])+o}_height({y:t},{y1:n,y2:r},{marginTop:i,marginBottom:o,height:s}){let{insetTop:a,insetBottom:c}=this;return ir(t)?s-i-o-a-c:l=>Math.max(0,Math.abs(r[l]-n[l])-a-c)}};function Ao(e,t={}){return ju(t)||(t={...t,y:Me,x2:W}),new hm(e,xf(I1(gf(t))))}function To(e,t={}){return ju(t)||(t={...t,x:Me,y2:W}),new dm(e,wf(A1(bf(t))))}var gY={ariaLabel:"cell"},hl=class extends Sf{constructor(t,{x:n,y:r,...i}={}){super(t,{x:{value:n,scale:"x",type:"band",optional:!0},y:{value:r,scale:"y",type:"band",optional:!0}},i,gY)}_transform(t,n){t.call(It,n,{},0,0)}};function qa(e,{x:t,y:n,...r}={}){return[t,n]=Ce(t,n),new hl(e,{...r,x:t,y:n})}function RB(e,{x:t=Me,fill:n,stroke:r,...i}={}){return n===void 0&&Ee(r)[0]===void 0&&(n=W),new hl(e,{...i,x:t,fill:n,stroke:r})}function $B(e,{y:t=Me,fill:n,stroke:r,...i}={}){return n===void 0&&Ee(r)[0]===void 0&&(n=W),new hl(e,{...i,y:t,fill:n,stroke:r})}var bY={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function pm(e){return e.sort===void 0&&e.reverse===void 0?t1({channel:"-r"},e):e}var dl=class extends _t{constructor(t,n={}){let{x:r,y:i,r:o,rotate:s,symbol:a=As,frameAnchor:c}=n,[l,u]=re(s,0),[f,h]=G5(a),[d,p]=re(o,f==null?3:4.5);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:d,scale:"r",filter:er,optional:!0},rotate:{value:l,optional:!0},symbol:{value:f,scale:"auto",optional:!0}},pm(n),bY),this.r=p,this.rotate=u,this.symbol=h,this.frameAnchor=wo(c);let{channels:m}=this,{symbol:g}=m;if(g){let{fill:y,stroke:b}=m;g.hint={fill:y?y.value===g.value?"color":"currentColor":this.fill??"currentColor",stroke:b?b.value===g.value?"color":"currentColor":this.stroke??"none"}}}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,r:u,rotate:f,symbol:h}=r,{r:d,rotate:p,symbol:m}=this,[g,y]=pn(this,i),b=m===As,x=u?void 0:d*d*Math.PI;return Sa(d)&&(t=[]),lt("svg:g",o).call(Bt,this,i,o).call(It,this,{x:c&&s,y:l&&a}).call(w=>w.selectAll().data(t).enter().append(b?"circle":"path").call(Nt,this).call(b?v=>{v.attr("cx",c?_=>c[_]:g).attr("cy",l?_=>l[_]:y).attr("r",u?_=>u[_]:d)}:v=>{v.attr("transform",$a`translate(${c?_=>c[_]:g},${l?_=>l[_]:y})${f?_=>` rotate(${f[_]})`:p?` rotate(${p})`:""}`).attr("d",u&&h?_=>{let M=Zn();return h[_].draw(M,u[_]*u[_]*Math.PI),M}:u?_=>{let M=Zn();return m.draw(M,u[_]*u[_]*Math.PI),M}:h?_=>{let M=Zn();return h[_].draw(M,x),M}:(()=>{let _=Zn();return m.draw(_,x),_})())}).call(Ht,this,r)).node()}};function ni(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Ce(t,n)),new dl(e,{...r,x:t,y:n})}function UB(e,{x:t=W,...n}={}){return new dl(e,E1({...n,x:t}))}function PB(e,{y:t=W,...n}={}){return new dl(e,T1({...n,y:t}))}function zB(e,t){return ni(e,{...t,symbol:"circle"})}function qB(e,t){return ni(e,{...t,symbol:"hexagon"})}var xY={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},pl=class extends _t{constructor(t,n={}){let{x:r,y:i,z:o,curve:s,tension:a}=n;super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y"},z:{value:Un(n),optional:!0}},n,xY),this.z=o,this.curve=X1(s,a),Li(this,n)}filter(t){return t}project(t,n,r){this.curve!==Pa&&super.project(t,n,r)}render(t,n,r,i,o){let{x:s,y:a}=r,{curve:c}=this;return lt("svg:g",o).call(Bt,this,i,o).call(It,this,n).call(l=>l.selectAll().data(u1(t,[s,a],this,r)).enter().append("path").call(Nt,this).call(rl,this,r).call(xN,this,r,o).attr("d",c===Pa&&o.projection?wY(o.projection,s,a):xp().curve(c).defined(u=>u>=0).x(u=>s[u]).y(u=>a[u]))).node()}};function wY(e,t,n){let r=In(e);return t=Ze(t),n=Ze(n),i=>{let o=[],s=[o];for(let a of i)a===-1?(o=[],s.push(o)):o.push([t[a],n[a]]);return r({type:"MultiLineString",coordinates:s})}}function ml(e,{x:t,y:n,...r}={}){return[t,n]=Ce(t,n),new pl(e,{...r,x:t,y:n})}function Va(e,{x:t=W,y:n=Me,...r}={}){return new pl(e,yf({...r,x:t,y:n}))}function ja(e,{x:t=Me,y:n=W,...r}={}){return new pl(e,mf({...r,x:t,y:n}))}var _Y={ariaLabel:"rect"},yl=class extends _t{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,inset:a=0,insetTop:c=a,insetRight:l=a,insetBottom:u=a,insetLeft:f=a,rx:h,ry:d}=n;super(t,{x1:{value:r,scale:"x",type:r!=null&&o==null?"band":void 0,optional:!0},y1:{value:i,scale:"y",type:i!=null&&s==null?"band":void 0,optional:!0},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,_Y),this.insetTop=Dt(c),this.insetRight=Dt(l),this.insetBottom=Dt(u),this.insetLeft=Dt(f),this.rx=ce(h,"auto"),this.ry=ce(d,"auto")}render(t,n,r,i,o){let{x:s,y:a}=n,{x1:c,y1:l,x2:u,y2:f}=r,{marginTop:h,marginRight:d,marginBottom:p,marginLeft:m,width:g,height:y}=i,{projection:b}=o,{insetTop:x,insetRight:w,insetBottom:v,insetLeft:_,rx:M,ry:D}=this,A=(s?.bandwidth?s.bandwidth():0)-_-w,N=(a?.bandwidth?a.bandwidth():0)-x-v;return lt("svg:g",o).call(Bt,this,i,o).call(It,this,{},0,0).call(T=>T.selectAll().data(t).enter().append("rect").call(Nt,this).attr("x",c&&(b||!ir(s))?u?B=>Math.min(c[B],u[B])+_:B=>c[B]+_:m+_).attr("y",l&&(b||!ir(a))?f?B=>Math.min(l[B],f[B])+x:B=>l[B]+x:h+x).attr("width",c&&(b||!ir(s))?u?B=>Math.max(0,Math.abs(u[B]-c[B])+A):A:g-d-m-w-_).attr("height",l&&(b||!ir(a))?f?B=>Math.max(0,Math.abs(l[B]-f[B])+N):N:y-h-p-x-v).call(ut,"rx",M).call(ut,"ry",D).call(Ht,this,r)).node()}};function mm(e,t){return new yl(e,WM(GM(t)))}function Mf(e,t={}){return ju(t)||(t={...t,y:Me,x2:W,interval:1}),new yl(e,xf(GM(gf(t))))}function If(e,t={}){return ju(t)||(t={...t,x:Me,y2:W,interval:1}),new yl(e,wf(WM(bf(t))))}function dI(e,t){t=vY(t);let{x:n,y:r,color:i,size:o}=t,s=Q1(e,n),a=Q1(e,r),c=Q1(e,i),l=Q1(e,o),{fx:u,fy:f,x:{value:h,reduce:d,zero:p,...m},y:{value:g,reduce:y,zero:b,...x},color:{value:w,color:v,reduce:_},size:{value:M,reduce:D},mark:A}=t;if(d===void 0&&(d=y==null&&h==null&&M==null&&g!=null?"count":null),y===void 0&&(y=d==null&&g==null&&M==null&&h!=null?"count":null),D===void 0&&M==null&&_==null&&d==null&&y==null&&(h==null||Ie(s))&&(g==null||Ie(a))&&(D="count"),p===void 0&&(p=J1(d)?!0:void 0),b===void 0&&(b=J1(y)?!0:void 0),h==null&&g==null)throw new Error("must specify x or y");if(d!=null&&g==null)throw new Error("reducing x requires y");if(y!=null&&h==null)throw new Error("reducing y requires x");A===void 0&&(A=M!=null||D!=null?"dot":J1(d)||J1(y)||_!=null?"bar":h!=null&&g!=null?Ie(s)||Ie(a)||d==null&&y==null&&!ym(s)&&!ym(a)?"dot":"line":h!=null||g!=null?"rule":null);let N,T,B;switch(A){case"dot":B=ni,T="stroke";break;case"line":B=s&&a||d!=null||y!=null?b||y!=null||s&&ym(s)?ja:p||d!=null||a&&ym(a)?Va:ml:s?Va:ja,T="stroke",jB(c)&&(N=null);break;case"area":B=!(b||y!=null)&&(p||d!=null||a&&ym(a))?za:Ps,T="fill",jB(c)&&(N=null);break;case"rule":B=s?Cr:kr,T="stroke";break;case"bar":B=d!=null?Ie(a)?VB(d)&&s&&Ie(s)?qa:Ao:Mf:y!=null?Ie(s)?VB(y)&&a&&Ie(a)?qa:To:If:_!=null||D!=null?s&&Ie(s)&&a&&Ie(a)?qa:s&&Ie(s)?To:a&&Ie(a)?Ao:mm:s&&Os(s)&&!(a&&Os(a))?Ao:a&&Os(a)&&!(s&&Os(s))?To:qa,T="fill";break;default:throw new Error(`invalid mark: ${A}`)}let L={fx:u,fy:f,x:s??void 0,y:a??void 0,[T]:c??v,z:N,r:l??void 0,tip:!0},S,I={[T]:_??void 0,r:D??void 0};if(d!=null&&y!=null)throw new Error("cannot reduce both x and y");return y!=null?(I.y=y,S=Ie(s)?La:Mo):d!=null?(I.x=d,S=Ie(a)?Fa:Io):(_!=null||D!=null)&&(s&&a?S=Ie(s)&&Ie(a)?jp:Ie(s)?Io:Ie(a)?Mo:Us:s?S=Ie(s)?La:Mo:a&&(S=Ie(a)?Fa:Io)),(S===Us||S===Mo)&&(L.x={value:s,...m}),(S===Us||S===Io)&&(L.y={value:a,...x}),p===void 0&&(p=s&&!(S===Us||S===Mo)&&(B===Ao||B===za||B===Mf||B===kr)),b===void 0&&(b=a&&!(S===Us||S===Io)&&(B===To||B===Ps||B===If||B===Cr)),{fx:u??null,fy:f??null,x:{value:h??null,reduce:d??null,zero:!!p,...m},y:{value:g??null,reduce:y??null,zero:!!b,...x},color:{value:w??null,reduce:_??null,...v!==void 0&&{color:v}},size:{value:M??null,reduce:D??null},mark:A,markImpl:YB[B],markOptions:L,transformImpl:YB[S],transformOptions:I,colorMode:T}}function WB(e,t){let n=dI(e,t),{fx:r,fy:i,x:{zero:o},y:{zero:s},markOptions:a,transformOptions:c,colorMode:l}=n,u=hI[n.markImpl],f=hI[n.transformImpl],h=r!=null||i!=null?pf({strokeOpacity:.1}):null,d=[o?Cr([0]):null,s?kr([0]):null],p=u(e,f?f(c,a):a);return l==="stroke"?Qe(h,d,p):Qe(h,p,d)}function ym(e){let t,n;for(let r of e){if(r==null)continue;if(t===void 0){t=r;continue}let i=Math.sign($t(t,r));if(i){if(n!==void 0&&i!==n)return!1;t=r,n=i}}return!0}function vY({x:e,y:t,color:n,size:r,fx:i,fy:o,mark:s}={}){return Lr(e)||(e=Af(e)),Lr(t)||(t=Af(t)),Lr(n)||(n=Ba(n)?{color:n}:Af(n)),Lr(r)||(r=Af(r)),Lr(i)&&({value:i}=Af(i)),Lr(o)&&({value:o}=Af(o)),s!=null&&(s=`${s}`.toLowerCase()),{x:e,y:t,color:n,size:r,fx:i,fy:o,mark:s}}function Q1(e,t){let n=bt(e,t.value);return n&&(n.label=En(t.value)),n}function Af(e){return SY(e)?{reduce:e}:{value:e}}function J1(e){return/^(?:distinct|count|sum|proportion)$/i.test(e)}function VB(e){return/^(?:first|last|mode)$/i.test(e)}function SY(e){if(e==null)return!1;if(typeof e.reduceIndex=="function"||typeof e.reduce=="function"&&fn(e)||/^p\d{2}$/i.test(e))return!0;switch(`${e}`.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 jB(e){return e?new Wn(e).size>e.length>>1:!1}var hI={dot:ni,line:ml,lineX:Va,lineY:ja,areaX:za,areaY:Ps,ruleX:Cr,ruleY:kr,barX:Ao,barY:To,rect:mm,rectX:Mf,rectY:If,cell:qa,bin:Us,binX:Mo,binY:Io,group:jp,groupX:La,groupY:Fa},YB=Object.fromEntries(Object.entries(hI).map(([e,t])=>[t,e]));function Tf(e,t={}){let{x:n,x1:r,x2:i}=t;n===void 0&&r===void 0&&i===void 0&&(t={...t,x:n=W});let o={};return n!=null&&(o.x=e),r!=null&&(o.x1=e),i!=null&&(o.x2=e),mr(o,t)}function Ef(e,t={}){let{y:n,y1:r,y2:i}=t;n===void 0&&r===void 0&&i===void 0&&(t={...t,y:n=W});let o={};return n!=null&&(o.y=e),r!=null&&(o.y1=e),i!=null&&(o.y2=e),mr(o,t)}function mr(e={},t={}){let n=Un(t),r=Object.entries(e).map(([i,o])=>{let s=Hx(i,t);if(s==null)throw new Error(`missing channel: ${i}`);let[a,c]=hn(s);return{key:i,input:s,output:a,setOutput:c,map:MY(o)}});return{...dn(t,(i,o)=>{let s=bt(i,n),a=r.map(({input:l})=>bt(i,l)),c=r.map(({setOutput:l})=>l(new Array(i.length)));for(let l of o)for(let u of s?on(l,f=>s[f]).values():[l])r.forEach(({map:f},h)=>f.mapIndex(u,a[h],c[h]));return{data:i,facets:o}}),...Object.fromEntries(r.map(({key:i,output:o})=>[i,o]))}}function MY(e){if(e==null)throw new Error("missing map");if(typeof e.mapIndex=="function")return e;if(typeof e.map=="function"&&fn(e))return IY(e);if(typeof e=="function")return pI(Yu(e));switch(`${e}`.toLowerCase()){case"cumsum":return TY;case"rank":return pI((t,n)=>sd(t,r=>n[r]));case"quantile":return pI((t,n)=>AY(t,r=>n[r]))}throw new Error(`invalid map: ${e}`)}function IY(e){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:e.map.bind(e)}}function AY(e,t){let n=Xi(e,t)-1;return sd(e,t).map(r=>r/n)}function pI(e){return{mapIndex(t,n,r){let i=e(t,n);if(i.length!==t.length)throw new Error("map function returned a mismatched length");for(let o=0,s=t.length;o<s;++o)r[t[o]]=i[o]}}}var TY={mapIndex(e,t,n){let r=0;for(let i of e)n[i]=r+=t[i]}};function GB(e={},t){return arguments.length===1&&(t=e),Tf(Df(e),t)}function XB(e={},t){return arguments.length===1&&(t=e),Ef(Df(e),t)}function Df(e={}){typeof e=="number"&&(e={k:e});let{k:t,reduce:n,shift:r,anchor:i,strict:o}=e;if(i===void 0&&r!==void 0&&(i=DY(r),Pn(`Warning: the shift option is deprecated; please use anchor "${i}" instead.`)),!((t=Math.floor(t))>0))throw new Error(`invalid k: ${t}`);return NY(n)(t,EY(i,t),o)}function EY(e="middle",t){switch(`${e}`.toLowerCase()){case"middle":return t-1>>1;case"start":return 0;case"end":return t-1}throw new Error(`invalid anchor: ${e}`)}function DY(e){switch(`${e}`.toLowerCase()){case"centered":return"middle";case"leading":return"start";case"trailing":return"end"}throw new Error(`invalid shift: ${e}`)}function NY(e="mean"){if(typeof e=="string"){if(/^p\d{2}$/i.test(e))return tw(Vu(e));switch(e.toLowerCase()){case"deviation":return tw(jr);case"max":return ew((t,n)=>jt(t,r=>n[r]));case"mean":return BY;case"median":return tw(Ai);case"min":return ew((t,n)=>ae(t,r=>n[r]));case"mode":return ew((t,n)=>Jl(t,r=>n[r]));case"sum":return HB;case"variance":return tw(aa);case"difference":return FY;case"ratio":return CY;case"first":return kY;case"last":return RY}}if(typeof e!="function")throw new Error(`invalid reduce: ${e}`);return ew(Yu(e))}function tw(e){return(t,n,r)=>r?{mapIndex(i,o,s){let a=l=>o[l]==null?NaN:+o[l],c=0;for(let l=0;l<t-1;++l)isNaN(a(l))&&++c;for(let l=0,u=i.length-t+1;l<u;++l)isNaN(a(l+t-1))&&++c,s[i[l+n]]=c===0?e(Ns(i,l,l+t),a):NaN,isNaN(a(l))&&--c}}:{mapIndex(i,o,s){let a=c=>o[c]==null?NaN:+o[c];for(let c=-n;c<0;++c)s[i[c+n]]=e(Ns(i,0,c+t),a);for(let c=0,l=i.length-n;c<l;++c)s[i[c+n]]=e(Ns(i,c,c+t),a)}}}function ew(e){return(t,n,r)=>r?{mapIndex(i,o,s){let a=0;for(let c=0;c<t-1;++c)a+=$e(o[i[c]]);for(let c=0,l=i.length-t+1;c<l;++c)a+=$e(o[i[c+t-1]]),a===t&&(s[i[c+n]]=e(Ns(i,c,c+t),o)),a-=$e(o[i[c]])}}:{mapIndex(i,o,s){for(let a=-n;a<0;++a)s[i[a+n]]=e(Ns(i,0,a+t),o);for(let a=0,c=i.length-n;a<c;++a)s[i[a+n]]=e(Ns(i,a,a+t),o)}}}function HB(e,t,n){return n?{mapIndex(r,i,o){let s=0,a=0;for(let c=0;c<e-1;++c){let l=i[r[c]];l===null||isNaN(l)?++s:a+=+l}for(let c=0,l=r.length-e+1;c<l;++c){let u=i[r[c]],f=i[r[c+e-1]];f===null||isNaN(f)?++s:a+=+f,o[r[c+t]]=s===0?a:NaN,u===null||isNaN(u)?--s:a-=+u}}}:{mapIndex(r,i,o){let s=0,a=r.length;for(let c=0,l=Math.min(a,e-t-1);c<l;++c)s+=+i[r[c]]||0;for(let c=-t,l=a-t;c<l;++c)s+=+i[r[c+e-1]]||0,o[r[c+t]]=s,s-=+i[r[c]]||0}}}function BY(e,t,n){if(n){let r=HB(e,t,n);return{mapIndex(i,o,s){r.mapIndex(i,o,s);for(let a=0,c=i.length-e+1;a<c;++a)s[i[a+t]]/=e}}}else return{mapIndex(r,i,o){let s=0,a=0,c=r.length;for(let l=0,u=Math.min(c,e-t-1);l<u;++l){let f=i[r[l]];f!==null&&!isNaN(f=+f)&&(s+=f,++a)}for(let l=-t,u=c-t;l<u;++l){let f=i[r[l+e-1]],h=i[r[l]];f!==null&&!isNaN(f=+f)&&(s+=f,++a),o[r[l+t]]=s/a,h!==null&&!isNaN(h=+h)&&(s-=h,--a)}}}}function OY(e,t,n,r){for(let i=n+r;n<i;++n){let o=e[t[n]];if($e(o))return o}}function LY(e,t,n,r){for(let i=n+r-1;i>=n;--i){let o=e[t[i]];if($e(o))return o}}function ZB(e,t,n,r){for(let i=n+r;n<i;++n){let o=e[t[n]];if(o!==null&&!isNaN(o=+o))return o}}function KB(e,t,n,r){for(let i=n+r-1;i>=n;--i){let o=e[t[i]];if(o!==null&&!isNaN(o=+o))return o}}function FY(e,t,n){return n?{mapIndex(r,i,o){for(let s=0,a=r.length-e;s<a;++s){let c=i[r[s]],l=i[r[s+e-1]];o[r[s+t]]=c===null||l===null?NaN:l-c}}}:{mapIndex(r,i,o){for(let s=-t,a=r.length-e+t+1;s<a;++s)o[r[s+t]]=KB(i,r,s,e)-ZB(i,r,s,e)}}}function CY(e,t,n){return n?{mapIndex(r,i,o){for(let s=0,a=r.length-e;s<a;++s){let c=i[r[s]],l=i[r[s+e-1]];o[r[s+t]]=c===null||l===null?NaN:l/c}}}:{mapIndex(r,i,o){for(let s=-t,a=r.length-e+t+1;s<a;++s)o[r[s+t]]=KB(i,r,s,e)/ZB(i,r,s,e)}}}function kY(e,t,n){return n?{mapIndex(r,i,o){for(let s=0,a=r.length-e;s<a;++s)o[r[s+t]]=i[r[s]]}}:{mapIndex(r,i,o){for(let s=-t,a=r.length-e+t+1;s<a;++s)o[r[s+t]]=OY(i,r,s,e)}}}function RY(e,t,n){return n?{mapIndex(r,i,o){for(let s=0,a=r.length-e;s<a;++s)o[r[s+t]]=i[r[s+e-1]]}}:{mapIndex(r,i,o){for(let s=-t,a=r.length-e+t+1;s<a;++s)o[r[s+t]]=LY(i,r,s,e)}}}var zs={n:20,k:2,color:"currentColor",opacity:.2,strict:!0,anchor:"end"};function QB(e,{x:t=W,y:n,k:r=zs.k,color:i=zs.color,opacity:o=zs.opacity,fill:s=i,fillOpacity:a=o,stroke:c=i,strokeOpacity:l,strokeWidth:u,...f}={}){return Qe(te(s)?null:za(e,mr({x1:Ya({k:-r,...f}),x2:Ya({k:r,...f})},{x1:t,x2:t,y:n,fill:s,fillOpacity:a,...f})),te(c)?null:Va(e,mr({x:Ya(f)},{x:t,y:n,stroke:c,strokeOpacity:l,strokeWidth:u,...f})))}function JB(e,{x:t,y:n=W,k:r=zs.k,color:i=zs.color,opacity:o=zs.opacity,fill:s=i,fillOpacity:a=o,stroke:c=i,strokeOpacity:l,strokeWidth:u,...f}={}){return Qe(te(s)?null:Ps(e,mr({y1:Ya({k:-r,...f}),y2:Ya({k:r,...f})},{x:t,y1:n,y2:n,fill:s,fillOpacity:a,...f})),te(c)?null:ja(e,mr({y:Ya(f)},{x:t,y:n,stroke:c,strokeOpacity:l,strokeWidth:u,...f})))}function Ya({n:e=zs.n,k:t=0,strict:n=zs.strict,anchor:r=zs.anchor}={}){return Df({k:e,reduce:i=>cs(i)+t*(jr(i)||0),strict:n,anchor:r})}var $Y={ariaLabel:"tick",fill:null,stroke:"currentColor"},nw=class extends _t{constructor(t,n,r){super(t,n,r,$Y),Li(this,r)}render(t,n,r,i,o){return lt("svg:g",o).call(Bt,this,i,o).call(this._transform,this,n).call(s=>s.selectAll().data(t).enter().append("line").call(Nt,this).attr("x1",this._x1(n,r,i)).attr("x2",this._x2(n,r,i)).attr("y1",this._y1(n,r,i)).attr("y2",this._y2(n,r,i)).call(Ht,this,r).call($s,this,r,o)).node()}},gm=class extends nw{constructor(t,n={}){let{x:r,y:i,inset:o=0,insetTop:s=o,insetBottom:a=o}=n;super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y",type:"band",optional:!0}},n),this.insetTop=Dt(s),this.insetBottom=Dt(a)}_transform(t,n,{x:r}){t.call(It,n,{x:r},Ne,0)}_x1(t,{x:n}){return r=>n[r]}_x2(t,{x:n}){return r=>n[r]}_y1({y:t},{y:n},{marginTop:r}){let{insetTop:i}=this;return n&&t?o=>n[o]+i:r+i}_y2({y:t},{y:n},{height:r,marginBottom:i}){let{insetBottom:o}=this;return n&&t?s=>n[s]+t.bandwidth()-o:r-i-o}},bm=class extends nw{constructor(t,n={}){let{x:r,y:i,inset:o=0,insetRight:s=o,insetLeft:a=o}=n;super(t,{y:{value:i,scale:"y"},x:{value:r,scale:"x",type:"band",optional:!0}},n),this.insetRight=Dt(s),this.insetLeft=Dt(a)}_transform(t,n,{y:r}){t.call(It,n,{y:r},0,Ne)}_x1({x:t},{x:n},{marginLeft:r}){let{insetLeft:i}=this;return n&&t?o=>n[o]+i:r+i}_x2({x:t},{x:n},{width:r,marginRight:i}){let{insetRight:o}=this;return n&&t?s=>n[s]+t.bandwidth()-o:r-i-o}_y1(t,{y:n}){return r=>n[r]}_y2(t,{y:n}){return r=>n[r]}};function rw(e,{x:t=W,...n}={}){return new gm(e,{...n,x:t})}function iw(e,{y:t=W,...n}={}){return new bm(e,{...n,y:t})}function tO(e,{x:t=W,y:n=null,fill:r="#ccc",fillOpacity:i,stroke:o="currentColor",strokeOpacity:s,strokeWidth:a=2,sort:c,...l}={}){let u=n!=null?Fa:Vp;return Qe(kr(e,u({x1:mI,x2:yI},{x:t,y:n,stroke:o,strokeOpacity:s,...l})),Ao(e,u({x1:"p25",x2:"p75"},{x:t,y:n,fill:r,fillOpacity:i,...l})),rw(e,u({x:"p50"},{x:t,y:n,stroke:o,strokeOpacity:s,strokeWidth:a,sort:c,...l})),ni(e,mr({x:nO},{x:t,y:n,z:n,stroke:o,strokeOpacity:s,...l})))}function eO(e,{y:t=W,x:n=null,fill:r="#ccc",fillOpacity:i,stroke:o="currentColor",strokeOpacity:s,strokeWidth:a=2,sort:c,...l}={}){let u=n!=null?La:Vp;return Qe(Cr(e,u({y1:mI,y2:yI},{x:n,y:t,stroke:o,strokeOpacity:s,...l})),To(e,u({y1:"p25",y2:"p75"},{x:n,y:t,fill:r,fillOpacity:i,...l})),iw(e,u({y:"p50"},{x:n,y:t,stroke:o,strokeOpacity:s,strokeWidth:a,sort:c,...l})),ni(e,mr({y:nO},{x:n,y:t,z:n,stroke:o,strokeOpacity:s,...l})))}function nO(e){let t=mI(e),n=yI(e);return e.map(r=>r<t||r>n?r:NaN)}function mI(e){let t=rO(e)*2.5-iO(e)*1.5;return ae(e,n=>n>=t?n:NaN)}function yI(e){let t=iO(e)*2.5-rO(e)*1.5;return jt(e,n=>n<=t?n:NaN)}function rO(e){return Gn(e,.25)}function iO(e){return Gn(e,.75)}var UY={ariaLabel:"raster",stroke:null,pixelSize:1};function Nf(e,t){let n=+e;if(isNaN(n))throw new Error(`invalid ${t}: ${e}`);return n}function oO(e,t){let n=Math.floor(e);if(isNaN(n))throw new Error(`invalid ${t}: ${e}`);return n}var wm=class extends _t{constructor(t,n,r={},i){let{width:o,height:s,x:a,y:c,x1:l=a==null?0:void 0,y1:u=c==null?0:void 0,x2:f=a==null?o:void 0,y2:h=c==null?s:void 0,pixelSize:d=i.pixelSize,blur:p=0,interpolate:m}=r;if(o!=null&&(o=oO(o,"width")),s!=null&&(s=oO(s,"height")),l!=null&&(l=Nf(l,"x1")),u!=null&&(u=Nf(u,"y1")),f!=null&&(f=Nf(f,"x2")),h!=null&&(h=Nf(h,"y2")),a==null&&(l==null||f==null))throw new Error("missing x");if(c==null&&(u==null||h==null))throw new Error("missing y");t!=null&&o!=null&&s!=null&&(a===void 0&&l!=null&&f!=null&&(a=GY(l,f,o,s)),c===void 0&&u!=null&&h!=null&&(c=XY(u,h,o,s))),super(t,{x:{value:a,scale:"x",optional:!0},y:{value:c,scale:"y",optional:!0},x1:{value:l==null?null:[l],scale:"x",optional:!0,filter:null},y1:{value:u==null?null:[u],scale:"y",optional:!0,filter:null},x2:{value:f==null?null:[f],scale:"x",optional:!0,filter:null},y2:{value:h==null?null:[h],scale:"y",optional:!0,filter:null},...n},r,i),this.width=o,this.height=s,this.pixelSize=Nf(d,"pixelSize"),this.blur=Nf(p,"blur"),this.interpolate=a==null||c==null?null:PY(m)}},_m=class extends wm{constructor(t,n={}){let{imageRendering:r}=n;if(t==null){let{fill:i,fillOpacity:o}=n;re(o)[0]!==void 0&&(n=ow("fillOpacity",n)),Ee(i)[0]!==void 0&&(n=ow("fill",n))}super(t,void 0,n,UY),this.imageRendering=ce(r,"auto")}scale(t,{color:n,...r},i){return super.scale(t,r,i)}render(t,n,r,i,o){let s=n[r.channels.fill?.scale]??(I=>I),{x:a,y:c}=r,{document:l}=o,[u,f,h,d]=aO(r,i,o),p=h-u,m=d-f,{pixelSize:g,width:y=Math.round(Math.abs(p)/g),height:b=Math.round(Math.abs(m)/g)}=this,x=y*b,{fill:w,fillOpacity:v}=r,_=0;if(this.interpolate){let I=y/p,E=b/m,C=Vt(a,F=>(F-u)*I,Float64Array),k=Vt(c,F=>(F-f)*E,Float64Array);w&&(w=this.interpolate(t,y,b,C,k,w)),v&&(v=this.interpolate(t,y,b,C,k,v))}else this.data==null&&t&&(_=t.fi*x);let M=l.createElement("canvas");M.width=y,M.height=b;let D=M.getContext("2d"),A=D.createImageData(y,b),N=A.data,{r:T,g:B,b:L}=en(this.fill)??{r:0,g:0,b:0},S=(this.fillOpacity??1)*255;for(let I=0;I<x;++I){let E=I<<2;if(w){let C=s(w[I+_]);if(C==null){N[E+3]=0;continue}({r:T,g:B,b:L}=en(C))}v&&(S=v[I+_]*255),N[E+0]=T,N[E+1]=B,N[E+2]=L,N[E+3]=S}return this.blur>0&&X_(A,this.blur),D.putImageData(A,0,0),lt("svg:g",o).call(Bt,this,i,o).call(It,this,n).call(I=>I.append("image").attr("transform",`translate(${u},${f}) scale(${Math.sign(h-u)},${Math.sign(d-f)})`).attr("width",Math.abs(p)).attr("height",Math.abs(m)).attr("preserveAspectRatio","none").call(ut,"image-rendering",this.imageRendering).call(Nt,this).attr("xlink:href",M.toDataURL())).node()}};function gI(e,t,n){arguments.length<3&&(n=t,t=null);let{x:r,y:i,[e]:o,...s}=n;return r===void 0&&i===void 0&&R5(t)&&(r=Ds,i=Ea,o===void 0&&(o=O5)),[t,{...s,x:r,y:i,[e]:o}]}function sO(){let[e,t]=gI("fill",...arguments);return new _m(e,e==null||t.fill!==void 0||t.fillOpacity!==void 0?t:{...t,fill:W})}function aO({x1:e,y1:t,x2:n,y2:r},i,{projection:o}){let{width:s,height:a,marginTop:c,marginRight:l,marginBottom:u,marginLeft:f}=i;return[e&&o==null?e[0]:f,t&&o==null?t[0]:c,n&&o==null?n[0]:s-l,r&&o==null?r[0]:a-u]}function bI({x1:e,y1:t,x2:n,y2:r},i,o,s){let a={};return e&&(a.x1=e),t&&(a.y1=t),n&&(a.x2=n),r&&(a.y2=r),aO(Qu(a,i),o,s)}function ow(e,t={}){let{[e]:n}=t;if(typeof n!="function")throw new Error(`invalid ${e}: not a function`);return _e({...t,[e]:void 0},function(r,i,o,s,a,c){let{x:l,y:u}=s;if(!l)throw new Error("missing scale: x");if(!u)throw new Error("missing scale: y");let[f,h,d,p]=bI(o,s,a,c),m=d-f,g=p-h,{pixelSize:y}=this,{width:b=Math.round(Math.abs(m)/y),height:x=Math.round(Math.abs(g)/y)}=t,w=new Array(b*x*(i?i.length:1)),v=m/b,_=g/x,M=0;for(let D of i??[void 0])for(let A=.5;A<x;++A)for(let N=.5;N<b;++N,++M)w[M]=n(l.invert(f+N*v),u.invert(h+A*_),D);return{data:w,facets:i,channels:{[e]:{value:w,scale:"auto"}}}})}function PY(e){if(typeof e=="function")return e;if(e==null)return sw;switch(`${e}`.toLowerCase()){case"none":return sw;case"nearest":return wI;case"barycentric":return xI();case"random-walk":return _I()}throw new Error(`invalid interpolate: ${e}`)}function sw(e,t,n,r,i,o){let s=new Array(t*n);for(let a of e)r[a]<0||r[a]>=t||i[a]<0||i[a]>=n||(s[Math.floor(i[a])*t+Math.floor(r[a])]=o[a]);return s}function xI({random:e=co(42)}={}){return(t,n,r,i,o,s)=>{let{points:a,triangles:c,hull:l}=Cn.from(t,d=>i[d],d=>o[d]),u=new s.constructor(n*r).fill(NaN),f=new Uint8Array(n*r),h=WY(s,e);for(let d=0;d<c.length;d+=3){let p=c[d],m=c[d+1],g=c[d+2],y=a[2*p],b=a[2*m],x=a[2*g],w=a[2*p+1],v=a[2*m+1],_=a[2*g+1],M=Math.min(y,b,x),D=Math.max(y,b,x),A=Math.min(w,v,_),N=Math.max(w,v,_),T=(v-_)*(y-x)+(w-_)*(x-b);if(!T)continue;let B=s[t[p]],L=s[t[m]],S=s[t[g]];for(let I=Math.floor(M);I<D;++I)for(let E=Math.floor(A);E<N;++E){if(I<0||I>=n||E<0||E>=r)continue;let C=I+.5,k=E+.5,F=((v-_)*(C-x)+(k-_)*(x-b))/T;if(F<0)continue;let R=((_-w)*(C-x)+(k-_)*(y-x))/T;if(R<0)continue;let $=1-F-R;if($<0)continue;let U=I+n*E;u[U]=h(B,F,L,R,S,$,I,E),f[U]=1}}return zY(u,f,i,o,s,n,r,l,t,h),u}}function zY(e,t,n,r,i,o,s,a,c,l){n=Float64Array.from(a,d=>n[c[d]]),r=Float64Array.from(a,d=>r[c[d]]),i=Array.from(a,d=>i[c[d]]);let u=n.length,f=Array.from({length:u},(d,p)=>VY(p,n,r)),h=0;for(let d=0;d<s;++d){let p=d+.5;for(let m=0;m<o;++m){let g=m+o*d;if(!t[g]){let y=m+.5;for(let b=0;b<u;++b){let x=(u+h+(b%2?(b+1)/2:-b/2))%u;if(f[x](y,p)){let w=qY(n.at(x-1),r.at(x-1),n[x],r[x],y,p);e[g]=l(i.at(x-1),w,i[x],1-w,i[x],0,m,d),h=x;break}}}}}}function qY(e,t,n,r,i,o){let s=n-e,a=r-t,c=s*(n-i)+a*(r-o),l=s*(i-e)+a*(o-t);return c>0&&l>0?c/(c+l):+(c>l)}function xm(e,t,n,r){return e*r-n*t}function VY(e,t,n){let r=t.length,i=t.at(e-2),o=n.at(e-2),s=t.at(e-1),a=n.at(e-1),c=t[e],l=n[e],u=t.at(e+1-r),f=n.at(e+1-r),h=s-c,d=a-l,p=i-s,m=o-a,g=c-u,y=l-f,b=Math.hypot(h,d),x=Math.hypot(p,m),w=Math.hypot(g,y);return(v,_)=>{let M=v-s,D=_-a,A=v-c,N=_-l;return xm(M,D,A,N)>-1e-6&&xm(M,D,h,d)*x-xm(M,D,p,m)*b>-1e-6&&xm(A,N,g,y)*b-xm(A,N,h,d)*w<=0}}function wI(e,t,n,r,i,o){let s=new o.constructor(t*n),a=Cn.from(e,u=>r[u],u=>i[u]),c,l;for(let u=.5,f=0;u<n;++u){l=c;for(let h=.5;h<t;++h,++f)l=a.find(h,u,l),h===.5&&(c=l),s[f]=o[e[l]]}return s}function _I({random:e=co(42),minDistance:t=.5,maxSteps:n=2}={}){return(r,i,o,s,a,c)=>{let l=new c.constructor(i*o),u=Cn.from(r,p=>s[p],p=>a[p]),f,h,d;for(let p=.5,m=0;p<o;++p){h=f;for(let g=.5;g<i;++g,++m){let y=g,b=p;d=h=u.find(y,b,h),g===.5&&(f=h);let x,w=0;for(;(x=Math.hypot(s[r[d]]-y,a[r[d]]-b))>t&&w<n;){let v=e(g,p,w)*2*Math.PI;y+=Math.cos(v)*x,b+=Math.sin(v)*x,d=u.find(y,b,d),++w}l[m]=c[r[d]]}}return l}}function jY(e,t,n,r,i,o){return t*e+r*n+o*i}function YY(e){return(t,n,r,i,o,s,a,c)=>{let l=e(a,c);return l<n?t:l<n+i?r:o}}function WY(e,t){return Os(e)||De(e)?jY:YY(t)}function GY(e,t,n){return{transform(r){let i=r.length,o=new Float64Array(i),s=(t-e)/n,a=e+s/2;for(let c=0;c<i;++c)o[c]=c%n*s+a;return o}}}function XY(e,t,n,r){return{transform(i){let o=i.length,s=new Float64Array(o),a=(t-e)/r,c=e+a/2;for(let l=0;l<o;++l)s[l]=Math.floor(l/n)%r*a+c;return s}}}var cO={ariaLabel:"contour",fill:"none",stroke:"currentColor",strokeMiterlimit:1,pixelSize:2},vm=class extends wm{constructor(t,{smooth:n=!0,value:r,...i}={}){let o=l1({},i,cO);if(r===void 0){for(let a in o)if(o[a].value!=null){if(r!==void 0)throw new Error("ambiguous contour value");r=i[a],i[a]="value"}}if(r!=null){let a={transform:c=>c.map(l=>l.value),label:En(r)};for(let c in o)i[c]==="value"&&(i[c]=a)}if(t==null){if(r==null)throw new Error("missing contour value");i=ow("value",{value:r,...i}),r=null}else{let{interpolate:a}=i;r===void 0&&(r=W),a===void 0&&(i.interpolate="nearest")}super(t,{value:{value:r,optional:!0}},HY(i),cO);let s={geometry:{value:W}};for(let a in this.channels){let c=this.channels[a],{scale:l}=c;l==="x"||l==="y"||a==="value"||(s[a]=c,delete this.channels[a])}this.contourChannels=s,this.smooth=!!n}filter(t,{x:n,y:r,value:i,...o},s){return super.filter(t,o,s)}render(t,n,r,i,o){let{geometry:s}=r,a=In();return lt("svg:g",o).call(Bt,this,i,o).call(It,this,n).call(c=>{c.selectAll().data(t).enter().append("path").call(Nt,this).attr("d",l=>a(s[l])).call(Ht,this,r)}).node()}};function HY({thresholds:e,interval:t,...n}){return e=cI(e,t,ca),_e(n,function(r,i,o,s,a,c){let[l,u,f,h]=bI(o,s,a,c),d=f-l,p=h-u,{pixelSize:m,width:g=Math.round(Math.abs(d)/m),height:y=Math.round(Math.abs(p)/m)}=this,b=g/d,x=y/p,w=o.value.value,v=[];if(this.interpolate){let{x:N,y:T}=ka(o,s,c),B=Vt(N,E=>(E-l)*b,Float64Array),L=Vt(T,E=>(E-u)*x,Float64Array),S=[o.x,o.y,o.value],I=[B,L,w];for(let E of i){let C=this.filter(E,S,I);v.push(this.interpolate(C,g,y,B,L,w))}}else if(i){let N=g*y,T=i.length;for(let B=0;B<T;++B)v.push(w.slice(B*N,B*N+N))}else v.push(w);if(this.blur>0)for(let N of v)ed({data:N,width:g,height:y},this.blur);let _=ZY(e,w,...KY(v));if(_===null)throw new Error(`unsupported thresholds: ${e}`);let{contour:M}=ma().size([g,y]).smooth(this.smooth),D=[],A=[];for(let N of v)A.push(Re(D.length,D.push(...Vt(_,T=>M(N,T)))));for(let{coordinates:N}of D)for(let T of N)for(let B of T)for(let L of B)L[0]=L[0]/b+l,L[1]=L[1]/x+u;return{data:D,facets:A,channels:s1(this.contourChannels,D)}})}function ZY(e,t,n,r){if(typeof e?.range=="function")return e.range(e.floor(n),r);if(typeof e=="function"&&(e=e(t,n,r)),typeof e!="number")return Pe(e);let i=vn(...Kl(n,r,e),e);for(;i[i.length-1]>=r;)i.pop();for(;i[1]<n;)i.shift();return i}function uO(){return new vm(...gI("value",...arguments))}function KY(e){return[ae(e,t=>ae(t,lO)),jt(e,t=>jt(t,lO))]}function lO(e){return isFinite(e)?e:NaN}function dO(e,t){return vI(lf,e,t)}function pO(e,t={}){return vI(uf,e,t)}function mO(e,t={}){return vI(il,e,t)}function vI(e,t,n={}){let{x:r,y:i,maxRadius:o}=n,s=e({px:r,py:i,maxRadius:o}),a=[];r!=null&&a.push(Cr(t,fO("x",{...s,inset:-6},n))),i!=null&&a.push(kr(t,fO("y",{...s,inset:-6},n))),r!=null&&a.push(So(t,hO("x",{...s,dy:9,frameAnchor:"bottom",lineAnchor:"top"},n))),i!=null&&a.push(So(t,hO("y",{...s,dx:-9,frameAnchor:"left",textAnchor:"end"},n)));for(let c of a)c.ariaLabel=`crosshair ${c.ariaLabel}`;return Qe(...a)}function yO(e,{channels:t,...n},{facet:r,facetAnchor:i,fx:o,fy:s,[e]:a,channels:c,transform:l,initializer:u}){return{...n,facet:r,facetAnchor:i,fx:o,fy:s,[e]:a,channels:{...t,...c},transform:l,initializer:QY(e,u)}}function QY(e,t){return t==null?t:function(n,r,{x:i,y:o,px:s,py:a,...c},...l){let{channels:{x:u,y:f,...h}={},...d}=t.call(this,n,r,{...c,x:s,y:a},...l);return{channels:{...h,...u&&{px:u,...e==="x"&&{x:u}},...f&&{py:f,...e==="y"&&{y:f}}},...d}}}function fO(e,t,n){let{color:r="currentColor",opacity:i=.2,ruleStroke:o=r,ruleStrokeOpacity:s=i,ruleStrokeWidth:a}=n;return{...yO(e,t,n),stroke:o,strokeOpacity:s,strokeWidth:a}}function hO(e,t,n){let{color:r="currentColor",textFill:i=r,textFillOpacity:o,textStroke:s="var(--plot-background)",textStrokeOpacity:a,textStrokeWidth:c=5}=n;return{...yO(e,t,JY(e,n)),fill:i,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:c}}function JY(e,t){return _e(t,(n,r,i)=>({channels:{text:{value:Wp(i,e)?.value}}}))}var tW={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},eW={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},nW={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},rW={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},iW={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},SI=class extends _t{constructor(t,n={}){let{x:r,y:i,z:o,curve:s,tension:a}=n;super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:o,optional:!0}},n,tW),this.curve=am(s,a),Li(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,{curve:f}=this,[h,d]=pn(this,i),p=c?b=>c[b]:un(h),m=l?b=>l[b]:un(d),g=this;function y(b){let x=-1,w=[],v={};for(let S in r)v[S]=[];let _=[],M=[],D=[],A=[];function N(S,I){S=b[S],I=b[I],w.push(++x),_[x]=p(S),D[x]=m(S),M[x]=p(I),A[x]=m(I);for(let E in r)v[E].push(r[E][I])}let{halfedges:T,hull:B,triangles:L}=Cn.from(b,p,m);for(let S=0;S<T.length;++S){let I=T[S];I>S&&N(L[S],L[I])}for(let S=0;S<B.length;++S)N(B[S],B[(S+1)%B.length]);Pt(this).selectAll().data(w).enter().append("path").call(Nt,g).attr("d",S=>{let I=Zn(),E=f(I);return E.lineStart(),E.point(_[S],D[S]),E.point(M[S],A[S]),E.lineEnd(),I}).call(Ht,g,v).call($s,g,v,o)}return lt("svg:g",o).call(Bt,this,i,o).call(It,this,{x:c&&s,y:l&&a}).call(u?b=>b.selectAll().data(on(t,x=>u[x]).values()).enter().append("g").each(y):b=>b.datum(t).each(y)).node()}},Sm=class extends _t{constructor(t,n={},r,i=({z:o})=>o){let{x:o,y:s}=n;super(t,{x:{value:o,scale:"x",optional:!0},y:{value:s,scale:"y",optional:!0},z:{value:i(n),optional:!0}},n,r)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,[f,h]=pn(this,i),d=c?y=>c[y]:un(f),p=l?y=>l[y]:un(h),m=this;function g(y){let b=Cn.from(y,d,p);Pt(this).append("path").datum(y[0]).call(Nt,m).attr("d",m._render(b,i)).call(Ht,m,r)}return lt("svg:g",o).call(Bt,this,i,o).call(It,this,{x:c&&s,y:l&&a}).call(u?y=>y.selectAll().data(on(t,b=>u[b]).values()).enter().append("g").each(g):y=>y.datum(t).each(g)).node()}},MI=class extends Sm{constructor(t,n={}){super(t,n,eW),this.fill="none"}_render(t){return t.render()}},II=class extends Sm{constructor(t,n={}){super(t,n,nW,Un)}_render(t){return t.renderHull()}},AI=class extends _t{constructor(t,n={}){let{x:r,y:i,z:o}=n;super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:o,optional:!0}},n,rW)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,[f,h]=pn(this,i),d=c?y=>c[y]:un(f),p=l?y=>l[y]:un(h),m=this;function g(y){let b=Cn.from(y,d,p),x=gO(b,i);Pt(this).selectAll().data(y).enter().append("path").call(Nt,m).attr("d",(w,v)=>x.renderCell(v)).call(Ht,m,r)}return lt("svg:g",o).call(Bt,this,i,o).call(It,this,{x:c&&s,y:l&&a}).call(u?y=>y.selectAll().data(on(t,b=>u[b]).values()).enter().append("g").each(g):y=>y.datum(t).each(g)).node()}},TI=class extends Sm{constructor(t,n){super(t,n,iW),this.fill="none"}_render(t,n){return gO(t,n).render()}};function gO(e,t){let{width:n,height:r,marginTop:i,marginRight:o,marginBottom:s,marginLeft:a}=t;return e.voronoi([a,i,n-o,r-s])}function Mm(e,t,{x:n,y:r,...i}={}){return[n,r]=Ce(n,r),new e(t,{...i,x:n,y:r})}function bO(e,t){return Mm(SI,e,t)}function xO(e,t){return Mm(MI,e,t)}function wO(e,t){return Mm(II,e,t)}function _O(e,t){return Mm(AI,e,t)}function vO(e,t){return Mm(TI,e,t)}var oW={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Im=class extends _t{constructor(t,{x:n,y:r,z:i,weight:o,fill:s,stroke:a,...c}={}){let l=SO(s)&&(s="currentColor",!0),u=SO(a)&&(a="currentColor",!0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:Un({z:i,fill:s,stroke:a}),optional:!0},weight:{value:o,optional:!0}},aW({...c,fill:s,stroke:a},l,u),oW),l&&(this.fill=void 0),u&&(this.stroke=void 0),this.z=i}filter(t){return t}render(t,n,r,i,o){let{contours:s}=r,a=In();return lt("svg:g",o).call(Bt,this,i,o).call(It,this,{}).call(c=>c.selectAll().data(t).enter().append("path").call(Nt,this).call(Ht,this,r).attr("d",l=>a(s[l]))).node()}};function MO(e,{x:t,y:n,...r}={}){return[t,n]=Ce(t,n),new Im(e,{...r,x:t,y:n})}var sW=new Set(["x","y","z","weight"]);function aW(e,t,n){let{bandwidth:i,thresholds:o}=e;return i=i===void 0?20:+i,o=o===void 0?20:typeof o?.[Symbol.iterator]=="function"?Ze(o):+o,_e(e,function(s,a,c,l,u,f){let h=c.weight?Ze(c.weight.value):null,d=c.z?.value,{z:p}=this,[m,g]=pn(this,u),{width:y,height:b}=u,{x,y:w}=ka(c,l,f),v=Object.fromEntries(Object.entries(c).filter(([L])=>!sW.has(L)).map(([L,S])=>[L,{...S,value:[]}])),_=t&&[],M=n&&[],D=kv().x(x?L=>x[L]:m).y(w?L=>w[L]:g).weight(h?L=>h[L]:1).size([y,b]).bandwidth(i),A=[];for(let L of a){let S=[];A.push(S);for(let I of d?Xp(L,d,p):[L]){let E=D.contours(I);S.push([I,E])}}let N=o;if(!(N instanceof Qc)){let L=0;for(let S of A)for(let[,I]of S){let E=I.max;E>L&&(L=E)}N=Float64Array.from({length:o-1},(S,I)=>L*100*(I+1)/o)}let T=[],B=[];for(let L of A){let S=[];T.push(S);for(let[I,E]of L)for(let C of N){S.push(B.length),B.push(E(C/100)),_&&_.push(C),M&&M.push(C);for(let k in v)v[k].value.push(c[k].value[I[0]])}}return _&&_.push(0),M&&M.push(0),{data:s,facets:T,channels:{...v,..._&&{fill:{value:_,scale:"color"}},...M&&{stroke:{value:M,scale:"color"}},contours:{value:B}}}})}function SO(e){return/^density$/i.test(e)}function TO(e,{x1:t,x2:n,y1:r,y2:i,x:o=t===void 0&&n===void 0?Me:void 0,y:s=r===void 0&&i===void 0?W:void 0,fill:a,positiveFill:c="#3ca951",negativeFill:l="#4269d0",fillOpacity:u=1,positiveFillOpacity:f=u,negativeFillOpacity:h=u,stroke:d,strokeOpacity:p,z:m=Ee(d)[0],clip:g,tip:y,render:b,...x}={}){return[t,n]=IO(o,t,n),[r,i]=IO(s,r,i),t===n&&r===i&&(r=Wa(0)),{tip:y}=Oi({tip:y},"x"),Qe(te(c)?null:Object.assign(cm(e,{x1:t,x2:n,y1:r,y2:i,z:m,fill:c,fillOpacity:f,render:cf(b,AO(!0)),clip:g,...x}),{ariaLabel:"positive difference"}),te(l)?null:Object.assign(cm(e,{x1:t,x2:n,y1:r,y2:i,z:m,fill:l,fillOpacity:h,render:cf(b,AO(!1)),clip:g,...x}),{ariaLabel:"negative difference"}),ml(e,{x:n,y:i,z:m,stroke:d,strokeOpacity:p,tip:y,clip:!0,...x}))}function IO(e,t,n){return t===void 0&&n===void 0?t=n=Wa(e):t===void 0?(n=Wa(n),t=e===void 0?n:Wa(e)):n===void 0?(t=Wa(t),n=e===void 0?t:Wa(e)):(t=Wa(t),n=Wa(n)),[t,n]}function Wa(e){let t,{value:n,label:r=En(n)}=ti(e);return{transform:i=>t||(t=bt(i,n)),label:r}}function AO(e){return(t,n,r,i,o,s)=>{let{x1:a,x2:c}=r,{height:l}=i,u=new Float32Array(a.length),f=new Float32Array(c.length);(e===y1(n.y)<0?u:f).fill(l);let h=s(t,n,{...r,x2:a,y2:f},i,o),d=s(t,n,{...r,x1:c,y1:u},i,o),p=h.querySelector("g")??h,m=d.querySelector("g")??d;for(let g=0;p.firstChild;g+=2){let y=c1(),b=lt("svg:clipPath",o).attr("id",y).node();b.appendChild(p.firstChild),m.childNodes[g].setAttribute("clip-path",`url(#${y})`),m.insertBefore(b,m.childNodes[g])}return d}}var cW={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Am=class extends _t{constructor(t,n={}){let[r,i]=re(n.r,3);super(t,{geometry:{value:n.geometry,scale:"projection"},r:{value:r,scale:"r",filter:er,optional:!0}},pm(n),cW),this.r=i}render(t,n,r,i,o){let{geometry:s,r:a}=r,c=In(o.projection??lW(n)),{r:l}=this;return Sa(l)?t=[]:l!==void 0&&c.pointRadius(l),lt("svg:g",o).call(Bt,this,i,o).call(It,this,n).call(u=>{u.selectAll().data(t).enter().append("path").call(Nt,this).attr("d",a?f=>c.pointRadius(a[f])(s[f]):f=>c(s[f])).call(Ht,this,r)}).node()}};function lW({x:e,y:t}){if(e||t)return e??=n=>n,t??=n=>n,Uc({point(n,r){this.stream.point(e(n),t(r))}})}function aw(e,{geometry:t=W,...n}={}){switch(e?.type){case"FeatureCollection":e=e.features;break;case"GeometryCollection":e=e.geometries;break;case"Feature":case"LineString":case"MultiLineString":case"MultiPoint":case"MultiPolygon":case"Point":case"Polygon":case"Sphere":e=[e];break}return new Am(e,{geometry:t,...n})}function EO({strokeWidth:e=1.5,...t}={}){return aw({type:"Sphere"},{strokeWidth:e,...t})}function DO({strokeOpacity:e=.1,...t}={}){return aw(i2(),{strokeOpacity:e,...t})}var Bf=.5,Of=0;function NO(e={fill:"count"},{binWidth:t,...n}={}){let{z:r}=n;return t=t===void 0?20:Dt(t),e=bM(e,n),_o(e,"fill")&&(n.channels={...n.channels,fill:{value:[]}}),n.symbol===void 0&&(n.symbol="hexagon"),n.r===void 0&&!_o(e,"r")&&(n.r=t/2),_e(n,(i,o,s,a,c,l)=>{let{x:u,y:f,z:h,fill:d,stroke:p,symbol:m}=s;if(u===void 0)throw new Error("missing channel: x");if(f===void 0)throw new Error("missing channel: y");({x:u,y:f}=ka(s,a,l)),h=h?h.value:bt(i,r),d=d?.value,p=p?.value,m=m?.value;let g=Yp(e,{z:h,fill:d,stroke:p,symbol:m}),y=h&&[],b=d&&[],x=p&&[],w=m&&[],v=[],_=[],M=[],D=-1;for(let B of e)B.initialize(i);for(let B of o){let L=[];for(let S of e)S.scope("facet",B);for(let[S,I]of Oa(B,g))for(let{index:E,extent:C}of uW(i,I,u,f,t)){L.push(++D),_.push(C.x),M.push(C.y),h&&y.push(g===h?S:h[E[0]]),d&&b.push(g===d?S:d[E[0]]),p&&x.push(g===p?S:p[E[0]]),m&&w.push(g===m?S:m[E[0]]);for(let k of e)k.reduce(E,C)}v.push(L)}let A=s.x.scale,N=s.y.scale,T={x:{value:_,source:a[A]?{value:Vt(_,a[A].invert),scale:A}:null},y:{value:M,source:a[N]?{value:Vt(M,a[N].invert),scale:N}:null},...h&&{z:{value:y}},...d&&{fill:{value:b,scale:"auto"}},...p&&{stroke:{value:x,scale:"auto"}},...m&&{symbol:{value:w,scale:"auto"}},...Object.fromEntries(e.map(({name:B,output:L})=>[B,{scale:"auto",label:L.label,radius:B==="r"?t/2:void 0,value:L.transform()}]))};return{data:i,facets:v,channels:T}})}function uW(e,t,n,r,i){let o=i*(1.5/cM),s=new Map;for(let a of t){let c=n[a],l=r[a];if(isNaN(c)||isNaN(l))continue;let u=Math.round(l=(l-Of)/o),f=Math.round(c=(c-Bf)/i-(u&1)/2),h=l-u;if(Math.abs(h)*3>1){let m=c-f,g=f+(c<f?-1:1)/2,y=u+(l<u?-1:1),b=c-g,x=l-y;m*m+h*h>b*b+x*x&&(f=g+(u&1?1:-1)/2,u=y)}let d=`${f},${u}`,p=s.get(d);p===void 0&&(p={index:[],extent:{data:e,x:(f+(u&1)/2)*i+Bf,y:u*o+Of}},s.set(d,p)),p.index.push(a)}return s.values()}var fW={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};function BO(e){return new Tm(e)}var Tm=class extends _t{constructor({binWidth:t=20,clip:n=!0,...r}={}){super(Ta,void 0,{clip:n,...r},fW),this.binWidth=Dt(t)}render(t,n,r,i,o){let{binWidth:s}=this,{marginTop:a,marginRight:c,marginBottom:l,marginLeft:u,width:f,height:h}=i,d=u-Bf,p=f-c-Bf,m=a-Of,g=h-l-Of,y=s/2,b=y*lM,x=b/2,w=y*2,v=b*1.5,_=Math.floor(d/w),M=Math.ceil(p/w),D=Math.floor((m+x)/v),A=Math.ceil((g-x)/v)+1,N=`m0,${Ga(-b)}l${Ga(y)},${Ga(x)}v${Ga(b)}l${Ga(-y)},${Ga(x)}`,T=N;for(let B=D;B<A;++B)for(let L=_;L<M;++L)T+=`M${Ga(L*w+(B&1)*y)},${Ga(B*v)}${N}`;return lt("svg:g",o).datum(0).call(Bt,this,i,o).call(It,this,{},Ne+Bf,Ne+Of).call(B=>B.append("path").call(Nt,this).call(Ht,this,r).attr("d",T)).node()}};function Ga(e){return Math.round(e*1e3)/1e3}var hW={ariaLabel:"image",fill:null,stroke:null};function dW(e){return/^\.*\//.test(e)}function pW(e){return/^(blob|data|file|http|https):/i.test(e)}function mW(e){return typeof e=="string"&&(dW(e)||pW(e))?[void 0,e]:[e,void 0]}var Em=class extends _t{constructor(t,n={}){let{x:r,y:i,r:o,width:s,height:a,rotate:c,src:l,preserveAspectRatio:u,crossOrigin:f,frameAnchor:h,imageRendering:d}=n;o==null&&(o=void 0),o===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[p,m]=mW(l),[g,y]=re(o),[b,x]=re(s,y!==void 0?y*2:void 0),[w,v]=re(a,y!==void 0?y*2:void 0),[_,M]=re(c,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:g,scale:"r",filter:er,optional:!0},width:{value:b,filter:er,optional:!0},height:{value:w,filter:er,optional:!0},rotate:{value:_,optional:!0},src:{value:p,optional:!0}},pm(n),hW),this.src=m,this.width=x,this.rotate=M,this.height=v,this.r=y,this.preserveAspectRatio=ce(u,"xMidYMid"),this.crossOrigin=Ue(f),this.frameAnchor=wo(h),this.imageRendering=ce(d,"auto")}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,width:u,height:f,r:h,rotate:d,src:p}=r,{r:m,width:g,height:y,rotate:b}=this,[x,w]=pn(this,i);return lt("svg:g",o).call(Bt,this,i,o).call(It,this,{x:c&&s,y:l&&a}).call(v=>v.selectAll().data(t).enter().append("image").call(Nt,this).attr("x",OO(c,u,h,x,g,m)).attr("y",OO(l,f,h,w,y,m)).attr("width",u?_=>u[_]:g!==void 0?g:h?_=>h[_]*2:m*2).attr("height",f?_=>f[_]:y!==void 0?y:h?_=>h[_]*2:m*2).attr("transform",d?_=>`rotate(${d[_]})`:b?`rotate(${b})`:null).attr("transform-origin",d||b?$a`${c?_=>c[_]:x}px ${l?_=>l[_]:w}px`:null).call(ut,"href",p?_=>p[_]:this.src).call(ut,"preserveAspectRatio",this.preserveAspectRatio).call(ut,"crossorigin",this.crossOrigin).call(ut,"image-rendering",this.imageRendering).call(ut,"clip-path",h?_=>`circle(${h[_]}px)`:m!==void 0?`circle(${m}px)`:null).call(Ht,this,r)).node()}};function OO(e,t,n,r,i,o){return t&&e?s=>e[s]-t[s]/2:t?s=>r-t[s]/2:e&&i!==void 0?s=>e[s]-i/2:i!==void 0?r-i/2:n&&e?s=>e[s]-n[s]:n?s=>r-n[s]:e?s=>e[s]-o:r-o}function LO(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Ce(t,n)),new Em(e,{...r,x:t,y:n})}function yW(e,t,n){var r=1e-8,i=t-1,o=n-1,s=0,a,c,l,u,f,h,d,p,m,g,y;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&n>=1?(l=e<.5?e:1-e,u=Math.sqrt(-2*Math.log(l)),d=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(d=-d),p=(d*d-3)/6,m=2/(1/(2*t-1)+1/(2*n-1)),g=d*Math.sqrt(p+m)/m-(1/(2*n-1)-1/(2*t-1))*(p+5/6-2/(3*m)),d=t/(t+n*Math.exp(2*g))):(a=Math.log(t/(t+n)),c=Math.log(n/(t+n)),u=Math.exp(t*a)/t,f=Math.exp(n*c)/n,g=u+f,e<u/g?d=Math.pow(t*g*e,1/t):d=1-Math.pow(n*g*(1-e),1/n)),y=-Lf(t)-Lf(n)+Lf(t+n);s<10;s++){if(d===0||d===1)return d;if(h=gW(d,t,n)-e,u=Math.exp(i*Math.log(d)+o*Math.log(1-d)+y),f=h/u,d-=u=f/(1-.5*Math.min(1,f*(i/d-o/(1-d)))),d<=0&&(d=.5*(d+u)),d>=1&&(d=.5*(d+u+1)),Math.abs(u)<r*d&&s>0)break}return d}function gW(e,t,n){var r=e===0||e===1?0:Math.exp(Lf(t+n)-Lf(t)-Lf(n)+t*Math.log(e)+n*Math.log(1-e));return e<0||e>1?!1:e<(t+1)/(t+n+2)?r*FO(e,t,n)/t:1-r*FO(1-e,n,t)/n}function FO(e,t,n){var r=1e-30,i=1,o=t+n,s=t+1,a=t-1,c=1,l=1-o*e/s,u,f,h,d;for(Math.abs(l)<r&&(l=r),l=1/l,d=l;i<=100&&(u=2*i,f=i*(n-i)*e/((a+u)*(t+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,d*=l*c,f=-(t+i)*(o+i)*e/((t+u)*(s+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,h=l*c,d*=h,!(Math.abs(h-1)<3e-7));i++);return d}function Lf(e){var t=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,i,o,s;for(s=(o=i=e)+5.5,s-=(i+.5)*Math.log(s);t<6;t++)r+=n[t]/++o;return Math.log(2.506628274631*r/i)-s}function CO(e,t){var n=yW(2*Math.min(e,1-e),.5*t,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}var bW={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},cw=class extends _t{constructor(t,n={}){let{x:r,y:i,z:o,ci:s=.95,precision:a=4}=n;if(super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y"},z:{value:Un(n),optional:!0}},n,bW),this.z=o,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(t,n,r,i,o){let{x:s,y:a,z:c}=r,{ci:l}=this;return lt("svg:g",o).call(Bt,this,i,o).call(It,this,n).call(u=>u.selectAll().data(c?Xp(t,c,this.z):[t]).enter().call(f=>f.append("path").attr("fill","none").call(Nt,this).call(rl,this,{...r,fill:null,fillOpacity:null}).attr("d",h=>this._renderLine(h,s,a)).call(l&&!Ls(this.fill)?h=>h.select(xW).attr("stroke","none").call(Nt,this).call(rl,this,{...r,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",d=>this._renderBand(d,s,a)):()=>{}))).node()}};function xW(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(Yr.svg,"path"),this)}var EI=class extends cw{constructor(t,n){super(t,n)}_renderBand(t,n,r){let{ci:i,precision:o}=this,[s,a]=se(t,u=>r[u]),c=lw(t,r,n),l=$O(t,r,n,(1-i)/2,c);return Fu().y(u=>u).x0(u=>l(u,-1)).x1(u=>l(u,1))(Re(s,a-o/2,o).concat(a))}_renderLine(t,n,r){let[i,o]=se(t,a=>r[a]),s=lw(t,r,n);return`M${s(i)},${i}L${s(o)},${o}`}},DI=class extends cw{constructor(t,n){super(t,n)}_renderBand(t,n,r){let{ci:i,precision:o}=this,[s,a]=se(t,u=>n[u]),c=lw(t,n,r),l=$O(t,n,r,(1-i)/2,c);return Fu().x(u=>u).y0(u=>l(u,-1)).y1(u=>l(u,1))(Re(s,a-o/2,o).concat(a))}_renderLine(t,n,r){let[i,o]=se(t,a=>n[a]),s=lw(t,n,r);return`M${i},${s(i)}L${o},${s(o)}`}};function kO(e,{y:t=Me,x:n=W,stroke:r,fill:i=te(r)?"currentColor":r,...o}={}){return new EI(e,yf({...o,x:n,y:t,fill:i,stroke:r}))}function RO(e,{x:t=Me,y:n=W,stroke:r,fill:i=te(r)?"currentColor":r,...o}={}){return new DI(e,mf({...o,x:t,y:n,fill:i,stroke:r}))}function lw(e,t,n){let r=0,i=0,o=0,s=0;for(let u of e){let f=t[u],h=n[u];r+=f,i+=h,o+=f*h,s+=f*f}let a=e.length,c=(a*o-r*i)/(a*s-r*r),l=(i-c*r)/a;return u=>c*u+l}function $O(e,t,n,r,i){let o=Sn(e,u=>t[u])/e.length,s=0,a=0;for(let u of e)s+=(t[u]-o)**2,a+=(n[u]-i(t[u]))**2;let c=Math.sqrt(a/(e.length-2)),l=CO(r,e.length-2);return(u,f)=>{let h=i(u),d=c*Math.sqrt(1/e.length+(u-o)**2/s);return h+f*l*d}}function Dm({path:e=W,delimiter:t,frameAnchor:n,treeLayout:r=Pc,treeSort:i,treeSeparation:o,treeAnchor:s,treeFilter:a,...c}={}){s=dw(s),i=zO(i),a!=null&&(a=BI(a)),n===void 0&&(n=s.frameAnchor);let l=qO(t),u=HO(c,BI),[f,h]=hn(),[d,p]=hn();return{x:f,y:d,frameAnchor:n,...dn(c,(m,g)=>{let y=l(bt(m,e)),b=h([]),x=p([]),w=-1,v=[],_=[],M=sb().path(A=>y[A]),D=r();D.nodeSize&&D.nodeSize([1,1]),D.separation&&o!==void 0&&D.separation(o??Up);for(let A of u)A[fw]=A[GO]([]);for(let A of g){let N=[],T=M(A.filter(B=>y[B]!=null)).each(B=>B.data=m[B.data]);i!=null&&T.sort(i),D(T);for(let B of T.descendants())if(!(a!=null&&!a(B))){N.push(++w),v[w]=B.data,s.position(B,w,b,x);for(let L of u)L[fw][w]=L[XO](B)}_.push(N)}return{data:v,facets:_}}),...Object.fromEntries(u)}}function hw({path:e=W,delimiter:t,curve:n="bump-x",stroke:r="#555",strokeWidth:i=1.5,strokeOpacity:o=.5,treeLayout:s=Pc,treeSort:a,treeSeparation:c,treeAnchor:l,treeFilter:u,...f}={}){l=dw(l),a=zO(a),u!=null&&(u=PO(u)),f={curve:n,stroke:r,strokeWidth:i,strokeOpacity:o,...f};let h=qO(t),d=HO(f,PO),[p,m]=hn(),[g,y]=hn(),[b,x]=hn(),[w,v]=hn();return{x1:p,x2:g,y1:b,y2:w,...dn(f,(_,M)=>{let D=h(bt(_,e)),A=m([]),N=y([]),T=x([]),B=v([]),L=-1,S=[],I=[],E=sb().path(k=>D[k]),C=s();C.nodeSize&&C.nodeSize([1,1]),C.separation&&c!==void 0&&C.separation(c??Up);for(let k of d)k[fw]=k[GO]([]);for(let k of M){let F=[],R=E(k.filter($=>D[$]!=null)).each($=>$.data=_[$.data]);a!=null&&R.sort(a),C(R);for(let{source:$,target:U}of R.links())if(!(u!=null&&!u(U,$))){F.push(++L),S[L]=U.data,l.position($,L,A,T),l.position(U,L,N,B);for(let G of d)G[fw][L]=G[XO](U,$)}I.push(F)}return{data:S,facets:I}}),...Object.fromEntries(d)}}function dw(e="left"){switch(`${e}`.trim().toLowerCase()){case"left":return wW;case"right":return _W}throw new Error(`invalid tree anchor: ${e}`)}var wW={frameAnchor:"left",dx:6,position({x:e,y:t},n,r,i){r[n]=t,i[n]=-e}},_W={frameAnchor:"right",dx:-6,position({x:e,y:t},n,r,i){r[n]=-t,i[n]=-e}};function zO(e){return e==null||typeof e=="function"?e:`${e}`.trim().toLowerCase().startsWith("node:")?UO(BI(e)):UO(vW(e))}function UO(e){return(t,n)=>ln(e(t),e(n))}function vW(e){return t=>t.data?.[e]}function qO(e="/"){if(e=`${e}`,e==="/")return n=>n;if(e.length!==1)throw new Error("delimiter must be exactly one character");let t=e.charCodeAt(0);return n=>n.map(r=>SW(r,t))}var NI=92,VO=47;function SW(e,t){if(t===NI)throw new Error("delimiter cannot be backslash");let n=!1;for(let r=0,i=e.length;r<i;++r){switch(e.charCodeAt(r)){case NI:if(!n){n=!0;continue}break;case t:n?(e=e.slice(0,r-1)+e.slice(r),--r,--i):e=e.slice(0,r)+"/"+e.slice(r+1);break;case VO:n?(e=e.slice(0,r)+"\\\\"+e.slice(r),r+=2,i+=2):(e=e.slice(0,r)+"\\"+e.slice(r),++r,++i);break}n=!1}return e}function MW(e){let t=!1;for(let n=0,r=e.length;n<r;++n){switch(e.charCodeAt(n)){case NI:if(!t){t=!0;continue}case VO:t&&(e=e.slice(0,n-1)+e.slice(n),--n,--r);break}t=!1}return e}function jO(e){return fn(e)&&typeof e.node=="function"}function IW(e){return fn(e)&&typeof e.link=="function"}function BI(e){if(jO(e))return e.node;if(e=`${e}`.trim().toLowerCase(),!!e.startsWith("node:")){switch(e){case"node:name":return LI;case"node:path":return OI;case"node:internal":return YO;case"node:external":return WO;case"node:depth":return FI;case"node:height":return CI}throw new Error(`invalid node value: ${e}`)}}function PO(e){if(jO(e))return e.node;if(IW(e))return e.link;if(e=`${e}`.trim().toLowerCase(),!(!e.startsWith("node:")&&!e.startsWith("parent:"))){switch(e){case"parent:name":return uw(LI);case"parent:path":return uw(OI);case"parent:depth":return uw(FI);case"parent:height":return uw(CI);case"node:name":return LI;case"node:path":return OI;case"node:internal":return YO;case"node:external":return WO;case"node:depth":return FI;case"node:height":return CI}throw new Error(`invalid link value: ${e}`)}}function OI(e){return e.id}function LI(e){return AW(e.id)}function FI(e){return e.depth}function CI(e){return e.height}function YO(e){return!!e.children}function WO(e){return!e.children}function uw(e){return(t,n)=>n==null?void 0:e(n)}function AW(e){let t=e.length;for(;--t>0&&!TW(e,t););return MW(e.slice(t+1))}function TW(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}var GO=2,XO=3,fw=4;function HO(e,t){let n=[];for(let r in e){let i=e[r],o=t(i);o!==void 0&&n.push([r,...hn(i),o])}return n}function kI(e,{fill:t,stroke:n,strokeWidth:r,strokeOpacity:i,strokeLinejoin:o,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:l,marker:u,markerStart:f=u,markerEnd:h=u,dot:d=te(f)&&te(h),text:p="node:name",textStroke:m="var(--plot-background)",title:g="node:path",dx:y,dy:b,textAnchor:x,treeLayout:w=Pc,textLayout:v=w===Pc||w===ib?"mirrored":"normal",tip:_,...M}={}){if(y===void 0&&(y=dw(M.treeAnchor).dx),x!==void 0)throw new Error("textAnchor is not a configurable tree option");v=Ke(v,"textLayout",["mirrored","normal"]);function D(A){return So(e,Dm({treeLayout:w,text:p,fill:t===void 0?"currentColor":t,stroke:m,dx:y,dy:b,title:g,...A,...M}))}return Qe(K1(e,hw({treeLayout:w,markerStart:f,markerEnd:h,stroke:n!==void 0?n:t===void 0?"node:internal":t,strokeWidth:r,strokeOpacity:i,strokeLinejoin:o,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:l,...M})),d?ni(e,Dm({treeLayout:w,fill:t===void 0?"node:internal":t,title:g,tip:_,...M})):null,p!=null?v==="mirrored"?[D({textAnchor:"start",treeFilter:"node:external"}),D({textAnchor:"end",treeFilter:"node:internal",dx:-y})]:D():null)}function ZO(e,t){return kI(e,{...t,treeLayout:ib})}function KO({geometry:e=W,...t}={}){return _e({...t,x:null,y:null},(n,r,i,o,s,{projection:a})=>{let c=bt(n,e),l=c.length,u=new Float64Array(l),f=new Float64Array(l),h=In(a);for(let d=0;d<l;++d)[u[d],f[d]]=h.centroid(c[d]);return{data:n,facets:r,channels:{x:{value:u,scale:a==null?"x":null,source:null},y:{value:f,scale:a==null?"y":null,source:null}}}})}function QO({geometry:e=W,...t}={}){let n;return{...t,x:{transform:r=>Float64Array.from(n=bt(bt(r,e),Qv),([i])=>i)},y:{transform:()=>Float64Array.from(n,([,r])=>r)}}}var lL=mF(cL(),1);var CW=({marginLeft:e})=>[1,e],kW=({width:e,marginRight:t})=>[-1,e-t],RW=({width:e,marginLeft:t,marginRight:n})=>[0,(t+e-n)/2],$W=({marginTop:e})=>[1,e],UW=({height:e,marginBottom:t})=>[-1,e-t],PW=({height:e,marginTop:t,marginBottom:n})=>[0,(t+e-n)/2];function uL(e){return typeof e=="string"?{anchor:e}:e}function fL(e={},t={}){arguments.length===1&&([e,t]=dL(e));let{anchor:n="left",padding:r=1,r:i=t.r}=uL(e);switch(`${n}`.toLowerCase()){case"left":n=CW;break;case"right":n=kW;break;case"middle":n=RW;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return pL("x","y",n,Dt(r),i,t)}function hL(e={},t={}){arguments.length===1&&([e,t]=dL(e));let{anchor:n="bottom",padding:r=1,r:i=t.r}=uL(e);switch(`${n}`.toLowerCase()){case"top":n=$W;break;case"bottom":n=UW;break;case"middle":n=PW;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return pL("y","x",n,Dt(r),i,t)}function dL(e){let{anchor:t,padding:n,...r}=e,{r:i}=r;return[{anchor:t,padding:n,r:i},r]}function pL(e,t,n,r,i,o){if(i!=null&&typeof i!="number"){let{channels:s,sort:a,reverse:c}=o;s=zp(s),s?.r===void 0&&(o={...o,channels:{...s,r:{value:i,scale:"r"}}}),a===void 0&&c===void 0&&(o.sort={channel:"-r"})}return _e(o,function(s,a,c,l,u,f){let{[t]:h,r:d}=c;if(!c[t])throw new Error(`missing channel: ${t}`);({[t]:h}=ka(c,l,f));let p=d?void 0:i!==void 0?Dt(i):this.r!==void 0?this.r:3;d&&(d=bt(d.value,l[d.scale]||W,Float64Array));let[m,g]=n(u),y=m?qW:zW,b=new Float64Array(h.length),x=d?w=>d[w]:()=>p;for(let w of a){let v=(0,lL.default)();w=w.filter(d?M=>Uu(h[M])&&er(d[M]):M=>Uu(h[M]));let _=new Float64Array(2*w.length+2);for(let M of w){let D=x(M),A=m?D+r:0,N=h[M]-D,T=h[M]+D,B=2;v.queryInterval(N-r,T+r,([,,S])=>{let I=b[S]-A,E=h[M]-h[S],C=r+(d?d[M]+d[S]:2*p),k=Math.sqrt(C*C-E*E);_[B++]=I-k,_[B++]=I+k});let L=_.slice(0,B);m&&(L=L.filter(S=>S>=0));t:for(let S of L.sort(y)){for(let I=0;I<B;I+=2)if(_[I]+1e-6<S&&S<_[I+1]-1e-6)continue t;b[M]=S+A;break}v.insert([N,T,M])}}m||(m=1);for(let w of a)for(let v of w)b[v]=b[v]*m+g;return{data:s,facets:a,channels:{[e]:{value:b,source:null},[t]:{value:h,source:c[t]},...d&&{r:{value:d,source:c.r}}}}})}function zW(e,t){return Math.abs(e)-Math.abs(t)}function qW(e,t){return e-t}function yL(e,t){return arguments.length===1&&({basis:e,...t}=e),Tf(yw(e),t)}function gL(e,t){return arguments.length===1&&({basis:e,...t}=e),Ef(yw(e),t)}function yw(e){if(e===void 0)return mL;if(typeof e=="function")return gw(Yu(e));if(/^p\d{2}$/i.test(e))return Rf(Vu(e));switch(`${e}`.toLowerCase()){case"deviation":return YW;case"first":return mL;case"last":return jW;case"max":return WW;case"mean":return GW;case"median":return XW;case"min":return HW;case"sum":return ZW;case"extent":return VW}throw new Error(`invalid basis: ${e}`)}function gw(e){return{mapIndex(t,n,r){let i=+e(t,n);for(let o of t)r[o]=n[o]===null?NaN:n[o]/i}}}function Rf(e){return gw((t,n)=>e(t,r=>n[r]))}var VW={mapIndex(e,t,n){let[r,i]=se(e,s=>t[s]),o=i-r;for(let s of e)n[s]=t[s]===null?NaN:(t[s]-r)/o}},mL=gw((e,t)=>{for(let n=0;n<e.length;++n){let r=t[e[n]];if($e(r))return r}}),jW=gw((e,t)=>{for(let n=e.length-1;n>=0;--n){let r=t[e[n]];if($e(r))return r}}),YW={mapIndex(e,t,n){let r=cs(e,o=>t[o]),i=jr(e,o=>t[o]);for(let o of e)n[o]=t[o]===null?NaN:i?(t[o]-r)/i:0}},WW=Rf(jt),GW=Rf(cs),XW=Rf(Ai),HW=Rf(ae),ZW=Rf(Sn);function bL(e,t){return KW("x",e,t)}function KW(e,t,n={}){let r,i=1;if(typeof t=="number")i=t,r=(l,u)=>+l+u;else{if(typeof t=="string"){let l=t.startsWith("-")?-1:1;[t,i]=Xx(t.replace(/^[+-]/,"")),i*=l}t=Gu(t),r=(l,u)=>t.offset(l,u)}let o=`${e}1`,s=`${e}2`,a=mr({[o]:l=>l.map(u=>r(u,i)),[s]:l=>l},n),c=a[s].transform;return a[s].transform=()=>{let l=c(),[u,f]=se(l);return l.domain=i<0?[u,r(f,i)]:[r(u,i),f],l},a}function xL(e,t={}){if(typeof e=="string")switch(e.toLowerCase()){case"first":return qI(t);case"last":return VI(t)}if(typeof e=="function")return Xa(null,e,t);let n,r;for(n in e){if(r!==void 0)throw new Error("ambiguous selector; multiple inputs");r=QW(e[n])}if(r===void 0)throw new Error(`invalid selector: ${e}`);return Xa(n,r,t)}function QW(e){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"min":return jI;case"max":return YI}throw new Error(`unknown selector: ${e}`)}function qI(e){return Xa(null,JW,e)}function VI(e){return Xa(null,tG,e)}function wL(e){return Xa("x",jI,e)}function _L(e){return Xa("y",jI,e)}function vL(e){return Xa("x",YI,e)}function SL(e){return Xa("y",YI,e)}function*JW(e){yield e[0]}function*tG(e){yield e[e.length-1]}function*jI(e,t){yield q0(e,n=>t[n])}function*YI(e,t){yield Sc(e,n=>t[n])}function Xa(e,t,n){if(e!=null){if(n[e]==null)throw new Error(`missing channel: ${e}`);e=n[e]}let r=Un(n);return dn(n,(i,o)=>{let s=bt(i,r),a=bt(i,e),c=[];for(let l of o){let u=[];for(let f of s?on(l,h=>s[h]).values():[l])for(let h of t(f,a))u.push(h);c.push(u)}return{data:i,facets:c}})}var eG=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"],["round","round"],["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"],["xLabelOffset","x.labelOffset"],["xFontVariant","x.fontVariant"],["xAriaLabel","x.ariaLabel"],["xAriaDescription","x.ariaDescription"],["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"],["yLabelOffset","y.labelOffset"],["yFontVariant","y.fontVariant"],["yAriaLabel","y.ariaLabel"],["yAriaDescription","y.ariaDescription"],["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"],["fxNice","fx.nice"],["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"],["fyNice","fy.mice"],["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"],["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"],["opacityReverse","opacity.reverse"],["opacityZero","opacity.zero"],["opacityTickFormat","opacity.tickFormat"],["opacityBase","opacity.base"],["opacityExponent","opacity.exponent"],["opacityConstant","opacity.constant"],["rScale","r.type"],["rDomain","r.domain"],["rRange","r.range"],["rClamp","r.clamp"],["rNice","r.nice"],["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"],["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 nG(e,t,n){for(let r=0;r<t.length;++r){let i=t[r];r===t.length-1?e[i]=n:e=e[i]||(e[i]={})}}function ML(e,t,n){for(let r in e){let i=eG.get(r);if(i==null)throw new Error(`Unrecognized plot attribute: ${r}`);let o=e[r];typeof o=="symbol"?n.push(r):o!==void 0&&nG(t,i.split("."),o)}}var rG=new Set(["frame","hexgrid","sphere","graticule"]);async function AL(e){let t={marks:[]},n=[],{attributes:r,marks:i}=e;ML(r,t,n);let o=[];for(let a of i)for(let{type:c,data:l,options:u}of a.plotSpecs())rG.has(c)?t.marks.push(bw[c](u)):t.marks.push(bw[c](l,u)),o.push(a.index);oG(t,e);let s=sm(t);sG(s,o),iG(e,s,r,n);for(let a of e.interactors)await a.init(s);return s}function iG(e,t,n,r){r.forEach(i=>{let o=n[i];if(o===js){if(!i.endsWith("Domain"))throw new Error(`Unsupported fixed attribute: ${i}`);let s=i.slice(0,-6),a=t.scale(s);a?.domain&&e.setAttribute(i,n[`${s}Reverse`]?a.domain.slice().reverse():a.domain)}else throw new Error(`Unrecognized symbol: ${o}`)})}function oG(e,t){let{marks:n}=t;xw("x",e,n,["x","x1","x2"]),xw("y",e,n,["y","y1","y2"]),xw("fx",e,n),xw("fy",e,n)}function xw(e,t,n,r=[e]){let i=t[e]||{};if(i.axis===null||i.label!==void 0)return;let o=n.map(u=>u.channelField(r)?.field);if(o.every(u=>u==null))return;let s,a,c;for(let u=0;u<o.length;++u){let{column:f,label:h}=o[u]||{};f===void 0&&h===void 0||(s===void 0&&a===void 0?(s=f,a=h,c=aG(n[u].data,r)||"number"):a!==h?a=void 0:s!==f&&(s=void 0))}let l=a||s;if(l!==void 0){if((c==="number"||c==="date")&&(e==="x"||e==="y")){i.percent&&(l=`${l} (%)`);let u=(e==="x"?1:-1)*(i.reverse?-1:1);e==="x"||i.labelAnchor==="center"?l=e==="x"==u<0?`\u2190 ${l}`:`${l} \u2192`:l=`${u<0?"\u2191 ":"\u2193 "}${l}`}t[e]={...i,label:l}}}function sG(e,t){let n=e.querySelectorAll('g[aria-label="facet"]');if(n.length)for(let r of n)IL(r,t);else IL(e,t)}function IL(e,t){let n=-1;for(let r of e.children){let i=r.getAttribute("aria-label")||"";r.nodeName==="style"||i.includes("-axis")||i.includes("-grid")||r.setAttribute("data-index",t[++n])}}function aG(e,t){for(let n of e)for(let r=0;r<t.length;++r){let i=n[t[r]];if(i!=null)return i instanceof Date?"date":typeof i}}var cG={width:640,marginLeft:40,marginRight:20,marginTop:20,marginBottom:30},WI=class{constructor(t){this.attributes={...cG},this.listeners=null,this.interactors=[],this.legends=[],this.marks=[],this.markset=null,this.element=t||document.createElement("div"),this.element.setAttribute("class","plot"),this.element.style.display="flex",this.element.value=this,this.params=new Map,this.synch=G_()}margins(){return{left:this.getAttribute("marginLeft"),top:this.getAttribute("marginTop"),bottom:this.getAttribute("marginBottom"),right:this.getAttribute("marginRight")}}innerWidth(){let{left:t,right:n}=this.margins();return this.getAttribute("width")-t-n}innerHeight(t=400){let{top:n,bottom:r}=this.margins(),i=this.getAttribute("height");return i==null&&t!=null&&(i=t,this.setAttribute("height",i,{silent:!0})),i-n-r}pending(t){this.synch.pending(t)}update(t){return this.synch.ready(t)&&!this.pendingRender&&(this.pendingRender=!0,requestAnimationFrame(()=>this.render())),this.synch.promise}async render(){this.pendingRender=!1;let t=await AL(this),n=this.legends.flatMap(({legend:r,include:i})=>{let o=r.init(t);return i?o:[]});this.element.replaceChildren(t,...n),this.synch.resolve()}getAttribute(t){return this.attributes[t]}setAttribute(t,n,r){return Jh(this.attributes[t],n)?(n===void 0?delete this.attributes[t]:this.attributes[t]=n,r?.silent||this.listeners?.get(t)?.forEach(i=>i(t,n)),!0):!1}addAttributeListener(t,n){let r=this.listeners||(this.listeners=new Map);return r.has(t)||r.set(t,new Set),r.get(t).add(n),this}removeAttributeListener(t,n){return this.listeners?.get(t)?.delete(n)}addParams(t,n){let{params:r}=this;for(let i of n)r.has(i)?r.get(i).push(t):(r.set(i,[t]),i.addEventListener("value",()=>Promise.allSettled(r.get(i).map(o=>o.requestQuery()))))}addMark(t){return t.setPlot(this,this.marks.length),this.marks.push(t),this.markset=null,this}get markSet(){return this.markset||(this.markset=new Set(this.marks))}addInteractor(t){return this.interactors.push(t),this}addLegend(t,n=!0){t.setPlot(this),this.legends.push({legend:t,include:n})}};function ww(e){return typeof e!="string"?!1:(e=e.toLowerCase().trim(),e==="none"||e==="currentcolor"||e.startsWith("url(")&&e.endsWith(")")||e.startsWith("var(")&&e.endsWith(")")||Tr(e)!==null)}var lG=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"]);function TL(e){return lG.has(e)}var uG=new Set(["asterisk","circle","cross","diamond","diamond2","hexagon","plus","square","square2","star","times","triangle","triangle2","wye"]);function EL(e){return uG.has(`${e}`.toLowerCase())}function Om(e){return typeof e?.getChild=="function"}function DL(e){switch(e.typeId){case 2:case 3:case 7:return Float64Array;default:return Array}}function NL(e){let{typeId:t}=e;return t===10?n=>n==null?n:new Date(n):t===2&&e.bitWidth>=64?n=>n==null?n:Number(n):n=>n}function Lm(e){let{type:t}=e,{typeId:n}=t;if(n===2&&t.bitWidth>=64){let r=e.length,i=new Float64Array(r);for(let o=0;o<r;++o){let s=e.get(o);i[o]=s==null?NaN:Number(s)}return i}return e.toArray()}function _w(e){return Om(e)?fG(e):e}function fG(e){let{batches:t,numRows:n}=e;if(!n)return[];let r=Array.from({length:n},()=>({}));for(let i=0,o=0;o<t.length;++o){let s=t[o],{schema:a,numRows:c,numCols:l}=s;for(let u=0;u<l;++u){let f=s.getChildAt(u),{name:h,type:d}=a.fields[u],p=NL(d);for(let m=i,g=0;g<c;++g,++m)r[m][h]=p(f.get(g))}i+=c}return r}var BL=e=>e==="stroke"||e==="fill",hG=e=>e==="symbol",dG=(e,t)=>e!=="sort"&&e!=="tip"&&t!=null&&!Array.isArray(t),GI=(e,t)=>({channel:e,field:t,as:t instanceof dr?t.column:e}),XI=(e,t)=>({channel:e,value:t}),vw=e=>Array.isArray(e),or=class extends jf{constructor(t,n,r,i={}){super(n?.options?.filterBy),this.type=t,this.reqs=i,this.source=n,vw(this.source)&&(this.data=this.source);let o=this.channels=[],s=this.detail=new Set,a=this.params=new Set,c=(l,u)=>{let f=typeof u;if(l==="channels")for(let h in u)s.add(h),c(h,u[h]);else if(f==="function"&&u[qf]){let h=u(this,l);for(let d in h)c(d,h[d])}else if(f==="string")TL(l)||BL(l)&&ww(u)||hG(l)&&EL(u)?o.push(XI(l,u)):o.push(GI(l,b0(u)));else if(is(u))if(Array.isArray(u.columns))o.push(GI(l,u)),a.add(u);else{let h=XI(l,u.value);o.push(h),u.addEventListener("value",d=>(h.value=d,this.update()))}else f==="object"&&dG(l,u)?o.push(GI(l,u)):u!==void 0&&o.push(XI(l,u))};for(let l in r)c(l,r[l])}setPlot(t,n){this.plot=t,this.index=n,t.addParams(this,this.params),this.source?.table&&this.queryPending()}hasOwnData(){return this.source==null||vw(this.source)}channel(t){return this.channels.find(n=>n.channel===t)}channelField(...t){let n=t.flat();for(let r of n){let i=this.channel(r);if(i?.field)return i}return null}fields(){if(this.hasOwnData())return null;let{source:{table:t},channels:n,reqs:r}=this,i=new Map;for(let{channel:o,field:s}of n){let a=s?.column;if(a){if(s.stats?.length||r[o]){i.has(a)||i.set(a,new Set);let c=i.get(a);r[o]?.forEach(l=>c.add(l)),s.stats?.forEach(l=>c.add(l))}}else continue}return Array.from(i,([o,s])=>({table:t,column:o,stats:Array.from(s)}))}fieldInfo(t){return this.stats=t.reduce((n,r)=>(n[r.column]=r,n),Object.create(null)),this}query(t=[]){if(this.hasOwnData())return null;let{channels:n,source:{table:r}}=this;return HI(n,r).where(t)}queryPending(){return this.plot.pending(this),this}queryResult(t){return this.data=_w(t),this}update(){return this.plot.update(this)}plotSpecs(){let{type:t,data:n,detail:r,channels:i}=this,o={},s={};for(let a of i){let c=r.has(a.channel)?s:o;c[a.channel]=ri(a)}return r.size&&(o.channels=s),[{type:t,data:n,options:o}]}};function ri(e){return Object.hasOwn(e,"value")?e.value:BL(e.channel)?{value:e.as,scale:"color"}:e.as}function HI(e,t,n=[]){let r=Ct.from({source:t}),i=new Set,o=!1;for(let s of e){let{channel:a,field:c,as:l}=s;if(!n.includes(a)){if(a==="orderby")r.orderby(s.value);else if(c){if(c.aggregate)o=!0;else{if(i.has(l))continue;i.add(l)}r.select({[l]:c})}}}return o&&r.groupby(Array.from(i)),r}function bl(e,t){let{plot:n}=e,r=n.getAttribute(`${t}Scale`);if(!r){let{field:o}=e.channelField(t,`${t}1`,`${t}2`),{type:s}=e.stats[o.column];r=s==="date"?"time":"linear"}let i={type:r};switch(r){case"log":i.base=n.getAttribute(`${t}Base`)??10;break;case"pow":i.exponent=n.getAttribute(`${t}Exponent`)??1;break;case"symlog":i.constant=n.getAttribute(`${t}Constant`)??1;break}return Qh(i)}function Rr(e,t,n,r,i=1,o){let{field:s}=e.channelField(t);o=o??s;let{type:a,apply:c,sqlApply:l}=bl(e,t),u=!!e.plot.getAttribute(`${t}Reverse`),[f,h]=r.map(b=>c(b)),d=l(o),p=a==="time"||a==="utc"?d:o,m=h===f?0:(n-i)/(h-f),g=m!==1?` * ${m}::DOUBLE`:"";return[u?q`(${h} - ${d}::DOUBLE)${g}`:q`(${d}::DOUBLE - ${f})${g}`,p]}var ZI={x:["min","max"]},KI={y:["min","max"]},Sw={...ZI,...KI};function OL(e,t,n,r,i){let{plot:o,stats:s}=e,a=o.getAttribute(r),c=o.getAttribute(i);if(Array.isArray(a)&&!a[yn])return a;{let{field:l}=e.channelField(n),{column:u}=l,{min:f,max:h}=s[u],d=QI(t,u)||(c?bs().domain([f,h]).nice().domain():[f,h]);return a!==js&&(d[yn]=!0),o.setAttribute(r,d,{silent:!0}),d}}function Eo(e,t){return OL(e,t,"x","xDomain","xNice")}function Do(e,t){return OL(e,t,"y","yDomain","yNice")}function QI(e,t){if(!e)return;let n,r,i=(o,s)=>{if(o==="BETWEEN"&&s.field.column===t){let{range:a}=s;a&&(n==null||a[0]<n)&&(n=a[0]),a&&(r==null||a[1]>r)&&(r=a[1])}};return Array.isArray(e)?e.forEach(o=>o.visit?.(i)):e.visit&&e.visit(i),n!=null&&r!=null&&n!==r?[n,r]:void 0}var JI=class extends or{constructor(t,n,r){let i=t.endsWith("X")?"y":t.endsWith("Y")?"x":null,o={[i]:["min","max"]};super(t,n,r,o),this.dim=i}query(t=[]){let{plot:n,dim:r,source:i,stats:o}=this,{optimize:s=!0}=i.options||{},a=super.query(t);if(!r)return a;let c=r==="x"?"y":"x",l=this.channelField(c)?.as,{field:u,as:f}=this.channelField(r),{type:h}=o[u.column];if(s&&(h==="date"||h==="number")&&l){let{column:p}=u,{max:m,min:g}=o[p],y=r==="x"?n.innerWidth():n.innerHeight(),[b,x]=QI(t,p)||[g,m],[w]=Rr(this,r,y,[b,x],1,f),v=a.select().map(_=>_.as).filter(_=>_!==f&&_!==l);return pG(a,w,f,l,v)}else return a.orderby(u)}};function pG(e,t,n,r,i=[]){let o=q`FLOOR(${t})::INTEGER`,s=a=>Ct.from(e).select(a).groupby(o,i);return Ct.union(s([{[n]:sa(n),[r]:w0(r,n)},...i]),s([{[n]:oa(n),[r]:_0(r,n)},...i]),s([{[n]:w0(n,r),[r]:sa(r)},...i]),s([{[n]:_0(n,r),[r]:oa(r)},...i])).orderby(i,n)}function LL(e,t="density"){return Om(e)?DL(e.getChild(t).type):typeof e[0][t]=="number"?Float64Array:Array}function FL(e,t){let n=LL(t);return mG(new n(e),t)}function mG(e,t,n="density"){if(Om(t)){let r=t.numRows;if(r===0)return e;let i=Lm(t.getChild("index")),o=Lm(t.getChild(n));for(let s=0;s<r;++s)e[i[s]]=o[s]}else for(let r of t)e[r.index]=r[n];return e}function CL(e,t,n,r,i=[],o){let s=e*t,a=r.map(y=>LL(n,y)),c=r.length,l=y=>{let b={};return i.forEach((x,w)=>b[x]=y[w]),r.forEach((x,w)=>b[x]=new a[w](s)),b},u={},f=i.length?null:u[[]]=l([]),h=i.length?y=>u[y]??(u[y]=l(y)):()=>f,d=n.numRows;if(d===0)return Object.values(u);let p=Lm(n.getChild("index")),m=r.map(y=>Lm(n.getChild(y))),g=i.map(y=>n.getChild(y));if(o){let y=p.map(x=>x%e),b=p.map(x=>Math.floor(x/e));if(i.length)for(let x=0;x<d;++x){let w=g.map(_=>_.get(x)),v=h(w);v.index||(v.index=[]),v.index.push(x)}else f.index=p.map((x,w)=>w);Object.values(u).forEach(x=>{for(let w=0;w<c;++w)o(x.index,e,t,y,b,m[w],x[r[w]]);delete x.index})}else for(let y=0;y<d;++y){let b=g.map(w=>w.get(y)),x=h(b);for(let w=0;w<c;++w)x[r[w]][p[y]]=m[w][y]}return Object.values(u)}function Fm(e,t){let n=0,r=0;return e.forEach(i=>{let o=i[t],s=o.length;for(let a=0;a<s;++a){let c=o[a];c<n&&(n=c),c>r&&(r=c)}}),n===0&&r===0?[0,1]:[n,r]}function kL(e,t){let n=new Wn;return e.forEach(r=>{let i=r[t],o=i.length;for(let s=0;s<o;++s)n.add(i[s])}),Array.from(n).sort($t)}function Dn(e,t,n,r){Yl(n)?(r=r||(()=>e.requestUpdate()),n.addEventListener("value",i=>(e[t]=i,r())),e[t]=n.value):e[t]=n}function Cm(e,t=!1){let n=new Float64Array(5),r=new Float64Array(4);yG(n,r,e);let i=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]),o=1+n[1]+n[2]+n[3]+n[4],s=(r[0]+r[1]+r[2]+r[3])/o,a=(i[1]+i[2]+i[3]+i[4])/o;return{sigma:e,negative:t,a:n,b_causal:r,b_anticausal:i,sum_causal:s,sum_anticausal:a}}function yG(e,t,n){let i=Float64Array.of(.84,1.8675,.84,-1.8675,-.34015,-.1299,-.34015,.1299),o=Math.exp(-1.783/n),s=Math.exp(-1.723/n),a=.6318/n,c=1.997/n,l=Float64Array.of(-o*Math.cos(a),o*Math.sin(a),-o*Math.cos(-a),o*Math.sin(-a),-s*Math.cos(c),s*Math.sin(c),-s*Math.cos(-c),s*Math.sin(-c)),u=n*2.5066282746310007,f=Float64Array.of(i[0],i[1],0,0,0,0,0,0),h=Float64Array.of(1,0,l[0],l[1],0,0,0,0,0,0),d,p;for(p=2;p<8;p+=2){for(f[p]=l[p]*f[p-2]-l[p+1]*f[p-1],f[p+1]=l[p]*f[p-1]+l[p+1]*f[p-2],d=p-2;d>0;d-=2)f[d]+=l[p]*f[d-2]-l[p+1]*f[d-1],f[d+1]+=l[p]*f[d-1]+l[p+1]*f[d-2];for(d=0;d<=p;d+=2)f[d]+=i[p]*h[d]-i[p+1]*h[d+1],f[d+1]+=i[p]*h[d+1]+i[p+1]*h[d];for(h[p+2]=l[p]*h[p]-l[p+1]*h[p+1],h[p+3]=l[p]*h[p+1]+l[p+1]*h[p],d=p;d>0;d-=2)h[d]+=l[p]*h[d-2]-l[p+1]*h[d-1],h[d+1]+=l[p]*h[d-1]+l[p+1]*h[d-2]}for(p=0;p<4;++p)d=p<<1,t[p]=f[d]/u,e[p+1]=h[d+2]}function RL(e,t,n,[r,i]){let o=new Float64Array(Math.max(r,i)),s=new Float64Array(Math.max(r,i)),a=new Float64Array(5),c=new Float64Array(n.length);for(let l=0,u=0;l<i;++l,u+=r){let f=c.subarray(u);Mw(e,n.subarray(u),r,1,o,s,a,f)}for(let l=0;l<r;++l){let u=c.subarray(l);Mw(t,u,i,r,o,s,a,u)}return c}function Mw(e,t,n,r=1,i=new Float64Array(n),o=new Float64Array(n),s=new Float64Array(5),a=i,c=gG){let l=r*2,u=r*3,f=r*4,h=r*n,d,p;for(c(i,t,n,r,e.b_causal,3,e.a,4,e.sum_causal,s,e.sigma),p=4,d=f;p<n;++p,d+=r)i[p]=e.b_causal[0]*t[d]+e.b_causal[1]*t[d-r]+e.b_causal[2]*t[d-l]+e.b_causal[3]*t[d-u]-e.a[1]*i[p-1]-e.a[2]*i[p-2]-e.a[3]*i[p-3]-e.a[4]*i[p-4];for(c(o,t,n,-r,e.b_anticausal,4,e.a,4,e.sum_anticausal,s,e.sigma),p=4,d=h-r*5;p<n;++p,d-=r)o[p]=e.b_anticausal[1]*t[d+r]+e.b_anticausal[2]*t[d+l]+e.b_anticausal[3]*t[d+u]+e.b_anticausal[4]*t[d+f]-e.a[1]*o[p-1]-e.a[2]*o[p-2]-e.a[3]*o[p-3]-e.a[4]*o[p-4];if(e.negative)for(p=0,d=0;p<n;++p,d+=r)a[d]=i[p]+o[n-p-1];else for(p=0,d=0;p<n;++p,d+=r)a[d]=Math.max(0,i[p]+o[n-p-1]);return a}function gG(e,t,n,r,i,o,s,a,c,l,u,f=.5){let h=Math.abs(r)*n,d=r<0?h+r:0,p,m,g;for(m=0;m<=a;++m)for(l[m]=m<=o?i[m]:0,g=1;g<=a&&g<=m;++g)l[m]-=s[g]*l[m-g];for(g=0;g<a;++g)for(e[g]=0,m=1;m<=g;++m)p=d+r*m,p>=0&&p<h&&(e[g]+=l[g-m]*t[p]);let y=t[d],b=Math.ceil(u*10);for(m=0;m<b;++m){for(g=0;g<a;++g)e[g]+=l[g]*y;if(c-=Math.abs(l[0]),c<=f)break;for(l[a]=m+a<=o?i[m+a]:0,g=1;g<=a;++g)l[a]-=s[g]*l[a-g];for(g=0;g<a;++g)l[g]=l[g+1]}}function $L({random:e=co(42)}={}){return(t,n,r,i,o,s,a)=>{let{points:c,triangles:l,hull:u}=Cn.from(t,d=>i[d],d=>o[d]),f=new Uint8Array(n*r),h=SG(s,e);for(let d=0;d<l.length;d+=3){let p=l[d],m=l[d+1],g=l[d+2],y=c[2*p],b=c[2*m],x=c[2*g],w=c[2*p+1],v=c[2*m+1],_=c[2*g+1],M=Math.min(y,b,x),D=Math.max(y,b,x),A=Math.min(w,v,_),N=Math.max(w,v,_),T=(v-_)*(y-x)+(w-_)*(x-b);if(!T)continue;let B=s[t[p]],L=s[t[m]],S=s[t[g]];for(let I=Math.floor(M);I<D;++I)for(let E=Math.floor(A);E<N;++E){if(I<0||I>=n||E<0||E>=r)continue;let C=I+.5,k=E+.5,F=((v-_)*(C-x)+(k-_)*(x-b))/T;if(F<0)continue;let R=((_-w)*(C-x)+(k-_)*(y-x))/T;if(R<0)continue;let $=1-F-R;if($<0)continue;let U=I+n*E;a[U]=h(B,F,L,R,S,$,I,E),f[U]=1}}return bG(a,f,i,o,s,n,r,u,t,h),a}}function bG(e,t,n,r,i,o,s,a,c,l){n=Float64Array.from(a,d=>n[c[d]]),r=Float64Array.from(a,d=>r[c[d]]),i=Array.from(a,d=>i[c[d]]);let u=n.length,f=Array.from({length:u},(d,p)=>wG(p,n,r)),h=0;for(let d=0;d<s;++d){let p=d+.5;for(let m=0;m<o;++m){let g=m+o*d;if(!t[g]){let y=m+.5;for(let b=0;b<u;++b){let x=(u+h+(b%2?(b+1)/2:-b/2))%u;if(f[x](y,p)){let w=xG(n.at(x-1),r.at(x-1),n[x],r[x],y,p);e[g]=l(i.at(x-1),w,i[x],1-w,i[x],0,m,d),h=x;break}}}}}}function xG(e,t,n,r,i,o){let s=n-e,a=r-t,c=s*(n-i)+a*(r-o),l=s*(i-e)+a*(o-t);return c>0&&l>0?c/(c+l):+(c>l)}function km(e,t,n,r){return e*r-n*t}function wG(e,t,n){let r=t.length,i=t.at(e-2),o=n.at(e-2),s=t.at(e-1),a=n.at(e-1),c=t[e],l=n[e],u=t.at(e+1-r),f=n.at(e+1-r),h=s-c,d=a-l,p=i-s,m=o-a,g=c-u,y=l-f,b=Math.hypot(h,d),x=Math.hypot(p,m),w=Math.hypot(g,y);return(v,_)=>{let M=v-s,D=_-a,A=v-c,N=_-l;return km(M,D,A,N)>-1e-6&&km(M,D,h,d)*x-km(M,D,p,m)*b>-1e-6&&km(A,N,g,y)*b-km(A,N,h,d)*w<=0}}function UL(e,t,n,r,i,o,s){let a=Cn.from(e,u=>r[u],u=>i[u]),c,l;for(let u=.5,f=0;u<n;++u){l=c;for(let h=.5;h<t;++h,++f)l=a.find(h,u,l),h===.5&&(c=l),s[f]=o[e[l]]}return s}function PL({random:e=co(42),minDistance:t=.5,maxSteps:n=2}={}){return(r,i,o,s,a,c,l)=>{let u=Cn.from(r,p=>s[p],p=>a[p]),f,h,d;for(let p=.5,m=0;p<o;++p){h=f;for(let g=.5;g<i;++g,++m){let y=g,b=p;d=h=u.find(y,b,h),g===.5&&(f=h);let x,w=0;for(;(x=Math.hypot(s[r[d]]-y,a[r[d]]-b))>t&&w<n;){let v=e(g,p,w)*2*Math.PI;y+=Math.cos(v)*x,b+=Math.sin(v)*x,d=u.find(y,b,d),++w}l[m]=c[r[d]]}}return l}}function _G(e,t,n,r,i,o){return t*e+r*n+o*i}function vG(e){return(t,n,r,i,o,s,a,c)=>{let l=e(a,c);return l<n?t:l<n+i?r:o}}function SG(e,t){return MG(e)||IG(e)?_G:vG(t)}function MG(e){for(let t of e)if(t!=null)return typeof t=="number"}function IG(e){for(let t of e)if(t!=null)return t instanceof Date}var qs="density",Fi=class extends or{constructor(t,n,r){let{bandwidth:i=0,interpolate:o="none",pixelSize:s=1,pad:a=1,width:c,height:l,...u}=r,f=AG(u);super(t,n,u,Sw),this.densityMap=f,Dn(this,"bandwidth",i,()=>this.grids?this.convolve().update():null),Dn(this,"pixelSize",s),Dn(this,"interpolate",o),Dn(this,"pad",a),Dn(this,"width",c),Dn(this,"height",l)}setPlot(t,n){let r=()=>{this.stats&&this.requestUpdate()};return t.addAttributeListener("domainX",r),t.addAttributeListener("domainY",r),super.setPlot(t,n)}get filterIndexable(){let t=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return t&&n&&!t[yn]&&!n[yn]}query(t=[]){let{interpolate:n,pad:r,channels:i,densityMap:o,source:s}=this,[a,c]=this.extentX=Eo(this,t),[l,u]=this.extentY=Do(this,t),[f,h]=this.bins=this.binDimensions(this),[d,p]=Rr(this,"x",f,[a,c],r),[m,g]=Rr(this,"y",h,[l,u],r),y=r?[Oe(p,[+a,+c]),Oe(g,[+l,+u])]:[gc(+a,p),yc(p,+c),gc(+l,g),yc(g,+u)],b=Ct.from(s.table).where(t.concat(y)),x=this.groupby=[],w={};for(let _ of i)if(Object.hasOwn(_,"field")){let{as:M,channel:D,field:A}=_;A.aggregate?(w[D]=A,o[D]=!0):D==="weight"?w[qs]=Mi(A):D!=="x"&&D!=="y"&&(b.select({[M]:A}),x.push(M))}let v=this.aggr=Object.keys(w);if(w.density&&v.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(v.length||(v.push(qs),w.density=Si()),n==="linear"){if(v.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!w.density)throw new Error("Linear binning not applicable to custom aggregates.");return DG(b,d,m,w[qs],f,x)}else return EG(b,d,m,w,f,x)}binDimensions(){let{plot:t,pixelSize:n,width:r,height:i}=this;return[r??Math.round(t.innerWidth()/n),i??Math.round(t.innerHeight()/n)]}queryResult(t){let[n,r]=this.bins,i=TG(this.interpolate);return this.grids=CL(n,r,t,this.aggr,this.groupby,i),this.convolve()}convolve(){let{aggr:t,bandwidth:n,bins:r,grids:i,plot:o}=this;if(this.kde=this.grids,n>0){let s=t.length===1?t[0]:t.includes(qs)?qs:null;if(!s)return console.warn("No compatible grid found for smoothing."),this;let a=o.innerWidth(),c=o.innerHeight(),[l,u]=r,f=i.some(p=>p[s].some(m=>m<0)),h=Cm(n*(l-1)/a,f),d=Cm(n*(u-1)/c,f);this.kde=this.grids.map(p=>{let m=RL(h,d,p[s],r);return{...p,[s]:m}})}return this}plotSpecs(){throw new Error("Unimplemented. Use a Grid2D mark subclass.")}};function AG(e){let t={};for(let n in e)e[n]==="density"&&(delete e[n],t[n]=!0);return t}function TG(e="none"){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"none":case"linear":return;case"nearest":return UL;case"barycentric":return $L();case"random-walk":return PL()}throw new Error(`invalid interpolate: ${e}`)}function EG(e,t,n,r,i,o){return e.select({index:q`FLOOR(${t})::INTEGER + FLOOR(${n})::INTEGER * ${i}`,...r}).groupby("index",o)}function DG(e,t,n,r,i,o){let s=r?.column?`* ${r.column}`:"",a=(h,d)=>e.clone().select({xp:t,yp:n,i:h,w:d}),c=a(q`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${i}`,q`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),l=a(q`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${i}`,q`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(q`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${i}`,q`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(q`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${i}`,q`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return Ct.from(Ct.unionAll(c,l,u,f)).select({index:"i",density:Mi("w")},o).groupby("index",o).having(Zh("density",0))}var t3=class extends Fi{constructor(t,n){let{thresholds:r=10,...i}=n;super("geo",t,{bandwidth:20,interpolate:"linear",pixelSize:2,...i}),Dn(this,"thresholds",r,()=>this.grids?this.contours().update():null)}convolve(){return super.convolve().contours()}contours(){let{bins:t,densityMap:n,kde:r,thresholds:i,plot:o}=this,s=i;if(!Array.isArray(s)){let[,w]=Fm(r,"density");s=Array.from({length:s-1},(v,_)=>w*(_+1)/s)}(n.fill||n.stroke)&&this.plot.getAttribute("colorScale")!=="log"&&this.plot.setAttribute("colorZero",!0);let[a,c]=t,[l,u]=o.getAttribute("xDomain"),[f,h]=o.getAttribute("yDomain"),d=(u-l)/a,p=(h-f)/c,m=+l,g=+f,y=w=>m+w*d,b=w=>g+w*p,x=ma().size(t);return this.data=r.flatMap(w=>s.map(v=>Object.assign(NG(x.contour(w.density,v),y,b),{...w,density:v}))),this}plotSpecs(){let{type:t,channels:n,densityMap:r,data:i}=this,o={};for(let s of n){let{channel:a}=s;a!=="x"&&a!=="y"&&(o[a]=ri(s))}return r.fill&&(o.fill="density"),r.stroke&&(o.stroke="density"),[{type:t,data:i,options:o}]}};function NG(e,t,n){function r(s){s.forEach(i)}function i(s){s.forEach(o)}function o(s){s[0]=t(s[0]),s[1]=n(s[1])}return e.coordinates.forEach(r),e}function Iw(e,t){if(typeof document<"u"){let n=document.createElement("canvas");return n.setAttribute("width",e),n.setAttribute("height",t),n}throw new Error("Can not create a canvas instance.")}function zL(e=1){let t=255*e|0;return(n,r,i)=>{for(let o=0,s=0;o<i;++o)for(let a=0;a<r;++a,s+=4)n[s+3]=t}}function qL(e){let{apply:t}=e;return(n,r,i,o)=>{for(let s=0,a=0;s<i;++s)for(let c=0,l=(i-s-1)*r;c<r;++c,a+=4)n[a+3]=255*t(o[c+l])|0}}function VL(e={}){let{r:t=0,g:n=0,b:r=0,opacity:i=1}=typeof e=="string"?en(e):e,o=new Uint8ClampedArray([t,n,r,255*i|0]);return(s,a,c)=>{for(let l=0,u=0;l<c;++l)for(let f=0;f<a;++f,u+=4)s[u+0]=o[0],s[u+1]=o[1],s[u+2]=o[2],s[u+3]=o[3]}}function jL(e){let{domain:t,range:n}=e,r=Object.create(null),i=new Uint8ClampedArray(4*t.length),o=t.length-1,s=n.length;for(let a=0;a<=o;++a){let c=n[a%s],{r:l,g:u,b:f,opacity:h=1}=typeof c=="string"?en(c):c,d=a<<2;i[d+0]=l,i[d+1]=u,i[d+2]=f,i[d+3]=255*h|0,r[t[a]]=d}return(a,c,l,u)=>{if(u.map)for(let f=0,h=0;f<l;++f)for(let d=0,p=(l-f-1)*c;d<c;++d,h+=4){let m=r[u[d+p]];a[h+0]=i[m+0],a[h+1]=i[m+1],a[h+2]=i[m+2],a[h+3]=i[m+3]}else{let f=r[u];for(let h=0,d=0;h<l;++h)for(let p=0;p<c;++p,d+=4)a[d+0]=i[f+0],a[d+1]=i[f+1],a[d+2]=i[f+2],a[d+3]=i[f+3]}}}function YL(e,t,n){let{interpolate:r}=t,i=new Uint8ClampedArray(4*e),o=e-1;for(let s=0;s<=o;++s){let a=r(s/o),{r:c,g:l,b:u,opacity:f=1}=typeof a=="string"?en(a):a,h=s<<2;i[h+0]=c,i[h+1]=l,i[h+2]=u,i[h+3]=255*f|0}return(s,a,c,l)=>{for(let u=0,f=0;u<c;++u)for(let h=0,d=(c-u-1)*a;h<a;++h,f+=4){let p=o*n(l[h+d])<<2;s[f+0]=i[p+0],s[f+1]=i[p+1],s[f+2]=i[p+2],s[f+3]=i[p+3]}}}var $f=class extends Fi{constructor(t,n){super("image",t,n)}setPlot(t,n){let r=()=>{this.stats&&this.rasterize()};t.addAttributeListener("schemeColor",r),super.setPlot(t,n)}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:t,kde:n}=this,[r,i]=t,{canvas:o,ctx:s,img:a}=FG(this,r,i),{alpha:c,alphaProp:l,color:u,colorProp:f}=n3(this);return this.data=n.map(h=>(u?.(a.data,r,i,h[f]),c?.(a.data,r,i,h[l]),s.putImageData(a,0,0),{src:o.toDataURL()})),this}plotSpecs(){let{type:t,plot:n,data:r}=this,i={src:"src",width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:t,data:r,options:i}]}},e3=class extends $f{constructor(t,n){super(t,{bandwidth:20,interpolate:"linear",pixelSize:2,...n})}};function n3(e){let{aggr:t,densityMap:n,groupby:r,plot:i}=e,o=t.includes(qs),s=t.includes("fillOpacity"),a=e.channel("fill"),c=e.channel("fillOpacity");if(t.length>2||o&&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 l=n.fill||t.includes("fill")?"grid":r.includes(a?.as)?"group":ww(a?.value)?a.value:o&&i.getAttribute("colorScheme")?"grid":void 0,u=n.fillOpacity||t.includes("fillOpacity")?"grid":typeof c?.value=="number"?c.value:o&&l!=="grid"?"grid":void 0;if(l!=="grid"&&u!=="grid")throw new Error("Raster mark missing density values.");let f=a?.as??(l==="grid"?qs:null),h=c?.as??(u==="grid"?qs:null),d=l!=="grid"&&l!=="group"?VL(l):OG(e,f),p=u!=="grid"?zL(u):BG(e,h);return{alphaProp:h,colorProp:f,alpha:p,color:d}}function BG(e,t){let{plot:n,kde:r}=e,i=n.getAttribute("opacityDomain"),o=i===js,s=i?.[yn],a=!o&&!s&&i||Fm(r,t);(o||s)&&(s&&(a[yn]=!0),n.setAttribute("colorDomain",a));let c=af({opacity:{type:n.getAttribute("opacityScale"),domain:a,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 qL(c)}function OG(e,t){let{plot:n,kde:r}=e,i=!r[0][t]?.map,o=i||Array.isArray(r[0][t]),s=n.getAttribute("colorDomain"),a=s===js,c=s?.[yn],l=!a&&!c&&s||(i?r.map(f=>f[t]).sort($t):o?kL(r,t):Fm(r,t));(a||c)&&(c&&(l[yn]=!0),n.setAttribute("colorDomain",l));let u=af({color:{type:n.getAttribute("colorScale"),domain:l,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(o)return jL(u);{let f=af({x:{type:LG(u.type),domain:u.domain,reverse:u.reverse,range:[0,1],clamp:u.clamp,base:u.base,exponent:u.exponent,constant:u.constant}});return YL(1024,u,f.apply)}}function LG(e){return e.endsWith("symlog")?"symlog":e.endsWith("log")?"log":e.endsWith("pow")?"pow":e.endsWith("sqrt")?"sqrt":e==="diverging"?"linear":e}function FG(e,t,n){if(!e.image||e.image.w!==t||e.image.h!==n){let r=Iw(t,n),i=r.getContext("2d",{willReadFrequently:!0}),o=i.getImageData(0,0,t,n);e.image={canvas:r,ctx:i,img:o,w:t,h:n}}return e.image}var r3=class extends $f{constructor(t,n){let{normalize:r=!0,...i}=n;super(t,i),Dn(this,"normalize",r)}query(t=[]){let{channels:n,normalize:r,source:i,binPad:o}=this,[s,a]=this.bins=this.binDimensions(this),[c]=Rr(this,"x",s,Eo(this,t),o),[l]=Rr(this,"y",a,Do(this,t),o),u=Ct.from(i.table).where(CG(this,t));this.aggr=["density"];let f=this.groupby=[],h=[];for(let d of n)if(Object.hasOwn(d,"field")){let{channel:p,field:m}=d;p==="z"?(u.select({[p]:m}),h.push("z")):p!=="x"&&p!=="y"&&(u.select({[p]:m}),f.push(p))}return kG(u,c,l,h,s,a,f,r)}};function CG(e,t){if(Array.isArray(t)&&!t.length)return t;let n=e.channelField("x").field.column,r=e.channelField("y").field.column,i=s=>s.op!=="BETWEEN"||s.field.column!==n&&s.field.column!==r,o=s=>s.op==="AND"?Ar(s.children.filter(a=>i(a))):s;return Array.isArray(t)?t.filter(s=>i(s)).map(s=>o(s)):o(t)}function kG(e,t,n,r,i,o,s=[],a=!0){e.select({x:q`FLOOR(${t})::INTEGER`,y:q`FLOOR(${n})::INTEGER`});let c=s.concat(r),l=c.length?`PARTITION BY ${c.join(", ")} `:"",u=Ct.from(e).select(c,{x0:"x",y0:"y",dx:q`(lead(x) OVER sw - x)`,dy:q`(lead(y) OVER sw - y)`}).window({sw:q`${l}ORDER BY x ASC`}).qualify(Ar(q`(x0 < ${i} OR x0 + dx < ${i})`,q`(y0 < ${o} OR y0 + dy < ${o})`,q`(x0 > 0 OR x0 + dx > 0)`,q`(y0 > 0 OR y0 + dy > 0)`)),f=Ct.select({x:q`GREATEST(MAX(ABS(dx)), MAX(ABS(dy)))`}).from("pairs"),h=Ct.select({i:q`UNNEST(range((${f})))::INTEGER`}),d=Ct.unionAll(Ct.select(c,{x:q`x0 + i`,y:q`y0 + ROUND(i * dy / dx::FLOAT)::INTEGER`}).from("pairs","indices").where(q`ABS(dy) <= ABS(dx) AND i < ABS(dx)`),Ct.select(c,{x:q`x0 + ROUND(SIGN(dy) * i * dx / dy::FLOAT)::INTEGER`,y:q`y0 + SIGN(dy) * i`}).from("pairs","indices").where(q`ABS(dy) > ABS(dx) AND i < ABS(dy)`),Ct.select(c,{x:"x0",y:"y0"}).from("pairs").where(Hh("dx"))),p=["x"].concat(c).join(", "),m=Ct.from("raster").select(c,"x","y",a?{w:q`1.0 / COUNT(*) OVER (PARTITION BY ${p})`}:null).where(Ar(Oe("x",[0,i],!0),Oe("y",[0,o],!0)));return Ct.with({pairs:u,indices:h,raster:d,points:m}).from("points").select(s,{index:q`x + y * ${i}::INTEGER`,density:a?Mi("w"):Si()}).groupby("index",s)}var i3=class extends or{constructor(t,n,r){let{bins:i=1024,bandwidth:o=20,...s}=r,a=t.endsWith("X")?"y":"x";super(t,n,s,a==="x"?ZI:KI),this.dim=a,Dn(this,"bins",i),Dn(this,"bandwidth",o,()=>this.grid?this.convolve().update():null)}get filterIndexable(){let t=this.dim==="x"?"xDomain":"yDomain",n=this.plot.getAttribute(t);return n&&!n[yn]}query(t=[]){if(this.hasOwnData())throw new Error("Density1DMark requires a data source");let{bins:n,channels:r,dim:i,source:{table:o}}=this,s=this.extent=(i==="x"?Eo:Do)(this,t),[a,c]=Rr(this,i,n,s),l=HI(r,o,[i]).where(t.concat(Oe(c,s))),u=this.channelField("weight")?"weight":null;return RG(l,a,u)}queryResult(t){return this.grid=FL(this.bins,t),this.convolve()}convolve(){let{bins:t,bandwidth:n,dim:r,grid:i,plot:o,extent:[s,a]}=this,c=i.some(b=>b<0),l=r==="x"?o.innerWidth():o.innerHeight(),u=Cm(n*(t-1)/l,c),f=Mw(u,i,t),h=this.data=[],d=r==="x"?"y":"x",p=this.channelField(r).as,m=+s,g=(a-m)/(t-1),y=1/g;for(let b=0;b<t;++b)h.push({[p]:m+b*g,[d]:f[b]*y});return this}plotSpecs(){let{type:t,data:n,channels:r,dim:i}=this,o=i==="x"?{y:"y"}:{x:"x"};for(let s of r)o[s.channel]=ri(s);return[{type:t,data:n,options:o}]}};function RG(e,t,n){let r=n?`* ${n}`:"",i=e.clone().select({p:t,i:q`FLOOR(p)::INTEGER`,w:q`(FLOOR(p) + 1 - p)${r}`}),o=e.clone().select({p:t,i:q`FLOOR(p)::INTEGER + 1`,w:q`(p - FLOOR(p))${r}`});return Ct.from(Ct.unionAll(i,o)).select({index:"i",density:Mi("w")}).groupby("index").having(O_("density",0))}var o3=class extends Fi{constructor(t,n){let{type:r="dot",...i}=n;super(r,t,{bandwidth:20,interpolate:"linear",pad:0,pixelSize:2,...i})}convolve(){super.convolve();let{bins:t,pad:n,extentX:r,extentY:i}=this,[o,s]=t,a=bl(this,"x"),c=bl(this,"y"),[l,u]=r.map(g=>a.apply(g)),[f,h]=i.map(g=>c.apply(g)),d=(u-l)/(o-n),p=(h-f)/(s-n),m=n?0:.5;return this.data=$G(this.kde,t,l,f,d,p,a.invert,c.invert,m),this}plotSpecs(){let{type:t,channels:n,densityMap:r,data:i}=this,o={};for(let s of n){let{channel:a}=s;o[a]=a==="x"||a==="y"?a:ri(s)}for(let s in r)r[s]&&(o[s]="density");return[{type:t,data:i,options:o}]}};function $G(e,t,n,r,i,o,s,a,c){let l=1/(i*o),[u,f]=t,h=[];for(let d of e){let p=d.density;for(let m=0,g=0;g<f;++g)for(let y=0;y<u;++y,++m)h.push({...d,x:s(n+(y+c)*i),y:a(r+(g+c)*o),density:p[m]*l})}return h}var UG="geom",s3=class extends or{constructor(t,n={},r){!vw(t)&&!n?.geometry&&(n.geometry=q_(UG)),super("geo",t,n,r)}queryResult(t){super.queryResult(t);let n=this.channelField("geometry")?.as;return n&&this.data&&this.data.forEach(r=>{typeof r[n]=="string"&&(r[n]=JSON.parse(r[n]))}),this}};var a3=class extends or{constructor(t,n){let{type:r="hexagon",binWidth:i=20,...o}=n;super(r,t,{r:i/2,clip:!0,...o},Sw),this.binWidth=i}get filterIndexable(){let t=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return t&&n&&!t[yn]&&!n[yn]}query(t=[]){if(this.hasOwnData())return null;let{plot:n,binWidth:r,channels:i,source:o}=this,[s,a]=Eo(this,t),[c,l]=Do(this,t),u=.5-n.getAttribute("marginLeft"),f=0-n.getAttribute("marginTop"),h=`${r}::DOUBLE`,d=`${r*(1.5/Math.sqrt(3))}::DOUBLE`,p=`${n.innerWidth()/(a-s)}::DOUBLE`,m=`${n.innerHeight()/(l-c)}::DOUBLE`,g,y,b=new Set,x={};for(let D of i)D.channel==="orderby"?w.orderby(D.value):D.channel==="x"?g=D:D.channel==="y"?y=D:Object.hasOwn(D,"field")&&(x[D.as]=D.field,D.field.aggregate&&D.field.columns.forEach(A=>b.add(A)));let w=Ct.select({[g.as]:q`${s}::DOUBLE + ((x + 0.5 * (y & 1)) * ${h} + ${u})::DOUBLE / ${p}`,[y.as]:q`${l}::DOUBLE - (y * ${d} + ${f})::DOUBLE / ${m}`,...x}).groupby("x","y"),v=`${p} * (${g.field} - ${s}::DOUBLE)`,_=`${m} * (${l}::DOUBLE - ${y.field})`,M=Ct.select({py:q`(${_} - ${f}) / ${d}`,pj:q`ROUND(py)::INTEGER`,px:q`(${v} - ${u}) / ${h} - 0.5 * (pj & 1)`,pi:q`ROUND(px)::INTEGER`,tt:q`ABS(py-pj) * 3 > 1 AND (px-pi)**2 + (py-pj)**2 > (px - pi - 0.5 * CASE WHEN px < pi THEN -1 ELSE 1 END)**2 + (py - pj - CASE WHEN py < pj THEN -1 ELSE 1 END)**2`,x:q`CASE WHEN tt THEN (pi + (CASE WHEN px < pi THEN -0.5 ELSE 0.5 END) + (CASE WHEN pj & 1 <> 0 THEN 0.5 ELSE -0.5 END))::INTEGER ELSE pi END`,y:q`CASE WHEN tt THEN (pj + CASE WHEN py < pj THEN -1 ELSE 1 END)::INTEGER ELSE pj END`}).select(Array.from(b)).from(o.table).where(mc(g.field),mc(y.field),t);return w.from(M)}};var c3=class extends Fi{constructor(t,n){let{origin:r=[0,0],dim:i="xy",...o}=n;super("image",t,o),this.origin=r,this.tileX=i.toLowerCase().includes("x"),this.tileY=i.toLowerCase().includes("y")}setPlot(t,n){let r=()=>{this.stats&&this.rasterize()};t.addAttributeListener("schemeColor",r),super.setPlot(t,n)}requestQuery(){return this.requestTiles()}query(t=[]){return this._filter=t,null}tileQuery(t){let{binType:n,binPad:r,channels:i,densityMap:o,source:s}=this,[[a,c],[l,u]]=t,[f,h]=this.bins,[d,p]=Rr(this,"x",f,[a,c],r),[m,g]=Rr(this,"y",h,[l,u],r),y=r?[Oe(p,[+a,+c]),Oe(g,[+l,+u])]:[gc(+a,p),yc(p,+c),gc(+l,g),yc(g,+u)],b=Ct.from(s.table).where(y),x=this.groupby=[],w={};for(let _ of i)if(Object.hasOwn(_,"field")){let{as:M,channel:D,field:A}=_;A.aggregate?(w[D]=A,o[D]=!0):D==="weight"?w.density=Mi(A):D!=="x"&&D!=="y"&&(b.select({[M]:A}),x.push(M))}let v=this.aggr=Object.keys(w);if(w.density&&v.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(v.length||(v.push("density"),w.density=Si()),n==="linear"){if(v.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!w.density)throw new Error("Linear binning not applicable to custom aggregates.");return jG(b,d,m,w.density,f,x)}else return VG(b,d,m,w,f,x)}async requestTiles(){let t=j_();this.prefetch&&t.cancel(this.prefetch);let{binPad:n,tileX:r,tileY:i,origin:[o,s]}=this,[a,c]=this.bins=this.binDimensions(this),[l,u]=Eo(this,this._filter),[f,h]=Do(this,this._filter),d=u-l,p=h-f,m=Math.floor((l-o)*(a-n)/d),g=Math.floor((f-s)*(c-n)/p),y=(N,T)=>[[o+N*d,o+(N+1)*d],[s+T*p,s+(T+1)*p]],b=Math.floor((l-o)/d),x=r?WL((u-o)/d):b,w=Math.floor((f-s)/p),v=i?WL((h-s)/p):w,_=[];for(let N=b;N<=x;++N)for(let T=w;T<=v;++T)_.push([N,T]);let M=_.map(([N,T])=>t.query(this.tileQuery(y(N,T)))),D=[];if(r)for(let N=w;N<=v;++N)D.push([x+1,N]),D.push([b-1,N]);if(i){let N=r?b-1:b,T=r?x+1:x;for(let B=N;B<=T;++B)D.push([B,v+1]),D.push([B,w-1])}this.prefetch=D.map(([N,T])=>t.prefetch(this.tileQuery(y(N,T))));let A=await Promise.all(M);this.grids=[{density:PG(a,c,m,g,_,A)}],this.convolve().update()}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:t,kde:n}=this,[r,i]=t,{canvas:o,ctx:s,img:a}=qG(this,r,i),{alpha:c,alphaProp:l,color:u,colorProp:f}=n3(this);return this.data=n.map(h=>(u?.(a.data,r,i,h[f]),c?.(a.data,r,i,h[l]),s.putImageData(a,0,0),{src:o.toDataURL()})),this}plotSpecs(){let{type:t,data:n,plot:r}=this,i={src:"src",width:r.innerWidth(),height:r.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:t,data:n,options:i}]}};function PG(e,t,n,r,i,o){let s=new Float64Array(e*t);return o.forEach((a,c)=>{let[l,u]=i[c],f=l*e-n,h=u*t-r;zG(e,t,s,a,f,h)}),s}function zG(e,t,n,r,i,o){let s=r.numRows;if(s===0)return;let a=r.getChild("index").toArray(),c=r.getChild("density").toArray();for(let l=0;l<s;++l){let u=a[l],f=i+u%e,h=o+Math.floor(u/e);0<=f&&f<e&&0<=h&&h<t&&(n[f+h*e]=c[l])}}function qG(e,t,n){if(!e.image||e.image.w!==t||e.image.h!==n){let r=Iw(t,n),i=r.getContext("2d",{willReadFrequently:!0}),o=i.getImageData(0,0,t,n);e.image={canvas:r,ctx:i,img:o,w:t,h:n}}return e.image}function VG(e,t,n,r,i,o){return e.select({index:q`FLOOR(${t})::INTEGER + FLOOR(${n})::INTEGER * ${i}`,...r}).groupby("index",o)}function jG(e,t,n,r,i,o){let s=r.column?`* ${r.column}`:"",a=(h,d)=>e.clone().select({xp:t,yp:n,i:h,w:d}),c=a(q`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${i}`,q`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),l=a(q`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${i}`,q`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(q`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${i}`,q`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(q`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${i}`,q`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return Ct.from(Ct.unionAll(c,l,u,f)).select({index:"i",density:Mi("w")},o).groupby("index",o).having(Zh("density",0))}function WL(e){let t=Math.floor(e);return t===e?t-1:t}function YG(e,t,n){var r=1e-8,i=t-1,o=n-1,s=0,a,c,l,u,f,h,d,p,m,g,y;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&n>=1?(l=e<.5?e:1-e,u=Math.sqrt(-2*Math.log(l)),d=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(d=-d),p=(d*d-3)/6,m=2/(1/(2*t-1)+1/(2*n-1)),g=d*Math.sqrt(p+m)/m-(1/(2*n-1)-1/(2*t-1))*(p+5/6-2/(3*m)),d=t/(t+n*Math.exp(2*g))):(a=Math.log(t/(t+n)),c=Math.log(n/(t+n)),u=Math.exp(t*a)/t,f=Math.exp(n*c)/n,g=u+f,e<u/g?d=Math.pow(t*g*e,1/t):d=1-Math.pow(n*g*(1-e),1/n)),y=-Uf(t)-Uf(n)+Uf(t+n);s<10;s++){if(d===0||d===1)return d;if(h=WG(d,t,n)-e,u=Math.exp(i*Math.log(d)+o*Math.log(1-d)+y),f=h/u,d-=u=f/(1-.5*Math.min(1,f*(i/d-o/(1-d)))),d<=0&&(d=.5*(d+u)),d>=1&&(d=.5*(d+u+1)),Math.abs(u)<r*d&&s>0)break}return d}function WG(e,t,n){var r=e===0||e===1?0:Math.exp(Uf(t+n)-Uf(t)-Uf(n)+t*Math.log(e)+n*Math.log(1-e));return e<0||e>1?!1:e<(t+1)/(t+n+2)?r*GL(e,t,n)/t:1-r*GL(1-e,n,t)/n}function GL(e,t,n){var r=1e-30,i=1,o=t+n,s=t+1,a=t-1,c=1,l=1-o*e/s,u,f,h,d;for(Math.abs(l)<r&&(l=r),l=1/l,d=l;i<=100&&(u=2*i,f=i*(n-i)*e/((a+u)*(t+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,d*=l*c,f=-(t+i)*(o+i)*e/((t+u)*(s+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,h=l*c,d*=h,!(Math.abs(h-1)<3e-7));i++);return d}function Uf(e){var t=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,i,o,s;for(s=(o=i=e)+5.5,s-=(i+.5)*Math.log(s);t<6;t++)r+=n[t]/++o;return Math.log(2.506628274631*r/i)-s}function XL(e,t){var n=YG(2*Math.min(e,1-e),.5*t,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}var l3=class extends or{constructor(t,n){let{ci:r=.95,precision:i=4,...o}=n;super("line",t,o);let s=()=>this.modelFit?this.confidenceBand().update():null;Dn(this,"ci",r,s),Dn(this,"precision",i,s)}query(t=[]){let n=this.channelField("x").as,r=this.channelField("y").as,i=Array.from(new Set(["stroke","z","fx","fy"].flatMap(o=>this.channelField(o)?.as||[])));return Ct.from(super.query(t)).select({intercept:C_(r,n),slope:k_(r,n),n:R_(r,n),ssy:$_(r,n),ssx:U_(r,n),xm:P_(r,n),x0:v0(sa(n).where(mc(r))),x1:v0(oa(n).where(mc(r)))}).select(i).groupby(i)}queryResult(t){return this.modelFit=_w(t),this.lineData=this.modelFit.flatMap(n=>GG(n)),this.confidenceBand()}confidenceBand(){let{ci:t,modelFit:n,precision:r,plot:i}=this,o=i.innerWidth();return this.areaData=t?n.flatMap(s=>XG(t,r,s,o)):null,this}plotSpecs(){let{lineData:t,areaData:n,channels:r,ci:i}=this,o={x:"x",y:"y"},s={x:"x",y1:"y1",y2:"y2",fillOpacity:.1};for(let a of r)switch(a.channel){case"x":case"y":case"fill":break;case"stroke":o.stroke=s.fill=ri(a);break;case"strokeOpacity":o.strokeOpacity=ri(a);break;case"fillOpacity":s.fillOpacity=ri(a);break;default:o[a.channel]=s[a.channel]=ri(a);break}return[...i?[{type:"areaY",data:n,options:s}]:[],{type:"line",data:t,options:o}]}};function GG(e){let{x0:t,x1:n,xm:r,intercept:i,slope:o,n:s,ssx:a,ssy:c,...l}=e;return[{x:t,y:i+t*o,...l},{x:n,y:i+n*o,...l}]}function XG(e,t,n,r){let{x0:i,x1:o,xm:s,intercept:a,slope:c,n:l,ssx:u,ssy:f,...h}=n,d=t*(o-i)/r,p=XL((1-e)/2,l-2)*Math.sqrt(f/(l-2));return Re(i,o-d/2,d).concat(o).map(m=>{let g=a+m*c,y=p*Math.sqrt(1/l+(m-s)**2/u);return{x:m,y1:g-y,y2:g+y,...h}})}function HL(e){let t=e.toLowerCase(),n=e.length,r="";for(let i=0;i<n;++i)r+=(e[i]!==t[i]?"-":"")+t[i];return r}function Pf(e){let t={};for(let n in e)t[HL(n)]=e[n];return t}function HG(e){let{channels:t}=e,n=new Set,r=!1,i=!1;for(let o of t){let{channel:s,field:a,as:c}=o;if(s==="orderby")r=!0;else if(a)if(a.aggregate)i=!0;else{if(n.has(c))continue;n.add(c)}}return!r&&i&&n.size&&e.channels.push({channel:"orderby",value:Array.from(n)}),e}var u3=class{constructor(t,{selection:n,channels:r={}}){this.mark=HG(t),this.selection=n;let i=Object.entries(Pf(r));this.channels=i.length?i:[["opacity",.2]],this.selection.addEventListener("value",Vf(()=>this.update()))}init(t){this.svg=t;let n=this.values=[],r=this.mark.index,i=this.nodes=t.querySelectorAll(`[data-index="${r}"] > *`),{channels:o}=this;for(let s=0;s<i.length;++s){let a=i[s];n.push(o.map(c=>a.getAttribute(c[0])))}return this.update()}async update(){let{svg:t,nodes:n,channels:r,values:i,mark:o,selection:s}=this;if(!t)return;let a=await ZG(o,s);for(let c=0;c<n.length;++c){let l=n[c],u=i[c],f=a(l.__data__);for(let h=0;h<r.length;++h){let[d,p]=r[h];l.setAttribute(d,f?u[h]:p)}}}};async function ZG(e,t){let n=t?.predicate(e);if(!n||n.length===0)return()=>!0;let r=e.filterBy?.predicate(e,!0),i={__:Ar(n)},o=e.query(r),s=o.groupby().length?o.select(i):o.$select(i),a=await e.coordinator.query(s),c=a.getChild?.("__");return a.numRows||a.length?c?l=>c.get(l):l=>a[l].__:()=>!1}function f3(e){let t=e.on,n=!0;function r(i){n=!1,i(),n=!0}return e.reset=(...i)=>{r(()=>e.clear(...i))},e.moveSilent=(...i)=>{r(()=>e.move(...i))},e.on=(...i)=>{if(i.length>1&&i[1]){let o=i[1];i[1]=(...s)=>n&&o(...s)}return t(...i)},e}function ZL(){return f3(Bv())}function KL(){return f3(Dv())}function QL(){return f3(Nv())}function Rm(e,t){return e===t||e&&t&&Math.abs(e[0]-t[0])<1e-12&&Math.abs(e[1]-t[1])<1e-12||!1}function No(e,t){let n=e.channelField(t)?.field;return n?.basis||n}function $m(e,t,n=1){return t.invert(n*Math.floor(e/n))}function Aw(){let e=this,t=e.getScreenCTM,n;e.getScreenCTM=()=>e.isConnected?n=t.call(e):n}var h3=class{constructor(t,{channel:n,selection:r,field:i,pixelSize:o=1,peers:s=!0,brush:a}){this.mark=t,this.channel=n,this.pixelSize=o||1,this.selection=r,this.peers=s,this.field=i||No(t,[n,n+"1",n+"2"]),this.style=a&&Pf(a),this.brush=n==="y"?QL():KL(),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(t){let n;t&&(n=t.map(r=>$m(r,this.scale,this.pixelSize)).sort((r,i)=>r-i)),Rm(n,this.value)||(this.value=n,this.g.call(this.brush.moveSilent,t),this.selection.update(this.clause(n)))}clause(t){let{mark:n,pixelSize:r,field:i,scale:o}=this;return{source:this,schema:{type:"interval",pixelSize:r,scales:[o]},clients:this.peers?n.plot.markSet:new Set().add(n),value:t,predicate:t?Oe(i,t):null}}init(t){let{brush:n,channel:r,style:i}=this;this.scale=t.scale(r);let o=t.scale("x").range,s=t.scale("y").range;n.extent([[ae(o),ae(s)],[jt(o),jt(s)]]);let a=Pt(t).selectAll('g[aria-label="facet"]'),c=a.size()?a:Pt(t);if(this.g=c.append("g").attr("class",`interval-${r}`).each(Aw).call(n).call(n.moveSilent,this.value?.map(this.scale.apply)),i){let l=this.g.selectAll("rect.selection");for(let u in i)l.attr(u,i[u])}t.addEventListener("pointerenter",()=>this.activate())}};var Tw=(e,t)=>e-t,d3=class{constructor(t,{selection:n,xfield:r,yfield:i,pixelSize:o=1,peers:s=!0,brush:a}){this.mark=t,this.pixelSize=o||1,this.selection=n,this.peers=s,this.xfield=r||No(t,["x","x1","x2"]),this.yfield=i||No(t,["y","y1","y2"]),this.style=a&&Pf(a),this.brush=ZL(),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(t){let{value:n,pixelSize:r,xscale:i,yscale:o}=this,s,a;if(t){let[c,l]=t;s=[c[0],l[0]].map(u=>$m(u,i,r)).sort(Tw),a=[c[1],l[1]].map(u=>$m(u,o,r)).sort(Tw)}(!Rm(s,n?.[0])||!Rm(a,n?.[1]))&&(this.value=t?[s,a]:void 0,this.g.call(this.brush.moveSilent,t),this.selection.update(this.clause(this.value)))}clause(t){let{mark:n,pixelSize:r,xfield:i,yfield:o,xscale:s,yscale:a}=this;return{source:this,schema:{type:"interval",pixelSize:r,scales:[s,a]},clients:this.peers?n.plot.markSet:new Set().add(n),value:t,predicate:t?Ar(Oe(i,t[0]),Oe(o,t[1])):null}}init(t){let{brush:n,style:r}=this,i=this.xscale=t.scale("x"),o=this.yscale=t.scale("y"),s=i.range,a=o.range;n.extent([[ae(s),ae(a)],[jt(s),jt(a)]]);let c=Pt(t).selectAll('g[aria-label="facet"]'),l=c.size()?c:Pt(t);if(this.g=l.append("g").attr("class","interval-xy").each(Aw).call(n),r){let u=this.g.selectAll("rect.selection");for(let f in r)u.attr(f,r[f])}if(this.value){let[u,f]=this.value[0].map(i.apply).sort(Tw),[h,d]=this.value[1].map(o.apply).sort(Tw);this.g.call(n.moveSilent,[[u,h],[f,d]])}t.addEventListener("pointerenter",()=>this.activate())}};var p3=class{constructor(t,{selection:n,channel:r,field:i}){this.mark=t,this.selection=n,this.clients=new Set().add(t),this.channel=r,this.field=i||No(t,[r])}clause(t){let{clients:n,field:r}=this,i=t?B_(r,Wh(t)):null;return{source:this,schema:{type:"point"},clients:n,value:t,predicate:i}}init(t){let n=this,{mark:r,channel:i,selection:o}=this,{data:s}=r,a=r.channelField(i).as,c=Pt(t).selectAll('g[aria-label="facet"]'),l=c.size()?c:Pt(t),u=t.scale(i),f=!W_(o);l.on("pointerdown pointermove",function(h){let[d,p]=Bn(h,this),m=KG(s,a,u.invert(i==="x"?d:p));o.update(f?m:n.clause(m))}),!f&&t.addEventListener("pointerenter",()=>{this.selection.activate(this.clause(0))})}};function KG(e,t,n){let r=1/0,i;return e.forEach(o=>{let s=Math.abs(o[t]-n);s<r&&(r=s,i=o[t])}),i}var JL=(e,t)=>e-t,y3=class{constructor(t,{x:n=new _c,y:r=new _c,xfield:i,yfield:o,zoom:s=!0,panx:a=!0,pany:c=!0}){this.mark=t,this.xsel=n,this.ysel=r,this.xfield=i||No(t,["x","x1","x2"]),this.yfield=o||No(t,["y","y1","y2"]),this.zoom=m3(s,[0,1/0],[1,1]),this.panx=this.xsel&&a,this.pany=this.ysel&&c;let{plot:l}=t;a&&this.xsel.addEventListener("value",u=>{l.setAttribute("xDomain",u)&&l.update()}),c&&this.ysel.addEventListener("value",u=>{l.setAttribute("yDomain",u)&&l.update()})}publish(t){if(this.panx){let n=QG(t,this.xscale);this.xsel.update(this.clause(n,this.xfield,this.xscale))}if(this.pany){let n=JG(t,this.yscale);this.ysel.update(this.clause(n,this.yfield,this.yscale))}}clause(t,n,r){return{source:this,schema:{type:"interval",scales:[r]},clients:this.mark.plot.markSet,value:t,predicate:t?Oe(n,t):null}}init(t){if(this.svg=t,this.initialized)return;this.initialized=!0;let{panx:n,pany:r,mark:{plot:{element:i}},xsel:o,ysel:s}=this;this.xscale=t.scale("x"),this.yscale=t.scale("y");let a=this.xscale.range.slice().sort(JL),c=this.yscale.range.slice().sort(JL),l=m3(n,[-1/0,1/0],a),u=m3(r,[-1/0,1/0],c),f=GS().extent([[a[0],c[0]],[a[1],c[1]]]).scaleExtent(this.zoom).translateExtent([[l[0],u[0]],[l[1],u[1]]]).on("start",()=>{this.xscale=this.svg.scale("x"),this.yscale=this.svg.scale("y")}).on("end",()=>i.__zoom=new Or(1,0,0)).on("zoom",({transform:h})=>this.publish(h));if(Pt(i).call(f),n||r){let h=!1;i.addEventListener("mouseenter",()=>{if(!h){if(h=!0,n){let{xscale:d,xfield:p}=this;o.activate(this.clause(d.domain,p,d))}if(r){let{yscale:d,yfield:p}=this;s.activate(this.clause(d.domain,p,d))}}}),i.addEventListener("mouseleave",()=>h=!1)}}};function m3(e,t,n){return e?Array.isArray(e)?e:t:n}function QG(e,t){return t.range.map(e.invertX,e).map(t.invert,t)}function JG(e,t){return t.range.map(e.invertY,e).map(t.invert,t)}var Um=class{constructor(t,{selection:n,channels:r,peers:i=!0}){this.value=null,this.mark=t,this.selection=n,this.peers=i,this.channels=r.map(o=>{let s=o==="color"?["fill","stroke"]:o==="x"?["x","x1","x2"]:o==="y"?["y","y1","y2"]:[o];for(let a=0;a<s.length;++a){let c=t.channelField(s[a]);if(c)return{field:c.field?.basis||c.field,as:c.as}}throw new Error(`Missing channel: ${o}`)})}clause(t){let{channels:n,mark:r}=this,i=null;if(t){let o=t.map(s=>{let a=s.map((c,l)=>L_(n[l].field,Wh(c)));return a.length>1?Ar(a):a[0]});i=o.length>1?Xh(o):o[0]}return{source:this,schema:{type:"point"},clients:this.peers?r.plot.markSet:new Set().add(r),value:t,predicate:i}}init(t,n,r){let{mark:i,channels:o,selection:s}=this,{data:a}=i;r=r||(l=>{let u=a[l.__data__];return o.map(f=>u[f.as])}),n=n||`[data-index="${i.index}"]`;let c=new Set(t.querySelectorAll(n));t.addEventListener("pointerdown",l=>{let u=s.single?s.value:this.value,f=l.target,h=null;if(tX(c,f)){let d=r(f);l.shiftKey&&u?.length?(h=u.filter(p=>g3(p,d)),h.length===u.length&&h.push(d)):u?.length===1&&!g3(u[0],d)?h=null:h=[d]}this.value=h,eX(u,h)&&s.update(this.clause(h))}),t.addEventListener("pointerenter",()=>{this.selection.activate(this.clause([this.channels.map(()=>0)]))})}};function tX(e,t){return e.has(t)||e.has(t.parentNode)||e.has(t.parentNode?.parentNode)}function eX(e,t){return e==null||t==null?e!=null||t!=null:e.length!==t.length||e.some((n,r)=>g3(n,t[r]))}function g3(e,t){let n=e.length;if(t.length!==n)return!0;for(let r=0;r<n;++r)if(e[r]!==t[r])return!0;return!1}var b3=class{constructor(t,n){let{as:r,...i}=n;this.channel=t,this.options={label:null,...i},this.selection=r,this.element=document.createElement("div"),this.element.setAttribute("class","legend"),this.element.value=this}setPlot(t){let{channel:n,selection:r}=this,i=nX(t,n);this.selection&&i&&(this.handler=new Um(i,{selection:r,channels:[n]}),this.selection.addEventListener("value",()=>this.update()))}init(t){let{channel:n,options:r,handler:i}=this,s=t.scale(n).type==="ordinal"?r:{marginTop:1,tickSize:2,height:28,...r};return this.legend=t.legend(n,s),i&&(i.init(this.legend,":scope > div",a=>[a.__data__]),this.update()),this.element.replaceChildren(this.legend),this.element}update(){if(!this.legend)return;let{value:t}=this.selection,n=t&&t.length?new Set(t.map(i=>i[0])):null,r=this.legend.querySelectorAll(":scope > div");for(let i of r){let o=n?n.has(i.__data__):!0;i.style.opacity=o?1:.2}}};function nX({marks:e},t){let n=t==="color"?["fill","stroke"]:t==="opacity"?["opacity","fillOpacity","strokeOpacity"]:null;if(n==null)return null;for(let r=e.length-1;r>-1;--r)if(e[r].channelField(n))return e[r];return null}var rX=new Set(["rectY-x","rectX-y","rect-x","rect-y"]);function tF(e,t={steps:25}){let n=(r,i)=>rX.has(`${r.type}-${i}`)?{[`${i}1`]:x3(r,i,e,t),[`${i}2`]:x3(r,i,e,{...t,offset:1})}:{[i]:x3(r,i,e,t)};return n[qf]=!0,n}function x3(e,t,n,r){return{column:n,label:n,get stats(){return["min","max"]},get columns(){return[n]},get basis(){return n},toString(){let{apply:i,sqlApply:o,sqlInvert:s}=bl(e,t),{min:a,max:c}=e.stats[n],l=iX(i(a),i(c),r),u=o(n),f=l.min===0?u:`(${u} - ${l.min})`,h=`${(l.max-l.min)/l.steps}::DOUBLE`,d=r.offset?`${r.offset} + `:"",p=`${l.min} + ${h} * (${d}FLOOR(${f} / ${h}))`;return`${s(p)}`}}}function iX(e,t,n){let{steps:r=25,minstep:i=0,nice:o=!0}=n;if(o!==!1){let s=t-e,a=r,c=Math.LN10,l=Math.ceil(Math.log(a)/c),u=Math.max(i,Math.pow(10,Math.round(Math.log(s)/c)-l));for(;Math.ceil(s/u)>a;)u*=10;let f=[5,2],h;for(let m=0,g=f.length;m<g;++m)h=u/f[m],h>=i&&s/h<=a&&(u=h);h=Math.log(u);let d=h>=0?0:~~(-h/c)+1,p=Math.pow(10,-d-1);h=Math.floor(e/u+p)*u,e=e<h?h-u:h,t=Math.ceil(t/u)*u,r=Math.round((t-e)/u)}return{min:e,max:t,steps:r}}export{JI as ConnectedMark,t3 as ContourMark,r3 as DenseLineMark,i3 as Density1DMark,o3 as Density2DMark,js as Fixed,s3 as GeoMark,Fi as Grid2DMark,e3 as HeatmapMark,a3 as HexbinMark,u3 as Highlight,h3 as Interval1D,d3 as Interval2D,b3 as Legend,or as Mark,p3 as Nearest,y3 as PanZoom,WI as Plot,$f as RasterMark,c3 as RasterTileMark,l3 as RegressionMark,Um as Toggle,qf as Transform,yn as Transient,tF as bin};
|