@uwdata/vgplot 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/vgplot.js +20838 -9881
- package/dist/vgplot.min.js +26 -17
- package/package.json +5 -5
package/dist/vgplot.min.js
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
var A$=Object.create;var bw=Object.defineProperty;var M$=Object.getOwnPropertyDescriptor;var N$=Object.getOwnPropertyNames;var R$=Object.getPrototypeOf,O$=Object.prototype.hasOwnProperty;var _R=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vr=(e,t)=>{for(var n in t)bw(e,n,{get:t[n],enumerable:!0})},D$=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of N$(t))!O$.call(e,i)&&i!==n&&bw(e,i,{get:()=>t[i],enumerable:!(r=M$(t,i))||r.enumerable});return e};var k$=(e,t,n)=>(n=e!=null?A$(R$(e)):{},D$(t||!e||!e.__esModule?bw(n,"default",{value:e,enumerable:!0}):n,e));var o9=_R((yPt,i9)=>{"use strict";function KJ(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 JJ(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 ttt(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 ett(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 ntt(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 cy(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)}i9.exports={ge:function(e,t,n,r,i){return cy(e,t,n,r,i,KJ)},gt:function(e,t,n,r,i){return cy(e,t,n,r,i,JJ)},lt:function(e,t,n,r,i){return cy(e,t,n,r,i,ttt)},le:function(e,t,n,r,i){return cy(e,t,n,r,i,ett)},eq:function(e,t,n,r,i){return cy(e,t,n,r,i,ntt)}}});var h9=_R((gPt,d9)=>{"use strict";var nw=o9(),sd=0,Ul=1,ew=2;d9.exports=itt;function NA(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 ly=NA.prototype;function AA(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 c9(e,t){var n=ad(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 s9(e,t){var n=e.intervals([]);n.push(t),c9(e,n)}function a9(e,t){var n=e.intervals([]),r=n.indexOf(t);return r<0?sd:(n.splice(r,1),c9(e,n),Ul)}ly.intervals=function(e){return e.push.apply(e,this.leftPoints),this.left&&this.left.intervals(e),this.right&&this.right.intervals(e),e};ly.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)?s9(this,e):this.left.insert(e):this.left=ad([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?s9(this,e):this.right.insert(e):this.right=ad([e]);else{var n=nw.ge(this.leftPoints,e,RA),r=nw.ge(this.rightPoints,e,OA);this.leftPoints.splice(n,0,e),this.rightPoints.splice(r,0,e)}};ly.remove=function(e){var t=this.count-this.leftPoints;if(e[1]<this.mid){if(!this.left)return sd;var n=this.right?this.right.count:0;if(4*n>3*(t-1))return a9(this,e);var r=this.left.remove(e);return r===ew?(this.left=null,this.count-=1,Ul):(r===Ul&&(this.count-=1),r)}else if(e[0]>this.mid){if(!this.right)return sd;var i=this.left?this.left.count:0;if(4*i>3*(t-1))return a9(this,e);var r=this.right.remove(e);return r===ew?(this.right=null,this.count-=1,Ul):(r===Ul&&(this.count-=1),r)}else{if(this.count===1)return this.leftPoints[0]===e?ew:sd;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}AA(this,s),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?AA(this,this.left):AA(this,this.right);return Ul}for(var a=nw.ge(this.leftPoints,e,RA);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=nw.ge(this.rightPoints,e,OA);r<this.rightPoints.length&&this.rightPoints[r][1]===e[1];++r)if(this.rightPoints[r]===e)return this.rightPoints.splice(r,1),Ul}return sd}};function l9(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 u9(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 f9(e,t){for(var n=0;n<e.length;++n){var r=t(e[n]);if(r)return r}}ly.queryPoint=function(e,t){if(e<this.mid){if(this.left){var n=this.left.queryPoint(e,t);if(n)return n}return l9(this.leftPoints,e,t)}else if(e>this.mid){if(this.right){var n=this.right.queryPoint(e,t);if(n)return n}return u9(this.rightPoints,e,t)}else return f9(this.leftPoints,t)};ly.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?l9(this.leftPoints,t,n):e>this.mid?u9(this.rightPoints,e,n):f9(this.leftPoints,n)};function rtt(e,t){return e-t}function RA(e,t){var n=e[0]-t[0];return n||e[1]-t[1]}function OA(e,t){var n=e[1]-t[1];return n||e[0]-t[0]}function ad(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(rtt);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(RA),l.sort(OA),new NA(r,ad(i),ad(o),c,l)}function MA(e){this.root=e}var cd=MA.prototype;cd.insert=function(e){this.root?this.root.insert(e):this.root=new NA(e[0],null,null,[e],[e])};cd.remove=function(e){if(this.root){var t=this.root.remove(e);return t===ew&&(this.root=null),t!==sd}return!1};cd.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)};cd.queryInterval=function(e,t,n){if(e<=t&&this.root)return this.root.queryInterval(e,t,n)};Object.defineProperty(cd,"count",{get:function(){return this.root?this.root.count:0}});Object.defineProperty(cd,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function itt(e){return!e||e.length===0?new MA(null):new MA(ad(e))}});var wR={};function _d(e,t=!1){let n,r,i=wR;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=wR,a(u)}),i=l}return t?c:a}var ur=class{constructor(t){this._filterBy=t,this._requestUpdate=_d(()=>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 SR(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 Z(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 vR(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 Ct(e){return this instanceof Ct?(this.v=e,this):new Ct(e)}function Sr(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(d){r[d]&&(i[d]=function(h){return new Promise(function(p,m){o.push([d,h,p,m])>1||a(d,h)})})}function a(d,h){try{c(r[d](h))}catch(p){f(o[0][3],p)}}function c(d){d.value instanceof Ct?Promise.resolve(d.value.v).then(l,u):f(o[0][2],d)}function l(d){a("next",d)}function u(d){a("throw",d)}function f(d,h){d(h),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:Ct(e[i](s)),done:!1}:o?o(s):s}:o}}function bi(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 vR=="function"?vR(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 Iw={};vr(Iw,{compareArrayLike:()=>Sw,joinUint8Arrays:()=>Tr,memcpy:()=>Yl,rebaseValueOffsets:()=>Uy,toArrayBufferView:()=>Pt,toArrayBufferViewAsyncIterator:()=>_i,toArrayBufferViewIterator:()=>Xi,toBigInt64Array:()=>U$,toBigUint64Array:()=>j$,toFloat32Array:()=>V$,toFloat32ArrayAsyncIterator:()=>sU,toFloat32ArrayIterator:()=>K$,toFloat64Array:()=>Y$,toFloat64ArrayAsyncIterator:()=>aU,toFloat64ArrayIterator:()=>J$,toInt16Array:()=>$$,toInt16ArrayAsyncIterator:()=>nU,toInt16ArrayIterator:()=>X$,toInt32Array:()=>xc,toInt32ArrayAsyncIterator:()=>rU,toInt32ArrayIterator:()=>H$,toInt8Array:()=>P$,toInt8ArrayAsyncIterator:()=>eU,toInt8ArrayIterator:()=>W$,toUint16Array:()=>z$,toUint16ArrayAsyncIterator:()=>iU,toUint16ArrayIterator:()=>Z$,toUint32Array:()=>q$,toUint32ArrayAsyncIterator:()=>oU,toUint32ArrayIterator:()=>Q$,toUint8Array:()=>Ot,toUint8ArrayAsyncIterator:()=>vw,toUint8ArrayIterator:()=>ww,toUint8ClampedArray:()=>G$,toUint8ClampedArrayAsyncIterator:()=>cU,toUint8ClampedArrayIterator:()=>tU});var F$=new TextDecoder("utf-8"),wd=e=>F$.decode(e),L$=new TextEncoder,oa=e=>L$.encode(e);var C$=e=>typeof e=="number",IR=e=>typeof e=="boolean",tn=e=>typeof e=="function",Vn=e=>e!=null&&Object(e)===e,Ir=e=>Vn(e)&&tn(e.then);var xi=e=>Vn(e)&&tn(e[Symbol.iterator]),Gr=e=>Vn(e)&&tn(e[Symbol.asyncIterator]),Fy=e=>Vn(e)&&Vn(e.schema);var Ly=e=>Vn(e)&&"done"in e&&"value"in e;var Cy=e=>Vn(e)&&tn(e.stat)&&C$(e.fd);var By=e=>Vn(e)&&vd(e.body),Py=e=>"_getDOMStream"in e&&"_getNodeStream"in e,TR=e=>Vn(e)&&tn(e.abort)&&tn(e.getWriter)&&!Py(e),vd=e=>Vn(e)&&tn(e.cancel)&&tn(e.getReader)&&!Py(e),ER=e=>Vn(e)&&tn(e.end)&&tn(e.write)&&IR(e.writable)&&!Py(e),$y=e=>Vn(e)&&tn(e.read)&&tn(e.pipe)&&IR(e.readable)&&!Py(e),AR=e=>Vn(e)&&tn(e.clear)&&tn(e.bytes)&&tn(e.position)&&tn(e.setPosition)&&tn(e.capacity)&&tn(e.getBufferIdentifier)&&tn(e.createLong);var _w=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function B$(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 Yl(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 Tr(e,t){let n=B$(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?Yl(s,o,a):s=o;break}Yl(s||(s=new Uint8Array(l)),o,a),a+=o.length}return[s||new Uint8Array(0),n.slice(c),r-(s?s.byteLength:0)]}function Pt(e,t){let n=Ly(t)?t.value:t;return n instanceof e?e===Uint8Array?new e(n.buffer,n.byteOffset,n.byteLength):n:n?(typeof n=="string"&&(n=oa(n)),n instanceof ArrayBuffer?new e(n):n instanceof _w?new e(n):AR(n)?Pt(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 P$=e=>Pt(Int8Array,e),$$=e=>Pt(Int16Array,e),xc=e=>Pt(Int32Array,e),U$=e=>Pt(BigInt64Array,e),Ot=e=>Pt(Uint8Array,e),z$=e=>Pt(Uint16Array,e),q$=e=>Pt(Uint32Array,e),j$=e=>Pt(BigUint64Array,e),V$=e=>Pt(Float32Array,e),Y$=e=>Pt(Float64Array,e),G$=e=>Pt(Uint8ClampedArray,e),xw=e=>(e.next(),e);function*Xi(e,t){let n=function*(i){yield i},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof _w?n(t):xi(t)?t:n(t);return yield*xw(function*(i){let o=null;do o=i.next(yield Pt(e,o));while(!o.done)}(r[Symbol.iterator]())),new e}var W$=e=>Xi(Int8Array,e),X$=e=>Xi(Int16Array,e),H$=e=>Xi(Int32Array,e),ww=e=>Xi(Uint8Array,e),Z$=e=>Xi(Uint16Array,e),Q$=e=>Xi(Uint32Array,e),K$=e=>Xi(Float32Array,e),J$=e=>Xi(Float64Array,e),tU=e=>Xi(Uint8ClampedArray,e);function _i(e,t){return Sr(this,arguments,function*(){if(Ir(t))return yield Ct(yield Ct(yield*Vl(bi(_i(e,yield Ct(t))))));let r=function(s){return Sr(this,arguments,function*(){yield yield Ct(yield Ct(s))})},i=function(s){return Sr(this,arguments,function*(){yield Ct(yield*Vl(bi(xw(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 _w?r(t):xi(t)?i(t):Gr(t)?t:r(t);return yield Ct(yield*Vl(bi(xw(function(s){return Sr(this,arguments,function*(){let a=null;do a=yield Ct(s.next(yield yield Ct(Pt(e,a))));while(!a.done)})}(o[Symbol.asyncIterator]()))))),yield Ct(new e)})}var eU=e=>_i(Int8Array,e),nU=e=>_i(Int16Array,e),rU=e=>_i(Int32Array,e),vw=e=>_i(Uint8Array,e),iU=e=>_i(Uint16Array,e),oU=e=>_i(Uint32Array,e),sU=e=>_i(Float32Array,e),aU=e=>_i(Float64Array,e),cU=e=>_i(Uint8ClampedArray,e);function Uy(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 Sw(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 bn={fromIterable(e){return zy(lU(e))},fromAsyncIterable(e){return zy(uU(e))},fromDOMStream(e){return zy(fU(e))},fromNodeStream(e){return zy(dU(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')}},zy=e=>(e.next(),e);function*lU(e){let t,n=!1,r=[],i,o,s,a=0;function c(){return o==="peek"?Tr(r,s)[0]:([i,r,a]=Tr(r,s),i)}({cmd:o,size:s}=yield null);let l=ww(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 uU(e){return Sr(this,arguments,function*(){let n,r=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Tr(i,a)[0]:([o,i,c]=Tr(i,a),o)}({cmd:s,size:a}=yield yield Ct(null));let u=vw(e)[Symbol.asyncIterator]();try{do if({done:n,value:o}=Number.isNaN(a-c)?yield Ct(u.next()):yield Ct(u.next(a-c)),!n&&o.byteLength>0&&(i.push(o),c+=o.byteLength),n||a<=c)do({cmd:s,size:a}=yield yield Ct(l()));while(a<c);while(!n)}catch(f){(r=!0)&&typeof u.throw=="function"&&(yield Ct(u.throw(f)))}finally{r===!1&&typeof u.return=="function"&&(yield Ct(u.return(new Uint8Array(0))))}return yield Ct(null)})}function fU(e){return Sr(this,arguments,function*(){let n=!1,r=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Tr(i,a)[0]:([o,i,c]=Tr(i,a),o)}({cmd:s,size:a}=yield yield Ct(null));let u=new Ew(e);try{do if({done:n,value:o}=Number.isNaN(a-c)?yield Ct(u.read()):yield Ct(u.read(a-c)),!n&&o.byteLength>0&&(i.push(Ot(o)),c+=o.byteLength),n||a<=c)do({cmd:s,size:a}=yield yield Ct(l()));while(a<c);while(!n)}catch(f){(r=!0)&&(yield Ct(u.cancel(f)))}finally{r===!1?yield Ct(u.cancel()):e.locked&&u.releaseLock()}return yield Ct(null)})}var Ew=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 Z(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 Z(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=Ot(n)),n})}},Tw=(e,t)=>{let n=i=>r([t,i]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function dU(e){return Sr(this,arguments,function*(){let n=[],r="error",i=!1,o=null,s,a,c=0,l=[],u;function f(){return s==="peek"?Tr(l,a)[0]:([u,l,c]=Tr(l,a),u)}if({cmd:s,size:a}=yield yield Ct(null),e.isTTY)return yield yield Ct(new Uint8Array(0)),yield Ct(null);try{n[0]=Tw(e,"end"),n[1]=Tw(e,"error");do{if(n[2]=Tw(e,"readable"),[r,o]=yield Ct(Promise.race(n.map(h=>h[2]))),r==="error")break;if((i=r==="end")||(Number.isFinite(a-c)?(u=Ot(e.read(a-c)),u.byteLength<a-c&&(u=Ot(e.read()))):u=Ot(e.read()),u.byteLength>0&&(l.push(u),c+=u.byteLength)),i||a<=c)do({cmd:s,size:a}=yield yield Ct(f()));while(a<c)}while(!i)}finally{yield Ct(d(n,r==="error"?o:null))}return yield Ct(null);function d(h,p){return u=l=null,new Promise((m,g)=>{for(let[y,b]of h)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 xe;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(xe||(xe={}));var xn;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(xn||(xn={}));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 Yn;(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"})(Yn||(Yn={}));var Qt;(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"})(Qt||(Qt={}));var D;(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"})(D||(D={}));var Wr;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(Wr||(Wr={}));var Yw={};vr(Yw,{clampIndex:()=>rz,clampRange:()=>Ed,createElementComparator:()=>ca});var Aw={};vr(Aw,{valueToString:()=>wi});function wi(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=>wi(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,n)=>typeof n=="bigint"?`${n}`:n)}var Nw={};vr(Nw,{BN:()=>Id,bigNumToBigInt:()=>RR,bigNumToString:()=>Xl,isArrowBigNumSymbol:()=>MR});var MR=Symbol.for("isArrowBigNum");function vi(e,...t){return t.length===0?Object.setPrototypeOf(Pt(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}vi.prototype[MR]=!0;vi.prototype.toJSON=function(){return`"${Xl(this)}"`};vi.prototype.valueOf=function(){return NR(this)};vi.prototype.toString=function(){return Xl(this)};vi.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return NR(this);case"string":return Xl(this);case"default":return RR(this)}return Xl(this)};function Gl(...e){return vi.apply(this,e)}function Wl(...e){return vi.apply(this,e)}function Sd(...e){return vi.apply(this,e)}Object.setPrototypeOf(Gl.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Wl.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Sd.prototype,Object.create(Uint32Array.prototype));Object.assign(Gl.prototype,vi.prototype,{constructor:Gl,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Wl.prototype,vi.prototype,{constructor:Wl,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Sd.prototype,vi.prototype,{constructor:Sd,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});function NR(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 Xl=e=>{if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return Mw(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return Mw(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`-${Mw(t)}`},RR=e=>e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:Xl(e);function Mw(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 Id=class e{static new(t,n){switch(n){case!0:return new Gl(t);case!1:return new Wl(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Gl(t)}return t.byteLength===16?new Sd(t):new Wl(t)}static signed(t){return new Gl(t)}static unsigned(t){return new Wl(t)}static decimal(t){return new Sd(t)}constructor(t,n){return e.new(t,n)}};function fr(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 OR,DR,kR,FR,LR,CR,BR,PR,$R,UR,zR,qR,jR,VR,YR,GR,WR,XR,HR,ZR,at=class e{static isNull(t){return t?.typeId===D.Null}static isInt(t){return t?.typeId===D.Int}static isFloat(t){return t?.typeId===D.Float}static isBinary(t){return t?.typeId===D.Binary}static isUtf8(t){return t?.typeId===D.Utf8}static isBool(t){return t?.typeId===D.Bool}static isDecimal(t){return t?.typeId===D.Decimal}static isDate(t){return t?.typeId===D.Date}static isTime(t){return t?.typeId===D.Time}static isTimestamp(t){return t?.typeId===D.Timestamp}static isInterval(t){return t?.typeId===D.Interval}static isDuration(t){return t?.typeId===D.Duration}static isList(t){return t?.typeId===D.List}static isStruct(t){return t?.typeId===D.Struct}static isUnion(t){return t?.typeId===D.Union}static isFixedSizeBinary(t){return t?.typeId===D.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===D.FixedSizeList}static isMap(t){return t?.typeId===D.Map}static isDictionary(t){return t?.typeId===D.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 D.NONE}};OR=Symbol.toStringTag;at[OR]=(e=>(e.children=null,e.ArrayType=Array,e[Symbol.toStringTag]="DataType"))(at.prototype);var Gn=class extends at{toString(){return"Null"}get typeId(){return D.Null}};DR=Symbol.toStringTag;Gn[DR]=(e=>e[Symbol.toStringTag]="Null")(Gn.prototype);var Pe=class extends at{constructor(t,n){super(),this.isSigned=t,this.bitWidth=n}get typeId(){return D.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}`}};kR=Symbol.toStringTag;Pe[kR]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(Pe.prototype);var qy=class extends Pe{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},jy=class extends Pe{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Hi=class extends Pe{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Vy=class extends Pe{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Yy=class extends Pe{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Gy=class extends Pe{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Wy=class extends Pe{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Xy=class extends Pe{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(qy.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(jy.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Hi.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Vy.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Yy.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Gy.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Wy.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Xy.prototype,"ArrayType",{value:BigUint64Array});var dr=class extends at{constructor(t){super(),this.precision=t}get typeId(){return D.Float}get ArrayType(){switch(this.precision){case xe.HALF:return Uint16Array;case xe.SINGLE:return Float32Array;case xe.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};FR=Symbol.toStringTag;dr[FR]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(dr.prototype);var Hy=class extends dr{constructor(){super(xe.HALF)}},Zy=class extends dr{constructor(){super(xe.SINGLE)}},Qy=class extends dr{constructor(){super(xe.DOUBLE)}};Object.defineProperty(Hy.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Zy.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Qy.prototype,"ArrayType",{value:Float64Array});var Yo=class extends at{constructor(){super()}get typeId(){return D.Binary}toString(){return"Binary"}};LR=Symbol.toStringTag;Yo[LR]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(Yo.prototype);var Go=class extends at{constructor(){super()}get typeId(){return D.Utf8}toString(){return"Utf8"}};CR=Symbol.toStringTag;Go[CR]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(Go.prototype);var Wo=class extends at{constructor(){super()}get typeId(){return D.Bool}toString(){return"Bool"}};BR=Symbol.toStringTag;Wo[BR]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(Wo.prototype);var Xo=class extends at{constructor(t,n,r=128){super(),this.scale=t,this.precision=n,this.bitWidth=r}get typeId(){return D.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};PR=Symbol.toStringTag;Xo[PR]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(Xo.prototype);var Ho=class extends at{constructor(t){super(),this.unit=t}get typeId(){return D.Date}toString(){return`Date${(this.unit+1)*32}<${xn[this.unit]}>`}};$R=Symbol.toStringTag;Ho[$R]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Date"))(Ho.prototype);var Si=class extends at{constructor(t,n){super(),this.unit=t,this.bitWidth=n}get typeId(){return D.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`)}};UR=Symbol.toStringTag;Si[UR]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(Si.prototype);var Zo=class extends at{constructor(t,n){super(),this.unit=t,this.timezone=n}get typeId(){return D.Timestamp}toString(){return`Timestamp<${pt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};zR=Symbol.toStringTag;Zo[zR]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Timestamp"))(Zo.prototype);var Qo=class extends at{constructor(t){super(),this.unit=t}get typeId(){return D.Interval}toString(){return`Interval<${Yn[this.unit]}>`}};qR=Symbol.toStringTag;Qo[qR]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(Qo.prototype);var Ko=class extends at{constructor(t){super(),this.unit=t}get typeId(){return D.Duration}toString(){return`Duration<${pt[this.unit]}>`}};jR=Symbol.toStringTag;Ko[jR]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(Ko.prototype);var Ii=class extends at{constructor(t){super(),this.children=[t]}get typeId(){return D.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}};VR=Symbol.toStringTag;Ii[VR]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(Ii.prototype);var ye=class extends at{constructor(t){super(),this.children=t}get typeId(){return D.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};YR=Symbol.toStringTag;ye[YR]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(ye.prototype);var Ti=class extends at{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 D.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};GR=Symbol.toStringTag;Ti[GR]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(Ti.prototype);var Jo=class extends at{constructor(t){super(),this.byteWidth=t}get typeId(){return D.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};WR=Symbol.toStringTag;Jo[WR]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(Jo.prototype);var Ei=class extends at{constructor(t,n){super(),this.listSize=t,this.children=[n]}get typeId(){return D.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}>`}};XR=Symbol.toStringTag;Ei[XR]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(Ei.prototype);var Ai=class extends at{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 D.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(", ")}}>`}};HR=Symbol.toStringTag;Ai[HR]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(Ai.prototype);var hU=(e=>()=>++e)(-1),Er=class extends at{constructor(t,n,r,i){super(),this.indices=n,this.dictionary=t,this.isOrdered=i||!1,this.id=r==null?hU():fr(r)}get typeId(){return D.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}>`}};ZR=Symbol.toStringTag;Er[ZR]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(Er.prototype);function Ar(e){let t=e;switch(e.typeId){case D.Decimal:return e.bitWidth/32;case D.Timestamp:return 2;case D.Date:return 1+t.unit;case D.Interval:return 1+t.unit;case D.FixedSizeList:return t.listSize;case D.FixedSizeBinary:return t.byteWidth;default:return 1}}var ut=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 pU(this,t,n)}getVisitFnByTypeId(t,n=!0){return Hl(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 pU(e,t,n=!0){return typeof t=="number"?Hl(e,t,n):typeof t=="string"&&t in D?Hl(e,D[t],n):t&&t instanceof at?Hl(e,QR(t),n):t?.type&&t.type instanceof at?Hl(e,QR(t.type),n):Hl(e,D.NONE,n)}function Hl(e,t,n=!0){let r=null;switch(t){case D.Null:r=e.visitNull;break;case D.Bool:r=e.visitBool;break;case D.Int:r=e.visitInt;break;case D.Int8:r=e.visitInt8||e.visitInt;break;case D.Int16:r=e.visitInt16||e.visitInt;break;case D.Int32:r=e.visitInt32||e.visitInt;break;case D.Int64:r=e.visitInt64||e.visitInt;break;case D.Uint8:r=e.visitUint8||e.visitInt;break;case D.Uint16:r=e.visitUint16||e.visitInt;break;case D.Uint32:r=e.visitUint32||e.visitInt;break;case D.Uint64:r=e.visitUint64||e.visitInt;break;case D.Float:r=e.visitFloat;break;case D.Float16:r=e.visitFloat16||e.visitFloat;break;case D.Float32:r=e.visitFloat32||e.visitFloat;break;case D.Float64:r=e.visitFloat64||e.visitFloat;break;case D.Utf8:r=e.visitUtf8;break;case D.Binary:r=e.visitBinary;break;case D.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case D.Date:r=e.visitDate;break;case D.DateDay:r=e.visitDateDay||e.visitDate;break;case D.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case D.Timestamp:r=e.visitTimestamp;break;case D.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case D.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case D.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case D.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case D.Time:r=e.visitTime;break;case D.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case D.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case D.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case D.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case D.Decimal:r=e.visitDecimal;break;case D.List:r=e.visitList;break;case D.Struct:r=e.visitStruct;break;case D.Union:r=e.visitUnion;break;case D.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case D.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case D.Dictionary:r=e.visitDictionary;break;case D.Interval:r=e.visitInterval;break;case D.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case D.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case D.Duration:r=e.visitDuration;break;case D.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case D.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case D.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case D.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case D.FixedSizeList:r=e.visitFixedSizeList;break;case D.Map:r=e.visitMap;break}if(typeof r=="function")return r;if(!n)return()=>null;throw new Error(`Unrecognized type '${D[t]}'`)}function QR(e){switch(e.typeId){case D.Null:return D.Null;case D.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?D.Int8:D.Uint8;case 16:return n?D.Int16:D.Uint16;case 32:return n?D.Int32:D.Uint32;case 64:return n?D.Int64:D.Uint64}return D.Int}case D.Float:switch(e.precision){case xe.HALF:return D.Float16;case xe.SINGLE:return D.Float32;case xe.DOUBLE:return D.Float64}return D.Float;case D.Binary:return D.Binary;case D.Utf8:return D.Utf8;case D.Bool:return D.Bool;case D.Decimal:return D.Decimal;case D.Time:switch(e.unit){case pt.SECOND:return D.TimeSecond;case pt.MILLISECOND:return D.TimeMillisecond;case pt.MICROSECOND:return D.TimeMicrosecond;case pt.NANOSECOND:return D.TimeNanosecond}return D.Time;case D.Timestamp:switch(e.unit){case pt.SECOND:return D.TimestampSecond;case pt.MILLISECOND:return D.TimestampMillisecond;case pt.MICROSECOND:return D.TimestampMicrosecond;case pt.NANOSECOND:return D.TimestampNanosecond}return D.Timestamp;case D.Date:switch(e.unit){case xn.DAY:return D.DateDay;case xn.MILLISECOND:return D.DateMillisecond}return D.Date;case D.Interval:switch(e.unit){case Yn.DAY_TIME:return D.IntervalDayTime;case Yn.YEAR_MONTH:return D.IntervalYearMonth}return D.Interval;case D.Duration:switch(e.unit){case pt.SECOND:return D.DurationSecond;case pt.MILLISECOND:return D.DurationMillisecond;case pt.MICROSECOND:return D.DurationMicrosecond;case pt.NANOSECOND:return D.DurationNanosecond}return D.Duration;case D.Map:return D.Map;case D.List:return D.List;case D.Struct:return D.Struct;case D.Union:switch(e.mode){case me.Dense:return D.DenseUnion;case me.Sparse:return D.SparseUnion}return D.Union;case D.FixedSizeBinary:return D.FixedSizeBinary;case D.FixedSizeList:return D.FixedSizeList;case D.Dictionary:return D.Dictionary}throw new Error(`Unrecognized type '${D[e.typeId]}'`)}ut.prototype.visitInt8=null;ut.prototype.visitInt16=null;ut.prototype.visitInt32=null;ut.prototype.visitInt64=null;ut.prototype.visitUint8=null;ut.prototype.visitUint16=null;ut.prototype.visitUint32=null;ut.prototype.visitUint64=null;ut.prototype.visitFloat16=null;ut.prototype.visitFloat32=null;ut.prototype.visitFloat64=null;ut.prototype.visitDateDay=null;ut.prototype.visitDateMillisecond=null;ut.prototype.visitTimestampSecond=null;ut.prototype.visitTimestampMillisecond=null;ut.prototype.visitTimestampMicrosecond=null;ut.prototype.visitTimestampNanosecond=null;ut.prototype.visitTimeSecond=null;ut.prototype.visitTimeMillisecond=null;ut.prototype.visitTimeMicrosecond=null;ut.prototype.visitTimeNanosecond=null;ut.prototype.visitDenseUnion=null;ut.prototype.visitSparseUnion=null;ut.prototype.visitIntervalDayTime=null;ut.prototype.visitIntervalYearMonth=null;ut.prototype.visitDuration=null;ut.prototype.visitDurationSecond=null;ut.prototype.visitDurationMillisecond=null;ut.prototype.visitDurationMicrosecond=null;ut.prototype.visitDurationNanosecond=null;var Rw={};vr(Rw,{float64ToUint16:()=>Td,uint16ToFloat64:()=>Ky});var KR=new Float64Array(1),Zl=new Uint32Array(KR.buffer);function Ky(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 Td(e){if(e!==e)return 32256;KR[0]=e;let t=(Zl[1]&2147483648)>>16&65535,n=Zl[1]&2146435072,r=0;return n>=1089470464?Zl[0]>0?n=31744:(n=(n&2080374784)>>16,r=(Zl[1]&1048575)>>10):n<=1056964608?(r=1048576+(Zl[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(Zl[1]&1048575)+512>>10),t|n|r&65535}var vt=class extends ut{};function At(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}var mU=(e,t,n)=>{e[t]=Math.trunc(n/864e5)},Ow=(e,t,n)=>{e[t]=Math.trunc(n%4294967296),e[t+1]=Math.trunc(n/4294967296)},yU=(e,t,n)=>{e[t]=Math.trunc(n*1e3%4294967296),e[t+1]=Math.trunc(n*1e3/4294967296)},gU=(e,t,n)=>{e[t]=Math.trunc(n*1e6%4294967296),e[t+1]=Math.trunc(n*1e6/4294967296)},JR=(e,t,n,r)=>{if(n+1<t.length){let{[n]:i,[n+1]:o}=t;e.set(r.subarray(0,o-i),i)}},bU=({offset:e,values:t},n,r)=>{let i=e+n;r?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},ts=({values:e},t,n)=>{e[t]=n},Dw=({values:e},t,n)=>{e[t]=n},tO=({values:e},t,n)=>{e[t]=Td(n)},xU=(e,t,n)=>{switch(e.type.precision){case xe.HALF:return tO(e,t,n);case xe.SINGLE:case xe.DOUBLE:return Dw(e,t,n)}},Jy=({values:e},t,n)=>{mU(e,t,n.valueOf())},tg=({values:e},t,n)=>{Ow(e,t*2,n.valueOf())},kw=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},_U=({values:e,valueOffsets:t},n,r)=>JR(e,t,n,r),wU=({values:e,valueOffsets:t},n,r)=>{JR(e,t,n,oa(r))},Fw=(e,t,n)=>{e.type.unit===xn.DAY?Jy(e,t,n):tg(e,t,n)},eg=({values:e},t,n)=>Ow(e,t*2,n/1e3),ng=({values:e},t,n)=>Ow(e,t*2,n),rg=({values:e},t,n)=>yU(e,t*2,n),ig=({values:e},t,n)=>gU(e,t*2,n),Lw=(e,t,n)=>{switch(e.type.unit){case pt.SECOND:return eg(e,t,n);case pt.MILLISECOND:return ng(e,t,n);case pt.MICROSECOND:return rg(e,t,n);case pt.NANOSECOND:return ig(e,t,n)}},og=({values:e},t,n)=>{e[t]=n},sg=({values:e},t,n)=>{e[t]=n},ag=({values:e},t,n)=>{e[t]=n},cg=({values:e},t,n)=>{e[t]=n},Cw=(e,t,n)=>{switch(e.type.unit){case pt.SECOND:return og(e,t,n);case pt.MILLISECOND:return sg(e,t,n);case pt.MICROSECOND:return ag(e,t,n);case pt.NANOSECOND:return cg(e,t,n)}},Bw=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},vU=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,o=_n.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))},SU=(e,t,n)=>{let r=e.children[0],{valueOffsets:i}=e,o=_n.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},IU=(e,t)=>(n,r,i,o)=>r&&n(r,e,t[o]),TU=(e,t)=>(n,r,i,o)=>r&&n(r,e,t.get(o)),EU=(e,t)=>(n,r,i,o)=>r&&n(r,e,t.get(i.name)),AU=(e,t)=>(n,r,i,o)=>r&&n(r,e,t[i.name]),MU=(e,t,n)=>{let r=e.type.children.map(o=>_n.getVisitFn(o.type)),i=n instanceof Map?EU(t,n):n instanceof Vt?TU(t,n):Array.isArray(n)?IU(t,n):AU(t,n);e.type.children.forEach((o,s)=>i(r[s],e.children[s],o,s))},NU=(e,t,n)=>{e.type.mode===me.Dense?eO(e,t,n):nO(e,t,n)},eO=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];_n.visit(i,e.valueOffsets[t],n)},nO=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];_n.visit(i,t,n)},RU=(e,t,n)=>{var r;(r=e.dictionary)===null||r===void 0||r.set(e.values[t],n)},Pw=(e,t,n)=>{e.type.unit===Yn.DAY_TIME?lg(e,t,n):ug(e,t,n)},lg=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},ug=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},fg=({values:e},t,n)=>{e[t]=n},dg=({values:e},t,n)=>{e[t]=n},hg=({values:e},t,n)=>{e[t]=n},pg=({values:e},t,n)=>{e[t]=n},$w=(e,t,n)=>{switch(e.type.unit){case pt.SECOND:return fg(e,t,n);case pt.MILLISECOND:return dg(e,t,n);case pt.MICROSECOND:return hg(e,t,n);case pt.NANOSECOND:return pg(e,t,n)}},OU=(e,t,n)=>{let{stride:r}=e,i=e.children[0],o=_n.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))};vt.prototype.visitBool=At(bU);vt.prototype.visitInt=At(ts);vt.prototype.visitInt8=At(ts);vt.prototype.visitInt16=At(ts);vt.prototype.visitInt32=At(ts);vt.prototype.visitInt64=At(ts);vt.prototype.visitUint8=At(ts);vt.prototype.visitUint16=At(ts);vt.prototype.visitUint32=At(ts);vt.prototype.visitUint64=At(ts);vt.prototype.visitFloat=At(xU);vt.prototype.visitFloat16=At(tO);vt.prototype.visitFloat32=At(Dw);vt.prototype.visitFloat64=At(Dw);vt.prototype.visitUtf8=At(wU);vt.prototype.visitBinary=At(_U);vt.prototype.visitFixedSizeBinary=At(kw);vt.prototype.visitDate=At(Fw);vt.prototype.visitDateDay=At(Jy);vt.prototype.visitDateMillisecond=At(tg);vt.prototype.visitTimestamp=At(Lw);vt.prototype.visitTimestampSecond=At(eg);vt.prototype.visitTimestampMillisecond=At(ng);vt.prototype.visitTimestampMicrosecond=At(rg);vt.prototype.visitTimestampNanosecond=At(ig);vt.prototype.visitTime=At(Cw);vt.prototype.visitTimeSecond=At(og);vt.prototype.visitTimeMillisecond=At(sg);vt.prototype.visitTimeMicrosecond=At(ag);vt.prototype.visitTimeNanosecond=At(cg);vt.prototype.visitDecimal=At(Bw);vt.prototype.visitList=At(vU);vt.prototype.visitStruct=At(MU);vt.prototype.visitUnion=At(NU);vt.prototype.visitDenseUnion=At(eO);vt.prototype.visitSparseUnion=At(nO);vt.prototype.visitDictionary=At(RU);vt.prototype.visitInterval=At(Pw);vt.prototype.visitIntervalDayTime=At(lg);vt.prototype.visitIntervalYearMonth=At(ug);vt.prototype.visitDuration=At($w);vt.prototype.visitDurationSecond=At(fg);vt.prototype.visitDurationMillisecond=At(dg);vt.prototype.visitDurationMicrosecond=At(hg);vt.prototype.visitDurationNanosecond=At(pg);vt.prototype.visitFixedSizeList=At(OU);vt.prototype.visitMap=At(SU);var _n=new vt;var Mi=Symbol.for("parent"),Ql=Symbol.for("rowIndex"),sa=class{constructor(t,n){return this[Mi]=t,this[Ql]=n,new Proxy(this,new zw)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Ql],n=this[Mi],r=n.type.children,i={};for(let o=-1,s=r.length;++o<s;)i[r[o].name]=je.visit(n.children[o],t);return i}toString(){return`{${[...this].map(([t,n])=>`${wi(t)}: ${wi(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Uw(this[Mi],this[Ql])}},Uw=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,je.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(sa.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Mi]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ql]:{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=je.visit(t[Mi].children[r],t[Ql]);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?(_n.visit(t[Mi].children[i],t[Ql],r),Reflect.set(t,n,r)):Reflect.has(t,n)||typeof n=="symbol"?Reflect.set(t,n,r):!1}};var gt=class extends ut{};function Tt(e){return(t,n)=>t.getValid(n)?e(t,n):null}var DU=(e,t)=>864e5*e[t],qw=(e,t)=>4294967296*e[t+1]+(e[t]>>>0),kU=(e,t)=>4294967296*(e[t+1]/1e3)+(e[t]>>>0)/1e3,FU=(e,t)=>4294967296*(e[t+1]/1e6)+(e[t]>>>0)/1e6,rO=e=>new Date(e),LU=(e,t)=>rO(DU(e,t)),CU=(e,t)=>rO(qw(e,t)),BU=(e,t)=>null,iO=(e,t,n)=>{if(n+1>=t.length)return null;let r=t[n],i=t[n+1];return e.subarray(r,i)},PU=({offset:e,values:t},n)=>{let r=e+n;return(t[r>>3]&1<<r%8)!==0},oO=({values:e},t)=>LU(e,t),sO=({values:e},t)=>CU(e,t*2),aa=({stride:e,values:t},n)=>t[e*n],$U=({stride:e,values:t},n)=>Ky(t[e*n]),aO=({values:e},t)=>e[t],UU=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),zU=({values:e,valueOffsets:t},n)=>iO(e,t,n),qU=({values:e,valueOffsets:t},n)=>{let r=iO(e,t,n);return r!==null?wd(r):null},jU=({values:e},t)=>e[t],VU=({type:e,values:t},n)=>e.precision!==xe.HALF?t[n]:Ky(t[n]),YU=(e,t)=>e.type.unit===xn.DAY?oO(e,t):sO(e,t),cO=({values:e},t)=>1e3*qw(e,t*2),lO=({values:e},t)=>qw(e,t*2),uO=({values:e},t)=>kU(e,t*2),fO=({values:e},t)=>FU(e,t*2),GU=(e,t)=>{switch(e.type.unit){case pt.SECOND:return cO(e,t);case pt.MILLISECOND:return lO(e,t);case pt.MICROSECOND:return uO(e,t);case pt.NANOSECOND:return fO(e,t)}},dO=({values:e},t)=>e[t],hO=({values:e},t)=>e[t],pO=({values:e},t)=>e[t],mO=({values:e},t)=>e[t],WU=(e,t)=>{switch(e.type.unit){case pt.SECOND:return dO(e,t);case pt.MILLISECOND:return hO(e,t);case pt.MICROSECOND:return pO(e,t);case pt.NANOSECOND:return mO(e,t)}},XU=({values:e,stride:t},n)=>Id.decimal(e.subarray(t*n,t*(n+1))),HU=(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 Vt([c])},ZU=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:o}=n,s=r[0];return new Zi(s.slice(i,o-i))},QU=(e,t)=>new sa(e,t),KU=(e,t)=>e.type.mode===me.Dense?yO(e,t):gO(e,t),yO=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return je.visit(r,e.valueOffsets[t])},gO=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return je.visit(r,t)},JU=(e,t)=>{var n;return(n=e.dictionary)===null||n===void 0?void 0:n.get(e.values[t])},tz=(e,t)=>e.type.unit===Yn.DAY_TIME?bO(e,t):xO(e,t),bO=({values:e},t)=>e.subarray(2*t,2*(t+1)),xO=({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},_O=({values:e},t)=>e[t],wO=({values:e},t)=>e[t],vO=({values:e},t)=>e[t],SO=({values:e},t)=>e[t],ez=(e,t)=>{switch(e.type.unit){case pt.SECOND:return _O(e,t);case pt.MILLISECOND:return wO(e,t);case pt.MICROSECOND:return vO(e,t);case pt.NANOSECOND:return SO(e,t)}},nz=(e,t)=>{let{stride:n,children:r}=e,o=r[0].slice(t*n,n);return new Vt([o])};gt.prototype.visitNull=Tt(BU);gt.prototype.visitBool=Tt(PU);gt.prototype.visitInt=Tt(jU);gt.prototype.visitInt8=Tt(aa);gt.prototype.visitInt16=Tt(aa);gt.prototype.visitInt32=Tt(aa);gt.prototype.visitInt64=Tt(aO);gt.prototype.visitUint8=Tt(aa);gt.prototype.visitUint16=Tt(aa);gt.prototype.visitUint32=Tt(aa);gt.prototype.visitUint64=Tt(aO);gt.prototype.visitFloat=Tt(VU);gt.prototype.visitFloat16=Tt($U);gt.prototype.visitFloat32=Tt(aa);gt.prototype.visitFloat64=Tt(aa);gt.prototype.visitUtf8=Tt(qU);gt.prototype.visitBinary=Tt(zU);gt.prototype.visitFixedSizeBinary=Tt(UU);gt.prototype.visitDate=Tt(YU);gt.prototype.visitDateDay=Tt(oO);gt.prototype.visitDateMillisecond=Tt(sO);gt.prototype.visitTimestamp=Tt(GU);gt.prototype.visitTimestampSecond=Tt(cO);gt.prototype.visitTimestampMillisecond=Tt(lO);gt.prototype.visitTimestampMicrosecond=Tt(uO);gt.prototype.visitTimestampNanosecond=Tt(fO);gt.prototype.visitTime=Tt(WU);gt.prototype.visitTimeSecond=Tt(dO);gt.prototype.visitTimeMillisecond=Tt(hO);gt.prototype.visitTimeMicrosecond=Tt(pO);gt.prototype.visitTimeNanosecond=Tt(mO);gt.prototype.visitDecimal=Tt(XU);gt.prototype.visitList=Tt(HU);gt.prototype.visitStruct=Tt(QU);gt.prototype.visitUnion=Tt(KU);gt.prototype.visitDenseUnion=Tt(yO);gt.prototype.visitSparseUnion=Tt(gO);gt.prototype.visitDictionary=Tt(JU);gt.prototype.visitInterval=Tt(tz);gt.prototype.visitIntervalDayTime=Tt(bO);gt.prototype.visitIntervalYearMonth=Tt(xO);gt.prototype.visitDuration=Tt(ez);gt.prototype.visitDurationSecond=Tt(_O);gt.prototype.visitDurationMillisecond=Tt(wO);gt.prototype.visitDurationMicrosecond=Tt(vO);gt.prototype.visitDurationNanosecond=Tt(SO);gt.prototype.visitFixedSizeList=Tt(nz);gt.prototype.visitMap=Tt(ZU);var je=new gt;var Xr=Symbol.for("keys"),Kl=Symbol.for("vals"),Zi=class{constructor(t){return this[Xr]=new Vt([t.children[0]]).memoize(),this[Kl]=t.children[1],new Proxy(this,new Vw)}[Symbol.iterator](){return new jw(this[Xr],this[Kl])}get size(){return this[Xr].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Xr],n=this[Kl],r={};for(let i=-1,o=t.length;++i<o;)r[t.get(i)]=je.visit(n,i);return r}toString(){return`{${[...this].map(([t,n])=>`${wi(t)}: ${wi(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),je.visit(this.vals,t)]})}},Vw=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Xr].toArray().map(String)}has(t,n){return t[Xr].includes(n)}getOwnPropertyDescriptor(t,n){if(t[Xr].indexOf(n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];let r=t[Xr].indexOf(n);if(r!==-1){let i=je.visit(Reflect.get(t,Kl),r);return Reflect.set(t,n,i),i}}set(t,n,r){let i=t[Xr].indexOf(n);return i!==-1?(_n.visit(Reflect.get(t,Kl),i,r),Reflect.set(t,n,r)):Reflect.has(t,n)?Reflect.set(t,n,r):!1}};Object.defineProperties(Zi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Xr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Kl]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function rz(e,t,n){let r=e.length,i=t>-1?t:r+t%r;return n?n(e,i):i}var IO;function Ed(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&&(IO=o,o=s,s=IO),s>i&&(s=i),r?r(e,o,s):[o,s]}var TO=e=>e!==e;function ca(e){if(typeof e!=="object"||e===null)return TO(e)?TO: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?Sw(e,n):!1:e instanceof Map?oz(e):Array.isArray(e)?iz(e):e instanceof Vt?sz(e):az(e,!0)}function iz(e){let t=[];for(let n=-1,r=e.length;++n<r;)t[n]=ca(e[n]);return mg(t)}function oz(e){let t=-1,n=[];for(let r of e.values())n[++t]=ca(r);return mg(n)}function sz(e){let t=[];for(let n=-1,r=e.length;++n<r;)t[n]=ca(e.get(n));return mg(t)}function az(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]=ca(e[n[i]]);return mg(r,n)}function mg(e,t){return n=>{if(!n||typeof n!="object")return!1;switch(n.constructor){case Array:return cz(e,n);case Map:return EO(e,n,n.keys());case Zi:case sa:case Object:case void 0:return EO(e,n,t||Object.keys(n))}return n instanceof Vt?lz(e,n):!1}}function cz(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 lz(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 EO(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 Gw={};vr(Gw,{BitIterator:()=>_c,getBit:()=>AO,getBool:()=>gg,packBools:()=>vc,popcnt_array:()=>MO,popcnt_bit_range:()=>Ad,popcnt_uint32:()=>yg,setBool:()=>uz,truncateBitmap:()=>wc});function gg(e,t,n,r){return(n&1<<r)!==0}function AO(e,t,n,r){return(n&1<<r)>>r}function uz(e,t,n){return n?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function wc(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):vc(new _c(n,e,t,null,gg)).subarray(0,r)),i}return n}function vc(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 _c=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 Ad(e,t,n){if(n-t<=0)return 0;if(n-t<8){let o=0;for(let s of new _c(e,t,n-t,e,AO))o+=s;return o}let r=n>>3<<3,i=t+(t%8===0?0:8-t%8);return Ad(e,t,i)+Ad(e,r,n)+MO(e,i>>3,r-i>>3)}function MO(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+=yg(o.getUint32(i)),i+=4;for(;s-i>=2;)r+=yg(o.getUint16(i)),i+=2;for(;s-i>=1;)r+=yg(o.getUint8(i)),i+=1;return r}function yg(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 fz=-1,se=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 at.isSparseUnion(t)?this.children.some(n=>n.nullable):at.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(at.isUnion(this.type))return this.children.reduce((r,i)=>r+i.nullCount,0);let t=this._nullCount,n;return t<=fz&&(n=this.nullBitmap)&&(this._nullCount=t=this.length-Ad(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=Ar(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(at.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(at.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(wc(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===D.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(wc(this.offset,n,this.nullBitmap),0);let o=this.buffers;return o[Wr.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[Wr.TYPE])&&(s[Wr.TYPE]=o.subarray(t,t+n)),(o=s[Wr.OFFSET])&&(s[Wr.OFFSET]=o.subarray(t,t+n+1))||(o=s[Wr.DATA])&&(s[Wr.DATA]=i===6?o:o.subarray(r*t,r*(t+n))),s}_sliceChildren(t,n,r){return t.map(i=>i.slice(n,r))}};se.prototype.children=Object.freeze([]);var Ww=class e extends ut{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:n,["offset"]:r=0,["length"]:i=0}=t;return new se(n,r,i,i)}visitBool(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.nullBitmap),o=Pt(n.ArrayType,t.data),{["length"]:s=o.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new se(n,r,s,a,[void 0,o,i])}visitInt(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.nullBitmap),o=Pt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new se(n,r,s,a,[void 0,o,i])}visitFloat(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.nullBitmap),o=Pt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new se(n,r,s,a,[void 0,o,i])}visitUtf8(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.data),o=Ot(t.nullBitmap),s=xc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new se(n,r,a,c,[s,i,o])}visitBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.data),o=Ot(t.nullBitmap),s=xc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new se(n,r,a,c,[s,i,o])}visitFixedSizeBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.nullBitmap),o=Pt(n.ArrayType,t.data),{["length"]:s=o.length/Ar(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new se(n,r,s,a,[void 0,o,i])}visitDate(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.nullBitmap),o=Pt(n.ArrayType,t.data),{["length"]:s=o.length/Ar(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new se(n,r,s,a,[void 0,o,i])}visitTimestamp(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.nullBitmap),o=Pt(n.ArrayType,t.data),{["length"]:s=o.length/Ar(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new se(n,r,s,a,[void 0,o,i])}visitTime(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.nullBitmap),o=Pt(n.ArrayType,t.data),{["length"]:s=o.length/Ar(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new se(n,r,s,a,[void 0,o,i])}visitDecimal(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.nullBitmap),o=Pt(n.ArrayType,t.data),{["length"]:s=o.length/Ar(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new se(n,r,s,a,[void 0,o,i])}visitList(t){let{["type"]:n,["offset"]:r=0,["child"]:i}=t,o=Ot(t.nullBitmap),s=xc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new se(n,r,a,c,[s,void 0,o],[i])}visitStruct(t){let{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,o=Ot(t.nullBitmap),{length:s=i.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new se(n,r,s,a,[void 0,void 0,o],i)}visitUnion(t){let{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,o=Pt(n.ArrayType,t.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=t;if(at.isSparseUnion(n))return new se(n,r,s,a,[void 0,void 0,void 0,o],i);let c=xc(t.valueOffsets);return new se(n,r,s,a,[c,void 0,void 0,o],i)}visitDictionary(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.nullBitmap),o=Pt(n.indices.ArrayType,t.data),{["dictionary"]:s=new Vt([new e().visit({type:n.dictionary})])}=t,{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new se(n,r,a,c,[void 0,o,i],[],s)}visitInterval(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.nullBitmap),o=Pt(n.ArrayType,t.data),{["length"]:s=o.length/Ar(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new se(n,r,s,a,[void 0,o,i])}visitDuration(t){let{["type"]:n,["offset"]:r=0}=t,i=Ot(t.nullBitmap),o=Pt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new se(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=Ot(t.nullBitmap),{["length"]:s=i.length/Ar(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new se(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=Ot(t.nullBitmap),s=xc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new se(n,r,a,c,[s,void 0,o],[i])}},dz=new Ww;function Dt(e){return dz.visit(e)}var Md=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 bg(e){return e.reduce((t,n)=>t+n.nullCount,0)}function xg(e){return e.reduce((t,n,r)=>(t[r+1]=t[r]+n.length,t),new Uint32Array(e.length+1))}function _g(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 Xw(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 Nd(e,t){return e.getValid(t)}function la(e){function t(n,r,i){return e(n[r],i)}return function(n){let r=this.data;return Xw(r,this._offsets,n,t)}}function wg(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=Xw(o,this._offsets,r,n);return t=void 0,s}}function vg(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):Xw(o,this._offsets,i,n);return t=void 0,s}}var bt=class extends ut{};function hz(e,t){return t===null&&e.length>0?0:-1}function pz(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new _c(n,e.offset+(t||0),e.length,n,gg)){if(!i)return r;++r}return-1}function kt(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case D.Union:break;case D.Dictionary:break;default:return pz(e,n)}let r=je.getVisitFn(e),i=ca(t);for(let o=(n||0)-1,s=e.length;++o<s;)if(i(r(e,o)))return o;return-1}function NO(e,t,n){let r=je.getVisitFn(e),i=ca(t);for(let o=(n||0)-1,s=e.length;++o<s;)if(i(r(e,o)))return o;return-1}bt.prototype.visitNull=hz;bt.prototype.visitBool=kt;bt.prototype.visitInt=kt;bt.prototype.visitInt8=kt;bt.prototype.visitInt16=kt;bt.prototype.visitInt32=kt;bt.prototype.visitInt64=kt;bt.prototype.visitUint8=kt;bt.prototype.visitUint16=kt;bt.prototype.visitUint32=kt;bt.prototype.visitUint64=kt;bt.prototype.visitFloat=kt;bt.prototype.visitFloat16=kt;bt.prototype.visitFloat32=kt;bt.prototype.visitFloat64=kt;bt.prototype.visitUtf8=kt;bt.prototype.visitBinary=kt;bt.prototype.visitFixedSizeBinary=kt;bt.prototype.visitDate=kt;bt.prototype.visitDateDay=kt;bt.prototype.visitDateMillisecond=kt;bt.prototype.visitTimestamp=kt;bt.prototype.visitTimestampSecond=kt;bt.prototype.visitTimestampMillisecond=kt;bt.prototype.visitTimestampMicrosecond=kt;bt.prototype.visitTimestampNanosecond=kt;bt.prototype.visitTime=kt;bt.prototype.visitTimeSecond=kt;bt.prototype.visitTimeMillisecond=kt;bt.prototype.visitTimeMicrosecond=kt;bt.prototype.visitTimeNanosecond=kt;bt.prototype.visitDecimal=kt;bt.prototype.visitList=kt;bt.prototype.visitStruct=kt;bt.prototype.visitUnion=kt;bt.prototype.visitDenseUnion=NO;bt.prototype.visitSparseUnion=NO;bt.prototype.visitDictionary=kt;bt.prototype.visitInterval=kt;bt.prototype.visitIntervalDayTime=kt;bt.prototype.visitIntervalYearMonth=kt;bt.prototype.visitDuration=kt;bt.prototype.visitDurationSecond=kt;bt.prototype.visitDurationMillisecond=kt;bt.prototype.visitDurationMicrosecond=kt;bt.prototype.visitDurationNanosecond=kt;bt.prototype.visitFixedSizeList=kt;bt.prototype.visitMap=kt;var Sc=new bt;var xt=class extends ut{};function Et(e){let{type:t}=e;if(e.nullCount===0&&e.stride===1&&(t.typeId===D.Timestamp||t instanceof Pe&&t.bitWidth!==64||t instanceof Si&&t.bitWidth!==64||t instanceof dr&&t.precision!==xe.HALF))return new Md(e.data.length,r=>{let i=e.data[r];return i.values.subarray(0,i.length)[Symbol.iterator]()});let n=0;return new Md(e.data.length,r=>{let o=e.data[r].length,s=e.slice(n,n+o);return n+=o,new Hw(s)})}var Hw=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}};xt.prototype.visitNull=Et;xt.prototype.visitBool=Et;xt.prototype.visitInt=Et;xt.prototype.visitInt8=Et;xt.prototype.visitInt16=Et;xt.prototype.visitInt32=Et;xt.prototype.visitInt64=Et;xt.prototype.visitUint8=Et;xt.prototype.visitUint16=Et;xt.prototype.visitUint32=Et;xt.prototype.visitUint64=Et;xt.prototype.visitFloat=Et;xt.prototype.visitFloat16=Et;xt.prototype.visitFloat32=Et;xt.prototype.visitFloat64=Et;xt.prototype.visitUtf8=Et;xt.prototype.visitBinary=Et;xt.prototype.visitFixedSizeBinary=Et;xt.prototype.visitDate=Et;xt.prototype.visitDateDay=Et;xt.prototype.visitDateMillisecond=Et;xt.prototype.visitTimestamp=Et;xt.prototype.visitTimestampSecond=Et;xt.prototype.visitTimestampMillisecond=Et;xt.prototype.visitTimestampMicrosecond=Et;xt.prototype.visitTimestampNanosecond=Et;xt.prototype.visitTime=Et;xt.prototype.visitTimeSecond=Et;xt.prototype.visitTimeMillisecond=Et;xt.prototype.visitTimeMicrosecond=Et;xt.prototype.visitTimeNanosecond=Et;xt.prototype.visitDecimal=Et;xt.prototype.visitList=Et;xt.prototype.visitStruct=Et;xt.prototype.visitUnion=Et;xt.prototype.visitDenseUnion=Et;xt.prototype.visitSparseUnion=Et;xt.prototype.visitDictionary=Et;xt.prototype.visitInterval=Et;xt.prototype.visitIntervalDayTime=Et;xt.prototype.visitIntervalYearMonth=Et;xt.prototype.visitDuration=Et;xt.prototype.visitDurationSecond=Et;xt.prototype.visitDurationMillisecond=Et;xt.prototype.visitDurationMicrosecond=Et;xt.prototype.visitDurationNanosecond=Et;xt.prototype.visitFixedSizeList=Et;xt.prototype.visitMap=Et;var Jl=new xt;var mz=(e,t)=>e+t,Qi=class extends ut{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+Mr.visit(i,n),0)}visitFixedSizeBinary(t,n){return t.type.byteWidth}visitMap(t,n){return 8+t.children.reduce((r,i)=>r+Mr.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)}},yz=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),gz=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),bz=({valueOffsets:e,stride:t,children:n},r)=>{let i=n[0],{[r*t]:o}=e,{[r*t+1]:s}=e,a=Mr.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},xz=({stride:e,children:t},n)=>{let r=t[0],i=r.slice(n*e,e),o=Mr.getVisitFn(r.type),s=0;for(let a=-1,c=i.length;++a<c;)s+=o(i,a);return s},_z=(e,t)=>e.type.mode===me.Dense?RO(e,t):OO(e,t),RO=({type:e,children:t,typeIds:n,valueOffsets:r},i)=>{let o=e.typeIdToChildIndex[n[i]];return 8+Mr.visit(t[o],r[i])},OO=({children:e},t)=>4+Mr.visitMany(e,e.map(()=>t)).reduce(mz,0);Qi.prototype.visitUtf8=yz;Qi.prototype.visitBinary=gz;Qi.prototype.visitList=bz;Qi.prototype.visitFixedSizeList=xz;Qi.prototype.visitUnion=_z;Qi.prototype.visitDenseUnion=RO;Qi.prototype.visitSparseUnion=OO;var Mr=new Qi;var DO,kO={},FO={},Vt=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 se)))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}=kO[s.typeId],f=o[0];this.isValid=d=>Nd(f,d),this.get=d=>a(f,d),this.set=(d,h)=>c(f,d,h),this.indexOf=d=>l(f,d),this.getByteLength=d=>u(f,d),this._offsets=[0,f.length];break}default:Object.setPrototypeOf(this,FO[s.typeId]),this._offsets=xg(o);break}this.data=o,this.type=s,this.stride=Ar(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 bg(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${D[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 Jl.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(Ed(this,t,n,({data:r,_offsets:i},o,s)=>_g(r,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:t,data:n,length:r,stride:i,ArrayType:o}=this;switch(t.typeId){case D.Int:case D.Float:case D.Decimal:case D.Time:case D.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 at.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(at.isDictionary(this.type)){let t=new Sg(this.data[0].dictionary),n=this.data.map(r=>{let i=r.clone();return i.dictionary=t,i});return new e(n)}return new Sg(this)}unmemoize(){if(at.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}};DO=Symbol.toStringTag;Vt[DO]=(e=>{e.type=at.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(D).map(n=>D[n]).filter(n=>typeof n=="number"&&n!==D.NONE);for(let n of t){let r=je.getVisitFnByTypeId(n),i=_n.getVisitFnByTypeId(n),o=Sc.getVisitFnByTypeId(n),s=Mr.getVisitFnByTypeId(n);kO[n]={get:r,set:i,indexOf:o,byteLength:s},FO[n]=Object.create(e,{isValid:{value:la(Nd)},get:{value:la(je.getVisitFnByTypeId(n))},set:{value:wg(_n.getVisitFnByTypeId(n))},indexOf:{value:vg(Sc.getVisitFnByTypeId(n))},getByteLength:{value:la(Mr.getVisitFnByTypeId(n))}})}return"Vector"})(Vt.prototype);var Sg=class e extends Vt{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 Vt(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function LO(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
|
-
switch (x) {${
|
|
3
|
-
case ${
|
|
1
|
+
var nX=Object.create;var tA=Object.defineProperty;var iX=Object.getOwnPropertyDescriptor;var oX=Object.getOwnPropertyNames;var sX=Object.getPrototypeOf,aX=Object.prototype.hasOwnProperty;var ek=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ir=(e,t)=>{for(var r in t)tA(e,r,{get:t[r],enumerable:!0})},cX=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of oX(t))!aX.call(e,i)&&i!==r&&tA(e,i,{get:()=>t[i],enumerable:!(n=iX(t,i))||n.enumerable});return e};var lX=(e,t,r)=>(r=e!=null?nX(sX(e)):{},cX(t||!e||!e.__esModule?tA(r,"default",{value:e,enumerable:!0}):r,e));var OW=ek((Ane,BW)=>{"use strict";function Jut(e,t,r,n,i){for(var o=i+1;n<=i;){var s=n+i>>>1,a=e[s],c=r!==void 0?r(a,t):a-t;c>=0?(o=s,i=s-1):n=s+1}return o}function tft(e,t,r,n,i){for(var o=i+1;n<=i;){var s=n+i>>>1,a=e[s],c=r!==void 0?r(a,t):a-t;c>0?(o=s,i=s-1):n=s+1}return o}function eft(e,t,r,n,i){for(var o=n-1;n<=i;){var s=n+i>>>1,a=e[s],c=r!==void 0?r(a,t):a-t;c<0?(o=s,n=s+1):i=s-1}return o}function rft(e,t,r,n,i){for(var o=n-1;n<=i;){var s=n+i>>>1,a=e[s],c=r!==void 0?r(a,t):a-t;c<=0?(o=s,n=s+1):i=s-1}return o}function nft(e,t,r,n,i){for(;n<=i;){var o=n+i>>>1,s=e[o],a=r!==void 0?r(s,t):s-t;if(a===0)return o;a<=0?n=o+1:i=o-1}return-1}function dx(e,t,r,n,i,o){return typeof r=="function"?o(e,t,r,n===void 0?0:n|0,i===void 0?e.length-1:i|0):o(e,t,void 0,r===void 0?0:r|0,n===void 0?e.length-1:n|0)}BW.exports={ge:function(e,t,r,n,i){return dx(e,t,r,n,i,Jut)},gt:function(e,t,r,n,i){return dx(e,t,r,n,i,tft)},lt:function(e,t,r,n,i){return dx(e,t,r,n,i,eft)},le:function(e,t,r,n,i){return dx(e,t,r,n,i,rft)},eq:function(e,t,r,n,i){return dx(e,t,r,n,i,nft)}}});var PW=ek((Mne,UW)=>{"use strict";var UT=OW(),dm=0,Td=1,CT=2;UW.exports=oft;function fF(e,t,r,n,i){this.mid=e,this.left=t,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(t?t.count:0)+(r?r.count:0)+n.length}var hx=fF.prototype;function lF(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 LW(e,t){var r=hm(t);e.mid=r.mid,e.left=r.left,e.right=r.right,e.leftPoints=r.leftPoints,e.rightPoints=r.rightPoints,e.count=r.count}function NW(e,t){var r=e.intervals([]);r.push(t),LW(e,r)}function FW(e,t){var r=e.intervals([]),n=r.indexOf(t);return n<0?dm:(r.splice(n,1),LW(e,r),Td)}hx.intervals=function(e){return e.push.apply(e,this.leftPoints),this.left&&this.left.intervals(e),this.right&&this.right.intervals(e),e};hx.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)?NW(this,e):this.left.insert(e):this.left=hm([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?NW(this,e):this.right.insert(e):this.right=hm([e]);else{var r=UT.ge(this.leftPoints,e,dF),n=UT.ge(this.rightPoints,e,hF);this.leftPoints.splice(r,0,e),this.rightPoints.splice(n,0,e)}};hx.remove=function(e){var t=this.count-this.leftPoints;if(e[1]<this.mid){if(!this.left)return dm;var r=this.right?this.right.count:0;if(4*r>3*(t-1))return FW(this,e);var n=this.left.remove(e);return n===CT?(this.left=null,this.count-=1,Td):(n===Td&&(this.count-=1),n)}else if(e[0]>this.mid){if(!this.right)return dm;var i=this.left?this.left.count:0;if(4*i>3*(t-1))return FW(this,e);var n=this.right.remove(e);return n===CT?(this.right=null,this.count-=1,Td):(n===Td&&(this.count-=1),n)}else{if(this.count===1)return this.leftPoints[0]===e?CT:dm;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,n=this.right;o.count-=s.count,o.right=s.left,s.left=a,s.right=n}lF(this,s),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?lF(this,this.left):lF(this,this.right);return Td}for(var a=UT.ge(this.leftPoints,e,dF);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 n=UT.ge(this.rightPoints,e,hF);n<this.rightPoints.length&&this.rightPoints[n][1]===e[1];++n)if(this.rightPoints[n]===e)return this.rightPoints.splice(n,1),Td}return dm}};function RW(e,t,r){for(var n=0;n<e.length&&e[n][0]<=t;++n){var i=r(e[n]);if(i)return i}}function kW(e,t,r){for(var n=e.length-1;n>=0&&e[n][1]>=t;--n){var i=r(e[n]);if(i)return i}}function CW(e,t){for(var r=0;r<e.length;++r){var n=t(e[r]);if(n)return n}}hx.queryPoint=function(e,t){if(e<this.mid){if(this.left){var r=this.left.queryPoint(e,t);if(r)return r}return RW(this.leftPoints,e,t)}else if(e>this.mid){if(this.right){var r=this.right.queryPoint(e,t);if(r)return r}return kW(this.rightPoints,e,t)}else return CW(this.leftPoints,t)};hx.queryInterval=function(e,t,r){if(e<this.mid&&this.left){var n=this.left.queryInterval(e,t,r);if(n)return n}if(t>this.mid&&this.right){var n=this.right.queryInterval(e,t,r);if(n)return n}return t<this.mid?RW(this.leftPoints,t,r):e>this.mid?kW(this.rightPoints,e,r):CW(this.leftPoints,r)};function ift(e,t){return e-t}function dF(e,t){var r=e[0]-t[0];return r||e[1]-t[1]}function hF(e,t){var r=e[1]-t[1];return r||e[0]-t[0]}function hm(e){if(e.length===0)return null;for(var t=[],r=0;r<e.length;++r)t.push(e[r][0],e[r][1]);t.sort(ift);for(var n=t[t.length>>1],i=[],o=[],s=[],r=0;r<e.length;++r){var a=e[r];a[1]<n?i.push(a):n<a[0]?o.push(a):s.push(a)}var c=s,l=s.slice();return c.sort(dF),l.sort(hF),new fF(n,hm(i),hm(o),c,l)}function uF(e){this.root=e}var pm=uF.prototype;pm.insert=function(e){this.root?this.root.insert(e):this.root=new fF(e[0],null,null,[e],[e])};pm.remove=function(e){if(this.root){var t=this.root.remove(e);return t===CT&&(this.root=null),t!==dm}return!1};pm.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)};pm.queryInterval=function(e,t,r){if(e<=t&&this.root)return this.root.queryInterval(e,t,r)};Object.defineProperty(pm,"count",{get:function(){return this.root?this.root.count:0}});Object.defineProperty(pm,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function oft(e){return!e||e.length===0?new uF(null):new uF(hm(e))}});var rk={};function Tm(e,t=!1){let r,n,i=rk;function o(l){r=e(l).then(()=>{if(n){let{value:u}=n;n=null,o(u)}else r=null})}function s(l){n={event:l}}function a(l){r?s(l):o(l)}function c(l){i!==l&&requestAnimationFrame(()=>{let u=i;i=rk,a(u)}),i=l}return t?c:a}var ai=class{constructor(t){this._filterBy=t,this._requestUpdate=Tm(()=>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 r=t||this.query(this.filterBy?.predicate(this));return this._coordinator.requestQuery(this,r)}requestUpdate(){this._requestUpdate()}update(){return this}};function zx(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function P(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(f){s(f)}}function c(u){try{l(n.throw(u))}catch(f){s(f)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})}function nk(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function H(e){return this instanceof H?(this.v=e,this):new H(e)}function $e(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(d){n[d]&&(i[d]=function(h){return new Promise(function(p,y){o.push([d,h,p,y])>1||a(d,h)})})}function a(d,h){try{c(n[d](h))}catch(p){f(o[0][3],p)}}function c(d){d.value instanceof H?Promise.resolve(d.value.v).then(l,u):f(o[0][2],d)}function l(d){a("next",d)}function u(d){a("throw",d)}function f(d,h){d(h),o.shift(),o.length&&a(o[0][0],o[0][1])}}function Ji(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(s){return(r=!r)?{value:H(e[i](s)),done:!1}:o?o(s):s}:o}}function fr(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof nk=="function"?nk(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[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 sA={};Ir(sA,{compareArrayLike:()=>oA,joinUint8Arrays:()=>Mi,memcpy:()=>Em,rebaseValueOffsets:()=>Hx,toArrayBufferView:()=>te,toArrayBufferViewAsyncIterator:()=>No,toArrayBufferViewIterator:()=>Ts,toBigInt64Array:()=>Xx,toBigUint64Array:()=>bX,toFloat32Array:()=>xX,toFloat32ArrayAsyncIterator:()=>RX,toFloat32ArrayIterator:()=>MX,toFloat64Array:()=>_X,toFloat64ArrayAsyncIterator:()=>kX,toFloat64ArrayIterator:()=>EX,toInt16Array:()=>mX,toInt16ArrayAsyncIterator:()=>OX,toInt16ArrayIterator:()=>SX,toInt32Array:()=>Vu,toInt32ArrayAsyncIterator:()=>NX,toInt32ArrayIterator:()=>IX,toInt8Array:()=>pX,toInt8ArrayAsyncIterator:()=>BX,toInt8ArrayIterator:()=>vX,toUint16Array:()=>yX,toUint16ArrayAsyncIterator:()=>FX,toUint16ArrayIterator:()=>TX,toUint32Array:()=>gX,toUint32ArrayAsyncIterator:()=>LX,toUint32ArrayIterator:()=>AX,toUint8Array:()=>Et,toUint8ArrayAsyncIterator:()=>iA,toUint8ArrayIterator:()=>nA,toUint8ClampedArray:()=>wX,toUint8ClampedArrayAsyncIterator:()=>CX,toUint8ClampedArrayIterator:()=>DX});var uX=new TextDecoder("utf-8"),Am=e=>uX.decode(e),fX=new TextEncoder,Is=e=>fX.encode(e);var dX=e=>typeof e=="number",ik=e=>typeof e=="boolean",$r=e=>typeof e=="function",Cn=e=>e!=null&&Object(e)===e,Ai=e=>Cn(e)&&$r(e.then);var Oo=e=>Cn(e)&&$r(e[Symbol.iterator]),to=e=>Cn(e)&&$r(e[Symbol.asyncIterator]),Vx=e=>Cn(e)&&Cn(e.schema);var jx=e=>Cn(e)&&"done"in e&&"value"in e;var qx=e=>Cn(e)&&$r(e.stat)&&dX(e.fd);var Yx=e=>Cn(e)&&Mm(e.body),Wx=e=>"_getDOMStream"in e&&"_getNodeStream"in e,ok=e=>Cn(e)&&$r(e.abort)&&$r(e.getWriter)&&!Wx(e),Mm=e=>Cn(e)&&$r(e.cancel)&&$r(e.getReader)&&!Wx(e),sk=e=>Cn(e)&&$r(e.end)&&$r(e.write)&&ik(e.writable)&&!Wx(e),Gx=e=>Cn(e)&&$r(e.read)&&$r(e.pipe)&&ik(e.readable)&&!Wx(e),ak=e=>Cn(e)&&$r(e.clear)&&$r(e.bytes)&&$r(e.position)&&$r(e.setPosition)&&$r(e.capacity)&&$r(e.getBufferIdentifier)&&$r(e.createLong);var rA=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function hX(e){let t=e[0]?[e[0]]:[],r,n,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:r,byteLength:i}=s,{byteOffset:n,byteLength:o}=a,r+i<n||n+o<r){a&&(t[++l]=a);continue}t[l]=new Uint8Array(s.buffer,r,n-r+o)}return t}function Em(e,t,r=0,n=t.byteLength){let i=e.byteLength,o=new Uint8Array(e.buffer,e.byteOffset,i),s=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,i));return o.set(s,r),e}function Mi(e,t){let r=hX(e),n=r.reduce((u,f)=>u+f.byteLength,0),i,o,s,a=0,c=-1,l=Math.min(t||Number.POSITIVE_INFINITY,n);for(let u=r.length;++c<u;){if(i=r[c],o=i.subarray(0,Math.min(i.length,l-a)),l<=a+o.length){o.length<i.length?r[c]=i.subarray(o.length):o.length===i.length&&c++,s?Em(s,o,a):s=o;break}Em(s||(s=new Uint8Array(l)),o,a),a+=o.length}return[s||new Uint8Array(0),r.slice(c),n-(s?s.byteLength:0)]}function te(e,t){let r=jx(t)?t.value:t;return r instanceof e?e===Uint8Array?new e(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=Is(r)),r instanceof ArrayBuffer?new e(r):r instanceof rA?new e(r):ak(r)?te(e,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new e(0):new e(r.buffer,r.byteOffset,r.byteLength/e.BYTES_PER_ELEMENT):e.from(r)):new e(0)}var pX=e=>te(Int8Array,e),mX=e=>te(Int16Array,e),Vu=e=>te(Int32Array,e),Xx=e=>te(BigInt64Array,e),Et=e=>te(Uint8Array,e),yX=e=>te(Uint16Array,e),gX=e=>te(Uint32Array,e),bX=e=>te(BigUint64Array,e),xX=e=>te(Float32Array,e),_X=e=>te(Float64Array,e),wX=e=>te(Uint8ClampedArray,e),eA=e=>(e.next(),e);function*Ts(e,t){let r=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof rA?r(t):Oo(t)?t:r(t);return yield*eA(function*(i){let o=null;do o=i.next(yield te(e,o));while(!o.done)}(n[Symbol.iterator]())),new e}var vX=e=>Ts(Int8Array,e),SX=e=>Ts(Int16Array,e),IX=e=>Ts(Int32Array,e),nA=e=>Ts(Uint8Array,e),TX=e=>Ts(Uint16Array,e),AX=e=>Ts(Uint32Array,e),MX=e=>Ts(Float32Array,e),EX=e=>Ts(Float64Array,e),DX=e=>Ts(Uint8ClampedArray,e);function No(e,t){return $e(this,arguments,function*(){if(Ai(t))return yield H(yield H(yield*Ji(fr(No(e,yield H(t))))));let n=function(s){return $e(this,arguments,function*(){yield yield H(yield H(s))})},i=function(s){return $e(this,arguments,function*(){yield H(yield*Ji(fr(eA(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 rA?n(t):Oo(t)?i(t):to(t)?t:n(t);return yield H(yield*Ji(fr(eA(function(s){return $e(this,arguments,function*(){let a=null;do a=yield H(s.next(yield yield H(te(e,a))));while(!a.done)})}(o[Symbol.asyncIterator]()))))),yield H(new e)})}var BX=e=>No(Int8Array,e),OX=e=>No(Int16Array,e),NX=e=>No(Int32Array,e),iA=e=>No(Uint8Array,e),FX=e=>No(Uint16Array,e),LX=e=>No(Uint32Array,e),RX=e=>No(Float32Array,e),kX=e=>No(Float64Array,e),CX=e=>No(Uint8ClampedArray,e);function Hx(e,t,r){if(e!==0){r=r.slice(0,t);for(let n=-1,i=r.length;++n<i;)r[n]+=e}return r.subarray(0,t)}function oA(e,t){let r=0,n=e.length;if(n!==t.length)return!1;if(n>0)do if(e[r]!==t[r])return!1;while(++r<n);return!0}var on={fromIterable(e){return Zx(UX(e))},fromAsyncIterable(e){return Zx(PX(e))},fromDOMStream(e){return Zx($X(e))},fromNodeStream(e){return Zx(zX(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')}},Zx=e=>(e.next(),e);function*UX(e){let t,r=!1,n=[],i,o,s,a=0;function c(){return o==="peek"?Mi(n,s)[0]:([i,n,a]=Mi(n,s),i)}({cmd:o,size:s}=(yield null)||{cmd:"read",size:0});let l=nA(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(s-a)?l.next():l.next(s-a),!t&&i.byteLength>0&&(n.push(i),a+=i.byteLength),t||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!t)}catch(u){(r=!0)&&typeof l.throw=="function"&&l.throw(u)}finally{r===!1&&typeof l.return=="function"&&l.return(null)}return null}function PX(e){return $e(this,arguments,function*(){let r,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Mi(i,a)[0]:([o,i,c]=Mi(i,a),o)}({cmd:s,size:a}=(yield yield H(null))||{cmd:"read",size:0});let u=iA(e)[Symbol.asyncIterator]();try{do if({done:r,value:o}=Number.isNaN(a-c)?yield H(u.next()):yield H(u.next(a-c)),!r&&o.byteLength>0&&(i.push(o),c+=o.byteLength),r||a<=c)do({cmd:s,size:a}=yield yield H(l()));while(a<c);while(!r)}catch(f){(n=!0)&&typeof u.throw=="function"&&(yield H(u.throw(f)))}finally{n===!1&&typeof u.return=="function"&&(yield H(u.return(new Uint8Array(0))))}return yield H(null)})}function $X(e){return $e(this,arguments,function*(){let r=!1,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Mi(i,a)[0]:([o,i,c]=Mi(i,a),o)}({cmd:s,size:a}=(yield yield H(null))||{cmd:"read",size:0});let u=new cA(e);try{do if({done:r,value:o}=Number.isNaN(a-c)?yield H(u.read()):yield H(u.read(a-c)),!r&&o.byteLength>0&&(i.push(Et(o)),c+=o.byteLength),r||a<=c)do({cmd:s,size:a}=yield yield H(l()));while(a<c);while(!r)}catch(f){(n=!0)&&(yield H(u.cancel(f)))}finally{n===!1?yield H(u.cancel()):e.locked&&u.releaseLock()}return yield H(null)})}var cA=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 P(this,void 0,void 0,function*(){let{reader:r,source:n}=this;r&&(yield r.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return P(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=yield this.reader.read();return!r.done&&(r.value=Et(r)),r})}},aA=(e,t)=>{let r=i=>n([t,i]),n;return[t,r,new Promise(i=>(n=i)&&e.once(t,r))]};function zX(e){return $e(this,arguments,function*(){let r=[],n="error",i=!1,o=null,s,a,c=0,l=[],u;function f(){return s==="peek"?Mi(l,a)[0]:([u,l,c]=Mi(l,a),u)}if({cmd:s,size:a}=(yield yield H(null))||{cmd:"read",size:0},e.isTTY)return yield yield H(new Uint8Array(0)),yield H(null);try{r[0]=aA(e,"end"),r[1]=aA(e,"error");do{if(r[2]=aA(e,"readable"),[n,o]=yield H(Promise.race(r.map(h=>h[2]))),n==="error")break;if((i=n==="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 H(f()));while(a<c)}while(!i)}finally{yield H(d(r,n==="error"?o:null))}return yield H(null);function d(h,p){return u=l=null,new Promise((y,g)=>{for(let[m,b]of h)e.off(m,b);try{let m=e.destroy;m&&m.call(e,p),p=void 0}catch(m){p=m||p}finally{p!=null?g(p):y()}})}})}var Ee;(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"})(Ee||(Ee={}));var Ue;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(Ue||(Ue={}));var Le;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(Le||(Le={}));var Tr;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(Tr||(Tr={}));var ft;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(ft||(ft={}));var Wr;(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"})(Wr||(Wr={}));var As=new Int32Array(2),Kx=new Float32Array(As.buffer),Qx=new Float64Array(As.buffer),Dd=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Dm;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(Dm||(Dm={}));var Ar=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 As[0]=this.readInt32(t),Kx[0]}readFloat64(t){return As[Dd?0:1]=this.readInt32(t),As[Dd?1:0]=this.readInt32(t+4),Qx[0]}writeInt8(t,r){this.bytes_[t]=r}writeUint8(t,r){this.bytes_[t]=r}writeInt16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeUint16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeInt32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeUint32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeInt64(t,r){this.writeInt32(t,Number(BigInt.asIntN(32,r))),this.writeInt32(t+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(t,r){this.writeUint32(t,Number(BigInt.asUintN(32,r))),this.writeUint32(t+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(t,r){Kx[0]=r,this.writeInt32(t,As[0])}writeFloat64(t,r){Qx[0]=r,this.writeInt32(t,As[Dd?0:1]),this.writeInt32(t+4,As[Dd?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 r=0;r<4;r++)t+=String.fromCharCode(this.readInt8(this.position_+4+r));return t}__offset(t,r){let n=t-this.readInt32(t);return r<this.readInt16(n)?this.readInt16(n+r):0}__union(t,r){return t.bb_pos=r+this.readInt32(r),t.bb=this,t}__string(t,r){t+=this.readInt32(t);let n=this.readInt32(t);t+=4;let i=this.bytes_.subarray(t,t+n);return r===Dm.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(t,r){return typeof t=="string"?this.__string(r):this.__union(t,r)}__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 r=0;r<4;r++)if(t.charCodeAt(r)!=this.readInt8(this.position()+4+r))return!1;return!0}createScalarList(t,r){let n=[];for(let i=0;i<r;++i){let o=t(i);o!==null&&n.push(o)}return n}createObjList(t,r){let n=[];for(let i=0;i<r;++i){let o=t(i);o!==null&&n.push(o.unpack())}return n}};var Lo=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 r;t?r=t:r=1024,this.bb=Ar.allocate(r),this.space=r}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,r){t>this.minalign&&(this.minalign=t);let n=~(this.bb.capacity()-this.space+r)+1&t-1;for(;this.space<n+t+r;){let i=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)}pad(t){for(let r=0;r<t;r++)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,r,n){(this.force_defaults||r!=n)&&(this.addInt8(r),this.slot(t))}addFieldInt16(t,r,n){(this.force_defaults||r!=n)&&(this.addInt16(r),this.slot(t))}addFieldInt32(t,r,n){(this.force_defaults||r!=n)&&(this.addInt32(r),this.slot(t))}addFieldInt64(t,r,n){(this.force_defaults||r!==n)&&(this.addInt64(r),this.slot(t))}addFieldFloat32(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat32(r),this.slot(t))}addFieldFloat64(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat64(r),this.slot(t))}addFieldOffset(t,r,n){(this.force_defaults||r!=n)&&(this.addOffset(r),this.slot(t))}addFieldStruct(t,r,n){r!=n&&(this.nested(r),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 r=t.capacity();if(r&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=r<<1,i=Ar.allocate(n);return i.setPosition(n-r),i.bytes().set(t.bytes(),n-r),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 r=0;r<t;r++)this.vtable[r]=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(),r=this.vtable_in_use-1;for(;r>=0&&this.vtable[r]==0;r--);let n=r+1;for(;r>=0;r--)this.addInt16(this.vtable[r]!=0?t-this.vtable[r]:0);let i=2;this.addInt16(t-this.object_start);let o=(n+i)*2;this.addInt16(o);let s=0,a=this.space;t:for(r=0;r<this.vtables.length;r++){let c=this.bb.capacity()-this.vtables[r];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[r];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,r,n){let i=n?4:0;if(r){let o=r;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,r){this.finish(t,r,!0)}requiredField(t,r){let n=this.bb.capacity()-t,i=n-this.bb.readInt32(n);if(!(r<this.bb.readInt16(i)&&this.bb.readInt16(i+r)!=0))throw new TypeError("FlatBuffers: field "+r+" must be set")}startVector(t,r,n){this.notNested(),this.vector_num_elems=r,this.prep(4,t*r),this.prep(n,t*r)}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 r=this.createString(t);return this.string_maps.set(t,r),r}createString(t){if(t==null)return 0;let r;t instanceof Uint8Array?r=t:r=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,r.length,1),this.bb.setPosition(this.space-=r.length);for(let n=0,i=this.space,o=this.bb.bytes();n<r.length;n++)o[i++]=r[n];return this.endVector()}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let r=[];for(let n=0;n<t.length;++n){let i=t[n];if(i!==null)r.push(this.createObjectOffset(i));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return r}createStructOffsetList(t,r){return r(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var Bm;(function(e){e[e.BUFFER=0]="BUFFER"})(Bm||(Bm={}));var Om;(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(Om||(Om={}));var t_=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBodyCompression(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,r){return t.setPosition(t.position()+4),(r||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):Om.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Bm.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,r){t.addFieldInt8(0,r,Om.LZ4_FRAME)}static addMethod(t,r){t.addFieldInt8(1,r,Bm.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,r,n){return e.startBodyCompression(t),e.addCodec(t,r),e.addMethod(t,n),e.endBodyCompression(t)}};var Bd=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,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,r,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(r??0)),t.offset()}};var Od=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,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,r,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(r??0)),t.offset()}};var Ei=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsRecordBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,r){return t.setPosition(t.position()+4),(r||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,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new Od).__init(this.bb.__vector(this.bb_pos+n)+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,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Bd).__init(this.bb.__vector(this.bb_pos+n)+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 r=this.bb.__offset(this.bb_pos,10);return r?(t||new t_).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addNodes(t,r){t.addFieldOffset(1,r,0)}static startNodesVector(t,r){t.startVector(16,r,8)}static addBuffers(t,r){t.addFieldOffset(2,r,0)}static startBuffersVector(t,r){t.startVector(16,r,8)}static addCompression(t,r){t.addFieldOffset(3,r,0)}static endRecordBatch(t){return t.endObject()}};var Ba=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,r){return t.setPosition(t.position()+4),(r||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 r=this.bb.__offset(this.bb_pos,6);return r?(t||new Ei).__init(this.bb.__indirect(this.bb_pos+r),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,r){t.addFieldInt64(0,r,BigInt("0"))}static addData(t,r){t.addFieldOffset(1,r,0)}static addIsDelta(t,r){t.addFieldInt8(2,+r,0)}static endDictionaryBatch(t){return t.endObject()}};var yl;(function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"})(yl||(yl={}));var Nm;(function(e){e[e.DenseArray=0]="DenseArray"})(Nm||(Nm={}));var Ro=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInt(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,r){return t.setPosition(t.position()+4),(r||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,r){t.addFieldInt32(0,r,0)}static addIsSigned(t,r){t.addFieldInt8(1,+r,0)}static endInt(t){return t.endObject()}static createInt(t,r,n){return e.startInt(t),e.addBitWidth(t,r),e.addIsSigned(t,n),e.endInt(t)}};var Ms=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryEncoding(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,r){return t.setPosition(t.position()+4),(r||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 r=this.bb.__offset(this.bb_pos,6);return r?(t||new Ro).__init(this.bb.__indirect(this.bb_pos+r),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):Nm.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addIndexType(t,r){t.addFieldOffset(1,r,0)}static addIsOrdered(t,r){t.addFieldInt8(2,+r,0)}static addDictionaryKind(t,r){t.addFieldInt16(3,r,Nm.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var zr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsKeyValue(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}key(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}value(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,r){t.addFieldOffset(0,r,0)}static addValue(t,r){t.addFieldOffset(1,r,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,r,n){return e.startKeyValue(t),e.addKey(t,r),e.addValue(t,n),e.endKeyValue(t)}};var Fm=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,r){return t.setPosition(t.position()+4),(r||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 Lm=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBool(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,r){return t.setPosition(t.position()+4),(r||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 gl=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDate(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,r){return t.setPosition(t.position()+4),(r||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):Tr.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,Tr.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,r){return e.startDate(t),e.addUnit(t,r),e.endDate(t)}};var Es=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDecimal(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,r){return t.setPosition(t.position()+4),(r||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,r){t.addFieldInt32(0,r,0)}static addScale(t,r){t.addFieldInt32(1,r,0)}static addBitWidth(t,r){t.addFieldInt32(2,r,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,r,n,i){return e.startDecimal(t),e.addPrecision(t,r),e.addScale(t,n),e.addBitWidth(t,i),e.endDecimal(t)}};var bl=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDuration(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,r){return t.setPosition(t.position()+4),(r||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):ft.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,ft.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,r){return e.startDuration(t),e.addUnit(t,r),e.endDuration(t)}};var xl=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,r){return t.setPosition(t.position()+4),(r||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,r){t.addFieldInt32(0,r,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,r){return e.startFixedSizeBinary(t),e.addByteWidth(t,r),e.endFixedSizeBinary(t)}};var _l=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,r){return t.setPosition(t.position()+4),(r||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,r){t.addFieldInt32(0,r,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,r){return e.startFixedSizeList(t),e.addListSize(t,r),e.endFixedSizeList(t)}};var wl=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFloatingPoint(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,r){return t.setPosition(t.position()+4),(r||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):Le.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,r){t.addFieldInt16(0,r,Le.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,r){return e.startFloatingPoint(t),e.addPrecision(t,r),e.endFloatingPoint(t)}};var vl=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInterval(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,r){return t.setPosition(t.position()+4),(r||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):Wr.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,Wr.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,r){return e.startInterval(t),e.addUnit(t,r),e.endInterval(t)}};var Rm=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,r){return t.setPosition(t.position()+4),(r||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 km=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,r){return t.setPosition(t.position()+4),(r||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 Cm=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,r){return t.setPosition(t.position()+4),(r||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 Sl=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMap(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,r){return t.setPosition(t.position()+4),(r||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,r){t.addFieldInt8(0,+r,0)}static endMap(t){return t.endObject()}static createMap(t,r){return e.startMap(t),e.addKeysSorted(t,r),e.endMap(t)}};var Um=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsNull(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,r){return t.setPosition(t.position()+4),(r||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 Pm=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsStruct_(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,r){return t.setPosition(t.position()+4),(r||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 Oa=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTime(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,r){return t.setPosition(t.position()+4),(r||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):ft.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,r){t.addFieldInt16(0,r,ft.MILLISECOND)}static addBitWidth(t,r){t.addFieldInt32(1,r,32)}static endTime(t){return t.endObject()}static createTime(t,r,n){return e.startTime(t),e.addUnit(t,r),e.addBitWidth(t,n),e.endTime(t)}};var Na=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTimestamp(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,r){return t.setPosition(t.position()+4),(r||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):ft.SECOND}timezone(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,r){t.addFieldInt16(0,r,ft.SECOND)}static addTimezone(t,r){t.addFieldOffset(1,r,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,r,n){return e.startTimestamp(t),e.addUnit(t,r),e.addTimezone(t,n),e.endTimestamp(t)}};var ko=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUnion(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,r){return t.setPosition(t.position()+4),(r||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):Ue.Sparse}typeIds(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readInt32(this.bb.__vector(this.bb_pos+r)+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,r){t.addFieldInt16(0,r,Ue.Sparse)}static addTypeIds(t,r){t.addFieldOffset(1,r,0)}static createTypeIdsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addInt32(r[n]);return t.endVector()}static startTypeIdsVector(t,r){t.startVector(4,r,4)}static endUnion(t){return t.endObject()}static createUnion(t,r,n){return e.startUnion(t),e.addMode(t,r),e.addTypeIds(t,n),e.endUnion(t)}};var $m=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,r){return t.setPosition(t.position()+4),(r||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 Re;(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"})(Re||(Re={}));var Tn=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsField(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}name(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,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):Re.NONE}type(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(t,this.bb_pos+r):null}dictionary(t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new Ms).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(t,r){let n=this.bb.__offset(this.bb_pos,14);return n?(r||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,r){let n=this.bb.__offset(this.bb_pos,16);return n?(r||new zr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,r){t.addFieldOffset(0,r,0)}static addNullable(t,r){t.addFieldInt8(1,+r,0)}static addTypeType(t,r){t.addFieldInt8(2,r,Re.NONE)}static addType(t,r){t.addFieldOffset(3,r,0)}static addDictionary(t,r){t.addFieldOffset(4,r,0)}static addChildren(t,r){t.addFieldOffset(5,r,0)}static createChildrenVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startChildrenVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(6,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endField(t){return t.endObject()}};var ci=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsSchema(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,r){return t.setPosition(t.position()+4),(r||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):yl.Little}fields(t,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new Tn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new zr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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 r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+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,r){t.addFieldInt16(0,r,yl.Little)}static addFields(t,r){t.addFieldOffset(1,r,0)}static createFieldsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startFieldsVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(2,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static addFeatures(t,r){t.addFieldOffset(3,r,0)}static createFeaturesVector(t,r){t.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)t.addInt64(r[n]);return t.endVector()}static startFeaturesVector(t,r){t.startVector(8,r,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,r){t.finish(r)}static finishSizePrefixedSchemaBuffer(t,r){t.finish(r,void 0,!0)}static createSchema(t,r,n,i,o){return e.startSchema(t),e.addEndianness(t,r),e.addFields(t,n),e.addCustomMetadata(t,i),e.addFeatures(t,o),e.endSchema(t)}};var oe;(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"})(oe||(oe={}));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.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"})(F||(F={}));var Co;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(Co||(Co={}));var MA={};Ir(MA,{clampIndex:()=>EH,clampRange:()=>qm,createElementComparator:()=>Al});var lA={};Ir(lA,{valueToString:()=>Uo});function Uo(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=>Uo(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,r)=>typeof r=="bigint"?`${r}`:r)}var fA={};Ir(fA,{BN:()=>Vm,bigNumToBigInt:()=>uk,bigNumToString:()=>Ld,isArrowBigNumSymbol:()=>ck});var ck=Symbol.for("isArrowBigNum");function Po(e,...t){return t.length===0?Object.setPrototypeOf(te(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}Po.prototype[ck]=!0;Po.prototype.toJSON=function(){return`"${Ld(this)}"`};Po.prototype.valueOf=function(){return lk(this)};Po.prototype.toString=function(){return Ld(this)};Po.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return lk(this);case"string":return Ld(this);case"default":return uk(this)}return Ld(this)};function Nd(...e){return Po.apply(this,e)}function Fd(...e){return Po.apply(this,e)}function zm(...e){return Po.apply(this,e)}Object.setPrototypeOf(Nd.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Fd.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(zm.prototype,Object.create(Uint32Array.prototype));Object.assign(Nd.prototype,Po.prototype,{constructor:Nd,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Fd.prototype,Po.prototype,{constructor:Fd,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(zm.prototype,Po.prototype,{constructor:zm,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});function lk(e){let{buffer:t,byteOffset:r,length:n,signed:i}=e,o=new BigUint64Array(t,r,n),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 Ld=e=>{if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return uA(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return uA(e);t=t.slice();let n=1;for(let o=0;o<t.length;o++){let s=t[o],a=~s+n;t[o]=a,n&=s===0?1:0}return`-${uA(t)}`},uk=e=>e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:Ld(e);function uA(e){let t="",r=new Uint32Array(2),n=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),o=-1,s=n.length-1;do{for(r[0]=n[o=0];o<s;)n[o++]=r[1]=r[0]/10,r[0]=(r[0]-r[1]*10<<16)+n[o];n[o]=r[1]=r[0]/10,r[0]=r[0]-r[1]*10,t=`${r[0]}${t}`}while(i[0]||i[1]||i[2]||i[3]);return t??"0"}var Vm=class e{static new(t,r){switch(r){case!0:return new Nd(t);case!1:return new Fd(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Nd(t)}return t.byteLength===16?new zm(t):new Fd(t)}static signed(t){return new Nd(t)}static unsigned(t){return new Fd(t)}static decimal(t){return new zm(t)}constructor(t,r){return e.new(t,r)}};function or(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 fk,dk,hk,pk,mk,yk,gk,bk,xk,_k,wk,vk,Sk,Ik,Tk,Ak,Mk,Ek,Dk,Bk,Ok,Nk,lt=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 isLargeBinary(t){return t?.typeId===F.LargeBinary}static isUtf8(t){return t?.typeId===F.Utf8}static isLargeUtf8(t){return t?.typeId===F.LargeUtf8}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===Ue.Dense}static isSparseUnion(t){return e.isUnion(t)&&t.mode===Ue.Sparse}constructor(t){this.typeId=t}};fk=Symbol.toStringTag;lt[fk]=(e=>(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]="DataType"))(lt.prototype);var Un=class extends lt{constructor(){super(F.Null)}toString(){return"Null"}};dk=Symbol.toStringTag;Un[dk]=(e=>e[Symbol.toStringTag]="Null")(Un.prototype);var br=class extends lt{constructor(t,r){super(F.Int),this.isSigned=t,this.bitWidth=r}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}`}};hk=Symbol.toStringTag;br[hk]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(br.prototype);var e_=class extends br{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},r_=class extends br{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Ds=class extends br{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},n_=class extends br{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},i_=class extends br{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},o_=class extends br{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},s_=class extends br{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},a_=class extends br{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(e_.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(r_.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Ds.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(n_.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(i_.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(o_.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(s_.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(a_.prototype,"ArrayType",{value:BigUint64Array});var li=class extends lt{constructor(t){super(F.Float),this.precision=t}get ArrayType(){switch(this.precision){case Le.HALF:return Uint16Array;case Le.SINGLE:return Float32Array;case Le.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};pk=Symbol.toStringTag;li[pk]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(li.prototype);var c_=class extends li{constructor(){super(Le.HALF)}},l_=class extends li{constructor(){super(Le.SINGLE)}},u_=class extends li{constructor(){super(Le.DOUBLE)}};Object.defineProperty(c_.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(l_.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(u_.prototype,"ArrayType",{value:Float64Array});var Fa=class extends lt{constructor(){super(F.Binary)}toString(){return"Binary"}};mk=Symbol.toStringTag;Fa[mk]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(Fa.prototype);var La=class extends lt{constructor(){super(F.LargeBinary)}toString(){return"LargeBinary"}};yk=Symbol.toStringTag;La[yk]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeBinary"))(La.prototype);var Ra=class extends lt{constructor(){super(F.Utf8)}toString(){return"Utf8"}};gk=Symbol.toStringTag;Ra[gk]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(Ra.prototype);var ka=class extends lt{constructor(){super(F.LargeUtf8)}toString(){return"LargeUtf8"}};bk=Symbol.toStringTag;ka[bk]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeUtf8"))(ka.prototype);var Ca=class extends lt{constructor(){super(F.Bool)}toString(){return"Bool"}};xk=Symbol.toStringTag;Ca[xk]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(Ca.prototype);var Ua=class extends lt{constructor(t,r,n=128){super(F.Decimal),this.scale=t,this.precision=r,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};_k=Symbol.toStringTag;Ua[_k]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(Ua.prototype);var Pa=class extends lt{constructor(t){super(F.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Tr[this.unit]}>`}};wk=Symbol.toStringTag;Pa[wk]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Date"))(Pa.prototype);var $o=class extends lt{constructor(t,r){super(F.Time),this.unit=t,this.bitWidth=r}toString(){return`Time${this.bitWidth}<${ft[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};vk=Symbol.toStringTag;$o[vk]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))($o.prototype);var $a=class extends lt{constructor(t,r){super(F.Timestamp),this.unit=t,this.timezone=r}toString(){return`Timestamp<${ft[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};Sk=Symbol.toStringTag;$a[Sk]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Timestamp"))($a.prototype);var za=class extends lt{constructor(t){super(F.Interval),this.unit=t}toString(){return`Interval<${Wr[this.unit]}>`}};Ik=Symbol.toStringTag;za[Ik]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(za.prototype);var Va=class extends lt{constructor(t){super(F.Duration),this.unit=t}toString(){return`Duration<${ft[this.unit]}>`}};Tk=Symbol.toStringTag;Va[Tk]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(Va.prototype);var zo=class extends lt{constructor(t){super(F.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}};Ak=Symbol.toStringTag;zo[Ak]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(zo.prototype);var ze=class extends lt{constructor(t){super(F.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};Mk=Symbol.toStringTag;ze[Mk]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(ze.prototype);var Vo=class extends lt{constructor(t,r,n){super(F.Union),this.mode=t,this.children=n,this.typeIds=r=Int32Array.from(r),this.typeIdToChildIndex=r.reduce((i,o,s)=>(i[o]=s)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};Ek=Symbol.toStringTag;Vo[Ek]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(Vo.prototype);var ja=class extends lt{constructor(t){super(F.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Dk=Symbol.toStringTag;ja[Dk]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(ja.prototype);var jo=class extends lt{constructor(t,r){super(F.FixedSizeList),this.listSize=t,this.children=[r]}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}>`}};Bk=Symbol.toStringTag;jo[Bk]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(jo.prototype);var qo=class extends lt{constructor(t,r=!1){var n,i,o;if(super(F.Map),this.children=[t],this.keysSorted=r,t&&(t.name="entries",!((n=t?.type)===null||n===void 0)&&n.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(", ")}}>`}};Ok=Symbol.toStringTag;qo[Ok]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(qo.prototype);var VX=(e=>()=>++e)(-1),Di=class extends lt{constructor(t,r,n,i){super(F.Dictionary),this.indices=r,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?VX():or(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};Nk=Symbol.toStringTag;Di[Nk]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(Di.prototype);function Bi(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 xt=class{visitMany(t,...r){return t.map((n,i)=>this.visit(n,...r.map(o=>o[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,r=!0){return jX(this,t,r)}getVisitFnByTypeId(t,r=!0){return Rd(this,t,r)}visitNull(t,...r){return null}visitBool(t,...r){return null}visitInt(t,...r){return null}visitFloat(t,...r){return null}visitUtf8(t,...r){return null}visitLargeUtf8(t,...r){return null}visitBinary(t,...r){return null}visitLargeBinary(t,...r){return null}visitFixedSizeBinary(t,...r){return null}visitDate(t,...r){return null}visitTimestamp(t,...r){return null}visitTime(t,...r){return null}visitDecimal(t,...r){return null}visitList(t,...r){return null}visitStruct(t,...r){return null}visitUnion(t,...r){return null}visitDictionary(t,...r){return null}visitInterval(t,...r){return null}visitDuration(t,...r){return null}visitFixedSizeList(t,...r){return null}visitMap(t,...r){return null}};function jX(e,t,r=!0){return typeof t=="number"?Rd(e,t,r):typeof t=="string"&&t in F?Rd(e,F[t],r):t&&t instanceof lt?Rd(e,Fk(t),r):t?.type&&t.type instanceof lt?Rd(e,Fk(t.type),r):Rd(e,F.NONE,r)}function Rd(e,t,r=!0){let n=null;switch(t){case F.Null:n=e.visitNull;break;case F.Bool:n=e.visitBool;break;case F.Int:n=e.visitInt;break;case F.Int8:n=e.visitInt8||e.visitInt;break;case F.Int16:n=e.visitInt16||e.visitInt;break;case F.Int32:n=e.visitInt32||e.visitInt;break;case F.Int64:n=e.visitInt64||e.visitInt;break;case F.Uint8:n=e.visitUint8||e.visitInt;break;case F.Uint16:n=e.visitUint16||e.visitInt;break;case F.Uint32:n=e.visitUint32||e.visitInt;break;case F.Uint64:n=e.visitUint64||e.visitInt;break;case F.Float:n=e.visitFloat;break;case F.Float16:n=e.visitFloat16||e.visitFloat;break;case F.Float32:n=e.visitFloat32||e.visitFloat;break;case F.Float64:n=e.visitFloat64||e.visitFloat;break;case F.Utf8:n=e.visitUtf8;break;case F.LargeUtf8:n=e.visitLargeUtf8;break;case F.Binary:n=e.visitBinary;break;case F.LargeBinary:n=e.visitLargeBinary;break;case F.FixedSizeBinary:n=e.visitFixedSizeBinary;break;case F.Date:n=e.visitDate;break;case F.DateDay:n=e.visitDateDay||e.visitDate;break;case F.DateMillisecond:n=e.visitDateMillisecond||e.visitDate;break;case F.Timestamp:n=e.visitTimestamp;break;case F.TimestampSecond:n=e.visitTimestampSecond||e.visitTimestamp;break;case F.TimestampMillisecond:n=e.visitTimestampMillisecond||e.visitTimestamp;break;case F.TimestampMicrosecond:n=e.visitTimestampMicrosecond||e.visitTimestamp;break;case F.TimestampNanosecond:n=e.visitTimestampNanosecond||e.visitTimestamp;break;case F.Time:n=e.visitTime;break;case F.TimeSecond:n=e.visitTimeSecond||e.visitTime;break;case F.TimeMillisecond:n=e.visitTimeMillisecond||e.visitTime;break;case F.TimeMicrosecond:n=e.visitTimeMicrosecond||e.visitTime;break;case F.TimeNanosecond:n=e.visitTimeNanosecond||e.visitTime;break;case F.Decimal:n=e.visitDecimal;break;case F.List:n=e.visitList;break;case F.Struct:n=e.visitStruct;break;case F.Union:n=e.visitUnion;break;case F.DenseUnion:n=e.visitDenseUnion||e.visitUnion;break;case F.SparseUnion:n=e.visitSparseUnion||e.visitUnion;break;case F.Dictionary:n=e.visitDictionary;break;case F.Interval:n=e.visitInterval;break;case F.IntervalDayTime:n=e.visitIntervalDayTime||e.visitInterval;break;case F.IntervalYearMonth:n=e.visitIntervalYearMonth||e.visitInterval;break;case F.Duration:n=e.visitDuration;break;case F.DurationSecond:n=e.visitDurationSecond||e.visitDuration;break;case F.DurationMillisecond:n=e.visitDurationMillisecond||e.visitDuration;break;case F.DurationMicrosecond:n=e.visitDurationMicrosecond||e.visitDuration;break;case F.DurationNanosecond:n=e.visitDurationNanosecond||e.visitDuration;break;case F.FixedSizeList:n=e.visitFixedSizeList;break;case F.Map:n=e.visitMap;break}if(typeof n=="function")return n;if(!r)return()=>null;throw new Error(`Unrecognized type '${F[t]}'`)}function Fk(e){switch(e.typeId){case F.Null:return F.Null;case F.Int:{let{bitWidth:t,isSigned:r}=e;switch(t){case 8:return r?F.Int8:F.Uint8;case 16:return r?F.Int16:F.Uint16;case 32:return r?F.Int32:F.Uint32;case 64:return r?F.Int64:F.Uint64}return F.Int}case F.Float:switch(e.precision){case Le.HALF:return F.Float16;case Le.SINGLE:return F.Float32;case Le.DOUBLE:return F.Float64}return F.Float;case F.Binary:return F.Binary;case F.LargeBinary:return F.LargeBinary;case F.Utf8:return F.Utf8;case F.LargeUtf8:return F.LargeUtf8;case F.Bool:return F.Bool;case F.Decimal:return F.Decimal;case F.Time:switch(e.unit){case ft.SECOND:return F.TimeSecond;case ft.MILLISECOND:return F.TimeMillisecond;case ft.MICROSECOND:return F.TimeMicrosecond;case ft.NANOSECOND:return F.TimeNanosecond}return F.Time;case F.Timestamp:switch(e.unit){case ft.SECOND:return F.TimestampSecond;case ft.MILLISECOND:return F.TimestampMillisecond;case ft.MICROSECOND:return F.TimestampMicrosecond;case ft.NANOSECOND:return F.TimestampNanosecond}return F.Timestamp;case F.Date:switch(e.unit){case Tr.DAY:return F.DateDay;case Tr.MILLISECOND:return F.DateMillisecond}return F.Date;case F.Interval:switch(e.unit){case Wr.DAY_TIME:return F.IntervalDayTime;case Wr.YEAR_MONTH:return F.IntervalYearMonth}return F.Interval;case F.Duration:switch(e.unit){case ft.SECOND:return F.DurationSecond;case ft.MILLISECOND:return F.DurationMillisecond;case ft.MICROSECOND:return F.DurationMicrosecond;case ft.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 Ue.Dense:return F.DenseUnion;case Ue.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]}'`)}xt.prototype.visitInt8=null;xt.prototype.visitInt16=null;xt.prototype.visitInt32=null;xt.prototype.visitInt64=null;xt.prototype.visitUint8=null;xt.prototype.visitUint16=null;xt.prototype.visitUint32=null;xt.prototype.visitUint64=null;xt.prototype.visitFloat16=null;xt.prototype.visitFloat32=null;xt.prototype.visitFloat64=null;xt.prototype.visitDateDay=null;xt.prototype.visitDateMillisecond=null;xt.prototype.visitTimestampSecond=null;xt.prototype.visitTimestampMillisecond=null;xt.prototype.visitTimestampMicrosecond=null;xt.prototype.visitTimestampNanosecond=null;xt.prototype.visitTimeSecond=null;xt.prototype.visitTimeMillisecond=null;xt.prototype.visitTimeMicrosecond=null;xt.prototype.visitTimeNanosecond=null;xt.prototype.visitDenseUnion=null;xt.prototype.visitSparseUnion=null;xt.prototype.visitIntervalDayTime=null;xt.prototype.visitIntervalYearMonth=null;xt.prototype.visitDuration=null;xt.prototype.visitDurationSecond=null;xt.prototype.visitDurationMillisecond=null;xt.prototype.visitDurationMicrosecond=null;xt.prototype.visitDurationNanosecond=null;var dA={};Ir(dA,{float64ToUint16:()=>jm,uint16ToFloat64:()=>f_});var Lk=new Float64Array(1),kd=new Uint32Array(Lk.buffer);function f_(e){let t=(e&31744)>>10,r=(e&1023)/1024,n=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return n*(r?Number.NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*Math.pow(2,t-15)*(1+r)}function jm(e){if(e!==e)return 32256;Lk[0]=e;let t=(kd[1]&2147483648)>>16&65535,r=kd[1]&2146435072,n=0;return r>=1089470464?kd[0]>0?r=31744:(r=(r&2080374784)>>16,n=(kd[1]&1048575)>>10):r<=1056964608?(n=1048576+(kd[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(kd[1]&1048575)+512>>10),t|r|n&65535}var At=class extends xt{};function Ut(e){return(t,r,n)=>{if(t.setValid(r,n!=null))return e(t,r,n)}}var qX=(e,t,r)=>{e[t]=Math.trunc(r/864e5)},hA=(e,t,r)=>{e[t]=Math.trunc(r%4294967296),e[t+1]=Math.trunc(r/4294967296)},YX=(e,t,r)=>{e[t]=Math.trunc(r*1e3%4294967296),e[t+1]=Math.trunc(r*1e3/4294967296)},WX=(e,t,r)=>{e[t]=Math.trunc(r*1e6%4294967296),e[t+1]=Math.trunc(r*1e6/4294967296)},Rk=(e,t,r,n)=>{if(r+1<t.length){let i=or(t[r]),o=or(t[r+1]);e.set(n.subarray(0,o-i),i)}},GX=({offset:e,values:t},r,n)=>{let i=e+r;n?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},qa=({values:e},t,r)=>{e[t]=r},pA=({values:e},t,r)=>{e[t]=r},kk=({values:e},t,r)=>{e[t]=jm(r)},XX=(e,t,r)=>{switch(e.type.precision){case Le.HALF:return kk(e,t,r);case Le.SINGLE:case Le.DOUBLE:return pA(e,t,r)}},d_=({values:e},t,r)=>{qX(e,t,r.valueOf())},h_=({values:e},t,r)=>{hA(e,t*2,r.valueOf())},mA=({stride:e,values:t},r,n)=>{t.set(n.subarray(0,e),e*r)},Ck=({values:e,valueOffsets:t},r,n)=>Rk(e,t,r,n),Uk=({values:e,valueOffsets:t},r,n)=>Rk(e,t,r,Is(n)),yA=(e,t,r)=>{e.type.unit===Tr.DAY?d_(e,t,r):h_(e,t,r)},p_=({values:e},t,r)=>hA(e,t*2,r/1e3),m_=({values:e},t,r)=>hA(e,t*2,r),y_=({values:e},t,r)=>YX(e,t*2,r),g_=({values:e},t,r)=>WX(e,t*2,r),gA=(e,t,r)=>{switch(e.type.unit){case ft.SECOND:return p_(e,t,r);case ft.MILLISECOND:return m_(e,t,r);case ft.MICROSECOND:return y_(e,t,r);case ft.NANOSECOND:return g_(e,t,r)}},b_=({values:e},t,r)=>{e[t]=r},x_=({values:e},t,r)=>{e[t]=r},__=({values:e},t,r)=>{e[t]=r},w_=({values:e},t,r)=>{e[t]=r},bA=(e,t,r)=>{switch(e.type.unit){case ft.SECOND:return b_(e,t,r);case ft.MILLISECOND:return x_(e,t,r);case ft.MICROSECOND:return __(e,t,r);case ft.NANOSECOND:return w_(e,t,r)}},xA=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},HX=(e,t,r)=>{let n=e.children[0],i=e.valueOffsets,o=sn.getVisitFn(n);if(Array.isArray(r))for(let s=-1,a=i[t],c=i[t+1];a<c;)o(n,a++,r[++s]);else for(let s=-1,a=i[t],c=i[t+1];a<c;)o(n,a++,r.get(++s))},ZX=(e,t,r)=>{let n=e.children[0],{valueOffsets:i}=e,o=sn.getVisitFn(n),{[t]:s,[t+1]:a}=i,c=r instanceof Map?r.entries():Object.entries(r);for(let l of c)if(o(n,s,l),++s>=a)break},KX=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[o]),QX=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(o)),JX=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(i.name)),tH=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[i.name]),eH=(e,t,r)=>{let n=e.type.children.map(o=>sn.getVisitFn(o.type)),i=r instanceof Map?JX(t,r):r instanceof le?QX(t,r):Array.isArray(r)?KX(t,r):tH(t,r);e.type.children.forEach((o,s)=>i(n[s],e.children[s],o,s))},rH=(e,t,r)=>{e.type.mode===Ue.Dense?Pk(e,t,r):$k(e,t,r)},Pk=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];sn.visit(i,e.valueOffsets[t],r)},$k=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];sn.visit(i,t,r)},nH=(e,t,r)=>{var n;(n=e.dictionary)===null||n===void 0||n.set(e.values[t],r)},_A=(e,t,r)=>{e.type.unit===Wr.DAY_TIME?v_(e,t,r):S_(e,t,r)},v_=({values:e},t,r)=>{e.set(r.subarray(0,2),2*t)},S_=({values:e},t,r)=>{e[t]=r[0]*12+r[1]%12},I_=({values:e},t,r)=>{e[t]=r},T_=({values:e},t,r)=>{e[t]=r},A_=({values:e},t,r)=>{e[t]=r},M_=({values:e},t,r)=>{e[t]=r},wA=(e,t,r)=>{switch(e.type.unit){case ft.SECOND:return I_(e,t,r);case ft.MILLISECOND:return T_(e,t,r);case ft.MICROSECOND:return A_(e,t,r);case ft.NANOSECOND:return M_(e,t,r)}},iH=(e,t,r)=>{let{stride:n}=e,i=e.children[0],o=sn.getVisitFn(i);if(Array.isArray(r))for(let s=-1,a=t*n;++s<n;)o(i,a+s,r[s]);else for(let s=-1,a=t*n;++s<n;)o(i,a+s,r.get(s))};At.prototype.visitBool=Ut(GX);At.prototype.visitInt=Ut(qa);At.prototype.visitInt8=Ut(qa);At.prototype.visitInt16=Ut(qa);At.prototype.visitInt32=Ut(qa);At.prototype.visitInt64=Ut(qa);At.prototype.visitUint8=Ut(qa);At.prototype.visitUint16=Ut(qa);At.prototype.visitUint32=Ut(qa);At.prototype.visitUint64=Ut(qa);At.prototype.visitFloat=Ut(XX);At.prototype.visitFloat16=Ut(kk);At.prototype.visitFloat32=Ut(pA);At.prototype.visitFloat64=Ut(pA);At.prototype.visitUtf8=Ut(Uk);At.prototype.visitLargeUtf8=Ut(Uk);At.prototype.visitBinary=Ut(Ck);At.prototype.visitLargeBinary=Ut(Ck);At.prototype.visitFixedSizeBinary=Ut(mA);At.prototype.visitDate=Ut(yA);At.prototype.visitDateDay=Ut(d_);At.prototype.visitDateMillisecond=Ut(h_);At.prototype.visitTimestamp=Ut(gA);At.prototype.visitTimestampSecond=Ut(p_);At.prototype.visitTimestampMillisecond=Ut(m_);At.prototype.visitTimestampMicrosecond=Ut(y_);At.prototype.visitTimestampNanosecond=Ut(g_);At.prototype.visitTime=Ut(bA);At.prototype.visitTimeSecond=Ut(b_);At.prototype.visitTimeMillisecond=Ut(x_);At.prototype.visitTimeMicrosecond=Ut(__);At.prototype.visitTimeNanosecond=Ut(w_);At.prototype.visitDecimal=Ut(xA);At.prototype.visitList=Ut(HX);At.prototype.visitStruct=Ut(eH);At.prototype.visitUnion=Ut(rH);At.prototype.visitDenseUnion=Ut(Pk);At.prototype.visitSparseUnion=Ut($k);At.prototype.visitDictionary=Ut(nH);At.prototype.visitInterval=Ut(_A);At.prototype.visitIntervalDayTime=Ut(v_);At.prototype.visitIntervalYearMonth=Ut(S_);At.prototype.visitDuration=Ut(wA);At.prototype.visitDurationSecond=Ut(I_);At.prototype.visitDurationMillisecond=Ut(T_);At.prototype.visitDurationMicrosecond=Ut(A_);At.prototype.visitDurationNanosecond=Ut(M_);At.prototype.visitFixedSizeList=Ut(iH);At.prototype.visitMap=Ut(ZX);var sn=new At;var Yo=Symbol.for("parent"),Cd=Symbol.for("rowIndex"),Il=class{constructor(t,r){return this[Yo]=t,this[Cd]=r,new Proxy(this,new SA)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Cd],r=this[Yo],n=r.type.children,i={};for(let o=-1,s=n.length;++o<s;)i[n[o].name]=Mr.visit(r.children[o],t);return i}toString(){return`{${[...this].map(([t,r])=>`${Uo(t)}: ${Uo(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new vA(this[Yo],this[Cd])}},vA=class{constructor(t,r){this.childIndex=0,this.children=t.children,this.rowIndex=r,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,Mr.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(Il.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Yo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Cd]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var SA=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Yo].type.children.map(r=>r.name)}has(t,r){return t[Yo].type.children.findIndex(n=>n.name===r)!==-1}getOwnPropertyDescriptor(t,r){if(t[Yo].type.children.findIndex(n=>n.name===r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[Yo].type.children.findIndex(i=>i.name===r);if(n!==-1){let i=Mr.visit(t[Yo].children[n],t[Cd]);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[Yo].type.children.findIndex(o=>o.name===r);return i!==-1?(sn.visit(t[Yo].children[i],t[Cd],n),Reflect.set(t,r,n)):Reflect.has(t,r)||typeof r=="symbol"?Reflect.set(t,r,n):!1}};var _t=class extends xt{};function Lt(e){return(t,r)=>t.getValid(r)?e(t,r):null}var oH=(e,t)=>864e5*e[t],IA=(e,t)=>4294967296*e[t+1]+(e[t]>>>0),sH=(e,t)=>4294967296*(e[t+1]/1e3)+(e[t]>>>0)/1e3,aH=(e,t)=>4294967296*(e[t+1]/1e6)+(e[t]>>>0)/1e6,zk=e=>new Date(e),cH=(e,t)=>zk(oH(e,t)),lH=(e,t)=>zk(IA(e,t)),uH=(e,t)=>null,Vk=(e,t,r)=>{if(r+1>=t.length)return null;let n=or(t[r]),i=or(t[r+1]);return e.subarray(n,i)},fH=({offset:e,values:t},r)=>{let n=e+r;return(t[n>>3]&1<<n%8)!==0},jk=({values:e},t)=>cH(e,t),qk=({values:e},t)=>lH(e,t*2),Tl=({stride:e,values:t},r)=>t[e*r],dH=({stride:e,values:t},r)=>f_(t[e*r]),Yk=({values:e},t)=>e[t],hH=({stride:e,values:t},r)=>t.subarray(e*r,e*(r+1)),Wk=({values:e,valueOffsets:t},r)=>Vk(e,t,r),Gk=({values:e,valueOffsets:t},r)=>{let n=Vk(e,t,r);return n!==null?Am(n):null},pH=({values:e},t)=>e[t],mH=({type:e,values:t},r)=>e.precision!==Le.HALF?t[r]:f_(t[r]),yH=(e,t)=>e.type.unit===Tr.DAY?jk(e,t):qk(e,t),Xk=({values:e},t)=>1e3*IA(e,t*2),Hk=({values:e},t)=>IA(e,t*2),Zk=({values:e},t)=>sH(e,t*2),Kk=({values:e},t)=>aH(e,t*2),gH=(e,t)=>{switch(e.type.unit){case ft.SECOND:return Xk(e,t);case ft.MILLISECOND:return Hk(e,t);case ft.MICROSECOND:return Zk(e,t);case ft.NANOSECOND:return Kk(e,t)}},Qk=({values:e},t)=>e[t],Jk=({values:e},t)=>e[t],tC=({values:e},t)=>e[t],eC=({values:e},t)=>e[t],bH=(e,t)=>{switch(e.type.unit){case ft.SECOND:return Qk(e,t);case ft.MILLISECOND:return Jk(e,t);case ft.MICROSECOND:return tC(e,t);case ft.NANOSECOND:return eC(e,t)}},xH=({values:e,stride:t},r)=>Vm.decimal(e.subarray(t*r,t*(r+1))),_H=(e,t)=>{let{valueOffsets:r,stride:n,children:i}=e,{[t*n]:o,[t*n+1]:s}=r,c=i[0].slice(o,s-o);return new le([c])},wH=(e,t)=>{let{valueOffsets:r,children:n}=e,{[t]:i,[t+1]:o}=r,s=n[0];return new Bs(s.slice(i,o-i))},vH=(e,t)=>new Il(e,t),SH=(e,t)=>e.type.mode===Ue.Dense?rC(e,t):nC(e,t),rC=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return Mr.visit(n,e.valueOffsets[t])},nC=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return Mr.visit(n,t)},IH=(e,t)=>{var r;return(r=e.dictionary)===null||r===void 0?void 0:r.get(e.values[t])},TH=(e,t)=>e.type.unit===Wr.DAY_TIME?iC(e,t):oC(e,t),iC=({values:e},t)=>e.subarray(2*t,2*(t+1)),oC=({values:e},t)=>{let r=e[t],n=new Int32Array(2);return n[0]=Math.trunc(r/12),n[1]=Math.trunc(r%12),n},sC=({values:e},t)=>e[t],aC=({values:e},t)=>e[t],cC=({values:e},t)=>e[t],lC=({values:e},t)=>e[t],AH=(e,t)=>{switch(e.type.unit){case ft.SECOND:return sC(e,t);case ft.MILLISECOND:return aC(e,t);case ft.MICROSECOND:return cC(e,t);case ft.NANOSECOND:return lC(e,t)}},MH=(e,t)=>{let{stride:r,children:n}=e,o=n[0].slice(t*r,r);return new le([o])};_t.prototype.visitNull=Lt(uH);_t.prototype.visitBool=Lt(fH);_t.prototype.visitInt=Lt(pH);_t.prototype.visitInt8=Lt(Tl);_t.prototype.visitInt16=Lt(Tl);_t.prototype.visitInt32=Lt(Tl);_t.prototype.visitInt64=Lt(Yk);_t.prototype.visitUint8=Lt(Tl);_t.prototype.visitUint16=Lt(Tl);_t.prototype.visitUint32=Lt(Tl);_t.prototype.visitUint64=Lt(Yk);_t.prototype.visitFloat=Lt(mH);_t.prototype.visitFloat16=Lt(dH);_t.prototype.visitFloat32=Lt(Tl);_t.prototype.visitFloat64=Lt(Tl);_t.prototype.visitUtf8=Lt(Gk);_t.prototype.visitLargeUtf8=Lt(Gk);_t.prototype.visitBinary=Lt(Wk);_t.prototype.visitLargeBinary=Lt(Wk);_t.prototype.visitFixedSizeBinary=Lt(hH);_t.prototype.visitDate=Lt(yH);_t.prototype.visitDateDay=Lt(jk);_t.prototype.visitDateMillisecond=Lt(qk);_t.prototype.visitTimestamp=Lt(gH);_t.prototype.visitTimestampSecond=Lt(Xk);_t.prototype.visitTimestampMillisecond=Lt(Hk);_t.prototype.visitTimestampMicrosecond=Lt(Zk);_t.prototype.visitTimestampNanosecond=Lt(Kk);_t.prototype.visitTime=Lt(bH);_t.prototype.visitTimeSecond=Lt(Qk);_t.prototype.visitTimeMillisecond=Lt(Jk);_t.prototype.visitTimeMicrosecond=Lt(tC);_t.prototype.visitTimeNanosecond=Lt(eC);_t.prototype.visitDecimal=Lt(xH);_t.prototype.visitList=Lt(_H);_t.prototype.visitStruct=Lt(vH);_t.prototype.visitUnion=Lt(SH);_t.prototype.visitDenseUnion=Lt(rC);_t.prototype.visitSparseUnion=Lt(nC);_t.prototype.visitDictionary=Lt(IH);_t.prototype.visitInterval=Lt(TH);_t.prototype.visitIntervalDayTime=Lt(iC);_t.prototype.visitIntervalYearMonth=Lt(oC);_t.prototype.visitDuration=Lt(AH);_t.prototype.visitDurationSecond=Lt(sC);_t.prototype.visitDurationMillisecond=Lt(aC);_t.prototype.visitDurationMicrosecond=Lt(cC);_t.prototype.visitDurationNanosecond=Lt(lC);_t.prototype.visitFixedSizeList=Lt(MH);_t.prototype.visitMap=Lt(wH);var Mr=new _t;var ro=Symbol.for("keys"),Ud=Symbol.for("vals"),Bs=class{constructor(t){return this[ro]=new le([t.children[0]]).memoize(),this[Ud]=t.children[1],new Proxy(this,new AA)}[Symbol.iterator](){return new TA(this[ro],this[Ud])}get size(){return this[ro].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[ro],r=this[Ud],n={};for(let i=-1,o=t.length;++i<o;)n[t.get(i)]=Mr.visit(r,i);return n}toString(){return`{${[...this].map(([t,r])=>`${Uo(t)}: ${Uo(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},TA=class{constructor(t,r){this.keys=t,this.vals=r,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),Mr.visit(this.vals,t)]})}},AA=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[ro].toArray().map(String)}has(t,r){return t[ro].includes(r)}getOwnPropertyDescriptor(t,r){if(t[ro].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[ro].indexOf(r);if(n!==-1){let i=Mr.visit(Reflect.get(t,Ud),n);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[ro].indexOf(r);return i!==-1?(sn.visit(Reflect.get(t,Ud),i,n),Reflect.set(t,r,n)):Reflect.has(t,r)?Reflect.set(t,r,n):!1}};Object.defineProperties(Bs.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ro]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ud]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function EH(e,t,r){let n=e.length,i=t>-1?t:n+t%n;return r?r(e,i):i}var uC;function qm(e,t,r,n){let{length:i=0}=e,o=typeof t!="number"?0:t,s=typeof r!="number"?i:r;return o<0&&(o=(o%i+i)%i),s<0&&(s=(s%i+i)%i),s<o&&(uC=o,o=s,s=uC),s>i&&(s=i),n?n(e,o,s):[o,s]}var fC=e=>e!==e;function Al(e){if(typeof e!=="object"||e===null)return fC(e)?fC:r=>r===e;if(e instanceof Date){let r=e.valueOf();return n=>n instanceof Date?n.valueOf()===r:!1}return ArrayBuffer.isView(e)?r=>r?oA(e,r):!1:e instanceof Map?BH(e):Array.isArray(e)?DH(e):e instanceof le?OH(e):NH(e,!0)}function DH(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=Al(e[r]);return E_(t)}function BH(e){let t=-1,r=[];for(let n of e.values())r[++t]=Al(n);return E_(r)}function OH(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=Al(e.get(r));return E_(t)}function NH(e,t=!1){let r=Object.keys(e);if(!t&&r.length===0)return()=>!1;let n=[];for(let i=-1,o=r.length;++i<o;)n[i]=Al(e[r[i]]);return E_(n,r)}function E_(e,t){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return FH(e,r);case Map:return dC(e,r,r.keys());case Bs:case Il:case Object:case void 0:return dC(e,r,t||Object.keys(r))}return r instanceof le?LH(e,r):!1}}function FH(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++n<r;)if(!e[n](t[n]))return!1;return!0}function LH(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++n<r;)if(!e[n](t.get(n)))return!1;return!0}function dC(e,t,r){let n=r[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=n.next(),u=i.next();for(;s<a&&!l.done&&!u.done&&!c.done&&!(l.value!==u.value||!e[s](c.value));++s,l=n.next(),u=i.next(),c=o.next());return s===a&&l.done&&u.done&&c.done?!0:(n.return&&n.return(),i.return&&i.return(),o.return&&o.return(),!1)}var EA={};Ir(EA,{BitIterator:()=>ju,getBit:()=>hC,getBool:()=>B_,packBools:()=>Yu,popcnt_array:()=>pC,popcnt_bit_range:()=>Ym,popcnt_uint32:()=>D_,setBool:()=>RH,truncateBitmap:()=>qu});function B_(e,t,r,n){return(r&1<<n)!==0}function hC(e,t,r,n){return(r&1<<n)>>n}function RH(e,t,r){return r?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function qu(e,t,r){let n=r.byteLength+7&-8;if(e>0||r.byteLength<n){let i=new Uint8Array(n);return i.set(e%8===0?r.subarray(e>>3):Yu(new ju(r,e,t,null,B_)).subarray(0,n)),i}return r}function Yu(e){let t=[],r=0,n=0,i=0;for(let s of e)s&&(i|=1<<n),++n===8&&(t[r++]=i,i=n=0);(r===0||n>0)&&(t[r++]=i);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}var ju=class{constructor(t,r,n,i,o){this.bytes=t,this.length=n,this.context=i,this.get=o,this.bit=r%8,this.byteIndex=r>>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 Ym(e,t,r){if(r-t<=0)return 0;if(r-t<8){let o=0;for(let s of new ju(e,t,r-t,e,hC))o+=s;return o}let n=r>>3<<3,i=t+(t%8===0?0:8-t%8);return Ym(e,t,i)+Ym(e,n,r)+pC(e,i>>3,n-i>>3)}function pC(e,t,r){let n=0,i=Math.trunc(t),o=new DataView(e.buffer,e.byteOffset,e.byteLength),s=r===void 0?e.byteLength:i+r;for(;s-i>=4;)n+=D_(o.getUint32(i)),i+=4;for(;s-i>=2;)n+=D_(o.getUint16(i)),i+=2;for(;s-i>=1;)n+=D_(o.getUint8(i)),i+=1;return n}function D_(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 kH=-1,_e=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 lt.isSparseUnion(t)?this.children.some(r=>r.nullable):lt.isDenseUnion(t)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:r,values:n,nullBitmap:i,typeIds:o}=this;return r&&(t+=r.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),this.children.reduce((s,a)=>s+a.byteLength,t)}get nullCount(){if(lt.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,r;return t<=kH&&(r=this.nullBitmap)&&(this._nullCount=t=this.length-Ym(r,this.offset,this.offset+this.length)),t}constructor(t,r,n,i,o,s=[],a){this.type=t,this.children=s,this.dictionary=a,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(n||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=Bi(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:r}=this;if(lt.isUnion(r)){let n=r,i=this.children[n.typeIdToChildIndex[this.typeIds[t]]],o=n.mode===Ue.Dense?this.valueOffsets[t]:t;return i.getValid(o)}if(this.nullable&&this.nullCount>0){let n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(t,r){let n,{type:i}=this;if(lt.isUnion(i)){let o=i,s=this.children[o.typeIdToChildIndex[this.typeIds[t]]],a=o.mode===Ue.Dense?this.valueOffsets[t]:t;n=s.getValid(a),s.setValid(a,r)}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(qu(s,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:o,_nullCount:-1}));let f=o[u];n=(f&l)!==0,r?o[u]=f|l:o[u]=f&~l}return n!==!!r&&(this._nullCount=this.nullCount+(r?-1:1)),r}clone(t=this.type,r=this.offset,n=this.length,i=this._nullCount,o=this,s=this.children){return new e(t,r,n,i,o,s,this.dictionary)}slice(t,r){let{stride:n,typeId:i,children:o}=this,s=+(this._nullCount===0)-1,a=i===16?n:1,c=this._sliceBuffers(t,r,n,i);return this.clone(this.type,this.offset+t,r,s,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*t,a*r))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===F.Null)return this.clone(this.type,0,t,0);let{length:r,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,r>>3);i[r>>3]=(1<<r-(r&-8))-1,n>0&&i.set(qu(this.offset,r,this.nullBitmap),0);let o=this.buffers;return o[Co.VALIDITY]=i,this.clone(this.type,0,t,n+(t-r),o)}_sliceBuffers(t,r,n,i){let o,{buffers:s}=this;return(o=s[Co.TYPE])&&(s[Co.TYPE]=o.subarray(t,t+r)),(o=s[Co.OFFSET])&&(s[Co.OFFSET]=o.subarray(t,t+r+1))||(o=s[Co.DATA])&&(s[Co.DATA]=i===6?o:o.subarray(n*t,n*(t+r))),s}_sliceChildren(t,r,n){return t.map(i=>i.slice(r,n))}};_e.prototype.children=Object.freeze([]);var DA=class e extends xt{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:r,["offset"]:n=0,["length"]:i=0}=t;return new _e(r,n,i,i)}visitBool(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.nullBitmap),o=te(r.ArrayType,t.data),{["length"]:s=o.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new _e(r,n,s,a,[void 0,o,i])}visitInt(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.nullBitmap),o=te(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new _e(r,n,s,a,[void 0,o,i])}visitFloat(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.nullBitmap),o=te(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new _e(r,n,s,a,[void 0,o,i])}visitUtf8(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.data),o=Et(t.nullBitmap),s=Vu(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new _e(r,n,a,c,[s,i,o])}visitLargeUtf8(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.data),o=Et(t.nullBitmap),s=Xx(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new _e(r,n,a,c,[s,i,o])}visitBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.data),o=Et(t.nullBitmap),s=Vu(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new _e(r,n,a,c,[s,i,o])}visitLargeBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.data),o=Et(t.nullBitmap),s=Xx(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new _e(r,n,a,c,[s,i,o])}visitFixedSizeBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.nullBitmap),o=te(r.ArrayType,t.data),{["length"]:s=o.length/Bi(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new _e(r,n,s,a,[void 0,o,i])}visitDate(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.nullBitmap),o=te(r.ArrayType,t.data),{["length"]:s=o.length/Bi(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new _e(r,n,s,a,[void 0,o,i])}visitTimestamp(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.nullBitmap),o=te(r.ArrayType,t.data),{["length"]:s=o.length/Bi(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new _e(r,n,s,a,[void 0,o,i])}visitTime(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.nullBitmap),o=te(r.ArrayType,t.data),{["length"]:s=o.length/Bi(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new _e(r,n,s,a,[void 0,o,i])}visitDecimal(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.nullBitmap),o=te(r.ArrayType,t.data),{["length"]:s=o.length/Bi(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new _e(r,n,s,a,[void 0,o,i])}visitList(t){let{["type"]:r,["offset"]:n=0,["child"]:i}=t,o=Et(t.nullBitmap),s=Vu(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new _e(r,n,a,c,[s,void 0,o],[i])}visitStruct(t){let{["type"]:r,["offset"]:n=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 _e(r,n,s,a,[void 0,void 0,o],i)}visitUnion(t){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=t,o=te(r.ArrayType,t.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=t;if(lt.isSparseUnion(r))return new _e(r,n,s,a,[void 0,void 0,void 0,o],i);let c=Vu(t.valueOffsets);return new _e(r,n,s,a,[c,void 0,void 0,o],i)}visitDictionary(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.nullBitmap),o=te(r.indices.ArrayType,t.data),{["dictionary"]:s=new le([new e().visit({type:r.dictionary})])}=t,{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new _e(r,n,a,c,[void 0,o,i],[],s)}visitInterval(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.nullBitmap),o=te(r.ArrayType,t.data),{["length"]:s=o.length/Bi(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new _e(r,n,s,a,[void 0,o,i])}visitDuration(t){let{["type"]:r,["offset"]:n=0}=t,i=Et(t.nullBitmap),o=te(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new _e(r,n,s,a,[void 0,o,i])}visitFixedSizeList(t){let{["type"]:r,["offset"]:n=0,["child"]:i=new e().visit({type:r.valueType})}=t,o=Et(t.nullBitmap),{["length"]:s=i.length/Bi(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new _e(r,n,s,a,[void 0,void 0,o],[i])}visitMap(t){let{["type"]:r,["offset"]:n=0,["child"]:i=new e().visit({type:r.childType})}=t,o=Et(t.nullBitmap),s=Vu(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new _e(r,n,a,c,[s,void 0,o],[i])}},CH=new DA;function Vt(e){return CH.visit(e)}var Wm=class{constructor(t=0,r){this.numChunks=t,this.getChunkIterator=r,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 mC(e){return e.some(t=>t.nullable)}function O_(e){return e.reduce((t,r)=>t+r.nullCount,0)}function N_(e){return e.reduce((t,r,n)=>(t[n+1]=t[n]+r.length,t),new Uint32Array(e.length+1))}function F_(e,t,r,n){let i=[];for(let o=-1,s=e.length;++o<s;){let a=e[o],c=t[o],{length:l}=a;if(c>=n)break;if(r>=c+l)continue;if(c>=r&&c+l<=n){i.push(a);continue}let u=Math.max(0,r-c),f=Math.min(n-c,l);i.push(a.slice(u,f-u))}return i.length===0&&i.push(e[0].slice(0,0)),i}function BA(e,t,r,n){let i=0,o=0,s=t.length-1;do{if(i>=s-1)return r<t[s]?n(e,i,r-t[i]):null;o=i+Math.trunc((s-i)*.5),r<t[o]?s=o:i=o}while(i<s)}function Gm(e,t){return e.getValid(t)}function Pd(e){function t(r,n,i){return e(r[n],i)}return function(r){let n=this.data;return BA(n,this._offsets,r,t)}}function L_(e){let t;function r(n,i,o){return e(n[i],o,t)}return function(n,i){let o=this.data;t=i;let s=BA(o,this._offsets,n,r);return t=void 0,s}}function R_(e){let t;function r(n,i,o){let s=o,a=0,c=0;for(let l=i-1,u=n.length;++l<u;){let f=n[l];if(~(a=e(f,t,s)))return c+a;s=0,c+=f.length}return-1}return function(n,i){t=n;let o=this.data,s=typeof i!="number"?r(o,0,0):BA(o,this._offsets,i,r);return t=void 0,s}}var wt=class extends xt{};function UH(e,t){return t===null&&e.length>0?0:-1}function PH(e,t){let{nullBitmap:r}=e;if(!r||e.nullCount<=0)return-1;let n=0;for(let i of new ju(r,e.offset+(t||0),e.length,r,B_)){if(!i)return n;++n}return-1}function jt(e,t,r){if(t===void 0)return-1;if(t===null)switch(e.typeId){case F.Union:break;case F.Dictionary:break;default:return PH(e,r)}let n=Mr.getVisitFn(e),i=Al(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}function yC(e,t,r){let n=Mr.getVisitFn(e),i=Al(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}wt.prototype.visitNull=UH;wt.prototype.visitBool=jt;wt.prototype.visitInt=jt;wt.prototype.visitInt8=jt;wt.prototype.visitInt16=jt;wt.prototype.visitInt32=jt;wt.prototype.visitInt64=jt;wt.prototype.visitUint8=jt;wt.prototype.visitUint16=jt;wt.prototype.visitUint32=jt;wt.prototype.visitUint64=jt;wt.prototype.visitFloat=jt;wt.prototype.visitFloat16=jt;wt.prototype.visitFloat32=jt;wt.prototype.visitFloat64=jt;wt.prototype.visitUtf8=jt;wt.prototype.visitLargeUtf8=jt;wt.prototype.visitBinary=jt;wt.prototype.visitLargeBinary=jt;wt.prototype.visitFixedSizeBinary=jt;wt.prototype.visitDate=jt;wt.prototype.visitDateDay=jt;wt.prototype.visitDateMillisecond=jt;wt.prototype.visitTimestamp=jt;wt.prototype.visitTimestampSecond=jt;wt.prototype.visitTimestampMillisecond=jt;wt.prototype.visitTimestampMicrosecond=jt;wt.prototype.visitTimestampNanosecond=jt;wt.prototype.visitTime=jt;wt.prototype.visitTimeSecond=jt;wt.prototype.visitTimeMillisecond=jt;wt.prototype.visitTimeMicrosecond=jt;wt.prototype.visitTimeNanosecond=jt;wt.prototype.visitDecimal=jt;wt.prototype.visitList=jt;wt.prototype.visitStruct=jt;wt.prototype.visitUnion=jt;wt.prototype.visitDenseUnion=yC;wt.prototype.visitSparseUnion=yC;wt.prototype.visitDictionary=jt;wt.prototype.visitInterval=jt;wt.prototype.visitIntervalDayTime=jt;wt.prototype.visitIntervalYearMonth=jt;wt.prototype.visitDuration=jt;wt.prototype.visitDurationSecond=jt;wt.prototype.visitDurationMillisecond=jt;wt.prototype.visitDurationMicrosecond=jt;wt.prototype.visitDurationNanosecond=jt;wt.prototype.visitFixedSizeList=jt;wt.prototype.visitMap=jt;var Wu=new wt;var vt=class extends xt{};function Rt(e){let{type:t}=e;if(e.nullCount===0&&e.stride===1&&(t.typeId===F.Timestamp||t instanceof br&&t.bitWidth!==64||t instanceof $o&&t.bitWidth!==64||t instanceof li&&t.precision!==Le.HALF))return new Wm(e.data.length,n=>{let i=e.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let r=0;return new Wm(e.data.length,n=>{let o=e.data[n].length,s=e.slice(r,r+o);return r+=o,new OA(s)})}var OA=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}};vt.prototype.visitNull=Rt;vt.prototype.visitBool=Rt;vt.prototype.visitInt=Rt;vt.prototype.visitInt8=Rt;vt.prototype.visitInt16=Rt;vt.prototype.visitInt32=Rt;vt.prototype.visitInt64=Rt;vt.prototype.visitUint8=Rt;vt.prototype.visitUint16=Rt;vt.prototype.visitUint32=Rt;vt.prototype.visitUint64=Rt;vt.prototype.visitFloat=Rt;vt.prototype.visitFloat16=Rt;vt.prototype.visitFloat32=Rt;vt.prototype.visitFloat64=Rt;vt.prototype.visitUtf8=Rt;vt.prototype.visitLargeUtf8=Rt;vt.prototype.visitBinary=Rt;vt.prototype.visitLargeBinary=Rt;vt.prototype.visitFixedSizeBinary=Rt;vt.prototype.visitDate=Rt;vt.prototype.visitDateDay=Rt;vt.prototype.visitDateMillisecond=Rt;vt.prototype.visitTimestamp=Rt;vt.prototype.visitTimestampSecond=Rt;vt.prototype.visitTimestampMillisecond=Rt;vt.prototype.visitTimestampMicrosecond=Rt;vt.prototype.visitTimestampNanosecond=Rt;vt.prototype.visitTime=Rt;vt.prototype.visitTimeSecond=Rt;vt.prototype.visitTimeMillisecond=Rt;vt.prototype.visitTimeMicrosecond=Rt;vt.prototype.visitTimeNanosecond=Rt;vt.prototype.visitDecimal=Rt;vt.prototype.visitList=Rt;vt.prototype.visitStruct=Rt;vt.prototype.visitUnion=Rt;vt.prototype.visitDenseUnion=Rt;vt.prototype.visitSparseUnion=Rt;vt.prototype.visitDictionary=Rt;vt.prototype.visitInterval=Rt;vt.prototype.visitIntervalDayTime=Rt;vt.prototype.visitIntervalYearMonth=Rt;vt.prototype.visitDuration=Rt;vt.prototype.visitDurationSecond=Rt;vt.prototype.visitDurationMillisecond=Rt;vt.prototype.visitDurationMicrosecond=Rt;vt.prototype.visitDurationNanosecond=Rt;vt.prototype.visitFixedSizeList=Rt;vt.prototype.visitMap=Rt;var $d=new vt;var gC,bC={},xC={},le=class e{constructor(t){var r,n,i;let o=t[0]instanceof e?t.flatMap(a=>a.data):t;if(o.length===0||o.some(a=>!(a instanceof _e)))throw new TypeError("Vector constructor expects an Array of Data instances.");let s=(r=o[0])===null||r===void 0?void 0:r.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:l}=bC[s.typeId],u=o[0];this.isValid=f=>Gm(u,f),this.get=f=>a(u,f),this.set=(f,d)=>c(u,f,d),this.indexOf=f=>l(u,f),this._offsets=[0,u.length];break}default:Object.setPrototypeOf(this,xC[s.typeId]),this._offsets=N_(o);break}this.data=o,this.type=s,this.stride=Bi(s),this.numChildren=(i=(n=s.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,r)=>t+r.byteLength,0)}get nullable(){return mC(this.data)}get nullCount(){return O_(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,r){}indexOf(t,r){return-1}includes(t,r){return this.indexOf(t,r)>-1}[Symbol.iterator](){return $d.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(t,r){return new e(qm(this,t,r,({data:n,_offsets:i},o,s)=>F_(n,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:t,data:r,length:n,stride:i,ArrayType:o}=this;switch(t.typeId){case F.Int:case F.Float:case F.Decimal:case F.Time:case F.Timestamp:switch(r.length){case 0:return new o;case 1:return r[0].values.subarray(0,n*i);default:return r.reduce((s,{values:a,length:c})=>(s.array.set(a.subarray(0,c*i),s.offset),s.offset+=c*i,s),{array:new o(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new e(this.data.map(({children:r})=>r[t])):null}get isMemoized(){return lt.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(lt.isDictionary(this.type)){let t=new k_(this.data[0].dictionary),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return new k_(this)}unmemoize(){if(lt.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return this}};gC=Symbol.toStringTag;le[gC]=(e=>{e.type=lt.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(r=>F[r]).filter(r=>typeof r=="number"&&r!==F.NONE);for(let r of t){let n=Mr.getVisitFnByTypeId(r),i=sn.getVisitFnByTypeId(r),o=Wu.getVisitFnByTypeId(r);bC[r]={get:n,set:i,indexOf:o},xC[r]=Object.create(e,{isValid:{value:Pd(Gm)},get:{value:Pd(Mr.getVisitFnByTypeId(r))},set:{value:L_(sn.getVisitFnByTypeId(r))},indexOf:{value:R_(Wu.getVisitFnByTypeId(r))}})}return"Vector"})(le.prototype);var k_=class e extends le{constructor(t){super(t.data);let r=this.get,n=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=r.call(this,s);return o[s]=c,c}}),Object.defineProperty(this,"set",{value(s,a){n.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 le(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function _C(e){if(!e||e.length<=0)return function(i){return!0};let t="",r=e.filter(n=>n===n);return r.length>0&&(t=`
|
|
2
|
+
switch (x) {${r.map(n=>`
|
|
3
|
+
case ${$H(n)}:`).join("")}
|
|
4
4
|
return false;
|
|
5
|
-
}`),e.length!==
|
|
5
|
+
}`),e.length!==r.length&&(t=`if (x !== x) return false;
|
|
6
6
|
${t}`),new Function("x",`${t}
|
|
7
|
-
return true;`)}function wz(e){return typeof e!="bigint"?wi(e):`${wi(e)}n`}var Zw=(e,t)=>(Math.ceil(e)*t+63&-64||64)/t,vz=(e,t=0)=>e.length>=t?e.subarray(0,t):Yl(new e.constructor(t),e,0),ua=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?Zw(r*1,this.BYTES_PER_ELEMENT):Zw(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=Zw(t*this.stride,this.BYTES_PER_ELEMENT);let n=vz(this.buffer,t);return this.clear(),n}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=Yl(new this.ArrayType(t),this.buffer)}};ua.prototype.offset=0;var es=class extends ua{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}},tu=class extends es{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()}},eu=class extends es{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 _e=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=Ar(t),this._nulls=new tu,n&&n.length>0&&(this._isValid=LO(n))}toVector(){return new Vt([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 d=this.children.map(h=>h.flush());return this.clear(),Dt({type:o,length:s,nullCount:a,children:d,child:d[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}};_e.prototype.length=1;_e.prototype.stride=1;_e.prototype.children=null;_e.prototype.finished=!1;_e.prototype.nullValues=null;_e.prototype._isValid=()=>!0;var Ve=class extends _e{constructor(t){super(t),this._values=new es(new this.ArrayType(0),this.stride)}setValue(t,n){let r=this._values;return r.reserve(t-r.length+1),super.setValue(t,n)}},Ki=class extends _e{constructor(t){super(t),this._pendingLength=0,this._offsets=new eu}setValue(t,n){let r=this._pending||(this._pending=new Map),i=r.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=n instanceof Zi?n[Xr].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 Ic=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 Ji=new Int32Array(2),Ig=new Float32Array(Ji.buffer),Tg=new Float64Array(Ji.buffer),nu=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Rd;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(Rd||(Rd={}));var Nr=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 Ji[0]=this.readInt32(t),Ig[0]}readFloat64(t){return Ji[nu?0:1]=this.readInt32(t),Ji[nu?1:0]=this.readInt32(t+4),Tg[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){Ig[0]=n,this.writeInt32(t,Ji[0])}writeFloat64(t,n){Tg[0]=n,this.writeInt32(t,Ji[nu?0:1]),this.writeInt32(t+4,Ji[nu?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===Rd.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 Tc=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=Nr.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=Nr.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 en=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 fa;(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"})(fa||(fa={}));var da;(function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"})(da||(da={}));var Od;(function(e){e[e.DenseArray=0]="DenseArray"})(Od||(Od={}));var Ri=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 to=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 Ri).__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):Od.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,Od.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var Dd=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 kd=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 Fd;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(Fd||(Fd={}));var ha=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):Fd.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,Fd.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,n){return e.startDate(t),e.addUnit(t,n),e.endDate(t)}};var eo=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 Oi;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(Oi||(Oi={}));var pa=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):Oi.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,Oi.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,n){return e.startDuration(t),e.addUnit(t,n),e.endDuration(t)}};var ma=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 ya=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 Ld;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(Ld||(Ld={}));var ga=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):Ld.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,n){t.addFieldInt16(0,n,Ld.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,n){return e.startFloatingPoint(t),e.addPrecision(t,n),e.endFloatingPoint(t)}};var Cd;(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"})(Cd||(Cd={}));var ba=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):Cd.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,Cd.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,n){return e.startInterval(t),e.addUnit(t,n),e.endInterval(t)}};var Bd=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 xa=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 Pd=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 $d=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 ns=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):Oi.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,Oi.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 rs=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):Oi.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,Oi.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 Ud;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(Ud||(Ud={}));var Di=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):Ud.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,Ud.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 zd=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 ge;(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"})(ge||(ge={}));var Fn=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):ge.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 to).__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 en).__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,ge.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 hr=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):da.Little}fields(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new Fn).__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 en).__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,da.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 Rr=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):fa.V1}schema(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new hr).__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 Ic).__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 Ic).__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 en).__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,fa.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 re=class e{constructor(t=[],n,r,i=Ie.V5){this.fields=t||[],this.metadata=n||new Map,r||(r=Qw(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=Ag(Ag(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:Ag(Ag(new Map,r[c].metadata),a.metadata)}))&&!1:!0}),s=Qw(o,new Map);return new e([...r,...o],i,new Map([...this.dictionaries,...s]))}};re.prototype.fields=null;re.prototype.metadata=null;re.prototype.dictionaries=null;var $t=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)}};$t.prototype.type=null;$t.prototype.name=null;$t.prototype.nullable=null;$t.prototype.metadata=null;function Ag(e,t){return new Map([...e||new Map,...t||new Map])}function Qw(e,t=new Map){for(let n=-1,r=e.length;++n<r;){let o=e[n].type;if(at.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&&Qw(o.children,t)}return t}var Sz=Tc,Iz=Nr,is=class{static decode(t){t=new Iz(Ot(t));let n=Rr.getRootAsFooter(t),r=re.decode(n.schema(),new Map,n.version());return new Kw(r,n)}static encode(t){let n=new Sz,r=re.encode(n,t.schema);Rr.startRecordBatchesVector(n,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())os.encode(n,s);let i=n.endVector();Rr.startDictionariesVector(n,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())os.encode(n,s);let o=n.endVector();return Rr.startFooter(n),Rr.addSchema(n,r),Rr.addVersion(n,Ie.V5),Rr.addRecordBatches(n,i),Rr.addDictionaries(n,o),Rr.finishFooterBuffer(n,Rr.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 Kw=class extends is{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 os.decode(n)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let n=this._footer.dictionaries(t);if(n)return os.decode(n)}return null}},os=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 Ic.createBlock(t,i,r,o)}constructor(t,n,r){this.metaDataLength=t,this.offset=fr(r),this.bodyLength=fr(n)}};var be=Object.freeze({done:!0,value:void 0}),qd=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Ec=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())}},Mg=class extends Ec{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return Z(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(be);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return bn.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return bn.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return Z(this,void 0,void 0,function*(){return yield this.abort(t),be})}return(t){return Z(this,void 0,void 0,function*(){return yield this.close(),be})}read(t){return Z(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Z(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(be)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var no=class extends Mg{write(t){if((t=Ot(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?wd(this.toUint8Array(!0)):this.toUint8Array(!1).then(wd)}toUint8Array(t=!1){return t?Tr(this._values)[0]:Z(this,void 0,void 0,function*(){var n,r,i,o;let s=[],a=0;try{for(var c=!0,l=bi(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 Tr(s,a)[0]})}},ro=class{constructor(t){t&&(this.source=new Jw(bn.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 no?this.source=new ss(bn.fromAsyncIterable(t)):$y(t)?this.source=new ss(bn.fromNodeStream(t)):vd(t)?this.source=new ss(bn.fromDOMStream(t)):By(t)?this.source=new ss(bn.fromDOMStream(t.body)):xi(t)?this.source=new ss(bn.fromIterable(t)):Ir(t)?this.source=new ss(bn.fromAsyncIterable(t)):Gr(t)&&(this.source=new ss(bn.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)}},Jw=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)||be)}return(t){return Object.create(this.source.return&&this.source.return(t)||be)}},ss=class{constructor(t){this.source=t,this._closedPromise=new Promise(n=>this._closedPromiseResolve=n)}cancel(t){return Z(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return Z(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Z(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,n="read"){return Z(this,void 0,void 0,function*(){return yield this.source.next({cmd:n,size:t})})}throw(t){return Z(this,void 0,void 0,function*(){let n=this.source.throw&&(yield this.source.throw(t))||be;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}return(t){return Z(this,void 0,void 0,function*(){let n=this.source.return&&(yield this.source.return(t))||be;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}};var jd=class extends ro{constructor(t,n){super(),this.position=0,this.buffer=Ot(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}}},_a=class extends Zr{constructor(t,n){super(),this.position=0,this._handle=t,typeof n=="number"?this.size=n:this._pending=Z(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return Z(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 Z(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 Z(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 Z(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 Z(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return Z(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return Z(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var ev={};vr(ev,{BaseInt64:()=>Vd,Int128:()=>Yd,Int64:()=>as,Uint64:()=>Ne});function ru(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var iu=8,tv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Vd=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`${ru(this.buffer[1])} ${ru(this.buffer[0])}`}},Ne=class e extends Vd{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=iu<r-o?iu:r-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),c=new e(new Uint32Array([tv[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)}},as=class e extends Vd{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=iu<i-s?iu:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),l=new e(new Uint32Array([tv[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)}},Yd=class e{constructor(t){this.buffer=t}high(){return new as(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new as(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 Ne(new Uint32Array([this.buffer[3],0])),r=new Ne(new Uint32Array([this.buffer[2],0])),i=new Ne(new Uint32Array([this.buffer[1],0])),o=new Ne(new Uint32Array([this.buffer[0],0])),s=new Ne(new Uint32Array([t.buffer[3],0])),a=new Ne(new Uint32Array([t.buffer[2],0])),c=new Ne(new Uint32Array([t.buffer[1],0])),l=new Ne(new Uint32Array([t.buffer[0],0])),u=Ne.multiply(o,l);this.buffer[0]=u.low();let f=new Ne(new Uint32Array([u.high(),0]));return u=Ne.multiply(i,l),f.plus(u),u=Ne.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 Ne(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Ne.multiply(r,l)).plus(Ne.multiply(i,c)).plus(Ne.multiply(o,a)),this.buffer[3]+=Ne.multiply(n,l).plus(Ne.multiply(r,c)).plus(Ne.multiply(i,a)).plus(Ne.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`${ru(this.buffer[3])} ${ru(this.buffer[2])} ${ru(this.buffer[1])} ${ru(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=iu<i-s?iu:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),l=new e(new Uint32Array([tv[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 Gd=class extends ut{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 $t?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)}},Ng=class extends Gd{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):vc(this.sources[r])}readOffsets(t,{offset:n}=this.nextBufferRange()){return Pt(Uint8Array,Pt(Int32Array,this.sources[n]))}readTypeIds(t,{offset:n}=this.nextBufferRange()){return Pt(Uint8Array,Pt(t.ArrayType,this.sources[n]))}readData(t,{offset:n}=this.nextBufferRange()){let{sources:r}=this;return at.isTimestamp(t)?Pt(Uint8Array,as.convertArray(r[n])):(at.isInt(t)||at.isTime(t))&&t.bitWidth===64||at.isDuration(t)?Pt(Uint8Array,as.convertArray(r[n])):at.isDate(t)&&t.unit===xn.MILLISECOND?Pt(Uint8Array,as.convertArray(r[n])):at.isDecimal(t)?Pt(Uint8Array,Yd.convertArray(r[n])):at.isBinary(t)||at.isFixedSizeBinary(t)?Tz(r[n]):at.isBool(t)?vc(r[n]):at.isUtf8(t)?oa(r[n].join("")):Pt(Uint8Array,Pt(t.ArrayType,r[n].map(i=>+i)))}};function Tz(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 ou=class extends Ki{constructor(t){super(t),this._values=new ua(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,Ot(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 Rg=class extends _e{constructor(t){super(t),this._values=new tu}setValue(t,n){this._values.set(t,+n)}};var Ac=class extends Ve{};Ac.prototype._setValue=Fw;var Wd=class extends Ac{};Wd.prototype._setValue=Jy;var Xd=class extends Ac{};Xd.prototype._setValue=tg;var Hd=class extends Ve{};Hd.prototype._setValue=Bw;var Og=class extends _e{constructor({type:t,nullValues:n,dictionaryHashFunction:r}){super({type:new Er(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Mc({type:this.type.indices,nullValues:n}),this.dictionary=Mc({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 Zd=class extends Ve{};Zd.prototype._setValue=kw;var Dg=class extends _e{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 Ei(this.type.listSize,new $t(n,t.type,!0)),r}};var Nc=class extends Ve{setValue(t,n){this._values.set(t,n)}},kg=class extends Nc{setValue(t,n){super.setValue(t,Td(n))}},Fg=class extends Nc{},Lg=class extends Nc{};var Rc=class extends Ve{};Rc.prototype._setValue=Pw;var Qd=class extends Rc{};Qd.prototype._setValue=lg;var Kd=class extends Rc{};Kd.prototype._setValue=ug;var cs=class extends Ve{};cs.prototype._setValue=$w;var Jd=class extends cs{};Jd.prototype._setValue=fg;var th=class extends cs{};th.prototype._setValue=dg;var eh=class extends cs{};eh.prototype._setValue=hg;var nh=class extends cs{};nh.prototype._setValue=pg;var Qr=class extends Ve{setValue(t,n){this._values.set(t,n)}},Cg=class extends Qr{},Bg=class extends Qr{},Pg=class extends Qr{},$g=class extends Qr{},Ug=class extends Qr{},zg=class extends Qr{},qg=class extends Qr{},jg=class extends Qr{};var Vg=class extends Ki{constructor(t){super(t),this._offsets=new eu}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 Ii(new $t(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 Yg=class extends Ki{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 Ai(new $t(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 Gg=class extends _e{setValue(t,n){}setValid(t,n){return this.length=Math.max(t+1,this.length),n}};var Wg=class extends _e{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 $t(n,t.type,!0)]),r}};var ls=class extends Ve{};ls.prototype._setValue=Lw;var rh=class extends ls{};rh.prototype._setValue=eg;var ih=class extends ls{};ih.prototype._setValue=ng;var oh=class extends ls{};oh.prototype._setValue=rg;var sh=class extends ls{};sh.prototype._setValue=ig;var us=class extends Ve{};us.prototype._setValue=Cw;var ah=class extends us{};ah.prototype._setValue=og;var ch=class extends us{};ch.prototype._setValue=sg;var lh=class extends us{};lh.prototype._setValue=ag;var uh=class extends us{};uh.prototype._setValue=cg;var su=class extends _e{constructor(t){super(t),this._typeIds=new es(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 $t(n,t.type)];return this.type=new Ti(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.")}},Xg=class extends su{},Hg=class extends su{constructor(t){super(t),this._offsets=new es(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 fh=class extends Ki{constructor(t){super(t),this._values=new ua(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,oa(n))}_flushPending(t,n){}};fh.prototype._flushPending=ou.prototype._flushPending;var nv=class extends ut{visitNull(){return Gg}visitBool(){return Rg}visitInt(){return Qr}visitInt8(){return Cg}visitInt16(){return Bg}visitInt32(){return Pg}visitInt64(){return $g}visitUint8(){return Ug}visitUint16(){return zg}visitUint32(){return qg}visitUint64(){return jg}visitFloat(){return Nc}visitFloat16(){return kg}visitFloat32(){return Fg}visitFloat64(){return Lg}visitUtf8(){return fh}visitBinary(){return ou}visitFixedSizeBinary(){return Zd}visitDate(){return Ac}visitDateDay(){return Wd}visitDateMillisecond(){return Xd}visitTimestamp(){return ls}visitTimestampSecond(){return rh}visitTimestampMillisecond(){return ih}visitTimestampMicrosecond(){return oh}visitTimestampNanosecond(){return sh}visitTime(){return us}visitTimeSecond(){return ah}visitTimeMillisecond(){return ch}visitTimeMicrosecond(){return lh}visitTimeNanosecond(){return uh}visitDecimal(){return Hd}visitList(){return Vg}visitStruct(){return Wg}visitUnion(){return su}visitDenseUnion(){return Hg}visitSparseUnion(){return Xg}visitDictionary(){return Og}visitInterval(){return Rc}visitIntervalDayTime(){return Qd}visitIntervalYearMonth(){return Kd}visitDuration(){return cs}visitDurationSecond(){return Jd}visitDurationMillisecond(){return th}visitDurationMicrosecond(){return eh}visistDurationNanosecond(){return nh}visitFixedSizeList(){return Dg}visitMap(){return Yg}},CO=new nv;var _t=class extends ut{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 Wn(e,t){return t instanceof e.constructor}function dh(e,t){return e===t||Wn(e,t)}function fs(e,t){return e===t||Wn(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function Zg(e,t){return e===t||Wn(e,t)&&e.precision===t.precision}function Ez(e,t){return e===t||Wn(e,t)&&e.byteWidth===t.byteWidth}function rv(e,t){return e===t||Wn(e,t)&&e.unit===t.unit}function hh(e,t){return e===t||Wn(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function ph(e,t){return e===t||Wn(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function Az(e,t){return e===t||Wn(e,t)&&e.children.length===t.children.length&&io.compareManyFields(e.children,t.children)}function Mz(e,t){return e===t||Wn(e,t)&&e.children.length===t.children.length&&io.compareManyFields(e.children,t.children)}function iv(e,t){return e===t||Wn(e,t)&&e.mode===t.mode&&e.typeIds.every((n,r)=>n===t.typeIds[r])&&io.compareManyFields(e.children,t.children)}function Nz(e,t){return e===t||Wn(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&io.visit(e.indices,t.indices)&&io.visit(e.dictionary,t.dictionary)}function ov(e,t){return e===t||Wn(e,t)&&e.unit===t.unit}function mh(e,t){return e===t||Wn(e,t)&&e.unit===t.unit}function Rz(e,t){return e===t||Wn(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&io.compareManyFields(e.children,t.children)}function Oz(e,t){return e===t||Wn(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&io.compareManyFields(e.children,t.children)}_t.prototype.visitNull=dh;_t.prototype.visitBool=dh;_t.prototype.visitInt=fs;_t.prototype.visitInt8=fs;_t.prototype.visitInt16=fs;_t.prototype.visitInt32=fs;_t.prototype.visitInt64=fs;_t.prototype.visitUint8=fs;_t.prototype.visitUint16=fs;_t.prototype.visitUint32=fs;_t.prototype.visitUint64=fs;_t.prototype.visitFloat=Zg;_t.prototype.visitFloat16=Zg;_t.prototype.visitFloat32=Zg;_t.prototype.visitFloat64=Zg;_t.prototype.visitUtf8=dh;_t.prototype.visitBinary=dh;_t.prototype.visitFixedSizeBinary=Ez;_t.prototype.visitDate=rv;_t.prototype.visitDateDay=rv;_t.prototype.visitDateMillisecond=rv;_t.prototype.visitTimestamp=hh;_t.prototype.visitTimestampSecond=hh;_t.prototype.visitTimestampMillisecond=hh;_t.prototype.visitTimestampMicrosecond=hh;_t.prototype.visitTimestampNanosecond=hh;_t.prototype.visitTime=ph;_t.prototype.visitTimeSecond=ph;_t.prototype.visitTimeMillisecond=ph;_t.prototype.visitTimeMicrosecond=ph;_t.prototype.visitTimeNanosecond=ph;_t.prototype.visitDecimal=dh;_t.prototype.visitList=Az;_t.prototype.visitStruct=Mz;_t.prototype.visitUnion=iv;_t.prototype.visitDenseUnion=iv;_t.prototype.visitSparseUnion=iv;_t.prototype.visitDictionary=Nz;_t.prototype.visitInterval=ov;_t.prototype.visitIntervalDayTime=ov;_t.prototype.visitIntervalYearMonth=ov;_t.prototype.visitDuration=mh;_t.prototype.visitDurationSecond=mh;_t.prototype.visitDurationMillisecond=mh;_t.prototype.visitDurationMicrosecond=mh;_t.prototype.visitDurationNanosecond=mh;_t.prototype.visitFixedSizeList=Rz;_t.prototype.visitMap=Oz;var io=new _t;function Oc(e,t){return io.compareSchemas(e,t)}function BO(e,t){return io.compareFields(e,t)}function PO(e,t){return io.visit(e,t)}function Mc(e){let t=e.type,n=new(CO.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(Mc(Object.assign(Object.assign({},l),{type:c})))}}return n}function Qg(e,t){return Dz(e,t.map(n=>n.data.concat()))}function Dz(e,t){let n=[...e.fields],r=[],i={numBatches:t.reduce((f,d)=>Math.max(f,d.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=kz(n,s,u,t,i),s>0&&(r[o++]=Dt({type:new ye(n),length:s,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(f=>new ke(e,f))]}function kz(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 $O,sn=class e{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new re([]),this._offsets=[0],this;let i,o;t[0]instanceof re&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop());let s=c=>{if(c){if(c instanceof ke)return[c];if(c instanceof e)return c.batches;if(c instanceof se){if(c.type instanceof ye)return[new ke(new re(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(h=>new Vt([c[h]])),f=new re(l.map((h,p)=>new $t(String(h),u[p].type))),[,d]=Qg(f,u);return d.length===0?[new ke(c)]:d}}}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 re([]),!(i instanceof re))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof ke))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Oc(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??xg(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=bg(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?Jl.visit(new Vt(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
|
|
7
|
+
return true;`)}function $H(e){return typeof e!="bigint"?Uo(e):`${Uo(e)}n`}function NA(e,t){let r=Math.ceil(e)*t-1;return(r-r%64+64||64)/t}function wC(e,t=0){return e.length>=t?e.subarray(0,t):Em(new e.constructor(t),e,0)}var Wo=class{constructor(t,r=0,n=1){this.length=Math.ceil(r/n),this.buffer=new t(this.length),this.stride=n,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,r){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let r=this.stride,n=this.length*r,i=this.buffer.length;n>=i&&this._resize(i===0?NA(n*1,this.BYTES_PER_ELEMENT):NA(n*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=NA(t*this.stride,this.BYTES_PER_ELEMENT);let r=wC(this.buffer,t);return this.clear(),r}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=wC(this.buffer,t)}},Ya=class extends Wo{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,r){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=r,this}},zd=class extends Ya{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,r){let{buffer:n}=this.reserve(t-this.length+1),i=t>>3,o=t%8,s=n[i]>>o&1;return r?s===0&&(n[i]|=1<<o,++this.numValid):s===1&&(n[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},Vd=class extends Ya{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,r){let n=this.length-1,i=this.reserve(t-n+1).buffer;return n<t++&&n>=0&&i.fill(i[n],n,t),i[t]=i[t-1]+r,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 Ge=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:r}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=r,this.stride=Bi(t),this._nulls=new zd,r&&r.length>0&&(this._isValid=_C(r))}toVector(){return new le([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:r,_values:n,_nulls:i,_typeIds:o,children:s}=this;return r&&(t+=r.byteLength),n&&(t+=n.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((r,n)=>r+n.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,r){return this.setValid(t,this.isValid(r))&&this.setValue(t,r),this}setValue(t,r){this._setValue(this,t,r)}setValid(t,r){return this.length=this._nulls.set(t,+r).length,r}addChild(t,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,r,n,i,{type:o,length:s,nullCount:a,_typeIds:c,_offsets:l,_values:u,_nulls:f}=this;(r=c?.flush(s))?i=l?.flush(s):(i=l?.flush(s))?t=u?.flush(l.last()):t=u?.flush(s),a>0&&(n=f?.flush(s));let d=this.children.map(h=>h.flush());return this.clear(),Vt({type:o,length:s,nullCount:a,children:d,child:d[0],data:t,typeIds:r,nullBitmap:n,valueOffsets:i})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,r,n,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(r=this._values)===null||r===void 0||r.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(let o of this.children)o.clear();return this}};Ge.prototype.length=1;Ge.prototype.stride=1;Ge.prototype.children=null;Ge.prototype.finished=!1;Ge.prototype.nullValues=null;Ge.prototype._isValid=()=>!0;var Er=class extends Ge{constructor(t){super(t),this._values=new Ya(this.ArrayType,0,this.stride)}setValue(t,r){let n=this._values;return n.reserve(t-n.length+1),super.setValue(t,r)}},ui=class extends Ge{constructor(t){super(t),this._pendingLength=0,this._offsets=new Vd(t.type)}setValue(t,r){let n=this._pending||(this._pending=new Map),i=n.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=r instanceof Bs?r[ro].length:r.length,n.set(t,r)}setValid(t,r){return super.setValid(t,r)?!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,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,r),this}};var Gu=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,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,r,n,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(r??0)),t.offset()}};var Oi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFooter(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,r){return t.setPosition(t.position()+4),(r||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):Ee.V1}schema(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new ci).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}dictionaries(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Gu).__init(this.bb.__vector(this.bb_pos+n)+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,r){let n=this.bb.__offset(this.bb_pos,10);return n?(r||new Gu).__init(this.bb.__vector(this.bb_pos+n)+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,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new zr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,r){t.addFieldInt16(0,r,Ee.V1)}static addSchema(t,r){t.addFieldOffset(1,r,0)}static addDictionaries(t,r){t.addFieldOffset(2,r,0)}static startDictionariesVector(t,r){t.startVector(24,r,8)}static addRecordBatches(t,r){t.addFieldOffset(3,r,0)}static startRecordBatchesVector(t,r){t.startVector(24,r,8)}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,r){t.finish(r)}static finishSizePrefixedFooterBuffer(t,r){t.finish(r,void 0,!0)}};var Ie=class e{constructor(t=[],r,n,i=Ee.V5){this.fields=t||[],this.metadata=r||new Map,n||(n=FA(t)),this.dictionaries=n,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,r)=>`${r}: ${t}`).join(", ")} }>`}select(t){let r=new Set(t),n=this.fields.filter(i=>r.has(i.name));return new e(n,this.metadata)}selectAt(t){let r=t.map(n=>this.fields[n]).filter(Boolean);return new e(r,this.metadata)}assign(...t){let r=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),n=[...this.fields],i=C_(C_(new Map,this.metadata),r.metadata),o=r.fields.filter(a=>{let c=n.findIndex(l=>l.name===a.name);return~c?(n[c]=a.clone({metadata:C_(C_(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),s=FA(o,new Map);return new e([...n,...o],i,new Map([...this.dictionaries,...s]))}};Ie.prototype.fields=null;Ie.prototype.metadata=null;Ie.prototype.dictionaries=null;var re=class e{static new(...t){let[r,n,i,o]=t;return t[0]&&typeof t[0]=="object"&&({name:r}=t[0],n===void 0&&(n=t[0].type),i===void 0&&(i=t[0].nullable),o===void 0&&(o=t[0].metadata)),new e(`${r}`,n,i,o)}constructor(t,r,n=!1,i){this.name=t,this.type=r,this.nullable=n,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[r,n,i,o]=t;return!t[0]||typeof t[0]!="object"?[r=this.name,n=this.type,i=this.nullable,o=this.metadata]=t:{name:r=this.name,type:n=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=t[0],e.new(r,n,i,o)}};re.prototype.type=null;re.prototype.name=null;re.prototype.nullable=null;re.prototype.metadata=null;function C_(e,t){return new Map([...e||new Map,...t||new Map])}function FA(e,t=new Map){for(let r=-1,n=e.length;++r<n;){let o=e[r].type;if(lt.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&&FA(o.children,t)}return t}var zH=Lo,VH=Ar,Wa=class{static decode(t){t=new VH(Et(t));let r=Oi.getRootAsFooter(t),n=Ie.decode(r.schema(),new Map,r.version());return new LA(n,r)}static encode(t){let r=new zH,n=Ie.encode(r,t.schema);Oi.startRecordBatchesVector(r,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())Ga.encode(r,s);let i=r.endVector();Oi.startDictionariesVector(r,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())Ga.encode(r,s);let o=r.endVector();return Oi.startFooter(r),Oi.addSchema(r,n),Oi.addVersion(r,Ee.V5),Oi.addRecordBatches(r,i),Oi.addDictionaries(r,o),Oi.finishFooterBuffer(r,Oi.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,r=Ee.V5,n,i){this.schema=t,this.version=r,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,r=-1,n=this.numRecordBatches;++r<n;)(t=this.getRecordBatch(r))&&(yield t)}*dictionaryBatches(){for(let t,r=-1,n=this.numDictionaries;++r<n;)(t=this.getDictionaryBatch(r))&&(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 LA=class extends Wa{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,r){super(t,r.version()),this._footer=r}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let r=this._footer.recordBatches(t);if(r)return Ga.decode(r)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let r=this._footer.dictionaries(t);if(r)return Ga.decode(r)}return null}},Ga=class e{static decode(t){return new e(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,r){let{metaDataLength:n}=r,i=BigInt(r.offset),o=BigInt(r.bodyLength);return Gu.createBlock(t,i,n,o)}constructor(t,r,n){this.metaDataLength=t,this.offset=or(n),this.bodyLength=or(r)}};var Ve=Object.freeze({done:!0,value:void 0}),Xm=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Xu=class{tee(){return this._getDOMStream().tee()}pipe(t,r){return this._getNodeStream().pipe(t,r)}pipeTo(t,r){return this._getDOMStream().pipeTo(t,r)}pipeThrough(t,r){return this._getDOMStream().pipeThrough(t,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},U_=class extends Xu{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return P(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(Ve);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return on.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return on.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return P(this,void 0,void 0,function*(){return yield this.abort(t),Ve})}return(t){return P(this,void 0,void 0,function*(){return yield this.close(),Ve})}read(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return P(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((r,n)=>{this.resolvers.push({resolve:r,reject:n})}):Promise.resolve(Ve)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var Os=class extends U_{write(t){if((t=Et(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Am(this.toUint8Array(!0)):this.toUint8Array(!1).then(Am)}toUint8Array(t=!1){return t?Mi(this._values)[0]:P(this,void 0,void 0,function*(){var r,n,i,o;let s=[],a=0;try{for(var c=!0,l=fr(this),u;u=yield l.next(),r=u.done,!r;c=!0){o=u.value,c=!1;let f=o;s.push(f),a+=f.byteLength}}catch(f){n={error:f}}finally{try{!c&&!r&&(i=l.return)&&(yield i.call(l))}finally{if(n)throw n.error}}return Mi(s,a)[0]})}},Ns=class{constructor(t){t&&(this.source=new RA(on.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)}},no=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof Os?this.source=new Xa(on.fromAsyncIterable(t)):Gx(t)?this.source=new Xa(on.fromNodeStream(t)):Mm(t)?this.source=new Xa(on.fromDOMStream(t)):Yx(t)?this.source=new Xa(on.fromDOMStream(t.body)):Oo(t)?this.source=new Xa(on.fromIterable(t)):Ai(t)?this.source=new Xa(on.fromAsyncIterable(t)):to(t)&&(this.source=new Xa(on.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)}},RA=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,r="read"){return this.source.next({cmd:r,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||Ve)}return(t){return Object.create(this.source.return&&this.source.return(t)||Ve)}},Xa=class{constructor(t){this.source=t,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}cancel(t){return P(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,r="read"){return P(this,void 0,void 0,function*(){return yield this.source.next({cmd:r,size:t})})}throw(t){return P(this,void 0,void 0,function*(){let r=this.source.throw&&(yield this.source.throw(t))||Ve;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}return(t){return P(this,void 0,void 0,function*(){let r=this.source.return&&(yield this.source.return(t))||Ve;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}};var Hm=class extends Ns{constructor(t,r){super(),this.position=0,this.buffer=Et(t),this.size=r===void 0?this.buffer.byteLength:r}readInt32(t){let{buffer:r,byteOffset:n}=this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:r,size:n,position:i}=this;return r&&i<n?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,i+Math.min(n-i,t)),r.subarray(i,this.position)):null}readAt(t,r){let n=this.buffer,i=Math.min(this.size,t+r);return n?n.subarray(t,i):new Uint8Array(r)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}},Ml=class extends no{constructor(t,r){super(),this.position=0,this._handle=t,typeof r=="number"?this.size=r:this._pending=P(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return P(this,void 0,void 0,function*(){let{buffer:r,byteOffset:n}=yield this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)})}seek(t){return P(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 P(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n,position:i}=this;if(r&&i<n){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=i,s=0,a=0,c=Math.min(n,o+Math.min(n-o,t)),l=new Uint8Array(Math.max(0,(this.position=c)-o));for(;(o+=a)<c&&(s+=a)<l.byteLength;)({bytesRead:a}=yield r.read(l,s,l.byteLength-s,o));return l}return null})}readAt(t,r){return P(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&t+r<i){let o=Math.min(i,t+r),s=new Uint8Array(o-t);return(yield n.read(s,0,r,t)).buffer}return new Uint8Array(r)})}close(){return P(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return P(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return P(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var CA={};Ir(CA,{BaseInt64:()=>Zm,Int128:()=>Km,Int64:()=>Ha,Uint64:()=>sr});function jd(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var qd=8,kA=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Zm=class{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let r=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),i=r[3]*n[3];this.buffer[0]=i&65535;let o=i>>>16;return i=r[2]*n[3],o+=i,i=r[3]*n[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]+=r[1]*n[3]+r[2]*n[2]+r[3]*n[1],this.buffer[1]+=r[0]*n[3]+r[1]*n[2]+r[2]*n[1]+r[3]*n[0]<<16,this}_plus(t){let r=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],r<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=r}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`${jd(this.buffer[1])} ${jd(this.buffer[0])}`}},sr=class e extends Zm{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let n=t.length,i=new e(r);for(let o=0;o<n;){let s=qd<n-o?qd:n-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),c=new e(new Uint32Array([kA[s],0]));i.times(c),i.plus(a),o+=s}return i}static convertArray(t){let r=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},Ha=class e extends Zm{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 r=this.buffer[1]<<0,n=t.buffer[1]<<0;return r<n||r===n&&this.buffer[0]<t.buffer[0]}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let n=t.startsWith("-"),i=t.length,o=new e(r);for(let s=n?1:0;s<i;){let a=qd<i-s?qd:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),l=new e(new Uint32Array([kA[a],0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},Km=class e{constructor(t){this.buffer=t}high(){return new Ha(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Ha(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 r=new sr(new Uint32Array([this.buffer[3],0])),n=new sr(new Uint32Array([this.buffer[2],0])),i=new sr(new Uint32Array([this.buffer[1],0])),o=new sr(new Uint32Array([this.buffer[0],0])),s=new sr(new Uint32Array([t.buffer[3],0])),a=new sr(new Uint32Array([t.buffer[2],0])),c=new sr(new Uint32Array([t.buffer[1],0])),l=new sr(new Uint32Array([t.buffer[0],0])),u=sr.multiply(o,l);this.buffer[0]=u.low();let f=new sr(new Uint32Array([u.high(),0]));return u=sr.multiply(i,l),f.plus(u),u=sr.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 sr(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(sr.multiply(n,l)).plus(sr.multiply(i,c)).plus(sr.multiply(o,a)),this.buffer[3]+=sr.multiply(r,l).plus(sr.multiply(n,c)).plus(sr.multiply(i,a)).plus(sr.multiply(o,s)).low(),this}plus(t){let r=new Uint32Array(4);return r[3]=this.buffer[3]+t.buffer[3]>>>0,r[2]=this.buffer[2]+t.buffer[2]>>>0,r[1]=this.buffer[1]+t.buffer[1]>>>0,r[0]=this.buffer[0]+t.buffer[0]>>>0,r[0]<this.buffer[0]>>>0&&++r[1],r[1]<this.buffer[1]>>>0&&++r[2],r[2]<this.buffer[2]>>>0&&++r[3],this.buffer[3]=r[3],this.buffer[2]=r[2],this.buffer[1]=r[1],this.buffer[0]=r[0],this}hex(){return`${jd(this.buffer[3])} ${jd(this.buffer[2])} ${jd(this.buffer[1])} ${jd(this.buffer[0])}`}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}static from(t,r=new Uint32Array(4)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(4)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(4)){let n=t.startsWith("-"),i=t.length,o=new e(r);for(let s=n?1:0;s<i;){let a=qd<i-s?qd:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),l=new e(new Uint32Array([kA[a],0,0,0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*4);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+4*4*n,4));return r}};var Qm=class extends xt{constructor(t,r,n,i,o=Ee.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=r,this.buffers=n,this.dictionaries=i,this.metadataVersion=o}visit(t){return super.visit(t instanceof re?t.type:t)}visitNull(t,{length:r}=this.nextFieldNode()){return Vt({type:t,length:r})}visitBool(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),children:this.visitMany(t.children)})}visitUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<Ee.V5&&this.readNullBitmap(t,n),t.mode===Ue.Sparse?this.visitSparseUnion(t,{length:r,nullCount:n}):this.visitDenseUnion(t,{length:r,nullCount:n})}visitDenseUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDuration(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),child:this.visit(t.children[0])})}visitMap(t,{length:r,nullCount:n}=this.nextFieldNode()){return Vt({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,r,n=this.nextBufferRange()){return r>0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,r){return this.readData(t,r)}readTypeIds(t,r){return this.readData(t,r)}readData(t,{length:r,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+r)}readDictionary(t){return this.dictionaries.get(t.id)}},P_=class extends Qm{constructor(t,r,n,i,o){super(new Uint8Array(0),r,n,i,o),this.sources=t}readNullBitmap(t,r,{offset:n}=this.nextBufferRange()){return r<=0?new Uint8Array(0):Yu(this.sources[n])}readOffsets(t,{offset:r}=this.nextBufferRange()){return te(Uint8Array,te(t.OffsetArrayType,this.sources[r]))}readTypeIds(t,{offset:r}=this.nextBufferRange()){return te(Uint8Array,te(t.ArrayType,this.sources[r]))}readData(t,{offset:r}=this.nextBufferRange()){let{sources:n}=this;return lt.isTimestamp(t)?te(Uint8Array,Ha.convertArray(n[r])):(lt.isInt(t)||lt.isTime(t))&&t.bitWidth===64||lt.isDuration(t)?te(Uint8Array,Ha.convertArray(n[r])):lt.isDate(t)&&t.unit===Tr.MILLISECOND?te(Uint8Array,Ha.convertArray(n[r])):lt.isDecimal(t)?te(Uint8Array,Km.convertArray(n[r])):lt.isBinary(t)||lt.isLargeBinary(t)||lt.isFixedSizeBinary(t)?jH(n[r]):lt.isBool(t)?Yu(n[r]):lt.isUtf8(t)||lt.isLargeUtf8(t)?Is(n[r].join("")):te(Uint8Array,te(t.ArrayType,n[r].map(i=>+i)))}};function jH(e){let t=e.join(""),r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n>>1]=Number.parseInt(t.slice(n,n+2),16);return r}var Yd=class extends ui{constructor(t){super(t),this._values=new Wo(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,r){return super.setValue(t,Et(r))}_flushPending(t,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)n.set(s,0);else{let c=a.length;i.set(a,o),n.set(s,c),o+=c}}};var Wd=class extends ui{constructor(t){super(t),this._values=new Wo(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,r){return super.setValue(t,Et(r))}_flushPending(t,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)n.set(s,BigInt(0));else{let c=a.length;i.set(a,o),n.set(s,BigInt(c)),o+=c}}};var $_=class extends Ge{constructor(t){super(t),this._values=new zd}setValue(t,r){this._values.set(t,+r)}};var Hu=class extends Er{};Hu.prototype._setValue=yA;var Jm=class extends Hu{};Jm.prototype._setValue=d_;var ty=class extends Hu{};ty.prototype._setValue=h_;var ey=class extends Er{};ey.prototype._setValue=xA;var z_=class extends Ge{constructor({type:t,nullValues:r,dictionaryHashFunction:n}){super({type:new Di(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Zu({type:this.type.indices,nullValues:r}),this.dictionary=Zu({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}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,r){let n=this.indices;return r=n.setValid(t,r),this.length=n.length,r}setValue(t,r){let n=this._keysToIndices,i=this.valueToKey(r),o=n[i];return o===void 0&&(n[i]=o=this._dictionaryOffset+this.dictionary.append(r).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,r=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=r?r.concat(n):n,this.finished||(this._dictionaryOffset+=n.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 ry=class extends Er{};ry.prototype._setValue=mA;var V_=class extends Ge{setValue(t,r){let[n]=this.children,i=t*this.stride;for(let o=-1,s=r.length;++o<s;)n.set(i+o,r[o])}addChild(t,r="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(t);return this.type=new jo(this.type.listSize,new re(r,t.type,!0)),n}};var Ku=class extends Er{setValue(t,r){this._values.set(t,r)}},j_=class extends Ku{setValue(t,r){super.setValue(t,jm(r))}},q_=class extends Ku{},Y_=class extends Ku{};var Qu=class extends Er{};Qu.prototype._setValue=_A;var ny=class extends Qu{};ny.prototype._setValue=v_;var iy=class extends Qu{};iy.prototype._setValue=S_;var Za=class extends Er{};Za.prototype._setValue=wA;var oy=class extends Za{};oy.prototype._setValue=I_;var sy=class extends Za{};sy.prototype._setValue=T_;var ay=class extends Za{};ay.prototype._setValue=A_;var cy=class extends Za{};cy.prototype._setValue=M_;var io=class extends Er{setValue(t,r){this._values.set(t,r)}},W_=class extends io{},G_=class extends io{},X_=class extends io{},H_=class extends io{},Z_=class extends io{},K_=class extends io{},Q_=class extends io{},J_=class extends io{};var t1=class extends ui{constructor(t){super(t),this._offsets=new Vd(t.type)}addChild(t,r="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new zo(new re(r,t.type,!0)),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(typeof o>"u")r.set(i,0);else{let s=o,a=s.length,c=r.set(i,a).buffer[i];for(let l=-1;++l<a;)n.set(c+l,s[l])}}};var e1=class extends ui{set(t,r){return super.set(t,r)}setValue(t,r){let n=r instanceof Map?r:new Map(Object.entries(r)),i=this._pending||(this._pending=new Map),o=i.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=n.size,i.set(t,n)}addChild(t,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new qo(new re(r,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(o===void 0)r.set(i,0);else{let{[i]:s,[i+1]:a}=r.set(i,o.size).buffer;for(let c of o.entries())if(n.set(s,c),++s>=a)break}}};var r1=class extends Ge{setValue(t,r){}setValid(t,r){return this.length=Math.max(t+1,this.length),r}};var n1=class extends Ge{setValue(t,r){let{children:n,type:i}=this;switch(Array.isArray(r)||r.constructor){case!0:return i.children.forEach((o,s)=>n[s].set(t,r[s]));case Map:return i.children.forEach((o,s)=>n[s].set(t,r.get(o.name)));default:return i.children.forEach((o,s)=>n[s].set(t,r[o.name]))}}setValid(t,r){return super.setValid(t,r)||this.children.forEach(n=>n.setValid(t,r)),r}addChild(t,r=`${this.numChildren}`){let n=this.children.push(t);return this.type=new ze([...this.type.children,new re(r,t.type,!0)]),n}};var Ka=class extends Er{};Ka.prototype._setValue=gA;var ly=class extends Ka{};ly.prototype._setValue=p_;var uy=class extends Ka{};uy.prototype._setValue=m_;var fy=class extends Ka{};fy.prototype._setValue=y_;var dy=class extends Ka{};dy.prototype._setValue=g_;var Qa=class extends Er{};Qa.prototype._setValue=bA;var hy=class extends Qa{};hy.prototype._setValue=b_;var py=class extends Qa{};py.prototype._setValue=x_;var my=class extends Qa{};my.prototype._setValue=__;var yy=class extends Qa{};yy.prototype._setValue=w_;var Gd=class extends Ge{constructor(t){super(t),this._typeIds=new Ya(Int8Array,0,1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,r){return this.set(this.length,t,r)}set(t,r,n){return n===void 0&&(n=this._valueToChildTypeId(this,r,t)),this.setValue(t,r,n),this}setValue(t,r,n){this._typeIds.set(t,n);let i=this.type.typeIdToChildIndex[n],o=this.children[i];o?.set(t,r)}addChild(t,r=`${this.children.length}`){let n=this.children.push(t),{type:{children:i,mode:o,typeIds:s}}=this,a=[...i,new re(r,t.type)];return this.type=new Vo(o,[...s,n],a),n}_valueToChildTypeId(t,r,n){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.")}},i1=class extends Gd{},o1=class extends Gd{constructor(t){super(t),this._offsets=new Ya(Int32Array)}setValue(t,r,n){let i=this._typeIds.set(t,n).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[i]),s=this._offsets.set(t,o.length).buffer[t];o?.set(s,r)}};var gy=class extends ui{constructor(t){super(t),this._values=new Wo(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,r){return super.setValue(t,Is(r))}_flushPending(t,r){}};gy.prototype._flushPending=Yd.prototype._flushPending;var by=class extends ui{constructor(t){super(t),this._values=new Wo(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,r){return super.setValue(t,Is(r))}_flushPending(t,r){}};by.prototype._flushPending=Wd.prototype._flushPending;var UA=class extends xt{visitNull(){return r1}visitBool(){return $_}visitInt(){return io}visitInt8(){return W_}visitInt16(){return G_}visitInt32(){return X_}visitInt64(){return H_}visitUint8(){return Z_}visitUint16(){return K_}visitUint32(){return Q_}visitUint64(){return J_}visitFloat(){return Ku}visitFloat16(){return j_}visitFloat32(){return q_}visitFloat64(){return Y_}visitUtf8(){return gy}visitLargeUtf8(){return by}visitBinary(){return Yd}visitLargeBinary(){return Wd}visitFixedSizeBinary(){return ry}visitDate(){return Hu}visitDateDay(){return Jm}visitDateMillisecond(){return ty}visitTimestamp(){return Ka}visitTimestampSecond(){return ly}visitTimestampMillisecond(){return uy}visitTimestampMicrosecond(){return fy}visitTimestampNanosecond(){return dy}visitTime(){return Qa}visitTimeSecond(){return hy}visitTimeMillisecond(){return py}visitTimeMicrosecond(){return my}visitTimeNanosecond(){return yy}visitDecimal(){return ey}visitList(){return t1}visitStruct(){return n1}visitUnion(){return Gd}visitDenseUnion(){return o1}visitSparseUnion(){return i1}visitDictionary(){return z_}visitInterval(){return Qu}visitIntervalDayTime(){return ny}visitIntervalYearMonth(){return iy}visitDuration(){return Za}visitDurationSecond(){return oy}visitDurationMillisecond(){return sy}visitDurationMicrosecond(){return ay}visitDurationNanosecond(){return cy}visitFixedSizeList(){return V_}visitMap(){return e1}},vC=new UA;var St=class extends xt{compareSchemas(t,r){return t===r||r instanceof t.constructor&&this.compareManyFields(t.fields,r.fields)}compareManyFields(t,r){return t===r||Array.isArray(t)&&Array.isArray(r)&&t.length===r.length&&t.every((n,i)=>this.compareFields(n,r[i]))}compareFields(t,r){return t===r||r instanceof t.constructor&&t.name===r.name&&t.nullable===r.nullable&&this.visit(t.type,r.type)}};function Pn(e,t){return t instanceof e.constructor}function Ju(e,t){return e===t||Pn(e,t)}function Ja(e,t){return e===t||Pn(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function s1(e,t){return e===t||Pn(e,t)&&e.precision===t.precision}function qH(e,t){return e===t||Pn(e,t)&&e.byteWidth===t.byteWidth}function PA(e,t){return e===t||Pn(e,t)&&e.unit===t.unit}function xy(e,t){return e===t||Pn(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function _y(e,t){return e===t||Pn(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function YH(e,t){return e===t||Pn(e,t)&&e.children.length===t.children.length&&Fs.compareManyFields(e.children,t.children)}function WH(e,t){return e===t||Pn(e,t)&&e.children.length===t.children.length&&Fs.compareManyFields(e.children,t.children)}function $A(e,t){return e===t||Pn(e,t)&&e.mode===t.mode&&e.typeIds.every((r,n)=>r===t.typeIds[n])&&Fs.compareManyFields(e.children,t.children)}function GH(e,t){return e===t||Pn(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Fs.visit(e.indices,t.indices)&&Fs.visit(e.dictionary,t.dictionary)}function zA(e,t){return e===t||Pn(e,t)&&e.unit===t.unit}function wy(e,t){return e===t||Pn(e,t)&&e.unit===t.unit}function XH(e,t){return e===t||Pn(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Fs.compareManyFields(e.children,t.children)}function HH(e,t){return e===t||Pn(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Fs.compareManyFields(e.children,t.children)}St.prototype.visitNull=Ju;St.prototype.visitBool=Ju;St.prototype.visitInt=Ja;St.prototype.visitInt8=Ja;St.prototype.visitInt16=Ja;St.prototype.visitInt32=Ja;St.prototype.visitInt64=Ja;St.prototype.visitUint8=Ja;St.prototype.visitUint16=Ja;St.prototype.visitUint32=Ja;St.prototype.visitUint64=Ja;St.prototype.visitFloat=s1;St.prototype.visitFloat16=s1;St.prototype.visitFloat32=s1;St.prototype.visitFloat64=s1;St.prototype.visitUtf8=Ju;St.prototype.visitLargeUtf8=Ju;St.prototype.visitBinary=Ju;St.prototype.visitLargeBinary=Ju;St.prototype.visitFixedSizeBinary=qH;St.prototype.visitDate=PA;St.prototype.visitDateDay=PA;St.prototype.visitDateMillisecond=PA;St.prototype.visitTimestamp=xy;St.prototype.visitTimestampSecond=xy;St.prototype.visitTimestampMillisecond=xy;St.prototype.visitTimestampMicrosecond=xy;St.prototype.visitTimestampNanosecond=xy;St.prototype.visitTime=_y;St.prototype.visitTimeSecond=_y;St.prototype.visitTimeMillisecond=_y;St.prototype.visitTimeMicrosecond=_y;St.prototype.visitTimeNanosecond=_y;St.prototype.visitDecimal=Ju;St.prototype.visitList=YH;St.prototype.visitStruct=WH;St.prototype.visitUnion=$A;St.prototype.visitDenseUnion=$A;St.prototype.visitSparseUnion=$A;St.prototype.visitDictionary=GH;St.prototype.visitInterval=zA;St.prototype.visitIntervalDayTime=zA;St.prototype.visitIntervalYearMonth=zA;St.prototype.visitDuration=wy;St.prototype.visitDurationSecond=wy;St.prototype.visitDurationMillisecond=wy;St.prototype.visitDurationMicrosecond=wy;St.prototype.visitDurationNanosecond=wy;St.prototype.visitFixedSizeList=XH;St.prototype.visitMap=HH;var Fs=new St;function tf(e,t){return Fs.compareSchemas(e,t)}function SC(e,t){return Fs.compareFields(e,t)}function IC(e,t){return Fs.visit(e,t)}function Zu(e){let t=e.type,r=new(vC.getVisitFn(t)())(e);if(t.children&&t.children.length>0){let n=e.children||[],i={nullValues:e.nullValues},o=Array.isArray(n)?(s,a)=>n[a]||i:({name:s})=>n[s]||i;for(let[s,a]of t.children.entries()){let{type:c}=a,l=o(a,s);r.children.push(Zu(Object.assign(Object.assign({},l),{type:c})))}}return r}function a1(e,t){return ZH(e,t.map(r=>r.data.concat()))}function ZH(e,t){let r=[...e.fields],n=[],i={numBatches:t.reduce((f,d)=>Math.max(f,d.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=KH(r,s,u,t,i),s>0&&(n[o++]=Vt({type:new ze(r),length:s,nullCount:0,children:u.slice()})))}return[e=e.assign(r),n.map(f=>new dr(e,f))]}function KH(e,t,r,n,i){var o;let s=(t+63&-64)>>3;for(let a=-1,c=n.length;++a<c;){let l=r[a],u=l?.length;if(u>=t)u===t?r[a]=l:(r[a]=l.slice(0,t),i.numBatches=Math.max(i.numBatches,n[a].unshift(l.slice(t,u-t))));else{let f=e[a];e[a]=f.clone({nullable:!0}),r[a]=(o=l?._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:Vt({type:f.type,length:t,nullCount:t,nullBitmap:new Uint8Array(s)})}}return r}var TC,fi=class e{constructor(...t){var r,n;if(t.length===0)return this.batches=[],this.schema=new Ie([]),this._offsets=[0],this;let i,o;t[0]instanceof Ie&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop());let s=c=>{if(c){if(c instanceof dr)return[c];if(c instanceof e)return c.batches;if(c instanceof _e){if(c.type instanceof ze)return[new dr(new Ie(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(h=>new le([c[h]])),f=i??new Ie(l.map((h,p)=>new re(String(h),u[p].type,u[p].nullable))),[,d]=a1(f,u);return d.length===0?[new dr(c)]:d}}}return[]},a=t.flatMap(c=>s(c));if(i=(n=i??((r=a[0])===null||r===void 0?void 0:r.schema))!==null&&n!==void 0?n:new Ie([]),!(i instanceof Ie))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof dr))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!tf(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??N_(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,r)=>t+r.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=O_(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,r){}indexOf(t,r){return-1}[Symbol.iterator](){return this.batches.length>0?$d.visit(new le(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 ke(n,i)))}slice(t,n){let r=this.schema;[t,n]=Ed({length:this.numRows},t,n);let i=_g(this.data,this._offsets,t,n);return new e(r,i.map(o=>new ke(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 Vt(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 Vt([Dt({type:new Gn,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]=Qg(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,d=n.findIndex(h=>h.name===c.name);return~d?f[d]=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(...Qg(o,s))}};$O=Symbol.toStringTag;sn[$O]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=la(Nd),e.get=la(je.getVisitFn(D.Struct)),e.set=wg(_n.getVisitFn(D.Struct)),e.indexOf=vg(Sc.getVisitFn(D.Struct)),e.getByteLength=la(Mr.getVisitFn(D.Struct)),"Table"))(sn.prototype);var zO,ke=class e{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof re))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=Dt({nullCount:0,type:new ye(this.schema.fields),children:this.schema.fields.map(n=>Dt({type:n.type,nullCount:0}))})]=t,!(this.data instanceof se))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=UO(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]=$t.new({name:l,type:n[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),s=new re(r),a=Dt({type:new ye(r),length:o,children:i,nullCount:0});[this.schema,this.data]=UO(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=qO(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 je.visit(this.data,t)}set(t,n){return _n.visit(this.data,t,n)}indexOf(t,n){return Sc.visit(this.data,t,n)}getByteLength(t){return Mr.visit(this.data,t)}[Symbol.iterator](){return Jl.visit(new Vt([this.data]))}toArray(){return[...this]}concat(...t){return new sn(this.schema,[this,...t])}slice(t,n){let[r]=new Vt([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 Vt([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 Vt([Dt({type:new Gn,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 re(o,new Map(this.schema.metadata)),i=Dt({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,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 ye(n.fields),length:this.numRows,children:r});return new e(n,i)}};zO=Symbol.toStringTag;ke[zO]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(ke.prototype);function UO(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 ye(i),length:n,children:o})]}function qO(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)||[]])qO(a.children,l?.children,n);if(at.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 Dc=class extends ke{constructor(t){let n=t.fields.map(i=>Dt({type:i.type})),r=Dt({type:new ye(t.fields),nullCount:0,children:n});super(t,r)}};var yh;(function(e){e[e.BUFFER=0]="BUFFER"})(yh||(yh={}));var gh;(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(gh||(gh={}));var Kg=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):gh.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):yh.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,n){t.addFieldInt8(0,n,gh.LZ4_FRAME)}static addMethod(t,n){t.addFieldInt8(1,n,yh.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 au=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 cu=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 Or=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 cu).__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 au).__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 Kg).__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 ds=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 Or).__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 lu;(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"})(lu||(lu={}));var ki=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):fa.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):lu.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 en).__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,fa.V1)}static addHeaderType(t,n){t.addFieldInt8(1,n,lu.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 sv=class extends ut{visit(t,n){return t==null||n==null?void 0:super.visit(t,n)}visitNull(t,n){return Pd.startNull(n),Pd.endNull(n)}visitInt(t,n){return Ri.startInt(n),Ri.addBitWidth(n,t.bitWidth),Ri.addIsSigned(n,t.isSigned),Ri.endInt(n)}visitFloat(t,n){return ga.startFloatingPoint(n),ga.addPrecision(n,t.precision),ga.endFloatingPoint(n)}visitBinary(t,n){return Dd.startBinary(n),Dd.endBinary(n)}visitBool(t,n){return kd.startBool(n),kd.endBool(n)}visitUtf8(t,n){return zd.startUtf8(n),zd.endUtf8(n)}visitDecimal(t,n){return eo.startDecimal(n),eo.addScale(n,t.scale),eo.addPrecision(n,t.precision),eo.addBitWidth(n,t.bitWidth),eo.endDecimal(n)}visitDate(t,n){return ha.startDate(n),ha.addUnit(n,t.unit),ha.endDate(n)}visitTime(t,n){return ns.startTime(n),ns.addUnit(n,t.unit),ns.addBitWidth(n,t.bitWidth),ns.endTime(n)}visitTimestamp(t,n){let r=t.timezone&&n.createString(t.timezone)||void 0;return rs.startTimestamp(n),rs.addUnit(n,t.unit),r!==void 0&&rs.addTimezone(n,r),rs.endTimestamp(n)}visitInterval(t,n){return ba.startInterval(n),ba.addUnit(n,t.unit),ba.endInterval(n)}visitDuration(t,n){return pa.startDuration(n),pa.addUnit(n,t.unit),pa.endDuration(n)}visitList(t,n){return Bd.startList(n),Bd.endList(n)}visitStruct(t,n){return $d.startStruct_(n),$d.endStruct_(n)}visitUnion(t,n){Di.startTypeIdsVector(n,t.typeIds.length);let r=Di.createTypeIdsVector(n,t.typeIds);return Di.startUnion(n),Di.addMode(n,t.mode),Di.addTypeIds(n,r),Di.endUnion(n)}visitDictionary(t,n){let r=this.visit(t.indices,n);return to.startDictionaryEncoding(n),to.addId(n,BigInt(t.id)),to.addIsOrdered(n,t.isOrdered),r!==void 0&&to.addIndexType(n,r),to.endDictionaryEncoding(n)}visitFixedSizeBinary(t,n){return ma.startFixedSizeBinary(n),ma.addByteWidth(n,t.byteWidth),ma.endFixedSizeBinary(n)}visitFixedSizeList(t,n){return ya.startFixedSizeList(n),ya.addListSize(n,t.listSize),ya.endFixedSizeList(n)}visitMap(t,n){return xa.startMap(n),xa.addKeysSorted(n,t.keysSorted),xa.endMap(n)}},Jg=new sv;function GO(e,t=new Map){return new re(Lz(e,t),t0(e.metadata),t)}function av(e){return new wn(e.count,XO(e.columns),HO(e.columns))}function WO(e){return new mr(av(e.data),e.id,e.isDelta)}function Lz(e,t){return(e.fields||[]).filter(Boolean).map(n=>$t.fromJSON(n,t))}function jO(e,t){return(e.children||[]).filter(Boolean).map(n=>$t.fromJSON(n,t))}function XO(e){return(e||[]).reduce((t,n)=>[...t,new Kr(n.count,Cz(n.VALIDITY)),...XO(n.children)],[])}function HO(e,t=[]){for(let n=-1,r=(e||[]).length;++n<r;){let i=e[n];i.VALIDITY&&t.push(new pr(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new pr(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new pr(t.length,i.OFFSET.length)),i.DATA&&t.push(new pr(t.length,i.DATA.length)),t=HO(i.children,t)}return t}function Cz(e){return(e||[]).reduce((t,n)=>t+ +(n===0),0)}function ZO(e,t){let n,r,i,o,s,a;return!t||!(o=e.dictionary)?(s=YO(e,jO(e,t)),i=new $t(e.name,s,e.nullable,t0(e.metadata))):t.has(n=o.id)?(r=(r=o.indexType)?VO(r):new Hi,a=new Er(t.get(n),r,n,o.isOrdered),i=new $t(e.name,a,e.nullable,t0(e.metadata))):(r=(r=o.indexType)?VO(r):new Hi,t.set(n,s=YO(e,jO(e,t))),a=new Er(s,r,n,o.isOrdered),i=new $t(e.name,a,e.nullable,t0(e.metadata))),i||null}function t0(e=[]){return new Map(e.map(({key:t,value:n})=>[t,n]))}function VO(e){return new Pe(e.isSigned,e.bitWidth)}function YO(e,t){let n=e.type.name;switch(n){case"NONE":return new Gn;case"null":return new Gn;case"binary":return new Yo;case"utf8":return new Go;case"bool":return new Wo;case"list":return new Ii((t||[])[0]);case"struct":return new ye(t||[]);case"struct_":return new ye(t||[])}switch(n){case"int":{let r=e.type;return new Pe(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=e.type;return new dr(xe[r.precision])}case"decimal":{let r=e.type;return new Xo(r.scale,r.precision,r.bitWidth)}case"date":{let r=e.type;return new Ho(xn[r.unit])}case"time":{let r=e.type;return new Si(pt[r.unit],r.bitWidth)}case"timestamp":{let r=e.type;return new Zo(pt[r.unit],r.timezone)}case"interval":{let r=e.type;return new Qo(Yn[r.unit])}case"duration":{let r=e.type;return new Ko(pt[r.unit])}case"union":{let r=e.type,[i,...o]=(r.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new Ti(me[s],r.typeIds||[],t||[])}case"fixedsizebinary":{let r=e.type;return new Jo(r.byteWidth)}case"fixedsizelist":{let r=e.type;return new Ei(r.listSize,(t||[])[0])}case"map":{let r=e.type;return new Ai((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var Bz=Tc,Pz=Nr,yr=class e{static fromJSON(t,n){let r=new e(0,Ie.V5,n);return r._createHeader=$z(t,n),r}static decode(t){t=new Pz(Ot(t));let n=ki.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),o=n.headerType(),s=new e(r,i,o);return s._createHeader=Uz(n,o),s}static encode(t){let n=new Bz,r=-1;return t.isSchema()?r=re.encode(n,t.header()):t.isRecordBatch()?r=wn.encode(n,t.header()):t.isDictionaryBatch()&&(r=mr.encode(n,t.header())),ki.startMessage(n),ki.addVersion(n,Ie.V5),ki.addHeader(n,r),ki.addHeaderType(n,t.headerType),ki.addBodyLength(n,BigInt(t.bodyLength)),ki.finishMessageBuffer(n,ki.endMessage(n)),n.asUint8Array()}static from(t,n=0){if(t instanceof re)return new e(0,Ie.V5,Qt.Schema,t);if(t instanceof wn)return new e(n,Ie.V5,Qt.RecordBatch,t);if(t instanceof mr)return new e(n,Ie.V5,Qt.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===Qt.Schema}isRecordBatch(){return this.headerType===Qt.RecordBatch}isDictionaryBatch(){return this.headerType===Qt.DictionaryBatch}constructor(t,n,r,i){this._version=n,this._headerType=r,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=fr(t)}},wn=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=fr(t)}},mr=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=fr(n)}},pr=class{constructor(t,n){this.offset=fr(t),this.length=fr(n)}},Kr=class{constructor(t,n){this.length=fr(t),this.nullCount=fr(n)}};function $z(e,t){return()=>{switch(t){case Qt.Schema:return re.fromJSON(e);case Qt.RecordBatch:return wn.fromJSON(e);case Qt.DictionaryBatch:return mr.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${Qt[t]}, type: ${t} }`)}}function Uz(e,t){return()=>{switch(t){case Qt.Schema:return re.decode(e.header(new hr),new Map,e.version());case Qt.RecordBatch:return wn.decode(e.header(new Or),e.version());case Qt.DictionaryBatch:return mr.decode(e.header(new ds),e.version())}throw new Error(`Unrecognized Message type: { name: ${Qt[t]}, type: ${t} }`)}}$t.encode=Qz;$t.decode=Hz;$t.fromJSON=ZO;re.encode=Zz;re.decode=zz;re.fromJSON=GO;wn.encode=Kz;wn.decode=qz;wn.fromJSON=av;mr.encode=Jz;mr.decode=jz;mr.fromJSON=WO;Kr.encode=tq;Kr.decode=Yz;pr.encode=eq;pr.decode=Vz;function zz(e,t=new Map,n=Ie.V5){let r=Xz(e,t);return new re(r,e0(e),t,n)}function qz(e,t=Ie.V5){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new wn(e.length(),Gz(e),Wz(e,t))}function jz(e,t=Ie.V5){return new mr(wn.decode(e.data(),t),e.id(),e.isDelta())}function Vz(e){return new pr(e.offset(),e.length())}function Yz(e){return new Kr(e.length(),e.nullCount())}function Gz(e){let t=[];for(let n,r=-1,i=-1,o=e.nodesLength();++r<o;)(n=e.nodes(r))&&(t[++i]=Kr.decode(n));return t}function Wz(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]=pr.decode(r));return n}function Xz(e,t){let n=[];for(let r,i=-1,o=-1,s=e.fieldsLength();++i<s;)(r=e.fields(i))&&(n[++o]=$t.decode(r,t));return n}function QO(e,t){let n=[];for(let r,i=-1,o=-1,s=e.childrenLength();++i<s;)(r=e.children(i))&&(n[++o]=$t.decode(r,t));return n}function Hz(e,t){let n,r,i,o,s,a;return!t||!(a=e.dictionary())?(i=JO(e,QO(e,t)),r=new $t(e.name(),i,e.nullable(),e0(e))):t.has(n=fr(a.id()))?(o=(o=a.indexType())?KO(o):new Hi,s=new Er(t.get(n),o,n,a.isOrdered()),r=new $t(e.name(),s,e.nullable(),e0(e))):(o=(o=a.indexType())?KO(o):new Hi,t.set(n,i=JO(e,QO(e,t))),s=new Er(i,o,n,a.isOrdered()),r=new $t(e.name(),s,e.nullable(),e0(e))),r||null}function e0(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 KO(e){return new Pe(e.isSigned(),e.bitWidth())}function JO(e,t){let n=e.typeType();switch(n){case ge.NONE:return new Gn;case ge.Null:return new Gn;case ge.Binary:return new Yo;case ge.Utf8:return new Go;case ge.Bool:return new Wo;case ge.List:return new Ii((t||[])[0]);case ge.Struct_:return new ye(t||[])}switch(n){case ge.Int:{let r=e.type(new Ri);return new Pe(r.isSigned(),r.bitWidth())}case ge.FloatingPoint:{let r=e.type(new ga);return new dr(r.precision())}case ge.Decimal:{let r=e.type(new eo);return new Xo(r.scale(),r.precision(),r.bitWidth())}case ge.Date:{let r=e.type(new ha);return new Ho(r.unit())}case ge.Time:{let r=e.type(new ns);return new Si(r.unit(),r.bitWidth())}case ge.Timestamp:{let r=e.type(new rs);return new Zo(r.unit(),r.timezone())}case ge.Interval:{let r=e.type(new ba);return new Qo(r.unit())}case ge.Duration:{let r=e.type(new pa);return new Ko(r.unit())}case ge.Union:{let r=e.type(new Di);return new Ti(r.mode(),r.typeIdsArray()||[],t||[])}case ge.FixedSizeBinary:{let r=e.type(new ma);return new Jo(r.byteWidth())}case ge.FixedSizeList:{let r=e.type(new ya);return new Ei(r.listSize(),(t||[])[0])}case ge.Map:{let r=e.type(new xa);return new Ai((t||[])[0],r.keysSorted())}}throw new Error(`Unrecognized type: "${ge[n]}" (${n})`)}function Zz(e,t){let n=t.fields.map(o=>$t.encode(e,o));hr.startFieldsVector(e,n.length);let r=hr.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?hr.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),c=e.createString(`${s}`);return en.startKeyValue(e),en.addKey(e,a),en.addValue(e,c),en.endKeyValue(e)})):-1;return hr.startSchema(e),hr.addFields(e,r),hr.addEndianness(e,nq?da.Little:da.Big),i!==-1&&hr.addCustomMetadata(e,i),hr.endSchema(e)}function Qz(e,t){let n=-1,r=-1,i=-1,o=t.type,s=t.typeId;at.isDictionary(o)?(s=o.dictionary.typeId,i=Jg.visit(o,e),r=Jg.visit(o.dictionary,e)):r=Jg.visit(o,e);let a=(o.children||[]).map(u=>$t.encode(e,u)),c=Fn.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?Fn.createCustomMetadataVector(e,[...t.metadata].map(([u,f])=>{let d=e.createString(`${u}`),h=e.createString(`${f}`);return en.startKeyValue(e),en.addKey(e,d),en.addValue(e,h),en.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),Fn.startField(e),Fn.addType(e,r),Fn.addTypeType(e,s),Fn.addChildren(e,c),Fn.addNullable(e,!!t.nullable),n!==-1&&Fn.addName(e,n),i!==-1&&Fn.addDictionary(e,i),l!==-1&&Fn.addCustomMetadata(e,l),Fn.endField(e)}function Kz(e,t){let n=t.nodes||[],r=t.buffers||[];Or.startNodesVector(e,n.length);for(let s of n.slice().reverse())Kr.encode(e,s);let i=e.endVector();Or.startBuffersVector(e,r.length);for(let s of r.slice().reverse())pr.encode(e,s);let o=e.endVector();return Or.startRecordBatch(e),Or.addLength(e,BigInt(t.length)),Or.addNodes(e,i),Or.addBuffers(e,o),Or.endRecordBatch(e)}function Jz(e,t){let n=wn.encode(e,t.data);return ds.startDictionaryBatch(e),ds.addId(e,BigInt(t.id)),ds.addIsDelta(e,t.isDelta),ds.addData(e,n),ds.endDictionaryBatch(e)}function tq(e,t){return cu.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function eq(e,t){return au.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var nq=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})();var lv=e=>`Expected ${Qt[e]} Message in stream, but was null or length 0.`,uv=e=>`Header pointer of flatbuffer-encoded ${Qt[e]} Message is null or length 0.`,tD=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,eD=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,uu=class{constructor(t){this.source=t instanceof ro?t:new ro(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?be:t.value===-1&&(t=this.readMetadataLength()).done?be:(t=this.readMetadata(t.value)).done?be: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(lv(t));return n.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let n=Ot(this.source.read(t));if(n.byteLength<t)throw new Error(eD(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()}readSchema(t=!1){let n=Qt.Schema,r=this.readMessage(n),i=r?.header();if(t&&!i)throw new Error(uv(n));return i}readMetadataLength(){let t=this.source.read(n0),n=t&&new Nr(t),r=n?.readInt32(0)||0;return{done:r===0,value:r}}readMetadata(t){let n=this.source.read(t);if(!n)return be;if(n.byteLength<t)throw new Error(tD(t,n.byteLength));return{done:!1,value:yr.decode(n)}}},bh=class{constructor(t,n){this.source=t instanceof Zr?t:Cy(t)?new _a(t,n):new Zr(t)}[Symbol.asyncIterator](){return this}next(){return Z(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?be:t.value===-1&&(t=yield this.readMetadataLength()).done?be:(t=yield this.readMetadata(t.value)).done?be:t})}throw(t){return Z(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return Z(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return Z(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(lv(t));return n.value})}readMessageBody(t){return Z(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let n=Ot(yield this.source.read(t));if(n.byteLength<t)throw new Error(eD(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()})}readSchema(t=!1){return Z(this,void 0,void 0,function*(){let n=Qt.Schema,r=yield this.readMessage(n),i=r?.header();if(t&&!i)throw new Error(uv(n));return i})}readMetadataLength(){return Z(this,void 0,void 0,function*(){let t=yield this.source.read(n0),n=t&&new Nr(t),r=n?.readInt32(0)||0;return{done:r===0,value:r}})}readMetadata(t){return Z(this,void 0,void 0,function*(){let n=yield this.source.read(t);if(!n)return be;if(n.byteLength<t)throw new Error(tD(t,n.byteLength));return{done:!1,value:yr.decode(n)}})}},xh=class extends uu{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof qd?t:new qd(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:yr.fromJSON(t.schema,Qt.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let n=t.dictionaries[this._dictionaryIndex++];return this._body=n.data.columns,{done:!1,value:yr.fromJSON(n,Qt.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let n=t.batches[this._batchIndex++];return this._body=n.columns,{done:!1,value:yr.fromJSON(n,Qt.RecordBatch)}}return this._body=[],be}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(lv(t));return n.value}readSchema(){let t=Qt.Schema,n=this.readMessage(t),r=n?.header();if(!n||!r)throw new Error(uv(t));return r}},n0=4,cv="ARROW1",fu=new Uint8Array(cv.length);for(let e=0;e<cv.length;e+=1)fu[e]=cv.codePointAt(e);function r0(e,t=0){for(let n=-1,r=fu.length;++n<r;)if(fu[n]!==e[t+n])return!1;return!0}var du=fu.length,fv=du+n0,nD=du*2+n0;var nn=class e extends Ec{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 Ir(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 bn.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return bn.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:Fy(t)?iq(t):Cy(t)?aq(t):Ir(t)?Z(this,void 0,void 0,function*(){return yield e.from(yield t)}):By(t)||vd(t)||$y(t)||Gr(t)?sq(new Zr(t)):oq(new ro(t))}static readAll(t){return t instanceof e?t.isSync()?rD(t):iD(t):Fy(t)||ArrayBuffer.isView(t)||xi(t)||Ly(t)?rD(t):iD(t)}},oo=class extends nn{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Sr(this,arguments,function*(){yield Ct(yield*Vl(bi(this[Symbol.iterator]())))})}},wa=class extends nn{constructor(t){super(t),this._impl=t}readAll(){var t,n,r,i;return Z(this,void 0,void 0,function*(){let o=new Array;try{for(var s=!0,a=bi(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]()}},va=class extends oo{constructor(t){super(t),this._impl=t}},_h=class extends wa{constructor(t){super(t),this._impl=t}},i0=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 ye(this.schema.fields),length:t.length,children:r});return new ke(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 Vt(l)):new Vt(l)).memoize()}return a.memoize()}_loadVectors(t,n,r){return new Gd(n,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},hu=class extends i0{constructor(t,n){super(n),this._reader=Fy(t)?new xh(this._handle=t):new uu(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=oD(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):be}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):be}next(){if(this.closed)return be;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 Dc(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},pu=class extends i0{constructor(t,n){super(n),this._reader=new bh(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Z(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 Z(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=oD(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Z(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):be})}return(t){return Z(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):be})}next(){return Z(this,void 0,void 0,function*(){if(this.closed)return be;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 Dc(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Z(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},o0=class extends hu{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 jd?t:new jd(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(Qt.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(Qt.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-fv,r=t.readInt32(n),i=t.readAt(n-r,r);return is.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}},dv=class extends pu{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 _a?t:new _a(t,r),i)}isFile(){return!0}isAsync(){return!0}open(t){let n=Object.create(null,{open:{get:()=>super.open}});return Z(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 Z(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(Qt.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 Z(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(Qt.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 Z(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let n=t.size-fv,r=yield t.readInt32(n),i=yield t.readAt(n-r,r);return is.decode(i)})}_readNextMessageAndValidate(t){return Z(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})}},hv=class extends hu{constructor(t,n){super(t,n)}_loadVectors(t,n,r){return new Ng(n,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}};function oD(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*rD(e){let t=nn.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function iD(e){return Sr(this,arguments,function*(){let n=yield Ct(nn.from(e));try{if(!(yield Ct(n.open({autoDestroy:!1}))).closed)do yield yield Ct(n);while(!(yield Ct(n.reset().open())).closed)}finally{yield Ct(n.cancel())}})}function iq(e){return new oo(new hv(e))}function oq(e){let t=e.peek(du+7&-8);return t&&t.byteLength>=4?r0(t)?new va(new o0(e.read())):new oo(new hu(e)):new oo(new hu(function*(){}()))}function sq(e){return Z(this,void 0,void 0,function*(){let t=yield e.peek(du+7&-8);return t&&t.byteLength>=4?r0(t)?new va(new o0(yield e.read())):new wa(new pu(e)):new wa(new pu(function(){return Sr(this,arguments,function*(){})}()))})}function aq(e){return Z(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new _a(e,t);return t>=nD&&r0(yield n.readAt(0,du+7&-8))?new _h(new dv(n)):new wa(new pu(n))})}var Fe=class e extends ut{static assemble(...t){let n=i=>i.flatMap(o=>Array.isArray(o)?n(o):o instanceof ke?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 Vt)return this.visitMany(t.data),this;let{type:n}=t;if(!at.isDictionary(n)){let{length:r}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(at.isUnion(n))this.nodes.push(new Kr(r,0));else{let{nullCount:i}=t;at.isNull(n)||Fi.call(this,i<=0?new Uint8Array(0):wc(t.offset,r,t.nullBitmap)),this.nodes.push(new Kr(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 Fi(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new pr(this._byteLength,t)),this._byteLength+=t,this}function cq(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:o}=e;if(Fi.call(this,i),n.mode===me.Sparse)return pv.call(this,e);if(n.mode===me.Dense){if(e.offset<=0)return Fi.call(this,o),pv.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);Fi.call(this,s),this.visitMany(e.children.map((l,u)=>{let f=n.typeIds[u],d=a[f],h=c[f];return l.slice(d,Math.min(r,h))}))}}return this}function lq(e){let t;return e.nullCount>=e.length?Fi.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?Fi.call(this,wc(e.offset,e.length,t)):Fi.call(this,vc(e.values))}function hs(e){return Fi.call(this,e.values.subarray(0,e.length*e.stride))}function sD(e){let{length:t,values:n,valueOffsets:r}=e,{[0]:i,[t]:o}=r,s=Math.min(o-i,n.byteLength-i);return Fi.call(this,Uy(-i,t+1,r)),Fi.call(this,n.subarray(i,i+s)),this}function mv(e){let{length:t,valueOffsets:n}=e;if(n){let{[0]:r,[t]:i}=n;return Fi.call(this,Uy(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function pv(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}Fe.prototype.visitBool=lq;Fe.prototype.visitInt=hs;Fe.prototype.visitFloat=hs;Fe.prototype.visitUtf8=sD;Fe.prototype.visitBinary=sD;Fe.prototype.visitFixedSizeBinary=hs;Fe.prototype.visitDate=hs;Fe.prototype.visitTimestamp=hs;Fe.prototype.visitTime=hs;Fe.prototype.visitDecimal=hs;Fe.prototype.visitList=mv;Fe.prototype.visitStruct=pv;Fe.prototype.visitUnion=cq;Fe.prototype.visitInterval=hs;Fe.prototype.visitDuration=hs;Fe.prototype.visitFixedSizeList=mv;Fe.prototype.visitMap=mv;var kc=class extends Ec{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 no,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,Vn(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 Ir(t)?t.then(n=>this.writeAll(n)):Gr(t)?gv(this,t):yv(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 no?this._sink=t:(this._sink=new no,t&&TR(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&ER(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||!Oc(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 sn&&!(n=t.schema))return this.finish()&&void 0;if(t instanceof ke&&!(n=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(n&&!Oc(n,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,n)}t instanceof ke?t instanceof Dc||this._writeRecordBatch(t):t instanceof sn?this.writeAll(t.batches):xi(t)&&this.writeAll(t)}_writeMessage(t,n=8){let r=n-1,i=yr.encode(t),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+r&~r,c=a-o-s;return t.headerType===Qt.RecordBatch?this._recordBatchBlocks.push(new os(a,t.bodyLength,this._position)):t.headerType===Qt.DictionaryBatch&&this._dictionaryBlocks.push(new os(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=Ot(t);n&&n.byteLength>0&&(this._sink.write(n),this._position+=n.byteLength)}return this}_writeSchema(t){return this._writeMessage(yr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(fu)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:n,nodes:r,bufferRegions:i,buffers:o}=Fe.assemble(t),s=new wn(t.numRows,r,i),a=yr.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}=Fe.assemble(new Vt([t])),c=new wn(t.length,o,s),l=new mr(c,n,r),u=yr.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}},Fc=class e extends kc{static writeAll(t,n){let r=new e(n);return Ir(t)?t.then(i=>r.writeAll(i)):Gr(t)?gv(r,t):yv(r,t)}},Lc=class e extends kc{static writeAll(t){let n=new e;return Ir(t)?t.then(r=>n.writeAll(r)):Gr(t)?gv(n,t):yv(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let n=is.encode(new is(t,Ie.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(n)._write(Int32Array.of(n.byteLength))._writeMagic()}};function yv(e,t){let n=t;t instanceof sn&&(n=t.batches,e.reset(void 0,t.schema));for(let r of n)e.write(r);return e.finish()}function gv(e,t){var n,r,i,o,s,a,c;return Z(this,void 0,void 0,function*(){try{for(n=!0,r=bi(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 aD(e,t){if(Gr(e))return fq(e,t);if(xi(e))return uq(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function uq(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=Ot(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 fq(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 Z(this,void 0,void 0,function*(){yield o(s,n||(n=e[Symbol.asyncIterator]()))})},pull(s){return Z(this,void 0,void 0,function*(){n?yield o(s,n):s.close()})},cancel(){return Z(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 Z(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=Ot(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 uD(e){return new bv(e)}var bv=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:n,["writableStrategy"]:r,["queueingStrategy"]:i="count"}=t,o=SR(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Mc(o),this._getSize=i!=="bytes"?cD:lD;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"?cD:lD}),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)}},cD=e=>{var t;return(t=e?.length)!==null&&t!==void 0?t:0},lD=e=>{var t;return(t=e?.byteLength)!==null&&t!==void 0?t:0};function s0(e,t){let n=new no,r=null,i=new ReadableStream({cancel(){return Z(this,void 0,void 0,function*(){yield n.close()})},start(a){return Z(this,void 0,void 0,function*(){yield s(a,r||(r=yield o()))})},pull(a){return Z(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 Z(this,void 0,void 0,function*(){return yield(yield nn.from(n)).open(t)})}function s(a,c){return Z(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 a0(e,t){let n=new this(e),r=new Zr(n),i=new ReadableStream({cancel(){return Z(this,void 0,void 0,function*(){yield r.cancel()})},pull(s){return Z(this,void 0,void 0,function*(){yield o(s)})},start(s){return Z(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 Z(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 Cc(e){let t=nn.from(e);return Ir(t)?t.then(n=>Cc(n)):t.isAsync()?t.readAll().then(n=>new sn(n)):new sn(t.readAll())}function c0(e,t="stream"){return(t==="stream"?Fc:Lc).writeAll(e).toUint8Array(!0)}var pq=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Nw),ev),Gw),Rw),Iw),Yw),Aw),{compareSchemas:Oc,compareFields:BO,compareTypes:PO});bn.toDOMStream=aD;_e.throughDOM=uD;nn.throughDOM=s0;va.throughDOM=s0;oo.throughDOM=s0;kc.throughDOM=a0;Lc.throughDOM=a0;Fc.throughDOM=a0;function l0(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:d}=r;if(r=null,c(),typeof l=="string"){let h=JSON.parse(l);h.error?d(h.error):f(h)}else if(u.type==="exec")f();else if(u.type==="arrow")f(Cc(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 gr=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?`${dD(t)}.`:""}${r}`}else return t?dD(t):"NULL"}};function dD(e){return e.split(".").map(n=>`"${n}"`).join(".")}function hD(e,t){return e instanceof gr&&e.column===t}function zt(e){return typeof e=="string"?Sa(e):e}function Bc(e){return typeof e=="string"?pD(e):e}function pD(e){return new gr(e)}function Sa(e,t){return arguments.length===1&&(t=e,e=null),new gr(e,t)}function so(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 ps=e=>typeof e?.addEventListener=="function";function u0(e){return e instanceof Ia}var Ia=class{constructor(t,n,r){this._expr=Array.isArray(t)?t:[t],this._deps=n||[],this.annotate(r);let i=this._expr.filter(o=>ps(o));i.length>0?(this._params=Array.from(new Set(i)),this._params.forEach(o=>{o.addEventListener("value",()=>mq(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=>ps(t)&&!u0(t)?so(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 mq(e,t){if(t?.size)return Promise.allSettled(Array.from(t,n=>n(e)))}function xv(e,t){let n=[e[0]],r=new Set,i=t.length;for(let o=0,s=0;o<i;){let a=t[o];ps(a)?n[++s]=a:(Array.isArray(a?.columns)&&a.columns.forEach(l=>r.add(l)),n[s]+=typeof a=="string"?a:so(a));let c=e[++o];ps(n[s])?n[++s]=c:n[s]+=c}return{spans:n,cols:Array.from(r)}}function j(e,...t){let{spans:n,cols:r}=xv(e,t);return new Ia(n,r)}function _v(e){let t=zt(e);return j`${t} DESC NULLS LAST`.annotate({label:t?.label,desc:!0})}var Dr=e=>({value:e,toString:()=>so(e)});function wh(e){e(this.op,this),this.children?.forEach(t=>t.visit(e))}function mD(e,t){let n=t.filter(i=>i!=null).map(zt),r=n.map((i,o)=>o?` ${e} `:"");return n.length===1?r.push(""):n.length>1&&(r[0]="(",r.push(")")),j(r,...n).annotate({op:e,children:n,visit:wh})}var Xn=(...e)=>mD("AND",e.flat()),Pc=(...e)=>mD("OR",e.flat()),yq=e=>t=>j`(${e} ${zt(t)})`.annotate({op:e,a:t,visit:wh}),wv=yq("NOT"),yD=e=>t=>j`(${zt(t)} ${e})`.annotate({op:e,a:t,visit:wh}),$c=yD("IS NULL"),ms=yD("IS NOT NULL"),Ta=e=>(t,n)=>j`(${zt(t)} ${e} ${zt(n)})`.annotate({op:e,a:t,b:n,visit:wh}),ys=Ta("="),Uc=Ta("<>"),gs=Ta("<"),vh=Ta(">"),bs=Ta("<="),vv=Ta(">="),Sv=Ta("IS DISTINCT FROM"),Sh=Ta("IS NOT DISTINCT FROM");function gD(e,t,n,r){t=zt(t);let i=e.startsWith("NOT ")?"NOT ":"";return(n?r?j`${i}(${n[0]} <= ${t} AND ${t} < ${n[1]})`:j`(${t} ${e} ${n[0]} AND ${n[1]})`:j``).annotate({op:e,visit:wh,field:t,range:n})}var Te=(e,t,n)=>gD("BETWEEN",e,t,n),Iv=(e,t,n)=>gD("NOT BETWEEN",e,t,n);function zc(e,t){return Array.from({length:e},()=>t)}function vn(e,t){return(...n)=>{let r=n.map(zt),i=t?`::${t}`:"";return(r.length?j([`${e}(`,...zc(r.length-1,", "),`)${i}`],...r):j`${e}()${i}`).annotate({func:e,args:r})}}var Tv=vn("REGEXP_MATCHES"),Ev=vn("CONTAINS"),Av=vn("PREFIX"),Mv=vn("SUFFIX"),gq=vn("LOWER"),bq=vn("UPPER"),xq=vn("LENGTH"),_q=vn("ISNAN"),wq=vn("ISFINITE"),vq=vn("ISINF");var Ih=class e extends Ia{constructor(t,n,r,i,o="",s="",a=""){let c;if(i&&!(o||s||a))c=i?j`${n} OVER "${i}"`:j`${n} OVER ()`;else{let d=o&&s?" ":"",h=(o||s)&&a?" ":"";c=j`${n} OVER (${i?`"${i}" `:""}${o}${d}${s}${h}${a})`}r&&(c=j`(${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(zt),r=j(["PARTITION BY ",zc(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(zt),r=j(["ORDER BY ",zc(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=bD("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=bD("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 bD(e,t){if(ps(t)){let n=j`${t}`;return n.toString=()=>`${e} ${xD(t.value)}`,n}return`${e} ${xD(t)}`}function xD(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 Li(e,t){return(...n)=>{let r=vn(e)(...n);return new Ih(e,r,t)}}var Nv=Li("ROW_NUMBER","INTEGER"),Rv=Li("RANK","INTEGER"),Ov=Li("DENSE_RANK","INTEGER"),Dv=Li("PERCENT_RANK"),kv=Li("CUME_DIST"),Fv=Li("NTILE"),Lv=Li("LAG"),Cv=Li("LEAD"),Bv=Li("FIRST_VALUE"),Pv=Li("LAST_VALUE"),$v=Li("NTH_VALUE");function zv(e,...t){return j(e,...t).annotate({aggregate:!0})}var Uv=class e extends Ia{constructor(t,n,r,i,o){n=(n||[]).map(zt);let{strings:s,exprs:a}=Sq(t,n,r,i,o),{spans:c,cols:l}=xv(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(Iq).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 Ih(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 Sq(e,t,n,r,i){let o=`)${n?`::${n}`:""}`,s=[`${e}(${r?"DISTINCT ":""}`],a=[];return t.length?(s=s.concat([...zc(t.length-1,", "),`${o}${i?" FILTER (WHERE ":""}`,...i?[")"]:[]]),a=[...t,...i?[i]:[]]):s[0]+="*"+o,{exprs:a,strings:s}}function Iq(e){let t=so(e);return t&&t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function Ht(e,t){return(...n)=>new Uv(e,n,t)}var kr=Ht("COUNT","INTEGER"),qv=Ht("AVG"),Tq=Ht("AVG"),jv=Ht("MAD"),Jr=Ht("MAX"),ti=Ht("MIN"),Fr=Ht("SUM","DOUBLE"),Vv=Ht("PRODUCT"),Yv=Ht("MEDIAN"),Gv=Ht("QUANTILE"),Wv=Ht("MODE"),Xv=Ht("VARIANCE"),Hv=Ht("STDDEV"),Zv=Ht("SKEWNESS"),Qv=Ht("KURTOSIS"),Kv=Ht("ENTROPY"),Jv=Ht("VAR_POP"),t2=Ht("STDDEV_POP"),e2=Ht("CORR"),n2=Ht("COVAR_POP"),r2=Ht("REGR_INTERCEPT"),i2=Ht("REGR_SLOPE"),o2=Ht("REGR_COUNT"),Eq=Ht("REGR_R2"),s2=Ht("REGR_SYY"),a2=Ht("REGR_SXX"),Aq=Ht("REGR_SXY"),c2=Ht("REGR_AVGX"),Mq=Ht("REGR_AVGY"),l2=Ht("FIRST"),u2=Ht("LAST"),mu=Ht("ARG_MIN"),yu=Ht("ARG_MAX"),f2=Ht("STRING_AGG"),d2=Ht("ARRAY_AGG");function Th(e,t){let n=zt(e),r=j`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 gu=e=>Th(e,"DOUBLE"),h2=e=>Th(e,"INTEGER");var p2=e=>j`epoch_ms(${zt(e)})`,m2=e=>{let t=zt(e);return j`MAKE_DATE(2012, MONTH(${t}), 1)`.annotate({label:"month"})},y2=e=>{let t=zt(e);return j`MAKE_DATE(2012, MONTH(${t}), DAY(${t}))`.annotate({label:"date"})},g2=e=>{let t=zt(e);return j`MAKE_DATE(2012, 1, DAY(${t}))`.annotate({label:"date"})};var Eh=vn("ST_AsGeoJSON"),_D=vn("ST_X"),wD=vn("ST_Y"),Ah=vn("ST_CENTROID"),b2=e=>_D(Ah(e)),x2=e=>wD(Ah(e));var yt=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 qc("UNION",t.flat())}static unionAll(...t){return new qc("UNION ALL",t.flat())}static intersect(...t){return new qc("INTERSECT",t.flat())}static except(...t){return new qc("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:zt(i)});else if(i instanceof gr)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:f0(o),expr:zt(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:Bc(i)});else if(i instanceof gr)r.push({as:i.table,from:i});else if(d0(i)||u0(i))r.push({from:i});else if(Array.isArray(i))r.push({as:f0(i[0]),from:Bc(i[1])});else for(let o in i)r.push({as:f0(o),from:Bc(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(zt)),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:f0(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(zt)),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(d0(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:d,with:h}=this.query,p=[];if(h.length){let g=h.map(({as:y,query:b})=>`"${y}" AS (${b})`);p.push(`WITH ${g.join(", ")}`)}let m=t.map(({as:g,expr:y})=>hD(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=d0(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,_=g?`${g} ROWS`:`${y} PERCENT`,v=b?` (${b}${x!=null?`, ${x}`:""})`:"";p.push(`USING SAMPLE ${_}${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(d)&&p.push(`OFFSET ${d}`),p.join(" ")}},qc=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(zt)),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 d0(e){return e instanceof yt||e instanceof qc}function f0(e){return Nq(e)?e.slice(1,-1):e}function Nq(e){return e[0]==='"'&&e[e.length-1]==='"'}var h0=e=>e;function Rq(){return{apply:h0,invert:h0,sqlApply:zt,sqlInvert:h0}}function Oq({base:e}={}){if(e==null||e===Math.E)return{apply:Math.log,invert:Math.exp,sqlApply:t=>j`LN(${zt(t)})`,sqlInvert:t=>j`EXP(${t})`};if(e===10)return{apply:Math.log10,invert:t=>Math.pow(10,t),sqlApply:t=>j`LOG(${zt(t)})`,sqlInvert:t=>j`POW(10, ${t})`};{let t=+e;return{apply:n=>Math.log(n)/Math.log(t),invert:n=>Math.pow(t,n),sqlApply:n=>j`LN(${zt(n)}) / LN(${t})`,sqlInvert:n=>j`POW(${t}, ${n})`}}}function Dq({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=zt(n),j`SIGN(${n}) * LN(${t} + ABS(${n}))`),sqlInvert:n=>j`SIGN(${n}) * (EXP(ABS(${n})) - ${t})`}}function kq(){return{apply:e=>Math.sign(e)*Math.sqrt(Math.abs(e)),invert:e=>Math.sign(e)*e*e,sqlApply:e=>(e=zt(e),j`SIGN(${e}) * SQRT(ABS(${e}))`),sqlInvert:e=>j`SIGN(${e}) * (${e}) ** 2`}}function Fq({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=zt(n),j`SIGN(${n}) * POW(ABS(${n}), ${t})`),sqlInvert:n=>j`SIGN(${n}) * POW(ABS(${n}), 1/${t})`}}function vD(){return{apply:e=>+e,invert:e=>new Date(e),sqlApply:e=>e instanceof Date?+e:p2(zt(e)),sqlInvert:h0}}var Lq={linear:Rq,log:Oq,symlog:Dq,sqrt:kq,pow:Fq,time:vD,utc:vD};function Mh(e){let t=Lq[e.type];return t?{...e,...t(e)}:null}function Ea(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 _2(e){return`INSTALL ${e}; LOAD ${e}`}function SD(e,{columns:t=Object.keys(e?.[0]||{})}={}){let n=[];if(Array.isArray(t)?(n=t,t=n.reduce((i,o)=>(i[o]=o,i),{})):t&&(n=Object.keys(t)),!n.length)throw new Error("Can not create table from empty column set.");let r=[];for(let i of e){let o=n.map(s=>`${so(i[s])} AS "${t[s]}"`);r.push(`(SELECT ${o.join(", ")})`)}return r.join(" UNION ALL ")}function p0(e,t,n,r={},i={}){let{select:o=["*"],where:s,view:a,temp:c,replace:l,...u}=r,f=Cq({...i,...u}),d=`${e}('${n}'${f?", "+f:""})`,h=s?` WHERE ${s}`:"",p=`SELECT ${o.join(", ")} FROM ${d}${h}`;return Ea(t,p,{view:a,temp:c,replace:l})}function v2(e,t,n){return p0("read_csv",e,t,n,{auto_detect:!0,sample_size:-1})}function S2(e,t,n){return p0("read_json",e,t,n,{auto_detect:!0,json_format:"auto"})}function I2(e,t,n){return p0("read_parquet",e,t,n)}function T2(e,t,n={}){let{options:r,...i}=n;if(r){let o=Array.isArray(r)?r.join(", "):typeof r=="string"?r:Object.entries(r).map(([s,a])=>`${s}=${a}`).join(", ");i.open_options=o.toUpperCase()}return p0("st_read",e,t,i)}function E2(e,t,n={}){let{select:r=["*"],...i}=n,o=SD(t),s=r.length===1&&r[0]==="*"?o:`SELECT ${r} FROM ${o}`;return Ea(e,s,i)}function Cq(e){return Object.entries(e).map(([t,n])=>`${t}=${w2(n)}`).join(", ")}function w2(e){switch(typeof e){case"boolean":return String(e);case"string":return`'${e}'`;case"undefined":case"object":return e==null?"NULL":Array.isArray(e)?"["+e.map(t=>w2(t)).join(", ")+"]":"{"+Object.entries(e).map(([t,n])=>`'${t}': ${w2(n)}`).join(", ")+"}";default:return e}}function ID(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 Bq="count",Pq="nulls",$q="max",Uq="min",zq="distinct";var qq={[Bq]:kr,[zq]:e=>kr(e).distinct(),[$q]:Jr,[Uq]:ti,[Pq]:e=>kr().where($c(e))};function TD({table:e,column:t},n){return yt.from(e).select(n.map(r=>[r,qq[r](t)]))}var ED=()=>Object.create(null),m0=class{constructor(t){this.mc=t,this.clear()}clear(){this.tables=ED()}tableInfo(t){let n=this.tables;if(n[t])return n[t];let r=jq(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(TD(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 Vq(this,t);return(await Promise.all(n.map(i=>this.fieldInfo(i)))).filter(i=>i)}};async function jq(e,t){let n=await e.query(`DESCRIBE ${Bc(t)}`,{type:"json",cache:!1}),r=ED();for(let i of n)r[i.column_name]={table:t,column:i.column_name,sqlType:i.column_type,type:ID(i.column_type),nullable:i.null==="YES"};return r}async function Vq(e,t){return t.length===1&&t[0].column==="*"?Object.values(await e.tableInfo(t[0].table)):t}function MD(e){let t=2166136261;for(let n=0,r=e.length;n<r;++n){let i=e.charCodeAt(n),o=i&65280;o&&(t=AD(t^o>>8)),t=AD(t^i&255)}return Yq(t)}function AD(e){return e+(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}function Yq(e){return e+=e<<13,e^=e>>>7,e+=e<<3,e^=e>>>17,e+=e<<5,e&4294967295}var y0=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,RD),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=Gq(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=RD(l),f=l.query(o.predicate(l)).select({...i.columns,...u.count}).groupby(Object.keys(i.columns)),[d]=f.subqueries;if(d){let b=Object.values(i.columns).map(x=>x.columns[0]);Xq(d,b)}let h=f.orderby();f.query.orderby=[];let p=f.toString(),g=`cube_index_${(MD(p)>>>0).toString(16)}`,y=a.exec(Ea(g,p,{temp:c}));s.set(l,{table:g,result:y,order:h,...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=yt.select(o,s).from(i).groupby(o).where(n).orderby(a);return this.mc.updateClient(t,c)}};function Gq(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=>Wq(l,s));if(c.some(l=>l==null))return null;c.length===1?(a=l=>l?Te("active0",l.range.map(c[0])):[],r={active0:c[0](e.predicate.field)}):(a=l=>l?Xn(l.children.map(({range:u},f)=>Te(`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 Wq(e,t){let{apply:n,sqlApply:r}=Mh(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=>j`${l}FLOOR(${c}::DOUBLE * (${r(u)} - ${s}::DOUBLE))::INTEGER`}}var ND={from:NaN};function RD(e){if(!e.filterIndexable)return ND;let t=e.query(),n=A2(t);if(!n||!t.groupby)return ND;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]:j`SUM("${a}")::DOUBLE`});break;case"AVG":s="_count_",i.push({[a]:j`(SUM("${a}" * ${s}) / SUM(${s}))::DOUBLE`});break;case"MAX":i.push({[a]:j`MAX("${a}")`});break;case"MIN":i.push({[a]:j`MIN("${a}")`});break;default:if(r.has(a))o.push(a);else return null}return{aggr:i,dims:o,count:s?{[s]:j`COUNT(*)`}:{},from:n}}function A2(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=A2(t[0]);for(let r=1;r<t.length;++r){let i=A2(t[r]);if(i!==void 0&&i!==n)return NaN}return n}function Xq(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 g0=class{constructor(t,n,r=!0){this.mc=t,this.selection=n,this.clients=new Set,this.indexer=r?new y0(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():Hq(t,r,i)}};function Hq(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 b0(){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 Zq(e){return(typeof requestAnimationFrame<"u"?requestAnimationFrame:typeof setImmediate<"u"?setImmediate:setTimeout)(e)}function OD(e,t,n){let r=[],i=0;function o(){let s=Qq(r,t);r=[],i=0;for(let a of s)Jq(a,e,n),nj(a,t)}return{add(s,a){s.request.type==="arrow"?(i=i||Zq(()=>o()),r.push({entry:s,priority:a,index:r.length})):e(s,a)}}}function Qq(e,t){let n=[],r=new Map;for(let i of e){let{entry:{request:o}}=i,s=Kq(o.query,t);if(!r.has(s)){let a=[];n.push(a),r.set(s,a)}r.get(s).push(i)}return n}function Kq(e,t){let n=`${e}`;if(e instanceof yt&&!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 gr&&o[s.column]||s))}return`${r}`}else return n}function Jq(e,t,n){if(tj(e))t({request:{type:"arrow",cache:!1,record:!1,query:ej(e,n)},result:e.result=b0()});else for(let{entry:r,priority:i}of e)t(r,i)}function tj(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 ej(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[d]=r.get(f);c.push([d,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 gr&&s[a.column]||a))}return i.$select(Array.from(r.values()))}async function nj(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=rj(i,n[s]);a.cache&&t.set(String(a.query),l),c.fulfill(l)})}function rj(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 ij=typeof requestIdleCallback<"u"?requestIdleCallback:setTimeout,DD=()=>({get:()=>{},set:(e,t)=>t,clear:()=>{}});function kD({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&&ij(r),o},clear(){n=new Map}}}function FD(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 ao={High:0,Normal:1,Low:2};function LD(){let e=FD(3),t,n,r,i=[],o=null,s;function a(){if(o||e.isEmpty())return;let{request:f,result:d}=e.next();o=u(f,d),o.finally(()=>{o=null,a()})}function c(f,d=ao.Normal){e.insert(f,d),a()}function l(f){i.length&&f&&i.forEach(d=>d.add(f))}async function u(f,d){try{let{query:h,type:p,cache:m=!1,record:g=!0,options:y}=f,b=h?`${h}`:null;if(g&&l(b),m){let v=n.get(b);if(v){r.debug("Cache"),d.fulfill(v);return}}let x=performance.now(),_=await t.query({type:p,sql:b,...y});m&&n.set(b,_),r.debug(`Request: ${(performance.now()-x).toFixed(1)}`),d.fulfill(_)}catch(h){d.reject(h)}}return{cache(f){return f!==void 0?n=f===!0?kD():f||DD():n},logger(f){return f?r=f:r},connector(f){return f?t=f:t},consolidate(f){f&&!s?s=OD(c,n,l):!f&&s&&(s=null)},request(f,d=ao.Normal){let h=b0(),p={request:f,result:h};return s?s.add(p,d):c(p,d),h},cancel(f){let d=new Set(f);e.remove(({result:h})=>d.has(h))},clear(){e.remove(({result:f})=>(f.reject("Cleared"),!0))},record(){let f=[],d={add(h){f.push(h)},reset(){f=[]},snapshot(){return f.slice()},stop(){return i=i.filter(h=>h!==d),f}};return i.push(d),d}}}function CD(){return{debug(){},info(){},log(){},warn(){},error(){}}}var x0;function ei(e){return e?x0=e:x0==null&&(x0=new Nh),x0}var Nh=class{constructor(t=l0(),n={}){let{logger:r=console,manager:i=LD()}=n;this.catalog=new m0(this),this.manager=i,this.logger(r),this.configure(n),this.databaseConnector(t),this.clear()}logger(t){return arguments.length&&(this._logger=t||CD(),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=ao.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=ao.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:ao.Low})}createBundle(t,n,r=ao.Low){let i={name:t,queries:n};return this.manager.request({type:"create-bundle",options:i},r)}loadBundle(t,n=ao.High){let r={name:t};return this.manager.request({type:"load-bundle",options:r},n)}updateClient(t,n,r=ao.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 g0(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 _0=class{constructor(){this._callbacks=new Map}addEventListener(t,n){this._callbacks.has(t)||this._callbacks.set(t,{callbacks:new Set,pending:null,queue:new M2}),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}}}},M2=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 Rh(e,t){return e===t?!1:e instanceof Date&&t instanceof Date?+e!=+t:Array.isArray(e)&&Array.isArray(t)?oj(e,t):!0}function oj(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 br(e){return e instanceof Aa}var Aa=class e extends _0{constructor(t){super(),this._value=t}static value(t){return new e(t)}static array(t){if(t.some(n=>br(n))){let n=new e,r=()=>n.update(t.map(i=>br(i)?i.value:i));return r(),t.forEach(i=>br(i)?i.addEventListener("value",r):0),n}return new e(t)}get value(){return this._value}update(t,{force:n}={}){return Rh(this._value,t)||n?this.emit("value",t):this.cancel("value"),this}willEmit(t,n){return t==="value"&&(this._value=n),n}};function ni(e){return e instanceof xs}var xs=class e extends Aa{static intersect({cross:t=!1}={}){return new e(new jc({cross:t}))}static union({cross:t=!1}={}){return new e(new jc({cross:t,union:!0}))}static single({cross:t=!1}={}){return new e(new jc({cross:t,single:!0}))}static crossfilter(){return new e(new jc({cross:!0}))}constructor(t=new jc){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)}},jc=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?Pc(o):o}queueFilter(t){if(this.cross){let n=t.active?.source;return r=>r.active?.source!==n}}};function BD(e="http://localhost:3000/"){return{async query(t){let n=fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return t.type==="exec"?n:t.type==="arrow"?Cc(n):(await n).json()}}}var sj=Object.create,PD=Object.defineProperty,aj=Object.getOwnPropertyDescriptor,cj=Object.getOwnPropertyNames,lj=Object.getPrototypeOf,uj=Object.prototype.hasOwnProperty,fj=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),dj=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cj(t))!uj.call(e,i)&&i!==n&&PD(e,i,{get:()=>t[i],enumerable:!(r=aj(t,i))||r.enumerable});return e},hj=(e,t,n)=>(n=e!=null?sj(lj(e)):{},dj(t||!e||!e.__esModule?PD(n,"default",{value:e,enumerable:!0}):n,e)),pj=fj((e,t)=>{t.exports=Worker}),mj=(e=>(e[e.UNDEFINED=0]="UNDEFINED",e[e.AUTOMATIC=1]="AUTOMATIC",e[e.READ_ONLY=2]="READ_ONLY",e[e.READ_WRITE=3]="READ_WRITE",e))(mj||{}),yj=(e=>(e[e.IDENTIFIER=0]="IDENTIFIER",e[e.NUMERIC_CONSTANT=1]="NUMERIC_CONSTANT",e[e.STRING_CONSTANT=2]="STRING_CONSTANT",e[e.OPERATOR=3]="OPERATOR",e[e.KEYWORD=4]="KEYWORD",e[e.COMMENT=5]="COMMENT",e))(yj||{}),gj=(e=>(e[e.NONE=0]="NONE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARNING=3]="WARNING",e[e.ERROR=4]="ERROR",e))(gj||{}),bj=(e=>(e[e.NONE=0]="NONE",e[e.CONNECT=1]="CONNECT",e[e.DISCONNECT=2]="DISCONNECT",e[e.OPEN=3]="OPEN",e[e.QUERY=4]="QUERY",e[e.INSTANTIATE=5]="INSTANTIATE",e))(bj||{}),xj=(e=>(e[e.NONE=0]="NONE",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR",e[e.START=3]="START",e[e.RUN=4]="RUN",e[e.CAPTURE=5]="CAPTURE",e))(xj||{}),_j=(e=>(e[e.NONE=0]="NONE",e[e.WEB_WORKER=1]="WEB_WORKER",e[e.NODE_WORKER=2]="NODE_WORKER",e[e.BINDINGS=3]="BINDINGS",e[e.ASYNC_DUCKDB=4]="ASYNC_DUCKDB",e))(_j||{}),$D=class{log(e){}},UD=class{constructor(e=2){this.level=e}log(e){e.level>=this.level&&console.log(e)}};var wj=(e=>(e[e.SUCCESS=0]="SUCCESS",e))(wj||{}),vj=class{constructor(e,t){this._bindings=e,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}async query(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.runQuery(this._conn,e),n=nn.from(t);return console.assert(n.isSync(),"Reader is not sync"),console.assert(n.isFile(),"Reader is not file"),new sn(n)}async send(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.startPendingQuery(this._conn,e);for(;t==null;)t=await this._bindings.pollPendingQuery(this._conn);let n=new zD(this._bindings,this._conn,t),r=await nn.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(e){return await this._bindings.getTableNames(this._conn,e)}async prepare(e){let t=await this._bindings.createPrepared(this._conn,e);return new Sj(this._bindings,this._conn,t)}async insertArrowTable(e,t){let n=c0(e,"stream");await this.insertArrowFromIPCStream(n,t)}async insertArrowFromIPCStream(e,t){await this._bindings.insertArrowFromIPCStream(this._conn,e,t)}async insertCSVFromPath(e,t){await this._bindings.insertCSVFromPath(this._conn,e,t)}async insertJSONFromPath(e,t){await this._bindings.insertJSONFromPath(this._conn,e,t)}},zD=class{constructor(e,t,n){this.db=e,this.conn=t,this.header=n,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e;return this._inFlight!=null?(e=await this._inFlight,this._inFlight=null):e=await this.db.fetchQueryResults(this.conn),this._depleted=e.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:e}}[Symbol.asyncIterator](){return this}},Sj=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...e){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,e),n=nn.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),new sn(n)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new zD(this.bindings,this.connectionId,t),r=await nn.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}},Ij=(e=>(e.CANCEL_PENDING_QUERY="CANCEL_PENDING_QUERY",e.CLOSE_PREPARED="CLOSE_PREPARED",e.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",e.CONNECT="CONNECT",e.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",e.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",e.CREATE_PREPARED="CREATE_PREPARED",e.DISCONNECT="DISCONNECT",e.DROP_FILE="DROP_FILE",e.DROP_FILES="DROP_FILES",e.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",e.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",e.FLUSH_FILES="FLUSH_FILES",e.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",e.GET_TABLE_NAMES="GET_TABLE_NAMES",e.GET_VERSION="GET_VERSION",e.GLOB_FILE_INFOS="GLOB_FILE_INFOS",e.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",e.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",e.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",e.INSTANTIATE="INSTANTIATE",e.OPEN="OPEN",e.PING="PING",e.POLL_PENDING_QUERY="POLL_PENDING_QUERY",e.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",e.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",e.REGISTER_FILE_URL="REGISTER_FILE_URL",e.RESET="RESET",e.RUN_PREPARED="RUN_PREPARED",e.RUN_QUERY="RUN_QUERY",e.SEND_PREPARED="SEND_PREPARED",e.START_PENDING_QUERY="START_PENDING_QUERY",e.TOKENIZE="TOKENIZE",e))(Ij||{}),Tj=(e=>(e.CONNECTION_INFO="CONNECTION_INFO",e.ERROR="ERROR",e.FEATURE_FLAGS="FEATURE_FLAGS",e.FILE_BUFFER="FILE_BUFFER",e.FILE_INFOS="FILE_INFOS",e.FILE_SIZE="FILE_SIZE",e.FILE_STATISTICS="FILE_STATISTICS",e.INSTANTIATE_PROGRESS="INSTANTIATE_PROGRESS",e.LOG="LOG",e.OK="OK",e.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",e.QUERY_PLAN="QUERY_PLAN",e.QUERY_RESULT="QUERY_RESULT",e.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",e.QUERY_RESULT_HEADER="QUERY_RESULT_HEADER",e.QUERY_RESULT_HEADER_OR_NULL="QUERY_RESULT_HEADER_OR_NULL",e.REGISTERED_FILE="REGISTERED_FILE",e.SCRIPT_TOKENS="SCRIPT_TOKENS",e.SUCCESS="SUCCESS",e.TABLE_NAMES="TABLE_NAMES",e.VERSION_STRING="VERSION_STRING",e))(Tj||{}),Kt=class{constructor(e,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=e,this.data=t,this.promise=new Promise((n,r)=>{this.promiseResolver=n,this.promiseRejecter=r})}};function w0(e){switch(e.typeId){case D.Binary:return{sqlType:"binary"};case D.Bool:return{sqlType:"bool"};case D.Date:return{sqlType:"date"};case D.DateDay:return{sqlType:"date32[d]"};case D.DateMillisecond:return{sqlType:"date64[ms]"};case D.Decimal:{let t=e;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case D.Float:return{sqlType:"float"};case D.Float16:return{sqlType:"float16"};case D.Float32:return{sqlType:"float32"};case D.Float64:return{sqlType:"float64"};case D.Int:return{sqlType:"int32"};case D.Int16:return{sqlType:"int16"};case D.Int32:return{sqlType:"int32"};case D.Int64:return{sqlType:"int64"};case D.Uint16:return{sqlType:"uint16"};case D.Uint32:return{sqlType:"uint32"};case D.Uint64:return{sqlType:"uint64"};case D.Uint8:return{sqlType:"uint8"};case D.IntervalDayTime:return{sqlType:"interval[dt]"};case D.IntervalYearMonth:return{sqlType:"interval[m]"};case D.List:return{sqlType:"list",valueType:w0(e.valueType)};case D.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:e.byteWidth};case D.Null:return{sqlType:"null"};case D.Utf8:return{sqlType:"utf8"};case D.Struct:return{sqlType:"struct",fields:e.children.map(t=>F2(t.name,t.type))};case D.Map:{let t=e;return{sqlType:"map",keyType:w0(t.keyType),valueType:w0(t.valueType)}}case D.Time:return{sqlType:"time[s]"};case D.TimeMicrosecond:return{sqlType:"time[us]"};case D.TimeMillisecond:return{sqlType:"time[ms]"};case D.TimeNanosecond:return{sqlType:"time[ns]"};case D.TimeSecond:return{sqlType:"time[s]"};case D.Timestamp:return{sqlType:"timestamp",timezone:e.timezone||void 0};case D.TimestampSecond:return{sqlType:"timestamp[s]",timezone:e.timezone||void 0};case D.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:e.timezone||void 0};case D.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:e.timezone||void 0};case D.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:e.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(e.toString()))}function F2(e,t){let n=w0(t);return n.name=e,n}var Ej=new TextEncoder,qD=class{constructor(e,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=e,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(e){this._worker=e,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,n)=>{this._workerShutdownResolver=t})}detach(){this._worker&&(this._worker.removeEventListener("message",this._onMessageHandler),this._worker.removeEventListener("error",this._onErrorHandler),this._worker.removeEventListener("close",this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(e,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let n=this._nextMessageId++;return this._pendingRequests.set(n,e),this._worker.postMessage({messageId:n,type:e.type,data:e.data},t),await e.promise}onMessage(e){var t;let n=e.data;switch(n.type){case"LOG":{this._logger.log(n.data);return}case"INSTANTIATE_PROGRESS":{for(let i of this._onInstantiationProgress)i(n.data);return}}let r=this._pendingRequests.get(n.requestId);if(!r){console.warn("unassociated response: [".concat(n.requestId,", ").concat(n.type.toString(),"]"));return}if(this._pendingRequests.delete(n.requestId),n.type=="ERROR"){let i=new Error(n.data.message);i.name=n.data.name,(t=Object.getOwnPropertyDescriptor(i,"stack"))!=null&&t.writable&&(i.stack=n.data.stack),r.promiseRejecter(i);return}switch(r.type){case"CLOSE_PREPARED":case"COLLECT_FILE_STATISTICS":case"COPY_FILE_TO_PATH":case"DISCONNECT":case"DROP_FILE":case"DROP_FILES":case"FLUSH_FILES":case"INSERT_ARROW_FROM_IPC_STREAM":case"IMPORT_CSV_FROM_PATH":case"IMPORT_JSON_FROM_PATH":case"OPEN":case"PING":case"REGISTER_FILE_BUFFER":case"REGISTER_FILE_HANDLE":case"REGISTER_FILE_URL":case"RESET":if(n.type=="OK"){r.promiseResolver(n.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],n.type=="OK"){r.promiseResolver(n.data);return}break;case"GLOB_FILE_INFOS":if(n.type=="FILE_INFOS"){r.promiseResolver(n.data);return}break;case"GET_VERSION":if(n.type=="VERSION_STRING"){r.promiseResolver(n.data);return}break;case"GET_FEATURE_FLAGS":if(n.type=="FEATURE_FLAGS"){r.promiseResolver(n.data);return}break;case"GET_TABLE_NAMES":if(n.type=="TABLE_NAMES"){r.promiseResolver(n.data);return}break;case"TOKENIZE":if(n.type=="SCRIPT_TOKENS"){r.promiseResolver(n.data);return}break;case"COPY_FILE_TO_BUFFER":if(n.type=="FILE_BUFFER"){r.promiseResolver(n.data);return}break;case"EXPORT_FILE_STATISTICS":if(n.type=="FILE_STATISTICS"){r.promiseResolver(n.data);return}break;case"CONNECT":if(n.type=="CONNECTION_INFO"){r.promiseResolver(n.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(n.type=="QUERY_RESULT"){r.promiseResolver(n.data);return}break;case"SEND_PREPARED":if(n.type=="QUERY_RESULT_HEADER"){r.promiseResolver(n.data);return}break;case"START_PENDING_QUERY":if(n.type=="QUERY_RESULT_HEADER_OR_NULL"){r.promiseResolver(n.data);return}break;case"POLL_PENDING_QUERY":if(n.type=="QUERY_RESULT_HEADER_OR_NULL"){r.promiseResolver(n.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],n.type=="SUCCESS"){r.promiseResolver(n.data);return}break;case"FETCH_QUERY_RESULTS":if(n.type=="QUERY_RESULT_CHUNK"){r.promiseResolver(n.data);return}break;case"CREATE_PREPARED":if(n.type=="PREPARED_STATEMENT_ID"){r.promiseResolver(n.data);return}break}r.promiseRejecter(new Error("unexpected response type: ".concat(n.type.toString())))}onError(e){console.error(e),console.error("error in duckdb worker: ".concat(e.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let e=new Kt("RESET",null);return await this.postTask(e)}async ping(){let e=new Kt("PING",null);await this.postTask(e)}async dropFile(e){let t=new Kt("DROP_FILE",e);return await this.postTask(t)}async dropFiles(){let e=new Kt("DROP_FILES",null);return await this.postTask(e)}async flushFiles(){let e=new Kt("FLUSH_FILES",null);return await this.postTask(e)}async instantiate(e,t=null,n=r=>{}){this._onInstantiationProgress.push(n);let r=new Kt("INSTANTIATE",[e,t]);return await this.postTask(r)}async getVersion(){let e=new Kt("GET_VERSION",null);return await this.postTask(e)}async getFeatureFlags(){let e=new Kt("GET_FEATURE_FLAGS",null);return await this.postTask(e)}async open(e){let t=new Kt("OPEN",e);await this.postTask(t)}async tokenize(e){let t=new Kt("TOKENIZE",e);return await this.postTask(t)}async connectInternal(){let e=new Kt("CONNECT",null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new vj(this,e)}async disconnect(e){let t=new Kt("DISCONNECT",e);await this.postTask(t)}async runQuery(e,t){let n=new Kt("RUN_QUERY",[e,t]);return await this.postTask(n)}async startPendingQuery(e,t){let n=new Kt("START_PENDING_QUERY",[e,t]);return await this.postTask(n)}async pollPendingQuery(e){let t=new Kt("POLL_PENDING_QUERY",e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new Kt("CANCEL_PENDING_QUERY",e);return await this.postTask(t)}async fetchQueryResults(e){let t=new Kt("FETCH_QUERY_RESULTS",e);return await this.postTask(t)}async getTableNames(e,t){let n=new Kt("GET_TABLE_NAMES",[e,t]);return await this.postTask(n)}async createPrepared(e,t){let n=new Kt("CREATE_PREPARED",[e,t]);return await this.postTask(n)}async closePrepared(e,t){let n=new Kt("CLOSE_PREPARED",[e,t]);await this.postTask(n)}async runPrepared(e,t,n){let r=new Kt("RUN_PREPARED",[e,t,n]);return await this.postTask(r)}async sendPrepared(e,t,n){let r=new Kt("SEND_PREPARED",[e,t,n]);return await this.postTask(r)}async globFiles(e){let t=new Kt("GLOB_FILE_INFOS",e);return await this.postTask(t)}async registerFileText(e,t){let n=Ej.encode(t);await this.registerFileBuffer(e,n)}async registerFileURL(e,t,n,r){t===void 0&&(t=e);let i=new Kt("REGISTER_FILE_URL",[e,t,n,r]);await this.postTask(i)}async registerEmptyFileBuffer(e){let t=new Kt("REGISTER_FILE_BUFFER",[e,new Uint8Array]);await this.postTask(t)}async registerFileBuffer(e,t){let n=new Kt("REGISTER_FILE_BUFFER",[e,t]);await this.postTask(n,[t.buffer])}async registerFileHandle(e,t,n,r){let i=new Kt("REGISTER_FILE_HANDLE",[e,t,n,r]);await this.postTask(i,[])}async collectFileStatistics(e,t){let n=new Kt("COLLECT_FILE_STATISTICS",[e,t]);await this.postTask(n,[])}async exportFileStatistics(e){let t=new Kt("EXPORT_FILE_STATISTICS",e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new Kt("COPY_FILE_TO_BUFFER",e);return await this.postTask(t)}async copyFileToPath(e,t){let n=new Kt("COPY_FILE_TO_PATH",[e,t]);await this.postTask(n)}async insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let r=new Kt("INSERT_ARROW_FROM_IPC_STREAM",[e,t,n]);await this.postTask(r,[t.buffer])}async insertCSVFromPath(e,t,n){if(n.columns!==void 0){let i=[];for(let o in n.columns){let s=n.columns[o];i.push(F2(o,s))}n.columnsFlat=i,delete n.columns}let r=new Kt("IMPORT_CSV_FROM_PATH",[e,t,n]);await this.postTask(r)}async insertJSONFromPath(e,t,n){if(n.columns!==void 0){let i=[];for(let o in n.columns){let s=n.columns[o];i.push(F2(o,s))}n.columnsFlat=i,delete n.columns}let r=new Kt("IMPORT_JSON_FROM_PATH",[e,t,n]);await this.postTask(r)}};var Aj=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),Mj=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),Nj=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),Rj=()=>(async e=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),L2={name:"@duckdb/duckdb-wasm",version:"1.28.1-dev99.0",description:"DuckDB powered by WebAssembly",license:"MIT",repository:{type:"git",url:"https://github.com/duckdb/duckdb-wasm.git"},keywords:["sql","duckdb","relational","database","data","query","wasm","analytics","olap","arrow","parquet","json","csv"],dependencies:{"apache-arrow":"^14.0.1"},devDependencies:{"@types/emscripten":"^1.39.10","@types/jasmine":"^5.1.4","@typescript-eslint/eslint-plugin":"^6.18.0","@typescript-eslint/parser":"^6.18.0",esbuild:"^0.19.10",eslint:"^8.56.0","eslint-plugin-jasmine":"^4.1.3","eslint-plugin-react":"^7.33.2","fast-glob":"^3.3.2",jasmine:"^5.1.0","jasmine-core":"^5.1.1","jasmine-spec-reporter":"^7.0.0","js-sha256":"^0.10.1",karma:"^6.4.2","karma-chrome-launcher":"^3.2.0","karma-coverage":"^2.2.1","karma-firefox-launcher":"^2.1.2","karma-jasmine":"^5.1.0","karma-jasmine-html-reporter":"^2.1.0","karma-sourcemap-loader":"^0.4.0","karma-spec-reporter":"^0.0.36","make-dir":"^4.0.0",nyc:"^15.1.0",prettier:"^3.2.2",puppeteer:"^21.7.0",rimraf:"^5.0.5",s3rver:"^3.7.1",typedoc:"^0.25.7",typescript:"^5.3.3","wasm-feature-detect":"^1.6.1","web-worker":"^1.2.0"},scripts:{"build:debug":"node bundle.mjs debug && tsc --emitDeclarationOnly","build:release":"node bundle.mjs release && tsc --emitDeclarationOnly",docs:"typedoc",report:"node ./coverage.mjs","test:node":"node --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs","test:node:debug":"node --inspect-brk --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs","test:node:coverage":"nyc -r json --report-dir ./coverage/node node ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs","test:firefox":"karma start ./karma/tests-firefox.cjs","test:chrome":"karma start ./karma/tests-chrome.cjs","test:chrome:eh":"karma start ./karma/tests-chrome-eh.cjs","test:chrome:coverage":"karma start ./karma/tests-chrome-coverage.cjs","test:browser":"karma start ./karma/tests-all.cjs","test:browser:debug":"karma start ./karma/tests-debug.cjs",test:"npm run test:chrome && npm run test:node","test:coverage":"npm run test:chrome:coverage && npm run test:node:coverage && npm run report",lint:"eslint src test"},files:["dist","!dist/types/test"],main:"dist/duckdb-browser.cjs",module:"dist/duckdb-browser.mjs",types:"dist/duckdb-browser.d.ts",jsdelivr:"dist/duckdb-browser.cjs",unpkg:"dist/duckdb-browser.mjs",sideEffects:!1,browser:{fs:!1,path:!1,perf_hooks:!1,os:!1,worker_threads:!1},exports:{"./dist/duckdb-mvp.wasm":"./dist/duckdb-mvp.wasm","./dist/duckdb-eh.wasm":"./dist/duckdb-eh.wasm","./dist/duckdb-coi.wasm":"./dist/duckdb-coi.wasm","./dist/duckdb-browser":"./dist/duckdb-browser.mjs","./dist/duckdb-browser.cjs":"./dist/duckdb-browser.cjs","./dist/duckdb-browser.mjs":"./dist/duckdb-browser.mjs","./dist/duckdb-browser-blocking":"./dist/duckdb-browser-blocking.mjs","./dist/duckdb-browser-blocking.mjs":"./dist/duckdb-browser-blocking.mjs","./dist/duckdb-browser-blocking.cjs":"./dist/duckdb-browser-blocking.cjs","./dist/duckdb-browser-coi.pthread.worker.js":"./dist/duckdb-browser-coi.pthread.worker.js","./dist/duckdb-browser-coi.worker.js":"./dist/duckdb-browser-coi.worker.js","./dist/duckdb-browser-eh.worker.js":"./dist/duckdb-browser-eh.worker.js","./dist/duckdb-browser-mvp.worker.js":"./dist/duckdb-browser-mvp.worker.js","./dist/duckdb-node":"./dist/duckdb-node.cjs","./dist/duckdb-node.cjs":"./dist/duckdb-node.cjs","./dist/duckdb-node-blocking":"./dist/duckdb-node-blocking.cjs","./dist/duckdb-node-blocking.cjs":"./dist/duckdb-node-blocking.cjs","./dist/duckdb-node-eh.worker.cjs":"./dist/duckdb-node-eh.worker.cjs","./dist/duckdb-node-mvp.worker.cjs":"./dist/duckdb-node-mvp.worker.cjs","./blocking":{browser:{types:"./dist/duckdb-browser-blocking.d.ts",import:"./dist/duckdb-browser-blocking.mjs",require:"./dist/duckdb-browser-blocking.cjs"},node:{types:"./dist/duckdb-node-blocking.d.ts",require:"./dist/duckdb-node-blocking.cjs",import:"./dist/duckdb-node-blocking.cjs"},types:"./dist/duckdb-browser-blocking.d.ts",import:"./dist/duckdb-browser-blocking.mjs",require:"./dist/duckdb-browser-blocking.cjs"},".":{browser:{types:"./dist/duckdb-browser.d.ts",import:"./dist/duckdb-browser.mjs",require:"./dist/duckdb-browser.cjs"},node:{types:"./dist/duckdb-node.d.ts",import:"./dist/duckdb-node.cjs",require:"./dist/duckdb-node.cjs"},types:"./dist/duckdb-browser.d.ts",import:"./dist/duckdb-browser.mjs",require:"./dist/duckdb-browser.cjs"}}},Oj=L2.name,Dj=L2.version,C2=L2.version.split("."),eht=C2[0],nht=C2[1],rht=C2[2],kj=()=>typeof navigator>"u";function jD(){let e="https://cdn.jsdelivr.net/npm/".concat(Oj,"@").concat(Dj,"/dist/");return{mvp:{mainModule:"".concat(e,"duckdb-mvp.wasm"),mainWorker:"".concat(e,"duckdb-browser-mvp.worker.js")},eh:{mainModule:"".concat(e,"duckdb-eh.wasm"),mainWorker:"".concat(e,"duckdb-browser-eh.worker.js")}}}var N2=null,R2=null,O2=null,D2=null,k2=null;async function Fj(){return N2==null&&(N2=typeof BigInt64Array<"u"),R2==null&&(R2=await Mj()),O2==null&&(O2=await Rj()),D2==null&&(D2=await Nj()),k2==null&&(k2=await Aj()),{bigInt64Array:N2,crossOriginIsolated:kj()||globalThis.crossOriginIsolated||!1,wasmExceptions:R2,wasmSIMD:D2,wasmThreads:O2,wasmBulkMemory:k2}}async function VD(e){let t=await Fj();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&e.coi)return{mainModule:e.coi.mainModule,mainWorker:e.coi.mainWorker,pthreadWorker:e.coi.pthreadWorker};if(e.eh)return{mainModule:e.eh.mainModule,mainWorker:e.eh.mainWorker,pthreadWorker:null}}return{mainModule:e.mvp.mainModule,mainWorker:e.mvp.mainWorker,pthreadWorker:null}}var iht=hj(pj());function Lj(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}var oht=Lj(),Cj=(e=>(e[e.BUFFER=0]="BUFFER",e[e.NODE_FS=1]="NODE_FS",e[e.BROWSER_FILEREADER=2]="BROWSER_FILEREADER",e[e.BROWSER_FSACCESS=3]="BROWSER_FSACCESS",e[e.HTTP=4]="HTTP",e[e.S3=5]="S3",e))(Cj||{});function YD(e={}){let{duckdb:t,connection:n,...r}=e,i=t,o=n,s;function a(){return s||(s=(i?Promise.resolve(i):Pj(r).then(u=>i=u)).then(u=>u.connect()).then(u=>o=u)),s}async function c(){return i||await a(),i}async function l(){return o||await a(),o}return{getDuckDB:c,getConnection:l,query:async u=>{let{type:f,sql:d}=u,p=await(await l()).query(d);return f==="exec"?void 0:f==="arrow"?p:Array.from(p)}}}async function Pj({log:e=!1}={}){let t=jD(),n=await VD(t),r=URL.createObjectURL(new Blob([`importScripts("${n.mainWorker}");`],{type:"text/javascript"})),i=new Worker(r),o=e?new UD:new $D,s=new qD(o,i);return await s.instantiate(n.mainModule,n.pthreadWorker),URL.revokeObjectURL(r),s}function B2(){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 yR={};vr(yR,{Fixed:()=>co,Param:()=>Aa,Query:()=>yt,Selection:()=>xs,agg:()=>zv,align:()=>dM,and:()=>Xn,area:()=>VN,areaX:()=>YN,areaY:()=>GN,argmax:()=>yu,argmin:()=>mu,arrayAgg:()=>d2,arrow:()=>B4,aspectRatio:()=>hM,avg:()=>qv,axis:()=>pM,axisFx:()=>q4,axisFy:()=>j4,axisX:()=>U4,axisY:()=>z4,barX:()=>ZN,barY:()=>QN,bin:()=>mw,cast:()=>Th,castDouble:()=>gu,castInteger:()=>h2,cell:()=>KN,cellX:()=>JN,cellY:()=>t4,centroid:()=>Ah,centroidX:()=>b2,centroidY:()=>x2,circle:()=>a4,colorBase:()=>J6,colorClamp:()=>q6,colorConstant:()=>eN,colorDomain:()=>U6,colorExponent:()=>tN,colorInterpolate:()=>G6,colorLabel:()=>H6,colorLegend:()=>hR,colorN:()=>j6,colorNice:()=>V6,colorPivot:()=>W6,colorRange:()=>z6,colorReverse:()=>Z6,colorScale:()=>$6,colorScheme:()=>Y6,colorSymmetric:()=>X6,colorTickFormat:()=>K6,colorZero:()=>Q6,column:()=>Sa,contour:()=>T4,coordinator:()=>ei,corr:()=>e2,count:()=>kr,covarPop:()=>n2,create:()=>Ea,cume_dist:()=>kv,dateDay:()=>g2,dateMonth:()=>m2,dateMonthDay:()=>y2,delaunayLink:()=>F4,delaunayMesh:()=>L4,denseLine:()=>I4,dense_rank:()=>Ov,density:()=>S4,densityX:()=>w4,densityY:()=>v4,dot:()=>i4,dotX:()=>o4,dotY:()=>s4,entropy:()=>Kv,eq:()=>ys,facetGrid:()=>B3,facetLabel:()=>P3,facetMargin:()=>D3,facetMarginBottom:()=>F3,facetMarginLeft:()=>L3,facetMarginRight:()=>C3,facetMarginTop:()=>k3,first:()=>l2,first_value:()=>Bv,frame:()=>$4,from:()=>p$,fxAlign:()=>G3,fxAriaDescription:()=>u6,fxAriaLabel:()=>l6,fxAxis:()=>Z3,fxDomain:()=>$3,fxFontVariant:()=>c6,fxGrid:()=>r6,fxInset:()=>q3,fxInsetLeft:()=>j3,fxInsetRight:()=>V3,fxLabel:()=>o6,fxLabelAnchor:()=>s6,fxLabelOffset:()=>a6,fxLine:()=>i6,fxNice:()=>z3,fxPadding:()=>W3,fxPaddingInner:()=>X3,fxPaddingOuter:()=>H3,fxRange:()=>U3,fxReverse:()=>f6,fxRound:()=>Y3,fxTickFormat:()=>e6,fxTickPadding:()=>t6,fxTickRotate:()=>n6,fxTickSize:()=>K3,fxTickSpacing:()=>J3,fxTicks:()=>Q3,fyAlign:()=>x6,fyAriaDescription:()=>B6,fyAriaLabel:()=>C6,fyAxis:()=>S6,fyDomain:()=>d6,fyFontVariant:()=>L6,fyGrid:()=>R6,fyInset:()=>m6,fyInsetBottom:()=>g6,fyInsetTop:()=>y6,fyLabel:()=>D6,fyLabelAnchor:()=>k6,fyLabelOffset:()=>F6,fyLine:()=>O6,fyNice:()=>p6,fyPadding:()=>_6,fyPaddingInner:()=>w6,fyPaddingOuter:()=>v6,fyRange:()=>h6,fyReverse:()=>P6,fyRound:()=>b6,fyTickFormat:()=>M6,fyTickPadding:()=>A6,fyTickRotate:()=>N6,fyTickSize:()=>T6,fyTickSpacing:()=>E6,fyTicks:()=>I6,geo:()=>X4,geojson:()=>Eh,graticule:()=>Z4,grid:()=>yM,gridFx:()=>G4,gridFy:()=>W4,gridX:()=>V4,gridY:()=>Y4,gt:()=>vh,gte:()=>vv,hconcat:()=>a$,heatmap:()=>E4,height:()=>aM,hexagon:()=>c4,hexbin:()=>N4,hexgrid:()=>R4,highlight:()=>Q4,hspace:()=>u$,hull:()=>C4,image:()=>_4,inset:()=>mM,intervalX:()=>rR,intervalXY:()=>oR,intervalY:()=>iR,isBetween:()=>Te,isDistinct:()=>Sv,isNotBetween:()=>Iv,isNotDistinct:()=>Sh,isNotNull:()=>ms,isNull:()=>$c,kurtosis:()=>Qv,label:()=>gM,lag:()=>Lv,last:()=>u2,last_value:()=>Pv,lead:()=>Cv,lengthBase:()=>NN,lengthClamp:()=>EN,lengthConstant:()=>ON,lengthDomain:()=>IN,lengthExponent:()=>RN,lengthNice:()=>AN,lengthRange:()=>TN,lengthScale:()=>SN,lengthZero:()=>MN,line:()=>WN,lineX:()=>XN,lineY:()=>HN,link:()=>P4,literal:()=>Dr,loadCSV:()=>v2,loadExtension:()=>_2,loadJSON:()=>S2,loadObjects:()=>E2,loadParquet:()=>I2,loadSpatial:()=>T2,lt:()=>gs,lte:()=>bs,mad:()=>jv,margin:()=>rM,marginBottom:()=>fM,marginLeft:()=>cM,marginRight:()=>lM,marginTop:()=>uM,margins:()=>nM,max:()=>Jr,median:()=>Yv,menu:()=>e$,min:()=>ti,mode:()=>Wv,name:()=>tM,nearestX:()=>eR,nearestY:()=>nR,neq:()=>Uc,not:()=>wv,nth_value:()=>$v,ntile:()=>Fv,opacityBase:()=>fN,opacityClamp:()=>oN,opacityConstant:()=>hN,opacityDomain:()=>rN,opacityExponent:()=>dN,opacityLabel:()=>aN,opacityLegend:()=>pR,opacityNice:()=>sN,opacityRange:()=>iN,opacityReverse:()=>cN,opacityScale:()=>nN,opacityTickFormat:()=>uN,opacityZero:()=>lN,or:()=>Pc,padding:()=>bM,pan:()=>sR,panX:()=>aR,panY:()=>cR,panZoom:()=>lR,panZoomX:()=>uR,panZoomY:()=>fR,percent_rank:()=>Dv,plot:()=>b$,product:()=>Vv,projectionClip:()=>qN,projectionDomain:()=>CN,projectionInset:()=>BN,projectionInsetBottom:()=>zN,projectionInsetLeft:()=>PN,projectionInsetRight:()=>$N,projectionInsetTop:()=>UN,projectionParallels:()=>kN,projectionPrecision:()=>FN,projectionRotate:()=>LN,projectionType:()=>DN,quantile:()=>Gv,rBase:()=>_N,rClamp:()=>gN,rConstant:()=>vN,rDomain:()=>mN,rExponent:()=>wN,rNice:()=>bN,rRange:()=>yN,rScale:()=>pN,rZero:()=>xN,rank:()=>Rv,raster:()=>A4,rasterTile:()=>M4,rect:()=>e4,rectX:()=>n4,rectY:()=>r4,regressionY:()=>O4,round:()=>xM,row_number:()=>Nv,ruleX:()=>d4,ruleY:()=>h4,search:()=>n$,skewness:()=>Zv,slider:()=>r$,sphere:()=>H4,spike:()=>x4,sql:()=>j,stddev:()=>Hv,stddevPop:()=>t2,stringAgg:()=>f2,style:()=>oM,sum:()=>Fr,symbolLegend:()=>mR,table:()=>i$,text:()=>l4,textX:()=>u4,textY:()=>f4,tickX:()=>p4,tickY:()=>m4,toggle:()=>gd,toggleColor:()=>tR,toggleX:()=>K4,toggleY:()=>J4,varPop:()=>Jv,variance:()=>Xv,vconcat:()=>s$,vector:()=>y4,vectorX:()=>g4,vectorY:()=>b4,voronoi:()=>D4,voronoiMesh:()=>k4,vspace:()=>l$,width:()=>sM,xAlign:()=>NM,xAriaDescription:()=>WM,xAriaLabel:()=>GM,xAxis:()=>kM,xBase:()=>ZM,xClamp:()=>AM,xConstant:()=>KM,xDomain:()=>wM,xExponent:()=>QM,xFontVariant:()=>YM,xGrid:()=>UM,xInset:()=>IM,xInsetLeft:()=>TM,xInsetRight:()=>EM,xLabel:()=>qM,xLabelAnchor:()=>jM,xLabelOffset:()=>VM,xLine:()=>zM,xNice:()=>SM,xPadding:()=>RM,xPaddingInner:()=>OM,xPaddingOuter:()=>DM,xRange:()=>vM,xReverse:()=>XM,xRound:()=>MM,xScale:()=>_M,xTickFormat:()=>PM,xTickPadding:()=>BM,xTickRotate:()=>$M,xTickSize:()=>LM,xTickSpacing:()=>CM,xTicks:()=>FM,xZero:()=>HM,xyDomain:()=>iM,yAlign:()=>c3,yAriaDescription:()=>E3,yAriaLabel:()=>T3,yAxis:()=>d3,yBase:()=>N3,yClamp:()=>s3,yConstant:()=>O3,yDomain:()=>t3,yExponent:()=>R3,yFontVariant:()=>I3,yGrid:()=>x3,yInset:()=>r3,yInsetBottom:()=>o3,yInsetTop:()=>i3,yLabel:()=>w3,yLabelAnchor:()=>v3,yLabelOffset:()=>S3,yLine:()=>_3,yNice:()=>n3,yPadding:()=>l3,yPaddingInner:()=>u3,yPaddingOuter:()=>f3,yRange:()=>e3,yReverse:()=>A3,yRound:()=>a3,yScale:()=>JM,yTickFormat:()=>g3,yTickPadding:()=>y3,yTickRotate:()=>b3,yTickSize:()=>p3,yTickSpacing:()=>m3,yTicks:()=>h3,yZero:()=>M3});var co=Symbol("Fixed"),Sn=Symbol("Transient"),Oh=Symbol("Transform");var ow={};vr(ow,{Area:()=>Fl,Arrow:()=>jm,BarX:()=>Vm,BarY:()=>Ym,Cell:()=>Ll,Contour:()=>ty,Density:()=>ry,Dot:()=>Cl,Frame:()=>Lm,Geo:()=>iy,Hexgrid:()=>oy,Image:()=>sy,Line:()=>Bl,Link:()=>zm,Mark:()=>wt,Raster:()=>Jm,Rect:()=>$l,RuleX:()=>Rm,RuleY:()=>Om,Text:()=>Ol,TickX:()=>Hm,TickY:()=>Zm,Tip:()=>Cm,Vector:()=>kl,area:()=>Um,areaX:()=>cc,areaY:()=>ea,arrow:()=>U7,auto:()=>Q7,autoSpec:()=>rA,axisFx:()=>I_,axisFy:()=>S_,axisX:()=>km,axisY:()=>Dm,barX:()=>Uo,barY:()=>zo,bin:()=>ta,binX:()=>Po,binY:()=>$o,bollinger:()=>dc,bollingerX:()=>rP,bollingerY:()=>iP,boxX:()=>oP,boxY:()=>sP,cell:()=>lc,cellX:()=>q7,cellY:()=>j7,centroid:()=>n9,circle:()=>G7,cluster:()=>e9,column:()=>pn,contour:()=>mP,crosshair:()=>bP,crosshairX:()=>xP,crosshairY:()=>_P,delaunayLink:()=>SP,delaunayMesh:()=>IP,density:()=>NP,differenceY:()=>DP,dodgeX:()=>y9,dodgeY:()=>g9,dot:()=>yi,dotX:()=>V7,dotY:()=>Y7,filter:()=>JC,find:()=>c5,formatIsoDate:()=>dE,formatMonth:()=>h5,formatWeekday:()=>p5,frame:()=>Uf,geo:()=>X_,geoCentroid:()=>r9,graticule:()=>FP,gridFx:()=>M_,gridFy:()=>E_,gridX:()=>A_,gridY:()=>T_,group:()=>vm,groupX:()=>tc,groupY:()=>ec,groupZ:()=>wm,hexagon:()=>W7,hexbin:()=>LP,hexgrid:()=>CP,hull:()=>TP,identity:()=>W,image:()=>PP,indexOf:()=>Ae,initializer:()=>Se,interpolateNearest:()=>uA,interpolateNone:()=>W_,interpolatorBarycentric:()=>lA,interpolatorRandomWalk:()=>fA,legend:()=>c7,line:()=>Pl,lineX:()=>uc,lineY:()=>fc,linearRegressionX:()=>zP,linearRegressionY:()=>qP,link:()=>P_,map:()=>_r,mapX:()=>Jf,mapY:()=>td,marks:()=>Je,normalize:()=>rw,normalizeX:()=>w9,normalizeY:()=>v9,plot:()=>Pm,pointer:()=>Lf,pointerX:()=>Cf,pointerY:()=>Al,raster:()=>fP,rect:()=>Wm,rectX:()=>Zf,rectY:()=>Qf,reverse:()=>t5,ruleX:()=>jr,ruleY:()=>Vr,scale:()=>kf,select:()=>I9,selectFirst:()=>DA,selectLast:()=>kA,selectMaxX:()=>A9,selectMaxY:()=>M9,selectMinX:()=>T9,selectMinY:()=>E9,shiftX:()=>S9,shuffle:()=>e5,sort:()=>z1,sphere:()=>kP,spike:()=>qB,stackX:()=>tA,stackX1:()=>O7,stackX2:()=>D7,stackY:()=>eA,stackY1:()=>k7,stackY2:()=>F7,text:()=>Bo,textX:()=>y_,textY:()=>g_,tickX:()=>V_,tickY:()=>Y_,tip:()=>O_,transform:()=>mn,tree:()=>EA,treeLink:()=>J_,treeNode:()=>ay,valueof:()=>mt,vector:()=>jE,vectorX:()=>__,vectorY:()=>w_,voronoi:()=>EP,voronoiMesh:()=>AP,window:()=>ed,windowX:()=>K7,windowY:()=>J7});function Ut(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Hn(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function _s(e){let t,n,r;e.length!==2?(t=Ut,n=(a,c)=>Ut(e(a),c),r=(a,c)=>e(a)-c):(t=e===Ut||e===Hn?e:$j,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 $j(){return 0}function Dh(e){return e===null?NaN:+e}function*GD(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 WD=_s(Ut),XD=WD.right,Uj=WD.left,zj=_s(Dh).center,ws=XD;var kh=HD(ZD),P2=HD(qj);function HD(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?(bu(a,l,i,o,s),bu(a,i,l,o,s),bu(a,l,i,o,s),xu(c,i,l,o,s),xu(c,l,i,o,s),xu(c,i,l,o,s)):a?(bu(a,i,l,o,s),bu(a,l,i,o,s),bu(a,i,l,o,s)):c&&(xu(c,i,l,o,s),xu(c,l,i,o,s),xu(c,i,l,o,s)),t}}function bu(e,t,n,r,i){for(let o=0,s=r*i;o<s;)e(t,n,o,o+=r,1)}function xu(e,t,n,r,i){for(let o=0,s=r*i;o<r;++o)e(t,n,o,o+s,r)}function qj(e){let t=ZD(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 ZD(e){let t=Math.floor(e);if(t===e)return jj(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 d=s,h=s+u;d<h;d+=c)l+=o[Math.min(a,d)];for(let d=s,h=a;d<=h;d+=c)l+=o[Math.min(a,d+u)],i[d]=(l+n*(o[Math.max(s,d-f)]+o[Math.min(a,d+f)]))/r,l-=o[Math.max(s,d-u)]}}function jj(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 lo(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 Vj(e){return e.length|0}function Yj(e){return!(e>0)}function Gj(e){return typeof e!="object"||"length"in e?e:Array.from(e)}function Wj(e){return t=>e(...t)}function v0(...e){let t=typeof e[e.length-1]=="function"&&Wj(e.pop());e=e.map(Gj);let n=e.map(Vj),r=e.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(Yj))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 S0(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 Ma(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 ri(e,t){let n=Ma(e,t);return n&&Math.sqrt(n)}function ae(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 In=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 Zn=class extends Map{constructor(t,n=JD){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($2(this,t))}has(t){return super.has($2(this,t))}set(t,n){return super.set(QD(this,t),n)}delete(t){return super.delete(KD(this,t))}},Qn=class extends Set{constructor(t,n=JD){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($2(this,t))}add(t){return super.add(QD(this,t))}delete(t){return super.delete(KD(this,t))}};function $2({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function QD({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function KD({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function JD(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Fh(e){return e}function an(e,...t){return z2(e,Fh,Fh,t)}function Ci(e,t,...n){return z2(e,Fh,t,n)}function U2(e,t,...n){return z2(e,Array.from,t,n)}function z2(e,t,n,r){return function i(o,s){if(s>=r.length)return n(o);let a=new Zn,c=r[s++],l=-1;for(let u of o){let f=c(u,++l,o),d=a.get(f);d?d.push(u):a.set(f,[u])}for(let[u,f]of a)a.set(u,i(f,s));return t(a)}(e,0)}function q2(e,t){return Array.from(t,n=>e[n])}function uo(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]))),q2(e,r)}return e.sort(Lh(n))}function Lh(e=Ut){if(e===Ut)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 _u(e,t,n){return(t.length!==2?uo(Ci(e,t,n),([r,i],[o,s])=>Ut(i,s)||Ut(r,o)):uo(an(e,n),([r,i],[o,s])=>t(i,s)||Ut(r,o))).map(([r])=>r)}var Xj=Math.sqrt(50),Hj=Math.sqrt(10),Zj=Math.sqrt(2);function I0(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>=Xj?10:o>=Hj?5:o>=Zj?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?I0(e,t,n*2):[a,c,l]}function Tn(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?I0(t,e,n):I0(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 vs(e,t,n){return t=+t,e=+e,n=+n,I0(e,t,n)[2]}function wu(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?vs(t,e,n):vs(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function vu(e,t,n){let r;for(;;){let i=vs(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 Na(e){return Math.max(1,Math.ceil(Math.log(lo(e))/Math.LN2)+1)}function Gt(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 T0(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 ce(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 E0(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 A0(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:Lh(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),d=.5*Math.sqrt(u*f*(c-f)/c)*(l-c/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/c+d)),p=Math.min(r,Math.floor(t+(c-l)*f/c+d));A0(e,t,h,p,i)}let o=e[t],s=n,a=r;for(Ch(e,n,t),i(e[r],o)>0&&Ch(e,n,r);s<a;){for(Ch(e,s,a),++s,--a;i(e[s],o)<0;)++s;for(;i(e[a],o)>0;)--a}i(e[n],o)===0?Ch(e,n,a):(++a,Ch(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function Ch(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Yc(e,t=Ut){let n,r=!1;if(t.length===1){let i;for(let o of e){let s=t(o);(r?Ut(s,i)>0:Ut(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 Kn(e,t,n){if(e=Float64Array.from(GD(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return ce(e);if(t>=1)return Gt(e);var r,i=(r-1)*t,o=Math.floor(i),s=Gt(A0(e,o).subarray(0,o+1)),a=ce(e.subarray(o+1));return s+(a-s)*(i-o)}}function j2(e,t,n=Dh){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 M0(e,t,n){let r=lo(e),i=Kn(e,.75)-Kn(e,.25);return r&&i?Math.ceil((n-t)/(2*i*Math.pow(r,-1/3))):1}function Bh(e,t,n){let r=lo(e),i=ri(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 Bi(e,t){return Kn(e,.5,t)}function*Kj(e){for(let t of e)yield*t}function Su(e){return Array.from(Kj(e))}function Iu(e,t){let n=new Zn;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 N0(e,t=Jj){let n=[],r,i=!1;for(let o of e)i&&n.push(t(r,o)),r=o,i=!0;return n}function Jj(e,t){return[e,t]}function $e(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 Ph(e,t=Ut){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=Ut);let i=(a,c)=>t(n[a],n[c]),o,s;return e=Uint32Array.from(n,(a,c)=>c),e.sort(t===Ut?(a,c)=>Vc(n[a],n[c]):Lh(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 R0(e,t=Ut){let n,r=!1;if(t.length===1){let i;for(let o of e){let s=t(o);(r?Ut(s,i)<0:Ut(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 En(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 Ra(e){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(e).reverse()}function t8(e){return e}var V2=1,Y2=2,G2=3,O0=4,e8=1e-6;function tV(e){return"translate("+e+",0)"}function eV(e){return"translate(0,"+e+")"}function nV(e){return t=>+e(t)}function rV(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function iV(){return!this.__axis}function oV(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===V2||e===O0?-1:1,u=e===O0||e===Y2?"x":"y",f=e===V2||e===G2?tV:eV;function d(h){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):t8),g=Math.max(o,0)+a,y=t.range(),b=+y[0]+c,x=+y[y.length-1]+c,_=(t.bandwidth?rV:nV)(t.copy(),c),v=h.selection?h.selection():h,w=v.selectAll(".domain").data([null]),T=v.selectAll(".tick").data(p,t).order(),M=T.exit(),R=T.enter().append("g").attr("class","tick"),I=T.select("line"),A=T.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),T=T.merge(R),I=I.merge(R.append("line").attr("stroke","currentColor").attr(u+"2",l*o)),A=A.merge(R.append("text").attr("fill","currentColor").attr(u,l*g).attr("dy",e===V2?"0em":e===G2?"0.71em":"0.32em")),h!==v&&(w=w.transition(h),T=T.transition(h),I=I.transition(h),A=A.transition(h),M=M.transition(h).attr("opacity",e8).attr("transform",function(O){return isFinite(O=_(O))?f(O+c):this.getAttribute("transform")}),R.attr("opacity",e8).attr("transform",function(O){var F=this.parentNode.__axis;return f((F&&isFinite(F=F(O))?F:_(O))+c)})),M.remove(),w.attr("d",e===O0||e===Y2?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),T.attr("opacity",1).attr("transform",function(O){return f(_(O)+c)}),I.attr(u+"2",l*o),A.attr(u,l*g).text(m),v.filter(iV).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Y2?"start":e===O0?"end":"middle"),v.each(function(){this.__axis=_})}return d.scale=function(h){return arguments.length?(t=h,d):t},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(h){return arguments.length?(n=h==null?[]:Array.from(h),d):n.slice()},d.tickValues=function(h){return arguments.length?(r=h==null?null:Array.from(h),d):r&&r.slice()},d.tickFormat=function(h){return arguments.length?(i=h,d):i},d.tickSize=function(h){return arguments.length?(o=s=+h,d):o},d.tickSizeInner=function(h){return arguments.length?(o=+h,d):o},d.tickSizeOuter=function(h){return arguments.length?(s=+h,d):s},d.tickPadding=function(h){return arguments.length?(a=+h,d):a},d.offset=function(h){return arguments.length?(c=+h,d):c},d}function W2(e){return oV(G2,e)}var sV={value:()=>{}};function r8(){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 D0(n)}function D0(e){this._=e}function aV(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}})}D0.prototype=r8.prototype={constructor:D0,on:function(e,t){var n=this._,r=aV(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=cV(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]=n8(n[i],e.name,t);else if(t==null)for(i in n)n[i]=n8(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 D0(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 cV(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function n8(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=sV,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Gc=r8;var k0="http://www.w3.org/1999/xhtml",ii={svg:"http://www.w3.org/2000/svg",xhtml:k0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Is(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ii.hasOwnProperty(t)?{space:ii[t],local:e}:e}function lV(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===k0&&t.documentElement.namespaceURI===k0?t.createElement(e):t.createElementNS(n,e)}}function uV(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ts(e){var t=Is(e);return(t.local?uV:lV)(t)}function fV(){}function Wc(e){return e==null?fV:function(){return this.querySelector(e)}}function i8(e){typeof e!="function"&&(e=Wc(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 X2(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function dV(){return[]}function $h(e){return e==null?dV:function(){return this.querySelectorAll(e)}}function hV(e){return function(){return X2(e.apply(this,arguments))}}function o8(e){typeof e=="function"?e=hV(e):e=$h(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 Uh(e){return function(){return this.matches(e)}}function F0(e){return function(t){return t.matches(e)}}var pV=Array.prototype.find;function mV(e){return function(){return pV.call(this.children,e)}}function yV(){return this.firstElementChild}function s8(e){return this.select(e==null?yV:mV(typeof e=="function"?e:F0(e)))}var gV=Array.prototype.filter;function bV(){return Array.from(this.children)}function xV(e){return function(){return gV.call(this.children,e)}}function a8(e){return this.selectAll(e==null?bV:xV(typeof e=="function"?e:F0(e)))}function c8(e){typeof e!="function"&&(e=Uh(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 L0(e){return new Array(e.length)}function l8(){return new Le(this._enter||this._groups.map(L0),this._parents)}function zh(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}zh.prototype={constructor:zh,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 u8(e){return function(){return e}}function _V(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 zh(e,o[s]);for(;s<c;++s)(a=t[s])&&(i[s]=a)}function wV(e,t,n,r,i,o,s){var a,c,l=new Map,u=t.length,f=o.length,d=new Array(u),h;for(a=0;a<u;++a)(c=t[a])&&(d[a]=h=s.call(c,c.__data__,a,t)+"",l.has(h)?i[a]=c:l.set(h,c));for(a=0;a<f;++a)h=s.call(e,o[a],a,o)+"",(c=l.get(h))?(r[a]=c,c.__data__=o[a],l.delete(h)):n[a]=new zh(e,o[a]);for(a=0;a<u;++a)(c=t[a])&&l.get(d[a])===c&&(i[a]=c)}function vV(e){return e.__data__}function f8(e,t){if(!arguments.length)return Array.from(this,vV);var n=t?wV:_V,r=this._parents,i=this._groups;typeof e!="function"&&(e=u8(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],d=f.length,h=SV(e.call(u,u&&u.__data__,l,r)),p=h.length,m=a[l]=new Array(p),g=s[l]=new Array(p),y=c[l]=new Array(d);n(u,f,m,g,y,h,t);for(var b=0,x=0,_,v;b<p;++b)if(_=m[b]){for(b>=x&&(x=b+1);!(v=g[x])&&++x<p;);_._next=v||null}}return s=new Le(s,r),s._enter=a,s._exit=c,s}function SV(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function d8(){return new Le(this._exit||this._groups.map(L0),this._parents)}function h8(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 p8(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,d=a[c]=new Array(f),h,p=0;p<f;++p)(h=l[p]||u[p])&&(d[p]=h);for(;c<i;++c)a[c]=n[c];return new Le(a,this._parents)}function m8(){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 y8(e){e||(e=IV);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}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 IV(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function g8(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function b8(){return Array.from(this)}function x8(){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 _8(){let e=0;for(let t of this)++e;return e}function w8(){return!this.node()}function v8(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 TV(e){return function(){this.removeAttribute(e)}}function EV(e){return function(){this.removeAttributeNS(e.space,e.local)}}function AV(e,t){return function(){this.setAttribute(e,t)}}function MV(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function NV(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function RV(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 S8(e,t){var n=Is(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?EV:TV:typeof t=="function"?n.local?RV:NV:n.local?MV:AV)(n,t))}function C0(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function OV(e){return function(){this.style.removeProperty(e)}}function DV(e,t,n){return function(){this.style.setProperty(e,t,n)}}function kV(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function I8(e,t,n){return arguments.length>1?this.each((t==null?OV:typeof t=="function"?kV:DV)(e,t,n??"")):Oa(this.node(),e)}function Oa(e,t){return e.style.getPropertyValue(t)||C0(e).getComputedStyle(e,null).getPropertyValue(t)}function FV(e){return function(){delete this[e]}}function LV(e,t){return function(){this[e]=t}}function CV(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function T8(e,t){return arguments.length>1?this.each((t==null?FV:typeof t=="function"?CV:LV)(e,t)):this.node()[e]}function E8(e){return e.trim().split(/^|\s+/)}function H2(e){return e.classList||new A8(e)}function A8(e){this._node=e,this._names=E8(e.getAttribute("class")||"")}A8.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 M8(e,t){for(var n=H2(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function N8(e,t){for(var n=H2(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function BV(e){return function(){M8(this,e)}}function PV(e){return function(){N8(this,e)}}function $V(e,t){return function(){(t.apply(this,arguments)?M8:N8)(this,e)}}function R8(e,t){var n=E8(e+"");if(arguments.length<2){for(var r=H2(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?$V:t?BV:PV)(n,t))}function UV(){this.textContent=""}function zV(e){return function(){this.textContent=e}}function qV(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function O8(e){return arguments.length?this.each(e==null?UV:(typeof e=="function"?qV:zV)(e)):this.node().textContent}function jV(){this.innerHTML=""}function VV(e){return function(){this.innerHTML=e}}function YV(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function D8(e){return arguments.length?this.each(e==null?jV:(typeof e=="function"?YV:VV)(e)):this.node().innerHTML}function GV(){this.nextSibling&&this.parentNode.appendChild(this)}function k8(){return this.each(GV)}function WV(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function F8(){return this.each(WV)}function L8(e){var t=typeof e=="function"?e:Ts(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function XV(){return null}function C8(e,t){var n=typeof e=="function"?e:Ts(e),r=t==null?XV:typeof t=="function"?t:Wc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function HV(){var e=this.parentNode;e&&e.removeChild(this)}function B8(){return this.each(HV)}function ZV(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function QV(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function P8(e){return this.select(e?QV:ZV)}function $8(e){return arguments.length?this.property("__data__",e):this.node().__data__}function KV(e){return function(t){e.call(this,t,this.__data__)}}function JV(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 tY(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 eY(e,t,n){return function(){var r=this.__on,i,o=KV(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 U8(e,t,n){var r=JV(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?eY:tY,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function z8(e,t,n){var r=C0(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 nY(e,t){return function(){return z8(this,e,t)}}function rY(e,t){return function(){return z8(this,e,t.apply(this,arguments))}}function q8(e,t){return this.each((typeof t=="function"?rY:nY)(e,t))}function*j8(){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 Z2=[null];function Le(e,t){this._groups=e,this._parents=t}function V8(){return new Le([[document.documentElement]],Z2)}function iY(){return this}Le.prototype=V8.prototype={constructor:Le,select:i8,selectAll:o8,selectChild:s8,selectChildren:a8,filter:c8,data:f8,enter:l8,exit:d8,join:h8,merge:p8,selection:iY,order:m8,sort:y8,call:g8,nodes:b8,node:x8,size:_8,empty:w8,each:v8,attr:S8,style:I8,property:T8,classed:R8,text:O8,html:D8,raise:k8,lower:F8,append:L8,insert:C8,remove:B8,clone:P8,datum:$8,on:U8,dispatch:q8,[Symbol.iterator]:j8};var Es=V8;function qt(e){return typeof e=="string"?new Le([[document.querySelector(e)]],[document.documentElement]):new Le([[e]],Z2)}function Y8(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ln(e,t){if(e=Y8(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 B0={capture:!0,passive:!1};function P0(e){e.preventDefault(),e.stopImmediatePropagation()}function qh(e){var t=e.document.documentElement,n=qt(e).on("dragstart.drag",P0,B0);"onselectstart"in t?n.on("selectstart.drag",P0,B0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function jh(e,t){var n=e.document.documentElement,r=qt(e).on("dragstart.drag",null);t&&(r.on("click.drag",P0,B0),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 As(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 ho(){}var ka=.7,Zc=1/ka,Tu="\\s*([+-]?\\d+)\\s*",Vh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oY=/^#([0-9a-f]{3,8})$/,sY=new RegExp(`^rgb\\(${Tu},${Tu},${Tu}\\)$`),aY=new RegExp(`^rgb\\(${fo},${fo},${fo}\\)$`),cY=new RegExp(`^rgba\\(${Tu},${Tu},${Tu},${Vh}\\)$`),lY=new RegExp(`^rgba\\(${fo},${fo},${fo},${Vh}\\)$`),uY=new RegExp(`^hsl\\(${Vh},${fo},${fo}\\)$`),fY=new RegExp(`^hsla\\(${Vh},${fo},${fo},${Vh}\\)$`),G8={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};As(ho,Lr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:W8,formatHex:W8,formatHex8:dY,formatHsl:hY,formatRgb:X8,toString:X8});function W8(){return this.rgb().formatHex()}function dY(){return this.rgb().formatHex8()}function hY(){return tk(this).formatHsl()}function X8(){return this.rgb().formatRgb()}function Lr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=oY.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?H8(t):n===3?new Ye(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$0(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=sY.exec(e))?new Ye(t[1],t[2],t[3],1):(t=aY.exec(e))?new Ye(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cY.exec(e))?$0(t[1],t[2],t[3],t[4]):(t=lY.exec(e))?$0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=uY.exec(e))?K8(t[1],t[2]/100,t[3]/100,1):(t=fY.exec(e))?K8(t[1],t[2]/100,t[3]/100,t[4]):G8.hasOwnProperty(e)?H8(G8[e]):e==="transparent"?new Ye(NaN,NaN,NaN,0):null}function H8(e){return new Ye(e>>16&255,e>>8&255,e&255,1)}function $0(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ye(e,t,n,r)}function Yh(e){return e instanceof ho||(e=Lr(e)),e?(e=e.rgb(),new Ye(e.r,e.g,e.b,e.opacity)):new Ye}function rn(e,t,n,r){return arguments.length===1?Yh(e):new Ye(e,t,n,r??1)}function Ye(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}As(Ye,rn,Da(ho,{brighter(e){return e=e==null?Zc:Math.pow(Zc,e),new Ye(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ka:Math.pow(ka,e),new Ye(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ye(Hc(this.r),Hc(this.g),Hc(this.b),z0(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:Z8,formatHex:Z8,formatHex8:pY,formatRgb:Q8,toString:Q8}));function Z8(){return`#${Xc(this.r)}${Xc(this.g)}${Xc(this.b)}`}function pY(){return`#${Xc(this.r)}${Xc(this.g)}${Xc(this.b)}${Xc((isNaN(this.opacity)?1:this.opacity)*255)}`}function Q8(){let e=z0(this.opacity);return`${e===1?"rgb(":"rgba("}${Hc(this.r)}, ${Hc(this.g)}, ${Hc(this.b)}${e===1?")":`, ${e})`}`}function z0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xc(e){return e=Hc(e),(e<16?"0":"")+e.toString(16)}function K8(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Pi(e,t,n,r)}function tk(e){if(e instanceof Pi)return new Pi(e.h,e.s,e.l,e.opacity);if(e instanceof ho||(e=Lr(e)),!e)return new Pi;if(e instanceof Pi)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 Pi(s,a,c,e.opacity)}function Gh(e,t,n,r){return arguments.length===1?tk(e):new Pi(e,t,n,r??1)}function Pi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}As(Pi,Gh,Da(ho,{brighter(e){return e=e==null?Zc:Math.pow(Zc,e),new Pi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ka:Math.pow(ka,e),new Pi(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 Ye(Q2(e>=240?e-240:e+120,i,r),Q2(e,i,r),Q2(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Pi(J8(this.h),U0(this.s),U0(this.l),z0(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=z0(this.opacity);return`${e===1?"hsl(":"hsla("}${J8(this.h)}, ${U0(this.s)*100}%, ${U0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function J8(e){return e=(e||0)%360,e<0?e+360:e}function U0(e){return Math.max(0,Math.min(1,e||0))}function Q2(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 q0=Math.PI/180,j0=180/Math.PI;var V0=18,ek=.96422,nk=1,rk=.82521,ik=4/29,Eu=6/29,ok=3*Eu*Eu,mY=Eu*Eu*Eu;function sk(e){if(e instanceof po)return new po(e.l,e.a,e.b,e.opacity);if(e instanceof Ms)return ak(e);e instanceof Ye||(e=Yh(e));var t=eS(e.r),n=eS(e.g),r=eS(e.b),i=K2((.2225045*t+.7168786*n+.0606169*r)/nk),o,s;return t===n&&n===r?o=s=i:(o=K2((.4360747*t+.3850649*n+.1430804*r)/ek),s=K2((.0139322*t+.0971045*n+.7141733*r)/rk)),new po(116*i-16,500*(o-i),200*(i-s),e.opacity)}function Au(e,t,n,r){return arguments.length===1?sk(e):new po(e,t,n,r??1)}function po(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}As(po,Au,Da(ho,{brighter(e){return new po(this.l+V0*(e??1),this.a,this.b,this.opacity)},darker(e){return new po(this.l-V0*(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=ek*J2(t),e=nk*J2(e),n=rk*J2(n),new Ye(tS(3.1338561*t-1.6168667*e-.4906146*n),tS(-.9787684*t+1.9161415*e+.033454*n),tS(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function K2(e){return e>mY?Math.pow(e,1/3):e/ok+ik}function J2(e){return e>Eu?e*e*e:ok*(e-ik)}function tS(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function eS(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function yY(e){if(e instanceof Ms)return new Ms(e.h,e.c,e.l,e.opacity);if(e instanceof po||(e=sk(e)),e.a===0&&e.b===0)return new Ms(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*j0;return new Ms(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Wh(e,t,n,r){return arguments.length===1?yY(e):new Ms(e,t,n,r??1)}function Ms(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function ak(e){if(isNaN(e.h))return new po(e.l,0,0,e.opacity);var t=e.h*q0;return new po(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}As(Ms,Wh,Da(ho,{brighter(e){return new Ms(this.h,this.c,this.l+V0*(e??1),this.opacity)},darker(e){return new Ms(this.h,this.c,this.l-V0*(e??1),this.opacity)},rgb(){return ak(this).rgb()}}));var fk=-.14861,nS=1.78277,rS=-.29227,Y0=-.90649,Xh=1.97294,ck=Xh*Y0,lk=Xh*nS,uk=nS*rS-Y0*fk;function gY(e){if(e instanceof Qc)return new Qc(e.h,e.s,e.l,e.opacity);e instanceof Ye||(e=Yh(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(uk*r+ck*t-lk*n)/(uk+ck-lk),o=r-i,s=(Xh*(n-i)-rS*o)/Y0,a=Math.sqrt(s*s+o*o)/(Xh*i*(1-i)),c=a?Math.atan2(s,o)*j0-120:NaN;return new Qc(c<0?c+360:c,a,i,e.opacity)}function Jn(e,t,n,r){return arguments.length===1?gY(e):new Qc(e,t,n,r??1)}function Qc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}As(Qc,Jn,Da(ho,{brighter(e){return e=e==null?Zc:Math.pow(Zc,e),new Qc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ka:Math.pow(ka,e),new Qc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*q0,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Ye(255*(t+n*(fk*r+nS*i)),255*(t+n*(rS*r+Y0*i)),255*(t+n*(Xh*r)),this.opacity)}}));function iS(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 dk(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 iS((n-r/t)*t,s,i,o,a)}}function hk(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 iS((n-r/t)*t,i,o,s,a)}}var Mu=e=>()=>e;function pk(e,t){return function(n){return e+n*t}}function bY(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 Nu(e,t){var n=t-e;return n?pk(e,n>180||n<-180?n-360*Math.round(n/360):n):Mu(isNaN(e)?t:e)}function mk(e){return(e=+e)==1?Ee:function(t,n){return n-t?bY(t,n,e):Mu(isNaN(t)?n:t)}}function Ee(e,t){var n=t-e;return n?pk(e,n):Mu(isNaN(e)?t:e)}var oi=function e(t){var n=mk(t);function r(i,o){var s=n((i=rn(i)).r,(o=rn(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=Ee(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 yk(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=rn(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 oS=yk(dk),xY=yk(hk);function gk(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 bk(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function xk(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]=Cr(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 _k(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function we(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function wk(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]=Cr(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var aS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sS=new RegExp(aS.source,"g");function _Y(e){return function(){return e}}function wY(e){return function(t){return e(t)+""}}function Hh(e,t){var n=aS.lastIndex=sS.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(e=e+"",t=t+"";(r=aS.exec(e))&&(i=sS.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:we(r,i)})),n=sS.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?wY(c[0].x):_Y(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 Cr(e,t){var n=typeof t,r;return t==null||n==="boolean"?Mu(t):(n==="number"?we:n==="string"?(r=Lr(t))?(t=r,oi):Hh:t instanceof Lr?oi:t instanceof Date?_k:bk(t)?gk:Array.isArray(t)?xk:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?wk:we)(e,t)}function Kc(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var vk=180/Math.PI,G0={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cS(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)*vk,skewX:Math.atan(c)*vk,scaleX:s,scaleY:a}}var W0;function Sk(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?G0:cS(t.a,t.b,t.c,t.d,t.e,t.f)}function Ik(e){return e==null?G0:(W0||(W0=document.createElementNS("http://www.w3.org/2000/svg","g")),W0.setAttribute("transform",e),(e=W0.transform.baseVal.consolidate())?(e=e.matrix,cS(e.a,e.b,e.c,e.d,e.e,e.f)):G0)}function Tk(e,t,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,f,d,h,p){if(l!==f||u!==d){var m=h.push("translate(",null,t,null,n);p.push({i:m-4,x:we(l,f)},{i:m-2,x:we(u,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function s(l,u,f,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:we(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(l,u,f,d){l!==u?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:we(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(l,u,f,d,h,p){if(l!==f||u!==d){var m=h.push(i(h)+"scale(",null,",",null,")");p.push({i:m-4,x:we(l,f)},{i:m-2,x:we(u,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(l,u){var f=[],d=[];return l=e(l),u=e(u),o(l.translateX,l.translateY,u.translateX,u.translateY,f,d),s(l.rotate,u.rotate,f,d),a(l.skewX,u.skewX,f,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,d),l=u=null,function(h){for(var p=-1,m=d.length,g;++p<m;)f[(g=d[p]).i]=g.x(h);return f.join("")}}}var lS=Tk(Sk,"px, ","px)","deg)"),uS=Tk(Ik,", ",")",")");var vY=1e-12;function Ek(e){return((e=Math.exp(e))+1/e)/2}function SY(e){return((e=Math.exp(e))-1/e)/2}function IY(e){return((e=Math.exp(2*e))-1)/(e+1)}var fS=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],d=s[2],h=u-a,p=f-c,m=h*h+p*p,g,y;if(m<vY)y=Math.log(d/l)/t,g=function(T){return[a+T*h,c+T*p,l*Math.exp(t*T*y)]};else{var b=Math.sqrt(m),x=(d*d-l*l+r*m)/(2*l*n*b),_=(d*d-l*l-r*m)/(2*d*n*b),v=Math.log(Math.sqrt(x*x+1)-x),w=Math.log(Math.sqrt(_*_+1)-_);y=(w-v)/t,g=function(T){var M=T*y,R=Ek(v),I=l/(n*b)*(R*IY(t*M+v)-SY(v));return[a+I*h,c+I*p,l*R/Ek(t*M+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 Ak(e){return function(t,n){var r=e((t=Gh(t)).h,(n=Gh(n)).h),i=Ee(t.s,n.s),o=Ee(t.l,n.l),s=Ee(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 dS=Ak(Nu),TY=Ak(Ee);function X0(e,t){var n=Ee((e=Au(e)).l,(t=Au(t)).l),r=Ee(e.a,t.a),i=Ee(e.b,t.b),o=Ee(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 Mk(e){return function(t,n){var r=e((t=Wh(t)).h,(n=Wh(n)).h),i=Ee(t.c,n.c),o=Ee(t.l,n.l),s=Ee(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 hS=Mk(Nu),EY=Mk(Ee);function Nk(e){return function t(n){n=+n;function r(i,o){var s=e((i=Jn(i)).h,(o=Jn(o)).h),a=Ee(i.s,o.s),c=Ee(i.l,o.l),l=Ee(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 AY=Nk(Nu),Ru=Nk(Ee);function mo(e,t){t===void 0&&(t=e,e=Cr);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 Cn(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var Ou=0,Qh=0,Zh=0,Ok=1e3,H0,Kh,Z0=0,Jc=0,Q0=0,Jh=typeof performance=="object"&&performance.now?performance:Date,Dk=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ep(){return Jc||(Dk(MY),Jc=Jh.now()+Q0)}function MY(){Jc=0}function tp(){this._call=this._time=this._next=null}tp.prototype=K0.prototype={constructor:tp,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ep():+n)+(t==null?0:+t),!this._next&&Kh!==this&&(Kh?Kh._next=this:H0=this,Kh=this),this._call=e,this._time=n,pS()},stop:function(){this._call&&(this._call=null,this._time=1/0,pS())}};function K0(e,t,n){var r=new tp;return r.restart(e,t,n),r}function kk(){ep(),++Ou;for(var e=H0,t;e;)(t=Jc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ou}function Rk(){Jc=(Z0=Jh.now())+Q0,Ou=Qh=0;try{kk()}finally{Ou=0,RY(),Jc=0}}function NY(){var e=Jh.now(),t=e-Z0;t>Ok&&(Q0-=t,Z0=e)}function RY(){for(var e,t=H0,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:H0=n);Kh=e,pS(r)}function pS(e){if(!Ou){Qh&&(Qh=clearTimeout(Qh));var t=e-Jc;t>24?(e<1/0&&(Qh=setTimeout(Rk,e-Jh.now()-Q0)),Zh&&(Zh=clearInterval(Zh))):(Zh||(Z0=Jh.now(),Zh=setInterval(NY,Ok)),Ou=1,Dk(Rk))}}function J0(e,t,n){var r=new tp;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var OY=Gc("start","end","cancel","interrupt"),DY=[],Ck=0,Fk=1,eb=2,tb=3,Lk=4,nb=5,np=6;function Fa(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;kY(e,n,{name:t,index:r,group:i,on:OY,tween:DY,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Ck})}function rp(e,t){var n=on(e,t);if(n.state>Ck)throw new Error("too late; already scheduled");return n}function An(e,t){var n=on(e,t);if(n.state>tb)throw new Error("too late; already running");return n}function on(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function kY(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=K0(o,0,n.time);function o(l){n.state=Fk,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,f,d,h;if(n.state!==Fk)return c();for(u in r)if(h=r[u],h.name===n.name){if(h.state===tb)return J0(s);h.state===Lk?(h.state=np,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[u]):+u<t&&(h.state=np,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[u])}if(J0(function(){n.state===tb&&(n.state=Lk,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=eb,n.on.call("start",e,e.__data__,n.index,n.group),n.state===eb){for(n.state=tb,i=new Array(d=n.tween.length),u=0,f=-1;u<d;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=h);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=nb,1),f=-1,d=i.length;++f<d;)i[f].call(e,u);n.state===nb&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=np,n.timer.stop(),delete r[t];for(var l in r)return;delete e.__transition}}function yo(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>eb&&r.state<nb,r.state=np,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function Bk(e){return this.each(function(){yo(this,e)})}function FY(e,t){var n,r;return function(){var i=An(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 LY(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=An(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 Pk(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=on(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?FY:LY)(n,e,t))}function Du(e,t,n){var r=e._id;return e.each(function(){var i=An(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return on(i,r).value[t]}}function rb(e,t){var n;return(typeof t=="number"?we:t instanceof Lr?oi:(n=Lr(t))?(t=n,oi):Hh)(e,t)}function CY(e){return function(){this.removeAttribute(e)}}function BY(e){return function(){this.removeAttributeNS(e.space,e.local)}}function PY(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 $Y(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 UY(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 zY(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 $k(e,t){var n=Is(e),r=n==="transform"?uS:rb;return this.attrTween(e,typeof t=="function"?(n.local?zY:UY)(n,r,Du(this,"attr."+e,t)):t==null?(n.local?BY:CY)(n):(n.local?$Y:PY)(n,r,t))}function qY(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function jY(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function VY(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&jY(e,o)),n}return i._value=t,i}function YY(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&qY(e,o)),n}return i._value=t,i}function Uk(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=Is(e);return this.tween(n,(r.local?VY:YY)(r,t))}function GY(e,t){return function(){rp(this,e).delay=+t.apply(this,arguments)}}function WY(e,t){return t=+t,function(){rp(this,e).delay=t}}function zk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?GY:WY)(t,e)):on(this.node(),t).delay}function XY(e,t){return function(){An(this,e).duration=+t.apply(this,arguments)}}function HY(e,t){return t=+t,function(){An(this,e).duration=t}}function qk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?XY:HY)(t,e)):on(this.node(),t).duration}function ZY(e,t){if(typeof t!="function")throw new Error;return function(){An(this,e).ease=t}}function jk(e){var t=this._id;return arguments.length?this.each(ZY(t,e)):on(this.node(),t).ease}function QY(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;An(this,e).ease=n}}function Vk(e){if(typeof e!="function")throw new Error;return this.each(QY(this._id,e))}function Yk(e){typeof e!="function"&&(e=Uh(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 tr(r,this._parents,this._name,this._id)}function Gk(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),d,h=0;h<u;++h)(d=c[h]||l[h])&&(f[h]=d);for(;a<r;++a)s[a]=t[a];return new tr(s,this._parents,this._name,this._id)}function KY(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 JY(e,t,n){var r,i,o=KY(t)?rp:An;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function Wk(e,t){var n=this._id;return arguments.length<2?on(this.node(),n).on.on(e):this.each(JY(n,e,t))}function tG(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Xk(){return this.on("end.remove",tG(this._id))}function Hk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wc(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,d=0;d<c;++d)(u=a[d])&&(f=e.call(u,u.__data__,d,a))&&("__data__"in u&&(f.__data__=u.__data__),l[d]=f,Fa(l[d],t,n,d,l,on(u,n)));return new tr(o,this._parents,t,n)}function Zk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=$h(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 d=e.call(u,u.__data__,f,c),h,p=on(u,n),m=0,g=d.length;m<g;++m)(h=d[m])&&Fa(h,t,n,m,d,p);o.push(d),s.push(u)}return new tr(o,s,t,n)}var eG=Es.prototype.constructor;function Qk(){return new eG(this._groups,this._parents)}function nG(e,t){var n,r,i;return function(){var o=Oa(this,e),s=(this.style.removeProperty(e),Oa(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function Kk(e){return function(){this.style.removeProperty(e)}}function rG(e,t,n){var r,i=n+"",o;return function(){var s=Oa(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function iG(e,t,n){var r,i,o;return function(){var s=Oa(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),Oa(this,e))),s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a))}}function oG(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var c=An(this,e),l=c.on,u=c.value[o]==null?a||(a=Kk(t)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function Jk(e,t,n){var r=(e+="")=="transform"?lS:rb;return t==null?this.styleTween(e,nG(e,r)).on("end.style."+e,Kk(e)):typeof t=="function"?this.styleTween(e,iG(e,r,Du(this,"style."+e,t))).each(oG(this._id,e)):this.styleTween(e,rG(e,r,t),n).on("end.style."+e,null)}function sG(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function aG(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&sG(e,s,n)),r}return o._value=t,o}function tF(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,aG(e,t,n??""))}function cG(e){return function(){this.textContent=e}}function lG(e){return function(){var t=e(this);this.textContent=t??""}}function eF(e){return this.tween("text",typeof e=="function"?lG(Du(this,"text",e)):cG(e==null?"":e+""))}function uG(e){return function(t){this.textContent=e.call(this,t)}}function fG(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&uG(i)),t}return r._value=e,r}function nF(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,fG(e))}function rF(){for(var e=this._name,t=this._id,n=ib(),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=on(c,t);Fa(c,e,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new tr(r,this._parents,e,n)}function iF(){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=An(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 dG=0;function tr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function oF(e){return Es().transition(e)}function ib(){return++dG}var Ns=Es.prototype;tr.prototype=oF.prototype={constructor:tr,select:Hk,selectAll:Zk,selectChild:Ns.selectChild,selectChildren:Ns.selectChildren,filter:Yk,merge:Gk,selection:Qk,transition:rF,call:Ns.call,nodes:Ns.nodes,node:Ns.node,size:Ns.size,empty:Ns.empty,each:Ns.each,on:Wk,attr:$k,attrTween:Uk,style:Jk,styleTween:tF,text:eF,textTween:nF,remove:Xk,tween:Pk,delay:zk,duration:qk,ease:jk,easeVarying:Vk,end:iF,[Symbol.iterator]:Ns[Symbol.iterator]};function ob(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var hG={time:null,delay:0,duration:250,ease:ob};function pG(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 sF(e){var t,n;e instanceof tr?(t=e._id,e=e._name):(t=ib(),(n=hG).time=ep(),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])&&Fa(c,e,t,l,s,n||pG(c,t));return new tr(r,this._parents,e,t)}Es.prototype.interrupt=Bk;Es.prototype.transition=sF;var sb=e=>()=>e;function mS(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 aF(e){e.stopImmediatePropagation()}function ab(e){e.preventDefault(),e.stopImmediatePropagation()}var cF={name:"drag"},yS={name:"space"},ku={name:"handle"},Fu={name:"center"},{abs:lF,max:Bn,min:Pn}=Math;function uF(e){return[+e[0],+e[1]]}function bS(e){return[uF(e[0]),uF(e[1])]}var cb={name:"x",handles:["w","e"].map(ip),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]]}},lb={name:"y",handles:["n","s"].map(ip),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]]}},mG={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(ip),input:function(e){return e==null?null:bS(e)},output:function(e){return e}},Rs={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"},fF={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},dF={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},yG={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},gG={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function ip(e){return{type:e}}function bG(e){return!e.ctrlKey&&!e.button}function xG(){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 _G(){return navigator.maxTouchPoints||"ontouchstart"in this}function gS(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function wG(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function xS(){return vS(cb)}function _S(){return vS(lb)}function wS(){return vS(mG)}function vS(e){var t=xG,n=bG,r=_G,i=!0,o=Gc("start","brush","end"),s=6,a;function c(g){var y=g.property("__brush",m).selectAll(".overlay").data([ip("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Rs.overlay).merge(y).each(function(){var x=gS(this).extent;qt(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([ip("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Rs.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 Rs[x.type]}),g.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).on("touchmove.brush",h).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,_=x.__brush,v=u(x,arguments),w=_.selection,T=e.input(typeof y=="function"?y.apply(this,arguments):y,_.extent),M=Cr(w,T);function R(I){_.selection=I===1&&T===null?null:M(I),l.call(x),v.brush()}return w!==null&&T!==null?R:R(1)}):g.each(function(){var x=this,_=arguments,v=x.__brush,w=e.input(typeof y=="function"?y.apply(x,_):y,v.extent),T=u(x,_).beforestart();yo(x),v.selection=w===null?null:w,l.call(x),T.start(b).brush(b).end(b)})},c.clear=function(g,y){c.move(g,null,y)};function l(){var g=qt(this),y=gS(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=qt(this.that).datum();o.call(g,this.that,new mS(g,{sourceEvent:y,target:c,selection:e.output(this.state.selection),mode:b,dispatch:o}),x)}};function d(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"?cF:i&&g.altKey?Fu:ku,_=e===lb?null:yG[b],v=e===cb?null:gG[b],w=gS(y),T=w.extent,M=w.selection,R=T[0][0],I,A,O=T[0][1],F,S,E=T[1][0],N,L,B=T[1][1],C,P,$=0,U=0,X,tt=_&&v&&i&&g.shiftKey,nt,st,Y=Array.from(g.touches||[g],et=>{let oe=et.identifier;return et=Ln(et,y),et.point0=et.slice(),et.identifier=oe,et});yo(y);var rt=u(y,arguments,!0).beforestart();if(b==="overlay"){M&&(X=!0);let et=[Y[0],Y[1]||Y[0]];w.selection=M=[[I=e===lb?R:Pn(et[0][0],et[1][0]),F=e===cb?O:Pn(et[0][1],et[1][1])],[N=e===lb?E:Bn(et[0][0],et[1][0]),C=e===cb?B:Bn(et[0][1],et[1][1])]],Y.length>1&&Lt(g)}else I=M[0][0],F=M[0][1],N=M[1][0],C=M[1][1];A=I,S=F,L=N,P=C;var q=qt(y).attr("pointer-events","none"),H=q.selectAll(".overlay").attr("cursor",Rs[b]);if(g.touches)rt.moved=z,rt.ended=dt;else{var ot=qt(g.view).on("mousemove.brush",z,!0).on("mouseup.brush",dt,!0);i&&ot.on("keydown.brush",Wt,!0).on("keyup.brush",Xt,!0),qh(g.view)}l.call(y),rt.start(g,x.name);function z(et){for(let oe of et.changedTouches||[et])for(let wr of Y)wr.identifier===oe.identifier&&(wr.cur=Ln(oe,y));if(tt&&!nt&&!st&&Y.length===1){let oe=Y[0];lF(oe.cur[0]-oe[0])>lF(oe.cur[1]-oe[1])?st=!0:nt=!0}for(let oe of Y)oe.cur&&(oe[0]=oe.cur[0],oe[1]=oe.cur[1]);X=!0,ab(et),Lt(et)}function Lt(et){let oe=Y[0],wr=oe.point0;var Gi;switch($=oe[0]-wr[0],U=oe[1]-wr[1],x){case yS:case cF:{_&&($=Bn(R-I,Pn(E-N,$)),A=I+$,L=N+$),v&&(U=Bn(O-F,Pn(B-C,U)),S=F+U,P=C+U);break}case ku:{Y[1]?(_&&(A=Bn(R,Pn(E,Y[0][0])),L=Bn(R,Pn(E,Y[1][0])),_=1),v&&(S=Bn(O,Pn(B,Y[0][1])),P=Bn(O,Pn(B,Y[1][1])),v=1)):(_<0?($=Bn(R-I,Pn(E-I,$)),A=I+$,L=N):_>0&&($=Bn(R-N,Pn(E-N,$)),A=I,L=N+$),v<0?(U=Bn(O-F,Pn(B-F,U)),S=F+U,P=C):v>0&&(U=Bn(O-C,Pn(B-C,U)),S=F,P=C+U));break}case Fu:{_&&(A=Bn(R,Pn(E,I-$*_)),L=Bn(R,Pn(E,N+$*_))),v&&(S=Bn(O,Pn(B,F-U*v)),P=Bn(O,Pn(B,C+U*v)));break}}L<A&&(_*=-1,Gi=I,I=N,N=Gi,Gi=A,A=L,L=Gi,b in fF&&H.attr("cursor",Rs[b=fF[b]])),P<S&&(v*=-1,Gi=F,F=C,C=Gi,Gi=S,S=P,P=Gi,b in dF&&H.attr("cursor",Rs[b=dF[b]])),w.selection&&(M=w.selection),nt&&(A=M[0][0],L=M[1][0]),st&&(S=M[0][1],P=M[1][1]),(M[0][0]!==A||M[0][1]!==S||M[1][0]!==L||M[1][1]!==P)&&(w.selection=[[A,S],[L,P]],l.call(y),rt.brush(et,x.name))}function dt(et){if(aF(et),et.touches){if(et.touches.length)return;a&&clearTimeout(a),a=setTimeout(function(){a=null},500)}else jh(et.view,X),ot.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),H.attr("cursor",Rs.overlay),w.selection&&(M=w.selection),wG(M)&&(w.selection=null,l.call(y)),rt.end(et,x.name)}function Wt(et){switch(et.keyCode){case 16:{tt=_&&v;break}case 18:{x===ku&&(_&&(N=L-$*_,I=A+$*_),v&&(C=P-U*v,F=S+U*v),x=Fu,Lt(et));break}case 32:{(x===ku||x===Fu)&&(_<0?N=L-$:_>0&&(I=A-$),v<0?C=P-U:v>0&&(F=S-U),x=yS,H.attr("cursor",Rs.selection),Lt(et));break}default:return}ab(et)}function Xt(et){switch(et.keyCode){case 16:{tt&&(nt=st=tt=!1,Lt(et));break}case 18:{x===Fu&&(_<0?N=L:_>0&&(I=A),v<0?C=P:v>0&&(F=S),x=ku,Lt(et));break}case 32:{x===yS&&(et.altKey?(_&&(N=L-$*_,I=A+$*_),v&&(C=P-U*v,F=S+U*v),x=Fu):(_<0?N=L:_>0&&(I=A),v<0?C=P:v>0&&(F=S),x=ku),H.attr("cursor",Rs[b]),Lt(et));break}default:return}ab(et)}}function h(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=bS(t.apply(this,arguments)),g.dim=e,g}return c.extent=function(g){return arguments.length?(t=typeof g=="function"?g:sb(bS(g)),c):t},c.filter=function(g){return arguments.length?(n=typeof g=="function"?g:sb(!!g),c):n},c.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:sb(!!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 SS=Math.PI,IS=2*SS,tl=1e-6,vG=IS-tl;function hF(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function SG(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return hF;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 La=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?hF:SG(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,d=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>tl)if(!(Math.abs(f*c-l*u)>tl)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-s,p=i-a,m=c*c+l*l,g=h*h+p*p,y=Math.sqrt(m),b=Math.sqrt(d),x=o*Math.tan((SS-Math.acos((m+d-g)/(2*y*b)))/2),_=x/b,v=x/y;Math.abs(_-1)>tl&&this._append`L${t+_*u},${n+_*f}`,this._append`A${o},${o},0,0,${+(f*h>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,d=s?i-o:o-i;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>tl||Math.abs(this._y1-u)>tl)&&this._append`L${l},${u}`,r&&(d<0&&(d=d%IS+IS),d>vG?this._append`A${r},${r},0,1,${f},${t-a},${n-c}A${r},${r},0,1,${f},${this._x1=l},${this._y1=u}`:d>tl&&this._append`A${r},${r},0,${+(d>=SS)},${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 pF(){return new La}pF.prototype=La.prototype;function er(e=3){return new La(+e)}var IG=Array.prototype,ub=IG.slice;function mF(e,t){return e-t}function yF(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 go=e=>()=>e;function gF(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=TG(e,t[n]))return i;return 0}function TG(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],d=f[0],h=f[1];if(EG(c,f,t))return 0;u>r!=h>r&&n<(d-l)*(r-u)/(h-u)+l&&(i=-i)}return i}function EG(e,t,n){var r;return AG(e,t,n)&&MG(e[r=+(e[0]===t[0])],n[r],t[r])}function AG(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function MG(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function bF(){}var Os=[[],[[[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 Ca(){var e=1,t=1,n=Na,r=c;function i(l){var u=n(l);if(Array.isArray(u))u=u.slice().sort(mF);else{let f=ae(l,NG);for(u=Tn(...vu(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 d=[],h=[];return s(l,f,function(p){r(p,l,f),yF(p)>0?d.push([p]):h.push(p)}),h.forEach(function(p){for(var m=0,g=d.length,y;m<g;++m)if(gF((y=d[m])[0],p)!==-1){y.push(p);return}}),{type:"MultiPolygon",value:u,coordinates:d}}function s(l,u,f){var d=new Array,h=new Array,p,m,g,y,b,x;for(p=m=-1,y=el(l[0],u),Os[y<<1].forEach(_);++p<e-1;)g=y,y=el(l[p+1],u),Os[g|y<<1].forEach(_);for(Os[y<<0].forEach(_);++m<t-1;){for(p=-1,y=el(l[m*e+e],u),b=el(l[m*e],u),Os[y<<1|b<<2].forEach(_);++p<e-1;)g=y,y=el(l[m*e+e+p+1],u),x=b,b=el(l[m*e+p+1],u),Os[g|y<<1|b<<2|x<<3].forEach(_);Os[y|b<<3].forEach(_)}for(p=-1,b=l[m*e]>=u,Os[b<<2].forEach(_);++p<e-1;)x=b,b=el(l[m*e+p+1],u),Os[b<<2|x<<3].forEach(_);Os[b<<3].forEach(_);function _(v){var w=[v[0][0]+p,v[0][1]+m],T=[v[1][0]+p,v[1][1]+m],M=a(w),R=a(T),I,A;(I=h[M])?(A=d[R])?(delete h[I.end],delete d[A.start],I===A?(I.ring.push(T),f(I.ring)):d[I.start]=h[A.end]={start:I.start,end:A.end,ring:I.ring.concat(A.ring)}):(delete h[I.end],I.ring.push(T),h[I.end=R]=I):(I=d[R])?(A=h[M])?(delete d[I.start],delete h[A.end],I===A?(I.ring.push(T),f(I.ring)):d[A.start]=h[I.end]={start:A.start,end:I.end,ring:A.ring.concat(I.ring)}):(delete d[I.start],I.ring.unshift(w),d[I.start=M]=I):d[M]=h[R]={start:M,end:R,ring:[w,T]}}}function a(l){return l[0]*2+l[1]*(e+1)*4}function c(l,u,f){l.forEach(function(d){var h=d[0],p=d[1],m=h|0,g=p|0,y=TS(u[g*e+m]);h>0&&h<e&&m===h&&(d[0]=xF(h,TS(u[g*e+m-1]),y,f)),p>0&&p<t&&g===p&&(d[1]=xF(p,TS(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)?go(ub.call(l)):go(l),i):n},i.smooth=function(l){return arguments.length?(r=l?c:bF,i):r===c},i}function NG(e){return isFinite(e)?e:NaN}function el(e,t){return e==null?!1:+e>=t}function TS(e){return e==null||isNaN(e=+e)?-1/0:e}function xF(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 RG(e){return e[0]}function OG(e){return e[1]}function DG(){return 1}function ES(){var e=RG,t=OG,n=DG,r=960,i=500,o=20,s=2,a=o*3,c=r+a*2>>s,l=i+a*2>>s,u=go(20);function f(b){var x=new Float32Array(c*l),_=Math.pow(2,-s),v=-1;for(let F of b){var w=(e(F,++v,b)+a)*_,T=(t(F,v,b)+a)*_,M=+n(F,v,b);if(M&&w>=0&&w<c&&T>=0&&T<l){var R=Math.floor(w),I=Math.floor(T),A=w-R-.5,O=T-I-.5;x[R+I*c]+=(1-A)*(1-O)*M,x[R+1+I*c]+=A*(1-O)*M,x[R+1+(I+1)*c]+=A*O*M,x[R+(I+1)*c]+=(1-A)*O*M}}return kh({data:x,width:c,height:l},o*_),x}function d(b){var x=f(b),_=u(x),v=Math.pow(2,2*s);return Array.isArray(_)||(_=Tn(Number.MIN_VALUE,Gt(x)/v,_)),Ca().size([c,l]).thresholds(_.map(w=>w*v))(x).map((w,T)=>(w.value=+_[T],h(w)))}d.contours=function(b){var x=f(b),_=Ca().size([c,l]),v=Math.pow(2,2*s),w=T=>{T=+T;var M=h(_.contour(x,T*v));return M.value=T,M};return Object.defineProperty(w,"max",{get:()=>Gt(x)/v}),w};function h(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,d}return d.x=function(b){return arguments.length?(e=typeof b=="function"?b:go(+b),d):e},d.y=function(b){return arguments.length?(t=typeof b=="function"?b:go(+b),d):t},d.weight=function(b){return arguments.length?(n=typeof b=="function"?b:go(+b),d):n},d.size=function(b){if(!arguments.length)return[r,i];var x=+b[0],_=+b[1];if(!(x>=0&&_>=0))throw new Error("invalid size");return r=x,i=_,y()},d.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()},d.thresholds=function(b){return arguments.length?(u=typeof b=="function"?b:Array.isArray(b)?go(ub.call(b)):go(b),d):u},d.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()},d}var Jt=11102230246251565e-32,Ge=134217729,op=(3+8*Jt)*Jt;function nl(e,t,n,r,i){let o,s,a,c,l=t[0],u=r[0],f=0,d=0;u>l==u>-l?(o=l,l=t[++f]):(o=u,u=r[++d]);let h=0;if(f<e&&d<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[++d]),o=s,a!==0&&(i[h++]=a);f<e&&d<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[++d]),o=s,a!==0&&(i[h++]=a);for(;f<e;)s=o+l,c=s-o,a=o-(s-c)+(l-c),l=t[++f],o=s,a!==0&&(i[h++]=a);for(;d<n;)s=o+u,c=s-o,a=o-(s-c)+(u-c),u=r[++d],o=s,a!==0&&(i[h++]=a);return(o!==0||h===0)&&(i[h++]=o),h}function sp(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 kG=(3+16*Jt)*Jt,FG=(2+12*Jt)*Jt,LG=(9+64*Jt)*Jt*Jt,Lu=V(4),_F=V(8),wF=V(12),vF=V(16),nr=V(4);function CG(e,t,n,r,i,o,s){let a,c,l,u,f,d,h,p,m,g,y,b,x,_,v,w,T,M,R=e-i,I=n-i,A=t-o,O=r-o;_=R*O,d=Ge*R,h=d-(d-R),p=R-h,d=Ge*O,m=d-(d-O),g=O-m,v=p*g-(_-h*m-p*m-h*g),w=A*I,d=Ge*A,h=d-(d-A),p=A-h,d=Ge*I,m=d-(d-I),g=I-m,T=p*g-(w-h*m-p*m-h*g),y=v-T,f=v-y,Lu[0]=v-(y+f)+(f-T),b=_+y,f=b-_,x=_-(b-f)+(y-f),y=x-w,f=x-y,Lu[1]=x-(y+f)+(f-w),M=b+y,f=M-b,Lu[2]=b-(M-f)+(y-f),Lu[3]=M;let F=sp(4,Lu),S=FG*s;if(F>=S||-F>=S||(f=e-R,a=e-(R+f)+(f-i),f=n-I,l=n-(I+f)+(f-i),f=t-A,c=t-(A+f)+(f-o),f=r-O,u=r-(O+f)+(f-o),a===0&&c===0&&l===0&&u===0)||(S=LG*s+op*Math.abs(F),F+=R*u+O*a-(A*l+I*c),F>=S||-F>=S))return F;_=a*O,d=Ge*a,h=d-(d-a),p=a-h,d=Ge*O,m=d-(d-O),g=O-m,v=p*g-(_-h*m-p*m-h*g),w=c*I,d=Ge*c,h=d-(d-c),p=c-h,d=Ge*I,m=d-(d-I),g=I-m,T=p*g-(w-h*m-p*m-h*g),y=v-T,f=v-y,nr[0]=v-(y+f)+(f-T),b=_+y,f=b-_,x=_-(b-f)+(y-f),y=x-w,f=x-y,nr[1]=x-(y+f)+(f-w),M=b+y,f=M-b,nr[2]=b-(M-f)+(y-f),nr[3]=M;let E=nl(4,Lu,4,nr,_F);_=R*u,d=Ge*R,h=d-(d-R),p=R-h,d=Ge*u,m=d-(d-u),g=u-m,v=p*g-(_-h*m-p*m-h*g),w=A*l,d=Ge*A,h=d-(d-A),p=A-h,d=Ge*l,m=d-(d-l),g=l-m,T=p*g-(w-h*m-p*m-h*g),y=v-T,f=v-y,nr[0]=v-(y+f)+(f-T),b=_+y,f=b-_,x=_-(b-f)+(y-f),y=x-w,f=x-y,nr[1]=x-(y+f)+(f-w),M=b+y,f=M-b,nr[2]=b-(M-f)+(y-f),nr[3]=M;let N=nl(E,_F,4,nr,wF);_=a*u,d=Ge*a,h=d-(d-a),p=a-h,d=Ge*u,m=d-(d-u),g=u-m,v=p*g-(_-h*m-p*m-h*g),w=c*l,d=Ge*c,h=d-(d-c),p=c-h,d=Ge*l,m=d-(d-l),g=l-m,T=p*g-(w-h*m-p*m-h*g),y=v-T,f=v-y,nr[0]=v-(y+f)+(f-T),b=_+y,f=b-_,x=_-(b-f)+(y-f),y=x-w,f=x-y,nr[1]=x-(y+f)+(f-w),M=b+y,f=M-b,nr[2]=b-(M-f)+(y-f),nr[3]=M;let L=nl(N,wF,4,nr,vF);return vF[L-1]}function Cu(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)>=kG*l?c:-CG(e,t,n,r,i,o,l)}var D_t=(7+56*Jt)*Jt,k_t=(3+28*Jt)*Jt,F_t=(26+288*Jt)*Jt*Jt,L_t=V(4),C_t=V(4),B_t=V(4),P_t=V(4),$_t=V(4),U_t=V(4),z_t=V(4),q_t=V(4),j_t=V(4),V_t=V(8),Y_t=V(8),G_t=V(8),W_t=V(4),X_t=V(8),H_t=V(8),Z_t=V(8),Q_t=V(12),K_t=V(192),J_t=V(192);var nwt=(10+96*Jt)*Jt,rwt=(4+48*Jt)*Jt,iwt=(44+576*Jt)*Jt*Jt,owt=V(4),swt=V(4),awt=V(4),cwt=V(4),lwt=V(4),uwt=V(4),fwt=V(4),dwt=V(4),hwt=V(8),pwt=V(8),mwt=V(8),ywt=V(8),gwt=V(8),bwt=V(8),xwt=V(8),_wt=V(8),wwt=V(8),vwt=V(4),Swt=V(4),Iwt=V(4),Twt=V(8),Ewt=V(16),Awt=V(16),Mwt=V(16),Nwt=V(32),Rwt=V(32),Owt=V(48),Dwt=V(64),kwt=V(1152),Fwt=V(1152);var Pwt=(16+224*Jt)*Jt,$wt=(5+72*Jt)*Jt,Uwt=(71+1408*Jt)*Jt*Jt,zwt=V(4),qwt=V(4),jwt=V(4),Vwt=V(4),Ywt=V(4),Gwt=V(4),Wwt=V(4),Xwt=V(4),Hwt=V(4),Zwt=V(4),Qwt=V(24),Kwt=V(24),Jwt=V(24),tvt=V(24),evt=V(24),nvt=V(24),rvt=V(24),ivt=V(24),ovt=V(24),svt=V(24),avt=V(1152),cvt=V(1152),lvt=V(1152),uvt=V(1152),fvt=V(1152),dvt=V(2304),hvt=V(2304),pvt=V(3456),mvt=V(5760),yvt=V(8),gvt=V(8),bvt=V(8),xvt=V(16),_vt=V(24),wvt=V(48),vvt=V(48),Svt=V(96),Ivt=V(192),Tvt=V(384),Evt=V(384),Avt=V(384),Mvt=V(768);var Nvt=V(96),Rvt=V(96),Ovt=V(96),Dvt=V(1152);var IF=Math.pow(2,-52),fb=new Uint32Array(512),Pu=class e{static from(t,n=qG,r=jG){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 A=t[2*I],O=t[2*I+1];A<a&&(a=A),O<c&&(c=O),A>l&&(l=A),O>u&&(u=O),this._ids[I]=I}let f=(a+l)/2,d=(c+u)/2,h=1/0,p,m,g;for(let I=0;I<s;I++){let A=AS(f,d,t[2*I],t[2*I+1]);A<h&&(p=I,h=A)}let y=t[2*p],b=t[2*p+1];h=1/0;for(let I=0;I<s;I++){if(I===p)continue;let A=AS(y,b,t[2*I],t[2*I+1]);A<h&&A>0&&(m=I,h=A)}let x=t[2*m],_=t[2*m+1],v=1/0;for(let I=0;I<s;I++){if(I===p||I===m)continue;let A=UG(y,b,x,_,t[2*I],t[2*I+1]);A<v&&(g=I,v=A)}let w=t[2*g],T=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];Bu(this._ids,this._dists,0,s-1);let I=new Uint32Array(s),A=0;for(let O=0,F=-1/0;O<s;O++){let S=this._ids[O];this._dists[S]>F&&(I[A++]=S,F=this._dists[S])}this.hull=I.subarray(0,A),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Cu(y,b,x,_,w,T)<0){let I=m,A=x,O=_;m=g,x=w,_=T,g=I,w=A,T=O}let M=zG(y,b,x,_,w,T);this._cx=M.x,this._cy=M.y;for(let I=0;I<s;I++)this._dists[I]=AS(t[2*I],t[2*I+1],M.x,M.y);Bu(this._ids,this._dists,0,s-1),this._hullStart=p;let R=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,_)]=m,o[this._hashKey(w,T)]=g,this.trianglesLen=0,this._addTriangle(p,m,g,-1,-1,-1);for(let I=0,A,O;I<this._ids.length;I++){let F=this._ids[I],S=t[2*F],E=t[2*F+1];if(I>0&&Math.abs(S-A)<=IF&&Math.abs(E-O)<=IF||(A=S,O=E,F===p||F===m||F===g))continue;let N=0;for(let $=0,U=this._hashKey(S,E);$<this._hashSize&&(N=o[(U+$)%this._hashSize],!(N!==-1&&N!==r[N]));$++);N=n[N];let L=N,B;for(;B=r[L],Cu(S,E,t[2*L],t[2*L+1],t[2*B],t[2*B+1])>=0;)if(L=B,L===N){L=-1;break}if(L===-1)continue;let C=this._addTriangle(L,F,r[L],-1,-1,i[L]);i[F]=this._legalize(C+2),i[L]=C,R++;let P=r[L];for(;B=r[P],Cu(S,E,t[2*P],t[2*P+1],t[2*B],t[2*B+1])<0;)C=this._addTriangle(P,F,B,i[F],-1,i[P]),i[F]=this._legalize(C+2),r[P]=P,R--,P=B;if(L===N)for(;B=n[L],Cu(S,E,t[2*B],t[2*B+1],t[2*L],t[2*L+1])<0;)C=this._addTriangle(B,F,L,-1,i[L],i[B]),this._legalize(C+2),i[B]=C,r[L]=L,R--,L=B;this._hullStart=n[F]=L,r[L]=n[P]=F,r[F]=P,o[this._hashKey(S,E)]=F,o[this._hashKey(t[2*L],t[2*L+1])]=L}this.hull=new Uint32Array(R);for(let I=0,A=this._hullStart;I<R;I++)this.hull[I]=A,A=r[A];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(PG(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=fb[--o];continue}let l=a-a%3,u=c+(t+1)%3,f=l+(a+2)%3,d=n[s],h=n[t],p=n[u],m=n[f];if($G(i[2*d],i[2*d+1],i[2*h],i[2*h+1],i[2*p],i[2*p+1],i[2*m],i[2*m+1])){n[t]=m,n[a]=d;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<fb.length&&(fb[o++]=b)}else{if(o===0)break;t=fb[--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 PG(e,t){let n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function AS(e,t,n,r){let i=e-n,o=t-r;return i*i+o*o}function $G(e,t,n,r,i,o,s,a){let c=e-s,l=t-a,u=n-s,f=r-a,d=i-s,h=o-a,p=c*c+l*l,m=u*u+f*f,g=d*d+h*h;return c*(f*g-m*h)-l*(u*g-m*d)+p*(u*h-f*d)<0}function UG(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,d=.5/(s*l-a*c),h=(l*u-a*f)*d,p=(s*f-c*u)*d;return h*h+p*p}function zG(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,d=.5/(s*l-a*c),h=e+(l*u-a*f)*d,p=t+(s*f-c*u)*d;return{x:h,y:p}}function Bu(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;ap(e,i,o),t[e[n]]>t[e[r]]&&ap(e,n,r),t[e[o]]>t[e[r]]&&ap(e,o,r),t[e[n]]>t[e[o]]&&ap(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;ap(e,o,s)}e[n+1]=e[s],e[s]=a,r-o+1>=s-n?(Bu(e,t,o,r),Bu(e,t,n,s-1)):(Bu(e,t,n,s-1),Bu(e,t,o,r))}}function ap(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function qG(e){return e[0]}function jG(e){return e[1]}var si=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 cp=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 _=r[m]*2,v=r[m+1]*2,w=r[m+2]*2,T=t[_],M=t[_+1],R=t[v],I=t[v+1],A=t[w],O=t[w+1],F=R-T,S=I-M,E=A-T,N=O-M,L=(F*N-S*E)*2;if(Math.abs(L)<1e-9){if(o===void 0){o=s=0;for(let C of n)o+=t[C*2],s+=t[C*2+1];o/=n.length,s/=n.length}let B=1e9*Math.sign((o-T)*N-(s-M)*E);b=(T+A)/2-B*N,x=(M+O)/2+B*E}else{let B=1/L,C=F*F+S*S,P=E*E+N*N;b=T+(N*C-S*P)*B,x=M+(F*P-E*C)*B}a[g]=b,a[g+1]=x}let c=n[n.length-1],l,u=c*4,f,d=t[2*c],h,p=t[2*c+1];i.fill(0);for(let m=0;m<n.length;++m)c=n[m],l=u,f=d,h=p,u=c*4,d=t[2*c],p=t[2*c+1],i[l+2]=i[u]=h-p,i[l+3]=i[u+1]=d-f}render(t){let n=t==null?t=new si: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 d=r[u];if(d<u)continue;let h=Math.floor(u/3)*2,p=Math.floor(d/3)*2,m=s[h],g=s[h+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,d=s[f],h=s[f+1],p=c*4,m=this._project(d,h,a[p+2],a[p+3]);m&&this._renderSegment(d,h,m[0],m[1],t)}return n&&n.value()}renderBounds(t){let n=t==null?t=new si: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 si: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,d=0;for(let h=0;h<r;h+=2)if(o=a,s=c,a=n[h],c=n[h+1],l=u,u=this._regioncode(a,c),l===0&&u===0)f=d,d=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=d,d=this._edgecode(m,g),f&&d&&this._edge(t,f,d,i,i.length),i?i.push(m,g):i=[m,g]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,i,i.length),i?i.push(y,b):i=[y,b]}if(i)f=d,d=this._edgecode(i[0],i[1]),f&&d&&this._edge(t,f,d,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,d=this._edgecode(a[u-2],a[u-1]);l<u;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,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 VG=2*Math.PI,$u=Math.pow;function YG(e){return e[0]}function GG(e){return e[1]}function WG(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 XG(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}var ai=class e{static from(t,n=YG,r=GG,i){return new e("length"in t?HG(t,n,r,i):Float64Array.from(ZG(t,n,r,i)))}constructor(t){this._delaunator=new Pu(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&&WG(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+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 d=0,h=n.length/2;d<h;++d){let p=XG(n[2*d],n[2*d+1],f);n[2*d]=p[0],n[2*d+1]=p[1]}this._delaunator=new Pu(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 cp(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=$u(n-l[t*2],2)+$u(r-l[t*2+1],2),d=i[t],h=d;do{let p=c[h],m=$u(n-l[p*2],2)+$u(r-l[p*2+1],2);if(m<f&&(f=m,u=p),h=h%3===2?h-2:h+1,c[h]!==t)break;if(h=a[h],h===-1){if(h=o[(s[t]+1)%o.length],h!==p&&$u(n-l[h*2],2)+$u(r-l[h*2+1],2)<f)return h;break}}while(h!==d);return u}render(t){let n=t==null?t=new si: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 si: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,VG)}return r&&r.value()}renderHull(t){let n=t==null?t=new si: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 si: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 HG(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*ZG(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 TF(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function rl(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 bo(e){return e=rl(Math.abs(e)),e?e[1]:NaN}function EF(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 AF(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var QG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function xo(e){if(!(t=QG.exec(e)))throw new Error("invalid format: "+e);var t;return new db({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]})}xo.prototype=db.prototype;function db(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+""}db.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 MF(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 MS;function NF(e,t){var n=rl(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(MS=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")+rl(e,Math.max(0,t+o-1))[0]}function NS(e,t){var n=rl(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 RS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:TF,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)=>NS(e*100,t),r:NS,s:NF,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function OS(e){return e}var RF=Array.prototype.map,OF=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function DF(e){var t=e.grouping===void 0||e.thousands===void 0?OS:EF(RF.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?OS:AF(RF.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=xo(f);var d=f.fill,h=f.align,p=f.sign,m=f.symbol,g=f.zero,y=f.width,b=f.comma,x=f.precision,_=f.trim,v=f.type;v==="n"?(b=!0,v="g"):RS[v]||(x===void 0&&(x=12),_=!0,v="g"),(g||d==="0"&&h==="=")&&(g=!0,d="0",h="=");var w=m==="$"?n:m==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",T=m==="$"?r:/[%p]/.test(v)?s:"",M=RS[v],R=/[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(A){var O=w,F=T,S,E,N;if(v==="c")F=M(A)+F,A="";else{A=+A;var L=A<0||1/A<0;if(A=isNaN(A)?c:M(Math.abs(A),x),_&&(A=MF(A)),L&&+A==0&&p!=="+"&&(L=!1),O=(L?p==="("?p:a:p==="-"||p==="("?"":p)+O,F=(v==="s"?OF[8+MS/3]:"")+F+(L&&p==="("?")":""),R){for(S=-1,E=A.length;++S<E;)if(N=A.charCodeAt(S),48>N||N>57){F=(N===46?i+A.slice(S+1):A.slice(S))+F,A=A.slice(0,S);break}}}b&&!g&&(A=t(A,1/0));var B=O.length+A.length+F.length,C=B<y?new Array(y-B+1).join(d):"";switch(b&&g&&(A=t(C+A,C.length?y-F.length:1/0),C=""),h){case"<":A=O+A+F+C;break;case"=":A=O+C+A+F;break;case"^":A=C.slice(0,B=C.length>>1)+O+A+F+C.slice(B);break;default:A=C+O+A+F;break}return o(A)}return I.toString=function(){return f+""},I}function u(f,d){var h=l((f=xo(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(bo(d)/3)))*3,m=Math.pow(10,-p),g=OF[8+p/3];return function(y){return h(m*y)+g}}return{format:l,formatPrefix:u}}var hb,ci,pb;DS({thousands:",",grouping:[3],currency:["$",""]});function DS(e){return hb=DF(e),ci=hb.format,pb=hb.formatPrefix,hb}function kS(e){return Math.max(0,-bo(Math.abs(e)))}function FS(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(bo(t)/3)))*3-bo(Math.abs(e)))}function LS(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,bo(t)-bo(e))+1}var J=1e-6,il=1e-12,Mt=Math.PI,de=Mt/2,CS=Mt/4,cn=Mt*2,Ce=180/Mt,jt=Mt/180,Bt=Math.abs,li=Math.atan,We=Math.atan2,K=Math.cos,lp=Math.ceil,mb=Math.exp;var yb=Math.hypot,ol=Math.log,gb=Math.pow,Q=Math.sin,$n=Math.sign||function(e){return e>0?1:e<0?-1:0},he=Math.sqrt,Uu=Math.tan;function bb(e){return e>1?0:e<-1?Mt:Math.acos(e)}function ve(e){return e>1?de:e<-1?-de:Math.asin(e)}function Xe(){}function xb(e,t){e&&FF.hasOwnProperty(e.type)&&FF[e.type](e,t)}var kF={Feature:function(e,t){xb(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)xb(n[r].geometry,t)}},FF={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){BS(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)BS(n[r],t,0)},Polygon:function(e,t){LF(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)LF(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)xb(n[r],t)}};function BS(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 LF(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)BS(e[n],t,1);t.polygonEnd()}function Br(e,t){e&&kF.hasOwnProperty(e.type)?kF[e.type](e,t):xb(e,t)}function up(e){return[We(e[1],e[0]),ve(e[2])]}function _o(e){var t=e[0],n=e[1],r=K(n);return[r*K(t),r*Q(t),Q(n)]}function fp(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function zu(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 _b(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function dp(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function hp(e){var t=he(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var pp,wb,vb,Sb,Ib,Tb,Eb,Ab,PS,$S,US,PF,$F,rr,ir,or,$i={sphere:Xe,point:zS,lineStart:CF,lineEnd:BF,polygonStart:function(){$i.lineStart=tW,$i.lineEnd=eW},polygonEnd:function(){$i.lineStart=CF,$i.lineEnd=BF}};function zS(e,t){e*=jt,t*=jt;var n=K(t);mp(n*K(e),n*Q(e),Q(t))}function mp(e,t,n){++pp,vb+=(e-vb)/pp,Sb+=(t-Sb)/pp,Ib+=(n-Ib)/pp}function CF(){$i.point=KG}function KG(e,t){e*=jt,t*=jt;var n=K(t);rr=n*K(e),ir=n*Q(e),or=Q(t),$i.point=JG,mp(rr,ir,or)}function JG(e,t){e*=jt,t*=jt;var n=K(t),r=n*K(e),i=n*Q(e),o=Q(t),s=We(he((s=ir*o-or*i)*s+(s=or*r-rr*o)*s+(s=rr*i-ir*r)*s),rr*r+ir*i+or*o);wb+=s,Tb+=s*(rr+(rr=r)),Eb+=s*(ir+(ir=i)),Ab+=s*(or+(or=o)),mp(rr,ir,or)}function BF(){$i.point=zS}function tW(){$i.point=nW}function eW(){UF(PF,$F),$i.point=zS}function nW(e,t){PF=e,$F=t,e*=jt,t*=jt,$i.point=UF;var n=K(t);rr=n*K(e),ir=n*Q(e),or=Q(t),mp(rr,ir,or)}function UF(e,t){e*=jt,t*=jt;var n=K(t),r=n*K(e),i=n*Q(e),o=Q(t),s=ir*o-or*i,a=or*r-rr*o,c=rr*i-ir*r,l=yb(s,a,c),u=ve(l),f=l&&-u/l;PS.add(f*s),$S.add(f*a),US.add(f*c),wb+=u,Tb+=u*(rr+(rr=r)),Eb+=u*(ir+(ir=i)),Ab+=u*(or+(or=o)),mp(rr,ir,or)}function qS(e){pp=wb=vb=Sb=Ib=Tb=Eb=Ab=0,PS=new In,$S=new In,US=new In,Br(e,$i);var t=+PS,n=+$S,r=+US,i=yb(t,n,r);return i<il&&(t=Tb,n=Eb,r=Ab,wb<J&&(t=vb,n=Sb,r=Ib),i=yb(t,n,r),i<il)?[NaN,NaN]:[We(n,t)*Ce,ve(r/i)*Ce]}function yp(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 jS(e,t){return Bt(e)>Mt&&(e-=Math.round(e/cn)*cn),[e,t]}jS.invert=jS;function VS(e,t,n){return(e%=cn)?t||n?yp(qF(e),jF(t,n)):qF(e):t||n?jF(t,n):jS}function zF(e){return function(t,n){return t+=e,Bt(t)>Mt&&(t-=Math.round(t/cn)*cn),[t,n]}}function qF(e){var t=zF(e);return t.invert=zF(-e),t}function jF(e,t){var n=K(e),r=Q(e),i=K(t),o=Q(t);function s(a,c){var l=K(c),u=K(a)*l,f=Q(a)*l,d=Q(c),h=d*n+u*r;return[We(f*i-h*o,u*n-d*r),ve(h*i+f*o)]}return s.invert=function(a,c){var l=K(c),u=K(a)*l,f=Q(a)*l,d=Q(c),h=d*i-f*o;return[We(f*i+d*o,u*n+h*r),ve(h*n-u*r)]},s}function VF(e){e=VS(e[0]*jt,e[1]*jt,e.length>2?e[2]*jt:0);function t(n){return n=e(n[0]*jt,n[1]*jt),n[0]*=Ce,n[1]*=Ce,n}return t.invert=function(n){return n=e.invert(n[0]*jt,n[1]*jt),n[0]*=Ce,n[1]*=Ce,n},t}function GF(e,t,n,r,i,o){if(n){var s=K(t),a=Q(t),c=r*n;i==null?(i=t+r*cn,o=t-c/2):(i=YF(s,i),o=YF(s,o),(r>0?i<o:i>o)&&(i+=r*cn));for(var l,u=i;r>0?u>o:u<o;u-=c)l=up([s,-a*K(u),-a*Q(u)]),e.point(l[0],l[1])}}function YF(e,t){t=_o(t),t[0]-=e,hp(t);var n=bb(-t[1]);return((-t[2]<0?-n:n)+cn-J)%cn}function Mb(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Xe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function qu(e,t){return Bt(e[0]-t[0])<J&&Bt(e[1]-t[1])<J}function Nb(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 Rb(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(qu(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*J}o.push(b=new Nb(g,p,null,!0)),s.push(b.o=new Nb(g,null,b,!1)),o.push(b=new Nb(y,p,null,!1)),s.push(b.o=new Nb(y,null,b,!0))}}),!!o.length){for(s.sort(t),WF(o),WF(s),a=0,c=s.length;a<c;++a)s[a].e=n=!n;for(var l=o[0],u,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,c=u.length;a<c;++a)i.point((f=u[a])[0],f[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(h)for(u=d.p.z,a=u.length-1;a>=0;--a)i.point((f=u[a])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);i.lineEnd()}}}function WF(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 YS(e){return Bt(e[0])<=Mt?e[0]:$n(e[0])*((Bt(e[0])+Mt)%cn-Mt)}function XF(e,t){var n=YS(t),r=t[1],i=Q(r),o=[Q(n),-K(n),0],s=0,a=0,c=new In;i===1?r=de+J:i===-1&&(r=-de-J);for(var l=0,u=e.length;l<u;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],p=YS(h),m=h[1]/2+CS,g=Q(m),y=K(m),b=0;b<d;++b,p=_,g=w,y=T,h=x){var x=f[b],_=YS(x),v=x[1]/2+CS,w=Q(v),T=K(v),M=_-p,R=M>=0?1:-1,I=R*M,A=I>Mt,O=g*w;if(c.add(We(O*R*Q(I),y*T+O*K(I))),s+=A?M+R*cn:M,A^p>=n^_>=n){var F=zu(_o(h),_o(x));hp(F);var S=zu(o,F);hp(S);var E=(A^M>=0?-1:1)*ve(S[2]);(r>E||r===E&&(F[0]||F[1]))&&(a+=A^M>=0?1:-1)}}return(s<-J||s<J&&c<-il)^a&1}function Ob(e,t,n,r){return function(i){var o=t(i),s=Mb(),a=t(s),c=!1,l,u,f,d={point:h,lineStart:m,lineEnd:g,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=x,u=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=m,d.lineEnd=g,u=Su(u);var _=XF(l,r);u.length?(c||(i.polygonStart(),c=!0),Rb(u,iW,_,n,i)):_&&(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 h(_,v){e(_,v)&&i.point(_,v)}function p(_,v){o.point(_,v)}function m(){d.point=p,o.lineStart()}function g(){d.point=h,o.lineEnd()}function y(_,v){f.push([_,v]),a.point(_,v)}function b(){a.lineStart(),f=[]}function x(){y(f[0][0],f[0][1]),a.lineEnd();var _=a.clean(),v=s.result(),w,T=v.length,M,R,I;if(f.pop(),l.push(f),f=null,!!T){if(_&1){if(R=v[0],(M=R.length-1)>0){for(c||(i.polygonStart(),c=!0),i.lineStart(),w=0;w<M;++w)i.point((I=R[w])[0],I[1]);i.lineEnd()}return}T>1&&_&2&&v.push(v.pop().concat(v.shift())),u.push(v.filter(rW))}}return d}}function rW(e){return e.length>1}function iW(e,t){return((e=e.x)[0]<0?e[1]-de-J:de-e[1])-((t=t.x)[0]<0?t[1]-de-J:de-t[1])}var GS=Ob(function(){return!0},oW,aW,[-Mt,-de]);function oW(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=Bt(o-t);Bt(c-Mt)<J?(e.point(t,n=(n+s)/2>0?de:-de),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&c>=Mt&&(Bt(t-r)<J&&(t-=r*J),Bt(o-a)<J&&(o-=a*J),n=sW(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 sW(e,t,n,r){var i,o,s=Q(e-n);return Bt(s)>J?li((Q(t)*(o=K(r))*Q(n)-Q(r)*(i=K(t))*Q(e))/(i*o*s)):(t+r)/2}function aW(e,t,n,r){var i;if(e==null)i=n*de,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(Bt(e[0]-t[0])>J){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 HF(e){var t=K(e),n=6*jt,r=t>0,i=Bt(t)>J;function o(u,f,d,h){GF(h,e,n,d,u,f)}function s(u,f){return K(u)*K(f)>t}function a(u){var f,d,h,p,m;return{lineStart:function(){p=h=!1,m=1},point:function(g,y){var b=[g,y],x,_=s(g,y),v=r?_?0:l(g,y):_?l(g+(g<0?Mt:-Mt),y):0;if(!f&&(p=h=_)&&u.lineStart(),_!==h&&(x=c(f,b),(!x||qu(f,x)||qu(b,x))&&(b[2]=1)),_!==h)m=0,_?(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^_){var w;!(v&d)&&(w=c(b,f,!0))&&(m=0,r?(u.lineStart(),u.point(w[0][0],w[0][1]),u.point(w[1][0],w[1][1]),u.lineEnd()):(u.point(w[1][0],w[1][1]),u.lineEnd(),u.lineStart(),u.point(w[0][0],w[0][1],3)))}_&&(!f||!qu(f,b))&&u.point(b[0],b[1]),f=b,h=_,d=v},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return m|(p&&h)<<1}}}function c(u,f,d){var h=_o(u),p=_o(f),m=[1,0,0],g=zu(h,p),y=fp(g,g),b=g[0],x=y-b*b;if(!x)return!d&&u;var _=t*y/x,v=-t*b/x,w=zu(m,g),T=dp(m,_),M=dp(g,v);_b(T,M);var R=w,I=fp(T,R),A=fp(R,R),O=I*I-A*(fp(T,T)-1);if(!(O<0)){var F=he(O),S=dp(R,(-I-F)/A);if(_b(S,T),S=up(S),!d)return S;var E=u[0],N=f[0],L=u[1],B=f[1],C;N<E&&(C=E,E=N,N=C);var P=N-E,$=Bt(P-Mt)<J,U=$||P<J;if(!$&&B<L&&(C=L,L=B,B=C),U?$?L+B>0^S[1]<(Bt(S[0]-E)<J?L:B):L<=S[1]&&S[1]<=B:P>Mt^(E<=S[0]&&S[0]<=N)){var X=dp(R,(-I+F)/A);return _b(X,T),[S,up(X)]}}}function l(u,f){var d=r?e:Mt-e,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return Ob(s,a,o,r?[0,-e]:[-Mt,e-Mt])}function ZF(e,t,n,r,i,o){var s=e[0],a=e[1],c=t[0],l=t[1],u=0,f=1,d=c-s,h=l-a,p;if(p=n-s,!(!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=i-s,!(!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)}if(p=r-a,!(!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=o-a,!(!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)}return u>0&&(e[0]=s+u*d,e[1]=a+u*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var gp=1e9,Db=-gp;function ju(e,t,n,r){function i(l,u){return e<=l&&l<=n&&t<=u&&u<=r}function o(l,u,f,d){var h=0,p=0;if(l==null||(h=s(l,f))!==(p=s(u,f))||c(l,u)<0^f>0)do d.point(h===0||h===3?e:n,h>1?r:t);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function s(l,u){return Bt(l[0]-e)<J?u>0?0:3:Bt(l[0]-n)<J?u>0?2:1:Bt(l[1]-t)<J?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),d=s(u,1);return f!==d?f-d: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=Mb(),d,h,p,m,g,y,b,x,_,v,w,T={point:M,lineStart:O,lineEnd:F,polygonStart:I,polygonEnd:A};function M(E,N){i(E,N)&&u.point(E,N)}function R(){for(var E=0,N=0,L=h.length;N<L;++N)for(var B=h[N],C=1,P=B.length,$=B[0],U,X,tt=$[0],nt=$[1];C<P;++C)U=tt,X=nt,$=B[C],tt=$[0],nt=$[1],X<=r?nt>r&&(tt-U)*(r-X)>(nt-X)*(e-U)&&++E:nt<=r&&(tt-U)*(r-X)<(nt-X)*(e-U)&&--E;return E}function I(){u=f,d=[],h=[],w=!0}function A(){var E=R(),N=w&&E,L=(d=Su(d)).length;(N||L)&&(l.polygonStart(),N&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),L&&Rb(d,a,E,o,l),l.polygonEnd()),u=l,d=h=p=null}function O(){T.point=S,h&&h.push(p=[]),v=!0,_=!1,b=x=NaN}function F(){d&&(S(m,g),y&&_&&f.rejoin(),d.push(f.result())),T.point=M,_&&u.lineEnd()}function S(E,N){var L=i(E,N);if(h&&p.push([E,N]),v)m=E,g=N,y=L,v=!1,L&&(u.lineStart(),u.point(E,N));else if(L&&_)u.point(E,N);else{var B=[b=Math.max(Db,Math.min(gp,b)),x=Math.max(Db,Math.min(gp,x))],C=[E=Math.max(Db,Math.min(gp,E)),N=Math.max(Db,Math.min(gp,N))];ZF(B,C,e,t,n,r)?(_||(u.lineStart(),u.point(B[0],B[1])),u.point(C[0],C[1]),L||u.lineEnd(),w=!1):L&&(u.lineStart(),u.point(E,N),w=!1)}b=E,x=N,_=L}return T}}function QF(e,t,n){var r=$e(e,t-J,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function KF(e,t,n){var r=$e(e,t-J,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function WS(){var e,t,n,r,i,o,s,a,c=10,l=c,u=90,f=360,d,h,p,m,g=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return $e(lp(r/u)*u,n,u).map(p).concat($e(lp(a/f)*f,s,f).map(m)).concat($e(lp(t/c)*c,e,c).filter(function(x){return Bt(x%u)>J}).map(d)).concat($e(lp(o/l)*l,i,l).filter(function(x){return Bt(x%f)>J}).map(h))}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,d=QF(o,i,90),h=KF(t,e,g),p=QF(a,s,90),m=KF(r,n,g),y):g},y.extentMajor([[-180,-90+J],[180,90-J]]).extentMinor([[-180,-80-J],[180,80+J]])}function XS(){return WS()()}var bp=e=>e;var HS=new In,ZS=new In,JF,tL,QS,KS,Pa={point:Xe,lineStart:Xe,lineEnd:Xe,polygonStart:function(){Pa.lineStart=cW,Pa.lineEnd=uW},polygonEnd:function(){Pa.lineStart=Pa.lineEnd=Pa.point=Xe,HS.add(Bt(ZS)),ZS=new In},result:function(){var e=HS/2;return HS=new In,e}};function cW(){Pa.point=lW}function lW(e,t){Pa.point=eL,JF=QS=e,tL=KS=t}function eL(e,t){ZS.add(KS*e-QS*t),QS=e,KS=t}function uW(){eL(JF,tL)}var JS=Pa;var Vu=1/0,kb=Vu,xp=-Vu,Fb=xp,fW={point:dW,lineStart:Xe,lineEnd:Xe,polygonStart:Xe,polygonEnd:Xe,result:function(){var e=[[Vu,kb],[xp,Fb]];return xp=Fb=-(kb=Vu=1/0),e}};function dW(e,t){e<Vu&&(Vu=e),e>xp&&(xp=e),t<kb&&(kb=t),t>Fb&&(Fb=t)}var Yu=fW;var tI=0,eI=0,_p=0,Lb=0,Cb=0,Gu=0,nI=0,rI=0,wp=0,iL,oL,wo,vo,Ui={point:sl,lineStart:nL,lineEnd:rL,polygonStart:function(){Ui.lineStart=mW,Ui.lineEnd=yW},polygonEnd:function(){Ui.point=sl,Ui.lineStart=nL,Ui.lineEnd=rL},result:function(){var e=wp?[nI/wp,rI/wp]:Gu?[Lb/Gu,Cb/Gu]:_p?[tI/_p,eI/_p]:[NaN,NaN];return tI=eI=_p=Lb=Cb=Gu=nI=rI=wp=0,e}};function sl(e,t){tI+=e,eI+=t,++_p}function nL(){Ui.point=hW}function hW(e,t){Ui.point=pW,sl(wo=e,vo=t)}function pW(e,t){var n=e-wo,r=t-vo,i=he(n*n+r*r);Lb+=i*(wo+e)/2,Cb+=i*(vo+t)/2,Gu+=i,sl(wo=e,vo=t)}function rL(){Ui.point=sl}function mW(){Ui.point=gW}function yW(){sL(iL,oL)}function gW(e,t){Ui.point=sL,sl(iL=wo=e,oL=vo=t)}function sL(e,t){var n=e-wo,r=t-vo,i=he(n*n+r*r);Lb+=i*(wo+e)/2,Cb+=i*(vo+t)/2,Gu+=i,i=vo*e-wo*t,nI+=i*(wo+e),rI+=i*(vo+t),wp+=i*3,sl(wo=e,vo=t)}var iI=Ui;function Bb(e){this._context=e}Bb.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,cn);break}}},result:Xe};var sI=new In,oI,aL,cL,vp,Sp,Pb={point:Xe,lineStart:function(){Pb.point=bW},lineEnd:function(){oI&&lL(aL,cL),Pb.point=Xe},polygonStart:function(){oI=!0},polygonEnd:function(){oI=null},result:function(){var e=+sI;return sI=new In,e}};function bW(e,t){Pb.point=lL,aL=vp=e,cL=Sp=t}function lL(e,t){vp-=e,Sp-=t,sI.add(he(vp*vp+Sp*Sp)),vp=e,Sp=t}var aI=Pb;var uL,$b,fL,dL,Wu=class{constructor(t){this._append=t==null?hL:xW(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!==fL||this._append!==$b){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`,fL=r,$b=this._append,dL=this._,this._=i}this._+=dL;break}}}result(){let t=this._;return this._="",t.length?t:null}};function hL(e){let t=1;this._+=e[0];for(let n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function xW(e){let t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return hL;if(t!==uL){let n=10**t;uL=t,$b=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 $b}function Mn(e,t){let n=3,r=4.5,i,o;function s(a){return a&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),Br(a,i(o))),o.result()}return s.area=function(a){return Br(a,i(JS)),JS.result()},s.measure=function(a){return Br(a,i(aI)),aI.result()},s.bounds=function(a){return Br(a,i(Yu)),Yu.result()},s.centroid=function(a){return Br(a,i(iI)),iI.result()},s.projection=function(a){return arguments.length?(i=a==null?(e=null,bp):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new Wu(n)):new Bb(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 Wu(n)),s},s.projection(e).digits(n).context(t)}function al(e){return{stream:Xu(e)}}function Xu(e){return function(t){var n=new cI;for(var r in e)n[r]=e[r];return n.stream=t,n}}function cI(){}cI.prototype={constructor:cI,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 lI(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Br(n,e.stream(Yu)),t(Yu.result()),r!=null&&e.clipExtent(r),e}function Ip(e,t,n){return lI(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 Ub(e,t,n){return Ip(e,[[0,0],t],n)}function zb(e,t,n){return lI(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 qb(e,t,n){return lI(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 pL=16,_W=K(30*jt);function uI(e,t){return+t?vW(e,t):wW(e)}function wW(e){return Xu({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function vW(e,t){function n(r,i,o,s,a,c,l,u,f,d,h,p,m,g){var y=l-r,b=u-i,x=y*y+b*b;if(x>4*t&&m--){var _=s+d,v=a+h,w=c+p,T=he(_*_+v*v+w*w),M=ve(w/=T),R=Bt(Bt(w)-1)<J||Bt(o-f)<J?(o+f)/2:We(v,_),I=e(R,M),A=I[0],O=I[1],F=A-r,S=O-i,E=b*F-y*S;(E*E/x>t||Bt((y*F+b*S)/x-.5)>.3||s*d+a*h+c*p<_W)&&(n(r,i,o,s,a,c,A,O,R,_/=T,v/=T,w,m,g),g.point(A,O),n(A,O,R,_,v,w,l,u,f,d,h,p,m,g))}}return function(r){var i,o,s,a,c,l,u,f,d,h,p,m,g={point:y,lineStart:b,lineEnd:_,polygonStart:function(){r.polygonStart(),g.lineStart=v},polygonEnd:function(){r.polygonEnd(),g.lineStart=b}};function y(M,R){M=e(M,R),r.point(M[0],M[1])}function b(){f=NaN,g.point=x,r.lineStart()}function x(M,R){var I=_o([M,R]),A=e(M,R);n(f,d,u,h,p,m,f=A[0],d=A[1],u=M,h=I[0],p=I[1],m=I[2],pL,r),r.point(f,d)}function _(){g.point=y,r.lineEnd()}function v(){b(),g.point=w,g.lineEnd=T}function w(M,R){x(i=M,R),o=f,s=d,a=h,c=p,l=m,g.point=x}function T(){n(f,d,u,h,p,m,o,s,i,a,c,l,pL,r),g.lineEnd=_,_()}return g}}var SW=Xu({point:function(e,t){this.stream.point(e*jt,t*jt)}});function IW(e){return Xu({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function TW(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 mL(e,t,n,r,i,o){if(!o)return TW(e,t,n,r,i);var s=K(o),a=Q(o),c=s*e,l=a*e,u=s/e,f=a/e,d=(a*n-s*t)/e,h=(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+d),i*(h-f*m-u*g)]},p}function Nn(e){return fI(function(){return e})()}function fI(e){var t,n=150,r=480,i=250,o=0,s=0,a=0,c=0,l=0,u,f=0,d=1,h=1,p=null,m=GS,g=null,y,b,x,_=bp,v=.5,w,T,M,R,I;function A(E){return M(E[0]*jt,E[1]*jt)}function O(E){return E=M.invert(E[0],E[1]),E&&[E[0]*Ce,E[1]*Ce]}A.stream=function(E){return R&&I===E?R:R=SW(IW(u)(m(w(_(I=E)))))},A.preclip=function(E){return arguments.length?(m=E,p=void 0,S()):m},A.postclip=function(E){return arguments.length?(_=E,g=y=b=x=null,S()):_},A.clipAngle=function(E){return arguments.length?(m=+E?HF(p=E*jt):(p=null,GS),S()):p*Ce},A.clipExtent=function(E){return arguments.length?(_=E==null?(g=y=b=x=null,bp):ju(g=+E[0][0],y=+E[0][1],b=+E[1][0],x=+E[1][1]),S()):g==null?null:[[g,y],[b,x]]},A.scale=function(E){return arguments.length?(n=+E,F()):n},A.translate=function(E){return arguments.length?(r=+E[0],i=+E[1],F()):[r,i]},A.center=function(E){return arguments.length?(o=E[0]%360*jt,s=E[1]%360*jt,F()):[o*Ce,s*Ce]},A.rotate=function(E){return arguments.length?(a=E[0]%360*jt,c=E[1]%360*jt,l=E.length>2?E[2]%360*jt:0,F()):[a*Ce,c*Ce,l*Ce]},A.angle=function(E){return arguments.length?(f=E%360*jt,F()):f*Ce},A.reflectX=function(E){return arguments.length?(d=E?-1:1,F()):d<0},A.reflectY=function(E){return arguments.length?(h=E?-1:1,F()):h<0},A.precision=function(E){return arguments.length?(w=uI(T,v=E*E),S()):he(v)},A.fitExtent=function(E,N){return Ip(A,E,N)},A.fitSize=function(E,N){return Ub(A,E,N)},A.fitWidth=function(E,N){return zb(A,E,N)},A.fitHeight=function(E,N){return qb(A,E,N)};function F(){var E=mL(n,0,0,d,h,f).apply(null,t(o,s)),N=mL(n,r-E[0],i-E[1],d,h,f);return u=VS(a,c,l),T=yp(t,N),M=yp(u,T),w=uI(T,v),S()}function S(){return R=I=null,A}return function(){return t=e.apply(this,arguments),A.invert=t.invert&&O,F()}}function Hu(e){var t=0,n=Mt/3,r=fI(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*jt,n=o[1]*jt):[t*Ce,n*Ce]},i}function yL(e){var t=K(e);function n(r,i){return[r*t,Q(i)/t]}return n.invert=function(r,i){return[r/t,ve(i*t)]},n}function gL(e,t){var n=Q(e),r=(n+Q(t))/2;if(Bt(r)<J)return yL(e);var i=1+n*(2*r-n),o=he(i)/r;function s(a,c){var l=he(i-2*r*Q(c))/r;return[l*Q(a*=r),o-l*K(a)]}return s.invert=function(a,c){var l=o-c,u=We(a,Bt(l))*$n(l);return l*r<0&&(u-=Mt*$n(a)*$n(l)),[u/r,ve((i-(a*a+l*l)*r*r)/(2*r))]},s}function $a(){return Hu(gL).scale(155.424).center([0,33.6442])}function Tp(){return $a().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function EW(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 dI(){var e,t,n=Tp(),r,i=$a().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=$a().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,c,l={point:function(d,h){c=[d,h]}};function u(d){var h=d[0],p=d[1];return c=null,r.point(h,p),c||(o.point(h,p),c)||(a.point(h,p),c)}u.invert=function(d){var h=n.scale(),p=n.translate(),m=(d[0]-p[0])/h,g=(d[1]-p[1])/h;return(g>=.12&&g<.234&&m>=-.425&&m<-.214?i:g>=.166&&g<.234&&m>=-.214&&m<-.115?s:n).invert(d)},u.stream=function(d){return e&&t===d?e:e=EW([n.stream(t=d),i.stream(d),s.stream(d)])},u.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),s.precision(d),f()):n.precision()},u.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),s.scale(d),u.translate(n.translate())):n.scale()},u.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],m=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,m-.238*h],[p+.455*h,m+.238*h]]).stream(l),o=i.translate([p-.307*h,m+.201*h]).clipExtent([[p-.425*h+J,m+.12*h+J],[p-.214*h-J,m+.234*h-J]]).stream(l),a=s.translate([p-.205*h,m+.212*h]).clipExtent([[p-.214*h+J,m+.166*h+J],[p-.115*h-J,m+.234*h-J]]).stream(l),f()},u.fitExtent=function(d,h){return Ip(u,d,h)},u.fitSize=function(d,h){return Ub(u,d,h)},u.fitWidth=function(d,h){return zb(u,d,h)},u.fitHeight=function(d,h){return qb(u,d,h)};function f(){return e=t=null,u}return u.scale(1070)}function jb(e){return function(t,n){var r=K(t),i=K(n),o=e(r*i);return o===1/0?[2,0]:[o*i*Q(t),o*Q(n)]}}function So(e){return function(t,n){var r=he(t*t+n*n),i=e(r),o=Q(i),s=K(i);return[We(t*o,r*s),ve(r&&n*o/r)]}}var hI=jb(function(e){return he(2/(1+e))});hI.invert=So(function(e){return 2*ve(e/2)});function pI(){return Nn(hI).scale(124.75).clipAngle(180-.001)}var mI=jb(function(e){return(e=bb(e))&&e/Q(e)});mI.invert=So(function(e){return e});function yI(){return Nn(mI).scale(79.4188).clipAngle(180-.001)}function Zu(e,t){return[e,ol(Uu((de+t)/2))]}Zu.invert=function(e,t){return[e,2*li(mb(t))-de]};function gI(){return bI(Zu).scale(961/cn)}function bI(e){var t=Nn(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(),d=t(VF(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===Zu?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,c),l]]:[[s,Math.max(d[1]-f,a)],[c,Math.min(d[1]+f,l)]])}return u()}function Vb(e){return Uu((de+e)/2)}function bL(e,t){var n=K(e),r=e===t?Q(e):ol(n/K(t))/ol(Vb(t)/Vb(e)),i=n*gb(Vb(e),r)/r;if(!r)return Zu;function o(s,a){i>0?a<-de+J&&(a=-de+J):a>de-J&&(a=de-J);var c=i/gb(Vb(a),r);return[c*Q(r*s),i-c*K(r*s)]}return o.invert=function(s,a){var c=i-a,l=$n(r)*he(s*s+c*c),u=We(s,Bt(c))*$n(c);return c*r<0&&(u-=Mt*$n(s)*$n(c)),[u/r,2*li(gb(i/l,1/r))-de]},o}function xI(){return Hu(bL).scale(109.5).parallels([30,30])}function Qu(e,t){return[e,t]}Qu.invert=Qu;function _I(){return Nn(Qu).scale(152.63)}function xL(e,t){var n=K(e),r=e===t?Q(e):(n-K(t))/(t-e),i=n/r+e;if(Bt(r)<J)return Qu;function o(s,a){var c=i-a,l=r*s;return[c*Q(l),i-c*K(l)]}return o.invert=function(s,a){var c=i-a,l=We(s,Bt(c))*$n(c);return c*r<0&&(l-=Mt*$n(s)*$n(c)),[l/r,i-$n(r)*he(s*s+c*c)]},o}function wI(){return Hu(xL).scale(131.154).center([0,13.9389])}var Ep=1.340264,Ap=-.081106,Mp=893e-6,Np=.003796,Yb=he(3)/2,AW=12;function vI(e,t){var n=ve(Yb*Q(t)),r=n*n,i=r*r*r;return[e*K(n)/(Yb*(Ep+3*Ap*r+i*(7*Mp+9*Np*r))),n*(Ep+Ap*r+i*(Mp+Np*r))]}vI.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,s,a,c;o<AW&&(a=n*(Ep+Ap*r+i*(Mp+Np*r))-t,c=Ep+3*Ap*r+i*(7*Mp+9*Np*r),n-=s=a/c,r=n*n,i=r*r*r,!(Bt(s)<il));++o);return[Yb*e*(Ep+3*Ap*r+i*(7*Mp+9*Np*r))/K(n),ve(Q(n)/Yb)]};function SI(){return Nn(vI).scale(177.158)}function II(e,t){var n=K(t),r=K(e)*n;return[n*Q(e)/r,Q(t)/r]}II.invert=So(li);function TI(){return Nn(II).scale(144.049).clipAngle(60)}function EI(e,t){return[K(t)*Q(e),Q(t)]}EI.invert=So(ve);function AI(){return Nn(EI).scale(249.5).clipAngle(90+J)}function MI(e,t){var n=K(t),r=1+K(e)*n;return[n*Q(e)/r,Q(t)/r]}MI.invert=So(function(e){return 2*li(e)});function NI(){return Nn(MI).scale(250).clipAngle(142)}function RI(e,t){return[ol(Uu((de+t)/2)),-e]}RI.invert=function(e,t){return[-t,2*li(mb(e))-de]};function OI(){var e=bI(RI),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 MW(e,t){return e.parent===t.parent?1:2}function NW(e){return e.reduce(RW,0)/e.length}function RW(e,t){return e+t.x}function OW(e){return 1+e.reduce(DW,0)}function DW(e,t){return Math.max(e,t.y)}function kW(e){for(var t;t=e.children;)e=t[0];return e}function FW(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Gb(){var e=MW,t=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=NW(h),d.y=OW(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var c=kW(o),l=FW(o),u=c.x-e(c,l)/2,f=l.x+e(l,c)/2;return o.eachAfter(r?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-u)/(f-u)*t,d.y=(1-(o.y?d.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 LW(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 _L(){return this.eachAfter(LW)}function wL(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function vL(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 SL(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 IL(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function TL(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 EL(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function AL(e){for(var t=this,n=CW(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 CW(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 ML(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function NL(){return Array.from(this)}function RL(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function OL(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*DL(){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 DI(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=$W)):t===void 0&&(t=PW);for(var n=new Ua(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 Ua(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(kI)}function BW(){return DI(this).eachBefore(UW)}function PW(e){return e.children}function $W(e){return Array.isArray(e)?e[1]:null}function UW(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function kI(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ua(e){this.data=e,this.depth=this.height=0,this.parent=null}Ua.prototype=DI.prototype={constructor:Ua,count:_L,each:wL,eachAfter:SL,eachBefore:vL,find:IL,sum:TL,sort:EL,path:AL,ancestors:ML,descendants:NL,leaves:RL,links:OL,copy:BW,[Symbol.iterator]:DL};function Wb(e){return e==null?null:zW(e)}function zW(e){if(typeof e!="function")throw new Error;return e}var qW={depth:-1},kL={},FI={};function jW(e){return e.id}function VW(e){return e.parentId}function Xb(){var e=jW,t=VW,n;function r(i){var o=Array.from(i),s=e,a=t,c,l,u,f,d,h,p,m,g=new Map;if(n!=null){let y=o.map((_,v)=>YW(n(_,v,i))),b=y.map(FL),x=new Set(y).add("");for(let _ of b)x.has(_)||(x.add(_),y.push(_),b.push(FL(_)),o.push(FI));s=(_,v)=>y[v],a=(_,v)=>b[v]}for(u=0,c=o.length;u<c;++u)l=o[u],h=o[u]=new Ua(l),(p=s(l,u,i))!=null&&(p+="")&&(m=h.id=p,g.set(m,g.has(m)?kL:h)),(p=a(l,u,i))!=null&&(p+="")&&(h.parent=p);for(u=0;u<c;++u)if(h=o[u],p=h.parent){if(d=g.get(p),!d)throw new Error("missing: "+p);if(d===kL)throw new Error("ambiguous: "+p);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===FI&&f.children.length===1;)f=f.children[0],--c;for(let y=o.length-1;y>=0&&(h=o[y],h.data===FI);--y)h.data=null}if(f.parent=qW,f.eachBefore(function(y){y.depth=y.parent.depth+1,--c}).eachBefore(kI),f.parent=null,c>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(e=Wb(i),r):e},r.parentId=function(i){return arguments.length?(t=Wb(i),r):t},r.path=function(i){return arguments.length?(n=Wb(i),r):n},r}function YW(e){e=`${e}`;let t=e.length;return LI(e,t-1)&&!LI(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function FL(e){let t=e.length;if(t<2)return"";for(;--t>1&&!LI(e,t););return e.slice(0,t)}function LI(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function GW(e,t){return e.parent===t.parent?1:2}function CI(e){var t=e.children;return t?t[0]:e.t}function BI(e){var t=e.children;return t?t[t.length-1]:e.t}function WW(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 XW(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 HW(e,t,n){return e.a.parent===t.parent?e.a:n}function Hb(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}Hb.prototype=Object.create(Ua.prototype);function ZW(e){for(var t=new Hb(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 Hb(o[s],s)),i.parent=n;return(t.parent=new Hb(null,0)).children=[t],t}function cl(){var e=GW,t=1,n=1,r=null;function i(l){var u=ZW(l);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),r)l.eachBefore(c);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,m=p-f.x,g=t/(d.x+p+m),y=n/(h.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,d=l.i?f[l.i-1]:null;if(u){XW(l);var h=(u[0].z+u[u.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,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 d=l,h=l,p=u,m=d.parent.children[0],g=d.m,y=h.m,b=p.m,x=m.m,_;p=BI(p),d=CI(d),p&&d;)m=CI(m),h=BI(h),h.a=l,_=p.z+b-d.z-g+e(p._,d._),_>0&&(WW(HW(p,l,f),l,_),g+=_,y+=_),b+=p.m,g+=d.m,x+=m.m,y+=h.m;p&&!BI(h)&&(h.t=p,h.m+=b-y),d&&!CI(m)&&(m.t=d,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 LL=23283064365386963e-26;function ll(e=Math.random()){let t=(0<=e&&e<1?e/LL:Math.abs(e))|0;return()=>(t=1664525*t+1013904223|0,LL*(t>>>0))}function He(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Rp(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 Op=Symbol("implicit");function ul(){var e=new Zn,t=[],n=[],r=Op;function i(o){let s=e.get(o);if(s===void 0){if(r!==Op)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 Zn;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 ul(t,n).unknown(r)},He.apply(i,arguments),i}function za(){var e=ul().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 d=t().length,h=i<r,p=h?i:r,m=h?r:i;o=(m-p)/Math.max(1,d-c+l*2),a&&(o=Math.floor(o)),p+=(m-p-o*(d-c))*u,s=o*(1-c),a&&(p=Math.round(p),s=Math.round(s));var g=$e(d).map(function(y){return p+o*y});return n(h?g.reverse():g)}return e.domain=function(d){return arguments.length?(t(d),f()):t()},e.range=function(d){return arguments.length?([r,i]=d,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(d){return arguments.length?(a=!!d,f()):a},e.padding=function(d){return arguments.length?(c=Math.min(1,l=+d),f()):c},e.paddingInner=function(d){return arguments.length?(c=Math.min(1,d),f()):c},e.paddingOuter=function(d){return arguments.length?(l=+d,f()):l},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},e.copy=function(){return za(t(),[r,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},He.apply(f(),arguments)}function CL(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return CL(t())},e}function PI(){return CL(za.apply(null,arguments).paddingInner(1))}function $I(e){return function(){return e}}function Ku(e){return+e}var BL=[0,1];function xr(e){return e}function UI(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:$I(isNaN(t)?NaN:.5)}function QW(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function KW(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=UI(i,r),o=n(s,o)):(r=UI(r,i),o=n(o,s)),function(a){return o(r(a))}}function JW(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]=UI(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var c=ws(e,a,1,r)-1;return o[c](i[c](a))}}function Io(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function fl(){var e=BL,t=BL,n=Cr,r,i,o,s=xr,a,c,l;function u(){var d=Math.min(e.length,t.length);return s!==xr&&(s=QW(e[0],e[d-1])),a=d>2?JW:KW,c=l=null,f}function f(d){return d==null||isNaN(d=+d)?o:(c||(c=a(e.map(r),t,n)))(r(s(d)))}return f.invert=function(d){return s(i((l||(l=a(t,e.map(r),we)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,Ku),u()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=Kc,u()},f.clamp=function(d){return arguments.length?(s=d?!0:xr,u()):s!==xr},f.interpolate=function(d){return arguments.length?(n=d,u()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return r=d,i=h,u()}}function Dp(){return fl()(xr,xr)}function zI(e,t,n,r){var i=wu(e,t,n),o;switch(r=xo(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=FS(i,s))&&(r.precision=o),pb(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=LS(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=kS(i))&&(r.precision=o-(r.type==="%")*2);break}}return ci(r)}function Ds(e){var t=e.domain;return e.ticks=function(n){var r=t();return Tn(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return zI(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=vs(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 ks(){var e=Dp();return e.copy=function(){return Io(e,ks())},He.apply(e,arguments),Ds(e)}function kp(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,Ku),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return kp(e).unknown(t)},e=arguments.length?Array.from(e,Ku):[0,1],Ds(n)}function Fp(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 PL(e){return Math.log(e)}function $L(e){return Math.exp(e)}function tX(e){return-Math.log(-e)}function eX(e){return-Math.exp(-e)}function nX(e){return isFinite(e)?+("1e"+e):e<0?0:e}function rX(e){return e===10?nX:e===Math.E?Math.exp:t=>Math.pow(e,t)}function iX(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 UL(e){return(t,n)=>-e(-t,n)}function qI(e){let t=e(PL,$L),n=t.domain,r=10,i,o;function s(){return i=iX(r),o=rX(r),n()[0]<0?(i=UL(i),o=UL(o),e(tX,eX)):e(PL,$L),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 d=i(l),h=i(u),p,m,g=a==null?10:+a,y=[];if(!(r%1)&&h-d<g){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(p=1;p<r;++p)if(m=d<0?p/o(-d):p*o(d),!(m<l)){if(m>u)break;y.push(m)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(m=d>0?p/o(-d):p*o(d),!(m<l)){if(m>u)break;y.push(m)}y.length*2<g&&(y=Tn(l,u,g))}else y=Tn(d,h,Math.min(h-d,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=xo(c)).precision==null&&(c.trim=!0),c=ci(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(Fp(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function Lp(){let e=qI(fl()).domain([1,10]);return e.copy=()=>Io(e,Lp()).base(e.base()),He.apply(e,arguments),e}function zL(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function qL(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function jI(e){var t=1,n=e(zL(t),qL(t));return n.constant=function(r){return arguments.length?e(zL(t=+r),qL(t)):t},Ds(n)}function Cp(){var e=jI(fl());return e.copy=function(){return Io(e,Cp()).constant(e.constant())},He.apply(e,arguments)}function jL(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function oX(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function sX(e){return e<0?-e*e:e*e}function VI(e){var t=e(xr,xr),n=1;function r(){return n===1?e(xr,xr):n===.5?e(oX,sX):e(jL(n),jL(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Ds(t)}function Bp(){var e=VI(fl());return e.copy=function(){return Io(e,Bp()).exponent(e.exponent())},He.apply(e,arguments),e}function Pp(){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]=j2(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?r:t[ws(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(Ut),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 Pp().domain(e).range(t).unknown(r)},He.apply(o,arguments)}function $p(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[ws(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 $p().domain(e).range(t).unknown(n)},He.apply(i,arguments)}var YI=new Date,GI=new Date;function pe(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=>pe(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)=>(YI.setTime(+o),GI.setTime(+s),e(YI),e(GI),Math.floor(n(YI,GI))),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 Up=pe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Up.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?pe(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Up);var qAt=Up.range;var ln=pe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),VL=ln.range;var Fs=pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),aX=Fs.range,Ls=pe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),cX=Ls.range;var Cs=pe(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()),lX=Cs.range,Bs=pe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),uX=Bs.range;var ui=pe(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),fX=ui.range,pl=pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),dX=pl.range,ml=pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),hX=ml.range;function yl(e){return pe(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 Pr=yl(0),qa=yl(1),Zb=yl(2),Qb=yl(3),Eo=yl(4),Kb=yl(5),Jb=yl(6),GL=Pr.range,pX=qa.range,mX=Zb.range,yX=Qb.range,gX=Eo.range,bX=Kb.range,xX=Jb.range;function gl(e){return pe(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 $r=gl(0),ja=gl(1),tx=gl(2),ex=gl(3),Ao=gl(4),nx=gl(5),rx=gl(6),WL=$r.range,_X=ja.range,wX=tx.range,vX=ex.range,SX=Ao.range,IX=nx.range,TX=rx.range;var Ps=pe(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()),EX=Ps.range,$s=pe(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()),AX=$s.range;var Un=pe(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());Un.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pe(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 MX=Un.range,zn=pe(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());zn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pe(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 NX=zn.range;function HL(e,t,n,r,i,o){let s=[[ln,1,1e3],[ln,5,5*1e3],[ln,15,15*1e3],[ln,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 d=u<l;d&&([l,u]=[u,l]);let h=f&&typeof f.range=="function"?f:c(l,u,f),p=h?h.range(l,+u+1):[];return d?p.reverse():p}function c(l,u,f){let d=Math.abs(u-l)/f,h=_s(([,,g])=>g).right(s,d);if(h===s.length)return e.every(wu(l/31536e6,u/31536e6,f));if(h===0)return Up.every(Math.max(wu(l,u,f),1));let[p,m]=s[d/s[h-1][2]<s[h][2]/d?h-1:h];return p.every(m)}return[a,c]}var[WI,qp]=HL(zn,$s,$r,ml,Bs,Ls),[XI,HI]=HL(Un,Ps,Pr,ui,Cs,Fs);function ZI(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 QI(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 jp(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function KI(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=Vp(i),u=Yp(i),f=Vp(o),d=Yp(o),h=Vp(s),p=Yp(s),m=Vp(a),g=Yp(a),y=Vp(c),b=Yp(c),x={a:L,A:B,b:C,B:P,c:null,d:eC,e:eC,f:JX,g:lH,G:fH,H:ZX,I:QX,j:KX,L:sC,m:tH,M:eH,p:$,q:U,Q:iC,s:oC,S:nH,u:rH,U:iH,V:oH,w:sH,W:aH,x:null,X:null,y:cH,Y:uH,Z:dH,"%":rC},_={a:X,A:tt,b:nt,B:st,c:null,d:nC,e:nC,f:yH,g:EH,G:MH,H:hH,I:pH,j:mH,L:cC,m:gH,M:bH,p:Y,q:rt,Q:iC,s:oC,S:xH,u:_H,U:wH,V:vH,w:SH,W:IH,x:null,X:null,y:TH,Y:AH,Z:NH,"%":rC},v={a:I,A,b:O,B:F,c:S,d:JL,e:JL,f:GX,g:KL,G:QL,H:tC,I:tC,j:qX,L:YX,m:zX,M:jX,p:R,q:UX,Q:XX,s:HX,S:VX,u:LX,U:CX,V:BX,w:FX,W:PX,x:E,X:N,y:KL,Y:QL,Z:$X,"%":WX};x.x=w(n,x),x.X=w(r,x),x.c=w(t,x),_.x=w(n,_),_.X=w(r,_),_.c=w(t,_);function w(q,H){return function(ot){var z=[],Lt=-1,dt=0,Wt=q.length,Xt,et,oe;for(ot instanceof Date||(ot=new Date(+ot));++Lt<Wt;)q.charCodeAt(Lt)===37&&(z.push(q.slice(dt,Lt)),(et=ZL[Xt=q.charAt(++Lt)])!=null?Xt=q.charAt(++Lt):et=Xt==="e"?" ":"0",(oe=H[Xt])&&(Xt=oe(ot,et)),z.push(Xt),dt=Lt+1);return z.push(q.slice(dt,Lt)),z.join("")}}function T(q,H){return function(ot){var z=jp(1900,void 0,1),Lt=M(z,q,ot+="",0),dt,Wt;if(Lt!=ot.length)return null;if("Q"in z)return new Date(z.Q);if("s"in z)return new Date(z.s*1e3+("L"in z?z.L:0));if(H&&!("Z"in z)&&(z.Z=0),"p"in z&&(z.H=z.H%12+z.p*12),z.m===void 0&&(z.m="q"in z?z.q:0),"V"in z){if(z.V<1||z.V>53)return null;"w"in z||(z.w=1),"Z"in z?(dt=QI(jp(z.y,0,1)),Wt=dt.getUTCDay(),dt=Wt>4||Wt===0?ja.ceil(dt):ja(dt),dt=pl.offset(dt,(z.V-1)*7),z.y=dt.getUTCFullYear(),z.m=dt.getUTCMonth(),z.d=dt.getUTCDate()+(z.w+6)%7):(dt=ZI(jp(z.y,0,1)),Wt=dt.getDay(),dt=Wt>4||Wt===0?qa.ceil(dt):qa(dt),dt=ui.offset(dt,(z.V-1)*7),z.y=dt.getFullYear(),z.m=dt.getMonth(),z.d=dt.getDate()+(z.w+6)%7)}else("W"in z||"U"in z)&&("w"in z||(z.w="u"in z?z.u%7:"W"in z?1:0),Wt="Z"in z?QI(jp(z.y,0,1)).getUTCDay():ZI(jp(z.y,0,1)).getDay(),z.m=0,z.d="W"in z?(z.w+6)%7+z.W*7-(Wt+5)%7:z.w+z.U*7-(Wt+6)%7);return"Z"in z?(z.H+=z.Z/100|0,z.M+=z.Z%100,QI(z)):ZI(z)}}function M(q,H,ot,z){for(var Lt=0,dt=H.length,Wt=ot.length,Xt,et;Lt<dt;){if(z>=Wt)return-1;if(Xt=H.charCodeAt(Lt++),Xt===37){if(Xt=H.charAt(Lt++),et=v[Xt in ZL?H.charAt(Lt++):Xt],!et||(z=et(q,ot,z))<0)return-1}else if(Xt!=ot.charCodeAt(z++))return-1}return z}function R(q,H,ot){var z=l.exec(H.slice(ot));return z?(q.p=u.get(z[0].toLowerCase()),ot+z[0].length):-1}function I(q,H,ot){var z=h.exec(H.slice(ot));return z?(q.w=p.get(z[0].toLowerCase()),ot+z[0].length):-1}function A(q,H,ot){var z=f.exec(H.slice(ot));return z?(q.w=d.get(z[0].toLowerCase()),ot+z[0].length):-1}function O(q,H,ot){var z=y.exec(H.slice(ot));return z?(q.m=b.get(z[0].toLowerCase()),ot+z[0].length):-1}function F(q,H,ot){var z=m.exec(H.slice(ot));return z?(q.m=g.get(z[0].toLowerCase()),ot+z[0].length):-1}function S(q,H,ot){return M(q,t,H,ot)}function E(q,H,ot){return M(q,n,H,ot)}function N(q,H,ot){return M(q,r,H,ot)}function L(q){return s[q.getDay()]}function B(q){return o[q.getDay()]}function C(q){return c[q.getMonth()]}function P(q){return a[q.getMonth()]}function $(q){return i[+(q.getHours()>=12)]}function U(q){return 1+~~(q.getMonth()/3)}function X(q){return s[q.getUTCDay()]}function tt(q){return o[q.getUTCDay()]}function nt(q){return c[q.getUTCMonth()]}function st(q){return a[q.getUTCMonth()]}function Y(q){return i[+(q.getUTCHours()>=12)]}function rt(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var H=w(q+="",x);return H.toString=function(){return q},H},parse:function(q){var H=T(q+="",!1);return H.toString=function(){return q},H},utcFormat:function(q){var H=w(q+="",_);return H.toString=function(){return q},H},utcParse:function(q){var H=T(q+="",!0);return H.toString=function(){return q},H}}}var ZL={"-":"",_:" ",0:"0"},un=/^\s*\d+/,OX=/^%/,DX=/[\\^$*+?|[\]().{}]/g;function te(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 kX(e){return e.replace(DX,"\\$&")}function Vp(e){return new RegExp("^(?:"+e.map(kX).join("|")+")","i")}function Yp(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function FX(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function LX(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function CX(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function BX(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function PX(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function QL(e,t,n){var r=un.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function KL(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function $X(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 UX(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function zX(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function JL(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function qX(e,t,n){var r=un.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function tC(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function jX(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function VX(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function YX(e,t,n){var r=un.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function GX(e,t,n){var r=un.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function WX(e,t,n){var r=OX.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function XX(e,t,n){var r=un.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function HX(e,t,n){var r=un.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function eC(e,t){return te(e.getDate(),t,2)}function ZX(e,t){return te(e.getHours(),t,2)}function QX(e,t){return te(e.getHours()%12||12,t,2)}function KX(e,t){return te(1+ui.count(Un(e),e),t,3)}function sC(e,t){return te(e.getMilliseconds(),t,3)}function JX(e,t){return sC(e,t)+"000"}function tH(e,t){return te(e.getMonth()+1,t,2)}function eH(e,t){return te(e.getMinutes(),t,2)}function nH(e,t){return te(e.getSeconds(),t,2)}function rH(e){var t=e.getDay();return t===0?7:t}function iH(e,t){return te(Pr.count(Un(e)-1,e),t,2)}function aC(e){var t=e.getDay();return t>=4||t===0?Eo(e):Eo.ceil(e)}function oH(e,t){return e=aC(e),te(Eo.count(Un(e),e)+(Un(e).getDay()===4),t,2)}function sH(e){return e.getDay()}function aH(e,t){return te(qa.count(Un(e)-1,e),t,2)}function cH(e,t){return te(e.getFullYear()%100,t,2)}function lH(e,t){return e=aC(e),te(e.getFullYear()%100,t,2)}function uH(e,t){return te(e.getFullYear()%1e4,t,4)}function fH(e,t){var n=e.getDay();return e=n>=4||n===0?Eo(e):Eo.ceil(e),te(e.getFullYear()%1e4,t,4)}function dH(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+te(t/60|0,"0",2)+te(t%60,"0",2)}function nC(e,t){return te(e.getUTCDate(),t,2)}function hH(e,t){return te(e.getUTCHours(),t,2)}function pH(e,t){return te(e.getUTCHours()%12||12,t,2)}function mH(e,t){return te(1+pl.count(zn(e),e),t,3)}function cC(e,t){return te(e.getUTCMilliseconds(),t,3)}function yH(e,t){return cC(e,t)+"000"}function gH(e,t){return te(e.getUTCMonth()+1,t,2)}function bH(e,t){return te(e.getUTCMinutes(),t,2)}function xH(e,t){return te(e.getUTCSeconds(),t,2)}function _H(e){var t=e.getUTCDay();return t===0?7:t}function wH(e,t){return te($r.count(zn(e)-1,e),t,2)}function lC(e){var t=e.getUTCDay();return t>=4||t===0?Ao(e):Ao.ceil(e)}function vH(e,t){return e=lC(e),te(Ao.count(zn(e),e)+(zn(e).getUTCDay()===4),t,2)}function SH(e){return e.getUTCDay()}function IH(e,t){return te(ja.count(zn(e)-1,e),t,2)}function TH(e,t){return te(e.getUTCFullYear()%100,t,2)}function EH(e,t){return e=lC(e),te(e.getUTCFullYear()%100,t,2)}function AH(e,t){return te(e.getUTCFullYear()%1e4,t,4)}function MH(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ao(e):Ao.ceil(e),te(e.getUTCFullYear()%1e4,t,4)}function NH(){return"+0000"}function rC(){return"%"}function iC(e){return+e}function oC(e){return Math.floor(+e/1e3)}var Ju,tf,uC,Mo,fC;JI({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 JI(e){return Ju=KI(e),tf=Ju.format,uC=Ju.parse,Mo=Ju.utcFormat,fC=Ju.utcParse,Ju}function RH(e){return new Date(e)}function OH(e){return e instanceof Date?+e:+new Date(+e)}function ix(e,t,n,r,i,o,s,a,c,l){var u=Dp(),f=u.invert,d=u.domain,h=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),y=l("%a %d"),b=l("%b %d"),x=l("%B"),_=l("%Y");function v(w){return(c(w)<w?h:a(w)<w?p:s(w)<w?m:o(w)<w?g:r(w)<w?i(w)<w?y:b:n(w)<w?x:_)(w)}return u.invert=function(w){return new Date(f(w))},u.domain=function(w){return arguments.length?d(Array.from(w,OH)):d().map(RH)},u.ticks=function(w){var T=d();return e(T[0],T[T.length-1],w??10)},u.tickFormat=function(w,T){return T==null?v:l(T)},u.nice=function(w){var T=d();return(!w||typeof w.range!="function")&&(w=t(T[0],T[T.length-1],w??10)),w?d(Fp(T,w)):u},u.copy=function(){return Io(u,ix(e,t,n,r,i,o,s,a,c,l))},u}function ox(){return He.apply(ix(XI,HI,Un,Ps,Pr,ui,Cs,Fs,ln,tf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function sx(){return He.apply(ix(WI,qp,zn,$s,$r,pl,Bs,Ls,ln,Mo).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Gp(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function ax(){var e=0,t=.5,n=1,r=1,i,o,s,a,c,l=xr,u,f=!1,d;function h(m){return isNaN(m=+m)?d:(m=.5+((m=+u(m))-o)*(r*m<r*o?a:c),l(f?Math.max(0,Math.min(1,m)):m))}h.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,h):[e,t,n]},h.clamp=function(m){return arguments.length?(f=!!m,h):f},h.interpolator=function(m){return arguments.length?(l=m,h):l};function p(m){return function(g){var y,b,x;return arguments.length?([y,b,x]=g,l=mo(m,[y,b,x]),h):[l(0),l(.5),l(1)]}}return h.range=p(Cr),h.rangeRound=p(Kc),h.unknown=function(m){return arguments.length?(d=m,h):d},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,h}}function Wp(){var e=Ds(ax()(xr));return e.copy=function(){return Gp(e,Wp())},Rp.apply(e,arguments)}function cx(){var e=qI(ax()).domain([.1,1,10]);return e.copy=function(){return Gp(e,cx()).base(e.base())},Rp.apply(e,arguments)}function lx(){var e=jI(ax());return e.copy=function(){return Gp(e,lx()).constant(e.constant())},Rp.apply(e,arguments)}function ux(){var e=VI(ax());return e.copy=function(){return Gp(e,ux()).exponent(e.exponent())},Rp.apply(e,arguments)}function G(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 tT=G("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var eT=G("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");var nT=G("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");var rT=G("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");var iT=G("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");var oT=G("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");var sT=G("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");var aT=G("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");var cT=G("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var lT=G("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var ht=e=>oS(e[e.length-1]);var fx=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(G),dx=ht(fx);var hx=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(G),px=ht(hx);var mx=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(G),yx=ht(mx);var gx=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(G),bx=ht(gx);var Xp=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(G),ef=ht(Xp);var xx=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(G),_x=ht(xx);var Hp=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(G),nf=ht(Hp);var wx=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(G),vx=ht(wx);var Sx=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(G),Ix=ht(Sx);var Tx=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(G),Ex=ht(Tx);var Ax=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(G),Mx=ht(Ax);var Nx=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(G),Rx=ht(Nx);var Ox=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(G),Dx=ht(Ox);var kx=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(G),Fx=ht(kx);var Lx=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(G),Cx=ht(Lx);var Bx=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(G),Px=ht(Bx);var $x=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(G),Ux=ht($x);var zx=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(G),qx=ht(zx);var jx=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(G),Vx=ht(jx);var Yx=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(G),Gx=ht(Yx);var Wx=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(G),Xx=ht(Wx);var Hx=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(G),Zx=ht(Hx);var Qx=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(G),Kx=ht(Qx);var Jx=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(G),t1=ht(Jx);var e1=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(G),n1=ht(e1);var r1=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(G),i1=ht(r1);var o1=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(G),s1=ht(o1);function a1(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 c1=Ru(Jn(300,.5,0),Jn(-240,.5,1));var u1=Ru(Jn(-100,.75,.35),Jn(80,1.5,.8)),f1=Ru(Jn(260,.75,.35),Jn(80,1.5,.8)),l1=Jn();function d1(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return l1.h=360*e-100,l1.s=1.5-1.5*t,l1.l=.8-.9*t,l1+""}var h1=rn(),DH=Math.PI/3,kH=Math.PI*2/3;function p1(e){var t;return e=(.5-e)*Math.PI,h1.r=255*(t=Math.sin(e))*t,h1.g=255*(t=Math.sin(e+DH))*t,h1.b=255*(t=Math.sin(e+kH))*t,h1+""}function m1(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 y1(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var g1=y1(G("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),b1=y1(G("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),x1=y1(G("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),_1=y1(G("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Ze(e){return function(){return e}}var uT=Math.cos;var rf=Math.min,Zp=Math.sin,ee=Math.sqrt,fT=1e-12,bl=Math.PI,u4t=bl/2,of=2*bl;function w1(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 La(t)}var p4t=Array.prototype.slice;function v1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dC(e){this._context=e}dC.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 Us(e){return new dC(e)}function S1(e){return e[0]}function I1(e){return e[1]}function Qp(e,t){var n=Ze(!0),r=null,i=Us,o=null,s=w1(a);e=typeof e=="function"?e:e===void 0?S1:Ze(e),t=typeof t=="function"?t:t===void 0?I1:Ze(t);function a(c){var l,u=(c=v1(c)).length,f,d=!1,h;for(r==null&&(o=i(h=s())),l=0;l<=u;++l)!(l<u&&n(f=c[l],l,c))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(f,l,c),+t(f,l,c));if(h)return o=null,h+""||null}return a.x=function(c){return arguments.length?(e=typeof c=="function"?c:Ze(+c),a):e},a.y=function(c){return arguments.length?(t=typeof c=="function"?c:Ze(+c),a):t},a.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Ze(!!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 sf(e,t,n){var r=null,i=Ze(!0),o=null,s=Us,a=null,c=w1(l);e=typeof e=="function"?e:e===void 0?S1:Ze(+e),t=typeof t=="function"?t:t===void 0?Ze(0):Ze(+t),n=typeof n=="function"?n:n===void 0?I1:Ze(+n);function l(f){var d,h,p,m=(f=v1(f)).length,g,y=!1,b,x=new Array(m),_=new Array(m);for(o==null&&(a=s(b=c())),d=0;d<=m;++d){if(!(d<m&&i(g=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=d-1;p>=h;--p)a.point(x[p],_[p]);a.lineEnd(),a.areaEnd()}y&&(x[d]=+e(g,d,f),_[d]=+t(g,d,f),a.point(r?+r(g,d,f):x[d],n?+n(g,d,f):_[d]))}if(b)return a=null,b+""||null}function u(){return Qp().defined(i).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ze(+f),r=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Ze(+f),l):e},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Ze(+f),l):r},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ze(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Ze(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Ze(+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:Ze(!!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 T1=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 dT(e){return new T1(e,!0)}function hT(e){return new T1(e,!1)}var FH=ee(3),Kp={draw(e,t){let n=ee(t+rf(t/28,.75))*.59436,r=n/2,i=r*FH;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 zs={draw(e,t){let n=ee(t/bl);e.moveTo(n,0),e.arc(0,0,n,0,of)}};var Jp={draw(e,t){let n=ee(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 hC=ee(1/3),LH=hC*2,tm={draw(e,t){let n=ee(t/LH),r=n*hC;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}};var em={draw(e,t){let n=ee(t)*.62625;e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}};var nm={draw(e,t){let n=ee(t-rf(t/7,2))*.87559;e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}};var rm={draw(e,t){let n=ee(t),r=-n/2;e.rect(r,r,n,n)}};var im={draw(e,t){let n=ee(t)*.4431;e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}};var CH=.8908130915292852,pC=Zp(bl/10)/Zp(7*bl/10),BH=Zp(of/10)*pC,PH=-uT(of/10)*pC,om={draw(e,t){let n=ee(t*CH),r=BH*n,i=PH*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){let s=of*o/5,a=uT(s),c=Zp(s);e.lineTo(c*n,-a*n),e.lineTo(a*r-c*i,c*r+a*i)}e.closePath()}};var pT=ee(3),sm={draw(e,t){let n=-ee(t/(pT*3));e.moveTo(0,n*2),e.lineTo(-pT*n,-n),e.lineTo(pT*n,-n),e.closePath()}};var $H=ee(3),am={draw(e,t){let n=ee(t)*.6824,r=n/2,i=n*$H/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}};var fi=-.5,di=ee(3)/2,mT=1/ee(12),UH=(mT/2+1)*3,cm={draw(e,t){let n=ee(t/UH),r=n/2,i=n*mT,o=r,s=n*mT+n,a=-o,c=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(a,c),e.lineTo(fi*r-di*i,di*r+fi*i),e.lineTo(fi*o-di*s,di*o+fi*s),e.lineTo(fi*a-di*c,di*a+fi*c),e.lineTo(fi*r+di*i,fi*i-di*r),e.lineTo(fi*o+di*s,fi*s-di*o),e.lineTo(fi*a+di*c,fi*c-di*a),e.closePath()}};var af={draw(e,t){let n=ee(t-rf(t/6,1.7))*.6189;e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}};var E1=[zs,Jp,tm,rm,om,sm,cm],yT=[zs,nm,af,am,Kp,im,em];function hi(){}function cf(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 lm(e){this._context=e}lm.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:cf(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:cf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gT(e){return new lm(e)}function mC(e){this._context=e}mC.prototype={areaStart:hi,areaEnd:hi,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:cf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function bT(e){return new mC(e)}function yC(e){this._context=e}yC.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:cf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xT(e){return new yC(e)}function gC(e,t){this._basis=new lm(e),this._beta=t}gC.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 _T=function e(t){function n(r){return t===1?new lm(r):new gC(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function lf(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 A1(e,t){this._context=e,this._k=(1-t)/6}A1.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:lf(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:lf(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 wT=function e(t){function n(r){return new A1(r,t)}return n.tension=function(r){return e(+r)},n}(0);function M1(e,t){this._context=e,this._k=(1-t)/6}M1.prototype={areaStart:hi,areaEnd:hi,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:lf(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 vT=function e(t){function n(r){return new M1(r,t)}return n.tension=function(r){return e(+r)},n}(0);function N1(e,t){this._context=e,this._k=(1-t)/6}N1.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:lf(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 ST=function e(t){function n(r){return new N1(r,t)}return n.tension=function(r){return e(+r)},n}(0);function um(e,t,n){var r=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>fT){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>fT){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 bC(e,t){this._context=e,this._alpha=t}bC.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:um(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 IT=function e(t){function n(r){return t?new bC(r,t):new A1(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function xC(e,t){this._context=e,this._alpha=t}xC.prototype={areaStart:hi,areaEnd:hi,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:um(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 TT=function e(t){function n(r){return t?new xC(r,t):new M1(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function _C(e,t){this._context=e,this._alpha=t}_C.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:um(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 ET=function e(t){function n(r){return t?new _C(r,t):new N1(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function wC(e){this._context=e}wC.prototype={areaStart:hi,areaEnd:hi,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 AT(e){return new wC(e)}function vC(e){return e<0?-1:1}function SC(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(vC(o)+vC(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function IC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function MT(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 R1(e){this._context=e}R1.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:MT(this,this._t0,IC(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,MT(this,IC(this,n=SC(this,e,t)),n);break;default:MT(this,this._t0,n=SC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function TC(e){this._context=new EC(e)}(TC.prototype=Object.create(R1.prototype)).point=function(e,t){R1.prototype.point.call(this,t,e)};function EC(e){this._context=e}EC.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 NT(e){return new R1(e)}function RT(e){return new TC(e)}function MC(e){this._context=e}MC.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=AC(e),i=AC(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 AC(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 OT(e){return new MC(e)}function O1(e,t){this._context=e,this._t=t}O1.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 DT(e){return new O1(e,.5)}function kT(e){return new O1(e,0)}function FT(e){return new O1(e,1)}var fm=e=>()=>e;function LT(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 Ur(e,t,n){this.k=e,this.x=t,this.y=n}Ur.prototype={constructor:Ur,scale:function(e){return e===1?this:new Ur(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ur(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 dm=new Ur(1,0,0);CT.prototype=Ur.prototype;function CT(e){for(;!e.__zoom;)if(!(e=e.parentNode))return dm;return e.__zoom}function D1(e){e.stopImmediatePropagation()}function uf(e){e.preventDefault(),e.stopImmediatePropagation()}function zH(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function qH(){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 NC(){return this.__zoom||dm}function jH(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function VH(){return navigator.maxTouchPoints||"ontouchstart"in this}function YH(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 BT(){var e=zH,t=qH,n=YH,r=jH,i=VH,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=fS,l=Gc("start","zoom","end"),u,f,d,h=500,p=150,m=0,g=10;function y(S){S.property("__zoom",NC).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",A).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(S,E,N,L){var B=S.selection?S.selection():S;B.property("__zoom",NC),S!==B?v(S,E,N,L):B.interrupt().each(function(){w(this,arguments).event(L).start().zoom(null,typeof E=="function"?E.apply(this,arguments):E).end()})},y.scaleBy=function(S,E,N,L){y.scaleTo(S,function(){var B=this.__zoom.k,C=typeof E=="function"?E.apply(this,arguments):E;return B*C},N,L)},y.scaleTo=function(S,E,N,L){y.transform(S,function(){var B=t.apply(this,arguments),C=this.__zoom,P=N==null?_(B):typeof N=="function"?N.apply(this,arguments):N,$=C.invert(P),U=typeof E=="function"?E.apply(this,arguments):E;return n(x(b(C,U),P,$),B,s)},N,L)},y.translateBy=function(S,E,N,L){y.transform(S,function(){return n(this.__zoom.translate(typeof E=="function"?E.apply(this,arguments):E,typeof N=="function"?N.apply(this,arguments):N),t.apply(this,arguments),s)},null,L)},y.translateTo=function(S,E,N,L,B){y.transform(S,function(){var C=t.apply(this,arguments),P=this.__zoom,$=L==null?_(C):typeof L=="function"?L.apply(this,arguments):L;return n(dm.translate($[0],$[1]).scale(P.k).translate(typeof E=="function"?-E.apply(this,arguments):-E,typeof N=="function"?-N.apply(this,arguments):-N),C,s)},L,B)};function b(S,E){return E=Math.max(o[0],Math.min(o[1],E)),E===S.k?S:new Ur(E,S.x,S.y)}function x(S,E,N){var L=E[0]-N[0]*S.k,B=E[1]-N[1]*S.k;return L===S.x&&B===S.y?S:new Ur(S.k,L,B)}function _(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function v(S,E,N,L){S.on("start.zoom",function(){w(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(L).end()}).tween("zoom",function(){var B=this,C=arguments,P=w(B,C).event(L),$=t.apply(B,C),U=N==null?_($):typeof N=="function"?N.apply(B,C):N,X=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),tt=B.__zoom,nt=typeof E=="function"?E.apply(B,C):E,st=c(tt.invert(U).concat(X/tt.k),nt.invert(U).concat(X/nt.k));return function(Y){if(Y===1)Y=nt;else{var rt=st(Y),q=X/rt[2];Y=new Ur(q,U[0]-rt[0]*q,U[1]-rt[1]*q)}P.zoom(null,Y)}})}function w(S,E,N){return!N&&S.__zooming||new T(S,E)}function T(S,E){this.that=S,this.args=E,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,E),this.taps=0}T.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,E){return this.mouse&&S!=="mouse"&&(this.mouse[1]=E.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=E.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=E.invert(this.touch1[0])),this.that.__zoom=E,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var E=qt(this.that).datum();l.call(S,this.that,new LT(S,{sourceEvent:this.sourceEvent,target:y,type:S,transform:this.that.__zoom,dispatch:l}),E)}};function M(S,...E){if(!e.apply(this,arguments))return;var N=w(this,E).event(S),L=this.__zoom,B=Math.max(o[0],Math.min(o[1],L.k*Math.pow(2,r.apply(this,arguments)))),C=Ln(S);if(N.wheel)(N.mouse[0][0]!==C[0]||N.mouse[0][1]!==C[1])&&(N.mouse[1]=L.invert(N.mouse[0]=C)),clearTimeout(N.wheel);else{if(L.k===B)return;N.mouse=[C,L.invert(C)],yo(this),N.start()}uf(S),N.wheel=setTimeout(P,p),N.zoom("mouse",n(x(b(L,B),N.mouse[0],N.mouse[1]),N.extent,s));function P(){N.wheel=null,N.end()}}function R(S,...E){if(d||!e.apply(this,arguments))return;var N=S.currentTarget,L=w(this,E,!0).event(S),B=qt(S.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",X,!0),C=Ln(S,N),P=S.clientX,$=S.clientY;qh(S.view),D1(S),L.mouse=[C,this.__zoom.invert(C)],yo(this),L.start();function U(tt){if(uf(tt),!L.moved){var nt=tt.clientX-P,st=tt.clientY-$;L.moved=nt*nt+st*st>m}L.event(tt).zoom("mouse",n(x(L.that.__zoom,L.mouse[0]=Ln(tt,N),L.mouse[1]),L.extent,s))}function X(tt){B.on("mousemove.zoom mouseup.zoom",null),jh(tt.view,L.moved),uf(tt),L.event(tt).end()}}function I(S,...E){if(e.apply(this,arguments)){var N=this.__zoom,L=Ln(S.changedTouches?S.changedTouches[0]:S,this),B=N.invert(L),C=N.k*(S.shiftKey?.5:2),P=n(x(b(N,C),L,B),t.apply(this,E),s);uf(S),a>0?qt(this).transition().duration(a).call(v,P,L,S):qt(this).call(y.transform,P,L,S)}}function A(S,...E){if(e.apply(this,arguments)){var N=S.touches,L=N.length,B=w(this,E,S.changedTouches.length===L).event(S),C,P,$,U;for(D1(S),P=0;P<L;++P)$=N[P],U=Ln($,this),U=[U,this.__zoom.invert(U),$.identifier],B.touch0?!B.touch1&&B.touch0[2]!==U[2]&&(B.touch1=U,B.taps=0):(B.touch0=U,C=!0,B.taps=1+!!u);u&&(u=clearTimeout(u)),C&&(B.taps<2&&(f=U[0],u=setTimeout(function(){u=null},h)),yo(this),B.start())}}function O(S,...E){if(this.__zooming){var N=w(this,E).event(S),L=S.changedTouches,B=L.length,C,P,$,U;for(uf(S),C=0;C<B;++C)P=L[C],$=Ln(P,this),N.touch0&&N.touch0[2]===P.identifier?N.touch0[0]=$:N.touch1&&N.touch1[2]===P.identifier&&(N.touch1[0]=$);if(P=N.that.__zoom,N.touch1){var X=N.touch0[0],tt=N.touch0[1],nt=N.touch1[0],st=N.touch1[1],Y=(Y=nt[0]-X[0])*Y+(Y=nt[1]-X[1])*Y,rt=(rt=st[0]-tt[0])*rt+(rt=st[1]-tt[1])*rt;P=b(P,Math.sqrt(Y/rt)),$=[(X[0]+nt[0])/2,(X[1]+nt[1])/2],U=[(tt[0]+st[0])/2,(tt[1]+st[1])/2]}else if(N.touch0)$=N.touch0[0],U=N.touch0[1];else return;N.zoom("touch",n(x(P,$,U),N.extent,s))}}function F(S,...E){if(this.__zooming){var N=w(this,E).event(S),L=S.changedTouches,B=L.length,C,P;for(D1(S),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),C=0;C<B;++C)P=L[C],N.touch0&&N.touch0[2]===P.identifier?delete N.touch0:N.touch1&&N.touch1[2]===P.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(P=Ln(P,this),Math.hypot(f[0]-P[0],f[1]-P[1])<g)){var $=qt(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return y.wheelDelta=function(S){return arguments.length?(r=typeof S=="function"?S:fm(+S),y):r},y.filter=function(S){return arguments.length?(e=typeof S=="function"?S:fm(!!S),y):e},y.touchable=function(S){return arguments.length?(i=typeof S=="function"?S:fm(!!S),y):i},y.extent=function(S){return arguments.length?(t=typeof S=="function"?S:fm([[+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 Ue(e){return e!=null&&!Number.isNaN(e)}function fn(e,t){return+Ue(t)-+Ue(e)||Ut(e,t)}function xl(e,t){return+Ue(t)-+Ue(e)||Hn(e,t)}function hm(e){return e!=null&&`${e}`!=""}function ff(e){return isFinite(e)?e:NaN}function sr(e){return e>0&&isFinite(e)?e:NaN}function Va(e){return e<0&&isFinite(e)?e:NaN}function df(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`${GH(e.getUTCFullYear(),4)}-${qs(e.getUTCMonth()+1,2)}-${qs(e.getUTCDate(),2)}${n||r||i||o?`T${qs(n,2)}:${qs(r,2)}${i||o?`:${qs(i,2)}${o?`.${qs(o,3)}`:""}`:""}Z`:""}`}function GH(e){return e<0?`-${qs(-e,6)}`:e>9999?`+${qs(e,6)}`:qs(e,4)}function qs(e,t){return`${e}`.padStart(t,"0")}var WH=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function pm(e,t){return WH.test(e+="")?new Date(e):typeof t=="function"?t(e):t}var pf=1e3,Ga=pf*60,Wa=Ga*60,Ro=Wa*24,No=Ro*7,_l=Ro*30,Ya=Ro*365,PT=[["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",pf],["5 seconds",5*pf],["15 seconds",15*pf],["30 seconds",30*pf],["minute",Ga],["5 minutes",5*Ga],["15 minutes",15*Ga],["30 minutes",30*Ga],["hour",Wa],["3 hours",3*Wa],["6 hours",6*Wa],["12 hours",12*Wa],["day",Ro],["2 days",2*Ro],["week",No],["2 weeks",2*No],["month",_l],["3 months",3*_l],["6 months",6*_l],["year",Ya],["2 years",2*Ya],["5 years",5*Ya],["10 years",10*Ya],["20 years",20*Ya],["50 years",50*Ya],["100 years",100*Ya]],$T=new Map([["second",pf],["minute",Ga],["hour",Wa],["day",Ro],["monday",No],["tuesday",No],["wednesday",No],["thursday",No],["friday",No],["saturday",No],["sunday",No],["week",No],["month",_l],["year",Ya]]),OC=new Map([["second",ln],["minute",Fs],["hour",Cs],["day",ui],["monday",qa],["tuesday",Zb],["wednesday",Qb],["thursday",Eo],["friday",Kb],["saturday",Jb],["sunday",Pr],["week",Pr],["month",Ps],["year",Un]]),UT=new Map([["second",ln],["minute",Ls],["hour",Bs],["day",ml],["monday",ja],["tuesday",tx],["wednesday",ex],["thursday",Ao],["friday",nx],["saturday",rx],["sunday",$r],["week",$r],["month",$s],["year",zn]]),mf=Symbol("intervalDuration"),F1=Symbol("intervalType");for(let[e,t]of OC)t[mf]=$T.get(e),t[F1]="time";for(let[e,t]of UT)t[mf]=$T.get(e),t[F1]="utc";var mm=[["year",zn,"utc"],["month",$s,"utc"],["day",ml,"utc",6*_l],["hour",Bs,"utc",3*Ro],["minute",Ls,"utc",6*Wa],["second",ln,"utc",30*Ga]],k1=[["year",Un,"time"],["month",Ps,"time"],["day",ui,"time",6*_l],["hour",Cs,"time",3*Ro],["minute",Fs,"time",6*Wa],["second",ln,"time",30*Ga]],XH=[mm[0],k1[0],mm[1],k1[1],mm[2],k1[2],...mm.slice(3)];function L1(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=UT.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 zT(e){return DC(L1(e),"time")}function ym(e){return DC(L1(e),"utc")}function DC([e,t],n){let r=(n==="time"?OC:UT).get(e);return t>1&&(r=r.every(t),r[mf]=$T.get(e)*t,r[F1]=n),r}function qT(e,t){if(!(t>1))return;let n=e[mf];if(!PT.some(([,i])=>i===n)||n%Ro===0&&Ro<n&&n<_l)return;let[r]=PT[_s(([,i])=>Math.log(i)).center(PT,Math.log(n*t))];return(e[F1]==="time"?zT:ym)(r)}function RC(e,t,n){let r=t==="time"?tf:Mo;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=HH(n);switch(e){case"millisecond":return hf(r(".%L"),r(":%M:%S"),i);case"second":return hf(r(":%S"),r("%-I:%M"),i);case"minute":return hf(r("%-I:%M"),r("%p"),i);case"hour":return hf(r("%-I %p"),r("%b %-d"),i);case"day":return hf(r("%-d"),r("%b"),i);case"month":return hf(r("%b"),r("%Y"),i);case"year":return r("%Y")}throw new Error("unable to format time ticks")}function HH(e){return e==="left"||e==="right"?(t,n)=>`
|
|
10
|
+
]`}concat(...t){let r=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new e(r,n.map(i=>new dr(r,i)))}slice(t,r){let n=this.schema;[t,r]=qm({length:this.numRows},t,r);let i=F_(this.data,this._offsets,t,r);return new e(n,i.map(o=>new dr(n,o)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){let r=this.data.map(n=>n.children[t]);if(r.length===0){let{type:n}=this.schema.fields[t],i=Vt({type:n,length:0,nullCount:0});r.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new le(r)}return null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),r)}setChildAt(t,r){let n=this.schema,i=[...this.batches];if(t>-1&&t<this.numCols){r||(r=new le([Vt({type:new Un,length:this.numRows})]));let o=n.fields.slice(),s=o[t].clone({type:r.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[o[t],a[t]]=[s,r],[n,i]=a1(n,a)}return new e(n,i)}select(t){let r=this.schema.fields.reduce((n,i,o)=>n.set(i.name,o),new Map);return this.selectAt(t.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(t){let r=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new e(r,n)}assign(t){let r=this.schema.fields,[n,i]=t.schema.fields.reduce((a,c,l)=>{let[u,f]=a,d=r.findIndex(h=>h.name===c.name);return~d?f[d]=l:u.push(l),a},[[],[]]),o=this.schema.assign(t.schema),s=[...r.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new e(...a1(o,s))}};TC=Symbol.toStringTag;fi[TC]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=Pd(Gm),e.get=Pd(Mr.getVisitFn(F.Struct)),e.set=L_(sn.getVisitFn(F.Struct)),e.indexOf=R_(Wu.getVisitFn(F.Struct)),"Table"))(fi.prototype);var MC,dr=class e{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Ie))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=Vt({nullCount:0,type:new ze(this.schema.fields),children:this.schema.fields.map(r=>Vt({type:r.type,nullCount:0}))})]=t,!(this.data instanceof _e))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=AC(this.schema,this.data.children);break}case 1:{let[r]=t,{fields:n,children:i,length:o}=Object.keys(r).reduce((c,l,u)=>(c.children[u]=r[l],c.length=Math.max(c.length,r[l].length),c.fields[u]=re.new({name:l,type:r[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),s=new Ie(n),a=Vt({type:new ze(n),length:o,children:i,nullCount:0});[this.schema,this.data]=AC(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=EC(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 Mr.visit(this.data,t)}set(t,r){return sn.visit(this.data,t,r)}indexOf(t,r){return Wu.visit(this.data,t,r)}[Symbol.iterator](){return $d.visit(new le([this.data]))}toArray(){return[...this]}concat(...t){return new fi(this.schema,[this,...t])}slice(t,r){let[n]=new le([this.data]).slice(t,r).data;return new e(this.schema,n)}getChild(t){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new le([this.data.children[t]]):null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),r)}setChildAt(t,r){let n=this.schema,i=this.data;if(t>-1&&t<this.numCols){r||(r=new le([Vt({type:new Un,length:this.numRows})]));let o=n.fields.slice(),s=i.children.slice(),a=o[t].clone({type:r.type});[o[t],s[t]]=[a,r.data[0]],n=new Ie(o,new Map(this.schema.metadata)),i=Vt({type:new ze(o),children:s})}return new e(n,i)}select(t){let r=this.schema.select(t),n=new ze(r.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(r,Vt({type:n,length:this.numRows,children:i}))}selectAt(t){let r=this.schema.selectAt(t),n=t.map(o=>this.data.children[o]).filter(Boolean),i=Vt({type:new ze(r.fields),length:this.numRows,children:n});return new e(r,i)}};MC=Symbol.toStringTag;dr[MC]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(dr.prototype);function AC(e,t,r=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;let i=[...e.fields],o=[...t],s=(r+63&-64)>>3;for(let[a,c]of e.fields.entries()){let l=t[a];(!l||l.length!==r)&&(i[a]=c.clone({nullable:!0}),o[a]=(n=l?._changeLengthAndBackfillNullBitmap(r))!==null&&n!==void 0?n:Vt({type:c.type,length:r,nullCount:r,nullBitmap:new Uint8Array(s)}))}return[e.assign(i),Vt({type:new ze(i),length:r,children:o})]}function EC(e,t,r=new Map){var n,i;if(((n=e?.length)!==null&&n!==void 0?n: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)||[]])EC(a.children,l?.children,r);if(lt.isDictionary(a)){let{id:l}=a;if(!r.has(l))c?.dictionary&&r.set(l,c.dictionary);else if(r.get(l)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return r}var ef=class extends dr{constructor(t){let r=t.fields.map(i=>Vt({type:i.type})),n=Vt({type:new ze(t.fields),nullCount:0,children:r});super(t,n)}};var Go=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMessage(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,r){return t.setPosition(t.position()+4),(r||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):Ee.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):oe.NONE}header(t){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__union(t,this.bb_pos+r):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new zr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,r){t.addFieldInt16(0,r,Ee.V1)}static addHeaderType(t,r){t.addFieldInt8(1,r,oe.NONE)}static addHeader(t,r){t.addFieldOffset(2,r,0)}static addBodyLength(t,r){t.addFieldInt64(3,r,BigInt("0"))}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,r){t.finish(r)}static finishSizePrefixedMessageBuffer(t,r){t.finish(r,void 0,!0)}static createMessage(t,r,n,i,o,s){return e.startMessage(t),e.addVersion(t,r),e.addHeaderType(t,n),e.addHeader(t,i),e.addBodyLength(t,o),e.addCustomMetadata(t,s),e.endMessage(t)}};var VA=class extends xt{visit(t,r){return t==null||r==null?void 0:super.visit(t,r)}visitNull(t,r){return Um.startNull(r),Um.endNull(r)}visitInt(t,r){return Ro.startInt(r),Ro.addBitWidth(r,t.bitWidth),Ro.addIsSigned(r,t.isSigned),Ro.endInt(r)}visitFloat(t,r){return wl.startFloatingPoint(r),wl.addPrecision(r,t.precision),wl.endFloatingPoint(r)}visitBinary(t,r){return Fm.startBinary(r),Fm.endBinary(r)}visitLargeBinary(t,r){return Rm.startLargeBinary(r),Rm.endLargeBinary(r)}visitBool(t,r){return Lm.startBool(r),Lm.endBool(r)}visitUtf8(t,r){return $m.startUtf8(r),$m.endUtf8(r)}visitLargeUtf8(t,r){return km.startLargeUtf8(r),km.endLargeUtf8(r)}visitDecimal(t,r){return Es.startDecimal(r),Es.addScale(r,t.scale),Es.addPrecision(r,t.precision),Es.addBitWidth(r,t.bitWidth),Es.endDecimal(r)}visitDate(t,r){return gl.startDate(r),gl.addUnit(r,t.unit),gl.endDate(r)}visitTime(t,r){return Oa.startTime(r),Oa.addUnit(r,t.unit),Oa.addBitWidth(r,t.bitWidth),Oa.endTime(r)}visitTimestamp(t,r){let n=t.timezone&&r.createString(t.timezone)||void 0;return Na.startTimestamp(r),Na.addUnit(r,t.unit),n!==void 0&&Na.addTimezone(r,n),Na.endTimestamp(r)}visitInterval(t,r){return vl.startInterval(r),vl.addUnit(r,t.unit),vl.endInterval(r)}visitDuration(t,r){return bl.startDuration(r),bl.addUnit(r,t.unit),bl.endDuration(r)}visitList(t,r){return Cm.startList(r),Cm.endList(r)}visitStruct(t,r){return Pm.startStruct_(r),Pm.endStruct_(r)}visitUnion(t,r){ko.startTypeIdsVector(r,t.typeIds.length);let n=ko.createTypeIdsVector(r,t.typeIds);return ko.startUnion(r),ko.addMode(r,t.mode),ko.addTypeIds(r,n),ko.endUnion(r)}visitDictionary(t,r){let n=this.visit(t.indices,r);return Ms.startDictionaryEncoding(r),Ms.addId(r,BigInt(t.id)),Ms.addIsOrdered(r,t.isOrdered),n!==void 0&&Ms.addIndexType(r,n),Ms.endDictionaryEncoding(r)}visitFixedSizeBinary(t,r){return xl.startFixedSizeBinary(r),xl.addByteWidth(r,t.byteWidth),xl.endFixedSizeBinary(r)}visitFixedSizeList(t,r){return _l.startFixedSizeList(r),_l.addListSize(r,t.listSize),_l.endFixedSizeList(r)}visitMap(t,r){return Sl.startMap(r),Sl.addKeysSorted(r,t.keysSorted),Sl.endMap(r)}},c1=new VA;function NC(e,t=new Map){return new Ie(JH(e,t),l1(e.metadata),t)}function jA(e){return new an(e.count,LC(e.columns),RC(e.columns))}function FC(e){return new hi(jA(e.data),e.id,e.isDelta)}function JH(e,t){return(e.fields||[]).filter(Boolean).map(r=>re.fromJSON(r,t))}function DC(e,t){return(e.children||[]).filter(Boolean).map(r=>re.fromJSON(r,t))}function LC(e){return(e||[]).reduce((t,r)=>[...t,new oo(r.count,tZ(r.VALIDITY)),...LC(r.children)],[])}function RC(e,t=[]){for(let r=-1,n=(e||[]).length;++r<n;){let i=e[r];i.VALIDITY&&t.push(new di(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new di(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new di(t.length,i.OFFSET.length)),i.DATA&&t.push(new di(t.length,i.DATA.length)),t=RC(i.children,t)}return t}function tZ(e){return(e||[]).reduce((t,r)=>t+ +(r===0),0)}function kC(e,t){let r,n,i,o,s,a;return!t||!(o=e.dictionary)?(s=OC(e,DC(e,t)),i=new re(e.name,s,e.nullable,l1(e.metadata))):t.has(r=o.id)?(n=(n=o.indexType)?BC(n):new Ds,a=new Di(t.get(r),n,r,o.isOrdered),i=new re(e.name,a,e.nullable,l1(e.metadata))):(n=(n=o.indexType)?BC(n):new Ds,t.set(r,s=OC(e,DC(e,t))),a=new Di(s,n,r,o.isOrdered),i=new re(e.name,a,e.nullable,l1(e.metadata))),i||null}function l1(e=[]){return new Map(e.map(({key:t,value:r})=>[t,r]))}function BC(e){return new br(e.isSigned,e.bitWidth)}function OC(e,t){let r=e.type.name;switch(r){case"NONE":return new Un;case"null":return new Un;case"binary":return new Fa;case"largebinary":return new La;case"utf8":return new Ra;case"largeutf8":return new ka;case"bool":return new Ca;case"list":return new zo((t||[])[0]);case"struct":return new ze(t||[]);case"struct_":return new ze(t||[])}switch(r){case"int":{let n=e.type;return new br(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=e.type;return new li(Le[n.precision])}case"decimal":{let n=e.type;return new Ua(n.scale,n.precision,n.bitWidth)}case"date":{let n=e.type;return new Pa(Tr[n.unit])}case"time":{let n=e.type;return new $o(ft[n.unit],n.bitWidth)}case"timestamp":{let n=e.type;return new $a(ft[n.unit],n.timezone)}case"interval":{let n=e.type;return new za(Wr[n.unit])}case"duration":{let n=e.type;return new Va(ft[n.unit])}case"union":{let n=e.type,[i,...o]=(n.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new Vo(Ue[s],n.typeIds||[],t||[])}case"fixedsizebinary":{let n=e.type;return new ja(n.byteWidth)}case"fixedsizelist":{let n=e.type;return new jo(n.listSize,(t||[])[0])}case"map":{let n=e.type;return new qo((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}var eZ=Lo,rZ=Ar,pi=class e{static fromJSON(t,r){let n=new e(0,Ee.V5,r);return n._createHeader=nZ(t,r),n}static decode(t){t=new rZ(Et(t));let r=Go.getRootAsMessage(t),n=r.bodyLength(),i=r.version(),o=r.headerType(),s=new e(n,i,o);return s._createHeader=iZ(r,o),s}static encode(t){let r=new eZ,n=-1;return t.isSchema()?n=Ie.encode(r,t.header()):t.isRecordBatch()?n=an.encode(r,t.header()):t.isDictionaryBatch()&&(n=hi.encode(r,t.header())),Go.startMessage(r),Go.addVersion(r,Ee.V5),Go.addHeader(r,n),Go.addHeaderType(r,t.headerType),Go.addBodyLength(r,BigInt(t.bodyLength)),Go.finishMessageBuffer(r,Go.endMessage(r)),r.asUint8Array()}static from(t,r=0){if(t instanceof Ie)return new e(0,Ee.V5,oe.Schema,t);if(t instanceof an)return new e(r,Ee.V5,oe.RecordBatch,t);if(t instanceof hi)return new e(r,Ee.V5,oe.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===oe.Schema}isRecordBatch(){return this.headerType===oe.RecordBatch}isDictionaryBatch(){return this.headerType===oe.DictionaryBatch}constructor(t,r,n,i){this._version=r,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=or(t)}},an=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,r,n){this._nodes=r,this._buffers=n,this._length=or(t)}},hi=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,r,n=!1){this._data=t,this._isDelta=n,this._id=or(r)}},di=class{constructor(t,r){this.offset=or(t),this.length=or(r)}},oo=class{constructor(t,r){this.length=or(t),this.nullCount=or(r)}};function nZ(e,t){return()=>{switch(t){case oe.Schema:return Ie.fromJSON(e);case oe.RecordBatch:return an.fromJSON(e);case oe.DictionaryBatch:return hi.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${oe[t]}, type: ${t} }`)}}function iZ(e,t){return()=>{switch(t){case oe.Schema:return Ie.decode(e.header(new ci),new Map,e.version());case oe.RecordBatch:return an.decode(e.header(new Ei),e.version());case oe.DictionaryBatch:return hi.decode(e.header(new Ba),e.version())}throw new Error(`Unrecognized Message type: { name: ${oe[t]}, type: ${t} }`)}}re.encode=mZ;re.decode=hZ;re.fromJSON=kC;Ie.encode=pZ;Ie.decode=oZ;Ie.fromJSON=NC;an.encode=yZ;an.decode=sZ;an.fromJSON=jA;hi.encode=gZ;hi.decode=aZ;hi.fromJSON=FC;oo.encode=bZ;oo.decode=lZ;di.encode=xZ;di.decode=cZ;function oZ(e,t=new Map,r=Ee.V5){let n=dZ(e,t);return new Ie(n,u1(e),t,r)}function sZ(e,t=Ee.V5){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new an(e.length(),uZ(e),fZ(e,t))}function aZ(e,t=Ee.V5){return new hi(an.decode(e.data(),t),e.id(),e.isDelta())}function cZ(e){return new di(e.offset(),e.length())}function lZ(e){return new oo(e.length(),e.nullCount())}function uZ(e){let t=[];for(let r,n=-1,i=-1,o=e.nodesLength();++n<o;)(r=e.nodes(n))&&(t[++i]=oo.decode(r));return t}function fZ(e,t){let r=[];for(let n,i=-1,o=-1,s=e.buffersLength();++i<s;)(n=e.buffers(i))&&(t<Ee.V4&&(n.bb_pos+=8*(i+1)),r[++o]=di.decode(n));return r}function dZ(e,t){let r=[];for(let n,i=-1,o=-1,s=e.fieldsLength();++i<s;)(n=e.fields(i))&&(r[++o]=re.decode(n,t));return r}function CC(e,t){let r=[];for(let n,i=-1,o=-1,s=e.childrenLength();++i<s;)(n=e.children(i))&&(r[++o]=re.decode(n,t));return r}function hZ(e,t){let r,n,i,o,s,a;return!t||!(a=e.dictionary())?(i=PC(e,CC(e,t)),n=new re(e.name(),i,e.nullable(),u1(e))):t.has(r=or(a.id()))?(o=(o=a.indexType())?UC(o):new Ds,s=new Di(t.get(r),o,r,a.isOrdered()),n=new re(e.name(),s,e.nullable(),u1(e))):(o=(o=a.indexType())?UC(o):new Ds,t.set(r,i=PC(e,CC(e,t))),s=new Di(i,o,r,a.isOrdered()),n=new re(e.name(),s,e.nullable(),u1(e))),n||null}function u1(e){let t=new Map;if(e)for(let r,n,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(r=e.customMetadata(i))&&(n=r.key())!=null&&t.set(n,r.value());return t}function UC(e){return new br(e.isSigned(),e.bitWidth())}function PC(e,t){let r=e.typeType();switch(r){case Re.NONE:return new Un;case Re.Null:return new Un;case Re.Binary:return new Fa;case Re.LargeBinary:return new La;case Re.Utf8:return new Ra;case Re.LargeUtf8:return new ka;case Re.Bool:return new Ca;case Re.List:return new zo((t||[])[0]);case Re.Struct_:return new ze(t||[])}switch(r){case Re.Int:{let n=e.type(new Ro);return new br(n.isSigned(),n.bitWidth())}case Re.FloatingPoint:{let n=e.type(new wl);return new li(n.precision())}case Re.Decimal:{let n=e.type(new Es);return new Ua(n.scale(),n.precision(),n.bitWidth())}case Re.Date:{let n=e.type(new gl);return new Pa(n.unit())}case Re.Time:{let n=e.type(new Oa);return new $o(n.unit(),n.bitWidth())}case Re.Timestamp:{let n=e.type(new Na);return new $a(n.unit(),n.timezone())}case Re.Interval:{let n=e.type(new vl);return new za(n.unit())}case Re.Duration:{let n=e.type(new bl);return new Va(n.unit())}case Re.Union:{let n=e.type(new ko);return new Vo(n.mode(),n.typeIdsArray()||[],t||[])}case Re.FixedSizeBinary:{let n=e.type(new xl);return new ja(n.byteWidth())}case Re.FixedSizeList:{let n=e.type(new _l);return new jo(n.listSize(),(t||[])[0])}case Re.Map:{let n=e.type(new Sl);return new qo((t||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${Re[r]}" (${r})`)}function pZ(e,t){let r=t.fields.map(o=>re.encode(e,o));ci.startFieldsVector(e,r.length);let n=ci.createFieldsVector(e,r),i=t.metadata&&t.metadata.size>0?ci.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),c=e.createString(`${s}`);return zr.startKeyValue(e),zr.addKey(e,a),zr.addValue(e,c),zr.endKeyValue(e)})):-1;return ci.startSchema(e),ci.addFields(e,n),ci.addEndianness(e,_Z?yl.Little:yl.Big),i!==-1&&ci.addCustomMetadata(e,i),ci.endSchema(e)}function mZ(e,t){let r=-1,n=-1,i=-1,o=t.type,s=t.typeId;lt.isDictionary(o)?(s=o.dictionary.typeId,i=c1.visit(o,e),n=c1.visit(o.dictionary,e)):n=c1.visit(o,e);let a=(o.children||[]).map(u=>re.encode(e,u)),c=Tn.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?Tn.createCustomMetadataVector(e,[...t.metadata].map(([u,f])=>{let d=e.createString(`${u}`),h=e.createString(`${f}`);return zr.startKeyValue(e),zr.addKey(e,d),zr.addValue(e,h),zr.endKeyValue(e)})):-1;return t.name&&(r=e.createString(t.name)),Tn.startField(e),Tn.addType(e,n),Tn.addTypeType(e,s),Tn.addChildren(e,c),Tn.addNullable(e,!!t.nullable),r!==-1&&Tn.addName(e,r),i!==-1&&Tn.addDictionary(e,i),l!==-1&&Tn.addCustomMetadata(e,l),Tn.endField(e)}function yZ(e,t){let r=t.nodes||[],n=t.buffers||[];Ei.startNodesVector(e,r.length);for(let s of r.slice().reverse())oo.encode(e,s);let i=e.endVector();Ei.startBuffersVector(e,n.length);for(let s of n.slice().reverse())di.encode(e,s);let o=e.endVector();return Ei.startRecordBatch(e),Ei.addLength(e,BigInt(t.length)),Ei.addNodes(e,i),Ei.addBuffers(e,o),Ei.endRecordBatch(e)}function gZ(e,t){let r=an.encode(e,t.data);return Ba.startDictionaryBatch(e),Ba.addId(e,BigInt(t.id)),Ba.addIsDelta(e,t.isDelta),Ba.addData(e,r),Ba.endDictionaryBatch(e)}function bZ(e,t){return Od.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function xZ(e,t){return Bd.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var _Z=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})();var YA=e=>`Expected ${oe[e]} Message in stream, but was null or length 0.`,WA=e=>`Header pointer of flatbuffer-encoded ${oe[e]} Message is null or length 0.`,$C=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,zC=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,Xd=class{constructor(t){this.source=t instanceof Ns?t:new Ns(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?Ve:t.value===-1&&(t=this.readMetadataLength()).done?Ve:(t=this.readMetadata(t.value)).done?Ve:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(YA(t));return r.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let r=Et(this.source.read(t));if(r.byteLength<t)throw new Error(zC(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(t=!1){let r=oe.Schema,n=this.readMessage(r),i=n?.header();if(t&&!i)throw new Error(WA(r));return i}readMetadataLength(){let t=this.source.read(f1),r=t&&new Ar(t),n=r?.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(t){let r=this.source.read(t);if(!r)return Ve;if(r.byteLength<t)throw new Error($C(t,r.byteLength));return{done:!1,value:pi.decode(r)}}},vy=class{constructor(t,r){this.source=t instanceof no?t:qx(t)?new Ml(t,r):new no(t)}[Symbol.asyncIterator](){return this}next(){return P(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?Ve:t.value===-1&&(t=yield this.readMetadataLength()).done?Ve:(t=yield this.readMetadata(t.value)).done?Ve:t})}throw(t){return P(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return P(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return P(this,void 0,void 0,function*(){let r;if((r=yield this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(YA(t));return r.value})}readMessageBody(t){return P(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let r=Et(yield this.source.read(t));if(r.byteLength<t)throw new Error(zC(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()})}readSchema(t=!1){return P(this,void 0,void 0,function*(){let r=oe.Schema,n=yield this.readMessage(r),i=n?.header();if(t&&!i)throw new Error(WA(r));return i})}readMetadataLength(){return P(this,void 0,void 0,function*(){let t=yield this.source.read(f1),r=t&&new Ar(t),n=r?.readInt32(0)||0;return{done:n===0,value:n}})}readMetadata(t){return P(this,void 0,void 0,function*(){let r=yield this.source.read(t);if(!r)return Ve;if(r.byteLength<t)throw new Error($C(t,r.byteLength));return{done:!1,value:pi.decode(r)}})}},Sy=class extends Xd{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof Xm?t:new Xm(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:pi.fromJSON(t.schema,oe.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let r=t.dictionaries[this._dictionaryIndex++];return this._body=r.data.columns,{done:!1,value:pi.fromJSON(r,oe.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let r=t.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:pi.fromJSON(r,oe.RecordBatch)}}return this._body=[],Ve}readMessageBody(t){return r(this._body);function r(n){return(n||[]).reduce((i,o)=>[...i,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE_ID&&[o.TYPE_ID]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...r(o.children)],[])}}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(YA(t));return r.value}readSchema(){let t=oe.Schema,r=this.readMessage(t),n=r?.header();if(!r||!n)throw new Error(WA(t));return n}},f1=4,qA="ARROW1",Hd=new Uint8Array(qA.length);for(let e=0;e<qA.length;e+=1)Hd[e]=qA.codePointAt(e);function d1(e,t=0){for(let r=-1,n=Hd.length;++r<n;)if(Hd[r]!==e[t+r])return!1;return!0}var Zd=Hd.length,GA=Zd+f1,VC=Zd*2+f1;var Ni=class e extends Xu{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 r=this._impl.open(t);return Ai(r)?r.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 on.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return on.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,r){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof e?t:Vx(t)?vZ(t):qx(t)?TZ(t):Ai(t)?P(this,void 0,void 0,function*(){return yield e.from(yield t)}):Yx(t)||Mm(t)||Gx(t)||to(t)?IZ(new no(t)):SZ(new Ns(t))}static readAll(t){return t instanceof e?t.isSync()?jC(t):qC(t):Vx(t)||ArrayBuffer.isView(t)||Oo(t)||jx(t)?jC(t):qC(t)}},tc=class extends Ni{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return $e(this,arguments,function*(){yield H(yield*Ji(fr(this[Symbol.iterator]())))})}},rf=class extends Ni{constructor(t){super(t),this._impl=t}readAll(){var t,r,n,i;return P(this,void 0,void 0,function*(){let o=new Array;try{for(var s=!0,a=fr(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){r={error:l}}finally{try{!s&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(r)throw r.error}}return o})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},nf=class extends tc{constructor(t){super(t),this._impl=t}},h1=class extends rf{constructor(t){super(t),this._impl=t}},p1=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,r){let n=this._loadVectors(t,r,this.schema.fields),i=Vt({type:new ze(this.schema.fields),length:t.length,children:n});return new dr(this.schema,i)}_loadDictionaryBatch(t,r){let{id:n,isDelta:i}=t,{dictionaries:o,schema:s}=this,a=o.get(n);if(i||!a){let c=s.dictionaries.get(n),l=this._loadVectors(t.data,r,[c]);return(a&&i?a.concat(new le(l)):new le(l)).memoize()}return a.memoize()}_loadVectors(t,r,n){return new Qm(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}},Kd=class extends p1{constructor(t,r){super(r),this._reader=Vx(t)?new Sy(this._handle=t):new Xd(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=YC(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):Ve}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Ve}next(){if(this.closed)return Ve;let t,{_reader:r}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ef(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},Qd=class extends p1{constructor(t,r){super(r),this._reader=new vy(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return P(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 P(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=YC(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return P(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Ve})}return(t){return P(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Ve})}next(){return P(this,void 0,void 0,function*(){if(this.closed)return Ve;let t,{_reader:r}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=yield r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=yield r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ef(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return P(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},m1=class extends Kd{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,r){super(t instanceof Hm?t:new Hm(t),r)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var r;if(this.closed)return null;this._footer||this.open();let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(oe.RecordBatch);if(i?.isRecordBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s)}}return null}_readDictionaryBatch(t){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(oe.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,r=t.size-GA,n=t.readInt32(r),i=t.readAt(r-n,n);return Wa.decode(i)}_readNextMessageAndValidate(t){var r;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}},XA=class extends Qd{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,...r){let n=typeof r[0]!="number"?r.shift():void 0,i=r[0]instanceof Map?r.shift():void 0;super(t instanceof Ml?t:new Ml(t,n),i)}isFile(){return!0}isAsync(){return!0}open(t){let r=Object.create(null,{open:{get:()=>super.open}});return P(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield r.open.call(this,t)})}readRecordBatch(t){var r;return P(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(oe.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 r;return P(this,void 0,void 0,function*(){let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(oe.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 P(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let r=t.size-GA,n=yield t.readInt32(r),i=yield t.readAt(r-n,n);return Wa.decode(i)})}_readNextMessageAndValidate(t){return P(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=this._footer.getRecordBatch(this._recordBatchIndex);if(r&&(yield this._handle.seek(r.offset)))return yield this._reader.readMessage(t)}return null})}},HA=class extends Kd{constructor(t,r){super(t,r)}_loadVectors(t,r,n){return new P_(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}};function YC(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*jC(e){let t=Ni.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function qC(e){return $e(this,arguments,function*(){let r=yield H(Ni.from(e));try{if(!(yield H(r.open({autoDestroy:!1}))).closed)do yield yield H(r);while(!(yield H(r.reset().open())).closed)}finally{yield H(r.cancel())}})}function vZ(e){return new tc(new HA(e))}function SZ(e){let t=e.peek(Zd+7&-8);return t&&t.byteLength>=4?d1(t)?new nf(new m1(e.read())):new tc(new Kd(e)):new tc(new Kd(function*(){}()))}function IZ(e){return P(this,void 0,void 0,function*(){let t=yield e.peek(Zd+7&-8);return t&&t.byteLength>=4?d1(t)?new nf(new m1(yield e.read())):new rf(new Qd(e)):new rf(new Qd(function(){return $e(this,arguments,function*(){})}()))})}function TZ(e){return P(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),r=new Ml(e,t);return t>=VC&&d1(yield r.readAt(0,Zd+7&-8))?new h1(new XA(r)):new rf(new Qd(r))})}var Je=class e extends xt{static assemble(...t){let r=i=>i.flatMap(o=>Array.isArray(o)?r(o):o instanceof dr?o.data.children:o.data),n=new e;return n.visitMany(r(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof le)return this.visitMany(t.data),this;let{type:r}=t;if(!lt.isDictionary(r)){let{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(lt.isUnion(r))this.nodes.push(new oo(n,0));else{let{nullCount:i}=t;lt.isNull(r)||Xo.call(this,i<=0?new Uint8Array(0):qu(t.offset,n,t.nullBitmap)),this.nodes.push(new oo(n,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 Xo(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new di(this._byteLength,t)),this._byteLength+=t,this}function AZ(e){var t;let{type:r,length:n,typeIds:i,valueOffsets:o}=e;if(Xo.call(this,i),r.mode===Ue.Sparse)return ZA.call(this,e);if(r.mode===Ue.Dense){if(e.offset<=0)return Xo.call(this,o),ZA.call(this,e);{let s=new Int32Array(n),a=Object.create(null),c=Object.create(null);for(let l,u,f=-1;++f<n;)(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);Xo.call(this,s),this.visitMany(e.children.map((l,u)=>{let f=r.typeIds[u],d=a[f],h=c[f];return l.slice(d,Math.min(n,h))}))}}return this}function MZ(e){let t;return e.nullCount>=e.length?Xo.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?Xo.call(this,qu(e.offset,e.length,t)):Xo.call(this,Yu(e.values))}function ec(e){return Xo.call(this,e.values.subarray(0,e.length*e.stride))}function y1(e){let{length:t,values:r,valueOffsets:n}=e,i=or(n[0]),o=or(n[t]),s=Math.min(o-i,r.byteLength-i);return Xo.call(this,Hx(-i,t+1,n)),Xo.call(this,r.subarray(i,i+s)),this}function KA(e){let{length:t,valueOffsets:r}=e;if(r){let{[0]:n,[t]:i}=r;return Xo.call(this,Hx(-n,t+1,r)),this.visit(e.children[0].slice(n,i-n))}return this.visit(e.children[0])}function ZA(e){return this.visitMany(e.type.children.map((t,r)=>e.children[r]).filter(Boolean))[0]}Je.prototype.visitBool=MZ;Je.prototype.visitInt=ec;Je.prototype.visitFloat=ec;Je.prototype.visitUtf8=y1;Je.prototype.visitLargeUtf8=y1;Je.prototype.visitBinary=y1;Je.prototype.visitLargeBinary=y1;Je.prototype.visitFixedSizeBinary=ec;Je.prototype.visitDate=ec;Je.prototype.visitTimestamp=ec;Je.prototype.visitTime=ec;Je.prototype.visitDecimal=ec;Je.prototype.visitList=KA;Je.prototype.visitStruct=ZA;Je.prototype.visitUnion=AZ;Je.prototype.visitInterval=ec;Je.prototype.visitDuration=ec;Je.prototype.visitFixedSizeList=KA;Je.prototype.visitMap=KA;var of=class extends Xu{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new Os,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,Cn(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 Ai(t)?t.then(r=>this.writeAll(r)):to(t)?JA(this,t):QA(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,r=null){return t===this._sink||t instanceof Os?this._sink=t:(this._sink=new Os,t&&ok(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&sk(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,(!r||!tf(r,this._schema))&&(r==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(t){let r=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof fi&&!(r=t.schema))return this.finish()&&void 0;if(t instanceof dr&&!(r=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!tf(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}t instanceof dr?t instanceof ef||this._writeRecordBatch(t):t instanceof fi?this.writeAll(t.batches):Oo(t)&&this.writeAll(t)}_writeMessage(t,r=8){let n=r-1,i=pi.encode(t),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+n&~n,c=a-o-s;return t.headerType===oe.RecordBatch?this._recordBatchBlocks.push(new Ga(a,t.bodyLength,this._position)):t.headerType===oe.DictionaryBatch&&this._dictionaryBlocks.push(new Ga(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 r=Et(t);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(t){return this._writeMessage(pi.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Hd)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o}=Je.assemble(t),s=new an(t.numRows,n,i),a=pi.from(s,r);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(o)}_writeDictionaryBatch(t,r,n=!1){this._dictionaryDeltaOffsets.set(r,t.length+(this._dictionaryDeltaOffsets.get(r)||0));let{byteLength:i,nodes:o,bufferRegions:s,buffers:a}=Je.assemble(new le([t])),c=new an(t.length,o,s),l=new hi(c,r,n),u=pi.from(l,i);return this._writeMessage(u)._writeBodyBuffers(a)}_writeBodyBuffers(t){let r,n,i;for(let o=-1,s=t.length;++o<s;)(r=t[o])&&(n=r.byteLength)>0&&(this._write(r),(i=(n+7&-8)-n)>0&&this._writePadding(i));return this}_writeDictionaries(t){for(let[r,n]of t.dictionaries){let i=this._dictionaryDeltaOffsets.get(r)||0;if(i===0||(n=n?.slice(i)).length>0)for(let o of n.data)this._writeDictionaryBatch(o,r,i>0),i+=o.length}return this}},Iy=class e extends of{static writeAll(t,r){let n=new e(r);return Ai(t)?t.then(i=>n.writeAll(i)):to(t)?JA(n,t):QA(n,t)}},Ty=class e extends of{static writeAll(t){let r=new e;return Ai(t)?t.then(n=>r.writeAll(n)):to(t)?JA(r,t):QA(r,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let r=Wa.encode(new Wa(t,Ee.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}};function QA(e,t){let r=t;t instanceof fi&&(r=t.batches,e.reset(void 0,t.schema));for(let n of r)e.write(n);return e.finish()}function JA(e,t){var r,n,i,o,s,a,c;return P(this,void 0,void 0,function*(){try{for(r=!0,n=fr(t);i=yield n.next(),o=i.done,!o;r=!0){c=i.value,r=!1;let l=c;e.write(l)}}catch(l){s={error:l}}finally{try{!r&&!o&&(a=n.return)&&(yield a.call(n))}finally{if(s)throw s.error}}return e.finish()})}function WC(e,t){if(to(e))return DZ(e,t);if(Oo(e))return EZ(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function EZ(e,t){let r=null,n=t?.type==="bytes"||!1,i=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){o(s,r||(r=e[Symbol.iterator]()))},pull(s){r?o(s,r):s.close()},cancel(){(r?.return&&r.return()||!0)&&(r=null)}}),Object.assign({highWaterMark:n?i:void 0},t));function o(s,a){let c,l=null,u=s.desiredSize||null;for(;!(l=a.next(n?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=Et(l.value))&&(u!=null&&n&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()}}function DZ(e,t){let r=null,n=t?.type==="bytes"||!1,i=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){return P(this,void 0,void 0,function*(){yield o(s,r||(r=e[Symbol.asyncIterator]()))})},pull(s){return P(this,void 0,void 0,function*(){r?yield o(s,r):s.close()})},cancel(){return P(this,void 0,void 0,function*(){(r?.return&&(yield r.return())||!0)&&(r=null)})}}),Object.assign({highWaterMark:n?i:void 0},t));function o(s,a){return P(this,void 0,void 0,function*(){let c,l=null,u=s.desiredSize||null;for(;!(l=yield a.next(n?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=Et(l.value))&&(u!=null&&n&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()})}}function HC(e){return new tM(e)}var tM=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=t,o=zx(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Zu(o),this._getSize=i!=="bytes"?GC:XC;let{["highWaterMark"]:s=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r),{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);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"?GC:XC}),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 r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-r}_maybeFlush(t,r){r!=null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(t,r){this._bufferedSize=0,this._controller=null,r==null?t.close():t.enqueue(r)}},GC=e=>{var t;return(t=e?.length)!==null&&t!==void 0?t:0},XC=e=>{var t;return(t=e?.byteLength)!==null&&t!==void 0?t:0};function g1(e,t){let r=new Os,n=null,i=new ReadableStream({cancel(){return P(this,void 0,void 0,function*(){yield r.close()})},start(a){return P(this,void 0,void 0,function*(){yield s(a,n||(n=yield o()))})},pull(a){return P(this,void 0,void 0,function*(){n?yield s(a,n):a.close()})}});return{writable:new WritableStream(r,Object.assign({highWaterMark:Math.pow(2,14)},e)),readable:i};function o(){return P(this,void 0,void 0,function*(){return yield(yield Ni.from(r)).open(t)})}function s(a,c){return P(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 b1(e,t){let r=new this(e),n=new no(r),i=new ReadableStream({cancel(){return P(this,void 0,void 0,function*(){yield n.cancel()})},pull(s){return P(this,void 0,void 0,function*(){yield o(s)})},start(s){return P(this,void 0,void 0,function*(){yield o(s)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(r,e),readable:i};function o(s){return P(this,void 0,void 0,function*(){let a=null,c=s.desiredSize;for(;a=yield n.read(c||null);)if(s.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;s.close()})}}function sf(e){let t=Ni.from(e);return Ai(t)?t.then(r=>sf(r)):t.isAsync()?t.readAll().then(r=>new fi(r)):new fi(t.readAll())}var OZ=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},fA),CA),EA),dA),sA),MA),lA),{compareSchemas:tf,compareFields:SC,compareTypes:IC});on.toDOMStream=WC;Ge.throughDOM=HC;Ni.throughDOM=g1;nf.throughDOM=g1;tc.throughDOM=g1;of.throughDOM=b1;Ty.throughDOM=b1;Iy.throughDOM=b1;function x1(e="ws://localhost:3000/"){let t=[],r=!1,n=null,i,o={open(){r=!0,c()},close(){for(r=!1,n=null,i=null;t.length;)t.shift().reject("Socket closed")},error(l){if(n){let{reject:u}=n;n=null,c(),u(l)}else console.error("WebSocket error: ",l)},message({data:l}){if(n){let{query:u,resolve:f,reject:d}=n;if(n=null,c(),typeof l=="string"){let h=JSON.parse(l);h.error?d(h.error):f(h)}else if(u.type==="exec")f();else if(u.type==="arrow")f(sf(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}),r&&!n&&c()}function c(){t.length&&(n=t.shift(),i.send(JSON.stringify(n.query)))}return{get connected(){return r},query(l){return new Promise((u,f)=>a(l,u,f))}}}var mi=class{constructor(t,r){t&&(this.table=String(t)),r&&(this.column=r)}get columns(){return this.column?[this.column]:[]}toString(){let{table:t,column:r}=this;if(r){let n=r.startsWith("*")?r:`"${r}"`;return`${t?`${ZC(t)}.`:""}${n}`}else return t?ZC(t):"NULL"}};function ZC(e){return e.split(".").map(r=>`"${r}"`).join(".")}function KC(e,t){return e instanceof mi&&e.column===t}function se(e){return typeof e=="string"?El(e):e}function af(e){return typeof e=="string"?QC(e):e}function QC(e){return new mi(e)}function El(e,t){return arguments.length===1&&(t=e,e=null),new mi(e,t)}function Ls(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 r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate();return t===Date.UTC(r,n,i)?`MAKE_DATE(${r}, ${n+1}, ${i})`:`EPOCH_MS(${t})`}else return e instanceof RegExp?`'${e.source}'`:String(e)}}var rc=e=>typeof e?.addEventListener=="function";function _1(e){return e instanceof Dl}var Dl=class{constructor(t,r,n){this._expr=Array.isArray(t)?t:[t],this._deps=r||[],this.annotate(n);let i=this._expr.filter(o=>rc(o));i.length>0?(this._params=Array.from(new Set(i)),this._params.forEach(o=>{o.addEventListener("value",()=>NZ(this,this.map?.get("value")))})):this.addEventListener=void 0}get value(){return this}get columns(){let{_params:t,_deps:r}=this;if(t){let n=new Set(t.flatMap(i=>{let o=i.value?.columns;return Array.isArray(o)?o:[]}));if(n.size){let i=new Set(r);return n.forEach(o=>i.add(o)),Array.from(i)}}return r}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=>rc(t)&&!_1(t)?Ls(t.value):t).join("")}addEventListener(t,r){let n=this.map||(this.map=new Map);(n.get(t)||(n.set(t,new Set),n.get(t))).add(r)}};function NZ(e,t){if(t?.size)return Promise.allSettled(Array.from(t,r=>r(e)))}function eM(e,t){let r=[e[0]],n=new Set,i=t.length;for(let o=0,s=0;o<i;){let a=t[o];rc(a)?r[++s]=a:(Array.isArray(a?.columns)&&a.columns.forEach(l=>n.add(l)),r[s]+=typeof a=="string"?a:Ls(a));let c=e[++o];rc(r[s])?r[++s]=c:r[s]+=c}return{spans:r,cols:Array.from(n)}}function W(e,...t){let{spans:r,cols:n}=eM(e,t);return new Dl(r,n)}function rM(e){let t=se(e);return W`${t} DESC NULLS LAST`.annotate({label:t?.label,desc:!0})}var Fi=e=>({value:e,toString:()=>Ls(e)});function Ay(e){e(this.op,this),this.children?.forEach(t=>t.visit(e))}function JC(e,t){let r=t.filter(i=>i!=null).map(se),n=r.map((i,o)=>o?` ${e} `:"");return r.length===1?n.push(""):r.length>1&&(n[0]="(",n.push(")")),W(n,...r).annotate({op:e,children:r,visit:Ay})}var $n=(...e)=>JC("AND",e.flat()),cf=(...e)=>JC("OR",e.flat()),FZ=e=>t=>W`(${e} ${se(t)})`.annotate({op:e,a:t,visit:Ay}),nM=FZ("NOT"),tU=e=>t=>W`(${se(t)} ${e})`.annotate({op:e,a:t,visit:Ay}),lf=tU("IS NULL"),nc=tU("IS NOT NULL"),Bl=e=>(t,r)=>W`(${se(t)} ${e} ${se(r)})`.annotate({op:e,a:t,b:r,visit:Ay}),ic=Bl("="),uf=Bl("<>"),oc=Bl("<"),My=Bl(">"),sc=Bl("<="),iM=Bl(">="),oM=Bl("IS DISTINCT FROM"),Ey=Bl("IS NOT DISTINCT FROM");function eU(e,t,r,n){t=se(t);let i=e.startsWith("NOT ")?"NOT ":"";return(r?n?W`${i}(${r[0]} <= ${t} AND ${t} < ${r[1]})`:W`(${t} ${e} ${r[0]} AND ${r[1]})`:W``).annotate({op:e,visit:Ay,field:t,range:r})}var tr=(e,t,r)=>eU("BETWEEN",e,t,r),sM=(e,t,r)=>eU("NOT BETWEEN",e,t,r);function ff(e,t){return Array.from({length:e},()=>t)}function cn(e,t){return(...r)=>{let n=r.map(se),i=t?`::${t}`:"";return(n.length?W([`${e}(`,...ff(n.length-1,", "),`)${i}`],...n):W`${e}()${i}`).annotate({func:e,args:n})}}var aM=cn("REGEXP_MATCHES"),cM=cn("CONTAINS"),lM=cn("PREFIX"),uM=cn("SUFFIX"),LZ=cn("LOWER"),RZ=cn("UPPER"),kZ=cn("LENGTH"),CZ=cn("ISNAN"),UZ=cn("ISFINITE"),PZ=cn("ISINF");var Dy=class e extends Dl{constructor(t,r,n,i,o="",s="",a=""){let c;if(i&&!(o||s||a))c=i?W`${r} OVER "${i}"`:W`${r} OVER ()`;else{let d=o&&s?" ":"",h=(o||s)&&a?" ":"";c=W`${r} OVER (${i?`"${i}" `:""}${o}${d}${s}${h}${a})`}n&&(c=W`(${c})::${n}`);let{_expr:u,_deps:f}=c;super(u,f,{window:t,func:r,type:n,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:r,func:n,type:i,group:o,order:s,frame:a}=this;return new e(r,n,i,t,o,s,a)}partitionby(...t){let r=t.flat().filter(u=>u).map(se),n=W(["PARTITION BY ",ff(r.length-1,", "),""],...r),{window:i,func:o,type:s,name:a,order:c,frame:l}=this;return new e(i,o,s,a,n,c,l)}orderby(...t){let r=t.flat().filter(u=>u).map(se),n=W(["ORDER BY ",ff(r.length-1,", "),""],...r),{window:i,func:o,type:s,name:a,group:c,frame:l}=this;return new e(i,o,s,a,c,n,l)}rows(t){let r=rU("ROWS",t),{window:n,func:i,type:o,name:s,group:a,order:c}=this;return new e(n,i,o,s,a,c,r)}range(t){let r=rU("RANGE",t),{window:n,func:i,type:o,name:s,group:a,order:c}=this;return new e(n,i,o,s,a,c,r)}};function rU(e,t){if(rc(t)){let r=W`${t}`;return r.toString=()=>`${e} ${nU(t.value)}`,r}return`${e} ${nU(t)}`}function nU(e){let[t,r]=e,n=t===0?"CURRENT ROW":Number.isFinite(t)?`${Math.abs(t)} PRECEDING`:"UNBOUNDED PRECEDING",i=r===0?"CURRENT ROW":Number.isFinite(r)?`${Math.abs(r)} FOLLOWING`:"UNBOUNDED FOLLOWING";return`BETWEEN ${n} AND ${i}`}function Ho(e,t){return(...r)=>{let n=cn(e)(...r);return new Dy(e,n,t)}}var fM=Ho("ROW_NUMBER","INTEGER"),dM=Ho("RANK","INTEGER"),hM=Ho("DENSE_RANK","INTEGER"),pM=Ho("PERCENT_RANK"),mM=Ho("CUME_DIST"),yM=Ho("NTILE"),gM=Ho("LAG"),bM=Ho("LEAD"),xM=Ho("FIRST_VALUE"),_M=Ho("LAST_VALUE"),wM=Ho("NTH_VALUE");function SM(e,...t){return W(e,...t).annotate({aggregate:!0})}var vM=class e extends Dl{constructor(t,r,n,i,o){r=(r||[]).map(se);let{strings:s,exprs:a}=$Z(t,r,n,i,o),{spans:c,cols:l}=eM(s,a);super(c,l,{aggregate:t,args:r,type:n,isDistinct:i,filter:o})}get basis(){return this.column}get label(){let{aggregate:t,args:r,isDistinct:n}=this,i=n?"DISTINCT"+(r.length?" ":""):"",o=r.length?`(${i}${r.map(zZ).join(", ")})`:"";return`${t.toLowerCase()}${o}`}distinct(){let{aggregate:t,args:r,type:n,filter:i}=this;return new e(t,r,n,!0,i)}where(t){let{aggregate:r,args:n,type:i,isDistinct:o}=this;return new e(r,n,i,o,t)}window(){let{aggregate:t,args:r,type:n,isDistinct:i}=this,o=new e(t,r,null,i);return new Dy(t,o,n)}partitionby(...t){return this.window().partitionby(...t)}orderby(...t){return this.window().orderby(...t)}rows(t,r){return this.window().rows(t,r)}range(t,r){return this.window().range(t,r)}};function $Z(e,t,r,n,i){let o=`)${r?`::${r}`:""}`,s=[`${e}(${n?"DISTINCT ":""}`],a=[];return t.length?(s=s.concat([...ff(t.length-1,", "),`${o}${i?" FILTER (WHERE ":""}`,...i?[")"]:[]]),a=[...t,...i?[i]:[]]):s[0]+="*"+o,{exprs:a,strings:s}}function zZ(e){let t=Ls(e);return t&&t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function me(e,t){return(...r)=>new vM(e,r,t)}var Li=me("COUNT","INTEGER"),IM=me("AVG"),VZ=me("AVG"),TM=me("MAD"),so=me("MAX"),ao=me("MIN"),Ri=me("SUM","DOUBLE"),AM=me("PRODUCT"),MM=me("MEDIAN"),EM=me("QUANTILE"),DM=me("MODE"),BM=me("VARIANCE"),OM=me("STDDEV"),NM=me("SKEWNESS"),FM=me("KURTOSIS"),LM=me("ENTROPY"),RM=me("VAR_POP"),kM=me("STDDEV_POP"),CM=me("CORR"),UM=me("COVAR_POP"),PM=me("REGR_INTERCEPT"),$M=me("REGR_SLOPE"),zM=me("REGR_COUNT"),jZ=me("REGR_R2"),VM=me("REGR_SYY"),jM=me("REGR_SXX"),qZ=me("REGR_SXY"),qM=me("REGR_AVGX"),YZ=me("REGR_AVGY"),YM=me("FIRST"),WM=me("LAST"),Jd=me("ARG_MIN"),th=me("ARG_MAX"),GM=me("STRING_AGG"),XM=me("ARRAY_AGG");function By(e,t){let r=se(e),n=W`CAST(${r} AS ${t})`;return Object.defineProperty(n,"label",{enumerable:!0,get(){return e.label}}),Object.defineProperty(n,"aggregate",{enumerable:!0,get(){return e.aggregate||!1}}),n}var eh=e=>By(e,"DOUBLE"),HM=e=>By(e,"INTEGER");var ZM=e=>W`epoch_ms(${se(e)})`,KM=e=>{let t=se(e);return W`MAKE_DATE(2012, MONTH(${t}), 1)`.annotate({label:"month"})},QM=e=>{let t=se(e);return W`MAKE_DATE(2012, MONTH(${t}), DAY(${t}))`.annotate({label:"date"})},JM=e=>{let t=se(e);return W`MAKE_DATE(2012, 1, DAY(${t}))`.annotate({label:"date"})};var Oy=cn("ST_AsGeoJSON"),iU=cn("ST_X"),oU=cn("ST_Y"),Ny=cn("ST_CENTROID"),tE=e=>iU(Ny(e)),eE=e=>oU(Ny(e));var Mt=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 df("UNION",t.flat())}static unionAll(...t){return new df("UNION ALL",t.flat())}static intersect(...t){return new df("INTERSECT",t.flat())}static except(...t){return new df("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:r}=this;if(t.length===0)return r.with;{let n=[],i=(o,s)=>{let a=s.clone();a.cteFor=this,n.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])}),r.with=r.with.concat(n),this}}select(...t){let{query:r}=this;if(t.length===0)return r.select;{let n=[];for(let i of t.flat())if(i!=null)if(typeof i=="string")n.push({as:i,expr:se(i)});else if(i instanceof mi)n.push({as:i.column,expr:i});else if(Array.isArray(i))n.push({as:i[0],expr:i[1]});else for(let o in i)n.push({as:w1(o),expr:se(i[o])});return r.select=r.select.concat(n),this}}$select(...t){return this.query.select=[],this.select(...t)}distinct(t=!0){return this.query.distinct=!!t,this}from(...t){let{query:r}=this;if(t.length===0)return r.from;{let n=[];return t.flat().forEach(i=>{if(i!=null)if(typeof i=="string")n.push({as:i,from:af(i)});else if(i instanceof mi)n.push({as:i.table,from:i});else if(v1(i)||_1(i))n.push({from:i});else if(Array.isArray(i))n.push({as:w1(i[0]),from:af(i[1])});else for(let o in i)n.push({as:w1(o),from:af(i[o])})}),r.from=r.from.concat(n),this}}$from(...t){return this.query.from=[],this.from(...t)}sample(t,r){let{query:n}=this;if(arguments.length===0)return n.sample;{let i=t;return typeof t=="number"&&(i=t>0&&t<1?{perc:100*t,method:r}:{rows:Math.round(t),method:r}),n.sample=i,this}}where(...t){let{query:r}=this;return t.length===0?r.where:(r.where=r.where.concat(t.flat().filter(n=>n)),this)}$where(...t){return this.query.where=[],this.where(...t)}groupby(...t){let{query:r}=this;return t.length===0?r.groupby:(r.groupby=r.groupby.concat(t.flat().filter(n=>n).map(se)),this)}$groupby(...t){return this.query.groupby=[],this.groupby(...t)}having(...t){let{query:r}=this;return t.length===0?r.having:(r.having=r.having.concat(t.flat().filter(n=>n)),this)}window(...t){let{query:r}=this;if(t.length===0)return r.window;{let n=[];return t.flat().forEach(i=>{if(i!=null)for(let o in i)n.push({as:w1(o),expr:i[o]})}),r.window=r.window.concat(n),this}}qualify(...t){let{query:r}=this;return t.length===0?r.qualify:(r.qualify=r.qualify.concat(t.flat().filter(n=>n)),this)}orderby(...t){let{query:r}=this;return t.length===0?r.orderby:(r.orderby=r.orderby.concat(t.flat().filter(n=>n).map(se)),this)}limit(t){let{query:r}=this;return arguments.length===0?r.limit:(r.limit=Number.isFinite(t)?t:void 0,this)}offset(t){let{query:r}=this;return arguments.length===0?r.offset:(r.offset=Number.isFinite(t)?t:void 0,this)}get subqueries(){let{query:t,cteFor:r}=this,i=(r?.query||t).with?.reduce((s,{as:a,query:c})=>(s[a]=c,s),{}),o=[];return t.from.forEach(({from:s})=>{if(v1(s))o.push(s);else if(i[s.table]){let a=i[s.table];o.push(a)}}),o}toString(){let{select:t,distinct:r,from:n,sample:i,where:o,groupby:s,having:a,window:c,qualify:l,orderby:u,limit:f,offset:d,with:h}=this.query,p=[];if(h.length){let g=h.map(({as:m,query:b})=>`"${m}" AS (${b})`);p.push(`WITH ${g.join(", ")}`)}let y=t.map(({as:g,expr:m})=>KC(m,g)&&!m.table?`${m}`:`${m} AS "${g}"`);if(p.push(`SELECT${r?" DISTINCT":""} ${y.join(", ")}`),n.length){let g=n.map(({as:m,from:b})=>{let x=v1(b)?`(${b})`:`${b}`;return!m||m===b.table?x:`${x} AS "${m}"`});p.push(`FROM ${g.join(", ")}`)}if(o.length){let g=o.map(String).filter(m=>m).join(" AND ");g&&p.push(`WHERE ${g}`)}if(i){let{rows:g,perc:m,method:b,seed:x}=i,_=g?`${g} ROWS`:`${m} PERCENT`,v=b?` (${b}${x!=null?`, ${x}`:""})`:"";p.push(`USING SAMPLE ${_}${v}`)}if(s.length&&p.push(`GROUP BY ${s.join(", ")}`),a.length){let g=a.map(String).filter(m=>m).join(" AND ");g&&p.push(`HAVING ${g}`)}if(c.length){let g=c.map(({as:m,expr:b})=>`"${m}" AS (${b})`);p.push(`WINDOW ${g.join(", ")}`)}if(l.length){let g=l.map(String).filter(m=>m).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(d)&&p.push(`OFFSET ${d}`),p.join(" ")}},df=class e{constructor(t,r){this.op=t,this.queries=r.map(n=>n.clone()),this.query={orderby:[]}}clone(){let t=new e(this.op,this.queries);return t.query={...this.query},t}orderby(...t){let{query:r}=this;return t.length===0?r.orderby:(r.orderby=r.orderby.concat(t.flat().filter(n=>n).map(se)),this)}limit(t){let{query:r}=this;return arguments.length===0?r.limit:(r.limit=Number.isFinite(t)?t:void 0,this)}offset(t){let{query:r}=this;return arguments.length===0?r.offset:(r.offset=Number.isFinite(t)?t:void 0,this)}get subqueries(){let{queries:t,cteFor:r}=this;return r&&t.forEach(n=>n.cteFor=r),t}toString(){let{op:t,queries:r,query:{orderby:n,limit:i,offset:o}}=this,s=[r.join(` ${t} `)];return n.length&&s.push(`ORDER BY ${n.join(", ")}`),Number.isFinite(i)&&s.push(`LIMIT ${i}`),Number.isFinite(o)&&s.push(`OFFSET ${o}`),s.join(" ")}};function v1(e){return e instanceof Mt||e instanceof df}function w1(e){return WZ(e)?e.slice(1,-1):e}function WZ(e){return e[0]==='"'&&e[e.length-1]==='"'}var S1=e=>e;function GZ(){return{apply:S1,invert:S1,sqlApply:se,sqlInvert:S1}}function XZ({base:e}={}){if(e==null||e===Math.E)return{apply:Math.log,invert:Math.exp,sqlApply:t=>W`LN(${se(t)})`,sqlInvert:t=>W`EXP(${t})`};if(e===10)return{apply:Math.log10,invert:t=>Math.pow(10,t),sqlApply:t=>W`LOG(${se(t)})`,sqlInvert:t=>W`POW(10, ${t})`};{let t=+e;return{apply:r=>Math.log(r)/Math.log(t),invert:r=>Math.pow(t,r),sqlApply:r=>W`LN(${se(r)}) / LN(${t})`,sqlInvert:r=>W`POW(${t}, ${r})`}}}function HZ({constant:e=1}={}){let t=+e;return{apply:r=>Math.sign(r)*Math.log1p(Math.abs(r)),invert:r=>Math.sign(r)*Math.exp(Math.abs(r)-t),sqlApply:r=>(r=se(r),W`SIGN(${r}) * LN(${t} + ABS(${r}))`),sqlInvert:r=>W`SIGN(${r}) * (EXP(ABS(${r})) - ${t})`}}function ZZ(){return{apply:e=>Math.sign(e)*Math.sqrt(Math.abs(e)),invert:e=>Math.sign(e)*e*e,sqlApply:e=>(e=se(e),W`SIGN(${e}) * SQRT(ABS(${e}))`),sqlInvert:e=>W`SIGN(${e}) * (${e}) ** 2`}}function KZ({exponent:e=1}={}){let t=+e;return{apply:r=>Math.sign(r)*Math.pow(Math.abs(r),t),invert:r=>Math.sign(r)*Math.pow(Math.abs(r),1/t),sqlApply:r=>(r=se(r),W`SIGN(${r}) * POW(ABS(${r}), ${t})`),sqlInvert:r=>W`SIGN(${r}) * POW(ABS(${r}), 1/${t})`}}function sU(){return{apply:e=>+e,invert:e=>new Date(e),sqlApply:e=>e instanceof Date?+e:ZM(se(e)),sqlInvert:S1}}var QZ={linear:GZ,log:XZ,symlog:HZ,sqrt:ZZ,pow:KZ,time:sU,utc:sU};function Fy(e){let t=QZ[e.type];return t?{...e,...t(e)}:null}function Ol(e,t,{replace:r=!1,temp:n=!0,view:i=!1}={}){return"CREATE"+(r?" OR REPLACE ":" ")+(n?"TEMP ":"")+(i?"VIEW":"TABLE")+(r?" ":" IF NOT EXISTS ")+e+" AS "+t}function rE(e){return`INSTALL ${e}; LOAD ${e}`}function aU(e,{columns:t=Object.keys(e?.[0]||{})}={}){let r=[];if(Array.isArray(t)?(r=t,t=r.reduce((i,o)=>(i[o]=o,i),{})):t&&(r=Object.keys(t)),!r.length)throw new Error("Can not create table from empty column set.");let n=[];for(let i of e){let o=r.map(s=>`${Ls(i[s])} AS "${t[s]}"`);n.push(`(SELECT ${o.join(", ")})`)}return n.join(" UNION ALL ")}function I1(e,t,r,n={},i={}){let{select:o=["*"],where:s,view:a,temp:c,replace:l,...u}=n,f=JZ({...i,...u}),d=`${e}('${r}'${f?", "+f:""})`,h=s?` WHERE ${s}`:"",p=`SELECT ${o.join(", ")} FROM ${d}${h}`;return Ol(t,p,{view:a,temp:c,replace:l})}function iE(e,t,r){return I1("read_csv",e,t,r,{auto_detect:!0,sample_size:-1})}function oE(e,t,r){return I1("read_json",e,t,r,{auto_detect:!0,json_format:"auto"})}function sE(e,t,r){return I1("read_parquet",e,t,r)}function aE(e,t,r={}){let{options:n,...i}=r;if(n){let o=Array.isArray(n)?n.join(", "):typeof n=="string"?n:Object.entries(n).map(([s,a])=>`${s}=${a}`).join(", ");i.open_options=o.toUpperCase()}return I1("st_read",e,t,i)}function cE(e,t,r={}){let{select:n=["*"],...i}=r,o=aU(t),s=n.length===1&&n[0]==="*"?o:`SELECT ${n} FROM ${o}`;return Ol(e,s,i)}function JZ(e){return Object.entries(e).map(([t,r])=>`${t}=${nE(r)}`).join(", ")}function nE(e){switch(typeof e){case"boolean":return String(e);case"string":return`'${e}'`;case"undefined":case"object":return e==null?"NULL":Array.isArray(e)?"["+e.map(t=>nE(t)).join(", ")+"]":"{"+Object.entries(e).map(([t,r])=>`'${t}': ${nE(r)}`).join(", ")+"}";default:return e}}function cU(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 tK="count",eK="nulls",rK="max",nK="min",iK="distinct";var oK={[tK]:Li,[iK]:e=>Li(e).distinct(),[rK]:so,[nK]:ao,[eK]:e=>Li().where(lf(e))};function lU({table:e,column:t},r){return Mt.from(e).select(r.map(n=>[n,oK[n](t)]))}var uU=()=>Object.create(null),T1=class{constructor(t){this.mc=t,this.clear()}clear(){this.tables=uU()}tableInfo(t){let r=this.tables;if(r[t])return r[t];let n=sK(this.mc,t).catch(i=>{throw r[t]=null,i});return r[t]=n}async fieldInfo({table:t,column:r,stats:n}){let o=(await this.tableInfo(t))[r];if(o==null)return;if(!n?.length)return o;let s=await this.mc.query(lU(o,n),{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 r=await aK(this,t);return(await Promise.all(r.map(i=>this.fieldInfo(i)))).filter(i=>i)}};async function sK(e,t){let r=await e.query(`DESCRIBE ${af(t)}`,{type:"json",cache:!1}),n=uU();for(let i of r)n[i.column_name]={table:t,column:i.column_name,sqlType:i.column_type,type:cU(i.column_type),nullable:i.null==="YES"};return n}async function aK(e,t){return t.length===1&&t[0].column==="*"?Object.values(await e.tableInfo(t[0].table)):t}function dU(e){let t=2166136261;for(let r=0,n=e.length;r<n;++r){let i=e.charCodeAt(r),o=i&65280;o&&(t=fU(t^o>>8)),t=fU(t^i&255)}return cK(t)}function fU(e){return e+(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}function cK(e){return e+=e<<13,e^=e>>>7,e+=e<<3,e^=e>>>17,e+=e<<5,e&4294967295}var A1=class{constructor(t,{selection:r,temp:n=!0}){this.mc=t,this.selection=r,this.temp=n,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,r){if(this.clients!==t){let l=Array.from(t,pU),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;r=r||this.selection.active;let{source:n}=r;if(n&&n===this.activeView?.source)return!0;if(this.clear(),!n)return!1;let i=this.activeView=lK(r);if(!i)return!1;this.mc.logger().warn("DATA CUBE INDEX CONSTRUCTION");let o=this.selection.remove(n),s=this.indices=new Map,{mc:a,temp:c}=this;for(let l of t){if(o.skip(l,r))continue;let u=pU(l),f=l.query(o.predicate(l)).select({...i.columns,...u.count}).groupby(Object.keys(i.columns)),[d]=f.subqueries;if(d){let b=Object.values(i.columns).map(x=>x.columns[0]);fK(d,b)}let h=f.orderby();f.query.orderby=[];let p=f.toString(),g=`cube_index_${(dU(p)>>>0).toString(16)}`,m=a.exec(Ol(g,p,{temp:c}));s.set(l,{table:g,result:m,order:h,...u})}}async update(){let{clients:t,selection:r,activeView:n}=this,i=n.predicate(r.active.predicate);return Promise.all(Array.from(t).map(o=>this.updateClient(o,i)))}async updateClient(t,r){let n=this.indices.get(t);if(!n)return;r||(r=this.activeView.predicate(this.selection.active.predicate));let{table:i,dims:o,aggr:s,order:a=[]}=n,c=Mt.select(o,s).from(i).groupby(o).where(r).orderby(a);return this.mc.updateClient(t,c)}};function lK(e){let{source:t,schema:r}=e,n=e.predicate?.columns;if(!r||!n)return null;let{type:i,scales:o,pixelSize:s=1}=r,a;if(i==="interval"&&o){let c=o.map(l=>uK(l,s));if(c.some(l=>l==null))return null;c.length===1?(a=l=>l?tr("active0",l.range.map(c[0])):[],n={active0:c[0](e.predicate.field)}):(a=l=>l?$n(l.children.map(({range:u},f)=>tr(`active${f}`,u.map(c[f])))):[],n=Object.fromEntries(e.predicate.children.map((l,u)=>[`active${u}`,c[u](l.field)])))}else if(i==="point")a=c=>c,n=Object.fromEntries(n.map(c=>[c.toString(),c]));else return null;return{source:t,columns:n,predicate:a}}function uK(e,t){let{apply:r,sqlApply:n}=Fy(e);if(r){let{domain:i,range:o}=e,s=r(Math.min(...i)),a=r(Math.max(...i)),c=Math.abs(o[1]-o[0])/(a-s)/t,l=t===1?"":`${t}::INTEGER * `;return u=>W`${l}FLOOR(${c}::DOUBLE * (${n(u)} - ${s}::DOUBLE))::INTEGER`}}var hU={from:NaN};function pU(e){if(!e.filterIndexable)return hU;let t=e.query(),r=lE(t);if(!r||!t.groupby)return hU;let n=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]:W`SUM("${a}")::DOUBLE`});break;case"AVG":s="_count_",i.push({[a]:W`(SUM("${a}" * ${s}) / SUM(${s}))::DOUBLE`});break;case"MAX":i.push({[a]:W`MAX("${a}")`});break;case"MIN":i.push({[a]:W`MIN("${a}")`});break;default:if(n.has(a))o.push(a);else return null}return{aggr:i,dims:o,count:s?{[s]:W`COUNT(*)`}:{},from:r}}function lE(e){let t=e.subqueries;if(e.select){let n=e.from();if(!n.length)return;if(t.length===0)return n[0].from.table}let r=lE(t[0]);for(let n=1;n<t.length;++n){let i=lE(t[n]);if(i!==void 0&&i!==r)return NaN}return r}function fK(e,t){let r=new Set,n=i=>{r.has(i)||(r.add(i),i.select&&i.from().length&&i.select(t),i.subqueries.forEach(n))};n(e)}var M1=class{constructor(t,r,n=!0){this.mc=t,this.selection=r,this.clients=new Set,this.indexer=n?new A1(this.mc,{...n,selection:r}):null;let{value:i,activate:o}=this.handlers={value:()=>this.update(),activate:s=>this.indexer?.index(this.clients,s)};r.addEventListener("value",i),r.addEventListener("activate",o)}finalize(){let{value:t,activate:r}=this.handlers;this.selection.removeEventListener("value",t),this.selection.removeEventListener("activate",r)}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:r,clients:n,selection:i}=this;return r?.index(n)?r.update():dK(t,n,i)}};function dK(e,t,r){return Promise.all(Array.from(t).map(n=>{let i=r.predicate(n);if(i!=null)return e.updateClient(n,n.query(i))}))}function E1(){let e,t,r=new Promise((n,i)=>{e=n,t=i});return r.fulfill=n=>(e(n),r),r.reject=n=>(t(n),r),r}function hK(e){return(typeof requestAnimationFrame<"u"?requestAnimationFrame:typeof setImmediate<"u"?setImmediate:setTimeout)(e)}function mU(e,t,r){let n=[],i=0;function o(){let s=pK(n,t);n=[],i=0;for(let a of s)yK(a,e,r),xK(a,t)}return{add(s,a){s.request.type==="arrow"?(i=i||hK(()=>o()),n.push({entry:s,priority:a,index:n.length})):e(s,a)}}}function pK(e,t){let r=[],n=new Map;for(let i of e){let{entry:{request:o}}=i,s=mK(o.query,t);if(!n.has(s)){let a=[];r.push(a),n.set(s,a)}n.get(s).push(i)}return r}function mK(e,t){let r=`${e}`;if(e instanceof Mt&&!t.get(r)){if(e.orderby().length||e.where().length||e.qualify().length||e.having().length)return r;let n=e.clone().$select("*"),i=e.groupby();if(i.length){let o={};e.select().forEach(({as:s,expr:a})=>o[s]=a),n.$groupby(i.map(s=>s instanceof mi&&o[s.column]||s))}return`${n}`}else return r}function yK(e,t,r){if(gK(e))t({request:{type:"arrow",cache:!1,record:!1,query:bK(e,r)},result:e.result=E1()});else for(let{entry:n,priority:i}of e)t(n,i)}function gK(e){if(e.length>1){let t=`${e[0].entry.request.query}`;for(let r=1;r<e.length;++r)if(t!==`${e[r].entry.request.query}`)return!0}return!1}function bK(e,t){let r=e.maps=[],n=new Map;for(let s of e){let{query:a}=s.entry.request,c=[];r.push(c);for(let{as:l,expr:u}of a.select()){let f=`${u}`;n.has(f)||n.set(f,[`col${n.size}`,u]);let[d]=n.get(f);c.push([d,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 mi&&s[a.column]||a))}return i.$select(Array.from(n.values()))}async function xK(e,t){let{maps:r,result:n}=e;if(!r)return;let i;try{i=await n}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=_K(i,r[s]);a.cache&&t.set(String(a.query),l),c.fulfill(l)})}function _K(e,t){if(t){let r={};for(let[n,i]of t)r[i]=e.getChild(n);return new e.constructor(r)}else return e}var wK=typeof requestIdleCallback<"u"?requestIdleCallback:setTimeout,yU=()=>({get:()=>{},set:(e,t)=>t,clear:()=>{}});function gU({max:e=1e3,ttl:t=3*60*60*1e3}={}){let r=new Map;function n(){let i=performance.now()-t,o=null,s=1/0;for(let[a,c]of r){let{last:l}=c;l<s&&(o=a,s=l),i>l&&r.delete(a)}o&&r.delete(o)}return{get(i){let o=r.get(i);if(o)return o.last=performance.now(),o.value},set(i,o){return r.set(i,{last:performance.now(),value:o}),r.size>e&&wK(n),o},clear(){r=new Map}}}function bU(e){let t=Array.from({length:e},()=>({head:null,tail:null}));return{isEmpty(){return t.every(r=>!r.head)},insert(r,n){let i=t[n];if(!i)throw new Error(`Invalid queue priority rank: ${n}`);let o={item:r,next:null};i.head===null?i.head=i.tail=o:i.tail=i.tail.next=o},remove(r){for(let n of t){let{head:i,tail:o}=n;for(let s=null,a=i;a;s=a,a=a.next)r(a.item)&&(a===i?i=a.next:s.next=a.next,a===o&&(o=s||i));n.head=i,n.tail=o}},next(){for(let r of t){let{head:n}=r;if(n!==null)return r.head=n.next,r.tail===n&&(r.tail=null),n.item}}}}var Rs={High:0,Normal:1,Low:2};function xU(){let e=bU(3),t,r,n,i=[],o=null,s;function a(){if(o||e.isEmpty())return;let{request:f,result:d}=e.next();o=u(f,d),o.finally(()=>{o=null,a()})}function c(f,d=Rs.Normal){e.insert(f,d),a()}function l(f){i.length&&f&&i.forEach(d=>d.add(f))}async function u(f,d){try{let{query:h,type:p,cache:y=!1,record:g=!0,options:m}=f,b=h?`${h}`:null;if(g&&l(b),y){let v=r.get(b);if(v){n.debug("Cache"),d.fulfill(v);return}}let x=performance.now(),_=await t.query({type:p,sql:b,...m});y&&r.set(b,_),n.debug(`Request: ${(performance.now()-x).toFixed(1)}`),d.fulfill(_)}catch(h){d.reject(h)}}return{cache(f){return f!==void 0?r=f===!0?gU():f||yU():r},logger(f){return f?n=f:n},connector(f){return f?t=f:t},consolidate(f){f&&!s?s=mU(c,r,l):!f&&s&&(s=null)},request(f,d=Rs.Normal){let h=E1(),p={request:f,result:h};return s?s.add(p,d):c(p,d),h},cancel(f){let d=new Set(f);e.remove(({result:h})=>d.has(h))},clear(){e.remove(({result:f})=>(f.reject("Cleared"),!0))},record(){let f=[],d={add(h){f.push(h)},reset(){f=[]},snapshot(){return f.slice()},stop(){return i=i.filter(h=>h!==d),f}};return i.push(d),d}}}function _U(){return{debug(){},info(){},log(){},warn(){},error(){}}}var D1;function co(e){return e?D1=e:D1==null&&(D1=new Ly),D1}var Ly=class{constructor(t=x1(),r={}){let{logger:n=console,manager:i=xU()}=r;this.catalog=new T1(this),this.manager=i,this.logger(n),this.configure(r),this.databaseConnector(t),this.clear()}logger(t){return arguments.length&&(this._logger=t||_U(),this.manager.logger(this._logger)),this._logger}configure({cache:t=!0,consolidate:r=!0,indexes:n=!0}){this.manager.cache(t),this.manager.consolidate(r),this.indexes=n}clear({clients:t=!0,cache:r=!0,catalog:n=!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),r&&this.manager.cache().clear(),n&&this.catalog.clear()}databaseConnector(t){return this.manager.connector(t)}cancel(t){this.manager.cancel(t)}exec(t,{priority:r=Rs.Normal}={}){return t=Array.isArray(t)?t.join(`;
|
|
11
|
+
`):t,this.manager.request({type:"exec",query:t},r)}query(t,{type:r="arrow",cache:n=!0,priority:i=Rs.Normal,...o}={}){return this.manager.request({type:r,query:t,cache:n,options:o},i)}prefetch(t,r={}){return this.query(t,{...r,cache:!0,priority:Rs.Low})}createBundle(t,r,n=Rs.Low){let i={name:t,queries:r};return this.manager.request({type:"create-bundle",options:i},n)}loadBundle(t,r=Rs.High){let n={name:t};return this.manager.request({type:"load-bundle",options:n},r)}updateClient(t,r,n=Rs.Normal){return t.queryPending(),this.query(r,{priority:n}).then(i=>t.queryResult(i).update(),i=>{t.queryError(i),this._logger.error(i)})}requestQuery(t,r){return this.filterGroups.get(t.filterBy)?.reset(),r?this.updateClient(t,r):t.update()}async connect(t){let{catalog:r,clients:n,filterGroups:i,indexes:o}=this;if(n.has(t))throw new Error("Client already connected.");n.add(t),t.coordinator=this;let s=t.fields();s?.length&&t.fieldInfo(await r.queryFields(s));let a=t.filterBy;if(a)if(i.has(a))i.get(a).add(t);else{let c=new M1(this,a,o);i.set(a,c.add(t))}t.requestQuery()}disconnect(t){let{clients:r,filterGroups:n}=this;r.has(t)&&(r.delete(t),n.get(t.filterBy)?.remove(t),t.coordinator=null)}};var B1=class{constructor(){this._callbacks=new Map}addEventListener(t,r){this._callbacks.has(t)||this._callbacks.set(t,{callbacks:new Set,pending:null,queue:new uE}),this._callbacks.get(t).callbacks.add(r)}removeEventListener(t,r){let n=this._callbacks.get(t);n&&n.callbacks.delete(r)}willEmit(t,r){return r}emitQueueFilter(){return null}cancel(t){this._callbacks.get(t)?.queue.clear()}emit(t,r){let n=this._callbacks.get(t)||{};if(n.pending)n.queue.enqueue(r,this.emitQueueFilter(t,r));else{let i=this.willEmit(t,r),{callbacks:o,queue:s}=n;if(o?.size){let a=Promise.allSettled(Array.from(o,c=>c(i))).then(()=>{n.pending=null,s.isEmpty()||this.emit(t,s.dequeue())});n.pending=a}}}},uE=class{constructor(){this.clear()}clear(){this.next=null}isEmpty(){return!this.next}enqueue(t,r){let n={value:t};if(r&&this.next){let i=this;for(;i.next;)r(i.next.value)?i=i.next:i.next=i.next.next;i.next=n}else this.next=n}dequeue(){let{next:t}=this;return this.next=t?.next,t?.value}};function Ry(e,t){return e===t?!1:e instanceof Date&&t instanceof Date?+e!=+t:Array.isArray(e)&&Array.isArray(t)?vK(e,t):!0}function vK(e,t){if(e.length!==t.length)return!0;for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!0;return!1}function yi(e){return e instanceof Nl}var Nl=class e extends B1{constructor(t){super(),this._value=t}static value(t){return new e(t)}static array(t){if(t.some(r=>yi(r))){let r=new e,n=()=>r.update(t.map(i=>yi(i)?i.value:i));return n(),t.forEach(i=>yi(i)?i.addEventListener("value",n):0),r}return new e(t)}get value(){return this._value}update(t,{force:r}={}){return Ry(this._value,t)||r?this.emit("value",t):this.cancel("value"),this}willEmit(t,r){return t==="value"&&(this._value=r),r}};function lo(e){return e instanceof ac}var ac=class e extends Nl{static intersect({cross:t=!1}={}){return new e(new hf({cross:t}))}static union({cross:t=!1}={}){return new e(new hf({cross:t,union:!0}))}static single({cross:t=!1}={}){return new e(new hf({cross:t,single:!0}))}static crossfilter(){return new e(new hf({cross:!0}))}constructor(t=new hf){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 r=this.clone();return r._value=r._resolved=r._resolver.resolve(this._resolved,{source:t}),r._value.active={source:t},r}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,r){return t==="value"?(this._value=r,this.value):r}emitQueueFilter(t,r){return t==="value"?this._resolver.queueFilter(r):null}skip(t,r){return this._resolver.skip(t,r)}predicate(t,r=!1){let{clauses:n}=this,i=r?null:n.active;return this._resolver.predicate(n,i,t)}},hf=class{constructor({union:t,cross:r,single:n}={}){this.union=!!t,this.cross=!!r,this.single=!!n}resolve(t,r,n=!1){let{source:i,predicate:o}=r,s=t.filter(c=>i!==c.source),a=this.single?[]:s;return this.single&&n&&s.forEach(c=>c.source?.reset?.()),o&&a.push(r),a}skip(t,r){return this.cross&&r?.clients?.has(t)}predicate(t,r,n){let{union:i}=this;if(this.skip(n,r))return;let o=t.filter(s=>!this.skip(n,s)).map(s=>s.predicate);return i&&o.length>1?cf(o):o}queueFilter(t){if(this.cross){let r=t.active?.source;return n=>n.active?.source!==r}}};function wU(e="http://localhost:3000/"){return{async query(t){let r=fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return t.type==="exec"?r:t.type==="arrow"?sf(r):(await r).json()}}}var yE={};Ir(yE,{compareArrayLike:()=>mE,joinUint8Arrays:()=>ki,memcpy:()=>rh,rebaseValueOffsets:()=>C1,toArrayBufferView:()=>ee,toArrayBufferViewAsyncIterator:()=>Qo,toArrayBufferViewIterator:()=>ks,toBigInt64Array:()=>DK,toBigUint64Array:()=>NK,toFloat32Array:()=>FK,toFloat32ArrayAsyncIterator:()=>HK,toFloat32ArrayIterator:()=>zK,toFloat64Array:()=>LK,toFloat64ArrayAsyncIterator:()=>ZK,toFloat64ArrayIterator:()=>VK,toInt16Array:()=>EK,toInt16ArrayAsyncIterator:()=>YK,toInt16ArrayIterator:()=>CK,toInt32Array:()=>pf,toInt32ArrayAsyncIterator:()=>WK,toInt32ArrayIterator:()=>UK,toInt8Array:()=>MK,toInt8ArrayAsyncIterator:()=>qK,toInt8ArrayIterator:()=>kK,toUint16Array:()=>BK,toUint16ArrayAsyncIterator:()=>GK,toUint16ArrayIterator:()=>PK,toUint32Array:()=>OK,toUint32ArrayAsyncIterator:()=>XK,toUint32ArrayIterator:()=>$K,toUint8Array:()=>Xt,toUint8ArrayAsyncIterator:()=>pE,toUint8ArrayIterator:()=>hE,toUint8ClampedArray:()=>RK,toUint8ClampedArrayAsyncIterator:()=>KK,toUint8ClampedArrayIterator:()=>jK});var SK=new TextDecoder("utf-8"),ky=e=>SK.decode(e),IK=new TextEncoder,Fl=e=>IK.encode(e);var TK=e=>typeof e=="number",vU=e=>typeof e=="boolean",Vr=e=>typeof e=="function",zn=e=>e!=null&&Object(e)===e,Zo=e=>zn(e)&&Vr(e.then);var Ko=e=>zn(e)&&Vr(e[Symbol.iterator]),uo=e=>zn(e)&&Vr(e[Symbol.asyncIterator]),O1=e=>zn(e)&&zn(e.schema);var N1=e=>zn(e)&&"done"in e&&"value"in e;var F1=e=>zn(e)&&Vr(e.stat)&&TK(e.fd);var L1=e=>zn(e)&&Cy(e.body),R1=e=>"_getDOMStream"in e&&"_getNodeStream"in e,SU=e=>zn(e)&&Vr(e.abort)&&Vr(e.getWriter)&&!R1(e),Cy=e=>zn(e)&&Vr(e.cancel)&&Vr(e.getReader)&&!R1(e),IU=e=>zn(e)&&Vr(e.end)&&Vr(e.write)&&vU(e.writable)&&!R1(e),k1=e=>zn(e)&&Vr(e.read)&&Vr(e.pipe)&&vU(e.readable)&&!R1(e),TU=e=>zn(e)&&Vr(e.clear)&&Vr(e.bytes)&&Vr(e.position)&&Vr(e.setPosition)&&Vr(e.capacity)&&Vr(e.getBufferIdentifier)&&Vr(e.createLong);var dE=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function AK(e){let t=e[0]?[e[0]]:[],r,n,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:r,byteLength:i}=s,{byteOffset:n,byteLength:o}=a,r+i<n||n+o<r){a&&(t[++l]=a);continue}t[l]=new Uint8Array(s.buffer,r,n-r+o)}return t}function rh(e,t,r=0,n=t.byteLength){let i=e.byteLength,o=new Uint8Array(e.buffer,e.byteOffset,i),s=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,i));return o.set(s,r),e}function ki(e,t){let r=AK(e),n=r.reduce((u,f)=>u+f.byteLength,0),i,o,s,a=0,c=-1,l=Math.min(t||Number.POSITIVE_INFINITY,n);for(let u=r.length;++c<u;){if(i=r[c],o=i.subarray(0,Math.min(i.length,l-a)),l<=a+o.length){o.length<i.length?r[c]=i.subarray(o.length):o.length===i.length&&c++,s?rh(s,o,a):s=o;break}rh(s||(s=new Uint8Array(l)),o,a),a+=o.length}return[s||new Uint8Array(0),r.slice(c),n-(s?s.byteLength:0)]}function ee(e,t){let r=N1(t)?t.value:t;return r instanceof e?e===Uint8Array?new e(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=Fl(r)),r instanceof ArrayBuffer?new e(r):r instanceof dE?new e(r):TU(r)?ee(e,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new e(0):new e(r.buffer,r.byteOffset,r.byteLength/e.BYTES_PER_ELEMENT):e.from(r)):new e(0)}var MK=e=>ee(Int8Array,e),EK=e=>ee(Int16Array,e),pf=e=>ee(Int32Array,e),DK=e=>ee(BigInt64Array,e),Xt=e=>ee(Uint8Array,e),BK=e=>ee(Uint16Array,e),OK=e=>ee(Uint32Array,e),NK=e=>ee(BigUint64Array,e),FK=e=>ee(Float32Array,e),LK=e=>ee(Float64Array,e),RK=e=>ee(Uint8ClampedArray,e),fE=e=>(e.next(),e);function*ks(e,t){let r=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof dE?r(t):Ko(t)?t:r(t);return yield*fE(function*(i){let o=null;do o=i.next(yield ee(e,o));while(!o.done)}(n[Symbol.iterator]())),new e}var kK=e=>ks(Int8Array,e),CK=e=>ks(Int16Array,e),UK=e=>ks(Int32Array,e),hE=e=>ks(Uint8Array,e),PK=e=>ks(Uint16Array,e),$K=e=>ks(Uint32Array,e),zK=e=>ks(Float32Array,e),VK=e=>ks(Float64Array,e),jK=e=>ks(Uint8ClampedArray,e);function Qo(e,t){return $e(this,arguments,function*(){if(Zo(t))return yield H(yield H(yield*Ji(fr(Qo(e,yield H(t))))));let n=function(s){return $e(this,arguments,function*(){yield yield H(yield H(s))})},i=function(s){return $e(this,arguments,function*(){yield H(yield*Ji(fr(fE(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 dE?n(t):Ko(t)?i(t):uo(t)?t:n(t);return yield H(yield*Ji(fr(fE(function(s){return $e(this,arguments,function*(){let a=null;do a=yield H(s.next(yield yield H(ee(e,a))));while(!a.done)})}(o[Symbol.asyncIterator]()))))),yield H(new e)})}var qK=e=>Qo(Int8Array,e),YK=e=>Qo(Int16Array,e),WK=e=>Qo(Int32Array,e),pE=e=>Qo(Uint8Array,e),GK=e=>Qo(Uint16Array,e),XK=e=>Qo(Uint32Array,e),HK=e=>Qo(Float32Array,e),ZK=e=>Qo(Float64Array,e),KK=e=>Qo(Uint8ClampedArray,e);function C1(e,t,r){if(e!==0){r=r.slice(0,t);for(let n=-1,i=r.length;++n<i;)r[n]+=e}return r.subarray(0,t)}function mE(e,t){let r=0,n=e.length;if(n!==t.length)return!1;if(n>0)do if(e[r]!==t[r])return!1;while(++r<n);return!0}var ln={fromIterable(e){return U1(QK(e))},fromAsyncIterable(e){return U1(JK(e))},fromDOMStream(e){return U1(tQ(e))},fromNodeStream(e){return U1(eQ(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')}},U1=e=>(e.next(),e);function*QK(e){let t,r=!1,n=[],i,o,s,a=0;function c(){return o==="peek"?ki(n,s)[0]:([i,n,a]=ki(n,s),i)}({cmd:o,size:s}=yield null);let l=hE(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(s-a)?l.next():l.next(s-a),!t&&i.byteLength>0&&(n.push(i),a+=i.byteLength),t||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!t)}catch(u){(r=!0)&&typeof l.throw=="function"&&l.throw(u)}finally{r===!1&&typeof l.return=="function"&&l.return(null)}return null}function JK(e){return $e(this,arguments,function*(){let r,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?ki(i,a)[0]:([o,i,c]=ki(i,a),o)}({cmd:s,size:a}=yield yield H(null));let u=pE(e)[Symbol.asyncIterator]();try{do if({done:r,value:o}=Number.isNaN(a-c)?yield H(u.next()):yield H(u.next(a-c)),!r&&o.byteLength>0&&(i.push(o),c+=o.byteLength),r||a<=c)do({cmd:s,size:a}=yield yield H(l()));while(a<c);while(!r)}catch(f){(n=!0)&&typeof u.throw=="function"&&(yield H(u.throw(f)))}finally{n===!1&&typeof u.return=="function"&&(yield H(u.return(new Uint8Array(0))))}return yield H(null)})}function tQ(e){return $e(this,arguments,function*(){let r=!1,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?ki(i,a)[0]:([o,i,c]=ki(i,a),o)}({cmd:s,size:a}=yield yield H(null));let u=new bE(e);try{do if({done:r,value:o}=Number.isNaN(a-c)?yield H(u.read()):yield H(u.read(a-c)),!r&&o.byteLength>0&&(i.push(Xt(o)),c+=o.byteLength),r||a<=c)do({cmd:s,size:a}=yield yield H(l()));while(a<c);while(!r)}catch(f){(n=!0)&&(yield H(u.cancel(f)))}finally{n===!1?yield H(u.cancel()):e.locked&&u.releaseLock()}return yield H(null)})}var bE=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 P(this,void 0,void 0,function*(){let{reader:r,source:n}=this;r&&(yield r.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return P(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=yield this.reader.read();return!r.done&&(r.value=Xt(r)),r})}},gE=(e,t)=>{let r=i=>n([t,i]),n;return[t,r,new Promise(i=>(n=i)&&e.once(t,r))]};function eQ(e){return $e(this,arguments,function*(){let r=[],n="error",i=!1,o=null,s,a,c=0,l=[],u;function f(){return s==="peek"?ki(l,a)[0]:([u,l,c]=ki(l,a),u)}if({cmd:s,size:a}=yield yield H(null),e.isTTY)return yield yield H(new Uint8Array(0)),yield H(null);try{r[0]=gE(e,"end"),r[1]=gE(e,"error");do{if(r[2]=gE(e,"readable"),[n,o]=yield H(Promise.race(r.map(h=>h[2]))),n==="error")break;if((i=n==="end")||(Number.isFinite(a-c)?(u=Xt(e.read(a-c)),u.byteLength<a-c&&(u=Xt(e.read()))):u=Xt(e.read()),u.byteLength>0&&(l.push(u),c+=u.byteLength)),i||a<=c)do({cmd:s,size:a}=yield yield H(f()));while(a<c)}while(!i)}finally{yield H(d(r,n==="error"?o:null))}return yield H(null);function d(h,p){return u=l=null,new Promise((y,g)=>{for(let[m,b]of h)e.off(m,b);try{let m=e.destroy;m&&m.call(e,p),p=void 0}catch(m){p=m||p}finally{p!=null?g(p):y()}})}})}var er;(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"})(er||(er={}));var je;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(je||(je={}));var Xe;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(Xe||(Xe={}));var un;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(un||(un={}));var It;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(It||(It={}));var Vn;(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"})(Vn||(Vn={}));var ge;(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"})(ge||(ge={}));var N;(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"})(N||(N={}));var fo;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(fo||(fo={}));var CE={};Ir(CE,{clampIndex:()=>WQ,clampRange:()=>zy,createElementComparator:()=>kl});var xE={};Ir(xE,{valueToString:()=>Jo});function Jo(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=>Jo(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,r)=>typeof r=="bigint"?`${r}`:r)}var wE={};Ir(wE,{BN:()=>Py,bigNumToBigInt:()=>EU,bigNumToString:()=>oh,isArrowBigNumSymbol:()=>AU});var AU=Symbol.for("isArrowBigNum");function ts(e,...t){return t.length===0?Object.setPrototypeOf(ee(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}ts.prototype[AU]=!0;ts.prototype.toJSON=function(){return`"${oh(this)}"`};ts.prototype.valueOf=function(){return MU(this)};ts.prototype.toString=function(){return oh(this)};ts.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return MU(this);case"string":return oh(this);case"default":return EU(this)}return oh(this)};function nh(...e){return ts.apply(this,e)}function ih(...e){return ts.apply(this,e)}function Uy(...e){return ts.apply(this,e)}Object.setPrototypeOf(nh.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(ih.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Uy.prototype,Object.create(Uint32Array.prototype));Object.assign(nh.prototype,ts.prototype,{constructor:nh,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(ih.prototype,ts.prototype,{constructor:ih,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Uy.prototype,ts.prototype,{constructor:Uy,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});function MU(e){let{buffer:t,byteOffset:r,length:n,signed:i}=e,o=new BigUint64Array(t,r,n),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 oh=e=>{if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return _E(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return _E(e);t=t.slice();let n=1;for(let o=0;o<t.length;o++){let s=t[o],a=~s+n;t[o]=a,n&=s===0?1:0}return`-${_E(t)}`},EU=e=>e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:oh(e);function _E(e){let t="",r=new Uint32Array(2),n=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),o=-1,s=n.length-1;do{for(r[0]=n[o=0];o<s;)n[o++]=r[1]=r[0]/10,r[0]=(r[0]-r[1]*10<<16)+n[o];n[o]=r[1]=r[0]/10,r[0]=r[0]-r[1]*10,t=`${r[0]}${t}`}while(i[0]||i[1]||i[2]||i[3]);return t??"0"}var Py=class e{static new(t,r){switch(r){case!0:return new nh(t);case!1:return new ih(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new nh(t)}return t.byteLength===16?new Uy(t):new ih(t)}static signed(t){return new nh(t)}static unsigned(t){return new ih(t)}static decimal(t){return new Uy(t)}constructor(t,r){return e.new(t,r)}};function gi(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 DU,BU,OU,NU,FU,LU,RU,kU,CU,UU,PU,$U,zU,VU,jU,qU,YU,WU,GU,XU,ht=class e{static isNull(t){return t?.typeId===N.Null}static isInt(t){return t?.typeId===N.Int}static isFloat(t){return t?.typeId===N.Float}static isBinary(t){return t?.typeId===N.Binary}static isUtf8(t){return t?.typeId===N.Utf8}static isBool(t){return t?.typeId===N.Bool}static isDecimal(t){return t?.typeId===N.Decimal}static isDate(t){return t?.typeId===N.Date}static isTime(t){return t?.typeId===N.Time}static isTimestamp(t){return t?.typeId===N.Timestamp}static isInterval(t){return t?.typeId===N.Interval}static isDuration(t){return t?.typeId===N.Duration}static isList(t){return t?.typeId===N.List}static isStruct(t){return t?.typeId===N.Struct}static isUnion(t){return t?.typeId===N.Union}static isFixedSizeBinary(t){return t?.typeId===N.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===N.FixedSizeList}static isMap(t){return t?.typeId===N.Map}static isDictionary(t){return t?.typeId===N.Dictionary}static isDenseUnion(t){return e.isUnion(t)&&t.mode===je.Dense}static isSparseUnion(t){return e.isUnion(t)&&t.mode===je.Sparse}get typeId(){return N.NONE}};DU=Symbol.toStringTag;ht[DU]=(e=>(e.children=null,e.ArrayType=Array,e[Symbol.toStringTag]="DataType"))(ht.prototype);var jn=class extends ht{toString(){return"Null"}get typeId(){return N.Null}};BU=Symbol.toStringTag;jn[BU]=(e=>e[Symbol.toStringTag]="Null")(jn.prototype);var xr=class extends ht{constructor(t,r){super(),this.isSigned=t,this.bitWidth=r}get typeId(){return N.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}`}};OU=Symbol.toStringTag;xr[OU]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(xr.prototype);var P1=class extends xr{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},$1=class extends xr{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Cs=class extends xr{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},z1=class extends xr{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},V1=class extends xr{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},j1=class extends xr{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},q1=class extends xr{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Y1=class extends xr{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(P1.prototype,"ArrayType",{value:Int8Array});Object.defineProperty($1.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Cs.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(z1.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(V1.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(j1.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(q1.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Y1.prototype,"ArrayType",{value:BigUint64Array});var bi=class extends ht{constructor(t){super(),this.precision=t}get typeId(){return N.Float}get ArrayType(){switch(this.precision){case Xe.HALF:return Uint16Array;case Xe.SINGLE:return Float32Array;case Xe.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};NU=Symbol.toStringTag;bi[NU]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(bi.prototype);var W1=class extends bi{constructor(){super(Xe.HALF)}},G1=class extends bi{constructor(){super(Xe.SINGLE)}},X1=class extends bi{constructor(){super(Xe.DOUBLE)}};Object.defineProperty(W1.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(G1.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(X1.prototype,"ArrayType",{value:Float64Array});var cc=class extends ht{constructor(){super()}get typeId(){return N.Binary}toString(){return"Binary"}};FU=Symbol.toStringTag;cc[FU]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(cc.prototype);var lc=class extends ht{constructor(){super()}get typeId(){return N.Utf8}toString(){return"Utf8"}};LU=Symbol.toStringTag;lc[LU]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(lc.prototype);var uc=class extends ht{constructor(){super()}get typeId(){return N.Bool}toString(){return"Bool"}};RU=Symbol.toStringTag;uc[RU]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(uc.prototype);var fc=class extends ht{constructor(t,r,n=128){super(),this.scale=t,this.precision=r,this.bitWidth=n}get typeId(){return N.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};kU=Symbol.toStringTag;fc[kU]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(fc.prototype);var dc=class extends ht{constructor(t){super(),this.unit=t}get typeId(){return N.Date}toString(){return`Date${(this.unit+1)*32}<${un[this.unit]}>`}};CU=Symbol.toStringTag;dc[CU]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Date"))(dc.prototype);var es=class extends ht{constructor(t,r){super(),this.unit=t,this.bitWidth=r}get typeId(){return N.Time}toString(){return`Time${this.bitWidth}<${It[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};UU=Symbol.toStringTag;es[UU]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(es.prototype);var hc=class extends ht{constructor(t,r){super(),this.unit=t,this.timezone=r}get typeId(){return N.Timestamp}toString(){return`Timestamp<${It[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};PU=Symbol.toStringTag;hc[PU]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Timestamp"))(hc.prototype);var pc=class extends ht{constructor(t){super(),this.unit=t}get typeId(){return N.Interval}toString(){return`Interval<${Vn[this.unit]}>`}};$U=Symbol.toStringTag;pc[$U]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(pc.prototype);var mc=class extends ht{constructor(t){super(),this.unit=t}get typeId(){return N.Duration}toString(){return`Duration<${It[this.unit]}>`}};zU=Symbol.toStringTag;mc[zU]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(mc.prototype);var rs=class extends ht{constructor(t){super(),this.children=[t]}get typeId(){return N.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}};VU=Symbol.toStringTag;rs[VU]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(rs.prototype);var qe=class extends ht{constructor(t){super(),this.children=t}get typeId(){return N.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};jU=Symbol.toStringTag;qe[jU]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(qe.prototype);var ns=class extends ht{constructor(t,r,n){super(),this.mode=t,this.children=n,this.typeIds=r=Int32Array.from(r),this.typeIdToChildIndex=r.reduce((i,o,s)=>(i[o]=s)&&i||i,Object.create(null))}get typeId(){return N.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};qU=Symbol.toStringTag;ns[qU]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(ns.prototype);var yc=class extends ht{constructor(t){super(),this.byteWidth=t}get typeId(){return N.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};YU=Symbol.toStringTag;yc[YU]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(yc.prototype);var is=class extends ht{constructor(t,r){super(),this.listSize=t,this.children=[r]}get typeId(){return N.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}>`}};WU=Symbol.toStringTag;is[WU]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(is.prototype);var os=class extends ht{constructor(t,r=!1){var n,i,o;if(super(),this.children=[t],this.keysSorted=r,t&&(t.name="entries",!((n=t?.type)===null||n===void 0)&&n.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 N.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(", ")}}>`}};GU=Symbol.toStringTag;os[GU]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(os.prototype);var rQ=(e=>()=>++e)(-1),Ci=class extends ht{constructor(t,r,n,i){super(),this.indices=r,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?rQ():gi(n)}get typeId(){return N.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}>`}};XU=Symbol.toStringTag;Ci[XU]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(Ci.prototype);function Ui(e){let t=e;switch(e.typeId){case N.Decimal:return e.bitWidth/32;case N.Timestamp:return 2;case N.Date:return 1+t.unit;case N.Interval:return 1+t.unit;case N.FixedSizeList:return t.listSize;case N.FixedSizeBinary:return t.byteWidth;default:return 1}}var mt=class{visitMany(t,...r){return t.map((n,i)=>this.visit(n,...r.map(o=>o[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,r=!0){return nQ(this,t,r)}getVisitFnByTypeId(t,r=!0){return sh(this,t,r)}visitNull(t,...r){return null}visitBool(t,...r){return null}visitInt(t,...r){return null}visitFloat(t,...r){return null}visitUtf8(t,...r){return null}visitBinary(t,...r){return null}visitFixedSizeBinary(t,...r){return null}visitDate(t,...r){return null}visitTimestamp(t,...r){return null}visitTime(t,...r){return null}visitDecimal(t,...r){return null}visitList(t,...r){return null}visitStruct(t,...r){return null}visitUnion(t,...r){return null}visitDictionary(t,...r){return null}visitInterval(t,...r){return null}visitDuration(t,...r){return null}visitFixedSizeList(t,...r){return null}visitMap(t,...r){return null}};function nQ(e,t,r=!0){return typeof t=="number"?sh(e,t,r):typeof t=="string"&&t in N?sh(e,N[t],r):t&&t instanceof ht?sh(e,HU(t),r):t?.type&&t.type instanceof ht?sh(e,HU(t.type),r):sh(e,N.NONE,r)}function sh(e,t,r=!0){let n=null;switch(t){case N.Null:n=e.visitNull;break;case N.Bool:n=e.visitBool;break;case N.Int:n=e.visitInt;break;case N.Int8:n=e.visitInt8||e.visitInt;break;case N.Int16:n=e.visitInt16||e.visitInt;break;case N.Int32:n=e.visitInt32||e.visitInt;break;case N.Int64:n=e.visitInt64||e.visitInt;break;case N.Uint8:n=e.visitUint8||e.visitInt;break;case N.Uint16:n=e.visitUint16||e.visitInt;break;case N.Uint32:n=e.visitUint32||e.visitInt;break;case N.Uint64:n=e.visitUint64||e.visitInt;break;case N.Float:n=e.visitFloat;break;case N.Float16:n=e.visitFloat16||e.visitFloat;break;case N.Float32:n=e.visitFloat32||e.visitFloat;break;case N.Float64:n=e.visitFloat64||e.visitFloat;break;case N.Utf8:n=e.visitUtf8;break;case N.Binary:n=e.visitBinary;break;case N.FixedSizeBinary:n=e.visitFixedSizeBinary;break;case N.Date:n=e.visitDate;break;case N.DateDay:n=e.visitDateDay||e.visitDate;break;case N.DateMillisecond:n=e.visitDateMillisecond||e.visitDate;break;case N.Timestamp:n=e.visitTimestamp;break;case N.TimestampSecond:n=e.visitTimestampSecond||e.visitTimestamp;break;case N.TimestampMillisecond:n=e.visitTimestampMillisecond||e.visitTimestamp;break;case N.TimestampMicrosecond:n=e.visitTimestampMicrosecond||e.visitTimestamp;break;case N.TimestampNanosecond:n=e.visitTimestampNanosecond||e.visitTimestamp;break;case N.Time:n=e.visitTime;break;case N.TimeSecond:n=e.visitTimeSecond||e.visitTime;break;case N.TimeMillisecond:n=e.visitTimeMillisecond||e.visitTime;break;case N.TimeMicrosecond:n=e.visitTimeMicrosecond||e.visitTime;break;case N.TimeNanosecond:n=e.visitTimeNanosecond||e.visitTime;break;case N.Decimal:n=e.visitDecimal;break;case N.List:n=e.visitList;break;case N.Struct:n=e.visitStruct;break;case N.Union:n=e.visitUnion;break;case N.DenseUnion:n=e.visitDenseUnion||e.visitUnion;break;case N.SparseUnion:n=e.visitSparseUnion||e.visitUnion;break;case N.Dictionary:n=e.visitDictionary;break;case N.Interval:n=e.visitInterval;break;case N.IntervalDayTime:n=e.visitIntervalDayTime||e.visitInterval;break;case N.IntervalYearMonth:n=e.visitIntervalYearMonth||e.visitInterval;break;case N.Duration:n=e.visitDuration;break;case N.DurationSecond:n=e.visitDurationSecond||e.visitDuration;break;case N.DurationMillisecond:n=e.visitDurationMillisecond||e.visitDuration;break;case N.DurationMicrosecond:n=e.visitDurationMicrosecond||e.visitDuration;break;case N.DurationNanosecond:n=e.visitDurationNanosecond||e.visitDuration;break;case N.FixedSizeList:n=e.visitFixedSizeList;break;case N.Map:n=e.visitMap;break}if(typeof n=="function")return n;if(!r)return()=>null;throw new Error(`Unrecognized type '${N[t]}'`)}function HU(e){switch(e.typeId){case N.Null:return N.Null;case N.Int:{let{bitWidth:t,isSigned:r}=e;switch(t){case 8:return r?N.Int8:N.Uint8;case 16:return r?N.Int16:N.Uint16;case 32:return r?N.Int32:N.Uint32;case 64:return r?N.Int64:N.Uint64}return N.Int}case N.Float:switch(e.precision){case Xe.HALF:return N.Float16;case Xe.SINGLE:return N.Float32;case Xe.DOUBLE:return N.Float64}return N.Float;case N.Binary:return N.Binary;case N.Utf8:return N.Utf8;case N.Bool:return N.Bool;case N.Decimal:return N.Decimal;case N.Time:switch(e.unit){case It.SECOND:return N.TimeSecond;case It.MILLISECOND:return N.TimeMillisecond;case It.MICROSECOND:return N.TimeMicrosecond;case It.NANOSECOND:return N.TimeNanosecond}return N.Time;case N.Timestamp:switch(e.unit){case It.SECOND:return N.TimestampSecond;case It.MILLISECOND:return N.TimestampMillisecond;case It.MICROSECOND:return N.TimestampMicrosecond;case It.NANOSECOND:return N.TimestampNanosecond}return N.Timestamp;case N.Date:switch(e.unit){case un.DAY:return N.DateDay;case un.MILLISECOND:return N.DateMillisecond}return N.Date;case N.Interval:switch(e.unit){case Vn.DAY_TIME:return N.IntervalDayTime;case Vn.YEAR_MONTH:return N.IntervalYearMonth}return N.Interval;case N.Duration:switch(e.unit){case It.SECOND:return N.DurationSecond;case It.MILLISECOND:return N.DurationMillisecond;case It.MICROSECOND:return N.DurationMicrosecond;case It.NANOSECOND:return N.DurationNanosecond}return N.Duration;case N.Map:return N.Map;case N.List:return N.List;case N.Struct:return N.Struct;case N.Union:switch(e.mode){case je.Dense:return N.DenseUnion;case je.Sparse:return N.SparseUnion}return N.Union;case N.FixedSizeBinary:return N.FixedSizeBinary;case N.FixedSizeList:return N.FixedSizeList;case N.Dictionary:return N.Dictionary}throw new Error(`Unrecognized type '${N[e.typeId]}'`)}mt.prototype.visitInt8=null;mt.prototype.visitInt16=null;mt.prototype.visitInt32=null;mt.prototype.visitInt64=null;mt.prototype.visitUint8=null;mt.prototype.visitUint16=null;mt.prototype.visitUint32=null;mt.prototype.visitUint64=null;mt.prototype.visitFloat16=null;mt.prototype.visitFloat32=null;mt.prototype.visitFloat64=null;mt.prototype.visitDateDay=null;mt.prototype.visitDateMillisecond=null;mt.prototype.visitTimestampSecond=null;mt.prototype.visitTimestampMillisecond=null;mt.prototype.visitTimestampMicrosecond=null;mt.prototype.visitTimestampNanosecond=null;mt.prototype.visitTimeSecond=null;mt.prototype.visitTimeMillisecond=null;mt.prototype.visitTimeMicrosecond=null;mt.prototype.visitTimeNanosecond=null;mt.prototype.visitDenseUnion=null;mt.prototype.visitSparseUnion=null;mt.prototype.visitIntervalDayTime=null;mt.prototype.visitIntervalYearMonth=null;mt.prototype.visitDuration=null;mt.prototype.visitDurationSecond=null;mt.prototype.visitDurationMillisecond=null;mt.prototype.visitDurationMicrosecond=null;mt.prototype.visitDurationNanosecond=null;var vE={};Ir(vE,{float64ToUint16:()=>$y,uint16ToFloat64:()=>H1});var ZU=new Float64Array(1),ah=new Uint32Array(ZU.buffer);function H1(e){let t=(e&31744)>>10,r=(e&1023)/1024,n=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return n*(r?Number.NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*Math.pow(2,t-15)*(1+r)}function $y(e){if(e!==e)return 32256;ZU[0]=e;let t=(ah[1]&2147483648)>>16&65535,r=ah[1]&2146435072,n=0;return r>=1089470464?ah[0]>0?r=31744:(r=(r&2080374784)>>16,n=(ah[1]&1048575)>>10):r<=1056964608?(n=1048576+(ah[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(ah[1]&1048575)+512>>10),t|r|n&65535}var kt=class extends mt{};function qt(e){return(t,r,n)=>{if(t.setValid(r,n!=null))return e(t,r,n)}}var iQ=(e,t,r)=>{e[t]=Math.trunc(r/864e5)},SE=(e,t,r)=>{e[t]=Math.trunc(r%4294967296),e[t+1]=Math.trunc(r/4294967296)},oQ=(e,t,r)=>{e[t]=Math.trunc(r*1e3%4294967296),e[t+1]=Math.trunc(r*1e3/4294967296)},sQ=(e,t,r)=>{e[t]=Math.trunc(r*1e6%4294967296),e[t+1]=Math.trunc(r*1e6/4294967296)},KU=(e,t,r,n)=>{if(r+1<t.length){let{[r]:i,[r+1]:o}=t;e.set(n.subarray(0,o-i),i)}},aQ=({offset:e,values:t},r,n)=>{let i=e+r;n?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},gc=({values:e},t,r)=>{e[t]=r},IE=({values:e},t,r)=>{e[t]=r},QU=({values:e},t,r)=>{e[t]=$y(r)},cQ=(e,t,r)=>{switch(e.type.precision){case Xe.HALF:return QU(e,t,r);case Xe.SINGLE:case Xe.DOUBLE:return IE(e,t,r)}},Z1=({values:e},t,r)=>{iQ(e,t,r.valueOf())},K1=({values:e},t,r)=>{SE(e,t*2,r.valueOf())},TE=({stride:e,values:t},r,n)=>{t.set(n.subarray(0,e),e*r)},lQ=({values:e,valueOffsets:t},r,n)=>KU(e,t,r,n),uQ=({values:e,valueOffsets:t},r,n)=>{KU(e,t,r,Fl(n))},AE=(e,t,r)=>{e.type.unit===un.DAY?Z1(e,t,r):K1(e,t,r)},Q1=({values:e},t,r)=>SE(e,t*2,r/1e3),J1=({values:e},t,r)=>SE(e,t*2,r),tw=({values:e},t,r)=>oQ(e,t*2,r),ew=({values:e},t,r)=>sQ(e,t*2,r),ME=(e,t,r)=>{switch(e.type.unit){case It.SECOND:return Q1(e,t,r);case It.MILLISECOND:return J1(e,t,r);case It.MICROSECOND:return tw(e,t,r);case It.NANOSECOND:return ew(e,t,r)}},rw=({values:e},t,r)=>{e[t]=r},nw=({values:e},t,r)=>{e[t]=r},iw=({values:e},t,r)=>{e[t]=r},ow=({values:e},t,r)=>{e[t]=r},EE=(e,t,r)=>{switch(e.type.unit){case It.SECOND:return rw(e,t,r);case It.MILLISECOND:return nw(e,t,r);case It.MICROSECOND:return iw(e,t,r);case It.NANOSECOND:return ow(e,t,r)}},DE=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},fQ=(e,t,r)=>{let n=e.children[0],i=e.valueOffsets,o=fn.getVisitFn(n);if(Array.isArray(r))for(let s=-1,a=i[t],c=i[t+1];a<c;)o(n,a++,r[++s]);else for(let s=-1,a=i[t],c=i[t+1];a<c;)o(n,a++,r.get(++s))},dQ=(e,t,r)=>{let n=e.children[0],{valueOffsets:i}=e,o=fn.getVisitFn(n),{[t]:s,[t+1]:a}=i,c=r instanceof Map?r.entries():Object.entries(r);for(let l of c)if(o(n,s,l),++s>=a)break},hQ=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[o]),pQ=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(o)),mQ=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(i.name)),yQ=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[i.name]),gQ=(e,t,r)=>{let n=e.type.children.map(o=>fn.getVisitFn(o.type)),i=r instanceof Map?mQ(t,r):r instanceof ue?pQ(t,r):Array.isArray(r)?hQ(t,r):yQ(t,r);e.type.children.forEach((o,s)=>i(n[s],e.children[s],o,s))},bQ=(e,t,r)=>{e.type.mode===je.Dense?JU(e,t,r):t5(e,t,r)},JU=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];fn.visit(i,e.valueOffsets[t],r)},t5=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];fn.visit(i,t,r)},xQ=(e,t,r)=>{var n;(n=e.dictionary)===null||n===void 0||n.set(e.values[t],r)},BE=(e,t,r)=>{e.type.unit===Vn.DAY_TIME?sw(e,t,r):aw(e,t,r)},sw=({values:e},t,r)=>{e.set(r.subarray(0,2),2*t)},aw=({values:e},t,r)=>{e[t]=r[0]*12+r[1]%12},cw=({values:e},t,r)=>{e[t]=r},lw=({values:e},t,r)=>{e[t]=r},uw=({values:e},t,r)=>{e[t]=r},fw=({values:e},t,r)=>{e[t]=r},OE=(e,t,r)=>{switch(e.type.unit){case It.SECOND:return cw(e,t,r);case It.MILLISECOND:return lw(e,t,r);case It.MICROSECOND:return uw(e,t,r);case It.NANOSECOND:return fw(e,t,r)}},_Q=(e,t,r)=>{let{stride:n}=e,i=e.children[0],o=fn.getVisitFn(i);if(Array.isArray(r))for(let s=-1,a=t*n;++s<n;)o(i,a+s,r[s]);else for(let s=-1,a=t*n;++s<n;)o(i,a+s,r.get(s))};kt.prototype.visitBool=qt(aQ);kt.prototype.visitInt=qt(gc);kt.prototype.visitInt8=qt(gc);kt.prototype.visitInt16=qt(gc);kt.prototype.visitInt32=qt(gc);kt.prototype.visitInt64=qt(gc);kt.prototype.visitUint8=qt(gc);kt.prototype.visitUint16=qt(gc);kt.prototype.visitUint32=qt(gc);kt.prototype.visitUint64=qt(gc);kt.prototype.visitFloat=qt(cQ);kt.prototype.visitFloat16=qt(QU);kt.prototype.visitFloat32=qt(IE);kt.prototype.visitFloat64=qt(IE);kt.prototype.visitUtf8=qt(uQ);kt.prototype.visitBinary=qt(lQ);kt.prototype.visitFixedSizeBinary=qt(TE);kt.prototype.visitDate=qt(AE);kt.prototype.visitDateDay=qt(Z1);kt.prototype.visitDateMillisecond=qt(K1);kt.prototype.visitTimestamp=qt(ME);kt.prototype.visitTimestampSecond=qt(Q1);kt.prototype.visitTimestampMillisecond=qt(J1);kt.prototype.visitTimestampMicrosecond=qt(tw);kt.prototype.visitTimestampNanosecond=qt(ew);kt.prototype.visitTime=qt(EE);kt.prototype.visitTimeSecond=qt(rw);kt.prototype.visitTimeMillisecond=qt(nw);kt.prototype.visitTimeMicrosecond=qt(iw);kt.prototype.visitTimeNanosecond=qt(ow);kt.prototype.visitDecimal=qt(DE);kt.prototype.visitList=qt(fQ);kt.prototype.visitStruct=qt(gQ);kt.prototype.visitUnion=qt(bQ);kt.prototype.visitDenseUnion=qt(JU);kt.prototype.visitSparseUnion=qt(t5);kt.prototype.visitDictionary=qt(xQ);kt.prototype.visitInterval=qt(BE);kt.prototype.visitIntervalDayTime=qt(sw);kt.prototype.visitIntervalYearMonth=qt(aw);kt.prototype.visitDuration=qt(OE);kt.prototype.visitDurationSecond=qt(cw);kt.prototype.visitDurationMillisecond=qt(lw);kt.prototype.visitDurationMicrosecond=qt(uw);kt.prototype.visitDurationNanosecond=qt(fw);kt.prototype.visitFixedSizeList=qt(_Q);kt.prototype.visitMap=qt(dQ);var fn=new kt;var ss=Symbol.for("parent"),ch=Symbol.for("rowIndex"),Ll=class{constructor(t,r){return this[ss]=t,this[ch]=r,new Proxy(this,new FE)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[ch],r=this[ss],n=r.type.children,i={};for(let o=-1,s=n.length;++o<s;)i[n[o].name]=Dr.visit(r.children[o],t);return i}toString(){return`{${[...this].map(([t,r])=>`${Jo(t)}: ${Jo(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new NE(this[ss],this[ch])}},NE=class{constructor(t,r){this.childIndex=0,this.children=t.children,this.rowIndex=r,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,Dr.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(Ll.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ss]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ch]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var FE=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[ss].type.children.map(r=>r.name)}has(t,r){return t[ss].type.children.findIndex(n=>n.name===r)!==-1}getOwnPropertyDescriptor(t,r){if(t[ss].type.children.findIndex(n=>n.name===r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[ss].type.children.findIndex(i=>i.name===r);if(n!==-1){let i=Dr.visit(t[ss].children[n],t[ch]);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[ss].type.children.findIndex(o=>o.name===r);return i!==-1?(fn.visit(t[ss].children[i],t[ch],n),Reflect.set(t,r,n)):Reflect.has(t,r)||typeof r=="symbol"?Reflect.set(t,r,n):!1}};var Dt=class extends mt{};function $t(e){return(t,r)=>t.getValid(r)?e(t,r):null}var wQ=(e,t)=>864e5*e[t],LE=(e,t)=>4294967296*e[t+1]+(e[t]>>>0),vQ=(e,t)=>4294967296*(e[t+1]/1e3)+(e[t]>>>0)/1e3,SQ=(e,t)=>4294967296*(e[t+1]/1e6)+(e[t]>>>0)/1e6,e5=e=>new Date(e),IQ=(e,t)=>e5(wQ(e,t)),TQ=(e,t)=>e5(LE(e,t)),AQ=(e,t)=>null,r5=(e,t,r)=>{if(r+1>=t.length)return null;let n=t[r],i=t[r+1];return e.subarray(n,i)},MQ=({offset:e,values:t},r)=>{let n=e+r;return(t[n>>3]&1<<n%8)!==0},n5=({values:e},t)=>IQ(e,t),i5=({values:e},t)=>TQ(e,t*2),Rl=({stride:e,values:t},r)=>t[e*r],EQ=({stride:e,values:t},r)=>H1(t[e*r]),o5=({values:e},t)=>e[t],DQ=({stride:e,values:t},r)=>t.subarray(e*r,e*(r+1)),BQ=({values:e,valueOffsets:t},r)=>r5(e,t,r),OQ=({values:e,valueOffsets:t},r)=>{let n=r5(e,t,r);return n!==null?ky(n):null},NQ=({values:e},t)=>e[t],FQ=({type:e,values:t},r)=>e.precision!==Xe.HALF?t[r]:H1(t[r]),LQ=(e,t)=>e.type.unit===un.DAY?n5(e,t):i5(e,t),s5=({values:e},t)=>1e3*LE(e,t*2),a5=({values:e},t)=>LE(e,t*2),c5=({values:e},t)=>vQ(e,t*2),l5=({values:e},t)=>SQ(e,t*2),RQ=(e,t)=>{switch(e.type.unit){case It.SECOND:return s5(e,t);case It.MILLISECOND:return a5(e,t);case It.MICROSECOND:return c5(e,t);case It.NANOSECOND:return l5(e,t)}},u5=({values:e},t)=>e[t],f5=({values:e},t)=>e[t],d5=({values:e},t)=>e[t],h5=({values:e},t)=>e[t],kQ=(e,t)=>{switch(e.type.unit){case It.SECOND:return u5(e,t);case It.MILLISECOND:return f5(e,t);case It.MICROSECOND:return d5(e,t);case It.NANOSECOND:return h5(e,t)}},CQ=({values:e,stride:t},r)=>Py.decimal(e.subarray(t*r,t*(r+1))),UQ=(e,t)=>{let{valueOffsets:r,stride:n,children:i}=e,{[t*n]:o,[t*n+1]:s}=r,c=i[0].slice(o,s-o);return new ue([c])},PQ=(e,t)=>{let{valueOffsets:r,children:n}=e,{[t]:i,[t+1]:o}=r,s=n[0];return new Us(s.slice(i,o-i))},$Q=(e,t)=>new Ll(e,t),zQ=(e,t)=>e.type.mode===je.Dense?p5(e,t):m5(e,t),p5=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return Dr.visit(n,e.valueOffsets[t])},m5=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return Dr.visit(n,t)},VQ=(e,t)=>{var r;return(r=e.dictionary)===null||r===void 0?void 0:r.get(e.values[t])},jQ=(e,t)=>e.type.unit===Vn.DAY_TIME?y5(e,t):g5(e,t),y5=({values:e},t)=>e.subarray(2*t,2*(t+1)),g5=({values:e},t)=>{let r=e[t],n=new Int32Array(2);return n[0]=Math.trunc(r/12),n[1]=Math.trunc(r%12),n},b5=({values:e},t)=>e[t],x5=({values:e},t)=>e[t],_5=({values:e},t)=>e[t],w5=({values:e},t)=>e[t],qQ=(e,t)=>{switch(e.type.unit){case It.SECOND:return b5(e,t);case It.MILLISECOND:return x5(e,t);case It.MICROSECOND:return _5(e,t);case It.NANOSECOND:return w5(e,t)}},YQ=(e,t)=>{let{stride:r,children:n}=e,o=n[0].slice(t*r,r);return new ue([o])};Dt.prototype.visitNull=$t(AQ);Dt.prototype.visitBool=$t(MQ);Dt.prototype.visitInt=$t(NQ);Dt.prototype.visitInt8=$t(Rl);Dt.prototype.visitInt16=$t(Rl);Dt.prototype.visitInt32=$t(Rl);Dt.prototype.visitInt64=$t(o5);Dt.prototype.visitUint8=$t(Rl);Dt.prototype.visitUint16=$t(Rl);Dt.prototype.visitUint32=$t(Rl);Dt.prototype.visitUint64=$t(o5);Dt.prototype.visitFloat=$t(FQ);Dt.prototype.visitFloat16=$t(EQ);Dt.prototype.visitFloat32=$t(Rl);Dt.prototype.visitFloat64=$t(Rl);Dt.prototype.visitUtf8=$t(OQ);Dt.prototype.visitBinary=$t(BQ);Dt.prototype.visitFixedSizeBinary=$t(DQ);Dt.prototype.visitDate=$t(LQ);Dt.prototype.visitDateDay=$t(n5);Dt.prototype.visitDateMillisecond=$t(i5);Dt.prototype.visitTimestamp=$t(RQ);Dt.prototype.visitTimestampSecond=$t(s5);Dt.prototype.visitTimestampMillisecond=$t(a5);Dt.prototype.visitTimestampMicrosecond=$t(c5);Dt.prototype.visitTimestampNanosecond=$t(l5);Dt.prototype.visitTime=$t(kQ);Dt.prototype.visitTimeSecond=$t(u5);Dt.prototype.visitTimeMillisecond=$t(f5);Dt.prototype.visitTimeMicrosecond=$t(d5);Dt.prototype.visitTimeNanosecond=$t(h5);Dt.prototype.visitDecimal=$t(CQ);Dt.prototype.visitList=$t(UQ);Dt.prototype.visitStruct=$t($Q);Dt.prototype.visitUnion=$t(zQ);Dt.prototype.visitDenseUnion=$t(p5);Dt.prototype.visitSparseUnion=$t(m5);Dt.prototype.visitDictionary=$t(VQ);Dt.prototype.visitInterval=$t(jQ);Dt.prototype.visitIntervalDayTime=$t(y5);Dt.prototype.visitIntervalYearMonth=$t(g5);Dt.prototype.visitDuration=$t(qQ);Dt.prototype.visitDurationSecond=$t(b5);Dt.prototype.visitDurationMillisecond=$t(x5);Dt.prototype.visitDurationMicrosecond=$t(_5);Dt.prototype.visitDurationNanosecond=$t(w5);Dt.prototype.visitFixedSizeList=$t(YQ);Dt.prototype.visitMap=$t(PQ);var Dr=new Dt;var ho=Symbol.for("keys"),lh=Symbol.for("vals"),Us=class{constructor(t){return this[ho]=new ue([t.children[0]]).memoize(),this[lh]=t.children[1],new Proxy(this,new kE)}[Symbol.iterator](){return new RE(this[ho],this[lh])}get size(){return this[ho].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[ho],r=this[lh],n={};for(let i=-1,o=t.length;++i<o;)n[t.get(i)]=Dr.visit(r,i);return n}toString(){return`{${[...this].map(([t,r])=>`${Jo(t)}: ${Jo(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},RE=class{constructor(t,r){this.keys=t,this.vals=r,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),Dr.visit(this.vals,t)]})}},kE=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[ho].toArray().map(String)}has(t,r){return t[ho].includes(r)}getOwnPropertyDescriptor(t,r){if(t[ho].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[ho].indexOf(r);if(n!==-1){let i=Dr.visit(Reflect.get(t,lh),n);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[ho].indexOf(r);return i!==-1?(fn.visit(Reflect.get(t,lh),i,n),Reflect.set(t,r,n)):Reflect.has(t,r)?Reflect.set(t,r,n):!1}};Object.defineProperties(Us.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ho]:{writable:!0,enumerable:!1,configurable:!1,value:null},[lh]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function WQ(e,t,r){let n=e.length,i=t>-1?t:n+t%n;return r?r(e,i):i}var v5;function zy(e,t,r,n){let{length:i=0}=e,o=typeof t!="number"?0:t,s=typeof r!="number"?i:r;return o<0&&(o=(o%i+i)%i),s<0&&(s=(s%i+i)%i),s<o&&(v5=o,o=s,s=v5),s>i&&(s=i),n?n(e,o,s):[o,s]}var S5=e=>e!==e;function kl(e){if(typeof e!=="object"||e===null)return S5(e)?S5:r=>r===e;if(e instanceof Date){let r=e.valueOf();return n=>n instanceof Date?n.valueOf()===r:!1}return ArrayBuffer.isView(e)?r=>r?mE(e,r):!1:e instanceof Map?XQ(e):Array.isArray(e)?GQ(e):e instanceof ue?HQ(e):ZQ(e,!0)}function GQ(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=kl(e[r]);return dw(t)}function XQ(e){let t=-1,r=[];for(let n of e.values())r[++t]=kl(n);return dw(r)}function HQ(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=kl(e.get(r));return dw(t)}function ZQ(e,t=!1){let r=Object.keys(e);if(!t&&r.length===0)return()=>!1;let n=[];for(let i=-1,o=r.length;++i<o;)n[i]=kl(e[r[i]]);return dw(n,r)}function dw(e,t){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return KQ(e,r);case Map:return I5(e,r,r.keys());case Us:case Ll:case Object:case void 0:return I5(e,r,t||Object.keys(r))}return r instanceof ue?QQ(e,r):!1}}function KQ(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++n<r;)if(!e[n](t[n]))return!1;return!0}function QQ(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++n<r;)if(!e[n](t.get(n)))return!1;return!0}function I5(e,t,r){let n=r[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=n.next(),u=i.next();for(;s<a&&!l.done&&!u.done&&!c.done&&!(l.value!==u.value||!e[s](c.value));++s,l=n.next(),u=i.next(),c=o.next());return s===a&&l.done&&u.done&&c.done?!0:(n.return&&n.return(),i.return&&i.return(),o.return&&o.return(),!1)}var UE={};Ir(UE,{BitIterator:()=>mf,getBit:()=>T5,getBool:()=>pw,packBools:()=>gf,popcnt_array:()=>A5,popcnt_bit_range:()=>Vy,popcnt_uint32:()=>hw,setBool:()=>JQ,truncateBitmap:()=>yf});function pw(e,t,r,n){return(r&1<<n)!==0}function T5(e,t,r,n){return(r&1<<n)>>n}function JQ(e,t,r){return r?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function yf(e,t,r){let n=r.byteLength+7&-8;if(e>0||r.byteLength<n){let i=new Uint8Array(n);return i.set(e%8===0?r.subarray(e>>3):gf(new mf(r,e,t,null,pw)).subarray(0,n)),i}return r}function gf(e){let t=[],r=0,n=0,i=0;for(let s of e)s&&(i|=1<<n),++n===8&&(t[r++]=i,i=n=0);(r===0||n>0)&&(t[r++]=i);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}var mf=class{constructor(t,r,n,i,o){this.bytes=t,this.length=n,this.context=i,this.get=o,this.bit=r%8,this.byteIndex=r>>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 Vy(e,t,r){if(r-t<=0)return 0;if(r-t<8){let o=0;for(let s of new mf(e,t,r-t,e,T5))o+=s;return o}let n=r>>3<<3,i=t+(t%8===0?0:8-t%8);return Vy(e,t,i)+Vy(e,n,r)+A5(e,i>>3,n-i>>3)}function A5(e,t,r){let n=0,i=Math.trunc(t),o=new DataView(e.buffer,e.byteOffset,e.byteLength),s=r===void 0?e.byteLength:i+r;for(;s-i>=4;)n+=hw(o.getUint32(i)),i+=4;for(;s-i>=2;)n+=hw(o.getUint16(i)),i+=2;for(;s-i>=1;)n+=hw(o.getUint8(i)),i+=1;return n}function hw(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 tJ=-1,De=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 ht.isSparseUnion(t)?this.children.some(r=>r.nullable):ht.isDenseUnion(t)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:r,values:n,nullBitmap:i,typeIds:o}=this;return r&&(t+=r.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),this.children.reduce((s,a)=>s+a.byteLength,t)}get nullCount(){if(ht.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,r;return t<=tJ&&(r=this.nullBitmap)&&(this._nullCount=t=this.length-Vy(r,this.offset,this.offset+this.length)),t}constructor(t,r,n,i,o,s=[],a){this.type=t,this.children=s,this.dictionary=a,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(n||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=Ui(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:r}=this;if(ht.isUnion(r)){let n=r,i=this.children[n.typeIdToChildIndex[this.typeIds[t]]],o=n.mode===je.Dense?this.valueOffsets[t]:t;return i.getValid(o)}if(this.nullable&&this.nullCount>0){let n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(t,r){let n,{type:i}=this;if(ht.isUnion(i)){let o=i,s=this.children[o.typeIdToChildIndex[this.typeIds[t]]],a=o.mode===je.Dense?this.valueOffsets[t]:t;n=s.getValid(a),s.setValid(a,r)}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(yf(s,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:o,_nullCount:-1}));let f=o[u];n=(f&l)!==0,r?o[u]=f|l:o[u]=f&~l}return n!==!!r&&(this._nullCount=this.nullCount+(r?-1:1)),r}clone(t=this.type,r=this.offset,n=this.length,i=this._nullCount,o=this,s=this.children){return new e(t,r,n,i,o,s,this.dictionary)}slice(t,r){let{stride:n,typeId:i,children:o}=this,s=+(this._nullCount===0)-1,a=i===16?n:1,c=this._sliceBuffers(t,r,n,i);return this.clone(this.type,this.offset+t,r,s,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*t,a*r))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===N.Null)return this.clone(this.type,0,t,0);let{length:r,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,r>>3);i[r>>3]=(1<<r-(r&-8))-1,n>0&&i.set(yf(this.offset,r,this.nullBitmap),0);let o=this.buffers;return o[fo.VALIDITY]=i,this.clone(this.type,0,t,n+(t-r),o)}_sliceBuffers(t,r,n,i){let o,{buffers:s}=this;return(o=s[fo.TYPE])&&(s[fo.TYPE]=o.subarray(t,t+r)),(o=s[fo.OFFSET])&&(s[fo.OFFSET]=o.subarray(t,t+r+1))||(o=s[fo.DATA])&&(s[fo.DATA]=i===6?o:o.subarray(n*t,n*(t+r))),s}_sliceChildren(t,r,n){return t.map(i=>i.slice(r,n))}};De.prototype.children=Object.freeze([]);var PE=class e extends mt{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:r,["offset"]:n=0,["length"]:i=0}=t;return new De(r,n,i,i)}visitBool(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.nullBitmap),o=ee(r.ArrayType,t.data),{["length"]:s=o.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new De(r,n,s,a,[void 0,o,i])}visitInt(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.nullBitmap),o=ee(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new De(r,n,s,a,[void 0,o,i])}visitFloat(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.nullBitmap),o=ee(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new De(r,n,s,a,[void 0,o,i])}visitUtf8(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.data),o=Xt(t.nullBitmap),s=pf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new De(r,n,a,c,[s,i,o])}visitBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.data),o=Xt(t.nullBitmap),s=pf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new De(r,n,a,c,[s,i,o])}visitFixedSizeBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.nullBitmap),o=ee(r.ArrayType,t.data),{["length"]:s=o.length/Ui(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new De(r,n,s,a,[void 0,o,i])}visitDate(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.nullBitmap),o=ee(r.ArrayType,t.data),{["length"]:s=o.length/Ui(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new De(r,n,s,a,[void 0,o,i])}visitTimestamp(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.nullBitmap),o=ee(r.ArrayType,t.data),{["length"]:s=o.length/Ui(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new De(r,n,s,a,[void 0,o,i])}visitTime(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.nullBitmap),o=ee(r.ArrayType,t.data),{["length"]:s=o.length/Ui(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new De(r,n,s,a,[void 0,o,i])}visitDecimal(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.nullBitmap),o=ee(r.ArrayType,t.data),{["length"]:s=o.length/Ui(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new De(r,n,s,a,[void 0,o,i])}visitList(t){let{["type"]:r,["offset"]:n=0,["child"]:i}=t,o=Xt(t.nullBitmap),s=pf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new De(r,n,a,c,[s,void 0,o],[i])}visitStruct(t){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=t,o=Xt(t.nullBitmap),{length:s=i.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new De(r,n,s,a,[void 0,void 0,o],i)}visitUnion(t){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=t,o=ee(r.ArrayType,t.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=t;if(ht.isSparseUnion(r))return new De(r,n,s,a,[void 0,void 0,void 0,o],i);let c=pf(t.valueOffsets);return new De(r,n,s,a,[c,void 0,void 0,o],i)}visitDictionary(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.nullBitmap),o=ee(r.indices.ArrayType,t.data),{["dictionary"]:s=new ue([new e().visit({type:r.dictionary})])}=t,{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new De(r,n,a,c,[void 0,o,i],[],s)}visitInterval(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.nullBitmap),o=ee(r.ArrayType,t.data),{["length"]:s=o.length/Ui(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new De(r,n,s,a,[void 0,o,i])}visitDuration(t){let{["type"]:r,["offset"]:n=0}=t,i=Xt(t.nullBitmap),o=ee(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new De(r,n,s,a,[void 0,o,i])}visitFixedSizeList(t){let{["type"]:r,["offset"]:n=0,["child"]:i=new e().visit({type:r.valueType})}=t,o=Xt(t.nullBitmap),{["length"]:s=i.length/Ui(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new De(r,n,s,a,[void 0,void 0,o],[i])}visitMap(t){let{["type"]:r,["offset"]:n=0,["child"]:i=new e().visit({type:r.childType})}=t,o=Xt(t.nullBitmap),s=pf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new De(r,n,a,c,[s,void 0,o],[i])}},eJ=new PE;function Ht(e){return eJ.visit(e)}var jy=class{constructor(t=0,r){this.numChunks=t,this.getChunkIterator=r,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 mw(e){return e.reduce((t,r)=>t+r.nullCount,0)}function yw(e){return e.reduce((t,r,n)=>(t[n+1]=t[n]+r.length,t),new Uint32Array(e.length+1))}function gw(e,t,r,n){let i=[];for(let o=-1,s=e.length;++o<s;){let a=e[o],c=t[o],{length:l}=a;if(c>=n)break;if(r>=c+l)continue;if(c>=r&&c+l<=n){i.push(a);continue}let u=Math.max(0,r-c),f=Math.min(n-c,l);i.push(a.slice(u,f-u))}return i.length===0&&i.push(e[0].slice(0,0)),i}function $E(e,t,r,n){let i=0,o=0,s=t.length-1;do{if(i>=s-1)return r<t[s]?n(e,i,r-t[i]):null;o=i+Math.trunc((s-i)*.5),r<t[o]?s=o:i=o}while(i<s)}function qy(e,t){return e.getValid(t)}function Cl(e){function t(r,n,i){return e(r[n],i)}return function(r){let n=this.data;return $E(n,this._offsets,r,t)}}function bw(e){let t;function r(n,i,o){return e(n[i],o,t)}return function(n,i){let o=this.data;t=i;let s=$E(o,this._offsets,n,r);return t=void 0,s}}function xw(e){let t;function r(n,i,o){let s=o,a=0,c=0;for(let l=i-1,u=n.length;++l<u;){let f=n[l];if(~(a=e(f,t,s)))return c+a;s=0,c+=f.length}return-1}return function(n,i){t=n;let o=this.data,s=typeof i!="number"?r(o,0,0):$E(o,this._offsets,i,r);return t=void 0,s}}var Bt=class extends mt{};function rJ(e,t){return t===null&&e.length>0?0:-1}function nJ(e,t){let{nullBitmap:r}=e;if(!r||e.nullCount<=0)return-1;let n=0;for(let i of new mf(r,e.offset+(t||0),e.length,r,pw)){if(!i)return n;++n}return-1}function Zt(e,t,r){if(t===void 0)return-1;if(t===null)switch(e.typeId){case N.Union:break;case N.Dictionary:break;default:return nJ(e,r)}let n=Dr.getVisitFn(e),i=kl(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}function M5(e,t,r){let n=Dr.getVisitFn(e),i=kl(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}Bt.prototype.visitNull=rJ;Bt.prototype.visitBool=Zt;Bt.prototype.visitInt=Zt;Bt.prototype.visitInt8=Zt;Bt.prototype.visitInt16=Zt;Bt.prototype.visitInt32=Zt;Bt.prototype.visitInt64=Zt;Bt.prototype.visitUint8=Zt;Bt.prototype.visitUint16=Zt;Bt.prototype.visitUint32=Zt;Bt.prototype.visitUint64=Zt;Bt.prototype.visitFloat=Zt;Bt.prototype.visitFloat16=Zt;Bt.prototype.visitFloat32=Zt;Bt.prototype.visitFloat64=Zt;Bt.prototype.visitUtf8=Zt;Bt.prototype.visitBinary=Zt;Bt.prototype.visitFixedSizeBinary=Zt;Bt.prototype.visitDate=Zt;Bt.prototype.visitDateDay=Zt;Bt.prototype.visitDateMillisecond=Zt;Bt.prototype.visitTimestamp=Zt;Bt.prototype.visitTimestampSecond=Zt;Bt.prototype.visitTimestampMillisecond=Zt;Bt.prototype.visitTimestampMicrosecond=Zt;Bt.prototype.visitTimestampNanosecond=Zt;Bt.prototype.visitTime=Zt;Bt.prototype.visitTimeSecond=Zt;Bt.prototype.visitTimeMillisecond=Zt;Bt.prototype.visitTimeMicrosecond=Zt;Bt.prototype.visitTimeNanosecond=Zt;Bt.prototype.visitDecimal=Zt;Bt.prototype.visitList=Zt;Bt.prototype.visitStruct=Zt;Bt.prototype.visitUnion=Zt;Bt.prototype.visitDenseUnion=M5;Bt.prototype.visitSparseUnion=M5;Bt.prototype.visitDictionary=Zt;Bt.prototype.visitInterval=Zt;Bt.prototype.visitIntervalDayTime=Zt;Bt.prototype.visitIntervalYearMonth=Zt;Bt.prototype.visitDuration=Zt;Bt.prototype.visitDurationSecond=Zt;Bt.prototype.visitDurationMillisecond=Zt;Bt.prototype.visitDurationMicrosecond=Zt;Bt.prototype.visitDurationNanosecond=Zt;Bt.prototype.visitFixedSizeList=Zt;Bt.prototype.visitMap=Zt;var bf=new Bt;var Ot=class extends mt{};function zt(e){let{type:t}=e;if(e.nullCount===0&&e.stride===1&&(t.typeId===N.Timestamp||t instanceof xr&&t.bitWidth!==64||t instanceof es&&t.bitWidth!==64||t instanceof bi&&t.precision!==Xe.HALF))return new jy(e.data.length,n=>{let i=e.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let r=0;return new jy(e.data.length,n=>{let o=e.data[n].length,s=e.slice(r,r+o);return r+=o,new zE(s)})}var zE=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}};Ot.prototype.visitNull=zt;Ot.prototype.visitBool=zt;Ot.prototype.visitInt=zt;Ot.prototype.visitInt8=zt;Ot.prototype.visitInt16=zt;Ot.prototype.visitInt32=zt;Ot.prototype.visitInt64=zt;Ot.prototype.visitUint8=zt;Ot.prototype.visitUint16=zt;Ot.prototype.visitUint32=zt;Ot.prototype.visitUint64=zt;Ot.prototype.visitFloat=zt;Ot.prototype.visitFloat16=zt;Ot.prototype.visitFloat32=zt;Ot.prototype.visitFloat64=zt;Ot.prototype.visitUtf8=zt;Ot.prototype.visitBinary=zt;Ot.prototype.visitFixedSizeBinary=zt;Ot.prototype.visitDate=zt;Ot.prototype.visitDateDay=zt;Ot.prototype.visitDateMillisecond=zt;Ot.prototype.visitTimestamp=zt;Ot.prototype.visitTimestampSecond=zt;Ot.prototype.visitTimestampMillisecond=zt;Ot.prototype.visitTimestampMicrosecond=zt;Ot.prototype.visitTimestampNanosecond=zt;Ot.prototype.visitTime=zt;Ot.prototype.visitTimeSecond=zt;Ot.prototype.visitTimeMillisecond=zt;Ot.prototype.visitTimeMicrosecond=zt;Ot.prototype.visitTimeNanosecond=zt;Ot.prototype.visitDecimal=zt;Ot.prototype.visitList=zt;Ot.prototype.visitStruct=zt;Ot.prototype.visitUnion=zt;Ot.prototype.visitDenseUnion=zt;Ot.prototype.visitSparseUnion=zt;Ot.prototype.visitDictionary=zt;Ot.prototype.visitInterval=zt;Ot.prototype.visitIntervalDayTime=zt;Ot.prototype.visitIntervalYearMonth=zt;Ot.prototype.visitDuration=zt;Ot.prototype.visitDurationSecond=zt;Ot.prototype.visitDurationMillisecond=zt;Ot.prototype.visitDurationMicrosecond=zt;Ot.prototype.visitDurationNanosecond=zt;Ot.prototype.visitFixedSizeList=zt;Ot.prototype.visitMap=zt;var uh=new Ot;var iJ=(e,t)=>e+t,Ps=class extends mt{visitNull(t,r){return 0}visitInt(t,r){return t.type.bitWidth/8}visitFloat(t,r){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,r){return 1/8}visitDecimal(t,r){return t.type.bitWidth/8}visitDate(t,r){return(t.type.unit+1)*4}visitTime(t,r){return t.type.bitWidth/8}visitTimestamp(t,r){return t.type.unit===It.SECOND?4:8}visitInterval(t,r){return(t.type.unit+1)*4}visitDuration(t,r){return 8}visitStruct(t,r){return t.children.reduce((n,i)=>n+Pi.visit(i,r),0)}visitFixedSizeBinary(t,r){return t.type.byteWidth}visitMap(t,r){return 8+t.children.reduce((n,i)=>n+Pi.visit(i,r),0)}visitDictionary(t,r){var n;return t.type.indices.bitWidth/8+(((n=t.dictionary)===null||n===void 0?void 0:n.getByteLength(t.values[r]))||0)}},oJ=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),sJ=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),aJ=({valueOffsets:e,stride:t,children:r},n)=>{let i=r[0],{[n*t]:o}=e,{[n*t+1]:s}=e,a=Pi.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},cJ=({stride:e,children:t},r)=>{let n=t[0],i=n.slice(r*e,e),o=Pi.getVisitFn(n.type),s=0;for(let a=-1,c=i.length;++a<c;)s+=o(i,a);return s},lJ=(e,t)=>e.type.mode===je.Dense?E5(e,t):D5(e,t),E5=({type:e,children:t,typeIds:r,valueOffsets:n},i)=>{let o=e.typeIdToChildIndex[r[i]];return 8+Pi.visit(t[o],n[i])},D5=({children:e},t)=>4+Pi.visitMany(e,e.map(()=>t)).reduce(iJ,0);Ps.prototype.visitUtf8=oJ;Ps.prototype.visitBinary=sJ;Ps.prototype.visitList=aJ;Ps.prototype.visitFixedSizeList=cJ;Ps.prototype.visitUnion=lJ;Ps.prototype.visitDenseUnion=E5;Ps.prototype.visitSparseUnion=D5;var Pi=new Ps;var B5,O5={},N5={},ue=class e{constructor(t){var r,n,i;let o=t[0]instanceof e?t.flatMap(a=>a.data):t;if(o.length===0||o.some(a=>!(a instanceof De)))throw new TypeError("Vector constructor expects an Array of Data instances.");let s=(r=o[0])===null||r===void 0?void 0:r.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:l,byteLength:u}=O5[s.typeId],f=o[0];this.isValid=d=>qy(f,d),this.get=d=>a(f,d),this.set=(d,h)=>c(f,d,h),this.indexOf=d=>l(f,d),this.getByteLength=d=>u(f,d),this._offsets=[0,f.length];break}default:Object.setPrototypeOf(this,N5[s.typeId]),this._offsets=yw(o);break}this.data=o,this.type=s,this.stride=Ui(s),this.numChildren=(i=(n=s.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,r)=>t+r.byteLength,0)}get nullCount(){return mw(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${N[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,r){}indexOf(t,r){return-1}includes(t,r){return this.indexOf(t,r)>-1}getByteLength(t){return 0}[Symbol.iterator](){return uh.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(t,r){return new e(zy(this,t,r,({data:n,_offsets:i},o,s)=>gw(n,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:t,data:r,length:n,stride:i,ArrayType:o}=this;switch(t.typeId){case N.Int:case N.Float:case N.Decimal:case N.Time:case N.Timestamp:switch(r.length){case 0:return new o;case 1:return r[0].values.subarray(0,n*i);default:return r.reduce((s,{values:a,length:c})=>(s.array.set(a.subarray(0,c*i),s.offset),s.offset+=c*i,s),{array:new o(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new e(this.data.map(({children:r})=>r[t])):null}get isMemoized(){return ht.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(ht.isDictionary(this.type)){let t=new _w(this.data[0].dictionary),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return new _w(this)}unmemoize(){if(ht.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return this}};B5=Symbol.toStringTag;ue[B5]=(e=>{e.type=ht.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(N).map(r=>N[r]).filter(r=>typeof r=="number"&&r!==N.NONE);for(let r of t){let n=Dr.getVisitFnByTypeId(r),i=fn.getVisitFnByTypeId(r),o=bf.getVisitFnByTypeId(r),s=Pi.getVisitFnByTypeId(r);O5[r]={get:n,set:i,indexOf:o,byteLength:s},N5[r]=Object.create(e,{isValid:{value:Cl(qy)},get:{value:Cl(Dr.getVisitFnByTypeId(r))},set:{value:bw(fn.getVisitFnByTypeId(r))},indexOf:{value:xw(bf.getVisitFnByTypeId(r))},getByteLength:{value:Cl(Pi.getVisitFnByTypeId(r))}})}return"Vector"})(ue.prototype);var _w=class e extends ue{constructor(t){super(t.data);let r=this.get,n=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=r.call(this,s);return o[s]=c,c}}),Object.defineProperty(this,"set",{value(s,a){n.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 ue(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function F5(e){if(!e||e.length<=0)return function(i){return!0};let t="",r=e.filter(n=>n===n);return r.length>0&&(t=`
|
|
12
|
+
switch (x) {${r.map(n=>`
|
|
13
|
+
case ${uJ(n)}:`).join("")}
|
|
14
|
+
return false;
|
|
15
|
+
}`),e.length!==r.length&&(t=`if (x !== x) return false;
|
|
16
|
+
${t}`),new Function("x",`${t}
|
|
17
|
+
return true;`)}function uJ(e){return typeof e!="bigint"?Jo(e):`${Jo(e)}n`}var VE=(e,t)=>(Math.ceil(e)*t+63&-64||64)/t,fJ=(e,t=0)=>e.length>=t?e.subarray(0,t):rh(new e.constructor(t),e,0),Ul=class{constructor(t,r=1){this.buffer=t,this.stride=r,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=Math.ceil(t.length/r))}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,r){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let r=this.stride,n=this.length*r,i=this.buffer.length;n>=i&&this._resize(i===0?VE(n*1,this.BYTES_PER_ELEMENT):VE(n*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=VE(t*this.stride,this.BYTES_PER_ELEMENT);let r=fJ(this.buffer,t);return this.clear(),r}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=rh(new this.ArrayType(t),this.buffer)}};Ul.prototype.offset=0;var bc=class extends Ul{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,r){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=r,this}},fh=class extends bc{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,r){let{buffer:n}=this.reserve(t-this.length+1),i=t>>3,o=t%8,s=n[i]>>o&1;return r?s===0&&(n[i]|=1<<o,++this.numValid):s===1&&(n[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},dh=class extends bc{constructor(t=new Int32Array(1)){super(t,1)}append(t){return this.set(this.length-1,t)}set(t,r){let n=this.length-1,i=this.reserve(t-n+1).buffer;return n<t++&&i.fill(i[n],n,t),i[t]=i[t-1]+r,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,0),super.flush(t+1)}};var He=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:r}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=r,this.stride=Ui(t),this._nulls=new fh,r&&r.length>0&&(this._isValid=F5(r))}toVector(){return new ue([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:r,_values:n,_nulls:i,_typeIds:o,children:s}=this;return r&&(t+=r.byteLength),n&&(t+=n.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((r,n)=>r+n.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,r){return this.setValid(t,this.isValid(r))&&this.setValue(t,r),this}setValue(t,r){this._setValue(this,t,r)}setValid(t,r){return this.length=this._nulls.set(t,+r).length,r}addChild(t,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,r,n,i,{type:o,length:s,nullCount:a,_typeIds:c,_offsets:l,_values:u,_nulls:f}=this;(r=c?.flush(s))?i=l?.flush(s):(i=l?.flush(s))?t=u?.flush(l.last()):t=u?.flush(s),a>0&&(n=f?.flush(s));let d=this.children.map(h=>h.flush());return this.clear(),Ht({type:o,length:s,nullCount:a,children:d,child:d[0],data:t,typeIds:r,nullBitmap:n,valueOffsets:i})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,r,n,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(r=this._values)===null||r===void 0||r.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(let o of this.children)o.clear();return this}};He.prototype.length=1;He.prototype.stride=1;He.prototype.children=null;He.prototype.finished=!1;He.prototype.nullValues=null;He.prototype._isValid=()=>!0;var Br=class extends He{constructor(t){super(t),this._values=new bc(new this.ArrayType(0),this.stride)}setValue(t,r){let n=this._values;return n.reserve(t-n.length+1),super.setValue(t,r)}},$s=class extends He{constructor(t){super(t),this._pendingLength=0,this._offsets=new dh}setValue(t,r){let n=this._pending||(this._pending=new Map),i=n.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=r instanceof Us?r[ho].length:r.length,n.set(t,r)}setValid(t,r){return super.setValid(t,r)?!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,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,r),this}};var xf=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,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,r,n,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(r??0)),t.offset()}};var jr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsKeyValue(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}key(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}value(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,r){t.addFieldOffset(0,r,0)}static addValue(t,r){t.addFieldOffset(1,r,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,r,n){return e.startKeyValue(t),e.addKey(t,r),e.addValue(t,n),e.endKeyValue(t)}};var Pl;(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"})(Pl||(Pl={}));var $l;(function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"})($l||($l={}));var Yy;(function(e){e[e.DenseArray=0]="DenseArray"})(Yy||(Yy={}));var as=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInt(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,r){return t.setPosition(t.position()+4),(r||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,r){t.addFieldInt32(0,r,0)}static addIsSigned(t,r){t.addFieldInt8(1,+r,0)}static endInt(t){return t.endObject()}static createInt(t,r,n){return e.startInt(t),e.addBitWidth(t,r),e.addIsSigned(t,n),e.endInt(t)}};var zs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryEncoding(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,r){return t.setPosition(t.position()+4),(r||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 r=this.bb.__offset(this.bb_pos,6);return r?(t||new as).__init(this.bb.__indirect(this.bb_pos+r),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):Yy.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addIndexType(t,r){t.addFieldOffset(1,r,0)}static addIsOrdered(t,r){t.addFieldInt8(2,+r,0)}static addDictionaryKind(t,r){t.addFieldInt16(3,r,Yy.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var Wy=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,r){return t.setPosition(t.position()+4),(r||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 Gy=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBool(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,r){return t.setPosition(t.position()+4),(r||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 Xy;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(Xy||(Xy={}));var zl=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDate(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,r){return t.setPosition(t.position()+4),(r||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):Xy.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,Xy.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,r){return e.startDate(t),e.addUnit(t,r),e.endDate(t)}};var Vs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDecimal(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,r){return t.setPosition(t.position()+4),(r||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,r){t.addFieldInt32(0,r,0)}static addScale(t,r){t.addFieldInt32(1,r,0)}static addBitWidth(t,r){t.addFieldInt32(2,r,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,r,n,i){return e.startDecimal(t),e.addPrecision(t,r),e.addScale(t,n),e.addBitWidth(t,i),e.endDecimal(t)}};var cs;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(cs||(cs={}));var Vl=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDuration(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,r){return t.setPosition(t.position()+4),(r||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):cs.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,cs.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,r){return e.startDuration(t),e.addUnit(t,r),e.endDuration(t)}};var jl=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,r){return t.setPosition(t.position()+4),(r||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,r){t.addFieldInt32(0,r,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,r){return e.startFixedSizeBinary(t),e.addByteWidth(t,r),e.endFixedSizeBinary(t)}};var ql=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,r){return t.setPosition(t.position()+4),(r||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,r){t.addFieldInt32(0,r,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,r){return e.startFixedSizeList(t),e.addListSize(t,r),e.endFixedSizeList(t)}};var Hy;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(Hy||(Hy={}));var Yl=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFloatingPoint(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,r){return t.setPosition(t.position()+4),(r||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):Hy.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,r){t.addFieldInt16(0,r,Hy.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,r){return e.startFloatingPoint(t),e.addPrecision(t,r),e.endFloatingPoint(t)}};var Zy;(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"})(Zy||(Zy={}));var Wl=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInterval(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,r){return t.setPosition(t.position()+4),(r||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):Zy.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,Zy.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,r){return e.startInterval(t),e.addUnit(t,r),e.endInterval(t)}};var Ky=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,r){return t.setPosition(t.position()+4),(r||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 Gl=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMap(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,r){return t.setPosition(t.position()+4),(r||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,r){t.addFieldInt8(0,+r,0)}static endMap(t){return t.endObject()}static createMap(t,r){return e.startMap(t),e.addKeysSorted(t,r),e.endMap(t)}};var Qy=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsNull(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,r){return t.setPosition(t.position()+4),(r||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 Jy=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsStruct_(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,r){return t.setPosition(t.position()+4),(r||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 xc=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTime(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,r){return t.setPosition(t.position()+4),(r||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):cs.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,r){t.addFieldInt16(0,r,cs.MILLISECOND)}static addBitWidth(t,r){t.addFieldInt32(1,r,32)}static endTime(t){return t.endObject()}static createTime(t,r,n){return e.startTime(t),e.addUnit(t,r),e.addBitWidth(t,n),e.endTime(t)}};var _c=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTimestamp(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,r){return t.setPosition(t.position()+4),(r||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):cs.SECOND}timezone(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,r){t.addFieldInt16(0,r,cs.SECOND)}static addTimezone(t,r){t.addFieldOffset(1,r,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,r,n){return e.startTimestamp(t),e.addUnit(t,r),e.addTimezone(t,n),e.endTimestamp(t)}};var tg;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(tg||(tg={}));var ls=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUnion(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,r){return t.setPosition(t.position()+4),(r||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):tg.Sparse}typeIds(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readInt32(this.bb.__vector(this.bb_pos+r)+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,r){t.addFieldInt16(0,r,tg.Sparse)}static addTypeIds(t,r){t.addFieldOffset(1,r,0)}static createTypeIdsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addInt32(r[n]);return t.endVector()}static startTypeIdsVector(t,r){t.startVector(4,r,4)}static endUnion(t){return t.endObject()}static createUnion(t,r,n){return e.startUnion(t),e.addMode(t,r),e.addTypeIds(t,n),e.endUnion(t)}};var eg=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,r){return t.setPosition(t.position()+4),(r||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 Ye;(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"})(Ye||(Ye={}));var An=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsField(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}name(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,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):Ye.NONE}type(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(t,this.bb_pos+r):null}dictionary(t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new zs).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(t,r){let n=this.bb.__offset(this.bb_pos,14);return n?(r||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,r){let n=this.bb.__offset(this.bb_pos,16);return n?(r||new jr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,r){t.addFieldOffset(0,r,0)}static addNullable(t,r){t.addFieldInt8(1,+r,0)}static addTypeType(t,r){t.addFieldInt8(2,r,Ye.NONE)}static addType(t,r){t.addFieldOffset(3,r,0)}static addDictionary(t,r){t.addFieldOffset(4,r,0)}static addChildren(t,r){t.addFieldOffset(5,r,0)}static createChildrenVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startChildrenVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(6,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endField(t){return t.endObject()}};var xi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsSchema(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,r){return t.setPosition(t.position()+4),(r||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):$l.Little}fields(t,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new An).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new jr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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 r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+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,r){t.addFieldInt16(0,r,$l.Little)}static addFields(t,r){t.addFieldOffset(1,r,0)}static createFieldsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startFieldsVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(2,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static addFeatures(t,r){t.addFieldOffset(3,r,0)}static createFeaturesVector(t,r){t.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)t.addInt64(r[n]);return t.endVector()}static startFeaturesVector(t,r){t.startVector(8,r,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,r){t.finish(r)}static finishSizePrefixedSchemaBuffer(t,r){t.finish(r,void 0,!0)}static createSchema(t,r,n,i,o){return e.startSchema(t),e.addEndianness(t,r),e.addFields(t,n),e.addCustomMetadata(t,i),e.addFeatures(t,o),e.endSchema(t)}};var $i=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFooter(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,r){return t.setPosition(t.position()+4),(r||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):Pl.V1}schema(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new xi).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}dictionaries(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new xf).__init(this.bb.__vector(this.bb_pos+n)+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,r){let n=this.bb.__offset(this.bb_pos,10);return n?(r||new xf).__init(this.bb.__vector(this.bb_pos+n)+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,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new jr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,r){t.addFieldInt16(0,r,Pl.V1)}static addSchema(t,r){t.addFieldOffset(1,r,0)}static addDictionaries(t,r){t.addFieldOffset(2,r,0)}static startDictionariesVector(t,r){t.startVector(24,r,8)}static addRecordBatches(t,r){t.addFieldOffset(3,r,0)}static startRecordBatchesVector(t,r){t.startVector(24,r,8)}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,r){t.finish(r)}static finishSizePrefixedFooterBuffer(t,r){t.finish(r,void 0,!0)}};var Te=class e{constructor(t=[],r,n,i=er.V5){this.fields=t||[],this.metadata=r||new Map,n||(n=jE(t)),this.dictionaries=n,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,r)=>`${r}: ${t}`).join(", ")} }>`}select(t){let r=new Set(t),n=this.fields.filter(i=>r.has(i.name));return new e(n,this.metadata)}selectAt(t){let r=t.map(n=>this.fields[n]).filter(Boolean);return new e(r,this.metadata)}assign(...t){let r=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),n=[...this.fields],i=ww(ww(new Map,this.metadata),r.metadata),o=r.fields.filter(a=>{let c=n.findIndex(l=>l.name===a.name);return~c?(n[c]=a.clone({metadata:ww(ww(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),s=jE(o,new Map);return new e([...n,...o],i,new Map([...this.dictionaries,...s]))}};Te.prototype.fields=null;Te.prototype.metadata=null;Te.prototype.dictionaries=null;var ne=class e{static new(...t){let[r,n,i,o]=t;return t[0]&&typeof t[0]=="object"&&({name:r}=t[0],n===void 0&&(n=t[0].type),i===void 0&&(i=t[0].nullable),o===void 0&&(o=t[0].metadata)),new e(`${r}`,n,i,o)}constructor(t,r,n=!1,i){this.name=t,this.type=r,this.nullable=n,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[r,n,i,o]=t;return!t[0]||typeof t[0]!="object"?[r=this.name,n=this.type,i=this.nullable,o=this.metadata]=t:{name:r=this.name,type:n=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=t[0],e.new(r,n,i,o)}};ne.prototype.type=null;ne.prototype.name=null;ne.prototype.nullable=null;ne.prototype.metadata=null;function ww(e,t){return new Map([...e||new Map,...t||new Map])}function jE(e,t=new Map){for(let r=-1,n=e.length;++r<n;){let o=e[r].type;if(ht.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&&jE(o.children,t)}return t}var dJ=Lo,hJ=Ar,wc=class{static decode(t){t=new hJ(Xt(t));let r=$i.getRootAsFooter(t),n=Te.decode(r.schema(),new Map,r.version());return new qE(n,r)}static encode(t){let r=new dJ,n=Te.encode(r,t.schema);$i.startRecordBatchesVector(r,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())vc.encode(r,s);let i=r.endVector();$i.startDictionariesVector(r,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())vc.encode(r,s);let o=r.endVector();return $i.startFooter(r),$i.addSchema(r,n),$i.addVersion(r,er.V5),$i.addRecordBatches(r,i),$i.addDictionaries(r,o),$i.finishFooterBuffer(r,$i.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,r=er.V5,n,i){this.schema=t,this.version=r,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,r=-1,n=this.numRecordBatches;++r<n;)(t=this.getRecordBatch(r))&&(yield t)}*dictionaryBatches(){for(let t,r=-1,n=this.numDictionaries;++r<n;)(t=this.getDictionaryBatch(r))&&(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 qE=class extends wc{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,r){super(t,r.version()),this._footer=r}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let r=this._footer.recordBatches(t);if(r)return vc.decode(r)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let r=this._footer.dictionaries(t);if(r)return vc.decode(r)}return null}},vc=class e{static decode(t){return new e(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,r){let{metaDataLength:n}=r,i=BigInt(r.offset),o=BigInt(r.bodyLength);return xf.createBlock(t,i,n,o)}constructor(t,r,n){this.metaDataLength=t,this.offset=gi(n),this.bodyLength=gi(r)}};var We=Object.freeze({done:!0,value:void 0}),rg=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},_f=class{tee(){return this._getDOMStream().tee()}pipe(t,r){return this._getNodeStream().pipe(t,r)}pipeTo(t,r){return this._getDOMStream().pipeTo(t,r)}pipeThrough(t,r){return this._getDOMStream().pipeThrough(t,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},vw=class extends _f{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return P(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(We);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return ln.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return ln.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return P(this,void 0,void 0,function*(){return yield this.abort(t),We})}return(t){return P(this,void 0,void 0,function*(){return yield this.close(),We})}read(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return P(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((r,n)=>{this.resolvers.push({resolve:r,reject:n})}):Promise.resolve(We)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var js=class extends vw{write(t){if((t=Xt(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?ky(this.toUint8Array(!0)):this.toUint8Array(!1).then(ky)}toUint8Array(t=!1){return t?ki(this._values)[0]:P(this,void 0,void 0,function*(){var r,n,i,o;let s=[],a=0;try{for(var c=!0,l=fr(this),u;u=yield l.next(),r=u.done,!r;c=!0){o=u.value,c=!1;let f=o;s.push(f),a+=f.byteLength}}catch(f){n={error:f}}finally{try{!c&&!r&&(i=l.return)&&(yield i.call(l))}finally{if(n)throw n.error}}return ki(s,a)[0]})}},qs=class{constructor(t){t&&(this.source=new YE(ln.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)}},po=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof js?this.source=new Sc(ln.fromAsyncIterable(t)):k1(t)?this.source=new Sc(ln.fromNodeStream(t)):Cy(t)?this.source=new Sc(ln.fromDOMStream(t)):L1(t)?this.source=new Sc(ln.fromDOMStream(t.body)):Ko(t)?this.source=new Sc(ln.fromIterable(t)):Zo(t)?this.source=new Sc(ln.fromAsyncIterable(t)):uo(t)&&(this.source=new Sc(ln.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)}},YE=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,r="read"){return this.source.next({cmd:r,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||We)}return(t){return Object.create(this.source.return&&this.source.return(t)||We)}},Sc=class{constructor(t){this.source=t,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}cancel(t){return P(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,r="read"){return P(this,void 0,void 0,function*(){return yield this.source.next({cmd:r,size:t})})}throw(t){return P(this,void 0,void 0,function*(){let r=this.source.throw&&(yield this.source.throw(t))||We;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}return(t){return P(this,void 0,void 0,function*(){let r=this.source.return&&(yield this.source.return(t))||We;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}};var ng=class extends qs{constructor(t,r){super(),this.position=0,this.buffer=Xt(t),this.size=r===void 0?this.buffer.byteLength:r}readInt32(t){let{buffer:r,byteOffset:n}=this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:r,size:n,position:i}=this;return r&&i<n?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,i+Math.min(n-i,t)),r.subarray(i,this.position)):null}readAt(t,r){let n=this.buffer,i=Math.min(this.size,t+r);return n?n.subarray(t,i):new Uint8Array(r)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}},Xl=class extends po{constructor(t,r){super(),this.position=0,this._handle=t,typeof r=="number"?this.size=r:this._pending=P(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return P(this,void 0,void 0,function*(){let{buffer:r,byteOffset:n}=yield this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)})}seek(t){return P(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 P(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n,position:i}=this;if(r&&i<n){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=i,s=0,a=0,c=Math.min(n,o+Math.min(n-o,t)),l=new Uint8Array(Math.max(0,(this.position=c)-o));for(;(o+=a)<c&&(s+=a)<l.byteLength;)({bytesRead:a}=yield r.read(l,s,l.byteLength-s,o));return l}return null})}readAt(t,r){return P(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&t+r<i){let o=Math.min(i,t+r),s=new Uint8Array(o-t);return(yield n.read(s,0,r,t)).buffer}return new Uint8Array(r)})}close(){return P(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return P(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return P(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var GE={};Ir(GE,{BaseInt64:()=>ig,Int128:()=>og,Int64:()=>Ic,Uint64:()=>ar});function hh(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var ph=8,WE=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],ig=class{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let r=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),i=r[3]*n[3];this.buffer[0]=i&65535;let o=i>>>16;return i=r[2]*n[3],o+=i,i=r[3]*n[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]+=r[1]*n[3]+r[2]*n[2]+r[3]*n[1],this.buffer[1]+=r[0]*n[3]+r[1]*n[2]+r[2]*n[1]+r[3]*n[0]<<16,this}_plus(t){let r=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],r<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=r}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`${hh(this.buffer[1])} ${hh(this.buffer[0])}`}},ar=class e extends ig{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let n=t.length,i=new e(r);for(let o=0;o<n;){let s=ph<n-o?ph:n-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),c=new e(new Uint32Array([WE[s],0]));i.times(c),i.plus(a),o+=s}return i}static convertArray(t){let r=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},Ic=class e extends ig{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 r=this.buffer[1]<<0,n=t.buffer[1]<<0;return r<n||r===n&&this.buffer[0]<t.buffer[0]}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let n=t.startsWith("-"),i=t.length,o=new e(r);for(let s=n?1:0;s<i;){let a=ph<i-s?ph:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),l=new e(new Uint32Array([WE[a],0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},og=class e{constructor(t){this.buffer=t}high(){return new Ic(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Ic(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 r=new ar(new Uint32Array([this.buffer[3],0])),n=new ar(new Uint32Array([this.buffer[2],0])),i=new ar(new Uint32Array([this.buffer[1],0])),o=new ar(new Uint32Array([this.buffer[0],0])),s=new ar(new Uint32Array([t.buffer[3],0])),a=new ar(new Uint32Array([t.buffer[2],0])),c=new ar(new Uint32Array([t.buffer[1],0])),l=new ar(new Uint32Array([t.buffer[0],0])),u=ar.multiply(o,l);this.buffer[0]=u.low();let f=new ar(new Uint32Array([u.high(),0]));return u=ar.multiply(i,l),f.plus(u),u=ar.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 ar(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(ar.multiply(n,l)).plus(ar.multiply(i,c)).plus(ar.multiply(o,a)),this.buffer[3]+=ar.multiply(r,l).plus(ar.multiply(n,c)).plus(ar.multiply(i,a)).plus(ar.multiply(o,s)).low(),this}plus(t){let r=new Uint32Array(4);return r[3]=this.buffer[3]+t.buffer[3]>>>0,r[2]=this.buffer[2]+t.buffer[2]>>>0,r[1]=this.buffer[1]+t.buffer[1]>>>0,r[0]=this.buffer[0]+t.buffer[0]>>>0,r[0]<this.buffer[0]>>>0&&++r[1],r[1]<this.buffer[1]>>>0&&++r[2],r[2]<this.buffer[2]>>>0&&++r[3],this.buffer[3]=r[3],this.buffer[2]=r[2],this.buffer[1]=r[1],this.buffer[0]=r[0],this}hex(){return`${hh(this.buffer[3])} ${hh(this.buffer[2])} ${hh(this.buffer[1])} ${hh(this.buffer[0])}`}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}static from(t,r=new Uint32Array(4)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(4)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(4)){let n=t.startsWith("-"),i=t.length,o=new e(r);for(let s=n?1:0;s<i;){let a=ph<i-s?ph:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),l=new e(new Uint32Array([WE[a],0,0,0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*4);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+4*4*n,4));return r}};var sg=class extends mt{constructor(t,r,n,i,o=er.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=r,this.buffers=n,this.dictionaries=i,this.metadataVersion=o}visit(t){return super.visit(t instanceof ne?t.type:t)}visitNull(t,{length:r}=this.nextFieldNode()){return Ht({type:t,length:r})}visitBool(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),children:this.visitMany(t.children)})}visitUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<er.V5&&this.readNullBitmap(t,n),t.mode===je.Sparse?this.visitSparseUnion(t,{length:r,nullCount:n}):this.visitDenseUnion(t,{length:r,nullCount:n})}visitDenseUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDuration(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),child:this.visit(t.children[0])})}visitMap(t,{length:r,nullCount:n}=this.nextFieldNode()){return Ht({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,r,n=this.nextBufferRange()){return r>0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,r){return this.readData(t,r)}readTypeIds(t,r){return this.readData(t,r)}readData(t,{length:r,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+r)}readDictionary(t){return this.dictionaries.get(t.id)}},Sw=class extends sg{constructor(t,r,n,i,o){super(new Uint8Array(0),r,n,i,o),this.sources=t}readNullBitmap(t,r,{offset:n}=this.nextBufferRange()){return r<=0?new Uint8Array(0):gf(this.sources[n])}readOffsets(t,{offset:r}=this.nextBufferRange()){return ee(Uint8Array,ee(Int32Array,this.sources[r]))}readTypeIds(t,{offset:r}=this.nextBufferRange()){return ee(Uint8Array,ee(t.ArrayType,this.sources[r]))}readData(t,{offset:r}=this.nextBufferRange()){let{sources:n}=this;return ht.isTimestamp(t)?ee(Uint8Array,Ic.convertArray(n[r])):(ht.isInt(t)||ht.isTime(t))&&t.bitWidth===64||ht.isDuration(t)?ee(Uint8Array,Ic.convertArray(n[r])):ht.isDate(t)&&t.unit===un.MILLISECOND?ee(Uint8Array,Ic.convertArray(n[r])):ht.isDecimal(t)?ee(Uint8Array,og.convertArray(n[r])):ht.isBinary(t)||ht.isFixedSizeBinary(t)?pJ(n[r]):ht.isBool(t)?gf(n[r]):ht.isUtf8(t)?Fl(n[r].join("")):ee(Uint8Array,ee(t.ArrayType,n[r].map(i=>+i)))}};function pJ(e){let t=e.join(""),r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n>>1]=Number.parseInt(t.slice(n,n+2),16);return r}var mh=class extends $s{constructor(t){super(t),this._values=new Ul(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,r){return super.setValue(t,Xt(r))}_flushPending(t,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)n.set(s,0);else{let c=a.length;i.set(a,o),n.set(s,c),o+=c}}};var Iw=class extends He{constructor(t){super(t),this._values=new fh}setValue(t,r){this._values.set(t,+r)}};var wf=class extends Br{};wf.prototype._setValue=AE;var ag=class extends wf{};ag.prototype._setValue=Z1;var cg=class extends wf{};cg.prototype._setValue=K1;var lg=class extends Br{};lg.prototype._setValue=DE;var Tw=class extends He{constructor({type:t,nullValues:r,dictionaryHashFunction:n}){super({type:new Ci(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=vf({type:this.type.indices,nullValues:r}),this.dictionary=vf({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}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,r){let n=this.indices;return r=n.setValid(t,r),this.length=n.length,r}setValue(t,r){let n=this._keysToIndices,i=this.valueToKey(r),o=n[i];return o===void 0&&(n[i]=o=this._dictionaryOffset+this.dictionary.append(r).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,r=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=r?r.concat(n):n,this.finished||(this._dictionaryOffset+=n.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 ug=class extends Br{};ug.prototype._setValue=TE;var Aw=class extends He{setValue(t,r){let[n]=this.children,i=t*this.stride;for(let o=-1,s=r.length;++o<s;)n.set(i+o,r[o])}addChild(t,r="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(t);return this.type=new is(this.type.listSize,new ne(r,t.type,!0)),n}};var Sf=class extends Br{setValue(t,r){this._values.set(t,r)}},Mw=class extends Sf{setValue(t,r){super.setValue(t,$y(r))}},Ew=class extends Sf{},Dw=class extends Sf{};var If=class extends Br{};If.prototype._setValue=BE;var fg=class extends If{};fg.prototype._setValue=sw;var dg=class extends If{};dg.prototype._setValue=aw;var Tc=class extends Br{};Tc.prototype._setValue=OE;var hg=class extends Tc{};hg.prototype._setValue=cw;var pg=class extends Tc{};pg.prototype._setValue=lw;var mg=class extends Tc{};mg.prototype._setValue=uw;var yg=class extends Tc{};yg.prototype._setValue=fw;var mo=class extends Br{setValue(t,r){this._values.set(t,r)}},Bw=class extends mo{},Ow=class extends mo{},Nw=class extends mo{},Fw=class extends mo{},Lw=class extends mo{},Rw=class extends mo{},kw=class extends mo{},Cw=class extends mo{};var Uw=class extends $s{constructor(t){super(t),this._offsets=new dh}addChild(t,r="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new rs(new ne(r,t.type,!0)),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(typeof o>"u")r.set(i,0);else{let s=o,a=s.length,c=r.set(i,a).buffer[i];for(let l=-1;++l<a;)n.set(c+l,s[l])}}};var Pw=class extends $s{set(t,r){return super.set(t,r)}setValue(t,r){let n=r instanceof Map?r:new Map(Object.entries(r)),i=this._pending||(this._pending=new Map),o=i.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=n.size,i.set(t,n)}addChild(t,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new os(new ne(r,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(o===void 0)r.set(i,0);else{let{[i]:s,[i+1]:a}=r.set(i,o.size).buffer;for(let c of o.entries())if(n.set(s,c),++s>=a)break}}};var $w=class extends He{setValue(t,r){}setValid(t,r){return this.length=Math.max(t+1,this.length),r}};var zw=class extends He{setValue(t,r){let{children:n,type:i}=this;switch(Array.isArray(r)||r.constructor){case!0:return i.children.forEach((o,s)=>n[s].set(t,r[s]));case Map:return i.children.forEach((o,s)=>n[s].set(t,r.get(o.name)));default:return i.children.forEach((o,s)=>n[s].set(t,r[o.name]))}}setValid(t,r){return super.setValid(t,r)||this.children.forEach(n=>n.setValid(t,r)),r}addChild(t,r=`${this.numChildren}`){let n=this.children.push(t);return this.type=new qe([...this.type.children,new ne(r,t.type,!0)]),n}};var Ac=class extends Br{};Ac.prototype._setValue=ME;var gg=class extends Ac{};gg.prototype._setValue=Q1;var bg=class extends Ac{};bg.prototype._setValue=J1;var xg=class extends Ac{};xg.prototype._setValue=tw;var _g=class extends Ac{};_g.prototype._setValue=ew;var Mc=class extends Br{};Mc.prototype._setValue=EE;var wg=class extends Mc{};wg.prototype._setValue=rw;var vg=class extends Mc{};vg.prototype._setValue=nw;var Sg=class extends Mc{};Sg.prototype._setValue=iw;var Ig=class extends Mc{};Ig.prototype._setValue=ow;var yh=class extends He{constructor(t){super(t),this._typeIds=new bc(new Int8Array(0),1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,r){return this.set(this.length,t,r)}set(t,r,n){return n===void 0&&(n=this._valueToChildTypeId(this,r,t)),this.setValue(t,r,n),this}setValue(t,r,n){this._typeIds.set(t,n);let i=this.type.typeIdToChildIndex[n],o=this.children[i];o?.set(t,r)}addChild(t,r=`${this.children.length}`){let n=this.children.push(t),{type:{children:i,mode:o,typeIds:s}}=this,a=[...i,new ne(r,t.type)];return this.type=new ns(o,[...s,n],a),n}_valueToChildTypeId(t,r,n){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.")}},Vw=class extends yh{},jw=class extends yh{constructor(t){super(t),this._offsets=new bc(new Int32Array(0))}setValue(t,r,n){let i=this._typeIds.set(t,n).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[i]),s=this._offsets.set(t,o.length).buffer[t];o?.set(s,r)}};var Tg=class extends $s{constructor(t){super(t),this._values=new Ul(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,r){return super.setValue(t,Fl(r))}_flushPending(t,r){}};Tg.prototype._flushPending=mh.prototype._flushPending;var XE=class extends mt{visitNull(){return $w}visitBool(){return Iw}visitInt(){return mo}visitInt8(){return Bw}visitInt16(){return Ow}visitInt32(){return Nw}visitInt64(){return Fw}visitUint8(){return Lw}visitUint16(){return Rw}visitUint32(){return kw}visitUint64(){return Cw}visitFloat(){return Sf}visitFloat16(){return Mw}visitFloat32(){return Ew}visitFloat64(){return Dw}visitUtf8(){return Tg}visitBinary(){return mh}visitFixedSizeBinary(){return ug}visitDate(){return wf}visitDateDay(){return ag}visitDateMillisecond(){return cg}visitTimestamp(){return Ac}visitTimestampSecond(){return gg}visitTimestampMillisecond(){return bg}visitTimestampMicrosecond(){return xg}visitTimestampNanosecond(){return _g}visitTime(){return Mc}visitTimeSecond(){return wg}visitTimeMillisecond(){return vg}visitTimeMicrosecond(){return Sg}visitTimeNanosecond(){return Ig}visitDecimal(){return lg}visitList(){return Uw}visitStruct(){return zw}visitUnion(){return yh}visitDenseUnion(){return jw}visitSparseUnion(){return Vw}visitDictionary(){return Tw}visitInterval(){return If}visitIntervalDayTime(){return fg}visitIntervalYearMonth(){return dg}visitDuration(){return Tc}visitDurationSecond(){return hg}visitDurationMillisecond(){return pg}visitDurationMicrosecond(){return mg}visistDurationNanosecond(){return yg}visitFixedSizeList(){return Aw}visitMap(){return Pw}},L5=new XE;var Nt=class extends mt{compareSchemas(t,r){return t===r||r instanceof t.constructor&&this.compareManyFields(t.fields,r.fields)}compareManyFields(t,r){return t===r||Array.isArray(t)&&Array.isArray(r)&&t.length===r.length&&t.every((n,i)=>this.compareFields(n,r[i]))}compareFields(t,r){return t===r||r instanceof t.constructor&&t.name===r.name&&t.nullable===r.nullable&&this.visit(t.type,r.type)}};function qn(e,t){return t instanceof e.constructor}function Ag(e,t){return e===t||qn(e,t)}function Ec(e,t){return e===t||qn(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function qw(e,t){return e===t||qn(e,t)&&e.precision===t.precision}function mJ(e,t){return e===t||qn(e,t)&&e.byteWidth===t.byteWidth}function HE(e,t){return e===t||qn(e,t)&&e.unit===t.unit}function Mg(e,t){return e===t||qn(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Eg(e,t){return e===t||qn(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function yJ(e,t){return e===t||qn(e,t)&&e.children.length===t.children.length&&Ys.compareManyFields(e.children,t.children)}function gJ(e,t){return e===t||qn(e,t)&&e.children.length===t.children.length&&Ys.compareManyFields(e.children,t.children)}function ZE(e,t){return e===t||qn(e,t)&&e.mode===t.mode&&e.typeIds.every((r,n)=>r===t.typeIds[n])&&Ys.compareManyFields(e.children,t.children)}function bJ(e,t){return e===t||qn(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Ys.visit(e.indices,t.indices)&&Ys.visit(e.dictionary,t.dictionary)}function KE(e,t){return e===t||qn(e,t)&&e.unit===t.unit}function Dg(e,t){return e===t||qn(e,t)&&e.unit===t.unit}function xJ(e,t){return e===t||qn(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Ys.compareManyFields(e.children,t.children)}function _J(e,t){return e===t||qn(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Ys.compareManyFields(e.children,t.children)}Nt.prototype.visitNull=Ag;Nt.prototype.visitBool=Ag;Nt.prototype.visitInt=Ec;Nt.prototype.visitInt8=Ec;Nt.prototype.visitInt16=Ec;Nt.prototype.visitInt32=Ec;Nt.prototype.visitInt64=Ec;Nt.prototype.visitUint8=Ec;Nt.prototype.visitUint16=Ec;Nt.prototype.visitUint32=Ec;Nt.prototype.visitUint64=Ec;Nt.prototype.visitFloat=qw;Nt.prototype.visitFloat16=qw;Nt.prototype.visitFloat32=qw;Nt.prototype.visitFloat64=qw;Nt.prototype.visitUtf8=Ag;Nt.prototype.visitBinary=Ag;Nt.prototype.visitFixedSizeBinary=mJ;Nt.prototype.visitDate=HE;Nt.prototype.visitDateDay=HE;Nt.prototype.visitDateMillisecond=HE;Nt.prototype.visitTimestamp=Mg;Nt.prototype.visitTimestampSecond=Mg;Nt.prototype.visitTimestampMillisecond=Mg;Nt.prototype.visitTimestampMicrosecond=Mg;Nt.prototype.visitTimestampNanosecond=Mg;Nt.prototype.visitTime=Eg;Nt.prototype.visitTimeSecond=Eg;Nt.prototype.visitTimeMillisecond=Eg;Nt.prototype.visitTimeMicrosecond=Eg;Nt.prototype.visitTimeNanosecond=Eg;Nt.prototype.visitDecimal=Ag;Nt.prototype.visitList=yJ;Nt.prototype.visitStruct=gJ;Nt.prototype.visitUnion=ZE;Nt.prototype.visitDenseUnion=ZE;Nt.prototype.visitSparseUnion=ZE;Nt.prototype.visitDictionary=bJ;Nt.prototype.visitInterval=KE;Nt.prototype.visitIntervalDayTime=KE;Nt.prototype.visitIntervalYearMonth=KE;Nt.prototype.visitDuration=Dg;Nt.prototype.visitDurationSecond=Dg;Nt.prototype.visitDurationMillisecond=Dg;Nt.prototype.visitDurationMicrosecond=Dg;Nt.prototype.visitDurationNanosecond=Dg;Nt.prototype.visitFixedSizeList=xJ;Nt.prototype.visitMap=_J;var Ys=new Nt;function Tf(e,t){return Ys.compareSchemas(e,t)}function R5(e,t){return Ys.compareFields(e,t)}function k5(e,t){return Ys.visit(e,t)}function vf(e){let t=e.type,r=new(L5.getVisitFn(t)())(e);if(t.children&&t.children.length>0){let n=e.children||[],i={nullValues:e.nullValues},o=Array.isArray(n)?(s,a)=>n[a]||i:({name:s})=>n[s]||i;for(let[s,a]of t.children.entries()){let{type:c}=a,l=o(a,s);r.children.push(vf(Object.assign(Object.assign({},l),{type:c})))}}return r}function Yw(e,t){return wJ(e,t.map(r=>r.data.concat()))}function wJ(e,t){let r=[...e.fields],n=[],i={numBatches:t.reduce((f,d)=>Math.max(f,d.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=vJ(r,s,u,t,i),s>0&&(n[o++]=Ht({type:new qe(r),length:s,nullCount:0,children:u.slice()})))}return[e=e.assign(r),n.map(f=>new hr(e,f))]}function vJ(e,t,r,n,i){var o;let s=(t+63&-64)>>3;for(let a=-1,c=n.length;++a<c;){let l=r[a],u=l?.length;if(u>=t)u===t?r[a]=l:(r[a]=l.slice(0,t),i.numBatches=Math.max(i.numBatches,n[a].unshift(l.slice(t,u-t))));else{let f=e[a];e[a]=f.clone({nullable:!0}),r[a]=(o=l?._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:Ht({type:f.type,length:t,nullCount:t,nullBitmap:new Uint8Array(s)})}}return r}var C5,Yn=class e{constructor(...t){var r,n;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 hr)return[c];if(c instanceof e)return c.batches;if(c instanceof De){if(c.type instanceof qe)return[new hr(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(h=>new ue([c[h]])),f=new Te(l.map((h,p)=>new ne(String(h),u[p].type))),[,d]=Yw(f,u);return d.length===0?[new hr(c)]:d}}}return[]},a=t.flatMap(c=>s(c));if(i=(n=i??((r=a[0])===null||r===void 0?void 0:r.schema))!==null&&n!==void 0?n:new Te([]),!(i instanceof Te))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof hr))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Tf(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??yw(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,r)=>t+r.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=mw(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,r){}indexOf(t,r){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?uh.visit(new ue(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
|
|
18
|
+
${this.toArray().join(`,
|
|
19
|
+
`)}
|
|
20
|
+
]`}concat(...t){let r=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new e(r,n.map(i=>new hr(r,i)))}slice(t,r){let n=this.schema;[t,r]=zy({length:this.numRows},t,r);let i=gw(this.data,this._offsets,t,r);return new e(n,i.map(o=>new hr(n,o)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){let r=this.data.map(n=>n.children[t]);if(r.length===0){let{type:n}=this.schema.fields[t],i=Ht({type:n,length:0,nullCount:0});r.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new ue(r)}return null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),r)}setChildAt(t,r){let n=this.schema,i=[...this.batches];if(t>-1&&t<this.numCols){r||(r=new ue([Ht({type:new jn,length:this.numRows})]));let o=n.fields.slice(),s=o[t].clone({type:r.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[o[t],a[t]]=[s,r],[n,i]=Yw(n,a)}return new e(n,i)}select(t){let r=this.schema.fields.reduce((n,i,o)=>n.set(i.name,o),new Map);return this.selectAt(t.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(t){let r=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new e(r,n)}assign(t){let r=this.schema.fields,[n,i]=t.schema.fields.reduce((a,c,l)=>{let[u,f]=a,d=r.findIndex(h=>h.name===c.name);return~d?f[d]=l:u.push(l),a},[[],[]]),o=this.schema.assign(t.schema),s=[...r.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new e(...Yw(o,s))}};C5=Symbol.toStringTag;Yn[C5]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=Cl(qy),e.get=Cl(Dr.getVisitFn(N.Struct)),e.set=bw(fn.getVisitFn(N.Struct)),e.indexOf=xw(bf.getVisitFn(N.Struct)),e.getByteLength=Cl(Pi.getVisitFn(N.Struct)),"Table"))(Yn.prototype);var P5,hr=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=Ht({nullCount:0,type:new qe(this.schema.fields),children:this.schema.fields.map(r=>Ht({type:r.type,nullCount:0}))})]=t,!(this.data instanceof De))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=U5(this.schema,this.data.children);break}case 1:{let[r]=t,{fields:n,children:i,length:o}=Object.keys(r).reduce((c,l,u)=>(c.children[u]=r[l],c.length=Math.max(c.length,r[l].length),c.fields[u]=ne.new({name:l,type:r[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),s=new Te(n),a=Ht({type:new qe(n),length:o,children:i,nullCount:0});[this.schema,this.data]=U5(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=$5(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 Dr.visit(this.data,t)}set(t,r){return fn.visit(this.data,t,r)}indexOf(t,r){return bf.visit(this.data,t,r)}getByteLength(t){return Pi.visit(this.data,t)}[Symbol.iterator](){return uh.visit(new ue([this.data]))}toArray(){return[...this]}concat(...t){return new Yn(this.schema,[this,...t])}slice(t,r){let[n]=new ue([this.data]).slice(t,r).data;return new e(this.schema,n)}getChild(t){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new ue([this.data.children[t]]):null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),r)}setChildAt(t,r){let n=this.schema,i=this.data;if(t>-1&&t<this.numCols){r||(r=new ue([Ht({type:new jn,length:this.numRows})]));let o=n.fields.slice(),s=i.children.slice(),a=o[t].clone({type:r.type});[o[t],s[t]]=[a,r.data[0]],n=new Te(o,new Map(this.schema.metadata)),i=Ht({type:new qe(o),children:s})}return new e(n,i)}select(t){let r=this.schema.select(t),n=new qe(r.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(r,Ht({type:n,length:this.numRows,children:i}))}selectAt(t){let r=this.schema.selectAt(t),n=t.map(o=>this.data.children[o]).filter(Boolean),i=Ht({type:new qe(r.fields),length:this.numRows,children:n});return new e(r,i)}};P5=Symbol.toStringTag;hr[P5]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(hr.prototype);function U5(e,t,r=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;let i=[...e.fields],o=[...t],s=(r+63&-64)>>3;for(let[a,c]of e.fields.entries()){let l=t[a];(!l||l.length!==r)&&(i[a]=c.clone({nullable:!0}),o[a]=(n=l?._changeLengthAndBackfillNullBitmap(r))!==null&&n!==void 0?n:Ht({type:c.type,length:r,nullCount:r,nullBitmap:new Uint8Array(s)}))}return[e.assign(i),Ht({type:new qe(i),length:r,children:o})]}function $5(e,t,r=new Map){var n,i;if(((n=e?.length)!==null&&n!==void 0?n: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)||[]])$5(a.children,l?.children,r);if(ht.isDictionary(a)){let{id:l}=a;if(!r.has(l))c?.dictionary&&r.set(l,c.dictionary);else if(r.get(l)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return r}var Af=class extends hr{constructor(t){let r=t.fields.map(i=>Ht({type:i.type})),n=Ht({type:new qe(t.fields),nullCount:0,children:r});super(t,n)}};var Bg;(function(e){e[e.BUFFER=0]="BUFFER"})(Bg||(Bg={}));var Og;(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(Og||(Og={}));var Ww=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBodyCompression(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,r){return t.setPosition(t.position()+4),(r||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):Og.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Bg.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,r){t.addFieldInt8(0,r,Og.LZ4_FRAME)}static addMethod(t,r){t.addFieldInt8(1,r,Bg.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,r,n){return e.startBodyCompression(t),e.addCodec(t,r),e.addMethod(t,n),e.endBodyCompression(t)}};var gh=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,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,r,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(r??0)),t.offset()}};var bh=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,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,r,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(r??0)),t.offset()}};var zi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsRecordBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,r){return t.setPosition(t.position()+4),(r||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,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new bh).__init(this.bb.__vector(this.bb_pos+n)+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,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new gh).__init(this.bb.__vector(this.bb_pos+n)+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 r=this.bb.__offset(this.bb_pos,10);return r?(t||new Ww).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addNodes(t,r){t.addFieldOffset(1,r,0)}static startNodesVector(t,r){t.startVector(16,r,8)}static addBuffers(t,r){t.addFieldOffset(2,r,0)}static startBuffersVector(t,r){t.startVector(16,r,8)}static addCompression(t,r){t.addFieldOffset(3,r,0)}static endRecordBatch(t){return t.endObject()}};var Dc=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,r){return t.setPosition(t.position()+4),(r||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 r=this.bb.__offset(this.bb_pos,6);return r?(t||new zi).__init(this.bb.__indirect(this.bb_pos+r),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,r){t.addFieldInt64(0,r,BigInt("0"))}static addData(t,r){t.addFieldOffset(1,r,0)}static addIsDelta(t,r){t.addFieldInt8(2,+r,0)}static endDictionaryBatch(t){return t.endObject()}};var xh;(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"})(xh||(xh={}));var us=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMessage(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,r){return t.setPosition(t.position()+4),(r||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):Pl.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):xh.NONE}header(t){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__union(t,this.bb_pos+r):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new jr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,r){t.addFieldInt16(0,r,Pl.V1)}static addHeaderType(t,r){t.addFieldInt8(1,r,xh.NONE)}static addHeader(t,r){t.addFieldOffset(2,r,0)}static addBodyLength(t,r){t.addFieldInt64(3,r,BigInt("0"))}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,r){t.finish(r)}static finishSizePrefixedMessageBuffer(t,r){t.finish(r,void 0,!0)}static createMessage(t,r,n,i,o,s){return e.startMessage(t),e.addVersion(t,r),e.addHeaderType(t,n),e.addHeader(t,i),e.addBodyLength(t,o),e.addCustomMetadata(t,s),e.endMessage(t)}};var QE=class extends mt{visit(t,r){return t==null||r==null?void 0:super.visit(t,r)}visitNull(t,r){return Qy.startNull(r),Qy.endNull(r)}visitInt(t,r){return as.startInt(r),as.addBitWidth(r,t.bitWidth),as.addIsSigned(r,t.isSigned),as.endInt(r)}visitFloat(t,r){return Yl.startFloatingPoint(r),Yl.addPrecision(r,t.precision),Yl.endFloatingPoint(r)}visitBinary(t,r){return Wy.startBinary(r),Wy.endBinary(r)}visitBool(t,r){return Gy.startBool(r),Gy.endBool(r)}visitUtf8(t,r){return eg.startUtf8(r),eg.endUtf8(r)}visitDecimal(t,r){return Vs.startDecimal(r),Vs.addScale(r,t.scale),Vs.addPrecision(r,t.precision),Vs.addBitWidth(r,t.bitWidth),Vs.endDecimal(r)}visitDate(t,r){return zl.startDate(r),zl.addUnit(r,t.unit),zl.endDate(r)}visitTime(t,r){return xc.startTime(r),xc.addUnit(r,t.unit),xc.addBitWidth(r,t.bitWidth),xc.endTime(r)}visitTimestamp(t,r){let n=t.timezone&&r.createString(t.timezone)||void 0;return _c.startTimestamp(r),_c.addUnit(r,t.unit),n!==void 0&&_c.addTimezone(r,n),_c.endTimestamp(r)}visitInterval(t,r){return Wl.startInterval(r),Wl.addUnit(r,t.unit),Wl.endInterval(r)}visitDuration(t,r){return Vl.startDuration(r),Vl.addUnit(r,t.unit),Vl.endDuration(r)}visitList(t,r){return Ky.startList(r),Ky.endList(r)}visitStruct(t,r){return Jy.startStruct_(r),Jy.endStruct_(r)}visitUnion(t,r){ls.startTypeIdsVector(r,t.typeIds.length);let n=ls.createTypeIdsVector(r,t.typeIds);return ls.startUnion(r),ls.addMode(r,t.mode),ls.addTypeIds(r,n),ls.endUnion(r)}visitDictionary(t,r){let n=this.visit(t.indices,r);return zs.startDictionaryEncoding(r),zs.addId(r,BigInt(t.id)),zs.addIsOrdered(r,t.isOrdered),n!==void 0&&zs.addIndexType(r,n),zs.endDictionaryEncoding(r)}visitFixedSizeBinary(t,r){return jl.startFixedSizeBinary(r),jl.addByteWidth(r,t.byteWidth),jl.endFixedSizeBinary(r)}visitFixedSizeList(t,r){return ql.startFixedSizeList(r),ql.addListSize(r,t.listSize),ql.endFixedSizeList(r)}visitMap(t,r){return Gl.startMap(r),Gl.addKeysSorted(r,t.keysSorted),Gl.endMap(r)}},Gw=new QE;function q5(e,t=new Map){return new Te(IJ(e,t),Xw(e.metadata),t)}function JE(e){return new dn(e.count,W5(e.columns),G5(e.columns))}function Y5(e){return new wi(JE(e.data),e.id,e.isDelta)}function IJ(e,t){return(e.fields||[]).filter(Boolean).map(r=>ne.fromJSON(r,t))}function z5(e,t){return(e.children||[]).filter(Boolean).map(r=>ne.fromJSON(r,t))}function W5(e){return(e||[]).reduce((t,r)=>[...t,new yo(r.count,TJ(r.VALIDITY)),...W5(r.children)],[])}function G5(e,t=[]){for(let r=-1,n=(e||[]).length;++r<n;){let i=e[r];i.VALIDITY&&t.push(new _i(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new _i(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new _i(t.length,i.OFFSET.length)),i.DATA&&t.push(new _i(t.length,i.DATA.length)),t=G5(i.children,t)}return t}function TJ(e){return(e||[]).reduce((t,r)=>t+ +(r===0),0)}function X5(e,t){let r,n,i,o,s,a;return!t||!(o=e.dictionary)?(s=j5(e,z5(e,t)),i=new ne(e.name,s,e.nullable,Xw(e.metadata))):t.has(r=o.id)?(n=(n=o.indexType)?V5(n):new Cs,a=new Ci(t.get(r),n,r,o.isOrdered),i=new ne(e.name,a,e.nullable,Xw(e.metadata))):(n=(n=o.indexType)?V5(n):new Cs,t.set(r,s=j5(e,z5(e,t))),a=new Ci(s,n,r,o.isOrdered),i=new ne(e.name,a,e.nullable,Xw(e.metadata))),i||null}function Xw(e=[]){return new Map(e.map(({key:t,value:r})=>[t,r]))}function V5(e){return new xr(e.isSigned,e.bitWidth)}function j5(e,t){let r=e.type.name;switch(r){case"NONE":return new jn;case"null":return new jn;case"binary":return new cc;case"utf8":return new lc;case"bool":return new uc;case"list":return new rs((t||[])[0]);case"struct":return new qe(t||[]);case"struct_":return new qe(t||[])}switch(r){case"int":{let n=e.type;return new xr(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=e.type;return new bi(Xe[n.precision])}case"decimal":{let n=e.type;return new fc(n.scale,n.precision,n.bitWidth)}case"date":{let n=e.type;return new dc(un[n.unit])}case"time":{let n=e.type;return new es(It[n.unit],n.bitWidth)}case"timestamp":{let n=e.type;return new hc(It[n.unit],n.timezone)}case"interval":{let n=e.type;return new pc(Vn[n.unit])}case"duration":{let n=e.type;return new mc(It[n.unit])}case"union":{let n=e.type,[i,...o]=(n.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new ns(je[s],n.typeIds||[],t||[])}case"fixedsizebinary":{let n=e.type;return new yc(n.byteWidth)}case"fixedsizelist":{let n=e.type;return new is(n.listSize,(t||[])[0])}case"map":{let n=e.type;return new os((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}var AJ=Lo,MJ=Ar,vi=class e{static fromJSON(t,r){let n=new e(0,er.V5,r);return n._createHeader=EJ(t,r),n}static decode(t){t=new MJ(Xt(t));let r=us.getRootAsMessage(t),n=r.bodyLength(),i=r.version(),o=r.headerType(),s=new e(n,i,o);return s._createHeader=DJ(r,o),s}static encode(t){let r=new AJ,n=-1;return t.isSchema()?n=Te.encode(r,t.header()):t.isRecordBatch()?n=dn.encode(r,t.header()):t.isDictionaryBatch()&&(n=wi.encode(r,t.header())),us.startMessage(r),us.addVersion(r,er.V5),us.addHeader(r,n),us.addHeaderType(r,t.headerType),us.addBodyLength(r,BigInt(t.bodyLength)),us.finishMessageBuffer(r,us.endMessage(r)),r.asUint8Array()}static from(t,r=0){if(t instanceof Te)return new e(0,er.V5,ge.Schema,t);if(t instanceof dn)return new e(r,er.V5,ge.RecordBatch,t);if(t instanceof wi)return new e(r,er.V5,ge.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===ge.Schema}isRecordBatch(){return this.headerType===ge.RecordBatch}isDictionaryBatch(){return this.headerType===ge.DictionaryBatch}constructor(t,r,n,i){this._version=r,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=gi(t)}},dn=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,r,n){this._nodes=r,this._buffers=n,this._length=gi(t)}},wi=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,r,n=!1){this._data=t,this._isDelta=n,this._id=gi(r)}},_i=class{constructor(t,r){this.offset=gi(t),this.length=gi(r)}},yo=class{constructor(t,r){this.length=gi(t),this.nullCount=gi(r)}};function EJ(e,t){return()=>{switch(t){case ge.Schema:return Te.fromJSON(e);case ge.RecordBatch:return dn.fromJSON(e);case ge.DictionaryBatch:return wi.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${ge[t]}, type: ${t} }`)}}function DJ(e,t){return()=>{switch(t){case ge.Schema:return Te.decode(e.header(new xi),new Map,e.version());case ge.RecordBatch:return dn.decode(e.header(new zi),e.version());case ge.DictionaryBatch:return wi.decode(e.header(new Dc),e.version())}throw new Error(`Unrecognized Message type: { name: ${ge[t]}, type: ${t} }`)}}ne.encode=$J;ne.decode=UJ;ne.fromJSON=X5;Te.encode=PJ;Te.decode=BJ;Te.fromJSON=q5;dn.encode=zJ;dn.decode=OJ;dn.fromJSON=JE;wi.encode=VJ;wi.decode=NJ;wi.fromJSON=Y5;yo.encode=jJ;yo.decode=LJ;_i.encode=qJ;_i.decode=FJ;function BJ(e,t=new Map,r=er.V5){let n=CJ(e,t);return new Te(n,Hw(e),t,r)}function OJ(e,t=er.V5){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new dn(e.length(),RJ(e),kJ(e,t))}function NJ(e,t=er.V5){return new wi(dn.decode(e.data(),t),e.id(),e.isDelta())}function FJ(e){return new _i(e.offset(),e.length())}function LJ(e){return new yo(e.length(),e.nullCount())}function RJ(e){let t=[];for(let r,n=-1,i=-1,o=e.nodesLength();++n<o;)(r=e.nodes(n))&&(t[++i]=yo.decode(r));return t}function kJ(e,t){let r=[];for(let n,i=-1,o=-1,s=e.buffersLength();++i<s;)(n=e.buffers(i))&&(t<er.V4&&(n.bb_pos+=8*(i+1)),r[++o]=_i.decode(n));return r}function CJ(e,t){let r=[];for(let n,i=-1,o=-1,s=e.fieldsLength();++i<s;)(n=e.fields(i))&&(r[++o]=ne.decode(n,t));return r}function H5(e,t){let r=[];for(let n,i=-1,o=-1,s=e.childrenLength();++i<s;)(n=e.children(i))&&(r[++o]=ne.decode(n,t));return r}function UJ(e,t){let r,n,i,o,s,a;return!t||!(a=e.dictionary())?(i=K5(e,H5(e,t)),n=new ne(e.name(),i,e.nullable(),Hw(e))):t.has(r=gi(a.id()))?(o=(o=a.indexType())?Z5(o):new Cs,s=new Ci(t.get(r),o,r,a.isOrdered()),n=new ne(e.name(),s,e.nullable(),Hw(e))):(o=(o=a.indexType())?Z5(o):new Cs,t.set(r,i=K5(e,H5(e,t))),s=new Ci(i,o,r,a.isOrdered()),n=new ne(e.name(),s,e.nullable(),Hw(e))),n||null}function Hw(e){let t=new Map;if(e)for(let r,n,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(r=e.customMetadata(i))&&(n=r.key())!=null&&t.set(n,r.value());return t}function Z5(e){return new xr(e.isSigned(),e.bitWidth())}function K5(e,t){let r=e.typeType();switch(r){case Ye.NONE:return new jn;case Ye.Null:return new jn;case Ye.Binary:return new cc;case Ye.Utf8:return new lc;case Ye.Bool:return new uc;case Ye.List:return new rs((t||[])[0]);case Ye.Struct_:return new qe(t||[])}switch(r){case Ye.Int:{let n=e.type(new as);return new xr(n.isSigned(),n.bitWidth())}case Ye.FloatingPoint:{let n=e.type(new Yl);return new bi(n.precision())}case Ye.Decimal:{let n=e.type(new Vs);return new fc(n.scale(),n.precision(),n.bitWidth())}case Ye.Date:{let n=e.type(new zl);return new dc(n.unit())}case Ye.Time:{let n=e.type(new xc);return new es(n.unit(),n.bitWidth())}case Ye.Timestamp:{let n=e.type(new _c);return new hc(n.unit(),n.timezone())}case Ye.Interval:{let n=e.type(new Wl);return new pc(n.unit())}case Ye.Duration:{let n=e.type(new Vl);return new mc(n.unit())}case Ye.Union:{let n=e.type(new ls);return new ns(n.mode(),n.typeIdsArray()||[],t||[])}case Ye.FixedSizeBinary:{let n=e.type(new jl);return new yc(n.byteWidth())}case Ye.FixedSizeList:{let n=e.type(new ql);return new is(n.listSize(),(t||[])[0])}case Ye.Map:{let n=e.type(new Gl);return new os((t||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${Ye[r]}" (${r})`)}function PJ(e,t){let r=t.fields.map(o=>ne.encode(e,o));xi.startFieldsVector(e,r.length);let n=xi.createFieldsVector(e,r),i=t.metadata&&t.metadata.size>0?xi.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),c=e.createString(`${s}`);return jr.startKeyValue(e),jr.addKey(e,a),jr.addValue(e,c),jr.endKeyValue(e)})):-1;return xi.startSchema(e),xi.addFields(e,n),xi.addEndianness(e,YJ?$l.Little:$l.Big),i!==-1&&xi.addCustomMetadata(e,i),xi.endSchema(e)}function $J(e,t){let r=-1,n=-1,i=-1,o=t.type,s=t.typeId;ht.isDictionary(o)?(s=o.dictionary.typeId,i=Gw.visit(o,e),n=Gw.visit(o.dictionary,e)):n=Gw.visit(o,e);let a=(o.children||[]).map(u=>ne.encode(e,u)),c=An.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?An.createCustomMetadataVector(e,[...t.metadata].map(([u,f])=>{let d=e.createString(`${u}`),h=e.createString(`${f}`);return jr.startKeyValue(e),jr.addKey(e,d),jr.addValue(e,h),jr.endKeyValue(e)})):-1;return t.name&&(r=e.createString(t.name)),An.startField(e),An.addType(e,n),An.addTypeType(e,s),An.addChildren(e,c),An.addNullable(e,!!t.nullable),r!==-1&&An.addName(e,r),i!==-1&&An.addDictionary(e,i),l!==-1&&An.addCustomMetadata(e,l),An.endField(e)}function zJ(e,t){let r=t.nodes||[],n=t.buffers||[];zi.startNodesVector(e,r.length);for(let s of r.slice().reverse())yo.encode(e,s);let i=e.endVector();zi.startBuffersVector(e,n.length);for(let s of n.slice().reverse())_i.encode(e,s);let o=e.endVector();return zi.startRecordBatch(e),zi.addLength(e,BigInt(t.length)),zi.addNodes(e,i),zi.addBuffers(e,o),zi.endRecordBatch(e)}function VJ(e,t){let r=dn.encode(e,t.data);return Dc.startDictionaryBatch(e),Dc.addId(e,BigInt(t.id)),Dc.addIsDelta(e,t.isDelta),Dc.addData(e,r),Dc.endDictionaryBatch(e)}function jJ(e,t){return bh.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function qJ(e,t){return gh.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var YJ=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})();var eD=e=>`Expected ${ge[e]} Message in stream, but was null or length 0.`,rD=e=>`Header pointer of flatbuffer-encoded ${ge[e]} Message is null or length 0.`,Q5=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,J5=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,_h=class{constructor(t){this.source=t instanceof qs?t:new qs(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?We:t.value===-1&&(t=this.readMetadataLength()).done?We:(t=this.readMetadata(t.value)).done?We:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(eD(t));return r.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let r=Xt(this.source.read(t));if(r.byteLength<t)throw new Error(J5(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(t=!1){let r=ge.Schema,n=this.readMessage(r),i=n?.header();if(t&&!i)throw new Error(rD(r));return i}readMetadataLength(){let t=this.source.read(Zw),r=t&&new Ar(t),n=r?.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(t){let r=this.source.read(t);if(!r)return We;if(r.byteLength<t)throw new Error(Q5(t,r.byteLength));return{done:!1,value:vi.decode(r)}}},Ng=class{constructor(t,r){this.source=t instanceof po?t:F1(t)?new Xl(t,r):new po(t)}[Symbol.asyncIterator](){return this}next(){return P(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?We:t.value===-1&&(t=yield this.readMetadataLength()).done?We:(t=yield this.readMetadata(t.value)).done?We:t})}throw(t){return P(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return P(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return P(this,void 0,void 0,function*(){let r;if((r=yield this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(eD(t));return r.value})}readMessageBody(t){return P(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let r=Xt(yield this.source.read(t));if(r.byteLength<t)throw new Error(J5(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()})}readSchema(t=!1){return P(this,void 0,void 0,function*(){let r=ge.Schema,n=yield this.readMessage(r),i=n?.header();if(t&&!i)throw new Error(rD(r));return i})}readMetadataLength(){return P(this,void 0,void 0,function*(){let t=yield this.source.read(Zw),r=t&&new Ar(t),n=r?.readInt32(0)||0;return{done:n===0,value:n}})}readMetadata(t){return P(this,void 0,void 0,function*(){let r=yield this.source.read(t);if(!r)return We;if(r.byteLength<t)throw new Error(Q5(t,r.byteLength));return{done:!1,value:vi.decode(r)}})}},Fg=class extends _h{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof rg?t:new rg(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:vi.fromJSON(t.schema,ge.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let r=t.dictionaries[this._dictionaryIndex++];return this._body=r.data.columns,{done:!1,value:vi.fromJSON(r,ge.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let r=t.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:vi.fromJSON(r,ge.RecordBatch)}}return this._body=[],We}readMessageBody(t){return r(this._body);function r(n){return(n||[]).reduce((i,o)=>[...i,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE_ID&&[o.TYPE_ID]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...r(o.children)],[])}}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(eD(t));return r.value}readSchema(){let t=ge.Schema,r=this.readMessage(t),n=r?.header();if(!r||!n)throw new Error(rD(t));return n}},Zw=4,tD="ARROW1",wh=new Uint8Array(tD.length);for(let e=0;e<tD.length;e+=1)wh[e]=tD.codePointAt(e);function Kw(e,t=0){for(let r=-1,n=wh.length;++r<n;)if(wh[r]!==e[t+r])return!1;return!0}var vh=wh.length,nD=vh+Zw,tP=vh*2+Zw;var hn=class e extends _f{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 r=this._impl.open(t);return Zo(r)?r.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 ln.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return ln.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,r){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof e?t:O1(t)?GJ(t):F1(t)?ZJ(t):Zo(t)?P(this,void 0,void 0,function*(){return yield e.from(yield t)}):L1(t)||Cy(t)||k1(t)||uo(t)?HJ(new po(t)):XJ(new qs(t))}static readAll(t){return t instanceof e?t.isSync()?eP(t):rP(t):O1(t)||ArrayBuffer.isView(t)||Ko(t)||N1(t)?eP(t):rP(t)}},Ws=class extends hn{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return $e(this,arguments,function*(){yield H(yield*Ji(fr(this[Symbol.iterator]())))})}},Hl=class extends hn{constructor(t){super(t),this._impl=t}readAll(){var t,r,n,i;return P(this,void 0,void 0,function*(){let o=new Array;try{for(var s=!0,a=fr(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){r={error:l}}finally{try{!s&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(r)throw r.error}}return o})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},Zl=class extends Ws{constructor(t){super(t),this._impl=t}},Lg=class extends Hl{constructor(t){super(t),this._impl=t}},Qw=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,r){let n=this._loadVectors(t,r,this.schema.fields),i=Ht({type:new qe(this.schema.fields),length:t.length,children:n});return new hr(this.schema,i)}_loadDictionaryBatch(t,r){let{id:n,isDelta:i}=t,{dictionaries:o,schema:s}=this,a=o.get(n);if(i||!a){let c=s.dictionaries.get(n),l=this._loadVectors(t.data,r,[c]);return(a&&i?a.concat(new ue(l)):new ue(l)).memoize()}return a.memoize()}_loadVectors(t,r,n){return new sg(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}},Sh=class extends Qw{constructor(t,r){super(r),this._reader=O1(t)?new Fg(this._handle=t):new _h(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=nP(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):We}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):We}next(){if(this.closed)return We;let t,{_reader:r}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Af(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},Ih=class extends Qw{constructor(t,r){super(r),this._reader=new Ng(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return P(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 P(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=nP(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return P(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):We})}return(t){return P(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):We})}next(){return P(this,void 0,void 0,function*(){if(this.closed)return We;let t,{_reader:r}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=yield r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=yield r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Af(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return P(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},Jw=class extends Sh{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,r){super(t instanceof ng?t:new ng(t),r)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var r;if(this.closed)return null;this._footer||this.open();let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(ge.RecordBatch);if(i?.isRecordBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s)}}return null}_readDictionaryBatch(t){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(ge.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,r=t.size-nD,n=t.readInt32(r),i=t.readAt(r-n,n);return wc.decode(i)}_readNextMessageAndValidate(t){var r;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}},iD=class extends Ih{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,...r){let n=typeof r[0]!="number"?r.shift():void 0,i=r[0]instanceof Map?r.shift():void 0;super(t instanceof Xl?t:new Xl(t,n),i)}isFile(){return!0}isAsync(){return!0}open(t){let r=Object.create(null,{open:{get:()=>super.open}});return P(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield r.open.call(this,t)})}readRecordBatch(t){var r;return P(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(ge.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 r;return P(this,void 0,void 0,function*(){let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(ge.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 P(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let r=t.size-nD,n=yield t.readInt32(r),i=yield t.readAt(r-n,n);return wc.decode(i)})}_readNextMessageAndValidate(t){return P(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=this._footer.getRecordBatch(this._recordBatchIndex);if(r&&(yield this._handle.seek(r.offset)))return yield this._reader.readMessage(t)}return null})}},oD=class extends Sh{constructor(t,r){super(t,r)}_loadVectors(t,r,n){return new Sw(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}};function nP(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*eP(e){let t=hn.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function rP(e){return $e(this,arguments,function*(){let r=yield H(hn.from(e));try{if(!(yield H(r.open({autoDestroy:!1}))).closed)do yield yield H(r);while(!(yield H(r.reset().open())).closed)}finally{yield H(r.cancel())}})}function GJ(e){return new Ws(new oD(e))}function XJ(e){let t=e.peek(vh+7&-8);return t&&t.byteLength>=4?Kw(t)?new Zl(new Jw(e.read())):new Ws(new Sh(e)):new Ws(new Sh(function*(){}()))}function HJ(e){return P(this,void 0,void 0,function*(){let t=yield e.peek(vh+7&-8);return t&&t.byteLength>=4?Kw(t)?new Zl(new Jw(yield e.read())):new Hl(new Ih(e)):new Hl(new Ih(function(){return $e(this,arguments,function*(){})}()))})}function ZJ(e){return P(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),r=new Xl(e,t);return t>=tP&&Kw(yield r.readAt(0,vh+7&-8))?new Lg(new iD(r)):new Hl(new Ih(r))})}var pr=class e extends mt{static assemble(...t){let r=i=>i.flatMap(o=>Array.isArray(o)?r(o):o instanceof hr?o.data.children:o.data),n=new e;return n.visitMany(r(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof ue)return this.visitMany(t.data),this;let{type:r}=t;if(!ht.isDictionary(r)){let{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(ht.isUnion(r))this.nodes.push(new yo(n,0));else{let{nullCount:i}=t;ht.isNull(r)||fs.call(this,i<=0?new Uint8Array(0):yf(t.offset,n,t.nullBitmap)),this.nodes.push(new yo(n,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 fs(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new _i(this._byteLength,t)),this._byteLength+=t,this}function KJ(e){var t;let{type:r,length:n,typeIds:i,valueOffsets:o}=e;if(fs.call(this,i),r.mode===je.Sparse)return sD.call(this,e);if(r.mode===je.Dense){if(e.offset<=0)return fs.call(this,o),sD.call(this,e);{let s=new Int32Array(n),a=Object.create(null),c=Object.create(null);for(let l,u,f=-1;++f<n;)(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);fs.call(this,s),this.visitMany(e.children.map((l,u)=>{let f=r.typeIds[u],d=a[f],h=c[f];return l.slice(d,Math.min(n,h))}))}}return this}function QJ(e){let t;return e.nullCount>=e.length?fs.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?fs.call(this,yf(e.offset,e.length,t)):fs.call(this,gf(e.values))}function Bc(e){return fs.call(this,e.values.subarray(0,e.length*e.stride))}function iP(e){let{length:t,values:r,valueOffsets:n}=e,{[0]:i,[t]:o}=n,s=Math.min(o-i,r.byteLength-i);return fs.call(this,C1(-i,t+1,n)),fs.call(this,r.subarray(i,i+s)),this}function aD(e){let{length:t,valueOffsets:r}=e;if(r){let{[0]:n,[t]:i}=r;return fs.call(this,C1(-n,t+1,r)),this.visit(e.children[0].slice(n,i-n))}return this.visit(e.children[0])}function sD(e){return this.visitMany(e.type.children.map((t,r)=>e.children[r]).filter(Boolean))[0]}pr.prototype.visitBool=QJ;pr.prototype.visitInt=Bc;pr.prototype.visitFloat=Bc;pr.prototype.visitUtf8=iP;pr.prototype.visitBinary=iP;pr.prototype.visitFixedSizeBinary=Bc;pr.prototype.visitDate=Bc;pr.prototype.visitTimestamp=Bc;pr.prototype.visitTime=Bc;pr.prototype.visitDecimal=Bc;pr.prototype.visitList=aD;pr.prototype.visitStruct=sD;pr.prototype.visitUnion=KJ;pr.prototype.visitInterval=Bc;pr.prototype.visitDuration=Bc;pr.prototype.visitFixedSizeList=aD;pr.prototype.visitMap=aD;var Mf=class extends _f{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new js,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 Zo(t)?t.then(r=>this.writeAll(r)):uo(t)?lD(this,t):cD(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,r=null){return t===this._sink||t instanceof js?this._sink=t:(this._sink=new js,t&&SU(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&IU(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,(!r||!Tf(r,this._schema))&&(r==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(t){let r=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof Yn&&!(r=t.schema))return this.finish()&&void 0;if(t instanceof hr&&!(r=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!Tf(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}t instanceof hr?t instanceof Af||this._writeRecordBatch(t):t instanceof Yn?this.writeAll(t.batches):Ko(t)&&this.writeAll(t)}_writeMessage(t,r=8){let n=r-1,i=vi.encode(t),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+n&~n,c=a-o-s;return t.headerType===ge.RecordBatch?this._recordBatchBlocks.push(new vc(a,t.bodyLength,this._position)):t.headerType===ge.DictionaryBatch&&this._dictionaryBlocks.push(new vc(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 r=Xt(t);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(t){return this._writeMessage(vi.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(wh)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o}=pr.assemble(t),s=new dn(t.numRows,n,i),a=vi.from(s,r);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(o)}_writeDictionaryBatch(t,r,n=!1){this._dictionaryDeltaOffsets.set(r,t.length+(this._dictionaryDeltaOffsets.get(r)||0));let{byteLength:i,nodes:o,bufferRegions:s,buffers:a}=pr.assemble(new ue([t])),c=new dn(t.length,o,s),l=new wi(c,r,n),u=vi.from(l,i);return this._writeMessage(u)._writeBodyBuffers(a)}_writeBodyBuffers(t){let r,n,i;for(let o=-1,s=t.length;++o<s;)(r=t[o])&&(n=r.byteLength)>0&&(this._write(r),(i=(n+7&-8)-n)>0&&this._writePadding(i));return this}_writeDictionaries(t){for(let[r,n]of t.dictionaries){let i=this._dictionaryDeltaOffsets.get(r)||0;if(i===0||(n=n?.slice(i)).length>0)for(let o of n.data)this._writeDictionaryBatch(o,r,i>0),i+=o.length}return this}},Ef=class e extends Mf{static writeAll(t,r){let n=new e(r);return Zo(t)?t.then(i=>n.writeAll(i)):uo(t)?lD(n,t):cD(n,t)}},Df=class e extends Mf{static writeAll(t){let r=new e;return Zo(t)?t.then(n=>r.writeAll(n)):uo(t)?lD(r,t):cD(r,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let r=wc.encode(new wc(t,er.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}};function cD(e,t){let r=t;t instanceof Yn&&(r=t.batches,e.reset(void 0,t.schema));for(let n of r)e.write(n);return e.finish()}function lD(e,t){var r,n,i,o,s,a,c;return P(this,void 0,void 0,function*(){try{for(r=!0,n=fr(t);i=yield n.next(),o=i.done,!o;r=!0){c=i.value,r=!1;let l=c;e.write(l)}}catch(l){s={error:l}}finally{try{!r&&!o&&(a=n.return)&&(yield a.call(n))}finally{if(s)throw s.error}}return e.finish()})}function oP(e,t){if(uo(e))return ttt(e,t);if(Ko(e))return JJ(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function JJ(e,t){let r=null,n=t?.type==="bytes"||!1,i=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){o(s,r||(r=e[Symbol.iterator]()))},pull(s){r?o(s,r):s.close()},cancel(){(r?.return&&r.return()||!0)&&(r=null)}}),Object.assign({highWaterMark:n?i:void 0},t));function o(s,a){let c,l=null,u=s.desiredSize||null;for(;!(l=a.next(n?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=Xt(l.value))&&(u!=null&&n&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()}}function ttt(e,t){let r=null,n=t?.type==="bytes"||!1,i=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){return P(this,void 0,void 0,function*(){yield o(s,r||(r=e[Symbol.asyncIterator]()))})},pull(s){return P(this,void 0,void 0,function*(){r?yield o(s,r):s.close()})},cancel(){return P(this,void 0,void 0,function*(){(r?.return&&(yield r.return())||!0)&&(r=null)})}}),Object.assign({highWaterMark:n?i:void 0},t));function o(s,a){return P(this,void 0,void 0,function*(){let c,l=null,u=s.desiredSize||null;for(;!(l=yield a.next(n?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=Xt(l.value))&&(u!=null&&n&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()})}}function cP(e){return new uD(e)}var uD=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=t,o=zx(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=vf(o),this._getSize=i!=="bytes"?sP:aP;let{["highWaterMark"]:s=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r),{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);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"?sP:aP}),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 r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-r}_maybeFlush(t,r){r!=null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(t,r){this._bufferedSize=0,this._controller=null,r==null?t.close():t.enqueue(r)}},sP=e=>{var t;return(t=e?.length)!==null&&t!==void 0?t:0},aP=e=>{var t;return(t=e?.byteLength)!==null&&t!==void 0?t:0};function tv(e,t){let r=new js,n=null,i=new ReadableStream({cancel(){return P(this,void 0,void 0,function*(){yield r.close()})},start(a){return P(this,void 0,void 0,function*(){yield s(a,n||(n=yield o()))})},pull(a){return P(this,void 0,void 0,function*(){n?yield s(a,n):a.close()})}});return{writable:new WritableStream(r,Object.assign({highWaterMark:Math.pow(2,14)},e)),readable:i};function o(){return P(this,void 0,void 0,function*(){return yield(yield hn.from(r)).open(t)})}function s(a,c){return P(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 ev(e,t){let r=new this(e),n=new po(r),i=new ReadableStream({cancel(){return P(this,void 0,void 0,function*(){yield n.cancel()})},pull(s){return P(this,void 0,void 0,function*(){yield o(s)})},start(s){return P(this,void 0,void 0,function*(){yield o(s)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(r,e),readable:i};function o(s){return P(this,void 0,void 0,function*(){let a=null,c=s.desiredSize;for(;a=yield n.read(c||null);)if(s.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;s.close()})}}function rv(e,t="stream"){return(t==="stream"?Ef:Df).writeAll(e).toUint8Array(!0)}var itt=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},wE),GE),UE),vE),yE),CE),xE),{compareSchemas:Tf,compareFields:R5,compareTypes:k5});ln.toDOMStream=oP;He.throughDOM=cP;hn.throughDOM=tv;Zl.throughDOM=tv;Ws.throughDOM=tv;Mf.throughDOM=ev;Df.throughDOM=ev;Ef.throughDOM=ev;var ott=Object.create,uP=Object.defineProperty,stt=Object.getOwnPropertyDescriptor,att=Object.getOwnPropertyNames,ctt=Object.getPrototypeOf,ltt=Object.prototype.hasOwnProperty,utt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ftt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of att(t))!ltt.call(e,i)&&i!==r&&uP(e,i,{get:()=>t[i],enumerable:!(n=stt(t,i))||n.enumerable});return e},dtt=(e,t,r)=>(r=e!=null?ott(ctt(e)):{},ftt(t||!e||!e.__esModule?uP(r,"default",{value:e,enumerable:!0}):r,e)),htt=utt((e,t)=>{t.exports=Worker}),ptt=(e=>(e[e.UNDEFINED=0]="UNDEFINED",e[e.AUTOMATIC=1]="AUTOMATIC",e[e.READ_ONLY=2]="READ_ONLY",e[e.READ_WRITE=3]="READ_WRITE",e))(ptt||{}),mtt=(e=>(e[e.IDENTIFIER=0]="IDENTIFIER",e[e.NUMERIC_CONSTANT=1]="NUMERIC_CONSTANT",e[e.STRING_CONSTANT=2]="STRING_CONSTANT",e[e.OPERATOR=3]="OPERATOR",e[e.KEYWORD=4]="KEYWORD",e[e.COMMENT=5]="COMMENT",e))(mtt||{}),ytt=(e=>(e[e.NONE=0]="NONE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARNING=3]="WARNING",e[e.ERROR=4]="ERROR",e))(ytt||{}),gtt=(e=>(e[e.NONE=0]="NONE",e[e.CONNECT=1]="CONNECT",e[e.DISCONNECT=2]="DISCONNECT",e[e.OPEN=3]="OPEN",e[e.QUERY=4]="QUERY",e[e.INSTANTIATE=5]="INSTANTIATE",e))(gtt||{}),btt=(e=>(e[e.NONE=0]="NONE",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR",e[e.START=3]="START",e[e.RUN=4]="RUN",e[e.CAPTURE=5]="CAPTURE",e))(btt||{}),xtt=(e=>(e[e.NONE=0]="NONE",e[e.WEB_WORKER=1]="WEB_WORKER",e[e.NODE_WORKER=2]="NODE_WORKER",e[e.BINDINGS=3]="BINDINGS",e[e.ASYNC_DUCKDB=4]="ASYNC_DUCKDB",e))(xtt||{}),fP=class{log(e){}},dP=class{constructor(e=2){this.level=e}log(e){e.level>=this.level&&console.log(e)}};var _tt=(e=>(e[e.SUCCESS=0]="SUCCESS",e))(_tt||{}),wtt=class{constructor(e,t){this._bindings=e,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}async query(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.runQuery(this._conn,e),r=hn.from(t);return console.assert(r.isSync(),"Reader is not sync"),console.assert(r.isFile(),"Reader is not file"),new Yn(r)}async send(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.startPendingQuery(this._conn,e);for(;t==null;)t=await this._bindings.pollPendingQuery(this._conn);let r=new hP(this._bindings,this._conn,t),n=await hn.from(r);return console.assert(n.isAsync()),console.assert(n.isStream()),n}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(e){return await this._bindings.getTableNames(this._conn,e)}async prepare(e){let t=await this._bindings.createPrepared(this._conn,e);return new vtt(this._bindings,this._conn,t)}async insertArrowTable(e,t){let r=rv(e,"stream");await this.insertArrowFromIPCStream(r,t)}async insertArrowFromIPCStream(e,t){await this._bindings.insertArrowFromIPCStream(this._conn,e,t)}async insertCSVFromPath(e,t){await this._bindings.insertCSVFromPath(this._conn,e,t)}async insertJSONFromPath(e,t){await this._bindings.insertJSONFromPath(this._conn,e,t)}},hP=class{constructor(e,t,r){this.db=e,this.conn=t,this.header=r,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e;return this._inFlight!=null?(e=await this._inFlight,this._inFlight=null):e=await this.db.fetchQueryResults(this.conn),this._depleted=e.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:e}}[Symbol.asyncIterator](){return this}},vtt=class{constructor(e,t,r){this.bindings=e,this.connectionId=t,this.statementId=r}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...e){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,e),r=hn.from(t);return console.assert(r.isSync()),console.assert(r.isFile()),new Yn(r)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),r=new hP(this.bindings,this.connectionId,t),n=await hn.from(r);return console.assert(n.isAsync()),console.assert(n.isStream()),n}},Stt=(e=>(e.CANCEL_PENDING_QUERY="CANCEL_PENDING_QUERY",e.CLOSE_PREPARED="CLOSE_PREPARED",e.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",e.CONNECT="CONNECT",e.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",e.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",e.CREATE_PREPARED="CREATE_PREPARED",e.DISCONNECT="DISCONNECT",e.DROP_FILE="DROP_FILE",e.DROP_FILES="DROP_FILES",e.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",e.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",e.FLUSH_FILES="FLUSH_FILES",e.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",e.GET_TABLE_NAMES="GET_TABLE_NAMES",e.GET_VERSION="GET_VERSION",e.GLOB_FILE_INFOS="GLOB_FILE_INFOS",e.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",e.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",e.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",e.INSTANTIATE="INSTANTIATE",e.OPEN="OPEN",e.PING="PING",e.POLL_PENDING_QUERY="POLL_PENDING_QUERY",e.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",e.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",e.REGISTER_FILE_URL="REGISTER_FILE_URL",e.RESET="RESET",e.RUN_PREPARED="RUN_PREPARED",e.RUN_QUERY="RUN_QUERY",e.SEND_PREPARED="SEND_PREPARED",e.START_PENDING_QUERY="START_PENDING_QUERY",e.TOKENIZE="TOKENIZE",e))(Stt||{}),Itt=(e=>(e.CONNECTION_INFO="CONNECTION_INFO",e.ERROR="ERROR",e.FEATURE_FLAGS="FEATURE_FLAGS",e.FILE_BUFFER="FILE_BUFFER",e.FILE_INFOS="FILE_INFOS",e.FILE_SIZE="FILE_SIZE",e.FILE_STATISTICS="FILE_STATISTICS",e.INSTANTIATE_PROGRESS="INSTANTIATE_PROGRESS",e.LOG="LOG",e.OK="OK",e.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",e.QUERY_PLAN="QUERY_PLAN",e.QUERY_RESULT="QUERY_RESULT",e.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",e.QUERY_RESULT_HEADER="QUERY_RESULT_HEADER",e.QUERY_RESULT_HEADER_OR_NULL="QUERY_RESULT_HEADER_OR_NULL",e.REGISTERED_FILE="REGISTERED_FILE",e.SCRIPT_TOKENS="SCRIPT_TOKENS",e.SUCCESS="SUCCESS",e.TABLE_NAMES="TABLE_NAMES",e.VERSION_STRING="VERSION_STRING",e))(Itt||{}),be=class{constructor(e,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=e,this.data=t,this.promise=new Promise((r,n)=>{this.promiseResolver=r,this.promiseRejecter=n})}};function nv(e){switch(e.typeId){case N.Binary:return{sqlType:"binary"};case N.Bool:return{sqlType:"bool"};case N.Date:return{sqlType:"date"};case N.DateDay:return{sqlType:"date32[d]"};case N.DateMillisecond:return{sqlType:"date64[ms]"};case N.Decimal:{let t=e;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case N.Float:return{sqlType:"float"};case N.Float16:return{sqlType:"float16"};case N.Float32:return{sqlType:"float32"};case N.Float64:return{sqlType:"float64"};case N.Int:return{sqlType:"int32"};case N.Int16:return{sqlType:"int16"};case N.Int32:return{sqlType:"int32"};case N.Int64:return{sqlType:"int64"};case N.Uint16:return{sqlType:"uint16"};case N.Uint32:return{sqlType:"uint32"};case N.Uint64:return{sqlType:"uint64"};case N.Uint8:return{sqlType:"uint8"};case N.IntervalDayTime:return{sqlType:"interval[dt]"};case N.IntervalYearMonth:return{sqlType:"interval[m]"};case N.List:return{sqlType:"list",valueType:nv(e.valueType)};case N.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:e.byteWidth};case N.Null:return{sqlType:"null"};case N.Utf8:return{sqlType:"utf8"};case N.Struct:return{sqlType:"struct",fields:e.children.map(t=>yD(t.name,t.type))};case N.Map:{let t=e;return{sqlType:"map",keyType:nv(t.keyType),valueType:nv(t.valueType)}}case N.Time:return{sqlType:"time[s]"};case N.TimeMicrosecond:return{sqlType:"time[us]"};case N.TimeMillisecond:return{sqlType:"time[ms]"};case N.TimeNanosecond:return{sqlType:"time[ns]"};case N.TimeSecond:return{sqlType:"time[s]"};case N.Timestamp:return{sqlType:"timestamp",timezone:e.timezone||void 0};case N.TimestampSecond:return{sqlType:"timestamp[s]",timezone:e.timezone||void 0};case N.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:e.timezone||void 0};case N.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:e.timezone||void 0};case N.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:e.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(e.toString()))}function yD(e,t){let r=nv(t);return r.name=e,r}var Ttt=new TextEncoder,pP=class{constructor(e,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=e,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(e){this._worker=e,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,r)=>{this._workerShutdownResolver=t})}detach(){this._worker&&(this._worker.removeEventListener("message",this._onMessageHandler),this._worker.removeEventListener("error",this._onErrorHandler),this._worker.removeEventListener("close",this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(e,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let r=this._nextMessageId++;return this._pendingRequests.set(r,e),this._worker.postMessage({messageId:r,type:e.type,data:e.data},t),await e.promise}onMessage(e){var t;let r=e.data;switch(r.type){case"LOG":{this._logger.log(r.data);return}case"INSTANTIATE_PROGRESS":{for(let i of this._onInstantiationProgress)i(r.data);return}}let n=this._pendingRequests.get(r.requestId);if(!n){console.warn("unassociated response: [".concat(r.requestId,", ").concat(r.type.toString(),"]"));return}if(this._pendingRequests.delete(r.requestId),r.type=="ERROR"){let i=new Error(r.data.message);i.name=r.data.name,(t=Object.getOwnPropertyDescriptor(i,"stack"))!=null&&t.writable&&(i.stack=r.data.stack),n.promiseRejecter(i);return}switch(n.type){case"CLOSE_PREPARED":case"COLLECT_FILE_STATISTICS":case"COPY_FILE_TO_PATH":case"DISCONNECT":case"DROP_FILE":case"DROP_FILES":case"FLUSH_FILES":case"INSERT_ARROW_FROM_IPC_STREAM":case"IMPORT_CSV_FROM_PATH":case"IMPORT_JSON_FROM_PATH":case"OPEN":case"PING":case"REGISTER_FILE_BUFFER":case"REGISTER_FILE_HANDLE":case"REGISTER_FILE_URL":case"RESET":if(r.type=="OK"){n.promiseResolver(r.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],r.type=="OK"){n.promiseResolver(r.data);return}break;case"GLOB_FILE_INFOS":if(r.type=="FILE_INFOS"){n.promiseResolver(r.data);return}break;case"GET_VERSION":if(r.type=="VERSION_STRING"){n.promiseResolver(r.data);return}break;case"GET_FEATURE_FLAGS":if(r.type=="FEATURE_FLAGS"){n.promiseResolver(r.data);return}break;case"GET_TABLE_NAMES":if(r.type=="TABLE_NAMES"){n.promiseResolver(r.data);return}break;case"TOKENIZE":if(r.type=="SCRIPT_TOKENS"){n.promiseResolver(r.data);return}break;case"COPY_FILE_TO_BUFFER":if(r.type=="FILE_BUFFER"){n.promiseResolver(r.data);return}break;case"EXPORT_FILE_STATISTICS":if(r.type=="FILE_STATISTICS"){n.promiseResolver(r.data);return}break;case"CONNECT":if(r.type=="CONNECTION_INFO"){n.promiseResolver(r.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(r.type=="QUERY_RESULT"){n.promiseResolver(r.data);return}break;case"SEND_PREPARED":if(r.type=="QUERY_RESULT_HEADER"){n.promiseResolver(r.data);return}break;case"START_PENDING_QUERY":if(r.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(r.data);return}break;case"POLL_PENDING_QUERY":if(r.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(r.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],r.type=="SUCCESS"){n.promiseResolver(r.data);return}break;case"FETCH_QUERY_RESULTS":if(r.type=="QUERY_RESULT_CHUNK"){n.promiseResolver(r.data);return}break;case"CREATE_PREPARED":if(r.type=="PREPARED_STATEMENT_ID"){n.promiseResolver(r.data);return}break}n.promiseRejecter(new Error("unexpected response type: ".concat(r.type.toString())))}onError(e){console.error(e),console.error("error in duckdb worker: ".concat(e.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let e=new be("RESET",null);return await this.postTask(e)}async ping(){let e=new be("PING",null);await this.postTask(e)}async dropFile(e){let t=new be("DROP_FILE",e);return await this.postTask(t)}async dropFiles(){let e=new be("DROP_FILES",null);return await this.postTask(e)}async flushFiles(){let e=new be("FLUSH_FILES",null);return await this.postTask(e)}async instantiate(e,t=null,r=n=>{}){this._onInstantiationProgress.push(r);let n=new be("INSTANTIATE",[e,t]);return await this.postTask(n)}async getVersion(){let e=new be("GET_VERSION",null);return await this.postTask(e)}async getFeatureFlags(){let e=new be("GET_FEATURE_FLAGS",null);return await this.postTask(e)}async open(e){let t=new be("OPEN",e);await this.postTask(t)}async tokenize(e){let t=new be("TOKENIZE",e);return await this.postTask(t)}async connectInternal(){let e=new be("CONNECT",null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new wtt(this,e)}async disconnect(e){let t=new be("DISCONNECT",e);await this.postTask(t)}async runQuery(e,t){let r=new be("RUN_QUERY",[e,t]);return await this.postTask(r)}async startPendingQuery(e,t){let r=new be("START_PENDING_QUERY",[e,t]);return await this.postTask(r)}async pollPendingQuery(e){let t=new be("POLL_PENDING_QUERY",e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new be("CANCEL_PENDING_QUERY",e);return await this.postTask(t)}async fetchQueryResults(e){let t=new be("FETCH_QUERY_RESULTS",e);return await this.postTask(t)}async getTableNames(e,t){let r=new be("GET_TABLE_NAMES",[e,t]);return await this.postTask(r)}async createPrepared(e,t){let r=new be("CREATE_PREPARED",[e,t]);return await this.postTask(r)}async closePrepared(e,t){let r=new be("CLOSE_PREPARED",[e,t]);await this.postTask(r)}async runPrepared(e,t,r){let n=new be("RUN_PREPARED",[e,t,r]);return await this.postTask(n)}async sendPrepared(e,t,r){let n=new be("SEND_PREPARED",[e,t,r]);return await this.postTask(n)}async globFiles(e){let t=new be("GLOB_FILE_INFOS",e);return await this.postTask(t)}async registerFileText(e,t){let r=Ttt.encode(t);await this.registerFileBuffer(e,r)}async registerFileURL(e,t,r,n){t===void 0&&(t=e);let i=new be("REGISTER_FILE_URL",[e,t,r,n]);await this.postTask(i)}async registerEmptyFileBuffer(e){let t=new be("REGISTER_FILE_BUFFER",[e,new Uint8Array]);await this.postTask(t)}async registerFileBuffer(e,t){let r=new be("REGISTER_FILE_BUFFER",[e,t]);await this.postTask(r,[t.buffer])}async registerFileHandle(e,t,r,n){let i=new be("REGISTER_FILE_HANDLE",[e,t,r,n]);await this.postTask(i,[])}async collectFileStatistics(e,t){let r=new be("COLLECT_FILE_STATISTICS",[e,t]);await this.postTask(r,[])}async exportFileStatistics(e){let t=new be("EXPORT_FILE_STATISTICS",e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new be("COPY_FILE_TO_BUFFER",e);return await this.postTask(t)}async copyFileToPath(e,t){let r=new be("COPY_FILE_TO_PATH",[e,t]);await this.postTask(r)}async insertArrowFromIPCStream(e,t,r){if(t.length==0)return;let n=new be("INSERT_ARROW_FROM_IPC_STREAM",[e,t,r]);await this.postTask(n,[t.buffer])}async insertCSVFromPath(e,t,r){if(r.columns!==void 0){let i=[];for(let o in r.columns){let s=r.columns[o];i.push(yD(o,s))}r.columnsFlat=i,delete r.columns}let n=new be("IMPORT_CSV_FROM_PATH",[e,t,r]);await this.postTask(n)}async insertJSONFromPath(e,t,r){if(r.columns!==void 0){let i=[];for(let o in r.columns){let s=r.columns[o];i.push(yD(o,s))}r.columnsFlat=i,delete r.columns}let n=new be("IMPORT_JSON_FROM_PATH",[e,t,r]);await this.postTask(n)}};var Att=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),Mtt=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),Ett=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),Dtt=()=>(async e=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),gD={name:"@duckdb/duckdb-wasm",version:"1.28.1-dev106.0",description:"DuckDB powered by WebAssembly",license:"MIT",repository:{type:"git",url:"https://github.com/duckdb/duckdb-wasm.git"},keywords:["sql","duckdb","relational","database","data","query","wasm","analytics","olap","arrow","parquet","json","csv"],dependencies:{"apache-arrow":"^14.0.1"},devDependencies:{"@types/emscripten":"^1.39.10","@types/jasmine":"^5.1.4","@typescript-eslint/eslint-plugin":"^6.18.0","@typescript-eslint/parser":"^6.18.0",esbuild:"^0.20.0",eslint:"^8.56.0","eslint-plugin-jasmine":"^4.1.3","eslint-plugin-react":"^7.33.2","fast-glob":"^3.3.2",jasmine:"^5.1.0","jasmine-core":"^5.1.1","jasmine-spec-reporter":"^7.0.0","js-sha256":"^0.11.0",karma:"^6.4.2","karma-chrome-launcher":"^3.2.0","karma-coverage":"^2.2.1","karma-firefox-launcher":"^2.1.2","karma-jasmine":"^5.1.0","karma-jasmine-html-reporter":"^2.1.0","karma-sourcemap-loader":"^0.4.0","karma-spec-reporter":"^0.0.36","make-dir":"^4.0.0",nyc:"^15.1.0",prettier:"^3.2.4",puppeteer:"^21.7.0",rimraf:"^5.0.5",s3rver:"^3.7.1",typedoc:"^0.25.7",typescript:"^5.3.3","wasm-feature-detect":"^1.6.1","web-worker":"^1.2.0"},scripts:{"build:debug":"node bundle.mjs debug && tsc --emitDeclarationOnly","build:release":"node bundle.mjs release && tsc --emitDeclarationOnly",docs:"typedoc",report:"node ./coverage.mjs","test:node":"node --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs","test:node:debug":"node --inspect-brk --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs","test:node:coverage":"nyc -r json --report-dir ./coverage/node node ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs","test:firefox":"karma start ./karma/tests-firefox.cjs","test:chrome":"karma start ./karma/tests-chrome.cjs","test:chrome:eh":"karma start ./karma/tests-chrome-eh.cjs","test:chrome:coverage":"karma start ./karma/tests-chrome-coverage.cjs","test:browser":"karma start ./karma/tests-all.cjs","test:browser:debug":"karma start ./karma/tests-debug.cjs",test:"npm run test:chrome && npm run test:node","test:coverage":"npm run test:chrome:coverage && npm run test:node:coverage && npm run report",lint:"eslint src test"},files:["dist","!dist/types/test"],main:"dist/duckdb-browser.cjs",module:"dist/duckdb-browser.mjs",types:"dist/duckdb-browser.d.ts",jsdelivr:"dist/duckdb-browser.cjs",unpkg:"dist/duckdb-browser.mjs",sideEffects:!1,browser:{fs:!1,path:!1,perf_hooks:!1,os:!1,worker_threads:!1},exports:{"./dist/duckdb-mvp.wasm":"./dist/duckdb-mvp.wasm","./dist/duckdb-eh.wasm":"./dist/duckdb-eh.wasm","./dist/duckdb-coi.wasm":"./dist/duckdb-coi.wasm","./dist/duckdb-browser":"./dist/duckdb-browser.mjs","./dist/duckdb-browser.cjs":"./dist/duckdb-browser.cjs","./dist/duckdb-browser.mjs":"./dist/duckdb-browser.mjs","./dist/duckdb-browser-blocking":"./dist/duckdb-browser-blocking.mjs","./dist/duckdb-browser-blocking.mjs":"./dist/duckdb-browser-blocking.mjs","./dist/duckdb-browser-blocking.cjs":"./dist/duckdb-browser-blocking.cjs","./dist/duckdb-browser-coi.pthread.worker.js":"./dist/duckdb-browser-coi.pthread.worker.js","./dist/duckdb-browser-coi.worker.js":"./dist/duckdb-browser-coi.worker.js","./dist/duckdb-browser-eh.worker.js":"./dist/duckdb-browser-eh.worker.js","./dist/duckdb-browser-mvp.worker.js":"./dist/duckdb-browser-mvp.worker.js","./dist/duckdb-node":"./dist/duckdb-node.cjs","./dist/duckdb-node.cjs":"./dist/duckdb-node.cjs","./dist/duckdb-node-blocking":"./dist/duckdb-node-blocking.cjs","./dist/duckdb-node-blocking.cjs":"./dist/duckdb-node-blocking.cjs","./dist/duckdb-node-eh.worker.cjs":"./dist/duckdb-node-eh.worker.cjs","./dist/duckdb-node-mvp.worker.cjs":"./dist/duckdb-node-mvp.worker.cjs","./blocking":{browser:{types:"./dist/duckdb-browser-blocking.d.ts",import:"./dist/duckdb-browser-blocking.mjs",require:"./dist/duckdb-browser-blocking.cjs"},node:{types:"./dist/duckdb-node-blocking.d.ts",require:"./dist/duckdb-node-blocking.cjs",import:"./dist/duckdb-node-blocking.cjs"},types:"./dist/duckdb-browser-blocking.d.ts",import:"./dist/duckdb-browser-blocking.mjs",require:"./dist/duckdb-browser-blocking.cjs"},".":{browser:{types:"./dist/duckdb-browser.d.ts",import:"./dist/duckdb-browser.mjs",require:"./dist/duckdb-browser.cjs"},node:{types:"./dist/duckdb-node.d.ts",import:"./dist/duckdb-node.cjs",require:"./dist/duckdb-node.cjs"},types:"./dist/duckdb-browser.d.ts",import:"./dist/duckdb-browser.mjs",require:"./dist/duckdb-browser.cjs"}}},Btt=gD.name,Ott=gD.version,bD=gD.version.split("."),fBt=bD[0],dBt=bD[1],hBt=bD[2],Ntt=()=>typeof navigator>"u";function mP(){let e="https://cdn.jsdelivr.net/npm/".concat(Btt,"@").concat(Ott,"/dist/");return{mvp:{mainModule:"".concat(e,"duckdb-mvp.wasm"),mainWorker:"".concat(e,"duckdb-browser-mvp.worker.js")},eh:{mainModule:"".concat(e,"duckdb-eh.wasm"),mainWorker:"".concat(e,"duckdb-browser-eh.worker.js")}}}var fD=null,dD=null,hD=null,pD=null,mD=null;async function Ftt(){return fD==null&&(fD=typeof BigInt64Array<"u"),dD==null&&(dD=await Mtt()),hD==null&&(hD=await Dtt()),pD==null&&(pD=await Ett()),mD==null&&(mD=await Att()),{bigInt64Array:fD,crossOriginIsolated:Ntt()||globalThis.crossOriginIsolated||!1,wasmExceptions:dD,wasmSIMD:pD,wasmThreads:hD,wasmBulkMemory:mD}}async function yP(e){let t=await Ftt();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&e.coi)return{mainModule:e.coi.mainModule,mainWorker:e.coi.mainWorker,pthreadWorker:e.coi.pthreadWorker};if(e.eh)return{mainModule:e.eh.mainModule,mainWorker:e.eh.mainWorker,pthreadWorker:null}}return{mainModule:e.mvp.mainModule,mainWorker:e.mvp.mainWorker,pthreadWorker:null}}var pBt=dtt(htt());function Ltt(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}var mBt=Ltt(),Rtt=(e=>(e[e.BUFFER=0]="BUFFER",e[e.NODE_FS=1]="NODE_FS",e[e.BROWSER_FILEREADER=2]="BROWSER_FILEREADER",e[e.BROWSER_FSACCESS=3]="BROWSER_FSACCESS",e[e.HTTP=4]="HTTP",e[e.S3=5]="S3",e))(Rtt||{});function gP(e={}){let{duckdb:t,connection:r,...n}=e,i=t,o=r,s;function a(){return s||(s=(i?Promise.resolve(i):Ctt(n).then(u=>i=u)).then(u=>u.connect()).then(u=>o=u)),s}async function c(){return i||await a(),i}async function l(){return o||await a(),o}return{getDuckDB:c,getConnection:l,query:async u=>{let{type:f,sql:d}=u,p=await(await l()).query(d);return f==="exec"?void 0:f==="arrow"?p:Array.from(p)}}}async function Ctt({log:e=!1}={}){let t=mP(),r=await yP(t),n=URL.createObjectURL(new Blob([`importScripts("${r.mainWorker}");`],{type:"text/javascript"})),i=new Worker(n),o=e?new dP:new fP,s=new pP(o,i);return await s.instantiate(r.mainModule,r.pthreadWorker),URL.revokeObjectURL(n),s}function xD(){let e=new Set,t,r=new Promise(n=>t=n);return{pending(n){e.add(n)},ready(n){return e.delete(n),e.size===0},resolve(){r=new Promise(n=>{t(),t=n})},get promise(){return r}}}var K8={};Ir(K8,{Fixed:()=>Gs,Param:()=>Nl,Query:()=>Mt,Selection:()=>ac,agg:()=>SM,align:()=>GF,and:()=>$n,area:()=>T4,areaX:()=>A4,areaY:()=>M4,argmax:()=>th,argmin:()=>Jd,arrayAgg:()=>XM,arrow:()=>b8,aspectRatio:()=>XF,avg:()=>IM,axis:()=>HF,axisFx:()=>S8,axisFy:()=>I8,axisX:()=>w8,axisY:()=>v8,barX:()=>O4,barY:()=>N4,bin:()=>KT,cast:()=>By,castDouble:()=>eh,castInteger:()=>HM,cell:()=>F4,cellX:()=>L4,cellY:()=>R4,centroid:()=>Ny,centroidX:()=>tE,centroidY:()=>eE,circle:()=>V4,colorBase:()=>LR,colorClamp:()=>SR,colorConstant:()=>kR,colorDomain:()=>wR,colorExponent:()=>RR,colorInterpolate:()=>MR,colorLabel:()=>BR,colorLegend:()=>X8,colorN:()=>IR,colorNice:()=>TR,colorPivot:()=>ER,colorRange:()=>vR,colorReverse:()=>OR,colorScale:()=>_R,colorScheme:()=>AR,colorSymmetric:()=>DR,colorTickFormat:()=>FR,colorZero:()=>NR,column:()=>El,contour:()=>s8,coordinator:()=>co,corr:()=>CM,count:()=>Li,covarPop:()=>UM,create:()=>Ol,cume_dist:()=>mM,dateDay:()=>JM,dateMonth:()=>KM,dateMonthDay:()=>QM,delaunayLink:()=>m8,delaunayMesh:()=>y8,denseLine:()=>o8,dense_rank:()=>hM,density:()=>i8,densityX:()=>r8,densityY:()=>n8,dot:()=>P4,dotX:()=>$4,dotY:()=>z4,entropy:()=>LM,eq:()=>ic,facetGrid:()=>bL,facetLabel:()=>xL,facetMargin:()=>hL,facetMarginBottom:()=>mL,facetMarginLeft:()=>yL,facetMarginRight:()=>gL,facetMarginTop:()=>pL,first:()=>YM,first_value:()=>xM,frame:()=>_8,from:()=>qG,fxAlign:()=>ML,fxAriaDescription:()=>YL,fxAriaLabel:()=>qL,fxAxis:()=>OL,fxDomain:()=>_L,fxFontVariant:()=>jL,fxGrid:()=>UL,fxInset:()=>SL,fxInsetLeft:()=>IL,fxInsetRight:()=>TL,fxLabel:()=>$L,fxLabelAnchor:()=>zL,fxLabelOffset:()=>VL,fxLine:()=>PL,fxNice:()=>vL,fxPadding:()=>EL,fxPaddingInner:()=>DL,fxPaddingOuter:()=>BL,fxRange:()=>wL,fxReverse:()=>WL,fxRound:()=>AL,fxTickFormat:()=>kL,fxTickPadding:()=>RL,fxTickRotate:()=>CL,fxTickSize:()=>FL,fxTickSpacing:()=>LL,fxTicks:()=>NL,fyAlign:()=>tR,fyAriaDescription:()=>bR,fyAriaLabel:()=>gR,fyAxis:()=>iR,fyDomain:()=>GL,fyFontVariant:()=>yR,fyGrid:()=>fR,fyInset:()=>ZL,fyInsetBottom:()=>QL,fyInsetTop:()=>KL,fyLabel:()=>hR,fyLabelAnchor:()=>pR,fyLabelOffset:()=>mR,fyLine:()=>dR,fyNice:()=>HL,fyPadding:()=>eR,fyPaddingInner:()=>rR,fyPaddingOuter:()=>nR,fyRange:()=>XL,fyReverse:()=>xR,fyRound:()=>JL,fyTickFormat:()=>lR,fyTickPadding:()=>cR,fyTickRotate:()=>uR,fyTickSize:()=>sR,fyTickSpacing:()=>aR,fyTicks:()=>oR,geo:()=>D8,geojson:()=>Oy,graticule:()=>O8,grid:()=>KF,gridFx:()=>M8,gridFy:()=>E8,gridX:()=>T8,gridY:()=>A8,gt:()=>My,gte:()=>iM,hconcat:()=>CG,heatmap:()=>a8,height:()=>VF,hexagon:()=>j4,hexbin:()=>u8,hexgrid:()=>f8,highlight:()=>N8,hspace:()=>$G,hull:()=>g8,image:()=>e8,inset:()=>ZF,intervalX:()=>U8,intervalXY:()=>$8,intervalY:()=>P8,isBetween:()=>tr,isDistinct:()=>oM,isNotBetween:()=>sM,isNotDistinct:()=>Ey,isNotNull:()=>nc,isNull:()=>lf,kurtosis:()=>FM,label:()=>QF,lag:()=>gM,last:()=>WM,last_value:()=>_M,lead:()=>bM,lengthBase:()=>u4,lengthClamp:()=>a4,lengthConstant:()=>d4,lengthDomain:()=>o4,lengthExponent:()=>f4,lengthNice:()=>c4,lengthRange:()=>s4,lengthScale:()=>i4,lengthZero:()=>l4,line:()=>E4,lineX:()=>D4,lineY:()=>B4,link:()=>x8,literal:()=>Fi,loadCSV:()=>iE,loadExtension:()=>rE,loadJSON:()=>oE,loadObjects:()=>cE,loadParquet:()=>sE,loadSpatial:()=>aE,lt:()=>oc,lte:()=>sc,mad:()=>TM,margin:()=>UF,marginBottom:()=>WF,marginLeft:()=>jF,marginRight:()=>qF,marginTop:()=>YF,margins:()=>CF,max:()=>so,median:()=>MM,menu:()=>OG,min:()=>ao,mode:()=>DM,name:()=>RF,nearestX:()=>k8,nearestY:()=>C8,neq:()=>uf,not:()=>nM,nth_value:()=>wM,ntile:()=>yM,opacityBase:()=>WR,opacityClamp:()=>$R,opacityConstant:()=>XR,opacityDomain:()=>UR,opacityExponent:()=>GR,opacityLabel:()=>VR,opacityLegend:()=>H8,opacityNice:()=>zR,opacityRange:()=>PR,opacityReverse:()=>jR,opacityScale:()=>CR,opacityTickFormat:()=>YR,opacityZero:()=>qR,or:()=>cf,padding:()=>JF,pan:()=>z8,panX:()=>V8,panY:()=>j8,panZoom:()=>q8,panZoomX:()=>Y8,panZoomY:()=>W8,percent_rank:()=>pM,plot:()=>XG,product:()=>AM,projectionClip:()=>S4,projectionDomain:()=>g4,projectionInset:()=>b4,projectionInsetBottom:()=>v4,projectionInsetLeft:()=>x4,projectionInsetRight:()=>_4,projectionInsetTop:()=>w4,projectionParallels:()=>p4,projectionPrecision:()=>m4,projectionRotate:()=>y4,projectionType:()=>h4,quantile:()=>EM,rBase:()=>e4,rClamp:()=>QR,rConstant:()=>n4,rDomain:()=>ZR,rExponent:()=>r4,rNice:()=>JR,rRange:()=>KR,rScale:()=>HR,rZero:()=>t4,rank:()=>dM,raster:()=>c8,rasterTile:()=>l8,rect:()=>k4,rectX:()=>C4,rectY:()=>U4,regressionY:()=>d8,round:()=>t6,row_number:()=>fM,ruleX:()=>G4,ruleY:()=>X4,search:()=>NG,skewness:()=>NM,slider:()=>FG,sphere:()=>B8,spike:()=>t8,sql:()=>W,stddev:()=>OM,stddevPop:()=>kM,stringAgg:()=>GM,style:()=>$F,sum:()=>Ri,symbolLegend:()=>Z8,table:()=>LG,text:()=>q4,textX:()=>Y4,textY:()=>W4,tickX:()=>H4,tickY:()=>Z4,toggle:()=>vm,toggleColor:()=>R8,toggleX:()=>F8,toggleY:()=>L8,varPop:()=>RM,variance:()=>BM,vconcat:()=>kG,vector:()=>K4,vectorX:()=>Q4,vectorY:()=>J4,voronoi:()=>h8,voronoiMesh:()=>p8,vspace:()=>PG,width:()=>zF,xAlign:()=>u6,xAriaDescription:()=>E6,xAriaLabel:()=>M6,xAxis:()=>p6,xBase:()=>O6,xClamp:()=>c6,xConstant:()=>F6,xDomain:()=>r6,xExponent:()=>N6,xFontVariant:()=>A6,xGrid:()=>w6,xInset:()=>o6,xInsetLeft:()=>s6,xInsetRight:()=>a6,xLabel:()=>S6,xLabelAnchor:()=>I6,xLabelOffset:()=>T6,xLine:()=>v6,xNice:()=>i6,xPadding:()=>f6,xPaddingInner:()=>d6,xPaddingOuter:()=>h6,xRange:()=>n6,xReverse:()=>D6,xRound:()=>l6,xScale:()=>e6,xTickFormat:()=>x6,xTickPadding:()=>b6,xTickRotate:()=>_6,xTickSize:()=>y6,xTickSpacing:()=>g6,xTicks:()=>m6,xZero:()=>B6,xyDomain:()=>PF,yAlign:()=>j6,yAriaDescription:()=>aL,yAriaLabel:()=>sL,yAxis:()=>G6,yBase:()=>uL,yClamp:()=>z6,yConstant:()=>dL,yDomain:()=>R6,yExponent:()=>fL,yFontVariant:()=>oL,yGrid:()=>tL,yInset:()=>U6,yInsetBottom:()=>$6,yInsetTop:()=>P6,yLabel:()=>rL,yLabelAnchor:()=>nL,yLabelOffset:()=>iL,yLine:()=>eL,yNice:()=>C6,yPadding:()=>q6,yPaddingInner:()=>Y6,yPaddingOuter:()=>W6,yRange:()=>k6,yReverse:()=>cL,yRound:()=>V6,yScale:()=>L6,yTickFormat:()=>Q6,yTickPadding:()=>K6,yTickRotate:()=>J6,yTickSize:()=>H6,yTickSpacing:()=>Z6,yTicks:()=>X6,yZero:()=>lL});var Gs=Symbol("Fixed"),pn=Symbol("Transient"),Rg=Symbol("Transform");var zT={};Ir(zT,{Area:()=>xd,Arrow:()=>Gb,BarX:()=>Xb,BarY:()=>Hb,Cell:()=>_d,Contour:()=>ix,Density:()=>ax,Dot:()=>wd,Frame:()=>Pb,Geo:()=>cx,Hexgrid:()=>lx,Image:()=>ux,Line:()=>vd,Link:()=>Yb,Mark:()=>Ft,Raster:()=>nx,Rect:()=>Id,RuleX:()=>Lb,RuleY:()=>Rb,Text:()=>yd,TickX:()=>Jb,TickY:()=>tx,Tip:()=>$b,Vector:()=>bd,area:()=>qb,areaX:()=>Ou,areaY:()=>dl,arrow:()=>dY,auto:()=>SY,autoSpec:()=>P3,axisFx:()=>sT,axisFy:()=>oT,axisX:()=>Cb,axisY:()=>kb,barX:()=>Ta,barY:()=>Aa,bin:()=>fl,binX:()=>Sa,binY:()=>Ia,bollinger:()=>Ru,bollingerX:()=>DY,bollingerY:()=>BY,boxX:()=>OY,boxY:()=>NY,cell:()=>Nu,cellX:()=>pY,cellY:()=>mY,centroid:()=>EW,circle:()=>bY,cluster:()=>MW,column:()=>tn,contour:()=>zY,crosshair:()=>qY,crosshairX:()=>YY,crosshairY:()=>WY,delaunayLink:()=>HY,delaunayMesh:()=>ZY,density:()=>eW,differenceY:()=>iW,dodgeX:()=>VW,dodgeY:()=>jW,dot:()=>Do,dotX:()=>yY,dotY:()=>gY,filter:()=>TV,find:()=>LV,formatIsoDate:()=>XN,formatMonth:()=>PV,formatWeekday:()=>$V,frame:()=>Wp,geo:()=>BT,geoCentroid:()=>DW,graticule:()=>sW,gridFx:()=>uT,gridFy:()=>cT,gridX:()=>lT,gridY:()=>aT,group:()=>Ab,groupX:()=>Su,groupY:()=>Iu,groupZ:()=>Tb,hexagon:()=>xY,hexbin:()=>aW,hexgrid:()=>cW,hull:()=>KY,identity:()=>K,image:()=>uW,indexOf:()=>nr,initializer:()=>Qe,interpolateNearest:()=>W3,interpolateNone:()=>DT,interpolatorBarycentric:()=>Y3,interpolatorRandomWalk:()=>G3,legend:()=>Lq,line:()=>Sd,lineX:()=>Fu,lineY:()=>Lu,linearRegressionX:()=>hW,linearRegressionY:()=>pW,link:()=>_T,map:()=>Ii,mapX:()=>om,mapY:()=>sm,marks:()=>Pr,normalize:()=>PT,normalizeX:()=>GW,normalizeY:()=>XW,plot:()=>Vb,pointer:()=>zp,pointerX:()=>Vp,pointerY:()=>dd,raster:()=>CY,rect:()=>Kb,rectX:()=>rm,rectY:()=>nm,reverse:()=>AV,ruleX:()=>Zi,ruleY:()=>Ki,scale:()=>Pp,select:()=>ZW,selectFirst:()=>pF,selectLast:()=>mF,selectMaxX:()=>JW,selectMaxY:()=>tG,selectMinX:()=>KW,selectMinY:()=>QW,shiftX:()=>HW,shuffle:()=>MV,sort:()=>SI,sphere:()=>oW,spike:()=>pq,stackX:()=>k3,stackX1:()=>nY,stackX2:()=>iY,stackY:()=>C3,stackY1:()=>oY,stackY2:()=>sY,text:()=>va,textX:()=>QI,textY:()=>JI,tickX:()=>AT,tickY:()=>MT,tip:()=>hT,transform:()=>en,tree:()=>cF,treeLink:()=>RT,treeNode:()=>fx,valueof:()=>Tt,vector:()=>T3,vectorX:()=>rT,vectorY:()=>nT,voronoi:()=>QY,voronoiMesh:()=>JY,window:()=>am,windowX:()=>IY,windowY:()=>TY});function ie(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Wn(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Oc(e){let t,r,n;e.length!==2?(t=ie,r=(a,c)=>ie(e(a),c),n=(a,c)=>e(a)-c):(t=e===ie||e===Wn?e:Utt,r=e,n=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;r(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;r(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&&n(a[f-1],c)>-n(a[f],c)?f-1:f}return{left:i,center:s,right:o}}function Utt(){return 0}function kg(e){return e===null?NaN:+e}function*bP(e,t){if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(yield r);else{let r=-1;for(let n of e)(n=t(n,++r,e))!=null&&(n=+n)>=n&&(yield n)}}var xP=Oc(ie),_P=xP.right,Ptt=xP.left,$tt=Oc(kg).center,Nc=_P;var Cg=wP(vP),_D=wP(ztt);function wP(e){return function(t,r,n=r){if(!((r=+r)>=0))throw new RangeError("invalid rx");if(!((n=+n)>=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||!r&&!n)return t;let a=r&&e(r),c=n&&e(n),l=i.slice();return a&&c?(Th(a,l,i,o,s),Th(a,i,l,o,s),Th(a,l,i,o,s),Ah(c,i,l,o,s),Ah(c,l,i,o,s),Ah(c,i,l,o,s)):a?(Th(a,i,l,o,s),Th(a,l,i,o,s),Th(a,i,l,o,s)):c&&(Ah(c,i,l,o,s),Ah(c,l,i,o,s),Ah(c,i,l,o,s)),t}}function Th(e,t,r,n,i){for(let o=0,s=n*i;o<s;)e(t,r,o,o+=n,1)}function Ah(e,t,r,n,i){for(let o=0,s=n*i;o<n;++o)e(t,r,o,o+s,n)}function ztt(e){let t=vP(e);return(r,n,i,o,s)=>{i<<=2,o<<=2,s<<=2,t(r,n,i+0,o+0,s),t(r,n,i+1,o+1,s),t(r,n,i+2,o+2,s),t(r,n,i+3,o+3,s)}}function vP(e){let t=Math.floor(e);if(t===e)return Vtt(e);let r=e-t,n=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 d=s,h=s+u;d<h;d+=c)l+=o[Math.min(a,d)];for(let d=s,h=a;d<=h;d+=c)l+=o[Math.min(a,d+u)],i[d]=(l+r*(o[Math.max(s,d-f)]+o[Math.min(a,d+f)]))/n,l-=o[Math.max(s,d-u)]}}function Vtt(e){let t=2*e+1;return(r,n,i,o,s)=>{if(!((o-=s)>=i))return;let a=e*n[i],c=s*e;for(let l=i,u=i+c;l<u;l+=s)a+=n[Math.min(o,l)];for(let l=i,u=o;l<=u;l+=s)a+=n[Math.min(o,l+c)],r[l]=a/t,a-=n[Math.max(i,l-c)]}}function Xs(e,t){let r=0;if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&++r;else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(i=+i)>=i&&++r}return r}function jtt(e){return e.length|0}function qtt(e){return!(e>0)}function Ytt(e){return typeof e!="object"||"length"in e?e:Array.from(e)}function Wtt(e){return t=>e(...t)}function iv(...e){let t=typeof e[e.length-1]=="function"&&Wtt(e.pop());e=e.map(Ytt);let r=e.map(jtt),n=e.length-1,i=new Array(n+1).fill(0),o=[];if(n<0||r.some(qtt))return o;for(;;){o.push(i.map((a,c)=>e[c][a]));let s=n;for(;++i[s]===r[s];){if(s===0)return t?o.map(t):o;i[s--]=0}}}function ov(e,t){var r=0,n=0;return Float64Array.from(e,t===void 0?i=>r+=+i||0:i=>r+=+t(i,n++,e)||0)}function Kl(e,t){let r=0,n,i=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(n=a-i,i+=n/++r,o+=n*(a-i))}if(r>1)return o/(r-1)}function go(e,t){let r=Kl(e,t);return r&&Math.sqrt(r)}function Be(e,t){let r,n;if(t===void 0)for(let i of e)i!=null&&(r===void 0?i>=i&&(r=n=i):(r>i&&(r=i),n<i&&(n=i)));else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(r===void 0?o>=o&&(r=n=o):(r>o&&(r=o),n<o&&(n=o)))}return[r,n]}var mn=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){let r=this._partials,n=0;for(let i=0;i<this._n&&i<32;i++){let o=r[i],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(r[n++]=a),t=s}return r[n]=t,this._n=n+1,this}valueOf(){let t=this._partials,r=this._n,n,i,o,s=0;if(r>0){for(s=t[--r];r>0&&(n=s,i=t[--r],s=n+i,o=i-(s-n),!o););r>0&&(o<0&&t[r-1]<0||o>0&&t[r-1]>0)&&(i=o*2,n=s+i,i==n-s&&(s=n))}return s}};var Gn=class extends Map{constructor(t,r=TP){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(let[n,i]of t)this.set(n,i)}get(t){return super.get(wD(this,t))}has(t){return super.has(wD(this,t))}set(t,r){return super.set(SP(this,t),r)}delete(t){return super.delete(IP(this,t))}},Xn=class extends Set{constructor(t,r=TP){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(let n of t)this.add(n)}has(t){return super.has(wD(this,t))}add(t){return super.add(SP(this,t))}delete(t){return super.delete(IP(this,t))}};function wD({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):r}function SP({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function IP({_intern:e,_key:t},r){let n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function TP(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Ug(e){return e}function Gr(e,...t){return SD(e,Ug,Ug,t)}function ds(e,t,...r){return SD(e,Ug,t,r)}function vD(e,t,...r){return SD(e,Array.from,t,r)}function SD(e,t,r,n){return function i(o,s){if(s>=n.length)return r(o);let a=new Gn,c=n[s++],l=-1;for(let u of o){let f=c(u,++l,o),d=a.get(f);d?d.push(u):a.set(f,[u])}for(let[u,f]of a)a.set(u,i(f,s));return t(a)}(e,0)}function ID(e,t){return Array.from(t,r=>e[r])}function Hs(e,...t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");e=Array.from(e);let[r]=t;if(r&&r.length!==2||t.length>1){let n=Uint32Array.from(e,(i,o)=>o);return t.length>1?(t=t.map(i=>e.map(i)),n.sort((i,o)=>{for(let s of t){let a=Bf(s[i],s[o]);if(a)return a}})):(r=e.map(r),n.sort((i,o)=>Bf(r[i],r[o]))),ID(e,n)}return e.sort(Pg(r))}function Pg(e=ie){if(e===ie)return Bf;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{let n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function Bf(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function Mh(e,t,r){return(t.length!==2?Hs(ds(e,t,r),([n,i],[o,s])=>ie(i,s)||ie(n,o)):Hs(Gr(e,r),([n,i],[o,s])=>t(i,s)||ie(n,o))).map(([n])=>n)}var Gtt=Math.sqrt(50),Xtt=Math.sqrt(10),Htt=Math.sqrt(2);function sv(e,t,r){let n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),s=o>=Gtt?10:o>=Xtt?5:o>=Htt?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<=r&&r<2?sv(e,t,r*2):[a,c,l]}function yn(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];let n=t<e,[i,o,s]=n?sv(t,e,r):sv(e,t,r);if(!(o>=i))return[];let a=o-i+1,c=new Array(a);if(n)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 Fc(e,t,r){return t=+t,e=+e,r=+r,sv(e,t,r)[2]}function Eh(e,t,r){t=+t,e=+e,r=+r;let n=t<e,i=n?Fc(t,e,r):Fc(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function Dh(e,t,r){let n;for(;;){let i=Fc(e,t,r);if(i===n||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),n=i}}function Ql(e){return Math.max(1,Math.ceil(Math.log(Xs(e))/Math.LN2)+1)}function de(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}return r}function av(e,t){let r,n=-1,i=-1;if(t===void 0)for(let o of e)++i,o!=null&&(r<o||r===void 0&&o>=o)&&(r=o,n=i);else for(let o of e)(o=t(o,++i,e))!=null&&(r<o||r===void 0&&o>=o)&&(r=o,n=i);return n}function Oe(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function cv(e,t){let r,n=-1,i=-1;if(t===void 0)for(let o of e)++i,o!=null&&(r>o||r===void 0&&o>=o)&&(r=o,n=i);else for(let o of e)(o=t(o,++i,e))!=null&&(r>o||r===void 0&&o>=o)&&(r=o,n=i);return n}function lv(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?Bf:Pg(i);n>r;){if(n-r>600){let c=n-r+1,l=t-r+1,u=Math.log(c),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(c-f)/c)*(l-c/2<0?-1:1),h=Math.max(r,Math.floor(t-l*f/c+d)),p=Math.min(n,Math.floor(t+(c-l)*f/c+d));lv(e,t,h,p,i)}let o=e[t],s=r,a=n;for($g(e,r,t),i(e[n],o)>0&&$g(e,r,n);s<a;){for($g(e,s,a),++s,--a;i(e[s],o)<0;)++s;for(;i(e[a],o)>0;)--a}i(e[r],o)===0?$g(e,r,a):(++a,$g(e,a,n)),a<=t&&(r=a+1),t<=a&&(n=a-1)}return e}function $g(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function Of(e,t=ie){let r,n=!1;if(t.length===1){let i;for(let o of e){let s=t(o);(n?ie(s,i)>0:ie(s,s)===0)&&(r=o,i=s,n=!0)}}else for(let i of e)(n?t(i,r)>0:t(i,i)===0)&&(r=i,n=!0);return r}function Hn(e,t,r){if(e=Float64Array.from(bP(e,r)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Oe(e);if(t>=1)return de(e);var n,i=(n-1)*t,o=Math.floor(i),s=de(lv(e,o).subarray(0,o+1)),a=Oe(e.subarray(o+1));return s+(a-s)*(i-o)}}function TD(e,t,r=kg){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),s=+r(e[o],o,e),a=+r(e[o+1],o+1,e);return s+(a-s)*(i-o)}}function uv(e,t,r){let n=Xs(e),i=Hn(e,.75)-Hn(e,.25);return n&&i?Math.ceil((r-t)/(2*i*Math.pow(n,-1/3))):1}function zg(e,t,r){let n=Xs(e),i=go(e);return n&&i?Math.ceil((r-t)*Math.cbrt(n)/(3.49*i)):1}function Lc(e,t){let r=0,n=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&(++r,n+=i);else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(o=+o)>=o&&(++r,n+=o)}if(r)return n/r}function hs(e,t){return Hn(e,.5,t)}function*Ktt(e){for(let t of e)yield*t}function Bh(e){return Array.from(Ktt(e))}function Oh(e,t){let r=new Gn;if(t===void 0)for(let o of e)o!=null&&o>=o&&r.set(o,(r.get(o)||0)+1);else{let o=-1;for(let s of e)(s=t(s,++o,e))!=null&&s>=s&&r.set(s,(r.get(s)||0)+1)}let n,i=0;for(let[o,s]of r)s>i&&(i=s,n=o);return n}function fv(e,t=Qtt){let r=[],n,i=!1;for(let o of e)i&&r.push(t(n,o)),n=o,i=!0;return r}function Qtt(e,t){return[e,t]}function _r(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n<i;)o[n]=e+n*r;return o}function Vg(e,t=ie){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let r=Array.from(e),n=new Float64Array(r.length);t.length!==2&&(r=r.map(t),t=ie);let i=(a,c)=>t(r[a],r[c]),o,s;return e=Uint32Array.from(r,(a,c)=>c),e.sort(t===ie?(a,c)=>Bf(r[a],r[c]):Pg(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),n[a]=s):n[a]=NaN}),n}function dv(e,t=ie){let r,n=!1;if(t.length===1){let i;for(let o of e){let s=t(o);(n?ie(s,i)<0:ie(s,s)===0)&&(r=o,i=s,n=!0)}}else for(let i of e)(n?t(i,r)<0:t(i,i)===0)&&(r=i,n=!0);return r}function gn(e,t){let r=0;if(t===void 0)for(let n of e)(n=+n)&&(r+=n);else{let n=-1;for(let i of e)(i=+t(i,++n,e))&&(r+=i)}return r}function Jl(e){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(e).reverse()}function AP(e){return e}var AD=1,MD=2,ED=3,hv=4,MP=1e-6;function Jtt(e){return"translate("+e+",0)"}function tet(e){return"translate(0,"+e+")"}function eet(e){return t=>+e(t)}function ret(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),r=>+e(r)+t}function net(){return!this.__axis}function iet(e,t){var r=[],n=null,i=null,o=6,s=6,a=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=e===AD||e===hv?-1:1,u=e===hv||e===MD?"x":"y",f=e===AD||e===ED?Jtt:tet;function d(h){var p=n??(t.ticks?t.ticks.apply(t,r):t.domain()),y=i??(t.tickFormat?t.tickFormat.apply(t,r):AP),g=Math.max(o,0)+a,m=t.range(),b=+m[0]+c,x=+m[m.length-1]+c,_=(t.bandwidth?ret:eet)(t.copy(),c),v=h.selection?h.selection():h,w=v.selectAll(".domain").data([null]),I=v.selectAll(".tick").data(p,t).order(),D=I.exit(),A=I.enter().append("g").attr("class","tick"),B=I.select("line"),M=I.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),I=I.merge(A),B=B.merge(A.append("line").attr("stroke","currentColor").attr(u+"2",l*o)),M=M.merge(A.append("text").attr("fill","currentColor").attr(u,l*g).attr("dy",e===AD?"0em":e===ED?"0.71em":"0.32em")),h!==v&&(w=w.transition(h),I=I.transition(h),B=B.transition(h),M=M.transition(h),D=D.transition(h).attr("opacity",MP).attr("transform",function(O){return isFinite(O=_(O))?f(O+c):this.getAttribute("transform")}),A.attr("opacity",MP).attr("transform",function(O){var R=this.parentNode.__axis;return f((R&&isFinite(R=R(O))?R:_(O))+c)})),D.remove(),w.attr("d",e===hv||e===MD?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),I.attr("opacity",1).attr("transform",function(O){return f(_(O)+c)}),B.attr(u+"2",l*o),M.attr(u,l*g).text(y),v.filter(net).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===MD?"start":e===hv?"end":"middle"),v.each(function(){this.__axis=_})}return d.scale=function(h){return arguments.length?(t=h,d):t},d.ticks=function(){return r=Array.from(arguments),d},d.tickArguments=function(h){return arguments.length?(r=h==null?[]:Array.from(h),d):r.slice()},d.tickValues=function(h){return arguments.length?(n=h==null?null:Array.from(h),d):n&&n.slice()},d.tickFormat=function(h){return arguments.length?(i=h,d):i},d.tickSize=function(h){return arguments.length?(o=s=+h,d):o},d.tickSizeInner=function(h){return arguments.length?(o=+h,d):o},d.tickSizeOuter=function(h){return arguments.length?(s=+h,d):s},d.tickPadding=function(h){return arguments.length?(a=+h,d):a},d.offset=function(h){return arguments.length?(c=+h,d):c},d}function DD(e){return iet(ED,e)}var oet={value:()=>{}};function DP(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new pv(r)}function pv(e){this._=e}function set(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}pv.prototype=DP.prototype={constructor:pv,on:function(e,t){var r=this._,n=set(e+"",r),i,o=-1,s=n.length;if(arguments.length<2){for(;++o<s;)if((i=(e=n[o]).type)&&(i=aet(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=n[o]).type)r[i]=EP(r[i],e.name,t);else if(t==null)for(i in r)r[i]=EP(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new pv(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,o;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],n=0,i=o.length;n<i;++n)o[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,o=n.length;i<o;++i)n[i].value.apply(t,r)}};function aet(e,t){for(var r=0,n=e.length,i;r<n;++r)if((i=e[r]).name===t)return i.value}function EP(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=oet,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var Nf=DP;var mv="http://www.w3.org/1999/xhtml",bo={svg:"http://www.w3.org/2000/svg",xhtml:mv,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Rc(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),bo.hasOwnProperty(t)?{space:bo[t],local:e}:e}function cet(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===mv&&t.documentElement.namespaceURI===mv?t.createElement(e):t.createElementNS(r,e)}}function uet(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function kc(e){var t=Rc(e);return(t.local?uet:cet)(t)}function fet(){}function Ff(e){return e==null?fet:function(){return this.querySelector(e)}}function BP(e){typeof e!="function"&&(e=Ff(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var o=t[i],s=o.length,a=n[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 mr(n,this._parents)}function BD(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function det(){return[]}function jg(e){return e==null?det:function(){return this.querySelectorAll(e)}}function het(e){return function(){return BD(e.apply(this,arguments))}}function OP(e){typeof e=="function"?e=het(e):e=jg(e);for(var t=this._groups,r=t.length,n=[],i=[],o=0;o<r;++o)for(var s=t[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(n.push(e.call(c,c.__data__,l,s)),i.push(c));return new mr(n,i)}function qg(e){return function(){return this.matches(e)}}function yv(e){return function(t){return t.matches(e)}}var pet=Array.prototype.find;function met(e){return function(){return pet.call(this.children,e)}}function yet(){return this.firstElementChild}function NP(e){return this.select(e==null?yet:met(typeof e=="function"?e:yv(e)))}var get=Array.prototype.filter;function bet(){return Array.from(this.children)}function xet(e){return function(){return get.call(this.children,e)}}function FP(e){return this.selectAll(e==null?bet:xet(typeof e=="function"?e:yv(e)))}function LP(e){typeof e!="function"&&(e=qg(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var o=t[i],s=o.length,a=n[i]=[],c,l=0;l<s;++l)(c=o[l])&&e.call(c,c.__data__,l,o)&&a.push(c);return new mr(n,this._parents)}function gv(e){return new Array(e.length)}function RP(){return new mr(this._enter||this._groups.map(gv),this._parents)}function Yg(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Yg.prototype={constructor:Yg,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 kP(e){return function(){return e}}function _et(e,t,r,n,i,o){for(var s=0,a,c=t.length,l=o.length;s<l;++s)(a=t[s])?(a.__data__=o[s],n[s]=a):r[s]=new Yg(e,o[s]);for(;s<c;++s)(a=t[s])&&(i[s]=a)}function wet(e,t,r,n,i,o,s){var a,c,l=new Map,u=t.length,f=o.length,d=new Array(u),h;for(a=0;a<u;++a)(c=t[a])&&(d[a]=h=s.call(c,c.__data__,a,t)+"",l.has(h)?i[a]=c:l.set(h,c));for(a=0;a<f;++a)h=s.call(e,o[a],a,o)+"",(c=l.get(h))?(n[a]=c,c.__data__=o[a],l.delete(h)):r[a]=new Yg(e,o[a]);for(a=0;a<u;++a)(c=t[a])&&l.get(d[a])===c&&(i[a]=c)}function vet(e){return e.__data__}function CP(e,t){if(!arguments.length)return Array.from(this,vet);var r=t?wet:_et,n=this._parents,i=this._groups;typeof e!="function"&&(e=kP(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=n[l],f=i[l],d=f.length,h=Iet(e.call(u,u&&u.__data__,l,n)),p=h.length,y=a[l]=new Array(p),g=s[l]=new Array(p),m=c[l]=new Array(d);r(u,f,y,g,m,h,t);for(var b=0,x=0,_,v;b<p;++b)if(_=y[b]){for(b>=x&&(x=b+1);!(v=g[x])&&++x<p;);_._next=v||null}}return s=new mr(s,n),s._enter=a,s._exit=c,s}function Iet(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function UP(){return new mr(this._exit||this._groups.map(gv),this._parents)}function PP(e,t,r){var n=this.enter(),i=this,o=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?o.remove():r(o),n&&i?n.merge(i).order():i}function $P(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,o=n.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var l=r[c],u=n[c],f=l.length,d=a[c]=new Array(f),h,p=0;p<f;++p)(h=l[p]||u[p])&&(d[p]=h);for(;c<i;++c)a[c]=r[c];return new mr(a,this._parents)}function zP(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],i=n.length-1,o=n[i],s;--i>=0;)(s=n[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function VP(e){e||(e=Tet);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var r=this._groups,n=r.length,i=new Array(n),o=0;o<n;++o){for(var s=r[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 mr(i,this._parents).order()}function Tet(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function jP(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function qP(){return Array.from(this)}function YP(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,o=n.length;i<o;++i){var s=n[i];if(s)return s}return null}function WP(){let e=0;for(let t of this)++e;return e}function GP(){return!this.node()}function XP(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i=t[r],o=0,s=i.length,a;o<s;++o)(a=i[o])&&e.call(a,a.__data__,o,i);return this}function Aet(e){return function(){this.removeAttribute(e)}}function Met(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Eet(e,t){return function(){this.setAttribute(e,t)}}function Det(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Bet(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Oet(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function HP(e,t){var r=Rc(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?Met:Aet:typeof t=="function"?r.local?Oet:Bet:r.local?Det:Eet)(r,t))}function bv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Net(e){return function(){this.style.removeProperty(e)}}function Fet(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Let(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function ZP(e,t,r){return arguments.length>1?this.each((t==null?Net:typeof t=="function"?Let:Fet)(e,t,r??"")):tu(this.node(),e)}function tu(e,t){return e.style.getPropertyValue(t)||bv(e).getComputedStyle(e,null).getPropertyValue(t)}function Ret(e){return function(){delete this[e]}}function ket(e,t){return function(){this[e]=t}}function Cet(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function KP(e,t){return arguments.length>1?this.each((t==null?Ret:typeof t=="function"?Cet:ket)(e,t)):this.node()[e]}function QP(e){return e.trim().split(/^|\s+/)}function OD(e){return e.classList||new JP(e)}function JP(e){this._node=e,this._names=QP(e.getAttribute("class")||"")}JP.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 t7(e,t){for(var r=OD(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function e7(e,t){for(var r=OD(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function Uet(e){return function(){t7(this,e)}}function Pet(e){return function(){e7(this,e)}}function $et(e,t){return function(){(t.apply(this,arguments)?t7:e7)(this,e)}}function r7(e,t){var r=QP(e+"");if(arguments.length<2){for(var n=OD(this.node()),i=-1,o=r.length;++i<o;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?$et:t?Uet:Pet)(r,t))}function zet(){this.textContent=""}function Vet(e){return function(){this.textContent=e}}function jet(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function n7(e){return arguments.length?this.each(e==null?zet:(typeof e=="function"?jet:Vet)(e)):this.node().textContent}function qet(){this.innerHTML=""}function Yet(e){return function(){this.innerHTML=e}}function Wet(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function i7(e){return arguments.length?this.each(e==null?qet:(typeof e=="function"?Wet:Yet)(e)):this.node().innerHTML}function Get(){this.nextSibling&&this.parentNode.appendChild(this)}function o7(){return this.each(Get)}function Xet(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function s7(){return this.each(Xet)}function a7(e){var t=typeof e=="function"?e:kc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Het(){return null}function c7(e,t){var r=typeof e=="function"?e:kc(e),n=t==null?Het:typeof t=="function"?t:Ff(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function Zet(){var e=this.parentNode;e&&e.removeChild(this)}function l7(){return this.each(Zet)}function Ket(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Qet(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function u7(e){return this.select(e?Qet:Ket)}function f7(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Jet(e){return function(t){e.call(this,t,this.__data__)}}function trt(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function ert(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,o;r<i;++r)o=t[r],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++n]=o;++n?t.length=n:delete this.__on}}}function rrt(e,t,r){return function(){var n=this.__on,i,o=Jet(t);if(n){for(var s=0,a=n.length;s<a;++s)if((i=n[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=r),i.value=t;return}}this.addEventListener(e.type,o,r),i={type:e.type,name:e.name,value:t,listener:o,options:r},n?n.push(i):this.__on=[i]}}function d7(e,t,r){var n=trt(e+""),i,o=n.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=n[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?rrt:ert,i=0;i<o;++i)this.each(a(n[i],t,r));return this}function h7(e,t,r){var n=bv(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function nrt(e,t){return function(){return h7(this,e,t)}}function irt(e,t){return function(){return h7(this,e,t.apply(this,arguments))}}function p7(e,t){return this.each((typeof t=="function"?irt:nrt)(e,t))}function*m7(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,o=n.length,s;i<o;++i)(s=n[i])&&(yield s)}var ND=[null];function mr(e,t){this._groups=e,this._parents=t}function y7(){return new mr([[document.documentElement]],ND)}function ort(){return this}mr.prototype=y7.prototype={constructor:mr,select:BP,selectAll:OP,selectChild:NP,selectChildren:FP,filter:LP,data:CP,enter:RP,exit:UP,join:PP,merge:$P,selection:ort,order:zP,sort:VP,call:jP,nodes:qP,node:YP,size:WP,empty:GP,each:XP,attr:HP,style:ZP,property:KP,classed:r7,text:n7,html:i7,raise:o7,lower:s7,append:a7,insert:c7,remove:l7,clone:u7,datum:f7,on:d7,dispatch:p7,[Symbol.iterator]:m7};var Cc=y7;function ae(e){return typeof e=="string"?new mr([[document.querySelector(e)]],[document.documentElement]):new mr([[e]],ND)}function g7(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Mn(e,t){if(e=g7(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.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 xv={capture:!0,passive:!1};function _v(e){e.preventDefault(),e.stopImmediatePropagation()}function Wg(e){var t=e.document.documentElement,r=ae(e).on("dragstart.drag",_v,xv);"onselectstart"in t?r.on("selectstart.drag",_v,xv):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Gg(e,t){var r=e.document.documentElement,n=ae(e).on("dragstart.drag",null);t&&(n.on("click.drag",_v,xv),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}function Uc(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function eu(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Ks(){}var ru=.7,kf=1/ru,Nh="\\s*([+-]?\\d+)\\s*",Xg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",srt=/^#([0-9a-f]{3,8})$/,art=new RegExp(`^rgb\\(${Nh},${Nh},${Nh}\\)$`),crt=new RegExp(`^rgb\\(${Zs},${Zs},${Zs}\\)$`),lrt=new RegExp(`^rgba\\(${Nh},${Nh},${Nh},${Xg}\\)$`),urt=new RegExp(`^rgba\\(${Zs},${Zs},${Zs},${Xg}\\)$`),frt=new RegExp(`^hsl\\(${Xg},${Zs},${Zs}\\)$`),drt=new RegExp(`^hsla\\(${Xg},${Zs},${Zs},${Xg}\\)$`),b7={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};Uc(Ks,Vi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:x7,formatHex:x7,formatHex8:hrt,formatHsl:prt,formatRgb:_7,toString:_7});function x7(){return this.rgb().formatHex()}function hrt(){return this.rgb().formatHex8()}function prt(){return A7(this).formatHsl()}function _7(){return this.rgb().formatRgb()}function Vi(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=srt.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?w7(t):r===3?new Or(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?wv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?wv(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=art.exec(e))?new Or(t[1],t[2],t[3],1):(t=crt.exec(e))?new Or(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lrt.exec(e))?wv(t[1],t[2],t[3],t[4]):(t=urt.exec(e))?wv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=frt.exec(e))?I7(t[1],t[2]/100,t[3]/100,1):(t=drt.exec(e))?I7(t[1],t[2]/100,t[3]/100,t[4]):b7.hasOwnProperty(e)?w7(b7[e]):e==="transparent"?new Or(NaN,NaN,NaN,0):null}function w7(e){return new Or(e>>16&255,e>>8&255,e&255,1)}function wv(e,t,r,n){return n<=0&&(e=t=r=NaN),new Or(e,t,r,n)}function Hg(e){return e instanceof Ks||(e=Vi(e)),e?(e=e.rgb(),new Or(e.r,e.g,e.b,e.opacity)):new Or}function qr(e,t,r,n){return arguments.length===1?Hg(e):new Or(e,t,r,n??1)}function Or(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Uc(Or,qr,eu(Ks,{brighter(e){return e=e==null?kf:Math.pow(kf,e),new Or(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ru:Math.pow(ru,e),new Or(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Or(Rf(this.r),Rf(this.g),Rf(this.b),Sv(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:v7,formatHex:v7,formatHex8:mrt,formatRgb:S7,toString:S7}));function v7(){return`#${Lf(this.r)}${Lf(this.g)}${Lf(this.b)}`}function mrt(){return`#${Lf(this.r)}${Lf(this.g)}${Lf(this.b)}${Lf((isNaN(this.opacity)?1:this.opacity)*255)}`}function S7(){let e=Sv(this.opacity);return`${e===1?"rgb(":"rgba("}${Rf(this.r)}, ${Rf(this.g)}, ${Rf(this.b)}${e===1?")":`, ${e})`}`}function Sv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rf(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Lf(e){return e=Rf(e),(e<16?"0":"")+e.toString(16)}function I7(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ps(e,t,r,n)}function A7(e){if(e instanceof ps)return new ps(e.h,e.s,e.l,e.opacity);if(e instanceof Ks||(e=Vi(e)),!e)return new ps;if(e instanceof ps)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=NaN,a=o-i,c=(o+i)/2;return a?(t===o?s=(r-n)/a+(r<n)*6:r===o?s=(n-t)/a+2:s=(t-r)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new ps(s,a,c,e.opacity)}function Zg(e,t,r,n){return arguments.length===1?A7(e):new ps(e,t,r,n??1)}function ps(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Uc(ps,Zg,eu(Ks,{brighter(e){return e=e==null?kf:Math.pow(kf,e),new ps(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ru:Math.pow(ru,e),new ps(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,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Or(FD(e>=240?e-240:e+120,i,n),FD(e,i,n),FD(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ps(T7(this.h),vv(this.s),vv(this.l),Sv(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=Sv(this.opacity);return`${e===1?"hsl(":"hsla("}${T7(this.h)}, ${vv(this.s)*100}%, ${vv(this.l)*100}%${e===1?")":`, ${e})`}`}}));function T7(e){return e=(e||0)%360,e<0?e+360:e}function vv(e){return Math.max(0,Math.min(1,e||0))}function FD(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var Iv=Math.PI/180,Tv=180/Math.PI;var Av=18,M7=.96422,E7=1,D7=.82521,B7=4/29,Fh=6/29,O7=3*Fh*Fh,yrt=Fh*Fh*Fh;function N7(e){if(e instanceof Qs)return new Qs(e.l,e.a,e.b,e.opacity);if(e instanceof Pc)return F7(e);e instanceof Or||(e=Hg(e));var t=CD(e.r),r=CD(e.g),n=CD(e.b),i=LD((.2225045*t+.7168786*r+.0606169*n)/E7),o,s;return t===r&&r===n?o=s=i:(o=LD((.4360747*t+.3850649*r+.1430804*n)/M7),s=LD((.0139322*t+.0971045*r+.7141733*n)/D7)),new Qs(116*i-16,500*(o-i),200*(i-s),e.opacity)}function Lh(e,t,r,n){return arguments.length===1?N7(e):new Qs(e,t,r,n??1)}function Qs(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}Uc(Qs,Lh,eu(Ks,{brighter(e){return new Qs(this.l+Av*(e??1),this.a,this.b,this.opacity)},darker(e){return new Qs(this.l-Av*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=M7*RD(t),e=E7*RD(e),r=D7*RD(r),new Or(kD(3.1338561*t-1.6168667*e-.4906146*r),kD(-.9787684*t+1.9161415*e+.033454*r),kD(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));function LD(e){return e>yrt?Math.pow(e,1/3):e/O7+B7}function RD(e){return e>Fh?e*e*e:O7*(e-B7)}function kD(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function CD(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function grt(e){if(e instanceof Pc)return new Pc(e.h,e.c,e.l,e.opacity);if(e instanceof Qs||(e=N7(e)),e.a===0&&e.b===0)return new Pc(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Tv;return new Pc(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Kg(e,t,r,n){return arguments.length===1?grt(e):new Pc(e,t,r,n??1)}function Pc(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function F7(e){if(isNaN(e.h))return new Qs(e.l,0,0,e.opacity);var t=e.h*Iv;return new Qs(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Uc(Pc,Kg,eu(Ks,{brighter(e){return new Pc(this.h,this.c,this.l+Av*(e??1),this.opacity)},darker(e){return new Pc(this.h,this.c,this.l-Av*(e??1),this.opacity)},rgb(){return F7(this).rgb()}}));var C7=-.14861,UD=1.78277,PD=-.29227,Mv=-.90649,Qg=1.97294,L7=Qg*Mv,R7=Qg*UD,k7=UD*PD-Mv*C7;function brt(e){if(e instanceof Cf)return new Cf(e.h,e.s,e.l,e.opacity);e instanceof Or||(e=Hg(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=(k7*n+L7*t-R7*r)/(k7+L7-R7),o=n-i,s=(Qg*(r-i)-PD*o)/Mv,a=Math.sqrt(s*s+o*o)/(Qg*i*(1-i)),c=a?Math.atan2(s,o)*Tv-120:NaN;return new Cf(c<0?c+360:c,a,i,e.opacity)}function Zn(e,t,r,n){return arguments.length===1?brt(e):new Cf(e,t,r,n??1)}function Cf(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Uc(Cf,Zn,eu(Ks,{brighter(e){return e=e==null?kf:Math.pow(kf,e),new Cf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ru:Math.pow(ru,e),new Cf(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Iv,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new Or(255*(t+r*(C7*n+UD*i)),255*(t+r*(PD*n+Mv*i)),255*(t+r*(Qg*n)),this.opacity)}}));function $D(e,t,r,n,i){var o=e*e,s=o*e;return((1-3*e+3*o-s)*t+(4-6*o+3*s)*r+(1+3*e+3*o-3*s)*n+s*i)/6}function U7(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],o=e[n+1],s=n>0?e[n-1]:2*i-o,a=n<t-1?e[n+2]:2*o-i;return $D((r-n/t)*t,s,i,o,a)}}function P7(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],o=e[n%t],s=e[(n+1)%t],a=e[(n+2)%t];return $D((r-n/t)*t,i,o,s,a)}}var Rh=e=>()=>e;function $7(e,t){return function(r){return e+r*t}}function xrt(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function kh(e,t){var r=t-e;return r?$7(e,r>180||r<-180?r-360*Math.round(r/360):r):Rh(isNaN(e)?t:e)}function z7(e){return(e=+e)==1?rr:function(t,r){return r-t?xrt(t,r,e):Rh(isNaN(t)?r:t)}}function rr(e,t){var r=t-e;return r?$7(e,r):Rh(isNaN(e)?t:e)}var xo=function e(t){var r=z7(t);function n(i,o){var s=r((i=qr(i)).r,(o=qr(o)).r),a=r(i.g,o.g),c=r(i.b,o.b),l=rr(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 n.gamma=e,n}(1);function V7(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),o=new Array(r),s,a;for(s=0;s<r;++s)a=qr(t[s]),n[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return n=e(n),i=e(i),o=e(o),a.opacity=1,function(c){return a.r=n(c),a.g=i(c),a.b=o(c),a+""}}}var zD=V7(U7),_rt=V7(P7);function j7(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;i<r;++i)n[i]=e[i]*(1-o)+t[i]*o;return n}}function q7(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Y7(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),o=new Array(r),s;for(s=0;s<n;++s)i[s]=ji(e[s],t[s]);for(;s<r;++s)o[s]=t[s];return function(a){for(s=0;s<n;++s)o[s]=i[s](a);return o}}function W7(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Ze(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function G7(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=ji(e[i],t[i]):n[i]=t[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var jD=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,VD=new RegExp(jD.source,"g");function wrt(e){return function(){return e}}function vrt(e){return function(t){return e(t)+""}}function Jg(e,t){var r=jD.lastIndex=VD.lastIndex=0,n,i,o,s=-1,a=[],c=[];for(e=e+"",t=t+"";(n=jD.exec(e))&&(i=VD.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),a[s]?a[s]+=o:a[++s]=o),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:Ze(n,i)})),r=VD.lastIndex;return r<t.length&&(o=t.slice(r),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?vrt(c[0].x):wrt(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 ji(e,t){var r=typeof t,n;return t==null||r==="boolean"?Rh(t):(r==="number"?Ze:r==="string"?(n=Vi(t))?(t=n,xo):Jg:t instanceof Vi?xo:t instanceof Date?W7:q7(t)?j7:Array.isArray(t)?Y7:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?G7:Ze)(e,t)}function Uf(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var X7=180/Math.PI,Ev={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function qD(e,t,r,n,i,o){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*r+t*n)&&(r-=e*c,n-=t*c),(a=Math.sqrt(r*r+n*n))&&(r/=a,n/=a,c/=a),e*n<t*r&&(e=-e,t=-t,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*X7,skewX:Math.atan(c)*X7,scaleX:s,scaleY:a}}var Dv;function H7(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ev:qD(t.a,t.b,t.c,t.d,t.e,t.f)}function Z7(e){return e==null?Ev:(Dv||(Dv=document.createElementNS("http://www.w3.org/2000/svg","g")),Dv.setAttribute("transform",e),(e=Dv.transform.baseVal.consolidate())?(e=e.matrix,qD(e.a,e.b,e.c,e.d,e.e,e.f)):Ev)}function K7(e,t,r,n){function i(l){return l.length?l.pop()+" ":""}function o(l,u,f,d,h,p){if(l!==f||u!==d){var y=h.push("translate(",null,t,null,r);p.push({i:y-4,x:Ze(l,f)},{i:y-2,x:Ze(u,d)})}else(f||d)&&h.push("translate("+f+t+d+r)}function s(l,u,f,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:f.push(i(f)+"rotate(",null,n)-2,x:Ze(l,u)})):u&&f.push(i(f)+"rotate("+u+n)}function a(l,u,f,d){l!==u?d.push({i:f.push(i(f)+"skewX(",null,n)-2,x:Ze(l,u)}):u&&f.push(i(f)+"skewX("+u+n)}function c(l,u,f,d,h,p){if(l!==f||u!==d){var y=h.push(i(h)+"scale(",null,",",null,")");p.push({i:y-4,x:Ze(l,f)},{i:y-2,x:Ze(u,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(l,u){var f=[],d=[];return l=e(l),u=e(u),o(l.translateX,l.translateY,u.translateX,u.translateY,f,d),s(l.rotate,u.rotate,f,d),a(l.skewX,u.skewX,f,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,d),l=u=null,function(h){for(var p=-1,y=d.length,g;++p<y;)f[(g=d[p]).i]=g.x(h);return f.join("")}}}var YD=K7(H7,"px, ","px)","deg)"),WD=K7(Z7,", ",")",")");var Srt=1e-12;function Q7(e){return((e=Math.exp(e))+1/e)/2}function Irt(e){return((e=Math.exp(e))-1/e)/2}function Trt(e){return((e=Math.exp(2*e))-1)/(e+1)}var GD=function e(t,r,n){function i(o,s){var a=o[0],c=o[1],l=o[2],u=s[0],f=s[1],d=s[2],h=u-a,p=f-c,y=h*h+p*p,g,m;if(y<Srt)m=Math.log(d/l)/t,g=function(I){return[a+I*h,c+I*p,l*Math.exp(t*I*m)]};else{var b=Math.sqrt(y),x=(d*d-l*l+n*y)/(2*l*r*b),_=(d*d-l*l-n*y)/(2*d*r*b),v=Math.log(Math.sqrt(x*x+1)-x),w=Math.log(Math.sqrt(_*_+1)-_);m=(w-v)/t,g=function(I){var D=I*m,A=Q7(v),B=l/(r*b)*(A*Trt(t*D+v)-Irt(v));return[a+B*h,c+B*p,l*A/Q7(t*D+v)]}}return g.duration=m*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 J7(e){return function(t,r){var n=e((t=Zg(t)).h,(r=Zg(r)).h),i=rr(t.s,r.s),o=rr(t.l,r.l),s=rr(t.opacity,r.opacity);return function(a){return t.h=n(a),t.s=i(a),t.l=o(a),t.opacity=s(a),t+""}}}var XD=J7(kh),Art=J7(rr);function Bv(e,t){var r=rr((e=Lh(e)).l,(t=Lh(t)).l),n=rr(e.a,t.a),i=rr(e.b,t.b),o=rr(e.opacity,t.opacity);return function(s){return e.l=r(s),e.a=n(s),e.b=i(s),e.opacity=o(s),e+""}}function t9(e){return function(t,r){var n=e((t=Kg(t)).h,(r=Kg(r)).h),i=rr(t.c,r.c),o=rr(t.l,r.l),s=rr(t.opacity,r.opacity);return function(a){return t.h=n(a),t.c=i(a),t.l=o(a),t.opacity=s(a),t+""}}}var HD=t9(kh),Mrt=t9(rr);function e9(e){return function t(r){r=+r;function n(i,o){var s=e((i=Zn(i)).h,(o=Zn(o)).h),a=rr(i.s,o.s),c=rr(i.l,o.l),l=rr(i.opacity,o.opacity);return function(u){return i.h=s(u),i.s=a(u),i.l=c(Math.pow(u,r)),i.opacity=l(u),i+""}}return n.gamma=t,n}(1)}var Ert=e9(kh),Ch=e9(rr);function Js(e,t){t===void 0&&(t=e,e=ji);for(var r=0,n=t.length-1,i=t[0],o=new Array(n<0?0:n);r<n;)o[r]=e(i,i=t[++r]);return function(s){var a=Math.max(0,Math.min(n-1,Math.floor(s*=n)));return o[a](s-a)}}function En(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e(n/(t-1));return r}var Uh=0,e0=0,t0=0,n9=1e3,Ov,r0,Nv=0,Pf=0,Fv=0,n0=typeof performance=="object"&&performance.now?performance:Date,i9=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function o0(){return Pf||(i9(Drt),Pf=n0.now()+Fv)}function Drt(){Pf=0}function i0(){this._call=this._time=this._next=null}i0.prototype=Lv.prototype={constructor:i0,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?o0():+r)+(t==null?0:+t),!this._next&&r0!==this&&(r0?r0._next=this:Ov=this,r0=this),this._call=e,this._time=r,ZD()},stop:function(){this._call&&(this._call=null,this._time=1/0,ZD())}};function Lv(e,t,r){var n=new i0;return n.restart(e,t,r),n}function o9(){o0(),++Uh;for(var e=Ov,t;e;)(t=Pf-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Uh}function r9(){Pf=(Nv=n0.now())+Fv,Uh=e0=0;try{o9()}finally{Uh=0,Ort(),Pf=0}}function Brt(){var e=n0.now(),t=e-Nv;t>n9&&(Fv-=t,Nv=e)}function Ort(){for(var e,t=Ov,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Ov=r);r0=e,ZD(n)}function ZD(e){if(!Uh){e0&&(e0=clearTimeout(e0));var t=e-Pf;t>24?(e<1/0&&(e0=setTimeout(r9,e-n0.now()-Fv)),t0&&(t0=clearInterval(t0))):(t0||(Nv=n0.now(),t0=setInterval(Brt,n9)),Uh=1,i9(r9))}}function Rv(e,t,r){var n=new i0;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var Nrt=Nf("start","end","cancel","interrupt"),Frt=[],c9=0,s9=1,Cv=2,kv=3,a9=4,Uv=5,s0=6;function nu(e,t,r,n,i,o){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;Lrt(e,r,{name:t,index:n,group:i,on:Nrt,tween:Frt,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:c9})}function a0(e,t){var r=Yr(e,t);if(r.state>c9)throw new Error("too late; already scheduled");return r}function bn(e,t){var r=Yr(e,t);if(r.state>kv)throw new Error("too late; already running");return r}function Yr(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Lrt(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=Lv(o,0,r.time);function o(l){r.state=s9,r.timer.restart(s,r.delay,r.time),r.delay<=l&&s(l-r.delay)}function s(l){var u,f,d,h;if(r.state!==s9)return c();for(u in n)if(h=n[u],h.name===r.name){if(h.state===kv)return Rv(s);h.state===a9?(h.state=s0,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete n[u]):+u<t&&(h.state=s0,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete n[u])}if(Rv(function(){r.state===kv&&(r.state=a9,r.timer.restart(a,r.delay,r.time),a(l))}),r.state=Cv,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Cv){for(r.state=kv,i=new Array(d=r.tween.length),u=0,f=-1;u<d;++u)(h=r.tween[u].value.call(e,e.__data__,r.index,r.group))&&(i[++f]=h);i.length=f+1}}function a(l){for(var u=l<r.duration?r.ease.call(null,l/r.duration):(r.timer.restart(c),r.state=Uv,1),f=-1,d=i.length;++f<d;)i[f].call(e,u);r.state===Uv&&(r.on.call("end",e,e.__data__,r.index,r.group),c())}function c(){r.state=s0,r.timer.stop(),delete n[t];for(var l in n)return;delete e.__transition}}function ta(e,t){var r=e.__transition,n,i,o=!0,s;if(r){t=t==null?null:t+"";for(s in r){if((n=r[s]).name!==t){o=!1;continue}i=n.state>Cv&&n.state<Uv,n.state=s0,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[s]}o&&delete e.__transition}}function l9(e){return this.each(function(){ta(this,e)})}function Rrt(e,t){var r,n;return function(){var i=bn(this,e),o=i.tween;if(o!==r){n=r=o;for(var s=0,a=n.length;s<a;++s)if(n[s].name===t){n=n.slice(),n.splice(s,1);break}}i.tween=n}}function krt(e,t,r){var n,i;if(typeof r!="function")throw new Error;return function(){var o=bn(this,e),s=o.tween;if(s!==n){i=(n=s).slice();for(var a={name:t,value:r},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 u9(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=Yr(this.node(),r).tween,i=0,o=n.length,s;i<o;++i)if((s=n[i]).name===e)return s.value;return null}return this.each((t==null?Rrt:krt)(r,e,t))}function Ph(e,t,r){var n=e._id;return e.each(function(){var i=bn(this,n);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return Yr(i,n).value[t]}}function Pv(e,t){var r;return(typeof t=="number"?Ze:t instanceof Vi?xo:(r=Vi(t))?(t=r,xo):Jg)(e,t)}function Crt(e){return function(){this.removeAttribute(e)}}function Urt(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Prt(e,t,r){var n,i=r+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===n?o:o=t(n=s,r)}}function $rt(e,t,r){var n,i=r+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===n?o:o=t(n=s,r)}}function zrt(e,t,r){var n,i,o;return function(){var s,a=r(this),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===n&&c===i?o:(i=c,o=t(n=s,a)))}}function Vrt(e,t,r){var n,i,o;return function(){var s,a=r(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===n&&c===i?o:(i=c,o=t(n=s,a)))}}function f9(e,t){var r=Rc(e),n=r==="transform"?WD:Pv;return this.attrTween(e,typeof t=="function"?(r.local?Vrt:zrt)(r,n,Ph(this,"attr."+e,t)):t==null?(r.local?Urt:Crt)(r):(r.local?$rt:Prt)(r,n,t))}function jrt(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function qrt(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Yrt(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&qrt(e,o)),r}return i._value=t,i}function Wrt(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&jrt(e,o)),r}return i._value=t,i}function d9(e,t){var r="attr."+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;var n=Rc(e);return this.tween(r,(n.local?Yrt:Wrt)(n,t))}function Grt(e,t){return function(){a0(this,e).delay=+t.apply(this,arguments)}}function Xrt(e,t){return t=+t,function(){a0(this,e).delay=t}}function h9(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Grt:Xrt)(t,e)):Yr(this.node(),t).delay}function Hrt(e,t){return function(){bn(this,e).duration=+t.apply(this,arguments)}}function Zrt(e,t){return t=+t,function(){bn(this,e).duration=t}}function p9(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Hrt:Zrt)(t,e)):Yr(this.node(),t).duration}function Krt(e,t){if(typeof t!="function")throw new Error;return function(){bn(this,e).ease=t}}function m9(e){var t=this._id;return arguments.length?this.each(Krt(t,e)):Yr(this.node(),t).ease}function Qrt(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;bn(this,e).ease=r}}function y9(e){if(typeof e!="function")throw new Error;return this.each(Qrt(this._id,e))}function g9(e){typeof e!="function"&&(e=qg(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var o=t[i],s=o.length,a=n[i]=[],c,l=0;l<s;++l)(c=o[l])&&e.call(c,c.__data__,l,o)&&a.push(c);return new Kn(n,this._parents,this._name,this._id)}function b9(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,o=Math.min(n,i),s=new Array(n),a=0;a<o;++a)for(var c=t[a],l=r[a],u=c.length,f=s[a]=new Array(u),d,h=0;h<u;++h)(d=c[h]||l[h])&&(f[h]=d);for(;a<n;++a)s[a]=t[a];return new Kn(s,this._parents,this._name,this._id)}function Jrt(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function tnt(e,t,r){var n,i,o=Jrt(t)?a0:bn;return function(){var s=o(this,e),a=s.on;a!==n&&(i=(n=a).copy()).on(t,r),s.on=i}}function x9(e,t){var r=this._id;return arguments.length<2?Yr(this.node(),r).on.on(e):this.each(tnt(r,e,t))}function ent(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function _9(){return this.on("end.remove",ent(this._id))}function w9(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Ff(e));for(var n=this._groups,i=n.length,o=new Array(i),s=0;s<i;++s)for(var a=n[s],c=a.length,l=o[s]=new Array(c),u,f,d=0;d<c;++d)(u=a[d])&&(f=e.call(u,u.__data__,d,a))&&("__data__"in u&&(f.__data__=u.__data__),l[d]=f,nu(l[d],t,r,d,l,Yr(u,r)));return new Kn(o,this._parents,t,r)}function v9(e){var t=this._name,r=this._id;typeof e!="function"&&(e=jg(e));for(var n=this._groups,i=n.length,o=[],s=[],a=0;a<i;++a)for(var c=n[a],l=c.length,u,f=0;f<l;++f)if(u=c[f]){for(var d=e.call(u,u.__data__,f,c),h,p=Yr(u,r),y=0,g=d.length;y<g;++y)(h=d[y])&&nu(h,t,r,y,d,p);o.push(d),s.push(u)}return new Kn(o,s,t,r)}var rnt=Cc.prototype.constructor;function S9(){return new rnt(this._groups,this._parents)}function nnt(e,t){var r,n,i;return function(){var o=tu(this,e),s=(this.style.removeProperty(e),tu(this,e));return o===s?null:o===r&&s===n?i:i=t(r=o,n=s)}}function I9(e){return function(){this.style.removeProperty(e)}}function int(e,t,r){var n,i=r+"",o;return function(){var s=tu(this,e);return s===i?null:s===n?o:o=t(n=s,r)}}function ont(e,t,r){var n,i,o;return function(){var s=tu(this,e),a=r(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),tu(this,e))),s===c?null:s===n&&c===i?o:(i=c,o=t(n=s,a))}}function snt(e,t){var r,n,i,o="style."+t,s="end."+o,a;return function(){var c=bn(this,e),l=c.on,u=c.value[o]==null?a||(a=I9(t)):void 0;(l!==r||i!==u)&&(n=(r=l).copy()).on(s,i=u),c.on=n}}function T9(e,t,r){var n=(e+="")=="transform"?YD:Pv;return t==null?this.styleTween(e,nnt(e,n)).on("end.style."+e,I9(e)):typeof t=="function"?this.styleTween(e,ont(e,n,Ph(this,"style."+e,t))).each(snt(this._id,e)):this.styleTween(e,int(e,n,t),r).on("end.style."+e,null)}function ant(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function cnt(e,t,r){var n,i;function o(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&ant(e,s,r)),n}return o._value=t,o}function A9(e,t,r){var n="style."+(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;return this.tween(n,cnt(e,t,r??""))}function lnt(e){return function(){this.textContent=e}}function unt(e){return function(){var t=e(this);this.textContent=t??""}}function M9(e){return this.tween("text",typeof e=="function"?unt(Ph(this,"text",e)):lnt(e==null?"":e+""))}function fnt(e){return function(t){this.textContent=e.call(this,t)}}function dnt(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&fnt(i)),t}return n._value=e,n}function E9(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,dnt(e))}function D9(){for(var e=this._name,t=this._id,r=$v(),n=this._groups,i=n.length,o=0;o<i;++o)for(var s=n[o],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=Yr(c,t);nu(c,e,r,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Kn(n,this._parents,e,r)}function B9(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};r.each(function(){var l=bn(this,n),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 hnt=0;function Kn(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function O9(e){return Cc().transition(e)}function $v(){return++hnt}var $c=Cc.prototype;Kn.prototype=O9.prototype={constructor:Kn,select:w9,selectAll:v9,selectChild:$c.selectChild,selectChildren:$c.selectChildren,filter:g9,merge:b9,selection:S9,transition:D9,call:$c.call,nodes:$c.nodes,node:$c.node,size:$c.size,empty:$c.empty,each:$c.each,on:x9,attr:f9,attrTween:d9,style:T9,styleTween:A9,text:M9,textTween:E9,remove:_9,tween:u9,delay:h9,duration:p9,ease:m9,easeVarying:y9,end:B9,[Symbol.iterator]:$c[Symbol.iterator]};function zv(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var pnt={time:null,delay:0,duration:250,ease:zv};function mnt(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function N9(e){var t,r;e instanceof Kn?(t=e._id,e=e._name):(t=$v(),(r=pnt).time=o0(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,o=0;o<i;++o)for(var s=n[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&nu(c,e,t,l,s,r||mnt(c,t));return new Kn(n,this._parents,e,t)}Cc.prototype.interrupt=l9;Cc.prototype.transition=N9;var Vv=e=>()=>e;function KD(e,{sourceEvent:t,target:r,selection:n,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},selection:{value:n,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function F9(e){e.stopImmediatePropagation()}function jv(e){e.preventDefault(),e.stopImmediatePropagation()}var L9={name:"drag"},QD={name:"space"},$h={name:"handle"},zh={name:"center"},{abs:R9,max:Dn,min:Bn}=Math;function k9(e){return[+e[0],+e[1]]}function tB(e){return[k9(e[0]),k9(e[1])]}var qv={name:"x",handles:["w","e"].map(c0),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]]}},Yv={name:"y",handles:["n","s"].map(c0),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]]}},ynt={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(c0),input:function(e){return e==null?null:tB(e)},output:function(e){return e}},zc={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"},C9={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},U9={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},gnt={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},bnt={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function c0(e){return{type:e}}function xnt(e){return!e.ctrlKey&&!e.button}function _nt(){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 wnt(){return navigator.maxTouchPoints||"ontouchstart"in this}function JD(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function vnt(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function eB(){return iB(qv)}function rB(){return iB(Yv)}function nB(){return iB(ynt)}function iB(e){var t=_nt,r=xnt,n=wnt,i=!0,o=Nf("start","brush","end"),s=6,a;function c(g){var m=g.property("__brush",y).selectAll(".overlay").data([c0("overlay")]);m.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",zc.overlay).merge(m).each(function(){var x=JD(this).extent;ae(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([c0("selection")]).enter().append("rect").attr("class","selection").attr("cursor",zc.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 zc[x.type]}),g.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(n).on("touchstart.brush",d).on("touchmove.brush",h).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(g,m,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,_=x.__brush,v=u(x,arguments),w=_.selection,I=e.input(typeof m=="function"?m.apply(this,arguments):m,_.extent),D=ji(w,I);function A(B){_.selection=B===1&&I===null?null:D(B),l.call(x),v.brush()}return w!==null&&I!==null?A:A(1)}):g.each(function(){var x=this,_=arguments,v=x.__brush,w=e.input(typeof m=="function"?m.apply(x,_):m,v.extent),I=u(x,_).beforestart();ta(x),v.selection=w===null?null:w,l.call(x),I.start(b).brush(b).end(b)})},c.clear=function(g,m){c.move(g,null,m)};function l(){var g=ae(this),m=JD(this).selection;m?(g.selectAll(".selection").style("display",null).attr("x",m[0][0]).attr("y",m[0][1]).attr("width",m[1][0]-m[0][0]).attr("height",m[1][1]-m[0][1]),g.selectAll(".handle").style("display",null).attr("x",function(b){return b.type[b.type.length-1]==="e"?m[1][0]-s/2:m[0][0]-s/2}).attr("y",function(b){return b.type[0]==="s"?m[1][1]-s/2:m[0][1]-s/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?m[1][0]-m[0][0]+s:s}).attr("height",function(b){return b.type==="e"||b.type==="w"?m[1][1]-m[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,m,b){var x=g.__brush.emitter;return x&&(!b||!x.clean)?x:new f(g,m,b)}function f(g,m,b){this.that=g,this.args=m,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,m){return this.starting?(this.starting=!1,this.emit("start",g,m)):this.emit("brush",g),this},brush:function(g,m){return this.emit("brush",g,m),this},end:function(g,m){return--this.active===0&&(delete this.state.emitter,this.emit("end",g,m)),this},emit:function(g,m,b){var x=ae(this.that).datum();o.call(g,this.that,new KD(g,{sourceEvent:m,target:c,selection:e.output(this.state.selection),mode:b,dispatch:o}),x)}};function d(g){if(a&&!g.touches||!r.apply(this,arguments))return;var m=this,b=g.target.__data__.type,x=(i&&g.metaKey?b="overlay":b)==="selection"?L9:i&&g.altKey?zh:$h,_=e===Yv?null:gnt[b],v=e===qv?null:bnt[b],w=JD(m),I=w.extent,D=w.selection,A=I[0][0],B,M,O=I[0][1],R,S,T=I[1][0],E,C,U=I[1][1],k,$,z=0,V=0,Q,nt=_&&v&&i&&g.shiftKey,st,ut,X=Array.from(g.touches||[g],ot=>{let Me=ot.identifier;return ot=Mn(ot,m),ot.point0=ot.slice(),ot.identifier=Me,ot});ta(m);var at=u(m,arguments,!0).beforestart();if(b==="overlay"){D&&(Q=!0);let ot=[X[0],X[1]||X[0]];w.selection=D=[[B=e===Yv?A:Bn(ot[0][0],ot[1][0]),R=e===qv?O:Bn(ot[0][1],ot[1][1])],[E=e===Yv?T:Dn(ot[0][0],ot[1][0]),k=e===qv?U:Dn(ot[0][1],ot[1][1])]],X.length>1&&Qt(g)}else B=D[0][0],R=D[0][1],E=D[1][0],k=D[1][1];M=B,S=R,C=E,$=k;var q=ae(m).attr("pointer-events","none"),J=q.selectAll(".overlay").attr("cursor",zc[b]);if(g.touches)at.moved=j,at.ended=gt;else{var ct=ae(g.view).on("mousemove.brush",j,!0).on("mouseup.brush",gt,!0);i&&ct.on("keydown.brush",he,!0).on("keyup.brush",pe,!0),Wg(g.view)}l.call(m),at.start(g,x.name);function j(ot){for(let Me of ot.changedTouches||[ot])for(let Ti of X)Ti.identifier===Me.identifier&&(Ti.cur=Mn(Me,m));if(nt&&!st&&!ut&&X.length===1){let Me=X[0];R9(Me.cur[0]-Me[0])>R9(Me.cur[1]-Me[1])?ut=!0:st=!0}for(let Me of X)Me.cur&&(Me[0]=Me.cur[0],Me[1]=Me.cur[1]);Q=!0,jv(ot),Qt(ot)}function Qt(ot){let Me=X[0],Ti=Me.point0;var vs;switch(z=Me[0]-Ti[0],V=Me[1]-Ti[1],x){case QD:case L9:{_&&(z=Dn(A-B,Bn(T-E,z)),M=B+z,C=E+z),v&&(V=Dn(O-R,Bn(U-k,V)),S=R+V,$=k+V);break}case $h:{X[1]?(_&&(M=Dn(A,Bn(T,X[0][0])),C=Dn(A,Bn(T,X[1][0])),_=1),v&&(S=Dn(O,Bn(U,X[0][1])),$=Dn(O,Bn(U,X[1][1])),v=1)):(_<0?(z=Dn(A-B,Bn(T-B,z)),M=B+z,C=E):_>0&&(z=Dn(A-E,Bn(T-E,z)),M=B,C=E+z),v<0?(V=Dn(O-R,Bn(U-R,V)),S=R+V,$=k):v>0&&(V=Dn(O-k,Bn(U-k,V)),S=R,$=k+V));break}case zh:{_&&(M=Dn(A,Bn(T,B-z*_)),C=Dn(A,Bn(T,E+z*_))),v&&(S=Dn(O,Bn(U,R-V*v)),$=Dn(O,Bn(U,k+V*v)));break}}C<M&&(_*=-1,vs=B,B=E,E=vs,vs=M,M=C,C=vs,b in C9&&J.attr("cursor",zc[b=C9[b]])),$<S&&(v*=-1,vs=R,R=k,k=vs,vs=S,S=$,$=vs,b in U9&&J.attr("cursor",zc[b=U9[b]])),w.selection&&(D=w.selection),st&&(M=D[0][0],C=D[1][0]),ut&&(S=D[0][1],$=D[1][1]),(D[0][0]!==M||D[0][1]!==S||D[1][0]!==C||D[1][1]!==$)&&(w.selection=[[M,S],[C,$]],l.call(m),at.brush(ot,x.name))}function gt(ot){if(F9(ot),ot.touches){if(ot.touches.length)return;a&&clearTimeout(a),a=setTimeout(function(){a=null},500)}else Gg(ot.view,Q),ct.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),J.attr("cursor",zc.overlay),w.selection&&(D=w.selection),vnt(D)&&(w.selection=null,l.call(m)),at.end(ot,x.name)}function he(ot){switch(ot.keyCode){case 16:{nt=_&&v;break}case 18:{x===$h&&(_&&(E=C-z*_,B=M+z*_),v&&(k=$-V*v,R=S+V*v),x=zh,Qt(ot));break}case 32:{(x===$h||x===zh)&&(_<0?E=C-z:_>0&&(B=M-z),v<0?k=$-V:v>0&&(R=S-V),x=QD,J.attr("cursor",zc.selection),Qt(ot));break}default:return}jv(ot)}function pe(ot){switch(ot.keyCode){case 16:{nt&&(st=ut=nt=!1,Qt(ot));break}case 18:{x===zh&&(_<0?E=C:_>0&&(B=M),v<0?k=$:v>0&&(R=S),x=$h,Qt(ot));break}case 32:{x===QD&&(ot.altKey?(_&&(E=C-z*_,B=M+z*_),v&&(k=$-V*v,R=S+V*v),x=zh):(_<0?E=C:_>0&&(B=M),v<0?k=$:v>0&&(R=S),x=$h),J.attr("cursor",zc[b]),Qt(ot));break}default:return}jv(ot)}}function h(g){u(this,arguments).moved(g)}function p(g){u(this,arguments).ended(g)}function y(){var g=this.__brush||{selection:null};return g.extent=tB(t.apply(this,arguments)),g.dim=e,g}return c.extent=function(g){return arguments.length?(t=typeof g=="function"?g:Vv(tB(g)),c):t},c.filter=function(g){return arguments.length?(r=typeof g=="function"?g:Vv(!!g),c):r},c.touchable=function(g){return arguments.length?(n=typeof g=="function"?g:Vv(!!g),c):n},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 oB=Math.PI,sB=2*oB,$f=1e-6,Snt=sB-$f;function P9(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Int(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return P9;let r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;i<o;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}var iu=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?P9:Int(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,o,s){this._append`C${+t},${+r},${+n},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,r,n,i,o){if(t=+t,r=+r,n=+n,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,c=n-t,l=i-r,u=s-t,f=a-r,d=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(d>$f)if(!(Math.abs(f*c-l*u)>$f)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-s,p=i-a,y=c*c+l*l,g=h*h+p*p,m=Math.sqrt(y),b=Math.sqrt(d),x=o*Math.tan((oB-Math.acos((y+d-g)/(2*m*b)))/2),_=x/b,v=x/m;Math.abs(_-1)>$f&&this._append`L${t+_*u},${r+_*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=t+v*c},${this._y1=r+v*l}`}}arc(t,r,n,i,o,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(i),c=n*Math.sin(i),l=t+a,u=r+c,f=1^s,d=s?i-o:o-i;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>$f||Math.abs(this._y1-u)>$f)&&this._append`L${l},${u}`,n&&(d<0&&(d=d%sB+sB),d>Snt?this._append`A${n},${n},0,1,${f},${t-a},${r-c}A${n},${n},0,1,${f},${this._x1=l},${this._y1=u}`:d>$f&&this._append`A${n},${n},0,${+(d>=oB)},${f},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function $9(){return new iu}$9.prototype=iu.prototype;function Qn(e=3){return new iu(+e)}var Tnt=Array.prototype,Wv=Tnt.slice;function z9(e,t){return e-t}function V9(e){for(var t=0,r=e.length,n=e[r-1][1]*e[0][0]-e[r-1][0]*e[0][1];++t<r;)n+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return n}var ea=e=>()=>e;function j9(e,t){for(var r=-1,n=t.length,i;++r<n;)if(i=Ant(e,t[r]))return i;return 0}function Ant(e,t){for(var r=t[0],n=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],d=f[0],h=f[1];if(Mnt(c,f,t))return 0;u>n!=h>n&&r<(d-l)*(n-u)/(h-u)+l&&(i=-i)}return i}function Mnt(e,t,r){var n;return Ent(e,t,r)&&Dnt(e[n=+(e[0]===t[0])],r[n],t[n])}function Ent(e,t,r){return(t[0]-e[0])*(r[1]-e[1])===(r[0]-e[0])*(t[1]-e[1])}function Dnt(e,t,r){return e<=t&&t<=r||r<=t&&t<=e}function q9(){}var Vc=[[],[[[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 ou(){var e=1,t=1,r=Ql,n=c;function i(l){var u=r(l);if(Array.isArray(u))u=u.slice().sort(z9);else{let f=Be(l,Bnt);for(u=yn(...Dh(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 d=[],h=[];return s(l,f,function(p){n(p,l,f),V9(p)>0?d.push([p]):h.push(p)}),h.forEach(function(p){for(var y=0,g=d.length,m;y<g;++y)if(j9((m=d[y])[0],p)!==-1){m.push(p);return}}),{type:"MultiPolygon",value:u,coordinates:d}}function s(l,u,f){var d=new Array,h=new Array,p,y,g,m,b,x;for(p=y=-1,m=zf(l[0],u),Vc[m<<1].forEach(_);++p<e-1;)g=m,m=zf(l[p+1],u),Vc[g|m<<1].forEach(_);for(Vc[m<<0].forEach(_);++y<t-1;){for(p=-1,m=zf(l[y*e+e],u),b=zf(l[y*e],u),Vc[m<<1|b<<2].forEach(_);++p<e-1;)g=m,m=zf(l[y*e+e+p+1],u),x=b,b=zf(l[y*e+p+1],u),Vc[g|m<<1|b<<2|x<<3].forEach(_);Vc[m|b<<3].forEach(_)}for(p=-1,b=l[y*e]>=u,Vc[b<<2].forEach(_);++p<e-1;)x=b,b=zf(l[y*e+p+1],u),Vc[b<<2|x<<3].forEach(_);Vc[b<<3].forEach(_);function _(v){var w=[v[0][0]+p,v[0][1]+y],I=[v[1][0]+p,v[1][1]+y],D=a(w),A=a(I),B,M;(B=h[D])?(M=d[A])?(delete h[B.end],delete d[M.start],B===M?(B.ring.push(I),f(B.ring)):d[B.start]=h[M.end]={start:B.start,end:M.end,ring:B.ring.concat(M.ring)}):(delete h[B.end],B.ring.push(I),h[B.end=A]=B):(B=d[A])?(M=h[D])?(delete d[B.start],delete h[M.end],B===M?(B.ring.push(I),f(B.ring)):d[M.start]=h[B.end]={start:M.start,end:B.end,ring:M.ring.concat(B.ring)}):(delete d[B.start],B.ring.unshift(w),d[B.start=D]=B):d[D]=h[A]={start:D,end:A,ring:[w,I]}}}function a(l){return l[0]*2+l[1]*(e+1)*4}function c(l,u,f){l.forEach(function(d){var h=d[0],p=d[1],y=h|0,g=p|0,m=aB(u[g*e+y]);h>0&&h<e&&y===h&&(d[0]=Y9(h,aB(u[g*e+y-1]),m,f)),p>0&&p<t&&g===p&&(d[1]=Y9(p,aB(u[(g-1)*e+y]),m,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?(r=typeof l=="function"?l:Array.isArray(l)?ea(Wv.call(l)):ea(l),i):r},i.smooth=function(l){return arguments.length?(n=l?c:q9,i):n===c},i}function Bnt(e){return isFinite(e)?e:NaN}function zf(e,t){return e==null?!1:+e>=t}function aB(e){return e==null||isNaN(e=+e)?-1/0:e}function Y9(e,t,r,n){let i=n-t,o=r-t,s=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(s)?e:e+s-.5}function Ont(e){return e[0]}function Nnt(e){return e[1]}function Fnt(){return 1}function cB(){var e=Ont,t=Nnt,r=Fnt,n=960,i=500,o=20,s=2,a=o*3,c=n+a*2>>s,l=i+a*2>>s,u=ea(20);function f(b){var x=new Float32Array(c*l),_=Math.pow(2,-s),v=-1;for(let R of b){var w=(e(R,++v,b)+a)*_,I=(t(R,v,b)+a)*_,D=+r(R,v,b);if(D&&w>=0&&w<c&&I>=0&&I<l){var A=Math.floor(w),B=Math.floor(I),M=w-A-.5,O=I-B-.5;x[A+B*c]+=(1-M)*(1-O)*D,x[A+1+B*c]+=M*(1-O)*D,x[A+1+(B+1)*c]+=M*O*D,x[A+(B+1)*c]+=(1-M)*O*D}}return Cg({data:x,width:c,height:l},o*_),x}function d(b){var x=f(b),_=u(x),v=Math.pow(2,2*s);return Array.isArray(_)||(_=yn(Number.MIN_VALUE,de(x)/v,_)),ou().size([c,l]).thresholds(_.map(w=>w*v))(x).map((w,I)=>(w.value=+_[I],h(w)))}d.contours=function(b){var x=f(b),_=ou().size([c,l]),v=Math.pow(2,2*s),w=I=>{I=+I;var D=h(_.contour(x,I*v));return D.value=I,D};return Object.defineProperty(w,"max",{get:()=>de(x)/v}),w};function h(b){return b.coordinates.forEach(p),b}function p(b){b.forEach(y)}function y(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 m(){return a=o*3,c=n+a*2>>s,l=i+a*2>>s,d}return d.x=function(b){return arguments.length?(e=typeof b=="function"?b:ea(+b),d):e},d.y=function(b){return arguments.length?(t=typeof b=="function"?b:ea(+b),d):t},d.weight=function(b){return arguments.length?(r=typeof b=="function"?b:ea(+b),d):r},d.size=function(b){if(!arguments.length)return[n,i];var x=+b[0],_=+b[1];if(!(x>=0&&_>=0))throw new Error("invalid size");return n=x,i=_,m()},d.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),m()},d.thresholds=function(b){return arguments.length?(u=typeof b=="function"?b:Array.isArray(b)?ea(Wv.call(b)):ea(b),d):u},d.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,m()},d}var xe=11102230246251565e-32,Nr=134217729,l0=(3+8*xe)*xe;function Vf(e,t,r,n,i){let o,s,a,c,l=t[0],u=n[0],f=0,d=0;u>l==u>-l?(o=l,l=t[++f]):(o=u,u=n[++d]);let h=0;if(f<e&&d<r)for(u>l==u>-l?(s=l+o,a=o-(s-l),l=t[++f]):(s=u+o,a=o-(s-u),u=n[++d]),o=s,a!==0&&(i[h++]=a);f<e&&d<r;)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=n[++d]),o=s,a!==0&&(i[h++]=a);for(;f<e;)s=o+l,c=s-o,a=o-(s-c)+(l-c),l=t[++f],o=s,a!==0&&(i[h++]=a);for(;d<r;)s=o+u,c=s-o,a=o-(s-c)+(u-c),u=n[++d],o=s,a!==0&&(i[h++]=a);return(o!==0||h===0)&&(i[h++]=o),h}function u0(e,t){let r=t[0];for(let n=1;n<e;n++)r+=t[n];return r}function G(e){return new Float64Array(e)}var Lnt=(3+16*xe)*xe,Rnt=(2+12*xe)*xe,knt=(9+64*xe)*xe*xe,Vh=G(4),W9=G(8),G9=G(12),X9=G(16),Jn=G(4);function Cnt(e,t,r,n,i,o,s){let a,c,l,u,f,d,h,p,y,g,m,b,x,_,v,w,I,D,A=e-i,B=r-i,M=t-o,O=n-o;_=A*O,d=Nr*A,h=d-(d-A),p=A-h,d=Nr*O,y=d-(d-O),g=O-y,v=p*g-(_-h*y-p*y-h*g),w=M*B,d=Nr*M,h=d-(d-M),p=M-h,d=Nr*B,y=d-(d-B),g=B-y,I=p*g-(w-h*y-p*y-h*g),m=v-I,f=v-m,Vh[0]=v-(m+f)+(f-I),b=_+m,f=b-_,x=_-(b-f)+(m-f),m=x-w,f=x-m,Vh[1]=x-(m+f)+(f-w),D=b+m,f=D-b,Vh[2]=b-(D-f)+(m-f),Vh[3]=D;let R=u0(4,Vh),S=Rnt*s;if(R>=S||-R>=S||(f=e-A,a=e-(A+f)+(f-i),f=r-B,l=r-(B+f)+(f-i),f=t-M,c=t-(M+f)+(f-o),f=n-O,u=n-(O+f)+(f-o),a===0&&c===0&&l===0&&u===0)||(S=knt*s+l0*Math.abs(R),R+=A*u+O*a-(M*l+B*c),R>=S||-R>=S))return R;_=a*O,d=Nr*a,h=d-(d-a),p=a-h,d=Nr*O,y=d-(d-O),g=O-y,v=p*g-(_-h*y-p*y-h*g),w=c*B,d=Nr*c,h=d-(d-c),p=c-h,d=Nr*B,y=d-(d-B),g=B-y,I=p*g-(w-h*y-p*y-h*g),m=v-I,f=v-m,Jn[0]=v-(m+f)+(f-I),b=_+m,f=b-_,x=_-(b-f)+(m-f),m=x-w,f=x-m,Jn[1]=x-(m+f)+(f-w),D=b+m,f=D-b,Jn[2]=b-(D-f)+(m-f),Jn[3]=D;let T=Vf(4,Vh,4,Jn,W9);_=A*u,d=Nr*A,h=d-(d-A),p=A-h,d=Nr*u,y=d-(d-u),g=u-y,v=p*g-(_-h*y-p*y-h*g),w=M*l,d=Nr*M,h=d-(d-M),p=M-h,d=Nr*l,y=d-(d-l),g=l-y,I=p*g-(w-h*y-p*y-h*g),m=v-I,f=v-m,Jn[0]=v-(m+f)+(f-I),b=_+m,f=b-_,x=_-(b-f)+(m-f),m=x-w,f=x-m,Jn[1]=x-(m+f)+(f-w),D=b+m,f=D-b,Jn[2]=b-(D-f)+(m-f),Jn[3]=D;let E=Vf(T,W9,4,Jn,G9);_=a*u,d=Nr*a,h=d-(d-a),p=a-h,d=Nr*u,y=d-(d-u),g=u-y,v=p*g-(_-h*y-p*y-h*g),w=c*l,d=Nr*c,h=d-(d-c),p=c-h,d=Nr*l,y=d-(d-l),g=l-y,I=p*g-(w-h*y-p*y-h*g),m=v-I,f=v-m,Jn[0]=v-(m+f)+(f-I),b=_+m,f=b-_,x=_-(b-f)+(m-f),m=x-w,f=x-m,Jn[1]=x-(m+f)+(f-w),D=b+m,f=D-b,Jn[2]=b-(D-f)+(m-f),Jn[3]=D;let C=Vf(E,G9,4,Jn,X9);return X9[C-1]}function jh(e,t,r,n,i,o){let s=(t-o)*(r-i),a=(e-i)*(n-o),c=s-a,l=Math.abs(s+a);return Math.abs(c)>=Lnt*l?c:-Cnt(e,t,r,n,i,o,l)}var V8t=(7+56*xe)*xe,j8t=(3+28*xe)*xe,q8t=(26+288*xe)*xe*xe,Y8t=G(4),W8t=G(4),G8t=G(4),X8t=G(4),H8t=G(4),Z8t=G(4),K8t=G(4),Q8t=G(4),J8t=G(4),tkt=G(8),ekt=G(8),rkt=G(8),nkt=G(4),ikt=G(8),okt=G(8),skt=G(8),akt=G(12),ckt=G(192),lkt=G(192);var dkt=(10+96*xe)*xe,hkt=(4+48*xe)*xe,pkt=(44+576*xe)*xe*xe,mkt=G(4),ykt=G(4),gkt=G(4),bkt=G(4),xkt=G(4),_kt=G(4),wkt=G(4),vkt=G(4),Skt=G(8),Ikt=G(8),Tkt=G(8),Akt=G(8),Mkt=G(8),Ekt=G(8),Dkt=G(8),Bkt=G(8),Okt=G(8),Nkt=G(4),Fkt=G(4),Lkt=G(4),Rkt=G(8),kkt=G(16),Ckt=G(16),Ukt=G(16),Pkt=G(32),$kt=G(32),zkt=G(48),Vkt=G(64),jkt=G(1152),qkt=G(1152);var Xkt=(16+224*xe)*xe,Hkt=(5+72*xe)*xe,Zkt=(71+1408*xe)*xe*xe,Kkt=G(4),Qkt=G(4),Jkt=G(4),tCt=G(4),eCt=G(4),rCt=G(4),nCt=G(4),iCt=G(4),oCt=G(4),sCt=G(4),aCt=G(24),cCt=G(24),lCt=G(24),uCt=G(24),fCt=G(24),dCt=G(24),hCt=G(24),pCt=G(24),mCt=G(24),yCt=G(24),gCt=G(1152),bCt=G(1152),xCt=G(1152),_Ct=G(1152),wCt=G(1152),vCt=G(2304),SCt=G(2304),ICt=G(3456),TCt=G(5760),ACt=G(8),MCt=G(8),ECt=G(8),DCt=G(16),BCt=G(24),OCt=G(48),NCt=G(48),FCt=G(96),LCt=G(192),RCt=G(384),kCt=G(384),CCt=G(384),UCt=G(768);var PCt=G(96),$Ct=G(96),zCt=G(96),VCt=G(1152);var Z9=Math.pow(2,-52),Gv=new Uint32Array(512),Yh=class e{static from(t,r=jnt,n=qnt){let i=t.length,o=new Float64Array(i*2);for(let s=0;s<i;s++){let a=t[s];o[2*s]=r(a),o[2*s+1]=n(a)}return new e(o)}constructor(t){let r=t.length>>1;if(r>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;let n=Math.max(2*r-5,0);this._triangles=new Uint32Array(n*3),this._halfedges=new Int32Array(n*3),this._hashSize=Math.ceil(Math.sqrt(r)),this._hullPrev=new Uint32Array(r),this._hullNext=new Uint32Array(r),this._hullTri=new Uint32Array(r),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(r),this._dists=new Float64Array(r),this.update()}update(){let{coords:t,_hullPrev:r,_hullNext:n,_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 B=t[2*A],M=t[2*A+1];B<a&&(a=B),M<c&&(c=M),B>l&&(l=B),M>u&&(u=M),this._ids[A]=A}let f=(a+l)/2,d=(c+u)/2,h,p,y;for(let A=0,B=1/0;A<s;A++){let M=lB(f,d,t[2*A],t[2*A+1]);M<B&&(h=A,B=M)}let g=t[2*h],m=t[2*h+1];for(let A=0,B=1/0;A<s;A++){if(A===h)continue;let M=lB(g,m,t[2*A],t[2*A+1]);M<B&&M>0&&(p=A,B=M)}let b=t[2*p],x=t[2*p+1],_=1/0;for(let A=0;A<s;A++){if(A===h||A===p)continue;let B=znt(g,m,b,x,t[2*A],t[2*A+1]);B<_&&(y=A,_=B)}let v=t[2*y],w=t[2*y+1];if(_===1/0){for(let M=0;M<s;M++)this._dists[M]=t[2*M]-t[0]||t[2*M+1]-t[1];qh(this._ids,this._dists,0,s-1);let A=new Uint32Array(s),B=0;for(let M=0,O=-1/0;M<s;M++){let R=this._ids[M],S=this._dists[R];S>O&&(A[B++]=R,O=S)}this.hull=A.subarray(0,B),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(jh(g,m,b,x,v,w)<0){let A=p,B=b,M=x;p=y,b=v,x=w,y=A,v=B,w=M}let I=Vnt(g,m,b,x,v,w);this._cx=I.x,this._cy=I.y;for(let A=0;A<s;A++)this._dists[A]=lB(t[2*A],t[2*A+1],I.x,I.y);qh(this._ids,this._dists,0,s-1),this._hullStart=h;let D=3;n[h]=r[y]=p,n[p]=r[h]=y,n[y]=r[p]=h,i[h]=0,i[p]=1,i[y]=2,o.fill(-1),o[this._hashKey(g,m)]=h,o[this._hashKey(b,x)]=p,o[this._hashKey(v,w)]=y,this.trianglesLen=0,this._addTriangle(h,p,y,-1,-1,-1);for(let A=0,B,M;A<this._ids.length;A++){let O=this._ids[A],R=t[2*O],S=t[2*O+1];if(A>0&&Math.abs(R-B)<=Z9&&Math.abs(S-M)<=Z9||(B=R,M=S,O===h||O===p||O===y))continue;let T=0;for(let $=0,z=this._hashKey(R,S);$<this._hashSize&&(T=o[(z+$)%this._hashSize],!(T!==-1&&T!==n[T]));$++);T=r[T];let E=T,C;for(;C=n[E],jh(R,S,t[2*E],t[2*E+1],t[2*C],t[2*C+1])>=0;)if(E=C,E===T){E=-1;break}if(E===-1)continue;let U=this._addTriangle(E,O,n[E],-1,-1,i[E]);i[O]=this._legalize(U+2),i[E]=U,D++;let k=n[E];for(;C=n[k],jh(R,S,t[2*k],t[2*k+1],t[2*C],t[2*C+1])<0;)U=this._addTriangle(k,O,C,i[O],-1,i[k]),i[O]=this._legalize(U+2),n[k]=k,D--,k=C;if(E===T)for(;C=r[E],jh(R,S,t[2*C],t[2*C+1],t[2*E],t[2*E+1])<0;)U=this._addTriangle(C,O,E,-1,i[E],i[C]),this._legalize(U+2),i[C]=U,n[E]=E,D--,E=C;this._hullStart=r[O]=E,n[E]=r[k]=O,n[O]=k,o[this._hashKey(R,S)]=O,o[this._hashKey(t[2*E],t[2*E+1])]=E}this.hull=new Uint32Array(D);for(let A=0,B=this._hullStart;A<D;A++)this.hull[A]=B,B=n[B];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,r){return Math.floor(Pnt(t-this._cx,r-this._cy)*this._hashSize)%this._hashSize}_legalize(t){let{_triangles:r,_halfedges:n,coords:i}=this,o=0,s=0;for(;;){let a=n[t],c=t-t%3;if(s=c+(t+2)%3,a===-1){if(o===0)break;t=Gv[--o];continue}let l=a-a%3,u=c+(t+1)%3,f=l+(a+2)%3,d=r[s],h=r[t],p=r[u],y=r[f];if($nt(i[2*d],i[2*d+1],i[2*h],i[2*h+1],i[2*p],i[2*p+1],i[2*y],i[2*y+1])){r[t]=y,r[a]=d;let m=n[f];if(m===-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,m),this._link(a,n[s]),this._link(s,f);let b=l+(a+1)%3;o<Gv.length&&(Gv[o++]=b)}else{if(o===0)break;t=Gv[--o]}}return s}_link(t,r){this._halfedges[t]=r,r!==-1&&(this._halfedges[r]=t)}_addTriangle(t,r,n,i,o,s){let a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=r,this._triangles[a+2]=n,this._link(a,i),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}};function Pnt(e,t){let r=e/(Math.abs(e)+Math.abs(t));return(t>0?3-r:1+r)/4}function lB(e,t,r,n){let i=e-r,o=t-n;return i*i+o*o}function $nt(e,t,r,n,i,o,s,a){let c=e-s,l=t-a,u=r-s,f=n-a,d=i-s,h=o-a,p=c*c+l*l,y=u*u+f*f,g=d*d+h*h;return c*(f*g-y*h)-l*(u*g-y*d)+p*(u*h-f*d)<0}function znt(e,t,r,n,i,o){let s=r-e,a=n-t,c=i-e,l=o-t,u=s*s+a*a,f=c*c+l*l,d=.5/(s*l-a*c),h=(l*u-a*f)*d,p=(s*f-c*u)*d;return h*h+p*p}function Vnt(e,t,r,n,i,o){let s=r-e,a=n-t,c=i-e,l=o-t,u=s*s+a*a,f=c*c+l*l,d=.5/(s*l-a*c),h=e+(l*u-a*f)*d,p=t+(s*f-c*u)*d;return{x:h,y:p}}function qh(e,t,r,n){if(n-r<=20)for(let i=r+1;i<=n;i++){let o=e[i],s=t[o],a=i-1;for(;a>=r&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{let i=r+n>>1,o=r+1,s=n;f0(e,i,o),t[e[r]]>t[e[n]]&&f0(e,r,n),t[e[o]]>t[e[n]]&&f0(e,o,n),t[e[r]]>t[e[o]]&&f0(e,r,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;f0(e,o,s)}e[r+1]=e[s],e[s]=a,n-o+1>=s-r?(qh(e,t,o,n),qh(e,t,r,s-1)):(qh(e,t,r,s-1),qh(e,t,o,n))}}function f0(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function jnt(e){return e[0]}function qnt(e){return e[1]}var _o=class{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,r){this._+=`L${this._x1=+t},${this._y1=+r}`}arc(t,r,n){t=+t,r=+r,n=+n;let i=t+n,o=r;if(n<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),n&&(this._+=`A${n},${n},0,1,1,${t-n},${r}A${n},${n},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,r,n,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${+n}v${+i}h${-n}Z`}value(){return this._||null}};var su=class{constructor(){this._=[]}moveTo(t,r){this._.push([t,r])}closePath(){this._.push(this._[0].slice())}lineTo(t,r){this._.push([t,r])}value(){return this._.length?this._:null}};var d0=class{constructor(t,[r,n,i,o]=[0,0,960,500]){if(!((i=+i)>=(r=+r))||!((o=+o)>=(n=+n)))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=r,this.ymax=o,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let{delaunay:{points:t,hull:r,triangles:n},vectors:i}=this,o,s,a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let y=0,g=0,m=n.length,b,x;y<m;y+=3,g+=2){let _=n[y]*2,v=n[y+1]*2,w=n[y+2]*2,I=t[_],D=t[_+1],A=t[v],B=t[v+1],M=t[w],O=t[w+1],R=A-I,S=B-D,T=M-I,E=O-D,C=(R*E-S*T)*2;if(Math.abs(C)<1e-9){if(o===void 0){o=s=0;for(let k of r)o+=t[k*2],s+=t[k*2+1];o/=r.length,s/=r.length}let U=1e9*Math.sign((o-I)*E-(s-D)*T);b=(I+M)/2-U*E,x=(D+O)/2+U*T}else{let U=1/C,k=R*R+S*S,$=T*T+E*E;b=I+(E*k-S*$)*U,x=D+(R*$-T*k)*U}a[g]=b,a[g+1]=x}let c=r[r.length-1],l,u=c*4,f,d=t[2*c],h,p=t[2*c+1];i.fill(0);for(let y=0;y<r.length;++y)c=r[y],l=u,f=d,h=p,u=c*4,d=t[2*c],p=t[2*c+1],i[l+2]=i[u]=h-p,i[l+3]=i[u+1]=d-f}render(t){let r=t==null?t=new _o:void 0,{delaunay:{halfedges:n,inedges:i,hull:o},circumcenters:s,vectors:a}=this;if(o.length<=1)return null;for(let u=0,f=n.length;u<f;++u){let d=n[u];if(d<u)continue;let h=Math.floor(u/3)*2,p=Math.floor(d/3)*2,y=s[h],g=s[h+1],m=s[p],b=s[p+1];this._renderSegment(y,g,m,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,d=s[f],h=s[f+1],p=c*4,y=this._project(d,h,a[p+2],a[p+3]);y&&this._renderSegment(d,h,y[0],y[1],t)}return r&&r.value()}renderBounds(t){let r=t==null?t=new _o:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),r&&r.value()}renderCell(t,r){let n=r==null?r=new _o:void 0,i=this._clip(t);if(i===null||!i.length)return;r.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])&&r.lineTo(i[s],i[s+1]);return r.closePath(),n&&n.value()}*cellPolygons(){let{delaunay:{points:t}}=this;for(let r=0,n=t.length/2;r<n;++r){let i=this.cellPolygon(r);i&&(i.index=r,yield i)}}cellPolygon(t){let r=new su;return this.renderCell(t,r),r.value()}_renderSegment(t,r,n,i,o){let s,a=this._regioncode(t,r),c=this._regioncode(n,i);a===0&&c===0?(o.moveTo(t,r),o.lineTo(n,i)):(s=this._clipSegment(t,r,n,i,a,c))&&(o.moveTo(s[0],s[1]),o.lineTo(s[2],s[3]))}contains(t,r,n){return r=+r,r!==r||(n=+n,n!==n)?!1:this.delaunay._step(t,r,n)===t}*neighbors(t){let r=this._clip(t);if(r)for(let n of this.delaunay.neighbors(t)){let i=this._clip(n);if(i){t:for(let o=0,s=r.length;o<s;o+=2)for(let a=0,c=i.length;a<c;a+=2)if(r[o]===i[a]&&r[o+1]===i[a+1]&&r[(o+2)%s]===i[(a+c-2)%c]&&r[(o+3)%s]===i[(a+c-1)%c]){yield n;break t}}}}_cell(t){let{circumcenters:r,delaunay:{inedges:n,halfedges:i,triangles:o}}=this,s=n[t];if(s===-1)return null;let a=[],c=s;do{let l=Math.floor(c/3);if(a.push(r[l*2],r[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 r=this._cell(t);if(r===null)return null;let{vectors:n}=this,i=t*4;return this._simplify(n[i]||n[i+1]?this._clipInfinite(t,r,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(t,r))}_clipFinite(t,r){let n=r.length,i=null,o,s,a=r[n-2],c=r[n-1],l,u=this._regioncode(a,c),f,d=0;for(let h=0;h<n;h+=2)if(o=a,s=c,a=r[h],c=r[h+1],l=u,u=this._regioncode(a,c),l===0&&u===0)f=d,d=0,i?i.push(a,c):i=[a,c];else{let p,y,g,m,b;if(l===0){if((p=this._clipSegment(o,s,a,c,l,u))===null)continue;[y,g,m,b]=p}else{if((p=this._clipSegment(a,c,o,s,u,l))===null)continue;[m,b,y,g]=p,f=d,d=this._edgecode(y,g),f&&d&&this._edge(t,f,d,i,i.length),i?i.push(y,g):i=[y,g]}f=d,d=this._edgecode(m,b),f&&d&&this._edge(t,f,d,i,i.length),i?i.push(m,b):i=[m,b]}if(i)f=d,d=this._edgecode(i[0],i[1]),f&&d&&this._edge(t,f,d,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,r,n,i,o,s){let a=o<s;for(a&&([t,r,n,i,o,s]=[n,i,t,r,s,o]);;){if(o===0&&s===0)return a?[n,i,t,r]:[t,r,n,i];if(o&s)return null;let c,l,u=o||s;u&8?(c=t+(n-t)*(this.ymax-r)/(i-r),l=this.ymax):u&4?(c=t+(n-t)*(this.ymin-r)/(i-r),l=this.ymin):u&2?(l=r+(i-r)*(this.xmax-t)/(n-t),c=this.xmax):(l=r+(i-r)*(this.xmin-t)/(n-t),c=this.xmin),o?(t=c,r=l,o=this._regioncode(t,r)):(n=c,i=l,s=this._regioncode(n,i))}}_clipInfinite(t,r,n,i,o,s){let a=Array.from(r),c;if((c=this._project(a[0],a[1],n,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,d=this._edgecode(a[u-2],a[u-1]);l<u;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,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,r,n,i,o){for(;r!==n;){let s,a;switch(r){case 5:r=4;continue;case 4:r=6,s=this.xmax,a=this.ymin;break;case 6:r=2;continue;case 2:r=10,s=this.xmax,a=this.ymax;break;case 10:r=8;continue;case 8:r=9,s=this.xmin,a=this.ymax;break;case 9:r=1;continue;case 1:r=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,r,n,i){let o=1/0,s,a,c;if(i<0){if(r<=this.ymin)return null;(s=(this.ymin-r)/i)<o&&(c=this.ymin,a=t+(o=s)*n)}else if(i>0){if(r>=this.ymax)return null;(s=(this.ymax-r)/i)<o&&(c=this.ymax,a=t+(o=s)*n)}if(n>0){if(t>=this.xmax)return null;(s=(this.xmax-t)/n)<o&&(a=this.xmax,c=r+(o=s)*i)}else if(n<0){if(t<=this.xmin)return null;(s=(this.xmin-t)/n)<o&&(a=this.xmin,c=r+(o=s)*i)}return[a,c]}_edgecode(t,r){return(t===this.xmin?1:t===this.xmax?2:0)|(r===this.ymin?4:r===this.ymax?8:0)}_regioncode(t,r){return(t<this.xmin?1:t>this.xmax?2:0)|(r<this.ymin?4:r>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let r=0;r<t.length;r+=2){let n=(r+2)%t.length,i=(r+4)%t.length;(t[r]===t[n]&&t[n]===t[i]||t[r+1]===t[n+1]&&t[n+1]===t[i+1])&&(t.splice(n,2),r-=2)}t.length||(t=null)}return t}};var Ynt=2*Math.PI,Wh=Math.pow;function Wnt(e){return e[0]}function Gnt(e){return e[1]}function Xnt(e){let{triangles:t,coords:r}=e;for(let n=0;n<t.length;n+=3){let i=2*t[n],o=2*t[n+1],s=2*t[n+2];if((r[s]-r[i])*(r[o+1]-r[i+1])-(r[o]-r[i])*(r[s+1]-r[i+1])>1e-10)return!1}return!0}function Hnt(e,t,r){return[e+Math.sin(e+t)*r,t+Math.cos(e-t)*r]}var On=class e{static from(t,r=Wnt,n=Gnt,i){return new e("length"in t?Znt(t,r,n,i):Float64Array.from(Knt(t,r,n,i)))}constructor(t){this._delaunator=new Yh(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,r=this.points;if(t.hull&&t.hull.length>2&&Xnt(t)){this.collinear=Int32Array.from({length:r.length/2},(d,h)=>h).sort((d,h)=>r[2*d]-r[2*h]||r[2*d+1]-r[2*h+1]);let c=this.collinear[0],l=this.collinear[this.collinear.length-1],u=[r[2*c],r[2*c+1],r[2*l],r[2*l+1]],f=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let d=0,h=r.length/2;d<h;++d){let p=Hnt(r[2*d],r[2*d+1],f);r[2*d]=p[0],r[2*d+1]=p[1]}this._delaunator=new Yh(r)}else delete this.collinear;let n=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=n.length;c<l;++c){let u=o[c%3===2?c-2:c+1];(n[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 d0(this,t)}*neighbors(t){let{inedges:r,hull:n,_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=r[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=n[(i[t]+1)%n.length];f!==u&&(yield f);return}}while(l!==c)}find(t,r,n=0){if(t=+t,t!==t||(r=+r,r!==r))return-1;let i=n,o;for(;(o=this._step(n,t,r))>=0&&o!==n&&o!==i;)n=o;return o}_step(t,r,n){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=Wh(r-l[t*2],2)+Wh(n-l[t*2+1],2),d=i[t],h=d;do{let p=c[h],y=Wh(r-l[p*2],2)+Wh(n-l[p*2+1],2);if(y<f&&(f=y,u=p),h=h%3===2?h-2:h+1,c[h]!==t)break;if(h=a[h],h===-1){if(h=o[(s[t]+1)%o.length],h!==p&&Wh(r-l[h*2],2)+Wh(n-l[h*2+1],2)<f)return h;break}}while(h!==d);return u}render(t){let r=t==null?t=new _o:void 0,{points:n,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(n[l],n[l+1]),t.lineTo(n[u],n[u+1])}return this.renderHull(t),r&&r.value()}renderPoints(t,r){r===void 0&&(!t||typeof t.moveTo!="function")&&(r=t,t=null),r=r==null?2:+r;let n=t==null?t=new _o: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+r,c),t.arc(a,c,r,0,Ynt)}return n&&n.value()}renderHull(t){let r=t==null?t=new _o:void 0,{hull:n,points:i}=this,o=n[0]*2,s=n.length;t.moveTo(i[o],i[o+1]);for(let a=1;a<s;++a){let c=2*n[a];t.lineTo(i[c],i[c+1])}return t.closePath(),r&&r.value()}hullPolygon(){let t=new su;return this.renderHull(t),t.value()}renderTriangle(t,r){let n=r==null?r=new _o:void 0,{points:i,triangles:o}=this,s=o[t*=3]*2,a=o[t+1]*2,c=o[t+2]*2;return r.moveTo(i[s],i[s+1]),r.lineTo(i[a],i[a+1]),r.lineTo(i[c],i[c+1]),r.closePath(),n&&n.value()}*trianglePolygons(){let{triangles:t}=this;for(let r=0,n=t.length/3;r<n;++r)yield this.trianglePolygon(r)}trianglePolygon(t){let r=new su;return this.renderTriangle(t,r),r.value()}};function Znt(e,t,r,n){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(n,a,s,e),o[s*2+1]=r.call(n,a,s,e)}return o}function*Knt(e,t,r,n){let i=0;for(let o of e)yield t.call(n,o,i,e),yield r.call(n,o,i,e),++i}function K9(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function jf(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ra(e){return e=jf(Math.abs(e)),e?e[1]:NaN}function Q9(e,t){return function(r,n){for(var i=r.length,o=[],s=0,a=e[0],c=0;i>0&&a>0&&(c+a+1>n&&(a=Math.max(1,n-c)),o.push(r.substring(i-=a,i+a)),!((c+=a+1)>n));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function J9(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Qnt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function na(e){if(!(t=Qnt.exec(e)))throw new Error("invalid format: "+e);var t;return new Xv({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]})}na.prototype=Xv.prototype;function Xv(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+""}Xv.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 t$(e){t:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break t;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var uB;function e$(e,t){var r=jf(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(uB=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return o===s?n:o>s?n+new Array(o-s+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+jf(e,Math.max(0,t+o-1))[0]}function fB(e,t){var r=jf(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var dB={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:K9,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)=>fB(e*100,t),r:fB,s:e$,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function hB(e){return e}var r$=Array.prototype.map,n$=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function i$(e){var t=e.grouping===void 0||e.thousands===void 0?hB:Q9(r$.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?hB:J9(r$.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=na(f);var d=f.fill,h=f.align,p=f.sign,y=f.symbol,g=f.zero,m=f.width,b=f.comma,x=f.precision,_=f.trim,v=f.type;v==="n"?(b=!0,v="g"):dB[v]||(x===void 0&&(x=12),_=!0,v="g"),(g||d==="0"&&h==="=")&&(g=!0,d="0",h="=");var w=y==="$"?r:y==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",I=y==="$"?n:/[%p]/.test(v)?s:"",D=dB[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 B(M){var O=w,R=I,S,T,E;if(v==="c")R=D(M)+R,M="";else{M=+M;var C=M<0||1/M<0;if(M=isNaN(M)?c:D(Math.abs(M),x),_&&(M=t$(M)),C&&+M==0&&p!=="+"&&(C=!1),O=(C?p==="("?p:a:p==="-"||p==="("?"":p)+O,R=(v==="s"?n$[8+uB/3]:"")+R+(C&&p==="("?")":""),A){for(S=-1,T=M.length;++S<T;)if(E=M.charCodeAt(S),48>E||E>57){R=(E===46?i+M.slice(S+1):M.slice(S))+R,M=M.slice(0,S);break}}}b&&!g&&(M=t(M,1/0));var U=O.length+M.length+R.length,k=U<m?new Array(m-U+1).join(d):"";switch(b&&g&&(M=t(k+M,k.length?m-R.length:1/0),k=""),h){case"<":M=O+M+R+k;break;case"=":M=O+k+M+R;break;case"^":M=k.slice(0,U=k.length>>1)+O+M+R+k.slice(U);break;default:M=k+O+M+R;break}return o(M)}return B.toString=function(){return f+""},B}function u(f,d){var h=l((f=na(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(ra(d)/3)))*3,y=Math.pow(10,-p),g=n$[8+p/3];return function(m){return h(y*m)+g}}return{format:l,formatPrefix:u}}var Hv,wo,Zv;pB({thousands:",",grouping:[3],currency:["$",""]});function pB(e){return Hv=i$(e),wo=Hv.format,Zv=Hv.formatPrefix,Hv}function mB(e){return Math.max(0,-ra(Math.abs(e)))}function yB(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ra(t)/3)))*3-ra(Math.abs(e)))}function gB(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ra(t)-ra(e))+1}var rt=1e-6,qf=1e-12,Yt=Math.PI,ke=Yt/2,bB=Yt/4,Xr=Yt*2,yr=180/Yt,ce=Yt/180,Jt=Math.abs,vo=Math.atan,Fr=Math.atan2,et=Math.cos,h0=Math.ceil,Kv=Math.exp;var Qv=Math.hypot,Yf=Math.log,Jv=Math.pow,tt=Math.sin,Nn=Math.sign||function(e){return e>0?1:e<0?-1:0},Ce=Math.sqrt,Gh=Math.tan;function tS(e){return e>1?0:e<-1?Yt:Math.acos(e)}function Ke(e){return e>1?ke:e<-1?-ke:Math.asin(e)}function Lr(){}function eS(e,t){e&&s$.hasOwnProperty(e.type)&&s$[e.type](e,t)}var o$={Feature:function(e,t){eS(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,i=r.length;++n<i;)eS(r[n].geometry,t)}},s$={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 r=e.coordinates,n=-1,i=r.length;++n<i;)e=r[n],t.point(e[0],e[1],e[2])},LineString:function(e,t){xB(e.coordinates,t,0)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)xB(r[n],t,0)},Polygon:function(e,t){a$(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)a$(r[n],t)},GeometryCollection:function(e,t){for(var r=e.geometries,n=-1,i=r.length;++n<i;)eS(r[n],t)}};function xB(e,t,r){var n=-1,i=e.length-r,o;for(t.lineStart();++n<i;)o=e[n],t.point(o[0],o[1],o[2]);t.lineEnd()}function a$(e,t){var r=-1,n=e.length;for(t.polygonStart();++r<n;)xB(e[r],t,1);t.polygonEnd()}function qi(e,t){e&&o$.hasOwnProperty(e.type)?o$[e.type](e,t):eS(e,t)}function p0(e){return[Fr(e[1],e[0]),Ke(e[2])]}function ia(e){var t=e[0],r=e[1],n=et(r);return[n*et(t),n*tt(t),tt(r)]}function m0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Xh(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 rS(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function y0(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function g0(e){var t=Ce(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var b0,nS,iS,oS,sS,aS,cS,lS,_B,wB,vB,u$,f$,ti,ei,ri,ms={sphere:Lr,point:SB,lineStart:c$,lineEnd:l$,polygonStart:function(){ms.lineStart=eit,ms.lineEnd=rit},polygonEnd:function(){ms.lineStart=c$,ms.lineEnd=l$}};function SB(e,t){e*=ce,t*=ce;var r=et(t);x0(r*et(e),r*tt(e),tt(t))}function x0(e,t,r){++b0,iS+=(e-iS)/b0,oS+=(t-oS)/b0,sS+=(r-sS)/b0}function c$(){ms.point=Jnt}function Jnt(e,t){e*=ce,t*=ce;var r=et(t);ti=r*et(e),ei=r*tt(e),ri=tt(t),ms.point=tit,x0(ti,ei,ri)}function tit(e,t){e*=ce,t*=ce;var r=et(t),n=r*et(e),i=r*tt(e),o=tt(t),s=Fr(Ce((s=ei*o-ri*i)*s+(s=ri*n-ti*o)*s+(s=ti*i-ei*n)*s),ti*n+ei*i+ri*o);nS+=s,aS+=s*(ti+(ti=n)),cS+=s*(ei+(ei=i)),lS+=s*(ri+(ri=o)),x0(ti,ei,ri)}function l$(){ms.point=SB}function eit(){ms.point=nit}function rit(){d$(u$,f$),ms.point=SB}function nit(e,t){u$=e,f$=t,e*=ce,t*=ce,ms.point=d$;var r=et(t);ti=r*et(e),ei=r*tt(e),ri=tt(t),x0(ti,ei,ri)}function d$(e,t){e*=ce,t*=ce;var r=et(t),n=r*et(e),i=r*tt(e),o=tt(t),s=ei*o-ri*i,a=ri*n-ti*o,c=ti*i-ei*n,l=Qv(s,a,c),u=Ke(l),f=l&&-u/l;_B.add(f*s),wB.add(f*a),vB.add(f*c),nS+=u,aS+=u*(ti+(ti=n)),cS+=u*(ei+(ei=i)),lS+=u*(ri+(ri=o)),x0(ti,ei,ri)}function IB(e){b0=nS=iS=oS=sS=aS=cS=lS=0,_B=new mn,wB=new mn,vB=new mn,qi(e,ms);var t=+_B,r=+wB,n=+vB,i=Qv(t,r,n);return i<qf&&(t=aS,r=cS,n=lS,nS<rt&&(t=iS,r=oS,n=sS),i=Qv(t,r,n),i<qf)?[NaN,NaN]:[Fr(r,t)*yr,Ke(n/i)*yr]}function _0(e,t){function r(n,i){return n=e(n,i),t(n[0],n[1])}return e.invert&&t.invert&&(r.invert=function(n,i){return n=t.invert(n,i),n&&e.invert(n[0],n[1])}),r}function TB(e,t){return Jt(e)>Yt&&(e-=Math.round(e/Xr)*Xr),[e,t]}TB.invert=TB;function AB(e,t,r){return(e%=Xr)?t||r?_0(p$(e),m$(t,r)):p$(e):t||r?m$(t,r):TB}function h$(e){return function(t,r){return t+=e,Jt(t)>Yt&&(t-=Math.round(t/Xr)*Xr),[t,r]}}function p$(e){var t=h$(e);return t.invert=h$(-e),t}function m$(e,t){var r=et(e),n=tt(e),i=et(t),o=tt(t);function s(a,c){var l=et(c),u=et(a)*l,f=tt(a)*l,d=tt(c),h=d*r+u*n;return[Fr(f*i-h*o,u*r-d*n),Ke(h*i+f*o)]}return s.invert=function(a,c){var l=et(c),u=et(a)*l,f=tt(a)*l,d=tt(c),h=d*i-f*o;return[Fr(f*i+d*o,u*r+h*n),Ke(h*r-u*n)]},s}function y$(e){e=AB(e[0]*ce,e[1]*ce,e.length>2?e[2]*ce:0);function t(r){return r=e(r[0]*ce,r[1]*ce),r[0]*=yr,r[1]*=yr,r}return t.invert=function(r){return r=e.invert(r[0]*ce,r[1]*ce),r[0]*=yr,r[1]*=yr,r},t}function b$(e,t,r,n,i,o){if(r){var s=et(t),a=tt(t),c=n*r;i==null?(i=t+n*Xr,o=t-c/2):(i=g$(s,i),o=g$(s,o),(n>0?i<o:i>o)&&(i+=n*Xr));for(var l,u=i;n>0?u>o:u<o;u-=c)l=p0([s,-a*et(u),-a*tt(u)]),e.point(l[0],l[1])}}function g$(e,t){t=ia(t),t[0]-=e,g0(t);var r=tS(-t[1]);return((-t[2]<0?-r:r)+Xr-rt)%Xr}function uS(){var e=[],t;return{point:function(r,n,i){t.push([r,n,i])},lineStart:function(){e.push(t=[])},lineEnd:Lr,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function Hh(e,t){return Jt(e[0]-t[0])<rt&&Jt(e[1]-t[1])<rt}function fS(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function dS(e,t,r,n,i){var o=[],s=[],a,c;if(e.forEach(function(p){if(!((y=p.length-1)<=0)){var y,g=p[0],m=p[y],b;if(Hh(g,m)){if(!g[2]&&!m[2]){for(i.lineStart(),a=0;a<y;++a)i.point((g=p[a])[0],g[1]);i.lineEnd();return}m[0]+=2*rt}o.push(b=new fS(g,p,null,!0)),s.push(b.o=new fS(g,null,b,!1)),o.push(b=new fS(m,p,null,!1)),s.push(b.o=new fS(m,null,b,!0))}}),!!o.length){for(s.sort(t),x$(o),x$(s),a=0,c=s.length;a<c;++a)s[a].e=r=!r;for(var l=o[0],u,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,c=u.length;a<c;++a)i.point((f=u[a])[0],f[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(h)for(u=d.p.z,a=u.length-1;a>=0;--a)i.point((f=u[a])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);i.lineEnd()}}}function x$(e){if(t=e.length){for(var t,r=0,n=e[0],i;++r<t;)n.n=i=e[r],i.p=n,n=i;n.n=i=e[0],i.p=n}}function MB(e){return Jt(e[0])<=Yt?e[0]:Nn(e[0])*((Jt(e[0])+Yt)%Xr-Yt)}function _$(e,t){var r=MB(t),n=t[1],i=tt(n),o=[tt(r),-et(r),0],s=0,a=0,c=new mn;i===1?n=ke+rt:i===-1&&(n=-ke-rt);for(var l=0,u=e.length;l<u;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],p=MB(h),y=h[1]/2+bB,g=tt(y),m=et(y),b=0;b<d;++b,p=_,g=w,m=I,h=x){var x=f[b],_=MB(x),v=x[1]/2+bB,w=tt(v),I=et(v),D=_-p,A=D>=0?1:-1,B=A*D,M=B>Yt,O=g*w;if(c.add(Fr(O*A*tt(B),m*I+O*et(B))),s+=M?D+A*Xr:D,M^p>=r^_>=r){var R=Xh(ia(h),ia(x));g0(R);var S=Xh(o,R);g0(S);var T=(M^D>=0?-1:1)*Ke(S[2]);(n>T||n===T&&(R[0]||R[1]))&&(a+=M^D>=0?1:-1)}}return(s<-rt||s<rt&&c<-qf)^a&1}function hS(e,t,r,n){return function(i){var o=t(i),s=uS(),a=t(s),c=!1,l,u,f,d={point:h,lineStart:y,lineEnd:g,polygonStart:function(){d.point=m,d.lineStart=b,d.lineEnd=x,u=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=y,d.lineEnd=g,u=Bh(u);var _=_$(l,n);u.length?(c||(i.polygonStart(),c=!0),dS(u,oit,_,r,i)):_&&(c||(i.polygonStart(),c=!0),i.lineStart(),r(null,null,1,i),i.lineEnd()),c&&(i.polygonEnd(),c=!1),u=l=null},sphere:function(){i.polygonStart(),i.lineStart(),r(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(_,v){e(_,v)&&i.point(_,v)}function p(_,v){o.point(_,v)}function y(){d.point=p,o.lineStart()}function g(){d.point=h,o.lineEnd()}function m(_,v){f.push([_,v]),a.point(_,v)}function b(){a.lineStart(),f=[]}function x(){m(f[0][0],f[0][1]),a.lineEnd();var _=a.clean(),v=s.result(),w,I=v.length,D,A,B;if(f.pop(),l.push(f),f=null,!!I){if(_&1){if(A=v[0],(D=A.length-1)>0){for(c||(i.polygonStart(),c=!0),i.lineStart(),w=0;w<D;++w)i.point((B=A[w])[0],B[1]);i.lineEnd()}return}I>1&&_&2&&v.push(v.pop().concat(v.shift())),u.push(v.filter(iit))}}return d}}function iit(e){return e.length>1}function oit(e,t){return((e=e.x)[0]<0?e[1]-ke-rt:ke-e[1])-((t=t.x)[0]<0?t[1]-ke-rt:ke-t[1])}var EB=hS(function(){return!0},sit,cit,[-Yt,-ke]);function sit(e){var t=NaN,r=NaN,n=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?Yt:-Yt,c=Jt(o-t);Jt(c-Yt)<rt?(e.point(t,r=(r+s)/2>0?ke:-ke),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(a,r),e.point(o,r),i=0):n!==a&&c>=Yt&&(Jt(t-n)<rt&&(t-=n*rt),Jt(o-a)<rt&&(o-=a*rt),r=ait(t,r,o,s),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(a,r),i=0),e.point(t=o,r=s),n=a},lineEnd:function(){e.lineEnd(),t=r=NaN},clean:function(){return 2-i}}}function ait(e,t,r,n){var i,o,s=tt(e-r);return Jt(s)>rt?vo((tt(t)*(o=et(n))*tt(r)-tt(n)*(i=et(t))*tt(e))/(i*o*s)):(t+n)/2}function cit(e,t,r,n){var i;if(e==null)i=r*ke,n.point(-Yt,i),n.point(0,i),n.point(Yt,i),n.point(Yt,0),n.point(Yt,-i),n.point(0,-i),n.point(-Yt,-i),n.point(-Yt,0),n.point(-Yt,i);else if(Jt(e[0]-t[0])>rt){var o=e[0]<t[0]?Yt:-Yt;i=r*o/2,n.point(-o,i),n.point(0,i),n.point(o,i)}else n.point(t[0],t[1])}function w$(e){var t=et(e),r=6*ce,n=t>0,i=Jt(t)>rt;function o(u,f,d,h){b$(h,e,r,d,u,f)}function s(u,f){return et(u)*et(f)>t}function a(u){var f,d,h,p,y;return{lineStart:function(){p=h=!1,y=1},point:function(g,m){var b=[g,m],x,_=s(g,m),v=n?_?0:l(g,m):_?l(g+(g<0?Yt:-Yt),m):0;if(!f&&(p=h=_)&&u.lineStart(),_!==h&&(x=c(f,b),(!x||Hh(f,x)||Hh(b,x))&&(b[2]=1)),_!==h)y=0,_?(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&&n^_){var w;!(v&d)&&(w=c(b,f,!0))&&(y=0,n?(u.lineStart(),u.point(w[0][0],w[0][1]),u.point(w[1][0],w[1][1]),u.lineEnd()):(u.point(w[1][0],w[1][1]),u.lineEnd(),u.lineStart(),u.point(w[0][0],w[0][1],3)))}_&&(!f||!Hh(f,b))&&u.point(b[0],b[1]),f=b,h=_,d=v},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return y|(p&&h)<<1}}}function c(u,f,d){var h=ia(u),p=ia(f),y=[1,0,0],g=Xh(h,p),m=m0(g,g),b=g[0],x=m-b*b;if(!x)return!d&&u;var _=t*m/x,v=-t*b/x,w=Xh(y,g),I=y0(y,_),D=y0(g,v);rS(I,D);var A=w,B=m0(I,A),M=m0(A,A),O=B*B-M*(m0(I,I)-1);if(!(O<0)){var R=Ce(O),S=y0(A,(-B-R)/M);if(rS(S,I),S=p0(S),!d)return S;var T=u[0],E=f[0],C=u[1],U=f[1],k;E<T&&(k=T,T=E,E=k);var $=E-T,z=Jt($-Yt)<rt,V=z||$<rt;if(!z&&U<C&&(k=C,C=U,U=k),V?z?C+U>0^S[1]<(Jt(S[0]-T)<rt?C:U):C<=S[1]&&S[1]<=U:$>Yt^(T<=S[0]&&S[0]<=E)){var Q=y0(A,(-B+R)/M);return rS(Q,I),[S,p0(Q)]}}}function l(u,f){var d=n?e:Yt-e,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return hS(s,a,o,n?[0,-e]:[-Yt,e-Yt])}function v$(e,t,r,n,i,o){var s=e[0],a=e[1],c=t[0],l=t[1],u=0,f=1,d=c-s,h=l-a,p;if(p=r-s,!(!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=i-s,!(!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)}if(p=n-a,!(!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=o-a,!(!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)}return u>0&&(e[0]=s+u*d,e[1]=a+u*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var w0=1e9,pS=-w0;function Zh(e,t,r,n){function i(l,u){return e<=l&&l<=r&&t<=u&&u<=n}function o(l,u,f,d){var h=0,p=0;if(l==null||(h=s(l,f))!==(p=s(u,f))||c(l,u)<0^f>0)do d.point(h===0||h===3?e:r,h>1?n:t);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function s(l,u){return Jt(l[0]-e)<rt?u>0?0:3:Jt(l[0]-r)<rt?u>0?2:1:Jt(l[1]-t)<rt?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),d=s(u,1);return f!==d?f-d: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=uS(),d,h,p,y,g,m,b,x,_,v,w,I={point:D,lineStart:O,lineEnd:R,polygonStart:B,polygonEnd:M};function D(T,E){i(T,E)&&u.point(T,E)}function A(){for(var T=0,E=0,C=h.length;E<C;++E)for(var U=h[E],k=1,$=U.length,z=U[0],V,Q,nt=z[0],st=z[1];k<$;++k)V=nt,Q=st,z=U[k],nt=z[0],st=z[1],Q<=n?st>n&&(nt-V)*(n-Q)>(st-Q)*(e-V)&&++T:st<=n&&(nt-V)*(n-Q)<(st-Q)*(e-V)&&--T;return T}function B(){u=f,d=[],h=[],w=!0}function M(){var T=A(),E=w&&T,C=(d=Bh(d)).length;(E||C)&&(l.polygonStart(),E&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),C&&dS(d,a,T,o,l),l.polygonEnd()),u=l,d=h=p=null}function O(){I.point=S,h&&h.push(p=[]),v=!0,_=!1,b=x=NaN}function R(){d&&(S(y,g),m&&_&&f.rejoin(),d.push(f.result())),I.point=D,_&&u.lineEnd()}function S(T,E){var C=i(T,E);if(h&&p.push([T,E]),v)y=T,g=E,m=C,v=!1,C&&(u.lineStart(),u.point(T,E));else if(C&&_)u.point(T,E);else{var U=[b=Math.max(pS,Math.min(w0,b)),x=Math.max(pS,Math.min(w0,x))],k=[T=Math.max(pS,Math.min(w0,T)),E=Math.max(pS,Math.min(w0,E))];v$(U,k,e,t,r,n)?(_||(u.lineStart(),u.point(U[0],U[1])),u.point(k[0],k[1]),C||u.lineEnd(),w=!1):C&&(u.lineStart(),u.point(T,E),w=!1)}b=T,x=E,_=C}return I}}function S$(e,t,r){var n=_r(e,t-rt,r).concat(t);return function(i){return n.map(function(o){return[i,o]})}}function I$(e,t,r){var n=_r(e,t-rt,r).concat(t);return function(i){return n.map(function(o){return[o,i]})}}function DB(){var e,t,r,n,i,o,s,a,c=10,l=c,u=90,f=360,d,h,p,y,g=2.5;function m(){return{type:"MultiLineString",coordinates:b()}}function b(){return _r(h0(n/u)*u,r,u).map(p).concat(_r(h0(a/f)*f,s,f).map(y)).concat(_r(h0(t/c)*c,e,c).filter(function(x){return Jt(x%u)>rt}).map(d)).concat(_r(h0(o/l)*l,i,l).filter(function(x){return Jt(x%f)>rt}).map(h))}return m.lines=function(){return b().map(function(x){return{type:"LineString",coordinates:x}})},m.outline=function(){return{type:"Polygon",coordinates:[p(n).concat(y(s).slice(1),p(r).reverse().slice(1),y(a).reverse().slice(1))]}},m.extent=function(x){return arguments.length?m.extentMajor(x).extentMinor(x):m.extentMinor()},m.extentMajor=function(x){return arguments.length?(n=+x[0][0],r=+x[1][0],a=+x[0][1],s=+x[1][1],n>r&&(x=n,n=r,r=x),a>s&&(x=a,a=s,s=x),m.precision(g)):[[n,a],[r,s]]},m.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),m.precision(g)):[[t,o],[e,i]]},m.step=function(x){return arguments.length?m.stepMajor(x).stepMinor(x):m.stepMinor()},m.stepMajor=function(x){return arguments.length?(u=+x[0],f=+x[1],m):[u,f]},m.stepMinor=function(x){return arguments.length?(c=+x[0],l=+x[1],m):[c,l]},m.precision=function(x){return arguments.length?(g=+x,d=S$(o,i,90),h=I$(t,e,g),p=S$(a,s,90),y=I$(n,r,g),m):g},m.extentMajor([[-180,-90+rt],[180,90-rt]]).extentMinor([[-180,-80-rt],[180,80+rt]])}function BB(){return DB()()}var v0=e=>e;var OB=new mn,NB=new mn,T$,A$,FB,LB,au={point:Lr,lineStart:Lr,lineEnd:Lr,polygonStart:function(){au.lineStart=lit,au.lineEnd=fit},polygonEnd:function(){au.lineStart=au.lineEnd=au.point=Lr,OB.add(Jt(NB)),NB=new mn},result:function(){var e=OB/2;return OB=new mn,e}};function lit(){au.point=uit}function uit(e,t){au.point=M$,T$=FB=e,A$=LB=t}function M$(e,t){NB.add(LB*e-FB*t),FB=e,LB=t}function fit(){M$(T$,A$)}var RB=au;var Kh=1/0,mS=Kh,S0=-Kh,yS=S0,dit={point:hit,lineStart:Lr,lineEnd:Lr,polygonStart:Lr,polygonEnd:Lr,result:function(){var e=[[Kh,mS],[S0,yS]];return S0=yS=-(mS=Kh=1/0),e}};function hit(e,t){e<Kh&&(Kh=e),e>S0&&(S0=e),t<mS&&(mS=t),t>yS&&(yS=t)}var Qh=dit;var kB=0,CB=0,I0=0,gS=0,bS=0,Jh=0,UB=0,PB=0,T0=0,B$,O$,oa,sa,ys={point:Wf,lineStart:E$,lineEnd:D$,polygonStart:function(){ys.lineStart=yit,ys.lineEnd=git},polygonEnd:function(){ys.point=Wf,ys.lineStart=E$,ys.lineEnd=D$},result:function(){var e=T0?[UB/T0,PB/T0]:Jh?[gS/Jh,bS/Jh]:I0?[kB/I0,CB/I0]:[NaN,NaN];return kB=CB=I0=gS=bS=Jh=UB=PB=T0=0,e}};function Wf(e,t){kB+=e,CB+=t,++I0}function E$(){ys.point=pit}function pit(e,t){ys.point=mit,Wf(oa=e,sa=t)}function mit(e,t){var r=e-oa,n=t-sa,i=Ce(r*r+n*n);gS+=i*(oa+e)/2,bS+=i*(sa+t)/2,Jh+=i,Wf(oa=e,sa=t)}function D$(){ys.point=Wf}function yit(){ys.point=bit}function git(){N$(B$,O$)}function bit(e,t){ys.point=N$,Wf(B$=oa=e,O$=sa=t)}function N$(e,t){var r=e-oa,n=t-sa,i=Ce(r*r+n*n);gS+=i*(oa+e)/2,bS+=i*(sa+t)/2,Jh+=i,i=sa*e-oa*t,UB+=i*(oa+e),PB+=i*(sa+t),T0+=i*3,Wf(oa=e,sa=t)}var $B=ys;function xS(e){this._context=e}xS.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,Xr);break}}},result:Lr};var VB=new mn,zB,F$,L$,A0,M0,_S={point:Lr,lineStart:function(){_S.point=xit},lineEnd:function(){zB&&R$(F$,L$),_S.point=Lr},polygonStart:function(){zB=!0},polygonEnd:function(){zB=null},result:function(){var e=+VB;return VB=new mn,e}};function xit(e,t){_S.point=R$,F$=A0=e,L$=M0=t}function R$(e,t){A0-=e,M0-=t,VB.add(Ce(A0*A0+M0*M0)),A0=e,M0=t}var jB=_S;var k$,wS,C$,U$,tp=class{constructor(t){this._append=t==null?P$:_it(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,r){switch(this._point){case 0:{this._append`M${t},${r}`,this._point=1;break}case 1:{this._append`L${t},${r}`;break}default:{if(this._append`M${t},${r}`,this._radius!==C$||this._append!==wS){let n=this._radius,i=this._;this._="",this._append`m0,${n}a${n},${n} 0 1,1 0,${-2*n}a${n},${n} 0 1,1 0,${2*n}z`,C$=n,wS=this._append,U$=this._,this._=i}this._+=U$;break}}}result(){let t=this._;return this._="",t.length?t:null}};function P$(e){let t=1;this._+=e[0];for(let r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function _it(e){let t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return P$;if(t!==k$){let r=10**t;k$=t,wS=function(i){let o=1;this._+=i[0];for(let s=i.length;o<s;++o)this._+=Math.round(arguments[o]*r)/r+i[o]}}return wS}function xn(e,t){let r=3,n=4.5,i,o;function s(a){return a&&(typeof n=="function"&&o.pointRadius(+n.apply(this,arguments)),qi(a,i(o))),o.result()}return s.area=function(a){return qi(a,i(RB)),RB.result()},s.measure=function(a){return qi(a,i(jB)),jB.result()},s.bounds=function(a){return qi(a,i(Qh)),Qh.result()},s.centroid=function(a){return qi(a,i($B)),$B.result()},s.projection=function(a){return arguments.length?(i=a==null?(e=null,v0):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new tp(r)):new xS(t=a),typeof n!="function"&&o.pointRadius(n),s):t},s.pointRadius=function(a){return arguments.length?(n=typeof a=="function"?a:(o.pointRadius(+a),+a),s):n},s.digits=function(a){if(!arguments.length)return r;if(a==null)r=null;else{let c=Math.floor(a);if(!(c>=0))throw new RangeError(`invalid digits: ${a}`);r=c}return t===null&&(o=new tp(r)),s},s.projection(e).digits(r).context(t)}function Gf(e){return{stream:ep(e)}}function ep(e){return function(t){var r=new qB;for(var n in e)r[n]=e[n];return r.stream=t,r}}function qB(){}qB.prototype={constructor:qB,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 YB(e,t,r){var n=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),n!=null&&e.clipExtent(null),qi(r,e.stream(Qh)),t(Qh.result()),n!=null&&e.clipExtent(n),e}function E0(e,t,r){return YB(e,function(n){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(i/(n[1][0]-n[0][0]),o/(n[1][1]-n[0][1])),a=+t[0][0]+(i-s*(n[1][0]+n[0][0]))/2,c=+t[0][1]+(o-s*(n[1][1]+n[0][1]))/2;e.scale(150*s).translate([a,c])},r)}function vS(e,t,r){return E0(e,[[0,0],t],r)}function SS(e,t,r){return YB(e,function(n){var i=+t,o=i/(n[1][0]-n[0][0]),s=(i-o*(n[1][0]+n[0][0]))/2,a=-o*n[0][1];e.scale(150*o).translate([s,a])},r)}function IS(e,t,r){return YB(e,function(n){var i=+t,o=i/(n[1][1]-n[0][1]),s=-o*n[0][0],a=(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([s,a])},r)}var $$=16,wit=et(30*ce);function WB(e,t){return+t?Sit(e,t):vit(e)}function vit(e){return ep({point:function(t,r){t=e(t,r),this.stream.point(t[0],t[1])}})}function Sit(e,t){function r(n,i,o,s,a,c,l,u,f,d,h,p,y,g){var m=l-n,b=u-i,x=m*m+b*b;if(x>4*t&&y--){var _=s+d,v=a+h,w=c+p,I=Ce(_*_+v*v+w*w),D=Ke(w/=I),A=Jt(Jt(w)-1)<rt||Jt(o-f)<rt?(o+f)/2:Fr(v,_),B=e(A,D),M=B[0],O=B[1],R=M-n,S=O-i,T=b*R-m*S;(T*T/x>t||Jt((m*R+b*S)/x-.5)>.3||s*d+a*h+c*p<wit)&&(r(n,i,o,s,a,c,M,O,A,_/=I,v/=I,w,y,g),g.point(M,O),r(M,O,A,_,v,w,l,u,f,d,h,p,y,g))}}return function(n){var i,o,s,a,c,l,u,f,d,h,p,y,g={point:m,lineStart:b,lineEnd:_,polygonStart:function(){n.polygonStart(),g.lineStart=v},polygonEnd:function(){n.polygonEnd(),g.lineStart=b}};function m(D,A){D=e(D,A),n.point(D[0],D[1])}function b(){f=NaN,g.point=x,n.lineStart()}function x(D,A){var B=ia([D,A]),M=e(D,A);r(f,d,u,h,p,y,f=M[0],d=M[1],u=D,h=B[0],p=B[1],y=B[2],$$,n),n.point(f,d)}function _(){g.point=m,n.lineEnd()}function v(){b(),g.point=w,g.lineEnd=I}function w(D,A){x(i=D,A),o=f,s=d,a=h,c=p,l=y,g.point=x}function I(){r(f,d,u,h,p,y,o,s,i,a,c,l,$$,n),g.lineEnd=_,_()}return g}}var Iit=ep({point:function(e,t){this.stream.point(e*ce,t*ce)}});function Tit(e){return ep({point:function(t,r){var n=e(t,r);return this.stream.point(n[0],n[1])}})}function Ait(e,t,r,n,i){function o(s,a){return s*=n,a*=i,[t+e*s,r-e*a]}return o.invert=function(s,a){return[(s-t)/e*n,(r-a)/e*i]},o}function z$(e,t,r,n,i,o){if(!o)return Ait(e,t,r,n,i);var s=et(o),a=tt(o),c=s*e,l=a*e,u=s/e,f=a/e,d=(a*r-s*t)/e,h=(a*t+s*r)/e;function p(y,g){return y*=n,g*=i,[c*y-l*g+t,r-l*y-c*g]}return p.invert=function(y,g){return[n*(u*y-f*g+d),i*(h-f*y-u*g)]},p}function _n(e){return GB(function(){return e})()}function GB(e){var t,r=150,n=480,i=250,o=0,s=0,a=0,c=0,l=0,u,f=0,d=1,h=1,p=null,y=EB,g=null,m,b,x,_=v0,v=.5,w,I,D,A,B;function M(T){return D(T[0]*ce,T[1]*ce)}function O(T){return T=D.invert(T[0],T[1]),T&&[T[0]*yr,T[1]*yr]}M.stream=function(T){return A&&B===T?A:A=Iit(Tit(u)(y(w(_(B=T)))))},M.preclip=function(T){return arguments.length?(y=T,p=void 0,S()):y},M.postclip=function(T){return arguments.length?(_=T,g=m=b=x=null,S()):_},M.clipAngle=function(T){return arguments.length?(y=+T?w$(p=T*ce):(p=null,EB),S()):p*yr},M.clipExtent=function(T){return arguments.length?(_=T==null?(g=m=b=x=null,v0):Zh(g=+T[0][0],m=+T[0][1],b=+T[1][0],x=+T[1][1]),S()):g==null?null:[[g,m],[b,x]]},M.scale=function(T){return arguments.length?(r=+T,R()):r},M.translate=function(T){return arguments.length?(n=+T[0],i=+T[1],R()):[n,i]},M.center=function(T){return arguments.length?(o=T[0]%360*ce,s=T[1]%360*ce,R()):[o*yr,s*yr]},M.rotate=function(T){return arguments.length?(a=T[0]%360*ce,c=T[1]%360*ce,l=T.length>2?T[2]%360*ce:0,R()):[a*yr,c*yr,l*yr]},M.angle=function(T){return arguments.length?(f=T%360*ce,R()):f*yr},M.reflectX=function(T){return arguments.length?(d=T?-1:1,R()):d<0},M.reflectY=function(T){return arguments.length?(h=T?-1:1,R()):h<0},M.precision=function(T){return arguments.length?(w=WB(I,v=T*T),S()):Ce(v)},M.fitExtent=function(T,E){return E0(M,T,E)},M.fitSize=function(T,E){return vS(M,T,E)},M.fitWidth=function(T,E){return SS(M,T,E)},M.fitHeight=function(T,E){return IS(M,T,E)};function R(){var T=z$(r,0,0,d,h,f).apply(null,t(o,s)),E=z$(r,n-T[0],i-T[1],d,h,f);return u=AB(a,c,l),I=_0(t,E),D=_0(u,I),w=WB(I,v),S()}function S(){return A=B=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&O,R()}}function rp(e){var t=0,r=Yt/3,n=GB(e),i=n(t,r);return i.parallels=function(o){return arguments.length?n(t=o[0]*ce,r=o[1]*ce):[t*yr,r*yr]},i}function V$(e){var t=et(e);function r(n,i){return[n*t,tt(i)/t]}return r.invert=function(n,i){return[n/t,Ke(i*t)]},r}function j$(e,t){var r=tt(e),n=(r+tt(t))/2;if(Jt(n)<rt)return V$(e);var i=1+r*(2*n-r),o=Ce(i)/n;function s(a,c){var l=Ce(i-2*n*tt(c))/n;return[l*tt(a*=n),o-l*et(a)]}return s.invert=function(a,c){var l=o-c,u=Fr(a,Jt(l))*Nn(l);return l*n<0&&(u-=Yt*Nn(a)*Nn(l)),[u/n,Ke((i-(a*a+l*l)*n*n)/(2*n))]},s}function cu(){return rp(j$).scale(155.424).center([0,33.6442])}function D0(){return cu().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Mit(e){var t=e.length;return{point:function(r,n){for(var i=-1;++i<t;)e[i].point(r,n)},sphere:function(){for(var r=-1;++r<t;)e[r].sphere()},lineStart:function(){for(var r=-1;++r<t;)e[r].lineStart()},lineEnd:function(){for(var r=-1;++r<t;)e[r].lineEnd()},polygonStart:function(){for(var r=-1;++r<t;)e[r].polygonStart()},polygonEnd:function(){for(var r=-1;++r<t;)e[r].polygonEnd()}}}function XB(){var e,t,r=D0(),n,i=cu().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=cu().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,c,l={point:function(d,h){c=[d,h]}};function u(d){var h=d[0],p=d[1];return c=null,n.point(h,p),c||(o.point(h,p),c)||(a.point(h,p),c)}u.invert=function(d){var h=r.scale(),p=r.translate(),y=(d[0]-p[0])/h,g=(d[1]-p[1])/h;return(g>=.12&&g<.234&&y>=-.425&&y<-.214?i:g>=.166&&g<.234&&y>=-.214&&y<-.115?s:r).invert(d)},u.stream=function(d){return e&&t===d?e:e=Mit([r.stream(t=d),i.stream(d),s.stream(d)])},u.precision=function(d){return arguments.length?(r.precision(d),i.precision(d),s.precision(d),f()):r.precision()},u.scale=function(d){return arguments.length?(r.scale(d),i.scale(d*.35),s.scale(d),u.translate(r.translate())):r.scale()},u.translate=function(d){if(!arguments.length)return r.translate();var h=r.scale(),p=+d[0],y=+d[1];return n=r.translate(d).clipExtent([[p-.455*h,y-.238*h],[p+.455*h,y+.238*h]]).stream(l),o=i.translate([p-.307*h,y+.201*h]).clipExtent([[p-.425*h+rt,y+.12*h+rt],[p-.214*h-rt,y+.234*h-rt]]).stream(l),a=s.translate([p-.205*h,y+.212*h]).clipExtent([[p-.214*h+rt,y+.166*h+rt],[p-.115*h-rt,y+.234*h-rt]]).stream(l),f()},u.fitExtent=function(d,h){return E0(u,d,h)},u.fitSize=function(d,h){return vS(u,d,h)},u.fitWidth=function(d,h){return SS(u,d,h)},u.fitHeight=function(d,h){return IS(u,d,h)};function f(){return e=t=null,u}return u.scale(1070)}function TS(e){return function(t,r){var n=et(t),i=et(r),o=e(n*i);return o===1/0?[2,0]:[o*i*tt(t),o*tt(r)]}}function aa(e){return function(t,r){var n=Ce(t*t+r*r),i=e(n),o=tt(i),s=et(i);return[Fr(t*o,n*s),Ke(n&&r*o/n)]}}var HB=TS(function(e){return Ce(2/(1+e))});HB.invert=aa(function(e){return 2*Ke(e/2)});function ZB(){return _n(HB).scale(124.75).clipAngle(180-.001)}var KB=TS(function(e){return(e=tS(e))&&e/tt(e)});KB.invert=aa(function(e){return e});function QB(){return _n(KB).scale(79.4188).clipAngle(180-.001)}function np(e,t){return[e,Yf(Gh((ke+t)/2))]}np.invert=function(e,t){return[e,2*vo(Kv(t))-ke]};function JB(){return tO(np).scale(961/Xr)}function tO(e){var t=_n(e),r=t.center,n=t.scale,i=t.translate,o=t.clipExtent,s=null,a,c,l;t.scale=function(f){return arguments.length?(n(f),u()):n()},t.translate=function(f){return arguments.length?(i(f),u()):i()},t.center=function(f){return arguments.length?(r(f),u()):r()},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=Yt*n(),d=t(y$(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===np?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,c),l]]:[[s,Math.max(d[1]-f,a)],[c,Math.min(d[1]+f,l)]])}return u()}function AS(e){return Gh((ke+e)/2)}function q$(e,t){var r=et(e),n=e===t?tt(e):Yf(r/et(t))/Yf(AS(t)/AS(e)),i=r*Jv(AS(e),n)/n;if(!n)return np;function o(s,a){i>0?a<-ke+rt&&(a=-ke+rt):a>ke-rt&&(a=ke-rt);var c=i/Jv(AS(a),n);return[c*tt(n*s),i-c*et(n*s)]}return o.invert=function(s,a){var c=i-a,l=Nn(n)*Ce(s*s+c*c),u=Fr(s,Jt(c))*Nn(c);return c*n<0&&(u-=Yt*Nn(s)*Nn(c)),[u/n,2*vo(Jv(i/l,1/n))-ke]},o}function eO(){return rp(q$).scale(109.5).parallels([30,30])}function ip(e,t){return[e,t]}ip.invert=ip;function rO(){return _n(ip).scale(152.63)}function Y$(e,t){var r=et(e),n=e===t?tt(e):(r-et(t))/(t-e),i=r/n+e;if(Jt(n)<rt)return ip;function o(s,a){var c=i-a,l=n*s;return[c*tt(l),i-c*et(l)]}return o.invert=function(s,a){var c=i-a,l=Fr(s,Jt(c))*Nn(c);return c*n<0&&(l-=Yt*Nn(s)*Nn(c)),[l/n,i-Nn(n)*Ce(s*s+c*c)]},o}function nO(){return rp(Y$).scale(131.154).center([0,13.9389])}var B0=1.340264,O0=-.081106,N0=893e-6,F0=.003796,MS=Ce(3)/2,Eit=12;function iO(e,t){var r=Ke(MS*tt(t)),n=r*r,i=n*n*n;return[e*et(r)/(MS*(B0+3*O0*n+i*(7*N0+9*F0*n))),r*(B0+O0*n+i*(N0+F0*n))]}iO.invert=function(e,t){for(var r=t,n=r*r,i=n*n*n,o=0,s,a,c;o<Eit&&(a=r*(B0+O0*n+i*(N0+F0*n))-t,c=B0+3*O0*n+i*(7*N0+9*F0*n),r-=s=a/c,n=r*r,i=n*n*n,!(Jt(s)<qf));++o);return[MS*e*(B0+3*O0*n+i*(7*N0+9*F0*n))/et(r),Ke(tt(r)/MS)]};function oO(){return _n(iO).scale(177.158)}function sO(e,t){var r=et(t),n=et(e)*r;return[r*tt(e)/n,tt(t)/n]}sO.invert=aa(vo);function aO(){return _n(sO).scale(144.049).clipAngle(60)}function cO(e,t){return[et(t)*tt(e),tt(t)]}cO.invert=aa(Ke);function lO(){return _n(cO).scale(249.5).clipAngle(90+rt)}function uO(e,t){var r=et(t),n=1+et(e)*r;return[r*tt(e)/n,tt(t)/n]}uO.invert=aa(function(e){return 2*vo(e)});function fO(){return _n(uO).scale(250).clipAngle(142)}function dO(e,t){return[Yf(Gh((ke+t)/2)),-e]}dO.invert=function(e,t){return[-t,2*vo(Kv(e))-ke]};function hO(){var e=tO(dO),t=e.center,r=e.rotate;return e.center=function(n){return arguments.length?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},e.rotate=function(n){return arguments.length?r([n[0],n[1],n.length>2?n[2]+90:90]):(n=r(),[n[0],n[1],n[2]-90])},r([0,0,90]).scale(159.155)}function Dit(e,t){return e.parent===t.parent?1:2}function Bit(e){return e.reduce(Oit,0)/e.length}function Oit(e,t){return e+t.x}function Nit(e){return 1+e.reduce(Fit,0)}function Fit(e,t){return Math.max(e,t.y)}function Lit(e){for(var t;t=e.children;)e=t[0];return e}function Rit(e){for(var t;t=e.children;)e=t[t.length-1];return e}function ES(){var e=Dit,t=1,r=1,n=!1;function i(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=Bit(h),d.y=Nit(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var c=Lit(o),l=Rit(o),u=c.x-e(c,l)/2,f=l.x+e(l,c)/2;return o.eachAfter(n?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*r}:function(d){d.x=(d.x-u)/(f-u)*t,d.y=(1-(o.y?d.y/o.y:1))*r})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(n=!1,t=+o[0],r=+o[1],i):n?null:[t,r]},i.nodeSize=function(o){return arguments.length?(n=!0,t=+o[0],r=+o[1],i):n?[t,r]:null},i}function kit(e){var t=0,r=e.children,n=r&&r.length;if(!n)t=1;else for(;--n>=0;)t+=r[n].value;e.value=t}function W$(){return this.eachAfter(kit)}function G$(e,t){let r=-1;for(let n of this)e.call(t,n,++r,this);return this}function X$(e,t){for(var r=this,n=[r],i,o,s=-1;r=n.pop();)if(e.call(t,r,++s,this),i=r.children)for(o=i.length-1;o>=0;--o)n.push(i[o]);return this}function H$(e,t){for(var r=this,n=[r],i=[],o,s,a,c=-1;r=n.pop();)if(i.push(r),o=r.children)for(s=0,a=o.length;s<a;++s)n.push(o[s]);for(;r=i.pop();)e.call(t,r,++c,this);return this}function Z$(e,t){let r=-1;for(let n of this)if(e.call(t,n,++r,this))return n}function K$(e){return this.eachAfter(function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r})}function Q$(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function J$(e){for(var t=this,r=Cit(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,0,e),e=e.parent;return n}function Cit(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;for(e=r.pop(),t=n.pop();e===t;)i=e,e=r.pop(),t=n.pop();return i}function tz(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function ez(){return Array.from(this)}function rz(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function nz(){var e=this,t=[];return e.each(function(r){r!==e&&t.push({source:r.parent,target:r})}),t}function*iz(){var e=this,t,r=[e],n,i,o;do for(t=r.reverse(),r=[];e=t.pop();)if(yield e,n=e.children)for(i=0,o=n.length;i<o;++i)r.push(n[i]);while(r.length)}function pO(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=$it)):t===void 0&&(t=Pit);for(var r=new lu(e),n,i=[r],o,s,a,c;n=i.pop();)if((s=t(n.data))&&(c=(s=Array.from(s)).length))for(n.children=s,a=c-1;a>=0;--a)i.push(o=s[a]=new lu(s[a])),o.parent=n,o.depth=n.depth+1;return r.eachBefore(mO)}function Uit(){return pO(this).eachBefore(zit)}function Pit(e){return e.children}function $it(e){return Array.isArray(e)?e[1]:null}function zit(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function mO(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function lu(e){this.data=e,this.depth=this.height=0,this.parent=null}lu.prototype=pO.prototype={constructor:lu,count:W$,each:G$,eachAfter:H$,eachBefore:X$,find:Z$,sum:K$,sort:Q$,path:J$,ancestors:tz,descendants:ez,leaves:rz,links:nz,copy:Uit,[Symbol.iterator]:iz};function DS(e){return e==null?null:Vit(e)}function Vit(e){if(typeof e!="function")throw new Error;return e}var jit={depth:-1},oz={},yO={};function qit(e){return e.id}function Yit(e){return e.parentId}function BS(){var e=qit,t=Yit,r;function n(i){var o=Array.from(i),s=e,a=t,c,l,u,f,d,h,p,y,g=new Map;if(r!=null){let m=o.map((_,v)=>Wit(r(_,v,i))),b=m.map(sz),x=new Set(m).add("");for(let _ of b)x.has(_)||(x.add(_),m.push(_),b.push(sz(_)),o.push(yO));s=(_,v)=>m[v],a=(_,v)=>b[v]}for(u=0,c=o.length;u<c;++u)l=o[u],h=o[u]=new lu(l),(p=s(l,u,i))!=null&&(p+="")&&(y=h.id=p,g.set(y,g.has(y)?oz:h)),(p=a(l,u,i))!=null&&(p+="")&&(h.parent=p);for(u=0;u<c;++u)if(h=o[u],p=h.parent){if(d=g.get(p),!d)throw new Error("missing: "+p);if(d===oz)throw new Error("ambiguous: "+p);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(r!=null){for(;f.data===yO&&f.children.length===1;)f=f.children[0],--c;for(let m=o.length-1;m>=0&&(h=o[m],h.data===yO);--m)h.data=null}if(f.parent=jit,f.eachBefore(function(m){m.depth=m.parent.depth+1,--c}).eachBefore(mO),f.parent=null,c>0)throw new Error("cycle");return f}return n.id=function(i){return arguments.length?(e=DS(i),n):e},n.parentId=function(i){return arguments.length?(t=DS(i),n):t},n.path=function(i){return arguments.length?(r=DS(i),n):r},n}function Wit(e){e=`${e}`;let t=e.length;return gO(e,t-1)&&!gO(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function sz(e){let t=e.length;if(t<2)return"";for(;--t>1&&!gO(e,t););return e.slice(0,t)}function gO(e,t){if(e[t]==="/"){let r=0;for(;t>0&&e[--t]==="\\";)++r;if(!(r&1))return!0}return!1}function Git(e,t){return e.parent===t.parent?1:2}function bO(e){var t=e.children;return t?t[0]:e.t}function xO(e){var t=e.children;return t?t[t.length-1]:e.t}function Xit(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function Hit(e){for(var t=0,r=0,n=e.children,i=n.length,o;--i>=0;)o=n[i],o.z+=t,o.m+=t,t+=o.s+(r+=o.c)}function Zit(e,t,r){return e.a.parent===t.parent?e.a:r}function OS(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}OS.prototype=Object.create(lu.prototype);function Kit(e){for(var t=new OS(e,0),r,n=[t],i,o,s,a;r=n.pop();)if(o=r._.children)for(r.children=new Array(a=o.length),s=a-1;s>=0;--s)n.push(i=r.children[s]=new OS(o[s],s)),i.parent=r;return(t.parent=new OS(null,0)).children=[t],t}function Xf(){var e=Git,t=1,r=1,n=null;function i(l){var u=Kit(l);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),n)l.eachBefore(c);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,y=p-f.x,g=t/(d.x+p+y),m=r/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+y)*g,b.y=b.depth*m})}return l}function o(l){var u=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(u){Hit(l);var h=(u[0].z+u[u.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,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 d=l,h=l,p=u,y=d.parent.children[0],g=d.m,m=h.m,b=p.m,x=y.m,_;p=xO(p),d=bO(d),p&&d;)y=bO(y),h=xO(h),h.a=l,_=p.z+b-d.z-g+e(p._,d._),_>0&&(Xit(Zit(p,l,f),l,_),g+=_,m+=_),b+=p.m,g+=d.m,x+=y.m,m+=h.m;p&&!xO(h)&&(h.t=p,h.m+=b-m),d&&!bO(y)&&(y.t=d,y.m+=g-x,f=l)}return f}function c(l){l.x*=t,l.y=l.depth*r}return i.separation=function(l){return arguments.length?(e=l,i):e},i.size=function(l){return arguments.length?(n=!1,t=+l[0],r=+l[1],i):n?null:[t,r]},i.nodeSize=function(l){return arguments.length?(n=!0,t=+l[0],r=+l[1],i):n?[t,r]:null},i}var az=23283064365386963e-26;function ca(e=Math.random()){let t=(0<=e&&e<1?e/az:Math.abs(e))|0;return()=>(t=1664525*t+1013904223|0,az*(t>>>0))}function Rr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function L0(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 R0=Symbol("implicit");function Hf(){var e=new Gn,t=[],r=[],n=R0;function i(o){let s=e.get(o);if(s===void 0){if(n!==R0)return n;e.set(o,s=t.push(o)-1)}return r[s%r.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Gn;for(let s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Hf(t,r).unknown(n)},Rr.apply(i,arguments),i}function uu(){var e=Hf().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,o,s,a=!1,c=0,l=0,u=.5;delete e.unknown;function f(){var d=t().length,h=i<n,p=h?i:n,y=h?n:i;o=(y-p)/Math.max(1,d-c+l*2),a&&(o=Math.floor(o)),p+=(y-p-o*(d-c))*u,s=o*(1-c),a&&(p=Math.round(p),s=Math.round(s));var g=_r(d).map(function(m){return p+o*m});return r(h?g.reverse():g)}return e.domain=function(d){return arguments.length?(t(d),f()):t()},e.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,f()):[n,i]},e.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(d){return arguments.length?(a=!!d,f()):a},e.padding=function(d){return arguments.length?(c=Math.min(1,l=+d),f()):c},e.paddingInner=function(d){return arguments.length?(c=Math.min(1,d),f()):c},e.paddingOuter=function(d){return arguments.length?(l=+d,f()):l},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},e.copy=function(){return uu(t(),[n,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},Rr.apply(f(),arguments)}function cz(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return cz(t())},e}function _O(){return cz(uu.apply(null,arguments).paddingInner(1))}function wO(e){return function(){return e}}function op(e){return+e}var lz=[0,1];function Si(e){return e}function vO(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:wO(isNaN(t)?NaN:.5)}function Qit(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Jit(e,t,r){var n=e[0],i=e[1],o=t[0],s=t[1];return i<n?(n=vO(i,n),o=r(s,o)):(n=vO(n,i),o=r(o,s)),function(a){return o(n(a))}}function tot(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),o=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)i[s]=vO(e[s],e[s+1]),o[s]=r(t[s],t[s+1]);return function(a){var c=Nc(e,a,1,n)-1;return o[c](i[c](a))}}function la(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Zf(){var e=lz,t=lz,r=ji,n,i,o,s=Si,a,c,l;function u(){var d=Math.min(e.length,t.length);return s!==Si&&(s=Qit(e[0],e[d-1])),a=d>2?tot:Jit,c=l=null,f}function f(d){return d==null||isNaN(d=+d)?o:(c||(c=a(e.map(n),t,r)))(n(s(d)))}return f.invert=function(d){return s(i((l||(l=a(t,e.map(n),Ze)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,op),u()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),r=Uf,u()},f.clamp=function(d){return arguments.length?(s=d?!0:Si,u()):s!==Si},f.interpolate=function(d){return arguments.length?(r=d,u()):r},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return n=d,i=h,u()}}function k0(){return Zf()(Si,Si)}function SO(e,t,r,n){var i=Eh(e,t,r),o;switch(n=na(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=yB(i,s))&&(n.precision=o),Zv(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=gB(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=mB(i))&&(n.precision=o-(n.type==="%")*2);break}}return wo(n)}function jc(e){var t=e.domain;return e.ticks=function(r){var n=t();return yn(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return SO(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,s=n[i],a=n[o],c,l,u=10;for(a<s&&(l=s,s=a,a=l,l=i,i=o,o=l);u-- >0;){if(l=Fc(s,a,r),l===c)return n[i]=s,n[o]=a,t(n);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 qc(){var e=k0();return e.copy=function(){return la(e,qc())},Rr.apply(e,arguments),jc(e)}function C0(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,op),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return C0(e).unknown(t)},e=arguments.length?Array.from(e,op):[0,1],jc(r)}function U0(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],s;return o<i&&(s=r,r=n,n=s,s=i,i=o,o=s),e[r]=t.floor(i),e[n]=t.ceil(o),e}function uz(e){return Math.log(e)}function fz(e){return Math.exp(e)}function eot(e){return-Math.log(-e)}function rot(e){return-Math.exp(-e)}function not(e){return isFinite(e)?+("1e"+e):e<0?0:e}function iot(e){return e===10?not:e===Math.E?Math.exp:t=>Math.pow(e,t)}function oot(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 dz(e){return(t,r)=>-e(-t,r)}function IO(e){let t=e(uz,fz),r=t.domain,n=10,i,o;function s(){return i=oot(n),o=iot(n),r()[0]<0?(i=dz(i),o=dz(o),e(eot,rot)):e(uz,fz),t}return t.base=function(a){return arguments.length?(n=+a,s()):n},t.domain=function(a){return arguments.length?(r(a),s()):r()},t.ticks=a=>{let c=r(),l=c[0],u=c[c.length-1],f=u<l;f&&([l,u]=[u,l]);let d=i(l),h=i(u),p,y,g=a==null?10:+a,m=[];if(!(n%1)&&h-d<g){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(p=1;p<n;++p)if(y=d<0?p/o(-d):p*o(d),!(y<l)){if(y>u)break;m.push(y)}}else for(;d<=h;++d)for(p=n-1;p>=1;--p)if(y=d>0?p/o(-d):p*o(d),!(y<l)){if(y>u)break;m.push(y)}m.length*2<g&&(m=yn(l,u,g))}else m=yn(d,h,Math.min(h-d,g)).map(o);return f?m.reverse():m},t.tickFormat=(a,c)=>{if(a==null&&(a=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=na(c)).precision==null&&(c.trim=!0),c=wo(c)),a===1/0)return c;let l=Math.max(1,n*a/t.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*n<n-.5&&(f*=n),f<=l?c(u):""}},t.nice=()=>r(U0(r(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function P0(){let e=IO(Zf()).domain([1,10]);return e.copy=()=>la(e,P0()).base(e.base()),Rr.apply(e,arguments),e}function hz(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function pz(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function TO(e){var t=1,r=e(hz(t),pz(t));return r.constant=function(n){return arguments.length?e(hz(t=+n),pz(t)):t},jc(r)}function $0(){var e=TO(Zf());return e.copy=function(){return la(e,$0()).constant(e.constant())},Rr.apply(e,arguments)}function mz(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function sot(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function aot(e){return e<0?-e*e:e*e}function AO(e){var t=e(Si,Si),r=1;function n(){return r===1?e(Si,Si):r===.5?e(sot,aot):e(mz(r),mz(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},jc(t)}function z0(){var e=AO(Zf());return e.copy=function(){return la(e,z0()).exponent(e.exponent())},Rr.apply(e,arguments),e}function V0(){var e=[],t=[],r=[],n;function i(){var s=0,a=Math.max(1,t.length);for(r=new Array(a-1);++s<a;)r[s-1]=TD(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?n:t[Nc(r,s)]}return o.invertExtent=function(s){var a=t.indexOf(s);return a<0?[NaN,NaN]:[a>0?r[a-1]:e[0],a<r.length?r[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(ie),i()},o.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},o.unknown=function(s){return arguments.length?(n=s,o):n},o.quantiles=function(){return r.slice()},o.copy=function(){return V0().domain(e).range(t).unknown(n)},Rr.apply(o,arguments)}function j0(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[Nc(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=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?(r=o,i):r},i.copy=function(){return j0().domain(e).range(t).unknown(r)},Rr.apply(i,arguments)}var MO=new Date,EO=new Date;function Pe(e,t,r,n){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=>Pe(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););}),r&&(i.count=(o,s)=>(MO.setTime(+o),EO.setTime(+s),e(MO),e(EO),Math.floor(r(MO,EO))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?s=>n(s)%o===0:s=>i.count(0,s)%o===0):i)),i}var q0=Pe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);q0.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Pe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):q0);var Q$t=q0.range;var Hr=Pe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),yz=Hr.range;var Yc=Pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),cot=Yc.range,Wc=Pe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),lot=Wc.range;var Gc=Pe(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()),uot=Gc.range,Xc=Pe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),fot=Xc.range;var So=Pe(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),dot=So.range,Jf=Pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),hot=Jf.range,td=Pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),pot=td.range;function ed(e){return Pe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}var Yi=ed(0),fu=ed(1),NS=ed(2),FS=ed(3),fa=ed(4),LS=ed(5),RS=ed(6),bz=Yi.range,mot=fu.range,yot=NS.range,got=FS.range,bot=fa.range,xot=LS.range,_ot=RS.range;function rd(e){return Pe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/6048e5)}var Wi=rd(0),du=rd(1),kS=rd(2),CS=rd(3),da=rd(4),US=rd(5),PS=rd(6),xz=Wi.range,wot=du.range,vot=kS.range,Sot=CS.range,Iot=da.range,Tot=US.range,Aot=PS.range;var Hc=Pe(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()),Mot=Hc.range,Zc=Pe(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()),Eot=Zc.range;var Fn=Pe(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());Fn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});var Dot=Fn.range,Ln=Pe(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:Pe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});var Bot=Ln.range;function wz(e,t,r,n,i,o){let s=[[Hr,1,1e3],[Hr,5,5*1e3],[Hr,15,15*1e3],[Hr,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],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[t,1,2592e6],[t,3,3*2592e6],[e,1,31536e6]];function a(l,u,f){let d=u<l;d&&([l,u]=[u,l]);let h=f&&typeof f.range=="function"?f:c(l,u,f),p=h?h.range(l,+u+1):[];return d?p.reverse():p}function c(l,u,f){let d=Math.abs(u-l)/f,h=Oc(([,,g])=>g).right(s,d);if(h===s.length)return e.every(Eh(l/31536e6,u/31536e6,f));if(h===0)return q0.every(Math.max(Eh(l,u,f),1));let[p,y]=s[d/s[h-1][2]<s[h][2]/d?h-1:h];return p.every(y)}return[a,c]}var[DO,W0]=wz(Ln,Zc,Wi,td,Xc,Wc),[BO,OO]=wz(Fn,Hc,Yi,So,Gc,Yc);function NO(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 FO(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 G0(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function LO(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,c=e.shortMonths,l=X0(i),u=H0(i),f=X0(o),d=H0(o),h=X0(s),p=H0(s),y=X0(a),g=H0(a),m=X0(c),b=H0(c),x={a:C,A:U,b:k,B:$,c:null,d:Mz,e:Mz,f:tst,g:ust,G:dst,H:Kot,I:Qot,j:Jot,L:Nz,m:est,M:rst,p:z,q:V,Q:Bz,s:Oz,S:nst,u:ist,U:ost,V:sst,w:ast,W:cst,x:null,X:null,y:lst,Y:fst,Z:hst,"%":Dz},_={a:Q,A:nt,b:st,B:ut,c:null,d:Ez,e:Ez,f:gst,g:Mst,G:Dst,H:pst,I:mst,j:yst,L:Lz,m:bst,M:xst,p:X,q:at,Q:Bz,s:Oz,S:_st,u:wst,U:vst,V:Sst,w:Ist,W:Tst,x:null,X:null,y:Ast,Y:Est,Z:Bst,"%":Dz},v={a:B,A:M,b:O,B:R,c:S,d:Tz,e:Tz,f:Got,g:Iz,G:Sz,H:Az,I:Az,j:jot,L:Wot,m:Vot,M:qot,p:A,q:zot,Q:Hot,s:Zot,S:Yot,u:kot,U:Cot,V:Uot,w:Rot,W:Pot,x:T,X:E,y:Iz,Y:Sz,Z:$ot,"%":Xot};x.x=w(r,x),x.X=w(n,x),x.c=w(t,x),_.x=w(r,_),_.X=w(n,_),_.c=w(t,_);function w(q,J){return function(ct){var j=[],Qt=-1,gt=0,he=q.length,pe,ot,Me;for(ct instanceof Date||(ct=new Date(+ct));++Qt<he;)q.charCodeAt(Qt)===37&&(j.push(q.slice(gt,Qt)),(ot=vz[pe=q.charAt(++Qt)])!=null?pe=q.charAt(++Qt):ot=pe==="e"?" ":"0",(Me=J[pe])&&(pe=Me(ct,ot)),j.push(pe),gt=Qt+1);return j.push(q.slice(gt,Qt)),j.join("")}}function I(q,J){return function(ct){var j=G0(1900,void 0,1),Qt=D(j,q,ct+="",0),gt,he;if(Qt!=ct.length)return null;if("Q"in j)return new Date(j.Q);if("s"in j)return new Date(j.s*1e3+("L"in j?j.L:0));if(J&&!("Z"in j)&&(j.Z=0),"p"in j&&(j.H=j.H%12+j.p*12),j.m===void 0&&(j.m="q"in j?j.q:0),"V"in j){if(j.V<1||j.V>53)return null;"w"in j||(j.w=1),"Z"in j?(gt=FO(G0(j.y,0,1)),he=gt.getUTCDay(),gt=he>4||he===0?du.ceil(gt):du(gt),gt=Jf.offset(gt,(j.V-1)*7),j.y=gt.getUTCFullYear(),j.m=gt.getUTCMonth(),j.d=gt.getUTCDate()+(j.w+6)%7):(gt=NO(G0(j.y,0,1)),he=gt.getDay(),gt=he>4||he===0?fu.ceil(gt):fu(gt),gt=So.offset(gt,(j.V-1)*7),j.y=gt.getFullYear(),j.m=gt.getMonth(),j.d=gt.getDate()+(j.w+6)%7)}else("W"in j||"U"in j)&&("w"in j||(j.w="u"in j?j.u%7:"W"in j?1:0),he="Z"in j?FO(G0(j.y,0,1)).getUTCDay():NO(G0(j.y,0,1)).getDay(),j.m=0,j.d="W"in j?(j.w+6)%7+j.W*7-(he+5)%7:j.w+j.U*7-(he+6)%7);return"Z"in j?(j.H+=j.Z/100|0,j.M+=j.Z%100,FO(j)):NO(j)}}function D(q,J,ct,j){for(var Qt=0,gt=J.length,he=ct.length,pe,ot;Qt<gt;){if(j>=he)return-1;if(pe=J.charCodeAt(Qt++),pe===37){if(pe=J.charAt(Qt++),ot=v[pe in vz?J.charAt(Qt++):pe],!ot||(j=ot(q,ct,j))<0)return-1}else if(pe!=ct.charCodeAt(j++))return-1}return j}function A(q,J,ct){var j=l.exec(J.slice(ct));return j?(q.p=u.get(j[0].toLowerCase()),ct+j[0].length):-1}function B(q,J,ct){var j=h.exec(J.slice(ct));return j?(q.w=p.get(j[0].toLowerCase()),ct+j[0].length):-1}function M(q,J,ct){var j=f.exec(J.slice(ct));return j?(q.w=d.get(j[0].toLowerCase()),ct+j[0].length):-1}function O(q,J,ct){var j=m.exec(J.slice(ct));return j?(q.m=b.get(j[0].toLowerCase()),ct+j[0].length):-1}function R(q,J,ct){var j=y.exec(J.slice(ct));return j?(q.m=g.get(j[0].toLowerCase()),ct+j[0].length):-1}function S(q,J,ct){return D(q,t,J,ct)}function T(q,J,ct){return D(q,r,J,ct)}function E(q,J,ct){return D(q,n,J,ct)}function C(q){return s[q.getDay()]}function U(q){return o[q.getDay()]}function k(q){return c[q.getMonth()]}function $(q){return a[q.getMonth()]}function z(q){return i[+(q.getHours()>=12)]}function V(q){return 1+~~(q.getMonth()/3)}function Q(q){return s[q.getUTCDay()]}function nt(q){return o[q.getUTCDay()]}function st(q){return c[q.getUTCMonth()]}function ut(q){return a[q.getUTCMonth()]}function X(q){return i[+(q.getUTCHours()>=12)]}function at(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var J=w(q+="",x);return J.toString=function(){return q},J},parse:function(q){var J=I(q+="",!1);return J.toString=function(){return q},J},utcFormat:function(q){var J=w(q+="",_);return J.toString=function(){return q},J},utcParse:function(q){var J=I(q+="",!0);return J.toString=function(){return q},J}}}var vz={"-":"",_:" ",0:"0"},Zr=/^\s*\d+/,Not=/^%/,Fot=/[\\^$*+?|[\]().{}]/g;function we(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o<r?new Array(r-o+1).join(t)+i:i)}function Lot(e){return e.replace(Fot,"\\$&")}function X0(e){return new RegExp("^(?:"+e.map(Lot).join("|")+")","i")}function H0(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function Rot(e,t,r){var n=Zr.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function kot(e,t,r){var n=Zr.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Cot(e,t,r){var n=Zr.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Uot(e,t,r){var n=Zr.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Pot(e,t,r){var n=Zr.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Sz(e,t,r){var n=Zr.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Iz(e,t,r){var n=Zr.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function $ot(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function zot(e,t,r){var n=Zr.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Vot(e,t,r){var n=Zr.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Tz(e,t,r){var n=Zr.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function jot(e,t,r){var n=Zr.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Az(e,t,r){var n=Zr.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function qot(e,t,r){var n=Zr.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Yot(e,t,r){var n=Zr.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Wot(e,t,r){var n=Zr.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Got(e,t,r){var n=Zr.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Xot(e,t,r){var n=Not.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Hot(e,t,r){var n=Zr.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Zot(e,t,r){var n=Zr.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function Mz(e,t){return we(e.getDate(),t,2)}function Kot(e,t){return we(e.getHours(),t,2)}function Qot(e,t){return we(e.getHours()%12||12,t,2)}function Jot(e,t){return we(1+So.count(Fn(e),e),t,3)}function Nz(e,t){return we(e.getMilliseconds(),t,3)}function tst(e,t){return Nz(e,t)+"000"}function est(e,t){return we(e.getMonth()+1,t,2)}function rst(e,t){return we(e.getMinutes(),t,2)}function nst(e,t){return we(e.getSeconds(),t,2)}function ist(e){var t=e.getDay();return t===0?7:t}function ost(e,t){return we(Yi.count(Fn(e)-1,e),t,2)}function Fz(e){var t=e.getDay();return t>=4||t===0?fa(e):fa.ceil(e)}function sst(e,t){return e=Fz(e),we(fa.count(Fn(e),e)+(Fn(e).getDay()===4),t,2)}function ast(e){return e.getDay()}function cst(e,t){return we(fu.count(Fn(e)-1,e),t,2)}function lst(e,t){return we(e.getFullYear()%100,t,2)}function ust(e,t){return e=Fz(e),we(e.getFullYear()%100,t,2)}function fst(e,t){return we(e.getFullYear()%1e4,t,4)}function dst(e,t){var r=e.getDay();return e=r>=4||r===0?fa(e):fa.ceil(e),we(e.getFullYear()%1e4,t,4)}function hst(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+we(t/60|0,"0",2)+we(t%60,"0",2)}function Ez(e,t){return we(e.getUTCDate(),t,2)}function pst(e,t){return we(e.getUTCHours(),t,2)}function mst(e,t){return we(e.getUTCHours()%12||12,t,2)}function yst(e,t){return we(1+Jf.count(Ln(e),e),t,3)}function Lz(e,t){return we(e.getUTCMilliseconds(),t,3)}function gst(e,t){return Lz(e,t)+"000"}function bst(e,t){return we(e.getUTCMonth()+1,t,2)}function xst(e,t){return we(e.getUTCMinutes(),t,2)}function _st(e,t){return we(e.getUTCSeconds(),t,2)}function wst(e){var t=e.getUTCDay();return t===0?7:t}function vst(e,t){return we(Wi.count(Ln(e)-1,e),t,2)}function Rz(e){var t=e.getUTCDay();return t>=4||t===0?da(e):da.ceil(e)}function Sst(e,t){return e=Rz(e),we(da.count(Ln(e),e)+(Ln(e).getUTCDay()===4),t,2)}function Ist(e){return e.getUTCDay()}function Tst(e,t){return we(du.count(Ln(e)-1,e),t,2)}function Ast(e,t){return we(e.getUTCFullYear()%100,t,2)}function Mst(e,t){return e=Rz(e),we(e.getUTCFullYear()%100,t,2)}function Est(e,t){return we(e.getUTCFullYear()%1e4,t,4)}function Dst(e,t){var r=e.getUTCDay();return e=r>=4||r===0?da(e):da.ceil(e),we(e.getUTCFullYear()%1e4,t,4)}function Bst(){return"+0000"}function Dz(){return"%"}function Bz(e){return+e}function Oz(e){return Math.floor(+e/1e3)}var sp,ap,kz,ha,Cz;RO({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 RO(e){return sp=LO(e),ap=sp.format,kz=sp.parse,ha=sp.utcFormat,Cz=sp.utcParse,sp}function Ost(e){return new Date(e)}function Nst(e){return e instanceof Date?+e:+new Date(+e)}function $S(e,t,r,n,i,o,s,a,c,l){var u=k0(),f=u.invert,d=u.domain,h=l(".%L"),p=l(":%S"),y=l("%I:%M"),g=l("%I %p"),m=l("%a %d"),b=l("%b %d"),x=l("%B"),_=l("%Y");function v(w){return(c(w)<w?h:a(w)<w?p:s(w)<w?y:o(w)<w?g:n(w)<w?i(w)<w?m:b:r(w)<w?x:_)(w)}return u.invert=function(w){return new Date(f(w))},u.domain=function(w){return arguments.length?d(Array.from(w,Nst)):d().map(Ost)},u.ticks=function(w){var I=d();return e(I[0],I[I.length-1],w??10)},u.tickFormat=function(w,I){return I==null?v:l(I)},u.nice=function(w){var I=d();return(!w||typeof w.range!="function")&&(w=t(I[0],I[I.length-1],w??10)),w?d(U0(I,w)):u},u.copy=function(){return la(u,$S(e,t,r,n,i,o,s,a,c,l))},u}function zS(){return Rr.apply($S(BO,OO,Fn,Hc,Yi,So,Gc,Yc,Hr,ap).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function VS(){return Rr.apply($S(DO,W0,Ln,Zc,Wi,Jf,Xc,Wc,Hr,ha).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Z0(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function jS(){var e=0,t=.5,r=1,n=1,i,o,s,a,c,l=Si,u,f=!1,d;function h(y){return isNaN(y=+y)?d:(y=.5+((y=+u(y))-o)*(n*y<n*o?a:c),l(f?Math.max(0,Math.min(1,y)):y))}h.domain=function(y){return arguments.length?([e,t,r]=y,i=u(e=+e),o=u(t=+t),s=u(r=+r),a=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),n=o<i?-1:1,h):[e,t,r]},h.clamp=function(y){return arguments.length?(f=!!y,h):f},h.interpolator=function(y){return arguments.length?(l=y,h):l};function p(y){return function(g){var m,b,x;return arguments.length?([m,b,x]=g,l=Js(y,[m,b,x]),h):[l(0),l(.5),l(1)]}}return h.range=p(ji),h.rangeRound=p(Uf),h.unknown=function(y){return arguments.length?(d=y,h):d},function(y){return u=y,i=y(e),o=y(t),s=y(r),a=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),n=o<i?-1:1,h}}function K0(){var e=jc(jS()(Si));return e.copy=function(){return Z0(e,K0())},L0.apply(e,arguments)}function qS(){var e=IO(jS()).domain([.1,1,10]);return e.copy=function(){return Z0(e,qS()).base(e.base())},L0.apply(e,arguments)}function YS(){var e=TO(jS());return e.copy=function(){return Z0(e,YS()).constant(e.constant())},L0.apply(e,arguments)}function WS(){var e=AO(jS());return e.copy=function(){return Z0(e,WS()).exponent(e.exponent())},L0.apply(e,arguments)}function Z(e){for(var t=e.length/6|0,r=new Array(t),n=0;n<t;)r[n]="#"+e.slice(n*6,++n*6);return r}var kO=Z("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var CO=Z("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");var UO=Z("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");var PO=Z("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");var $O=Z("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");var zO=Z("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");var VO=Z("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");var jO=Z("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");var qO=Z("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var YO=Z("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var bt=e=>zD(e[e.length-1]);var GS=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Z),XS=bt(GS);var HS=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Z),ZS=bt(HS);var KS=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Z),QS=bt(KS);var JS=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Z),t2=bt(JS);var Q0=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Z),cp=bt(Q0);var e2=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Z),r2=bt(e2);var J0=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Z),lp=bt(J0);var n2=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Z),i2=bt(n2);var o2=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Z),s2=bt(o2);var a2=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Z),c2=bt(a2);var l2=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Z),u2=bt(l2);var f2=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Z),d2=bt(f2);var h2=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Z),p2=bt(h2);var m2=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Z),y2=bt(m2);var g2=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Z),b2=bt(g2);var x2=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Z),_2=bt(x2);var w2=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Z),v2=bt(w2);var S2=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Z),I2=bt(S2);var T2=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Z),A2=bt(T2);var M2=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Z),E2=bt(M2);var D2=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Z),B2=bt(D2);var O2=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Z),N2=bt(O2);var F2=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Z),L2=bt(F2);var R2=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Z),k2=bt(R2);var C2=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Z),U2=bt(C2);var P2=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Z),$2=bt(P2);var z2=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Z),V2=bt(z2);function j2(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 q2=Ch(Zn(300,.5,0),Zn(-240,.5,1));var W2=Ch(Zn(-100,.75,.35),Zn(80,1.5,.8)),G2=Ch(Zn(260,.75,.35),Zn(80,1.5,.8)),Y2=Zn();function X2(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Y2.h=360*e-100,Y2.s=1.5-1.5*t,Y2.l=.8-.9*t,Y2+""}var H2=qr(),Fst=Math.PI/3,Lst=Math.PI*2/3;function Z2(e){var t;return e=(.5-e)*Math.PI,H2.r=255*(t=Math.sin(e))*t,H2.g=255*(t=Math.sin(e+Fst))*t,H2.b=255*(t=Math.sin(e+Lst))*t,H2+""}function K2(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 Q2(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}}var J2=Q2(Z("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),tI=Q2(Z("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),eI=Q2(Z("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),rI=Q2(Z("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function kr(e){return function(){return e}}var WO=Math.cos;var up=Math.min,tb=Math.sin,ve=Math.sqrt,GO=1e-12,nd=Math.PI,_Yt=nd/2,fp=2*nd;function nI(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{let n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new iu(t)}var IYt=Array.prototype.slice;function iI(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Uz(e){this._context=e}Uz.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 Kc(e){return new Uz(e)}function oI(e){return e[0]}function sI(e){return e[1]}function eb(e,t){var r=kr(!0),n=null,i=Kc,o=null,s=nI(a);e=typeof e=="function"?e:e===void 0?oI:kr(e),t=typeof t=="function"?t:t===void 0?sI:kr(t);function a(c){var l,u=(c=iI(c)).length,f,d=!1,h;for(n==null&&(o=i(h=s())),l=0;l<=u;++l)!(l<u&&r(f=c[l],l,c))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(f,l,c),+t(f,l,c));if(h)return o=null,h+""||null}return a.x=function(c){return arguments.length?(e=typeof c=="function"?c:kr(+c),a):e},a.y=function(c){return arguments.length?(t=typeof c=="function"?c:kr(+c),a):t},a.defined=function(c){return arguments.length?(r=typeof c=="function"?c:kr(!!c),a):r},a.curve=function(c){return arguments.length?(i=c,n!=null&&(o=i(n)),a):i},a.context=function(c){return arguments.length?(c==null?n=o=null:o=i(n=c),a):n},a}function dp(e,t,r){var n=null,i=kr(!0),o=null,s=Kc,a=null,c=nI(l);e=typeof e=="function"?e:e===void 0?oI:kr(+e),t=typeof t=="function"?t:t===void 0?kr(0):kr(+t),r=typeof r=="function"?r:r===void 0?sI:kr(+r);function l(f){var d,h,p,y=(f=iI(f)).length,g,m=!1,b,x=new Array(y),_=new Array(y);for(o==null&&(a=s(b=c())),d=0;d<=y;++d){if(!(d<y&&i(g=f[d],d,f))===m)if(m=!m)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=d-1;p>=h;--p)a.point(x[p],_[p]);a.lineEnd(),a.areaEnd()}m&&(x[d]=+e(g,d,f),_[d]=+t(g,d,f),a.point(n?+n(g,d,f):x[d],r?+r(g,d,f):_[d]))}if(b)return a=null,b+""||null}function u(){return eb().defined(i).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:kr(+f),n=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:kr(+f),l):e},l.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:kr(+f),l):n},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:kr(+f),r=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:kr(+f),l):t},l.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:kr(+f),l):r},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(r)},l.lineX1=function(){return u().x(n).y(t)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:kr(!!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 aI=class{constructor(t,r){this._context=t,this._x=r}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,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}};function XO(e){return new aI(e,!0)}function HO(e){return new aI(e,!1)}var Rst=ve(3),rb={draw(e,t){let r=ve(t+up(t/28,.75))*.59436,n=r/2,i=n*Rst;e.moveTo(0,r),e.lineTo(0,-r),e.moveTo(-i,-n),e.lineTo(i,n),e.moveTo(-i,n),e.lineTo(i,-n)}};var Qc={draw(e,t){let r=ve(t/nd);e.moveTo(r,0),e.arc(0,0,r,0,fp)}};var nb={draw(e,t){let r=ve(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}};var Pz=ve(1/3),kst=Pz*2,ib={draw(e,t){let r=ve(t/kst),n=r*Pz;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}};var ob={draw(e,t){let r=ve(t)*.62625;e.moveTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.lineTo(-r,0),e.closePath()}};var sb={draw(e,t){let r=ve(t-up(t/7,2))*.87559;e.moveTo(-r,0),e.lineTo(r,0),e.moveTo(0,r),e.lineTo(0,-r)}};var ab={draw(e,t){let r=ve(t),n=-r/2;e.rect(n,n,r,r)}};var cb={draw(e,t){let r=ve(t)*.4431;e.moveTo(r,r),e.lineTo(r,-r),e.lineTo(-r,-r),e.lineTo(-r,r),e.closePath()}};var Cst=.8908130915292852,$z=tb(nd/10)/tb(7*nd/10),Ust=tb(fp/10)*$z,Pst=-WO(fp/10)*$z,lb={draw(e,t){let r=ve(t*Cst),n=Ust*r,i=Pst*r;e.moveTo(0,-r),e.lineTo(n,i);for(let o=1;o<5;++o){let s=fp*o/5,a=WO(s),c=tb(s);e.lineTo(c*r,-a*r),e.lineTo(a*n-c*i,c*n+a*i)}e.closePath()}};var ZO=ve(3),ub={draw(e,t){let r=-ve(t/(ZO*3));e.moveTo(0,r*2),e.lineTo(-ZO*r,-r),e.lineTo(ZO*r,-r),e.closePath()}};var $st=ve(3),fb={draw(e,t){let r=ve(t)*.6824,n=r/2,i=r*$st/2;e.moveTo(0,-r),e.lineTo(i,n),e.lineTo(-i,n),e.closePath()}};var Io=-.5,To=ve(3)/2,KO=1/ve(12),zst=(KO/2+1)*3,db={draw(e,t){let r=ve(t/zst),n=r/2,i=r*KO,o=n,s=r*KO+r,a=-o,c=s;e.moveTo(n,i),e.lineTo(o,s),e.lineTo(a,c),e.lineTo(Io*n-To*i,To*n+Io*i),e.lineTo(Io*o-To*s,To*o+Io*s),e.lineTo(Io*a-To*c,To*a+Io*c),e.lineTo(Io*n+To*i,Io*i-To*n),e.lineTo(Io*o+To*s,Io*s-To*o),e.lineTo(Io*a+To*c,Io*c-To*a),e.closePath()}};var hp={draw(e,t){let r=ve(t-up(t/6,1.7))*.6189;e.moveTo(-r,-r),e.lineTo(r,r),e.moveTo(-r,r),e.lineTo(r,-r)}};var cI=[Qc,nb,ib,ab,lb,ub,db],QO=[Qc,sb,hp,fb,rb,cb,ob];function Ao(){}function pp(e,t,r){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+r)/6)}function hb(e){this._context=e}hb.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:pp(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:pp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function JO(e){return new hb(e)}function zz(e){this._context=e}zz.prototype={areaStart:Ao,areaEnd:Ao,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:pp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tN(e){return new zz(e)}function Vz(e){this._context=e}Vz.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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:pp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function eN(e){return new Vz(e)}function jz(e,t){this._basis=new hb(e),this._beta=t}jz.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],o=e[r]-n,s=t[r]-i,a=-1,c;++a<=r;)c=a/r,this._basis.point(this._beta*e[a]+(1-this._beta)*(n+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 rN=function e(t){function r(n){return t===1?new hb(n):new jz(n,t)}return r.beta=function(n){return e(+n)},r}(.85);function mp(e,t,r){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-r),e._x2,e._y2)}function lI(e,t){this._context=e,this._k=(1-t)/6}lI.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:mp(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:mp(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 nN=function e(t){function r(n){return new lI(n,t)}return r.tension=function(n){return e(+n)},r}(0);function uI(e,t){this._context=e,this._k=(1-t)/6}uI.prototype={areaStart:Ao,areaEnd:Ao,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:mp(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 iN=function e(t){function r(n){return new uI(n,t)}return r.tension=function(n){return e(+n)},r}(0);function fI(e,t){this._context=e,this._k=(1-t)/6}fI.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:mp(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 oN=function e(t){function r(n){return new fI(n,t)}return r.tension=function(n){return e(+n)},r}(0);function pb(e,t,r){var n=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>GO){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);n=(n*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>GO){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-r*e._l12_2a)/u}e._context.bezierCurveTo(n,i,o,s,e._x2,e._y2)}function qz(e,t){this._context=e,this._alpha=t}qz.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 r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:pb(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 sN=function e(t){function r(n){return t?new qz(n,t):new lI(n,0)}return r.alpha=function(n){return e(+n)},r}(.5);function Yz(e,t){this._context=e,this._alpha=t}Yz.prototype={areaStart:Ao,areaEnd:Ao,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 r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:pb(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 aN=function e(t){function r(n){return t?new Yz(n,t):new uI(n,0)}return r.alpha=function(n){return e(+n)},r}(.5);function Wz(e,t){this._context=e,this._alpha=t}Wz.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 r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:pb(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 cN=function e(t){function r(n){return t?new Wz(n,t):new fI(n,0)}return r.alpha=function(n){return e(+n)},r}(.5);function Gz(e){this._context=e}Gz.prototype={areaStart:Ao,areaEnd:Ao,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 lN(e){return new Gz(e)}function Xz(e){return e<0?-1:1}function Hz(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),s=(r-e._y1)/(i||n<0&&-0),a=(o*i+s*n)/(n+i);return(Xz(o)+Xz(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function Zz(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function uN(e,t,r){var n=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-n)/3;e._context.bezierCurveTo(n+a,i+a*t,o-a,s-a*r,o,s)}function dI(e){this._context=e}dI.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:uN(this,this._t0,Zz(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 r=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,uN(this,Zz(this,r=Hz(this,e,t)),r);break;default:uN(this,this._t0,r=Hz(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Kz(e){this._context=new Qz(e)}(Kz.prototype=Object.create(dI.prototype)).point=function(e,t){dI.prototype.point.call(this,t,e)};function Qz(e){this._context=e}Qz.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,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}};function fN(e){return new dI(e)}function dN(e){return new Kz(e)}function tV(e){this._context=e}tV.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Jz(e),i=Jz(t),o=0,s=1;s<r;++o,++s)this._context.bezierCurveTo(n[0][o],i[0][o],n[1][o],i[1][o],e[s],t[s]);(this._line||this._line!==0&&r===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 Jz(e){var t,r=e.length-1,n,i=new Array(r),o=new Array(r),s=new Array(r);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,s[t]-=n*s[t-1];for(i[r-1]=s[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function hN(e){return new tV(e)}function hI(e,t){this._context=e,this._t=t}hI.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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function pN(e){return new hI(e,.5)}function mN(e){return new hI(e,0)}function yN(e){return new hI(e,1)}var mb=e=>()=>e;function gN(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}function Gi(e,t,r){this.k=e,this.x=t,this.y=r}Gi.prototype={constructor:Gi,scale:function(e){return e===1?this:new Gi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Gi(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 yb=new Gi(1,0,0);bN.prototype=Gi.prototype;function bN(e){for(;!e.__zoom;)if(!(e=e.parentNode))return yb;return e.__zoom}function pI(e){e.stopImmediatePropagation()}function yp(e){e.preventDefault(),e.stopImmediatePropagation()}function Vst(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function jst(){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 eV(){return this.__zoom||yb}function qst(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Yst(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wst(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],o=e.invertY(t[0][1])-r[0][1],s=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function xN(){var e=Vst,t=jst,r=Wst,n=qst,i=Yst,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=GD,l=Nf("start","zoom","end"),u,f,d,h=500,p=150,y=0,g=10;function m(S){S.property("__zoom",eV).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",B).filter(i).on("touchstart.zoom",M).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(S,T,E,C){var U=S.selection?S.selection():S;U.property("__zoom",eV),S!==U?v(S,T,E,C):U.interrupt().each(function(){w(this,arguments).event(C).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},m.scaleBy=function(S,T,E,C){m.scaleTo(S,function(){var U=this.__zoom.k,k=typeof T=="function"?T.apply(this,arguments):T;return U*k},E,C)},m.scaleTo=function(S,T,E,C){m.transform(S,function(){var U=t.apply(this,arguments),k=this.__zoom,$=E==null?_(U):typeof E=="function"?E.apply(this,arguments):E,z=k.invert($),V=typeof T=="function"?T.apply(this,arguments):T;return r(x(b(k,V),$,z),U,s)},E,C)},m.translateBy=function(S,T,E,C){m.transform(S,function(){return r(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),s)},null,C)},m.translateTo=function(S,T,E,C,U){m.transform(S,function(){var k=t.apply(this,arguments),$=this.__zoom,z=C==null?_(k):typeof C=="function"?C.apply(this,arguments):C;return r(yb.translate(z[0],z[1]).scale($.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof E=="function"?-E.apply(this,arguments):-E),k,s)},C,U)};function b(S,T){return T=Math.max(o[0],Math.min(o[1],T)),T===S.k?S:new Gi(T,S.x,S.y)}function x(S,T,E){var C=T[0]-E[0]*S.k,U=T[1]-E[1]*S.k;return C===S.x&&U===S.y?S:new Gi(S.k,C,U)}function _(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function v(S,T,E,C){S.on("start.zoom",function(){w(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(C).end()}).tween("zoom",function(){var U=this,k=arguments,$=w(U,k).event(C),z=t.apply(U,k),V=E==null?_(z):typeof E=="function"?E.apply(U,k):E,Q=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),nt=U.__zoom,st=typeof T=="function"?T.apply(U,k):T,ut=c(nt.invert(V).concat(Q/nt.k),st.invert(V).concat(Q/st.k));return function(X){if(X===1)X=st;else{var at=ut(X),q=Q/at[2];X=new Gi(q,V[0]-at[0]*q,V[1]-at[1]*q)}$.zoom(null,X)}})}function w(S,T,E){return!E&&S.__zooming||new I(S,T)}function I(S,T){this.that=S,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,T),this.taps=0}I.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,T){return this.mouse&&S!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var T=ae(this.that).datum();l.call(S,this.that,new gN(S,{sourceEvent:this.sourceEvent,target:m,type:S,transform:this.that.__zoom,dispatch:l}),T)}};function D(S,...T){if(!e.apply(this,arguments))return;var E=w(this,T).event(S),C=this.__zoom,U=Math.max(o[0],Math.min(o[1],C.k*Math.pow(2,n.apply(this,arguments)))),k=Mn(S);if(E.wheel)(E.mouse[0][0]!==k[0]||E.mouse[0][1]!==k[1])&&(E.mouse[1]=C.invert(E.mouse[0]=k)),clearTimeout(E.wheel);else{if(C.k===U)return;E.mouse=[k,C.invert(k)],ta(this),E.start()}yp(S),E.wheel=setTimeout($,p),E.zoom("mouse",r(x(b(C,U),E.mouse[0],E.mouse[1]),E.extent,s));function $(){E.wheel=null,E.end()}}function A(S,...T){if(d||!e.apply(this,arguments))return;var E=S.currentTarget,C=w(this,T,!0).event(S),U=ae(S.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",Q,!0),k=Mn(S,E),$=S.clientX,z=S.clientY;Wg(S.view),pI(S),C.mouse=[k,this.__zoom.invert(k)],ta(this),C.start();function V(nt){if(yp(nt),!C.moved){var st=nt.clientX-$,ut=nt.clientY-z;C.moved=st*st+ut*ut>y}C.event(nt).zoom("mouse",r(x(C.that.__zoom,C.mouse[0]=Mn(nt,E),C.mouse[1]),C.extent,s))}function Q(nt){U.on("mousemove.zoom mouseup.zoom",null),Gg(nt.view,C.moved),yp(nt),C.event(nt).end()}}function B(S,...T){if(e.apply(this,arguments)){var E=this.__zoom,C=Mn(S.changedTouches?S.changedTouches[0]:S,this),U=E.invert(C),k=E.k*(S.shiftKey?.5:2),$=r(x(b(E,k),C,U),t.apply(this,T),s);yp(S),a>0?ae(this).transition().duration(a).call(v,$,C,S):ae(this).call(m.transform,$,C,S)}}function M(S,...T){if(e.apply(this,arguments)){var E=S.touches,C=E.length,U=w(this,T,S.changedTouches.length===C).event(S),k,$,z,V;for(pI(S),$=0;$<C;++$)z=E[$],V=Mn(z,this),V=[V,this.__zoom.invert(V),z.identifier],U.touch0?!U.touch1&&U.touch0[2]!==V[2]&&(U.touch1=V,U.taps=0):(U.touch0=V,k=!0,U.taps=1+!!u);u&&(u=clearTimeout(u)),k&&(U.taps<2&&(f=V[0],u=setTimeout(function(){u=null},h)),ta(this),U.start())}}function O(S,...T){if(this.__zooming){var E=w(this,T).event(S),C=S.changedTouches,U=C.length,k,$,z,V;for(yp(S),k=0;k<U;++k)$=C[k],z=Mn($,this),E.touch0&&E.touch0[2]===$.identifier?E.touch0[0]=z:E.touch1&&E.touch1[2]===$.identifier&&(E.touch1[0]=z);if($=E.that.__zoom,E.touch1){var Q=E.touch0[0],nt=E.touch0[1],st=E.touch1[0],ut=E.touch1[1],X=(X=st[0]-Q[0])*X+(X=st[1]-Q[1])*X,at=(at=ut[0]-nt[0])*at+(at=ut[1]-nt[1])*at;$=b($,Math.sqrt(X/at)),z=[(Q[0]+st[0])/2,(Q[1]+st[1])/2],V=[(nt[0]+ut[0])/2,(nt[1]+ut[1])/2]}else if(E.touch0)z=E.touch0[0],V=E.touch0[1];else return;E.zoom("touch",r(x($,z,V),E.extent,s))}}function R(S,...T){if(this.__zooming){var E=w(this,T).event(S),C=S.changedTouches,U=C.length,k,$;for(pI(S),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),k=0;k<U;++k)$=C[k],E.touch0&&E.touch0[2]===$.identifier?delete E.touch0:E.touch1&&E.touch1[2]===$.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&&($=Mn($,this),Math.hypot(f[0]-$[0],f[1]-$[1])<g)){var z=ae(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return m.wheelDelta=function(S){return arguments.length?(n=typeof S=="function"?S:mb(+S),m):n},m.filter=function(S){return arguments.length?(e=typeof S=="function"?S:mb(!!S),m):e},m.touchable=function(S){return arguments.length?(i=typeof S=="function"?S:mb(!!S),m):i},m.extent=function(S){return arguments.length?(t=typeof S=="function"?S:mb([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),m):t},m.scaleExtent=function(S){return arguments.length?(o[0]=+S[0],o[1]=+S[1],m):[o[0],o[1]]},m.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],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(S){return arguments.length?(r=S,m):r},m.duration=function(S){return arguments.length?(a=+S,m):a},m.interpolate=function(S){return arguments.length?(c=S,m):c},m.on=function(){var S=l.on.apply(l,arguments);return S===l?m:S},m.clickDistance=function(S){return arguments.length?(y=(S=+S)*S,m):Math.sqrt(y)},m.tapDistance=function(S){return arguments.length?(g=+S,m):g},m}function wr(e){return e!=null&&!Number.isNaN(e)}function Kr(e,t){return+wr(t)-+wr(e)||ie(e,t)}function id(e,t){return+wr(t)-+wr(e)||Wn(e,t)}function gb(e){return e!=null&&`${e}`!=""}function gp(e){return isFinite(e)?e:NaN}function ni(e){return e>0&&isFinite(e)?e:NaN}function hu(e){return e<0&&isFinite(e)?e:NaN}function bp(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return typeof t=="function"?t(e):t;let r=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${Gst(e.getUTCFullYear(),4)}-${Jc(e.getUTCMonth()+1,2)}-${Jc(e.getUTCDate(),2)}${r||n||i||o?`T${Jc(r,2)}:${Jc(n,2)}${i||o?`:${Jc(i,2)}${o?`.${Jc(o,3)}`:""}`:""}Z`:""}`}function Gst(e){return e<0?`-${Jc(-e,6)}`:e>9999?`+${Jc(e,6)}`:Jc(e,4)}function Jc(e,t){return`${e}`.padStart(t,"0")}var Xst=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function bb(e,t){return Xst.test(e+="")?new Date(e):typeof t=="function"?t(e):t}var _p=1e3,mu=_p*60,yu=mu*60,ma=yu*24,pa=ma*7,od=ma*30,pu=ma*365,_N=[["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",_p],["5 seconds",5*_p],["15 seconds",15*_p],["30 seconds",30*_p],["minute",mu],["5 minutes",5*mu],["15 minutes",15*mu],["30 minutes",30*mu],["hour",yu],["3 hours",3*yu],["6 hours",6*yu],["12 hours",12*yu],["day",ma],["2 days",2*ma],["week",pa],["2 weeks",2*pa],["month",od],["3 months",3*od],["6 months",6*od],["year",pu],["2 years",2*pu],["5 years",5*pu],["10 years",10*pu],["20 years",20*pu],["50 years",50*pu],["100 years",100*pu]],wN=new Map([["second",_p],["minute",mu],["hour",yu],["day",ma],["monday",pa],["tuesday",pa],["wednesday",pa],["thursday",pa],["friday",pa],["saturday",pa],["sunday",pa],["week",pa],["month",od],["year",pu]]),nV=new Map([["second",Hr],["minute",Yc],["hour",Gc],["day",So],["monday",fu],["tuesday",NS],["wednesday",FS],["thursday",fa],["friday",LS],["saturday",RS],["sunday",Yi],["week",Yi],["month",Hc],["year",Fn]]),vN=new Map([["second",Hr],["minute",Wc],["hour",Xc],["day",td],["monday",du],["tuesday",kS],["wednesday",CS],["thursday",da],["friday",US],["saturday",PS],["sunday",Wi],["week",Wi],["month",Zc],["year",Ln]]),wp=Symbol("intervalDuration"),yI=Symbol("intervalType");for(let[e,t]of nV)t[wp]=wN.get(e),t[yI]="time";for(let[e,t]of vN)t[wp]=wN.get(e),t[yI]="utc";var xb=[["year",Ln,"utc"],["month",Zc,"utc"],["day",td,"utc",6*od],["hour",Xc,"utc",3*ma],["minute",Wc,"utc",6*yu],["second",Hr,"utc",30*mu]],mI=[["year",Fn,"time"],["month",Hc,"time"],["day",So,"time",6*od],["hour",Gc,"time",3*ma],["minute",Yc,"time",6*yu],["second",Hr,"time",30*mu]],Hst=[xb[0],mI[0],xb[1],mI[1],xb[2],mI[2],...xb.slice(3)];function gI(e){let t=`${e}`.toLowerCase();t.endsWith("s")&&(t=t.slice(0,-1));let r=1,n=/^(?:(\d+)\s+)/.exec(t);switch(n&&(t=t.slice(n[0].length),r=+n[1]),t){case"quarter":t="month",r*=3;break;case"half":t="month",r*=6;break}let i=vN.get(t);if(!i)throw new Error(`unknown interval: ${e}`);if(r>1&&!i.every)throw new Error(`non-periodic interval: ${t}`);return[t,r]}function SN(e){return iV(gI(e),"time")}function _b(e){return iV(gI(e),"utc")}function iV([e,t],r){let n=(r==="time"?nV:vN).get(e);return t>1&&(n=n.every(t),n[wp]=wN.get(e)*t,n[yI]=r),n}function IN(e,t){if(!(t>1))return;let r=e[wp];if(!_N.some(([,i])=>i===r)||r%ma===0&&ma<r&&r<od)return;let[n]=_N[Oc(([,i])=>Math.log(i)).center(_N,Math.log(r*t))];return(e[yI]==="time"?SN:_b)(n)}function rV(e,t,r){let n=t==="time"?ap:ha;if(r==null)return n(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=Zst(r);switch(e){case"millisecond":return xp(n(".%L"),n(":%M:%S"),i);case"second":return xp(n(":%S"),n("%-I:%M"),i);case"minute":return xp(n("%-I:%M"),n("%p"),i);case"hour":return xp(n("%-I %p"),n("%b %-d"),i);case"day":return xp(n("%-d"),n("%b"),i);case"month":return xp(n("%b"),n("%Y"),i);case"year":return n("%Y")}throw new Error("unable to format time ticks")}function Zst(e){return e==="left"||e==="right"?(t,r)=>`
|
|
12
21
|
${t}
|
|
13
|
-
${
|
|
14
|
-
${t}`:(t,
|
|
15
|
-
${n}`}function ZH(e){return e==="time"?k1:e==="utc"?mm:XH}function kC(e,t,n){let r=Gt(N0(t,(i,o)=>Math.abs(o-i)));if(r<1e3)return RC("millisecond","utc",n);for(let[i,o,s,a]of ZH(e)){if(r>a||i==="hour"&&!r)break;if(t.every(c=>o.floor(c)>=c))return RC(i,s,n)}}function hf(e,t,n){return(r,i,o)=>{let s=e(r,i),a=t(r,i),c=i-js(o);return i!==c&&o[c]!==void 0&&a===t(o[c],c)?s:n(s,a)}}var wl=Object.getPrototypeOf(Uint8Array),QH=Object.prototype.toString,jT=Symbol("reindex");function mt(e,t,n){let r=typeof t;return r==="string"?FC(e,VT(t),n):r==="function"?FC(e,t,n):r==="number"||t instanceof Date||r==="boolean"?Yt(e,dn(t),n):typeof t?.transform=="function"?LC(t.transform(e),n):KH(LC(t,n),e?.[jT])}function KH(e,t){return t?bm(e,t):e}function FC(e,t,n){return Yt(e,n?.prototype instanceof wl?JH(t):t,n)}function LC(e,t){return t===void 0?qe(e):e instanceof t?e:t.prototype instanceof wl&&!(e instanceof wl)?t.from(e,YT):t.from(e)}function JH(e){return(t,n)=>YT(e(t,n))}var Xa=[null],VT=e=>t=>t[e],Ae={transform:ar},W={transform:e=>e};var gm=()=>1,CC=()=>!0,ze=e=>e==null?e:`${e}`,Nt=e=>e==null?e:+e;var Vs=e=>e?e[0]:void 0,Ha=e=>e?e[1]:void 0,BC=e=>e?e[2]:void 0,dn=e=>()=>e;function yf(e){let t=+`${e}`.slice(1)/100;return(n,r)=>Kn(n,t,r)}function Qe(e){return e instanceof wl?e:Yt(e,YT,Float64Array)}function YT(e){return e==null?NaN:Number(e)}function PC(e){return Yt(e,GT)}function GT(e){return e instanceof Date&&!isNaN(e)?e:typeof e=="string"?pm(e):e==null||isNaN(e=+e)?void 0:new Date(e)}function Re(e,t){return e===void 0&&(e=t),e===null?[void 0,"none"]:Ka(e)?[void 0,e]:[e,void 0]}function ie(e,t){return e===void 0&&(e=t),e===null||typeof e=="number"?[void 0,e]:[e,void 0]}function WT(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 qe(e){return e==null||e instanceof Array||e instanceof wl?e:Array.from(e)}function Yt(e,t,n=Array){return e==null?e:e instanceof n?e.map(t):n.from(e,t)}function Za(e,t=Array){return e instanceof t?e.slice():t.from(e)}function XT({x:e,x1:t,x2:n}){return e!==void 0||t!==void 0||n!==void 0}function HT({y:e,y1:t,y2:n}){return e!==void 0||t!==void 0||n!==void 0}function gf(e){return XT(e)||HT(e)||e.interval!==void 0}function hn(e){return e?.toString===QH}function Oo(e){return hn(e)&&(e.type!==void 0||e.domain!==void 0)}function zr(e){return hn(e)&&typeof e.transform!="function"}function Do(e){return zr(e)&&e.value===void 0&&e.channel===void 0}function ZT(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 Be(e,t){return e===void 0&&t===void 0?[Vs,Ha]:[e,t]}function qn({z:e,fill:t,stroke:n}={}){return e===void 0&&([e]=Re(t)),e===void 0&&([e]=Re(n)),e}function ar(e){let t=e.length,n=new Uint32Array(t);for(let r=0;r<t;++r)n[r]=r;return n}function bm(e,t){return Yt(t,n=>e[n],e.constructor)}function bf(e){return e.length===1?(t,n)=>e(bm(n,t)):e}function Ys(e,t,n){return e.subarray?e.subarray(t,n):e.slice(t,n)}function Gs(e){return e!==null&&typeof e=="object"?e.valueOf():e}function C1(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 pn(e){let t;return[{transform:()=>t,label:On(e)},n=>t=n]}function Rn(e){return e==null?[e]:pn(e)}function On(e,t){return typeof e=="string"?e:e&&e.label!==void 0?e.label:t}function xf(e,t){return{transform(n){let r=e.transform(n),i=t.transform(n);return Oe(r)||Oe(i)?Yt(r,(o,s)=>new Date((+r[s]+ +i[s])/2)):Yt(r,(o,s)=>(+r[s]+ +i[s])/2,Float64Array)},label:e.label}}function vl(e,t){let n=QT(t?.interval,t?.type);return n?Yt(e,n):e}function QT(e,t){let n=_f(e,t);return n&&(r=>Ue(r)?n.floor(r):r)}function _f(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)=>$e(Math.ceil(r*n),i*n).map(o=>o/n)}:{floor:r=>Math.floor(r/n)*n,offset:r=>r+n,range:(r,i)=>$e(Math.ceil(r/n),i/n).map(o=>o*n)}}if(typeof e=="string")return(t==="time"?zT:ym)(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 ko(e,t){if(e=_f(e,t),e&&typeof e.range!="function")throw new Error("invalid interval: missing range method");return e}function $C(e,t){if(e=ko(e,t),e&&typeof e.ceil!="function")throw new Error("invalid interval: missing ceil method");return e}function UC(e){return Qa(e)&&typeof e?.floor=="function"&&e.floor()instanceof Date}function Qa(e){return typeof e?.range=="function"}function pi(e){return e===void 0||zr(e)?e:{value:e}}function zC(e){return e==null?null:{transform:t=>mt(t,e,Float64Array),label:On(e)}}function qC(e){if(!cr(e))return!1;for(let t of e)if(t!=null)return typeof t=="object"&&"0"in t&&"1"in t}function cr(e){return e&&typeof e[Symbol.iterator]=="function"}function B1(e){for(let t of e)if(t!=null)return typeof t!="object"||t instanceof Date}function Me(e){for(let t of e){if(t==null)continue;let n=typeof t;return n==="string"||n==="boolean"}}function Oe(e){for(let t of e)if(t!=null)return t instanceof Date}function jC(e){for(let t of e)if(t!=null)return typeof t=="string"&&isNaN(t)&&pm(t)}function VC(e){for(let t of e)if(t!=null){if(typeof t!="string")return!1;if(t.trim())return!isNaN(t)}}function Ws(e){for(let t of e)if(t!=null)return typeof t=="number"}function P1(e,t){let n;for(let r of e)if(r!=null){if(!t(r))return!1;n=!0}return n}var tZ=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 Ka(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)||tZ.has(e))}function YC(e){return typeof e=="number"&&(0<=e&&e<=1||isNaN(e))}function ne(e){return e==null||Xs(e)}function Xs(e){return/^\s*none\s*$/i.test(e)}function GC(e){return/^\s*round\s*$/i.test(e)}function $1(e,t){return WT(e,t,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function Fo(e="middle"){return $1(e,"frameAnchor")}function js(e){if(e==null)return;let t=e[0],n=e[e.length-1];return Hn(t,n)}function WC(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 eZ(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 xm(e){return cr(e)?eZ(e):e}var mi=Symbol("position"),qr=Symbol("color"),Sl=Symbol("radius"),Il=Symbol("length"),Tl=Symbol("opacity"),wf=Symbol("symbol"),XC=Symbol("projection"),fe=new Map([["x",mi],["y",mi],["fx",mi],["fy",mi],["r",Sl],["color",qr],["opacity",Tl],["symbol",wf],["length",Il],["projection",XC]]);function HC(e){return e===mi||e===XC}function ZC(e){return e===mi||e===Sl||e===Il||e===Tl}var KT=Math.sqrt(3),JT=2/KT,nZ={draw(e,t){let n=Math.sqrt(t/Math.PI),r=n*JT,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()}},tE=new Map([["asterisk",Kp],["circle",zs],["cross",Jp],["diamond",tm],["diamond2",em],["hexagon",nZ],["plus",nm],["square",rm],["square2",im],["star",om],["times",af],["triangle",sm],["triangle2",am],["wye",cm]]);function eE(e){return e&&typeof e.draw=="function"}function QC(e){return eE(e)?!0:typeof e!="string"?!1:tE.has(e.toLowerCase())}function vf(e){if(e==null||eE(e))return e;let t=tE.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid symbol: ${e}`)}function KC(e){if(e==null||eE(e))return[void 0,e];if(typeof e=="string"){let t=tE.get(`${e}`.toLowerCase());if(t)return[void 0,t]}return[e,void 0]}function mn({filter:e,sort:t,reverse:n,transform:r,initializer:i,...o}={},s){if(r===void 0&&(e!=null&&(r=iE(e)),t!=null&&!Do(t)&&(r=nE(r,sE(t))),n&&(r=nE(r,oE))),s!=null&&i!=null)throw new Error("transforms cannot be applied after initializers");return{...o,...(t===null||Do(t))&&{sort:t},transform:nE(r,s)}}function Se({filter:e,sort:t,reverse:n,initializer:r,...i}={},o){return r===void 0&&(e!=null&&(r=iE(e)),t!=null&&!Do(t)&&(r=rE(r,sE(t))),n&&(r=rE(r,oE))),{...i,...(t===null||Do(t))&&{sort:t},initializer:rE(r,o)}}function nE(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,qe(n),r,i)}}function rE(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 U1(e,t){return(e.initializer!=null?Se:mn)(e,t)}function JC(e,t){return U1(t,iE(e))}function iE(e){return(t,n)=>{let r=mt(t,e);return{data:t,facets:n.map(i=>i.filter(o=>r[o]))}}}function t5({sort:e,...t}={}){return{...U1(t,oE),sort:Do(e)?e:null}}function oE(e,t){return{data:e,facets:t.map(n=>n.slice().reverse())}}function e5({seed:e,sort:t,...n}={}){return{...U1(n,n5(e==null?Math.random:ll(e))),sort:Do(t)?t:null}}function z1(e,{sort:t,...n}={}){return{...(zr(e)&&e.channel!==void 0?Se:U1)(n,sE(e)),sort:Do(t)?t:null}}function sE(e){return(typeof e=="function"&&e.length!==1?rZ:n5)(e)}function rZ(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 n5(e){let t,n;({channel:t,value:e,order:n}={...pi(e)});let r=t?.startsWith("-");if(r&&(t=t.slice(1)),n===void 0&&(n=r?xl:fn),typeof n!="function")switch(`${n}`.toLowerCase()){case"ascending":n=fn;break;case"descending":n=xl;break;default:throw new Error(`invalid order: ${n}`)}return(i,o,s)=>{let a;if(t===void 0)a=mt(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 wm(e,t){return q1(null,null,e,t)}function tc(e={y:"count"},t={}){let{x:n=W}=t;if(n==null)throw new Error("missing channel: x");return q1(n,null,e,t)}function ec(e={x:"count"},t={}){let{y:n=W}=t;if(n==null)throw new Error("missing channel: y");return q1(null,n,e,t)}function vm(e={fill:"count"},t={}){let{x:n,y:r}=t;if([n,r]=Be(n,r),n==null)throw new Error("missing channel: x");if(r==null)throw new Error("missing channel: y");return q1(n,r,e,t)}function q1(e,t,{data:n=Y1,filter:r,sort:i,reverse:o,...s}={},a={}){s=cE(s,a),n=a5(n,W),i=i==null?void 0:o5("sort",i,a),r=r==null?void 0:s5("filter",r,a);let[c,l]=Rn(e),[u,f]=Rn(t),{z:d,fill:h,stroke:p,x1:m,x2:g,y1:y,y2:b,...x}=a,[_,v]=Rn(d),[w]=Re(h),[T]=Re(p),[M,R]=Rn(w),[I,A]=Rn(T);return{..."z"in a&&{z:_||d},..."fill"in a&&{fill:M||h},..."stroke"in a&&{stroke:I||p},...mn(x,(O,F,S)=>{let E=vl(mt(O,e),S?.x),N=vl(mt(O,t),S?.y),L=mt(O,d),B=mt(O,w),C=mt(O,T),P=Sm(s,{z:L,fill:B,stroke:C}),$=[],U=[],X=E&&l([]),tt=N&&f([]),nt=L&&v([]),st=B&&R([]),Y=C&&A([]),rt=0;for(let q of s)q.initialize(O);i&&i.initialize(O),r&&r.initialize(O);for(let q of F){let H=[];for(let ot of s)ot.scope("facet",q);i&&i.scope("facet",q),r&&r.scope("facet",q);for(let[ot,z]of Ja(q,P))for(let[Lt,dt]of Ja(z,N))for(let[Wt,Xt]of Ja(dt,E)){let et={data:O};if(E&&(et.x=Wt),N&&(et.y=Lt),!(r&&!r.reduce(Xt,et))){H.push(rt++),U.push(n.reduceIndex(Xt,O,et)),E&&X.push(Wt),N&&tt.push(Lt),L&&nt.push(P===L?ot:L[Xt[0]]),B&&st.push(P===B?ot:B[Xt[0]]),C&&Y.push(P===C?ot:C[Xt[0]]);for(let oe of s)oe.reduce(Xt,et);i&&i.reduce(Xt,et)}}$.push(H)}return lE($,i,o),{data:U,facets:$}}),...!Lo(s,"x")&&(c?{x:c}:{x1:m,x2:g}),...!Lo(s,"y")&&(u?{y:u}:{y1:y,y2:b}),...Object.fromEntries(s.map(({name:O,output:F})=>[O,F]))}}function Lo(e,...t){for(let{name:n}of e)if(t.includes(n))return!0;return!1}function aE(e,t,n=j1){let r=Object.entries(e);return t.title!=null&&e.title===void 0&&r.push(["title",lZ]),t.href!=null&&e.href===void 0&&r.push(["href",G1]),r.filter(([,i])=>i!==void 0).map(([i,o])=>o===null?iZ(i):n(i,o,t))}function j1(e,t,n,r=V1){let i;hn(t)&&"reduce"in t&&(i=t.scale,t=t.reduce);let o=r(e,t,n),[s,a]=pn(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 iZ(e){return{name:e,initialize(){},scope(){},reduce(){}}}function V1(e,t,n,r=Sf){let i=C1(e,n),o=r(t,i),s,a;return{label:On(o===_m?null:i,o.label),initialize(c){s=i===void 0?c:mt(c,i),o.scope==="data"&&(a=o.reduceIndex(ar(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 Ja(e,t){return t?uo(an(e,n=>t[n]),Vs):[[,e]]}function Sf(e,t,n=oZ){if(e==null)return n(e);if(typeof e.reduceIndex=="function")return e;if(typeof e.reduce=="function"&&hn(e))return aZ(e);if(typeof e=="function")return cZ(e);if(/^p\d{2}$/i.test(e))return Hs(yf(e));switch(`${e}`.toLowerCase()){case"first":return G1;case"last":return uZ;case"identity":return Y1;case"count":return _m;case"distinct":return fZ;case"sum":return t==null?_m:dZ;case"proportion":return i5(t,"data");case"proportion-facet":return i5(t,"facet");case"deviation":return Hs(ri);case"min":return Hs(ce);case"min-index":return Hs(E0);case"max":return Hs(Gt);case"max-index":return Hs(T0);case"mean":return r5(Ss);case"median":return r5(Bi);case"variance":return Hs(Ma);case"mode":return Hs(Iu)}return n(e)}function oZ(e){throw new Error(`invalid reduce: ${e}`)}function cE(e,t){return aE(e,t,o5)}function o5(e,t,n){return j1(e,t,n,s5)}function s5(e,t,n){return V1(e,t,n,a5)}function a5(e,t){return Sf(e,t,sZ)}function sZ(e){switch(`${e}`.toLowerCase()){case"x":return hZ;case"y":return pZ}throw new Error(`invalid group reduce: ${e}`)}function Sm(e,t){for(let n in t){let r=t[n];if(r!==void 0&&!e.some(i=>i.name===n))return r}}function lE(e,t,n){if(t){let r=t.output.transform(),i=(o,s)=>fn(r[o],r[s]);e.forEach(o=>o.sort(i))}n&&e.forEach(r=>r.reverse())}function aZ(e){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...e,reduceIndex:e.reduce.bind(e)}}function cZ(e){return{reduceIndex(t,n,r){return e(bm(n,t),r)}}}function Hs(e){return{reduceIndex(t,n){return e(t,r=>n[r])}}}function r5(e){return{reduceIndex(t,n){let r=e(t,i=>n[i]);return Oe(n)?new Date(r):r}}}var Y1={reduceIndex(e,t){return bm(t,e)}},G1={reduceIndex(e,t){return t[e[0]]}},lZ={reduceIndex(e,t){let r=uo(Ci(e,o=>o.length,o=>t[o]),Ha),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`,En(o,Ha)]}return i.map(([o,s])=>`${o} (${s.toLocaleString("en-US")})`).join(`
|
|
16
|
-
`)}},uZ={reduceIndex(e,t){return t[e[e.length-1]]}},_m={label:"Frequency",reduceIndex(e){return e.length}},fZ={label:"Distinct",reduceIndex(e,t){let n=new Qn;for(let r of e)n.add(t[r]);return n.size}},dZ=Hs(En);function i5(e,t){return e==null?{scope:t,label:"Frequency",reduceIndex:(n,r,i=1)=>n.length/i}:{scope:t,reduceIndex:(n,r,i=1)=>En(n,o=>r[o])/i}}var hZ={reduceIndex(e,t,{x:n}){return n}},pZ={reduceIndex(e,t,{y:n}){return n}};function c5(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 If(e,{scale:t,type:n,value:r,filter:i,hint:o,label:s=On(r)},a){return o===void 0&&typeof r?.transform=="function"&&(o=r.hint),fE(a,{scale:t,type:n,value:mt(e,r),label:s,filter:i,hint:o})}function W1(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,If(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:Yt(o,s)]}));return n.channels=e,n}function fE(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&&P1(r,Ka)?null:"color";break;case"fillOpacity":case"strokeOpacity":case"opacity":t.scale=n!==!0&&P1(r,YC)?null:"opacity";break;case"symbol":n!==!0&&P1(r,QC)?(t.scale=null,t.value=Yt(r,vf)):t.scale="symbol";break;default:t.scale=fe.has(e)?e:null;break}else if(n===!1)t.scale=null;else if(n!=null&&!fe.has(n))throw new Error(`unknown scale: ${n}`);return t}function u5(e,t,n,r,i){let{order:o,reverse:s,reduce:a=!0,limit:c}=i;for(let l in i){if(!fe.has(l))continue;let{value:u,order:f=o,reverse:d=s,reduce:h=a,limit:p=c}=pi(i[l]),m=u?.startsWith("-");if(m&&(u=u.slice(1)),f=f===void 0?m!==(u==="width"||u==="height")?d5:f5:gZ(f),h==null||h===!1)continue;let g=l==="fx"||l==="fy"?yZ(t,r[l]):mZ(n,l);if(!g)throw new Error(`missing channel for scale: ${l}`);let y=g.value,[b=0,x=1/0]=cr(p)?p:p<0?[p]:[0,p];if(u==null)g.domain=()=>{let _=Array.from(new Qn(y));return d&&(_=_.reverse()),(b!==0||x!==1/0)&&(_=_.slice(b,x)),_};else{let _=u==="data"?e:u==="height"?l5(n,"y1","y2"):u==="width"?l5(n,"x1","x2"):uE(n,u,u==="y"?"y2":u==="x"?"x2":void 0),v=Sf(h===!0?"max":h,_);g.domain=()=>{let w=U2(ar(y),T=>v.reduceIndex(T,_),T=>y[T]);return f&&w.sort(f),d&&w.reverse(),(b!==0||x!==1/0)&&(w=w.slice(b,x)),w.map(Vs)}}}}function mZ(e,t){for(let n in e){let r=e[n];if(r.scale===t)return r}}function yZ(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 l5(e,t,n){let r=uE(e,t),i=uE(e,n);return Yt(i,(o,s)=>Math.abs(o-r[s]),Float64Array)}function uE(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 gZ(e){if(e==null||typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"ascending":return f5;case"descending":return d5}throw new Error(`invalid order: ${e}`)}function f5([e,t],[n,r]){return fn(t,r)||fn(e,n)}function d5([e,t],[n,r]){return xl(t,r)||fn(e,n)}function Im(e,t){let n=e[t];if(n){for(;n.source;)n=n.source;return n.source===null?null:n}}function X1(e){let t,n;return(...r)=>((n?.length!==r.length||n.some((i,o)=>i!==r[o]))&&(n=r,t=e(...r)),t)}var bZ=X1(e=>new Intl.NumberFormat(e)),xZ=X1((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{month:t}})),_Z=X1((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{weekday:t}}));function wZ(e="en-US"){let t=bZ(e);return n=>n!=null&&!isNaN(n)?t.format(n):void 0}function h5(e="en-US",t="short"){let n=xZ(e,t);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2e3,+r)))?n.format(r):void 0}function p5(e="en-US",t="short"){let n=_Z(e,t);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2001,0,+r)))?n.format(r):void 0}function dE(e){return df(e,"Invalid Date")}function vZ(e="en-US"){let t=wZ(e);return n=>(n instanceof Date?dE:typeof n=="number"?t:ze)(n)}var zi=vZ();var hE=0,pE;function m5(){let e=hE;return hE=0,pE=void 0,e}function jn(e){e!==pE&&(pE=e,console.warn(e),++hE)}var De=(typeof window<"u"?window.devicePixelRatio>1:typeof it>"u")?0:.5,SZ=0;function H1(){return`plot-clip-${++SZ}`}function Z1(e,{title:t,href:n,ariaLabel:r,ariaDescription:i,ariaHidden:o,target:s,fill:a,fillOpacity:c,stroke:l,strokeWidth:u,strokeOpacity:f,strokeLinejoin:d,strokeLinecap:h,strokeMiterlimit:p,strokeDasharray:m,strokeDashoffset:g,opacity:y,mixBlendMode:b,imageFilter:x,paintOrder:_,pointerEvents:v,shapeRendering:w,channels:T},{ariaLabel:M,fill:R="currentColor",fillOpacity:I,stroke:A="none",strokeOpacity:O,strokeWidth:F,strokeLinecap:S,strokeLinejoin:E,strokeMiterlimit:N,paintOrder:L}){R===null&&(a=null,c=null),A===null&&(l=null,f=null),ne(R)?!ne(A)&&(!ne(a)||T?.fill)&&(A="none"):ne(A)&&(!ne(l)||T?.stroke)&&(R="none");let[B,C]=Re(a,R),[P,$]=ie(c,I),[U,X]=Re(l,A),[tt,nt]=ie(f,O),[st,Y]=ie(y);Xs(X)||(u===void 0&&(u=F),h===void 0&&(h=S),d===void 0&&(d=E),p===void 0&&!GC(d)&&(p=N),!Xs(C)&&_===void 0&&(_=L));let[rt,q]=ie(u);return R!==null&&(e.fill=le(C,"currentColor"),e.fillOpacity=Tm($,1)),A!==null&&(e.stroke=le(X,"none"),e.strokeWidth=Tm(q,1),e.strokeOpacity=Tm(nt,1),e.strokeLinejoin=le(d,"miter"),e.strokeLinecap=le(h,"butt"),e.strokeMiterlimit=Tm(p,4),e.strokeDasharray=le(m,"none"),e.strokeDashoffset=le(g,"0")),e.target=ze(s),e.ariaLabel=ze(M),e.ariaDescription=ze(i),e.ariaHidden=ze(o),e.opacity=Tm(Y,1),e.mixBlendMode=le(b,"normal"),e.imageFilter=le(x,"none"),e.paintOrder=le(_,"normal"),e.pointerEvents=le(v,"auto"),e.shapeRendering=le(w,"auto"),{title:{value:t,optional:!0,filter:null},href:{value:n,optional:!0,filter:null},ariaLabel:{value:r,optional:!0,filter:null},fill:{value:B,scale:"auto",optional:!0},fillOpacity:{value:P,scale:"auto",optional:!0},stroke:{value:U,scale:"auto",optional:!0},strokeOpacity:{value:tt,scale:"auto",optional:!0},strokeWidth:{value:rt,optional:!0},opacity:{value:st,scale:"auto",optional:!0}}}function IZ(e,t){t&&e.filter(n=>hm(t[n])).append("title").call(EZ,t)}function TZ(e,t){t&&e.filter(([n])=>hm(t[n])).append("title").call(AZ,t)}function EZ(e,t){t&&e.text(n=>zi(t[n]))}function AZ(e,t){t&&e.text(([n])=>zi(t[n]))}function Zt(e,{target:t,tip:n},{ariaLabel:r,title:i,fill:o,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:l,opacity:u,href:f}){r&&ft(e,"aria-label",d=>r[d]),o&&ft(e,"fill",d=>o[d]),s&&ft(e,"fill-opacity",d=>s[d]),a&&ft(e,"stroke",d=>a[d]),c&&ft(e,"stroke-opacity",d=>c[d]),l&&ft(e,"stroke-width",d=>l[d]),u&&ft(e,"opacity",d=>u[d]),f&&y5(e,d=>f[d],t),n||IZ(e,i)}function El(e,{target:t,tip:n},{ariaLabel:r,title:i,fill:o,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:l,opacity:u,href:f}){r&&ft(e,"aria-label",([d])=>r[d]),o&&ft(e,"fill",([d])=>o[d]),s&&ft(e,"fill-opacity",([d])=>s[d]),a&&ft(e,"stroke",([d])=>a[d]),c&&ft(e,"stroke-opacity",([d])=>c[d]),l&&ft(e,"stroke-width",([d])=>l[d]),u&&ft(e,"opacity",([d])=>u[d]),f&&y5(e,([d])=>f[d],t),n||TZ(e,i)}function MZ({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 Em(e,t,n){let r=an(e,i=>t[i]);return n===void 0&&r.size>1+e.length>>1&&jn("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*Q1(e,t,n,r){let{z:i}=n,{z:o}=r,s=MZ(r,n),a=[...t,...s];for(let c of o?Em(e,o,i):[e]){let l,u;t:for(let f of c){for(let d of a)if(!Ue(d[f])){u&&u.push(-1);continue t}if(l===void 0){u&&(yield u),l=s.map(d=>Gs(d[f])),u=[f];continue}u.push(f);for(let d=0;d<s.length;++d)if(Gs(s[d][f])!==l[d]){yield u,l=s.map(p=>Gs(p[f])),u=[f];continue t}}u&&(yield u)}}function K1(e){return e===!0?e="frame":e===!1?e=null:e!=null&&(e=Ke(e,"clip",["frame","sphere"])),e}function NZ(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,d=H1();i=`url(#${d})`,e=ct("svg:g",r).call(h=>h.append("svg:clipPath").attr("id",d).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=H1();i=`url(#${a})`,e.append("clipPath").attr("id",a).append("path").attr("d",Mn(s)({type:"Sphere"}));break}}ft(e,"aria-label",t.ariaLabel),ft(e,"aria-description",t.ariaDescription),ft(e,"aria-hidden",t.ariaHidden),ft(e,"clip-path",i)}function Ft(e,t,n,r){NZ(e,t,n,r),ft(e,"fill",t.fill),ft(e,"fill-opacity",t.fillOpacity),ft(e,"stroke",t.stroke),ft(e,"stroke-width",t.strokeWidth),ft(e,"stroke-opacity",t.strokeOpacity),ft(e,"stroke-linejoin",t.strokeLinejoin),ft(e,"stroke-linecap",t.strokeLinecap),ft(e,"stroke-miterlimit",t.strokeMiterlimit),ft(e,"stroke-dasharray",t.strokeDasharray),ft(e,"stroke-dashoffset",t.strokeDashoffset),ft(e,"shape-rendering",t.shapeRendering),ft(e,"filter",t.imageFilter),ft(e,"paint-order",t.paintOrder);let{pointerEvents:i=r.pointerSticky===!1?"none":void 0}=t;ft(e,"pointer-events",i)}function Rt(e,t){RZ(e,"mix-blend-mode",t.mixBlendMode),ft(e,"opacity",t.opacity)}function y5(e,t,n){e.each(function(r){let i=t(r);if(i!=null){let o=this.ownerDocument.createElementNS(ii.svg,"a");o.setAttribute("fill","inherit"),o.setAttributeNS(ii.xlink,"href",i),n!=null&&o.setAttribute("target",n),this.parentNode.insertBefore(o,this).appendChild(this)}})}function ft(e,t,n){n!=null&&e.attr(t,n)}function RZ(e,t,n){n!=null&&e.style(t,n)}function It(e,t,{x:n,y:r},i=De,o=De){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 le(e,t){if((e=ze(e))!==t)return e}function Tm(e,t){if((e=Nt(e))!==t)return e}var OZ=/^-?([_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}`,!OZ.test(e))throw new Error(`invalid class name: ${e}`);return e}function Af(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 yn({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 nc(e={}){let{document:t=typeof window<"u"?window.document:void 0,clip:n}=e;return{document:t,clip:K1(n)}}function ct(e,{document:t}){return qt(Ts(e).call(t.documentElement))}var b5=Math.PI,Zs=2*b5,g5=.618;function x5({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(hn(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}=_5(e));let{width:u,height:f,marginLeft:d,marginRight:h,marginTop:p,marginBottom:m}=s,g=u-d-h-o-r,y=f-p-m-n-i;if(e=e?.({width:g,height:y,clip:l,...a}),e==null)return;l=DZ(l,d,p,u-h,f-m);let b=d+o,x=p+n,_;if(c!=null){let[[v,w],[T,M]]=Mn(e).bounds(c),R=Math.min(g/(T-v),y/(M-w));R>0?(b-=(R*(v+T)-g)/2,x-=(R*(w+M)-y)/2,_=Object.assign(al({point(I,A){this.stream.point(I*R+b,A*R+x)}}),{invert:([I,A])=>[(I-b)/R,(A-x)/R]})):jn("Warning: the projection could not be fit to the specified domain; using the default scale.")}return _??=b===0&&x===0?w5():Object.assign(al({point(v,w){this.stream.point(v+b,w+x)}}),{invert:([v,w])=>[v-b,w-x]}),{stream:v=>e.stream(_.stream(l(v))),invert:v=>e.invert(_.invert(v))}}function _5(e){switch(`${e}`.toLowerCase()){case"albers-usa":return qi(dI,.7463,.4673);case"albers":return J1(Tp,.7463,.4673);case"azimuthal-equal-area":return qi(pI,4,4);case"azimuthal-equidistant":return qi(yI,Zs,Zs);case"conic-conformal":return J1(xI,Zs,Zs);case"conic-equal-area":return J1($a,6.1702,2.9781);case"conic-equidistant":return J1(wI,7.312,3.6282);case"equal-earth":return qi(SI,5.4133,2.6347);case"equirectangular":return qi(_I,Zs,b5);case"gnomonic":return qi(TI,3.4641,3.4641);case"identity":return{type:w5};case"reflect-y":return{type:kZ};case"mercator":return qi(gI,Zs,Zs);case"orthographic":return qi(AI,2,2);case"stereographic":return qi(NI,2,2);case"transverse-mercator":return qi(OI,Zs,Zs);default:throw new Error(`unknown projection type: ${e}`)}}function DZ(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 ju(t,n,r,i);default:throw new Error(`unknown projection clip type: ${e}`)}}function qi(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 J1(e,t,n){let{type:r,aspectRatio:i}=qi(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 w5=dn({stream:e=>e,invert:e=>e}),kZ=dn(Object.assign(al({point(e,t){this.stream.point(e,-t)}}),{invert:([e,t])=>[e,-t]}));function mE(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,d){a[l]=f,c[l]=d}});for(l=0;l<s;++l)u.point(i[l],o[l])}function v5({projection:e}={}){return e==null?!1:typeof e.stream=="function"?!0:(hn(e)&&(e=e.type),e!=null)}function S5(e){if(typeof e?.stream=="function")return g5;if(hn(e)&&(e=e.type),e!=null){if(typeof e!="function"){let{aspectRatio:t}=_5(e);if(t)return t}return g5}}function rc(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"&&mE("x","y",o,n),r&&(o.x=Qe(o.x)),i&&(o.y=Qe(o.y)),o}function I5(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)Br(s,o);return[r,i]}var FZ=["#4269d0","#efb118","#ff725c","#6cc5b0","#3ca951","#ff8ab7","#a463f2","#97bbf5","#9c6b4e","#9498a0"],N5=new Map([["accent",eT],["category10",tT],["dark2",nT],["observable10",FZ],["paired",rT],["pastel1",iT],["pastel2",oT],["set1",sT],["set2",aT],["set3",cT],["tableau10",lT]]);function R5(e){return e!=null&&N5.has(`${e}`.toLowerCase())}var T5=new Map([...N5,["brbg",Qs(fx,dx)],["prgn",Qs(hx,px)],["piyg",Qs(mx,yx)],["puor",Qs(gx,bx)],["rdbu",Qs(Xp,ef)],["rdgy",Qs(xx,_x)],["rdylbu",Qs(Hp,nf)],["rdylgn",Qs(wx,vx)],["spectral",Qs(Sx,Ix)],["burd",E5(Xp,ef)],["buylrd",E5(Hp,nf)],["blues",gn(Hx,Zx)],["greens",gn(Qx,Kx)],["greys",gn(Jx,t1)],["oranges",gn(o1,s1)],["purples",gn(e1,n1)],["reds",gn(r1,i1)],["turbo",Ks(m1)],["viridis",Ks(g1)],["magma",Ks(b1)],["inferno",Ks(x1)],["plasma",Ks(_1)],["cividis",Ks(a1)],["cubehelix",Ks(c1)],["warm",Ks(u1)],["cool",Ks(f1)],["bugn",gn(Tx,Ex)],["bupu",gn(Ax,Mx)],["gnbu",gn(Nx,Rx)],["orrd",gn(Ox,Dx)],["pubu",gn(Lx,Cx)],["pubugn",gn(kx,Fx)],["purd",gn(Bx,Px)],["rdpu",gn($x,Ux)],["ylgn",gn(jx,Vx)],["ylgnbu",gn(zx,qx)],["ylorbr",gn(Yx,Gx)],["ylorrd",gn(Wx,Xx)],["rainbow",A5(d1)],["sinebow",A5(p1)]]);function gn(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?Cn(t,n):e[n])}function Qs(e,t){return({length:n})=>n===2?[e[3][0],e[3][2]]:(n=Math.max(3,Math.floor(n)),n>11?Cn(t,n):e[n])}function E5(e,t){return({length:n})=>n===2?[e[3][2],e[3][0]]:(n=Math.max(3,Math.floor(n)),n>11?Cn(r=>t(1-r),n):e[n].slice().reverse())}function Ks(e){return({length:t})=>Cn(e,Math.max(2,Math.floor(t)))}function A5(e){return({length:t})=>Cn(e,Math.floor(t)+1).slice(0,-1)}function yE(e){let t=`${e}`.toLowerCase();if(!T5.has(t))throw new Error(`unknown ordinal scheme: ${t}`);return T5.get(t)}function Am(e,t){let n=yE(e),r=typeof n=="function"?n({length:t}):n;return r.length!==t?r.slice(0,t):r}function O5(e,t="greys"){let n=new Set,[r,i]=Am(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 M5=new Map([["brbg",dx],["prgn",px],["piyg",yx],["puor",bx],["rdbu",ef],["rdgy",_x],["rdylbu",nf],["rdylgn",vx],["spectral",Ix],["burd",e=>ef(1-e)],["buylrd",e=>nf(1-e)],["blues",Zx],["greens",Kx],["greys",t1],["purples",n1],["reds",i1],["oranges",s1],["turbo",m1],["viridis",g1],["magma",b1],["inferno",x1],["plasma",_1],["cividis",a1],["cubehelix",c1],["warm",u1],["cool",f1],["bugn",Ex],["bupu",Mx],["gnbu",Rx],["orrd",Dx],["pubugn",Fx],["pubu",Cx],["purd",Px],["rdpu",Ux],["ylgnbu",qx],["ylgn",Vx],["ylorbr",Gx],["ylorrd",Xx],["rainbow",d1],["sinebow",p1]]);function Mf(e){let t=`${e}`.toLowerCase();if(!M5.has(t))throw new Error(`unknown quantitative scheme: ${t}`);return M5.get(t)}var LZ=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function D5(e){return e!=null&&LZ.has(`${e}`.toLowerCase())}var bE=e=>t=>e(1-t),gE=[0,1],k5=new Map([["number",we],["rgb",oi],["hsl",dS],["hcl",hS],["lab",X0]]);function xE(e){let t=`${e}`.toLowerCase();if(!k5.has(t))throw new Error(`unknown interpolator: ${t}`);return k5.get(t)}function Rf(e,t,n,{type:r,nice:i,clamp:o,zero:s,domain:a=z5(e,n),unknown:c,round:l,scheme:u,interval:f,range:d=fe.get(e)===Sl?$Z(n,a):fe.get(e)===Il?UZ(n,a):fe.get(e)===Tl?gE:void 0,interpolate:h=fe.get(e)===qr?u==null&&d!==void 0?oi:Mf(u!==void 0?u:r==="cyclical"?"rainbow":"turbo"):l?Kc:we,reverse:p}){if(f=ko(f,r),(r==="cyclical"||r==="sequential")&&(r="linear"),typeof h!="function"&&(h=xE(h)),p=!!p,d!==void 0){let m=(a=qe(a)).length,g=(d=qe(d)).length;if(m!==g){if(h.length===1)throw new Error("invalid piecewise interpolator");h=mo(h,d),d=void 0}}if(h.length===1?(p&&(h=bE(h),p=!1),d===void 0&&(d=Float64Array.from(a,(m,g)=>g/(a.length-1)),d.length===2&&(d=gE)),t.interpolate((d===gE?dn:Mm)(h))):t.interpolate(h),s){let[m,g]=ae(a);(m>0||g<0)&&(a=Za(a),js(a)!==Math.sign(m)?a[a.length-1]=0:a[0]=0)}return p&&(a=Ra(a)),t.domain(a).unknown(c),i&&(t.nice(CZ(i,r)),a=t.domain()),d!==void 0&&t.range(d),o&&t.clamp(o),{type:r,domain:a,range:d,scale:t,interpolate:h,interval:f}}function CZ(e,t){return e===!0?void 0:typeof e=="number"?e:$C(e,t)}function F5(e,t,n){return Rf(e,ks(),t,n)}function L5(e,t,n){return _E(e,t,{...n,exponent:.5})}function _E(e,t,{exponent:n=1,...r}){return Rf(e,Bp().exponent(n),t,{...r,type:"pow"})}function C5(e,t,{base:n=10,domain:r=zZ(t),...i}){return Rf(e,Lp().base(n),t,{...i,domain:r})}function B5(e,t,{constant:n=1,...r}){return Rf(e,Cp().constant(n),t,r)}function P5(e,t,{range:n,quantiles:r=n===void 0?5:(n=[...n]).length,n:i=r,scheme:o="rdylbu",domain:s=qZ(t),unknown:a,interpolate:c,reverse:l}){return n===void 0&&(n=c!==void 0?Cn(c,i):fe.get(e)===qr?Am(o,i):void 0),s.length>0&&(s=Pp(s,n===void 0?{length:i}:n).quantiles()),t_(e,t,{domain:s,range:n,reverse:l,unknown:a})}function $5(e,t,{range:n,n:r=n===void 0?5:(n=[...n]).length,scheme:i="rdylbu",domain:o=z5(e,t),unknown:s,interpolate:a,reverse:c}){let[l,u]=ae(o),f;return n===void 0?(f=Tn(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?Cn(a,r):fe.get(e)===qr?Am(i,r):void 0):(f=Cn(we(l,u),r+1).slice(1,-1),l instanceof Date&&(f=f.map(d=>new Date(d)))),js(qe(o))<0&&f.reverse(),t_(e,t,{domain:f,range:n,reverse:c,unknown:s})}function t_(e,t,{domain:n=[0],unknown:r,scheme:i="rdylbu",interpolate:o,range:s=o!==void 0?Cn(o,n.length+1):fe.get(e)===qr?Am(i,n.length+1):void 0,reverse:a}){n=qe(n);let c=js(n);if(!isNaN(c)&&!BZ(n,c))throw new Error(`the ${e} scale has a non-monotonic domain`);return a&&(s=Ra(s)),{type:"threshold",scale:$p(c<0?Ra(n):n,s===void 0?[]:s).unknown(r),domain:n,range:s}}function BZ(e,t){for(let n=1,r=e.length,i=e[0];n<r;++n){let o=Hn(i,i=e[n]);if(o!==0&&o!==t)return!1}return!0}function U5(e){return{type:"identity",scale:ZC(fe.get(e))?kp():t=>t}}function Nf(e,t=ff){return e.length?[ce(e,({value:n})=>n===void 0?n:ce(n,t)),Gt(e,({value:n})=>n===void 0?n:Gt(n,t))]:[0,1]}function z5(e,t){let n=fe.get(e);return(n===Sl||n===Tl||n===Il?PZ:Nf)(t)}function PZ(e){return[0,e.length?Gt(e,({value:t})=>t===void 0?t:Gt(t,ff)):1]}function $Z(e,t){let n=e.find(({radius:s})=>s!==void 0);if(n!==void 0)return[0,n.radius];let r=Kn(e,.5,({value:s})=>s===void 0?NaN:Kn(s,.25,sr)),i=t.map(s=>3*Math.sqrt(s/r)),o=30/Gt(i);return o<1?i.map(s=>s*o):i}function UZ(e,t){let n=Bi(e,({value:o})=>o===void 0?NaN:Bi(o,Math.abs)),r=t.map(o=>12*o/n),i=60/Gt(r);return i<1?r.map(o=>o*i):r}function zZ(e){for(let{value:t}of e)if(t!==void 0)for(let n of t){if(n>0)return Nf(e,sr);if(n<0)return Nf(e,Va)}return[1,10]}function qZ(e){let t=[];for(let{value:n}of e)if(n!==void 0)for(let r of n)t.push(r);return t}function Mm(e){return(t,n)=>r=>e(t+r*(n-t))}function e_(e,t,n,r,{type:i,nice:o,clamp:s,domain:a=Nf(r),unknown:c,pivot:l=0,scheme:u,range:f,symmetric:d=!0,interpolate:h=fe.get(e)===qr?u==null&&f!==void 0?oi:Mf(u!==void 0?u:"rdbu"):we,reverse:p}){l=+l,a=qe(a);let[m,g]=a;if(a.length>2&&jn(`Warning: the diverging ${e} scale domain contains extra elements.`),Hn(m,g)<0&&([m,g]=[g,m],p=!p),m=Math.min(m,l),g=Math.max(g,l),typeof h!="function"&&(h=xE(h)),f!==void 0&&(h=h.length===1?Mm(h)(...f):mo(h,f)),p&&(h=bE(h)),d){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(h),s&&t.clamp(s),o&&t.nice(o),{type:i,domain:[m,g],pivot:l,interpolate:h,scale:t}}function q5(e,t,n){return e_(e,Wp(),jZ,t,n)}function j5(e,t,n){return wE(e,t,{...n,exponent:.5})}function wE(e,t,{exponent:n=1,...r}){return e_(e,ux().exponent(n=+n),GZ(n),t,{...r,type:"diverging-pow"})}function V5(e,t,{base:n=10,pivot:r=1,domain:i=Nf(t,r<0?Va:sr),...o}){return e_(e,cx().base(n=+n),VZ,t,{domain:i,pivot:r,...o})}function Y5(e,t,{constant:n=1,...r}){return e_(e,lx().constant(n=+n),WZ(n),t,r)}var jZ={apply(e){return e},invert(e){return e}},VZ={apply:Math.log,invert:Math.exp},YZ={apply(e){return Math.sign(e)*Math.sqrt(Math.abs(e))},invert(e){return Math.sign(e)*(e*e)}};function GZ(e){return e===.5?YZ:{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 WZ(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 G5(e,t,n,r){return Rf(e,t,n,r)}function W5(e,t,n){return G5(e,ox(),t,n)}function X5(e,t,n){return G5(e,sx(),t,n)}var Of=Symbol("ordinal");function Z5(e,t,n,{type:r,interval:i,domain:o,range:s,reverse:a,hint:c}){return i=ko(i,r),o===void 0&&(o=eB(n,i,e)),(r==="categorical"||r===Of)&&(r="ordinal"),a&&(o=Ra(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 Q5(e,t,{type:n,interval:r,domain:i,range:o,scheme:s,unknown:a,...c}){r=ko(r,n),i===void 0&&(i=eB(t,r,e));let l;if(fe.get(e)===wf)l=XZ(t),o=o===void 0?HZ(l):Yt(o,vf);else if(fe.get(e)===qr&&(o===void 0&&(n==="ordinal"||n===Of)&&(o=O5(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=Mf(s),f=o[0],d=o[1]-o[0];o=({length:h})=>Cn(p=>u(f+d*p),h)}else o=yE(s);if(a===Op)throw new Error(`implicit unknown on ${e} scale is not supported`);return Z5(e,ul().unknown(a),t,{...c,type:n,domain:i,range:o,hint:l})}function K5(e,t,{align:n=.5,padding:r=.5,...i}){return tB(PI().align(n).padding(r),t,i,e)}function J5(e,t,{align:n=.5,padding:r=.1,paddingInner:i=r,paddingOuter:o=e==="fx"||e==="fy"?0:r,...s}){return tB(za().align(n).paddingInner(i).paddingOuter(o),t,s,e)}function tB(e,t,n,r){let{round:i}=n;return i!==void 0&&e.round(i=!!i),e=Z5(r,e,t,n),e.round=i,e}function eB(e,t,n){let r=new Qn;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]=ae(r).map(t.floor,t);return t.range(i,t.offset(o))}if(r.size>1e4&&fe.get(n)===mi)throw new Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return uo(r,fn)}function H5(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 XZ(e){return{fill:H5(e,"fill"),stroke:H5(e,"stroke")}}function HZ(e){return ne(e.fill)?yT:E1}function Nm(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:d,projection:h,facet:{label:p=t}={},...m}={}){let g={};for(let[y,b]of e){let x=m[y],_=lB(y,b,{round:fe.get(y)===mi?a:void 0,nice:c,clamp:l,zero:u,align:f,padding:d,projection:h,...x});if(_){let{label:v=y==="fx"||y==="fy"?p:t,percent:w,transform:T,inset:M,insetTop:R=M!==void 0?M:y==="y"?r:0,insetRight:I=M!==void 0?M:y==="x"?i:0,insetBottom:A=M!==void 0?M:y==="y"?o:0,insetLeft:O=M!==void 0?M:y==="x"?s:0}=x||{};if(T==null)T=void 0;else if(typeof T!="function")throw new Error("invalid scale transform; not a function");_.percent=!!w,_.label=v===void 0?ZZ(b,_):v,_.transform=T,y==="x"||y==="fx"?(_.insetLeft=+O,_.insetRight=+I):(y==="y"||y==="fy")&&(_.insetTop=+R,_.insetBottom=+A),g[y]=_}}return g}function SE(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]=fB(i),n[r]=o,o.type=s,a!=null&&(o.interval=a),c!=null&&(o.label=c)}return n}function sB(e,t){let{x:n,y:r,fx:i,fy:o}=e,s=i||o?i_(t):t;i&&nB(i,s),o&&rB(o,s);let a=i||o?IE(e,t):t;n&&nB(n,a),r&&rB(r,a)}function ZZ(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!Co(t)&&t.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function r_(e){return Math.sign(js(e.domain()))*Math.sign(js(e.range()))}function i_(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 IE({fx:e,fy:t},n){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:a,height:c}=i_(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 nB(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)],Co(e)||(e.range=cB(e)),e.scale.range(e.range)}aB(e)}function rB(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],Co(e)?e.range.reverse():e.range=cB(e),e.scale.range(e.range)}aB(e)}function aB(e){e.round===void 0&&JZ(e)&&QZ(e)<=30&&e.scale.round(!0)}function QZ({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 cB(e){let t=e.scale.domain().length+TE(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 o_(e,t,n){return lB(e,n===void 0?void 0:[{hint:n}],{...t})}function lB(e,t=[],n={}){let r=KZ(e,t,n);if(n.type===void 0&&n.domain===void 0&&n.range===void 0&&n.interval==null&&e!=="fx"&&e!=="fy"&&Co({type:r})){let i=t.map(({value:o})=>o).filter(o=>o!==void 0);i.some(Oe)?jn(`Warning: some data associated with the ${e} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${Df(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 "${Df(r)}".`):i.some(jC)?jn(`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 "${Df(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 "${Df(r)}".`):i.some(VC)&&jn(`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 "${Df(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 "${Df(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=n_(t,n,Qe);break;case"identity":switch(fe.get(e)){case mi:n=n_(t,n,Qe);break;case wf:n=n_(t,n,tQ);break}break;case"utc":case"time":n=n_(t,n,PC);break}switch(r){case"diverging":return q5(e,t,n);case"diverging-sqrt":return j5(e,t,n);case"diverging-pow":return wE(e,t,n);case"diverging-log":return V5(e,t,n);case"diverging-symlog":return Y5(e,t,n);case"categorical":case"ordinal":case Of:return Q5(e,t,n);case"cyclical":case"sequential":case"linear":return F5(e,t,n);case"sqrt":return L5(e,t,n);case"threshold":return t_(e,t,n);case"quantile":return P5(e,t,n);case"quantize":return $5(e,t,n);case"pow":return _E(e,t,n);case"log":return C5(e,t,n);case"symlog":return B5(e,t,n);case"utc":return X5(e,t,n);case"time":return W5(e,t,n);case"point":return K5(e,t,n);case"band":return J5(e,t,n);case"identity":return U5(e);case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function Df(e){return typeof e=="symbol"?e.description:e}function iB(e){return typeof e=="string"?`${e}`.toLowerCase():e}var oB={toString:()=>"projection"};function KZ(e,t,{type:n,domain:r,range:i,scheme:o,pivot:s,projection:a}){if(n=iB(n),e==="fx"||e==="fy")return"band";(e==="x"||e==="y")&&a!=null&&(n=oB);for(let l of t){let u=iB(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===oB)return;if(n!==void 0)return n;if(r===void 0&&!t.some(({value:l})=>l!==void 0))return;let c=fe.get(e);if(c===Sl)return"sqrt";if(c===Tl||c===Il)return"linear";if(c===wf)return"ordinal";if((r||i||[]).length>2)return vE(c);if(r!==void 0){if(Me(r))return vE(c);if(Oe(r))return"utc"}else{let l=t.map(({value:u})=>u).filter(u=>u!==void 0);if(l.some(Me))return vE(c);if(l.some(Oe))return"utc"}if(c===qr){if(s!=null||D5(o))return"diverging";if(R5(o))return"categorical"}return"linear"}function vE(e){switch(e){case mi:return"point";case qr:return Of;default:return"ordinal"}}function Co({type:e}){return e==="ordinal"||e==="point"||e==="band"||e===Of}function TE({type:e}){return e==="threshold"}function JZ({type:e}){return e==="point"||e==="band"}function lr(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 n_(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 tQ(e){return Yt(e,vf)}function kf(e={}){let t;for(let n in e)if(fe.has(n)&&Oo(e[n])){if(t!==void 0)throw new Error("ambiguous scale definition; multiple scales found");t=fB(o_(n,e[n]))}if(t===void 0)throw new Error("invalid scale definition; no scale found");return t}function uB(e){return t=>{if(!fe.has(t=`${t}`))throw new Error(`unknown scale: ${t}`);return e[t]}}function fB({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:Za(n),...r!==void 0&&{range:Za(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 hB(e,t,n={}){let r=.5-De,i=.5+De,o=.5+De,s=.5-De;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:d=640,height:h=eQ(e,n,{width:d,marginTopDefault:r,marginRightDefault:i,marginBottomDefault:o,marginLeftDefault:s})+Math.max(0,c-r+u-o)}=n;d=+d,h=+h;let p={width:d,height:h,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 eQ({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,d=S5(i);if(d){let p=r?r.scale.domain().length:1,m=(1.1*f-.1)/(1.1*p-.1)*d,g=Math.max(.1,Math.min(10,m));return Math.round((s-u-c)*g+a+l)}let h=t?Co(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=dB("y",t)/(dB("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,h*f))*20+!!r*30+60}function dB(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]=ae(r);return Math.abs(i(s)-i(o))}function mB(e,t){let{fx:n,fy:r}=Nm(e,t),i=n?.scale.domain(),o=r?.scale.domain();return i&&o?v0(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 yB(e,{x:t,y:n}){return t&&=RE(t),n&&=RE(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 a_(e,{fx:t,fy:n}){let r=ar(e),i=t?.value,o=n?.value;return t&&n?Ci(r,s=>(s.fx=i[s[0]],s.fy=o[s[0]],s),s=>i[s],s=>o[s]):t?Ci(r,s=>(s.fx=i[s[0]],s),s=>i[s]):Ci(r,s=>(s.fy=o[s[0]],s),s=>o[s])}function gB(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 bB(e){let t=[],n=new Uint32Array(En(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 nQ=new Map([["top",EE],["right",NE],["bottom",AE],["left",ME],["top-left",s_(EE,ME)],["top-right",s_(EE,NE)],["bottom-left",s_(AE,ME)],["bottom-right",s_(AE,NE)],["top-empty",iQ],["right-empty",aQ],["bottom-empty",oQ],["left-empty",sQ],["empty",cQ]]);function xB(e){if(e==null)return null;let t=nQ.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid facet anchor: ${e}`)}var pB=new WeakMap;function RE(e){let t=pB.get(e);return t||pB.set(e,t=new Zn(Yt(e,(n,r)=>[n,r]))),t}function ic(e,t){return RE(e).get(t)}function rQ(e,t,n){return t=Gs(t),n=Gs(n),e.find(r=>Object.is(Gs(r.x),t)&&Object.is(Gs(r.y),n))}function c_(e,t,n){return rQ(e,t,n)?.empty}function EE(e,{y:t},{y:n}){return t?ic(t,n)===0:!0}function AE(e,{y:t},{y:n}){return t?ic(t,n)===t.length-1:!0}function ME(e,{x:t},{x:n}){return t?ic(t,n)===0:!0}function NE(e,{x:t},{x:n}){return t?ic(t,n)===t.length-1:!0}function iQ(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=ic(t,r);if(o>0)return c_(e,n,t[o-1])}function oQ(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=ic(t,r);if(o<t.length-1)return c_(e,n,t[o+1])}function sQ(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=ic(t,n);if(o>0)return c_(e,t[o-1],r)}function aQ(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=ic(t,n);if(o<t.length-1)return c_(e,t[o+1],r)}function cQ(e,t,{empty:n}){return n}function s_(e,t){return function(){return e.apply(null,arguments)&&t.apply(null,arguments)}}function l_(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 wt=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:d=0,marginTop:h=d,marginRight:p=d,marginBottom:m=d,marginLeft:g=d,clip:y=i?.clip,channels:b,tip:x,render:_}=r;if(this.data=t,this.sort=Do(l)?l:null,this.initializer=Se(r).initializer,this.transform=this.initializer?r.transform:mn(r).transform,o===null||o===!1?this.facet=null:(this.facet=Ke(o===!0?"include":o,"facet",["auto","include","exclude","super"]),this.fx=t===Xa&&typeof a=="string"?[a]:a,this.fy=t===Xa&&typeof c=="string"?[c]:c),this.facetAnchor=xB(s),n=xm(n),b!==void 0&&(n={...lQ(b),...n}),i!==void 0&&(n={...Z1(this,r,i),...n}),this.channels=Object.fromEntries(Object.entries(n).map(([v,w])=>{if(zr(w.value)){let{value:T,label:M=w.label,scale:R=w.scale}=w.value;w={...w,label:M,scale:R,value:T}}if(t===Xa&&typeof w.value=="string"){let{value:T}=w;w={...w,value:[T]}}return[v,w]}).filter(([v,{value:w,optional:T}])=>{if(w!=null)return!0;if(T)return!1;throw new Error(`missing channel value: ${v}`)})),this.dx=+u,this.dy=+f,this.marginTop=+h,this.marginRight=+p,this.marginBottom=+m,this.marginLeft=+g,this.clip=K1(y),this.tip=uQ(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:w}=n[v];if(!(w!=="x"&&w!=="y"))throw new Error("super-faceting cannot use x or y")}}_!=null&&(this.render=Ff(_,this.render))}initialize(t,n,r){let i=qe(this.data);t===void 0&&i!=null&&(t=[ar(i)]);let o=t;this.transform!=null&&({facets:t,data:i}=this.transform(i,t,r),i=qe(i)),t!==void 0&&(t.original=o);let s=W1(this.channels,i);return this.sort!=null&&u5(i,t,s,n,this.sort),{data:i,facets:t,channels:s}}filter(t,n,r){for(let i in n){let{filter:o=Ue}=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"&&mE(i,o,n,r.projection)}}scale(t,n,r){let i=Tf(t,n);return r.projection&&this.project(t,i,r),i}};function Je(...e){return e.plot=wt.prototype.plot,e}function Ff(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,d)=>t.call(this,c,l,u,f,d,a))}}function lQ(e){return Object.fromEntries(Object.entries(xm(e)).map(([t,n])=>(n=typeof n=="string"?{value:n,label:t}:pi(n),n.filter===void 0&&n.scale==null&&(n={...n,filter:null}),[t,n])))}function uQ(e){return e===!0?"xy":e===!1||e==null?null:typeof e=="string"?Ke(e,"tip",["x","y","xy"]):e}function ji(e,t){return e?.tip===!0?{...e,tip:t}:hn(e?.tip)&&e.tip.pointer===void 0?{...e,tip:{...e.tip,pointer:t}}:e}var _B=new WeakMap;function OE(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:Ff(function(u,f,d,h,p,m){p={...p,pointerSticky:!1};let g=p.ownerSVGElement,{data:y}=p.getMarkState(this),b=_B.get(g);b||_B.set(g,b={sticky:!1,roots:[],renders:[]});let x=b.renders.push(X)-1,{x:_,y:v,fx:w,fy:T}=f,M=w?w(u.fx)-h.marginLeft:0,R=T?T(u.fy)-h.marginTop:0;_?.bandwidth&&(M+=_.bandwidth()/2),v?.bandwidth&&(R+=v.bandwidth()/2);let I=u.fi!=null,A;if(I){let Y=b.facetStates;Y||(b.facetStates=Y=new Map),A=Y.get(this),A||Y.set(this,A=new Map)}let[O,F]=yn(this,h),{px:S,py:E}=d,N=S?Y=>S[Y]:DE(d,O),L=E?Y=>E[Y]:kE(d,F),B,C,P,$;function U(Y,rt){if(I)if($&&($=cancelAnimationFrame($)),Y==null)A.delete(u.fi);else{A.set(u.fi,rt),$=requestAnimationFrame(()=>{$=null;for(let[q,H]of A)if(H<rt||H===rt&&q<u.fi){Y=null;break}X(Y)});return}X(Y)}function X(Y){if(B===Y&&P===b.sticky)return;B=Y,P=p.pointerSticky=b.sticky;let rt=B==null?[]:[B];I&&(rt.fx=u.fx,rt.fy=u.fy,rt.fi=u.fi);let q=m(rt,f,d,h,p);if(C){if(I){let H=C.parentNode,ot=C.getAttribute("transform"),z=q.getAttribute("transform");ot?q.setAttribute("transform",ot):q.removeAttribute("transform"),z?H.setAttribute("transform",z):H.removeAttribute("transform"),q.removeAttribute("aria-label"),q.removeAttribute("aria-description"),q.removeAttribute("aria-hidden")}C.replaceWith(q)}return b.roots[x]=C=q,B==null&&A?.size>1||p.dispatchValue(B==null?null:y[B]),q}function tt(Y){if(b.sticky||Y.pointerType==="mouse"&&Y.buttons===1)return;let[rt,q]=Ln(Y);rt-=M,q-=R;let H=rt<h.marginLeft||rt>h.width-h.marginRight?1:e,ot=q<h.marginTop||q>h.height-h.marginBottom?1:t,z=null,Lt=s*s;for(let dt of u){let Wt=H*(N(dt)-rt),Xt=ot*(L(dt)-q),et=Wt*Wt+Xt*Xt;et<=Lt&&(z=dt,Lt=et)}if(z!=null&&(e!==1||t!==1)){let dt=N(z)-rt,Wt=L(z)-q;Lt=dt*dt+Wt*Wt}U(z,Lt)}function nt(Y){Y.pointerType==="mouse"&&B!=null&&(b.sticky&&b.roots.some(rt=>rt?.contains(Y.target))||(b.sticky?(b.sticky=!1,b.renders.forEach(rt=>rt(null))):(b.sticky=!0,X(B)),Y.stopImmediatePropagation()))}function st(Y){Y.pointerType==="mouse"&&(b.sticky||U(null))}return g.addEventListener("pointerenter",tt),g.addEventListener("pointermove",tt),g.addEventListener("pointerdown",nt),g.addEventListener("pointerleave",st),X(null)},c)}}function Lf(e){return OE(1,1,e)}function Cf(e){return OE(1,.01,e)}function Al(e){return OE(.01,1,e)}function DE({x1:e,x2:t,x:n=e},r){return e&&t?i=>(e[i]+t[i])/2:n?i=>n[i]:()=>r}function kE({y1:e,y2:t,y:n=e},r){return e&&t?i=>(e[i]+t[i])/2:n?i=>n[i]:()=>r}function u_(e){return Co(e)&&e.interval===void 0?void 0:"tabular-nums"}function wB(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:d,fontVariant:h=u_(e),round:p=!0,opacity:m,className:g}=t,y=nc(t);g=Ef(g),m=ie(m)[1],d===null&&(d=()=>null);let b=ct("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) {
|
|
22
|
+
${r}`:e==="top"?(t,r)=>`${r}
|
|
23
|
+
${t}`:(t,r)=>`${t}
|
|
24
|
+
${r}`}function Kst(e){return e==="time"?mI:e==="utc"?xb:Hst}function oV(e,t,r){let n=de(fv(t,(i,o)=>Math.abs(o-i)));if(n<1e3)return rV("millisecond","utc",r);for(let[i,o,s,a]of Kst(e)){if(n>a||i==="hour"&&!n)break;if(t.every(c=>o.floor(c)>=c))return rV(i,s,r)}}function xp(e,t,r){return(n,i,o)=>{let s=e(n,i),a=t(n,i),c=i-tl(o);return i!==c&&o[c]!==void 0&&a===t(o[c],c)?s:r(s,a)}}var sd=Object.getPrototypeOf(Uint8Array),Qst=Object.prototype.toString,TN=Symbol("reindex");function Tt(e,t,r){let n=typeof t;return n==="string"?sV(e,AN(t),r):n==="function"?sV(e,t,r):n==="number"||t instanceof Date||n==="boolean"?fe(e,Qr(t),r):typeof t?.transform=="function"?aV(t.transform(e),r):Jst(aV(t,r),e?.[TN])}function Jst(e,t){return t?vb(e,t):e}function sV(e,t,r){return fe(e,r?.prototype instanceof sd?tat(t):t,r)}function aV(e,t){return t===void 0?Sr(e):e instanceof t?e:t.prototype instanceof sd&&!(e instanceof sd)?t.from(e,MN):t.from(e)}function tat(e){return(t,r)=>MN(e(t,r))}var gu=[null],AN=e=>t=>t[e],nr={transform:ii},K={transform:e=>e};var wb=()=>1,cV=()=>!0,vr=e=>e==null?e:`${e}`,Wt=e=>e==null?e:+e;var el=e=>e?e[0]:void 0,bu=e=>e?e[1]:void 0,lV=e=>e?e[2]:void 0,Qr=e=>()=>e;function vp(e){let t=+`${e}`.slice(1)/100;return(r,n)=>Hn(r,t,n)}function Cr(e){return e instanceof sd?e:fe(e,MN,Float64Array)}function MN(e){return e==null?NaN:Number(e)}function uV(e){return fe(e,EN)}function EN(e){return e instanceof Date&&!isNaN(e)?e:typeof e=="string"?bb(e):e==null||isNaN(e=+e)?void 0:new Date(e)}function cr(e,t){return e===void 0&&(e=t),e===null?[void 0,"none"]:wu(e)?[void 0,e]:[e,void 0]}function Ae(e,t){return e===void 0&&(e=t),e===null||typeof e=="number"?[void 0,e]:[e,void 0]}function DN(e,t,r){if(e!=null)return Ur(e,t,r)}function Ur(e,t,r){let n=`${e}`.toLowerCase();if(!r.includes(n))throw new Error(`invalid ${t}: ${e}`);return n}function Sr(e){return e==null||e instanceof Array||e instanceof sd?e:Array.from(e)}function fe(e,t,r=Array){return e==null?e:e instanceof r?e.map(t):r.from(e,t)}function xu(e,t=Array){return e instanceof t?e.slice():t.from(e)}function BN({x:e,x1:t,x2:r}){return e!==void 0||t!==void 0||r!==void 0}function ON({y:e,y1:t,y2:r}){return e!==void 0||t!==void 0||r!==void 0}function Sp(e){return BN(e)||ON(e)||e.interval!==void 0}function Jr(e){return e?.toString===Qst}function ya(e){return Jr(e)&&(e.type!==void 0||e.domain!==void 0)}function Xi(e){return Jr(e)&&typeof e.transform!="function"}function ga(e){return Xi(e)&&e.value===void 0&&e.channel===void 0}function NN(e,t,r,n=K){return t===void 0&&r===void 0?(t=0,r=e===void 0?n:e):t===void 0?t=e===void 0?0:e:r===void 0&&(r=e===void 0?0:e),[t,r]}function gr(e,t){return e===void 0&&t===void 0?[el,bu]:[e,t]}function Rn({z:e,fill:t,stroke:r}={}){return e===void 0&&([e]=cr(t)),e===void 0&&([e]=cr(r)),e}function ii(e){let t=e.length,r=new Uint32Array(t);for(let n=0;n<t;++n)r[n]=n;return r}function vb(e,t){return fe(t,r=>e[r],e.constructor)}function Ip(e){return e.length===1?(t,r)=>e(vb(r,t)):e}function rl(e,t,r){return e.subarray?e.subarray(t,r):e.slice(t,r)}function nl(e){return e!==null&&typeof e=="object"?e.valueOf():e}function bI(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 tn(e){let t;return[{transform:()=>t,label:vn(e)},r=>t=r]}function wn(e){return e==null?[e]:tn(e)}function vn(e,t){return typeof e=="string"?e:e&&e.label!==void 0?e.label:t}function Tp(e,t){return{transform(r){let n=e.transform(r),i=t.transform(r);return lr(n)||lr(i)?fe(n,(o,s)=>new Date((+n[s]+ +i[s])/2)):fe(n,(o,s)=>(+n[s]+ +i[s])/2,Float64Array)},label:e.label}}function ad(e,t){let r=FN(t?.interval,t?.type);return r?fe(e,r):e}function FN(e,t){let r=Ap(e,t);return r&&(n=>wr(n)?r.floor(n):n)}function Ap(e,t){if(e!=null){if(typeof e=="number"){0<e&&e<1&&Number.isInteger(1/e)&&(e=-1/e);let r=Math.abs(e);return e<0?{floor:n=>Math.floor(n*r)/r,offset:n=>(n*r+1)/r,range:(n,i)=>_r(Math.ceil(n*r),i*r).map(o=>o/r)}:{floor:n=>Math.floor(n/r)*r,offset:n=>n+r,range:(n,i)=>_r(Math.ceil(n/r),i/r).map(o=>o*r)}}if(typeof e=="string")return(t==="time"?SN:_b)(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 ba(e,t){if(e=Ap(e,t),e&&typeof e.range!="function")throw new Error("invalid interval: missing range method");return e}function fV(e,t){if(e=ba(e,t),e&&typeof e.ceil!="function")throw new Error("invalid interval: missing ceil method");return e}function dV(e){return _u(e)&&typeof e?.floor=="function"&&e.floor()instanceof Date}function _u(e){return typeof e?.range=="function"}function Mo(e){return e===void 0||Xi(e)?e:{value:e}}function hV(e){return e==null?null:{transform:t=>Tt(t,e,Float64Array),label:vn(e)}}function pV(e){if(!oi(e))return!1;for(let t of e)if(t!=null)return typeof t=="object"&&"0"in t&&"1"in t}function oi(e){return e&&typeof e[Symbol.iterator]=="function"}function xI(e){for(let t of e)if(t!=null)return typeof t!="object"||t instanceof Date}function ir(e){for(let t of e){if(t==null)continue;let r=typeof t;return r==="string"||r==="boolean"}}function lr(e){for(let t of e)if(t!=null)return t instanceof Date}function mV(e){for(let t of e)if(t!=null)return typeof t=="string"&&isNaN(t)&&bb(t)}function yV(e){for(let t of e)if(t!=null){if(typeof t!="string")return!1;if(t.trim())return!isNaN(t)}}function il(e){for(let t of e)if(t!=null)return typeof t=="number"}function _I(e,t){let r;for(let n of e)if(n!=null){if(!t(n))return!1;r=!0}return r}var eat=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 wu(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)||eat.has(e))}function gV(e){return typeof e=="number"&&(0<=e&&e<=1||isNaN(e))}function Se(e){return e==null||ol(e)}function ol(e){return/^\s*none\s*$/i.test(e)}function bV(e){return/^\s*round\s*$/i.test(e)}function wI(e,t){return DN(e,t,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function xa(e="middle"){return wI(e,"frameAnchor")}function tl(e){if(e==null)return;let t=e[0],r=e[e.length-1];return Wn(t,r)}function xV(e={},...t){let r=e;for(let n of t)for(let i in n)if(r[i]===void 0){let o=n[i];r===e?r={...r,[i]:o}:r[i]=o}return r}function rat(e){console.warn("named iterables are deprecated; please use an object instead");let t=new Set;return Object.fromEntries(Array.from(e,r=>{let{name:n}=r;if(n==null)throw new Error("missing name");let i=`${n}`;if(i==="__proto__")throw new Error(`illegal name: ${i}`);if(t.has(i))throw new Error(`duplicate name: ${i}`);return t.add(i),[n,r]}))}function Sb(e){return oi(e)?rat(e):e}var Eo=Symbol("position"),Hi=Symbol("color"),cd=Symbol("radius"),ld=Symbol("length"),ud=Symbol("opacity"),Mp=Symbol("symbol"),_V=Symbol("projection"),Fe=new Map([["x",Eo],["y",Eo],["fx",Eo],["fy",Eo],["r",cd],["color",Hi],["opacity",ud],["symbol",Mp],["length",ld],["projection",_V]]);function wV(e){return e===Eo||e===_V}function vV(e){return e===Eo||e===cd||e===ld||e===ud}var LN=Math.sqrt(3),RN=2/LN,nat={draw(e,t){let r=Math.sqrt(t/Math.PI),n=r*RN,i=n/2;e.moveTo(0,n),e.lineTo(r,i),e.lineTo(r,-i),e.lineTo(0,-n),e.lineTo(-r,-i),e.lineTo(-r,i),e.closePath()}},kN=new Map([["asterisk",rb],["circle",Qc],["cross",nb],["diamond",ib],["diamond2",ob],["hexagon",nat],["plus",sb],["square",ab],["square2",cb],["star",lb],["times",hp],["triangle",ub],["triangle2",fb],["wye",db]]);function CN(e){return e&&typeof e.draw=="function"}function SV(e){return CN(e)?!0:typeof e!="string"?!1:kN.has(e.toLowerCase())}function Ep(e){if(e==null||CN(e))return e;let t=kN.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid symbol: ${e}`)}function IV(e){if(e==null||CN(e))return[void 0,e];if(typeof e=="string"){let t=kN.get(`${e}`.toLowerCase());if(t)return[void 0,t]}return[e,void 0]}function en({filter:e,sort:t,reverse:r,transform:n,initializer:i,...o}={},s){if(n===void 0&&(e!=null&&(n=$N(e)),t!=null&&!ga(t)&&(n=UN(n,VN(t))),r&&(n=UN(n,zN))),s!=null&&i!=null)throw new Error("transforms cannot be applied after initializers");return{...o,...(t===null||ga(t))&&{sort:t},transform:UN(n,s)}}function Qe({filter:e,sort:t,reverse:r,initializer:n,...i}={},o){return n===void 0&&(e!=null&&(n=$N(e)),t!=null&&!ga(t)&&(n=PN(n,VN(t))),r&&(n=PN(n,zN))),{...i,...(t===null||ga(t))&&{sort:t},initializer:PN(n,o)}}function UN(e,t){return e==null?t===null?void 0:t:t==null?e===null?void 0:e:function(r,n,i){return{data:r,facets:n}=e.call(this,r,n,i),t.call(this,Sr(r),n,i)}}function PN(e,t){return e==null?t===null?void 0:t:t==null?e===null?void 0:e:function(r,n,i,...o){let s,a,c,l,u,f;return{data:a=r,facets:c=n,channels:s}=e.call(this,r,n,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 vI(e,t){return(e.initializer!=null?Qe:en)(e,t)}function TV(e,t){return vI(t,$N(e))}function $N(e){return(t,r)=>{let n=Tt(t,e);return{data:t,facets:r.map(i=>i.filter(o=>n[o]))}}}function AV({sort:e,...t}={}){return{...vI(t,zN),sort:ga(e)?e:null}}function zN(e,t){return{data:e,facets:t.map(r=>r.slice().reverse())}}function MV({seed:e,sort:t,...r}={}){return{...vI(r,EV(e==null?Math.random:ca(e))),sort:ga(t)?t:null}}function SI(e,{sort:t,...r}={}){return{...(Xi(e)&&e.channel!==void 0?Qe:vI)(r,VN(e)),sort:ga(t)?t:null}}function VN(e){return(typeof e=="function"&&e.length!==1?iat:EV)(e)}function iat(e){return(t,r)=>{let n=(i,o)=>e(t[i],t[o]);return{data:t,facets:r.map(i=>i.slice().sort(n))}}}function EV(e){let t,r;({channel:t,value:e,order:r}={...Mo(e)});let n=t?.startsWith("-");if(n&&(t=t.slice(1)),r===void 0&&(r=n?id:Kr),typeof r!="function")switch(`${r}`.toLowerCase()){case"ascending":r=Kr;break;case"descending":r=id;break;default:throw new Error(`invalid order: ${r}`)}return(i,o,s)=>{let a;if(t===void 0)a=Tt(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)=>r(a[l],a[u]);return{data:i,facets:o.map(l=>l.slice().sort(c))}}}function Tb(e,t){return II(null,null,e,t)}function Su(e={y:"count"},t={}){let{x:r=K}=t;if(r==null)throw new Error("missing channel: x");return II(r,null,e,t)}function Iu(e={x:"count"},t={}){let{y:r=K}=t;if(r==null)throw new Error("missing channel: y");return II(null,r,e,t)}function Ab(e={fill:"count"},t={}){let{x:r,y:n}=t;if([r,n]=gr(r,n),r==null)throw new Error("missing channel: x");if(n==null)throw new Error("missing channel: y");return II(r,n,e,t)}function II(e,t,{data:r=MI,filter:n,sort:i,reverse:o,...s}={},a={}){s=qN(s,a),r=FV(r,K),i=i==null?void 0:OV("sort",i,a),n=n==null?void 0:NV("filter",n,a);let[c,l]=wn(e),[u,f]=wn(t),{z:d,fill:h,stroke:p,x1:y,x2:g,y1:m,y2:b,...x}=a,[_,v]=wn(d),[w]=cr(h),[I]=cr(p),[D,A]=wn(w),[B,M]=wn(I);return{..."z"in a&&{z:_||d},..."fill"in a&&{fill:D||h},..."stroke"in a&&{stroke:B||p},...en(x,(O,R,S)=>{let T=ad(Tt(O,e),S?.x),E=ad(Tt(O,t),S?.y),C=Tt(O,d),U=Tt(O,w),k=Tt(O,I),$=Mb(s,{z:C,fill:U,stroke:k}),z=[],V=[],Q=T&&l([]),nt=E&&f([]),st=C&&v([]),ut=U&&A([]),X=k&&M([]),at=0;for(let q of s)q.initialize(O);i&&i.initialize(O),n&&n.initialize(O);for(let q of R){let J=[];for(let ct of s)ct.scope("facet",q);i&&i.scope("facet",q),n&&n.scope("facet",q);for(let[ct,j]of vu(q,$))for(let[Qt,gt]of vu(j,E))for(let[he,pe]of vu(gt,T)){let ot={data:O};if(T&&(ot.x=he),E&&(ot.y=Qt),!(n&&!n.reduce(pe,ot))){J.push(at++),V.push(r.reduceIndex(pe,O,ot)),T&&Q.push(he),E&&nt.push(Qt),C&&st.push($===C?ct:C[pe[0]]),U&&ut.push($===U?ct:U[pe[0]]),k&&X.push($===k?ct:k[pe[0]]);for(let Me of s)Me.reduce(pe,ot);i&&i.reduce(pe,ot)}}z.push(J)}return YN(z,i,o),{data:V,facets:z}}),...!_a(s,"x")&&(c?{x:c}:{x1:y,x2:g}),...!_a(s,"y")&&(u?{y:u}:{y1:m,y2:b}),...Object.fromEntries(s.map(({name:O,output:R})=>[O,R]))}}function _a(e,...t){for(let{name:r}of e)if(t.includes(r))return!0;return!1}function jN(e,t,r=TI){let n=Object.entries(e);return t.title!=null&&e.title===void 0&&n.push(["title",uat]),t.href!=null&&e.href===void 0&&n.push(["href",EI]),n.filter(([,i])=>i!==void 0).map(([i,o])=>o===null?oat(i):r(i,o,t))}function TI(e,t,r,n=AI){let i;Jr(t)&&"reduce"in t&&(i=t.scale,t=t.reduce);let o=n(e,t,r),[s,a]=tn(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 oat(e){return{name:e,initialize(){},scope(){},reduce(){}}}function AI(e,t,r,n=Dp){let i=bI(e,r),o=n(t,i),s,a;return{label:vn(o===Ib?null:i,o.label),initialize(c){s=i===void 0?c:Tt(c,i),o.scope==="data"&&(a=o.reduceIndex(ii(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 vu(e,t){return t?Hs(Gr(e,r=>t[r]),el):[[,e]]}function Dp(e,t,r=sat){if(e==null)return r(e);if(typeof e.reduceIndex=="function")return e;if(typeof e.reduce=="function"&&Jr(e))return cat(e);if(typeof e=="function")return lat(e);if(/^p\d{2}$/i.test(e))return sl(vp(e));switch(`${e}`.toLowerCase()){case"first":return EI;case"last":return fat;case"identity":return MI;case"count":return Ib;case"distinct":return dat;case"sum":return t==null?Ib:hat;case"proportion":return BV(t,"data");case"proportion-facet":return BV(t,"facet");case"deviation":return sl(go);case"min":return sl(Oe);case"min-index":return sl(cv);case"max":return sl(de);case"max-index":return sl(av);case"mean":return DV(Lc);case"median":return DV(hs);case"variance":return sl(Kl);case"mode":return sl(Oh)}return r(e)}function sat(e){throw new Error(`invalid reduce: ${e}`)}function qN(e,t){return jN(e,t,OV)}function OV(e,t,r){return TI(e,t,r,NV)}function NV(e,t,r){return AI(e,t,r,FV)}function FV(e,t){return Dp(e,t,aat)}function aat(e){switch(`${e}`.toLowerCase()){case"x":return pat;case"y":return mat}throw new Error(`invalid group reduce: ${e}`)}function Mb(e,t){for(let r in t){let n=t[r];if(n!==void 0&&!e.some(i=>i.name===r))return n}}function YN(e,t,r){if(t){let n=t.output.transform(),i=(o,s)=>Kr(n[o],n[s]);e.forEach(o=>o.sort(i))}r&&e.forEach(n=>n.reverse())}function cat(e){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...e,reduceIndex:e.reduce.bind(e)}}function lat(e){return{reduceIndex(t,r,n){return e(vb(r,t),n)}}}function sl(e){return{reduceIndex(t,r){return e(t,n=>r[n])}}}function DV(e){return{reduceIndex(t,r){let n=e(t,i=>r[i]);return lr(r)?new Date(n):n}}}var MI={reduceIndex(e,t){return vb(t,e)}},EI={reduceIndex(e,t){return t[e[0]]}},uat={reduceIndex(e,t){let n=Hs(ds(e,o=>o.length,o=>t[o]),bu),i=n.slice(-5).reverse();if(i.length<n.length){let o=n.slice(0,-4);i[4]=[`\u2026 ${o.length.toLocaleString("en-US")} more`,gn(o,bu)]}return i.map(([o,s])=>`${o} (${s.toLocaleString("en-US")})`).join(`
|
|
25
|
+
`)}},fat={reduceIndex(e,t){return t[e[e.length-1]]}},Ib={label:"Frequency",reduceIndex(e){return e.length}},dat={label:"Distinct",reduceIndex(e,t){let r=new Xn;for(let n of e)r.add(t[n]);return r.size}},hat=sl(gn);function BV(e,t){return e==null?{scope:t,label:"Frequency",reduceIndex:(r,n,i=1)=>r.length/i}:{scope:t,reduceIndex:(r,n,i=1)=>gn(r,o=>n[o])/i}}var pat={reduceIndex(e,t,{x:r}){return r}},mat={reduceIndex(e,t,{y:r}){return r}};function LV(e){if(typeof e!="function")throw new Error(`invalid test function: ${e}`);return{reduceIndex(t,r,{data:n}){return r[t.find(i=>e(n[i],i,n))]}}}function Bp(e,{scale:t,type:r,value:n,filter:i,hint:o,label:s=vn(n)},a){return o===void 0&&typeof n?.transform=="function"&&(o=n.hint),GN(a,{scale:t,type:r,value:Tt(e,n),label:s,filter:i,hint:o})}function DI(e,t){return Object.fromEntries(Object.entries(e).map(([r,n])=>[r,Bp(t,n,r)]))}function Op(e,t){let r=Object.fromEntries(Object.entries(e).map(([n,{scale:i,value:o}])=>{let s=i==null?null:t[i];return[n,s==null?o:fe(o,s)]}));return r.channels=e,r}function GN(e,t){let{scale:r,value:n}=t;if(r===!0||r==="auto")switch(e){case"fill":case"stroke":case"color":t.scale=r!==!0&&_I(n,wu)?null:"color";break;case"fillOpacity":case"strokeOpacity":case"opacity":t.scale=r!==!0&&_I(n,gV)?null:"opacity";break;case"symbol":r!==!0&&_I(n,SV)?(t.scale=null,t.value=fe(n,Ep)):t.scale="symbol";break;default:t.scale=Fe.has(e)?e:null;break}else if(r===!1)t.scale=null;else if(r!=null&&!Fe.has(r))throw new Error(`unknown scale: ${r}`);return t}function kV(e,t,r,n,i){let{order:o,reverse:s,reduce:a=!0,limit:c}=i;for(let l in i){if(!Fe.has(l))continue;let{value:u,order:f=o,reverse:d=s,reduce:h=a,limit:p=c}=Mo(i[l]),y=u?.startsWith("-");if(y&&(u=u.slice(1)),f=f===void 0?y!==(u==="width"||u==="height")?UV:CV:bat(f),h==null||h===!1)continue;let g=l==="fx"||l==="fy"?gat(t,n[l]):yat(r,l);if(!g)throw new Error(`missing channel for scale: ${l}`);let m=g.value,[b=0,x=1/0]=oi(p)?p:p<0?[p]:[0,p];if(u==null)g.domain=()=>{let _=Array.from(new Xn(m));return d&&(_=_.reverse()),(b!==0||x!==1/0)&&(_=_.slice(b,x)),_};else{let _=u==="data"?e:u==="height"?RV(r,"y1","y2"):u==="width"?RV(r,"x1","x2"):WN(r,u,u==="y"?"y2":u==="x"?"x2":void 0),v=Dp(h===!0?"max":h,_);g.domain=()=>{let w=vD(ii(m),I=>v.reduceIndex(I,_),I=>m[I]);return f&&w.sort(f),d&&w.reverse(),(b!==0||x!==1/0)&&(w=w.slice(b,x)),w.map(el)}}}}function yat(e,t){for(let r in e){let n=e[r];if(n.scale===t)return n}}function gat(e,t){let r=e.original;if(r===e)return t;let n=t.value,i=t.value=[];for(let o=0;o<r.length;++o){let s=n[r[o][0]];for(let a of e[o])i[a]=s}return t}function RV(e,t,r){let n=WN(e,t),i=WN(e,r);return fe(i,(o,s)=>Math.abs(o-n[s]),Float64Array)}function WN(e,t,r){let n=e[t];if(!n&&r!==void 0&&(n=e[r]),n)return n.value;throw new Error(`missing channel: ${t}`)}function bat(e){if(e==null||typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"ascending":return CV;case"descending":return UV}throw new Error(`invalid order: ${e}`)}function CV([e,t],[r,n]){return Kr(t,n)||Kr(e,r)}function UV([e,t],[r,n]){return id(t,n)||Kr(e,r)}function Eb(e,t){let r=e[t];if(r){for(;r.source;)r=r.source;return r.source===null?null:r}}function BI(e){let t,r;return(...n)=>((r?.length!==n.length||r.some((i,o)=>i!==n[o]))&&(r=n,t=e(...n)),t)}var xat=BI(e=>new Intl.NumberFormat(e)),_at=BI((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{month:t}})),wat=BI((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{weekday:t}}));function vat(e="en-US"){let t=xat(e);return r=>r!=null&&!isNaN(r)?t.format(r):void 0}function PV(e="en-US",t="short"){let r=_at(e,t);return n=>n!=null&&!isNaN(n=+new Date(Date.UTC(2e3,+n)))?r.format(n):void 0}function $V(e="en-US",t="short"){let r=wat(e,t);return n=>n!=null&&!isNaN(n=+new Date(Date.UTC(2001,0,+n)))?r.format(n):void 0}function XN(e){return bp(e,"Invalid Date")}function Sat(e="en-US"){let t=vat(e);return r=>(r instanceof Date?XN:typeof r=="number"?t:vr)(r)}var gs=Sat();var HN=0,ZN;function zV(){let e=HN;return HN=0,ZN=void 0,e}function kn(e){e!==ZN&&(ZN=e,console.warn(e),++HN)}var ur=(typeof window<"u"?window.devicePixelRatio>1:typeof it>"u")?0:.5,Iat=0;function OI(){return`plot-clip-${++Iat}`}function NI(e,{title:t,href:r,ariaLabel:n,ariaDescription:i,ariaHidden:o,target:s,fill:a,fillOpacity:c,stroke:l,strokeWidth:u,strokeOpacity:f,strokeLinejoin:d,strokeLinecap:h,strokeMiterlimit:p,strokeDasharray:y,strokeDashoffset:g,opacity:m,mixBlendMode:b,imageFilter:x,paintOrder:_,pointerEvents:v,shapeRendering:w,channels:I},{ariaLabel:D,fill:A="currentColor",fillOpacity:B,stroke:M="none",strokeOpacity:O,strokeWidth:R,strokeLinecap:S,strokeLinejoin:T,strokeMiterlimit:E,paintOrder:C}){A===null&&(a=null,c=null),M===null&&(l=null,f=null),Se(A)?!Se(M)&&(!Se(a)||I?.fill)&&(M="none"):Se(M)&&(!Se(l)||I?.stroke)&&(A="none");let[U,k]=cr(a,A),[$,z]=Ae(c,B),[V,Q]=cr(l,M),[nt,st]=Ae(f,O),[ut,X]=Ae(m);ol(Q)||(u===void 0&&(u=R),h===void 0&&(h=S),d===void 0&&(d=T),p===void 0&&!bV(d)&&(p=E),!ol(k)&&_===void 0&&(_=C));let[at,q]=Ae(u);return A!==null&&(e.fill=Ne(k,"currentColor"),e.fillOpacity=Db(z,1)),M!==null&&(e.stroke=Ne(Q,"none"),e.strokeWidth=Db(q,1),e.strokeOpacity=Db(st,1),e.strokeLinejoin=Ne(d,"miter"),e.strokeLinecap=Ne(h,"butt"),e.strokeMiterlimit=Db(p,4),e.strokeDasharray=Ne(y,"none"),e.strokeDashoffset=Ne(g,"0")),e.target=vr(s),e.ariaLabel=vr(D),e.ariaDescription=vr(i),e.ariaHidden=vr(o),e.opacity=Db(X,1),e.mixBlendMode=Ne(b,"normal"),e.imageFilter=Ne(x,"none"),e.paintOrder=Ne(_,"normal"),e.pointerEvents=Ne(v,"auto"),e.shapeRendering=Ne(w,"auto"),{title:{value:t,optional:!0,filter:null},href:{value:r,optional:!0,filter:null},ariaLabel:{value:n,optional:!0,filter:null},fill:{value:U,scale:"auto",optional:!0},fillOpacity:{value:$,scale:"auto",optional:!0},stroke:{value:V,scale:"auto",optional:!0},strokeOpacity:{value:nt,scale:"auto",optional:!0},strokeWidth:{value:at,optional:!0},opacity:{value:ut,scale:"auto",optional:!0}}}function Tat(e,t){t&&e.filter(r=>gb(t[r])).append("title").call(Mat,t)}function Aat(e,t){t&&e.filter(([r])=>gb(t[r])).append("title").call(Eat,t)}function Mat(e,t){t&&e.text(r=>gs(t[r]))}function Eat(e,t){t&&e.text(([r])=>gs(t[r]))}function ye(e,{target:t,tip:r},{ariaLabel:n,title:i,fill:o,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:l,opacity:u,href:f}){n&&yt(e,"aria-label",d=>n[d]),o&&yt(e,"fill",d=>o[d]),s&&yt(e,"fill-opacity",d=>s[d]),a&&yt(e,"stroke",d=>a[d]),c&&yt(e,"stroke-opacity",d=>c[d]),l&&yt(e,"stroke-width",d=>l[d]),u&&yt(e,"opacity",d=>u[d]),f&&VV(e,d=>f[d],t),r||Tat(e,i)}function fd(e,{target:t,tip:r},{ariaLabel:n,title:i,fill:o,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:l,opacity:u,href:f}){n&&yt(e,"aria-label",([d])=>n[d]),o&&yt(e,"fill",([d])=>o[d]),s&&yt(e,"fill-opacity",([d])=>s[d]),a&&yt(e,"stroke",([d])=>a[d]),c&&yt(e,"stroke-opacity",([d])=>c[d]),l&&yt(e,"stroke-width",([d])=>l[d]),u&&yt(e,"opacity",([d])=>u[d]),f&&VV(e,([d])=>f[d],t),r||Aat(e,i)}function Dat({ariaLabel:e,title:t,fill:r,fillOpacity:n,stroke:i,strokeOpacity:o,strokeWidth:s,opacity:a,href:c},{tip:l}){return[e,l?void 0:t,r,n,i,o,s,a,c].filter(u=>u!==void 0)}function Bb(e,t,r){let n=Gr(e,i=>t[i]);return r===void 0&&n.size>1+e.length>>1&&kn("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."),n.values()}function*FI(e,t,r,n){let{z:i}=r,{z:o}=n,s=Dat(n,r),a=[...t,...s];for(let c of o?Bb(e,o,i):[e]){let l,u;t:for(let f of c){for(let d of a)if(!wr(d[f])){u&&u.push(-1);continue t}if(l===void 0){u&&(yield u),l=s.map(d=>nl(d[f])),u=[f];continue}u.push(f);for(let d=0;d<s.length;++d)if(nl(s[d][f])!==l[d]){yield u,l=s.map(p=>nl(p[f])),u=[f];continue t}}u&&(yield u)}}function LI(e){return e===!0?e="frame":e===!1?e=null:e!=null&&(e=Ur(e,"clip",["frame","sphere"])),e}function Bat(e,t,r,n){let i,{clip:o=n.clip}=t;switch(o){case"frame":{let{width:s,height:a,marginLeft:c,marginRight:l,marginTop:u,marginBottom:f}=r,d=OI();i=`url(#${d})`,e=pt("svg:g",n).call(h=>h.append("svg:clipPath").attr("id",d).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}=n;if(!s)throw new Error('the "sphere" clip option requires a projection');let a=OI();i=`url(#${a})`,e.append("clipPath").attr("id",a).append("path").attr("d",xn(s)({type:"Sphere"}));break}}yt(e,"aria-label",t.ariaLabel),yt(e,"aria-description",t.ariaDescription),yt(e,"aria-hidden",t.ariaHidden),yt(e,"clip-path",i)}function Kt(e,t,r,n){Bat(e,t,r,n),yt(e,"fill",t.fill),yt(e,"fill-opacity",t.fillOpacity),yt(e,"stroke",t.stroke),yt(e,"stroke-width",t.strokeWidth),yt(e,"stroke-opacity",t.strokeOpacity),yt(e,"stroke-linejoin",t.strokeLinejoin),yt(e,"stroke-linecap",t.strokeLinecap),yt(e,"stroke-miterlimit",t.strokeMiterlimit),yt(e,"stroke-dasharray",t.strokeDasharray),yt(e,"stroke-dashoffset",t.strokeDashoffset),yt(e,"shape-rendering",t.shapeRendering),yt(e,"filter",t.imageFilter),yt(e,"paint-order",t.paintOrder);let{pointerEvents:i=n.pointerSticky===!1?"none":void 0}=t;yt(e,"pointer-events",i)}function Gt(e,t){Oat(e,"mix-blend-mode",t.mixBlendMode),yt(e,"opacity",t.opacity)}function VV(e,t,r){e.each(function(n){let i=t(n);if(i!=null){let o=this.ownerDocument.createElementNS(bo.svg,"a");o.setAttribute("fill","inherit"),o.setAttributeNS(bo.xlink,"href",i),r!=null&&o.setAttribute("target",r),this.parentNode.insertBefore(o,this).appendChild(this)}})}function yt(e,t,r){r!=null&&e.attr(t,r)}function Oat(e,t,r){r!=null&&e.style(t,r)}function Pt(e,t,{x:r,y:n},i=ur,o=ur){i+=t.dx,o+=t.dy,r?.bandwidth&&(i+=r.bandwidth()/2),n?.bandwidth&&(o+=n.bandwidth()/2),(i||o)&&e.attr("transform",`translate(${i},${o})`)}function Ne(e,t){if((e=vr(e))!==t)return e}function Db(e,t){if((e=Wt(e))!==t)return e}var Nat=/^-?([_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 Np(e){if(e===void 0)return"plot-d6a7b5";if(e=`${e}`,!Nat.test(e))throw new Error(`invalid class name: ${e}`);return e}function Fp(e,t){if(typeof t=="string")e.property("style",t);else if(t!=null)for(let r of e)Object.assign(r.style,t)}function rn({frameAnchor:e},{width:t,height:r,marginTop:n,marginRight:i,marginBottom:o,marginLeft:s}){return[/left$/.test(e)?s:/right$/.test(e)?t-i:(s+t-i)/2,/^top/.test(e)?n:/^bottom/.test(e)?r-o:(n+r-o)/2]}function Tu(e={}){let{document:t=typeof window<"u"?window.document:void 0,clip:r}=e;return{document:t,clip:LI(r)}}function pt(e,{document:t}){return ae(kc(e).call(t.documentElement))}var qV=Math.PI,al=2*qV,jV=.618;function YV({projection:e,inset:t=0,insetTop:r=t,insetRight:n=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(Jr(e)){let v;if({type:e,domain:c,inset:v,insetTop:r=v!==void 0?v:r,insetRight:n=v!==void 0?v:n,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}=WV(e));let{width:u,height:f,marginLeft:d,marginRight:h,marginTop:p,marginBottom:y}=s,g=u-d-h-o-n,m=f-p-y-r-i;if(e=e?.({width:g,height:m,clip:l,...a}),e==null)return;l=Fat(l,d,p,u-h,f-y);let b=d+o,x=p+r,_;if(c!=null){let[[v,w],[I,D]]=xn(e).bounds(c),A=Math.min(g/(I-v),m/(D-w));A>0?(b-=(A*(v+I)-g)/2,x-=(A*(w+D)-m)/2,_=Gf({point(B,M){this.stream.point(B*A+b,M*A+x)}})):kn("Warning: the projection could not be fit to the specified domain; using the default scale.")}return _??=b===0&&x===0?GV():Gf({point(v,w){this.stream.point(v+b,w+x)}}),{stream:v=>e.stream(_.stream(l(v)))}}function WV(e){switch(`${e}`.toLowerCase()){case"albers-usa":return bs(XB,.7463,.4673);case"albers":return RI(D0,.7463,.4673);case"azimuthal-equal-area":return bs(ZB,4,4);case"azimuthal-equidistant":return bs(QB,al,al);case"conic-conformal":return RI(eO,al,al);case"conic-equal-area":return RI(cu,6.1702,2.9781);case"conic-equidistant":return RI(nO,7.312,3.6282);case"equal-earth":return bs(oO,5.4133,2.6347);case"equirectangular":return bs(rO,al,qV);case"gnomonic":return bs(aO,3.4641,3.4641);case"identity":return{type:GV};case"reflect-y":return{type:Lat};case"mercator":return bs(JB,al,al);case"orthographic":return bs(lO,2,2);case"stereographic":return bs(fO,2,2);case"transverse-mercator":return bs(hO,al,al);default:throw new Error(`unknown projection type: ${e}`)}}function Fat(e,t,r,n,i){if(e===!1||e==null||typeof e=="number")return o=>o;switch(e===!0&&(e="frame"),`${e}`.toLowerCase()){case"frame":return Zh(t,r,n,i);default:throw new Error(`unknown projection clip type: ${e}`)}}function bs(e,t,r){return{type:({width:n,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(n/t,i/r)),c.translate([n/2,i/2]),c},aspectRatio:r/t}}function RI(e,t,r){let{type:n,aspectRatio:i}=bs(e,t,r);return{type:o=>{let{parallels:s,domain:a,width:c,height:l}=o,u=n(o);return s!=null&&(u.parallels(s),a===void 0&&u.fitSize([c,l],{type:"Sphere"})),u},aspectRatio:i}}var GV=Qr({stream:e=>e}),Lat=Qr(Gf({point(e,t){this.stream.point(e,-t)}}));function KN(e,t,r,n){let i=r[e],o=r[t],s=i.length,a=r[e]=new Float64Array(s).fill(NaN),c=r[t]=new Float64Array(s).fill(NaN),l,u=n.stream({point(f,d){a[l]=f,c[l]=d}});for(l=0;l<s;++l)u.point(i[l],o[l])}function XV({projection:e}={}){return e==null?!1:typeof e.stream=="function"?!0:(Jr(e)&&(e=e.type),e!=null)}function HV(e){if(typeof e?.stream=="function")return jV;if(Jr(e)&&(e=e.type),e!=null){if(typeof e!="function"){let{aspectRatio:t}=WV(e);if(t)return t}return jV}}function Au(e,t,{projection:r}){let{x:n,y:i}=e,o={};return n&&(o.x=n),i&&(o.y=i),o=Op(o,t),r&&n?.scale==="x"&&i?.scale==="y"&&KN("x","y",o,r),n&&(o.x=Cr(o.x)),i&&(o.y=Cr(o.y)),o}function ZV(e){let t=[],r=[],n={scale:"x",value:t},i={scale:"y",value:r},o={point(s,a){t.push(s),r.push(a)},lineStart(){},lineEnd(){},polygonStart(){},polygonEnd(){},sphere(){}};for(let s of e.value)qi(s,o);return[n,i]}var Rat=["#4269d0","#efb118","#ff725c","#6cc5b0","#3ca951","#ff8ab7","#a463f2","#97bbf5","#9c6b4e","#9498a0"],ej=new Map([["accent",CO],["category10",kO],["dark2",UO],["observable10",Rat],["paired",PO],["pastel1",$O],["pastel2",zO],["set1",VO],["set2",jO],["set3",qO],["tableau10",YO]]);function rj(e){return e!=null&&ej.has(`${e}`.toLowerCase())}var KV=new Map([...ej,["brbg",cl(GS,XS)],["prgn",cl(HS,ZS)],["piyg",cl(KS,QS)],["puor",cl(JS,t2)],["rdbu",cl(Q0,cp)],["rdgy",cl(e2,r2)],["rdylbu",cl(J0,lp)],["rdylgn",cl(n2,i2)],["spectral",cl(o2,s2)],["burd",QV(Q0,cp)],["buylrd",QV(J0,lp)],["blues",nn(O2,N2)],["greens",nn(F2,L2)],["greys",nn(R2,k2)],["oranges",nn(z2,V2)],["purples",nn(C2,U2)],["reds",nn(P2,$2)],["turbo",ll(K2)],["viridis",ll(J2)],["magma",ll(tI)],["inferno",ll(eI)],["plasma",ll(rI)],["cividis",ll(j2)],["cubehelix",ll(q2)],["warm",ll(W2)],["cool",ll(G2)],["bugn",nn(a2,c2)],["bupu",nn(l2,u2)],["gnbu",nn(f2,d2)],["orrd",nn(h2,p2)],["pubu",nn(g2,b2)],["pubugn",nn(m2,y2)],["purd",nn(x2,_2)],["rdpu",nn(w2,v2)],["ylgn",nn(T2,A2)],["ylgnbu",nn(S2,I2)],["ylorbr",nn(M2,E2)],["ylorrd",nn(D2,B2)],["rainbow",JV(X2)],["sinebow",JV(Z2)]]);function nn(e,t){return({length:r})=>r===1?[e[3][1]]:r===2?[e[3][1],e[3][2]]:(r=Math.max(3,Math.floor(r)),r>9?En(t,r):e[r])}function cl(e,t){return({length:r})=>r===2?[e[3][0],e[3][2]]:(r=Math.max(3,Math.floor(r)),r>11?En(t,r):e[r])}function QV(e,t){return({length:r})=>r===2?[e[3][2],e[3][0]]:(r=Math.max(3,Math.floor(r)),r>11?En(n=>t(1-n),r):e[r].slice().reverse())}function ll(e){return({length:t})=>En(e,Math.max(2,Math.floor(t)))}function JV(e){return({length:t})=>En(e,Math.floor(t)+1).slice(0,-1)}function QN(e){let t=`${e}`.toLowerCase();if(!KV.has(t))throw new Error(`unknown ordinal scheme: ${t}`);return KV.get(t)}function Ob(e,t){let r=QN(e),n=typeof r=="function"?r({length:t}):r;return n.length!==t?n.slice(0,t):n}function nj(e,t="greys"){let r=new Set,[n,i]=Ob(t,2);for(let o of e)if(o!=null)if(o===!0)r.add(i);else if(o===!1)r.add(n);else return;return[...r]}var tj=new Map([["brbg",XS],["prgn",ZS],["piyg",QS],["puor",t2],["rdbu",cp],["rdgy",r2],["rdylbu",lp],["rdylgn",i2],["spectral",s2],["burd",e=>cp(1-e)],["buylrd",e=>lp(1-e)],["blues",N2],["greens",L2],["greys",k2],["purples",U2],["reds",$2],["oranges",V2],["turbo",K2],["viridis",J2],["magma",tI],["inferno",eI],["plasma",rI],["cividis",j2],["cubehelix",q2],["warm",W2],["cool",G2],["bugn",c2],["bupu",u2],["gnbu",d2],["orrd",p2],["pubugn",y2],["pubu",b2],["purd",_2],["rdpu",v2],["ylgnbu",I2],["ylgn",A2],["ylorbr",E2],["ylorrd",B2],["rainbow",X2],["sinebow",Z2]]);function Lp(e){let t=`${e}`.toLowerCase();if(!tj.has(t))throw new Error(`unknown quantitative scheme: ${t}`);return tj.get(t)}var kat=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function ij(e){return e!=null&&kat.has(`${e}`.toLowerCase())}var t3=e=>t=>e(1-t),JN=[0,1],oj=new Map([["number",Ze],["rgb",xo],["hsl",XD],["hcl",HD],["lab",Bv]]);function e3(e){let t=`${e}`.toLowerCase();if(!oj.has(t))throw new Error(`unknown interpolator: ${t}`);return oj.get(t)}function kp(e,t,r,{type:n,nice:i,clamp:o,zero:s,domain:a=hj(e,r),unknown:c,round:l,scheme:u,interval:f,range:d=Fe.get(e)===cd?$at(r,a):Fe.get(e)===ld?zat(r,a):Fe.get(e)===ud?JN:void 0,interpolate:h=Fe.get(e)===Hi?u==null&&d!==void 0?xo:Lp(u!==void 0?u:n==="cyclical"?"rainbow":"turbo"):l?Uf:Ze,reverse:p}){if(f=ba(f,n),(n==="cyclical"||n==="sequential")&&(n="linear"),typeof h!="function"&&(h=e3(h)),p=!!p,d!==void 0){let y=(a=Sr(a)).length,g=(d=Sr(d)).length;if(y!==g){if(h.length===1)throw new Error("invalid piecewise interpolator");h=Js(h,d),d=void 0}}if(h.length===1?(p&&(h=t3(h),p=!1),d===void 0&&(d=Float64Array.from(a,(y,g)=>g/(a.length-1)),d.length===2&&(d=JN)),t.interpolate((d===JN?Qr:Nb)(h))):t.interpolate(h),s){let[y,g]=Be(a);(y>0||g<0)&&(a=xu(a),tl(a)!==Math.sign(y)?a[a.length-1]=0:a[0]=0)}return p&&(a=Jl(a)),t.domain(a).unknown(c),i&&(t.nice(Cat(i,n)),a=t.domain()),d!==void 0&&t.range(d),o&&t.clamp(o),{type:n,domain:a,range:d,scale:t,interpolate:h,interval:f}}function Cat(e,t){return e===!0?void 0:typeof e=="number"?e:fV(e,t)}function sj(e,t,r){return kp(e,qc(),t,r)}function aj(e,t,r){return r3(e,t,{...r,exponent:.5})}function r3(e,t,{exponent:r=1,...n}){return kp(e,z0().exponent(r),t,{...n,type:"pow"})}function cj(e,t,{base:r=10,domain:n=Vat(t),...i}){return kp(e,P0().base(r),t,{...i,domain:n})}function lj(e,t,{constant:r=1,...n}){return kp(e,$0().constant(r),t,n)}function uj(e,t,{range:r,quantiles:n=r===void 0?5:(r=[...r]).length,n:i=n,scheme:o="rdylbu",domain:s=jat(t),unknown:a,interpolate:c,reverse:l}){return r===void 0&&(r=c!==void 0?En(c,i):Fe.get(e)===Hi?Ob(o,i):void 0),s.length>0&&(s=V0(s,r===void 0?{length:i}:r).quantiles()),kI(e,t,{domain:s,range:r,reverse:l,unknown:a})}function fj(e,t,{range:r,n=r===void 0?5:(r=[...r]).length,scheme:i="rdylbu",domain:o=hj(e,t),unknown:s,interpolate:a,reverse:c}){let[l,u]=Be(o),f;return r===void 0?(f=yn(l,u,n),f[0]<=l&&f.splice(0,1),f[f.length-1]>=u&&f.pop(),n=f.length+1,r=a!==void 0?En(a,n):Fe.get(e)===Hi?Ob(i,n):void 0):(f=En(Ze(l,u),n+1).slice(1,-1),l instanceof Date&&(f=f.map(d=>new Date(d)))),tl(Sr(o))<0&&f.reverse(),kI(e,t,{domain:f,range:r,reverse:c,unknown:s})}function kI(e,t,{domain:r=[0],unknown:n,scheme:i="rdylbu",interpolate:o,range:s=o!==void 0?En(o,r.length+1):Fe.get(e)===Hi?Ob(i,r.length+1):void 0,reverse:a}){r=Sr(r);let c=tl(r);if(!isNaN(c)&&!Uat(r,c))throw new Error(`the ${e} scale has a non-monotonic domain`);return a&&(s=Jl(s)),{type:"threshold",scale:j0(c<0?Jl(r):r,s===void 0?[]:s).unknown(n),domain:r,range:s}}function Uat(e,t){for(let r=1,n=e.length,i=e[0];r<n;++r){let o=Wn(i,i=e[r]);if(o!==0&&o!==t)return!1}return!0}function dj(e){return{type:"identity",scale:vV(Fe.get(e))?C0():t=>t}}function Rp(e,t=gp){return e.length?[Oe(e,({value:r})=>r===void 0?r:Oe(r,t)),de(e,({value:r})=>r===void 0?r:de(r,t))]:[0,1]}function hj(e,t){let r=Fe.get(e);return(r===cd||r===ud||r===ld?Pat:Rp)(t)}function Pat(e){return[0,e.length?de(e,({value:t})=>t===void 0?t:de(t,gp)):1]}function $at(e,t){let r=e.find(({radius:s})=>s!==void 0);if(r!==void 0)return[0,r.radius];let n=Hn(e,.5,({value:s})=>s===void 0?NaN:Hn(s,.25,ni)),i=t.map(s=>3*Math.sqrt(s/n)),o=30/de(i);return o<1?i.map(s=>s*o):i}function zat(e,t){let r=hs(e,({value:o})=>o===void 0?NaN:hs(o,Math.abs)),n=t.map(o=>12*o/r),i=60/de(n);return i<1?n.map(o=>o*i):n}function Vat(e){for(let{value:t}of e)if(t!==void 0)for(let r of t){if(r>0)return Rp(e,ni);if(r<0)return Rp(e,hu)}return[1,10]}function jat(e){let t=[];for(let{value:r}of e)if(r!==void 0)for(let n of r)t.push(n);return t}function Nb(e){return(t,r)=>n=>e(t+n*(r-t))}function CI(e,t,r,n,{type:i,nice:o,clamp:s,domain:a=Rp(n),unknown:c,pivot:l=0,scheme:u,range:f,symmetric:d=!0,interpolate:h=Fe.get(e)===Hi?u==null&&f!==void 0?xo:Lp(u!==void 0?u:"rdbu"):Ze,reverse:p}){l=+l,a=Sr(a);let[y,g]=a;if(a.length>2&&kn(`Warning: the diverging ${e} scale domain contains extra elements.`),Wn(y,g)<0&&([y,g]=[g,y],p=!p),y=Math.min(y,l),g=Math.max(g,l),typeof h!="function"&&(h=e3(h)),f!==void 0&&(h=h.length===1?Nb(h)(...f):Js(h,f)),p&&(h=t3(h)),d){let m=r.apply(l),b=m-r.apply(y),x=r.apply(g)-m;b<x?y=r.invert(m-x):b>x&&(g=r.invert(m+b))}return t.domain([y,l,g]).unknown(c).interpolator(h),s&&t.clamp(s),o&&t.nice(o),{type:i,domain:[y,g],pivot:l,interpolate:h,scale:t}}function pj(e,t,r){return CI(e,K0(),qat,t,r)}function mj(e,t,r){return n3(e,t,{...r,exponent:.5})}function n3(e,t,{exponent:r=1,...n}){return CI(e,WS().exponent(r=+r),Gat(r),t,{...n,type:"diverging-pow"})}function yj(e,t,{base:r=10,pivot:n=1,domain:i=Rp(t,n<0?hu:ni),...o}){return CI(e,qS().base(r=+r),Yat,t,{domain:i,pivot:n,...o})}function gj(e,t,{constant:r=1,...n}){return CI(e,YS().constant(r=+r),Xat(r),t,n)}var qat={apply(e){return e},invert(e){return e}},Yat={apply:Math.log,invert:Math.exp},Wat={apply(e){return Math.sign(e)*Math.sqrt(Math.abs(e))},invert(e){return Math.sign(e)*(e*e)}};function Gat(e){return e===.5?Wat:{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 Xat(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 bj(e,t,r,n){return kp(e,t,r,n)}function xj(e,t,r){return bj(e,zS(),t,r)}function _j(e,t,r){return bj(e,VS(),t,r)}var Cp=Symbol("ordinal");function vj(e,t,r,{type:n,interval:i,domain:o,range:s,reverse:a,hint:c}){return i=ba(i,n),o===void 0&&(o=Mj(r,i,e)),(n==="categorical"||n===Cp)&&(n="ordinal"),a&&(o=Jl(o)),o=t.domain(o).domain(),s!==void 0&&(typeof s=="function"&&(s=s(o)),t.range(s)),{type:n,domain:o,range:s,scale:t,hint:c,interval:i}}function Sj(e,t,{type:r,interval:n,domain:i,range:o,scheme:s,unknown:a,...c}){n=ba(n,r),i===void 0&&(i=Mj(t,n,e));let l;if(Fe.get(e)===Mp)l=Hat(t),o=o===void 0?Zat(l):fe(o,Ep);else if(Fe.get(e)===Hi&&(o===void 0&&(r==="ordinal"||r===Cp)&&(o=nj(i,s),o!==void 0&&(s=void 0)),s===void 0&&o===void 0&&(s=r==="ordinal"?"turbo":"observable10"),s!==void 0))if(o!==void 0){let u=Lp(s),f=o[0],d=o[1]-o[0];o=({length:h})=>En(p=>u(f+d*p),h)}else o=QN(s);if(a===R0)throw new Error(`implicit unknown on ${e} scale is not supported`);return vj(e,Hf().unknown(a),t,{...c,type:r,domain:i,range:o,hint:l})}function Ij(e,t,{align:r=.5,padding:n=.5,...i}){return Aj(_O().align(r).padding(n),t,i,e)}function Tj(e,t,{align:r=.5,padding:n=.1,paddingInner:i=n,paddingOuter:o=e==="fx"||e==="fy"?0:n,...s}){return Aj(uu().align(r).paddingInner(i).paddingOuter(o),t,s,e)}function Aj(e,t,r,n){let{round:i}=r;return i!==void 0&&e.round(i=!!i),e=vj(n,e,t,r),e.round=i,e}function Mj(e,t,r){let n=new Xn;for(let{value:i,domain:o}of e){if(o!==void 0)return o();if(i!==void 0)for(let s of i)n.add(s)}if(t!==void 0){let[i,o]=Be(n).map(t.floor,t);return t.range(i,t.offset(o))}if(n.size>1e4&&Fe.get(r)===Eo)throw new Error(`implicit ordinal domain of ${r} scale has more than 10,000 values`);return Hs(n,Kr)}function wj(e,t){let r;for(let{hint:n}of e){let i=n?.[t];if(i!==void 0){if(r===void 0)r=i;else if(r!==i)return}}return r}function Hat(e){return{fill:wj(e,"fill"),stroke:wj(e,"stroke")}}function Zat(e){return Se(e.fill)?QO:cI}function Fb(e,{label:t,inset:r=0,insetTop:n=r,insetRight:i=r,insetBottom:o=r,insetLeft:s=r,round:a,nice:c,clamp:l,zero:u,align:f,padding:d,projection:h,facet:{label:p=t}={},...y}={}){let g={};for(let[m,b]of e){let x=y[m],_=Rj(m,b,{round:Fe.get(m)===Eo?a:void 0,nice:c,clamp:l,zero:u,align:f,padding:d,projection:h,...x});if(_){let{label:v=m==="fx"||m==="fy"?p:t,percent:w,transform:I,inset:D,insetTop:A=D!==void 0?D:m==="y"?n:0,insetRight:B=D!==void 0?D:m==="x"?i:0,insetBottom:M=D!==void 0?D:m==="y"?o:0,insetLeft:O=D!==void 0?D:m==="x"?s:0}=x||{};if(I==null)I=void 0;else if(typeof I!="function")throw new Error("invalid scale transform; not a function");_.percent=!!w,_.label=v===void 0?Kat(b,_):v,_.transform=I,m==="x"||m==="fx"?(_.insetLeft=+O,_.insetRight=+B):(m==="y"||m==="fy")&&(_.insetTop=+A,_.insetBottom=+M),g[m]=_}}return g}function o3(e){let t={},r={scales:t};for(let[n,i]of Object.entries(e)){let{scale:o,type:s,interval:a,label:c}=i;t[n]=Cj(i),r[n]=o,o.type=s,a!=null&&(o.interval=a),c!=null&&(o.label=c)}return r}function Nj(e,t){let{x:r,y:n,fx:i,fy:o}=e,s=i||o?$I(t):t;i&&Ej(i,s),o&&Dj(o,s);let a=i||o?s3(e,t):t;r&&Ej(r,a),n&&Dj(n,a)}function Kat(e=[],t){let r;for(let{label:n}of e)if(n!==void 0){if(r===void 0)r=n;else if(r!==n)return}if(r!==void 0)return!wa(t)&&t.percent&&(r=`${r} (%)`),{inferred:!0,toString:()=>r}}function PI(e){return Math.sign(tl(e.domain()))*Math.sign(tl(e.range()))}function $I(e){let{marginTop:t,marginRight:r,marginBottom:n,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(r,c),marginBottom:Math.max(n,l),marginLeft:Math.max(i,u),width:o,height:s}}function s3({fx:e,fy:t},r){let{marginTop:n,marginRight:i,marginBottom:o,marginLeft:s,width:a,height:c}=$I(r);return{marginTop:n,marginRight:i,marginBottom:o,marginLeft:s,width:e?e.scale.bandwidth()+s+i:a,height:t?t.scale.bandwidth()+n+o:c,facet:{width:a,height:c}}}function Ej(e,t){if(e.range===void 0){let{insetLeft:r,insetRight:n}=e,{width:i,marginLeft:o=0,marginRight:s=0}=t,a=o+r,c=i-s-n;e.range=[a,Math.max(a,c)],wa(e)||(e.range=Lj(e)),e.scale.range(e.range)}Fj(e)}function Dj(e,t){if(e.range===void 0){let{insetTop:r,insetBottom:n}=e,{height:i,marginTop:o=0,marginBottom:s=0}=t,a=o+r,c=i-s-n;e.range=[Math.max(a,c),a],wa(e)?e.range.reverse():e.range=Lj(e),e.scale.range(e.range)}Fj(e)}function Fj(e){e.round===void 0&&tct(e)&&Qat(e)<=30&&e.scale.round(!0)}function Qat({scale:e}){let t=e.domain().length,[r,n]=e.range(),i=e.paddingInner?e.paddingInner():1,o=e.paddingOuter?e.paddingOuter():e.padding(),s=t-i,a=Math.abs(n-r)/Math.max(1,s+o*2);return(a-Math.floor(a))*s}function Lj(e){let t=e.scale.domain().length+a3(e);if(!(t>2))return e.range;let[r,n]=e.range;return Array.from({length:t},(i,o)=>r+o/(t-1)*(n-r))}function zI(e,t,r){return Rj(e,r===void 0?void 0:[{hint:r}],{...t})}function Rj(e,t=[],r={}){let n=Jat(e,t,r);if(r.type===void 0&&r.domain===void 0&&r.range===void 0&&r.interval==null&&e!=="fx"&&e!=="fy"&&wa({type:n})){let i=t.map(({value:o})=>o).filter(o=>o!==void 0);i.some(lr)?kn(`Warning: some data associated with the ${e} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${Up(n)}" 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 "${Up(n)}".`):i.some(mV)?kn(`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 "${Up(n)}" 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 "${Up(n)}".`):i.some(yV)&&kn(`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 "${Up(n)}" 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 "${Up(n)}".`)}switch(r.type=n,n){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":r=UI(t,r,Cr);break;case"identity":switch(Fe.get(e)){case Eo:r=UI(t,r,Cr);break;case Mp:r=UI(t,r,ect);break}break;case"utc":case"time":r=UI(t,r,uV);break}switch(n){case"diverging":return pj(e,t,r);case"diverging-sqrt":return mj(e,t,r);case"diverging-pow":return n3(e,t,r);case"diverging-log":return yj(e,t,r);case"diverging-symlog":return gj(e,t,r);case"categorical":case"ordinal":case Cp:return Sj(e,t,r);case"cyclical":case"sequential":case"linear":return sj(e,t,r);case"sqrt":return aj(e,t,r);case"threshold":return kI(e,t,r);case"quantile":return uj(e,t,r);case"quantize":return fj(e,t,r);case"pow":return r3(e,t,r);case"log":return cj(e,t,r);case"symlog":return lj(e,t,r);case"utc":return _j(e,t,r);case"time":return xj(e,t,r);case"point":return Ij(e,t,r);case"band":return Tj(e,t,r);case"identity":return dj(e);case void 0:return;default:throw new Error(`unknown scale type: ${n}`)}}function Up(e){return typeof e=="symbol"?e.description:e}function Bj(e){return typeof e=="string"?`${e}`.toLowerCase():e}var Oj={toString:()=>"projection"};function Jat(e,t,{type:r,domain:n,range:i,scheme:o,pivot:s,projection:a}){if(r=Bj(r),e==="fx"||e==="fy")return"band";(e==="x"||e==="y")&&a!=null&&(r=Oj);for(let l of t){let u=Bj(l.type);if(u!==void 0){if(r===void 0)r=u;else if(r!==u)throw new Error(`scale incompatible with channel: ${r} !== ${u}`)}}if(r===Oj)return;if(r!==void 0)return r;if(n===void 0&&!t.some(({value:l})=>l!==void 0))return;let c=Fe.get(e);if(c===cd)return"sqrt";if(c===ud||c===ld)return"linear";if(c===Mp)return"ordinal";if((n||i||[]).length>2)return i3(c);if(n!==void 0){if(ir(n))return i3(c);if(lr(n))return"utc"}else{let l=t.map(({value:u})=>u).filter(u=>u!==void 0);if(l.some(ir))return i3(c);if(l.some(lr))return"utc"}if(c===Hi){if(s!=null||ij(o))return"diverging";if(rj(o))return"categorical"}return"linear"}function i3(e){switch(e){case Eo:return"point";case Hi:return Cp;default:return"ordinal"}}function wa({type:e}){return e==="ordinal"||e==="point"||e==="band"||e===Cp}function a3({type:e}){return e==="threshold"}function tct({type:e}){return e==="point"||e==="band"}function si(e){if(e===void 0)return!0;let t=e.domain(),r=e(t[0]);for(let n=1,i=t.length;n<i;++n)if(e(t[n])-r)return!1;return!0}function UI(e,{domain:t,...r},n){for(let i of e)i.value!==void 0&&(t===void 0&&(t=i.value?.domain),i.value=n(i.value));return{domain:t===void 0?t:n(t),...r}}function ect(e){return fe(e,Ep)}function Pp(e={}){let t;for(let r in e)if(Fe.has(r)&&ya(e[r])){if(t!==void 0)throw new Error("ambiguous scale definition; multiple scales found");t=Cj(zI(r,e[r]))}if(t===void 0)throw new Error("invalid scale definition; no scale found");return t}function kj(e){return t=>{if(!Fe.has(t=`${t}`))throw new Error(`unknown scale: ${t}`);return e[t]}}function Cj({scale:e,type:t,domain:r,range:n,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:xu(r),...n!==void 0&&{range:xu(n)},...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 Pj(e,t,r={}){let n=.5-ur,i=.5+ur,o=.5+ur,s=.5-ur;for(let{marginTop:y,marginRight:g,marginBottom:m,marginLeft:b}of t)y>n&&(n=y),g>i&&(i=g),m>o&&(o=m),b>s&&(s=b);let{margin:a,marginTop:c=a!==void 0?a:n,marginRight:l=a!==void 0?a:i,marginBottom:u=a!==void 0?a:o,marginLeft:f=a!==void 0?a:s}=r;c=+c,l=+l,u=+u,f=+f;let{width:d=640,height:h=rct(e,r,{width:d,marginTopDefault:n,marginRightDefault:i,marginBottomDefault:o,marginLeftDefault:s})+Math.max(0,c-n+u-o)}=r;d=+d,h=+h;let p={width:d,height:h,marginTop:c,marginRight:l,marginBottom:u,marginLeft:f};if(e.fx||e.fy){let{margin:y,marginTop:g=y!==void 0?y:c,marginRight:m=y!==void 0?y:l,marginBottom:b=y!==void 0?y:u,marginLeft:x=y!==void 0?y:f}=r.facet??{};g=+g,m=+m,b=+b,x=+x,p.facet={marginTop:g,marginRight:m,marginBottom:b,marginLeft:x}}return p}function rct({x:e,y:t,fy:r,fx:n},{projection:i,aspectRatio:o},{width:s,marginTopDefault:a,marginRightDefault:c,marginBottomDefault:l,marginLeftDefault:u}){let f=r?r.scale.domain().length:1,d=HV(i);if(d){let p=n?n.scale.domain().length:1,y=(1.1*f-.1)/(1.1*p-.1)*d,g=Math.max(.1,Math.min(10,y));return Math.round((s-u-c)*g+a+l)}let h=t?wa(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=Uj("y",t)/(Uj("x",e)*o),y=n?n.scale.bandwidth():1,g=r?r.scale.bandwidth():1,m=y*(s-u-c)-e.insetLeft-e.insetRight;return(p*m+t.insetTop+t.insetBottom)/g+a+l}return!!(t||r)*Math.max(1,Math.min(60,h*f))*20+!!n*30+60}function Uj(e,t){if(!t)throw new Error(`aspectRatio requires ${e} scale`);let{type:r,domain:n}=t,i;switch(r){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 n.length;default:throw new Error(`unsupported ${e} scale for aspectRatio: ${r}`)}let[o,s]=Be(n);return Math.abs(i(s)-i(o))}function zj(e,t){let{fx:r,fy:n}=Fb(e,t),i=r?.scale.domain(),o=n?.scale.domain();return i&&o?iv(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 Vj(e,{x:t,y:r}){return t&&=d3(t),r&&=d3(r),e.filter(t&&r?n=>t.has(n.x)&&r.has(n.y):t?n=>t.has(n.x):n=>r.has(n.y)).sort(t&&r?(n,i)=>t.get(n.x)-t.get(i.x)||r.get(n.y)-r.get(i.y):t?(n,i)=>t.get(n.x)-t.get(i.x):(n,i)=>r.get(n.y)-r.get(i.y))}function jI(e,{fx:t,fy:r}){let n=ii(e),i=t?.value,o=r?.value;return t&&r?ds(n,s=>(s.fx=i[s[0]],s.fy=o[s[0]],s),s=>i[s],s=>o[s]):t?ds(n,s=>(s.fx=i[s[0]],s),s=>i[s]):ds(n,s=>(s.fy=o[s[0]],s),s=>o[s])}function jj(e,t,{marginTop:r,marginLeft:n}){return e&&t?({x:i,y:o})=>`translate(${e(i)-n},${t(o)-r})`:e?({x:i})=>`translate(${e(i)-n},0)`:({y:i})=>`translate(0,${t(i)-r})`}function qj(e){let t=[],r=new Uint32Array(gn(e,n=>n.length));for(let n of e){let i=0;for(let o of e)n!==o&&(r.set(o,i),i+=o.length);t.push(r.slice(0,i))}return t}var nct=new Map([["top",c3],["right",f3],["bottom",l3],["left",u3],["top-left",VI(c3,u3)],["top-right",VI(c3,f3)],["bottom-left",VI(l3,u3)],["bottom-right",VI(l3,f3)],["top-empty",oct],["right-empty",cct],["bottom-empty",sct],["left-empty",act],["empty",lct]]);function Yj(e){if(e==null)return null;let t=nct.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid facet anchor: ${e}`)}var $j=new WeakMap;function d3(e){let t=$j.get(e);return t||$j.set(e,t=new Gn(fe(e,(r,n)=>[r,n]))),t}function Mu(e,t){return d3(e).get(t)}function ict(e,t,r){return t=nl(t),r=nl(r),e.find(n=>Object.is(nl(n.x),t)&&Object.is(nl(n.y),r))}function qI(e,t,r){return ict(e,t,r)?.empty}function c3(e,{y:t},{y:r}){return t?Mu(t,r)===0:!0}function l3(e,{y:t},{y:r}){return t?Mu(t,r)===t.length-1:!0}function u3(e,{x:t},{x:r}){return t?Mu(t,r)===0:!0}function f3(e,{x:t},{x:r}){return t?Mu(t,r)===t.length-1:!0}function oct(e,{y:t},{x:r,y:n,empty:i}){if(i)return!1;if(!t)return;let o=Mu(t,n);if(o>0)return qI(e,r,t[o-1])}function sct(e,{y:t},{x:r,y:n,empty:i}){if(i)return!1;if(!t)return;let o=Mu(t,n);if(o<t.length-1)return qI(e,r,t[o+1])}function act(e,{x:t},{x:r,y:n,empty:i}){if(i)return!1;if(!t)return;let o=Mu(t,r);if(o>0)return qI(e,t[o-1],n)}function cct(e,{x:t},{x:r,y:n,empty:i}){if(i)return!1;if(!t)return;let o=Mu(t,r);if(o<t.length-1)return qI(e,t[o+1],n)}function lct(e,t,{empty:r}){return r}function VI(e,t){return function(){return e.apply(null,arguments)&&t.apply(null,arguments)}}function YI(e,{channels:{fx:t,fy:r},groups:n}){return t&&r?e.map(({x:i,y:o})=>n.get(i)?.get(o)??[]):t?e.map(({x:i})=>n.get(i)??[]):e.map(({y:i})=>n.get(i)??[])}var Ft=class{constructor(t,r={},n={},i){let{facet:o="auto",facetAnchor:s,fx:a,fy:c,sort:l,dx:u=0,dy:f=0,margin:d=0,marginTop:h=d,marginRight:p=d,marginBottom:y=d,marginLeft:g=d,clip:m=i?.clip,channels:b,tip:x,render:_}=n;if(this.data=t,this.sort=ga(l)?l:null,this.initializer=Qe(n).initializer,this.transform=this.initializer?n.transform:en(n).transform,o===null||o===!1?this.facet=null:(this.facet=Ur(o===!0?"include":o,"facet",["auto","include","exclude","super"]),this.fx=t===gu&&typeof a=="string"?[a]:a,this.fy=t===gu&&typeof c=="string"?[c]:c),this.facetAnchor=Yj(s),r=Sb(r),b!==void 0&&(r={...uct(b),...r}),i!==void 0&&(r={...NI(this,n,i),...r}),this.channels=Object.fromEntries(Object.entries(r).map(([v,w])=>{if(Xi(w.value)){let{value:I,label:D=w.label,scale:A=w.scale}=w.value;w={...w,label:D,scale:A,value:I}}if(t===gu&&typeof w.value=="string"){let{value:I}=w;w={...w,value:[I]}}return[v,w]}).filter(([v,{value:w,optional:I}])=>{if(w!=null)return!0;if(I)return!1;throw new Error(`missing channel value: ${v}`)})),this.dx=+u,this.dy=+f,this.marginTop=+h,this.marginRight=+p,this.marginBottom=+y,this.marginLeft=+g,this.clip=LI(m),this.tip=fct(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:w}=r[v];if(!(w!=="x"&&w!=="y"))throw new Error("super-faceting cannot use x or y")}}_!=null&&(this.render=$p(_,this.render))}initialize(t,r,n){let i=Sr(this.data);t===void 0&&i!=null&&(t=[ii(i)]);let o=t;this.transform!=null&&({facets:t,data:i}=this.transform(i,t,n),i=Sr(i)),t!==void 0&&(t.original=o);let s=DI(this.channels,i);return this.sort!=null&&kV(i,t,s,r,this.sort),{data:i,facets:t,channels:s}}filter(t,r,n){for(let i in r){let{filter:o=wr}=r[i];if(o!==null){let s=n[i];t=t.filter(a=>o(s[a]))}}return t}project(t,r,n){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"&&KN(i,o,r,n.projection)}}scale(t,r,n){let i=Op(t,r);return n.projection&&this.project(t,i,n),i}};function Pr(...e){return e.plot=Ft.prototype.plot,e}function $p(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(r,n,i,o,s,a){return e.call(this,r,n,i,o,s,(c,l,u,f,d)=>t.call(this,c,l,u,f,d,a))}}function uct(e){return Object.fromEntries(Object.entries(Sb(e)).map(([t,r])=>(r=typeof r=="string"?{value:r,label:t}:Mo(r),r.filter===void 0&&r.scale==null&&(r={...r,filter:null}),[t,r])))}function fct(e){return e===!0?"xy":e===!1||e==null?null:typeof e=="string"?Ur(e,"tip",["x","y","xy"]):e}function xs(e,t){return e?.tip===!0?{...e,tip:t}:Jr(e?.tip)&&e.tip.pointer===void 0?{...e,tip:{...e.tip,pointer:t}}:e}var Wj=new WeakMap;function h3(e,t,{x:r,y:n,px:i,py:o,maxRadius:s=40,channels:a,render:c,...l}={}){return s=+s,i!=null&&(r??=null,a={...a,px:{value:i,scale:"x"}}),o!=null&&(n??=null,a={...a,py:{value:o,scale:"y"}}),{x:r,y:n,channels:a,...l,render:$p(function(u,f,d,h,p,y){p={...p,pointerSticky:!1};let g=p.ownerSVGElement,{data:m}=p.getMarkState(this),b=Wj.get(g);b||Wj.set(g,b={sticky:!1,roots:[],renders:[]});let x=b.renders.push(Q)-1,{x:_,y:v,fx:w,fy:I}=f,D=w?w(u.fx)-h.marginLeft:0,A=I?I(u.fy)-h.marginTop:0;_?.bandwidth&&(D+=_.bandwidth()/2),v?.bandwidth&&(A+=v.bandwidth()/2);let B=u.fi!=null,M;if(B){let X=b.facetStates;X||(b.facetStates=X=new Map),M=X.get(this),M||X.set(this,M=new Map)}let[O,R]=rn(this,h),{px:S,py:T}=d,E=S?X=>S[X]:p3(d,O),C=T?X=>T[X]:m3(d,R),U,k,$,z;function V(X,at){if(B)if(z&&(z=cancelAnimationFrame(z)),X==null)M.delete(u.fi);else{M.set(u.fi,at),z=requestAnimationFrame(()=>{z=null;for(let[q,J]of M)if(J<at||J===at&&q<u.fi){X=null;break}Q(X)});return}Q(X)}function Q(X){if(U===X&&$===b.sticky)return;U=X,$=p.pointerSticky=b.sticky;let at=U==null?[]:[U];B&&(at.fx=u.fx,at.fy=u.fy,at.fi=u.fi);let q=y(at,f,d,h,p);if(k){if(B){let J=k.parentNode,ct=k.getAttribute("transform"),j=q.getAttribute("transform");ct?q.setAttribute("transform",ct):q.removeAttribute("transform"),j?J.setAttribute("transform",j):J.removeAttribute("transform"),q.removeAttribute("aria-label"),q.removeAttribute("aria-description"),q.removeAttribute("aria-hidden")}k.replaceWith(q)}return b.roots[x]=k=q,U==null&&M?.size>1||p.dispatchValue(U==null?null:m[U]),q}function nt(X){if(b.sticky||X.pointerType==="mouse"&&X.buttons===1)return;let[at,q]=Mn(X);at-=D,q-=A;let J=at<h.marginLeft||at>h.width-h.marginRight?1:e,ct=q<h.marginTop||q>h.height-h.marginBottom?1:t,j=null,Qt=s*s;for(let gt of u){let he=J*(E(gt)-at),pe=ct*(C(gt)-q),ot=he*he+pe*pe;ot<=Qt&&(j=gt,Qt=ot)}if(j!=null&&(e!==1||t!==1)){let gt=E(j)-at,he=C(j)-q;Qt=gt*gt+he*he}V(j,Qt)}function st(X){X.pointerType==="mouse"&&U!=null&&(b.sticky&&b.roots.some(at=>at?.contains(X.target))||(b.sticky?(b.sticky=!1,b.renders.forEach(at=>at(null))):(b.sticky=!0,Q(U)),X.stopImmediatePropagation()))}function ut(X){X.pointerType==="mouse"&&(b.sticky||V(null))}return g.addEventListener("pointerenter",nt),g.addEventListener("pointermove",nt),g.addEventListener("pointerdown",st),g.addEventListener("pointerleave",ut),Q(null)},c)}}function zp(e){return h3(1,1,e)}function Vp(e){return h3(1,.01,e)}function dd(e){return h3(.01,1,e)}function p3({x1:e,x2:t,x:r=e},n){return e&&t?i=>(e[i]+t[i])/2:r?i=>r[i]:()=>n}function m3({y1:e,y2:t,y:r=e},n){return e&&t?i=>(e[i]+t[i])/2:r?i=>r[i]:()=>n}function WI(e){return wa(e)&&e.interval===void 0?void 0:"tabular-nums"}function Gj(e,t){let{label:r=e.label,tickSize:n=6,width:i=240,height:o=44+n,marginTop:s=18,marginRight:a=0,marginBottom:c=16+n,marginLeft:l=0,style:u,ticks:f=(i-l-a)/64,tickFormat:d,fontVariant:h=WI(e),round:p=!0,opacity:y,className:g}=t,m=Tu(t);g=Np(g),y=Ae(y)[1],d===null&&(d=()=>null);let b=pt("svg",m).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) {
|
|
17
26
|
display: block;
|
|
18
27
|
height: auto;
|
|
19
28
|
height: intrinsic;
|
|
@@ -22,9 +31,9 @@ ${n}`}function ZH(e){return e==="time"?k1:e==="utc"?mm:XH}function kC(e,t,n){let
|
|
|
22
31
|
}
|
|
23
32
|
:where(.${g}-ramp text) {
|
|
24
33
|
white-space: pre;
|
|
25
|
-
}`)).call(Af,u),x=O=>O.selectAll(".tick line").attr("y1",s+c-o),_,v=p?(O,F)=>O.rangeRound(F):(O,F)=>O.range(F),{type:w,domain:T,range:M,interpolate:R,scale:I,pivot:A}=e;if(R){let O=M===void 0?R:mo(R.length===1?Mm(R):R,M);_=v(I.copy(),Cn(we(l,i-a),Math.min(T.length+(A!==void 0),M===void 0?1/0:M.length)));let F=256,S=y.document.createElement("canvas");S.width=F,S.height=1;let E=S.getContext("2d");for(let N=0,L=F-1;N<F;++N)E.fillStyle=O(N/L),E.fillRect(N,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(w==="threshold"){let O=T,F=d===void 0?S=>S:typeof d=="string"?ci(d):d;_=v(ks().domain([-1,M.length-1]),[l,i-a]),b.append("g").attr("fill-opacity",m).selectAll().data(M).enter().append("rect").attr("x",(S,E)=>_(E-1)).attr("y",s).attr("width",(S,E)=>_(E)-_(E-1)).attr("height",o-s-c).attr("fill",S=>S),f=Yt(O,(S,E)=>E),d=S=>F(O[S],S)}else _=v(za().domain(T),[l,i-a]),b.append("g").attr("fill-opacity",m).selectAll().data(T).enter().append("rect").attr("x",_).attr("y",s).attr("width",Math.max(0,_.bandwidth()-1)).attr("height",o-s-c).attr("fill",I),x=()=>{};return b.append("g").attr("transform",`translate(0,${o-c})`).call(W2(_).ticks(Array.isArray(f)?null:f,typeof d=="string"?d:void 0).tickFormat(typeof d=="function"?d:void 0).tickSize(r).tickValues(Array.isArray(f)?f:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",le(h,"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 Bf=Math.PI/180;function Vi(e,{marker:t,markerStart:n=t,markerMid:r=t,markerEnd:i=t}={}){e.markerStart=FE(n),e.markerMid=FE(r),e.markerEnd=FE(i)}function FE(e){if(e==null||e===!1)return null;if(e===!0)return SB;if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"none":return null;case"arrow":return vB("auto");case"arrow-reverse":return vB("auto-start-reverse");case"dot":return fQ;case"circle":case"circle-fill":return SB;case"circle-stroke":return dQ;case"tick":return LE("auto");case"tick-x":return LE(90);case"tick-y":return LE(0)}throw new Error(`invalid marker: ${e}`)}function vB(e){return(t,n)=>ct("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 fQ(e,t){return ct("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 SB(e,t){return ct("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 dQ(e,t){return ct("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 LE(e){return(t,n)=>ct("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 hQ=0;function Js(e,t,{stroke:n},r){return TB(e,t,n&&(i=>n[i]),r)}function IB(e,t,{stroke:n},r){return TB(e,t,n&&(([i])=>n[i]),r)}function TB(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),d=a.get(l);d||a.set(l,d=new Map);let h=d.get(f);if(!h){let p=this.parentNode.insertBefore(l(f,s),this),m=`plot-marker-${++hQ}`;p.setAttribute("id",m),d.set(f,h=`url(#${m})`)}return h}}t&&e.attr("marker-start",c(t)),n&&e.attr("marker-mid",c(n)),r&&e.attr("marker-end",c(r))}function Ml({inset:e,insetLeft:t,insetRight:n,...r}={}){return[t,n]=EB(e,t,n),{inset:e,insetLeft:t,insetRight:n,...r}}function Nl({inset:e,insetTop:t,insetBottom:n,...r}={}){return[t,n]=EB(e,t,n),{inset:e,insetTop:t,insetBottom:n,...r}}function EB(e,t,n){return e===void 0&&t===void 0&&n===void 0?De?[1,0]:[.5,.5]:[t,n]}function AB(e,{interval:t}){return e={...pi(e)},e.interval=_f(e.interval===void 0?t:e.interval),e}function f_(e,t,n,r){let{[e]:i,[`${e}1`]:o,[`${e}2`]:s}=n,{value:a,interval:c}=AB(i,n);if(a==null||c==null&&!r)return n;let l=On(i);if(c==null){let h,p={transform:m=>h||(h=mt(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 d(h){return f!==void 0&&h===u?f:f=Yt(mt(u=h,a),p=>c.floor(p))}return t({...n,[e]:void 0,[`${e}1`]:o===void 0?{transform:d,label:l}:o,[`${e}2`]:s===void 0?{transform:h=>d(h).map(p=>c.offset(p)),label:l}:s})}function MB(e,t,n){let{[e]:r}=n,{value:i,interval:o}=AB(r,n);return i==null||o==null?n:t({...n,[e]:{label:On(r),transform:s=>{let a=Yt(mt(s,i),l=>o.floor(l)),c=a.map(l=>o.offset(l));return a.map(Oe(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 CE(e={}){return f_("x",Ml,e,!0)}function BE(e={}){return f_("y",Nl,e,!0)}function d_(e={}){return f_("x",Ml,e)}function h_(e={}){return f_("y",Nl,e)}function p_(e={}){return MB("x",Ml,e)}function m_(e={}){return MB("y",Nl,e)}var NB={ariaLabel:"rule",fill:null,stroke:"currentColor"},Rm=class extends wt{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}},ji(n,"x"),NB),this.insetTop=Nt(a),this.insetBottom=Nt(c),Vi(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y1:l,y2:u}=r,{width:f,height:d,marginTop:h,marginRight:p,marginLeft:m,marginBottom:g}=i,{insetTop:y,insetBottom:b}=this;return ct("svg:g",o).call(Ft,this,i,o).call(It,this,{x:c&&s},De,0).call(x=>x.selectAll().data(t).enter().append("line").call(Rt,this).attr("x1",c?_=>c[_]:(m+f-p)/2).attr("x2",c?_=>c[_]:(m+f-p)/2).attr("y1",l&&!lr(a)?_=>l[_]+y:h+y).attr("y2",u&&!lr(a)?a.bandwidth?_=>u[_]+a.bandwidth()-b:_=>u[_]-b:d-g-b).call(Zt,this,r).call(Js,this,r,o)).node()}},Om=class extends wt{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}},ji(n,"y"),NB),this.insetRight=Nt(a),this.insetLeft=Nt(c),Vi(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{y:c,x1:l,x2:u}=r,{width:f,height:d,marginTop:h,marginRight:p,marginLeft:m,marginBottom:g}=i,{insetLeft:y,insetRight:b}=this;return ct("svg:g",o).call(Ft,this,i,o).call(It,this,{y:c&&a},0,De).call(x=>x.selectAll().data(t).enter().append("line").call(Rt,this).attr("x1",l&&!lr(s)?_=>l[_]+y:m+y).attr("x2",u&&!lr(s)?s.bandwidth?_=>u[_]+s.bandwidth()-b:_=>u[_]-b:f-p-b).attr("y1",c?_=>c[_]:(h+d-g)/2).attr("y2",c?_=>c[_]:(h+d-g)/2).call(Zt,this,r).call(Js,this,r,o)).node()}};function jr(e,t){let{x:n=W,y:r,y1:i,y2:o,...s}=h_(t);return[i,o]=RB(r,i,o),new Rm(e,{...s,x:n,y1:i,y2:o})}function Vr(e,t){let{y:n=W,x:r,x1:i,x2:o,...s}=d_(t);return[i,o]=RB(r,i,o),new Om(e,{...s,y:n,x1:i,x2:o})}function RB(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 oc(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 pQ={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"},LB="\xAD",Ol=class extends wt{constructor(t,n={}){let{x:r,y:i,text:o=cr(t)&&B1(t)?W:Ae,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:d,fontFamily:h=d?"ui-monospace, monospace":void 0,fontSize:p,fontStyle:m,fontVariant:g,fontWeight:y,rotate:b}=n,[x,_]=ie(b,0),[v,w]=bQ(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:zC(x),optional:!0},text:{value:o,filter:hm,optional:!0}},n,pQ),this.rotate=_,this.textAnchor=le(a,"middle"),this.lineAnchor=Ke(c,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+l,this.lineWidth=+u,this.textOverflow=$E(f),this.monospace=!!d,this.fontFamily=ze(h),this.fontSize=w,this.fontStyle=ze(m),this.fontVariant=ze(g),this.fontWeight=ze(y),this.frameAnchor=Fo(s),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${u}`);this.splitLines=zE(this),this.clipLine=qE(this)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,rotate:u,text:f,title:d,fontSize:h}=r,{rotate:p}=this,[m,g]=yn(this,i);return ct("svg:g",o).call(Ft,this,i,o).call(UE,this,f,i).call(It,this,{x:c&&s,y:l&&a}).call(y=>y.selectAll().data(t).enter().append("text").call(Rt,this).call(mQ,this,f,d).attr("transform",oc`translate(${c?b=>c[b]:m},${l?b=>l[b]:g})${u?b=>` rotate(${u[b]})`:p?` rotate(${p})`:""}`).call(ft,"font-size",h&&(b=>h[b])).call(Zt,this,r)).node()}};function $E(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 mQ(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(zi(n[l])??"").map(c),f=u.length,d=i==="top"?.71:i==="bottom"?1-f:(164-f*100)/200;if(f>1){let h=0;for(let p=0;p<f;++p){if(++h,!u[p])continue;let m=this.ownerDocument.createElementNS(ii.svg,"tspan");m.setAttribute("x",0),p===h-1?m.setAttribute("y",`${(d+p)*o}em`):m.setAttribute("dy",`${h*o}em`),m.textContent=u[p],this.appendChild(m),h=0}}else d&&this.setAttribute("y",`${d*o}em`),this.textContent=u[0];if(s&&!r&&u[0]!==n[l]){let h=this.ownerDocument.createElementNS(ii.svg,"title");h.textContent=n[l],this.appendChild(h)}})}function Bo(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Be(t,n)),new Ol(e,{...r,x:t,y:n})}function y_(e,{x:t=W,...n}={}){return new Ol(e,m_({...n,x:t}))}function g_(e,{y:t=W,...n}={}){return new Ol(e,p_({...n,y:t}))}function UE(e,t,n){ft(e,"text-anchor",t.textAnchor),ft(e,"font-family",t.fontFamily),ft(e,"font-size",t.fontSize),ft(e,"font-style",t.fontStyle),ft(e,"font-variant",t.fontVariant===void 0?yQ(n):t.fontVariant),ft(e,"font-weight",t.fontWeight)}function yQ(e){return e&&(Ws(e)||Oe(e))?"tabular-nums":void 0}var gQ=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function bQ(e){return e==null||typeof e=="number"?[void 0,e]:typeof e!="string"?[e,void 0]:(e=e.trim().toLowerCase(),gQ.has(e)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(e)?[void 0,e]:[e,void 0])}function xQ(e,t,n){let r=[],i,o=0;for(let[s,a,c]of _Q(e)){if(i===void 0&&(i=s),o>i&&n(e,i,a)>t&&(r.push(e.slice(i,o)+(e[o-1]===LB?"-":"")),i=s),c){r.push(e.slice(i,a)),i=void 0;continue}o=a}return r}function*_Q(e){let t=0,n=0,r=e.length;for(;n<r;){let i=1;switch(e[n]){case LB: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]===`
|
|
34
|
+
}`)).call(Fp,u),x=O=>O.selectAll(".tick line").attr("y1",s+c-o),_,v=p?(O,R)=>O.rangeRound(R):(O,R)=>O.range(R),{type:w,domain:I,range:D,interpolate:A,scale:B,pivot:M}=e;if(A){let O=D===void 0?A:Js(A.length===1?Nb(A):A,D);_=v(B.copy(),En(Ze(l,i-a),Math.min(I.length+(M!==void 0),D===void 0?1/0:D.length)));let R=256,S=m.document.createElement("canvas");S.width=R,S.height=1;let T=S.getContext("2d");for(let E=0,C=R-1;E<R;++E)T.fillStyle=O(E/C),T.fillRect(E,0,1,1);b.append("image").attr("opacity",y).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(w==="threshold"){let O=I,R=d===void 0?S=>S:typeof d=="string"?wo(d):d;_=v(qc().domain([-1,D.length-1]),[l,i-a]),b.append("g").attr("fill-opacity",y).selectAll().data(D).enter().append("rect").attr("x",(S,T)=>_(T-1)).attr("y",s).attr("width",(S,T)=>_(T)-_(T-1)).attr("height",o-s-c).attr("fill",S=>S),f=fe(O,(S,T)=>T),d=S=>R(O[S],S)}else _=v(uu().domain(I),[l,i-a]),b.append("g").attr("fill-opacity",y).selectAll().data(I).enter().append("rect").attr("x",_).attr("y",s).attr("width",Math.max(0,_.bandwidth()-1)).attr("height",o-s-c).attr("fill",B),x=()=>{};return b.append("g").attr("transform",`translate(0,${o-c})`).call(DD(_).ticks(Array.isArray(f)?null:f,typeof d=="string"?d:void 0).tickFormat(typeof d=="function"?d:void 0).tickSize(n).tickValues(Array.isArray(f)?f:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",Ne(h,"normal")).call(x).call(O=>O.select(".domain").remove()),r!==void 0&&b.append("text").attr("x",l).attr("y",s-6).attr("fill","currentColor").attr("font-weight","bold").text(r),b.node()}var jp=Math.PI/180;function _s(e,{marker:t,markerStart:r=t,markerMid:n=t,markerEnd:i=t}={}){e.markerStart=y3(r),e.markerMid=y3(n),e.markerEnd=y3(i)}function y3(e){if(e==null||e===!1)return null;if(e===!0)return Hj;if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"none":return null;case"arrow":return Xj("auto");case"arrow-reverse":return Xj("auto-start-reverse");case"dot":return dct;case"circle":case"circle-fill":return Hj;case"circle-stroke":return hct;case"tick":return g3("auto");case"tick-x":return g3(90);case"tick-y":return g3(0)}throw new Error(`invalid marker: ${e}`)}function Xj(e){return(t,r)=>pt("svg:marker",r).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(n=>n.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function dct(e,t){return pt("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","none").call(r=>r.append("circle").attr("r",2.5)).node()}function Hj(e,t){return pt("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(r=>r.append("circle").attr("r",3)).node()}function hct(e,t){return pt("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(r=>r.append("circle").attr("r",3)).node()}function g3(e){return(t,r)=>pt("svg:marker",r).attr("viewBox","-3 -3 6 6").attr("markerWidth",6).attr("markerHeight",6).attr("orient",e).attr("stroke",t).call(n=>n.append("path").attr("d","M0,-3v6")).node()}var pct=0;function ul(e,t,{stroke:r},n){return Kj(e,t,r&&(i=>r[i]),n)}function Zj(e,t,{stroke:r},n){return Kj(e,t,r&&(([i])=>r[i]),n)}function Kj(e,{markerStart:t,markerMid:r,markerEnd:n,stroke:i},o=()=>i,s){let a=new Map;function c(l){return function(u){let f=o(u),d=a.get(l);d||a.set(l,d=new Map);let h=d.get(f);if(!h){let p=this.parentNode.insertBefore(l(f,s),this),y=`plot-marker-${++pct}`;p.setAttribute("id",y),d.set(f,h=`url(#${y})`)}return h}}t&&e.attr("marker-start",c(t)),r&&e.attr("marker-mid",c(r)),n&&e.attr("marker-end",c(n))}function hd({inset:e,insetLeft:t,insetRight:r,...n}={}){return[t,r]=Qj(e,t,r),{inset:e,insetLeft:t,insetRight:r,...n}}function pd({inset:e,insetTop:t,insetBottom:r,...n}={}){return[t,r]=Qj(e,t,r),{inset:e,insetTop:t,insetBottom:r,...n}}function Qj(e,t,r){return e===void 0&&t===void 0&&r===void 0?ur?[1,0]:[.5,.5]:[t,r]}function Jj(e,{interval:t}){return e={...Mo(e)},e.interval=Ap(e.interval===void 0?t:e.interval),e}function GI(e,t,r,n){let{[e]:i,[`${e}1`]:o,[`${e}2`]:s}=r,{value:a,interval:c}=Jj(i,r);if(a==null||c==null&&!n)return r;let l=vn(i);if(c==null){let h,p={transform:y=>h||(h=Tt(y,a)),label:l};return{...r,[e]:void 0,[`${e}1`]:o===void 0?p:o,[`${e}2`]:s===void 0&&!(o===s&&n)?p:s}}let u,f;function d(h){return f!==void 0&&h===u?f:f=fe(Tt(u=h,a),p=>c.floor(p))}return t({...r,[e]:void 0,[`${e}1`]:o===void 0?{transform:d,label:l}:o,[`${e}2`]:s===void 0?{transform:h=>d(h).map(p=>c.offset(p)),label:l}:s})}function tq(e,t,r){let{[e]:n}=r,{value:i,interval:o}=Jj(n,r);return i==null||o==null?r:t({...r,[e]:{label:vn(n),transform:s=>{let a=fe(Tt(s,i),l=>o.floor(l)),c=a.map(l=>o.offset(l));return a.map(lr(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 b3(e={}){return GI("x",hd,e,!0)}function x3(e={}){return GI("y",pd,e,!0)}function XI(e={}){return GI("x",hd,e)}function HI(e={}){return GI("y",pd,e)}function ZI(e={}){return tq("x",hd,e)}function KI(e={}){return tq("y",pd,e)}var eq={ariaLabel:"rule",fill:null,stroke:"currentColor"},Lb=class extends Ft{constructor(t,r={}){let{x:n,y1:i,y2:o,inset:s=0,insetTop:a=s,insetBottom:c=s}=r;super(t,{x:{value:n,scale:"x",optional:!0},y1:{value:i,scale:"y",optional:!0},y2:{value:o,scale:"y",optional:!0}},xs(r,"x"),eq),this.insetTop=Wt(a),this.insetBottom=Wt(c),_s(this,r)}render(t,r,n,i,o){let{x:s,y:a}=r,{x:c,y1:l,y2:u}=n,{width:f,height:d,marginTop:h,marginRight:p,marginLeft:y,marginBottom:g}=i,{insetTop:m,insetBottom:b}=this;return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,{x:c&&s},ur,0).call(x=>x.selectAll().data(t).enter().append("line").call(Gt,this).attr("x1",c?_=>c[_]:(y+f-p)/2).attr("x2",c?_=>c[_]:(y+f-p)/2).attr("y1",l&&!si(a)?_=>l[_]+m:h+m).attr("y2",u&&!si(a)?a.bandwidth?_=>u[_]+a.bandwidth()-b:_=>u[_]-b:d-g-b).call(ye,this,n).call(ul,this,n,o)).node()}},Rb=class extends Ft{constructor(t,r={}){let{x1:n,x2:i,y:o,inset:s=0,insetRight:a=s,insetLeft:c=s}=r;super(t,{y:{value:o,scale:"y",optional:!0},x1:{value:n,scale:"x",optional:!0},x2:{value:i,scale:"x",optional:!0}},xs(r,"y"),eq),this.insetRight=Wt(a),this.insetLeft=Wt(c),_s(this,r)}render(t,r,n,i,o){let{x:s,y:a}=r,{y:c,x1:l,x2:u}=n,{width:f,height:d,marginTop:h,marginRight:p,marginLeft:y,marginBottom:g}=i,{insetLeft:m,insetRight:b}=this;return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,{y:c&&a},0,ur).call(x=>x.selectAll().data(t).enter().append("line").call(Gt,this).attr("x1",l&&!si(s)?_=>l[_]+m:y+m).attr("x2",u&&!si(s)?s.bandwidth?_=>u[_]+s.bandwidth()-b:_=>u[_]-b:f-p-b).attr("y1",c?_=>c[_]:(h+d-g)/2).attr("y2",c?_=>c[_]:(h+d-g)/2).call(ye,this,n).call(ul,this,n,o)).node()}};function Zi(e,t){let{x:r=K,y:n,y1:i,y2:o,...s}=HI(t);return[i,o]=rq(n,i,o),new Lb(e,{...s,x:r,y1:i,y2:o})}function Ki(e,t){let{y:r=K,x:n,x1:i,x2:o,...s}=XI(t);return[i,o]=rq(n,i,o),new Rb(e,{...s,y:r,x1:i,x2:o})}function rq(e,t,r){if(e==null){if(t===void 0){if(r!==void 0)return[0,r]}else if(r===void 0)return[0,t]}else{if(t===void 0)return r===void 0?[0,e]:[e,r];if(r===void 0)return[e,t]}return[t,r]}function Eu(e,...t){let r=t.length;for(let n=0,i=!0;n<r;++n)typeof t[n]!="function"&&(i&&(e=e.slice(),i=!1),e.splice(n,2,e[n]+t[n]+e[n+1]),t.splice(n,1),--n,--r);return n=>{let i=e[0];for(let o=0;o<r;++o)i+=t[o](n)+e[o+1];return i}}var mct={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"},aq="\xAD",yd=class extends Ft{constructor(t,r={}){let{x:n,y:i,text:o=oi(t)&&xI(t)?K:nr,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:d,fontFamily:h=d?"ui-monospace, monospace":void 0,fontSize:p,fontStyle:y,fontVariant:g,fontWeight:m,rotate:b}=r,[x,_]=Ae(b,0),[v,w]=xct(p);if(super(t,{x:{value:n,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},fontSize:{value:v,optional:!0},rotate:{value:hV(x),optional:!0},text:{value:o,filter:gb,optional:!0}},r,mct),this.rotate=_,this.textAnchor=Ne(a,"middle"),this.lineAnchor=Ur(c,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+l,this.lineWidth=+u,this.textOverflow=w3(f),this.monospace=!!d,this.fontFamily=vr(h),this.fontSize=w,this.fontStyle=vr(y),this.fontVariant=vr(g),this.fontWeight=vr(m),this.frameAnchor=xa(s),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${u}`);this.splitLines=S3(this),this.clipLine=I3(this)}render(t,r,n,i,o){let{x:s,y:a}=r,{x:c,y:l,rotate:u,text:f,title:d,fontSize:h}=n,{rotate:p}=this,[y,g]=rn(this,i);return pt("svg:g",o).call(Kt,this,i,o).call(v3,this,f,i).call(Pt,this,{x:c&&s,y:l&&a}).call(m=>m.selectAll().data(t).enter().append("text").call(Gt,this).call(yct,this,f,d).attr("transform",Eu`translate(${c?b=>c[b]:y},${l?b=>l[b]:g})${u?b=>` rotate(${u[b]})`:p?` rotate(${p})`:""}`).call(yt,"font-size",h&&(b=>h[b])).call(ye,this,n)).node()}};function w3(e){return e==null?null:Ur(e,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function yct(e,t,r,n){if(!r)return;let{lineAnchor:i,lineHeight:o,textOverflow:s,splitLines:a,clipLine:c}=t;e.each(function(l){let u=a(gs(r[l])??"").map(c),f=u.length,d=i==="top"?.71:i==="bottom"?1-f:(164-f*100)/200;if(f>1){let h=0;for(let p=0;p<f;++p){if(++h,!u[p])continue;let y=this.ownerDocument.createElementNS(bo.svg,"tspan");y.setAttribute("x",0),p===h-1?y.setAttribute("y",`${(d+p)*o}em`):y.setAttribute("dy",`${h*o}em`),y.textContent=u[p],this.appendChild(y),h=0}}else d&&this.setAttribute("y",`${d*o}em`),this.textContent=u[0];if(s&&!n&&u[0]!==r[l]){let h=this.ownerDocument.createElementNS(bo.svg,"title");h.textContent=r[l],this.appendChild(h)}})}function va(e,{x:t,y:r,...n}={}){return n.frameAnchor===void 0&&([t,r]=gr(t,r)),new yd(e,{...n,x:t,y:r})}function QI(e,{x:t=K,...r}={}){return new yd(e,KI({...r,x:t}))}function JI(e,{y:t=K,...r}={}){return new yd(e,ZI({...r,y:t}))}function v3(e,t,r){yt(e,"text-anchor",t.textAnchor),yt(e,"font-family",t.fontFamily),yt(e,"font-size",t.fontSize),yt(e,"font-style",t.fontStyle),yt(e,"font-variant",t.fontVariant===void 0?gct(r):t.fontVariant),yt(e,"font-weight",t.fontWeight)}function gct(e){return e&&(il(e)||lr(e))?"tabular-nums":void 0}var bct=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function xct(e){return e==null||typeof e=="number"?[void 0,e]:typeof e!="string"?[e,void 0]:(e=e.trim().toLowerCase(),bct.has(e)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(e)?[void 0,e]:[e,void 0])}function _ct(e,t,r){let n=[],i,o=0;for(let[s,a,c]of wct(e)){if(i===void 0&&(i=s),o>i&&r(e,i,a)>t&&(n.push(e.slice(i,o)+(e[o-1]===aq?"-":"")),i=s),c){n.push(e.slice(i,a)),i=void 0;continue}o=a}return n}function*wct(e){let t=0,r=0,n=e.length;for(;r<n;){let i=1;switch(e[r]){case aq:case"-":++r,yield[t,r,!1],t=r;break;case" ":for(yield[t,r,!1];e[++r]===" ";);t=r;break;case"\r":e[r+1]===`
|
|
26
35
|
`&&++i;case`
|
|
27
|
-
`:yield[t,n,!0],n+=i,t=n;break;default:++n;break}}yield[t,n,!0]}var OB={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 b_(e,t=0,n=e.length){let r=0;for(let i=t;i<n;i=Pf(e,i))r+=OB[e[i]]??(BB(e,i)?120:OB.e);return r}function x_(e,t=0,n=e.length){let r=0;for(let i=t;i<n;i=Pf(e,i))r+=BB(e,i)?126:63;return r}function zE({monospace:e,lineWidth:t,textOverflow:n}){if(n!=null||t==1/0)return o=>o.split(/\r\n?|\n/g);let r=e?x_:b_,i=t*100;return o=>xQ(o,i,r)}function qE({monospace:e,lineWidth:t,textOverflow:n}){if(n==null||t==1/0)return o=>o;let r=e?x_:b_,i=t*100;switch(n){case"clip-start":return o=>kB(o,i,r,"");case"clip-end":return o=>DB(o,i,r,"");case"ellipsis-start":return o=>kB(o,i,r,Rl);case"ellipsis-middle":return o=>wQ(o,i,r,Rl);case"ellipsis-end":return o=>DB(o,i,r,Rl)}}var Rl="\u2026";function Dl(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 DB(e,t,n,r){e=e.trim();let i=n(r),[o]=Dl(e,t,n,i);return o<0?e:e.slice(0,o).trimEnd()+r}function wQ(e,t,n,r){e=e.trim();let i=n(e);if(i<=t)return e;let o=n(r)/2,[s,a]=Dl(e,t/2,n,o),[c]=Dl(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 kB(e,t,n,r){e=e.trim();let i=n(e);if(i<=t)return e;let o=n(r),[s]=Dl(e,i-t+o,n,-o);return s<0?r:r+e.slice(Pf(e,s)).trimStart()}var PE=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,FB=/\p{Extended_Pictographic}/uy;function Pf(e,t){return t+=vQ(e,t)?2:1,IQ(e,t)&&(t=PE.lastIndex),SQ(e,t)?Pf(e,t+1):t}function CB(e,t){return e.charCodeAt(t)<128}function vQ(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 SQ(e,t){return e.charCodeAt(t)===8205}function IQ(e,t){return CB(e,t)?!1:(PE.lastIndex=t,PE.test(e))}function BB(e,t){return CB(e,t)?!1:(FB.lastIndex=t,FB.test(e))}var PB={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},$B=3.5,TQ=$B*5,UB={draw(e,t,n){let r=t*n/TQ;e.moveTo(0,0),e.lineTo(0,-t),e.moveTo(-r,r-t),e.lineTo(0,-t),e.lineTo(r,r-t)}},zB={draw(e,t,n){e.moveTo(-n,0),e.lineTo(0,-t),e.lineTo(n,0)}},EQ=new Map([["arrow",UB],["spike",zB]]);function AQ(e){return e&&typeof e.draw=="function"}function MQ(e){if(AQ(e))return e;let t=EQ.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid shape: ${e}`)}var kl=class extends wt{constructor(t,n={}){let{x:r,y:i,r:o=$B,length:s,rotate:a,shape:c=UB,anchor:l="middle",frameAnchor:u}=n,[f,d]=ie(s,12),[h,p]=ie(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:h,optional:!0}},n,PB),this.r=+o,this.length=d,this.rotate=p,this.shape=MQ(c),this.anchor=Ke(l,"anchor",["start","middle","end"]),this.frameAnchor=Fo(u)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,length:u,rotate:f}=r,{length:d,rotate:h,anchor:p,shape:m,r:g}=this,[y,b]=yn(this,i);return ct("svg:g",o).call(Ft,this,i,o).call(It,this,{x:c&&s,y:l&&a}).call(x=>x.selectAll().data(t).enter().append("path").call(Rt,this).attr("transform",oc`translate(${c?_=>c[_]:y},${l?_=>l[_]:b})${f?_=>` rotate(${f[_]})`:h?` rotate(${h})`:""}${p==="start"?"":p==="end"?u?_=>` translate(0,${u[_]})`:` translate(0,${d})`:u?_=>` translate(0,${u[_]/2})`:` translate(0,${d/2})`}`).attr("d",u?_=>{let v=er();return m.draw(v,u[_],g),v}:(()=>{let _=er();return m.draw(_,d,g),_})()).call(Zt,this,r)).node()}};function jE(e,t={}){let{x:n,y:r,...i}=t;return t.frameAnchor===void 0&&([n,r]=Be(n,r)),new kl(e,{...i,x:n,y:r})}function __(e,t={}){let{x:n=W,...r}=t;return new kl(e,{...r,x:n})}function w_(e,t={}){let{y:n=W,...r}=t;return new kl(e,{...r,y:n})}function qB(e,t={}){let{shape:n=zB,stroke:r=PB.stroke,strokeWidth:i=1,fill:o=r,fillOpacity:s=.3,anchor:a="start",...c}=t;return jE(e,{...c,shape:n,stroke:r,strokeWidth:i,fill:o,fillOpacity:s,anchor:a})}function sc(e,t){return arguments.length<2&&!cr(e)&&(t=e,e=null),t===void 0&&(t={}),[e,t]}function v_({anchor:e}={},t){return e===void 0?t[0]:Ke(e,"anchor",t)}function jB(e){return v_(e,["left","right"])}function VB(e){return v_(e,["right","left"])}function YB(e){return v_(e,["bottom","top"])}function GB(e){return v_(e,["top","bottom"])}function Dm(){let[e,t]=sc(...arguments);return WB("y",jB(t),e,t)}function S_(){let[e,t]=sc(...arguments);return WB("fy",VB(t),e,t)}function km(){let[e,t]=sc(...arguments);return XB("x",YB(t),e,t)}function I_(){let[e,t]=sc(...arguments);return XB("fx",GB(t),e,t)}function WB(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:d,textStrokeWidth:h,tickSize:p=e==="y"?6:0,tickPadding:m,tickRotate:g,x:y,margin:b,marginTop:x=b===void 0?20:b,marginRight:_=b===void 0?t==="right"?40:0:b,marginBottom:v=b===void 0?20:b,marginLeft:w=b===void 0?t==="left"?40:0:b,label:T,labelAnchor:M,labelArrow:R,labelOffset:I,...A}){return p=Nt(p),m=Nt(m),g=Nt(g),M!==void 0&&(M=Ke(M,"labelAnchor",["center","top","bottom"])),R=n7(R),Je(p&&!ne(o)?NQ(e,t,n,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:m,tickRotate:g,x:y,...A}):null,ne(c)?null:OQ(e,t,n,{fill:c,fillOpacity:l,stroke:f,strokeOpacity:d,strokeWidth:h,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:g,x:y,marginTop:x,marginRight:_,marginBottom:v,marginLeft:w,...A}),!ne(c)&&T!==null?Bo([],KB({fill:c,fillOpacity:l,...A},function(O,F,S,E,N){let L=E[e],{marginTop:B,marginRight:C,marginBottom:P,marginLeft:$}=e==="y"&&N.inset||N,U=M??(L.bandwidth?"center":"top"),X=I??(t==="right"?C:$)-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-B:U==="bottom"?P-3:0,this.dx=t==="right"?X:-X,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[e7(e,L,{anchor:t,label:T,labelAnchor:U,labelArrow:R})]}}}})):null)}function XB(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:d,textStrokeWidth:h,tickSize:p=e==="x"?6:0,tickPadding:m,tickRotate:g,y,margin:b,marginTop:x=b===void 0?t==="top"?30:0:b,marginRight:_=b===void 0?20:b,marginBottom:v=b===void 0?t==="bottom"?30:0:b,marginLeft:w=b===void 0?20:b,label:T,labelAnchor:M,labelArrow:R,labelOffset:I,...A}){return p=Nt(p),m=Nt(m),g=Nt(g),M!==void 0&&(M=Ke(M,"labelAnchor",["center","left","right"])),R=n7(R),Je(p&&!ne(o)?RQ(e,t,n,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:m,tickRotate:g,y,...A}):null,ne(c)?null:DQ(e,t,n,{fill:c,fillOpacity:l,stroke:f,strokeOpacity:d,strokeWidth:h,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:g,y,marginTop:x,marginRight:_,marginBottom:v,marginLeft:w,...A}),!ne(c)&&T!==null?Bo([],KB({fill:c,fillOpacity:l,...A},function(O,F,S,E,N){let L=E[e],{marginTop:B,marginRight:C,marginBottom:P,marginLeft:$}=e==="x"&&N.inset||N,U=M??(L.bandwidth?"center":"right"),X=I??(t==="top"?B:P)-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"?-X:X,this.dx=U==="right"?C-3:U==="left"?3-$:0,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[e7(e,L,{anchor:t,label:T,labelAnchor:U,labelArrow:R})]}}}})):null)}function NQ(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:d=0,y:h=e==="y"?void 0:null,...p}){return $f(w_,e,t,`${e}-axis tick`,n,{strokeWidth:r,strokeLinecap:i,strokeLinejoin:o,facetAnchor:s,frameAnchor:a,y:h,...p,dx:t==="left"?+d-De+ +u:+d+De-f,anchor:"start",length:c,shape:t==="left"?CQ:BQ})}function RQ(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:d=0,x:h=e==="x"?void 0:null,...p}){return $f(__,e,t,`${e}-axis tick`,n,{strokeWidth:r,strokeLinejoin:o,strokeLinecap:i,facetAnchor:s,frameAnchor:a,x:h,...p,dy:t==="bottom"?+d-De-f:+d+De+ +u,anchor:"start",length:c,shape:t==="bottom"?FQ:LQ})}function OQ(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*Bf):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:d=0,insetLeft:h=d,insetRight:p=d,dx:m=0,y:g=e==="y"?void 0:null,...y}){return $f(g_,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+ +h:+m+ +o+ +a-p},function(b,x,_,v,w){f===void 0&&(this.fontVariant=t7(b)),c===void 0&&(w.text=JB(b,x,_,v,t))})}function DQ(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*Bf):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:d=0,insetTop:h=d,insetBottom:p=d,dy:m=0,x:g=e==="x"?void 0:null,...y}){return $f(y_,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+ +h},function(b,x,_,v,w){f===void 0&&(this.fontVariant=t7(b)),c===void 0&&(w.text=JB(b,x,_,v,t))})}function T_(){let[e,t]=sc(...arguments);return HB("y",jB(t),e,t)}function E_(){let[e,t]=sc(...arguments);return HB("fy",VB(t),e,t)}function A_(){let[e,t]=sc(...arguments);return ZB("x",YB(t),e,t)}function M_(){let[e,t]=sc(...arguments);return ZB("fx",GB(t),e,t)}function HB(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 $f(Vr,e,t,`${e}-grid`,n,{y:r,x1:o,x2:s,...QB(a)})}function ZB(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 $f(jr,e,t,`${e}-grid`,n,{x:r,y1:o,y2:s,...QB(a)})}function QB({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 KB({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]=Re(e),[,t]=ie(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 $f(e,t,n,r,i,o,s){let a;function c(f,d,h,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:_,ticks:v,tickFormat:w,tickSpacing:T=t==="x"?80:35}=o;if(typeof v=="string"&&r7(b)&&(_=v,v=void 0),v===void 0&&(v=ko(_,b.type)??kQ(b,T)),f==null){if(cr(v))f=qe(v);else if(Qa(v))f=VE(v,...ae(x));else if(b.interval){let R=b.interval;if(b.ticks){let[I,A]=ae(x),O=(A-I)/R[mf];R=qT(R,O/v)??R,f=VE(R,I,A)}else{f=x;let I=f.length;R=qT(R,I/v)??R,R!==b.interval&&(f=VE(R,...ae(f)))}if(R===b.interval){let I=Math.round(f.length/v);I>1&&(f=f.filter((A,O)=>O%I===0))}}else b.ticks?f=b.ticks(v):f=x;if(!b.ticks&&f.length&&f!==x){let R=new Qn(x);f=f.filter(I=>R.has(I)),f.length||jn(`Warning: the ${t}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}t==="y"||t==="x"?d=[ar(f)]:a[t]={scale:t,value:W}}s?.call(this,b,f,v,w,a);let M=Object.fromEntries(Object.entries(a).map(([R,I])=>[R,{...I,value:mt(f,I.value)}]));return y&&(d=g.filterFacets(f,M)),{data:f,facets:d,channels:M}}let l=Se(o).initializer,u=e(i,Se({...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 kQ(e,t){let[n,r]=ae(e.range());return(r-n)/t}function JB(e,t,n,r,i){return{value:Fm(e,t,n,r,i)}}function Fm(e,t,n,r,i){return typeof r=="function"?r:r===void 0&&t&&Oe(t)?kC(e.type,t,i)??zi:e.tickFormat?e.tickFormat(typeof n=="number"?n:null,r):r===void 0?zi:typeof r=="string"?(Oe(e.domain())?Mo:ci)(r):dn(r)}function VE(e,t,n){return e.range(t,e.offset(e.floor(n)))}var FQ={draw(e,t){e.moveTo(0,0),e.lineTo(0,t)}},LQ={draw(e,t){e.moveTo(0,0),e.lineTo(0,-t)}},CQ={draw(e,t){e.moveTo(0,0),e.lineTo(-t,0)}},BQ={draw(e,t){e.moveTo(0,0),e.lineTo(t,0)}};function t7(e){return e.bandwidth&&!e.interval?void 0:"tabular-nums"}function e7(e,t,{anchor:n,label:r=t.label,labelAnchor:i,labelArrow:o}={}){if(!(r==null||r.inferred&&r7(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=r_(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 n7(e="auto"){return ne(e)?!1:typeof e=="boolean"?e:Ke(e,"labelArrow",["auto","up","right","down","left"])}function r7(e){return Oe(e.domain())}function i7(e,t){if(t==null)return t;let n=e(t);if(!n)throw new Error(`scale not found: ${t}`);return n}function o7(e,{opacity:t,...n}={}){if(!Co(e)&&!TE(e))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${e.type})`);return a7(e,n,(r,i,o,s)=>r.append("svg").attr("width",o).attr("height",s).attr("fill",i.scale).attr("fill-opacity",ie(t)[1]).append("rect").attr("width","100%").attr("height","100%"))}function s7(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:ne(t)?"currentColor":"none",strokeOpacity:i=1,strokeWidth:o=1.5,r:s=4.5,...a}={},c){let[l,u]=Re(t),[f,d]=Re(r),h=i7(c,l),p=i7(c,f),m=s*s*Math.PI;return n=ie(n)[1],i=ie(i)[1],o=ie(o)[1],a7(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"?_=>h.scale(_):u).attr("fill-opacity",n).attr("stroke",f==="color"?_=>p.scale(_):d).attr("stroke-opacity",i).attr("stroke-width",o).append("path").attr("d",_=>{let v=er();return e.scale(_).draw(v,m),v}))}function a7(e,t={},n){let{columns:r,tickFormat:i,fontVariant:o=u_(e),swatchSize:s=15,swatchWidth:a=s,swatchHeight:c=s,marginLeft:l=0,className:u,style:f,width:d}=t,h=nc(t);u=Ef(u),i=Fm(e.scale,e.domain,void 0,i);let p=ct("div",h).attr("class",`${u}-swatches ${u}-swatches-${r!=null?"columns":"wrap"}`),m;return r!=null?(m=`:where(.${u}-swatches-columns .${u}-swatch) {
|
|
36
|
+
`:yield[t,r,!0],r+=i,t=r;break;default:++r;break}}yield[t,r,!0]}var nq={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 tT(e,t=0,r=e.length){let n=0;for(let i=t;i<r;i=qp(e,i))n+=nq[e[i]]??(lq(e,i)?120:nq.e);return n}function eT(e,t=0,r=e.length){let n=0;for(let i=t;i<r;i=qp(e,i))n+=lq(e,i)?126:63;return n}function S3({monospace:e,lineWidth:t,textOverflow:r}){if(r!=null||t==1/0)return o=>o.split(/\r\n?|\n/g);let n=e?eT:tT,i=t*100;return o=>_ct(o,i,n)}function I3({monospace:e,lineWidth:t,textOverflow:r}){if(r==null||t==1/0)return o=>o;let n=e?eT:tT,i=t*100;switch(r){case"clip-start":return o=>oq(o,i,n,"");case"clip-end":return o=>iq(o,i,n,"");case"ellipsis-start":return o=>oq(o,i,n,md);case"ellipsis-middle":return o=>vct(o,i,n,md);case"ellipsis-end":return o=>iq(o,i,n,md)}}var md="\u2026";function gd(e,t,r,n){let i=[],o=0;for(let s=0,a=0,c=e.length;s<c;s=a){a=qp(e,s);let l=r(e,s,a);if(o+l>t){for(o+=n;o>t&&s>0;)a=s,s=i.pop(),o-=r(e,s,a);return[s,t-o]}o+=l,i.push(s)}return[-1,0]}function iq(e,t,r,n){e=e.trim();let i=r(n),[o]=gd(e,t,r,i);return o<0?e:e.slice(0,o).trimEnd()+n}function vct(e,t,r,n){e=e.trim();let i=r(e);if(i<=t)return e;let o=r(n)/2,[s,a]=gd(e,t/2,r,o),[c]=gd(e,i-t/2-a+o,r,-o);return c<0?n:e.slice(0,s).trimEnd()+n+e.slice(qp(e,c)).trimStart()}function oq(e,t,r,n){e=e.trim();let i=r(e);if(i<=t)return e;let o=r(n),[s]=gd(e,i-t+o,r,-o);return s<0?n:n+e.slice(qp(e,s)).trimStart()}var _3=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,sq=/\p{Extended_Pictographic}/uy;function qp(e,t){return t+=Sct(e,t)?2:1,Tct(e,t)&&(t=_3.lastIndex),Ict(e,t)?qp(e,t+1):t}function cq(e,t){return e.charCodeAt(t)<128}function Sct(e,t){let r=e.charCodeAt(t);if(r>=55296&&r<56320){let n=e.charCodeAt(t+1);return n>=56320&&n<57344}return!1}function Ict(e,t){return e.charCodeAt(t)===8205}function Tct(e,t){return cq(e,t)?!1:(_3.lastIndex=t,_3.test(e))}function lq(e,t){return cq(e,t)?!1:(sq.lastIndex=t,sq.test(e))}var uq={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},fq=3.5,Act=fq*5,dq={draw(e,t,r){let n=t*r/Act;e.moveTo(0,0),e.lineTo(0,-t),e.moveTo(-n,n-t),e.lineTo(0,-t),e.lineTo(n,n-t)}},hq={draw(e,t,r){e.moveTo(-r,0),e.lineTo(0,-t),e.lineTo(r,0)}},Mct=new Map([["arrow",dq],["spike",hq]]);function Ect(e){return e&&typeof e.draw=="function"}function Dct(e){if(Ect(e))return e;let t=Mct.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid shape: ${e}`)}var bd=class extends Ft{constructor(t,r={}){let{x:n,y:i,r:o=fq,length:s,rotate:a,shape:c=dq,anchor:l="middle",frameAnchor:u}=r,[f,d]=Ae(s,12),[h,p]=Ae(a,0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},length:{value:f,scale:"length",optional:!0},rotate:{value:h,optional:!0}},r,uq),this.r=+o,this.length=d,this.rotate=p,this.shape=Dct(c),this.anchor=Ur(l,"anchor",["start","middle","end"]),this.frameAnchor=xa(u)}render(t,r,n,i,o){let{x:s,y:a}=r,{x:c,y:l,length:u,rotate:f}=n,{length:d,rotate:h,anchor:p,shape:y,r:g}=this,[m,b]=rn(this,i);return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,{x:c&&s,y:l&&a}).call(x=>x.selectAll().data(t).enter().append("path").call(Gt,this).attr("transform",Eu`translate(${c?_=>c[_]:m},${l?_=>l[_]:b})${f?_=>` rotate(${f[_]})`:h?` rotate(${h})`:""}${p==="start"?"":p==="end"?u?_=>` translate(0,${u[_]})`:` translate(0,${d})`:u?_=>` translate(0,${u[_]/2})`:` translate(0,${d/2})`}`).attr("d",u?_=>{let v=Qn();return y.draw(v,u[_],g),v}:(()=>{let _=Qn();return y.draw(_,d,g),_})()).call(ye,this,n)).node()}};function T3(e,t={}){let{x:r,y:n,...i}=t;return t.frameAnchor===void 0&&([r,n]=gr(r,n)),new bd(e,{...i,x:r,y:n})}function rT(e,t={}){let{x:r=K,...n}=t;return new bd(e,{...n,x:r})}function nT(e,t={}){let{y:r=K,...n}=t;return new bd(e,{...n,y:r})}function pq(e,t={}){let{shape:r=hq,stroke:n=uq.stroke,strokeWidth:i=1,fill:o=n,fillOpacity:s=.3,anchor:a="start",...c}=t;return T3(e,{...c,shape:r,stroke:n,strokeWidth:i,fill:o,fillOpacity:s,anchor:a})}function Du(e,t){return arguments.length<2&&!oi(e)&&(t=e,e=null),t===void 0&&(t={}),[e,t]}function iT({anchor:e}={},t){return e===void 0?t[0]:Ur(e,"anchor",t)}function mq(e){return iT(e,["left","right"])}function yq(e){return iT(e,["right","left"])}function gq(e){return iT(e,["bottom","top"])}function bq(e){return iT(e,["top","bottom"])}function kb(){let[e,t]=Du(...arguments);return xq("y",mq(t),e,t)}function oT(){let[e,t]=Du(...arguments);return xq("fy",yq(t),e,t)}function Cb(){let[e,t]=Du(...arguments);return _q("x",gq(t),e,t)}function sT(){let[e,t]=Du(...arguments);return _q("fx",bq(t),e,t)}function xq(e,t,r,{color:n="currentColor",opacity:i=1,stroke:o=n,strokeOpacity:s=i,strokeWidth:a=1,fill:c=n,fillOpacity:l=i,textAnchor:u,textStroke:f,textStrokeOpacity:d,textStrokeWidth:h,tickSize:p=e==="y"?6:0,tickPadding:y,tickRotate:g,x:m,margin:b,marginTop:x=b===void 0?20:b,marginRight:_=b===void 0?t==="right"?40:0:b,marginBottom:v=b===void 0?20:b,marginLeft:w=b===void 0?t==="left"?40:0:b,label:I,labelAnchor:D,labelArrow:A,labelOffset:B,...M}){return p=Wt(p),y=Wt(y),g=Wt(g),D!==void 0&&(D=Ur(D,"labelAnchor",["center","top","bottom"])),A=Eq(A),Pr(p&&!Se(o)?Bct(e,t,r,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:y,tickRotate:g,x:m,...M}):null,Se(c)?null:Nct(e,t,r,{fill:c,fillOpacity:l,stroke:f,strokeOpacity:d,strokeWidth:h,textAnchor:u,tickSize:p,tickPadding:y,tickRotate:g,x:m,marginTop:x,marginRight:_,marginBottom:v,marginLeft:w,...M}),!Se(c)&&I!==null?va([],Iq({fill:c,fillOpacity:l,...M},function(O,R,S,T,E){let C=T[e],{marginTop:U,marginRight:k,marginBottom:$,marginLeft:z}=e==="y"&&E.inset||E,V=D??(C.bandwidth?"center":"top"),Q=B??(t==="right"?k:z)-3;return V==="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=V,this.frameAnchor=`${V}-${t}`,this.rotate=0),this.dy=V==="top"?3-U:V==="bottom"?$-3:0,this.dx=t==="right"?Q:-Q,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[Mq(e,C,{anchor:t,label:I,labelAnchor:V,labelArrow:A})]}}}})):null)}function _q(e,t,r,{color:n="currentColor",opacity:i=1,stroke:o=n,strokeOpacity:s=i,strokeWidth:a=1,fill:c=n,fillOpacity:l=i,textAnchor:u,textStroke:f,textStrokeOpacity:d,textStrokeWidth:h,tickSize:p=e==="x"?6:0,tickPadding:y,tickRotate:g,y:m,margin:b,marginTop:x=b===void 0?t==="top"?30:0:b,marginRight:_=b===void 0?20:b,marginBottom:v=b===void 0?t==="bottom"?30:0:b,marginLeft:w=b===void 0?20:b,label:I,labelAnchor:D,labelArrow:A,labelOffset:B,...M}){return p=Wt(p),y=Wt(y),g=Wt(g),D!==void 0&&(D=Ur(D,"labelAnchor",["center","left","right"])),A=Eq(A),Pr(p&&!Se(o)?Oct(e,t,r,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:y,tickRotate:g,y:m,...M}):null,Se(c)?null:Fct(e,t,r,{fill:c,fillOpacity:l,stroke:f,strokeOpacity:d,strokeWidth:h,textAnchor:u,tickSize:p,tickPadding:y,tickRotate:g,y:m,marginTop:x,marginRight:_,marginBottom:v,marginLeft:w,...M}),!Se(c)&&I!==null?va([],Iq({fill:c,fillOpacity:l,...M},function(O,R,S,T,E){let C=T[e],{marginTop:U,marginRight:k,marginBottom:$,marginLeft:z}=e==="x"&&E.inset||E,V=D??(C.bandwidth?"center":"right"),Q=B??(t==="top"?U:$)-3;return V==="center"?(this.frameAnchor=t,this.textAnchor=void 0):(this.frameAnchor=`${t}-${V}`,this.textAnchor=V==="right"?"end":"start"),this.lineAnchor=t,this.dy=t==="top"?-Q:Q,this.dx=V==="right"?k-3:V==="left"?3-z:0,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[Mq(e,C,{anchor:t,label:I,labelAnchor:V,labelArrow:A})]}}}})):null)}function Bct(e,t,r,{strokeWidth:n=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:d=0,y:h=e==="y"?void 0:null,...p}){return Yp(nT,e,t,`${e}-axis tick`,r,{strokeWidth:n,strokeLinecap:i,strokeLinejoin:o,facetAnchor:s,frameAnchor:a,y:h,...p,dx:t==="left"?+d-ur+ +u:+d+ur-f,anchor:"start",length:c,shape:t==="left"?Cct:Uct})}function Oct(e,t,r,{strokeWidth:n=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:d=0,x:h=e==="x"?void 0:null,...p}){return Yp(rT,e,t,`${e}-axis tick`,r,{strokeWidth:n,strokeLinejoin:o,strokeLinecap:i,facetAnchor:s,frameAnchor:a,x:h,...p,dy:t==="bottom"?+d-ur-f:+d+ur+ +u,anchor:"start",length:c,shape:t==="bottom"?Rct:kct})}function Nct(e,t,r,{facetAnchor:n=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*jp):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:d=0,insetLeft:h=d,insetRight:p=d,dx:y=0,y:g=e==="y"?void 0:null,...m}){return Yp(JI,e,t,`${e}-axis tick label`,r,{facetAnchor:n,frameAnchor:i,text:c,textAnchor:l,lineAnchor:u,fontVariant:f,rotate:s,y:g,...m,dx:t==="left"?+y-o-a+ +h:+y+ +o+ +a-p},function(b,x,_,v,w){f===void 0&&(this.fontVariant=Aq(b)),c===void 0&&(w.text=Tq(b,x,_,v,t))})}function Fct(e,t,r,{facetAnchor:n=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*jp):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:d=0,insetTop:h=d,insetBottom:p=d,dy:y=0,x:g=e==="x"?void 0:null,...m}){return Yp(QI,e,t,`${e}-axis tick label`,r,{facetAnchor:n,frameAnchor:i,text:c===void 0?null:c,textAnchor:l,lineAnchor:u,fontVariant:f,rotate:s,x:g,...m,dy:t==="bottom"?+y+ +o+ +a-p:+y-o-a+ +h},function(b,x,_,v,w){f===void 0&&(this.fontVariant=Aq(b)),c===void 0&&(w.text=Tq(b,x,_,v,t))})}function aT(){let[e,t]=Du(...arguments);return wq("y",mq(t),e,t)}function cT(){let[e,t]=Du(...arguments);return wq("fy",yq(t),e,t)}function lT(){let[e,t]=Du(...arguments);return vq("x",gq(t),e,t)}function uT(){let[e,t]=Du(...arguments);return vq("fx",bq(t),e,t)}function wq(e,t,r,{y:n=e==="y"?void 0:null,x:i=null,x1:o=t==="left"?i:null,x2:s=t==="right"?i:null,...a}){return Yp(Ki,e,t,`${e}-grid`,r,{y:n,x1:o,x2:s,...Sq(a)})}function vq(e,t,r,{x:n=e==="x"?void 0:null,y:i=null,y1:o=t==="top"?i:null,y2:s=t==="bottom"?i:null,...a}){return Yp(Zi,e,t,`${e}-grid`,r,{x:n,y1:o,y2:s,...Sq(a)})}function Sq({color:e="currentColor",opacity:t=.1,stroke:r=e,strokeOpacity:n=t,strokeWidth:i=1,...o}){return{stroke:r,strokeOpacity:n,strokeWidth:i,...o}}function Iq({fill:e,fillOpacity:t,fontFamily:r,fontSize:n,fontStyle:i,fontVariant:o,fontWeight:s,monospace:a,pointerEvents:c,shapeRendering:l,clip:u=!1},f){return[,e]=cr(e),[,t]=Ae(t),{facet:"super",x:null,y:null,fill:e,fillOpacity:t,fontFamily:r,fontSize:n,fontStyle:i,fontVariant:o,fontWeight:s,monospace:a,pointerEvents:c,shapeRendering:l,clip:u,initializer:f}}function Yp(e,t,r,n,i,o,s){let a;function c(f,d,h,p,y,g){let m=f==null&&(t==="fx"||t==="fy"),{[t]:b}=p;if(!b)throw new Error(`missing scale: ${t}`);let x=b.domain(),{interval:_,ticks:v,tickFormat:w,tickSpacing:I=t==="x"?80:35}=o;if(typeof v=="string"&&Dq(b)&&(_=v,v=void 0),v===void 0&&(v=ba(_,b.type)??Lct(b,I)),f==null){if(oi(v))f=Sr(v);else if(_u(v))f=A3(v,...Be(x));else if(b.interval){let A=b.interval;if(b.ticks){let[B,M]=Be(x),O=(M-B)/A[wp];A=IN(A,O/v)??A,f=A3(A,B,M)}else{f=x;let B=f.length;A=IN(A,B/v)??A,A!==b.interval&&(f=A3(A,...Be(f)))}if(A===b.interval){let B=Math.round(f.length/v);B>1&&(f=f.filter((M,O)=>O%B===0))}}else b.ticks?f=b.ticks(v):f=x;if(!b.ticks&&f.length&&f!==x){let A=new Xn(x);f=f.filter(B=>A.has(B)),f.length||kn(`Warning: the ${t}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}t==="y"||t==="x"?d=[ii(f)]:a[t]={scale:t,value:K}}s?.call(this,b,f,v,w,a);let D=Object.fromEntries(Object.entries(a).map(([A,B])=>[A,{...B,value:Tt(f,B.value)}]));return m&&(d=g.filterFacets(f,D)),{data:f,facets:d,channels:D}}let l=Qe(o).initializer,u=e(i,Qe({...o,initializer:c},l));return i==null?(a=u.channels,u.channels={}):a={},u.ariaLabel=n,u.clip===void 0&&(u.clip=!1),u}function Lct(e,t){let[r,n]=Be(e.range());return(n-r)/t}function Tq(e,t,r,n,i){return{value:Ub(e,t,r,n,i)}}function Ub(e,t,r,n,i){return typeof n=="function"?n:n===void 0&&t&&lr(t)?oV(e.type,t,i)??gs:e.tickFormat?e.tickFormat(typeof r=="number"?r:null,n):n===void 0?gs:typeof n=="string"?(lr(e.domain())?ha:wo)(n):Qr(n)}function A3(e,t,r){return e.range(t,e.offset(e.floor(r)))}var Rct={draw(e,t){e.moveTo(0,0),e.lineTo(0,t)}},kct={draw(e,t){e.moveTo(0,0),e.lineTo(0,-t)}},Cct={draw(e,t){e.moveTo(0,0),e.lineTo(-t,0)}},Uct={draw(e,t){e.moveTo(0,0),e.lineTo(t,0)}};function Aq(e){return e.bandwidth&&!e.interval?void 0:"tabular-nums"}function Mq(e,t,{anchor:r,label:n=t.label,labelAnchor:i,labelArrow:o}={}){if(!(n==null||n.inferred&&Dq(t)&&/^(date|time|year)$/i.test(n))){if(n=String(n),o==="auto"&&(o=(!t.bandwidth||t.interval)&&!/[↑↓→←]/.test(n)),!o)return n;if(o===!0){let s=PI(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 ${n}`;case"right":return`${n} \u2192`;case"up":return r==="right"?`${n} \u2191`:`\u2191 ${n}`;case"down":return r==="right"?`${n} \u2193`:`\u2193 ${n}`}return n}}function Eq(e="auto"){return Se(e)?!1:typeof e=="boolean"?e:Ur(e,"labelArrow",["auto","up","right","down","left"])}function Dq(e){return lr(e.domain())}function Bq(e,t){if(t==null)return t;let r=e(t);if(!r)throw new Error(`scale not found: ${t}`);return r}function Oq(e,{opacity:t,...r}={}){if(!wa(e)&&!a3(e))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${e.type})`);return Fq(e,r,(n,i,o,s)=>n.append("svg").attr("width",o).attr("height",s).attr("fill",i.scale).attr("fill-opacity",Ae(t)[1]).append("rect").attr("width","100%").attr("height","100%"))}function Nq(e,{fill:t=e.hint?.fill!==void 0?e.hint.fill:"none",fillOpacity:r=1,stroke:n=e.hint?.stroke!==void 0?e.hint.stroke:Se(t)?"currentColor":"none",strokeOpacity:i=1,strokeWidth:o=1.5,r:s=4.5,...a}={},c){let[l,u]=cr(t),[f,d]=cr(n),h=Bq(c,l),p=Bq(c,f),y=s*s*Math.PI;return r=Ae(r)[1],i=Ae(i)[1],o=Ae(o)[1],Fq(e,a,(g,m,b,x)=>g.append("svg").attr("viewBox","-8 -8 16 16").attr("width",b).attr("height",x).attr("fill",l==="color"?_=>h.scale(_):u).attr("fill-opacity",r).attr("stroke",f==="color"?_=>p.scale(_):d).attr("stroke-opacity",i).attr("stroke-width",o).append("path").attr("d",_=>{let v=Qn();return e.scale(_).draw(v,y),v}))}function Fq(e,t={},r){let{columns:n,tickFormat:i,fontVariant:o=WI(e),swatchSize:s=15,swatchWidth:a=s,swatchHeight:c=s,marginLeft:l=0,className:u,style:f,width:d}=t,h=Tu(t);u=Np(u),i=Ub(e.scale,e.domain,void 0,i);let p=pt("div",h).attr("class",`${u}-swatches ${u}-swatches-${n!=null?"columns":"wrap"}`),y;return n!=null?(y=`:where(.${u}-swatches-columns .${u}-swatch) {
|
|
28
37
|
display: flex;
|
|
29
38
|
align-items: center;
|
|
30
39
|
break-inside: avoid;
|
|
@@ -37,7 +46,7 @@ ${n}`}function ZH(e){return e==="time"?k1:e==="utc"?mm:XH}function kC(e,t,n){let
|
|
|
37
46
|
white-space: nowrap;
|
|
38
47
|
overflow: hidden;
|
|
39
48
|
text-overflow: ellipsis;
|
|
40
|
-
}`,p.style("columns",
|
|
49
|
+
}`,p.style("columns",n).selectAll().data(e.domain).enter().append("div").attr("class",`${u}-swatch`).call(r,e,a,c).call(g=>g.append("div").attr("class",`${u}-swatch-label`).attr("title",i).text(i))):(y=`:where(.${u}-swatches-wrap) {
|
|
41
50
|
display: flex;
|
|
42
51
|
align-items: center;
|
|
43
52
|
min-height: 33px;
|
|
@@ -47,7 +56,7 @@ ${n}`}function ZH(e){return e==="time"?k1:e==="utc"?mm:XH}function kC(e,t,n){let
|
|
|
47
56
|
display: inline-flex;
|
|
48
57
|
align-items: center;
|
|
49
58
|
margin-right: 1em;
|
|
50
|
-
}`,p.selectAll().data(e.domain).enter().append("span").attr("class",`${u}-swatch`).call(
|
|
59
|
+
}`,p.selectAll().data(e.domain).enter().append("span").attr("class",`${u}-swatch`).call(r,e,a,c).append(function(){return this.ownerDocument.createTextNode(i.apply(this,arguments))})),p.call(g=>g.insert("style","*").text(`:where(.${u}-swatches) {
|
|
51
60
|
font-family: system-ui, sans-serif;
|
|
52
61
|
font-size: 10px;
|
|
53
62
|
margin-bottom: 0.5em;
|
|
@@ -56,7 +65,7 @@ ${n}`}function ZH(e){return e==="time"?k1:e==="utc"?mm:XH}function kC(e,t,n){let
|
|
|
56
65
|
margin-right: 0.5em;
|
|
57
66
|
overflow: visible;
|
|
58
67
|
}
|
|
59
|
-
${m}`)).style("margin-left",l?`${+l}px`:null).style("width",d===void 0?null:`${+d}px`).style("font-variant",le(o,"normal")).call(Af,f).node()}var N_=new Map([["symbol",s7],["color",u7],["opacity",PQ]]);function c7(e={}){for(let[t,n]of N_){let r=e[t];if(Oo(r)){let i=nc(e),o;if(t==="symbol"){let{fill:s,stroke:a=s===void 0&&Oo(e.color)?"color":void 0}=e;o={fill:s,stroke:a}}return n(o_(t,r,o),YE(i,r,e),s=>Oo(e[s])?o_(s,e[s]):null)}}throw new Error("unknown legend type; no scale found")}function l7(e,t,n={}){return(r,i)=>{if(!N_.has(r))throw new Error(`unknown legend type: ${r}`);if(r in e)return N_.get(r)(e[r],YE(t,n[r],i),o=>e[o])}}function YE({className:e,...t},{label:n,ticks:r,tickFormat:i}={},o){return WC(o,{className:e,...t},{label:n,ticks:r,tickFormat:i})}function u7(e,{legend:t=!0,...n}){if(t===!0&&(t=e.type==="ordinal"?"swatches":"ramp"),e.domain!==void 0)switch(`${t}`.toLowerCase()){case"swatches":return o7(e,n);case"ramp":return wB(e,n);default:throw new Error(`unknown legend type: ${t}`)}}function PQ({type:e,interpolate:t,...n},{legend:r=!0,color:i=rn(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 u7({type:e,...n,interpolate:$Q(i)},{legend:r,...o})}function $Q(e){let{r:t,g:n,b:r}=rn(e)||rn(0,0,0);return i=>`rgba(${t},${n},${r},${i})`}function f7(e,t,n){let r=[];for(let[i,o]of N_){let s=n[i];if(s?.legend&&i in e){let a=o(e[i],YE(t,e[i],s),c=>e[c]);a!=null&&r.push(a)}}return r}var UQ={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},zQ={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1},Lm=class extends wt{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(Xa,void 0,t,n==null?UQ:zQ),this.anchor=WT(n,"anchor",["top","right","bottom","left"]),this.insetTop=Nt(i),this.insetRight=Nt(o),this.insetBottom=Nt(s),this.insetLeft=Nt(a),this.rx=Nt(c),this.ry=Nt(l)}render(t,n,r,i,o){let{marginTop:s,marginRight:a,marginBottom:c,marginLeft:l,width:u,height:f}=i,{anchor:d,insetTop:h,insetRight:p,insetBottom:m,insetLeft:g,rx:y,ry:b}=this,x=l+g,_=u-a-p,v=s+h,w=f-c-m;return ct(d?"svg:line":"svg:rect",o).datum(0).call(Ft,this,i,o).call(Rt,this).call(Zt,this,r).call(It,this,{}).call(d==="left"?T=>T.attr("x1",x).attr("x2",x).attr("y1",v).attr("y2",w):d==="right"?T=>T.attr("x1",_).attr("x2",_).attr("y1",v).attr("y2",w):d==="top"?T=>T.attr("x1",x).attr("x2",_).attr("y1",v).attr("y2",v):d==="bottom"?T=>T.attr("x1",x).attr("x2",_).attr("y1",w).attr("y2",w):T=>T.attr("x",x).attr("y",v).attr("width",_-x).attr("height",w-v).attr("rx",y).attr("ry",b)).node()}};function Uf(e){return new Lm(e)}var GE={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor"},qQ=new Set(["geometry","href","src","ariaLabel","scales"]),Cm=class extends wt{constructor(t,n={}){n.tip&&(n={...n,tip:!1}),n.title===void 0&&cr(t)&&B1(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:d=f?"ui-monospace, monospace":void 0,fontSize:h,fontStyle:p,fontVariant:m,fontWeight:g,lineHeight:y=1,lineWidth:b=20,frameAnchor:x,format:_,textAnchor:v="start",textOverflow:w,textPadding:T=8,title:M,pointerSize:R=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:M,optional:!0}},n,GE),this.anchor=$1(l,"anchor"),this.preferredAnchor=$1(u,"preferredAnchor"),this.frameAnchor=Fo(x),this.textAnchor=le(v,"middle"),this.textPadding=+T,this.pointerSize=+R,this.pathFilter=ze(I),this.lineHeight=+y,this.lineWidth=+b,this.textOverflow=$E(w),this.monospace=!!f,this.fontFamily=ze(d),this.fontSize=Nt(h),this.fontStyle=ze(p),this.fontVariant=ze(m),this.fontWeight=ze(g);for(let A in GE)A in this.channels&&(this[A]=GE[A]);this.splitLines=zE(this),this.clipLine=qE(this),this.format={..._}}render(t,n,r,i,o){let s=this,{x:a,y:c,fx:l,fy:u}=n,{ownerSVGElement:f,document:d}=o,{anchor:h,monospace:p,lineHeight:m,lineWidth:g}=this,{textPadding:y,pointerSize:b,pathFilter:x}=this,{marginTop:_,marginLeft:v}=i,{x1:w,y1:T,x2:M,y2:R,x:I=w??M,y:A=T??R}=r,O=l?l(t.fx)-v:0,F=u?u(t.fy)-_:0,[S,E]=yn(this,i),N=DE(r,S),L=kE(r,E),B=p?x_:b_,C=B(Rl),P,$;"title"in r?(P=r.channels,$=WQ):(P=GQ.call(this,r,n),$=XQ);let U=ct("svg:g",o).call(Ft,this,i,o).call(UE,this).call(It,this,{x:I&&a,y:A&&c}).call(nt=>nt.selectAll().data(t).enter().append("g").attr("transform",st=>`translate(${Math.round(N(st))},${Math.round(L(st))})`).call(Rt,this).call(st=>st.append("path").attr("filter",x)).call(st=>st.append("text").each(function(Y){let rt=qt(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");let q=$.call(s,Y,t,P,n,r);if(typeof q=="string")for(let H of s.splitLines(q))X(rt,{value:s.clipLine(H)});else{let H=new Set;for(let ot of q){let{label:z=""}=ot;z&&H.has(z)||(H.add(z),X(rt,ot))}}})));function X(nt,{label:st,value:Y,color:rt,opacity:q}){st??="",Y??="";let H=rt!=null||q!=null,ot,z=g*100,[Lt]=Dl(st,z,B,C);if(Lt>=0)st=st.slice(0,Lt).trimEnd()+Rl,ot=Y.trim(),Y="";else{(st||!Y&&!H)&&(Y=" "+Y);let[Wt]=Dl(Y,z-B(st),B,C);Wt>=0&&(ot=Y.trim(),Y=Y.slice(0,Wt).trimEnd()+Rl)}let dt=nt.append("tspan").attr("x",0).attr("dy",`${m}em`).text("\u200B");st&&dt.append("tspan").attr("font-weight","bold").text(st),Y&&dt.append(()=>d.createTextNode(Y)),H&&dt.append("tspan").text(" \u25A0").attr("fill",rt).attr("fill-opacity",q).style("user-select","none"),ot&&dt.append("title").text(ot)}function tt(){let{width:nt,height:st}=i.facet??i;U.selectChildren().each(function(Y){let{x:rt,width:q,height:H}=this.getBBox();q=Math.round(q),H=Math.round(H);let ot=h;if(ot===void 0){let dt=N(Y)+O,Wt=L(Y)+F,Xt=dt+q+b+y*2<nt,et=dt-q-b-y*2>0,oe=Wt+H+b+y*2<st,wr=Wt-H-b-y*2>0;ot=Xt&&et?oe&&wr?s.preferredAnchor:wr?"bottom":"top":oe&&wr?Xt?"left":"right":(Xt||et)&&(oe||wr)?`${wr?"bottom":"top"}-${Xt?"left":"right"}`:s.preferredAnchor}let z=this.firstChild,Lt=this.lastChild;if(z.setAttribute("d",YQ(ot,b,y,q,H)),rt)for(let dt of Lt.childNodes)dt.setAttribute("x",-rt);Lt.setAttribute("y",`${+jQ(ot,Lt.childNodes.length,m).toFixed(6)}em`),Lt.setAttribute("transform",`translate(${VQ(ot,b,y,q,H)})`)}),U.attr("visibility",null)}return t.length&&(U.attr("visibility","hidden"),f.isConnected?Promise.resolve().then(tt):typeof requestAnimationFrame<"u"&&requestAnimationFrame(tt)),U.node()}};function O_(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Be(t,n)),new Cm(e,{...r,x:t,y:n})}function jQ(e,t,n){return/^top(?:-|$)/.test(e)?.94-n:-.29-t*n}function VQ(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 YQ(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 GQ({channels:e},t){let n={},r=this.format;r=d7(r,e,"x"),r=d7(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=Im(e,i);s&&(n[i]=s)}}for(let i in e){if(i in n||i in r||qQ.has(i))continue;let o=Im(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]=(Oe(s)?Mo:ci)(o)}else if(o===void 0||o===!0){let s=t[i];this.format[i]=s?.bandwidth?Fm(s,s.domain()):zi}}return n}function d7(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 WQ(e,t,{title:n}){return zi(n.value[e],e)}function*XQ(e,t,n,r,i){for(let o in n){if(o==="fx"||o==="fy"){yield{label:R_(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:p7(r,n,"x"),value:h7(this.format.x2,n.x1,s,e)};else if(o==="y2"&&"y1"in n)yield{label:p7(r,n,"y"),value:h7(this.format.y2,n.y1,s,e)};else{let a=s.value[e],c=s.scale;if(!Ue(a)&&c==null)continue;yield{label:R_(r,n,o),value:this.format[o](a,e),color:c==="color"?i[o][e]:null,opacity:c==="opacity"?i[o][e]:null}}}}function h7(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 p7(e,t,n){let r=R_(e,t,`${n}1`,n),i=R_(e,t,`${n}2`,n);return r===i?r:`${r}\u2013${i}`}function R_(e,t,n,r=n){let i=t[n],o=e[i?.scale??n];return String(o?.label??i?.label??r)}function Pm(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?[]:y7(e.marks);l.push(...eK(l));let u=JQ(t,e),f=new Map;for(let C of l){let P=g7(C,u,e);P&&f.set(C,P)}let d=new Map;u&&Bm(d,[u],e),Bm(d,f,e);let h=y7(nK(l,d,e));for(let C of h){let P=g7(C,u,e);P&&f.set(C,P)}l.unshift(...h);let p=mB(d,e);if(p!==void 0){let C=u?l_(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?l_(p,U):C)}let P=new Set;for(let{facetsIndex:$}of f.values())$?.forEach((U,X)=>{U?.length>0&&P.add(X)});p.forEach(0<P.size&&P.size<p.length?($,U)=>$.empty=!P.has(U):$=>$.empty=!1);for(let $ of l)if($.facet==="exclude"){let U=f.get($);U!==void 0&&(U.facetsIndex=bB(U.facetsIndex))}}for(let C of fe.keys())Oo(e[C])&&C!=="fx"&&C!=="fy"&&d.set(C,[]);let m=new Map;for(let C of l){if(m.has(C))throw new Error("duplicate mark; each mark must be unique");let{facetsIndex:P,channels:$}=f.get(C)??{},{data:U,facets:X,channels:tt}=C.initialize(P,$,e);HE(tt,e),m.set(C,{data:U,facets:X,channels:tt})}let g=Nm(Bm(d,m,e),e),y=hB(g,l,e);sB(g,y);let b=SE(g),{fx:x,fy:_}=b,v=x||_?IE(g,y):y,w=x||_?lK(b,y):y,T=nc(e),M=T.document,R=Ts("svg").call(M.documentElement),I=R;T.ownerSVGElement=R,T.className=c,T.projection=x5(e,v),T.filterFacets=(C,P)=>l_(p,{channels:P,groups:a_(C,P)}),T.getMarkState=C=>{let P=m.get(C),$=f.get(C);return{...P,channels:{...P.channels,...$?.channels}}},T.dispatchValue=C=>{I.value!==C&&(I.value=C,I.dispatchEvent(new Event("input",{bubbles:!0})))};let A=new Set;for(let[C,P]of m)if(C.initializer!=null){let $=C.facet==="super"?w:v,U=C.initializer(P.data,P.facets,P.channels,b,$,T);if(U.data!==void 0&&(P.data=U.data),U.facets!==void 0&&(P.facets=U.facets),U.channels!==void 0){let{fx:X,fy:tt,...nt}=U.channels;KQ(nt),Object.assign(P.channels,nt);for(let st of Object.values(nt)){let{scale:Y}=st;Y!=null&&!HC(fe.get(Y))&&(_7(st,e),A.add(Y))}(X!=null||tt!=null)&&f.set(C,!0)}}if(A.size){let C=new Map;Bm(C,m,e,X=>A.has(X)),Bm(d,m,e,X=>A.has(X));let P=cK(Nm(C,e),g),{scales:$,...U}=SE(P);Object.assign(g,P),Object.assign(b,U),Object.assign(b.scales,$)}let O,F;p!==void 0&&(O={x:x?.domain(),y:_?.domain()},p=yB(p,O),F=gB(x,_,y));for(let[C,P]of m)P.values=C.scale(P.channels,b,T);let{width:S,height:E}=y;qt(R).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",E).attr("viewBox",`0 0 ${S} ${E}`).attr("aria-label",s).attr("aria-description",a).call(C=>C.append("style").text(`:where(.${c}) {
|
|
68
|
+
${y}`)).style("margin-left",l?`${+l}px`:null).style("width",d===void 0?null:`${+d}px`).style("font-variant",Ne(o,"normal")).call(Fp,f).node()}var fT=new Map([["symbol",Nq],["color",kq],["opacity",Pct]]);function Lq(e={}){for(let[t,r]of fT){let n=e[t];if(ya(n)){let i=Tu(e),o;if(t==="symbol"){let{fill:s,stroke:a=s===void 0&&ya(e.color)?"color":void 0}=e;o={fill:s,stroke:a}}return r(zI(t,n,o),M3(i,n,e),s=>ya(e[s])?zI(s,e[s]):null)}}throw new Error("unknown legend type; no scale found")}function Rq(e,t,r={}){return(n,i)=>{if(!fT.has(n))throw new Error(`unknown legend type: ${n}`);if(n in e)return fT.get(n)(e[n],M3(t,r[n],i),o=>e[o])}}function M3({className:e,...t},{label:r,ticks:n,tickFormat:i}={},o){return xV(o,{className:e,...t},{label:r,ticks:n,tickFormat:i})}function kq(e,{legend:t=!0,...r}){if(t===!0&&(t=e.type==="ordinal"?"swatches":"ramp"),e.domain!==void 0)switch(`${t}`.toLowerCase()){case"swatches":return Oq(e,r);case"ramp":return Gj(e,r);default:throw new Error(`unknown legend type: ${t}`)}}function Pct({type:e,interpolate:t,...r},{legend:n=!0,color:i=qr(0,0,0),...o}){if(!t)throw new Error(`${e} opacity scales are not supported`);if(n===!0&&(n="ramp"),`${n}`.toLowerCase()!=="ramp")throw new Error(`${n} opacity legends are not supported`);return kq({type:e,...r,interpolate:$ct(i)},{legend:n,...o})}function $ct(e){let{r:t,g:r,b:n}=qr(e)||qr(0,0,0);return i=>`rgba(${t},${r},${n},${i})`}function Cq(e,t,r){let n=[];for(let[i,o]of fT){let s=r[i];if(s?.legend&&i in e){let a=o(e[i],M3(t,e[i],s),c=>e[c]);a!=null&&n.push(a)}}return n}var zct={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},Vct={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1},Pb=class extends Ft{constructor(t={}){let{anchor:r=null,inset:n=0,insetTop:i=n,insetRight:o=n,insetBottom:s=n,insetLeft:a=n,rx:c,ry:l}=t;super(gu,void 0,t,r==null?zct:Vct),this.anchor=DN(r,"anchor",["top","right","bottom","left"]),this.insetTop=Wt(i),this.insetRight=Wt(o),this.insetBottom=Wt(s),this.insetLeft=Wt(a),this.rx=Wt(c),this.ry=Wt(l)}render(t,r,n,i,o){let{marginTop:s,marginRight:a,marginBottom:c,marginLeft:l,width:u,height:f}=i,{anchor:d,insetTop:h,insetRight:p,insetBottom:y,insetLeft:g,rx:m,ry:b}=this,x=l+g,_=u-a-p,v=s+h,w=f-c-y;return pt(d?"svg:line":"svg:rect",o).datum(0).call(Kt,this,i,o).call(Gt,this).call(ye,this,n).call(Pt,this,{}).call(d==="left"?I=>I.attr("x1",x).attr("x2",x).attr("y1",v).attr("y2",w):d==="right"?I=>I.attr("x1",_).attr("x2",_).attr("y1",v).attr("y2",w):d==="top"?I=>I.attr("x1",x).attr("x2",_).attr("y1",v).attr("y2",v):d==="bottom"?I=>I.attr("x1",x).attr("x2",_).attr("y1",w).attr("y2",w):I=>I.attr("x",x).attr("y",v).attr("width",_-x).attr("height",w-v).attr("rx",m).attr("ry",b)).node()}};function Wp(e){return new Pb(e)}var E3={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor"},jct=new Set(["geometry","href","src","ariaLabel","scales"]),$b=class extends Ft{constructor(t,r={}){r.tip&&(r={...r,tip:!1}),r.title===void 0&&oi(t)&&xI(t)&&(r={...r,title:K});let{x:n,y:i,x1:o,x2:s,y1:a,y2:c,anchor:l,preferredAnchor:u="bottom",monospace:f,fontFamily:d=f?"ui-monospace, monospace":void 0,fontSize:h,fontStyle:p,fontVariant:y,fontWeight:g,lineHeight:m=1,lineWidth:b=20,frameAnchor:x,format:_,textAnchor:v="start",textOverflow:w,textPadding:I=8,title:D,pointerSize:A=12,pathFilter:B="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=r;super(t,{x:{value:o!=null&&s!=null?null:n,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}},r,E3),this.anchor=wI(l,"anchor"),this.preferredAnchor=wI(u,"preferredAnchor"),this.frameAnchor=xa(x),this.textAnchor=Ne(v,"middle"),this.textPadding=+I,this.pointerSize=+A,this.pathFilter=vr(B),this.lineHeight=+m,this.lineWidth=+b,this.textOverflow=w3(w),this.monospace=!!f,this.fontFamily=vr(d),this.fontSize=Wt(h),this.fontStyle=vr(p),this.fontVariant=vr(y),this.fontWeight=vr(g);for(let M in E3)M in this.channels&&(this[M]=E3[M]);this.splitLines=S3(this),this.clipLine=I3(this),this.format={..._}}render(t,r,n,i,o){let s=this,{x:a,y:c,fx:l,fy:u}=r,{ownerSVGElement:f,document:d}=o,{anchor:h,monospace:p,lineHeight:y,lineWidth:g}=this,{textPadding:m,pointerSize:b,pathFilter:x}=this,{marginTop:_,marginLeft:v}=i,{x1:w,y1:I,x2:D,y2:A,x:B=w??D,y:M=I??A}=n,O=l?l(t.fx)-v:0,R=u?u(t.fy)-_:0,[S,T]=rn(this,i),E=p3(n,S),C=m3(n,T),U=p?eT:tT,k=U(md),$,z;"title"in n?($=n.channels,z=Xct):($=Gct.call(this,n,r),z=Hct);let V=pt("svg:g",o).call(Kt,this,i,o).call(v3,this).call(Pt,this,{x:B&&a,y:M&&c}).call(st=>st.selectAll().data(t).enter().append("g").attr("transform",ut=>`translate(${Math.round(E(ut))},${Math.round(C(ut))})`).call(Gt,this).call(ut=>ut.append("path").attr("filter",x)).call(ut=>ut.append("text").each(function(X){let at=ae(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");let q=z.call(s,X,t,$,r,n);if(typeof q=="string")for(let J of s.splitLines(q))Q(at,{value:s.clipLine(J)});else{let J=new Set;for(let ct of q){let{label:j=""}=ct;j&&J.has(j)||(J.add(j),Q(at,ct))}}})));function Q(st,{label:ut,value:X,color:at,opacity:q}){ut??="",X??="";let J=at!=null||q!=null,ct,j=g*100,[Qt]=gd(ut,j,U,k);if(Qt>=0)ut=ut.slice(0,Qt).trimEnd()+md,ct=X.trim(),X="";else{(ut||!X&&!J)&&(X=" "+X);let[he]=gd(X,j-U(ut),U,k);he>=0&&(ct=X.trim(),X=X.slice(0,he).trimEnd()+md)}let gt=st.append("tspan").attr("x",0).attr("dy",`${y}em`).text("\u200B");ut&>.append("tspan").attr("font-weight","bold").text(ut),X&>.append(()=>d.createTextNode(X)),J&>.append("tspan").text(" \u25A0").attr("fill",at).attr("fill-opacity",q).style("user-select","none"),ct&>.append("title").text(ct)}function nt(){let{width:st,height:ut}=i.facet??i;V.selectChildren().each(function(X){let{x:at,width:q,height:J}=this.getBBox();q=Math.round(q),J=Math.round(J);let ct=h;if(ct===void 0){let gt=E(X)+O,he=C(X)+R,pe=gt+q+b+m*2<st,ot=gt-q-b-m*2>0,Me=he+J+b+m*2<ut,Ti=he-J-b-m*2>0;ct=pe&&ot?Me&&Ti?s.preferredAnchor:Ti?"bottom":"top":Me&&Ti?pe?"left":"right":(pe||ot)&&(Me||Ti)?`${Ti?"bottom":"top"}-${pe?"left":"right"}`:s.preferredAnchor}let j=this.firstChild,Qt=this.lastChild;if(j.setAttribute("d",Wct(ct,b,m,q,J)),at)for(let gt of Qt.childNodes)gt.setAttribute("x",-at);Qt.setAttribute("y",`${+qct(ct,Qt.childNodes.length,y).toFixed(6)}em`),Qt.setAttribute("transform",`translate(${Yct(ct,b,m,q,J)})`)}),V.attr("visibility",null)}return t.length&&(V.attr("visibility","hidden"),f.isConnected?Promise.resolve().then(nt):typeof requestAnimationFrame<"u"&&requestAnimationFrame(nt)),V.node()}};function hT(e,{x:t,y:r,...n}={}){return n.frameAnchor===void 0&&([t,r]=gr(t,r)),new $b(e,{...n,x:t,y:r})}function qct(e,t,r){return/^top(?:-|$)/.test(e)?.94-r:-.29-t*r}function Yct(e,t,r,n,i){switch(e){case"middle":return[-n/2,i/2];case"top-left":return[r,t+r];case"top":return[-n/2,t/2+r];case"top-right":return[-n-r,t+r];case"right":return[-t/2-n-r,i/2];case"bottom-left":return[r,-t-r];case"bottom":return[-n/2,-t/2-r];case"bottom-right":return[-n-r,-t-r];case"left":return[r+t/2,i/2]}}function Wct(e,t,r,n,i){let o=n+r*2,s=i+r*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 Gct({channels:e},t){let r={},n=this.format;n=Uq(n,e,"x"),n=Uq(n,e,"y"),this.format=n;for(let i in n){let o=n[i];if(!(o===null||o===!1))if(i==="fx"||i==="fy")r[i]=!0;else{let s=Eb(e,i);s&&(r[i]=s)}}for(let i in e){if(i in r||i in n||jct.has(i))continue;let o=Eb(e,i);o&&(r[i]=o)}this.facet&&(t.fx&&!("fx"in n)&&(r.fx=!0),t.fy&&!("fy"in n)&&(r.fy=!0));for(let i in r){let o=this.format[i];if(typeof o=="string"){let s=r[i]?.value??t[i]?.domain()??[];this.format[i]=(lr(s)?ha:wo)(o)}else if(o===void 0||o===!0){let s=t[i];this.format[i]=s?.bandwidth?Ub(s,s.domain()):gs}}return r}function Uq(e,t,r){if(!(r in e))return e;let n=`${r}1`,i=`${r}2`;if((n in e||!(n in t))&&(i in e||!(i in t)))return e;let o=Object.entries(e),s=e[r];return o.splice(o.findIndex(([a])=>a===r)+1,0,[n,s],[i,s]),Object.fromEntries(o)}function Xct(e,t,{title:r}){return gs(r.value[e],e)}function*Hct(e,t,r,n,i){for(let o in r){if(o==="fx"||o==="fy"){yield{label:dT(n,r,o),value:this.format[o](t[o],e)};continue}if(o==="x1"&&"x2"in r||o==="y1"&&"y2"in r)continue;let s=r[o];if(o==="x2"&&"x1"in r)yield{label:$q(n,r,"x"),value:Pq(this.format.x2,r.x1,s,e)};else if(o==="y2"&&"y1"in r)yield{label:$q(n,r,"y"),value:Pq(this.format.y2,r.y1,s,e)};else{let a=s.value[e],c=s.scale;if(!wr(a)&&c==null)continue;yield{label:dT(n,r,o),value:this.format[o](a,e),color:c==="color"?i[o][e]:null,opacity:c==="opacity"?i[o][e]:null}}}}function Pq(e,t,r,n){return r.hint?.length?`${e(r.value[n]-t.value[n],n)}`:`${e(t.value[n],n)}\u2013${e(r.value[n],n)}`}function $q(e,t,r){let n=dT(e,t,`${r}1`,r),i=dT(e,t,`${r}2`,r);return n===i?n:`${n}\u2013${i}`}function dT(e,t,r,n=r){let i=t[r],o=e[i?.scale??r];return String(o?.label??i?.label??n)}function Vb(e={}){let{facet:t,style:r,title:n,subtitle:i,caption:o,ariaLabel:s,ariaDescription:a}=e,c=Np(e.className),l=e.marks===void 0?[]:Vq(e.marks);l.push(...rlt(l));let u=tlt(t,e),f=new Map;for(let k of l){let $=jq(k,u,e);$&&f.set(k,$)}let d=new Map;u&&zb(d,[u],e),zb(d,f,e);let h=Vq(nlt(l,d,e));for(let k of h){let $=jq(k,u,e);$&&f.set(k,$)}l.unshift(...h);let p=zj(d,e);if(p!==void 0){let k=u?YI(p,u):void 0;for(let z of l){if(z.facet===null||z.facet==="super")continue;let V=f.get(z);V!==void 0&&(V.facetsIndex=z.fx!=null||z.fy!=null?YI(p,V):k)}let $=new Set;for(let{facetsIndex:z}of f.values())z?.forEach((V,Q)=>{V?.length>0&&$.add(Q)});p.forEach(0<$.size&&$.size<p.length?(z,V)=>z.empty=!$.has(V):z=>z.empty=!1);for(let z of l)if(z.facet==="exclude"){let V=f.get(z);V!==void 0&&(V.facetsIndex=qj(V.facetsIndex))}}for(let k of Fe.keys())ya(e[k])&&k!=="fx"&&k!=="fy"&&d.set(k,[]);let y=new Map;for(let k of l){if(y.has(k))throw new Error("duplicate mark; each mark must be unique");let{facetsIndex:$,channels:z}=f.get(k)??{},{data:V,facets:Q,channels:nt}=k.initialize($,z,e);O3(nt,e),y.set(k,{data:V,facets:Q,channels:nt})}let g=Fb(zb(d,y,e),e),m=Pj(g,l,e);Nj(g,m);let b=o3(g),{fx:x,fy:_}=b,v=x||_?s3(g,m):m,w=x||_?ult(b,m):m,I=Tu(e),D=I.document,A=kc("svg").call(D.documentElement),B=A;I.ownerSVGElement=A,I.className=c,I.projection=YV(e,v),I.filterFacets=(k,$)=>YI(p,{channels:$,groups:jI(k,$)}),I.getMarkState=k=>{let $=y.get(k),z=f.get(k);return{...$,channels:{...$.channels,...z?.channels}}},I.dispatchValue=k=>{B.value!==k&&(B.value=k,B.dispatchEvent(new Event("input",{bubbles:!0})))};let M=new Set;for(let[k,$]of y)if(k.initializer!=null){let z=k.facet==="super"?w:v,V=k.initializer($.data,$.facets,$.channels,b,z,I);if(V.data!==void 0&&($.data=V.data),V.facets!==void 0&&($.facets=V.facets),V.channels!==void 0){let{fx:Q,fy:nt,...st}=V.channels;Jct(st),Object.assign($.channels,st);for(let ut of Object.values(st)){let{scale:X}=ut;X!=null&&!wV(Fe.get(X))&&(Wq(ut,e),M.add(X))}(Q!=null||nt!=null)&&f.set(k,!0)}}if(M.size){let k=new Map;zb(k,y,e,Q=>M.has(Q)),zb(d,y,e,Q=>M.has(Q));let $=llt(Fb(k,e),g),{scales:z,...V}=o3($);Object.assign(g,$),Object.assign(b,V),Object.assign(b.scales,z)}let O,R;p!==void 0&&(O={x:x?.domain(),y:_?.domain()},p=Vj(p,O),R=jj(x,_,m));for(let[k,$]of y)$.values=k.scale($.channels,b,I);let{width:S,height:T}=m;ae(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",T).attr("viewBox",`0 0 ${S} ${T}`).attr("aria-label",s).attr("aria-description",a).call(k=>k.append("style").text(`:where(.${c}) {
|
|
60
69
|
--plot-background: white;
|
|
61
70
|
display: block;
|
|
62
71
|
height: auto;
|
|
@@ -66,4 +75,4 @@ ${m}`)).style("margin-left",l?`${+l}px`:null).style("width",d===void 0?null:`${+
|
|
|
66
75
|
:where(.${c} text),
|
|
67
76
|
:where(.${c} tspan) {
|
|
68
77
|
white-space: pre;
|
|
69
|
-
}`)).call(Af,n);for(let C of l){let{channels:P,values:$,facets:U}=m.get(C);if(p===void 0||C.facet==="super"){let X=null;if(U&&(X=U[0],X=C.filter(X,P,$),X.length===0))continue;let tt=C.render(X,b,$,w,T);if(tt==null)continue;R.appendChild(tt)}else{let X;for(let tt of p){if(!(C.facetAnchor?.(p,O,tt)??!tt.empty))continue;let nt=null;if(U){let Y=f.has(C);if(nt=U[Y?tt.i:0],nt=C.filter(nt,P,$),nt.length===0)continue;!Y&&nt===U[0]&&(nt=Ys(nt)),nt.fx=tt.x,nt.fy=tt.y,nt.fi=tt.i}let st=C.render(nt,b,$,v,T);if(st!=null){(X??=qt(R).append("g")).append(()=>st).datum(tt);for(let Y of["aria-label","aria-description","aria-hidden","transform"])st.hasAttribute(Y)&&(X.attr(Y,st.getAttribute(Y)),st.removeAttribute(Y))}}X?.selectChildren().attr("transform",F)}}let N=f7(g,T,e),{figure:L=r!=null||i!=null||o!=null||N.length>0}=e;L&&(I=M.createElement("figure"),I.className=`${c}-figure`,I.style.maxWidth="initial",r!=null&&I.append(m7(M,r,"h2")),i!=null&&I.append(m7(M,i,"h3")),I.append(...N,R),o!=null&&I.append(HQ(M,o))),I.scale=uB(b.scales),I.legend=l7(g,T,e),I.projection=T.projection;let B=m5();return B>0&&qt(R).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(`${B.toLocaleString("en-US")} warning${B===1?"":"s"}. Please check the console.`),I}function m7(e,t,n){if(t.ownerDocument)return t;let r=e.createElement(n);return r.append(t),r}function HQ(e,t){let n=e.createElement("figcaption");return n.append(t),n}function ZQ({marks:e=[],...t}={}){return Pm({...t,marks:[...e,this]})}wt.prototype.plot=ZQ;function y7(e){return e.flat(1/0).filter(t=>t!=null).map(QQ)}function QQ(e){return typeof e.render=="function"?e:new XE(e)}var XE=class extends wt{constructor(t){if(typeof t!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}};function HE(e,t){for(let n in e)_7(e[n],t);return e}function _7(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:QT(s,i)}=t[n]??{};a!=null&&(e.value=Yt(e.value,a),e.transform=!1)}function KQ(e){for(let t in e)fE(t,e[t])}function Bm(e,t,n,r=CC){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(!v5(n)){let c=n.x?.domain===void 0,l=n.y?.domain===void 0;if(c||l){let[u,f]=I5(s);c&&WE(e,"x",u),l&&WE(e,"y",f)}}}else WE(e,a,s)}return e}function WE(e,t,n){let r=e.get(t);r!==void 0?r.push(n):e.set(t,[n])}function JQ(e,t){if(e==null)return;let{x:n,y:r}=e;if(n==null&&r==null)return;let i=qe(e.data);if(i==null)throw new Error("missing facet data");let o={};n!=null&&(o.fx=If(i,{value:n,scale:"fx"})),r!=null&&(o.fy=If(i,{value:r,scale:"fy"})),HE(o,t);let s=a_(i,o);return{channels:o,groups:s,data:e.data}}function g7(e,t,n){if(e.facet===null||e.facet==="super")return;let{fx:r,fy:i}=e;if(r!=null||i!=null){let c=qe(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=If(c,{value:r,scale:"fx"})),i!=null&&(l.fy=If(c,{value:i,scale:"fy"})),HE(l,n),{channels:l,groups:a_(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)&&qe(e.data)?.length===a.length&&jn(`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 tK(e,t={}){return Se({...t,x:null,y:null},(n,r,i,o,s,a)=>a.getMarkState(e))}function eK(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)?Cf:/^y$/i.test(i)?Al:Lf,r=i(tK(n,r)),r.title=null,o===void 0&&(r.preferredAnchor=i===Al?"left":"bottom");let s=O_(n.data,r);s.facet=n.facet,s.facetAnchor=n.facetAnchor,t.push(s)}}return t}function nK(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:d}=u,x:{axis:h=c,grid:p=h===null?null:l}=i,y:{axis:m=c,grid:g=m===null?null:l}=o,fx:{axis:y=f,grid:b=y===null?null:d}=s,fy:{axis:x=f,grid:_=x===null?null:d}=a}=n;(r||!Oo(i)&&!b7("x",e))&&(h=p=null),(r||!Oo(o)&&!b7("y",e))&&(m=g=null),t.has("fx")||(y=b=null),t.has("fy")||(x=_=null),h===void 0&&(h=!F_(e,"x")),m===void 0&&(m=!F_(e,"y")),y===void 0&&(y=!F_(e,"fx")),x===void 0&&(x=!F_(e,"fy")),h===!0&&(h="bottom"),m===!0&&(m="left"),y===!0&&(y=h==="top"||h===null?"bottom":"top"),x===!0&&(x=m==="right"||m===null?"left":"right");let v=[];return k_(v,_,E_,a),D_(v,x,S_,"right","left",u,a),k_(v,b,M_,s),D_(v,y,I_,"top","bottom",u,s),k_(v,g,T_,o),D_(v,m,Dm,"left","right",n,o),k_(v,p,A_,i),D_(v,h,km,"bottom","top",n,i),v}function D_(e,t,n,r,i,o,s){if(!t)return;let a=rK(t);s=iK(a?r:t,o,s);let{line:c}=s;(n===Dm||n===km)&&c&&!Xs(c)&&e.push(Uf(oK(s))),e.push(n(s)),a&&e.push(n({...s,anchor:i,label:null}))}function k_(e,t,n,r){!t||Xs(t)||e.push(n(sK(t,r)))}function rK(e){return/^\s*both\s*$/i.test(e)}function iK(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:d=t.label,labelAnchor:h,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:d,labelAnchor:h,labelArrow:p,labelOffset:m}}function oK(e){let{anchor:t,line:n}=e;return{anchor:t,facetAnchor:t+"-empty",stroke:n===!0?void 0:n}}function sK(e,{stroke:t=Ka(e)?e:void 0,ticks:n=aK(e)?e:void 0,tickSpacing:r,ariaLabel:i,ariaDescription:o}){return{stroke:t,ticks:n,tickSpacing:r,ariaLabel:i,ariaDescription:o}}function aK(e){switch(typeof e){case"number":return!0;case"string":return!Ka(e)}return cr(e)||typeof e?.range=="function"}function F_(e,t){let n=`${t}-axis `;return e.some(r=>r.ariaLabel?.startsWith(n))}function b7(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 cK(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 lK({fx:e,fy:t},n){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:a,height:c}=i_(n),l=e&&x7(e),u=t&&x7(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 x7(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 uK=new Map([["basis",gT],["basis-closed",bT],["basis-open",xT],["bundle",_T],["bump-x",dT],["bump-y",hT],["cardinal",wT],["cardinal-closed",vT],["cardinal-open",ST],["catmull-rom",IT],["catmull-rom-closed",TT],["catmull-rom-open",ET],["linear",Us],["linear-closed",AT],["monotone-x",NT],["monotone-y",RT],["natural",OT],["step",DT],["step-after",FT],["step-before",kT]]);function $m(e=Us,t){if(typeof e=="function")return e;let n=uK.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 L_(e=ac,t){return typeof e!="function"&&`${e}`.toLowerCase()==="auto"?ac:$m(e,t)}function ac(e){return Us(e)}function Po(e={y:"count"},t={}){[e,t]=QE(e,t);let{x:n,y:r}=t;return ZE(C_(n,t,W),null,null,r,e,Ml(t))}function $o(e={x:"count"},t={}){[e,t]=QE(e,t);let{x:n,y:r}=t;return ZE(null,C_(r,t,W),n,null,e,Nl(t))}function ta(e={fill:"count"},t={}){[e,t]=QE(e,t);let{x:n,y:r}=fK(t);return ZE(n,r,null,null,e,Ml(Nl(t)))}function S7(e,t,n={}){if(n?.interval==null)return n;let{reduce:r=G1}=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 zf(e={}){return S7(Po,"y",ji(e,"x"))}function qf(e={}){return S7($o,"x",ji(e,"y"))}function ZE(e,t,n,r,{data:i=Y1,filter:o=_m,sort:s,reverse:a,...c}={},l={}){e=w7(e),t=w7(t),c=dK(c,l),i=E7(i,W),s=s==null?void 0:I7("sort",s,l),o=o==null?void 0:T7("filter",o,l),n!=null&&Lo(c,"x","x1","x2")&&(n=null),r!=null&&Lo(c,"y","y1","y2")&&(r=null);let[u,f]=Rn(e),[d,h]=Rn(e),[p,m]=Rn(t),[g,y]=Rn(t),[b,x]=n!=null?[n,"x"]:r!=null?[r,"y"]:[],[_,v]=Rn(b),{x:w,y:T,z:M,fill:R,stroke:I,x1:A,x2:O,y1:F,y2:S,domain:E,cumulative:N,thresholds:L,interval:B,...C}=l,[P,$]=Rn(M),[U]=Re(R),[X]=Re(I),[tt,nt]=Rn(U),[st,Y]=Rn(X);return{..."z"in l&&{z:P||M},..."fill"in l&&{fill:tt||R},..."stroke"in l&&{stroke:st||I},...mn(C,(rt,q,H)=>{let ot=vl(mt(rt,b),H?.[x]),z=mt(rt,M),Lt=mt(rt,U),dt=mt(rt,X),Wt=Sm(c,{z,fill:Lt,stroke:dt}),Xt=[],et=[],oe=ot&&v([]),wr=z&&$([]),Gi=Lt&&nt([]),x$=dt&&Y([]),gR=e&&f([]),_$=e&&h([]),bR=t&&m([]),w$=t&&y([]),v$=mK(e,t,rt),S$=0;for(let jl of c)jl.initialize(rt);s&&s.initialize(rt),o&&o.initialize(rt);for(let jl of q){let xR=[];for(let xd of c)xd.scope("facet",jl);s&&s.scope("facet",jl),o&&o.scope("facet",jl);for(let[xd,I$]of Ja(jl,Wt))for(let[T$,ky]of Ja(I$,ot))for(let[Wi,bc]of v$(ky))if(!(o&&!o.reduce(Wi,bc))){xR.push(S$++),et.push(i.reduceIndex(Wi,rt,bc)),ot&&oe.push(T$),z&&wr.push(Wt===z?xd:z[(Wi.length>0?Wi:ky)[0]]),Lt&&Gi.push(Wt===Lt?xd:Lt[(Wi.length>0?Wi:ky)[0]]),dt&&x$.push(Wt===dt?xd:dt[(Wi.length>0?Wi:ky)[0]]),gR&&(gR.push(bc.x1),_$.push(bc.x2)),bR&&(bR.push(bc.y1),w$.push(bc.y2));for(let E$ of c)E$.reduce(Wi,bc);s&&s.reduce(Wi)}Xt.push(xR)}return lE(Xt,s,a),{data:et,facets:Xt}}),...!Lo(c,"x")&&(u?{x1:u,x2:d,x:xf(u,d)}:{x:w,x1:A,x2:O}),...!Lo(c,"y")&&(p?{y1:p,y2:g,y:xf(p,g)}:{y:T,y1:F,y2:S}),..._&&{[x]:_},...Object.fromEntries(c.map(({name:rt,output:q})=>[rt,q]))}}function QE({cumulative:e,domain:t,thresholds:n,interval:r,...i},o){return[i,{cumulative:e,domain:t,thresholds:n,interval:r,...o}]}function C_(e,{cumulative:t,domain:n,thresholds:r,interval:i},o){return e={...pi(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=KE(e.thresholds,e.interval),e}function fK(e){let{x:t,y:n}=e;return t=C_(t,e),n=C_(n,e),[t.value,n.value]=Be(t.value,n.value),{x:t,y:n}}function w7(e){if(e==null)return;let{value:t,cumulative:n,domain:r=ae,thresholds:i}=e,o=s=>{let a=mt(s,t),c;if(Oe(a)||pK(i)){a=Yt(a,GT,Float64Array);let[u,f]=typeof r=="function"?r(a):r,d=typeof i=="function"&&!Qa(i)?i(a,u,f):i;typeof d=="number"&&(d=qp(u,f,d)),Qa(d)&&(r===ae&&(u=d.floor(u),f=d.offset(d.floor(f))),d=d.range(u,d.offset(f))),c=d}else{a=Qe(a);let[u,f]=typeof r=="function"?r(a):r,d=typeof i=="function"&&!Qa(i)?i(a,u,f):i;if(typeof d=="number")if(r===ae){let h=vs(u,f,d);if(isFinite(h))if(h>0){let p=Math.round(u/h),m=Math.round(f/h);p*h<=u||--p,m*h>f||++m;let g=m-p+1;d=new Float64Array(g);for(let y=0;y<g;++y)d[y]=(p+y)*h}else if(h<0){h=-h;let p=Math.round(u*h),m=Math.round(f*h);p/h<=u||--p,m/h>f||++m;let g=m-p+1;d=new Float64Array(g);for(let y=0;y<g;++y)d[y]=(p+y)/h}else d=[u];else d=[u]}else d=Tn(u,f,d);else Qa(d)&&(r===ae&&(u=d.floor(u),f=d.offset(d.floor(f))),d=d.range(u,d.offset(f)));c=d}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?gK:n>0?yK:JE)(l,c,a),l};return o.label=On(t),o}function KE(e,t,n=v7){if(e===void 0)return t===void 0?n:ko(t);if(typeof e=="string"){switch(e.toLowerCase()){case"freedman-diaconis":return M0;case"scott":return Bh;case"sturges":return Na;case"auto":return v7}return ym(e)}return e}function dK(e,t){return aE(e,t,I7)}function I7(e,t,n){return j1(e,t,n,T7)}function T7(e,t,n){return V1(e,t,n,E7)}function E7(e,t){return Sf(e,t,hK)}function hK(e){switch(`${e}`.toLowerCase()){case"x":return bK;case"x1":return _K;case"x2":return wK;case"y":return xK;case"y1":return vK;case"y2":return SK}throw new Error(`invalid bin reduce: ${e}`)}function v7(e,t,n){return Math.min(200,Bh(e,t,n))}function pK(e){return UC(e)||cr(e)&&Oe(e)}function mK(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,[d,h]]of i.entries())yield[u[f],{data:n,x1:c,y1:d,x2:l,y2:h}]}}: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 JE(e,t,n){return t=Qe(t),r=>{let i=e.map(()=>[]);for(let o of r)i[ws(t,n[o])-1]?.push(o);return i}}function yK(e,t,n){let r=JE(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 gK(e,t,n){let r=JE(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 A7(e,t){let n=(+e+ +t)/2;return e instanceof Date?new Date(n):n}var bK={reduceIndex(e,t,{x1:n,x2:r}){return A7(n,r)}},xK={reduceIndex(e,t,{y1:n,y2:r}){return A7(n,r)}},_K={reduceIndex(e,t,{x1:n}){return n}},wK={reduceIndex(e,t,{x2:n}){return n}},vK={reduceIndex(e,t,{y1:n}){return n}},SK={reduceIndex(e,t,{y2:n}){return n}};function jf(e={}){return XT(e)?e:{...e,x:W}}function Vf(e={}){return HT(e)?e:{...e,y:W}}function M7(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=Za(e);let o=e[jT]=new Uint32Array(n+i);t=t.map(a=>Za(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 tA(e={},t={}){arguments.length===1&&([e,t]=Wf(e));let{y1:n,y:r=n,x:i,...o}=t,[s,a,c,l]=Xf(r,i,"y","x",e,o);return{...s,y1:n,y:a,x1:c,x2:l,x:xf(c,l)}}function O7(e={},t={}){arguments.length===1&&([e,t]=Wf(e));let{y1:n,y:r=n,x:i}=t,[o,s,a]=Xf(r,i,"y","x",e,t);return{...o,y1:n,y:s,x:a}}function D7(e={},t={}){arguments.length===1&&([e,t]=Wf(e));let{y1:n,y:r=n,x:i}=t,[o,s,,a]=Xf(r,i,"y","x",e,t);return{...o,y1:n,y:s,x:a}}function eA(e={},t={}){arguments.length===1&&([e,t]=Wf(e));let{x1:n,x:r=n,y:i,...o}=t,[s,a,c,l]=Xf(r,i,"x","y",e,o);return{...s,x1:n,x:a,y1:c,y2:l,y:xf(c,l)}}function k7(e={},t={}){arguments.length===1&&([e,t]=Wf(e));let{x1:n,x:r=n,y:i}=t,[o,s,a]=Xf(r,i,"x","y",e,t);return{...o,x1:n,x:s,y:a}}function F7(e={},t={}){arguments.length===1&&([e,t]=Wf(e));let{x1:n,x:r=n,y:i}=t,[o,s,,a]=Xf(r,i,"x","y",e,t);return{...o,x1:n,x:s,y:a}}function Yf({x:e,x1:t,x2:n,...r}={}){return r=ji(r,"y"),t===void 0&&n===void 0?tA({x:e,...r}):([t,n]=ZT(e,t,n),{...r,x1:t,x2:n})}function Gf({y:e,y1:t,y2:n,...r}={}){return r=ji(r,"x"),t===void 0&&n===void 0?eA({y:e,...r}):([t,n]=ZT(e,t,n),{...r,y1:t,y2:n})}function Wf(e){let{offset:t,order:n,reverse:r,...i}=e;return[{offset:t,order:n,reverse:r},i]}var IK={length:!0};function Xf(e,t=gm,n,r,{offset:i,order:o,reverse:s},a){if(t===null)throw new Error(`stack requires ${r}`);let c=qn(a),[l,u]=Rn(e),[f,d]=pn(t),[h,p]=pn(t);return f.hint=h.hint=IK,i=TK(i),o=MK(o,i,r),[mn(a,(m,g,y)=>{({data:m,facets:g}=M7(m,g));let b=e==null?void 0:u(vl(mt(m,e),y?.[n])),x=mt(m,t,Float64Array),_=mt(m,c),v=o&&o(m,b,x,_),w=m.length,T=d(new Float64Array(w)),M=p(new Float64Array(w)),R=[];for(let I of g){let A=b?Array.from(an(I,O=>b[O]).values()):[I];if(v)for(let O of A)O.sort(v);for(let O of A){let F=0,S=0;s&&O.reverse();for(let E of O){let N=x[E];N<0?F=M[E]=(T[E]=F)+N:N>0?S=M[E]=(T[E]=S)+N:M[E]=T[E]=S}}R.push(A)}return i&&i(R,T,M,_),{data:m,facets:g}}),l,f,h]}function TK(e){if(e!=null){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"expand":case"normalize":return EK;case"center":case"silhouette":return AK;case"wiggle":return C7}throw new Error(`unknown offset: ${e}`)}}function L7(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 EK(e,t,n){for(let r of e)for(let i of r){let[o,s]=L7(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 AK(e,t,n){for(let r of e){for(let i of r){let[o,s]=L7(i,n);for(let a of i){let c=(s+o)/2;t[a]-=c,n[a]-=c}}B7(r,t,n)}P7(e,t,n)}function C7(e,t,n,r){for(let i of e){let o=new Zn,s=0;for(let a of i){let c=-1,l=a.map(h=>Math.abs(n[h]-t[h])),u=a.map(h=>{c=r?r[h]:++c;let p=n[h]-t[h],m=o.has(c)?p-o.get(c):0;return o.set(c,p),m}),f=[0,...S0(u)];for(let h of a)t[h]+=s,n[h]+=s;let d=En(l);d&&(s-=En(l,(h,p)=>(u[p]/2+f[p])*h)/d)}B7(i,t,n)}P7(e,t,n)}function B7(e,t,n){let r=ce(e,i=>ce(i,o=>t[o]));for(let i of e)for(let o of i)t[o]-=r,n[o]-=r}function P7(e,t,n){let r=e.length;if(r===1)return;let i=e.map(a=>a.flat()),o=i.map(a=>(ce(a,c=>t[c])+Gt(a,c=>n[c]))/2),s=ce(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 MK(e,t,n){if(e===void 0&&t===C7)return N7(fn);if(e!=null){if(typeof e=="string"){let r=e.startsWith("-"),i=r?xl:fn;switch((r?e.slice(1):e).toLowerCase()){case"value":case n:return NK(i);case"z":return RK(i);case"sum":return OK(i);case"appearance":return DK(i);case"inside-out":return N7(i)}return R7(VT(e))}if(typeof e=="function")return(e.length===1?R7:kK)(e);if(Array.isArray(e))return FK(e);throw new Error(`invalid order: ${e}`)}}function NK(e){return(t,n,r)=>(i,o)=>e(r[i],r[o])}function RK(e){return(t,n,r,i)=>(o,s)=>e(i[o],i[s])}function OK(e){return B_(e,(t,n,r,i)=>_u(ar(t),o=>En(o,s=>r[s]),o=>i[o]))}function DK(e){return B_(e,(t,n,r,i)=>_u(ar(t),o=>n[Yc(o,s=>r[s])],o=>i[o]))}function N7(e){return B_(e,(t,n,r,i)=>{let o=ar(t),s=_u(o,f=>n[Yc(f,d=>r[d])],f=>i[f]),a=Ci(o,f=>En(f,d=>r[d]),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 R7(e){return t=>{let n=mt(t,e);return(r,i)=>fn(n[r],n[i])}}function kK(e){return t=>(n,r)=>e(t[n],t[r])}function FK(e){return B_(fn,()=>e)}function B_(e,t){return(n,r,i,o)=>{if(!o)throw new Error("missing channel: z");let s=new Zn(t(n,r,i,o).map((a,c)=>[a,c]));return(a,c)=>e(s.get(o[a]),s.get(o[c]))}}var LK={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Fl=class extends wt{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:qn(n),optional:!0}},n,LK),this.z=a,this.curve=$m(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 ct("svg:g",o).call(Ft,this,i,o).call(It,this,n,0,0).call(u=>u.selectAll().data(Q1(t,[s,a,c,l],this,r)).enter().append("path").call(Rt,this).call(El,this,r).attr("d",sf().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 Um(e,t){return t===void 0?ea(e,{x:Vs,y:Ha}):new Fl(e,t)}function cc(e,t){let{y:n=Ae,...r}=qf(t);return new Fl(e,Yf(jf({...r,y1:n,y2:void 0})))}function ea(e,t){let{x:n=Ae,...r}=zf(t);return new Fl(e,Gf(Vf({...r,x1:n,x2:void 0})))}var CK={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},zm=class extends wt{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,CK),this.curve=L_(a,c),Vi(this,n)}project(t,n,r){this.curve!==ac&&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 ct("svg:g",o).call(Ft,this,i,o).call(It,this,n).call(f=>f.selectAll().data(t).enter().append("path").call(Rt,this).attr("d",u===ac&&o.projection?BK(o.projection,s,a,c,l):d=>{let h=er(),p=u(h);return p.lineStart(),p.point(s[d],a[d]),p.point(c[d],l[d]),p.lineEnd(),h}).call(Zt,this,r).call(Js,this,r,o)).node()}};function BK(e,t,n,r,i){let o=Mn(e);return t=Qe(t),n=Qe(n),r=Qe(r),i=Qe(i),s=>o({type:"LineString",coordinates:[[t[s],n[s]],[r[s],i[s]]]})}function P_(e,{x:t,x1:n,x2:r,y:i,y1:o,y2:s,...a}={}){return[n,r]=qm(t,n,r),[o,s]=qm(i,o,s),new zm(e,{...a,x1:n,x2:r,y1:o,y2:s})}function qm(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 PK={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5},jm=class extends wt{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:d=u,sweep:h}=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,PK),this.bend=a===!0?22.5:Math.max(-90,Math.min(90,a)),this.headAngle=+c,this.headLength=+l,this.insetStart=+f,this.insetEnd=+d,this.sweep=$K(h)}render(t,n,r,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a,SW:u}=r,{strokeWidth:f,bend:d,headAngle:h,headLength:p,insetStart:m,insetEnd:g}=this,y=u?_=>u[_]:dn(f===void 0?1:f),b=h*Bf/2,x=p/1.5;return ct("svg:g",o).call(Ft,this,i,o).call(It,this,n).call(_=>_.selectAll().data(t).enter().append("path").call(Rt,this).attr("d",v=>{let w=s[v],T=a[v],M=c[v],R=l[v],I=Math.hypot(M-w,R-T);if(I<=m+g)return null;let A=Math.atan2(R-T,M-w),O=Math.min(x*y(v),I/3),F=this.sweep(w,T,M,R)*d*Bf,S=Math.hypot(I/Math.tan(F),I)/2;if(m||g)if(S<1e5){let tt=Math.sign(F),[nt,st]=UK([w,T],[M,R],S,tt);if(m&&([w,T]=$7([nt,st,S],[w,T,m],-tt*Math.sign(m))),g){let[Y,rt]=$7([nt,st,S],[M,R,g],tt*Math.sign(g));A+=Math.atan2(rt-st,Y-nt)-Math.atan2(R-st,M-nt),M=Y,R=rt}}else{let tt=M-w,nt=R-T,st=Math.hypot(tt,nt);m&&(w+=tt/st*m,T+=nt/st*m),g&&(M-=tt/st*g,R-=nt/st*g)}let E=A+F,N=E+b,L=E-b,B=M-O*Math.cos(N),C=R-O*Math.sin(N),P=M-O*Math.cos(L),$=R-O*Math.sin(L),U=S<1e5?`A${S},${S} 0,0,${F>0?1:0} `:"L",X=O?`M${B},${C}L${M},${R}L${P},${$}`:"";return`M${w},${T}${U}${M},${R}${X}`}).call(Zt,this,r)).node()}};function $K(e=1){if(typeof e=="number")return dn(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)=>Ut(t,r);case"-x":return(t,n,r)=>Hn(t,r);case"+y":return(t,n,r,i)=>Ut(n,i);case"-y":return(t,n,r,i)=>Hn(n,i)}}function UK([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 $7([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 U7(e,{x:t,x1:n,x2:r,y:i,y1:o,y2:s,...a}={}){return[n,r]=qm(t,n,r),[o,s]=qm(i,o,s),new jm(e,{...a,x1:n,x2:r,y1:o,y2:s})}var Hf=class extends wt{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=Nt(s),this.insetRight=Nt(a),this.insetBottom=Nt(c),this.insetLeft=Nt(l),this.rx=le(u,"auto"),this.ry=le(f,"auto")}render(t,n,r,i,o){let{rx:s,ry:a}=this;return ct("svg:g",o).call(Ft,this,i,o).call(this._transform,this,n).call(c=>c.selectAll().data(t).enter().append("rect").call(Rt,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(ft,"rx",s).call(ft,"ry",a).call(Zt,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)}},z7={ariaLabel:"bar"},Vm=class extends Hf{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,z7)}_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 lr(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 lr(t)?s-i-o-a-c:l=>Math.max(0,Math.abs(r[l]-n[l])-a-c)}},Ym=class extends Hf{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,z7)}_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 lr(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 lr(t)?s-i-o-a-c:l=>Math.max(0,Math.abs(r[l]-n[l])-a-c)}};function Uo(e,t={}){return gf(t)||(t={...t,y:Ae,x2:W}),new Vm(e,Yf(d_(jf(t))))}function zo(e,t={}){return gf(t)||(t={...t,x:Ae,y2:W}),new Ym(e,Gf(h_(Vf(t))))}var zK={ariaLabel:"cell"},Ll=class extends Hf{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,zK)}_transform(t,n){t.call(It,n,{},0,0)}};function lc(e,{x:t,y:n,...r}={}){return[t,n]=Be(t,n),new Ll(e,{...r,x:t,y:n})}function q7(e,{x:t=Ae,fill:n,stroke:r,...i}={}){return n===void 0&&Re(r)[0]===void 0&&(n=W),new Ll(e,{...i,x:t,fill:n,stroke:r})}function j7(e,{y:t=Ae,fill:n,stroke:r,...i}={}){return n===void 0&&Re(r)[0]===void 0&&(n=W),new Ll(e,{...i,y:t,fill:n,stroke:r})}var qK={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function Gm(e){return e.sort===void 0&&e.reverse===void 0?z1({channel:"-r"},e):e}var Cl=class extends wt{constructor(t,n={}){let{x:r,y:i,r:o,rotate:s,symbol:a=zs,frameAnchor:c}=n,[l,u]=ie(s,0),[f,d]=KC(a),[h,p]=ie(o,f==null?3:4.5);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:h,scale:"r",filter:sr,optional:!0},rotate:{value:l,optional:!0},symbol:{value:f,scale:"auto",optional:!0}},Gm(n),qK),this.r=p,this.rotate=u,this.symbol=d,this.frameAnchor=Fo(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:d}=r,{r:h,rotate:p,symbol:m}=this,[g,y]=yn(this,i),b=m===zs,x=u?void 0:h*h*Math.PI;return Va(h)&&(t=[]),ct("svg:g",o).call(Ft,this,i,o).call(It,this,{x:c&&s,y:l&&a}).call(_=>_.selectAll().data(t).enter().append(b?"circle":"path").call(Rt,this).call(b?v=>{v.attr("cx",c?w=>c[w]:g).attr("cy",l?w=>l[w]:y).attr("r",u?w=>u[w]:h)}:v=>{v.attr("transform",oc`translate(${c?w=>c[w]:g},${l?w=>l[w]:y})${f?w=>` rotate(${f[w]})`:p?` rotate(${p})`:""}`).attr("d",u&&d?w=>{let T=er();return d[w].draw(T,u[w]*u[w]*Math.PI),T}:u?w=>{let T=er();return m.draw(T,u[w]*u[w]*Math.PI),T}:d?w=>{let T=er();return d[w].draw(T,x),T}:(()=>{let w=er();return m.draw(w,x),w})())}).call(Zt,this,r)).node()}};function yi(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Be(t,n)),new Cl(e,{...r,x:t,y:n})}function V7(e,{x:t=W,...n}={}){return new Cl(e,m_({...n,x:t}))}function Y7(e,{y:t=W,...n}={}){return new Cl(e,p_({...n,y:t}))}function G7(e,t){return yi(e,{...t,symbol:"circle"})}function W7(e,t){return yi(e,{...t,symbol:"hexagon"})}var jK={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Bl=class extends wt{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:qn(n),optional:!0}},n,jK),this.z=o,this.curve=L_(s,a),Vi(this,n)}filter(t){return t}project(t,n,r){this.curve!==ac&&super.project(t,n,r)}render(t,n,r,i,o){let{x:s,y:a}=r,{curve:c}=this;return ct("svg:g",o).call(Ft,this,i,o).call(It,this,n).call(l=>l.selectAll().data(Q1(t,[s,a],this,r)).enter().append("path").call(Rt,this).call(El,this,r).call(IB,this,r,o).attr("d",c===ac&&o.projection?VK(o.projection,s,a):Qp().curve(c).defined(u=>u>=0).x(u=>s[u]).y(u=>a[u]))).node()}};function VK(e,t,n){let r=Mn(e);return t=Qe(t),n=Qe(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 Pl(e,{x:t,y:n,...r}={}){return[t,n]=Be(t,n),new Bl(e,{...r,x:t,y:n})}function uc(e,{x:t=W,y:n=Ae,...r}={}){return new Bl(e,qf({...r,x:t,y:n}))}function fc(e,{x:t=Ae,y:n=W,...r}={}){return new Bl(e,zf({...r,x:t,y:n}))}var YK={ariaLabel:"rect"},$l=class extends wt{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:d,ry:h}=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,YK),this.insetTop=Nt(c),this.insetRight=Nt(l),this.insetBottom=Nt(u),this.insetLeft=Nt(f),this.rx=le(d,"auto"),this.ry=le(h,"auto")}render(t,n,r,i,o){let{x:s,y:a}=n,{x1:c,y1:l,x2:u,y2:f}=r,{marginTop:d,marginRight:h,marginBottom:p,marginLeft:m,width:g,height:y}=i,{projection:b}=o,{insetTop:x,insetRight:_,insetBottom:v,insetLeft:w,rx:T,ry:M}=this,R=(s?.bandwidth?s.bandwidth():0)-w-_,I=(a?.bandwidth?a.bandwidth():0)-x-v;return ct("svg:g",o).call(Ft,this,i,o).call(It,this,{},0,0).call(A=>A.selectAll().data(t).enter().append("rect").call(Rt,this).attr("x",c&&(b||!lr(s))?u?O=>Math.min(c[O],u[O])+w:O=>c[O]+w:m+w).attr("y",l&&(b||!lr(a))?f?O=>Math.min(l[O],f[O])+x:O=>l[O]+x:d+x).attr("width",c&&(b||!lr(s))?u?O=>Math.max(0,Math.abs(u[O]-c[O])+R):R:g-h-m-_-w).attr("height",l&&(b||!lr(a))?f?O=>Math.max(0,Math.abs(l[O]-f[O])+I):I:y-d-p-x-v).call(ft,"rx",T).call(ft,"ry",M).call(Zt,this,r)).node()}};function Wm(e,t){return new $l(e,CE(BE(t)))}function Zf(e,t={}){return gf(t)||(t={...t,y:Ae,x2:W,interval:1}),new $l(e,Yf(BE(jf(t))))}function Qf(e,t={}){return gf(t)||(t={...t,x:Ae,y2:W,interval:1}),new $l(e,Gf(CE(Vf(t))))}function rA(e,t){t=GK(t);let{x:n,y:r,color:i,size:o}=t,s=$_(e,n),a=$_(e,r),c=$_(e,i),l=$_(e,o),{fx:u,fy:f,x:{value:d,reduce:h,zero:p,...m},y:{value:g,reduce:y,zero:b,...x},color:{value:_,color:v,reduce:w},size:{value:T,reduce:M},mark:R}=t;if(h===void 0&&(h=y==null&&d==null&&T==null&&g!=null?"count":null),y===void 0&&(y=h==null&&g==null&&T==null&&d!=null?"count":null),M===void 0&&T==null&&w==null&&h==null&&y==null&&(d==null||Me(s))&&(g==null||Me(a))&&(M="count"),p===void 0&&(p=U_(h)?!0:void 0),b===void 0&&(b=U_(y)?!0:void 0),d==null&&g==null)throw new Error("must specify x or y");if(h!=null&&g==null)throw new Error("reducing x requires y");if(y!=null&&d==null)throw new Error("reducing y requires x");R===void 0&&(R=T!=null||M!=null?"dot":U_(h)||U_(y)||w!=null?"bar":d!=null&&g!=null?Me(s)||Me(a)||h==null&&y==null&&!Xm(s)&&!Xm(a)?"dot":"line":d!=null||g!=null?"rule":null);let I,A,O;switch(R){case"dot":O=yi,A="stroke";break;case"line":O=s&&a||h!=null||y!=null?b||y!=null||s&&Xm(s)?fc:p||h!=null||a&&Xm(a)?uc:Pl:s?uc:fc,A="stroke",H7(c)&&(I=null);break;case"area":O=!(b||y!=null)&&(p||h!=null||a&&Xm(a))?cc:ea,A="fill",H7(c)&&(I=null);break;case"rule":O=s?jr:Vr,A="stroke";break;case"bar":O=h!=null?Me(a)?X7(h)&&s&&Me(s)?lc:Uo:Zf:y!=null?Me(s)?X7(y)&&a&&Me(a)?lc:zo:Qf:w!=null||M!=null?s&&Me(s)&&a&&Me(a)?lc:s&&Me(s)?zo:a&&Me(a)?Uo:Wm:s&&Ws(s)&&!(a&&Ws(a))?Uo:a&&Ws(a)&&!(s&&Ws(s))?zo:lc,A="fill";break;default:throw new Error(`invalid mark: ${R}`)}let F={fx:u,fy:f,x:s??void 0,y:a??void 0,[A]:c??v,z:I,r:l??void 0,tip:!0},S,E={[A]:w??void 0,r:M??void 0};if(h!=null&&y!=null)throw new Error("cannot reduce both x and y");return y!=null?(E.y=y,S=Me(s)?tc:Po):h!=null?(E.x=h,S=Me(a)?ec:$o):(w!=null||M!=null)&&(s&&a?S=Me(s)&&Me(a)?vm:Me(s)?$o:Me(a)?Po:ta:s?S=Me(s)?tc:Po:a&&(S=Me(a)?ec:$o)),(S===ta||S===Po)&&(F.x={value:s,...m}),(S===ta||S===$o)&&(F.y={value:a,...x}),p===void 0&&(p=s&&!(S===ta||S===Po)&&(O===Uo||O===cc||O===Zf||O===Vr)),b===void 0&&(b=a&&!(S===ta||S===$o)&&(O===zo||O===ea||O===Qf||O===jr)),{fx:u??null,fy:f??null,x:{value:d??null,reduce:h??null,zero:!!p,...m},y:{value:g??null,reduce:y??null,zero:!!b,...x},color:{value:_??null,reduce:w??null,...v!==void 0&&{color:v}},size:{value:T??null,reduce:M??null},mark:R,markImpl:Z7[O],markOptions:F,transformImpl:Z7[S],transformOptions:E,colorMode:A}}function Q7(e,t){let n=rA(e,t),{fx:r,fy:i,x:{zero:o},y:{zero:s},markOptions:a,transformOptions:c,colorMode:l}=n,u=nA[n.markImpl],f=nA[n.transformImpl],d=r!=null||i!=null?Uf({strokeOpacity:.1}):null,h=[o?jr([0]):null,s?Vr([0]):null],p=u(e,f?f(c,a):a);return l==="stroke"?Je(d,h,p):Je(d,p,h)}function Xm(e){let t,n;for(let r of e){if(r==null)continue;if(t===void 0){t=r;continue}let i=Math.sign(Ut(t,r));if(i){if(n!==void 0&&i!==n)return!1;t=r,n=i}}return!0}function GK({x:e,y:t,color:n,size:r,fx:i,fy:o,mark:s}={}){return zr(e)||(e=Kf(e)),zr(t)||(t=Kf(t)),zr(n)||(n=Ka(n)?{color:n}:Kf(n)),zr(r)||(r=Kf(r)),zr(i)&&({value:i}=Kf(i)),zr(o)&&({value:o}=Kf(o)),s!=null&&(s=`${s}`.toLowerCase()),{x:e,y:t,color:n,size:r,fx:i,fy:o,mark:s}}function $_(e,t){let n=mt(e,t.value);return n&&(n.label=On(t.value)),n}function Kf(e){return WK(e)?{reduce:e}:{value:e}}function U_(e){return/^(?:distinct|count|sum|proportion)$/i.test(e)}function X7(e){return/^(?:first|last|mode)$/i.test(e)}function WK(e){if(e==null)return!1;if(typeof e.reduceIndex=="function"||typeof e.reduce=="function"&&hn(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 H7(e){return e?new Qn(e).size>e.length>>1:!1}var nA={dot:yi,line:Pl,lineX:uc,lineY:fc,areaX:cc,areaY:ea,ruleX:jr,ruleY:Vr,barX:Uo,barY:zo,rect:Wm,rectX:Zf,rectY:Qf,cell:lc,bin:ta,binX:Po,binY:$o,group:vm,groupX:tc,groupY:ec},Z7=Object.fromEntries(Object.entries(nA).map(([e,t])=>[t,e]));function Jf(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),_r(o,t)}function td(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),_r(o,t)}function _r(e={},t={}){let n=qn(t),r=Object.entries(e).map(([i,o])=>{let s=C1(i,t);if(s==null)throw new Error(`missing channel: ${i}`);let[a,c]=pn(s);return{key:i,input:s,output:a,setOutput:c,map:XK(o)}});return{...mn(t,(i,o)=>{let s=mt(i,n),a=r.map(({input:l})=>mt(i,l)),c=r.map(({setOutput:l})=>l(new Array(i.length)));for(let l of o)for(let u of s?an(l,f=>s[f]).values():[l])r.forEach(({map:f},d)=>f.mapIndex(u,a[d],c[d]));return{data:i,facets:o}}),...Object.fromEntries(r.map(({key:i,output:o})=>[i,o]))}}function XK(e){if(e==null)throw new Error("missing map");if(typeof e.mapIndex=="function")return e;if(typeof e.map=="function"&&hn(e))return HK(e);if(typeof e=="function")return iA(bf(e));switch(`${e}`.toLowerCase()){case"cumsum":return QK;case"rank":return iA((t,n)=>Ph(t,r=>n[r]));case"quantile":return iA((t,n)=>ZK(t,r=>n[r]))}throw new Error(`invalid map: ${e}`)}function HK(e){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:e.map.bind(e)}}function ZK(e,t){let n=lo(e,t)-1;return Ph(e,t).map(r=>r/n)}function iA(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 QK={mapIndex(e,t,n){let r=0;for(let i of e)n[i]=r+=t[i]}};function K7(e={},t){return arguments.length===1&&(t=e),Jf(ed(e),t)}function J7(e={},t){return arguments.length===1&&(t=e),td(ed(e),t)}function ed(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=JK(r),jn(`Warning: the shift option is deprecated; please use anchor "${i}" instead.`)),!((t=Math.floor(t))>0))throw new Error(`invalid k: ${t}`);return tJ(n)(t,KK(i,t),o)}function KK(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 JK(e){switch(`${e}`.toLowerCase()){case"centered":return"middle";case"leading":return"start";case"trailing":return"end"}throw new Error(`invalid shift: ${e}`)}function tJ(e="mean"){if(typeof e=="string"){if(/^p\d{2}$/i.test(e))return z_(yf(e));switch(e.toLowerCase()){case"deviation":return z_(ri);case"max":return q_((t,n)=>Gt(t,r=>n[r]));case"mean":return eJ;case"median":return z_(Bi);case"min":return q_((t,n)=>ce(t,r=>n[r]));case"mode":return q_((t,n)=>Iu(t,r=>n[r]));case"sum":return tP;case"variance":return z_(Ma);case"difference":return iJ;case"ratio":return oJ;case"first":return sJ;case"last":return aJ}}if(typeof e!="function")throw new Error(`invalid reduce: ${e}`);return q_(bf(e))}function z_(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(Ys(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(Ys(i,0,c+t),a);for(let c=0,l=i.length-n;c<l;++c)s[i[c+n]]=e(Ys(i,c,c+t),a)}}}function q_(e){return(t,n,r)=>r?{mapIndex(i,o,s){let a=0;for(let c=0;c<t-1;++c)a+=Ue(o[i[c]]);for(let c=0,l=i.length-t+1;c<l;++c)a+=Ue(o[i[c+t-1]]),a===t&&(s[i[c+n]]=e(Ys(i,c,c+t),o)),a-=Ue(o[i[c]])}}:{mapIndex(i,o,s){for(let a=-n;a<0;++a)s[i[a+n]]=e(Ys(i,0,a+t),o);for(let a=0,c=i.length-n;a<c;++a)s[i[a+n]]=e(Ys(i,a,a+t),o)}}}function tP(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 eJ(e,t,n){if(n){let r=tP(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]],d=i[r[l]];f!==null&&!isNaN(f=+f)&&(s+=f,++a),o[r[l+t]]=s/a,d!==null&&!isNaN(d=+d)&&(s-=d,--a)}}}}function nJ(e,t,n,r){for(let i=n+r;n<i;++n){let o=e[t[n]];if(Ue(o))return o}}function rJ(e,t,n,r){for(let i=n+r-1;i>=n;--i){let o=e[t[i]];if(Ue(o))return o}}function eP(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 nP(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 iJ(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]]=nP(i,r,s,e)-eP(i,r,s,e)}}}function oJ(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]]=nP(i,r,s,e)/eP(i,r,s,e)}}}function sJ(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]]=nJ(i,r,s,e)}}}function aJ(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]]=rJ(i,r,s,e)}}}var na={n:20,k:2,color:"currentColor",opacity:.2,strict:!0,anchor:"end"};function rP(e,{x:t=W,y:n,k:r=na.k,color:i=na.color,opacity:o=na.opacity,fill:s=i,fillOpacity:a=o,stroke:c=i,strokeOpacity:l,strokeWidth:u,...f}={}){return Je(ne(s)?null:cc(e,_r({x1:dc({k:-r,...f}),x2:dc({k:r,...f})},{x1:t,x2:t,y:n,fill:s,fillOpacity:a,...f})),ne(c)?null:uc(e,_r({x:dc(f)},{x:t,y:n,stroke:c,strokeOpacity:l,strokeWidth:u,...f})))}function iP(e,{x:t,y:n=W,k:r=na.k,color:i=na.color,opacity:o=na.opacity,fill:s=i,fillOpacity:a=o,stroke:c=i,strokeOpacity:l,strokeWidth:u,...f}={}){return Je(ne(s)?null:ea(e,_r({y1:dc({k:-r,...f}),y2:dc({k:r,...f})},{x:t,y1:n,y2:n,fill:s,fillOpacity:a,...f})),ne(c)?null:fc(e,_r({y:dc(f)},{x:t,y:n,stroke:c,strokeOpacity:l,strokeWidth:u,...f})))}function dc({n:e=na.n,k:t=0,strict:n=na.strict,anchor:r=na.anchor}={}){return ed({k:e,reduce:i=>Ss(i)+t*(ri(i)||0),strict:n,anchor:r})}var cJ={ariaLabel:"tick",fill:null,stroke:"currentColor"},j_=class extends wt{constructor(t,n,r){super(t,n,r,cJ),Vi(this,r)}render(t,n,r,i,o){return ct("svg:g",o).call(Ft,this,i,o).call(this._transform,this,n).call(s=>s.selectAll().data(t).enter().append("line").call(Rt,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(Zt,this,r).call(Js,this,r,o)).node()}},Hm=class extends j_{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=Nt(s),this.insetBottom=Nt(a)}_transform(t,n,{x:r}){t.call(It,n,{x:r},De,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}},Zm=class extends j_{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=Nt(s),this.insetLeft=Nt(a)}_transform(t,n,{y:r}){t.call(It,n,{y:r},0,De)}_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 V_(e,{x:t=W,...n}={}){return new Hm(e,{...n,x:t})}function Y_(e,{y:t=W,...n}={}){return new Zm(e,{...n,y:t})}function oP(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?ec:wm;return Je(Vr(e,u({x1:oA,x2:sA},{x:t,y:n,stroke:o,strokeOpacity:s,...l})),Uo(e,u({x1:"p25",x2:"p75"},{x:t,y:n,fill:r,fillOpacity:i,...l})),V_(e,u({x:"p50"},{x:t,y:n,stroke:o,strokeOpacity:s,strokeWidth:a,sort:c,...l})),yi(e,_r({x:aP},{x:t,y:n,z:n,stroke:o,strokeOpacity:s,...l})))}function sP(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?tc:wm;return Je(jr(e,u({y1:oA,y2:sA},{x:n,y:t,stroke:o,strokeOpacity:s,...l})),zo(e,u({y1:"p25",y2:"p75"},{x:n,y:t,fill:r,fillOpacity:i,...l})),Y_(e,u({y:"p50"},{x:n,y:t,stroke:o,strokeOpacity:s,strokeWidth:a,sort:c,...l})),yi(e,_r({y:aP},{x:n,y:t,z:n,stroke:o,strokeOpacity:s,...l})))}function aP(e){let t=oA(e),n=sA(e);return e.map(r=>r<t||r>n?r:NaN)}function oA(e){let t=cP(e)*2.5-lP(e)*1.5;return ce(e,n=>n>=t?n:NaN)}function sA(e){let t=lP(e)*2.5-cP(e)*1.5;return Gt(e,n=>n<=t?n:NaN)}function cP(e){return Kn(e,.25)}function lP(e){return Kn(e,.75)}var lJ={ariaLabel:"raster",stroke:null,pixelSize:1};function nd(e,t){let n=+e;if(isNaN(n))throw new Error(`invalid ${t}: ${e}`);return n}function uP(e,t){let n=Math.floor(e);if(isNaN(n))throw new Error(`invalid ${t}: ${e}`);return n}var Km=class extends wt{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:d=c==null?s:void 0,pixelSize:h=i.pixelSize,blur:p=0,interpolate:m}=r;if(o!=null&&(o=uP(o,"width")),s!=null&&(s=uP(s,"height")),l!=null&&(l=nd(l,"x1")),u!=null&&(u=nd(u,"y1")),f!=null&&(f=nd(f,"x2")),d!=null&&(d=nd(d,"y2")),a==null&&(l==null||f==null))throw new Error("missing x");if(c==null&&(u==null||d==null))throw new Error("missing y");t!=null&&o!=null&&s!=null&&(a===void 0&&l!=null&&f!=null&&(a=gJ(l,f,o,s)),c===void 0&&u!=null&&d!=null&&(c=bJ(u,d,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:d==null?null:[d],scale:"y",optional:!0,filter:null},...n},r,i),this.width=o,this.height=s,this.pixelSize=nd(h,"pixelSize"),this.blur=nd(p,"blur"),this.interpolate=a==null||c==null?null:uJ(m)}},Jm=class extends Km{constructor(t,n={}){let{imageRendering:r}=n;if(t==null){let{fill:i,fillOpacity:o}=n;ie(o)[0]!==void 0&&(n=G_("fillOpacity",n)),Re(i)[0]!==void 0&&(n=G_("fill",n))}super(t,void 0,n,lJ),this.imageRendering=le(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]??(E=>E),{x:a,y:c}=r,{document:l}=o,[u,f,d,h]=dP(r,i,o),p=d-u,m=h-f,{pixelSize:g,width:y=Math.round(Math.abs(p)/g),height:b=Math.round(Math.abs(m)/g)}=this,x=y*b,{fill:_,fillOpacity:v}=r,w=0;if(this.interpolate){let E=y/p,N=b/m,L=Yt(a,C=>(C-u)*E,Float64Array),B=Yt(c,C=>(C-f)*N,Float64Array);_&&(_=this.interpolate(t,y,b,L,B,_)),v&&(v=this.interpolate(t,y,b,L,B,v))}else this.data==null&&t&&(w=t.fi*x);let T=l.createElement("canvas");T.width=y,T.height=b;let M=T.getContext("2d"),R=M.createImageData(y,b),I=R.data,{r:A,g:O,b:F}=rn(this.fill)??{r:0,g:0,b:0},S=(this.fillOpacity??1)*255;for(let E=0;E<x;++E){let N=E<<2;if(_){let L=s(_[E+w]);if(L==null){I[N+3]=0;continue}({r:A,g:O,b:F}=rn(L))}v&&(S=v[E+w]*255),I[N+0]=A,I[N+1]=O,I[N+2]=F,I[N+3]=S}return this.blur>0&&P2(R,this.blur),M.putImageData(R,0,0),ct("svg:g",o).call(Ft,this,i,o).call(It,this,n).call(E=>E.append("image").attr("transform",`translate(${u},${f}) scale(${Math.sign(d-u)},${Math.sign(h-f)})`).attr("width",Math.abs(p)).attr("height",Math.abs(m)).attr("preserveAspectRatio","none").call(ft,"image-rendering",this.imageRendering).call(Rt,this).attr("xlink:href",T.toDataURL())).node()}};function aA(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&&qC(t)&&(r=Vs,i=Ha,o===void 0&&(o=BC)),[t,{...s,x:r,y:i,[e]:o}]}function fP(){let[e,t]=aA("fill",...arguments);return new Jm(e,e==null||t.fill!==void 0||t.fillOpacity!==void 0?t:{...t,fill:W})}function dP({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 cA({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),dP(Tf(a,i),o,s)}function G_(e,t={}){let{[e]:n}=t;if(typeof n!="function")throw new Error(`invalid ${e}: not a function`);return Se({...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,d,h,p]=cA(o,s,a,c),m=h-f,g=p-d,{pixelSize:y}=this,{width:b=Math.round(Math.abs(m)/y),height:x=Math.round(Math.abs(g)/y)}=t,_=new Array(b*x*(i?i.length:1)),v=m/b,w=g/x,T=0;for(let M of i??[void 0])for(let R=.5;R<x;++R)for(let I=.5;I<b;++I,++T)_[T]=n(l.invert(f+I*v),u.invert(d+R*w),M);return{data:_,facets:i,channels:{[e]:{value:_,scale:"auto"}}}})}function uJ(e){if(typeof e=="function")return e;if(e==null)return W_;switch(`${e}`.toLowerCase()){case"none":return W_;case"nearest":return uA;case"barycentric":return lA();case"random-walk":return fA()}throw new Error(`invalid interpolate: ${e}`)}function W_(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 lA({random:e=ll(42)}={}){return(t,n,r,i,o,s)=>{let{points:a,triangles:c,hull:l}=ai.from(t,h=>i[h],h=>o[h]),u=new s.constructor(n*r).fill(NaN),f=new Uint8Array(n*r),d=yJ(s,e);for(let h=0;h<c.length;h+=3){let p=c[h],m=c[h+1],g=c[h+2],y=a[2*p],b=a[2*m],x=a[2*g],_=a[2*p+1],v=a[2*m+1],w=a[2*g+1],T=Math.min(y,b,x),M=Math.max(y,b,x),R=Math.min(_,v,w),I=Math.max(_,v,w),A=(v-w)*(y-x)+(_-w)*(x-b);if(!A)continue;let O=s[t[p]],F=s[t[m]],S=s[t[g]];for(let E=Math.floor(T);E<M;++E)for(let N=Math.floor(R);N<I;++N){if(E<0||E>=n||N<0||N>=r)continue;let L=E+.5,B=N+.5,C=((v-w)*(L-x)+(B-w)*(x-b))/A;if(C<0)continue;let P=((w-_)*(L-x)+(B-w)*(y-x))/A;if(P<0)continue;let $=1-C-P;if($<0)continue;let U=E+n*N;u[U]=d(O,C,F,P,S,$,E,N),f[U]=1}}return fJ(u,f,i,o,s,n,r,l,t,d),u}}function fJ(e,t,n,r,i,o,s,a,c,l){n=Float64Array.from(a,h=>n[c[h]]),r=Float64Array.from(a,h=>r[c[h]]),i=Array.from(a,h=>i[c[h]]);let u=n.length,f=Array.from({length:u},(h,p)=>hJ(p,n,r)),d=0;for(let h=0;h<s;++h){let p=h+.5;for(let m=0;m<o;++m){let g=m+o*h;if(!t[g]){let y=m+.5;for(let b=0;b<u;++b){let x=(u+d+(b%2?(b+1)/2:-b/2))%u;if(f[x](y,p)){let _=dJ(n.at(x-1),r.at(x-1),n[x],r[x],y,p);e[g]=l(i.at(x-1),_,i[x],1-_,i[x],0,m,h),d=x;break}}}}}}function dJ(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 Qm(e,t,n,r){return e*r-n*t}function hJ(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),d=s-c,h=a-l,p=i-s,m=o-a,g=c-u,y=l-f,b=Math.hypot(d,h),x=Math.hypot(p,m),_=Math.hypot(g,y);return(v,w)=>{let T=v-s,M=w-a,R=v-c,I=w-l;return Qm(T,M,R,I)>-1e-6&&Qm(T,M,d,h)*x-Qm(T,M,p,m)*b>-1e-6&&Qm(R,I,g,y)*b-Qm(R,I,d,h)*_<=0}}function uA(e,t,n,r,i,o){let s=new o.constructor(t*n),a=ai.from(e,u=>r[u],u=>i[u]),c,l;for(let u=.5,f=0;u<n;++u){l=c;for(let d=.5;d<t;++d,++f)l=a.find(d,u,l),d===.5&&(c=l),s[f]=o[e[l]]}return s}function fA({random:e=ll(42),minDistance:t=.5,maxSteps:n=2}={}){return(r,i,o,s,a,c)=>{let l=new c.constructor(i*o),u=ai.from(r,p=>s[p],p=>a[p]),f,d,h;for(let p=.5,m=0;p<o;++p){d=f;for(let g=.5;g<i;++g,++m){let y=g,b=p;h=d=u.find(y,b,d),g===.5&&(f=d);let x,_=0;for(;(x=Math.hypot(s[r[h]]-y,a[r[h]]-b))>t&&_<n;){let v=e(g,p,_)*2*Math.PI;y+=Math.cos(v)*x,b+=Math.sin(v)*x,h=u.find(y,b,h),++_}l[m]=c[r[h]]}}return l}}function pJ(e,t,n,r,i,o){return t*e+r*n+o*i}function mJ(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 yJ(e,t){return Ws(e)||Oe(e)?pJ:mJ(t)}function gJ(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 bJ(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 hP={ariaLabel:"contour",fill:"none",stroke:"currentColor",strokeMiterlimit:1,pixelSize:2},ty=class extends Km{constructor(t,{smooth:n=!0,value:r,...i}={}){let o=Z1({},i,hP);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:On(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=G_("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}},xJ(i),hP);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=Mn();return ct("svg:g",o).call(Ft,this,i,o).call(It,this,n).call(c=>{c.selectAll().data(t).enter().append("path").call(Rt,this).attr("d",l=>a(s[l])).call(Zt,this,r)}).node()}};function xJ({thresholds:e,interval:t,...n}){return e=KE(e,t,Na),Se(n,function(r,i,o,s,a,c){let[l,u,f,d]=cA(o,s,a,c),h=f-l,p=d-u,{pixelSize:m,width:g=Math.round(Math.abs(h)/m),height:y=Math.round(Math.abs(p)/m)}=this,b=g/h,x=y/p,_=o.value.value,v=[];if(this.interpolate){let{x:I,y:A}=rc(o,s,c),O=Yt(I,N=>(N-l)*b,Float64Array),F=Yt(A,N=>(N-u)*x,Float64Array),S=[o.x,o.y,o.value],E=[O,F,_];for(let N of i){let L=this.filter(N,S,E);v.push(this.interpolate(L,g,y,O,F,_))}}else if(i){let I=g*y,A=i.length;for(let O=0;O<A;++O)v.push(_.slice(O*I,O*I+I))}else v.push(_);if(this.blur>0)for(let I of v)kh({data:I,width:g,height:y},this.blur);let w=_J(e,_,...wJ(v));if(w===null)throw new Error(`unsupported thresholds: ${e}`);let{contour:T}=Ca().size([g,y]).smooth(this.smooth),M=[],R=[];for(let I of v)R.push($e(M.length,M.push(...Yt(w,A=>T(I,A)))));for(let{coordinates:I}of M)for(let A of I)for(let O of A)for(let F of O)F[0]=F[0]/b+l,F[1]=F[1]/x+u;return{data:M,facets:R,channels:W1(this.contourChannels,M)}})}function _J(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 qe(e);let i=Tn(...vu(n,r,e),e);for(;i[i.length-1]>=r;)i.pop();for(;i[1]<n;)i.shift();return i}function mP(){return new ty(...aA("value",...arguments))}function wJ(e){return[ce(e,t=>ce(t,pP)),Gt(e,t=>Gt(t,pP))]}function pP(e){return isFinite(e)?e:NaN}function bP(e,t){return dA(Lf,e,t)}function xP(e,t={}){return dA(Cf,e,t)}function _P(e,t={}){return dA(Al,e,t)}function dA(e,t,n={}){let{x:r,y:i,maxRadius:o}=n,s=e({px:r,py:i,maxRadius:o}),a=[];r!=null&&a.push(jr(t,yP("x",{...s,inset:-6},n))),i!=null&&a.push(Vr(t,yP("y",{...s,inset:-6},n))),r!=null&&a.push(Bo(t,gP("x",{...s,dy:9,frameAnchor:"bottom",lineAnchor:"top"},n))),i!=null&&a.push(Bo(t,gP("y",{...s,dx:-9,frameAnchor:"left",textAnchor:"end"},n)));for(let c of a)c.ariaLabel=`crosshair ${c.ariaLabel}`;return Je(...a)}function wP(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:vJ(e,u)}}function vJ(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,...d}={},...h}=t.call(this,n,r,{...c,x:s,y:a},...l);return{channels:{...d,...u&&{px:u,...e==="x"&&{x:u}},...f&&{py:f,...e==="y"&&{y:f}}},...h}}}function yP(e,t,n){let{color:r="currentColor",opacity:i=.2,ruleStroke:o=r,ruleStrokeOpacity:s=i,ruleStrokeWidth:a}=n;return{...wP(e,t,n),stroke:o,strokeOpacity:s,strokeWidth:a}}function gP(e,t,n){let{color:r="currentColor",textFill:i=r,textFillOpacity:o,textStroke:s="var(--plot-background)",textStrokeOpacity:a,textStrokeWidth:c=5}=n;return{...wP(e,t,SJ(e,n)),fill:i,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:c}}function SJ(e,t){return Se(t,(n,r,i)=>({channels:{text:{value:Im(i,e)?.value}}}))}var IJ={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},TJ={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},EJ={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},AJ={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},MJ={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},hA=class extends wt{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,IJ),this.curve=$m(s,a),Vi(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,{curve:f}=this,[d,h]=yn(this,i),p=c?b=>c[b]:dn(d),m=l?b=>l[b]:dn(h),g=this;function y(b){let x=-1,_=[],v={};for(let S in r)v[S]=[];let w=[],T=[],M=[],R=[];function I(S,E){S=b[S],E=b[E],_.push(++x),w[x]=p(S),M[x]=m(S),T[x]=p(E),R[x]=m(E);for(let N in r)v[N].push(r[N][E])}let{halfedges:A,hull:O,triangles:F}=ai.from(b,p,m);for(let S=0;S<A.length;++S){let E=A[S];E>S&&I(F[S],F[E])}for(let S=0;S<O.length;++S)I(O[S],O[(S+1)%O.length]);qt(this).selectAll().data(_).enter().append("path").call(Rt,g).attr("d",S=>{let E=er(),N=f(E);return N.lineStart(),N.point(w[S],M[S]),N.point(T[S],R[S]),N.lineEnd(),E}).call(Zt,g,v).call(Js,g,v,o)}return ct("svg:g",o).call(Ft,this,i,o).call(It,this,{x:c&&s,y:l&&a}).call(u?b=>b.selectAll().data(an(t,x=>u[x]).values()).enter().append("g").each(y):b=>b.datum(t).each(y)).node()}},ey=class extends wt{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,d]=yn(this,i),h=c?y=>c[y]:dn(f),p=l?y=>l[y]:dn(d),m=this;function g(y){let b=ai.from(y,h,p);qt(this).append("path").datum(y[0]).call(Rt,m).attr("d",m._render(b,i)).call(Zt,m,r)}return ct("svg:g",o).call(Ft,this,i,o).call(It,this,{x:c&&s,y:l&&a}).call(u?y=>y.selectAll().data(an(t,b=>u[b]).values()).enter().append("g").each(g):y=>y.datum(t).each(g)).node()}},pA=class extends ey{constructor(t,n={}){super(t,n,TJ),this.fill="none"}_render(t){return t.render()}},mA=class extends ey{constructor(t,n={}){super(t,n,EJ,qn)}_render(t){return t.renderHull()}},yA=class extends wt{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,AJ)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,[f,d]=yn(this,i),h=c?y=>c[y]:dn(f),p=l?y=>l[y]:dn(d),m=this;function g(y){let b=ai.from(y,h,p),x=vP(b,i);qt(this).selectAll().data(y).enter().append("path").call(Rt,m).attr("d",(_,v)=>x.renderCell(v)).call(Zt,m,r)}return ct("svg:g",o).call(Ft,this,i,o).call(It,this,{x:c&&s,y:l&&a}).call(u?y=>y.selectAll().data(an(t,b=>u[b]).values()).enter().append("g").each(g):y=>y.datum(t).each(g)).node()}},gA=class extends ey{constructor(t,n){super(t,n,MJ),this.fill="none"}_render(t,n){return vP(t,n).render()}};function vP(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 ny(e,t,{x:n,y:r,...i}={}){return[n,r]=Be(n,r),new e(t,{...i,x:n,y:r})}function SP(e,t){return ny(hA,e,t)}function IP(e,t){return ny(pA,e,t)}function TP(e,t){return ny(mA,e,t)}function EP(e,t){return ny(yA,e,t)}function AP(e,t){return ny(gA,e,t)}var NJ={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1},ry=class extends wt{constructor(t,{x:n,y:r,z:i,weight:o,fill:s,stroke:a,...c}={}){let l=MP(s)&&(s="currentColor",!0),u=MP(a)&&(a="currentColor",!0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:qn({z:i,fill:s,stroke:a}),optional:!0},weight:{value:o,optional:!0}},OJ({...c,fill:s,stroke:a},l,u),NJ),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=Mn();return ct("svg:g",o).call(Ft,this,i,o).call(It,this,{}).call(c=>c.selectAll().data(t).enter().append("path").call(Rt,this).call(Zt,this,r).attr("d",l=>a(s[l]))).node()}};function NP(e,{x:t,y:n,...r}={}){return[t,n]=Be(t,n),new ry(e,{...r,x:t,y:n})}var RJ=new Set(["x","y","z","weight"]);function OJ(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"?Qe(o):+o,Se(e,function(s,a,c,l,u,f){let d=c.weight?Qe(c.weight.value):null,h=c.z?.value,{z:p}=this,[m,g]=yn(this,u),{width:y,height:b}=u,{x,y:_}=rc(c,l,f),v=Object.fromEntries(Object.entries(c).filter(([F])=>!RJ.has(F)).map(([F,S])=>[F,{...S,value:[]}])),w=t&&[],T=n&&[],M=ES().x(x?F=>x[F]:m).y(_?F=>_[F]:g).weight(d?F=>d[F]:1).size([y,b]).bandwidth(i),R=[];for(let F of a){let S=[];R.push(S);for(let E of h?Em(F,h,p):[F]){let N=M.contours(E);S.push([E,N])}}let I=o;if(!(I instanceof wl)){let F=0;for(let S of R)for(let[,E]of S){let N=E.max;N>F&&(F=N)}I=Float64Array.from({length:o-1},(S,E)=>F*100*(E+1)/o)}let A=[],O=[];for(let F of R){let S=[];A.push(S);for(let[E,N]of F)for(let L of I){S.push(O.length),O.push(N(L/100)),w&&w.push(L),T&&T.push(L);for(let B in v)v[B].value.push(c[B].value[E[0]])}}return w&&w.push(0),T&&T.push(0),{data:s,facets:A,channels:{...v,...w&&{fill:{value:w,scale:"color"}},...T&&{stroke:{value:T,scale:"color"}},contours:{value:O}}}})}function MP(e){return/^density$/i.test(e)}function DP(e,{x1:t,x2:n,y1:r,y2:i,x:o=t===void 0&&n===void 0?Ae: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:d=u,stroke:h,strokeOpacity:p,z:m=Re(h)[0],clip:g,tip:y,render:b,...x}={}){return[t,n]=RP(o,t,n),[r,i]=RP(s,r,i),t===n&&r===i&&(r=hc(0)),{tip:y}=ji({tip:y},"x"),Je(ne(c)?null:Object.assign(Um(e,{x1:t,x2:n,y1:r,y2:i,z:m,fill:c,fillOpacity:f,render:Ff(b,OP(!0)),clip:g,...x}),{ariaLabel:"positive difference"}),ne(l)?null:Object.assign(Um(e,{x1:t,x2:n,y1:r,y2:i,z:m,fill:l,fillOpacity:d,render:Ff(b,OP(!1)),clip:g,...x}),{ariaLabel:"negative difference"}),Pl(e,{x:n,y:i,z:m,stroke:h,strokeOpacity:p,tip:y,clip:!0,...x}))}function RP(e,t,n){return t===void 0&&n===void 0?t=n=hc(e):t===void 0?(n=hc(n),t=e===void 0?n:hc(e)):n===void 0?(t=hc(t),n=e===void 0?t:hc(e)):(t=hc(t),n=hc(n)),[t,n]}function hc(e){let t,{value:n,label:r=On(n)}=pi(e);return{transform:i=>t||(t=mt(i,n)),label:r}}function OP(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===r_(n.y)<0?u:f).fill(l);let d=s(t,n,{...r,x2:a,y2:f},i,o),h=s(t,n,{...r,x1:c,y1:u},i,o),p=d.querySelector("g")??d,m=h.querySelector("g")??h;for(let g=0;p.firstChild;g+=2){let y=H1(),b=ct("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 h}}var DJ={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},iy=class extends wt{constructor(t,n={}){let[r,i]=ie(n.r,3);super(t,{geometry:{value:n.geometry,scale:"projection"},r:{value:r,scale:"r",filter:sr,optional:!0}},Gm(n),DJ),this.r=i}render(t,n,r,i,o){let{geometry:s,r:a}=r,c=Mn(o.projection??kJ(n)),{r:l}=this;return Va(l)?t=[]:l!==void 0&&c.pointRadius(l),ct("svg:g",o).call(Ft,this,i,o).call(It,this,n).call(u=>{u.selectAll().data(t).enter().append("path").call(Rt,this).attr("d",a?f=>c.pointRadius(a[f])(s[f]):f=>c(s[f])).call(Zt,this,r)}).node()}};function kJ({x:e,y:t}){if(e||t)return e??=n=>n,t??=n=>n,al({point(n,r){this.stream.point(e(n),t(r))}})}function X_(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 iy(e,{geometry:t,...n})}function kP({strokeWidth:e=1.5,...t}={}){return X_({type:"Sphere"},{strokeWidth:e,...t})}function FP({strokeOpacity:e=.1,...t}={}){return X_(XS(),{strokeOpacity:e,...t})}var rd=.5,id=0;function LP(e={fill:"count"},{binWidth:t,...n}={}){let{z:r}=n;return t=t===void 0?20:Nt(t),e=cE(e,n),Lo(e,"fill")&&(n.channels={...n.channels,fill:{value:[]}}),n.symbol===void 0&&(n.symbol="hexagon"),n.r===void 0&&!Lo(e,"r")&&(n.r=t/2),Se(n,(i,o,s,a,c,l)=>{let{x:u,y:f,z:d,fill:h,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}=rc(s,a,l)),d=d?d.value:mt(i,r),h=h?.value,p=p?.value,m=m?.value;let g=Sm(e,{z:d,fill:h,stroke:p,symbol:m}),y=d&&[],b=h&&[],x=p&&[],_=m&&[],v=[],w=[],T=[],M=-1;for(let O of e)O.initialize(i);for(let O of o){let F=[];for(let S of e)S.scope("facet",O);for(let[S,E]of Ja(O,g))for(let{index:N,extent:L}of FJ(i,E,u,f,t)){F.push(++M),w.push(L.x),T.push(L.y),d&&y.push(g===d?S:d[N[0]]),h&&b.push(g===h?S:h[N[0]]),p&&x.push(g===p?S:p[N[0]]),m&&_.push(g===m?S:m[N[0]]);for(let B of e)B.reduce(N,L)}v.push(F)}let R=s.x.scale,I=s.y.scale,A={x:{value:w,source:a[R]?{value:Yt(w,a[R].invert),scale:R}:null},y:{value:T,source:a[I]?{value:Yt(T,a[I].invert),scale:I}:null},...d&&{z:{value:y}},...h&&{fill:{value:b,scale:"auto"}},...p&&{stroke:{value:x,scale:"auto"}},...m&&{symbol:{value:_,scale:"auto"}},...Object.fromEntries(e.map(({name:O,output:F})=>[O,{scale:"auto",label:F.label,radius:O==="r"?t/2:void 0,value:F.transform()}]))};return{data:i,facets:v,channels:A}})}function FJ(e,t,n,r,i){let o=i*(1.5/KT),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-id)/o),f=Math.round(c=(c-rd)/i-(u&1)/2),d=l-u;if(Math.abs(d)*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+d*d>b*b+x*x&&(f=g+(u&1?1:-1)/2,u=y)}let h=`${f},${u}`,p=s.get(h);p===void 0&&(p={index:[],extent:{data:e,x:(f+(u&1)/2)*i+rd,y:u*o+id}},s.set(h,p)),p.index.push(a)}return s.values()}var LJ={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};function CP(e){return new oy(e)}var oy=class extends wt{constructor({binWidth:t=20,clip:n=!0,...r}={}){super(Xa,void 0,{clip:n,...r},LJ),this.binWidth=Nt(t)}render(t,n,r,i,o){let{binWidth:s}=this,{marginTop:a,marginRight:c,marginBottom:l,marginLeft:u,width:f,height:d}=i,h=u-rd,p=f-c-rd,m=a-id,g=d-l-id,y=s/2,b=y*JT,x=b/2,_=y*2,v=b*1.5,w=Math.floor(h/_),T=Math.ceil(p/_),M=Math.floor((m+x)/v),R=Math.ceil((g-x)/v)+1,I=`m0,${pc(-b)}l${pc(y)},${pc(x)}v${pc(b)}l${pc(-y)},${pc(x)}`,A=I;for(let O=M;O<R;++O)for(let F=w;F<T;++F)A+=`M${pc(F*_+(O&1)*y)},${pc(O*v)}${I}`;return ct("svg:g",o).datum(0).call(Ft,this,i,o).call(It,this,{},De+rd,De+id).call(O=>O.append("path").call(Rt,this).call(Zt,this,r).attr("d",A)).node()}};function pc(e){return Math.round(e*1e3)/1e3}var CJ={ariaLabel:"image",fill:null,stroke:null};function BJ(e){return/^\.*\//.test(e)}function PJ(e){return/^(blob|data|file|http|https):/i.test(e)}function $J(e){return typeof e=="string"&&(BJ(e)||PJ(e))?[void 0,e]:[e,void 0]}var sy=class extends wt{constructor(t,n={}){let{x:r,y:i,r:o,width:s,height:a,rotate:c,src:l,preserveAspectRatio:u,crossOrigin:f,frameAnchor:d,imageRendering:h}=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]=$J(l),[g,y]=ie(o),[b,x]=ie(s,y!==void 0?y*2:void 0),[_,v]=ie(a,y!==void 0?y*2:void 0),[w,T]=ie(c,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:g,scale:"r",filter:sr,optional:!0},width:{value:b,filter:sr,optional:!0},height:{value:_,filter:sr,optional:!0},rotate:{value:w,optional:!0},src:{value:p,optional:!0}},Gm(n),CJ),this.src=m,this.width=x,this.rotate=T,this.height=v,this.r=y,this.preserveAspectRatio=le(u,"xMidYMid"),this.crossOrigin=ze(f),this.frameAnchor=Fo(d),this.imageRendering=le(h,"auto")}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,width:u,height:f,r:d,rotate:h,src:p}=r,{r:m,width:g,height:y,rotate:b}=this,[x,_]=yn(this,i);return ct("svg:g",o).call(Ft,this,i,o).call(It,this,{x:c&&s,y:l&&a}).call(v=>v.selectAll().data(t).enter().append("image").call(Rt,this).attr("x",BP(c,u,d,x,g,m)).attr("y",BP(l,f,d,_,y,m)).attr("width",u?w=>u[w]:g!==void 0?g:d?w=>d[w]*2:m*2).attr("height",f?w=>f[w]:y!==void 0?y:d?w=>d[w]*2:m*2).attr("transform",h?w=>`rotate(${h[w]})`:b?`rotate(${b})`:null).attr("transform-origin",h||b?oc`${c?w=>c[w]:x}px ${l?w=>l[w]:_}px`:null).call(ft,"href",p?w=>p[w]:this.src).call(ft,"preserveAspectRatio",this.preserveAspectRatio).call(ft,"crossorigin",this.crossOrigin).call(ft,"image-rendering",this.imageRendering).call(ft,"clip-path",d?w=>`circle(${d[w]}px)`:m!==void 0?`circle(${m}px)`:null).call(Zt,this,r)).node()}};function BP(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 PP(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Be(t,n)),new sy(e,{...r,x:t,y:n})}function UJ(e,t,n){var r=1e-8,i=t-1,o=n-1,s=0,a,c,l,u,f,d,h,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)),h=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(h=-h),p=(h*h-3)/6,m=2/(1/(2*t-1)+1/(2*n-1)),g=h*Math.sqrt(p+m)/m-(1/(2*n-1)-1/(2*t-1))*(p+5/6-2/(3*m)),h=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?h=Math.pow(t*g*e,1/t):h=1-Math.pow(n*g*(1-e),1/n)),y=-od(t)-od(n)+od(t+n);s<10;s++){if(h===0||h===1)return h;if(d=zJ(h,t,n)-e,u=Math.exp(i*Math.log(h)+o*Math.log(1-h)+y),f=d/u,h-=u=f/(1-.5*Math.min(1,f*(i/h-o/(1-h)))),h<=0&&(h=.5*(h+u)),h>=1&&(h=.5*(h+u+1)),Math.abs(u)<r*h&&s>0)break}return h}function zJ(e,t,n){var r=e===0||e===1?0:Math.exp(od(t+n)-od(t)-od(n)+t*Math.log(e)+n*Math.log(1-e));return e<0||e>1?!1:e<(t+1)/(t+n+2)?r*$P(e,t,n)/t:1-r*$P(1-e,n,t)/n}function $P(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,d,h;for(Math.abs(l)<r&&(l=r),l=1/l,h=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,h*=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,d=l*c,h*=d,!(Math.abs(d-1)<3e-7));i++);return h}function od(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 UP(e,t){var n=UJ(2*Math.min(e,1-e),.5*t,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}var qJ={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},H_=class extends wt{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:qn(n),optional:!0}},n,qJ),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 ct("svg:g",o).call(Ft,this,i,o).call(It,this,n).call(u=>u.selectAll().data(c?Em(t,c,this.z):[t]).enter().call(f=>f.append("path").attr("fill","none").call(Rt,this).call(El,this,{...r,fill:null,fillOpacity:null}).attr("d",d=>this._renderLine(d,s,a)).call(l&&!Xs(this.fill)?d=>d.select(jJ).attr("stroke","none").call(Rt,this).call(El,this,{...r,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",h=>this._renderBand(h,s,a)):()=>{}))).node()}};function jJ(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(ii.svg,"path"),this)}var bA=class extends H_{constructor(t,n){super(t,n)}_renderBand(t,n,r){let{ci:i,precision:o}=this,[s,a]=ae(t,u=>r[u]),c=Z_(t,r,n),l=jP(t,r,n,(1-i)/2,c);return sf().y(u=>u).x0(u=>l(u,-1)).x1(u=>l(u,1))($e(s,a-o/2,o).concat(a))}_renderLine(t,n,r){let[i,o]=ae(t,a=>r[a]),s=Z_(t,r,n);return`M${s(i)},${i}L${s(o)},${o}`}},xA=class extends H_{constructor(t,n){super(t,n)}_renderBand(t,n,r){let{ci:i,precision:o}=this,[s,a]=ae(t,u=>n[u]),c=Z_(t,n,r),l=jP(t,n,r,(1-i)/2,c);return sf().x(u=>u).y0(u=>l(u,-1)).y1(u=>l(u,1))($e(s,a-o/2,o).concat(a))}_renderLine(t,n,r){let[i,o]=ae(t,a=>n[a]),s=Z_(t,n,r);return`M${i},${s(i)}L${o},${s(o)}`}};function zP(e,{y:t=Ae,x:n=W,stroke:r,fill:i=ne(r)?"currentColor":r,...o}={}){return new bA(e,qf({...o,x:n,y:t,fill:i,stroke:r}))}function qP(e,{x:t=Ae,y:n=W,stroke:r,fill:i=ne(r)?"currentColor":r,...o}={}){return new xA(e,zf({...o,x:t,y:n,fill:i,stroke:r}))}function Z_(e,t,n){let r=0,i=0,o=0,s=0;for(let u of e){let f=t[u],d=n[u];r+=f,i+=d,o+=f*d,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 jP(e,t,n,r,i){let o=En(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=UP(r,e.length-2);return(u,f)=>{let d=i(u),h=c*Math.sqrt(1/e.length+(u-o)**2/s);return d+f*l*h}}function ay({path:e=W,delimiter:t,frameAnchor:n,treeLayout:r=cl,treeSort:i,treeSeparation:o,treeAnchor:s,treeFilter:a,...c}={}){s=tw(s),i=GP(i),a!=null&&(a=wA(a)),n===void 0&&(n=s.frameAnchor);let l=WP(t),u=t9(c,wA),[f,d]=pn(),[h,p]=pn();return{x:f,y:h,frameAnchor:n,...mn(c,(m,g)=>{let y=l(mt(m,e)),b=d([]),x=p([]),_=-1,v=[],w=[],T=Xb().path(R=>y[R]),M=r();M.nodeSize&&M.nodeSize([1,1]),M.separation&&o!==void 0&&M.separation(o??gm);for(let R of u)R[K_]=R[KP]([]);for(let R of g){let I=[],A=T(R.filter(O=>y[O]!=null)).each(O=>O.data=m[O.data]);i!=null&&A.sort(i),M(A);for(let O of A.descendants())if(!(a!=null&&!a(O))){I.push(++_),v[_]=O.data,s.position(O,_,b,x);for(let F of u)F[K_][_]=F[JP](O)}w.push(I)}return{data:v,facets:w}}),...Object.fromEntries(u)}}function J_({path:e=W,delimiter:t,curve:n="bump-x",stroke:r="#555",strokeWidth:i=1.5,strokeOpacity:o=.5,treeLayout:s=cl,treeSort:a,treeSeparation:c,treeAnchor:l,treeFilter:u,...f}={}){l=tw(l),a=GP(a),u!=null&&(u=YP(u)),f={curve:n,stroke:r,strokeWidth:i,strokeOpacity:o,...f};let d=WP(t),h=t9(f,YP),[p,m]=pn(),[g,y]=pn(),[b,x]=pn(),[_,v]=pn();return{x1:p,x2:g,y1:b,y2:_,...mn(f,(w,T)=>{let M=d(mt(w,e)),R=m([]),I=y([]),A=x([]),O=v([]),F=-1,S=[],E=[],N=Xb().path(B=>M[B]),L=s();L.nodeSize&&L.nodeSize([1,1]),L.separation&&c!==void 0&&L.separation(c??gm);for(let B of h)B[K_]=B[KP]([]);for(let B of T){let C=[],P=N(B.filter($=>M[$]!=null)).each($=>$.data=w[$.data]);a!=null&&P.sort(a),L(P);for(let{source:$,target:U}of P.links())if(!(u!=null&&!u(U,$))){C.push(++F),S[F]=U.data,l.position($,F,R,A),l.position(U,F,I,O);for(let X of h)X[K_][F]=X[JP](U,$)}E.push(C)}return{data:S,facets:E}}),...Object.fromEntries(h)}}function tw(e="left"){switch(`${e}`.trim().toLowerCase()){case"left":return VJ;case"right":return YJ}throw new Error(`invalid tree anchor: ${e}`)}var VJ={frameAnchor:"left",dx:6,position({x:e,y:t},n,r,i){r[n]=t,i[n]=-e}},YJ={frameAnchor:"right",dx:-6,position({x:e,y:t},n,r,i){r[n]=-t,i[n]=-e}};function GP(e){return e==null||typeof e=="function"?e:`${e}`.trim().toLowerCase().startsWith("node:")?VP(wA(e)):VP(GJ(e))}function VP(e){return(t,n)=>fn(e(t),e(n))}function GJ(e){return t=>t.data?.[e]}function WP(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=>WJ(r,t))}var _A=92,XP=47;function WJ(e,t){if(t===_A)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 _A: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 XP: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 XJ(e){let t=!1;for(let n=0,r=e.length;n<r;++n){switch(e.charCodeAt(n)){case _A:if(!t){t=!0;continue}case XP:t&&(e=e.slice(0,n-1)+e.slice(n),--n,--r);break}t=!1}return e}function HP(e){return hn(e)&&typeof e.node=="function"}function HJ(e){return hn(e)&&typeof e.link=="function"}function wA(e){if(HP(e))return e.node;if(e=`${e}`.trim().toLowerCase(),!!e.startsWith("node:")){switch(e){case"node:name":return SA;case"node:path":return vA;case"node:internal":return ZP;case"node:external":return QP;case"node:depth":return IA;case"node:height":return TA}throw new Error(`invalid node value: ${e}`)}}function YP(e){if(HP(e))return e.node;if(HJ(e))return e.link;if(e=`${e}`.trim().toLowerCase(),!(!e.startsWith("node:")&&!e.startsWith("parent:"))){switch(e){case"parent:name":return Q_(SA);case"parent:path":return Q_(vA);case"parent:depth":return Q_(IA);case"parent:height":return Q_(TA);case"node:name":return SA;case"node:path":return vA;case"node:internal":return ZP;case"node:external":return QP;case"node:depth":return IA;case"node:height":return TA}throw new Error(`invalid link value: ${e}`)}}function vA(e){return e.id}function SA(e){return ZJ(e.id)}function IA(e){return e.depth}function TA(e){return e.height}function ZP(e){return!!e.children}function QP(e){return!e.children}function Q_(e){return(t,n)=>n==null?void 0:e(n)}function ZJ(e){let t=e.length;for(;--t>0&&!QJ(e,t););return XJ(e.slice(t+1))}function QJ(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}var KP=2,JP=3,K_=4;function t9(e,t){let n=[];for(let r in e){let i=e[r],o=t(i);o!==void 0&&n.push([r,...pn(i),o])}return n}function EA(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:d=u,dot:h=ne(f)&&ne(d),text:p="node:name",textStroke:m="var(--plot-background)",title:g="node:path",dx:y,dy:b,textAnchor:x,treeLayout:_=cl,textLayout:v=_===cl||_===Gb?"mirrored":"normal",tip:w,...T}={}){if(y===void 0&&(y=tw(T.treeAnchor).dx),x!==void 0)throw new Error("textAnchor is not a configurable tree option");v=Ke(v,"textLayout",["mirrored","normal"]);function M(R){return Bo(e,ay({treeLayout:_,text:p,fill:t===void 0?"currentColor":t,stroke:m,dx:y,dy:b,title:g,...R,...T}))}return Je(P_(e,J_({treeLayout:_,markerStart:f,markerEnd:d,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,...T})),h?yi(e,ay({treeLayout:_,fill:t===void 0?"node:internal":t,title:g,tip:w,...T})):null,p!=null?v==="mirrored"?[M({textAnchor:"start",treeFilter:"node:external"}),M({textAnchor:"end",treeFilter:"node:internal",dx:-y})]:M():null)}function e9(e,t){return EA(e,{...t,treeLayout:Gb})}function n9({geometry:e=W,...t}={}){return Se({...t,x:null,y:null},(n,r,i,o,s,{projection:a})=>{let c=mt(n,e),l=c.length,u=new Float64Array(l),f=new Float64Array(l),d=Mn(a);for(let h=0;h<l;++h)[u[h],f[h]]=d.centroid(c[h]);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 r9({geometry:e=W,...t}={}){let n;return{...t,x:{transform:r=>Float64Array.from(n=mt(mt(r,e),qS),([i])=>i)},y:{transform:()=>Float64Array.from(n,([,r])=>r)}}}var p9=k$(h9(),1);var ott=({marginLeft:e})=>[1,e],stt=({width:e,marginRight:t})=>[-1,e-t],att=({width:e,marginLeft:t,marginRight:n})=>[0,(t+e-n)/2],ctt=({marginTop:e})=>[1,e],ltt=({height:e,marginBottom:t})=>[-1,e-t],utt=({height:e,marginTop:t,marginBottom:n})=>[0,(t+e-n)/2];function m9(e){return typeof e=="string"?{anchor:e}:e}function y9(e={},t={}){arguments.length===1&&([e,t]=b9(e));let{anchor:n="left",padding:r=1,r:i=t.r}=m9(e);switch(`${n}`.toLowerCase()){case"left":n=ott;break;case"right":n=stt;break;case"middle":n=att;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return x9("x","y",n,Nt(r),i,t)}function g9(e={},t={}){arguments.length===1&&([e,t]=b9(e));let{anchor:n="bottom",padding:r=1,r:i=t.r}=m9(e);switch(`${n}`.toLowerCase()){case"top":n=ctt;break;case"bottom":n=ltt;break;case"middle":n=utt;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return x9("y","x",n,Nt(r),i,t)}function b9(e){let{anchor:t,padding:n,...r}=e,{r:i}=r;return[{anchor:t,padding:n,r:i},r]}function x9(e,t,n,r,i,o){if(i!=null&&typeof i!="number"){let{channels:s,sort:a,reverse:c}=o;s=xm(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 Se(o,function(s,a,c,l,u,f){let{[t]:d,r:h}=c;if(!c[t])throw new Error(`missing channel: ${t}`);({[t]:d}=rc(c,l,f));let p=h?void 0:i!==void 0?Nt(i):this.r!==void 0?this.r:3;h&&(h=mt(h.value,l[h.scale]||W,Float64Array));let[m,g]=n(u),y=m?dtt:ftt,b=new Float64Array(d.length),x=h?_=>h[_]:()=>p;for(let _ of a){let v=(0,p9.default)();_=_.filter(h?T=>ff(d[T])&&sr(h[T]):T=>ff(d[T]));let w=new Float64Array(2*_.length+2);for(let T of _){let M=x(T),R=m?M+r:0,I=d[T]-M,A=d[T]+M,O=2;v.queryInterval(I-r,A+r,([,,S])=>{let E=b[S]-R,N=d[T]-d[S],L=r+(h?h[T]+h[S]:2*p),B=Math.sqrt(L*L-N*N);w[O++]=E-B,w[O++]=E+B});let F=w.slice(0,O);m&&(F=F.filter(S=>S>=0));t:for(let S of F.sort(y)){for(let E=0;E<O;E+=2)if(w[E]+1e-6<S&&S<w[E+1]-1e-6)continue t;b[T]=S+R;break}v.insert([I,A,T])}}m||(m=1);for(let _ of a)for(let v of _)b[v]=b[v]*m+g;return{data:s,facets:a,channels:{[e]:{value:b,source:null},[t]:{value:d,source:c[t]},...h&&{r:{value:h,source:c.r}}}}})}function ftt(e,t){return Math.abs(e)-Math.abs(t)}function dtt(e,t){return e-t}function w9(e,t){return arguments.length===1&&({basis:e,...t}=e),Jf(rw(e),t)}function v9(e,t){return arguments.length===1&&({basis:e,...t}=e),td(rw(e),t)}function rw(e){if(e===void 0)return _9;if(typeof e=="function")return iw(bf(e));if(/^p\d{2}$/i.test(e))return ld(yf(e));switch(`${e}`.toLowerCase()){case"deviation":return mtt;case"first":return _9;case"last":return ptt;case"max":return ytt;case"mean":return gtt;case"median":return btt;case"min":return xtt;case"sum":return _tt;case"extent":return htt}throw new Error(`invalid basis: ${e}`)}function iw(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 ld(e){return iw((t,n)=>e(t,r=>n[r]))}var htt={mapIndex(e,t,n){let[r,i]=ae(e,s=>t[s]),o=i-r;for(let s of e)n[s]=t[s]===null?NaN:(t[s]-r)/o}},_9=iw((e,t)=>{for(let n=0;n<e.length;++n){let r=t[e[n]];if(Ue(r))return r}}),ptt=iw((e,t)=>{for(let n=e.length-1;n>=0;--n){let r=t[e[n]];if(Ue(r))return r}}),mtt={mapIndex(e,t,n){let r=Ss(e,o=>t[o]),i=ri(e,o=>t[o]);for(let o of e)n[o]=t[o]===null?NaN:i?(t[o]-r)/i:0}},ytt=ld(Gt),gtt=ld(Ss),btt=ld(Bi),xtt=ld(ce),_tt=ld(En);function S9(e,t){return wtt("x",e,t)}function wtt(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]=L1(t.replace(/^[+-]/,"")),i*=l}t=_f(t),r=(l,u)=>t.offset(l,u)}let o=`${e}1`,s=`${e}2`,a=_r({[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]=ae(l);return l.domain=i<0?[u,r(f,i)]:[r(u,i),f],l},a}function I9(e,t={}){if(typeof e=="string")switch(e.toLowerCase()){case"first":return DA(t);case"last":return kA(t)}if(typeof e=="function")return mc(null,e,t);let n,r;for(n in e){if(r!==void 0)throw new Error("ambiguous selector; multiple inputs");r=vtt(e[n])}if(r===void 0)throw new Error(`invalid selector: ${e}`);return mc(n,r,t)}function vtt(e){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"min":return FA;case"max":return LA}throw new Error(`unknown selector: ${e}`)}function DA(e){return mc(null,Stt,e)}function kA(e){return mc(null,Itt,e)}function T9(e){return mc("x",FA,e)}function E9(e){return mc("y",FA,e)}function A9(e){return mc("x",LA,e)}function M9(e){return mc("y",LA,e)}function*Stt(e){yield e[0]}function*Itt(e){yield e[e.length-1]}function*FA(e,t){yield R0(e,n=>t[n])}function*LA(e,t){yield Yc(e,n=>t[n])}function mc(e,t,n){if(e!=null){if(n[e]==null)throw new Error(`missing channel: ${e}`);e=n[e]}let r=qn(n);return mn(n,(i,o)=>{let s=mt(i,r),a=mt(i,e),c=[];for(let l of o){let u=[];for(let f of s?an(l,d=>s[d]).values():[l])for(let d of t(f,a))u.push(d);c.push(u)}return{data:i,facets:c}})}var Ttt=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 Ett(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 N9(e,t,n){for(let r in e){let i=Ttt.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&&Ett(t,i.split("."),o)}}var Att=new Set(["frame","hexgrid","sphere","graticule"]);async function O9(e){let t={marks:[]},n=[],{attributes:r,marks:i}=e;N9(r,t,n);let o=[];for(let a of i)for(let{type:c,data:l,options:u}of a.plotSpecs())Att.has(c)?t.marks.push(ow[c](u)):t.marks.push(ow[c](l,u)),o.push(a.index);Ntt(t,e);let s=Pm(t);Rtt(s,o),Mtt(e,s,r,n);for(let a of e.interactors)await a.init(s);return s}function Mtt(e,t,n,r){r.forEach(i=>{let o=n[i];if(o===co){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 Ntt(e,t){let{marks:n}=t;sw("x",e,n,["x","x1","x2"]),sw("y",e,n,["y","y1","y2"]),sw("fx",e,n),sw("fy",e,n)}function sw(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:d}=o[u]||{};f===void 0&&d===void 0||(s===void 0&&a===void 0?(s=f,a=d,c=Ott(n[u].data,r)||"number"):a!==d?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 Rtt(e,t){let n=e.querySelectorAll('g[aria-label="facet"]');if(n.length)for(let r of n)R9(r,t);else R9(e,t)}function R9(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 Ott(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 Dtt={width:640,marginLeft:40,marginRight:20,marginTop:20,marginBottom:30},uy=class{constructor(t){this.attributes={...Dtt},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=B2()}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 O9(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 Rh(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 aw(e){return typeof e!="string"?!1:(e=e.toLowerCase().trim(),e==="none"||e==="currentcolor"||e.startsWith("url(")&&e.endsWith(")")||e.startsWith("var(")&&e.endsWith(")")||Lr(e)!==null)}var ktt=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 D9(e){return ktt.has(e)}var Ftt=new Set(["asterisk","circle","cross","diamond","diamond2","hexagon","plus","square","square2","star","times","triangle","triangle2","wye"]);function k9(e){return Ftt.has(`${e}`.toLowerCase())}function ud(e){return typeof e?.getChild=="function"}function F9(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 cw(e){return ud(e)?Ltt(e):e}function Ltt(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:d,type:h}=a.fields[u],p=F9(h);for(let m=i,g=0;g<c;++g,++m)r[m][d]=p(f.get(g))}i+=c}return r}var L9=e=>e==="stroke"||e==="fill",Ctt=e=>e==="symbol",Btt=(e,t)=>e!=="sort"&&e!=="tip"&&t!=null&&!Array.isArray(t),CA=(e,t)=>({channel:e,field:t,as:t instanceof gr?t.column:e}),BA=(e,t)=>({channel:e,value:t}),lw=e=>Array.isArray(e),Dn=class extends ur{constructor(t,n,r,i={}){super(n?.options?.filterBy),this.type=t,this.reqs=i,this.source=n,lw(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 d in u)s.add(d),c(d,u[d]);else if(f==="function"&&u[Oh]){let d=u(this,l);for(let h in d)c(h,d[h])}else if(f==="string")D9(l)||L9(l)&&aw(u)||Ctt(l)&&k9(u)?o.push(BA(l,u)):o.push(CA(l,Sa(u)));else if(ps(u))if(Array.isArray(u.columns))o.push(CA(l,u)),a.add(u);else{let d=BA(l,u.value);o.push(d),u.addEventListener("value",h=>(d.value=h,this.update()))}else f==="object"&&Btt(l,u)?o.push(CA(l,u)):u!==void 0&&o.push(BA(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||lw(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 PA(n,r).where(t)}queryPending(){return this.plot.pending(this),this}queryResult(t){return this.data=cw(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]=gi(a)}return r.size&&(o.channels=s),[{type:t,data:n,options:o}]}};function gi(e){return Object.hasOwn(e,"value")?e.value:L9(e.channel)?{value:e.as,scale:"color"}:e.as}function PA(e,t,n=[]){let r=yt.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 zl(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 Mh(i)}function Yr(e,t,n,r,i=1,o){let{field:s}=e.channelField(t);o=o??s;let{type:a,apply:c,sqlApply:l}=zl(e,t),u=!!e.plot.getAttribute(`${t}Reverse`),[f,d]=r.map(b=>c(b)),h=l(o),p=a==="time"||a==="utc"?h:o,m=d===f?0:(n-i)/(d-f),g=m!==1?` * ${m}::DOUBLE`:"";return[u?j`(${d} - ${h}::DOUBLE)${g}`:j`(${h}::DOUBLE - ${f})${g}`,p]}var $A={x:["min","max"]},UA={y:["min","max"]},uw={...$A,...UA};function C9(e,t,n,r,i){let{plot:o,stats:s}=e,a=o.getAttribute(r),c=o.getAttribute(i);if(Array.isArray(a)&&!a[Sn])return a;{let{field:l}=e.channelField(n),{column:u}=l,{min:f,max:d}=s[u],h=zA(t,u)||(c?ks().domain([f,d]).nice().domain():[f,d]);return a!==co&&(h[Sn]=!0),o.setAttribute(r,h,{silent:!0}),h}}function qo(e,t){return C9(e,t,"x","xDomain","xNice")}function jo(e,t){return C9(e,t,"y","yDomain","yNice")}function zA(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 fy=class extends Dn{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:d}=o[u.column];if(s&&(d==="date"||d==="number")&&l){let{column:p}=u,{max:m,min:g}=o[p],y=r==="x"?n.innerWidth():n.innerHeight(),[b,x]=zA(t,p)||[g,m],[_]=Yr(this,r,y,[b,x],1,f),v=a.select().map(w=>w.as).filter(w=>w!==f&&w!==l);return Ptt(a,_,f,l,v)}else return a.orderby(u)}};function Ptt(e,t,n,r,i=[]){let o=j`FLOOR(${t})::INTEGER`,s=a=>yt.from(e).select(a).groupby(o,i);return yt.union(s([{[n]:ti(n),[r]:mu(r,n)},...i]),s([{[n]:Jr(n),[r]:yu(r,n)},...i]),s([{[n]:mu(n,r),[r]:ti(r)},...i]),s([{[n]:yu(n,r),[r]:Jr(r)},...i])).orderby(i,n)}function qA(e,t="density"){if(ud(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 B9(e,t){let n=qA(t);return $9(new n(e),t)}function P9(e,t,n,r,i=[]){if(i.length)return qtt(e*t,n,r,i);{let o={};return r.forEach(s=>{let a=qA(n,s);o[s]=$9(new a(e*t),n,s)}),[o]}}function $9(e,t,n="density"){if(ud(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 qtt(e,t,n,r){let i=n.map(c=>qA(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(ud(t)){let c=t.numRows;if(c===0)return[];let l=t.getChild("index").toArray(),u=n.map(d=>t.getChild(d).toArray()),f=r.map(d=>t.getChild(d));for(let d=0;d<c;++d){let h=f.map(m=>m.get(d)),p=a(h);for(let m=0;m<o;++m)p[n[m]][l[d]]=u[m][d]}}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 dy(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 U9(e,t){let n=new Qn;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(Ut)}function kn(e,t,n,r){br(n)?(r=r||(()=>e.requestUpdate()),n.addEventListener("value",i=>(e[t]=i,r())),e[t]=n.value):e[t]=n}function hy(e,t=!1){let n=new Float64Array(5),r=new Float64Array(4);jtt(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 jtt(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),d=Float64Array.of(1,0,l[0],l[1],0,0,0,0,0,0),h,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],h=p-2;h>0;h-=2)f[h]+=l[p]*f[h-2]-l[p+1]*f[h-1],f[h+1]+=l[p]*f[h-1]+l[p+1]*f[h-2];for(h=0;h<=p;h+=2)f[h]+=i[p]*d[h]-i[p+1]*d[h+1],f[h+1]+=i[p]*d[h+1]+i[p+1]*d[h];for(d[p+2]=l[p]*d[p]-l[p+1]*d[p+1],d[p+3]=l[p]*d[p+1]+l[p+1]*d[p],h=p;h>0;h-=2)d[h]+=l[p]*d[h-2]-l[p+1]*d[h-1],d[h+1]+=l[p]*d[h-1]+l[p+1]*d[h-2]}for(p=0;p<4;++p)h=p<<1,t[p]=f[h]/u,e[p+1]=d[h+2]}function z9(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);fw(e,n.subarray(u),r,1,o,s,a,f)}for(let l=0;l<r;++l){let u=c.subarray(l);fw(t,u,i,r,o,s,a,u)}return c}function fw(e,t,n,r=1,i=new Float64Array(n),o=new Float64Array(n),s=new Float64Array(5),a=i,c=Vtt){let l=r*2,u=r*3,f=r*4,d=r*n,h,p;for(c(i,t,n,r,e.b_causal,3,e.a,4,e.sum_causal,s,e.sigma),p=4,h=f;p<n;++p,h+=r)i[p]=e.b_causal[0]*t[h]+e.b_causal[1]*t[h-r]+e.b_causal[2]*t[h-l]+e.b_causal[3]*t[h-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,h=d-r*5;p<n;++p,h-=r)o[p]=e.b_anticausal[1]*t[h+r]+e.b_anticausal[2]*t[h+l]+e.b_anticausal[3]*t[h+u]+e.b_anticausal[4]*t[h+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,h=0;p<n;++p,h+=r)a[h]=i[p]+o[n-p-1];else for(p=0,h=0;p<n;++p,h+=r)a[h]=Math.max(0,i[p]+o[n-p-1]);return a}function Vtt(e,t,n,r,i,o,s,a,c,l){let u=Math.abs(r)*n,f=r<0?u+r:0,d,h,p;for(h=0;h<a;++h)for(l[h]=h<=o?i[h]:0,p=1;p<=a&&p<=h;++p)l[h]-=s[p]*l[h-p];for(p=0;p<a;++p)for(e[p]=0,h=1;h<=p;++h)d=f+r*h,d>=0&&d<u&&(e[p]+=l[p-h]*t[d]);let m=t[f];if(m>0)for(p=0;p<a;++p)e[p]+=l[p]*m}var ra="density",Yi=class extends Dn{constructor(t,n,r){let{bandwidth:i=0,interpolate:o="none",pixelSize:s=1,pad:a=1,width:c,height:l,...u}=r,f=Ytt(u);super(t,n,u,uw),this.densityMap=f,kn(this,"bandwidth",i,()=>this.grids?this.convolve().update():null),kn(this,"pixelSize",s),kn(this,"interpolate",o),kn(this,"pad",a),kn(this,"width",c),kn(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[Sn]&&!n[Sn]}query(t=[]){let{interpolate:n,pad:r,channels:i,densityMap:o,source:s}=this,[a,c]=this.extentX=qo(this,t),[l,u]=this.extentY=jo(this,t),[f,d]=this.bins=this.binDimensions(this),[h,p]=Yr(this,"x",f,[a,c],r),[m,g]=Yr(this,"y",d,[l,u],r),y=r?[Te(p,[+a,+c]),Te(g,[+l,+u])]:[bs(+a,p),gs(p,+c),bs(+l,g),gs(g,+u)],b=yt.from(s.table).where(t.concat(y)),x=this.groupby=[],_={};for(let w of i)if(Object.hasOwn(w,"field")){let{as:T,channel:M,field:R}=w;R.aggregate?(_[M]=R,o[M]=!0):M==="weight"?_[ra]=Fr(R):M!=="x"&&M!=="y"&&(b.select({[T]:R}),x.push(T))}let v=this.aggr=Object.keys(_);if(_.density&&v.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(v.length||(v.push(ra),_.density=kr()),n==="linear"){if(v.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!_.density)throw new Error("Linear binning not applicable to custom aggregates.");return Wtt(b,h,m,_[ra],f,x)}else return Gtt(b,h,m,_,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=P9(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(ra)?ra: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)),d=hy(n*(l-1)/a,f),h=hy(n*(u-1)/c,f);this.kde=this.grids.map(p=>{let m=z9(d,h,p[s],r);return{...p,[s]:m}})}return this}plotSpecs(){throw new Error("Unimplemented. Use a Grid2D mark subclass.")}};function Ytt(e){let t={};for(let n in e)e[n]==="density"&&(delete e[n],t[n]=!0);return t}function Gtt(e,t,n,r,i,o){return e.select({index:j`FLOOR(${t})::INTEGER + FLOOR(${n})::INTEGER * ${i}`,...r}).groupby("index",o)}function Wtt(e,t,n,r,i,o){let s=r?.column?`* ${r.column}`:"",a=(d,h)=>e.clone().select({xp:t,yp:n,i:d,w:h}),c=a(j`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${i}`,j`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),l=a(j`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${i}`,j`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(j`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${i}`,j`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(j`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${i}`,j`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return yt.from(yt.unionAll(c,l,u,f)).select({index:"i",density:Fr("w")},o).groupby("index",o).having(Uc("density",0))}var py=class extends Yi{constructor(t,n){let{thresholds:r=10,...i}=n;super("geo",t,{bandwidth:20,interpolate:"linear",pixelSize:2,...i}),kn(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[,_]=dy(r,"density");s=Array.from({length:s-1},(v,w)=>_*(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,d]=o.getAttribute("yDomain"),h=(u-l)/a,p=(d-f)/c,m=+l,g=+f,y=_=>m+_*h,b=_=>g+_*p,x=Ca().size(t);return this.data=r.flatMap(_=>s.map(v=>Object.assign(Xtt(x.contour(_.density,v),y,b),{..._,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]=gi(s))}return r.fill&&(o.fill="density"),r.stroke&&(o.stroke="density"),[{type:t,data:i,options:o}]}};function Xtt(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 dw(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 q9(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 j9(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 V9(e={}){let{r:t=0,g:n=0,b:r=0,opacity:i=1}=typeof e=="string"?rn(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 Y9(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:d=1}=typeof c=="string"?rn(c):c,h=a<<2;i[h+0]=l,i[h+1]=u,i[h+2]=f,i[h+3]=255*d|0,r[t[a]]=h}return(a,c,l,u)=>{if(u.map)for(let f=0,d=0;f<l;++f)for(let h=0,p=(l-f-1)*c;h<c;++h,d+=4){let m=r[u[h+p]];a[d+0]=i[m+0],a[d+1]=i[m+1],a[d+2]=i[m+2],a[d+3]=i[m+3]}else{let f=r[u];for(let d=0,h=0;d<l;++d)for(let p=0;p<c;++p,h+=4)a[h+0]=i[f+0],a[h+1]=i[f+1],a[h+2]=i[f+2],a[h+3]=i[f+3]}}}function G9(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"?rn(a):a,d=s<<2;i[d+0]=c,i[d+1]=l,i[d+2]=u,i[d+3]=255*f|0}return(s,a,c,l)=>{for(let u=0,f=0;u<c;++u)for(let d=0,h=(c-u-1)*a;d<a;++d,f+=4){let p=o*n(l[d+h])<<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 yc=class extends Yi{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}=Ktt(this,r,i),{alpha:c,alphaProp:l,color:u,colorProp:f}=jA(this);return this.data=n.map(d=>(u?.(a.data,r,i,d[f]),c?.(a.data,r,i,d[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}]}},my=class extends yc{constructor(t,n){super(t,{bandwidth:20,interpolate:"linear",pixelSize:2,...n})}};function jA(e){let{aggr:t,densityMap:n,groupby:r,plot:i}=e,o=t.includes(ra),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":aw(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"?ra:null),d=c?.as??(u==="grid"?ra:null),h=l!=="grid"&&l!=="group"?V9(l):Ztt(e,f),p=u!=="grid"?q9(u):Htt(e,d);return{alphaProp:d,colorProp:f,alpha:p,color:h}}function Htt(e,t){let{plot:n,kde:r}=e,i=n.getAttribute("opacityDomain"),o=i===co,s=i?.[Sn],a=!o&&!s&&i||dy(r,t);(o||s)&&(s&&(a[Sn]=!0),n.setAttribute("colorDomain",a));let c=kf({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 j9(c)}function Ztt(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===co,c=s?.[Sn],l=!a&&!c&&s||(i?r.map(f=>f[t]).sort(Ut):o?U9(r,t):dy(r,t));(a||c)&&(c&&(l[Sn]=!0),n.setAttribute("colorDomain",l));let u=kf({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 Y9(u);{let f=kf({x:{type:Qtt(u.type),domain:u.domain,reverse:u.reverse,range:[0,1],clamp:u.clamp,base:u.base,exponent:u.exponent,constant:u.constant}});return G9(1024,u,f.apply)}}function Qtt(e){return e.endsWith("symlog")?"symlog":e.endsWith("log")?"log":e.endsWith("pow")?"pow":e.endsWith("sqrt")?"sqrt":e==="diverging"?"linear":e}function Ktt(e,t,n){if(!e.image||e.image.w!==t||e.image.h!==n){let r=dw(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 yy=class extends yc{constructor(t,n){let{normalize:r=!0,...i}=n;super(t,i),kn(this,"normalize",r)}query(t=[]){let{channels:n,normalize:r,source:i,binPad:o}=this,[s,a]=this.bins=this.binDimensions(this),[c]=Yr(this,"x",s,qo(this,t),o),[l]=Yr(this,"y",a,jo(this,t),o),u=yt.from(i.table).where(Jtt(this,t));this.aggr=["density"];let f=this.groupby=[],d=[];for(let h of n)if(Object.hasOwn(h,"field")){let{channel:p,field:m}=h;p==="z"?(u.select({[p]:m}),d.push("z")):p!=="x"&&p!=="y"&&(u.select({[p]:m}),f.push(p))}return tet(u,c,l,d,s,a,f,r)}};function Jtt(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"?Xn(s.children.filter(a=>i(a))):s;return Array.isArray(t)?t.filter(s=>i(s)).map(s=>o(s)):o(t)}function tet(e,t,n,r,i,o,s=[],a=!0){e.select({x:j`FLOOR(${t})::INTEGER`,y:j`FLOOR(${n})::INTEGER`});let c=s.concat(r),l=c.length?`PARTITION BY ${c.join(", ")} `:"",u=yt.from(e).select(c,{x0:"x",y0:"y",dx:j`(lead(x) OVER sw - x)`,dy:j`(lead(y) OVER sw - y)`}).window({sw:j`${l}ORDER BY x ASC`}).qualify(Xn(j`(x0 < ${i} OR x0 + dx < ${i})`,j`(y0 < ${o} OR y0 + dy < ${o})`,j`(x0 > 0 OR x0 + dx > 0)`,j`(y0 > 0 OR y0 + dy > 0)`)),f=yt.select({x:j`GREATEST(MAX(ABS(dx)), MAX(ABS(dy)))`}).from("pairs"),d=yt.select({i:j`UNNEST(range((${f})))::INTEGER`}),h=yt.unionAll(yt.select(c,{x:j`x0 + i`,y:j`y0 + ROUND(i * dy / dx::FLOAT)::INTEGER`}).from("pairs","indices").where(j`ABS(dy) <= ABS(dx) AND i < ABS(dx)`),yt.select(c,{x:j`x0 + ROUND(SIGN(dy) * i * dx / dy::FLOAT)::INTEGER`,y:j`y0 + SIGN(dy) * i`}).from("pairs","indices").where(j`ABS(dy) > ABS(dx) AND i < ABS(dy)`),yt.select(c,{x:"x0",y:"y0"}).from("pairs").where($c("dx"))),p=["x"].concat(c).join(", "),m=yt.from("raster").select(c,"x","y",a?{w:j`1.0 / COUNT(*) OVER (PARTITION BY ${p})`}:null).where(Xn(Te("x",[0,i],!0),Te("y",[0,o],!0)));return yt.with({pairs:u,indices:d,raster:h,points:m}).from("points").select(s,{index:j`x + y * ${i}::INTEGER`,density:a?Fr("w"):kr()}).groupby("index",s)}var fd=class extends Dn{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"?$A:UA),this.dim=a,kn(this,"bins",i),kn(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[Sn]}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"?qo:jo)(this,t),[a,c]=Yr(this,i,n,s),l=PA(r,o,[i]).where(t.concat(Te(c,s))),u=this.channelField("weight")?"weight":null;return eet(l,a,u)}queryResult(t){return this.grid=B9(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=hy(n*(t-1)/l,c),f=fw(u,i,t),d=this.data=[],h=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)d.push({[p]:m+b*g,[h]: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]=gi(s);return[{type:t,data:n,options:o}]}};function eet(e,t,n){let r=n?`* ${n}`:"",i=e.clone().select({p:t,i:j`FLOOR(p)::INTEGER`,w:j`(FLOOR(p) + 1 - p)${r}`}),o=e.clone().select({p:t,i:j`FLOOR(p)::INTEGER + 1`,w:j`(p - FLOOR(p))${r}`});return yt.from(yt.unionAll(i,o)).select({index:"i",density:Fr("w")}).groupby("index").having(vh("density",0))}var gy=class extends Yi{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=zl(this,"x"),c=zl(this,"y"),[l,u]=r.map(g=>a.apply(g)),[f,d]=i.map(g=>c.apply(g)),h=(u-l)/(o-n),p=(d-f)/(s-n),m=n?0:.5;return this.data=net(this.kde,t,l,f,h,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:gi(s)}for(let s in r)r[s]&&(o[s]="density");return[{type:t,data:i,options:o}]}};function net(e,t,n,r,i,o,s,a,c){let l=1/(i*o),[u,f]=t,d=[];for(let h of e){let p=h.density;for(let m=0,g=0;g<f;++g)for(let y=0;y<u;++y,++m)d.push({...h,x:s(n+(y+c)*i),y:a(r+(g+c)*o),density:p[m]*l})}return d}var ret="geom",by=class extends Dn{constructor(t,n={},r){!lw(t)&&!n?.geometry&&(n.geometry=Eh(ret)),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 xy=class extends Dn{constructor(t,n){let{type:r="hexagon",binWidth:i=20,...o}=n;super(r,t,{r:i/2,clip:!0,...o},uw),this.binWidth=i}get filterIndexable(){let t=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return t&&n&&!t[Sn]&&!n[Sn]}query(t=[]){if(this.hasOwnData())return null;let{plot:n,binWidth:r,channels:i,source:o}=this,[s,a]=qo(this,t),[c,l]=jo(this,t),u=.5-n.getAttribute("marginLeft"),f=0-n.getAttribute("marginTop"),d=`${r}::DOUBLE`,h=`${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 M of i)M.channel==="orderby"?_.orderby(M.value):M.channel==="x"?g=M:M.channel==="y"?y=M:Object.hasOwn(M,"field")&&(x[M.as]=M.field,M.field.aggregate&&M.field.columns.forEach(R=>b.add(R)));let _=yt.select({[g.as]:j`${s}::DOUBLE + ((x + 0.5 * (y & 1)) * ${d} + ${u})::DOUBLE / ${p}`,[y.as]:j`${l}::DOUBLE - (y * ${h} + ${f})::DOUBLE / ${m}`,...x}).groupby("x","y"),v=`${p} * (${g.field} - ${s}::DOUBLE)`,w=`${m} * (${l}::DOUBLE - ${y.field})`,T=yt.select({py:j`(${w} - ${f}) / ${h}`,pj:j`ROUND(py)::INTEGER`,px:j`(${v} - ${u}) / ${d} - 0.5 * (pj & 1)`,pi:j`ROUND(px)::INTEGER`,tt:j`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:j`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:j`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(ms(g.field),ms(y.field),t);return _.from(T)}};var _y=class extends Yi{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,d]=this.bins,[h,p]=Yr(this,"x",f,[a,c],r),[m,g]=Yr(this,"y",d,[l,u],r),y=r?[Te(p,[+a,+c]),Te(g,[+l,+u])]:[bs(+a,p),gs(p,+c),bs(+l,g),gs(g,+u)],b=yt.from(s.table).where(y),x=this.groupby=[],_={};for(let w of i)if(Object.hasOwn(w,"field")){let{as:T,channel:M,field:R}=w;R.aggregate?(_[M]=R,o[M]=!0):M==="weight"?_.density=Fr(R):M!=="x"&&M!=="y"&&(b.select({[T]:R}),x.push(T))}let v=this.aggr=Object.keys(_);if(_.density&&v.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(v.length||(v.push("density"),_.density=kr()),n==="linear"){if(v.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!_.density)throw new Error("Linear binning not applicable to custom aggregates.");return cet(b,h,m,_.density,f,x)}else return aet(b,h,m,_,f,x)}async requestTiles(){let t=ei();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]=qo(this,this._filter),[f,d]=jo(this,this._filter),h=u-l,p=d-f,m=Math.floor((l-o)*(a-n)/h),g=Math.floor((f-s)*(c-n)/p),y=(I,A)=>[[o+I*h,o+(I+1)*h],[s+A*p,s+(A+1)*p]],b=Math.floor((l-o)/h),x=r?W9((u-o)/h):b,_=Math.floor((f-s)/p),v=i?W9((d-s)/p):_,w=[];for(let I=b;I<=x;++I)for(let A=_;A<=v;++A)w.push([I,A]);let T=w.map(([I,A])=>t.query(this.tileQuery(y(I,A)))),M=[];if(r)for(let I=_;I<=v;++I)M.push([x+1,I]),M.push([b-1,I]);if(i){let I=r?b-1:b,A=r?x+1:x;for(let O=I;O<=A;++O)M.push([O,v+1]),M.push([O,_-1])}this.prefetch=M.map(([I,A])=>t.prefetch(this.tileQuery(y(I,A))));let R=await Promise.all(T);this.grids=[{density:iet(a,c,m,g,w,R)}],this.convolve().update()}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:t,kde:n}=this,[r,i]=t,{canvas:o,ctx:s,img:a}=set(this,r,i),{alpha:c,alphaProp:l,color:u,colorProp:f}=jA(this);return this.data=n.map(d=>(u?.(a.data,r,i,d[f]),c?.(a.data,r,i,d[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 iet(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,d=u*t-r;oet(e,t,s,a,f,d)}),s}function oet(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,d=o+Math.floor(u/e);0<=f&&f<e&&0<=d&&d<t&&(n[f+d*e]=c[l])}}function set(e,t,n){if(!e.image||e.image.w!==t||e.image.h!==n){let r=dw(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 aet(e,t,n,r,i,o){return e.select({index:j`FLOOR(${t})::INTEGER + FLOOR(${n})::INTEGER * ${i}`,...r}).groupby("index",o)}function cet(e,t,n,r,i,o){let s=r.column?`* ${r.column}`:"",a=(d,h)=>e.clone().select({xp:t,yp:n,i:d,w:h}),c=a(j`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${i}`,j`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),l=a(j`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${i}`,j`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(j`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${i}`,j`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(j`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${i}`,j`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return yt.from(yt.unionAll(c,l,u,f)).select({index:"i",density:Fr("w")},o).groupby("index",o).having(Uc("density",0))}function W9(e){let t=Math.floor(e);return t===e?t-1:t}function uet(e,t,n){var r=1e-8,i=t-1,o=n-1,s=0,a,c,l,u,f,d,h,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)),h=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(h=-h),p=(h*h-3)/6,m=2/(1/(2*t-1)+1/(2*n-1)),g=h*Math.sqrt(p+m)/m-(1/(2*n-1)-1/(2*t-1))*(p+5/6-2/(3*m)),h=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?h=Math.pow(t*g*e,1/t):h=1-Math.pow(n*g*(1-e),1/n)),y=-dd(t)-dd(n)+dd(t+n);s<10;s++){if(h===0||h===1)return h;if(d=fet(h,t,n)-e,u=Math.exp(i*Math.log(h)+o*Math.log(1-h)+y),f=d/u,h-=u=f/(1-.5*Math.min(1,f*(i/h-o/(1-h)))),h<=0&&(h=.5*(h+u)),h>=1&&(h=.5*(h+u+1)),Math.abs(u)<r*h&&s>0)break}return h}function fet(e,t,n){var r=e===0||e===1?0:Math.exp(dd(t+n)-dd(t)-dd(n)+t*Math.log(e)+n*Math.log(1-e));return e<0||e>1?!1:e<(t+1)/(t+n+2)?r*X9(e,t,n)/t:1-r*X9(1-e,n,t)/n}function X9(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,d,h;for(Math.abs(l)<r&&(l=r),l=1/l,h=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,h*=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,d=l*c,h*=d,!(Math.abs(d-1)<3e-7));i++);return h}function dd(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 H9(e,t){var n=uet(2*Math.min(e,1-e),.5*t,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}var wy=class extends Dn{constructor(t,n){let{ci:r=.95,precision:i=4,...o}=n;super("line",t,o);let s=()=>this.modelFit?this.confidenceBand().update():null;kn(this,"ci",r,s),kn(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 yt.from(super.query(t)).select({intercept:r2(r,n),slope:i2(r,n),n:o2(r,n),ssy:s2(r,n),ssx:a2(r,n),xm:c2(r,n),x0:gu(ti(n).where(ms(r))),x1:gu(Jr(n).where(ms(r)))}).select(i).groupby(i)}queryResult(t){return this.modelFit=cw(t),this.lineData=this.modelFit.flatMap(n=>det(n)),this.confidenceBand()}confidenceBand(){let{ci:t,modelFit:n,precision:r,plot:i}=this,o=i.innerWidth();return this.areaData=t?n.flatMap(s=>het(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=gi(a);break;case"strokeOpacity":o.strokeOpacity=gi(a);break;case"fillOpacity":s.fillOpacity=gi(a);break;default:o[a.channel]=s[a.channel]=gi(a);break}return[...i?[{type:"areaY",data:n,options:s}]:[],{type:"line",data:t,options:o}]}};function det(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 het(e,t,n,r){let{x0:i,x1:o,xm:s,intercept:a,slope:c,n:l,ssx:u,ssy:f,...d}=n,h=t*(o-i)/r,p=H9((1-e)/2,l-2)*Math.sqrt(f/(l-2));return $e(i,o-h/2,h).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,...d}})}function Z9(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 hd(e){let t={};for(let n in e)t[Z9(n)]=e[n];return t}function pet(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 vy=class{constructor(t,{selection:n,channels:r={}}){this.mark=pet(t),this.selection=n;let i=Object.entries(hd(r));this.channels=i.length?i:[["opacity",.2]],this.selection.addEventListener("value",_d(()=>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 met(o,s);for(let c=0;c<n.length;++c){let l=n[c],u=i[c],f=a(l.__data__);for(let d=0;d<r.length;++d){let[h,p]=r[d];l.setAttribute(h,f?u[d]:p)}}}};async function met(e,t){let n=t?.predicate(e);if(!n||n.length===0)return()=>!0;let r=e.filterBy?.predicate(e,!0),i={__:Xn(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 VA(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 Q9(){return VA(wS())}function K9(){return VA(xS())}function J9(){return VA(_S())}function Sy(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 Vo(e,t){let n=e.channelField(t)?.field;return n?.basis||n}function Iy(e,t,n=1){return t.invert(n*Math.floor(e/n))}function hw(){let e=this,t=e.getScreenCTM,n;e.getScreenCTM=()=>e.isConnected?n=t.call(e):n}var pd=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||Vo(t,[n,n+"1",n+"2"]),this.style=a&&hd(a),this.brush=n==="y"?J9():K9(),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=>Iy(r,this.scale,this.pixelSize)).sort((r,i)=>r-i)),Sy(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?Te(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([[ce(o),ce(s)],[Gt(o),Gt(s)]]);let a=qt(t).selectAll('g[aria-label="facet"]'),c=a.size()?a:qt(t);if(this.g=c.append("g").attr("class",`interval-${r}`).each(hw).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 pw=(e,t)=>e-t,Ty=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||Vo(t,["x","x1","x2"]),this.yfield=i||Vo(t,["y","y1","y2"]),this.style=a&&hd(a),this.brush=Q9(),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=>Iy(u,i,r)).sort(pw),a=[c[1],l[1]].map(u=>Iy(u,o,r)).sort(pw)}(!Sy(s,n?.[0])||!Sy(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?Xn(Te(i,t[0]),Te(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([[ce(s),ce(a)],[Gt(s),Gt(a)]]);let c=qt(t).selectAll('g[aria-label="facet"]'),l=c.size()?c:qt(t);if(this.g=l.append("g").attr("class","interval-xy").each(hw).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(pw),[d,h]=this.value[1].map(o.apply).sort(pw);this.g.call(n.moveSilent,[[u,d],[f,h]])}t.addEventListener("pointerenter",()=>this.activate())}};var md=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||Vo(t,[r])}clause(t){let{clients:n,field:r}=this,i=t?ys(r,Dr(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=qt(t).selectAll('g[aria-label="facet"]'),l=c.size()?c:qt(t),u=t.scale(i),f=!ni(o);l.on("pointerdown pointermove",function(d){let[h,p]=Ln(d,this),m=yet(s,a,u.invert(i==="x"?h:p));o.update(f?m:n.clause(m))}),!f&&t.addEventListener("pointerenter",()=>{this.selection.activate(this.clause(0))})}};function yet(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 t$=(e,t)=>e-t,Ey=class{constructor(t,{x:n=new xs,y:r=new xs,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||Vo(t,["x","x1","x2"]),this.yfield=o||Vo(t,["y","y1","y2"]),this.zoom=YA(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=get(t,this.xscale);this.xsel.update(this.clause(n,this.xfield,this.xscale))}if(this.pany){let n=bet(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?Te(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(t$),c=this.yscale.range.slice().sort(t$),l=YA(n,[-1/0,1/0],a),u=YA(r,[-1/0,1/0],c),f=BT().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 Ur(1,0,0)).on("zoom",({transform:d})=>this.publish(d));if(qt(i).call(f),n||r){let d=!1;i.addEventListener("mouseenter",()=>{if(!d){if(d=!0,n){let{xscale:h,xfield:p}=this;o.activate(this.clause(h.domain,p,h))}if(r){let{yscale:h,yfield:p}=this;s.activate(this.clause(h.domain,p,h))}}}),i.addEventListener("mouseleave",()=>d=!1)}}};function YA(e,t,n){return e?Array.isArray(e)?e:t:n}function get(e,t){return t.range.map(e.invertX,e).map(t.invert,t)}function bet(e,t){return t.range.map(e.invertY,e).map(t.invert,t)}var ql=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)=>Sh(n[l].field,Dr(c)));return a.length>1?Xn(a):a[0]});i=o.length>1?Pc(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,d=null;if(xet(c,f)){let h=r(f);l.shiftKey&&u?.length?(d=u.filter(p=>GA(p,h)),d.length===u.length&&d.push(h)):u?.length===1&&!GA(u[0],h)?d=null:d=[h]}this.value=d,_et(u,d)&&s.update(this.clause(d))}),t.addEventListener("pointerenter",()=>{this.selection.activate(this.clause([this.channels.map(()=>0)]))})}};function xet(e,t){return e.has(t)||e.has(t.parentNode)||e.has(t.parentNode?.parentNode)}function _et(e,t){return e==null||t==null?e!=null||t!=null:e.length!==t.length||e.some((n,r)=>GA(n,t[r]))}function GA(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 yd=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=wet(t,n);this.selection&&i&&(this.handler=new ql(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 wet({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 vet=new Set(["rectY-x","rectX-y","rect-x","rect-y"]);function mw(e,t={steps:25}){let n=(r,i)=>vet.has(`${r.type}-${i}`)?{[`${i}1`]:WA(r,i,e,t),[`${i}2`]:WA(r,i,e,{...t,offset:1})}:{[i]:WA(r,i,e,t)};return n[Oh]=!0,n}function WA(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}=zl(e,t),{min:a,max:c}=e.stats[n],l=Iet(i(a),i(c),r),u=o(n),f=l.min===0?u:`(${u} - ${l.min})`,d=`${(l.max-l.min)/l.steps}::DOUBLE`,h=r.offset?`${r.offset} + `:"",p=`${l.min} + ${d} * (${h}FLOOR(${f} / ${d}))`;return`${s(p)}`}}}function Iet(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],d;for(let m=0,g=f.length;m<g;++m)d=u/f[m],d>=i&&s/d<=a&&(u=d);d=Math.log(u);let h=d>=0?0:~~(-d/c)+1,p=Math.pow(10,-h-1);d=Math.floor(e/u+p)*u,e=e<d?d-u:d,t=Math.ceil(t/u)*u,r=Math.round((t-e)/u)}return{min:e,max:t,steps:r}}var Tet=e=>e&&typeof e=="object"&&!Array.isArray(e);var Ay=class extends ur{constructor({element:t,filterBy:n,from:r,column:i,label:o=i,format:s=u=>u,options:a,value:c,as:l}={}){super(n),this.from=r,this.column=i,this.selection=l,this.format=s,this.element=t??document.createElement("div"),this.element.setAttribute("class","input"),this.element.value=this;let u=document.createElement("label");u.innerText=o||i,this.element.appendChild(u),this.select=document.createElement("select"),a&&(this.data=a.map(f=>Tet(f)?f:{value:f}),this.update()),c=c??this.selection?.value??this.data?.[0]?.value,this.selection?.value===void 0&&this.publish(c),this.element.appendChild(this.select),this.selection&&(this.select.addEventListener("input",()=>{this.publish(this.selectedValue()??null)}),ni(this.selection)||this.selection.addEventListener("value",f=>{f!==this.select.value&&this.selectedValue(f)}))}selectedValue(t){if(arguments.length===0){let n=this.select.selectedIndex;return this.data[n].value}else{let n=this.data?.findIndex(r=>r.value===t);n>=0?this.select.selectedIndex=n:this.select.value=String(t)}}reset(){this.select.selectedIndex=this.from?0:-1}publish(t){let{selection:n,column:r}=this;ni(n)?n.update({source:this,schema:{type:"point"},value:t,predicate:t!==""&&t!==void 0?ys(r,Dr(t)):null}):br(n)&&n.update(t)}query(t=[]){let{from:n,column:r}=this;return n?yt.from(n).select({value:r}).distinct().where(t).orderby(r):null}queryResult(t){return this.data=[{value:"",label:"All"},...t],this}update(){let{data:t,format:n,select:r}=this;r.replaceChildren();for(let{value:i,label:o}of t){let s=document.createElement("option");s.setAttribute("value",i),s.innerText=o??n(i),this.select.appendChild(s)}return this.selection&&this.selectedValue(this.selection?.value??""),this}};var Eet={contains:Ev,prefix:Av,suffix:Mv,regexp:Tv},Aet=0;var My=class extends ur{constructor({element:t,filterBy:n,from:r,column:i,label:o,type:s="contains",as:a}={}){if(super(n),this.id="search_"+ ++Aet,this.type=s,this.from=r,this.column=i,this.selection=a,this.element=t??document.createElement("div"),this.element.setAttribute("class","input"),this.element.value=this,o){let c=document.createElement("label");c.setAttribute("for",this.id),c.innerText=o,this.element.appendChild(c)}this.searchbox=document.createElement("input"),this.searchbox.setAttribute("id",this.id),this.searchbox.setAttribute("type","text"),this.searchbox.setAttribute("placeholder","Query"),this.element.appendChild(this.searchbox),this.selection&&(this.searchbox.addEventListener("input",()=>{this.publish(this.searchbox.value||null)}),ni(this.selection)||this.selection.addEventListener("value",c=>{c!==this.searchbox.value&&(this.searchbox.value=c)}))}reset(){this.searchbox.value=""}publish(t){let{selection:n,column:r,type:i}=this;ni(n)?n.update({source:this,schema:{type:i},value:t,predicate:t?Eet[i](r,Dr(t)):null}):br(n)&&n.update(t)}query(t=[]){let{from:n,column:r}=this;return n?yt.from(n).select({list:r}).distinct().where(t):null}queryResult(t){return this.data=t,this}update(){let t=document.createElement("datalist"),n=`${this.id}_list`;t.setAttribute("id",n);for(let r of this.data){let i=document.createElement("option");i.setAttribute("value",r.list),t.append(i)}return this.datalist&&this.datalist.remove(),this.element.appendChild(this.datalist=t),this.searchbox.setAttribute("list",n),this}};var Met=0;var Ny=class extends ur{constructor({element:t,filterBy:n,as:r,min:i,max:o,step:s,from:a,column:c,label:l=c,value:u=r?.value,width:f}={}){if(super(n),this.id="slider_"+ ++Met,this.from=a,this.column=c||"value",this.selection=r,this.min=i,this.max=o,this.step=s,this.element=t||document.createElement("div"),this.element.setAttribute("class","input"),this.element.value=this,l){let d=document.createElement("label");d.setAttribute("for",this.id),d.innerText=l,this.element.appendChild(d)}this.slider=document.createElement("input"),this.slider.setAttribute("id",this.id),this.slider.setAttribute("type","range"),f!=null&&(this.slider.style.width=`${+f}px`),i!=null&&this.slider.setAttribute("min",i),o!=null&&this.slider.setAttribute("max",o),s!=null&&this.slider.setAttribute("step",s),u!=null&&(this.slider.setAttribute("value",u),this.selection?.value===void 0&&this.publish(u)),this.element.appendChild(this.slider),this.selection&&(this.slider.addEventListener("input",()=>{this.publish(+this.slider.value)}),ni(this.selection)||this.selection.addEventListener("value",d=>{d!==+this.slider.value&&(this.slider.value=d)}))}query(t=[]){let{from:n,column:r}=this;return!n||this.min!=null&&this.max!=null?null:yt.select({min:ti(r),max:Jr(r)}).from(n).where(t)}queryResult(t){let{min:n,max:r}=Array.from(t)[0];return this.min==null&&this.slider.setAttribute("min",n),this.max==null&&this.slider.setAttribute("max",r),this.step==null&&this.slider.setAttribute("step",(r-n)/500),this}publish(t){let{selection:n,column:r}=this;ni(n)?n.update({source:this,schema:{type:"point"},value:t,predicate:ys(r,Dr(t))}):br(this.selection)&&n.update(t)}};var HA=QA(e=>{let t=yw(e);return n=>n==null?"":typeof n=="number"?t(n):n instanceof Date?ZA(n):`${n}`}),yw=QA(e=>t=>t===0?"0":t.toLocaleString(e)),pqt=HA(),mqt=yw();function ZA(e){return df(e,"Invalid Date")}function QA(e){let t=QA,n;return(r="en")=>r===t?n:n=e(t=r)}var Net=-1;var Ry=class extends ur{constructor({element:t,filterBy:n,from:r,columns:i=["*"],align:o={},format:s,width:a,maxWidth:c,height:l=500,rowBatch:u=100}={}){super(n),this.id=`table-${++Net}`,this.from=r,this.columns=i,this.format=s,this.align=o,this.widths=typeof a=="object"?a:{},this.offset=0,this.limit=+u,this.pending=!1,this.sortHeader=null,this.sortColumn=null,this.sortDesc=!1,this.element=t||document.createElement("div"),this.element.setAttribute("id",this.id),this.element.value=this,typeof a=="number"&&(this.element.style.width=`${a}px`),c&&(this.element.style.maxWidth=`${c}px`),this.element.style.maxHeight=`${l}px`,this.element.style.overflow="auto";let f=-1;this.element.addEventListener("scroll",d=>{let{pending:h,loaded:p}=this,{scrollHeight:m,scrollTop:g,clientHeight:y}=d.target,b=g<f;f=g,!(b||h||p)&&m-g<2*y&&(this.pending=!0,this.requestData(this.offset+this.limit))}),this.tbl=document.createElement("table"),this.element.appendChild(this.tbl),this.head=document.createElement("thead"),this.tbl.appendChild(this.head),this.body=document.createElement("tbody"),this.tbl.appendChild(this.body),this.style=document.createElement("style"),this.element.appendChild(this.style)}requestData(t=0){this.offset=t;let n=this.query(this.filterBy?.predicate(this));this.requestQuery(n),ei().prefetch(n.clone().offset(t+this.limit))}fields(){return this.columns.map(t=>Sa(this.from,t))}fieldInfo(t){this.schema=t;let n=this.head;n.innerHTML="";let r=document.createElement("tr");for(let{column:i}of t){let o=document.createElement("th");o.addEventListener("click",s=>this.sort(s,i)),o.appendChild(document.createElement("span")),o.appendChild(document.createTextNode(i)),r.appendChild(o)}return n.appendChild(r),this.formats=Ret(this.format,t),this.style.innerText=ket(this.id,Oet(this.align,t),Det(this.widths,t)),this}query(t=[]){let{from:n,limit:r,offset:i,schema:o,sortColumn:s,sortDesc:a}=this;return yt.from(n).select(o.map(c=>c.column)).where(t).orderby(s?a?_v(s):s:[]).limit(r).offset(i)}queryResult(t){return this.pending||(this.loaded=!1,this.body.replaceChildren()),this.data=t,this}update(){let{body:t,formats:n,data:r,schema:i,limit:o}=this,s=i.length,a=0;for(let c of r){++a;let l=document.createElement("tr");for(let u=0;u<s;++u){let f=c[i[u].column],d=document.createElement("td");d.innerText=f==null?"":n[u](f),l.appendChild(d)}t.appendChild(l)}return a<o&&(this.loaded=!0),this.pending=!1,this}sort(t,n){n===this.sortColumn?this.sortDesc=!this.sortDesc:(this.sortColumn=n,this.sortDesc=!1);let r=t.currentTarget,i=this.sortHeader;i===r&&t.metaKey?(i.firstChild.textContent="",this.sortHeader=null,this.sortColumn=null):(i&&(i.firstChild.textContent=""),this.sortHeader=r,r.firstChild.textContent=this.sortDesc?"\u25BE":"\u25B4"),this.requestData()}};function Ret(e={},t,n){return t.map(({column:r,type:i})=>{if(r in e)return e[r];switch(i){case"number":return yw(n);case"date":return ZA;default:return HA(n)}})}function Oet(e={},t){return t.map(({column:n,type:r})=>n in e?e[n]:r==="number"?"right":"left")}function Det(e={},t){return t.map(({column:n})=>e[n])}function ket(e,t,n){let r=[];return t.forEach((i,o)=>{let s=+n[o];if(i!=="left"||s){let a=i!=="left"?`text-align:${i};`:"",c=s?`width:${s}px;max-width:${s}px;`:"";r.push(`#${e} tr>:nth-child(${o+1}) {${a}${c}}`)}}),r.join(" ")}function Oy(e,...t){let n=e?.context?.coordinator??ei();for(let r of t)n.connect(r)}function gw(e,t,n){let r=new t(n);return Oy(e,r),r.element}function e$(e){return gw(this,Ay,e)}function n$(e){return gw(this,My,e)}function r$(e){return gw(this,Ny,e)}function i$(e){return gw(this,Ry,e)}function o$({direction:e="vertical",wrap:t=!1},n){let r=document.createElement("div");return r.style.display="flex",r.style.flexDirection=e==="vertical"?"column":"row",r.style.flexWrap=t?t===!0?"wrap":t:"nowrap",r.style.justifyContent="flex-start",r.style.alignItems="flex-start",n.forEach(i=>r.appendChild(i)),r.value={element:r},r}function s$(...e){return o$({direction:"vertical"},e.flat())}function a$(...e){return o$({direction:"horizontal"},e.flat())}function c$({dim:e="width",size:t=10}){let n=document.createElement("span");n.style.display="inline-block",n.style[e]=Number.isNaN(+t)?t:`${t}px`;let r={element:n};return n.value=r,n}function l$(e){return c$({dim:"height",size:e})}function u$(e){return c$({dim:"width",size:e})}var h$={};vr(h$,{align:()=>dM,aspectRatio:()=>hM,axis:()=>pM,colorBase:()=>J6,colorClamp:()=>q6,colorConstant:()=>eN,colorDomain:()=>U6,colorExponent:()=>tN,colorInterpolate:()=>G6,colorLabel:()=>H6,colorN:()=>j6,colorNice:()=>V6,colorPivot:()=>W6,colorRange:()=>z6,colorReverse:()=>Z6,colorScale:()=>$6,colorScheme:()=>Y6,colorSymmetric:()=>X6,colorTickFormat:()=>K6,colorZero:()=>Q6,facetGrid:()=>B3,facetLabel:()=>P3,facetMargin:()=>D3,facetMarginBottom:()=>F3,facetMarginLeft:()=>L3,facetMarginRight:()=>C3,facetMarginTop:()=>k3,fxAlign:()=>G3,fxAriaDescription:()=>u6,fxAriaLabel:()=>l6,fxAxis:()=>Z3,fxDomain:()=>$3,fxFontVariant:()=>c6,fxGrid:()=>r6,fxInset:()=>q3,fxInsetLeft:()=>j3,fxInsetRight:()=>V3,fxLabel:()=>o6,fxLabelAnchor:()=>s6,fxLabelOffset:()=>a6,fxLine:()=>i6,fxNice:()=>z3,fxPadding:()=>W3,fxPaddingInner:()=>X3,fxPaddingOuter:()=>H3,fxRange:()=>U3,fxReverse:()=>f6,fxRound:()=>Y3,fxTickFormat:()=>e6,fxTickPadding:()=>t6,fxTickRotate:()=>n6,fxTickSize:()=>K3,fxTickSpacing:()=>J3,fxTicks:()=>Q3,fyAlign:()=>x6,fyAriaDescription:()=>B6,fyAriaLabel:()=>C6,fyAxis:()=>S6,fyDomain:()=>d6,fyFontVariant:()=>L6,fyGrid:()=>R6,fyInset:()=>m6,fyInsetBottom:()=>g6,fyInsetTop:()=>y6,fyLabel:()=>D6,fyLabelAnchor:()=>k6,fyLabelOffset:()=>F6,fyLine:()=>O6,fyNice:()=>p6,fyPadding:()=>_6,fyPaddingInner:()=>w6,fyPaddingOuter:()=>v6,fyRange:()=>h6,fyReverse:()=>P6,fyRound:()=>b6,fyTickFormat:()=>M6,fyTickPadding:()=>A6,fyTickRotate:()=>N6,fyTickSize:()=>T6,fyTickSpacing:()=>E6,fyTicks:()=>I6,grid:()=>yM,height:()=>aM,inset:()=>mM,label:()=>gM,lengthBase:()=>NN,lengthClamp:()=>EN,lengthConstant:()=>ON,lengthDomain:()=>IN,lengthExponent:()=>RN,lengthNice:()=>AN,lengthRange:()=>TN,lengthScale:()=>SN,lengthZero:()=>MN,margin:()=>rM,marginBottom:()=>fM,marginLeft:()=>cM,marginRight:()=>lM,marginTop:()=>uM,margins:()=>nM,name:()=>tM,opacityBase:()=>fN,opacityClamp:()=>oN,opacityConstant:()=>hN,opacityDomain:()=>rN,opacityExponent:()=>dN,opacityLabel:()=>aN,opacityNice:()=>sN,opacityRange:()=>iN,opacityReverse:()=>cN,opacityScale:()=>nN,opacityTickFormat:()=>uN,opacityZero:()=>lN,padding:()=>bM,projectionClip:()=>qN,projectionDomain:()=>CN,projectionInset:()=>BN,projectionInsetBottom:()=>zN,projectionInsetLeft:()=>PN,projectionInsetRight:()=>$N,projectionInsetTop:()=>UN,projectionParallels:()=>kN,projectionPrecision:()=>FN,projectionRotate:()=>LN,projectionType:()=>DN,rBase:()=>_N,rClamp:()=>gN,rConstant:()=>vN,rDomain:()=>mN,rExponent:()=>wN,rNice:()=>bN,rRange:()=>yN,rScale:()=>pN,rZero:()=>xN,round:()=>xM,style:()=>oM,width:()=>sM,xAlign:()=>NM,xAriaDescription:()=>WM,xAriaLabel:()=>GM,xAxis:()=>kM,xBase:()=>ZM,xClamp:()=>AM,xConstant:()=>KM,xDomain:()=>wM,xExponent:()=>QM,xFontVariant:()=>YM,xGrid:()=>UM,xInset:()=>IM,xInsetLeft:()=>TM,xInsetRight:()=>EM,xLabel:()=>qM,xLabelAnchor:()=>jM,xLabelOffset:()=>VM,xLine:()=>zM,xNice:()=>SM,xPadding:()=>RM,xPaddingInner:()=>OM,xPaddingOuter:()=>DM,xRange:()=>vM,xReverse:()=>XM,xRound:()=>MM,xScale:()=>_M,xTickFormat:()=>PM,xTickPadding:()=>BM,xTickRotate:()=>$M,xTickSize:()=>LM,xTickSpacing:()=>CM,xTicks:()=>FM,xZero:()=>HM,xyDomain:()=>iM,yAlign:()=>c3,yAriaDescription:()=>E3,yAriaLabel:()=>T3,yAxis:()=>d3,yBase:()=>N3,yClamp:()=>s3,yConstant:()=>O3,yDomain:()=>t3,yExponent:()=>R3,yFontVariant:()=>I3,yGrid:()=>x3,yInset:()=>r3,yInsetBottom:()=>o3,yInsetTop:()=>i3,yLabel:()=>w3,yLabelAnchor:()=>v3,yLabelOffset:()=>S3,yLine:()=>_3,yNice:()=>n3,yPadding:()=>l3,yPaddingInner:()=>u3,yPaddingOuter:()=>f3,yRange:()=>e3,yReverse:()=>A3,yRound:()=>a3,yScale:()=>JM,yTickFormat:()=>g3,yTickPadding:()=>y3,yTickRotate:()=>b3,yTickSize:()=>p3,yTickSpacing:()=>m3,yTicks:()=>h3,yZero:()=>M3});var Dy=class extends Map{request(t,n){if(this.has(t))n(this.get(t));else{let r=this.waiting||(this.waiting=new Map),i=r.get(t)||[];r.set(t,i.concat(n))}}set(t,n){this.has(t)&&console.warn(`Overwriting named plot "${t}".`);let{waiting:r}=this;return r?.has(t)&&(r.get(t).forEach(i=>i(n)),r.delete(t)),super.set(t,n)}},KA=new Dy;function JA(e,t,n){(e?.context?.namedPlots??KA).request(t,n)}function f$(e,t,n){(e?.context?.namedPlots??KA).set(t,n)}function tM(e){return t=>f$(this,e,t)}function d$(e,t,n){br(n)?(n.addEventListener("value",r=>{e.setAttribute(t,r),e.update()}),n.value!==void 0&&e.setAttribute(t,n.value)):e.setAttribute(t,n)}function Fet(e,t){return n=>{d$(n,e,t)}}function eM(e){return t=>{for(let[n,r]of Object.entries(e))d$(t,n,r)}}function nM(e){let{top:t,bottom:n,left:r,right:i}=e,o={};return t!==void 0&&(o.marginTop=t),n!==void 0&&(o.marginBottom=n),r!==void 0&&(o.marginLeft=r),i!==void 0&&(o.marginRight=i),eM(o)}function rM(e){return eM({marginTop:e,marginBottom:e,marginLeft:e,marginRight:e})}function iM(e){return eM({xDomain:e,yDomain:e})}var k=e=>t=>Fet(e,t),oM=k("style"),sM=k("width"),aM=k("height"),cM=k("marginLeft"),lM=k("marginRight"),uM=k("marginTop"),fM=k("marginBottom"),dM=k("align"),hM=k("aspectRatio"),pM=k("axis"),mM=k("inset"),yM=k("grid"),gM=k("label"),bM=k("padding"),xM=k("round"),_M=k("xScale"),wM=k("xDomain"),vM=k("xRange"),SM=k("xNice"),IM=k("xInset"),TM=k("xInsetLeft"),EM=k("xInsetRight"),AM=k("xClamp"),MM=k("xRound"),NM=k("xAlign"),RM=k("xPadding"),OM=k("xPaddingInner"),DM=k("xPaddingOuter"),kM=k("xAxis"),FM=k("xTicks"),LM=k("xTickSize"),CM=k("xTickSpacing"),BM=k("xTickPadding"),PM=k("xTickFormat"),$M=k("xTickRotate"),UM=k("xGrid"),zM=k("xLine"),qM=k("xLabel"),jM=k("xLabelAnchor"),VM=k("xLabelOffset"),YM=k("xFontVariant"),GM=k("xAriaLabel"),WM=k("xAriaDescription"),XM=k("xReverse"),HM=k("xZero"),ZM=k("xBase"),QM=k("xExponent"),KM=k("xConstant"),JM=k("yScale"),t3=k("yDomain"),e3=k("yRange"),n3=k("yNice"),r3=k("yInset"),i3=k("yInsetTop"),o3=k("yInsetBottom"),s3=k("yClamp"),a3=k("yRound"),c3=k("yAlign"),l3=k("yPadding"),u3=k("yPaddingInner"),f3=k("yPaddingOuter"),d3=k("yAxis"),h3=k("yTicks"),p3=k("yTickSize"),m3=k("yTickSpacing"),y3=k("yTickPadding"),g3=k("yTickFormat"),b3=k("yTickRotate"),x3=k("yGrid"),_3=k("yLine"),w3=k("yLabel"),v3=k("yLabelAnchor"),S3=k("yLabelOffset"),I3=k("yFontVariant"),T3=k("yAriaLabel"),E3=k("yAriaDescription"),A3=k("yReverse"),M3=k("yZero"),N3=k("yBase"),R3=k("yExponent"),O3=k("yConstant"),D3=k("facetMargin"),k3=k("facetMarginTop"),F3=k("facetMarginBottom"),L3=k("facetMarginLeft"),C3=k("facetMarginRight"),B3=k("facetGrid"),P3=k("facetLabel"),$3=k("fxDomain"),U3=k("fxRange"),z3=k("fxNice"),q3=k("fxInset"),j3=k("fxInsetLeft"),V3=k("fxInsetRight"),Y3=k("fxRound"),G3=k("fxAlign"),W3=k("fxPadding"),X3=k("fxPaddingInner"),H3=k("fxPaddingOuter"),Z3=k("fxAxis"),Q3=k("fxTicks"),K3=k("fxTickSize"),J3=k("fxTickSpacing"),t6=k("fxTickPadding"),e6=k("fxTickFormat"),n6=k("fxTickRotate"),r6=k("fxGrid"),i6=k("fxLine"),o6=k("fxLabel"),s6=k("fxLabelAnchor"),a6=k("fxLabelOffset"),c6=k("fxFontVariant"),l6=k("fxAriaLabel"),u6=k("fxAriaDescription"),f6=k("fxReverse"),d6=k("fyDomain"),h6=k("fyRange"),p6=k("fyNice"),m6=k("fyInset"),y6=k("fyInsetTop"),g6=k("fyInsetBottom"),b6=k("fyRound"),x6=k("fyAlign"),_6=k("fyPadding"),w6=k("fyPaddingInner"),v6=k("fyPaddingOuter"),S6=k("fyAxis"),I6=k("fyTicks"),T6=k("fyTickSize"),E6=k("fyTickSpacing"),A6=k("fyTickPadding"),M6=k("fyTickFormat"),N6=k("fyTickRotate"),R6=k("fyGrid"),O6=k("fyLine"),D6=k("fyLabel"),k6=k("fyLabelAnchor"),F6=k("fyLabelOffset"),L6=k("fyFontVariant"),C6=k("fyAriaLabel"),B6=k("fyAriaDescription"),P6=k("fyReverse"),$6=k("colorScale"),U6=k("colorDomain"),z6=k("colorRange"),q6=k("colorClamp"),j6=k("colorN"),V6=k("colorNice"),Y6=k("colorScheme"),G6=k("colorInterpolate"),W6=k("colorPivot"),X6=k("colorSymmetric"),H6=k("colorLabel"),Z6=k("colorReverse"),Q6=k("colorZero"),K6=k("colorTickFormat"),J6=k("colorBase"),tN=k("colorExponent"),eN=k("colorConstant"),nN=k("opacityScale"),rN=k("opacityDomain"),iN=k("opacityRange"),oN=k("opacityClamp"),sN=k("opacityNice"),aN=k("opacityLabel"),cN=k("opacityReverse"),lN=k("opacityZero"),uN=k("opacityTickFormat"),fN=k("opacityBase"),dN=k("opacityExponent"),hN=k("opacityConstant"),pN=k("rScale"),mN=k("rDomain"),yN=k("rRange"),gN=k("rClamp"),bN=k("rNice"),xN=k("rZero"),_N=k("rBase"),wN=k("rExponent"),vN=k("rConstant"),SN=k("lengthScale"),IN=k("lengthDomain"),TN=k("lengthRange"),EN=k("lengthClamp"),AN=k("lengthNice"),MN=k("lengthZero"),NN=k("lengthBase"),RN=k("lengthExponent"),ON=k("lengthConstant"),DN=k("projectionType"),kN=k("projectionParallels"),FN=k("projectionPrecision"),LN=k("projectionRotate"),CN=k("projectionDomain"),BN=k("projectionInset"),PN=k("projectionInsetLeft"),$N=k("projectionInsetRight"),UN=k("projectionInsetTop"),zN=k("projectionInsetBottom"),qN=k("projectionClip");function p$(e,t){return{table:e,options:t}}var m$={};vr(m$,{area:()=>VN,areaX:()=>YN,areaY:()=>GN,arrow:()=>B4,axisFx:()=>q4,axisFy:()=>j4,axisX:()=>U4,axisY:()=>z4,barX:()=>ZN,barY:()=>QN,cell:()=>KN,cellX:()=>JN,cellY:()=>t4,circle:()=>a4,contour:()=>T4,delaunayLink:()=>F4,delaunayMesh:()=>L4,denseLine:()=>I4,density:()=>S4,densityX:()=>w4,densityY:()=>v4,dot:()=>i4,dotX:()=>o4,dotY:()=>s4,frame:()=>$4,geo:()=>X4,graticule:()=>Z4,gridFx:()=>G4,gridFy:()=>W4,gridX:()=>V4,gridY:()=>Y4,heatmap:()=>E4,hexagon:()=>c4,hexbin:()=>N4,hexgrid:()=>R4,hull:()=>C4,image:()=>_4,line:()=>WN,lineX:()=>XN,lineY:()=>HN,link:()=>P4,raster:()=>A4,rasterTile:()=>M4,rect:()=>e4,rectX:()=>n4,rectY:()=>r4,regressionY:()=>O4,ruleX:()=>d4,ruleY:()=>h4,sphere:()=>H4,spike:()=>x4,text:()=>l4,textX:()=>u4,textY:()=>f4,tickX:()=>p4,tickY:()=>m4,vector:()=>y4,vectorX:()=>g4,vectorY:()=>b4,voronoi:()=>D4,voronoiMesh:()=>k4});var Let=new Set(["frame","axisX","axisY","axisFx","axisFy","gridX","gridY","gridFx","gridFy","hexgrid","graticule","sphere"]);function St(e,t,n={}){arguments.length===2&&!Array.isArray(t)&&(n=t,t=Let.has(e)?null:[{}]);let r=e.startsWith("area")||e.startsWith("line")?fy:Dn;return jN(r,e,t,n)}function jN(e,t,n,r){return i=>{i.addMark(new e(t,n,r))}}function ia(e,t,n){return r=>{r.addMark(new e(t,n))}}var VN=(...e)=>St("area",...e),YN=(...e)=>St("areaX",...e),GN=(...e)=>St("areaY",...e),WN=(...e)=>St("line",...e),XN=(...e)=>St("lineX",...e),HN=(...e)=>St("lineY",...e),ZN=(...e)=>St("barX",...e),QN=(...e)=>St("barY",...e),KN=(...e)=>St("cell",...e),JN=(...e)=>St("cellX",...e),t4=(...e)=>St("cellY",...e),e4=(...e)=>St("rect",...e),n4=(...e)=>St("rectX",...e),r4=(...e)=>St("rectY",...e),i4=(...e)=>St("dot",...e),o4=(...e)=>St("dotX",...e),s4=(...e)=>St("dotY",...e),a4=(...e)=>St("circle",...e),c4=(...e)=>St("hexagon",...e),l4=(...e)=>St("text",...e),u4=(...e)=>St("textX",...e),f4=(...e)=>St("textY",...e),d4=(...e)=>St("ruleX",...e),h4=(...e)=>St("ruleY",...e),p4=(...e)=>St("tickX",...e),m4=(...e)=>St("tickY",...e),y4=(...e)=>St("vector",...e),g4=(...e)=>St("vectoX",...e),b4=(...e)=>St("vectorY",...e),x4=(...e)=>St("spike",...e),_4=(...e)=>St("image",...e),w4=(...e)=>jN(fd,"areaX",...e),v4=(...e)=>jN(fd,"areaY",...e),S4=(...e)=>ia(gy,...e),I4=(...e)=>ia(yy,...e),T4=(...e)=>ia(py,...e),E4=(...e)=>ia(my,...e),A4=(...e)=>ia(yc,...e),M4=(...e)=>ia(_y,...e),N4=(...e)=>ia(xy,...e),R4=(...e)=>St("hexgrid",...e),O4=(...e)=>ia(wy,...e),D4=(...e)=>St("voronoi",...e),k4=(...e)=>St("voronoiMesh",...e),F4=(...e)=>St("delaunayLink",...e),L4=(...e)=>St("delaunayMesh",...e),C4=(...e)=>St("hull",...e),B4=(...e)=>St("arrow",...e),P4=(...e)=>St("link",...e),$4=(...e)=>St("frame",...e),U4=(...e)=>St("axisX",...e),z4=(...e)=>St("axisY",...e),q4=(...e)=>St("axisFx",...e),j4=(...e)=>St("axisFy",...e),V4=(...e)=>St("gridX",...e),Y4=(...e)=>St("gridY",...e),G4=(...e)=>St("gridFx",...e),W4=(...e)=>St("gridFy",...e),X4=(...e)=>ia(by,...e),H4=(...e)=>St("sphere",...e),Z4=(...e)=>St("graticule",...e);var y$={};vr(y$,{highlight:()=>Q4,intervalX:()=>rR,intervalXY:()=>oR,intervalY:()=>iR,nearestX:()=>eR,nearestY:()=>nR,pan:()=>sR,panX:()=>aR,panY:()=>cR,panZoom:()=>lR,panZoomX:()=>uR,panZoomY:()=>fR,toggle:()=>gd,toggleColor:()=>tR,toggleX:()=>K4,toggleY:()=>J4});function gc(e,t){return n=>{let r=n.marks[n.marks.length-1];n.addInteractor(new e(r,t))}}function Q4({by:e,...t}){return gc(vy,{selection:e,channels:t})}function gd({as:e,...t}){return gc(ql,{...t,selection:e})}function K4(e){return gd({...e,channels:["x"]})}function J4(e){return gd({...e,channels:["y"]})}function tR(e){return gd({...e,channels:["color"]})}function eR({as:e,...t}){return gc(md,{...t,selection:e,channel:"x"})}function nR({as:e,...t}){return gc(md,{...t,selection:e,channel:"y"})}function rR({as:e,...t}){return gc(pd,{...t,selection:e,channel:"x"})}function iR({as:e,...t}){return gc(pd,{...t,selection:e,channel:"y"})}function oR({as:e,...t}){return gc(Ty,{...t,selection:e})}function bd(e){return gc(Ey,e)}function sR(e={}){return bd({...e,zoom:!1})}function aR(e={}){return bd({...e,zoom:!1,pany:!1})}function cR(e={}){return bd({...e,zoom:!1,panx:!1})}function lR(e={}){return bd(e)}function uR(e={}){return bd({...e,pany:!1})}function fR(e={}){return bd({...e,panx:!1})}var g$={};vr(g$,{colorLegend:()=>hR,opacityLegend:()=>pR,symbolLegend:()=>mR});function dR(e,t={}){if(t.for){let{for:n,...r}=t,i=new yd(e,r),o=typeof n,s=a=>a.addLegend(i,!1);return o==="string"?JA(this,n,s):n.value&&s(n.value),i.element}else return n=>n.addLegend(new yd(e,t))}function hR(e){return dR.call(this,"color",e)}function pR(e){return dR.call(this,"opacity",e)}function mR(e){return dR.call(this,"symbol",e)}function b$(...e){let t=new uy;return e.flat().forEach(n=>n(t)),Oy(this,...t.marks),t.element}function Cet({coordinator:e=ei(),namedPlots:t=new Dy,extensions:n=null,...r}={}){return{...yR,...n,context:{coordinator:e,namedPlots:t,...r}}}export{Nh as Coordinator,co as Fixed,ur as MosaicClient,Aa as Param,yt as Query,xs as Selection,zv as agg,dM as align,Xn as and,VN as area,YN as areaX,GN as areaY,yu as argmax,mu as argmin,d2 as arrayAgg,B4 as arrow,hM as aspectRatio,h$ as attributeDirectives,qv as avg,pM as axis,q4 as axisFx,j4 as axisFy,U4 as axisX,z4 as axisY,ZN as barX,QN as barY,mw as bin,Th as cast,gu as castDouble,h2 as castInteger,KN as cell,JN as cellX,t4 as cellY,Ah as centroid,b2 as centroidX,x2 as centroidY,a4 as circle,J6 as colorBase,q6 as colorClamp,eN as colorConstant,U6 as colorDomain,tN as colorExponent,G6 as colorInterpolate,H6 as colorLabel,hR as colorLegend,j6 as colorN,V6 as colorNice,W6 as colorPivot,z6 as colorRange,Z6 as colorReverse,$6 as colorScale,Y6 as colorScheme,X6 as colorSymmetric,K6 as colorTickFormat,Q6 as colorZero,Sa as column,Oy as connect,T4 as contour,ei as coordinator,e2 as corr,kr as count,n2 as covarPop,Ea as create,Cet as createAPIContext,kv as cume_dist,g2 as dateDay,m2 as dateMonth,y2 as dateMonthDay,F4 as delaunayLink,L4 as delaunayMesh,I4 as denseLine,Ov as dense_rank,S4 as density,w4 as densityX,v4 as densityY,i4 as dot,o4 as dotX,s4 as dotY,Kv as entropy,ys as eq,B3 as facetGrid,P3 as facetLabel,D3 as facetMargin,F3 as facetMarginBottom,L3 as facetMarginLeft,C3 as facetMarginRight,k3 as facetMarginTop,l2 as first,Bv as first_value,$4 as frame,p$ as from,G3 as fxAlign,u6 as fxAriaDescription,l6 as fxAriaLabel,Z3 as fxAxis,$3 as fxDomain,c6 as fxFontVariant,r6 as fxGrid,q3 as fxInset,j3 as fxInsetLeft,V3 as fxInsetRight,o6 as fxLabel,s6 as fxLabelAnchor,a6 as fxLabelOffset,i6 as fxLine,z3 as fxNice,W3 as fxPadding,X3 as fxPaddingInner,H3 as fxPaddingOuter,U3 as fxRange,f6 as fxReverse,Y3 as fxRound,e6 as fxTickFormat,t6 as fxTickPadding,n6 as fxTickRotate,K3 as fxTickSize,J3 as fxTickSpacing,Q3 as fxTicks,x6 as fyAlign,B6 as fyAriaDescription,C6 as fyAriaLabel,S6 as fyAxis,d6 as fyDomain,L6 as fyFontVariant,R6 as fyGrid,m6 as fyInset,g6 as fyInsetBottom,y6 as fyInsetTop,D6 as fyLabel,k6 as fyLabelAnchor,F6 as fyLabelOffset,O6 as fyLine,p6 as fyNice,_6 as fyPadding,w6 as fyPaddingInner,v6 as fyPaddingOuter,h6 as fyRange,P6 as fyReverse,b6 as fyRound,M6 as fyTickFormat,A6 as fyTickPadding,N6 as fyTickRotate,T6 as fyTickSize,E6 as fyTickSpacing,I6 as fyTicks,X4 as geo,Eh as geojson,Z4 as graticule,yM as grid,G4 as gridFx,W4 as gridFy,V4 as gridX,Y4 as gridY,vh as gt,vv as gte,a$ as hconcat,E4 as heatmap,aM as height,c4 as hexagon,N4 as hexbin,R4 as hexgrid,Q4 as highlight,u$ as hspace,C4 as hull,_4 as image,mM as inset,y$ as interactorDirectives,rR as intervalX,oR as intervalXY,iR as intervalY,Te as isBetween,Sv as isDistinct,Iv as isNotBetween,Sh as isNotDistinct,ms as isNotNull,$c as isNull,Qv as kurtosis,gM as label,Lv as lag,u2 as last,Pv as last_value,Cv as lead,g$ as legendDirectives,NN as lengthBase,EN as lengthClamp,ON as lengthConstant,IN as lengthDomain,RN as lengthExponent,AN as lengthNice,TN as lengthRange,SN as lengthScale,MN as lengthZero,WN as line,XN as lineX,HN as lineY,P4 as link,Dr as literal,v2 as loadCSV,_2 as loadExtension,S2 as loadJSON,E2 as loadObjects,I2 as loadParquet,T2 as loadSpatial,gs as lt,bs as lte,jv as mad,rM as margin,fM as marginBottom,cM as marginLeft,lM as marginRight,uM as marginTop,nM as margins,m$ as markDirectives,Jr as max,Yv as median,e$ as menu,ti as min,Wv as mode,tM as name,KA as namedPlots,eR as nearestX,nR as nearestY,Uc as neq,wv as not,$v as nth_value,Fv as ntile,fN as opacityBase,oN as opacityClamp,hN as opacityConstant,rN as opacityDomain,dN as opacityExponent,aN as opacityLabel,pR as opacityLegend,sN as opacityNice,iN as opacityRange,cN as opacityReverse,nN as opacityScale,uN as opacityTickFormat,lN as opacityZero,Pc as or,bM as padding,sR as pan,aR as panX,cR as panY,lR as panZoom,uR as panZoomX,fR as panZoomY,Dv as percent_rank,b$ as plot,Vv as product,qN as projectionClip,CN as projectionDomain,BN as projectionInset,zN as projectionInsetBottom,PN as projectionInsetLeft,$N as projectionInsetRight,UN as projectionInsetTop,kN as projectionParallels,FN as projectionPrecision,LN as projectionRotate,DN as projectionType,Gv as quantile,_N as rBase,gN as rClamp,vN as rConstant,mN as rDomain,wN as rExponent,bN as rNice,yN as rRange,pN as rScale,xN as rZero,Rv as rank,A4 as raster,M4 as rasterTile,e4 as rect,n4 as rectX,r4 as rectY,O4 as regressionY,JA as requestNamedPlot,BD as restConnector,xM as round,Nv as row_number,d4 as ruleX,h4 as ruleY,n$ as search,Zv as skewness,r$ as slider,l0 as socketConnector,H4 as sphere,x4 as spike,j as sql,Hv as stddev,t2 as stddevPop,f2 as stringAgg,oM as style,Fr as sum,mR as symbolLegend,i$ as table,l4 as text,u4 as textX,f4 as textY,p4 as tickX,m4 as tickY,gd as toggle,tR as toggleColor,K4 as toggleX,J4 as toggleY,Jv as varPop,Xv as variance,s$ as vconcat,y4 as vector,g4 as vectorX,b4 as vectorY,D4 as voronoi,k4 as voronoiMesh,l$ as vspace,YD as wasmConnector,sM as width,NM as xAlign,WM as xAriaDescription,GM as xAriaLabel,kM as xAxis,ZM as xBase,AM as xClamp,KM as xConstant,wM as xDomain,QM as xExponent,YM as xFontVariant,UM as xGrid,IM as xInset,TM as xInsetLeft,EM as xInsetRight,qM as xLabel,jM as xLabelAnchor,VM as xLabelOffset,zM as xLine,SM as xNice,RM as xPadding,OM as xPaddingInner,DM as xPaddingOuter,vM as xRange,XM as xReverse,MM as xRound,_M as xScale,PM as xTickFormat,BM as xTickPadding,$M as xTickRotate,LM as xTickSize,CM as xTickSpacing,FM as xTicks,HM as xZero,iM as xyDomain,c3 as yAlign,E3 as yAriaDescription,T3 as yAriaLabel,d3 as yAxis,N3 as yBase,s3 as yClamp,O3 as yConstant,t3 as yDomain,R3 as yExponent,I3 as yFontVariant,x3 as yGrid,r3 as yInset,o3 as yInsetBottom,i3 as yInsetTop,w3 as yLabel,v3 as yLabelAnchor,S3 as yLabelOffset,_3 as yLine,n3 as yNice,l3 as yPadding,u3 as yPaddingInner,f3 as yPaddingOuter,e3 as yRange,A3 as yReverse,a3 as yRound,JM as yScale,g3 as yTickFormat,y3 as yTickPadding,b3 as yTickRotate,p3 as yTickSize,m3 as yTickSpacing,h3 as yTicks,M3 as yZero};
|
|
78
|
+
}`)).call(Fp,r);for(let k of l){let{channels:$,values:z,facets:V}=y.get(k);if(p===void 0||k.facet==="super"){let Q=null;if(V&&(Q=V[0],Q=k.filter(Q,$,z),Q.length===0))continue;let nt=k.render(Q,b,z,w,I);if(nt==null)continue;A.appendChild(nt)}else{let Q;for(let nt of p){if(!(k.facetAnchor?.(p,O,nt)??!nt.empty))continue;let st=null;if(V){let X=f.has(k);if(st=V[X?nt.i:0],st=k.filter(st,$,z),st.length===0)continue;!X&&st===V[0]&&(st=rl(st)),st.fx=nt.x,st.fy=nt.y,st.fi=nt.i}let ut=k.render(st,b,z,v,I);if(ut!=null){(Q??=ae(A).append("g")).append(()=>ut).datum(nt);for(let X of["aria-label","aria-description","aria-hidden","transform"])ut.hasAttribute(X)&&(Q.attr(X,ut.getAttribute(X)),ut.removeAttribute(X))}}Q?.selectChildren().attr("transform",R)}}let E=Cq(g,I,e),{figure:C=n!=null||i!=null||o!=null||E.length>0}=e;C&&(B=D.createElement("figure"),B.className=`${c}-figure`,B.style.maxWidth="initial",n!=null&&B.append(zq(D,n,"h2")),i!=null&&B.append(zq(D,i,"h3")),B.append(...E,A),o!=null&&B.append(Zct(D,o))),B.scale=kj(b.scales),B.legend=Rq(g,I,e);let U=zV();return U>0&&ae(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(`${U.toLocaleString("en-US")} warning${U===1?"":"s"}. Please check the console.`),B}function zq(e,t,r){if(t.ownerDocument)return t;let n=e.createElement(r);return n.append(t),n}function Zct(e,t){let r=e.createElement("figcaption");return r.append(t),r}function Kct({marks:e=[],...t}={}){return Vb({...t,marks:[...e,this]})}Ft.prototype.plot=Kct;function Vq(e){return e.flat(1/0).filter(t=>t!=null).map(Qct)}function Qct(e){return typeof e.render=="function"?e:new B3(e)}var B3=class extends Ft{constructor(t){if(typeof t!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}};function O3(e,t){for(let r in e)Wq(e[r],t);return e}function Wq(e,t){let{scale:r,transform:n=!0}=e;if(r==null||!n)return;let{type:i,percent:o,interval:s,transform:a=o?c=>c*100:FN(s,i)}=t[r]??{};a!=null&&(e.value=fe(e.value,a),e.transform=!1)}function Jct(e){for(let t in e)GN(t,e[t])}function zb(e,t,r,n=cV){for(let{channels:i}of t.values())for(let o in i){let s=i[o],{scale:a}=s;if(a!=null&&n(a))if(a==="projection"){if(!XV(r)){let c=r.x?.domain===void 0,l=r.y?.domain===void 0;if(c||l){let[u,f]=ZV(s);c&&D3(e,"x",u),l&&D3(e,"y",f)}}}else D3(e,a,s)}return e}function D3(e,t,r){let n=e.get(t);n!==void 0?n.push(r):e.set(t,[r])}function tlt(e,t){if(e==null)return;let{x:r,y:n}=e;if(r==null&&n==null)return;let i=Sr(e.data);if(i==null)throw new Error("missing facet data");let o={};r!=null&&(o.fx=Bp(i,{value:r,scale:"fx"})),n!=null&&(o.fy=Bp(i,{value:n,scale:"fy"})),O3(o,t);let s=jI(i,o);return{channels:o,groups:s,data:e.data}}function jq(e,t,r){if(e.facet===null||e.facet==="super")return;let{fx:n,fy:i}=e;if(n!=null||i!=null){let c=Sr(e.data??n??i);if(c===void 0)throw new Error(`missing facet data in ${e.ariaLabel}`);if(c===null)return;let l={};return n!=null&&(l.fx=Bp(c,{value:n,scale:"fx"})),i!=null&&(l.fy=Bp(c,{value:i,scale:"fy"})),O3(l,r),{channels:l,groups:jI(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)&&Sr(e.data)?.length===a.length&&kn(`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 elt(e,t={}){return Qe({...t,x:null,y:null},(r,n,i,o,s,a)=>a.getMarkState(e))}function rlt(e){let t=[];for(let r of e){let n=r.tip;if(n){n===!0?n={}:typeof n=="string"&&(n={pointer:n});let{pointer:i,preferredAnchor:o}=n;i=/^x$/i.test(i)?Vp:/^y$/i.test(i)?dd:zp,n=i(elt(r,n)),n.title=null,o===void 0&&(n.preferredAnchor=i===dd?"left":"bottom");let s=hT(r.data,n);s.facet=r.facet,s.facetAnchor=r.facetAnchor,t.push(s)}}return t}function nlt(e,t,r){let{projection:n,x:i={},y:o={},fx:s={},fy:a={},axis:c,grid:l,facet:u={},facet:{axis:f=c,grid:d}=u,x:{axis:h=c,grid:p=h===null?null:l}=i,y:{axis:y=c,grid:g=y===null?null:l}=o,fx:{axis:m=f,grid:b=m===null?null:d}=s,fy:{axis:x=f,grid:_=x===null?null:d}=a}=r;(n||!ya(i)&&!qq("x",e))&&(h=p=null),(n||!ya(o)&&!qq("y",e))&&(y=g=null),t.has("fx")||(m=b=null),t.has("fy")||(x=_=null),h===void 0&&(h=!yT(e,"x")),y===void 0&&(y=!yT(e,"y")),m===void 0&&(m=!yT(e,"fx")),x===void 0&&(x=!yT(e,"fy")),h===!0&&(h="bottom"),y===!0&&(y="left"),m===!0&&(m=h==="top"||h===null?"bottom":"top"),x===!0&&(x=y==="right"||y===null?"left":"right");let v=[];return mT(v,_,cT,a),pT(v,x,oT,"right","left",u,a),mT(v,b,uT,s),pT(v,m,sT,"top","bottom",u,s),mT(v,g,aT,o),pT(v,y,kb,"left","right",r,o),mT(v,p,lT,i),pT(v,h,Cb,"bottom","top",r,i),v}function pT(e,t,r,n,i,o,s){if(!t)return;let a=ilt(t);s=olt(a?n:t,o,s);let{line:c}=s;(r===kb||r===Cb)&&c&&!ol(c)&&e.push(Wp(slt(s))),e.push(r(s)),a&&e.push(r({...s,anchor:i,label:null}))}function mT(e,t,r,n){!t||ol(t)||e.push(r(alt(t,n)))}function ilt(e){return/^\s*both\s*$/i.test(e)}function olt(e,t,{line:r=t.line,ticks:n,tickSize:i,tickSpacing:o,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:l,ariaLabel:u,ariaDescription:f,label:d=t.label,labelAnchor:h,labelArrow:p=t.labelArrow,labelOffset:y}){return{anchor:e,line:r,ticks:n,tickSize:i,tickSpacing:o,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:l,ariaLabel:u,ariaDescription:f,label:d,labelAnchor:h,labelArrow:p,labelOffset:y}}function slt(e){let{anchor:t,line:r}=e;return{anchor:t,facetAnchor:t+"-empty",stroke:r===!0?void 0:r}}function alt(e,{stroke:t=wu(e)?e:void 0,ticks:r=clt(e)?e:void 0,tickSpacing:n,ariaLabel:i,ariaDescription:o}){return{stroke:t,ticks:r,tickSpacing:n,ariaLabel:i,ariaDescription:o}}function clt(e){switch(typeof e){case"number":return!0;case"string":return!wu(e)}return oi(e)||typeof e?.range=="function"}function yT(e,t){let r=`${t}-axis `;return e.some(n=>n.ariaLabel?.startsWith(r))}function qq(e,t){for(let r of t)for(let n in r.channels){let{scale:i}=r.channels[n];if(i===e||i==="projection")return!0}return!1}function llt(e,t){for(let r in e){let n=e[r],i=t[r];n.label===void 0&&i&&(n.label=i.label)}return e}function ult({fx:e,fy:t},r){let{marginTop:n,marginRight:i,marginBottom:o,marginLeft:s,width:a,height:c}=$I(r),l=e&&Yq(e),u=t&&Yq(t);return{marginTop:t?u[0]:n,marginRight:e?a-l[1]:i,marginBottom:t?c-u[1]:o,marginLeft:e?l[0]:s,inset:{marginTop:r.marginTop,marginRight:r.marginRight,marginBottom:r.marginBottom,marginLeft:r.marginLeft},width:a,height:c}}function Yq(e){let t=e.domain(),r=e(t[0]),n=e(t[t.length-1]);return n<r&&([r,n]=[n,r]),[r,n+e.bandwidth()]}var flt=new Map([["basis",JO],["basis-closed",tN],["basis-open",eN],["bundle",rN],["bump-x",XO],["bump-y",HO],["cardinal",nN],["cardinal-closed",iN],["cardinal-open",oN],["catmull-rom",sN],["catmull-rom-closed",aN],["catmull-rom-open",cN],["linear",Kc],["linear-closed",lN],["monotone-x",fN],["monotone-y",dN],["natural",hN],["step",pN],["step-after",yN],["step-before",mN]]);function jb(e=Kc,t){if(typeof e=="function")return e;let r=flt.get(`${e}`.toLowerCase());if(!r)throw new Error(`unknown curve: ${e}`);if(t!==void 0){if("beta"in r)return r.beta(t);if("tension"in r)return r.tension(t);if("alpha"in r)return r.alpha(t)}return r}function gT(e=Bu,t){return typeof e!="function"&&`${e}`.toLowerCase()==="auto"?Bu:jb(e,t)}function Bu(e){return Kc(e)}function Sa(e={y:"count"},t={}){[e,t]=F3(e,t);let{x:r,y:n}=t;return N3(bT(r,t,K),null,null,n,e,hd(t))}function Ia(e={x:"count"},t={}){[e,t]=F3(e,t);let{x:r,y:n}=t;return N3(null,bT(n,t,K),r,null,e,pd(t))}function fl(e={fill:"count"},t={}){[e,t]=F3(e,t);let{x:r,y:n}=dlt(t);return N3(r,n,null,null,e,hd(pd(t)))}function Hq(e,t,r={}){if(r?.interval==null)return r;let{reduce:n=EI}=r,i={filter:null};return r[t]!=null&&(i[t]=n),r[`${t}1`]!=null&&(i[`${t}1`]=n),r[`${t}2`]!=null&&(i[`${t}2`]=n),e(i,r)}function Gp(e={}){return Hq(Sa,"y",xs(e,"x"))}function Xp(e={}){return Hq(Ia,"x",xs(e,"y"))}function N3(e,t,r,n,{data:i=MI,filter:o=Ib,sort:s,reverse:a,...c}={},l={}){e=Gq(e),t=Gq(t),c=hlt(c,l),i=Qq(i,K),s=s==null?void 0:Zq("sort",s,l),o=o==null?void 0:Kq("filter",o,l),r!=null&&_a(c,"x","x1","x2")&&(r=null),n!=null&&_a(c,"y","y1","y2")&&(n=null);let[u,f]=wn(e),[d,h]=wn(e),[p,y]=wn(t),[g,m]=wn(t),[b,x]=r!=null?[r,"x"]:n!=null?[n,"y"]:[],[_,v]=wn(b),{x:w,y:I,z:D,fill:A,stroke:B,x1:M,x2:O,y1:R,y2:S,domain:T,cumulative:E,thresholds:C,interval:U,...k}=l,[$,z]=wn(D),[V]=cr(A),[Q]=cr(B),[nt,st]=wn(V),[ut,X]=wn(Q);return{..."z"in l&&{z:$||D},..."fill"in l&&{fill:nt||A},..."stroke"in l&&{stroke:ut||B},...en(k,(at,q,J)=>{let ct=ad(Tt(at,b),J?.[x]),j=Tt(at,D),Qt=Tt(at,V),gt=Tt(at,Q),he=Mb(c,{z:j,fill:Qt,stroke:gt}),pe=[],ot=[],Me=ct&&v([]),Ti=j&&z([]),vs=Qt&&st([]),HG=gt&&X([]),Q8=e&&f([]),ZG=e&&h([]),J8=t&&y([]),KG=t&&m([]),QG=ylt(e,t,at),JG=0;for(let Ed of c)Ed.initialize(at);s&&s.initialize(at),o&&o.initialize(at);for(let Ed of q){let tk=[];for(let Im of c)Im.scope("facet",Ed);s&&s.scope("facet",Ed),o&&o.scope("facet",Ed);for(let[Im,tX]of vu(Ed,he))for(let[eX,$x]of vu(tX,ct))for(let[Ss,zu]of QG($x))if(!(o&&!o.reduce(Ss,zu))){tk.push(JG++),ot.push(i.reduceIndex(Ss,at,zu)),ct&&Me.push(eX),j&&Ti.push(he===j?Im:j[(Ss.length>0?Ss:$x)[0]]),Qt&&vs.push(he===Qt?Im:Qt[(Ss.length>0?Ss:$x)[0]]),gt&&HG.push(he===gt?Im:gt[(Ss.length>0?Ss:$x)[0]]),Q8&&(Q8.push(zu.x1),ZG.push(zu.x2)),J8&&(J8.push(zu.y1),KG.push(zu.y2));for(let rX of c)rX.reduce(Ss,zu);s&&s.reduce(Ss)}pe.push(tk)}return YN(pe,s,a),{data:ot,facets:pe}}),...!_a(c,"x")&&(u?{x1:u,x2:d,x:Tp(u,d)}:{x:w,x1:M,x2:O}),...!_a(c,"y")&&(p?{y1:p,y2:g,y:Tp(p,g)}:{y:I,y1:R,y2:S}),..._&&{[x]:_},...Object.fromEntries(c.map(({name:at,output:q})=>[at,q]))}}function F3({cumulative:e,domain:t,thresholds:r,interval:n,...i},o){return[i,{cumulative:e,domain:t,thresholds:r,interval:n,...o}]}function bT(e,{cumulative:t,domain:r,thresholds:n,interval:i},o){return e={...Mo(e)},e.domain===void 0&&(e.domain=r),e.cumulative===void 0&&(e.cumulative=t),e.thresholds===void 0&&(e.thresholds=n),e.interval===void 0&&(e.interval=i),e.value===void 0&&(e.value=o),e.thresholds=L3(e.thresholds,e.interval),e}function dlt(e){let{x:t,y:r}=e;return t=bT(t,e),r=bT(r,e),[t.value,r.value]=gr(t.value,r.value),{x:t,y:r}}function Gq(e){if(e==null)return;let{value:t,cumulative:r,domain:n=Be,thresholds:i}=e,o=s=>{let a=Tt(s,t),c;if(lr(a)||mlt(i)){a=fe(a,EN,Float64Array);let[u,f]=typeof n=="function"?n(a):n,d=typeof i=="function"&&!_u(i)?i(a,u,f):i;typeof d=="number"&&(d=W0(u,f,d)),_u(d)&&(n===Be&&(u=d.floor(u),f=d.offset(d.floor(f))),d=d.range(u,d.offset(f))),c=d}else{a=Cr(a);let[u,f]=typeof n=="function"?n(a):n,d=typeof i=="function"&&!_u(i)?i(a,u,f):i;if(typeof d=="number")if(n===Be){let h=Fc(u,f,d);if(isFinite(h))if(h>0){let p=Math.round(u/h),y=Math.round(f/h);p*h<=u||--p,y*h>f||++y;let g=y-p+1;d=new Float64Array(g);for(let m=0;m<g;++m)d[m]=(p+m)*h}else if(h<0){h=-h;let p=Math.round(u*h),y=Math.round(f*h);p/h<=u||--p,y/h>f||++y;let g=y-p+1;d=new Float64Array(g);for(let m=0;m<g;++m)d[m]=(p+m)/h}else d=[u];else d=[u]}else d=yn(u,f,d);else _u(d)&&(n===Be&&(u=d.floor(u),f=d.offset(d.floor(f))),d=d.range(u,d.offset(f)));c=d}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=(r<0?blt:r>0?glt:R3)(l,c,a),l};return o.label=vn(t),o}function L3(e,t,r=Xq){if(e===void 0)return t===void 0?r:ba(t);if(typeof e=="string"){switch(e.toLowerCase()){case"freedman-diaconis":return uv;case"scott":return zg;case"sturges":return Ql;case"auto":return Xq}return _b(e)}return e}function hlt(e,t){return jN(e,t,Zq)}function Zq(e,t,r){return TI(e,t,r,Kq)}function Kq(e,t,r){return AI(e,t,r,Qq)}function Qq(e,t){return Dp(e,t,plt)}function plt(e){switch(`${e}`.toLowerCase()){case"x":return xlt;case"x1":return wlt;case"x2":return vlt;case"y":return _lt;case"y1":return Slt;case"y2":return Ilt}throw new Error(`invalid bin reduce: ${e}`)}function Xq(e,t,r){return Math.min(200,zg(e,t,r))}function mlt(e){return dV(e)||oi(e)&&lr(e)}function ylt(e,t,r){let n=e?.(r),i=t?.(r);return n&&i?function*(o){let s=n.bin(o);for(let[a,[c,l]]of n.entries()){let u=i.bin(s[a]);for(let[f,[d,h]]of i.entries())yield[u[f],{data:r,x1:c,y1:d,x2:l,y2:h}]}}:n?function*(o){let s=n.bin(o);for(let[a,[c,l]]of n.entries())yield[s[a],{data:r,x1:c,x2:l}]}:function*(o){let s=i.bin(o);for(let[a,[c,l]]of i.entries())yield[s[a],{data:r,y1:c,y2:l}]}}function R3(e,t,r){return t=Cr(t),n=>{let i=e.map(()=>[]);for(let o of n)i[Nc(t,r[o])-1]?.push(o);return i}}function glt(e,t,r){let n=R3(e,t,r);return i=>{let o=n(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 blt(e,t,r){let n=R3(e,t,r);return i=>{let o=n(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 Jq(e,t){let r=(+e+ +t)/2;return e instanceof Date?new Date(r):r}var xlt={reduceIndex(e,t,{x1:r,x2:n}){return Jq(r,n)}},_lt={reduceIndex(e,t,{y1:r,y2:n}){return Jq(r,n)}},wlt={reduceIndex(e,t,{x1:r}){return r}},vlt={reduceIndex(e,t,{x2:r}){return r}},Slt={reduceIndex(e,t,{y1:r}){return r}},Ilt={reduceIndex(e,t,{y2:r}){return r}};function Hp(e={}){return BN(e)?e:{...e,x:K}}function Zp(e={}){return ON(e)?e:{...e,y:K}}function tY(e,t){if(t.length===1)return{data:e,facets:t};let r=e.length,n=new Uint8Array(r),i=0;for(let a of t)for(let c of a)n[c]&&++i,n[c]=1;if(i===0)return{data:e,facets:t};e=xu(e);let o=e[TN]=new Uint32Array(r+i);t=t.map(a=>xu(a,Uint32Array));let s=r;n.fill(0);for(let a of t)for(let c=0,l=a.length;c<l;++c){let u=a[c];n[u]?(a[c]=s,e[s]=e[u],o[s]=u,++s):o[u]=u,n[u]=1}return{data:e,facets:t}}function k3(e={},t={}){arguments.length===1&&([e,t]=Jp(e));let{y1:r,y:n=r,x:i,...o}=t,[s,a,c,l]=tm(n,i,"y","x",e,o);return{...s,y1:r,y:a,x1:c,x2:l,x:Tp(c,l)}}function nY(e={},t={}){arguments.length===1&&([e,t]=Jp(e));let{y1:r,y:n=r,x:i}=t,[o,s,a]=tm(n,i,"y","x",e,t);return{...o,y1:r,y:s,x:a}}function iY(e={},t={}){arguments.length===1&&([e,t]=Jp(e));let{y1:r,y:n=r,x:i}=t,[o,s,,a]=tm(n,i,"y","x",e,t);return{...o,y1:r,y:s,x:a}}function C3(e={},t={}){arguments.length===1&&([e,t]=Jp(e));let{x1:r,x:n=r,y:i,...o}=t,[s,a,c,l]=tm(n,i,"x","y",e,o);return{...s,x1:r,x:a,y1:c,y2:l,y:Tp(c,l)}}function oY(e={},t={}){arguments.length===1&&([e,t]=Jp(e));let{x1:r,x:n=r,y:i}=t,[o,s,a]=tm(n,i,"x","y",e,t);return{...o,x1:r,x:s,y:a}}function sY(e={},t={}){arguments.length===1&&([e,t]=Jp(e));let{x1:r,x:n=r,y:i}=t,[o,s,,a]=tm(n,i,"x","y",e,t);return{...o,x1:r,x:s,y:a}}function Kp({x:e,x1:t,x2:r,...n}={}){return n=xs(n,"y"),t===void 0&&r===void 0?k3({x:e,...n}):([t,r]=NN(e,t,r),{...n,x1:t,x2:r})}function Qp({y:e,y1:t,y2:r,...n}={}){return n=xs(n,"x"),t===void 0&&r===void 0?C3({y:e,...n}):([t,r]=NN(e,t,r),{...n,y1:t,y2:r})}function Jp(e){let{offset:t,order:r,reverse:n,...i}=e;return[{offset:t,order:r,reverse:n},i]}var Tlt={length:!0};function tm(e,t=wb,r,n,{offset:i,order:o,reverse:s},a){if(t===null)throw new Error(`stack requires ${n}`);let c=Rn(a),[l,u]=wn(e),[f,d]=tn(t),[h,p]=tn(t);return f.hint=h.hint=Tlt,i=Alt(i),o=Dlt(o,i,n),[en(a,(y,g,m)=>{({data:y,facets:g}=tY(y,g));let b=e==null?void 0:u(ad(Tt(y,e),m?.[r])),x=Tt(y,t,Float64Array),_=Tt(y,c),v=o&&o(y,b,x,_),w=y.length,I=d(new Float64Array(w)),D=p(new Float64Array(w)),A=[];for(let B of g){let M=b?Array.from(Gr(B,O=>b[O]).values()):[B];if(v)for(let O of M)O.sort(v);for(let O of M){let R=0,S=0;s&&O.reverse();for(let T of O){let E=x[T];E<0?R=D[T]=(I[T]=R)+E:E>0?S=D[T]=(I[T]=S)+E:D[T]=I[T]=S}}A.push(M)}return i&&i(A,I,D,_),{data:y,facets:g}}),l,f,h]}function Alt(e){if(e!=null){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"expand":case"normalize":return Mlt;case"center":case"silhouette":return Elt;case"wiggle":return cY}throw new Error(`unknown offset: ${e}`)}}function aY(e,t){let r=0,n=0;for(let i of e){let o=t[i];o<r&&(r=o),o>n&&(n=o)}return[r,n]}function Mlt(e,t,r){for(let n of e)for(let i of n){let[o,s]=aY(i,r);for(let a of i){let c=1/(s-o||1);t[a]=c*(t[a]-o),r[a]=c*(r[a]-o)}}}function Elt(e,t,r){for(let n of e){for(let i of n){let[o,s]=aY(i,r);for(let a of i){let c=(s+o)/2;t[a]-=c,r[a]-=c}}lY(n,t,r)}uY(e,t,r)}function cY(e,t,r,n){for(let i of e){let o=new Gn,s=0;for(let a of i){let c=-1,l=a.map(h=>Math.abs(r[h]-t[h])),u=a.map(h=>{c=n?n[h]:++c;let p=r[h]-t[h],y=o.has(c)?p-o.get(c):0;return o.set(c,p),y}),f=[0,...ov(u)];for(let h of a)t[h]+=s,r[h]+=s;let d=gn(l);d&&(s-=gn(l,(h,p)=>(u[p]/2+f[p])*h)/d)}lY(i,t,r)}uY(e,t,r)}function lY(e,t,r){let n=Oe(e,i=>Oe(i,o=>t[o]));for(let i of e)for(let o of i)t[o]-=n,r[o]-=n}function uY(e,t,r){let n=e.length;if(n===1)return;let i=e.map(a=>a.flat()),o=i.map(a=>(Oe(a,c=>t[c])+de(a,c=>r[c]))/2),s=Oe(o);for(let a=0;a<n;a++){let c=s-o[a];for(let l of i[a])t[l]+=c,r[l]+=c}}function Dlt(e,t,r){if(e===void 0&&t===cY)return eY(Kr);if(e!=null){if(typeof e=="string"){let n=e.startsWith("-"),i=n?id:Kr;switch((n?e.slice(1):e).toLowerCase()){case"value":case r:return Blt(i);case"z":return Olt(i);case"sum":return Nlt(i);case"appearance":return Flt(i);case"inside-out":return eY(i)}return rY(AN(e))}if(typeof e=="function")return(e.length===1?rY:Llt)(e);if(Array.isArray(e))return Rlt(e);throw new Error(`invalid order: ${e}`)}}function Blt(e){return(t,r,n)=>(i,o)=>e(n[i],n[o])}function Olt(e){return(t,r,n,i)=>(o,s)=>e(i[o],i[s])}function Nlt(e){return xT(e,(t,r,n,i)=>Mh(ii(t),o=>gn(o,s=>n[s]),o=>i[o]))}function Flt(e){return xT(e,(t,r,n,i)=>Mh(ii(t),o=>r[Of(o,s=>n[s])],o=>i[o]))}function eY(e){return xT(e,(t,r,n,i)=>{let o=ii(t),s=Mh(o,f=>r[Of(f,d=>n[d])],f=>i[f]),a=ds(o,f=>gn(f,d=>n[d]),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 rY(e){return t=>{let r=Tt(t,e);return(n,i)=>Kr(r[n],r[i])}}function Llt(e){return t=>(r,n)=>e(t[r],t[n])}function Rlt(e){return xT(Kr,()=>e)}function xT(e,t){return(r,n,i,o)=>{if(!o)throw new Error("missing channel: z");let s=new Gn(t(r,n,i,o).map((a,c)=>[a,c]));return(a,c)=>e(s.get(o[a]),s.get(o[c]))}}var klt={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},xd=class extends Ft{constructor(t,r={}){let{x1:n,y1:i,x2:o,y2:s,z:a,curve:c,tension:l}=r;super(t,{x1:{value:n,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0},z:{value:Rn(r),optional:!0}},r,klt),this.z=a,this.curve=jb(c,l)}filter(t){return t}render(t,r,n,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a}=n;return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,r,0,0).call(u=>u.selectAll().data(FI(t,[s,a,c,l],this,n)).enter().append("path").call(Gt,this).call(fd,this,n).attr("d",dp().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 qb(e,t){return t===void 0?dl(e,{x:el,y:bu}):new xd(e,t)}function Ou(e,t){let{y:r=nr,...n}=Xp(t);return new xd(e,Kp(Hp({...n,y1:r,y2:void 0})))}function dl(e,t){let{x:r=nr,...n}=Gp(t);return new xd(e,Qp(Zp({...n,x1:r,x2:void 0})))}var Clt={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Yb=class extends Ft{constructor(t,r={}){let{x1:n,y1:i,x2:o,y2:s,curve:a,tension:c}=r;super(t,{x1:{value:n,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},r,Clt),this.curve=gT(a,c),_s(this,r)}project(t,r,n){this.curve!==Bu&&super.project(t,r,n)}render(t,r,n,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a}=n,{curve:u}=this;return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,r).call(f=>f.selectAll().data(t).enter().append("path").call(Gt,this).attr("d",u===Bu&&o.projection?Ult(o.projection,s,a,c,l):d=>{let h=Qn(),p=u(h);return p.lineStart(),p.point(s[d],a[d]),p.point(c[d],l[d]),p.lineEnd(),h}).call(ye,this,n).call(ul,this,n,o)).node()}};function Ult(e,t,r,n,i){let o=xn(e);return t=Cr(t),r=Cr(r),n=Cr(n),i=Cr(i),s=>o({type:"LineString",coordinates:[[t[s],r[s]],[n[s],i[s]]]})}function _T(e,{x:t,x1:r,x2:n,y:i,y1:o,y2:s,...a}={}){return[r,n]=Wb(t,r,n),[o,s]=Wb(i,o,s),new Yb(e,{...a,x1:r,x2:n,y1:o,y2:s})}function Wb(e,t,r){if(e===void 0){if(t===void 0){if(r!==void 0)return[r]}else if(r===void 0)return[t]}else{if(t===void 0)return r===void 0?[e]:[e,r];if(r===void 0)return[e,t]}return[t,r]}var Plt={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5},Gb=class extends Ft{constructor(t,r={}){let{x1:n,y1:i,x2:o,y2:s,bend:a=0,headAngle:c=60,headLength:l=8,inset:u=0,insetStart:f=u,insetEnd:d=u,sweep:h}=r;super(t,{x1:{value:n,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},r,Plt),this.bend=a===!0?22.5:Math.max(-90,Math.min(90,a)),this.headAngle=+c,this.headLength=+l,this.insetStart=+f,this.insetEnd=+d,this.sweep=$lt(h)}render(t,r,n,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a,SW:u}=n,{strokeWidth:f,bend:d,headAngle:h,headLength:p,insetStart:y,insetEnd:g}=this,m=u?_=>u[_]:Qr(f===void 0?1:f),b=h*jp/2,x=p/1.5;return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,r).call(_=>_.selectAll().data(t).enter().append("path").call(Gt,this).attr("d",v=>{let w=s[v],I=a[v],D=c[v],A=l[v],B=Math.hypot(D-w,A-I);if(B<=y+g)return null;let M=Math.atan2(A-I,D-w),O=Math.min(x*m(v),B/3),R=this.sweep(w,I,D,A)*d*jp,S=Math.hypot(B/Math.tan(R),B)/2;if(y||g)if(S<1e5){let nt=Math.sign(R),[st,ut]=zlt([w,I],[D,A],S,nt);if(y&&([w,I]=fY([st,ut,S],[w,I,y],-nt*Math.sign(y))),g){let[X,at]=fY([st,ut,S],[D,A,g],nt*Math.sign(g));M+=Math.atan2(at-ut,X-st)-Math.atan2(A-ut,D-st),D=X,A=at}}else{let nt=D-w,st=A-I,ut=Math.hypot(nt,st);y&&(w+=nt/ut*y,I+=st/ut*y),g&&(D-=nt/ut*g,A-=st/ut*g)}let T=M+R,E=T+b,C=T-b,U=D-O*Math.cos(E),k=A-O*Math.sin(E),$=D-O*Math.cos(C),z=A-O*Math.sin(C),V=S<1e5?`A${S},${S} 0,0,${R>0?1:0} `:"L",Q=O?`M${U},${k}L${D},${A}L${$},${z}`:"";return`M${w},${I}${V}${D},${A}${Q}`}).call(ye,this,n)).node()}};function $lt(e=1){if(typeof e=="number")return Qr(Math.sign(e));if(typeof e=="function")return(t,r,n,i)=>Math.sign(e(t,r,n,i));switch(Ur(e,"sweep",["+x","-x","+y","-y"])){case"+x":return(t,r,n)=>ie(t,n);case"-x":return(t,r,n)=>Wn(t,n);case"+y":return(t,r,n,i)=>ie(r,i);case"-y":return(t,r,n,i)=>Wn(r,i)}}function zlt([e,t],[r,n],i,o){let s=r-e,a=n-t,c=Math.hypot(s,a),l=o*Math.sqrt(i*i-c*c/4)/c;return[(e+r)/2-a*l,(t+n)/2+s*l]}function fY([e,t,r],[n,i,o],s){let a=n-e,c=i-t,l=Math.hypot(a,c),u=(a*a+c*c-o*o+r*r)/(2*l),f=s*Math.sqrt(r*r-u*u);return[e+(a*u+c*f)/l,t+(c*u-a*f)/l]}function dY(e,{x:t,x1:r,x2:n,y:i,y1:o,y2:s,...a}={}){return[r,n]=Wb(t,r,n),[o,s]=Wb(i,o,s),new Gb(e,{...a,x1:r,x2:n,y1:o,y2:s})}var em=class extends Ft{constructor(t,r,n={},i){super(t,r,n,i);let{inset:o=0,insetTop:s=o,insetRight:a=o,insetBottom:c=o,insetLeft:l=o,rx:u,ry:f}=n;this.insetTop=Wt(s),this.insetRight=Wt(a),this.insetBottom=Wt(c),this.insetLeft=Wt(l),this.rx=Ne(u,"auto"),this.ry=Ne(f,"auto")}render(t,r,n,i,o){let{rx:s,ry:a}=this;return pt("svg:g",o).call(Kt,this,i,o).call(this._transform,this,r).call(c=>c.selectAll().data(t).enter().append("rect").call(Gt,this).attr("x",this._x(r,n,i)).attr("width",this._width(r,n,i)).attr("y",this._y(r,n,i)).attr("height",this._height(r,n,i)).call(yt,"rx",s).call(yt,"ry",a).call(ye,this,n)).node()}_x(t,{x:r},{marginLeft:n}){let{insetLeft:i}=this;return r?o=>r[o]+i:n+i}_y(t,{y:r},{marginTop:n}){let{insetTop:i}=this;return r?o=>r[o]+i:n+i}_width({x:t},{x:r},{marginRight:n,marginLeft:i,width:o}){let{insetLeft:s,insetRight:a}=this,c=r&&t?t.bandwidth():o-n-i;return Math.max(0,c-s-a)}_height({y:t},{y:r},{marginTop:n,marginBottom:i,height:o}){let{insetTop:s,insetBottom:a}=this,c=r&&t?t.bandwidth():o-n-i;return Math.max(0,c-s-a)}},hY={ariaLabel:"bar"},Xb=class extends em{constructor(t,r={}){let{x1:n,x2:i,y:o}=r;super(t,{x1:{value:n,scale:"x"},x2:{value:i,scale:"x"},y:{value:o,scale:"y",type:"band",optional:!0}},r,hY)}_transform(t,r,{x:n}){t.call(Pt,r,{x:n},0,0)}_x({x:t},{x1:r,x2:n},{marginLeft:i}){let{insetLeft:o}=this;return si(t)?i+o:s=>Math.min(r[s],n[s])+o}_width({x:t},{x1:r,x2:n},{marginRight:i,marginLeft:o,width:s}){let{insetLeft:a,insetRight:c}=this;return si(t)?s-i-o-a-c:l=>Math.max(0,Math.abs(n[l]-r[l])-a-c)}},Hb=class extends em{constructor(t,r={}){let{x:n,y1:i,y2:o}=r;super(t,{y1:{value:i,scale:"y"},y2:{value:o,scale:"y"},x:{value:n,scale:"x",type:"band",optional:!0}},r,hY)}_transform(t,r,{y:n}){t.call(Pt,r,{y:n},0,0)}_y({y:t},{y1:r,y2:n},{marginTop:i}){let{insetTop:o}=this;return si(t)?i+o:s=>Math.min(r[s],n[s])+o}_height({y:t},{y1:r,y2:n},{marginTop:i,marginBottom:o,height:s}){let{insetTop:a,insetBottom:c}=this;return si(t)?s-i-o-a-c:l=>Math.max(0,Math.abs(n[l]-r[l])-a-c)}};function Ta(e,t={}){return Sp(t)||(t={...t,y:nr,x2:K}),new Xb(e,Kp(XI(Hp(t))))}function Aa(e,t={}){return Sp(t)||(t={...t,x:nr,y2:K}),new Hb(e,Qp(HI(Zp(t))))}var Vlt={ariaLabel:"cell"},_d=class extends em{constructor(t,{x:r,y:n,...i}={}){super(t,{x:{value:r,scale:"x",type:"band",optional:!0},y:{value:n,scale:"y",type:"band",optional:!0}},i,Vlt)}_transform(t,r){t.call(Pt,r,{},0,0)}};function Nu(e,{x:t,y:r,...n}={}){return[t,r]=gr(t,r),new _d(e,{...n,x:t,y:r})}function pY(e,{x:t=nr,fill:r,stroke:n,...i}={}){return r===void 0&&cr(n)[0]===void 0&&(r=K),new _d(e,{...i,x:t,fill:r,stroke:n})}function mY(e,{y:t=nr,fill:r,stroke:n,...i}={}){return r===void 0&&cr(n)[0]===void 0&&(r=K),new _d(e,{...i,y:t,fill:r,stroke:n})}var jlt={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function Zb(e){return e.sort===void 0&&e.reverse===void 0?SI({channel:"-r"},e):e}var wd=class extends Ft{constructor(t,r={}){let{x:n,y:i,r:o,rotate:s,symbol:a=Qc,frameAnchor:c}=r,[l,u]=Ae(s,0),[f,d]=IV(a),[h,p]=Ae(o,f==null?3:4.5);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:h,scale:"r",filter:ni,optional:!0},rotate:{value:l,optional:!0},symbol:{value:f,scale:"auto",optional:!0}},Zb(r),jlt),this.r=p,this.rotate=u,this.symbol=d,this.frameAnchor=xa(c);let{channels:y}=this,{symbol:g}=y;if(g){let{fill:m,stroke:b}=y;g.hint={fill:m?m.value===g.value?"color":"currentColor":this.fill??"currentColor",stroke:b?b.value===g.value?"color":"currentColor":this.stroke??"none"}}}render(t,r,n,i,o){let{x:s,y:a}=r,{x:c,y:l,r:u,rotate:f,symbol:d}=n,{r:h,rotate:p,symbol:y}=this,[g,m]=rn(this,i),b=y===Qc,x=u?void 0:h*h*Math.PI;return hu(h)&&(t=[]),pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,{x:c&&s,y:l&&a}).call(_=>_.selectAll().data(t).enter().append(b?"circle":"path").call(Gt,this).call(b?v=>{v.attr("cx",c?w=>c[w]:g).attr("cy",l?w=>l[w]:m).attr("r",u?w=>u[w]:h)}:v=>{v.attr("transform",Eu`translate(${c?w=>c[w]:g},${l?w=>l[w]:m})${f?w=>` rotate(${f[w]})`:p?` rotate(${p})`:""}`).attr("d",u&&d?w=>{let I=Qn();return d[w].draw(I,u[w]*u[w]*Math.PI),I}:u?w=>{let I=Qn();return y.draw(I,u[w]*u[w]*Math.PI),I}:d?w=>{let I=Qn();return d[w].draw(I,x),I}:(()=>{let w=Qn();return y.draw(w,x),w})())}).call(ye,this,n)).node()}};function Do(e,{x:t,y:r,...n}={}){return n.frameAnchor===void 0&&([t,r]=gr(t,r)),new wd(e,{...n,x:t,y:r})}function yY(e,{x:t=K,...r}={}){return new wd(e,KI({...r,x:t}))}function gY(e,{y:t=K,...r}={}){return new wd(e,ZI({...r,y:t}))}function bY(e,t){return Do(e,{...t,symbol:"circle"})}function xY(e,t){return Do(e,{...t,symbol:"hexagon"})}var qlt={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},vd=class extends Ft{constructor(t,r={}){let{x:n,y:i,z:o,curve:s,tension:a}=r;super(t,{x:{value:n,scale:"x"},y:{value:i,scale:"y"},z:{value:Rn(r),optional:!0}},r,qlt),this.z=o,this.curve=gT(s,a),_s(this,r)}filter(t){return t}project(t,r,n){this.curve!==Bu&&super.project(t,r,n)}render(t,r,n,i,o){let{x:s,y:a}=n,{curve:c}=this;return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,r).call(l=>l.selectAll().data(FI(t,[s,a],this,n)).enter().append("path").call(Gt,this).call(fd,this,n).call(Zj,this,n,o).attr("d",c===Bu&&o.projection?Ylt(o.projection,s,a):eb().curve(c).defined(u=>u>=0).x(u=>s[u]).y(u=>a[u]))).node()}};function Ylt(e,t,r){let n=xn(e);return t=Cr(t),r=Cr(r),i=>{let o=[],s=[o];for(let a of i)a===-1?(o=[],s.push(o)):o.push([t[a],r[a]]);return n({type:"MultiLineString",coordinates:s})}}function Sd(e,{x:t,y:r,...n}={}){return[t,r]=gr(t,r),new vd(e,{...n,x:t,y:r})}function Fu(e,{x:t=K,y:r=nr,...n}={}){return new vd(e,Xp({...n,x:t,y:r}))}function Lu(e,{x:t=nr,y:r=K,...n}={}){return new vd(e,Gp({...n,x:t,y:r}))}var Wlt={ariaLabel:"rect"},Id=class extends Ft{constructor(t,r={}){let{x1:n,y1:i,x2:o,y2:s,inset:a=0,insetTop:c=a,insetRight:l=a,insetBottom:u=a,insetLeft:f=a,rx:d,ry:h}=r;super(t,{x1:{value:n,scale:"x",type:n!=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}},r,Wlt),this.insetTop=Wt(c),this.insetRight=Wt(l),this.insetBottom=Wt(u),this.insetLeft=Wt(f),this.rx=Ne(d,"auto"),this.ry=Ne(h,"auto")}render(t,r,n,i,o){let{x:s,y:a}=r,{x1:c,y1:l,x2:u,y2:f}=n,{marginTop:d,marginRight:h,marginBottom:p,marginLeft:y,width:g,height:m}=i,{projection:b}=o,{insetTop:x,insetRight:_,insetBottom:v,insetLeft:w,rx:I,ry:D}=this,A=(s?.bandwidth?s.bandwidth():0)-w-_,B=(a?.bandwidth?a.bandwidth():0)-x-v;return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,{},0,0).call(M=>M.selectAll().data(t).enter().append("rect").call(Gt,this).attr("x",c&&(b||!si(s))?u?O=>Math.min(c[O],u[O])+w:O=>c[O]+w:y+w).attr("y",l&&(b||!si(a))?f?O=>Math.min(l[O],f[O])+x:O=>l[O]+x:d+x).attr("width",c&&(b||!si(s))?u?O=>Math.max(0,Math.abs(u[O]-c[O])+A):A:g-h-y-_-w).attr("height",l&&(b||!si(a))?f?O=>Math.max(0,Math.abs(l[O]-f[O])+B):B:m-d-p-x-v).call(yt,"rx",I).call(yt,"ry",D).call(ye,this,n)).node()}};function Kb(e,t){return new Id(e,b3(x3(t)))}function rm(e,t={}){return Sp(t)||(t={...t,y:nr,x2:K,interval:1}),new Id(e,Kp(x3(Hp(t))))}function nm(e,t={}){return Sp(t)||(t={...t,x:nr,y2:K,interval:1}),new Id(e,Qp(b3(Zp(t))))}function P3(e,t){t=Glt(t);let{x:r,y:n,color:i,size:o}=t,s=wT(e,r),a=wT(e,n),c=wT(e,i),l=wT(e,o),{fx:u,fy:f,x:{value:d,reduce:h,zero:p,...y},y:{value:g,reduce:m,zero:b,...x},color:{value:_,color:v,reduce:w},size:{value:I,reduce:D},mark:A}=t;if(h===void 0&&(h=m==null&&d==null&&I==null&&g!=null?"count":null),m===void 0&&(m=h==null&&g==null&&I==null&&d!=null?"count":null),D===void 0&&I==null&&w==null&&h==null&&m==null&&(d==null||ir(s))&&(g==null||ir(a))&&(D="count"),p===void 0&&(p=vT(h)?!0:void 0),b===void 0&&(b=vT(m)?!0:void 0),d==null&&g==null)throw new Error("must specify x or y");if(h!=null&&g==null)throw new Error("reducing x requires y");if(m!=null&&d==null)throw new Error("reducing y requires x");A===void 0&&(A=I!=null||D!=null?"dot":vT(h)||vT(m)||w!=null?"bar":d!=null&&g!=null?ir(s)||ir(a)||h==null&&m==null&&!Qb(s)&&!Qb(a)?"dot":"line":d!=null||g!=null?"rule":null);let B,M,O;switch(A){case"dot":O=Do,M="stroke";break;case"line":O=s&&a||h!=null||m!=null?b||m!=null||s&&Qb(s)?Lu:p||h!=null||a&&Qb(a)?Fu:Sd:s?Fu:Lu,M="stroke",wY(c)&&(B=null);break;case"area":O=!(b||m!=null)&&(p||h!=null||a&&Qb(a))?Ou:dl,M="fill",wY(c)&&(B=null);break;case"rule":O=s?Zi:Ki,M="stroke";break;case"bar":O=h!=null?ir(a)?_Y(h)&&s&&ir(s)?Nu:Ta:rm:m!=null?ir(s)?_Y(m)&&a&&ir(a)?Nu:Aa:nm:w!=null||D!=null?s&&ir(s)&&a&&ir(a)?Nu:s&&ir(s)?Aa:a&&ir(a)?Ta:Kb:s&&il(s)&&!(a&&il(a))?Ta:a&&il(a)&&!(s&&il(s))?Aa:Nu,M="fill";break;default:throw new Error(`invalid mark: ${A}`)}let R={fx:u,fy:f,x:s??void 0,y:a??void 0,[M]:c??v,z:B,r:l??void 0,tip:!0},S,T={[M]:w??void 0,r:D??void 0};if(h!=null&&m!=null)throw new Error("cannot reduce both x and y");return m!=null?(T.y=m,S=ir(s)?Su:Sa):h!=null?(T.x=h,S=ir(a)?Iu:Ia):(w!=null||D!=null)&&(s&&a?S=ir(s)&&ir(a)?Ab:ir(s)?Ia:ir(a)?Sa:fl:s?S=ir(s)?Su:Sa:a&&(S=ir(a)?Iu:Ia)),(S===fl||S===Sa)&&(R.x={value:s,...y}),(S===fl||S===Ia)&&(R.y={value:a,...x}),p===void 0&&(p=s&&!(S===fl||S===Sa)&&(O===Ta||O===Ou||O===rm||O===Ki)),b===void 0&&(b=a&&!(S===fl||S===Ia)&&(O===Aa||O===dl||O===nm||O===Zi)),{fx:u??null,fy:f??null,x:{value:d??null,reduce:h??null,zero:!!p,...y},y:{value:g??null,reduce:m??null,zero:!!b,...x},color:{value:_??null,reduce:w??null,...v!==void 0&&{color:v}},size:{value:I??null,reduce:D??null},mark:A,markImpl:vY[O],markOptions:R,transformImpl:vY[S],transformOptions:T,colorMode:M}}function SY(e,t){let r=P3(e,t),{fx:n,fy:i,x:{zero:o},y:{zero:s},markOptions:a,transformOptions:c,colorMode:l}=r,u=U3[r.markImpl],f=U3[r.transformImpl],d=n!=null||i!=null?Wp({strokeOpacity:.1}):null,h=[o?Zi([0]):null,s?Ki([0]):null],p=u(e,f?f(c,a):a);return l==="stroke"?Pr(d,h,p):Pr(d,p,h)}function Qb(e){let t,r;for(let n of e){if(n==null)continue;if(t===void 0){t=n;continue}let i=Math.sign(ie(t,n));if(i){if(r!==void 0&&i!==r)return!1;t=n,r=i}}return!0}function Glt({x:e,y:t,color:r,size:n,fx:i,fy:o,mark:s}={}){return Xi(e)||(e=im(e)),Xi(t)||(t=im(t)),Xi(r)||(r=wu(r)?{color:r}:im(r)),Xi(n)||(n=im(n)),Xi(i)&&({value:i}=im(i)),Xi(o)&&({value:o}=im(o)),s!=null&&(s=`${s}`.toLowerCase()),{x:e,y:t,color:r,size:n,fx:i,fy:o,mark:s}}function wT(e,t){let r=Tt(e,t.value);return r&&(r.label=vn(t.value)),r}function im(e){return Xlt(e)?{reduce:e}:{value:e}}function vT(e){return/^(?:distinct|count|sum|proportion)$/i.test(e)}function _Y(e){return/^(?:first|last|mode)$/i.test(e)}function Xlt(e){if(e==null)return!1;if(typeof e.reduceIndex=="function"||typeof e.reduce=="function"&&Jr(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 wY(e){return e?new Xn(e).size>e.length>>1:!1}var U3={dot:Do,line:Sd,lineX:Fu,lineY:Lu,areaX:Ou,areaY:dl,ruleX:Zi,ruleY:Ki,barX:Ta,barY:Aa,rect:Kb,rectX:rm,rectY:nm,cell:Nu,bin:fl,binX:Sa,binY:Ia,group:Ab,groupX:Su,groupY:Iu},vY=Object.fromEntries(Object.entries(U3).map(([e,t])=>[t,e]));function om(e,t={}){let{x:r,x1:n,x2:i}=t;r===void 0&&n===void 0&&i===void 0&&(t={...t,x:r=K});let o={};return r!=null&&(o.x=e),n!=null&&(o.x1=e),i!=null&&(o.x2=e),Ii(o,t)}function sm(e,t={}){let{y:r,y1:n,y2:i}=t;r===void 0&&n===void 0&&i===void 0&&(t={...t,y:r=K});let o={};return r!=null&&(o.y=e),n!=null&&(o.y1=e),i!=null&&(o.y2=e),Ii(o,t)}function Ii(e={},t={}){let r=Rn(t),n=Object.entries(e).map(([i,o])=>{let s=bI(i,t);if(s==null)throw new Error(`missing channel: ${i}`);let[a,c]=tn(s);return{key:i,input:s,output:a,setOutput:c,map:Hlt(o)}});return{...en(t,(i,o)=>{let s=Tt(i,r),a=n.map(({input:l})=>Tt(i,l)),c=n.map(({setOutput:l})=>l(new Array(i.length)));for(let l of o)for(let u of s?Gr(l,f=>s[f]).values():[l])n.forEach(({map:f},d)=>f.mapIndex(u,a[d],c[d]));return{data:i,facets:o}}),...Object.fromEntries(n.map(({key:i,output:o})=>[i,o]))}}function Hlt(e){if(e==null)throw new Error("missing map");if(typeof e.mapIndex=="function")return e;if(typeof e.map=="function"&&Jr(e))return Zlt(e);if(typeof e=="function")return $3(Ip(e));switch(`${e}`.toLowerCase()){case"cumsum":return Qlt;case"rank":return $3((t,r)=>Vg(t,n=>r[n]));case"quantile":return $3((t,r)=>Klt(t,n=>r[n]))}throw new Error(`invalid map: ${e}`)}function Zlt(e){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:e.map.bind(e)}}function Klt(e,t){let r=Xs(e,t)-1;return Vg(e,t).map(n=>n/r)}function $3(e){return{mapIndex(t,r,n){let i=e(t,r);if(i.length!==t.length)throw new Error("map function returned a mismatched length");for(let o=0,s=t.length;o<s;++o)n[t[o]]=i[o]}}}var Qlt={mapIndex(e,t,r){let n=0;for(let i of e)r[i]=n+=t[i]}};function IY(e={},t){return arguments.length===1&&(t=e),om(am(e),t)}function TY(e={},t){return arguments.length===1&&(t=e),sm(am(e),t)}function am(e={}){typeof e=="number"&&(e={k:e});let{k:t,reduce:r,shift:n,anchor:i,strict:o}=e;if(i===void 0&&n!==void 0&&(i=tut(n),kn(`Warning: the shift option is deprecated; please use anchor "${i}" instead.`)),!((t=Math.floor(t))>0))throw new Error(`invalid k: ${t}`);return eut(r)(t,Jlt(i,t),o)}function Jlt(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 tut(e){switch(`${e}`.toLowerCase()){case"centered":return"middle";case"leading":return"start";case"trailing":return"end"}throw new Error(`invalid shift: ${e}`)}function eut(e="mean"){if(typeof e=="string"){if(/^p\d{2}$/i.test(e))return ST(vp(e));switch(e.toLowerCase()){case"deviation":return ST(go);case"max":return IT((t,r)=>de(t,n=>r[n]));case"mean":return rut;case"median":return ST(hs);case"min":return IT((t,r)=>Oe(t,n=>r[n]));case"mode":return IT((t,r)=>Oh(t,n=>r[n]));case"sum":return AY;case"variance":return ST(Kl);case"difference":return out;case"ratio":return sut;case"first":return aut;case"last":return cut}}if(typeof e!="function")throw new Error(`invalid reduce: ${e}`);return IT(Ip(e))}function ST(e){return(t,r,n)=>n?{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+r]]=c===0?e(rl(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=-r;c<0;++c)s[i[c+r]]=e(rl(i,0,c+t),a);for(let c=0,l=i.length-r;c<l;++c)s[i[c+r]]=e(rl(i,c,c+t),a)}}}function IT(e){return(t,r,n)=>n?{mapIndex(i,o,s){let a=0;for(let c=0;c<t-1;++c)a+=wr(o[i[c]]);for(let c=0,l=i.length-t+1;c<l;++c)a+=wr(o[i[c+t-1]]),a===t&&(s[i[c+r]]=e(rl(i,c,c+t),o)),a-=wr(o[i[c]])}}:{mapIndex(i,o,s){for(let a=-r;a<0;++a)s[i[a+r]]=e(rl(i,0,a+t),o);for(let a=0,c=i.length-r;a<c;++a)s[i[a+r]]=e(rl(i,a,a+t),o)}}}function AY(e,t,r){return r?{mapIndex(n,i,o){let s=0,a=0;for(let c=0;c<e-1;++c){let l=i[n[c]];l===null||isNaN(l)?++s:a+=+l}for(let c=0,l=n.length-e+1;c<l;++c){let u=i[n[c]],f=i[n[c+e-1]];f===null||isNaN(f)?++s:a+=+f,o[n[c+t]]=s===0?a:NaN,u===null||isNaN(u)?--s:a-=+u}}}:{mapIndex(n,i,o){let s=0,a=n.length;for(let c=0,l=Math.min(a,e-t-1);c<l;++c)s+=+i[n[c]]||0;for(let c=-t,l=a-t;c<l;++c)s+=+i[n[c+e-1]]||0,o[n[c+t]]=s,s-=+i[n[c]]||0}}}function rut(e,t,r){if(r){let n=AY(e,t,r);return{mapIndex(i,o,s){n.mapIndex(i,o,s);for(let a=0,c=i.length-e+1;a<c;++a)s[i[a+t]]/=e}}}else return{mapIndex(n,i,o){let s=0,a=0,c=n.length;for(let l=0,u=Math.min(c,e-t-1);l<u;++l){let f=i[n[l]];f!==null&&!isNaN(f=+f)&&(s+=f,++a)}for(let l=-t,u=c-t;l<u;++l){let f=i[n[l+e-1]],d=i[n[l]];f!==null&&!isNaN(f=+f)&&(s+=f,++a),o[n[l+t]]=s/a,d!==null&&!isNaN(d=+d)&&(s-=d,--a)}}}}function nut(e,t,r,n){for(let i=r+n;r<i;++r){let o=e[t[r]];if(wr(o))return o}}function iut(e,t,r,n){for(let i=r+n-1;i>=r;--i){let o=e[t[i]];if(wr(o))return o}}function MY(e,t,r,n){for(let i=r+n;r<i;++r){let o=e[t[r]];if(o!==null&&!isNaN(o=+o))return o}}function EY(e,t,r,n){for(let i=r+n-1;i>=r;--i){let o=e[t[i]];if(o!==null&&!isNaN(o=+o))return o}}function out(e,t,r){return r?{mapIndex(n,i,o){for(let s=0,a=n.length-e;s<a;++s){let c=i[n[s]],l=i[n[s+e-1]];o[n[s+t]]=c===null||l===null?NaN:l-c}}}:{mapIndex(n,i,o){for(let s=-t,a=n.length-e+t+1;s<a;++s)o[n[s+t]]=EY(i,n,s,e)-MY(i,n,s,e)}}}function sut(e,t,r){return r?{mapIndex(n,i,o){for(let s=0,a=n.length-e;s<a;++s){let c=i[n[s]],l=i[n[s+e-1]];o[n[s+t]]=c===null||l===null?NaN:l/c}}}:{mapIndex(n,i,o){for(let s=-t,a=n.length-e+t+1;s<a;++s)o[n[s+t]]=EY(i,n,s,e)/MY(i,n,s,e)}}}function aut(e,t,r){return r?{mapIndex(n,i,o){for(let s=0,a=n.length-e;s<a;++s)o[n[s+t]]=i[n[s]]}}:{mapIndex(n,i,o){for(let s=-t,a=n.length-e+t+1;s<a;++s)o[n[s+t]]=nut(i,n,s,e)}}}function cut(e,t,r){return r?{mapIndex(n,i,o){for(let s=0,a=n.length-e;s<a;++s)o[n[s+t]]=i[n[s+e-1]]}}:{mapIndex(n,i,o){for(let s=-t,a=n.length-e+t+1;s<a;++s)o[n[s+t]]=iut(i,n,s,e)}}}var hl={n:20,k:2,color:"currentColor",opacity:.2,strict:!0,anchor:"end"};function DY(e,{x:t=K,y:r,k:n=hl.k,color:i=hl.color,opacity:o=hl.opacity,fill:s=i,fillOpacity:a=o,stroke:c=i,strokeOpacity:l,strokeWidth:u,...f}={}){return Pr(Se(s)?null:Ou(e,Ii({x1:Ru({k:-n,...f}),x2:Ru({k:n,...f})},{x1:t,x2:t,y:r,fill:s,fillOpacity:a,...f})),Se(c)?null:Fu(e,Ii({x:Ru(f)},{x:t,y:r,stroke:c,strokeOpacity:l,strokeWidth:u,...f})))}function BY(e,{x:t,y:r=K,k:n=hl.k,color:i=hl.color,opacity:o=hl.opacity,fill:s=i,fillOpacity:a=o,stroke:c=i,strokeOpacity:l,strokeWidth:u,...f}={}){return Pr(Se(s)?null:dl(e,Ii({y1:Ru({k:-n,...f}),y2:Ru({k:n,...f})},{x:t,y1:r,y2:r,fill:s,fillOpacity:a,...f})),Se(c)?null:Lu(e,Ii({y:Ru(f)},{x:t,y:r,stroke:c,strokeOpacity:l,strokeWidth:u,...f})))}function Ru({n:e=hl.n,k:t=0,strict:r=hl.strict,anchor:n=hl.anchor}={}){return am({k:e,reduce:i=>Lc(i)+t*(go(i)||0),strict:r,anchor:n})}var lut={ariaLabel:"tick",fill:null,stroke:"currentColor"},TT=class extends Ft{constructor(t,r,n){super(t,r,n,lut),_s(this,n)}render(t,r,n,i,o){return pt("svg:g",o).call(Kt,this,i,o).call(this._transform,this,r).call(s=>s.selectAll().data(t).enter().append("line").call(Gt,this).attr("x1",this._x1(r,n,i)).attr("x2",this._x2(r,n,i)).attr("y1",this._y1(r,n,i)).attr("y2",this._y2(r,n,i)).call(ye,this,n).call(ul,this,n,o)).node()}},Jb=class extends TT{constructor(t,r={}){let{x:n,y:i,inset:o=0,insetTop:s=o,insetBottom:a=o}=r;super(t,{x:{value:n,scale:"x"},y:{value:i,scale:"y",type:"band",optional:!0}},r),this.insetTop=Wt(s),this.insetBottom=Wt(a)}_transform(t,r,{x:n}){t.call(Pt,r,{x:n},ur,0)}_x1(t,{x:r}){return n=>r[n]}_x2(t,{x:r}){return n=>r[n]}_y1({y:t},{y:r},{marginTop:n}){let{insetTop:i}=this;return r&&t?o=>r[o]+i:n+i}_y2({y:t},{y:r},{height:n,marginBottom:i}){let{insetBottom:o}=this;return r&&t?s=>r[s]+t.bandwidth()-o:n-i-o}},tx=class extends TT{constructor(t,r={}){let{x:n,y:i,inset:o=0,insetRight:s=o,insetLeft:a=o}=r;super(t,{y:{value:i,scale:"y"},x:{value:n,scale:"x",type:"band",optional:!0}},r),this.insetRight=Wt(s),this.insetLeft=Wt(a)}_transform(t,r,{y:n}){t.call(Pt,r,{y:n},0,ur)}_x1({x:t},{x:r},{marginLeft:n}){let{insetLeft:i}=this;return r&&t?o=>r[o]+i:n+i}_x2({x:t},{x:r},{width:n,marginRight:i}){let{insetRight:o}=this;return r&&t?s=>r[s]+t.bandwidth()-o:n-i-o}_y1(t,{y:r}){return n=>r[n]}_y2(t,{y:r}){return n=>r[n]}};function AT(e,{x:t=K,...r}={}){return new Jb(e,{...r,x:t})}function MT(e,{y:t=K,...r}={}){return new tx(e,{...r,y:t})}function OY(e,{x:t=K,y:r=null,fill:n="#ccc",fillOpacity:i,stroke:o="currentColor",strokeOpacity:s,strokeWidth:a=2,sort:c,...l}={}){let u=r!=null?Iu:Tb;return Pr(Ki(e,u({x1:z3,x2:V3},{x:t,y:r,stroke:o,strokeOpacity:s,...l})),Ta(e,u({x1:"p25",x2:"p75"},{x:t,y:r,fill:n,fillOpacity:i,...l})),AT(e,u({x:"p50"},{x:t,y:r,stroke:o,strokeOpacity:s,strokeWidth:a,sort:c,...l})),Do(e,Ii({x:FY},{x:t,y:r,z:r,stroke:o,strokeOpacity:s,...l})))}function NY(e,{y:t=K,x:r=null,fill:n="#ccc",fillOpacity:i,stroke:o="currentColor",strokeOpacity:s,strokeWidth:a=2,sort:c,...l}={}){let u=r!=null?Su:Tb;return Pr(Zi(e,u({y1:z3,y2:V3},{x:r,y:t,stroke:o,strokeOpacity:s,...l})),Aa(e,u({y1:"p25",y2:"p75"},{x:r,y:t,fill:n,fillOpacity:i,...l})),MT(e,u({y:"p50"},{x:r,y:t,stroke:o,strokeOpacity:s,strokeWidth:a,sort:c,...l})),Do(e,Ii({y:FY},{x:r,y:t,z:r,stroke:o,strokeOpacity:s,...l})))}function FY(e){let t=z3(e),r=V3(e);return e.map(n=>n<t||n>r?n:NaN)}function z3(e){let t=LY(e)*2.5-RY(e)*1.5;return Oe(e,r=>r>=t?r:NaN)}function V3(e){let t=RY(e)*2.5-LY(e)*1.5;return de(e,r=>r<=t?r:NaN)}function LY(e){return Hn(e,.25)}function RY(e){return Hn(e,.75)}var uut={ariaLabel:"raster",stroke:null,pixelSize:1};function cm(e,t){let r=+e;if(isNaN(r))throw new Error(`invalid ${t}: ${e}`);return r}function kY(e,t){let r=Math.floor(e);if(isNaN(r))throw new Error(`invalid ${t}: ${e}`);return r}var rx=class extends Ft{constructor(t,r,n={},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:d=c==null?s:void 0,pixelSize:h=i.pixelSize,blur:p=0,interpolate:y}=n;if(o!=null&&(o=kY(o,"width")),s!=null&&(s=kY(s,"height")),l!=null&&(l=cm(l,"x1")),u!=null&&(u=cm(u,"y1")),f!=null&&(f=cm(f,"x2")),d!=null&&(d=cm(d,"y2")),a==null&&(l==null||f==null))throw new Error("missing x");if(c==null&&(u==null||d==null))throw new Error("missing y");t!=null&&o!=null&&s!=null&&(a===void 0&&l!=null&&f!=null&&(a=but(l,f,o,s)),c===void 0&&u!=null&&d!=null&&(c=xut(u,d,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:d==null?null:[d],scale:"y",optional:!0,filter:null},...r},n,i),this.width=o,this.height=s,this.pixelSize=cm(h,"pixelSize"),this.blur=cm(p,"blur"),this.interpolate=a==null||c==null?null:fut(y)}},nx=class extends rx{constructor(t,r={}){let{imageRendering:n}=r;if(t==null){let{fill:i,fillOpacity:o}=r;Ae(o)[0]!==void 0&&(r=ET("fillOpacity",r)),cr(i)[0]!==void 0&&(r=ET("fill",r))}super(t,void 0,r,uut),this.imageRendering=Ne(n,"auto")}scale(t,{color:r,...n},i){return super.scale(t,n,i)}render(t,r,n,i,o){let s=r[n.channels.fill?.scale]??(T=>T),{x:a,y:c}=n,{document:l}=o,[u,f,d,h]=UY(n,i,o),p=d-u,y=h-f,{pixelSize:g,width:m=Math.round(Math.abs(p)/g),height:b=Math.round(Math.abs(y)/g)}=this,x=m*b,{fill:_,fillOpacity:v}=n,w=0;if(this.interpolate){let T=m/p,E=b/y,C=fe(a,k=>(k-u)*T,Float64Array),U=fe(c,k=>(k-f)*E,Float64Array);_&&(_=this.interpolate(t,m,b,C,U,_)),v&&(v=this.interpolate(t,m,b,C,U,v))}else this.data==null&&t&&(w=t.fi*x);let I=l.createElement("canvas");I.width=m,I.height=b;let D=I.getContext("2d"),A=D.createImageData(m,b),B=A.data,{r:M,g:O,b:R}=qr(this.fill)??{r:0,g:0,b:0},S=(this.fillOpacity??1)*255;for(let T=0;T<x;++T){let E=T<<2;if(_){let C=s(_[T+w]);if(C==null){B[E+3]=0;continue}({r:M,g:O,b:R}=qr(C))}v&&(S=v[T+w]*255),B[E+0]=M,B[E+1]=O,B[E+2]=R,B[E+3]=S}return this.blur>0&&_D(A,this.blur),D.putImageData(A,0,0),pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,r).call(T=>T.append("image").attr("transform",`translate(${u},${f}) scale(${Math.sign(d-u)},${Math.sign(h-f)})`).attr("width",Math.abs(p)).attr("height",Math.abs(y)).attr("preserveAspectRatio","none").call(yt,"image-rendering",this.imageRendering).call(Gt,this).attr("xlink:href",I.toDataURL())).node()}};function j3(e,t,r){arguments.length<3&&(r=t,t=null);let{x:n,y:i,[e]:o,...s}=r;return n===void 0&&i===void 0&&pV(t)&&(n=el,i=bu,o===void 0&&(o=lV)),[t,{...s,x:n,y:i,[e]:o}]}function CY(){let[e,t]=j3("fill",...arguments);return new nx(e,e==null||t.fill!==void 0||t.fillOpacity!==void 0?t:{...t,fill:K})}function UY({x1:e,y1:t,x2:r,y2:n},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,r&&o==null?r[0]:s-l,n&&o==null?n[0]:a-u]}function q3({x1:e,y1:t,x2:r,y2:n},i,o,s){let a={};return e&&(a.x1=e),t&&(a.y1=t),r&&(a.x2=r),n&&(a.y2=n),UY(Op(a,i),o,s)}function ET(e,t={}){let{[e]:r}=t;if(typeof r!="function")throw new Error(`invalid ${e}: not a function`);return Qe({...t,[e]:void 0},function(n,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,d,h,p]=q3(o,s,a,c),y=h-f,g=p-d,{pixelSize:m}=this,{width:b=Math.round(Math.abs(y)/m),height:x=Math.round(Math.abs(g)/m)}=t,_=new Array(b*x*(i?i.length:1)),v=y/b,w=g/x,I=0;for(let D of i??[void 0])for(let A=.5;A<x;++A)for(let B=.5;B<b;++B,++I)_[I]=r(l.invert(f+B*v),u.invert(d+A*w),D);return{data:_,facets:i,channels:{[e]:{value:_,scale:"auto"}}}})}function fut(e){if(typeof e=="function")return e;if(e==null)return DT;switch(`${e}`.toLowerCase()){case"none":return DT;case"nearest":return W3;case"barycentric":return Y3();case"random-walk":return G3()}throw new Error(`invalid interpolate: ${e}`)}function DT(e,t,r,n,i,o){let s=new Array(t*r);for(let a of e)n[a]<0||n[a]>=t||i[a]<0||i[a]>=r||(s[Math.floor(i[a])*t+Math.floor(n[a])]=o[a]);return s}function Y3({random:e=ca(42)}={}){return(t,r,n,i,o,s)=>{let{points:a,triangles:c,hull:l}=On.from(t,h=>i[h],h=>o[h]),u=new s.constructor(r*n).fill(NaN),f=new Uint8Array(r*n),d=gut(s,e);for(let h=0;h<c.length;h+=3){let p=c[h],y=c[h+1],g=c[h+2],m=a[2*p],b=a[2*y],x=a[2*g],_=a[2*p+1],v=a[2*y+1],w=a[2*g+1],I=Math.min(m,b,x),D=Math.max(m,b,x),A=Math.min(_,v,w),B=Math.max(_,v,w),M=(v-w)*(m-x)+(_-w)*(x-b);if(!M)continue;let O=s[t[p]],R=s[t[y]],S=s[t[g]];for(let T=Math.floor(I);T<D;++T)for(let E=Math.floor(A);E<B;++E){if(T<0||T>=r||E<0||E>=n)continue;let C=T+.5,U=E+.5,k=((v-w)*(C-x)+(U-w)*(x-b))/M;if(k<0)continue;let $=((w-_)*(C-x)+(U-w)*(m-x))/M;if($<0)continue;let z=1-k-$;if(z<0)continue;let V=T+r*E;u[V]=d(O,k,R,$,S,z,T,E),f[V]=1}}return dut(u,f,i,o,s,r,n,l,t,d),u}}function dut(e,t,r,n,i,o,s,a,c,l){r=Float64Array.from(a,h=>r[c[h]]),n=Float64Array.from(a,h=>n[c[h]]),i=Array.from(a,h=>i[c[h]]);let u=r.length,f=Array.from({length:u},(h,p)=>put(p,r,n)),d=0;for(let h=0;h<s;++h){let p=h+.5;for(let y=0;y<o;++y){let g=y+o*h;if(!t[g]){let m=y+.5;for(let b=0;b<u;++b){let x=(u+d+(b%2?(b+1)/2:-b/2))%u;if(f[x](m,p)){let _=hut(r.at(x-1),n.at(x-1),r[x],n[x],m,p);e[g]=l(i.at(x-1),_,i[x],1-_,i[x],0,y,h),d=x;break}}}}}}function hut(e,t,r,n,i,o){let s=r-e,a=n-t,c=s*(r-i)+a*(n-o),l=s*(i-e)+a*(o-t);return c>0&&l>0?c/(c+l):+(c>l)}function ex(e,t,r,n){return e*n-r*t}function put(e,t,r){let n=t.length,i=t.at(e-2),o=r.at(e-2),s=t.at(e-1),a=r.at(e-1),c=t[e],l=r[e],u=t.at(e+1-n),f=r.at(e+1-n),d=s-c,h=a-l,p=i-s,y=o-a,g=c-u,m=l-f,b=Math.hypot(d,h),x=Math.hypot(p,y),_=Math.hypot(g,m);return(v,w)=>{let I=v-s,D=w-a,A=v-c,B=w-l;return ex(I,D,A,B)>-1e-6&&ex(I,D,d,h)*x-ex(I,D,p,y)*b>-1e-6&&ex(A,B,g,m)*b-ex(A,B,d,h)*_<=0}}function W3(e,t,r,n,i,o){let s=new o.constructor(t*r),a=On.from(e,u=>n[u],u=>i[u]),c,l;for(let u=.5,f=0;u<r;++u){l=c;for(let d=.5;d<t;++d,++f)l=a.find(d,u,l),d===.5&&(c=l),s[f]=o[e[l]]}return s}function G3({random:e=ca(42),minDistance:t=.5,maxSteps:r=2}={}){return(n,i,o,s,a,c)=>{let l=new c.constructor(i*o),u=On.from(n,p=>s[p],p=>a[p]),f,d,h;for(let p=.5,y=0;p<o;++p){d=f;for(let g=.5;g<i;++g,++y){let m=g,b=p;h=d=u.find(m,b,d),g===.5&&(f=d);let x,_=0;for(;(x=Math.hypot(s[n[h]]-m,a[n[h]]-b))>t&&_<r;){let v=e(g,p,_)*2*Math.PI;m+=Math.cos(v)*x,b+=Math.sin(v)*x,h=u.find(m,b,h),++_}l[y]=c[n[h]]}}return l}}function mut(e,t,r,n,i,o){return t*e+n*r+o*i}function yut(e){return(t,r,n,i,o,s,a,c)=>{let l=e(a,c);return l<r?t:l<r+i?n:o}}function gut(e,t){return il(e)||lr(e)?mut:yut(t)}function but(e,t,r){return{transform(n){let i=n.length,o=new Float64Array(i),s=(t-e)/r,a=e+s/2;for(let c=0;c<i;++c)o[c]=c%r*s+a;return o}}}function xut(e,t,r,n){return{transform(i){let o=i.length,s=new Float64Array(o),a=(t-e)/n,c=e+a/2;for(let l=0;l<o;++l)s[l]=Math.floor(l/r)%n*a+c;return s}}}var PY={ariaLabel:"contour",fill:"none",stroke:"currentColor",strokeMiterlimit:1,pixelSize:2},ix=class extends rx{constructor(t,{smooth:r=!0,value:n,...i}={}){let o=NI({},i,PY);if(n===void 0){for(let a in o)if(o[a].value!=null){if(n!==void 0)throw new Error("ambiguous contour value");n=i[a],i[a]="value"}}if(n!=null){let a={transform:c=>c.map(l=>l.value),label:vn(n)};for(let c in o)i[c]==="value"&&(i[c]=a)}if(t==null){if(n==null)throw new Error("missing contour value");i=ET("value",{value:n,...i}),n=null}else{let{interpolate:a}=i;n===void 0&&(n=K),a===void 0&&(i.interpolate="nearest")}super(t,{value:{value:n,optional:!0}},_ut(i),PY);let s={geometry:{value:K}};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=!!r}filter(t,{x:r,y:n,value:i,...o},s){return super.filter(t,o,s)}render(t,r,n,i,o){let{geometry:s}=n,a=xn();return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,r).call(c=>{c.selectAll().data(t).enter().append("path").call(Gt,this).attr("d",l=>a(s[l])).call(ye,this,n)}).node()}};function _ut({thresholds:e,interval:t,...r}){return e=L3(e,t,Ql),Qe(r,function(n,i,o,s,a,c){let[l,u,f,d]=q3(o,s,a,c),h=f-l,p=d-u,{pixelSize:y,width:g=Math.round(Math.abs(h)/y),height:m=Math.round(Math.abs(p)/y)}=this,b=g/h,x=m/p,_=o.value.value,v=[];if(this.interpolate){let{x:B,y:M}=Au(o,s,c),O=fe(B,E=>(E-l)*b,Float64Array),R=fe(M,E=>(E-u)*x,Float64Array),S=[o.x,o.y,o.value],T=[O,R,_];for(let E of i){let C=this.filter(E,S,T);v.push(this.interpolate(C,g,m,O,R,_))}}else if(i){let B=g*m,M=i.length;for(let O=0;O<M;++O)v.push(_.slice(O*B,O*B+B))}else v.push(_);if(this.blur>0)for(let B of v)Cg({data:B,width:g,height:m},this.blur);let w=wut(e,_,...vut(v));if(w===null)throw new Error(`unsupported thresholds: ${e}`);let{contour:I}=ou().size([g,m]).smooth(this.smooth),D=[],A=[];for(let B of v)A.push(_r(D.length,D.push(...fe(w,M=>I(B,M)))));for(let{coordinates:B}of D)for(let M of B)for(let O of M)for(let R of O)R[0]=R[0]/b+l,R[1]=R[1]/x+u;return{data:D,facets:A,channels:DI(this.contourChannels,D)}})}function wut(e,t,r,n){if(typeof e?.range=="function")return e.range(e.floor(r),n);if(typeof e=="function"&&(e=e(t,r,n)),typeof e!="number")return Sr(e);let i=yn(...Dh(r,n,e),e);for(;i[i.length-1]>=n;)i.pop();for(;i[1]<r;)i.shift();return i}function zY(){return new ix(...j3("value",...arguments))}function vut(e){return[Oe(e,t=>Oe(t,$Y)),de(e,t=>de(t,$Y))]}function $Y(e){return isFinite(e)?e:NaN}function qY(e,t){return X3(zp,e,t)}function YY(e,t={}){return X3(Vp,e,t)}function WY(e,t={}){return X3(dd,e,t)}function X3(e,t,r={}){let{x:n,y:i,maxRadius:o}=r,s=e({px:n,py:i,maxRadius:o}),a=[];n!=null&&a.push(Zi(t,VY("x",{...s,inset:-6},r))),i!=null&&a.push(Ki(t,VY("y",{...s,inset:-6},r))),n!=null&&a.push(va(t,jY("x",{...s,dy:9,frameAnchor:"bottom",lineAnchor:"top"},r))),i!=null&&a.push(va(t,jY("y",{...s,dx:-9,frameAnchor:"left",textAnchor:"end"},r)));for(let c of a)c.ariaLabel=`crosshair ${c.ariaLabel}`;return Pr(...a)}function GY(e,{channels:t,...r},{facet:n,facetAnchor:i,fx:o,fy:s,[e]:a,channels:c,transform:l,initializer:u}){return{...r,facet:n,facetAnchor:i,fx:o,fy:s,[e]:a,channels:{...t,...c},transform:l,initializer:Sut(e,u)}}function Sut(e,t){return t==null?t:function(r,n,{x:i,y:o,px:s,py:a,...c},...l){let{channels:{x:u,y:f,...d}={},...h}=t.call(this,r,n,{...c,x:s,y:a},...l);return{channels:{...d,...u&&{px:u,...e==="x"&&{x:u}},...f&&{py:f,...e==="y"&&{y:f}}},...h}}}function VY(e,t,r){let{color:n="currentColor",opacity:i=.2,ruleStroke:o=n,ruleStrokeOpacity:s=i,ruleStrokeWidth:a}=r;return{...GY(e,t,r),stroke:o,strokeOpacity:s,strokeWidth:a}}function jY(e,t,r){let{color:n="currentColor",textFill:i=n,textFillOpacity:o,textStroke:s="var(--plot-background)",textStrokeOpacity:a,textStrokeWidth:c=5}=r;return{...GY(e,t,Iut(e,r)),fill:i,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:c}}function Iut(e,t){return Qe(t,(r,n,i)=>({channels:{text:{value:Eb(i,e)?.value}}}))}var Tut={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Aut={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},Mut={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},Eut={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Dut={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},H3=class extends Ft{constructor(t,r={}){let{x:n,y:i,z:o,curve:s,tension:a}=r;super(t,{x:{value:n,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:o,optional:!0}},r,Tut),this.curve=jb(s,a),_s(this,r)}render(t,r,n,i,o){let{x:s,y:a}=r,{x:c,y:l,z:u}=n,{curve:f}=this,[d,h]=rn(this,i),p=c?b=>c[b]:Qr(d),y=l?b=>l[b]:Qr(h),g=this;function m(b){let x=-1,_=[],v={};for(let S in n)v[S]=[];let w=[],I=[],D=[],A=[];function B(S,T){S=b[S],T=b[T],_.push(++x),w[x]=p(S),D[x]=y(S),I[x]=p(T),A[x]=y(T);for(let E in n)v[E].push(n[E][T])}let{halfedges:M,hull:O,triangles:R}=On.from(b,p,y);for(let S=0;S<M.length;++S){let T=M[S];T>S&&B(R[S],R[T])}for(let S=0;S<O.length;++S)B(O[S],O[(S+1)%O.length]);ae(this).selectAll().data(_).enter().append("path").call(Gt,g).attr("d",S=>{let T=Qn(),E=f(T);return E.lineStart(),E.point(w[S],D[S]),E.point(I[S],A[S]),E.lineEnd(),T}).call(ye,g,v).call(ul,g,v,o)}return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,{x:c&&s,y:l&&a}).call(u?b=>b.selectAll().data(Gr(t,x=>u[x]).values()).enter().append("g").each(m):b=>b.datum(t).each(m)).node()}},ox=class extends Ft{constructor(t,r={},n,i=({z:o})=>o){let{x:o,y:s}=r;super(t,{x:{value:o,scale:"x",optional:!0},y:{value:s,scale:"y",optional:!0},z:{value:i(r),optional:!0}},r,n)}render(t,r,n,i,o){let{x:s,y:a}=r,{x:c,y:l,z:u}=n,[f,d]=rn(this,i),h=c?m=>c[m]:Qr(f),p=l?m=>l[m]:Qr(d),y=this;function g(m){let b=On.from(m,h,p);ae(this).append("path").datum(m[0]).call(Gt,y).attr("d",y._render(b,i)).call(ye,y,n)}return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,{x:c&&s,y:l&&a}).call(u?m=>m.selectAll().data(Gr(t,b=>u[b]).values()).enter().append("g").each(g):m=>m.datum(t).each(g)).node()}},Z3=class extends ox{constructor(t,r={}){super(t,r,Aut),this.fill="none"}_render(t){return t.render()}},K3=class extends ox{constructor(t,r={}){super(t,r,Mut,Rn)}_render(t){return t.renderHull()}},Q3=class extends Ft{constructor(t,r={}){let{x:n,y:i,z:o}=r;super(t,{x:{value:n,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:o,optional:!0}},r,Eut)}render(t,r,n,i,o){let{x:s,y:a}=r,{x:c,y:l,z:u}=n,[f,d]=rn(this,i),h=c?m=>c[m]:Qr(f),p=l?m=>l[m]:Qr(d),y=this;function g(m){let b=On.from(m,h,p),x=XY(b,i);ae(this).selectAll().data(m).enter().append("path").call(Gt,y).attr("d",(_,v)=>x.renderCell(v)).call(ye,y,n)}return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,{x:c&&s,y:l&&a}).call(u?m=>m.selectAll().data(Gr(t,b=>u[b]).values()).enter().append("g").each(g):m=>m.datum(t).each(g)).node()}},J3=class extends ox{constructor(t,r){super(t,r,Dut),this.fill="none"}_render(t,r){return XY(t,r).render()}};function XY(e,t){let{width:r,height:n,marginTop:i,marginRight:o,marginBottom:s,marginLeft:a}=t;return e.voronoi([a,i,r-o,n-s])}function sx(e,t,{x:r,y:n,...i}={}){return[r,n]=gr(r,n),new e(t,{...i,x:r,y:n})}function HY(e,t){return sx(H3,e,t)}function ZY(e,t){return sx(Z3,e,t)}function KY(e,t){return sx(K3,e,t)}function QY(e,t){return sx(Q3,e,t)}function JY(e,t){return sx(J3,e,t)}var But={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1},ax=class extends Ft{constructor(t,{x:r,y:n,z:i,weight:o,fill:s,stroke:a,...c}={}){let l=tW(s)&&(s="currentColor",!0),u=tW(a)&&(a="currentColor",!0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:n,scale:"y",optional:!0},z:{value:Rn({z:i,fill:s,stroke:a}),optional:!0},weight:{value:o,optional:!0}},Nut({...c,fill:s,stroke:a},l,u),But),l&&(this.fill=void 0),u&&(this.stroke=void 0),this.z=i}filter(t){return t}render(t,r,n,i,o){let{contours:s}=n,a=xn();return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,{}).call(c=>c.selectAll().data(t).enter().append("path").call(Gt,this).call(ye,this,n).attr("d",l=>a(s[l]))).node()}};function eW(e,{x:t,y:r,...n}={}){return[t,r]=gr(t,r),new ax(e,{...n,x:t,y:r})}var Out=new Set(["x","y","z","weight"]);function Nut(e,t,r){let{bandwidth:i,thresholds:o}=e;return i=i===void 0?20:+i,o=o===void 0?20:typeof o?.[Symbol.iterator]=="function"?Cr(o):+o,Qe(e,function(s,a,c,l,u,f){let d=c.weight?Cr(c.weight.value):null,h=c.z?.value,{z:p}=this,[y,g]=rn(this,u),{width:m,height:b}=u,{x,y:_}=Au(c,l,f),v=Object.fromEntries(Object.entries(c).filter(([R])=>!Out.has(R)).map(([R,S])=>[R,{...S,value:[]}])),w=t&&[],I=r&&[],D=cB().x(x?R=>x[R]:y).y(_?R=>_[R]:g).weight(d?R=>d[R]:1).size([m,b]).bandwidth(i),A=[];for(let R of a){let S=[];A.push(S);for(let T of h?Bb(R,h,p):[R]){let E=D.contours(T);S.push([T,E])}}let B=o;if(!(B instanceof sd)){let R=0;for(let S of A)for(let[,T]of S){let E=T.max;E>R&&(R=E)}B=Float64Array.from({length:o-1},(S,T)=>R*100*(T+1)/o)}let M=[],O=[];for(let R of A){let S=[];M.push(S);for(let[T,E]of R)for(let C of B){S.push(O.length),O.push(E(C/100)),w&&w.push(C),I&&I.push(C);for(let U in v)v[U].value.push(c[U].value[T[0]])}}return w&&w.push(0),I&&I.push(0),{data:s,facets:M,channels:{...v,...w&&{fill:{value:w,scale:"color"}},...I&&{stroke:{value:I,scale:"color"}},contours:{value:O}}}})}function tW(e){return/^density$/i.test(e)}function iW(e,{x1:t,x2:r,y1:n,y2:i,x:o=t===void 0&&r===void 0?nr:void 0,y:s=n===void 0&&i===void 0?K:void 0,fill:a,positiveFill:c="#3ca951",negativeFill:l="#4269d0",fillOpacity:u=1,positiveFillOpacity:f=u,negativeFillOpacity:d=u,stroke:h,strokeOpacity:p,z:y=cr(h)[0],clip:g,tip:m,render:b,...x}={}){return[t,r]=rW(o,t,r),[n,i]=rW(s,n,i),t===r&&n===i&&(n=ku(0)),{tip:m}=xs({tip:m},"x"),Pr(Se(c)?null:Object.assign(qb(e,{x1:t,x2:r,y1:n,y2:i,z:y,fill:c,fillOpacity:f,render:$p(b,nW(!0)),clip:g,...x}),{ariaLabel:"positive difference"}),Se(l)?null:Object.assign(qb(e,{x1:t,x2:r,y1:n,y2:i,z:y,fill:l,fillOpacity:d,render:$p(b,nW(!1)),clip:g,...x}),{ariaLabel:"negative difference"}),Sd(e,{x:r,y:i,z:y,stroke:h,strokeOpacity:p,tip:m,clip:!0,...x}))}function rW(e,t,r){return t===void 0&&r===void 0?t=r=ku(e):t===void 0?(r=ku(r),t=e===void 0?r:ku(e)):r===void 0?(t=ku(t),r=e===void 0?t:ku(e)):(t=ku(t),r=ku(r)),[t,r]}function ku(e){let t,{value:r,label:n=vn(r)}=Mo(e);return{transform:i=>t||(t=Tt(i,r)),label:n}}function nW(e){return(t,r,n,i,o,s)=>{let{x1:a,x2:c}=n,{height:l}=i,u=new Float32Array(a.length),f=new Float32Array(c.length);(e===PI(r.y)<0?u:f).fill(l);let d=s(t,r,{...n,x2:a,y2:f},i,o),h=s(t,r,{...n,x1:c,y1:u},i,o),p=d.querySelector("g")??d,y=h.querySelector("g")??h;for(let g=0;p.firstChild;g+=2){let m=OI(),b=pt("svg:clipPath",o).attr("id",m).node();b.appendChild(p.firstChild),y.childNodes[g].setAttribute("clip-path",`url(#${m})`),y.insertBefore(b,y.childNodes[g])}return h}}var Fut={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},cx=class extends Ft{constructor(t,r={}){let[n,i]=Ae(r.r,3);super(t,{geometry:{value:r.geometry,scale:"projection"},r:{value:n,scale:"r",filter:ni,optional:!0}},Zb(r),Fut),this.r=i}render(t,r,n,i,o){let{geometry:s,r:a}=n,c=xn(o.projection??Lut(r)),{r:l}=this;return hu(l)?t=[]:l!==void 0&&c.pointRadius(l),pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,r).call(u=>{u.selectAll().data(t).enter().append("path").call(Gt,this).attr("d",a?f=>c.pointRadius(a[f])(s[f]):f=>c(s[f])).call(ye,this,n)}).node()}};function Lut({x:e,y:t}){if(e||t)return e??=r=>r,t??=r=>r,Gf({point(r,n){this.stream.point(e(r),t(n))}})}function BT(e,{geometry:t=K,...r}={}){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 cx(e,{geometry:t,...r})}function oW({strokeWidth:e=1.5,...t}={}){return BT({type:"Sphere"},{strokeWidth:e,...t})}function sW({strokeOpacity:e=.1,...t}={}){return BT(BB(),{strokeOpacity:e,...t})}var lm=.5,um=0;function aW(e={fill:"count"},{binWidth:t,...r}={}){let{z:n}=r;return t=t===void 0?20:Wt(t),e=qN(e,r),_a(e,"fill")&&(r.channels={...r.channels,fill:{value:[]}}),r.symbol===void 0&&(r.symbol="hexagon"),r.r===void 0&&!_a(e,"r")&&(r.r=t/2),Qe(r,(i,o,s,a,c,l)=>{let{x:u,y:f,z:d,fill:h,stroke:p,symbol:y}=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}=Au(s,a,l)),d=d?d.value:Tt(i,n),h=h?.value,p=p?.value,y=y?.value;let g=Mb(e,{z:d,fill:h,stroke:p,symbol:y}),m=d&&[],b=h&&[],x=p&&[],_=y&&[],v=[],w=[],I=[],D=-1;for(let O of e)O.initialize(i);for(let O of o){let R=[];for(let S of e)S.scope("facet",O);for(let[S,T]of vu(O,g))for(let{index:E,extent:C}of Rut(i,T,u,f,t)){R.push(++D),w.push(C.x),I.push(C.y),d&&m.push(g===d?S:d[E[0]]),h&&b.push(g===h?S:h[E[0]]),p&&x.push(g===p?S:p[E[0]]),y&&_.push(g===y?S:y[E[0]]);for(let U of e)U.reduce(E,C)}v.push(R)}let A=s.x.scale,B=s.y.scale,M={x:{value:w,source:a[A]?{value:fe(w,a[A].invert),scale:A}:null},y:{value:I,source:a[B]?{value:fe(I,a[B].invert),scale:B}:null},...d&&{z:{value:m}},...h&&{fill:{value:b,scale:"auto"}},...p&&{stroke:{value:x,scale:"auto"}},...y&&{symbol:{value:_,scale:"auto"}},...Object.fromEntries(e.map(({name:O,output:R})=>[O,{scale:"auto",label:R.label,radius:O==="r"?t/2:void 0,value:R.transform()}]))};return{data:i,facets:v,channels:M}})}function Rut(e,t,r,n,i){let o=i*(1.5/LN),s=new Map;for(let a of t){let c=r[a],l=n[a];if(isNaN(c)||isNaN(l))continue;let u=Math.round(l=(l-um)/o),f=Math.round(c=(c-lm)/i-(u&1)/2),d=l-u;if(Math.abs(d)*3>1){let y=c-f,g=f+(c<f?-1:1)/2,m=u+(l<u?-1:1),b=c-g,x=l-m;y*y+d*d>b*b+x*x&&(f=g+(u&1?1:-1)/2,u=m)}let h=`${f},${u}`,p=s.get(h);p===void 0&&(p={index:[],extent:{data:e,x:(f+(u&1)/2)*i+lm,y:u*o+um}},s.set(h,p)),p.index.push(a)}return s.values()}var kut={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};function cW(e){return new lx(e)}var lx=class extends Ft{constructor({binWidth:t=20,clip:r=!0,...n}={}){super(gu,void 0,{clip:r,...n},kut),this.binWidth=Wt(t)}render(t,r,n,i,o){let{binWidth:s}=this,{marginTop:a,marginRight:c,marginBottom:l,marginLeft:u,width:f,height:d}=i,h=u-lm,p=f-c-lm,y=a-um,g=d-l-um,m=s/2,b=m*RN,x=b/2,_=m*2,v=b*1.5,w=Math.floor(h/_),I=Math.ceil(p/_),D=Math.floor((y+x)/v),A=Math.ceil((g-x)/v)+1,B=`m0,${Cu(-b)}l${Cu(m)},${Cu(x)}v${Cu(b)}l${Cu(-m)},${Cu(x)}`,M=B;for(let O=D;O<A;++O)for(let R=w;R<I;++R)M+=`M${Cu(R*_+(O&1)*m)},${Cu(O*v)}${B}`;return pt("svg:g",o).datum(0).call(Kt,this,i,o).call(Pt,this,{},ur+lm,ur+um).call(O=>O.append("path").call(Gt,this).call(ye,this,n).attr("d",M)).node()}};function Cu(e){return Math.round(e*1e3)/1e3}var Cut={ariaLabel:"image",fill:null,stroke:null};function Uut(e){return/^\.*\//.test(e)}function Put(e){return/^(blob|data|file|http|https):/i.test(e)}function $ut(e){return typeof e=="string"&&(Uut(e)||Put(e))?[void 0,e]:[e,void 0]}var ux=class extends Ft{constructor(t,r={}){let{x:n,y:i,r:o,width:s,height:a,rotate:c,src:l,preserveAspectRatio:u,crossOrigin:f,frameAnchor:d,imageRendering:h}=r;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,y]=$ut(l),[g,m]=Ae(o),[b,x]=Ae(s,m!==void 0?m*2:void 0),[_,v]=Ae(a,m!==void 0?m*2:void 0),[w,I]=Ae(c,0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:g,scale:"r",filter:ni,optional:!0},width:{value:b,filter:ni,optional:!0},height:{value:_,filter:ni,optional:!0},rotate:{value:w,optional:!0},src:{value:p,optional:!0}},Zb(r),Cut),this.src=y,this.width=x,this.rotate=I,this.height=v,this.r=m,this.preserveAspectRatio=Ne(u,"xMidYMid"),this.crossOrigin=vr(f),this.frameAnchor=xa(d),this.imageRendering=Ne(h,"auto")}render(t,r,n,i,o){let{x:s,y:a}=r,{x:c,y:l,width:u,height:f,r:d,rotate:h,src:p}=n,{r:y,width:g,height:m,rotate:b}=this,[x,_]=rn(this,i);return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,{x:c&&s,y:l&&a}).call(v=>v.selectAll().data(t).enter().append("image").call(Gt,this).attr("x",lW(c,u,d,x,g,y)).attr("y",lW(l,f,d,_,m,y)).attr("width",u?w=>u[w]:g!==void 0?g:d?w=>d[w]*2:y*2).attr("height",f?w=>f[w]:m!==void 0?m:d?w=>d[w]*2:y*2).attr("transform",h?w=>`rotate(${h[w]})`:b?`rotate(${b})`:null).attr("transform-origin",h||b?Eu`${c?w=>c[w]:x}px ${l?w=>l[w]:_}px`:null).call(yt,"href",p?w=>p[w]:this.src).call(yt,"preserveAspectRatio",this.preserveAspectRatio).call(yt,"crossorigin",this.crossOrigin).call(yt,"image-rendering",this.imageRendering).call(yt,"clip-path",d?w=>`circle(${d[w]}px)`:y!==void 0?`circle(${y}px)`:null).call(ye,this,n)).node()}};function lW(e,t,r,n,i,o){return t&&e?s=>e[s]-t[s]/2:t?s=>n-t[s]/2:e&&i!==void 0?s=>e[s]-i/2:i!==void 0?n-i/2:r&&e?s=>e[s]-r[s]:r?s=>n-r[s]:e?s=>e[s]-o:n-o}function uW(e,{x:t,y:r,...n}={}){return n.frameAnchor===void 0&&([t,r]=gr(t,r)),new ux(e,{...n,x:t,y:r})}function zut(e,t,r){var n=1e-8,i=t-1,o=r-1,s=0,a,c,l,u,f,d,h,p,y,g,m;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&r>=1?(l=e<.5?e:1-e,u=Math.sqrt(-2*Math.log(l)),h=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(h=-h),p=(h*h-3)/6,y=2/(1/(2*t-1)+1/(2*r-1)),g=h*Math.sqrt(p+y)/y-(1/(2*r-1)-1/(2*t-1))*(p+5/6-2/(3*y)),h=t/(t+r*Math.exp(2*g))):(a=Math.log(t/(t+r)),c=Math.log(r/(t+r)),u=Math.exp(t*a)/t,f=Math.exp(r*c)/r,g=u+f,e<u/g?h=Math.pow(t*g*e,1/t):h=1-Math.pow(r*g*(1-e),1/r)),m=-fm(t)-fm(r)+fm(t+r);s<10;s++){if(h===0||h===1)return h;if(d=Vut(h,t,r)-e,u=Math.exp(i*Math.log(h)+o*Math.log(1-h)+m),f=d/u,h-=u=f/(1-.5*Math.min(1,f*(i/h-o/(1-h)))),h<=0&&(h=.5*(h+u)),h>=1&&(h=.5*(h+u+1)),Math.abs(u)<n*h&&s>0)break}return h}function Vut(e,t,r){var n=e===0||e===1?0:Math.exp(fm(t+r)-fm(t)-fm(r)+t*Math.log(e)+r*Math.log(1-e));return e<0||e>1?!1:e<(t+1)/(t+r+2)?n*fW(e,t,r)/t:1-n*fW(1-e,r,t)/r}function fW(e,t,r){var n=1e-30,i=1,o=t+r,s=t+1,a=t-1,c=1,l=1-o*e/s,u,f,d,h;for(Math.abs(l)<n&&(l=n),l=1/l,h=l;i<=100&&(u=2*i,f=i*(r-i)*e/((a+u)*(t+u)),l=1+f*l,Math.abs(l)<n&&(l=n),c=1+f/c,Math.abs(c)<n&&(c=n),l=1/l,h*=l*c,f=-(t+i)*(o+i)*e/((t+u)*(s+u)),l=1+f*l,Math.abs(l)<n&&(l=n),c=1+f/c,Math.abs(c)<n&&(c=n),l=1/l,d=l*c,h*=d,!(Math.abs(d-1)<3e-7));i++);return h}function fm(e){var t=0,r=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],n=1.000000000190015,i,o,s;for(s=(o=i=e)+5.5,s-=(i+.5)*Math.log(s);t<6;t++)n+=r[t]/++o;return Math.log(2.506628274631*n/i)-s}function dW(e,t){var r=zut(2*Math.min(e,1-e),.5*t,.5);return r=Math.sqrt(t*(1-r)/r),e>.5?r:-r}var jut={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},OT=class extends Ft{constructor(t,r={}){let{x:n,y:i,z:o,ci:s=.95,precision:a=4}=r;if(super(t,{x:{value:n,scale:"x"},y:{value:i,scale:"y"},z:{value:Rn(r),optional:!0}},r,jut),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,r,n,i,o){let{x:s,y:a,z:c}=n,{ci:l}=this;return pt("svg:g",o).call(Kt,this,i,o).call(Pt,this,r).call(u=>u.selectAll().data(c?Bb(t,c,this.z):[t]).enter().call(f=>f.append("path").attr("fill","none").call(Gt,this).call(fd,this,{...n,fill:null,fillOpacity:null}).attr("d",d=>this._renderLine(d,s,a)).call(l&&!ol(this.fill)?d=>d.select(qut).attr("stroke","none").call(Gt,this).call(fd,this,{...n,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",h=>this._renderBand(h,s,a)):()=>{}))).node()}};function qut(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(bo.svg,"path"),this)}var tF=class extends OT{constructor(t,r){super(t,r)}_renderBand(t,r,n){let{ci:i,precision:o}=this,[s,a]=Be(t,u=>n[u]),c=NT(t,n,r),l=mW(t,n,r,(1-i)/2,c);return dp().y(u=>u).x0(u=>l(u,-1)).x1(u=>l(u,1))(_r(s,a-o/2,o).concat(a))}_renderLine(t,r,n){let[i,o]=Be(t,a=>n[a]),s=NT(t,n,r);return`M${s(i)},${i}L${s(o)},${o}`}},eF=class extends OT{constructor(t,r){super(t,r)}_renderBand(t,r,n){let{ci:i,precision:o}=this,[s,a]=Be(t,u=>r[u]),c=NT(t,r,n),l=mW(t,r,n,(1-i)/2,c);return dp().x(u=>u).y0(u=>l(u,-1)).y1(u=>l(u,1))(_r(s,a-o/2,o).concat(a))}_renderLine(t,r,n){let[i,o]=Be(t,a=>r[a]),s=NT(t,r,n);return`M${i},${s(i)}L${o},${s(o)}`}};function hW(e,{y:t=nr,x:r=K,stroke:n,fill:i=Se(n)?"currentColor":n,...o}={}){return new tF(e,Xp({...o,x:r,y:t,fill:i,stroke:n}))}function pW(e,{x:t=nr,y:r=K,stroke:n,fill:i=Se(n)?"currentColor":n,...o}={}){return new eF(e,Gp({...o,x:t,y:r,fill:i,stroke:n}))}function NT(e,t,r){let n=0,i=0,o=0,s=0;for(let u of e){let f=t[u],d=r[u];n+=f,i+=d,o+=f*d,s+=f*f}let a=e.length,c=(a*o-n*i)/(a*s-n*n),l=(i-c*n)/a;return u=>c*u+l}function mW(e,t,r,n,i){let o=gn(e,u=>t[u])/e.length,s=0,a=0;for(let u of e)s+=(t[u]-o)**2,a+=(r[u]-i(t[u]))**2;let c=Math.sqrt(a/(e.length-2)),l=dW(n,e.length-2);return(u,f)=>{let d=i(u),h=c*Math.sqrt(1/e.length+(u-o)**2/s);return d+f*l*h}}function fx({path:e=K,delimiter:t,frameAnchor:r,treeLayout:n=Xf,treeSort:i,treeSeparation:o,treeAnchor:s,treeFilter:a,...c}={}){s=kT(s),i=bW(i),a!=null&&(a=nF(a)),r===void 0&&(r=s.frameAnchor);let l=xW(t),u=AW(c,nF),[f,d]=tn(),[h,p]=tn();return{x:f,y:h,frameAnchor:r,...en(c,(y,g)=>{let m=l(Tt(y,e)),b=d([]),x=p([]),_=-1,v=[],w=[],I=BS().path(A=>m[A]),D=n();D.nodeSize&&D.nodeSize([1,1]),D.separation&&o!==void 0&&D.separation(o??wb);for(let A of u)A[LT]=A[IW]([]);for(let A of g){let B=[],M=I(A.filter(O=>m[O]!=null)).each(O=>O.data=y[O.data]);i!=null&&M.sort(i),D(M);for(let O of M.descendants())if(!(a!=null&&!a(O))){B.push(++_),v[_]=O.data,s.position(O,_,b,x);for(let R of u)R[LT][_]=R[TW](O)}w.push(B)}return{data:v,facets:w}}),...Object.fromEntries(u)}}function RT({path:e=K,delimiter:t,curve:r="bump-x",stroke:n="#555",strokeWidth:i=1.5,strokeOpacity:o=.5,treeLayout:s=Xf,treeSort:a,treeSeparation:c,treeAnchor:l,treeFilter:u,...f}={}){l=kT(l),a=bW(a),u!=null&&(u=gW(u)),f={curve:r,stroke:n,strokeWidth:i,strokeOpacity:o,...f};let d=xW(t),h=AW(f,gW),[p,y]=tn(),[g,m]=tn(),[b,x]=tn(),[_,v]=tn();return{x1:p,x2:g,y1:b,y2:_,...en(f,(w,I)=>{let D=d(Tt(w,e)),A=y([]),B=m([]),M=x([]),O=v([]),R=-1,S=[],T=[],E=BS().path(U=>D[U]),C=s();C.nodeSize&&C.nodeSize([1,1]),C.separation&&c!==void 0&&C.separation(c??wb);for(let U of h)U[LT]=U[IW]([]);for(let U of I){let k=[],$=E(U.filter(z=>D[z]!=null)).each(z=>z.data=w[z.data]);a!=null&&$.sort(a),C($);for(let{source:z,target:V}of $.links())if(!(u!=null&&!u(V,z))){k.push(++R),S[R]=V.data,l.position(z,R,A,M),l.position(V,R,B,O);for(let Q of h)Q[LT][R]=Q[TW](V,z)}T.push(k)}return{data:S,facets:T}}),...Object.fromEntries(h)}}function kT(e="left"){switch(`${e}`.trim().toLowerCase()){case"left":return Yut;case"right":return Wut}throw new Error(`invalid tree anchor: ${e}`)}var Yut={frameAnchor:"left",dx:6,position({x:e,y:t},r,n,i){n[r]=t,i[r]=-e}},Wut={frameAnchor:"right",dx:-6,position({x:e,y:t},r,n,i){n[r]=-t,i[r]=-e}};function bW(e){return e==null||typeof e=="function"?e:`${e}`.trim().toLowerCase().startsWith("node:")?yW(nF(e)):yW(Gut(e))}function yW(e){return(t,r)=>Kr(e(t),e(r))}function Gut(e){return t=>t.data?.[e]}function xW(e="/"){if(e=`${e}`,e==="/")return r=>r;if(e.length!==1)throw new Error("delimiter must be exactly one character");let t=e.charCodeAt(0);return r=>r.map(n=>Xut(n,t))}var rF=92,_W=47;function Xut(e,t){if(t===rF)throw new Error("delimiter cannot be backslash");let r=!1;for(let n=0,i=e.length;n<i;++n){switch(e.charCodeAt(n)){case rF:if(!r){r=!0;continue}break;case t:r?(e=e.slice(0,n-1)+e.slice(n),--n,--i):e=e.slice(0,n)+"/"+e.slice(n+1);break;case _W:r?(e=e.slice(0,n)+"\\\\"+e.slice(n),n+=2,i+=2):(e=e.slice(0,n)+"\\"+e.slice(n),++n,++i);break}r=!1}return e}function Hut(e){let t=!1;for(let r=0,n=e.length;r<n;++r){switch(e.charCodeAt(r)){case rF:if(!t){t=!0;continue}case _W:t&&(e=e.slice(0,r-1)+e.slice(r),--r,--n);break}t=!1}return e}function wW(e){return Jr(e)&&typeof e.node=="function"}function Zut(e){return Jr(e)&&typeof e.link=="function"}function nF(e){if(wW(e))return e.node;if(e=`${e}`.trim().toLowerCase(),!!e.startsWith("node:")){switch(e){case"node:name":return oF;case"node:path":return iF;case"node:internal":return vW;case"node:external":return SW;case"node:depth":return sF;case"node:height":return aF}throw new Error(`invalid node value: ${e}`)}}function gW(e){if(wW(e))return e.node;if(Zut(e))return e.link;if(e=`${e}`.trim().toLowerCase(),!(!e.startsWith("node:")&&!e.startsWith("parent:"))){switch(e){case"parent:name":return FT(oF);case"parent:path":return FT(iF);case"parent:depth":return FT(sF);case"parent:height":return FT(aF);case"node:name":return oF;case"node:path":return iF;case"node:internal":return vW;case"node:external":return SW;case"node:depth":return sF;case"node:height":return aF}throw new Error(`invalid link value: ${e}`)}}function iF(e){return e.id}function oF(e){return Kut(e.id)}function sF(e){return e.depth}function aF(e){return e.height}function vW(e){return!!e.children}function SW(e){return!e.children}function FT(e){return(t,r)=>r==null?void 0:e(r)}function Kut(e){let t=e.length;for(;--t>0&&!Qut(e,t););return Hut(e.slice(t+1))}function Qut(e,t){if(e[t]==="/"){let r=0;for(;t>0&&e[--t]==="\\";)++r;if(!(r&1))return!0}return!1}var IW=2,TW=3,LT=4;function AW(e,t){let r=[];for(let n in e){let i=e[n],o=t(i);o!==void 0&&r.push([n,...tn(i),o])}return r}function cF(e,{fill:t,stroke:r,strokeWidth:n,strokeOpacity:i,strokeLinejoin:o,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:l,marker:u,markerStart:f=u,markerEnd:d=u,dot:h=Se(f)&&Se(d),text:p="node:name",textStroke:y="var(--plot-background)",title:g="node:path",dx:m,dy:b,textAnchor:x,treeLayout:_=Xf,textLayout:v=_===Xf||_===ES?"mirrored":"normal",tip:w,...I}={}){if(m===void 0&&(m=kT(I.treeAnchor).dx),x!==void 0)throw new Error("textAnchor is not a configurable tree option");v=Ur(v,"textLayout",["mirrored","normal"]);function D(A){return va(e,fx({treeLayout:_,text:p,fill:t===void 0?"currentColor":t,stroke:y,dx:m,dy:b,title:g,...A,...I}))}return Pr(_T(e,RT({treeLayout:_,markerStart:f,markerEnd:d,stroke:r!==void 0?r:t===void 0?"node:internal":t,strokeWidth:n,strokeOpacity:i,strokeLinejoin:o,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:l,...I})),h?Do(e,fx({treeLayout:_,fill:t===void 0?"node:internal":t,title:g,tip:w,...I})):null,p!=null?v==="mirrored"?[D({textAnchor:"start",treeFilter:"node:external"}),D({textAnchor:"end",treeFilter:"node:internal",dx:-m})]:D():null)}function MW(e,t){return cF(e,{...t,treeLayout:ES})}function EW({geometry:e=K,...t}={}){return Qe({...t,x:null,y:null},(r,n,i,o,s,{projection:a})=>{let c=Tt(r,e),l=c.length,u=new Float64Array(l),f=new Float64Array(l),d=xn(a);for(let h=0;h<l;++h)[u[h],f[h]]=d.centroid(c[h]);return{data:r,facets:n,channels:{x:{value:u,scale:a==null?"x":null,source:null},y:{value:f,scale:a==null?"y":null,source:null}}}})}function DW({geometry:e=K,...t}={}){let r;return{...t,x:{transform:n=>Float64Array.from(r=Tt(Tt(n,e),IB),([i])=>i)},y:{transform:()=>Float64Array.from(r,([,n])=>n)}}}var $W=lX(PW(),1);var sft=({marginLeft:e})=>[1,e],aft=({width:e,marginRight:t})=>[-1,e-t],cft=({width:e,marginLeft:t,marginRight:r})=>[0,(t+e-r)/2],lft=({marginTop:e})=>[1,e],uft=({height:e,marginBottom:t})=>[-1,e-t],fft=({height:e,marginTop:t,marginBottom:r})=>[0,(t+e-r)/2];function zW(e){return typeof e=="string"?{anchor:e}:e}function VW(e={},t={}){arguments.length===1&&([e,t]=qW(e));let{anchor:r="left",padding:n=1,r:i=t.r}=zW(e);switch(`${r}`.toLowerCase()){case"left":r=sft;break;case"right":r=aft;break;case"middle":r=cft;break;default:throw new Error(`unknown dodge anchor: ${r}`)}return YW("x","y",r,Wt(n),i,t)}function jW(e={},t={}){arguments.length===1&&([e,t]=qW(e));let{anchor:r="bottom",padding:n=1,r:i=t.r}=zW(e);switch(`${r}`.toLowerCase()){case"top":r=lft;break;case"bottom":r=uft;break;case"middle":r=fft;break;default:throw new Error(`unknown dodge anchor: ${r}`)}return YW("y","x",r,Wt(n),i,t)}function qW(e){let{anchor:t,padding:r,...n}=e,{r:i}=n;return[{anchor:t,padding:r,r:i},n]}function YW(e,t,r,n,i,o){if(i!=null&&typeof i!="number"){let{channels:s,sort:a,reverse:c}=o;s=Sb(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 Qe(o,function(s,a,c,l,u,f){let{[t]:d,r:h}=c;if(!c[t])throw new Error(`missing channel: ${t}`);({[t]:d}=Au(c,l,f));let p=h?void 0:i!==void 0?Wt(i):this.r!==void 0?this.r:3;h&&(h=Tt(h.value,l[h.scale]||K,Float64Array));let[y,g]=r(u),m=y?hft:dft,b=new Float64Array(d.length),x=h?_=>h[_]:()=>p;for(let _ of a){let v=(0,$W.default)();_=_.filter(h?I=>gp(d[I])&&ni(h[I]):I=>gp(d[I]));let w=new Float64Array(2*_.length+2);for(let I of _){let D=x(I),A=y?D+n:0,B=d[I]-D,M=d[I]+D,O=2;v.queryInterval(B-n,M+n,([,,S])=>{let T=b[S]-A,E=d[I]-d[S],C=n+(h?h[I]+h[S]:2*p),U=Math.sqrt(C*C-E*E);w[O++]=T-U,w[O++]=T+U});let R=w.slice(0,O);y&&(R=R.filter(S=>S>=0));t:for(let S of R.sort(m)){for(let T=0;T<O;T+=2)if(w[T]+1e-6<S&&S<w[T+1]-1e-6)continue t;b[I]=S+A;break}v.insert([B,M,I])}}y||(y=1);for(let _ of a)for(let v of _)b[v]=b[v]*y+g;return{data:s,facets:a,channels:{[e]:{value:b,source:null},[t]:{value:d,source:c[t]},...h&&{r:{value:h,source:c.r}}}}})}function dft(e,t){return Math.abs(e)-Math.abs(t)}function hft(e,t){return e-t}function GW(e,t){return arguments.length===1&&({basis:e,...t}=e),om(PT(e),t)}function XW(e,t){return arguments.length===1&&({basis:e,...t}=e),sm(PT(e),t)}function PT(e){if(e===void 0)return WW;if(typeof e=="function")return $T(Ip(e));if(/^p\d{2}$/i.test(e))return mm(vp(e));switch(`${e}`.toLowerCase()){case"deviation":return yft;case"first":return WW;case"last":return mft;case"max":return gft;case"mean":return bft;case"median":return xft;case"min":return _ft;case"sum":return wft;case"extent":return pft}throw new Error(`invalid basis: ${e}`)}function $T(e){return{mapIndex(t,r,n){let i=+e(t,r);for(let o of t)n[o]=r[o]===null?NaN:r[o]/i}}}function mm(e){return $T((t,r)=>e(t,n=>r[n]))}var pft={mapIndex(e,t,r){let[n,i]=Be(e,s=>t[s]),o=i-n;for(let s of e)r[s]=t[s]===null?NaN:(t[s]-n)/o}},WW=$T((e,t)=>{for(let r=0;r<e.length;++r){let n=t[e[r]];if(wr(n))return n}}),mft=$T((e,t)=>{for(let r=e.length-1;r>=0;--r){let n=t[e[r]];if(wr(n))return n}}),yft={mapIndex(e,t,r){let n=Lc(e,o=>t[o]),i=go(e,o=>t[o]);for(let o of e)r[o]=t[o]===null?NaN:i?(t[o]-n)/i:0}},gft=mm(de),bft=mm(Lc),xft=mm(hs),_ft=mm(Oe),wft=mm(gn);function HW(e,t){return vft("x",e,t)}function vft(e,t,r={}){let n,i=1;if(typeof t=="number")i=t,n=(l,u)=>+l+u;else{if(typeof t=="string"){let l=t.startsWith("-")?-1:1;[t,i]=gI(t.replace(/^[+-]/,"")),i*=l}t=Ap(t),n=(l,u)=>t.offset(l,u)}let o=`${e}1`,s=`${e}2`,a=Ii({[o]:l=>l.map(u=>n(u,i)),[s]:l=>l},r),c=a[s].transform;return a[s].transform=()=>{let l=c(),[u,f]=Be(l);return l.domain=i<0?[u,n(f,i)]:[n(u,i),f],l},a}function ZW(e,t={}){if(typeof e=="string")switch(e.toLowerCase()){case"first":return pF(t);case"last":return mF(t)}if(typeof e=="function")return Uu(null,e,t);let r,n;for(r in e){if(n!==void 0)throw new Error("ambiguous selector; multiple inputs");n=Sft(e[r])}if(n===void 0)throw new Error(`invalid selector: ${e}`);return Uu(r,n,t)}function Sft(e){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"min":return yF;case"max":return gF}throw new Error(`unknown selector: ${e}`)}function pF(e){return Uu(null,Ift,e)}function mF(e){return Uu(null,Tft,e)}function KW(e){return Uu("x",yF,e)}function QW(e){return Uu("y",yF,e)}function JW(e){return Uu("x",gF,e)}function tG(e){return Uu("y",gF,e)}function*Ift(e){yield e[0]}function*Tft(e){yield e[e.length-1]}function*yF(e,t){yield dv(e,r=>t[r])}function*gF(e,t){yield Of(e,r=>t[r])}function Uu(e,t,r){if(e!=null){if(r[e]==null)throw new Error(`missing channel: ${e}`);e=r[e]}let n=Rn(r);return en(r,(i,o)=>{let s=Tt(i,n),a=Tt(i,e),c=[];for(let l of o){let u=[];for(let f of s?Gr(l,d=>s[d]).values():[l])for(let d of t(f,a))u.push(d);c.push(u)}return{data:i,facets:c}})}var Aft=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 Mft(e,t,r){for(let n=0;n<t.length;++n){let i=t[n];n===t.length-1?e[i]=r:e=e[i]||(e[i]={})}}function eG(e,t,r){for(let n in e){let i=Aft.get(n);if(i==null)throw new Error(`Unrecognized plot attribute: ${n}`);let o=e[n];typeof o=="symbol"?r.push(n):o!==void 0&&Mft(t,i.split("."),o)}}var Eft=new Set(["frame","hexgrid","sphere","graticule"]);async function nG(e){let t={marks:[]},r=[],{attributes:n,marks:i}=e;eG(n,t,r);let o=[];for(let a of i)for(let{type:c,data:l,options:u}of a.plotSpecs())Eft.has(c)?t.marks.push(zT[c](u)):t.marks.push(zT[c](l,u)),o.push(a.index);Bft(t,e);let s=Vb(t);Oft(s,o),Dft(e,s,n,r);for(let a of e.interactors)await a.init(s);return s}function Dft(e,t,r,n){n.forEach(i=>{let o=r[i];if(o===Gs){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,r[`${s}Reverse`]?a.domain.slice().reverse():a.domain)}else throw new Error(`Unrecognized symbol: ${o}`)})}function Bft(e,t){let{marks:r}=t;VT("x",e,r,["x","x1","x2"]),VT("y",e,r,["y","y1","y2"]),VT("fx",e,r),VT("fy",e,r)}function VT(e,t,r,n=[e]){let i=t[e]||{};if(i.axis===null||i.label!==void 0)return;let o=r.map(u=>u.channelField(n)?.field);if(o.every(u=>u==null))return;let s,a,c;for(let u=0;u<o.length;++u){let{column:f,label:d}=o[u]||{};f===void 0&&d===void 0||(s===void 0&&a===void 0?(s=f,a=d,c=Nft(r[u].data,n)||"number"):a!==d?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 Oft(e,t){let r=e.querySelectorAll('g[aria-label="facet"]');if(r.length)for(let n of r)rG(n,t);else rG(e,t)}function rG(e,t){let r=-1;for(let n of e.children){let i=n.getAttribute("aria-label")||"";n.nodeName==="style"||i.includes("-axis")||i.includes("-grid")||n.setAttribute("data-index",t[++r])}}function Nft(e,t){for(let r of e)for(let n=0;n<t.length;++n){let i=r[t[n]];if(i!=null)return i instanceof Date?"date":typeof i}}var Fft={width:640,marginLeft:40,marginRight:20,marginTop:20,marginBottom:30},px=class{constructor(t){this.attributes={...Fft},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=xD()}margins(){return{left:this.getAttribute("marginLeft"),top:this.getAttribute("marginTop"),bottom:this.getAttribute("marginBottom"),right:this.getAttribute("marginRight")}}innerWidth(){let{left:t,right:r}=this.margins();return this.getAttribute("width")-t-r}innerHeight(t=400){let{top:r,bottom:n}=this.margins(),i=this.getAttribute("height");return i==null&&t!=null&&(i=t,this.setAttribute("height",i,{silent:!0})),i-r-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 nG(this),r=this.legends.flatMap(({legend:n,include:i})=>{let o=n.init(t);return i?o:[]});this.element.replaceChildren(t,...r),this.synch.resolve()}getAttribute(t){return this.attributes[t]}setAttribute(t,r,n){return Ry(this.attributes[t],r)?(r===void 0?delete this.attributes[t]:this.attributes[t]=r,n?.silent||this.listeners?.get(t)?.forEach(i=>i(t,r)),!0):!1}addAttributeListener(t,r){let n=this.listeners||(this.listeners=new Map);return n.has(t)||n.set(t,new Set),n.get(t).add(r),this}removeAttributeListener(t,r){return this.listeners?.get(t)?.delete(r)}addParams(t,r){let{params:n}=this;for(let i of r)n.has(i)?n.get(i).push(t):(n.set(i,[t]),i.addEventListener("value",()=>Promise.allSettled(n.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,r=!0){t.setPlot(this),this.legends.push({legend:t,include:r})}};function jT(e){return typeof e!="string"?!1:(e=e.toLowerCase().trim(),e==="none"||e==="currentcolor"||e.startsWith("url(")&&e.endsWith(")")||e.startsWith("var(")&&e.endsWith(")")||Vi(e)!==null)}var Lft=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 iG(e){return Lft.has(e)}var Rft=new Set(["asterisk","circle","cross","diamond","diamond2","hexagon","plus","square","square2","star","times","triangle","triangle2","wye"]);function oG(e){return Rft.has(`${e}`.toLowerCase())}function mx(e){return typeof e?.getChild=="function"}function sG(e){switch(e.typeId){case 2:case 3:case 7:return Float64Array;default:return Array}}function aG(e){let{typeId:t}=e;return t===10?r=>r==null?r:new Date(r):t===2&&e.bitWidth>=64?r=>r==null?r:Number(r):r=>r}function yx(e){let{type:t}=e,{typeId:r}=t;if(r===2&&t.bitWidth>=64){let n=e.length,i=new Float64Array(n);for(let o=0;o<n;++o){let s=e.get(o);i[o]=s==null?NaN:Number(s)}return i}return e.toArray()}function qT(e){return mx(e)?kft(e):e}function kft(e){let{batches:t,numRows:r}=e;if(!r)return[];let n=Array.from({length:r},()=>({}));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:d,type:h}=a.fields[u],p=aG(h);for(let y=i,g=0;g<c;++g,++y)n[y][d]=p(f.get(g))}i+=c}return n}var cG=e=>e==="stroke"||e==="fill",Cft=e=>e==="symbol",Uft=(e,t)=>e!=="sort"&&e!=="tip"&&t!=null&&!Array.isArray(t),bF=(e,t)=>({channel:e,field:t,as:t instanceof mi?t.column:e}),xF=(e,t)=>({channel:e,value:t}),YT=e=>Array.isArray(e),Sn=class extends ai{constructor(t,r,n,i={}){super(r?.options?.filterBy),this.type=t,this.reqs=i,this.source=r,YT(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 d in u)s.add(d),c(d,u[d]);else if(f==="function"&&u[Rg]){let d=u(this,l);for(let h in d)c(h,d[h])}else if(f==="string")iG(l)||cG(l)&&jT(u)||Cft(l)&&oG(u)?o.push(xF(l,u)):o.push(bF(l,El(u)));else if(rc(u))if(Array.isArray(u.columns))o.push(bF(l,u)),a.add(u);else{let d=xF(l,u.value);o.push(d),u.addEventListener("value",h=>(d.value=h,this.update()))}else f==="object"&&Uft(l,u)?o.push(bF(l,u)):u!==void 0&&o.push(xF(l,u))};for(let l in n)c(l,n[l])}setPlot(t,r){this.plot=t,this.index=r,t.addParams(this,this.params),this.source?.table&&this.queryPending()}hasOwnData(){return this.source==null||YT(this.source)}channel(t){return this.channels.find(r=>r.channel===t)}channelField(...t){let r=t.flat();for(let n of r){let i=this.channel(n);if(i?.field)return i}return null}fields(){if(this.hasOwnData())return null;let{source:{table:t},channels:r,reqs:n}=this,i=new Map;for(let{channel:o,field:s}of r){let a=s?.column;if(a){if(s.stats?.length||n[o]){i.has(a)||i.set(a,new Set);let c=i.get(a);n[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((r,n)=>(r[n.column]=n,r),Object.create(null)),this}query(t=[]){if(this.hasOwnData())return null;let{channels:r,source:{table:n}}=this;return _F(r,n).where(t)}queryPending(){return this.plot.pending(this),this}queryResult(t){return this.data=qT(t),this}update(){return this.plot.update(this)}plotSpecs(){let{type:t,data:r,detail:n,channels:i}=this,o={},s={};for(let a of i){let c=n.has(a.channel)?s:o;c[a.channel]=Bo(a)}return n.size&&(o.channels=s),[{type:t,data:r,options:o}]}};function Bo(e){return Object.hasOwn(e,"value")?e.value:cG(e.channel)?{value:e.as,scale:"color"}:e.as}function _F(e,t,r=[]){let n=Mt.from({source:t}),i=new Set,o=!1;for(let s of e){let{channel:a,field:c,as:l}=s;if(!r.includes(a)){if(a==="orderby")n.orderby(s.value);else if(c){if(c.aggregate)o=!0;else{if(i.has(l))continue;i.add(l)}n.select({[l]:c})}}}return o&&n.groupby(Array.from(i)),n}function Ad(e,t){let{plot:r}=e,n=r.getAttribute(`${t}Scale`);if(!n){let{field:o}=e.channelField(t,`${t}1`,`${t}2`),{type:s}=e.stats[o.column];n=s==="date"?"time":"linear"}let i={type:n};switch(n){case"log":i.base=r.getAttribute(`${t}Base`)??10;break;case"pow":i.exponent=r.getAttribute(`${t}Exponent`)??1;break;case"symlog":i.constant=r.getAttribute(`${t}Constant`)??1;break}return Fy(i)}function Qi(e,t,r,n,i=1,o){let{field:s}=e.channelField(t);o=o??s;let{type:a,apply:c,sqlApply:l}=Ad(e,t),u=!!e.plot.getAttribute(`${t}Reverse`),[f,d]=n.map(b=>c(b)),h=l(o),p=a==="time"||a==="utc"?h:o,y=d===f?0:(r-i)/(d-f),g=y!==1?` * ${y}::DOUBLE`:"";return[u?W`(${d} - ${h}::DOUBLE)${g}`:W`(${h}::DOUBLE - ${f})${g}`,p]}var wF={x:["min","max"]},vF={y:["min","max"]},WT={...wF,...vF};function lG(e,t,r,n,i){let{plot:o,stats:s}=e,a=o.getAttribute(n),c=o.getAttribute(i);if(Array.isArray(a)&&!a[pn])return a;{let{field:l}=e.channelField(r),{column:u}=l,{min:f,max:d}=s[u],h=SF(t,u)||(c?qc().domain([f,d]).nice().domain():[f,d]);return a!==Gs&&(h[pn]=!0),o.setAttribute(n,h,{silent:!0}),h}}function Ma(e,t){return lG(e,t,"x","xDomain","xNice")}function Ea(e,t){return lG(e,t,"y","yDomain","yNice")}function SF(e,t){if(!e)return;let r,n,i=(o,s)=>{if(o==="BETWEEN"&&s.field.column===t){let{range:a}=s;a&&(r==null||a[0]<r)&&(r=a[0]),a&&(n==null||a[1]>n)&&(n=a[1])}};return Array.isArray(e)?e.forEach(o=>o.visit?.(i)):e.visit&&e.visit(i),r!=null&&n!=null&&r!==n?[r,n]:void 0}var gx=class extends Sn{constructor(t,r,n){let i=t.endsWith("X")?"y":t.endsWith("Y")?"x":null,o={[i]:["min","max"]};super(t,r,n,o),this.dim=i}query(t=[]){let{plot:r,dim:n,source:i,stats:o}=this,{optimize:s=!0}=i.options||{},a=super.query(t);if(!n)return a;let c=n==="x"?"y":"x",l=this.channelField(c)?.as,{field:u,as:f}=this.channelField(n),{type:d}=o[u.column];if(s&&(d==="date"||d==="number")&&l){let{column:p}=u,{max:y,min:g}=o[p],m=n==="x"?r.innerWidth():r.innerHeight(),[b,x]=SF(t,p)||[g,y],[_]=Qi(this,n,m,[b,x],1,f),v=a.select().map(w=>w.as).filter(w=>w!==f&&w!==l);return Pft(a,_,f,l,v)}else return a.orderby(u)}};function Pft(e,t,r,n,i=[]){let o=W`FLOOR(${t})::INTEGER`,s=a=>Mt.from(e).select(a).groupby(o,i);return Mt.union(s([{[r]:ao(r),[n]:Jd(n,r)},...i]),s([{[r]:so(r),[n]:th(n,r)},...i]),s([{[r]:Jd(r,n),[n]:ao(n)},...i]),s([{[r]:th(r,n),[n]:so(n)},...i])).orderby(i,r)}function uG(e,t="density"){return mx(e)?sG(e.getChild(t).type):typeof e[0][t]=="number"?Float64Array:Array}function fG(e,t){let r=uG(t);return $ft(new r(e),t)}function $ft(e,t,r="density"){if(mx(t)){let n=t.numRows;if(n===0)return e;let i=yx(t.getChild("index")),o=yx(t.getChild(r));for(let s=0;s<n;++s)e[i[s]]=o[s]}else for(let n of t)e[n.index]=n[r];return e}function dG(e,t,r,n,i=[],o){let s=e*t,a=n.map(m=>uG(r,m)),c=n.length,l=m=>{let b={};return i.forEach((x,_)=>b[x]=m[_]),n.forEach((x,_)=>b[x]=new a[_](s)),b},u={},f=i.length?null:u[[]]=l([]),d=i.length?m=>u[m]??(u[m]=l(m)):()=>f,h=r.numRows;if(h===0)return Object.values(u);let p=yx(r.getChild("index")),y=n.map(m=>yx(r.getChild(m))),g=i.map(m=>r.getChild(m));if(o){let m=p.map(x=>x%e),b=p.map(x=>Math.floor(x/e));if(i.length)for(let x=0;x<h;++x){let _=g.map(w=>w.get(x)),v=d(_);v.index||(v.index=[]),v.index.push(x)}else f.index=p.map((x,_)=>_);Object.values(u).forEach(x=>{for(let _=0;_<c;++_)o(x.index,e,t,m,b,y[_],x[n[_]]);delete x.index})}else for(let m=0;m<h;++m){let b=g.map(_=>_.get(m)),x=d(b);for(let _=0;_<c;++_)x[n[_]][p[m]]=y[_][m]}return Object.values(u)}function bx(e,t){let r=0,n=0;return e.forEach(i=>{let o=i[t],s=o.length;for(let a=0;a<s;++a){let c=o[a];c<r&&(r=c),c>n&&(n=c)}}),r===0&&n===0?[0,1]:[r,n]}function hG(e,t){let r=new Xn;return e.forEach(n=>{let i=n[t],o=i.length;for(let s=0;s<o;++s)r.add(i[s])}),Array.from(r).sort(ie)}function In(e,t,r,n){yi(r)?(n=n||(()=>e.requestUpdate()),r.addEventListener("value",i=>(e[t]=i,n())),e[t]=r.value):e[t]=r}function xx(e,t=!1){let r=new Float64Array(5),n=new Float64Array(4);zft(r,n,e);let i=Float64Array.of(0,n[1]-r[1]*n[0],n[2]-r[2]*n[0],n[3]-r[3]*n[0],-r[4]*n[0]),o=1+r[1]+r[2]+r[3]+r[4],s=(n[0]+n[1]+n[2]+n[3])/o,a=(i[1]+i[2]+i[3]+i[4])/o;return{sigma:e,negative:t,a:r,b_causal:n,b_anticausal:i,sum_causal:s,sum_anticausal:a}}function zft(e,t,r){let i=Float64Array.of(.84,1.8675,.84,-1.8675,-.34015,-.1299,-.34015,.1299),o=Math.exp(-1.783/r),s=Math.exp(-1.723/r),a=.6318/r,c=1.997/r,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=r*2.5066282746310007,f=Float64Array.of(i[0],i[1],0,0,0,0,0,0),d=Float64Array.of(1,0,l[0],l[1],0,0,0,0,0,0),h,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],h=p-2;h>0;h-=2)f[h]+=l[p]*f[h-2]-l[p+1]*f[h-1],f[h+1]+=l[p]*f[h-1]+l[p+1]*f[h-2];for(h=0;h<=p;h+=2)f[h]+=i[p]*d[h]-i[p+1]*d[h+1],f[h+1]+=i[p]*d[h+1]+i[p+1]*d[h];for(d[p+2]=l[p]*d[p]-l[p+1]*d[p+1],d[p+3]=l[p]*d[p+1]+l[p+1]*d[p],h=p;h>0;h-=2)d[h]+=l[p]*d[h-2]-l[p+1]*d[h-1],d[h+1]+=l[p]*d[h-1]+l[p+1]*d[h-2]}for(p=0;p<4;++p)h=p<<1,t[p]=f[h]/u,e[p+1]=d[h+2]}function pG(e,t,r,[n,i]){let o=new Float64Array(Math.max(n,i)),s=new Float64Array(Math.max(n,i)),a=new Float64Array(5),c=new Float64Array(r.length);for(let l=0,u=0;l<i;++l,u+=n){let f=c.subarray(u);GT(e,r.subarray(u),n,1,o,s,a,f)}for(let l=0;l<n;++l){let u=c.subarray(l);GT(t,u,i,n,o,s,a,u)}return c}function GT(e,t,r,n=1,i=new Float64Array(r),o=new Float64Array(r),s=new Float64Array(5),a=i,c=Vft){let l=n*2,u=n*3,f=n*4,d=n*r,h,p;for(c(i,t,r,n,e.b_causal,3,e.a,4,e.sum_causal,s,e.sigma),p=4,h=f;p<r;++p,h+=n)i[p]=e.b_causal[0]*t[h]+e.b_causal[1]*t[h-n]+e.b_causal[2]*t[h-l]+e.b_causal[3]*t[h-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,r,-n,e.b_anticausal,4,e.a,4,e.sum_anticausal,s,e.sigma),p=4,h=d-n*5;p<r;++p,h-=n)o[p]=e.b_anticausal[1]*t[h+n]+e.b_anticausal[2]*t[h+l]+e.b_anticausal[3]*t[h+u]+e.b_anticausal[4]*t[h+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,h=0;p<r;++p,h+=n)a[h]=i[p]+o[r-p-1];else for(p=0,h=0;p<r;++p,h+=n)a[h]=Math.max(0,i[p]+o[r-p-1]);return a}function Vft(e,t,r,n,i,o,s,a,c,l,u,f=.5){let d=Math.abs(n)*r,h=n<0?d+n:0,p,y,g;for(y=0;y<=a;++y)for(l[y]=y<=o?i[y]:0,g=1;g<=a&&g<=y;++g)l[y]-=s[g]*l[y-g];for(g=0;g<a;++g)for(e[g]=0,y=1;y<=g;++y)p=h+n*y,p>=0&&p<d&&(e[g]+=l[g-y]*t[p]);let m=t[h],b=Math.ceil(u*10);for(y=0;y<b;++y){for(g=0;g<a;++g)e[g]+=l[g]*m;if(c-=Math.abs(l[0]),c<=f)break;for(l[a]=y+a<=o?i[y+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 mG({random:e=ca(42)}={}){return(t,r,n,i,o,s,a)=>{let{points:c,triangles:l,hull:u}=On.from(t,h=>i[h],h=>o[h]),f=new Uint8Array(r*n),d=Xft(s,e);for(let h=0;h<l.length;h+=3){let p=l[h],y=l[h+1],g=l[h+2],m=c[2*p],b=c[2*y],x=c[2*g],_=c[2*p+1],v=c[2*y+1],w=c[2*g+1],I=Math.min(m,b,x),D=Math.max(m,b,x),A=Math.min(_,v,w),B=Math.max(_,v,w),M=(v-w)*(m-x)+(_-w)*(x-b);if(!M)continue;let O=s[t[p]],R=s[t[y]],S=s[t[g]];for(let T=Math.floor(I);T<D;++T)for(let E=Math.floor(A);E<B;++E){if(T<0||T>=r||E<0||E>=n)continue;let C=T+.5,U=E+.5,k=((v-w)*(C-x)+(U-w)*(x-b))/M;if(k<0)continue;let $=((w-_)*(C-x)+(U-w)*(m-x))/M;if($<0)continue;let z=1-k-$;if(z<0)continue;let V=T+r*E;a[V]=d(O,k,R,$,S,z,T,E),f[V]=1}}return jft(a,f,i,o,s,r,n,u,t,d),a}}function jft(e,t,r,n,i,o,s,a,c,l){r=Float64Array.from(a,h=>r[c[h]]),n=Float64Array.from(a,h=>n[c[h]]),i=Array.from(a,h=>i[c[h]]);let u=r.length,f=Array.from({length:u},(h,p)=>Yft(p,r,n)),d=0;for(let h=0;h<s;++h){let p=h+.5;for(let y=0;y<o;++y){let g=y+o*h;if(!t[g]){let m=y+.5;for(let b=0;b<u;++b){let x=(u+d+(b%2?(b+1)/2:-b/2))%u;if(f[x](m,p)){let _=qft(r.at(x-1),n.at(x-1),r[x],n[x],m,p);e[g]=l(i.at(x-1),_,i[x],1-_,i[x],0,y,h),d=x;break}}}}}}function qft(e,t,r,n,i,o){let s=r-e,a=n-t,c=s*(r-i)+a*(n-o),l=s*(i-e)+a*(o-t);return c>0&&l>0?c/(c+l):+(c>l)}function _x(e,t,r,n){return e*n-r*t}function Yft(e,t,r){let n=t.length,i=t.at(e-2),o=r.at(e-2),s=t.at(e-1),a=r.at(e-1),c=t[e],l=r[e],u=t.at(e+1-n),f=r.at(e+1-n),d=s-c,h=a-l,p=i-s,y=o-a,g=c-u,m=l-f,b=Math.hypot(d,h),x=Math.hypot(p,y),_=Math.hypot(g,m);return(v,w)=>{let I=v-s,D=w-a,A=v-c,B=w-l;return _x(I,D,A,B)>-1e-6&&_x(I,D,d,h)*x-_x(I,D,p,y)*b>-1e-6&&_x(A,B,g,m)*b-_x(A,B,d,h)*_<=0}}function yG(e,t,r,n,i,o,s){let a=On.from(e,u=>n[u],u=>i[u]),c,l;for(let u=.5,f=0;u<r;++u){l=c;for(let d=.5;d<t;++d,++f)l=a.find(d,u,l),d===.5&&(c=l),s[f]=o[e[l]]}return s}function gG({random:e=ca(42),minDistance:t=.5,maxSteps:r=2}={}){return(n,i,o,s,a,c,l)=>{let u=On.from(n,p=>s[p],p=>a[p]),f,d,h;for(let p=.5,y=0;p<o;++p){d=f;for(let g=.5;g<i;++g,++y){let m=g,b=p;h=d=u.find(m,b,d),g===.5&&(f=d);let x,_=0;for(;(x=Math.hypot(s[n[h]]-m,a[n[h]]-b))>t&&_<r;){let v=e(g,p,_)*2*Math.PI;m+=Math.cos(v)*x,b+=Math.sin(v)*x,h=u.find(m,b,h),++_}l[y]=c[n[h]]}}return l}}function Wft(e,t,r,n,i,o){return t*e+n*r+o*i}function Gft(e){return(t,r,n,i,o,s,a,c)=>{let l=e(a,c);return l<r?t:l<r+i?n:o}}function Xft(e,t){return Hft(e)||Zft(e)?Wft:Gft(t)}function Hft(e){for(let t of e)if(t!=null)return typeof t=="number"}function Zft(e){for(let t of e)if(t!=null)return t instanceof Date}var pl="density",ws=class extends Sn{constructor(t,r,n){let{bandwidth:i=0,interpolate:o="none",pixelSize:s=1,pad:a=1,width:c,height:l,...u}=n,f=Kft(u);super(t,r,u,WT),this.densityMap=f,In(this,"bandwidth",i,()=>this.grids?this.convolve().update():null),In(this,"pixelSize",s),In(this,"interpolate",o),In(this,"pad",a),In(this,"width",c),In(this,"height",l)}setPlot(t,r){let n=()=>{this.stats&&this.requestUpdate()};return t.addAttributeListener("domainX",n),t.addAttributeListener("domainY",n),super.setPlot(t,r)}get filterIndexable(){let t=this.plot.getAttribute("xDomain"),r=this.plot.getAttribute("yDomain");return t&&r&&!t[pn]&&!r[pn]}query(t=[]){let{interpolate:r,pad:n,channels:i,densityMap:o,source:s}=this,[a,c]=this.extentX=Ma(this,t),[l,u]=this.extentY=Ea(this,t),[f,d]=this.bins=this.binDimensions(this),[h,p]=Qi(this,"x",f,[a,c],n),[y,g]=Qi(this,"y",d,[l,u],n),m=n?[tr(p,[+a,+c]),tr(g,[+l,+u])]:[sc(+a,p),oc(p,+c),sc(+l,g),oc(g,+u)],b=Mt.from(s.table).where(t.concat(m)),x=this.groupby=[],_={};for(let w of i)if(Object.hasOwn(w,"field")){let{as:I,channel:D,field:A}=w;A.aggregate?(_[D]=A,o[D]=!0):D==="weight"?_[pl]=Ri(A):D!=="x"&&D!=="y"&&(b.select({[I]:A}),x.push(I))}let v=this.aggr=Object.keys(_);if(_.density&&v.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(v.length||(v.push(pl),_.density=Li()),r==="linear"){if(v.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!_.density)throw new Error("Linear binning not applicable to custom aggregates.");return tdt(b,h,y,_[pl],f,x)}else return Jft(b,h,y,_,f,x)}binDimensions(){let{plot:t,pixelSize:r,width:n,height:i}=this;return[n??Math.round(t.innerWidth()/r),i??Math.round(t.innerHeight()/r)]}queryResult(t){let[r,n]=this.bins,i=Qft(this.interpolate);return this.grids=dG(r,n,t,this.aggr,this.groupby,i),this.convolve()}convolve(){let{aggr:t,bandwidth:r,bins:n,grids:i,plot:o}=this;if(this.kde=this.grids,r>0){let s=t.length===1?t[0]:t.includes(pl)?pl:null;if(!s)return console.warn("No compatible grid found for smoothing."),this;let a=o.innerWidth(),c=o.innerHeight(),[l,u]=n,f=i.some(p=>p[s].some(y=>y<0)),d=xx(r*(l-1)/a,f),h=xx(r*(u-1)/c,f);this.kde=this.grids.map(p=>{let y=pG(d,h,p[s],n);return{...p,[s]:y}})}return this}plotSpecs(){throw new Error("Unimplemented. Use a Grid2D mark subclass.")}};function Kft(e){let t={};for(let r in e)e[r]==="density"&&(delete e[r],t[r]=!0);return t}function Qft(e="none"){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"none":case"linear":return;case"nearest":return yG;case"barycentric":return mG();case"random-walk":return gG()}throw new Error(`invalid interpolate: ${e}`)}function Jft(e,t,r,n,i,o){return e.select({index:W`FLOOR(${t})::INTEGER + FLOOR(${r})::INTEGER * ${i}`,...n}).groupby("index",o)}function tdt(e,t,r,n,i,o){let s=n?.column?`* ${n.column}`:"",a=(d,h)=>e.clone().select({xp:t,yp:r,i:d,w:h}),c=a(W`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${i}`,W`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),l=a(W`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${i}`,W`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(W`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${i}`,W`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(W`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${i}`,W`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return Mt.from(Mt.unionAll(c,l,u,f)).select({index:"i",density:Ri("w")},o).groupby("index",o).having(uf("density",0))}var wx=class extends ws{constructor(t,r){let{thresholds:n=10,...i}=r;super("geo",t,{bandwidth:20,interpolate:"linear",pixelSize:2,...i}),In(this,"thresholds",n,()=>this.grids?this.contours().update():null)}convolve(){return super.convolve().contours()}contours(){let{bins:t,densityMap:r,kde:n,thresholds:i,plot:o}=this,s=i;if(!Array.isArray(s)){let[,_]=bx(n,"density");s=Array.from({length:s-1},(v,w)=>_*(w+1)/s)}(r.fill||r.stroke)&&this.plot.getAttribute("colorScale")!=="log"&&this.plot.setAttribute("colorZero",!0);let[a,c]=t,[l,u]=o.getAttribute("xDomain"),[f,d]=o.getAttribute("yDomain"),h=(u-l)/a,p=(d-f)/c,y=+l,g=+f,m=_=>y+_*h,b=_=>g+_*p,x=ou().size(t);return this.data=n.flatMap(_=>s.map(v=>Object.assign(edt(x.contour(_.density,v),m,b),{..._,density:v}))),this}plotSpecs(){let{type:t,channels:r,densityMap:n,data:i}=this,o={};for(let s of r){let{channel:a}=s;a!=="x"&&a!=="y"&&(o[a]=Bo(s))}return n.fill&&(o.fill="density"),n.stroke&&(o.stroke="density"),[{type:t,data:i,options:o}]}};function edt(e,t,r){function n(s){s.forEach(i)}function i(s){s.forEach(o)}function o(s){s[0]=t(s[0]),s[1]=r(s[1])}return e.coordinates.forEach(n),e}function XT(e,t){if(typeof document<"u"){let r=document.createElement("canvas");return r.setAttribute("width",e),r.setAttribute("height",t),r}throw new Error("Can not create a canvas instance.")}function bG(e=1){let t=255*e|0;return(r,n,i)=>{for(let o=0,s=0;o<i;++o)for(let a=0;a<n;++a,s+=4)r[s+3]=t}}function xG(e){let{apply:t}=e;return(r,n,i,o)=>{for(let s=0,a=0;s<i;++s)for(let c=0,l=(i-s-1)*n;c<n;++c,a+=4)r[a+3]=255*t(o[c+l])|0}}function _G(e={}){let{r:t=0,g:r=0,b:n=0,opacity:i=1}=typeof e=="string"?qr(e):e,o=new Uint8ClampedArray([t,r,n,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 wG(e){let{domain:t,range:r}=e,n=Object.create(null),i=new Uint8ClampedArray(4*t.length),o=t.length-1,s=r.length;for(let a=0;a<=o;++a){let c=r[a%s],{r:l,g:u,b:f,opacity:d=1}=typeof c=="string"?qr(c):c,h=a<<2;i[h+0]=l,i[h+1]=u,i[h+2]=f,i[h+3]=255*d|0,n[t[a]]=h}return(a,c,l,u)=>{if(u.map)for(let f=0,d=0;f<l;++f)for(let h=0,p=(l-f-1)*c;h<c;++h,d+=4){let y=n[u[h+p]];a[d+0]=i[y+0],a[d+1]=i[y+1],a[d+2]=i[y+2],a[d+3]=i[y+3]}else{let f=n[u];for(let d=0,h=0;d<l;++d)for(let p=0;p<c;++p,h+=4)a[h+0]=i[f+0],a[h+1]=i[f+1],a[h+2]=i[f+2],a[h+3]=i[f+3]}}}function vG(e,t,r){let{interpolate:n}=t,i=new Uint8ClampedArray(4*e),o=e-1;for(let s=0;s<=o;++s){let a=n(s/o),{r:c,g:l,b:u,opacity:f=1}=typeof a=="string"?qr(a):a,d=s<<2;i[d+0]=c,i[d+1]=l,i[d+2]=u,i[d+3]=255*f|0}return(s,a,c,l)=>{for(let u=0,f=0;u<c;++u)for(let d=0,h=(c-u-1)*a;d<a;++d,f+=4){let p=o*r(l[d+h])<<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 Pu=class extends ws{constructor(t,r){super("image",t,r)}setPlot(t,r){let n=()=>{this.stats&&this.rasterize()};t.addAttributeListener("schemeColor",n),super.setPlot(t,r)}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:t,kde:r}=this,[n,i]=t,{canvas:o,ctx:s,img:a}=odt(this,n,i),{alpha:c,alphaProp:l,color:u,colorProp:f}=IF(this);return this.data=r.map(d=>(u?.(a.data,n,i,d[f]),c?.(a.data,n,i,d[l]),s.putImageData(a,0,0),{src:o.toDataURL()})),this}plotSpecs(){let{type:t,plot:r,data:n}=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}]}},vx=class extends Pu{constructor(t,r){super(t,{bandwidth:20,interpolate:"linear",pixelSize:2,...r})}};function IF(e){let{aggr:t,densityMap:r,groupby:n,plot:i}=e,o=t.includes(pl),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(n.includes(c?.as))throw new Error("Raster fillOpacity must be an aggregate or constant.");let l=r.fill||t.includes("fill")?"grid":n.includes(a?.as)?"group":jT(a?.value)?a.value:o&&i.getAttribute("colorScheme")?"grid":void 0,u=r.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"?pl:null),d=c?.as??(u==="grid"?pl:null),h=l!=="grid"&&l!=="group"?_G(l):ndt(e,f),p=u!=="grid"?bG(u):rdt(e,d);return{alphaProp:d,colorProp:f,alpha:p,color:h}}function rdt(e,t){let{plot:r,kde:n}=e,i=r.getAttribute("opacityDomain"),o=i===Gs,s=i?.[pn],a=!o&&!s&&i||bx(n,t);(o||s)&&(s&&(a[pn]=!0),r.setAttribute("colorDomain",a));let c=Pp({opacity:{type:r.getAttribute("opacityScale"),domain:a,clamp:r.getAttribute("opacityClamp"),nice:r.getAttribute("opacityNice"),reverse:r.getAttribute("opacityReverse"),zero:r.getAttribute("opacityZero"),base:r.getAttribute("opacityBase"),exponent:r.getAttribute("opacityExponent"),constant:r.getAttribute("opacityConstant")}});return xG(c)}function ndt(e,t){let{plot:r,kde:n}=e,i=!n[0][t]?.map,o=i||Array.isArray(n[0][t]),s=r.getAttribute("colorDomain"),a=s===Gs,c=s?.[pn],l=!a&&!c&&s||(i?n.map(f=>f[t]).sort(ie):o?hG(n,t):bx(n,t));(a||c)&&(c&&(l[pn]=!0),r.setAttribute("colorDomain",l));let u=Pp({color:{type:r.getAttribute("colorScale"),domain:l,range:r.getAttribute("colorRange"),clamp:r.getAttribute("colorClamp"),n:r.getAttribute("colorN"),nice:r.getAttribute("colorNice"),reverse:r.getAttribute("colorReverse"),scheme:r.getAttribute("colorScheme"),interpolate:r.getAttribute("colorInterpolate"),pivot:r.getAttribute("colorPivot"),symmetric:r.getAttribute("colorSymmetric"),zero:r.getAttribute("colorZero"),base:r.getAttribute("colorBase"),exponent:r.getAttribute("colorExponent"),constant:r.getAttribute("colorConstant")}});if(o)return wG(u);{let f=Pp({x:{type:idt(u.type),domain:u.domain,reverse:u.reverse,range:[0,1],clamp:u.clamp,base:u.base,exponent:u.exponent,constant:u.constant}});return vG(1024,u,f.apply)}}function idt(e){return e.endsWith("symlog")?"symlog":e.endsWith("log")?"log":e.endsWith("pow")?"pow":e.endsWith("sqrt")?"sqrt":e==="diverging"?"linear":e}function odt(e,t,r){if(!e.image||e.image.w!==t||e.image.h!==r){let n=XT(t,r),i=n.getContext("2d",{willReadFrequently:!0}),o=i.getImageData(0,0,t,r);e.image={canvas:n,ctx:i,img:o,w:t,h:r}}return e.image}var Sx=class extends Pu{constructor(t,r){let{normalize:n=!0,...i}=r;super(t,i),In(this,"normalize",n)}query(t=[]){let{channels:r,normalize:n,source:i,binPad:o}=this,[s,a]=this.bins=this.binDimensions(this),[c]=Qi(this,"x",s,Ma(this,t),o),[l]=Qi(this,"y",a,Ea(this,t),o),u=Mt.from(i.table).where(sdt(this,t));this.aggr=["density"];let f=this.groupby=[],d=[];for(let h of r)if(Object.hasOwn(h,"field")){let{channel:p,field:y}=h;p==="z"?(u.select({[p]:y}),d.push("z")):p!=="x"&&p!=="y"&&(u.select({[p]:y}),f.push(p))}return adt(u,c,l,d,s,a,f,n)}};function sdt(e,t){if(Array.isArray(t)&&!t.length)return t;let r=e.channelField("x").field.column,n=e.channelField("y").field.column,i=s=>s.op!=="BETWEEN"||s.field.column!==r&&s.field.column!==n,o=s=>s.op==="AND"?$n(s.children.filter(a=>i(a))):s;return Array.isArray(t)?t.filter(s=>i(s)).map(s=>o(s)):o(t)}function adt(e,t,r,n,i,o,s=[],a=!0){e.select({x:W`FLOOR(${t})::INTEGER`,y:W`FLOOR(${r})::INTEGER`});let c=s.concat(n),l=c.length?`PARTITION BY ${c.join(", ")} `:"",u=Mt.from(e).select(c,{x0:"x",y0:"y",dx:W`(lead(x) OVER sw - x)`,dy:W`(lead(y) OVER sw - y)`}).window({sw:W`${l}ORDER BY x ASC`}).qualify($n(W`(x0 < ${i} OR x0 + dx < ${i})`,W`(y0 < ${o} OR y0 + dy < ${o})`,W`(x0 > 0 OR x0 + dx > 0)`,W`(y0 > 0 OR y0 + dy > 0)`)),f=Mt.select({x:W`GREATEST(MAX(ABS(dx)), MAX(ABS(dy)))`}).from("pairs"),d=Mt.select({i:W`UNNEST(range((${f})))::INTEGER`}),h=Mt.unionAll(Mt.select(c,{x:W`x0 + i`,y:W`y0 + ROUND(i * dy / dx::FLOAT)::INTEGER`}).from("pairs","indices").where(W`ABS(dy) <= ABS(dx) AND i < ABS(dx)`),Mt.select(c,{x:W`x0 + ROUND(SIGN(dy) * i * dx / dy::FLOAT)::INTEGER`,y:W`y0 + SIGN(dy) * i`}).from("pairs","indices").where(W`ABS(dy) > ABS(dx) AND i < ABS(dy)`),Mt.select(c,{x:"x0",y:"y0"}).from("pairs").where(lf("dx"))),p=["x"].concat(c).join(", "),y=Mt.from("raster").select(c,"x","y",a?{w:W`1.0 / COUNT(*) OVER (PARTITION BY ${p})`}:null).where($n(tr("x",[0,i],!0),tr("y",[0,o],!0)));return Mt.with({pairs:u,indices:d,raster:h,points:y}).from("points").select(s,{index:W`x + y * ${i}::INTEGER`,density:a?Ri("w"):Li()}).groupby("index",s)}var ym=class extends Sn{constructor(t,r,n){let{bins:i=1024,bandwidth:o=20,...s}=n,a=t.endsWith("X")?"y":"x";super(t,r,s,a==="x"?wF:vF),this.dim=a,In(this,"bins",i),In(this,"bandwidth",o,()=>this.grid?this.convolve().update():null)}get filterIndexable(){let t=this.dim==="x"?"xDomain":"yDomain",r=this.plot.getAttribute(t);return r&&!r[pn]}query(t=[]){if(this.hasOwnData())throw new Error("Density1DMark requires a data source");let{bins:r,channels:n,dim:i,source:{table:o}}=this,s=this.extent=(i==="x"?Ma:Ea)(this,t),[a,c]=Qi(this,i,r,s),l=_F(n,o,[i]).where(t.concat(tr(c,s))),u=this.channelField("weight")?"weight":null;return cdt(l,a,u)}queryResult(t){return this.grid=fG(this.bins,t),this.convolve()}convolve(){let{bins:t,bandwidth:r,dim:n,grid:i,plot:o,extent:[s,a]}=this,c=i.some(b=>b<0),l=n==="x"?o.innerWidth():o.innerHeight(),u=xx(r*(t-1)/l,c),f=GT(u,i,t),d=this.data=[],h=n==="x"?"y":"x",p=this.channelField(n).as,y=+s,g=(a-y)/(t-1),m=1/g;for(let b=0;b<t;++b)d.push({[p]:y+b*g,[h]:f[b]*m});return this}plotSpecs(){let{type:t,data:r,channels:n,dim:i}=this,o=i==="x"?{y:"y"}:{x:"x"};for(let s of n)o[s.channel]=Bo(s);return[{type:t,data:r,options:o}]}};function cdt(e,t,r){let n=r?`* ${r}`:"",i=e.clone().select({p:t,i:W`FLOOR(p)::INTEGER`,w:W`(FLOOR(p) + 1 - p)${n}`}),o=e.clone().select({p:t,i:W`FLOOR(p)::INTEGER + 1`,w:W`(p - FLOOR(p))${n}`});return Mt.from(Mt.unionAll(i,o)).select({index:"i",density:Ri("w")}).groupby("index").having(My("density",0))}var Ix=class extends ws{constructor(t,r){let{type:n="dot",...i}=r;super(n,t,{bandwidth:20,interpolate:"linear",pad:0,pixelSize:2,...i})}convolve(){super.convolve();let{bins:t,pad:r,extentX:n,extentY:i}=this,[o,s]=t,a=Ad(this,"x"),c=Ad(this,"y"),[l,u]=n.map(g=>a.apply(g)),[f,d]=i.map(g=>c.apply(g)),h=(u-l)/(o-r),p=(d-f)/(s-r),y=r?0:.5;return this.data=ldt(this.kde,t,l,f,h,p,a.invert,c.invert,y),this}plotSpecs(){let{type:t,channels:r,densityMap:n,data:i}=this,o={};for(let s of r){let{channel:a}=s;o[a]=a==="x"||a==="y"?a:Bo(s)}for(let s in n)n[s]&&(o[s]="density");return[{type:t,data:i,options:o}]}};function ldt(e,t,r,n,i,o,s,a,c){let l=1/(i*o),[u,f]=t,d=[];for(let h of e){let p=h.density;for(let y=0,g=0;g<f;++g)for(let m=0;m<u;++m,++y)d.push({...h,x:s(r+(m+c)*i),y:a(n+(g+c)*o),density:p[y]*l})}return d}var udt="geom",Tx=class extends Sn{constructor(t,r={},n){!YT(t)&&!r?.geometry&&(r.geometry=Oy(udt)),super("geo",t,r,n)}queryResult(t){super.queryResult(t);let r=this.channelField("geometry")?.as;return r&&this.data&&this.data.forEach(n=>{typeof n[r]=="string"&&(n[r]=JSON.parse(n[r]))}),this}};var Ax=class extends Sn{constructor(t,r){let{type:n="hexagon",binWidth:i=20,...o}=r;super(n,t,{r:i/2,clip:!0,...o},WT),this.binWidth=i}get filterIndexable(){let t=this.plot.getAttribute("xDomain"),r=this.plot.getAttribute("yDomain");return t&&r&&!t[pn]&&!r[pn]}query(t=[]){if(this.hasOwnData())return null;let{plot:r,binWidth:n,channels:i,source:o}=this,[s,a]=Ma(this,t),[c,l]=Ea(this,t),u=.5-r.getAttribute("marginLeft"),f=0-r.getAttribute("marginTop"),d=`${n}::DOUBLE`,h=`${n*(1.5/Math.sqrt(3))}::DOUBLE`,p=`${r.innerWidth()/(a-s)}::DOUBLE`,y=`${r.innerHeight()/(l-c)}::DOUBLE`,g,m,b=new Set,x={};for(let D of i)D.channel==="orderby"?_.orderby(D.value):D.channel==="x"?g=D:D.channel==="y"?m=D:Object.hasOwn(D,"field")&&(x[D.as]=D.field,D.field.aggregate&&D.field.columns.forEach(A=>b.add(A)));let _=Mt.select({[g.as]:W`${s}::DOUBLE + ((x + 0.5 * (y & 1)) * ${d} + ${u})::DOUBLE / ${p}`,[m.as]:W`${l}::DOUBLE - (y * ${h} + ${f})::DOUBLE / ${y}`,...x}).groupby("x","y"),v=`${p} * (${g.field} - ${s}::DOUBLE)`,w=`${y} * (${l}::DOUBLE - ${m.field})`,I=Mt.select({py:W`(${w} - ${f}) / ${h}`,pj:W`ROUND(py)::INTEGER`,px:W`(${v} - ${u}) / ${d} - 0.5 * (pj & 1)`,pi:W`ROUND(px)::INTEGER`,tt:W`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:W`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:W`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(nc(g.field),nc(m.field),t);return _.from(I)}};var Mx=class extends ws{constructor(t,r){let{origin:n=[0,0],dim:i="xy",...o}=r;super("image",t,o),this.origin=n,this.tileX=i.toLowerCase().includes("x"),this.tileY=i.toLowerCase().includes("y")}setPlot(t,r){let n=()=>{this.stats&&this.rasterize()};t.addAttributeListener("schemeColor",n),super.setPlot(t,r)}requestQuery(){return this.requestTiles()}query(t=[]){return this._filter=t,null}tileQuery(t){let{binType:r,binPad:n,channels:i,densityMap:o,source:s}=this,[[a,c],[l,u]]=t,[f,d]=this.bins,[h,p]=Qi(this,"x",f,[a,c],n),[y,g]=Qi(this,"y",d,[l,u],n),m=n?[tr(p,[+a,+c]),tr(g,[+l,+u])]:[sc(+a,p),oc(p,+c),sc(+l,g),oc(g,+u)],b=Mt.from(s.table).where(m),x=this.groupby=[],_={};for(let w of i)if(Object.hasOwn(w,"field")){let{as:I,channel:D,field:A}=w;A.aggregate?(_[D]=A,o[D]=!0):D==="weight"?_.density=Ri(A):D!=="x"&&D!=="y"&&(b.select({[I]:A}),x.push(I))}let v=this.aggr=Object.keys(_);if(_.density&&v.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(v.length||(v.push("density"),_.density=Li()),r==="linear"){if(v.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!_.density)throw new Error("Linear binning not applicable to custom aggregates.");return mdt(b,h,y,_.density,f,x)}else return pdt(b,h,y,_,f,x)}async requestTiles(){let t=co();this.prefetch&&t.cancel(this.prefetch);let{binPad:r,tileX:n,tileY:i,origin:[o,s]}=this,[a,c]=this.bins=this.binDimensions(this),[l,u]=Ma(this,this._filter),[f,d]=Ea(this,this._filter),h=u-l,p=d-f,y=Math.floor((l-o)*(a-r)/h),g=Math.floor((f-s)*(c-r)/p),m=(B,M)=>[[o+B*h,o+(B+1)*h],[s+M*p,s+(M+1)*p]],b=Math.floor((l-o)/h),x=n?SG((u-o)/h):b,_=Math.floor((f-s)/p),v=i?SG((d-s)/p):_,w=[];for(let B=b;B<=x;++B)for(let M=_;M<=v;++M)w.push([B,M]);let I=w.map(([B,M])=>t.query(this.tileQuery(m(B,M)))),D=[];if(n)for(let B=_;B<=v;++B)D.push([x+1,B]),D.push([b-1,B]);if(i){let B=n?b-1:b,M=n?x+1:x;for(let O=B;O<=M;++O)D.push([O,v+1]),D.push([O,_-1])}this.prefetch=D.map(([B,M])=>t.prefetch(this.tileQuery(m(B,M))));let A=await Promise.all(I);this.grids=[{density:fdt(a,c,y,g,w,A)}],this.convolve().update()}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:t,kde:r}=this,[n,i]=t,{canvas:o,ctx:s,img:a}=hdt(this,n,i),{alpha:c,alphaProp:l,color:u,colorProp:f}=IF(this);return this.data=r.map(d=>(u?.(a.data,n,i,d[f]),c?.(a.data,n,i,d[l]),s.putImageData(a,0,0),{src:o.toDataURL()})),this}plotSpecs(){let{type:t,data:r,plot:n}=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}]}};function fdt(e,t,r,n,i,o){let s=new Float64Array(e*t);return o.forEach((a,c)=>{let[l,u]=i[c],f=l*e-r,d=u*t-n;ddt(e,t,s,a,f,d)}),s}function ddt(e,t,r,n,i,o){let s=n.numRows;if(s===0)return;let a=n.getChild("index").toArray(),c=n.getChild("density").toArray();for(let l=0;l<s;++l){let u=a[l],f=i+u%e,d=o+Math.floor(u/e);0<=f&&f<e&&0<=d&&d<t&&(r[f+d*e]=c[l])}}function hdt(e,t,r){if(!e.image||e.image.w!==t||e.image.h!==r){let n=XT(t,r),i=n.getContext("2d",{willReadFrequently:!0}),o=i.getImageData(0,0,t,r);e.image={canvas:n,ctx:i,img:o,w:t,h:r}}return e.image}function pdt(e,t,r,n,i,o){return e.select({index:W`FLOOR(${t})::INTEGER + FLOOR(${r})::INTEGER * ${i}`,...n}).groupby("index",o)}function mdt(e,t,r,n,i,o){let s=n.column?`* ${n.column}`:"",a=(d,h)=>e.clone().select({xp:t,yp:r,i:d,w:h}),c=a(W`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${i}`,W`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),l=a(W`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${i}`,W`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(W`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${i}`,W`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(W`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${i}`,W`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return Mt.from(Mt.unionAll(c,l,u,f)).select({index:"i",density:Ri("w")},o).groupby("index",o).having(uf("density",0))}function SG(e){let t=Math.floor(e);return t===e?t-1:t}function ydt(e,t,r){var n=1e-8,i=t-1,o=r-1,s=0,a,c,l,u,f,d,h,p,y,g,m;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&r>=1?(l=e<.5?e:1-e,u=Math.sqrt(-2*Math.log(l)),h=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(h=-h),p=(h*h-3)/6,y=2/(1/(2*t-1)+1/(2*r-1)),g=h*Math.sqrt(p+y)/y-(1/(2*r-1)-1/(2*t-1))*(p+5/6-2/(3*y)),h=t/(t+r*Math.exp(2*g))):(a=Math.log(t/(t+r)),c=Math.log(r/(t+r)),u=Math.exp(t*a)/t,f=Math.exp(r*c)/r,g=u+f,e<u/g?h=Math.pow(t*g*e,1/t):h=1-Math.pow(r*g*(1-e),1/r)),m=-gm(t)-gm(r)+gm(t+r);s<10;s++){if(h===0||h===1)return h;if(d=gdt(h,t,r)-e,u=Math.exp(i*Math.log(h)+o*Math.log(1-h)+m),f=d/u,h-=u=f/(1-.5*Math.min(1,f*(i/h-o/(1-h)))),h<=0&&(h=.5*(h+u)),h>=1&&(h=.5*(h+u+1)),Math.abs(u)<n*h&&s>0)break}return h}function gdt(e,t,r){var n=e===0||e===1?0:Math.exp(gm(t+r)-gm(t)-gm(r)+t*Math.log(e)+r*Math.log(1-e));return e<0||e>1?!1:e<(t+1)/(t+r+2)?n*IG(e,t,r)/t:1-n*IG(1-e,r,t)/r}function IG(e,t,r){var n=1e-30,i=1,o=t+r,s=t+1,a=t-1,c=1,l=1-o*e/s,u,f,d,h;for(Math.abs(l)<n&&(l=n),l=1/l,h=l;i<=100&&(u=2*i,f=i*(r-i)*e/((a+u)*(t+u)),l=1+f*l,Math.abs(l)<n&&(l=n),c=1+f/c,Math.abs(c)<n&&(c=n),l=1/l,h*=l*c,f=-(t+i)*(o+i)*e/((t+u)*(s+u)),l=1+f*l,Math.abs(l)<n&&(l=n),c=1+f/c,Math.abs(c)<n&&(c=n),l=1/l,d=l*c,h*=d,!(Math.abs(d-1)<3e-7));i++);return h}function gm(e){var t=0,r=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],n=1.000000000190015,i,o,s;for(s=(o=i=e)+5.5,s-=(i+.5)*Math.log(s);t<6;t++)n+=r[t]/++o;return Math.log(2.506628274631*n/i)-s}function TG(e,t){var r=ydt(2*Math.min(e,1-e),.5*t,.5);return r=Math.sqrt(t*(1-r)/r),e>.5?r:-r}var Ex=class extends Sn{constructor(t,r){let{ci:n=.95,precision:i=4,...o}=r;super("line",t,o);let s=()=>this.modelFit?this.confidenceBand().update():null;In(this,"ci",n,s),In(this,"precision",i,s)}query(t=[]){let r=this.channelField("x").as,n=this.channelField("y").as,i=Array.from(new Set(["stroke","z","fx","fy"].flatMap(o=>this.channelField(o)?.as||[])));return Mt.from(super.query(t)).select({intercept:PM(n,r),slope:$M(n,r),n:zM(n,r),ssy:VM(n,r),ssx:jM(n,r),xm:qM(n,r),x0:eh(ao(r).where(nc(n))),x1:eh(so(r).where(nc(n)))}).select(i).groupby(i)}queryResult(t){return this.modelFit=qT(t),this.lineData=this.modelFit.flatMap(r=>bdt(r)),this.confidenceBand()}confidenceBand(){let{ci:t,modelFit:r,precision:n,plot:i}=this,o=i.innerWidth();return this.areaData=t?r.flatMap(s=>xdt(t,n,s,o)):null,this}plotSpecs(){let{lineData:t,areaData:r,channels:n,ci:i}=this,o={x:"x",y:"y"},s={x:"x",y1:"y1",y2:"y2",fillOpacity:.1};for(let a of n)switch(a.channel){case"x":case"y":case"fill":break;case"stroke":o.stroke=s.fill=Bo(a);break;case"strokeOpacity":o.strokeOpacity=Bo(a);break;case"fillOpacity":s.fillOpacity=Bo(a);break;default:o[a.channel]=s[a.channel]=Bo(a);break}return[...i?[{type:"areaY",data:r,options:s}]:[],{type:"line",data:t,options:o}]}};function bdt(e){let{x0:t,x1:r,xm:n,intercept:i,slope:o,n:s,ssx:a,ssy:c,...l}=e;return[{x:t,y:i+t*o,...l},{x:r,y:i+r*o,...l}]}function xdt(e,t,r,n){let{x0:i,x1:o,xm:s,intercept:a,slope:c,n:l,ssx:u,ssy:f,...d}=r,h=t*(o-i)/n,p=TG((1-e)/2,l-2)*Math.sqrt(f/(l-2));return _r(i,o-h/2,h).concat(o).map(y=>{let g=a+y*c,m=p*Math.sqrt(1/l+(y-s)**2/u);return{x:y,y1:g-m,y2:g+m,...d}})}function AG(e){let t=e.toLowerCase(),r=e.length,n="";for(let i=0;i<r;++i)n+=(e[i]!==t[i]?"-":"")+t[i];return n}function bm(e){let t={};for(let r in e)t[AG(r)]=e[r];return t}function _dt(e){let{channels:t}=e,r=new Set,n=!1,i=!1;for(let o of t){let{channel:s,field:a,as:c}=o;if(s==="orderby")n=!0;else if(a)if(a.aggregate)i=!0;else{if(r.has(c))continue;r.add(c)}}return!n&&i&&r.size&&e.channels.push({channel:"orderby",value:Array.from(r)}),e}var Dx=class{constructor(t,{selection:r,channels:n={}}){this.mark=_dt(t),this.selection=r;let i=Object.entries(bm(n));this.channels=i.length?i:[["opacity",.2]],this.selection.addEventListener("value",Tm(()=>this.update()))}init(t){this.svg=t;let r=this.values=[],n=this.mark.index,i=this.nodes=t.querySelectorAll(`[data-index="${n}"] > *`),{channels:o}=this;for(let s=0;s<i.length;++s){let a=i[s];r.push(o.map(c=>a.getAttribute(c[0])))}return this.update()}async update(){let{svg:t,nodes:r,channels:n,values:i,mark:o,selection:s}=this;if(!t)return;let a=await wdt(o,s);for(let c=0;c<r.length;++c){let l=r[c],u=i[c],f=a(l.__data__);for(let d=0;d<n.length;++d){let[h,p]=n[d];l.setAttribute(h,f?u[d]:p)}}}};async function wdt(e,t){let r=t?.predicate(e);if(!r||r.length===0)return()=>!0;let n=e.filterBy?.predicate(e,!0),i={__:$n(r)},o=e.query(n),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 TF(e){let t=e.on,r=!0;function n(i){r=!1,i(),r=!0}return e.reset=(...i)=>{n(()=>e.clear(...i))},e.moveSilent=(...i)=>{n(()=>e.move(...i))},e.on=(...i)=>{if(i.length>1&&i[1]){let o=i[1];i[1]=(...s)=>r&&o(...s)}return t(...i)},e}function MG(){return TF(nB())}function EG(){return TF(eB())}function DG(){return TF(rB())}function Bx(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 Da(e,t){let r=e.channelField(t)?.field;return r?.basis||r}function Ox(e,t,r=1){return t.invert(r*Math.floor(e/r))}function HT(){let e=this,t=e.getScreenCTM,r;e.getScreenCTM=()=>e.isConnected?r=t.call(e):r}var xm=class{constructor(t,{channel:r,selection:n,field:i,pixelSize:o=1,peers:s=!0,brush:a}){this.mark=t,this.channel=r,this.pixelSize=o||1,this.selection=n,this.peers=s,this.field=i||Da(t,[r,r+"1",r+"2"]),this.style=a&&bm(a),this.brush=r==="y"?DG():EG(),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 r;t&&(r=t.map(n=>Ox(n,this.scale,this.pixelSize)).sort((n,i)=>n-i)),Bx(r,this.value)||(this.value=r,this.g.call(this.brush.moveSilent,t),this.selection.update(this.clause(r)))}clause(t){let{mark:r,pixelSize:n,field:i,scale:o}=this;return{source:this,schema:{type:"interval",pixelSize:n,scales:[o]},clients:this.peers?r.plot.markSet:new Set().add(r),value:t,predicate:t?tr(i,t):null}}init(t){let{brush:r,channel:n,style:i}=this;this.scale=t.scale(n);let o=t.scale("x").range,s=t.scale("y").range;r.extent([[Oe(o),Oe(s)],[de(o),de(s)]]);let a=ae(t).selectAll('g[aria-label="facet"]'),c=a.size()?a:ae(t);if(this.g=c.append("g").attr("class",`interval-${n}`).each(HT).call(r).call(r.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 ZT=(e,t)=>e-t,Nx=class{constructor(t,{selection:r,xfield:n,yfield:i,pixelSize:o=1,peers:s=!0,brush:a}){this.mark=t,this.pixelSize=o||1,this.selection=r,this.peers=s,this.xfield=n||Da(t,["x","x1","x2"]),this.yfield=i||Da(t,["y","y1","y2"]),this.style=a&&bm(a),this.brush=MG(),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:r,pixelSize:n,xscale:i,yscale:o}=this,s,a;if(t){let[c,l]=t;s=[c[0],l[0]].map(u=>Ox(u,i,n)).sort(ZT),a=[c[1],l[1]].map(u=>Ox(u,o,n)).sort(ZT)}(!Bx(s,r?.[0])||!Bx(a,r?.[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:r,pixelSize:n,xfield:i,yfield:o,xscale:s,yscale:a}=this;return{source:this,schema:{type:"interval",pixelSize:n,scales:[s,a]},clients:this.peers?r.plot.markSet:new Set().add(r),value:t,predicate:t?$n(tr(i,t[0]),tr(o,t[1])):null}}init(t){let{brush:r,style:n}=this,i=this.xscale=t.scale("x"),o=this.yscale=t.scale("y"),s=i.range,a=o.range;r.extent([[Oe(s),Oe(a)],[de(s),de(a)]]);let c=ae(t).selectAll('g[aria-label="facet"]'),l=c.size()?c:ae(t);if(this.g=l.append("g").attr("class","interval-xy").each(HT).call(r),n){let u=this.g.selectAll("rect.selection");for(let f in n)u.attr(f,n[f])}if(this.value){let[u,f]=this.value[0].map(i.apply).sort(ZT),[d,h]=this.value[1].map(o.apply).sort(ZT);this.g.call(r.moveSilent,[[u,d],[f,h]])}t.addEventListener("pointerenter",()=>this.activate())}};var _m=class{constructor(t,{selection:r,channel:n,field:i}){this.mark=t,this.selection=r,this.clients=new Set().add(t),this.channel=n,this.field=i||Da(t,[n])}clause(t){let{clients:r,field:n}=this,i=t?ic(n,Fi(t)):null;return{source:this,schema:{type:"point"},clients:r,value:t,predicate:i}}init(t){let r=this,{mark:n,channel:i,selection:o}=this,{data:s}=n,a=n.channelField(i).as,c=ae(t).selectAll('g[aria-label="facet"]'),l=c.size()?c:ae(t),u=t.scale(i),f=!lo(o);l.on("pointerdown pointermove",function(d){let[h,p]=Mn(d,this),y=vdt(s,a,u.invert(i==="x"?h:p));o.update(f?y:r.clause(y))}),!f&&t.addEventListener("pointerenter",()=>{this.selection.activate(this.clause(0))})}};function vdt(e,t,r){let n=1/0,i;return e.forEach(o=>{let s=Math.abs(o[t]-r);s<n&&(n=s,i=o[t])}),i}var BG=(e,t)=>e-t,Fx=class{constructor(t,{x:r=new ac,y:n=new ac,xfield:i,yfield:o,zoom:s=!0,panx:a=!0,pany:c=!0}){this.mark=t,this.xsel=r,this.ysel=n,this.xfield=i||Da(t,["x","x1","x2"]),this.yfield=o||Da(t,["y","y1","y2"]),this.zoom=AF(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 r=Sdt(t,this.xscale);this.xsel.update(this.clause(r,this.xfield,this.xscale))}if(this.pany){let r=Idt(t,this.yscale);this.ysel.update(this.clause(r,this.yfield,this.yscale))}}clause(t,r,n){return{source:this,schema:{type:"interval",scales:[n]},clients:this.mark.plot.markSet,value:t,predicate:t?tr(r,t):null}}init(t){if(this.svg=t,this.initialized)return;this.initialized=!0;let{panx:r,pany:n,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(BG),c=this.yscale.range.slice().sort(BG),l=AF(r,[-1/0,1/0],a),u=AF(n,[-1/0,1/0],c),f=xN().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 Gi(1,0,0)).on("zoom",({transform:d})=>this.publish(d));if(ae(i).call(f),r||n){let d=!1;i.addEventListener("mouseenter",()=>{if(!d){if(d=!0,r){let{xscale:h,xfield:p}=this;o.activate(this.clause(h.domain,p,h))}if(n){let{yscale:h,yfield:p}=this;s.activate(this.clause(h.domain,p,h))}}}),i.addEventListener("mouseleave",()=>d=!1)}}};function AF(e,t,r){return e?Array.isArray(e)?e:t:r}function Sdt(e,t){return t.range.map(e.invertX,e).map(t.invert,t)}function Idt(e,t){return t.range.map(e.invertY,e).map(t.invert,t)}var Md=class{constructor(t,{selection:r,channels:n,peers:i=!0}){this.value=null,this.mark=t,this.selection=r,this.peers=i,this.channels=n.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:r,mark:n}=this,i=null;if(t){let o=t.map(s=>{let a=s.map((c,l)=>Ey(r[l].field,Fi(c)));return a.length>1?$n(a):a[0]});i=o.length>1?cf(o):o[0]}return{source:this,schema:{type:"point"},clients:this.peers?n.plot.markSet:new Set().add(n),value:t,predicate:i}}init(t,r,n){let{mark:i,channels:o,selection:s}=this,{data:a}=i;n=n||(l=>{let u=a[l.__data__];return o.map(f=>u[f.as])}),r=r||`[data-index="${i.index}"]`;let c=new Set(t.querySelectorAll(r));t.addEventListener("pointerdown",l=>{let u=s.single?s.value:this.value,f=l.target,d=null;if(Tdt(c,f)){let h=n(f);l.shiftKey&&u?.length?(d=u.filter(p=>MF(p,h)),d.length===u.length&&d.push(h)):u?.length===1&&!MF(u[0],h)?d=null:d=[h]}this.value=d,Adt(u,d)&&s.update(this.clause(d))}),t.addEventListener("pointerenter",()=>{this.selection.activate(this.clause([this.channels.map(()=>0)]))})}};function Tdt(e,t){return e.has(t)||e.has(t.parentNode)||e.has(t.parentNode?.parentNode)}function Adt(e,t){return e==null||t==null?e!=null||t!=null:e.length!==t.length||e.some((r,n)=>MF(r,t[n]))}function MF(e,t){let r=e.length;if(t.length!==r)return!0;for(let n=0;n<r;++n)if(e[n]!==t[n])return!0;return!1}var wm=class{constructor(t,r){let{as:n,...i}=r;this.channel=t,this.options={label:null,...i},this.selection=n,this.element=document.createElement("div"),this.element.setAttribute("class","legend"),this.element.value=this}setPlot(t){let{channel:r,selection:n}=this,i=Mdt(t,r);this.selection&&i&&(this.handler=new Md(i,{selection:n,channels:[r]}),this.selection.addEventListener("value",()=>this.update()))}init(t){let{channel:r,options:n,handler:i}=this,s=t.scale(r).type==="ordinal"?n:{marginTop:1,tickSize:2,height:28,...n};return this.legend=t.legend(r,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,r=t&&t.length?new Set(t.map(i=>i[0])):null,n=this.legend.querySelectorAll(":scope > div");for(let i of n){let o=r?r.has(i.__data__):!0;i.style.opacity=o?1:.2}}};function Mdt({marks:e},t){let r=t==="color"?["fill","stroke"]:t==="opacity"?["opacity","fillOpacity","strokeOpacity"]:null;if(r==null)return null;for(let n=e.length-1;n>-1;--n)if(e[n].channelField(r))return e[n];return null}var Edt=new Set(["rectY-x","rectX-y","rect-x","rect-y"]);function KT(e,t={steps:25}){let r=(n,i)=>Edt.has(`${n.type}-${i}`)?{[`${i}1`]:EF(n,i,e,t),[`${i}2`]:EF(n,i,e,{...t,offset:1})}:{[i]:EF(n,i,e,t)};return r[Rg]=!0,r}function EF(e,t,r,n){return{column:r,label:r,get stats(){return["min","max"]},get columns(){return[r]},get basis(){return r},toString(){let{apply:i,sqlApply:o,sqlInvert:s}=Ad(e,t),{min:a,max:c}=e.stats[r],l=Ddt(i(a),i(c),n),u=o(r),f=l.min===0?u:`(${u} - ${l.min})`,d=`${(l.max-l.min)/l.steps}::DOUBLE`,h=n.offset?`${n.offset} + `:"",p=`${l.min} + ${d} * (${h}FLOOR(${f} / ${d}))`;return`${s(p)}`}}}function Ddt(e,t,r){let{steps:n=25,minstep:i=0,nice:o=!0}=r;if(o!==!1){let s=t-e,a=n,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],d;for(let y=0,g=f.length;y<g;++y)d=u/f[y],d>=i&&s/d<=a&&(u=d);d=Math.log(u);let h=d>=0?0:~~(-d/c)+1,p=Math.pow(10,-h-1);d=Math.floor(e/u+p)*u,e=e<d?d-u:d,t=Math.ceil(t/u)*u,n=Math.round((t-e)/u)}return{min:e,max:t,steps:n}}var Bdt=e=>e&&typeof e=="object"&&!Array.isArray(e);var Lx=class extends ai{constructor({element:t,filterBy:r,from:n,column:i,label:o=i,format:s=u=>u,options:a,value:c,as:l}={}){super(r),this.from=n,this.column=i,this.selection=l,this.format=s,this.element=t??document.createElement("div"),this.element.setAttribute("class","input"),this.element.value=this;let u=document.createElement("label");u.innerText=o||i,this.element.appendChild(u),this.select=document.createElement("select"),a&&(this.data=a.map(f=>Bdt(f)?f:{value:f}),this.update()),c=c??this.selection?.value??this.data?.[0]?.value,this.selection?.value===void 0&&this.publish(c),this.element.appendChild(this.select),this.selection&&(this.select.addEventListener("input",()=>{this.publish(this.selectedValue()??null)}),lo(this.selection)||this.selection.addEventListener("value",f=>{f!==this.select.value&&this.selectedValue(f)}))}selectedValue(t){if(arguments.length===0){let r=this.select.selectedIndex;return this.data[r].value}else{let r=this.data?.findIndex(n=>n.value===t);r>=0?this.select.selectedIndex=r:this.select.value=String(t)}}reset(){this.select.selectedIndex=this.from?0:-1}publish(t){let{selection:r,column:n}=this;lo(r)?r.update({source:this,schema:{type:"point"},value:t,predicate:t!==""&&t!==void 0?ic(n,Fi(t)):null}):yi(r)&&r.update(t)}query(t=[]){let{from:r,column:n}=this;return r?Mt.from(r).select({value:n}).distinct().where(t).orderby(n):null}queryResult(t){return this.data=[{value:"",label:"All"},...t],this}update(){let{data:t,format:r,select:n}=this;n.replaceChildren();for(let{value:i,label:o}of t){let s=document.createElement("option");s.setAttribute("value",i),s.innerText=o??r(i),this.select.appendChild(s)}return this.selection&&this.selectedValue(this.selection?.value??""),this}};var Odt={contains:cM,prefix:lM,suffix:uM,regexp:aM},Ndt=0;var Rx=class extends ai{constructor({element:t,filterBy:r,from:n,column:i,label:o,type:s="contains",as:a}={}){if(super(r),this.id="search_"+ ++Ndt,this.type=s,this.from=n,this.column=i,this.selection=a,this.element=t??document.createElement("div"),this.element.setAttribute("class","input"),this.element.value=this,o){let c=document.createElement("label");c.setAttribute("for",this.id),c.innerText=o,this.element.appendChild(c)}this.searchbox=document.createElement("input"),this.searchbox.setAttribute("id",this.id),this.searchbox.setAttribute("type","text"),this.searchbox.setAttribute("placeholder","Query"),this.element.appendChild(this.searchbox),this.selection&&(this.searchbox.addEventListener("input",()=>{this.publish(this.searchbox.value||null)}),lo(this.selection)||this.selection.addEventListener("value",c=>{c!==this.searchbox.value&&(this.searchbox.value=c)}))}reset(){this.searchbox.value=""}publish(t){let{selection:r,column:n,type:i}=this;lo(r)?r.update({source:this,schema:{type:i},value:t,predicate:t?Odt[i](n,Fi(t)):null}):yi(r)&&r.update(t)}query(t=[]){let{from:r,column:n}=this;return r?Mt.from(r).select({list:n}).distinct().where(t):null}queryResult(t){return this.data=t,this}update(){let t=document.createElement("datalist"),r=`${this.id}_list`;t.setAttribute("id",r);for(let n of this.data){let i=document.createElement("option");i.setAttribute("value",n.list),t.append(i)}return this.datalist&&this.datalist.remove(),this.element.appendChild(this.datalist=t),this.searchbox.setAttribute("list",r),this}};var Fdt=0;var kx=class extends ai{constructor({element:t,filterBy:r,as:n,min:i,max:o,step:s,from:a,column:c,label:l=c,value:u=n?.value,width:f}={}){if(super(r),this.id="slider_"+ ++Fdt,this.from=a,this.column=c||"value",this.selection=n,this.min=i,this.max=o,this.step=s,this.element=t||document.createElement("div"),this.element.setAttribute("class","input"),this.element.value=this,l){let d=document.createElement("label");d.setAttribute("for",this.id),d.innerText=l,this.element.appendChild(d)}this.slider=document.createElement("input"),this.slider.setAttribute("id",this.id),this.slider.setAttribute("type","range"),f!=null&&(this.slider.style.width=`${+f}px`),i!=null&&this.slider.setAttribute("min",i),o!=null&&this.slider.setAttribute("max",o),s!=null&&this.slider.setAttribute("step",s),u!=null&&(this.slider.setAttribute("value",u),this.selection?.value===void 0&&this.publish(u)),this.element.appendChild(this.slider),this.selection&&(this.slider.addEventListener("input",()=>{this.publish(+this.slider.value)}),lo(this.selection)||this.selection.addEventListener("value",d=>{d!==+this.slider.value&&(this.slider.value=d)}))}query(t=[]){let{from:r,column:n}=this;return!r||this.min!=null&&this.max!=null?null:Mt.select({min:ao(n),max:so(n)}).from(r).where(t)}queryResult(t){let{min:r,max:n}=Array.from(t)[0];return this.min==null&&this.slider.setAttribute("min",r),this.max==null&&this.slider.setAttribute("max",n),this.step==null&&this.slider.setAttribute("step",(n-r)/500),this}publish(t){let{selection:r,column:n}=this;lo(r)?r.update({source:this,schema:{type:"point"},value:t,predicate:ic(n,Fi(t))}):yi(this.selection)&&r.update(t)}};var BF=NF(e=>{let t=QT(e);return r=>r==null?"":typeof r=="number"?t(r):r instanceof Date?OF(r):`${r}`}),QT=NF(e=>t=>t===0?"0":t.toLocaleString(e)),Mce=BF(),Ece=QT();function OF(e){return bp(e,"Invalid Date")}function NF(e){let t=NF,r;return(n="en")=>n===t?r:r=e(t=n)}var Ldt=-1;var Cx=class extends ai{constructor({element:t,filterBy:r,from:n,columns:i=["*"],align:o={},format:s,width:a,maxWidth:c,height:l=500,rowBatch:u=100}={}){super(r),this.id=`table-${++Ldt}`,this.from=n,this.columns=i,this.format=s,this.align=o,this.widths=typeof a=="object"?a:{},this.offset=0,this.limit=+u,this.pending=!1,this.sortHeader=null,this.sortColumn=null,this.sortDesc=!1,this.element=t||document.createElement("div"),this.element.setAttribute("id",this.id),this.element.value=this,typeof a=="number"&&(this.element.style.width=`${a}px`),c&&(this.element.style.maxWidth=`${c}px`),this.element.style.maxHeight=`${l}px`,this.element.style.overflow="auto";let f=-1;this.element.addEventListener("scroll",d=>{let{pending:h,loaded:p}=this,{scrollHeight:y,scrollTop:g,clientHeight:m}=d.target,b=g<f;f=g,!(b||h||p)&&y-g<2*m&&(this.pending=!0,this.requestData(this.offset+this.limit))}),this.tbl=document.createElement("table"),this.element.appendChild(this.tbl),this.head=document.createElement("thead"),this.tbl.appendChild(this.head),this.body=document.createElement("tbody"),this.tbl.appendChild(this.body),this.style=document.createElement("style"),this.element.appendChild(this.style)}requestData(t=0){this.offset=t;let r=this.query(this.filterBy?.predicate(this));this.requestQuery(r),co().prefetch(r.clone().offset(t+this.limit))}fields(){return this.columns.map(t=>El(this.from,t))}fieldInfo(t){this.schema=t;let r=this.head;r.innerHTML="";let n=document.createElement("tr");for(let{column:i}of t){let o=document.createElement("th");o.addEventListener("click",s=>this.sort(s,i)),o.appendChild(document.createElement("span")),o.appendChild(document.createTextNode(i)),n.appendChild(o)}return r.appendChild(n),this.formats=Rdt(this.format,t),this.style.innerText=Udt(this.id,kdt(this.align,t),Cdt(this.widths,t)),this}query(t=[]){let{from:r,limit:n,offset:i,schema:o,sortColumn:s,sortDesc:a}=this;return Mt.from(r).select(o.map(c=>c.column)).where(t).orderby(s?a?rM(s):s:[]).limit(n).offset(i)}queryResult(t){return this.pending||(this.loaded=!1,this.body.replaceChildren()),this.data=t,this}update(){let{body:t,formats:r,data:n,schema:i,limit:o}=this,s=i.length,a=0;for(let c of n){++a;let l=document.createElement("tr");for(let u=0;u<s;++u){let f=c[i[u].column],d=document.createElement("td");d.innerText=f==null?"":r[u](f),l.appendChild(d)}t.appendChild(l)}return a<o&&(this.loaded=!0),this.pending=!1,this}sort(t,r){r===this.sortColumn?this.sortDesc=!this.sortDesc:(this.sortColumn=r,this.sortDesc=!1);let n=t.currentTarget,i=this.sortHeader;i===n&&t.metaKey?(i.firstChild.textContent="",this.sortHeader=null,this.sortColumn=null):(i&&(i.firstChild.textContent=""),this.sortHeader=n,n.firstChild.textContent=this.sortDesc?"\u25BE":"\u25B4"),this.requestData()}};function Rdt(e={},t,r){return t.map(({column:n,type:i})=>{if(n in e)return e[n];switch(i){case"number":return QT(r);case"date":return OF;default:return BF(r)}})}function kdt(e={},t){return t.map(({column:r,type:n})=>r in e?e[r]:n==="number"?"right":"left")}function Cdt(e={},t){return t.map(({column:r})=>e[r])}function Udt(e,t,r){let n=[];return t.forEach((i,o)=>{let s=+r[o];if(i!=="left"||s){let a=i!=="left"?`text-align:${i};`:"",c=s?`width:${s}px;max-width:${s}px;`:"";n.push(`#${e} tr>:nth-child(${o+1}) {${a}${c}}`)}}),n.join(" ")}function Ux(e,...t){let r=e?.context?.coordinator??co();for(let n of t)r.connect(n)}function JT(e,t,r){let n=new t(r);return Ux(e,n),n.element}function OG(e){return JT(this,Lx,e)}function NG(e){return JT(this,Rx,e)}function FG(e){return JT(this,kx,e)}function LG(e){return JT(this,Cx,e)}function RG({direction:e="vertical",wrap:t=!1},r){let n=document.createElement("div");return n.style.display="flex",n.style.flexDirection=e==="vertical"?"column":"row",n.style.flexWrap=t?t===!0?"wrap":t:"nowrap",n.style.justifyContent="flex-start",n.style.alignItems="flex-start",r.forEach(i=>n.appendChild(i)),n.value={element:n},n}function kG(...e){return RG({direction:"vertical"},e.flat())}function CG(...e){return RG({direction:"horizontal"},e.flat())}function UG({dim:e="width",size:t=10}){let r=document.createElement("span");r.style.display="inline-block",r.style[e]=Number.isNaN(+t)?t:`${t}px`;let n={element:r};return r.value=n,r}function PG(e){return UG({dim:"height",size:e})}function $G(e){return UG({dim:"width",size:e})}var jG={};Ir(jG,{align:()=>GF,aspectRatio:()=>XF,axis:()=>HF,colorBase:()=>LR,colorClamp:()=>SR,colorConstant:()=>kR,colorDomain:()=>wR,colorExponent:()=>RR,colorInterpolate:()=>MR,colorLabel:()=>BR,colorN:()=>IR,colorNice:()=>TR,colorPivot:()=>ER,colorRange:()=>vR,colorReverse:()=>OR,colorScale:()=>_R,colorScheme:()=>AR,colorSymmetric:()=>DR,colorTickFormat:()=>FR,colorZero:()=>NR,facetGrid:()=>bL,facetLabel:()=>xL,facetMargin:()=>hL,facetMarginBottom:()=>mL,facetMarginLeft:()=>yL,facetMarginRight:()=>gL,facetMarginTop:()=>pL,fxAlign:()=>ML,fxAriaDescription:()=>YL,fxAriaLabel:()=>qL,fxAxis:()=>OL,fxDomain:()=>_L,fxFontVariant:()=>jL,fxGrid:()=>UL,fxInset:()=>SL,fxInsetLeft:()=>IL,fxInsetRight:()=>TL,fxLabel:()=>$L,fxLabelAnchor:()=>zL,fxLabelOffset:()=>VL,fxLine:()=>PL,fxNice:()=>vL,fxPadding:()=>EL,fxPaddingInner:()=>DL,fxPaddingOuter:()=>BL,fxRange:()=>wL,fxReverse:()=>WL,fxRound:()=>AL,fxTickFormat:()=>kL,fxTickPadding:()=>RL,fxTickRotate:()=>CL,fxTickSize:()=>FL,fxTickSpacing:()=>LL,fxTicks:()=>NL,fyAlign:()=>tR,fyAriaDescription:()=>bR,fyAriaLabel:()=>gR,fyAxis:()=>iR,fyDomain:()=>GL,fyFontVariant:()=>yR,fyGrid:()=>fR,fyInset:()=>ZL,fyInsetBottom:()=>QL,fyInsetTop:()=>KL,fyLabel:()=>hR,fyLabelAnchor:()=>pR,fyLabelOffset:()=>mR,fyLine:()=>dR,fyNice:()=>HL,fyPadding:()=>eR,fyPaddingInner:()=>rR,fyPaddingOuter:()=>nR,fyRange:()=>XL,fyReverse:()=>xR,fyRound:()=>JL,fyTickFormat:()=>lR,fyTickPadding:()=>cR,fyTickRotate:()=>uR,fyTickSize:()=>sR,fyTickSpacing:()=>aR,fyTicks:()=>oR,grid:()=>KF,height:()=>VF,inset:()=>ZF,label:()=>QF,lengthBase:()=>u4,lengthClamp:()=>a4,lengthConstant:()=>d4,lengthDomain:()=>o4,lengthExponent:()=>f4,lengthNice:()=>c4,lengthRange:()=>s4,lengthScale:()=>i4,lengthZero:()=>l4,margin:()=>UF,marginBottom:()=>WF,marginLeft:()=>jF,marginRight:()=>qF,marginTop:()=>YF,margins:()=>CF,name:()=>RF,opacityBase:()=>WR,opacityClamp:()=>$R,opacityConstant:()=>XR,opacityDomain:()=>UR,opacityExponent:()=>GR,opacityLabel:()=>VR,opacityNice:()=>zR,opacityRange:()=>PR,opacityReverse:()=>jR,opacityScale:()=>CR,opacityTickFormat:()=>YR,opacityZero:()=>qR,padding:()=>JF,projectionClip:()=>S4,projectionDomain:()=>g4,projectionInset:()=>b4,projectionInsetBottom:()=>v4,projectionInsetLeft:()=>x4,projectionInsetRight:()=>_4,projectionInsetTop:()=>w4,projectionParallels:()=>p4,projectionPrecision:()=>m4,projectionRotate:()=>y4,projectionType:()=>h4,rBase:()=>e4,rClamp:()=>QR,rConstant:()=>n4,rDomain:()=>ZR,rExponent:()=>r4,rNice:()=>JR,rRange:()=>KR,rScale:()=>HR,rZero:()=>t4,round:()=>t6,style:()=>$F,width:()=>zF,xAlign:()=>u6,xAriaDescription:()=>E6,xAriaLabel:()=>M6,xAxis:()=>p6,xBase:()=>O6,xClamp:()=>c6,xConstant:()=>F6,xDomain:()=>r6,xExponent:()=>N6,xFontVariant:()=>A6,xGrid:()=>w6,xInset:()=>o6,xInsetLeft:()=>s6,xInsetRight:()=>a6,xLabel:()=>S6,xLabelAnchor:()=>I6,xLabelOffset:()=>T6,xLine:()=>v6,xNice:()=>i6,xPadding:()=>f6,xPaddingInner:()=>d6,xPaddingOuter:()=>h6,xRange:()=>n6,xReverse:()=>D6,xRound:()=>l6,xScale:()=>e6,xTickFormat:()=>x6,xTickPadding:()=>b6,xTickRotate:()=>_6,xTickSize:()=>y6,xTickSpacing:()=>g6,xTicks:()=>m6,xZero:()=>B6,xyDomain:()=>PF,yAlign:()=>j6,yAriaDescription:()=>aL,yAriaLabel:()=>sL,yAxis:()=>G6,yBase:()=>uL,yClamp:()=>z6,yConstant:()=>dL,yDomain:()=>R6,yExponent:()=>fL,yFontVariant:()=>oL,yGrid:()=>tL,yInset:()=>U6,yInsetBottom:()=>$6,yInsetTop:()=>P6,yLabel:()=>rL,yLabelAnchor:()=>nL,yLabelOffset:()=>iL,yLine:()=>eL,yNice:()=>C6,yPadding:()=>q6,yPaddingInner:()=>Y6,yPaddingOuter:()=>W6,yRange:()=>k6,yReverse:()=>cL,yRound:()=>V6,yScale:()=>L6,yTickFormat:()=>Q6,yTickPadding:()=>K6,yTickRotate:()=>J6,yTickSize:()=>H6,yTickSpacing:()=>Z6,yTicks:()=>X6,yZero:()=>lL});var Px=class extends Map{request(t,r){if(this.has(t))r(this.get(t));else{let n=this.waiting||(this.waiting=new Map),i=n.get(t)||[];n.set(t,i.concat(r))}}set(t,r){this.has(t)&&console.warn(`Overwriting named plot "${t}".`);let{waiting:n}=this;return n?.has(t)&&(n.get(t).forEach(i=>i(r)),n.delete(t)),super.set(t,r)}},FF=new Px;function LF(e,t,r){(e?.context?.namedPlots??FF).request(t,r)}function zG(e,t,r){(e?.context?.namedPlots??FF).set(t,r)}function RF(e){return t=>zG(this,e,t)}function VG(e,t,r){yi(r)?(r.addEventListener("value",n=>{e.setAttribute(t,n),e.update()}),r.value!==void 0&&e.setAttribute(t,r.value)):e.setAttribute(t,r)}function Pdt(e,t){return r=>{VG(r,e,t)}}function kF(e){return t=>{for(let[r,n]of Object.entries(e))VG(t,r,n)}}function CF(e){let{top:t,bottom:r,left:n,right:i}=e,o={};return t!==void 0&&(o.marginTop=t),r!==void 0&&(o.marginBottom=r),n!==void 0&&(o.marginLeft=n),i!==void 0&&(o.marginRight=i),kF(o)}function UF(e){return kF({marginTop:e,marginBottom:e,marginLeft:e,marginRight:e})}function PF(e){return kF({xDomain:e,yDomain:e})}var L=e=>t=>Pdt(e,t),$F=L("style"),zF=L("width"),VF=L("height"),jF=L("marginLeft"),qF=L("marginRight"),YF=L("marginTop"),WF=L("marginBottom"),GF=L("align"),XF=L("aspectRatio"),HF=L("axis"),ZF=L("inset"),KF=L("grid"),QF=L("label"),JF=L("padding"),t6=L("round"),e6=L("xScale"),r6=L("xDomain"),n6=L("xRange"),i6=L("xNice"),o6=L("xInset"),s6=L("xInsetLeft"),a6=L("xInsetRight"),c6=L("xClamp"),l6=L("xRound"),u6=L("xAlign"),f6=L("xPadding"),d6=L("xPaddingInner"),h6=L("xPaddingOuter"),p6=L("xAxis"),m6=L("xTicks"),y6=L("xTickSize"),g6=L("xTickSpacing"),b6=L("xTickPadding"),x6=L("xTickFormat"),_6=L("xTickRotate"),w6=L("xGrid"),v6=L("xLine"),S6=L("xLabel"),I6=L("xLabelAnchor"),T6=L("xLabelOffset"),A6=L("xFontVariant"),M6=L("xAriaLabel"),E6=L("xAriaDescription"),D6=L("xReverse"),B6=L("xZero"),O6=L("xBase"),N6=L("xExponent"),F6=L("xConstant"),L6=L("yScale"),R6=L("yDomain"),k6=L("yRange"),C6=L("yNice"),U6=L("yInset"),P6=L("yInsetTop"),$6=L("yInsetBottom"),z6=L("yClamp"),V6=L("yRound"),j6=L("yAlign"),q6=L("yPadding"),Y6=L("yPaddingInner"),W6=L("yPaddingOuter"),G6=L("yAxis"),X6=L("yTicks"),H6=L("yTickSize"),Z6=L("yTickSpacing"),K6=L("yTickPadding"),Q6=L("yTickFormat"),J6=L("yTickRotate"),tL=L("yGrid"),eL=L("yLine"),rL=L("yLabel"),nL=L("yLabelAnchor"),iL=L("yLabelOffset"),oL=L("yFontVariant"),sL=L("yAriaLabel"),aL=L("yAriaDescription"),cL=L("yReverse"),lL=L("yZero"),uL=L("yBase"),fL=L("yExponent"),dL=L("yConstant"),hL=L("facetMargin"),pL=L("facetMarginTop"),mL=L("facetMarginBottom"),yL=L("facetMarginLeft"),gL=L("facetMarginRight"),bL=L("facetGrid"),xL=L("facetLabel"),_L=L("fxDomain"),wL=L("fxRange"),vL=L("fxNice"),SL=L("fxInset"),IL=L("fxInsetLeft"),TL=L("fxInsetRight"),AL=L("fxRound"),ML=L("fxAlign"),EL=L("fxPadding"),DL=L("fxPaddingInner"),BL=L("fxPaddingOuter"),OL=L("fxAxis"),NL=L("fxTicks"),FL=L("fxTickSize"),LL=L("fxTickSpacing"),RL=L("fxTickPadding"),kL=L("fxTickFormat"),CL=L("fxTickRotate"),UL=L("fxGrid"),PL=L("fxLine"),$L=L("fxLabel"),zL=L("fxLabelAnchor"),VL=L("fxLabelOffset"),jL=L("fxFontVariant"),qL=L("fxAriaLabel"),YL=L("fxAriaDescription"),WL=L("fxReverse"),GL=L("fyDomain"),XL=L("fyRange"),HL=L("fyNice"),ZL=L("fyInset"),KL=L("fyInsetTop"),QL=L("fyInsetBottom"),JL=L("fyRound"),tR=L("fyAlign"),eR=L("fyPadding"),rR=L("fyPaddingInner"),nR=L("fyPaddingOuter"),iR=L("fyAxis"),oR=L("fyTicks"),sR=L("fyTickSize"),aR=L("fyTickSpacing"),cR=L("fyTickPadding"),lR=L("fyTickFormat"),uR=L("fyTickRotate"),fR=L("fyGrid"),dR=L("fyLine"),hR=L("fyLabel"),pR=L("fyLabelAnchor"),mR=L("fyLabelOffset"),yR=L("fyFontVariant"),gR=L("fyAriaLabel"),bR=L("fyAriaDescription"),xR=L("fyReverse"),_R=L("colorScale"),wR=L("colorDomain"),vR=L("colorRange"),SR=L("colorClamp"),IR=L("colorN"),TR=L("colorNice"),AR=L("colorScheme"),MR=L("colorInterpolate"),ER=L("colorPivot"),DR=L("colorSymmetric"),BR=L("colorLabel"),OR=L("colorReverse"),NR=L("colorZero"),FR=L("colorTickFormat"),LR=L("colorBase"),RR=L("colorExponent"),kR=L("colorConstant"),CR=L("opacityScale"),UR=L("opacityDomain"),PR=L("opacityRange"),$R=L("opacityClamp"),zR=L("opacityNice"),VR=L("opacityLabel"),jR=L("opacityReverse"),qR=L("opacityZero"),YR=L("opacityTickFormat"),WR=L("opacityBase"),GR=L("opacityExponent"),XR=L("opacityConstant"),HR=L("rScale"),ZR=L("rDomain"),KR=L("rRange"),QR=L("rClamp"),JR=L("rNice"),t4=L("rZero"),e4=L("rBase"),r4=L("rExponent"),n4=L("rConstant"),i4=L("lengthScale"),o4=L("lengthDomain"),s4=L("lengthRange"),a4=L("lengthClamp"),c4=L("lengthNice"),l4=L("lengthZero"),u4=L("lengthBase"),f4=L("lengthExponent"),d4=L("lengthConstant"),h4=L("projectionType"),p4=L("projectionParallels"),m4=L("projectionPrecision"),y4=L("projectionRotate"),g4=L("projectionDomain"),b4=L("projectionInset"),x4=L("projectionInsetLeft"),_4=L("projectionInsetRight"),w4=L("projectionInsetTop"),v4=L("projectionInsetBottom"),S4=L("projectionClip");function qG(e,t){return{table:e,options:t}}var YG={};Ir(YG,{area:()=>T4,areaX:()=>A4,areaY:()=>M4,arrow:()=>b8,axisFx:()=>S8,axisFy:()=>I8,axisX:()=>w8,axisY:()=>v8,barX:()=>O4,barY:()=>N4,cell:()=>F4,cellX:()=>L4,cellY:()=>R4,circle:()=>V4,contour:()=>s8,delaunayLink:()=>m8,delaunayMesh:()=>y8,denseLine:()=>o8,density:()=>i8,densityX:()=>r8,densityY:()=>n8,dot:()=>P4,dotX:()=>$4,dotY:()=>z4,frame:()=>_8,geo:()=>D8,graticule:()=>O8,gridFx:()=>M8,gridFy:()=>E8,gridX:()=>T8,gridY:()=>A8,heatmap:()=>a8,hexagon:()=>j4,hexbin:()=>u8,hexgrid:()=>f8,hull:()=>g8,image:()=>e8,line:()=>E4,lineX:()=>D4,lineY:()=>B4,link:()=>x8,raster:()=>c8,rasterTile:()=>l8,rect:()=>k4,rectX:()=>C4,rectY:()=>U4,regressionY:()=>d8,ruleX:()=>G4,ruleY:()=>X4,sphere:()=>B8,spike:()=>t8,text:()=>q4,textX:()=>Y4,textY:()=>W4,tickX:()=>H4,tickY:()=>Z4,vector:()=>K4,vectorX:()=>Q4,vectorY:()=>J4,voronoi:()=>h8,voronoiMesh:()=>p8});var $dt=new Set(["frame","axisX","axisY","axisFx","axisFy","gridX","gridY","gridFx","gridFy","hexgrid","graticule","sphere"]);function Ct(e,t,r={}){arguments.length===2&&!Array.isArray(t)&&(r=t,t=$dt.has(e)?null:[{}]);let n=e.startsWith("area")||e.startsWith("line")?gx:Sn;return I4(n,e,t,r)}function I4(e,t,r,n){return i=>{i.addMark(new e(t,r,n))}}function ml(e,t,r){return n=>{n.addMark(new e(t,r))}}var T4=(...e)=>Ct("area",...e),A4=(...e)=>Ct("areaX",...e),M4=(...e)=>Ct("areaY",...e),E4=(...e)=>Ct("line",...e),D4=(...e)=>Ct("lineX",...e),B4=(...e)=>Ct("lineY",...e),O4=(...e)=>Ct("barX",...e),N4=(...e)=>Ct("barY",...e),F4=(...e)=>Ct("cell",...e),L4=(...e)=>Ct("cellX",...e),R4=(...e)=>Ct("cellY",...e),k4=(...e)=>Ct("rect",...e),C4=(...e)=>Ct("rectX",...e),U4=(...e)=>Ct("rectY",...e),P4=(...e)=>Ct("dot",...e),$4=(...e)=>Ct("dotX",...e),z4=(...e)=>Ct("dotY",...e),V4=(...e)=>Ct("circle",...e),j4=(...e)=>Ct("hexagon",...e),q4=(...e)=>Ct("text",...e),Y4=(...e)=>Ct("textX",...e),W4=(...e)=>Ct("textY",...e),G4=(...e)=>Ct("ruleX",...e),X4=(...e)=>Ct("ruleY",...e),H4=(...e)=>Ct("tickX",...e),Z4=(...e)=>Ct("tickY",...e),K4=(...e)=>Ct("vector",...e),Q4=(...e)=>Ct("vectoX",...e),J4=(...e)=>Ct("vectorY",...e),t8=(...e)=>Ct("spike",...e),e8=(...e)=>Ct("image",...e),r8=(...e)=>I4(ym,"areaX",...e),n8=(...e)=>I4(ym,"areaY",...e),i8=(...e)=>ml(Ix,...e),o8=(...e)=>ml(Sx,...e),s8=(...e)=>ml(wx,...e),a8=(...e)=>ml(vx,...e),c8=(...e)=>ml(Pu,...e),l8=(...e)=>ml(Mx,...e),u8=(...e)=>ml(Ax,...e),f8=(...e)=>Ct("hexgrid",...e),d8=(...e)=>ml(Ex,...e),h8=(...e)=>Ct("voronoi",...e),p8=(...e)=>Ct("voronoiMesh",...e),m8=(...e)=>Ct("delaunayLink",...e),y8=(...e)=>Ct("delaunayMesh",...e),g8=(...e)=>Ct("hull",...e),b8=(...e)=>Ct("arrow",...e),x8=(...e)=>Ct("link",...e),_8=(...e)=>Ct("frame",...e),w8=(...e)=>Ct("axisX",...e),v8=(...e)=>Ct("axisY",...e),S8=(...e)=>Ct("axisFx",...e),I8=(...e)=>Ct("axisFy",...e),T8=(...e)=>Ct("gridX",...e),A8=(...e)=>Ct("gridY",...e),M8=(...e)=>Ct("gridFx",...e),E8=(...e)=>Ct("gridFy",...e),D8=(...e)=>ml(Tx,...e),B8=(...e)=>Ct("sphere",...e),O8=(...e)=>Ct("graticule",...e);var WG={};Ir(WG,{highlight:()=>N8,intervalX:()=>U8,intervalXY:()=>$8,intervalY:()=>P8,nearestX:()=>k8,nearestY:()=>C8,pan:()=>z8,panX:()=>V8,panY:()=>j8,panZoom:()=>q8,panZoomX:()=>Y8,panZoomY:()=>W8,toggle:()=>vm,toggleColor:()=>R8,toggleX:()=>F8,toggleY:()=>L8});function $u(e,t){return r=>{let n=r.marks[r.marks.length-1];r.addInteractor(new e(n,t))}}function N8({by:e,...t}){return $u(Dx,{selection:e,channels:t})}function vm({as:e,...t}){return $u(Md,{...t,selection:e})}function F8(e){return vm({...e,channels:["x"]})}function L8(e){return vm({...e,channels:["y"]})}function R8(e){return vm({...e,channels:["color"]})}function k8({as:e,...t}){return $u(_m,{...t,selection:e,channel:"x"})}function C8({as:e,...t}){return $u(_m,{...t,selection:e,channel:"y"})}function U8({as:e,...t}){return $u(xm,{...t,selection:e,channel:"x"})}function P8({as:e,...t}){return $u(xm,{...t,selection:e,channel:"y"})}function $8({as:e,...t}){return $u(Nx,{...t,selection:e})}function Sm(e){return $u(Fx,e)}function z8(e={}){return Sm({...e,zoom:!1})}function V8(e={}){return Sm({...e,zoom:!1,pany:!1})}function j8(e={}){return Sm({...e,zoom:!1,panx:!1})}function q8(e={}){return Sm(e)}function Y8(e={}){return Sm({...e,pany:!1})}function W8(e={}){return Sm({...e,panx:!1})}var GG={};Ir(GG,{colorLegend:()=>X8,opacityLegend:()=>H8,symbolLegend:()=>Z8});function G8(e,t={}){if(t.for){let{for:r,...n}=t,i=new wm(e,n),o=typeof r,s=a=>a.addLegend(i,!1);return o==="string"?LF(this,r,s):r.value&&s(r.value),i.element}else return r=>r.addLegend(new wm(e,t))}function X8(e){return G8.call(this,"color",e)}function H8(e){return G8.call(this,"opacity",e)}function Z8(e){return G8.call(this,"symbol",e)}function XG(...e){let t=new px;return e.flat().forEach(r=>r(t)),Ux(this,...t.marks),t.element}function zdt({coordinator:e=co(),namedPlots:t=new Px,extensions:r=null,...n}={}){return{...K8,...r,context:{coordinator:e,namedPlots:t,...n}}}export{Ly as Coordinator,Gs as Fixed,ai as MosaicClient,Nl as Param,Mt as Query,ac as Selection,SM as agg,GF as align,$n as and,T4 as area,A4 as areaX,M4 as areaY,th as argmax,Jd as argmin,XM as arrayAgg,b8 as arrow,XF as aspectRatio,jG as attributeDirectives,IM as avg,HF as axis,S8 as axisFx,I8 as axisFy,w8 as axisX,v8 as axisY,O4 as barX,N4 as barY,KT as bin,By as cast,eh as castDouble,HM as castInteger,F4 as cell,L4 as cellX,R4 as cellY,Ny as centroid,tE as centroidX,eE as centroidY,V4 as circle,LR as colorBase,SR as colorClamp,kR as colorConstant,wR as colorDomain,RR as colorExponent,MR as colorInterpolate,BR as colorLabel,X8 as colorLegend,IR as colorN,TR as colorNice,ER as colorPivot,vR as colorRange,OR as colorReverse,_R as colorScale,AR as colorScheme,DR as colorSymmetric,FR as colorTickFormat,NR as colorZero,El as column,Ux as connect,s8 as contour,co as coordinator,CM as corr,Li as count,UM as covarPop,Ol as create,zdt as createAPIContext,mM as cume_dist,JM as dateDay,KM as dateMonth,QM as dateMonthDay,m8 as delaunayLink,y8 as delaunayMesh,o8 as denseLine,hM as dense_rank,i8 as density,r8 as densityX,n8 as densityY,P4 as dot,$4 as dotX,z4 as dotY,LM as entropy,ic as eq,bL as facetGrid,xL as facetLabel,hL as facetMargin,mL as facetMarginBottom,yL as facetMarginLeft,gL as facetMarginRight,pL as facetMarginTop,YM as first,xM as first_value,_8 as frame,qG as from,ML as fxAlign,YL as fxAriaDescription,qL as fxAriaLabel,OL as fxAxis,_L as fxDomain,jL as fxFontVariant,UL as fxGrid,SL as fxInset,IL as fxInsetLeft,TL as fxInsetRight,$L as fxLabel,zL as fxLabelAnchor,VL as fxLabelOffset,PL as fxLine,vL as fxNice,EL as fxPadding,DL as fxPaddingInner,BL as fxPaddingOuter,wL as fxRange,WL as fxReverse,AL as fxRound,kL as fxTickFormat,RL as fxTickPadding,CL as fxTickRotate,FL as fxTickSize,LL as fxTickSpacing,NL as fxTicks,tR as fyAlign,bR as fyAriaDescription,gR as fyAriaLabel,iR as fyAxis,GL as fyDomain,yR as fyFontVariant,fR as fyGrid,ZL as fyInset,QL as fyInsetBottom,KL as fyInsetTop,hR as fyLabel,pR as fyLabelAnchor,mR as fyLabelOffset,dR as fyLine,HL as fyNice,eR as fyPadding,rR as fyPaddingInner,nR as fyPaddingOuter,XL as fyRange,xR as fyReverse,JL as fyRound,lR as fyTickFormat,cR as fyTickPadding,uR as fyTickRotate,sR as fyTickSize,aR as fyTickSpacing,oR as fyTicks,D8 as geo,Oy as geojson,O8 as graticule,KF as grid,M8 as gridFx,E8 as gridFy,T8 as gridX,A8 as gridY,My as gt,iM as gte,CG as hconcat,a8 as heatmap,VF as height,j4 as hexagon,u8 as hexbin,f8 as hexgrid,N8 as highlight,$G as hspace,g8 as hull,e8 as image,ZF as inset,WG as interactorDirectives,U8 as intervalX,$8 as intervalXY,P8 as intervalY,tr as isBetween,oM as isDistinct,sM as isNotBetween,Ey as isNotDistinct,nc as isNotNull,lf as isNull,FM as kurtosis,QF as label,gM as lag,WM as last,_M as last_value,bM as lead,GG as legendDirectives,u4 as lengthBase,a4 as lengthClamp,d4 as lengthConstant,o4 as lengthDomain,f4 as lengthExponent,c4 as lengthNice,s4 as lengthRange,i4 as lengthScale,l4 as lengthZero,E4 as line,D4 as lineX,B4 as lineY,x8 as link,Fi as literal,iE as loadCSV,rE as loadExtension,oE as loadJSON,cE as loadObjects,sE as loadParquet,aE as loadSpatial,oc as lt,sc as lte,TM as mad,UF as margin,WF as marginBottom,jF as marginLeft,qF as marginRight,YF as marginTop,CF as margins,YG as markDirectives,so as max,MM as median,OG as menu,ao as min,DM as mode,RF as name,FF as namedPlots,k8 as nearestX,C8 as nearestY,uf as neq,nM as not,wM as nth_value,yM as ntile,WR as opacityBase,$R as opacityClamp,XR as opacityConstant,UR as opacityDomain,GR as opacityExponent,VR as opacityLabel,H8 as opacityLegend,zR as opacityNice,PR as opacityRange,jR as opacityReverse,CR as opacityScale,YR as opacityTickFormat,qR as opacityZero,cf as or,JF as padding,z8 as pan,V8 as panX,j8 as panY,q8 as panZoom,Y8 as panZoomX,W8 as panZoomY,pM as percent_rank,XG as plot,AM as product,S4 as projectionClip,g4 as projectionDomain,b4 as projectionInset,v4 as projectionInsetBottom,x4 as projectionInsetLeft,_4 as projectionInsetRight,w4 as projectionInsetTop,p4 as projectionParallels,m4 as projectionPrecision,y4 as projectionRotate,h4 as projectionType,EM as quantile,e4 as rBase,QR as rClamp,n4 as rConstant,ZR as rDomain,r4 as rExponent,JR as rNice,KR as rRange,HR as rScale,t4 as rZero,dM as rank,c8 as raster,l8 as rasterTile,k4 as rect,C4 as rectX,U4 as rectY,d8 as regressionY,LF as requestNamedPlot,wU as restConnector,t6 as round,fM as row_number,G4 as ruleX,X4 as ruleY,NG as search,NM as skewness,FG as slider,x1 as socketConnector,B8 as sphere,t8 as spike,W as sql,OM as stddev,kM as stddevPop,GM as stringAgg,$F as style,Ri as sum,Z8 as symbolLegend,LG as table,q4 as text,Y4 as textX,W4 as textY,H4 as tickX,Z4 as tickY,vm as toggle,R8 as toggleColor,F8 as toggleX,L8 as toggleY,RM as varPop,BM as variance,kG as vconcat,K4 as vector,Q4 as vectorX,J4 as vectorY,h8 as voronoi,p8 as voronoiMesh,PG as vspace,gP as wasmConnector,zF as width,u6 as xAlign,E6 as xAriaDescription,M6 as xAriaLabel,p6 as xAxis,O6 as xBase,c6 as xClamp,F6 as xConstant,r6 as xDomain,N6 as xExponent,A6 as xFontVariant,w6 as xGrid,o6 as xInset,s6 as xInsetLeft,a6 as xInsetRight,S6 as xLabel,I6 as xLabelAnchor,T6 as xLabelOffset,v6 as xLine,i6 as xNice,f6 as xPadding,d6 as xPaddingInner,h6 as xPaddingOuter,n6 as xRange,D6 as xReverse,l6 as xRound,e6 as xScale,x6 as xTickFormat,b6 as xTickPadding,_6 as xTickRotate,y6 as xTickSize,g6 as xTickSpacing,m6 as xTicks,B6 as xZero,PF as xyDomain,j6 as yAlign,aL as yAriaDescription,sL as yAriaLabel,G6 as yAxis,uL as yBase,z6 as yClamp,dL as yConstant,R6 as yDomain,fL as yExponent,oL as yFontVariant,tL as yGrid,U6 as yInset,$6 as yInsetBottom,P6 as yInsetTop,rL as yLabel,nL as yLabelAnchor,iL as yLabelOffset,eL as yLine,C6 as yNice,q6 as yPadding,Y6 as yPaddingInner,W6 as yPaddingOuter,k6 as yRange,cL as yReverse,V6 as yRound,L6 as yScale,Q6 as yTickFormat,K6 as yTickPadding,J6 as yTickRotate,H6 as yTickSize,Z6 as yTickSpacing,X6 as yTicks,lL as yZero};
|