@uwdata/mosaic-spec 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/mosaic-schema.json +2122 -422
  2. package/dist/mosaic-spec.js +7783 -15281
  3. package/dist/mosaic-spec.min.js +29 -38
  4. package/dist/types/ast/ColumnParamRefNode.d.ts +8 -0
  5. package/dist/types/ast/ExpressionNode.d.ts +2 -4
  6. package/dist/types/ast/ParamNode.d.ts +1 -2
  7. package/dist/types/ast/ParamRefNode.d.ts +1 -1
  8. package/dist/types/ast/SelectionNode.d.ts +15 -5
  9. package/dist/types/constants.d.ts +2 -1
  10. package/dist/types/parse-spec.d.ts +33 -8
  11. package/dist/types/spec/Input.d.ts +1 -1
  12. package/dist/types/spec/Param.d.ts +6 -0
  13. package/dist/types/spec/PlotAttribute.d.ts +11 -5
  14. package/dist/types/spec/PlotFrom.d.ts +1 -1
  15. package/dist/types/spec/PlotInteractor.d.ts +2 -1
  16. package/dist/types/spec/Transform.d.ts +8 -2
  17. package/dist/types/spec/interactors/BrushStyles.d.ts +27 -0
  18. package/dist/types/spec/interactors/Interval1D.d.ts +6 -27
  19. package/dist/types/spec/interactors/Interval2D.d.ts +6 -5
  20. package/dist/types/spec/interactors/Region.d.ts +32 -0
  21. package/dist/types/spec/interactors/Toggle.d.ts +3 -3
  22. package/dist/types/spec/marks/Marks.d.ts +5 -0
  23. package/package.json +7 -7
  24. package/src/ast/ColumnParamRefNode.js +21 -0
  25. package/src/ast/DataNode.js +3 -3
  26. package/src/ast/ExpressionNode.js +17 -22
  27. package/src/ast/ParamNode.js +3 -4
  28. package/src/ast/ParamRefNode.js +1 -1
  29. package/src/ast/PlotFromNode.js +6 -6
  30. package/src/ast/PlotMarkNode.js +2 -2
  31. package/src/ast/SelectionNode.js +46 -14
  32. package/src/ast/TransformNode.js +14 -12
  33. package/src/config/transforms.js +1 -0
  34. package/src/constants.js +2 -1
  35. package/src/parse-spec.js +53 -16
  36. package/src/spec/Input.ts +1 -1
  37. package/src/spec/Param.ts +7 -0
  38. package/src/spec/PlotAttribute.ts +13 -5
  39. package/src/spec/PlotFrom.ts +1 -1
  40. package/src/spec/PlotInteractor.ts +7 -5
  41. package/src/spec/Spec.ts +1 -1
  42. package/src/spec/Transform.ts +10 -1
  43. package/src/spec/interactors/BrushStyles.ts +27 -0
  44. package/src/spec/interactors/Interval1D.ts +6 -28
  45. package/src/spec/interactors/Interval2D.ts +6 -5
  46. package/src/spec/interactors/Region.ts +34 -0
  47. package/src/spec/interactors/Toggle.ts +3 -3
  48. package/src/spec/marks/Marks.ts +6 -0
@@ -1,30 +1,21 @@
1
- var yq=Object.create;var i2=Object.defineProperty;var gq=Object.getOwnPropertyDescriptor;var xq=Object.getOwnPropertyNames;var bq=Object.getPrototypeOf,wq=Object.prototype.hasOwnProperty;var TO=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Tr=(e,t)=>{for(var n in t)i2(e,n,{get:t[n],enumerable:!0})},_q=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of xq(t))!wq.call(e,i)&&i!==n&&i2(e,i,{get:()=>t[i],enumerable:!(r=gq(t,i))||r.enumerable});return e};var vq=(e,t,n)=>(n=e!=null?yq(bq(e)):{},_q(t||!e||!e.__esModule?i2(n,"default",{value:e,enumerable:!0}):n,e));var fU=TO((SUt,uU)=>{"use strict";function vnt(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 Snt(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 Int(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 Ant(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 Mnt(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 Qy(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)}uU.exports={ge:function(e,t,n,r,i){return Qy(e,t,n,r,i,vnt)},gt:function(e,t,n,r,i){return Qy(e,t,n,r,i,Snt)},lt:function(e,t,n,r,i){return Qy(e,t,n,r,i,Int)},le:function(e,t,n,r,i){return Qy(e,t,n,r,i,Ant)},eq:function(e,t,n,r,i){return Qy(e,t,n,r,i,Mnt)}}});var bU=TO((IUt,xU)=>{"use strict";var Z_=fU(),Ah=0,Jl=1,H_=2;xU.exports=Ent;function g6(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 Ky=g6.prototype;function m6(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 pU(e,t){var n=Mh(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 hU(e,t){var n=e.intervals([]);n.push(t),pU(e,n)}function dU(e,t){var n=e.intervals([]),r=n.indexOf(t);return r<0?Ah:(n.splice(r,1),pU(e,n),Jl)}Ky.intervals=function(e){return e.push.apply(e,this.leftPoints),this.left&&this.left.intervals(e),this.right&&this.right.intervals(e),e};Ky.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)?hU(this,e):this.left.insert(e):this.left=Mh([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?hU(this,e):this.right.insert(e):this.right=Mh([e]);else{var n=Z_.ge(this.leftPoints,e,x6),r=Z_.ge(this.rightPoints,e,b6);this.leftPoints.splice(n,0,e),this.rightPoints.splice(r,0,e)}};Ky.remove=function(e){var t=this.count-this.leftPoints;if(e[1]<this.mid){if(!this.left)return Ah;var n=this.right?this.right.count:0;if(4*n>3*(t-1))return dU(this,e);var r=this.left.remove(e);return r===H_?(this.left=null,this.count-=1,Jl):(r===Jl&&(this.count-=1),r)}else if(e[0]>this.mid){if(!this.right)return Ah;var i=this.left?this.left.count:0;if(4*i>3*(t-1))return dU(this,e);var r=this.right.remove(e);return r===H_?(this.right=null,this.count-=1,Jl):(r===Jl&&(this.count-=1),r)}else{if(this.count===1)return this.leftPoints[0]===e?H_:Ah;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}m6(this,s),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?m6(this,this.left):m6(this,this.right);return Jl}for(var a=Z_.ge(this.leftPoints,e,x6);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=Z_.ge(this.rightPoints,e,b6);r<this.rightPoints.length&&this.rightPoints[r][1]===e[1];++r)if(this.rightPoints[r]===e)return this.rightPoints.splice(r,1),Jl}return Ah}};function mU(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 yU(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 gU(e,t){for(var n=0;n<e.length;++n){var r=t(e[n]);if(r)return r}}Ky.queryPoint=function(e,t){if(e<this.mid){if(this.left){var n=this.left.queryPoint(e,t);if(n)return n}return mU(this.leftPoints,e,t)}else if(e>this.mid){if(this.right){var n=this.right.queryPoint(e,t);if(n)return n}return yU(this.rightPoints,e,t)}else return gU(this.leftPoints,t)};Ky.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?mU(this.leftPoints,t,n):e>this.mid?yU(this.rightPoints,e,n):gU(this.leftPoints,n)};function Tnt(e,t){return e-t}function x6(e,t){var n=e[0]-t[0];return n||e[1]-t[1]}function b6(e,t){var n=e[1]-t[1];return n||e[0]-t[0]}function Mh(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(Tnt);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(x6),l.sort(b6),new g6(r,Mh(i),Mh(o),c,l)}function y6(e){this.root=e}var Th=y6.prototype;Th.insert=function(e){this.root?this.root.insert(e):this.root=new g6(e[0],null,null,[e],[e])};Th.remove=function(e){if(this.root){var t=this.root.remove(e);return t===H_&&(this.root=null),t!==Ah}return!1};Th.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)};Th.queryInterval=function(e,t,n){if(e<=t&&this.root)return this.root.queryInterval(e,t,n)};Object.defineProperty(Th,"count",{get:function(){return this.root?this.root.count:0}});Object.defineProperty(Th,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function Ent(e){return!e||e.length===0?new y6(null):new y6(Mh(e))}});var EO={};function Yh(e,t=!1){let n,r,i=EO;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=EO,a(u)}),i=l}return t?c:a}var hr=class{constructor(t){this._filterBy=t,this._requestUpdate=Yh(()=>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(t){return this}query(t){return null}queryPending(){return this}queryResult(t){return this}queryError(t){return 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 DO(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 J(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 NO(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 $t(e){return this instanceof $t?(this.v=e,this):new $t(e)}function Er(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i={},a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(d){return function(p){return Promise.resolve(p).then(d,f)}}function a(d,p){r[d]&&(i[d]=function(m){return new Promise(function(y,g){o.push([d,m,y,g])>1||c(d,m)})},p&&(i[d]=p(i[d])))}function c(d,p){try{l(r[d](p))}catch(m){h(o[0][3],m)}}function l(d){d.value instanceof $t?Promise.resolve(d.value.v).then(u,f):h(o[0][2],d)}function u(d){c("next",d)}function f(d){c("throw",d)}function h(d,p){d(p),o.shift(),o.length&&c(o[0][0],o[0][1])}}function cu(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:$t(e[i](s)),done:!1}:o?o(s):s}:o}}function Si(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 NO=="function"?NO(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 u2={};Tr(u2,{compareArrayLike:()=>l2,joinUint8Arrays:()=>Dr,memcpy:()=>Wh,rebaseValueOffsets:()=>Yg,toArrayBufferView:()=>zt,toArrayBufferViewAsyncIterator:()=>Ai,toArrayBufferViewIterator:()=>Qi,toBigInt64Array:()=>Vg,toBigUint64Array:()=>Oq,toFloat32Array:()=>Bq,toFloat32ArrayAsyncIterator:()=>Wq,toFloat32ArrayIterator:()=>Uq,toFloat64Array:()=>Lq,toFloat64ArrayAsyncIterator:()=>Hq,toFloat64ArrayIterator:()=>zq,toInt16Array:()=>Eq,toInt16ArrayAsyncIterator:()=>Vq,toInt16ArrayIterator:()=>Rq,toInt32Array:()=>Ic,toInt32ArrayAsyncIterator:()=>Yq,toInt32ArrayIterator:()=>Fq,toInt8Array:()=>Tq,toInt8ArrayAsyncIterator:()=>jq,toInt8ArrayIterator:()=>kq,toUint16Array:()=>Nq,toUint16ArrayAsyncIterator:()=>Xq,toUint16ArrayIterator:()=>$q,toUint32Array:()=>Dq,toUint32ArrayAsyncIterator:()=>Gq,toUint32ArrayIterator:()=>Pq,toUint8Array:()=>St,toUint8ArrayAsyncIterator:()=>c2,toUint8ArrayIterator:()=>a2,toUint8ClampedArray:()=>Cq,toUint8ClampedArrayAsyncIterator:()=>Zq,toUint8ClampedArrayIterator:()=>qq});var Sq=new TextDecoder("utf-8"),Xh=e=>Sq.decode(e),Iq=new TextEncoder,Ji=e=>Iq.encode(e);var Aq=e=>typeof e=="number",OO=e=>typeof e=="boolean",rn=e=>typeof e=="function",Wn=e=>e!=null&&Object(e)===e,Nr=e=>Wn(e)&&rn(e.then);var Ii=e=>Wn(e)&&rn(e[Symbol.iterator]),Zr=e=>Wn(e)&&rn(e[Symbol.asyncIterator]),$g=e=>Wn(e)&&Wn(e.schema);var Pg=e=>Wn(e)&&"done"in e&&"value"in e;var Ug=e=>Wn(e)&&rn(e.stat)&&Aq(e.fd);var zg=e=>Wn(e)&&Gh(e.body),qg=e=>"_getDOMStream"in e&&"_getNodeStream"in e,BO=e=>Wn(e)&&rn(e.abort)&&rn(e.getWriter)&&!qg(e),Gh=e=>Wn(e)&&rn(e.cancel)&&rn(e.getReader)&&!qg(e),LO=e=>Wn(e)&&rn(e.end)&&rn(e.write)&&OO(e.writable)&&!qg(e),jg=e=>Wn(e)&&rn(e.read)&&rn(e.pipe)&&OO(e.readable)&&!qg(e),CO=e=>Wn(e)&&rn(e.clear)&&rn(e.bytes)&&rn(e.position)&&rn(e.setPosition)&&rn(e.capacity)&&rn(e.getBufferIdentifier)&&rn(e.createLong);var s2=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Mq(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 Wh(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 Dr(e,t){let n=Mq(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?Wh(s,o,a):s=o;break}Wh(s||(s=new Uint8Array(l)),o,a),a+=o.length}return[s||new Uint8Array(0),n.slice(c),r-(s?s.byteLength:0)]}function zt(e,t){let n=Pg(t)?t.value:t;return n instanceof e?e===Uint8Array?new e(n.buffer,n.byteOffset,n.byteLength):n:n?(typeof n=="string"&&(n=Ji(n)),n instanceof ArrayBuffer?new e(n):n instanceof s2?new e(n):CO(n)?zt(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 Tq=e=>zt(Int8Array,e),Eq=e=>zt(Int16Array,e),Ic=e=>zt(Int32Array,e),Vg=e=>zt(BigInt64Array,e),St=e=>zt(Uint8Array,e),Nq=e=>zt(Uint16Array,e),Dq=e=>zt(Uint32Array,e),Oq=e=>zt(BigUint64Array,e),Bq=e=>zt(Float32Array,e),Lq=e=>zt(Float64Array,e),Cq=e=>zt(Uint8ClampedArray,e),o2=e=>(e.next(),e);function*Qi(e,t){let n=function*(i){yield i},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof s2?n(t):Ii(t)?t:n(t);return yield*o2(function*(i){let o=null;do o=i.next(yield zt(e,o));while(!o.done)}(r[Symbol.iterator]())),new e}var kq=e=>Qi(Int8Array,e),Rq=e=>Qi(Int16Array,e),Fq=e=>Qi(Int32Array,e),a2=e=>Qi(Uint8Array,e),$q=e=>Qi(Uint16Array,e),Pq=e=>Qi(Uint32Array,e),Uq=e=>Qi(Float32Array,e),zq=e=>Qi(Float64Array,e),qq=e=>Qi(Uint8ClampedArray,e);function Ai(e,t){return Er(this,arguments,function*(){if(Nr(t))return yield $t(yield $t(yield*cu(Si(Ai(e,yield $t(t))))));let r=function(s){return Er(this,arguments,function*(){yield yield $t(yield $t(s))})},i=function(s){return Er(this,arguments,function*(){yield $t(yield*cu(Si(o2(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 s2?r(t):Ii(t)?i(t):Zr(t)?t:r(t);return yield $t(yield*cu(Si(o2(function(s){return Er(this,arguments,function*(){let a=null;do a=yield $t(s.next(yield yield $t(zt(e,a))));while(!a.done)})}(o[Symbol.asyncIterator]()))))),yield $t(new e)})}var jq=e=>Ai(Int8Array,e),Vq=e=>Ai(Int16Array,e),Yq=e=>Ai(Int32Array,e),c2=e=>Ai(Uint8Array,e),Xq=e=>Ai(Uint16Array,e),Gq=e=>Ai(Uint32Array,e),Wq=e=>Ai(Float32Array,e),Hq=e=>Ai(Float64Array,e),Zq=e=>Ai(Uint8ClampedArray,e);function Yg(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 l2(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 vn={fromIterable(e){return Xg(Jq(e))},fromAsyncIterable(e){return Xg(Qq(e))},fromDOMStream(e){return Xg(Kq(e))},fromNodeStream(e){return Xg(tj(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')}},Xg=e=>(e.next(),e);function*Jq(e){let t,n=!1,r=[],i,o,s,a=0;function c(){return o==="peek"?Dr(r,s)[0]:([i,r,a]=Dr(r,s),i)}({cmd:o,size:s}=(yield null)||{cmd:"read",size:0});let l=a2(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 Qq(e){return Er(this,arguments,function*(){let n,r=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Dr(i,a)[0]:([o,i,c]=Dr(i,a),o)}({cmd:s,size:a}=(yield yield $t(null))||{cmd:"read",size:0});let u=c2(e)[Symbol.asyncIterator]();try{do if({done:n,value:o}=Number.isNaN(a-c)?yield $t(u.next()):yield $t(u.next(a-c)),!n&&o.byteLength>0&&(i.push(o),c+=o.byteLength),n||a<=c)do({cmd:s,size:a}=yield yield $t(l()));while(a<c);while(!n)}catch(f){(r=!0)&&typeof u.throw=="function"&&(yield $t(u.throw(f)))}finally{r===!1&&typeof u.return=="function"&&(yield $t(u.return(new Uint8Array(0))))}return yield $t(null)})}function Kq(e){return Er(this,arguments,function*(){let n=!1,r=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Dr(i,a)[0]:([o,i,c]=Dr(i,a),o)}({cmd:s,size:a}=(yield yield $t(null))||{cmd:"read",size:0});let u=new h2(e);try{do if({done:n,value:o}=Number.isNaN(a-c)?yield $t(u.read()):yield $t(u.read(a-c)),!n&&o.byteLength>0&&(i.push(St(o)),c+=o.byteLength),n||a<=c)do({cmd:s,size:a}=yield yield $t(l()));while(a<c);while(!n)}catch(f){(r=!0)&&(yield $t(u.cancel(f)))}finally{r===!1?yield $t(u.cancel()):e.locked&&u.releaseLock()}return yield $t(null)})}var h2=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 J(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 J(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=St(n)),n})}},f2=(e,t)=>{let n=i=>r([t,i]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function tj(e){return Er(this,arguments,function*(){let n=[],r="error",i=!1,o=null,s,a,c=0,l=[],u;function f(){return s==="peek"?Dr(l,a)[0]:([u,l,c]=Dr(l,a),u)}if({cmd:s,size:a}=(yield yield $t(null))||{cmd:"read",size:0},e.isTTY)return yield yield $t(new Uint8Array(0)),yield $t(null);try{n[0]=f2(e,"end"),n[1]=f2(e,"error");do{if(n[2]=f2(e,"readable"),[r,o]=yield $t(Promise.race(n.map(d=>d[2]))),r==="error")break;if((i=r==="end")||(Number.isFinite(a-c)?(u=St(e.read(a-c)),u.byteLength<a-c&&(u=St(e.read()))):u=St(e.read()),u.byteLength>0&&(l.push(u),c+=u.byteLength)),i||a<=c)do({cmd:s,size:a}=yield yield $t(f()));while(a<c)}while(!i)}finally{yield $t(h(n,r==="error"?o:null))}return yield $t(null);function h(d,p){return u=l=null,new Promise((m,y)=>{for(let[g,x]of d)e.off(g,x);try{let g=e.destroy;g&&g.call(e,p),p=void 0}catch(g){p=g||p}finally{p!=null?y(p):m()}})}})}var ue;(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"})(ue||(ue={}));var be;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(be||(be={}));var me;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(me||(me={}));var Pe;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(Pe||(Pe={}));var ct;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(ct||(ct={}));var un;(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"})(un||(un={}));var Ki=new Int32Array(2),Gg=new Float32Array(Ki.buffer),Wg=new Float64Array(Ki.buffer),lu=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Hh;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(Hh||(Hh={}));var Or=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 Ki[0]=this.readInt32(t),Gg[0]}readFloat64(t){return Ki[lu?0:1]=this.readInt32(t),Ki[lu?1:0]=this.readInt32(t+4),Wg[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){Gg[0]=n,this.writeInt32(t,Ki[0])}writeFloat64(t,n){Wg[0]=n,this.writeInt32(t,Ki[lu?0:1]),this.writeInt32(t+4,Ki[lu?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===Hh.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 Ac=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=Or.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=Or.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;return 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),this.bb.bytes().set(n,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),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 Zh;(function(e){e[e.BUFFER=0]="BUFFER"})(Zh||(Zh={}));var Jh;(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(Jh||(Jh={}));var Zg=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBodyCompression(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):Jh.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Zh.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,n){t.addFieldInt8(0,n,Jh.LZ4_FRAME)}static addMethod(t,n){t.addFieldInt8(1,n,Zh.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 uu=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 fu=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 Br=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 fu).__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 uu).__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 Zg).__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 ss=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 Br).__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 da;(function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"})(da||(da={}));var Qh;(function(e){e[e.DenseArray=0]="DenseArray"})(Qh||(Qh={}));var Ti=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 Ti).__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):Qh.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,Qh.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var on=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 Kh=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 td=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 pa=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):Pe.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,Pe.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 ma=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):ct.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,ct.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,n){return e.startDuration(t),e.addUnit(t,n),e.endDuration(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 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 ga=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 xa=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):me.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,n){t.addFieldInt16(0,n,me.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,n){return e.startFloatingPoint(t),e.addPrecision(t,n),e.endFloatingPoint(t)}};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):un.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,un.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,n){return e.startInterval(t),e.addUnit(t,n),e.endInterval(t)}};var ed=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsLargeBinary(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return e.startLargeBinary(t),e.endLargeBinary(t)}};var nd=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsLargeUtf8(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return e.startLargeUtf8(t),e.endLargeUtf8(t)}};var rd=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 wa=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 id=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 od=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 as=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):ct.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,ct.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 cs=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):ct.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,ct.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 Ei=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):be.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,be.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 sd=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 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 kn=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):ye.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 on).__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,ye.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 dr=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 kn).__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 on).__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 jt;(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"})(jt||(jt={}));var C;(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"})(C||(C={}));var Ni;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(Ni||(Ni={}));var B2={};Tr(B2,{clampRange:()=>wd,createElementComparator:()=>Ia,wrapIndex:()=>Mc});var d2={};Tr(d2,{valueToString:()=>Di});function Di(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=>Di(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,n)=>typeof n=="bigint"?`${n}`:n)}var g2={};Tr(g2,{BN:()=>cd,bigNumToBigInt:()=>RO,bigNumToNumber:()=>y2,bigNumToString:()=>pu,isArrowBigNumSymbol:()=>kO});function te(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)}function p2(e,t){return te(e/t)+te(e%t)/te(t)}var kO=Symbol.for("isArrowBigNum");function Oi(e,...t){return t.length===0?Object.setPrototypeOf(zt(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}Oi.prototype[kO]=!0;Oi.prototype.toJSON=function(){return`"${pu(this)}"`};Oi.prototype.valueOf=function(e){return y2(this,e)};Oi.prototype.toString=function(){return pu(this)};Oi.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return y2(this);case"string":return pu(this);case"default":return RO(this)}return pu(this)};function hu(...e){return Oi.apply(this,e)}function du(...e){return Oi.apply(this,e)}function ad(...e){return Oi.apply(this,e)}Object.setPrototypeOf(hu.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(du.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(ad.prototype,Object.create(Uint32Array.prototype));Object.assign(hu.prototype,Oi.prototype,{constructor:hu,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(du.prototype,Oi.prototype,{constructor:du,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(ad.prototype,Oi.prototype,{constructor:ad,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var ej=BigInt(4294967296)*BigInt(4294967296),nj=ej-BigInt(1);function y2(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:o}=e,s=new BigUint64Array(n,r,i/8),a=o&&s.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),l=0;if(a){for(let u of s)c|=(u^nj)*(BigInt(1)<<BigInt(64*l++));c*=BigInt(-1),c-=BigInt(1)}else for(let u of s)c|=u*(BigInt(1)<<BigInt(64*l++));if(typeof t=="number"){let u=BigInt(Math.pow(10,t)),f=c/u,h=c%u;return te(f)+te(h)/te(u)}return te(c)}function pu(e){if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return m2(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return m2(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`-${m2(t)}`}function RO(e){return e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:pu(e)}function m2(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 cd=class e{static new(t,n){switch(n){case!0:return new hu(t);case!1:return new du(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new hu(t)}return t.byteLength===16?new ad(t):new du(t)}static signed(t){return new hu(t)}static unsigned(t){return new du(t)}static decimal(t){return new ad(t)}constructor(t,n){return e.new(t,n)}};var FO,$O,PO,UO,zO,qO,jO,VO,YO,XO,GO,WO,HO,ZO,JO,QO,KO,t5,e5,n5,r5,i5,W=class e{static isNull(t){return t?.typeId===C.Null}static isInt(t){return t?.typeId===C.Int}static isFloat(t){return t?.typeId===C.Float}static isBinary(t){return t?.typeId===C.Binary}static isLargeBinary(t){return t?.typeId===C.LargeBinary}static isUtf8(t){return t?.typeId===C.Utf8}static isLargeUtf8(t){return t?.typeId===C.LargeUtf8}static isBool(t){return t?.typeId===C.Bool}static isDecimal(t){return t?.typeId===C.Decimal}static isDate(t){return t?.typeId===C.Date}static isTime(t){return t?.typeId===C.Time}static isTimestamp(t){return t?.typeId===C.Timestamp}static isInterval(t){return t?.typeId===C.Interval}static isDuration(t){return t?.typeId===C.Duration}static isList(t){return t?.typeId===C.List}static isStruct(t){return t?.typeId===C.Struct}static isUnion(t){return t?.typeId===C.Union}static isFixedSizeBinary(t){return t?.typeId===C.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===C.FixedSizeList}static isMap(t){return t?.typeId===C.Map}static isDictionary(t){return t?.typeId===C.Dictionary}static isDenseUnion(t){return e.isUnion(t)&&t.mode===be.Dense}static isSparseUnion(t){return e.isUnion(t)&&t.mode===be.Sparse}constructor(t){this.typeId=t}};FO=Symbol.toStringTag;W[FO]=(e=>(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]="DataType"))(W.prototype);var Rn=class extends W{constructor(){super(C.Null)}toString(){return"Null"}};$O=Symbol.toStringTag;Rn[$O]=(e=>e[Symbol.toStringTag]="Null")(Rn.prototype);var Ye=class extends W{constructor(t,n){super(C.Int),this.isSigned=t,this.bitWidth=n}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};PO=Symbol.toStringTag;Ye[PO]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(Ye.prototype);var ld=class extends Ye{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},ud=class extends Ye{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Bi=class extends Ye{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},fd=class extends Ye{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},hd=class extends Ye{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},dd=class extends Ye{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},pd=class extends Ye{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},md=class extends Ye{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(ld.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(ud.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Bi.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(fd.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(hd.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(dd.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(pd.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(md.prototype,"ArrayType",{value:BigUint64Array});var Lr=class extends W{constructor(t){super(C.Float),this.precision=t}get ArrayType(){switch(this.precision){case me.HALF:return Uint16Array;case me.SINGLE:return Float32Array;case me.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};UO=Symbol.toStringTag;Lr[UO]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(Lr.prototype);var yd=class extends Lr{constructor(){super(me.HALF)}},gd=class extends Lr{constructor(){super(me.SINGLE)}},xd=class extends Lr{constructor(){super(me.DOUBLE)}};Object.defineProperty(yd.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(gd.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(xd.prototype,"ArrayType",{value:Float64Array});var no=class extends W{constructor(){super(C.Binary)}toString(){return"Binary"}};zO=Symbol.toStringTag;no[zO]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(no.prototype);var ro=class extends W{constructor(){super(C.LargeBinary)}toString(){return"LargeBinary"}};qO=Symbol.toStringTag;ro[qO]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeBinary"))(ro.prototype);var io=class extends W{constructor(){super(C.Utf8)}toString(){return"Utf8"}};jO=Symbol.toStringTag;io[jO]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(io.prototype);var oo=class extends W{constructor(){super(C.LargeUtf8)}toString(){return"LargeUtf8"}};VO=Symbol.toStringTag;oo[VO]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeUtf8"))(oo.prototype);var so=class extends W{constructor(){super(C.Bool)}toString(){return"Bool"}};YO=Symbol.toStringTag;so[YO]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(so.prototype);var ao=class extends W{constructor(t,n,r=128){super(C.Decimal),this.scale=t,this.precision=n,this.bitWidth=r}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};XO=Symbol.toStringTag;ao[XO]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(ao.prototype);var co=class extends W{constructor(t){super(C.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Pe[this.unit]}>`}get ArrayType(){return this.unit===Pe.DAY?Int32Array:BigInt64Array}};GO=Symbol.toStringTag;co[GO]=(e=>(e.unit=null,e[Symbol.toStringTag]="Date"))(co.prototype);var lo=class extends W{constructor(t,n){super(C.Time),this.unit=t,this.bitWidth=n}toString(){return`Time${this.bitWidth}<${ct[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};WO=Symbol.toStringTag;lo[WO]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(lo.prototype);var uo=class extends W{constructor(t,n){super(C.Timestamp),this.unit=t,this.timezone=n}toString(){return`Timestamp<${ct[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};HO=Symbol.toStringTag;uo[HO]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Timestamp"))(uo.prototype);var fo=class extends W{constructor(t){super(C.Interval),this.unit=t}toString(){return`Interval<${un[this.unit]}>`}};ZO=Symbol.toStringTag;fo[ZO]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(fo.prototype);var ho=class extends W{constructor(t){super(C.Duration),this.unit=t}toString(){return`Duration<${ct[this.unit]}>`}};JO=Symbol.toStringTag;ho[JO]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(ho.prototype);var Qr=class extends W{constructor(t){super(C.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}};QO=Symbol.toStringTag;Qr[QO]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(Qr.prototype);var we=class extends W{constructor(t){super(C.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};KO=Symbol.toStringTag;we[KO]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(we.prototype);var Kr=class extends W{constructor(t,n,r){super(C.Union),this.mode=t,this.children=r,this.typeIds=n=Int32Array.from(n),this.typeIdToChildIndex=n.reduce((i,o,s)=>(i[o]=s)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};t5=Symbol.toStringTag;Kr[t5]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(Kr.prototype);var po=class extends W{constructor(t){super(C.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};e5=Symbol.toStringTag;po[e5]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(po.prototype);var ti=class extends W{constructor(t,n){super(C.FixedSizeList),this.listSize=t,this.children=[n]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};n5=Symbol.toStringTag;ti[n5]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(ti.prototype);var ei=class extends W{constructor(t,n=!1){var r,i,o;if(super(C.Map),this.children=[t],this.keysSorted=n,t&&(t.name="entries",!((r=t?.type)===null||r===void 0)&&r.children)){let s=(i=t?.type)===null||i===void 0?void 0:i.children[0];s&&(s.name="key");let a=(o=t?.type)===null||o===void 0?void 0:o.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};r5=Symbol.toStringTag;ei[r5]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(ei.prototype);var rj=(e=>()=>++e)(-1),pr=class extends W{constructor(t,n,r,i){super(C.Dictionary),this.indices=n,this.dictionary=t,this.isOrdered=i||!1,this.id=r==null?rj():te(r)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};i5=Symbol.toStringTag;pr[i5]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(pr.prototype);function Cr(e){let t=e;switch(e.typeId){case C.Decimal:return e.bitWidth/32;case C.Interval:return 1+t.unit;case C.FixedSizeList:return t.listSize;case C.FixedSizeBinary:return t.byteWidth;default:return 1}}var mt=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 ij(this,t,n)}getVisitFnByTypeId(t,n=!0){return mu(this,t,n)}visitNull(t,...n){return null}visitBool(t,...n){return null}visitInt(t,...n){return null}visitFloat(t,...n){return null}visitUtf8(t,...n){return null}visitLargeUtf8(t,...n){return null}visitBinary(t,...n){return null}visitLargeBinary(t,...n){return null}visitFixedSizeBinary(t,...n){return null}visitDate(t,...n){return null}visitTimestamp(t,...n){return null}visitTime(t,...n){return null}visitDecimal(t,...n){return null}visitList(t,...n){return null}visitStruct(t,...n){return null}visitUnion(t,...n){return null}visitDictionary(t,...n){return null}visitInterval(t,...n){return null}visitDuration(t,...n){return null}visitFixedSizeList(t,...n){return null}visitMap(t,...n){return null}};function ij(e,t,n=!0){return typeof t=="number"?mu(e,t,n):typeof t=="string"&&t in C?mu(e,C[t],n):t&&t instanceof W?mu(e,o5(t),n):t?.type&&t.type instanceof W?mu(e,o5(t.type),n):mu(e,C.NONE,n)}function mu(e,t,n=!0){let r=null;switch(t){case C.Null:r=e.visitNull;break;case C.Bool:r=e.visitBool;break;case C.Int:r=e.visitInt;break;case C.Int8:r=e.visitInt8||e.visitInt;break;case C.Int16:r=e.visitInt16||e.visitInt;break;case C.Int32:r=e.visitInt32||e.visitInt;break;case C.Int64:r=e.visitInt64||e.visitInt;break;case C.Uint8:r=e.visitUint8||e.visitInt;break;case C.Uint16:r=e.visitUint16||e.visitInt;break;case C.Uint32:r=e.visitUint32||e.visitInt;break;case C.Uint64:r=e.visitUint64||e.visitInt;break;case C.Float:r=e.visitFloat;break;case C.Float16:r=e.visitFloat16||e.visitFloat;break;case C.Float32:r=e.visitFloat32||e.visitFloat;break;case C.Float64:r=e.visitFloat64||e.visitFloat;break;case C.Utf8:r=e.visitUtf8;break;case C.LargeUtf8:r=e.visitLargeUtf8;break;case C.Binary:r=e.visitBinary;break;case C.LargeBinary:r=e.visitLargeBinary;break;case C.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case C.Date:r=e.visitDate;break;case C.DateDay:r=e.visitDateDay||e.visitDate;break;case C.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case C.Timestamp:r=e.visitTimestamp;break;case C.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case C.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case C.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case C.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case C.Time:r=e.visitTime;break;case C.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case C.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case C.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case C.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case C.Decimal:r=e.visitDecimal;break;case C.List:r=e.visitList;break;case C.Struct:r=e.visitStruct;break;case C.Union:r=e.visitUnion;break;case C.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case C.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case C.Dictionary:r=e.visitDictionary;break;case C.Interval:r=e.visitInterval;break;case C.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case C.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case C.Duration:r=e.visitDuration;break;case C.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case C.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case C.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case C.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case C.FixedSizeList:r=e.visitFixedSizeList;break;case C.Map:r=e.visitMap;break}if(typeof r=="function")return r;if(!n)return()=>null;throw new Error(`Unrecognized type '${C[t]}'`)}function o5(e){switch(e.typeId){case C.Null:return C.Null;case C.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?C.Int8:C.Uint8;case 16:return n?C.Int16:C.Uint16;case 32:return n?C.Int32:C.Uint32;case 64:return n?C.Int64:C.Uint64}return C.Int}case C.Float:switch(e.precision){case me.HALF:return C.Float16;case me.SINGLE:return C.Float32;case me.DOUBLE:return C.Float64}return C.Float;case C.Binary:return C.Binary;case C.LargeBinary:return C.LargeBinary;case C.Utf8:return C.Utf8;case C.LargeUtf8:return C.LargeUtf8;case C.Bool:return C.Bool;case C.Decimal:return C.Decimal;case C.Time:switch(e.unit){case ct.SECOND:return C.TimeSecond;case ct.MILLISECOND:return C.TimeMillisecond;case ct.MICROSECOND:return C.TimeMicrosecond;case ct.NANOSECOND:return C.TimeNanosecond}return C.Time;case C.Timestamp:switch(e.unit){case ct.SECOND:return C.TimestampSecond;case ct.MILLISECOND:return C.TimestampMillisecond;case ct.MICROSECOND:return C.TimestampMicrosecond;case ct.NANOSECOND:return C.TimestampNanosecond}return C.Timestamp;case C.Date:switch(e.unit){case Pe.DAY:return C.DateDay;case Pe.MILLISECOND:return C.DateMillisecond}return C.Date;case C.Interval:switch(e.unit){case un.DAY_TIME:return C.IntervalDayTime;case un.YEAR_MONTH:return C.IntervalYearMonth}return C.Interval;case C.Duration:switch(e.unit){case ct.SECOND:return C.DurationSecond;case ct.MILLISECOND:return C.DurationMillisecond;case ct.MICROSECOND:return C.DurationMicrosecond;case ct.NANOSECOND:return C.DurationNanosecond}return C.Duration;case C.Map:return C.Map;case C.List:return C.List;case C.Struct:return C.Struct;case C.Union:switch(e.mode){case be.Dense:return C.DenseUnion;case be.Sparse:return C.SparseUnion}return C.Union;case C.FixedSizeBinary:return C.FixedSizeBinary;case C.FixedSizeList:return C.FixedSizeList;case C.Dictionary:return C.Dictionary}throw new Error(`Unrecognized type '${C[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 x2={};Tr(x2,{float64ToUint16:()=>bd,uint16ToFloat64:()=>Jg});var s5=new Float64Array(1),yu=new Uint32Array(s5.buffer);function Jg(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 bd(e){if(e!==e)return 32256;s5[0]=e;let t=(yu[1]&2147483648)>>16&65535,n=yu[1]&2146435072,r=0;return n>=1089470464?yu[0]>0?n=31744:(n=(n&2080374784)>>16,r=(yu[1]&1048575)>>10):n<=1056964608?(r=1048576+(yu[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(yu[1]&1048575)+512>>10),t|n|r&65535}var _t=class extends mt{};function Tt(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}var oj=(e,t,n)=>{e[t]=Math.floor(n/864e5)},a5=(e,t,n,r)=>{if(n+1<t.length){let i=te(t[n]),o=te(t[n+1]);e.set(r.subarray(0,o-i),i)}},sj=({offset:e,values:t},n,r)=>{let i=e+n;r?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},ls=({values:e},t,n)=>{e[t]=n},b2=({values:e},t,n)=>{e[t]=n},c5=({values:e},t,n)=>{e[t]=bd(n)},aj=(e,t,n)=>{switch(e.type.precision){case me.HALF:return c5(e,t,n);case me.SINGLE:case me.DOUBLE:return b2(e,t,n)}},Qg=({values:e},t,n)=>{oj(e,t,n.valueOf())},Kg=({values:e},t,n)=>{e[t]=BigInt(n)},w2=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},l5=({values:e,valueOffsets:t},n,r)=>a5(e,t,n,r),u5=({values:e,valueOffsets:t},n,r)=>a5(e,t,n,Ji(r)),_2=(e,t,n)=>{e.type.unit===Pe.DAY?Qg(e,t,n):Kg(e,t,n)},t0=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},e0=({values:e},t,n)=>{e[t]=BigInt(n)},n0=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},r0=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},v2=(e,t,n)=>{switch(e.type.unit){case ct.SECOND:return t0(e,t,n);case ct.MILLISECOND:return e0(e,t,n);case ct.MICROSECOND:return n0(e,t,n);case ct.NANOSECOND:return r0(e,t,n)}},i0=({values:e},t,n)=>{e[t]=n},o0=({values:e},t,n)=>{e[t]=n},s0=({values:e},t,n)=>{e[t]=n},a0=({values:e},t,n)=>{e[t]=n},S2=(e,t,n)=>{switch(e.type.unit){case ct.SECOND:return i0(e,t,n);case ct.MILLISECOND:return o0(e,t,n);case ct.MICROSECOND:return s0(e,t,n);case ct.NANOSECOND:return a0(e,t,n)}},I2=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},cj=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,o=Sn.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))},lj=(e,t,n)=>{let r=e.children[0],{valueOffsets:i}=e,o=Sn.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},uj=(e,t)=>(n,r,i,o)=>r&&n(r,e,t[o]),fj=(e,t)=>(n,r,i,o)=>r&&n(r,e,t.get(o)),hj=(e,t)=>(n,r,i,o)=>r&&n(r,e,t.get(i.name)),dj=(e,t)=>(n,r,i,o)=>r&&n(r,e,t[i.name]),pj=(e,t,n)=>{let r=e.type.children.map(o=>Sn.getVisitFn(o.type)),i=n instanceof Map?hj(t,n):n instanceof Gt?fj(t,n):Array.isArray(n)?uj(t,n):dj(t,n);e.type.children.forEach((o,s)=>i(r[s],e.children[s],o,s))},mj=(e,t,n)=>{e.type.mode===be.Dense?f5(e,t,n):h5(e,t,n)},f5=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Sn.visit(i,e.valueOffsets[t],n)},h5=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Sn.visit(i,t,n)},yj=(e,t,n)=>{var r;(r=e.dictionary)===null||r===void 0||r.set(e.values[t],n)},A2=(e,t,n)=>{e.type.unit===un.DAY_TIME?c0(e,t,n):l0(e,t,n)},c0=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},l0=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},u0=({values:e},t,n)=>{e[t]=n},f0=({values:e},t,n)=>{e[t]=n},h0=({values:e},t,n)=>{e[t]=n},d0=({values:e},t,n)=>{e[t]=n},M2=(e,t,n)=>{switch(e.type.unit){case ct.SECOND:return u0(e,t,n);case ct.MILLISECOND:return f0(e,t,n);case ct.MICROSECOND:return h0(e,t,n);case ct.NANOSECOND:return d0(e,t,n)}},gj=(e,t,n)=>{let{stride:r}=e,i=e.children[0],o=Sn.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))};_t.prototype.visitBool=Tt(sj);_t.prototype.visitInt=Tt(ls);_t.prototype.visitInt8=Tt(ls);_t.prototype.visitInt16=Tt(ls);_t.prototype.visitInt32=Tt(ls);_t.prototype.visitInt64=Tt(ls);_t.prototype.visitUint8=Tt(ls);_t.prototype.visitUint16=Tt(ls);_t.prototype.visitUint32=Tt(ls);_t.prototype.visitUint64=Tt(ls);_t.prototype.visitFloat=Tt(aj);_t.prototype.visitFloat16=Tt(c5);_t.prototype.visitFloat32=Tt(b2);_t.prototype.visitFloat64=Tt(b2);_t.prototype.visitUtf8=Tt(u5);_t.prototype.visitLargeUtf8=Tt(u5);_t.prototype.visitBinary=Tt(l5);_t.prototype.visitLargeBinary=Tt(l5);_t.prototype.visitFixedSizeBinary=Tt(w2);_t.prototype.visitDate=Tt(_2);_t.prototype.visitDateDay=Tt(Qg);_t.prototype.visitDateMillisecond=Tt(Kg);_t.prototype.visitTimestamp=Tt(v2);_t.prototype.visitTimestampSecond=Tt(t0);_t.prototype.visitTimestampMillisecond=Tt(e0);_t.prototype.visitTimestampMicrosecond=Tt(n0);_t.prototype.visitTimestampNanosecond=Tt(r0);_t.prototype.visitTime=Tt(S2);_t.prototype.visitTimeSecond=Tt(i0);_t.prototype.visitTimeMillisecond=Tt(o0);_t.prototype.visitTimeMicrosecond=Tt(s0);_t.prototype.visitTimeNanosecond=Tt(a0);_t.prototype.visitDecimal=Tt(I2);_t.prototype.visitList=Tt(cj);_t.prototype.visitStruct=Tt(pj);_t.prototype.visitUnion=Tt(mj);_t.prototype.visitDenseUnion=Tt(f5);_t.prototype.visitSparseUnion=Tt(h5);_t.prototype.visitDictionary=Tt(yj);_t.prototype.visitInterval=Tt(A2);_t.prototype.visitIntervalDayTime=Tt(c0);_t.prototype.visitIntervalYearMonth=Tt(l0);_t.prototype.visitDuration=Tt(M2);_t.prototype.visitDurationSecond=Tt(u0);_t.prototype.visitDurationMillisecond=Tt(f0);_t.prototype.visitDurationMicrosecond=Tt(h0);_t.prototype.visitDurationNanosecond=Tt(d0);_t.prototype.visitFixedSizeList=Tt(gj);_t.prototype.visitMap=Tt(lj);var Sn=new _t;var Li=Symbol.for("parent"),gu=Symbol.for("rowIndex"),_a=class{constructor(t,n){return this[Li]=t,this[gu]=n,new Proxy(this,new E2)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[gu],n=this[Li],r=n.type.children,i={};for(let o=-1,s=r.length;++o<s;)i[r[o].name]=Xe.visit(n.children[o],t);return i}toString(){return`{${[...this].map(([t,n])=>`${Di(t)}: ${Di(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new T2(this[Li],this[gu])}},T2=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,Xe.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(_a.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Li]:{writable:!0,enumerable:!1,configurable:!1,value:null},[gu]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var E2=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Li].type.children.map(n=>n.name)}has(t,n){return t[Li].type.children.findIndex(r=>r.name===n)!==-1}getOwnPropertyDescriptor(t,n){if(t[Li].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[Li].type.children.findIndex(i=>i.name===n);if(r!==-1){let i=Xe.visit(t[Li].children[r],t[gu]);return Reflect.set(t,n,i),i}}set(t,n,r){let i=t[Li].type.children.findIndex(o=>o.name===n);return i!==-1?(Sn.visit(t[Li].children[i],t[gu],r),Reflect.set(t,n,r)):Reflect.has(t,n)||typeof n=="symbol"?Reflect.set(t,n,r):!1}};var yt=class extends mt{};function It(e){return(t,n)=>t.getValid(n)?e(t,n):null}var xj=(e,t)=>864e5*e[t],bj=(e,t)=>null,d5=(e,t,n)=>{if(n+1>=t.length)return null;let r=te(t[n]),i=te(t[n+1]);return e.subarray(r,i)},wj=({offset:e,values:t},n)=>{let r=e+n;return(t[r>>3]&1<<r%8)!==0},p5=({values:e},t)=>xj(e,t),m5=({values:e},t)=>te(e[t]),va=({stride:e,values:t},n)=>t[e*n],_j=({stride:e,values:t},n)=>Jg(t[e*n]),y5=({values:e},t)=>e[t],vj=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),g5=({values:e,valueOffsets:t},n)=>d5(e,t,n),x5=({values:e,valueOffsets:t},n)=>{let r=d5(e,t,n);return r!==null?Xh(r):null},Sj=({values:e},t)=>e[t],Ij=({type:e,values:t},n)=>e.precision!==me.HALF?t[n]:Jg(t[n]),Aj=(e,t)=>e.type.unit===Pe.DAY?p5(e,t):m5(e,t),b5=({values:e},t)=>1e3*te(e[t]),w5=({values:e},t)=>te(e[t]),_5=({values:e},t)=>p2(e[t],BigInt(1e3)),v5=({values:e},t)=>p2(e[t],BigInt(1e6)),Mj=(e,t)=>{switch(e.type.unit){case ct.SECOND:return b5(e,t);case ct.MILLISECOND:return w5(e,t);case ct.MICROSECOND:return _5(e,t);case ct.NANOSECOND:return v5(e,t)}},S5=({values:e},t)=>e[t],I5=({values:e},t)=>e[t],A5=({values:e},t)=>e[t],M5=({values:e},t)=>e[t],Tj=(e,t)=>{switch(e.type.unit){case ct.SECOND:return S5(e,t);case ct.MILLISECOND:return I5(e,t);case ct.MICROSECOND:return A5(e,t);case ct.NANOSECOND:return M5(e,t)}},Ej=({values:e,stride:t},n)=>cd.decimal(e.subarray(t*n,t*(n+1))),Nj=(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 Gt([c])},Dj=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:o}=n,s=r[0];return new mo(s.slice(i,o-i))},Oj=(e,t)=>new _a(e,t),Bj=(e,t)=>e.type.mode===be.Dense?T5(e,t):E5(e,t),T5=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Xe.visit(r,e.valueOffsets[t])},E5=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Xe.visit(r,t)},Lj=(e,t)=>{var n;return(n=e.dictionary)===null||n===void 0?void 0:n.get(e.values[t])},Cj=(e,t)=>e.type.unit===un.DAY_TIME?N5(e,t):D5(e,t),N5=({values:e},t)=>e.subarray(2*t,2*(t+1)),D5=({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},O5=({values:e},t)=>e[t],B5=({values:e},t)=>e[t],L5=({values:e},t)=>e[t],C5=({values:e},t)=>e[t],kj=(e,t)=>{switch(e.type.unit){case ct.SECOND:return O5(e,t);case ct.MILLISECOND:return B5(e,t);case ct.MICROSECOND:return L5(e,t);case ct.NANOSECOND:return C5(e,t)}},Rj=(e,t)=>{let{stride:n,children:r}=e,o=r[0].slice(t*n,n);return new Gt([o])};yt.prototype.visitNull=It(bj);yt.prototype.visitBool=It(wj);yt.prototype.visitInt=It(Sj);yt.prototype.visitInt8=It(va);yt.prototype.visitInt16=It(va);yt.prototype.visitInt32=It(va);yt.prototype.visitInt64=It(y5);yt.prototype.visitUint8=It(va);yt.prototype.visitUint16=It(va);yt.prototype.visitUint32=It(va);yt.prototype.visitUint64=It(y5);yt.prototype.visitFloat=It(Ij);yt.prototype.visitFloat16=It(_j);yt.prototype.visitFloat32=It(va);yt.prototype.visitFloat64=It(va);yt.prototype.visitUtf8=It(x5);yt.prototype.visitLargeUtf8=It(x5);yt.prototype.visitBinary=It(g5);yt.prototype.visitLargeBinary=It(g5);yt.prototype.visitFixedSizeBinary=It(vj);yt.prototype.visitDate=It(Aj);yt.prototype.visitDateDay=It(p5);yt.prototype.visitDateMillisecond=It(m5);yt.prototype.visitTimestamp=It(Mj);yt.prototype.visitTimestampSecond=It(b5);yt.prototype.visitTimestampMillisecond=It(w5);yt.prototype.visitTimestampMicrosecond=It(_5);yt.prototype.visitTimestampNanosecond=It(v5);yt.prototype.visitTime=It(Tj);yt.prototype.visitTimeSecond=It(S5);yt.prototype.visitTimeMillisecond=It(I5);yt.prototype.visitTimeMicrosecond=It(A5);yt.prototype.visitTimeNanosecond=It(M5);yt.prototype.visitDecimal=It(Ej);yt.prototype.visitList=It(Nj);yt.prototype.visitStruct=It(Oj);yt.prototype.visitUnion=It(Bj);yt.prototype.visitDenseUnion=It(T5);yt.prototype.visitSparseUnion=It(E5);yt.prototype.visitDictionary=It(Lj);yt.prototype.visitInterval=It(Cj);yt.prototype.visitIntervalDayTime=It(N5);yt.prototype.visitIntervalYearMonth=It(D5);yt.prototype.visitDuration=It(kj);yt.prototype.visitDurationSecond=It(O5);yt.prototype.visitDurationMillisecond=It(B5);yt.prototype.visitDurationMicrosecond=It(L5);yt.prototype.visitDurationNanosecond=It(C5);yt.prototype.visitFixedSizeList=It(Rj);yt.prototype.visitMap=It(Dj);var Xe=new yt;var Sa=Symbol.for("keys"),bu=Symbol.for("vals"),xu=Symbol.for("kKeysAsStrings"),N2=Symbol.for("_kKeysAsStrings"),mo=class{constructor(t){return this[Sa]=new Gt([t.children[0]]).memoize(),this[bu]=t.children[1],new Proxy(this,new O2)}get[xu](){return this[N2]||(this[N2]=Array.from(this[Sa].toArray(),String))}[Symbol.iterator](){return new D2(this[Sa],this[bu])}get size(){return this[Sa].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Sa],n=this[bu],r={};for(let i=-1,o=t.length;++i<o;)r[t.get(i)]=Xe.visit(n,i);return r}toString(){return`{${[...this].map(([t,n])=>`${Di(t)}: ${Di(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},D2=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),Xe.visit(this.vals,t)]})}},O2=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[xu]}has(t,n){return t[xu].includes(n)}getOwnPropertyDescriptor(t,n){if(t[xu].indexOf(n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];let r=t[xu].indexOf(n);if(r!==-1){let i=Xe.visit(Reflect.get(t,bu),r);return Reflect.set(t,n,i),i}}set(t,n,r){let i=t[xu].indexOf(n);return i!==-1?(Sn.visit(Reflect.get(t,bu),i,r),Reflect.set(t,n,r)):Reflect.has(t,n)?Reflect.set(t,n,r):!1}};Object.defineProperties(mo.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Sa]:{writable:!0,enumerable:!1,configurable:!1,value:null},[bu]:{writable:!0,enumerable:!1,configurable:!1,value:null},[N2]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var k5;function wd(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&&(k5=o,o=s,s=k5),s>i&&(s=i),r?r(e,o,s):[o,s]}var Mc=(e,t)=>e<0?t+e:e,R5=e=>e!==e;function Ia(e){if(typeof e!=="object"||e===null)return R5(e)?R5: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?l2(e,n):!1:e instanceof Map?$j(e):Array.isArray(e)?Fj(e):e instanceof Gt?Pj(e):Uj(e,!0)}function Fj(e){let t=[];for(let n=-1,r=e.length;++n<r;)t[n]=Ia(e[n]);return p0(t)}function $j(e){let t=-1,n=[];for(let r of e.values())n[++t]=Ia(r);return p0(n)}function Pj(e){let t=[];for(let n=-1,r=e.length;++n<r;)t[n]=Ia(e.get(n));return p0(t)}function Uj(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]=Ia(e[n[i]]);return p0(r,n)}function p0(e,t){return n=>{if(!n||typeof n!="object")return!1;switch(n.constructor){case Array:return zj(e,n);case Map:return F5(e,n,n.keys());case mo:case _a:case Object:case void 0:return F5(e,n,t||Object.keys(n))}return n instanceof Gt?qj(e,n):!1}}function zj(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 qj(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 F5(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 L2={};Tr(L2,{BitIterator:()=>Tc,getBit:()=>$5,getBool:()=>y0,packBools:()=>Nc,popcnt_array:()=>P5,popcnt_bit_range:()=>_d,popcnt_uint32:()=>m0,setBool:()=>jj,truncateBitmap:()=>Ec});function y0(e,t,n,r){return(n&1<<r)!==0}function $5(e,t,n,r){return(n&1<<r)>>r}function jj(e,t,n){return n?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function Ec(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):Nc(new Tc(n,e,t,null,y0)).subarray(0,r)),i}return n}function Nc(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 Tc=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 _d(e,t,n){if(n-t<=0)return 0;if(n-t<8){let o=0;for(let s of new Tc(e,t,n-t,e,$5))o+=s;return o}let r=n>>3<<3,i=t+(t%8===0?0:8-t%8);return _d(e,t,i)+_d(e,r,n)+P5(e,i>>3,r-i>>3)}function P5(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+=m0(o.getUint32(i)),i+=4;for(;s-i>=2;)r+=m0(o.getUint16(i)),i+=2;for(;s-i>=1;)r+=m0(o.getUint8(i)),i+=1;return r}function m0(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 Vj=-1,ne=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 W.isSparseUnion(t)?this.children.some(n=>n.nullable):W.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(W.isUnion(this.type))return this.children.reduce((r,i)=>r+i.nullCount,0);let t=this._nullCount,n;return t<=Vj&&(n=this.nullBitmap)&&(this._nullCount=t=n.length===0?0:this.length-_d(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=Cr(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(W.isUnion(n)){let r=n,i=this.children[r.typeIdToChildIndex[this.typeIds[t]]],o=r.mode===be.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(W.isUnion(i)){let o=i,s=this.children[o.typeIdToChildIndex[this.typeIds[t]]],a=o.mode===be.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(Ec(s,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:o})):Object.assign(this,{nullBitmap:o,_nullCount:0}));let f=o[u];r=(f&l)!==0,o[u]=n?f|l: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===C.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(Ec(this.offset,n,this.nullBitmap),0);let o=this.buffers;return o[Ni.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[Ni.TYPE])&&(s[Ni.TYPE]=o.subarray(t,t+n)),(o=s[Ni.OFFSET])&&(s[Ni.OFFSET]=o.subarray(t,t+n+1))||(o=s[Ni.DATA])&&(s[Ni.DATA]=i===6?o:o.subarray(r*t,r*(t+n))),s}_sliceChildren(t,n,r){return t.map(i=>i.slice(n,r))}};ne.prototype.children=Object.freeze([]);var C2=class e extends mt{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:n,["offset"]:r=0,["length"]:i=0}=t;return new ne(n,r,i,i)}visitBool(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.nullBitmap),o=zt(n.ArrayType,t.data),{["length"]:s=o.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ne(n,r,s,a,[void 0,o,i])}visitInt(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.nullBitmap),o=zt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ne(n,r,s,a,[void 0,o,i])}visitFloat(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.nullBitmap),o=zt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ne(n,r,s,a,[void 0,o,i])}visitUtf8(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.data),o=St(t.nullBitmap),s=Ic(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ne(n,r,a,c,[s,i,o])}visitLargeUtf8(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.data),o=St(t.nullBitmap),s=Vg(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ne(n,r,a,c,[s,i,o])}visitBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.data),o=St(t.nullBitmap),s=Ic(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ne(n,r,a,c,[s,i,o])}visitLargeBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.data),o=St(t.nullBitmap),s=Vg(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ne(n,r,a,c,[s,i,o])}visitFixedSizeBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.nullBitmap),o=zt(n.ArrayType,t.data),{["length"]:s=o.length/Cr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ne(n,r,s,a,[void 0,o,i])}visitDate(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.nullBitmap),o=zt(n.ArrayType,t.data),{["length"]:s=o.length/Cr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ne(n,r,s,a,[void 0,o,i])}visitTimestamp(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.nullBitmap),o=zt(n.ArrayType,t.data),{["length"]:s=o.length/Cr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ne(n,r,s,a,[void 0,o,i])}visitTime(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.nullBitmap),o=zt(n.ArrayType,t.data),{["length"]:s=o.length/Cr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ne(n,r,s,a,[void 0,o,i])}visitDecimal(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.nullBitmap),o=zt(n.ArrayType,t.data),{["length"]:s=o.length/Cr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ne(n,r,s,a,[void 0,o,i])}visitList(t){let{["type"]:n,["offset"]:r=0,["child"]:i}=t,o=St(t.nullBitmap),s=Ic(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ne(n,r,a,c,[s,void 0,o],[i])}visitStruct(t){let{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,o=St(t.nullBitmap),{length:s=i.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new ne(n,r,s,a,[void 0,void 0,o],i)}visitUnion(t){let{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,o=zt(n.ArrayType,t.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=t;if(W.isSparseUnion(n))return new ne(n,r,s,a,[void 0,void 0,void 0,o],i);let c=Ic(t.valueOffsets);return new ne(n,r,s,a,[c,void 0,void 0,o],i)}visitDictionary(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.nullBitmap),o=zt(n.indices.ArrayType,t.data),{["dictionary"]:s=new Gt([new e().visit({type:n.dictionary})])}=t,{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ne(n,r,a,c,[void 0,o,i],[],s)}visitInterval(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.nullBitmap),o=zt(n.ArrayType,t.data),{["length"]:s=o.length/Cr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ne(n,r,s,a,[void 0,o,i])}visitDuration(t){let{["type"]:n,["offset"]:r=0}=t,i=St(t.nullBitmap),o=zt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ne(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=St(t.nullBitmap),{["length"]:s=i.length/Cr(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ne(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=St(t.nullBitmap),s=Ic(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ne(n,r,a,c,[s,void 0,o],[i])}},Yj=new C2;function Nt(e){return Yj.visit(e)}var vd=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 U5(e){return e.some(t=>t.nullable)}function g0(e){return e.reduce((t,n)=>t+n.nullCount,0)}function x0(e){return e.reduce((t,n,r)=>(t[r+1]=t[r]+n.length,t),new Uint32Array(e.length+1))}function b0(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 k2(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 Sd(e,t){return e.getValid(t)}function wu(e){function t(n,r,i){return e(n[r],i)}return function(n){let r=this.data;return k2(r,this._offsets,n,t)}}function w0(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=k2(o,this._offsets,r,n);return t=void 0,s}}function _0(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):k2(o,this._offsets,i,n);return t=void 0,s}}var gt=class extends mt{};function Xj(e,t){return t===null&&e.length>0?0:-1}function Gj(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new Tc(n,e.offset+(t||0),e.length,n,y0)){if(!i)return r;++r}return-1}function Dt(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case C.Union:break;case C.Dictionary:break;default:return Gj(e,n)}let r=Xe.getVisitFn(e),i=Ia(t);for(let o=(n||0)-1,s=e.length;++o<s;)if(i(r(e,o)))return o;return-1}function z5(e,t,n){let r=Xe.getVisitFn(e),i=Ia(t);for(let o=(n||0)-1,s=e.length;++o<s;)if(i(r(e,o)))return o;return-1}gt.prototype.visitNull=Xj;gt.prototype.visitBool=Dt;gt.prototype.visitInt=Dt;gt.prototype.visitInt8=Dt;gt.prototype.visitInt16=Dt;gt.prototype.visitInt32=Dt;gt.prototype.visitInt64=Dt;gt.prototype.visitUint8=Dt;gt.prototype.visitUint16=Dt;gt.prototype.visitUint32=Dt;gt.prototype.visitUint64=Dt;gt.prototype.visitFloat=Dt;gt.prototype.visitFloat16=Dt;gt.prototype.visitFloat32=Dt;gt.prototype.visitFloat64=Dt;gt.prototype.visitUtf8=Dt;gt.prototype.visitLargeUtf8=Dt;gt.prototype.visitBinary=Dt;gt.prototype.visitLargeBinary=Dt;gt.prototype.visitFixedSizeBinary=Dt;gt.prototype.visitDate=Dt;gt.prototype.visitDateDay=Dt;gt.prototype.visitDateMillisecond=Dt;gt.prototype.visitTimestamp=Dt;gt.prototype.visitTimestampSecond=Dt;gt.prototype.visitTimestampMillisecond=Dt;gt.prototype.visitTimestampMicrosecond=Dt;gt.prototype.visitTimestampNanosecond=Dt;gt.prototype.visitTime=Dt;gt.prototype.visitTimeSecond=Dt;gt.prototype.visitTimeMillisecond=Dt;gt.prototype.visitTimeMicrosecond=Dt;gt.prototype.visitTimeNanosecond=Dt;gt.prototype.visitDecimal=Dt;gt.prototype.visitList=Dt;gt.prototype.visitStruct=Dt;gt.prototype.visitUnion=Dt;gt.prototype.visitDenseUnion=z5;gt.prototype.visitSparseUnion=z5;gt.prototype.visitDictionary=Dt;gt.prototype.visitInterval=Dt;gt.prototype.visitIntervalDayTime=Dt;gt.prototype.visitIntervalYearMonth=Dt;gt.prototype.visitDuration=Dt;gt.prototype.visitDurationSecond=Dt;gt.prototype.visitDurationMillisecond=Dt;gt.prototype.visitDurationMicrosecond=Dt;gt.prototype.visitDurationNanosecond=Dt;gt.prototype.visitFixedSizeList=Dt;gt.prototype.visitMap=Dt;var Dc=new gt;var xt=class extends mt{};function At(e){let{type:t}=e;if(e.nullCount===0&&e.stride===1&&(W.isInt(t)&&t.bitWidth!==64||W.isTime(t)&&t.bitWidth!==64||W.isFloat(t)&&t.precision!==me.HALF))return new vd(e.data.length,r=>{let i=e.data[r];return i.values.subarray(0,i.length)[Symbol.iterator]()});let n=0;return new vd(e.data.length,r=>{let o=e.data[r].length,s=e.slice(n,n+o);return n+=o,new R2(s)})}var R2=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=At;xt.prototype.visitBool=At;xt.prototype.visitInt=At;xt.prototype.visitInt8=At;xt.prototype.visitInt16=At;xt.prototype.visitInt32=At;xt.prototype.visitInt64=At;xt.prototype.visitUint8=At;xt.prototype.visitUint16=At;xt.prototype.visitUint32=At;xt.prototype.visitUint64=At;xt.prototype.visitFloat=At;xt.prototype.visitFloat16=At;xt.prototype.visitFloat32=At;xt.prototype.visitFloat64=At;xt.prototype.visitUtf8=At;xt.prototype.visitLargeUtf8=At;xt.prototype.visitBinary=At;xt.prototype.visitLargeBinary=At;xt.prototype.visitFixedSizeBinary=At;xt.prototype.visitDate=At;xt.prototype.visitDateDay=At;xt.prototype.visitDateMillisecond=At;xt.prototype.visitTimestamp=At;xt.prototype.visitTimestampSecond=At;xt.prototype.visitTimestampMillisecond=At;xt.prototype.visitTimestampMicrosecond=At;xt.prototype.visitTimestampNanosecond=At;xt.prototype.visitTime=At;xt.prototype.visitTimeSecond=At;xt.prototype.visitTimeMillisecond=At;xt.prototype.visitTimeMicrosecond=At;xt.prototype.visitTimeNanosecond=At;xt.prototype.visitDecimal=At;xt.prototype.visitList=At;xt.prototype.visitStruct=At;xt.prototype.visitUnion=At;xt.prototype.visitDenseUnion=At;xt.prototype.visitSparseUnion=At;xt.prototype.visitDictionary=At;xt.prototype.visitInterval=At;xt.prototype.visitIntervalDayTime=At;xt.prototype.visitIntervalYearMonth=At;xt.prototype.visitDuration=At;xt.prototype.visitDurationSecond=At;xt.prototype.visitDurationMillisecond=At;xt.prototype.visitDurationMicrosecond=At;xt.prototype.visitDurationNanosecond=At;xt.prototype.visitFixedSizeList=At;xt.prototype.visitMap=At;var _u=new xt;var q5,j5={},V5={},Gt=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 ne)))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}=j5[s.typeId],u=o[0];this.isValid=f=>Sd(u,f),this.get=f=>a(u,f),this.set=(f,h)=>c(u,f,h),this.indexOf=f=>l(u,f),this._offsets=[0,u.length];break}default:Object.setPrototypeOf(this,V5[s.typeId]),this._offsets=x0(o);break}this.data=o,this.type=s,this.stride=Cr(s),this.numChildren=(i=(r=s.children)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,n)=>t+n.byteLength,0)}get nullable(){return U5(this.data)}get nullCount(){return g0(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${C[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(Mc(t,this.length))}set(t,n){}indexOf(t,n){return-1}includes(t,n){return this.indexOf(t,n)>-1}[Symbol.iterator](){return _u.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(wd(this,t,n,({data:r,_offsets:i},o,s)=>b0(r,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:t,data:n,length:r,stride:i,ArrayType:o}=this;switch(t.typeId){case C.Int:case C.Float:case C.Decimal:case C.Time:case C.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 W.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(W.isDictionary(this.type)){let t=new v0(this.data[0].dictionary),n=this.data.map(r=>{let i=r.clone();return i.dictionary=t,i});return new e(n)}return new v0(this)}unmemoize(){if(W.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}};q5=Symbol.toStringTag;Gt[q5]=(e=>{e.type=W.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(C).map(n=>C[n]).filter(n=>typeof n=="number"&&n!==C.NONE);for(let n of t){let r=Xe.getVisitFnByTypeId(n),i=Sn.getVisitFnByTypeId(n),o=Dc.getVisitFnByTypeId(n);j5[n]={get:r,set:i,indexOf:o},V5[n]=Object.create(e,{isValid:{value:wu(Sd)},get:{value:wu(Xe.getVisitFnByTypeId(n))},set:{value:w0(Sn.getVisitFnByTypeId(n))},indexOf:{value:_0(Dc.getVisitFnByTypeId(n))}})}return"Vector"})(Gt.prototype);var v0=class e extends Gt{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 Gt(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function Y5(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) {${n.map(r=>`
3
- case ${Wj(r)}:`).join("")}
4
- return false;
5
- }`),e.length!==n.length&&(t=`if (x !== x) return false;
6
- ${t}`),new Function("x",`${t}
7
- return true;`)}function Wj(e){return typeof e!="bigint"?Di(e):`${Di(e)}n`}function F2(e,t){let n=Math.ceil(e)*t-1;return(n-n%64+64||64)/t}function X5(e,t=0){return e.length>=t?e.subarray(0,t):Wh(new e.constructor(t),e,0)}var Ci=class{constructor(t,n=0,r=1){this.length=Math.ceil(n/r),this.buffer=new t(this.length),this.stride=r,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,n){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let n=this.stride,r=this.length*n,i=this.buffer.length;r>=i&&this._resize(i===0?F2(r*1,this.BYTES_PER_ELEMENT):F2(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=F2(t*this.stride,this.BYTES_PER_ELEMENT);let n=X5(this.buffer,t);return this.clear(),n}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=X5(this.buffer,t)}},us=class extends Ci{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}},vu=class extends us{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,n){let{buffer:r}=this.reserve(t-this.length+1),i=t>>3,o=t%8,s=r[i]>>o&1;return n?s===0&&(r[i]|=1<<o,++this.numValid):s===1&&(r[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},Su=class extends us{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,n){let r=this.length-1,i=this.reserve(t-r+1).buffer;return r<t++&&r>=0&&i.fill(i[r],r,t),i[t]=i[t-1]+n,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(t+1)}};var Se=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=Cr(t),this._nulls=new vu,n&&n.length>0&&(this._isValid=Y5(n))}toVector(){return new Gt([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0,{_offsets:n,_values:r,_nulls:i,_typeIds:o,children:s}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),s.reduce((a,c)=>a+c.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((n,r)=>n+r.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,n){return this.setValid(t,this.isValid(n))&&this.setValue(t,n),this}setValue(t,n){this._setValue(this,t,n)}setValid(t,n){return this.length=this._nulls.set(t,+n).length,n}addChild(t,n=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,n,r,i,{type:o,length:s,nullCount:a,_typeIds:c,_offsets:l,_values:u,_nulls:f}=this;(n=c?.flush(s))?i=l?.flush(s):(i=l?.flush(s))?t=u?.flush(l.last()):t=u?.flush(s),a>0&&(r=f?.flush(s));let h=this.children.map(d=>d.flush());return this.clear(),Nt({type:o,length:s,nullCount:a,children:h,child:h[0],data:t,typeIds:n,nullBitmap:r,valueOffsets:i})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,n,r,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(n=this._values)===null||n===void 0||n.clear(),(r=this._offsets)===null||r===void 0||r.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(let o of this.children)o.clear();return this}};Se.prototype.length=1;Se.prototype.stride=1;Se.prototype.children=null;Se.prototype.finished=!1;Se.prototype.nullValues=null;Se.prototype._isValid=()=>!0;var Ge=class extends Se{constructor(t){super(t),this._values=new us(this.ArrayType,0,this.stride)}setValue(t,n){let r=this._values;return r.reserve(t-r.length+1),super.setValue(t,n)}},mr=class extends Se{constructor(t){super(t),this._pendingLength=0,this._offsets=new Su(t.type)}setValue(t,n){let r=this._pending||(this._pending=new Map),i=r.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=n instanceof mo?n[Sa].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 Oc=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 kr=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):ue.V1}schema(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new dr).__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 Oc).__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 Oc).__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 on).__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,ue.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 ae=class e{constructor(t=[],n,r,i=ue.V5){this.fields=t||[],this.metadata=n||new Map,r||(r=$2(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=S0(S0(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:S0(S0(new Map,r[c].metadata),a.metadata)}))&&!1:!0}),s=$2(o,new Map);return new e([...r,...o],i,new Map([...this.dictionaries,...s]))}};ae.prototype.fields=null;ae.prototype.metadata=null;ae.prototype.dictionaries=null;var qt=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)}};qt.prototype.type=null;qt.prototype.name=null;qt.prototype.nullable=null;qt.prototype.metadata=null;function S0(e,t){return new Map([...e||new Map,...t||new Map])}function $2(e,t=new Map){for(let n=-1,r=e.length;++n<r;){let o=e[n].type;if(W.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&&$2(o.children,t)}return t}var Hj=Ac,Zj=Or,fs=class{static decode(t){t=new Zj(St(t));let n=kr.getRootAsFooter(t),r=ae.decode(n.schema(),new Map,n.version());return new P2(r,n)}static encode(t){let n=new Hj,r=ae.encode(n,t.schema);kr.startRecordBatchesVector(n,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())hs.encode(n,s);let i=n.endVector();kr.startDictionariesVector(n,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())hs.encode(n,s);let o=n.endVector();return kr.startFooter(n),kr.addSchema(n,r),kr.addVersion(n,ue.V5),kr.addRecordBatches(n,i),kr.addDictionaries(n,o),kr.finishFooterBuffer(n,kr.endFooter(n)),n.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,n=ue.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 P2=class extends fs{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 hs.decode(n)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let n=this._footer.dictionaries(t);if(n)return hs.decode(n)}return null}},hs=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 Oc.createBlock(t,i,r,o)}constructor(t,n,r){this.metaDataLength=t,this.offset=te(r),this.bodyLength=te(n)}};var ve=Object.freeze({done:!0,value:void 0}),Id=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Bc=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())}},I0=class extends Bc{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return J(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 vn.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return vn.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return J(this,void 0,void 0,function*(){return yield this.abort(t),ve})}return(t){return J(this,void 0,void 0,function*(){return yield this.close(),ve})}read(t){return J(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return J(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(ve)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var yo=class extends I0{write(t){if((t=St(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Xh(this.toUint8Array(!0)):this.toUint8Array(!1).then(Xh)}toUint8Array(t=!1){return t?Dr(this._values)[0]:J(this,void 0,void 0,function*(){var n,r,i,o;let s=[],a=0;try{for(var c=!0,l=Si(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 Dr(s,a)[0]})}},go=class{constructor(t){t&&(this.source=new U2(vn.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)}},ni=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof yo?this.source=new ds(vn.fromAsyncIterable(t)):jg(t)?this.source=new ds(vn.fromNodeStream(t)):Gh(t)?this.source=new ds(vn.fromDOMStream(t)):zg(t)?this.source=new ds(vn.fromDOMStream(t.body)):Ii(t)?this.source=new ds(vn.fromIterable(t)):Nr(t)?this.source=new ds(vn.fromAsyncIterable(t)):Zr(t)&&(this.source=new ds(vn.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)}},U2=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)||ve)}return(t){return Object.create(this.source.return&&this.source.return(t)||ve)}},ds=class{constructor(t){this.source=t,this._closedPromise=new Promise(n=>this._closedPromiseResolve=n)}cancel(t){return J(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return J(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return J(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return J(this,arguments,void 0,function*(n,r="read"){return yield this.source.next({cmd:r,size:n})})}throw(t){return J(this,void 0,void 0,function*(){let n=this.source.throw&&(yield this.source.throw(t))||ve;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}return(t){return J(this,void 0,void 0,function*(){let n=this.source.return&&(yield this.source.return(t))||ve;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}};var Ad=class extends go{constructor(t,n){super(),this.position=0,this.buffer=St(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}}},Aa=class extends ni{constructor(t,n){super(),this.position=0,this._handle=t,typeof n=="number"?this.size=n:this._pending=J(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return J(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 J(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 J(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 J(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 J(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return J(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return J(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var q2={};Tr(q2,{BaseInt64:()=>Md,Int128:()=>Td,Int64:()=>ps,Uint64:()=>Oe});function Iu(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var Au=8,z2=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Md=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`${Iu(this.buffer[1])} ${Iu(this.buffer[0])}`}},Oe=class e extends Md{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=Au<r-o?Au:r-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),c=new e(new Uint32Array([z2[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)}},ps=class e extends Md{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=Au<i-s?Au:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),l=new e(new Uint32Array([z2[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)}},Td=class e{constructor(t){this.buffer=t}high(){return new ps(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new ps(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 Oe(new Uint32Array([this.buffer[3],0])),r=new Oe(new Uint32Array([this.buffer[2],0])),i=new Oe(new Uint32Array([this.buffer[1],0])),o=new Oe(new Uint32Array([this.buffer[0],0])),s=new Oe(new Uint32Array([t.buffer[3],0])),a=new Oe(new Uint32Array([t.buffer[2],0])),c=new Oe(new Uint32Array([t.buffer[1],0])),l=new Oe(new Uint32Array([t.buffer[0],0])),u=Oe.multiply(o,l);this.buffer[0]=u.low();let f=new Oe(new Uint32Array([u.high(),0]));return u=Oe.multiply(i,l),f.plus(u),u=Oe.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 Oe(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Oe.multiply(r,l)).plus(Oe.multiply(i,c)).plus(Oe.multiply(o,a)),this.buffer[3]+=Oe.multiply(n,l).plus(Oe.multiply(r,c)).plus(Oe.multiply(i,a)).plus(Oe.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`${Iu(this.buffer[3])} ${Iu(this.buffer[2])} ${Iu(this.buffer[1])} ${Iu(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=Au<i-s?Au:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),l=new e(new Uint32Array([z2[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 Ed=class extends mt{constructor(t,n,r,i,o=ue.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 qt?t.type:t)}visitNull(t,{length:n}=this.nextFieldNode()){return Nt({type:t,length:n})}visitBool(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitInt(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFloat(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitUtf8(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({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 Nt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({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 Nt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDate(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTimestamp(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTime(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDecimal(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitList(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({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 Nt({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<ue.V5&&this.readNullBitmap(t,r),t.mode===be.Sparse?this.visitSparseUnion(t,{length:n,nullCount:r}):this.visitDenseUnion(t,{length:n,nullCount:r})}visitDenseUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({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 Nt({type:t,length:n,nullCount:r,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({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 Nt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDuration(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFixedSizeList(t,{length:n,nullCount:r}=this.nextFieldNode()){return Nt({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 Nt({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)}},A0=class extends Ed{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):Nc(this.sources[r])}readOffsets(t,{offset:n}=this.nextBufferRange()){return zt(Uint8Array,zt(t.OffsetArrayType,this.sources[n]))}readTypeIds(t,{offset:n}=this.nextBufferRange()){return zt(Uint8Array,zt(t.ArrayType,this.sources[n]))}readData(t,{offset:n}=this.nextBufferRange()){let{sources:r}=this;return W.isTimestamp(t)?zt(Uint8Array,ps.convertArray(r[n])):(W.isInt(t)||W.isTime(t))&&t.bitWidth===64||W.isDuration(t)?zt(Uint8Array,ps.convertArray(r[n])):W.isDate(t)&&t.unit===Pe.MILLISECOND?zt(Uint8Array,ps.convertArray(r[n])):W.isDecimal(t)?zt(Uint8Array,Td.convertArray(r[n])):W.isBinary(t)||W.isLargeBinary(t)||W.isFixedSizeBinary(t)?Jj(r[n]):W.isBool(t)?Nc(r[n]):W.isUtf8(t)||W.isLargeUtf8(t)?Ji(r[n].join("")):zt(Uint8Array,zt(t.ArrayType,r[n].map(i=>+i)))}};function Jj(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 Mu=class extends mr{constructor(t){super(t),this._values=new Ci(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,St(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 Tu=class extends mr{constructor(t){super(t),this._values=new Ci(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,St(n))}_flushPending(t,n){let r=this._offsets,i=this._values.reserve(n).buffer,o=0;for(let[s,a]of t)if(a===void 0)r.set(s,BigInt(0));else{let c=a.length;i.set(a,o),r.set(s,BigInt(c)),o+=c}}};var M0=class extends Se{constructor(t){super(t),this._values=new vu}setValue(t,n){this._values.set(t,+n)}};var Lc=class extends Ge{};Lc.prototype._setValue=_2;var Nd=class extends Lc{};Nd.prototype._setValue=Qg;var Dd=class extends Lc{};Dd.prototype._setValue=Kg;var Od=class extends Ge{};Od.prototype._setValue=I2;var T0=class extends Se{constructor({type:t,nullValues:n,dictionaryHashFunction:r}){super({type:new pr(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Cc({type:this.type.indices,nullValues:n}),this.dictionary=Cc({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 Bd=class extends Ge{};Bd.prototype._setValue=w2;var E0=class extends Se{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 ti(this.type.listSize,new qt(n,t.type,!0)),r}};var kc=class extends Ge{setValue(t,n){this._values.set(t,n)}},N0=class extends kc{setValue(t,n){super.setValue(t,bd(n))}},D0=class extends kc{},O0=class extends kc{};var Rc=class extends Ge{};Rc.prototype._setValue=A2;var Ld=class extends Rc{};Ld.prototype._setValue=c0;var Cd=class extends Rc{};Cd.prototype._setValue=l0;var ms=class extends Ge{};ms.prototype._setValue=M2;var kd=class extends ms{};kd.prototype._setValue=u0;var Rd=class extends ms{};Rd.prototype._setValue=f0;var Fd=class extends ms{};Fd.prototype._setValue=h0;var $d=class extends ms{};$d.prototype._setValue=d0;var ri=class extends Ge{setValue(t,n){this._values.set(t,n)}},B0=class extends ri{},L0=class extends ri{},C0=class extends ri{},k0=class extends ri{},R0=class extends ri{},F0=class extends ri{},$0=class extends ri{},P0=class extends ri{};var U0=class extends mr{constructor(t){super(t),this._offsets=new Su(t.type)}addChild(t,n="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Qr(new qt(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 z0=class extends mr{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 ei(new qt(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 q0=class extends Se{setValue(t,n){}setValid(t,n){return this.length=Math.max(t+1,this.length),n}};var j0=class extends Se{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 we([...this.type.children,new qt(n,t.type,!0)]),r}};var ys=class extends Ge{};ys.prototype._setValue=v2;var Pd=class extends ys{};Pd.prototype._setValue=t0;var Ud=class extends ys{};Ud.prototype._setValue=e0;var zd=class extends ys{};zd.prototype._setValue=n0;var qd=class extends ys{};qd.prototype._setValue=r0;var gs=class extends Ge{};gs.prototype._setValue=S2;var jd=class extends gs{};jd.prototype._setValue=i0;var Vd=class extends gs{};Vd.prototype._setValue=o0;var Yd=class extends gs{};Yd.prototype._setValue=s0;var Xd=class extends gs{};Xd.prototype._setValue=a0;var Eu=class extends Se{constructor(t){super(t),this._typeIds=new us(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 qt(n,t.type)];return this.type=new Kr(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.")}},V0=class extends Eu{},Y0=class extends Eu{constructor(t){super(t),this._offsets=new us(Int32Array)}setValue(t,n,r){let i=this._typeIds.set(t,r).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[i]),s=this._offsets.set(t,o.length).buffer[t];o?.set(s,n)}};var Gd=class extends mr{constructor(t){super(t),this._values=new Ci(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,Ji(n))}_flushPending(t,n){}};Gd.prototype._flushPending=Mu.prototype._flushPending;var Wd=class extends mr{constructor(t){super(t),this._values=new Ci(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,Ji(n))}_flushPending(t,n){}};Wd.prototype._flushPending=Tu.prototype._flushPending;var j2=class extends mt{visitNull(){return q0}visitBool(){return M0}visitInt(){return ri}visitInt8(){return B0}visitInt16(){return L0}visitInt32(){return C0}visitInt64(){return k0}visitUint8(){return R0}visitUint16(){return F0}visitUint32(){return $0}visitUint64(){return P0}visitFloat(){return kc}visitFloat16(){return N0}visitFloat32(){return D0}visitFloat64(){return O0}visitUtf8(){return Gd}visitLargeUtf8(){return Wd}visitBinary(){return Mu}visitLargeBinary(){return Tu}visitFixedSizeBinary(){return Bd}visitDate(){return Lc}visitDateDay(){return Nd}visitDateMillisecond(){return Dd}visitTimestamp(){return ys}visitTimestampSecond(){return Pd}visitTimestampMillisecond(){return Ud}visitTimestampMicrosecond(){return zd}visitTimestampNanosecond(){return qd}visitTime(){return gs}visitTimeSecond(){return jd}visitTimeMillisecond(){return Vd}visitTimeMicrosecond(){return Yd}visitTimeNanosecond(){return Xd}visitDecimal(){return Od}visitList(){return U0}visitStruct(){return j0}visitUnion(){return Eu}visitDenseUnion(){return Y0}visitSparseUnion(){return V0}visitDictionary(){return T0}visitInterval(){return Rc}visitIntervalDayTime(){return Ld}visitIntervalYearMonth(){return Cd}visitDuration(){return ms}visitDurationSecond(){return kd}visitDurationMillisecond(){return Rd}visitDurationMicrosecond(){return Fd}visitDurationNanosecond(){return $d}visitFixedSizeList(){return E0}visitMap(){return z0}},G5=new j2;var bt=class extends mt{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 Hn(e,t){return t instanceof e.constructor}function Fc(e,t){return e===t||Hn(e,t)}function xs(e,t){return e===t||Hn(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function X0(e,t){return e===t||Hn(e,t)&&e.precision===t.precision}function Qj(e,t){return e===t||Hn(e,t)&&e.byteWidth===t.byteWidth}function V2(e,t){return e===t||Hn(e,t)&&e.unit===t.unit}function Hd(e,t){return e===t||Hn(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Zd(e,t){return e===t||Hn(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function Kj(e,t){return e===t||Hn(e,t)&&e.children.length===t.children.length&&xo.compareManyFields(e.children,t.children)}function tV(e,t){return e===t||Hn(e,t)&&e.children.length===t.children.length&&xo.compareManyFields(e.children,t.children)}function Y2(e,t){return e===t||Hn(e,t)&&e.mode===t.mode&&e.typeIds.every((n,r)=>n===t.typeIds[r])&&xo.compareManyFields(e.children,t.children)}function eV(e,t){return e===t||Hn(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&xo.visit(e.indices,t.indices)&&xo.visit(e.dictionary,t.dictionary)}function X2(e,t){return e===t||Hn(e,t)&&e.unit===t.unit}function Jd(e,t){return e===t||Hn(e,t)&&e.unit===t.unit}function nV(e,t){return e===t||Hn(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&xo.compareManyFields(e.children,t.children)}function rV(e,t){return e===t||Hn(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&xo.compareManyFields(e.children,t.children)}bt.prototype.visitNull=Fc;bt.prototype.visitBool=Fc;bt.prototype.visitInt=xs;bt.prototype.visitInt8=xs;bt.prototype.visitInt16=xs;bt.prototype.visitInt32=xs;bt.prototype.visitInt64=xs;bt.prototype.visitUint8=xs;bt.prototype.visitUint16=xs;bt.prototype.visitUint32=xs;bt.prototype.visitUint64=xs;bt.prototype.visitFloat=X0;bt.prototype.visitFloat16=X0;bt.prototype.visitFloat32=X0;bt.prototype.visitFloat64=X0;bt.prototype.visitUtf8=Fc;bt.prototype.visitLargeUtf8=Fc;bt.prototype.visitBinary=Fc;bt.prototype.visitLargeBinary=Fc;bt.prototype.visitFixedSizeBinary=Qj;bt.prototype.visitDate=V2;bt.prototype.visitDateDay=V2;bt.prototype.visitDateMillisecond=V2;bt.prototype.visitTimestamp=Hd;bt.prototype.visitTimestampSecond=Hd;bt.prototype.visitTimestampMillisecond=Hd;bt.prototype.visitTimestampMicrosecond=Hd;bt.prototype.visitTimestampNanosecond=Hd;bt.prototype.visitTime=Zd;bt.prototype.visitTimeSecond=Zd;bt.prototype.visitTimeMillisecond=Zd;bt.prototype.visitTimeMicrosecond=Zd;bt.prototype.visitTimeNanosecond=Zd;bt.prototype.visitDecimal=Fc;bt.prototype.visitList=Kj;bt.prototype.visitStruct=tV;bt.prototype.visitUnion=Y2;bt.prototype.visitDenseUnion=Y2;bt.prototype.visitSparseUnion=Y2;bt.prototype.visitDictionary=eV;bt.prototype.visitInterval=X2;bt.prototype.visitIntervalDayTime=X2;bt.prototype.visitIntervalYearMonth=X2;bt.prototype.visitDuration=Jd;bt.prototype.visitDurationSecond=Jd;bt.prototype.visitDurationMillisecond=Jd;bt.prototype.visitDurationMicrosecond=Jd;bt.prototype.visitDurationNanosecond=Jd;bt.prototype.visitFixedSizeList=nV;bt.prototype.visitMap=rV;var xo=new bt;function $c(e,t){return xo.compareSchemas(e,t)}function W5(e,t){return xo.compareFields(e,t)}function H5(e,t){return xo.visit(e,t)}function Cc(e){let t=e.type,n=new(G5.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(Cc(Object.assign(Object.assign({},l),{type:c})))}}return n}function G0(e,t){return iV(e,t.map(n=>n.data.concat()))}function iV(e,t){let n=[...e.fields],r=[],i={numBatches:t.reduce((f,h)=>Math.max(f,h.length),0)},o=0,s=0,a=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,a=-1;++a<c;)u[a]=l=t[a].shift(),s=Math.min(s,l?l.length:s);Number.isFinite(s)&&(u=oV(n,s,u,t,i),s>0&&(r[o++]=Nt({type:new we(n),length:s,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(f=>new ke(e,f))]}function oV(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:Nt({type:f.type,length:t,nullCount:t,nullBitmap:new Uint8Array(s)})}}return n}var Z5,yr=class e{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new ae([]),this._offsets=[0],this;let i,o;t[0]instanceof ae&&(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 ne){if(c.type instanceof we)return[new ke(new ae(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(l=>s(l));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(l=>s(l));if(typeof c=="object"){let l=Object.keys(c),u=l.map(d=>new Gt([c[d]])),f=i??new ae(l.map((d,p)=>new qt(String(d),u[p].type,u[p].nullable))),[,h]=G0(f,u);return h.length===0?[new ke(c)]:h}}}return[]},a=t.flatMap(c=>s(c));if(i=(r=i??((n=a[0])===null||n===void 0?void 0:n.schema))!==null&&r!==void 0?r:new ae([]),!(i instanceof ae))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(!$c(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??x0(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=g0(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(Mc(t,this.numRows))}set(t,n){}indexOf(t,n){return-1}[Symbol.iterator](){return this.batches.length>0?_u.visit(new Gt(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
8
- ${this.toArray().join(`,
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]=wd({length:this.numRows},t,n);let i=b0(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=Nt({type:r,length:0,nullCount:0});n.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new Gt(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 Gt([Nt({type:new Rn,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]=G0(r,a)}return new e(r,i)}select(t){let n=this.schema.fields.reduce((r,i,o)=>r.set(i.name,o),new Map);return this.selectAt(t.map(r=>n.get(r)).filter(r=>r>-1))}selectAt(t){let n=this.schema.selectAt(t),r=this.batches.map(i=>i.selectAt(t));return new e(n,r)}assign(t){let n=this.schema.fields,[r,i]=t.schema.fields.reduce((a,c,l)=>{let[u,f]=a,h=n.findIndex(d=>d.name===c.name);return~h?f[h]=l:u.push(l),a},[[],[]]),o=this.schema.assign(t.schema),s=[...n.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...r.map(a=>t.getChildAt(a))].filter(Boolean);return new e(...G0(o,s))}};Z5=Symbol.toStringTag;yr[Z5]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=wu(Sd),e.get=wu(Xe.getVisitFn(C.Struct)),e.set=w0(Sn.getVisitFn(C.Struct)),e.indexOf=_0(Dc.getVisitFn(C.Struct)),"Table"))(yr.prototype);var Q5,ke=class e{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof ae))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=Nt({nullCount:0,type:new we(this.schema.fields),children:this.schema.fields.map(n=>Nt({type:n.type,nullCount:0}))})]=t,!(this.data instanceof ne))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=J5(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]=qt.new({name:l,type:n[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),s=new ae(r),a=Nt({type:new we(r),length:o,children:i,nullCount:0});[this.schema,this.data]=J5(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=K5(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 Xe.visit(this.data,t)}at(t){return this.get(Mc(t,this.numRows))}set(t,n){return Sn.visit(this.data,t,n)}indexOf(t,n){return Dc.visit(this.data,t,n)}[Symbol.iterator](){return _u.visit(new Gt([this.data]))}toArray(){return[...this]}concat(...t){return new yr(this.schema,[this,...t])}slice(t,n){let[r]=new Gt([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 Gt([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 Gt([Nt({type:new Rn,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 ae(o,new Map(this.schema.metadata)),i=Nt({type:new we(o),children:s})}return new e(r,i)}select(t){let n=this.schema.select(t),r=new we(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,Nt({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=Nt({type:new we(n.fields),length:this.numRows,children:r});return new e(n,i)}};Q5=Symbol.toStringTag;ke[Q5]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(ke.prototype);function J5(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:Nt({type:c.type,length:n,nullCount:n,nullBitmap:new Uint8Array(s)}))}return[e.assign(i),Nt({type:new we(i),length:n,children:o})]}function K5(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)||[]])K5(a.children,l?.children,n);if(W.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 Pc=class extends ke{constructor(t){let n=t.fields.map(i=>Nt({type:i.type})),r=Nt({type:new we(t.fields),nullCount:0,children:n});super(t,r)}};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):ue.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):jt.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 on).__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,ue.V1)}static addHeaderType(t,n){t.addFieldInt8(1,n,jt.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 G2=class extends mt{visit(t,n){return t==null||n==null?void 0:super.visit(t,n)}visitNull(t,n){return id.startNull(n),id.endNull(n)}visitInt(t,n){return Ti.startInt(n),Ti.addBitWidth(n,t.bitWidth),Ti.addIsSigned(n,t.isSigned),Ti.endInt(n)}visitFloat(t,n){return xa.startFloatingPoint(n),xa.addPrecision(n,t.precision),xa.endFloatingPoint(n)}visitBinary(t,n){return Kh.startBinary(n),Kh.endBinary(n)}visitLargeBinary(t,n){return ed.startLargeBinary(n),ed.endLargeBinary(n)}visitBool(t,n){return td.startBool(n),td.endBool(n)}visitUtf8(t,n){return sd.startUtf8(n),sd.endUtf8(n)}visitLargeUtf8(t,n){return nd.startLargeUtf8(n),nd.endLargeUtf8(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 pa.startDate(n),pa.addUnit(n,t.unit),pa.endDate(n)}visitTime(t,n){return as.startTime(n),as.addUnit(n,t.unit),as.addBitWidth(n,t.bitWidth),as.endTime(n)}visitTimestamp(t,n){let r=t.timezone&&n.createString(t.timezone)||void 0;return cs.startTimestamp(n),cs.addUnit(n,t.unit),r!==void 0&&cs.addTimezone(n,r),cs.endTimestamp(n)}visitInterval(t,n){return ba.startInterval(n),ba.addUnit(n,t.unit),ba.endInterval(n)}visitDuration(t,n){return ma.startDuration(n),ma.addUnit(n,t.unit),ma.endDuration(n)}visitList(t,n){return rd.startList(n),rd.endList(n)}visitStruct(t,n){return od.startStruct_(n),od.endStruct_(n)}visitUnion(t,n){Ei.startTypeIdsVector(n,t.typeIds.length);let r=Ei.createTypeIdsVector(n,t.typeIds);return Ei.startUnion(n),Ei.addMode(n,t.mode),Ei.addTypeIds(n,r),Ei.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 ya.startFixedSizeBinary(n),ya.addByteWidth(n,t.byteWidth),ya.endFixedSizeBinary(n)}visitFixedSizeList(t,n){return ga.startFixedSizeList(n),ga.addListSize(n,t.listSize),ga.endFixedSizeList(n)}visitMap(t,n){return wa.startMap(n),wa.addKeysSorted(n,t.keysSorted),wa.endMap(n)}},W0=new G2;function rB(e,t=new Map){return new ae(aV(e,t),H0(e.metadata),t)}function W2(e){return new In(e.count,oB(e.columns),sB(e.columns))}function iB(e){return new xr(W2(e.data),e.id,e.isDelta)}function aV(e,t){return(e.fields||[]).filter(Boolean).map(n=>qt.fromJSON(n,t))}function tB(e,t){return(e.children||[]).filter(Boolean).map(n=>qt.fromJSON(n,t))}function oB(e){return(e||[]).reduce((t,n)=>[...t,new ii(n.count,cV(n.VALIDITY)),...oB(n.children)],[])}function sB(e,t=[]){for(let n=-1,r=(e||[]).length;++n<r;){let i=e[n];i.VALIDITY&&t.push(new gr(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new gr(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new gr(t.length,i.OFFSET.length)),i.DATA&&t.push(new gr(t.length,i.DATA.length)),t=sB(i.children,t)}return t}function cV(e){return(e||[]).reduce((t,n)=>t+ +(n===0),0)}function aB(e,t){let n,r,i,o,s,a;return!t||!(o=e.dictionary)?(s=nB(e,tB(e,t)),i=new qt(e.name,s,e.nullable,H0(e.metadata))):t.has(n=o.id)?(r=(r=o.indexType)?eB(r):new Bi,a=new pr(t.get(n),r,n,o.isOrdered),i=new qt(e.name,a,e.nullable,H0(e.metadata))):(r=(r=o.indexType)?eB(r):new Bi,t.set(n,s=nB(e,tB(e,t))),a=new pr(s,r,n,o.isOrdered),i=new qt(e.name,a,e.nullable,H0(e.metadata))),i||null}function H0(e=[]){return new Map(e.map(({key:t,value:n})=>[t,n]))}function eB(e){return new Ye(e.isSigned,e.bitWidth)}function nB(e,t){let n=e.type.name;switch(n){case"NONE":return new Rn;case"null":return new Rn;case"binary":return new no;case"largebinary":return new ro;case"utf8":return new io;case"largeutf8":return new oo;case"bool":return new so;case"list":return new Qr((t||[])[0]);case"struct":return new we(t||[]);case"struct_":return new we(t||[])}switch(n){case"int":{let r=e.type;return new Ye(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=e.type;return new Lr(me[r.precision])}case"decimal":{let r=e.type;return new ao(r.scale,r.precision,r.bitWidth)}case"date":{let r=e.type;return new co(Pe[r.unit])}case"time":{let r=e.type;return new lo(ct[r.unit],r.bitWidth)}case"timestamp":{let r=e.type;return new uo(ct[r.unit],r.timezone)}case"interval":{let r=e.type;return new fo(un[r.unit])}case"duration":{let r=e.type;return new ho(ct[r.unit])}case"union":{let r=e.type,[i,...o]=(r.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new Kr(be[s],r.typeIds||[],t||[])}case"fixedsizebinary":{let r=e.type;return new po(r.byteWidth)}case"fixedsizelist":{let r=e.type;return new ti(r.listSize,(t||[])[0])}case"map":{let r=e.type;return new ei((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var lV=Ac,uV=Or,br=class e{static fromJSON(t,n){let r=new e(0,ue.V5,n);return r._createHeader=fV(t,n),r}static decode(t){t=new uV(St(t));let n=ki.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),o=n.headerType(),s=new e(r,i,o);return s._createHeader=hV(n,o),s}static encode(t){let n=new lV,r=-1;return t.isSchema()?r=ae.encode(n,t.header()):t.isRecordBatch()?r=In.encode(n,t.header()):t.isDictionaryBatch()&&(r=xr.encode(n,t.header())),ki.startMessage(n),ki.addVersion(n,ue.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 ae)return new e(0,ue.V5,jt.Schema,t);if(t instanceof In)return new e(n,ue.V5,jt.RecordBatch,t);if(t instanceof xr)return new e(n,ue.V5,jt.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===jt.Schema}isRecordBatch(){return this.headerType===jt.RecordBatch}isDictionaryBatch(){return this.headerType===jt.DictionaryBatch}constructor(t,n,r,i){this._version=n,this._headerType=r,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=te(t)}},In=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=te(t)}},xr=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=te(n)}},gr=class{constructor(t,n){this.offset=te(t),this.length=te(n)}},ii=class{constructor(t,n){this.length=te(t),this.nullCount=te(n)}};function fV(e,t){return()=>{switch(t){case jt.Schema:return ae.fromJSON(e);case jt.RecordBatch:return In.fromJSON(e);case jt.DictionaryBatch:return xr.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${jt[t]}, type: ${t} }`)}}function hV(e,t){return()=>{switch(t){case jt.Schema:return ae.decode(e.header(new dr),new Map,e.version());case jt.RecordBatch:return In.decode(e.header(new Br),e.version());case jt.DictionaryBatch:return xr.decode(e.header(new ss),e.version())}throw new Error(`Unrecognized Message type: { name: ${jt[t]}, type: ${t} }`)}}qt.encode=SV;qt.decode=_V;qt.fromJSON=aB;ae.encode=vV;ae.decode=dV;ae.fromJSON=rB;In.encode=IV;In.decode=pV;In.fromJSON=W2;xr.encode=AV;xr.decode=mV;xr.fromJSON=iB;ii.encode=MV;ii.decode=gV;gr.encode=TV;gr.decode=yV;function dV(e,t=new Map,n=ue.V5){let r=wV(e,t);return new ae(r,Z0(e),t,n)}function pV(e,t=ue.V5){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new In(e.length(),xV(e),bV(e,t))}function mV(e,t=ue.V5){return new xr(In.decode(e.data(),t),e.id(),e.isDelta())}function yV(e){return new gr(e.offset(),e.length())}function gV(e){return new ii(e.length(),e.nullCount())}function xV(e){let t=[];for(let n,r=-1,i=-1,o=e.nodesLength();++r<o;)(n=e.nodes(r))&&(t[++i]=ii.decode(n));return t}function bV(e,t){let n=[];for(let r,i=-1,o=-1,s=e.buffersLength();++i<s;)(r=e.buffers(i))&&(t<ue.V4&&(r.bb_pos+=8*(i+1)),n[++o]=gr.decode(r));return n}function wV(e,t){let n=[];for(let r,i=-1,o=-1,s=e.fieldsLength();++i<s;)(r=e.fields(i))&&(n[++o]=qt.decode(r,t));return n}function cB(e,t){let n=[];for(let r,i=-1,o=-1,s=e.childrenLength();++i<s;)(r=e.children(i))&&(n[++o]=qt.decode(r,t));return n}function _V(e,t){let n,r,i,o,s,a;return!t||!(a=e.dictionary())?(i=uB(e,cB(e,t)),r=new qt(e.name(),i,e.nullable(),Z0(e))):t.has(n=te(a.id()))?(o=(o=a.indexType())?lB(o):new Bi,s=new pr(t.get(n),o,n,a.isOrdered()),r=new qt(e.name(),s,e.nullable(),Z0(e))):(o=(o=a.indexType())?lB(o):new Bi,t.set(n,i=uB(e,cB(e,t))),s=new pr(i,o,n,a.isOrdered()),r=new qt(e.name(),s,e.nullable(),Z0(e))),r||null}function Z0(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 lB(e){return new Ye(e.isSigned(),e.bitWidth())}function uB(e,t){let n=e.typeType();switch(n){case ye.NONE:return new Rn;case ye.Null:return new Rn;case ye.Binary:return new no;case ye.LargeBinary:return new ro;case ye.Utf8:return new io;case ye.LargeUtf8:return new oo;case ye.Bool:return new so;case ye.List:return new Qr((t||[])[0]);case ye.Struct_:return new we(t||[])}switch(n){case ye.Int:{let r=e.type(new Ti);return new Ye(r.isSigned(),r.bitWidth())}case ye.FloatingPoint:{let r=e.type(new xa);return new Lr(r.precision())}case ye.Decimal:{let r=e.type(new eo);return new ao(r.scale(),r.precision(),r.bitWidth())}case ye.Date:{let r=e.type(new pa);return new co(r.unit())}case ye.Time:{let r=e.type(new as);return new lo(r.unit(),r.bitWidth())}case ye.Timestamp:{let r=e.type(new cs);return new uo(r.unit(),r.timezone())}case ye.Interval:{let r=e.type(new ba);return new fo(r.unit())}case ye.Duration:{let r=e.type(new ma);return new ho(r.unit())}case ye.Union:{let r=e.type(new Ei);return new Kr(r.mode(),r.typeIdsArray()||[],t||[])}case ye.FixedSizeBinary:{let r=e.type(new ya);return new po(r.byteWidth())}case ye.FixedSizeList:{let r=e.type(new ga);return new ti(r.listSize(),(t||[])[0])}case ye.Map:{let r=e.type(new wa);return new ei((t||[])[0],r.keysSorted())}}throw new Error(`Unrecognized type: "${ye[n]}" (${n})`)}function vV(e,t){let n=t.fields.map(o=>qt.encode(e,o));dr.startFieldsVector(e,n.length);let r=dr.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?dr.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),c=e.createString(`${s}`);return on.startKeyValue(e),on.addKey(e,a),on.addValue(e,c),on.endKeyValue(e)})):-1;return dr.startSchema(e),dr.addFields(e,r),dr.addEndianness(e,EV?da.Little:da.Big),i!==-1&&dr.addCustomMetadata(e,i),dr.endSchema(e)}function SV(e,t){let n=-1,r=-1,i=-1,o=t.type,s=t.typeId;W.isDictionary(o)?(s=o.dictionary.typeId,i=W0.visit(o,e),r=W0.visit(o.dictionary,e)):r=W0.visit(o,e);let a=(o.children||[]).map(u=>qt.encode(e,u)),c=kn.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?kn.createCustomMetadataVector(e,[...t.metadata].map(([u,f])=>{let h=e.createString(`${u}`),d=e.createString(`${f}`);return on.startKeyValue(e),on.addKey(e,h),on.addValue(e,d),on.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),kn.startField(e),kn.addType(e,r),kn.addTypeType(e,s),kn.addChildren(e,c),kn.addNullable(e,!!t.nullable),n!==-1&&kn.addName(e,n),i!==-1&&kn.addDictionary(e,i),l!==-1&&kn.addCustomMetadata(e,l),kn.endField(e)}function IV(e,t){let n=t.nodes||[],r=t.buffers||[];Br.startNodesVector(e,n.length);for(let s of n.slice().reverse())ii.encode(e,s);let i=e.endVector();Br.startBuffersVector(e,r.length);for(let s of r.slice().reverse())gr.encode(e,s);let o=e.endVector();return Br.startRecordBatch(e),Br.addLength(e,BigInt(t.length)),Br.addNodes(e,i),Br.addBuffers(e,o),Br.endRecordBatch(e)}function AV(e,t){let n=In.encode(e,t.data);return ss.startDictionaryBatch(e),ss.addId(e,BigInt(t.id)),ss.addIsDelta(e,t.isDelta),ss.addData(e,n),ss.endDictionaryBatch(e)}function MV(e,t){return fu.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function TV(e,t){return uu.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var EV=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})();var Z2=e=>`Expected ${jt[e]} Message in stream, but was null or length 0.`,J2=e=>`Header pointer of flatbuffer-encoded ${jt[e]} Message is null or length 0.`,fB=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,hB=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,Nu=class{constructor(t){this.source=t instanceof go?t:new go(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 n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(Z2(t));return n.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let n=St(this.source.read(t));if(n.byteLength<t)throw new Error(hB(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()}readSchema(t=!1){let n=jt.Schema,r=this.readMessage(n),i=r?.header();if(t&&!i)throw new Error(J2(n));return i}readMetadataLength(){let t=this.source.read(J0),n=t&&new Or(t),r=n?.readInt32(0)||0;return{done:r===0,value:r}}readMetadata(t){let n=this.source.read(t);if(!n)return ve;if(n.byteLength<t)throw new Error(fB(t,n.byteLength));return{done:!1,value:br.decode(n)}}},Qd=class{constructor(t,n){this.source=t instanceof ni?t:Ug(t)?new Aa(t,n):new ni(t)}[Symbol.asyncIterator](){return this}next(){return J(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 J(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return J(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return J(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(Z2(t));return n.value})}readMessageBody(t){return J(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let n=St(yield this.source.read(t));if(n.byteLength<t)throw new Error(hB(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()})}readSchema(){return J(this,arguments,void 0,function*(t=!1){let n=jt.Schema,r=yield this.readMessage(n),i=r?.header();if(t&&!i)throw new Error(J2(n));return i})}readMetadataLength(){return J(this,void 0,void 0,function*(){let t=yield this.source.read(J0),n=t&&new Or(t),r=n?.readInt32(0)||0;return{done:r===0,value:r}})}readMetadata(t){return J(this,void 0,void 0,function*(){let n=yield this.source.read(t);if(!n)return ve;if(n.byteLength<t)throw new Error(fB(t,n.byteLength));return{done:!1,value:br.decode(n)}})}},Kd=class extends Nu{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof Id?t:new Id(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:br.fromJSON(t.schema,jt.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let n=t.dictionaries[this._dictionaryIndex++];return this._body=n.data.columns,{done:!1,value:br.fromJSON(n,jt.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let n=t.batches[this._batchIndex++];return this._body=n.columns,{done:!1,value:br.fromJSON(n,jt.RecordBatch)}}return this._body=[],ve}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(Z2(t));return n.value}readSchema(){let t=jt.Schema,n=this.readMessage(t),r=n?.header();if(!n||!r)throw new Error(J2(t));return r}},J0=4,H2="ARROW1",Du=new Uint8Array(H2.length);for(let e=0;e<H2.length;e+=1)Du[e]=H2.codePointAt(e);function Q0(e,t=0){for(let n=-1,r=Du.length;++n<r;)if(Du[n]!==e[t+n])return!1;return!0}var Ou=Du.length,Q2=Ou+J0,dB=Ou*2+J0;var Rr=class e extends Bc{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 Nr(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 vn.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return vn.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:$g(t)?DV(t):Ug(t)?LV(t):Nr(t)?J(this,void 0,void 0,function*(){return yield e.from(yield t)}):zg(t)||Gh(t)||jg(t)||Zr(t)?BV(new ni(t)):OV(new go(t))}static readAll(t){return t instanceof e?t.isSync()?pB(t):mB(t):$g(t)||ArrayBuffer.isView(t)||Ii(t)||Pg(t)?pB(t):mB(t)}},bs=class extends Rr{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Er(this,arguments,function*(){yield $t(yield*cu(Si(this[Symbol.iterator]())))})}},Uc=class extends Rr{constructor(t){super(t),this._impl=t}readAll(){return J(this,void 0,void 0,function*(){var t,n,r,i;let o=new Array;try{for(var s=!0,a=Si(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]()}},zc=class extends bs{constructor(t){super(t),this._impl=t}},K0=class extends Uc{constructor(t){super(t),this._impl=t}},tx=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=Nt({type:new we(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 Gt(l)):new Gt(l)).memoize()}return a.memoize()}_loadVectors(t,n,r){return new Ed(n,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},Bu=class extends tx{constructor(t,n){super(n),this._reader=$g(t)?new Kd(this._handle=t):new Nu(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=yB(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: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 Pc(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},Lu=class extends tx{constructor(t,n){super(n),this._reader=new Qd(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return J(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 J(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=yB(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return J(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):ve})}return(t){return J(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):ve})}next(){return J(this,void 0,void 0,function*(){if(this.closed)return ve;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 Pc(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return J(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},ex=class extends Bu{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 Ad?t:new Ad(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(jt.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(jt.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-Q2,r=t.readInt32(n),i=t.readAt(n-r,r);return fs.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}},K2=class extends Lu{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 Aa?t:new Aa(t,r),i)}isFile(){return!0}isAsync(){return!0}open(t){let n=Object.create(null,{open:{get:()=>super.open}});return J(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){return J(this,void 0,void 0,function*(){var n;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(jt.RecordBatch);if(i?.isRecordBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s)}}return null})}_readDictionaryBatch(t){return J(this,void 0,void 0,function*(){var n;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(jt.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 J(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let n=t.size-Q2,r=yield t.readInt32(n),i=yield t.readAt(n-r,r);return fs.decode(i)})}_readNextMessageAndValidate(t){return J(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})}},tS=class extends Bu{constructor(t,n){super(t,n)}_loadVectors(t,n,r){return new A0(n,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}};function yB(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*pB(e){let t=Rr.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function mB(e){return Er(this,arguments,function*(){let n=yield $t(Rr.from(e));try{if(!(yield $t(n.open({autoDestroy:!1}))).closed)do yield yield $t(n);while(!(yield $t(n.reset().open())).closed)}finally{yield $t(n.cancel())}})}function DV(e){return new bs(new tS(e))}function OV(e){let t=e.peek(Ou+7&-8);return t&&t.byteLength>=4?Q0(t)?new zc(new ex(e.read())):new bs(new Bu(e)):new bs(new Bu(function*(){}()))}function BV(e){return J(this,void 0,void 0,function*(){let t=yield e.peek(Ou+7&-8);return t&&t.byteLength>=4?Q0(t)?new zc(new ex(yield e.read())):new Uc(new Lu(e)):new Uc(new Lu(function(){return Er(this,arguments,function*(){})}()))})}function LV(e){return J(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new Aa(e,t);return t>=dB&&Q0(yield n.readAt(0,Ou+7&-8))?new K0(new K2(n)):new Uc(new Lu(n))})}var Te=class e extends mt{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 Gt)return this.visitMany(t.data),this;let{type:n}=t;if(!W.isDictionary(n)){let{length:r}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(W.isUnion(n))this.nodes.push(new ii(r,0));else{let{nullCount:i}=t;W.isNull(n)||Ri.call(this,i<=0?new Uint8Array(0):Ec(t.offset,r,t.nullBitmap)),this.nodes.push(new ii(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 Ri(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new gr(this._byteLength,t)),this._byteLength+=t,this}function CV(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:o}=e;if(Ri.call(this,i),n.mode===be.Sparse)return eS.call(this,e);if(n.mode===be.Dense){if(e.offset<=0)return Ri.call(this,o),eS.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);Ri.call(this,s),this.visitMany(e.children.map((l,u)=>{let f=n.typeIds[u],h=a[f],d=c[f];return l.slice(h,Math.min(r,d))}))}}return this}function kV(e){let t;return e.nullCount>=e.length?Ri.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?Ri.call(this,Ec(e.offset,e.length,t)):Ri.call(this,Nc(e.values))}function ws(e){return Ri.call(this,e.values.subarray(0,e.length*e.stride))}function nx(e){let{length:t,values:n,valueOffsets:r}=e,i=te(r[0]),o=te(r[t]),s=Math.min(o-i,n.byteLength-i);return Ri.call(this,Yg(-i,t+1,r)),Ri.call(this,n.subarray(i,i+s)),this}function nS(e){let{length:t,valueOffsets:n}=e;if(n){let{[0]:r,[t]:i}=n;return Ri.call(this,Yg(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function eS(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}Te.prototype.visitBool=kV;Te.prototype.visitInt=ws;Te.prototype.visitFloat=ws;Te.prototype.visitUtf8=nx;Te.prototype.visitLargeUtf8=nx;Te.prototype.visitBinary=nx;Te.prototype.visitLargeBinary=nx;Te.prototype.visitFixedSizeBinary=ws;Te.prototype.visitDate=ws;Te.prototype.visitTimestamp=ws;Te.prototype.visitTime=ws;Te.prototype.visitDecimal=ws;Te.prototype.visitList=nS;Te.prototype.visitStruct=eS;Te.prototype.visitUnion=CV;Te.prototype.visitInterval=ws;Te.prototype.visitDuration=ws;Te.prototype.visitFixedSizeList=nS;Te.prototype.visitMap=nS;var qc=class extends Bc{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 yo,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,Wn(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 Nr(t)?t.then(n=>this.writeAll(n)):Zr(t)?iS(this,t):rS(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 yo?this._sink=t:(this._sink=new yo,t&&BO(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&LO(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||!$c(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 yr&&!(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&&!$c(n,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,n)}t instanceof ke?t instanceof Pc||this._writeRecordBatch(t):t instanceof yr?this.writeAll(t.batches):Ii(t)&&this.writeAll(t)}_writeMessage(t,n=8){let r=n-1,i=br.encode(t),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+r&~r,c=a-o-s;return t.headerType===jt.RecordBatch?this._recordBatchBlocks.push(new hs(a,t.bodyLength,this._position)):t.headerType===jt.DictionaryBatch&&this._dictionaryBlocks.push(new hs(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=St(t);n&&n.byteLength>0&&(this._sink.write(n),this._position+=n.byteLength)}return this}_writeSchema(t){return this._writeMessage(br.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Du)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:n,nodes:r,bufferRegions:i,buffers:o}=Te.assemble(t),s=new In(t.numRows,r,i),a=br.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}=Te.assemble(new Gt([t])),c=new In(t.length,o,s),l=new xr(c,n,r),u=br.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}},tp=class e extends qc{static writeAll(t,n){let r=new e(n);return Nr(t)?t.then(i=>r.writeAll(i)):Zr(t)?iS(r,t):rS(r,t)}},ep=class e extends qc{static writeAll(t){let n=new e;return Nr(t)?t.then(r=>n.writeAll(r)):Zr(t)?iS(n,t):rS(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let n=fs.encode(new fs(t,ue.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(n)._write(Int32Array.of(n.byteLength))._writeMagic()}};function rS(e,t){let n=t;t instanceof yr&&(n=t.batches,e.reset(void 0,t.schema));for(let r of n)e.write(r);return e.finish()}function iS(e,t){return J(this,void 0,void 0,function*(){var n,r,i,o,s,a,c;try{for(n=!0,r=Si(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 gB(e,t){if(Zr(e))return FV(e,t);if(Ii(e))return RV(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function RV(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=St(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 FV(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 J(this,void 0,void 0,function*(){yield o(s,n||(n=e[Symbol.asyncIterator]()))})},pull(s){return J(this,void 0,void 0,function*(){n?yield o(s,n):s.close()})},cancel(){return J(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 J(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=St(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 wB(e){return new oS(e)}var oS=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:n,["writableStrategy"]:r,["queueingStrategy"]:i="count"}=t,o=DO(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Cc(o),this._getSize=i!=="bytes"?xB:bB;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"?xB:bB}),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)}},xB=e=>{var t;return(t=e?.length)!==null&&t!==void 0?t:0},bB=e=>{var t;return(t=e?.byteLength)!==null&&t!==void 0?t:0};function rx(e,t){let n=new yo,r=null,i=new ReadableStream({cancel(){return J(this,void 0,void 0,function*(){yield n.close()})},start(a){return J(this,void 0,void 0,function*(){yield s(a,r||(r=yield o()))})},pull(a){return J(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 J(this,void 0,void 0,function*(){return yield(yield Rr.from(n)).open(t)})}function s(a,c){return J(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 ix(e,t){let n=new this(e),r=new ni(n),i=new ReadableStream({cancel(){return J(this,void 0,void 0,function*(){yield r.cancel()})},pull(s){return J(this,void 0,void 0,function*(){yield o(s)})},start(s){return J(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 J(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 np(e){let t=Rr.from(e);return Nr(t)?t.then(n=>np(n)):t.isAsync()?t.readAll().then(n=>new yr(n)):new yr(t.readAll())}var rY=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g2),q2),L2),x2),u2),B2),d2),{compareSchemas:$c,compareFields:W5,compareTypes:H5});vn.toDOMStream=gB;Se.throughDOM=wB;Rr.throughDOM=rx;zc.throughDOM=rx;bs.throughDOM=rx;qc.throughDOM=ix;ep.throughDOM=ix;tp.throughDOM=ix;function ox(e="ws://localhost:3000/"){let t=[],n=!1,r=null,i,o={open(){n=!0,c()},close(){for(n=!1,r=null,i=null;t.length;)t.shift().reject("Socket closed")},error(l){if(r){let{reject:u}=r;r=null,c(),u(l)}else console.error("WebSocket error: ",l)},message({data:l}){if(r){let{query:u,resolve:f,reject:h}=r;if(r=null,c(),typeof l=="string"){let d=JSON.parse(l);d.error?h(d.error):f(d)}else if(u.type==="exec")f();else if(u.type==="arrow")f(np(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 wr=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?`${_B(t)}.`:""}${r}`}else return t?_B(t):"NULL"}};function _B(e){return e.split(".").map(n=>`"${n}"`).join(".")}function vB(e,t){return e instanceof wr&&e.column===t}function Ut(e){return typeof e=="string"?Ma(e):e}function jc(e){return typeof e=="string"?SB(e):e}function SB(e){return new wr(e)}function Ma(e,t=null){return arguments.length===1&&(t=e,e=null),new wr(e,t)}function bo(e){switch(typeof e){case"boolean":return e?"TRUE":"FALSE";case"string":return`'${e.replace("'","''")}'`;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 _s=e=>typeof e?.addEventListener=="function";function sx(e){return e instanceof vs}var vs=class{constructor(t,n,r){this._expr=Array.isArray(t)?t:[t],this._deps=n||[],this.annotate(r);let i=this._expr.filter(o=>_s(o));i.length>0?(this._params=Array.from(new Set(i)),this._params.forEach(o=>{o.addEventListener("value",()=>iY(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=>_s(t)&&!sx(t)?bo(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 iY(e,t){if(t?.size)return Promise.allSettled(Array.from(t,n=>n(e)))}function sS(e,t){let n=[e[0]],r=new Set,i=t.length;for(let o=0,s=0;o<i;){let a=t[o];_s(a)?n[++s]=a:(Array.isArray(a?.columns)&&a.columns.forEach(l=>r.add(l)),n[s]+=typeof a=="string"?a:bo(a));let c=e[++o];_s(n[s])?n[++s]=c:n[s]+=c}return{spans:n,cols:Array.from(r)}}function j(e,...t){let{spans:n,cols:r}=sS(e,t);return new vs(n,r)}function aS(e){let t=Ut(e);return j`${t} DESC NULLS LAST`.annotate({label:t?.label,desc:!0})}var Vc=e=>({value:e,toString:()=>bo(e)});function rp(e){e(this.op,this),this.children?.forEach(t=>t.visit(e))}function IB(e,t){let n=t.filter(i=>i!=null).map(Ut),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:rp})}var _r=(...e)=>IB("AND",e.flat()),Yc=(...e)=>IB("OR",e.flat()),oY=e=>t=>j`(${e} ${Ut(t)})`.annotate({op:e,a:t,visit:rp}),cS=oY("NOT"),AB=e=>t=>j`(${Ut(t)} ${e})`.annotate({op:e,a:t,visit:rp}),Xc=AB("IS NULL"),Ss=AB("IS NOT NULL"),Ta=e=>(t,n)=>j`(${Ut(t)} ${e} ${Ut(n)})`.annotate({op:e,a:t,b:n,visit:rp}),lS=Ta("="),Gc=Ta("<>"),Is=Ta("<"),ip=Ta(">"),As=Ta("<="),uS=Ta(">="),fS=Ta("IS DISTINCT FROM"),Cu=Ta("IS NOT DISTINCT FROM");function MB(e,t,n,r){t=Ut(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:rp,field:t,range:n})}var We=(e,t,n)=>MB("BETWEEN",e,t,n),hS=(e,t,n)=>MB("NOT BETWEEN",e,t,n);function Wc(e,t){return Array.from({length:e},()=>t)}function An(e,t){return(...n)=>{let r=n.map(Ut),i=t?`::${t}`:"";return(r.length?j([`${e}(`,...Wc(r.length-1,", "),`)${i}`],...r):j`${e}()${i}`).annotate({func:e,args:r})}}var dS=An("REGEXP_MATCHES"),pS=An("CONTAINS"),mS=An("PREFIX"),yS=An("SUFFIX"),sY=An("LOWER"),aY=An("UPPER"),cY=An("LENGTH"),lY=An("ISNAN"),uY=An("ISFINITE"),fY=An("ISINF");var op=class e extends vs{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 h=o&&s?" ":"",d=(o||s)&&a?" ":"";c=j`${n} OVER (${i?`"${i}" `:""}${o}${h}${s}${d}${a})`}r&&(c=j`(${c})::${r}`);let{_expr:u,_deps:f}=c;super(u,f),this.window=t,this.func=n,this.type=r,this.name=i,this.group=o,this.order=s,this.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(Ut),r=j(["PARTITION BY ",Wc(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(Ut),r=j(["ORDER BY ",Wc(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=TB("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=TB("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 TB(e,t){if(_s(t)){let n=j`${t}`;return n.toString=()=>`${e} ${EB(t.value)}`,n}return`${e} ${EB(t)}`}function EB(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 Fi(e,t){return(...n)=>{let r=An(e)(...n);return new op(e,r,t)}}var gS=Fi("ROW_NUMBER","INTEGER"),xS=Fi("RANK","INTEGER"),bS=Fi("DENSE_RANK","INTEGER"),wS=Fi("PERCENT_RANK"),_S=Fi("CUME_DIST"),vS=Fi("NTILE"),SS=Fi("LAG"),IS=Fi("LEAD"),AS=Fi("FIRST_VALUE"),MS=Fi("LAST_VALUE"),TS=Fi("NTH_VALUE");function Vt(e,...t){return j(e,...t).annotate({aggregate:!0})}var ES=class e extends vs{constructor(t,n,r,i,o){n=(n||[]).map(Ut);let{strings:s,exprs:a}=hY(t,n,r,i,o),{spans:c,cols:l}=sS(s,a);super(c,l),this.aggregate=t,this.args=n,this.type=r,this.isDistinct=i,this.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(dY).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 op(t,o,r)}partitionby(...t){return this.window().partitionby(...t)}orderby(...t){return this.window().orderby(...t)}rows(t){return this.window().rows(t)}range(t){return this.window().range(t)}};function hY(e,t,n,r,i){let o=`)${n?`::${n}`:""}`,s=[`${e}(${r?"DISTINCT ":""}`],a=[];return t.length?(s=s.concat([...Wc(t.length-1,", "),`${o}${i?" FILTER (WHERE ":""}`,...i?[")"]:[]]),a=[...t,...i?[i]:[]]):s[0]+="*"+o,{exprs:a,strings:s}}function dY(e){let t=bo(e);return t&&t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function Zt(e,t){return(...n)=>new ES(e,n,t)}var Zn=Zt("COUNT","INTEGER"),sp=Zt("AVG"),pY=Zt("AVG"),NS=Zt("MAD"),oi=Zt("MAX"),si=Zt("MIN"),Fr=Zt("SUM","DOUBLE"),DS=Zt("PRODUCT"),OS=Zt("MEDIAN"),BS=Zt("QUANTILE"),LS=Zt("MODE"),CS=Zt("VARIANCE"),ap=Zt("STDDEV"),kS=Zt("SKEWNESS"),RS=Zt("KURTOSIS"),FS=Zt("ENTROPY"),$S=Zt("VAR_POP"),PS=Zt("STDDEV_POP"),US=Zt("CORR"),zS=Zt("COVAR_SAMP"),qS=Zt("COVAR_POP"),jS=Zt("REGR_INTERCEPT"),VS=Zt("REGR_SLOPE"),YS=Zt("REGR_COUNT"),mY=Zt("REGR_R2"),XS=Zt("REGR_SYY"),GS=Zt("REGR_SXX"),yY=Zt("REGR_SXY"),WS=Zt("REGR_AVGX"),gY=Zt("REGR_AVGY"),HS=Zt("FIRST"),ZS=Zt("LAST"),ku=Zt("ARG_MIN"),Ru=Zt("ARG_MAX"),JS=Zt("STRING_AGG"),QS=Zt("ARRAY_AGG");function cp(e,t){let n=Ut(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 Fu=e=>cp(e,"DOUBLE"),KS=e=>cp(e,"INTEGER");var tI=e=>j`epoch_ms(${Ut(e)})`;function eI(e,t,n=1){let r=`INTERVAL ${n} ${t}`,i=Ut(e);return j`TIME_BUCKET(${r}, ${i})`.annotate({label:t})}var nI=e=>{let t=Ut(e);return j`MAKE_DATE(2012, MONTH(${t}), 1)`.annotate({label:"month"})},rI=e=>{let t=Ut(e);return j`MAKE_DATE(2012, MONTH(${t}), DAY(${t}))`.annotate({label:"date"})},iI=e=>{let t=Ut(e);return j`MAKE_DATE(2012, 1, DAY(${t}))`.annotate({label:"date"})};var lp=An("ST_AsGeoJSON"),NB=An("ST_X"),DB=An("ST_Y"),up=An("ST_CENTROID"),oI=e=>NB(up(e)),sI=e=>DB(up(e));var dt=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 Hc("UNION",t.flat())}static unionAll(...t){return new Hc("UNION ALL",t.flat())}static intersect(...t){return new Hc("INTERSECT",t.flat())}static except(...t){return new Hc("EXCEPT",t.flat())}static describe(t){let n=t.clone(),{clone:r,toString:i}=n;return Object.assign(n,{describe:!0,clone:()=>e.describe(r.call(n)),toString:()=>`DESCRIBE ${i.call(n)}`})}constructor(){this.query={with:[],select:[],from:[],where:[],groupby:[],having:[],window:[],qualify:[],orderby:[]},this.cteFor=null}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 o of t.flat())if(o!=null)if(typeof o=="string")r.push({as:o,expr:Ut(o)});else if(o instanceof wr)r.push({as:o.column,expr:o});else if(Array.isArray(o))r.push({as:o[0],expr:o[1]});else for(let s in o)r.push({as:ax(s),expr:Ut(o[s])});let i=new Set(r.map(o=>o.as));return n.select=n.select.filter(o=>!i.has(o.as)).concat(r.filter(o=>o.expr)),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:jc(i)});else if(i instanceof wr)r.push({as:i.table,from:i});else if(fp(i)||sx(i))r.push({from:i});else if(Array.isArray(i))r.push({as:ax(i[0]),from:jc(i[1])});else for(let o in i)r.push({as:ax(o),from:jc(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(Ut)),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:ax(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(Ut)),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(fp(s))o.push(s);else if(i[s.table]){let a=i[s.table];o.push(a)}}),o}toString(){let{with:t,select:n,distinct:r,from:i,sample:o,where:s,groupby:a,having:c,window:l,qualify:u,orderby:f,limit:h,offset:d}=this.query,p=[];if(t.length){let y=t.map(({as:g,query:x})=>`"${g}" AS (${x})`);p.push(`WITH ${y.join(", ")}`)}let m=n.map(({as:y,expr:g})=>vB(g,y)&&!g.table?`${g}`:`${g} AS "${y}"`);if(p.push(`SELECT${r?" DISTINCT":""} ${m.join(", ")}`),i.length){let y=i.map(({as:g,from:x})=>{let b=fp(x)?`(${x})`:`${x}`;return!g||g===x.table?b:`${b} AS "${g}"`});p.push(`FROM ${y.join(", ")}`)}if(s.length){let y=s.map(String).filter(g=>g).join(" AND ");y&&p.push(`WHERE ${y}`)}if(o){let{rows:y,perc:g,method:x,seed:b}=o,w=y?`${y} ROWS`:`${g} PERCENT`,v=x?` (${x}${b!=null?`, ${b}`:""})`:"";p.push(`USING SAMPLE ${w}${v}`)}if(a.length&&p.push(`GROUP BY ${a.join(", ")}`),c.length){let y=c.map(String).filter(g=>g).join(" AND ");y&&p.push(`HAVING ${y}`)}if(l.length){let y=l.map(({as:g,expr:x})=>`"${g}" AS (${x})`);p.push(`WINDOW ${y.join(", ")}`)}if(u.length){let y=u.map(String).filter(g=>g).join(" AND ");y&&p.push(`QUALIFY ${y}`)}return f.length&&p.push(`ORDER BY ${f.join(", ")}`),Number.isFinite(h)&&p.push(`LIMIT ${h}`),Number.isFinite(d)&&p.push(`OFFSET ${d}`),p.join(" ")}},Hc=class e{constructor(t,n){this.op=t,this.queries=n.map(r=>r.clone()),this.query={orderby:[]},this.cteFor=null}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(Ut)),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 fp(e){return e instanceof dt||e instanceof Hc}function aI(e){return fp(e)&&e.describe}function ax(e){return xY(e)?e.slice(1,-1):e}function xY(e){return e[0]==='"'&&e[e.length-1]==='"'}var cx=e=>e;function OB(){return{apply:cx,invert:cx,sqlApply:Ut,sqlInvert:cx}}function bY({base:e=null}={}){if(e==null||e===Math.E)return{apply:Math.log,invert:Math.exp,sqlApply:t=>j`LN(${Ut(t)})`,sqlInvert:t=>j`EXP(${t})`};if(e===10)return{apply:Math.log10,invert:t=>Math.pow(10,t),sqlApply:t=>j`LOG(${Ut(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(${Ut(n)}) / LN(${t})`,sqlInvert:n=>j`POW(${t}, ${n})`}}}function wY({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=Ut(n),j`SIGN(${n}) * LN(${t} + ABS(${n}))`),sqlInvert:n=>j`SIGN(${n}) * (EXP(ABS(${n})) - ${t})`}}function _Y(){return{apply:e=>Math.sign(e)*Math.sqrt(Math.abs(e)),invert:e=>Math.sign(e)*e*e,sqlApply:e=>(e=Ut(e),j`SIGN(${e}) * SQRT(ABS(${e}))`),sqlInvert:e=>j`SIGN(${e}) * (${e}) ** 2`}}function vY({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=Ut(n),j`SIGN(${n}) * POW(ABS(${n}), ${t})`),sqlInvert:n=>j`SIGN(${n}) * POW(ABS(${n}), 1/${t})`}}function BB(){return{apply:e=>+e,invert:e=>new Date(e),sqlApply:e=>e instanceof Date?+e:tI(Ut(e)),sqlInvert:cx}}var SY={identity:OB,linear:OB,log:bY,symlog:wY,sqrt:_Y,pow:vY,time:BB,utc:BB};function hp(e){let t=SY[e.type];return t?{...e,...t(e)}:null}function wo(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 dp(e){return`INSTALL ${e}; LOAD ${e}`}function LB(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=>`${bo(i[s])} AS "${t[s]}"`);r.push(`(SELECT ${o.join(", ")})`)}return r.join(" UNION ALL ")}function lx(e,t,n,r={},i={}){let{select:o=["*"],where:s,view:a,temp:c,replace:l,...u}=r,f=IY({...i,...u}),h=`${e}('${n}'${f?", "+f:""})`,d=s?` WHERE ${s}`:"",p=`SELECT ${o.join(", ")} FROM ${h}${d}`;return wo(t,p,{view:a,temp:c,replace:l})}function lI(e,t,n){return lx("read_csv",e,t,n,{auto_detect:!0,sample_size:-1})}function uI(e,t,n){return lx("read_json",e,t,n,{auto_detect:!0,json_format:"auto"})}function fI(e,t,n){return lx("read_parquet",e,t,n)}function hI(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(", ");Object.assign(i,{open_options:o.toUpperCase()})}return lx("st_read",e,t,i)}function dI(e,t,n={}){let{select:r=["*"],...i}=n,o=LB(t),s=r.length===1&&r[0]==="*"?o:`SELECT ${r} FROM ${o}`;return wo(e,s,i)}function IY(e){return Object.entries(e).map(([t,n])=>`${t}=${cI(n)}`).join(", ")}function cI(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=>cI(t)).join(", ")+"]":"{"+Object.entries(e).map(([t,n])=>`'${t}': ${cI(n)}`).join(", ")+"}";default:return e}}function kB(e){if(!e.filterIndexable)return null;let t=e.query(),n=pI(t);if(typeof n!="string"||!t.select)return null;let r=[],i=[],o={};for(let s of t.select()){let{as:a,expr:{aggregate:c,args:l}}=s,u=c?.toUpperCase?.();switch(u){case"COUNT":case"SUM":r.push({[a]:Vt`SUM("${a}")::DOUBLE`});break;case"AVG":r.push({[a]:MY(o,a,l[0])});break;case"ARG_MAX":r.push({[a]:TY(o,a,l)});break;case"ARG_MIN":r.push({[a]:EY(o,a,l)});break;case"VARIANCE":case"VAR_SAMP":o[a]=null,r.push({[a]:ux(o,l[0],n)});break;case"VAR_POP":o[a]=null,r.push({[a]:ux(o,l[0],n,!1)});break;case"STDDEV":case"STDDEV_SAMP":o[a]=null,r.push({[a]:Vt`SQRT(${ux(o,l[0],n)})`});break;case"STDDEV_POP":o[a]=null,r.push({[a]:Vt`SQRT(${ux(o,l[0],n,!1)})`});break;case"COVAR_SAMP":o[a]=null,r.push({[a]:fx(o,l,n)});break;case"COVAR_POP":o[a]=null,r.push({[a]:fx(o,l,n,!1)});break;case"CORR":o[a]=null,r.push({[a]:CB(o,l,n)});break;case"REGR_COUNT":o[a]=null,r.push({[a]:Vt`${$u(o,l)}::DOUBLE`});break;case"REGR_AVGX":o[a]=null,r.push({[a]:$B(o,l)});break;case"REGR_AVGY":o[a]=null,r.push({[a]:PB(o,l)});break;case"REGR_SYY":o[a]=null,r.push({[a]:yI(o,0,l,n)});break;case"REGR_SXX":o[a]=null,r.push({[a]:yI(o,1,l,n)});break;case"REGR_SXY":o[a]=null,r.push({[a]:fx(o,l,n,null)});break;case"REGR_SLOPE":o[a]=null,r.push({[a]:UB(o,l,n)});break;case"REGR_INTERCEPT":o[a]=null,r.push({[a]:NY(o,l,n)});break;case"REGR_R2":o[a]=null,r.push({[a]:Vt`(${CB(o,l,n)}) ** 2`});break;case"MAX":case"MIN":case"BIT_AND":case"BIT_OR":case"BIT_XOR":case"BOOL_AND":case"BOOL_OR":case"PRODUCT":r.push({[a]:Vt`${u}("${a}")`});break;default:if(!c)i.push(a);else return null}}return r.length?{from:n,dims:i,aggr:r,aux:o}:null}function $i(e,...t){let n=t.length?"_"+t.map(AY).join("_"):"";return`__${e}${n}__`}function AY(e){return`${e}`.replaceAll('"',"").replaceAll(" ","_")}function pI(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=pI(t[0]);for(let r=1;r<t.length;++r){let i=pI(t[r]);if(i!==void 0&&i!==n)return NaN}return n}function RB(e,t){let n=$i("count",t);return e[n]=Vt`COUNT(${t})`,Vt`SUM(${n})`.annotate({name:n})}function MY(e,t,n){let r=RB(e,n);return Vt`(SUM("${t}" * ${r.name}) / ${r})`}function pp(e,t){return j`(SELECT AVG(${e}) FROM "${t}")`}function TY(e,t,[,n]){let r=$i("max",n);return e[r]=Vt`MAX(${n})`,Vt`ARG_MAX("${t}", ${r})`}function EY(e,t,[,n]){let r=$i("min",n);return e[r]=Vt`MIN(${n})`,Vt`ARG_MIN("${t}", ${r})`}function ux(e,t,n,r=!0){let i=RB(e,t),o=$i("rssq",t),s=$i("rsum",t),a=j`${t} - ${pp(t,n)}`;return e[o]=Vt`SUM((${a}) ** 2)`,e[s]=Vt`SUM(${a})`,Vt`(SUM(${o}) - (SUM(${s}) ** 2 / ${i})) / (${i}${r?" - 1":""})`}function fx(e,t,n,r=!0){let i=$u(e,t),o=FB(e,t,n),s=mp(e,1,t,n),a=mp(e,0,t,n),c=r===null?"":r?` / (${i} - 1)`:` / ${i}`;return Vt`(${o} - ${s} * ${a} / ${i})${c}`}function CB(e,t,n){let r=$u(e,t),i=FB(e,t,n),o=mI(e,1,t,n),s=mI(e,0,t,n),a=mp(e,1,t,n),c=mp(e,0,t,n),l=Vt`(${o} - (${a} ** 2) / ${r})`,u=Vt`(${s} - (${c} ** 2) / ${r})`;return Vt`(${i} - ${a} * ${c} / ${r}) / SQRT(${l} * ${u})`}function $u(e,[t,n]){let r=$i("count",t,n);return e[r]=Vt`REGR_COUNT(${t}, ${n})`,Vt`SUM(${r})`.annotate({name:r})}function mp(e,t,n,r){let i=n[t],o=n[1-t],s=$i("rs",i);return e[s]=Vt`SUM(${i} - ${pp(i,r)}) FILTER (${o} IS NOT NULL)`,Vt`SUM(${s})`}function mI(e,t,n,r){let i=n[t],o=n[1-t],s=$i("rss",i);return e[s]=Vt`SUM((${i} - ${pp(i,r)}) ** 2) FILTER (${o} IS NOT NULL)`,Vt`SUM(${s})`}function FB(e,t,n){let[r,i]=t,o=$i("sxy",r,i);return e[o]=Vt`SUM((${i} - ${pp(i,n)}) * (${r} - ${pp(r,n)}))`,Vt`SUM(${o})`}function $B(e,t){let[n,r]=t,i=$u(e,t),o=$i("avg",r,n);return e[o]=Vt`REGR_AVGX(${n}, ${r})`,Vt`(SUM(${o} * ${i.name}) / ${i})`}function PB(e,t){let[n,r]=t,i=$u(e,t),o=$i("avg",n,r);return e[o]=Vt`REGR_AVGY(${n}, ${r})`,Vt`(SUM(${o} * ${i.name}) / ${i})`}function yI(e,t,n,r){let i=$u(e,n),o=mp(e,t,n,r),s=mI(e,t,n,r);return Vt`(${s} - (${o} ** 2 / ${i}))`}function UB(e,t,n){let r=fx(e,t,n,null),i=yI(e,1,t,n);return Vt`(${r}) / ${i}`}function NY(e,t,n){let r=$B(e,t),i=PB(e,t),o=UB(e,t,n);return Vt`${i} - (${o}) * ${r}`}function qB(e){let t=2166136261;for(let n=0,r=e.length;n<r;++n){let i=e.charCodeAt(n),o=i&65280;o&&(t=zB(t^o>>8)),t=zB(t^i&255)}return DY(t)}function zB(e){return e+(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}function DY(e){return e+=e<<13,e^=e>>>7,e+=e<<3,e^=e>>>17,e+=e<<5,e&4294967295}var OY={skip:!0,result:null},hx=class{constructor(t,{enabled:n=!0,temp:r=!0}={}){this.indexes=new Map,this.active=null,this.temp=r,this.mc=t,this._enabled=n}enabled(t){if(t===void 0)return this._enabled;this._enabled!==t&&(t||this.clear(),this._enabled=t)}clear(){this.mc.cancel(Array.from(this.indexes.values(),t=>t?.result)),this.indexes.clear(),this.active=null}index(t,n,r){if(!this._enabled)return null;let{indexes:i,mc:o,temp:s}=this,{source:a}=r;if(!a||this.active&&(this.active.source!==a&&this.clear(),this.active?.source===null))return null;let{active:c}=this;if(!c&&(this.active=c=BY(r),c.source===null))return null;if(i.has(t))return i.get(t);let l=kB(t),u;if(!l)u=null;else if(n.skip(t,r))u=OY;else{let f=n.remove(a).predicate(t);u=kY(t.query(f),c,l),u.result=o.exec(wo(u.table,u.create,{temp:s})),u.result.catch(h=>o.logger().error(h))}return i.set(t,u),u}};function BY(e){let{source:t,meta:n}=e,r=e.predicate,i=r?.columns,o,s;if(!n||!i)return{source:null,columns:s,predicate:o};let{type:a,scales:c,bin:l,pixelSize:u=1}=n;if(a==="point")o=f=>f,s=Object.fromEntries(i.map(f=>[`${f}`,Ut(f)]));else if(a==="interval"&&c){let f=c.map(h=>CY(h,u,l));f.some(h=>!h)||(f.length===1?(o=h=>h?We("active0",h.range.map(f[0])):[],s={active0:f[0](r.field)}):(o=h=>h?_r(h.children.map(({range:d},p)=>We(`active${p}`,d.map(f[p])))):[],s=Object.fromEntries(r.children.map((h,d)=>[`active${d}`,f[d](h.field)]))))}return{source:s?t:null,columns:s,predicate:o}}var LY={ceil:"CEIL",round:"ROUND"};function CY(e,t,n){let{type:r,domain:i,range:o,apply:s,sqlApply:a}=hp(e);if(!s)return;let c=LY[`${n}`.toLowerCase()]||"FLOOR",l=s(Math.min(...i)),u=s(Math.max(...i)),f=r==="identity"?1:Math.abs(o[1]-o[0])/(u-l),h=f/t===1?"":`${f/t}::DOUBLE * `,d=l===0?"":` - ${l}::DOUBLE`;return p=>j`${c}(${h}(${a(p)}${d}))::INTEGER`}function kY(e,t,n){let{dims:r,aggr:i,aux:o}=n,{columns:s}=t,a=e.select({...s,...o}).groupby(Object.keys(s)),[c]=a.subqueries;if(c){let p=Object.values(s).flatMap(m=>m.columns);RY(c,p)}let l=a.orderby();a.query.orderby=[];let u=a.toString(),h=`cube_index_${(qB(u)>>>0).toString(16)}`,d=dt.select(r,i).from(h).groupby(r).orderby(l);return new gI({table:h,create:u,active:t,select:d})}function RY(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 gI=class{constructor({table:t,create:n,active:r,select:i}={}){this.table=t,this.create=n,this.result=null,this.active=r,this.select=i,this.skip=!1}query(t){return this.select.clone().where(this.active.predicate(t))}};var Zc=class extends Promise{constructor(){let t,n;super((r,i)=>{t=r,n=i}),this._resolve=t,this._reject=n}fulfill(t){return this._resolve(t),this}reject(t){return this._reject(t),this}};Zc.prototype.constructor=Promise;function FY(e){return(typeof requestAnimationFrame<"u"?requestAnimationFrame:typeof setImmediate<"u"?setImmediate:setTimeout)(e)}function jB(e,t,n){let r=[],i=0;function o(){let s=$Y(r,t);r=[],i=0;for(let a of s)UY(a,e,n),jY(a,t)}return{add(s,a){s.request.type==="arrow"?(i=i||FY(()=>o()),r.push({entry:s,priority:a,index:r.length})):e(s,a)}}}function $Y(e,t){let n=[],r=new Map;for(let i of e){let{entry:{request:o}}=i,s=PY(o.query,t);if(!r.has(s)){let a=[];n.push(a),r.set(s,a)}r.get(s).push(i)}return n}function PY(e,t){let n=`${e}`;if(e instanceof dt&&!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 wr&&o[s.column]||s))}return`${r}`}else return n}function UY(e,t,n){if(zY(e))t({request:{type:"arrow",cache:!1,record:!1,query:e.query=qY(e,n)},result:e.result=new Zc});else for(let{entry:r,priority:i}of e)t(r,i)}function zY(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 qY(e,t){let n=e.maps=[],r=new Map;for(let s of e){let{query:a}=s.entry.request,c=[];n.push(c);for(let{as:l,expr:u}of a.select()){let f=`${u}`;r.has(f)||r.set(f,[`col${r.size}`,u]);let[h]=r.get(f);c.push([h,l])}t(`${a}`)}let i=e[0].entry.request.query.clone(),o=i.groupby();if(o.length){let s={};e.maps[0].forEach(([a,c])=>s[c]=a),i.$groupby(o.map(a=>a instanceof wr&&s[a.column]||a))}return i.$select(Array.from(r.values()))}async function jY(e,t){let{maps:n,query:r,result:i}=e;if(!n)return;let o;try{o=await i}catch(a){for(let{entry:c}of e)c.result.reject(a);return}let s=aI(r);e.forEach(({entry:a},c)=>{let{request:l,result:u}=a,f=n[c],h=s&&f?YY(o,f):f?VY(o,f):o;l.cache&&t.set(String(l.query),h),u.fulfill(h)})}function VY(e,t){let n={};for(let[r,i]of t)n[i]=e.getChild(r);return new e.constructor(n)}function YY(e,t){let n=new Map(t),r=[];for(let i of e)n.has(i.column_name)&&r.push({...i,column_name:n.get(i.column_name)});return r}var XY=typeof requestIdleCallback<"u"?requestIdleCallback:setTimeout,VB=()=>({get:()=>{},set:(e,t)=>t,clear:()=>{}});function YB({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&&XY(r),o},clear(){n=new Map}}}function XB(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 _o={High:0,Normal:1,Low:2},dx=class{constructor(){this.queue=XB(3),this.db=null,this.clientCache=null,this._logger=null,this._logQueries=!1,this.recorders=[],this.pending=null,this._consolidate=null}next(){if(this.pending||this.queue.isEmpty())return;let{request:t,result:n}=this.queue.next();this.pending=this.submit(t,n),this.pending.finally(()=>{this.pending=null,this.next()})}enqueue(t,n=_o.Normal){this.queue.insert(t,n),this.next()}recordQuery(t){this.recorders.length&&t&&this.recorders.forEach(n=>n.add(t))}async submit(t,n){try{let{query:r,type:i,cache:o=!1,record:s=!0,options:a}=t,c=r?`${r}`:null;if(s&&this.recordQuery(c),o){let f=this.clientCache.get(c);if(f){this._logger.debug("Cache"),n.fulfill(f);return}}let l=performance.now();this._logQueries&&this._logger.debug("Query",{type:i,sql:c,...a});let u=await this.db.query({type:i,sql:c,...a});o&&this.clientCache.set(c,u),this._logger.debug(`Request: ${(performance.now()-l).toFixed(1)}`),n.fulfill(u)}catch(r){n.reject(r)}}cache(t){return t!==void 0?this.clientCache=t===!0?YB():t||VB():this.clientCache}logger(t){return t?this._logger=t:this._logger}logQueries(t){return t!==void 0?this._logQueries=!!t:this._logQueries}connector(t){return t?this.db=t:this.db}consolidate(t){t&&!this._consolidate?this._consolidate=jB(this.enqueue.bind(this),this.clientCache,this.recordQuery.bind(this)):!t&&this._consolidate&&(this._consolidate=null)}request(t,n=_o.Normal){let r=new Zc,i={request:t,result:r};return this._consolidate?this._consolidate.add(i,n):this.enqueue(i,n),r}cancel(t){let n=new Set(t);n.size&&this.queue.remove(({result:r})=>n.has(r))}clear(){this.queue.remove(({result:t})=>(t.reject("Cleared"),!0))}record(){let t=[],n={add(r){t.push(r)},reset(){t=[]},snapshot(){return t.slice()},stop(){return this.recorders=this.recorders.filter(r=>r!==n),t}};return this.recorders.push(n),n}};function xI(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":return"number";case"DATE":case"TIMESTAMP":case"TIMESTAMPTZ":case"TIMESTAMP WITH TIME ZONE":case"TIME":case"TIMESTAMP_NS":return"date";case"BOOLEAN":return"boolean";case"VARCHAR":case"UUID":case"JSON":return"string";case"ARRAY":case"LIST":return"array";case"BLOB":case"STRUCT":case"MAP":case"GEOMETRY":return"object";default:if(e.startsWith("DECIMAL"))return"number";if(e.startsWith("STRUCT")||e.startsWith("MAP"))return"object";if(e.endsWith("]"))return"array";throw new Error(`Unsupported type: ${e}`)}}function bI(e){return typeof e?.getChild=="function"}function wI(e){if(W.isTimestamp(e))return t=>t==null?t:new Date(t);if(W.isInt(e)&&e.bitWidth>=64)return t=>t==null?t:Number(t);if(W.isDecimal(e)){let t=1/Math.pow(10,e.scale);return n=>n==null?n:WB(n,t)}return t=>t}function _I(e){let{type:t}=e;if(W.isTimestamp(t)){let n=e.length,r=new Array(n);for(let i=0;i<n;++i){let o=e.get(i);r[i]=o==null?null:new Date(o)}return r}if(W.isInt(t)&&t.bitWidth>=64){let n=e.length,r=e.nullCount?new Array(n):new Float64Array(n);for(let i=0;i<n;++i){let o=e.get(i);r[i]=o==null?null:Number(o)}return r}if(W.isDecimal(t)){let n=1/Math.pow(10,t.scale),r=e.length,i=e.nullCount?new Array(r):new Float64Array(r);for(let o=0;o<r;++o){let s=e.get(o);i[o]=s==null?null:WB(s,n)}return i}return e.nullCount?Array.from(e):e.toArray()}var GB=Array.from({length:8},(e,t)=>Math.pow(2,t*32));function WB(e,t){let n=e.length,r=0;if(e.signed&&(e[n-1]|0)<0){for(let i=0;i<n;++i)r+=~e[i]*GB[i];r=-(r+1)}else for(let i=0;i<n;++i)r+=e[i]*GB[i];return r*t}var GY="count",WY="nulls",HY="max",ZY="min",JY="distinct";var QY={[GY]:Zn,[JY]:e=>Zn(e).distinct(),[HY]:oi,[ZY]:si,[WY]:e=>Zn().where(Xc(e))};function KY(e,t,n){return dt.from(e).select(Array.from(n,r=>[r,QY[r](t)]))}async function HB(e,t){return t.length===1&&`${t[0].column}`=="*"?eX(e,t[0].table):(await Promise.all(t.map(n=>tX(e,n)))).filter(n=>n)}async function tX(e,{table:t,column:n,stats:r}){let i=dt.from({source:t}).select({column:n}).groupby(n.aggregate?j`ALL`:[]),[o]=Array.from(await e.query(dt.describe(i))),s={table:t,column:`${n}`,sqlType:o.column_type,type:xI(o.column_type),nullable:o.null==="YES"};if(!(r?.length||r?.size))return s;let a=await e.query(KY(t,n,r),{persist:!0});for(let c=0;c<a.numCols;++c){let{name:l}=a.schema.fields[c],u=a.getChildAt(c),f=wI(u.type);s[l]=f(u.get(0))}return s}async function eX(e,t){let n=await e.query(`DESCRIBE ${jc(t)}`);return Array.from(n).map(r=>({table:t,column:r.column_name,sqlType:r.column_type,type:xI(r.column_type),nullable:r.null==="YES"}))}function ZB(){return{debug(){},info(){},log(){},warn(){},error(){}}}var px;function ai(e){return e?px=e:px==null&&(px=new yp),px}var yp=class{constructor(t=ox(),{logger:n=console,manager:r=new dx,cache:i=!0,consolidate:o=!0,indexes:s={}}={}){this.manager=r,this.manager.cache(i),this.manager.consolidate(o),this.dataCubeIndexer=new hx(this,s),this.logger(n),this.databaseConnector(t),this.clear()}clear({clients:t=!0,cache:n=!0}={}){this.manager.clear(),t&&(this.filterGroups?.forEach(r=>r.disconnect()),this.filterGroups=new Map,this.clients?.forEach(r=>this.disconnect(r)),this.clients=new Set),n&&this.manager.cache().clear()}databaseConnector(t){return this.manager.connector(t)}logger(t){return arguments.length&&(this._logger=t||ZB(),this.manager.logger(this._logger)),this._logger}cancel(t){this.manager.cancel(t)}exec(t,{priority:n=_o.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=_o.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:_o.Low})}createBundle(t,n,r=_o.Low){let i={name:t,queries:n};return this.manager.request({type:"create-bundle",options:i},r)}loadBundle(t,n=_o.High){let r={name:t};return this.manager.request({type:"load-bundle",options:r},n)}updateClient(t,n,r=_o.Normal){return t.queryPending(),this.query(n,{priority:r}).then(i=>t.queryResult(i).update(),i=>{this._logger.error(i),t.queryError(i)}).catch(i=>this._logger.error(i))}requestQuery(t,n){return this.dataCubeIndexer.clear(),n?this.updateClient(t,n):t.update()}async connect(t){let{clients:n}=this;if(n.has(t))throw new Error("Client already connected.");n.add(t),t.coordinator=this;let r=t.fields();r?.length&&t.fieldInfo(await HB(this,r)),nX(this,t.filterBy,t),t.requestQuery()}disconnect(t){let{clients:n,filterGroups:r}=this;if(!n.has(t))return;n.delete(t),t.coordinator=null;let i=r.get(t.filterBy);i&&i.clients.delete(t)}};function nX(e,t,n){if(!t)return;let r=e.filterGroups.get(t);if(!r){let i=s=>rX(e,t,s),o=()=>iX(e,t);t.addEventListener("activate",i),t.addEventListener("value",o),r={selection:t,clients:new Set,disconnect(){t.removeEventListener("activate",i),t.removeEventListener("value",o)}},e.filterGroups.set(t,r)}r.clients.add(n)}function rX(e,t,n){let{dataCubeIndexer:r,filterGroups:i}=e,{clients:o}=i.get(t);for(let s of o)r.index(s,t,n)}function iX(e,t){let{dataCubeIndexer:n,filterGroups:r}=e,{clients:i}=r.get(t),{active:o}=t;return Promise.allSettled(Array.from(i,s=>{let a=n.index(s,t,o),c=a?null:t.predicate(s);if(a?.skip||!a&&!c)return;let l=a?.query(o.predicate)??s.query(c);return e.updateClient(s,l)}))}var mx=class{constructor(){this._callbacks=new Map}addEventListener(t,n){this._callbacks.has(t)||this._callbacks.set(t,{callbacks:new Set,pending:null,queue:new vI}),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(t,n){return null}cancel(t){this._callbacks.get(t)?.queue.clear()}async pending(t){await this._callbacks.get(t)?.pending}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=Array.from(o,c=>c(i));r.pending=Promise.allSettled(a).then(()=>{r.pending=null,s.isEmpty()||this.emit(t,s.dequeue())})}}}},vI=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 gp(e,t){return e===t?!1:e instanceof Date&&t instanceof Date?+e!=+t:Array.isArray(e)&&Array.isArray(t)?oX(e,t):!0}function oX(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 vr(e){return e instanceof Ea}var Ea=class e extends mx{constructor(t){super(),this._value=t}static value(t){return new e(t)}static array(t){if(t.some(n=>vr(n))){let n=new e,r=()=>{n.update(t.map(i=>vr(i)?i.value:i))};return r(),t.forEach(i=>vr(i)?i.addEventListener("value",r):0),n}return new e(t)}get value(){return this._value}update(t,{force:n}={}){return gp(this._value,t)||n?this.emit("value",t):this.cancel("value"),this}willEmit(t,n){return t==="value"&&(this._value=n),n}};function $r(e){return e instanceof Ms}var Ms=class e extends Ea{static intersect({cross:t=!1,empty:n=!1}={}){return new e(new Jc({cross:t,empty:n}))}static union({cross:t=!1,empty:n=!1}={}){return new e(new Jc({cross:t,empty:n,union:!0}))}static single({cross:t=!1,empty:n=!1}={}){return new e(new Jc({cross:t,empty:n,single:!0}))}static crossfilter({empty:t=!1}={}){return new e(new Jc({cross:!0,empty:t}))}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 resolver(){return this._resolver}get single(){return this._resolver.single}get clauses(){return super.value}get active(){return this.clauses.active}get value(){return this.active?.value}valueFor(t){return this.clauses.find(n=>n.source===t)?.value}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,empty:i}={}){this.union=!!t,this.cross=!!n,this.single=!!r,this.empty=!!i}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{empty:i,union:o}=this;if(i&&!t.length)return["FALSE"];if(this.skip(r,n))return;let s=t.filter(a=>!this.skip(r,a)).map(a=>a.predicate);return o&&s.length>1?Yc(s):s}queueFilter(t){if(this.cross){let n=t.active?.source;return r=>r.active?.source!==n}return null}};function xp(e,t,{source:n,clients:r=n?new Set([n]):void 0}){let i=t!==void 0?Cu(e,Vc(t)):null;return{meta:{type:"point"},source:n,clients:r,value:t,predicate:i}}function Qc(e,t,{source:n,clients:r=n?new Set([n]):void 0}){let i=null;if(t){let o=t.map(s=>{let a=s.map((c,l)=>Cu(e[l],Vc(c)));return a.length>1?_r(a):a[0]});i=o.length>1?Yc(o):o[0]}return{meta:{type:"point"},source:n,clients:r,value:t,predicate:i}}function Kc(e,t,{source:n,clients:r=n?new Set([n]):void 0,bin:i,scale:o,pixelSize:s=1}){let a=t!=null?We(e,t):null;return{meta:{type:"interval",scales:o&&[o],bin:i,pixelSize:s},source:n,clients:r,value:t,predicate:a}}function SI(e,t,{source:n,clients:r=n?new Set([n]):void 0,bin:i,scales:o=[],pixelSize:s=1}){let a=t!=null?_r(e.map((l,u)=>We(l,t[u]))):null;return{meta:{type:"interval",scales:o,bin:i,pixelSize:s},source:n,clients:r,value:t,predicate:a}}var sX={contains:pS,prefix:mS,suffix:yS,regexp:dS};function II(e,t,{source:n,clients:r=void 0,method:i="contains"}){let o=sX[i],s=t?o(e,Vc(t)):null;return{meta:{type:"match",method:i},source:n,clients:r,value:t,predicate:s}}function AI(){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}}}function Sr(e){return bI(e)?aX(e):cX(e)}function aX(e){let{numRows:t,numCols:n,schema:{fields:r}}=e,i={};for(let o=0;o<n;++o){let s=r[o].name;i[s]?console.warn(`Redundant column name "${s}". Skipping...`):i[s]=_I(e.getChildAt(o))}return{numRows:t,columns:i}}function cX(e){let t=e.length;if(typeof e[0]=="object"){let n=t?Object.keys(e[0]):[],r={};return n.length>0&&n.forEach(i=>{r[i]=e.map(o=>o[i])}),{numRows:t,columns:r}}else return{numRows:t,values:e}}var pO={};Tr(pO,{Fixed:()=>vo,Param:()=>Ea,Query:()=>dt,Selection:()=>Ms,agg:()=>Vt,align:()=>Q6,and:()=>_r,area:()=>$N,areaX:()=>PN,areaY:()=>UN,argmax:()=>Ru,argmin:()=>ku,arrayAgg:()=>QS,arrow:()=>LD,aspectRatio:()=>K6,avg:()=>sp,axis:()=>t4,axisFx:()=>$D,axisFy:()=>PD,axisX:()=>RD,axisY:()=>FD,barX:()=>VN,barY:()=>YN,bin:()=>gv,cast:()=>cp,castDouble:()=>Fu,castInteger:()=>KS,cell:()=>XN,cellX:()=>GN,cellY:()=>WN,centroid:()=>up,centroidX:()=>oI,centroidY:()=>sI,circle:()=>eD,colorBase:()=>zE,colorClamp:()=>NE,colorConstant:()=>jE,colorDomain:()=>TE,colorExponent:()=>qE,colorInterpolate:()=>LE,colorLabel:()=>RE,colorLegend:()=>fO,colorN:()=>DE,colorNice:()=>OE,colorPercent:()=>FE,colorPivot:()=>CE,colorRange:()=>EE,colorReverse:()=>$E,colorScale:()=>ME,colorScheme:()=>BE,colorSymmetric:()=>kE,colorTickFormat:()=>UE,colorZero:()=>PE,column:()=>Ma,contour:()=>bD,coordinator:()=>ai,corr:()=>US,count:()=>Zn,covarPop:()=>qS,covariance:()=>zS,create:()=>wo,cume_dist:()=>_S,dateDay:()=>iI,dateMonth:()=>nI,dateMonthDay:()=>rI,delaunayLink:()=>DD,delaunayMesh:()=>OD,denseLine:()=>xD,dense_rank:()=>bS,density:()=>gD,densityX:()=>mD,densityY:()=>yD,dot:()=>QN,dotX:()=>KN,dotY:()=>tD,entropy:()=>FS,eq:()=>lS,errorbarX:()=>MD,errorbarY:()=>TD,facetGrid:()=>M8,facetLabel:()=>T8,facetMargin:()=>_8,facetMarginBottom:()=>S8,facetMarginLeft:()=>I8,facetMarginRight:()=>A8,facetMarginTop:()=>v8,first:()=>HS,first_value:()=>AS,frame:()=>kD,from:()=>Iz,fxAlign:()=>C8,fxAriaDescription:()=>Q8,fxAriaLabel:()=>J8,fxAxis:()=>$8,fxDomain:()=>E8,fxFontVariant:()=>Z8,fxGrid:()=>Y8,fxInset:()=>D8,fxInsetLeft:()=>O8,fxInsetRight:()=>B8,fxLabel:()=>G8,fxLabelAnchor:()=>W8,fxLabelOffset:()=>H8,fxLine:()=>X8,fxPadding:()=>k8,fxPaddingInner:()=>R8,fxPaddingOuter:()=>F8,fxRange:()=>N8,fxReverse:()=>K8,fxRound:()=>L8,fxTickFormat:()=>j8,fxTickPadding:()=>q8,fxTickRotate:()=>V8,fxTickSize:()=>U8,fxTickSpacing:()=>z8,fxTicks:()=>P8,fyAlign:()=>sE,fyAriaDescription:()=>IE,fyAriaLabel:()=>SE,fyAxis:()=>uE,fyDomain:()=>tE,fyFontVariant:()=>vE,fyGrid:()=>gE,fyInset:()=>nE,fyInsetBottom:()=>iE,fyInsetTop:()=>rE,fyLabel:()=>bE,fyLabelAnchor:()=>wE,fyLabelOffset:()=>_E,fyLine:()=>xE,fyPadding:()=>aE,fyPaddingInner:()=>cE,fyPaddingOuter:()=>lE,fyRange:()=>eE,fyReverse:()=>AE,fyRound:()=>oE,fyTickFormat:()=>mE,fyTickPadding:()=>pE,fyTickRotate:()=>yE,fyTickSize:()=>hE,fyTickSpacing:()=>dE,fyTicks:()=>fE,geo:()=>VD,geojson:()=>lp,graticule:()=>XD,grid:()=>n4,gridFx:()=>qD,gridFy:()=>jD,gridX:()=>UD,gridY:()=>zD,gt:()=>ip,gte:()=>uS,hconcat:()=>xz,heatmap:()=>wD,height:()=>G6,hexagon:()=>nD,hexbin:()=>SD,hexgrid:()=>ID,highlight:()=>GD,hspace:()=>_z,hull:()=>BD,image:()=>pD,inset:()=>e4,intervalX:()=>eO,intervalXY:()=>rO,intervalY:()=>nO,isBetween:()=>We,isDistinct:()=>fS,isNotBetween:()=>hS,isNotDistinct:()=>Cu,isNotNull:()=>Ss,isNull:()=>Xc,kurtosis:()=>RS,label:()=>r4,lag:()=>SS,last:()=>ZS,last_value:()=>MS,lead:()=>IS,lengthBase:()=>IN,lengthClamp:()=>wN,lengthConstant:()=>MN,lengthDomain:()=>xN,lengthExponent:()=>AN,lengthNice:()=>_N,lengthPercent:()=>vN,lengthRange:()=>bN,lengthScale:()=>gN,lengthZero:()=>SN,line:()=>zN,lineX:()=>qN,lineY:()=>jN,link:()=>CD,literal:()=>Vc,loadCSV:()=>lI,loadExtension:()=>dp,loadJSON:()=>uI,loadObjects:()=>dI,loadParquet:()=>fI,loadSpatial:()=>hI,lt:()=>Is,lte:()=>As,mad:()=>NS,margin:()=>j6,marginBottom:()=>J6,marginLeft:()=>W6,marginRight:()=>H6,marginTop:()=>Z6,margins:()=>q6,max:()=>oi,median:()=>OS,menu:()=>hz,min:()=>si,mode:()=>LS,name:()=>U6,nearest:()=>QD,nearestX:()=>KD,nearestY:()=>tO,neq:()=>Gc,not:()=>cS,nth_value:()=>TS,ntile:()=>vS,opacityBase:()=>tN,opacityClamp:()=>GE,opacityConstant:()=>nN,opacityDomain:()=>YE,opacityExponent:()=>eN,opacityLabel:()=>HE,opacityLegend:()=>hO,opacityNice:()=>WE,opacityPercent:()=>ZE,opacityRange:()=>XE,opacityReverse:()=>JE,opacityScale:()=>VE,opacityTickFormat:()=>KE,opacityZero:()=>QE,or:()=>Yc,padding:()=>i4,pan:()=>iO,panX:()=>oO,panY:()=>sO,panZoom:()=>aO,panZoomX:()=>cO,panZoomY:()=>lO,percent_rank:()=>wS,plot:()=>Az,product:()=>DS,projectionClip:()=>FN,projectionDomain:()=>ON,projectionInset:()=>BN,projectionInsetBottom:()=>RN,projectionInsetLeft:()=>LN,projectionInsetRight:()=>CN,projectionInsetTop:()=>kN,projectionParallels:()=>EN,projectionPrecision:()=>NN,projectionRotate:()=>DN,projectionType:()=>TN,quantile:()=>BS,rBase:()=>pN,rClamp:()=>lN,rConstant:()=>yN,rDomain:()=>aN,rExponent:()=>mN,rLabel:()=>fN,rNice:()=>uN,rPercent:()=>hN,rRange:()=>cN,rScale:()=>sN,rZero:()=>dN,rank:()=>xS,raster:()=>_D,rasterTile:()=>vD,rect:()=>HN,rectX:()=>ZN,rectY:()=>JN,regressionY:()=>AD,row_number:()=>gS,ruleX:()=>sD,ruleY:()=>aD,search:()=>dz,skewness:()=>kS,slider:()=>pz,sphere:()=>YD,spike:()=>dD,sql:()=>j,stddev:()=>ap,stddevPop:()=>PS,stringAgg:()=>JS,style:()=>Y6,sum:()=>Fr,symbolDomain:()=>iN,symbolLegend:()=>dO,symbolRange:()=>oN,symbolScale:()=>rN,table:()=>mz,text:()=>rD,textX:()=>iD,textY:()=>oD,tickX:()=>cD,tickY:()=>lD,toggle:()=>eu,toggleColor:()=>JD,toggleX:()=>WD,toggleY:()=>HD,toggleZ:()=>ZD,varPop:()=>$S,variance:()=>CS,vconcat:()=>gz,vector:()=>uD,vectorX:()=>fD,vectorY:()=>hD,voronoi:()=>ED,voronoiMesh:()=>ND,vspace:()=>wz,width:()=>X6,xAlign:()=>p4,xAriaDescription:()=>L4,xAriaLabel:()=>B4,xAxis:()=>x4,xBase:()=>F4,xClamp:()=>h4,xConstant:()=>P4,xDomain:()=>s4,xExponent:()=>$4,xFontVariant:()=>O4,xGrid:()=>A4,xInset:()=>l4,xInsetLeft:()=>u4,xInsetRight:()=>f4,xLabel:()=>T4,xLabelAnchor:()=>E4,xLabelArrow:()=>N4,xLabelOffset:()=>D4,xLine:()=>M4,xNice:()=>c4,xPadding:()=>m4,xPaddingInner:()=>y4,xPaddingOuter:()=>g4,xPercent:()=>C4,xRange:()=>a4,xReverse:()=>k4,xRound:()=>d4,xScale:()=>o4,xTickFormat:()=>S4,xTickPadding:()=>v4,xTickRotate:()=>I4,xTickSize:()=>w4,xTickSpacing:()=>_4,xTicks:()=>b4,xZero:()=>R4,xyDomain:()=>V6,yAlign:()=>H4,yAriaDescription:()=>p8,yAriaLabel:()=>d8,yAxis:()=>K4,yBase:()=>x8,yClamp:()=>G4,yConstant:()=>w8,yDomain:()=>z4,yExponent:()=>b8,yFontVariant:()=>h8,yGrid:()=>s8,yInset:()=>V4,yInsetBottom:()=>X4,yInsetTop:()=>Y4,yLabel:()=>c8,yLabelAnchor:()=>l8,yLabelArrow:()=>u8,yLabelOffset:()=>f8,yLine:()=>a8,yNice:()=>j4,yPadding:()=>Z4,yPaddingInner:()=>J4,yPaddingOuter:()=>Q4,yPercent:()=>m8,yRange:()=>q4,yReverse:()=>y8,yRound:()=>W4,yScale:()=>U4,yTickFormat:()=>i8,yTickPadding:()=>r8,yTickRotate:()=>o8,yTickSize:()=>e8,yTickSpacing:()=>n8,yTicks:()=>t8,yZero:()=>g8});var vo=Symbol("Fixed"),Mn=Symbol("Transient"),bp=Symbol("Transform");var v6={};Tr(v6,{Area:()=>Yl,Arrow:()=>Dy,BarX:()=>Oy,BarY:()=>By,Cell:()=>Xl,Contour:()=>Vy,Density:()=>Gy,Dot:()=>Gl,Frame:()=>Sy,Geo:()=>Wy,Hexgrid:()=>Hy,Image:()=>Zy,Line:()=>Wl,Link:()=>Ey,Mark:()=>vt,Raster:()=>Uy,Rect:()=>Zl,RuleX:()=>xy,RuleY:()=>by,Text:()=>ql,TickX:()=>Ry,TickY:()=>Fy,Tip:()=>Iy,Vector:()=>Vl,area:()=>Ty,areaX:()=>hc,areaY:()=>ca,arrow:()=>X9,auto:()=>rP,autoSpec:()=>WT,axisFx:()=>x_,axisFy:()=>g_,axisX:()=>_y,axisY:()=>wy,barX:()=>Ko,barY:()=>ts,bin:()=>aa,binX:()=>Jo,binY:()=>Qo,bollinger:()=>yc,bollingerX:()=>lP,bollingerY:()=>uP,boxX:()=>fP,boxY:()=>hP,cell:()=>dc,cellX:()=>W9,cellY:()=>H9,centroid:()=>cU,circle:()=>Q9,cluster:()=>aU,column:()=>xn,contour:()=>_P,crosshair:()=>IP,crosshairX:()=>AP,crosshairY:()=>MP,delaunayLink:()=>NP,delaunayMesh:()=>DP,density:()=>kP,differenceY:()=>$P,dodgeX:()=>vU,dodgeY:()=>SU,dot:()=>_i,dotX:()=>Z9,dotY:()=>J9,filter:()=>i7,find:()=>d7,formatIsoDate:()=>_T,formatMonth:()=>w$,formatNumber:()=>wT,formatWeekday:()=>_$,frame:()=>ih,geo:()=>q_,geoCentroid:()=>lU,graticule:()=>UP,gridFx:()=>v_,gridFy:()=>w_,gridX:()=>__,gridY:()=>b_,group:()=>uy,groupX:()=>ec,groupY:()=>nc,groupZ:()=>ly,hexagon:()=>K9,hexbin:()=>zP,hexgrid:()=>qP,hull:()=>OP,identity:()=>H,image:()=>VP,indexOf:()=>Ne,initializer:()=>Me,interpolateNearest:()=>qy,interpolateNone:()=>z_,interpolatorBarycentric:()=>zy,interpolatorRandomWalk:()=>jy,legend:()=>d9,line:()=>Hl,lineX:()=>pc,lineY:()=>mc,linearRegressionX:()=>GP,linearRegressionY:()=>WP,link:()=>B_,map:()=>Ar,mapX:()=>xh,mapY:()=>bh,marks:()=>nn,normalize:()=>J_,normalizeX:()=>TU,normalizeY:()=>EU,numberInterval:()=>U3,plot:()=>oh,pointer:()=>ac,pointerX:()=>cc,pointerY:()=>oa,raster:()=>gP,rect:()=>Cy,rectX:()=>mh,rectY:()=>yh,reverse:()=>o7,ruleX:()=>Gr,ruleY:()=>Wr,scale:()=>rc,select:()=>DU,selectFirst:()=>tg,selectLast:()=>eg,selectMaxX:()=>ev,selectMaxY:()=>nv,selectMinX:()=>K_,selectMinY:()=>tv,shiftX:()=>NU,shuffle:()=>s7,sort:()=>Rw,sphere:()=>PP,spike:()=>G$,stackX:()=>YT,stackX1:()=>F9,stackX2:()=>$9,stackY:()=>XT,stackY1:()=>P9,stackY2:()=>U9,text:()=>Zo,textX:()=>u_,textY:()=>f_,tickX:()=>$_,tickY:()=>P_,timeInterval:()=>iy,tip:()=>A_,transform:()=>bn,tree:()=>p6,treeLink:()=>G_,treeNode:()=>Jy,utcInterval:()=>Ol,valueof:()=>wt,vector:()=>CT,vectorX:()=>p_,vectorY:()=>m_,voronoi:()=>BP,voronoiMesh:()=>LP,window:()=>wh,windowX:()=>iP,windowY:()=>oP});function Ot(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Jn(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Pi(e){let t,n,r;e.length!==2?(t=Ot,n=(a,c)=>Ot(e(a),c),r=(a,c)=>e(a)-c):(t=e===Ot||e===Jn?e:fX,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 fX(){return 0}function wp(e){return e===null?NaN:+e}function*JB(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 QB=Pi(Ot),KB=QB.right,hX=QB.left,dX=Pi(wp).center,Ts=KB;var _p=tL(eL),MI=tL(pX);function tL(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?(Pu(a,l,i,o,s),Pu(a,i,l,o,s),Pu(a,l,i,o,s),Uu(c,i,l,o,s),Uu(c,l,i,o,s),Uu(c,i,l,o,s)):a?(Pu(a,i,l,o,s),Pu(a,l,i,o,s),Pu(a,i,l,o,s)):c&&(Uu(c,i,l,o,s),Uu(c,l,i,o,s),Uu(c,i,l,o,s)),t}}function Pu(e,t,n,r,i){for(let o=0,s=r*i;o<s;)e(t,n,o,o+=r,1)}function Uu(e,t,n,r,i){for(let o=0,s=r*i;o<r;++o)e(t,n,o,o+s,r)}function pX(e){let t=eL(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 eL(e){let t=Math.floor(e);if(t===e)return mX(e);let n=e-t,r=2*e+1;return(i,o,s,a,c)=>{if(!((a-=c)>=s))return;let l=t*o[s],u=c*t,f=u+c;for(let h=s,d=s+u;h<d;h+=c)l+=o[Math.min(a,h)];for(let h=s,d=a;h<=d;h+=c)l+=o[Math.min(a,h+u)],i[h]=(l+n*(o[Math.max(s,h-f)]+o[Math.min(a,h+f)]))/r,l-=o[Math.max(s,h-u)]}}function mX(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 So(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 yX(e){return e.length|0}function gX(e){return!(e>0)}function xX(e){return typeof e!="object"||"length"in e?e:Array.from(e)}function bX(e){return t=>e(...t)}function yx(...e){let t=typeof e[e.length-1]=="function"&&bX(e.pop());e=e.map(xX);let n=e.map(yX),r=e.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(gX))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 gx(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 Na(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 ci(e,t){let n=Na(e,t);return n&&Math.sqrt(n)}function fe(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 Tn=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){let n=this._partials,r=0;for(let i=0;i<this._n&&i<32;i++){let o=n[i],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(n[r++]=a),t=s}return n[r]=t,this._n=r+1,this}valueOf(){let t=this._partials,n=this._n,r,i,o,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}};var Qn=class extends Map{constructor(t,n=iL){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(TI(this,t))}has(t){return super.has(TI(this,t))}set(t,n){return super.set(nL(this,t),n)}delete(t){return super.delete(rL(this,t))}},Kn=class extends Set{constructor(t,n=iL){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(TI(this,t))}add(t){return super.add(nL(this,t))}delete(t){return super.delete(rL(this,t))}};function TI({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function nL({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function rL({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function iL(e){return e!==null&&typeof e=="object"?e.valueOf():e}function vp(e){return e}function fn(e,...t){return NI(e,vp,vp,t)}function Ui(e,t,...n){return NI(e,vp,t,n)}function EI(e,t,...n){return NI(e,Array.from,t,n)}function NI(e,t,n,r){return function i(o,s){if(s>=r.length)return n(o);let a=new Qn,c=r[s++],l=-1;for(let u of o){let f=c(u,++l,o),h=a.get(f);h?h.push(u):a.set(f,[u])}for(let[u,f]of a)a.set(u,i(f,s));return t(a)}(e,0)}function DI(e,t){return Array.from(t,n=>e[n])}function Es(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=tl(s[i],s[o]);if(a)return a}})):(n=e.map(n),r.sort((i,o)=>tl(n[i],n[o]))),DI(e,r)}return e.sort(Sp(n))}function Sp(e=Ot){if(e===Ot)return tl;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 tl(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function zu(e,t,n){return(t.length!==2?Es(Ui(e,t,n),([r,i],[o,s])=>Ot(i,s)||Ot(r,o)):Es(fn(e,n),([r,i],[o,s])=>t(i,s)||Ot(r,o))).map(([r])=>r)}var wX=Math.sqrt(50),_X=Math.sqrt(10),vX=Math.sqrt(2);function xx(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>=wX?10:o>=_X?5:o>=vX?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?xx(e,t,n*2):[a,c,l]}function En(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?xx(t,e,n):xx(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 Ns(e,t,n){return t=+t,e=+e,n=+n,xx(e,t,n)[2]}function qu(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?Ns(t,e,n):Ns(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ju(e,t,n){let r;for(;;){let i=Ns(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 Da(e){return Math.max(1,Math.ceil(Math.log(So(e))/Math.LN2)+1)}function Jt(e,t){let n;if(t===void 0)for(let r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function bx(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 he(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 wx(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 _x(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?tl:Sp(i);r>n;){if(r-n>600){let c=r-n+1,l=t-n+1,u=Math.log(c),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(c-f)/c)*(l-c/2<0?-1:1),d=Math.max(n,Math.floor(t-l*f/c+h)),p=Math.min(r,Math.floor(t+(c-l)*f/c+h));_x(e,t,d,p,i)}let o=e[t],s=n,a=r;for(Ip(e,n,t),i(e[r],o)>0&&Ip(e,n,r);s<a;){for(Ip(e,s,a),++s,--a;i(e[s],o)<0;)++s;for(;i(e[a],o)>0;)--a}i(e[n],o)===0?Ip(e,n,a):(++a,Ip(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function Ip(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function el(e,t=Ot){let n,r=!1;if(t.length===1){let i;for(let o of e){let s=t(o);(r?Ot(s,i)>0:Ot(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 tr(e,t,n){if(e=Float64Array.from(JB(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return he(e);if(t>=1)return Jt(e);var r,i=(r-1)*t,o=Math.floor(i),s=Jt(_x(e,o).subarray(0,o+1)),a=he(e.subarray(o+1));return s+(a-s)*(i-o)}}function OI(e,t,n=wp){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 vx(e,t,n){let r=So(e),i=tr(e,.75)-tr(e,.25);return r&&i?Math.ceil((n-t)/(2*i*Math.pow(r,-1/3))):1}function Ap(e,t,n){let r=So(e),i=ci(e);return r&&i?Math.ceil((n-t)*Math.cbrt(r)/(3.49*i)):1}function Ds(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 zi(e,t){return tr(e,.5,t)}function*IX(e){for(let t of e)yield*t}function Vu(e){return Array.from(IX(e))}function Yu(e,t){let n=new Qn;if(t===void 0)for(let o of e)o!=null&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let s of e)(s=t(s,++o,e))!=null&&s>=s&&n.set(s,(n.get(s)||0)+1)}let r,i=0;for(let[o,s]of n)s>i&&(i=s,r=o);return r}function Sx(e,t=AX){let n=[],r,i=!1;for(let o of e)i&&n.push(t(r,o)),r=o,i=!0;return n}function AX(e,t){return[e,t]}function Ue(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 Mp(e,t=Ot){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=Ot);let i=(a,c)=>t(n[a],n[c]),o,s;return e=Uint32Array.from(n,(a,c)=>c),e.sort(t===Ot?(a,c)=>tl(n[a],n[c]):Sp(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 Ix(e,t=Ot){let n,r=!1;if(t.length===1){let i;for(let o of e){let s=t(o);(r?Ot(s,i)<0:Ot(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 Nn(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 Oa(e){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(e).reverse()}function oL(e){return e}var BI=1,LI=2,CI=3,Ax=4,sL=1e-6;function MX(e){return"translate("+e+",0)"}function TX(e){return"translate(0,"+e+")"}function EX(e){return t=>+e(t)}function NX(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function DX(){return!this.__axis}function OX(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===BI||e===Ax?-1:1,u=e===Ax||e===LI?"x":"y",f=e===BI||e===CI?MX:TX;function h(d){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):oL),y=Math.max(o,0)+a,g=t.range(),x=+g[0]+c,b=+g[g.length-1]+c,w=(t.bandwidth?NX:EX)(t.copy(),c),v=d.selection?d.selection():d,_=v.selectAll(".domain").data([null]),A=v.selectAll(".tick").data(p,t).order(),E=A.exit(),T=A.enter().append("g").attr("class","tick"),D=A.select("line"),I=A.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(T),D=D.merge(T.append("line").attr("stroke","currentColor").attr(u+"2",l*o)),I=I.merge(T.append("text").attr("fill","currentColor").attr(u,l*y).attr("dy",e===BI?"0em":e===CI?"0.71em":"0.32em")),d!==v&&(_=_.transition(d),A=A.transition(d),D=D.transition(d),I=I.transition(d),E=E.transition(d).attr("opacity",sL).attr("transform",function(O){return isFinite(O=w(O))?f(O+c):this.getAttribute("transform")}),T.attr("opacity",sL).attr("transform",function(O){var L=this.parentNode.__axis;return f((L&&isFinite(L=L(O))?L:w(O))+c)})),E.remove(),_.attr("d",e===Ax||e===LI?s?"M"+l*s+","+x+"H"+c+"V"+b+"H"+l*s:"M"+c+","+x+"V"+b:s?"M"+x+","+l*s+"V"+c+"H"+b+"V"+l*s:"M"+x+","+c+"H"+b),A.attr("opacity",1).attr("transform",function(O){return f(w(O)+c)}),D.attr(u+"2",l*o),I.attr(u,l*y).text(m),v.filter(DX).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===LI?"start":e===Ax?"end":"middle"),v.each(function(){this.__axis=w})}return h.scale=function(d){return arguments.length?(t=d,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),h):n.slice()},h.tickValues=function(d){return arguments.length?(r=d==null?null:Array.from(d),h):r&&r.slice()},h.tickFormat=function(d){return arguments.length?(i=d,h):i},h.tickSize=function(d){return arguments.length?(o=s=+d,h):o},h.tickSizeInner=function(d){return arguments.length?(o=+d,h):o},h.tickSizeOuter=function(d){return arguments.length?(s=+d,h):s},h.tickPadding=function(d){return arguments.length?(a=+d,h):a},h.offset=function(d){return arguments.length?(c=+d,h):c},h}function kI(e){return OX(CI,e)}var BX={value:()=>{}};function cL(){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 Mx(n)}function Mx(e){this._=e}function LX(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}})}Mx.prototype=cL.prototype={constructor:Mx,on:function(e,t){var n=this._,r=LX(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=CX(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]=aL(n[i],e.name,t);else if(t==null)for(i in n)n[i]=aL(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 Mx(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 CX(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function aL(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=BX,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var nl=cL;var Tx="http://www.w3.org/1999/xhtml",li={svg:"http://www.w3.org/2000/svg",xhtml:Tx,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Os(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),li.hasOwnProperty(t)?{space:li[t],local:e}:e}function kX(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Tx&&t.documentElement.namespaceURI===Tx?t.createElement(e):t.createElementNS(n,e)}}function RX(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Bs(e){var t=Os(e);return(t.local?RX:kX)(t)}function FX(){}function rl(e){return e==null?FX:function(){return this.querySelector(e)}}function lL(e){typeof e!="function"&&(e=rl(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 Re(r,this._parents)}function RI(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function $X(){return[]}function Tp(e){return e==null?$X:function(){return this.querySelectorAll(e)}}function PX(e){return function(){return RI(e.apply(this,arguments))}}function uL(e){typeof e=="function"?e=PX(e):e=Tp(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 Re(r,i)}function Ep(e){return function(){return this.matches(e)}}function Ex(e){return function(t){return t.matches(e)}}var UX=Array.prototype.find;function zX(e){return function(){return UX.call(this.children,e)}}function qX(){return this.firstElementChild}function fL(e){return this.select(e==null?qX:zX(typeof e=="function"?e:Ex(e)))}var jX=Array.prototype.filter;function VX(){return Array.from(this.children)}function YX(e){return function(){return jX.call(this.children,e)}}function hL(e){return this.selectAll(e==null?VX:YX(typeof e=="function"?e:Ex(e)))}function dL(e){typeof e!="function"&&(e=Ep(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 Re(r,this._parents)}function Nx(e){return new Array(e.length)}function pL(){return new Re(this._enter||this._groups.map(Nx),this._parents)}function Np(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Np.prototype={constructor:Np,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 mL(e){return function(){return e}}function XX(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 Np(e,o[s]);for(;s<c;++s)(a=t[s])&&(i[s]=a)}function GX(e,t,n,r,i,o,s){var a,c,l=new Map,u=t.length,f=o.length,h=new Array(u),d;for(a=0;a<u;++a)(c=t[a])&&(h[a]=d=s.call(c,c.__data__,a,t)+"",l.has(d)?i[a]=c:l.set(d,c));for(a=0;a<f;++a)d=s.call(e,o[a],a,o)+"",(c=l.get(d))?(r[a]=c,c.__data__=o[a],l.delete(d)):n[a]=new Np(e,o[a]);for(a=0;a<u;++a)(c=t[a])&&l.get(h[a])===c&&(i[a]=c)}function WX(e){return e.__data__}function yL(e,t){if(!arguments.length)return Array.from(this,WX);var n=t?GX:XX,r=this._parents,i=this._groups;typeof e!="function"&&(e=mL(e));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],f=i[l],h=f.length,d=HX(e.call(u,u&&u.__data__,l,r)),p=d.length,m=a[l]=new Array(p),y=s[l]=new Array(p),g=c[l]=new Array(h);n(u,f,m,y,g,d,t);for(var x=0,b=0,w,v;x<p;++x)if(w=m[x]){for(x>=b&&(b=x+1);!(v=y[b])&&++b<p;);w._next=v||null}}return s=new Re(s,r),s._enter=a,s._exit=c,s}function HX(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gL(){return new Re(this._exit||this._groups.map(Nx),this._parents)}function xL(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 bL(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var l=n[c],u=r[c],f=l.length,h=a[c]=new Array(f),d,p=0;p<f;++p)(d=l[p]||u[p])&&(h[p]=d);for(;c<i;++c)a[c]=n[c];return new Re(a,this._parents)}function wL(){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 _L(e){e||(e=ZX);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,c=i[o]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(t)}return new Re(i,this._parents).order()}function ZX(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function vL(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function SL(){return Array.from(this)}function IL(){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 AL(){let e=0;for(let t of this)++e;return e}function ML(){return!this.node()}function TL(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 JX(e){return function(){this.removeAttribute(e)}}function QX(e){return function(){this.removeAttributeNS(e.space,e.local)}}function KX(e,t){return function(){this.setAttribute(e,t)}}function tG(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function eG(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function nG(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 EL(e,t){var n=Os(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?QX:JX:typeof t=="function"?n.local?nG:eG:n.local?tG:KX)(n,t))}function Dx(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function rG(e){return function(){this.style.removeProperty(e)}}function iG(e,t,n){return function(){this.style.setProperty(e,t,n)}}function oG(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function NL(e,t,n){return arguments.length>1?this.each((t==null?rG:typeof t=="function"?oG:iG)(e,t,n??"")):Ba(this.node(),e)}function Ba(e,t){return e.style.getPropertyValue(t)||Dx(e).getComputedStyle(e,null).getPropertyValue(t)}function sG(e){return function(){delete this[e]}}function aG(e,t){return function(){this[e]=t}}function cG(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function DL(e,t){return arguments.length>1?this.each((t==null?sG:typeof t=="function"?cG:aG)(e,t)):this.node()[e]}function OL(e){return e.trim().split(/^|\s+/)}function FI(e){return e.classList||new BL(e)}function BL(e){this._node=e,this._names=OL(e.getAttribute("class")||"")}BL.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 LL(e,t){for(var n=FI(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function CL(e,t){for(var n=FI(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function lG(e){return function(){LL(this,e)}}function uG(e){return function(){CL(this,e)}}function fG(e,t){return function(){(t.apply(this,arguments)?LL:CL)(this,e)}}function kL(e,t){var n=OL(e+"");if(arguments.length<2){for(var r=FI(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?fG:t?lG:uG)(n,t))}function hG(){this.textContent=""}function dG(e){return function(){this.textContent=e}}function pG(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function RL(e){return arguments.length?this.each(e==null?hG:(typeof e=="function"?pG:dG)(e)):this.node().textContent}function mG(){this.innerHTML=""}function yG(e){return function(){this.innerHTML=e}}function gG(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function FL(e){return arguments.length?this.each(e==null?mG:(typeof e=="function"?gG:yG)(e)):this.node().innerHTML}function xG(){this.nextSibling&&this.parentNode.appendChild(this)}function $L(){return this.each(xG)}function bG(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function PL(){return this.each(bG)}function UL(e){var t=typeof e=="function"?e:Bs(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function wG(){return null}function zL(e,t){var n=typeof e=="function"?e:Bs(e),r=t==null?wG:typeof t=="function"?t:rl(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function _G(){var e=this.parentNode;e&&e.removeChild(this)}function qL(){return this.each(_G)}function vG(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function SG(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function jL(e){return this.select(e?SG:vG)}function VL(e){return arguments.length?this.property("__data__",e):this.node().__data__}function IG(e){return function(t){e.call(this,t,this.__data__)}}function AG(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 MG(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 TG(e,t,n){return function(){var r=this.__on,i,o=IG(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 YL(e,t,n){var r=AG(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?TG:MG,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function XL(e,t,n){var r=Dx(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 EG(e,t){return function(){return XL(this,e,t)}}function NG(e,t){return function(){return XL(this,e,t.apply(this,arguments))}}function GL(e,t){return this.each((typeof t=="function"?NG:EG)(e,t))}function*WL(){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 $I=[null];function Re(e,t){this._groups=e,this._parents=t}function HL(){return new Re([[document.documentElement]],$I)}function DG(){return this}Re.prototype=HL.prototype={constructor:Re,select:lL,selectAll:uL,selectChild:fL,selectChildren:hL,filter:dL,data:yL,enter:pL,exit:gL,join:xL,merge:bL,selection:DG,order:wL,sort:_L,call:vL,nodes:SL,node:IL,size:AL,empty:ML,each:TL,attr:EL,style:NL,property:DL,classed:kL,text:RL,html:FL,raise:$L,lower:PL,append:UL,insert:zL,remove:qL,clone:jL,datum:VL,on:YL,dispatch:GL,[Symbol.iterator]:WL};var Ls=HL;function Yt(e){return typeof e=="string"?new Re([[document.querySelector(e)]],[document.documentElement]):new Re([[e]],$I)}function ZL(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Fn(e,t){if(e=ZL(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 Ox={capture:!0,passive:!1};function Bx(e){e.preventDefault(),e.stopImmediatePropagation()}function Dp(e){var t=e.document.documentElement,n=Yt(e).on("dragstart.drag",Bx,Ox);"onselectstart"in t?n.on("selectstart.drag",Bx,Ox):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Op(e,t){var n=e.document.documentElement,r=Yt(e).on("dragstart.drag",null);t&&(r.on("click.drag",Bx,Ox),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 Cs(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function La(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ao(){}var Ca=.7,sl=1/Ca,Xu="\\s*([+-]?\\d+)\\s*",Bp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Io="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",OG=/^#([0-9a-f]{3,8})$/,BG=new RegExp(`^rgb\\(${Xu},${Xu},${Xu}\\)$`),LG=new RegExp(`^rgb\\(${Io},${Io},${Io}\\)$`),CG=new RegExp(`^rgba\\(${Xu},${Xu},${Xu},${Bp}\\)$`),kG=new RegExp(`^rgba\\(${Io},${Io},${Io},${Bp}\\)$`),RG=new RegExp(`^hsl\\(${Bp},${Io},${Io}\\)$`),FG=new RegExp(`^hsla\\(${Bp},${Io},${Io},${Bp}\\)$`),JL={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};Cs(Ao,Pr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:QL,formatHex:QL,formatHex8:$G,formatHsl:PG,formatRgb:KL,toString:KL});function QL(){return this.rgb().formatHex()}function $G(){return this.rgb().formatHex8()}function PG(){return oC(this).formatHsl()}function KL(){return this.rgb().formatRgb()}function Pr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=OG.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?tC(t):n===3?new He(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Lx(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Lx(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=BG.exec(e))?new He(t[1],t[2],t[3],1):(t=LG.exec(e))?new He(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=CG.exec(e))?Lx(t[1],t[2],t[3],t[4]):(t=kG.exec(e))?Lx(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=RG.exec(e))?rC(t[1],t[2]/100,t[3]/100,1):(t=FG.exec(e))?rC(t[1],t[2]/100,t[3]/100,t[4]):JL.hasOwnProperty(e)?tC(JL[e]):e==="transparent"?new He(NaN,NaN,NaN,0):null}function tC(e){return new He(e>>16&255,e>>8&255,e&255,1)}function Lx(e,t,n,r){return r<=0&&(e=t=n=NaN),new He(e,t,n,r)}function Lp(e){return e instanceof Ao||(e=Pr(e)),e?(e=e.rgb(),new He(e.r,e.g,e.b,e.opacity)):new He}function sn(e,t,n,r){return arguments.length===1?Lp(e):new He(e,t,n,r??1)}function He(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Cs(He,sn,La(Ao,{brighter(e){return e=e==null?sl:Math.pow(sl,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ca:Math.pow(Ca,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new He(ol(this.r),ol(this.g),ol(this.b),kx(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:eC,formatHex:eC,formatHex8:UG,formatRgb:nC,toString:nC}));function eC(){return`#${il(this.r)}${il(this.g)}${il(this.b)}`}function UG(){return`#${il(this.r)}${il(this.g)}${il(this.b)}${il((isNaN(this.opacity)?1:this.opacity)*255)}`}function nC(){let e=kx(this.opacity);return`${e===1?"rgb(":"rgba("}${ol(this.r)}, ${ol(this.g)}, ${ol(this.b)}${e===1?")":`, ${e})`}`}function kx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ol(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function il(e){return e=ol(e),(e<16?"0":"")+e.toString(16)}function rC(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new qi(e,t,n,r)}function oC(e){if(e instanceof qi)return new qi(e.h,e.s,e.l,e.opacity);if(e instanceof Ao||(e=Pr(e)),!e)return new qi;if(e instanceof qi)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 qi(s,a,c,e.opacity)}function Cp(e,t,n,r){return arguments.length===1?oC(e):new qi(e,t,n,r??1)}function qi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Cs(qi,Cp,La(Ao,{brighter(e){return e=e==null?sl:Math.pow(sl,e),new qi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ca:Math.pow(Ca,e),new qi(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 He(PI(e>=240?e-240:e+120,i,r),PI(e,i,r),PI(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new qi(iC(this.h),Cx(this.s),Cx(this.l),kx(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=kx(this.opacity);return`${e===1?"hsl(":"hsla("}${iC(this.h)}, ${Cx(this.s)*100}%, ${Cx(this.l)*100}%${e===1?")":`, ${e})`}`}}));function iC(e){return e=(e||0)%360,e<0?e+360:e}function Cx(e){return Math.max(0,Math.min(1,e||0))}function PI(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 Rx=Math.PI/180,Fx=180/Math.PI;var $x=18,sC=.96422,aC=1,cC=.82521,lC=4/29,Gu=6/29,uC=3*Gu*Gu,zG=Gu*Gu*Gu;function fC(e){if(e instanceof Mo)return new Mo(e.l,e.a,e.b,e.opacity);if(e instanceof ks)return hC(e);e instanceof He||(e=Lp(e));var t=jI(e.r),n=jI(e.g),r=jI(e.b),i=UI((.2225045*t+.7168786*n+.0606169*r)/aC),o,s;return t===n&&n===r?o=s=i:(o=UI((.4360747*t+.3850649*n+.1430804*r)/sC),s=UI((.0139322*t+.0971045*n+.7141733*r)/cC)),new Mo(116*i-16,500*(o-i),200*(i-s),e.opacity)}function Wu(e,t,n,r){return arguments.length===1?fC(e):new Mo(e,t,n,r??1)}function Mo(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Cs(Mo,Wu,La(Ao,{brighter(e){return new Mo(this.l+$x*(e??1),this.a,this.b,this.opacity)},darker(e){return new Mo(this.l-$x*(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=sC*zI(t),e=aC*zI(e),n=cC*zI(n),new He(qI(3.1338561*t-1.6168667*e-.4906146*n),qI(-.9787684*t+1.9161415*e+.033454*n),qI(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function UI(e){return e>zG?Math.pow(e,1/3):e/uC+lC}function zI(e){return e>Gu?e*e*e:uC*(e-lC)}function qI(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function jI(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function qG(e){if(e instanceof ks)return new ks(e.h,e.c,e.l,e.opacity);if(e instanceof Mo||(e=fC(e)),e.a===0&&e.b===0)return new ks(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Fx;return new ks(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function kp(e,t,n,r){return arguments.length===1?qG(e):new ks(e,t,n,r??1)}function ks(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function hC(e){if(isNaN(e.h))return new Mo(e.l,0,0,e.opacity);var t=e.h*Rx;return new Mo(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Cs(ks,kp,La(Ao,{brighter(e){return new ks(this.h,this.c,this.l+$x*(e??1),this.opacity)},darker(e){return new ks(this.h,this.c,this.l-$x*(e??1),this.opacity)},rgb(){return hC(this).rgb()}}));var yC=-.14861,VI=1.78277,YI=-.29227,Px=-.90649,Rp=1.97294,dC=Rp*Px,pC=Rp*VI,mC=VI*YI-Px*yC;function jG(e){if(e instanceof al)return new al(e.h,e.s,e.l,e.opacity);e instanceof He||(e=Lp(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(mC*r+dC*t-pC*n)/(mC+dC-pC),o=r-i,s=(Rp*(n-i)-YI*o)/Px,a=Math.sqrt(s*s+o*o)/(Rp*i*(1-i)),c=a?Math.atan2(s,o)*Fx-120:NaN;return new al(c<0?c+360:c,a,i,e.opacity)}function er(e,t,n,r){return arguments.length===1?jG(e):new al(e,t,n,r??1)}function al(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Cs(al,er,La(Ao,{brighter(e){return e=e==null?sl:Math.pow(sl,e),new al(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ca:Math.pow(Ca,e),new al(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Rx,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new He(255*(t+n*(yC*r+VI*i)),255*(t+n*(YI*r+Px*i)),255*(t+n*(Rp*r)),this.opacity)}}));function XI(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 gC(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 XI((n-r/t)*t,s,i,o,a)}}function xC(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 XI((n-r/t)*t,i,o,s,a)}}var Hu=e=>()=>e;function bC(e,t){return function(n){return e+n*t}}function VG(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 Zu(e,t){var n=t-e;return n?bC(e,n>180||n<-180?n-360*Math.round(n/360):n):Hu(isNaN(e)?t:e)}function wC(e){return(e=+e)==1?Ee:function(t,n){return n-t?VG(t,n,e):Hu(isNaN(t)?n:t)}}function Ee(e,t){var n=t-e;return n?bC(e,n):Hu(isNaN(e)?t:e)}var ui=function e(t){var n=wC(t);function r(i,o){var s=n((i=sn(i)).r,(o=sn(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 _C(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=sn(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 GI=_C(gC),YG=_C(xC);function vC(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 SC(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function IC(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]=Ur(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 AC(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ie(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function MC(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]=Ur(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var HI=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,WI=new RegExp(HI.source,"g");function XG(e){return function(){return e}}function GG(e){return function(t){return e(t)+""}}function Fp(e,t){var n=HI.lastIndex=WI.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(e=e+"",t=t+"";(r=HI.exec(e))&&(i=WI.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:Ie(r,i)})),n=WI.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?GG(c[0].x):XG(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 Ur(e,t){var n=typeof t,r;return t==null||n==="boolean"?Hu(t):(n==="number"?Ie:n==="string"?(r=Pr(t))?(t=r,ui):Fp:t instanceof Pr?ui:t instanceof Date?AC:SC(t)?vC:Array.isArray(t)?IC:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?MC:Ie)(e,t)}function cl(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var TC=180/Math.PI,Ux={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ZI(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)*TC,skewX:Math.atan(c)*TC,scaleX:s,scaleY:a}}var zx;function EC(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ux:ZI(t.a,t.b,t.c,t.d,t.e,t.f)}function NC(e){return e==null?Ux:(zx||(zx=document.createElementNS("http://www.w3.org/2000/svg","g")),zx.setAttribute("transform",e),(e=zx.transform.baseVal.consolidate())?(e=e.matrix,ZI(e.a,e.b,e.c,e.d,e.e,e.f)):Ux)}function DC(e,t,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,f,h,d,p){if(l!==f||u!==h){var m=d.push("translate(",null,t,null,n);p.push({i:m-4,x:Ie(l,f)},{i:m-2,x:Ie(u,h)})}else(f||h)&&d.push("translate("+f+t+h+n)}function s(l,u,f,h){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Ie(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(l,u,f,h){l!==u?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Ie(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(l,u,f,h,d,p){if(l!==f||u!==h){var m=d.push(i(d)+"scale(",null,",",null,")");p.push({i:m-4,x:Ie(l,f)},{i:m-2,x:Ie(u,h)})}else(f!==1||h!==1)&&d.push(i(d)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=e(l),u=e(u),o(l.translateX,l.translateY,u.translateX,u.translateY,f,h),s(l.rotate,u.rotate,f,h),a(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(d){for(var p=-1,m=h.length,y;++p<m;)f[(y=h[p]).i]=y.x(d);return f.join("")}}}var JI=DC(EC,"px, ","px)","deg)"),QI=DC(NC,", ",")",")");var WG=1e-12;function OC(e){return((e=Math.exp(e))+1/e)/2}function HG(e){return((e=Math.exp(e))-1/e)/2}function ZG(e){return((e=Math.exp(2*e))-1)/(e+1)}var KI=function e(t,n,r){function i(o,s){var a=o[0],c=o[1],l=o[2],u=s[0],f=s[1],h=s[2],d=u-a,p=f-c,m=d*d+p*p,y,g;if(m<WG)g=Math.log(h/l)/t,y=function(A){return[a+A*d,c+A*p,l*Math.exp(t*A*g)]};else{var x=Math.sqrt(m),b=(h*h-l*l+r*m)/(2*l*n*x),w=(h*h-l*l-r*m)/(2*h*n*x),v=Math.log(Math.sqrt(b*b+1)-b),_=Math.log(Math.sqrt(w*w+1)-w);g=(_-v)/t,y=function(A){var E=A*g,T=OC(v),D=l/(n*x)*(T*ZG(t*E+v)-HG(v));return[a+D*d,c+D*p,l*T/OC(t*E+v)]}}return y.duration=g*1e3*t/Math.SQRT2,y}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 BC(e){return function(t,n){var r=e((t=Cp(t)).h,(n=Cp(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 tA=BC(Zu),JG=BC(Ee);function qx(e,t){var n=Ee((e=Wu(e)).l,(t=Wu(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 LC(e){return function(t,n){var r=e((t=kp(t)).h,(n=kp(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 eA=LC(Zu),QG=LC(Ee);function CC(e){return function t(n){n=+n;function r(i,o){var s=e((i=er(i)).h,(o=er(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 KG=CC(Zu),Ju=CC(Ee);function To(e,t){t===void 0&&(t=e,e=Ur);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 $n(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var Qu=0,Pp=0,$p=0,RC=1e3,jx,Up,Vx=0,ll=0,Yx=0,zp=typeof performance=="object"&&performance.now?performance:Date,FC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function jp(){return ll||(FC(tW),ll=zp.now()+Yx)}function tW(){ll=0}function qp(){this._call=this._time=this._next=null}qp.prototype=Xx.prototype={constructor:qp,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?jp():+n)+(t==null?0:+t),!this._next&&Up!==this&&(Up?Up._next=this:jx=this,Up=this),this._call=e,this._time=n,nA()},stop:function(){this._call&&(this._call=null,this._time=1/0,nA())}};function Xx(e,t,n){var r=new qp;return r.restart(e,t,n),r}function $C(){jp(),++Qu;for(var e=jx,t;e;)(t=ll-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qu}function kC(){ll=(Vx=zp.now())+Yx,Qu=Pp=0;try{$C()}finally{Qu=0,nW(),ll=0}}function eW(){var e=zp.now(),t=e-Vx;t>RC&&(Yx-=t,Vx=e)}function nW(){for(var e,t=jx,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:jx=n);Up=e,nA(r)}function nA(e){if(!Qu){Pp&&(Pp=clearTimeout(Pp));var t=e-ll;t>24?(e<1/0&&(Pp=setTimeout(kC,e-zp.now()-Yx)),$p&&($p=clearInterval($p))):($p||(Vx=zp.now(),$p=setInterval(eW,RC)),Qu=1,FC(kC))}}function Gx(e,t,n){var r=new qp;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var rW=nl("start","end","cancel","interrupt"),iW=[],zC=0,PC=1,Hx=2,Wx=3,UC=4,Zx=5,Vp=6;function ka(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;oW(e,n,{name:t,index:r,group:i,on:rW,tween:iW,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:zC})}function Yp(e,t){var n=an(e,t);if(n.state>zC)throw new Error("too late; already scheduled");return n}function Dn(e,t){var n=an(e,t);if(n.state>Wx)throw new Error("too late; already running");return n}function an(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function oW(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Xx(o,0,n.time);function o(l){n.state=PC,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,f,h,d;if(n.state!==PC)return c();for(u in r)if(d=r[u],d.name===n.name){if(d.state===Wx)return Gx(s);d.state===UC?(d.state=Vp,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete r[u]):+u<t&&(d.state=Vp,d.timer.stop(),d.on.call("cancel",e,e.__data__,d.index,d.group),delete r[u])}if(Gx(function(){n.state===Wx&&(n.state=UC,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Hx,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Hx){for(n.state=Wx,i=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(d=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=d);i.length=f+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Zx,1),f=-1,h=i.length;++f<h;)i[f].call(e,u);n.state===Zx&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Vp,n.timer.stop(),delete r[t];for(var l in r)return;delete e.__transition}}function Eo(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>Hx&&r.state<Zx,r.state=Vp,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function qC(e){return this.each(function(){Eo(this,e)})}function sW(e,t){var n,r;return function(){var i=Dn(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 aW(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Dn(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 jC(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=an(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?sW:aW)(n,e,t))}function Ku(e,t,n){var r=e._id;return e.each(function(){var i=Dn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return an(i,r).value[t]}}function Jx(e,t){var n;return(typeof t=="number"?Ie:t instanceof Pr?ui:(n=Pr(t))?(t=n,ui):Fp)(e,t)}function cW(e){return function(){this.removeAttribute(e)}}function lW(e){return function(){this.removeAttributeNS(e.space,e.local)}}function uW(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 fW(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 hW(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 dW(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 VC(e,t){var n=Os(e),r=n==="transform"?QI:Jx;return this.attrTween(e,typeof t=="function"?(n.local?dW:hW)(n,r,Ku(this,"attr."+e,t)):t==null?(n.local?lW:cW)(n):(n.local?fW:uW)(n,r,t))}function pW(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function mW(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yW(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&mW(e,o)),n}return i._value=t,i}function gW(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&pW(e,o)),n}return i._value=t,i}function YC(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=Os(e);return this.tween(n,(r.local?yW:gW)(r,t))}function xW(e,t){return function(){Yp(this,e).delay=+t.apply(this,arguments)}}function bW(e,t){return t=+t,function(){Yp(this,e).delay=t}}function XC(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?xW:bW)(t,e)):an(this.node(),t).delay}function wW(e,t){return function(){Dn(this,e).duration=+t.apply(this,arguments)}}function _W(e,t){return t=+t,function(){Dn(this,e).duration=t}}function GC(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?wW:_W)(t,e)):an(this.node(),t).duration}function vW(e,t){if(typeof t!="function")throw new Error;return function(){Dn(this,e).ease=t}}function WC(e){var t=this._id;return arguments.length?this.each(vW(t,e)):an(this.node(),t).ease}function SW(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Dn(this,e).ease=n}}function HC(e){if(typeof e!="function")throw new Error;return this.each(SW(this._id,e))}function ZC(e){typeof e!="function"&&(e=Ep(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 nr(r,this._parents,this._name,this._id)}function JC(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=t[a],l=n[a],u=c.length,f=s[a]=new Array(u),h,d=0;d<u;++d)(h=c[d]||l[d])&&(f[d]=h);for(;a<r;++a)s[a]=t[a];return new nr(s,this._parents,this._name,this._id)}function IW(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 AW(e,t,n){var r,i,o=IW(t)?Yp:Dn;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function QC(e,t){var n=this._id;return arguments.length<2?an(this.node(),n).on.on(e):this.each(AW(n,e,t))}function MW(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function KC(){return this.on("end.remove",MW(this._id))}function tk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=rl(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],c=a.length,l=o[s]=new Array(c),u,f,h=0;h<c;++h)(u=a[h])&&(f=e.call(u,u.__data__,h,a))&&("__data__"in u&&(f.__data__=u.__data__),l[h]=f,ka(l[h],t,n,h,l,an(u,n)));return new nr(o,this._parents,t,n)}function ek(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Tp(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],l=c.length,u,f=0;f<l;++f)if(u=c[f]){for(var h=e.call(u,u.__data__,f,c),d,p=an(u,n),m=0,y=h.length;m<y;++m)(d=h[m])&&ka(d,t,n,m,h,p);o.push(h),s.push(u)}return new nr(o,s,t,n)}var TW=Ls.prototype.constructor;function nk(){return new TW(this._groups,this._parents)}function EW(e,t){var n,r,i;return function(){var o=Ba(this,e),s=(this.style.removeProperty(e),Ba(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function rk(e){return function(){this.style.removeProperty(e)}}function NW(e,t,n){var r,i=n+"",o;return function(){var s=Ba(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function DW(e,t,n){var r,i,o;return function(){var s=Ba(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),Ba(this,e))),s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a))}}function OW(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var c=Dn(this,e),l=c.on,u=c.value[o]==null?a||(a=rk(t)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function ik(e,t,n){var r=(e+="")=="transform"?JI:Jx;return t==null?this.styleTween(e,EW(e,r)).on("end.style."+e,rk(e)):typeof t=="function"?this.styleTween(e,DW(e,r,Ku(this,"style."+e,t))).each(OW(this._id,e)):this.styleTween(e,NW(e,r,t),n).on("end.style."+e,null)}function BW(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function LW(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&BW(e,s,n)),r}return o._value=t,o}function ok(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,LW(e,t,n??""))}function CW(e){return function(){this.textContent=e}}function kW(e){return function(){var t=e(this);this.textContent=t??""}}function sk(e){return this.tween("text",typeof e=="function"?kW(Ku(this,"text",e)):CW(e==null?"":e+""))}function RW(e){return function(t){this.textContent=e.call(this,t)}}function FW(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&RW(i)),t}return r._value=e,r}function ak(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,FW(e))}function ck(){for(var e=this._name,t=this._id,n=Qx(),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=an(c,t);ka(c,e,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new nr(r,this._parents,e,n)}function lk(){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=Dn(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 $W=0;function nr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function uk(e){return Ls().transition(e)}function Qx(){return++$W}var Rs=Ls.prototype;nr.prototype=uk.prototype={constructor:nr,select:tk,selectAll:ek,selectChild:Rs.selectChild,selectChildren:Rs.selectChildren,filter:ZC,merge:JC,selection:nk,transition:ck,call:Rs.call,nodes:Rs.nodes,node:Rs.node,size:Rs.size,empty:Rs.empty,each:Rs.each,on:QC,attr:VC,attrTween:YC,style:ik,styleTween:ok,text:sk,textTween:ak,remove:KC,tween:jC,delay:XC,duration:GC,ease:WC,easeVarying:HC,end:lk,[Symbol.iterator]:Rs[Symbol.iterator]};function Kx(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var PW={time:null,delay:0,duration:250,ease:Kx};function UW(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 fk(e){var t,n;e instanceof nr?(t=e._id,e=e._name):(t=Qx(),(n=PW).time=jp(),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])&&ka(c,e,t,l,s,n||UW(c,t));return new nr(r,this._parents,e,t)}Ls.prototype.interrupt=qC;Ls.prototype.transition=fk;var tb=e=>()=>e;function rA(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 hk(e){e.stopImmediatePropagation()}function eb(e){e.preventDefault(),e.stopImmediatePropagation()}var dk={name:"drag"},iA={name:"space"},tf={name:"handle"},ef={name:"center"},{abs:pk,max:Pn,min:Un}=Math;function mk(e){return[+e[0],+e[1]]}function sA(e){return[mk(e[0]),mk(e[1])]}var nb={name:"x",handles:["w","e"].map(Xp),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]]}},rb={name:"y",handles:["n","s"].map(Xp),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]]}},zW={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Xp),input:function(e){return e==null?null:sA(e)},output:function(e){return e}},Fs={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"},yk={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},gk={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},qW={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},jW={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Xp(e){return{type:e}}function VW(e){return!e.ctrlKey&&!e.button}function YW(){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 XW(){return navigator.maxTouchPoints||"ontouchstart"in this}function oA(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function GW(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function aA(){return uA(nb)}function cA(){return uA(rb)}function lA(){return uA(zW)}function uA(e){var t=YW,n=VW,r=XW,i=!0,o=nl("start","brush","end"),s=6,a;function c(y){var g=y.property("__brush",m).selectAll(".overlay").data([Xp("overlay")]);g.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Fs.overlay).merge(g).each(function(){var b=oA(this).extent;Yt(this).attr("x",b[0][0]).attr("y",b[0][1]).attr("width",b[1][0]-b[0][0]).attr("height",b[1][1]-b[0][1])}),y.selectAll(".selection").data([Xp("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Fs.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var x=y.selectAll(".handle").data(e.handles,function(b){return b.type});x.exit().remove(),x.enter().append("rect").attr("class",function(b){return"handle handle--"+b.type}).attr("cursor",function(b){return Fs[b.type]}),y.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(y,g,x){y.tween?y.on("start.brush",function(b){u(this,arguments).beforestart().start(b)}).on("interrupt.brush end.brush",function(b){u(this,arguments).end(b)}).tween("brush",function(){var b=this,w=b.__brush,v=u(b,arguments),_=w.selection,A=e.input(typeof g=="function"?g.apply(this,arguments):g,w.extent),E=Ur(_,A);function T(D){w.selection=D===1&&A===null?null:E(D),l.call(b),v.brush()}return _!==null&&A!==null?T:T(1)}):y.each(function(){var b=this,w=arguments,v=b.__brush,_=e.input(typeof g=="function"?g.apply(b,w):g,v.extent),A=u(b,w).beforestart();Eo(b),v.selection=_===null?null:_,l.call(b),A.start(x).brush(x).end(x)})},c.clear=function(y,g){c.move(y,null,g)};function l(){var y=Yt(this),g=oA(this).selection;g?(y.selectAll(".selection").style("display",null).attr("x",g[0][0]).attr("y",g[0][1]).attr("width",g[1][0]-g[0][0]).attr("height",g[1][1]-g[0][1]),y.selectAll(".handle").style("display",null).attr("x",function(x){return x.type[x.type.length-1]==="e"?g[1][0]-s/2:g[0][0]-s/2}).attr("y",function(x){return x.type[0]==="s"?g[1][1]-s/2:g[0][1]-s/2}).attr("width",function(x){return x.type==="n"||x.type==="s"?g[1][0]-g[0][0]+s:s}).attr("height",function(x){return x.type==="e"||x.type==="w"?g[1][1]-g[0][1]+s:s})):y.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(y,g,x){var b=y.__brush.emitter;return b&&(!x||!b.clean)?b:new f(y,g,x)}function f(y,g,x){this.that=y,this.args=g,this.state=y.__brush,this.active=0,this.clean=x}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(y,g){return this.starting?(this.starting=!1,this.emit("start",y,g)):this.emit("brush",y),this},brush:function(y,g){return this.emit("brush",y,g),this},end:function(y,g){return--this.active===0&&(delete this.state.emitter,this.emit("end",y,g)),this},emit:function(y,g,x){var b=Yt(this.that).datum();o.call(y,this.that,new rA(y,{sourceEvent:g,target:c,selection:e.output(this.state.selection),mode:x,dispatch:o}),b)}};function h(y){if(a&&!y.touches||!n.apply(this,arguments))return;var g=this,x=y.target.__data__.type,b=(i&&y.metaKey?x="overlay":x)==="selection"?dk:i&&y.altKey?ef:tf,w=e===rb?null:qW[x],v=e===nb?null:jW[x],_=oA(g),A=_.extent,E=_.selection,T=A[0][0],D,I,O=A[0][1],L,S,M=A[1][0],N,R,F=A[1][1],k,$,P=0,U=0,G,nt=w&&v&&i&&y.shiftKey,ot,at,Y=Array.from(y.touches||[y],tt=>{let le=tt.identifier;return tt=Fn(tt,g),tt.point0=tt.slice(),tt.identifier=le,tt});Eo(g);var st=u(g,arguments,!0).beforestart();if(x==="overlay"){E&&(G=!0);let tt=[Y[0],Y[1]||Y[0]];_.selection=E=[[D=e===rb?T:Un(tt[0][0],tt[1][0]),L=e===nb?O:Un(tt[0][1],tt[1][1])],[N=e===rb?M:Pn(tt[0][0],tt[1][0]),k=e===nb?F:Pn(tt[0][1],tt[1][1])]],Y.length>1&&Ft(y)}else D=E[0][0],L=E[0][1],N=E[1][0],k=E[1][1];I=D,S=L,R=N,$=k;var q=Yt(g).attr("pointer-events","none"),Z=q.selectAll(".overlay").attr("cursor",Fs[x]);if(y.touches)st.moved=z,st.ended=ht;else{var rt=Yt(y.view).on("mousemove.brush",z,!0).on("mouseup.brush",ht,!0);i&&rt.on("keydown.brush",Ht,!0).on("keyup.brush",Qt,!0),Dp(y.view)}l.call(g),st.start(y,b.name);function z(tt){for(let le of tt.changedTouches||[tt])for(let Mr of Y)Mr.identifier===le.identifier&&(Mr.cur=Fn(le,g));if(nt&&!ot&&!at&&Y.length===1){let le=Y[0];pk(le.cur[0]-le[0])>pk(le.cur[1]-le[1])?at=!0:ot=!0}for(let le of Y)le.cur&&(le[0]=le.cur[0],le[1]=le.cur[1]);G=!0,eb(tt),Ft(tt)}function Ft(tt){let le=Y[0],Mr=le.point0;var Hi;switch(P=le[0]-Mr[0],U=le[1]-Mr[1],b){case iA:case dk:{w&&(P=Pn(T-D,Un(M-N,P)),I=D+P,R=N+P),v&&(U=Pn(O-L,Un(F-k,U)),S=L+U,$=k+U);break}case tf:{Y[1]?(w&&(I=Pn(T,Un(M,Y[0][0])),R=Pn(T,Un(M,Y[1][0])),w=1),v&&(S=Pn(O,Un(F,Y[0][1])),$=Pn(O,Un(F,Y[1][1])),v=1)):(w<0?(P=Pn(T-D,Un(M-D,P)),I=D+P,R=N):w>0&&(P=Pn(T-N,Un(M-N,P)),I=D,R=N+P),v<0?(U=Pn(O-L,Un(F-L,U)),S=L+U,$=k):v>0&&(U=Pn(O-k,Un(F-k,U)),S=L,$=k+U));break}case ef:{w&&(I=Pn(T,Un(M,D-P*w)),R=Pn(T,Un(M,N+P*w))),v&&(S=Pn(O,Un(F,L-U*v)),$=Pn(O,Un(F,k+U*v)));break}}R<I&&(w*=-1,Hi=D,D=N,N=Hi,Hi=I,I=R,R=Hi,x in yk&&Z.attr("cursor",Fs[x=yk[x]])),$<S&&(v*=-1,Hi=L,L=k,k=Hi,Hi=S,S=$,$=Hi,x in gk&&Z.attr("cursor",Fs[x=gk[x]])),_.selection&&(E=_.selection),ot&&(I=E[0][0],R=E[1][0]),at&&(S=E[0][1],$=E[1][1]),(E[0][0]!==I||E[0][1]!==S||E[1][0]!==R||E[1][1]!==$)&&(_.selection=[[I,S],[R,$]],l.call(g),st.brush(tt,b.name))}function ht(tt){if(hk(tt),tt.touches){if(tt.touches.length)return;a&&clearTimeout(a),a=setTimeout(function(){a=null},500)}else Op(tt.view,G),rt.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),Z.attr("cursor",Fs.overlay),_.selection&&(E=_.selection),GW(E)&&(_.selection=null,l.call(g)),st.end(tt,b.name)}function Ht(tt){switch(tt.keyCode){case 16:{nt=w&&v;break}case 18:{b===tf&&(w&&(N=R-P*w,D=I+P*w),v&&(k=$-U*v,L=S+U*v),b=ef,Ft(tt));break}case 32:{(b===tf||b===ef)&&(w<0?N=R-P:w>0&&(D=I-P),v<0?k=$-U:v>0&&(L=S-U),b=iA,Z.attr("cursor",Fs.selection),Ft(tt));break}default:return}eb(tt)}function Qt(tt){switch(tt.keyCode){case 16:{nt&&(ot=at=nt=!1,Ft(tt));break}case 18:{b===ef&&(w<0?N=R:w>0&&(D=I),v<0?k=$:v>0&&(L=S),b=tf,Ft(tt));break}case 32:{b===iA&&(tt.altKey?(w&&(N=R-P*w,D=I+P*w),v&&(k=$-U*v,L=S+U*v),b=ef):(w<0?N=R:w>0&&(D=I),v<0?k=$:v>0&&(L=S),b=tf),Z.attr("cursor",Fs[x]),Ft(tt));break}default:return}eb(tt)}}function d(y){u(this,arguments).moved(y)}function p(y){u(this,arguments).ended(y)}function m(){var y=this.__brush||{selection:null};return y.extent=sA(t.apply(this,arguments)),y.dim=e,y}return c.extent=function(y){return arguments.length?(t=typeof y=="function"?y:tb(sA(y)),c):t},c.filter=function(y){return arguments.length?(n=typeof y=="function"?y:tb(!!y),c):n},c.touchable=function(y){return arguments.length?(r=typeof y=="function"?y:tb(!!y),c):r},c.handleSize=function(y){return arguments.length?(s=+y,c):s},c.keyModifiers=function(y){return arguments.length?(i=!!y,c):i},c.on=function(){var y=o.on.apply(o,arguments);return y===o?c:y},c}var fA=Math.PI,hA=2*fA,ul=1e-6,WW=hA-ul;function xk(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function HW(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return xk;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 Ra=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?xk:HW(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,c=r-t,l=i-n,u=s-t,f=a-n,h=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>ul)if(!(Math.abs(f*c-l*u)>ul)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let d=r-s,p=i-a,m=c*c+l*l,y=d*d+p*p,g=Math.sqrt(m),x=Math.sqrt(h),b=o*Math.tan((fA-Math.acos((m+h-y)/(2*g*x)))/2),w=b/x,v=b/g;Math.abs(w-1)>ul&&this._append`L${t+w*u},${n+w*f}`,this._append`A${o},${o},0,0,${+(f*d>u*p)},${this._x1=t+v*c},${this._y1=n+v*l}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),c=r*Math.sin(i),l=t+a,u=n+c,f=1^s,h=s?i-o:o-i;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>ul||Math.abs(this._y1-u)>ul)&&this._append`L${l},${u}`,r&&(h<0&&(h=h%hA+hA),h>WW?this._append`A${r},${r},0,1,${f},${t-a},${n-c}A${r},${r},0,1,${f},${this._x1=l},${this._y1=u}`:h>ul&&this._append`A${r},${r},0,${+(h>=fA)},${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 bk(){return new Ra}bk.prototype=Ra.prototype;function rr(e=3){return new Ra(+e)}var ZW=Array.prototype,ib=ZW.slice;function wk(e,t){return e-t}function _k(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r}var No=e=>()=>e;function vk(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=JW(e,t[n]))return i;return 0}function JW(e,t){for(var n=t[0],r=t[1],i=-1,o=0,s=e.length,a=s-1;o<s;a=o++){var c=e[o],l=c[0],u=c[1],f=e[a],h=f[0],d=f[1];if(QW(c,f,t))return 0;u>r!=d>r&&n<(h-l)*(r-u)/(d-u)+l&&(i=-i)}return i}function QW(e,t,n){var r;return KW(e,t,n)&&tH(e[r=+(e[0]===t[0])],n[r],t[r])}function KW(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function tH(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function Sk(){}var $s=[[],[[[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 Fa(){var e=1,t=1,n=Da,r=c;function i(l){var u=n(l);if(Array.isArray(u))u=u.slice().sort(wk);else{let f=fe(l,eH);for(u=En(...ju(f[0],f[1],u),u);u[u.length-1]>=f[1];)u.pop();for(;u[1]<f[0];)u.shift()}return u.map(f=>o(l,f))}function o(l,u){let f=u==null?NaN:+u;if(isNaN(f))throw new Error(`invalid value: ${u}`);var h=[],d=[];return s(l,f,function(p){r(p,l,f),_k(p)>0?h.push([p]):d.push(p)}),d.forEach(function(p){for(var m=0,y=h.length,g;m<y;++m)if(vk((g=h[m])[0],p)!==-1){g.push(p);return}}),{type:"MultiPolygon",value:u,coordinates:h}}function s(l,u,f){var h=new Array,d=new Array,p,m,y,g,x,b;for(p=m=-1,g=fl(l[0],u),$s[g<<1].forEach(w);++p<e-1;)y=g,g=fl(l[p+1],u),$s[y|g<<1].forEach(w);for($s[g<<0].forEach(w);++m<t-1;){for(p=-1,g=fl(l[m*e+e],u),x=fl(l[m*e],u),$s[g<<1|x<<2].forEach(w);++p<e-1;)y=g,g=fl(l[m*e+e+p+1],u),b=x,x=fl(l[m*e+p+1],u),$s[y|g<<1|x<<2|b<<3].forEach(w);$s[g|x<<3].forEach(w)}for(p=-1,x=l[m*e]>=u,$s[x<<2].forEach(w);++p<e-1;)b=x,x=fl(l[m*e+p+1],u),$s[x<<2|b<<3].forEach(w);$s[x<<3].forEach(w);function w(v){var _=[v[0][0]+p,v[0][1]+m],A=[v[1][0]+p,v[1][1]+m],E=a(_),T=a(A),D,I;(D=d[E])?(I=h[T])?(delete d[D.end],delete h[I.start],D===I?(D.ring.push(A),f(D.ring)):h[D.start]=d[I.end]={start:D.start,end:I.end,ring:D.ring.concat(I.ring)}):(delete d[D.end],D.ring.push(A),d[D.end=T]=D):(D=h[T])?(I=d[E])?(delete h[D.start],delete d[I.end],D===I?(D.ring.push(A),f(D.ring)):h[I.start]=d[D.end]={start:I.start,end:D.end,ring:I.ring.concat(D.ring)}):(delete h[D.start],D.ring.unshift(_),h[D.start=E]=D):h[E]=d[T]={start:E,end:T,ring:[_,A]}}}function a(l){return l[0]*2+l[1]*(e+1)*4}function c(l,u,f){l.forEach(function(h){var d=h[0],p=h[1],m=d|0,y=p|0,g=dA(u[y*e+m]);d>0&&d<e&&m===d&&(h[0]=Ik(d,dA(u[y*e+m-1]),g,f)),p>0&&p<t&&y===p&&(h[1]=Ik(p,dA(u[(y-1)*e+m]),g,f))})}return i.contour=o,i.size=function(l){if(!arguments.length)return[e,t];var u=Math.floor(l[0]),f=Math.floor(l[1]);if(!(u>=0&&f>=0))throw new Error("invalid size");return e=u,t=f,i},i.thresholds=function(l){return arguments.length?(n=typeof l=="function"?l:Array.isArray(l)?No(ib.call(l)):No(l),i):n},i.smooth=function(l){return arguments.length?(r=l?c:Sk,i):r===c},i}function eH(e){return isFinite(e)?e:NaN}function fl(e,t){return e==null?!1:+e>=t}function dA(e){return e==null||isNaN(e=+e)?-1/0:e}function Ik(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 nH(e){return e[0]}function rH(e){return e[1]}function iH(){return 1}function pA(){var e=nH,t=rH,n=iH,r=960,i=500,o=20,s=2,a=o*3,c=r+a*2>>s,l=i+a*2>>s,u=No(20);function f(x){var b=new Float32Array(c*l),w=Math.pow(2,-s),v=-1;for(let L of x){var _=(e(L,++v,x)+a)*w,A=(t(L,v,x)+a)*w,E=+n(L,v,x);if(E&&_>=0&&_<c&&A>=0&&A<l){var T=Math.floor(_),D=Math.floor(A),I=_-T-.5,O=A-D-.5;b[T+D*c]+=(1-I)*(1-O)*E,b[T+1+D*c]+=I*(1-O)*E,b[T+1+(D+1)*c]+=I*O*E,b[T+(D+1)*c]+=(1-I)*O*E}}return _p({data:b,width:c,height:l},o*w),b}function h(x){var b=f(x),w=u(b),v=Math.pow(2,2*s);return Array.isArray(w)||(w=En(Number.MIN_VALUE,Jt(b)/v,w)),Fa().size([c,l]).thresholds(w.map(_=>_*v))(b).map((_,A)=>(_.value=+w[A],d(_)))}h.contours=function(x){var b=f(x),w=Fa().size([c,l]),v=Math.pow(2,2*s),_=A=>{A=+A;var E=d(w.contour(b,A*v));return E.value=A,E};return Object.defineProperty(_,"max",{get:()=>Jt(b)/v}),_};function d(x){return x.coordinates.forEach(p),x}function p(x){x.forEach(m)}function m(x){x.forEach(y)}function y(x){x[0]=x[0]*Math.pow(2,s)-a,x[1]=x[1]*Math.pow(2,s)-a}function g(){return a=o*3,c=r+a*2>>s,l=i+a*2>>s,h}return h.x=function(x){return arguments.length?(e=typeof x=="function"?x:No(+x),h):e},h.y=function(x){return arguments.length?(t=typeof x=="function"?x:No(+x),h):t},h.weight=function(x){return arguments.length?(n=typeof x=="function"?x:No(+x),h):n},h.size=function(x){if(!arguments.length)return[r,i];var b=+x[0],w=+x[1];if(!(b>=0&&w>=0))throw new Error("invalid size");return r=b,i=w,g()},h.cellSize=function(x){if(!arguments.length)return 1<<s;if(!((x=+x)>=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(x)/Math.LN2),g()},h.thresholds=function(x){return arguments.length?(u=typeof x=="function"?x:Array.isArray(x)?No(ib.call(x)):No(x),h):u},h.bandwidth=function(x){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((x=+x)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*x*x+1)-1)/2,g()},h}var ee=11102230246251565e-32,Ze=134217729,Gp=(3+8*ee)*ee;function hl(e,t,n,r,i){let o,s,a,c,l=t[0],u=r[0],f=0,h=0;u>l==u>-l?(o=l,l=t[++f]):(o=u,u=r[++h]);let d=0;if(f<e&&h<n)for(u>l==u>-l?(s=l+o,a=o-(s-l),l=t[++f]):(s=u+o,a=o-(s-u),u=r[++h]),o=s,a!==0&&(i[d++]=a);f<e&&h<n;)u>l==u>-l?(s=o+l,c=s-o,a=o-(s-c)+(l-c),l=t[++f]):(s=o+u,c=s-o,a=o-(s-c)+(u-c),u=r[++h]),o=s,a!==0&&(i[d++]=a);for(;f<e;)s=o+l,c=s-o,a=o-(s-c)+(l-c),l=t[++f],o=s,a!==0&&(i[d++]=a);for(;h<n;)s=o+u,c=s-o,a=o-(s-c)+(u-c),u=r[++h],o=s,a!==0&&(i[d++]=a);return(o!==0||d===0)&&(i[d++]=o),d}function Wp(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 oH=(3+16*ee)*ee,sH=(2+12*ee)*ee,aH=(9+64*ee)*ee*ee,nf=V(4),Ak=V(8),Mk=V(12),Tk=V(16),ir=V(4);function cH(e,t,n,r,i,o,s){let a,c,l,u,f,h,d,p,m,y,g,x,b,w,v,_,A,E,T=e-i,D=n-i,I=t-o,O=r-o;w=T*O,h=Ze*T,d=h-(h-T),p=T-d,h=Ze*O,m=h-(h-O),y=O-m,v=p*y-(w-d*m-p*m-d*y),_=I*D,h=Ze*I,d=h-(h-I),p=I-d,h=Ze*D,m=h-(h-D),y=D-m,A=p*y-(_-d*m-p*m-d*y),g=v-A,f=v-g,nf[0]=v-(g+f)+(f-A),x=w+g,f=x-w,b=w-(x-f)+(g-f),g=b-_,f=b-g,nf[1]=b-(g+f)+(f-_),E=x+g,f=E-x,nf[2]=x-(E-f)+(g-f),nf[3]=E;let L=Wp(4,nf),S=sH*s;if(L>=S||-L>=S||(f=e-T,a=e-(T+f)+(f-i),f=n-D,l=n-(D+f)+(f-i),f=t-I,c=t-(I+f)+(f-o),f=r-O,u=r-(O+f)+(f-o),a===0&&c===0&&l===0&&u===0)||(S=aH*s+Gp*Math.abs(L),L+=T*u+O*a-(I*l+D*c),L>=S||-L>=S))return L;w=a*O,h=Ze*a,d=h-(h-a),p=a-d,h=Ze*O,m=h-(h-O),y=O-m,v=p*y-(w-d*m-p*m-d*y),_=c*D,h=Ze*c,d=h-(h-c),p=c-d,h=Ze*D,m=h-(h-D),y=D-m,A=p*y-(_-d*m-p*m-d*y),g=v-A,f=v-g,ir[0]=v-(g+f)+(f-A),x=w+g,f=x-w,b=w-(x-f)+(g-f),g=b-_,f=b-g,ir[1]=b-(g+f)+(f-_),E=x+g,f=E-x,ir[2]=x-(E-f)+(g-f),ir[3]=E;let M=hl(4,nf,4,ir,Ak);w=T*u,h=Ze*T,d=h-(h-T),p=T-d,h=Ze*u,m=h-(h-u),y=u-m,v=p*y-(w-d*m-p*m-d*y),_=I*l,h=Ze*I,d=h-(h-I),p=I-d,h=Ze*l,m=h-(h-l),y=l-m,A=p*y-(_-d*m-p*m-d*y),g=v-A,f=v-g,ir[0]=v-(g+f)+(f-A),x=w+g,f=x-w,b=w-(x-f)+(g-f),g=b-_,f=b-g,ir[1]=b-(g+f)+(f-_),E=x+g,f=E-x,ir[2]=x-(E-f)+(g-f),ir[3]=E;let N=hl(M,Ak,4,ir,Mk);w=a*u,h=Ze*a,d=h-(h-a),p=a-d,h=Ze*u,m=h-(h-u),y=u-m,v=p*y-(w-d*m-p*m-d*y),_=c*l,h=Ze*c,d=h-(h-c),p=c-d,h=Ze*l,m=h-(h-l),y=l-m,A=p*y-(_-d*m-p*m-d*y),g=v-A,f=v-g,ir[0]=v-(g+f)+(f-A),x=w+g,f=x-w,b=w-(x-f)+(g-f),g=b-_,f=b-g,ir[1]=b-(g+f)+(f-_),E=x+g,f=E-x,ir[2]=x-(E-f)+(g-f),ir[3]=E;let R=hl(N,Mk,4,ir,Tk);return Tk[R-1]}function rf(e,t,n,r,i,o){let s=(t-o)*(n-i),a=(e-i)*(r-o),c=s-a,l=Math.abs(s+a);return Math.abs(c)>=oH*l?c:-cH(e,t,n,r,i,o,l)}var B2t=(7+56*ee)*ee,L2t=(3+28*ee)*ee,C2t=(26+288*ee)*ee*ee,k2t=V(4),R2t=V(4),F2t=V(4),$2t=V(4),P2t=V(4),U2t=V(4),z2t=V(4),q2t=V(4),j2t=V(4),V2t=V(8),Y2t=V(8),X2t=V(8),G2t=V(4),W2t=V(8),H2t=V(8),Z2t=V(8),J2t=V(12),Q2t=V(192),K2t=V(192);var nSt=(10+96*ee)*ee,rSt=(4+48*ee)*ee,iSt=(44+576*ee)*ee*ee,oSt=V(4),sSt=V(4),aSt=V(4),cSt=V(4),lSt=V(4),uSt=V(4),fSt=V(4),hSt=V(4),dSt=V(8),pSt=V(8),mSt=V(8),ySt=V(8),gSt=V(8),xSt=V(8),bSt=V(8),wSt=V(8),_St=V(8),vSt=V(4),SSt=V(4),ISt=V(4),ASt=V(8),MSt=V(16),TSt=V(16),ESt=V(16),NSt=V(32),DSt=V(32),OSt=V(48),BSt=V(64),LSt=V(1152),CSt=V(1152);var $St=(16+224*ee)*ee,PSt=(5+72*ee)*ee,USt=(71+1408*ee)*ee*ee,zSt=V(4),qSt=V(4),jSt=V(4),VSt=V(4),YSt=V(4),XSt=V(4),GSt=V(4),WSt=V(4),HSt=V(4),ZSt=V(4),JSt=V(24),QSt=V(24),KSt=V(24),tIt=V(24),eIt=V(24),nIt=V(24),rIt=V(24),iIt=V(24),oIt=V(24),sIt=V(24),aIt=V(1152),cIt=V(1152),lIt=V(1152),uIt=V(1152),fIt=V(1152),hIt=V(2304),dIt=V(2304),pIt=V(3456),mIt=V(5760),yIt=V(8),gIt=V(8),xIt=V(8),bIt=V(16),wIt=V(24),_It=V(48),vIt=V(48),SIt=V(96),IIt=V(192),AIt=V(384),MIt=V(384),TIt=V(384),EIt=V(768);var NIt=V(96),DIt=V(96),OIt=V(96),BIt=V(1152);var Nk=Math.pow(2,-52),ob=new Uint32Array(512),sf=class e{static from(t,n=pH,r=mH){let i=t.length,o=new Float64Array(i*2);for(let s=0;s<i;s++){let a=t[s];o[2*s]=n(a),o[2*s+1]=r(a)}return new e(o)}constructor(t){let n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;let r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){let{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=t.length>>1,a=1/0,c=1/0,l=-1/0,u=-1/0;for(let T=0;T<s;T++){let D=t[2*T],I=t[2*T+1];D<a&&(a=D),I<c&&(c=I),D>l&&(l=D),I>u&&(u=I),this._ids[T]=T}let f=(a+l)/2,h=(c+u)/2,d,p,m;for(let T=0,D=1/0;T<s;T++){let I=mA(f,h,t[2*T],t[2*T+1]);I<D&&(d=T,D=I)}let y=t[2*d],g=t[2*d+1];for(let T=0,D=1/0;T<s;T++){if(T===d)continue;let I=mA(y,g,t[2*T],t[2*T+1]);I<D&&I>0&&(p=T,D=I)}let x=t[2*p],b=t[2*p+1],w=1/0;for(let T=0;T<s;T++){if(T===d||T===p)continue;let D=hH(y,g,x,b,t[2*T],t[2*T+1]);D<w&&(m=T,w=D)}let v=t[2*m],_=t[2*m+1];if(w===1/0){for(let I=0;I<s;I++)this._dists[I]=t[2*I]-t[0]||t[2*I+1]-t[1];of(this._ids,this._dists,0,s-1);let T=new Uint32Array(s),D=0;for(let I=0,O=-1/0;I<s;I++){let L=this._ids[I],S=this._dists[L];S>O&&(T[D++]=L,O=S)}this.hull=T.subarray(0,D),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(rf(y,g,x,b,v,_)<0){let T=p,D=x,I=b;p=m,x=v,b=_,m=T,v=D,_=I}let A=dH(y,g,x,b,v,_);this._cx=A.x,this._cy=A.y;for(let T=0;T<s;T++)this._dists[T]=mA(t[2*T],t[2*T+1],A.x,A.y);of(this._ids,this._dists,0,s-1),this._hullStart=d;let E=3;r[d]=n[m]=p,r[p]=n[d]=m,r[m]=n[p]=d,i[d]=0,i[p]=1,i[m]=2,o.fill(-1),o[this._hashKey(y,g)]=d,o[this._hashKey(x,b)]=p,o[this._hashKey(v,_)]=m,this.trianglesLen=0,this._addTriangle(d,p,m,-1,-1,-1);for(let T=0,D,I;T<this._ids.length;T++){let O=this._ids[T],L=t[2*O],S=t[2*O+1];if(T>0&&Math.abs(L-D)<=Nk&&Math.abs(S-I)<=Nk||(D=L,I=S,O===d||O===p||O===m))continue;let M=0;for(let $=0,P=this._hashKey(L,S);$<this._hashSize&&(M=o[(P+$)%this._hashSize],!(M!==-1&&M!==r[M]));$++);M=n[M];let N=M,R;for(;R=r[N],rf(L,S,t[2*N],t[2*N+1],t[2*R],t[2*R+1])>=0;)if(N=R,N===M){N=-1;break}if(N===-1)continue;let F=this._addTriangle(N,O,r[N],-1,-1,i[N]);i[O]=this._legalize(F+2),i[N]=F,E++;let k=r[N];for(;R=r[k],rf(L,S,t[2*k],t[2*k+1],t[2*R],t[2*R+1])<0;)F=this._addTriangle(k,O,R,i[O],-1,i[k]),i[O]=this._legalize(F+2),r[k]=k,E--,k=R;if(N===M)for(;R=n[N],rf(L,S,t[2*R],t[2*R+1],t[2*N],t[2*N+1])<0;)F=this._addTriangle(R,O,N,-1,i[N],i[R]),this._legalize(F+2),i[R]=F,r[N]=N,E--,N=R;this._hullStart=n[O]=N,r[N]=n[k]=O,r[O]=k,o[this._hashKey(L,S)]=O,o[this._hashKey(t[2*N],t[2*N+1])]=N}this.hull=new Uint32Array(E);for(let T=0,D=this._hullStart;T<E;T++)this.hull[T]=D,D=r[D];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(uH(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=ob[--o];continue}let l=a-a%3,u=c+(t+1)%3,f=l+(a+2)%3,h=n[s],d=n[t],p=n[u],m=n[f];if(fH(i[2*h],i[2*h+1],i[2*d],i[2*d+1],i[2*p],i[2*p+1],i[2*m],i[2*m+1])){n[t]=m,n[a]=h;let g=r[f];if(g===-1){let b=this._hullStart;do{if(this._hullTri[b]===f){this._hullTri[b]=t;break}b=this._hullPrev[b]}while(b!==this._hullStart)}this._link(t,g),this._link(a,r[s]),this._link(s,f);let x=l+(a+1)%3;o<ob.length&&(ob[o++]=x)}else{if(o===0)break;t=ob[--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 uH(e,t){let n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function mA(e,t,n,r){let i=e-n,o=t-r;return i*i+o*o}function fH(e,t,n,r,i,o,s,a){let c=e-s,l=t-a,u=n-s,f=r-a,h=i-s,d=o-a,p=c*c+l*l,m=u*u+f*f,y=h*h+d*d;return c*(f*y-m*d)-l*(u*y-m*h)+p*(u*d-f*h)<0}function hH(e,t,n,r,i,o){let s=n-e,a=r-t,c=i-e,l=o-t,u=s*s+a*a,f=c*c+l*l,h=.5/(s*l-a*c),d=(l*u-a*f)*h,p=(s*f-c*u)*h;return d*d+p*p}function dH(e,t,n,r,i,o){let s=n-e,a=r-t,c=i-e,l=o-t,u=s*s+a*a,f=c*c+l*l,h=.5/(s*l-a*c),d=e+(l*u-a*f)*h,p=t+(s*f-c*u)*h;return{x:d,y:p}}function of(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;Hp(e,i,o),t[e[n]]>t[e[r]]&&Hp(e,n,r),t[e[o]]>t[e[r]]&&Hp(e,o,r),t[e[n]]>t[e[o]]&&Hp(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;Hp(e,o,s)}e[n+1]=e[s],e[s]=a,r-o+1>=s-n?(of(e,t,o,r),of(e,t,n,s-1)):(of(e,t,n,s-1),of(e,t,o,r))}}function Hp(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function pH(e){return e[0]}function mH(e){return e[1]}var fi=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 $a=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 Zp=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,y=0,g=r.length,x,b;m<g;m+=3,y+=2){let w=r[m]*2,v=r[m+1]*2,_=r[m+2]*2,A=t[w],E=t[w+1],T=t[v],D=t[v+1],I=t[_],O=t[_+1],L=T-A,S=D-E,M=I-A,N=O-E,R=(L*N-S*M)*2;if(Math.abs(R)<1e-9){if(o===void 0){o=s=0;for(let k of n)o+=t[k*2],s+=t[k*2+1];o/=n.length,s/=n.length}let F=1e9*Math.sign((o-A)*N-(s-E)*M);x=(A+I)/2-F*N,b=(E+O)/2+F*M}else{let F=1/R,k=L*L+S*S,$=M*M+N*N;x=A+(N*k-S*$)*F,b=E+(L*$-M*k)*F}a[y]=x,a[y+1]=b}let c=n[n.length-1],l,u=c*4,f,h=t[2*c],d,p=t[2*c+1];i.fill(0);for(let m=0;m<n.length;++m)c=n[m],l=u,f=h,d=p,u=c*4,h=t[2*c],p=t[2*c+1],i[l+2]=i[u]=d-p,i[l+3]=i[u+1]=h-f}render(t){let n=t==null?t=new fi:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:s,vectors:a}=this;if(o.length<=1)return null;for(let u=0,f=r.length;u<f;++u){let h=r[u];if(h<u)continue;let d=Math.floor(u/3)*2,p=Math.floor(h/3)*2,m=s[d],y=s[d+1],g=s[p],x=s[p+1];this._renderSegment(m,y,g,x,t)}let c,l=o[o.length-1];for(let u=0;u<o.length;++u){c=l,l=o[u];let f=Math.floor(i[l]/3)*2,h=s[f],d=s[f+1],p=c*4,m=this._project(h,d,a[p+2],a[p+3]);m&&this._renderSegment(h,d,m[0],m[1],t)}return n&&n.value()}renderBounds(t){let n=t==null?t=new fi: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 fi: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 $a;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,o){let s,a=this._regioncode(t,n),c=this._regioncode(r,i);a===0&&c===0?(o.moveTo(t,n),o.lineTo(r,i)):(s=this._clipSegment(t,n,r,i,a,c))&&(o.moveTo(s[0],s[1]),o.lineTo(s[2],s[3]))}contains(t,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(t,n,r)===t}*neighbors(t){let n=this._clip(t);if(n)for(let r of this.delaunay.neighbors(t)){let i=this._clip(r);if(i){t:for(let o=0,s=n.length;o<s;o+=2)for(let a=0,c=i.length;a<c;a+=2)if(n[o]===i[a]&&n[o+1]===i[a+1]&&n[(o+2)%s]===i[(a+c-2)%c]&&n[(o+3)%s]===i[(a+c-1)%c]){yield r;break t}}}}_cell(t){let{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,s=r[t];if(s===-1)return null;let a=[],c=s;do{let l=Math.floor(c/3);if(a.push(n[l*2],n[l*2+1]),c=c%3===2?c-2:c+1,o[c]!==t)break;c=i[c]}while(c!==s&&c!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];let n=this._cell(t);if(n===null)return null;let{vectors:r}=this,i=t*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(t,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(t,n))}_clipFinite(t,n){let r=n.length,i=null,o,s,a=n[r-2],c=n[r-1],l,u=this._regioncode(a,c),f,h=0;for(let d=0;d<r;d+=2)if(o=a,s=c,a=n[d],c=n[d+1],l=u,u=this._regioncode(a,c),l===0&&u===0)f=h,h=0,i?i.push(a,c):i=[a,c];else{let p,m,y,g,x;if(l===0){if((p=this._clipSegment(o,s,a,c,l,u))===null)continue;[m,y,g,x]=p}else{if((p=this._clipSegment(a,c,o,s,u,l))===null)continue;[g,x,m,y]=p,f=h,h=this._edgecode(m,y),f&&h&&this._edge(t,f,h,i,i.length),i?i.push(m,y):i=[m,y]}f=h,h=this._edgecode(g,x),f&&h&&this._edge(t,f,h,i,i.length),i?i.push(g,x):i=[g,x]}if(i)f=h,h=this._edgecode(i[0],i[1]),f&&h&&this._edge(t,f,h,i,i.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(t,n,r,i,o,s){let a=o<s;for(a&&([t,n,r,i,o,s]=[r,i,t,n,s,o]);;){if(o===0&&s===0)return a?[r,i,t,n]:[t,n,r,i];if(o&s)return null;let c,l,u=o||s;u&8?(c=t+(r-t)*(this.ymax-n)/(i-n),l=this.ymax):u&4?(c=t+(r-t)*(this.ymin-n)/(i-n),l=this.ymin):u&2?(l=n+(i-n)*(this.xmax-t)/(r-t),c=this.xmax):(l=n+(i-n)*(this.xmin-t)/(r-t),c=this.xmin),o?(t=c,n=l,o=this._regioncode(t,n)):(r=c,i=l,s=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,o,s){let a=Array.from(n),c;if((c=this._project(a[0],a[1],r,i))&&a.unshift(c[0],c[1]),(c=this._project(a[a.length-2],a[a.length-1],o,s))&&a.push(c[0],c[1]),a=this._clipFinite(t,a))for(let l=0,u=a.length,f,h=this._edgecode(a[u-2],a[u-1]);l<u;l+=2)f=h,h=this._edgecode(a[l],a[l+1]),f&&h&&(l=this._edge(t,f,h,a,l),u=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,n,r,i,o){for(;n!==r;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(i[o]!==s||i[o+1]!==a)&&this.contains(t,s,a)&&(i.splice(o,0,s,a),o+=2)}return o}_project(t,n,r,i){let o=1/0,s,a,c;if(i<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/i)<o&&(c=this.ymin,a=t+(o=s)*r)}else if(i>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)<o&&(c=this.ymax,a=t+(o=s)*r)}if(r>0){if(t>=this.xmax)return null;(s=(this.xmax-t)/r)<o&&(a=this.xmax,c=n+(o=s)*i)}else if(r<0){if(t<=this.xmin)return null;(s=(this.xmin-t)/r)<o&&(a=this.xmin,c=n+(o=s)*i)}return[a,c]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){let r=(n+2)%t.length,i=(n+4)%t.length;(t[n]===t[r]&&t[r]===t[i]||t[n+1]===t[r+1]&&t[r+1]===t[i+1])&&(t.splice(r,2),n-=2)}t.length||(t=null)}return t}};var yH=2*Math.PI,af=Math.pow;function gH(e){return e[0]}function xH(e){return e[1]}function bH(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 wH(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}var hi=class e{static from(t,n=gH,r=xH,i){return new e("length"in t?_H(t,n,r,i):Float64Array.from(vH(t,n,r,i)))}constructor(t){this._delaunator=new sf(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&&bH(t)){this.collinear=Int32Array.from({length:n.length/2},(h,d)=>d).sort((h,d)=>n[2*h]-n[2*d]||n[2*h+1]-n[2*d+1]);let c=this.collinear[0],l=this.collinear[this.collinear.length-1],u=[n[2*c],n[2*c+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let h=0,d=n.length/2;h<d;++h){let p=wH(n[2*h],n[2*h+1],f);n[2*h]=p[0],n[2*h+1]=p[1]}this._delaunator=new sf(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 Zp(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=af(n-l[t*2],2)+af(r-l[t*2+1],2),h=i[t],d=h;do{let p=c[d],m=af(n-l[p*2],2)+af(r-l[p*2+1],2);if(m<f&&(f=m,u=p),d=d%3===2?d-2:d+1,c[d]!==t)break;if(d=a[d],d===-1){if(d=o[(s[t]+1)%o.length],d!==p&&af(n-l[d*2],2)+af(r-l[d*2+1],2)<f)return d;break}}while(d!==h);return u}render(t){let n=t==null?t=new fi: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 fi: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,yH)}return r&&r.value()}renderHull(t){let n=t==null?t=new fi: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 $a;return this.renderHull(t),t.value()}renderTriangle(t,n){let r=n==null?n=new fi: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 $a;return this.renderTriangle(t,n),n.value()}};function _H(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*vH(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 Dk(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function dl(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 Do(e){return e=dl(Math.abs(e)),e?e[1]:NaN}function Ok(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 Bk(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var SH=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Oo(e){if(!(t=SH.exec(e)))throw new Error("invalid format: "+e);var t;return new sb({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]})}Oo.prototype=sb.prototype;function sb(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+""}sb.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 Lk(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 yA;function Ck(e,t){var n=dl(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(yA=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")+dl(e,Math.max(0,t+o-1))[0]}function gA(e,t){var n=dl(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 xA={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Dk,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)=>gA(e*100,t),r:gA,s:Ck,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function bA(e){return e}var kk=Array.prototype.map,Rk=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Fk(e){var t=e.grouping===void 0||e.thousands===void 0?bA:Ok(kk.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?bA:Bk(kk.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=Oo(f);var h=f.fill,d=f.align,p=f.sign,m=f.symbol,y=f.zero,g=f.width,x=f.comma,b=f.precision,w=f.trim,v=f.type;v==="n"?(x=!0,v="g"):xA[v]||(b===void 0&&(b=12),w=!0,v="g"),(y||h==="0"&&d==="=")&&(y=!0,h="0",d="=");var _=m==="$"?n:m==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",A=m==="$"?r:/[%p]/.test(v)?s:"",E=xA[v],T=/[defgprs%]/.test(v);b=b===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function D(I){var O=_,L=A,S,M,N;if(v==="c")L=E(I)+L,I="";else{I=+I;var R=I<0||1/I<0;if(I=isNaN(I)?c:E(Math.abs(I),b),w&&(I=Lk(I)),R&&+I==0&&p!=="+"&&(R=!1),O=(R?p==="("?p:a:p==="-"||p==="("?"":p)+O,L=(v==="s"?Rk[8+yA/3]:"")+L+(R&&p==="("?")":""),T){for(S=-1,M=I.length;++S<M;)if(N=I.charCodeAt(S),48>N||N>57){L=(N===46?i+I.slice(S+1):I.slice(S))+L,I=I.slice(0,S);break}}}x&&!y&&(I=t(I,1/0));var F=O.length+I.length+L.length,k=F<g?new Array(g-F+1).join(h):"";switch(x&&y&&(I=t(k+I,k.length?g-L.length:1/0),k=""),d){case"<":I=O+I+L+k;break;case"=":I=O+k+I+L;break;case"^":I=k.slice(0,F=k.length>>1)+O+I+L+k.slice(F);break;default:I=k+O+I+L;break}return o(I)}return D.toString=function(){return f+""},D}function u(f,h){var d=l((f=Oo(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Do(h)/3)))*3,m=Math.pow(10,-p),y=Rk[8+p/3];return function(g){return d(m*g)+y}}return{format:l,formatPrefix:u}}var ab,di,cb;wA({thousands:",",grouping:[3],currency:["$",""]});function wA(e){return ab=Fk(e),di=ab.format,cb=ab.formatPrefix,ab}function _A(e){return Math.max(0,-Do(Math.abs(e)))}function vA(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Do(t)/3)))*3-Do(Math.abs(e)))}function SA(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Do(t)-Do(e))+1}var et=1e-6,pl=1e-12,Bt=Math.PI,ge=Bt/2,IA=Bt/4,hn=Bt*2,Fe=180/Bt,Xt=Bt/180,Pt=Math.abs,pi=Math.atan,Je=Math.atan2,K=Math.cos,Jp=Math.ceil,lb=Math.exp;var ub=Math.hypot,ml=Math.log,fb=Math.pow,Q=Math.sin,zn=Math.sign||function(e){return e>0?1:e<0?-1:0},xe=Math.sqrt,cf=Math.tan;function hb(e){return e>1?0:e<-1?Bt:Math.acos(e)}function Ae(e){return e>1?ge:e<-1?-ge:Math.asin(e)}function Qe(){}function db(e,t){e&&Pk.hasOwnProperty(e.type)&&Pk[e.type](e,t)}var $k={Feature:function(e,t){db(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)db(n[r].geometry,t)}},Pk={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){AA(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)AA(n[r],t,0)},Polygon:function(e,t){Uk(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Uk(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)db(n[r],t)}};function AA(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 Uk(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)AA(e[n],t,1);t.polygonEnd()}function zr(e,t){e&&$k.hasOwnProperty(e.type)?$k[e.type](e,t):db(e,t)}function Qp(e){return[Je(e[1],e[0]),Ae(e[2])]}function Bo(e){var t=e[0],n=e[1],r=K(n);return[r*K(t),r*Q(t),Q(n)]}function Kp(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function lf(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 pb(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function tm(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function em(e){var t=xe(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var nm,mb,yb,gb,xb,bb,wb,_b,MA,TA,EA,jk,Vk,or,sr,ar,ji={sphere:Qe,point:NA,lineStart:zk,lineEnd:qk,polygonStart:function(){ji.lineStart=MH,ji.lineEnd=TH},polygonEnd:function(){ji.lineStart=zk,ji.lineEnd=qk}};function NA(e,t){e*=Xt,t*=Xt;var n=K(t);rm(n*K(e),n*Q(e),Q(t))}function rm(e,t,n){++nm,yb+=(e-yb)/nm,gb+=(t-gb)/nm,xb+=(n-xb)/nm}function zk(){ji.point=IH}function IH(e,t){e*=Xt,t*=Xt;var n=K(t);or=n*K(e),sr=n*Q(e),ar=Q(t),ji.point=AH,rm(or,sr,ar)}function AH(e,t){e*=Xt,t*=Xt;var n=K(t),r=n*K(e),i=n*Q(e),o=Q(t),s=Je(xe((s=sr*o-ar*i)*s+(s=ar*r-or*o)*s+(s=or*i-sr*r)*s),or*r+sr*i+ar*o);mb+=s,bb+=s*(or+(or=r)),wb+=s*(sr+(sr=i)),_b+=s*(ar+(ar=o)),rm(or,sr,ar)}function qk(){ji.point=NA}function MH(){ji.point=EH}function TH(){Yk(jk,Vk),ji.point=NA}function EH(e,t){jk=e,Vk=t,e*=Xt,t*=Xt,ji.point=Yk;var n=K(t);or=n*K(e),sr=n*Q(e),ar=Q(t),rm(or,sr,ar)}function Yk(e,t){e*=Xt,t*=Xt;var n=K(t),r=n*K(e),i=n*Q(e),o=Q(t),s=sr*o-ar*i,a=ar*r-or*o,c=or*i-sr*r,l=ub(s,a,c),u=Ae(l),f=l&&-u/l;MA.add(f*s),TA.add(f*a),EA.add(f*c),mb+=u,bb+=u*(or+(or=r)),wb+=u*(sr+(sr=i)),_b+=u*(ar+(ar=o)),rm(or,sr,ar)}function DA(e){nm=mb=yb=gb=xb=bb=wb=_b=0,MA=new Tn,TA=new Tn,EA=new Tn,zr(e,ji);var t=+MA,n=+TA,r=+EA,i=ub(t,n,r);return i<pl&&(t=bb,n=wb,r=_b,mb<et&&(t=yb,n=gb,r=xb),i=ub(t,n,r),i<pl)?[NaN,NaN]:[Je(n,t)*Fe,Ae(r/i)*Fe]}function im(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 OA(e,t){return Pt(e)>Bt&&(e-=Math.round(e/hn)*hn),[e,t]}OA.invert=OA;function BA(e,t,n){return(e%=hn)?t||n?im(Gk(e),Wk(t,n)):Gk(e):t||n?Wk(t,n):OA}function Xk(e){return function(t,n){return t+=e,Pt(t)>Bt&&(t-=Math.round(t/hn)*hn),[t,n]}}function Gk(e){var t=Xk(e);return t.invert=Xk(-e),t}function Wk(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,h=Q(c),d=h*n+u*r;return[Je(f*i-d*o,u*n-h*r),Ae(d*i+f*o)]}return s.invert=function(a,c){var l=K(c),u=K(a)*l,f=Q(a)*l,h=Q(c),d=h*i-f*o;return[Je(f*i+h*o,u*n+d*r),Ae(d*n-u*r)]},s}function Hk(e){e=BA(e[0]*Xt,e[1]*Xt,e.length>2?e[2]*Xt:0);function t(n){return n=e(n[0]*Xt,n[1]*Xt),n[0]*=Fe,n[1]*=Fe,n}return t.invert=function(n){return n=e.invert(n[0]*Xt,n[1]*Xt),n[0]*=Fe,n[1]*=Fe,n},t}function Jk(e,t,n,r,i,o){if(n){var s=K(t),a=Q(t),c=r*n;i==null?(i=t+r*hn,o=t-c/2):(i=Zk(s,i),o=Zk(s,o),(r>0?i<o:i>o)&&(i+=r*hn));for(var l,u=i;r>0?u>o:u<o;u-=c)l=Qp([s,-a*K(u),-a*Q(u)]),e.point(l[0],l[1])}}function Zk(e,t){t=Bo(t),t[0]-=e,em(t);var n=hb(-t[1]);return((-t[2]<0?-n:n)+hn-et)%hn}function vb(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Qe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function uf(e,t){return Pt(e[0]-t[0])<et&&Pt(e[1]-t[1])<et}function Sb(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 Ib(e,t,n,r,i){var o=[],s=[],a,c;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,y=p[0],g=p[m],x;if(uf(y,g)){if(!y[2]&&!g[2]){for(i.lineStart(),a=0;a<m;++a)i.point((y=p[a])[0],y[1]);i.lineEnd();return}g[0]+=2*et}o.push(x=new Sb(y,p,null,!0)),s.push(x.o=new Sb(y,null,x,!1)),o.push(x=new Sb(g,p,null,!1)),s.push(x.o=new Sb(g,null,x,!0))}}),!!o.length){for(s.sort(t),Qk(o),Qk(s),a=0,c=s.length;a<c;++a)s[a].e=n=!n;for(var l=o[0],u,f;;){for(var h=l,d=!0;h.v;)if((h=h.n)===l)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(a=0,c=u.length;a<c;++a)i.point((f=u[a])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(u=h.p.z,a=u.length-1;a>=0;--a)i.point((f=u[a])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,d=!d}while(!h.v);i.lineEnd()}}}function Qk(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 LA(e){return Pt(e[0])<=Bt?e[0]:zn(e[0])*((Pt(e[0])+Bt)%hn-Bt)}function Kk(e,t){var n=LA(t),r=t[1],i=Q(r),o=[Q(n),-K(n),0],s=0,a=0,c=new Tn;i===1?r=ge+et:i===-1&&(r=-ge-et);for(var l=0,u=e.length;l<u;++l)if(h=(f=e[l]).length)for(var f,h,d=f[h-1],p=LA(d),m=d[1]/2+IA,y=Q(m),g=K(m),x=0;x<h;++x,p=w,y=_,g=A,d=b){var b=f[x],w=LA(b),v=b[1]/2+IA,_=Q(v),A=K(v),E=w-p,T=E>=0?1:-1,D=T*E,I=D>Bt,O=y*_;if(c.add(Je(O*T*Q(D),g*A+O*K(D))),s+=I?E+T*hn:E,I^p>=n^w>=n){var L=lf(Bo(d),Bo(b));em(L);var S=lf(o,L);em(S);var M=(I^E>=0?-1:1)*Ae(S[2]);(r>M||r===M&&(L[0]||L[1]))&&(a+=I^E>=0?1:-1)}}return(s<-et||s<et&&c<-pl)^a&1}function Ab(e,t,n,r){return function(i){var o=t(i),s=vb(),a=t(s),c=!1,l,u,f,h={point:d,lineStart:m,lineEnd:y,polygonStart:function(){h.point=g,h.lineStart=x,h.lineEnd=b,u=[],l=[]},polygonEnd:function(){h.point=d,h.lineStart=m,h.lineEnd=y,u=Vu(u);var w=Kk(l,r);u.length?(c||(i.polygonStart(),c=!0),Ib(u,DH,w,n,i)):w&&(c||(i.polygonStart(),c=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),c&&(i.polygonEnd(),c=!1),u=l=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(w,v){e(w,v)&&i.point(w,v)}function p(w,v){o.point(w,v)}function m(){h.point=p,o.lineStart()}function y(){h.point=d,o.lineEnd()}function g(w,v){f.push([w,v]),a.point(w,v)}function x(){a.lineStart(),f=[]}function b(){g(f[0][0],f[0][1]),a.lineEnd();var w=a.clean(),v=s.result(),_,A=v.length,E,T,D;if(f.pop(),l.push(f),f=null,!!A){if(w&1){if(T=v[0],(E=T.length-1)>0){for(c||(i.polygonStart(),c=!0),i.lineStart(),_=0;_<E;++_)i.point((D=T[_])[0],D[1]);i.lineEnd()}return}A>1&&w&2&&v.push(v.pop().concat(v.shift())),u.push(v.filter(NH))}}return h}}function NH(e){return e.length>1}function DH(e,t){return((e=e.x)[0]<0?e[1]-ge-et:ge-e[1])-((t=t.x)[0]<0?t[1]-ge-et:ge-t[1])}var CA=Ab(function(){return!0},OH,LH,[-Bt,-ge]);function OH(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?Bt:-Bt,c=Pt(o-t);Pt(c-Bt)<et?(e.point(t,n=(n+s)/2>0?ge:-ge),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&c>=Bt&&(Pt(t-r)<et&&(t-=r*et),Pt(o-a)<et&&(o-=a*et),n=BH(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 BH(e,t,n,r){var i,o,s=Q(e-n);return Pt(s)>et?pi((Q(t)*(o=K(r))*Q(n)-Q(r)*(i=K(t))*Q(e))/(i*o*s)):(t+r)/2}function LH(e,t,n,r){var i;if(e==null)i=n*ge,r.point(-Bt,i),r.point(0,i),r.point(Bt,i),r.point(Bt,0),r.point(Bt,-i),r.point(0,-i),r.point(-Bt,-i),r.point(-Bt,0),r.point(-Bt,i);else if(Pt(e[0]-t[0])>et){var o=e[0]<t[0]?Bt:-Bt;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function tR(e){var t=K(e),n=6*Xt,r=t>0,i=Pt(t)>et;function o(u,f,h,d){Jk(d,e,n,h,u,f)}function s(u,f){return K(u)*K(f)>t}function a(u){var f,h,d,p,m;return{lineStart:function(){p=d=!1,m=1},point:function(y,g){var x=[y,g],b,w=s(y,g),v=r?w?0:l(y,g):w?l(y+(y<0?Bt:-Bt),g):0;if(!f&&(p=d=w)&&u.lineStart(),w!==d&&(b=c(f,x),(!b||uf(f,b)||uf(x,b))&&(x[2]=1)),w!==d)m=0,w?(u.lineStart(),b=c(x,f),u.point(b[0],b[1])):(b=c(f,x),u.point(b[0],b[1],2),u.lineEnd()),f=b;else if(i&&f&&r^w){var _;!(v&h)&&(_=c(x,f,!0))&&(m=0,r?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}w&&(!f||!uf(f,x))&&u.point(x[0],x[1]),f=x,d=w,h=v},lineEnd:function(){d&&u.lineEnd(),f=null},clean:function(){return m|(p&&d)<<1}}}function c(u,f,h){var d=Bo(u),p=Bo(f),m=[1,0,0],y=lf(d,p),g=Kp(y,y),x=y[0],b=g-x*x;if(!b)return!h&&u;var w=t*g/b,v=-t*x/b,_=lf(m,y),A=tm(m,w),E=tm(y,v);pb(A,E);var T=_,D=Kp(A,T),I=Kp(T,T),O=D*D-I*(Kp(A,A)-1);if(!(O<0)){var L=xe(O),S=tm(T,(-D-L)/I);if(pb(S,A),S=Qp(S),!h)return S;var M=u[0],N=f[0],R=u[1],F=f[1],k;N<M&&(k=M,M=N,N=k);var $=N-M,P=Pt($-Bt)<et,U=P||$<et;if(!P&&F<R&&(k=R,R=F,F=k),U?P?R+F>0^S[1]<(Pt(S[0]-M)<et?R:F):R<=S[1]&&S[1]<=F:$>Bt^(M<=S[0]&&S[0]<=N)){var G=tm(T,(-D+L)/I);return pb(G,A),[S,Qp(G)]}}}function l(u,f){var h=r?e:Bt-e,d=0;return u<-h?d|=1:u>h&&(d|=2),f<-h?d|=4:f>h&&(d|=8),d}return Ab(s,a,o,r?[0,-e]:[-Bt,e-Bt])}function eR(e,t,n,r,i,o){var s=e[0],a=e[1],c=t[0],l=t[1],u=0,f=1,h=c-s,d=l-a,p;if(p=n-s,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>u&&(u=p)}if(p=i-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<f&&(f=p)}if(p=r-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>u&&(u=p)}if(p=o-a,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<f&&(f=p)}return u>0&&(e[0]=s+u*h,e[1]=a+u*d),f<1&&(t[0]=s+f*h,t[1]=a+f*d),!0}}}}}var om=1e9,Mb=-om;function ff(e,t,n,r){function i(l,u){return e<=l&&l<=n&&t<=u&&u<=r}function o(l,u,f,h){var d=0,p=0;if(l==null||(d=s(l,f))!==(p=s(u,f))||c(l,u)<0^f>0)do h.point(d===0||d===3?e:n,d>1?r:t);while((d=(d+f+4)%4)!==p);else h.point(u[0],u[1])}function s(l,u){return Pt(l[0]-e)<et?u>0?0:3:Pt(l[0]-n)<et?u>0?2:1:Pt(l[1]-t)<et?u>0?1:0:u>0?3:2}function a(l,u){return c(l.x,u.x)}function c(l,u){var f=s(l,1),h=s(u,1);return f!==h?f-h:f===0?u[1]-l[1]:f===1?l[0]-u[0]:f===2?l[1]-u[1]:u[0]-l[0]}return function(l){var u=l,f=vb(),h,d,p,m,y,g,x,b,w,v,_,A={point:E,lineStart:O,lineEnd:L,polygonStart:D,polygonEnd:I};function E(M,N){i(M,N)&&u.point(M,N)}function T(){for(var M=0,N=0,R=d.length;N<R;++N)for(var F=d[N],k=1,$=F.length,P=F[0],U,G,nt=P[0],ot=P[1];k<$;++k)U=nt,G=ot,P=F[k],nt=P[0],ot=P[1],G<=r?ot>r&&(nt-U)*(r-G)>(ot-G)*(e-U)&&++M:ot<=r&&(nt-U)*(r-G)<(ot-G)*(e-U)&&--M;return M}function D(){u=f,h=[],d=[],_=!0}function I(){var M=T(),N=_&&M,R=(h=Vu(h)).length;(N||R)&&(l.polygonStart(),N&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),R&&Ib(h,a,M,o,l),l.polygonEnd()),u=l,h=d=p=null}function O(){A.point=S,d&&d.push(p=[]),v=!0,w=!1,x=b=NaN}function L(){h&&(S(m,y),g&&w&&f.rejoin(),h.push(f.result())),A.point=E,w&&u.lineEnd()}function S(M,N){var R=i(M,N);if(d&&p.push([M,N]),v)m=M,y=N,g=R,v=!1,R&&(u.lineStart(),u.point(M,N));else if(R&&w)u.point(M,N);else{var F=[x=Math.max(Mb,Math.min(om,x)),b=Math.max(Mb,Math.min(om,b))],k=[M=Math.max(Mb,Math.min(om,M)),N=Math.max(Mb,Math.min(om,N))];eR(F,k,e,t,n,r)?(w||(u.lineStart(),u.point(F[0],F[1])),u.point(k[0],k[1]),R||u.lineEnd(),_=!1):R&&(u.lineStart(),u.point(M,N),_=!1)}x=M,b=N,w=R}return A}}function nR(e,t,n){var r=Ue(e,t-et,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function rR(e,t,n){var r=Ue(e,t-et,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function kA(){var e,t,n,r,i,o,s,a,c=10,l=c,u=90,f=360,h,d,p,m,y=2.5;function g(){return{type:"MultiLineString",coordinates:x()}}function x(){return Ue(Jp(r/u)*u,n,u).map(p).concat(Ue(Jp(a/f)*f,s,f).map(m)).concat(Ue(Jp(t/c)*c,e,c).filter(function(b){return Pt(b%u)>et}).map(h)).concat(Ue(Jp(o/l)*l,i,l).filter(function(b){return Pt(b%f)>et}).map(d))}return g.lines=function(){return x().map(function(b){return{type:"LineString",coordinates:b}})},g.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(m(s).slice(1),p(n).reverse().slice(1),m(a).reverse().slice(1))]}},g.extent=function(b){return arguments.length?g.extentMajor(b).extentMinor(b):g.extentMinor()},g.extentMajor=function(b){return arguments.length?(r=+b[0][0],n=+b[1][0],a=+b[0][1],s=+b[1][1],r>n&&(b=r,r=n,n=b),a>s&&(b=a,a=s,s=b),g.precision(y)):[[r,a],[n,s]]},g.extentMinor=function(b){return arguments.length?(t=+b[0][0],e=+b[1][0],o=+b[0][1],i=+b[1][1],t>e&&(b=t,t=e,e=b),o>i&&(b=o,o=i,i=b),g.precision(y)):[[t,o],[e,i]]},g.step=function(b){return arguments.length?g.stepMajor(b).stepMinor(b):g.stepMinor()},g.stepMajor=function(b){return arguments.length?(u=+b[0],f=+b[1],g):[u,f]},g.stepMinor=function(b){return arguments.length?(c=+b[0],l=+b[1],g):[c,l]},g.precision=function(b){return arguments.length?(y=+b,h=nR(o,i,90),d=rR(t,e,y),p=nR(a,s,90),m=rR(r,n,y),g):y},g.extentMajor([[-180,-90+et],[180,90-et]]).extentMinor([[-180,-80-et],[180,80+et]])}function RA(){return kA()()}var sm=e=>e;var FA=new Tn,$A=new Tn,iR,oR,PA,UA,Pa={point:Qe,lineStart:Qe,lineEnd:Qe,polygonStart:function(){Pa.lineStart=CH,Pa.lineEnd=RH},polygonEnd:function(){Pa.lineStart=Pa.lineEnd=Pa.point=Qe,FA.add(Pt($A)),$A=new Tn},result:function(){var e=FA/2;return FA=new Tn,e}};function CH(){Pa.point=kH}function kH(e,t){Pa.point=sR,iR=PA=e,oR=UA=t}function sR(e,t){$A.add(UA*e-PA*t),PA=e,UA=t}function RH(){sR(iR,oR)}var zA=Pa;var hf=1/0,Tb=hf,am=-hf,Eb=am,FH={point:$H,lineStart:Qe,lineEnd:Qe,polygonStart:Qe,polygonEnd:Qe,result:function(){var e=[[hf,Tb],[am,Eb]];return am=Eb=-(Tb=hf=1/0),e}};function $H(e,t){e<hf&&(hf=e),e>am&&(am=e),t<Tb&&(Tb=t),t>Eb&&(Eb=t)}var df=FH;var qA=0,jA=0,cm=0,Nb=0,Db=0,pf=0,VA=0,YA=0,lm=0,lR,uR,Lo,Co,Vi={point:yl,lineStart:aR,lineEnd:cR,polygonStart:function(){Vi.lineStart=zH,Vi.lineEnd=qH},polygonEnd:function(){Vi.point=yl,Vi.lineStart=aR,Vi.lineEnd=cR},result:function(){var e=lm?[VA/lm,YA/lm]:pf?[Nb/pf,Db/pf]:cm?[qA/cm,jA/cm]:[NaN,NaN];return qA=jA=cm=Nb=Db=pf=VA=YA=lm=0,e}};function yl(e,t){qA+=e,jA+=t,++cm}function aR(){Vi.point=PH}function PH(e,t){Vi.point=UH,yl(Lo=e,Co=t)}function UH(e,t){var n=e-Lo,r=t-Co,i=xe(n*n+r*r);Nb+=i*(Lo+e)/2,Db+=i*(Co+t)/2,pf+=i,yl(Lo=e,Co=t)}function cR(){Vi.point=yl}function zH(){Vi.point=jH}function qH(){fR(lR,uR)}function jH(e,t){Vi.point=fR,yl(lR=Lo=e,uR=Co=t)}function fR(e,t){var n=e-Lo,r=t-Co,i=xe(n*n+r*r);Nb+=i*(Lo+e)/2,Db+=i*(Co+t)/2,pf+=i,i=Co*e-Lo*t,VA+=i*(Lo+e),YA+=i*(Co+t),lm+=i*3,yl(Lo=e,Co=t)}var XA=Vi;function Ob(e){this._context=e}Ob.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,hn);break}}},result:Qe};var WA=new Tn,GA,hR,dR,um,fm,Bb={point:Qe,lineStart:function(){Bb.point=VH},lineEnd:function(){GA&&pR(hR,dR),Bb.point=Qe},polygonStart:function(){GA=!0},polygonEnd:function(){GA=null},result:function(){var e=+WA;return WA=new Tn,e}};function VH(e,t){Bb.point=pR,hR=um=e,dR=fm=t}function pR(e,t){um-=e,fm-=t,WA.add(xe(um*um+fm*fm)),um=e,fm=t}var HA=Bb;var mR,Lb,yR,gR,mf=class{constructor(t){this._append=t==null?xR:YH(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!==yR||this._append!==Lb){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`,yR=r,Lb=this._append,gR=this._,this._=i}this._+=gR;break}}}result(){let t=this._;return this._="",t.length?t:null}};function xR(e){let t=1;this._+=e[0];for(let n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function YH(e){let t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return xR;if(t!==mR){let n=10**t;mR=t,Lb=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 Lb}function On(e,t){let n=3,r=4.5,i,o;function s(a){return a&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),zr(a,i(o))),o.result()}return s.area=function(a){return zr(a,i(zA)),zA.result()},s.measure=function(a){return zr(a,i(HA)),HA.result()},s.bounds=function(a){return zr(a,i(df)),df.result()},s.centroid=function(a){return zr(a,i(XA)),XA.result()},s.projection=function(a){return arguments.length?(i=a==null?(e=null,sm):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new mf(n)):new Ob(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 mf(n)),s},s.projection(e).digits(n).context(t)}function gl(e){return{stream:yf(e)}}function yf(e){return function(t){var n=new ZA;for(var r in e)n[r]=e[r];return n.stream=t,n}}function ZA(){}ZA.prototype={constructor:ZA,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 JA(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),zr(n,e.stream(df)),t(df.result()),r!=null&&e.clipExtent(r),e}function hm(e,t,n){return JA(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 Cb(e,t,n){return hm(e,[[0,0],t],n)}function kb(e,t,n){return JA(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 Rb(e,t,n){return JA(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 bR=16,XH=K(30*Xt);function QA(e,t){return+t?WH(e,t):GH(e)}function GH(e){return yf({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function WH(e,t){function n(r,i,o,s,a,c,l,u,f,h,d,p,m,y){var g=l-r,x=u-i,b=g*g+x*x;if(b>4*t&&m--){var w=s+h,v=a+d,_=c+p,A=xe(w*w+v*v+_*_),E=Ae(_/=A),T=Pt(Pt(_)-1)<et||Pt(o-f)<et?(o+f)/2:Je(v,w),D=e(T,E),I=D[0],O=D[1],L=I-r,S=O-i,M=x*L-g*S;(M*M/b>t||Pt((g*L+x*S)/b-.5)>.3||s*h+a*d+c*p<XH)&&(n(r,i,o,s,a,c,I,O,T,w/=A,v/=A,_,m,y),y.point(I,O),n(I,O,T,w,v,_,l,u,f,h,d,p,m,y))}}return function(r){var i,o,s,a,c,l,u,f,h,d,p,m,y={point:g,lineStart:x,lineEnd:w,polygonStart:function(){r.polygonStart(),y.lineStart=v},polygonEnd:function(){r.polygonEnd(),y.lineStart=x}};function g(E,T){E=e(E,T),r.point(E[0],E[1])}function x(){f=NaN,y.point=b,r.lineStart()}function b(E,T){var D=Bo([E,T]),I=e(E,T);n(f,h,u,d,p,m,f=I[0],h=I[1],u=E,d=D[0],p=D[1],m=D[2],bR,r),r.point(f,h)}function w(){y.point=g,r.lineEnd()}function v(){x(),y.point=_,y.lineEnd=A}function _(E,T){b(i=E,T),o=f,s=h,a=d,c=p,l=m,y.point=b}function A(){n(f,h,u,d,p,m,o,s,i,a,c,l,bR,r),y.lineEnd=w,w()}return y}}var HH=yf({point:function(e,t){this.stream.point(e*Xt,t*Xt)}});function ZH(e){return yf({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function JH(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 wR(e,t,n,r,i,o){if(!o)return JH(e,t,n,r,i);var s=K(o),a=Q(o),c=s*e,l=a*e,u=s/e,f=a/e,h=(a*n-s*t)/e,d=(a*t+s*n)/e;function p(m,y){return m*=r,y*=i,[c*m-l*y+t,n-l*m-c*y]}return p.invert=function(m,y){return[r*(u*m-f*y+h),i*(d-f*m-u*y)]},p}function Bn(e){return KA(function(){return e})()}function KA(e){var t,n=150,r=480,i=250,o=0,s=0,a=0,c=0,l=0,u,f=0,h=1,d=1,p=null,m=CA,y=null,g,x,b,w=sm,v=.5,_,A,E,T,D;function I(M){return E(M[0]*Xt,M[1]*Xt)}function O(M){return M=E.invert(M[0],M[1]),M&&[M[0]*Fe,M[1]*Fe]}I.stream=function(M){return T&&D===M?T:T=HH(ZH(u)(m(_(w(D=M)))))},I.preclip=function(M){return arguments.length?(m=M,p=void 0,S()):m},I.postclip=function(M){return arguments.length?(w=M,y=g=x=b=null,S()):w},I.clipAngle=function(M){return arguments.length?(m=+M?tR(p=M*Xt):(p=null,CA),S()):p*Fe},I.clipExtent=function(M){return arguments.length?(w=M==null?(y=g=x=b=null,sm):ff(y=+M[0][0],g=+M[0][1],x=+M[1][0],b=+M[1][1]),S()):y==null?null:[[y,g],[x,b]]},I.scale=function(M){return arguments.length?(n=+M,L()):n},I.translate=function(M){return arguments.length?(r=+M[0],i=+M[1],L()):[r,i]},I.center=function(M){return arguments.length?(o=M[0]%360*Xt,s=M[1]%360*Xt,L()):[o*Fe,s*Fe]},I.rotate=function(M){return arguments.length?(a=M[0]%360*Xt,c=M[1]%360*Xt,l=M.length>2?M[2]%360*Xt:0,L()):[a*Fe,c*Fe,l*Fe]},I.angle=function(M){return arguments.length?(f=M%360*Xt,L()):f*Fe},I.reflectX=function(M){return arguments.length?(h=M?-1:1,L()):h<0},I.reflectY=function(M){return arguments.length?(d=M?-1:1,L()):d<0},I.precision=function(M){return arguments.length?(_=QA(A,v=M*M),S()):xe(v)},I.fitExtent=function(M,N){return hm(I,M,N)},I.fitSize=function(M,N){return Cb(I,M,N)},I.fitWidth=function(M,N){return kb(I,M,N)},I.fitHeight=function(M,N){return Rb(I,M,N)};function L(){var M=wR(n,0,0,h,d,f).apply(null,t(o,s)),N=wR(n,r-M[0],i-M[1],h,d,f);return u=BA(a,c,l),A=im(t,N),E=im(u,A),_=QA(A,v),S()}function S(){return T=D=null,I}return function(){return t=e.apply(this,arguments),I.invert=t.invert&&O,L()}}function gf(e){var t=0,n=Bt/3,r=KA(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*Xt,n=o[1]*Xt):[t*Fe,n*Fe]},i}function _R(e){var t=K(e);function n(r,i){return[r*t,Q(i)/t]}return n.invert=function(r,i){return[r/t,Ae(i*t)]},n}function vR(e,t){var n=Q(e),r=(n+Q(t))/2;if(Pt(r)<et)return _R(e);var i=1+n*(2*r-n),o=xe(i)/r;function s(a,c){var l=xe(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=Je(a,Pt(l))*zn(l);return l*r<0&&(u-=Bt*zn(a)*zn(l)),[u/r,Ae((i-(a*a+l*l)*r*r)/(2*r))]},s}function Ua(){return gf(vR).scale(155.424).center([0,33.6442])}function dm(){return Ua().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function QH(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 tM(){var e,t,n=dm(),r,i=Ua().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=Ua().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,c,l={point:function(h,d){c=[h,d]}};function u(h){var d=h[0],p=h[1];return c=null,r.point(d,p),c||(o.point(d,p),c)||(a.point(d,p),c)}u.invert=function(h){var d=n.scale(),p=n.translate(),m=(h[0]-p[0])/d,y=(h[1]-p[1])/d;return(y>=.12&&y<.234&&m>=-.425&&m<-.214?i:y>=.166&&y<.234&&m>=-.214&&m<-.115?s:n).invert(h)},u.stream=function(h){return e&&t===h?e:e=QH([n.stream(t=h),i.stream(h),s.stream(h)])},u.precision=function(h){return arguments.length?(n.precision(h),i.precision(h),s.precision(h),f()):n.precision()},u.scale=function(h){return arguments.length?(n.scale(h),i.scale(h*.35),s.scale(h),u.translate(n.translate())):n.scale()},u.translate=function(h){if(!arguments.length)return n.translate();var d=n.scale(),p=+h[0],m=+h[1];return r=n.translate(h).clipExtent([[p-.455*d,m-.238*d],[p+.455*d,m+.238*d]]).stream(l),o=i.translate([p-.307*d,m+.201*d]).clipExtent([[p-.425*d+et,m+.12*d+et],[p-.214*d-et,m+.234*d-et]]).stream(l),a=s.translate([p-.205*d,m+.212*d]).clipExtent([[p-.214*d+et,m+.166*d+et],[p-.115*d-et,m+.234*d-et]]).stream(l),f()},u.fitExtent=function(h,d){return hm(u,h,d)},u.fitSize=function(h,d){return Cb(u,h,d)},u.fitWidth=function(h,d){return kb(u,h,d)},u.fitHeight=function(h,d){return Rb(u,h,d)};function f(){return e=t=null,u}return u.scale(1070)}function Fb(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 ko(e){return function(t,n){var r=xe(t*t+n*n),i=e(r),o=Q(i),s=K(i);return[Je(t*o,r*s),Ae(r&&n*o/r)]}}var eM=Fb(function(e){return xe(2/(1+e))});eM.invert=ko(function(e){return 2*Ae(e/2)});function nM(){return Bn(eM).scale(124.75).clipAngle(180-.001)}var rM=Fb(function(e){return(e=hb(e))&&e/Q(e)});rM.invert=ko(function(e){return e});function iM(){return Bn(rM).scale(79.4188).clipAngle(180-.001)}function xf(e,t){return[e,ml(cf((ge+t)/2))]}xf.invert=function(e,t){return[e,2*pi(lb(t))-ge]};function oM(){return sM(xf).scale(961/hn)}function sM(e){var t=Bn(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=Bt*r(),h=t(Hk(t.rotate()).invert([0,0]));return o(s==null?[[h[0]-f,h[1]-f],[h[0]+f,h[1]+f]]:e===xf?[[Math.max(h[0]-f,s),a],[Math.min(h[0]+f,c),l]]:[[s,Math.max(h[1]-f,a)],[c,Math.min(h[1]+f,l)]])}return u()}function $b(e){return cf((ge+e)/2)}function SR(e,t){var n=K(e),r=e===t?Q(e):ml(n/K(t))/ml($b(t)/$b(e)),i=n*fb($b(e),r)/r;if(!r)return xf;function o(s,a){i>0?a<-ge+et&&(a=-ge+et):a>ge-et&&(a=ge-et);var c=i/fb($b(a),r);return[c*Q(r*s),i-c*K(r*s)]}return o.invert=function(s,a){var c=i-a,l=zn(r)*xe(s*s+c*c),u=Je(s,Pt(c))*zn(c);return c*r<0&&(u-=Bt*zn(s)*zn(c)),[u/r,2*pi(fb(i/l,1/r))-ge]},o}function aM(){return gf(SR).scale(109.5).parallels([30,30])}function bf(e,t){return[e,t]}bf.invert=bf;function cM(){return Bn(bf).scale(152.63)}function IR(e,t){var n=K(e),r=e===t?Q(e):(n-K(t))/(t-e),i=n/r+e;if(Pt(r)<et)return bf;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=Je(s,Pt(c))*zn(c);return c*r<0&&(l-=Bt*zn(s)*zn(c)),[l/r,i-zn(r)*xe(s*s+c*c)]},o}function lM(){return gf(IR).scale(131.154).center([0,13.9389])}var pm=1.340264,mm=-.081106,ym=893e-6,gm=.003796,Pb=xe(3)/2,KH=12;function uM(e,t){var n=Ae(Pb*Q(t)),r=n*n,i=r*r*r;return[e*K(n)/(Pb*(pm+3*mm*r+i*(7*ym+9*gm*r))),n*(pm+mm*r+i*(ym+gm*r))]}uM.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,s,a,c;o<KH&&(a=n*(pm+mm*r+i*(ym+gm*r))-t,c=pm+3*mm*r+i*(7*ym+9*gm*r),n-=s=a/c,r=n*n,i=r*r*r,!(Pt(s)<pl));++o);return[Pb*e*(pm+3*mm*r+i*(7*ym+9*gm*r))/K(n),Ae(Q(n)/Pb)]};function fM(){return Bn(uM).scale(177.158)}function hM(e,t){var n=K(t),r=K(e)*n;return[n*Q(e)/r,Q(t)/r]}hM.invert=ko(pi);function dM(){return Bn(hM).scale(144.049).clipAngle(60)}function pM(e,t){return[K(t)*Q(e),Q(t)]}pM.invert=ko(Ae);function mM(){return Bn(pM).scale(249.5).clipAngle(90+et)}function yM(e,t){var n=K(t),r=1+K(e)*n;return[n*Q(e)/r,Q(t)/r]}yM.invert=ko(function(e){return 2*pi(e)});function gM(){return Bn(yM).scale(250).clipAngle(142)}function xM(e,t){return[ml(cf((ge+t)/2)),-e]}xM.invert=function(e,t){return[-t,2*pi(lb(e))-ge]};function bM(){var e=sM(xM),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 tZ(e,t){return e.parent===t.parent?1:2}function eZ(e){return e.reduce(nZ,0)/e.length}function nZ(e,t){return e+t.x}function rZ(e){return 1+e.reduce(iZ,0)}function iZ(e,t){return Math.max(e,t.y)}function oZ(e){for(var t;t=e.children;)e=t[0];return e}function sZ(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Ub(){var e=tZ,t=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(h){var d=h.children;d?(h.x=eZ(d),h.y=rZ(d)):(h.x=s?a+=e(h,s):0,h.y=0,s=h)});var c=oZ(o),l=sZ(o),u=c.x-e(c,l)/2,f=l.x+e(l,c)/2;return o.eachAfter(r?function(h){h.x=(h.x-o.x)*t,h.y=(o.y-h.y)*n}:function(h){h.x=(h.x-u)/(f-u)*t,h.y=(1-(o.y?h.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(r=!1,t=+o[0],n=+o[1],i):r?null:[t,n]},i.nodeSize=function(o){return arguments.length?(r=!0,t=+o[0],n=+o[1],i):r?[t,n]:null},i}function aZ(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 AR(){return this.eachAfter(aZ)}function MR(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function TR(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 ER(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 NR(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function DR(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 OR(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function BR(e){for(var t=this,n=cZ(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 cZ(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 LR(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function CR(){return Array.from(this)}function kR(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function RR(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*FR(){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 wM(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=fZ)):t===void 0&&(t=uZ);for(var n=new za(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 za(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(_M)}function lZ(){return wM(this).eachBefore(hZ)}function uZ(e){return e.children}function fZ(e){return Array.isArray(e)?e[1]:null}function hZ(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function _M(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function za(e){this.data=e,this.depth=this.height=0,this.parent=null}za.prototype=wM.prototype={constructor:za,count:AR,each:MR,eachAfter:ER,eachBefore:TR,find:NR,sum:DR,sort:OR,path:BR,ancestors:LR,descendants:CR,leaves:kR,links:RR,copy:lZ,[Symbol.iterator]:FR};function zb(e){return e==null?null:dZ(e)}function dZ(e){if(typeof e!="function")throw new Error;return e}var pZ={depth:-1},$R={},vM={};function mZ(e){return e.id}function yZ(e){return e.parentId}function qb(){var e=mZ,t=yZ,n;function r(i){var o=Array.from(i),s=e,a=t,c,l,u,f,h,d,p,m,y=new Map;if(n!=null){let g=o.map((w,v)=>gZ(n(w,v,i))),x=g.map(PR),b=new Set(g).add("");for(let w of x)b.has(w)||(b.add(w),g.push(w),x.push(PR(w)),o.push(vM));s=(w,v)=>g[v],a=(w,v)=>x[v]}for(u=0,c=o.length;u<c;++u)l=o[u],d=o[u]=new za(l),(p=s(l,u,i))!=null&&(p+="")&&(m=d.id=p,y.set(m,y.has(m)?$R:d)),(p=a(l,u,i))!=null&&(p+="")&&(d.parent=p);for(u=0;u<c;++u)if(d=o[u],p=d.parent){if(h=y.get(p),!h)throw new Error("missing: "+p);if(h===$R)throw new Error("ambiguous: "+p);h.children?h.children.push(d):h.children=[d],d.parent=h}else{if(f)throw new Error("multiple roots");f=d}if(!f)throw new Error("no root");if(n!=null){for(;f.data===vM&&f.children.length===1;)f=f.children[0],--c;for(let g=o.length-1;g>=0&&(d=o[g],d.data===vM);--g)d.data=null}if(f.parent=pZ,f.eachBefore(function(g){g.depth=g.parent.depth+1,--c}).eachBefore(_M),f.parent=null,c>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(e=zb(i),r):e},r.parentId=function(i){return arguments.length?(t=zb(i),r):t},r.path=function(i){return arguments.length?(n=zb(i),r):n},r}function gZ(e){e=`${e}`;let t=e.length;return SM(e,t-1)&&!SM(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function PR(e){let t=e.length;if(t<2)return"";for(;--t>1&&!SM(e,t););return e.slice(0,t)}function SM(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function xZ(e,t){return e.parent===t.parent?1:2}function IM(e){var t=e.children;return t?t[0]:e.t}function AM(e){var t=e.children;return t?t[t.length-1]:e.t}function bZ(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 wZ(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 _Z(e,t,n){return e.a.parent===t.parent?e.a:n}function jb(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}jb.prototype=Object.create(za.prototype);function vZ(e){for(var t=new jb(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 jb(o[s],s)),i.parent=n;return(t.parent=new jb(null,0)).children=[t],t}function xl(){var e=xZ,t=1,n=1,r=null;function i(l){var u=vZ(l);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),r)l.eachBefore(c);else{var f=l,h=l,d=l;l.eachBefore(function(x){x.x<f.x&&(f=x),x.x>h.x&&(h=x),x.depth>d.depth&&(d=x)});var p=f===h?1:e(f,h)/2,m=p-f.x,y=t/(h.x+p+m),g=n/(d.depth||1);l.eachBefore(function(x){x.x=(x.x+m)*y,x.y=x.depth*g})}return l}function o(l){var u=l.children,f=l.parent.children,h=l.i?f[l.i-1]:null;if(u){wZ(l);var d=(u[0].z+u[u.length-1].z)/2;h?(l.z=h.z+e(l._,h._),l.m=l.z-d):l.z=d}else h&&(l.z=h.z+e(l._,h._));l.parent.A=a(l,h,l.parent.A||f[0])}function s(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,u,f){if(u){for(var h=l,d=l,p=u,m=h.parent.children[0],y=h.m,g=d.m,x=p.m,b=m.m,w;p=AM(p),h=IM(h),p&&h;)m=IM(m),d=AM(d),d.a=l,w=p.z+x-h.z-y+e(p._,h._),w>0&&(bZ(_Z(p,l,f),l,w),y+=w,g+=w),x+=p.m,y+=h.m,b+=m.m,g+=d.m;p&&!AM(d)&&(d.t=p,d.m+=x-g),h&&!IM(m)&&(m.t=h,m.m+=y-b,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 UR=23283064365386963e-26;function bl(e=Math.random()){let t=(0<=e&&e<1?e/UR:Math.abs(e))|0;return()=>(t=1664525*t+1013904223|0,UR*(t>>>0))}function Ke(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function xm(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 bm=Symbol("implicit");function wl(){var e=new Qn,t=[],n=[],r=bm;function i(o){let s=e.get(o);if(s===void 0){if(r!==bm)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Qn;for(let s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return wl(t,n).unknown(r)},Ke.apply(i,arguments),i}function qa(){var e=wl().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,c=0,l=0,u=.5;delete e.unknown;function f(){var h=t().length,d=i<r,p=d?i:r,m=d?r:i;o=(m-p)/Math.max(1,h-c+l*2),a&&(o=Math.floor(o)),p+=(m-p-o*(h-c))*u,s=o*(1-c),a&&(p=Math.round(p),s=Math.round(s));var y=Ue(h).map(function(g){return p+o*g});return n(d?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(h){return arguments.length?(a=!!h,f()):a},e.padding=function(h){return arguments.length?(c=Math.min(1,l=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(l=+h,f()):l},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),f()):u},e.copy=function(){return qa(t(),[r,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},Ke.apply(f(),arguments)}function zR(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return zR(t())},e}function MM(){return zR(qa.apply(null,arguments).paddingInner(1))}function TM(e){return function(){return e}}function wf(e){return+e}var qR=[0,1];function Ir(e){return e}function EM(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:TM(isNaN(t)?NaN:.5)}function SZ(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function IZ(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=EM(i,r),o=n(s,o)):(r=EM(r,i),o=n(o,s)),function(a){return o(r(a))}}function AZ(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]=EM(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var c=Ts(e,a,1,r)-1;return o[c](i[c](a))}}function Ro(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function _l(){var e=qR,t=qR,n=Ur,r,i,o,s=Ir,a,c,l;function u(){var h=Math.min(e.length,t.length);return s!==Ir&&(s=SZ(e[0],e[h-1])),a=h>2?AZ:IZ,c=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(c||(c=a(e.map(r),t,n)))(r(s(h)))}return f.invert=function(h){return s(i((l||(l=a(t,e.map(r),Ie)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,wf),u()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=cl,u()},f.clamp=function(h){return arguments.length?(s=h?!0:Ir,u()):s!==Ir},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,d){return r=h,i=d,u()}}function wm(){return _l()(Ir,Ir)}function NM(e,t,n,r){var i=qu(e,t,n),o;switch(r=Oo(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=vA(i,s))&&(r.precision=o),cb(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=SA(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=_A(i))&&(r.precision=o-(r.type==="%")*2);break}}return di(r)}function Ps(e){var t=e.domain;return e.ticks=function(n){var r=t();return En(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return NM(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=Ns(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 Us(){var e=wm();return e.copy=function(){return Ro(e,Us())},Ke.apply(e,arguments),Ps(e)}function _m(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,wf),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return _m(e).unknown(t)},e=arguments.length?Array.from(e,wf):[0,1],Ps(n)}function vm(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 jR(e){return Math.log(e)}function VR(e){return Math.exp(e)}function MZ(e){return-Math.log(-e)}function TZ(e){return-Math.exp(-e)}function EZ(e){return isFinite(e)?+("1e"+e):e<0?0:e}function NZ(e){return e===10?EZ:e===Math.E?Math.exp:t=>Math.pow(e,t)}function DZ(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 YR(e){return(t,n)=>-e(-t,n)}function DM(e){let t=e(jR,VR),n=t.domain,r=10,i,o;function s(){return i=DZ(r),o=NZ(r),n()[0]<0?(i=YR(i),o=YR(o),e(MZ,TZ)):e(jR,VR),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{let c=n(),l=c[0],u=c[c.length-1],f=u<l;f&&([l,u]=[u,l]);let h=i(l),d=i(u),p,m,y=a==null?10:+a,g=[];if(!(r%1)&&d-h<y){if(h=Math.floor(h),d=Math.ceil(d),l>0){for(;h<=d;++h)for(p=1;p<r;++p)if(m=h<0?p/o(-h):p*o(h),!(m<l)){if(m>u)break;g.push(m)}}else for(;h<=d;++h)for(p=r-1;p>=1;--p)if(m=h>0?p/o(-h):p*o(h),!(m<l)){if(m>u)break;g.push(m)}g.length*2<y&&(g=En(l,u,y))}else g=En(h,d,Math.min(d-h,y)).map(o);return f?g.reverse():g},t.tickFormat=(a,c)=>{if(a==null&&(a=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Oo(c)).precision==null&&(c.trim=!0),c=di(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(vm(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function Sm(){let e=DM(_l()).domain([1,10]);return e.copy=()=>Ro(e,Sm()).base(e.base()),Ke.apply(e,arguments),e}function XR(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function GR(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function OM(e){var t=1,n=e(XR(t),GR(t));return n.constant=function(r){return arguments.length?e(XR(t=+r),GR(t)):t},Ps(n)}function Im(){var e=OM(_l());return e.copy=function(){return Ro(e,Im()).constant(e.constant())},Ke.apply(e,arguments)}function WR(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function OZ(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function BZ(e){return e<0?-e*e:e*e}function BM(e){var t=e(Ir,Ir),n=1;function r(){return n===1?e(Ir,Ir):n===.5?e(OZ,BZ):e(WR(n),WR(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Ps(t)}function Am(){var e=BM(_l());return e.copy=function(){return Ro(e,Am()).exponent(e.exponent())},Ke.apply(e,arguments),e}function Mm(){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]=OI(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?r:t[Ts(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(Ot),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 Mm().domain(e).range(t).unknown(r)},Ke.apply(o,arguments)}function Tm(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[Ts(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 Tm().domain(e).range(t).unknown(n)},Ke.apply(i,arguments)}var LM=new Date,CM=new Date;function _e(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=>_e(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)=>(LM.setTime(+o),CM.setTime(+s),e(LM),e(CM),Math.floor(n(LM,CM))),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 Em=_e(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Em.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?_e(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Em);var q4t=Em.range;var dn=_e(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),HR=dn.range;var zs=_e(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),LZ=zs.range,qs=_e(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),CZ=qs.range;var js=_e(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()),kZ=js.range,Vs=_e(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),RZ=Vs.range;var mi=_e(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),FZ=mi.range,Il=_e(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),$Z=Il.range,Al=_e(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),PZ=Al.range;function Ml(e){return _e(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 qr=Ml(0),ja=Ml(1),Vb=Ml(2),Yb=Ml(3),$o=Ml(4),Xb=Ml(5),Gb=Ml(6),JR=qr.range,UZ=ja.range,zZ=Vb.range,qZ=Yb.range,jZ=$o.range,VZ=Xb.range,YZ=Gb.range;function Tl(e){return _e(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 jr=Tl(0),Va=Tl(1),Wb=Tl(2),Hb=Tl(3),Po=Tl(4),Zb=Tl(5),Jb=Tl(6),QR=jr.range,XZ=Va.range,GZ=Wb.range,WZ=Hb.range,HZ=Po.range,ZZ=Zb.range,JZ=Jb.range;var Ys=_e(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()),QZ=Ys.range,Xs=_e(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()),KZ=Xs.range;var qn=_e(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());qn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_e(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 tJ=qn.range,jn=_e(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());jn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_e(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 eJ=jn.range;function tF(e,t,n,r,i,o){let s=[[dn,1,1e3],[dn,5,5*1e3],[dn,15,15*1e3],[dn,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[r,1,864e5],[r,2,2*864e5],[n,1,6048e5],[t,1,2592e6],[t,3,3*2592e6],[e,1,31536e6]];function a(l,u,f){let h=u<l;h&&([l,u]=[u,l]);let d=f&&typeof f.range=="function"?f:c(l,u,f),p=d?d.range(l,+u+1):[];return h?p.reverse():p}function c(l,u,f){let h=Math.abs(u-l)/f,d=Pi(([,,y])=>y).right(s,h);if(d===s.length)return e.every(qu(l/31536e6,u/31536e6,f));if(d===0)return Em.every(Math.max(qu(l,u,f),1));let[p,m]=s[h/s[d-1][2]<s[d][2]/h?d-1:d];return p.every(m)}return[a,c]}var[kM,Dm]=tF(jn,Xs,jr,Al,Vs,qs),[RM,FM]=tF(qn,Ys,qr,mi,js,zs);function $M(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 PM(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 Om(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function UM(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=Bm(i),u=Lm(i),f=Bm(o),h=Lm(o),d=Bm(s),p=Lm(s),m=Bm(a),y=Lm(a),g=Bm(c),x=Lm(c),b={a:R,A:F,b:k,B:$,c:null,d:sF,e:sF,f:AJ,g:kJ,G:FJ,H:vJ,I:SJ,j:IJ,L:fF,m:MJ,M:TJ,p:P,q:U,Q:lF,s:uF,S:EJ,u:NJ,U:DJ,V:OJ,w:BJ,W:LJ,x:null,X:null,y:CJ,Y:RJ,Z:$J,"%":cF},w={a:G,A:nt,b:ot,B:at,c:null,d:aF,e:aF,f:qJ,g:QJ,G:tQ,H:PJ,I:UJ,j:zJ,L:dF,m:jJ,M:VJ,p:Y,q:st,Q:lF,s:uF,S:YJ,u:XJ,U:GJ,V:WJ,w:HJ,W:ZJ,x:null,X:null,y:JJ,Y:KJ,Z:eQ,"%":cF},v={a:D,A:I,b:O,B:L,c:S,d:iF,e:iF,f:xJ,g:rF,G:nF,H:oF,I:oF,j:pJ,L:gJ,m:dJ,M:mJ,p:T,q:hJ,Q:wJ,s:_J,S:yJ,u:aJ,U:cJ,V:lJ,w:sJ,W:uJ,x:M,X:N,y:rF,Y:nF,Z:fJ,"%":bJ};b.x=_(n,b),b.X=_(r,b),b.c=_(t,b),w.x=_(n,w),w.X=_(r,w),w.c=_(t,w);function _(q,Z){return function(rt){var z=[],Ft=-1,ht=0,Ht=q.length,Qt,tt,le;for(rt instanceof Date||(rt=new Date(+rt));++Ft<Ht;)q.charCodeAt(Ft)===37&&(z.push(q.slice(ht,Ft)),(tt=eF[Qt=q.charAt(++Ft)])!=null?Qt=q.charAt(++Ft):tt=Qt==="e"?" ":"0",(le=Z[Qt])&&(Qt=le(rt,tt)),z.push(Qt),ht=Ft+1);return z.push(q.slice(ht,Ft)),z.join("")}}function A(q,Z){return function(rt){var z=Om(1900,void 0,1),Ft=E(z,q,rt+="",0),ht,Ht;if(Ft!=rt.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(Z&&!("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?(ht=PM(Om(z.y,0,1)),Ht=ht.getUTCDay(),ht=Ht>4||Ht===0?Va.ceil(ht):Va(ht),ht=Il.offset(ht,(z.V-1)*7),z.y=ht.getUTCFullYear(),z.m=ht.getUTCMonth(),z.d=ht.getUTCDate()+(z.w+6)%7):(ht=$M(Om(z.y,0,1)),Ht=ht.getDay(),ht=Ht>4||Ht===0?ja.ceil(ht):ja(ht),ht=mi.offset(ht,(z.V-1)*7),z.y=ht.getFullYear(),z.m=ht.getMonth(),z.d=ht.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),Ht="Z"in z?PM(Om(z.y,0,1)).getUTCDay():$M(Om(z.y,0,1)).getDay(),z.m=0,z.d="W"in z?(z.w+6)%7+z.W*7-(Ht+5)%7:z.w+z.U*7-(Ht+6)%7);return"Z"in z?(z.H+=z.Z/100|0,z.M+=z.Z%100,PM(z)):$M(z)}}function E(q,Z,rt,z){for(var Ft=0,ht=Z.length,Ht=rt.length,Qt,tt;Ft<ht;){if(z>=Ht)return-1;if(Qt=Z.charCodeAt(Ft++),Qt===37){if(Qt=Z.charAt(Ft++),tt=v[Qt in eF?Z.charAt(Ft++):Qt],!tt||(z=tt(q,rt,z))<0)return-1}else if(Qt!=rt.charCodeAt(z++))return-1}return z}function T(q,Z,rt){var z=l.exec(Z.slice(rt));return z?(q.p=u.get(z[0].toLowerCase()),rt+z[0].length):-1}function D(q,Z,rt){var z=d.exec(Z.slice(rt));return z?(q.w=p.get(z[0].toLowerCase()),rt+z[0].length):-1}function I(q,Z,rt){var z=f.exec(Z.slice(rt));return z?(q.w=h.get(z[0].toLowerCase()),rt+z[0].length):-1}function O(q,Z,rt){var z=g.exec(Z.slice(rt));return z?(q.m=x.get(z[0].toLowerCase()),rt+z[0].length):-1}function L(q,Z,rt){var z=m.exec(Z.slice(rt));return z?(q.m=y.get(z[0].toLowerCase()),rt+z[0].length):-1}function S(q,Z,rt){return E(q,t,Z,rt)}function M(q,Z,rt){return E(q,n,Z,rt)}function N(q,Z,rt){return E(q,r,Z,rt)}function R(q){return s[q.getDay()]}function F(q){return o[q.getDay()]}function k(q){return c[q.getMonth()]}function $(q){return a[q.getMonth()]}function P(q){return i[+(q.getHours()>=12)]}function U(q){return 1+~~(q.getMonth()/3)}function G(q){return s[q.getUTCDay()]}function nt(q){return o[q.getUTCDay()]}function ot(q){return c[q.getUTCMonth()]}function at(q){return a[q.getUTCMonth()]}function Y(q){return i[+(q.getUTCHours()>=12)]}function st(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var Z=_(q+="",b);return Z.toString=function(){return q},Z},parse:function(q){var Z=A(q+="",!1);return Z.toString=function(){return q},Z},utcFormat:function(q){var Z=_(q+="",w);return Z.toString=function(){return q},Z},utcParse:function(q){var Z=A(q+="",!0);return Z.toString=function(){return q},Z}}}var eF={"-":"",_:" ",0:"0"},pn=/^\s*\d+/,rJ=/^%/,iJ=/[\\^$*+?|[\]().{}]/g;function re(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 oJ(e){return e.replace(iJ,"\\$&")}function Bm(e){return new RegExp("^(?:"+e.map(oJ).join("|")+")","i")}function Lm(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function sJ(e,t,n){var r=pn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function aJ(e,t,n){var r=pn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function cJ(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function lJ(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function uJ(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function nF(e,t,n){var r=pn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function rF(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function fJ(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 hJ(e,t,n){var r=pn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function dJ(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function iF(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function pJ(e,t,n){var r=pn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function oF(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function mJ(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function yJ(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function gJ(e,t,n){var r=pn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function xJ(e,t,n){var r=pn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function bJ(e,t,n){var r=rJ.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function wJ(e,t,n){var r=pn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function _J(e,t,n){var r=pn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function sF(e,t){return re(e.getDate(),t,2)}function vJ(e,t){return re(e.getHours(),t,2)}function SJ(e,t){return re(e.getHours()%12||12,t,2)}function IJ(e,t){return re(1+mi.count(qn(e),e),t,3)}function fF(e,t){return re(e.getMilliseconds(),t,3)}function AJ(e,t){return fF(e,t)+"000"}function MJ(e,t){return re(e.getMonth()+1,t,2)}function TJ(e,t){return re(e.getMinutes(),t,2)}function EJ(e,t){return re(e.getSeconds(),t,2)}function NJ(e){var t=e.getDay();return t===0?7:t}function DJ(e,t){return re(qr.count(qn(e)-1,e),t,2)}function hF(e){var t=e.getDay();return t>=4||t===0?$o(e):$o.ceil(e)}function OJ(e,t){return e=hF(e),re($o.count(qn(e),e)+(qn(e).getDay()===4),t,2)}function BJ(e){return e.getDay()}function LJ(e,t){return re(ja.count(qn(e)-1,e),t,2)}function CJ(e,t){return re(e.getFullYear()%100,t,2)}function kJ(e,t){return e=hF(e),re(e.getFullYear()%100,t,2)}function RJ(e,t){return re(e.getFullYear()%1e4,t,4)}function FJ(e,t){var n=e.getDay();return e=n>=4||n===0?$o(e):$o.ceil(e),re(e.getFullYear()%1e4,t,4)}function $J(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+re(t/60|0,"0",2)+re(t%60,"0",2)}function aF(e,t){return re(e.getUTCDate(),t,2)}function PJ(e,t){return re(e.getUTCHours(),t,2)}function UJ(e,t){return re(e.getUTCHours()%12||12,t,2)}function zJ(e,t){return re(1+Il.count(jn(e),e),t,3)}function dF(e,t){return re(e.getUTCMilliseconds(),t,3)}function qJ(e,t){return dF(e,t)+"000"}function jJ(e,t){return re(e.getUTCMonth()+1,t,2)}function VJ(e,t){return re(e.getUTCMinutes(),t,2)}function YJ(e,t){return re(e.getUTCSeconds(),t,2)}function XJ(e){var t=e.getUTCDay();return t===0?7:t}function GJ(e,t){return re(jr.count(jn(e)-1,e),t,2)}function pF(e){var t=e.getUTCDay();return t>=4||t===0?Po(e):Po.ceil(e)}function WJ(e,t){return e=pF(e),re(Po.count(jn(e),e)+(jn(e).getUTCDay()===4),t,2)}function HJ(e){return e.getUTCDay()}function ZJ(e,t){return re(Va.count(jn(e)-1,e),t,2)}function JJ(e,t){return re(e.getUTCFullYear()%100,t,2)}function QJ(e,t){return e=pF(e),re(e.getUTCFullYear()%100,t,2)}function KJ(e,t){return re(e.getUTCFullYear()%1e4,t,4)}function tQ(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Po(e):Po.ceil(e),re(e.getUTCFullYear()%1e4,t,4)}function eQ(){return"+0000"}function cF(){return"%"}function lF(e){return+e}function uF(e){return Math.floor(+e/1e3)}var _f,vf,mF,Uo,yF;zM({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 zM(e){return _f=UM(e),vf=_f.format,mF=_f.parse,Uo=_f.utcFormat,yF=_f.utcParse,_f}function nQ(e){return new Date(e)}function rQ(e){return e instanceof Date?+e:+new Date(+e)}function Qb(e,t,n,r,i,o,s,a,c,l){var u=wm(),f=u.invert,h=u.domain,d=l(".%L"),p=l(":%S"),m=l("%I:%M"),y=l("%I %p"),g=l("%a %d"),x=l("%b %d"),b=l("%B"),w=l("%Y");function v(_){return(c(_)<_?d:a(_)<_?p:s(_)<_?m:o(_)<_?y:r(_)<_?i(_)<_?g:x:n(_)<_?b:w)(_)}return u.invert=function(_){return new Date(f(_))},u.domain=function(_){return arguments.length?h(Array.from(_,rQ)):h().map(nQ)},u.ticks=function(_){var A=h();return e(A[0],A[A.length-1],_??10)},u.tickFormat=function(_,A){return A==null?v:l(A)},u.nice=function(_){var A=h();return(!_||typeof _.range!="function")&&(_=t(A[0],A[A.length-1],_??10)),_?h(vm(A,_)):u},u.copy=function(){return Ro(u,Qb(e,t,n,r,i,o,s,a,c,l))},u}function Kb(){return Ke.apply(Qb(RM,FM,qn,Ys,qr,mi,js,zs,dn,vf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function t1(){return Ke.apply(Qb(kM,Dm,jn,Xs,jr,Il,Vs,qs,dn,Uo).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Cm(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function e1(){var e=0,t=.5,n=1,r=1,i,o,s,a,c,l=Ir,u,f=!1,h;function d(m){return isNaN(m=+m)?h:(m=.5+((m=+u(m))-o)*(r*m<r*o?a:c),l(f?Math.max(0,Math.min(1,m)):m))}d.domain=function(m){return arguments.length?([e,t,n]=m,i=u(e=+e),o=u(t=+t),s=u(n=+n),a=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,d):[e,t,n]},d.clamp=function(m){return arguments.length?(f=!!m,d):f},d.interpolator=function(m){return arguments.length?(l=m,d):l};function p(m){return function(y){var g,x,b;return arguments.length?([g,x,b]=y,l=To(m,[g,x,b]),d):[l(0),l(.5),l(1)]}}return d.range=p(Ur),d.rangeRound=p(cl),d.unknown=function(m){return arguments.length?(h=m,d):h},function(m){return u=m,i=m(e),o=m(t),s=m(n),a=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,d}}function km(){var e=Ps(e1()(Ir));return e.copy=function(){return Cm(e,km())},xm.apply(e,arguments)}function n1(){var e=DM(e1()).domain([.1,1,10]);return e.copy=function(){return Cm(e,n1()).base(e.base())},xm.apply(e,arguments)}function r1(){var e=OM(e1());return e.copy=function(){return Cm(e,r1()).constant(e.constant())},xm.apply(e,arguments)}function i1(){var e=BM(e1());return e.copy=function(){return Cm(e,i1()).exponent(e.exponent())},xm.apply(e,arguments)}function X(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 qM=X("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var jM=X("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");var VM=X("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");var YM=X("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0");var XM=X("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");var GM=X("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");var WM=X("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");var HM=X("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");var ZM=X("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");var JM=X("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var QM=X("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var pt=e=>GI(e[e.length-1]);var o1=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(X),s1=pt(o1);var a1=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(X),c1=pt(a1);var l1=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(X),u1=pt(l1);var f1=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(X),h1=pt(f1);var Rm=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(X),Sf=pt(Rm);var d1=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(X),p1=pt(d1);var Fm=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(X),If=pt(Fm);var m1=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(X),y1=pt(m1);var g1=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(X),x1=pt(g1);var b1=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(X),w1=pt(b1);var _1=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(X),v1=pt(_1);var S1=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(X),I1=pt(S1);var A1=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(X),M1=pt(A1);var T1=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(X),E1=pt(T1);var N1=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(X),D1=pt(N1);var O1=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(X),B1=pt(O1);var L1=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(X),C1=pt(L1);var k1=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(X),R1=pt(k1);var F1=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(X),$1=pt(F1);var P1=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(X),U1=pt(P1);var z1=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(X),q1=pt(z1);var j1=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(X),V1=pt(j1);var Y1=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(X),X1=pt(Y1);var G1=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(X),W1=pt(G1);var H1=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(X),Z1=pt(H1);var J1=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(X),Q1=pt(J1);var K1=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(X),tw=pt(K1);function ew(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 nw=Ju(er(300,.5,0),er(-240,.5,1));var iw=Ju(er(-100,.75,.35),er(80,1.5,.8)),ow=Ju(er(260,.75,.35),er(80,1.5,.8)),rw=er();function sw(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return rw.h=360*e-100,rw.s=1.5-1.5*t,rw.l=.8-.9*t,rw+""}var aw=sn(),iQ=Math.PI/3,oQ=Math.PI*2/3;function cw(e){var t;return e=(.5-e)*Math.PI,aw.r=255*(t=Math.sin(e))*t,aw.g=255*(t=Math.sin(e+iQ))*t,aw.b=255*(t=Math.sin(e+oQ))*t,aw+""}function lw(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 uw(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var fw=uw(X("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),hw=uw(X("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),dw=uw(X("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),pw=uw(X("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function tn(e){return function(){return e}}var KM=Math.cos;var Af=Math.min,$m=Math.sin,ie=Math.sqrt,t3=1e-12,El=Math.PI,dOt=El/2,Mf=2*El;function mw(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 Ra(t)}var gOt=Array.prototype.slice;function yw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gF(e){this._context=e}gF.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 Gs(e){return new gF(e)}function gw(e){return e[0]}function xw(e){return e[1]}function Pm(e,t){var n=tn(!0),r=null,i=Gs,o=null,s=mw(a);e=typeof e=="function"?e:e===void 0?gw:tn(e),t=typeof t=="function"?t:t===void 0?xw:tn(t);function a(c){var l,u=(c=yw(c)).length,f,h=!1,d;for(r==null&&(o=i(d=s())),l=0;l<=u;++l)!(l<u&&n(f=c[l],l,c))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(f,l,c),+t(f,l,c));if(d)return o=null,d+""||null}return a.x=function(c){return arguments.length?(e=typeof c=="function"?c:tn(+c),a):e},a.y=function(c){return arguments.length?(t=typeof c=="function"?c:tn(+c),a):t},a.defined=function(c){return arguments.length?(n=typeof c=="function"?c:tn(!!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 Tf(e,t,n){var r=null,i=tn(!0),o=null,s=Gs,a=null,c=mw(l);e=typeof e=="function"?e:e===void 0?gw:tn(+e),t=typeof t=="function"?t:t===void 0?tn(0):tn(+t),n=typeof n=="function"?n:n===void 0?xw:tn(+n);function l(f){var h,d,p,m=(f=yw(f)).length,y,g=!1,x,b=new Array(m),w=new Array(m);for(o==null&&(a=s(x=c())),h=0;h<=m;++h){if(!(h<m&&i(y=f[h],h,f))===g)if(g=!g)d=h,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=h-1;p>=d;--p)a.point(b[p],w[p]);a.lineEnd(),a.areaEnd()}g&&(b[h]=+e(y,h,f),w[h]=+t(y,h,f),a.point(r?+r(y,h,f):b[h],n?+n(y,h,f):w[h]))}if(x)return a=null,x+""||null}function u(){return Pm().defined(i).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:tn(+f),r=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:tn(+f),l):e},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:tn(+f),l):r},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:tn(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:tn(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:tn(+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:tn(!!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 bw=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 e3(e){return new bw(e,!0)}function n3(e){return new bw(e,!1)}var sQ=ie(3),Um={draw(e,t){let n=ie(t+Af(t/28,.75))*.59436,r=n/2,i=r*sQ;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 Ws={draw(e,t){let n=ie(t/El);e.moveTo(n,0),e.arc(0,0,n,0,Mf)}};var zm={draw(e,t){let n=ie(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 xF=ie(1/3),aQ=xF*2,qm={draw(e,t){let n=ie(t/aQ),r=n*xF;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}};var jm={draw(e,t){let n=ie(t)*.62625;e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}};var Vm={draw(e,t){let n=ie(t-Af(t/7,2))*.87559;e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}};var Ym={draw(e,t){let n=ie(t),r=-n/2;e.rect(r,r,n,n)}};var Xm={draw(e,t){let n=ie(t)*.4431;e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}};var cQ=.8908130915292852,bF=$m(El/10)/$m(7*El/10),lQ=$m(Mf/10)*bF,uQ=-KM(Mf/10)*bF,Gm={draw(e,t){let n=ie(t*cQ),r=lQ*n,i=uQ*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){let s=Mf*o/5,a=KM(s),c=$m(s);e.lineTo(c*n,-a*n),e.lineTo(a*r-c*i,c*r+a*i)}e.closePath()}};var r3=ie(3),Wm={draw(e,t){let n=-ie(t/(r3*3));e.moveTo(0,n*2),e.lineTo(-r3*n,-n),e.lineTo(r3*n,-n),e.closePath()}};var fQ=ie(3),Hm={draw(e,t){let n=ie(t)*.6824,r=n/2,i=n*fQ/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}};var yi=-.5,gi=ie(3)/2,i3=1/ie(12),hQ=(i3/2+1)*3,Zm={draw(e,t){let n=ie(t/hQ),r=n/2,i=n*i3,o=r,s=n*i3+n,a=-o,c=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(a,c),e.lineTo(yi*r-gi*i,gi*r+yi*i),e.lineTo(yi*o-gi*s,gi*o+yi*s),e.lineTo(yi*a-gi*c,gi*a+yi*c),e.lineTo(yi*r+gi*i,yi*i-gi*r),e.lineTo(yi*o+gi*s,yi*s-gi*o),e.lineTo(yi*a+gi*c,yi*c-gi*a),e.closePath()}};var Ef={draw(e,t){let n=ie(t-Af(t/6,1.7))*.6189;e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}};var ww=[Ws,zm,qm,Ym,Gm,Wm,Zm],o3=[Ws,Vm,Ef,Hm,Um,Xm,jm];function xi(){}function Nf(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 Jm(e){this._context=e}Jm.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:Nf(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:Nf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function s3(e){return new Jm(e)}function wF(e){this._context=e}wF.prototype={areaStart:xi,areaEnd:xi,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:Nf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function a3(e){return new wF(e)}function _F(e){this._context=e}_F.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:Nf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function c3(e){return new _F(e)}function vF(e,t){this._basis=new Jm(e),this._beta=t}vF.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 l3=function e(t){function n(r){return t===1?new Jm(r):new vF(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Df(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 _w(e,t){this._context=e,this._k=(1-t)/6}_w.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:Df(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:Df(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 u3=function e(t){function n(r){return new _w(r,t)}return n.tension=function(r){return e(+r)},n}(0);function vw(e,t){this._context=e,this._k=(1-t)/6}vw.prototype={areaStart:xi,areaEnd:xi,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:Df(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 f3=function e(t){function n(r){return new vw(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Sw(e,t){this._context=e,this._k=(1-t)/6}Sw.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:Df(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 h3=function e(t){function n(r){return new Sw(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Qm(e,t,n){var r=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>t3){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>t3){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 SF(e,t){this._context=e,this._alpha=t}SF.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:Qm(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 d3=function e(t){function n(r){return t?new SF(r,t):new _w(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function IF(e,t){this._context=e,this._alpha=t}IF.prototype={areaStart:xi,areaEnd:xi,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:Qm(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 p3=function e(t){function n(r){return t?new IF(r,t):new vw(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function AF(e,t){this._context=e,this._alpha=t}AF.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:Qm(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 m3=function e(t){function n(r){return t?new AF(r,t):new Sw(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function MF(e){this._context=e}MF.prototype={areaStart:xi,areaEnd:xi,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 y3(e){return new MF(e)}function TF(e){return e<0?-1:1}function EF(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(TF(o)+TF(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function NF(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function g3(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 Iw(e){this._context=e}Iw.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:g3(this,this._t0,NF(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,g3(this,NF(this,n=EF(this,e,t)),n);break;default:g3(this,this._t0,n=EF(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function DF(e){this._context=new OF(e)}(DF.prototype=Object.create(Iw.prototype)).point=function(e,t){Iw.prototype.point.call(this,t,e)};function OF(e){this._context=e}OF.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 x3(e){return new Iw(e)}function b3(e){return new DF(e)}function LF(e){this._context=e}LF.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=BF(e),i=BF(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 BF(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 w3(e){return new LF(e)}function Aw(e,t){this._context=e,this._t=t}Aw.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 _3(e){return new Aw(e,.5)}function v3(e){return new Aw(e,0)}function S3(e){return new Aw(e,1)}var Km=e=>()=>e;function I3(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 Vr(e,t,n){this.k=e,this.x=t,this.y=n}Vr.prototype={constructor:Vr,scale:function(e){return e===1?this:new Vr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Vr(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 ty=new Vr(1,0,0);A3.prototype=Vr.prototype;function A3(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ty;return e.__zoom}function Mw(e){e.stopImmediatePropagation()}function Of(e){e.preventDefault(),e.stopImmediatePropagation()}function dQ(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function pQ(){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 CF(){return this.__zoom||ty}function mQ(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function yQ(){return navigator.maxTouchPoints||"ontouchstart"in this}function gQ(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 M3(){var e=dQ,t=pQ,n=gQ,r=mQ,i=yQ,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=KI,l=nl("start","zoom","end"),u,f,h,d=500,p=150,m=0,y=10;function g(S){S.property("__zoom",CF).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",D).filter(i).on("touchstart.zoom",I).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(S,M,N,R){var F=S.selection?S.selection():S;F.property("__zoom",CF),S!==F?v(S,M,N,R):F.interrupt().each(function(){_(this,arguments).event(R).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},g.scaleBy=function(S,M,N,R){g.scaleTo(S,function(){var F=this.__zoom.k,k=typeof M=="function"?M.apply(this,arguments):M;return F*k},N,R)},g.scaleTo=function(S,M,N,R){g.transform(S,function(){var F=t.apply(this,arguments),k=this.__zoom,$=N==null?w(F):typeof N=="function"?N.apply(this,arguments):N,P=k.invert($),U=typeof M=="function"?M.apply(this,arguments):M;return n(b(x(k,U),$,P),F,s)},N,R)},g.translateBy=function(S,M,N,R){g.transform(S,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof N=="function"?N.apply(this,arguments):N),t.apply(this,arguments),s)},null,R)},g.translateTo=function(S,M,N,R,F){g.transform(S,function(){var k=t.apply(this,arguments),$=this.__zoom,P=R==null?w(k):typeof R=="function"?R.apply(this,arguments):R;return n(ty.translate(P[0],P[1]).scale($.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof N=="function"?-N.apply(this,arguments):-N),k,s)},R,F)};function x(S,M){return M=Math.max(o[0],Math.min(o[1],M)),M===S.k?S:new Vr(M,S.x,S.y)}function b(S,M,N){var R=M[0]-N[0]*S.k,F=M[1]-N[1]*S.k;return R===S.x&&F===S.y?S:new Vr(S.k,R,F)}function w(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function v(S,M,N,R){S.on("start.zoom",function(){_(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(R).end()}).tween("zoom",function(){var F=this,k=arguments,$=_(F,k).event(R),P=t.apply(F,k),U=N==null?w(P):typeof N=="function"?N.apply(F,k):N,G=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),nt=F.__zoom,ot=typeof M=="function"?M.apply(F,k):M,at=c(nt.invert(U).concat(G/nt.k),ot.invert(U).concat(G/ot.k));return function(Y){if(Y===1)Y=ot;else{var st=at(Y),q=G/st[2];Y=new Vr(q,U[0]-st[0]*q,U[1]-st[1]*q)}$.zoom(null,Y)}})}function _(S,M,N){return!N&&S.__zooming||new A(S,M)}function A(S,M){this.that=S,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,M),this.taps=0}A.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,M){return this.mouse&&S!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var M=Yt(this.that).datum();l.call(S,this.that,new I3(S,{sourceEvent:this.sourceEvent,target:g,type:S,transform:this.that.__zoom,dispatch:l}),M)}};function E(S,...M){if(!e.apply(this,arguments))return;var N=_(this,M).event(S),R=this.__zoom,F=Math.max(o[0],Math.min(o[1],R.k*Math.pow(2,r.apply(this,arguments)))),k=Fn(S);if(N.wheel)(N.mouse[0][0]!==k[0]||N.mouse[0][1]!==k[1])&&(N.mouse[1]=R.invert(N.mouse[0]=k)),clearTimeout(N.wheel);else{if(R.k===F)return;N.mouse=[k,R.invert(k)],Eo(this),N.start()}Of(S),N.wheel=setTimeout($,p),N.zoom("mouse",n(b(x(R,F),N.mouse[0],N.mouse[1]),N.extent,s));function $(){N.wheel=null,N.end()}}function T(S,...M){if(h||!e.apply(this,arguments))return;var N=S.currentTarget,R=_(this,M,!0).event(S),F=Yt(S.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",G,!0),k=Fn(S,N),$=S.clientX,P=S.clientY;Dp(S.view),Mw(S),R.mouse=[k,this.__zoom.invert(k)],Eo(this),R.start();function U(nt){if(Of(nt),!R.moved){var ot=nt.clientX-$,at=nt.clientY-P;R.moved=ot*ot+at*at>m}R.event(nt).zoom("mouse",n(b(R.that.__zoom,R.mouse[0]=Fn(nt,N),R.mouse[1]),R.extent,s))}function G(nt){F.on("mousemove.zoom mouseup.zoom",null),Op(nt.view,R.moved),Of(nt),R.event(nt).end()}}function D(S,...M){if(e.apply(this,arguments)){var N=this.__zoom,R=Fn(S.changedTouches?S.changedTouches[0]:S,this),F=N.invert(R),k=N.k*(S.shiftKey?.5:2),$=n(b(x(N,k),R,F),t.apply(this,M),s);Of(S),a>0?Yt(this).transition().duration(a).call(v,$,R,S):Yt(this).call(g.transform,$,R,S)}}function I(S,...M){if(e.apply(this,arguments)){var N=S.touches,R=N.length,F=_(this,M,S.changedTouches.length===R).event(S),k,$,P,U;for(Mw(S),$=0;$<R;++$)P=N[$],U=Fn(P,this),U=[U,this.__zoom.invert(U),P.identifier],F.touch0?!F.touch1&&F.touch0[2]!==U[2]&&(F.touch1=U,F.taps=0):(F.touch0=U,k=!0,F.taps=1+!!u);u&&(u=clearTimeout(u)),k&&(F.taps<2&&(f=U[0],u=setTimeout(function(){u=null},d)),Eo(this),F.start())}}function O(S,...M){if(this.__zooming){var N=_(this,M).event(S),R=S.changedTouches,F=R.length,k,$,P,U;for(Of(S),k=0;k<F;++k)$=R[k],P=Fn($,this),N.touch0&&N.touch0[2]===$.identifier?N.touch0[0]=P:N.touch1&&N.touch1[2]===$.identifier&&(N.touch1[0]=P);if($=N.that.__zoom,N.touch1){var G=N.touch0[0],nt=N.touch0[1],ot=N.touch1[0],at=N.touch1[1],Y=(Y=ot[0]-G[0])*Y+(Y=ot[1]-G[1])*Y,st=(st=at[0]-nt[0])*st+(st=at[1]-nt[1])*st;$=x($,Math.sqrt(Y/st)),P=[(G[0]+ot[0])/2,(G[1]+ot[1])/2],U=[(nt[0]+at[0])/2,(nt[1]+at[1])/2]}else if(N.touch0)P=N.touch0[0],U=N.touch0[1];else return;N.zoom("touch",n(b($,P,U),N.extent,s))}}function L(S,...M){if(this.__zooming){var N=_(this,M).event(S),R=S.changedTouches,F=R.length,k,$;for(Mw(S),h&&clearTimeout(h),h=setTimeout(function(){h=null},d),k=0;k<F;++k)$=R[k],N.touch0&&N.touch0[2]===$.identifier?delete N.touch0:N.touch1&&N.touch1[2]===$.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&&($=Fn($,this),Math.hypot(f[0]-$[0],f[1]-$[1])<y)){var P=Yt(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return g.wheelDelta=function(S){return arguments.length?(r=typeof S=="function"?S:Km(+S),g):r},g.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Km(!!S),g):e},g.touchable=function(S){return arguments.length?(i=typeof S=="function"?S:Km(!!S),g):i},g.extent=function(S){return arguments.length?(t=typeof S=="function"?S:Km([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),g):t},g.scaleExtent=function(S){return arguments.length?(o[0]=+S[0],o[1]=+S[1],g):[o[0],o[1]]},g.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],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(S){return arguments.length?(n=S,g):n},g.duration=function(S){return arguments.length?(a=+S,g):a},g.interpolate=function(S){return arguments.length?(c=S,g):c},g.on=function(){var S=l.on.apply(l,arguments);return S===l?g:S},g.clickDistance=function(S){return arguments.length?(m=(S=+S)*S,g):Math.sqrt(m)},g.tapDistance=function(S){return arguments.length?(y=+S,g):y},g}function ze(e){return e!=null&&!Number.isNaN(e)}function mn(e,t){return+ze(t)-+ze(e)||Ot(e,t)}function Nl(e,t){return+ze(t)-+ze(e)||Jn(e,t)}function ey(e){return e!=null&&`${e}`!=""}function Bf(e){return isFinite(e)?e:NaN}function cr(e){return e>0&&isFinite(e)?e:NaN}function Ya(e){return e<0&&isFinite(e)?e:NaN}function Lf(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`${xQ(e.getUTCFullYear(),4)}-${Hs(e.getUTCMonth()+1,2)}-${Hs(e.getUTCDate(),2)}${n||r||i||o?`T${Hs(n,2)}:${Hs(r,2)}${i||o?`:${Hs(i,2)}${o?`.${Hs(o,3)}`:""}`:""}Z`:""}`}function xQ(e){return e<0?`-${Hs(-e,6)}`:e>9999?`+${Hs(e,6)}`:Hs(e,4)}function Hs(e,t){return`${e}`.padStart(t,"0")}var bQ=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function ny(e,t){return bQ.test(e+="")?new Date(e):typeof t=="function"?t(e):t}function Zs(e){if(e==null)return;let t=e[0],n=e[e.length-1];return Jn(t,n)}var kf=1e3,Ga=kf*60,Wa=Ga*60,qo=Wa*24,zo=qo*7,Dl=qo*30,Xa=qo*365,T3=[["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",kf],["5 seconds",5*kf],["15 seconds",15*kf],["30 seconds",30*kf],["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",qo],["2 days",2*qo],["week",zo],["2 weeks",2*zo],["month",Dl],["3 months",3*Dl],["6 months",6*Dl],["year",Xa],["2 years",2*Xa],["5 years",5*Xa],["10 years",10*Xa],["20 years",20*Xa],["50 years",50*Xa],["100 years",100*Xa]],E3=new Map([["second",kf],["minute",Ga],["hour",Wa],["day",qo],["monday",zo],["tuesday",zo],["wednesday",zo],["thursday",zo],["friday",zo],["saturday",zo],["sunday",zo],["week",zo],["month",Dl],["year",Xa]]),RF=new Map([["second",dn],["minute",zs],["hour",js],["day",mi],["monday",ja],["tuesday",Vb],["wednesday",Yb],["thursday",$o],["friday",Xb],["saturday",Gb],["sunday",qr],["week",qr],["month",Ys],["year",qn]]),N3=new Map([["second",dn],["minute",qs],["hour",Vs],["day",Al],["monday",Va],["tuesday",Wb],["wednesday",Hb],["thursday",Po],["friday",Zb],["saturday",Jb],["sunday",jr],["week",jr],["month",Xs],["year",jn]]),Rf=Symbol("intervalDuration"),Ew=Symbol("intervalType");for(let[e,t]of RF)t[Rf]=E3.get(e),t[Ew]="time";for(let[e,t]of N3)t[Rf]=E3.get(e),t[Ew]="utc";var ry=[["year",jn,"utc"],["month",Xs,"utc"],["day",Al,"utc",6*Dl],["hour",Vs,"utc",3*qo],["minute",qs,"utc",6*Wa],["second",dn,"utc",30*Ga]],Tw=[["year",qn,"time"],["month",Ys,"time"],["day",mi,"time",6*Dl],["hour",js,"time",3*qo],["minute",zs,"time",6*Wa],["second",dn,"time",30*Ga]],wQ=[ry[0],Tw[0],ry[1],Tw[1],ry[2],Tw[2],...ry.slice(3)];function Nw(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=N3.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 iy(e){return FF(Nw(e),"time")}function Ol(e){return FF(Nw(e),"utc")}function FF([e,t],n){let r=(n==="time"?RF:N3).get(e);return t>1&&(r=r.every(t),r[Rf]=E3.get(e)*t,r[Ew]=n),r}function D3(e,t){if(!(t>1))return;let n=e[Rf];if(!T3.some(([,i])=>i===n)||n%qo===0&&qo<n&&n<Dl)return;let[r]=T3[Pi(([,i])=>Math.log(i)).center(T3,Math.log(n*t))];return(e[Ew]==="time"?iy:Ol)(r)}function kF(e,t,n){let r=t==="time"?vf:Uo;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=_Q(n);switch(e){case"millisecond":return Cf(r(".%L"),r(":%M:%S"),i);case"second":return Cf(r(":%S"),r("%-I:%M"),i);case"minute":return Cf(r("%-I:%M"),r("%p"),i);case"hour":return Cf(r("%-I %p"),r("%b %-d"),i);case"day":return Cf(r("%-d"),r("%b"),i);case"month":return Cf(r("%b"),r("%Y"),i);case"year":return r("%Y")}throw new Error("unable to format time ticks")}function _Q(e){return e==="left"||e==="right"?(t,n)=>`
12
- ${t}
13
- ${n}`:e==="top"?(t,n)=>`${n}
14
- ${t}`:(t,n)=>`${t}
15
- ${n}`}function vQ(e){return e==="time"?Tw:e==="utc"?ry:wQ}function $F(e,t,n){let r=Jt(Sx(t,(i,o)=>Math.abs(o-i)));if(r<1e3)return kF("millisecond","utc",n);for(let[i,o,s,a]of vQ(e)){if(r>a||i==="hour"&&!r)break;if(t.every(c=>o.floor(c)>=c))return kF(i,s,n)}}function Cf(e,t,n){return(r,i,o)=>{let s=e(r,i),a=t(r,i),c=i-Zs(o);return i!==c&&o[c]!==void 0&&a===t(o[c],c)?s:n(s,a)}}var Bl=Object.getPrototypeOf(Uint8Array),SQ=Object.prototype.toString,O3=Symbol("reindex");function wt(e,t,n){let r=typeof t;return r==="string"?PF(e,B3(t),n):r==="function"?PF(e,t,n):r==="number"||t instanceof Date||r==="boolean"?Wt(e,yn(t),n):typeof t?.transform=="function"?UF(t.transform(e),n):IQ(UF(t,n),e?.[O3])}function IQ(e,t){return e!=null&&t?sy(e,t):e}function PF(e,t,n){return Wt(e,n?.prototype instanceof Bl?AQ(t):t,n)}function UF(e,t){return t===void 0?je(e):e instanceof t?e:t.prototype instanceof Bl&&!(e instanceof Bl)?t.from(e,L3):t.from(e)}function AQ(e){return(t,n)=>L3(e(t,n))}var Ha=[null],B3=e=>t=>t[e],Ne={transform:lr},H={transform:e=>e};var oy=()=>1,zF=()=>!0,qe=e=>e==null?e:`${e}`,Lt=e=>e==null?e:+e;var Ll=e=>e?e[0]:void 0,Za=e=>e?e[1]:void 0,qF=e=>e?e[2]:void 0,yn=e=>()=>e;function Ff(e){let t=+`${e}`.slice(1)/100;return(n,r)=>tr(n,t,r)}function en(e){return e instanceof Bl?e:Wt(e,L3,Float64Array)}function L3(e){return e==null?NaN:Number(e)}function jF(e){return Wt(e,C3)}function C3(e){return e instanceof Date&&!isNaN(e)?e:typeof e=="string"?ny(e):e==null||isNaN(e=+e)?void 0:new Date(e)}function Be(e,t){return e===void 0&&(e=t),e===null?[void 0,"none"]:Ka(e)?[void 0,e]:[e,void 0]}function ce(e,t){return e===void 0&&(e=t),e===null||typeof e=="number"?[void 0,e]:[e,void 0]}function k3(e,t,n){if(e!=null)return cn(e,t,n)}function cn(e,t,n){let r=`${e}`.toLowerCase();if(!n.includes(r))throw new Error(`invalid ${t}: ${e}`);return r}function je(e){return e==null||e instanceof Array||e instanceof Bl?e:Array.from(e)}function Wt(e,t,n=Array){return e==null?e:e instanceof n?e.map(t):n.from(e,t)}function Ja(e,t=Array){return e instanceof t?e.slice():t.from(e)}function R3({x:e,x1:t,x2:n}){return e!==void 0||t!==void 0||n!==void 0}function F3({y:e,y1:t,y2:n}){return e!==void 0||t!==void 0||n!==void 0}function $f(e){return R3(e)||F3(e)||e.interval!==void 0}function gn(e){return e?.toString===SQ}function jo(e){return gn(e)&&(e.type!==void 0||e.domain!==void 0)}function Yr(e){return gn(e)&&typeof e.transform!="function"}function Vo(e){return Yr(e)&&e.value===void 0&&e.channel===void 0}function $3(e,t,n,r=H){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 $e(e,t){return e===void 0&&t===void 0?[Ll,Za]:[e,t]}function Vn({z:e,fill:t,stroke:n}={}){return e===void 0&&([e]=Be(t)),e===void 0&&([e]=Be(n)),e}function lr(e){let t=e.length,n=new Uint32Array(t);for(let r=0;r<t;++r)n[r]=r;return n}function sy(e,t){return Wt(t,n=>e[n],e.constructor)}function Pf(e){return e.length===1?(t,n)=>e(sy(n,t)):e}function Js(e,t,n){return e.subarray?e.subarray(t,n):e.slice(t,n)}function Qs(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Dw(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 xn(e){let t;return[{transform:()=>t,label:Cn(e)},n=>t=n]}function Ln(e){return e==null?[e]:xn(e)}function Cn(e,t){return typeof e=="string"?e:e&&e.label!==void 0?e.label:t}function Uf(e,t){return{transform(n){let r=e.transform(n),i=t.transform(n);return Le(r)||Le(i)?Wt(r,(o,s)=>new Date((+r[s]+ +i[s])/2)):Wt(r,(o,s)=>(+r[s]+ +i[s])/2,Float64Array)},label:e.label}}function Cl(e,t){let n=P3(t?.interval,t?.type);return n?Wt(e,n):e}function P3(e,t){let n=zf(e,t);return n&&(r=>ze(r)?n.floor(r):r)}function zf(e,t){if(e!=null){if(typeof e=="number")return U3(e);if(typeof e=="string")return(t==="time"?iy:Ol)(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 U3(e){e=+e,0<e&&e<1&&Number.isInteger(1/e)&&(e=-1/e);let t=Math.abs(e);return e<0?{floor:n=>Math.floor(n*t)/t,offset:(n,r=1)=>(n*t+Math.floor(r))/t,range:(n,r)=>Ue(Math.ceil(n*t),r*t).map(i=>i/t)}:{floor:n=>Math.floor(n/t)*t,offset:(n,r=1)=>n+t*Math.floor(r),range:(n,r)=>Ue(Math.ceil(n/t),r/t).map(i=>i*t)}}function Yo(e,t){if(e=zf(e,t),e&&typeof e.range!="function")throw new Error("invalid interval: missing range method");return e}function VF(e,t){if(e=Yo(e,t),e&&typeof e.ceil!="function")throw new Error("invalid interval: missing ceil method");return e}function YF(e){return Qa(e)&&typeof e?.floor=="function"&&e.floor()instanceof Date}function Qa(e){return typeof e?.range=="function"}function bi(e){return e===void 0||Yr(e)?e:{value:e}}function XF(e){return e==null?null:{transform:t=>wt(t,e,Float64Array),label:Cn(e)}}function GF(e){if(!ur(e))return!1;for(let t of e)if(t!=null)return typeof t=="object"&&"0"in t&&"1"in t}function ur(e){return e&&typeof e[Symbol.iterator]=="function"}function Ow(e){for(let t of e)if(t!=null)return typeof t!="object"||t instanceof Date}function De(e){for(let t of e){if(t==null)continue;let n=typeof t;return n==="string"||n==="boolean"}}function Le(e){for(let t of e)if(t!=null)return t instanceof Date}function WF(e){for(let t of e)if(t!=null)return typeof t=="string"&&isNaN(t)&&ny(t)}function HF(e){for(let t of e)if(t!=null){if(typeof t!="string")return!1;if(t.trim())return!isNaN(t)}}function Ks(e){for(let t of e)if(t!=null)return typeof t=="number"}function Bw(e,t){let n;for(let r of e)if(r!=null){if(!t(r))return!1;n=!0}return n}var MQ=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)||MQ.has(e))}function ZF(e){return typeof e=="number"&&(0<=e&&e<=1||isNaN(e))}function oe(e){return e==null||ta(e)}function ta(e){return/^\s*none\s*$/i.test(e)}function JF(e){return/^\s*round\s*$/i.test(e)}function Lw(e,t){return k3(e,t,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function Xo(e="middle"){return Lw(e,"frameAnchor")}function QF(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 TQ(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 ay(e){return ur(e)?TQ(e):e}function Cw(e){return e===!0?e="frame":e===!1?e=null:e!=null&&(e=cn(e,"clip",["frame","sphere"])),e}var wi=Symbol("position"),Xr=Symbol("color"),kl=Symbol("radius"),Rl=Symbol("length"),Fl=Symbol("opacity"),qf=Symbol("symbol"),KF=Symbol("projection"),pe=new Map([["x",wi],["y",wi],["fx",wi],["fy",wi],["r",kl],["color",Xr],["opacity",Fl],["symbol",qf],["length",Rl],["projection",KF]]);function t7(e){return e===wi||e===KF}function e7(e){return e===wi||e===kl||e===Rl||e===Fl}var z3=Math.sqrt(3),q3=2/z3,EQ={draw(e,t){let n=Math.sqrt(t/Math.PI),r=n*q3,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()}},j3=new Map([["asterisk",Um],["circle",Ws],["cross",zm],["diamond",qm],["diamond2",jm],["hexagon",EQ],["plus",Vm],["square",Ym],["square2",Xm],["star",Gm],["times",Ef],["triangle",Wm],["triangle2",Hm],["wye",Zm]]);function V3(e){return e&&typeof e.draw=="function"}function n7(e){return V3(e)?!0:typeof e!="string"?!1:j3.has(e.toLowerCase())}function jf(e){if(e==null||V3(e))return e;let t=j3.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid symbol: ${e}`)}function r7(e){if(e==null||V3(e))return[void 0,e];if(typeof e=="string"){let t=j3.get(`${e}`.toLowerCase());if(t)return[void 0,t]}return[e,void 0]}function bn({filter:e,sort:t,reverse:n,transform:r,initializer:i,...o}={},s){if(r===void 0&&(e!=null&&(r=G3(e)),t!=null&&!Vo(t)&&(r=Y3(r,H3(t))),n&&(r=Y3(r,W3))),s!=null&&i!=null)throw new Error("transforms cannot be applied after initializers");return{...o,...(t===null||Vo(t))&&{sort:t},transform:Y3(r,s)}}function Me({filter:e,sort:t,reverse:n,initializer:r,...i}={},o){return r===void 0&&(e!=null&&(r=G3(e)),t!=null&&!Vo(t)&&(r=X3(r,H3(t))),n&&(r=X3(r,W3))),{...i,...(t===null||Vo(t))&&{sort:t},initializer:X3(r,o)}}function Y3(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,je(n),r,i)}}function X3(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 kw(e,t){return(e.initializer!=null?Me:bn)(e,t)}function i7(e,t){return kw(t,G3(e))}function G3(e){return(t,n)=>{let r=wt(t,e);return{data:t,facets:n.map(i=>i.filter(o=>r[o]))}}}function o7({sort:e,...t}={}){return{...kw(t,W3),sort:Vo(e)?e:null}}function W3(e,t){return{data:e,facets:t.map(n=>n.slice().reverse())}}function s7({seed:e,sort:t,...n}={}){return{...kw(n,a7(e==null?Math.random:bl(e))),sort:Vo(t)?t:null}}function Rw(e,{sort:t,...n}={}){return{...(Yr(e)&&e.channel!==void 0?Me:kw)(n,H3(e)),sort:Vo(t)?t:null}}function H3(e){return(typeof e=="function"&&e.length!==1?NQ:a7)(e)}function NQ(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 a7(e){let t,n;({channel:t,value:e,order:n}={...bi(e)});let r=t?.startsWith("-");if(r&&(t=t.slice(1)),n===void 0&&(n=r?Nl:mn),typeof n!="function")switch(`${n}`.toLowerCase()){case"ascending":n=mn;break;case"descending":n=Nl;break;default:throw new Error(`invalid order: ${n}`)}return(i,o,s)=>{let a;if(t===void 0)a=wt(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 ly(e,t){return Fw(null,null,e,t)}function ec(e={y:"count"},t={}){let{x:n=H}=t;if(n==null)throw new Error("missing channel: x");return Fw(n,null,e,t)}function nc(e={x:"count"},t={}){let{y:n=H}=t;if(n==null)throw new Error("missing channel: y");return Fw(null,n,e,t)}function uy(e={fill:"count"},t={}){let{x:n,y:r}=t;if([n,r]=$e(n,r),n==null)throw new Error("missing channel: x");if(r==null)throw new Error("missing channel: y");return Fw(n,r,e,t)}function Fw(e,t,{data:n=Uw,filter:r,sort:i,reverse:o,...s}={},a={}){s=J3(s,a),n=h7(n,H),i=i==null?void 0:u7("sort",i,a),r=r==null?void 0:f7("filter",r,a);let[c,l]=Ln(e),[u,f]=Ln(t),{z:h,fill:d,stroke:p,x1:m,x2:y,y1:g,y2:x,...b}=a,[w,v]=Ln(h),[_]=Be(d),[A]=Be(p),[E,T]=Ln(_),[D,I]=Ln(A);return{..."z"in a&&{z:w||h},..."fill"in a&&{fill:E||d},..."stroke"in a&&{stroke:D||p},...bn(b,(O,L,S)=>{let M=Cl(wt(O,e),S?.x),N=Cl(wt(O,t),S?.y),R=wt(O,h),F=wt(O,_),k=wt(O,A),$=fy(s,{z:R,fill:F,stroke:k}),P=[],U=[],G=M&&l([]),nt=N&&f([]),ot=R&&v([]),at=F&&T([]),Y=k&&I([]),st=0;for(let q of s)q.initialize(O);i&&i.initialize(O),r&&r.initialize(O);for(let q of L){let Z=[];for(let rt of s)rt.scope("facet",q);i&&i.scope("facet",q),r&&r.scope("facet",q);for(let[rt,z]of tc(q,$))for(let[Ft,ht]of tc(z,N))for(let[Ht,Qt]of tc(ht,M)){let tt={data:O};if(M&&(tt.x=Ht),N&&(tt.y=Ft),$&&(tt.z=rt),!(r&&!r.reduce(Qt,tt))){Z.push(st++),U.push(n.reduceIndex(Qt,O,tt)),M&&G.push(Ht),N&&nt.push(Ft),R&&ot.push($===R?rt:R[Qt[0]]),F&&at.push($===F?rt:F[Qt[0]]),k&&Y.push($===k?rt:k[Qt[0]]);for(let le of s)le.reduce(Qt,tt);i&&i.reduce(Qt,tt)}}P.push(Z)}return Q3(P,i,o),{data:U,facets:P}}),...!Go(s,"x")&&(c?{x:c}:{x1:m,x2:y}),...!Go(s,"y")&&(u?{y:u}:{y1:g,y2:x}),...Object.fromEntries(s.map(({name:O,output:L})=>[O,L]))}}function Go(e,...t){for(let{name:n}of e)if(t.includes(n))return!0;return!1}function Z3(e,t,n=$w){let r=Object.entries(e);return t.title!=null&&e.title===void 0&&r.push(["title",kQ]),t.href!=null&&e.href===void 0&&r.push(["href",zw]),r.filter(([,i])=>i!==void 0).map(([i,o])=>o===null?DQ(i):n(i,o,t))}function $w(e,t,n,r=Pw){let i;gn(t)&&"reduce"in t&&(i=t.scale,t=t.reduce);let o=r(e,t,n),[s,a]=xn(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 DQ(e){return{name:e,initialize(){},scope(){},reduce(){}}}function Pw(e,t,n,r=Vf){let i=Dw(e,n),o=r(t,i),s,a;return{label:Cn(o===cy?null:i,o.label),initialize(c){s=i===void 0?c:wt(c,i),o.scope==="data"&&(a=o.reduceIndex(lr(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 tc(e,t){return t?fn(e,n=>t[n]):[[,e]]}function Vf(e,t,n=OQ){if(e==null)return n(e);if(typeof e.reduceIndex=="function")return e;if(typeof e.reduce=="function"&&gn(e))return LQ(e);if(typeof e=="function")return CQ(e);if(/^p\d{2}$/i.test(e))return ea(Ff(e));switch(`${e}`.toLowerCase()){case"first":return zw;case"last":return RQ;case"identity":return Uw;case"count":return cy;case"distinct":return FQ;case"sum":return t==null?cy:$Q;case"proportion":return l7(t,"data");case"proportion-facet":return l7(t,"facet");case"deviation":return ea(ci);case"min":return ea(he);case"min-index":return ea(wx);case"max":return ea(Jt);case"max-index":return ea(bx);case"mean":return c7(Ds);case"median":return c7(zi);case"variance":return ea(Na);case"mode":return ea(Yu)}return n(e)}function OQ(e){throw new Error(`invalid reduce: ${e}`)}function J3(e,t){return Z3(e,t,u7)}function u7(e,t,n){return $w(e,t,n,f7)}function f7(e,t,n){return Pw(e,t,n,h7)}function h7(e,t){return Vf(e,t,BQ)}function BQ(e){switch(`${e}`.toLowerCase()){case"x":return PQ;case"y":return UQ;case"z":return K3}throw new Error(`invalid group reduce: ${e}`)}function fy(e,t){for(let n in t){let r=t[n];if(r!==void 0&&!e.some(i=>i.name===n))return r}}function Q3(e,t,n){if(t){let r=t.output.transform(),i=(o,s)=>mn(r[o],r[s]);e.forEach(o=>o.sort(i))}n&&e.forEach(r=>r.reverse())}function LQ(e){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...e,reduceIndex:e.reduce.bind(e)}}function CQ(e){return{reduceIndex(t,n,r){return e(sy(n,t),r)}}}function ea(e){return{reduceIndex(t,n){return e(t,r=>n[r])}}}function c7(e){return{reduceIndex(t,n){let r=e(t,i=>n[i]);return Le(n)?new Date(r):r}}}var Uw={reduceIndex(e,t){return sy(t,e)}},zw={reduceIndex(e,t){return t[e[0]]}},kQ={reduceIndex(e,t){let r=Es(Ui(e,o=>o.length,o=>t[o]),Za),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`,Nn(o,Za)]}return i.map(([o,s])=>`${o} (${s.toLocaleString("en-US")})`).join(`
16
- `)}},RQ={reduceIndex(e,t){return t[e[e.length-1]]}},cy={label:"Frequency",reduceIndex(e){return e.length}},FQ={label:"Distinct",reduceIndex(e,t){let n=new Kn;for(let r of e)n.add(t[r]);return n.size}},$Q=ea(Nn);function l7(e,t){return e==null?{scope:t,label:"Frequency",reduceIndex:(n,r,i=1)=>n.length/i}:{scope:t,reduceIndex:(n,r,i=1)=>Nn(n,o=>r[o])/i}}var PQ={reduceIndex(e,t,{x:n}){return n}},UQ={reduceIndex(e,t,{y:n}){return n}},K3={reduceIndex(e,t,{z:n}){return n}};function d7(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 Yf(e,{scale:t,type:n,value:r,filter:i,hint:o,label:s=Cn(r)},a){return o===void 0&&typeof r?.transform=="function"&&(o=r.hint),eT(a,{scale:t,type:n,value:wt(e,r),label:s,filter:i,hint:o})}function qw(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,Yf(t,r,n)]))}function Xf(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:Wt(o,s)]}));return n.channels=e,n}function eT(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&&Bw(r,Ka)?null:"color";break;case"fillOpacity":case"strokeOpacity":case"opacity":t.scale=n!==!0&&Bw(r,ZF)?null:"opacity";break;case"symbol":n!==!0&&Bw(r,n7)?(t.scale=null,t.value=Wt(r,jf)):t.scale="symbol";break;default:t.scale=pe.has(e)?e:null;break}else if(n===!1)t.scale=null;else if(n!=null&&!pe.has(n))throw new Error(`unknown scale: ${n}`);return t}function m7(e,t,n,r,i){let{order:o,reverse:s,reduce:a=!0,limit:c}=i;for(let l in i){if(!pe.has(l))continue;let{value:u,order:f=o,reverse:h=s,reduce:d=a,limit:p=c}=bi(i[l]),m=u?.startsWith("-");if(m&&(u=u.slice(1)),f=f===void 0?m!==(u==="width"||u==="height")?g7:y7:jQ(f),d==null||d===!1)continue;let y=l==="fx"||l==="fy"?qQ(t,r[l]):zQ(n,l);if(!y)throw new Error(`missing channel for scale: ${l}`);let g=y.value,[x=0,b=1/0]=ur(p)?p:p<0?[p]:[0,p];if(u==null)y.domain=()=>{let w=Array.from(new Kn(g));return h&&(w=w.reverse()),(x!==0||b!==1/0)&&(w=w.slice(x,b)),w};else{let w=u==="data"?e:u==="height"?p7(n,"y1","y2"):u==="width"?p7(n,"x1","x2"):tT(n,u,u==="y"?"y2":u==="x"?"x2":void 0),v=Vf(d===!0?"max":d,w);y.domain=()=>{let _=EI(lr(g),A=>v.reduceIndex(A,w),A=>g[A]);return f&&_.sort(f),h&&_.reverse(),(x!==0||b!==1/0)&&(_=_.slice(x,b)),_.map(Ll)}}}}function zQ(e,t){for(let n in e){let r=e[n];if(r.scale===t)return r}}function qQ(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 p7(e,t,n){let r=tT(e,t),i=tT(e,n);return Wt(i,(o,s)=>Math.abs(o-r[s]),Float64Array)}function tT(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 jQ(e){if(e==null||typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"ascending":return y7;case"descending":return g7}throw new Error(`invalid order: ${e}`)}function y7([e,t],[n,r]){return mn(t,r)||mn(e,n)}function g7([e,t],[n,r]){return Nl(t,r)||mn(e,n)}function hy(e,t){let n=e[t];if(n){for(;n.source;)n=n.source;return n.source===null?null:n}}var v7=new Map([["accent",jM],["category10",qM],["dark2",VM],["observable10",YM],["paired",XM],["pastel1",GM],["pastel2",WM],["set1",HM],["set2",ZM],["set3",JM],["tableau10",QM]]);function S7(e){return e!=null&&v7.has(`${e}`.toLowerCase())}var x7=new Map([...v7,["brbg",na(o1,s1)],["prgn",na(a1,c1)],["piyg",na(l1,u1)],["puor",na(f1,h1)],["rdbu",na(Rm,Sf)],["rdgy",na(d1,p1)],["rdylbu",na(Fm,If)],["rdylgn",na(m1,y1)],["spectral",na(g1,x1)],["burd",b7(Rm,Sf)],["buylrd",b7(Fm,If)],["blues",wn(j1,V1)],["greens",wn(Y1,X1)],["greys",wn(G1,W1)],["oranges",wn(K1,tw)],["purples",wn(H1,Z1)],["reds",wn(J1,Q1)],["turbo",ra(lw)],["viridis",ra(fw)],["magma",ra(hw)],["inferno",ra(dw)],["plasma",ra(pw)],["cividis",ra(ew)],["cubehelix",ra(nw)],["warm",ra(iw)],["cool",ra(ow)],["bugn",wn(b1,w1)],["bupu",wn(_1,v1)],["gnbu",wn(S1,I1)],["orrd",wn(A1,M1)],["pubu",wn(N1,D1)],["pubugn",wn(T1,E1)],["purd",wn(O1,B1)],["rdpu",wn(L1,C1)],["ylgn",wn(F1,$1)],["ylgnbu",wn(k1,R1)],["ylorbr",wn(P1,U1)],["ylorrd",wn(z1,q1)],["rainbow",w7(sw)],["sinebow",w7(cw)]]);function wn(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?$n(t,n):e[n])}function na(e,t){return({length:n})=>n===2?[e[3][0],e[3][2]]:(n=Math.max(3,Math.floor(n)),n>11?$n(t,n):e[n])}function b7(e,t){return({length:n})=>n===2?[e[3][2],e[3][0]]:(n=Math.max(3,Math.floor(n)),n>11?$n(r=>t(1-r),n):e[n].slice().reverse())}function ra(e){return({length:t})=>$n(e,Math.max(2,Math.floor(t)))}function w7(e){return({length:t})=>$n(e,Math.floor(t)+1).slice(0,-1)}function nT(e){let t=`${e}`.toLowerCase();if(!x7.has(t))throw new Error(`unknown ordinal scheme: ${t}`);return x7.get(t)}function dy(e,t){let n=nT(e),r=typeof n=="function"?n({length:t}):n;return r.length!==t?r.slice(0,t):r}function I7(e,t="greys"){let n=new Set,[r,i]=dy(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 _7=new Map([["brbg",s1],["prgn",c1],["piyg",u1],["puor",h1],["rdbu",Sf],["rdgy",p1],["rdylbu",If],["rdylgn",y1],["spectral",x1],["burd",e=>Sf(1-e)],["buylrd",e=>If(1-e)],["blues",V1],["greens",X1],["greys",W1],["purples",Z1],["reds",Q1],["oranges",tw],["turbo",lw],["viridis",fw],["magma",hw],["inferno",dw],["plasma",pw],["cividis",ew],["cubehelix",nw],["warm",iw],["cool",ow],["bugn",w1],["bupu",v1],["gnbu",I1],["orrd",M1],["pubugn",E1],["pubu",D1],["purd",B1],["rdpu",C1],["ylgnbu",R1],["ylgn",$1],["ylorbr",U1],["ylorrd",q1],["rainbow",sw],["sinebow",cw]]);function Gf(e){let t=`${e}`.toLowerCase();if(!_7.has(t))throw new Error(`unknown quantitative scheme: ${t}`);return _7.get(t)}var VQ=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function A7(e){return e!=null&&VQ.has(`${e}`.toLowerCase())}var iT=e=>t=>e(1-t),rT=[0,1],M7=new Map([["number",Ie],["rgb",ui],["hsl",tA],["hcl",eA],["lab",qx]]);function oT(e){let t=`${e}`.toLowerCase();if(!M7.has(t))throw new Error(`unknown interpolator: ${t}`);return M7.get(t)}function Hf(e,t,n,{type:r,nice:i,clamp:o,zero:s,domain:a=C7(e,n),unknown:c,round:l,scheme:u,interval:f,range:h=pe.get(e)===kl?WQ(n,a):pe.get(e)===Rl?HQ(n,a):pe.get(e)===Fl?rT:void 0,interpolate:d=pe.get(e)===Xr?u==null&&h!==void 0?ui:Gf(u!==void 0?u:r==="cyclical"?"rainbow":"turbo"):l?cl:Ie,reverse:p}){if(f=Yo(f,r),(r==="cyclical"||r==="sequential")&&(r="linear"),typeof d!="function"&&(d=oT(d)),p=!!p,h!==void 0){let m=(a=je(a)).length,y=(h=je(h)).length;if(m!==y){if(d.length===1)throw new Error("invalid piecewise interpolator");d=To(d,h),h=void 0}}if(d.length===1?(p&&(d=iT(d),p=!1),h===void 0&&(h=Float64Array.from(a,(m,y)=>y/(a.length-1)),h.length===2&&(h=rT)),t.interpolate((h===rT?yn:py)(d))):t.interpolate(d),s){let[m,y]=fe(a);(m>0||y<0)&&(a=Ja(a),(Zs(a)||1)===Math.sign(m)?a[0]=0:a[a.length-1]=0)}return p&&(a=Oa(a)),t.domain(a).unknown(c),i&&(t.nice(YQ(i,r)),a=t.domain()),h!==void 0&&t.range(h),o&&t.clamp(o),{type:r,domain:a,range:h,scale:t,interpolate:d,interval:f}}function YQ(e,t){return e===!0?void 0:typeof e=="number"?e:VF(e,t)}function T7(e,t,n){return Hf(e,Us(),t,n)}function E7(e,t,n){return sT(e,t,{...n,exponent:.5})}function sT(e,t,{exponent:n=1,...r}){return Hf(e,Am().exponent(n),t,{...r,type:"pow"})}function N7(e,t,{base:n=10,domain:r=ZQ(t),...i}){return Hf(e,Sm().base(n),t,{...i,domain:r})}function D7(e,t,{constant:n=1,...r}){return Hf(e,Im().constant(n),t,r)}function O7(e,t,{range:n,quantiles:r=n===void 0?5:(n=[...n]).length,n:i=r,scheme:o="rdylbu",domain:s=JQ(t),unknown:a,interpolate:c,reverse:l}){return n===void 0&&(n=c!==void 0?$n(c,i):pe.get(e)===Xr?dy(o,i):void 0),s.length>0&&(s=Mm(s,n===void 0?{length:i}:n).quantiles()),jw(e,t,{domain:s,range:n,reverse:l,unknown:a})}function B7(e,t,{range:n,n:r=n===void 0?5:(n=[...n]).length,scheme:i="rdylbu",domain:o=C7(e,t),unknown:s,interpolate:a,reverse:c}){let[l,u]=fe(o),f;return n===void 0?(f=En(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?$n(a,r):pe.get(e)===Xr?dy(i,r):void 0):(f=$n(Ie(l,u),r+1).slice(1,-1),l instanceof Date&&(f=f.map(h=>new Date(h)))),Zs(je(o))<0&&f.reverse(),jw(e,t,{domain:f,range:n,reverse:c,unknown:s})}function jw(e,t,{domain:n=[0],unknown:r,scheme:i="rdylbu",interpolate:o,range:s=o!==void 0?$n(o,n.length+1):pe.get(e)===Xr?dy(i,n.length+1):void 0,reverse:a}){n=je(n);let c=Zs(n);if(!isNaN(c)&&!XQ(n,c))throw new Error(`the ${e} scale has a non-monotonic domain`);return a&&(s=Oa(s)),{type:"threshold",scale:Tm(c<0?Oa(n):n,s===void 0?[]:s).unknown(r),domain:n,range:s}}function XQ(e,t){for(let n=1,r=e.length,i=e[0];n<r;++n){let o=Jn(i,i=e[n]);if(o!==0&&o!==t)return!1}return!0}function L7(e){return{type:"identity",scale:e7(pe.get(e))?_m():t=>t}}function Wf(e,t=Bf){return e.length?[he(e,({value:n})=>n===void 0?n:he(n,t)),Jt(e,({value:n})=>n===void 0?n:Jt(n,t))]:[0,1]}function C7(e,t){let n=pe.get(e);return(n===kl||n===Fl||n===Rl?GQ:Wf)(t)}function GQ(e){return[0,e.length?Jt(e,({value:t})=>t===void 0?t:Jt(t,Bf)):1]}function WQ(e,t){let n=e.find(({radius:s})=>s!==void 0);if(n!==void 0)return[0,n.radius];let r=tr(e,.5,({value:s})=>s===void 0?NaN:tr(s,.25,cr)),i=t.map(s=>3*Math.sqrt(s/r)),o=30/Jt(i);return o<1?i.map(s=>s*o):i}function HQ(e,t){let n=zi(e,({value:o})=>o===void 0?NaN:zi(o,Math.abs)),r=t.map(o=>12*o/n),i=60/Jt(r);return i<1?r.map(o=>o*i):r}function ZQ(e){for(let{value:t}of e)if(t!==void 0)for(let n of t){if(n>0)return Wf(e,cr);if(n<0)return Wf(e,Ya)}return[1,10]}function JQ(e){let t=[];for(let{value:n}of e)if(n!==void 0)for(let r of n)t.push(r);return t}function py(e){return(t,n)=>r=>e(t+r*(n-t))}var aT=0,cT;function k7(){let e=aT;return aT=0,cT=void 0,e}function Yn(e){e!==cT&&(cT=e,console.warn(e),++aT)}function Vw(e,t,n,r,{type:i,nice:o,clamp:s,domain:a=Wf(r),unknown:c,pivot:l=0,scheme:u,range:f,symmetric:h=!0,interpolate:d=pe.get(e)===Xr?u==null&&f!==void 0?ui:Gf(u!==void 0?u:"rdbu"):Ie,reverse:p}){l=+l,a=je(a);let[m,y]=a;if(a.length>2&&Yn(`Warning: the diverging ${e} scale domain contains extra elements.`),Jn(m,y)<0&&([m,y]=[y,m],p=!p),m=Math.min(m,l),y=Math.max(y,l),typeof d!="function"&&(d=oT(d)),f!==void 0&&(d=d.length===1?py(d)(...f):To(d,f)),p&&(d=iT(d)),h){let g=n.apply(l),x=g-n.apply(m),b=n.apply(y)-g;x<b?m=n.invert(g-b):x>b&&(y=n.invert(g+x))}return t.domain([m,l,y]).unknown(c).interpolator(d),s&&t.clamp(s),o&&t.nice(o),{type:i,domain:[m,y],pivot:l,interpolate:d,scale:t}}function R7(e,t,n){return Vw(e,km(),QQ,t,n)}function F7(e,t,n){return lT(e,t,{...n,exponent:.5})}function lT(e,t,{exponent:n=1,...r}){return Vw(e,i1().exponent(n=+n),eK(n),t,{...r,type:"diverging-pow"})}function $7(e,t,{base:n=10,pivot:r=1,domain:i=Wf(t,r<0?Ya:cr),...o}){return Vw(e,n1().base(n=+n),KQ,t,{domain:i,pivot:r,...o})}function P7(e,t,{constant:n=1,...r}){return Vw(e,r1().constant(n=+n),nK(n),t,r)}var QQ={apply(e){return e},invert(e){return e}},KQ={apply:Math.log,invert:Math.exp},tK={apply(e){return Math.sign(e)*Math.sqrt(Math.abs(e))},invert(e){return Math.sign(e)*(e*e)}};function eK(e){return e===.5?tK:{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 nK(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 U7(e,t,n,r){return Hf(e,t,n,r)}function z7(e,t,n){return U7(e,Kb(),t,n)}function q7(e,t,n){return U7(e,t1(),t,n)}var Zf=Symbol("ordinal");function V7(e,t,n,{type:r,interval:i,domain:o,range:s,reverse:a,hint:c}){return i=Yo(i,r),o===void 0&&(o=H7(n,i,e)),(r==="categorical"||r===Zf)&&(r="ordinal"),a&&(o=Oa(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 Y7(e,t,{type:n,interval:r,domain:i,range:o,scheme:s,unknown:a,...c}){r=Yo(r,n),i===void 0&&(i=H7(t,r,e));let l;if(pe.get(e)===qf)l=rK(t),o=o===void 0?iK(l):Wt(o,jf);else if(pe.get(e)===Xr&&(o===void 0&&(n==="ordinal"||n===Zf)&&(o=I7(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=Gf(s),f=o[0],h=o[1]-o[0];o=({length:d})=>$n(p=>u(f+h*p),d)}else o=nT(s);if(a===bm)throw new Error(`implicit unknown on ${e} scale is not supported`);return V7(e,wl().unknown(a),t,{...c,type:n,domain:i,range:o,hint:l})}function X7(e,t,{align:n=.5,padding:r=.5,...i}){return W7(MM().align(n).padding(r),t,i,e)}function G7(e,t,{align:n=.5,padding:r=.1,paddingInner:i=r,paddingOuter:o=e==="fx"||e==="fy"?0:r,...s}){return W7(qa().align(n).paddingInner(i).paddingOuter(o),t,s,e)}function W7(e,t,n,r){let{round:i}=n;return i!==void 0&&e.round(i=!!i),e=V7(r,e,t,n),e.round=i,e}function H7(e,t,n){let r=new Kn;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]=fe(r).map(t.floor,t);return t.range(i,t.offset(o))}if(r.size>1e4&&pe.get(n)===wi)throw new Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return Es(r,mn)}function j7(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 rK(e){return{fill:j7(e,"fill"),stroke:j7(e,"stroke")}}function iK(e){return oe(e.fill)?o3:ww}function my(e,{label:t,inset:n=0,insetTop:r=n,insetRight:i=n,insetBottom:o=n,insetLeft:s=n,round:a,nice:c,clamp:l,zero:u,align:f,padding:h,projection:d,facet:{label:p=t}={},...m}={}){let y={};for(let[g,x]of e){let b=m[g],w=r$(g,x,{round:pe.get(g)===wi?a:void 0,nice:c,clamp:l,zero:u,align:f,padding:h,projection:d,...b});if(w){let{label:v=g==="fx"||g==="fy"?p:t,percent:_,transform:A,inset:E,insetTop:T=E!==void 0?E:g==="y"?r:0,insetRight:D=E!==void 0?E:g==="x"?i:0,insetBottom:I=E!==void 0?E:g==="y"?o:0,insetLeft:O=E!==void 0?E:g==="x"?s:0}=b||{};if(A==null)A=void 0;else if(typeof A!="function")throw new Error("invalid scale transform; not a function");w.percent=!!_,w.label=v===void 0?oK(x,w):v,w.transform=A,g==="x"||g==="fx"?(w.insetLeft=+O,w.insetRight=+D):(g==="y"||g==="fy")&&(w.insetTop=+T,w.insetBottom=+I),y[g]=w}}return y}function fT(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]=o$(i),n[r]=o,o.type=s,a!=null&&(o.interval=a),c!=null&&(o.label=c)}return n}function t$(e,t){let{x:n,y:r,fx:i,fy:o}=e,s=i||o?Gw(t):t;i&&Z7(i,s),o&&J7(o,s);let a=i||o?hT(e,t):t;n&&Z7(n,a),r&&J7(r,a)}function oK(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!Wo(t)&&t.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function Xw(e){return Math.sign(Zs(e.domain()))*Math.sign(Zs(e.range()))}function Gw(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 hT({fx:e,fy:t},n){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:a,height:c}=Gw(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 Z7(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)],Wo(e)||(e.range=n$(e)),e.scale.range(e.range)}e$(e)}function J7(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],Wo(e)?e.range.reverse():e.range=n$(e),e.scale.range(e.range)}e$(e)}function e$(e){e.round===void 0&&cK(e)&&sK(e)<=30&&e.scale.round(!0)}function sK({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 n$(e){let t=e.scale.domain().length+dT(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 Ww(e,t,n){return r$(e,n===void 0?void 0:[{hint:n}],{...t})}function r$(e,t=[],n={}){let r=aK(e,t,n);if(n.type===void 0&&n.domain===void 0&&n.range===void 0&&n.interval==null&&e!=="fx"&&e!=="fy"&&Wo({type:r})){let i=t.map(({value:o})=>o).filter(o=>o!==void 0);i.some(Le)?Yn(`Warning: some data associated with the ${e} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${Jf(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 "${Jf(r)}".`):i.some(WF)?Yn(`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 "${Jf(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 "${Jf(r)}".`):i.some(HF)&&Yn(`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 "${Jf(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 "${Jf(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=Yw(t,n,en);break;case"identity":switch(pe.get(e)){case wi:n=Yw(t,n,en);break;case qf:n=Yw(t,n,lK);break}break;case"utc":case"time":n=Yw(t,n,jF);break}switch(r){case"diverging":return R7(e,t,n);case"diverging-sqrt":return F7(e,t,n);case"diverging-pow":return lT(e,t,n);case"diverging-log":return $7(e,t,n);case"diverging-symlog":return P7(e,t,n);case"categorical":case"ordinal":case Zf:return Y7(e,t,n);case"cyclical":case"sequential":case"linear":return T7(e,t,n);case"sqrt":return E7(e,t,n);case"threshold":return jw(e,t,n);case"quantile":return O7(e,t,n);case"quantize":return B7(e,t,n);case"pow":return sT(e,t,n);case"log":return N7(e,t,n);case"symlog":return D7(e,t,n);case"utc":return q7(e,t,n);case"time":return z7(e,t,n);case"point":return X7(e,t,n);case"band":return G7(e,t,n);case"identity":return L7(e);case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function Jf(e){return typeof e=="symbol"?e.description:e}function Q7(e){return typeof e=="string"?`${e}`.toLowerCase():e}var K7={toString:()=>"projection"};function aK(e,t,{type:n,domain:r,range:i,scheme:o,pivot:s,projection:a}){if(n=Q7(n),e==="fx"||e==="fy")return"band";(e==="x"||e==="y")&&a!=null&&(n=K7);for(let l of t){let u=Q7(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===K7)return;if(n!==void 0)return n;if(r===void 0&&!t.some(({value:l})=>l!==void 0))return;let c=pe.get(e);if(c===kl)return"sqrt";if(c===Fl||c===Rl)return"linear";if(c===qf)return"ordinal";if((r||i||[]).length>2)return uT(c);if(r!==void 0){if(De(r))return uT(c);if(Le(r))return"utc"}else{let l=t.map(({value:u})=>u).filter(u=>u!==void 0);if(l.some(De))return uT(c);if(l.some(Le))return"utc"}if(c===Xr){if(s!=null||A7(o))return"diverging";if(S7(o))return"categorical"}return"linear"}function uT(e){switch(e){case wi:return"point";case Xr:return Zf;default:return"ordinal"}}function Wo({type:e}){return e==="ordinal"||e==="point"||e==="band"||e===Zf}function dT({type:e}){return e==="threshold"}function cK({type:e}){return e==="point"||e==="band"}function fr(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 Yw(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 lK(e){return Wt(e,jf)}function rc(e={}){let t;for(let n in e)if(pe.has(n)&&jo(e[n])){if(t!==void 0)throw new Error("ambiguous scale definition; multiple scales found");t=o$(Ww(n,e[n]))}if(t===void 0)throw new Error("invalid scale definition; no scale found");return t}function i$(e){return t=>{if(!pe.has(t=`${t}`))throw new Error(`unknown scale: ${t}`);return e[t]}}function o$({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:Ja(n),...r!==void 0&&{range:Ja(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 a$(e,t){let{fx:n,fy:r}=my(e,t),i=n?.scale.domain(),o=r?.scale.domain();return i&&o?yx(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 c$(e,{x:t,y:n}){return t&&=xT(t),n&&=xT(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 Zw(e,{fx:t,fy:n}){let r=lr(e),i=t?.value,o=n?.value;return t&&n?Ui(r,s=>(s.fx=i[s[0]],s.fy=o[s[0]],s),s=>i[s],s=>o[s]):t?Ui(r,s=>(s.fx=i[s[0]],s),s=>i[s]):Ui(r,s=>(s.fy=o[s[0]],s),s=>o[s])}function l$(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 u$(e){let t=[],n=new Uint32Array(Nn(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 uK=new Map([["top",pT],["right",gT],["bottom",mT],["left",yT],["top-left",Hw(pT,yT)],["top-right",Hw(pT,gT)],["bottom-left",Hw(mT,yT)],["bottom-right",Hw(mT,gT)],["top-empty",hK],["right-empty",mK],["bottom-empty",dK],["left-empty",pK],["empty",yK]]);function f$(e){if(e==null)return null;let t=uK.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid facet anchor: ${e}`)}var s$=new WeakMap;function xT(e){let t=s$.get(e);return t||s$.set(e,t=new Qn(Wt(e,(n,r)=>[n,r]))),t}function ic(e,t){return xT(e).get(t)}function fK(e,t,n){return t=Qs(t),n=Qs(n),e.find(r=>Object.is(Qs(r.x),t)&&Object.is(Qs(r.y),n))}function Jw(e,t,n){return fK(e,t,n)?.empty}function pT(e,{y:t},{y:n}){return t?ic(t,n)===0:!0}function mT(e,{y:t},{y:n}){return t?ic(t,n)===t.length-1:!0}function yT(e,{x:t},{x:n}){return t?ic(t,n)===0:!0}function gT(e,{x:t},{x:n}){return t?ic(t,n)===t.length-1:!0}function hK(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 Jw(e,n,t[o-1])}function dK(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 Jw(e,n,t[o+1])}function pK(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 Jw(e,t[o-1],r)}function mK(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 Jw(e,t[o+1],r)}function yK(e,t,{empty:n}){return n}function Hw(e,t){return function(){return e.apply(null,arguments)&&t.apply(null,arguments)}}function Qw(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 d$=Math.PI,ia=2*d$,h$=.618;function p$({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(gn(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}=m$(e));let{width:u,height:f,marginLeft:h,marginRight:d,marginTop:p,marginBottom:m}=s,y=u-h-d-o-r,g=f-p-m-n-i;if(e=e?.({width:y,height:g,clip:l,...a}),e==null)return;l=gK(l,h,p,u-d,f-m);let x=h+o,b=p+n,w;if(c!=null){let[[v,_],[A,E]]=On(e).bounds(c),T=Math.min(y/(A-v),g/(E-_));T>0?(x-=(T*(v+A)-y)/2,b-=(T*(_+E)-g)/2,w=gl({point(D,I){this.stream.point(D*T+x,I*T+b)}})):Yn("Warning: the projection could not be fit to the specified domain; using the default scale.")}return w??=x===0&&b===0?y$():gl({point(v,_){this.stream.point(v+x,_+b)}}),{stream:v=>e.stream(w.stream(l(v)))}}function m$(e){switch(`${e}`.toLowerCase()){case"albers-usa":return Yi(tM,.7463,.4673);case"albers":return Kw(dm,.7463,.4673);case"azimuthal-equal-area":return Yi(nM,4,4);case"azimuthal-equidistant":return Yi(iM,ia,ia);case"conic-conformal":return Kw(aM,ia,ia);case"conic-equal-area":return Kw(Ua,6.1702,2.9781);case"conic-equidistant":return Kw(lM,7.312,3.6282);case"equal-earth":return Yi(fM,5.4133,2.6347);case"equirectangular":return Yi(cM,ia,d$);case"gnomonic":return Yi(dM,3.4641,3.4641);case"identity":return{type:y$};case"reflect-y":return{type:xK};case"mercator":return Yi(oM,ia,ia);case"orthographic":return Yi(mM,2,2);case"stereographic":return Yi(gM,2,2);case"transverse-mercator":return Yi(bM,ia,ia);default:throw new Error(`unknown projection type: ${e}`)}}function gK(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 ff(t,n,r,i);default:throw new Error(`unknown projection clip type: ${e}`)}}function Yi(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 Kw(e,t,n){let{type:r,aspectRatio:i}=Yi(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 y$=yn({stream:e=>e}),xK=yn(gl({point(e,t){this.stream.point(e,-t)}}));function bT(e,t,n,r){let i=n[e],o=n[t],s=i.length,a=n[e]=new Float64Array(s).fill(NaN),c=n[t]=new Float64Array(s).fill(NaN),l,u=r.stream({point(f,h){a[l]=f,c[l]=h}});for(l=0;l<s;++l)u.point(i[l],o[l])}function g$({projection:e}={}){return e==null?!1:typeof e.stream=="function"?!0:(gn(e)&&(e=e.type),e!=null)}function x$(e){if(typeof e?.stream=="function")return h$;if(gn(e)&&(e=e.type),e!=null){if(typeof e!="function"){let{aspectRatio:t}=m$(e);if(t)return t}return h$}}function oc(e,t,{projection:n}){let{x:r,y:i}=e,o={};return r&&(o.x=r),i&&(o.y=i),o=Xf(o,t),n&&r?.scale==="x"&&i?.scale==="y"&&bT("x","y",o,n),r&&(o.x=en(o.x)),i&&(o.y=en(o.y)),o}function b$(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)zr(s,o);return[r,i]}function sc(e={}){let{document:t=typeof window<"u"?window.document:void 0,clip:n}=e;return{document:t,clip:Cw(n)}}function ut(e,{document:t}){return Yt(Bs(e).call(t.documentElement))}function t_(e){let t,n;return(...r)=>((n?.length!==r.length||n.some((i,o)=>i!==r[o]))&&(n=r,t=e(...r)),t)}var bK=t_(e=>new Intl.NumberFormat(e)),wK=t_((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{month:t}})),_K=t_((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{weekday:t}}));function wT(e="en-US"){let t=bK(e);return n=>n!=null&&!isNaN(n)?t.format(n):void 0}function w$(e="en-US",t="short"){let n=wK(e,t);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2e3,+r)))?n.format(r):void 0}function _$(e="en-US",t="short"){let n=_K(e,t);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2001,0,+r)))?n.format(r):void 0}function _T(e){return Lf(e,"Invalid Date")}function vK(e="en-US"){let t=wT(e);return n=>(n instanceof Date?_T:typeof n=="number"?t:qe)(n)}var Ho=vK();var Ce=(typeof window<"u"?window.devicePixelRatio>1:typeof it>"u")?0:.5,SK=0;function e_(){return`plot-clip-${++SK}`}function n_(e,{title:t,href:n,ariaLabel:r,ariaDescription:i,ariaHidden:o,target:s,fill:a,fillOpacity:c,stroke:l,strokeWidth:u,strokeOpacity:f,strokeLinejoin:h,strokeLinecap:d,strokeMiterlimit:p,strokeDasharray:m,strokeDashoffset:y,opacity:g,mixBlendMode:x,imageFilter:b,paintOrder:w,pointerEvents:v,shapeRendering:_,channels:A},{ariaLabel:E,fill:T="currentColor",fillOpacity:D,stroke:I="none",strokeOpacity:O,strokeWidth:L,strokeLinecap:S,strokeLinejoin:M,strokeMiterlimit:N,paintOrder:R}){T===null&&(a=null,c=null),I===null&&(l=null,f=null),oe(T)?!oe(I)&&(!oe(a)||A?.fill)&&(I="none"):oe(I)&&(!oe(l)||A?.stroke)&&(T="none");let[F,k]=Be(a,T),[$,P]=ce(c,D),[U,G]=Be(l,I),[nt,ot]=ce(f,O),[at,Y]=ce(g);ta(G)||(u===void 0&&(u=L),d===void 0&&(d=S),h===void 0&&(h=M),p===void 0&&!JF(h)&&(p=N),!ta(k)&&w===void 0&&(w=R));let[st,q]=ce(u);return T!==null&&(e.fill=de(k,"currentColor"),e.fillOpacity=yy(P,1)),I!==null&&(e.stroke=de(G,"none"),e.strokeWidth=yy(q,1),e.strokeOpacity=yy(ot,1),e.strokeLinejoin=de(h,"miter"),e.strokeLinecap=de(d,"butt"),e.strokeMiterlimit=yy(p,4),e.strokeDasharray=de(m,"none"),e.strokeDashoffset=de(y,"0")),e.target=qe(s),e.ariaLabel=qe(E),e.ariaDescription=qe(i),e.ariaHidden=qe(o),e.opacity=yy(Y,1),e.mixBlendMode=de(x,"normal"),e.imageFilter=de(b,"none"),e.paintOrder=de(w,"normal"),e.pointerEvents=de(v,"auto"),e.shapeRendering=de(_,"auto"),{title:{value:t,optional:!0,filter:null},href:{value:n,optional:!0,filter:null},ariaLabel:{value:r,optional:!0,filter:null},fill:{value:F,scale:"auto",optional:!0},fillOpacity:{value:$,scale:"auto",optional:!0},stroke:{value:U,scale:"auto",optional:!0},strokeOpacity:{value:nt,scale:"auto",optional:!0},strokeWidth:{value:st,optional:!0},opacity:{value:at,scale:"auto",optional:!0}}}function IK(e,t){t&&e.filter(n=>ey(t[n])).append("title").call(MK,t)}function AK(e,t){t&&e.filter(([n])=>ey(t[n])).append("title").call(TK,t)}function MK(e,t){t&&e.text(n=>Ho(t[n]))}function TK(e,t){t&&e.text(([n])=>Ho(t[n]))}function Kt(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",h=>r[h]),o&&ft(e,"fill",h=>o[h]),s&&ft(e,"fill-opacity",h=>s[h]),a&&ft(e,"stroke",h=>a[h]),c&&ft(e,"stroke-opacity",h=>c[h]),l&&ft(e,"stroke-width",h=>l[h]),u&&ft(e,"opacity",h=>u[h]),f&&v$(e,h=>f[h],t),n||IK(e,i)}function $l(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",([h])=>r[h]),o&&ft(e,"fill",([h])=>o[h]),s&&ft(e,"fill-opacity",([h])=>s[h]),a&&ft(e,"stroke",([h])=>a[h]),c&&ft(e,"stroke-opacity",([h])=>c[h]),l&&ft(e,"stroke-width",([h])=>l[h]),u&&ft(e,"opacity",([h])=>u[h]),f&&v$(e,([h])=>f[h],t),n||AK(e,i)}function EK({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 gy(e,t,n){let r=fn(e,i=>t[i]);return n===void 0&&r.size>1+e.length>>1&&Yn("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*r_(e,t,n,r){let{z:i}=n,{z:o}=r,s=EK(r,n),a=[...t,...s];for(let c of o?gy(e,o,i):[e]){let l,u;t:for(let f of c){for(let h of a)if(!ze(h[f])){u&&u.push(-1);continue t}if(l===void 0){u&&(yield u),l=s.map(h=>Qs(h[f])),u=[f];continue}u.push(f);for(let h=0;h<s.length;++h)if(Qs(s[h][f])!==l[h]){yield u,l=s.map(p=>Qs(p[f])),u=[f];continue t}}u&&(yield u)}}function NK(e,t,n,r){let i,{clip:o=r.clip}=t;switch(o){case"frame":{let{width:s,height:a,marginLeft:c,marginRight:l,marginTop:u,marginBottom:f}=n,h=e_();i=`url(#${h})`,e=ut("svg:g",r).call(d=>d.append("svg:clipPath").attr("id",h).append("rect").attr("x",c).attr("y",u).attr("width",s-l-c).attr("height",a-u-f)).each(function(){this.appendChild(e.node()),e.node=()=>this});break}case"sphere":{let{projection:s}=r;if(!s)throw new Error('the "sphere" clip option requires a projection');let a=e_();i=`url(#${a})`,e.append("clipPath").attr("id",a).append("path").attr("d",On(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 kt(e,t,n,r){NK(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 Ct(e,t){DK(e,"mix-blend-mode",t.mixBlendMode),ft(e,"opacity",t.opacity)}function v$(e,t,n){e.each(function(r){let i=t(r);if(i!=null){let o=this.ownerDocument.createElementNS(li.svg,"a");o.setAttribute("fill","inherit"),o.setAttributeNS(li.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 DK(e,t,n){n!=null&&e.style(t,n)}function Et(e,t,{x:n,y:r},i=Ce,o=Ce){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 de(e,t){if((e=qe(e))!==t)return e}function yy(e,t){if((e=Lt(e))!==t)return e}var OK=/^-?([_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 Qf(e){if(e===void 0)return"plot-d6a7b5";if(e=`${e}`,!OK.test(e))throw new Error(`invalid class name: ${e}`);return e}function Kf(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 _n({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]}var vt=class{constructor(t,n={},r={},i){let{facet:o="auto",facetAnchor:s,fx:a,fy:c,sort:l,dx:u=0,dy:f=0,margin:h=0,marginTop:d=h,marginRight:p=h,marginBottom:m=h,marginLeft:y=h,clip:g=i?.clip,channels:x,tip:b,render:w}=r;if(this.data=t,this.sort=Vo(l)?l:null,this.initializer=Me(r).initializer,this.transform=this.initializer?r.transform:bn(r).transform,o===null||o===!1?this.facet=null:(this.facet=cn(o===!0?"include":o,"facet",["auto","include","exclude","super"]),this.fx=t===Ha&&typeof a=="string"?[a]:a,this.fy=t===Ha&&typeof c=="string"?[c]:c),this.facetAnchor=f$(s),n=ay(n),x!==void 0&&(n={...BK(x),...n}),i!==void 0&&(n={...n_(this,r,i),...n}),this.channels=Object.fromEntries(Object.entries(n).map(([v,_])=>{if(Yr(_.value)){let{value:A,label:E=_.label,scale:T=_.scale}=_.value;_={..._,label:E,scale:T,value:A}}if(t===Ha&&typeof _.value=="string"){let{value:A}=_;_={..._,value:[A]}}return[v,_]}).filter(([v,{value:_,optional:A}])=>{if(_!=null)return!0;if(A)return!1;throw new Error(`missing channel value: ${v}`)})),this.dx=+u,this.dy=+f,this.marginTop=+d,this.marginRight=+p,this.marginBottom=+m,this.marginLeft=+y,this.clip=Cw(g),this.tip=LK(b),this.facet==="super"){if(a||c)throw new Error("super-faceting cannot use fx or fy");for(let v in this.channels){let{scale:_}=n[v];if(!(_!=="x"&&_!=="y"))throw new Error("super-faceting cannot use x or y")}}w!=null&&(this.render=th(w,this.render))}initialize(t,n,r){let i=je(this.data);t===void 0&&i!=null&&(t=[lr(i)]);let o=t;this.transform!=null&&({facets:t,data:i}=this.transform(i,t,r),i=je(i)),t!==void 0&&(t.original=o);let s=qw(this.channels,i);return this.sort!=null&&m7(i,t,s,n,this.sort),{data:i,facets:t,channels:s}}filter(t,n,r){for(let i in n){let{filter:o=ze}=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"&&bT(i,o,n,r.projection)}}scale(t,n,r){let i=Xf(t,n);return r.projection&&this.project(t,i,r),i}};function nn(...e){return e.plot=vt.prototype.plot,e}function th(e,t){if(e==null)return t===null?void 0:t;if(t==null)return e===null?void 0:e;if(typeof e!="function")throw new TypeError(`invalid render transform: ${e}`);if(typeof t!="function")throw new TypeError(`invalid render transform: ${t}`);return function(n,r,i,o,s,a){return e.call(this,n,r,i,o,s,(c,l,u,f,h)=>t.call(this,c,l,u,f,h,a))}}function BK(e){return Object.fromEntries(Object.entries(ay(e)).map(([t,n])=>(n=typeof n=="string"?{value:n,label:t}:bi(n),n.filter===void 0&&n.scale==null&&(n={...n,filter:null}),[t,n])))}function LK(e){return e===!0?"xy":e===!1||e==null?null:typeof e=="string"?cn(e,"tip",["x","y","xy"]):e}function Xi(e,t){return e?.tip===!0?{...e,tip:t}:gn(e?.tip)&&e.tip.pointer===void 0?{...e,tip:{...e.tip,pointer:t}}:e}function I$(e,t,n={}){let r=.5-Ce,i=.5+Ce,o=.5+Ce,s=.5-Ce;for(let{marginTop:m,marginRight:y,marginBottom:g,marginLeft:x}of t)m>r&&(r=m),y>i&&(i=y),g>o&&(o=g),x>s&&(s=x);let{margin:a,marginTop:c=a!==void 0?a:r,marginRight:l=a!==void 0?a:i,marginBottom:u=a!==void 0?a:o,marginLeft:f=a!==void 0?a:s}=n;c=+c,l=+l,u=+u,f=+f;let{width:h=640,height:d=CK(e,n,{width:h,marginTopDefault:r,marginRightDefault:i,marginBottomDefault:o,marginLeftDefault:s})+Math.max(0,c-r+u-o)}=n;h=+h,d=+d;let p={width:h,height:d,marginTop:c,marginRight:l,marginBottom:u,marginLeft:f};if(e.fx||e.fy){let{margin:m,marginTop:y=m!==void 0?m:c,marginRight:g=m!==void 0?m:l,marginBottom:x=m!==void 0?m:u,marginLeft:b=m!==void 0?m:f}=n.facet??{};y=+y,g=+g,x=+x,b=+b,p.facet={marginTop:y,marginRight:g,marginBottom:x,marginLeft:b}}return p}function CK({x:e,y:t,fy:n,fx:r},{projection:i,aspectRatio:o},{width:s,marginTopDefault:a,marginRightDefault:c,marginBottomDefault:l,marginLeftDefault:u}){let f=n?n.scale.domain().length:1,h=x$(i);if(h){let p=r?r.scale.domain().length:1,m=(1.1*f-.1)/(1.1*p-.1)*h,y=Math.max(.1,Math.min(10,m));return Math.round((s-u-c)*y+a+l)}let d=t?Wo(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=S$("y",t)/(S$("x",e)*o),m=r?r.scale.bandwidth():1,y=n?n.scale.bandwidth():1,g=m*(s-u-c)-e.insetLeft-e.insetRight;return(p*g+t.insetTop+t.insetBottom)/y+a+l}return!!(t||n)*Math.max(1,Math.min(60,d*f))*20+!!r*30+60}function S$(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]=fe(r);return Math.abs(i(s)-i(o))}var A$=new WeakMap;function vT(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:th(function(u,f,h,d,p,m){p={...p,pointerSticky:!1};let y=p.ownerSVGElement,{data:g}=p.getMarkState(this),x=A$.get(y);x||A$.set(y,x={sticky:!1,roots:[],renders:[]});let b=x.renders.push(G)-1,{x:w,y:v,fx:_,fy:A}=f,E=_?_(u.fx)-d.marginLeft:0,T=A?A(u.fy)-d.marginTop:0;w?.bandwidth&&(E+=w.bandwidth()/2),v?.bandwidth&&(T+=v.bandwidth()/2);let D=u.fi!=null,I;if(D){let Y=x.facetStates;Y||(x.facetStates=Y=new Map),I=Y.get(this),I||Y.set(this,I=new Map)}let[O,L]=_n(this,d),{px:S,py:M}=h,N=S?Y=>S[Y]:ST(h,O),R=M?Y=>M[Y]:IT(h,L),F,k,$,P;function U(Y,st){if(D)if(P&&(P=cancelAnimationFrame(P)),Y==null)I.delete(u.fi);else{I.set(u.fi,st),P=requestAnimationFrame(()=>{P=null;for(let[q,Z]of I)if(Z<st||Z===st&&q<u.fi){Y=null;break}G(Y)});return}G(Y)}function G(Y){if(F===Y&&$===x.sticky)return;F=Y,$=p.pointerSticky=x.sticky;let st=F==null?[]:[F];D&&(st.fx=u.fx,st.fy=u.fy,st.fi=u.fi);let q=m(st,f,h,d,p);if(k){if(D){let Z=k.parentNode,rt=k.getAttribute("transform"),z=q.getAttribute("transform");rt?q.setAttribute("transform",rt):q.removeAttribute("transform"),z?Z.setAttribute("transform",z):Z.removeAttribute("transform"),q.removeAttribute("aria-label"),q.removeAttribute("aria-description"),q.removeAttribute("aria-hidden")}k.replaceWith(q)}return x.roots[b]=k=q,F==null&&I?.size>1||p.dispatchValue(F==null?null:g[F]),q}function nt(Y){if(x.sticky||Y.pointerType==="mouse"&&Y.buttons===1)return;let[st,q]=Fn(Y);st-=E,q-=T;let Z=st<d.marginLeft||st>d.width-d.marginRight?1:e,rt=q<d.marginTop||q>d.height-d.marginBottom?1:t,z=null,Ft=s*s;for(let ht of u){let Ht=Z*(N(ht)-st),Qt=rt*(R(ht)-q),tt=Ht*Ht+Qt*Qt;tt<=Ft&&(z=ht,Ft=tt)}if(z!=null&&(e!==1||t!==1)){let ht=N(z)-st,Ht=R(z)-q;Ft=ht*ht+Ht*Ht}U(z,Ft)}function ot(Y){Y.pointerType==="mouse"&&F!=null&&(x.sticky&&x.roots.some(st=>st?.contains(Y.target))||(x.sticky?(x.sticky=!1,x.renders.forEach(st=>st(null))):(x.sticky=!0,G(F)),Y.stopImmediatePropagation()))}function at(Y){Y.pointerType==="mouse"&&(x.sticky||U(null))}return y.addEventListener("pointerenter",nt),y.addEventListener("pointermove",nt),y.addEventListener("pointerdown",ot),y.addEventListener("pointerleave",at),G(null)},c)}}function ac(e){return vT(1,1,e)}function cc(e){return vT(1,.01,e)}function oa(e){return vT(.01,1,e)}function ST({x1:e,x2:t,x:n=e},r){return e&&t?i=>(e[i]+t[i])/2:n?i=>n[i]:()=>r}function IT({y1:e,y2:t,y:n=e},r){return e&&t?i=>(e[i]+t[i])/2:n?i=>n[i]:()=>r}function i_(e){return Wo(e)&&e.interval===void 0?void 0:"tabular-nums"}function M$(e,t){let{label:n=e.label,tickSize:r=6,width:i=240,height:o=44+r,marginTop:s=18,marginRight:a=0,marginBottom:c=16+r,marginLeft:l=0,style:u,ticks:f=(i-l-a)/64,tickFormat:h,fontVariant:d=i_(e),round:p=!0,opacity:m,className:y}=t,g=sc(t);y=Qf(y),m=ce(m)[1],h===null&&(h=()=>null);let x=ut("svg",g).attr("class",`${y}-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(.${y}-ramp) {
1
+ var gq=Object.create;var aw=Object.defineProperty;var yq=Object.getOwnPropertyDescriptor;var bq=Object.getOwnPropertyNames;var wq=Object.getPrototypeOf,vq=Object.prototype.hasOwnProperty;var v7=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pc=(t,e)=>{for(var n in e)aw(t,n,{get:e[n],enumerable:!0})},_q=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of bq(e))!vq.call(t,o)&&o!==n&&aw(t,o,{get:()=>e[o],enumerable:!(r=yq(e,o))||r.enumerable});return t};var Sq=(t,e,n)=>(n=t!=null?gq(wq(t)):{},_q(e||!t||!t.__esModule?aw(n,"default",{value:t,enumerable:!0}):n,t));var QD=v7((NPt,HD)=>{"use strict";function PZ(t,e,n,r,o){for(var i=o+1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c>=0?(i=s,o=s-1):r=s+1}return i}function FZ(t,e,n,r,o){for(var i=o+1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c>0?(i=s,o=s-1):r=s+1}return i}function qZ(t,e,n,r,o){for(var i=r-1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c<0?(i=s,r=s+1):o=s-1}return i}function BZ(t,e,n,r,o){for(var i=r-1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c<=0?(i=s,r=s+1):o=s-1}return i}function zZ(t,e,n,r,o){for(;r<=o;){var i=r+o>>>1,s=t[i],a=n!==void 0?n(s,e):s-e;if(a===0)return i;a<=0?r=i+1:o=i-1}return-1}function Bh(t,e,n,r,o,i){return typeof n=="function"?i(t,e,n,r===void 0?0:r|0,o===void 0?t.length-1:o|0):i(t,e,void 0,n===void 0?0:n|0,r===void 0?t.length-1:r|0)}HD.exports={ge:function(t,e,n,r,o){return Bh(t,e,n,r,o,PZ)},gt:function(t,e,n,r,o){return Bh(t,e,n,r,o,FZ)},lt:function(t,e,n,r,o){return Bh(t,e,n,r,o,qZ)},le:function(t,e,n,r,o){return Bh(t,e,n,r,o,BZ)},eq:function(t,e,n,r,o){return Bh(t,e,n,r,o,zZ)}}});var oP=v7((CPt,rP)=>{"use strict";var Qb=QD(),Bu=0,Ac=1,Hb=2;rP.exports=UZ;function sM(t,e,n,r,o){this.mid=t,this.left=e,this.right=n,this.leftPoints=r,this.rightPoints=o,this.count=(e?e.count:0)+(n?n.count:0)+r.length}var zh=sM.prototype;function oM(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function KD(t,e){var n=zu(e);t.mid=n.mid,t.left=n.left,t.right=n.right,t.leftPoints=n.leftPoints,t.rightPoints=n.rightPoints,t.count=n.count}function ZD(t,e){var n=t.intervals([]);n.push(e),KD(t,n)}function JD(t,e){var n=t.intervals([]),r=n.indexOf(e);return r<0?Bu:(n.splice(r,1),KD(t,n),Ac)}zh.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t};zh.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?ZD(this,t):this.left.insert(t):this.left=zu([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?ZD(this,t):this.right.insert(t):this.right=zu([t]);else{var n=Qb.ge(this.leftPoints,t,aM),r=Qb.ge(this.rightPoints,t,cM);this.leftPoints.splice(n,0,t),this.rightPoints.splice(r,0,t)}};zh.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){if(!this.left)return Bu;var n=this.right?this.right.count:0;if(4*n>3*(e-1))return JD(this,t);var r=this.left.remove(t);return r===Hb?(this.left=null,this.count-=1,Ac):(r===Ac&&(this.count-=1),r)}else if(t[0]>this.mid){if(!this.right)return Bu;var o=this.left?this.left.count:0;if(4*o>3*(e-1))return JD(this,t);var r=this.right.remove(t);return r===Hb?(this.right=null,this.count-=1,Ac):(r===Ac&&(this.count-=1),r)}else{if(this.count===1)return this.leftPoints[0]===t?Hb:Bu;if(this.leftPoints.length===1&&this.leftPoints[0]===t){if(this.left&&this.right){for(var i=this,s=this.left;s.right;)i=s,s=s.right;if(i===this)s.right=this.right;else{var a=this.left,r=this.right;i.count-=s.count,i.right=s.left,s.left=a,s.right=r}oM(this,s),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?oM(this,this.left):oM(this,this.right);return Ac}for(var a=Qb.ge(this.leftPoints,t,aM);a<this.leftPoints.length&&this.leftPoints[a][0]===t[0];++a)if(this.leftPoints[a]===t){this.count-=1,this.leftPoints.splice(a,1);for(var r=Qb.ge(this.rightPoints,t,cM);r<this.rightPoints.length&&this.rightPoints[r][1]===t[1];++r)if(this.rightPoints[r]===t)return this.rightPoints.splice(r,1),Ac}return Bu}};function tP(t,e,n){for(var r=0;r<t.length&&t[r][0]<=e;++r){var o=n(t[r]);if(o)return o}}function eP(t,e,n){for(var r=t.length-1;r>=0&&t[r][1]>=e;--r){var o=n(t[r]);if(o)return o}}function nP(t,e){for(var n=0;n<t.length;++n){var r=e(t[n]);if(r)return r}}zh.queryPoint=function(t,e){if(t<this.mid){if(this.left){var n=this.left.queryPoint(t,e);if(n)return n}return tP(this.leftPoints,t,e)}else if(t>this.mid){if(this.right){var n=this.right.queryPoint(t,e);if(n)return n}return eP(this.rightPoints,t,e)}else return nP(this.leftPoints,e)};zh.queryInterval=function(t,e,n){if(t<this.mid&&this.left){var r=this.left.queryInterval(t,e,n);if(r)return r}if(e>this.mid&&this.right){var r=this.right.queryInterval(t,e,n);if(r)return r}return e<this.mid?tP(this.leftPoints,e,n):t>this.mid?eP(this.rightPoints,t,n):nP(this.leftPoints,n)};function YZ(t,e){return t-e}function aM(t,e){var n=t[0]-e[0];return n||t[1]-e[1]}function cM(t,e){var n=t[1]-e[1];return n||t[0]-e[0]}function zu(t){if(t.length===0)return null;for(var e=[],n=0;n<t.length;++n)e.push(t[n][0],t[n][1]);e.sort(YZ);for(var r=e[e.length>>1],o=[],i=[],s=[],n=0;n<t.length;++n){var a=t[n];a[1]<r?o.push(a):r<a[0]?i.push(a):s.push(a)}var c=s,f=s.slice();return c.sort(aM),f.sort(cM),new sM(r,zu(o),zu(i),c,f)}function iM(t){this.root=t}var Yu=iM.prototype;Yu.insert=function(t){this.root?this.root.insert(t):this.root=new sM(t[0],null,null,[t],[t])};Yu.remove=function(t){if(this.root){var e=this.root.remove(t);return e===Hb&&(this.root=null),e!==Bu}return!1};Yu.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)};Yu.queryInterval=function(t,e,n){if(t<=e&&this.root)return this.root.queryInterval(t,e,n)};Object.defineProperty(Yu,"count",{get:function(){return this.root?this.root.count:0}});Object.defineProperty(Yu,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function UZ(t){return!t||t.length===0?new iM(null):new iM(zu(t))}});var _7={};function sl(t,e=!1){let n,r,o=_7;function i(f){n=t(f).catch(()=>{}).finally(()=>{if(r){let{value:u}=r;r=null,i(u)}else n=null})}function s(f){r={event:f}}function a(f){n?s(f):i(f)}function c(f){o!==f&&requestAnimationFrame(()=>{let u=o;o=_7,a(u)}),o=f}return e?c:a}var Bn=class{constructor(e){this._filterBy=e,this._requestUpdate=sl(()=>this.requestQuery(),!0),this._coordinator=null}get coordinator(){return this._coordinator}set coordinator(e){this._coordinator=e}get filterBy(){return this._filterBy}get filterStable(){return!0}fields(){return null}fieldInfo(e){return this}query(e){return null}queryPending(){return this}queryResult(e){return this}queryError(e){return this}requestQuery(e){let n=e||this.query(this.filterBy?.predicate(this));return this._coordinator.requestQuery(this,n)}requestUpdate(){this._requestUpdate()}initialize(){return this._coordinator.initializeClient(this)}update(){return this}};var al=Uint8Array.of(65,82,82,79,87,49),mr={V1:0,V2:1,V3:2,V4:3,V5:4};var xr={NONE:0,Schema:1,DictionaryBatch:2,RecordBatch:3,Tensor:4,SparseTensor:5},z={Dictionary:-1,NONE:0,Null:1,Int:2,Float:3,Binary:4,Utf8:5,Bool:6,Decimal:7,Date:8,Time:9,Timestamp:10,Interval:11,List:12,Struct:13,Union:14,FixedSizeBinary:15,FixedSizeList:16,Map:17,Duration:18,LargeBinary:19,LargeUtf8:20,LargeList:21,RunEndEncoded:22,BinaryView:23,Utf8View:24,ListView:25,LargeListView:26},Fc={HALF:0,SINGLE:1,DOUBLE:2},Ko={DAY:0,MILLISECOND:1},De={SECOND:0,MILLISECOND:1,MICROSECOND:2,NANOSECOND:3},gr={YEAR_MONTH:0,DAY_TIME:1,MONTH_DAY_NANO:2},ti={Sparse:0,Dense:1};var qc=Uint8Array,Im=Uint16Array,Nm=Uint32Array,Cm=BigUint64Array,cl=Int8Array,S7=Int16Array,zn=Int32Array,Zn=BigInt64Array,cw=Float32Array,Hi=Float64Array;function M7(t,e){let n=Math.log2(t)-3;return(e?[cl,S7,zn,Zn]:[qc,Im,Nm,Cm])[n]}var ett=Object.getPrototypeOf(Int8Array);function Bc(t,e){let n=0,r=t.length;if(r<=2147483648)do{let o=n+r>>>1;t[o]<=e?n=o+1:r=o}while(n<r);else do{let o=Math.trunc((n+r)/2);t[o]<=e?n=o+1:r=o}while(n<r);return n}function km(t,e,n){if(e(t))return t;throw new Error(n(t))}function Yn(t,e,n){return e=Array.isArray(e)?e:Object.values(e),km(t,r=>e.includes(r),n??(()=>`${t} must be one of ${e}`))}function Lm(t,e){for(let[n,r]of Object.entries(t))if(r===e)return n;return"<Unknown>"}var ei=t=>`Unsupported data type: "${Lm(z,t)}" (id ${t})`,fl=(t,e,n=!0,r=null)=>({name:t,type:e,nullable:n,metadata:r});function A7(t){return Object.hasOwn(t,"name")&&T7(t.type)}function T7(t){return typeof t?.typeId=="number"}function Qi(t,e="",n=!0){return A7(t)?t:fl(e,km(t,T7,()=>"Data type expected."),n)}var Rm=(t,e,n=!1,r=-1)=>({typeId:z.Dictionary,id:r,dictionary:t,indices:e||zc(),ordered:n});var Om=(t=32,e=!0)=>({typeId:z.Int,bitWidth:Yn(t,[8,16,32,64]),signed:e,values:M7(t,e)});var zc=()=>Om(32);var fw=(t=2)=>({typeId:z.Float,precision:Yn(t,Fc),values:[Im,cw,Hi][t]});var uw=()=>({typeId:z.Binary,offsets:zn}),$m=()=>({typeId:z.Utf8,offsets:zn});var lw=(t,e,n=128)=>({typeId:z.Decimal,precision:t,scale:e,bitWidth:Yn(n,[128,256]),values:Cm}),pw=t=>({typeId:z.Date,unit:Yn(t,Ko),values:t===Ko.DAY?zn:Zn});var dw=(t=De.MILLISECOND,e=32)=>({typeId:z.Time,unit:Yn(t,De),bitWidth:Yn(e,[32,64]),values:e===32?zn:Zn});var Dm=(t=De.MILLISECOND,e=null)=>({typeId:z.Timestamp,unit:Yn(t,De),timezone:e,values:Zn}),hw=(t=gr.MONTH_DAY_NANO)=>({typeId:z.Interval,unit:Yn(t,gr),values:t===gr.MONTH_DAY_NANO?void 0:zn}),Pm=t=>({typeId:z.List,children:[Qi(t)],offsets:zn}),Fm=t=>({typeId:z.Struct,children:Array.isArray(t)&&A7(t[0])?t:Object.entries(t).map(([e,n])=>fl(e,n))}),mw=(t,e,n,r)=>(n??=e.map((o,i)=>i),{typeId:z.Union,mode:Yn(t,ti),typeIds:n,typeMap:n.reduce((o,i,s)=>(o[i]=s,o),{}),children:e.map((o,i)=>Qi(o,`_${i}`)),typeIdForValue:r,offsets:zn}),xw=t=>({typeId:z.FixedSizeBinary,stride:t}),qm=(t,e)=>({typeId:z.FixedSizeList,stride:e,children:[Qi(t)]}),E7=(t,e)=>({typeId:z.Map,keysSorted:t,children:[e],offsets:zn});var gw=(t=De.MILLISECOND)=>({typeId:z.Duration,unit:Yn(t,De),values:Zn}),yw=()=>({typeId:z.LargeBinary,offsets:Zn}),bw=()=>({typeId:z.LargeUtf8,offsets:Zn}),ww=t=>({typeId:z.LargeList,children:[Qi(t)],offsets:Zn}),vw=(t,e)=>({typeId:z.RunEndEncoded,children:[km(Qi(t,"run_ends"),n=>n.type.typeId===z.Int,()=>"Run-ends must have an integer type."),Qi(e,"values")]});var _w=t=>({typeId:z.ListView,children:[Qi(t,"value")],offsets:zn}),Sw=t=>({typeId:z.LargeListView,children:[Qi(t,"value")],offsets:Zn});var Mq=new Hi(2),Bm=Mq.buffer,utt=new Zn(Bm),ltt=new Nm(Bm),ptt=new zn(Bm),dtt=new qc(Bm);function io(t){if(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)throw Error(`BigInt exceeds integer number representation: ${t}`);return Number(t)}function zm(t,e){return Number(t/e)+Number(t%e)/Number(e)}var Yc=t=>BigInt.asUintN(64,t);function N7(t,e){let n=e<<1,r;return BigInt.asIntN(64,t[n+1])<0?(r=Yc(~t[n])|Yc(~t[n+1])<<64n,r=-(r+1n)):r=t[n]|t[n+1]<<64n,r}function C7(t,e){let n=e<<2,r;return BigInt.asIntN(64,t[n+3])<0?(r=Yc(~t[n])|Yc(~t[n+1])<<64n|Yc(~t[n+2])<<128n|Yc(~t[n+3])<<192n,r=-(r+1n)):r=t[n]|t[n+1]<<64n|t[n+2]<<128n|t[n+3]<<192n,r}var Tq=new TextDecoder("utf-8"),ytt=new TextEncoder;function Uc(t){return Tq.decode(t)}var sa=4;function Mw(t,e){return(t[e>>3]&1<<e%8)!==0}function ln(t,e){let n=e+Xt(t,e),r=n-Xt(t,n),o=Je(t,r);return(i,s,a=null)=>{if(i<o){let c=Je(t,r+i);if(c)return s(t,n+c)}return a}}function qr(t,e){return e}function Zi(t,e){return!!Eq(t,e)}function Eq(t,e){return ul(t,e)<<24>>24}function ul(t,e){return t[e]}function Je(t,e){return Iq(t,e)<<16>>16}function Iq(t,e){return t[e]|t[e+1]<<8}function Xt(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function k7(t,e){return Xt(t,e)>>>0}function Pe(t,e){return io(BigInt.asIntN(64,BigInt(k7(t,e))+(BigInt(k7(t,e+sa))<<32n)))}function aa(t,e){let n=e+Xt(t,e),r=Xt(t,n);return n+=sa,Uc(t.subarray(n,n+r))}function Jn(t,e,n,r){if(!e)return[];let o=e+Xt(t,e);return Array.from({length:Xt(t,o)},(i,s)=>r(t,o+sa+s*n))}var Aw=Symbol("rowIndex");function ll(t,e){class n{constructor(i){this[Aw]=i}toJSON(){return L7(t,e,this[Aw])}}let r=n.prototype;for(let o=0;o<t.length;++o){if(Object.hasOwn(r,t[o]))continue;let i=e[o];Object.defineProperty(r,t[o],{get(){return i.at(this[Aw])},enumerable:!0})}return o=>new n(o)}function Ym(t,e){return n=>L7(t,e,n)}function L7(t,e,n){let r={};for(let o=0;o<t.length;++o)r[t[o]]=e[o].at(n);return r}function R7(t){return t instanceof Ji}var ca=class{static ArrayType=null;constructor({length:e,nullCount:n,type:r,validity:o,values:i,offsets:s,sizes:a,children:c}){this.length=e,this.nullCount=n,this.type=r,this.validity=o,this.values=i,this.offsets=s,this.sizes=a,this.children=c,(!n||!this.validity)&&(this.at=f=>this.value(f))}get[Symbol.toStringTag](){return"Batch"}at(e){return this.isValid(e)?this.value(e):null}isValid(e){return Mw(this.validity,e)}value(e){return this.values[e]}slice(e,n){let r=n-e,o=Array(r);for(let i=0;i<r;++i)o[i]=this.at(e+i);return o}*[Symbol.iterator](){for(let e=0;e<this.length;++e)yield this.at(e)}},Ji=class extends ca{constructor(e){super(e);let{length:n,values:r}=this;this.values=r.subarray(0,n)}slice(e,n){return this.nullCount?super.slice(e,n):this.values.subarray(e,n)}[Symbol.iterator](){return this.nullCount?super[Symbol.iterator]():this.values[Symbol.iterator]()}},pl=class extends ca{static ArrayType=Hi},se=class extends ca{static ArrayType=Array},dl=class extends se{value(e){return null}},so=class extends pl{value(e){return io(this.values[e])}},Um=class extends pl{value(e){let n=this.values[e],r=(n&31744)>>10,o=(n&1023)/1024,i=(-1)**((n&32768)>>15);switch(r){case 31:return i*(o?Number.NaN:1/0);case 0:return i*(o?6103515625e-14*o:0)}return i*2**(r-15)*(1+o)}},jm=class extends se{value(e){return Mw(this.values,e)}},Xm=class extends ca{constructor(e){super(e);let{bitWidth:n,scale:r}=this.type;this.decimal=n===128?N7:C7,this.scale=10n**BigInt(r)}},Wm=class extends Xm{static ArrayType=Hi;value(e){return zm(this.decimal(this.values,e),this.scale)}},Vm=class extends Xm{static ArrayType=Array;value(e){return this.decimal(this.values,e)}},hl=class extends se{constructor(e){super(e),this.source=e}value(e){return new Date(this.source.value(e))}},Gm=class extends pl{value(e){return 864e5*this.values[e]}},O7=so,Hm=class extends so{value(e){return super.value(e)*1e3}},$7=so,Qm=class extends so{value(e){return zm(this.values[e],1000n)}},Zm=class extends so{value(e){return zm(this.values[e],1000000n)}},Jm=class extends se{value(e){return this.values.subarray(e<<1,e+1<<1)}},Km=class extends se{value(e){let n=this.values,r=e<<4;return Float64Array.of(Xt(n,r),Xt(n,r+4),Pe(n,r+8))}},D7=({values:t,offsets:e},n)=>t.subarray(e[n],e[n+1]),P7=({values:t,offsets:e},n)=>t.subarray(io(e[n]),io(e[n+1])),t0=class extends se{value(e){return D7(this,e)}},e0=class extends se{value(e){return P7(this,e)}},n0=class extends se{value(e){return Uc(D7(this,e))}},r0=class extends se{value(e){return Uc(P7(this,e))}},o0=class extends se{value(e){let n=this.offsets;return this.children[0].slice(n[e],n[e+1])}},i0=class extends se{value(e){let n=this.offsets;return this.children[0].slice(io(n[e]),io(n[e+1]))}},s0=class extends se{value(e){let n=this.offsets[e],r=n+this.sizes[e];return this.children[0].slice(n,r)}},a0=class extends se{value(e){let n=this.offsets[e],r=n+this.sizes[e];return this.children[0].slice(io(n),io(r))}},c0=class extends se{constructor(e){super(e),this.stride=this.type.stride}},f0=class extends c0{value(e){let{stride:n,values:r}=this;return r.subarray(e*n,(e+1)*n)}},u0=class extends c0{value(e){let{children:n,stride:r}=this;return n[0].slice(e*r,(e+1)*r)}};function F7({children:t,offsets:e},n){let[r,o]=t[0].children,i=e[n],s=e[n+1],a=[];for(let c=i;c<s;++c)a.push([r.at(c),o.at(c)]);return a}var l0=class extends se{value(e){return F7(this,e)}},p0=class extends se{value(e){return new Map(F7(this,e))}},ml=class extends se{constructor({typeIds:e,...n}){super(n),this.typeIds=e,this.typeMap=this.type.typeMap}value(e,n=e){let{typeIds:r,children:o,typeMap:i}=this;return o[i[r[e]]].at(n)}},d0=class extends ml{value(e){return super.value(e,this.offsets[e])}},xl=class extends se{constructor(e,n=Ym){super(e),this.names=this.type.children.map(r=>r.name),this.factory=n(this.names,this.children)}value(e){return this.factory(e)}},h0=class extends xl{constructor(e){super(e,ll)}},m0=class extends se{value(e){let[{values:n},r]=this.children;return r.at(Bc(n,e))}},x0=class extends se{setDictionary(e){return this.dictionary=e,this.cache=e.cache(),this}value(e){return this.cache[this.key(e)]}key(e){return this.values[e]}},g0=class extends se{constructor({data:e,...n}){super(n),this.data=e}view(e){let{values:n,data:r}=this,o=e<<4,i=o+4,s=n,a=Xt(s,o);return a>12&&(i=Xt(s,o+12),s=r[Xt(s,o+8)]),s.subarray(i,i+a)}},y0=class extends g0{value(e){return this.view(e)}},b0=class extends g0{value(e){return Uc(this.view(e))}};function Tw(t){let e=[];return{add(n){return e.push(n),this},clear:()=>e=[],done:()=>new fa(e,t)}}var fa=class{constructor(e,n=e[0]?.type){this.type=n,this.length=e.reduce((i,s)=>i+s.length,0),this.nullCount=e.reduce((i,s)=>i+s.nullCount,0),this.data=e;let r=e.length,o=new Int32Array(r+1);if(r===1){let[i]=e;o[1]=i.length,this.at=s=>i.at(s)}else for(let i=0,s=0;i<r;++i)o[i+1]=s+=e[i].length;this.offsets=o}get[Symbol.toStringTag](){return"Column"}[Symbol.iterator](){let e=this.data;return e.length===1?e[0][Symbol.iterator]():Nq(e)}at(e){let{data:n,offsets:r}=this,o=Bc(r,e)-1;return n[o]?.at(e-r[o])}get(e){return this.at(e)}toArray(){let{length:e,nullCount:n,data:r}=this,o=!n&&R7(r[0]),i=r.length;if(o&&i===1)return r[0].values;let s=!i||n>0?Array:r[0].constructor.ArrayType??r[0].values.constructor,a=new s(e);return o?Cq(a,r):kq(a,r)}cache(){return this._cache??(this._cache=this.toArray())}};function*Nq(t){for(let e=0;e<t.length;++e){let n=t[e][Symbol.iterator]();for(let r=n.next();!r.done;r=n.next())yield r.value}}function Cq(t,e){for(let n=0,r=0;n<e.length;++n){let{values:o}=e[n];t.set(o,r),r+=o.length}return t}function kq(t,e){let n=-1;for(let r=0;r<e.length;++r){let o=e[r];for(let i=0;i<o.length;++i)t[++n]=o.at(i)}return t}var jc=class t{constructor(e,n,r=!1){let o=e.fields.map(s=>s.name);this.schema=e,this.names=o,this.children=n,this.factory=r?ll:Ym;let i=[];this.getFactory=s=>i[s]??(i[s]=this.factory(o,n.map(a=>a.data[s])))}get[Symbol.toStringTag](){return"Table"}get numCols(){return this.names.length}get numRows(){return this.children[0]?.length??0}getChildAt(e){return this.children[e]}getChild(e){let n=this.names.findIndex(r=>r===e);return n>-1?this.children[n]:void 0}selectAt(e,n=[]){let{children:r,factory:o,schema:i}=this,{fields:s}=i;return new t({...i,fields:e.map((a,c)=>Lq(s[a],n[c]))},e.map(a=>r[a]),o===ll)}select(e,n){let r=this.names,o=e.map(i=>r.indexOf(i));return this.selectAt(o,n)}toColumns(){let{children:e,names:n}=this,r={};return n.forEach((o,i)=>r[o]=e[i]?.toArray()??[]),r}toArray(){let{children:e,getFactory:n,numRows:r}=this,o=e[0]?.data??[],i=Array(r);for(let s=0,a=-1;s<o.length;++s){let c=n(s);for(let f=0;f<o[s].length;++f)i[++a]=c(f)}return i}*[Symbol.iterator](){let{children:e,getFactory:n}=this,r=e[0]?.data??[];for(let o=0;o<r.length;++o){let i=n(o);for(let s=0;s<r[o].length;++s)yield i(s)}}at(e){let{children:n,getFactory:r,numRows:o}=this;if(e<0||e>=o)return null;let[{offsets:i}]=n,s=Bc(i,e)-1;return r(s)(e-i[s])}get(e){return this.at(e)}};function Lq(t,e){return e!=null&&e!==t.name?{...t,name:e}:t}function gl(t,e={}){let{typeId:n,bitWidth:r,precision:o,unit:i}=t,{useBigInt:s,useDate:a,useDecimalBigInt:c,useMap:f,useProxy:u}=e;switch(n){case z.Null:return dl;case z.Bool:return jm;case z.Int:case z.Time:case z.Duration:return s||r<64?Ji:so;case z.Float:return o?Ji:Um;case z.Date:return q7(i===Ko.DAY?Gm:O7,a&&hl);case z.Timestamp:return q7(i===De.SECOND?Hm:i===De.MILLISECOND?$7:i===De.MICROSECOND?Qm:Zm,a&&hl);case z.Decimal:return c?Vm:Wm;case z.Interval:return i===gr.DAY_TIME?Jm:i===gr.YEAR_MONTH?Ji:Km;case z.FixedSizeBinary:return f0;case z.Utf8:return n0;case z.LargeUtf8:return r0;case z.Binary:return t0;case z.LargeBinary:return e0;case z.BinaryView:return y0;case z.Utf8View:return b0;case z.List:return o0;case z.LargeList:return i0;case z.Map:return f?p0:l0;case z.ListView:return s0;case z.LargeListView:return a0;case z.FixedSizeList:return u0;case z.Struct:return u?h0:xl;case z.RunEndEncoded:return m0;case z.Dictionary:return x0;case z.Union:return t.mode?d0:ml}throw new Error(ei(n))}function q7(t,e){return e?class extends e{constructor(r){super(new t(r))}}:t}function Rq(t,e){return{offset:Pe(t,e),metadataLength:Xt(t,e+8),bodyLength:Pe(t,e+16)}}function Ew(t,e){return Jn(t,e,24,Rq)}function w0(t,e,n){let r=ln(t,e);if(r(10,qr,0))throw new Error("Record batch compression not implemented");let o=n<mr.V4?8:0;return{length:r(4,Pe,0),nodes:Jn(t,r(6,qr),16,(i,s)=>({length:Pe(i,s),nullCount:Pe(i,s+8)})),regions:Jn(t,r(8,qr),16+o,(i,s)=>({offset:Pe(i,s+o),length:Pe(i,s+o+8)})),variadic:Jn(t,r(12,qr),8,Pe)}}function B7(t,e,n){let r=ln(t,e);return{id:r(4,Pe,0),data:r(6,(o,i)=>w0(o,i,n)),isDelta:r(8,Zi,!1)}}function Iw(t,e,n,r){Yn(n,z,ei);let o=ln(t,e);switch(n){case z.Binary:return uw();case z.Utf8:return $m();case z.LargeBinary:return yw();case z.LargeUtf8:return bw();case z.List:return Pm(r[0]);case z.ListView:return _w(r[0]);case z.LargeList:return ww(r[0]);case z.LargeListView:return Sw(r[0]);case z.Struct:return Fm(r);case z.RunEndEncoded:return vw(r[0],r[1]);case z.Int:return Om(o(4,Xt,0),o(6,Zi,!1));case z.Float:return fw(o(4,Je,Fc.HALF));case z.Decimal:return lw(o(4,Xt,0),o(6,Xt,0),o(8,Xt,128));case z.Date:return pw(o(4,Je,Ko.MILLISECOND));case z.Time:return dw(o(4,Je,De.MILLISECOND),o(6,Xt,32));case z.Timestamp:return Dm(o(4,Je,De.SECOND),o(6,aa));case z.Interval:return hw(o(4,Je,gr.YEAR_MONTH));case z.Duration:return gw(o(4,Je,De.MILLISECOND));case z.FixedSizeBinary:return xw(o(4,Xt,0));case z.FixedSizeList:return qm(r[0],o(4,Xt,0));case z.Map:return E7(o(4,Zi,!1),r[0]);case z.Union:return mw(o(4,Je,ti.Sparse),r,Jn(t,o(6,qr),4,Xt))}return{typeId:n}}function yl(t,e){let n=Jn(t,e,4,(r,o)=>{let i=ln(r,o);return[i(4,aa),i(6,aa)]});return n.length?new Map(n):null}function v0(t,e,n){let r=ln(t,e);return{version:n,endianness:r(4,Je,0),fields:r(6,Oq,[]),metadata:r(8,yl)}}function Oq(t,e){return Jn(t,e,4,z7)}function z7(t,e){let n=ln(t,e),r=n(8,ul,z.NONE),o=n(10,qr,0),i=n(12,Dq),s=n(14,(c,f)=>$q(c,f)),a=Iw(t,o,r,s);return i&&(i.dictionary=a,a=i),{name:n(4,aa),type:a,nullable:n(6,Zi,!1),metadata:n(16,yl)}}function $q(t,e){let n=Jn(t,e,4,z7);return n.length?n:null}function Dq(t,e){if(!e)return null;let n=ln(t,e);return Rm(null,n(6,Pq,zc()),n(8,Zi,!1),n(4,Pe,0))}function Pq(t,e){return Iw(t,e,z.Int)}var Fq=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,qq=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`,Bq=t=>`Unsupported message type: ${t} (${Lm(xr,t)})`;function _0(t,e){let n=Xt(t,e)||0;if(e+=sa,n===-1&&(n=Xt(t,e)||0,e+=sa),n===0)return null;let r=t.subarray(e,e+=n);if(r.byteLength<n)throw new Error(Fq(n,r.byteLength));let o=ln(r,0),i=o(4,Je,mr.V1),s=o(6,ul,xr.NONE),a=o(8,qr,0),c=o(10,Pe,0),f;if(a){let u=s===xr.Schema?v0:s===xr.DictionaryBatch?B7:s===xr.RecordBatch?w0:null;if(!u)throw new Error(Bq(s));if(f=u(r,a,i),c>0){let p=t.subarray(e,e+=c);if(p.byteLength<c)throw new Error(qq(c,p.byteLength));f.body=p}}return{version:i,type:s,index:e,content:f}}function Y7(t){let e=t instanceof ArrayBuffer?new Uint8Array(t):t;return e instanceof Uint8Array&&zq(e)?Uq(e):Yq(e)}function zq(t){if(!t||t.length<4)return!1;for(let e=0;e<6;++e)if(al[e]!==t[e])return!1;return!0}function Yq(t){let e=[t].flat(),n,r=[],o=[];for(let i of e){if(!(i instanceof Uint8Array))throw new Error("IPC data batch was not a Uint8Array.");let s=0;for(;;){let a=_0(i,s);if(a===null)break;if(s=a.index,!!a.content)switch(a.type){case xr.Schema:n||(n=a.content);break;case xr.RecordBatch:r.push(a.content);break;case xr.DictionaryBatch:o.push(a.content);break}}}return{schema:n,dictionaries:o,records:r,metadata:null}}function Uq(t){let e=t.byteLength-(al.length+4),n=Xt(t,e),r=ln(t,e-n),o=r(4,Je,mr.V1),i=r(8,Ew,[]),s=r(10,Ew,[]);return{schema:r(6,(a,c)=>v0(a,c,o)),dictionaries:i.map(({offset:a})=>_0(t,a).content),records:s.map(({offset:a})=>_0(t,a).content),metadata:r(12,yl)}}function Cw(t,e){return jq(Y7(t),e)}function jq(t,e={}){let{schema:n={fields:[]},dictionaries:r,records:o}=t,{version:i,fields:s}=n,a=new Map,c=Wq(e,i,a),f=new Map;Xq(n,l=>{let d=l.type;d.typeId===z.Dictionary&&f.set(d.id,d.dictionary)});let u=new Map;for(let l of r){let{id:d,data:h,isDelta:m,body:x}=l,g=f.get(d),y=Nw(g,c({...h,body:x}));if(u.has(d)){let b=u.get(d);m||b.clear(),b.add(y)}else{if(m)throw new Error("Delta update can not be first dictionary batch.");u.set(d,Tw(g).add(y))}}u.forEach((l,d)=>a.set(d,l.done()));let p=s.map(l=>Tw(l.type));for(let l of o){let d=c(l);s.forEach((h,m)=>p[m].add(Nw(h.type,d)))}return new jc(n,p.map(l=>l.done()),e.useProxy)}function Xq(t,e){t.fields.forEach(function n(r){e(r),r.type.dictionary?.children?.forEach(n),r.type.children?.forEach(n)})}function Wq(t,e,n){let r={version:e,options:t,dictionary:o=>n.get(o)};return o=>{let{length:i,nodes:s,regions:a,variadic:c,body:f}=o,u=-1,p=-1,l=-1;return{...r,length:i,node:()=>s[++u],buffer:d=>{let{length:h,offset:m}=a[++p];return d?new d(f.buffer,f.byteOffset+m,h/d.BYTES_PER_ELEMENT):f.subarray(m,m+h)},variadic:()=>c[++l],visit(d){return d.map(h=>Nw(h.type,this))}}}}function Nw(t,e){let{typeId:n}=t,{length:r,options:o,node:i,buffer:s,variadic:a,version:c}=e,f=gl(t,o);if(n===z.Null)return new f({length:r,nullCount:r,type:t});let u={...i(),type:t};switch(n){case z.Bool:case z.Int:case z.Time:case z.Duration:case z.Float:case z.Decimal:case z.Date:case z.Timestamp:case z.Interval:case z.FixedSizeBinary:return new f({...u,validity:s(),values:s(t.values)});case z.Utf8:case z.LargeUtf8:case z.Binary:case z.LargeBinary:return new f({...u,validity:s(),offsets:s(t.offsets),values:s()});case z.BinaryView:case z.Utf8View:return new f({...u,validity:s(),values:s(),data:Array.from({length:a()},()=>s())});case z.List:case z.LargeList:case z.Map:return new f({...u,validity:s(),offsets:s(t.offsets),children:e.visit(t.children)});case z.ListView:case z.LargeListView:return new f({...u,validity:s(),offsets:s(t.offsets),sizes:s(t.offsets),children:e.visit(t.children)});case z.FixedSizeList:case z.Struct:return new f({...u,validity:s(),children:e.visit(t.children)});case z.RunEndEncoded:return new f({...u,children:e.visit(t.children)});case z.Dictionary:{let{id:p,indices:l}=t;return new f({...u,validity:s(),values:s(l.values)}).setDictionary(e.dictionary(p))}case z.Union:return c<mr.V5&&s(),new f({...u,typeIds:s(cl),offsets:t.mode===ti.Sparse?null:s(t.offsets),children:e.visit(t.children)});default:throw new Error(ei(n))}}var Het=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;function bl(t){return Cw(t,{useDate:!0})}function S0(t="ws://localhost:3000/"){let e=[],n=!1,r=null,o,i={open(){n=!0,c()},close(){for(n=!1,r=null,o=null;e.length;)e.shift().reject("Socket closed")},error(f){if(r){let{reject:u}=r;r=null,c(),u(f)}else console.error("WebSocket error: ",f)},message({data:f}){if(r){let{query:u,resolve:p,reject:l}=r;if(r=null,c(),typeof f=="string"){let d=JSON.parse(f);d.error?l(d.error):p(d)}else if(u.type==="exec")p();else if(u.type==="arrow")p(bl(f));else throw new Error(`Unexpected socket data: ${f}`)}else console.log("WebSocket message: ",f)}};function s(){o=new WebSocket(t),o.binaryType="arraybuffer";for(let f in i)o.addEventListener(f,i[f])}function a(f,u,p){o==null&&s(),e.push({query:f,resolve:u,reject:p}),n&&!r&&c()}function c(){e.length&&(r=e.shift(),o.send(JSON.stringify(r.query)))}return{get connected(){return n},query(f){return new Promise((u,p)=>a(f,u,p))}}}var Xc="COLUMN_REF",M0="COLUMN_PARAM",H7="TABLE_REF",Q7="LITERAL",Z7="INTERVAL",A0="ORDER_BY",T0="CAST",E0="CASE",I0="WHEN",N0="UNARY",J7="UNARY_POSTFIX",C0="BINARY",k0="BETWEEN",L0="NOT_BETWEEN",R0="LOGICAL_OPERATOR",O0="IN",$0="FUNCTION",la="AGGREGATE",Wc="WINDOW",D0="WINDOW_DEF",P0="WINDOW_FRAME",K7="EXPRESSION",Vc="FRAGMENT",F0="VERBATIM",Gc="PARAM",tI="WITH_CLAUSE",q0="SELECT_CLAUSE",B0="FROM_CLAUSE";var eI="SAMPLE_CLAUSE";var z0="WINDOW_CLAUSE";var Y0="SELECT_QUERY",U0="DESCRIBE_QUERY",j0="SET_OPERATION";function pn(t){return t instanceof xe}var xe=class{constructor(e){this.type=e}},vt=class extends xe{};var pa=class extends vt{constructor(e){super(Q7),this.value=e}toString(){return kw(this.value)}};function kw(t){switch(typeof t){case"number":return Number.isFinite(t)?`${t}`:"NULL";case"string":return`'${t.replace("'","''")}'`;case"boolean":return t?"TRUE":"FALSE";default:if(t==null)return"NULL";if(t instanceof Date){let e=+t;if(Number.isNaN(e))return"NULL";let n=t.getUTCFullYear(),r=t.getUTCMonth(),o=t.getUTCDate();return e===Date.UTC(n,r,o)?`DATE '${n}-${r+1}-${o}'`:`epoch_ms(${e})`}else return t instanceof RegExp?`'${t.source}'`:`${t}`}}var Br=class extends vt{constructor(e){super(Gc),this.param=e}get value(){return this.param.value}toString(){return kw(this.value)}};function Lw(t){return t.split(".")}function zr(t){return`"${t}"`}function X0(t){return t&&mB(t)?t.slice(1,-1):t}function mB(t){return t[0]==='"'&&t[t.length-1]==='"'}function Ki(t){return t instanceof Hc}var Hc=class extends vt{constructor(e){super(H7),this.table=[e].flat()}get name(){return this.table[this.table.length-1]}toString(){return this.table.map(e=>zr(e)).join(".")}};var da=class extends vt{constructor(e,n=[]){super($0),this.name=e,this.args=n}toString(){let{name:e,args:n}=this;return`${e}(${n.join(", ")})`}};function Vt(t,...e){return new da(t,wl(e).map(Mt))}function Ot(t,...e){return new _l(t,wl(e).map(Mt))}function yr(t,...e){return new ha(new vl(t,wl(e).map(Mt)))}function Un(t,e=Mt){return t.flat().filter(n=>n!=null).map(n=>e(n))}function wl(t){let e=t.length,n=e;for(;n>0&&t[n-1]===void 0;--n);return n<e?t.slice(0,n):t}function br(t){return typeof t=="string"}function Sl(t){return Array.isArray(t)}function Yr(t){return t&&typeof t.addEventListener=="function"&&t.dynamic!==!1&&"value"in t}var Al=class extends xe{constructor(e,n){super(z0),this.name=e,this.def=n}toString(){return`${zr(this.name)} AS ${this.def}`}},ha=class t extends vt{constructor(e,n=new ma){super(Wc),this.func=e,this.def=n}over(e){return new t(this.func,this.def.over(e))}partitionby(...e){return new t(this.func,this.def.partitionby(...e))}orderby(...e){return new t(this.func,this.def.orderby(...e))}rows(e){return new t(this.func,this.def.rows(e))}range(e){return new t(this.func,this.def.range(e))}toString(){return`${this.func} OVER ${this.def}`}},vl=class extends da{constructor(e,n){super(e,n)}},ma=class extends xe{constructor(e,n,r,o){super(D0),this.name=e,this.partition=n,this.order=r,this.frame=o}over(e){return Ml(this,{name:e})}partitionby(...e){return Ml(this,{partition:Un(e)})}orderby(...e){return Ml(this,{order:Un(e)})}rows(e){return Ml(this,{frame:new Tl(e)})}range(e){return Ml(this,{frame:new Tl(e,!0)})}toString(){let{name:e,partition:n,order:r,frame:o}=this,i=e&&zr(e),s=[i,n?.length&&`PARTITION BY ${n.join(", ")}`,r?.length&&`ORDER BY ${r.join(", ")}`,o].filter(a=>a);return i&&s.length<2?i:`(${s.join(" ")})`}},Tl=class extends xe{constructor(e,n=!1,r=void 0){super(P0),this.extent=Yr(e)?new Br(e):e,this.range=n,this.exclude=r}toString(){let{range:e,exclude:n,extent:r}=this,o=e?"RANGE":"ROWS",[i,s]=pn(r)?r.value:r,a=nI(i,"PRECEDING"),c=nI(s,"FOLLOWING");return`${o} BETWEEN ${a} AND ${c}${n?` ${n}`:""}`}};function Ml(t,e){return new ma(e.name??t.name,e.partition??t.partition,e.order??t.order,e.frame??t.frame)}function nI(t,e){return t===0?"CURRENT ROW":Number.isFinite(t)?`${Math.abs(t)} ${e}`:`UNBOUNDED ${e}`}function ts(t){return t instanceof ri}var ri=class extends vt{constructor(e,n){super(e),this.table=n}get column(){return null}toString(){let{column:e,table:n}=this,r=`${n??""}`,o=e==="*"?"*":zr(e);return(r?r+".":"")+o}},El=class extends ri{constructor(e,n){super(Xc,n),this.name=e}get column(){return this.name}};var Il=class extends ri{constructor(e,n){super(M0,n),this.param=e}get column(){return`${this.param.value}`}};function oi(t,e){let n=xa(e);return Yr(t)?new Il(new Br(t),n):new El(t,n)}var ga=class extends vt{constructor(e){super(F0),this.value=e}toString(){return this.value}};function Fe(t){return new pa(t)}function rI(t){return new ga(t)}function W0(...t){let e=Un(t,String);return e?.length?new Hc(e):void 0}function Mt(t){return br(t)?xB(t):ba(t)}function ya(t){return br(t)?rI(t):ba(t)}function ba(t){return t instanceof vt?t:Yr(t)?new Br(t):Fe(t)}function xa(t){return br(t)?gB(t):Sl(t)?W0(t):t}function xB(t){let e=Lw(t);return oi(e.pop(),W0(e))}function gB(t){return W0(Lw(t))}function Rw(){return new ma}var _l=class t extends vt{constructor(e,n,r,o){super(la),this.name=e,this.args=n,this.isDistinct=r,this.filter=o}distinct(e=!0){return new t(this.name,this.args,e,this.filter)}where(e){return br(e)&&(e=ya(e)),new t(this.name,this.args,this.isDistinct,e)}window(){return new ha(this)}partitionby(...e){return this.window().partitionby(...e)}orderby(...e){return this.window().orderby(...e)}toString(){let{name:e,args:n,isDistinct:r,filter:o}=this,i=r?"DISTINCT ":"",s=n?.length?n.join(", "):"*",a=o?` FILTER (WHERE ${o})`:"";return`${e}(${i}${s})${a}`}},oI=["any_value","approx_count_distinct","approx_quantile","arbitrary","arg_max","arg_max_null","arg_min","arg_min_null","array_agg","avg","bit_and","bit_or","bit_xor","bitstring_agg","bool_and","bool_or","corr","count","covar_pop","covar_samp","entropy","favg","first","fsum","geomean","kurtosis_pop","kurtosis","last","mad","max","max_by","median","min","min_by","mode","product","quantile","quantile_cont","quantile_disc","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_sxx","regr_sxy","regr_syy","regr_slope","reservoir_quantile","skewness","stddev","stddev_pop","stddev_samp","string_agg","sum","variance","var_pop","var_samp"];var V0=class extends vt{constructor(e,n,r){super(e),this.expr=n,this.extent=r}toSQL(e){let{extent:n,expr:r}=this;return n?`(${r} ${e} ${n[0]} AND ${n[1]})`:""}},wa=class extends V0{constructor(e,n){super(k0,e,n)}toString(){return super.toSQL("BETWEEN")}},Nl=class extends V0{constructor(e,n){super(L0,e,n)}toString(){return super.toSQL("NOT BETWEEN")}};var Cl=class extends vt{constructor(e,n,r){super(C0),this.op=e,this.left=n,this.right=r}toString(){return`(${this.left} ${this.op} ${this.right})`}};var Qc=class t extends vt{constructor(e=void 0,n=[],r=void 0){super(E0),this.expr=e,this._when=n,this._else=r}when(e,n){return new t(this.expr,this._when.concat(new Zc(Mt(e),Mt(n))),this._else)}else(e){return new t(this.expr,this._when,Mt(e))}toString(){return"CASE "+(this.expr?`${this.expr} `:"")+this._when.join(" ")+(this._else?` ELSE ${this._else}`:"")+" END"}},Zc=class extends xe{constructor(e,n){super(I0),this.when=e,this.then=n}toString(){return`WHEN ${this.when} THEN ${this.then}`}};var kl=class extends vt{constructor(e,n){super(T0),this.expr=e,this.cast=n}toString(){return`(${this.expr})::${this.cast}`}};var Ll=class extends vt{constructor(e){super(Vc),this.spans=e}toString(){return this.spans.join("")}};var Rl=class extends xe{constructor(e,n=!1,r=void 0,o=void 0){super(eI),this.size=e,this.perc=n,this.method=r,this.seed=o}toString(){let{size:e,perc:n,method:r,seed:o}=this,i=n?"%":" ROWS",s=o!=null?`, ${o}`:"";return`${e}${i}${r?` (${r}${s})`:""}`}};var Ol=class extends xe{constructor(e,n){super(q0),this.expr=e,this.alias=n}toString(){let{expr:e,alias:n}=this;return!n||yB(e,n)?`${e}`:`${e} AS ${zr(n)}`}};function yB(t,e){return t instanceof ri&&t.table==null&&t.column===e}var $l=class extends xe{constructor(e,n){super(tI),this.name=e,this.query=n}toString(){return`"${this.name}" AS (${this.query})`}};function G0(t){return t instanceof st}function es(t){return t instanceof _a}function Ow(t){return t instanceof Dl}var st=class extends vt{static select(...e){return new _a().select(...e)}static from(...e){return new _a().from(...e)}static with(...e){return new _a().with(...e)}static union(...e){return new va("UNION",e.flat())}static unionAll(...e){return new va("UNION ALL",e.flat())}static intersect(...e){return new va("INTERSECT",e.flat())}static except(...e){return new va("EXCEPT",e.flat())}static describe(e){return new Dl(e)}constructor(e){super(e),this._orderby=[],this._limit=void 0,this._offset=void 0,this.cteFor=null}get subqueries(){return[]}clone(){return this}orderby(...e){return this._orderby=this._orderby.concat(Un(e)),this}limit(e){return this._limit=Number.isFinite(e)?e:void 0,this}offset(e){return this._offset=Number.isFinite(e)?e:void 0,this}},_a=class t extends st{constructor(){super(Y0),this._with=[],this._select=[],this._from=[],this._where=[],this._sample=void 0,this._groupby=[],this._having=[],this._window=[],this._qualify=[]}get subqueries(){let e=this.cteFor||this,r=(e instanceof t?e._with:[]).reduce((i,s)=>(i[s.name]=s.query,i),{}),o=[];return this._from.forEach(({expr:i})=>{if(G0(i))o.push(i);else if(Ki(i)){let s=r[i.name];s&&o.push(s)}}),o}clone(){return Object.assign(new t,this)}with(...e){let n=[],r=(o,i)=>{let s=i.clone();s.cteFor=this,n.push(new $l(o,s))};return e.flat().forEach(o=>{if(o!=null)for(let i in o)r(i,o[i])}),this._with=this._with.concat(n),this}select(...e){let n=[],r=(i,s)=>n.push(new Ol(i==null?i:Mt(i),X0(s)));e.flat().forEach(i=>{if(i!=null)if(br(i))r(i,i);else if(ts(i))r(i,i.column);else if(Sl(i))r(i[1],i[0]);else for(let s in i)r(i[s],s)});let o=new Set(n.map(i=>i.alias));return this._select=this._select.filter(i=>!o.has(i.alias)).concat(n.filter(i=>i.expr)),this}setSelect(...e){return this._select=[],this.select(...e)}distinct(e=!0){return this._distinct=!!e,this}from(...e){let n=[],r=(o,i)=>n.push(new Pl(xa(o),X0(i)));return e.flat().forEach(o=>{if(o!=null)if(br(o))r(o,o);else if(Ki(o))r(o,o.name);else if(pn(o))r(o);else if(Sl(o))r(o[1],o[0]);else for(let i in o)r(o[i],i)}),this._from=this._from.concat(n),this}setFrom(...e){return this._from=[],this.from(...e)}sample(e,n,r){let o;if(typeof e=="number"){let i=e>0&&e<1,s=i?e*100:Math.floor(e);o=new Rl(s,i,n,r)}else o=e;return this._sample=o,this}where(...e){return this._where=this._where.concat(Un(e,ya)),this}setWhere(...e){return this._where=[],this.where(...e)}groupby(...e){return this._groupby=this._groupby.concat(Un(e)),this}setGroupby(...e){return this._groupby=[],this.groupby(...e)}having(...e){return this._having=this._having.concat(Un(e,ya)),this}window(...e){let n=[];return e.flat().forEach(r=>{if(r!=null)for(let o in r)n.push(new Al(X0(o),r[o]))}),this._window=this._window.concat(n),this}qualify(...e){return this._qualify=this._qualify.concat(Un(e,ya)),this}toString(){let{_with:e,_select:n,_distinct:r,_from:o,_sample:i,_where:s,_groupby:a,_having:c,_window:f,_qualify:u,_orderby:p,_limit:l,_offset:d}=this,h=[];if(e.length&&h.push(`WITH ${e.join(", ")}`),h.push(`SELECT${r?" DISTINCT":""} ${n.join(", ")}`),o.length&&h.push(`FROM ${o.join(", ")}`),s.length){let m=s.map(String).filter(x=>x).join(" AND ");m&&h.push(`WHERE ${m}`)}if(i&&h.push(`USING SAMPLE ${i}`),a.length&&h.push(`GROUP BY ${a.join(", ")}`),c.length){let m=c.map(String).filter(x=>x).join(" AND ");m&&h.push(`HAVING ${m}`)}if(f.length&&h.push(`WINDOW ${f.join(", ")}`),u.length){let m=u.map(String).filter(x=>x).join(" AND ");m&&h.push(`QUALIFY ${m}`)}return p.length&&h.push(`ORDER BY ${p.join(", ")}`),Number.isFinite(l)&&h.push(`LIMIT ${l}`),Number.isFinite(d)&&h.push(`OFFSET ${d}`),h.join(" ")}},Dl=class t extends xe{constructor(e){super(U0),this.query=e}clone(){return new t(this.query.clone())}toString(){return`DESCRIBE ${this.query}`}},va=class t extends st{constructor(e,n){super(j0),this.op=e,this.queries=n}get subqueries(){let{queries:e,cteFor:n}=this;return n&&e.forEach(r=>r.cteFor=n),e}clone(){let{op:e,queries:n,...r}=this;return Object.assign(new t(e,n),r)}toString(){let{op:e,queries:n,_orderby:r,_limit:o,_offset:i}=this,s=[n.join(` ${e} `)];return r.length&&s.push(`ORDER BY ${r.join(", ")}`),Number.isFinite(o)&&s.push(`LIMIT ${o}`),Number.isFinite(i)&&s.push(`OFFSET ${i}`),s.join(" ")}};var Pl=class extends xe{constructor(e,n){super(B0),this.expr=e,this.alias=n}toString(){let{expr:e,alias:n}=this,r=G0(e)?`(${e})`:`${e}`;return n&&!(Ki(e)&&e.table.join(".")===n)?`${r} AS ${zr(n)}`:`${r}`}};var Fl=class extends vt{constructor(e,n){super(O0),this.expr=e,this.values=n}toString(){return`(${this.expr} IN (${this.values.join(", ")}))`}};var ql=class extends vt{constructor(e,n=1){super(Z7),this.name=e,this.steps=n}toString(){return`INTERVAL ${this.steps} ${this.name}`}};var H0=class extends vt{constructor(e,n){super(R0),this.op=e,this.clauses=n}toString(){let e=this.clauses;return e.length===0?"":e.length===1?`${e[0]}`:`(${e.join(` ${this.op} `)})`}},Bl=class extends H0{constructor(e){super("AND",e)}},zl=class extends H0{constructor(e){super("OR",e)}};var Jc=class extends vt{constructor(e,n,r){super(A0),this.expr=e,this.desc=n,this.nullsFirst=r}toString(){let{expr:e,desc:n,nullsFirst:r}=this;return`${e}${n?" DESC":n===!1?" ASC":""}${r?" NULLS FIRST":r===!1?" NULLS LAST":""}`}};var Q0=class extends vt{constructor(e,n,r){super(e),this.op=n,this.expr=r}},Yl=class extends Q0{constructor(e,n){super(N0,e,n)}toString(){return`(${this.op} ${this.expr})`}},Ul=class extends Q0{constructor(e,n){super(J7,e,n)}toString(){return`(${this.expr} ${this.op})`}};function ns(t,e){return Ot("arg_max",t,e)}function rs(t,e){return Ot("arg_min",t,e)}function $w(t){return Ot("array_agg",t)}function jl(t){return Ot("avg",t)}function Dw(t,e){return Ot("corr",t,e)}function qe(t){return Ot("count",t)}function Pw(t,e){return Ot("covar_samp",t,e)}function Fw(t,e){return Ot("covar_pop",t,e)}function qw(t){return Ot("entropy",t)}function Bw(t){return Ot("first",t)}function zw(t){return Ot("kurtosis",t)}function Yw(t){return Ot("mad",t)}function Ke(t){return Ot("max",t)}function Uw(t){return Ot("median",t)}function jn(t){return Ot("min",t)}function jw(t){return Ot("mode",t)}function Xw(t){return Ot("last",t)}function Ww(t){return Ot("product",t)}function Vw(t,e){return Ot("quantile",t,e)}function Xl(t,e){return Ot("regr_avgx",t,e)}function Gw(t,e){return Ot("regr_avgy",t,e)}function Wl(t,e){return Ot("regr_count",t,e)}function Hw(t,e){return Ot("regr_intercept",t,e)}function Qw(t,e){return Ot("regr_sxx",t,e)}function Zw(t,e){return Ot("regr_syy",t,e)}function Jw(t,e){return Ot("regr_slope",t,e)}function Kw(t){return Ot("skewness",t)}function Vl(t){return Ot("stddev",t)}function tv(t){return Ot("stddev_pop",t)}function ev(t){return Ot("string_agg",t)}function Yt(t){return Ot("sum",t)}function nv(t){return Ot("var_samp",t)}function rv(t){return Ot("var_pop",t)}function ii(t,e,n){return t?new Qc(void 0,[new Zc(Mt(t),Mt(e))],Mt(n)):new Qc}function Kc(t,e){return new kl(Mt(t),e)}function Gt(t){return Kc(t,"INTEGER")}function ov(t){return Kc(t,"FLOAT")}function pe(t){return Kc(t,"DOUBLE")}function Z0(t,e){return new ql(t,e)}function iv(t){return Vt("epoch_ms",t)}function sv(t,e,n=1){return Vt("time_bucket",Z0(e,n),t)}function av(t){return Vt("make_date",2012,Vt("month",t),1)}function cv(t){let e=Mt(t);return Vt("make_date",2012,Vt("month",e),Vt("day",e))}function fv(t){return Vt("make_date",2012,1,Vt("day",t))}function uv(...t){return Vt("greatest",...t)}function J0(t){return Vt("exp",t)}function lv(t){return Vt("log",t)}function tf(t){return Vt("ln",t)}function Ur(t){return Vt("sign",t)}function Be(t){return Vt("abs",t)}function si(t){return Vt("sqrt",t)}function pv(t){return Vt("ceil",t)}function ze(t){return Vt("floor",t)}function ai(t,e){return Vt("round",t,e)}function bB(t,e){return new Yl(t,Mt(e))}function iI(t,e){return new Ul(t,Mt(e))}function Xn(t,e,n){return new Cl(t,Mt(e),Mt(n))}function sI(t,e,n=!1){let r=n?Nl:wa;return new r(Mt(t),e?.map(Mt))}function dn(...t){return new Bl(Un(t))}function wr(...t){return new zl(Un(t))}function dv(t){return bB("NOT",t)}function Sa(t){return iI("IS NULL",t)}function vr(t){return iI("IS NOT NULL",t)}function Gl(t,e){return Xn("&",t,e)}function Rt(t,e){return Xn("+",t,e)}function pt(t,e){return Xn("-",t,e)}function mt(t,e){return Xn("*",t,e)}function Pt(t,e){return Xn("/",t,e)}function ve(t,e){return Xn("**",t,e)}function hv(t,e){return Xn("=",t,e)}function jr(t,e){return Xn("<>",t,e)}function ae(t,e){return Xn("<",t,e)}function _r(t,e){return Xn(">",t,e)}function Kn(t,e){return Xn("<=",t,e)}function mv(t,e){return Xn(">=",t,e)}function xv(t,e){return Xn("IS DISTINCT FROM",t,e)}function ef(t,e){return Xn("IS NOT DISTINCT FROM",t,e)}function tn(t,e){return sI(t,e,!1)}function gv(t,e){return sI(t,e,!0)}function yv(t,e){return new Fl(Mt(t),e.map(Mt))}function bv(t,e){return new Jc(Mt(t),!1,e)}function wv(t,e){return new Jc(Mt(t),!0,e)}function Hl(t){return Vt("st_asgeojson",t)}function aI(t){return Vt("st_x",t)}function cI(t){return Vt("st_y",t)}function Ql(t){return Vt("st_centroid",t)}function vv(t){return aI(Ql(t))}function _v(t){return cI(Ql(t))}function ge(t,...e){return new Ll(wB(t,e))}function wB(t,e){let n=[t[0]],r=e.length;for(let o=0,i=0;o<r;){let s=e[o];pn(s)?n[++i]=s:Yr(s)?n[++i]=new Br(s):n[i]+=br(s)?s:Fe(s);let a=t[++o];pn(n[i])?n[++i]=a:n[i]+=a}return n.filter(o=>o).map(o=>br(o)?new ga(o):o)}function K0(t,e,...n){return Vt(t,e,...wl(n).map(ba))}function Sv(t,e,n){return K0("regexp_matches",t,e,n)}function Mv(t,e){return K0("contains",t,e)}function Av(t,e){return K0("starts_with",t,e)}function Tv(t,e){return K0("ends_with",t,e)}function Ev(){return yr("row_number")}function Iv(){return yr("rank")}function Nv(){return yr("dense_rank")}function Cv(){return yr("percent_rank")}function kv(){return yr("cume_dist")}function Lv(t){return yr("ntile",t)}function Rv(t,e,n){return yr("lag",t,e,n)}function nf(t,e,n){return yr("lead",t,e,n)}function Ov(t){return yr("first_value",t)}function $v(t){return yr("last_value",t)}function Dv(t,e){return yr("nth_value",t,e)}var tx={[la]:["args","filter"],[k0]:["expr","extent"],[C0]:["left","right"],[E0]:["expr","_when","_else"],[T0]:["expr"],[M0]:["param","table"],[Xc]:["table"],[U0]:["query"],[K7]:["node"],[Vc]:["spans"],[B0]:["expr"],[$0]:["args"],[O0]:["expr","values"],[R0]:["clauses"],[L0]:["expr","extent"],[A0]:["expr"],[Gc]:["value"],[q0]:["expr"],[Y0]:["_with","_select","_from","_where","_sample","_groupby","_having","_window","_qualify","_orderby"],[j0]:["subqueries","_orderby"],[N0]:["expr"],[I0]:["when","then"],[Wc]:["func","def"],[z0]:["def"],[D0]:["partition","order","frame"],[P0]:["extent"]};function Zl(t,e){if(e.has(t))return e.get(t);if(pn(t)){let n=tx[t.type],r=n?.length??0;for(let o=0;o<r;++o){let i=n[o],s=t[i];if(Array.isArray(s)){let a=s.length;for(let c=0;c<a;++c)s[c]=Zl(s[c],e)}else s&&(t[i]=Zl(s,e))}}return t}function ao(t,e){if(!pn(t))return;let n=e(t);if(n)return n;let r=tx[t.type],o=r?.length??0;for(let i=0;i<o;++i){let s=t[r[i]];if(Array.isArray(s)){let a=s.length;for(let c=0;c<a;++c)if(s[c]&&+ao(s[c],e)<0)return n}else if(s&&+ao(s,e)<0)return-1}}var vB=new RegExp(`^(${oI.join("|")})$`),_B=/(\\'|\\"|"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\w+\()/g;function SB(t){return t.split(_B).some(e=>e.endsWith("(")&&vB.test(e.slice(0,-1)))}function tr(t){let e=0;return ao(t,n=>{switch(n.type){case Wc:return-1;case la:return e|=1,-1;case Vc:case F0:{let r=`${n}`.toLowerCase(),o=r.indexOf("(select ");return o>=0&&(r=r.slice(0,o)),r.includes(") over ")?-1:SB(r)?(e|=2,-1):1}}}),e}function Pv(t){let e=new Set;return ao(t,n=>{n.type===la&&e.add(n)}),Array.from(e)}function rf(t){let e={};return ao(t,n=>{n.type===Xc&&(e[n]=n)}),Object.values(e)}function Fv(t){let e=new Set;return ao(t,n=>{n.type===Gc&&e.add(n.param)}),Array.from(e)}function co(t,e,{replace:n=!1,temp:r=!1,view:o=!1}={}){return"CREATE"+(n?" OR REPLACE ":" ")+(r?"TEMP ":"")+(o?"VIEW":"TABLE")+(n?" ":" IF NOT EXISTS ")+t+" AS "+e}function qv(t,{strict:e=!1}={}){return"CREATE SCHEMA "+(e?"":"IF NOT EXISTS ")+t}function Jl(t){return`INSTALL ${t}; LOAD ${t}`}function fI(t,{columns:e=Object.keys(t?.[0]||{})}={}){let n=[];if(Array.isArray(e)?(n=e,e=n.reduce((o,i)=>(o[i]=i,o),{})):e&&(n=Object.keys(e)),!n.length)throw new Error("Can not create table from empty column set.");let r=[];for(let o of t){let i=n.map(s=>`${ba(o[s])} AS "${e[s]}"`);r.push(`(SELECT ${i.join(", ")})`)}return r.join(" UNION ALL ")}function ex(t,e,n,r={},o={}){let{select:i=["*"],where:s,view:a,temp:c,replace:f,...u}=r,p=MB({...o,...u}),l=`${t}('${n}'${p?", "+p:""})`,d=s?` WHERE ${s}`:"",h=`SELECT ${i.join(", ")} FROM ${l}${d}`;return co(e,h,{view:a,temp:c,replace:f})}function zv(t,e,n){return ex("read_csv",t,e,n,{auto_detect:!0,sample_size:-1})}function Yv(t,e,n){return ex("read_json",t,e,n,{auto_detect:!0,format:"auto"})}function Uv(t,e,n){return ex("read_parquet",t,e,n)}function jv(t,e,n={}){let{options:r,...o}=n;if(r){let i=Array.isArray(r)?r.join(", "):typeof r=="string"?r:Object.entries(r).map(([s,a])=>`${s}=${a}`).join(", ");Object.assign(o,{open_options:i.toUpperCase()})}return ex("st_read",t,e,o)}function Xv(t,e,n={}){let{select:r=["*"],...o}=n,i=fI(e),s=r.length===1&&r[0]==="*"?i:`SELECT ${r} FROM ${i}`;return co(t,s,o)}function MB(t){return Object.entries(t).map(([e,n])=>`${e}=${Bv(n)}`).join(", ")}function Bv(t){switch(typeof t){case"boolean":return String(t);case"string":return`'${t}'`;case"undefined":case"object":return t==null?"NULL":Array.isArray(t)?"["+t.map(e=>Bv(e)).join(", ")+"]":"{"+Object.entries(t).map(([e,n])=>`'${e}': ${Bv(n)}`).join(", ")+"}";default:return t}}function Wv(t,e,n,r,o){let i=o?pt(n,pe(t)):pt(pe(t),e),s=n===e?0:r/(n-e);return s?mt(i,pe(s)):i}function Vv(t,e,n,r,o,i){return t.select({index:Rt(Gt(ze(e)),mt(Gt(ze(n)),o)),...r}).groupby("index",i)}function Gv(t,e,n){let r=n?s=>mt(s,n):s=>s,o=ze(e),i=Rt(o,1);return st.from(st.unionAll(t.clone().select({i:Gt(o),w:r(pt(i,e))}),t.clone().select({i:Gt(i),w:r(pt(e,o))}))).select({index:"i",density:Yt("w")}).groupby("index").having(jr("density",0))}function AB(t){return t}function Hv(t,e,n,r,o,i){let s=r?g=>mt(g,r):AB,a=(g,y)=>t.clone().select({xp:e,yp:n,i:g,w:y}),c=(g,y)=>Rt(g,mt(y,o)),f=Gt(ze(e)),u=Gt(ze(n)),p=Rt(f,1),l=Rt(u,1),d=pt(e,f),h=pt(p,e),m=pt(n,u),x=pt(l,n);return st.from(st.unionAll(a(c(f,u),s(mt(h,x))),a(c(f,l),s(mt(h,m))),a(c(p,u),s(mt(d,x))),a(c(p,l),s(mt(d,m))))).select({index:"i",density:Yt("w")},i).groupby("index",i).having(jr("density",0))}function Qv(t,e,n,r,o,i,s=[],a=!0){t.select({x:Gt(ze(e)),y:Gt(ze(n))});let c=s.concat(r),f=st.from(t).select(c,{x0:"x",y0:"y",dx:pt(nf("x").over("sw"),"x"),dy:pt(nf("y").over("sw"),"y")}).window({sw:Rw().partitionby(c).orderby(bv("x"))}).qualify([wr(ae("x0",o),ae(Rt("x0","dx"),o)),wr(ae("y0",i),ae(Rt("y0","dy"),i)),wr(_r("x0",0),_r(Rt("x0","dx"),0)),wr(_r("y0",0),_r(Rt("y0","dy"),0))]),u=st.select({x:uv(Ke(Be("dx")),Ke(Be("dy")))}).from("pairs"),p=st.select({i:Gt(ge`UNNEST(range((${u})))`)}),l=st.unionAll(st.select(c,{x:Rt("x0","i"),y:Rt("y0",Gt(ai(Pt(mt("i","dy"),"dx"))))}).from("pairs","indices").where([Kn(Be("dy"),Be("dx")),ae("i",Be("dx"))]),st.select(c,{x:Rt("x0",Gt(ai(Pt(mt(mt(Ur("dy"),"i"),"dx"),"dy")))),y:Rt("y0",mt(Ur("dy"),"i"))}).from("pairs","indices").where([_r(Be("dy"),Be("dx")),ae("i",Be("dy"))]),st.select(c,{x:"x0",y:"y0"}).from("pairs").where(Sa("dx"))),d=st.from("raster").select(c,"x","y",a?{w:Pt(1,qe().partitionby(["x"].concat(c)))}:null).where([Kn(0,"x"),ae("x",o),Kn(0,"y"),ae("y",i)]);return st.with({pairs:f,indices:p,raster:l,points:d}).from("points").select(s,{index:Rt("x",mt("y",Gt(o))),density:a?Yt("w"):qe()}).groupby("index",s)}function Zv(t,e,n,r,o=[]){let i=Gt(ze(e)),s=a=>st.from(t).select(a).groupby(i,o);return st.union(s([{[n]:jn(n),[r]:rs(r,n)},...o]),s([{[n]:Ke(n),[r]:ns(r,n)},...o]),s([{[n]:rs(n,r),[r]:jn(r)},...o]),s([{[n]:ns(n,r),[r]:Ke(r)},...o])).orderby(o,n)}var nx=t=>t;function uI(){return{apply:nx,invert:nx,sqlApply:Mt,sqlInvert:nx}}function TB({base:t=null}={}){if(t==null||t===Math.E)return{apply:Math.log,invert:Math.exp,sqlApply:e=>tf(e),sqlInvert:e=>J0(e)};if(t===10)return{apply:Math.log10,invert:e=>Math.pow(10,e),sqlApply:e=>lv(e),sqlInvert:e=>ve(10,e)};{let e=+t;return{apply:n=>Math.log(n)/Math.log(e),invert:n=>Math.pow(e,n),sqlApply:n=>Pt(tf(n),tf(e)),sqlInvert:n=>ve(e,n)}}}function EB({constant:t=1}={}){let e=+t;return{apply:n=>Math.sign(n)*Math.log1p(Math.abs(n)),invert:n=>Math.sign(n)*Math.exp(Math.abs(n)-e),sqlApply:n=>(n=Mt(n),mt(Ur(n),tf(Rt(e,Be(n))))),sqlInvert:n=>mt(Ur(n),pt(J0(Be(n)),e))}}function IB(){return{apply:t=>Math.sign(t)*Math.sqrt(Math.abs(t)),invert:t=>Math.sign(t)*t*t,sqlApply:t=>(t=Mt(t),mt(Ur(t),si(Be(t)))),sqlInvert:t=>mt(Ur(t),ve(t,2))}}function NB({exponent:t=1}={}){let e=+t;return{apply:n=>Math.sign(n)*Math.pow(Math.abs(n),e),invert:n=>Math.sign(n)*Math.pow(Math.abs(n),1/e),sqlApply:n=>(n=Mt(n),mt(Ur(n),ve(Be(n),e))),sqlInvert:n=>mt(Ur(n),ve(Be(n),Pt(1,e)))}}function lI(){return{apply:t=>+t,invert:t=>new Date(t),sqlApply:t=>t instanceof Date?Fe(+t):kB(t)?Fe(+t.value):iv(t),sqlInvert:nx}}var CB={identity:uI,linear:uI,log:TB,symlog:EB,sqrt:IB,pow:NB,time:lI,utc:lI};function Kl(t){let e=CB[t.type];return e?{...t,...e(t)}:null}function kB(t){return t instanceof pa&&t.value instanceof Date}function rx(t){let e=2166136261;for(let n=0,r=t.length;n<r;++n){let o=t.charCodeAt(n),i=o&65280;i&&(e=pI(e^i>>8)),e=pI(e^o&255)}return LB(e)>>>0}function pI(t){return t+(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)}function LB(t){return t+=t<<13,t^=t>>>7,t+=t<<3,t^=t>>>17,t+=t<<5,t&4294967295}function hI(t,e,n){switch(t.name){case"count":case"sum":return RB(e,t);case"avg":return OB(e,t);case"arg_max":return $B(e,t);case"arg_min":return DB(e,t);case"variance":case"var_samp":return ox(e,t,n);case"var_pop":return ox(e,t,n,!1);case"stddev":case"stddev_samp":return si(ox(e,t,n));case"stddev_pop":return si(ox(e,t,n,!1));case"covar_samp":return ix(e,t,n);case"covar_pop":return ix(e,t,n,!1);case"corr":return dI(e,t,n);case"regr_count":return of(e,t).expr;case"regr_avgx":return yI(e,t);case"regr_avgy":return bI(e,t);case"regr_syy":return Kv(e,0,t,n);case"regr_sxx":return Kv(e,1,t,n);case"regr_sxy":return ix(e,t,n,null);case"regr_slope":return wI(e,t,n);case"regr_intercept":return PB(e,t,n);case"regr_r2":return ve(dI(e,t,n),2);case"max":case"min":case"bit_and":case"bit_or":case"bit_xor":case"bool_and":case"bool_or":case"product":{let r=mI(t);return e[r]=t,ge`${t.name}("${r}")`}default:return null}}function mI(t){return"pre_"+rx(`${t}`).toString(16)}function Mn(t,e,n){let r=n?.filter;r&&(e=e.filter?e.where(dn(r,e.filter)):e.where(r));let o=mI(e);return t[o]=e,o}function xI(t,e){let n=Mn(t,qe(e.args[0]),e);return{expr:Yt(n),name:n}}function RB(t,e){return Yt(Mn(t,e))}function OB(t,e){let n=Mn(t,e),{expr:r,name:o}=xI(t,e);return Pt(Yt(mt(n,o)),r)}function $B(t,e){let n=Mn(t,e),r=Mn(t,Ke(e.args[1]),e);return ns(n,r)}function DB(t,e){let n=Mn(t,e),r=Mn(t,jn(e.args[1]),e);return rs(n,r)}function ox(t,e,n,r=!0){let o=e.args[0],{expr:i}=xI(t,e),s=pt(o,n(o)),a=Mn(t,Yt(ve(s,2)),e),c=Mn(t,Yt(s),e),f=r?pt(i,1):i;return Pt(pt(Yt(a),Pt(ve(Yt(c),2),i)),f)}function ix(t,e,n,r=!0){let{expr:o}=of(t,e),i=gI(t,e,n),s=tp(t,1,e,n),a=tp(t,0,e,n),c=pt(i,Pt(mt(s,a),o));return r===null?c:r?Pt(c,pt(o,1)):Pt(c,o)}function dI(t,e,n){let{expr:r}=of(t,e),o=gI(t,e,n),i=Jv(t,1,e,n),s=Jv(t,0,e,n),a=tp(t,1,e,n),c=tp(t,0,e,n),f=pt(i,Pt(ve(a,2),r)),u=pt(s,Pt(ve(c,2),r));return Pt(pt(o,Pt(mt(a,c),r)),si(mt(f,u)))}function of(t,e){let[n,r]=e.args,o=Mn(t,Wl(n,r),e);return{expr:Yt(o),name:o}}function tp(t,e,n,r){let o=n.args,i=o[e],s=o[1-e],a=Yt(pt(i,r(i))).where(vr(s));return Yt(Mn(t,a,n))}function Jv(t,e,n,r){let o=n.args,i=o[e],s=o[1-e],a=Yt(ve(pt(i,r(i)),2)).where(vr(s));return Yt(Mn(t,a,n))}function gI(t,e,n){let[r,o]=e.args,i=Yt(mt(pt(o,n(o)),pt(r,n(r))));return Yt(Mn(t,i,e))}function yI(t,e){let[n,r]=e.args,{expr:o,name:i}=of(t,e),s=Mn(t,Xl(n,r),e);return Pt(Yt(mt(s,i)),o)}function bI(t,e){let[n,r]=e.args,{expr:o,name:i}=of(t,e),s=Mn(t,Gw(n,r),e);return Pt(Yt(mt(s,i)),o)}function Kv(t,e,n,r){let{expr:o}=of(t,n),i=tp(t,e,n,r),s=Jv(t,e,n,r);return pt(s,Pt(ve(i,2),o))}function wI(t,e,n){let r=ix(t,e,n,null),o=Kv(t,1,e,n);return Pt(r,o)}function PB(t,e,n){let r=yI(t,e),o=bI(t,e),i=wI(t,e,n);return pt(o,mt(i,r))}function vI(t){if(!t.filterStable)return null;let e=t.query();if(!es(e))return null;let n=sx(e,c=>{let f=c._from[0]?.expr;return Ki(f)?f.name:f});if(typeof n!="string")return null;let r=new Map,o={},i={},s=[],a=c=>{let f=c.column,u=sx(e,p=>p._select.find(l=>l.alias===f)?.expr);return ge`(SELECT avg(${u??c}) FROM "${n}")`};for(let{alias:c,expr:f}of e._select){if(tr(f)>1)return null;let u=Pv(f);if(u.length===0)s.push(c),o[c]=f;else{for(let p of u){if(p.isDistinct)return null;let l=hI(p,o,a);if(!l)return null;r.set(p,l)}i[c]=Zl(f,r)}}return r.size?{group:s,preagg:o,output:i}:null}function sx(t,e){let n=t.subqueries;if(es(t)&&n.length===0)return e(t);let r=sx(n[0],e);for(let o=1;o<n.length;++o){let i=sx(n[o],e);if(i!==void 0&&i!==r)return NaN}return r}var FB={skip:!0,result:null},ax=class{constructor(e,{schema:n="mosaic",enabled:r=!0}={}){this.entries=new Map,this.active=null,this.mc=e,this._schema=n,this._enabled=r}set enabled(e){this._enabled!==e&&(e||this.clear(),this._enabled=e)}get enabled(){return this._enabled}set schema(e){this._schema!==e&&(this.clear(),this._schema=e)}get schema(){return this._schema}dropSchema(){return this.clear(),this.mc.exec(`DROP SCHEMA IF EXISTS "${this.schema}" CASCADE`)}clear(){this.entries.clear(),this.active=null}request(e,n,r){if(!this.enabled)return null;let{entries:o,mc:i,schema:s}=this,{source:a}=r;if(!a||this.active&&(this.active.source!==a&&this.clear(),this.active?.source===null))return null;let{active:c}=this;if(!c&&(this.active=c=qB(r),c.source===null))return null;if(o.has(e))return o.get(e);let f=vI(e),u;if(!f)u=null;else if(n.skip(e,r))u=FB;else{let p=n.remove(a).predicate(e);u=YB(e.query(p),c,f,s),u.result=i.exec([`CREATE SCHEMA IF NOT EXISTS ${s}`,co(u.table,u.create,{temp:!1})]),u.result.catch(l=>i.logger().error(l))}return o.set(e,u),u}};function qB(t){let{source:e,meta:n}=t,r=t.predicate,o=rf(r).map(p=>p.column),i,s;if(!n||!o)return{source:null,columns:s,predicate:i};let{type:a,scales:c,bin:f,pixelSize:u=1}=n;if(a==="point")i=p=>p,s=Object.fromEntries(o.map(p=>[`${p}`,Mt(p)]));else if(a==="interval"&&c){let p=c.map(l=>zB(l,u,f));p.some(l=>!l)||(p.length===1?(i=l=>l?tn("active0",l.extent.map(p[0])):[],s={active0:p[0](r.expr)}):(i=l=>l?dn(l.clauses.map((d,h)=>tn(`active${h}`,d.extent.map(p[h])))):[],s=Object.fromEntries(r.clauses.map((l,d)=>[`active${d}`,p[d](l.expr)]))))}return{source:s?e:null,columns:s,predicate:i}}var BB={ceil:pv,round:ai};function zB(t,e,n){let{type:r,domain:o,range:i,apply:s,sqlApply:a}=Kl(t);if(!s)return;let c=BB[`${n}`.toLowerCase()]||ze,f=s(Math.min(...o)),u=s(Math.max(...o)),p=(r==="identity"?1:Math.abs(i[1]-i[0])/(u-f))/e,l=p===1?h=>h:h=>mt(pe(p),h),d=f===0?h=>h:h=>pt(h,pe(f));return h=>Gt(c(l(d(a(h)))))}function YB(t,e,n,r){let{group:o,output:i,preagg:s}=n,{columns:a}=e,c=t.setSelect({...s,...a}).groupby(Object.keys(a)),[f]=c.subqueries;if(f){let x=Object.values(a).flatMap(g=>rf(g).map(y=>y.column));UB(f,x)}let u=c._having,p=c._orderby;c._having=[],c._orderby=[];let l=c.toString(),d=(rx(l)>>>0).toString(16),h=`${r}.preagg_${d}`,m=st.select(o,i).from(h).groupby(o).having(u).orderby(p);return new t_({table:h,create:l,active:e,select:m})}function UB(t,e){let n=new Set,r=o=>{n.has(o)||(n.add(o),es(o)&&o._from.length&&o.select(e),o.subqueries.forEach(r))};r(t)}var t_=class{constructor({table:e,create:n,active:r,select:o}){this.table=e,this.create=n,this.result=null,this.active=r,this.select=o,this.skip=!1}query(e){return this.select.clone().where(this.active.predicate(e))}};function e_(t){switch(t){case"BIGINT":case"HUGEINT":case"INTEGER":case"SMALLINT":case"TINYINT":case"UBIGINT":case"UINTEGER":case"USMALLINT":case"UTINYINT":case"DOUBLE":case"FLOAT":case"REAL":return"number";case"DATE":case"TIMESTAMP":case"TIMESTAMPTZ":case"TIMESTAMP WITH TIME ZONE":case"TIME":case"TIMESTAMP_NS":return"date";case"BOOLEAN":return"boolean";case"VARCHAR":case"UUID":case"JSON":return"string";case"ARRAY":case"LIST":return"array";case"BLOB":case"STRUCT":case"MAP":case"GEOMETRY":return"object";default:if(t.startsWith("DECIMAL"))return"number";if(t.startsWith("STRUCT")||t.startsWith("MAP"))return"object";if(t.endsWith("]"))return"array";throw new Error(`Unsupported type: ${t}`)}}var jB="count",XB="nulls",WB="max",VB="min",GB="distinct";var HB={[jB]:qe,[GB]:t=>qe(t).distinct(),[WB]:Ke,[VB]:jn,[XB]:t=>qe().where(Sa(t))};function QB(t,e,n){return st.from(t).select(Array.from(n,r=>({[r]:HB[r](e)})))}async function _I(t,e){return e.length===1&&e[0].column==="*"?JB(t,e[0].table):(await Promise.all(e.map(n=>ZB(t,n)))).filter(n=>n)}async function ZB(t,{table:e,column:n,stats:r}){let o=st.from({source:e}).select({column:n}).groupby(n.aggregate?ge`ALL`:[]),[i]=Array.from(await t.query(st.describe(o))),s={table:e,column:`${n}`,sqlType:i.column_type,type:e_(i.column_type),nullable:i.null==="YES"};if(!(r?.length||r?.size))return s;let[a]=await t.query(QB(e,n,r),{persist:!0});return Object.assign(s,a)}async function JB(t,e){let n=await t.query(`DESCRIBE ${xa(e)}`);return Array.from(n).map(r=>({table:e,column:r.column_name,sqlType:r.column_type,type:e_(r.column_type),nullable:r.null==="YES"}))}var os=Object.freeze({pending:Symbol("pending"),ready:Symbol("ready"),error:Symbol("error"),done:Symbol("done")}),Ma=class extends Promise{constructor(){let e,n;super((r,o)=>{e=r,n=o}),this._resolve=e,this._reject=n,this._state=os.pending,this._value=void 0}fulfill(e){if(this._value!==void 0){if(e!==void 0)throw Error("Promise is ready and fulfill has a provided value");this._resolve(this._value)}else{if(e===void 0)throw Error("Promise is neither ready nor has provided value");this._resolve(e)}return this._state=os.done,this}ready(e){return this._state=os.ready,this._value=e,this}reject(e){return this._state=os.error,this._reject(e),this}get state(){return this._state}};Ma.prototype.constructor=Promise;function cx(){return{debug(...t){},info(...t){},log(...t){},warn(...t){},error(...t){}}}function KB(t){return(typeof requestAnimationFrame<"u"?requestAnimationFrame:typeof setImmediate<"u"?setImmediate:setTimeout)(t)}function SI(t,e){let n=[],r=0;function o(){let i=tz(n,e);n=[],r=0;for(let s of i)nz(s,t),iz(s,e)}return{add(i,s){i.request.type==="arrow"?(r=r||KB(()=>o()),n.push({entry:i,priority:s,index:n.length})):t(i,s)}}}function tz(t,e){let n=[],r=new Map;for(let o of t){let{entry:{request:i}}=o,s=ez(i.query,e);if(!r.has(s)){let a=[];n.push(a),r.set(s,a)}r.get(s).push(o)}return n}function ez(t,e){let n=`${t}`;if(es(t)&&!e.get(n)){if(t._orderby.length||t._where.length||t._qualify.length||t._having.length)return n;let r=t.clone().setSelect("*"),o=t._groupby;if(o.length){let i={};t._select.forEach(({alias:s,expr:a})=>i[s]=a),r.setGroupby(o.map(s=>ts(s)&&i[s.column]||s))}else t._select.some(i=>tr(i.expr))&&r.setGroupby("ALL");return`${r}`}else return n}function nz(t,e){if(rz(t))e({request:{type:"arrow",cache:!1,query:t.query=oz(t)},result:t.result=new Ma});else for(let{entry:n,priority:r}of t)e(n,r)}function rz(t){if(t.length>1){let e=`${t[0].entry.request.query}`;for(let n=1;n<t.length;++n)if(e!==`${t[n].entry.request.query}`)return!0}return!1}function oz(t){let e=t.maps=[],n=new Map;for(let i of t){let{query:s}=i.entry.request,a=[];e.push(a);for(let{alias:c,expr:f}of s._select){let u=`${f}`;n.has(u)||n.set(u,[`col${n.size}`,f]);let[p]=n.get(u);a.push([p,c])}}let r=t[0].entry.request.query.clone(),o=r._groupby;if(o.length){let i={};t.maps[0].forEach(([s,a])=>i[a]=s),r.setGroupby(o.map(s=>ts(s)&&i[s.column]||s))}return r.setSelect(Array.from(n.values()))}async function iz(t,e){let{maps:n,query:r,result:o}=t;if(!n)return;let i;try{i=await o}catch(a){for(let{entry:c}of t)c.result.reject(a);return}let s=Ow(r);t.forEach(({entry:a},c)=>{let{request:f,result:u}=a,p=n[c],l=s&&p?az(i,p):p?sz(i,p):i;f.cache&&e.set(String(f.query),l),u.fulfill(l)})}function sz(t,e){return t.select(e.map(n=>n[0]),e.map(n=>n[1]))}function az(t,e){let n=new Map(e),r=[];for(let o of t)n.has(o.column_name)&&r.push({...o,column_name:n.get(o.column_name)});return r}var cz=typeof requestIdleCallback<"u"?requestIdleCallback:setTimeout,MI=()=>({get:()=>{},set:(t,e)=>e,clear:()=>{}});function AI({max:t=1e3,ttl:e=3*60*60*1e3}={}){let n=new Map;function r(){let o=performance.now()-e,i=null,s=1/0;for(let[a,c]of n){let{last:f}=c;f<s&&(i=a,s=f),o>f&&n.delete(a)}i&&n.delete(i)}return{get(o){let i=n.get(o);if(i)return i.last=performance.now(),i.value},set(o,i){return n.set(o,{last:performance.now(),value:i}),n.size>t&&cz(r),i},clear(){n=new Map}}}var fx=class{constructor(e){this.queue=Array.from({length:e},()=>({head:null,tail:null}))}isEmpty(){return this.queue.every(e=>!e.head)}insert(e,n){let r=this.queue[n];if(!r)throw new Error(`Invalid queue priority rank: ${n}`);let o={item:e,next:null};r.head===null?r.head=r.tail=o:r.tail=r.tail.next=o}remove(e){for(let n of this.queue){let{head:r,tail:o}=n;for(let i=null,s=r;s;i=s,s=s.next)e(s.item)&&(s===r?r=s.next:i.next=s.next,s===o&&(o=i||r));n.head=r,n.tail=o}}next(){for(let e of this.queue){let{head:n}=e;if(n!==null)return e.head=n.next,e.tail===n&&(e.tail=null),n.item}}};var fo=Object.freeze({High:0,Normal:1,Low:2}),ux=class{constructor(e=32){this.queue=new fx(3),this.db=null,this.clientCache=null,this._logger=cx(),this._logQueries=!1,this._consolidate=null,this.pendingResults=[],this.maxConcurrentRequests=e,this.pendingExec=!1}next(){if(this.queue.isEmpty()||this.pendingResults.length>this.maxConcurrentRequests||this.pendingExec)return;let{request:e,result:n}=this.queue.next();this.pendingResults.push(n),e.type==="exec"&&(this.pendingExec=!0),this.submit(e,n).finally(()=>{for(;this.pendingResults.length&&this.pendingResults[0].state!==os.pending;){let r=this.pendingResults.shift();r.state===os.ready?r.fulfill():r.state===os.done&&this._logger.warn("Found resolved query in pending results.")}e.type==="exec"&&(this.pendingExec=!1),this.next()})}enqueue(e,n=fo.Normal){this.queue.insert(e,n),this.next()}async submit(e,n){try{let{query:r,type:o,cache:i=!1,options:s}=e,a=r?`${r}`:null;if(i){let p=this.clientCache.get(a);if(p){let l=await p;this._logger.debug("Cache"),n.ready(l);return}}let c=performance.now();this._logQueries&&this._logger.debug("Query",{type:o,sql:a,...s});let f=this.db.query({type:o,sql:a,...s});i&&this.clientCache.set(a,f);let u=await f;i&&this.clientCache.set(a,u),this._logger.debug(`Request: ${(performance.now()-c).toFixed(1)}`),n.ready(o==="exec"?null:u)}catch(r){n.reject(r)}}cache(e){return e!==void 0?this.clientCache=e===!0?AI():e||MI():this.clientCache}logger(e){return e?this._logger=e:this._logger}logQueries(e){return e!==void 0?this._logQueries=!!e:this._logQueries}connector(e){return e?this.db=e:this.db}consolidate(e){e&&!this._consolidate?this._consolidate=SI(this.enqueue.bind(this),this.clientCache):!e&&this._consolidate&&(this._consolidate=null)}request(e,n=fo.Normal){let r=new Ma,o={request:e,result:r};return this._consolidate?this._consolidate.add(o,n):this.enqueue(o,n),r}cancel(e){let n=new Set(e);if(n.size){this.queue.remove(({result:r})=>n.has(r)?(r.reject("Canceled"),!0):!1);for(let r of this.pendingResults)n.has(r)&&r.reject("Canceled")}}clear(){this.queue.remove(({result:e})=>(e.reject("Cleared"),!0));for(let e of this.pendingResults)e.reject("Cleared");this.pendingResults=[]}};var lx;function Sr(t){return t?lx=t:lx==null&&(lx=new ep),lx}var ep=class{constructor(e=S0(),{logger:n=console,manager:r=new ux,cache:o=!0,consolidate:i=!0,preagg:s={}}={}){this.manager=r,this.manager.cache(o),this.manager.consolidate(i),this.databaseConnector(e),this.logger(n),this.clear(),this.preaggregator=new ax(this,s)}clear({clients:e=!0,cache:n=!0}={}){this.manager.clear(),e&&(this.filterGroups?.forEach(r=>r.disconnect()),this.filterGroups=new Map,this.clients?.forEach(r=>this.disconnect(r)),this.clients=new Set),n&&this.manager.cache().clear()}databaseConnector(e){return this.manager.connector(e)}logger(e){return arguments.length&&(this._logger=e||cx(),this.manager.logger(this._logger)),this._logger}cancel(e){this.manager.cancel(e)}exec(e,{priority:n=fo.Normal}={}){return e=Array.isArray(e)?e.filter(r=>r).join(`;
2
+ `):e,this.manager.request({type:"exec",query:e},n)}query(e,{type:n="arrow",cache:r=!0,priority:o=fo.Normal,...i}={}){return this.manager.request({type:n,query:e,cache:r,options:i},o)}prefetch(e,n={}){return this.query(e,{...n,cache:!0,priority:fo.Low})}createBundle(e,n,r=fo.Low){let o={name:e,queries:n.map(i=>typeof i=="string"?{sql:i}:i)};return this.manager.request({type:"create-bundle",options:o},r)}loadBundle(e,n=fo.High){let r={name:e};return this.manager.request({type:"load-bundle",options:r},n)}updateClient(e,n,r=fo.Normal){return e.queryPending(),this.query(n,{priority:r}).then(o=>e.queryResult(o).update(),o=>{this._logger.error(o),e.queryError(o)}).catch(o=>this._logger.error(o))}requestQuery(e,n){return this.preaggregator.clear(),n?this.updateClient(e,n):Promise.resolve(e.update())}async connect(e){let{clients:n}=this;if(n.has(e))throw new Error("Client already connected.");n.add(e),e.coordinator=this,this.initializeClient(e),fz(this,e.filterBy,e)}async initializeClient(e){let n=e.fields();return n?.length&&e.fieldInfo(await _I(this,n)),e.requestQuery()}disconnect(e){let{clients:n,filterGroups:r}=this;if(!n.has(e))return;n.delete(e),e.coordinator=null;let o=r.get(e.filterBy);o&&o.clients.delete(e)}};function fz(t,e,n){if(!e)return;let r=t.filterGroups.get(e);if(!r){let o=s=>uz(t,e,s),i=()=>lz(t,e);e.addEventListener("activate",o),e.addEventListener("value",i),r={selection:e,clients:new Set,disconnect(){e.removeEventListener("activate",o),e.removeEventListener("value",i)}},t.filterGroups.set(e,r)}r.clients.add(n)}function uz(t,e,n){let{preaggregator:r,filterGroups:o}=t,{clients:i}=o.get(e);for(let s of i)r.request(s,e,n)}function lz(t,e){let{preaggregator:n,filterGroups:r}=t,{clients:o}=r.get(e),{active:i}=e;return Promise.allSettled(Array.from(o,s=>{let a=n.request(s,e,i),c=a?null:e.predicate(s);if(a?.skip||!a&&!c)return;let f=a?.query(i.predicate)??s.query(c);return t.updateClient(s,f)}))}var px=class{constructor(){this._callbacks=new Map}addEventListener(e,n){this._callbacks.has(e)||this._callbacks.set(e,{callbacks:new Set,pending:null,queue:new n_}),this._callbacks.get(e).callbacks.add(n)}removeEventListener(e,n){let r=this._callbacks.get(e);r&&r.callbacks.delete(n)}willEmit(e,n){return n}emitQueueFilter(e,n){return null}cancel(e){this._callbacks.get(e)?.queue.clear()}async pending(e){await this._callbacks.get(e)?.pending}emit(e,n){let r=this._callbacks.get(e)||{};if(r.pending)r.queue.enqueue(n,this.emitQueueFilter(e,n));else{let o=this.willEmit(e,n),{callbacks:i,queue:s}=r;if(i?.size){let a=Array.from(i,c=>c(o));r.pending=Promise.allSettled(a).then(()=>{r.pending=null,s.isEmpty()||this.emit(e,s.dequeue())})}}}},n_=class{constructor(){this.clear()}clear(){this.next=null}isEmpty(){return!this.next}enqueue(e,n){let r={value:e};if(n&&this.next){let o=this;for(;o.next;)n(o.next.value)?o=o.next:o.next=o.next.next;o.next=r}else this.next=r}dequeue(){let{next:e}=this;return this.next=e?.next,e?.value}};function np(t,e){return t===e?!1:t instanceof Date&&e instanceof Date?+t!=+e:Array.isArray(t)&&Array.isArray(e)?pz(t,e):!0}function pz(t,e){if(t.length!==e.length)return!0;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!0;return!1}function _e(t){return t instanceof is}var is=class t extends px{constructor(e){super(),this._value=e}static value(e){return new t(e)}static array(e){if(e.some(n=>_e(n))){let n=new t,r=()=>{n.update(e.map(o=>_e(o)?o.value:o))};return r(),e.forEach(o=>_e(o)?o.addEventListener("value",r):0),n}return new t(e)}get value(){return this._value}update(e,{force:n}={}){return np(this._value,e)||n?this.emit("value",e):this.cancel("value"),this}willEmit(e,n){return e==="value"&&(this._value=n),n}};function er(t){return t instanceof uo}function dx(t,e){return new uo(new hx(t),e&&[e].flat())}var uo=class t extends is{static intersect({cross:e=!1,empty:n=!1,include:r=[]}={}){return dx({cross:e,empty:n},r)}static union({cross:e=!1,empty:n=!1,include:r=[]}={}){return dx({cross:e,empty:n,union:!0},r)}static single({cross:e=!1,empty:n=!1,include:r=[]}={}){return dx({cross:e,empty:n,single:!0},r)}static crossfilter({empty:e=!1,include:n=[]}={}){return dx({cross:!0,empty:e},n)}constructor(e=new hx,n=[]){if(super([]),this._resolved=this._value,this._resolver=e,this._relay=new Set,Array.isArray(n))for(let r of n)r._relay.add(this)}clone(){let e=new t(this._resolver);return e._value=e._resolved=this._value,e}remove(e){let n=this.clone();return n._value=n._resolved=n._resolver.resolve(this._resolved,{source:e}),n._value.active={source:e},n}get resolver(){return this._resolver}get single(){return this._resolver.single}get clauses(){return super.value}get active(){return this.clauses.active}get value(){return this.active?.value}valueFor(e){return this.clauses.find(n=>n.source===e)?.value}activate(e){this.emit("activate",e),this._relay.forEach(n=>n.activate(e))}update(e){return this._resolved=this._resolver.resolve(this._resolved,e,!0),this._resolved.active=e,this._relay.forEach(n=>n.update(e)),super.update(this._resolved)}willEmit(e,n){return e==="value"?(this._value=n,this.value):n}emitQueueFilter(e,n){return e==="value"?this._resolver.queueFilter(n):null}skip(e,n){return this._resolver.skip(e,n)}predicate(e,n=!1){let{clauses:r}=this,o=n?null:r.active;return this._resolver.predicate(r,o,e)}},hx=class{constructor({union:e,cross:n,single:r,empty:o}={}){this.union=!!e,this.cross=!!n,this.single=!!r,this.empty=!!o}resolve(e,n,r=!1){let{source:o,predicate:i}=n,s=e.filter(c=>o!==c.source),a=this.single?[]:s;return this.single&&r&&s.forEach(c=>c.source?.reset?.()),i&&a.push(n),a}skip(e,n){return this.cross&&n?.clients?.has(e)}predicate(e,n,r){let{empty:o,union:i}=this;if(o&&!e.length)return[Fe(!1)];if(this.skip(r,n))return;let s=e.filter(a=>!this.skip(r,a)).map(a=>a.predicate);return i&&s.length>1?wr(s):s}queueFilter(e){if(this.cross){let n=e.active?.source;return r=>r.active?.source!==n}return null}};function Aa(t,e,{source:n,clients:r=n?new Set([n]):void 0}){let o=e!==void 0?ef(t,Fe(e)):null;return{meta:{type:"point"},source:n,clients:r,value:e,predicate:o}}function ci(t,e,{source:n,clients:r=n?new Set([n]):void 0}){let o=null;if(e){let i=e.length&&t.length===1?[yv(t[0],e.map(s=>Fe(s[0])))]:e.map(s=>dn(s.map((a,c)=>ef(t[c],Fe(a)))));o=e.length===0?Fe(!1):i.length>1?wr(i):i[0]}return{meta:{type:"point"},source:n,clients:r,value:e,predicate:o}}function Ta(t,e,{source:n,clients:r=n?new Set([n]):void 0,bin:o,scale:i,pixelSize:s=1}){let a=e!=null?tn(t,e):null;return{meta:{type:"interval",scales:i&&[i],bin:o,pixelSize:s},source:n,clients:r,value:e,predicate:a}}function r_(t,e,{source:n,clients:r=n?new Set([n]):void 0,bin:o,scales:i=[],pixelSize:s=1}){let a=e!=null?dn(t.map((f,u)=>tn(f,e[u]))):null;return{meta:{type:"interval",scales:i,bin:o,pixelSize:s},source:n,clients:r,value:e,predicate:a}}var dz={contains:Mv,prefix:Av,suffix:Tv,regexp:Sv};function o_(t,e,{source:n,clients:r=void 0,method:o="contains"}){let i=dz[o],s=e?i(t,Fe(e)):null;return{meta:{type:"match",method:o},source:n,clients:r,value:e,predicate:s}}function i_(t){return typeof t?.getChild=="function"}function s_(){let t=new Set,e,n=new Promise(r=>e=r);return{pending(r){t.add(r)},ready(r){return t.delete(r),t.size===0},resolve(){n=new Promise(r=>{e(),e=r})},get promise(){return n}}}function Wn(t){return i_(t)?hz(t):mz(t)}function hz(t){let{numRows:e}=t;return{numRows:e,columns:t.toColumns()}}function mz(t){let e=t.length;if(typeof t[0]=="object"){let n=e?Object.keys(t[0]):[],r={};return n.length>0&&n.forEach(o=>{r[o]=t.map(i=>i[o])}),{numRows:e,columns:r}}else return{numRows:e,values:t}}var a7={};Pc(a7,{Fixed:()=>lo,Param:()=>is,Query:()=>st,Selection:()=>uo,align:()=>YM,and:()=>dn,area:()=>CT,areaX:()=>kT,areaY:()=>LT,argmax:()=>ns,argmin:()=>rs,ariaDescription:()=>QM,ariaLabel:()=>HM,arrayAgg:()=>$w,arrow:()=>AE,aspectRatio:()=>UM,avg:()=>jl,axis:()=>jM,axisFx:()=>CE,axisFy:()=>kE,axisX:()=>IE,axisY:()=>NE,barX:()=>DT,barY:()=>PT,bin:()=>MM,cast:()=>Kc,cell:()=>FT,cellX:()=>qT,cellY:()=>BT,centroid:()=>Ql,centroidX:()=>vv,centroidY:()=>_v,circle:()=>VT,clip:()=>VM,colorBase:()=>R8,colorClamp:()=>v8,colorConstant:()=>$8,colorDomain:()=>b8,colorExponent:()=>O8,colorInterpolate:()=>A8,colorLabel:()=>I8,colorLegend:()=>o7,colorN:()=>_8,colorNice:()=>S8,colorPercent:()=>N8,colorPivot:()=>T8,colorRange:()=>w8,colorReverse:()=>C8,colorScale:()=>y8,colorScheme:()=>M8,colorSymmetric:()=>E8,colorTickFormat:()=>L8,colorZero:()=>k8,column:()=>oi,contour:()=>lE,coordinator:()=>Sr,corr:()=>Dw,count:()=>qe,covarPop:()=>Fw,covariance:()=>Pw,createSchema:()=>qv,createTable:()=>co,cume_dist:()=>kv,dateDay:()=>fv,dateMonth:()=>av,dateMonthDay:()=>cv,delaunayLink:()=>_E,delaunayMesh:()=>SE,denseLine:()=>uE,dense_rank:()=>Nv,density:()=>fE,densityX:()=>aE,densityY:()=>cE,dot:()=>jT,dotX:()=>XT,dotY:()=>WT,entropy:()=>qw,eq:()=>hv,errorbarX:()=>yE,errorbarY:()=>bE,facetGrid:()=>yA,facetLabel:()=>bA,facetMargin:()=>dA,facetMarginBottom:()=>mA,facetMarginLeft:()=>xA,facetMarginRight:()=>gA,facetMarginTop:()=>hA,first:()=>Bw,first_value:()=>Ov,float32:()=>ov,float64:()=>pe,frame:()=>EE,from:()=>SF,fxAlign:()=>TA,fxAriaDescription:()=>jA,fxAriaLabel:()=>UA,fxAxis:()=>CA,fxDomain:()=>wA,fxFontVariant:()=>YA,fxGrid:()=>PA,fxInset:()=>_A,fxInsetLeft:()=>SA,fxInsetRight:()=>MA,fxLabel:()=>qA,fxLabelAnchor:()=>BA,fxLabelOffset:()=>zA,fxLine:()=>FA,fxPadding:()=>EA,fxPaddingInner:()=>IA,fxPaddingOuter:()=>NA,fxRange:()=>vA,fxReverse:()=>XA,fxRound:()=>AA,fxTickFormat:()=>$A,fxTickPadding:()=>OA,fxTickRotate:()=>DA,fxTickSize:()=>LA,fxTickSpacing:()=>RA,fxTicks:()=>kA,fyAlign:()=>JA,fyAriaDescription:()=>x8,fyAriaLabel:()=>m8,fyAxis:()=>n8,fyDomain:()=>WA,fyFontVariant:()=>h8,fyGrid:()=>f8,fyInset:()=>GA,fyInsetBottom:()=>QA,fyInsetTop:()=>HA,fyLabel:()=>l8,fyLabelAnchor:()=>p8,fyLabelOffset:()=>d8,fyLine:()=>u8,fyPadding:()=>KA,fyPaddingInner:()=>t8,fyPaddingOuter:()=>e8,fyRange:()=>VA,fyReverse:()=>g8,fyRound:()=>ZA,fyTickFormat:()=>a8,fyTickPadding:()=>s8,fyTickRotate:()=>c8,fyTickSize:()=>o8,fyTickSpacing:()=>i8,fyTicks:()=>r8,geo:()=>DE,geojson:()=>Hl,graticule:()=>FE,grid:()=>WM,gridFx:()=>OE,gridFy:()=>$E,gridX:()=>LE,gridY:()=>RE,gt:()=>_r,gte:()=>mv,hconcat:()=>gF,heatmap:()=>pE,height:()=>PM,hexagon:()=>GT,hexbin:()=>mE,hexgrid:()=>xE,highlight:()=>qE,hspace:()=>wF,hull:()=>ME,image:()=>sE,inset:()=>XM,int32:()=>Gt,intervalX:()=>BE,intervalXY:()=>YE,intervalY:()=>zE,isBetween:()=>tn,isDistinct:()=>xv,isNotBetween:()=>gv,isNotDistinct:()=>ef,isNotNull:()=>vr,isNull:()=>Sa,kurtosis:()=>zw,lag:()=>Rv,last:()=>Xw,last_value:()=>$v,lead:()=>nf,lengthBase:()=>xT,lengthClamp:()=>pT,lengthConstant:()=>yT,lengthDomain:()=>uT,lengthExponent:()=>gT,lengthNice:()=>dT,lengthPercent:()=>hT,lengthRange:()=>lT,lengthScale:()=>fT,lengthZero:()=>mT,line:()=>RT,lineX:()=>OT,lineY:()=>$T,link:()=>TE,literal:()=>Fe,loadCSV:()=>zv,loadExtension:()=>Jl,loadJSON:()=>Yv,loadObjects:()=>Xv,loadParquet:()=>Uv,loadSpatial:()=>jv,lt:()=>ae,lte:()=>Kn,mad:()=>Yw,margin:()=>RM,marginBottom:()=>zM,marginLeft:()=>FM,marginRight:()=>qM,marginTop:()=>BM,margins:()=>LM,max:()=>Ke,median:()=>Uw,menu:()=>lF,min:()=>jn,mode:()=>jw,name:()=>CM,nearest:()=>UE,nearestX:()=>jE,nearestY:()=>XE,neq:()=>jr,not:()=>dv,nth_value:()=>Dv,ntile:()=>Lv,opacityBase:()=>W8,opacityClamp:()=>q8,opacityConstant:()=>G8,opacityDomain:()=>P8,opacityExponent:()=>V8,opacityLabel:()=>z8,opacityLegend:()=>i7,opacityNice:()=>B8,opacityPercent:()=>Y8,opacityRange:()=>F8,opacityReverse:()=>U8,opacityScale:()=>D8,opacityTickFormat:()=>X8,opacityZero:()=>j8,or:()=>wr,padding:()=>GM,pan:()=>ZE,panX:()=>JE,panY:()=>KE,panZoom:()=>t7,panZoomX:()=>e7,panZoomY:()=>n7,percent_rank:()=>Cv,plot:()=>MF,product:()=>Ww,projectionClip:()=>NT,projectionDomain:()=>ST,projectionInset:()=>MT,projectionInsetBottom:()=>IT,projectionInsetLeft:()=>AT,projectionInsetRight:()=>TT,projectionInsetTop:()=>ET,projectionParallels:()=>wT,projectionPrecision:()=>vT,projectionRotate:()=>_T,projectionType:()=>bT,quantile:()=>Vw,rBase:()=>sT,rClamp:()=>eT,rConstant:()=>cT,rDomain:()=>K8,rExponent:()=>aT,rLabel:()=>rT,rNice:()=>nT,rPercent:()=>oT,rRange:()=>tT,rScale:()=>J8,rZero:()=>iT,rank:()=>Iv,raster:()=>dE,rasterTile:()=>hE,rect:()=>zT,rectX:()=>YT,rectY:()=>UT,region:()=>WE,regressionY:()=>gE,row_number:()=>Ev,ruleX:()=>JT,ruleY:()=>KT,search:()=>pF,skewness:()=>Kw,slider:()=>dF,sphere:()=>PE,spike:()=>iE,sql:()=>ge,stddev:()=>Vl,stddevPop:()=>tv,stringAgg:()=>ev,style:()=>$M,sum:()=>Yt,symbolDomain:()=>Q8,symbolLegend:()=>s7,symbolRange:()=>Z8,symbolScale:()=>H8,table:()=>hF,text:()=>HT,textX:()=>QT,textY:()=>ZT,tickX:()=>tE,tickY:()=>eE,toggle:()=>Cc,toggleColor:()=>QE,toggleX:()=>VE,toggleY:()=>GE,toggleZ:()=>HE,varPop:()=>rv,variance:()=>nv,vconcat:()=>xF,vector:()=>nE,vectorX:()=>rE,vectorY:()=>oE,voronoi:()=>wE,voronoiMesh:()=>vE,vspace:()=>bF,width:()=>DM,xAlign:()=>s5,xAriaDescription:()=>A5,xAriaLabel:()=>M5,xAxis:()=>u5,xBase:()=>N5,xClamp:()=>o5,xConstant:()=>k5,xDomain:()=>JM,xExponent:()=>C5,xFontVariant:()=>S5,xGrid:()=>g5,xInset:()=>e5,xInsetLeft:()=>n5,xInsetRight:()=>r5,xLabel:()=>b5,xLabelAnchor:()=>w5,xLabelArrow:()=>v5,xLabelOffset:()=>_5,xLine:()=>y5,xNice:()=>t5,xPadding:()=>a5,xPaddingInner:()=>c5,xPaddingOuter:()=>f5,xPercent:()=>T5,xRange:()=>KM,xReverse:()=>E5,xRound:()=>i5,xScale:()=>ZM,xTickFormat:()=>m5,xTickPadding:()=>h5,xTickRotate:()=>x5,xTickSize:()=>p5,xTickSpacing:()=>d5,xTicks:()=>l5,xZero:()=>I5,xyDomain:()=>OM,yAlign:()=>z5,yAriaDescription:()=>sA,yAriaLabel:()=>iA,yAxis:()=>X5,yBase:()=>uA,yClamp:()=>q5,yConstant:()=>pA,yDomain:()=>R5,yExponent:()=>lA,yFontVariant:()=>oA,yGrid:()=>J5,yInset:()=>D5,yInsetBottom:()=>F5,yInsetTop:()=>P5,yLabel:()=>tA,yLabelAnchor:()=>eA,yLabelArrow:()=>nA,yLabelOffset:()=>rA,yLine:()=>K5,yNice:()=>$5,yPadding:()=>Y5,yPaddingInner:()=>U5,yPaddingOuter:()=>j5,yPercent:()=>aA,yRange:()=>O5,yReverse:()=>cA,yRound:()=>B5,yScale:()=>L5,yTickFormat:()=>Q5,yTickPadding:()=>H5,yTickRotate:()=>Z5,yTickSize:()=>V5,yTickSpacing:()=>G5,yTicks:()=>W5,yZero:()=>fA});var lo=Symbol("Fixed"),en=Symbol("Transient"),rp=Symbol("Transform");var lM={};Pc(lM,{Area:()=>yc,Arrow:()=>bh,BarX:()=>bc,BarY:()=>wc,Cell:()=>vc,Contour:()=>Ch,Density:()=>Rh,Dot:()=>_c,Frame:()=>ph,Geo:()=>Oh,Hexgrid:()=>$h,Image:()=>Dh,Line:()=>Sc,Link:()=>gh,Mark:()=>lt,Raster:()=>Th,Rect:()=>gc,RuleX:()=>rh,RuleY:()=>oh,Text:()=>hc,TickX:()=>_h,TickY:()=>Sh,Tip:()=>dh,Vector:()=>xc,WaffleX:()=>Fh,WaffleY:()=>qh,area:()=>xh,areaX:()=>Vs,areaY:()=>Wi,arrow:()=>S$,auto:()=>O$,autoSpec:()=>D4,axisFx:()=>hb,axisFy:()=>db,axisX:()=>sh,axisY:()=>ih,barX:()=>Xo,barY:()=>Wo,bin:()=>Xi,binX:()=>Uo,binY:()=>jo,bollinger:()=>Zs,bollingerX:()=>B$,bollingerY:()=>z$,boxX:()=>Y$,boxY:()=>U$,cell:()=>Gs,cellX:()=>A$,cellY:()=>T$,centroid:()=>zb,circle:()=>N$,cluster:()=>zD,column:()=>Ge,contour:()=>J$,crosshair:()=>eD,crosshairX:()=>nD,crosshairY:()=>rD,delaunayLink:()=>sD,delaunayMesh:()=>aD,density:()=>pD,differenceX:()=>mD,differenceY:()=>xD,dodgeX:()=>aP,dodgeY:()=>cP,dot:()=>Pr,dotX:()=>E$,dotY:()=>I$,filter:()=>$L,find:()=>jL,formatIsoDate:()=>a4,formatMonth:()=>HR,formatNumber:()=>s4,formatWeekday:()=>QR,frame:()=>Eu,geo:()=>Yb,geoCentroid:()=>yD,graticule:()=>wD,gridFx:()=>yb,gridFy:()=>xb,gridX:()=>gb,gridY:()=>mb,group:()=>Hd,groupX:()=>Ls,groupY:()=>Rs,groupZ:()=>Gd,hexagon:()=>C$,hexbin:()=>vD,hexgrid:()=>_D,hull:()=>cD,identity:()=>W,image:()=>MD,indexOf:()=>Zt,initializer:()=>Kt,interpolateNearest:()=>Ih,interpolateNone:()=>Bb,interpolatorBarycentric:()=>Eh,interpolatorRandomWalk:()=>Nh,legend:()=>XO,line:()=>Mc,lineX:()=>Hs,lineY:()=>Qs,linearRegressionX:()=>ED,linearRegressionY:()=>ID,link:()=>kb,map:()=>Hn,mapX:()=>Ru,mapY:()=>Ou,marks:()=>ke,normalize:()=>Zb,normalizeX:()=>pP,normalizeY:()=>dP,numberInterval:()=>MS,plot:()=>Iu,pointer:()=>qs,pointerX:()=>Bs,pointerY:()=>Ui,raster:()=>G$,rect:()=>lh,rectX:()=>Au,rectY:()=>Tu,reverse:()=>DL,ruleX:()=>pr,ruleY:()=>dr,scale:()=>Os,select:()=>gP,selectFirst:()=>Yh,selectLast:()=>Uh,selectMaxX:()=>e2,selectMaxY:()=>n2,selectMinX:()=>Kb,selectMinY:()=>t2,shiftX:()=>hP,shiftY:()=>mP,shuffle:()=>PL,sort:()=>$1,sphere:()=>bD,spike:()=>AO,stackX:()=>A4,stackX1:()=>ZO,stackX2:()=>JO,stackY:()=>T4,stackY1:()=>KO,stackY2:()=>t$,text:()=>Yo,textX:()=>sb,textY:()=>ab,tickX:()=>Pb,tickY:()=>Fb,timeInterval:()=>Yd,tip:()=>Ab,transform:()=>Ce,tree:()=>nM,treeLink:()=>Vb,treeNode:()=>Ph,utcInterval:()=>oc,valueof:()=>ut,vector:()=>_4,vectorX:()=>ub,vectorY:()=>lb,voronoi:()=>fD,voronoiMesh:()=>uD,waffleX:()=>VD,waffleY:()=>GD,window:()=>$u,windowX:()=>$$,windowY:()=>D$});function yt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function An(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Xr(t){let e,n,r;t.length!==2?(e=yt,n=(a,c)=>yt(t(a),c),r=(a,c)=>t(a)-c):(e=t===yt||t===An?t:yz,n=t,r=t);function o(a,c,f=0,u=a.length){if(f<u){if(e(c,c)!==0)return u;do{let p=f+u>>>1;n(a[p],c)<0?f=p+1:u=p}while(f<u)}return f}function i(a,c,f=0,u=a.length){if(f<u){if(e(c,c)!==0)return u;do{let p=f+u>>>1;n(a[p],c)<=0?f=p+1:u=p}while(f<u)}return f}function s(a,c,f=0,u=a.length){let p=o(a,c,f,u-1);return p>f&&r(a[p-1],c)>-r(a[p],c)?p-1:p}return{left:o,center:s,right:i}}function yz(){return 0}function op(t){return t===null?NaN:+t}function*TI(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}var EI=Xr(yt),II=EI.right,bz=EI.left,wz=Xr(op).center,fi=II;var ip=NI(CI),a_=NI(vz);function NI(t){return function(e,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:o,width:i,height:s}=e;if(!((i=Math.floor(i))>=0))throw new RangeError("invalid width");if(!((s=Math.floor(s!==void 0?s:o.length/i))>=0))throw new RangeError("invalid height");if(!i||!s||!n&&!r)return e;let a=n&&t(n),c=r&&t(r),f=o.slice();return a&&c?(sf(a,f,o,i,s),sf(a,o,f,i,s),sf(a,f,o,i,s),af(c,o,f,i,s),af(c,f,o,i,s),af(c,o,f,i,s)):a?(sf(a,o,f,i,s),sf(a,f,o,i,s),sf(a,o,f,i,s)):c&&(af(c,o,f,i,s),af(c,f,o,i,s),af(c,o,f,i,s)),e}}function sf(t,e,n,r,o){for(let i=0,s=r*o;i<s;)t(e,n,i,i+=r,1)}function af(t,e,n,r,o){for(let i=0,s=r*o;i<r;++i)t(e,n,i,i+s,r)}function vz(t){let e=CI(t);return(n,r,o,i,s)=>{o<<=2,i<<=2,s<<=2,e(n,r,o+0,i+0,s),e(n,r,o+1,i+1,s),e(n,r,o+2,i+2,s),e(n,r,o+3,i+3,s)}}function CI(t){let e=Math.floor(t);if(e===t)return _z(t);let n=t-e,r=2*t+1;return(o,i,s,a,c)=>{if(!((a-=c)>=s))return;let f=e*i[s],u=c*e,p=u+c;for(let l=s,d=s+u;l<d;l+=c)f+=i[Math.min(a,l)];for(let l=s,d=a;l<=d;l+=c)f+=i[Math.min(a,l+u)],o[l]=(f+n*(i[Math.max(s,l-p)]+i[Math.min(a,l+p)]))/r,f-=i[Math.max(s,l-u)]}}function _z(t){let e=2*t+1;return(n,r,o,i,s)=>{if(!((i-=s)>=o))return;let a=t*r[o],c=s*t;for(let f=o,u=o+c;f<u;f+=s)a+=r[Math.min(i,f)];for(let f=o,u=i;f<=u;f+=s)a+=r[Math.min(i,f+c)],n[f]=a/e,a-=r[Math.max(o,f-c)]}}function po(t,e){let n=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(o=+o)>=o&&++n}return n}function Sz(t){return t.length|0}function Mz(t){return!(t>0)}function Az(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function Tz(t){return e=>t(...e)}function mx(...t){let e=typeof t[t.length-1]=="function"&&Tz(t.pop());t=t.map(Az);let n=t.map(Sz),r=t.length-1,o=new Array(r+1).fill(0),i=[];if(r<0||n.some(Mz))return i;for(;;){i.push(o.map((a,c)=>t[c][a]));let s=r;for(;++o[s]===n[s];){if(s===0)return e?i.map(e):i;o[s--]=0}}}function xx(t,e){var n=0,r=0;return Float64Array.from(t,e===void 0?o=>n+=+o||0:o=>n+=+e(o,r++,t)||0)}function ss(t,e){let n=0,r,o=0,i=0;if(e===void 0)for(let s of t)s!=null&&(s=+s)>=s&&(r=s-o,o+=r/++n,i+=r*(s-o));else{let s=-1;for(let a of t)(a=e(a,++s,t))!=null&&(a=+a)>=a&&(r=a-o,o+=r/++n,i+=r*(a-o))}if(n>1)return i/(n-1)}function Mr(t,e){let n=ss(t,e);return n&&Math.sqrt(n)}function Ft(t,e){let n,r;if(e===void 0)for(let o of t)o!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)));else{let o=-1;for(let i of t)(i=e(i,++o,t))!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}var nn=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){let n=this._partials,r=0;for(let o=0;o<this._n&&o<32;o++){let i=n[o],s=e+i,a=Math.abs(e)<Math.abs(i)?e-(s-i):i-(s-e);a&&(n[r++]=a),e=s}return n[r]=e,this._n=r+1,this}valueOf(){let e=this._partials,n=this._n,r,o,i,s=0;if(n>0){for(s=e[--n];n>0&&(r=s,o=e[--n],s=r+o,i=o-(s-r),!i););n>0&&(i<0&&e[n-1]<0||i>0&&e[n-1]>0)&&(o=i*2,r=s+o,o==r-s&&(s=r))}return s}};var Tn=class extends Map{constructor(e,n=RI){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let[r,o]of e)this.set(r,o)}get(e){return super.get(c_(this,e))}has(e){return super.has(c_(this,e))}set(e,n){return super.set(kI(this,e),n)}delete(e){return super.delete(LI(this,e))}},En=class extends Set{constructor(e,n=RI){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let r of e)this.add(r)}has(e){return super.has(c_(this,e))}add(e){return super.add(kI(this,e))}delete(e){return super.delete(LI(this,e))}};function c_({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):n}function kI({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function LI({_intern:t,_key:e},n){let r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function RI(t){return t!==null&&typeof t=="object"?t.valueOf():t}function sp(t){return t}function rn(t,...e){return u_(t,sp,sp,e)}function Wr(t,e,...n){return u_(t,sp,e,n)}function f_(t,e,...n){return u_(t,Array.from,e,n)}function u_(t,e,n,r){return function o(i,s){if(s>=r.length)return n(i);let a=new Tn,c=r[s++],f=-1;for(let u of i){let p=c(u,++f,i),l=a.get(p);l?l.push(u):a.set(p,[u])}for(let[u,p]of a)a.set(u,o(p,s));return e(a)}(t,0)}function l_(t,e){return Array.from(e,n=>t[n])}function ui(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){let r=Uint32Array.from(t,(o,i)=>i);return e.length>1?(e=e.map(o=>t.map(o)),r.sort((o,i)=>{for(let s of e){let a=Ea(s[o],s[i]);if(a)return a}})):(n=t.map(n),r.sort((o,i)=>Ea(n[o],n[i]))),l_(t,r)}return t.sort(ap(n))}function ap(t=yt){if(t===yt)return Ea;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{let r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function Ea(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}function cf(t,e,n){return(e.length!==2?ui(Wr(t,e,n),([r,o],[i,s])=>yt(o,s)||yt(r,i)):ui(rn(t,n),([r,o],[i,s])=>e(o,s)||yt(r,i))).map(([r])=>r)}var Ez=Math.sqrt(50),Iz=Math.sqrt(10),Nz=Math.sqrt(2);function gx(t,e,n){let r=(e-t)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),s=i>=Ez?10:i>=Iz?5:i>=Nz?2:1,a,c,f;return o<0?(f=Math.pow(10,-o)/s,a=Math.round(t*f),c=Math.round(e*f),a/f<t&&++a,c/f>e&&--c,f=-f):(f=Math.pow(10,o)*s,a=Math.round(t/f),c=Math.round(e/f),a*f<t&&++a,c*f>e&&--c),c<a&&.5<=n&&n<2?gx(t,e,n*2):[a,c,f]}function on(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];let r=e<t,[o,i,s]=r?gx(e,t,n):gx(t,e,n);if(!(i>=o))return[];let a=i-o+1,c=new Array(a);if(r)if(s<0)for(let f=0;f<a;++f)c[f]=(i-f)/-s;else for(let f=0;f<a;++f)c[f]=(i-f)*s;else if(s<0)for(let f=0;f<a;++f)c[f]=(o+f)/-s;else for(let f=0;f<a;++f)c[f]=(o+f)*s;return c}function li(t,e,n){return e=+e,t=+t,n=+n,gx(t,e,n)[2]}function ff(t,e,n){e=+e,t=+t,n=+n;let r=e<t,o=r?li(e,t,n):li(t,e,n);return(r?-1:1)*(o<0?1/-o:o)}function uf(t,e,n){let r;for(;;){let o=li(t,e,n);if(o===r||o===0||!isFinite(o))return[t,e];o>0?(t=Math.floor(t/o)*o,e=Math.ceil(e/o)*o):o<0&&(t=Math.ceil(t*o)/o,e=Math.floor(e*o)/o),r=o}}function as(t){return Math.max(1,Math.ceil(Math.log(po(t))/Math.LN2)+1)}function kt(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o)}return n}function yx(t,e){let n,r=-1,o=-1;if(e===void 0)for(let i of t)++o,i!=null&&(n<i||n===void 0&&i>=i)&&(n=i,r=o);else for(let i of t)(i=e(i,++o,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i,r=o);return r}function It(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function bx(t,e){let n,r=-1,o=-1;if(e===void 0)for(let i of t)++o,i!=null&&(n>i||n===void 0&&i>=i)&&(n=i,r=o);else for(let i of t)(i=e(i,++o,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i,r=o);return r}function wx(t,e,n=0,r=1/0,o){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(o=o===void 0?Ea:ap(o);r>n;){if(r-n>600){let c=r-n+1,f=e-n+1,u=Math.log(c),p=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*p*(c-p)/c)*(f-c/2<0?-1:1),d=Math.max(n,Math.floor(e-f*p/c+l)),h=Math.min(r,Math.floor(e+(c-f)*p/c+l));wx(t,e,d,h,o)}let i=t[e],s=n,a=r;for(cp(t,n,e),o(t[r],i)>0&&cp(t,n,r);s<a;){for(cp(t,s,a),++s,--a;o(t[s],i)<0;)++s;for(;o(t[a],i)>0;)--a}o(t[n],i)===0?cp(t,n,a):(++a,cp(t,a,r)),a<=e&&(n=a+1),e<=a&&(r=a-1)}return t}function cp(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}function Ia(t,e=yt){let n,r=!1;if(e.length===1){let o;for(let i of t){let s=e(i);(r?yt(s,o)>0:yt(s,s)===0)&&(n=i,o=s,r=!0)}}else for(let o of t)(r?e(o,n)>0:e(o,o)===0)&&(n=o,r=!0);return n}function In(t,e,n){if(t=Float64Array.from(TI(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return It(t);if(e>=1)return kt(t);var r,o=(r-1)*e,i=Math.floor(o),s=kt(wx(t,i).subarray(0,i+1)),a=It(t.subarray(i+1));return s+(a-s)*(o-i)}}function p_(t,e,n=op){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,o=(r-1)*e,i=Math.floor(o),s=+n(t[i],i,t),a=+n(t[i+1],i+1,t);return s+(a-s)*(o-i)}}function vx(t,e,n){let r=po(t),o=In(t,.75)-In(t,.25);return r&&o?Math.ceil((n-e)/(2*o*Math.pow(r,-1/3))):1}function fp(t,e,n){let r=po(t),o=Mr(t);return r&&o?Math.ceil((n-e)*Math.cbrt(r)/(3.49*o)):1}function pi(t,e){let n=0,r=0;if(e===void 0)for(let o of t)o!=null&&(o=+o)>=o&&(++n,r+=o);else{let o=-1;for(let i of t)(i=e(i,++o,t))!=null&&(i=+i)>=i&&(++n,r+=i)}if(n)return r/n}function Vr(t,e){return In(t,.5,e)}function*kz(t){for(let e of t)yield*e}function lf(t){return Array.from(kz(t))}function pf(t,e){let n=new Tn;if(e===void 0)for(let i of t)i!=null&&i>=i&&n.set(i,(n.get(i)||0)+1);else{let i=-1;for(let s of t)(s=e(s,++i,t))!=null&&s>=s&&n.set(s,(n.get(s)||0)+1)}let r,o=0;for(let[i,s]of n)s>o&&(o=s,r=i);return r}function _x(t,e=Lz){let n=[],r,o=!1;for(let i of t)o&&n.push(e(r,i)),r=i,o=!0;return n}function Lz(t,e){return[t,e]}function ye(t,e,n){t=+t,e=+e,n=(o=arguments.length)<2?(e=t,t=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((e-t)/n))|0,i=new Array(o);++r<o;)i[r]=t+r*n;return i}function up(t,e=yt){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(t),r=new Float64Array(n.length);e.length!==2&&(n=n.map(e),e=yt);let o=(a,c)=>e(n[a],n[c]),i,s;return t=Uint32Array.from(n,(a,c)=>c),t.sort(e===yt?(a,c)=>Ea(n[a],n[c]):ap(o)),t.forEach((a,c)=>{let f=o(a,i===void 0?a:i);f>=0?((i===void 0||f>0)&&(i=a,s=c),r[a]=s):r[a]=NaN}),r}function Sx(t,e=yt){let n,r=!1;if(e.length===1){let o;for(let i of t){let s=e(i);(r?yt(s,o)<0:yt(s,s)===0)&&(n=i,o=s,r=!0)}}else for(let o of t)(r?e(o,n)<0:e(o,o)===0)&&(n=o,r=!0);return n}function sn(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let o of t)(o=+e(o,++r,t))&&(n+=o)}return n}function cs(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function OI(t){return t}var d_=1,h_=2,m_=3,Mx=4,$I=1e-6;function Rz(t){return"translate("+t+",0)"}function Oz(t){return"translate(0,"+t+")"}function $z(t){return e=>+t(e)}function Dz(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function Pz(){return!this.__axis}function Fz(t,e){var n=[],r=null,o=null,i=6,s=6,a=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,f=t===d_||t===Mx?-1:1,u=t===Mx||t===h_?"x":"y",p=t===d_||t===m_?Rz:Oz;function l(d){var h=r??(e.ticks?e.ticks.apply(e,n):e.domain()),m=o??(e.tickFormat?e.tickFormat.apply(e,n):OI),x=Math.max(i,0)+a,g=e.range(),y=+g[0]+c,b=+g[g.length-1]+c,w=(e.bandwidth?Dz:$z)(e.copy(),c),_=d.selection?d.selection():d,v=_.selectAll(".domain").data([null]),A=_.selectAll(".tick").data(h,e).order(),T=A.exit(),E=A.enter().append("g").attr("class","tick"),N=A.select("line"),M=A.select("text");v=v.merge(v.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(E),N=N.merge(E.append("line").attr("stroke","currentColor").attr(u+"2",f*i)),M=M.merge(E.append("text").attr("fill","currentColor").attr(u,f*x).attr("dy",t===d_?"0em":t===m_?"0.71em":"0.32em")),d!==_&&(v=v.transition(d),A=A.transition(d),N=N.transition(d),M=M.transition(d),T=T.transition(d).attr("opacity",$I).attr("transform",function(k){return isFinite(k=w(k))?p(k+c):this.getAttribute("transform")}),E.attr("opacity",$I).attr("transform",function(k){var O=this.parentNode.__axis;return p((O&&isFinite(O=O(k))?O:w(k))+c)})),T.remove(),v.attr("d",t===Mx||t===h_?s?"M"+f*s+","+y+"H"+c+"V"+b+"H"+f*s:"M"+c+","+y+"V"+b:s?"M"+y+","+f*s+"V"+c+"H"+b+"V"+f*s:"M"+y+","+c+"H"+b),A.attr("opacity",1).attr("transform",function(k){return p(w(k)+c)}),N.attr(u+"2",f*i),M.attr(u,f*x).text(m),_.filter(Pz).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===h_?"start":t===Mx?"end":"middle"),_.each(function(){this.__axis=w})}return l.scale=function(d){return arguments.length?(e=d,l):e},l.ticks=function(){return n=Array.from(arguments),l},l.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),l):n.slice()},l.tickValues=function(d){return arguments.length?(r=d==null?null:Array.from(d),l):r&&r.slice()},l.tickFormat=function(d){return arguments.length?(o=d,l):o},l.tickSize=function(d){return arguments.length?(i=s=+d,l):i},l.tickSizeInner=function(d){return arguments.length?(i=+d,l):i},l.tickSizeOuter=function(d){return arguments.length?(s=+d,l):s},l.tickPadding=function(d){return arguments.length?(a=+d,l):a},l.offset=function(d){return arguments.length?(c=+d,l):c},l}function x_(t){return Fz(m_,t)}var qz={value:()=>{}};function PI(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ax(n)}function Ax(t){this._=t}function Bz(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ax.prototype=PI.prototype={constructor:Ax,on:function(t,e){var n=this._,r=Bz(t+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(t=r[i]).type)&&(o=zz(n[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<s;)if(o=(t=r[i]).type)n[o]=DI(n[o],t.name,e);else if(e==null)for(o in n)n[o]=DI(n[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ax(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};function zz(t,e){for(var n=0,r=t.length,o;n<r;++n)if((o=t[n]).name===e)return o.value}function DI(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=qz,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Na=PI;var Tx="http://www.w3.org/1999/xhtml",Nn={svg:"http://www.w3.org/2000/svg",xhtml:Tx,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function di(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Nn.hasOwnProperty(e)?{space:Nn[e],local:t}:t}function Yz(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Tx&&e.documentElement.namespaceURI===Tx?e.createElement(t):e.createElementNS(n,t)}}function Uz(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function hi(t){var e=di(t);return(e.local?Uz:Yz)(e)}function jz(){}function Ca(t){return t==null?jz:function(){return this.querySelector(t)}}function FI(t){typeof t!="function"&&(t=Ca(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],s=i.length,a=r[o]=new Array(s),c,f,u=0;u<s;++u)(c=i[u])&&(f=t.call(c,c.__data__,u,i))&&("__data__"in c&&(f.__data__=c.__data__),a[u]=f);return new de(r,this._parents)}function g_(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Xz(){return[]}function lp(t){return t==null?Xz:function(){return this.querySelectorAll(t)}}function Wz(t){return function(){return g_(t.apply(this,arguments))}}function qI(t){typeof t=="function"?t=Wz(t):t=lp(t);for(var e=this._groups,n=e.length,r=[],o=[],i=0;i<n;++i)for(var s=e[i],a=s.length,c,f=0;f<a;++f)(c=s[f])&&(r.push(t.call(c,c.__data__,f,s)),o.push(c));return new de(r,o)}function pp(t){return function(){return this.matches(t)}}function Ex(t){return function(e){return e.matches(t)}}var Vz=Array.prototype.find;function Gz(t){return function(){return Vz.call(this.children,t)}}function Hz(){return this.firstElementChild}function BI(t){return this.select(t==null?Hz:Gz(typeof t=="function"?t:Ex(t)))}var Qz=Array.prototype.filter;function Zz(){return Array.from(this.children)}function Jz(t){return function(){return Qz.call(this.children,t)}}function zI(t){return this.selectAll(t==null?Zz:Jz(typeof t=="function"?t:Ex(t)))}function YI(t){typeof t!="function"&&(t=pp(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],s=i.length,a=r[o]=[],c,f=0;f<s;++f)(c=i[f])&&t.call(c,c.__data__,f,i)&&a.push(c);return new de(r,this._parents)}function Ix(t){return new Array(t.length)}function UI(){return new de(this._enter||this._groups.map(Ix),this._parents)}function dp(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}dp.prototype={constructor:dp,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function jI(t){return function(){return t}}function Kz(t,e,n,r,o,i){for(var s=0,a,c=e.length,f=i.length;s<f;++s)(a=e[s])?(a.__data__=i[s],r[s]=a):n[s]=new dp(t,i[s]);for(;s<c;++s)(a=e[s])&&(o[s]=a)}function tY(t,e,n,r,o,i,s){var a,c,f=new Map,u=e.length,p=i.length,l=new Array(u),d;for(a=0;a<u;++a)(c=e[a])&&(l[a]=d=s.call(c,c.__data__,a,e)+"",f.has(d)?o[a]=c:f.set(d,c));for(a=0;a<p;++a)d=s.call(t,i[a],a,i)+"",(c=f.get(d))?(r[a]=c,c.__data__=i[a],f.delete(d)):n[a]=new dp(t,i[a]);for(a=0;a<u;++a)(c=e[a])&&f.get(l[a])===c&&(o[a]=c)}function eY(t){return t.__data__}function XI(t,e){if(!arguments.length)return Array.from(this,eY);var n=e?tY:Kz,r=this._parents,o=this._groups;typeof t!="function"&&(t=jI(t));for(var i=o.length,s=new Array(i),a=new Array(i),c=new Array(i),f=0;f<i;++f){var u=r[f],p=o[f],l=p.length,d=nY(t.call(u,u&&u.__data__,f,r)),h=d.length,m=a[f]=new Array(h),x=s[f]=new Array(h),g=c[f]=new Array(l);n(u,p,m,x,g,d,e);for(var y=0,b=0,w,_;y<h;++y)if(w=m[y]){for(y>=b&&(b=y+1);!(_=x[b])&&++b<h;);w._next=_||null}}return s=new de(s,r),s._enter=a,s._exit=c,s}function nY(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function WI(){return new de(this._exit||this._groups.map(Ix),this._parents)}function VI(t,e,n){var r=this.enter(),o=this,i=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function GI(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),c=0;c<s;++c)for(var f=n[c],u=r[c],p=f.length,l=a[c]=new Array(p),d,h=0;h<p;++h)(d=f[h]||u[h])&&(l[h]=d);for(;c<o;++c)a[c]=n[c];return new de(a,this._parents)}function HI(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function QI(t){t||(t=rY);function e(p,l){return p&&l?t(p.__data__,l.__data__):!p-!l}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,c=o[i]=new Array(a),f,u=0;u<a;++u)(f=s[u])&&(c[u]=f);c.sort(e)}return new de(o,this._parents).order()}function rY(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ZI(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function JI(){return Array.from(this)}function KI(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function tN(){let t=0;for(let e of this)++t;return t}function eN(){return!this.node()}function nN(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o=e[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&t.call(a,a.__data__,i,o);return this}function oY(t){return function(){this.removeAttribute(t)}}function iY(t){return function(){this.removeAttributeNS(t.space,t.local)}}function sY(t,e){return function(){this.setAttribute(t,e)}}function aY(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function cY(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function fY(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function rN(t,e){var n=di(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?iY:oY:typeof e=="function"?n.local?fY:cY:n.local?aY:sY)(n,e))}function Nx(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function uY(t){return function(){this.style.removeProperty(t)}}function lY(t,e,n){return function(){this.style.setProperty(t,e,n)}}function pY(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function oN(t,e,n){return arguments.length>1?this.each((e==null?uY:typeof e=="function"?pY:lY)(t,e,n??"")):fs(this.node(),t)}function fs(t,e){return t.style.getPropertyValue(e)||Nx(t).getComputedStyle(t,null).getPropertyValue(e)}function dY(t){return function(){delete this[t]}}function hY(t,e){return function(){this[t]=e}}function mY(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function iN(t,e){return arguments.length>1?this.each((e==null?dY:typeof e=="function"?mY:hY)(t,e)):this.node()[t]}function sN(t){return t.trim().split(/^|\s+/)}function y_(t){return t.classList||new aN(t)}function aN(t){this._node=t,this._names=sN(t.getAttribute("class")||"")}aN.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function cN(t,e){for(var n=y_(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function fN(t,e){for(var n=y_(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function xY(t){return function(){cN(this,t)}}function gY(t){return function(){fN(this,t)}}function yY(t,e){return function(){(e.apply(this,arguments)?cN:fN)(this,t)}}function uN(t,e){var n=sN(t+"");if(arguments.length<2){for(var r=y_(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof e=="function"?yY:e?xY:gY)(n,e))}function bY(){this.textContent=""}function wY(t){return function(){this.textContent=t}}function vY(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function lN(t){return arguments.length?this.each(t==null?bY:(typeof t=="function"?vY:wY)(t)):this.node().textContent}function _Y(){this.innerHTML=""}function SY(t){return function(){this.innerHTML=t}}function MY(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function pN(t){return arguments.length?this.each(t==null?_Y:(typeof t=="function"?MY:SY)(t)):this.node().innerHTML}function AY(){this.nextSibling&&this.parentNode.appendChild(this)}function dN(){return this.each(AY)}function TY(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function hN(){return this.each(TY)}function mN(t){var e=typeof t=="function"?t:hi(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function EY(){return null}function xN(t,e){var n=typeof t=="function"?t:hi(t),r=e==null?EY:typeof e=="function"?e:Ca(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function IY(){var t=this.parentNode;t&&t.removeChild(this)}function gN(){return this.each(IY)}function NY(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function CY(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function yN(t){return this.select(t?CY:NY)}function bN(t){return arguments.length?this.property("__data__",t):this.node().__data__}function kY(t){return function(e){t.call(this,e,this.__data__)}}function LY(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function RY(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,o=e.length,i;n<o;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++r]=i;++r?e.length=r:delete this.__on}}}function OY(t,e,n){return function(){var r=this.__on,o,i=kY(e);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=e;return}}this.addEventListener(t.type,i,n),o={type:t.type,name:t.name,value:e,listener:i,options:n},r?r.push(o):this.__on=[o]}}function wN(t,e,n){var r=LY(t+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,f=a.length,u;c<f;++c)for(o=0,u=a[c];o<i;++o)if((s=r[o]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?OY:RY,o=0;o<i;++o)this.each(a(r[o],e,n));return this}function vN(t,e,n){var r=Nx(t),o=r.CustomEvent;typeof o=="function"?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function $Y(t,e){return function(){return vN(this,t,e)}}function DY(t,e){return function(){return vN(this,t,e.apply(this,arguments))}}function _N(t,e){return this.each((typeof e=="function"?DY:$Y)(t,e))}function*SN(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var b_=[null];function de(t,e){this._groups=t,this._parents=e}function MN(){return new de([[document.documentElement]],b_)}function PY(){return this}de.prototype=MN.prototype={constructor:de,select:FI,selectAll:qI,selectChild:BI,selectChildren:zI,filter:YI,data:XI,enter:UI,exit:WI,join:VI,merge:GI,selection:PY,order:HI,sort:QI,call:ZI,nodes:JI,node:KI,size:tN,empty:eN,each:nN,attr:rN,style:oN,property:iN,classed:uN,text:lN,html:pN,raise:dN,lower:hN,append:mN,insert:xN,remove:gN,clone:yN,datum:bN,on:wN,dispatch:_N,[Symbol.iterator]:SN};var mi=MN;function Nt(t){return typeof t=="string"?new de([[document.querySelector(t)]],[document.documentElement]):new de([[t]],b_)}function AN(t){let e;for(;e=t.sourceEvent;)t=e;return t}function hn(t,e){if(t=AN(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}var Cx={capture:!0,passive:!1};function kx(t){t.preventDefault(),t.stopImmediatePropagation()}function hp(t){var e=t.document.documentElement,n=Nt(t).on("dragstart.drag",kx,Cx);"onselectstart"in e?n.on("selectstart.drag",kx,Cx):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function mp(t,e){var n=t.document.documentElement,r=Nt(t).on("dragstart.drag",null);e&&(r.on("click.drag",kx,Cx),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 xi(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function us(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function mo(){}var ls=.7,Ra=1/ls,df="\\s*([+-]?\\d+)\\s*",xp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ho="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",FY=/^#([0-9a-f]{3,8})$/,qY=new RegExp(`^rgb\\(${df},${df},${df}\\)$`),BY=new RegExp(`^rgb\\(${ho},${ho},${ho}\\)$`),zY=new RegExp(`^rgba\\(${df},${df},${df},${xp}\\)$`),YY=new RegExp(`^rgba\\(${ho},${ho},${ho},${xp}\\)$`),UY=new RegExp(`^hsl\\(${xp},${ho},${ho}\\)$`),jY=new RegExp(`^hsla\\(${xp},${ho},${ho},${xp}\\)$`),TN={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};xi(mo,nr,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:EN,formatHex:EN,formatHex8:XY,formatHsl:WY,formatRgb:IN,toString:IN});function EN(){return this.rgb().formatHex()}function XY(){return this.rgb().formatHex8()}function WY(){return ON(this).formatHsl()}function IN(){return this.rgb().formatRgb()}function nr(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=FY.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?NN(e):n===3?new Se(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Lx(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Lx(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=qY.exec(t))?new Se(e[1],e[2],e[3],1):(e=BY.exec(t))?new Se(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=zY.exec(t))?Lx(e[1],e[2],e[3],e[4]):(e=YY.exec(t))?Lx(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=UY.exec(t))?LN(e[1],e[2]/100,e[3]/100,1):(e=jY.exec(t))?LN(e[1],e[2]/100,e[3]/100,e[4]):TN.hasOwnProperty(t)?NN(TN[t]):t==="transparent"?new Se(NaN,NaN,NaN,0):null}function NN(t){return new Se(t>>16&255,t>>8&255,t&255,1)}function Lx(t,e,n,r){return r<=0&&(t=e=n=NaN),new Se(t,e,n,r)}function gp(t){return t instanceof mo||(t=nr(t)),t?(t=t.rgb(),new Se(t.r,t.g,t.b,t.opacity)):new Se}function Le(t,e,n,r){return arguments.length===1?gp(t):new Se(t,e,n,r??1)}function Se(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}xi(Se,Le,us(mo,{brighter(t){return t=t==null?Ra:Math.pow(Ra,t),new Se(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ls:Math.pow(ls,t),new Se(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Se(La(this.r),La(this.g),La(this.b),Ox(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:CN,formatHex:CN,formatHex8:VY,formatRgb:kN,toString:kN}));function CN(){return`#${ka(this.r)}${ka(this.g)}${ka(this.b)}`}function VY(){return`#${ka(this.r)}${ka(this.g)}${ka(this.b)}${ka((isNaN(this.opacity)?1:this.opacity)*255)}`}function kN(){let t=Ox(this.opacity);return`${t===1?"rgb(":"rgba("}${La(this.r)}, ${La(this.g)}, ${La(this.b)}${t===1?")":`, ${t})`}`}function Ox(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function La(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ka(t){return t=La(t),(t<16?"0":"")+t.toString(16)}function LN(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Gr(t,e,n,r)}function ON(t){if(t instanceof Gr)return new Gr(t.h,t.s,t.l,t.opacity);if(t instanceof mo||(t=nr(t)),!t)return new Gr;if(t instanceof Gr)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),s=NaN,a=i-o,c=(i+o)/2;return a?(e===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-e)/a+2:s=(e-n)/a+4,a/=c<.5?i+o:2-i-o,s*=60):a=c>0&&c<1?0:s,new Gr(s,a,c,t.opacity)}function yp(t,e,n,r){return arguments.length===1?ON(t):new Gr(t,e,n,r??1)}function Gr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}xi(Gr,yp,us(mo,{brighter(t){return t=t==null?Ra:Math.pow(Ra,t),new Gr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ls:Math.pow(ls,t),new Gr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new Se(w_(t>=240?t-240:t+120,o,r),w_(t,o,r),w_(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new Gr(RN(this.h),Rx(this.s),Rx(this.l),Ox(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Ox(this.opacity);return`${t===1?"hsl(":"hsla("}${RN(this.h)}, ${Rx(this.s)*100}%, ${Rx(this.l)*100}%${t===1?")":`, ${t})`}`}}));function RN(t){return t=(t||0)%360,t<0?t+360:t}function Rx(t){return Math.max(0,Math.min(1,t||0))}function w_(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var $x=Math.PI/180,Dx=180/Math.PI;var Px=18,$N=.96422,DN=1,PN=.82521,FN=4/29,hf=6/29,qN=3*hf*hf,GY=hf*hf*hf;function BN(t){if(t instanceof xo)return new xo(t.l,t.a,t.b,t.opacity);if(t instanceof gi)return zN(t);t instanceof Se||(t=gp(t));var e=M_(t.r),n=M_(t.g),r=M_(t.b),o=v_((.2225045*e+.7168786*n+.0606169*r)/DN),i,s;return e===n&&n===r?i=s=o:(i=v_((.4360747*e+.3850649*n+.1430804*r)/$N),s=v_((.0139322*e+.0971045*n+.7141733*r)/PN)),new xo(116*o-16,500*(i-o),200*(o-s),t.opacity)}function mf(t,e,n,r){return arguments.length===1?BN(t):new xo(t,e,n,r??1)}function xo(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}xi(xo,mf,us(mo,{brighter(t){return new xo(this.l+Px*(t??1),this.a,this.b,this.opacity)},darker(t){return new xo(this.l-Px*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=$N*__(e),t=DN*__(t),n=PN*__(n),new Se(S_(3.1338561*e-1.6168667*t-.4906146*n),S_(-.9787684*e+1.9161415*t+.033454*n),S_(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function v_(t){return t>GY?Math.pow(t,1/3):t/qN+FN}function __(t){return t>hf?t*t*t:qN*(t-FN)}function S_(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function M_(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function HY(t){if(t instanceof gi)return new gi(t.h,t.c,t.l,t.opacity);if(t instanceof xo||(t=BN(t)),t.a===0&&t.b===0)return new gi(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Dx;return new gi(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function bp(t,e,n,r){return arguments.length===1?HY(t):new gi(t,e,n,r??1)}function gi(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function zN(t){if(isNaN(t.h))return new xo(t.l,0,0,t.opacity);var e=t.h*$x;return new xo(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}xi(gi,bp,us(mo,{brighter(t){return new gi(this.h,this.c,this.l+Px*(t??1),this.opacity)},darker(t){return new gi(this.h,this.c,this.l-Px*(t??1),this.opacity)},rgb(){return zN(this).rgb()}}));var XN=-.14861,A_=1.78277,T_=-.29227,Fx=-.90649,wp=1.97294,YN=wp*Fx,UN=wp*A_,jN=A_*T_-Fx*XN;function QY(t){if(t instanceof Oa)return new Oa(t.h,t.s,t.l,t.opacity);t instanceof Se||(t=gp(t));var e=t.r/255,n=t.g/255,r=t.b/255,o=(jN*r+YN*e-UN*n)/(jN+YN-UN),i=r-o,s=(wp*(n-o)-T_*i)/Fx,a=Math.sqrt(s*s+i*i)/(wp*o*(1-o)),c=a?Math.atan2(s,i)*Dx-120:NaN;return new Oa(c<0?c+360:c,a,o,t.opacity)}function Cn(t,e,n,r){return arguments.length===1?QY(t):new Oa(t,e,n,r??1)}function Oa(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}xi(Oa,Cn,us(mo,{brighter(t){return t=t==null?Ra:Math.pow(Ra,t),new Oa(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ls:Math.pow(ls,t),new Oa(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*$x,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),o=Math.sin(t);return new Se(255*(e+n*(XN*r+A_*o)),255*(e+n*(T_*r+Fx*o)),255*(e+n*(wp*r)),this.opacity)}}));function E_(t,e,n,r,o){var i=t*t,s=i*t;return((1-3*t+3*i-s)*e+(4-6*i+3*s)*n+(1+3*t+3*i-3*s)*r+s*o)/6}function WN(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],s=r>0?t[r-1]:2*o-i,a=r<e-1?t[r+2]:2*i-o;return E_((n-r/e)*e,s,o,i,a)}}function VN(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],i=t[r%e],s=t[(r+1)%e],a=t[(r+2)%e];return E_((n-r/e)*e,o,i,s,a)}}var xf=t=>()=>t;function GN(t,e){return function(n){return t+n*e}}function ZY(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function gf(t,e){var n=e-t;return n?GN(t,n>180||n<-180?n-360*Math.round(n/360):n):xf(isNaN(t)?e:t)}function HN(t){return(t=+t)==1?re:function(e,n){return n-e?ZY(e,n,t):xf(isNaN(e)?n:e)}}function re(t,e){var n=e-t;return n?GN(t,n):xf(isNaN(t)?e:t)}var Ar=function t(e){var n=HN(e);function r(o,i){var s=n((o=Le(o)).r,(i=Le(i)).r),a=n(o.g,i.g),c=n(o.b,i.b),f=re(o.opacity,i.opacity);return function(u){return o.r=s(u),o.g=a(u),o.b=c(u),o.opacity=f(u),o+""}}return r.gamma=t,r}(1);function QN(t){return function(e){var n=e.length,r=new Array(n),o=new Array(n),i=new Array(n),s,a;for(s=0;s<n;++s)a=Le(e[s]),r[s]=a.r||0,o[s]=a.g||0,i[s]=a.b||0;return r=t(r),o=t(o),i=t(i),a.opacity=1,function(c){return a.r=r(c),a.g=o(c),a.b=i(c),a+""}}}var I_=QN(WN),JY=QN(VN);function ZN(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=t[o]*(1-i)+e[o]*i;return r}}function JN(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function KN(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=rr(t[s],e[s]);for(;s<n;++s)i[s]=e[s];return function(a){for(s=0;s<r;++s)i[s]=o[s](a);return i}}function tC(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function ee(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function eC(t,e){var n={},r={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?n[o]=rr(t[o],e[o]):r[o]=e[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var C_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,N_=new RegExp(C_.source,"g");function KY(t){return function(){return t}}function tU(t){return function(e){return t(e)+""}}function vp(t,e){var n=C_.lastIndex=N_.lastIndex=0,r,o,i,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=C_.exec(t))&&(o=N_.exec(e));)(i=o.index)>n&&(i=e.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,c.push({i:s,x:ee(r,o)})),n=N_.lastIndex;return n<e.length&&(i=e.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?c[0]?tU(c[0].x):KY(e):(e=c.length,function(f){for(var u=0,p;u<e;++u)a[(p=c[u]).i]=p.x(f);return a.join("")})}function rr(t,e){var n=typeof e,r;return e==null||n==="boolean"?xf(e):(n==="number"?ee:n==="string"?(r=nr(e))?(e=r,Ar):vp:e instanceof nr?Ar:e instanceof Date?tC:JN(e)?ZN:Array.isArray(e)?KN:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?eC:ee)(t,e)}function $a(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var nC=180/Math.PI,qx={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function k_(t,e,n,r,o,i){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*nC,skewX:Math.atan(c)*nC,scaleX:s,scaleY:a}}var Bx;function rC(t){let e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?qx:k_(e.a,e.b,e.c,e.d,e.e,e.f)}function oC(t){return t==null?qx:(Bx||(Bx=document.createElementNS("http://www.w3.org/2000/svg","g")),Bx.setAttribute("transform",t),(t=Bx.transform.baseVal.consolidate())?(t=t.matrix,k_(t.a,t.b,t.c,t.d,t.e,t.f)):qx)}function iC(t,e,n,r){function o(f){return f.length?f.pop()+" ":""}function i(f,u,p,l,d,h){if(f!==p||u!==l){var m=d.push("translate(",null,e,null,n);h.push({i:m-4,x:ee(f,p)},{i:m-2,x:ee(u,l)})}else(p||l)&&d.push("translate("+p+e+l+n)}function s(f,u,p,l){f!==u?(f-u>180?u+=360:u-f>180&&(f+=360),l.push({i:p.push(o(p)+"rotate(",null,r)-2,x:ee(f,u)})):u&&p.push(o(p)+"rotate("+u+r)}function a(f,u,p,l){f!==u?l.push({i:p.push(o(p)+"skewX(",null,r)-2,x:ee(f,u)}):u&&p.push(o(p)+"skewX("+u+r)}function c(f,u,p,l,d,h){if(f!==p||u!==l){var m=d.push(o(d)+"scale(",null,",",null,")");h.push({i:m-4,x:ee(f,p)},{i:m-2,x:ee(u,l)})}else(p!==1||l!==1)&&d.push(o(d)+"scale("+p+","+l+")")}return function(f,u){var p=[],l=[];return f=t(f),u=t(u),i(f.translateX,f.translateY,u.translateX,u.translateY,p,l),s(f.rotate,u.rotate,p,l),a(f.skewX,u.skewX,p,l),c(f.scaleX,f.scaleY,u.scaleX,u.scaleY,p,l),f=u=null,function(d){for(var h=-1,m=l.length,x;++h<m;)p[(x=l[h]).i]=x.x(d);return p.join("")}}}var L_=iC(rC,"px, ","px)","deg)"),R_=iC(oC,", ",")",")");var eU=1e-12;function sC(t){return((t=Math.exp(t))+1/t)/2}function nU(t){return((t=Math.exp(t))-1/t)/2}function rU(t){return((t=Math.exp(2*t))-1)/(t+1)}var O_=function t(e,n,r){function o(i,s){var a=i[0],c=i[1],f=i[2],u=s[0],p=s[1],l=s[2],d=u-a,h=p-c,m=d*d+h*h,x,g;if(m<eU)g=Math.log(l/f)/e,x=function(A){return[a+A*d,c+A*h,f*Math.exp(e*A*g)]};else{var y=Math.sqrt(m),b=(l*l-f*f+r*m)/(2*f*n*y),w=(l*l-f*f-r*m)/(2*l*n*y),_=Math.log(Math.sqrt(b*b+1)-b),v=Math.log(Math.sqrt(w*w+1)-w);g=(v-_)/e,x=function(A){var T=A*g,E=sC(_),N=f/(n*y)*(E*rU(e*T+_)-nU(_));return[a+N*d,c+N*h,f*E/sC(e*T+_)]}}return x.duration=g*1e3*e/Math.SQRT2,x}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return t(s,a,c)},o}(Math.SQRT2,2,4);function aC(t){return function(e,n){var r=t((e=yp(e)).h,(n=yp(n)).h),o=re(e.s,n.s),i=re(e.l,n.l),s=re(e.opacity,n.opacity);return function(a){return e.h=r(a),e.s=o(a),e.l=i(a),e.opacity=s(a),e+""}}}var $_=aC(gf),oU=aC(re);function zx(t,e){var n=re((t=mf(t)).l,(e=mf(e)).l),r=re(t.a,e.a),o=re(t.b,e.b),i=re(t.opacity,e.opacity);return function(s){return t.l=n(s),t.a=r(s),t.b=o(s),t.opacity=i(s),t+""}}function cC(t){return function(e,n){var r=t((e=bp(e)).h,(n=bp(n)).h),o=re(e.c,n.c),i=re(e.l,n.l),s=re(e.opacity,n.opacity);return function(a){return e.h=r(a),e.c=o(a),e.l=i(a),e.opacity=s(a),e+""}}}var D_=cC(gf),iU=cC(re);function fC(t){return function e(n){n=+n;function r(o,i){var s=t((o=Cn(o)).h,(i=Cn(i)).h),a=re(o.s,i.s),c=re(o.l,i.l),f=re(o.opacity,i.opacity);return function(u){return o.h=s(u),o.s=a(u),o.l=c(Math.pow(u,n)),o.opacity=f(u),o+""}}return r.gamma=e,r}(1)}var sU=fC(gf),yf=fC(re);function go(t,e){e===void 0&&(e=t,t=rr);for(var n=0,r=e.length-1,o=e[0],i=new Array(r<0?0:r);n<r;)i[n]=t(o,o=e[++n]);return function(s){var a=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return i[a](s-a)}}function mn(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}var bf=0,Sp=0,_p=0,lC=1e3,Yx,Mp,Ux=0,Da=0,jx=0,Ap=typeof performance=="object"&&performance.now?performance:Date,pC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ep(){return Da||(pC(aU),Da=Ap.now()+jx)}function aU(){Da=0}function Tp(){this._call=this._time=this._next=null}Tp.prototype=Xx.prototype={constructor:Tp,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ep():+n)+(e==null?0:+e),!this._next&&Mp!==this&&(Mp?Mp._next=this:Yx=this,Mp=this),this._call=t,this._time=n,P_()},stop:function(){this._call&&(this._call=null,this._time=1/0,P_())}};function Xx(t,e,n){var r=new Tp;return r.restart(t,e,n),r}function dC(){Ep(),++bf;for(var t=Yx,e;t;)(e=Da-t._time)>=0&&t._call.call(void 0,e),t=t._next;--bf}function uC(){Da=(Ux=Ap.now())+jx,bf=Sp=0;try{dC()}finally{bf=0,fU(),Da=0}}function cU(){var t=Ap.now(),e=t-Ux;e>lC&&(jx-=e,Ux=t)}function fU(){for(var t,e=Yx,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Yx=n);Mp=t,P_(r)}function P_(t){if(!bf){Sp&&(Sp=clearTimeout(Sp));var e=t-Da;e>24?(t<1/0&&(Sp=setTimeout(uC,t-Ap.now()-jx)),_p&&(_p=clearInterval(_p))):(_p||(Ux=Ap.now(),_p=setInterval(cU,lC)),bf=1,pC(uC))}}function Wx(t,e,n){var r=new Tp;return e=e==null?0:+e,r.restart(o=>{r.stop(),t(o+e)},e,n),r}var uU=Na("start","end","cancel","interrupt"),lU=[],xC=0,hC=1,Gx=2,Vx=3,mC=4,Hx=5,Ip=6;function ps(t,e,n,r,o,i){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;pU(t,n,{name:e,index:r,group:o,on:uU,tween:lU,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:xC})}function Np(t,e){var n=Re(t,e);if(n.state>xC)throw new Error("too late; already scheduled");return n}function an(t,e){var n=Re(t,e);if(n.state>Vx)throw new Error("too late; already running");return n}function Re(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function pU(t,e,n){var r=t.__transition,o;r[e]=n,n.timer=Xx(i,0,n.time);function i(f){n.state=hC,n.timer.restart(s,n.delay,n.time),n.delay<=f&&s(f-n.delay)}function s(f){var u,p,l,d;if(n.state!==hC)return c();for(u in r)if(d=r[u],d.name===n.name){if(d.state===Vx)return Wx(s);d.state===mC?(d.state=Ip,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[u]):+u<e&&(d.state=Ip,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[u])}if(Wx(function(){n.state===Vx&&(n.state=mC,n.timer.restart(a,n.delay,n.time),a(f))}),n.state=Gx,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Gx){for(n.state=Vx,o=new Array(l=n.tween.length),u=0,p=-1;u<l;++u)(d=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(o[++p]=d);o.length=p+1}}function a(f){for(var u=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=Hx,1),p=-1,l=o.length;++p<l;)o[p].call(t,u);n.state===Hx&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=Ip,n.timer.stop(),delete r[e];for(var f in r)return;delete t.__transition}}function yo(t,e){var n=t.__transition,r,o,i=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){i=!1;continue}o=r.state>Gx&&r.state<Hx,r.state=Ip,r.timer.stop(),r.on.call(o?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}i&&delete t.__transition}}function gC(t){return this.each(function(){yo(this,t)})}function dU(t,e){var n,r;return function(){var o=an(this,t),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function hU(t,e,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=an(this,t),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:e,value:n},c=0,f=o.length;c<f;++c)if(o[c].name===e){o[c]=a;break}c===f&&o.push(a)}i.tween=o}}function yC(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Re(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===t)return s.value;return null}return this.each((e==null?dU:hU)(n,t,e))}function wf(t,e,n){var r=t._id;return t.each(function(){var o=an(this,r);(o.value||(o.value={}))[e]=n.apply(this,arguments)}),function(o){return Re(o,r).value[e]}}function Qx(t,e){var n;return(typeof e=="number"?ee:e instanceof nr?Ar:(n=nr(e))?(e=n,Ar):vp)(t,e)}function mU(t){return function(){this.removeAttribute(t)}}function xU(t){return function(){this.removeAttributeNS(t.space,t.local)}}function gU(t,e,n){var r,o=n+"",i;return function(){var s=this.getAttribute(t);return s===o?null:s===r?i:i=e(r=s,n)}}function yU(t,e,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===r?i:i=e(r=s,n)}}function bU(t,e,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=e(r=s,a)))}}function wU(t,e,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=e(r=s,a)))}}function bC(t,e){var n=di(t),r=n==="transform"?R_:Qx;return this.attrTween(t,typeof e=="function"?(n.local?wU:bU)(n,r,wf(this,"attr."+t,e)):e==null?(n.local?xU:mU)(n):(n.local?yU:gU)(n,r,e))}function vU(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function _U(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function SU(t,e){var n,r;function o(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&_U(t,i)),n}return o._value=e,o}function MU(t,e){var n,r;function o(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&vU(t,i)),n}return o._value=e,o}function wC(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=di(t);return this.tween(n,(r.local?SU:MU)(r,e))}function AU(t,e){return function(){Np(this,t).delay=+e.apply(this,arguments)}}function TU(t,e){return e=+e,function(){Np(this,t).delay=e}}function vC(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?AU:TU)(e,t)):Re(this.node(),e).delay}function EU(t,e){return function(){an(this,t).duration=+e.apply(this,arguments)}}function IU(t,e){return e=+e,function(){an(this,t).duration=e}}function _C(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?EU:IU)(e,t)):Re(this.node(),e).duration}function NU(t,e){if(typeof e!="function")throw new Error;return function(){an(this,t).ease=e}}function SC(t){var e=this._id;return arguments.length?this.each(NU(e,t)):Re(this.node(),e).ease}function CU(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;an(this,t).ease=n}}function MC(t){if(typeof t!="function")throw new Error;return this.each(CU(this._id,t))}function AC(t){typeof t!="function"&&(t=pp(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],s=i.length,a=r[o]=[],c,f=0;f<s;++f)(c=i[f])&&t.call(c,c.__data__,f,i)&&a.push(c);return new kn(r,this._parents,this._name,this._id)}function TC(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var c=e[a],f=n[a],u=c.length,p=s[a]=new Array(u),l,d=0;d<u;++d)(l=c[d]||f[d])&&(p[d]=l);for(;a<r;++a)s[a]=e[a];return new kn(s,this._parents,this._name,this._id)}function kU(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function LU(t,e,n){var r,o,i=kU(e)?Np:an;return function(){var s=i(this,t),a=s.on;a!==r&&(o=(r=a).copy()).on(e,n),s.on=o}}function EC(t,e){var n=this._id;return arguments.length<2?Re(this.node(),n).on.on(t):this.each(LU(n,t,e))}function RU(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function IC(){return this.on("end.remove",RU(this._id))}function NC(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ca(t));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],c=a.length,f=i[s]=new Array(c),u,p,l=0;l<c;++l)(u=a[l])&&(p=t.call(u,u.__data__,l,a))&&("__data__"in u&&(p.__data__=u.__data__),f[l]=p,ps(f[l],e,n,l,f,Re(u,n)));return new kn(i,this._parents,e,n)}function CC(t){var e=this._name,n=this._id;typeof t!="function"&&(t=lp(t));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var c=r[a],f=c.length,u,p=0;p<f;++p)if(u=c[p]){for(var l=t.call(u,u.__data__,p,c),d,h=Re(u,n),m=0,x=l.length;m<x;++m)(d=l[m])&&ps(d,e,n,m,l,h);i.push(l),s.push(u)}return new kn(i,s,e,n)}var OU=mi.prototype.constructor;function kC(){return new OU(this._groups,this._parents)}function $U(t,e){var n,r,o;return function(){var i=fs(this,t),s=(this.style.removeProperty(t),fs(this,t));return i===s?null:i===n&&s===r?o:o=e(n=i,r=s)}}function LC(t){return function(){this.style.removeProperty(t)}}function DU(t,e,n){var r,o=n+"",i;return function(){var s=fs(this,t);return s===o?null:s===r?i:i=e(r=s,n)}}function PU(t,e,n){var r,o,i;return function(){var s=fs(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),fs(this,t))),s===c?null:s===r&&c===o?i:(o=c,i=e(r=s,a))}}function FU(t,e){var n,r,o,i="style."+e,s="end."+i,a;return function(){var c=an(this,t),f=c.on,u=c.value[i]==null?a||(a=LC(e)):void 0;(f!==n||o!==u)&&(r=(n=f).copy()).on(s,o=u),c.on=r}}function RC(t,e,n){var r=(t+="")=="transform"?L_:Qx;return e==null?this.styleTween(t,$U(t,r)).on("end.style."+t,LC(t)):typeof e=="function"?this.styleTween(t,PU(t,r,wf(this,"style."+t,e))).each(FU(this._id,t)):this.styleTween(t,DU(t,r,e),n).on("end.style."+t,null)}function qU(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function BU(t,e,n){var r,o;function i(){var s=e.apply(this,arguments);return s!==o&&(r=(o=s)&&qU(t,s,n)),r}return i._value=e,i}function OC(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,BU(t,e,n??""))}function zU(t){return function(){this.textContent=t}}function YU(t){return function(){var e=t(this);this.textContent=e??""}}function $C(t){return this.tween("text",typeof t=="function"?YU(wf(this,"text",t)):zU(t==null?"":t+""))}function UU(t){return function(e){this.textContent=t.call(this,e)}}function jU(t){var e,n;function r(){var o=t.apply(this,arguments);return o!==n&&(e=(n=o)&&UU(o)),e}return r._value=t,r}function DC(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,jU(t))}function PC(){for(var t=this._name,e=this._id,n=Zx(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,f=0;f<a;++f)if(c=s[f]){var u=Re(c,e);ps(c,t,n,f,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new kn(r,this._parents,t,n)}function FC(){var t,e,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},c={value:function(){--o===0&&i()}};n.each(function(){var f=an(this,r),u=f.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),f.on=e}),o===0&&i()})}var XU=0;function kn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function qC(t){return mi().transition(t)}function Zx(){return++XU}var yi=mi.prototype;kn.prototype=qC.prototype={constructor:kn,select:NC,selectAll:CC,selectChild:yi.selectChild,selectChildren:yi.selectChildren,filter:AC,merge:TC,selection:kC,transition:PC,call:yi.call,nodes:yi.nodes,node:yi.node,size:yi.size,empty:yi.empty,each:yi.each,on:EC,attr:bC,attrTween:wC,style:RC,styleTween:OC,text:$C,textTween:DC,remove:IC,tween:yC,delay:vC,duration:_C,ease:SC,easeVarying:MC,end:FC,[Symbol.iterator]:yi[Symbol.iterator]};function Jx(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var WU={time:null,delay:0,duration:250,ease:Jx};function VU(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function BC(t){var e,n;t instanceof kn?(e=t._id,t=t._name):(e=Zx(),(n=WU).time=Ep(),t=t==null?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,f=0;f<a;++f)(c=s[f])&&ps(c,t,e,f,s,n||VU(c,e));return new kn(r,this._parents,t,e)}mi.prototype.interrupt=gC;mi.prototype.transition=BC;var Kx=t=>()=>t;function F_(t,{sourceEvent:e,target:n,selection:r,mode:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function zC(t){t.stopImmediatePropagation()}function tg(t){t.preventDefault(),t.stopImmediatePropagation()}var YC={name:"drag"},q_={name:"space"},vf={name:"handle"},_f={name:"center"},{abs:UC,max:xn,min:gn}=Math;function jC(t){return[+t[0],+t[1]]}function z_(t){return[jC(t[0]),jC(t[1])]}var eg={name:"x",handles:["w","e"].map(Cp),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ng={name:"y",handles:["n","s"].map(Cp),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},GU={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Cp),input:function(t){return t==null?null:z_(t)},output:function(t){return t}},bi={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"},XC={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},WC={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},HU={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},QU={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Cp(t){return{type:t}}function ZU(t){return!t.ctrlKey&&!t.button}function JU(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function KU(){return navigator.maxTouchPoints||"ontouchstart"in this}function B_(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function tj(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Y_(){return X_(eg)}function U_(){return X_(ng)}function j_(){return X_(GU)}function X_(t){var e=JU,n=ZU,r=KU,o=!0,i=Na("start","brush","end"),s=6,a;function c(x){var g=x.property("__brush",m).selectAll(".overlay").data([Cp("overlay")]);g.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",bi.overlay).merge(g).each(function(){var b=B_(this).extent;Nt(this).attr("x",b[0][0]).attr("y",b[0][1]).attr("width",b[1][0]-b[0][0]).attr("height",b[1][1]-b[0][1])}),x.selectAll(".selection").data([Cp("selection")]).enter().append("rect").attr("class","selection").attr("cursor",bi.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=x.selectAll(".handle").data(t.handles,function(b){return b.type});y.exit().remove(),y.enter().append("rect").attr("class",function(b){return"handle handle--"+b.type}).attr("cursor",function(b){return bi[b.type]}),x.each(f).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",l).filter(r).on("touchstart.brush",l).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",h).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(x,g,y){x.tween?x.on("start.brush",function(b){u(this,arguments).beforestart().start(b)}).on("interrupt.brush end.brush",function(b){u(this,arguments).end(b)}).tween("brush",function(){var b=this,w=b.__brush,_=u(b,arguments),v=w.selection,A=t.input(typeof g=="function"?g.apply(this,arguments):g,w.extent),T=rr(v,A);function E(N){w.selection=N===1&&A===null?null:T(N),f.call(b),_.brush()}return v!==null&&A!==null?E:E(1)}):x.each(function(){var b=this,w=arguments,_=b.__brush,v=t.input(typeof g=="function"?g.apply(b,w):g,_.extent),A=u(b,w).beforestart();yo(b),_.selection=v===null?null:v,f.call(b),A.start(y).brush(y).end(y)})},c.clear=function(x,g){c.move(x,null,g)};function f(){var x=Nt(this),g=B_(this).selection;g?(x.selectAll(".selection").style("display",null).attr("x",g[0][0]).attr("y",g[0][1]).attr("width",g[1][0]-g[0][0]).attr("height",g[1][1]-g[0][1]),x.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?g[1][0]-s/2:g[0][0]-s/2}).attr("y",function(y){return y.type[0]==="s"?g[1][1]-s/2:g[0][1]-s/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?g[1][0]-g[0][0]+s:s}).attr("height",function(y){return y.type==="e"||y.type==="w"?g[1][1]-g[0][1]+s:s})):x.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(x,g,y){var b=x.__brush.emitter;return b&&(!y||!b.clean)?b:new p(x,g,y)}function p(x,g,y){this.that=x,this.args=g,this.state=x.__brush,this.active=0,this.clean=y}p.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(x,g){return this.starting?(this.starting=!1,this.emit("start",x,g)):this.emit("brush",x),this},brush:function(x,g){return this.emit("brush",x,g),this},end:function(x,g){return--this.active===0&&(delete this.state.emitter,this.emit("end",x,g)),this},emit:function(x,g,y){var b=Nt(this.that).datum();i.call(x,this.that,new F_(x,{sourceEvent:g,target:c,selection:t.output(this.state.selection),mode:y,dispatch:i}),b)}};function l(x){if(a&&!x.touches||!n.apply(this,arguments))return;var g=this,y=x.target.__data__.type,b=(o&&x.metaKey?y="overlay":y)==="selection"?YC:o&&x.altKey?_f:vf,w=t===ng?null:HU[y],_=t===eg?null:QU[y],v=B_(g),A=v.extent,T=v.selection,E=A[0][0],N,M,k=A[0][1],O,S,I=A[1][0],C,L,D=A[1][1],$,P,F=0,q=0,V,K=w&&_&&o&&x.shiftKey,et,rt,j=Array.from(x.touches||[x],Z=>{let jt=Z.identifier;return Z=hn(Z,g),Z.point0=Z.slice(),Z.identifier=jt,Z});yo(g);var nt=u(g,arguments,!0).beforestart();if(y==="overlay"){T&&(V=!0);let Z=[j[0],j[1]||j[0]];v.selection=T=[[N=t===ng?E:gn(Z[0][0],Z[1][0]),O=t===eg?k:gn(Z[0][1],Z[1][1])],[C=t===ng?I:xn(Z[0][0],Z[1][0]),$=t===eg?D:xn(Z[0][1],Z[1][1])]],j.length>1&&_t(x)}else N=T[0][0],O=T[0][1],C=T[1][0],$=T[1][1];M=N,S=O,L=C,P=$;var Y=Nt(g).attr("pointer-events","none"),G=Y.selectAll(".overlay").attr("cursor",bi[y]);if(x.touches)nt.moved=B,nt.ended=ct;else{var tt=Nt(x.view).on("mousemove.brush",B,!0).on("mouseup.brush",ct,!0);o&&tt.on("keydown.brush",Ct,!0).on("keyup.brush",Lt,!0),hp(x.view)}f.call(g),nt.start(x,b.name);function B(Z){for(let jt of Z.changedTouches||[Z])for(let Qn of j)Qn.identifier===jt.identifier&&(Qn.cur=hn(jt,g));if(K&&!et&&!rt&&j.length===1){let jt=j[0];UC(jt.cur[0]-jt[0])>UC(jt.cur[1]-jt[1])?rt=!0:et=!0}for(let jt of j)jt.cur&&(jt[0]=jt.cur[0],jt[1]=jt.cur[1]);V=!0,tg(Z),_t(Z)}function _t(Z){let jt=j[0],Qn=jt.point0;var ro;switch(F=jt[0]-Qn[0],q=jt[1]-Qn[1],b){case q_:case YC:{w&&(F=xn(E-N,gn(I-C,F)),M=N+F,L=C+F),_&&(q=xn(k-O,gn(D-$,q)),S=O+q,P=$+q);break}case vf:{j[1]?(w&&(M=xn(E,gn(I,j[0][0])),L=xn(E,gn(I,j[1][0])),w=1),_&&(S=xn(k,gn(D,j[0][1])),P=xn(k,gn(D,j[1][1])),_=1)):(w<0?(F=xn(E-N,gn(I-N,F)),M=N+F,L=C):w>0&&(F=xn(E-C,gn(I-C,F)),M=N,L=C+F),_<0?(q=xn(k-O,gn(D-O,q)),S=O+q,P=$):_>0&&(q=xn(k-$,gn(D-$,q)),S=O,P=$+q));break}case _f:{w&&(M=xn(E,gn(I,N-F*w)),L=xn(E,gn(I,C+F*w))),_&&(S=xn(k,gn(D,O-q*_)),P=xn(k,gn(D,$+q*_)));break}}L<M&&(w*=-1,ro=N,N=C,C=ro,ro=M,M=L,L=ro,y in XC&&G.attr("cursor",bi[y=XC[y]])),P<S&&(_*=-1,ro=O,O=$,$=ro,ro=S,S=P,P=ro,y in WC&&G.attr("cursor",bi[y=WC[y]])),v.selection&&(T=v.selection),et&&(M=T[0][0],L=T[1][0]),rt&&(S=T[0][1],P=T[1][1]),(T[0][0]!==M||T[0][1]!==S||T[1][0]!==L||T[1][1]!==P)&&(v.selection=[[M,S],[L,P]],f.call(g),nt.brush(Z,b.name))}function ct(Z){if(zC(Z),Z.touches){if(Z.touches.length)return;a&&clearTimeout(a),a=setTimeout(function(){a=null},500)}else mp(Z.view,V),tt.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);Y.attr("pointer-events","all"),G.attr("cursor",bi.overlay),v.selection&&(T=v.selection),tj(T)&&(v.selection=null,f.call(g)),nt.end(Z,b.name)}function Ct(Z){switch(Z.keyCode){case 16:{K=w&&_;break}case 18:{b===vf&&(w&&(C=L-F*w,N=M+F*w),_&&($=P-q*_,O=S+q*_),b=_f,_t(Z));break}case 32:{(b===vf||b===_f)&&(w<0?C=L-F:w>0&&(N=M-F),_<0?$=P-q:_>0&&(O=S-q),b=q_,G.attr("cursor",bi.selection),_t(Z));break}default:return}tg(Z)}function Lt(Z){switch(Z.keyCode){case 16:{K&&(et=rt=K=!1,_t(Z));break}case 18:{b===_f&&(w<0?C=L:w>0&&(N=M),_<0?$=P:_>0&&(O=S),b=vf,_t(Z));break}case 32:{b===q_&&(Z.altKey?(w&&(C=L-F*w,N=M+F*w),_&&($=P-q*_,O=S+q*_),b=_f):(w<0?C=L:w>0&&(N=M),_<0?$=P:_>0&&(O=S),b=vf),G.attr("cursor",bi[y]),_t(Z));break}default:return}tg(Z)}}function d(x){u(this,arguments).moved(x)}function h(x){u(this,arguments).ended(x)}function m(){var x=this.__brush||{selection:null};return x.extent=z_(e.apply(this,arguments)),x.dim=t,x}return c.extent=function(x){return arguments.length?(e=typeof x=="function"?x:Kx(z_(x)),c):e},c.filter=function(x){return arguments.length?(n=typeof x=="function"?x:Kx(!!x),c):n},c.touchable=function(x){return arguments.length?(r=typeof x=="function"?x:Kx(!!x),c):r},c.handleSize=function(x){return arguments.length?(s=+x,c):s},c.keyModifiers=function(x){return arguments.length?(o=!!x,c):o},c.on=function(){var x=i.on.apply(i,arguments);return x===i?c:x},c}var W_=Math.PI,V_=2*W_,Pa=1e-6,ej=V_-Pa;function VC(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function nj(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return VC;let n=10**e;return function(r){this._+=r[0];for(let o=1,i=r.length;o<i;++o)this._+=Math.round(arguments[o]*n)/n+r[o]}}var ds=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?VC:nj(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,o){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+o}`}bezierCurveTo(e,n,r,o,i,s){this._append`C${+e},${+n},${+r},${+o},${this._x1=+i},${this._y1=+s}`}arcTo(e,n,r,o,i){if(e=+e,n=+n,r=+r,o=+o,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,a=this._y1,c=r-e,f=o-n,u=s-e,p=a-n,l=u*u+p*p;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(l>Pa)if(!(Math.abs(p*c-f*u)>Pa)||!i)this._append`L${this._x1=e},${this._y1=n}`;else{let d=r-s,h=o-a,m=c*c+f*f,x=d*d+h*h,g=Math.sqrt(m),y=Math.sqrt(l),b=i*Math.tan((W_-Math.acos((m+l-x)/(2*g*y)))/2),w=b/y,_=b/g;Math.abs(w-1)>Pa&&this._append`L${e+w*u},${n+w*p}`,this._append`A${i},${i},0,0,${+(p*d>u*h)},${this._x1=e+_*c},${this._y1=n+_*f}`}}arc(e,n,r,o,i,s){if(e=+e,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(o),c=r*Math.sin(o),f=e+a,u=n+c,p=1^s,l=s?o-i:i-o;this._x1===null?this._append`M${f},${u}`:(Math.abs(this._x1-f)>Pa||Math.abs(this._y1-u)>Pa)&&this._append`L${f},${u}`,r&&(l<0&&(l=l%V_+V_),l>ej?this._append`A${r},${r},0,1,${p},${e-a},${n-c}A${r},${r},0,1,${p},${this._x1=f},${this._y1=u}`:l>Pa&&this._append`A${r},${r},0,${+(l>=W_)},${p},${this._x1=e+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(e,n,r,o){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+o}h${-r}Z`}toString(){return this._}};function GC(){return new ds}GC.prototype=ds.prototype;function Ln(t=3){return new ds(+t)}var rj=Array.prototype,rg=rj.slice;function HC(t,e){return t-e}function QC(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}var bo=t=>()=>t;function ZC(t,e){for(var n=-1,r=e.length,o;++n<r;)if(o=oj(t,e[n]))return o;return 0}function oj(t,e){for(var n=e[0],r=e[1],o=-1,i=0,s=t.length,a=s-1;i<s;a=i++){var c=t[i],f=c[0],u=c[1],p=t[a],l=p[0],d=p[1];if(ij(c,p,e))return 0;u>r!=d>r&&n<(l-f)*(r-u)/(d-u)+f&&(o=-o)}return o}function ij(t,e,n){var r;return sj(t,e,n)&&aj(t[r=+(t[0]===e[0])],n[r],e[r])}function sj(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function aj(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function JC(){}var wi=[[],[[[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 hs(){var t=1,e=1,n=as,r=c;function o(f){var u=n(f);if(Array.isArray(u))u=u.slice().sort(HC);else{let p=Ft(f,cj);for(u=on(...uf(p[0],p[1],u),u);u[u.length-1]>=p[1];)u.pop();for(;u[1]<p[0];)u.shift()}return u.map(p=>i(f,p))}function i(f,u){let p=u==null?NaN:+u;if(isNaN(p))throw new Error(`invalid value: ${u}`);var l=[],d=[];return s(f,p,function(h){r(h,f,p),QC(h)>0?l.push([h]):d.push(h)}),d.forEach(function(h){for(var m=0,x=l.length,g;m<x;++m)if(ZC((g=l[m])[0],h)!==-1){g.push(h);return}}),{type:"MultiPolygon",value:u,coordinates:l}}function s(f,u,p){var l=new Array,d=new Array,h,m,x,g,y,b;for(h=m=-1,g=Fa(f[0],u),wi[g<<1].forEach(w);++h<t-1;)x=g,g=Fa(f[h+1],u),wi[x|g<<1].forEach(w);for(wi[g<<0].forEach(w);++m<e-1;){for(h=-1,g=Fa(f[m*t+t],u),y=Fa(f[m*t],u),wi[g<<1|y<<2].forEach(w);++h<t-1;)x=g,g=Fa(f[m*t+t+h+1],u),b=y,y=Fa(f[m*t+h+1],u),wi[x|g<<1|y<<2|b<<3].forEach(w);wi[g|y<<3].forEach(w)}for(h=-1,y=f[m*t]>=u,wi[y<<2].forEach(w);++h<t-1;)b=y,y=Fa(f[m*t+h+1],u),wi[y<<2|b<<3].forEach(w);wi[y<<3].forEach(w);function w(_){var v=[_[0][0]+h,_[0][1]+m],A=[_[1][0]+h,_[1][1]+m],T=a(v),E=a(A),N,M;(N=d[T])?(M=l[E])?(delete d[N.end],delete l[M.start],N===M?(N.ring.push(A),p(N.ring)):l[N.start]=d[M.end]={start:N.start,end:M.end,ring:N.ring.concat(M.ring)}):(delete d[N.end],N.ring.push(A),d[N.end=E]=N):(N=l[E])?(M=d[T])?(delete l[N.start],delete d[M.end],N===M?(N.ring.push(A),p(N.ring)):l[M.start]=d[N.end]={start:M.start,end:N.end,ring:M.ring.concat(N.ring)}):(delete l[N.start],N.ring.unshift(v),l[N.start=T]=N):l[T]=d[E]={start:T,end:E,ring:[v,A]}}}function a(f){return f[0]*2+f[1]*(t+1)*4}function c(f,u,p){f.forEach(function(l){var d=l[0],h=l[1],m=d|0,x=h|0,g=G_(u[x*t+m]);d>0&&d<t&&m===d&&(l[0]=KC(d,G_(u[x*t+m-1]),g,p)),h>0&&h<e&&x===h&&(l[1]=KC(h,G_(u[(x-1)*t+m]),g,p))})}return o.contour=i,o.size=function(f){if(!arguments.length)return[t,e];var u=Math.floor(f[0]),p=Math.floor(f[1]);if(!(u>=0&&p>=0))throw new Error("invalid size");return t=u,e=p,o},o.thresholds=function(f){return arguments.length?(n=typeof f=="function"?f:Array.isArray(f)?bo(rg.call(f)):bo(f),o):n},o.smooth=function(f){return arguments.length?(r=f?c:JC,o):r===c},o}function cj(t){return isFinite(t)?t:NaN}function Fa(t,e){return t==null?!1:+t>=e}function G_(t){return t==null||isNaN(t=+t)?-1/0:t}function KC(t,e,n,r){let o=r-e,i=n-e,s=isFinite(o)||isFinite(i)?o/i:Math.sign(o)/Math.sign(i);return isNaN(s)?t:t+s-.5}function fj(t){return t[0]}function uj(t){return t[1]}function lj(){return 1}function H_(){var t=fj,e=uj,n=lj,r=960,o=500,i=20,s=2,a=i*3,c=r+a*2>>s,f=o+a*2>>s,u=bo(20);function p(y){var b=new Float32Array(c*f),w=Math.pow(2,-s),_=-1;for(let O of y){var v=(t(O,++_,y)+a)*w,A=(e(O,_,y)+a)*w,T=+n(O,_,y);if(T&&v>=0&&v<c&&A>=0&&A<f){var E=Math.floor(v),N=Math.floor(A),M=v-E-.5,k=A-N-.5;b[E+N*c]+=(1-M)*(1-k)*T,b[E+1+N*c]+=M*(1-k)*T,b[E+1+(N+1)*c]+=M*k*T,b[E+(N+1)*c]+=(1-M)*k*T}}return ip({data:b,width:c,height:f},i*w),b}function l(y){var b=p(y),w=u(b),_=Math.pow(2,2*s);return Array.isArray(w)||(w=on(Number.MIN_VALUE,kt(b)/_,w)),hs().size([c,f]).thresholds(w.map(v=>v*_))(b).map((v,A)=>(v.value=+w[A],d(v)))}l.contours=function(y){var b=p(y),w=hs().size([c,f]),_=Math.pow(2,2*s),v=A=>{A=+A;var T=d(w.contour(b,A*_));return T.value=A,T};return Object.defineProperty(v,"max",{get:()=>kt(b)/_}),v};function d(y){return y.coordinates.forEach(h),y}function h(y){y.forEach(m)}function m(y){y.forEach(x)}function x(y){y[0]=y[0]*Math.pow(2,s)-a,y[1]=y[1]*Math.pow(2,s)-a}function g(){return a=i*3,c=r+a*2>>s,f=o+a*2>>s,l}return l.x=function(y){return arguments.length?(t=typeof y=="function"?y:bo(+y),l):t},l.y=function(y){return arguments.length?(e=typeof y=="function"?y:bo(+y),l):e},l.weight=function(y){return arguments.length?(n=typeof y=="function"?y:bo(+y),l):n},l.size=function(y){if(!arguments.length)return[r,o];var b=+y[0],w=+y[1];if(!(b>=0&&w>=0))throw new Error("invalid size");return r=b,o=w,g()},l.cellSize=function(y){if(!arguments.length)return 1<<s;if(!((y=+y)>=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(y)/Math.LN2),g()},l.thresholds=function(y){return arguments.length?(u=typeof y=="function"?y:Array.isArray(y)?bo(rg.call(y)):bo(y),l):u},l.bandwidth=function(y){if(!arguments.length)return Math.sqrt(i*(i+1));if(!((y=+y)>=0))throw new Error("invalid bandwidth");return i=(Math.sqrt(4*y*y+1)-1)/2,g()},l}var $t=11102230246251565e-32,Me=134217729,kp=(3+8*$t)*$t;function qa(t,e,n,r,o){let i,s,a,c,f=e[0],u=r[0],p=0,l=0;u>f==u>-f?(i=f,f=e[++p]):(i=u,u=r[++l]);let d=0;if(p<t&&l<n)for(u>f==u>-f?(s=f+i,a=i-(s-f),f=e[++p]):(s=u+i,a=i-(s-u),u=r[++l]),i=s,a!==0&&(o[d++]=a);p<t&&l<n;)u>f==u>-f?(s=i+f,c=s-i,a=i-(s-c)+(f-c),f=e[++p]):(s=i+u,c=s-i,a=i-(s-c)+(u-c),u=r[++l]),i=s,a!==0&&(o[d++]=a);for(;p<t;)s=i+f,c=s-i,a=i-(s-c)+(f-c),f=e[++p],i=s,a!==0&&(o[d++]=a);for(;l<n;)s=i+u,c=s-i,a=i-(s-c)+(u-c),u=r[++l],i=s,a!==0&&(o[d++]=a);return(i!==0||d===0)&&(o[d++]=i),d}function Lp(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function U(t){return new Float64Array(t)}var pj=(3+16*$t)*$t,dj=(2+12*$t)*$t,hj=(9+64*$t)*$t*$t,Sf=U(4),t9=U(8),e9=U(12),n9=U(16),Rn=U(4);function mj(t,e,n,r,o,i,s){let a,c,f,u,p,l,d,h,m,x,g,y,b,w,_,v,A,T,E=t-o,N=n-o,M=e-i,k=r-i;w=E*k,l=Me*E,d=l-(l-E),h=E-d,l=Me*k,m=l-(l-k),x=k-m,_=h*x-(w-d*m-h*m-d*x),v=M*N,l=Me*M,d=l-(l-M),h=M-d,l=Me*N,m=l-(l-N),x=N-m,A=h*x-(v-d*m-h*m-d*x),g=_-A,p=_-g,Sf[0]=_-(g+p)+(p-A),y=w+g,p=y-w,b=w-(y-p)+(g-p),g=b-v,p=b-g,Sf[1]=b-(g+p)+(p-v),T=y+g,p=T-y,Sf[2]=y-(T-p)+(g-p),Sf[3]=T;let O=Lp(4,Sf),S=dj*s;if(O>=S||-O>=S||(p=t-E,a=t-(E+p)+(p-o),p=n-N,f=n-(N+p)+(p-o),p=e-M,c=e-(M+p)+(p-i),p=r-k,u=r-(k+p)+(p-i),a===0&&c===0&&f===0&&u===0)||(S=hj*s+kp*Math.abs(O),O+=E*u+k*a-(M*f+N*c),O>=S||-O>=S))return O;w=a*k,l=Me*a,d=l-(l-a),h=a-d,l=Me*k,m=l-(l-k),x=k-m,_=h*x-(w-d*m-h*m-d*x),v=c*N,l=Me*c,d=l-(l-c),h=c-d,l=Me*N,m=l-(l-N),x=N-m,A=h*x-(v-d*m-h*m-d*x),g=_-A,p=_-g,Rn[0]=_-(g+p)+(p-A),y=w+g,p=y-w,b=w-(y-p)+(g-p),g=b-v,p=b-g,Rn[1]=b-(g+p)+(p-v),T=y+g,p=T-y,Rn[2]=y-(T-p)+(g-p),Rn[3]=T;let I=qa(4,Sf,4,Rn,t9);w=E*u,l=Me*E,d=l-(l-E),h=E-d,l=Me*u,m=l-(l-u),x=u-m,_=h*x-(w-d*m-h*m-d*x),v=M*f,l=Me*M,d=l-(l-M),h=M-d,l=Me*f,m=l-(l-f),x=f-m,A=h*x-(v-d*m-h*m-d*x),g=_-A,p=_-g,Rn[0]=_-(g+p)+(p-A),y=w+g,p=y-w,b=w-(y-p)+(g-p),g=b-v,p=b-g,Rn[1]=b-(g+p)+(p-v),T=y+g,p=T-y,Rn[2]=y-(T-p)+(g-p),Rn[3]=T;let C=qa(I,t9,4,Rn,e9);w=a*u,l=Me*a,d=l-(l-a),h=a-d,l=Me*u,m=l-(l-u),x=u-m,_=h*x-(w-d*m-h*m-d*x),v=c*f,l=Me*c,d=l-(l-c),h=c-d,l=Me*f,m=l-(l-f),x=f-m,A=h*x-(v-d*m-h*m-d*x),g=_-A,p=_-g,Rn[0]=_-(g+p)+(p-A),y=w+g,p=y-w,b=w-(y-p)+(g-p),g=b-v,p=b-g,Rn[1]=b-(g+p)+(p-v),T=y+g,p=T-y,Rn[2]=y-(T-p)+(g-p),Rn[3]=T;let L=qa(C,e9,4,Rn,n9);return n9[L-1]}function Mf(t,e,n,r,o,i){let s=(e-i)*(n-o),a=(t-o)*(r-i),c=s-a,f=Math.abs(s+a);return Math.abs(c)>=pj*f?c:-mj(t,e,n,r,o,i,f)}var l2t=(7+56*$t)*$t,p2t=(3+28*$t)*$t,d2t=(26+288*$t)*$t*$t,h2t=U(4),m2t=U(4),x2t=U(4),g2t=U(4),y2t=U(4),b2t=U(4),w2t=U(4),v2t=U(4),_2t=U(4),S2t=U(8),M2t=U(8),A2t=U(8),T2t=U(4),E2t=U(8),I2t=U(8),N2t=U(8),C2t=U(12),k2t=U(192),L2t=U(192);var $2t=(10+96*$t)*$t,D2t=(4+48*$t)*$t,P2t=(44+576*$t)*$t*$t,F2t=U(4),q2t=U(4),B2t=U(4),z2t=U(4),Y2t=U(4),U2t=U(4),j2t=U(4),X2t=U(4),W2t=U(8),V2t=U(8),G2t=U(8),H2t=U(8),Q2t=U(8),Z2t=U(8),J2t=U(8),K2t=U(8),twt=U(8),ewt=U(4),nwt=U(4),rwt=U(4),owt=U(8),iwt=U(16),swt=U(16),awt=U(16),cwt=U(32),fwt=U(32),uwt=U(48),lwt=U(64),pwt=U(1152),dwt=U(1152);var gwt=(16+224*$t)*$t,ywt=(5+72*$t)*$t,bwt=(71+1408*$t)*$t*$t,wwt=U(4),vwt=U(4),_wt=U(4),Swt=U(4),Mwt=U(4),Awt=U(4),Twt=U(4),Ewt=U(4),Iwt=U(4),Nwt=U(4),Cwt=U(24),kwt=U(24),Lwt=U(24),Rwt=U(24),Owt=U(24),$wt=U(24),Dwt=U(24),Pwt=U(24),Fwt=U(24),qwt=U(24),Bwt=U(1152),zwt=U(1152),Ywt=U(1152),Uwt=U(1152),jwt=U(1152),Xwt=U(2304),Wwt=U(2304),Vwt=U(3456),Gwt=U(5760),Hwt=U(8),Qwt=U(8),Zwt=U(8),Jwt=U(16),Kwt=U(24),tvt=U(48),evt=U(48),nvt=U(96),rvt=U(192),ovt=U(384),ivt=U(384),svt=U(384),avt=U(768);var cvt=U(96),fvt=U(96),uvt=U(96),lvt=U(1152);var o9=Math.pow(2,-52),og=new Uint32Array(512),Tf=class t{static from(e,n=vj,r=_j){let o=e.length,i=new Float64Array(o*2);for(let s=0;s<o;s++){let a=e[s];i[2*s]=n(a),i[2*s+1]=r(a)}return new t(i)}constructor(e){let n=e.length>>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;let r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){let{coords:e,_hullPrev:n,_hullNext:r,_hullTri:o,_hullHash:i}=this,s=e.length>>1,a=1/0,c=1/0,f=-1/0,u=-1/0;for(let E=0;E<s;E++){let N=e[2*E],M=e[2*E+1];N<a&&(a=N),M<c&&(c=M),N>f&&(f=N),M>u&&(u=M),this._ids[E]=E}let p=(a+f)/2,l=(c+u)/2,d,h,m;for(let E=0,N=1/0;E<s;E++){let M=Q_(p,l,e[2*E],e[2*E+1]);M<N&&(d=E,N=M)}let x=e[2*d],g=e[2*d+1];for(let E=0,N=1/0;E<s;E++){if(E===d)continue;let M=Q_(x,g,e[2*E],e[2*E+1]);M<N&&M>0&&(h=E,N=M)}let y=e[2*h],b=e[2*h+1],w=1/0;for(let E=0;E<s;E++){if(E===d||E===h)continue;let N=bj(x,g,y,b,e[2*E],e[2*E+1]);N<w&&(m=E,w=N)}let _=e[2*m],v=e[2*m+1];if(w===1/0){for(let M=0;M<s;M++)this._dists[M]=e[2*M]-e[0]||e[2*M+1]-e[1];Af(this._ids,this._dists,0,s-1);let E=new Uint32Array(s),N=0;for(let M=0,k=-1/0;M<s;M++){let O=this._ids[M],S=this._dists[O];S>k&&(E[N++]=O,k=S)}this.hull=E.subarray(0,N),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Mf(x,g,y,b,_,v)<0){let E=h,N=y,M=b;h=m,y=_,b=v,m=E,_=N,v=M}let A=wj(x,g,y,b,_,v);this._cx=A.x,this._cy=A.y;for(let E=0;E<s;E++)this._dists[E]=Q_(e[2*E],e[2*E+1],A.x,A.y);Af(this._ids,this._dists,0,s-1),this._hullStart=d;let T=3;r[d]=n[m]=h,r[h]=n[d]=m,r[m]=n[h]=d,o[d]=0,o[h]=1,o[m]=2,i.fill(-1),i[this._hashKey(x,g)]=d,i[this._hashKey(y,b)]=h,i[this._hashKey(_,v)]=m,this.trianglesLen=0,this._addTriangle(d,h,m,-1,-1,-1);for(let E=0,N,M;E<this._ids.length;E++){let k=this._ids[E],O=e[2*k],S=e[2*k+1];if(E>0&&Math.abs(O-N)<=o9&&Math.abs(S-M)<=o9||(N=O,M=S,k===d||k===h||k===m))continue;let I=0;for(let P=0,F=this._hashKey(O,S);P<this._hashSize&&(I=i[(F+P)%this._hashSize],!(I!==-1&&I!==r[I]));P++);I=n[I];let C=I,L;for(;L=r[C],Mf(O,S,e[2*C],e[2*C+1],e[2*L],e[2*L+1])>=0;)if(C=L,C===I){C=-1;break}if(C===-1)continue;let D=this._addTriangle(C,k,r[C],-1,-1,o[C]);o[k]=this._legalize(D+2),o[C]=D,T++;let $=r[C];for(;L=r[$],Mf(O,S,e[2*$],e[2*$+1],e[2*L],e[2*L+1])<0;)D=this._addTriangle($,k,L,o[k],-1,o[$]),o[k]=this._legalize(D+2),r[$]=$,T--,$=L;if(C===I)for(;L=n[C],Mf(O,S,e[2*L],e[2*L+1],e[2*C],e[2*C+1])<0;)D=this._addTriangle(L,k,C,-1,o[C],o[L]),this._legalize(D+2),o[L]=D,r[C]=C,T--,C=L;this._hullStart=n[k]=C,r[C]=n[$]=k,r[k]=$,i[this._hashKey(O,S)]=k,i[this._hashKey(e[2*C],e[2*C+1])]=C}this.hull=new Uint32Array(T);for(let E=0,N=this._hullStart;E<T;E++)this.hull[E]=N,N=r[N];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,n){return Math.floor(gj(e-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(e){let{_triangles:n,_halfedges:r,coords:o}=this,i=0,s=0;for(;;){let a=r[e],c=e-e%3;if(s=c+(e+2)%3,a===-1){if(i===0)break;e=og[--i];continue}let f=a-a%3,u=c+(e+1)%3,p=f+(a+2)%3,l=n[s],d=n[e],h=n[u],m=n[p];if(yj(o[2*l],o[2*l+1],o[2*d],o[2*d+1],o[2*h],o[2*h+1],o[2*m],o[2*m+1])){n[e]=m,n[a]=l;let g=r[p];if(g===-1){let b=this._hullStart;do{if(this._hullTri[b]===p){this._hullTri[b]=e;break}b=this._hullPrev[b]}while(b!==this._hullStart)}this._link(e,g),this._link(a,r[s]),this._link(s,p);let y=f+(a+1)%3;i<og.length&&(og[i++]=y)}else{if(i===0)break;e=og[--i]}}return s}_link(e,n){this._halfedges[e]=n,n!==-1&&(this._halfedges[n]=e)}_addTriangle(e,n,r,o,i,s){let a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=n,this._triangles[a+2]=r,this._link(a,o),this._link(a+1,i),this._link(a+2,s),this.trianglesLen+=3,a}};function gj(t,e){let n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}function Q_(t,e,n,r){let o=t-n,i=e-r;return o*o+i*i}function yj(t,e,n,r,o,i,s,a){let c=t-s,f=e-a,u=n-s,p=r-a,l=o-s,d=i-a,h=c*c+f*f,m=u*u+p*p,x=l*l+d*d;return c*(p*x-m*d)-f*(u*x-m*l)+h*(u*d-p*l)<0}function bj(t,e,n,r,o,i){let s=n-t,a=r-e,c=o-t,f=i-e,u=s*s+a*a,p=c*c+f*f,l=.5/(s*f-a*c),d=(f*u-a*p)*l,h=(s*p-c*u)*l;return d*d+h*h}function wj(t,e,n,r,o,i){let s=n-t,a=r-e,c=o-t,f=i-e,u=s*s+a*a,p=c*c+f*f,l=.5/(s*f-a*c),d=t+(f*u-a*p)*l,h=e+(s*p-c*u)*l;return{x:d,y:h}}function Af(t,e,n,r){if(r-n<=20)for(let o=n+1;o<=r;o++){let i=t[o],s=e[i],a=o-1;for(;a>=n&&e[t[a]]>s;)t[a+1]=t[a--];t[a+1]=i}else{let o=n+r>>1,i=n+1,s=r;Rp(t,o,i),e[t[n]]>e[t[r]]&&Rp(t,n,r),e[t[i]]>e[t[r]]&&Rp(t,i,r),e[t[n]]>e[t[i]]&&Rp(t,n,i);let a=t[i],c=e[a];for(;;){do i++;while(e[t[i]]<c);do s--;while(e[t[s]]>c);if(s<i)break;Rp(t,i,s)}t[n+1]=t[s],t[s]=a,r-i+1>=s-n?(Af(t,e,i,r),Af(t,e,n,s-1)):(Af(t,e,n,s-1),Af(t,e,i,r))}}function Rp(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}function vj(t){return t[0]}function _j(t){return t[1]}var Tr=class{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;let o=e+r,i=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${o},${i}`:(Math.abs(this._x1-o)>1e-6||Math.abs(this._y1-i)>1e-6)&&(this._+="L"+o+","+i),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=o},${this._y1=i}`)}rect(e,n,r,o){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+o}h${-r}Z`}value(){return this._||null}};var ms=class{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}};var Op=class{constructor(e,[n,r,o,i]=[0,0,960,500]){if(!((o=+o)>=(n=+n))||!((i=+i)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=o,this.xmin=n,this.ymax=i,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let{delaunay:{points:e,hull:n,triangles:r},vectors:o}=this,i,s,a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let m=0,x=0,g=r.length,y,b;m<g;m+=3,x+=2){let w=r[m]*2,_=r[m+1]*2,v=r[m+2]*2,A=e[w],T=e[w+1],E=e[_],N=e[_+1],M=e[v],k=e[v+1],O=E-A,S=N-T,I=M-A,C=k-T,L=(O*C-S*I)*2;if(Math.abs(L)<1e-9){if(i===void 0){i=s=0;for(let $ of n)i+=e[$*2],s+=e[$*2+1];i/=n.length,s/=n.length}let D=1e9*Math.sign((i-A)*C-(s-T)*I);y=(A+M)/2-D*C,b=(T+k)/2+D*I}else{let D=1/L,$=O*O+S*S,P=I*I+C*C;y=A+(C*$-S*P)*D,b=T+(O*P-I*$)*D}a[x]=y,a[x+1]=b}let c=n[n.length-1],f,u=c*4,p,l=e[2*c],d,h=e[2*c+1];o.fill(0);for(let m=0;m<n.length;++m)c=n[m],f=u,p=l,d=h,u=c*4,l=e[2*c],h=e[2*c+1],o[f+2]=o[u]=d-h,o[f+3]=o[u+1]=l-p}render(e){let n=e==null?e=new Tr:void 0,{delaunay:{halfedges:r,inedges:o,hull:i},circumcenters:s,vectors:a}=this;if(i.length<=1)return null;for(let u=0,p=r.length;u<p;++u){let l=r[u];if(l<u)continue;let d=Math.floor(u/3)*2,h=Math.floor(l/3)*2,m=s[d],x=s[d+1],g=s[h],y=s[h+1];this._renderSegment(m,x,g,y,e)}let c,f=i[i.length-1];for(let u=0;u<i.length;++u){c=f,f=i[u];let p=Math.floor(o[f]/3)*2,l=s[p],d=s[p+1],h=c*4,m=this._project(l,d,a[h+2],a[h+3]);m&&this._renderSegment(l,d,m[0],m[1],e)}return n&&n.value()}renderBounds(e){let n=e==null?e=new Tr:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(e,n){let r=n==null?n=new Tr:void 0,o=this._clip(e);if(o===null||!o.length)return;n.moveTo(o[0],o[1]);let i=o.length;for(;o[0]===o[i-2]&&o[1]===o[i-1]&&i>1;)i-=2;for(let s=2;s<i;s+=2)(o[s]!==o[s-2]||o[s+1]!==o[s-1])&&n.lineTo(o[s],o[s+1]);return n.closePath(),r&&r.value()}*cellPolygons(){let{delaunay:{points:e}}=this;for(let n=0,r=e.length/2;n<r;++n){let o=this.cellPolygon(n);o&&(o.index=n,yield o)}}cellPolygon(e){let n=new ms;return this.renderCell(e,n),n.value()}_renderSegment(e,n,r,o,i){let s,a=this._regioncode(e,n),c=this._regioncode(r,o);a===0&&c===0?(i.moveTo(e,n),i.lineTo(r,o)):(s=this._clipSegment(e,n,r,o,a,c))&&(i.moveTo(s[0],s[1]),i.lineTo(s[2],s[3]))}contains(e,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(e,n,r)===e}*neighbors(e){let n=this._clip(e);if(n)for(let r of this.delaunay.neighbors(e)){let o=this._clip(r);if(o){t:for(let i=0,s=n.length;i<s;i+=2)for(let a=0,c=o.length;a<c;a+=2)if(n[i]===o[a]&&n[i+1]===o[a+1]&&n[(i+2)%s]===o[(a+c-2)%c]&&n[(i+3)%s]===o[(a+c-1)%c]){yield r;break t}}}}_cell(e){let{circumcenters:n,delaunay:{inedges:r,halfedges:o,triangles:i}}=this,s=r[e];if(s===-1)return null;let a=[],c=s;do{let f=Math.floor(c/3);if(a.push(n[f*2],n[f*2+1]),c=c%3===2?c-2:c+1,i[c]!==e)break;c=o[c]}while(c!==s&&c!==-1);return a}_clip(e){if(e===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];let n=this._cell(e);if(n===null)return null;let{vectors:r}=this,o=e*4;return this._simplify(r[o]||r[o+1]?this._clipInfinite(e,n,r[o],r[o+1],r[o+2],r[o+3]):this._clipFinite(e,n))}_clipFinite(e,n){let r=n.length,o=null,i,s,a=n[r-2],c=n[r-1],f,u=this._regioncode(a,c),p,l=0;for(let d=0;d<r;d+=2)if(i=a,s=c,a=n[d],c=n[d+1],f=u,u=this._regioncode(a,c),f===0&&u===0)p=l,l=0,o?o.push(a,c):o=[a,c];else{let h,m,x,g,y;if(f===0){if((h=this._clipSegment(i,s,a,c,f,u))===null)continue;[m,x,g,y]=h}else{if((h=this._clipSegment(a,c,i,s,u,f))===null)continue;[g,y,m,x]=h,p=l,l=this._edgecode(m,x),p&&l&&this._edge(e,p,l,o,o.length),o?o.push(m,x):o=[m,x]}p=l,l=this._edgecode(g,y),p&&l&&this._edge(e,p,l,o,o.length),o?o.push(g,y):o=[g,y]}if(o)p=l,l=this._edgecode(o[0],o[1]),p&&l&&this._edge(e,p,l,o,o.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return o}_clipSegment(e,n,r,o,i,s){let a=i<s;for(a&&([e,n,r,o,i,s]=[r,o,e,n,s,i]);;){if(i===0&&s===0)return a?[r,o,e,n]:[e,n,r,o];if(i&s)return null;let c,f,u=i||s;u&8?(c=e+(r-e)*(this.ymax-n)/(o-n),f=this.ymax):u&4?(c=e+(r-e)*(this.ymin-n)/(o-n),f=this.ymin):u&2?(f=n+(o-n)*(this.xmax-e)/(r-e),c=this.xmax):(f=n+(o-n)*(this.xmin-e)/(r-e),c=this.xmin),i?(e=c,n=f,i=this._regioncode(e,n)):(r=c,o=f,s=this._regioncode(r,o))}}_clipInfinite(e,n,r,o,i,s){let a=Array.from(n),c;if((c=this._project(a[0],a[1],r,o))&&a.unshift(c[0],c[1]),(c=this._project(a[a.length-2],a[a.length-1],i,s))&&a.push(c[0],c[1]),a=this._clipFinite(e,a))for(let f=0,u=a.length,p,l=this._edgecode(a[u-2],a[u-1]);f<u;f+=2)p=l,l=this._edgecode(a[f],a[f+1]),p&&l&&(f=this._edge(e,p,l,a,f),u=a.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(e,n,r,o,i){for(;n!==r;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(o[i]!==s||o[i+1]!==a)&&this.contains(e,s,a)&&(o.splice(i,0,s,a),i+=2)}return i}_project(e,n,r,o){let i=1/0,s,a,c;if(o<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/o)<i&&(c=this.ymin,a=e+(i=s)*r)}else if(o>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/o)<i&&(c=this.ymax,a=e+(i=s)*r)}if(r>0){if(e>=this.xmax)return null;(s=(this.xmax-e)/r)<i&&(a=this.xmax,c=n+(i=s)*o)}else if(r<0){if(e<=this.xmin)return null;(s=(this.xmin-e)/r)<i&&(a=this.xmin,c=n+(i=s)*o)}return[a,c]}_edgecode(e,n){return(e===this.xmin?1:e===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(e,n){return(e<this.xmin?1:e>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n<e.length;n+=2){let r=(n+2)%e.length,o=(n+4)%e.length;(e[n]===e[r]&&e[r]===e[o]||e[n+1]===e[r+1]&&e[r+1]===e[o+1])&&(e.splice(r,2),n-=2)}e.length||(e=null)}return e}};var Sj=2*Math.PI,Ef=Math.pow;function Mj(t){return t[0]}function Aj(t){return t[1]}function Tj(t){let{triangles:e,coords:n}=t;for(let r=0;r<e.length;r+=3){let o=2*e[r],i=2*e[r+1],s=2*e[r+2];if((n[s]-n[o])*(n[i+1]-n[o+1])-(n[i]-n[o])*(n[s+1]-n[o+1])>1e-10)return!1}return!0}function Ej(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}var Er=class t{static from(e,n=Mj,r=Aj,o){return new t("length"in e?Ij(e,n,r,o):Float64Array.from(Nj(e,n,r,o)))}constructor(e){this._delaunator=new Tf(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){let e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&Tj(e)){this.collinear=Int32Array.from({length:n.length/2},(l,d)=>d).sort((l,d)=>n[2*l]-n[2*d]||n[2*l+1]-n[2*d+1]);let c=this.collinear[0],f=this.collinear[this.collinear.length-1],u=[n[2*c],n[2*c+1],n[2*f],n[2*f+1]],p=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let l=0,d=n.length/2;l<d;++l){let h=Ej(n[2*l],n[2*l+1],p);n[2*l]=h[0],n[2*l+1]=h[1]}this._delaunator=new Tf(n)}else delete this.collinear;let r=this.halfedges=this._delaunator.halfedges,o=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let c=0,f=r.length;c<f;++c){let u=i[c%3===2?c-2:c+1];(r[c]===-1||s[u]===-1)&&(s[u]=c)}for(let c=0,f=o.length;c<f;++c)a[o[c]]=c;o.length<=2&&o.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=o[0],s[o[0]]=1,o.length===2&&(s[o[1]]=0,this.triangles[1]=o[1],this.triangles[2]=o[1]))}voronoi(e){return new Op(this,e)}*neighbors(e){let{inedges:n,hull:r,_hullIndex:o,halfedges:i,triangles:s,collinear:a}=this;if(a){let p=a.indexOf(e);p>0&&(yield a[p-1]),p<a.length-1&&(yield a[p+1]);return}let c=n[e];if(c===-1)return;let f=c,u=-1;do{if(yield u=s[f],f=f%3===2?f-2:f+1,s[f]!==e)return;if(f=i[f],f===-1){let p=r[(o[e]+1)%r.length];p!==u&&(yield p);return}}while(f!==c)}find(e,n,r=0){if(e=+e,e!==e||(n=+n,n!==n))return-1;let o=r,i;for(;(i=this._step(r,e,n))>=0&&i!==r&&i!==o;)r=i;return i}_step(e,n,r){let{inedges:o,hull:i,_hullIndex:s,halfedges:a,triangles:c,points:f}=this;if(o[e]===-1||!f.length)return(e+1)%(f.length>>1);let u=e,p=Ef(n-f[e*2],2)+Ef(r-f[e*2+1],2),l=o[e],d=l;do{let h=c[d],m=Ef(n-f[h*2],2)+Ef(r-f[h*2+1],2);if(m<p&&(p=m,u=h),d=d%3===2?d-2:d+1,c[d]!==e)break;if(d=a[d],d===-1){if(d=i[(s[e]+1)%i.length],d!==h&&Ef(n-f[d*2],2)+Ef(r-f[d*2+1],2)<p)return d;break}}while(d!==l);return u}render(e){let n=e==null?e=new Tr:void 0,{points:r,halfedges:o,triangles:i}=this;for(let s=0,a=o.length;s<a;++s){let c=o[s];if(c<s)continue;let f=i[s]*2,u=i[c]*2;e.moveTo(r[f],r[f+1]),e.lineTo(r[u],r[u+1])}return this.renderHull(e),n&&n.value()}renderPoints(e,n){n===void 0&&(!e||typeof e.moveTo!="function")&&(n=e,e=null),n=n==null?2:+n;let r=e==null?e=new Tr:void 0,{points:o}=this;for(let i=0,s=o.length;i<s;i+=2){let a=o[i],c=o[i+1];e.moveTo(a+n,c),e.arc(a,c,n,0,Sj)}return r&&r.value()}renderHull(e){let n=e==null?e=new Tr:void 0,{hull:r,points:o}=this,i=r[0]*2,s=r.length;e.moveTo(o[i],o[i+1]);for(let a=1;a<s;++a){let c=2*r[a];e.lineTo(o[c],o[c+1])}return e.closePath(),n&&n.value()}hullPolygon(){let e=new ms;return this.renderHull(e),e.value()}renderTriangle(e,n){let r=n==null?n=new Tr:void 0,{points:o,triangles:i}=this,s=i[e*=3]*2,a=i[e+1]*2,c=i[e+2]*2;return n.moveTo(o[s],o[s+1]),n.lineTo(o[a],o[a+1]),n.lineTo(o[c],o[c+1]),n.closePath(),r&&r.value()}*trianglePolygons(){let{triangles:e}=this;for(let n=0,r=e.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(e){let n=new ms;return this.renderTriangle(e,n),n.value()}};function Ij(t,e,n,r){let o=t.length,i=new Float64Array(o*2);for(let s=0;s<o;++s){let a=t[s];i[s*2]=e.call(r,a,s,t),i[s*2+1]=n.call(r,a,s,t)}return i}function*Nj(t,e,n,r){let o=0;for(let i of t)yield e.call(r,i,o,t),yield n.call(r,i,o,t),++o}function i9(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Ba(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function wo(t){return t=Ba(Math.abs(t)),t?t[1]:NaN}function s9(t,e){return function(n,r){for(var o=n.length,i=[],s=0,a=t[0],c=0;o>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),i.push(n.substring(o-=a,o+a)),!((c+=a+1)>r));)a=t[s=(s+1)%t.length];return i.reverse().join(e)}}function a9(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Cj=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vo(t){if(!(e=Cj.exec(t)))throw new Error("invalid format: "+t);var e;return new ig({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}vo.prototype=ig.prototype;function ig(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}ig.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 c9(t){t:for(var e=t.length,n=1,r=-1,o;n<e;++n)switch(t[n]){case".":r=o=n;break;case"0":r===0&&(r=n),o=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(o+1):t}var Z_;function f9(t,e){var n=Ba(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(Z_=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,s=r.length;return i===s?r:i>s?r+new Array(i-s+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Ba(t,Math.max(0,e+i-1))[0]}function J_(t,e){var n=Ba(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}var K_={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:i9,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>J_(t*100,e),r:J_,s:f9,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function t6(t){return t}var u9=Array.prototype.map,l9=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function p9(t){var e=t.grouping===void 0||t.thousands===void 0?t6:s9(u9.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",o=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?t6:a9(u9.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"\u2212":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function f(p){p=vo(p);var l=p.fill,d=p.align,h=p.sign,m=p.symbol,x=p.zero,g=p.width,y=p.comma,b=p.precision,w=p.trim,_=p.type;_==="n"?(y=!0,_="g"):K_[_]||(b===void 0&&(b=12),w=!0,_="g"),(x||l==="0"&&d==="=")&&(x=!0,l="0",d="=");var v=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",A=m==="$"?r:/[%p]/.test(_)?s:"",T=K_[_],E=/[defgprs%]/.test(_);b=b===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function N(M){var k=v,O=A,S,I,C;if(_==="c")O=T(M)+O,M="";else{M=+M;var L=M<0||1/M<0;if(M=isNaN(M)?c:T(Math.abs(M),b),w&&(M=c9(M)),L&&+M==0&&h!=="+"&&(L=!1),k=(L?h==="("?h:a:h==="-"||h==="("?"":h)+k,O=(_==="s"?l9[8+Z_/3]:"")+O+(L&&h==="("?")":""),E){for(S=-1,I=M.length;++S<I;)if(C=M.charCodeAt(S),48>C||C>57){O=(C===46?o+M.slice(S+1):M.slice(S))+O,M=M.slice(0,S);break}}}y&&!x&&(M=e(M,1/0));var D=k.length+M.length+O.length,$=D<g?new Array(g-D+1).join(l):"";switch(y&&x&&(M=e($+M,$.length?g-O.length:1/0),$=""),d){case"<":M=k+M+O+$;break;case"=":M=k+$+M+O;break;case"^":M=$.slice(0,D=$.length>>1)+k+M+O+$.slice(D);break;default:M=$+k+M+O;break}return i(M)}return N.toString=function(){return p+""},N}function u(p,l){var d=f((p=vo(p),p.type="f",p)),h=Math.max(-8,Math.min(8,Math.floor(wo(l)/3)))*3,m=Math.pow(10,-h),x=l9[8+h/3];return function(g){return d(m*g)+x}}return{format:f,formatPrefix:u}}var sg,Ir,ag;e6({thousands:",",grouping:[3],currency:["$",""]});function e6(t){return sg=p9(t),Ir=sg.format,ag=sg.formatPrefix,sg}function n6(t){return Math.max(0,-wo(Math.abs(t)))}function r6(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(wo(e)/3)))*3-wo(Math.abs(t)))}function o6(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,wo(e)-wo(t))+1}var J=1e-6,za=1e-12,bt=Math.PI,Ht=bt/2,i6=bt/4,Ye=bt*2,he=180/bt,At=bt/180,St=Math.abs,Nr=Math.atan,Ae=Math.atan2,Q=Math.cos,$p=Math.ceil,cg=Math.exp;var fg=Math.hypot,Ya=Math.log,ug=Math.pow,H=Math.sin,yn=Math.sign||function(t){return t>0?1:t<0?-1:0},Qt=Math.sqrt,If=Math.tan;function lg(t){return t>1?0:t<-1?bt:Math.acos(t)}function ne(t){return t>1?Ht:t<-1?-Ht:Math.asin(t)}function Te(){}function pg(t,e){t&&h9.hasOwnProperty(t.type)&&h9[t.type](t,e)}var d9={Feature:function(t,e){pg(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,o=n.length;++r<o;)pg(n[r].geometry,e)}},h9={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){s6(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)s6(n[r],e,0)},Polygon:function(t,e){m9(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)m9(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,o=n.length;++r<o;)pg(n[r],e)}};function s6(t,e,n){var r=-1,o=t.length-n,i;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function m9(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)s6(t[n],e,1);e.polygonEnd()}function or(t,e){t&&d9.hasOwnProperty(t.type)?d9[t.type](t,e):pg(t,e)}function Dp(t){return[Ae(t[1],t[0]),ne(t[2])]}function _o(t){var e=t[0],n=t[1],r=Q(n);return[r*Q(e),r*H(e),H(n)]}function Pp(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Nf(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function dg(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Fp(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function qp(t){var e=Qt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Bp,hg,mg,xg,gg,yg,bg,wg,a6,c6,f6,y9,b9,On,$n,Dn,Hr={sphere:Te,point:u6,lineStart:x9,lineEnd:g9,polygonStart:function(){Hr.lineStart=Rj,Hr.lineEnd=Oj},polygonEnd:function(){Hr.lineStart=x9,Hr.lineEnd=g9}};function u6(t,e){t*=At,e*=At;var n=Q(e);zp(n*Q(t),n*H(t),H(e))}function zp(t,e,n){++Bp,mg+=(t-mg)/Bp,xg+=(e-xg)/Bp,gg+=(n-gg)/Bp}function x9(){Hr.point=kj}function kj(t,e){t*=At,e*=At;var n=Q(e);On=n*Q(t),$n=n*H(t),Dn=H(e),Hr.point=Lj,zp(On,$n,Dn)}function Lj(t,e){t*=At,e*=At;var n=Q(e),r=n*Q(t),o=n*H(t),i=H(e),s=Ae(Qt((s=$n*i-Dn*o)*s+(s=Dn*r-On*i)*s+(s=On*o-$n*r)*s),On*r+$n*o+Dn*i);hg+=s,yg+=s*(On+(On=r)),bg+=s*($n+($n=o)),wg+=s*(Dn+(Dn=i)),zp(On,$n,Dn)}function g9(){Hr.point=u6}function Rj(){Hr.point=$j}function Oj(){w9(y9,b9),Hr.point=u6}function $j(t,e){y9=t,b9=e,t*=At,e*=At,Hr.point=w9;var n=Q(e);On=n*Q(t),$n=n*H(t),Dn=H(e),zp(On,$n,Dn)}function w9(t,e){t*=At,e*=At;var n=Q(e),r=n*Q(t),o=n*H(t),i=H(e),s=$n*i-Dn*o,a=Dn*r-On*i,c=On*o-$n*r,f=fg(s,a,c),u=ne(f),p=f&&-u/f;a6.add(p*s),c6.add(p*a),f6.add(p*c),hg+=u,yg+=u*(On+(On=r)),bg+=u*($n+($n=o)),wg+=u*(Dn+(Dn=i)),zp(On,$n,Dn)}function l6(t){Bp=hg=mg=xg=gg=yg=bg=wg=0,a6=new nn,c6=new nn,f6=new nn,or(t,Hr);var e=+a6,n=+c6,r=+f6,o=fg(e,n,r);return o<za&&(e=yg,n=bg,r=wg,hg<J&&(e=mg,n=xg,r=gg),o=fg(e,n,r),o<za)?[NaN,NaN]:[Ae(n,e)*he,ne(r/o)*he]}function Yp(t,e){function n(r,o){return r=t(r,o),e(r[0],r[1])}return t.invert&&e.invert&&(n.invert=function(r,o){return r=e.invert(r,o),r&&t.invert(r[0],r[1])}),n}function p6(t,e){return St(t)>bt&&(t-=Math.round(t/Ye)*Ye),[t,e]}p6.invert=p6;function d6(t,e,n){return(t%=Ye)?e||n?Yp(_9(t),S9(e,n)):_9(t):e||n?S9(e,n):p6}function v9(t){return function(e,n){return e+=t,St(e)>bt&&(e-=Math.round(e/Ye)*Ye),[e,n]}}function _9(t){var e=v9(t);return e.invert=v9(-t),e}function S9(t,e){var n=Q(t),r=H(t),o=Q(e),i=H(e);function s(a,c){var f=Q(c),u=Q(a)*f,p=H(a)*f,l=H(c),d=l*n+u*r;return[Ae(p*o-d*i,u*n-l*r),ne(d*o+p*i)]}return s.invert=function(a,c){var f=Q(c),u=Q(a)*f,p=H(a)*f,l=H(c),d=l*o-p*i;return[Ae(p*o+l*i,u*n+d*r),ne(d*n-u*r)]},s}function M9(t){t=d6(t[0]*At,t[1]*At,t.length>2?t[2]*At:0);function e(n){return n=t(n[0]*At,n[1]*At),n[0]*=he,n[1]*=he,n}return e.invert=function(n){return n=t.invert(n[0]*At,n[1]*At),n[0]*=he,n[1]*=he,n},e}function T9(t,e,n,r,o,i){if(n){var s=Q(e),a=H(e),c=r*n;o==null?(o=e+r*Ye,i=e-c/2):(o=A9(s,o),i=A9(s,i),(r>0?o<i:o>i)&&(o+=r*Ye));for(var f,u=o;r>0?u>i:u<i;u-=c)f=Dp([s,-a*Q(u),-a*H(u)]),t.point(f[0],f[1])}}function A9(t,e){e=_o(e),e[0]-=t,qp(e);var n=lg(-e[1]);return((-e[2]<0?-n:n)+Ye-J)%Ye}function vg(){var t=[],e;return{point:function(n,r,o){e.push([n,r,o])},lineStart:function(){t.push(e=[])},lineEnd:Te,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Cf(t,e){return St(t[0]-e[0])<J&&St(t[1]-e[1])<J}function _g(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Sg(t,e,n,r,o){var i=[],s=[],a,c;if(t.forEach(function(h){if(!((m=h.length-1)<=0)){var m,x=h[0],g=h[m],y;if(Cf(x,g)){if(!x[2]&&!g[2]){for(o.lineStart(),a=0;a<m;++a)o.point((x=h[a])[0],x[1]);o.lineEnd();return}g[0]+=2*J}i.push(y=new _g(x,h,null,!0)),s.push(y.o=new _g(x,null,y,!1)),i.push(y=new _g(g,h,null,!1)),s.push(y.o=new _g(g,null,y,!0))}}),!!i.length){for(s.sort(e),E9(i),E9(s),a=0,c=s.length;a<c;++a)s[a].e=n=!n;for(var f=i[0],u,p;;){for(var l=f,d=!0;l.v;)if((l=l.n)===f)return;u=l.z,o.lineStart();do{if(l.v=l.o.v=!0,l.e){if(d)for(a=0,c=u.length;a<c;++a)o.point((p=u[a])[0],p[1]);else r(l.x,l.n.x,1,o);l=l.n}else{if(d)for(u=l.p.z,a=u.length-1;a>=0;--a)o.point((p=u[a])[0],p[1]);else r(l.x,l.p.x,-1,o);l=l.p}l=l.o,u=l.z,d=!d}while(!l.v);o.lineEnd()}}}function E9(t){if(e=t.length){for(var e,n=0,r=t[0],o;++n<e;)r.n=o=t[n],o.p=r,r=o;r.n=o=t[0],o.p=r}}function h6(t){return St(t[0])<=bt?t[0]:yn(t[0])*((St(t[0])+bt)%Ye-bt)}function I9(t,e){var n=h6(e),r=e[1],o=H(r),i=[H(n),-Q(n),0],s=0,a=0,c=new nn;o===1?r=Ht+J:o===-1&&(r=-Ht-J);for(var f=0,u=t.length;f<u;++f)if(l=(p=t[f]).length)for(var p,l,d=p[l-1],h=h6(d),m=d[1]/2+i6,x=H(m),g=Q(m),y=0;y<l;++y,h=w,x=v,g=A,d=b){var b=p[y],w=h6(b),_=b[1]/2+i6,v=H(_),A=Q(_),T=w-h,E=T>=0?1:-1,N=E*T,M=N>bt,k=x*v;if(c.add(Ae(k*E*H(N),g*A+k*Q(N))),s+=M?T+E*Ye:T,M^h>=n^w>=n){var O=Nf(_o(d),_o(b));qp(O);var S=Nf(i,O);qp(S);var I=(M^T>=0?-1:1)*ne(S[2]);(r>I||r===I&&(O[0]||O[1]))&&(a+=M^T>=0?1:-1)}}return(s<-J||s<J&&c<-za)^a&1}function Mg(t,e,n,r){return function(o){var i=e(o),s=vg(),a=e(s),c=!1,f,u,p,l={point:d,lineStart:m,lineEnd:x,polygonStart:function(){l.point=g,l.lineStart=y,l.lineEnd=b,u=[],f=[]},polygonEnd:function(){l.point=d,l.lineStart=m,l.lineEnd=x,u=lf(u);var w=I9(f,r);u.length?(c||(o.polygonStart(),c=!0),Sg(u,Pj,w,n,o)):w&&(c||(o.polygonStart(),c=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),c&&(o.polygonEnd(),c=!1),u=f=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function d(w,_){t(w,_)&&o.point(w,_)}function h(w,_){i.point(w,_)}function m(){l.point=h,i.lineStart()}function x(){l.point=d,i.lineEnd()}function g(w,_){p.push([w,_]),a.point(w,_)}function y(){a.lineStart(),p=[]}function b(){g(p[0][0],p[0][1]),a.lineEnd();var w=a.clean(),_=s.result(),v,A=_.length,T,E,N;if(p.pop(),f.push(p),p=null,!!A){if(w&1){if(E=_[0],(T=E.length-1)>0){for(c||(o.polygonStart(),c=!0),o.lineStart(),v=0;v<T;++v)o.point((N=E[v])[0],N[1]);o.lineEnd()}return}A>1&&w&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(Dj))}}return l}}function Dj(t){return t.length>1}function Pj(t,e){return((t=t.x)[0]<0?t[1]-Ht-J:Ht-t[1])-((e=e.x)[0]<0?e[1]-Ht-J:Ht-e[1])}var m6=Mg(function(){return!0},Fj,Bj,[-bt,-Ht]);function Fj(t){var e=NaN,n=NaN,r=NaN,o;return{lineStart:function(){t.lineStart(),o=1},point:function(i,s){var a=i>0?bt:-bt,c=St(i-e);St(c-bt)<J?(t.point(e,n=(n+s)/2>0?Ht:-Ht),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),t.point(i,n),o=0):r!==a&&c>=bt&&(St(e-r)<J&&(e-=r*J),St(i-a)<J&&(i-=a*J),n=qj(e,n,i,s),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),o=0),t.point(e=i,n=s),r=a},lineEnd:function(){t.lineEnd(),e=n=NaN},clean:function(){return 2-o}}}function qj(t,e,n,r){var o,i,s=H(t-n);return St(s)>J?Nr((H(e)*(i=Q(r))*H(n)-H(r)*(o=Q(e))*H(t))/(o*i*s)):(e+r)/2}function Bj(t,e,n,r){var o;if(t==null)o=n*Ht,r.point(-bt,o),r.point(0,o),r.point(bt,o),r.point(bt,0),r.point(bt,-o),r.point(0,-o),r.point(-bt,-o),r.point(-bt,0),r.point(-bt,o);else if(St(t[0]-e[0])>J){var i=t[0]<e[0]?bt:-bt;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(e[0],e[1])}function N9(t){var e=Q(t),n=2*At,r=e>0,o=St(e)>J;function i(u,p,l,d){T9(d,t,n,l,u,p)}function s(u,p){return Q(u)*Q(p)>e}function a(u){var p,l,d,h,m;return{lineStart:function(){h=d=!1,m=1},point:function(x,g){var y=[x,g],b,w=s(x,g),_=r?w?0:f(x,g):w?f(x+(x<0?bt:-bt),g):0;if(!p&&(h=d=w)&&u.lineStart(),w!==d&&(b=c(p,y),(!b||Cf(p,b)||Cf(y,b))&&(y[2]=1)),w!==d)m=0,w?(u.lineStart(),b=c(y,p),u.point(b[0],b[1])):(b=c(p,y),u.point(b[0],b[1],2),u.lineEnd()),p=b;else if(o&&p&&r^w){var v;!(_&l)&&(v=c(y,p,!0))&&(m=0,r?(u.lineStart(),u.point(v[0][0],v[0][1]),u.point(v[1][0],v[1][1]),u.lineEnd()):(u.point(v[1][0],v[1][1]),u.lineEnd(),u.lineStart(),u.point(v[0][0],v[0][1],3)))}w&&(!p||!Cf(p,y))&&u.point(y[0],y[1]),p=y,d=w,l=_},lineEnd:function(){d&&u.lineEnd(),p=null},clean:function(){return m|(h&&d)<<1}}}function c(u,p,l){var d=_o(u),h=_o(p),m=[1,0,0],x=Nf(d,h),g=Pp(x,x),y=x[0],b=g-y*y;if(!b)return!l&&u;var w=e*g/b,_=-e*y/b,v=Nf(m,x),A=Fp(m,w),T=Fp(x,_);dg(A,T);var E=v,N=Pp(A,E),M=Pp(E,E),k=N*N-M*(Pp(A,A)-1);if(!(k<0)){var O=Qt(k),S=Fp(E,(-N-O)/M);if(dg(S,A),S=Dp(S),!l)return S;var I=u[0],C=p[0],L=u[1],D=p[1],$;C<I&&($=I,I=C,C=$);var P=C-I,F=St(P-bt)<J,q=F||P<J;if(!F&&D<L&&($=L,L=D,D=$),q?F?L+D>0^S[1]<(St(S[0]-I)<J?L:D):L<=S[1]&&S[1]<=D:P>bt^(I<=S[0]&&S[0]<=C)){var V=Fp(E,(-N+O)/M);return dg(V,A),[S,Dp(V)]}}}function f(u,p){var l=r?t:bt-t,d=0;return u<-l?d|=1:u>l&&(d|=2),p<-l?d|=4:p>l&&(d|=8),d}return Mg(s,a,i,r?[0,-t]:[-bt,t-bt])}function C9(t,e,n,r,o,i){var s=t[0],a=t[1],c=e[0],f=e[1],u=0,p=1,l=c-s,d=f-a,h;if(h=n-s,!(!l&&h>0)){if(h/=l,l<0){if(h<u)return;h<p&&(p=h)}else if(l>0){if(h>p)return;h>u&&(u=h)}if(h=o-s,!(!l&&h<0)){if(h/=l,l<0){if(h>p)return;h>u&&(u=h)}else if(l>0){if(h<u)return;h<p&&(p=h)}if(h=r-a,!(!d&&h>0)){if(h/=d,d<0){if(h<u)return;h<p&&(p=h)}else if(d>0){if(h>p)return;h>u&&(u=h)}if(h=i-a,!(!d&&h<0)){if(h/=d,d<0){if(h>p)return;h>u&&(u=h)}else if(d>0){if(h<u)return;h<p&&(p=h)}return u>0&&(t[0]=s+u*l,t[1]=a+u*d),p<1&&(e[0]=s+p*l,e[1]=a+p*d),!0}}}}}var Up=1e9,Ag=-Up;function kf(t,e,n,r){function o(f,u){return t<=f&&f<=n&&e<=u&&u<=r}function i(f,u,p,l){var d=0,h=0;if(f==null||(d=s(f,p))!==(h=s(u,p))||c(f,u)<0^p>0)do l.point(d===0||d===3?t:n,d>1?r:e);while((d=(d+p+4)%4)!==h);else l.point(u[0],u[1])}function s(f,u){return St(f[0]-t)<J?u>0?0:3:St(f[0]-n)<J?u>0?2:1:St(f[1]-e)<J?u>0?1:0:u>0?3:2}function a(f,u){return c(f.x,u.x)}function c(f,u){var p=s(f,1),l=s(u,1);return p!==l?p-l:p===0?u[1]-f[1]:p===1?f[0]-u[0]:p===2?f[1]-u[1]:u[0]-f[0]}return function(f){var u=f,p=vg(),l,d,h,m,x,g,y,b,w,_,v,A={point:T,lineStart:k,lineEnd:O,polygonStart:N,polygonEnd:M};function T(I,C){o(I,C)&&u.point(I,C)}function E(){for(var I=0,C=0,L=d.length;C<L;++C)for(var D=d[C],$=1,P=D.length,F=D[0],q,V,K=F[0],et=F[1];$<P;++$)q=K,V=et,F=D[$],K=F[0],et=F[1],V<=r?et>r&&(K-q)*(r-V)>(et-V)*(t-q)&&++I:et<=r&&(K-q)*(r-V)<(et-V)*(t-q)&&--I;return I}function N(){u=p,l=[],d=[],v=!0}function M(){var I=E(),C=v&&I,L=(l=lf(l)).length;(C||L)&&(f.polygonStart(),C&&(f.lineStart(),i(null,null,1,f),f.lineEnd()),L&&Sg(l,a,I,i,f),f.polygonEnd()),u=f,l=d=h=null}function k(){A.point=S,d&&d.push(h=[]),_=!0,w=!1,y=b=NaN}function O(){l&&(S(m,x),g&&w&&p.rejoin(),l.push(p.result())),A.point=T,w&&u.lineEnd()}function S(I,C){var L=o(I,C);if(d&&h.push([I,C]),_)m=I,x=C,g=L,_=!1,L&&(u.lineStart(),u.point(I,C));else if(L&&w)u.point(I,C);else{var D=[y=Math.max(Ag,Math.min(Up,y)),b=Math.max(Ag,Math.min(Up,b))],$=[I=Math.max(Ag,Math.min(Up,I)),C=Math.max(Ag,Math.min(Up,C))];C9(D,$,t,e,n,r)?(w||(u.lineStart(),u.point(D[0],D[1])),u.point($[0],$[1]),L||u.lineEnd(),v=!1):L&&(u.lineStart(),u.point(I,C),v=!1)}y=I,b=C,w=L}return A}}function k9(t,e,n){var r=ye(t,e-J,n).concat(e);return function(o){return r.map(function(i){return[o,i]})}}function L9(t,e,n){var r=ye(t,e-J,n).concat(e);return function(o){return r.map(function(i){return[i,o]})}}function x6(){var t,e,n,r,o,i,s,a,c=10,f=c,u=90,p=360,l,d,h,m,x=2.5;function g(){return{type:"MultiLineString",coordinates:y()}}function y(){return ye($p(r/u)*u,n,u).map(h).concat(ye($p(a/p)*p,s,p).map(m)).concat(ye($p(e/c)*c,t,c).filter(function(b){return St(b%u)>J}).map(l)).concat(ye($p(i/f)*f,o,f).filter(function(b){return St(b%p)>J}).map(d))}return g.lines=function(){return y().map(function(b){return{type:"LineString",coordinates:b}})},g.outline=function(){return{type:"Polygon",coordinates:[h(r).concat(m(s).slice(1),h(n).reverse().slice(1),m(a).reverse().slice(1))]}},g.extent=function(b){return arguments.length?g.extentMajor(b).extentMinor(b):g.extentMinor()},g.extentMajor=function(b){return arguments.length?(r=+b[0][0],n=+b[1][0],a=+b[0][1],s=+b[1][1],r>n&&(b=r,r=n,n=b),a>s&&(b=a,a=s,s=b),g.precision(x)):[[r,a],[n,s]]},g.extentMinor=function(b){return arguments.length?(e=+b[0][0],t=+b[1][0],i=+b[0][1],o=+b[1][1],e>t&&(b=e,e=t,t=b),i>o&&(b=i,i=o,o=b),g.precision(x)):[[e,i],[t,o]]},g.step=function(b){return arguments.length?g.stepMajor(b).stepMinor(b):g.stepMinor()},g.stepMajor=function(b){return arguments.length?(u=+b[0],p=+b[1],g):[u,p]},g.stepMinor=function(b){return arguments.length?(c=+b[0],f=+b[1],g):[c,f]},g.precision=function(b){return arguments.length?(x=+b,l=k9(i,o,90),d=L9(e,t,x),h=k9(a,s,90),m=L9(r,n,x),g):x},g.extentMajor([[-180,-90+J],[180,90-J]]).extentMinor([[-180,-80-J],[180,80+J]])}function g6(){return x6()()}var jp=t=>t;var y6=new nn,b6=new nn,R9,O9,w6,v6,xs={point:Te,lineStart:Te,lineEnd:Te,polygonStart:function(){xs.lineStart=zj,xs.lineEnd=Uj},polygonEnd:function(){xs.lineStart=xs.lineEnd=xs.point=Te,y6.add(St(b6)),b6=new nn},result:function(){var t=y6/2;return y6=new nn,t}};function zj(){xs.point=Yj}function Yj(t,e){xs.point=$9,R9=w6=t,O9=v6=e}function $9(t,e){b6.add(v6*t-w6*e),w6=t,v6=e}function Uj(){$9(R9,O9)}var _6=xs;var Lf=1/0,Tg=Lf,Xp=-Lf,Eg=Xp,jj={point:Xj,lineStart:Te,lineEnd:Te,polygonStart:Te,polygonEnd:Te,result:function(){var t=[[Lf,Tg],[Xp,Eg]];return Xp=Eg=-(Tg=Lf=1/0),t}};function Xj(t,e){t<Lf&&(Lf=t),t>Xp&&(Xp=t),e<Tg&&(Tg=e),e>Eg&&(Eg=e)}var Rf=jj;var S6=0,M6=0,Wp=0,Ig=0,Ng=0,Of=0,A6=0,T6=0,Vp=0,F9,q9,So,Mo,Qr={point:Ua,lineStart:D9,lineEnd:P9,polygonStart:function(){Qr.lineStart=Gj,Qr.lineEnd=Hj},polygonEnd:function(){Qr.point=Ua,Qr.lineStart=D9,Qr.lineEnd=P9},result:function(){var t=Vp?[A6/Vp,T6/Vp]:Of?[Ig/Of,Ng/Of]:Wp?[S6/Wp,M6/Wp]:[NaN,NaN];return S6=M6=Wp=Ig=Ng=Of=A6=T6=Vp=0,t}};function Ua(t,e){S6+=t,M6+=e,++Wp}function D9(){Qr.point=Wj}function Wj(t,e){Qr.point=Vj,Ua(So=t,Mo=e)}function Vj(t,e){var n=t-So,r=e-Mo,o=Qt(n*n+r*r);Ig+=o*(So+t)/2,Ng+=o*(Mo+e)/2,Of+=o,Ua(So=t,Mo=e)}function P9(){Qr.point=Ua}function Gj(){Qr.point=Qj}function Hj(){B9(F9,q9)}function Qj(t,e){Qr.point=B9,Ua(F9=So=t,q9=Mo=e)}function B9(t,e){var n=t-So,r=e-Mo,o=Qt(n*n+r*r);Ig+=o*(So+t)/2,Ng+=o*(Mo+e)/2,Of+=o,o=Mo*t-So*e,A6+=o*(So+t),T6+=o*(Mo+e),Vp+=o*3,Ua(So=t,Mo=e)}var E6=Qr;function Cg(t){this._context=t}Cg.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Ye);break}}},result:Te};var N6=new nn,I6,z9,Y9,Gp,Hp,kg={point:Te,lineStart:function(){kg.point=Zj},lineEnd:function(){I6&&U9(z9,Y9),kg.point=Te},polygonStart:function(){I6=!0},polygonEnd:function(){I6=null},result:function(){var t=+N6;return N6=new nn,t}};function Zj(t,e){kg.point=U9,z9=Gp=t,Y9=Hp=e}function U9(t,e){Gp-=t,Hp-=e,N6.add(Qt(Gp*Gp+Hp*Hp)),Gp=t,Hp=e}var C6=kg;var j9,Lg,X9,W9,$f=class{constructor(e){this._append=e==null?V9:Jj(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==X9||this._append!==Lg){let r=this._radius,o=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,X9=r,Lg=this._append,W9=this._,this._=o}this._+=W9;break}}}result(){let e=this._;return this._="",e.length?e:null}};function V9(t){let e=1;this._+=t[0];for(let n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function Jj(t){let e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return V9;if(e!==j9){let n=10**e;j9=e,Lg=function(o){let i=1;this._+=o[0];for(let s=o.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return Lg}function Ue(t,e){let n=3,r=4.5,o,i;function s(a){return a&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),or(a,o(i))),i.result()}return s.area=function(a){return or(a,o(_6)),_6.result()},s.measure=function(a){return or(a,o(C6)),C6.result()},s.bounds=function(a){return or(a,o(Rf)),Rf.result()},s.centroid=function(a){return or(a,o(E6)),E6.result()},s.projection=function(a){return arguments.length?(o=a==null?(t=null,jp):(t=a).stream,s):t},s.context=function(a){return arguments.length?(i=a==null?(e=null,new $f(n)):new Cg(e=a),typeof r!="function"&&i.pointRadius(r),s):e},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(i.pointRadius(+a),+a),s):r},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{let c=Math.floor(a);if(!(c>=0))throw new RangeError(`invalid digits: ${a}`);n=c}return e===null&&(i=new $f(n)),s},s.projection(t).digits(n).context(e)}function ja(t){return{stream:Df(t)}}function Df(t){return function(e){var n=new k6;for(var r in t)n[r]=t[r];return n.stream=e,n}}function k6(){}k6.prototype={constructor:k6,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function L6(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),or(n,t.stream(Rf)),e(Rf.result()),r!=null&&t.clipExtent(r),t}function Qp(t,e,n){return L6(t,function(r){var o=e[1][0]-e[0][0],i=e[1][1]-e[0][1],s=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),a=+e[0][0]+(o-s*(r[1][0]+r[0][0]))/2,c=+e[0][1]+(i-s*(r[1][1]+r[0][1]))/2;t.scale(150*s).translate([a,c])},n)}function Rg(t,e,n){return Qp(t,[[0,0],e],n)}function Og(t,e,n){return L6(t,function(r){var o=+e,i=o/(r[1][0]-r[0][0]),s=(o-i*(r[1][0]+r[0][0]))/2,a=-i*r[0][1];t.scale(150*i).translate([s,a])},n)}function $g(t,e,n){return L6(t,function(r){var o=+e,i=o/(r[1][1]-r[0][1]),s=-i*r[0][0],a=(o-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([s,a])},n)}var G9=16,Kj=Q(30*At);function R6(t,e){return+e?eX(t,e):tX(t)}function tX(t){return Df({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function eX(t,e){function n(r,o,i,s,a,c,f,u,p,l,d,h,m,x){var g=f-r,y=u-o,b=g*g+y*y;if(b>4*e&&m--){var w=s+l,_=a+d,v=c+h,A=Qt(w*w+_*_+v*v),T=ne(v/=A),E=St(St(v)-1)<J||St(i-p)<J?(i+p)/2:Ae(_,w),N=t(E,T),M=N[0],k=N[1],O=M-r,S=k-o,I=y*O-g*S;(I*I/b>e||St((g*O+y*S)/b-.5)>.3||s*l+a*d+c*h<Kj)&&(n(r,o,i,s,a,c,M,k,E,w/=A,_/=A,v,m,x),x.point(M,k),n(M,k,E,w,_,v,f,u,p,l,d,h,m,x))}}return function(r){var o,i,s,a,c,f,u,p,l,d,h,m,x={point:g,lineStart:y,lineEnd:w,polygonStart:function(){r.polygonStart(),x.lineStart=_},polygonEnd:function(){r.polygonEnd(),x.lineStart=y}};function g(T,E){T=t(T,E),r.point(T[0],T[1])}function y(){p=NaN,x.point=b,r.lineStart()}function b(T,E){var N=_o([T,E]),M=t(T,E);n(p,l,u,d,h,m,p=M[0],l=M[1],u=T,d=N[0],h=N[1],m=N[2],G9,r),r.point(p,l)}function w(){x.point=g,r.lineEnd()}function _(){y(),x.point=v,x.lineEnd=A}function v(T,E){b(o=T,E),i=p,s=l,a=d,c=h,f=m,x.point=b}function A(){n(p,l,u,d,h,m,i,s,o,a,c,f,G9,r),x.lineEnd=w,w()}return x}}var nX=Df({point:function(t,e){this.stream.point(t*At,e*At)}});function rX(t){return Df({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}function oX(t,e,n,r,o){function i(s,a){return s*=r,a*=o,[e+t*s,n-t*a]}return i.invert=function(s,a){return[(s-e)/t*r,(n-a)/t*o]},i}function H9(t,e,n,r,o,i){if(!i)return oX(t,e,n,r,o);var s=Q(i),a=H(i),c=s*t,f=a*t,u=s/t,p=a/t,l=(a*n-s*e)/t,d=(a*e+s*n)/t;function h(m,x){return m*=r,x*=o,[c*m-f*x+e,n-f*m-c*x]}return h.invert=function(m,x){return[r*(u*m-p*x+l),o*(d-p*m-u*x)]},h}function cn(t){return O6(function(){return t})()}function O6(t){var e,n=150,r=480,o=250,i=0,s=0,a=0,c=0,f=0,u,p=0,l=1,d=1,h=null,m=m6,x=null,g,y,b,w=jp,_=.5,v,A,T,E,N;function M(I){return T(I[0]*At,I[1]*At)}function k(I){return I=T.invert(I[0],I[1]),I&&[I[0]*he,I[1]*he]}M.stream=function(I){return E&&N===I?E:E=nX(rX(u)(m(v(w(N=I)))))},M.preclip=function(I){return arguments.length?(m=I,h=void 0,S()):m},M.postclip=function(I){return arguments.length?(w=I,x=g=y=b=null,S()):w},M.clipAngle=function(I){return arguments.length?(m=+I?N9(h=I*At):(h=null,m6),S()):h*he},M.clipExtent=function(I){return arguments.length?(w=I==null?(x=g=y=b=null,jp):kf(x=+I[0][0],g=+I[0][1],y=+I[1][0],b=+I[1][1]),S()):x==null?null:[[x,g],[y,b]]},M.scale=function(I){return arguments.length?(n=+I,O()):n},M.translate=function(I){return arguments.length?(r=+I[0],o=+I[1],O()):[r,o]},M.center=function(I){return arguments.length?(i=I[0]%360*At,s=I[1]%360*At,O()):[i*he,s*he]},M.rotate=function(I){return arguments.length?(a=I[0]%360*At,c=I[1]%360*At,f=I.length>2?I[2]%360*At:0,O()):[a*he,c*he,f*he]},M.angle=function(I){return arguments.length?(p=I%360*At,O()):p*he},M.reflectX=function(I){return arguments.length?(l=I?-1:1,O()):l<0},M.reflectY=function(I){return arguments.length?(d=I?-1:1,O()):d<0},M.precision=function(I){return arguments.length?(v=R6(A,_=I*I),S()):Qt(_)},M.fitExtent=function(I,C){return Qp(M,I,C)},M.fitSize=function(I,C){return Rg(M,I,C)},M.fitWidth=function(I,C){return Og(M,I,C)},M.fitHeight=function(I,C){return $g(M,I,C)};function O(){var I=H9(n,0,0,l,d,p).apply(null,e(i,s)),C=H9(n,r-I[0],o-I[1],l,d,p);return u=d6(a,c,f),A=Yp(e,C),T=Yp(u,A),v=R6(A,_),S()}function S(){return E=N=null,M}return function(){return e=t.apply(this,arguments),M.invert=e.invert&&k,O()}}function Pf(t){var e=0,n=bt/3,r=O6(t),o=r(e,n);return o.parallels=function(i){return arguments.length?r(e=i[0]*At,n=i[1]*At):[e*he,n*he]},o}function Q9(t){var e=Q(t);function n(r,o){return[r*e,H(o)/e]}return n.invert=function(r,o){return[r/e,ne(o*e)]},n}function Z9(t,e){var n=H(t),r=(n+H(e))/2;if(St(r)<J)return Q9(t);var o=1+n*(2*r-n),i=Qt(o)/r;function s(a,c){var f=Qt(o-2*r*H(c))/r;return[f*H(a*=r),i-f*Q(a)]}return s.invert=function(a,c){var f=i-c,u=Ae(a,St(f))*yn(f);return f*r<0&&(u-=bt*yn(a)*yn(f)),[u/r,ne((o-(a*a+f*f)*r*r)/(2*r))]},s}function gs(){return Pf(Z9).scale(155.424).center([0,33.6442])}function Zp(){return gs().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function iX(t){var e=t.length;return{point:function(n,r){for(var o=-1;++o<e;)t[o].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function $6(){var t,e,n=Zp(),r,o=gs().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,s=gs().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,c,f={point:function(l,d){c=[l,d]}};function u(l){var d=l[0],h=l[1];return c=null,r.point(d,h),c||(i.point(d,h),c)||(a.point(d,h),c)}u.invert=function(l){var d=n.scale(),h=n.translate(),m=(l[0]-h[0])/d,x=(l[1]-h[1])/d;return(x>=.12&&x<.234&&m>=-.425&&m<-.214?o:x>=.166&&x<.234&&m>=-.214&&m<-.115?s:n).invert(l)},u.stream=function(l){return t&&e===l?t:t=iX([n.stream(e=l),o.stream(l),s.stream(l)])},u.precision=function(l){return arguments.length?(n.precision(l),o.precision(l),s.precision(l),p()):n.precision()},u.scale=function(l){return arguments.length?(n.scale(l),o.scale(l*.35),s.scale(l),u.translate(n.translate())):n.scale()},u.translate=function(l){if(!arguments.length)return n.translate();var d=n.scale(),h=+l[0],m=+l[1];return r=n.translate(l).clipExtent([[h-.455*d,m-.238*d],[h+.455*d,m+.238*d]]).stream(f),i=o.translate([h-.307*d,m+.201*d]).clipExtent([[h-.425*d+J,m+.12*d+J],[h-.214*d-J,m+.234*d-J]]).stream(f),a=s.translate([h-.205*d,m+.212*d]).clipExtent([[h-.214*d+J,m+.166*d+J],[h-.115*d-J,m+.234*d-J]]).stream(f),p()},u.fitExtent=function(l,d){return Qp(u,l,d)},u.fitSize=function(l,d){return Rg(u,l,d)},u.fitWidth=function(l,d){return Og(u,l,d)},u.fitHeight=function(l,d){return $g(u,l,d)};function p(){return t=e=null,u}return u.scale(1070)}function Dg(t){return function(e,n){var r=Q(e),o=Q(n),i=t(r*o);return i===1/0?[2,0]:[i*o*H(e),i*H(n)]}}function Ao(t){return function(e,n){var r=Qt(e*e+n*n),o=t(r),i=H(o),s=Q(o);return[Ae(e*i,r*s),ne(r&&n*i/r)]}}var D6=Dg(function(t){return Qt(2/(1+t))});D6.invert=Ao(function(t){return 2*ne(t/2)});function P6(){return cn(D6).scale(124.75).clipAngle(180-.001)}var F6=Dg(function(t){return(t=lg(t))&&t/H(t)});F6.invert=Ao(function(t){return t});function q6(){return cn(F6).scale(79.4188).clipAngle(180-.001)}function Ff(t,e){return[t,Ya(If((Ht+e)/2))]}Ff.invert=function(t,e){return[t,2*Nr(cg(e))-Ht]};function B6(){return z6(Ff).scale(961/Ye)}function z6(t){var e=cn(t),n=e.center,r=e.scale,o=e.translate,i=e.clipExtent,s=null,a,c,f;e.scale=function(p){return arguments.length?(r(p),u()):r()},e.translate=function(p){return arguments.length?(o(p),u()):o()},e.center=function(p){return arguments.length?(n(p),u()):n()},e.clipExtent=function(p){return arguments.length?(p==null?s=a=c=f=null:(s=+p[0][0],a=+p[0][1],c=+p[1][0],f=+p[1][1]),u()):s==null?null:[[s,a],[c,f]]};function u(){var p=bt*r(),l=e(M9(e.rotate()).invert([0,0]));return i(s==null?[[l[0]-p,l[1]-p],[l[0]+p,l[1]+p]]:t===Ff?[[Math.max(l[0]-p,s),a],[Math.min(l[0]+p,c),f]]:[[s,Math.max(l[1]-p,a)],[c,Math.min(l[1]+p,f)]])}return u()}function Pg(t){return If((Ht+t)/2)}function J9(t,e){var n=Q(t),r=t===e?H(t):Ya(n/Q(e))/Ya(Pg(e)/Pg(t)),o=n*ug(Pg(t),r)/r;if(!r)return Ff;function i(s,a){o>0?a<-Ht+J&&(a=-Ht+J):a>Ht-J&&(a=Ht-J);var c=o/ug(Pg(a),r);return[c*H(r*s),o-c*Q(r*s)]}return i.invert=function(s,a){var c=o-a,f=yn(r)*Qt(s*s+c*c),u=Ae(s,St(c))*yn(c);return c*r<0&&(u-=bt*yn(s)*yn(c)),[u/r,2*Nr(ug(o/f,1/r))-Ht]},i}function Y6(){return Pf(J9).scale(109.5).parallels([30,30])}function qf(t,e){return[t,e]}qf.invert=qf;function U6(){return cn(qf).scale(152.63)}function K9(t,e){var n=Q(t),r=t===e?H(t):(n-Q(e))/(e-t),o=n/r+t;if(St(r)<J)return qf;function i(s,a){var c=o-a,f=r*s;return[c*H(f),o-c*Q(f)]}return i.invert=function(s,a){var c=o-a,f=Ae(s,St(c))*yn(c);return c*r<0&&(f-=bt*yn(s)*yn(c)),[f/r,o-yn(r)*Qt(s*s+c*c)]},i}function j6(){return Pf(K9).scale(131.154).center([0,13.9389])}var Jp=1.340264,Kp=-.081106,td=893e-6,ed=.003796,Fg=Qt(3)/2,sX=12;function X6(t,e){var n=ne(Fg*H(e)),r=n*n,o=r*r*r;return[t*Q(n)/(Fg*(Jp+3*Kp*r+o*(7*td+9*ed*r))),n*(Jp+Kp*r+o*(td+ed*r))]}X6.invert=function(t,e){for(var n=e,r=n*n,o=r*r*r,i=0,s,a,c;i<sX&&(a=n*(Jp+Kp*r+o*(td+ed*r))-e,c=Jp+3*Kp*r+o*(7*td+9*ed*r),n-=s=a/c,r=n*n,o=r*r*r,!(St(s)<za));++i);return[Fg*t*(Jp+3*Kp*r+o*(7*td+9*ed*r))/Q(n),ne(H(n)/Fg)]};function W6(){return cn(X6).scale(177.158)}function V6(t,e){var n=Q(e),r=Q(t)*n;return[n*H(t)/r,H(e)/r]}V6.invert=Ao(Nr);function G6(){return cn(V6).scale(144.049).clipAngle(60)}function H6(t,e){return[Q(e)*H(t),H(e)]}H6.invert=Ao(ne);function Q6(){return cn(H6).scale(249.5).clipAngle(90+J)}function Z6(t,e){var n=Q(e),r=1+Q(t)*n;return[n*H(t)/r,H(e)/r]}Z6.invert=Ao(function(t){return 2*Nr(t)});function J6(){return cn(Z6).scale(250).clipAngle(142)}function K6(t,e){return[Ya(If((Ht+e)/2)),-t]}K6.invert=function(t,e){return[-e,2*Nr(cg(t))-Ht]};function t3(){var t=z6(K6),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function aX(t,e){return t.parent===e.parent?1:2}function cX(t){return t.reduce(fX,0)/t.length}function fX(t,e){return t+e.x}function uX(t){return 1+t.reduce(lX,0)}function lX(t,e){return Math.max(t,e.y)}function pX(t){for(var e;e=t.children;)t=e[0];return t}function dX(t){for(var e;e=t.children;)t=e[e.length-1];return t}function qg(){var t=aX,e=1,n=1,r=!1;function o(i){var s,a=0;i.eachAfter(function(l){var d=l.children;d?(l.x=cX(d),l.y=uX(d)):(l.x=s?a+=t(l,s):0,l.y=0,s=l)});var c=pX(i),f=dX(i),u=c.x-t(c,f)/2,p=f.x+t(f,c)/2;return i.eachAfter(r?function(l){l.x=(l.x-i.x)*e,l.y=(i.y-l.y)*n}:function(l){l.x=(l.x-u)/(p-u)*e,l.y=(1-(i.y?l.y/i.y:1))*n})}return o.separation=function(i){return arguments.length?(t=i,o):t},o.size=function(i){return arguments.length?(r=!1,e=+i[0],n=+i[1],o):r?null:[e,n]},o.nodeSize=function(i){return arguments.length?(r=!0,e=+i[0],n=+i[1],o):r?[e,n]:null},o}function hX(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function tk(){return this.eachAfter(hX)}function ek(t,e){let n=-1;for(let r of this)t.call(e,r,++n,this);return this}function nk(t,e){for(var n=this,r=[n],o,i,s=-1;n=r.pop();)if(t.call(e,n,++s,this),o=n.children)for(i=o.length-1;i>=0;--i)r.push(o[i]);return this}function rk(t,e){for(var n=this,r=[n],o=[],i,s,a,c=-1;n=r.pop();)if(o.push(n),i=n.children)for(s=0,a=i.length;s<a;++s)r.push(i[s]);for(;n=o.pop();)t.call(e,n,++c,this);return this}function ok(t,e){let n=-1;for(let r of this)if(t.call(e,r,++n,this))return r}function ik(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,o=r&&r.length;--o>=0;)n+=r[o].value;e.value=n})}function sk(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function ak(t){for(var e=this,n=mX(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function mX(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),o=null;for(t=n.pop(),e=r.pop();t===e;)o=t,t=n.pop(),e=r.pop();return o}function ck(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function fk(){return Array.from(this)}function uk(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function lk(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*pk(){var t=this,e,n=[t],r,o,i;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(o=0,i=r.length;o<i;++o)n.push(r[o]);while(n.length)}function e3(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=yX)):e===void 0&&(e=gX);for(var n=new ys(t),r,o=[n],i,s,a,c;r=o.pop();)if((s=e(r.data))&&(c=(s=Array.from(s)).length))for(r.children=s,a=c-1;a>=0;--a)o.push(i=s[a]=new ys(s[a])),i.parent=r,i.depth=r.depth+1;return n.eachBefore(n3)}function xX(){return e3(this).eachBefore(bX)}function gX(t){return t.children}function yX(t){return Array.isArray(t)?t[1]:null}function bX(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function n3(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function ys(t){this.data=t,this.depth=this.height=0,this.parent=null}ys.prototype=e3.prototype={constructor:ys,count:tk,each:ek,eachAfter:rk,eachBefore:nk,find:ok,sum:ik,sort:sk,path:ak,ancestors:ck,descendants:fk,leaves:uk,links:lk,copy:xX,[Symbol.iterator]:pk};function Bg(t){return t==null?null:wX(t)}function wX(t){if(typeof t!="function")throw new Error;return t}var vX={depth:-1},dk={},r3={};function _X(t){return t.id}function SX(t){return t.parentId}function zg(){var t=_X,e=SX,n;function r(o){var i=Array.from(o),s=t,a=e,c,f,u,p,l,d,h,m,x=new Map;if(n!=null){let g=i.map((w,_)=>MX(n(w,_,o))),y=g.map(hk),b=new Set(g).add("");for(let w of y)b.has(w)||(b.add(w),g.push(w),y.push(hk(w)),i.push(r3));s=(w,_)=>g[_],a=(w,_)=>y[_]}for(u=0,c=i.length;u<c;++u)f=i[u],d=i[u]=new ys(f),(h=s(f,u,o))!=null&&(h+="")&&(m=d.id=h,x.set(m,x.has(m)?dk:d)),(h=a(f,u,o))!=null&&(h+="")&&(d.parent=h);for(u=0;u<c;++u)if(d=i[u],h=d.parent){if(l=x.get(h),!l)throw new Error("missing: "+h);if(l===dk)throw new Error("ambiguous: "+h);l.children?l.children.push(d):l.children=[d],d.parent=l}else{if(p)throw new Error("multiple roots");p=d}if(!p)throw new Error("no root");if(n!=null){for(;p.data===r3&&p.children.length===1;)p=p.children[0],--c;for(let g=i.length-1;g>=0&&(d=i[g],d.data===r3);--g)d.data=null}if(p.parent=vX,p.eachBefore(function(g){g.depth=g.parent.depth+1,--c}).eachBefore(n3),p.parent=null,c>0)throw new Error("cycle");return p}return r.id=function(o){return arguments.length?(t=Bg(o),r):t},r.parentId=function(o){return arguments.length?(e=Bg(o),r):e},r.path=function(o){return arguments.length?(n=Bg(o),r):n},r}function MX(t){t=`${t}`;let e=t.length;return o3(t,e-1)&&!o3(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function hk(t){let e=t.length;if(e<2)return"";for(;--e>1&&!o3(t,e););return t.slice(0,e)}function o3(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function AX(t,e){return t.parent===e.parent?1:2}function i3(t){var e=t.children;return e?e[0]:t.t}function s3(t){var e=t.children;return e?e[e.length-1]:t.t}function TX(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function EX(t){for(var e=0,n=0,r=t.children,o=r.length,i;--o>=0;)i=r[o],i.z+=e,i.m+=e,e+=i.s+(n+=i.c)}function IX(t,e,n){return t.a.parent===e.parent?t.a:n}function Yg(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}Yg.prototype=Object.create(ys.prototype);function NX(t){for(var e=new Yg(t,0),n,r=[e],o,i,s,a;n=r.pop();)if(i=n._.children)for(n.children=new Array(a=i.length),s=a-1;s>=0;--s)r.push(o=n.children[s]=new Yg(i[s],s)),o.parent=n;return(e.parent=new Yg(null,0)).children=[e],e}function Xa(){var t=AX,e=1,n=1,r=null;function o(f){var u=NX(f);if(u.eachAfter(i),u.parent.m=-u.z,u.eachBefore(s),r)f.eachBefore(c);else{var p=f,l=f,d=f;f.eachBefore(function(y){y.x<p.x&&(p=y),y.x>l.x&&(l=y),y.depth>d.depth&&(d=y)});var h=p===l?1:t(p,l)/2,m=h-p.x,x=e/(l.x+h+m),g=n/(d.depth||1);f.eachBefore(function(y){y.x=(y.x+m)*x,y.y=y.depth*g})}return f}function i(f){var u=f.children,p=f.parent.children,l=f.i?p[f.i-1]:null;if(u){EX(f);var d=(u[0].z+u[u.length-1].z)/2;l?(f.z=l.z+t(f._,l._),f.m=f.z-d):f.z=d}else l&&(f.z=l.z+t(f._,l._));f.parent.A=a(f,l,f.parent.A||p[0])}function s(f){f._.x=f.z+f.parent.m,f.m+=f.parent.m}function a(f,u,p){if(u){for(var l=f,d=f,h=u,m=l.parent.children[0],x=l.m,g=d.m,y=h.m,b=m.m,w;h=s3(h),l=i3(l),h&&l;)m=i3(m),d=s3(d),d.a=f,w=h.z+y-l.z-x+t(h._,l._),w>0&&(TX(IX(h,f,p),f,w),x+=w,g+=w),y+=h.m,x+=l.m,b+=m.m,g+=d.m;h&&!s3(d)&&(d.t=h,d.m+=y-g),l&&!i3(m)&&(m.t=l,m.m+=x-b,p=f)}return p}function c(f){f.x*=e,f.y=f.depth*n}return o.separation=function(f){return arguments.length?(t=f,o):t},o.size=function(f){return arguments.length?(r=!1,e=+f[0],n=+f[1],o):r?null:[e,n]},o.nodeSize=function(f){return arguments.length?(r=!0,e=+f[0],n=+f[1],o):r?[e,n]:null},o}var mk=23283064365386963e-26;function Wa(t=Math.random()){let e=(0<=t&&t<1?t/mk:Math.abs(t))|0;return()=>(e=1664525*e+1013904223|0,mk*(e>>>0))}function Ee(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function nd(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}var rd=Symbol("implicit");function Va(){var t=new Tn,e=[],n=[],r=rd;function o(i){let s=t.get(i);if(s===void 0){if(r!==rd)return r;t.set(i,s=e.push(i)-1)}return n[s%n.length]}return o.domain=function(i){if(!arguments.length)return e.slice();e=[],t=new Tn;for(let s of i)t.has(s)||t.set(s,e.push(s)-1);return o},o.range=function(i){return arguments.length?(n=Array.from(i),o):n.slice()},o.unknown=function(i){return arguments.length?(r=i,o):r},o.copy=function(){return Va(e,n).unknown(r)},Ee.apply(o,arguments),o}function bs(){var t=Va().unknown(void 0),e=t.domain,n=t.range,r=0,o=1,i,s,a=!1,c=0,f=0,u=.5;delete t.unknown;function p(){var l=e().length,d=o<r,h=d?o:r,m=d?r:o;i=(m-h)/Math.max(1,l-c+f*2),a&&(i=Math.floor(i)),h+=(m-h-i*(l-c))*u,s=i*(1-c),a&&(h=Math.round(h),s=Math.round(s));var x=ye(l).map(function(g){return h+i*g});return n(d?x.reverse():x)}return t.domain=function(l){return arguments.length?(e(l),p()):e()},t.range=function(l){return arguments.length?([r,o]=l,r=+r,o=+o,p()):[r,o]},t.rangeRound=function(l){return[r,o]=l,r=+r,o=+o,a=!0,p()},t.bandwidth=function(){return s},t.step=function(){return i},t.round=function(l){return arguments.length?(a=!!l,p()):a},t.padding=function(l){return arguments.length?(c=Math.min(1,f=+l),p()):c},t.paddingInner=function(l){return arguments.length?(c=Math.min(1,l),p()):c},t.paddingOuter=function(l){return arguments.length?(f=+l,p()):f},t.align=function(l){return arguments.length?(u=Math.max(0,Math.min(1,l)),p()):u},t.copy=function(){return bs(e(),[r,o]).round(a).paddingInner(c).paddingOuter(f).align(u)},Ee.apply(p(),arguments)}function xk(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return xk(e())},t}function a3(){return xk(bs.apply(null,arguments).paddingInner(1))}function c3(t){return function(){return t}}function Bf(t){return+t}var gk=[0,1];function Vn(t){return t}function f3(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:c3(isNaN(e)?NaN:.5)}function CX(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function kX(t,e,n){var r=t[0],o=t[1],i=e[0],s=e[1];return o<r?(r=f3(o,r),i=n(s,i)):(r=f3(r,o),i=n(i,s)),function(a){return i(r(a))}}function LX(t,e,n){var r=Math.min(t.length,e.length)-1,o=new Array(r),i=new Array(r),s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)o[s]=f3(t[s],t[s+1]),i[s]=n(e[s],e[s+1]);return function(a){var c=fi(t,a,1,r)-1;return i[c](o[c](a))}}function To(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Ga(){var t=gk,e=gk,n=rr,r,o,i,s=Vn,a,c,f;function u(){var l=Math.min(t.length,e.length);return s!==Vn&&(s=CX(t[0],t[l-1])),a=l>2?LX:kX,c=f=null,p}function p(l){return l==null||isNaN(l=+l)?i:(c||(c=a(t.map(r),e,n)))(r(s(l)))}return p.invert=function(l){return s(o((f||(f=a(e,t.map(r),ee)))(l)))},p.domain=function(l){return arguments.length?(t=Array.from(l,Bf),u()):t.slice()},p.range=function(l){return arguments.length?(e=Array.from(l),u()):e.slice()},p.rangeRound=function(l){return e=Array.from(l),n=$a,u()},p.clamp=function(l){return arguments.length?(s=l?!0:Vn,u()):s!==Vn},p.interpolate=function(l){return arguments.length?(n=l,u()):n},p.unknown=function(l){return arguments.length?(i=l,p):i},function(l,d){return r=l,o=d,u()}}function od(){return Ga()(Vn,Vn)}function u3(t,e,n,r){var o=ff(t,e,n),i;switch(r=vo(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(i=r6(o,s))&&(r.precision=i),ag(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=o6(o,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=n6(o))&&(r.precision=i-(r.type==="%")*2);break}}return Ir(r)}function vi(t){var e=t.domain;return t.ticks=function(n){var r=e();return on(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var o=e();return u3(o[0],o[o.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),o=0,i=r.length-1,s=r[o],a=r[i],c,f,u=10;for(a<s&&(f=s,s=a,a=f,f=o,o=i,i=f);u-- >0;){if(f=li(s,a,n),f===c)return r[o]=s,r[i]=a,e(r);if(f>0)s=Math.floor(s/f)*f,a=Math.ceil(a/f)*f;else if(f<0)s=Math.ceil(s*f)/f,a=Math.floor(a*f)/f;else break;c=f}return t},t}function _i(){var t=od();return t.copy=function(){return To(t,_i())},Ee.apply(t,arguments),vi(t)}function id(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,Bf),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return id(t).unknown(e)},t=arguments.length?Array.from(t,Bf):[0,1],vi(n)}function sd(t,e){t=t.slice();var n=0,r=t.length-1,o=t[n],i=t[r],s;return i<o&&(s=n,n=r,r=s,s=o,o=i,i=s),t[n]=e.floor(o),t[r]=e.ceil(i),t}function yk(t){return Math.log(t)}function bk(t){return Math.exp(t)}function RX(t){return-Math.log(-t)}function OX(t){return-Math.exp(-t)}function $X(t){return isFinite(t)?+("1e"+t):t<0?0:t}function DX(t){return t===10?$X:t===Math.E?Math.exp:e=>Math.pow(t,e)}function PX(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function wk(t){return(e,n)=>-t(-e,n)}function l3(t){let e=t(yk,bk),n=e.domain,r=10,o,i;function s(){return o=PX(r),i=DX(r),n()[0]<0?(o=wk(o),i=wk(i),t(RX,OX)):t(yk,bk),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{let c=n(),f=c[0],u=c[c.length-1],p=u<f;p&&([f,u]=[u,f]);let l=o(f),d=o(u),h,m,x=a==null?10:+a,g=[];if(!(r%1)&&d-l<x){if(l=Math.floor(l),d=Math.ceil(d),f>0){for(;l<=d;++l)for(h=1;h<r;++h)if(m=l<0?h/i(-l):h*i(l),!(m<f)){if(m>u)break;g.push(m)}}else for(;l<=d;++l)for(h=r-1;h>=1;--h)if(m=l>0?h/i(-l):h*i(l),!(m<f)){if(m>u)break;g.push(m)}g.length*2<x&&(g=on(f,u,x))}else g=on(l,d,Math.min(d-l,x)).map(i);return p?g.reverse():g},e.tickFormat=(a,c)=>{if(a==null&&(a=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=vo(c)).precision==null&&(c.trim=!0),c=Ir(c)),a===1/0)return c;let f=Math.max(1,r*a/e.ticks().length);return u=>{let p=u/i(Math.round(o(u)));return p*r<r-.5&&(p*=r),p<=f?c(u):""}},e.nice=()=>n(sd(n(),{floor:a=>i(Math.floor(o(a))),ceil:a=>i(Math.ceil(o(a)))})),e}function ad(){let t=l3(Ga()).domain([1,10]);return t.copy=()=>To(t,ad()).base(t.base()),Ee.apply(t,arguments),t}function vk(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function _k(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function p3(t){var e=1,n=t(vk(e),_k(e));return n.constant=function(r){return arguments.length?t(vk(e=+r),_k(e)):e},vi(n)}function cd(){var t=p3(Ga());return t.copy=function(){return To(t,cd()).constant(t.constant())},Ee.apply(t,arguments)}function Sk(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function FX(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function qX(t){return t<0?-t*t:t*t}function d3(t){var e=t(Vn,Vn),n=1;function r(){return n===1?t(Vn,Vn):n===.5?t(FX,qX):t(Sk(n),Sk(1/n))}return e.exponent=function(o){return arguments.length?(n=+o,r()):n},vi(e)}function fd(){var t=d3(Ga());return t.copy=function(){return To(t,fd()).exponent(t.exponent())},Ee.apply(t,arguments),t}function ud(){var t=[],e=[],n=[],r;function o(){var s=0,a=Math.max(1,e.length);for(n=new Array(a-1);++s<a;)n[s-1]=p_(t,s/a);return i}function i(s){return s==null||isNaN(s=+s)?r:e[fi(n,s)]}return i.invertExtent=function(s){var a=e.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:t[0],a<n.length?n[a]:t[t.length-1]]},i.domain=function(s){if(!arguments.length)return t.slice();t=[];for(let a of s)a!=null&&!isNaN(a=+a)&&t.push(a);return t.sort(yt),o()},i.range=function(s){return arguments.length?(e=Array.from(s),o()):e.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return ud().domain(t).range(e).unknown(r)},Ee.apply(i,arguments)}function ld(){var t=[.5],e=[0,1],n,r=1;function o(i){return i!=null&&i<=i?e[fi(t,i,0,r)]:n}return o.domain=function(i){return arguments.length?(t=Array.from(i),r=Math.min(t.length,e.length-1),o):t.slice()},o.range=function(i){return arguments.length?(e=Array.from(i),r=Math.min(t.length,e.length-1),o):e.slice()},o.invertExtent=function(i){var s=e.indexOf(i);return[t[s-1],t[s]]},o.unknown=function(i){return arguments.length?(n=i,o):n},o.copy=function(){return ld().domain(t).range(e).unknown(n)},Ee.apply(o,arguments)}var h3=new Date,m3=new Date;function Jt(t,e,n,r){function o(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(t(i=new Date(+i)),i),o.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),o.round=i=>{let s=o(i),a=o.ceil(i);return i-s<a-i?s:a},o.offset=(i,s)=>(e(i=new Date(+i),s==null?1:Math.floor(s)),i),o.range=(i,s,a)=>{let c=[];if(i=o.ceil(i),a=a==null?1:Math.floor(a),!(i<s)||!(a>0))return c;let f;do c.push(f=new Date(+i)),e(i,a),t(i);while(f<i&&i<s);return c},o.filter=i=>Jt(s=>{if(s>=s)for(;t(s),!i(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!i(s););else for(;--a>=0;)for(;e(s,1),!i(s););}),n&&(o.count=(i,s)=>(h3.setTime(+i),m3.setTime(+s),t(h3),t(m3),Math.floor(n(h3,m3))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(r?s=>r(s)%i===0:s=>o.count(0,s)%i===0):o)),o}var pd=Jt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);pd.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Jt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):pd);var vMt=pd.range;var je=Jt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),Mk=je.range;var Si=Jt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),BX=Si.range,Mi=Jt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),zX=Mi.range;var Ai=Jt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),YX=Ai.range,Ti=Jt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),UX=Ti.range;var Cr=Jt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),jX=Cr.range,Za=Jt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),XX=Za.range,Ja=Jt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),WX=Ja.range;function Ka(t){return Jt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var ir=Ka(0),ws=Ka(1),Ug=Ka(2),jg=Ka(3),Io=Ka(4),Xg=Ka(5),Wg=Ka(6),Tk=ir.range,VX=ws.range,GX=Ug.range,HX=jg.range,QX=Io.range,ZX=Xg.range,JX=Wg.range;function tc(t){return Jt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/6048e5)}var sr=tc(0),vs=tc(1),Vg=tc(2),Gg=tc(3),No=tc(4),Hg=tc(5),Qg=tc(6),Ek=sr.range,KX=vs.range,tW=Vg.range,eW=Gg.range,nW=No.range,rW=Hg.range,oW=Qg.range;var Ei=Jt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),iW=Ei.range,Ii=Jt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),sW=Ii.range;var bn=Jt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());bn.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Jt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});var aW=bn.range,wn=Jt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wn.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Jt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});var cW=wn.range;function Nk(t,e,n,r,o,i){let s=[[je,1,1e3],[je,5,5*1e3],[je,15,15*1e3],[je,30,30*1e3],[i,1,6e4],[i,5,5*6e4],[i,15,15*6e4],[i,30,30*6e4],[o,1,36e5],[o,3,3*36e5],[o,6,6*36e5],[o,12,12*36e5],[r,1,864e5],[r,2,2*864e5],[n,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function a(f,u,p){let l=u<f;l&&([f,u]=[u,f]);let d=p&&typeof p.range=="function"?p:c(f,u,p),h=d?d.range(f,+u+1):[];return l?h.reverse():h}function c(f,u,p){let l=Math.abs(u-f)/p,d=Xr(([,,x])=>x).right(s,l);if(d===s.length)return t.every(ff(f/31536e6,u/31536e6,p));if(d===0)return pd.every(Math.max(ff(f,u,p),1));let[h,m]=s[l/s[d-1][2]<s[d][2]/l?d-1:d];return h.every(m)}return[a,c]}var[x3,hd]=Nk(wn,Ii,sr,Ja,Ti,Mi),[g3,y3]=Nk(bn,Ei,ir,Cr,Ai,Si);function b3(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function w3(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function md(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function v3(t){var e=t.dateTime,n=t.date,r=t.time,o=t.periods,i=t.days,s=t.shortDays,a=t.months,c=t.shortMonths,f=xd(o),u=gd(o),p=xd(i),l=gd(i),d=xd(s),h=gd(s),m=xd(a),x=gd(a),g=xd(c),y=gd(c),b={a:L,A:D,b:$,B:P,c:null,d:$k,e:$k,f:LW,g:YW,G:jW,H:NW,I:CW,j:kW,L:Bk,m:RW,M:OW,p:F,q,Q:Fk,s:qk,S:$W,u:DW,U:PW,V:FW,w:qW,W:BW,x:null,X:null,y:zW,Y:UW,Z:XW,"%":Pk},w={a:V,A:K,b:et,B:rt,c:null,d:Dk,e:Dk,f:HW,g:iV,G:aV,H:WW,I:VW,j:GW,L:Yk,m:QW,M:ZW,p:j,q:nt,Q:Fk,s:qk,S:JW,u:KW,U:tV,V:eV,w:nV,W:rV,x:null,X:null,y:oV,Y:sV,Z:cV,"%":Pk},_={a:N,A:M,b:k,B:O,c:S,d:Rk,e:Rk,f:AW,g:Lk,G:kk,H:Ok,I:Ok,j:vW,L:MW,m:wW,M:_W,p:E,q:bW,Q:EW,s:IW,S:SW,u:hW,U:mW,V:xW,w:dW,W:gW,x:I,X:C,y:Lk,Y:kk,Z:yW,"%":TW};b.x=v(n,b),b.X=v(r,b),b.c=v(e,b),w.x=v(n,w),w.X=v(r,w),w.c=v(e,w);function v(Y,G){return function(tt){var B=[],_t=-1,ct=0,Ct=Y.length,Lt,Z,jt;for(tt instanceof Date||(tt=new Date(+tt));++_t<Ct;)Y.charCodeAt(_t)===37&&(B.push(Y.slice(ct,_t)),(Z=Ck[Lt=Y.charAt(++_t)])!=null?Lt=Y.charAt(++_t):Z=Lt==="e"?" ":"0",(jt=G[Lt])&&(Lt=jt(tt,Z)),B.push(Lt),ct=_t+1);return B.push(Y.slice(ct,_t)),B.join("")}}function A(Y,G){return function(tt){var B=md(1900,void 0,1),_t=T(B,Y,tt+="",0),ct,Ct;if(_t!=tt.length)return null;if("Q"in B)return new Date(B.Q);if("s"in B)return new Date(B.s*1e3+("L"in B?B.L:0));if(G&&!("Z"in B)&&(B.Z=0),"p"in B&&(B.H=B.H%12+B.p*12),B.m===void 0&&(B.m="q"in B?B.q:0),"V"in B){if(B.V<1||B.V>53)return null;"w"in B||(B.w=1),"Z"in B?(ct=w3(md(B.y,0,1)),Ct=ct.getUTCDay(),ct=Ct>4||Ct===0?vs.ceil(ct):vs(ct),ct=Za.offset(ct,(B.V-1)*7),B.y=ct.getUTCFullYear(),B.m=ct.getUTCMonth(),B.d=ct.getUTCDate()+(B.w+6)%7):(ct=b3(md(B.y,0,1)),Ct=ct.getDay(),ct=Ct>4||Ct===0?ws.ceil(ct):ws(ct),ct=Cr.offset(ct,(B.V-1)*7),B.y=ct.getFullYear(),B.m=ct.getMonth(),B.d=ct.getDate()+(B.w+6)%7)}else("W"in B||"U"in B)&&("w"in B||(B.w="u"in B?B.u%7:"W"in B?1:0),Ct="Z"in B?w3(md(B.y,0,1)).getUTCDay():b3(md(B.y,0,1)).getDay(),B.m=0,B.d="W"in B?(B.w+6)%7+B.W*7-(Ct+5)%7:B.w+B.U*7-(Ct+6)%7);return"Z"in B?(B.H+=B.Z/100|0,B.M+=B.Z%100,w3(B)):b3(B)}}function T(Y,G,tt,B){for(var _t=0,ct=G.length,Ct=tt.length,Lt,Z;_t<ct;){if(B>=Ct)return-1;if(Lt=G.charCodeAt(_t++),Lt===37){if(Lt=G.charAt(_t++),Z=_[Lt in Ck?G.charAt(_t++):Lt],!Z||(B=Z(Y,tt,B))<0)return-1}else if(Lt!=tt.charCodeAt(B++))return-1}return B}function E(Y,G,tt){var B=f.exec(G.slice(tt));return B?(Y.p=u.get(B[0].toLowerCase()),tt+B[0].length):-1}function N(Y,G,tt){var B=d.exec(G.slice(tt));return B?(Y.w=h.get(B[0].toLowerCase()),tt+B[0].length):-1}function M(Y,G,tt){var B=p.exec(G.slice(tt));return B?(Y.w=l.get(B[0].toLowerCase()),tt+B[0].length):-1}function k(Y,G,tt){var B=g.exec(G.slice(tt));return B?(Y.m=y.get(B[0].toLowerCase()),tt+B[0].length):-1}function O(Y,G,tt){var B=m.exec(G.slice(tt));return B?(Y.m=x.get(B[0].toLowerCase()),tt+B[0].length):-1}function S(Y,G,tt){return T(Y,e,G,tt)}function I(Y,G,tt){return T(Y,n,G,tt)}function C(Y,G,tt){return T(Y,r,G,tt)}function L(Y){return s[Y.getDay()]}function D(Y){return i[Y.getDay()]}function $(Y){return c[Y.getMonth()]}function P(Y){return a[Y.getMonth()]}function F(Y){return o[+(Y.getHours()>=12)]}function q(Y){return 1+~~(Y.getMonth()/3)}function V(Y){return s[Y.getUTCDay()]}function K(Y){return i[Y.getUTCDay()]}function et(Y){return c[Y.getUTCMonth()]}function rt(Y){return a[Y.getUTCMonth()]}function j(Y){return o[+(Y.getUTCHours()>=12)]}function nt(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var G=v(Y+="",b);return G.toString=function(){return Y},G},parse:function(Y){var G=A(Y+="",!1);return G.toString=function(){return Y},G},utcFormat:function(Y){var G=v(Y+="",w);return G.toString=function(){return Y},G},utcParse:function(Y){var G=A(Y+="",!0);return G.toString=function(){return Y},G}}}var Ck={"-":"",_:" ",0:"0"},Xe=/^\s*\d+/,uW=/^%/,lW=/[\\^$*+?|[\]().{}]/g;function qt(t,e,n){var r=t<0?"-":"",o=(r?-t:t)+"",i=o.length;return r+(i<n?new Array(n-i+1).join(e)+o:o)}function pW(t){return t.replace(lW,"\\$&")}function xd(t){return new RegExp("^(?:"+t.map(pW).join("|")+")","i")}function gd(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function dW(t,e,n){var r=Xe.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function hW(t,e,n){var r=Xe.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function mW(t,e,n){var r=Xe.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function xW(t,e,n){var r=Xe.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function gW(t,e,n){var r=Xe.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function kk(t,e,n){var r=Xe.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Lk(t,e,n){var r=Xe.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function yW(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function bW(t,e,n){var r=Xe.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function wW(t,e,n){var r=Xe.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Rk(t,e,n){var r=Xe.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function vW(t,e,n){var r=Xe.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ok(t,e,n){var r=Xe.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function _W(t,e,n){var r=Xe.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function SW(t,e,n){var r=Xe.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function MW(t,e,n){var r=Xe.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function AW(t,e,n){var r=Xe.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function TW(t,e,n){var r=uW.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function EW(t,e,n){var r=Xe.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function IW(t,e,n){var r=Xe.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function $k(t,e){return qt(t.getDate(),e,2)}function NW(t,e){return qt(t.getHours(),e,2)}function CW(t,e){return qt(t.getHours()%12||12,e,2)}function kW(t,e){return qt(1+Cr.count(bn(t),t),e,3)}function Bk(t,e){return qt(t.getMilliseconds(),e,3)}function LW(t,e){return Bk(t,e)+"000"}function RW(t,e){return qt(t.getMonth()+1,e,2)}function OW(t,e){return qt(t.getMinutes(),e,2)}function $W(t,e){return qt(t.getSeconds(),e,2)}function DW(t){var e=t.getDay();return e===0?7:e}function PW(t,e){return qt(ir.count(bn(t)-1,t),e,2)}function zk(t){var e=t.getDay();return e>=4||e===0?Io(t):Io.ceil(t)}function FW(t,e){return t=zk(t),qt(Io.count(bn(t),t)+(bn(t).getDay()===4),e,2)}function qW(t){return t.getDay()}function BW(t,e){return qt(ws.count(bn(t)-1,t),e,2)}function zW(t,e){return qt(t.getFullYear()%100,e,2)}function YW(t,e){return t=zk(t),qt(t.getFullYear()%100,e,2)}function UW(t,e){return qt(t.getFullYear()%1e4,e,4)}function jW(t,e){var n=t.getDay();return t=n>=4||n===0?Io(t):Io.ceil(t),qt(t.getFullYear()%1e4,e,4)}function XW(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+qt(e/60|0,"0",2)+qt(e%60,"0",2)}function Dk(t,e){return qt(t.getUTCDate(),e,2)}function WW(t,e){return qt(t.getUTCHours(),e,2)}function VW(t,e){return qt(t.getUTCHours()%12||12,e,2)}function GW(t,e){return qt(1+Za.count(wn(t),t),e,3)}function Yk(t,e){return qt(t.getUTCMilliseconds(),e,3)}function HW(t,e){return Yk(t,e)+"000"}function QW(t,e){return qt(t.getUTCMonth()+1,e,2)}function ZW(t,e){return qt(t.getUTCMinutes(),e,2)}function JW(t,e){return qt(t.getUTCSeconds(),e,2)}function KW(t){var e=t.getUTCDay();return e===0?7:e}function tV(t,e){return qt(sr.count(wn(t)-1,t),e,2)}function Uk(t){var e=t.getUTCDay();return e>=4||e===0?No(t):No.ceil(t)}function eV(t,e){return t=Uk(t),qt(No.count(wn(t),t)+(wn(t).getUTCDay()===4),e,2)}function nV(t){return t.getUTCDay()}function rV(t,e){return qt(vs.count(wn(t)-1,t),e,2)}function oV(t,e){return qt(t.getUTCFullYear()%100,e,2)}function iV(t,e){return t=Uk(t),qt(t.getUTCFullYear()%100,e,2)}function sV(t,e){return qt(t.getUTCFullYear()%1e4,e,4)}function aV(t,e){var n=t.getUTCDay();return t=n>=4||n===0?No(t):No.ceil(t),qt(t.getUTCFullYear()%1e4,e,4)}function cV(){return"+0000"}function Pk(){return"%"}function Fk(t){return+t}function qk(t){return Math.floor(+t/1e3)}var zf,Yf,jk,Co,Xk;_3({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 _3(t){return zf=v3(t),Yf=zf.format,jk=zf.parse,Co=zf.utcFormat,Xk=zf.utcParse,zf}function fV(t){return new Date(t)}function uV(t){return t instanceof Date?+t:+new Date(+t)}function Zg(t,e,n,r,o,i,s,a,c,f){var u=od(),p=u.invert,l=u.domain,d=f(".%L"),h=f(":%S"),m=f("%I:%M"),x=f("%I %p"),g=f("%a %d"),y=f("%b %d"),b=f("%B"),w=f("%Y");function _(v){return(c(v)<v?d:a(v)<v?h:s(v)<v?m:i(v)<v?x:r(v)<v?o(v)<v?g:y:n(v)<v?b:w)(v)}return u.invert=function(v){return new Date(p(v))},u.domain=function(v){return arguments.length?l(Array.from(v,uV)):l().map(fV)},u.ticks=function(v){var A=l();return t(A[0],A[A.length-1],v??10)},u.tickFormat=function(v,A){return A==null?_:f(A)},u.nice=function(v){var A=l();return(!v||typeof v.range!="function")&&(v=e(A[0],A[A.length-1],v??10)),v?l(sd(A,v)):u},u.copy=function(){return To(u,Zg(t,e,n,r,o,i,s,a,c,f))},u}function Jg(){return Ee.apply(Zg(g3,y3,bn,Ei,ir,Cr,Ai,Si,je,Yf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Kg(){return Ee.apply(Zg(x3,hd,wn,Ii,sr,Za,Ti,Mi,je,Co).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function yd(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function ty(){var t=0,e=.5,n=1,r=1,o,i,s,a,c,f=Vn,u,p=!1,l;function d(m){return isNaN(m=+m)?l:(m=.5+((m=+u(m))-i)*(r*m<r*i?a:c),f(p?Math.max(0,Math.min(1,m)):m))}d.domain=function(m){return arguments.length?([t,e,n]=m,o=u(t=+t),i=u(e=+e),s=u(n=+n),a=o===i?0:.5/(i-o),c=i===s?0:.5/(s-i),r=i<o?-1:1,d):[t,e,n]},d.clamp=function(m){return arguments.length?(p=!!m,d):p},d.interpolator=function(m){return arguments.length?(f=m,d):f};function h(m){return function(x){var g,y,b;return arguments.length?([g,y,b]=x,f=go(m,[g,y,b]),d):[f(0),f(.5),f(1)]}}return d.range=h(rr),d.rangeRound=h($a),d.unknown=function(m){return arguments.length?(l=m,d):l},function(m){return u=m,o=m(t),i=m(e),s=m(n),a=o===i?0:.5/(i-o),c=i===s?0:.5/(s-i),r=i<o?-1:1,d}}function bd(){var t=vi(ty()(Vn));return t.copy=function(){return yd(t,bd())},nd.apply(t,arguments)}function ey(){var t=l3(ty()).domain([.1,1,10]);return t.copy=function(){return yd(t,ey()).base(t.base())},nd.apply(t,arguments)}function ny(){var t=p3(ty());return t.copy=function(){return yd(t,ny()).constant(t.constant())},nd.apply(t,arguments)}function ry(){var t=d3(ty());return t.copy=function(){return yd(t,ry()).exponent(t.exponent())},nd.apply(t,arguments)}function X(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(r*6,++r*6);return n}var S3=X("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var M3=X("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");var A3=X("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");var T3=X("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0");var E3=X("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");var I3=X("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");var N3=X("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");var C3=X("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");var k3=X("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");var L3=X("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var R3=X("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var ft=t=>I_(t[t.length-1]);var oy=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(X),iy=ft(oy);var sy=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(X),ay=ft(sy);var cy=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(X),fy=ft(cy);var uy=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(X),ly=ft(uy);var wd=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(X),Uf=ft(wd);var py=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(X),dy=ft(py);var vd=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(X),jf=ft(vd);var hy=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(X),my=ft(hy);var xy=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(X),gy=ft(xy);var yy=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(X),by=ft(yy);var wy=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(X),vy=ft(wy);var _y=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(X),Sy=ft(_y);var My=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(X),Ay=ft(My);var Ty=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(X),Ey=ft(Ty);var Iy=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(X),Ny=ft(Iy);var Cy=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(X),ky=ft(Cy);var Ly=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(X),Ry=ft(Ly);var Oy=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(X),$y=ft(Oy);var Dy=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(X),Py=ft(Dy);var Fy=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(X),qy=ft(Fy);var By=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(X),zy=ft(By);var Yy=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(X),Uy=ft(Yy);var jy=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(X),Xy=ft(jy);var Wy=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(X),Vy=ft(Wy);var Gy=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(X),Hy=ft(Gy);var Qy=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(X),Zy=ft(Qy);var Jy=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(X),Ky=ft(Jy);function t1(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}var e1=yf(Cn(300,.5,0),Cn(-240,.5,1));var r1=yf(Cn(-100,.75,.35),Cn(80,1.5,.8)),o1=yf(Cn(260,.75,.35),Cn(80,1.5,.8)),n1=Cn();function i1(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return n1.h=360*t-100,n1.s=1.5-1.5*e,n1.l=.8-.9*e,n1+""}var s1=Le(),lV=Math.PI/3,pV=Math.PI*2/3;function a1(t){var e;return t=(.5-t)*Math.PI,s1.r=255*(e=Math.sin(t))*e,s1.g=255*(e=Math.sin(t+lV))*e,s1.b=255*(e=Math.sin(t+pV))*e,s1+""}function c1(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function f1(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var u1=f1(X("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),l1=f1(X("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),p1=f1(X("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),d1=f1(X("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Ie(t){return function(){return t}}var O3=Math.cos;var Xf=Math.min,_d=Math.sin,Bt=Math.sqrt,$3=1e-12,ec=Math.PI,WTt=ec/2,Wf=2*ec;function h1(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{let r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new ds(e)}var QTt=Array.prototype.slice;function m1(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Wk(t){this._context=t}Wk.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function Ni(t){return new Wk(t)}function x1(t){return t[0]}function g1(t){return t[1]}function Sd(t,e){var n=Ie(!0),r=null,o=Ni,i=null,s=h1(a);t=typeof t=="function"?t:t===void 0?x1:Ie(t),e=typeof e=="function"?e:e===void 0?g1:Ie(e);function a(c){var f,u=(c=m1(c)).length,p,l=!1,d;for(r==null&&(i=o(d=s())),f=0;f<=u;++f)!(f<u&&n(p=c[f],f,c))===l&&((l=!l)?i.lineStart():i.lineEnd()),l&&i.point(+t(p,f,c),+e(p,f,c));if(d)return i=null,d+""||null}return a.x=function(c){return arguments.length?(t=typeof c=="function"?c:Ie(+c),a):t},a.y=function(c){return arguments.length?(e=typeof c=="function"?c:Ie(+c),a):e},a.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Ie(!!c),a):n},a.curve=function(c){return arguments.length?(o=c,r!=null&&(i=o(r)),a):o},a.context=function(c){return arguments.length?(c==null?r=i=null:i=o(r=c),a):r},a}function Vf(t,e,n){var r=null,o=Ie(!0),i=null,s=Ni,a=null,c=h1(f);t=typeof t=="function"?t:t===void 0?x1:Ie(+t),e=typeof e=="function"?e:e===void 0?Ie(0):Ie(+e),n=typeof n=="function"?n:n===void 0?g1:Ie(+n);function f(p){var l,d,h,m=(p=m1(p)).length,x,g=!1,y,b=new Array(m),w=new Array(m);for(i==null&&(a=s(y=c())),l=0;l<=m;++l){if(!(l<m&&o(x=p[l],l,p))===g)if(g=!g)d=l,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),h=l-1;h>=d;--h)a.point(b[h],w[h]);a.lineEnd(),a.areaEnd()}g&&(b[l]=+t(x,l,p),w[l]=+e(x,l,p),a.point(r?+r(x,l,p):b[l],n?+n(x,l,p):w[l]))}if(y)return a=null,y+""||null}function u(){return Sd().defined(o).curve(s).context(i)}return f.x=function(p){return arguments.length?(t=typeof p=="function"?p:Ie(+p),r=null,f):t},f.x0=function(p){return arguments.length?(t=typeof p=="function"?p:Ie(+p),f):t},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Ie(+p),f):r},f.y=function(p){return arguments.length?(e=typeof p=="function"?p:Ie(+p),n=null,f):e},f.y0=function(p){return arguments.length?(e=typeof p=="function"?p:Ie(+p),f):e},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Ie(+p),f):n},f.lineX0=f.lineY0=function(){return u().x(t).y(e)},f.lineY1=function(){return u().x(t).y(n)},f.lineX1=function(){return u().x(r).y(e)},f.defined=function(p){return arguments.length?(o=typeof p=="function"?p:Ie(!!p),f):o},f.curve=function(p){return arguments.length?(s=p,i!=null&&(a=s(i)),f):s},f.context=function(p){return arguments.length?(p==null?i=a=null:a=s(i=p),f):i},f}var y1=class{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}};function D3(t){return new y1(t,!0)}function P3(t){return new y1(t,!1)}var dV=Bt(3),Md={draw(t,e){let n=Bt(e+Xf(e/28,.75))*.59436,r=n/2,o=r*dV;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-o,-r),t.lineTo(o,r),t.moveTo(-o,r),t.lineTo(o,-r)}};var Ci={draw(t,e){let n=Bt(e/ec);t.moveTo(n,0),t.arc(0,0,n,0,Wf)}};var Ad={draw(t,e){let n=Bt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}};var Vk=Bt(1/3),hV=Vk*2,Td={draw(t,e){let n=Bt(e/hV),r=n*Vk;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}};var Ed={draw(t,e){let n=Bt(e)*.62625;t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}};var Id={draw(t,e){let n=Bt(e-Xf(e/7,2))*.87559;t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}};var Nd={draw(t,e){let n=Bt(e),r=-n/2;t.rect(r,r,n,n)}};var Cd={draw(t,e){let n=Bt(e)*.4431;t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}};var mV=.8908130915292852,Gk=_d(ec/10)/_d(7*ec/10),xV=_d(Wf/10)*Gk,gV=-O3(Wf/10)*Gk,kd={draw(t,e){let n=Bt(e*mV),r=xV*n,o=gV*n;t.moveTo(0,-n),t.lineTo(r,o);for(let i=1;i<5;++i){let s=Wf*i/5,a=O3(s),c=_d(s);t.lineTo(c*n,-a*n),t.lineTo(a*r-c*o,c*r+a*o)}t.closePath()}};var F3=Bt(3),Ld={draw(t,e){let n=-Bt(e/(F3*3));t.moveTo(0,n*2),t.lineTo(-F3*n,-n),t.lineTo(F3*n,-n),t.closePath()}};var yV=Bt(3),Rd={draw(t,e){let n=Bt(e)*.6824,r=n/2,o=n*yV/2;t.moveTo(0,-n),t.lineTo(o,r),t.lineTo(-o,r),t.closePath()}};var kr=-.5,Lr=Bt(3)/2,q3=1/Bt(12),bV=(q3/2+1)*3,Od={draw(t,e){let n=Bt(e/bV),r=n/2,o=n*q3,i=r,s=n*q3+n,a=-i,c=s;t.moveTo(r,o),t.lineTo(i,s),t.lineTo(a,c),t.lineTo(kr*r-Lr*o,Lr*r+kr*o),t.lineTo(kr*i-Lr*s,Lr*i+kr*s),t.lineTo(kr*a-Lr*c,Lr*a+kr*c),t.lineTo(kr*r+Lr*o,kr*o-Lr*r),t.lineTo(kr*i+Lr*s,kr*s-Lr*i),t.lineTo(kr*a+Lr*c,kr*c-Lr*a),t.closePath()}};var Gf={draw(t,e){let n=Bt(e-Xf(e/6,1.7))*.6189;t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}};var b1=[Ci,Ad,Td,Nd,kd,Ld,Od],B3=[Ci,Id,Gf,Rd,Md,Cd,Ed];function Rr(){}function Hf(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function $d(t){this._context=t}$d.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:Hf(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Hf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function z3(t){return new $d(t)}function Hk(t){this._context=t}Hk.prototype={areaStart:Rr,areaEnd:Rr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Hf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Y3(t){return new Hk(t)}function Qk(t){this._context=t}Qk.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Hf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function U3(t){return new Qk(t)}function Zk(t,e){this._basis=new $d(t),this._beta=e}Zk.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],o=e[0],i=t[n]-r,s=e[n]-o,a=-1,c;++a<=n;)c=a/n,this._basis.point(this._beta*t[a]+(1-this._beta)*(r+c*i),this._beta*e[a]+(1-this._beta)*(o+c*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var j3=function t(e){function n(r){return e===1?new $d(r):new Zk(r,e)}return n.beta=function(r){return t(+r)},n}(.85);function Qf(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function w1(t,e){this._context=t,this._k=(1-e)/6}w1.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:Qf(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Qf(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var X3=function t(e){function n(r){return new w1(r,e)}return n.tension=function(r){return t(+r)},n}(0);function v1(t,e){this._context=t,this._k=(1-e)/6}v1.prototype={areaStart:Rr,areaEnd:Rr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Qf(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var W3=function t(e){function n(r){return new v1(r,e)}return n.tension=function(r){return t(+r)},n}(0);function _1(t,e){this._context=t,this._k=(1-e)/6}_1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Qf(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var V3=function t(e){function n(r){return new _1(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Dd(t,e,n){var r=t._x1,o=t._y1,i=t._x2,s=t._y2;if(t._l01_a>$3){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,o=(o*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>$3){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*f+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*f+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,o,i,s,t._x2,t._y2)}function Jk(t,e){this._context=t,this._alpha=e}Jk.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Dd(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var G3=function t(e){function n(r){return e?new Jk(r,e):new w1(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function Kk(t,e){this._context=t,this._alpha=e}Kk.prototype={areaStart:Rr,areaEnd:Rr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Dd(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var H3=function t(e){function n(r){return e?new Kk(r,e):new v1(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function tL(t,e){this._context=t,this._alpha=e}tL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Dd(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Q3=function t(e){function n(r){return e?new tL(r,e):new _1(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function eL(t){this._context=t}eL.prototype={areaStart:Rr,areaEnd:Rr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Z3(t){return new eL(t)}function nL(t){return t<0?-1:1}function rL(t,e,n){var r=t._x1-t._x0,o=e-t._x1,i=(t._y1-t._y0)/(r||o<0&&-0),s=(n-t._y1)/(o||r<0&&-0),a=(i*o+s*r)/(r+o);return(nL(i)+nL(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(a))||0}function oL(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function J3(t,e,n){var r=t._x0,o=t._y0,i=t._x1,s=t._y1,a=(i-r)/3;t._context.bezierCurveTo(r+a,o+a*e,i-a,s-a*n,i,s)}function S1(t){this._context=t}S1.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:J3(this,this._t0,oL(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,J3(this,oL(this,n=rL(this,t,e)),n);break;default:J3(this,this._t0,n=rL(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function iL(t){this._context=new sL(t)}(iL.prototype=Object.create(S1.prototype)).point=function(t,e){S1.prototype.point.call(this,e,t)};function sL(t){this._context=t}sL.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,o,i){this._context.bezierCurveTo(e,t,r,n,i,o)}};function K3(t){return new S1(t)}function tS(t){return new iL(t)}function cL(t){this._context=t}cL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=aL(t),o=aL(e),i=0,s=1;s<n;++i,++s)this._context.bezierCurveTo(r[0][i],o[0][i],r[1][i],o[1][i],t[s],e[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function aL(t){var e,n=t.length-1,r,o=new Array(n),i=new Array(n),s=new Array(n);for(o[0]=0,i[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)o[e]=1,i[e]=4,s[e]=4*t[e]+2*t[e+1];for(o[n-1]=2,i[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=o[e]/i[e-1],i[e]-=r,s[e]-=r*s[e-1];for(o[n-1]=s[n-1]/i[n-1],e=n-2;e>=0;--e)o[e]=(s[e]-o[e+1])/i[e];for(i[n-1]=(t[n]+o[n-1])/2,e=0;e<n-1;++e)i[e]=2*t[e+1]-o[e+1];return[o,i]}function eS(t){return new cL(t)}function M1(t,e){this._context=t,this._t=e}M1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function nS(t){return new M1(t,.5)}function rS(t){return new M1(t,0)}function oS(t){return new M1(t,1)}var Pd=t=>()=>t;function iS(t,{sourceEvent:e,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function ar(t,e,n){this.k=t,this.x=e,this.y=n}ar.prototype={constructor:ar,scale:function(t){return t===1?this:new ar(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new ar(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fd=new ar(1,0,0);sS.prototype=ar.prototype;function sS(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Fd;return t.__zoom}function A1(t){t.stopImmediatePropagation()}function Zf(t){t.preventDefault(),t.stopImmediatePropagation()}function wV(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function vV(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function fL(){return this.__zoom||Fd}function _V(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function SV(){return navigator.maxTouchPoints||"ontouchstart"in this}function MV(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function aS(){var t=wV,e=vV,n=MV,r=_V,o=SV,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=O_,f=Na("start","zoom","end"),u,p,l,d=500,h=150,m=0,x=10;function g(S){S.property("__zoom",fL).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",N).filter(o).on("touchstart.zoom",M).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(S,I,C,L){var D=S.selection?S.selection():S;D.property("__zoom",fL),S!==D?_(S,I,C,L):D.interrupt().each(function(){v(this,arguments).event(L).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},g.scaleBy=function(S,I,C,L){g.scaleTo(S,function(){var D=this.__zoom.k,$=typeof I=="function"?I.apply(this,arguments):I;return D*$},C,L)},g.scaleTo=function(S,I,C,L){g.transform(S,function(){var D=e.apply(this,arguments),$=this.__zoom,P=C==null?w(D):typeof C=="function"?C.apply(this,arguments):C,F=$.invert(P),q=typeof I=="function"?I.apply(this,arguments):I;return n(b(y($,q),P,F),D,s)},C,L)},g.translateBy=function(S,I,C,L){g.transform(S,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof C=="function"?C.apply(this,arguments):C),e.apply(this,arguments),s)},null,L)},g.translateTo=function(S,I,C,L,D){g.transform(S,function(){var $=e.apply(this,arguments),P=this.__zoom,F=L==null?w($):typeof L=="function"?L.apply(this,arguments):L;return n(Fd.translate(F[0],F[1]).scale(P.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof C=="function"?-C.apply(this,arguments):-C),$,s)},L,D)};function y(S,I){return I=Math.max(i[0],Math.min(i[1],I)),I===S.k?S:new ar(I,S.x,S.y)}function b(S,I,C){var L=I[0]-C[0]*S.k,D=I[1]-C[1]*S.k;return L===S.x&&D===S.y?S:new ar(S.k,L,D)}function w(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function _(S,I,C,L){S.on("start.zoom",function(){v(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){v(this,arguments).event(L).end()}).tween("zoom",function(){var D=this,$=arguments,P=v(D,$).event(L),F=e.apply(D,$),q=C==null?w(F):typeof C=="function"?C.apply(D,$):C,V=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),K=D.__zoom,et=typeof I=="function"?I.apply(D,$):I,rt=c(K.invert(q).concat(V/K.k),et.invert(q).concat(V/et.k));return function(j){if(j===1)j=et;else{var nt=rt(j),Y=V/nt[2];j=new ar(Y,q[0]-nt[0]*Y,q[1]-nt[1]*Y)}P.zoom(null,j)}})}function v(S,I,C){return!C&&S.__zooming||new A(S,I)}function A(S,I){this.that=S,this.args=I,this.active=0,this.sourceEvent=null,this.extent=e.apply(S,I),this.taps=0}A.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,I){return this.mouse&&S!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var I=Nt(this.that).datum();f.call(S,this.that,new iS(S,{sourceEvent:this.sourceEvent,target:g,type:S,transform:this.that.__zoom,dispatch:f}),I)}};function T(S,...I){if(!t.apply(this,arguments))return;var C=v(this,I).event(S),L=this.__zoom,D=Math.max(i[0],Math.min(i[1],L.k*Math.pow(2,r.apply(this,arguments)))),$=hn(S);if(C.wheel)(C.mouse[0][0]!==$[0]||C.mouse[0][1]!==$[1])&&(C.mouse[1]=L.invert(C.mouse[0]=$)),clearTimeout(C.wheel);else{if(L.k===D)return;C.mouse=[$,L.invert($)],yo(this),C.start()}Zf(S),C.wheel=setTimeout(P,h),C.zoom("mouse",n(b(y(L,D),C.mouse[0],C.mouse[1]),C.extent,s));function P(){C.wheel=null,C.end()}}function E(S,...I){if(l||!t.apply(this,arguments))return;var C=S.currentTarget,L=v(this,I,!0).event(S),D=Nt(S.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",V,!0),$=hn(S,C),P=S.clientX,F=S.clientY;hp(S.view),A1(S),L.mouse=[$,this.__zoom.invert($)],yo(this),L.start();function q(K){if(Zf(K),!L.moved){var et=K.clientX-P,rt=K.clientY-F;L.moved=et*et+rt*rt>m}L.event(K).zoom("mouse",n(b(L.that.__zoom,L.mouse[0]=hn(K,C),L.mouse[1]),L.extent,s))}function V(K){D.on("mousemove.zoom mouseup.zoom",null),mp(K.view,L.moved),Zf(K),L.event(K).end()}}function N(S,...I){if(t.apply(this,arguments)){var C=this.__zoom,L=hn(S.changedTouches?S.changedTouches[0]:S,this),D=C.invert(L),$=C.k*(S.shiftKey?.5:2),P=n(b(y(C,$),L,D),e.apply(this,I),s);Zf(S),a>0?Nt(this).transition().duration(a).call(_,P,L,S):Nt(this).call(g.transform,P,L,S)}}function M(S,...I){if(t.apply(this,arguments)){var C=S.touches,L=C.length,D=v(this,I,S.changedTouches.length===L).event(S),$,P,F,q;for(A1(S),P=0;P<L;++P)F=C[P],q=hn(F,this),q=[q,this.__zoom.invert(q),F.identifier],D.touch0?!D.touch1&&D.touch0[2]!==q[2]&&(D.touch1=q,D.taps=0):(D.touch0=q,$=!0,D.taps=1+!!u);u&&(u=clearTimeout(u)),$&&(D.taps<2&&(p=q[0],u=setTimeout(function(){u=null},d)),yo(this),D.start())}}function k(S,...I){if(this.__zooming){var C=v(this,I).event(S),L=S.changedTouches,D=L.length,$,P,F,q;for(Zf(S),$=0;$<D;++$)P=L[$],F=hn(P,this),C.touch0&&C.touch0[2]===P.identifier?C.touch0[0]=F:C.touch1&&C.touch1[2]===P.identifier&&(C.touch1[0]=F);if(P=C.that.__zoom,C.touch1){var V=C.touch0[0],K=C.touch0[1],et=C.touch1[0],rt=C.touch1[1],j=(j=et[0]-V[0])*j+(j=et[1]-V[1])*j,nt=(nt=rt[0]-K[0])*nt+(nt=rt[1]-K[1])*nt;P=y(P,Math.sqrt(j/nt)),F=[(V[0]+et[0])/2,(V[1]+et[1])/2],q=[(K[0]+rt[0])/2,(K[1]+rt[1])/2]}else if(C.touch0)F=C.touch0[0],q=C.touch0[1];else return;C.zoom("touch",n(b(P,F,q),C.extent,s))}}function O(S,...I){if(this.__zooming){var C=v(this,I).event(S),L=S.changedTouches,D=L.length,$,P;for(A1(S),l&&clearTimeout(l),l=setTimeout(function(){l=null},d),$=0;$<D;++$)P=L[$],C.touch0&&C.touch0[2]===P.identifier?delete C.touch0:C.touch1&&C.touch1[2]===P.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),C.taps===2&&(P=hn(P,this),Math.hypot(p[0]-P[0],p[1]-P[1])<x)){var F=Nt(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return g.wheelDelta=function(S){return arguments.length?(r=typeof S=="function"?S:Pd(+S),g):r},g.filter=function(S){return arguments.length?(t=typeof S=="function"?S:Pd(!!S),g):t},g.touchable=function(S){return arguments.length?(o=typeof S=="function"?S:Pd(!!S),g):o},g.extent=function(S){return arguments.length?(e=typeof S=="function"?S:Pd([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),g):e},g.scaleExtent=function(S){return arguments.length?(i[0]=+S[0],i[1]=+S[1],g):[i[0],i[1]]},g.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],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(S){return arguments.length?(n=S,g):n},g.duration=function(S){return arguments.length?(a=+S,g):a},g.interpolate=function(S){return arguments.length?(c=S,g):c},g.on=function(){var S=f.on.apply(f,arguments);return S===f?g:S},g.clickDistance=function(S){return arguments.length?(m=(S=+S)*S,g):Math.sqrt(m)},g.tapDistance=function(S){return arguments.length?(x=+S,g):x},g}function oe(t){return t!=null&&!Number.isNaN(t)}function We(t,e){return+oe(e)-+oe(t)||yt(t,e)}function nc(t,e){return+oe(e)-+oe(t)||An(t,e)}function qd(t){return t!=null&&`${t}`!=""}function Jf(t){return isFinite(t)?t:NaN}function Pn(t){return t>0&&isFinite(t)?t:NaN}function _s(t){return t<0&&isFinite(t)?t:NaN}function Kf(t,e){if(t instanceof Date||(t=new Date(+t)),isNaN(t))return typeof e=="function"?e(t):e;let n=t.getUTCHours(),r=t.getUTCMinutes(),o=t.getUTCSeconds(),i=t.getUTCMilliseconds();return`${AV(t.getUTCFullYear(),4)}-${ki(t.getUTCMonth()+1,2)}-${ki(t.getUTCDate(),2)}${n||r||o||i?`T${ki(n,2)}:${ki(r,2)}${o||i?`:${ki(o,2)}${i?`.${ki(i,3)}`:""}`:""}Z`:""}`}function AV(t){return t<0?`-${ki(-t,6)}`:t>9999?`+${ki(t,6)}`:ki(t,4)}function ki(t,e){return`${t}`.padStart(e,"0")}var TV=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function Bd(t,e){return TV.test(t+="")?new Date(t):typeof e=="function"?e(t):e}function Li(t){if(t==null)return;let e=t[0],n=t[t.length-1];return An(e,n)}var eu=1e3,Ms=eu*60,As=Ms*60,Lo=As*24,ko=Lo*7,rc=Lo*30,Ss=Lo*365,cS=[["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",eu],["5 seconds",5*eu],["15 seconds",15*eu],["30 seconds",30*eu],["minute",Ms],["5 minutes",5*Ms],["15 minutes",15*Ms],["30 minutes",30*Ms],["hour",As],["3 hours",3*As],["6 hours",6*As],["12 hours",12*As],["day",Lo],["2 days",2*Lo],["week",ko],["2 weeks",2*ko],["month",rc],["3 months",3*rc],["6 months",6*rc],["year",Ss],["2 years",2*Ss],["5 years",5*Ss],["10 years",10*Ss],["20 years",20*Ss],["50 years",50*Ss],["100 years",100*Ss]],fS=new Map([["second",eu],["minute",Ms],["hour",As],["day",Lo],["monday",ko],["tuesday",ko],["wednesday",ko],["thursday",ko],["friday",ko],["saturday",ko],["sunday",ko],["week",ko],["month",rc],["year",Ss]]),lL=new Map([["second",je],["minute",Si],["hour",Ai],["day",Cr],["monday",ws],["tuesday",Ug],["wednesday",jg],["thursday",Io],["friday",Xg],["saturday",Wg],["sunday",ir],["week",ir],["month",Ei],["year",bn]]),uS=new Map([["second",je],["minute",Mi],["hour",Ti],["day",Ja],["monday",vs],["tuesday",Vg],["wednesday",Gg],["thursday",No],["friday",Hg],["saturday",Qg],["sunday",sr],["week",sr],["month",Ii],["year",wn]]),nu=Symbol("intervalDuration"),E1=Symbol("intervalType");for(let[t,e]of lL)e[nu]=fS.get(t),e[E1]="time";for(let[t,e]of uS)e[nu]=fS.get(t),e[E1]="utc";var zd=[["year",wn,"utc"],["month",Ii,"utc"],["day",Ja,"utc",6*rc],["hour",Ti,"utc",3*Lo],["minute",Mi,"utc",6*As],["second",je,"utc",30*Ms]],T1=[["year",bn,"time"],["month",Ei,"time"],["day",Cr,"time",6*rc],["hour",Ai,"time",3*Lo],["minute",Si,"time",6*As],["second",je,"time",30*Ms]],EV=[zd[0],T1[0],zd[1],T1[1],zd[2],T1[2],...zd.slice(3)];function I1(t){let e=`${t}`.toLowerCase();e.endsWith("s")&&(e=e.slice(0,-1));let n=1,r=/^(?:(\d+)\s+)/.exec(e);switch(r&&(e=e.slice(r[0].length),n=+r[1]),e){case"quarter":e="month",n*=3;break;case"half":e="month",n*=6;break}let o=uS.get(e);if(!o)throw new Error(`unknown interval: ${t}`);if(n>1&&!o.every)throw new Error(`non-periodic interval: ${e}`);return[e,n]}function Yd(t){return pL(I1(t),"time")}function oc(t){return pL(I1(t),"utc")}function pL([t,e],n){let r=(n==="time"?lL:uS).get(t);return e>1&&(r=r.every(e),r[nu]=fS.get(t)*e,r[E1]=n),r}function lS(t,e){if(!(e>1))return;let n=t[nu];if(!cS.some(([,o])=>o===n)||n%Lo===0&&Lo<n&&n<rc)return;let[r]=cS[Xr(([,o])=>Math.log(o)).center(cS,Math.log(n*e))];return(t[E1]==="time"?Yd:oc)(r)}function uL(t,e,n){let r=e==="time"?Yf:Co;if(n==null)return r(t==="year"?"%Y":t==="month"?"%Y-%m":t==="day"?"%Y-%m-%d":t==="hour"||t==="minute"?"%Y-%m-%dT%H:%M":t==="second"?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M:%S.%L");let o=IV(n);switch(t){case"millisecond":return tu(r(".%L"),r(":%M:%S"),o);case"second":return tu(r(":%S"),r("%-I:%M"),o);case"minute":return tu(r("%-I:%M"),r("%p"),o);case"hour":return tu(r("%-I %p"),r("%b %-d"),o);case"day":return tu(r("%-d"),r("%b"),o);case"month":return tu(r("%b"),r("%Y"),o);case"year":return r("%Y")}throw new Error("unable to format time ticks")}function IV(t){return t==="left"||t==="right"?(e,n)=>`
3
+ ${e}
4
+ ${n}`:t==="top"?(e,n)=>`${n}
5
+ ${e}`:(e,n)=>`${e}
6
+ ${n}`}function NV(t){return t==="time"?T1:t==="utc"?zd:EV}function dL(t,e,n){let r=kt(_x(e,(o,i)=>Math.abs(i-o)));if(r<1e3)return uL("millisecond","utc",n);for(let[o,i,s,a]of NV(t)){if(r>a||o==="hour"&&!r)break;if(e.every(c=>i.floor(c)>=c))return uL(o,s,n)}}function tu(t,e,n){return(r,o,i)=>{let s=t(r,o),a=e(r,o),c=o-Li(i);return o!==c&&i[c]!==void 0&&a===e(i[c],c)?s:n(s,a)}}var Ud=Object.getPrototypeOf(Uint8Array),CV=Object.prototype.toString;function Gn(t){return t instanceof Array||t instanceof Ud}function mL(t){return t instanceof Ud&&!kV(t)}function xL(t){return t?.prototype instanceof Ud&&!LV(t)}function kV(t){return t instanceof BigInt64Array||t instanceof BigUint64Array}function LV(t){return t===BigInt64Array||t===BigUint64Array}var dS=Symbol("reindex");function ut(t,e,n){let r=typeof e;return r==="string"?IL(t)?hS(t.getChild(e),n):hL(t,mS(e),n):r==="function"?hL(t,e,n):r==="number"||e instanceof Date||r==="boolean"?Et(t,ue(e),n):typeof e?.transform=="function"?pS(e.transform(t),n):RV(pS(e,n),t?.[dS])}function RV(t,e){return t!=null&&e?Xd(t,e):t}function hL(t,e,n){return Et(t,xL(n)?(r,o)=>xS(e(r,o)):e,n)}function pS(t,e){return e===void 0?cr(t):NL(t)?hS(t,e):t instanceof e?t:e.from(t,xL(e)&&!mL(t)?xS:void 0)}function hS(t,e){return t==null?t:(e===void 0||e===Array)&&DV(t.type)?gS(t.toArray()):pS(t.toArray(),e)}var Ts=[null],mS=t=>e=>{let n=e[t];return n===void 0&&e.type==="Feature"?e.properties?.[t]:n},Zt={transform:Fn},W={transform:t=>t};var jd=()=>1,gL=()=>!0,be=t=>t==null?t:`${t}`,Dt=t=>t==null?t:+t;var ic=t=>t?t[0]:void 0,Es=t=>t?t[1]:void 0,yL=t=>t?t[2]:void 0,ue=t=>()=>t;function ru(t){let e=+`${t}`.slice(1)/100;return(n,r)=>In(n,e,r)}function Ne(t){return mL(t)?t:Et(t,xS,Float64Array)}function xS(t){return t==null?NaN:Number(t)}function gS(t){return Et(t,yS)}function yS(t){return t instanceof Date&&!isNaN(t)?t:typeof t=="string"?Bd(t):t==null||isNaN(t=Number(t))?void 0:new Date(t)}function ce(t,e){return t===void 0&&(t=e),t===null?[void 0,"none"]:ks(t)?[void 0,t]:[t,void 0]}function Ut(t,e){return t===void 0&&(t=e),t===null||typeof t=="number"?[void 0,t]:[t,void 0]}function bS(t,e,n){if(t!=null)return Oe(t,e,n)}function Oe(t,e,n){let r=`${t}`.toLowerCase();if(!n.includes(r))throw new Error(`invalid ${e}: ${t}`);return r}function Ri(t){return IL(t)?t:cr(t)}function cr(t){if(t==null||Gn(t))return t;if(NL(t))return hS(t);switch(t.type){case"FeatureCollection":return t.features;case"GeometryCollection":return t.geometries;case"Feature":case"LineString":case"MultiLineString":case"MultiPoint":case"MultiPolygon":case"Point":case"Polygon":case"Sphere":return[t]}return Array.from(t)}function Et(t,e,n=Array){return t==null?t:t instanceof n?t.map(e):n.from(t,e)}function Is(t,e=Array){return t instanceof e?t.slice():e.from(t)}function wS({x:t,x1:e,x2:n}){return t!==void 0||e!==void 0||n!==void 0}function vS({y:t,y1:e,y2:n}){return t!==void 0||e!==void 0||n!==void 0}function Oi(t){return wS(t)||vS(t)||t.interval!==void 0}function Ve(t){return t?.toString===CV}function Ro(t){return Ve(t)&&(t.type!==void 0||t.domain!==void 0)}function fr(t){return Ve(t)&&typeof t.transform!="function"}function Oo(t){return fr(t)&&t.value===void 0&&t.channel===void 0}function _S(t,e,n,r=W){return e===void 0&&n===void 0?(e=0,n=t===void 0?r:t):e===void 0?e=t===void 0?0:t:n===void 0&&(n=t===void 0?0:t),[e,n]}function me(t,e){return t===void 0&&e===void 0?[ic,Es]:[t,e]}function vn({z:t,fill:e,stroke:n}={}){return t===void 0&&([t]=ce(e)),t===void 0&&([t]=ce(n)),t}function Ns(t){return Gn(t)?t.length:t?.numRows}function Fn(t){let e=Ns(t),n=new Uint32Array(e);for(let r=0;r<e;++r)n[r]=r;return n}function Xd(t,e){return Gn(t)?Et(e,n=>t[n],t.constructor):Et(e,n=>t.at(n))}function ou(t){return t.length===1?(e,n)=>t(Xd(n,e)):t}function $i(t,e,n){return t.subarray?t.subarray(e,n):t.slice(e,n)}function Or(t){return t!==null&&typeof t=="object"?t.valueOf():t}function N1(t,e){if(e[t]!==void 0)return e[t];switch(t){case"x1":case"x2":t="x";break;case"y1":case"y2":t="y";break}return e[t]}function Ge(t){let e;return[{transform:()=>e,label:un(t)},n=>e=n]}function fn(t){return t==null?[t]:Ge(t)}function un(t,e){return typeof t=="string"?t:t&&t.label!==void 0?t.label:e}function iu(t,e){return{transform(n){let r=t.transform(n),o=e.transform(n);return fe(r)||fe(o)?Et(r,(i,s)=>new Date((+r[s]+ +o[s])/2)):Et(r,(i,s)=>(+r[s]+ +o[s])/2,Float64Array)},label:t.label}}function sc(t,e){let n=SS(e?.interval,e?.type);return n?Et(t,n):t}function SS(t,e){let n=su(t,e);return n&&(r=>oe(r)?n.floor(r):r)}function su(t,e){if(t!=null){if(typeof t=="number")return MS(t);if(typeof t=="string")return(e==="time"?Yd:oc)(t);if(typeof t.floor!="function")throw new Error("invalid interval; missing floor method");if(typeof t.offset!="function")throw new Error("invalid interval; missing offset method");return t}}function MS(t){t=+t,0<t&&t<1&&Number.isInteger(1/t)&&(t=-1/t);let e=Math.abs(t);return t<0?{floor:n=>Math.floor(n*e)/e,offset:(n,r=1)=>(n*e+Math.floor(r))/e,range:(n,r)=>ye(Math.ceil(n*e),r*e).map(o=>o/e)}:{floor:n=>Math.floor(n/e)*e,offset:(n,r=1)=>n+e*Math.floor(r),range:(n,r)=>ye(Math.ceil(n/e),r/e).map(o=>o*e)}}function $o(t,e){if(t=su(t,e),t&&typeof t.range!="function")throw new Error("invalid interval: missing range method");return t}function bL(t,e){if(t=$o(t,e),t&&typeof t.ceil!="function")throw new Error("invalid interval: missing ceil method");return t}function wL(t){return Cs(t)&&typeof t?.floor=="function"&&t.floor()instanceof Date}function Cs(t){return typeof t?.range=="function"}function $r(t){return t===void 0||fr(t)?t:{value:t}}function vL(t){return t==null?null:{transform:e=>ut(e,t,Float64Array),label:un(t)}}function _L(t){if(!qn(t))return!1;for(let e of t)if(e!=null)return typeof e=="object"&&"0"in e&&"1"in e}function qn(t){return t&&typeof t[Symbol.iterator]=="function"}function C1(t){for(let e of t)if(e!=null)return typeof e!="object"||e instanceof Date}function ie(t){for(let e of t){if(e==null)continue;let n=typeof e;return n==="string"||n==="boolean"}}function fe(t){for(let e of t)if(e!=null)return e instanceof Date}function SL(t){for(let e of t)if(e!=null)return typeof e=="string"&&isNaN(e)&&Bd(e)}function ML(t){for(let e of t)if(e!=null){if(typeof e!="string")return!1;if(e.trim())return!isNaN(e)}}function Di(t){for(let e of t)if(e!=null)return typeof e=="number"}function k1(t,e){let n;for(let r of t)if(r!=null){if(!e(r))return!1;n=!0}return n}var OV=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 ks(t){return typeof t!="string"?!1:(t=t.toLowerCase().trim(),/^#[0-9a-f]{3,8}$/.test(t)||/^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.*\)$/.test(t)||OV.has(t))}function AL(t){return typeof t=="number"&&(0<=t&&t<=1||isNaN(t))}function zt(t){return t==null||Pi(t)}function Pi(t){return/^\s*none\s*$/i.test(t)}function TL(t){return/^\s*round\s*$/i.test(t)}function L1(t,e){return bS(t,e,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function Do(t="middle"){return L1(t,"frameAnchor")}function EL(t={},...e){let n=t;for(let r of e)for(let o in r)if(n[o]===void 0){let i=r[o];n===t?n={...n,[o]:i}:n[o]=i}return n}function $V(t){console.warn("named iterables are deprecated; please use an object instead");let e=new Set;return Object.fromEntries(Array.from(t,n=>{let{name:r}=n;if(r==null)throw new Error("missing name");let o=`${r}`;if(o==="__proto__")throw new Error(`illegal name: ${o}`);if(e.has(o))throw new Error(`duplicate name: ${o}`);return e.add(o),[r,n]}))}function Wd(t){return qn(t)?$V(t):t}function R1(t){return t===!0?t="frame":t===!1?t=null:t!=null&&(t=Oe(t,"clip",["frame","sphere"])),t}function IL(t){return t&&typeof t.getChild=="function"&&typeof t.toArray=="function"&&t.schema&&Array.isArray(t.schema.fields)}function NL(t){return t&&typeof t.toArray=="function"&&t.type}function DV(t){return t&&(t.typeId===8||t.typeId===10)&&t.unit===1}var Dr=Symbol("position"),ur=Symbol("color"),ac=Symbol("radius"),cc=Symbol("length"),fc=Symbol("opacity"),au=Symbol("symbol"),CL=Symbol("projection"),Wt=new Map([["x",Dr],["y",Dr],["fx",Dr],["fy",Dr],["r",ac],["color",ur],["opacity",fc],["symbol",au],["length",cc],["projection",CL]]);function kL(t){return t===Dr||t===CL}function LL(t){return t===Dr||t===ac||t===cc||t===fc}var AS=Math.sqrt(3),TS=2/AS,PV={draw(t,e){let n=Math.sqrt(e/Math.PI),r=n*TS,o=r/2;t.moveTo(0,r),t.lineTo(n,o),t.lineTo(n,-o),t.lineTo(0,-r),t.lineTo(-n,-o),t.lineTo(-n,o),t.closePath()}},ES=new Map([["asterisk",Md],["circle",Ci],["cross",Ad],["diamond",Td],["diamond2",Ed],["hexagon",PV],["plus",Id],["square",Nd],["square2",Cd],["star",kd],["times",Gf],["triangle",Ld],["triangle2",Rd],["wye",Od]]);function IS(t){return t&&typeof t.draw=="function"}function RL(t){return IS(t)?!0:typeof t!="string"?!1:ES.has(t.toLowerCase())}function cu(t){if(t==null||IS(t))return t;let e=ES.get(`${t}`.toLowerCase());if(e)return e;throw new Error(`invalid symbol: ${t}`)}function OL(t){if(t==null||IS(t))return[void 0,t];if(typeof t=="string"){let e=ES.get(`${t}`.toLowerCase());if(e)return[void 0,e]}return[t,void 0]}function Ce({filter:t,sort:e,reverse:n,transform:r,initializer:o,...i}={},s){if(r===void 0&&(t!=null&&(r=kS(t)),e!=null&&!Oo(e)&&(r=NS(r,RS(e))),n&&(r=NS(r,LS))),s!=null&&o!=null)throw new Error("transforms cannot be applied after initializers");return{...i,...(e===null||Oo(e))&&{sort:e},transform:NS(r,s)}}function Kt({filter:t,sort:e,reverse:n,initializer:r,...o}={},i){return r===void 0&&(t!=null&&(r=kS(t)),e!=null&&!Oo(e)&&(r=CS(r,RS(e))),n&&(r=CS(r,LS))),{...o,...(e===null||Oo(e))&&{sort:e},initializer:CS(r,i)}}function NS(t,e){return t==null?e===null?void 0:e:e==null?t===null?void 0:t:function(n,r,o){return{data:n,facets:r}=t.call(this,n,r,o),e.call(this,Ri(n),r,o)}}function CS(t,e){return t==null?e===null?void 0:e:e==null?t===null?void 0:t:function(n,r,o,...i){let s,a,c,f,u,p;return{data:a=n,facets:c=r,channels:s}=t.call(this,n,r,o,...i),{data:u=a,facets:p=c,channels:f}=e.call(this,a,c,{...o,...s},...i),{data:u,facets:p,channels:{...s,...f}}}}function O1(t,e){return(t.initializer!=null?Kt:Ce)(t,e)}function $L(t,e){return O1(e,kS(t))}function kS(t){return(e,n)=>{let r=ut(e,t);return{data:e,facets:n.map(o=>o.filter(i=>r[i]))}}}function DL({sort:t,...e}={}){return{...O1(e,LS),sort:Oo(t)?t:null}}function LS(t,e){return{data:t,facets:e.map(n=>n.slice().reverse())}}function PL({seed:t,sort:e,...n}={}){return{...O1(n,FL(t==null?Math.random:Wa(t))),sort:Oo(e)?e:null}}function $1(t,{sort:e,...n}={}){return{...(fr(t)&&t.channel!==void 0?Kt:O1)(n,RS(t)),sort:Oo(e)?e:null}}function RS(t){return(typeof t=="function"&&t.length!==1?FV:FL)(t)}function FV(t){return(e,n)=>{let r=Gn(e)?(o,i)=>t(e[o],e[i]):(o,i)=>t(e.get(o),e.get(i));return{data:e,facets:n.map(o=>o.slice().sort(r))}}}function FL(t){let e,n;({channel:e,value:t,order:n}={...$r(t)});let r=e?.startsWith("-");if(r&&(e=e.slice(1)),n===void 0&&(n=r?nc:We),typeof n!="function")switch(`${n}`.toLowerCase()){case"ascending":n=We;break;case"descending":n=nc;break;default:throw new Error(`invalid order: ${n}`)}return(o,i,s)=>{let a;if(e===void 0)a=ut(o,t);else{if(s===void 0)throw new Error("channel sort requires an initializer");if(a=s[e],!a)return{};a=a.value}let c=(f,u)=>n(a[f],a[u]);return{data:o,facets:i.map(f=>f.slice().sort(c))}}}function Gd(t,e){return D1(null,null,t,e)}function Ls(t={y:"count"},e={}){let{x:n=W}=e;if(n==null)throw new Error("missing channel: x");return D1(n,null,t,e)}function Rs(t={x:"count"},e={}){let{y:n=W}=e;if(n==null)throw new Error("missing channel: y");return D1(null,n,t,e)}function Hd(t={fill:"count"},e={}){let{x:n,y:r}=e;if([n,r]=me(n,r),n==null)throw new Error("missing channel: x");if(r==null)throw new Error("missing channel: y");return D1(n,r,t,e)}function D1(t,e,{data:n=q1,filter:r,sort:o,reverse:i,...s}={},a={}){s=$S(s,a),n=UL(n,W),o=o==null?void 0:zL("sort",o,a),r=r==null?void 0:YL("filter",r,a);let[c,f]=fn(t),[u,p]=fn(e),{z:l,fill:d,stroke:h,x1:m,x2:x,y1:g,y2:y,...b}=a,[w,_]=fn(l),[v]=ce(d),[A]=ce(h),[T,E]=fn(v),[N,M]=fn(A);return{..."z"in a&&{z:w||l},..."fill"in a&&{fill:T||d},..."stroke"in a&&{stroke:N||h},...Ce(b,(k,O,S)=>{let I=sc(ut(k,t),S?.x),C=sc(ut(k,e),S?.y),L=ut(k,l),D=ut(k,v),$=ut(k,A),P=Qd(s,{z:L,fill:D,stroke:$}),F=[],q=[],V=I&&f([]),K=C&&p([]),et=L&&_([]),rt=D&&E([]),j=$&&M([]),nt=0;for(let Y of s)Y.initialize(k);o&&o.initialize(k),r&&r.initialize(k);for(let Y of O){let G=[];for(let tt of s)tt.scope("facet",Y);o&&o.scope("facet",Y),r&&r.scope("facet",Y);for(let[tt,B]of Po(Y,P))for(let[_t,ct]of Po(B,C))for(let[Ct,Lt]of Po(ct,I)){let Z={data:k};if(I&&(Z.x=Ct),C&&(Z.y=_t),P&&(Z.z=tt),!(r&&!r.reduce(Lt,Z))){G.push(nt++),q.push(n.reduceIndex(Lt,k,Z)),I&&V.push(Ct),C&&K.push(_t),L&&et.push(P===L?tt:L[Lt[0]]),D&&rt.push(P===D?tt:D[Lt[0]]),$&&j.push(P===$?tt:$[Lt[0]]);for(let jt of s)jt.reduce(Lt,Z);o&&o.reduce(Lt,Z)}}F.push(G)}return DS(F,o,i),{data:q,facets:F}}),...!Fo(s,"x")&&(c?{x:c}:{x1:m,x2:x}),...!Fo(s,"y")&&(u?{y:u}:{y1:g,y2:y}),...Object.fromEntries(s.map(({name:k,output:O})=>[k,O]))}}function Fo(t,...e){for(let{name:n}of t)if(e.includes(n))return!0;return!1}function OS(t,e,n=P1){let r=Object.entries(t);return e.title!=null&&t.title===void 0&&r.push(["title",jV]),e.href!=null&&t.href===void 0&&r.push(["href",B1]),r.filter(([,o])=>o!==void 0).map(([o,i])=>i===null?qV(o):n(o,i,e))}function P1(t,e,n,r=F1){let o;Ve(e)&&"reduce"in e&&(o=e.scale,e=e.reduce);let i=r(t,e,n),[s,a]=Ge(i.label),c;return{name:t,output:o===void 0?s:{value:s,scale:o},initialize(f){i.initialize(f),c=a([])},scope(f,u){i.scope(f,u)},reduce(f,u){c.push(i.reduce(f,u))}}}function qV(t){return{name:t,initialize(){},scope(){},reduce(){}}}function F1(t,e,n,r=fu){let o=N1(t,n),i=r(e,o),s,a;return{label:un(i===Vd?null:o,i.label),initialize(c){s=o===void 0?c:ut(c,o),i.scope==="data"&&(a=i.reduceIndex(Fn(c),s))},scope(c,f){i.scope===c&&(a=i.reduceIndex(f,s))},reduce(c,f){return i.scope==null?i.reduceIndex(c,s,f):i.reduceIndex(c,s,a,f)}}}function Po(t,e){return e?rn(t,n=>e[n]):[[,t]]}function fu(t,e,n=BV){if(t==null)return n(t);if(typeof t.reduceIndex=="function")return t;if(typeof t.reduce=="function"&&Ve(t))return YV(t);if(typeof t=="function")return UV(t);if(/^p\d{2}$/i.test(t))return Fi(ru(t));switch(`${t}`.toLowerCase()){case"first":return B1;case"last":return XV;case"identity":return q1;case"count":return Vd;case"distinct":return WV;case"sum":return e==null?Vd:VV;case"proportion":return BL(e,"data");case"proportion-facet":return BL(e,"facet");case"deviation":return Fi(Mr);case"min":return Fi(It);case"min-index":return Fi(bx);case"max":return Fi(kt);case"max-index":return Fi(yx);case"mean":return qL(pi);case"median":return qL(Vr);case"variance":return Fi(ss);case"mode":return Fi(pf)}return n(t)}function BV(t){throw new Error(`invalid reduce: ${t}`)}function $S(t,e){return OS(t,e,zL)}function zL(t,e,n){return P1(t,e,n,YL)}function YL(t,e,n){return F1(t,e,n,UL)}function UL(t,e){return fu(t,e,zV)}function zV(t){switch(`${t}`.toLowerCase()){case"x":return GV;case"y":return HV;case"z":return PS}throw new Error(`invalid group reduce: ${t}`)}function Qd(t,e){for(let n in e){let r=e[n];if(r!==void 0&&!t.some(o=>o.name===n))return r}}function DS(t,e,n){if(e){let r=e.output.transform(),o=(i,s)=>We(r[i],r[s]);t.forEach(i=>i.sort(o))}n&&t.forEach(r=>r.reverse())}function YV(t){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...t,reduceIndex:t.reduce.bind(t)}}function UV(t){return{reduceIndex(e,n,r){return t(Xd(n,e),r)}}}function Fi(t){return{reduceIndex(e,n){return t(e,r=>n[r])}}}function qL(t){return{reduceIndex(e,n){let r=t(e,o=>n[o]);return fe(n)?new Date(r):r}}}var q1={reduceIndex(t,e){return Xd(e,t)}},B1={reduceIndex(t,e){return e[t[0]]}},jV={reduceIndex(t,e){let r=ui(Wr(t,i=>i.length,i=>e[i]),Es),o=r.slice(-5).reverse();if(o.length<r.length){let i=r.slice(0,-4);o[4]=[`\u2026 ${i.length.toLocaleString("en-US")} more`,sn(i,Es)]}return o.map(([i,s])=>`${i} (${s.toLocaleString("en-US")})`).join(`
7
+ `)}},XV={reduceIndex(t,e){return e[t[t.length-1]]}},Vd={label:"Frequency",reduceIndex(t){return t.length}},WV={label:"Distinct",reduceIndex(t,e){let n=new En;for(let r of t)n.add(e[r]);return n.size}},VV=Fi(sn);function BL(t,e){return t==null?{scope:e,label:"Frequency",reduceIndex:(n,r,o=1)=>n.length/o}:{scope:e,reduceIndex:(n,r,o=1)=>sn(n,i=>r[i])/o}}var GV={reduceIndex(t,e,{x:n}){return n}},HV={reduceIndex(t,e,{y:n}){return n}},PS={reduceIndex(t,e,{z:n}){return n}};function jL(t){if(typeof t!="function")throw new Error(`invalid test function: ${t}`);return{reduceIndex(e,n,{data:r}){return n[e.find(Gn(r)?o=>t(r[o],o,r):o=>t(r.get(o),o,r))]}}}function uu(t,{scale:e,type:n,value:r,filter:o,hint:i,label:s=un(r)},a){return i===void 0&&typeof r?.transform=="function"&&(i=r.hint),qS(a,{scale:e,type:n,value:ut(t,r),label:s,filter:o,hint:i})}function z1(t,e){return Object.fromEntries(Object.entries(t).map(([n,r])=>[n,uu(e,r,n)]))}function lu(t,e){let n=Object.fromEntries(Object.entries(t).map(([r,{scale:o,value:i}])=>{let s=o==null?null:e[o];return[r,s==null?i:Et(i,s)]}));return n.channels=t,n}function qS(t,e){let{scale:n,value:r}=e;if(n===!0||n==="auto")switch(t){case"fill":case"stroke":case"color":e.scale=n!==!0&&k1(r,ks)?null:"color",e.defaultScale="color";break;case"fillOpacity":case"strokeOpacity":case"opacity":e.scale=n!==!0&&k1(r,AL)?null:"opacity",e.defaultScale="opacity";break;case"symbol":n!==!0&&k1(r,RL)?(e.scale=null,e.value=Et(r,cu)):e.scale="symbol",e.defaultScale="symbol";break;default:e.scale=Wt.has(t)?t:null;break}else if(n===!1)e.scale=null;else if(n!=null&&!Wt.has(n))throw new Error(`unknown scale: ${n}`);return e}function WL(t,e,n,r,o){let{order:i,reverse:s,reduce:a=!0,limit:c}=o;for(let f in o){if(!Wt.has(f))continue;let{value:u,order:p=i,reverse:l=s,reduce:d=a,limit:h=c}=$r(o[f]),m=u?.startsWith("-");if(m&&(u=u.slice(1)),p=p===void 0?m!==(u==="width"||u==="height")?GL:VL:JV(p),d==null||d===!1)continue;let x=f==="fx"||f==="fy"?ZV(e,r[f]):QV(n,f);if(!x)throw new Error(`missing channel for scale: ${f}`);let g=x.value,[y=0,b=1/0]=qn(h)?h:h<0?[h]:[0,h];if(u==null)x.domain=()=>{let w=Array.from(new En(g));return l&&(w=w.reverse()),(y!==0||b!==1/0)&&(w=w.slice(y,b)),w};else{let w=u==="data"?t:u==="height"?XL(n,"y1","y2"):u==="width"?XL(n,"x1","x2"):FS(n,u,u==="y"?"y2":u==="x"?"x2":void 0),_=fu(d===!0?"max":d,w);x.domain=()=>{let v=f_(Fn(g),A=>_.reduceIndex(A,w),A=>g[A]);return p&&v.sort(p),l&&v.reverse(),(y!==0||b!==1/0)&&(v=v.slice(y,b)),v.map(ic)}}}}function QV(t,e){for(let n in t){let r=t[n];if(r.scale===e)return r}}function ZV(t,e){let n=t.original;if(n===t)return e;let r=e.value,o=e.value=[];for(let i=0;i<n.length;++i){let s=r[n[i][0]];for(let a of t[i])o[a]=s}return e}function XL(t,e,n){let r=FS(t,e),o=FS(t,n);return Et(o,(i,s)=>Math.abs(i-r[s]),Float64Array)}function FS(t,e,n){let r=t[e];if(!r&&n!==void 0&&(r=t[n]),r)return r.value;throw new Error(`missing channel: ${e}`)}function JV(t){if(t==null||typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"ascending":return VL;case"descending":return GL}throw new Error(`invalid order: ${t}`)}function VL([t,e],[n,r]){return We(e,r)||We(t,n)}function GL([t,e],[n,r]){return nc(e,r)||We(t,n)}function Zd(t,e){let n=t[e];if(n){for(;n.source;)n=n.source;return n.source===null?null:n}}var KL=new Map([["accent",M3],["category10",S3],["dark2",A3],["observable10",T3],["paired",E3],["pastel1",I3],["pastel2",N3],["set1",C3],["set2",k3],["set3",L3],["tableau10",R3]]);function tR(t){return t!=null&&KL.has(`${t}`.toLowerCase())}var HL=new Map([...KL,["brbg",qi(oy,iy)],["prgn",qi(sy,ay)],["piyg",qi(cy,fy)],["puor",qi(uy,ly)],["rdbu",qi(wd,Uf)],["rdgy",qi(py,dy)],["rdylbu",qi(vd,jf)],["rdylgn",qi(hy,my)],["spectral",qi(xy,gy)],["burd",QL(wd,Uf)],["buylrd",QL(vd,jf)],["blues",He(Yy,Uy)],["greens",He(jy,Xy)],["greys",He(Wy,Vy)],["oranges",He(Jy,Ky)],["purples",He(Gy,Hy)],["reds",He(Qy,Zy)],["turbo",Bi(c1)],["viridis",Bi(u1)],["magma",Bi(l1)],["inferno",Bi(p1)],["plasma",Bi(d1)],["cividis",Bi(t1)],["cubehelix",Bi(e1)],["warm",Bi(r1)],["cool",Bi(o1)],["bugn",He(yy,by)],["bupu",He(wy,vy)],["gnbu",He(_y,Sy)],["orrd",He(My,Ay)],["pubu",He(Iy,Ny)],["pubugn",He(Ty,Ey)],["purd",He(Cy,ky)],["rdpu",He(Ly,Ry)],["ylgn",He(Dy,Py)],["ylgnbu",He(Oy,$y)],["ylorbr",He(Fy,qy)],["ylorrd",He(By,zy)],["rainbow",ZL(i1)],["sinebow",ZL(a1)]]);function He(t,e){return({length:n})=>n===1?[t[3][1]]:n===2?[t[3][1],t[3][2]]:(n=Math.max(3,Math.floor(n)),n>9?mn(e,n):t[n])}function qi(t,e){return({length:n})=>n===2?[t[3][0],t[3][2]]:(n=Math.max(3,Math.floor(n)),n>11?mn(e,n):t[n])}function QL(t,e){return({length:n})=>n===2?[t[3][2],t[3][0]]:(n=Math.max(3,Math.floor(n)),n>11?mn(r=>e(1-r),n):t[n].slice().reverse())}function Bi(t){return({length:e})=>mn(t,Math.max(2,Math.floor(e)))}function ZL(t){return({length:e})=>mn(t,Math.floor(e)+1).slice(0,-1)}function BS(t){let e=`${t}`.toLowerCase();if(!HL.has(e))throw new Error(`unknown ordinal scheme: ${e}`);return HL.get(e)}function Jd(t,e){let n=BS(t),r=typeof n=="function"?n({length:e}):n;return r.length!==e?r.slice(0,e):r}function eR(t,e="greys"){let n=new Set,[r,o]=Jd(e,2);for(let i of t)if(i!=null)if(i===!0)n.add(o);else if(i===!1)n.add(r);else return;return[...n]}var JL=new Map([["brbg",iy],["prgn",ay],["piyg",fy],["puor",ly],["rdbu",Uf],["rdgy",dy],["rdylbu",jf],["rdylgn",my],["spectral",gy],["burd",t=>Uf(1-t)],["buylrd",t=>jf(1-t)],["blues",Uy],["greens",Xy],["greys",Vy],["purples",Hy],["reds",Zy],["oranges",Ky],["turbo",c1],["viridis",u1],["magma",l1],["inferno",p1],["plasma",d1],["cividis",t1],["cubehelix",e1],["warm",r1],["cool",o1],["bugn",by],["bupu",vy],["gnbu",Sy],["orrd",Ay],["pubugn",Ey],["pubu",Ny],["purd",ky],["rdpu",Ry],["ylgnbu",$y],["ylgn",Py],["ylorbr",qy],["ylorrd",zy],["rainbow",i1],["sinebow",a1]]);function pu(t){let e=`${t}`.toLowerCase();if(!JL.has(e))throw new Error(`unknown quantitative scheme: ${e}`);return JL.get(e)}var KV=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function nR(t){return t!=null&&KV.has(`${t}`.toLowerCase())}var YS=t=>e=>t(1-e),zS=[0,1],rR=new Map([["number",ee],["rgb",Ar],["hsl",$_],["hcl",D_],["lab",zx]]);function US(t){let e=`${t}`.toLowerCase();if(!rR.has(e))throw new Error(`unknown interpolator: ${e}`);return rR.get(e)}function hu(t,e,n,{type:r,nice:o,clamp:i,zero:s,domain:a=lR(t,n),unknown:c,round:f,scheme:u,interval:p,range:l=Wt.get(t)===ac?rG(n,a):Wt.get(t)===cc?oG(n,a):Wt.get(t)===fc?zS:void 0,interpolate:d=Wt.get(t)===ur?u==null&&l!==void 0?Ar:pu(u!==void 0?u:r==="cyclical"?"rainbow":"turbo"):f?$a:ee,reverse:h}){if(p=$o(p,r),(r==="cyclical"||r==="sequential")&&(r="linear"),typeof d!="function"&&(d=US(d)),h=!!h,l!==void 0){let m=(a=cr(a)).length,x=(l=cr(l)).length;if(m!==x){if(d.length===1)throw new Error("invalid piecewise interpolator");d=go(d,l),l=void 0}}if(d.length===1?(h&&(d=YS(d),h=!1),l===void 0&&(l=Float64Array.from(a,(m,x)=>x/(a.length-1)),l.length===2&&(l=zS)),e.interpolate((l===zS?ue:Kd)(d))):e.interpolate(d),s){let[m,x]=Ft(a);(m>0||x<0)&&(a=Is(a),(Li(a)||1)===Math.sign(m)?a[0]=0:a[a.length-1]=0)}return h&&(a=cs(a)),e.domain(a).unknown(c),o&&(e.nice(tG(o,r)),a=e.domain()),l!==void 0&&e.range(l),i&&e.clamp(i),{type:r,domain:a,range:l,scale:e,interpolate:d,interval:p}}function tG(t,e){return t===!0?void 0:typeof t=="number"?t:bL(t,e)}function oR(t,e,n){return hu(t,_i(),e,n)}function iR(t,e,n){return jS(t,e,{...n,exponent:.5})}function jS(t,e,{exponent:n=1,...r}){return hu(t,fd().exponent(n),e,{...r,type:"pow"})}function sR(t,e,{base:n=10,domain:r=iG(e),...o}){return hu(t,ad().base(n),e,{...o,domain:r})}function aR(t,e,{constant:n=1,...r}){return hu(t,cd().constant(n),e,r)}function cR(t,e,{range:n,quantiles:r=n===void 0?5:(n=[...n]).length,n:o=r,scheme:i="rdylbu",domain:s=sG(e),unknown:a,interpolate:c,reverse:f}){return n===void 0&&(n=c!==void 0?mn(c,o):Wt.get(t)===ur?Jd(i,o):void 0),s.length>0&&(s=ud(s,n===void 0?{length:o}:n).quantiles()),Y1(t,e,{domain:s,range:n,reverse:f,unknown:a})}function fR(t,e,{range:n,n:r=n===void 0?5:(n=[...n]).length,scheme:o="rdylbu",domain:i=lR(t,e),unknown:s,interpolate:a,reverse:c}){let[f,u]=Ft(i),p;return n===void 0?(p=on(f,u,r),p[0]<=f&&p.splice(0,1),p[p.length-1]>=u&&p.pop(),r=p.length+1,n=a!==void 0?mn(a,r):Wt.get(t)===ur?Jd(o,r):void 0):(p=mn(ee(f,u),r+1).slice(1,-1),f instanceof Date&&(p=p.map(l=>new Date(l)))),Li(cr(i))<0&&p.reverse(),Y1(t,e,{domain:p,range:n,reverse:c,unknown:s})}function Y1(t,e,{domain:n=[0],unknown:r,scheme:o="rdylbu",interpolate:i,range:s=i!==void 0?mn(i,n.length+1):Wt.get(t)===ur?Jd(o,n.length+1):void 0,reverse:a}){n=cr(n);let c=Li(n);if(!isNaN(c)&&!eG(n,c))throw new Error(`the ${t} scale has a non-monotonic domain`);return a&&(s=cs(s)),{type:"threshold",scale:ld(c<0?cs(n):n,s===void 0?[]:s).unknown(r),domain:n,range:s}}function eG(t,e){for(let n=1,r=t.length,o=t[0];n<r;++n){let i=An(o,o=t[n]);if(i!==0&&i!==e)return!1}return!0}function uR(t){return{type:"identity",scale:LL(Wt.get(t))?id():e=>e}}function du(t,e=Jf){return t.length?[It(t,({value:n})=>n===void 0?n:It(n,e)),kt(t,({value:n})=>n===void 0?n:kt(n,e))]:[0,1]}function lR(t,e){let n=Wt.get(t);return(n===ac||n===fc||n===cc?nG:du)(e)}function nG(t){return[0,t.length?kt(t,({value:e})=>e===void 0?e:kt(e,Jf)):1]}function rG(t,e){let n=t.find(({radius:s})=>s!==void 0);if(n!==void 0)return[0,n.radius];let r=In(t,.5,({value:s})=>s===void 0?NaN:In(s,.25,Pn)),o=e.map(s=>3*Math.sqrt(s/r)),i=30/kt(o);return i<1?o.map(s=>s*i):o}function oG(t,e){let n=Vr(t,({value:i})=>i===void 0?NaN:Vr(i,Math.abs)),r=e.map(i=>12*i/n),o=60/kt(r);return o<1?r.map(i=>i*o):r}function iG(t){for(let{value:e}of t)if(e!==void 0)for(let n of e){if(n>0)return du(t,Pn);if(n<0)return du(t,_s)}return[1,10]}function sG(t){let e=[];for(let{value:n}of t)if(n!==void 0)for(let r of n)e.push(r);return e}function Kd(t){return(e,n)=>r=>t(e+r*(n-e))}var XS=0,WS;function pR(){let t=XS;return XS=0,WS=void 0,t}function _n(t){t!==WS&&(WS=t,console.warn(t),++XS)}function U1(t,e,n,r,{type:o,nice:i,clamp:s,domain:a=du(r),unknown:c,pivot:f=0,scheme:u,range:p,symmetric:l=!0,interpolate:d=Wt.get(t)===ur?u==null&&p!==void 0?Ar:pu(u!==void 0?u:"rdbu"):ee,reverse:h}){f=+f,a=cr(a);let[m,x]=a;if(a.length>2&&_n(`Warning: the diverging ${t} scale domain contains extra elements.`),An(m,x)<0&&([m,x]=[x,m],h=!h),m=Math.min(m,f),x=Math.max(x,f),typeof d!="function"&&(d=US(d)),p!==void 0&&(d=d.length===1?Kd(d)(...p):go(d,p)),h&&(d=YS(d)),l){let g=n.apply(f),y=g-n.apply(m),b=n.apply(x)-g;y<b?m=n.invert(g-b):y>b&&(x=n.invert(g+y))}return e.domain([m,f,x]).unknown(c).interpolator(d),s&&e.clamp(s),i&&e.nice(i),{type:o,domain:[m,x],pivot:f,interpolate:d,scale:e}}function dR(t,e,n){return U1(t,bd(),aG,e,n)}function hR(t,e,n){return VS(t,e,{...n,exponent:.5})}function VS(t,e,{exponent:n=1,...r}){return U1(t,ry().exponent(n=+n),uG(n),e,{...r,type:"diverging-pow"})}function mR(t,e,{base:n=10,pivot:r=1,domain:o=du(e,r<0?_s:Pn),...i}){return U1(t,ey().base(n=+n),cG,e,{domain:o,pivot:r,...i})}function xR(t,e,{constant:n=1,...r}){return U1(t,ny().constant(n=+n),lG(n),e,r)}var aG={apply(t){return t},invert(t){return t}},cG={apply:Math.log,invert:Math.exp},fG={apply(t){return Math.sign(t)*Math.sqrt(Math.abs(t))},invert(t){return Math.sign(t)*(t*t)}};function uG(t){return t===.5?fG:{apply(e){return Math.sign(e)*Math.pow(Math.abs(e),t)},invert(e){return Math.sign(e)*Math.pow(Math.abs(e),1/t)}}}function lG(t){return{apply(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))},invert(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}}function gR(t,e,n,r){return hu(t,e,n,r)}function yR(t,e,n){return gR(t,Jg(),e,n)}function bR(t,e,n){return gR(t,Kg(),e,n)}var mu=Symbol("ordinal");function vR(t,e,n,{type:r,interval:o,domain:i,range:s,reverse:a,hint:c}){return o=$o(o,r),i===void 0&&(i=TR(n,o,t)),(r==="categorical"||r===mu)&&(r="ordinal"),a&&(i=cs(i)),i=e.domain(i).domain(),s!==void 0&&(typeof s=="function"&&(s=s(i)),e.range(s)),{type:r,domain:i,range:s,scale:e,hint:c,interval:o}}function _R(t,e,{type:n,interval:r,domain:o,range:i,scheme:s,unknown:a,...c}){r=$o(r,n),o===void 0&&(o=TR(e,r,t));let f;if(Wt.get(t)===au)f=pG(e),i=i===void 0?dG(f):Et(i,cu);else if(Wt.get(t)===ur&&(i===void 0&&(n==="ordinal"||n===mu)&&(i=eR(o,s),i!==void 0&&(s=void 0)),s===void 0&&i===void 0&&(s=n==="ordinal"?"turbo":"observable10"),s!==void 0))if(i!==void 0){let u=pu(s),p=i[0],l=i[1]-i[0];i=({length:d})=>mn(h=>u(p+l*h),d)}else i=BS(s);if(a===rd)throw new Error(`implicit unknown on ${t} scale is not supported`);return vR(t,Va().unknown(a),e,{...c,type:n,domain:o,range:i,hint:f})}function SR(t,e,{align:n=.5,padding:r=.5,...o}){return AR(a3().align(n).padding(r),e,o,t)}function MR(t,e,{align:n=.5,padding:r=.1,paddingInner:o=r,paddingOuter:i=t==="fx"||t==="fy"?0:r,...s}){return AR(bs().align(n).paddingInner(o).paddingOuter(i),e,s,t)}function AR(t,e,n,r){let{round:o}=n;return o!==void 0&&t.round(o=!!o),t=vR(r,t,e,n),t.round=o,t}function TR(t,e,n){let r=new En;for(let{value:o,domain:i}of t){if(i!==void 0)return i();if(o!==void 0)for(let s of o)r.add(s)}if(e!==void 0){let[o,i]=Ft(r).map(e.floor,e);return e.range(o,e.offset(i))}if(r.size>1e4&&Wt.get(n)===Dr)throw new Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return ui(r,We)}function wR(t,e){let n;for(let{hint:r}of t){let o=r?.[e];if(o!==void 0){if(n===void 0)n=o;else if(n!==o)return}}return n}function pG(t){return{fill:wR(t,"fill"),stroke:wR(t,"stroke")}}function dG(t){return zt(t.fill)?B3:b1}function th(t,{label:e,inset:n=0,insetTop:r=n,insetRight:o=n,insetBottom:i=n,insetLeft:s=n,round:a,nice:c,clamp:f,zero:u,align:p,padding:l,projection:d,facet:{label:h=e}={},...m}={}){let x={};for(let[g,y]of t){let b=m[g],w=OR(g,y,{round:Wt.get(g)===Dr?a:void 0,nice:c,clamp:f,zero:u,align:p,padding:l,projection:d,...b});if(w){let{label:_=g==="fx"||g==="fy"?h:e,percent:v,transform:A,inset:T,insetTop:E=T!==void 0?T:g==="y"?r:0,insetRight:N=T!==void 0?T:g==="x"?o:0,insetBottom:M=T!==void 0?T:g==="y"?i:0,insetLeft:k=T!==void 0?T:g==="x"?s:0}=b||{};if(A==null)A=void 0;else if(typeof A!="function")throw new Error("invalid scale transform; not a function");w.percent=!!v,w.label=_===void 0?hG(y,w):_,w.transform=A,g==="x"||g==="fx"?(w.insetLeft=+k,w.insetRight=+N):(g==="y"||g==="fy")&&(w.insetTop=+E,w.insetBottom=+M),x[g]=w}}return x}function HS(t){let e={},n={scales:e};for(let[r,o]of Object.entries(t)){let{scale:i,type:s,interval:a,label:c}=o;e[r]=DR(o),n[r]=i,i.type=s,a!=null&&(i.interval=a),c!=null&&(i.label=c)}return n}function kR(t,e){let{x:n,y:r,fx:o,fy:i}=t,s=o||i?W1(e):e;o&&ER(o,s),i&&IR(i,s);let a=o||i?QS(t,e):e;n&&ER(n,a),r&&IR(r,a)}function hG(t=[],e){let n;for(let{label:r}of t)if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}if(n!==void 0)return!qo(e)&&e.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function X1(t){return Math.sign(Li(t.domain()))*Math.sign(Li(t.range()))}function W1(t){let{marginTop:e,marginRight:n,marginBottom:r,marginLeft:o,width:i,height:s,facet:{marginTop:a,marginRight:c,marginBottom:f,marginLeft:u}}=t;return{marginTop:Math.max(e,a),marginRight:Math.max(n,c),marginBottom:Math.max(r,f),marginLeft:Math.max(o,u),width:i,height:s}}function QS({fx:t,fy:e},n){let{marginTop:r,marginRight:o,marginBottom:i,marginLeft:s,width:a,height:c}=W1(n);return{marginTop:r,marginRight:o,marginBottom:i,marginLeft:s,width:t?t.scale.bandwidth()+s+o:a,height:e?e.scale.bandwidth()+r+i:c,facet:{width:a,height:c}}}function ER(t,e){if(t.range===void 0){let{insetLeft:n,insetRight:r}=t,{width:o,marginLeft:i=0,marginRight:s=0}=e,a=i+n,c=o-s-r;t.range=[a,Math.max(a,c)],qo(t)||(t.range=RR(t)),t.scale.range(t.range)}LR(t)}function IR(t,e){if(t.range===void 0){let{insetTop:n,insetBottom:r}=t,{height:o,marginTop:i=0,marginBottom:s=0}=e,a=i+n,c=o-s-r;t.range=[Math.max(a,c),a],qo(t)?t.range.reverse():t.range=RR(t),t.scale.range(t.range)}LR(t)}function LR(t){t.round===void 0&&gG(t)&&mG(t)<=30&&t.scale.round(!0)}function mG({scale:t}){let e=t.domain().length,[n,r]=t.range(),o=t.paddingInner?t.paddingInner():1,i=t.paddingOuter?t.paddingOuter():t.padding(),s=e-o,a=Math.abs(r-n)/Math.max(1,s+i*2);return(a-Math.floor(a))*s}function RR(t){let e=t.scale.domain().length+ZS(t);if(!(e>2))return t.range;let[n,r]=t.range;return Array.from({length:e},(o,i)=>n+i/(e-1)*(r-n))}function V1(t,e,n){return OR(t,n===void 0?void 0:[{hint:n}],{...e})}function OR(t,e=[],n={}){let r=xG(t,e,n);if(n.type===void 0&&n.domain===void 0&&n.range===void 0&&n.interval==null&&t!=="fx"&&t!=="fy"&&qo({type:r})){let o=e.map(({value:i})=>i).filter(i=>i!==void 0);o.some(fe)?_n(`Warning: some data associated with the ${t} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${xu(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${t} scale to "${xu(r)}".`):o.some(SL)?_n(`Warning: some data associated with the ${t} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${xu(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${t} scale to "${xu(r)}".`):o.some(ML)&&_n(`Warning: some data associated with the ${t} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${xu(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${t} scale to "${xu(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=j1(e,n,Ne);break;case"identity":switch(Wt.get(t)){case Dr:n=j1(e,n,Ne);break;case au:n=j1(e,n,yG);break}break;case"utc":case"time":n=j1(e,n,gS);break}switch(r){case"diverging":return dR(t,e,n);case"diverging-sqrt":return hR(t,e,n);case"diverging-pow":return VS(t,e,n);case"diverging-log":return mR(t,e,n);case"diverging-symlog":return xR(t,e,n);case"categorical":case"ordinal":case mu:return _R(t,e,n);case"cyclical":case"sequential":case"linear":return oR(t,e,n);case"sqrt":return iR(t,e,n);case"threshold":return Y1(t,e,n);case"quantile":return cR(t,e,n);case"quantize":return fR(t,e,n);case"pow":return jS(t,e,n);case"log":return sR(t,e,n);case"symlog":return aR(t,e,n);case"utc":return bR(t,e,n);case"time":return yR(t,e,n);case"point":return SR(t,e,n);case"band":return MR(t,e,n);case"identity":return uR(t);case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function xu(t){return typeof t=="symbol"?t.description:t}function NR(t){return typeof t=="string"?`${t}`.toLowerCase():t}var CR={toString:()=>"projection"};function xG(t,e,{type:n,domain:r,range:o,scheme:i,pivot:s,projection:a}){if(n=NR(n),t==="fx"||t==="fy")return"band";(t==="x"||t==="y")&&a!=null&&(n=CR);for(let f of e){let u=NR(f.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===CR)return;if(n!==void 0)return n;if(r===void 0&&!e.some(({value:f})=>f!==void 0))return;let c=Wt.get(t);if(c===ac)return"sqrt";if(c===fc||c===cc)return"linear";if(c===au)return"ordinal";if((r||o||[]).length>2)return GS(c);if(r!==void 0){if(ie(r))return GS(c);if(fe(r))return"utc"}else{let f=e.map(({value:u})=>u).filter(u=>u!==void 0);if(f.some(ie))return GS(c);if(f.some(fe))return"utc"}if(c===ur){if(s!=null||nR(i))return"diverging";if(tR(i))return"categorical"}return"linear"}function GS(t){switch(t){case Dr:return"point";case ur:return mu;default:return"ordinal"}}function qo({type:t}){return t==="ordinal"||t==="point"||t==="band"||t===mu}function ZS({type:t}){return t==="threshold"}function gG({type:t}){return t==="point"||t==="band"}function lr(t){if(t===void 0)return!0;let e=t.domain(),n=t(e[0]);for(let r=1,o=e.length;r<o;++r)if(t(e[r])-n)return!1;return!0}function j1(t,{domain:e,...n},r){for(let o of t)o.value!==void 0&&(e===void 0&&(e=o.value?.domain),o.value=r(o.value));return{domain:e===void 0?e:r(e),...n}}function yG(t){return Et(t,cu)}function Os(t={}){let e;for(let n in t)if(Wt.has(n)&&Ro(t[n])){if(e!==void 0)throw new Error("ambiguous scale definition; multiple scales found");e=DR(V1(n,t[n]))}if(e===void 0)throw new Error("invalid scale definition; no scale found");return e}function $R(t){return e=>{if(!Wt.has(e=`${e}`))throw new Error(`unknown scale: ${e}`);return t[e]}}function DR({scale:t,type:e,domain:n,range:r,interpolate:o,interval:i,transform:s,percent:a,pivot:c}){if(e==="identity")return{type:"identity",apply:u=>u,invert:u=>u};let f=t.unknown?t.unknown():void 0;return{type:e,domain:Is(n),...r!==void 0&&{range:Is(r)},...s!==void 0&&{transform:s},...a&&{percent:a},...f!==void 0&&{unknown:f},...i!==void 0&&{interval:i},...o!==void 0&&{interpolate:o},...t.clamp&&{clamp:t.clamp()},...c!==void 0&&{pivot:c,symmetric:!1},...t.base&&{base:t.base()},...t.exponent&&{exponent:t.exponent()},...t.constant&&{constant:t.constant()},...t.align&&{align:t.align(),round:t.round()},...t.padding&&(t.paddingInner?{paddingInner:t.paddingInner(),paddingOuter:t.paddingOuter()}:{padding:t.padding()}),...t.bandwidth&&{bandwidth:t.bandwidth(),step:t.step()},apply:u=>t(u),...t.invert&&{invert:u=>t.invert(u)}}}function FR(t,e){let{fx:n,fy:r}=th(t,e),o=n?.scale.domain(),i=r?.scale.domain();return o&&i?mx(o,i).map(([s,a],c)=>({x:s,y:a,i:c})):o?o.map((s,a)=>({x:s,i:a})):i?i.map((s,a)=>({y:s,i:a})):void 0}function qR(t,{x:e,y:n}){return e&&=n4(e),n&&=n4(n),t.filter(e&&n?r=>e.has(r.x)&&n.has(r.y):e?r=>e.has(r.x):r=>n.has(r.y)).sort(e&&n?(r,o)=>e.get(r.x)-e.get(o.x)||n.get(r.y)-n.get(o.y):e?(r,o)=>e.get(r.x)-e.get(o.x):(r,o)=>n.get(r.y)-n.get(o.y))}function H1(t,{fx:e,fy:n}){let r=Fn(t),o=e?.value,i=n?.value;return e&&n?Wr(r,s=>(s.fx=o[s[0]],s.fy=i[s[0]],s),s=>o[s],s=>i[s]):e?Wr(r,s=>(s.fx=o[s[0]],s),s=>o[s]):Wr(r,s=>(s.fy=i[s[0]],s),s=>i[s])}function BR(t,e,{marginTop:n,marginLeft:r}){return t&&e?({x:o,y:i})=>`translate(${t(o)-r},${e(i)-n})`:t?({x:o})=>`translate(${t(o)-r},0)`:({y:o})=>`translate(0,${e(o)-n})`}function zR(t){let e=[],n=new Uint32Array(sn(t,r=>r.length));for(let r of t){let o=0;for(let i of t)r!==i&&(n.set(i,o),o+=i.length);e.push(n.slice(0,o))}return e}var bG=new Map([["top",JS],["right",e4],["bottom",KS],["left",t4],["top-left",G1(JS,t4)],["top-right",G1(JS,e4)],["bottom-left",G1(KS,t4)],["bottom-right",G1(KS,e4)],["top-empty",vG],["right-empty",MG],["bottom-empty",_G],["left-empty",SG],["empty",AG]]);function YR(t){if(t==null)return null;let e=bG.get(`${t}`.toLowerCase());if(e)return e;throw new Error(`invalid facet anchor: ${t}`)}var PR=new WeakMap;function n4(t){let e=PR.get(t);return e||PR.set(t,e=new Tn(Et(t,(n,r)=>[n,r]))),e}function $s(t,e){return n4(t).get(e)}function wG(t,e,n){return e=Or(e),n=Or(n),t.find(r=>Object.is(Or(r.x),e)&&Object.is(Or(r.y),n))}function Q1(t,e,n){return wG(t,e,n)?.empty}function JS(t,{y:e},{y:n}){return e?$s(e,n)===0:!0}function KS(t,{y:e},{y:n}){return e?$s(e,n)===e.length-1:!0}function t4(t,{x:e},{x:n}){return e?$s(e,n)===0:!0}function e4(t,{x:e},{x:n}){return e?$s(e,n)===e.length-1:!0}function vG(t,{y:e},{x:n,y:r,empty:o}){if(o)return!1;if(!e)return;let i=$s(e,r);if(i>0)return Q1(t,n,e[i-1])}function _G(t,{y:e},{x:n,y:r,empty:o}){if(o)return!1;if(!e)return;let i=$s(e,r);if(i<e.length-1)return Q1(t,n,e[i+1])}function SG(t,{x:e},{x:n,y:r,empty:o}){if(o)return!1;if(!e)return;let i=$s(e,n);if(i>0)return Q1(t,e[i-1],r)}function MG(t,{x:e},{x:n,y:r,empty:o}){if(o)return!1;if(!e)return;let i=$s(e,n);if(i<e.length-1)return Q1(t,e[i+1],r)}function AG(t,e,{empty:n}){return n}function G1(t,e){return function(){return t.apply(null,arguments)&&e.apply(null,arguments)}}function Z1(t,{channels:{fx:e,fy:n},groups:r}){return e&&n?t.map(({x:o,y:i})=>r.get(o)?.get(i)??[]):e?t.map(({x:o})=>r.get(o)??[]):t.map(({y:o})=>r.get(o)??[])}var UR=Math.PI,zi=2*UR,r4=.618;function jR({projection:t,inset:e=0,insetTop:n=e,insetRight:r=e,insetBottom:o=e,insetLeft:i=e}={},s){if(t==null)return;if(typeof t.stream=="function")return t;let a,c,f="frame";if(Ve(t)){let _;if({type:t,domain:c,inset:_,insetTop:n=_!==void 0?_:n,insetRight:r=_!==void 0?_:r,insetBottom:o=_!==void 0?_:o,insetLeft:i=_!==void 0?_:i,clip:f=f,...a}=t,t==null)return}typeof t!="function"&&({type:t}=o4(t));let{width:u,height:p,marginLeft:l,marginRight:d,marginTop:h,marginBottom:m}=s,x=u-l-d-i-r,g=p-h-m-n-o;if(t=t?.({width:x,height:g,clip:f,...a}),t==null)return;f=TG(f,l,h,u-d,p-m);let y=l+i,b=h+n,w;if(c!=null){let[[_,v],[A,T]]=Ue(t).bounds(c),E=Math.min(x/(A-_),g/(T-v));E>0?(y-=(E*(_+A)-x)/2,b-=(E*(v+T)-g)/2,w=ja({point(N,M){this.stream.point(N*E+y,M*E+b)}})):_n("Warning: the projection could not be fit to the specified domain; using the default scale.")}return w??=y===0&&b===0?XR():ja({point(_,v){this.stream.point(_+y,v+b)}}),{stream:_=>t.stream(w.stream(f(_)))}}function o4(t){switch(`${t}`.toLowerCase()){case"albers-usa":return Zr($6,.7463,.4673);case"albers":return J1(Zp,.7463,.4673);case"azimuthal-equal-area":return Zr(P6,4,4);case"azimuthal-equidistant":return Zr(q6,zi,zi);case"conic-conformal":return J1(Y6,zi,zi);case"conic-equal-area":return J1(gs,6.1702,2.9781);case"conic-equidistant":return J1(j6,7.312,3.6282);case"equal-earth":return Zr(W6,5.4133,2.6347);case"equirectangular":return Zr(U6,zi,UR);case"gnomonic":return Zr(G6,3.4641,3.4641);case"identity":return{type:XR};case"reflect-y":return{type:EG};case"mercator":return Zr(B6,zi,zi);case"orthographic":return Zr(Q6,2,2);case"stereographic":return Zr(J6,2,2);case"transverse-mercator":return Zr(t3,zi,zi);default:throw new Error(`unknown projection type: ${t}`)}}function TG(t,e,n,r,o){if(t===!1||t==null||typeof t=="number")return i=>i;switch(t===!0&&(t="frame"),`${t}`.toLowerCase()){case"frame":return kf(e,n,r,o);default:throw new Error(`unknown projection clip type: ${t}`)}}function Zr(t,e,n){return{type:({width:r,height:o,rotate:i,precision:s=.15,clip:a})=>{let c=t();return s!=null&&c.precision?.(s),i!=null&&c.rotate?.(i),typeof a=="number"&&c.clipAngle?.(a),r!=null&&(c.scale(Math.min(r/e,o/n)),c.translate([r/2,o/2])),c},aspectRatio:n/e}}function J1(t,e,n){let{type:r,aspectRatio:o}=Zr(t,e,n);return{type:i=>{let{parallels:s,domain:a,width:c,height:f}=i,u=r(i);return s!=null&&(u.parallels(s),a===void 0&&c!=null&&u.fitSize([c,f],{type:"Sphere"})),u},aspectRatio:o}}var XR=ue({stream:t=>t}),EG=ue(ja({point(t,e){this.stream.point(t,-e)}}));function i4(t,e,n,r){let o=n[t],i=n[e],s=o.length,a=n[t]=new Float64Array(s).fill(NaN),c=n[e]=new Float64Array(s).fill(NaN),f,u=r.stream({point(p,l){a[f]=p,c[f]=l}});for(f=0;f<s;++f)u.point(o[f],i[f])}function WR({projection:t}={}){return t==null?!1:typeof t.stream=="function"?!0:(Ve(t)&&(t=t.type),t!=null)}function VR(t){if(typeof t?.stream=="function")return r4;if(Ve(t)){let e,n;if({domain:e,type:t,...n}=t,e!=null&&t!=null){let r=typeof t=="string"?o4(t).type:t,[[o,i],[s,a]]=Ue(r({...n,width:100,height:100})).bounds(e),c=(a-i)/(s-o);return c&&isFinite(c)?c<.2?.2:c>5?5:c:r4}}if(t!=null){if(typeof t!="function"){let{aspectRatio:e}=o4(t);if(e)return e}return r4}}function Bo(t,e,{projection:n}){let{x:r,y:o}=t,i={};return r&&(i.x=r),o&&(i.y=o),i=lu(i,e),n&&r?.scale==="x"&&o?.scale==="y"&&i4("x","y",i,n),r&&(i.x=Ne(i.x)),o&&(i.y=Ne(i.y)),i}function GR(t){let e=[],n=[],r={scale:"x",value:e},o={scale:"y",value:n},i={point(s,a){e.push(s),n.push(a)},lineStart(){},lineEnd(){},polygonStart(){},polygonEnd(){},sphere(){}};for(let s of t.value)or(s,i);return[r,o]}function Ds(t={}){let{document:e=typeof window<"u"?window.document:void 0,clip:n}=t;return{document:e,clip:R1(n)}}function ot(t,{document:e}){return Nt(hi(t).call(e.documentElement))}var K1=Symbol("unset");function Ps(t){return(t.length===1?IG:NG)(t)}function IG(t){let e,n=K1;return r=>(Object.is(n,r)||(n=r,e=t(r)),e)}function NG(t){let e,n;return(...r)=>((n?.length!==r.length||n.some((o,i)=>!Object.is(o,r[i])))&&(n=r,e=t(...r)),e)}var CG=Ps(t=>new Intl.NumberFormat(t)),kG=Ps((t,e)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...e&&{month:e}})),LG=Ps((t,e)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...e&&{weekday:e}}));function s4(t="en-US"){let e=CG(t);return n=>n!=null&&!isNaN(n)?e.format(n):void 0}function HR(t="en-US",e="short"){let n=kG(t,e);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2e3,+r)))?n.format(r):void 0}function QR(t="en-US",e="short"){let n=LG(t,e);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2001,0,+r)))?n.format(r):void 0}function a4(t){return Kf(t,"Invalid Date")}function RG(t="en-US"){let e=s4(t);return n=>(n instanceof Date?a4:typeof n=="number"?e:be)(n)}var zo=RG();var le=(typeof window<"u"?window.devicePixelRatio>1:typeof it>"u")?0:.5,OG=0,$G=0;function c4(){return`plot-clip-${++OG}`}function ZR(){return`plot-pattern-${++$G}`}function tb(t,{title:e,href:n,ariaLabel:r,ariaDescription:o,ariaHidden:i,target:s,fill:a,fillOpacity:c,stroke:f,strokeWidth:u,strokeOpacity:p,strokeLinejoin:l,strokeLinecap:d,strokeMiterlimit:h,strokeDasharray:m,strokeDashoffset:x,opacity:g,mixBlendMode:y,imageFilter:b,paintOrder:w,pointerEvents:_,shapeRendering:v,channels:A},{ariaLabel:T,fill:E="currentColor",fillOpacity:N,stroke:M="none",strokeOpacity:k,strokeWidth:O,strokeLinecap:S,strokeLinejoin:I,strokeMiterlimit:C,paintOrder:L}){E===null&&(a=null,c=null),M===null&&(f=null,p=null),zt(E)?!zt(M)&&(!zt(a)||A?.fill)&&(M="none"):zt(M)&&(!zt(f)||A?.stroke)&&(E="none");let[D,$]=ce(a,E),[P,F]=Ut(c,N),[q,V]=ce(f,M),[K,et]=Ut(p,k),[rt,j]=Ut(g);Pi(V)||(u===void 0&&(u=O),d===void 0&&(d=S),l===void 0&&(l=I),h===void 0&&!TL(l)&&(h=C),!Pi($)&&w===void 0&&(w=L));let[nt,Y]=Ut(u);return E!==null&&(t.fill=te($,"currentColor"),t.fillOpacity=eh(F,1)),M!==null&&(t.stroke=te(V,"none"),t.strokeWidth=eh(Y,1),t.strokeOpacity=eh(et,1),t.strokeLinejoin=te(l,"miter"),t.strokeLinecap=te(d,"butt"),t.strokeMiterlimit=eh(h,4),t.strokeDasharray=te(m,"none"),t.strokeDashoffset=te(x,"0")),t.target=be(s),t.ariaLabel=be(T),t.ariaDescription=be(o),t.ariaHidden=be(i),t.opacity=eh(j,1),t.mixBlendMode=te(y,"normal"),t.imageFilter=te(b,"none"),t.paintOrder=te(w,"normal"),t.pointerEvents=te(_,"auto"),t.shapeRendering=te(v,"auto"),{title:{value:e,optional:!0,filter:null},href:{value:n,optional:!0,filter:null},ariaLabel:{value:r,optional:!0,filter:null},fill:{value:D,scale:"auto",optional:!0},fillOpacity:{value:P,scale:"auto",optional:!0},stroke:{value:q,scale:"auto",optional:!0},strokeOpacity:{value:K,scale:"auto",optional:!0},strokeWidth:{value:nt,optional:!0},opacity:{value:rt,scale:"auto",optional:!0}}}function DG(t,e){e&&t.filter(n=>qd(e[n])).append("title").call(FG,e)}function PG(t,e){e&&t.filter(([n])=>qd(e[n])).append("title").call(qG,e)}function FG(t,e){e&&t.text(n=>zo(e[n]))}function qG(t,e){e&&t.text(([n])=>zo(e[n]))}function Tt(t,{target:e,tip:n},{ariaLabel:r,title:o,fill:i,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:f,opacity:u,href:p}){r&&at(t,"aria-label",l=>r[l]),i&&at(t,"fill",l=>i[l]),s&&at(t,"fill-opacity",l=>s[l]),a&&at(t,"stroke",l=>a[l]),c&&at(t,"stroke-opacity",l=>c[l]),f&&at(t,"stroke-width",l=>f[l]),u&&at(t,"opacity",l=>u[l]),p&&KR(t,l=>p[l],e),n||DG(t,o)}function uc(t,{target:e,tip:n},{ariaLabel:r,title:o,fill:i,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:f,opacity:u,href:p}){r&&at(t,"aria-label",([l])=>r[l]),i&&at(t,"fill",([l])=>i[l]),s&&at(t,"fill-opacity",([l])=>s[l]),a&&at(t,"stroke",([l])=>a[l]),c&&at(t,"stroke-opacity",([l])=>c[l]),f&&at(t,"stroke-width",([l])=>f[l]),u&&at(t,"opacity",([l])=>u[l]),p&&KR(t,([l])=>p[l],e),n||PG(t,o)}function BG({ariaLabel:t,title:e,fill:n,fillOpacity:r,stroke:o,strokeOpacity:i,strokeWidth:s,opacity:a,href:c},{tip:f}){return[t,f?void 0:e,n,r,o,i,s,a,c].filter(u=>u!==void 0)}function nh(t,e,n){let r=rn(t,o=>e[o]);return n===void 0&&r.size>1+t.length>>1&&_n("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*eb(t,e,n,r){let{z:o}=n,{z:i}=r,s=BG(r,n),a=[...e,...s];for(let c of i?nh(t,i,o):[t]){let f,u;t:for(let p of c){for(let l of a)if(!oe(l[p])){u&&u.push(-1);continue t}if(f===void 0){u&&(yield u),f=s.map(l=>Or(l[p])),u=[p];continue}u.push(p);for(let l=0;l<s.length;++l)if(Or(s[l][p])!==f[l]){yield u,f=s.map(h=>Or(h[p])),u=[p];continue t}}u&&(yield u)}}function zG(t,e,n,r){let o,{clip:i=r.clip}=e;switch(i){case"frame":{t=ot("svg:g",r).each(function(){this.appendChild(t.node()),t.node=()=>this}),o=YG(r,n);break}case"sphere":{o=UG(r);break}}at(t,"aria-label",e.ariaLabel),at(t,"aria-description",e.ariaDescription),at(t,"aria-hidden",e.ariaHidden),at(t,"clip-path",o)}function JR(t){let e=new WeakMap;return(n,r)=>{let o=e.get(n);if(!o){let i=c4();Nt(n.ownerSVGElement).append("clipPath").attr("id",i).call(t,n,r),e.set(n,o=`url(#${i})`)}return o}}var YG=JR((t,e,n)=>{let{width:r,height:o,marginLeft:i,marginRight:s,marginTop:a,marginBottom:c}=n;t.append("rect").attr("x",i).attr("y",a).attr("width",r-s-i).attr("height",o-a-c)}),UG=JR((t,e)=>{let{projection:n}=e;if(!n)throw new Error('the "sphere" clip option requires a projection');t.append("path").attr("d",Ue(n)({type:"Sphere"}))});function wt(t,e,n,r){zG(t,e,n,r),at(t,"class",e.className),at(t,"fill",e.fill),at(t,"fill-opacity",e.fillOpacity),at(t,"stroke",e.stroke),at(t,"stroke-width",e.strokeWidth),at(t,"stroke-opacity",e.strokeOpacity),at(t,"stroke-linejoin",e.strokeLinejoin),at(t,"stroke-linecap",e.strokeLinecap),at(t,"stroke-miterlimit",e.strokeMiterlimit),at(t,"stroke-dasharray",e.strokeDasharray),at(t,"stroke-dashoffset",e.strokeDashoffset),at(t,"shape-rendering",e.shapeRendering),at(t,"filter",e.imageFilter),at(t,"paint-order",e.paintOrder);let{pointerEvents:o=r.pointerSticky===!1?"none":void 0}=e;at(t,"pointer-events",o)}function dt(t,e){jG(t,"mix-blend-mode",e.mixBlendMode),at(t,"opacity",e.opacity)}function KR(t,e,n){t.each(function(r){let o=e(r);if(o!=null){let i=this.ownerDocument.createElementNS(Nn.svg,"a");i.setAttribute("fill","inherit"),i.setAttributeNS(Nn.xlink,"href",o),n!=null&&i.setAttribute("target",n),this.parentNode.insertBefore(i,this).appendChild(this)}})}function at(t,e,n){n!=null&&t.attr(e,n)}function jG(t,e,n){n!=null&&t.style(e,n)}function xt(t,e,{x:n,y:r},o=le,i=le){o+=e.dx,i+=e.dy,n?.bandwidth&&(o+=n.bandwidth()/2),r?.bandwidth&&(i+=r.bandwidth()/2),(o||i)&&t.attr("transform",`translate(${o},${i})`)}function te(t,e){if((t=be(t))!==e)return t}function eh(t,e){if((t=Dt(t))!==e)return t}var XG=/^-?([_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 Fs(t){if(t===void 0)return"plot-d6a7b5";if(t=`${t}`,!XG.test(t))throw new Error(`invalid class name: ${t}`);return t}function gu(t,e){if(typeof e=="string")t.property("style",e);else if(e!=null)for(let n of t)Object.assign(n.style,e)}function Qe({frameAnchor:t},{width:e,height:n,marginTop:r,marginRight:o,marginBottom:i,marginLeft:s}){return[/left$/.test(t)?s:/right$/.test(t)?e-o:(s+e-o)/2,/^top/.test(t)?r:/^bottom/.test(t)?n-i:(r+n-i)/2]}var lt=class{constructor(e,n={},r={},o){let{facet:i="auto",facetAnchor:s,fx:a,fy:c,sort:f,dx:u=0,dy:p=0,margin:l=0,marginTop:d=l,marginRight:h=l,marginBottom:m=l,marginLeft:x=l,className:g,clip:y=o?.clip,channels:b,tip:w,render:_}=r;if(this.data=e,this.sort=Oo(f)?f:null,this.initializer=Kt(r).initializer,this.transform=this.initializer?r.transform:Ce(r).transform,i===null||i===!1?this.facet=null:(this.facet=Oe(i===!0?"include":i,"facet",["auto","include","exclude","super"]),this.fx=e===Ts&&typeof a=="string"?[a]:a,this.fy=e===Ts&&typeof c=="string"?[c]:c),this.facetAnchor=YR(s),n=Wd(n),b!==void 0&&(n={...WG(b),...n}),o!==void 0&&(n={...tb(this,r,o),...n}),this.channels=Object.fromEntries(Object.entries(n).map(([v,A])=>{if(fr(A.value)){let{value:T,label:E=A.label,scale:N=A.scale}=A.value;A={...A,label:E,scale:N,value:T}}if(e===Ts&&typeof A.value=="string"){let{value:T}=A;A={...A,value:[T]}}return[v,A]}).filter(([v,{value:A,optional:T}])=>{if(A!=null)return!0;if(T)return!1;throw new Error(`missing channel value: ${v}`)})),this.dx=+u,this.dy=+p,this.marginTop=+d,this.marginRight=+h,this.marginBottom=+m,this.marginLeft=+x,this.clip=R1(y),this.tip=VG(w),this.className=g?Fs(g):null,this.facet==="super"){if(a||c)throw new Error("super-faceting cannot use fx or fy");for(let v in this.channels){let{scale:A}=n[v];if(!(A!=="x"&&A!=="y"))throw new Error("super-faceting cannot use x or y")}}_!=null&&(this.render=Yi(_,this.render))}initialize(e,n,r){let o=Ri(this.data);e===void 0&&o!=null&&(e=[Fn(o)]);let i=e;this.transform!=null&&({facets:e,data:o}=this.transform(o,e,r),o=Ri(o)),e!==void 0&&(e.original=i);let s=z1(this.channels,o);return this.sort!=null&&WL(o,e,s,n,this.sort),{data:o,facets:e,channels:s}}filter(e,n,r){for(let o in n){let{filter:i=oe}=n[o];if(i!==null){let s=r[o];e=e.filter(a=>i(s[a]))}}return e}project(e,n,r){for(let o in e)if(e[o].scale==="x"&&/^x|x$/.test(o)){let i=o.replace(/^x|x$/,"y");i in e&&e[i].scale==="y"&&i4(o,i,n,r.projection)}}scale(e,n,r){let o=lu(e,n);return r.projection&&this.project(e,o,r),o}};function ke(...t){return t.plot=lt.prototype.plot,t}function Yi(t,e){if(t==null)return e===null?void 0:e;if(e==null)return t===null?void 0:t;if(typeof t!="function")throw new TypeError(`invalid render transform: ${t}`);if(typeof e!="function")throw new TypeError(`invalid render transform: ${e}`);return function(n,r,o,i,s,a){return t.call(this,n,r,o,i,s,(c,f,u,p,l)=>e.call(this,c,f,u,p,l,a))}}function WG(t){return Object.fromEntries(Object.entries(Wd(t)).map(([e,n])=>(n=typeof n=="string"?{value:n,label:e}:$r(n),n.filter===void 0&&n.scale==null&&(n={...n,filter:null}),[e,n])))}function VG(t){return t===!0?"xy":t===!1||t==null?null:typeof t=="string"?Oe(t,"tip",["x","y","xy"]):t}function Jr(t,e){return t?.tip===!0?{...t,tip:e}:Ve(t?.tip)&&t.tip.pointer===void 0?{...t,tip:{...t.tip,pointer:e}}:t}function eO(t,e,n={}){let r=.5-le,o=.5+le,i=.5+le,s=.5-le;for(let{marginTop:m,marginRight:x,marginBottom:g,marginLeft:y}of e)m>r&&(r=m),x>o&&(o=x),g>i&&(i=g),y>s&&(s=y);let{margin:a,marginTop:c=a!==void 0?a:r,marginRight:f=a!==void 0?a:o,marginBottom:u=a!==void 0?a:i,marginLeft:p=a!==void 0?a:s}=n;c=+c,f=+f,u=+u,p=+p;let{width:l=640,height:d=GG(t,n,{width:l,marginTopDefault:r,marginRightDefault:o,marginBottomDefault:i,marginLeftDefault:s})+Math.max(0,c-r+u-i)}=n;l=+l,d=+d;let h={width:l,height:d,marginTop:c,marginRight:f,marginBottom:u,marginLeft:p};if(t.fx||t.fy){let{margin:m,marginTop:x=m!==void 0?m:c,marginRight:g=m!==void 0?m:f,marginBottom:y=m!==void 0?m:u,marginLeft:b=m!==void 0?m:p}=n.facet??{};x=+x,g=+g,y=+y,b=+b,h.facet={marginTop:x,marginRight:g,marginBottom:y,marginLeft:b}}return h}function GG({x:t,y:e,fy:n,fx:r},{projection:o,aspectRatio:i},{width:s,marginTopDefault:a,marginRightDefault:c,marginBottomDefault:f,marginLeftDefault:u}){let p=n&&n.scale.domain().length||1,l=VR(o);if(l){let h=r?r.scale.domain().length:1,m=(1.1*p-.1)/(1.1*h-.1)*l,x=Math.max(.1,Math.min(10,m));return Math.round((s-u-c)*x+a+f)}let d=e?qo(e)?e.scale.domain().length||1:Math.max(7,17/p):1;if(i!=null){if(i=+i,!(isFinite(i)&&i>0))throw new Error(`invalid aspectRatio: ${i}`);let h=tO("y",e)/(tO("x",t)*i),m=r?r.scale.bandwidth():1,x=n?n.scale.bandwidth():1,g=m*(s-u-c)-t.insetLeft-t.insetRight;return(h*g+e.insetTop+e.insetBottom)/x+a+f}return!!(e||n)*Math.max(1,Math.min(60,d*p))*20+!!r*30+60}function tO(t,e){if(!e)throw new Error(`aspectRatio requires ${t} scale`);let{type:n,domain:r}=e,o;switch(n){case"linear":case"utc":case"time":o=Number;break;case"pow":{let a=e.scale.exponent();o=c=>Math.pow(c,a);break}case"log":o=Math.log;break;case"point":case"band":return r.length;default:throw new Error(`unsupported ${t} scale for aspectRatio: ${n}`)}let[i,s]=Ft(r);return Math.abs(o(s)-o(i))}var nO=new WeakMap;function f4(t,e,{x:n,y:r,px:o,py:i,maxRadius:s=40,channels:a,render:c,...f}={}){return s=+s,o!=null&&(n??=null,a={...a,px:{value:o,scale:"x"}}),i!=null&&(r??=null,a={...a,py:{value:i,scale:"y"}}),{x:n,y:r,channels:a,...f,render:Yi(function(u,p,l,d,h,m){h={...h,pointerSticky:!1};let x=h.ownerSVGElement,{data:g}=h.getMarkState(this),y=nO.get(x);y||nO.set(x,y={sticky:!1,roots:[],renders:[]});let b=y.renders.push(V)-1,{x:w,y:_,fx:v,fy:A}=p,T=v?v(u.fx)-d.marginLeft:0,E=A?A(u.fy)-d.marginTop:0;w?.bandwidth&&(T+=w.bandwidth()/2),_?.bandwidth&&(E+=_.bandwidth()/2);let N=u.fi!=null,M;if(N){let j=y.facetStates;j||(y.facetStates=j=new Map),M=j.get(this),M||j.set(this,M=new Map)}let[k,O]=Qe(this,d),{px:S,py:I}=l,C=S?j=>S[j]:u4(l,k),L=I?j=>I[j]:l4(l,O),D,$,P,F;function q(j,nt){if(N)if(F&&(F=cancelAnimationFrame(F)),j==null)M.delete(u.fi);else{M.set(u.fi,nt),F=requestAnimationFrame(()=>{F=null;for(let[Y,G]of M)if(G<nt||G===nt&&Y<u.fi){j=null;break}V(j)});return}V(j)}function V(j){if(D===j&&P===y.sticky)return;D=j,P=h.pointerSticky=y.sticky;let nt=D==null?[]:[D];N&&(nt.fx=u.fx,nt.fy=u.fy,nt.fi=u.fi);let Y=m(nt,p,l,d,h);if($){if(N){let G=$.parentNode,tt=$.getAttribute("transform"),B=Y.getAttribute("transform");tt?Y.setAttribute("transform",tt):Y.removeAttribute("transform"),B?G.setAttribute("transform",B):G.removeAttribute("transform"),Y.removeAttribute("aria-label"),Y.removeAttribute("aria-description"),Y.removeAttribute("aria-hidden")}$.replaceWith(Y)}if(y.roots[b]=$=Y,!(D==null&&M?.size>1)){let G=D==null?null:Gn(g)?g[D]:g.get(D);h.dispatchValue(G)}return Y}function K(j){if(y.sticky||j.pointerType==="mouse"&&j.buttons===1)return;let[nt,Y]=hn(j);nt-=T,Y-=E;let G=nt<d.marginLeft||nt>d.width-d.marginRight?1:t,tt=Y<d.marginTop||Y>d.height-d.marginBottom?1:e,B=null,_t=s*s;for(let ct of u){let Ct=G*(C(ct)-nt),Lt=tt*(L(ct)-Y),Z=Ct*Ct+Lt*Lt;Z<=_t&&(B=ct,_t=Z)}if(B!=null&&(t!==1||e!==1)){let ct=C(B)-nt,Ct=L(B)-Y;_t=ct*ct+Ct*Ct}q(B,_t)}function et(j){j.pointerType==="mouse"&&D!=null&&(y.sticky&&y.roots.some(nt=>nt?.contains(j.target))||(y.sticky?(y.sticky=!1,y.renders.forEach(nt=>nt(null))):(y.sticky=!0,V(D)),j.stopImmediatePropagation()))}function rt(j){j.pointerType==="mouse"&&(y.sticky||q(null))}return x.addEventListener("pointerenter",K),x.addEventListener("pointermove",K),x.addEventListener("pointerdown",et),x.addEventListener("pointerleave",rt),V(null)},c)}}function qs(t){return f4(1,1,t)}function Bs(t){return f4(1,.01,t)}function Ui(t){return f4(.01,1,t)}function u4({x1:t,x2:e,x:n=t},r){return t&&e?o=>(t[o]+e[o])/2:n?o=>n[o]:()=>r}function l4({y1:t,y2:e,y:n=t},r){return t&&e?o=>(t[o]+e[o])/2:n?o=>n[o]:()=>r}function nb(t){return qo(t)&&t.interval===void 0?void 0:"tabular-nums"}function rO(t,e){let{label:n=t.label,tickSize:r=6,width:o=240,height:i=44+r,marginTop:s=18,marginRight:a=0,marginBottom:c=16+r,marginLeft:f=0,style:u,ticks:p=(o-f-a)/64,tickFormat:l,fontVariant:d=nb(t),round:h=!0,opacity:m,className:x}=e,g=Ds(e);x=Fs(x),m=Ut(m)[1],l===null&&(l=()=>null);let y=ot("svg",g).attr("class",`${x}-ramp`).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",o).attr("height",i).attr("viewBox",`0 0 ${o} ${i}`).call(k=>k.append("style").text(`:where(.${x}-ramp) {
17
8
  display: block;
18
9
  height: auto;
19
10
  height: intrinsic;
20
11
  max-width: 100%;
21
12
  overflow: visible;
22
13
  }
23
- :where(.${y}-ramp text) {
14
+ :where(.${x}-ramp text) {
24
15
  white-space: pre;
25
- }`)).call(Kf,u),b=O=>O.selectAll(".tick line").attr("y1",s+c-o),w,v=p?(O,L)=>O.rangeRound(L):(O,L)=>O.range(L),{type:_,domain:A,range:E,interpolate:T,scale:D,pivot:I}=e;if(T){let O=E===void 0?T:To(T.length===1?py(T):T,E);w=v(D.copy(),$n(Ie(l,i-a),Math.min(A.length+(I!==void 0),E===void 0?1/0:E.length)));let L=256,S=g.document.createElement("canvas");S.width=L,S.height=1;let M=S.getContext("2d");for(let N=0,R=L-1;N<L;++N)M.fillStyle=O(N/R),M.fillRect(N,0,1,1);x.append("image").attr("opacity",m).attr("x",l).attr("y",s).attr("width",i-l-a).attr("height",o-s-c).attr("preserveAspectRatio","none").attr("xlink:href",S.toDataURL())}else if(_==="threshold"){let O=A,L=h===void 0?S=>S:typeof h=="string"?di(h):h;w=v(Us().domain([-1,E.length-1]),[l,i-a]),x.append("g").attr("fill-opacity",m).selectAll().data(E).enter().append("rect").attr("x",(S,M)=>w(M-1)).attr("y",s).attr("width",(S,M)=>w(M)-w(M-1)).attr("height",o-s-c).attr("fill",S=>S),f=Wt(O,(S,M)=>M),h=S=>L(O[S],S)}else w=v(qa().domain(A),[l,i-a]),x.append("g").attr("fill-opacity",m).selectAll().data(A).enter().append("rect").attr("x",w).attr("y",s).attr("width",Math.max(0,w.bandwidth()-1)).attr("height",o-s-c).attr("fill",D),b=()=>{};return x.append("g").attr("transform",`translate(0,${o-c})`).call(kI(w).ticks(Array.isArray(f)?null:f,typeof h=="string"?h:void 0).tickFormat(typeof h=="function"?h:void 0).tickSize(r).tickValues(Array.isArray(f)?f:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",de(d,"normal")).call(b).call(O=>O.select(".domain").remove()),n!==void 0&&x.append("text").attr("x",l).attr("y",s-6).attr("fill","currentColor").attr("font-weight","bold").text(n),x.node()}var eh=Math.PI/180;function Gi(e,{marker:t,markerStart:n=t,markerMid:r=t,markerEnd:i=t}={}){e.markerStart=AT(n),e.markerMid=AT(r),e.markerEnd=AT(i)}function AT(e){if(e==null||e===!1)return null;if(e===!0)return E$;if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"none":return null;case"arrow":return T$("auto");case"arrow-reverse":return T$("auto-start-reverse");case"dot":return kK;case"circle":case"circle-fill":return E$;case"circle-stroke":return RK;case"tick":return MT("auto");case"tick-x":return MT(90);case"tick-y":return MT(0)}throw new Error(`invalid marker: ${e}`)}function T$(e){return(t,n)=>ut("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 kK(e,t){return ut("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 E$(e,t){return ut("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 RK(e,t){return ut("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 MT(e){return(t,n)=>ut("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 FK=0;function sa(e,t,{stroke:n},r){return D$(e,t,n&&(i=>n[i]),r)}function N$(e,t,{stroke:n},r){return D$(e,t,n&&(([i])=>n[i]),r)}function D$(e,{markerStart:t,markerMid:n,markerEnd:r,stroke:i},o=()=>i,s){let a=new Map;function c(l){return function(u){let f=o(u),h=a.get(l);h||a.set(l,h=new Map);let d=h.get(f);if(!d){let p=this.parentNode.insertBefore(l(f,s),this),m=`plot-marker-${++FK}`;p.setAttribute("id",m),h.set(f,d=`url(#${m})`)}return d}}t&&e.attr("marker-start",c(t)),n&&e.attr("marker-mid",c(n)),r&&e.attr("marker-end",c(r))}function Pl({inset:e,insetLeft:t,insetRight:n,...r}={}){return[t,n]=O$(e,t,n),{inset:e,insetLeft:t,insetRight:n,...r}}function Ul({inset:e,insetTop:t,insetBottom:n,...r}={}){return[t,n]=O$(e,t,n),{inset:e,insetTop:t,insetBottom:n,...r}}function O$(e,t,n){return e===void 0&&t===void 0&&n===void 0?Ce?[1,0]:[.5,.5]:[t,n]}function B$(e,{interval:t}){return e={...bi(e)},e.interval=zf(e.interval===void 0?t:e.interval),e}function o_(e,t,n,r){let{[e]:i,[`${e}1`]:o,[`${e}2`]:s}=n,{value:a,interval:c}=B$(i,n);if(a==null||c==null&&!r)return n;let l=Cn(i);if(c==null){let d,p={transform:m=>d||(d=wt(m,a)),label:l};return{...n,[e]:void 0,[`${e}1`]:o===void 0?p:o,[`${e}2`]:s===void 0&&!(o===s&&r)?p:s}}let u,f;function h(d){return f!==void 0&&d===u?f:f=Wt(wt(u=d,a),p=>c.floor(p))}return t({...n,[e]:void 0,[`${e}1`]:o===void 0?{transform:h,label:l}:o,[`${e}2`]:s===void 0?{transform:d=>h(d).map(p=>c.offset(p)),label:l}:s})}function L$(e,t,n){let{[e]:r}=n,{value:i,interval:o}=B$(r,n);return i==null||o==null?n:t({...n,[e]:{label:Cn(r),transform:s=>{let a=Wt(wt(s,i),l=>o.floor(l)),c=a.map(l=>o.offset(l));return a.map(Le(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 TT(e={}){return o_("x",Pl,e,!0)}function ET(e={}){return o_("y",Ul,e,!0)}function s_(e={}){return o_("x",Pl,e)}function a_(e={}){return o_("y",Ul,e)}function c_(e={}){return L$("x",Pl,e)}function l_(e={}){return L$("y",Ul,e)}var C$={ariaLabel:"rule",fill:null,stroke:"currentColor"},xy=class extends vt{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}},Xi(n,"x"),C$),this.insetTop=Lt(a),this.insetBottom=Lt(c),Gi(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y1:l,y2:u}=r,{width:f,height:h,marginTop:d,marginRight:p,marginLeft:m,marginBottom:y}=i,{insetTop:g,insetBottom:x}=this;return ut("svg:g",o).call(kt,this,i,o).call(Et,this,{x:c&&s},Ce,0).call(b=>b.selectAll().data(t).enter().append("line").call(Ct,this).attr("x1",c?w=>c[w]:(m+f-p)/2).attr("x2",c?w=>c[w]:(m+f-p)/2).attr("y1",l&&!fr(a)?w=>l[w]+g:d+g).attr("y2",u&&!fr(a)?a.bandwidth?w=>u[w]+a.bandwidth()-x:w=>u[w]-x:h-y-x).call(Kt,this,r).call(sa,this,r,o)).node()}},by=class extends vt{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}},Xi(n,"y"),C$),this.insetRight=Lt(a),this.insetLeft=Lt(c),Gi(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{y:c,x1:l,x2:u}=r,{width:f,height:h,marginTop:d,marginRight:p,marginLeft:m,marginBottom:y}=i,{insetLeft:g,insetRight:x}=this;return ut("svg:g",o).call(kt,this,i,o).call(Et,this,{y:c&&a},0,Ce).call(b=>b.selectAll().data(t).enter().append("line").call(Ct,this).attr("x1",l&&!fr(s)?w=>l[w]+g:m+g).attr("x2",u&&!fr(s)?s.bandwidth?w=>u[w]+s.bandwidth()-x:w=>u[w]-x:f-p-x).attr("y1",c?w=>c[w]:(d+h-y)/2).attr("y2",c?w=>c[w]:(d+h-y)/2).call(Kt,this,r).call(sa,this,r,o)).node()}};function Gr(e,t){let{x:n=H,y:r,y1:i,y2:o,...s}=a_(t);return[i,o]=k$(r,i,o),new xy(e,{...s,x:n,y1:i,y2:o})}function Wr(e,t){let{y:n=H,x:r,x1:i,x2:o,...s}=s_(t);return[i,o]=k$(r,i,o),new by(e,{...s,y:n,x1:i,x2:o})}function k$(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 lc(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 $K={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"},U$="\xAD",ql=class extends vt{constructor(t,n={}){let{x:r,y:i,text:o=ur(t)&&Ow(t)?H:Ne,frameAnchor:s,textAnchor:a=/right$/i.test(s)?"end":/left$/i.test(s)?"start":"middle",lineAnchor:c=/^top/i.test(s)?"top":/^bottom/i.test(s)?"bottom":"middle",lineHeight:l=1,lineWidth:u=1/0,textOverflow:f,monospace:h,fontFamily:d=h?"ui-monospace, monospace":void 0,fontSize:p,fontStyle:m,fontVariant:y,fontWeight:g,rotate:x}=n,[b,w]=ce(x,0),[v,_]=qK(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:XF(b),optional:!0},text:{value:o,filter:ey,optional:!0}},n,$K),this.rotate=w,this.textAnchor=de(a,"middle"),this.lineAnchor=cn(c,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+l,this.lineWidth=+u,this.textOverflow=DT(f),this.monospace=!!h,this.fontFamily=qe(d),this.fontSize=_,this.fontStyle=qe(m),this.fontVariant=qe(y),this.fontWeight=qe(g),this.frameAnchor=Xo(s),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${u}`);this.splitLines=BT(this),this.clipLine=LT(this)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,rotate:u,text:f,title:h,fontSize:d}=r,{rotate:p}=this,[m,y]=_n(this,i);return ut("svg:g",o).call(kt,this,i,o).call(OT,this,f,i).call(Et,this,{x:c&&s,y:l&&a}).call(g=>g.selectAll().data(t).enter().append("text").call(Ct,this).call(PK,this,f,h).attr("transform",lc`translate(${c?x=>c[x]:m},${l?x=>l[x]:y})${u?x=>` rotate(${u[x]})`:p?` rotate(${p})`:""}`).call(ft,"font-size",d&&(x=>d[x])).call(Kt,this,r)).node()}};function DT(e){return e==null?null:cn(e,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function PK(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(Ho(n[l])??"").map(c),f=u.length,h=i==="top"?.71:i==="bottom"?1-f:(164-f*100)/200;if(f>1){let d=0;for(let p=0;p<f;++p){if(++d,!u[p])continue;let m=this.ownerDocument.createElementNS(li.svg,"tspan");m.setAttribute("x",0),p===d-1?m.setAttribute("y",`${(h+p)*o}em`):m.setAttribute("dy",`${d*o}em`),m.textContent=u[p],this.appendChild(m),d=0}}else h&&this.setAttribute("y",`${h*o}em`),this.textContent=u[0];if(s&&!r&&u[0]!==n[l]){let d=this.ownerDocument.createElementNS(li.svg,"title");d.textContent=n[l],this.appendChild(d)}})}function Zo(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=$e(t,n)),new ql(e,{...r,x:t,y:n})}function u_(e,{x:t=H,...n}={}){return new ql(e,l_({...n,x:t}))}function f_(e,{y:t=H,...n}={}){return new ql(e,c_({...n,y:t}))}function OT(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?UK(n):t.fontVariant),ft(e,"font-weight",t.fontWeight)}function UK(e){return e&&(Ks(e)||Le(e))?"tabular-nums":void 0}var zK=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function qK(e){return e==null||typeof e=="number"?[void 0,e]:typeof e!="string"?[e,void 0]:(e=e.trim().toLowerCase(),zK.has(e)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(e)?[void 0,e]:[e,void 0])}function jK(e,t,n){let r=[],i,o=0;for(let[s,a,c]of VK(e)){if(i===void 0&&(i=s),o>i&&n(e,i,a)>t&&(r.push(e.slice(i,o)+(e[o-1]===U$?"-":"")),i=s),c){r.push(e.slice(i,a)),i=void 0;continue}o=a}return r}function*VK(e){let t=0,n=0,r=e.length;for(;n<r;){let i=1;switch(e[n]){case U$:case"-":++n,yield[t,n,!1],t=n;break;case" ":for(yield[t,n,!1];e[++n]===" ";);t=n;break;case"\r":e[n+1]===`
26
- `&&++i;case`
27
- `:yield[t,n,!0],n+=i,t=n;break;default:++n;break}}yield[t,n,!0]}var R$={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 h_(e,t=0,n=e.length){let r=0;for(let i=t;i<n;i=nh(e,i))r+=R$[e[i]]??(q$(e,i)?120:R$.e);return r}function d_(e,t=0,n=e.length){let r=0;for(let i=t;i<n;i=nh(e,i))r+=q$(e,i)?126:63;return r}function BT({monospace:e,lineWidth:t,textOverflow:n}){if(n!=null||t==1/0)return o=>o.split(/\r\n?|\n/g);let r=e?d_:h_,i=t*100;return o=>jK(o,i,r)}function LT({monospace:e,lineWidth:t,textOverflow:n}){if(n==null||t==1/0)return o=>o;let r=e?d_:h_,i=t*100;switch(n){case"clip-start":return o=>$$(o,i,r,"");case"clip-end":return o=>F$(o,i,r,"");case"ellipsis-start":return o=>$$(o,i,r,zl);case"ellipsis-middle":return o=>YK(o,i,r,zl);case"ellipsis-end":return o=>F$(o,i,r,zl)}}var zl="\u2026";function jl(e,t,n,r){let i=[],o=0;for(let s=0,a=0,c=e.length;s<c;s=a){a=nh(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 F$(e,t,n,r){e=e.trim();let i=n(r),[o]=jl(e,t,n,i);return o<0?e:e.slice(0,o).trimEnd()+r}function YK(e,t,n,r){e=e.trim();let i=n(e);if(i<=t)return e;let o=n(r)/2,[s,a]=jl(e,t/2,n,o),[c]=jl(e,i-t/2-a+o,n,-o);return c<0?r:e.slice(0,s).trimEnd()+r+e.slice(nh(e,c)).trimStart()}function $$(e,t,n,r){e=e.trim();let i=n(e);if(i<=t)return e;let o=n(r),[s]=jl(e,i-t+o,n,-o);return s<0?r:r+e.slice(nh(e,s)).trimStart()}var NT=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,P$=/\p{Extended_Pictographic}/uy;function nh(e,t){return t+=XK(e,t)?2:1,WK(e,t)&&(t=NT.lastIndex),GK(e,t)?nh(e,t+1):t}function z$(e,t){return e.charCodeAt(t)<128}function XK(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 GK(e,t){return e.charCodeAt(t)===8205}function WK(e,t){return z$(e,t)?!1:(NT.lastIndex=t,NT.test(e))}function q$(e,t){return z$(e,t)?!1:(P$.lastIndex=t,P$.test(e))}var j$={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},V$=3.5,HK=V$*5,Y$={draw(e,t,n){let r=t*n/HK;e.moveTo(0,0),e.lineTo(0,-t),e.moveTo(-r,r-t),e.lineTo(0,-t),e.lineTo(r,r-t)}},X$={draw(e,t,n){e.moveTo(-n,0),e.lineTo(0,-t),e.lineTo(n,0)}},ZK=new Map([["arrow",Y$],["spike",X$]]);function JK(e){return e&&typeof e.draw=="function"}function QK(e){if(JK(e))return e;let t=ZK.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid shape: ${e}`)}var Vl=class extends vt{constructor(t,n={}){let{x:r,y:i,r:o=V$,length:s,rotate:a,shape:c=Y$,anchor:l="middle",frameAnchor:u}=n,[f,h]=ce(s,12),[d,p]=ce(a,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},length:{value:f,scale:"length",optional:!0},rotate:{value:d,optional:!0}},n,j$),this.r=+o,this.length=h,this.rotate=p,this.shape=QK(c),this.anchor=cn(l,"anchor",["start","middle","end"]),this.frameAnchor=Xo(u)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,length:u,rotate:f}=r,{length:h,rotate:d,anchor:p,shape:m,r:y}=this,[g,x]=_n(this,i);return ut("svg:g",o).call(kt,this,i,o).call(Et,this,{x:c&&s,y:l&&a}).call(b=>b.selectAll().data(t).enter().append("path").call(Ct,this).attr("transform",lc`translate(${c?w=>c[w]:g},${l?w=>l[w]:x})${f?w=>` rotate(${f[w]})`:d?` rotate(${d})`:""}${p==="start"?"":p==="end"?u?w=>` translate(0,${u[w]})`:` translate(0,${h})`:u?w=>` translate(0,${u[w]/2})`:` translate(0,${h/2})`}`).attr("d",u?w=>{let v=rr();return m.draw(v,u[w],y),v}:(()=>{let w=rr();return m.draw(w,h,y),w})()).call(Kt,this,r)).node()}};function CT(e,t={}){let{x:n,y:r,...i}=t;return t.frameAnchor===void 0&&([n,r]=$e(n,r)),new Vl(e,{...i,x:n,y:r})}function p_(e,t={}){let{x:n=H,...r}=t;return new Vl(e,{...r,x:n})}function m_(e,t={}){let{y:n=H,...r}=t;return new Vl(e,{...r,y:n})}function G$(e,t={}){let{shape:n=X$,stroke:r=j$.stroke,strokeWidth:i=1,fill:o=r,fillOpacity:s=.3,anchor:a="start",...c}=t;return CT(e,{...c,shape:n,stroke:r,strokeWidth:i,fill:o,fillOpacity:s,anchor:a})}function uc(e,t){return arguments.length<2&&!ur(e)&&(t=e,e=null),t===void 0&&(t={}),[e,t]}function y_({anchor:e}={},t){return e===void 0?t[0]:cn(e,"anchor",t)}function W$(e){return y_(e,["left","right"])}function H$(e){return y_(e,["right","left"])}function Z$(e){return y_(e,["bottom","top"])}function J$(e){return y_(e,["top","bottom"])}function wy(){let[e,t]=uc(...arguments);return Q$("y",W$(t),e,t)}function g_(){let[e,t]=uc(...arguments);return Q$("fy",H$(t),e,t)}function _y(){let[e,t]=uc(...arguments);return K$("x",Z$(t),e,t)}function x_(){let[e,t]=uc(...arguments);return K$("fx",J$(t),e,t)}function Q$(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:s=i,strokeWidth:a=1,fill:c=r,fillOpacity:l=i,textAnchor:u,textStroke:f,textStrokeOpacity:h,textStrokeWidth:d,tickSize:p=e==="y"?6:0,tickPadding:m,tickRotate:y,x:g,margin:x,marginTop:b=x===void 0?20:x,marginRight:w=x===void 0?t==="right"?40:0:x,marginBottom:v=x===void 0?20:x,marginLeft:_=x===void 0?t==="left"?40:0:x,label:A,labelAnchor:E,labelArrow:T,labelOffset:D,...I}){return p=Lt(p),m=Lt(m),y=Lt(y),E!==void 0&&(E=cn(E,"labelAnchor",["center","top","bottom"])),T=a9(T),nn(p&&!oe(o)?KK(e,t,n,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:m,tickRotate:y,x:g,...I}):null,oe(c)?null:ett(e,t,n,{fill:c,fillOpacity:l,stroke:f,strokeOpacity:h,strokeWidth:d,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:y,x:g,marginTop:b,marginRight:w,marginBottom:v,marginLeft:_,...I}),!oe(c)&&A!==null?Zo([],r9({fill:c,fillOpacity:l,...I},function(O,L,S,M,N){let R=M[e],{marginTop:F,marginRight:k,marginBottom:$,marginLeft:P}=e==="y"&&N.inset||N,U=E??(R.bandwidth?"center":"top"),G=D??(t==="right"?k:P)-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-F:U==="bottom"?$-3:0,this.dx=t==="right"?G:-G,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[s9(e,R,{anchor:t,label:A,labelAnchor:U,labelArrow:T})]}}}})):null)}function K$(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:s=i,strokeWidth:a=1,fill:c=r,fillOpacity:l=i,textAnchor:u,textStroke:f,textStrokeOpacity:h,textStrokeWidth:d,tickSize:p=e==="x"?6:0,tickPadding:m,tickRotate:y,y:g,margin:x,marginTop:b=x===void 0?t==="top"?30:0:x,marginRight:w=x===void 0?20:x,marginBottom:v=x===void 0?t==="bottom"?30:0:x,marginLeft:_=x===void 0?20:x,label:A,labelAnchor:E,labelArrow:T,labelOffset:D,...I}){return p=Lt(p),m=Lt(m),y=Lt(y),E!==void 0&&(E=cn(E,"labelAnchor",["center","left","right"])),T=a9(T),nn(p&&!oe(o)?ttt(e,t,n,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:m,tickRotate:y,y:g,...I}):null,oe(c)?null:ntt(e,t,n,{fill:c,fillOpacity:l,stroke:f,strokeOpacity:h,strokeWidth:d,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:y,y:g,marginTop:b,marginRight:w,marginBottom:v,marginLeft:_,...I}),!oe(c)&&A!==null?Zo([],r9({fill:c,fillOpacity:l,...I},function(O,L,S,M,N){let R=M[e],{marginTop:F,marginRight:k,marginBottom:$,marginLeft:P}=e==="x"&&N.inset||N,U=E??(R.bandwidth?"center":"right"),G=D??(t==="top"?F:$)-3;return U==="center"?(this.frameAnchor=t,this.textAnchor=void 0):(this.frameAnchor=`${t}-${U}`,this.textAnchor=U==="right"?"end":"start"),this.lineAnchor=t,this.dy=t==="top"?-G:G,this.dx=U==="right"?k-3:U==="left"?3-P:0,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[s9(e,R,{anchor:t,label:A,labelAnchor:U,labelArrow:T})]}}}})):null)}function KK(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:s=t+(e==="y"?"-empty":""),frameAnchor:a=t,tickSize:c,inset:l=0,insetLeft:u=l,insetRight:f=l,dx:h=0,y:d=e==="y"?void 0:null,...p}){return rh(m_,e,n,{ariaLabel:`${e}-axis tick`,ariaHidden:!0},{strokeWidth:r,strokeLinecap:i,strokeLinejoin:o,facetAnchor:s,frameAnchor:a,y:d,...p,dx:t==="left"?+h-Ce+ +u:+h+Ce-f,anchor:"start",length:c,shape:t==="left"?stt:att})}function ttt(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:s=t+(e==="x"?"-empty":""),frameAnchor:a=t,tickSize:c,inset:l=0,insetTop:u=l,insetBottom:f=l,dy:h=0,x:d=e==="x"?void 0:null,...p}){return rh(p_,e,n,{ariaLabel:`${e}-axis tick`,ariaHidden:!0},{strokeWidth:r,strokeLinejoin:o,strokeLinecap:i,facetAnchor:s,frameAnchor:a,x:d,...p,dy:t==="bottom"?+h-Ce-f:+h+Ce+ +u,anchor:"start",length:c,shape:t==="bottom"?itt:ott})}function ett(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*eh):0),text:c,textAnchor:l=Math.abs(s)>60?"middle":t==="left"?"end":"start",lineAnchor:u=s>60?"top":s<-60?"bottom":"middle",fontVariant:f,inset:h=0,insetLeft:d=h,insetRight:p=h,dx:m=0,y=e==="y"?void 0:null,...g}){return rh(f_,e,n,{ariaLabel:`${e}-axis tick label`},{facetAnchor:r,frameAnchor:i,text:c,textAnchor:l,lineAnchor:u,fontVariant:f,rotate:s,y,...g,dx:t==="left"?+m-o-a+ +d:+m+ +o+ +a-p},function(x,b,w,v,_){f===void 0&&(this.fontVariant=o9(x)),c===void 0&&(_.text=i9(x,b,w,v,t))})}function ntt(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*eh):0),text:c,textAnchor:l=Math.abs(s)>=10?s<0^t==="bottom"?"start":"end":"middle",lineAnchor:u=Math.abs(s)>=10?"middle":t==="bottom"?"top":"bottom",fontVariant:f,inset:h=0,insetTop:d=h,insetBottom:p=h,dy:m=0,x:y=e==="x"?void 0:null,...g}){return rh(u_,e,n,{ariaLabel:`${e}-axis tick label`},{facetAnchor:r,frameAnchor:i,text:c===void 0?null:c,textAnchor:l,lineAnchor:u,fontVariant:f,rotate:s,x:y,...g,dy:t==="bottom"?+m+ +o+ +a-p:+m-o-a+ +d},function(x,b,w,v,_){f===void 0&&(this.fontVariant=o9(x)),c===void 0&&(_.text=i9(x,b,w,v,t))})}function b_(){let[e,t]=uc(...arguments);return t9("y",W$(t),e,t)}function w_(){let[e,t]=uc(...arguments);return t9("fy",H$(t),e,t)}function __(){let[e,t]=uc(...arguments);return e9("x",Z$(t),e,t)}function v_(){let[e,t]=uc(...arguments);return e9("fx",J$(t),e,t)}function t9(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 rh(Wr,e,n,{ariaLabel:`${e}-grid`,ariaHidden:!0},{y:r,x1:o,x2:s,...n9(a)})}function e9(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 rh(Gr,e,n,{ariaLabel:`${e}-grid`,ariaHidden:!0},{x:r,y1:o,y2:s,...n9(a)})}function n9({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 r9({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]=Be(e),[,t]=ce(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 rh(e,t,n,r,i,o){let s;function a(u,f,h,d,p,m){let y=u==null&&(t==="fx"||t==="fy"),{[t]:g}=d;if(!g)throw new Error(`missing scale: ${t}`);let x=g.domain(),{interval:b,ticks:w,tickFormat:v,tickSpacing:_=t==="x"?80:35}=i;if(typeof w=="string"&&c9(g)&&(b=w,w=void 0),w===void 0&&(w=Yo(b,g.type)??rtt(g,_)),u==null){if(ur(w))u=je(w);else if(Qa(w))u=kT(w,...fe(x));else if(g.interval){let E=g.interval;if(g.ticks){let[T,D]=fe(x),I=(D-T)/E[Rf];E=D3(E,I/w)??E,u=kT(E,T,D)}else{u=x;let T=u.length;E=D3(E,T/w)??E,E!==g.interval&&(u=kT(E,...fe(u)))}if(E===g.interval){let T=Math.round(u.length/w);T>1&&(u=u.filter((D,I)=>I%T===0))}}else g.ticks?u=g.ticks(w):u=x;if(!g.ticks&&u.length&&u!==x){let E=new Kn(x);u=u.filter(T=>E.has(T)),u.length||Yn(`Warning: the ${t}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}t==="y"||t==="x"?f=[lr(u)]:s[t]={scale:t,value:H}}o?.call(this,g,u,w,v,s);let A=Object.fromEntries(Object.entries(s).map(([E,T])=>[E,{...T,value:wt(u,T.value)}]));return y&&(f=m.filterFacets(u,A)),{data:u,facets:f,channels:A}}let c=Me(i).initializer,l=e(n,Me({...i,initializer:a},c));return n==null?(s=l.channels,l.channels={}):s={},r!==void 0&&Object.assign(l,r),l.clip===void 0&&(l.clip=!1),l}function rtt(e,t){let[n,r]=fe(e.range());return(r-n)/t}function i9(e,t,n,r,i){return{value:vy(e,t,n,r,i)}}function vy(e,t,n,r,i){return typeof r=="function"&&!(e.type==="log"&&e.tickFormat)?r:r===void 0&&t&&Le(t)?$F(e.type,t,i)??Ho:e.tickFormat?e.tickFormat(typeof n=="number"?n:null,r):r===void 0?Ho:typeof r=="string"?(Le(e.domain())?Uo:di)(r):yn(r)}function kT(e,t,n){return e.range(t,e.offset(e.floor(n)))}var itt={draw(e,t){e.moveTo(0,0),e.lineTo(0,t)}},ott={draw(e,t){e.moveTo(0,0),e.lineTo(0,-t)}},stt={draw(e,t){e.moveTo(0,0),e.lineTo(-t,0)}},att={draw(e,t){e.moveTo(0,0),e.lineTo(t,0)}};function o9(e){return e.bandwidth&&!e.interval?void 0:"tabular-nums"}function s9(e,t,{anchor:n,label:r=t.label,labelAnchor:i,labelArrow:o}={}){if(!(r==null||r.inferred&&c9(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=Xw(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 a9(e="auto"){return oe(e)?!1:typeof e=="boolean"?e:cn(e,"labelArrow",["auto","up","right","down","left"])}function c9(e){return Le(e.domain())}function l9(e,t){if(t==null)return t;let n=e(t);if(!n)throw new Error(`scale not found: ${t}`);return n}function u9(e,{opacity:t,...n}={}){if(!Wo(e)&&!dT(e))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${e.type})`);return h9(e,n,(r,i,o,s)=>r.append("svg").attr("width",o).attr("height",s).attr("fill",i.scale).attr("fill-opacity",ce(t)[1]).append("rect").attr("width","100%").attr("height","100%"))}function f9(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:oe(t)?"currentColor":"none",strokeOpacity:i=1,strokeWidth:o=1.5,r:s=4.5,...a}={},c){let[l,u]=Be(t),[f,h]=Be(r),d=l9(c,l),p=l9(c,f),m=s*s*Math.PI;return n=ce(n)[1],i=ce(i)[1],o=ce(o)[1],h9(e,a,(y,g,x,b)=>y.append("svg").attr("viewBox","-8 -8 16 16").attr("width",x).attr("height",b).attr("fill",l==="color"?w=>d.scale(w):u).attr("fill-opacity",n).attr("stroke",f==="color"?w=>p.scale(w):h).attr("stroke-opacity",i).attr("stroke-width",o).append("path").attr("d",w=>{let v=rr();return e.scale(w).draw(v,m),v}))}function h9(e,t={},n){let{columns:r,tickFormat:i,fontVariant:o=i_(e),swatchSize:s=15,swatchWidth:a=s,swatchHeight:c=s,marginLeft:l=0,className:u,style:f,width:h}=t,d=sc(t);u=Qf(u),i=vy(e.scale,e.domain,void 0,i);let p=ut("div",d).attr("class",`${u}-swatches ${u}-swatches-${r!=null?"columns":"wrap"}`),m;return r!=null?(m=`:where(.${u}-swatches-columns .${u}-swatch) {
16
+ }`)).call(gu,u),b=k=>k.selectAll(".tick line").attr("y1",s+c-i),w,_=h?(k,O)=>k.rangeRound(O):(k,O)=>k.range(O),{type:v,domain:A,range:T,interpolate:E,scale:N,pivot:M}=t;if(E){let k=T===void 0?E:go(E.length===1?Kd(E):E,T);w=_(N.copy(),mn(ee(f,o-a),Math.min(A.length+(M!==void 0),T===void 0?1/0:T.length)));let O=256,S=g.document.createElement("canvas");S.width=O,S.height=1;let I=S.getContext("2d");for(let C=0,L=O-1;C<O;++C)I.fillStyle=k(C/L),I.fillRect(C,0,1,1);y.append("image").attr("opacity",m).attr("x",f).attr("y",s).attr("width",o-f-a).attr("height",i-s-c).attr("preserveAspectRatio","none").attr("xlink:href",S.toDataURL())}else if(v==="threshold"){let k=A,O=l===void 0?S=>S:typeof l=="string"?Ir(l):l;w=_(_i().domain([-1,T.length-1]),[f,o-a]),y.append("g").attr("fill-opacity",m).selectAll().data(T).enter().append("rect").attr("x",(S,I)=>w(I-1)).attr("y",s).attr("width",(S,I)=>w(I)-w(I-1)).attr("height",i-s-c).attr("fill",S=>S),p=Et(k,(S,I)=>I),l=S=>O(k[S],S)}else w=_(bs().domain(A),[f,o-a]),y.append("g").attr("fill-opacity",m).selectAll().data(A).enter().append("rect").attr("x",w).attr("y",s).attr("width",Math.max(0,w.bandwidth()-1)).attr("height",i-s-c).attr("fill",N),b=()=>{};return y.append("g").attr("transform",`translate(0,${i-c})`).call(x_(w).ticks(Array.isArray(p)?null:p,typeof l=="string"?l:void 0).tickFormat(typeof l=="function"?l:void 0).tickSize(r).tickValues(Array.isArray(p)?p:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",te(d,"normal")).call(b).call(k=>k.select(".domain").remove()),n!==void 0&&y.append("text").attr("x",f).attr("y",s-6).attr("fill","currentColor").attr("font-weight","bold").text(n),y.node()}var yu=Math.PI/180;function Kr(t,{marker:e,markerStart:n=e,markerMid:r=e,markerEnd:o=e}={}){t.markerStart=p4(n),t.markerMid=p4(r),t.markerEnd=p4(o)}function p4(t){if(t==null||t===!1)return null;if(t===!0)return iO;if(typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"none":return null;case"arrow":return oO("auto");case"arrow-reverse":return oO("auto-start-reverse");case"dot":return HG;case"circle":case"circle-fill":return iO;case"circle-stroke":return QG;case"tick":return d4("auto");case"tick-x":return d4(90);case"tick-y":return d4(0)}throw new Error(`invalid marker: ${t}`)}function oO(t){return(e,n)=>ot("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient",t).attr("fill","none").attr("stroke",e).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 HG(t,e){return ot("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","none").call(n=>n.append("circle").attr("r",2.5)).node()}function iO(t,e){return ot("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","var(--plot-background)").attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function QG(t,e){return ot("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","var(--plot-background)").attr("stroke",t).attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function d4(t){return(e,n)=>ot("svg:marker",n).attr("viewBox","-3 -3 6 6").attr("markerWidth",6).attr("markerHeight",6).attr("orient",t).attr("stroke",e).call(r=>r.append("path").attr("d","M0,-3v6")).node()}var ZG=0;function ji(t,e,{stroke:n},r){return cO(t,e,n&&(o=>n[o]),null,r)}function sO(t,e,{stroke:n,z:r},o){return cO(t,e,n&&(([i])=>n[i]),r,o)}var h4=1,aO=2;function JG(t,e){let n=new Uint8Array(e.length),r=t.data().filter(i=>i.length>1),o=r.length;for(let i=0,s=K1;i<o;++i){let a=r[i];if(a.length>1){let c=a[0];s!==(s=Or(e[c]))&&(n[c]|=h4)}}for(let i=o-1,s=K1;i>=0;--i){let a=r[i];if(a.length>1){let c=a[0];s!==(s=Or(e[c]))&&(n[c]|=aO)}}return([i])=>n[i]}function cO(t,{markerStart:e,markerMid:n,markerEnd:r,stroke:o},i=()=>o,s,a){if(!e&&!n&&!r)return;let c=new Map,f=s&&JG(t,s);function u(p,l,d){return function(h){if(d&&!d(h))return;let m=i(h),x=c.get(l);x||c.set(l,x=new Map);let g=x.get(m);if(!g){let y=this.parentNode.insertBefore(l(m,a),this),b=`plot-marker-${++ZG}`;y.setAttribute("id",b),x.set(m,g=`url(#${b})`)}this.setAttribute(p,g)}}e&&t.each(u("marker-start",e,f&&(p=>f(p)&h4))),n&&f&&t.each(u("marker-start",n,p=>!(f(p)&h4))),n&&t.each(u("marker-mid",n)),r&&t.each(u("marker-end",r,f&&(p=>f(p)&aO)))}function lc({inset:t,insetLeft:e,insetRight:n,...r}={}){return[e,n]=fO(t,e,n),{inset:t,insetLeft:e,insetRight:n,...r}}function pc({inset:t,insetTop:e,insetBottom:n,...r}={}){return[e,n]=fO(t,e,n),{inset:t,insetTop:e,insetBottom:n,...r}}function fO(t,e,n){return t===void 0&&e===void 0&&n===void 0?le?[1,0]:[.5,.5]:[e,n]}function uO(t,{interval:e}){return t={...$r(t)},t.interval=su(t.interval===void 0?e:t.interval),t}function rb(t,e,n,r){let{[t]:o,[`${t}1`]:i,[`${t}2`]:s}=n,{value:a,interval:c}=uO(o,n);if(a==null||c==null&&!r)return n;let f=un(o);if(c==null){let d,h={transform:m=>d||(d=ut(m,a)),label:f};return{...n,[t]:void 0,[`${t}1`]:i===void 0?h:i,[`${t}2`]:s===void 0&&!(i===s&&r)?h:s}}let u,p;function l(d){return p!==void 0&&d===u?p:p=Et(ut(u=d,a),h=>c.floor(h))}return e({...n,[t]:void 0,[`${t}1`]:i===void 0?{transform:l,label:f}:i,[`${t}2`]:s===void 0?{transform:d=>l(d).map(h=>c.offset(h)),label:f}:s})}function lO(t,e,n){let{[t]:r}=n,{value:o,interval:i}=uO(r,n);return o==null||i==null?n:e({...n,[t]:{label:un(r),transform:s=>{let a=Et(ut(s,o),f=>i.floor(f)),c=a.map(f=>i.offset(f));return a.map(fe(a)?(f,u)=>f==null||isNaN(f=+f)||(u=c[u],u==null)||isNaN(u=+u)?void 0:new Date((f+u)/2):(f,u)=>f==null||(u=c[u],u==null)?NaN:(+f+ +u)/2)}}})}function m4(t={}){return rb("x",lc,t,!0)}function x4(t={}){return rb("y",pc,t,!0)}function bu(t={}){return rb("x",lc,t)}function wu(t={}){return rb("y",pc,t)}function ob(t={}){return lO("x",lc,t)}function ib(t={}){return lO("y",pc,t)}var pO={ariaLabel:"rule",fill:null,stroke:"currentColor"},rh=class extends lt{constructor(e,n={}){let{x:r,y1:o,y2:i,inset:s=0,insetTop:a=s,insetBottom:c=s}=n;super(e,{x:{value:r,scale:"x",optional:!0},y1:{value:o,scale:"y",optional:!0},y2:{value:i,scale:"y",optional:!0}},Jr(n,"x"),pO),this.insetTop=Dt(a),this.insetBottom=Dt(c),Kr(this,n)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y1:f,y2:u}=r,{width:p,height:l,marginTop:d,marginRight:h,marginLeft:m,marginBottom:x}=o,{insetTop:g,insetBottom:y}=this;return ot("svg:g",i).call(wt,this,o,i).call(xt,this,{x:c&&s},le,0).call(b=>b.selectAll().data(e).enter().append("line").call(dt,this).attr("x1",c?w=>c[w]:(m+p-h)/2).attr("x2",c?w=>c[w]:(m+p-h)/2).attr("y1",f&&!lr(a)?w=>f[w]+g:d+g).attr("y2",u&&!lr(a)?a.bandwidth?w=>u[w]+a.bandwidth()-y:w=>u[w]-y:l-x-y).call(Tt,this,r).call(ji,this,r,i)).node()}},oh=class extends lt{constructor(e,n={}){let{x1:r,x2:o,y:i,inset:s=0,insetRight:a=s,insetLeft:c=s}=n;super(e,{y:{value:i,scale:"y",optional:!0},x1:{value:r,scale:"x",optional:!0},x2:{value:o,scale:"x",optional:!0}},Jr(n,"y"),pO),this.insetRight=Dt(a),this.insetLeft=Dt(c),Kr(this,n)}render(e,n,r,o,i){let{x:s,y:a}=n,{y:c,x1:f,x2:u}=r,{width:p,height:l,marginTop:d,marginRight:h,marginLeft:m,marginBottom:x}=o,{insetLeft:g,insetRight:y}=this;return ot("svg:g",i).call(wt,this,o,i).call(xt,this,{y:c&&a},0,le).call(b=>b.selectAll().data(e).enter().append("line").call(dt,this).attr("x1",f&&!lr(s)?w=>f[w]+g:m+g).attr("x2",u&&!lr(s)?s.bandwidth?w=>u[w]+s.bandwidth()-y:w=>u[w]-y:p-h-y).attr("y1",c?w=>c[w]:(d+l-x)/2).attr("y2",c?w=>c[w]:(d+l-x)/2).call(Tt,this,r).call(ji,this,r,i)).node()}};function pr(t,e){let{x:n=W,y:r,y1:o,y2:i,...s}=wu(e);return[o,i]=dO(r,o,i),new rh(t,{...s,x:n,y1:o,y2:i})}function dr(t,e){let{y:n=W,x:r,x1:o,x2:i,...s}=bu(e);return[o,i]=dO(r,o,i),new oh(t,{...s,y:n,x1:o,x2:i})}function dO(t,e,n){if(t==null){if(e===void 0){if(n!==void 0)return[0,n]}else if(n===void 0)return[0,e]}else{if(e===void 0)return n===void 0?[0,t]:[t,n];if(n===void 0)return[t,e]}return[e,n]}function to(t,...e){let n=e.length;for(let r=0,o=!0;r<n;++r)typeof e[r]!="function"&&(o&&(t=t.slice(),o=!1),t.splice(r,2,t[r]+e[r]+t[r+1]),e.splice(r,1),--r,--n);return r=>{let o=t[0];for(let i=0;i<n;++i)o+=e[i](r)+t[i+1];return o}}var KG={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"},yO="\xAD",hc=class extends lt{constructor(e,n={}){let{x:r,y:o,text:i=qn(e)&&C1(e)?W:Zt,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:f=1,lineWidth:u=1/0,textOverflow:p,monospace:l,fontFamily:d=l?"ui-monospace, monospace":void 0,fontSize:h,fontStyle:m,fontVariant:x,fontWeight:g,rotate:y}=n,[b,w]=Ut(y,0),[_,v]=rH(h);if(super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},fontSize:{value:_,optional:!0},rotate:{value:vL(b),optional:!0},text:{value:i,filter:qd,optional:!0}},n,KG),this.rotate=w,this.textAnchor=te(a,"middle"),this.lineAnchor=Oe(c,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+f,this.lineWidth=+u,this.textOverflow=y4(p),this.monospace=!!l,this.fontFamily=be(d),this.fontSize=v,this.fontStyle=be(m),this.fontVariant=be(x),this.fontWeight=be(g),this.frameAnchor=Do(s),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${u}`);this.splitLines=w4(this),this.clipLine=v4(this)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,rotate:u,text:p,title:l,fontSize:d}=r,{rotate:h}=this,[m,x]=Qe(this,o);return ot("svg:g",i).call(wt,this,o,i).call(b4,this,p,o).call(xt,this,{x:c&&s,y:f&&a}).call(g=>g.selectAll().data(e).enter().append("text").call(dt,this).call(tH,this,p,l).attr("transform",to`translate(${c?y=>c[y]:m},${f?y=>f[y]:x})${u?y=>` rotate(${u[y]})`:h?` rotate(${h})`:""}`).call(at,"font-size",d&&(y=>d[y])).call(Tt,this,r)).node()}};function y4(t){return t==null?null:Oe(t,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function tH(t,e,n,r){if(!n)return;let{lineAnchor:o,lineHeight:i,textOverflow:s,splitLines:a,clipLine:c}=e;t.each(function(f){let u=a(zo(n[f])??"").map(c),p=u.length,l=o==="top"?.71:o==="bottom"?1-p:(164-p*100)/200;if(p>1){let d=0;for(let h=0;h<p;++h){if(++d,!u[h])continue;let m=this.ownerDocument.createElementNS(Nn.svg,"tspan");m.setAttribute("x",0),h===d-1?m.setAttribute("y",`${(l+h)*i}em`):m.setAttribute("dy",`${d*i}em`),m.textContent=u[h],this.appendChild(m),d=0}}else l&&this.setAttribute("y",`${l*i}em`),this.textContent=u[0];if(s&&!r&&u[0]!==n[f]){let d=this.ownerDocument.createElementNS(Nn.svg,"title");d.textContent=n[f],this.appendChild(d)}})}function Yo(t,{x:e,y:n,...r}={}){return r.frameAnchor===void 0&&([e,n]=me(e,n)),new hc(t,{...r,x:e,y:n})}function sb(t,{x:e=W,...n}={}){return new hc(t,ib({...n,x:e}))}function ab(t,{y:e=W,...n}={}){return new hc(t,ob({...n,y:e}))}function b4(t,e,n){at(t,"text-anchor",e.textAnchor),at(t,"font-family",e.fontFamily),at(t,"font-size",e.fontSize),at(t,"font-style",e.fontStyle),at(t,"font-variant",e.fontVariant===void 0?eH(n):e.fontVariant),at(t,"font-weight",e.fontWeight)}function eH(t){return t&&(Di(t)||fe(t))?"tabular-nums":void 0}var nH=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function rH(t){return t==null||typeof t=="number"?[void 0,t]:typeof t!="string"?[t,void 0]:(t=t.trim().toLowerCase(),nH.has(t)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(t)?[void 0,t]:[t,void 0])}function oH(t,e,n){let r=[],o,i=0;for(let[s,a,c]of iH(t)){if(o===void 0&&(o=s),i>o&&n(t,o,a)>e&&(r.push(t.slice(o,i)+(t[i-1]===yO?"-":"")),o=s),c){r.push(t.slice(o,a)),o=void 0;continue}i=a}return r}function*iH(t){let e=0,n=0,r=t.length;for(;n<r;){let o=1;switch(t[n]){case yO:case"-":++n,yield[e,n,!1],e=n;break;case" ":for(yield[e,n,!1];t[++n]===" ";);e=n;break;case"\r":t[n+1]===`
17
+ `&&++o;case`
18
+ `:yield[e,n,!0],n+=o,e=n;break;default:++n;break}}yield[e,n,!0]}var hO={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 cb(t,e=0,n=t.length){let r=0;for(let o=e;o<n;o=vu(t,o))r+=hO[t[o]]??(wO(t,o)?120:hO.e);return r}function fb(t,e=0,n=t.length){let r=0;for(let o=e;o<n;o=vu(t,o))r+=wO(t,o)?126:63;return r}function w4({monospace:t,lineWidth:e,textOverflow:n}){if(n!=null||e==1/0)return i=>i.split(/\r\n?|\n/g);let r=t?fb:cb,o=e*100;return i=>oH(i,o,r)}function v4({monospace:t,lineWidth:e,textOverflow:n}){if(n==null||e==1/0)return i=>i;let r=t?fb:cb,o=e*100;switch(n){case"clip-start":return i=>xO(i,o,r,"");case"clip-end":return i=>mO(i,o,r,"");case"ellipsis-start":return i=>xO(i,o,r,dc);case"ellipsis-middle":return i=>sH(i,o,r,dc);case"ellipsis-end":return i=>mO(i,o,r,dc)}}var dc="\u2026";function mc(t,e,n,r){let o=[],i=0;for(let s=0,a=0,c=t.length;s<c;s=a){a=vu(t,s);let f=n(t,s,a);if(i+f>e){for(i+=r;i>e&&s>0;)a=s,s=o.pop(),i-=n(t,s,a);return[s,e-i]}i+=f,o.push(s)}return[-1,0]}function mO(t,e,n,r){t=t.trim();let o=n(r),[i]=mc(t,e,n,o);return i<0?t:t.slice(0,i).trimEnd()+r}function sH(t,e,n,r){t=t.trim();let o=n(t);if(o<=e)return t;let i=n(r)/2,[s,a]=mc(t,e/2,n,i),[c]=mc(t,o-e/2-a+i,n,-i);return c<0?r:t.slice(0,s).trimEnd()+r+t.slice(vu(t,c)).trimStart()}function xO(t,e,n,r){t=t.trim();let o=n(t);if(o<=e)return t;let i=n(r),[s]=mc(t,o-e+i,n,-i);return s<0?r:r+t.slice(vu(t,s)).trimStart()}var g4=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,gO=/\p{Extended_Pictographic}/uy;function vu(t,e){return e+=aH(t,e)?2:1,fH(t,e)&&(e=g4.lastIndex),cH(t,e)?vu(t,e+1):e}function bO(t,e){return t.charCodeAt(e)<128}function aH(t,e){let n=t.charCodeAt(e);if(n>=55296&&n<56320){let r=t.charCodeAt(e+1);return r>=56320&&r<57344}return!1}function cH(t,e){return t.charCodeAt(e)===8205}function fH(t,e){return bO(t,e)?!1:(g4.lastIndex=e,g4.test(t))}function wO(t,e){return bO(t,e)?!1:(gO.lastIndex=e,gO.test(t))}var vO={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},_O=3.5,uH=_O*5,SO={draw(t,e,n){let r=e*n/uH;t.moveTo(0,0),t.lineTo(0,-e),t.moveTo(-r,r-e),t.lineTo(0,-e),t.lineTo(r,r-e)}},MO={draw(t,e,n){t.moveTo(-n,0),t.lineTo(0,-e),t.lineTo(n,0)}},lH=new Map([["arrow",SO],["spike",MO]]);function pH(t){return t&&typeof t.draw=="function"}function dH(t){if(pH(t))return t;let e=lH.get(`${t}`.toLowerCase());if(e)return e;throw new Error(`invalid shape: ${t}`)}var xc=class extends lt{constructor(e,n={}){let{x:r,y:o,r:i=_O,length:s,rotate:a,shape:c=SO,anchor:f="middle",frameAnchor:u}=n,[p,l]=Ut(s,12),[d,h]=Ut(a,0);super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},length:{value:p,scale:"length",optional:!0},rotate:{value:d,optional:!0}},n,vO),this.r=+i,this.length=l,this.rotate=h,this.shape=dH(c),this.anchor=Oe(f,"anchor",["start","middle","end"]),this.frameAnchor=Do(u)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,length:u,rotate:p}=r,{length:l,rotate:d,anchor:h,shape:m,r:x}=this,[g,y]=Qe(this,o);return ot("svg:g",i).call(wt,this,o,i).call(xt,this,{x:c&&s,y:f&&a}).call(b=>b.selectAll().data(e).enter().append("path").call(dt,this).attr("transform",to`translate(${c?w=>c[w]:g},${f?w=>f[w]:y})${p?w=>` rotate(${p[w]})`:d?` rotate(${d})`:""}${h==="start"?"":h==="end"?u?w=>` translate(0,${u[w]})`:` translate(0,${l})`:u?w=>` translate(0,${u[w]/2})`:` translate(0,${l/2})`}`).attr("d",u?w=>{let _=Ln();return m.draw(_,u[w],x),_}:(()=>{let w=Ln();return m.draw(w,l,x),w})()).call(Tt,this,r)).node()}};function _4(t,e={}){let{x:n,y:r,...o}=e;return e.frameAnchor===void 0&&([n,r]=me(n,r)),new xc(t,{...o,x:n,y:r})}function ub(t,e={}){let{x:n=W,...r}=e;return new xc(t,{...r,x:n})}function lb(t,e={}){let{y:n=W,...r}=e;return new xc(t,{...r,y:n})}function AO(t,e={}){let{shape:n=MO,stroke:r=vO.stroke,strokeWidth:o=1,fill:i=r,fillOpacity:s=.3,anchor:a="start",...c}=e;return _4(t,{...c,shape:n,stroke:r,strokeWidth:o,fill:i,fillOpacity:s,anchor:a})}function zs(t,e){return arguments.length<2&&!qn(t)&&(e=t,t=null),e===void 0&&(e={}),[t,e]}function pb({anchor:t}={},e){return t===void 0?e[0]:Oe(t,"anchor",e)}function TO(t){return pb(t,["left","right"])}function EO(t){return pb(t,["right","left"])}function IO(t){return pb(t,["bottom","top"])}function NO(t){return pb(t,["top","bottom"])}function ih(){let[t,e]=zs(...arguments);return CO("y",TO(e),t,e)}function db(){let[t,e]=zs(...arguments);return CO("fy",EO(e),t,e)}function sh(){let[t,e]=zs(...arguments);return kO("x",IO(e),t,e)}function hb(){let[t,e]=zs(...arguments);return kO("fx",NO(e),t,e)}function CO(t,e,n,{color:r="currentColor",opacity:o=1,stroke:i=r,strokeOpacity:s=o,strokeWidth:a=1,fill:c=r,fillOpacity:f=o,textAnchor:u,textStroke:p,textStrokeOpacity:l,textStrokeWidth:d,tickSize:h=t==="y"?6:0,tickPadding:m,tickRotate:x,x:g,margin:y,marginTop:b=y===void 0?20:y,marginRight:w=y===void 0?e==="right"?40:0:y,marginBottom:_=y===void 0?20:y,marginLeft:v=y===void 0?e==="left"?40:0:y,label:A,labelAnchor:T,labelArrow:E,labelOffset:N,...M}){return h=Dt(h),m=Dt(m),x=Dt(x),T!==void 0&&(T=Oe(T,"labelAnchor",["center","top","bottom"])),E=qO(E),ke(h&&!zt(i)?hH(t,e,n,{stroke:i,strokeOpacity:s,strokeWidth:a,tickSize:h,tickPadding:m,tickRotate:x,x:g,...M}):null,zt(c)?null:xH(t,e,n,{fill:c,fillOpacity:f,stroke:p,strokeOpacity:l,strokeWidth:d,textAnchor:u,tickSize:h,tickPadding:m,tickRotate:x,x:g,marginTop:b,marginRight:w,marginBottom:_,marginLeft:v,...M}),!zt(c)&&A!==null?Yo([],$O({fill:c,fillOpacity:f,...M},function(k,O,S,I,C){let L=I[t],{marginTop:D,marginRight:$,marginBottom:P,marginLeft:F}=t==="y"&&C.inset||C,q=T??(L.bandwidth?"center":"top"),V=N??(e==="right"?$:F)-3;return q==="center"?(this.textAnchor=void 0,this.lineAnchor=e==="right"?"bottom":"top",this.frameAnchor=e,this.rotate=-90):(this.textAnchor=e==="right"?"end":"start",this.lineAnchor=q,this.frameAnchor=`${q}-${e}`,this.rotate=0),this.dy=q==="top"?3-D:q==="bottom"?P-3:0,this.dx=e==="right"?V:-V,this.ariaLabel=`${t}-axis label`,{facets:[[0]],channels:{text:{value:[FO(t,L,{anchor:e,label:A,labelAnchor:q,labelArrow:E})]}}}})):null)}function kO(t,e,n,{color:r="currentColor",opacity:o=1,stroke:i=r,strokeOpacity:s=o,strokeWidth:a=1,fill:c=r,fillOpacity:f=o,textAnchor:u,textStroke:p,textStrokeOpacity:l,textStrokeWidth:d,tickSize:h=t==="x"?6:0,tickPadding:m,tickRotate:x,y:g,margin:y,marginTop:b=y===void 0?e==="top"?30:0:y,marginRight:w=y===void 0?20:y,marginBottom:_=y===void 0?e==="bottom"?30:0:y,marginLeft:v=y===void 0?20:y,label:A,labelAnchor:T,labelArrow:E,labelOffset:N,...M}){return h=Dt(h),m=Dt(m),x=Dt(x),T!==void 0&&(T=Oe(T,"labelAnchor",["center","left","right"])),E=qO(E),ke(h&&!zt(i)?mH(t,e,n,{stroke:i,strokeOpacity:s,strokeWidth:a,tickSize:h,tickPadding:m,tickRotate:x,y:g,...M}):null,zt(c)?null:gH(t,e,n,{fill:c,fillOpacity:f,stroke:p,strokeOpacity:l,strokeWidth:d,textAnchor:u,tickSize:h,tickPadding:m,tickRotate:x,y:g,marginTop:b,marginRight:w,marginBottom:_,marginLeft:v,...M}),!zt(c)&&A!==null?Yo([],$O({fill:c,fillOpacity:f,...M},function(k,O,S,I,C){let L=I[t],{marginTop:D,marginRight:$,marginBottom:P,marginLeft:F}=t==="x"&&C.inset||C,q=T??(L.bandwidth?"center":"right"),V=N??(e==="top"?D:P)-3;return q==="center"?(this.frameAnchor=e,this.textAnchor=void 0):(this.frameAnchor=`${e}-${q}`,this.textAnchor=q==="right"?"end":"start"),this.lineAnchor=e,this.dy=e==="top"?-V:V,this.dx=q==="right"?$-3:q==="left"?3-F:0,this.ariaLabel=`${t}-axis label`,{facets:[[0]],channels:{text:{value:[FO(t,L,{anchor:e,label:A,labelAnchor:q,labelArrow:E})]}}}})):null)}function hH(t,e,n,{strokeWidth:r=1,strokeLinecap:o=null,strokeLinejoin:i=null,facetAnchor:s=e+(t==="y"?"-empty":""),frameAnchor:a=e,tickSize:c,inset:f=0,insetLeft:u=f,insetRight:p=f,dx:l=0,y:d=t==="y"?void 0:null,...h}){return _u(lb,t,n,{ariaLabel:`${t}-axis tick`,ariaHidden:!0},{strokeWidth:r,strokeLinecap:o,strokeLinejoin:i,facetAnchor:s,frameAnchor:a,y:d,...h,dx:e==="left"?+l-le+ +u:+l+le-p,anchor:"start",length:c,shape:e==="left"?vH:_H})}function mH(t,e,n,{strokeWidth:r=1,strokeLinecap:o=null,strokeLinejoin:i=null,facetAnchor:s=e+(t==="x"?"-empty":""),frameAnchor:a=e,tickSize:c,inset:f=0,insetTop:u=f,insetBottom:p=f,dy:l=0,x:d=t==="x"?void 0:null,...h}){return _u(ub,t,n,{ariaLabel:`${t}-axis tick`,ariaHidden:!0},{strokeWidth:r,strokeLinejoin:i,strokeLinecap:o,facetAnchor:s,frameAnchor:a,x:d,...h,dy:e==="bottom"?+l-le-p:+l+le+ +u,anchor:"start",length:c,shape:e==="bottom"?bH:wH})}function xH(t,e,n,{facetAnchor:r=e+(t==="y"?"-empty":""),frameAnchor:o=e,tickSize:i,tickRotate:s=0,tickPadding:a=Math.max(3,9-i)+(Math.abs(s)>60?4*Math.cos(s*yu):0),text:c,textAnchor:f=Math.abs(s)>60?"middle":e==="left"?"end":"start",lineAnchor:u=s>60?"top":s<-60?"bottom":"middle",fontVariant:p,inset:l=0,insetLeft:d=l,insetRight:h=l,dx:m=0,y:x=t==="y"?void 0:null,...g}){return _u(ab,t,n,{ariaLabel:`${t}-axis tick label`},{facetAnchor:r,frameAnchor:o,text:c,textAnchor:f,lineAnchor:u,fontVariant:p,rotate:s,y:x,...g,dx:e==="left"?+m-i-a+ +d:+m+ +i+ +a-h},function(y,b,w,_,v){p===void 0&&(this.fontVariant=PO(y)),c===void 0&&(v.text=DO(y,b,w,_,e))})}function gH(t,e,n,{facetAnchor:r=e+(t==="x"?"-empty":""),frameAnchor:o=e,tickSize:i,tickRotate:s=0,tickPadding:a=Math.max(3,9-i)+(Math.abs(s)>=10?4*Math.cos(s*yu):0),text:c,textAnchor:f=Math.abs(s)>=10?s<0^e==="bottom"?"start":"end":"middle",lineAnchor:u=Math.abs(s)>=10?"middle":e==="bottom"?"top":"bottom",fontVariant:p,inset:l=0,insetTop:d=l,insetBottom:h=l,dy:m=0,x=t==="x"?void 0:null,...g}){return _u(sb,t,n,{ariaLabel:`${t}-axis tick label`},{facetAnchor:r,frameAnchor:o,text:c===void 0?null:c,textAnchor:f,lineAnchor:u,fontVariant:p,rotate:s,x,...g,dy:e==="bottom"?+m+ +i+ +a-h:+m-i-a+ +d},function(y,b,w,_,v){p===void 0&&(this.fontVariant=PO(y)),c===void 0&&(v.text=DO(y,b,w,_,e))})}function mb(){let[t,e]=zs(...arguments);return LO("y",TO(e),t,e)}function xb(){let[t,e]=zs(...arguments);return LO("fy",EO(e),t,e)}function gb(){let[t,e]=zs(...arguments);return RO("x",IO(e),t,e)}function yb(){let[t,e]=zs(...arguments);return RO("fx",NO(e),t,e)}function LO(t,e,n,{y:r=t==="y"?void 0:null,x:o=null,x1:i=e==="left"?o:null,x2:s=e==="right"?o:null,...a}){return _u(dr,t,n,{ariaLabel:`${t}-grid`,ariaHidden:!0},{y:r,x1:i,x2:s,...OO(a)})}function RO(t,e,n,{x:r=t==="x"?void 0:null,y:o=null,y1:i=e==="top"?o:null,y2:s=e==="bottom"?o:null,...a}){return _u(pr,t,n,{ariaLabel:`${t}-grid`,ariaHidden:!0},{x:r,y1:i,y2:s,...OO(a)})}function OO({color:t="currentColor",opacity:e=.1,stroke:n=t,strokeOpacity:r=e,strokeWidth:o=1,...i}){return{stroke:n,strokeOpacity:r,strokeWidth:o,...i}}function $O({fill:t,fillOpacity:e,fontFamily:n,fontSize:r,fontStyle:o,fontVariant:i,fontWeight:s,monospace:a,pointerEvents:c,shapeRendering:f,clip:u=!1},p){return[,t]=ce(t),[,e]=Ut(e),{facet:"super",x:null,y:null,fill:t,fillOpacity:e,fontFamily:n,fontSize:r,fontStyle:o,fontVariant:i,fontWeight:s,monospace:a,pointerEvents:c,shapeRendering:f,clip:u,initializer:p}}function _u(t,e,n,r,o,i){let s;function a(u,p,l,d,h,m){let x=u==null&&(e==="fx"||e==="fy"),{[e]:g}=d;if(!g)throw new Error(`missing scale: ${e}`);let y=g.domain(),{interval:b,ticks:w,tickFormat:_,tickSpacing:v=e==="x"?80:35}=o;if(typeof w=="string"&&BO(g)&&(b=w,w=void 0),w===void 0&&(w=$o(b,g.type)??yH(g,v)),u==null){if(qn(w))u=cr(w);else if(Cs(w))u=S4(w,...Ft(y));else if(g.interval){let T=g.interval;if(g.ticks){let[E,N]=Ft(y),M=(N-E)/T[nu];T=lS(T,M/w)??T,u=S4(T,E,N)}else{u=y;let E=u.length;T=lS(T,E/w)??T,T!==g.interval&&(u=S4(T,...Ft(u)))}if(T===g.interval){let E=Math.round(u.length/w);E>1&&(u=u.filter((N,M)=>M%E===0))}}else g.ticks?u=g.ticks(w):u=y;if(!g.ticks&&u.length&&u!==y){let T=new En(y);u=u.filter(E=>T.has(E)),u.length||_n(`Warning: the ${e}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}e==="y"||e==="x"?p=[Fn(u)]:s[e]={scale:e,value:W}}i?.call(this,g,u,w,_,s);let A=Object.fromEntries(Object.entries(s).map(([T,E])=>[T,{...E,value:ut(u,E.value)}]));return x&&(p=m.filterFacets(u,A)),{data:u,facets:p,channels:A}}let c=Kt(o).initializer,f=t(n,Kt({...o,initializer:a},c));return n==null?(s=f.channels,f.channels={}):s={},r!==void 0&&Object.assign(f,r),f.clip===void 0&&(f.clip=!1),f}function yH(t,e){let[n,r]=Ft(t.range());return(r-n)/e}function DO(t,e,n,r,o){return{value:ah(t,e,n,r,o)}}function ah(t,e,n,r,o){return typeof r=="function"&&!(t.type==="log"&&t.tickFormat)?r:r===void 0&&e&&fe(e)?dL(t.type,e,o)??zo:t.tickFormat?t.tickFormat(typeof n=="number"?n:null,r):r===void 0?zo:typeof r=="string"?(fe(t.domain())?Co:Ir)(r):ue(r)}function S4(t,e,n){return t.range(e,t.offset(t.floor(n)))}var bH={draw(t,e){t.moveTo(0,0),t.lineTo(0,e)}},wH={draw(t,e){t.moveTo(0,0),t.lineTo(0,-e)}},vH={draw(t,e){t.moveTo(0,0),t.lineTo(-e,0)}},_H={draw(t,e){t.moveTo(0,0),t.lineTo(e,0)}};function PO(t){return t.bandwidth&&!t.interval?void 0:"tabular-nums"}function FO(t,e,{anchor:n,label:r=e.label,labelAnchor:o,labelArrow:i}={}){if(!(r==null||r.inferred&&BO(e)&&/^(date|time|year)$/i.test(r))){if(r=String(r),i==="auto"&&(i=(!e.bandwidth||e.interval)&&!/[↑↓→←]/.test(r)),!i)return r;if(i===!0){let s=X1(e);s&&(i=/x$/.test(t)||o==="center"?/x$/.test(t)===s<0?"left":"right":s<0?"up":"down")}switch(i){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 qO(t="auto"){return zt(t)?!1:typeof t=="boolean"?t:Oe(t,"labelArrow",["auto","up","right","down","left"])}function BO(t){return fe(t.domain())}function zO(t,e){if(e==null)return e;let n=t(e);if(!n)throw new Error(`scale not found: ${e}`);return n}function YO(t,{opacity:e,...n}={}){if(!qo(t)&&!ZS(t))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${t.type})`);return jO(t,n,(r,o,i,s)=>r.append("svg").attr("width",i).attr("height",s).attr("fill",o.scale).attr("fill-opacity",Ut(e)[1]).append("rect").attr("width","100%").attr("height","100%"))}function UO(t,{fill:e=t.hint?.fill!==void 0?t.hint.fill:"none",fillOpacity:n=1,stroke:r=t.hint?.stroke!==void 0?t.hint.stroke:zt(e)?"currentColor":"none",strokeOpacity:o=1,strokeWidth:i=1.5,r:s=4.5,...a}={},c){let[f,u]=ce(e),[p,l]=ce(r),d=zO(c,f),h=zO(c,p),m=s*s*Math.PI;return n=Ut(n)[1],o=Ut(o)[1],i=Ut(i)[1],jO(t,a,(x,g,y,b)=>x.append("svg").attr("viewBox","-8 -8 16 16").attr("width",y).attr("height",b).attr("fill",f==="color"?w=>d.scale(w):u).attr("fill-opacity",n).attr("stroke",p==="color"?w=>h.scale(w):l).attr("stroke-opacity",o).attr("stroke-width",i).append("path").attr("d",w=>{let _=Ln();return t.scale(w).draw(_,m),_}))}function jO(t,e={},n){let{columns:r,tickFormat:o,fontVariant:i=nb(t),swatchSize:s=15,swatchWidth:a=s,swatchHeight:c=s,marginLeft:f=0,className:u,style:p,width:l}=e,d=Ds(e);u=Fs(u),o=ah(t.scale,t.domain,void 0,o);let h=ot("div",d).attr("class",`${u}-swatches ${u}-swatches-${r!=null?"columns":"wrap"}`),m;return r!=null?(m=`:where(.${u}-swatches-columns .${u}-swatch) {
28
19
  display: flex;
29
20
  align-items: center;
30
21
  break-inside: avoid;
@@ -37,7 +28,7 @@ ${n}`}function vQ(e){return e==="time"?Tw:e==="utc"?ry:wQ}function $F(e,t,n){let
37
28
  white-space: nowrap;
38
29
  overflow: hidden;
39
30
  text-overflow: ellipsis;
40
- }`,p.style("columns",r).selectAll().data(e.domain).enter().append("div").attr("class",`${u}-swatch`).call(n,e,a,c).call(y=>y.append("div").attr("class",`${u}-swatch-label`).attr("title",i).text(i))):(m=`:where(.${u}-swatches-wrap) {
31
+ }`,h.style("columns",r).selectAll().data(t.domain).enter().append("div").attr("class",`${u}-swatch`).call(n,t,a,c).call(x=>x.append("div").attr("class",`${u}-swatch-label`).attr("title",o).text(o))):(m=`:where(.${u}-swatches-wrap) {
41
32
  display: flex;
42
33
  align-items: center;
43
34
  min-height: 33px;
@@ -47,7 +38,7 @@ ${n}`}function vQ(e){return e==="time"?Tw:e==="utc"?ry:wQ}function $F(e,t,n){let
47
38
  display: inline-flex;
48
39
  align-items: center;
49
40
  margin-right: 1em;
50
- }`,p.selectAll().data(e.domain).enter().append("span").attr("class",`${u}-swatch`).call(n,e,a,c).append(function(){return this.ownerDocument.createTextNode(i.apply(this,arguments))})),p.call(y=>y.insert("style","*").text(`:where(.${u}-swatches) {
41
+ }`,h.selectAll().data(t.domain).enter().append("span").attr("class",`${u}-swatch`).call(n,t,a,c).append(function(){return this.ownerDocument.createTextNode(o.apply(this,arguments))})),h.call(x=>x.insert("style","*").text(`:where(.${u}-swatches) {
51
42
  font-family: system-ui, sans-serif;
52
43
  font-size: 10px;
53
44
  margin-bottom: 0.5em;
@@ -56,7 +47,7 @@ ${n}`}function vQ(e){return e==="time"?Tw:e==="utc"?ry:wQ}function $F(e,t,n){let
56
47
  margin-right: 0.5em;
57
48
  overflow: visible;
58
49
  }
59
- ${m}`)).style("margin-left",l?`${+l}px`:null).style("width",h===void 0?null:`${+h}px`).style("font-variant",de(o,"normal")).call(Kf,f).node()}var S_=new Map([["symbol",f9],["color",m9],["opacity",ctt]]);function d9(e={}){for(let[t,n]of S_){let r=e[t];if(jo(r)){let i=sc(e),o;if(t==="symbol"){let{fill:s,stroke:a=s===void 0&&jo(e.color)?"color":void 0}=e;o={fill:s,stroke:a}}return n(Ww(t,r,o),RT(i,r,e),s=>jo(e[s])?Ww(s,e[s]):null)}}throw new Error("unknown legend type; no scale found")}function p9(e,t,n={}){return(r,i)=>{if(!S_.has(r))throw new Error(`unknown legend type: ${r}`);if(r in e)return S_.get(r)(e[r],RT(t,n[r],i),o=>e[o])}}function RT({className:e,...t},{label:n,ticks:r,tickFormat:i}={},o){return QF(o,{className:e,...t},{label:n,ticks:r,tickFormat:i})}function m9(e,{legend:t=!0,...n}){if(t===!0&&(t=e.type==="ordinal"?"swatches":"ramp"),e.domain!==void 0)switch(`${t}`.toLowerCase()){case"swatches":return u9(e,n);case"ramp":return M$(e,n);default:throw new Error(`unknown legend type: ${t}`)}}function ctt({type:e,interpolate:t,...n},{legend:r=!0,color:i=sn(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 m9({type:e,...n,interpolate:ltt(i)},{legend:r,...o})}function ltt(e){let{r:t,g:n,b:r}=sn(e)||sn(0,0,0);return i=>`rgba(${t},${n},${r},${i})`}function y9(e,t,n){let r=[];for(let[i,o]of S_){let s=n[i];if(s?.legend&&i in e){let a=o(e[i],RT(t,e[i],s),c=>e[c]);a!=null&&r.push(a)}}return r}var utt={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},ftt={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1},Sy=class extends vt{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(Ha,void 0,t,n==null?utt:ftt),this.anchor=k3(n,"anchor",["top","right","bottom","left"]),this.insetTop=Lt(i),this.insetRight=Lt(o),this.insetBottom=Lt(s),this.insetLeft=Lt(a),this.rx=Lt(c),this.ry=Lt(l)}render(t,n,r,i,o){let{marginTop:s,marginRight:a,marginBottom:c,marginLeft:l,width:u,height:f}=i,{anchor:h,insetTop:d,insetRight:p,insetBottom:m,insetLeft:y,rx:g,ry:x}=this,b=l+y,w=u-a-p,v=s+d,_=f-c-m;return ut(h?"svg:line":"svg:rect",o).datum(0).call(kt,this,i,o).call(Ct,this).call(Kt,this,r).call(Et,this,{}).call(h==="left"?A=>A.attr("x1",b).attr("x2",b).attr("y1",v).attr("y2",_):h==="right"?A=>A.attr("x1",w).attr("x2",w).attr("y1",v).attr("y2",_):h==="top"?A=>A.attr("x1",b).attr("x2",w).attr("y1",v).attr("y2",v):h==="bottom"?A=>A.attr("x1",b).attr("x2",w).attr("y1",_).attr("y2",_):A=>A.attr("x",b).attr("y",v).attr("width",w-b).attr("height",_-v).attr("rx",g).attr("ry",x)).node()}};function ih(e){return new Sy(e)}var FT={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor"},htt=new Set(["geometry","href","src","ariaLabel","scales"]),Iy=class extends vt{constructor(t,n={}){n.tip&&(n={...n,tip:!1}),n.title===void 0&&ur(t)&&Ow(t)&&(n={...n,title:H});let{x:r,y:i,x1:o,x2:s,y1:a,y2:c,anchor:l,preferredAnchor:u="bottom",monospace:f,fontFamily:h=f?"ui-monospace, monospace":void 0,fontSize:d,fontStyle:p,fontVariant:m,fontWeight:y,lineHeight:g=1,lineWidth:x=20,frameAnchor:b,format:w,textAnchor:v="start",textOverflow:_,textPadding:A=8,title:E,pointerSize:T=12,pathFilter:D="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=n;super(t,{x:{value:o!=null&&s!=null?null:r,scale:"x",optional:!0},y:{value:a!=null&&c!=null?null:i,scale:"y",optional:!0},x1:{value:o,scale:"x",optional:s==null},y1:{value:a,scale:"y",optional:c==null},x2:{value:s,scale:"x",optional:o==null},y2:{value:c,scale:"y",optional:a==null},title:{value:E,optional:!0}},n,FT),this.anchor=Lw(l,"anchor"),this.preferredAnchor=Lw(u,"preferredAnchor"),this.frameAnchor=Xo(b),this.textAnchor=de(v,"middle"),this.textPadding=+A,this.pointerSize=+T,this.pathFilter=qe(D),this.lineHeight=+g,this.lineWidth=+x,this.textOverflow=DT(_),this.monospace=!!f,this.fontFamily=qe(h),this.fontSize=Lt(d),this.fontStyle=qe(p),this.fontVariant=qe(m),this.fontWeight=qe(y);for(let I in FT)I in this.channels&&(this[I]=FT[I]);this.splitLines=BT(this),this.clipLine=LT(this),this.format=typeof w=="string"||typeof w=="function"?{title:w}:{...w}}render(t,n,r,i,o){let s=this,{x:a,y:c,fx:l,fy:u}=n,{ownerSVGElement:f,document:h}=o,{anchor:d,monospace:p,lineHeight:m,lineWidth:y}=this,{textPadding:g,pointerSize:x,pathFilter:b}=this,{marginTop:w,marginLeft:v}=i,{x1:_,y1:A,x2:E,y2:T,x:D=_??E,y:I=A??T}=r,O=l?l(t.fx)-v:0,L=u?u(t.fy)-w:0,[S,M]=_n(this,i),N=ST(r,S),R=IT(r,M),F=p?d_:h_,k=F(zl),$,P;"title"in r?($=g9.call(this,{title:r.channels.title},n),P=ytt):($=g9.call(this,r.channels,n),P=gtt);let U=ut("svg:g",o).call(kt,this,i,o).call(OT,this).call(Et,this,{x:D&&a,y:I&&c}).call(ot=>ot.selectAll().data(t).enter().append("g").attr("transform",at=>`translate(${Math.round(N(at))},${Math.round(R(at))})`).call(Ct,this).call(at=>at.append("path").attr("filter",b)).call(at=>at.append("text").each(function(Y){let st=Yt(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");let q=P.call(s,Y,t,$,n,r);if(typeof q=="string")for(let Z of s.splitLines(q))G(st,{value:s.clipLine(Z)});else{let Z=new Set;for(let rt of q){let{label:z=""}=rt;z&&Z.has(z)||(Z.add(z),G(st,rt))}}})));function G(ot,{label:at,value:Y,color:st,opacity:q}){at??="",Y??="";let Z=st!=null||q!=null,rt,z=y*100,[Ft]=jl(at,z,F,k);if(Ft>=0)at=at.slice(0,Ft).trimEnd()+zl,rt=Y.trim(),Y="";else{(at||!Y&&!Z)&&(Y=" "+Y);let[Ht]=jl(Y,z-F(at),F,k);Ht>=0&&(rt=Y.trim(),Y=Y.slice(0,Ht).trimEnd()+zl)}let ht=ot.append("tspan").attr("x",0).attr("dy",`${m}em`).text("\u200B");at&&ht.append("tspan").attr("font-weight","bold").text(at),Y&&ht.append(()=>h.createTextNode(Y)),Z&&ht.append("tspan").text(" \u25A0").attr("fill",st).attr("fill-opacity",q).style("user-select","none"),rt&&ht.append("title").text(rt)}function nt(){let{width:ot,height:at}=i.facet??i;U.selectChildren().each(function(Y){let{x:st,width:q,height:Z}=this.getBBox();q=Math.round(q),Z=Math.round(Z);let rt=d;if(rt===void 0){let ht=N(Y)+O,Ht=R(Y)+L,Qt=ht+q+x+g*2<ot,tt=ht-q-x-g*2>0,le=Ht+Z+x+g*2<at,Mr=Ht-Z-x-g*2>0;rt=Qt&&tt?le&&Mr?s.preferredAnchor:Mr?"bottom":"top":le&&Mr?Qt?"left":"right":(Qt||tt)&&(le||Mr)?`${Mr?"bottom":"top"}-${Qt?"left":"right"}`:s.preferredAnchor}let z=this.firstChild,Ft=this.lastChild;if(z.setAttribute("d",mtt(rt,x,g,q,Z)),st)for(let ht of Ft.childNodes)ht.setAttribute("x",-st);Ft.setAttribute("y",`${+dtt(rt,Ft.childNodes.length,m).toFixed(6)}em`),Ft.setAttribute("transform",`translate(${ptt(rt,x,g,q,Z)})`)}),U.attr("visibility",null)}return t.length&&(U.attr("visibility","hidden"),f.isConnected?Promise.resolve().then(nt):typeof requestAnimationFrame<"u"&&requestAnimationFrame(nt)),U.node()}};function A_(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=$e(t,n)),new Iy(e,{...r,x:t,y:n})}function dtt(e,t,n){return/^top(?:-|$)/.test(e)?.94-n:-.29-t*n}function ptt(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 mtt(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 g9(e,t){let n={},r=this.format;r=x9(r,e,"x"),r=x9(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=hy(e,i);s&&(n[i]=s)}}for(let i in e){if(i in n||i in r||htt.has(i))continue;let o=hy(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]=(Le(s)?Uo:di)(o)}else if(o===void 0||o===!0){let s=t[i];this.format[i]=s?.bandwidth?vy(s,s.domain()):Ho}}return n}function x9(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 ytt(e,t,{title:n}){return this.format.title(n.value[e],e)}function*gtt(e,t,n,r,i){for(let o in n){if(o==="fx"||o==="fy"){yield{label:I_(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:w9(r,n,"x"),value:b9(this.format.x2,n.x1,s,e)};else if(o==="y2"&&"y1"in n)yield{label:w9(r,n,"y"),value:b9(this.format.y2,n.y1,s,e)};else{let a=s.value[e],c=s.scale;if(!ze(a)&&c==null)continue;yield{label:I_(r,n,o),value:this.format[o](a,e),color:c==="color"?i[o][e]:null,opacity:c==="opacity"?i[o][e]:null}}}}function b9(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 w9(e,t,n){let r=I_(e,t,`${n}1`,n),i=I_(e,t,`${n}2`,n);return r===i?r:`${r}\u2013${i}`}function I_(e,t,n,r=n){let i=t[n],o=e[i?.scale??n];return String(o?.label??i?.label??r)}function oh(e={}){let{facet:t,style:n,title:r,subtitle:i,caption:o,ariaLabel:s,ariaDescription:a}=e,c=Qf(e.className),l=e.marks===void 0?[]:v9(e.marks);l.push(...Stt(l));let u=_tt(t,e),f=new Map;for(let k of l){let $=S9(k,u,e);$&&f.set(k,$)}let h=new Map;u&&Ay(h,[u],e),Ay(h,f,e);let d=v9(Itt(l,h,e));for(let k of d){let $=S9(k,u,e);$&&f.set(k,$)}l.unshift(...d);let p=a$(h,e);if(p!==void 0){let k=u?Qw(p,u):void 0;for(let P of l){if(P.facet===null||P.facet==="super")continue;let U=f.get(P);U!==void 0&&(U.facetsIndex=P.fx!=null||P.fy!=null?Qw(p,U):k)}let $=new Set;for(let{facetsIndex:P}of f.values())P?.forEach((U,G)=>{U?.length>0&&$.add(G)});p.forEach(0<$.size&&$.size<p.length?(P,U)=>P.empty=!$.has(U):P=>P.empty=!1);for(let P of l)if(P.facet==="exclude"){let U=f.get(P);U!==void 0&&(U.facetsIndex=u$(U.facetsIndex))}}for(let k of pe.keys())jo(e[k])&&k!=="fx"&&k!=="fy"&&h.set(k,[]);let m=new Map;for(let k of l){if(m.has(k))throw new Error("duplicate mark; each mark must be unique");let{facetsIndex:$,channels:P}=f.get(k)??{},{data:U,facets:G,channels:nt}=k.initialize($,P,e);UT(nt,e),m.set(k,{data:U,facets:G,channels:nt})}let y=my(Ay(h,m,e),e),g=I$(y,l,e);t$(y,g);let x=fT(y),{fx:b,fy:w}=x,v=b||w?hT(y,g):g,_=b||w?Ott(x,g):g,A=sc(e),E=A.document,T=Bs("svg").call(E.documentElement),D=T;A.ownerSVGElement=T,A.className=c,A.projection=p$(e,v),A.filterFacets=(k,$)=>Qw(p,{channels:$,groups:Zw(k,$)}),A.getMarkState=k=>{let $=m.get(k),P=f.get(k);return{...$,channels:{...$.channels,...P?.channels}}},A.dispatchValue=k=>{D.value!==k&&(D.value=k,D.dispatchEvent(new Event("input",{bubbles:!0})))};let I=new Set;for(let[k,$]of m)if(k.initializer!=null){let P=k.facet==="super"?_:v,U=k.initializer($.data,$.facets,$.channels,x,P,A);if(U.data!==void 0&&($.data=U.data),U.facets!==void 0&&($.facets=U.facets),U.channels!==void 0){let{fx:G,fy:nt,...ot}=U.channels;wtt(ot),Object.assign($.channels,ot);for(let at of Object.values(ot)){let{scale:Y}=at;Y!=null&&!t7(pe.get(Y))&&(M9(at,e),I.add(Y))}(G!=null||nt!=null)&&f.set(k,!0)}}if(I.size){let k=new Map;Ay(k,m,e,G=>I.has(G)),Ay(h,m,e,G=>I.has(G));let $=Dtt(my(k,e),y),{scales:P,...U}=fT($);Object.assign(y,$),Object.assign(x,U),Object.assign(x.scales,P)}let O,L;p!==void 0&&(O={x:b?.domain(),y:w?.domain()},p=c$(p,O),L=l$(b,w,g));for(let[k,$]of m)$.values=k.scale($.channels,x,A);let{width:S,height:M}=g;Yt(T).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",M).attr("viewBox",`0 0 ${S} ${M}`).attr("aria-label",s).attr("aria-description",a).call(k=>k.append("style").text(`:where(.${c}) {
50
+ ${m}`)).style("margin-left",f?`${+f}px`:null).style("width",l===void 0?null:`${+l}px`).style("font-variant",te(i,"normal")).call(gu,p).node()}var bb=new Map([["symbol",UO],["color",VO],["opacity",SH]]);function XO(t={}){for(let[e,n]of bb){let r=t[e];if(Ro(r)){let o=Ds(t),i;if(e==="symbol"){let{fill:s,stroke:a=s===void 0&&Ro(t.color)?"color":void 0}=t;i={fill:s,stroke:a}}return n(V1(e,r,i),M4(o,r,t),s=>Ro(t[s])?V1(s,t[s]):null)}}throw new Error("unknown legend type; no scale found")}function WO(t,e,n={}){return(r,o)=>{if(!bb.has(r))throw new Error(`unknown legend type: ${r}`);if(r in t)return bb.get(r)(t[r],M4(e,n[r],o),i=>t[i])}}function M4({className:t,...e},{label:n,ticks:r,tickFormat:o}={},i){return EL(i,{className:t,...e},{label:n,ticks:r,tickFormat:o})}function VO(t,{legend:e=!0,...n}){if(e===!0&&(e=t.type==="ordinal"?"swatches":"ramp"),t.domain!==void 0)switch(`${e}`.toLowerCase()){case"swatches":return YO(t,n);case"ramp":return rO(t,n);default:throw new Error(`unknown legend type: ${e}`)}}function SH({type:t,interpolate:e,...n},{legend:r=!0,color:o=Le(0,0,0),...i}){if(!e)throw new Error(`${t} opacity scales are not supported`);if(r===!0&&(r="ramp"),`${r}`.toLowerCase()!=="ramp")throw new Error(`${r} opacity legends are not supported`);return VO({type:t,...n,interpolate:MH(o)},{legend:r,...i})}function MH(t){let{r:e,g:n,b:r}=Le(t)||Le(0,0,0);return o=>`rgba(${e},${n},${r},${o})`}function GO(t,e,n){let r=[];for(let[o,i]of bb){let s=n[o];if(s?.legend&&o in t){let a=i(t[o],M4(e,t[o],s),c=>t[c]);a!=null&&r.push(a)}}return r}function Ys(t={}){return wS(t)?t:{...t,x:W}}function Us(t={}){return vS(t)?t:{...t,y:W}}function wb(t,e){if(e.length===1)return{data:t,facets:e};let n=Ns(t),r=new Uint8Array(n),o=0;for(let a of e)for(let c of a)r[c]&&++o,r[c]=1;if(o===0)return{data:t,facets:e};t=Is(t);let i=t[dS]=new Uint32Array(n+o);e=e.map(a=>Is(a,Uint32Array));let s=n;r.fill(0);for(let a of e)for(let c=0,f=a.length;c<f;++c){let u=a[c];r[u]?(a[c]=s,t[s]=t[u],i[s]=u,++s):i[u]=u,r[u]=1}return{data:t,facets:e}}function A4(t={},e={}){arguments.length===1&&([t,e]=Su(t));let{y1:n,y:r=n,x:o,...i}=e,[s,a,c,f]=Mu(r,o,"y","x",t,i);return{...s,y1:n,y:a,x1:c,x2:f,x:iu(c,f)}}function ZO(t={},e={}){arguments.length===1&&([t,e]=Su(t));let{y1:n,y:r=n,x:o}=e,[i,s,a]=Mu(r,o,"y","x",t,e);return{...i,y1:n,y:s,x:a}}function JO(t={},e={}){arguments.length===1&&([t,e]=Su(t));let{y1:n,y:r=n,x:o}=e,[i,s,,a]=Mu(r,o,"y","x",t,e);return{...i,y1:n,y:s,x:a}}function T4(t={},e={}){arguments.length===1&&([t,e]=Su(t));let{x1:n,x:r=n,y:o,...i}=e,[s,a,c,f]=Mu(r,o,"x","y",t,i);return{...s,x1:n,x:a,y1:c,y2:f,y:iu(c,f)}}function KO(t={},e={}){arguments.length===1&&([t,e]=Su(t));let{x1:n,x:r=n,y:o}=e,[i,s,a]=Mu(r,o,"x","y",t,e);return{...i,x1:n,x:s,y:a}}function t$(t={},e={}){arguments.length===1&&([t,e]=Su(t));let{x1:n,x:r=n,y:o}=e,[i,s,,a]=Mu(r,o,"x","y",t,e);return{...i,x1:n,x:s,y:a}}function js({x:t,x1:e,x2:n,...r}={}){return r=Jr(r,"y"),e===void 0&&n===void 0?A4({x:t,...r}):([e,n]=_S(t,e,n),{...r,x1:e,x2:n})}function Xs({y:t,y1:e,y2:n,...r}={}){return r=Jr(r,"x"),e===void 0&&n===void 0?T4({y:t,...r}):([e,n]=_S(t,e,n),{...r,y1:e,y2:n})}function Su(t){let{offset:e,order:n,reverse:r,...o}=t;return[{offset:e,order:n,reverse:r},o]}var AH={length:!0};function Mu(t,e=jd,n,r,{offset:o,order:i,reverse:s},a){if(e===null)throw new Error(`stack requires ${r}`);let c=vn(a),[f,u]=fn(t),[p,l]=Ge(e),[d,h]=Ge(e);return p.hint=d.hint=AH,o=TH(o),i=NH(i,o,r),[Ce(a,(m,x,g)=>{({data:m,facets:x}=wb(m,x));let y=t==null?void 0:u(sc(ut(m,t),g?.[n])),b=ut(m,e,Float64Array),w=ut(m,c),_=i&&i(m,y,b,w),v=Ns(m),A=l(new Float64Array(v)),T=h(new Float64Array(v)),E=[];for(let N of x){let M=y?Array.from(rn(N,k=>y[k]).values()):[N];if(_)for(let k of M)k.sort(_);for(let k of M){let O=0,S=0;s&&k.reverse();for(let I of k){let C=b[I];C<0?O=T[I]=(A[I]=O)+C:C>0?S=T[I]=(A[I]=S)+C:T[I]=A[I]=S}}E.push(M)}return o&&o(E,A,T,w),{data:m,facets:x}}),f,p,d]}function TH(t){if(t!=null){if(typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"expand":case"normalize":return EH;case"center":case"silhouette":return IH;case"wiggle":return n$}throw new Error(`unknown offset: ${t}`)}}function e$(t,e){let n=0,r=0;for(let o of t){let i=e[o];i<n&&(n=i),i>r&&(r=i)}return[n,r]}function EH(t,e,n){for(let r of t)for(let o of r){let[i,s]=e$(o,n);for(let a of o){let c=1/(s-i||1);e[a]=c*(e[a]-i),n[a]=c*(n[a]-i)}}}function IH(t,e,n){for(let r of t){for(let o of r){let[i,s]=e$(o,n);for(let a of o){let c=(s+i)/2;e[a]-=c,n[a]-=c}}r$(r,e,n)}o$(t,e,n)}function n$(t,e,n,r){for(let o of t){let i=new Tn,s=0;for(let a of o){let c=-1,f=a.map(d=>Math.abs(n[d]-e[d])),u=a.map(d=>{c=r?r[d]:++c;let h=n[d]-e[d],m=i.has(c)?h-i.get(c):0;return i.set(c,h),m}),p=[0,...xx(u)];for(let d of a)e[d]+=s,n[d]+=s;let l=sn(f);l&&(s-=sn(f,(d,h)=>(u[h]/2+p[h])*d)/l)}r$(o,e,n)}o$(t,e,n)}function r$(t,e,n){let r=It(t,o=>It(o,i=>e[i]));for(let o of t)for(let i of o)e[i]-=r,n[i]-=r}function o$(t,e,n){let r=t.length;if(r===1)return;let o=t.map(a=>a.flat()),i=o.map(a=>(It(a,c=>e[c])+kt(a,c=>n[c]))/2),s=It(i);for(let a=0;a<r;a++){let c=s-i[a];for(let f of o[a])e[f]+=c,n[f]+=c}}function NH(t,e,n){if(t===void 0&&e===n$)return HO(We);if(t!=null){if(typeof t=="string"){let r=t.startsWith("-"),o=r?nc:We;switch((r?t.slice(1):t).toLowerCase()){case"value":case n:return CH(o);case"z":return kH(o);case"sum":return LH(o);case"appearance":return RH(o);case"inside-out":return HO(o)}return QO(mS(t))}if(typeof t=="function")return(t.length===1?QO:OH)(t);if(Gn(t))return $H(t);throw new Error(`invalid order: ${t}`)}}function CH(t){return(e,n,r)=>(o,i)=>t(r[o],r[i])}function kH(t){return(e,n,r,o)=>(i,s)=>t(o[i],o[s])}function LH(t){return vb(t,(e,n,r,o)=>cf(Fn(e),i=>sn(i,s=>r[s]),i=>o[i]))}function RH(t){return vb(t,(e,n,r,o)=>cf(Fn(e),i=>n[Ia(i,s=>r[s])],i=>o[i]))}function HO(t){return vb(t,(e,n,r,o)=>{let i=Fn(e),s=cf(i,p=>n[Ia(p,l=>r[l])],p=>o[p]),a=Wr(i,p=>sn(p,l=>r[l]),p=>o[p]),c=[],f=[],u=0;for(let p of s)u<0?(u+=a.get(p),c.push(p)):(u-=a.get(p),f.push(p));return f.reverse().concat(c)})}function QO(t){return e=>{let n=ut(e,t);return(r,o)=>We(n[r],n[o])}}function OH(t){return e=>Gn(e)?(n,r)=>t(e[n],e[r]):(n,r)=>t(e.get(n),e.get(r))}function $H(t){return vb(We,()=>t)}function vb(t,e){return(n,r,o,i)=>{if(!i)throw new Error("missing channel: z");let s=new Tn(e(n,r,o,i).map((a,c)=>[a,c]));return(a,c)=>t(s.get(i[a]),s.get(i[c]))}}var DH={ariaLabel:"rect"},gc=class extends lt{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s}=n;super(e,{x1:{value:r,scale:"x",type:r!=null&&i==null?"band":void 0,optional:!0},y1:{value:o,scale:"y",type:o!=null&&s==null?"band":void 0,optional:!0},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,DH),ch(this,n),fh(this,n)}render(e,n,r,o,i){let{x:s,y:a}=n,{x1:c,y1:f,x2:u,y2:p}=r,{marginTop:l,marginRight:d,marginBottom:h,marginLeft:m,width:x,height:g}=o,{projection:y}=i,{insetTop:b,insetRight:w,insetBottom:_,insetLeft:v}=this,{rx:A,ry:T,rx1y1:E,rx1y2:N,rx2y1:M,rx2y2:k}=this;(c||u)&&!y&&lr(s)&&(c=u=null),(f||p)&&!y&&lr(a)&&(f=p=null);let O=s?.bandwidth?s.bandwidth():0,S=a?.bandwidth?a.bandwidth():0;return ot("svg:g",i).call(wt,this,o,i).call(xt,this,{},0,0).call(I=>I.selectAll().data(e).enter().call(E||N||M||k?C=>C.append("path").call(dt,this).call(uh,c&&u?L=>c[L]+(u[L]<c[L]?-w:v):c?L=>c[L]+v:m+v,f&&p?L=>f[L]+(p[L]<f[L]?-_:b):f?L=>f[L]+b:l+b,c&&u?L=>u[L]-(u[L]<c[L]?-v:w):c?L=>c[L]+O-w:x-d-w,f&&p?L=>p[L]-(p[L]<f[L]?-b:_):f?L=>f[L]+S-_:g-h-_,this).call(Tt,this,r):C=>C.append("rect").call(dt,this).attr("x",c?u?L=>Math.min(c[L],u[L])+v:L=>c[L]+v:m+v).attr("y",f?p?L=>Math.min(f[L],p[L])+b:L=>f[L]+b:l+b).attr("width",c?u?L=>Math.max(0,Math.abs(u[L]-c[L])+O-v-w):O-v-w:x-d-m-w-v).attr("height",f?p?L=>Math.max(0,Math.abs(f[L]-p[L])+S-b-_):S-b-_:g-l-h-b-_).call(at,"rx",A).call(at,"ry",T).call(Tt,this,r))).node()}};function ch(t,{inset:e=0,insetTop:n=e,insetRight:r=e,insetBottom:o=e,insetLeft:i=e}={}){t.insetTop=Dt(n),t.insetRight=Dt(r),t.insetBottom=Dt(o),t.insetLeft=Dt(i)}function fh(t,{r:e,rx:n,ry:r,rx1:o=e,ry1:i=e,rx2:s=e,ry2:a=e,rx1y1:c=o!==void 0?+o:i!==void 0?+i:0,rx1y2:f=o!==void 0?+o:a!==void 0?+a:0,rx2y1:u=s!==void 0?+s:i!==void 0?+i:0,rx2y2:p=s!==void 0?+s:a!==void 0?+a:0}={}){c||f||u||p?(t.rx1y1=c,t.rx1y2=f,t.rx2y1=u,t.rx2y2=p):(t.rx=te(n,"auto"),t.ry=te(r,"auto"))}function uh(t,e,n,r,o,i){let{rx1y1:s,rx1y2:a,rx2y1:c,rx2y2:f}=i;typeof e!="function"&&(e=ue(e)),typeof n!="function"&&(n=ue(n)),typeof r!="function"&&(r=ue(r)),typeof o!="function"&&(o=ue(o));let u=Math.max(Math.abs(s+c),Math.abs(a+f)),p=Math.max(Math.abs(s+a),Math.abs(c+f));t.attr("d",l=>{let d=e(l),h=n(l),m=r(l),x=o(l),g=d>m,y=h>x,b=g?m:d,w=g?d:m,_=y?x:h,v=y?h:x,A=Math.min(1,(w-b)/u,(v-_)/p),T=A*(g?y?f:c:y?a:s),E=A*(g?y?a:s:y?f:c),N=A*(g?y?s:a:y?c:f),M=A*(g?y?c:f:y?s:a);return`M${b},${_+Sb(T,M)}A${T},${T} 0 0 ${T<0?0:1} ${b+_b(T,M)},${_}H${w-_b(E,N)}A${E},${E} 0 0 ${E<0?0:1} ${w},${_+Sb(E,N)}V${v-Sb(N,E)}A${N},${N} 0 0 ${N<0?0:1} ${w-_b(N,E)},${v}H${b+_b(M,T)}A${M},${M} 0 0 ${M<0?0:1} ${b},${v-Sb(M,T)}Z`})}function _b(t,e){return e<0?t:Math.abs(t)}function Sb(t,e){return e<0?Math.abs(t):t}function lh(t,e){return new gc(t,m4(x4(e)))}function Au(t,e={}){return Oi(e)||(e={...e,y:Zt,x2:W,interval:1}),new gc(t,js(x4(Ys(e))))}function Tu(t,e={}){return Oi(e)||(e={...e,x:Zt,y2:W,interval:1}),new gc(t,Xs(m4(Us(e))))}var PH={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},FH={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1},ph=class extends lt{constructor(e={}){let{anchor:n=null}=e;super(Ts,void 0,e,n==null?PH:FH),this.anchor=bS(n,"anchor",["top","right","bottom","left"]),ch(this,e),n||fh(this,e)}render(e,n,r,o,i){let{marginTop:s,marginRight:a,marginBottom:c,marginLeft:f,width:u,height:p}=o,{anchor:l,insetTop:d,insetRight:h,insetBottom:m,insetLeft:x}=this,{rx:g,ry:y,rx1y1:b,rx1y2:w,rx2y1:_,rx2y2:v}=this,A=f+x,T=u-a-h,E=s+d,N=p-c-m;return ot(l?"svg:line":b||w||_||v?"svg:path":"svg:rect",i).datum(0).call(wt,this,o,i).call(dt,this).call(Tt,this,r).call(xt,this,{}).call(l==="left"?M=>M.attr("x1",A).attr("x2",A).attr("y1",E).attr("y2",N):l==="right"?M=>M.attr("x1",T).attr("x2",T).attr("y1",E).attr("y2",N):l==="top"?M=>M.attr("x1",A).attr("x2",T).attr("y1",E).attr("y2",E):l==="bottom"?M=>M.attr("x1",A).attr("x2",T).attr("y1",N).attr("y2",N):b||w||_||v?M=>M.call(uh,A,E,T,N,this):M=>M.attr("x",A).attr("y",E).attr("width",T-A).attr("height",N-E).attr("rx",g).attr("ry",y)).node()}};function Eu(t){return new ph(t)}var E4={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor"},qH=new Set(["geometry","href","src","ariaLabel","scales"]),dh=class extends lt{constructor(e,n={}){n.tip&&(n={...n,tip:!1}),n.title===void 0&&qn(e)&&C1(e)&&(n={...n,title:W});let{x:r,y:o,x1:i,x2:s,y1:a,y2:c,anchor:f,preferredAnchor:u="bottom",monospace:p,fontFamily:l=p?"ui-monospace, monospace":void 0,fontSize:d,fontStyle:h,fontVariant:m,fontWeight:x,lineHeight:g=1,lineWidth:y=20,frameAnchor:b,format:w,textAnchor:_="start",textOverflow:v,textPadding:A=8,title:T,pointerSize:E=12,pathFilter:N="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=n;super(e,{x:{value:i!=null&&s!=null?null:r,scale:"x",optional:!0},y:{value:a!=null&&c!=null?null:o,scale:"y",optional:!0},x1:{value:i,scale:"x",optional:s==null},y1:{value:a,scale:"y",optional:c==null},x2:{value:s,scale:"x",optional:i==null},y2:{value:c,scale:"y",optional:a==null},title:{value:T,optional:!0}},n,E4),this.anchor=L1(f,"anchor"),this.preferredAnchor=L1(u,"preferredAnchor"),this.frameAnchor=Do(b),this.textAnchor=te(_,"middle"),this.textPadding=+A,this.pointerSize=+E,this.pathFilter=be(N),this.lineHeight=+g,this.lineWidth=+y,this.textOverflow=y4(v),this.monospace=!!p,this.fontFamily=be(l),this.fontSize=Dt(d),this.fontStyle=be(h),this.fontVariant=be(m),this.fontWeight=be(x);for(let M in E4)M in this.channels&&(this[M]=E4[M]);this.splitLines=w4(this),this.clipLine=v4(this),this.format=typeof w=="string"||typeof w=="function"?{title:w}:{...w}}render(e,n,r,o,i){let s=this,{x:a,y:c,fx:f,fy:u}=n,{ownerSVGElement:p,document:l}=i,{anchor:d,monospace:h,lineHeight:m,lineWidth:x}=this,{textPadding:g,pointerSize:y,pathFilter:b}=this,{marginTop:w,marginLeft:_}=o,{x1:v,y1:A,x2:T,y2:E,x:N=v??T,y:M=A??E}=r,k=f?f(e.fx)-_:0,O=u?u(e.fy)-w:0,[S,I]=Qe(this,o),C=u4(r,S),L=l4(r,I),D=h?fb:cb,$=D(dc),P,F;"title"in r?(P=i$.call(this,{title:r.channels.title},n),F=UH):(P=i$.call(this,r.channels,n),F=jH);let q=ot("svg:g",i).call(wt,this,o,i).call(b4,this).call(xt,this,{x:N&&a,y:M&&c}).call(et=>et.selectAll().data(e).enter().append("g").attr("transform",rt=>`translate(${Math.round(C(rt))},${Math.round(L(rt))})`).call(dt,this).call(rt=>rt.append("path").attr("filter",b)).call(rt=>rt.append("text").each(function(j){let nt=Nt(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");let Y=F.call(s,j,e,P,n,r);if(typeof Y=="string")for(let G of s.splitLines(Y))V(nt,{value:s.clipLine(G)});else{let G=new Set;for(let tt of Y){let{label:B=""}=tt;B&&G.has(B)||(G.add(B),V(nt,tt))}}})));function V(et,{label:rt,value:j,color:nt,opacity:Y}){rt??="",j??="";let G=nt!=null||Y!=null,tt,B=x*100,[_t]=mc(rt,B,D,$);if(_t>=0)rt=rt.slice(0,_t).trimEnd()+dc,tt=j.trim(),j="";else{(rt||!j&&!G)&&(j=" "+j);let[Ct]=mc(j,B-D(rt),D,$);Ct>=0&&(tt=j.trim(),j=j.slice(0,Ct).trimEnd()+dc)}let ct=et.append("tspan").attr("x",0).attr("dy",`${m}em`).text("\u200B");rt&&ct.append("tspan").attr("font-weight","bold").text(rt),j&&ct.append(()=>l.createTextNode(j)),G&&ct.append("tspan").text(" \u25A0").attr("fill",nt).attr("fill-opacity",Y).style("user-select","none"),tt&&ct.append("title").text(tt)}function K(){let{width:et,height:rt}=o.facet??o;q.selectChildren().each(function(j){let{x:nt,width:Y,height:G}=this.getBBox();Y=Math.round(Y),G=Math.round(G);let tt=d;if(tt===void 0){let ct=C(j)+k,Ct=L(j)+O,Lt=ct+Y+y+g*2<et,Z=ct-Y-y-g*2>0,jt=Ct+G+y+g*2<rt,Qn=Ct-G-y-g*2>0;tt=Lt&&Z?jt&&Qn?s.preferredAnchor:Qn?"bottom":"top":jt&&Qn?Lt?"left":"right":(Lt||Z)&&(jt||Qn)?`${Qn?"bottom":"top"}-${Lt?"left":"right"}`:s.preferredAnchor}let B=this.firstChild,_t=this.lastChild;if(B.setAttribute("d",YH(tt,y,g,Y,G)),nt)for(let ct of _t.childNodes)ct.setAttribute("x",-nt);_t.setAttribute("y",`${+BH(tt,_t.childNodes.length,m).toFixed(6)}em`),_t.setAttribute("transform",`translate(${zH(tt,y,g,Y,G)})`)}),q.attr("visibility",null)}return e.length&&(q.attr("visibility","hidden"),p.isConnected?Promise.resolve().then(K):typeof requestAnimationFrame<"u"&&requestAnimationFrame(K)),q.node()}};function Ab(t,{x:e,y:n,...r}={}){return r.frameAnchor===void 0&&([e,n]=me(e,n)),new dh(t,{...r,x:e,y:n})}function BH(t,e,n){return/^top(?:-|$)/.test(t)?.94-n:-.29-e*n}function zH(t,e,n,r,o){switch(t){case"middle":return[-r/2,o/2];case"top-left":return[n,e+n];case"top":return[-r/2,e/2+n];case"top-right":return[-r-n,e+n];case"right":return[-e/2-r-n,o/2];case"bottom-left":return[n,-e-n];case"bottom":return[-r/2,-e/2-n];case"bottom-right":return[-r-n,-e-n];case"left":return[n+e/2,o/2]}}function YH(t,e,n,r,o){let i=r+n*2,s=o+n*2;switch(t){case"middle":return`M${-i/2},${-s/2}h${i}v${s}h${-i}z`;case"top-left":return`M0,0l${e},${e}h${i-e}v${s}h${-i}z`;case"top":return`M0,0l${e/2},${e/2}h${(i-e)/2}v${s}h${-i}v${-s}h${(i-e)/2}z`;case"top-right":return`M0,0l${-e},${e}h${e-i}v${s}h${i}z`;case"right":return`M0,0l${-e/2},${-e/2}v${e/2-s/2}h${-i}v${s}h${i}v${e/2-s/2}z`;case"bottom-left":return`M0,0l${e},${-e}h${i-e}v${-s}h${-i}z`;case"bottom":return`M0,0l${e/2},${-e/2}h${(i-e)/2}v${-s}h${-i}v${s}h${(i-e)/2}z`;case"bottom-right":return`M0,0l${-e},${-e}h${e-i}v${-s}h${i}z`;case"left":return`M0,0l${e/2},${-e/2}v${e/2-s/2}h${i}v${s}h${-i}v${e/2-s/2}z`}}function i$(t,e){let n={},r=this.format;r=s$(r,t,"x"),r=s$(r,t,"y"),this.format=r;for(let o in r){let i=r[o];if(!(i===null||i===!1))if(o==="fx"||o==="fy")n[o]=!0;else{let s=Zd(t,o);s&&(n[o]=s)}}for(let o in t){if(o in n||o in r||qH.has(o)||(o==="x"||o==="y")&&t.geometry)continue;let i=Zd(t,o);if(i){if(i.scale==null&&i.defaultScale==="color")continue;n[o]=i}}this.facet&&(e.fx&&!("fx"in r)&&(n.fx=!0),e.fy&&!("fy"in r)&&(n.fy=!0));for(let o in n){let i=this.format[o];if(typeof i=="string"){let s=n[o]?.value??e[o]?.domain()??[];this.format[o]=(fe(s)?Co:Ir)(i)}else if(i===void 0||i===!0){let s=e[o];this.format[o]=s?.bandwidth?ah(s,s.domain()):zo}}return n}function s$(t,e,n){if(!(n in t))return t;let r=`${n}1`,o=`${n}2`;if((r in t||!(r in e))&&(o in t||!(o in e)))return t;let i=Object.entries(t),s=t[n];return i.splice(i.findIndex(([a])=>a===n)+1,0,[r,s],[o,s]),Object.fromEntries(i)}function UH(t,e,{title:n}){return this.format.title(n.value[t],t)}function*jH(t,e,n,r,o){for(let i in n){if(i==="fx"||i==="fy"){yield{label:Mb(r,n,i),value:this.format[i](e[i],t)};continue}if(i==="x1"&&"x2"in n||i==="y1"&&"y2"in n)continue;let s=n[i];if(i==="x2"&&"x1"in n)yield{label:c$(r,n,"x"),value:a$(this.format.x2,n.x1,s,t)};else if(i==="y2"&&"y1"in n)yield{label:c$(r,n,"y"),value:a$(this.format.y2,n.y1,s,t)};else{let a=s.value[t],c=s.scale;if(!oe(a)&&c==null)continue;yield{label:Mb(r,n,i),value:this.format[i](a,t),color:c==="color"?o[i][t]:null,opacity:c==="opacity"?o[i][t]:null}}}}function a$(t,e,n,r){return n.hint?.length?`${t(n.value[r]-e.value[r],r)}`:`${t(e.value[r],r)}\u2013${t(n.value[r],r)}`}function c$(t,e,n){let r=Mb(t,e,`${n}1`,n),o=Mb(t,e,`${n}2`,n);return r===o?r:`${r}\u2013${o}`}function Mb(t,e,n,r=n){let o=e[n],i=t[o?.scale??n];return String(i?.label??o?.label??r)}function Iu(t={}){let{facet:e,style:n,title:r,subtitle:o,caption:i,ariaLabel:s,ariaDescription:a}=t,c=Fs(t.className),f=t.marks===void 0?[]:u$(t.marks);f.push(...QH(f));let u=GH(e,t),p=new Map;for(let $ of f){let P=l$($,u,t);P&&p.set($,P)}let l=new Map;u&&hh(l,[u],t),hh(l,p,t);let d=u$(ZH(f,l,t));for(let $ of d){let P=l$($,u,t);P&&p.set($,P)}f.unshift(...d);let h=FR(l,t);if(h!==void 0){let $=u?Z1(h,u):void 0;for(let F of f){if(F.facet===null||F.facet==="super")continue;let q=p.get(F);q!==void 0&&(q.facetsIndex=F.fx!=null||F.fy!=null?Z1(h,q):$)}let P=new Set;for(let{facetsIndex:F}of p.values())F?.forEach((q,V)=>{q?.length>0&&P.add(V)});h.forEach(0<P.size&&P.size<h.length?(F,q)=>F.empty=!P.has(q):F=>F.empty=!1);for(let F of f)if(F.facet==="exclude"){let q=p.get(F);q!==void 0&&(q.facetsIndex=zR(q.facetsIndex))}}for(let $ of Wt.keys())Ro(t[$])&&$!=="fx"&&$!=="fy"&&l.set($,[]);let m=new Map;for(let $ of f){if(m.has($))throw new Error("duplicate mark; each mark must be unique");let{facetsIndex:P,channels:F}=p.get($)??{},{data:q,facets:V,channels:K}=$.initialize(P,F,t);C4(K,t),m.set($,{data:q,facets:V,channels:K})}let x=th(hh(l,m,t),t),g=eO(x,f,t);kR(x,g);let y=HS(x),{fx:b,fy:w}=y,_=b||w?QS(x,g):g,v=b||w?oQ(y,g):g,A=Ds(t),T=A.document,E=hi("svg").call(T.documentElement),N=E;A.ownerSVGElement=E,A.className=c,A.projection=jR(t,_),A.filterFacets=($,P)=>Z1(h,{channels:P,groups:H1($,P)}),A.getMarkState=$=>{let P=m.get($),F=p.get($);return{...P,channels:{...P.channels,...F?.channels}}},A.dispatchValue=$=>{N.value!==$&&(N.value=$,N.dispatchEvent(new Event("input",{bubbles:!0})))};let M=new Set;for(let[$,P]of m)if($.initializer!=null){let F=$.facet==="super"?v:_,q=$.initializer(P.data,P.facets,P.channels,y,F,A);if(q.data!==void 0&&(P.data=q.data),q.facets!==void 0&&(P.facets=q.facets),q.channels!==void 0){let{fx:V,fy:K,...et}=q.channels;VH(et),Object.assign(P.channels,et);for(let rt of Object.values(et)){let{scale:j}=rt;j!=null&&!kL(Wt.get(j))&&(h$(rt,t),M.add(j))}(V!=null||K!=null)&&p.set($,!0)}}if(M.size){let $=new Map;hh($,m,t,V=>M.has(V)),hh(l,m,t,V=>M.has(V));let P=rQ(th($,t),x),{scales:F,...q}=HS(P);Object.assign(x,P),Object.assign(y,q),Object.assign(y.scales,F)}let k,O;h!==void 0&&(k={x:b?.domain(),y:w?.domain()},h=qR(h,k),O=BR(b,w,g));for(let[$,P]of m)P.values=$.scale(P.channels,y,A);let{width:S,height:I}=g;Nt(E).attr("class",c).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",S).attr("height",I).attr("viewBox",`0 0 ${S} ${I}`).attr("aria-label",s).attr("aria-description",a).call($=>$.append("style").text(`:where(.${c}) {
60
51
  --plot-background: white;
61
52
  display: block;
62
53
  height: auto;
@@ -66,24 +57,24 @@ ${m}`)).style("margin-left",l?`${+l}px`:null).style("width",h===void 0?null:`${+
66
57
  :where(.${c} text),
67
58
  :where(.${c} tspan) {
68
59
  white-space: pre;
69
- }`)).call(Kf,n);for(let k of l){let{channels:$,values:P,facets:U}=m.get(k);if(p===void 0||k.facet==="super"){let G=null;if(U&&(G=U[0],G=k.filter(G,$,P),G.length===0))continue;let nt=k.render(G,x,P,_,A);if(nt==null)continue;T.appendChild(nt)}else{let G;for(let nt of p){if(!(k.facetAnchor?.(p,O,nt)??!nt.empty))continue;let ot=null;if(U){let Y=f.has(k);if(ot=U[Y?nt.i:0],ot=k.filter(ot,$,P),ot.length===0)continue;!Y&&ot===U[0]&&(ot=Js(ot)),ot.fx=nt.x,ot.fy=nt.y,ot.fi=nt.i}let at=k.render(ot,x,P,v,A);if(at!=null){(G??=Yt(T).append("g")).append(()=>at).datum(nt);for(let Y of["aria-label","aria-description","aria-hidden","transform"])at.hasAttribute(Y)&&(G.attr(Y,at.getAttribute(Y)),at.removeAttribute(Y))}}G?.selectChildren().attr("transform",L)}}let N=y9(y,A,e),{figure:R=r!=null||i!=null||o!=null||N.length>0}=e;R&&(D=E.createElement("figure"),D.className=`${c}-figure`,D.style.maxWidth="initial",r!=null&&D.append(_9(E,r,"h2")),i!=null&&D.append(_9(E,i,"h3")),D.append(...N,T),o!=null&&D.append(xtt(E,o)),"value"in T&&(D.value=T.value,delete T.value)),D.scale=i$(x.scales),D.legend=p9(y,A,e);let F=k7();return F>0&&Yt(T).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(`${F.toLocaleString("en-US")} warning${F===1?"":"s"}. Please check the console.`),D}function _9(e,t,n){if(t.ownerDocument)return t;let r=e.createElement(n);return r.append(t),r}function xtt(e,t){let n=e.createElement("figcaption");return n.append(t),n}function v9(e){return e.flat(1/0).filter(t=>t!=null).map(btt)}function btt(e){return typeof e.render=="function"?e:new PT(e)}var PT=class extends vt{constructor(t){if(typeof t!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}};function UT(e,t){for(let n in e)M9(e[n],t);return e}function M9(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==null?NaN:c*100:P3(s,i)}=t[n]??{};a!=null&&(e.value=Wt(e.value,a),e.transform=!1)}function wtt(e){for(let t in e)eT(t,e[t])}function Ay(e,t,n,r=zF){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(!g$(n)){let c=n.x?.domain===void 0,l=n.y?.domain===void 0;if(c||l){let[u,f]=b$(s);c&&$T(e,"x",u),l&&$T(e,"y",f)}}}else $T(e,a,s)}return e}function $T(e,t,n){let r=e.get(t);r!==void 0?r.push(n):e.set(t,[n])}function _tt(e,t){if(e==null)return;let{x:n,y:r}=e;if(n==null&&r==null)return;let i=je(e.data);if(i==null)throw new Error("missing facet data");let o={};n!=null&&(o.fx=Yf(i,{value:n,scale:"fx"})),r!=null&&(o.fy=Yf(i,{value:r,scale:"fy"})),UT(o,t);let s=Zw(i,o);return{channels:o,groups:s,data:e.data}}function S9(e,t,n){if(e.facet===null||e.facet==="super")return;let{fx:r,fy:i}=e;if(r!=null||i!=null){let c=je(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=Yf(c,{value:r,scale:"fx"})),i!=null&&(l.fy=Yf(c,{value:i,scale:"fy"})),UT(l,n),{channels:l,groups:Zw(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)&&je(e.data)?.length===a.length&&Yn(`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 vtt(e,t={}){return Me({...t,x:null,y:null},(n,r,i,o,s,a)=>a.getMarkState(e))}function Stt(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)?cc:/^y$/i.test(i)?oa:ac,r=i(vtt(n,r)),r.title=null,o===void 0&&(r.preferredAnchor=i===oa?"left":"bottom");let s=A_(n.data,r);s.facet=n.facet,s.facetAnchor=n.facetAnchor,t.push(s)}}return t}function Itt(e,t,n){let{projection:r,x:i={},y:o={},fx:s={},fy:a={},axis:c,grid:l,facet:u={},facet:{axis:f=c,grid:h}=u,x:{axis:d=c,grid:p=d===null?null:l}=i,y:{axis:m=c,grid:y=m===null?null:l}=o,fx:{axis:g=f,grid:x=g===null?null:h}=s,fy:{axis:b=f,grid:w=b===null?null:h}=a}=n;(r||!jo(i)&&!I9("x",e))&&(d=p=null),(r||!jo(o)&&!I9("y",e))&&(m=y=null),t.has("fx")||(g=x=null),t.has("fy")||(b=w=null),d===void 0&&(d=!E_(e,"x")),m===void 0&&(m=!E_(e,"y")),g===void 0&&(g=!E_(e,"fx")),b===void 0&&(b=!E_(e,"fy")),d===!0&&(d="bottom"),m===!0&&(m="left"),g===!0&&(g=d==="top"||d===null?"bottom":"top"),b===!0&&(b=m==="right"||m===null?"left":"right");let v=[];return T_(v,w,w_,a),M_(v,b,g_,"right","left",u,a),T_(v,x,v_,s),M_(v,g,x_,"top","bottom",u,s),T_(v,y,b_,o),M_(v,m,wy,"left","right",n,o),T_(v,p,__,i),M_(v,d,_y,"bottom","top",n,i),v}function M_(e,t,n,r,i,o,s){if(!t)return;let a=Att(t);s=Mtt(a?r:t,o,s);let{line:c}=s;(n===wy||n===_y)&&c&&!ta(c)&&e.push(ih(Ttt(s))),e.push(n(s)),a&&e.push(n({...s,anchor:i,label:null}))}function T_(e,t,n,r){!t||ta(t)||e.push(n(Ett(t,r)))}function Att(e){return/^\s*both\s*$/i.test(e)}function Mtt(e,t,{line:n=t.line,ticks:r,tickSize:i,tickSpacing:o,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:l,ariaLabel:u,ariaDescription:f,label:h=t.label,labelAnchor:d,labelArrow:p=t.labelArrow,labelOffset:m}){return{anchor:e,line:n,ticks:r,tickSize:i,tickSpacing:o,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:l,ariaLabel:u,ariaDescription:f,label:h,labelAnchor:d,labelArrow:p,labelOffset:m}}function Ttt(e){let{anchor:t,line:n}=e;return{anchor:t,facetAnchor:t+"-empty",stroke:n===!0?void 0:n}}function Ett(e,{stroke:t=Ka(e)?e:void 0,ticks:n=Ntt(e)?e:void 0,tickSpacing:r,ariaLabel:i,ariaDescription:o}){return{stroke:t,ticks:n,tickSpacing:r,ariaLabel:i,ariaDescription:o}}function Ntt(e){switch(typeof e){case"number":return!0;case"string":return!Ka(e)}return ur(e)||typeof e?.range=="function"}function E_(e,t){let n=`${t}-axis `;return e.some(r=>r.ariaLabel?.startsWith(n))}function I9(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 Dtt(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 Ott({fx:e,fy:t},n){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:a,height:c}=Gw(n),l=e&&A9(e),u=t&&A9(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 A9(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 Btt=new Map([["basis",s3],["basis-closed",a3],["basis-open",c3],["bundle",l3],["bump-x",e3],["bump-y",n3],["cardinal",u3],["cardinal-closed",f3],["cardinal-open",h3],["catmull-rom",d3],["catmull-rom-closed",p3],["catmull-rom-open",m3],["linear",Gs],["linear-closed",y3],["monotone-x",x3],["monotone-y",b3],["natural",w3],["step",_3],["step-after",S3],["step-before",v3]]);function My(e=Gs,t){if(typeof e=="function")return e;let n=Btt.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 N_(e=fc,t){return typeof e!="function"&&`${e}`.toLowerCase()==="auto"?fc:My(e,t)}function fc(e){return Gs(e)}function Jo(e={y:"count"},t={}){[e,t]=qT(e,t);let{x:n,y:r}=t;return zT(D_(n,t,H),null,null,r,e,Pl(t))}function Qo(e={x:"count"},t={}){[e,t]=qT(e,t);let{x:n,y:r}=t;return zT(null,D_(r,t,H),n,null,e,Ul(t))}function aa(e={fill:"count"},t={}){[e,t]=qT(e,t);let{x:n,y:r}=Ltt(t);return zT(n,r,null,null,e,Pl(Ul(t)))}function N9(e,t,n={}){if(n?.interval==null)return n;let{reduce:r=zw}=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 sh(e={}){return N9(Jo,"y",Xi(e,"x"))}function ah(e={}){return N9(Qo,"x",Xi(e,"y"))}function zT(e,t,n,r,{data:i=Uw,filter:o=cy,sort:s,reverse:a,...c}={},l={}){e=T9(e),t=T9(t),c=Ctt(c,l),i=B9(i,H),s=s==null?void 0:D9("sort",s,l),o=o==null?void 0:O9("filter",o,l),n!=null&&Go(c,"x","x1","x2")&&(n=null),r!=null&&Go(c,"y","y1","y2")&&(r=null);let[u,f]=Ln(e),[h,d]=Ln(e),[p,m]=Ln(t),[y,g]=Ln(t),[x,b]=n!=null?[n,"x"]:r!=null?[r,"y"]:[],[w,v]=Ln(x),{x:_,y:A,z:E,fill:T,stroke:D,x1:I,x2:O,y1:L,y2:S,domain:M,cumulative:N,thresholds:R,interval:F,...k}=l,[$,P]=Ln(E),[U]=Be(T),[G]=Be(D),[nt,ot]=Ln(U),[at,Y]=Ln(G);return{..."z"in l&&{z:$||E},..."fill"in l&&{fill:nt||T},..."stroke"in l&&{stroke:at||D},...bn(k,(st,q,Z)=>{let rt=Cl(wt(st,x),Z?.[b]),z=wt(st,E),Ft=wt(st,U),ht=wt(st,G),Ht=fy(c,{z,fill:Ft,stroke:ht}),Qt=[],tt=[],le=rt&&v([]),Mr=z&&P([]),Hi=Ft&&ot([]),cq=ht&&Y([]),IO=e&&f([]),lq=e&&d([]),AO=t&&m([]),uq=t&&g([]),fq=Ftt(e,t,st),hq=0;for(let su of c)su.initialize(st);s&&s.initialize(st),o&&o.initialize(st);for(let su of q){let MO=[];for(let au of c)au.scope("facet",su);s&&s.scope("facet",su),o&&o.scope("facet",su);for(let[au,dq]of tc(su,Ht))for(let[pq,Fg]of tc(dq,rt))for(let[Zi,os]of fq(Fg))if(Ht&&(os.z=au),!(o&&!o.reduce(Zi,os))){MO.push(hq++),tt.push(i.reduceIndex(Zi,st,os)),rt&&le.push(pq),z&&Mr.push(Ht===z?au:z[(Zi.length>0?Zi:Fg)[0]]),Ft&&Hi.push(Ht===Ft?au:Ft[(Zi.length>0?Zi:Fg)[0]]),ht&&cq.push(Ht===ht?au:ht[(Zi.length>0?Zi:Fg)[0]]),IO&&(IO.push(os.x1),lq.push(os.x2)),AO&&(AO.push(os.y1),uq.push(os.y2));for(let mq of c)mq.reduce(Zi,os);s&&s.reduce(Zi,os)}Qt.push(MO)}return Q3(Qt,s,a),{data:tt,facets:Qt}}),...!Go(c,"x")&&(u?{x1:u,x2:h,x:Uf(u,h)}:{x:_,x1:I,x2:O}),...!Go(c,"y")&&(p?{y1:p,y2:y,y:Uf(p,y)}:{y:A,y1:L,y2:S}),...w&&{[b]:w},...Object.fromEntries(c.map(({name:st,output:q})=>[st,q]))}}function qT({cumulative:e,domain:t,thresholds:n,interval:r,...i},o){return[i,{cumulative:e,domain:t,thresholds:n,interval:r,...o}]}function D_(e,{cumulative:t,domain:n,thresholds:r,interval:i},o){return e={...bi(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=jT(e.thresholds,e.interval),e}function Ltt(e){let{x:t,y:n}=e;return t=D_(t,e),n=D_(n,e),[t.value,n.value]=$e(t.value,n.value),{x:t,y:n}}function T9(e){if(e==null)return;let{value:t,cumulative:n,domain:r=fe,thresholds:i}=e,o=s=>{let a=wt(s,t),c;if(Le(a)||Rtt(i)){a=Wt(a,C3,Float64Array);let[u,f]=typeof r=="function"?r(a):r,h=typeof i=="function"&&!Qa(i)?i(a,u,f):i;typeof h=="number"&&(h=Dm(u,f,h)),Qa(h)&&(r===fe&&(u=h.floor(u),f=h.offset(h.floor(f))),h=h.range(u,h.offset(f))),c=h}else{a=en(a);let[u,f]=typeof r=="function"?r(a):r,h=typeof i=="function"&&!Qa(i)?i(a,u,f):i;if(typeof h=="number")if(r===fe){let d=Ns(u,f,h);if(isFinite(d))if(d>0){let p=Math.round(u/d),m=Math.round(f/d);p*d<=u||--p,m*d>f||++m;let y=m-p+1;h=new Float64Array(y);for(let g=0;g<y;++g)h[g]=(p+g)*d}else if(d<0){d=-d;let p=Math.round(u*d),m=Math.round(f*d);p/d<=u||--p,m/d>f||++m;let y=m-p+1;h=new Float64Array(y);for(let g=0;g<y;++g)h[g]=(p+g)/d}else h=[u];else h=[u]}else h=En(u,f,h);else Qa(h)&&(r===fe&&(u=h.floor(u),f=h.offset(h.floor(f))),h=h.range(u,h.offset(f)));c=h}let l=[];if(c.length===1)l.push([c[0],c[0]]);else for(let u=1;u<c.length;++u)l.push([c[u-1],c[u]]);return l.bin=(n<0?Ptt:n>0?$tt:VT)(l,c,a),l};return o.label=Cn(t),o}function jT(e,t,n=E9){if(e===void 0)return t===void 0?n:Yo(t);if(typeof e=="string"){switch(e.toLowerCase()){case"freedman-diaconis":return vx;case"scott":return Ap;case"sturges":return Da;case"auto":return E9}return Ol(e)}return e}function Ctt(e,t){return Z3(e,t,D9)}function D9(e,t,n){return $w(e,t,n,O9)}function O9(e,t,n){return Pw(e,t,n,B9)}function B9(e,t){return Vf(e,t,ktt)}function ktt(e){switch(`${e}`.toLowerCase()){case"x":return Utt;case"x1":return qtt;case"x2":return jtt;case"y":return ztt;case"y1":return Vtt;case"y2":return Ytt;case"z":return K3}throw new Error(`invalid bin reduce: ${e}`)}function E9(e,t,n){return Math.min(200,Ap(e,t,n))}function Rtt(e){return YF(e)||ur(e)&&Le(e)}function Ftt(e,t,n){let r=e?.(n),i=t?.(n);return r&&i?function*(o){let s=r.bin(o);for(let[a,[c,l]]of r.entries()){let u=i.bin(s[a]);for(let[f,[h,d]]of i.entries())yield[u[f],{data:n,x1:c,y1:h,x2:l,y2:d}]}}:r?function*(o){let s=r.bin(o);for(let[a,[c,l]]of r.entries())yield[s[a],{data:n,x1:c,x2:l}]}:function*(o){let s=i.bin(o);for(let[a,[c,l]]of i.entries())yield[s[a],{data:n,y1:c,y2:l}]}}function VT(e,t,n){return t=en(t),r=>{let i=e.map(()=>[]);for(let o of r)i[Ts(t,n[o])-1]?.push(o);return i}}function $tt(e,t,n){let r=VT(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 Ptt(e,t,n){let r=VT(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 L9(e,t){let n=(+e+ +t)/2;return e instanceof Date?new Date(n):n}var Utt={reduceIndex(e,t,{x1:n,x2:r}){return L9(n,r)}},ztt={reduceIndex(e,t,{y1:n,y2:r}){return L9(n,r)}},qtt={reduceIndex(e,t,{x1:n}){return n}},jtt={reduceIndex(e,t,{x2:n}){return n}},Vtt={reduceIndex(e,t,{y1:n}){return n}},Ytt={reduceIndex(e,t,{y2:n}){return n}};function ch(e={}){return R3(e)?e:{...e,x:H}}function lh(e={}){return F3(e)?e:{...e,y:H}}function C9(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=Ja(e);let o=e[O3]=new Uint32Array(n+i);t=t.map(a=>Ja(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 YT(e={},t={}){arguments.length===1&&([e,t]=hh(e));let{y1:n,y:r=n,x:i,...o}=t,[s,a,c,l]=dh(r,i,"y","x",e,o);return{...s,y1:n,y:a,x1:c,x2:l,x:Uf(c,l)}}function F9(e={},t={}){arguments.length===1&&([e,t]=hh(e));let{y1:n,y:r=n,x:i}=t,[o,s,a]=dh(r,i,"y","x",e,t);return{...o,y1:n,y:s,x:a}}function $9(e={},t={}){arguments.length===1&&([e,t]=hh(e));let{y1:n,y:r=n,x:i}=t,[o,s,,a]=dh(r,i,"y","x",e,t);return{...o,y1:n,y:s,x:a}}function XT(e={},t={}){arguments.length===1&&([e,t]=hh(e));let{x1:n,x:r=n,y:i,...o}=t,[s,a,c,l]=dh(r,i,"x","y",e,o);return{...s,x1:n,x:a,y1:c,y2:l,y:Uf(c,l)}}function P9(e={},t={}){arguments.length===1&&([e,t]=hh(e));let{x1:n,x:r=n,y:i}=t,[o,s,a]=dh(r,i,"x","y",e,t);return{...o,x1:n,x:s,y:a}}function U9(e={},t={}){arguments.length===1&&([e,t]=hh(e));let{x1:n,x:r=n,y:i}=t,[o,s,,a]=dh(r,i,"x","y",e,t);return{...o,x1:n,x:s,y:a}}function uh({x:e,x1:t,x2:n,...r}={}){return r=Xi(r,"y"),t===void 0&&n===void 0?YT({x:e,...r}):([t,n]=$3(e,t,n),{...r,x1:t,x2:n})}function fh({y:e,y1:t,y2:n,...r}={}){return r=Xi(r,"x"),t===void 0&&n===void 0?XT({y:e,...r}):([t,n]=$3(e,t,n),{...r,y1:t,y2:n})}function hh(e){let{offset:t,order:n,reverse:r,...i}=e;return[{offset:t,order:n,reverse:r},i]}var Xtt={length:!0};function dh(e,t=oy,n,r,{offset:i,order:o,reverse:s},a){if(t===null)throw new Error(`stack requires ${r}`);let c=Vn(a),[l,u]=Ln(e),[f,h]=xn(t),[d,p]=xn(t);return f.hint=d.hint=Xtt,i=Gtt(i),o=Ztt(o,i,r),[bn(a,(m,y,g)=>{({data:m,facets:y}=C9(m,y));let x=e==null?void 0:u(Cl(wt(m,e),g?.[n])),b=wt(m,t,Float64Array),w=wt(m,c),v=o&&o(m,x,b,w),_=m.length,A=h(new Float64Array(_)),E=p(new Float64Array(_)),T=[];for(let D of y){let I=x?Array.from(fn(D,O=>x[O]).values()):[D];if(v)for(let O of I)O.sort(v);for(let O of I){let L=0,S=0;s&&O.reverse();for(let M of O){let N=b[M];N<0?L=E[M]=(A[M]=L)+N:N>0?S=E[M]=(A[M]=S)+N:E[M]=A[M]=S}}T.push(I)}return i&&i(T,A,E,w),{data:m,facets:y}}),l,f,d]}function Gtt(e){if(e!=null){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"expand":case"normalize":return Wtt;case"center":case"silhouette":return Htt;case"wiggle":return q9}throw new Error(`unknown offset: ${e}`)}}function z9(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 Wtt(e,t,n){for(let r of e)for(let i of r){let[o,s]=z9(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 Htt(e,t,n){for(let r of e){for(let i of r){let[o,s]=z9(i,n);for(let a of i){let c=(s+o)/2;t[a]-=c,n[a]-=c}}j9(r,t,n)}V9(e,t,n)}function q9(e,t,n,r){for(let i of e){let o=new Qn,s=0;for(let a of i){let c=-1,l=a.map(d=>Math.abs(n[d]-t[d])),u=a.map(d=>{c=r?r[d]:++c;let p=n[d]-t[d],m=o.has(c)?p-o.get(c):0;return o.set(c,p),m}),f=[0,...gx(u)];for(let d of a)t[d]+=s,n[d]+=s;let h=Nn(l);h&&(s-=Nn(l,(d,p)=>(u[p]/2+f[p])*d)/h)}j9(i,t,n)}V9(e,t,n)}function j9(e,t,n){let r=he(e,i=>he(i,o=>t[o]));for(let i of e)for(let o of i)t[o]-=r,n[o]-=r}function V9(e,t,n){let r=e.length;if(r===1)return;let i=e.map(a=>a.flat()),o=i.map(a=>(he(a,c=>t[c])+Jt(a,c=>n[c]))/2),s=he(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 Ztt(e,t,n){if(e===void 0&&t===q9)return k9(mn);if(e!=null){if(typeof e=="string"){let r=e.startsWith("-"),i=r?Nl:mn;switch((r?e.slice(1):e).toLowerCase()){case"value":case n:return Jtt(i);case"z":return Qtt(i);case"sum":return Ktt(i);case"appearance":return tet(i);case"inside-out":return k9(i)}return R9(B3(e))}if(typeof e=="function")return(e.length===1?R9:eet)(e);if(Array.isArray(e))return net(e);throw new Error(`invalid order: ${e}`)}}function Jtt(e){return(t,n,r)=>(i,o)=>e(r[i],r[o])}function Qtt(e){return(t,n,r,i)=>(o,s)=>e(i[o],i[s])}function Ktt(e){return O_(e,(t,n,r,i)=>zu(lr(t),o=>Nn(o,s=>r[s]),o=>i[o]))}function tet(e){return O_(e,(t,n,r,i)=>zu(lr(t),o=>n[el(o,s=>r[s])],o=>i[o]))}function k9(e){return O_(e,(t,n,r,i)=>{let o=lr(t),s=zu(o,f=>n[el(f,h=>r[h])],f=>i[f]),a=Ui(o,f=>Nn(f,h=>r[h]),f=>i[f]),c=[],l=[],u=0;for(let f of s)u<0?(u+=a.get(f),c.push(f)):(u-=a.get(f),l.push(f));return l.reverse().concat(c)})}function R9(e){return t=>{let n=wt(t,e);return(r,i)=>mn(n[r],n[i])}}function eet(e){return t=>(n,r)=>e(t[n],t[r])}function net(e){return O_(mn,()=>e)}function O_(e,t){return(n,r,i,o)=>{if(!o)throw new Error("missing channel: z");let s=new Qn(t(n,r,i,o).map((a,c)=>[a,c]));return(a,c)=>e(s.get(o[a]),s.get(o[c]))}}var ret={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Yl=class extends vt{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:Vn(n),optional:!0}},n,ret),this.z=a,this.curve=My(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 ut("svg:g",o).call(kt,this,i,o).call(Et,this,n,0,0).call(u=>u.selectAll().data(r_(t,[s,a,c,l],this,r)).enter().append("path").call(Ct,this).call($l,this,r).attr("d",Tf().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 Ty(e,t){return t===void 0?ca(e,{x:Ll,y:Za}):new Yl(e,t)}function hc(e,t){let{y:n=Ne,...r}=ah(t);return new Yl(e,uh(ch({...r,y1:n,y2:void 0})))}function ca(e,t){let{x:n=Ne,...r}=sh(t);return new Yl(e,fh(lh({...r,x1:n,x2:void 0})))}var iet={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Ey=class extends vt{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,iet),this.curve=N_(a,c),Gi(this,n)}project(t,n,r){this.curve!==fc&&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 ut("svg:g",o).call(kt,this,i,o).call(Et,this,n).call(f=>f.selectAll().data(t).enter().append("path").call(Ct,this).attr("d",u===fc&&o.projection?oet(o.projection,s,a,c,l):h=>{let d=rr(),p=u(d);return p.lineStart(),p.point(s[h],a[h]),p.point(c[h],l[h]),p.lineEnd(),d}).call(Kt,this,r).call(sa,this,r,o)).node()}};function oet(e,t,n,r,i){let o=On(e);return t=en(t),n=en(n),r=en(r),i=en(i),s=>o({type:"LineString",coordinates:[[t[s],n[s]],[r[s],i[s]]]})}function B_(e,{x:t,x1:n,x2:r,y:i,y1:o,y2:s,...a}={}){return[n,r]=Ny(t,n,r),[o,s]=Ny(i,o,s),new Ey(e,{...a,x1:n,x2:r,y1:o,y2:s})}function Ny(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 set={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5},Dy=class extends vt{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,bend:a=0,headAngle:c=60,headLength:l=8,inset:u=0,insetStart:f=u,insetEnd:h=u,sweep:d}=n;super(t,{x1:{value:r,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,set),this.bend=a===!0?22.5:Math.max(-90,Math.min(90,a)),this.headAngle=+c,this.headLength=+l,this.insetStart=+f,this.insetEnd=+h,this.sweep=aet(d)}render(t,n,r,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a,SW:u}=r,{strokeWidth:f,bend:h,headAngle:d,headLength:p,insetStart:m,insetEnd:y}=this,g=u?w=>u[w]:yn(f===void 0?1:f),x=d*eh/2,b=p/1.5;return ut("svg:g",o).call(kt,this,i,o).call(Et,this,n).call(w=>w.selectAll().data(t).enter().append("path").call(Ct,this).attr("d",v=>{let _=s[v],A=a[v],E=c[v],T=l[v],D=Math.hypot(E-_,T-A);if(D<=m+y)return null;let I=Math.atan2(T-A,E-_),O=Math.min(b*g(v),D/3),L=this.sweep(_,A,E,T)*h*eh,S=Math.hypot(D/Math.tan(L),D)/2;if(m||y)if(S<1e5){let nt=Math.sign(L),[ot,at]=cet([_,A],[E,T],S,nt);if(m&&([_,A]=Y9([ot,at,S],[_,A,m],-nt*Math.sign(m))),y){let[Y,st]=Y9([ot,at,S],[E,T,y],nt*Math.sign(y));I+=Math.atan2(st-at,Y-ot)-Math.atan2(T-at,E-ot),E=Y,T=st}}else{let nt=E-_,ot=T-A,at=Math.hypot(nt,ot);m&&(_+=nt/at*m,A+=ot/at*m),y&&(E-=nt/at*y,T-=ot/at*y)}let M=I+L,N=M+x,R=M-x,F=E-O*Math.cos(N),k=T-O*Math.sin(N),$=E-O*Math.cos(R),P=T-O*Math.sin(R),U=S<1e5?`A${S},${S} 0,0,${L>0?1:0} `:"L",G=O?`M${F},${k}L${E},${T}L${$},${P}`:"";return`M${_},${A}${U}${E},${T}${G}`}).call(Kt,this,r)).node()}};function aet(e=1){if(typeof e=="number")return yn(Math.sign(e));if(typeof e=="function")return(t,n,r,i)=>Math.sign(e(t,n,r,i));switch(cn(e,"sweep",["+x","-x","+y","-y"])){case"+x":return(t,n,r)=>Ot(t,r);case"-x":return(t,n,r)=>Jn(t,r);case"+y":return(t,n,r,i)=>Ot(n,i);case"-y":return(t,n,r,i)=>Jn(n,i)}}function cet([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 Y9([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 X9(e,{x:t,x1:n,x2:r,y:i,y1:o,y2:s,...a}={}){return[n,r]=Ny(t,n,r),[o,s]=Ny(i,o,s),new Dy(e,{...a,x1:n,x2:r,y1:o,y2:s})}var ph=class extends vt{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=Lt(s),this.insetRight=Lt(a),this.insetBottom=Lt(c),this.insetLeft=Lt(l),this.rx=de(u,"auto"),this.ry=de(f,"auto")}render(t,n,r,i,o){let{rx:s,ry:a}=this;return ut("svg:g",o).call(kt,this,i,o).call(this._transform,this,n).call(c=>c.selectAll().data(t).enter().append("rect").call(Ct,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(Kt,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)}},G9={ariaLabel:"bar"},Oy=class extends ph{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,G9)}_transform(t,n,{x:r}){t.call(Et,n,{x:r},0,0)}_x({x:t},{x1:n,x2:r},{marginLeft:i}){let{insetLeft:o}=this;return fr(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 fr(t)?s-i-o-a-c:l=>Math.max(0,Math.abs(r[l]-n[l])-a-c)}},By=class extends ph{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,G9)}_transform(t,n,{y:r}){t.call(Et,n,{y:r},0,0)}_y({y:t},{y1:n,y2:r},{marginTop:i}){let{insetTop:o}=this;return fr(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 fr(t)?s-i-o-a-c:l=>Math.max(0,Math.abs(r[l]-n[l])-a-c)}};function Ko(e,t={}){return $f(t)||(t={...t,y:Ne,x2:H}),new Oy(e,uh(s_(ch(t))))}function ts(e,t={}){return $f(t)||(t={...t,x:Ne,y2:H}),new By(e,fh(a_(lh(t))))}var uet={ariaLabel:"cell"},Xl=class extends ph{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,uet)}_transform(t,n){t.call(Et,n,{},0,0)}};function dc(e,{x:t,y:n,...r}={}){return[t,n]=$e(t,n),new Xl(e,{...r,x:t,y:n})}function W9(e,{x:t=Ne,fill:n,stroke:r,...i}={}){return n===void 0&&Be(r)[0]===void 0&&(n=H),new Xl(e,{...i,x:t,fill:n,stroke:r})}function H9(e,{y:t=Ne,fill:n,stroke:r,...i}={}){return n===void 0&&Be(r)[0]===void 0&&(n=H),new Xl(e,{...i,y:t,fill:n,stroke:r})}var fet={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function Ly(e){return e.sort===void 0&&e.reverse===void 0?Rw({channel:"-r"},e):e}var Gl=class extends vt{constructor(t,n={}){let{x:r,y:i,r:o,rotate:s,symbol:a=Ws,frameAnchor:c}=n,[l,u]=ce(s,0),[f,h]=r7(a),[d,p]=ce(o,f==null?3:4.5);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:d,scale:"r",filter:cr,optional:!0},rotate:{value:l,optional:!0},symbol:{value:f,scale:"auto",optional:!0}},Ly(n),fet),this.r=p,this.rotate=u,this.symbol=h,this.frameAnchor=Xo(c);let{channels:m}=this,{symbol:y}=m;if(y){let{fill:g,stroke:x}=m;y.hint={fill:g?g.value===y.value?"color":"currentColor":this.fill??"currentColor",stroke:x?x.value===y.value?"color":"currentColor":this.stroke??"none"}}}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,r:u,rotate:f,symbol:h}=r,{r:d,rotate:p,symbol:m}=this,[y,g]=_n(this,i),x=m===Ws,b=u?void 0:d*d*Math.PI;return Ya(d)&&(t=[]),ut("svg:g",o).call(kt,this,i,o).call(Et,this,{x:c&&s,y:l&&a}).call(w=>w.selectAll().data(t).enter().append(x?"circle":"path").call(Ct,this).call(x?v=>{v.attr("cx",c?_=>c[_]:y).attr("cy",l?_=>l[_]:g).attr("r",u?_=>u[_]:d)}:v=>{v.attr("transform",lc`translate(${c?_=>c[_]:y},${l?_=>l[_]:g})${f?_=>` rotate(${f[_]})`:p?` rotate(${p})`:""}`).attr("d",u&&h?_=>{let A=rr();return h[_].draw(A,u[_]*u[_]*Math.PI),A}:u?_=>{let A=rr();return m.draw(A,u[_]*u[_]*Math.PI),A}:h?_=>{let A=rr();return h[_].draw(A,b),A}:(()=>{let _=rr();return m.draw(_,b),_})())}).call(Kt,this,r)).node()}};function _i(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=$e(t,n)),new Gl(e,{...r,x:t,y:n})}function Z9(e,{x:t=H,...n}={}){return new Gl(e,l_({...n,x:t}))}function J9(e,{y:t=H,...n}={}){return new Gl(e,c_({...n,y:t}))}function Q9(e,t){return _i(e,{...t,symbol:"circle"})}function K9(e,t){return _i(e,{...t,symbol:"hexagon"})}var het={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Wl=class extends vt{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:Vn(n),optional:!0}},n,het),this.z=o,this.curve=N_(s,a),Gi(this,n)}filter(t){return t}project(t,n,r){this.curve!==fc&&super.project(t,n,r)}render(t,n,r,i,o){let{x:s,y:a}=r,{curve:c}=this;return ut("svg:g",o).call(kt,this,i,o).call(Et,this,n).call(l=>l.selectAll().data(r_(t,[s,a],this,r)).enter().append("path").call(Ct,this).call($l,this,r).call(N$,this,r,o).attr("d",c===fc&&o.projection?det(o.projection,s,a):Pm().curve(c).defined(u=>u>=0).x(u=>s[u]).y(u=>a[u]))).node()}};function det(e,t,n){let r=On(e);return t=en(t),n=en(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 Hl(e,{x:t,y:n,...r}={}){return[t,n]=$e(t,n),new Wl(e,{...r,x:t,y:n})}function pc(e,{x:t=H,y:n=Ne,...r}={}){return new Wl(e,ah({...r,x:t,y:n}))}function mc(e,{x:t=Ne,y:n=H,...r}={}){return new Wl(e,sh({...r,x:t,y:n}))}var pet={ariaLabel:"rect"},Zl=class extends vt{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,inset:a=0,insetTop:c=a,insetRight:l=a,insetBottom:u=a,insetLeft:f=a,rx:h,ry:d}=n;super(t,{x1:{value:r,scale:"x",type:r!=null&&o==null?"band":void 0,optional:!0},y1:{value:i,scale:"y",type:i!=null&&s==null?"band":void 0,optional:!0},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,pet),this.insetTop=Lt(c),this.insetRight=Lt(l),this.insetBottom=Lt(u),this.insetLeft=Lt(f),this.rx=de(h,"auto"),this.ry=de(d,"auto")}render(t,n,r,i,o){let{x:s,y:a}=n,{x1:c,y1:l,x2:u,y2:f}=r,{marginTop:h,marginRight:d,marginBottom:p,marginLeft:m,width:y,height:g}=i,{projection:x}=o,{insetTop:b,insetRight:w,insetBottom:v,insetLeft:_,rx:A,ry:E}=this,T=(s?.bandwidth?s.bandwidth():0)-_-w,D=(a?.bandwidth?a.bandwidth():0)-b-v;return ut("svg:g",o).call(kt,this,i,o).call(Et,this,{},0,0).call(I=>I.selectAll().data(t).enter().append("rect").call(Ct,this).attr("x",c&&(x||!fr(s))?u?O=>Math.min(c[O],u[O])+_:O=>c[O]+_:m+_).attr("y",l&&(x||!fr(a))?f?O=>Math.min(l[O],f[O])+b:O=>l[O]+b:h+b).attr("width",c&&(x||!fr(s))?u?O=>Math.max(0,Math.abs(u[O]-c[O])+T):T:y-d-m-w-_).attr("height",l&&(x||!fr(a))?f?O=>Math.max(0,Math.abs(l[O]-f[O])+D):D:g-h-p-b-v).call(ft,"rx",A).call(ft,"ry",E).call(Kt,this,r)).node()}};function Cy(e,t){return new Zl(e,TT(ET(t)))}function mh(e,t={}){return $f(t)||(t={...t,y:Ne,x2:H,interval:1}),new Zl(e,uh(ET(ch(t))))}function yh(e,t={}){return $f(t)||(t={...t,x:Ne,y2:H,interval:1}),new Zl(e,fh(TT(lh(t))))}function WT(e,t){t=met(t);let{x:n,y:r,color:i,size:o}=t,s=L_(e,n),a=L_(e,r),c=L_(e,i),l=L_(e,o),{fx:u,fy:f,x:{value:h,reduce:d,zero:p,...m},y:{value:y,reduce:g,zero:x,...b},color:{value:w,color:v,reduce:_},size:{value:A,reduce:E},mark:T}=t;if(d===void 0&&(d=g==null&&h==null&&A==null&&y!=null?"count":null),g===void 0&&(g=d==null&&y==null&&A==null&&h!=null?"count":null),E===void 0&&A==null&&_==null&&d==null&&g==null&&(h==null||De(s))&&(y==null||De(a))&&(E="count"),p===void 0&&(p=C_(d)?!0:void 0),x===void 0&&(x=C_(g)?!0:void 0),h==null&&y==null)throw new Error("must specify x or y");if(d!=null&&y==null)throw new Error("reducing x requires y");if(g!=null&&h==null)throw new Error("reducing y requires x");T===void 0&&(T=A!=null||E!=null?"dot":C_(d)||C_(g)||_!=null?"bar":h!=null&&y!=null?De(s)||De(a)||d==null&&g==null&&!ky(s)&&!ky(a)?"dot":"line":h!=null||y!=null?"rule":null);let D,I,O;switch(T){case"dot":O=_i,I="stroke";break;case"line":O=s&&a||d!=null||g!=null?x||g!=null||s&&ky(s)?mc:p||d!=null||a&&ky(a)?pc:Hl:s?pc:mc,I="stroke",eP(c)&&(D=null);break;case"area":O=!(x||g!=null)&&(p||d!=null||a&&ky(a))?hc:ca,I="fill",eP(c)&&(D=null);break;case"rule":O=s?Gr:Wr,I="stroke";break;case"bar":O=d!=null?De(a)?tP(d)&&s&&De(s)?dc:Ko:mh:g!=null?De(s)?tP(g)&&a&&De(a)?dc:ts:yh:_!=null||E!=null?s&&De(s)&&a&&De(a)?dc:s&&De(s)?ts:a&&De(a)?Ko:Cy:s&&Ks(s)&&!(a&&Ks(a))?Ko:a&&Ks(a)&&!(s&&Ks(s))?ts:dc,I="fill";break;default:throw new Error(`invalid mark: ${T}`)}let L={fx:u,fy:f,x:s??void 0,y:a??void 0,[I]:c??v,z:D,r:l??void 0,tip:!0},S,M={[I]:_??void 0,r:E??void 0};if(d!=null&&g!=null)throw new Error("cannot reduce both x and y");return g!=null?(M.y=g,S=De(s)?ec:Jo):d!=null?(M.x=d,S=De(a)?nc:Qo):(_!=null||E!=null)&&(s&&a?S=De(s)&&De(a)?uy:De(s)?Qo:De(a)?Jo:aa:s?S=De(s)?ec:Jo:a&&(S=De(a)?nc:Qo)),(S===aa||S===Jo)&&(L.x={value:s,...m}),(S===aa||S===Qo)&&(L.y={value:a,...b}),p===void 0&&(p=s&&!(S===aa||S===Jo)&&(O===Ko||O===hc||O===mh||O===Wr)),x===void 0&&(x=a&&!(S===aa||S===Qo)&&(O===ts||O===ca||O===yh||O===Gr)),{fx:u??null,fy:f??null,x:{value:h??null,reduce:d??null,zero:!!p,...m},y:{value:y??null,reduce:g??null,zero:!!x,...b},color:{value:w??null,reduce:_??null,...v!==void 0&&{color:v}},size:{value:A??null,reduce:E??null},mark:T,markImpl:nP[O],markOptions:L,transformImpl:nP[S],transformOptions:M,colorMode:I}}function rP(e,t){let n=WT(e,t),{fx:r,fy:i,x:{zero:o},y:{zero:s},markOptions:a,transformOptions:c,colorMode:l}=n,u=GT[n.markImpl],f=GT[n.transformImpl],h=r!=null||i!=null?ih({strokeOpacity:.1}):null,d=[o?Gr([0]):null,s?Wr([0]):null],p=u(e,f?f(c,a):a);return l==="stroke"?nn(h,d,p):nn(h,p,d)}function ky(e){let t,n;for(let r of e){if(r==null)continue;if(t===void 0){t=r;continue}let i=Math.sign(Ot(t,r));if(i){if(n!==void 0&&i!==n)return!1;t=r,n=i}}return!0}function met({x:e,y:t,color:n,size:r,fx:i,fy:o,mark:s}={}){return Yr(e)||(e=gh(e)),Yr(t)||(t=gh(t)),Yr(n)||(n=Ka(n)?{color:n}:gh(n)),Yr(r)||(r=gh(r)),Yr(i)&&({value:i}=gh(i)),Yr(o)&&({value:o}=gh(o)),s!=null&&(s=`${s}`.toLowerCase()),{x:e,y:t,color:n,size:r,fx:i,fy:o,mark:s}}function L_(e,t){let n=wt(e,t.value);return n&&(n.label=Cn(t.value)),n}function gh(e){return yet(e)?{reduce:e}:{value:e}}function C_(e){return/^(?:distinct|count|sum|proportion)$/i.test(e)}function tP(e){return/^(?:first|last|mode)$/i.test(e)}function yet(e){if(e==null)return!1;if(typeof e.reduceIndex=="function"||typeof e.reduce=="function"&&gn(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 eP(e){return e?new Kn(e).size>e.length>>1:!1}var GT={dot:_i,line:Hl,lineX:pc,lineY:mc,areaX:hc,areaY:ca,ruleX:Gr,ruleY:Wr,barX:Ko,barY:ts,rect:Cy,rectX:mh,rectY:yh,cell:dc,bin:aa,binX:Jo,binY:Qo,group:uy,groupX:ec,groupY:nc},nP=Object.fromEntries(Object.entries(GT).map(([e,t])=>[t,e]));function xh(e,t={}){let{x:n,x1:r,x2:i}=t;n===void 0&&r===void 0&&i===void 0&&(t={...t,x:n=H});let o={};return n!=null&&(o.x=e),r!=null&&(o.x1=e),i!=null&&(o.x2=e),Ar(o,t)}function bh(e,t={}){let{y:n,y1:r,y2:i}=t;n===void 0&&r===void 0&&i===void 0&&(t={...t,y:n=H});let o={};return n!=null&&(o.y=e),r!=null&&(o.y1=e),i!=null&&(o.y2=e),Ar(o,t)}function Ar(e={},t={}){let n=Vn(t),r=Object.entries(e).map(([i,o])=>{let s=Dw(i,t);if(s==null)throw new Error(`missing channel: ${i}`);let[a,c]=xn(s);return{key:i,input:s,output:a,setOutput:c,map:get(o)}});return{...bn(t,(i,o)=>{let s=wt(i,n),a=r.map(({input:l})=>wt(i,l)),c=r.map(({setOutput:l})=>l(new Array(i.length)));for(let l of o)for(let u of s?fn(l,f=>s[f]).values():[l])r.forEach(({map:f},h)=>f.mapIndex(u,a[h],c[h]));return{data:i,facets:o}}),...Object.fromEntries(r.map(({key:i,output:o})=>[i,o]))}}function get(e){if(e==null)throw new Error("missing map");if(typeof e.mapIndex=="function")return e;if(typeof e.map=="function"&&gn(e))return xet(e);if(typeof e=="function")return HT(Pf(e));switch(`${e}`.toLowerCase()){case"cumsum":return wet;case"rank":return HT((t,n)=>Mp(t,r=>n[r]));case"quantile":return HT((t,n)=>bet(t,r=>n[r]))}throw new Error(`invalid map: ${e}`)}function xet(e){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:e.map.bind(e)}}function bet(e,t){let n=So(e,t)-1;return Mp(e,t).map(r=>r/n)}function HT(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 wet={mapIndex(e,t,n){let r=0;for(let i of e)n[i]=r+=t[i]}};function iP(e={},t){return arguments.length===1&&(t=e),xh(wh(e),t)}function oP(e={},t){return arguments.length===1&&(t=e),bh(wh(e),t)}function wh(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=vet(r),Yn(`Warning: the shift option is deprecated; please use anchor "${i}" instead.`)),!((t=Math.floor(t))>0))throw new Error(`invalid k: ${t}`);return Iet(n)(t,_et(i,t),o)}function _et(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 vet(e){switch(`${e}`.toLowerCase()){case"centered":return"middle";case"leading":return"start";case"trailing":return"end"}throw new Error(`invalid shift: ${e}`)}function Iet(e="mean"){if(typeof e=="string"){if(/^p\d{2}$/i.test(e))return k_(Ff(e));switch(e.toLowerCase()){case"deviation":return k_(ci);case"max":return R_((t,n)=>Jt(t,r=>n[r]));case"mean":return Aet;case"median":return k_(zi);case"min":return R_((t,n)=>he(t,r=>n[r]));case"mode":return R_((t,n)=>Yu(t,r=>n[r]));case"sum":return sP;case"variance":return k_(Na);case"difference":return Eet;case"ratio":return Net;case"first":return Det;case"last":return Oet}}if(typeof e!="function")throw new Error(`invalid reduce: ${e}`);return R_(Pf(e))}function k_(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(Js(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(Js(i,0,c+t),a);for(let c=0,l=i.length-n;c<l;++c)s[i[c+n]]=e(Js(i,c,c+t),a)}}}function R_(e){return(t,n,r)=>r?{mapIndex(i,o,s){let a=0;for(let c=0;c<t-1;++c)a+=ze(o[i[c]]);for(let c=0,l=i.length-t+1;c<l;++c)a+=ze(o[i[c+t-1]]),a===t&&(s[i[c+n]]=e(Js(i,c,c+t),o)),a-=ze(o[i[c]])}}:{mapIndex(i,o,s){for(let a=-n;a<0;++a)s[i[a+n]]=e(Js(i,0,a+t),o);for(let a=0,c=i.length-n;a<c;++a)s[i[a+n]]=e(Js(i,a,a+t),o)}}}function sP(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 Aet(e,t,n){if(n){let r=sP(e,t,n);return{mapIndex(i,o,s){r.mapIndex(i,o,s);for(let a=0,c=i.length-e+1;a<c;++a)s[i[a+t]]/=e}}}else return{mapIndex(r,i,o){let s=0,a=0,c=r.length;for(let l=0,u=Math.min(c,e-t-1);l<u;++l){let f=i[r[l]];f!==null&&!isNaN(f=+f)&&(s+=f,++a)}for(let l=-t,u=c-t;l<u;++l){let f=i[r[l+e-1]],h=i[r[l]];f!==null&&!isNaN(f=+f)&&(s+=f,++a),o[r[l+t]]=s/a,h!==null&&!isNaN(h=+h)&&(s-=h,--a)}}}}function Met(e,t,n,r){for(let i=n+r;n<i;++n){let o=e[t[n]];if(ze(o))return o}}function Tet(e,t,n,r){for(let i=n+r-1;i>=n;--i){let o=e[t[i]];if(ze(o))return o}}function aP(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 cP(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 Eet(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]]=cP(i,r,s,e)-aP(i,r,s,e)}}}function Net(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]]=cP(i,r,s,e)/aP(i,r,s,e)}}}function Det(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]]=Met(i,r,s,e)}}}function Oet(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]]=Tet(i,r,s,e)}}}var la={n:20,k:2,color:"currentColor",opacity:.2,strict:!0,anchor:"end"};function lP(e,{x:t=H,y:n,k:r=la.k,color:i=la.color,opacity:o=la.opacity,fill:s=i,fillOpacity:a=o,stroke:c=i,strokeOpacity:l,strokeWidth:u,...f}={}){return nn(oe(s)?null:hc(e,Ar({x1:yc({k:-r,...f}),x2:yc({k:r,...f})},{x1:t,x2:t,y:n,fill:s,fillOpacity:a,...f})),oe(c)?null:pc(e,Ar({x:yc(f)},{x:t,y:n,stroke:c,strokeOpacity:l,strokeWidth:u,...f})))}function uP(e,{x:t,y:n=H,k:r=la.k,color:i=la.color,opacity:o=la.opacity,fill:s=i,fillOpacity:a=o,stroke:c=i,strokeOpacity:l,strokeWidth:u,...f}={}){return nn(oe(s)?null:ca(e,Ar({y1:yc({k:-r,...f}),y2:yc({k:r,...f})},{x:t,y1:n,y2:n,fill:s,fillOpacity:a,...f})),oe(c)?null:mc(e,Ar({y:yc(f)},{x:t,y:n,stroke:c,strokeOpacity:l,strokeWidth:u,...f})))}function yc({n:e=la.n,k:t=0,strict:n=la.strict,anchor:r=la.anchor}={}){return wh({k:e,reduce:i=>Ds(i)+t*(ci(i)||0),strict:n,anchor:r})}var Bet={ariaLabel:"tick",fill:null,stroke:"currentColor"},F_=class extends vt{constructor(t,n,r){super(t,n,r,Bet),Gi(this,r)}render(t,n,r,i,o){return ut("svg:g",o).call(kt,this,i,o).call(this._transform,this,n).call(s=>s.selectAll().data(t).enter().append("line").call(Ct,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(Kt,this,r).call(sa,this,r,o)).node()}},Ry=class extends F_{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=Lt(s),this.insetBottom=Lt(a)}_transform(t,n,{x:r}){t.call(Et,n,{x:r},Ce,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}},Fy=class extends F_{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=Lt(s),this.insetLeft=Lt(a)}_transform(t,n,{y:r}){t.call(Et,n,{y:r},0,Ce)}_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 $_(e,{x:t=H,...n}={}){return new Ry(e,{...n,x:t})}function P_(e,{y:t=H,...n}={}){return new Fy(e,{...n,y:t})}function fP(e,{x:t=H,y:n=null,fill:r="#ccc",fillOpacity:i,stroke:o="currentColor",strokeOpacity:s,strokeWidth:a=2,sort:c,...l}={}){let u=n!=null?nc:ly;return nn(Wr(e,u({x1:ZT,x2:JT},{x:t,y:n,stroke:o,strokeOpacity:s,...l})),Ko(e,u({x1:"p25",x2:"p75"},{x:t,y:n,fill:r,fillOpacity:i,...l})),$_(e,u({x:"p50"},{x:t,y:n,stroke:o,strokeOpacity:s,strokeWidth:a,sort:c,...l})),_i(e,Ar({x:dP},{x:t,y:n,z:n,stroke:o,strokeOpacity:s,...l})))}function hP(e,{y:t=H,x:n=null,fill:r="#ccc",fillOpacity:i,stroke:o="currentColor",strokeOpacity:s,strokeWidth:a=2,sort:c,...l}={}){let u=n!=null?ec:ly;return nn(Gr(e,u({y1:ZT,y2:JT},{x:n,y:t,stroke:o,strokeOpacity:s,...l})),ts(e,u({y1:"p25",y2:"p75"},{x:n,y:t,fill:r,fillOpacity:i,...l})),P_(e,u({y:"p50"},{x:n,y:t,stroke:o,strokeOpacity:s,strokeWidth:a,sort:c,...l})),_i(e,Ar({y:dP},{x:n,y:t,z:n,stroke:o,strokeOpacity:s,...l})))}function dP(e){let t=ZT(e),n=JT(e);return e.map(r=>r<t||r>n?r:NaN)}function ZT(e){let t=pP(e)*2.5-mP(e)*1.5;return he(e,n=>n>=t?n:NaN)}function JT(e){let t=mP(e)*2.5-pP(e)*1.5;return Jt(e,n=>n<=t?n:NaN)}function pP(e){return tr(e,.25)}function mP(e){return tr(e,.75)}var Let={ariaLabel:"raster",stroke:null,pixelSize:1};function _h(e,t){let n=+e;if(isNaN(n))throw new Error(`invalid ${t}: ${e}`);return n}function yP(e,t){let n=Math.floor(e);if(isNaN(n))throw new Error(`invalid ${t}: ${e}`);return n}var Py=class extends vt{constructor(t,n,r={},i){let{width:o,height:s,x:a,y:c,x1:l=a==null?0:void 0,y1:u=c==null?0:void 0,x2:f=a==null?o:void 0,y2:h=c==null?s:void 0,pixelSize:d=i.pixelSize,blur:p=0,interpolate:m}=r;if(o!=null&&(o=yP(o,"width")),s!=null&&(s=yP(s,"height")),l!=null&&(l=_h(l,"x1")),u!=null&&(u=_h(u,"y1")),f!=null&&(f=_h(f,"x2")),h!=null&&(h=_h(h,"y2")),a==null&&(l==null||f==null))throw new Error("missing x");if(c==null&&(u==null||h==null))throw new Error("missing y");t!=null&&o!=null&&s!=null&&(a===void 0&&l!=null&&f!=null&&(a=zet(l,f,o,s)),c===void 0&&u!=null&&h!=null&&(c=qet(u,h,o,s))),super(t,{x:{value:a,scale:"x",optional:!0},y:{value:c,scale:"y",optional:!0},x1:{value:l==null?null:[l],scale:"x",optional:!0,filter:null},y1:{value:u==null?null:[u],scale:"y",optional:!0,filter:null},x2:{value:f==null?null:[f],scale:"x",optional:!0,filter:null},y2:{value:h==null?null:[h],scale:"y",optional:!0,filter:null},...n},r,i),this.width=o,this.height=s,this.pixelSize=_h(d,"pixelSize"),this.blur=_h(p,"blur"),this.interpolate=a==null||c==null?null:Cet(m)}},Uy=class extends Py{constructor(t,n={}){let{imageRendering:r}=n;if(t==null){let{fill:i,fillOpacity:o}=n;ce(o)[0]!==void 0&&(n=U_("fillOpacity",n)),Be(i)[0]!==void 0&&(n=U_("fill",n))}super(t,void 0,n,Let),this.imageRendering=de(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]??(M=>M),{x:a,y:c}=r,{document:l}=o,[u,f,h,d]=xP(r,i,o),p=h-u,m=d-f,{pixelSize:y,width:g=Math.round(Math.abs(p)/y),height:x=Math.round(Math.abs(m)/y)}=this,b=g*x,{fill:w,fillOpacity:v}=r,_=0;if(this.interpolate){let M=g/p,N=x/m,R=Wt(a,k=>(k-u)*M,Float64Array),F=Wt(c,k=>(k-f)*N,Float64Array);w&&(w=this.interpolate(t,g,x,R,F,w)),v&&(v=this.interpolate(t,g,x,R,F,v))}else this.data==null&&t&&(_=t.fi*b);let A=l.createElement("canvas");A.width=g,A.height=x;let E=A.getContext("2d"),T=E.createImageData(g,x),D=T.data,{r:I,g:O,b:L}=sn(this.fill)??{r:0,g:0,b:0},S=(this.fillOpacity??1)*255;for(let M=0;M<b;++M){let N=M<<2;if(w){let R=s(w[M+_]);if(R==null){D[N+3]=0;continue}({r:I,g:O,b:L}=sn(R))}v&&(S=v[M+_]*255),D[N+0]=I,D[N+1]=O,D[N+2]=L,D[N+3]=S}return this.blur>0&&MI(T,this.blur),E.putImageData(T,0,0),ut("svg:g",o).call(kt,this,i,o).call(Et,this,n).call(M=>M.append("image").attr("transform",`translate(${u},${f}) scale(${Math.sign(h-u)},${Math.sign(d-f)})`).attr("width",Math.abs(p)).attr("height",Math.abs(m)).attr("preserveAspectRatio","none").call(ft,"image-rendering",this.imageRendering).call(Ct,this).attr("xlink:href",A.toDataURL())).node()}};function QT(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&&GF(t)&&(r=Ll,i=Za,o===void 0&&(o=qF)),[t,{...s,x:r,y:i,[e]:o}]}function gP(){let[e,t]=QT("fill",...arguments);return new Uy(e,e==null||t.fill!==void 0||t.fillOpacity!==void 0?t:{...t,fill:H})}function xP({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 KT({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),xP(Xf(a,i),o,s)}function U_(e,t={}){let{[e]:n}=t;if(typeof n!="function")throw new Error(`invalid ${e}: not a function`);return Me({...t,[e]:void 0},function(r,i,o,s,a,c){let{x:l,y:u}=s;if(!l)throw new Error("missing scale: x");if(!u)throw new Error("missing scale: y");let[f,h,d,p]=KT(o,s,a,c),m=d-f,y=p-h,{pixelSize:g}=this,{width:x=Math.round(Math.abs(m)/g),height:b=Math.round(Math.abs(y)/g)}=t,w=new Array(x*b*(i?i.length:1)),v=m/x,_=y/b,A=0;for(let E of i??[void 0])for(let T=.5;T<b;++T)for(let D=.5;D<x;++D,++A)w[A]=n(l.invert(f+D*v),u.invert(h+T*_),E);return{data:w,facets:i,channels:{[e]:{value:w,scale:"auto"}}}})}function Cet(e){if(typeof e=="function")return e;if(e==null)return z_;switch(`${e}`.toLowerCase()){case"none":return z_;case"nearest":return qy;case"barycentric":return zy();case"random-walk":return jy()}throw new Error(`invalid interpolate: ${e}`)}function z_(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 zy({random:e=bl(42)}={}){return(t,n,r,i,o,s)=>{let{points:a,triangles:c,hull:l}=hi.from(t,d=>i[d],d=>o[d]),u=new s.constructor(n*r).fill(NaN),f=new Uint8Array(n*r),h=Uet(s,e);for(let d=0;d<c.length;d+=3){let p=c[d],m=c[d+1],y=c[d+2],g=a[2*p],x=a[2*m],b=a[2*y],w=a[2*p+1],v=a[2*m+1],_=a[2*y+1],A=Math.min(g,x,b),E=Math.max(g,x,b),T=Math.min(w,v,_),D=Math.max(w,v,_),I=(v-_)*(g-b)+(w-_)*(b-x);if(!I)continue;let O=s[t[p]],L=s[t[m]],S=s[t[y]];for(let M=Math.floor(A);M<E;++M)for(let N=Math.floor(T);N<D;++N){if(M<0||M>=n||N<0||N>=r)continue;let R=M+.5,F=N+.5,k=Math.sign(I),$=(v-_)*(R-b)+(F-_)*(b-x);if($*k<0)continue;let P=(_-w)*(R-b)+(F-_)*(g-b);if(P*k<0)continue;let U=I-($+P);if(U*k<0)continue;let G=M+n*N;u[G]=h(O,$/I,L,P/I,S,U/I,M,N),f[G]=1}}return ket(u,f,i,o,s,n,r,l,t,h),u}}function ket(e,t,n,r,i,o,s,a,c,l){n=Float64Array.from(a,d=>n[c[d]]),r=Float64Array.from(a,d=>r[c[d]]),i=Array.from(a,d=>i[c[d]]);let u=n.length,f=Array.from({length:u},(d,p)=>Fet(p,n,r)),h=0;for(let d=0;d<s;++d){let p=d+.5;for(let m=0;m<o;++m){let y=m+o*d;if(!t[y]){let g=m+.5;for(let x=0;x<u;++x){let b=(u+h+(x%2?(x+1)/2:-x/2))%u;if(f[b](g,p)){let w=Ret(n.at(b-1),r.at(b-1),n[b],r[b],g,p);e[y]=l(i.at(b-1),w,i[b],1-w,i[b],0,m,d),h=b;break}}}}}}function Ret(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 $y(e,t,n,r){return e*r-n*t}function Fet(e,t,n){let r=t.length,i=t.at(e-2),o=n.at(e-2),s=t.at(e-1),a=n.at(e-1),c=t[e],l=n[e],u=t.at(e+1-r),f=n.at(e+1-r),h=s-c,d=a-l,p=i-s,m=o-a,y=c-u,g=l-f,x=Math.hypot(h,d),b=Math.hypot(p,m),w=Math.hypot(y,g);return(v,_)=>{let A=v-s,E=_-a,T=v-c,D=_-l;return $y(A,E,T,D)>-1e-6&&$y(A,E,h,d)*b-$y(A,E,p,m)*x>-1e-6&&$y(T,D,y,g)*x-$y(T,D,h,d)*w<=0}}function qy(e,t,n,r,i,o){let s=new o.constructor(t*n),a=hi.from(e,u=>r[u],u=>i[u]),c,l;for(let u=.5,f=0;u<n;++u){l=c;for(let h=.5;h<t;++h,++f)l=a.find(h,u,l),h===.5&&(c=l),s[f]=o[e[l]]}return s}function jy({random:e=bl(42),minDistance:t=.5,maxSteps:n=2}={}){return(r,i,o,s,a,c)=>{let l=new c.constructor(i*o),u=hi.from(r,p=>s[p],p=>a[p]),f,h,d;for(let p=.5,m=0;p<o;++p){h=f;for(let y=.5;y<i;++y,++m){let g=y,x=p;d=h=u.find(g,x,h),y===.5&&(f=h);let b,w=0;for(;(b=Math.hypot(s[r[d]]-g,a[r[d]]-x))>t&&w<n;){let v=e(y,p,w)*2*Math.PI;g+=Math.cos(v)*b,x+=Math.sin(v)*b,d=u.find(g,x,d),++w}l[m]=c[r[d]]}}return l}}function $et(e,t,n,r,i,o){return t*e+r*n+o*i}function Pet(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 Uet(e,t){return Ks(e)||Le(e)?$et:Pet(t)}function zet(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 qet(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 bP={ariaLabel:"contour",fill:"none",stroke:"currentColor",strokeMiterlimit:1,pixelSize:2},Vy=class extends Py{constructor(t,{smooth:n=!0,value:r,...i}={}){let o=n_({},i,bP);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:Cn(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=U_("value",{value:r,...i}),r=null}else{let{interpolate:a}=i;r===void 0&&(r=H),a===void 0&&(i.interpolate="nearest")}super(t,{value:{value:r,optional:!0}},jet(i),bP);let s={geometry:{value:H}};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=On();return ut("svg:g",o).call(kt,this,i,o).call(Et,this,n).call(c=>{c.selectAll().data(t).enter().append("path").call(Ct,this).attr("d",l=>a(s[l])).call(Kt,this,r)}).node()}};function jet({thresholds:e,interval:t,...n}){return e=jT(e,t,Da),Me(n,function(r,i,o,s,a,c){let[l,u,f,h]=KT(o,s,a,c),d=f-l,p=h-u,{pixelSize:m,width:y=Math.round(Math.abs(d)/m),height:g=Math.round(Math.abs(p)/m)}=this,x=y/d,b=g/p,w=o.value.value,v=[];if(this.interpolate){let{x:D,y:I}=oc(o,s,c),O=Wt(D,N=>(N-l)*x,Float64Array),L=Wt(I,N=>(N-u)*b,Float64Array),S=[o.x,o.y,o.value],M=[O,L,w];for(let N of i){let R=this.filter(N,S,M);v.push(this.interpolate(R,y,g,O,L,w))}}else if(i){let D=y*g,I=i.length;for(let O=0;O<I;++O)v.push(w.slice(O*D,O*D+D))}else v.push(w);if(this.blur>0)for(let D of v)_p({data:D,width:y,height:g},this.blur);let _=Vet(e,w,...Yet(v));if(_===null)throw new Error(`unsupported thresholds: ${e}`);let{contour:A}=Fa().size([y,g]).smooth(this.smooth),E=[],T=[];for(let D of v)T.push(Ue(E.length,E.push(...Wt(_,I=>A(D,I)))));for(let{coordinates:D}of E)for(let I of D)for(let O of I)for(let L of O)L[0]=L[0]/x+l,L[1]=L[1]/b+u;return{data:E,facets:T,channels:qw(this.contourChannels,E)}})}function Vet(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 je(e);let i=En(...ju(n,r,e),e);for(;i[i.length-1]>=r;)i.pop();for(;i[1]<n;)i.shift();return i}function _P(){return new Vy(...QT("value",...arguments))}function Yet(e){return[he(e,t=>he(t,wP)),Jt(e,t=>Jt(t,wP))]}function wP(e){return isFinite(e)?e:NaN}function IP(e,t){return t6(ac,e,t)}function AP(e,t={}){return t6(cc,e,t)}function MP(e,t={}){return t6(oa,e,t)}function t6(e,t,n={}){let{x:r,y:i,maxRadius:o}=n,s=e({px:r,py:i,maxRadius:o}),a=[];r!=null&&a.push(Gr(t,vP("x",{...s,inset:-6},n))),i!=null&&a.push(Wr(t,vP("y",{...s,inset:-6},n))),r!=null&&a.push(Zo(t,SP("x",{...s,dy:9,frameAnchor:"bottom",lineAnchor:"top"},n))),i!=null&&a.push(Zo(t,SP("y",{...s,dx:-9,frameAnchor:"left",textAnchor:"end"},n)));for(let c of a)c.ariaLabel=`crosshair ${c.ariaLabel}`;return nn(...a)}function TP(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:Xet(e,u)}}function Xet(e,t){return t==null?t:function(n,r,{x:i,y:o,px:s,py:a,...c},...l){let{channels:{x:u,y:f,...h}={},...d}=t.call(this,n,r,{...c,x:s,y:a},...l);return{channels:{...h,...u&&{px:u,...e==="x"&&{x:u}},...f&&{py:f,...e==="y"&&{y:f}}},...d}}}function vP(e,t,n){let{color:r="currentColor",opacity:i=.2,ruleStroke:o=r,ruleStrokeOpacity:s=i,ruleStrokeWidth:a}=n;return{...TP(e,t,n),stroke:o,strokeOpacity:s,strokeWidth:a}}function SP(e,t,n){let{color:r="currentColor",textFill:i=r,textFillOpacity:o,textStroke:s="var(--plot-background)",textStrokeOpacity:a,textStrokeWidth:c=5}=n;return{...TP(e,t,Get(e,n)),fill:i,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:c}}function Get(e,t){return Me(t,(n,r,i)=>({channels:{text:{value:hy(i,e)?.value}}}))}var Wet={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Het={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},Zet={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},Jet={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Qet={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},e6=class extends vt{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,Wet),this.curve=My(s,a),Gi(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,{curve:f}=this,[h,d]=_n(this,i),p=c?x=>c[x]:yn(h),m=l?x=>l[x]:yn(d),y=this;function g(x){let b=-1,w=[],v={};for(let S in r)v[S]=[];let _=[],A=[],E=[],T=[];function D(S,M){S=x[S],M=x[M],w.push(++b),_[b]=p(S),E[b]=m(S),A[b]=p(M),T[b]=m(M);for(let N in r)v[N].push(r[N][M])}let{halfedges:I,hull:O,triangles:L}=hi.from(x,p,m);for(let S=0;S<I.length;++S){let M=I[S];M>S&&D(L[S],L[M])}for(let S=0;S<O.length;++S)D(O[S],O[(S+1)%O.length]);Yt(this).selectAll().data(w).enter().append("path").call(Ct,y).attr("d",S=>{let M=rr(),N=f(M);return N.lineStart(),N.point(_[S],E[S]),N.point(A[S],T[S]),N.lineEnd(),M}).call(Kt,y,v).call(sa,y,v,o)}return ut("svg:g",o).call(kt,this,i,o).call(Et,this,{x:c&&s,y:l&&a}).call(u?x=>x.selectAll().data(fn(t,b=>u[b]).values()).enter().append("g").each(g):x=>x.datum(t).each(g)).node()}},Yy=class extends vt{constructor(t,n={},r,i=({z:o})=>o){let{x:o,y:s}=n;super(t,{x:{value:o,scale:"x",optional:!0},y:{value:s,scale:"y",optional:!0},z:{value:i(n),optional:!0}},n,r)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,[f,h]=_n(this,i),d=c?g=>c[g]:yn(f),p=l?g=>l[g]:yn(h),m=this;function y(g){let x=hi.from(g,d,p);Yt(this).append("path").datum(g[0]).call(Ct,m).attr("d",m._render(x,i)).call(Kt,m,r)}return ut("svg:g",o).call(kt,this,i,o).call(Et,this,{x:c&&s,y:l&&a}).call(u?g=>g.selectAll().data(fn(t,x=>u[x]).values()).enter().append("g").each(y):g=>g.datum(t).each(y)).node()}},n6=class extends Yy{constructor(t,n={}){super(t,n,Het),this.fill="none"}_render(t){return t.render()}},r6=class extends Yy{constructor(t,n={}){super(t,n,Zet,Vn)}_render(t){return t.renderHull()}},i6=class extends vt{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,Jet)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,[f,h]=_n(this,i),d=c?g=>c[g]:yn(f),p=l?g=>l[g]:yn(h),m=this;function y(g){let x=hi.from(g,d,p),b=EP(x,i);Yt(this).selectAll().data(g).enter().append("path").call(Ct,m).attr("d",(w,v)=>b.renderCell(v)).call(Kt,m,r)}return ut("svg:g",o).call(kt,this,i,o).call(Et,this,{x:c&&s,y:l&&a}).call(u?g=>g.selectAll().data(fn(t,x=>u[x]).values()).enter().append("g").each(y):g=>g.datum(t).each(y)).node()}},o6=class extends Yy{constructor(t,n){super(t,n,Qet),this.fill="none"}_render(t,n){return EP(t,n).render()}};function EP(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 Xy(e,t,{x:n,y:r,...i}={}){return[n,r]=$e(n,r),new e(t,{...i,x:n,y:r})}function NP(e,t){return Xy(e6,e,t)}function DP(e,t){return Xy(n6,e,t)}function OP(e,t){return Xy(r6,e,t)}function BP(e,t){return Xy(i6,e,t)}function LP(e,t){return Xy(o6,e,t)}var Ket={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Gy=class extends vt{constructor(t,{x:n,y:r,z:i,weight:o,fill:s,stroke:a,...c}={}){let l=CP(s)&&(s="currentColor",!0),u=CP(a)&&(a="currentColor",!0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:Vn({z:i,fill:s,stroke:a}),optional:!0},weight:{value:o,optional:!0}},ent({...c,fill:s,stroke:a},l,u),Ket),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=On();return ut("svg:g",o).call(kt,this,i,o).call(Et,this,{}).call(c=>c.selectAll().data(t).enter().append("path").call(Ct,this).call(Kt,this,r).attr("d",l=>a(s[l]))).node()}};function kP(e,{x:t,y:n,...r}={}){return[t,n]=$e(t,n),new Gy(e,{...r,x:t,y:n})}var tnt=new Set(["x","y","z","weight"]);function ent(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"?en(o):+o,Me(e,function(s,a,c,l,u,f){let h=c.weight?en(c.weight.value):null,d=c.z?.value,{z:p}=this,[m,y]=_n(this,u),{width:g,height:x}=u,{x:b,y:w}=oc(c,l,f),v=Object.fromEntries(Object.entries(c).filter(([L])=>!tnt.has(L)).map(([L,S])=>[L,{...S,value:[]}])),_=t&&[],A=n&&[],E=pA().x(b?L=>b[L]:m).y(w?L=>w[L]:y).weight(h?L=>h[L]:1).size([g,x]).bandwidth(i),T=[];for(let L of a){let S=[];T.push(S);for(let M of d?gy(L,d,p):[L]){let N=E.contours(M);S.push([M,N])}}let D=o;if(!(D instanceof Bl)){let L=0;for(let S of T)for(let[,M]of S){let N=M.max;N>L&&(L=N)}D=Float64Array.from({length:o-1},(S,M)=>L*100*(M+1)/o)}let I=[],O=[];for(let L of T){let S=[];I.push(S);for(let[M,N]of L)for(let R of D){S.push(O.length),O.push(N(R/100)),_&&_.push(R),A&&A.push(R);for(let F in v)v[F].value.push(c[F].value[M[0]])}}return _&&_.push(0),A&&A.push(0),{data:s,facets:I,channels:{...v,..._&&{fill:{value:_,scale:"color"}},...A&&{stroke:{value:A,scale:"color"}},contours:{value:O}}}})}function CP(e){return/^density$/i.test(e)}function $P(e,{x1:t,x2:n,y1:r,y2:i,x:o=t===void 0&&n===void 0?Ne:void 0,y:s=r===void 0&&i===void 0?H:void 0,fill:a,positiveFill:c="#3ca951",negativeFill:l="#4269d0",fillOpacity:u=1,positiveFillOpacity:f=u,negativeFillOpacity:h=u,stroke:d,strokeOpacity:p,z:m=Be(d)[0],clip:y,tip:g,render:x,...b}={}){return[t,n]=RP(o,t,n),[r,i]=RP(s,r,i),t===n&&r===i&&(r=gc(0)),{tip:g}=Xi({tip:g},"x"),nn(oe(c)?null:Object.assign(Ty(e,{x1:t,x2:n,y1:r,y2:i,z:m,fill:c,fillOpacity:f,render:th(x,FP(!0)),clip:y,...b}),{ariaLabel:"positive difference"}),oe(l)?null:Object.assign(Ty(e,{x1:t,x2:n,y1:r,y2:i,z:m,fill:l,fillOpacity:h,render:th(x,FP(!1)),clip:y,...b}),{ariaLabel:"negative difference"}),Hl(e,{x:n,y:i,z:m,stroke:d,strokeOpacity:p,tip:g,clip:!0,...b}))}function RP(e,t,n){return t===void 0&&n===void 0?t=n=gc(e):t===void 0?(n=gc(n),t=e===void 0?n:gc(e)):n===void 0?(t=gc(t),n=e===void 0?t:gc(e)):(t=gc(t),n=gc(n)),[t,n]}function gc(e){let t,{value:n,label:r=Cn(n)}=bi(e);return{transform:i=>t||(t=wt(i,n)),label:r}}function FP(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===Xw(n.y)<0?u:f).fill(l);let h=s(t,n,{...r,x2:a,y2:f},i,o),d=s(t,n,{...r,x1:c,y1:u},i,o),p=h.querySelector("g")??h,m=d.querySelector("g")??d;for(let y=0;p.firstChild;y+=2){let g=e_(),x=ut("svg:clipPath",o).attr("id",g).node();x.appendChild(p.firstChild),m.childNodes[y].setAttribute("clip-path",`url(#${g})`),m.insertBefore(x,m.childNodes[y])}return d}}var nnt={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Wy=class extends vt{constructor(t,n={}){let[r,i]=ce(n.r,3);super(t,{geometry:{value:n.geometry,scale:"projection"},r:{value:r,scale:"r",filter:cr,optional:!0}},Ly(n),nnt),this.r=i}render(t,n,r,i,o){let{geometry:s,r:a}=r,c=On(o.projection??rnt(n)),{r:l}=this;return Ya(l)?t=[]:l!==void 0&&c.pointRadius(l),ut("svg:g",o).call(kt,this,i,o).call(Et,this,n).call(u=>{u.selectAll().data(t).enter().append("path").call(Ct,this).attr("d",a?f=>c.pointRadius(a[f])(s[f]):f=>c(s[f])).call(Kt,this,r)}).node()}};function rnt({x:e,y:t}){if(e||t)return e??=n=>n,t??=n=>n,gl({point(n,r){this.stream.point(e(n),t(r))}})}function q_(e,{geometry:t=H,...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 Wy(e,{geometry:t,...n})}function PP({strokeWidth:e=1.5,...t}={}){return q_({type:"Sphere"},{strokeWidth:e,...t})}function UP({strokeOpacity:e=.1,...t}={}){return q_(RA(),{strokeOpacity:e,...t})}var vh=.5,Sh=0;function zP(e={fill:"count"},{binWidth:t,...n}={}){let{z:r}=n;return t=t===void 0?20:Lt(t),e=J3(e,n),Go(e,"fill")&&(n.channels={...n.channels,fill:{value:[]}}),n.symbol===void 0&&(n.symbol="hexagon"),n.r===void 0&&!Go(e,"r")&&(n.r=t/2),Me(n,(i,o,s,a,c,l)=>{let{x:u,y:f,z:h,fill:d,stroke:p,symbol:m}=s;if(u===void 0)throw new Error("missing channel: x");if(f===void 0)throw new Error("missing channel: y");({x:u,y:f}=oc(s,a,l)),h=h?h.value:wt(i,r),d=d?.value,p=p?.value,m=m?.value;let y=fy(e,{z:h,fill:d,stroke:p,symbol:m}),g=h&&[],x=d&&[],b=p&&[],w=m&&[],v=[],_=[],A=[],E=-1;for(let O of e)O.initialize(i);for(let O of o){let L=[];for(let S of e)S.scope("facet",O);for(let[S,M]of tc(O,y))for(let{index:N,extent:R}of int(i,M,u,f,t)){L.push(++E),_.push(R.x),A.push(R.y),h&&g.push(y===h?S:h[N[0]]),d&&x.push(y===d?S:d[N[0]]),p&&b.push(y===p?S:p[N[0]]),m&&w.push(y===m?S:m[N[0]]);for(let F of e)F.reduce(N,R)}v.push(L)}let T=s.x.scale,D=s.y.scale,I={x:{value:_,source:a[T]?{value:Wt(_,a[T].invert),scale:T}:null},y:{value:A,source:a[D]?{value:Wt(A,a[D].invert),scale:D}:null},...h&&{z:{value:g}},...d&&{fill:{value:x,scale:"auto"}},...p&&{stroke:{value:b,scale:"auto"}},...m&&{symbol:{value:w,scale:"auto"}},...Object.fromEntries(e.map(({name:O,output:L})=>[O,{scale:"auto",label:L.label,radius:O==="r"?t/2:void 0,value:L.transform()}]))};return{data:i,facets:v,channels:I}})}function int(e,t,n,r,i){let o=i*(1.5/z3),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-Sh)/o),f=Math.round(c=(c-vh)/i-(u&1)/2),h=l-u;if(Math.abs(h)*3>1){let m=c-f,y=f+(c<f?-1:1)/2,g=u+(l<u?-1:1),x=c-y,b=l-g;m*m+h*h>x*x+b*b&&(f=y+(u&1?1:-1)/2,u=g)}let d=`${f},${u}`,p=s.get(d);p===void 0&&(p={index:[],extent:{data:e,x:(f+(u&1)/2)*i+vh,y:u*o+Sh}},s.set(d,p)),p.index.push(a)}return s.values()}var ont={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};function qP(e){return new Hy(e)}var Hy=class extends vt{constructor({binWidth:t=20,clip:n=!0,...r}={}){super(Ha,void 0,{clip:n,...r},ont),this.binWidth=Lt(t)}render(t,n,r,i,o){let{binWidth:s}=this,{marginTop:a,marginRight:c,marginBottom:l,marginLeft:u,width:f,height:h}=i,d=u-vh,p=f-c-vh,m=a-Sh,y=h-l-Sh,g=s/2,x=g*q3,b=x/2,w=g*2,v=x*1.5,_=Math.floor(d/w),A=Math.ceil(p/w),E=Math.floor((m+b)/v),T=Math.ceil((y-b)/v)+1,D=`m0,${xc(-x)}l${xc(g)},${xc(b)}v${xc(x)}l${xc(-g)},${xc(b)}`,I=D;for(let O=E;O<T;++O)for(let L=_;L<A;++L)I+=`M${xc(L*w+(O&1)*g)},${xc(O*v)}${D}`;return ut("svg:g",o).datum(0).call(kt,this,i,o).call(Et,this,{},Ce+vh,Ce+Sh).call(O=>O.append("path").call(Ct,this).call(Kt,this,r).attr("d",I)).node()}};function xc(e){return Math.round(e*1e3)/1e3}var snt={ariaLabel:"image",fill:null,stroke:null};function ant(e){return/^\.*\//.test(e)}function cnt(e){return/^(blob|data|file|http|https):/i.test(e)}function lnt(e){return typeof e=="string"&&(ant(e)||cnt(e))?[void 0,e]:[e,void 0]}var Zy=class extends vt{constructor(t,n={}){let{x:r,y:i,r:o,width:s,height:a,rotate:c,src:l,preserveAspectRatio:u,crossOrigin:f,frameAnchor:h,imageRendering:d}=n;o==null&&(o=void 0),o===void 0&&s===void 0&&a===void 0?s=a=16:s===void 0&&a!==void 0?s=a:a===void 0&&s!==void 0&&(a=s);let[p,m]=lnt(l),[y,g]=ce(o),[x,b]=ce(s,g!==void 0?g*2:void 0),[w,v]=ce(a,g!==void 0?g*2:void 0),[_,A]=ce(c,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:y,scale:"r",filter:cr,optional:!0},width:{value:x,filter:cr,optional:!0},height:{value:w,filter:cr,optional:!0},rotate:{value:_,optional:!0},src:{value:p,optional:!0}},Ly(n),snt),this.src=m,this.width=b,this.rotate=A,this.height=v,this.r=g,this.preserveAspectRatio=de(u,"xMidYMid"),this.crossOrigin=qe(f),this.frameAnchor=Xo(h),this.imageRendering=de(d,"auto")}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,width:u,height:f,r:h,rotate:d,src:p}=r,{r:m,width:y,height:g,rotate:x}=this,[b,w]=_n(this,i);return ut("svg:g",o).call(kt,this,i,o).call(Et,this,{x:c&&s,y:l&&a}).call(v=>v.selectAll().data(t).enter().append("image").call(Ct,this).attr("x",jP(c,u,h,b,y,m)).attr("y",jP(l,f,h,w,g,m)).attr("width",u?_=>u[_]:y!==void 0?y:h?_=>h[_]*2:m*2).attr("height",f?_=>f[_]:g!==void 0?g:h?_=>h[_]*2:m*2).attr("transform",d?_=>`rotate(${d[_]})`:x?`rotate(${x})`:null).attr("transform-origin",d||x?lc`${c?_=>c[_]:b}px ${l?_=>l[_]:w}px`:null).call(ft,"href",p?_=>p[_]:this.src).call(ft,"preserveAspectRatio",this.preserveAspectRatio).call(ft,"crossorigin",this.crossOrigin).call(ft,"image-rendering",this.imageRendering).call(ft,"clip-path",h?_=>`circle(${h[_]}px)`:m!==void 0?`circle(${m}px)`:null).call(Kt,this,r)).node()}};function jP(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 VP(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=$e(t,n)),new Zy(e,{...r,x:t,y:n})}function unt(e,t,n){var r=1e-8,i=t-1,o=n-1,s=0,a,c,l,u,f,h,d,p,m,y,g;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&n>=1?(l=e<.5?e:1-e,u=Math.sqrt(-2*Math.log(l)),d=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(d=-d),p=(d*d-3)/6,m=2/(1/(2*t-1)+1/(2*n-1)),y=d*Math.sqrt(p+m)/m-(1/(2*n-1)-1/(2*t-1))*(p+5/6-2/(3*m)),d=t/(t+n*Math.exp(2*y))):(a=Math.log(t/(t+n)),c=Math.log(n/(t+n)),u=Math.exp(t*a)/t,f=Math.exp(n*c)/n,y=u+f,e<u/y?d=Math.pow(t*y*e,1/t):d=1-Math.pow(n*y*(1-e),1/n)),g=-Ih(t)-Ih(n)+Ih(t+n);s<10;s++){if(d===0||d===1)return d;if(h=fnt(d,t,n)-e,u=Math.exp(i*Math.log(d)+o*Math.log(1-d)+g),f=h/u,d-=u=f/(1-.5*Math.min(1,f*(i/d-o/(1-d)))),d<=0&&(d=.5*(d+u)),d>=1&&(d=.5*(d+u+1)),Math.abs(u)<r*d&&s>0)break}return d}function fnt(e,t,n){var r=e===0||e===1?0:Math.exp(Ih(t+n)-Ih(t)-Ih(n)+t*Math.log(e)+n*Math.log(1-e));return e<0||e>1?!1:e<(t+1)/(t+n+2)?r*YP(e,t,n)/t:1-r*YP(1-e,n,t)/n}function YP(e,t,n){var r=1e-30,i=1,o=t+n,s=t+1,a=t-1,c=1,l=1-o*e/s,u,f,h,d;for(Math.abs(l)<r&&(l=r),l=1/l,d=l;i<=100&&(u=2*i,f=i*(n-i)*e/((a+u)*(t+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,d*=l*c,f=-(t+i)*(o+i)*e/((t+u)*(s+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,h=l*c,d*=h,!(Math.abs(h-1)<3e-7));i++);return d}function Ih(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 XP(e,t){var n=unt(2*Math.min(e,1-e),.5*t,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}var hnt={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},j_=class extends vt{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:Vn(n),optional:!0}},n,hnt),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 ut("svg:g",o).call(kt,this,i,o).call(Et,this,n).call(u=>u.selectAll().data(c?gy(t,c,this.z):[t]).enter().call(f=>f.append("path").attr("fill","none").call(Ct,this).call($l,this,{...r,fill:null,fillOpacity:null}).attr("d",h=>this._renderLine(h,s,a)).call(l&&!ta(this.fill)?h=>h.select(dnt).attr("stroke","none").call(Ct,this).call($l,this,{...r,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",d=>this._renderBand(d,s,a)):()=>{}))).node()}};function dnt(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(li.svg,"path"),this)}var s6=class extends j_{constructor(t,n){super(t,n)}_renderBand(t,n,r){let{ci:i,precision:o}=this,[s,a]=fe(t,u=>r[u]),c=V_(t,r,n),l=HP(t,r,n,(1-i)/2,c);return Tf().y(u=>u).x0(u=>l(u,-1)).x1(u=>l(u,1))(Ue(s,a-o/2,o).concat(a))}_renderLine(t,n,r){let[i,o]=fe(t,a=>r[a]),s=V_(t,r,n);return`M${s(i)},${i}L${s(o)},${o}`}},a6=class extends j_{constructor(t,n){super(t,n)}_renderBand(t,n,r){let{ci:i,precision:o}=this,[s,a]=fe(t,u=>n[u]),c=V_(t,n,r),l=HP(t,n,r,(1-i)/2,c);return Tf().x(u=>u).y0(u=>l(u,-1)).y1(u=>l(u,1))(Ue(s,a-o/2,o).concat(a))}_renderLine(t,n,r){let[i,o]=fe(t,a=>n[a]),s=V_(t,n,r);return`M${i},${s(i)}L${o},${s(o)}`}};function GP(e,{y:t=Ne,x:n=H,stroke:r,fill:i=oe(r)?"currentColor":r,...o}={}){return new s6(e,ah({...o,x:n,y:t,fill:i,stroke:r}))}function WP(e,{x:t=Ne,y:n=H,stroke:r,fill:i=oe(r)?"currentColor":r,...o}={}){return new a6(e,sh({...o,x:t,y:n,fill:i,stroke:r}))}function V_(e,t,n){let r=0,i=0,o=0,s=0;for(let u of e){let f=t[u],h=n[u];r+=f,i+=h,o+=f*h,s+=f*f}let a=e.length,c=(a*o-r*i)/(a*s-r*r),l=(i-c*r)/a;return u=>c*u+l}function HP(e,t,n,r,i){let o=Nn(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=XP(r,e.length-2);return(u,f)=>{let h=i(u),d=c*Math.sqrt(1/e.length+(u-o)**2/s);return h+f*l*d}}function Jy({path:e=H,delimiter:t,frameAnchor:n,treeLayout:r=xl,treeSort:i,treeSeparation:o,treeAnchor:s,treeFilter:a,...c}={}){s=W_(s),i=QP(i),a!=null&&(a=l6(a)),n===void 0&&(n=s.frameAnchor);let l=KP(t),u=sU(c,l6),[f,h]=xn(),[d,p]=xn();return{x:f,y:d,frameAnchor:n,...bn(c,(m,y)=>{let g=l(wt(m,e)),x=h([]),b=p([]),w=-1,v=[],_=[],A=qb().path(T=>g[T]),E=r();E.nodeSize&&E.nodeSize([1,1]),E.separation&&o!==void 0&&E.separation(o??oy);for(let T of u)T[X_]=T[iU]([]);for(let T of y){let D=[],I=A(T.filter(O=>g[O]!=null)).each(O=>O.data=m[O.data]);i!=null&&I.sort(i),E(I);for(let O of I.descendants())if(!(a!=null&&!a(O))){D.push(++w),v[w]=O.data,s.position(O,w,x,b);for(let L of u)L[X_][w]=L[oU](O)}_.push(D)}return{data:v,facets:_}}),...Object.fromEntries(u)}}function G_({path:e=H,delimiter:t,curve:n="bump-x",stroke:r="#555",strokeWidth:i=1.5,strokeOpacity:o=.5,treeLayout:s=xl,treeSort:a,treeSeparation:c,treeAnchor:l,treeFilter:u,...f}={}){l=W_(l),a=QP(a),u!=null&&(u=JP(u)),f={curve:n,stroke:r,strokeWidth:i,strokeOpacity:o,...f};let h=KP(t),d=sU(f,JP),[p,m]=xn(),[y,g]=xn(),[x,b]=xn(),[w,v]=xn();return{x1:p,x2:y,y1:x,y2:w,...bn(f,(_,A)=>{let E=h(wt(_,e)),T=m([]),D=g([]),I=b([]),O=v([]),L=-1,S=[],M=[],N=qb().path(F=>E[F]),R=s();R.nodeSize&&R.nodeSize([1,1]),R.separation&&c!==void 0&&R.separation(c??oy);for(let F of d)F[X_]=F[iU]([]);for(let F of A){let k=[],$=N(F.filter(P=>E[P]!=null)).each(P=>P.data=_[P.data]);a!=null&&$.sort(a),R($);for(let{source:P,target:U}of $.links())if(!(u!=null&&!u(U,P))){k.push(++L),S[L]=U.data,l.position(P,L,T,I),l.position(U,L,D,O);for(let G of d)G[X_][L]=G[oU](U,P)}M.push(k)}return{data:S,facets:M}}),...Object.fromEntries(d)}}function W_(e="left"){switch(`${e}`.trim().toLowerCase()){case"left":return pnt;case"right":return mnt}throw new Error(`invalid tree anchor: ${e}`)}var pnt={frameAnchor:"left",dx:6,position({x:e,y:t},n,r,i){r[n]=t,i[n]=-e}},mnt={frameAnchor:"right",dx:-6,position({x:e,y:t},n,r,i){r[n]=-t,i[n]=-e}};function QP(e){return e==null||typeof e=="function"?e:`${e}`.trim().toLowerCase().startsWith("node:")?ZP(l6(e)):ZP(ynt(e))}function ZP(e){return(t,n)=>mn(e(t),e(n))}function ynt(e){return t=>t.data?.[e]}function KP(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=>gnt(r,t))}var c6=92,tU=47;function gnt(e,t){if(t===c6)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 c6: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 tU: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 xnt(e){let t=!1;for(let n=0,r=e.length;n<r;++n){switch(e.charCodeAt(n)){case c6:if(!t){t=!0;continue}case tU:t&&(e=e.slice(0,n-1)+e.slice(n),--n,--r);break}t=!1}return e}function eU(e){return gn(e)&&typeof e.node=="function"}function bnt(e){return gn(e)&&typeof e.link=="function"}function l6(e){if(eU(e))return e.node;if(e=`${e}`.trim().toLowerCase(),!!e.startsWith("node:")){switch(e){case"node:name":return f6;case"node:path":return u6;case"node:internal":return nU;case"node:external":return rU;case"node:depth":return h6;case"node:height":return d6}throw new Error(`invalid node value: ${e}`)}}function JP(e){if(eU(e))return e.node;if(bnt(e))return e.link;if(e=`${e}`.trim().toLowerCase(),!(!e.startsWith("node:")&&!e.startsWith("parent:"))){switch(e){case"parent:name":return Y_(f6);case"parent:path":return Y_(u6);case"parent:depth":return Y_(h6);case"parent:height":return Y_(d6);case"node:name":return f6;case"node:path":return u6;case"node:internal":return nU;case"node:external":return rU;case"node:depth":return h6;case"node:height":return d6}throw new Error(`invalid link value: ${e}`)}}function u6(e){return e.id}function f6(e){return wnt(e.id)}function h6(e){return e.depth}function d6(e){return e.height}function nU(e){return!!e.children}function rU(e){return!e.children}function Y_(e){return(t,n)=>n==null?void 0:e(n)}function wnt(e){let t=e.length;for(;--t>0&&!_nt(e,t););return xnt(e.slice(t+1))}function _nt(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}var iU=2,oU=3,X_=4;function sU(e,t){let n=[];for(let r in e){let i=e[r],o=t(i);o!==void 0&&n.push([r,...xn(i),o])}return n}function p6(e,{fill:t,stroke:n,strokeWidth:r,strokeOpacity:i,strokeLinejoin:o,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:l,marker:u,markerStart:f=u,markerEnd:h=u,dot:d=oe(f)&&oe(h),text:p="node:name",textStroke:m="var(--plot-background)",title:y="node:path",dx:g,dy:x,textAnchor:b,treeLayout:w=xl,textLayout:v=w===xl||w===Ub?"mirrored":"normal",tip:_,...A}={}){if(g===void 0&&(g=W_(A.treeAnchor).dx),b!==void 0)throw new Error("textAnchor is not a configurable tree option");v=cn(v,"textLayout",["mirrored","normal"]);function E(T){return Zo(e,Jy({treeLayout:w,text:p,fill:t===void 0?"currentColor":t,stroke:m,dx:g,dy:x,title:y,...T,...A}))}return nn(B_(e,G_({treeLayout:w,markerStart:f,markerEnd:h,stroke:n!==void 0?n:t===void 0?"node:internal":t,strokeWidth:r,strokeOpacity:i,strokeLinejoin:o,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:l,...A})),d?_i(e,Jy({treeLayout:w,fill:t===void 0?"node:internal":t,title:y,tip:_,...A})):null,p!=null?v==="mirrored"?[E({textAnchor:"start",treeFilter:"node:external"}),E({textAnchor:"end",treeFilter:"node:internal",dx:-g})]:E():null)}function aU(e,t){return p6(e,{...t,treeLayout:Ub})}function cU({geometry:e=H,...t}={}){return Me({...t,x:null,y:null},(n,r,i,o,s,{projection:a})=>{let c=wt(n,e),l=c.length,u=new Float64Array(l),f=new Float64Array(l),h=On(a);for(let d=0;d<l;++d)[u[d],f[d]]=h.centroid(c[d]);return{data:n,facets:r,channels:{x:{value:u,scale:a==null?"x":null,source:null},y:{value:f,scale:a==null?"y":null,source:null}}}})}function lU({geometry:e=H,...t}={}){let n;return{...t,x:{transform:r=>Float64Array.from(n=wt(wt(r,e),DA),([i])=>i)},y:{transform:()=>Float64Array.from(n,([,r])=>r)}}}var wU=vq(bU(),1);var Nnt=({marginLeft:e})=>[1,e],Dnt=({width:e,marginRight:t})=>[-1,e-t],Ont=({width:e,marginLeft:t,marginRight:n})=>[0,(t+e-n)/2],Bnt=({marginTop:e})=>[1,e],Lnt=({height:e,marginBottom:t})=>[-1,e-t],Cnt=({height:e,marginTop:t,marginBottom:n})=>[0,(t+e-n)/2];function _U(e){return typeof e=="string"?{anchor:e}:e}function vU(e={},t={}){arguments.length===1&&([e,t]=IU(e));let{anchor:n="left",padding:r=1,r:i=t.r}=_U(e);switch(`${n}`.toLowerCase()){case"left":n=Nnt;break;case"right":n=Dnt;break;case"middle":n=Ont;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return AU("x","y",n,Lt(r),i,t)}function SU(e={},t={}){arguments.length===1&&([e,t]=IU(e));let{anchor:n="bottom",padding:r=1,r:i=t.r}=_U(e);switch(`${n}`.toLowerCase()){case"top":n=Bnt;break;case"bottom":n=Lnt;break;case"middle":n=Cnt;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return AU("y","x",n,Lt(r),i,t)}function IU(e){let{anchor:t,padding:n,...r}=e,{r:i}=r;return[{anchor:t,padding:n,r:i},r]}function AU(e,t,n,r,i,o){if(i!=null&&typeof i!="number"){let{channels:s,sort:a,reverse:c}=o;s=ay(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 Me(o,function(s,a,c,l,u,f){let{[t]:h,r:d}=c;if(!c[t])throw new Error(`missing channel: ${t}`);({[t]:h}=oc(c,l,f));let p=d?void 0:i!==void 0?Lt(i):this.r!==void 0?this.r:3;d&&(d=wt(d.value,l[d.scale]||H,Float64Array));let[m,y]=n(u),g=m?Rnt:knt,x=new Float64Array(h.length),b=d?w=>d[w]:()=>p;for(let w of a){let v=(0,wU.default)();w=w.filter(d?A=>Bf(h[A])&&cr(d[A]):A=>Bf(h[A]));let _=new Float64Array(2*w.length+2);for(let A of w){let E=b(A),T=m?E+r:0,D=h[A]-E,I=h[A]+E,O=2;v.queryInterval(D-r,I+r,([,,S])=>{let M=x[S]-T,N=h[A]-h[S],R=r+(d?d[A]+d[S]:2*p),F=Math.sqrt(R*R-N*N);_[O++]=M-F,_[O++]=M+F});let L=_.slice(0,O);m&&(L=L.filter(S=>S>=0));t:for(let S of L.sort(g)){for(let M=0;M<O;M+=2)if(_[M]+1e-6<S&&S<_[M+1]-1e-6)continue t;x[A]=S+T;break}v.insert([D,I,A])}}m||(m=1);for(let w of a)for(let v of w)x[v]=x[v]*m+y;return{data:s,facets:a,channels:{[e]:{value:x,source:null},[t]:{value:h,source:c[t]},...d&&{r:{value:d,source:c.r}}}}})}function knt(e,t){return Math.abs(e)-Math.abs(t)}function Rnt(e,t){return e-t}function TU(e,t){return arguments.length===1&&({basis:e,...t}=e),xh(J_(e),t)}function EU(e,t){return arguments.length===1&&({basis:e,...t}=e),bh(J_(e),t)}function J_(e){if(e===void 0)return MU;if(typeof e=="function")return Q_(Pf(e));if(/^p\d{2}$/i.test(e))return Eh(Ff(e));switch(`${e}`.toLowerCase()){case"deviation":return Pnt;case"first":return MU;case"last":return $nt;case"max":return Unt;case"mean":return znt;case"median":return qnt;case"min":return jnt;case"sum":return Vnt;case"extent":return Fnt}throw new Error(`invalid basis: ${e}`)}function Q_(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 Eh(e){return Q_((t,n)=>e(t,r=>n[r]))}var Fnt={mapIndex(e,t,n){let[r,i]=fe(e,s=>t[s]),o=i-r;for(let s of e)n[s]=t[s]===null?NaN:(t[s]-r)/o}},MU=Q_((e,t)=>{for(let n=0;n<e.length;++n){let r=t[e[n]];if(ze(r))return r}}),$nt=Q_((e,t)=>{for(let n=e.length-1;n>=0;--n){let r=t[e[n]];if(ze(r))return r}}),Pnt={mapIndex(e,t,n){let r=Ds(e,o=>t[o]),i=ci(e,o=>t[o]);for(let o of e)n[o]=t[o]===null?NaN:i?(t[o]-r)/i:0}},Unt=Eh(Jt),znt=Eh(Ds),qnt=Eh(zi),jnt=Eh(he),Vnt=Eh(Nn);function NU(e,t){return Ynt("x",e,t)}function Ynt(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]=Nw(t.replace(/^[+-]/,"")),i*=l}t=zf(t),r=(l,u)=>t.offset(l,u)}let o=`${e}1`,s=`${e}2`,a=Ar({[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]=fe(l);return l.domain=i<0?[u,r(f,i)]:[r(u,i),f],l},a}function DU(e,t={}){if(typeof e=="string")switch(e.toLowerCase()){case"first":return tg(t);case"last":return eg(t)}if(typeof e=="function")return bc(null,e,t);let n,r;for(n in e){if(r!==void 0)throw new Error("ambiguous selector; multiple inputs");r=Xnt(e[n])}if(r===void 0)throw new Error(`invalid selector: ${e}`);return bc(n,r,t)}function Xnt(e){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"min":return w6;case"max":return _6}throw new Error(`unknown selector: ${e}`)}function tg(e){return bc(null,Gnt,e)}function eg(e){return bc(null,Wnt,e)}function K_(e){return bc("x",w6,e)}function tv(e){return bc("y",w6,e)}function ev(e){return bc("x",_6,e)}function nv(e){return bc("y",_6,e)}function*Gnt(e){yield e[0]}function*Wnt(e){yield e[e.length-1]}function*w6(e,t){yield Ix(e,n=>t[n])}function*_6(e,t){yield el(e,n=>t[n])}function bc(e,t,n){if(e!=null){if(n[e]==null)throw new Error(`missing channel: ${e}`);e=n[e]}let r=Vn(n);return bn(n,(i,o)=>{let s=wt(i,r),a=wt(i,e),c=[];for(let l of o){let u=[];for(let f of s?fn(l,h=>s[h]).values():[l])for(let h of t(f,a))u.push(h);c.push(u)}return{data:i,facets:c}})}vt.prototype.plot=function({marks:e=[],...t}={}){return oh({...t,marks:[...e,this]})};var Hnt=new Map([["style","style"],["width","width"],["height","height"],["margin","margin"],["marginLeft","marginLeft"],["marginRight","marginRight"],["marginTop","marginTop"],["marginBottom","marginBottom"],["align","align"],["aspectRatio","aspectRatio"],["axis","axis"],["inset","inset"],["grid","grid"],["label","label"],["padding","padding"],["xScale","x.type"],["xDomain","x.domain"],["xRange","x.range"],["xNice","x.nice"],["xInset","x.inset"],["xInsetLeft","x.insetLeft"],["xInsetRight","x.insetRight"],["xClamp","x.clamp"],["xRound","x.round"],["xAlign","x.align"],["xPadding","x.padding"],["xPaddingInner","x.paddingInner"],["xPaddingOuter","x.paddingOuter"],["xAxis","x.axis"],["xTicks","x.ticks"],["xTickSize","x.tickSize"],["xTickSpacing","x.tickSpacing"],["xTickPadding","x.tickPadding"],["xTickFormat","x.tickFormat"],["xTickRotate","x.tickRotate"],["xGrid","x.grid"],["xLine","x.line"],["xLabel","x.label"],["xLabelAnchor","x.labelAnchor"],["xLabelArrow","x.labelArrow"],["xLabelOffset","x.labelOffset"],["xFontVariant","x.fontVariant"],["xAriaLabel","x.ariaLabel"],["xAriaDescription","x.ariaDescription"],["xPercent","x.percent"],["xReverse","x.reverse"],["xZero","x.zero"],["xBase","x.base"],["xExponent","x.exponent"],["xConstant","x.constant"],["yScale","y.type"],["yDomain","y.domain"],["yRange","y.range"],["yNice","y.nice"],["yInset","y.inset"],["yInsetTop","y.insetTop"],["yInsetBottom","y.insetBottom"],["yClamp","y.clamp"],["yRound","y.round"],["yAlign","y.align"],["yPadding","y.padding"],["yPaddingInner","y.paddingInner"],["yPaddingOuter","y.paddingOuter"],["yAxis","y.axis"],["yTicks","y.ticks"],["yTickSize","y.tickSize"],["yTickSpacing","y.tickSpacing"],["yTickPadding","y.tickPadding"],["yTickFormat","y.tickFormat"],["yTickRotate","y.tickRotate"],["yGrid","y.grid"],["yLine","y.line"],["yLabel","y.label"],["yLabelAnchor","y.labelAnchor"],["yLabelArrow","y.labelArrow"],["yLabelOffset","y.labelOffset"],["yFontVariant","y.fontVariant"],["yAriaLabel","y.ariaLabel"],["yAriaDescription","y.ariaDescription"],["yPercent","y.percent"],["yReverse","y.reverse"],["yZero","y.zero"],["yBase","y.base"],["yExponent","y.exponent"],["yConstant","y.constant"],["facetMargin","facet.margin"],["facetMarginTop","facet.marginTop"],["facetMarginBottom","facet.marginBottom"],["facetMarginLeft","facet.marginLeft"],["facetMarginRight","facet.marginRight"],["facetGrid","facet.grid"],["facetLabel","facet.label"],["fxDomain","fx.domain"],["fxRange","fx.range"],["fxInset","fx.inset"],["fxInsetLeft","fx.insetLeft"],["fxInsetRight","fx.insetRight"],["fxRound","fx.round"],["fxAlign","fx.align"],["fxPadding","fx.padding"],["fxPaddingInner","fx.paddingInner"],["fxPaddingOuter","fx.paddingOuter"],["fxAxis","fx.axis"],["fxTicks","fx.ticks"],["fxTickSize","fx.tickSize"],["fxTickSpacing","fx.tickSpacing"],["fxTickPadding","fx.tickPadding"],["fxTickFormat","fx.tickFormat"],["fxTickRotate","fx.tickRotate"],["fxGrid","fx.grid"],["fxLine","fx.line"],["fxLabel","fx.label"],["fxLabelAnchor","fx.labelAnchor"],["fxLabelOffset","fx.labelOffset"],["fxFontVariant","fx.fontVariant"],["fxAriaLabel","fx.ariaLabel"],["fxAriaDescription","fx.ariaDescription"],["fxReverse","fx.reverse"],["fyDomain","fy.domain"],["fyRange","fy.range"],["fyInset","fy,inset"],["fyInsetTop","fy.insetTop"],["fyInsetBottom","fy.insetBottom"],["fyRound","fy.round"],["fyAlign","fy.align"],["fyPadding","fy.padding"],["fyPaddingInner","fy.paddingInner"],["fyPaddingOuter","fy.paddingOuter"],["fyAxis","fy.axis"],["fyTicks","fy.ticks"],["fyTickSize","fy.tickSize"],["fyTickSpacing","fy.tickSpacing"],["fyTickPadding","fy.tickPadding"],["fyTickFormat","fy.tickFormat"],["fyTickRotate","fy.tickRotate"],["fyGrid","fy.grid"],["fyLine","fy.line"],["fyLabel","fy.label"],["fyLabelAnchor","fy.labelAnchor"],["fyLabelOffset","fy.labelOffset"],["fyFontVariant","fy.fontVariant"],["fyAriaLabel","fy.ariaLabel"],["fyAriaDescription","fy.ariaDescription"],["fyReverse","fy.reverse"],["colorScale","color.type"],["colorDomain","color.domain"],["colorRange","color.range"],["colorClamp","color.clamp"],["colorN","color.n"],["colorNice","color.nice"],["colorScheme","color.scheme"],["colorInterpolate","color.interpolate"],["colorPivot","color.pivot"],["colorSymmetric","color.symmetric"],["colorLabel","color.label"],["colorPercent","color.percent"],["colorReverse","color.reverse"],["colorZero","color.zero"],["colorTickFormat","color.tickFormat"],["colorBase","color.base"],["colorExponent","color.exponent"],["colorConstant","color.constant"],["opacityScale","opacity.type"],["opacityDomain","opacity.domain"],["opacityRange","opacity.range"],["opacityClamp","opacity.clamp"],["opacityNice","opacity.nice"],["opacityLabel","opacity.label"],["opacityPercent","opacity.percent"],["opacityReverse","opacity.reverse"],["opacityZero","opacity.zero"],["opacityTickFormat","opacity.tickFormat"],["opacityBase","opacity.base"],["opacityExponent","opacity.exponent"],["opacityConstant","opacity.constant"],["symbolScale","symbol.type"],["symbolDomain","symbol.domain"],["symbolRange","symbol.range"],["rScale","r.type"],["rDomain","r.domain"],["rRange","r.range"],["rClamp","r.clamp"],["rNice","r.nice"],["rLabel","r.label"],["rPercent","r.percent"],["rZero","r.zero"],["rBase","r.base"],["rExponent","r.exponent"],["rConstant","r.constant"],["lengthScale","length.type"],["lengthDomain","length.domain"],["lengthRange","length.range"],["lengthClamp","length.clamp"],["lengthNice","length.nice"],["lengthPercent","length.percent"],["lengthZero","length.zero"],["lengthBase","length.base"],["lengthExponent","length.exponent"],["lengthConstant","length.constant"],["projectionType","projection.type"],["projectionParallels","projection.parallels"],["projectionPrecision","projection.precision"],["projectionRotate","projection.rotate"],["projectionDomain","projection.domain"],["projectionInset","projection.inset"],["projectionInsetLeft","projection.insetLeft"],["projectionInsetRight","projection.insetRight"],["projectionInsetTop","projection.insetTop"],["projectionInsetBottom","projection.insetBottom"],["projectionClip","projection.clip"]]);function Znt(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 OU(e,t,n){for(let r in e){let i=Hnt.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&&Znt(t,i.split("."),o)}}var Jnt=new Set(["frame","hexgrid","sphere","graticule"]),Qnt=new Map([["first",tg],["last",eg],["maxX",ev],["maxY",nv],["minX",K_],["minY",tv],["nearest",ac],["nearestX",cc],["nearestXY",oa]]);async function LU(e){let t={marks:[]},n=[],{attributes:r,marks:i}=e;OU(r,t,n);let o=[];for(let a of i)for(let{type:c,data:l,options:u}of a.plotSpecs()){let{select:f,...h}=u,d=Qnt.get(f)?.(h)??h,p=Jnt.has(c)?[d]:[l,d];t.marks.push(v6[c](...p)),o.push(a.index)}trt(t,e);let s=oh(t);ert(s,o),Knt(e,s,r,n);for(let a of e.interactors)await a.init(s);return s}function Knt(e,t,n,r){r.forEach(i=>{let o=n[i];if(o===vo){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 trt(e,t){let{marks:n}=t;rv("x",e,n),rv("y",e,n),rv("fx",e,n),rv("fy",e,n)}function rv(e,t,n){let r=t[e]||{};if(r.axis===null||r.label!==void 0)return;let i=n.map(l=>l.channelField(e)?.field);if(i.every(l=>l==null))return;let o,s,a;for(let l=0;l<i.length;++l){let{column:u,label:f}=i[l]||{};u===void 0&&f===void 0||(o===void 0&&s===void 0?(o=u,s=f,a=nrt(n[l].data,e)||"number"):s!==f?s=void 0:o!==u&&(o=void 0))}let c=s||o;if(c!==void 0){if((a==="number"||a==="date")&&(e==="x"||e==="y")){r.percent&&(c=`${c} (%)`);let l=(e==="x"?1:-1)*(r.reverse?-1:1);e==="x"||r.labelAnchor==="center"?c=e==="x"==l<0?`\u2190 ${c}`:`${c} \u2192`:c=`${l<0?"\u2191 ":"\u2193 "}${c}`}t[e]={...r,label:c}}}function ert(e,t){let n=e.querySelectorAll('g[aria-label="facet"]');if(n.length)for(let r of n)BU(r,t);else BU(e,t)}function BU(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 nrt(e,t){if(!e)return;let{columns:n}=e,r=n[t]??n[t+"1"]??n[t+"2"];if(r){for(let i of r)if(i!=null)return i instanceof Date?"date":typeof i}}var rrt={width:640,marginLeft:40,marginRight:20,marginTop:20,marginBottom:30},ng=class{constructor(t){this.attributes={...rrt},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=AI()}margins(){return{left:this.getAttribute("marginLeft"),top:this.getAttribute("marginTop"),bottom:this.getAttribute("marginBottom"),right:this.getAttribute("marginRight")}}innerWidth(){let{left:t,right:n}=this.margins();return this.getAttribute("width")-t-n}innerHeight(t=400){let{top:n,bottom:r}=this.margins(),i=this.getAttribute("height");return i==null&&(i=irt(this,n,r)||t,this.setAttribute("height",i,{silent:!0})),i-n-r}pending(t){this.synch.pending(t)}update(t){return this.synch.ready(t)&&!this.pendingRender&&(this.pendingRender=!0,requestAnimationFrame(()=>this.render())),this.synch.promise}async render(){this.pendingRender=!1;let t=await LU(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 gp(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 irt(e,t,n){let r=e.getAttribute("aspectRatio");if(r==null)return;let i=e.getAttribute("xDomain"),o=e.getAttribute("yDomain");if(!i||!o)return;let s=Math.abs(i[1]-i[0]);return Math.abs(o[1]-o[0])*e.innerWidth()/(r*s)+t+n}function iv(e){return typeof e!="string"?!1:(e=e.toLowerCase().trim(),e==="none"||e==="currentcolor"||e.startsWith("url(")&&e.endsWith(")")||e.startsWith("var(")&&e.endsWith(")")||Pr(e)!==null)}var ort=new Set(["order","sort","label","anchor","curve","tension","marker","markerStart","markerMid","markerEnd","textAnchor","lineAnchor","lineHeight","textOverflow","monospace","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","frameAnchor","strokeLinejoin","strokeLinecap","strokeMiterlimit","strokeDasharray","strokeDashoffset","mixBlendMode","shapeRendering","imageRendering","preserveAspectRatio","interpolate","crossOrigin","paintOrder","pointerEvents","target","select"]);function CU(e){return ort.has(e)}var srt=new Set(["asterisk","circle","cross","diamond","diamond2","hexagon","plus","square","square2","star","times","triangle","triangle2","wye"]);function kU(e){return srt.has(`${e}`.toLowerCase())}var RU=e=>e==="stroke"||e==="fill",art=e=>/opacity$/i.test(e),crt=e=>e==="symbol",lrt=(e,t)=>e!=="sort"&&e!=="tip"&&t!=null&&!Array.isArray(t),S6=(e,t)=>({channel:e,field:t,as:t instanceof wr?t.column:e}),I6=(e,t)=>({channel:e,value:t}),ov=e=>Array.isArray(e),ln=class extends hr{constructor(t,n,r,i={}){super(n?.options?.filterBy),this.type=t,this.reqs=i,this.source=n,ov(this.source)&&(this.data=Sr(this.source));let o=this.channels=[],s=this.detail=new Set,a=this.params=new Set,c=(l,u)=>{let f=typeof u;if(l==="channels")for(let h in u)s.add(h),c(h,u[h]);else if(f==="function"&&u[bp]){let h=u(this,l);for(let d in h)c(d,h[d])}else if(f==="string")CU(l)||RU(l)&&iv(u)||crt(l)&&kU(u)?o.push(I6(l,u)):o.push(S6(l,Ma(u)));else if(_s(u))if(Array.isArray(u.columns))o.push(S6(l,u)),a.add(u);else{let h=I6(l,u.value);o.push(h),u.addEventListener("value",d=>(h.value=d,this.update()))}else f==="object"&&lrt(l,u)?o.push(S6(l,u)):u!==void 0&&o.push(I6(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||ov(this.source)}hasFieldInfo(){return!!this._fieldInfo}channel(t){return this.channels.find(n=>n.channel===t)}channelField(t,{exact:n=!1}={}){let r=n?this.channel(t):this.channels.find(i=>i.channel.startsWith(t));return r?.field?r: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){if(!s)continue;let a=s.stats?.stats||[],c=s.stats?.column??s,l=i.get(c)??i.set(c,new Set).get(c);a.forEach(u=>l.add(u)),r[o]?.forEach(u=>l.add(u))}return Array.from(i,([o,s])=>({table:t,column:o,stats:s}))}fieldInfo(t){let n=Object.fromEntries(t.map(r=>[r.column,r]));for(let r of this.channels){let{field:i}=r;i&&Object.assign(r,n[i.stats?.column??i])}return this._fieldInfo=!0,this}query(t=[]){if(this.hasOwnData())return null;let{channels:n,source:{table:r}}=this;return rg(n,r).where(t)}queryPending(){return this.plot.pending(this),this}queryResult(t){return this.data=Sr(t),this}update(){return this.plot.update(this)}plotSpecs(){let{type:t,data:n,detail:r,channels:i}=this;return A6(t,r,i,n)}};function Xn(e,t){let n=t?.[e.as]??e.as;return Object.hasOwn(e,"value")?e.value:RU(e.channel)?{value:n,scale:"color"}:art(e.channel)?{value:n,scale:"opacity"}:n}function rg(e,t,n=[]){let r=dt.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 A6(e,t,n,r,i={}){let{numRows:o,values:s,columns:a}=r??{},c={};for(let f of n){let h=t.has(f.channel)?c:i;h[f.channel]=Xn(f,a)}return t.size&&(i.channels=c),[{type:e,data:s??(r?{length:o}:null),options:i}]}function Ql(e,t){let{plot:n}=e,r=n.getAttribute(`${t}Scale`);if(!r){let{type:o}=e.channelField(t);r=o==="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 hp(i)}function Hr(e,t,n,r,i=1,o){let{field:s}=e.channelField(t);o=o??s;let{type:a,apply:c,sqlApply:l}=Ql(e,t),u=!!e.plot.getAttribute(`${t}Reverse`),[f,h]=r.map(x=>c(x)),d=l(o),p=a==="time"||a==="utc"?d:o,m=h===f?0:(n-i)/(h-f),y=m!==1?` * ${m}::DOUBLE`:"";return[u?j`(${h} - ${d}::DOUBLE)${y}`:j`(${d}::DOUBLE - ${f})${y}`,p]}var M6={x:["min","max"]},T6={y:["min","max"]},sv={...M6,...T6};function FU(e,t,n,r,i){let{plot:o}=e,s=o.getAttribute(r),a=o.getAttribute(i);if(Array.isArray(s)&&!s[Mn])return s;{let{column:c,min:l,max:u}=e.channelField(n),f=E6(t,c)||(a?Us().domain([l,u]).nice().domain():[l,u]);return s!==vo&&(f[Mn]=!0),o.setAttribute(r,f,{silent:!0}),f}}function es(e,t){return FU(e,t,"x","xDomain","xNice")}function ns(e,t){return FU(e,t,"y","yDomain","yNice")}function E6(e,t){if(!e)return;let n,r,i=(o,s)=>{if(o==="BETWEEN"&&`${s.field}`===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 ig=class extends ln{constructor(t,n,r){let i=t.endsWith("X")?"y":t.endsWith("Y")?"x":null,o=i?{[i]:["min","max"]}:void 0;super(t,n,r,o),this.dim=i}query(t=[]){let{plot:n,dim:r,source:i}=this,{optimize:o=!0}=i.options||{},s=super.query(t);if(!r)return s;let a=r==="x"?"y":"x",c=this.channelField(a,{exact:!0})?.as,{field:l,as:u,type:f,min:h,max:d}=this.channelField(r);if(o&&(f==="date"||f==="number")&&c){let m=r==="x"?n.innerWidth():n.innerHeight(),[y,g]=E6(t,l)||[h,d],[x]=Hr(this,r,m,[y,g],1,u),b=s.select().map(w=>w.as).filter(w=>w!==u&&w!==c);return urt(s,x,u,c,b)}else return s.orderby(l)}};function urt(e,t,n,r,i=[]){let o=j`FLOOR(${t})::INTEGER`,s=a=>dt.from(e).select(a).groupby(o,i);return dt.union(s([{[n]:si(n),[r]:ku(r,n)},...i]),s([{[n]:oi(n),[r]:Ru(r,n)},...i]),s([{[n]:ku(n,r),[r]:si(r)},...i]),s([{[n]:Ru(n,r),[r]:oi(r)},...i])).orderby(i,n)}function $U(e,t=[]){return new t.constructor(e)}function PU(e,t,n){let r=$U(e,n),i=n.length;for(let o=0;o<i;++o)r[t[o]]=n[o];return r}function UU(e,t,n,r,i,o,s){let a=n.length,c=e*t,l=i.map(d=>r[d]),u={},f=[],h=new Int32Array(a);if(o?.length){let d=o.map(m=>r[m]),p={};for(let m=0;m<a;++m){let y=d.map(g=>g[m]);h[m]=p[y]??=f.push(y)-1}for(let m=0;m<o.length;++m)u[o[m]]=f.map(y=>y[m])}else f.push([]);if(s){let d=n.map(y=>y%e),p=n.map(y=>Math.floor(y/e)),m=f.map(()=>[]);for(let y=0;y<a;++y)m[h[y]].push(y);i.forEach((y,g)=>{let x=l[g];u[y]=f.map((b,w)=>s(m[w],e,t,d,p,x))})}else i.forEach((d,p)=>{let m=l[p],y=u[d]=f.map(()=>$U(c,m));for(let g=0;g<a;++g)y[h[g]][n[g]]=m[g]});return{numRows:f.length,columns:u}}function og(e){let t=1/0,n=-1/0;return e.forEach(r=>{let i=r.length;for(let o=0;o<i;++o){let s=r[o];s<t&&(t=s),s>n&&(n=s)}}),Number.isFinite(t)&&Number.isFinite(n)?[t,n]:[0,1]}function zU(e){let t=new Kn;return e.forEach(n=>{let r=n.length;for(let i=0;i<r;++i)t.add(n[i])}),Array.from(t).sort(Ot)}function Ve(e,t){return vr(e)?(e.addEventListener("value",t),e.value):e}function sg(e,t=!1){let n=new Float64Array(5),r=new Float64Array(4);frt(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 frt(e,t,n){let i=Float64Array.of(.84,1.8675,.84,-1.8675,-.34015,-.1299,-.34015,.1299),o=Math.exp(-1.783/n),s=Math.exp(-1.723/n),a=.6318/n,c=1.997/n,l=Float64Array.of(-o*Math.cos(a),o*Math.sin(a),-o*Math.cos(-a),o*Math.sin(-a),-s*Math.cos(c),s*Math.sin(c),-s*Math.cos(-c),s*Math.sin(-c)),u=n*2.5066282746310007,f=Float64Array.of(i[0],i[1],0,0,0,0,0,0),h=Float64Array.of(1,0,l[0],l[1],0,0,0,0,0,0),d,p;for(p=2;p<8;p+=2){for(f[p]=l[p]*f[p-2]-l[p+1]*f[p-1],f[p+1]=l[p]*f[p-1]+l[p+1]*f[p-2],d=p-2;d>0;d-=2)f[d]+=l[p]*f[d-2]-l[p+1]*f[d-1],f[d+1]+=l[p]*f[d-1]+l[p+1]*f[d-2];for(d=0;d<=p;d+=2)f[d]+=i[p]*h[d]-i[p+1]*h[d+1],f[d+1]+=i[p]*h[d+1]+i[p+1]*h[d];for(h[p+2]=l[p]*h[p]-l[p+1]*h[p+1],h[p+3]=l[p]*h[p+1]+l[p+1]*h[p],d=p;d>0;d-=2)h[d]+=l[p]*h[d-2]-l[p+1]*h[d-1],h[d+1]+=l[p]*h[d-1]+l[p+1]*h[d-2]}for(p=0;p<4;++p)d=p<<1,t[p]=f[d]/u,e[p+1]=h[d+2]}function qU(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);av(e,n.subarray(u),r,1,o,s,a,f)}for(let l=0;l<r;++l){let u=c.subarray(l);av(t,u,i,r,o,s,a,u)}return c}function av(e,t,n,r=1,i=new Float64Array(n),o=new Float64Array(n),s=new Float64Array(5),a=i,c=hrt){let l=r*2,u=r*3,f=r*4,h=r*n,d,p;for(c(i,t,n,r,e.b_causal,3,e.a,4,e.sum_causal,s,e.sigma),p=4,d=f;p<n;++p,d+=r)i[p]=e.b_causal[0]*t[d]+e.b_causal[1]*t[d-r]+e.b_causal[2]*t[d-l]+e.b_causal[3]*t[d-u]-e.a[1]*i[p-1]-e.a[2]*i[p-2]-e.a[3]*i[p-3]-e.a[4]*i[p-4];for(c(o,t,n,-r,e.b_anticausal,4,e.a,4,e.sum_anticausal,s,e.sigma),p=4,d=h-r*5;p<n;++p,d-=r)o[p]=e.b_anticausal[1]*t[d+r]+e.b_anticausal[2]*t[d+l]+e.b_anticausal[3]*t[d+u]+e.b_anticausal[4]*t[d+f]-e.a[1]*o[p-1]-e.a[2]*o[p-2]-e.a[3]*o[p-3]-e.a[4]*o[p-4];if(e.negative)for(p=0,d=0;p<n;++p,d+=r)a[d]=i[p]+o[n-p-1];else for(p=0,d=0;p<n;++p,d+=r)a[d]=Math.max(0,i[p]+o[n-p-1]);return a}function hrt(e,t,n,r,i,o,s,a,c,l,u,f=.5){let h=Math.abs(r)*n,d=r<0?h+r:0,p,m,y;for(m=0;m<=a;++m)for(l[m]=m<=o?i[m]:0,y=1;y<=a&&y<=m;++y)l[m]-=s[y]*l[m-y];for(y=0;y<a;++y)for(e[y]=0,m=1;m<=y;++m)p=d+r*m,p>=0&&p<h&&(e[y]+=l[y-m]*t[p]);let g=t[d],x=Math.ceil(u*10);for(m=0;m<x;++m){for(y=0;y<a;++y)e[y]+=l[y]*g;if(c-=Math.abs(l[0]),c<=f)break;for(l[a]=m+a<=o?i[m+a]:0,y=1;y<=a;++y)l[a]-=s[y]*l[a-y];for(y=0;y<a;++y)l[y]=l[y+1]}}var ua="density",Wi=class extends ln{constructor(t,n,r){let{bandwidth:i=0,interpolate:o="none",pixelSize:s=1,pad:a=1,width:c,height:l,...u}=r,f=drt(u);super(t,n,u,sv),this.densityMap=f,this.bandwidth=Ve(i,h=>(this.bandwidth=h,this.grids?this.convolve().update():null)),this.interpolate=Ve(o,h=>(this.interpolate=h,this.requestUpdate())),this.pixelSize=Ve(s,h=>(this.pixelSize=h,this.requestUpdate())),this.pad=Ve(a,h=>(this.pad=h,this.requestUpdate())),this.width=Ve(c,h=>(this.width=h,this.requestUpdate())),this.height=Ve(l,h=>(this.height=h,this.requestUpdate()))}setPlot(t,n){let r=()=>{this.hasFieldInfo()&&this.requestUpdate()};t.addAttributeListener("xDomain",r),t.addAttributeListener("yDomain",r),super.setPlot(t,n)}get filterIndexable(){let t=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return t&&n&&!t[Mn]&&!n[Mn]}query(t=[]){let{interpolate:n,pad:r,channels:i,densityMap:o,source:s}=this,[a,c]=this.extentX=es(this,t),[l,u]=this.extentY=ns(this,t),[f,h]=this.bins=this.binDimensions(),[d,p]=Hr(this,"x",f,[a,c],r),[m,y]=Hr(this,"y",h,[l,u],r),g=r?[We(p,[+a,+c]),We(y,[+l,+u])]:[As(+a,p),Is(p,+c),As(+l,y),Is(y,+u)],x=dt.from(s.table).where(t.concat(g)),b=this.groupby=[],w={};for(let _ of i)if(Object.hasOwn(_,"field")){let{as:A,channel:E,field:T}=_;T.aggregate?(w[E]=T,o[E]=!0):E==="weight"?w[ua]=Fr(T):E!=="x"&&E!=="y"&&(x.select({[A]:T}),b.push(A))}let v=this.aggr=Object.keys(w);if(w.density&&v.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(v.length||(v.push(ua),w.density=Zn()),n==="linear"){if(v.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!w.density)throw new Error("Linear binning not applicable to custom aggregates.");return yrt(x,d,m,w[ua],f,b)}else return mrt(x,d,m,w,f,b)}binDimensions(){let{plot:t,pixelSize:n,width:r,height:i}=this;return[r??Math.round(t.innerWidth()/n),i??Math.round(t.innerHeight()/n)]}queryResult(t){let[n,r]=this.bins,i=prt(this.interpolate),{columns:o}=Sr(t);return this.grids0=UU(n,r,o.index,o,this.aggr,this.groupby,i),this.convolve()}convolve(){let{aggr:t,bandwidth:n,bins:r,grids0:i,plot:o}=this;if(this.grids=i,n>0){let s=t.length===1?t[0]:t.includes(ua)?ua:null;if(!s)return console.warn("No compatible grid found for smoothing."),this;let a=i.columns[s],c=o.innerWidth(),l=o.innerHeight(),[u,f]=r,h=a.some(m=>m.some(y=>y<0)),d=sg(n*(u-1)/c,h),p=sg(n*(f-1)/l,h);this.grids={numRows:i.numRows,columns:{...i.columns,[s]:a.map(m=>qU(d,p,m,r))}}}return this}};function drt(e){let t={};for(let n in e)e[n]==="density"&&(delete e[n],t[n]=!0);return t}function prt(e="none"){if(typeof e=="function")return e;switch(e.toLowerCase()){case"none":case"linear":return;case"nearest":return qy;case"barycentric":return zy();case"random-walk":return jy()}throw new Error(`invalid interpolate: ${e}`)}function mrt(e,t,n,r,i,o){return e.select({index:j`FLOOR(${t})::INTEGER + FLOOR(${n})::INTEGER * ${i}`,...r}).groupby("index",o)}function yrt(e,t,n,r,i,o){let s=r?.column?`* ${r.column}`:"",a=(h,d)=>e.clone().select({xp:t,yp:n,i:h,w:d}),c=a(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 dt.from(dt.unionAll(c,l,u,f)).select({index:"i",density:Fr("w")},o).groupby("index",o).having(Gc("density",0))}var ag=class extends Wi{constructor(t,n){let{thresholds:r=10,...i}=n;super("geo",t,{bandwidth:20,interpolate:"linear",pixelSize:2,...i}),this.thresholds=Ve(r,o=>(this.thresholds=o,this.grids?this.contours().update():null))}convolve(){return super.convolve().contours()}contours(){let{bins:t,densityMap:n,grids:r,thresholds:i,plot:o}=this,{numRows:s,columns:a}=r,c=i,l;if(Array.isArray(c))l=c;else{let[,I]=og(a.density);l=Array.from({length:c-1},(O,L)=>I*(L+1)/c)}(n.fill||n.stroke)&&this.plot.getAttribute("colorScale")!=="log"&&this.plot.setAttribute("colorZero",!0);let[u,f]=t,[h,d]=o.getAttribute("xDomain"),[p,m]=o.getAttribute("yDomain"),y=(d-h)/u,g=(m-p)/f,x=+h,b=+p,w=I=>x+I*y,v=I=>b+I*g,_=Fa().size(t),A=this.contourData=Array(s*l.length),{density:E,...T}=a,D=Object.entries(T);for(let I=0,O=0;I<s;++I){let L=E[I],S=D.reduce((M,[N,R])=>(M[N]=R[I],M),{});for(let M=0;M<l.length;++M,++O)A[O]=Object.assign(grt(_.contour(L,l[M]),w,v),S)}return this}plotSpecs(){let{type:t,channels:n,densityMap:r,contourData:i}=this,o={};for(let s of n){let{channel:a}=s;a!=="x"&&a!=="y"&&(o[a]=Xn(s))}for(let s in r)r[s]&&(o[s]=Xn({channel:s,as:"value"}));return[{type:t,data:i,options:o}]}};function grt(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 cg(e){return Array.from({length:e},(t,n)=>n)}function cv(e,t){let n=t.reduce((i,o,s)=>(i[o]=s,i),{}),r=cg(e.length);return r.sort((i,o)=>n[e[i]]-n[e[o]]),r}function lv(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 jU(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 VU(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 YU(e={}){let{r:t=0,g:n=0,b:r=0,opacity:i=1}=typeof e=="string"?sn(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 XU(e){let{domain:t,range:n}=e,r=Object.create(null),i=new Uint8ClampedArray(4*t.length),o=t.length-1,s=n.length;for(let a=0;a<=o;++a){let c=n[a%s],{r:l,g:u,b:f,opacity:h=1}=typeof c=="string"?sn(c):c,d=a<<2;i[d+0]=l,i[d+1]=u,i[d+2]=f,i[d+3]=255*h|0,r[t[a]]=d}return(a,c,l,u)=>{if(u.map)for(let f=0,h=0;f<l;++f)for(let d=0,p=(l-f-1)*c;d<c;++d,h+=4){let m=r[u[d+p]];a[h+0]=i[m+0],a[h+1]=i[m+1],a[h+2]=i[m+2],a[h+3]=i[m+3]}else{let f=r[u];for(let h=0,d=0;h<l;++h)for(let p=0;p<c;++p,d+=4)a[d+0]=i[f+0],a[d+1]=i[f+1],a[d+2]=i[f+2],a[d+3]=i[f+3]}}}function GU(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"?sn(a):a,h=s<<2;i[h+0]=c,i[h+1]=l,i[h+2]=u,i[h+3]=255*f|0}return(s,a,c,l)=>{for(let u=0,f=0;u<c;++u)for(let h=0,d=(c-u-1)*a;h<a;++h,f+=4){let p=o*n(l[h+d])<<2;s[f+0]=i[p+0],s[f+1]=i[p+1],s[f+2]=i[p+2],s[f+3]=i[p+3]}}}var wc=class extends Wi{constructor(t,n){super("image",t,n),this.image=null}setPlot(t,n){let r=()=>{this.hasFieldInfo()&&this.rasterize()};t.addAttributeListener("schemeColor",r),super.setPlot(t,n)}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:t,grids:n}=this,[r,i]=t,{numRows:o,columns:s}=n,{canvas:a,ctx:c,img:l}=_rt(this,r,i),{alpha:u,alphaProp:f,color:h,colorProp:d}=N6(this),p=s[f]??[],m=s[d]??[],y=o>1&&d&&this.groupby?.includes(d)?cv(m,this.plot.getAttribute("colorDomain")):cg(o);return this.data={numRows:o,columns:{src:Array.from({length:o},(g,x)=>(h?.(l.data,r,i,m[y[x]]),u?.(l.data,r,i,p[y[x]]),c.putImageData(l,0,0),a.toDataURL()))}},this}plotSpecs(){let{type:t,plot:n,data:{numRows:r,columns:i}}=this,o={src:i.src,width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:t,data:{length:r},options:o}]}},lg=class extends wc{constructor(t,n){super(t,{bandwidth:20,interpolate:"linear",pixelSize:2,...n})}};function N6(e){let{aggr:t,densityMap:n,groupby:r,plot:i}=e,o=t.includes(ua),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":iv(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"?ua:null),h=c?.as??(u==="grid"?ua:null),d=l!=="grid"&&l!=="group"?YU(l):brt(e,f),p=u!=="grid"?jU(u):xrt(e,h);return{alphaProp:h,colorProp:f,alpha:p,color:d}}function xrt(e,t){let{plot:n,grids:r}=e,i=n.getAttribute("opacityDomain"),o=i===vo,s=i?.[Mn],a=!o&&!s&&i||og(r.columns[t]);(o||s||!i)&&(o||(a[Mn]=!0),n.setAttribute("opacityDomain",a));let c=rc({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 VU(c)}function brt(e,t){let{plot:n,grids:r}=e,i=r.columns[t],o=!i[0]?.map,s=o||Array.isArray(i[0]),a=n.getAttribute("colorDomain"),c=a===vo,l=a?.[Mn],u=!c&&!l&&a||(o?i.slice().sort(Ot):s?zU(i):og(i));(c||l||!a)&&(c||(u[Mn]=!0),n.setAttribute("colorDomain",u));let f=rc({color:{type:n.getAttribute("colorScale"),domain:u,range:n.getAttribute("colorRange"),clamp:n.getAttribute("colorClamp"),n:n.getAttribute("colorN"),nice:n.getAttribute("colorNice"),reverse:n.getAttribute("colorReverse"),scheme:n.getAttribute("colorScheme"),interpolate:n.getAttribute("colorInterpolate"),pivot:n.getAttribute("colorPivot"),symmetric:n.getAttribute("colorSymmetric"),zero:n.getAttribute("colorZero"),base:n.getAttribute("colorBase"),exponent:n.getAttribute("colorExponent"),constant:n.getAttribute("colorConstant")}});if(s)return XU(f);{let h=rc({x:{type:wrt(f.type),domain:f.domain,reverse:f.reverse,range:[0,1],clamp:f.clamp,base:f.base,exponent:f.exponent,constant:f.constant}});return GU(1024,f,h.apply)}}function wrt(e){return e.endsWith("symlog")?"symlog":e.endsWith("log")?"log":e.endsWith("pow")?"pow":e.endsWith("sqrt")?"sqrt":e==="diverging"?"linear":e}function _rt(e,t,n){if(!e.image||e.image.w!==t||e.image.h!==n){let r=lv(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 ug=class extends wc{constructor(t,n){let{normalize:r=!0,...i}=n;super(t,i),this.normalize=Ve(r,o=>(this.normalize=o,this.requestUpdate()))}query(t=[]){let{channels:n,normalize:r,source:i,pad:o}=this,[s,a]=this.bins=this.binDimensions(),[c]=Hr(this,"x",s,es(this,t),o),[l]=Hr(this,"y",a,ns(this,t),o),u=dt.from(i.table).where(vrt(this,t));this.aggr=["density"];let f=this.groupby=[],h=[];for(let d of n)if(Object.hasOwn(d,"field")){let{channel:p,field:m}=d;p==="z"?(u.select({[p]:m}),h.push("z")):p!=="x"&&p!=="y"&&(u.select({[p]:m}),f.push(p))}return Srt(u,c,l,h,s,a,f,r)}};function vrt(e,t){if(Array.isArray(t)&&!t.length)return t;let{column:n}=e.channelField("x"),{column:r}=e.channelField("y"),i=s=>{let a=`${s.field}`;return s.op!=="BETWEEN"||a!==n&&a!==r},o=s=>s.op==="AND"?_r(s.children.filter(a=>i(a))):s;return Array.isArray(t)?t.filter(s=>i(s)).map(s=>o(s)):o(t)}function Srt(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=dt.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(_r(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=dt.select({x:j`GREATEST(MAX(ABS(dx)), MAX(ABS(dy)))`}).from("pairs"),h=dt.select({i:j`UNNEST(range((${f})))::INTEGER`}),d=dt.unionAll(dt.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)`),dt.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)`),dt.select(c,{x:"x0",y:"y0"}).from("pairs").where(Xc("dx"))),p=["x"].concat(c).join(", "),m=dt.from("raster").select(c,"x","y",a?{w:j`1.0 / COUNT(*) OVER (PARTITION BY ${p})`}:null).where(_r(We("x",[0,i],!0),We("y",[0,o],!0)));return dt.with({pairs:u,indices:h,raster:d,points:m}).from("points").select(s,{index:j`x + y * ${i}::INTEGER`,density:a?Fr("w"):Zn()}).groupby("index",s)}var Nh=class extends ln{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"?M6:T6),this.dim=a,this.bins=Ve(i,c=>(this.bins=c,this.requestUpdate())),this.bandwidth=Ve(o,c=>(this.bandwidth=c,this.grid?this.convolve().update():null))}get filterIndexable(){let t=this.dim==="x"?"xDomain":"yDomain",n=this.plot.getAttribute(t);return n&&!n[Mn]}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"?es:ns)(this,t),[a,c]=Hr(this,i,n,s),l=rg(r,o,[i]).where(t.concat(We(c,s))),u=this.channelField("weight")?"weight":null;return Irt(l,a,u)}queryResult(t){let{columns:{index:n,density:r}}=Sr(t);return this.grid=PU(this.bins,n,r),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=sg(n*(t-1)/l,c),f=av(u,i,t),h=r==="x"?"y":"x",d=this.channelField(r).as,p=+s,m=(a-p)/(t-1),y=1/m,g=new Float64Array(t),x=new Float64Array(t);for(let b=0;b<t;++b)g[b]=p+b*m,x[b]=f[b]*y;return this.data={numRows:t,columns:{[d]:g,[h]:x}},this}plotSpecs(){let{type:t,data:{numRows:n,columns:r},channels:i,dim:o}=this,s=o==="x"?{y:r.y}:{x:r.x};for(let a of i)s[a.channel]=Xn(a,r);return[{type:t,data:{length:n},options:s}]}};function Irt(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 dt.from(dt.unionAll(i,o)).select({index:"i",density:Fr("w")}).groupby("index").having(ip("density",0))}var fg=class extends Wi{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=Ql(this,"x"),c=Ql(this,"y"),[l,u]=r.map(y=>a.apply(y)),[f,h]=i.map(y=>c.apply(y)),d=(u-l)/(o-n),p=(h-f)/(s-n),m=n?0:.5;return this.data=Art(this.grids,t,l,f,d,p,a.invert,c.invert,m),this}plotSpecs(){let{type:t,channels:n,densityMap:r,data:{numRows:i,columns:o}}=this,s={};for(let a of n){let{channel:c}=a;s[c]=c==="x"||c==="y"?o[c]:Xn(a,o)}for(let a in r)r[a]&&(s[a]=o.density);return[{type:t,data:{length:i},options:s}]}};function Art(e,t,n,r,i,o,s,a,c){let l=1/(i*o),[u,f]=t,h=u*f,d=h*e.numRows,p=new Float64Array(d),m=new Float64Array(d),y=new Float64Array(d),g={x:p,y:m,density:y},{density:x,...b}=e.columns;for(let v in b)g[v]=new b[v].constructor(d);let w=0;for(let v=0;v<e.numRows;++v){for(let A in b)g[A].fill(b[A][v],w,w+h);let _=x[v];for(let A=0,E=0;E<f;++E)for(let T=0;T<u;++T,++w,++A)p[w]=s(n+(T+c)*i),m[w]=a(r+(E+c)*o),y[w]=_[A]*l}return{numRows:d,columns:g}}function Mrt(e,t,n){var r=1e-8,i=t-1,o=n-1,s=0,a,c,l,u,f,h,d,p,m,y,g;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&n>=1?(l=e<.5?e:1-e,u=Math.sqrt(-2*Math.log(l)),d=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(d=-d),p=(d*d-3)/6,m=2/(1/(2*t-1)+1/(2*n-1)),y=d*Math.sqrt(p+m)/m-(1/(2*n-1)-1/(2*t-1))*(p+5/6-2/(3*m)),d=t/(t+n*Math.exp(2*y))):(a=Math.log(t/(t+n)),c=Math.log(n/(t+n)),u=Math.exp(t*a)/t,f=Math.exp(n*c)/n,y=u+f,e<u/y?d=Math.pow(t*y*e,1/t):d=1-Math.pow(n*y*(1-e),1/n)),g=-Dh(t)-Dh(n)+Dh(t+n);s<10;s++){if(d===0||d===1)return d;if(h=Trt(d,t,n)-e,u=Math.exp(i*Math.log(d)+o*Math.log(1-d)+g),f=h/u,d-=u=f/(1-.5*Math.min(1,f*(i/d-o/(1-d)))),d<=0&&(d=.5*(d+u)),d>=1&&(d=.5*(d+u+1)),Math.abs(u)<r*d&&s>0)break}return d}function Trt(e,t,n){var r=e===0||e===1?0:Math.exp(Dh(t+n)-Dh(t)-Dh(n)+t*Math.log(e)+n*Math.log(1-e));return e<0||e>1?0:e<(t+1)/(t+n+2)?r*WU(e,t,n)/t:1-r*WU(1-e,n,t)/n}function WU(e,t,n){var r=1e-30,i=1,o=t+n,s=t+1,a=t-1,c=1,l=1-o*e/s,u,f,h,d;for(Math.abs(l)<r&&(l=r),l=1/l,d=l;i<=100&&(u=2*i,f=i*(n-i)*e/((a+u)*(t+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,d*=l*c,f=-(t+i)*(o+i)*e/((t+u)*(s+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,h=l*c,d*=h,!(Math.abs(h-1)<3e-7));i++);return d}function Dh(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 HU(e,t){var n=Mrt(2*Math.min(e,1-e),.5*t,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}function ZU(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}var Oh=class extends ln{constructor(t,n,r){let i=t.endsWith("X")?"y":"x",{ci:o=.95,...s}=r;super(t,n,s),this.dim=i,this.field=this.channelField(i).field,this.channels=this.channels.filter(a=>a.channel!==i),this.ci=Ve(o,a=>(this.ci=a,this.update()))}query(t=[]){let{channels:n,field:r,source:{table:i}}=this,o=n.concat([{field:sp(r),as:"__avg__"},{field:Zn(r),as:"__n__"},{field:ap(r),as:"__sd__"}]);return rg(o,i).where(t)}queryResult(t){return this.data=Sr(t),this}plotSpecs(){let{type:t,dim:n,detail:r,data:i,ci:o,channels:s}=this,a=Math.SQRT2*ZU(o),{columns:{__avg__:c,__sd__:l,__n__:u}}=i,f={[`${n}1`]:c.map((h,d)=>h-a*l[d]/Math.sqrt(u[d])),[`${n}2`]:c.map((h,d)=>h+a*l[d]/Math.sqrt(u[d]))};return A6(t,r,s,i,f)}};var Ert="geom",hg=class extends ln{constructor(t,n={},r){!ov(t)&&!n?.geometry&&(n.geometry=lp(Ert)),super("geo",t,n,r)}queryResult(t){super.queryResult(t);let n=this.channelField("geometry")?.as;if(n){let{columns:r}=this.data;typeof r[n][0]=="string"&&(r[n]=r[n].map(i=>JSON.parse(i)))}return this}};var dg=class extends ln{constructor(t,n){let{type:r="hexagon",binWidth:i=20,...o}=n;super(r,t,{r:i/2,clip:!0,...o},sv),this.binWidth=Ve(i,s=>(this.binWidth=s,this.requestUpdate()))}get filterIndexable(){let t=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return t&&n&&!t[Mn]&&!n[Mn]}query(t=[]){if(this.hasOwnData())return null;let{plot:n,binWidth:r,channels:i,source:o}=this,s,a,c=new Set,l={};for(let w of i)if(w.channel!=="orderby"){if(w.channel==="x")s=w;else if(w.channel==="y")a=w;else if(Object.hasOwn(w,"field")){let{as:v,field:_}=w;l[v]=_,_.aggregate||c.add(v)}}let[u,f]=es(this,t),[h,d]=ns(this,t),p=.5-n.getAttribute("marginLeft"),m=0-n.getAttribute("marginTop"),y=`${r}::DOUBLE`,g=`${r*(1.5/Math.sqrt(3))}::DOUBLE`,x=`${n.innerWidth()/(f-u)}::DOUBLE`,b=`${n.innerHeight()/(d-h)}::DOUBLE`;return dt.select({[s.as]:j`${u}::DOUBLE + ((_x + 0.5 * (_y & 1)) * ${y} + ${p})::DOUBLE / ${x}`,[a.as]:j`${d}::DOUBLE - (_y * ${g} + ${m})::DOUBLE / ${b}`,...l}).groupby("_x","_y",...c).from(dt.select({_py:j`(${b} * (${d}::DOUBLE - ${a.field}) - ${m}) / ${g}`,_pj:j`ROUND(_py)::INTEGER`,_px:j`(${x} * (${s.field} - ${u}::DOUBLE) - ${p}) / ${y} - 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`},"*").from(o.table).where(Ss(s.field),Ss(a.field),t))}};var pg=class extends Wi{constructor(t,n){let{origin:r=[0,0],dim:i="xy",...o}=n;super("image",t,o),this.image=null,this.origin=r,this.tileX=i.toLowerCase().includes("x"),this.tileY=i.toLowerCase().includes("y")}setPlot(t,n){let r=()=>{this.hasFieldInfo()&&this.rasterize()};t.addAttributeListener("schemeColor",r),super.setPlot(t,n)}requestQuery(){return this.requestTiles()}query(t=[]){return this._filter=t,null}tileQuery(t){let{interpolate:n,pad:r,channels:i,densityMap:o,source:s}=this,[[a,c],[l,u]]=t,[f,h]=this.bins,[d,p]=Hr(this,"x",f,[a,c],r),[m,y]=Hr(this,"y",h,[l,u],r),g=r?[We(p,[+a,+c]),We(y,[+l,+u])]:[As(+a,p),Is(p,+c),As(+l,y),Is(y,+u)],x=dt.from(s.table).where(g),b=this.groupby=[],w={};for(let _ of i)if(Object.hasOwn(_,"field")){let{as:A,channel:E,field:T}=_;T.aggregate?(w[E]=T,o[E]=!0):E==="weight"?w.density=Fr(T):E!=="x"&&E!=="y"&&(x.select({[A]:T}),b.push(A))}let v=this.aggr=Object.keys(w);if(w.density&&v.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(v.length||(v.push("density"),w.density=Zn()),n==="linear"){if(v.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!w.density)throw new Error("Linear binning not applicable to custom aggregates.");return Lrt(x,d,m,w.density,f,b)}else return Brt(x,d,m,w,f,b)}async requestTiles(){let t=ai();this.prefetch&&t.cancel(this.prefetch);let{pad:n,tileX:r,tileY:i,origin:[o,s]}=this,[a,c]=this.bins=this.binDimensions(),[l,u]=es(this,this._filter),[f,h]=ns(this,this._filter),d=u-l,p=h-f,m=Math.floor((l-o)*(a-n)/d),y=Math.floor((f-s)*(c-n)/p),g=(I,O)=>[[o+I*d,o+(I+1)*d],[s+O*p,s+(O+1)*p]],x=Math.floor((l-o)/d),b=r?JU((u-o)/d):x,w=Math.floor((f-s)/p),v=i?JU((h-s)/p):w,_=[];for(let I=x;I<=b;++I)for(let O=w;O<=v;++O)_.push([I,O]);let A=_.map(([I,O])=>t.query(this.tileQuery(g(I,O)))),E=[];if(r)for(let I=w;I<=v;++I)E.push([b+1,I]),E.push([x-1,I]);if(i){let I=r?x-1:x,O=r?b+1:b;for(let L=I;L<=O;++L)E.push([L,v+1]),E.push([L,w-1])}this.prefetch=E.map(([I,O])=>t.prefetch(this.tileQuery(g(I,O))));let T=await Promise.all(A),D=Nrt(a,c,m,y,_,T);this.grids0={numRows:D.length,columns:{density:[D]}},this.convolve().update()}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:t,grids:n}=this,[r,i]=t,{numRows:o,columns:s}=n,{canvas:a,ctx:c,img:l}=Ort(this,r,i),{alpha:u,alphaProp:f,color:h,colorProp:d}=N6(this),p=s[f]??[],m=s[d]??[],y=o>1&&d&&this.groupby?.includes(d)?cv(m,this.plot.getAttribute("colorDomain")):cg(o);return this.data={numRows:o,columns:{src:Array.from({length:o},(g,x)=>(h?.(l.data,r,i,m[y[x]]),u?.(l.data,r,i,p[y[x]]),c.putImageData(l,0,0),a.toDataURL()))}},this}plotSpecs(){let{type:t,plot:n,data:{numRows:r,columns:i}}=this,o={src:i.src,width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:t,data:{length:r},options:o}]}};function Nrt(e,t,n,r,i,o){let s=new Float64Array(e*t);return o.forEach((a,c)=>{let[l,u]=i[c],f=l*e-n,h=u*t-r;Drt(e,t,s,a,f,h)}),s}function Drt(e,t,n,r,i,o){let s=r.numRows;if(s===0)return;let a=r.getChild("index").toArray(),c=r.getChild("density").toArray();for(let l=0;l<s;++l){let u=a[l],f=i+u%e,h=o+Math.floor(u/e);0<=f&&f<e&&0<=h&&h<t&&(n[f+h*e]=c[l])}}function Ort(e,t,n){if(!e.image||e.image.w!==t||e.image.h!==n){let r=lv(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 Brt(e,t,n,r,i,o){return e.select({index:j`FLOOR(${t})::INTEGER + FLOOR(${n})::INTEGER * ${i}`,...r}).groupby("index",o)}function Lrt(e,t,n,r,i,o){let s=r.column?`* ${r.column}`:"",a=(h,d)=>e.clone().select({xp:t,yp:n,i:h,w:d}),c=a(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 dt.from(dt.unionAll(c,l,u,f)).select({index:"i",density:Fr("w")},o).groupby("index",o).having(Gc("density",0))}function JU(e){let t=Math.floor(e);return t===e?t-1:t}var mg=class extends ln{constructor(t,n){let{ci:r=.95,precision:i=4,...o}=n;super("line",t,o);let s=()=>this.modelFit?this.confidenceBand().update():null;this.ci=Ve(r,a=>(this.ci=a,s())),this.precision=Ve(i,a=>(this.precision=a,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 dt.from(super.query(t)).select({intercept:jS(r,n),slope:VS(r,n),n:YS(r,n),ssy:XS(r,n),ssx:GS(r,n),xm:WS(r,n),x0:Fu(si(n).where(Ss(r))),x1:Fu(oi(n).where(Ss(r)))}).select(i).groupby(i)}queryResult(t){return this.modelFit=Sr(t),this.lineData=Crt(this.modelFit),this.confidenceBand()}confidenceBand(){let{ci:t,modelFit:n,precision:r,plot:i}=this,o=i.innerWidth();return this.areaData=t?krt(n,t,r,o):null,this}plotSpecs(){let{lineData:t,areaData:n,channels:r,ci:i}=this,o=t.columns,s=i?n.columns:{},a={x:o.x,y:o.y},c={x:s.x,y1:s.y1,y2:s.y2,fillOpacity:.1};for(let l of r)switch(l.channel){case"x":case"y":case"fill":break;case"tip":c.tip=Xn(l,s);break;case"stroke":a.stroke=Xn(l,o),c.fill=Xn(l,s);break;case"strokeOpacity":a.strokeOpacity=Xn(l,o);break;case"fillOpacity":c.fillOpacity=Xn(l,s);break;default:a[l.channel]=Xn(l,o),c[l.channel]=Xn(l,s);break}return[...i?[{type:"areaY",data:{length:n.numRows},options:c}]:[],{type:"line",data:{length:t.numRows},options:a}]}};function D6(e,t){if(e.concat)return e.concat(t);let n=new e.constructor(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}function Crt(e){let{x0:t=[],x1:n=[],xm:r,intercept:i,slope:o,n:s,ssx:a,ssy:c,...l}=e.columns,u=(d,p)=>i[p]+d*o[p],f=D6(t,n),h=D6(t.map(u),n.map(u));for(let d in l)l[d]=D6(l[d],l[d]);return{numRows:f.length,columns:{x:f,y:h,...l}}}function krt(e,t,n,r){let i=e.numRows,{x0:o,x1:s,xm:a,intercept:c,slope:l,n:u,ssx:f,ssy:h,...d}=e.columns,p=Object.keys(d),m={x:[],y1:[],y2:[]};p.forEach(y=>m[y]=[]);for(let y=0;y<i;++y){let g=n*(s[y]-o[y])/r,x=HU((1-t)/2,u[y]-2)*Math.sqrt(h[y]/(u[y]-2));Ue(o[y],s[y]-g/2,g).concat(s[y]).forEach(b=>{let w=c[y]+b*l[y],v=x*Math.sqrt(1/u[y]+(b-a[y])**2/f[y]);m.x.push(b),m.y1.push(w-v),m.y2.push(w+v),p.forEach(_=>m[_].push(d[_][y]))})}return{numRows:m.x.length,columns:m}}function QU(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 Bh(e){let t={};for(let n in e)t[QU(n)]=e[n];return t}function Rrt(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 yg=class{constructor(t,{selection:n,channels:r={}}){this.mark=Rrt(t),this.selection=n;let i=Object.entries(Bh(r));this.channels=i.length?i:[["opacity",.2]],this.selection.addEventListener("value",Yh(()=>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 Frt(o,s);for(let c=0;c<n.length;++c){let l=n[c],u=i[c],f=l.__data__,h=a(Array.isArray(f)?f[0]:f);for(let d=0;d<r.length;++d){let[p,m]=r[d];l.setAttribute(p,h?u[d]:m)}}}};async function Frt(e,t){let n=t?.predicate(e);if(!n||n.length===0)return()=>!0;let r=e.filterBy?.predicate(e,!0),i={__:_r(n)},o=e.query(r);(o.queries||[o]).forEach(c=>{c.groupby().length?c.select(i):c.$select(i)});let s=await e.coordinator.query(o),a=s.getChild?.("__");return s.numRows||s.length?a?c=>a.get(c):c=>s[c].__:()=>!1}function O6(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 KU(){return O6(lA())}function tz(){return O6(aA())}function ez(){return O6(cA())}function gg(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 rs(e,t){let n=e.channelField(t)?.field;return n?.basis||n}function xg(e,t,n=1){return t.invert(n*Math.floor(e/n))}function uv(){let e=this,t=e.getScreenCTM,n;e.getScreenCTM=()=>e.isConnected?n=t.call(e):n}var _c=class{constructor(t,{channel:n,selection:r,field:i=void 0,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||rs(t,n),this.style=a&&Bh(a),this.brush=n==="y"?ez():tz(),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=>xg(r,this.scale,this.pixelSize)).sort((r,i)=>r-i)),gg(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 Kc(i,t,{source:this,clients:this.peers?n.plot.markSet:new Set().add(n),scale:o,pixelSize:r})}init(t,n){let{brush:r,channel:i,style:o}=this;this.scale=t.scale(i);let s=t.scale("x").range,a=t.scale("y").range;r.extent([[he(s),he(a)],[Jt(s),Jt(a)]]);let c=this.value?.map(this.scale.apply).sort(Ot),l=Yt(t).selectAll('g[aria-label="facet"]');if(n=l.size()?l:Yt(n??t),this.g=n.append("g").attr("class",`interval-${i}`).each(uv).call(r).call(r.moveSilent,c),o){let u=this.g.selectAll("rect.selection");for(let f in o)u.attr(f,o[f])}t.addEventListener("pointerenter",u=>{u.buttons||this.activate()})}};var bg=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||rs(t,"x"),this.yfield=i||rs(t,"y"),this.style=a&&Bh(a),this.brush=KU(),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=>xg(u,i,r)).sort(Ot),a=[c[1],l[1]].map(u=>xg(u,o,r)).sort(Ot)}(!gg(s,n?.[0])||!gg(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 SI([i,o],t,{source:this,clients:this.peers?n.plot.markSet:new Set().add(n),scales:[s,a],pixelSize:r})}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([[he(s),he(a)],[Jt(s),Jt(a)]]);let c=Yt(t).selectAll('g[aria-label="facet"]'),l=c.size()?c:Yt(t);if(this.g=l.append("g").attr("class","interval-xy").each(uv).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(Ot),[h,d]=this.value[1].map(o.apply).sort(Ot);this.g.call(n.moveSilent,[[u,h],[f,d]])}t.addEventListener("pointerenter",u=>{u.buttons||this.activate()})}};var Kl=class{constructor(t,{selection:n,pointer:r,channels:i,fields:o,maxRadius:s=40}){this.mark=t,this.selection=n,this.clients=new Set().add(t),this.pointer=r,this.channels=i||(r==="x"?["x"]:r==="y"?["y"]:["x","y"]),this.fields=o||this.channels.map(a=>rs(t,[a])),this.maxRadius=s,this.valueIndex=-1}clause(t){let{clients:n,fields:r}=this;return Qc(r,t&&[t],{source:this,clients:n})}init(t){let n=this,{mark:r,channels:i,selection:o,maxRadius:s}=this,{data:{columns:a}}=r,c=i.map(x=>r.channelField(x).as),l=!$r(o),u=Yt(t).selectAll('g[aria-label="facet"]'),f=u.size()?u:Yt(t),h=t.scale("x").apply,d=t.scale("y").apply,p=Array.from(a[r.channelField("x").as],h),m=Array.from(a[r.channelField("y").as],d),y=this.pointer==="y"?.01:1,g=this.pointer==="x"?.01:1;f.on("pointerenter pointerdown pointermove",function(x){let[b,w]=Fn(x,this),v=$rt(p,m,b,w,y,g,s);if(v!==this.valueIndex){this.valueIndex=v;let _=v<0?void 0:c.map(A=>a[A][v]);l?v>-1&&o.update(_.length>1?_:_[0]):o.update(n.clause(_))}}),!l&&(f.on("pointerleave",()=>{o.update(n.clause(void 0))}),t.addEventListener("pointerenter",x=>{if(!x.buttons){let b=this.channels.map(()=>0);o.activate(this.clause(b))}}))}};function $rt(e,t,n,r,i,o,s){let a=s*s,c=-1;for(let l=0;l<e.length;++l){let u=i*(e[l]-n),f=o*(t[l]-r),h=u*u+f*f;h<=a&&(a=h,c=l)}return c}var nz=(e,t)=>e-t,wg=class{constructor(t,{x:n=new Ms,y:r=new Ms,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||rs(t,"x"),this.yfield=o||rs(t,"y"),this.zoom=B6(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=Prt(t,this.xscale);this.xsel.update(this.clause(n,this.xfield,this.xscale))}if(this.pany){let n=Urt(t,this.yscale);this.ysel.update(this.clause(n,this.yfield,this.yscale))}}clause(t,n,r){return Kc(n,t,{source:this,clients:this.mark.plot.markSet,scale:r})}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(nz),c=this.yscale.range.slice().sort(nz),l=B6(n,[-1/0,1/0],a),u=B6(r,[-1/0,1/0],c),f=M3().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 Vr(1,0,0)).on("zoom",({transform:h})=>this.publish(h));if(Yt(i).call(f),n||r){let h=!1;i.addEventListener("pointerenter",d=>{if(!h&&(h=!0,!d.buttons)){if(n){let{xscale:p,xfield:m}=this;o.activate(this.clause(p.domain,m,p))}if(r){let{yscale:p,yfield:m}=this;s.activate(this.clause(p.domain,m,p))}}}),i.addEventListener("pointerleave",()=>h=!1)}}};function B6(e,t,n){return e?Array.isArray(e)?e:t:n}function Prt(e,t){return t.range.map(e.invertX,e).map(t.invert,t)}function Urt(e,t){return t.range.map(e.invertY,e).map(t.invert,t)}var tu=class{constructor(t,{selection:n,channels:r,peers:i=!0}){this.value=null,this.mark=t,this.selection=n,this.peers=i;let o=this.fields=[],s=this.as=[];r.forEach(a=>{let c=a==="color"?["color","fill","stroke"]:a==="x"?["x","x1","x2"]:a==="y"?["y","y1","y2"]:[a];for(let l=0;l<c.length;++l){let u=t.channelField(c[l],{exact:!0});if(u){o.push(u.field?.basis||u.field),s.push(u.as);return}}throw new Error(`Missing channel: ${a}`)})}clause(t){let{fields:n,mark:r}=this;return Qc(n,t,{source:this,clients:this.peers?r.plot.markSet:new Set().add(r)})}init(t,n,r){let{mark:i,as:o,selection:s}=this,{data:{columns:a={}}={}}=i;r??=l=>o.map(u=>{let f=l.__data__;return a[u][Array.isArray(f)?f[0]:f]}),n??=`[data-index="${i.index}"]`;let c=new Set(t.querySelectorAll(n));t.addEventListener("pointerdown",l=>{let u=s.single?s.value:this.value,f=l.target,h=null;if(zrt(c,f)){let d=r(f);(l.shiftKey||l.metaKey)&&u?.length?(h=u.filter(p=>L6(p,d)),h.length===u.length&&h.push(d)):u?.length===1&&!L6(u[0],d)?h=null:h=[d]}this.value=h,qrt(u,h)&&s.update(this.clause(h))}),t.addEventListener("pointerenter",l=>{l.buttons||this.selection.activate(this.clause([this.fields.map(()=>0)]))})}};function zrt(e,t){return e.has(t)||e.has(t.parentNode)||e.has(t.parentNode?.parentNode)}function qrt(e,t){return e==null||t==null?e!=null||t!=null:e.length!==t.length||e.some((n,r)=>L6(n,t[r]))}function L6(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 iz=":scope > div, :scope > span",fv="swatch",rz="ramp",Lh=class{constructor(t,n){let{as:r,field:i,...o}=n;this.channel=t,this.options=o,this.type=null,this.handler=null,this.selection=r,this.field=i,this.legend=null,this.element=document.createElement("div"),this.element.setAttribute("class","legend"),Object.defineProperty(this.element,"value",{value:this})}setPlot(t){this.plot=t}init(t){let n=jrt(this,t);return this.element.replaceChildren(n),this.element}update(){if(!this.legend)return;let{selection:t,handler:n}=this,{single:r,value:i}=t,o=r?i:t.valueFor(n),s=o&&o.length?new Set(o.map(c=>c[0])):null,a=this.legend.querySelectorAll(iz);for(let c of a){let l=s?s.has(c.__data__):!0;c.style.opacity=l?1:.2}}};function jrt(e,t){let{channel:n,plot:r,selection:i}=e,o=t.scale(n),s=o.type==="ordinal"?fv:rz,a={label:r.getAttribute(`${n}Label`)??null,...e.options},c=s===fv?a:a.label?{tickSize:2,...a}:{tickSize:2,marginTop:1,height:29,...a},l=t.legend(n,c);e.legend=l;let u=!!i;if(u&&s===rz){let f=c.width??240,h=Grt(o,f);h?l.scale=function(d){return d==="x"?{range:[0,f]}:d==="y"?{range:[-10,0]}:d===n?h:void 0}:u=!1}if(u){let f=Vrt(e,s);s===fv?(f.init(l,iz,h=>[h.__data__]),e.update()):f.init(l,l.querySelector("g:last-of-type"))}return l}function Vrt(e,t){let{channel:n,handler:r,selection:i}=e;if(r)return r;let o=Yrt(e);return t===fv?(e.handler=new tu(o,{selection:i,channels:[n],peers:!1}),i.addEventListener("value",()=>e.update())):e.handler=new _c(o,{selection:i,channel:n,brush:{fill:"none",stroke:"currentColor"},peers:!1}),e.handler}function Yrt(e){let{channel:t,plot:n}=e,r=e.field??Xrt(n.marks,t)??"value";if(r){let i={field:r};return{plot:n,channelField:o=>t===o?i:void 0}}}function Xrt(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)for(let i of n){let o=e[r].channelField(i,{exact:!0});if(o)return o.field}return null}function Grt(e,t){let{apply:n,invert:r,interpolate:i,...o}=e,s=e.type;s.startsWith("diverging-")&&(s=s.slice(11));let a;switch(s){case"log":case"pow":case"sqrt":case"symlog":a=s;break;case"threshold":case"quantize":case"quantile":return console.warn(`Legends do not yet support ${s} scales.`),null;default:a="linear"}return rc({x:{...o,type:a,range:[0,t]}})}function hv(e,t,n=0,r=Math.LN10){let i,o=Math.ceil(Math.log(t)/r),s=Math.max(n,Math.pow(10,Math.round(Math.log(e)/r)-o));for(;Math.ceil(e/s)>t;)s*=10;let a=[5,2];for(let c=0,l=a.length;c<l;++c)i=s/a[c],i>=n&&e/i<=t&&(s=i);return s}function oz(e,t,n){let{step:r,steps:i,minstep:o=0,nice:s=!0}=n;if(s!==!1){let a=t-e,c=Math.LN10;r=r||hv(a,i||25,o,c);let l=Math.log(r),u=l>=0?0:~~(-l/c)+1,f=Math.pow(10,-u-1);l=Math.floor(e/r+f)*r,e=e<l?l-r:l,t=Math.ceil(t/r)*r,i=Math.round((t-e)/r)}return{min:e,max:t,steps:i}}var lz="year",sz="month",az="day",dv="hour",pv="minute",mv="second",Wrt="millisecond",vg=1e3,Sg=vg*60,Ig=Sg*60,yv=Ig*24,Hrt=yv*7,cz=yv*30,Zrt=yv*365,_g=[[mv,1,vg],[mv,5,5*vg],[mv,15,15*vg],[mv,30,30*vg],[pv,1,Sg],[pv,5,5*Sg],[pv,15,15*Sg],[pv,30,30*Sg],[dv,1,Ig],[dv,3,3*Ig],[dv,6,6*Ig],[dv,12,12*Ig],[az,1,yv],[az,7,Hrt],[sz,1,cz],[sz,3,3*cz],[lz,1,Zrt]];function uz(e,t,n){let r=t-e,i=r/n,o=Pi(s=>s[2]).right(_g,i);return o===_g.length?{interval:lz,step:hv(r,n)}:o?(o=_g[i/_g[o-1][2]<_g[o][2]/i?o-1:o],{interval:o[0],step:o[1]}):{interval:Wrt,step:hv(r,n,1)}}var Jrt=new Set(["rectY-x","rectX-y","rect-x","rect-y","ruleY-x","ruleX-y"]);function Qrt(e,t){return Jrt.has(`${e.type}-${t}`)}function gv(e,t={}){let n=(r,i)=>Qrt(r,i)?{[`${i}1`]:C6(r,i,e,t),[`${i}2`]:C6(r,i,e,{...t,offset:1})}:{[i]:C6(r,i,e,t)};return n[bp]=!0,n}function C6(e,t,n,r){return{column:n,label:n,get columns(){return[n]},get basis(){return n},get stats(){return{column:n,stats:["min","max"]}},toString(){let{type:i,min:o,max:s}=e.channelField(t),{interval:a,steps:c,offset:l=0}=r,u=a??(i==="date"||Krt(e,t)?"date":"number");if(u==="number"){let{apply:f,sqlApply:h,sqlInvert:d}=Ql(e,t),p=oz(f(o),f(s),r),m=h(n),y=p.min===0?m:`(${m} - ${p.min})`,g=`${(p.max-p.min)/p.steps}::DOUBLE`,x=l?`${l} + `:"",b=`${p.min} + ${g} * (${x}FLOOR(${y} / ${g}))`;return`${d(b)}`}else{let{interval:f,step:h=1}=u==="date"?uz(o,s,c||40):r,d=l?` + INTERVAL ${l*h} ${f}`:"";return`(${eI(n,f,h)}${d})`}}}}function Krt(e,t){let n=e.plot.getAttribute(`${t}Scale`);return n==="utc"||n==="time"}var tit=e=>e&&typeof e=="object"&&!Array.isArray(e);var Ag=class extends hr{constructor({element:t,filterBy:n,from:r,column:i,label:o=i,format:s=f=>f,options:a,value:c,field:l=i,as:u}={}){super(n),this.from=r,this.column=i,this.format=s,this.field=l;let f=this.selection=u;this.element=t??document.createElement("div"),this.element.setAttribute("class","input"),Object.defineProperty(this.element,"value",{value:this});let h=document.createElement("label");if(h.innerText=o||i,this.element.appendChild(h),this.select=document.createElement("select"),this.element.appendChild(this.select),a&&(this.data=a.map(d=>tit(d)?d:{value:d}),this.selectedValue(c??""),this.update()),f){let d=!$r(f);c!=null&&(!d||f.value===void 0)&&this.publish(c),this.select.addEventListener("input",()=>{this.publish(this.selectedValue()??null)}),d&&this.selection.addEventListener("value",p=>{p!==this.select.value&&this.selectedValue(p)})}}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,field:r}=this;if($r(n)){t===""&&(t=void 0);let i=xp(r,t,{source:this});n.update(i)}else vr(n)&&n.update(t)}query(t=[]){let{from:n,column:r}=this;return n?dt.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,selection:i}=this;r.replaceChildren();for(let{value:o,label:s}of t){let a=document.createElement("option");a.setAttribute("value",o),a.innerText=s??n(o),this.select.appendChild(a)}if(i){let o=$r(i)?i.valueFor(this):i.value;this.selectedValue(o??"")}return this}};var eit=0;var Mg=class extends hr{constructor({element:t,filterBy:n,from:r,column:i,label:o,type:s="contains",field:a=i,as:c}={}){if(super(n),this.id="search_"+ ++eit,this.type=s,this.from=r,this.column=i,this.selection=c,this.field=a,this.element=t??document.createElement("div"),this.element.setAttribute("class","input"),Object.defineProperty(this.element,"value",{value:this}),o){let l=document.createElement("label");l.setAttribute("for",this.id),l.innerText=o,this.element.appendChild(l)}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)}),$r(this.selection)||this.selection.addEventListener("value",l=>{l!==this.searchbox.value&&(this.searchbox.value=l)}))}reset(){this.searchbox.value=""}publish(t){let{selection:n,field:r,type:i}=this;if($r(n)){let o=II(r,t,{source:this,method:i});n.update(o)}else vr(n)&&n.update(t)}query(t=[]){let{from:n,column:r}=this;return n?dt.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 nit=0;var Tg=class extends hr{constructor({element:t,filterBy:n,as:r,min:i,max:o,step:s,from:a,column:c,label:l=c,value:u=r?.value,select:f="point",field:h=c,width:d}={}){if(super(n),this.id="slider_"+ ++nit,this.from=a,this.column=c||"value",this.selection=r,this.selectionType=f,this.field=h,this.min=i,this.max=o,this.step=s,this.element=t||document.createElement("div"),this.element.setAttribute("class","input"),Object.defineProperty(this.element,"value",{value:this}),l){let p=document.createElement("label");p.setAttribute("for",this.id),p.innerText=l,this.element.appendChild(p)}this.slider=document.createElement("input"),this.slider.setAttribute("id",this.id),this.slider.setAttribute("type","range"),d!=null&&(this.slider.style.width=`${+d}px`),i!=null&&this.slider.setAttribute("min",`${i}`),o!=null&&this.slider.setAttribute("max",`${o}`),s!=null&&this.slider.setAttribute("step",`${s}`),this.element.appendChild(this.slider),this.curval=document.createElement("label"),this.curval.setAttribute("for",this.id),this.curval.setAttribute("class","value"),this.element.appendChild(this.curval),u!=null&&(this.slider.setAttribute("value",`${u}`),this.selection?.value===void 0&&this.publish(u)),this.curval.innerText=this.slider.value,this.slider.addEventListener("input",()=>{let{value:p}=this.slider;this.curval.innerText=p,this.selection&&this.publish(+p)}),this.selection&&!$r(this.selection)&&this.selection.addEventListener("value",p=>{p!==+this.slider.value&&(this.slider.value=p,this.curval.innerText=p)})}query(t=[]){let{from:n,column:r}=this;return!n||this.min!=null&&this.max!=null?null:dt.select({min:si(r),max:oi(r)}).from(n).where(t)}queryResult(t){let{min:n,max:r}=Array.from(t)[0];return this.min==null&&(this.min=n,this.slider.setAttribute("min",`${n}`)),this.max==null&&(this.max=r,this.slider.setAttribute("max",`${r}`)),this.step==null&&(this.step=(r-n)/500,this.slider.setAttribute("step",`${this.step}`)),this}publish(t){let{field:n,selectionType:r,selection:i}=this;if($r(i))if(r==="interval"){let o=[this.min??0,t];i.update(Kc(n,o,{source:this,bin:"ceil",scale:{type:"identity",domain:o},pixelSize:this.step}))}else i.update(xp(n,t,{source:this}));else vr(this.selection)&&i.update(t)}};var R6=fz(e=>{let t=xv(e);return n=>n==null?"":typeof n=="number"?t(n):n instanceof Date?F6(n):`${n}`}),xv=fz(e=>t=>t===0?"0":t.toLocaleString(e)),VYt=R6(),YYt=xv();function F6(e){return Lf(e,"Invalid Date")}function fz(e){let t=null,n;return(r="en")=>r===t?n:n=e(t=r)}var rit=-1;var Eg=class extends hr{constructor({element:t,filterBy:n,from:r,columns:i=["*"],align:o={},format:s,width:a,maxWidth:c,height:l=500,rowBatch:u=100,as:f}={}){super(n),this.id=`table-${++rit}`,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.selection=f,this.currentRow=-1,this.sortHeader=null,this.sortColumn=null,this.sortDesc=!1,this.element=t||document.createElement("div"),this.element.setAttribute("id",this.id),Object.defineProperty(this.element,"value",{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 h=-1;this.element.addEventListener("scroll",d=>{let{pending:p,loaded:m}=this,{scrollHeight:y,scrollTop:g,clientHeight:x}=d.target,b=g<h;h=g,!(b||p||m)&&y-g<2*x&&(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.selection&&(this.body.addEventListener("pointerover",d=>{let p=iit(d.target);p>-1&&p!==this.currentRow&&(this.currentRow=p,this.selection.update(this.clause([p])))}),this.body.addEventListener("pointerleave",()=>{this.currentRow=-1,this.selection.update(this.clause())})),this.style=document.createElement("style"),this.element.appendChild(this.style)}clause(t=[]){let{data:n,limit:r,schema:i}=this,o=i.map(a=>a.column),s=t.map(a=>{let{columns:c}=n[~~(a/r)];return o.map(l=>c[l][a%r])});return Qc(o,s,{source:this})}requestData(t=0){this.offset=t;let n=this.query(this.filterBy?.predicate(this));this.requestQuery(n),ai().prefetch(n.clone().offset(t+this.limit))}fields(){return this.columns.map(t=>Ma(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=oit(this.format,t),this.style.innerText=cit(this.id,sit(this.align,t),ait(this.widths,t)),this}query(t=[]){let{from:n,limit:r,offset:i,schema:o,sortColumn:s,sortDesc:a}=this;return dt.from(n).select(o.map(c=>c.column)).where(t).orderby(s?a?aS(s):s:[]).limit(r).offset(i)}queryResult(t){return this.pending||(this.loaded=!1,this.data=[],this.body.replaceChildren(),this.offset=0),this.data.push(Sr(t)),this}update(){let{body:t,formats:n,data:r,schema:i,limit:o}=this,s=i.length,a=r.length-1,c=o*a,{numRows:l,columns:u}=r[a],f=i.map(h=>u[h.column]);for(let h=0;h<l;++h){let d=document.createElement("tr");Object.assign(d,{__row__:c+h});for(let p=0;p<s;++p){let m=f[p][h],y=document.createElement("td");y.innerText=m==null?"":n[p](m),d.appendChild(y)}t.appendChild(d)}return l<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 iit(e){let t=e.parentElement;return Object.hasOwn(t,"__row__")?+t.__row__:-1}function oit(e={},t,n){return t.map(({column:r,type:i})=>{if(r in e)return e[r];switch(i){case"number":return xv(n);case"date":return F6;default:return R6(n)}})}function sit(e={},t){return t.map(({column:n,type:r})=>n in e?e[n]:r==="number"?"right":"left")}function ait(e={},t){return t.map(({column:n})=>e[n])}function cit(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 Ng(e,...t){let n=e?.context?.coordinator??ai();for(let r of t)n.connect(r)}function bv(e,t,n){let r=new t(n);return Ng(e,r),r.element}function hz(e){return bv(this,Ag,e)}function dz(e){return bv(this,Mg,e)}function pz(e){return bv(this,Tg,e)}function mz(e){return bv(this,Eg,e)}function yz({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)),Object.assign(r,{value:{element:r}}),r}function gz(...e){return yz({direction:"vertical"},e.flat())}function xz(...e){return yz({direction:"horizontal"},e.flat())}function bz({dim:e="width",size:t=10}){let n=document.createElement("span");return n.style.display="inline-block",n.style[e]=Number.isNaN(+t)?t:`${t}px`,Object.assign(n,{value:{element:n}})}function wz(e){return bz({dim:"height",size:e})}function _z(e){return bz({dim:"width",size:e})}var wv={};Tr(wv,{align:()=>Q6,aspectRatio:()=>K6,axis:()=>t4,colorBase:()=>zE,colorClamp:()=>NE,colorConstant:()=>jE,colorDomain:()=>TE,colorExponent:()=>qE,colorInterpolate:()=>LE,colorLabel:()=>RE,colorN:()=>DE,colorNice:()=>OE,colorPercent:()=>FE,colorPivot:()=>CE,colorRange:()=>EE,colorReverse:()=>$E,colorScale:()=>ME,colorScheme:()=>BE,colorSymmetric:()=>kE,colorTickFormat:()=>UE,colorZero:()=>PE,facetGrid:()=>M8,facetLabel:()=>T8,facetMargin:()=>_8,facetMarginBottom:()=>S8,facetMarginLeft:()=>I8,facetMarginRight:()=>A8,facetMarginTop:()=>v8,fxAlign:()=>C8,fxAriaDescription:()=>Q8,fxAriaLabel:()=>J8,fxAxis:()=>$8,fxDomain:()=>E8,fxFontVariant:()=>Z8,fxGrid:()=>Y8,fxInset:()=>D8,fxInsetLeft:()=>O8,fxInsetRight:()=>B8,fxLabel:()=>G8,fxLabelAnchor:()=>W8,fxLabelOffset:()=>H8,fxLine:()=>X8,fxPadding:()=>k8,fxPaddingInner:()=>R8,fxPaddingOuter:()=>F8,fxRange:()=>N8,fxReverse:()=>K8,fxRound:()=>L8,fxTickFormat:()=>j8,fxTickPadding:()=>q8,fxTickRotate:()=>V8,fxTickSize:()=>U8,fxTickSpacing:()=>z8,fxTicks:()=>P8,fyAlign:()=>sE,fyAriaDescription:()=>IE,fyAriaLabel:()=>SE,fyAxis:()=>uE,fyDomain:()=>tE,fyFontVariant:()=>vE,fyGrid:()=>gE,fyInset:()=>nE,fyInsetBottom:()=>iE,fyInsetTop:()=>rE,fyLabel:()=>bE,fyLabelAnchor:()=>wE,fyLabelOffset:()=>_E,fyLine:()=>xE,fyPadding:()=>aE,fyPaddingInner:()=>cE,fyPaddingOuter:()=>lE,fyRange:()=>eE,fyReverse:()=>AE,fyRound:()=>oE,fyTickFormat:()=>mE,fyTickPadding:()=>pE,fyTickRotate:()=>yE,fyTickSize:()=>hE,fyTickSpacing:()=>dE,fyTicks:()=>fE,grid:()=>n4,height:()=>G6,inset:()=>e4,label:()=>r4,lengthBase:()=>IN,lengthClamp:()=>wN,lengthConstant:()=>MN,lengthDomain:()=>xN,lengthExponent:()=>AN,lengthNice:()=>_N,lengthPercent:()=>vN,lengthRange:()=>bN,lengthScale:()=>gN,lengthZero:()=>SN,margin:()=>j6,marginBottom:()=>J6,marginLeft:()=>W6,marginRight:()=>H6,marginTop:()=>Z6,margins:()=>q6,name:()=>U6,opacityBase:()=>tN,opacityClamp:()=>GE,opacityConstant:()=>nN,opacityDomain:()=>YE,opacityExponent:()=>eN,opacityLabel:()=>HE,opacityNice:()=>WE,opacityPercent:()=>ZE,opacityRange:()=>XE,opacityReverse:()=>JE,opacityScale:()=>VE,opacityTickFormat:()=>KE,opacityZero:()=>QE,padding:()=>i4,projectionClip:()=>FN,projectionDomain:()=>ON,projectionInset:()=>BN,projectionInsetBottom:()=>RN,projectionInsetLeft:()=>LN,projectionInsetRight:()=>CN,projectionInsetTop:()=>kN,projectionParallels:()=>EN,projectionPrecision:()=>NN,projectionRotate:()=>DN,projectionType:()=>TN,rBase:()=>pN,rClamp:()=>lN,rConstant:()=>yN,rDomain:()=>aN,rExponent:()=>mN,rLabel:()=>fN,rNice:()=>uN,rPercent:()=>hN,rRange:()=>cN,rScale:()=>sN,rZero:()=>dN,style:()=>Y6,symbolDomain:()=>iN,symbolRange:()=>oN,symbolScale:()=>rN,width:()=>X6,xAlign:()=>p4,xAriaDescription:()=>L4,xAriaLabel:()=>B4,xAxis:()=>x4,xBase:()=>F4,xClamp:()=>h4,xConstant:()=>P4,xDomain:()=>s4,xExponent:()=>$4,xFontVariant:()=>O4,xGrid:()=>A4,xInset:()=>l4,xInsetLeft:()=>u4,xInsetRight:()=>f4,xLabel:()=>T4,xLabelAnchor:()=>E4,xLabelArrow:()=>N4,xLabelOffset:()=>D4,xLine:()=>M4,xNice:()=>c4,xPadding:()=>m4,xPaddingInner:()=>y4,xPaddingOuter:()=>g4,xPercent:()=>C4,xRange:()=>a4,xReverse:()=>k4,xRound:()=>d4,xScale:()=>o4,xTickFormat:()=>S4,xTickPadding:()=>v4,xTickRotate:()=>I4,xTickSize:()=>w4,xTickSpacing:()=>_4,xTicks:()=>b4,xZero:()=>R4,xyDomain:()=>V6,yAlign:()=>H4,yAriaDescription:()=>p8,yAriaLabel:()=>d8,yAxis:()=>K4,yBase:()=>x8,yClamp:()=>G4,yConstant:()=>w8,yDomain:()=>z4,yExponent:()=>b8,yFontVariant:()=>h8,yGrid:()=>s8,yInset:()=>V4,yInsetBottom:()=>X4,yInsetTop:()=>Y4,yLabel:()=>c8,yLabelAnchor:()=>l8,yLabelArrow:()=>u8,yLabelOffset:()=>f8,yLine:()=>a8,yNice:()=>j4,yPadding:()=>Z4,yPaddingInner:()=>J4,yPaddingOuter:()=>Q4,yPercent:()=>m8,yRange:()=>q4,yReverse:()=>y8,yRound:()=>W4,yScale:()=>U4,yTickFormat:()=>i8,yTickPadding:()=>r8,yTickRotate:()=>o8,yTickSize:()=>e8,yTickSpacing:()=>n8,yTicks:()=>t8,yZero:()=>g8});var Dg=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)}clear(){return this.waiting?.clear(),super.clear()}},$6=new Dg;function P6(e,t,n){(e?.context?.namedPlots??$6).request(t,n)}function vz(e,t,n){(e?.context?.namedPlots??$6).set(t,n)}function U6(e){return t=>vz(this,e,t)}function Sz(e,t,n){vr(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 lit(e,t){return n=>{Sz(n,e,t)}}function z6(e){return t=>{for(let[n,r]of Object.entries(e))Sz(t,n,r)}}function q6(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),z6(o)}function j6(e){return z6({marginTop:e,marginBottom:e,marginLeft:e,marginRight:e})}function V6(e){return z6({xDomain:e,yDomain:e})}var B=e=>t=>lit(e,t),Y6=B("style"),X6=B("width"),G6=B("height"),W6=B("marginLeft"),H6=B("marginRight"),Z6=B("marginTop"),J6=B("marginBottom"),Q6=B("align"),K6=B("aspectRatio"),t4=B("axis"),e4=B("inset"),n4=B("grid"),r4=B("label"),i4=B("padding"),o4=B("xScale"),s4=B("xDomain"),a4=B("xRange"),c4=B("xNice"),l4=B("xInset"),u4=B("xInsetLeft"),f4=B("xInsetRight"),h4=B("xClamp"),d4=B("xRound"),p4=B("xAlign"),m4=B("xPadding"),y4=B("xPaddingInner"),g4=B("xPaddingOuter"),x4=B("xAxis"),b4=B("xTicks"),w4=B("xTickSize"),_4=B("xTickSpacing"),v4=B("xTickPadding"),S4=B("xTickFormat"),I4=B("xTickRotate"),A4=B("xGrid"),M4=B("xLine"),T4=B("xLabel"),E4=B("xLabelAnchor"),N4=B("xLabelArrow"),D4=B("xLabelOffset"),O4=B("xFontVariant"),B4=B("xAriaLabel"),L4=B("xAriaDescription"),C4=B("xPercent"),k4=B("xReverse"),R4=B("xZero"),F4=B("xBase"),$4=B("xExponent"),P4=B("xConstant"),U4=B("yScale"),z4=B("yDomain"),q4=B("yRange"),j4=B("yNice"),V4=B("yInset"),Y4=B("yInsetTop"),X4=B("yInsetBottom"),G4=B("yClamp"),W4=B("yRound"),H4=B("yAlign"),Z4=B("yPadding"),J4=B("yPaddingInner"),Q4=B("yPaddingOuter"),K4=B("yAxis"),t8=B("yTicks"),e8=B("yTickSize"),n8=B("yTickSpacing"),r8=B("yTickPadding"),i8=B("yTickFormat"),o8=B("yTickRotate"),s8=B("yGrid"),a8=B("yLine"),c8=B("yLabel"),l8=B("yLabelAnchor"),u8=B("yLabelArrow"),f8=B("yLabelOffset"),h8=B("yFontVariant"),d8=B("yAriaLabel"),p8=B("yAriaDescription"),m8=B("yPercent"),y8=B("yReverse"),g8=B("yZero"),x8=B("yBase"),b8=B("yExponent"),w8=B("yConstant"),_8=B("facetMargin"),v8=B("facetMarginTop"),S8=B("facetMarginBottom"),I8=B("facetMarginLeft"),A8=B("facetMarginRight"),M8=B("facetGrid"),T8=B("facetLabel"),E8=B("fxDomain"),N8=B("fxRange"),D8=B("fxInset"),O8=B("fxInsetLeft"),B8=B("fxInsetRight"),L8=B("fxRound"),C8=B("fxAlign"),k8=B("fxPadding"),R8=B("fxPaddingInner"),F8=B("fxPaddingOuter"),$8=B("fxAxis"),P8=B("fxTicks"),U8=B("fxTickSize"),z8=B("fxTickSpacing"),q8=B("fxTickPadding"),j8=B("fxTickFormat"),V8=B("fxTickRotate"),Y8=B("fxGrid"),X8=B("fxLine"),G8=B("fxLabel"),W8=B("fxLabelAnchor"),H8=B("fxLabelOffset"),Z8=B("fxFontVariant"),J8=B("fxAriaLabel"),Q8=B("fxAriaDescription"),K8=B("fxReverse"),tE=B("fyDomain"),eE=B("fyRange"),nE=B("fyInset"),rE=B("fyInsetTop"),iE=B("fyInsetBottom"),oE=B("fyRound"),sE=B("fyAlign"),aE=B("fyPadding"),cE=B("fyPaddingInner"),lE=B("fyPaddingOuter"),uE=B("fyAxis"),fE=B("fyTicks"),hE=B("fyTickSize"),dE=B("fyTickSpacing"),pE=B("fyTickPadding"),mE=B("fyTickFormat"),yE=B("fyTickRotate"),gE=B("fyGrid"),xE=B("fyLine"),bE=B("fyLabel"),wE=B("fyLabelAnchor"),_E=B("fyLabelOffset"),vE=B("fyFontVariant"),SE=B("fyAriaLabel"),IE=B("fyAriaDescription"),AE=B("fyReverse"),ME=B("colorScale"),TE=B("colorDomain"),EE=B("colorRange"),NE=B("colorClamp"),DE=B("colorN"),OE=B("colorNice"),BE=B("colorScheme"),LE=B("colorInterpolate"),CE=B("colorPivot"),kE=B("colorSymmetric"),RE=B("colorLabel"),FE=B("colorPercent"),$E=B("colorReverse"),PE=B("colorZero"),UE=B("colorTickFormat"),zE=B("colorBase"),qE=B("colorExponent"),jE=B("colorConstant"),VE=B("opacityScale"),YE=B("opacityDomain"),XE=B("opacityRange"),GE=B("opacityClamp"),WE=B("opacityNice"),HE=B("opacityLabel"),ZE=B("opacityPercent"),JE=B("opacityReverse"),QE=B("opacityZero"),KE=B("opacityTickFormat"),tN=B("opacityBase"),eN=B("opacityExponent"),nN=B("opacityConstant"),rN=B("symbolScale"),iN=B("symbolDomain"),oN=B("symbolRange"),sN=B("rScale"),aN=B("rDomain"),cN=B("rRange"),lN=B("rClamp"),uN=B("rNice"),fN=B("rLabel"),hN=B("rPercent"),dN=B("rZero"),pN=B("rBase"),mN=B("rExponent"),yN=B("rConstant"),gN=B("lengthScale"),xN=B("lengthDomain"),bN=B("lengthRange"),wN=B("lengthClamp"),_N=B("lengthNice"),vN=B("lengthPercent"),SN=B("lengthZero"),IN=B("lengthBase"),AN=B("lengthExponent"),MN=B("lengthConstant"),TN=B("projectionType"),EN=B("projectionParallels"),NN=B("projectionPrecision"),DN=B("projectionRotate"),ON=B("projectionDomain"),BN=B("projectionInset"),LN=B("projectionInsetLeft"),CN=B("projectionInsetRight"),kN=B("projectionInsetTop"),RN=B("projectionInsetBottom"),FN=B("projectionClip");function Iz(e,t){return{table:e,options:t}}var vv={};Tr(vv,{area:()=>$N,areaX:()=>PN,areaY:()=>UN,arrow:()=>LD,axisFx:()=>$D,axisFy:()=>PD,axisX:()=>RD,axisY:()=>FD,barX:()=>VN,barY:()=>YN,cell:()=>XN,cellX:()=>GN,cellY:()=>WN,circle:()=>eD,contour:()=>bD,delaunayLink:()=>DD,delaunayMesh:()=>OD,denseLine:()=>xD,density:()=>gD,densityX:()=>mD,densityY:()=>yD,dot:()=>QN,dotX:()=>KN,dotY:()=>tD,errorbarX:()=>MD,errorbarY:()=>TD,frame:()=>kD,geo:()=>VD,graticule:()=>XD,gridFx:()=>qD,gridFy:()=>jD,gridX:()=>UD,gridY:()=>zD,heatmap:()=>wD,hexagon:()=>nD,hexbin:()=>SD,hexgrid:()=>ID,hull:()=>BD,image:()=>pD,line:()=>zN,lineX:()=>qN,lineY:()=>jN,link:()=>CD,raster:()=>_D,rasterTile:()=>vD,rect:()=>HN,rectX:()=>ZN,rectY:()=>JN,regressionY:()=>AD,ruleX:()=>sD,ruleY:()=>aD,sphere:()=>YD,spike:()=>dD,text:()=>rD,textX:()=>iD,textY:()=>oD,tickX:()=>cD,tickY:()=>lD,vector:()=>uD,vectorX:()=>fD,vectorY:()=>hD,voronoi:()=>ED,voronoiMesh:()=>ND});var uit=new Set(["frame","axisX","axisY","axisFx","axisFy","gridX","gridY","gridFx","gridFy","hexgrid","graticule","sphere"]);function Mt(e,t,n={}){arguments.length===2&&!Array.isArray(t)&&(n=t,t=uit.has(e)?null:[{}]);let r=e.startsWith("area")||e.startsWith("line")?ig:ln;return _v(r,e,t,n)}function _v(e,t,n,r){return i=>{i.addMark(new e(t,n,r))}}function is(e,t,n){return r=>{r.addMark(new e(t,n))}}var $N=(...e)=>Mt("area",...e),PN=(...e)=>Mt("areaX",...e),UN=(...e)=>Mt("areaY",...e),zN=(...e)=>Mt("line",...e),qN=(...e)=>Mt("lineX",...e),jN=(...e)=>Mt("lineY",...e),VN=(...e)=>Mt("barX",...e),YN=(...e)=>Mt("barY",...e),XN=(...e)=>Mt("cell",...e),GN=(...e)=>Mt("cellX",...e),WN=(...e)=>Mt("cellY",...e),HN=(...e)=>Mt("rect",...e),ZN=(...e)=>Mt("rectX",...e),JN=(...e)=>Mt("rectY",...e),QN=(...e)=>Mt("dot",...e),KN=(...e)=>Mt("dotX",...e),tD=(...e)=>Mt("dotY",...e),eD=(...e)=>Mt("circle",...e),nD=(...e)=>Mt("hexagon",...e),rD=(...e)=>Mt("text",...e),iD=(...e)=>Mt("textX",...e),oD=(...e)=>Mt("textY",...e),sD=(...e)=>Mt("ruleX",...e),aD=(...e)=>Mt("ruleY",...e),cD=(...e)=>Mt("tickX",...e),lD=(...e)=>Mt("tickY",...e),uD=(...e)=>Mt("vector",...e),fD=(...e)=>Mt("vectoX",...e),hD=(...e)=>Mt("vectorY",...e),dD=(...e)=>Mt("spike",...e),pD=(...e)=>Mt("image",...e),mD=(...e)=>_v(Nh,"areaX",...e),yD=(...e)=>_v(Nh,"areaY",...e),gD=(...e)=>is(fg,...e),xD=(...e)=>is(ug,...e),bD=(...e)=>is(ag,...e),wD=(...e)=>is(lg,...e),_D=(...e)=>is(wc,...e),vD=(...e)=>is(pg,...e),SD=(...e)=>is(dg,...e),ID=(...e)=>Mt("hexgrid",...e),AD=(...e)=>is(mg,...e),MD=(...e)=>_v(Oh,"ruleY",...e),TD=(...e)=>is(Oh,"ruleX",...e),ED=(...e)=>Mt("voronoi",...e),ND=(...e)=>Mt("voronoiMesh",...e),DD=(...e)=>Mt("delaunayLink",...e),OD=(...e)=>Mt("delaunayMesh",...e),BD=(...e)=>Mt("hull",...e),LD=(...e)=>Mt("arrow",...e),CD=(...e)=>Mt("link",...e),kD=(...e)=>Mt("frame",...e),RD=(...e)=>Mt("axisX",...e),FD=(...e)=>Mt("axisY",...e),$D=(...e)=>Mt("axisFx",...e),PD=(...e)=>Mt("axisFy",...e),UD=(...e)=>Mt("gridX",...e),zD=(...e)=>Mt("gridY",...e),qD=(...e)=>Mt("gridFx",...e),jD=(...e)=>Mt("gridFy",...e),VD=(...e)=>is(hg,...e),YD=(...e)=>Mt("sphere",...e),XD=(...e)=>Mt("graticule",...e);var Sv={};Tr(Sv,{highlight:()=>GD,intervalX:()=>eO,intervalXY:()=>rO,intervalY:()=>nO,nearest:()=>QD,nearestX:()=>KD,nearestY:()=>tO,pan:()=>iO,panX:()=>oO,panY:()=>sO,panZoom:()=>aO,panZoomX:()=>cO,panZoomY:()=>lO,toggle:()=>eu,toggleColor:()=>JD,toggleX:()=>WD,toggleY:()=>HD,toggleZ:()=>ZD});function fa(e,t){return n=>{let r=n.marks[n.marks.length-1];n.addInteractor(new e(r,t))}}function GD({by:e,...t}){return fa(yg,{selection:e,channels:t})}function eu({as:e,...t}){return fa(tu,{...t,selection:e})}function WD(e){return eu({...e,channels:["x"]})}function HD(e){return eu({...e,channels:["y"]})}function ZD(e){return eu({...e,channels:["z"]})}function JD(e){return eu({...e,channels:["color"]})}function QD({as:e,...t}){return fa(Kl,{...t,selection:e,pointer:"xy"})}function KD({as:e,...t}){return fa(Kl,{...t,selection:e,pointer:"x"})}function tO({as:e,...t}){return fa(Kl,{...t,selection:e,pointer:"y"})}function eO({as:e,...t}){return fa(_c,{...t,selection:e,channel:"x"})}function nO({as:e,...t}){return fa(_c,{...t,selection:e,channel:"y"})}function rO({as:e,...t}){return fa(bg,{...t,selection:e})}function Ch(e){return fa(wg,e)}function iO(e={}){return Ch({...e,zoom:!1})}function oO(e={}){return Ch({...e,zoom:!1,pany:!1})}function sO(e={}){return Ch({...e,zoom:!1,panx:!1})}function aO(e={}){return Ch(e)}function cO(e={}){return Ch({...e,pany:!1})}function lO(e={}){return Ch({...e,panx:!1})}var Iv={};Tr(Iv,{colorLegend:()=>fO,opacityLegend:()=>hO,symbolLegend:()=>dO});function uO(e,t={}){if(t.for){let{for:n,...r}=t,i=new Lh(e,r),o=typeof n,s=a=>a.addLegend(i,!1);return o==="string"?P6(this,n,s):n.value&&s(n.value),i.element}else return n=>n.addLegend(new Lh(e,t))}function fO(e){return uO.call(this,"color",e)}function hO(e){return uO.call(this,"opacity",e)}function dO(e){return uO.call(this,"symbol",e)}function Az(...e){let t=new ng;return e.flat().forEach(n=>n(t)),Ng(this,...t.marks),t.update(),t.element}function mO({coordinator:e=ai(),namedPlots:t=new Dg,extensions:n=null,...r}={}){return{...pO,...n,context:{coordinator:e,namedPlots:t,...r}}}var Mz="spec",Av="literal",XXt="dataref",Tz="options",Ez="selection",Nz="paramref",Dz="param",yO="select",Mv="value",Oz="crossfilter",Tv="intersect",Bz="union",Lz="single",Cz="data",kz="expression",vc="sql",ha="agg",Og="input",kh="hconcat",Rh="vconcat",Fh="hspace",$h="vspace",Ev="mark",gO="from",Ph="plot",Bg="legend",Rz="attribute",xO="transform",Fz="interactor",Lg="Fixed";var Rt=class{constructor(t,n=null){this.type=t,this.children=n}instantiate(t){throw Error("instantiate not implemented")}codegen(t){return Error("codegen not implemented")}toJSON(){return Error("toJSON not implemented")}};var Cg=class extends Rt{constructor(t,n,r,i,o,s){super(Mz,[t]),this.root=t,this.meta=n,this.config=r,this.data=i,this.params=o,this.plotDefaults=s}toJSON(){let{root:t,meta:n,config:r,plotDefaults:i}=this,o=new Map(Object.entries(this.data)),s=new Map(Object.entries(this.params)),a={};if(n&&(a.meta={...n}),r&&(a.config={...r}),o?.size){let c=a.data={};for(let[l,u]of o)c[l]=u.toJSON()}if(s?.size){let c=a.params={};for(let[l,u]of s)c[l]=u.toJSON()}if(i?.length){let c=a.plotDefaults={};for(let l of i)Object.assign(c,l.toJSON())}return Object.assign(a,t.toJSON())}};function $z(e){let t=typeof e;return t==="object"?e?.param:t==="string"?fit(e):null}function fit(e){return e?.[0]==="$"?e.slice(1):null}function kg(e){return`$${e}`}function Nv(e){return[e].flat()}function vi(e){return Array.isArray(e)}function Uh(e){return e!==null&&typeof e=="object"&&!vi(e)}function Sc(e){return typeof e=="string"}function zh(e,t){throw Object.assign(Error(e),{data:t})}var hit=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function Pz(e,t){return hit.test(e+="")?new Date(e):t}function Gn(e,t){let n={};for(let r in e)n[r]=t.maybeSelection(e[r]);return new qh(n)}var qh=class e extends Rt{constructor(t){super(Tz),this.options=t}filter(t){let n=Object.fromEntries(Object.entries(this.options).filter(([r,i])=>t(r,i)));return new e(n)}instantiate(t){let{options:n}=this,r={};for(let i in n)r[i]=n[i].instantiate(t);return r}codegen(t){let{options:n}=this,r=[];for(let i in n)r.push(`${i}: ${n[i].codegen(t)}`);return r.length?`{${t.maybeLineWrap(r)}}`:""}toJSON(){let{options:t}=this,n={};for(let r in t)n[r]=t[r].toJSON();return n}};var qz="table",jz="parquet",Vz="csv",bO="json",Fv="spatial",Uz=new Map([[qz,yit],[jz,git],[Vz,xit],[bO,bit],[Fv,wit]]);function Yz(e,t,n){let r=dit(t);if(Uz.has(r.type))return Uz.get(r.type)(e,r,n);n.error("Unrecognized data format type.",t)}function dit(e){return vi(e)&&(e={type:"json",data:e}),Sc(e)&&(e={type:"table",query:e}),{...e,type:pit(e)}}function pit(e){return e.type||mit(e.file)||"table"}function mit(e){let t=e?.lastIndexOf(".");return t>0?e.slice(t+1):null}function yit(e,t,n){let{query:r,type:i,...o}=t;return new Ov(e,r,Gn(o,n))}function git(e,t,n){let{file:r,type:i,...o}=t;return new Lv(e,r,Gn(o,n))}function xit(e,t,n){let{file:r,type:i,...o}=t;return new Cv(e,r,Gn(o,n))}function bit(e,t,n){let{data:r,file:i,type:o,...s}=t,a=Gn(s,n);return r?new Rv(e,r,a):new kv(e,i,a)}function wit(e,t,n){let{file:r,type:i,...o}=t;return new Bv(e,r,Gn(o,n))}function zz(e,t){return t?new URL(e,t).toString():e}function _it(e,t){let n=e?.codegen(t);return n?`, ${n}`:""}var Dv=class extends Rt{constructor(t,n){super(Cz),this.name=t,this.format=n}},jh=class extends Dv{constructor(t,n){super(t,n)}instantiateQuery(t){t.error("instantiateQuery not implemented")}codegenQuery(t){t.error("codegenQuery not implemented")}instantiate(t){let n=this.instantiateQuery(t);if(n)return n}codegen(t){let n=this.codegenQuery(t);if(n)return n}},Ov=class extends jh{constructor(t,n,r){super(t,qz),this.query=n?.trim(),this.options=r}instantiateQuery(t){let{name:n,query:r,options:i}=this;if(r)return t.api.create(n,r,i.instantiate(t))}codegenQuery(t){let{name:n,query:r,options:i}=this;if(r)return`\`${wo(n,r,i.instantiate(t))}\``}toJSON(){let{format:t,query:n,options:r}=this;return{type:t,query:n,...r.toJSON()}}},nu=class extends jh{constructor(t,n,r,i,o){super(t,n),this.file=i,this.method=r,this.options=o}instantiateQuery(t){let{name:n,method:r,file:i,options:o}=this,s=zz(i,t.baseURL),a=o?.instantiate(t);return t.api[r](n,s,a)}codegenQuery(t){let{name:n,method:r,file:i,options:o}=this,s=zz(i,t.baseURL),a=_it(o,t);return`${t.ns()}${r}("${n}", "${s}"${a})`}toJSON(){let{format:t,file:n,options:r}=this;return{type:t,file:n,...r.toJSON()}}},Bv=class extends nu{constructor(t,n,r){super(t,Fv,"loadSpatial",n,r)}},Lv=class extends nu{constructor(t,n,r){super(t,jz,"loadParquet",n,r)}},Cv=class extends nu{constructor(t,n,r){super(t,Vz,"loadCSV",n,r)}},kv=class extends nu{constructor(t,n,r){super(t,bO,"loadJSON",n,r)}},Rv=class extends jh{constructor(t,n,r){super(t,bO),this.data=n,this.options=r}instantiateQuery(t){let{name:n,data:r,options:i}=this;return t.api.loadObjects(n,r,i.instantiate(t))}codegenQuery(t){let{name:n,data:r,options:i}=this,o=i?","+i.codegen(t):"",s=`[
60
+ }`)).call(gu,n);for(let $ of f){let{channels:P,values:F,facets:q}=m.get($);if(h===void 0||$.facet==="super"){let V=null;if(q&&(V=q[0],V=$.filter(V,P,F),V.length===0))continue;let K=$.render(V,y,F,v,A);if(K==null)continue;E.appendChild(K)}else{let V;for(let K of h){if(!($.facetAnchor?.(h,k,K)??!K.empty))continue;let et=null;if(q){let j=p.has($);if(et=q[j?K.i:0],et=$.filter(et,P,F),et.length===0)continue;!j&&et===q[0]&&(et=$i(et)),et.fx=K.x,et.fy=K.y,et.fi=K.i}let rt=$.render(et,y,F,_,A);if(rt!=null){(V??=Nt(E).append("g")).append(()=>rt).datum(K);for(let j of["aria-label","aria-description","aria-hidden","transform"])rt.hasAttribute(j)&&(V.attr(j,rt.getAttribute(j)),rt.removeAttribute(j))}}V?.selectChildren().attr("transform",O)}}let C=GO(x,A,t),{figure:L=r!=null||o!=null||i!=null||C.length>0}=t;L&&(N=T.createElement("figure"),N.className=`${c}-figure`,N.style.maxWidth="initial",r!=null&&N.append(f$(T,r,"h2")),o!=null&&N.append(f$(T,o,"h3")),N.append(...C,E),i!=null&&N.append(XH(T,i)),"value"in E&&(N.value=E.value,delete E.value)),N.scale=$R(y.scales),N.legend=WO(x,A,t);let D=pR();return D>0&&Nt(E).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(`${D.toLocaleString("en-US")} warning${D===1?"":"s"}. Please check the console.`),N}function f$(t,e,n){if(e.ownerDocument)return e;let r=t.createElement(n);return r.append(e),r}function XH(t,e){let n=t.createElement("figcaption");return n.append(e),n}function u$(t){return t.flat(1/0).filter(e=>e!=null).map(WH)}function WH(t){return typeof t.render=="function"?t:new N4(t)}var N4=class extends lt{constructor(e){if(typeof e!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=e}render(){}};function C4(t,e){for(let n in t)h$(t[n],e);return t}function h$(t,e){let{scale:n,transform:r=!0}=t;if(n==null||!r)return;let{type:o,percent:i,interval:s,transform:a=i?c=>c==null?NaN:c*100:SS(s,o)}=e[n]??{};a!=null&&(t.value=Et(t.value,a),t.transform=!1)}function VH(t){for(let e in t)qS(e,t[e])}function hh(t,e,n,r=gL){for(let{channels:o}of e.values())for(let i in o){let s=o[i],{scale:a}=s;if(a!=null&&r(a))if(a==="projection"){if(!WR(n)){let c=n.x?.domain===void 0,f=n.y?.domain===void 0;if(c||f){let[u,p]=GR(s);c&&I4(t,"x",u),f&&I4(t,"y",p)}}}else I4(t,a,s)}return t}function I4(t,e,n){let r=t.get(e);r!==void 0?r.push(n):t.set(e,[n])}function GH(t,e){if(t==null)return;let{x:n,y:r}=t;if(n==null&&r==null)return;let o=Ri(t.data);if(o==null)throw new Error("missing facet data");let i={};n!=null&&(i.fx=uu(o,{value:n,scale:"fx"})),r!=null&&(i.fy=uu(o,{value:r,scale:"fy"})),C4(i,e);let s=H1(o,i);return{channels:i,groups:s,data:t.data}}function l$(t,e,n){if(t.facet===null||t.facet==="super")return;let{fx:r,fy:o}=t;if(r!=null||o!=null){let c=Ri(t.data??r??o);if(c===void 0)throw new Error(`missing facet data in ${t.ariaLabel}`);if(c===null)return;let f={};return r!=null&&(f.fx=uu(c,{value:r,scale:"fx"})),o!=null&&(f.fy=uu(c,{value:o,scale:"fy"})),C4(f,n),{channels:f,groups:H1(c,f)}}if(e===void 0)return;let{channels:i,groups:s,data:a}=e;if(t.facet!=="auto"||t.data===a)return{channels:i,groups:s};a.length>0&&(s.size>1||s.size===1&&i.fx&&i.fy&&[...s][0][1].size>1)&&Ns(Ri(t.data))===Ns(a)&&_n(`Warning: the ${t.ariaLabel} mark appears to use faceted data, but isn\u2019t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function HH(t,e={}){return Kt({...e,x:null,y:null},(n,r,o,i,s,a)=>a.getMarkState(t))}function QH(t){let e=[];for(let n of t){let r=n.tip;if(r){r===!0?r={}:typeof r=="string"&&(r={pointer:r});let{pointer:o,preferredAnchor:i}=r;o=/^x$/i.test(o)?Bs:/^y$/i.test(o)?Ui:qs,r=o(HH(n,r)),r.title=null,i===void 0&&(r.preferredAnchor=o===Ui?"left":"bottom");let s=Ab(n.data,r);s.facet=n.facet,s.facetAnchor=n.facetAnchor,e.push(s)}}return e}function ZH(t,e,n){let{projection:r,x:o={},y:i={},fx:s={},fy:a={},axis:c,grid:f,facet:u={},facet:{axis:p=c,grid:l}=u,x:{axis:d=c,grid:h=d===null?null:f}=o,y:{axis:m=c,grid:x=m===null?null:f}=i,fx:{axis:g=p,grid:y=g===null?null:l}=s,fy:{axis:b=p,grid:w=b===null?null:l}=a}=n;(r||!Ro(o)&&!p$("x",t))&&(d=h=null),(r||!Ro(i)&&!p$("y",t))&&(m=x=null),e.has("fx")||(g=y=null),e.has("fy")||(b=w=null),d===void 0&&(d=!Ib(t,"x")),m===void 0&&(m=!Ib(t,"y")),g===void 0&&(g=!Ib(t,"fx")),b===void 0&&(b=!Ib(t,"fy")),d===!0&&(d="bottom"),m===!0&&(m="left"),g===!0&&(g=d==="top"||d===null?"bottom":"top"),b===!0&&(b=m==="right"||m===null?"left":"right");let _=[];return Eb(_,w,xb,a),Tb(_,b,db,"right","left",u,a),Eb(_,y,yb,s),Tb(_,g,hb,"top","bottom",u,s),Eb(_,x,mb,i),Tb(_,m,ih,"left","right",n,i),Eb(_,h,gb,o),Tb(_,d,sh,"bottom","top",n,o),_}function Tb(t,e,n,r,o,i,s){if(!e)return;let a=JH(e);s=KH(a?r:e,i,s);let{line:c}=s;(n===ih||n===sh)&&c&&!Pi(c)&&t.push(Eu(tQ(s))),t.push(n(s)),a&&t.push(n({...s,anchor:o,label:null}))}function Eb(t,e,n,r){!e||Pi(e)||t.push(n(eQ(e,r)))}function JH(t){return/^\s*both\s*$/i.test(t)}function KH(t,e,{line:n=e.line,ticks:r,tickSize:o,tickSpacing:i,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:f,ariaLabel:u,ariaDescription:p,label:l=e.label,labelAnchor:d,labelArrow:h=e.labelArrow,labelOffset:m}){return{anchor:t,line:n,ticks:r,tickSize:o,tickSpacing:i,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:f,ariaLabel:u,ariaDescription:p,label:l,labelAnchor:d,labelArrow:h,labelOffset:m}}function tQ(t){let{anchor:e,line:n}=t;return{anchor:e,facetAnchor:e+"-empty",stroke:n===!0?void 0:n}}function eQ(t,{stroke:e=ks(t)?t:void 0,ticks:n=nQ(t)?t:void 0,tickSpacing:r,ariaLabel:o,ariaDescription:i}){return{stroke:e,ticks:n,tickSpacing:r,ariaLabel:o,ariaDescription:i}}function nQ(t){switch(typeof t){case"number":return!0;case"string":return!ks(t)}return qn(t)||typeof t?.range=="function"}function Ib(t,e){let n=`${e}-axis `;return t.some(r=>r.ariaLabel?.startsWith(n))}function p$(t,e){for(let n of e)for(let r in n.channels){let{scale:o}=n.channels[r];if(o===t||o==="projection")return!0}return!1}function rQ(t,e){for(let n in t){let r=t[n],o=e[n];r.label===void 0&&o&&(r.label=o.label)}return t}function oQ({fx:t,fy:e},n){let{marginTop:r,marginRight:o,marginBottom:i,marginLeft:s,width:a,height:c}=W1(n),f=t&&d$(t),u=e&&d$(e);return{marginTop:e?u[0]:r,marginRight:t?a-f[1]:o,marginBottom:e?c-u[1]:i,marginLeft:t?f[0]:s,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:a,height:c}}function d$(t){let e=t.domain();if(e.length===0)return[0,t.bandwidth()];let n=t(e[0]),r=t(e[e.length-1]);return r<n&&([n,r]=[r,n]),[n,r+t.bandwidth()]}var iQ=new Map([["basis",z3],["basis-closed",Y3],["basis-open",U3],["bundle",j3],["bump-x",D3],["bump-y",P3],["cardinal",X3],["cardinal-closed",W3],["cardinal-open",V3],["catmull-rom",G3],["catmull-rom-closed",H3],["catmull-rom-open",Q3],["linear",Ni],["linear-closed",Z3],["monotone-x",K3],["monotone-y",tS],["natural",eS],["step",nS],["step-after",oS],["step-before",rS]]);function mh(t=Ni,e){if(typeof t=="function")return t;let n=iQ.get(`${t}`.toLowerCase());if(!n)throw new Error(`unknown curve: ${t}`);if(e!==void 0){if("beta"in n)return n.beta(e);if("tension"in n)return n.tension(e);if("alpha"in n)return n.alpha(e)}return n}function Nb(t=Ws,e){return typeof t!="function"&&`${t}`.toLowerCase()==="auto"?Ws:mh(t,e)}function Ws(t){return Ni(t)}function Uo(t={y:"count"},e={}){[t,e]=L4(t,e);let{x:n,y:r}=e;return k4(Cb(n,e,W),null,null,r,t,lc(e))}function jo(t={x:"count"},e={}){[t,e]=L4(t,e);let{x:n,y:r}=e;return k4(null,Cb(r,e,W),n,null,t,pc(e))}function Xi(t={fill:"count"},e={}){[t,e]=L4(t,e);let{x:n,y:r}=sQ(e);return k4(n,r,null,null,t,lc(pc(e)))}function g$(t,e,n={}){if(n?.interval==null)return n;let{reduce:r=B1}=n,o={filter:null};return n[e]!=null&&(o[e]=r),n[`${e}1`]!=null&&(o[`${e}1`]=r),n[`${e}2`]!=null&&(o[`${e}2`]=r),t(o,n)}function Nu(t={}){return g$(Uo,"y",Jr(t,"x"))}function Cu(t={}){return g$(jo,"x",Jr(t,"y"))}function k4(t,e,n,r,{data:o=q1,filter:i=Vd,sort:s,reverse:a,...c}={},f={}){t=m$(t),e=m$(e),c=aQ(c,f),o=w$(o,W),s=s==null?void 0:y$("sort",s,f),i=i==null?void 0:b$("filter",i,f),n!=null&&Fo(c,"x","x1","x2")&&(n=null),r!=null&&Fo(c,"y","y1","y2")&&(r=null);let[u,p]=fn(t),[l,d]=fn(t),[h,m]=fn(e),[x,g]=fn(e),[y,b]=n!=null?[n,"x"]:r!=null?[r,"y"]:[],[w,_]=fn(y),{x:v,y:A,z:T,fill:E,stroke:N,x1:M,x2:k,y1:O,y2:S,domain:I,cumulative:C,thresholds:L,interval:D,...$}=f,[P,F]=fn(T),[q]=ce(E),[V]=ce(N),[K,et]=fn(q),[rt,j]=fn(V);return{..."z"in f&&{z:P||T},..."fill"in f&&{fill:K||E},..."stroke"in f&&{stroke:rt||N},...Ce($,(nt,Y,G)=>{let tt=sc(ut(nt,y),G?.[b]),B=ut(nt,T),_t=ut(nt,q),ct=ut(nt,V),Ct=Qd(c,{z:B,fill:_t,stroke:ct}),Lt=[],Z=[],jt=tt&&_([]),Qn=B&&F([]),ro=_t&&et([]),fq=ct&&j([]),y7=t&&p([]),uq=t&&d([]),b7=e&&m([]),lq=e&&g([]),pq=uQ(t,e,nt),dq=0;for(let $c of c)$c.initialize(nt);s&&s.initialize(nt),i&&i.initialize(nt);for(let $c of Y){let w7=[];for(let Dc of c)Dc.scope("facet",$c);s&&s.scope("facet",$c),i&&i.scope("facet",$c);for(let[Dc,hq]of Po($c,Ct))for(let[mq,Em]of Po(hq,tt))for(let[oo,Jo]of pq(Em))if(Ct&&(Jo.z=Dc),!(i&&!i.reduce(oo,Jo))){w7.push(dq++),Z.push(o.reduceIndex(oo,nt,Jo)),tt&&jt.push(mq),B&&Qn.push(Ct===B?Dc:B[(oo.length>0?oo:Em)[0]]),_t&&ro.push(Ct===_t?Dc:_t[(oo.length>0?oo:Em)[0]]),ct&&fq.push(Ct===ct?Dc:ct[(oo.length>0?oo:Em)[0]]),y7&&(y7.push(Jo.x1),uq.push(Jo.x2)),b7&&(b7.push(Jo.y1),lq.push(Jo.y2));for(let xq of c)xq.reduce(oo,Jo);s&&s.reduce(oo,Jo)}Lt.push(w7)}return DS(Lt,s,a),{data:Z,facets:Lt}}),...!Fo(c,"x")&&(u?{x1:u,x2:l,x:iu(u,l)}:{x:v,x1:M,x2:k}),...!Fo(c,"y")&&(h?{y1:h,y2:x,y:iu(h,x)}:{y:A,y1:O,y2:S}),...w&&{[b]:w},...Object.fromEntries(c.map(({name:nt,output:Y})=>[nt,Y]))}}function L4({cumulative:t,domain:e,thresholds:n,interval:r,...o},i){return[o,{cumulative:t,domain:e,thresholds:n,interval:r,...i}]}function Cb(t,{cumulative:e,domain:n,thresholds:r,interval:o},i){return t={...$r(t)},t.domain===void 0&&(t.domain=n),t.cumulative===void 0&&(t.cumulative=e),t.thresholds===void 0&&(t.thresholds=r),t.interval===void 0&&(t.interval=o),t.value===void 0&&(t.value=i),t.thresholds=R4(t.thresholds,t.interval),t}function sQ(t){let{x:e,y:n}=t;return e=Cb(e,t),n=Cb(n,t),[e.value,n.value]=me(e.value,n.value),{x:e,y:n}}function m$(t){if(t==null)return;let{value:e,cumulative:n,domain:r=Ft,thresholds:o}=t,i=s=>{let a=ut(s,e),c;if(fe(a)||fQ(o)){a=Et(a,yS,Float64Array);let[u,p]=typeof r=="function"?r(a):r,l=typeof o=="function"&&!Cs(o)?o(a,u,p):o;typeof l=="number"&&(l=hd(u,p,l)),Cs(l)&&(r===Ft&&(u=l.floor(u),p=l.offset(l.floor(p))),l=l.range(u,l.offset(p))),c=l}else{a=Ne(a);let[u,p]=typeof r=="function"?r(a):r,l=typeof o=="function"&&!Cs(o)?o(a,u,p):o;if(typeof l=="number")if(r===Ft){let d=li(u,p,l);if(isFinite(d))if(d>0){let h=Math.round(u/d),m=Math.round(p/d);h*d<=u||--h,m*d>p||++m;let x=m-h+1;l=new Float64Array(x);for(let g=0;g<x;++g)l[g]=(h+g)*d}else if(d<0){d=-d;let h=Math.round(u*d),m=Math.round(p*d);h/d<=u||--h,m/d>p||++m;let x=m-h+1;l=new Float64Array(x);for(let g=0;g<x;++g)l[g]=(h+g)/d}else l=[u];else l=[u]}else l=on(u,p,l);else Cs(l)&&(r===Ft&&(u=l.floor(u),p=l.offset(l.floor(p))),l=l.range(u,l.offset(p)));c=l}let f=[];if(c.length===1)f.push([c[0],c[0]]);else for(let u=1;u<c.length;++u)f.push([c[u-1],c[u]]);return f.bin=(n<0?pQ:n>0?lQ:O4)(f,c,a),f};return i.label=un(e),i}function R4(t,e,n=x$){if(t===void 0)return e===void 0?n:$o(e);if(typeof t=="string"){switch(t.toLowerCase()){case"freedman-diaconis":return vx;case"scott":return fp;case"sturges":return as;case"auto":return x$}return oc(t)}return t}function aQ(t,e){return OS(t,e,y$)}function y$(t,e,n){return P1(t,e,n,b$)}function b$(t,e,n){return F1(t,e,n,w$)}function w$(t,e){return fu(t,e,cQ)}function cQ(t){switch(`${t}`.toLowerCase()){case"x":return dQ;case"x1":return mQ;case"x2":return xQ;case"y":return hQ;case"y1":return gQ;case"y2":return yQ;case"z":return PS}throw new Error(`invalid bin reduce: ${t}`)}function x$(t,e,n){return Math.min(200,fp(t,e,n))}function fQ(t){return wL(t)||qn(t)&&fe(t)}function uQ(t,e,n){let r=t?.(n),o=e?.(n);return r&&o?function*(i){let s=r.bin(i);for(let[a,[c,f]]of r.entries()){let u=o.bin(s[a]);for(let[p,[l,d]]of o.entries())yield[u[p],{data:n,x1:c,y1:l,x2:f,y2:d}]}}:r?function*(i){let s=r.bin(i);for(let[a,[c,f]]of r.entries())yield[s[a],{data:n,x1:c,x2:f}]}:function*(i){let s=o.bin(i);for(let[a,[c,f]]of o.entries())yield[s[a],{data:n,y1:c,y2:f}]}}function O4(t,e,n){return e=Ne(e),r=>{let o=t.map(()=>[]);for(let i of r)o[fi(e,n[i])-1]?.push(i);return o}}function lQ(t,e,n){let r=O4(t,e,n);return o=>{let i=r(o);for(let s=1,a=i.length;s<a;++s){let c=i[s-1],f=i[s];for(let u of c)f.push(u)}return i}}function pQ(t,e,n){let r=O4(t,e,n);return o=>{let i=r(o);for(let s=i.length-2;s>=0;--s){let a=i[s+1],c=i[s];for(let f of a)c.push(f)}return i}}function v$(t,e){let n=(+t+ +e)/2;return t instanceof Date?new Date(n):n}var dQ={reduceIndex(t,e,{x1:n,x2:r}){return v$(n,r)}},hQ={reduceIndex(t,e,{y1:n,y2:r}){return v$(n,r)}},mQ={reduceIndex(t,e,{x1:n}){return n}},xQ={reduceIndex(t,e,{x2:n}){return n}},gQ={reduceIndex(t,e,{y1:n}){return n}},yQ={reduceIndex(t,e,{y2:n}){return n}};var bQ={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},yc=class extends lt{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s,z:a,curve:c,tension:f}=n;super(e,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0},z:{value:vn(n),optional:!0}},n,bQ),this.z=a,this.curve=mh(c,f)}filter(e){return e}render(e,n,r,o,i){let{x1:s,y1:a,x2:c=s,y2:f=a}=r;return ot("svg:g",i).call(wt,this,o,i).call(xt,this,n,0,0).call(u=>u.selectAll().data(eb(e,[s,a,c,f],this,r)).enter().append("path").call(dt,this).call(uc,this,r).attr("d",Vf().curve(this.curve).defined(p=>p>=0).x0(p=>s[p]).y0(p=>a[p]).x1(p=>c[p]).y1(p=>f[p]))).node()}};function xh(t,e){return e===void 0?Wi(t,{x:ic,y:Es}):new yc(t,e)}function Vs(t,e){let{y:n=Zt,...r}=Cu(e);return new yc(t,js(Ys({...r,y1:n,y2:void 0})))}function Wi(t,e){let{x:n=Zt,...r}=Nu(e);return new yc(t,Xs(Us({...r,x1:n,x2:void 0})))}var wQ={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},gh=class extends lt{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s,curve:a,tension:c}=n;super(e,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,wQ),this.curve=Nb(a,c),Kr(this,n)}project(e,n,r){this.curve!==Ws&&super.project(e,n,r)}render(e,n,r,o,i){let{x1:s,y1:a,x2:c=s,y2:f=a}=r,{curve:u}=this;return ot("svg:g",i).call(wt,this,o,i).call(xt,this,n).call(p=>p.selectAll().data(e).enter().append("path").call(dt,this).attr("d",u===Ws&&i.projection?vQ(i.projection,s,a,c,f):l=>{let d=Ln(),h=u(d);return h.lineStart(),h.point(s[l],a[l]),h.point(c[l],f[l]),h.lineEnd(),d}).call(Tt,this,r).call(ji,this,r,i)).node()}};function vQ(t,e,n,r,o){let i=Ue(t);return e=Ne(e),n=Ne(n),r=Ne(r),o=Ne(o),s=>i({type:"LineString",coordinates:[[e[s],n[s]],[r[s],o[s]]]})}function kb(t,{x:e,x1:n,x2:r,y:o,y1:i,y2:s,...a}={}){return[n,r]=yh(e,n,r),[i,s]=yh(o,i,s),new gh(t,{...a,x1:n,x2:r,y1:i,y2:s})}function yh(t,e,n){if(t===void 0){if(e===void 0){if(n!==void 0)return[n]}else if(n===void 0)return[e]}else{if(e===void 0)return n===void 0?[t]:[t,n];if(n===void 0)return[t,e]}return[e,n]}var _Q={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5},bh=class extends lt{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s,bend:a=0,headAngle:c=60,headLength:f=8,inset:u=0,insetStart:p=u,insetEnd:l=u,sweep:d}=n;super(e,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,_Q),this.bend=a===!0?22.5:Math.max(-90,Math.min(90,a)),this.headAngle=+c,this.headLength=+f,this.insetStart=+p,this.insetEnd=+l,this.sweep=SQ(d)}render(e,n,r,o,i){let{x1:s,y1:a,x2:c=s,y2:f=a,SW:u}=r,{strokeWidth:p,bend:l,headAngle:d,headLength:h,insetStart:m,insetEnd:x}=this,g=u?w=>u[w]:ue(p===void 0?1:p),y=d*yu/2,b=h/1.5;return ot("svg:g",i).call(wt,this,o,i).call(xt,this,n).call(w=>w.selectAll().data(e).enter().append("path").call(dt,this).attr("d",_=>{let v=s[_],A=a[_],T=c[_],E=f[_],N=Math.hypot(T-v,E-A);if(N<=m+x)return null;let M=Math.atan2(E-A,T-v),k=Math.min(b*g(_),N/3),O=this.sweep(v,A,T,E)*l*yu,S=Math.hypot(N/Math.tan(O),N)/2;if(m||x)if(S<1e5){let K=Math.sign(O),[et,rt]=MQ([v,A],[T,E],S,K);if(m&&([v,A]=_$([et,rt,S],[v,A,m],-K*Math.sign(m))),x){let[j,nt]=_$([et,rt,S],[T,E,x],K*Math.sign(x));M+=Math.atan2(nt-rt,j-et)-Math.atan2(E-rt,T-et),T=j,E=nt}}else{let K=T-v,et=E-A,rt=Math.hypot(K,et);m&&(v+=K/rt*m,A+=et/rt*m),x&&(T-=K/rt*x,E-=et/rt*x)}let I=M+O,C=I+y,L=I-y,D=T-k*Math.cos(C),$=E-k*Math.sin(C),P=T-k*Math.cos(L),F=E-k*Math.sin(L),q=S<1e5?`A${S},${S} 0,0,${O>0?1:0} `:"L",V=k?`M${D},${$}L${T},${E}L${P},${F}`:"";return`M${v},${A}${q}${T},${E}${V}`}).call(Tt,this,r)).node()}};function SQ(t=1){if(typeof t=="number")return ue(Math.sign(t));if(typeof t=="function")return(e,n,r,o)=>Math.sign(t(e,n,r,o));switch(Oe(t,"sweep",["+x","-x","+y","-y"])){case"+x":return(e,n,r)=>yt(e,r);case"-x":return(e,n,r)=>An(e,r);case"+y":return(e,n,r,o)=>yt(n,o);case"-y":return(e,n,r,o)=>An(n,o)}}function MQ([t,e],[n,r],o,i){let s=n-t,a=r-e,c=Math.hypot(s,a),f=i*Math.sqrt(o*o-c*c/4)/c;return[(t+n)/2-a*f,(e+r)/2+s*f]}function _$([t,e,n],[r,o,i],s){let a=r-t,c=o-e,f=Math.hypot(a,c),u=(a*a+c*c-i*i+n*n)/(2*f),p=s*Math.sqrt(n*n-u*u);return[t+(a*u+c*p)/f,e+(c*u-a*p)/f]}function S$(t,{x:e,x1:n,x2:r,y:o,y1:i,y2:s,...a}={}){return[n,r]=yh(e,n,r),[i,s]=yh(o,i,s),new bh(t,{...a,x1:n,x2:r,y1:i,y2:s})}var AQ={ariaLabel:"bar"},ku=class extends lt{constructor(e,n,r={},o=AQ){super(e,n,r,o),ch(this,r),fh(this,r)}render(e,n,r,o,i){let{rx:s,ry:a,rx1y1:c,rx1y2:f,rx2y1:u,rx2y2:p}=this,l=this._x(n,r,o),d=this._y(n,r,o),h=this._width(n,r,o),m=this._height(n,r,o);return ot("svg:g",i).call(wt,this,o,i).call(this._transform,this,n).call(x=>x.selectAll().data(e).enter().call(c||f||u||p?g=>g.append("path").call(dt,this).call(uh,l,d,M$(l,h),M$(d,m),this).call(Tt,this,r):g=>g.append("rect").call(dt,this).attr("x",l).attr("width",h).attr("y",d).attr("height",m).call(at,"rx",s).call(at,"ry",a).call(Tt,this,r))).node()}_x(e,{x:n},{marginLeft:r}){let{insetLeft:o}=this;return n?i=>n[i]+o:r+o}_y(e,{y:n},{marginTop:r}){let{insetTop:o}=this;return n?i=>n[i]+o:r+o}_width({x:e},{x:n},{marginRight:r,marginLeft:o,width:i}){let{insetLeft:s,insetRight:a}=this,c=n&&e?e.bandwidth():i-r-o;return Math.max(0,c-s-a)}_height({y:e},{y:n},{marginTop:r,marginBottom:o,height:i}){let{insetTop:s,insetBottom:a}=this,c=n&&e?e.bandwidth():i-r-o;return Math.max(0,c-s-a)}};function M$(t,e){return typeof t=="function"&&typeof e=="function"?n=>t(n)+e(n):typeof t=="function"?n=>t(n)+e:typeof e=="function"?n=>t+e(n):t+e}var bc=class extends ku{constructor(e,n={},r){let{x1:o,x2:i,y:s}=n;super(e,{x1:{value:o,scale:"x"},x2:{value:i,scale:"x"},y:{value:s,scale:"y",type:"band",optional:!0}},n,r)}_transform(e,n,{x:r}){e.call(xt,n,{x:r},0,0)}_x({x:e},{x1:n,x2:r},{marginLeft:o}){let{insetLeft:i}=this;return lr(e)?o+i:s=>Math.min(n[s],r[s])+i}_width({x:e},{x1:n,x2:r},{marginRight:o,marginLeft:i,width:s}){let{insetLeft:a,insetRight:c}=this;return lr(e)?s-o-i-a-c:f=>Math.max(0,Math.abs(r[f]-n[f])-a-c)}},wc=class extends ku{constructor(e,n={},r){let{x:o,y1:i,y2:s}=n;super(e,{y1:{value:i,scale:"y"},y2:{value:s,scale:"y"},x:{value:o,scale:"x",type:"band",optional:!0}},n,r)}_transform(e,n,{y:r}){e.call(xt,n,{y:r},0,0)}_y({y:e},{y1:n,y2:r},{marginTop:o}){let{insetTop:i}=this;return lr(e)?o+i:s=>Math.min(n[s],r[s])+i}_height({y:e},{y1:n,y2:r},{marginTop:o,marginBottom:i,height:s}){let{insetTop:a,insetBottom:c}=this;return lr(e)?s-o-i-a-c:f=>Math.max(0,Math.abs(r[f]-n[f])-a-c)}};function Xo(t,e={}){return Oi(e)||(e={...e,y:Zt,x2:W}),new bc(t,js(bu(Ys(e))))}function Wo(t,e={}){return Oi(e)||(e={...e,x:Zt,y2:W}),new wc(t,Xs(wu(Us(e))))}var TQ={ariaLabel:"cell"},vc=class extends ku{constructor(e,{x:n,y:r,...o}={}){super(e,{x:{value:n,scale:"x",type:"band",optional:!0},y:{value:r,scale:"y",type:"band",optional:!0}},o,TQ)}_transform(e,n){e.call(xt,n,{},0,0)}};function Gs(t,{x:e,y:n,...r}={}){return[e,n]=me(e,n),new vc(t,{...r,x:e,y:n})}function A$(t,{x:e=Zt,fill:n,stroke:r,...o}={}){return n===void 0&&ce(r)[0]===void 0&&(n=W),new vc(t,{...o,x:e,fill:n,stroke:r})}function T$(t,{y:e=Zt,fill:n,stroke:r,...o}={}){return n===void 0&&ce(r)[0]===void 0&&(n=W),new vc(t,{...o,y:e,fill:n,stroke:r})}var EQ={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function wh(t){return t.sort===void 0&&t.reverse===void 0?$1({channel:"-r"},t):t}var _c=class extends lt{constructor(e,n={}){let{x:r,y:o,r:i,rotate:s,symbol:a=Ci,frameAnchor:c}=n,[f,u]=Ut(s,0),[p,l]=OL(a),[d,h]=Ut(i,p==null?3:4.5);super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},r:{value:d,scale:"r",filter:Pn,optional:!0},rotate:{value:f,optional:!0},symbol:{value:p,scale:"auto",optional:!0}},wh(n),EQ),this.r=h,this.rotate=u,this.symbol=l,this.frameAnchor=Do(c);let{channels:m}=this,{symbol:x}=m;if(x){let{fill:g,stroke:y}=m;x.hint={fill:g?g.value===x.value?"color":"currentColor":this.fill??"currentColor",stroke:y?y.value===x.value?"color":"currentColor":this.stroke??"none"}}}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,r:u,rotate:p,symbol:l}=r,{r:d,rotate:h,symbol:m}=this,[x,g]=Qe(this,o),y=m===Ci,b=u?void 0:d*d*Math.PI;return _s(d)&&(e=[]),ot("svg:g",i).call(wt,this,o,i).call(xt,this,{x:c&&s,y:f&&a}).call(w=>w.selectAll().data(e).enter().append(y?"circle":"path").call(dt,this).call(y?_=>{_.attr("cx",c?v=>c[v]:x).attr("cy",f?v=>f[v]:g).attr("r",u?v=>u[v]:d)}:_=>{_.attr("transform",to`translate(${c?v=>c[v]:x},${f?v=>f[v]:g})${p?v=>` rotate(${p[v]})`:h?` rotate(${h})`:""}`).attr("d",u&&l?v=>{let A=Ln();return l[v].draw(A,u[v]*u[v]*Math.PI),A}:u?v=>{let A=Ln();return m.draw(A,u[v]*u[v]*Math.PI),A}:l?v=>{let A=Ln();return l[v].draw(A,b),A}:(()=>{let v=Ln();return m.draw(v,b),v})())}).call(Tt,this,r)).node()}};function Pr(t,{x:e,y:n,...r}={}){return r.frameAnchor===void 0&&([e,n]=me(e,n)),new _c(t,{...r,x:e,y:n})}function E$(t,{x:e=W,...n}={}){return new _c(t,ib({...n,x:e}))}function I$(t,{y:e=W,...n}={}){return new _c(t,ob({...n,y:e}))}function N$(t,e){return Pr(t,{...e,symbol:"circle"})}function C$(t,e){return Pr(t,{...e,symbol:"hexagon"})}var IQ={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Sc=class extends lt{constructor(e,n={}){let{x:r,y:o,z:i,curve:s,tension:a}=n;super(e,{x:{value:r,scale:"x"},y:{value:o,scale:"y"},z:{value:vn(n),optional:!0}},n,IQ),this.z=i,this.curve=Nb(s,a),Kr(this,n)}filter(e){return e}project(e,n,r){this.curve!==Ws&&super.project(e,n,r)}render(e,n,r,o,i){let{x:s,y:a}=r,{curve:c}=this;return ot("svg:g",i).call(wt,this,o,i).call(xt,this,n).call(f=>f.selectAll().data(eb(e,[s,a],this,r)).enter().append("path").call(dt,this).call(uc,this,r).call(sO,this,r,i).attr("d",c===Ws&&i.projection?NQ(i.projection,s,a):Sd().curve(c).defined(u=>u>=0).x(u=>s[u]).y(u=>a[u]))).node()}};function NQ(t,e,n){let r=Ue(t);return e=Ne(e),n=Ne(n),o=>{let i=[],s=[i];for(let a of o)a===-1?(i=[],s.push(i)):i.push([e[a],n[a]]);return r({type:"MultiLineString",coordinates:s})}}function Mc(t,{x:e,y:n,...r}={}){return[e,n]=me(e,n),new Sc(t,{...r,x:e,y:n})}function Hs(t,{x:e=W,y:n=Zt,...r}={}){return new Sc(t,Cu({...r,x:e,y:n}))}function Qs(t,{x:e=Zt,y:n=W,...r}={}){return new Sc(t,Nu({...r,x:e,y:n}))}function D4(t,e){e=CQ(e);let{x:n,y:r,color:o,size:i}=e,s=Lb(t,n),a=Lb(t,r),c=Lb(t,o),f=Lb(t,i),{fx:u,fy:p,x:{value:l,reduce:d,zero:h,...m},y:{value:x,reduce:g,zero:y,...b},color:{value:w,color:_,reduce:v},size:{value:A,reduce:T},mark:E}=e;if(d===void 0&&(d=g==null&&l==null&&A==null&&x!=null?"count":null),g===void 0&&(g=d==null&&x==null&&A==null&&l!=null?"count":null),T===void 0&&A==null&&v==null&&d==null&&g==null&&(l==null||ie(s))&&(x==null||ie(a))&&(T="count"),h===void 0&&(h=Rb(d)?!0:void 0),y===void 0&&(y=Rb(g)?!0:void 0),l==null&&x==null)throw new Error("must specify x or y");if(d!=null&&x==null)throw new Error("reducing x requires y");if(g!=null&&l==null)throw new Error("reducing y requires x");E===void 0&&(E=A!=null||T!=null?"dot":Rb(d)||Rb(g)||v!=null?"bar":l!=null&&x!=null?ie(s)||ie(a)||d==null&&g==null&&!vh(s)&&!vh(a)?"dot":"line":l!=null||x!=null?"rule":null);let N,M,k;switch(E){case"dot":k=Pr,M="stroke";break;case"line":k=s&&a||d!=null||g!=null?y||g!=null||s&&vh(s)?Qs:h||d!=null||a&&vh(a)?Hs:Mc:s?Hs:Qs,M="stroke",L$(c)&&(N=null);break;case"area":k=!(y||g!=null)&&(h||d!=null||a&&vh(a))?Vs:Wi,M="fill",L$(c)&&(N=null);break;case"rule":k=s?pr:dr,M="stroke";break;case"bar":k=d!=null?ie(a)?k$(d)&&s&&ie(s)?Gs:Xo:Au:g!=null?ie(s)?k$(g)&&a&&ie(a)?Gs:Wo:Tu:v!=null||T!=null?s&&ie(s)&&a&&ie(a)?Gs:s&&ie(s)?Wo:a&&ie(a)?Xo:lh:s&&Di(s)&&!(a&&Di(a))?Xo:a&&Di(a)&&!(s&&Di(s))?Wo:Gs,M="fill";break;default:throw new Error(`invalid mark: ${E}`)}let O={fx:u,fy:p,x:s??void 0,y:a??void 0,[M]:c??_,z:N,r:f??void 0,tip:!0},S,I={[M]:v??void 0,r:T??void 0};if(d!=null&&g!=null)throw new Error("cannot reduce both x and y");return g!=null?(I.y=g,S=ie(s)?Ls:Uo):d!=null?(I.x=d,S=ie(a)?Rs:jo):(v!=null||T!=null)&&(s&&a?S=ie(s)&&ie(a)?Hd:ie(s)?jo:ie(a)?Uo:Xi:s?S=ie(s)?Ls:Uo:a&&(S=ie(a)?Rs:jo)),(S===Xi||S===Uo)&&(O.x={value:s,...m}),(S===Xi||S===jo)&&(O.y={value:a,...b}),h===void 0&&(h=s&&!(S===Xi||S===Uo)&&(k===Xo||k===Vs||k===Au||k===dr)),y===void 0&&(y=a&&!(S===Xi||S===jo)&&(k===Wo||k===Wi||k===Tu||k===pr)),{fx:u??null,fy:p??null,x:{value:l??null,reduce:d??null,zero:!!h,...m},y:{value:x??null,reduce:g??null,zero:!!y,...b},color:{value:w??null,reduce:v??null,..._!==void 0&&{color:_}},size:{value:A??null,reduce:T??null},mark:E,markImpl:R$[k],markOptions:O,transformImpl:R$[S],transformOptions:I,colorMode:M}}function O$(t,e){let n=D4(t,e),{fx:r,fy:o,x:{zero:i},y:{zero:s},markOptions:a,transformOptions:c,colorMode:f}=n,u=$4[n.markImpl],p=$4[n.transformImpl],l=r!=null||o!=null?Eu({strokeOpacity:.1}):null,d=[i?pr([0]):null,s?dr([0]):null],h=u(t,p?p(c,a):a);return f==="stroke"?ke(l,d,h):ke(l,h,d)}function vh(t){let e,n;for(let r of t){if(r==null)continue;if(e===void 0){e=r;continue}let o=Math.sign(yt(e,r));if(o){if(n!==void 0&&o!==n)return!1;e=r,n=o}}return!0}function CQ({x:t,y:e,color:n,size:r,fx:o,fy:i,mark:s}={}){return fr(t)||(t=Lu(t)),fr(e)||(e=Lu(e)),fr(n)||(n=ks(n)?{color:n}:Lu(n)),fr(r)||(r=Lu(r)),fr(o)&&({value:o}=Lu(o)),fr(i)&&({value:i}=Lu(i)),s!=null&&(s=`${s}`.toLowerCase()),{x:t,y:e,color:n,size:r,fx:o,fy:i,mark:s}}function Lb(t,e){let n=ut(t,e.value);return n&&(n.label=un(e.value)),n}function Lu(t){return kQ(t)?{reduce:t}:{value:t}}function Rb(t){return/^(?:distinct|count|sum|proportion)$/i.test(t)}function k$(t){return/^(?:first|last|mode)$/i.test(t)}function kQ(t){if(t==null)return!1;if(typeof t.reduceIndex=="function"||typeof t.reduce=="function"&&Ve(t)||/^p\d{2}$/i.test(t))return!0;switch(`${t}`.toLowerCase()){case"first":case"last":case"count":case"distinct":case"sum":case"proportion":case"proportion-facet":case"deviation":case"min":case"min-index":case"max":case"max-index":case"mean":case"median":case"variance":case"mode":return!0}return!1}function L$(t){return t?new En(t).size>t.length>>1:!1}var $4={dot:Pr,line:Mc,lineX:Hs,lineY:Qs,areaX:Vs,areaY:Wi,ruleX:pr,ruleY:dr,barX:Xo,barY:Wo,rect:lh,rectX:Au,rectY:Tu,cell:Gs,bin:Xi,binX:Uo,binY:jo,group:Hd,groupX:Ls,groupY:Rs},R$=Object.fromEntries(Object.entries($4).map(([t,e])=>[e,t]));function Ru(t,e={}){let{x:n,x1:r,x2:o}=e;n===void 0&&r===void 0&&o===void 0&&(e={...e,x:n=W});let i={};return n!=null&&(i.x=t),r!=null&&(i.x1=t),o!=null&&(i.x2=t),Hn(i,e)}function Ou(t,e={}){let{y:n,y1:r,y2:o}=e;n===void 0&&r===void 0&&o===void 0&&(e={...e,y:n=W});let i={};return n!=null&&(i.y=t),r!=null&&(i.y1=t),o!=null&&(i.y2=t),Hn(i,e)}function Hn(t={},e={}){let n=vn(e),r=Object.entries(t).map(([o,i])=>{let s=N1(o,e);if(s==null)throw new Error(`missing channel: ${o}`);let[a,c]=Ge(s);return{key:o,input:s,output:a,setOutput:c,map:LQ(i)}});return{...Ce(e,(o,i)=>{let s=ut(o,n),a=r.map(({input:f})=>ut(o,f)),c=r.map(({setOutput:f})=>f(new Array(o.length)));for(let f of i)for(let u of s?rn(f,p=>s[p]).values():[f])r.forEach(({map:p},l)=>p.mapIndex(u,a[l],c[l]));return{data:o,facets:i}}),...Object.fromEntries(r.map(({key:o,output:i})=>[o,i]))}}function LQ(t){if(t==null)throw new Error("missing map");if(typeof t.mapIndex=="function")return t;if(typeof t.map=="function"&&Ve(t))return RQ(t);if(typeof t=="function")return P4(ou(t));switch(`${t}`.toLowerCase()){case"cumsum":return $Q;case"rank":return P4((e,n)=>up(e,r=>n[r]));case"quantile":return P4((e,n)=>OQ(e,r=>n[r]))}throw new Error(`invalid map: ${t}`)}function RQ(t){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:t.map.bind(t)}}function OQ(t,e){let n=po(t,e)-1;return up(t,e).map(r=>r/n)}function P4(t){return{mapIndex(e,n,r){let o=t(e,n);if(o.length!==e.length)throw new Error("map function returned a mismatched length");for(let i=0,s=e.length;i<s;++i)r[e[i]]=o[i]}}}var $Q={mapIndex(t,e,n){let r=0;for(let o of t)n[o]=r+=e[o]}};function $$(t={},e){return arguments.length===1&&(e=t),Ru($u(t),e)}function D$(t={},e){return arguments.length===1&&(e=t),Ou($u(t),e)}function $u(t={}){typeof t=="number"&&(t={k:t});let{k:e,reduce:n,shift:r,anchor:o,strict:i}=t;if(o===void 0&&r!==void 0&&(o=PQ(r),_n(`Warning: the shift option is deprecated; please use anchor "${o}" instead.`)),!((e=Math.floor(e))>0))throw new Error(`invalid k: ${e}`);return FQ(n)(e,DQ(o,e),i)}function DQ(t="middle",e){switch(`${t}`.toLowerCase()){case"middle":return e-1>>1;case"start":return 0;case"end":return e-1}throw new Error(`invalid anchor: ${t}`)}function PQ(t){switch(`${t}`.toLowerCase()){case"centered":return"middle";case"leading":return"start";case"trailing":return"end"}throw new Error(`invalid shift: ${t}`)}function FQ(t="mean"){if(typeof t=="string"){if(/^p\d{2}$/i.test(t))return Ob(ru(t));switch(t.toLowerCase()){case"deviation":return Ob(Mr);case"max":return $b((e,n)=>kt(e,r=>n[r]));case"mean":return qQ;case"median":return Ob(Vr);case"min":return $b((e,n)=>It(e,r=>n[r]));case"mode":return $b((e,n)=>pf(e,r=>n[r]));case"sum":return P$;case"variance":return Ob(ss);case"difference":return YQ;case"ratio":return UQ;case"first":return jQ;case"last":return XQ}}if(typeof t!="function")throw new Error(`invalid reduce: ${t}`);return $b(ou(t))}function Ob(t){return(e,n,r)=>r?{mapIndex(o,i,s){let a=f=>i[f]==null?NaN:+i[f],c=0;for(let f=0;f<e-1;++f)isNaN(a(f))&&++c;for(let f=0,u=o.length-e+1;f<u;++f)isNaN(a(f+e-1))&&++c,s[o[f+n]]=c===0?t($i(o,f,f+e),a):NaN,isNaN(a(f))&&--c}}:{mapIndex(o,i,s){let a=c=>i[c]==null?NaN:+i[c];for(let c=-n;c<0;++c)s[o[c+n]]=t($i(o,0,c+e),a);for(let c=0,f=o.length-n;c<f;++c)s[o[c+n]]=t($i(o,c,c+e),a)}}}function $b(t){return(e,n,r)=>r?{mapIndex(o,i,s){let a=0;for(let c=0;c<e-1;++c)a+=oe(i[o[c]]);for(let c=0,f=o.length-e+1;c<f;++c)a+=oe(i[o[c+e-1]]),a===e&&(s[o[c+n]]=t($i(o,c,c+e),i)),a-=oe(i[o[c]])}}:{mapIndex(o,i,s){for(let a=-n;a<0;++a)s[o[a+n]]=t($i(o,0,a+e),i);for(let a=0,c=o.length-n;a<c;++a)s[o[a+n]]=t($i(o,a,a+e),i)}}}function P$(t,e,n){return n?{mapIndex(r,o,i){let s=0,a=0;for(let c=0;c<t-1;++c){let f=o[r[c]];f===null||isNaN(f)?++s:a+=+f}for(let c=0,f=r.length-t+1;c<f;++c){let u=o[r[c]],p=o[r[c+t-1]];p===null||isNaN(p)?++s:a+=+p,i[r[c+e]]=s===0?a:NaN,u===null||isNaN(u)?--s:a-=+u}}}:{mapIndex(r,o,i){let s=0,a=r.length;for(let c=0,f=Math.min(a,t-e-1);c<f;++c)s+=+o[r[c]]||0;for(let c=-e,f=a-e;c<f;++c)s+=+o[r[c+t-1]]||0,i[r[c+e]]=s,s-=+o[r[c]]||0}}}function qQ(t,e,n){if(n){let r=P$(t,e,n);return{mapIndex(o,i,s){r.mapIndex(o,i,s);for(let a=0,c=o.length-t+1;a<c;++a)s[o[a+e]]/=t}}}else return{mapIndex(r,o,i){let s=0,a=0,c=r.length;for(let f=0,u=Math.min(c,t-e-1);f<u;++f){let p=o[r[f]];p!==null&&!isNaN(p=+p)&&(s+=p,++a)}for(let f=-e,u=c-e;f<u;++f){let p=o[r[f+t-1]],l=o[r[f]];p!==null&&!isNaN(p=+p)&&(s+=p,++a),i[r[f+e]]=s/a,l!==null&&!isNaN(l=+l)&&(s-=l,--a)}}}}function BQ(t,e,n,r){for(let o=n+r;n<o;++n){let i=t[e[n]];if(oe(i))return i}}function zQ(t,e,n,r){for(let o=n+r-1;o>=n;--o){let i=t[e[o]];if(oe(i))return i}}function F$(t,e,n,r){for(let o=n+r;n<o;++n){let i=t[e[n]];if(i!==null&&!isNaN(i=+i))return i}}function q$(t,e,n,r){for(let o=n+r-1;o>=n;--o){let i=t[e[o]];if(i!==null&&!isNaN(i=+i))return i}}function YQ(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s){let c=o[r[s]],f=o[r[s+t-1]];i[r[s+e]]=c===null||f===null?NaN:f-c}}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=q$(o,r,s,t)-F$(o,r,s,t)}}}function UQ(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s){let c=o[r[s]],f=o[r[s+t-1]];i[r[s+e]]=c===null||f===null?NaN:f/c}}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=q$(o,r,s,t)/F$(o,r,s,t)}}}function jQ(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s)i[r[s+e]]=o[r[s]]}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=BQ(o,r,s,t)}}}function XQ(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s)i[r[s+e]]=o[r[s+t-1]]}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=zQ(o,r,s,t)}}}var Vi={n:20,k:2,color:"currentColor",opacity:.2,strict:!0,anchor:"end"};function B$(t,{x:e=W,y:n,k:r=Vi.k,color:o=Vi.color,opacity:i=Vi.opacity,fill:s=o,fillOpacity:a=i,stroke:c=o,strokeOpacity:f,strokeWidth:u,...p}={}){return ke(zt(s)?null:Vs(t,Hn({x1:Zs({k:-r,...p}),x2:Zs({k:r,...p})},{x1:e,x2:e,y:n,fill:s,fillOpacity:a,...p})),zt(c)?null:Hs(t,Hn({x:Zs(p)},{x:e,y:n,stroke:c,strokeOpacity:f,strokeWidth:u,...p})))}function z$(t,{x:e,y:n=W,k:r=Vi.k,color:o=Vi.color,opacity:i=Vi.opacity,fill:s=o,fillOpacity:a=i,stroke:c=o,strokeOpacity:f,strokeWidth:u,...p}={}){return ke(zt(s)?null:Wi(t,Hn({y1:Zs({k:-r,...p}),y2:Zs({k:r,...p})},{x:e,y1:n,y2:n,fill:s,fillOpacity:a,...p})),zt(c)?null:Qs(t,Hn({y:Zs(p)},{x:e,y:n,stroke:c,strokeOpacity:f,strokeWidth:u,...p})))}function Zs({n:t=Vi.n,k:e=0,strict:n=Vi.strict,anchor:r=Vi.anchor}={}){return $u({k:t,reduce:o=>pi(o)+e*(Mr(o)||0),strict:n,anchor:r})}var WQ={ariaLabel:"tick",fill:null,stroke:"currentColor"},Db=class extends lt{constructor(e,n,r){super(e,n,r,WQ),Kr(this,r)}render(e,n,r,o,i){return ot("svg:g",i).call(wt,this,o,i).call(this._transform,this,n).call(s=>s.selectAll().data(e).enter().append("line").call(dt,this).attr("x1",this._x1(n,r,o)).attr("x2",this._x2(n,r,o)).attr("y1",this._y1(n,r,o)).attr("y2",this._y2(n,r,o)).call(Tt,this,r).call(ji,this,r,i)).node()}},_h=class extends Db{constructor(e,n={}){let{x:r,y:o,inset:i=0,insetTop:s=i,insetBottom:a=i}=n;super(e,{x:{value:r,scale:"x"},y:{value:o,scale:"y",type:"band",optional:!0}},n),this.insetTop=Dt(s),this.insetBottom=Dt(a)}_transform(e,n,{x:r}){e.call(xt,n,{x:r},le,0)}_x1(e,{x:n}){return r=>n[r]}_x2(e,{x:n}){return r=>n[r]}_y1({y:e},{y:n},{marginTop:r}){let{insetTop:o}=this;return n&&e?i=>n[i]+o:r+o}_y2({y:e},{y:n},{height:r,marginBottom:o}){let{insetBottom:i}=this;return n&&e?s=>n[s]+e.bandwidth()-i:r-o-i}},Sh=class extends Db{constructor(e,n={}){let{x:r,y:o,inset:i=0,insetRight:s=i,insetLeft:a=i}=n;super(e,{y:{value:o,scale:"y"},x:{value:r,scale:"x",type:"band",optional:!0}},n),this.insetRight=Dt(s),this.insetLeft=Dt(a)}_transform(e,n,{y:r}){e.call(xt,n,{y:r},0,le)}_x1({x:e},{x:n},{marginLeft:r}){let{insetLeft:o}=this;return n&&e?i=>n[i]+o:r+o}_x2({x:e},{x:n},{width:r,marginRight:o}){let{insetRight:i}=this;return n&&e?s=>n[s]+e.bandwidth()-i:r-o-i}_y1(e,{y:n}){return r=>n[r]}_y2(e,{y:n}){return r=>n[r]}};function Pb(t,{x:e=W,...n}={}){return new _h(t,{...n,x:e})}function Fb(t,{y:e=W,...n}={}){return new Sh(t,{...n,y:e})}function Y$(t,{x:e=W,y:n=null,r,fill:o="#ccc",fillOpacity:i,stroke:s="currentColor",strokeOpacity:a,strokeWidth:c=2,sort:f,...u}={}){let p=n!=null?Rs:Gd;return ke(dr(t,p({x1:F4,x2:q4},{x:e,y:n,stroke:s,strokeOpacity:a,...u})),Xo(t,p({x1:"p25",x2:"p75"},{x:e,y:n,fill:o,fillOpacity:i,...u})),Pb(t,p({x:"p50"},{x:e,y:n,stroke:s,strokeOpacity:a,strokeWidth:c,sort:f,...u})),Pr(t,Hn({x:j$},{x:e,y:n,z:n,r,stroke:s,strokeOpacity:a,...u})))}function U$(t,{y:e=W,x:n=null,r,fill:o="#ccc",fillOpacity:i,stroke:s="currentColor",strokeOpacity:a,strokeWidth:c=2,sort:f,...u}={}){let p=n!=null?Ls:Gd;return ke(pr(t,p({y1:F4,y2:q4},{x:n,y:e,stroke:s,strokeOpacity:a,...u})),Wo(t,p({y1:"p25",y2:"p75"},{x:n,y:e,fill:o,fillOpacity:i,...u})),Fb(t,p({y:"p50"},{x:n,y:e,stroke:s,strokeOpacity:a,strokeWidth:c,sort:f,...u})),Pr(t,Hn({y:j$},{x:n,y:e,z:n,r,stroke:s,strokeOpacity:a,...u})))}function j$(t){let e=F4(t),n=q4(t);return t.map(r=>r<e||r>n?r:NaN)}function F4(t){let e=X$(t)*2.5-W$(t)*1.5;return It(t,n=>n>=e?n:NaN)}function q4(t){let e=W$(t)*2.5-X$(t)*1.5;return kt(t,n=>n<=e?n:NaN)}function X$(t){return In(t,.25)}function W$(t){return In(t,.75)}var VQ={ariaLabel:"raster",stroke:null,pixelSize:1};function Du(t,e){let n=+t;if(isNaN(n))throw new Error(`invalid ${e}: ${t}`);return n}function V$(t,e){let n=Math.floor(t);if(isNaN(n))throw new Error(`invalid ${e}: ${t}`);return n}var Ah=class extends lt{constructor(e,n,r={},o){let{width:i,height:s,x:a,y:c,x1:f=a==null?0:void 0,y1:u=c==null?0:void 0,x2:p=a==null?i:void 0,y2:l=c==null?s:void 0,pixelSize:d=o.pixelSize,blur:h=0,interpolate:m}=r;if(i!=null&&(i=V$(i,"width")),s!=null&&(s=V$(s,"height")),f!=null&&(f=Du(f,"x1")),u!=null&&(u=Du(u,"y1")),p!=null&&(p=Du(p,"x2")),l!=null&&(l=Du(l,"y2")),a==null&&(f==null||p==null))throw new Error("missing x");if(c==null&&(u==null||l==null))throw new Error("missing y");e!=null&&i!=null&&s!=null&&(a===void 0&&f!=null&&p!=null&&(a=eZ(f,p,i,s)),c===void 0&&u!=null&&l!=null&&(c=nZ(u,l,i,s))),super(e,{x:{value:a,scale:"x",optional:!0},y:{value:c,scale:"y",optional:!0},x1:{value:f==null?null:[f],scale:"x",optional:!0,filter:null},y1:{value:u==null?null:[u],scale:"y",optional:!0,filter:null},x2:{value:p==null?null:[p],scale:"x",optional:!0,filter:null},y2:{value:l==null?null:[l],scale:"y",optional:!0,filter:null},...n},r,o),this.width=i,this.height=s,this.pixelSize=Du(d,"pixelSize"),this.blur=Du(h,"blur"),this.interpolate=a==null||c==null?null:GQ(m)}},Th=class extends Ah{constructor(e,n={}){let{imageRendering:r}=n;if(e==null){let{fill:o,fillOpacity:i}=n;Ut(i)[0]!==void 0&&(n=qb("fillOpacity",n)),ce(o)[0]!==void 0&&(n=qb("fill",n))}super(e,void 0,n,VQ),this.imageRendering=te(r,"auto")}scale(e,{color:n,...r},o){return super.scale(e,r,o)}render(e,n,r,o,i){let s=n[r.channels.fill?.scale]??(I=>I),{x:a,y:c}=r,{document:f}=i,[u,p,l,d]=H$(r,o,i),h=l-u,m=d-p,{pixelSize:x,width:g=Math.round(Math.abs(h)/x),height:y=Math.round(Math.abs(m)/x)}=this,b=g*y,{fill:w,fillOpacity:_}=r,v=0;if(this.interpolate){let I=g/h,C=y/m,L=Et(a,$=>($-u)*I,Float64Array),D=Et(c,$=>($-p)*C,Float64Array);w&&(w=this.interpolate(e,g,y,L,D,w)),_&&(_=this.interpolate(e,g,y,L,D,_))}else this.data==null&&e&&(v=e.fi*b);let A=f.createElement("canvas");A.width=g,A.height=y;let T=A.getContext("2d"),E=T.createImageData(g,y),N=E.data,{r:M,g:k,b:O}=Le(this.fill)??{r:0,g:0,b:0},S=(this.fillOpacity??1)*255;for(let I=0;I<b;++I){let C=I<<2;if(w){let L=s(w[I+v]);if(L==null){N[C+3]=0;continue}({r:M,g:k,b:O}=Le(L))}_&&(S=_[I+v]*255),N[C+0]=M,N[C+1]=k,N[C+2]=O,N[C+3]=S}return this.blur>0&&a_(E,this.blur),T.putImageData(E,0,0),ot("svg:g",i).call(wt,this,o,i).call(xt,this,n).call(I=>I.append("image").attr("transform",`translate(${u},${p}) scale(${Math.sign(l-u)},${Math.sign(d-p)})`).attr("width",Math.abs(h)).attr("height",Math.abs(m)).attr("preserveAspectRatio","none").call(at,"image-rendering",this.imageRendering).call(dt,this).attr("xlink:href",A.toDataURL())).node()}};function B4(t,e,n){arguments.length<3&&(n=e,e=null);let{x:r,y:o,[t]:i,...s}=n;return r===void 0&&o===void 0&&_L(e)&&(r=ic,o=Es,i===void 0&&(i=yL)),[e,{...s,x:r,y:o,[t]:i}]}function G$(){let[t,e]=B4("fill",...arguments);return new Th(t,t==null||e.fill!==void 0||e.fillOpacity!==void 0?e:{...e,fill:W})}function H$({x1:t,y1:e,x2:n,y2:r},o,{projection:i}){let{width:s,height:a,marginTop:c,marginRight:f,marginBottom:u,marginLeft:p}=o;return[t&&i==null?t[0]:p,e&&i==null?e[0]:c,n&&i==null?n[0]:s-f,r&&i==null?r[0]:a-u]}function z4({x1:t,y1:e,x2:n,y2:r},o,i,s){let a={};return t&&(a.x1=t),e&&(a.y1=e),n&&(a.x2=n),r&&(a.y2=r),H$(lu(a,o),i,s)}function qb(t,e={}){let{[t]:n}=e;if(typeof n!="function")throw new Error(`invalid ${t}: not a function`);return Kt({...e,[t]:void 0},function(r,o,i,s,a,c){let{x:f,y:u}=s;if(!f)throw new Error("missing scale: x");if(!u)throw new Error("missing scale: y");let[p,l,d,h]=z4(i,s,a,c),m=d-p,x=h-l,{pixelSize:g}=this,{width:y=Math.round(Math.abs(m)/g),height:b=Math.round(Math.abs(x)/g)}=e,w=new Array(y*b*(o?o.length:1)),_=m/y,v=x/b,A=0;for(let T of o??[void 0])for(let E=.5;E<b;++E)for(let N=.5;N<y;++N,++A)w[A]=n(f.invert(p+N*_),u.invert(l+E*v),T);return{data:w,facets:o,channels:{[t]:{value:w,scale:"auto"}}}})}function GQ(t){if(typeof t=="function")return t;if(t==null)return Bb;switch(`${t}`.toLowerCase()){case"none":return Bb;case"nearest":return Ih;case"barycentric":return Eh();case"random-walk":return Nh()}throw new Error(`invalid interpolate: ${t}`)}function Bb(t,e,n,r,o,i){let s=new Array(e*n);for(let a of t)r[a]<0||r[a]>=e||o[a]<0||o[a]>=n||(s[Math.floor(o[a])*e+Math.floor(r[a])]=i[a]);return s}function Eh({random:t=Wa(42)}={}){return(e,n,r,o,i,s)=>{let{points:a,triangles:c,hull:f}=Er.from(e,d=>o[d],d=>i[d]),u=new s.constructor(n*r).fill(NaN),p=new Uint8Array(n*r),l=tZ(s,t);for(let d=0;d<c.length;d+=3){let h=c[d],m=c[d+1],x=c[d+2],g=a[2*h],y=a[2*m],b=a[2*x],w=a[2*h+1],_=a[2*m+1],v=a[2*x+1],A=Math.min(g,y,b),T=Math.max(g,y,b),E=Math.min(w,_,v),N=Math.max(w,_,v),M=(_-v)*(g-b)+(w-v)*(b-y);if(!M)continue;let k=s[e[h]],O=s[e[m]],S=s[e[x]];for(let I=Math.floor(A);I<T;++I)for(let C=Math.floor(E);C<N;++C){if(I<0||I>=n||C<0||C>=r)continue;let L=I+.5,D=C+.5,$=Math.sign(M),P=(_-v)*(L-b)+(D-v)*(b-y);if(P*$<0)continue;let F=(v-w)*(L-b)+(D-v)*(g-b);if(F*$<0)continue;let q=M-(P+F);if(q*$<0)continue;let V=I+n*C;u[V]=l(k,P/M,O,F/M,S,q/M,I,C),p[V]=1}}return HQ(u,p,o,i,s,n,r,f,e,l),u}}function HQ(t,e,n,r,o,i,s,a,c,f){n=Float64Array.from(a,d=>n[c[d]]),r=Float64Array.from(a,d=>r[c[d]]),o=Array.from(a,d=>o[c[d]]);let u=n.length,p=Array.from({length:u},(d,h)=>ZQ(h,n,r)),l=0;for(let d=0;d<s;++d){let h=d+.5;for(let m=0;m<i;++m){let x=m+i*d;if(!e[x]){let g=m+.5;for(let y=0;y<u;++y){let b=(u+l+(y%2?(y+1)/2:-y/2))%u;if(p[b](g,h)){let w=QQ(n.at(b-1),r.at(b-1),n[b],r[b],g,h);t[x]=f(o.at(b-1),w,o[b],1-w,o[b],0,m,d),l=b;break}}}}}}function QQ(t,e,n,r,o,i){let s=n-t,a=r-e,c=s*(n-o)+a*(r-i),f=s*(o-t)+a*(i-e);return c>0&&f>0?c/(c+f):+(c>f)}function Mh(t,e,n,r){return t*r-n*e}function ZQ(t,e,n){let r=e.length,o=e.at(t-2),i=n.at(t-2),s=e.at(t-1),a=n.at(t-1),c=e[t],f=n[t],u=e.at(t+1-r),p=n.at(t+1-r),l=s-c,d=a-f,h=o-s,m=i-a,x=c-u,g=f-p,y=Math.hypot(l,d),b=Math.hypot(h,m),w=Math.hypot(x,g);return(_,v)=>{let A=_-s,T=v-a,E=_-c,N=v-f;return Mh(A,T,E,N)>-1e-6&&Mh(A,T,l,d)*b-Mh(A,T,h,m)*y>-1e-6&&Mh(E,N,x,g)*y-Mh(E,N,l,d)*w<=0}}function Ih(t,e,n,r,o,i){let s=new i.constructor(e*n),a=Er.from(t,u=>r[u],u=>o[u]),c,f;for(let u=.5,p=0;u<n;++u){f=c;for(let l=.5;l<e;++l,++p)f=a.find(l,u,f),l===.5&&(c=f),s[p]=i[t[f]]}return s}function Nh({random:t=Wa(42),minDistance:e=.5,maxSteps:n=2}={}){return(r,o,i,s,a,c)=>{let f=new c.constructor(o*i),u=Er.from(r,h=>s[h],h=>a[h]),p,l,d;for(let h=.5,m=0;h<i;++h){l=p;for(let x=.5;x<o;++x,++m){let g=x,y=h;d=l=u.find(g,y,l),x===.5&&(p=l);let b,w=0;for(;(b=Math.hypot(s[r[d]]-g,a[r[d]]-y))>e&&w<n;){let _=t(x,h,w)*2*Math.PI;g+=Math.cos(_)*b,y+=Math.sin(_)*b,d=u.find(g,y,d),++w}f[m]=c[r[d]]}}return f}}function JQ(t,e,n,r,o,i){return e*t+r*n+i*o}function KQ(t){return(e,n,r,o,i,s,a,c)=>{let f=t(a,c);return f<n?e:f<n+o?r:i}}function tZ(t,e){return Di(t)||fe(t)?JQ:KQ(e)}function eZ(t,e,n){return{transform(r){let o=r.length,i=new Float64Array(o),s=(e-t)/n,a=t+s/2;for(let c=0;c<o;++c)i[c]=c%n*s+a;return i}}}function nZ(t,e,n,r){return{transform(o){let i=o.length,s=new Float64Array(i),a=(e-t)/r,c=t+a/2;for(let f=0;f<i;++f)s[f]=Math.floor(f/n)%r*a+c;return s}}}var Q$={ariaLabel:"contour",fill:"none",stroke:"currentColor",strokeMiterlimit:1,pixelSize:2},Ch=class extends Ah{constructor(e,{smooth:n=!0,value:r,...o}={}){let i=tb({},o,Q$);if(r===void 0){for(let a in i)if(i[a].value!=null){if(r!==void 0)throw new Error("ambiguous contour value");r=o[a],o[a]="value"}}if(r!=null){let a={transform:c=>c.map(f=>f.value),label:un(r)};for(let c in i)o[c]==="value"&&(o[c]=a)}if(e==null){if(r==null)throw new Error("missing contour value");o=qb("value",{value:r,...o}),r=null}else{let{interpolate:a}=o;r===void 0&&(r=W),a===void 0&&(o.interpolate="nearest")}super(e,{value:{value:r,optional:!0}},rZ(o),Q$);let s={geometry:{value:W}};for(let a in this.channels){let c=this.channels[a],{scale:f}=c;f==="x"||f==="y"||a==="value"||(s[a]=c,delete this.channels[a])}this.contourChannels=s,this.smooth=!!n}filter(e,{x:n,y:r,value:o,...i},s){return super.filter(e,i,s)}render(e,n,r,o,i){let{geometry:s}=r,a=Ue();return ot("svg:g",i).call(wt,this,o,i).call(xt,this,n).call(c=>{c.selectAll().data(e).enter().append("path").call(dt,this).attr("d",f=>a(s[f])).call(Tt,this,r)}).node()}};function rZ({thresholds:t,interval:e,...n}){return t=R4(t,e,as),Kt(n,function(r,o,i,s,a,c){let[f,u,p,l]=z4(i,s,a,c),d=p-f,h=l-u,{pixelSize:m,width:x=Math.round(Math.abs(d)/m),height:g=Math.round(Math.abs(h)/m)}=this,y=x/d,b=g/h,w=i.value.value,_=[];if(this.interpolate){let{x:N,y:M}=Bo(i,s,c),k=Et(N,C=>(C-f)*y,Float64Array),O=Et(M,C=>(C-u)*b,Float64Array),S=[i.x,i.y,i.value],I=[k,O,w];for(let C of o){let L=this.filter(C,S,I);_.push(this.interpolate(L,x,g,k,O,w))}}else if(o){let N=x*g,M=o.length;for(let k=0;k<M;++k)_.push(w.slice(k*N,k*N+N))}else _.push(w);if(this.blur>0)for(let N of _)ip({data:N,width:x,height:g},this.blur);let v=oZ(t,w,...iZ(_));if(v===null)throw new Error(`unsupported thresholds: ${t}`);let{contour:A}=hs().size([x,g]).smooth(this.smooth),T=[],E=[];for(let N of _)E.push(ye(T.length,T.push(...Et(v,M=>A(N,M)))));for(let{coordinates:N}of T)for(let M of N)for(let k of M)for(let O of k)O[0]=O[0]/y+f,O[1]=O[1]/b+u;return{data:T,facets:E,channels:z1(this.contourChannels,T)}})}function oZ(t,e,n,r){if(typeof t?.range=="function")return t.range(t.floor(n),r);if(typeof t=="function"&&(t=t(e,n,r)),typeof t!="number")return cr(t);let o=on(...uf(n,r,t),t);for(;o[o.length-1]>=r;)o.pop();for(;o[1]<n;)o.shift();return o}function J$(){return new Ch(...B4("value",...arguments))}function iZ(t){return[It(t,e=>It(e,Z$)),kt(t,e=>kt(e,Z$))]}function Z$(t){return isFinite(t)?t:NaN}function eD(t,e){return Y4(qs,t,e)}function nD(t,e={}){return Y4(Bs,t,e)}function rD(t,e={}){return Y4(Ui,t,e)}function Y4(t,e,n={}){let{x:r,y:o,maxRadius:i}=n,s=t({px:r,py:o,maxRadius:i}),a=[];r!=null&&a.push(pr(e,K$("x",{...s,inset:-6},n))),o!=null&&a.push(dr(e,K$("y",{...s,inset:-6},n))),r!=null&&a.push(Yo(e,tD("x",{...s,dy:9,frameAnchor:"bottom",lineAnchor:"top"},n))),o!=null&&a.push(Yo(e,tD("y",{...s,dx:-9,frameAnchor:"left",textAnchor:"end"},n)));for(let c of a)c.ariaLabel=`crosshair ${c.ariaLabel}`;return ke(...a)}function oD(t,{channels:e,...n},{facet:r,facetAnchor:o,fx:i,fy:s,[t]:a,channels:c,transform:f,initializer:u}){return{...n,facet:r,facetAnchor:o,fx:i,fy:s,[t]:a,channels:{...e,...c},transform:f,initializer:sZ(t,u)}}function sZ(t,e){return e==null?e:function(n,r,{x:o,y:i,px:s,py:a,...c},...f){let{channels:{x:u,y:p,...l}={},...d}=e.call(this,n,r,{...c,x:s,y:a},...f);return{channels:{...l,...u&&{px:u,...t==="x"&&{x:u}},...p&&{py:p,...t==="y"&&{y:p}}},...d}}}function K$(t,e,n){let{color:r="currentColor",opacity:o=.2,ruleStroke:i=r,ruleStrokeOpacity:s=o,ruleStrokeWidth:a}=n;return{...oD(t,e,n),stroke:i,strokeOpacity:s,strokeWidth:a}}function tD(t,e,n){let{color:r="currentColor",textFill:o=r,textFillOpacity:i,textStroke:s="var(--plot-background)",textStrokeOpacity:a,textStrokeWidth:c=5}=n;return{...oD(t,e,aZ(t,n)),fill:o,fillOpacity:i,stroke:s,strokeOpacity:a,strokeWidth:c}}function aZ(t,e){return Kt(e,(n,r,o)=>({channels:{text:{value:Zd(o,t)?.value}}}))}var cZ={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},fZ={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},uZ={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},lZ={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},pZ={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},U4=class extends lt{constructor(e,n={}){let{x:r,y:o,z:i,curve:s,tension:a}=n;super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},z:{value:i,optional:!0}},n,cZ),this.curve=mh(s,a),Kr(this,n)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,z:u}=r,{curve:p}=this,[l,d]=Qe(this,o),h=c?y=>c[y]:ue(l),m=f?y=>f[y]:ue(d),x=this;function g(y){let b=-1,w=[],_={};for(let S in r)_[S]=[];let v=[],A=[],T=[],E=[];function N(S,I){S=y[S],I=y[I],w.push(++b),v[b]=h(S),T[b]=m(S),A[b]=h(I),E[b]=m(I);for(let C in r)_[C].push(r[C][I])}let{halfedges:M,hull:k,triangles:O}=Er.from(y,h,m);for(let S=0;S<M.length;++S){let I=M[S];I>S&&N(O[S],O[I])}for(let S=0;S<k.length;++S)N(k[S],k[(S+1)%k.length]);Nt(this).selectAll().data(w).enter().append("path").call(dt,x).attr("d",S=>{let I=Ln(),C=p(I);return C.lineStart(),C.point(v[S],T[S]),C.point(A[S],E[S]),C.lineEnd(),I}).call(Tt,x,_).call(ji,x,_,i)}return ot("svg:g",i).call(wt,this,o,i).call(xt,this,{x:c&&s,y:f&&a}).call(u?y=>y.selectAll().data(rn(e,b=>u[b]).values()).enter().append("g").each(g):y=>y.datum(e).each(g)).node()}},kh=class extends lt{constructor(e,n={},r,o=({z:i})=>i){let{x:i,y:s}=n;super(e,{x:{value:i,scale:"x",optional:!0},y:{value:s,scale:"y",optional:!0},z:{value:o(n),optional:!0}},n,r)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,z:u}=r,[p,l]=Qe(this,o),d=c?g=>c[g]:ue(p),h=f?g=>f[g]:ue(l),m=this;function x(g){let y=Er.from(g,d,h);Nt(this).append("path").datum(g[0]).call(dt,m).attr("d",m._render(y,o)).call(Tt,m,r)}return ot("svg:g",i).call(wt,this,o,i).call(xt,this,{x:c&&s,y:f&&a}).call(u?g=>g.selectAll().data(rn(e,y=>u[y]).values()).enter().append("g").each(x):g=>g.datum(e).each(x)).node()}},j4=class extends kh{constructor(e,n={}){super(e,n,fZ),this.fill="none"}_render(e){return e.render()}},X4=class extends kh{constructor(e,n={}){super(e,n,uZ,vn)}_render(e){return e.renderHull()}},W4=class extends lt{constructor(e,n={}){let{x:r,y:o,z:i}=n;super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},z:{value:i,optional:!0}},Kt(n,function(s,a,c,f,u,p){let{x:l,y:d,z:h}=c;({x:l,y:d}=Bo(c,f,p)),h=h?.value;let m=new Array((l??d).length).fill(null),[x,g]=Qe(this,u),y=l?w=>l[w]:ue(x),b=d?w=>d[w]:ue(g);for(let w of a){l&&(w=w.filter(_=>oe(y(_)))),d&&(w=w.filter(_=>oe(b(_))));for(let[,_]of Po(w,h)){let v=Er.from(_,y,b),A=iD(v,u);for(let T=0,E=_.length;T<E;++T)m[_[T]]=A.renderCell(T)}}return{data:s,facets:a,channels:{cells:{value:m}}}}),lZ)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,cells:u}=r;return ot("svg:g",i).call(wt,this,o,i).call(xt,this,{x:c&&s,y:f&&a}).call(p=>{p.selectAll().data(e).enter().append("path").call(dt,this).attr("d",l=>u[l]).call(Tt,this,r)}).node()}},V4=class extends kh{constructor(e,n){super(e,n,pZ),this.fill="none"}_render(e,n){return iD(e,n).render()}};function iD(t,e){let{width:n,height:r,marginTop:o,marginRight:i,marginBottom:s,marginLeft:a}=e;return t.voronoi([a,o,n-i,r-s])}function Lh(t,e,{x:n,y:r,...o}={}){return[n,r]=me(n,r),new t(e,{...o,x:n,y:r})}function sD(t,e){return Lh(U4,t,e)}function aD(t,e){return Lh(j4,t,e)}function cD(t,e){return Lh(X4,t,e)}function fD(t,{x:e,y:n,initializer:r,...o}={}){return Lh(W4,t,{...Ce({...o,x:e,y:n},wb),initializer:r})}function uD(t,e){return Lh(V4,t,e)}var dZ={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Rh=class extends lt{constructor(e,{x:n,y:r,z:o,weight:i,fill:s,stroke:a,...c}={}){let f=lD(s)&&(s="currentColor",!0),u=lD(a)&&(a="currentColor",!0);super(e,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:vn({z:o,fill:s,stroke:a}),optional:!0},weight:{value:i,optional:!0}},mZ({...c,fill:s,stroke:a},f,u),dZ),f&&(this.fill=void 0),u&&(this.stroke=void 0),this.z=o}filter(e){return e}render(e,n,r,o,i){let{contours:s}=r,a=Ue();return ot("svg:g",i).call(wt,this,o,i).call(xt,this,{}).call(c=>c.selectAll().data(e).enter().append("path").call(dt,this).call(Tt,this,r).attr("d",f=>a(s[f]))).node()}};function pD(t,{x:e,y:n,...r}={}){return[e,n]=me(e,n),new Rh(t,{...r,x:e,y:n})}var hZ=new Set(["x","y","z","weight"]);function mZ(t,e,n){let{bandwidth:o,thresholds:i}=t;return o=o===void 0?20:+o,i=i===void 0?20:typeof i?.[Symbol.iterator]=="function"?Ne(i):+i,Kt(t,function(s,a,c,f,u,p){let l=c.weight?Ne(c.weight.value):null,d=c.z?.value,{z:h}=this,[m,x]=Qe(this,u),{width:g,height:y}=u,{x:b,y:w}=Bo(c,f,p),_=Object.fromEntries(Object.entries(c).filter(([O])=>!hZ.has(O)).map(([O,S])=>[O,{...S,value:[]}])),v=e&&[],A=n&&[],T=H_().x(b?O=>b[O]:m).y(w?O=>w[O]:x).weight(l?O=>l[O]:1).size([g,y]).bandwidth(o),E=[];for(let O of a){let S=[];E.push(S);for(let I of d?nh(O,d,h):[O]){let C=T.contours(I);S.push([I,C])}}let N=i;if(!(N instanceof Ud)){let O=0;for(let S of E)for(let[,I]of S){let C=I.max;C>O&&(O=C)}N=Float64Array.from({length:i-1},(S,I)=>O*100*(I+1)/i)}let M=[],k=[];for(let O of E){let S=[];M.push(S);for(let[I,C]of O)for(let L of N){S.push(k.length),k.push(C(L/100)),v&&v.push(L),A&&A.push(L);for(let D in _)_[D].value.push(c[D].value[I[0]])}}return v&&v.push(0),A&&A.push(0),{data:s,facets:M,channels:{..._,...v&&{fill:{value:v,scale:"color"}},...A&&{stroke:{value:A,scale:"color"}},contours:{value:k}}}})}function lD(t){return/^density$/i.test(t)}function mD(t,e){return gD("x",t,e)}function xD(t,e){return gD("y",t,e)}function gD(t,e,{x1:n,x2:r,y1:o,y2:i,x:s=n===void 0&&r===void 0?t==="y"?Zt:W:void 0,y:a=o===void 0&&i===void 0?t==="x"?Zt:W:void 0,fill:c,positiveFill:f="#3ca951",negativeFill:u="#4269d0",fillOpacity:p=1,positiveFillOpacity:l=p,negativeFillOpacity:d=p,stroke:h,strokeOpacity:m,z:x=ce(h)[0],clip:g,tip:y,render:b,...w}={}){return[n,r]=dD(s,n,r),[o,i]=dD(a,o,i),n===r&&o===i&&(t==="y"?o=Gi(0):n=Gi(0)),{tip:y}=Jr({tip:y},t==="y"?"x":"y"),ke(zt(f)?null:Object.assign(xh(e,{x1:n,x2:r,y1:o,y2:i,z:x,fill:f,fillOpacity:l,render:Yi(b,hD(t,!0)),clip:g,...w}),{ariaLabel:"positive difference"}),zt(u)?null:Object.assign(xh(e,{x1:n,x2:r,y1:o,y2:i,z:x,fill:u,fillOpacity:d,render:Yi(b,hD(t,!1)),clip:g,...w}),{ariaLabel:"negative difference"}),Mc(e,{x:r,y:i,z:x,stroke:h,strokeOpacity:m,tip:y,clip:!0,...w}))}function dD(t,e,n){return e===void 0&&n===void 0?e=n=Gi(t):e===void 0?(n=Gi(n),e=t===void 0?n:Gi(t)):n===void 0?(e=Gi(e),n=t===void 0?e:Gi(t)):(e=Gi(e),n=Gi(n)),[e,n]}function Gi(t){let e,{value:n,label:r=un(n)}=$r(t);return{transform:o=>e||(e=ut(o,n)),label:r}}function hD(t,e){let n=t==="x"?"y":"x",r=`${n}1`,o=`${n}2`,i=`${t}1`,s=`${t}2`;return(a,c,f,u,p,l)=>{let{[r]:d,[o]:h}=f,m=new Float32Array(d.length),x=new Float32Array(h.length),g=u[t==="y"?"height":"width"];(e===X1(c[t])<0?m:x).fill(g);let y=l(a,c,{...f,[o]:d,[s]:x},u,p),b=l(a,c,{...f,[r]:h,[i]:m},u,p),w=y.querySelector("g")??y,_=b.querySelector("g")??b;for(let v=0;w.firstChild;v+=2){let A=c4(),T=ot("svg:clipPath",p).attr("id",A).node();T.appendChild(w.firstChild),_.childNodes[v].setAttribute("clip-path",`url(#${A})`),_.insertBefore(T,_.childNodes[v])}return b}}function zb({geometry:t=W,...e}={}){let n=Ps(r=>ut(r,t));return Kt({...e,x:null,y:null,geometry:{transform:n}},(r,o,i,s,a,{projection:c})=>{let f=n(r),u=f.length,p=new Float64Array(u),l=new Float64Array(u),d=Ue(c);for(let h=0;h<u;++h)[p[h],l[h]]=d.centroid(f[h]);return{data:r,facets:o,channels:{x:{value:p,scale:c==null?"x":null,source:null},y:{value:l,scale:c==null?"y":null,source:null}}}})}function yD({geometry:t=W,...e}={}){let n=Ps(o=>ut(o,t)),r=Ps(o=>ut(n(o),l6));return{...e,x:{transform:o=>Float64Array.from(r(o),([i])=>i)},y:{transform:o=>Float64Array.from(r(o),([,i])=>i)},geometry:{transform:n}}}var xZ={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Oh=class extends lt{constructor(e,n={}){let[r,o]=Ut(n.r,3);super(e,{x:{value:n.tip?n.x:null,scale:"x",optional:!0},y:{value:n.tip?n.y:null,scale:"y",optional:!0},r:{value:r,scale:"r",filter:Pn,optional:!0},geometry:{value:n.geometry,scale:"projection"}},wh(n),xZ),this.r=o}render(e,n,r,o,i){let{geometry:s,r:a}=r,c=Ue(i.projection??gZ(n)),{r:f}=this;return _s(f)?e=[]:f!==void 0&&c.pointRadius(f),ot("svg:g",i).call(wt,this,o,i).call(xt,this,n).call(u=>{u.selectAll().data(e).enter().append("path").call(dt,this).attr("d",a?p=>c.pointRadius(a[p])(s[p]):p=>c(s[p])).call(Tt,this,r)}).node()}};function gZ({x:t,y:e}){if(t||e)return t??=n=>n,e??=n=>n,ja({point(n,r){this.stream.point(t(n),e(r))}})}function Yb(t,e={}){return e.tip&&e.x===void 0&&e.y===void 0?e=zb(e):e.geometry===void 0&&(e={...e,geometry:W}),new Oh(t,e)}function bD({strokeWidth:t=1.5,...e}={}){return Yb({type:"Sphere"},{strokeWidth:t,...e})}function wD({strokeOpacity:t=.1,...e}={}){return Yb(g6(),{strokeOpacity:t,...e})}var Pu=.5,Fu=0;function vD(t={fill:"count"},{binWidth:e,...n}={}){let{z:r}=n;return e=e===void 0?20:Dt(e),t=$S(t,n),Fo(t,"fill")&&(n.channels={...n.channels,fill:{value:[]}}),n.symbol===void 0&&(n.symbol="hexagon"),n.r===void 0&&!Fo(t,"r")&&(n.r=e/2),Kt(n,(o,i,s,a,c,f)=>{let{x:u,y:p,z:l,fill:d,stroke:h,symbol:m}=s;if(u===void 0)throw new Error("missing channel: x");if(p===void 0)throw new Error("missing channel: y");({x:u,y:p}=Bo(s,a,f)),l=l?l.value:ut(o,r),d=d?.value,h=h?.value,m=m?.value;let x=Qd(t,{z:l,fill:d,stroke:h,symbol:m}),g=l&&[],y=d&&[],b=h&&[],w=m&&[],_=[],v=[],A=[],T=-1;for(let k of t)k.initialize(o);for(let k of i){let O=[];for(let S of t)S.scope("facet",k);for(let[S,I]of Po(k,x))for(let{index:C,extent:L}of yZ(o,I,u,p,e)){O.push(++T),v.push(L.x),A.push(L.y),l&&g.push(x===l?S:l[C[0]]),d&&y.push(x===d?S:d[C[0]]),h&&b.push(x===h?S:h[C[0]]),m&&w.push(x===m?S:m[C[0]]);for(let D of t)D.reduce(C,L)}_.push(O)}let E=s.x.scale,N=s.y.scale,M={x:{value:v,source:a[E]?{value:Et(v,a[E].invert),scale:E}:null},y:{value:A,source:a[N]?{value:Et(A,a[N].invert),scale:N}:null},...l&&{z:{value:g}},...d&&{fill:{value:y,scale:"auto"}},...h&&{stroke:{value:b,scale:"auto"}},...m&&{symbol:{value:w,scale:"auto"}},...Object.fromEntries(t.map(({name:k,output:O})=>[k,{scale:"auto",label:O.label,radius:k==="r"?e/2:void 0,value:O.transform()}]))};return{data:o,facets:_,channels:M}})}function yZ(t,e,n,r,o){let i=o*(1.5/AS),s=new Map;for(let a of e){let c=n[a],f=r[a];if(isNaN(c)||isNaN(f))continue;let u=Math.round(f=(f-Fu)/i),p=Math.round(c=(c-Pu)/o-(u&1)/2),l=f-u;if(Math.abs(l)*3>1){let m=c-p,x=p+(c<p?-1:1)/2,g=u+(f<u?-1:1),y=c-x,b=f-g;m*m+l*l>y*y+b*b&&(p=x+(u&1?1:-1)/2,u=g)}let d=`${p},${u}`,h=s.get(d);h===void 0&&(h={index:[],extent:{data:t,x:(p+(u&1)/2)*o+Pu,y:u*i+Fu}},s.set(d,h)),h.index.push(a)}return s.values()}var bZ={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};function _D(t){return new $h(t)}var $h=class extends lt{constructor({binWidth:e=20,clip:n=!0,...r}={}){super(Ts,void 0,{clip:n,...r},bZ),this.binWidth=Dt(e)}render(e,n,r,o,i){let{binWidth:s}=this,{marginTop:a,marginRight:c,marginBottom:f,marginLeft:u,width:p,height:l}=o,d=u-Pu,h=p-c-Pu,m=a-Fu,x=l-f-Fu,g=s/2,y=g*TS,b=y/2,w=g*2,_=y*1.5,v=Math.floor(d/w),A=Math.ceil(h/w),T=Math.floor((m+b)/_),E=Math.ceil((x-b)/_)+1,N=`m0,${Js(-y)}l${Js(g)},${Js(b)}v${Js(y)}l${Js(-g)},${Js(b)}`,M=N;for(let k=T;k<E;++k)for(let O=v;O<A;++O)M+=`M${Js(O*w+(k&1)*g)},${Js(k*_)}${N}`;return ot("svg:g",i).datum(0).call(wt,this,o,i).call(xt,this,{},le+Pu,le+Fu).call(k=>k.append("path").call(dt,this).call(Tt,this,r).attr("d",M)).node()}};function Js(t){return Math.round(t*1e3)/1e3}var wZ={ariaLabel:"image",fill:null,stroke:null};function vZ(t){return/^\.*\//.test(t)}function _Z(t){return/^(blob|data|file|http|https):/i.test(t)}function SZ(t){return typeof t=="string"&&(vZ(t)||_Z(t))?[void 0,t]:[t,void 0]}var Dh=class extends lt{constructor(e,n={}){let{x:r,y:o,r:i,width:s,height:a,rotate:c,src:f,preserveAspectRatio:u,crossOrigin:p,frameAnchor:l,imageRendering:d}=n;i==null&&(i=void 0),i===void 0&&s===void 0&&a===void 0?s=a=16:s===void 0&&a!==void 0?s=a:a===void 0&&s!==void 0&&(a=s);let[h,m]=SZ(f),[x,g]=Ut(i),[y,b]=Ut(s,g!==void 0?g*2:void 0),[w,_]=Ut(a,g!==void 0?g*2:void 0),[v,A]=Ut(c,0);super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},r:{value:x,scale:"r",filter:Pn,optional:!0},width:{value:y,filter:Pn,optional:!0},height:{value:w,filter:Pn,optional:!0},rotate:{value:v,optional:!0},src:{value:h,optional:!0}},wh(n),wZ),this.src=m,this.width=b,this.rotate=A,this.height=_,this.r=g,this.preserveAspectRatio=te(u,"xMidYMid"),this.crossOrigin=be(p),this.frameAnchor=Do(l),this.imageRendering=te(d,"auto")}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,width:u,height:p,r:l,rotate:d,src:h}=r,{r:m,width:x,height:g,rotate:y}=this,[b,w]=Qe(this,o);return ot("svg:g",i).call(wt,this,o,i).call(xt,this,{x:c&&s,y:f&&a}).call(_=>_.selectAll().data(e).enter().append("image").call(dt,this).attr("x",SD(c,u,l,b,x,m)).attr("y",SD(f,p,l,w,g,m)).attr("width",u?v=>u[v]:x!==void 0?x:l?v=>l[v]*2:m*2).attr("height",p?v=>p[v]:g!==void 0?g:l?v=>l[v]*2:m*2).attr("transform",d?v=>`rotate(${d[v]})`:y?`rotate(${y})`:null).attr("transform-origin",d||y?to`${c?v=>c[v]:b}px ${f?v=>f[v]:w}px`:null).call(at,"href",h?v=>h[v]:this.src).call(at,"preserveAspectRatio",this.preserveAspectRatio).call(at,"crossorigin",this.crossOrigin).call(at,"image-rendering",this.imageRendering).call(at,"clip-path",l?v=>`circle(${l[v]}px)`:m!==void 0?`circle(${m}px)`:null).call(Tt,this,r)).node()}};function SD(t,e,n,r,o,i){return e&&t?s=>t[s]-e[s]/2:e?s=>r-e[s]/2:t&&o!==void 0?s=>t[s]-o/2:o!==void 0?r-o/2:n&&t?s=>t[s]-n[s]:n?s=>r-n[s]:t?s=>t[s]-i:r-i}function MD(t,{x:e,y:n,...r}={}){return r.frameAnchor===void 0&&([e,n]=me(e,n)),new Dh(t,{...r,x:e,y:n})}function MZ(t,e,n){var r=1e-8,o=e-1,i=n-1,s=0,a,c,f,u,p,l,d,h,m,x,g;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&n>=1?(f=t<.5?t:1-t,u=Math.sqrt(-2*Math.log(f)),d=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,t<.5&&(d=-d),h=(d*d-3)/6,m=2/(1/(2*e-1)+1/(2*n-1)),x=d*Math.sqrt(h+m)/m-(1/(2*n-1)-1/(2*e-1))*(h+5/6-2/(3*m)),d=e/(e+n*Math.exp(2*x))):(a=Math.log(e/(e+n)),c=Math.log(n/(e+n)),u=Math.exp(e*a)/e,p=Math.exp(n*c)/n,x=u+p,t<u/x?d=Math.pow(e*x*t,1/e):d=1-Math.pow(n*x*(1-t),1/n)),g=-qu(e)-qu(n)+qu(e+n);s<10;s++){if(d===0||d===1)return d;if(l=AZ(d,e,n)-t,u=Math.exp(o*Math.log(d)+i*Math.log(1-d)+g),p=l/u,d-=u=p/(1-.5*Math.min(1,p*(o/d-i/(1-d)))),d<=0&&(d=.5*(d+u)),d>=1&&(d=.5*(d+u+1)),Math.abs(u)<r*d&&s>0)break}return d}function AZ(t,e,n){var r=t===0||t===1?0:Math.exp(qu(e+n)-qu(e)-qu(n)+e*Math.log(t)+n*Math.log(1-t));return t<0||t>1?!1:t<(e+1)/(e+n+2)?r*AD(t,e,n)/e:1-r*AD(1-t,n,e)/n}function AD(t,e,n){var r=1e-30,o=1,i=e+n,s=e+1,a=e-1,c=1,f=1-i*t/s,u,p,l,d;for(Math.abs(f)<r&&(f=r),f=1/f,d=f;o<=100&&(u=2*o,p=o*(n-o)*t/((a+u)*(e+u)),f=1+p*f,Math.abs(f)<r&&(f=r),c=1+p/c,Math.abs(c)<r&&(c=r),f=1/f,d*=f*c,p=-(e+o)*(i+o)*t/((e+u)*(s+u)),f=1+p*f,Math.abs(f)<r&&(f=r),c=1+p/c,Math.abs(c)<r&&(c=r),f=1/f,l=f*c,d*=l,!(Math.abs(l-1)<3e-7));o++);return d}function qu(t){var e=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,o,i,s;for(s=(i=o=t)+5.5,s-=(o+.5)*Math.log(s);e<6;e++)r+=n[e]/++i;return Math.log(2.506628274631*r/o)-s}function TD(t,e){var n=MZ(2*Math.min(t,1-t),.5*e,.5);return n=Math.sqrt(e*(1-n)/n),t>.5?n:-n}var TZ={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Ub=class extends lt{constructor(e,n={}){let{x:r,y:o,z:i,ci:s=.95,precision:a=4}=n;if(super(e,{x:{value:r,scale:"x"},y:{value:o,scale:"y"},z:{value:vn(n),optional:!0}},n,TZ),this.z=i,this.ci=+s,this.precision=+a,!(0<=this.ci&&this.ci<1))throw new Error(`invalid ci; not in [0, 1): ${s}`);if(!(this.precision>0))throw new Error(`invalid precision: ${a}`)}render(e,n,r,o,i){let{x:s,y:a,z:c}=r,{ci:f}=this;return ot("svg:g",i).call(wt,this,o,i).call(xt,this,n).call(u=>u.selectAll().data(c?nh(e,c,this.z):[e]).enter().call(p=>p.append("path").attr("fill","none").call(dt,this).call(uc,this,{...r,fill:null,fillOpacity:null}).attr("d",l=>this._renderLine(l,s,a)).call(f&&!Pi(this.fill)?l=>l.select(EZ).attr("stroke","none").call(dt,this).call(uc,this,{...r,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",d=>this._renderBand(d,s,a)):()=>{}))).node()}};function EZ(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(Nn.svg,"path"),this)}var G4=class extends Ub{constructor(e,n){super(e,n)}_renderBand(e,n,r){let{ci:o,precision:i}=this,[s,a]=Ft(e,u=>r[u]),c=jb(e,r,n),f=ND(e,r,n,(1-o)/2,c);return Vf().y(u=>u).x0(u=>f(u,-1)).x1(u=>f(u,1))(ye(s,a-i/2,i).concat(a))}_renderLine(e,n,r){let[o,i]=Ft(e,a=>r[a]),s=jb(e,r,n);return`M${s(o)},${o}L${s(i)},${i}`}},H4=class extends Ub{constructor(e,n){super(e,n)}_renderBand(e,n,r){let{ci:o,precision:i}=this,[s,a]=Ft(e,u=>n[u]),c=jb(e,n,r),f=ND(e,n,r,(1-o)/2,c);return Vf().x(u=>u).y0(u=>f(u,-1)).y1(u=>f(u,1))(ye(s,a-i/2,i).concat(a))}_renderLine(e,n,r){let[o,i]=Ft(e,a=>n[a]),s=jb(e,n,r);return`M${o},${s(o)}L${i},${s(i)}`}};function ED(t,{y:e=Zt,x:n=W,stroke:r,fill:o=zt(r)?"currentColor":r,...i}={}){return new G4(t,Cu({...i,x:n,y:e,fill:o,stroke:r}))}function ID(t,{x:e=Zt,y:n=W,stroke:r,fill:o=zt(r)?"currentColor":r,...i}={}){return new H4(t,Nu({...i,x:e,y:n,fill:o,stroke:r}))}function jb(t,e,n){let r=0,o=0,i=0,s=0;for(let u of t){let p=e[u],l=n[u];r+=p,o+=l,i+=p*l,s+=p*p}let a=t.length,c=(a*i-r*o)/(a*s-r*r),f=(o-c*r)/a;return u=>c*u+f}function ND(t,e,n,r,o){let i=sn(t,u=>e[u])/t.length,s=0,a=0;for(let u of t)s+=(e[u]-i)**2,a+=(n[u]-o(e[u]))**2;let c=Math.sqrt(a/(t.length-2)),f=TD(r,t.length-2);return(u,p)=>{let l=o(u),d=c*Math.sqrt(1/t.length+(u-i)**2/s);return l+p*f*d}}function Ph({path:t=W,delimiter:e,frameAnchor:n,treeLayout:r=Xa,treeSort:o,treeSeparation:i,treeAnchor:s,treeFilter:a,...c}={}){s=Gb(s),o=LD(o),a!=null&&(a=Z4(a)),n===void 0&&(n=s.frameAnchor);let f=RD(e),u=BD(c,Z4),[p,l]=Ge(),[d,h]=Ge();return{x:p,y:d,frameAnchor:n,...Ce(c,(m,x)=>{let g=f(ut(m,t)),y=l([]),b=h([]),w=-1,_=[],v=[],A=zg().path(N=>g[N]),T=Gn(m)?N=>N.data=m[N.data]:N=>N.data=m.get(N.data),E=r();E.nodeSize&&E.nodeSize([1,1]),E.separation&&i!==void 0&&E.separation(i??jd);for(let N of u)N[Wb]=N[FD]([]);for(let N of x){let M=[],k=A(N.filter(O=>g[O]!=null)).each(T);o!=null&&k.sort(o),E(k);for(let O of k.descendants())if(!(a!=null&&!a(O))){M.push(++w),_[w]=O.data,s.position(O,w,y,b);for(let S of u)S[Wb][w]=S[qD](O)}v.push(M)}return{data:_,facets:v}}),...Object.fromEntries(u)}}function Vb({path:t=W,delimiter:e,curve:n="bump-x",stroke:r="#555",strokeWidth:o=1.5,strokeOpacity:i=.5,treeLayout:s=Xa,treeSort:a,treeSeparation:c,treeAnchor:f,treeFilter:u,...p}={}){f=Gb(f),a=LD(a),u!=null&&(u=kD(u)),p={curve:n,stroke:r,strokeWidth:o,strokeOpacity:i,...p};let l=RD(e),d=BD(p,kD),[h,m]=Ge(),[x,g]=Ge(),[y,b]=Ge(),[w,_]=Ge();return{x1:h,x2:x,y1:y,y2:w,...Ce(p,(v,A)=>{let T=l(ut(v,t)),E=m([]),N=g([]),M=b([]),k=_([]),O=-1,S=[],I=[],C=zg().path(D=>T[D]),L=s();L.nodeSize&&L.nodeSize([1,1]),L.separation&&c!==void 0&&L.separation(c??jd);for(let D of d)D[Wb]=D[FD]([]);for(let D of A){let $=[],P=C(D.filter(F=>T[F]!=null)).each(F=>F.data=v[F.data]);a!=null&&P.sort(a),L(P);for(let{source:F,target:q}of P.links())if(!(u!=null&&!u(q,F))){$.push(++O),S[O]=q.data,f.position(F,O,E,M),f.position(q,O,N,k);for(let V of d)V[Wb][O]=V[qD](q,F)}I.push($)}return{data:S,facets:I}}),...Object.fromEntries(d)}}function Gb(t="left"){switch(`${t}`.trim().toLowerCase()){case"left":return IZ;case"right":return NZ}throw new Error(`invalid tree anchor: ${t}`)}var IZ={frameAnchor:"left",dx:6,position({x:t,y:e},n,r,o){r[n]=e,o[n]=-t}},NZ={frameAnchor:"right",dx:-6,position({x:t,y:e},n,r,o){r[n]=-e,o[n]=-t}};function LD(t){return t==null||typeof t=="function"?t:`${t}`.trim().toLowerCase().startsWith("node:")?CD(Z4(t)):CD(CZ(t))}function CD(t){return(e,n)=>We(t(e),t(n))}function CZ(t){return e=>e.data?.[t]}function RD(t="/"){if(t=`${t}`,t==="/")return n=>n;if(t.length!==1)throw new Error("delimiter must be exactly one character");let e=t.charCodeAt(0);return n=>n.map(r=>kZ(r,e))}var Q4=92,OD=47;function kZ(t,e){if(e===Q4)throw new Error("delimiter cannot be backslash");let n=!1;for(let r=0,o=t.length;r<o;++r){switch(t.charCodeAt(r)){case Q4:if(!n){n=!0;continue}break;case e:n?(t=t.slice(0,r-1)+t.slice(r),--r,--o):t=t.slice(0,r)+"/"+t.slice(r+1);break;case OD:n?(t=t.slice(0,r)+"\\\\"+t.slice(r),r+=2,o+=2):(t=t.slice(0,r)+"\\"+t.slice(r),++r,++o);break}n=!1}return t}function LZ(t){let e=!1;for(let n=0,r=t.length;n<r;++n){switch(t.charCodeAt(n)){case Q4:if(!e){e=!0;continue}case OD:e&&(t=t.slice(0,n-1)+t.slice(n),--n,--r);break}e=!1}return t}function $D(t){return Ve(t)&&typeof t.node=="function"}function RZ(t){return Ve(t)&&typeof t.link=="function"}function Z4(t){if($D(t))return t.node;if(t=`${t}`.trim().toLowerCase(),!!t.startsWith("node:")){switch(t){case"node:name":return K4;case"node:path":return J4;case"node:internal":return DD;case"node:external":return PD;case"node:depth":return tM;case"node:height":return eM}throw new Error(`invalid node value: ${t}`)}}function kD(t){if($D(t))return t.node;if(RZ(t))return t.link;if(t=`${t}`.trim().toLowerCase(),!(!t.startsWith("node:")&&!t.startsWith("parent:"))){switch(t){case"parent:name":return Xb(K4);case"parent:path":return Xb(J4);case"parent:depth":return Xb(tM);case"parent:height":return Xb(eM);case"node:name":return K4;case"node:path":return J4;case"node:internal":return DD;case"node:external":return PD;case"node:depth":return tM;case"node:height":return eM}throw new Error(`invalid link value: ${t}`)}}function J4(t){return t.id}function K4(t){return OZ(t.id)}function tM(t){return t.depth}function eM(t){return t.height}function DD(t){return!!t.children}function PD(t){return!t.children}function Xb(t){return(e,n)=>n==null?void 0:t(n)}function OZ(t){let e=t.length;for(;--e>0&&!$Z(t,e););return LZ(t.slice(e+1))}function $Z(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}var FD=2,qD=3,Wb=4;function BD(t,e){let n=[];for(let r in t){let o=t[r],i=e(o);i!==void 0&&n.push([r,...Ge(o),i])}return n}function nM(t,{fill:e,stroke:n,strokeWidth:r,strokeOpacity:o,strokeLinejoin:i,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:f,marker:u,markerStart:p=u,markerEnd:l=u,dot:d=zt(p)&&zt(l),text:h="node:name",textStroke:m="var(--plot-background)",title:x="node:path",dx:g,dy:y,textAnchor:b,treeLayout:w=Xa,textLayout:_=w===Xa||w===qg?"mirrored":"normal",tip:v,...A}={}){if(g===void 0&&(g=Gb(A.treeAnchor).dx),b!==void 0)throw new Error("textAnchor is not a configurable tree option");_=Oe(_,"textLayout",["mirrored","normal"]);function T(E){return Yo(t,Ph({treeLayout:w,text:h,fill:e===void 0?"currentColor":e,stroke:m,dx:g,dy:y,title:x,...E,...A}))}return ke(kb(t,Vb({treeLayout:w,markerStart:p,markerEnd:l,stroke:n!==void 0?n:e===void 0?"node:internal":e,strokeWidth:r,strokeOpacity:o,strokeLinejoin:i,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:f,...A})),d?Pr(t,Ph({treeLayout:w,fill:e===void 0?"node:internal":e,title:x,tip:v,...A})):null,h!=null?_==="mirrored"?[T({textAnchor:"start",treeFilter:"node:external"}),T({textAnchor:"end",treeFilter:"node:internal",dx:-g})]:T():null)}function zD(t,e){return nM(t,{...e,treeLayout:qg})}var UD={ariaLabel:"waffle"},Fh=class extends bc{constructor(e,{unit:n=1,gap:r=1,round:o,render:i,multiple:s,...a}={}){super(e,{...a,render:Yi(i,jD("x"))},UD),this.unit=Math.max(0,n),this.gap=+r,this.round=XD(o),this.multiple=WD(s)}},qh=class extends wc{constructor(e,{unit:n=1,gap:r=1,round:o,render:i,multiple:s,...a}={}){super(e,{...a,render:Yi(i,jD("y"))},UD),this.unit=Math.max(0,n),this.gap=+r,this.round=XD(o),this.multiple=WD(s)}};function jD(t){return function(e,n,r,o,i){let{unit:s,gap:a,rx:c,ry:f,round:u}=this,{document:p}=i,l=r.channels[`${t}1`].value,d=r.channels[`${t}2`].value,h=this[t==="y"?"_width":"_height"](n,r,o),m=this[t==="y"?"_x":"_y"](n,r,o),x=s*DZ(n.scales[t]),{multiple:g=Math.max(1,Math.floor(Math.sqrt(h/x)))}=this,y=Math.min(h/g,x*g),b=x*g,w=t==="y"?([M,k])=>[M*y,-k*b]:([M,k])=>[k*b,M*y],_=(h-g*y)/2,v=typeof m=="function"?M=>m(M)+_:m+_,A=n[t](0),T=ZR(),E=p.createElementNS(Nn.svg,"pattern");E.setAttribute("width",t==="y"?y:b),E.setAttribute("height",t==="y"?b:y),E.setAttribute("patternUnits","userSpaceOnUse");let N=E.appendChild(p.createElementNS(Nn.svg,"rect"));return N.setAttribute("x",a/2),N.setAttribute("y",a/2),N.setAttribute("width",(t==="y"?y:b)-a),N.setAttribute("height",(t==="y"?b:y)-a),c!=null&&N.setAttribute("rx",c),f!=null&&N.setAttribute("ry",f),ot("svg:g",i).call(wt,this,o,i).call(this._transform,this,n).call(M=>M.selectAll().data(e).enter().append(()=>E.cloneNode(!0)).attr("id",k=>`${T}-${k}`).select("rect").call(dt,this).call(Tt,this,r)).call(M=>M.selectAll().data(e).enter().append("path").attr("transform",t==="y"?to`translate(${v},${A})`:to`translate(${A},${v})`).attr("d",k=>`M${rM(u(l[k]/s),u(d[k]/s),g).map(w).join("L")}Z`).attr("fill",k=>`url(#${T}-${k})`).attr("stroke",this.stroke==null?null:k=>`url(#${T}-${k})`)).node()}}function rM(t,e,n){if(t<0||e<0){let r=Math.ceil(-Math.min(t,e)/n);return rM(t+r*n,e+r*n,n).map(([o,i])=>[o,i-r])}return e<t?rM(e,t,n):[[0,Math.ceil(t/n)],[Math.floor(t%n),Math.ceil(t/n)],[Math.floor(t%n),Math.floor(t/n)+t%1],[Math.ceil(t%n),Math.floor(t/n)+t%1],...t%n>n-1?[]:[[Math.ceil(t%n),Math.floor(t/n)],[n,Math.floor(t/n)]],[n,Math.floor(e/n)],[Math.ceil(e%n),Math.floor(e/n)],[Math.ceil(e%n),Math.floor(e/n)+e%1],[Math.floor(e%n),Math.floor(e/n)+e%1],...e%n<1?[]:[[Math.floor(e%n),Math.ceil(e/n)],[0,Math.ceil(e/n)]]]}function XD(t){if(t===void 0||t===!1)return Number;if(t===!0)return Math.round;if(typeof t!="function")throw new Error(`invalid round: ${t}`);return t}function WD(t){return t===void 0?void 0:Math.max(1,Math.floor(t))}function DZ({domain:t,range:e}){return YD(e)/YD(t)}function YD(t){let[e,n]=Ft(t);return n-e}function VD(t,e={}){return Oi(e)||(e={...e,y:Zt,x2:W}),new Fh(t,js(bu(Ys(e))))}function GD(t,e={}){return Oi(e)||(e={...e,x:Zt,y2:W}),new qh(t,Xs(wu(Us(e))))}var iP=Sq(oP(),1);var jZ=({marginLeft:t})=>[1,t],XZ=({width:t,marginRight:e})=>[-1,t-e],WZ=({width:t,marginLeft:e,marginRight:n})=>[0,(e+t-n)/2],VZ=({marginTop:t})=>[1,t],GZ=({height:t,marginBottom:e})=>[-1,t-e],HZ=({height:t,marginTop:e,marginBottom:n})=>[0,(e+t-n)/2];function sP(t){return typeof t=="string"?{anchor:t}:t}function aP(t={},e={}){arguments.length===1&&([t,e]=fP(t));let{anchor:n="left",padding:r=1,r:o=e.r}=sP(t);switch(`${n}`.toLowerCase()){case"left":n=jZ;break;case"right":n=XZ;break;case"middle":n=WZ;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return uP("x","y",n,Dt(r),o,e)}function cP(t={},e={}){arguments.length===1&&([t,e]=fP(t));let{anchor:n="bottom",padding:r=1,r:o=e.r}=sP(t);switch(`${n}`.toLowerCase()){case"top":n=VZ;break;case"bottom":n=GZ;break;case"middle":n=HZ;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return uP("y","x",n,Dt(r),o,e)}function fP(t){let{anchor:e,padding:n,...r}=t,{r:o}=r;return[{anchor:e,padding:n,r:o},r]}function uP(t,e,n,r,o,i){if(o!=null&&typeof o!="number"){let{channels:s,sort:a,reverse:c}=i;s=Wd(s),s?.r===void 0&&(i={...i,channels:{...s,r:{value:o,scale:"r"}}}),a===void 0&&c===void 0&&(i.sort={channel:"-r"})}return Kt(i,function(s,a,c,f,u,p){let{[e]:l,r:d}=c;if(!c[e])throw new Error(`missing channel: ${e}`);({[e]:l}=Bo(c,f,p));let h=d?void 0:o!==void 0?Dt(o):this.r!==void 0?this.r:3;d&&(d=ut(d.value,f[d.scale]||W,Float64Array));let[m,x]=n(u),g=m?ZZ:QZ,y=new Float64Array(l.length),b=d?w=>d[w]:()=>h;for(let w of a){let _=(0,iP.default)();w=w.filter(d?A=>Jf(l[A])&&Pn(d[A]):A=>Jf(l[A]));let v=new Float64Array(2*w.length+2);for(let A of w){let T=b(A),E=m?T+r:0,N=l[A]-T,M=l[A]+T,k=2;_.queryInterval(N-r,M+r,([,,S])=>{let I=y[S]-E,C=l[A]-l[S],L=r+(d?d[A]+d[S]:2*h),D=Math.sqrt(L*L-C*C);v[k++]=I-D,v[k++]=I+D});let O=v.slice(0,k);m&&(O=O.filter(S=>S>=0));t:for(let S of O.sort(g)){for(let I=0;I<k;I+=2)if(v[I]+1e-6<S&&S<v[I+1]-1e-6)continue t;y[A]=S+E;break}_.insert([N,M,A])}}m||(m=1);for(let w of a)for(let _ of w)y[_]=y[_]*m+x;return{data:s,facets:a,channels:{[t]:{value:y,source:null},[e]:{value:l,source:c[e]},...d&&{r:{value:d,source:c.r}}}}})}function QZ(t,e){return Math.abs(t)-Math.abs(e)}function ZZ(t,e){return t-e}function pP(t,e){return arguments.length===1&&({basis:t,...e}=t),Ru(Zb(t),e)}function dP(t,e){return arguments.length===1&&({basis:t,...e}=t),Ou(Zb(t),e)}function Zb(t){if(t===void 0)return lP;if(typeof t=="function")return Jb(ou(t));if(/^p\d{2}$/i.test(t))return Uu(ru(t));switch(`${t}`.toLowerCase()){case"deviation":return tJ;case"first":return lP;case"last":return KZ;case"max":return eJ;case"mean":return nJ;case"median":return rJ;case"min":return oJ;case"sum":return iJ;case"extent":return JZ}throw new Error(`invalid basis: ${t}`)}function Jb(t){return{mapIndex(e,n,r){let o=+t(e,n);for(let i of e)r[i]=n[i]===null?NaN:n[i]/o}}}function Uu(t){return Jb((e,n)=>t(e,r=>n[r]))}var JZ={mapIndex(t,e,n){let[r,o]=Ft(t,s=>e[s]),i=o-r;for(let s of t)n[s]=e[s]===null?NaN:(e[s]-r)/i}},lP=Jb((t,e)=>{for(let n=0;n<t.length;++n){let r=e[t[n]];if(oe(r))return r}}),KZ=Jb((t,e)=>{for(let n=t.length-1;n>=0;--n){let r=e[t[n]];if(oe(r))return r}}),tJ={mapIndex(t,e,n){let r=pi(t,i=>e[i]),o=Mr(t,i=>e[i]);for(let i of t)n[i]=e[i]===null?NaN:o?(e[i]-r)/o:0}},eJ=Uu(kt),nJ=Uu(pi),rJ=Uu(Vr),oJ=Uu(It),iJ=Uu(sn);function hP(t,e){return xP("x",t,e)}function mP(t,e){return xP("y",t,e)}function xP(t,e,n={}){let r,o=1;if(typeof e=="number")o=e,r=(f,u)=>+f+u;else{if(typeof e=="string"){let f=e.startsWith("-")?-1:1;[e,o]=I1(e.replace(/^[+-]/,"")),o*=f}e=su(e),r=(f,u)=>e.offset(f,u)}let i=`${t}1`,s=`${t}2`,a=Hn({[i]:f=>f.map(u=>r(u,o)),[s]:f=>f},n),c=a[s].transform;return a[s].transform=()=>{let f=c(),[u,p]=Ft(f);return f.domain=o<0?[u,r(p,o)]:[r(u,o),p],f},a}function gP(t,e={}){if(typeof t=="string")switch(t.toLowerCase()){case"first":return Yh(e);case"last":return Uh(e)}if(typeof t=="function")return Ks(null,t,e);let n,r;for(n in t){if(r!==void 0)throw new Error("ambiguous selector; multiple inputs");r=sJ(t[n])}if(r===void 0)throw new Error(`invalid selector: ${t}`);return Ks(n,r,e)}function sJ(t){if(typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"min":return fM;case"max":return uM}throw new Error(`unknown selector: ${t}`)}function Yh(t){return Ks(null,aJ,t)}function Uh(t){return Ks(null,cJ,t)}function Kb(t){return Ks("x",fM,t)}function t2(t){return Ks("y",fM,t)}function e2(t){return Ks("x",uM,t)}function n2(t){return Ks("y",uM,t)}function*aJ(t){yield t[0]}function*cJ(t){yield t[t.length-1]}function*fM(t,e){yield Sx(t,n=>e[n])}function*uM(t,e){yield Ia(t,n=>e[n])}function Ks(t,e,n){if(t!=null){if(n[t]==null)throw new Error(`missing channel: ${t}`);t=n[t]}let r=vn(n);return Ce(n,(o,i)=>{let s=ut(o,r),a=ut(o,t),c=[];for(let f of i){let u=[];for(let p of s?rn(f,l=>s[l]).values():[f])for(let l of e(p,a))u.push(l);c.push(u)}return{data:o,facets:c}})}lt.prototype.plot=function({marks:t=[],...e}={}){return Iu({...e,marks:[...t,this]})};var fJ=new Map([["style","style"],["width","width"],["height","height"],["margin","margin"],["marginLeft","marginLeft"],["marginRight","marginRight"],["marginTop","marginTop"],["marginBottom","marginBottom"],["align","align"],["aspectRatio","aspectRatio"],["axis","axis"],["inset","inset"],["grid","grid"],["label","label"],["padding","padding"],["xScale","x.type"],["xDomain","x.domain"],["xRange","x.range"],["xNice","x.nice"],["xInset","x.inset"],["xInsetLeft","x.insetLeft"],["xInsetRight","x.insetRight"],["xClamp","x.clamp"],["xRound","x.round"],["xAlign","x.align"],["xPadding","x.padding"],["xPaddingInner","x.paddingInner"],["xPaddingOuter","x.paddingOuter"],["xAxis","x.axis"],["xTicks","x.ticks"],["xTickSize","x.tickSize"],["xTickSpacing","x.tickSpacing"],["xTickPadding","x.tickPadding"],["xTickFormat","x.tickFormat"],["xTickRotate","x.tickRotate"],["xGrid","x.grid"],["xLine","x.line"],["xLabel","x.label"],["xLabelAnchor","x.labelAnchor"],["xLabelArrow","x.labelArrow"],["xLabelOffset","x.labelOffset"],["xFontVariant","x.fontVariant"],["xAriaLabel","x.ariaLabel"],["xAriaDescription","x.ariaDescription"],["xPercent","x.percent"],["xReverse","x.reverse"],["xZero","x.zero"],["xBase","x.base"],["xExponent","x.exponent"],["xConstant","x.constant"],["yScale","y.type"],["yDomain","y.domain"],["yRange","y.range"],["yNice","y.nice"],["yInset","y.inset"],["yInsetTop","y.insetTop"],["yInsetBottom","y.insetBottom"],["yClamp","y.clamp"],["yRound","y.round"],["yAlign","y.align"],["yPadding","y.padding"],["yPaddingInner","y.paddingInner"],["yPaddingOuter","y.paddingOuter"],["yAxis","y.axis"],["yTicks","y.ticks"],["yTickSize","y.tickSize"],["yTickSpacing","y.tickSpacing"],["yTickPadding","y.tickPadding"],["yTickFormat","y.tickFormat"],["yTickRotate","y.tickRotate"],["yGrid","y.grid"],["yLine","y.line"],["yLabel","y.label"],["yLabelAnchor","y.labelAnchor"],["yLabelArrow","y.labelArrow"],["yLabelOffset","y.labelOffset"],["yFontVariant","y.fontVariant"],["yAriaLabel","y.ariaLabel"],["yAriaDescription","y.ariaDescription"],["yPercent","y.percent"],["yReverse","y.reverse"],["yZero","y.zero"],["yBase","y.base"],["yExponent","y.exponent"],["yConstant","y.constant"],["facetMargin","facet.margin"],["facetMarginTop","facet.marginTop"],["facetMarginBottom","facet.marginBottom"],["facetMarginLeft","facet.marginLeft"],["facetMarginRight","facet.marginRight"],["facetGrid","facet.grid"],["facetLabel","facet.label"],["fxDomain","fx.domain"],["fxRange","fx.range"],["fxInset","fx.inset"],["fxInsetLeft","fx.insetLeft"],["fxInsetRight","fx.insetRight"],["fxRound","fx.round"],["fxAlign","fx.align"],["fxPadding","fx.padding"],["fxPaddingInner","fx.paddingInner"],["fxPaddingOuter","fx.paddingOuter"],["fxAxis","fx.axis"],["fxTicks","fx.ticks"],["fxTickSize","fx.tickSize"],["fxTickSpacing","fx.tickSpacing"],["fxTickPadding","fx.tickPadding"],["fxTickFormat","fx.tickFormat"],["fxTickRotate","fx.tickRotate"],["fxGrid","fx.grid"],["fxLine","fx.line"],["fxLabel","fx.label"],["fxLabelAnchor","fx.labelAnchor"],["fxLabelOffset","fx.labelOffset"],["fxFontVariant","fx.fontVariant"],["fxAriaLabel","fx.ariaLabel"],["fxAriaDescription","fx.ariaDescription"],["fxReverse","fx.reverse"],["fyDomain","fy.domain"],["fyRange","fy.range"],["fyInset","fy,inset"],["fyInsetTop","fy.insetTop"],["fyInsetBottom","fy.insetBottom"],["fyRound","fy.round"],["fyAlign","fy.align"],["fyPadding","fy.padding"],["fyPaddingInner","fy.paddingInner"],["fyPaddingOuter","fy.paddingOuter"],["fyAxis","fy.axis"],["fyTicks","fy.ticks"],["fyTickSize","fy.tickSize"],["fyTickSpacing","fy.tickSpacing"],["fyTickPadding","fy.tickPadding"],["fyTickFormat","fy.tickFormat"],["fyTickRotate","fy.tickRotate"],["fyGrid","fy.grid"],["fyLine","fy.line"],["fyLabel","fy.label"],["fyLabelAnchor","fy.labelAnchor"],["fyLabelOffset","fy.labelOffset"],["fyFontVariant","fy.fontVariant"],["fyAriaLabel","fy.ariaLabel"],["fyAriaDescription","fy.ariaDescription"],["fyReverse","fy.reverse"],["colorScale","color.type"],["colorDomain","color.domain"],["colorRange","color.range"],["colorClamp","color.clamp"],["colorN","color.n"],["colorNice","color.nice"],["colorScheme","color.scheme"],["colorInterpolate","color.interpolate"],["colorPivot","color.pivot"],["colorSymmetric","color.symmetric"],["colorLabel","color.label"],["colorPercent","color.percent"],["colorReverse","color.reverse"],["colorZero","color.zero"],["colorTickFormat","color.tickFormat"],["colorBase","color.base"],["colorExponent","color.exponent"],["colorConstant","color.constant"],["opacityScale","opacity.type"],["opacityDomain","opacity.domain"],["opacityRange","opacity.range"],["opacityClamp","opacity.clamp"],["opacityNice","opacity.nice"],["opacityLabel","opacity.label"],["opacityPercent","opacity.percent"],["opacityReverse","opacity.reverse"],["opacityZero","opacity.zero"],["opacityTickFormat","opacity.tickFormat"],["opacityBase","opacity.base"],["opacityExponent","opacity.exponent"],["opacityConstant","opacity.constant"],["symbolScale","symbol.type"],["symbolDomain","symbol.domain"],["symbolRange","symbol.range"],["rScale","r.type"],["rDomain","r.domain"],["rRange","r.range"],["rClamp","r.clamp"],["rNice","r.nice"],["rLabel","r.label"],["rPercent","r.percent"],["rZero","r.zero"],["rBase","r.base"],["rExponent","r.exponent"],["rConstant","r.constant"],["lengthScale","length.type"],["lengthDomain","length.domain"],["lengthRange","length.range"],["lengthClamp","length.clamp"],["lengthNice","length.nice"],["lengthPercent","length.percent"],["lengthZero","length.zero"],["lengthBase","length.base"],["lengthExponent","length.exponent"],["lengthConstant","length.constant"],["projectionType","projection.type"],["projectionParallels","projection.parallels"],["projectionPrecision","projection.precision"],["projectionRotate","projection.rotate"],["projectionDomain","projection.domain"],["projectionInset","projection.inset"],["projectionInsetLeft","projection.insetLeft"],["projectionInsetRight","projection.insetRight"],["projectionInsetTop","projection.insetTop"],["projectionInsetBottom","projection.insetBottom"],["projectionClip","projection.clip"]]);function uJ(t,e,n){for(let r=0;r<e.length;++r){let o=e[r];r===e.length-1?t[o]=n:t=t[o]||(t[o]={})}}function yP(t,e,n){for(let r in t){let o=fJ.get(r);if(o==null)throw new Error(`Unrecognized plot attribute: ${r}`);let i=t[r];typeof i=="symbol"?n.push(r):i!==void 0&&uJ(e,o.split("."),i)}}var lJ=new Set(["frame","hexgrid","sphere","graticule"]),pJ=new Map([["first",Yh],["last",Uh],["maxX",e2],["maxY",n2],["minX",Kb],["minY",t2],["nearest",qs],["nearestX",Bs],["nearestXY",Ui]]);async function bP(t){let e={marks:[]},n=[],{attributes:r,marks:o}=t;yP(r,e,n);let i=[];for(let a of o)for(let{type:c,data:f,options:u}of a.plotSpecs()){let{select:p,...l}=u,d=pJ.get(p)?.(l)??l,h=lJ.has(c)?[d]:[f,d];e.marks.push(lM[c](...h)),i.push(a.index)}hJ(e,t);let s=Iu(e);xJ(s,i),dJ(t,s,r,n);for(let a of t.interactors)await a.init(s);return s}function dJ(t,e,n,r){r.forEach(o=>{let i=n[o];if(i===lo){if(!o.endsWith("Domain"))throw new Error(`Unsupported fixed attribute: ${o}`);let s=o.slice(0,-6),a=e.scale(s);a?.domain&&t.setAttribute(o,n[`${s}Reverse`]?a.domain.slice().reverse():a.domain)}else throw new Error(`Unrecognized symbol: ${i}`)})}function hJ(t,e){let{marks:n}=e;r2("x",t,n),r2("y",t,n),r2("fx",t,n),r2("fy",t,n)}function r2(t,e,n){let r=e[t]||{};if(r.axis===null||r.label!==void 0)return;let o=n.map(s=>s.channelField(t)?.field);if(o.every(s=>s==null))return;let i;for(let s=0;s<o.length;++s){let a=wP(o[s]);a!==void 0&&(i===void 0?i=a:i!==a&&(i=void 0))}i!==void 0&&(e[t]={...r,label:i})}function wP(t){if(t){switch(t.type){case"COLUMN_REF":return t.column;case"CAST":return wP(t.expr);case"FUNCTION":if(t.name==="make_date")return"date";break}return mJ(t)}}function mJ(t){let e=`${t}`.replaceAll('"',"").replaceAll("(*)","()");return e.endsWith("()")?e.slice(0,-2):e}function xJ(t,e){let n=-1;for(let r of t.children){let o=r.getAttribute("aria-label")||"";r.nodeName==="style"||o.includes("-axis")||o.includes("-grid")||r.setAttribute("data-index",e[++n])}}var gJ={width:640,marginLeft:40,marginRight:20,marginTop:20,marginBottom:30},jh=class{constructor(e){this.attributes={...gJ},this.listeners=null,this.interactors=[],this.legends=[],this.marks=[],this.markset=null,this.element=e||document.createElement("div"),this.element.setAttribute("class","plot"),this.element.style.display="flex",this.element.value=this,this.params=new Map,this.synch=s_()}margins(){return{left:this.getAttribute("marginLeft"),top:this.getAttribute("marginTop"),bottom:this.getAttribute("marginBottom"),right:this.getAttribute("marginRight")}}innerWidth(){let{left:e,right:n}=this.margins();return this.getAttribute("width")-e-n}innerHeight(e=400){let{top:n,bottom:r}=this.margins(),o=this.getAttribute("height");return o==null&&(o=yJ(this,n,r)||e,this.setAttribute("height",o,{silent:!0})),o-n-r}pending(e){this.synch.pending(e)}update(e){return this.synch.ready(e)&&!this.pendingRender&&(this.pendingRender=!0,requestAnimationFrame(()=>this.render())),this.synch.promise}async render(){this.pendingRender=!1;let e=await bP(this),n=this.legends.flatMap(({legend:r,include:o})=>{let i=r.init(e);return o?i:[]});this.element.replaceChildren(e,...n),this.synch.resolve()}getAttribute(e){return this.attributes[e]}setAttribute(e,n,r){return np(this.attributes[e],n)?(n===void 0?delete this.attributes[e]:this.attributes[e]=n,r?.silent||this.listeners?.get(e)?.forEach(o=>o(e,n)),!0):!1}addAttributeListener(e,n){let r=this.listeners||(this.listeners=new Map);return r.has(e)||r.set(e,new Set),r.get(e).add(n),this}removeAttributeListener(e,n){return this.listeners?.get(e)?.delete(n)}addParams(e,n){let{params:r}=this;for(let o of n)r.has(o)?r.get(o).push(e):(r.set(o,[e]),o.addEventListener("value",()=>Promise.allSettled(r.get(o).map(i=>i.initialize()))))}addMark(e){return e.setPlot(this,this.marks.length),this.marks.push(e),this.markset=null,this}get markSet(){return this.markset||(this.markset=new Set(this.marks))}addInteractor(e){return this.interactors.push(e),this}addLegend(e,n=!0){e.setPlot(this),this.legends.push({legend:e,include:n})}};function yJ(t,e,n){let r=t.getAttribute("aspectRatio");if(r==null)return;let o=t.getAttribute("xDomain"),i=t.getAttribute("yDomain");if(!o||!i)return;let s=Math.abs(o[1]-o[0]);return Math.abs(i[1]-i[0])*t.innerWidth()/(r*s)+e+n}function o2(t){return typeof t!="string"?!1:(t=t.toLowerCase().trim(),t==="none"||t==="currentcolor"||t.startsWith("url(")&&t.endsWith(")")||t.startsWith("var(")&&t.endsWith(")")||nr(t)!==null)}var bJ=new Set(["order","sort","label","anchor","curve","tension","marker","markerStart","markerMid","markerEnd","textAnchor","lineAnchor","lineHeight","textOverflow","monospace","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","frameAnchor","strokeLinejoin","strokeLinecap","strokeMiterlimit","strokeDasharray","strokeDashoffset","mixBlendMode","shapeRendering","imageRendering","preserveAspectRatio","interpolate","crossOrigin","paintOrder","pointerEvents","target","select"]);function vP(t){return bJ.has(t)}var wJ=new Set(["asterisk","circle","cross","diamond","diamond2","hexagon","plus","square","square2","star","times","triangle","triangle2","wye"]);function _P(t){return wJ.has(`${t}`.toLowerCase())}var SP=t=>t==="stroke"||t==="fill",vJ=t=>/opacity$/i.test(t),_J=t=>t==="symbol",SJ=(t,e)=>t!=="sort"&&t!=="tip"&&e!=null&&!Array.isArray(e),pM=(t,e)=>({channel:t,field:e,as:ts(e)?e.column:t}),dM=(t,e)=>({channel:t,value:e}),i2=t=>Array.isArray(t),$e=class extends Bn{constructor(e,n,r,o={}){super(n?.options?.filterBy),this.type=e,this.reqs=o,this.source=n;let i=this.channels=[],s=this.detail=new Set,a=this.params=new Set;i2(n)?this.data=Wn(n):_e(n?.table)&&a.add(n.table);let c=(f,u)=>{let p=typeof u;if(f==="channels")for(let l in u)s.add(l),c(l,u[l]);else if(p==="function"&&u[rp]){let l=u(this,f);for(let d in l)c(d,l[d])}else if(p==="string")vP(f)||SP(f)&&o2(u)||_J(f)&&_P(u)?i.push(dM(f,u)):i.push(pM(f,oi(u)));else if(Yr(u)){let l=dM(f,u.value);i.push(l),u.addEventListener("value",d=>(l.value=d,this.update()))}else pn(u)?(Fv(u).forEach(l=>a.add(l)),i.push(pM(f,u))):p==="object"&&SJ(f,u)?i.push(pM(f,u)):u!==void 0&&i.push(dM(f,u))};for(let f in r)c(f,r[f])}setPlot(e,n){this.plot=e,this.index=n,e.addParams(this,this.params),this.source?.table&&this.queryPending()}sourceTable(){let e=this.source?.table;return e?_e(e)?e.value:e:null}hasOwnData(){return this.source==null||i2(this.source)}hasFieldInfo(){return!!this._fieldInfo}channel(e){return this.channels.find(n=>n.channel===e)}channelField(e,{exact:n=!1}={}){let r=n?this.channel(e):this.channels.find(o=>o.channel.startsWith(e));return r?.field?r:null}fields(){if(this.hasOwnData())return null;let{channels:e,reqs:n}=this,r=new Map;for(let{channel:i,field:s}of e){if(!s)continue;let a=s.stats?.stats||[],c=s.stats?.column??s,f=r.get(c)??r.set(c,new Set).get(c);a.forEach(u=>f.add(u)),n[i]?.forEach(u=>f.add(u))}let o=this.sourceTable();return Array.from(r,([i,s])=>({table:o,column:i,stats:s}))}fieldInfo(e){let n=Object.fromEntries(e.map(r=>[r.column,r]));for(let r of this.channels){let{field:o}=r;o&&Object.assign(r,n[o.stats?.column??o])}return this._fieldInfo=!0,this}query(e=[]){return this.hasOwnData()?null:Xh(this.channels,this.sourceTable()).where(e)}queryPending(){return this.plot.pending(this),this}queryResult(e){return this.data=Wn(e),this}update(){return this.plot.update(this)}plotSpecs(){let{type:e,data:n,detail:r,channels:o}=this;return hM(e,r,o,n)}};function Sn(t,e){let n=e?.[t.as]??t.as;return Object.hasOwn(t,"value")?t.value:SP(t.channel)?{value:n,scale:"color"}:vJ(t.channel)?{value:n,scale:"opacity"}:n}function Xh(t,e,n=[]){let r=st.from({source:e}),o=new Set,i=!1;for(let s of t){let{channel:a,field:c,as:f}=s;if(!n.includes(a)){if(a==="orderby")r.orderby(s.value);else if(c){if(tr(c))i=!0;else{if(o.has(f))continue;o.add(f)}r.select({[f]:c})}}}return i&&r.groupby(Array.from(o)),r}function hM(t,e,n,r,o={}){let{numRows:i,values:s,columns:a}=r??{},c={};for(let p of n){let l=e.has(p.channel)?c:o;l[p.channel]=Sn(p,a)}return e.size&&(o.channels=c),[{type:t,data:s??(r?{length:i}:null),options:o}]}function Tc(t,e){let{plot:n}=t,r=n.getAttribute(`${e}Scale`);if(!r){let{type:i}=t.channelField(e);r=i==="date"?"time":"linear"}let o={type:r};switch(r){case"log":o.base=n.getAttribute(`${e}Base`)??10;break;case"pow":o.exponent=n.getAttribute(`${e}Exponent`)??1;break;case"symlog":o.constant=n.getAttribute(`${e}Constant`)??1;break}return Kl(o)}function hr(t,e,n,r,o=1,i){let{field:s}=t.channelField(e);i=i??s;let{type:a,apply:c,sqlApply:f}=Tc(t,e),u=!!t.plot.getAttribute(`${e}Reverse`),[p,l]=r.map(m=>c(m)),d=f(i),h=a==="time"||a==="utc"?d:i;return[Wv(d,p,l,n-o,u),h]}var mM={x:["min","max"]},xM={y:["min","max"]},s2={...mM,...xM};function MP(t,e,n,r,o){let{plot:i}=t,s=i.getAttribute(r),a=i.getAttribute(o);if(Array.isArray(s)&&!s[en])return s;{let{column:c,min:f,max:u}=t.channelField(n),p=gM(e,c)||(a?_i().domain([f,u]).nice().domain():[f,u]);return s!==lo&&(p[en]=!0),i.setAttribute(r,p,{silent:!0}),p}}function Vo(t,e){return MP(t,e,"x","xDomain","xNice")}function Go(t,e){return MP(t,e,"y","yDomain","yNice")}function gM(t,e){if(!t)return;let n,r;return[t].flat().forEach(o=>ao(o,i=>{if(i instanceof wa&&`${i.expr}`===e){let s=(i.extent??[]).map(a=>a?.value??a);(n==null||s[0]<n)&&(n=s[0]),(r==null||s[1]>r)&&(r=s[1])}})),n!=null&&r!=null&&n!==r?[n,r]:void 0}var Wh=class extends $e{constructor(e,n,r){let o=e.endsWith("X")?"y":e.endsWith("Y")?"x":null,i=o?{[o]:["count","min","max"]}:void 0;super(e,n,r,i),this.dim=o}query(e=[]){let{plot:n,dim:r,source:o}=this,i=o.options?.optimize,s=super.query(e);if(!r)return s;let a=r==="x"?"y":"x",c=this.channelField(a,{exact:!0})?.as,{field:f,as:u,type:p,count:l,min:d,max:h}=this.channelField(r),m=p==="date"||p==="number",x=r==="x"?n.innerWidth():n.innerHeight();if(i??=l/x>10,i&&m&&c){let[g,y]=gM(e,f)||[d,h],[b]=hr(this,r,x,[g,y],1,u),w=s._select.map(_=>_.alias).filter(_=>_!==u&&_!==c);return Zv(s,b,u,c,w)}else return s.orderby(f)}};function AP(t,e=[]){return new e.constructor(t)}function TP(t,e,n){let r=AP(t,n),o=n.length;for(let i=0;i<o;++i)r[e[i]]=n[i];return r}function EP(t,e,n,r,o,i,s){let a=n.length,c=t*e,f=o.map(d=>r[d]),u={},p=[],l=new Int32Array(a);if(i?.length){let d=i.map(m=>r[m]),h={};for(let m=0;m<a;++m){let x=d.map(g=>g[m]);l[m]=h[x]??=p.push(x)-1}for(let m=0;m<i.length;++m)u[i[m]]=p.map(x=>x[m])}else p.push([]);if(s){let d=n.map(x=>x%t),h=n.map(x=>Math.floor(x/t)),m=p.map(()=>[]);for(let x=0;x<a;++x)m[l[x]].push(x);o.forEach((x,g)=>{let y=f[g];u[x]=p.map((b,w)=>s(m[w],t,e,d,h,y))})}else o.forEach((d,h)=>{let m=f[h],x=u[d]=p.map(()=>AP(c,m));for(let g=0;g<a;++g)x[l[g]][n[g]]=m[g]});return{numRows:p.length,columns:u}}function Vh(t){let e=1/0,n=-1/0;return t.forEach(r=>{let o=r.length;for(let i=0;i<o;++i){let s=r[i];s<e&&(e=s),s>n&&(n=s)}}),Number.isFinite(e)&&Number.isFinite(n)?[e,n]:[0,1]}function IP(t){let e=new En;return t.forEach(n=>{let r=n.length;for(let o=0;o<r;++o)e.add(n[o])}),Array.from(e).sort(yt)}function we(t,e){return _e(t)?(t.addEventListener("value",e),t.value):t}function Gh(t,e=!1){let n=new Float64Array(5),r=new Float64Array(4);MJ(n,r,t);let o=Float64Array.of(0,r[1]-n[1]*r[0],r[2]-n[2]*r[0],r[3]-n[3]*r[0],-n[4]*r[0]),i=1+n[1]+n[2]+n[3]+n[4],s=(r[0]+r[1]+r[2]+r[3])/i,a=(o[1]+o[2]+o[3]+o[4])/i;return{sigma:t,negative:e,a:n,b_causal:r,b_anticausal:o,sum_causal:s,sum_anticausal:a}}function MJ(t,e,n){let o=Float64Array.of(.84,1.8675,.84,-1.8675,-.34015,-.1299,-.34015,.1299),i=Math.exp(-1.783/n),s=Math.exp(-1.723/n),a=.6318/n,c=1.997/n,f=Float64Array.of(-i*Math.cos(a),i*Math.sin(a),-i*Math.cos(-a),i*Math.sin(-a),-s*Math.cos(c),s*Math.sin(c),-s*Math.cos(-c),s*Math.sin(-c)),u=n*2.5066282746310007,p=Float64Array.of(o[0],o[1],0,0,0,0,0,0),l=Float64Array.of(1,0,f[0],f[1],0,0,0,0,0,0),d,h;for(h=2;h<8;h+=2){for(p[h]=f[h]*p[h-2]-f[h+1]*p[h-1],p[h+1]=f[h]*p[h-1]+f[h+1]*p[h-2],d=h-2;d>0;d-=2)p[d]+=f[h]*p[d-2]-f[h+1]*p[d-1],p[d+1]+=f[h]*p[d-1]+f[h+1]*p[d-2];for(d=0;d<=h;d+=2)p[d]+=o[h]*l[d]-o[h+1]*l[d+1],p[d+1]+=o[h]*l[d+1]+o[h+1]*l[d];for(l[h+2]=f[h]*l[h]-f[h+1]*l[h+1],l[h+3]=f[h]*l[h+1]+f[h+1]*l[h],d=h;d>0;d-=2)l[d]+=f[h]*l[d-2]-f[h+1]*l[d-1],l[d+1]+=f[h]*l[d-1]+f[h+1]*l[d-2]}for(h=0;h<4;++h)d=h<<1,e[h]=p[d]/u,t[h+1]=l[d+2]}function NP(t,e,n,[r,o]){let i=new Float64Array(Math.max(r,o)),s=new Float64Array(Math.max(r,o)),a=new Float64Array(5),c=new Float64Array(n.length);for(let f=0,u=0;f<o;++f,u+=r){let p=c.subarray(u);a2(t,n.subarray(u),r,1,i,s,a,p)}for(let f=0;f<r;++f){let u=c.subarray(f);a2(e,u,o,r,i,s,a,u)}return c}function a2(t,e,n,r=1,o=new Float64Array(n),i=new Float64Array(n),s=new Float64Array(5),a=o,c=AJ){let f=r*2,u=r*3,p=r*4,l=r*n,d,h;for(c(o,e,n,r,t.b_causal,3,t.a,4,t.sum_causal,s,t.sigma),h=4,d=p;h<n;++h,d+=r)o[h]=t.b_causal[0]*e[d]+t.b_causal[1]*e[d-r]+t.b_causal[2]*e[d-f]+t.b_causal[3]*e[d-u]-t.a[1]*o[h-1]-t.a[2]*o[h-2]-t.a[3]*o[h-3]-t.a[4]*o[h-4];for(c(i,e,n,-r,t.b_anticausal,4,t.a,4,t.sum_anticausal,s,t.sigma),h=4,d=l-r*5;h<n;++h,d-=r)i[h]=t.b_anticausal[1]*e[d+r]+t.b_anticausal[2]*e[d+f]+t.b_anticausal[3]*e[d+u]+t.b_anticausal[4]*e[d+p]-t.a[1]*i[h-1]-t.a[2]*i[h-2]-t.a[3]*i[h-3]-t.a[4]*i[h-4];if(t.negative)for(h=0,d=0;h<n;++h,d+=r)a[d]=o[h]+i[n-h-1];else for(h=0,d=0;h<n;++h,d+=r)a[d]=Math.max(0,o[h]+i[n-h-1]);return a}function AJ(t,e,n,r,o,i,s,a,c,f,u,p=.5){let l=Math.abs(r)*n,d=r<0?l+r:0,h,m,x;for(m=0;m<=a;++m)for(f[m]=m<=i?o[m]:0,x=1;x<=a&&x<=m;++x)f[m]-=s[x]*f[m-x];for(x=0;x<a;++x)for(t[x]=0,m=1;m<=x;++m)h=d+r*m,h>=0&&h<l&&(t[x]+=f[x-m]*e[h]);let g=e[d],y=Math.ceil(u*10);for(m=0;m<y;++m){for(x=0;x<a;++x)t[x]+=f[x]*g;if(c-=Math.abs(f[0]),c<=p)break;for(f[a]=m+a<=i?o[m+a]:0,x=1;x<=a;++x)f[a]-=s[x]*f[a-x];for(x=0;x<a;++x)f[x]=f[x+1]}}var eo="density",no=class extends $e{constructor(e,n,r){let{bandwidth:o=0,interpolate:i="none",pixelSize:s=1,pad:a=1,width:c,height:f,...u}=r,p=TJ(u);super(e,n,u,s2),this.densityMap=p,this.bandwidth=we(o,l=>(this.bandwidth=l,this.grids?this.convolve().update():null)),this.interpolate=we(i,l=>(this.interpolate=l,this.requestUpdate())),this.pixelSize=we(s,l=>(this.pixelSize=l,this.requestUpdate())),this.pad=we(a,l=>(this.pad=l,this.requestUpdate())),this.width=we(c,l=>(this.width=l,this.requestUpdate())),this.height=we(f,l=>(this.height=l,this.requestUpdate()))}setPlot(e,n){let r=()=>{this.hasFieldInfo()&&this.requestUpdate()};e.addAttributeListener("xDomain",r),e.addAttributeListener("yDomain",r),super.setPlot(e,n)}get filterStable(){let e=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return e&&n&&!e[en]&&!n[en]}query(e=[]){let{interpolate:n,pad:r,channels:o,densityMap:i}=this,[s,a]=this.extentX=Vo(this,e),[c,f]=this.extentY=Go(this,e),[u,p]=this.bins=this.binDimensions(),[l,d]=hr(this,"x",u,[s,a],r),[h,m]=hr(this,"y",p,[c,f],r),x=r?[tn(d,[+s,+a]),tn(m,[+c,+f])]:[Kn(+s,d),ae(d,+a),Kn(+c,m),ae(m,+f)],g=st.from(this.sourceTable()).where(e.concat(x)),y=this.groupby=[],b={};for(let _ of o)if(Object.hasOwn(_,"field")){let{as:v,channel:A,field:T}=_;tr(T)?(b[A]=T,i[A]=!0):A==="weight"?b[eo]=Yt(T):A!=="x"&&A!=="y"&&(g.select({[v]:T}),y.push(v))}let w=this.aggr=Object.keys(b);if(b.density&&w.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(w.length||(w.push(eo),b[eo]=qe()),n==="linear"){if(w.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!b[eo])throw new Error("Linear binning not applicable to custom aggregates.");let _=rf(b[eo])[0];return Hv(g,l,h,_,u,y)}else return Vv(g,l,h,b,u,y)}binDimensions(){let{plot:e,pixelSize:n,width:r,height:o}=this;return[r??Math.round(e.innerWidth()/n),o??Math.round(e.innerHeight()/n)]}queryResult(e){let[n,r]=this.bins,o=EJ(this.interpolate),{columns:i}=Wn(e);return this.grids0=EP(n,r,i.index,i,this.aggr,this.groupby,o),this.convolve()}convolve(){let{aggr:e,bandwidth:n,bins:r,grids0:o,plot:i}=this;if(this.grids=o,n>0){let s=e.length===1?e[0]:e.includes(eo)?eo:null;if(!s)return console.warn("No compatible grid found for smoothing."),this;let a=o.columns[s],c=i.innerWidth(),f=i.innerHeight(),[u,p]=r,l=a.some(m=>m.some(x=>x<0)),d=Gh(n*(u-1)/c,l),h=Gh(n*(p-1)/f,l);this.grids={numRows:o.numRows,columns:{...o.columns,[s]:a.map(m=>NP(d,h,m,r))}}}return this}};function TJ(t){let e={};for(let n in t)t[n]==="density"&&(delete t[n],e[n]=!0);return e}function EJ(t="none"){if(typeof t=="function")return t;switch(t.toLowerCase()){case"none":case"linear":return;case"nearest":return Ih;case"barycentric":return Eh();case"random-walk":return Nh()}throw new Error(`invalid interpolate: ${t}`)}var Hh=class extends no{constructor(e,n){let{thresholds:r=10,...o}=n;super("geo",e,{bandwidth:20,interpolate:"linear",pixelSize:2,...o}),this.thresholds=we(r,i=>(this.thresholds=i,this.grids?this.contours().update():null))}convolve(){return super.convolve().contours()}contours(){let{bins:e,densityMap:n,grids:r,thresholds:o,plot:i}=this,{numRows:s,columns:a}=r,c=o,f;if(Array.isArray(c))f=c;else{let[,M]=Vh(a.density);f=Array.from({length:c-1},(k,O)=>M*(O+1)/c)}(n.fill||n.stroke)&&this.plot.getAttribute("colorScale")!=="log"&&this.plot.setAttribute("colorZero",!0);let[u,p]=e,[l,d]=i.getAttribute("xDomain"),[h,m]=i.getAttribute("yDomain"),x=(d-l)/u,g=(m-h)/p,y=+l,b=+h,w=M=>y+M*x,_=M=>b+M*g,v=hs().size(e),A=this.contourData=Array(s*f.length),{density:T,...E}=a,N=Object.entries(E);for(let M=0,k=0;M<s;++M){let O=T[M],S=N.reduce((I,[C,L])=>(I[C]=L[M],I),{});for(let I=0;I<f.length;++I,++k)A[k]=Object.assign(IJ(v.contour(O,f[I]),w,_),S)}return this}plotSpecs(){let{type:e,channels:n,densityMap:r,contourData:o}=this,i={};for(let s of n){let{channel:a}=s;a!=="x"&&a!=="y"&&(i[a]=Sn(s))}for(let s in r)r[s]&&(i[s]=Sn({channel:s,as:"value"}));return[{type:e,data:o,options:i}]}};function IJ(t,e,n){function r(s){s.forEach(o)}function o(s){s.forEach(i)}function i(s){s[0]=e(s[0]),s[1]=n(s[1])}return t.coordinates.forEach(r),t}function Qh(t){return Array.from({length:t},(e,n)=>n)}function c2(t,e){let n=e.reduce((o,i,s)=>(o[i]=s,o),{}),r=Qh(t.length);return r.sort((o,i)=>n[t[o]]-n[t[i]]),r}function f2(t,e){if(typeof document<"u"){let n=document.createElement("canvas");return n.setAttribute("width",t),n.setAttribute("height",e),n}throw new Error("Can not create a canvas instance.")}function CP(t=1){let e=255*t|0;return(n,r,o)=>{for(let i=0,s=0;i<o;++i)for(let a=0;a<r;++a,s+=4)n[s+3]=e}}function kP(t){let{apply:e}=t;return(n,r,o,i)=>{for(let s=0,a=0;s<o;++s)for(let c=0,f=(o-s-1)*r;c<r;++c,a+=4)n[a+3]=255*e(i[c+f])|0}}function LP(t={}){let{r:e=0,g:n=0,b:r=0,opacity:o=1}=typeof t=="string"?Le(t):t,i=new Uint8ClampedArray([e,n,r,255*o|0]);return(s,a,c)=>{for(let f=0,u=0;f<c;++f)for(let p=0;p<a;++p,u+=4)s[u+0]=i[0],s[u+1]=i[1],s[u+2]=i[2],s[u+3]=i[3]}}function RP(t){let{domain:e,range:n}=t,r=Object.create(null),o=new Uint8ClampedArray(4*e.length),i=e.length-1,s=n.length;for(let a=0;a<=i;++a){let c=n[a%s],{r:f,g:u,b:p,opacity:l=1}=typeof c=="string"?Le(c):c,d=a<<2;o[d+0]=f,o[d+1]=u,o[d+2]=p,o[d+3]=255*l|0,r[e[a]]=d}return(a,c,f,u)=>{if(u.map)for(let p=0,l=0;p<f;++p)for(let d=0,h=(f-p-1)*c;d<c;++d,l+=4){let m=r[u[d+h]];a[l+0]=o[m+0],a[l+1]=o[m+1],a[l+2]=o[m+2],a[l+3]=o[m+3]}else{let p=r[u];for(let l=0,d=0;l<f;++l)for(let h=0;h<c;++h,d+=4)a[d+0]=o[p+0],a[d+1]=o[p+1],a[d+2]=o[p+2],a[d+3]=o[p+3]}}}function OP(t,e,n){let{interpolate:r}=e,o=new Uint8ClampedArray(4*t),i=t-1;for(let s=0;s<=i;++s){let a=r(s/i),{r:c,g:f,b:u,opacity:p=1}=typeof a=="string"?Le(a):a,l=s<<2;o[l+0]=c,o[l+1]=f,o[l+2]=u,o[l+3]=255*p|0}return(s,a,c,f)=>{for(let u=0,p=0;u<c;++u)for(let l=0,d=(c-u-1)*a;l<a;++l,p+=4){let h=i*n(f[l+d])<<2;s[p+0]=o[h+0],s[p+1]=o[h+1],s[p+2]=o[h+2],s[p+3]=o[h+3]}}}var ta=class extends no{constructor(e,n){super("image",e,n),this.image=null}setPlot(e,n){let r=()=>{this.hasFieldInfo()&&this.rasterize()};e.addAttributeListener("schemeColor",r),super.setPlot(e,n)}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:e,grids:n}=this,[r,o]=e,{numRows:i,columns:s}=n,{canvas:a,ctx:c,img:f}=LJ(this,r,o),{alpha:u,alphaProp:p,color:l,colorProp:d}=yM(this),h=s[p]??[],m=s[d]??[],x=i>1&&d&&this.groupby?.includes(d)?c2(m,this.plot.getAttribute("colorDomain")):Qh(i);return this.data={numRows:i,columns:{src:Array.from({length:i},(g,y)=>(l?.(f.data,r,o,m[x[y]]),u?.(f.data,r,o,h[x[y]]),c.putImageData(f,0,0),a.toDataURL()))}},this}plotSpecs(){let{type:e,plot:n,data:{numRows:r,columns:o}}=this,i={src:o.src,width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:e,data:{length:r},options:i}]}},Zh=class extends ta{constructor(e,n){super(e,{bandwidth:20,interpolate:"linear",pixelSize:2,...n})}};function yM(t){let{aggr:e,densityMap:n,groupby:r,plot:o}=t,i=e.includes(eo),s=e.includes("fillOpacity"),a=t.channel("fill"),c=t.channel("fillOpacity");if(e.length>2||i&&s)throw new Error("Invalid raster encodings. Try dropping an aggregate?");if(r.includes(c?.as))throw new Error("Raster fillOpacity must be an aggregate or constant.");let f=n.fill||e.includes("fill")?"grid":r.includes(a?.as)?"group":o2(a?.value)?a.value:i&&o.getAttribute("colorScheme")?"grid":void 0,u=n.fillOpacity||e.includes("fillOpacity")?"grid":typeof c?.value=="number"?c.value:i&&f!=="grid"?"grid":void 0;if(f!=="grid"&&u!=="grid")throw new Error("Raster mark missing density values.");let p=a?.as??(f==="grid"?eo:null),l=c?.as??(u==="grid"?eo:null),d=f!=="grid"&&f!=="group"?LP(f):CJ(t,p),h=u!=="grid"?CP(u):NJ(t,l);return{alphaProp:l,colorProp:p,alpha:h,color:d}}function NJ(t,e){let{plot:n,grids:r}=t,o=n.getAttribute("opacityDomain"),i=o===lo,s=o?.[en],a=!i&&!s&&o||Vh(r.columns[e]);(i||s||!o)&&(i||(a[en]=!0),n.setAttribute("opacityDomain",a));let c=Os({opacity:{type:n.getAttribute("opacityScale"),domain:a,range:n.getAttribute("opacityRange"),clamp:n.getAttribute("opacityClamp"),nice:n.getAttribute("opacityNice"),reverse:n.getAttribute("opacityReverse"),zero:n.getAttribute("opacityZero"),base:n.getAttribute("opacityBase"),exponent:n.getAttribute("opacityExponent"),constant:n.getAttribute("opacityConstant")}});return kP(c)}function CJ(t,e){let{plot:n,grids:r}=t,o=r.columns[e],i=!o[0]?.map,s=i||Array.isArray(o[0]),a=n.getAttribute("colorDomain"),c=a===lo,f=a?.[en],u=!c&&!f&&a||(i?o.slice().sort(yt):s?IP(o):Vh(o));(c||f||!a)&&(c||(u[en]=!0),n.setAttribute("colorDomain",u));let p=Os({color:{type:n.getAttribute("colorScale"),domain:u,range:n.getAttribute("colorRange"),clamp:n.getAttribute("colorClamp"),n:n.getAttribute("colorN"),nice:n.getAttribute("colorNice"),reverse:n.getAttribute("colorReverse"),scheme:n.getAttribute("colorScheme"),interpolate:n.getAttribute("colorInterpolate"),pivot:n.getAttribute("colorPivot"),symmetric:n.getAttribute("colorSymmetric"),zero:n.getAttribute("colorZero"),base:n.getAttribute("colorBase"),exponent:n.getAttribute("colorExponent"),constant:n.getAttribute("colorConstant")}});if(s)return RP(p);{let l=Os({x:{type:kJ(p.type),domain:p.domain,reverse:p.reverse,range:[0,1],clamp:p.clamp,base:p.base,exponent:p.exponent,constant:p.constant}});return OP(1024,p,l.apply)}}function kJ(t){return t.endsWith("symlog")?"symlog":t.endsWith("log")?"log":t.endsWith("pow")?"pow":t.endsWith("sqrt")?"sqrt":t==="diverging"?"linear":t}function LJ(t,e,n){if(!t.image||t.image.w!==e||t.image.h!==n){let r=f2(e,n),o=r.getContext("2d",{willReadFrequently:!0}),i=o.getImageData(0,0,e,n);t.image={canvas:r,ctx:o,img:i,w:e,h:n}}return t.image}var Jh=class extends ta{constructor(e,n){let{normalize:r=!0,...o}=n;super(e,o),this.normalize=we(r,i=>(this.normalize=i,this.requestUpdate()))}query(e=[]){let{channels:n,normalize:r,pad:o}=this,[i,s]=this.bins=this.binDimensions(),[a]=hr(this,"x",i,Vo(this,e),o),[c]=hr(this,"y",s,Go(this,e),o),f=st.from(this.sourceTable()).where(RJ(this,e));this.aggr=["density"];let u=this.groupby=[],p=[];for(let l of n)if(Object.hasOwn(l,"field")){let{channel:d,field:h}=l;d==="z"?(f.select({[d]:h}),p.push("z")):d!=="x"&&d!=="y"&&(f.select({[d]:h}),u.push(d))}return Qv(f,a,c,p,i,s,u,r)}};function RJ(t,e){if(Array.isArray(e)&&!e.length)return e;let n=t.channelField("x").column,r=t.channelField("y").column,o=s=>{let a=`${s.expr}`;return s.type!=="BETWEEN"||a!==n&&a!==r},i=s=>s.op==="AND"?dn(s.clauses.filter(a=>o(a))):s;return Array.isArray(e)?e.filter(s=>o(s)).map(s=>i(s)):i(e)}var ju=class extends $e{constructor(e,n,r){let{bins:o=1024,bandwidth:i=20,...s}=r,a=e.endsWith("X")?"y":"x";super(e,n,s,a==="x"?mM:xM),this.dim=a,this.bins=we(o,c=>(this.bins=c,this.requestUpdate())),this.bandwidth=we(i,c=>(this.bandwidth=c,this.grid?this.convolve().update():null))}get filterStable(){let e=this.dim==="x"?"xDomain":"yDomain",n=this.plot.getAttribute(e);return n&&!n[en]}query(e=[]){if(this.hasOwnData())throw new Error("Density1DMark requires a data source");let{bins:n,channels:r,dim:o}=this,i=this.extent=(o==="x"?Vo:Go)(this,e),[s,a]=hr(this,o,n,i),c=Xh(r,this.sourceTable(),[o]).where(e.concat(tn(a,i))),f=this.channelField("weight")?"weight":null;return Gv(c,s,f)}queryResult(e){let{columns:{index:n,density:r}}=Wn(e);return this.grid=TP(this.bins,n,r),this.convolve()}convolve(){let{bins:e,bandwidth:n,dim:r,grid:o,plot:i,extent:[s,a]}=this,c=o.some(b=>b<0),f=r==="x"?i.innerWidth():i.innerHeight(),u=Gh(n*(e-1)/f,c),p=a2(u,o,e),l=r==="x"?"y":"x",d=this.channelField(r).as,h=+s,m=(a-h)/(e-1),x=1/m,g=new Float64Array(e),y=new Float64Array(e);for(let b=0;b<e;++b)g[b]=h+b*m,y[b]=p[b]*x;return this.data={numRows:e,columns:{[d]:g,[l]:y}},this}plotSpecs(){let{type:e,data:{numRows:n,columns:r},channels:o,dim:i}=this,s=i==="x"?{y:r.y}:{x:r.x};for(let a of o)s[a.channel]=Sn(a,r);return[{type:e,data:{length:n},options:s}]}};var Kh=class extends no{constructor(e,n){let{type:r="dot",...o}=n;super(r,e,{bandwidth:20,interpolate:"linear",pad:0,pixelSize:2,...o})}convolve(){super.convolve();let{bins:e,pad:n,extentX:r,extentY:o}=this,[i,s]=e,a=Tc(this,"x"),c=Tc(this,"y"),[f,u]=r.map(x=>a.apply(x)),[p,l]=o.map(x=>c.apply(x)),d=(u-f)/(i-n),h=(l-p)/(s-n),m=n?0:.5;return this.data=OJ(this.grids,e,f,p,d,h,a.invert,c.invert,m),this}plotSpecs(){let{type:e,channels:n,densityMap:r,data:{numRows:o,columns:i}}=this,s={};for(let a of n){let{channel:c}=a;s[c]=c==="x"||c==="y"?i[c]:Sn(a,i)}for(let a in r)r[a]&&(s[a]=i.density);return[{type:e,data:{length:o},options:s}]}};function OJ(t,e,n,r,o,i,s,a,c){let f=1/(o*i),[u,p]=e,l=u*p,d=l*t.numRows,h=new Float64Array(d),m=new Float64Array(d),x=new Float64Array(d),g={x:h,y:m,density:x},{density:y,...b}=t.columns;for(let _ in b)g[_]=new b[_].constructor(d);let w=0;for(let _=0;_<t.numRows;++_){for(let A in b)g[A].fill(b[A][_],w,w+l);let v=y[_];for(let A=0,T=0;T<p;++T)for(let E=0;E<u;++E,++w,++A)h[w]=s(n+(E+c)*o),m[w]=a(r+(T+c)*i),x[w]=v[A]*f}return{numRows:d,columns:g}}function $J(t,e,n){var r=1e-8,o=e-1,i=n-1,s=0,a,c,f,u,p,l,d,h,m,x,g;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&n>=1?(f=t<.5?t:1-t,u=Math.sqrt(-2*Math.log(f)),d=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,t<.5&&(d=-d),h=(d*d-3)/6,m=2/(1/(2*e-1)+1/(2*n-1)),x=d*Math.sqrt(h+m)/m-(1/(2*n-1)-1/(2*e-1))*(h+5/6-2/(3*m)),d=e/(e+n*Math.exp(2*x))):(a=Math.log(e/(e+n)),c=Math.log(n/(e+n)),u=Math.exp(e*a)/e,p=Math.exp(n*c)/n,x=u+p,t<u/x?d=Math.pow(e*x*t,1/e):d=1-Math.pow(n*x*(1-t),1/n)),g=-Xu(e)-Xu(n)+Xu(e+n);s<10;s++){if(d===0||d===1)return d;if(l=DJ(d,e,n)-t,u=Math.exp(o*Math.log(d)+i*Math.log(1-d)+g),p=l/u,d-=u=p/(1-.5*Math.min(1,p*(o/d-i/(1-d)))),d<=0&&(d=.5*(d+u)),d>=1&&(d=.5*(d+u+1)),Math.abs(u)<r*d&&s>0)break}return d}function DJ(t,e,n){var r=t===0||t===1?0:Math.exp(Xu(e+n)-Xu(e)-Xu(n)+e*Math.log(t)+n*Math.log(1-t));return t<0||t>1?0:t<(e+1)/(e+n+2)?r*$P(t,e,n)/e:1-r*$P(1-t,n,e)/n}function $P(t,e,n){var r=1e-30,o=1,i=e+n,s=e+1,a=e-1,c=1,f=1-i*t/s,u,p,l,d;for(Math.abs(f)<r&&(f=r),f=1/f,d=f;o<=100&&(u=2*o,p=o*(n-o)*t/((a+u)*(e+u)),f=1+p*f,Math.abs(f)<r&&(f=r),c=1+p/c,Math.abs(c)<r&&(c=r),f=1/f,d*=f*c,p=-(e+o)*(i+o)*t/((e+u)*(s+u)),f=1+p*f,Math.abs(f)<r&&(f=r),c=1+p/c,Math.abs(c)<r&&(c=r),f=1/f,l=f*c,d*=l,!(Math.abs(l-1)<3e-7));o++);return d}function Xu(t){var e=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,o,i,s;for(s=(i=o=t)+5.5,s-=(o+.5)*Math.log(s);e<6;e++)r+=n[e]/++i;return Math.log(2.506628274631*r/o)-s}function DP(t,e){var n=$J(2*Math.min(t,1-t),.5*e,.5);return n=Math.sqrt(e*(1-n)/n),t>.5?n:-n}function PP(t){let e=-Math.log((1-t)*(1+t)),n;return e<6.25?(e-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*e,n=128584807152564e-32+n*e,n=11157877678025181e-33+n*e,n=-1333171662854621e-31+n*e,n=20972767875968562e-33+n*e,n=6637638134358324e-30+n*e,n=-4054566272975207e-29+n*e,n=-8151934197605472e-29+n*e,n=26335093153082323e-28+n*e,n=-12975133253453532e-27+n*e,n=-5415412054294628e-26+n*e,n=10512122733215323e-25+n*e,n=-4112633980346984e-24+n*e,n=-29070369957882005e-24+n*e,n=42347877827932404e-23+n*e,n=-13654692000834679e-22+n*e,n=-13882523362786469e-21+n*e,n=.00018673420803405714+n*e,n=-.000740702534166267+n*e,n=-.006033670871430149+n*e,n=.24015818242558962+n*e,n=1.6536545626831027+n*e):e<16?(e=Math.sqrt(e)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*e,n=-27517406297064545e-23+n*e,n=18239629214389228e-24+n*e,n=15027403968909828e-22+n*e,n=-4013867526981546e-21+n*e,n=29234449089955446e-22+n*e,n=12475304481671779e-21+n*e,n=-47318229009055734e-21+n*e,n=6828485145957318e-20+n*e,n=24031110387097894e-21+n*e,n=-.0003550375203628475+n*e,n=.0009532893797373805+n*e,n=-.0016882755560235047+n*e,n=.002491442096107851+n*e,n=-.003751208507569241+n*e,n=.005370914553590064+n*e,n=1.0052589676941592+n*e,n=3.0838856104922208+n*e):Number.isFinite(e)?(e=Math.sqrt(e)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*e,n=15076572693500548e-25+n*e,n=-3789465440126737e-24+n*e,n=761570120807834e-23+n*e,n=-1496002662714924e-23+n*e,n=2914795345090108e-23+n*e,n=-6771199775845234e-23+n*e,n=22900482228026655e-23+n*e,n=-99298272942317e-20+n*e,n=4526062597223154e-21+n*e,n=-1968177810553167e-20+n*e,n=7599527703001776e-20+n*e,n=-.00021503011930044477+n*e,n=-.00013871931833623122+n*e,n=1.0103004648645344+n*e,n=4.849906401408584+n*e):n=1/0,n*t}var Wu=class extends $e{constructor(e,n,r){let o=e.endsWith("X")?"y":"x",{ci:i=.95,...s}=r;super(e,n,s),this.dim=o,this.field=this.channelField(o).field,this.channels=this.channels.filter(a=>a.channel!==o),this.ci=we(i,a=>(this.ci=a,this.update()))}query(e=[]){let{channels:n,field:r}=this,o=n.concat([{field:jl(r),as:"__avg__"},{field:Pt(Vl(r),si(qe(r))),as:"__se__"}]);return Xh(o,this.sourceTable()).where(e)}queryResult(e){return this.data=Wn(e),this}plotSpecs(){let{type:e,dim:n,detail:r,data:o,ci:i,channels:s}=this,a=Math.SQRT2*PP(i),{columns:{__avg__:c,__se__:f}}=o,u={[`${n}1`]:c.map((p,l)=>p-a*f[l]),[`${n}2`]:c.map((p,l)=>p+a*f[l])};return hM(e,r,s,o,u)}};var PJ="geom",tm=class extends $e{constructor(e,n={},r){!i2(e)&&!n?.geometry&&(n.geometry=Hl(PJ)),super("geo",e,n,r)}queryResult(e){super.queryResult(e);let n=this.channelField("geometry")?.as;if(n){let{columns:r}=this.data;typeof r[n][0]=="string"&&(r[n]=r[n].map(o=>JSON.parse(o)))}return this}};var em=class extends $e{constructor(e,n){let{type:r="hexagon",binWidth:o=20,...i}=n;super(r,e,{r:o/2,clip:!0,...i},s2),this.binWidth=we(o,s=>(this.binWidth=s,this.requestUpdate()))}get filterStable(){let e=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return e&&n&&!e[en]&&!n[en]}query(e=[]){if(this.hasOwnData())return null;let{plot:n,binWidth:r,channels:o}=this,i,s,a=new Set,c={};for(let N of o)if(N.channel!=="orderby"){if(N.channel==="x")i=N;else if(N.channel==="y")s=N;else if(Object.hasOwn(N,"field")){let{as:M,field:k}=N;c[M]=k,tr(k)||a.add(M)}}let[f,u]=Vo(this,e),[p,l]=Go(this,e),d=.5-n.getAttribute("marginLeft"),h=0-n.getAttribute("marginTop"),m=pe(r),x=pe(r*(1.5/Math.sqrt(3))),g=pe(n.innerWidth()/(u-f)),y=pe(n.innerHeight()/(l-p)),b="_x",w="_y",_="_px",v="_py",A="_pi",T="_pj",E="_tt";return st.select({[i.as]:Rt(pe(f),Pt(Rt(mt(Rt(b,mt(.5,Gl(w,1))),m),d),g)),[s.as]:pt(pe(l),Pt(Rt(mt(w,x),h),y)),...c}).groupby(b,w,...a).from(st.select({[v]:Pt(mt(y,pt(pt(l,s.field),h)),x),[T]:Gt(ai(v)),[_]:pt(Pt(pt(mt(g,pt(i.field,f)),d),m),mt(.5,Gl(T,1))),[A]:Gt(ai(_)),[E]:dn(_r(mt(Be(pt(v,T)),3),1),_r(Rt(ve(pt(_,A),2),ve(pt(v,T),2)),Rt(ve(pt(pt(_,A),mt(.5,ii(ae(_,A),-1,1))),2),ve(pt(pt(v,T),ii(ae(v,T),-1,1)),2)))),[b]:ii(E,Gt(Rt(Rt(A,ii(ae(_,A),-.5,.5)),ii(jr(Gl(T,1),0),.5,-.5))),A),[w]:ii(E,Gt(Rt(T,ii(ae(v,T),-1,1))),T)},"*").from(this.sourceTable()).where(vr(i.field),vr(s.field),e))}};var nm=class extends no{constructor(e,n){let{origin:r=[0,0],dim:o="xy",...i}=n;super("image",e,i),this.image=null,this.origin=r,this.tileX=o.toLowerCase().includes("x"),this.tileY=o.toLowerCase().includes("y")}setPlot(e,n){let r=()=>{this.hasFieldInfo()&&this.rasterize()};e.addAttributeListener("schemeColor",r),super.setPlot(e,n)}requestQuery(){return this.requestTiles()}query(e=[]){return this._filter=e,null}tileQuery(e){let{interpolate:n,pad:r,channels:o,densityMap:i}=this,[[s,a],[c,f]]=e,[u,p]=this.bins,[l,d]=hr(this,"x",u,[s,a],r),[h,m]=hr(this,"y",p,[c,f],r),x=r?[tn(d,[+s,+a]),tn(m,[+c,+f])]:[Kn(+s,d),ae(d,+a),Kn(+c,m),ae(m,+f)],g=st.from(this.sourceTable()).where(x),y=this.groupby=[],b={};for(let _ of o)if(Object.hasOwn(_,"field")){let{as:v,channel:A,field:T}=_;T.aggregate?(b[A]=T,i[A]=!0):A==="weight"?b.density=Yt(T):A!=="x"&&A!=="y"&&(g.select({[v]:T}),y.push(v))}let w=this.aggr=Object.keys(b);if(b.density&&w.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(w.length||(w.push("density"),b.density=qe()),n==="linear"){if(w.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!b.density)throw new Error("Linear binning not applicable to custom aggregates.");return YJ(g,l,h,b.density,u,y)}else return zJ(g,l,h,b,u,y)}async requestTiles(){let e=Sr();this.prefetch&&e.cancel(this.prefetch);let{pad:n,tileX:r,tileY:o,origin:[i,s]}=this,[a,c]=this.bins=this.binDimensions(),[f,u]=Vo(this,this._filter),[p,l]=Go(this,this._filter),d=u-f,h=l-p,m=Math.floor((f-i)*(a-n)/d),x=Math.floor((p-s)*(c-n)/h),g=(M,k)=>[[i+M*d,i+(M+1)*d],[s+k*h,s+(k+1)*h]],y=Math.floor((f-i)/d),b=r?FP((u-i)/d):y,w=Math.floor((p-s)/h),_=o?FP((l-s)/h):w,v=[];for(let M=y;M<=b;++M)for(let k=w;k<=_;++k)v.push([M,k]);let A=v.map(([M,k])=>e.query(this.tileQuery(g(M,k)))),T=[];if(r)for(let M=w;M<=_;++M)T.push([b+1,M]),T.push([y-1,M]);if(o){let M=r?y-1:y,k=r?b+1:b;for(let O=M;O<=k;++O)T.push([O,_+1]),T.push([O,w-1])}this.prefetch=T.map(([M,k])=>e.prefetch(this.tileQuery(g(M,k))));let E=await Promise.all(A),N=FJ(a,c,m,x,v,E);this.grids0={numRows:N.length,columns:{density:[N]}},this.convolve().update()}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:e,grids:n}=this,[r,o]=e,{numRows:i,columns:s}=n,{canvas:a,ctx:c,img:f}=BJ(this,r,o),{alpha:u,alphaProp:p,color:l,colorProp:d}=yM(this),h=s[p]??[],m=s[d]??[],x=i>1&&d&&this.groupby?.includes(d)?c2(m,this.plot.getAttribute("colorDomain")):Qh(i);return this.data={numRows:i,columns:{src:Array.from({length:i},(g,y)=>(l?.(f.data,r,o,m[x[y]]),u?.(f.data,r,o,h[x[y]]),c.putImageData(f,0,0),a.toDataURL()))}},this}plotSpecs(){let{type:e,plot:n,data:{numRows:r,columns:o}}=this,i={src:o.src,width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:e,data:{length:r},options:i}]}};function FJ(t,e,n,r,o,i){let s=new Float64Array(t*e);return i.forEach((a,c)=>{let[f,u]=o[c],p=f*t-n,l=u*e-r;qJ(t,e,s,a,p,l)}),s}function qJ(t,e,n,r,o,i){let s=r.numRows;if(s===0)return;let a=r.getChild("index").toArray(),c=r.getChild("density").toArray();for(let f=0;f<s;++f){let u=a[f],p=o+u%t,l=i+Math.floor(u/t);0<=p&&p<t&&0<=l&&l<e&&(n[p+l*t]=c[f])}}function BJ(t,e,n){if(!t.image||t.image.w!==e||t.image.h!==n){let r=f2(e,n),o=r.getContext("2d",{willReadFrequently:!0}),i=o.getImageData(0,0,e,n);t.image={canvas:r,ctx:o,img:i,w:e,h:n}}return t.image}function zJ(t,e,n,r,o,i){return t.select({index:ge`FLOOR(${e})::INTEGER + FLOOR(${n})::INTEGER * ${o}`,...r}).groupby("index",i)}function YJ(t,e,n,r,o,i){let s=r.column?`* ${r.column}`:"",a=(l,d)=>t.clone().select({xp:e,yp:n,i:l,w:d}),c=a(ge`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${o}`,ge`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(ge`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${o}`,ge`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(ge`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${o}`,ge`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),p=a(ge`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${o}`,ge`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return st.from(st.unionAll(c,f,u,p)).select({index:"i",density:Yt("w")},i).groupby("index",i).having(jr("density",0))}function FP(t){let e=Math.floor(t);return e===t?e-1:e}var rm=class extends $e{constructor(e,n){let{ci:r=.95,precision:o=4,...i}=n;super("line",e,i);let s=()=>this.modelFit?this.confidenceBand().update():null;this.ci=we(r,a=>(this.ci=a,s())),this.precision=we(o,a=>(this.precision=a,s()))}query(e=[]){let n=this.channelField("x").as,r=this.channelField("y").as,o=Array.from(new Set(["stroke","z","fx","fy"].flatMap(i=>this.channelField(i)?.as||[])));return st.from(super.query(e)).select({intercept:Hw(r,n),slope:Jw(r,n),n:Wl(r,n),ssy:Zw(r,n),ssx:Qw(r,n),xm:Xl(r,n),x0:pe(jn(n).where(vr(r))),x1:pe(Ke(n).where(vr(r)))}).select(o).groupby(o)}queryResult(e){return this.modelFit=Wn(e),this.lineData=UJ(this.modelFit),this.confidenceBand()}confidenceBand(){let{ci:e,modelFit:n,precision:r,plot:o}=this,i=o.innerWidth();return this.areaData=e?jJ(n,e,r,i):null,this}plotSpecs(){let{lineData:e,areaData:n,channels:r,ci:o}=this,i=e.columns,s=o?n.columns:{},a={x:i.x,y:i.y},c={x:s.x,y1:s.y1,y2:s.y2,fillOpacity:.1};for(let f of r)switch(f.channel){case"x":case"y":case"fill":break;case"tip":c.tip=Sn(f,s);break;case"stroke":a.stroke=Sn(f,i),c.fill=Sn(f,s);break;case"strokeOpacity":a.strokeOpacity=Sn(f,i);break;case"fillOpacity":c.fillOpacity=Sn(f,s);break;default:a[f.channel]=Sn(f,i),c[f.channel]=Sn(f,s);break}return[...o?[{type:"areaY",data:{length:n.numRows},options:c}]:[],{type:"line",data:{length:e.numRows},options:a}]}};function bM(t,e){if(t.concat)return t.concat(e);let n=new t.constructor(t.length+e.length);return n.set(t,0),n.set(e,t.length),n}function UJ(t){let{x0:e=[],x1:n=[],xm:r,intercept:o,slope:i,n:s,ssx:a,ssy:c,...f}=t.columns,u=(d,h)=>o[h]+d*i[h],p=bM(e,n),l=bM(e.map(u),n.map(u));for(let d in f)f[d]=bM(f[d],f[d]);return{numRows:p.length,columns:{x:p,y:l,...f}}}function jJ(t,e,n,r){let o=t.numRows,{x0:i,x1:s,xm:a,intercept:c,slope:f,n:u,ssx:p,ssy:l,...d}=t.columns,h=Object.keys(d),m={x:[],y1:[],y2:[]};h.forEach(x=>m[x]=[]);for(let x=0;x<o;++x){let g=n*(s[x]-i[x])/r,y=DP((1-e)/2,u[x]-2)*Math.sqrt(l[x]/(u[x]-2));ye(i[x],s[x]-g/2,g).concat(s[x]).forEach(b=>{let w=c[x]+b*f[x],_=y*Math.sqrt(1/u[x]+(b-a[x])**2/p[x]);m.x.push(b),m.y1.push(w-_),m.y2.push(w+_),h.forEach(v=>m[v].push(d[v][x]))})}return{numRows:m.x.length,columns:m}}function Vu(t){t.tagName==="a"&&(t=t.children[0]);let e=t.__data__;return Array.isArray(e)?e[0]:e}function qP(t){let e=t.toLowerCase(),n=t.length,r="";for(let o=0;o<n;++o)r+=(t[o]!==e[o]?"-":"")+e[o];return r}function ea(t){let e={};for(let n in t)e[qP(n)]=t[n];return e}function XJ(t){let{channels:e}=t,n=new Set,r=!1,o=!1;for(let i of e){let{channel:s,field:a,as:c}=i;if(s==="orderby")r=!0;else if(a)if(tr(a))o=!0;else{if(n.has(c))continue;n.add(c)}}return!r&&o&&n.size&&t.channels.push({channel:"orderby",value:Array.from(n)}),t}var om=class{constructor(e,{selection:n,channels:r={}}){this.mark=XJ(e),this.selection=n;let o=Object.entries(ea(r));this.channels=o.length?o:[["opacity",.2]],this.selection.addEventListener("value",sl(()=>this.update()))}init(e){this.svg=e;let n=this.values=[],o=`g[data-index="${this.mark.index}"]`,i=`${o} > *:not(g), ${o} > g > *`,s=this.nodes=e.querySelectorAll(i),{channels:a}=this;for(let c=0;c<s.length;++c){let f=s[c];n.push(a.map(u=>f.getAttribute(u[0])))}return this.update()}async update(){let{svg:e,nodes:n,channels:r,values:o,mark:i,selection:s}=this;if(!e)return;let a=await WJ(i,s);for(let c=0;c<n.length;++c){let f=n[c],u=o[c],p=a(Vu(f));for(let l=0;l<r.length;++l){let[d,h]=r[l];f.setAttribute(d,p?u[l]:h)}}}};async function WJ(t,e){let n=e?.predicate(t);if(!n||n.length===0)return()=>!0;let r=t.filterBy?.predicate(t,!0),o={__:dn(n)},i=t.query(r);(i.queries||[i]).forEach(c=>{c._groupby.length?c.select(o):c.setSelect(o)});let s=await t.coordinator.query(i),a=s.getChild?.("__");return s.numRows||s.length?a?c=>a.at(c):c=>s[c].__:()=>!1}function u2(){let t=this,e=t.getScreenCTM,n;t.getScreenCTM=()=>t.isConnected?n=e.call(t):n}function wM(t){let e=t.on,n=!0;function r(o){n=!1,o(),n=!0}return t.reset=(...o)=>{r(()=>t.clear(...o))},t.moveSilent=(...o)=>{r(()=>t.move(...o))},t.on=(...o)=>{if(o.length>1&&o[1]){let i=o[1];o[1]=(...s)=>n&&i(...s)}return e(...o)},t}function l2(){return wM(j_())}function BP(){return wM(Y_())}function zP(){return wM(U_())}function p2(t,e,n,r,o){let i=Nt(e??t).append("g").attr("class",o),s=t.scale("fx"),a=t.scale("fy");if(s||a){let c=s?.domain.map(u=>s.apply(u)-n),f=a?.domain.map(u=>a.apply(u)-r);if(c&&f)for(let u=0;u<c.length;++u)for(let p=0;p<f.length;++p)i.append("g").attr("transform",`translate(${c[u]}, ${f[p]})`);else if(c)for(let u=0;u<c.length;++u)i.append("g").attr("transform",`translate(${c[u]}, 0})`);else if(f)for(let u=0;u<f.length;++u)i.append("g").attr("transform",`translate(0, ${f[u]})`);i=i.selectAll("g")}return i.each(u2)}function im(t,e){return t===e||t&&e&&Math.abs(t[0]-e[0])<1e-12&&Math.abs(t[1]-e[1])<1e-12||!1}function YP(t){if(pn(t)){if(t.type==="COLUMN_REF")return t.column;if(t.type==="AGGREGATE")return t.args[0]??t}return t}function Ho(t,e){return YP(t.channelField(e)?.field)}function UP(t,e){let n=[],r=[];return e.forEach(o=>{let i=o==="color"?["color","fill","stroke"]:o==="x"?["x","x1","x2"]:o==="y"?["y","y1","y2"]:[o];for(let s=0;s<i.length;++s){let a=t.channelField(i[s],{exact:!0});if(a){n.push(YP(a.field)),r.push(a.as);return}}throw new Error(`Missing channel: ${o}`)}),{fields:n,as:r}}function sm(t,e,n=1){return e.invert(n*Math.floor(t/n))}var na=class{constructor(e,{channel:n,selection:r,field:o=void 0,pixelSize:i=1,peers:s=!0,brush:a}){this.mark=e,this.channel=n,this.pixelSize=i||1,this.selection=r,this.peers=s,this.field=o||Ho(e,n),this.style=a&&ea(a),this.brush=n==="y"?zP():BP(),this.brush.on("brush end",({selection:c})=>this.publish(c))}reset(){this.value=void 0,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause(this.value||[0,1]))}publish(e){let n;e&&(n=e.map(r=>sm(r,this.scale,this.pixelSize)).sort((r,o)=>r-o)),im(n,this.value)||(this.value=n,this.g.call(this.brush.moveSilent,e),this.selection.update(this.clause(n)))}clause(e){let{mark:n,pixelSize:r,field:o,scale:i}=this;return Ta(o,e,{source:this,clients:this.peers?n.plot.markSet:new Set().add(n),scale:i,pixelSize:r})}init(e,n){let{brush:r,channel:o,style:i}=this;this.scale=e.scale(o);let s=this.value?.map(this.scale.apply).sort(yt),a=e.scale("x").range,c=e.scale("y").range;if(r.extent([[It(a),It(c)],[kt(a),kt(c)]]),this.g=p2(e,n,It(a),It(c),`interval-${o}`).call(r).call(r.moveSilent,s),i){let f=this.g.selectAll("rect.selection");for(let u in i)f.attr(u,i[u])}e.addEventListener("pointerenter",f=>{f.buttons||this.activate()})}};var am=class{constructor(e,{selection:n,xfield:r,yfield:o,pixelSize:i=1,peers:s=!0,brush:a}){this.mark=e,this.pixelSize=i||1,this.selection=n,this.peers=s,this.xfield=r||Ho(e,"x"),this.yfield=o||Ho(e,"y"),this.style=a&&ea(a),this.brush=l2(),this.brush.on("brush end",({selection:c})=>this.publish(c))}reset(){this.value=void 0,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause(this.value||[[0,1],[0,1]]))}publish(e){let{value:n,pixelSize:r,xscale:o,yscale:i}=this,s,a;if(e){let[c,f]=e;s=[c[0],f[0]].map(u=>sm(u,o,r)).sort(yt),a=[c[1],f[1]].map(u=>sm(u,i,r)).sort(yt)}(!im(s,n?.[0])||!im(a,n?.[1]))&&(this.value=e?[s,a]:void 0,this.g.call(this.brush.moveSilent,e),this.selection.update(this.clause(this.value)))}clause(e){let{mark:n,pixelSize:r,xfield:o,yfield:i,xscale:s,yscale:a}=this;return r_([o,i],e,{source:this,clients:this.peers?n.plot.markSet:new Set().add(n),scales:[s,a],pixelSize:r})}init(e){let{brush:n,style:r,value:o}=this,i=this.xscale=e.scale("x"),s=this.yscale=e.scale("y"),a=i.range,c=s.range;if(n.extent([[It(a),It(c)],[kt(a),kt(c)]]),this.g=p2(e,null,It(a),It(c),"interval-xy").call(n),r){let f=this.g.selectAll("rect.selection");for(let u in r)f.attr(u,r[u])}if(o){let[f,u]=o[0].map(i.apply).sort(yt),[p,l]=o[1].map(s.apply).sort(yt);this.g.call(n.moveSilent,[[f,p],[u,l]])}e.addEventListener("pointerenter",f=>{f.buttons||this.activate()})}};var Ec=class{constructor(e,{selection:n,pointer:r,channels:o,fields:i,maxRadius:s=40}){this.mark=e,this.selection=n,this.clients=new Set().add(e),this.pointer=r,this.channels=o||(r==="x"?["x"]:r==="y"?["y"]:["x","y"]),this.fields=i||this.channels.map(a=>Ho(e,[a])),this.maxRadius=s,this.valueIndex=-1}clause(e){let{clients:n,fields:r}=this,o={source:this,clients:n};return r.length>1?ci(r,e&&[e],o):Aa(r[0],e?.[0],o)}init(e){let n=this,{mark:r,channels:o,selection:i,maxRadius:s}=this,{data:{columns:a}}=r,c=o.map(m=>r.channelField(m).as),f=!er(i),[u,p]=VJ(e,r),l=this.pointer==="y"?.01:1,d=this.pointer==="x"?.01:1,h=Nt(e);h.on("pointerenter pointerdown pointermove",function(m){let[x,g]=hn(m,this),y=GJ(u,p,x,g,l,d,s);if(y!==this.valueIndex){this.valueIndex=y;let b=y<0?void 0:c.map(w=>a[w][y]);i.update(f?!b||b.length>1?b:b[0]:n.clause(b))}}),!f&&(h.on("pointerleave",()=>{i.update(n.clause(void 0))}),e.addEventListener("pointerenter",m=>{if(!m.buttons){let x=this.channels.map(()=>0);i.activate(this.clause(x))}}))}};function VJ(t,e){let{data:{columns:n}}=e,r=p=>n[e.channelField(p)?.as],o=p=>t.scale(p),i=t.scale("x"),s=t.scale("y"),a=o("fx")?.apply,c=o("fy")?.apply,f=Array.from(r("x"),i.apply),u=Array.from(r("y"),s.apply);if(a){let p=It(i.range),l=r("fx");for(let d=0;d<l.length;++d)f[d]+=a(l[d])-p}if(c){let p=It(s.range),l=r("fy");for(let d=0;d<l.length;++d)u[d]+=c(l[d])-p}return[f,u]}function GJ(t,e,n,r,o,i,s){let a=s*s,c=-1;for(let f=0;f<t.length;++f){let u=o*(t[f]-n),p=i*(e[f]-r),l=u*u+p*p;l<=a&&(a=l,c=f)}return c}var jP=(t,e)=>t-e,cm=class{constructor(e,{x:n=new uo,y:r=new uo,xfield:o,yfield:i,zoom:s=!0,panx:a=!0,pany:c=!0}){this.mark=e,this.xsel=n,this.ysel=r,this.xfield=o||Ho(e,"x"),this.yfield=i||Ho(e,"y"),this.zoom=vM(s,[0,1/0],[1,1]),this.panx=this.xsel&&a,this.pany=this.ysel&&c;let{plot:f}=e;a&&this.xsel.addEventListener("value",u=>{f.setAttribute("xDomain",u)&&f.update()}),c&&this.ysel.addEventListener("value",u=>{f.setAttribute("yDomain",u)&&f.update()})}publish(e){if(this.panx){let n=HJ(e,this.xscale);this.xsel.update(this.clause(n,this.xfield,this.xscale))}if(this.pany){let n=QJ(e,this.yscale);this.ysel.update(this.clause(n,this.yfield,this.yscale))}}clause(e,n,r){return Ta(n,e,{source:this,clients:this.mark.plot.markSet,scale:r})}init(e){if(this.svg=e,this.initialized)return;this.initialized=!0;let{panx:n,pany:r,mark:{plot:{element:o}},xsel:i,ysel:s}=this;this.xscale=e.scale("x"),this.yscale=e.scale("y");let a=this.xscale.range.slice().sort(jP),c=this.yscale.range.slice().sort(jP),f=vM(n,[-1/0,1/0],a),u=vM(r,[-1/0,1/0],c),p=aS().extent([[a[0],c[0]],[a[1],c[1]]]).scaleExtent(this.zoom).translateExtent([[f[0],u[0]],[f[1],u[1]]]).on("start",()=>{this.xscale=this.svg.scale("x"),this.yscale=this.svg.scale("y")}).on("end",()=>o.__zoom=new ar(1,0,0)).on("zoom",({transform:l})=>this.publish(l));if(Nt(o).call(p),n||r){let l=!1;o.addEventListener("pointerenter",d=>{if(!l&&(l=!0,!d.buttons)){if(n){let{xscale:h,xfield:m}=this;i.activate(this.clause(h.domain,m,h))}if(r){let{yscale:h,yfield:m}=this;s.activate(this.clause(h.domain,m,h))}}}),o.addEventListener("pointerleave",()=>l=!1)}}};function vM(t,e,n){return t?Array.isArray(t)?t:e:n}function HJ(t,e){return e.range.map(t.invertX,t).map(e.invert,e)}function QJ(t,e){return e.range.map(t.invertY,t).map(e.invert,e)}var ZJ={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},JJ=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,KJ=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,tK=/^((\s+,?\s*)|(,\s*))/,eK=/^[01]/,XP=t=>`Invalid SVG path, incorrect parameter ${t}`;function WP(t){let e=[];return(t.match(JJ)||[]).forEach(r=>{let o=r[0],i=o.toLowerCase(),s=ZJ[i],a=nK(i,s,r.slice(1).trim()),c=a.length;if(c<s||c&&c%s!==0)throw new Error(XP("count"));if(e.push([o,...a.slice(0,s)]),c!==s){i==="m"&&(o=o==="M"?"L":"l");for(let f=s;f<c;f+=s)e.push([o,...a.slice(f,f+s)])}}),e}function nK(t,e,n){let r=[];for(let o=0;e&&o<n.length;)for(let i=0;i<e;++i){let s=t==="a"&&(i===3||i===4)?eK:KJ,a=n.slice(o).match(s);if(a===null)throw new Error(XP("type"));o+=a[0].length,r.push(+a[0]);let c=n.slice(o).match(tK);c!==null&&(o+=c[0].length)}return r}function ZP(t,e,n){let{x:r,y:o}=t.getBoundingClientRect(),i=t.createSVGMatrix(),s=[];for(let a of e.children)if(a.tagName==="g"){let c=JP(a)??i;for(let f of a.children)VP(n,r,o,f,c)&&s.push(f)}else VP(n,r,o,a,i)&&s.push(a);return s}function VP(t,e,n,r,o){let[[i,s],[a,c]]=t,{e:f,f:u}=o,p=r.getBoundingClientRect(),l=p.left-e,d=p.right-e,h=p.top-n,m=p.bottom-n;if(l>=i&&d<=a&&h>=s&&m<=c)return!0;if(l<=a&&d>=i&&h<=c&&m>=s){let x=r.tagName;if(x==="a"&&(r=r.children[0],x=r.tagName),x==="rect"||x==="text"||x==="image")return!0;switch(i-=f,s-=u,a-=f,c-=u,x){case"circle":return KP(i,s,a,c,Ic(r.cx),Ic(r.cy),Ic(r.r));case"line":return tF(i,s,a,c,Ic(r.x1),Ic(r.y1),Ic(r.x2),Ic(r.y2));case"path":return rK(i,s,a,c,r)}}return!1}function Ic(t){return t.baseVal.value}function JP(t){let e=t.transform.baseVal,n=e.length,r=e[0]?.matrix;for(let o=1;o<n;++o)r=r.multiply(e[o].matrix);return r}function KP(t,e,n,r,o,i,s){let a=t<=o&&o<=n,c=e<=i&&i<=r;if(a&&c)return!0;let f=Math.min(Math.abs(t-o),Math.abs(n-o));if(c&&f<=s)return!0;let u=Math.min(Math.abs(e-i),Math.abs(r-i));return a&&u<=s||f*f+u*u<=s*s}function tF(t,e,n,r,o,i,s,a){let c=Math.max(Math.min(o,s),t),f=Math.min(Math.max(o,s),n);if(c>f)return!1;let u=i,p=a,l=s-o;if(Math.abs(l)>1e-8){let m=(a-i)/l,x=i-m*o;u=m*c+x,p=m*f+x}let d=Math.max(Math.min(u,p),e),h=Math.min(Math.max(u,p),r);return d<=h}function rK(t,e,n,r,o){let i=o.__path__||(o.__path__=WP(o.getAttribute("d"))),s=0,a=0,c=0,f=0,u=!1,p=[0,0],l=2,d=JP(o),h=(y,b)=>{p.length=l=2,p[0]=c=s=y,p[1]=f=a=b},m=d?(y,b)=>h(GP(d,y,b),HP(d,y,b)):(y,b)=>h(y,b),x=(y,b)=>(p[l]=y,p[l+1]=b,l+=2,tF(t,e,n,r,p[l-4],p[l-3],y,b)),g=d?(y,b)=>{u=x(GP(d,c=y,f=b),HP(d,y,b))}:(y,b)=>{u=x(c=y,f=b)};for(let y=0;y<i.length;++y){let b=i[y];switch(b[0]){case"M":m(b[1],b[2]);break;case"m":m(c+b[1],f+b[2]);break;case"L":case"T":g(b[1],b[2]);break;case"H":g(b[1],f);break;case"V":g(c,b[1]);break;case"l":case"t":g(c+b[1],f+b[2]);break;case"h":g(c+b[1],f);break;case"v":g(c,f+b[1]);break;case"C":g(b[5],b[6]);break;case"c":g(c+b[5],f+b[6]);break;case"S":case"Q":g(b[3],b[4]);break;case"s":case"q":g(c+b[3],f+b[4]);break;case"A":g(b[6],b[7]);break;case"a":if(oK(i,y))return KP(t,e,n,r,c,f-b[2],b[2]);g(c+b[6],c+b[7]);break;case"z":case"Z":if(g(s,a),iK(t,e,p)>0)return!0;m(s,a);break;default:return console.warn("SVG path command not supported: ",b[0]),!1}if(u)return!0}return!1}function GP(t,e,n){return t.a*e+t.c*n+t.e}function HP(t,e,n){return t.b*e+t.d*n+t.f}function oK(t,e){let n=t[e],r=t[e+1];return r&&r[0]==="a"&&t[e+2]?.[0]==="z"&&n[1]===n[2]&&r[1]===r[2]&&n[1]===r[1]&&n[7]===-r[7]}function iK(t,e,n){let r=0,o=n.length-2;for(let i=0;i<o;i+=2)n[i+1]<=e?n[i+3]>e&&QP(t,e,n,i)>0&&++r:n[i+3]<=e&&QP(t,e,n[i])<0&&--r;return r}function QP(t,e,n,r){return(n[r+2]-n[r])*(e-n[r+1])-(t-n[r])*(n[r+3]-n[r+1])}function d2(t,e){return t==null||e==null?t!=null||e!=null:t.length!==e.length||t.some((n,r)=>h2(n,e[r]))}function h2(t,e){let n=t.length;if(e.length!==n)return!0;for(let r=0;r<n;++r)if(t[r]!==e[r])return!0;return!1}var fm=class{constructor(e,{channels:n,selection:r,peers:o=!0,brush:i={fill:"none",stroke:"currentColor",strokeDasharray:"1,1"}}){this.mark=e,this.selection=r,this.peers=o,this.style=i&&ea(i),this.brush=l2(),this.brush.on("brush end",c=>this.publish(c.selection)),this.extent=null,this.groups=null;let{fields:s,as:a}=UP(e,n);this.fields=s,this.as=a}reset(){this.value=void 0,this.extent=null,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause([this.fields.map(()=>0)]))}clause(e){let{fields:n,mark:r}=this;return ci(n,e,{source:this,clients:this.peers?r.plot.markSet:new Set().add(r)})}publish(e){let{as:n,group:r,mark:o,svg:i}=this,s;if(e){let{data:{columns:a={}}={}}=o,c=new Map;ZP(i,r,e).forEach(f=>{let u=Vu(f),p=n.map(l=>a[l][u]);c.set(p.join("|"),p)}),s=Array.from(c.values())}this.extent=e,d2(s,this.value)&&(this.value=s,this.selection.update(this.clause(s)))}init(e){let{brush:n,extent:r,mark:o,style:i}=this;this.svg=e;let s=e.width.baseVal.value,a=e.height.baseVal.value;if(n.extent([[0,0],[s,a]]),this.group=e.querySelector(`[data-index="${o.index}"]`),this.g=Nt(e).append("g").attr("class","region-xy").each(u2).call(n).call(n.moveSilent,r),i){let c=this.g.selectAll("rect.selection");for(let f in i)c.attr(f,i[f])}e.addEventListener("pointerenter",c=>{c.buttons||this.activate()})}};var Nc=class{constructor(e,{selection:n,channels:r,peers:o=!0}){this.value=null,this.mark=e,this.selection=n,this.peers=o;let i=this.fields=[],s=this.as=[];r.forEach(a=>{let c=a==="color"?["color","fill","stroke"]:a==="x"?["x","x1","x2"]:a==="y"?["y","y1","y2"]:[a];for(let f=0;f<c.length;++f){let u=e.channelField(c[f],{exact:!0});if(u){i.push(u.field?.basis||u.field),s.push(u.as);return}}throw new Error(`Missing channel: ${a}`)})}clause(e){let{fields:n,mark:r}=this;return ci(n,e,{source:this,clients:this.peers?r.plot.markSet:new Set().add(r)})}init(e,n,r){let{mark:o,as:i,selection:s}=this,{data:{columns:a={}}={}}=o;r??=f=>i.map(u=>a[u][Vu(f)]),n??=`[data-index="${o.index}"]`;let c=Array.from(e.querySelectorAll(n));e.addEventListener("pointerdown",f=>{let u=s.single?s.value:this.value,p=f.target,l=null;if(sK(c,p)){let d=r(p);(f.shiftKey||f.metaKey)&&u?.length?(l=u.filter(h=>h2(h,d)),l.length===u.length&&l.push(d)):u?.length===1&&!h2(u[0],d)?l=null:l=[d]}this.value=l,d2(u,l)&&s.update(this.clause(l))}),e.addEventListener("pointerenter",f=>{f.buttons||this.selection.activate(this.clause([this.fields.map(()=>0)]))})}};function sK(t,e){return t.some(n=>n.contains(e))}var nF=":scope > div, :scope > span",m2="swatch",eF="ramp",Gu=class{constructor(e,n){let{as:r,field:o,...i}=n;this.channel=e,this.options=i,this.type=null,this.handler=null,this.selection=r,this.field=o,this.legend=null,this.element=document.createElement("div"),this.element.setAttribute("class","legend"),Object.defineProperty(this.element,"value",{value:this})}setPlot(e){this.plot=e}init(e){let n=aK(this,e);return this.element.replaceChildren(n),this.element}update(){if(!this.legend)return;let{selection:e,handler:n}=this,{single:r,value:o}=e,i=r?o:e.valueFor(n),s=i&&i.length?new Set(i.map(c=>c[0])):null,a=this.legend.querySelectorAll(nF);for(let c of a){let f=s?s.has(c.__data__):!0;c.style.opacity=f?1:.2}}};function aK(t,e){let{channel:n,plot:r,selection:o}=t,i=e.scale(n),s=i.type==="ordinal"?m2:eF,a={label:r.getAttribute(`${n}Label`)??null,...t.options},c=s===m2?a:a.label?{tickSize:2,...a}:{tickSize:2,marginTop:1,height:29,...a},f=e.legend(n,c);t.legend=f;let u=!!o;if(u&&s===eF){let p=c.width??240,l=lK(i,p);l?f.scale=function(d){return d==="x"?{range:[0,p]}:d==="y"?{range:[-10,0]}:d===n?l:void 0}:u=!1}if(u){let p=cK(t,s);s===m2?(p.init(f,nF,l=>[l.__data__]),t.update()):p.init(f,f.querySelector("g:last-of-type"))}return f}function cK(t,e){let{channel:n,handler:r,selection:o}=t;if(r)return r;let i=fK(t);return e===m2?(t.handler=new Nc(i,{selection:o,channels:[n],peers:!1}),o.addEventListener("value",()=>t.update())):t.handler=new na(i,{selection:o,channel:n,brush:{fill:"none",stroke:"currentColor"},peers:!1}),t.handler}function fK(t){let{channel:e,plot:n}=t,r=t.field??uK(n.marks,e)??"value";if(r){let o={field:r};return{plot:n,channelField:i=>e===i?o:void 0}}}function uK(t,e){let n=e==="color"?["fill","stroke"]:e==="opacity"?["opacity","fillOpacity","strokeOpacity"]:null;if(n==null)return null;for(let r=t.length-1;r>-1;--r)for(let o of n){let i=t[r].channelField(o,{exact:!0});if(i)return i.field}return null}function lK(t,e){let{apply:n,invert:r,interpolate:o,...i}=t,s=t.type;s.startsWith("diverging-")&&(s=s.slice(11));let a;switch(s){case"log":case"pow":case"sqrt":case"symlog":a=s;break;case"threshold":case"quantize":case"quantile":return console.warn(`Legends do not yet support ${s} scales.`),null;default:a="linear"}return Os({x:{...i,type:a,range:[0,e]}})}function x2(t,e,n=0,r=Math.LN10){let o,i=Math.ceil(Math.log(e)/r),s=Math.max(n,Math.pow(10,Math.round(Math.log(t)/r)-i));for(;Math.ceil(t/s)>e;)s*=10;let a=[5,2];for(let c=0,f=a.length;c<f;++c)o=s/a[c],o>=n&&t/o<=e&&(s=o);return s}function rF(t,e,n){let{step:r,steps:o,minstep:i=0,nice:s=!0}=n;if(s!==!1){let a=e-t,c=Math.LN10;r=r||x2(a,o||25,i,c);let f=Math.log(r),u=f>=0?0:~~(-f/c)+1,p=Math.pow(10,-u-1);f=Math.floor(t/r+p)*r,t=t<f?f-r:f,e=Math.ceil(e/r)*r,o=Math.round((e-t)/r)}return{min:t,max:e,steps:o}}var aF="year",oF="month",iF="day",g2="hour",y2="minute",b2="second",pK="millisecond",lm=1e3,pm=lm*60,dm=pm*60,w2=dm*24,dK=w2*7,sF=w2*30,cF=w2*365,um=[[b2,1,lm],[b2,5,5*lm],[b2,15,15*lm],[b2,30,30*lm],[y2,1,pm],[y2,5,5*pm],[y2,15,15*pm],[y2,30,30*pm],[g2,1,dm],[g2,3,3*dm],[g2,6,6*dm],[g2,12,12*dm],[iF,1,w2],[iF,7,dK],[oF,1,sF],[oF,3,3*sF],[aF,1,cF]];function fF(t,e,n){let r=e-t,o=r/n,i=Xr(s=>s[2]).right(um,o);return i===um.length?{interval:aF,step:x2(r/cF,n)}:i?(i=um[o/um[i-1][2]<um[i][2]/o?i-1:i],{interval:i[0],step:i[1]}):{interval:pK,step:x2(r,n,1)}}var hK=new Set(["rectY-x","rectX-y","rect-x","rect-y","ruleY-x","ruleX-y"]);function mK(t,e){return hK.has(`${t.type}-${e}`)}function MM(t,e={}){let n=(r,o)=>mK(r,o)?{[`${o}1`]:_M(r,o,t,e),[`${o}2`]:_M(r,o,t,{...e,offset:1})}:{[o]:_M(r,o,t,e)};return n[rp]=!0,n}function _M(t,e,n,r){return new SM(n,t,e,r)}function xK(t,e){let n=t.plot.getAttribute(`${e}Scale`);return n==="utc"||n==="time"}var SM=class extends vt{constructor(e,n,r,o){super("COLUMN_REF"),this.column=e,this.mark=n,this.channel=r,this.options=o}get stats(){return{column:this.column,stats:["min","max"]}}toString(){let{mark:e,channel:n,column:r,options:o}=this,{type:i,min:s,max:a}=e.channelField(n),{interval:c,steps:f,offset:u=0}=o,p=c??(i==="date"||xK(e,n)?"date":"number"),l;if(p==="number"){let{apply:d,sqlApply:h,sqlInvert:m}=Tc(e,n),x=rF(d(s),d(a),o),g=h(r),y=pe((x.max-x.min)/x.steps),b=ze(Pt(x.min===0?g:pt(g,x.min),y)),w=Rt(x.min,mt(y,u?Rt(u,b):b));l=m(w)}else{let{interval:d,step:h=1}=p==="date"?fF(s,a,f||40):o,m=sv(r,d,h);l=u?Rt(m,Z0(d,u*h)):m}return`${l}`}};var gK=t=>t&&typeof t=="object"&&!Array.isArray(t);var hm=class extends Bn{constructor({element:e,filterBy:n,from:r,column:o,label:i=o,format:s=p=>p,options:a,value:c,field:f=o,as:u}={}){super(n),this.from=r,this.column=o,this.format=s,this.field=f;let p=this.selection=u;this.element=e??document.createElement("div"),this.element.setAttribute("class","input"),Object.defineProperty(this.element,"value",{value:this});let l=document.createElement("label");if(l.innerText=i||o,this.element.appendChild(l),this.select=document.createElement("select"),this.element.appendChild(this.select),a&&(this.data=a.map(d=>gK(d)?d:{value:d}),this.selectedValue(c??""),this.update()),p){let d=!er(p);c!=null&&(!d||p.value===void 0)&&this.publish(c),this.select.addEventListener("input",()=>{this.publish(this.selectedValue()??null)}),d&&this.selection.addEventListener("value",h=>{h!==this.select.value&&this.selectedValue(h)})}}selectedValue(e){if(arguments.length===0){let n=this.select.selectedIndex;return this.data[n].value}else{let n=this.data?.findIndex(r=>r.value===e);n>=0?this.select.selectedIndex=n:this.select.value=String(e)}}reset(){this.select.selectedIndex=this.from?0:-1}publish(e){let{selection:n,field:r}=this;if(er(n)){e===""&&(e=void 0);let o=Aa(r,e,{source:this});n.update(o)}else _e(n)&&n.update(e)}query(e=[]){let{from:n,column:r}=this;return n?st.from(n).select({value:r}).distinct().where(e).orderby(r):null}queryResult(e){return this.data=[{value:"",label:"All"},...e],this}update(){let{data:e,format:n,select:r,selection:o}=this;r.replaceChildren();for(let{value:i,label:s}of e){let a=document.createElement("option");a.setAttribute("value",i),a.innerText=s??n(i),this.select.appendChild(a)}if(o){let i=er(o)?o.valueFor(this):o.value;this.selectedValue(i??"")}return this}};var yK=0;var mm=class extends Bn{constructor({element:e,filterBy:n,from:r,column:o,label:i,type:s="contains",field:a=o,as:c}={}){if(super(n),this.id="search_"+ ++yK,this.type=s,this.from=r,this.column=o,this.selection=c,this.field=a,this.element=e??document.createElement("div"),this.element.setAttribute("class","input"),Object.defineProperty(this.element,"value",{value:this}),i){let f=document.createElement("label");f.setAttribute("for",this.id),f.innerText=i,this.element.appendChild(f)}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)}),er(this.selection)||this.selection.addEventListener("value",f=>{f!==this.searchbox.value&&(this.searchbox.value=f)}))}reset(){this.searchbox.value=""}publish(e){let{selection:n,field:r,type:o}=this;if(er(n)){let i=o_(r,e,{source:this,method:o});n.update(i)}else _e(n)&&n.update(e)}query(e=[]){let{from:n,column:r}=this;return n?st.from(n).select({list:r}).distinct().where(e):null}queryResult(e){return this.data=e,this}update(){let e=document.createElement("datalist"),n=`${this.id}_list`;e.setAttribute("id",n);for(let r of this.data){let o=document.createElement("option");o.setAttribute("value",r.list),e.append(o)}return this.datalist&&this.datalist.remove(),this.element.appendChild(this.datalist=e),this.searchbox.setAttribute("list",n),this}};var bK=0;var xm=class extends Bn{constructor({element:e,filterBy:n,as:r,min:o,max:i,step:s,from:a,column:c,label:f=c,value:u=r?.value,select:p="point",field:l=c,width:d}={}){if(super(n),this.id="slider_"+ ++bK,this.from=a,this.column=c||"value",this.selection=r,this.selectionType=p,this.field=l,this.min=o,this.max=i,this.step=s,this.element=e||document.createElement("div"),this.element.setAttribute("class","input"),Object.defineProperty(this.element,"value",{value:this}),f){let h=document.createElement("label");h.setAttribute("for",this.id),h.innerText=f,this.element.appendChild(h)}this.slider=document.createElement("input"),this.slider.setAttribute("id",this.id),this.slider.setAttribute("type","range"),d!=null&&(this.slider.style.width=`${+d}px`),o!=null&&this.slider.setAttribute("min",`${o}`),i!=null&&this.slider.setAttribute("max",`${i}`),s!=null&&this.slider.setAttribute("step",`${s}`),this.element.appendChild(this.slider),this.curval=document.createElement("label"),this.curval.setAttribute("for",this.id),this.curval.setAttribute("class","value"),this.element.appendChild(this.curval),u!=null&&(this.slider.setAttribute("value",`${u}`),this.selection?.value===void 0&&this.publish(u)),this.curval.innerText=this.slider.value,this.slider.addEventListener("input",()=>{let{value:h}=this.slider;this.curval.innerText=h,this.selection&&this.publish(+h)}),this.selection&&!er(this.selection)&&this.selection.addEventListener("value",h=>{h!==+this.slider.value&&(this.slider.value=h,this.curval.innerText=h)})}query(e=[]){let{from:n,column:r}=this;return!n||this.min!=null&&this.max!=null?null:st.select({min:jn(r),max:Ke(r)}).from(n).where(e)}queryResult(e){let{min:n,max:r}=Array.from(e)[0];return this.min==null&&(this.min=n,this.slider.setAttribute("min",`${n}`)),this.max==null&&(this.max=r,this.slider.setAttribute("max",`${r}`)),this.step==null&&(this.step=(r-n)/500,this.slider.setAttribute("step",`${this.step}`)),this}publish(e){let{field:n,selectionType:r,selection:o}=this;if(er(o))if(r==="interval"){let i=[this.min??0,e];o.update(Ta(n,i,{source:this,bin:"ceil",scale:{type:"identity",domain:i},pixelSize:this.step}))}else o.update(Aa(n,e,{source:this}));else _e(this.selection)&&o.update(e)}};var TM=uF(t=>{let e=v2(t);return n=>n==null?"":typeof n=="number"?e(n):n instanceof Date?EM(n):`${n}`}),v2=uF(t=>e=>e===0?"0":e.toLocaleString(t)),gUt=TM(),yUt=v2();function EM(t){return Kf(t,"Invalid Date")}function uF(t){let e=null,n;return(r="en")=>r===e?n:n=t(e=r)}var wK=-1;var gm=class extends Bn{constructor({element:e,filterBy:n,from:r,columns:o=["*"],align:i={},format:s,width:a,maxWidth:c,height:f=500,rowBatch:u=100,as:p}={}){super(n),this.id=`table-${++wK}`,this.from=r,this.columns=o,this.format=s,this.align=i,this.widths=typeof a=="object"?a:{},_e(r)&&r.addEventListener("value",()=>this.initialize()),this.offset=0,this.limit=+u,this.pending=!1,this.selection=p,this.currentRow=-1,this.sortHeader=null,this.sortColumn=null,this.sortDesc=!1,this.element=e||document.createElement("div"),this.element.setAttribute("id",this.id),Object.defineProperty(this.element,"value",{value:this}),typeof a=="number"&&(this.element.style.width=`${a}px`),c&&(this.element.style.maxWidth=`${c}px`),this.element.style.maxHeight=`${f}px`,this.element.style.overflow="auto";let l=-1;this.element.addEventListener("scroll",d=>{let{pending:h,loaded:m}=this,{scrollHeight:x,scrollTop:g,clientHeight:y}=d.target,b=g<l;l=g,!(b||h||m)&&x-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.selection&&(this.body.addEventListener("pointerover",d=>{let h=vK(d.target);h>-1&&h!==this.currentRow&&(this.currentRow=h,this.selection.update(this.clause([h])))}),this.body.addEventListener("pointerleave",()=>{this.currentRow=-1,this.selection.update(this.clause())})),this.style=document.createElement("style"),this.element.appendChild(this.style)}sourceTable(){return _e(this.from)?this.from.value:this.from}clause(e=[]){let{data:n,limit:r,schema:o}=this,i=o.map(a=>a.column),s=e.map(a=>{let{columns:c}=n[~~(a/r)];return i.map(f=>c[f][a%r])});return ci(i,s,{source:this})}requestData(e=0){this.offset=e;let n=this.query(this.filterBy?.predicate(this));this.requestQuery(n),Sr().prefetch(n.clone().offset(e+this.limit))}fields(){let e=this.sourceTable();return this.columns.map(n=>oi(n,e))}fieldInfo(e){this.schema=e;let n=this.head;n.innerHTML="";let r=document.createElement("tr");for(let{column:o}of e){let i=document.createElement("th");i.addEventListener("click",s=>this.sort(s,o)),i.appendChild(document.createElement("span")),i.appendChild(document.createTextNode(o)),r.appendChild(i)}return n.appendChild(r),this.formats=_K(this.format,e),this.style.innerText=AK(this.id,SK(this.align,e),MK(this.widths,e)),this}query(e=[]){let{limit:n,offset:r,schema:o,sortColumn:i,sortDesc:s}=this;return st.from(this.sourceTable()).select(o.map(a=>a.column)).where(e).orderby(i?s?wv(i):i:[]).limit(n).offset(r)}queryResult(e){return this.pending||(this.loaded=!1,this.data=[],this.body.replaceChildren(),this.offset=0),this.data.push(Wn(e)),this}update(){let{body:e,formats:n,data:r,schema:o,limit:i}=this,s=o.length,a=r.length-1,c=i*a,{numRows:f,columns:u}=r[a],p=o.map(l=>u[l.column]);for(let l=0;l<f;++l){let d=document.createElement("tr");Object.assign(d,{__row__:c+l});for(let h=0;h<s;++h){let m=p[h][l],x=document.createElement("td");x.innerText=m==null?"":n[h](m),d.appendChild(x)}e.appendChild(d)}return f<i&&(this.loaded=!0),this.pending=!1,this}sort(e,n){n===this.sortColumn?this.sortDesc=!this.sortDesc:(this.sortColumn=n,this.sortDesc=!1);let r=e.currentTarget,o=this.sortHeader;o===r&&e.metaKey?(o.firstChild.textContent="",this.sortHeader=null,this.sortColumn=null):(o&&(o.firstChild.textContent=""),this.sortHeader=r,r.firstChild.textContent=this.sortDesc?"\u25BE":"\u25B4"),this.requestData()}};function vK(t){let e=t.parentElement;return Object.hasOwn(e,"__row__")?+e.__row__:-1}function _K(t={},e,n){return e.map(({column:r,type:o})=>{if(r in t)return t[r];switch(o){case"number":return v2(n);case"date":return EM;default:return TM(n)}})}function SK(t={},e){return e.map(({column:n,type:r})=>n in t?t[n]:r==="number"?"right":"left")}function MK(t={},e){return e.map(({column:n})=>t[n])}function AK(t,e,n){let r=[];return e.forEach((o,i)=>{let s=+n[i];if(o!=="left"||s){let a=o!=="left"?`text-align:${o};`:"",c=s?`width:${s}px;max-width:${s}px;`:"";r.push(`#${t} tr>:nth-child(${i+1}) {${a}${c}}`)}}),r.join(" ")}function ym(t,...e){let n=t?.context?.coordinator??Sr();for(let r of e)n.connect(r)}function _2(t,e,n){let r=new e(n);return ym(t,r),r.element}function lF(t){return _2(this,hm,t)}function pF(t){return _2(this,mm,t)}function dF(t){return _2(this,xm,t)}function hF(t){return _2(this,gm,t)}function mF({direction:t="vertical",wrap:e=!1},n){let r=document.createElement("div");return r.style.display="flex",r.style.flexDirection=t==="vertical"?"column":"row",r.style.flexWrap=e?e===!0?"wrap":e:"nowrap",r.style.justifyContent="flex-start",r.style.alignItems="flex-start",n.forEach(o=>r.appendChild(o)),Object.assign(r,{value:{element:r}}),r}function xF(...t){return mF({direction:"vertical"},t.flat())}function gF(...t){return mF({direction:"horizontal"},t.flat())}function yF({dim:t="width",size:e=10}){let n=document.createElement("span");return n.style.display="inline-block",n.style[t]=Number.isNaN(+e)?e:`${e}px`,Object.assign(n,{value:{element:n}})}function bF(t){return yF({dim:"height",size:t})}function wF(t){return yF({dim:"width",size:t})}var S2={};Pc(S2,{align:()=>YM,ariaDescription:()=>QM,ariaLabel:()=>HM,aspectRatio:()=>UM,axis:()=>jM,clip:()=>VM,colorBase:()=>R8,colorClamp:()=>v8,colorConstant:()=>$8,colorDomain:()=>b8,colorExponent:()=>O8,colorInterpolate:()=>A8,colorLabel:()=>I8,colorN:()=>_8,colorNice:()=>S8,colorPercent:()=>N8,colorPivot:()=>T8,colorRange:()=>w8,colorReverse:()=>C8,colorScale:()=>y8,colorScheme:()=>M8,colorSymmetric:()=>E8,colorTickFormat:()=>L8,colorZero:()=>k8,facetGrid:()=>yA,facetLabel:()=>bA,facetMargin:()=>dA,facetMarginBottom:()=>mA,facetMarginLeft:()=>xA,facetMarginRight:()=>gA,facetMarginTop:()=>hA,fxAlign:()=>TA,fxAriaDescription:()=>jA,fxAriaLabel:()=>UA,fxAxis:()=>CA,fxDomain:()=>wA,fxFontVariant:()=>YA,fxGrid:()=>PA,fxInset:()=>_A,fxInsetLeft:()=>SA,fxInsetRight:()=>MA,fxLabel:()=>qA,fxLabelAnchor:()=>BA,fxLabelOffset:()=>zA,fxLine:()=>FA,fxPadding:()=>EA,fxPaddingInner:()=>IA,fxPaddingOuter:()=>NA,fxRange:()=>vA,fxReverse:()=>XA,fxRound:()=>AA,fxTickFormat:()=>$A,fxTickPadding:()=>OA,fxTickRotate:()=>DA,fxTickSize:()=>LA,fxTickSpacing:()=>RA,fxTicks:()=>kA,fyAlign:()=>JA,fyAriaDescription:()=>x8,fyAriaLabel:()=>m8,fyAxis:()=>n8,fyDomain:()=>WA,fyFontVariant:()=>h8,fyGrid:()=>f8,fyInset:()=>GA,fyInsetBottom:()=>QA,fyInsetTop:()=>HA,fyLabel:()=>l8,fyLabelAnchor:()=>p8,fyLabelOffset:()=>d8,fyLine:()=>u8,fyPadding:()=>KA,fyPaddingInner:()=>t8,fyPaddingOuter:()=>e8,fyRange:()=>VA,fyReverse:()=>g8,fyRound:()=>ZA,fyTickFormat:()=>a8,fyTickPadding:()=>s8,fyTickRotate:()=>c8,fyTickSize:()=>o8,fyTickSpacing:()=>i8,fyTicks:()=>r8,grid:()=>WM,height:()=>PM,inset:()=>XM,lengthBase:()=>xT,lengthClamp:()=>pT,lengthConstant:()=>yT,lengthDomain:()=>uT,lengthExponent:()=>gT,lengthNice:()=>dT,lengthPercent:()=>hT,lengthRange:()=>lT,lengthScale:()=>fT,lengthZero:()=>mT,margin:()=>RM,marginBottom:()=>zM,marginLeft:()=>FM,marginRight:()=>qM,marginTop:()=>BM,margins:()=>LM,name:()=>CM,opacityBase:()=>W8,opacityClamp:()=>q8,opacityConstant:()=>G8,opacityDomain:()=>P8,opacityExponent:()=>V8,opacityLabel:()=>z8,opacityNice:()=>B8,opacityPercent:()=>Y8,opacityRange:()=>F8,opacityReverse:()=>U8,opacityScale:()=>D8,opacityTickFormat:()=>X8,opacityZero:()=>j8,padding:()=>GM,projectionClip:()=>NT,projectionDomain:()=>ST,projectionInset:()=>MT,projectionInsetBottom:()=>IT,projectionInsetLeft:()=>AT,projectionInsetRight:()=>TT,projectionInsetTop:()=>ET,projectionParallels:()=>wT,projectionPrecision:()=>vT,projectionRotate:()=>_T,projectionType:()=>bT,rBase:()=>sT,rClamp:()=>eT,rConstant:()=>cT,rDomain:()=>K8,rExponent:()=>aT,rLabel:()=>rT,rNice:()=>nT,rPercent:()=>oT,rRange:()=>tT,rScale:()=>J8,rZero:()=>iT,style:()=>$M,symbolDomain:()=>Q8,symbolRange:()=>Z8,symbolScale:()=>H8,width:()=>DM,xAlign:()=>s5,xAriaDescription:()=>A5,xAriaLabel:()=>M5,xAxis:()=>u5,xBase:()=>N5,xClamp:()=>o5,xConstant:()=>k5,xDomain:()=>JM,xExponent:()=>C5,xFontVariant:()=>S5,xGrid:()=>g5,xInset:()=>e5,xInsetLeft:()=>n5,xInsetRight:()=>r5,xLabel:()=>b5,xLabelAnchor:()=>w5,xLabelArrow:()=>v5,xLabelOffset:()=>_5,xLine:()=>y5,xNice:()=>t5,xPadding:()=>a5,xPaddingInner:()=>c5,xPaddingOuter:()=>f5,xPercent:()=>T5,xRange:()=>KM,xReverse:()=>E5,xRound:()=>i5,xScale:()=>ZM,xTickFormat:()=>m5,xTickPadding:()=>h5,xTickRotate:()=>x5,xTickSize:()=>p5,xTickSpacing:()=>d5,xTicks:()=>l5,xZero:()=>I5,xyDomain:()=>OM,yAlign:()=>z5,yAriaDescription:()=>sA,yAriaLabel:()=>iA,yAxis:()=>X5,yBase:()=>uA,yClamp:()=>q5,yConstant:()=>pA,yDomain:()=>R5,yExponent:()=>lA,yFontVariant:()=>oA,yGrid:()=>J5,yInset:()=>D5,yInsetBottom:()=>F5,yInsetTop:()=>P5,yLabel:()=>tA,yLabelAnchor:()=>eA,yLabelArrow:()=>nA,yLabelOffset:()=>rA,yLine:()=>K5,yNice:()=>$5,yPadding:()=>Y5,yPaddingInner:()=>U5,yPaddingOuter:()=>j5,yPercent:()=>aA,yRange:()=>O5,yReverse:()=>cA,yRound:()=>B5,yScale:()=>L5,yTickFormat:()=>Q5,yTickPadding:()=>H5,yTickRotate:()=>Z5,yTickSize:()=>V5,yTickSpacing:()=>G5,yTicks:()=>W5,yZero:()=>fA});var bm=class extends Map{request(e,n){if(this.has(e))n(this.get(e));else{let r=this.waiting||(this.waiting=new Map),o=r.get(e)||[];r.set(e,o.concat(n))}}set(e,n){this.has(e)&&console.warn(`Overwriting named plot "${e}".`);let{waiting:r}=this;return r?.has(e)&&(r.get(e).forEach(o=>o(n)),r.delete(e)),super.set(e,n)}clear(){return this.waiting?.clear(),super.clear()}},IM=new bm;function NM(t,e,n){(t?.context?.namedPlots??IM).request(e,n)}function vF(t,e,n){(t?.context?.namedPlots??IM).set(e,n)}function CM(t){return e=>vF(this,t,e)}function _F(t,e,n){_e(n)?(n.addEventListener("value",r=>{t.setAttribute(e,r),t.update()}),n.value!==void 0&&t.setAttribute(e,n.value)):t.setAttribute(e,n)}function TK(t,e){return n=>{_F(n,t,e)}}function kM(t){return e=>{for(let[n,r]of Object.entries(t))_F(e,n,r)}}function LM(t){let{top:e,bottom:n,left:r,right:o}=t,i={};return e!==void 0&&(i.marginTop=e),n!==void 0&&(i.marginBottom=n),r!==void 0&&(i.marginLeft=r),o!==void 0&&(i.marginRight=o),kM(i)}function RM(t){return kM({marginTop:t,marginBottom:t,marginLeft:t,marginRight:t})}function OM(t){return kM({xDomain:t,yDomain:t})}var R=t=>e=>TK(t,e),$M=R("style"),DM=R("width"),PM=R("height"),FM=R("marginLeft"),qM=R("marginRight"),BM=R("marginTop"),zM=R("marginBottom"),YM=R("align"),UM=R("aspectRatio"),jM=R("axis"),XM=R("inset"),WM=R("grid"),VM=R("clip"),GM=R("padding"),HM=R("ariaLabel"),QM=R("ariaDescription"),ZM=R("xScale"),JM=R("xDomain"),KM=R("xRange"),t5=R("xNice"),e5=R("xInset"),n5=R("xInsetLeft"),r5=R("xInsetRight"),o5=R("xClamp"),i5=R("xRound"),s5=R("xAlign"),a5=R("xPadding"),c5=R("xPaddingInner"),f5=R("xPaddingOuter"),u5=R("xAxis"),l5=R("xTicks"),p5=R("xTickSize"),d5=R("xTickSpacing"),h5=R("xTickPadding"),m5=R("xTickFormat"),x5=R("xTickRotate"),g5=R("xGrid"),y5=R("xLine"),b5=R("xLabel"),w5=R("xLabelAnchor"),v5=R("xLabelArrow"),_5=R("xLabelOffset"),S5=R("xFontVariant"),M5=R("xAriaLabel"),A5=R("xAriaDescription"),T5=R("xPercent"),E5=R("xReverse"),I5=R("xZero"),N5=R("xBase"),C5=R("xExponent"),k5=R("xConstant"),L5=R("yScale"),R5=R("yDomain"),O5=R("yRange"),$5=R("yNice"),D5=R("yInset"),P5=R("yInsetTop"),F5=R("yInsetBottom"),q5=R("yClamp"),B5=R("yRound"),z5=R("yAlign"),Y5=R("yPadding"),U5=R("yPaddingInner"),j5=R("yPaddingOuter"),X5=R("yAxis"),W5=R("yTicks"),V5=R("yTickSize"),G5=R("yTickSpacing"),H5=R("yTickPadding"),Q5=R("yTickFormat"),Z5=R("yTickRotate"),J5=R("yGrid"),K5=R("yLine"),tA=R("yLabel"),eA=R("yLabelAnchor"),nA=R("yLabelArrow"),rA=R("yLabelOffset"),oA=R("yFontVariant"),iA=R("yAriaLabel"),sA=R("yAriaDescription"),aA=R("yPercent"),cA=R("yReverse"),fA=R("yZero"),uA=R("yBase"),lA=R("yExponent"),pA=R("yConstant"),dA=R("facetMargin"),hA=R("facetMarginTop"),mA=R("facetMarginBottom"),xA=R("facetMarginLeft"),gA=R("facetMarginRight"),yA=R("facetGrid"),bA=R("facetLabel"),wA=R("fxDomain"),vA=R("fxRange"),_A=R("fxInset"),SA=R("fxInsetLeft"),MA=R("fxInsetRight"),AA=R("fxRound"),TA=R("fxAlign"),EA=R("fxPadding"),IA=R("fxPaddingInner"),NA=R("fxPaddingOuter"),CA=R("fxAxis"),kA=R("fxTicks"),LA=R("fxTickSize"),RA=R("fxTickSpacing"),OA=R("fxTickPadding"),$A=R("fxTickFormat"),DA=R("fxTickRotate"),PA=R("fxGrid"),FA=R("fxLine"),qA=R("fxLabel"),BA=R("fxLabelAnchor"),zA=R("fxLabelOffset"),YA=R("fxFontVariant"),UA=R("fxAriaLabel"),jA=R("fxAriaDescription"),XA=R("fxReverse"),WA=R("fyDomain"),VA=R("fyRange"),GA=R("fyInset"),HA=R("fyInsetTop"),QA=R("fyInsetBottom"),ZA=R("fyRound"),JA=R("fyAlign"),KA=R("fyPadding"),t8=R("fyPaddingInner"),e8=R("fyPaddingOuter"),n8=R("fyAxis"),r8=R("fyTicks"),o8=R("fyTickSize"),i8=R("fyTickSpacing"),s8=R("fyTickPadding"),a8=R("fyTickFormat"),c8=R("fyTickRotate"),f8=R("fyGrid"),u8=R("fyLine"),l8=R("fyLabel"),p8=R("fyLabelAnchor"),d8=R("fyLabelOffset"),h8=R("fyFontVariant"),m8=R("fyAriaLabel"),x8=R("fyAriaDescription"),g8=R("fyReverse"),y8=R("colorScale"),b8=R("colorDomain"),w8=R("colorRange"),v8=R("colorClamp"),_8=R("colorN"),S8=R("colorNice"),M8=R("colorScheme"),A8=R("colorInterpolate"),T8=R("colorPivot"),E8=R("colorSymmetric"),I8=R("colorLabel"),N8=R("colorPercent"),C8=R("colorReverse"),k8=R("colorZero"),L8=R("colorTickFormat"),R8=R("colorBase"),O8=R("colorExponent"),$8=R("colorConstant"),D8=R("opacityScale"),P8=R("opacityDomain"),F8=R("opacityRange"),q8=R("opacityClamp"),B8=R("opacityNice"),z8=R("opacityLabel"),Y8=R("opacityPercent"),U8=R("opacityReverse"),j8=R("opacityZero"),X8=R("opacityTickFormat"),W8=R("opacityBase"),V8=R("opacityExponent"),G8=R("opacityConstant"),H8=R("symbolScale"),Q8=R("symbolDomain"),Z8=R("symbolRange"),J8=R("rScale"),K8=R("rDomain"),tT=R("rRange"),eT=R("rClamp"),nT=R("rNice"),rT=R("rLabel"),oT=R("rPercent"),iT=R("rZero"),sT=R("rBase"),aT=R("rExponent"),cT=R("rConstant"),fT=R("lengthScale"),uT=R("lengthDomain"),lT=R("lengthRange"),pT=R("lengthClamp"),dT=R("lengthNice"),hT=R("lengthPercent"),mT=R("lengthZero"),xT=R("lengthBase"),gT=R("lengthExponent"),yT=R("lengthConstant"),bT=R("projectionType"),wT=R("projectionParallels"),vT=R("projectionPrecision"),_T=R("projectionRotate"),ST=R("projectionDomain"),MT=R("projectionInset"),AT=R("projectionInsetLeft"),TT=R("projectionInsetRight"),ET=R("projectionInsetTop"),IT=R("projectionInsetBottom"),NT=R("projectionClip");function SF(t,e){return{table:t,options:e}}var A2={};Pc(A2,{area:()=>CT,areaX:()=>kT,areaY:()=>LT,arrow:()=>AE,axisFx:()=>CE,axisFy:()=>kE,axisX:()=>IE,axisY:()=>NE,barX:()=>DT,barY:()=>PT,cell:()=>FT,cellX:()=>qT,cellY:()=>BT,circle:()=>VT,contour:()=>lE,delaunayLink:()=>_E,delaunayMesh:()=>SE,denseLine:()=>uE,density:()=>fE,densityX:()=>aE,densityY:()=>cE,dot:()=>jT,dotX:()=>XT,dotY:()=>WT,errorbarX:()=>yE,errorbarY:()=>bE,frame:()=>EE,geo:()=>DE,graticule:()=>FE,gridFx:()=>OE,gridFy:()=>$E,gridX:()=>LE,gridY:()=>RE,heatmap:()=>pE,hexagon:()=>GT,hexbin:()=>mE,hexgrid:()=>xE,hull:()=>ME,image:()=>sE,line:()=>RT,lineX:()=>OT,lineY:()=>$T,link:()=>TE,raster:()=>dE,rasterTile:()=>hE,rect:()=>zT,rectX:()=>YT,rectY:()=>UT,regressionY:()=>gE,ruleX:()=>JT,ruleY:()=>KT,sphere:()=>PE,spike:()=>iE,text:()=>HT,textX:()=>QT,textY:()=>ZT,tickX:()=>tE,tickY:()=>eE,vector:()=>nE,vectorX:()=>rE,vectorY:()=>oE,voronoi:()=>wE,voronoiMesh:()=>vE});var EK=new Set(["frame","axisX","axisY","axisFx","axisFy","gridX","gridY","gridFx","gridFy","hexgrid","graticule","sphere"]);function ht(t,e,n={}){arguments.length===2&&!Array.isArray(e)&&(n=e,e=EK.has(t)?null:[{}]);let r=t.startsWith("area")||t.startsWith("line")?Wh:$e;return M2(r,t,e,n)}function M2(t,e,n,r){return o=>{o.addMark(new t(e,n,r))}}function Qo(t,e,n){return r=>{r.addMark(new t(e,n))}}var CT=(...t)=>ht("area",...t),kT=(...t)=>ht("areaX",...t),LT=(...t)=>ht("areaY",...t),RT=(...t)=>ht("line",...t),OT=(...t)=>ht("lineX",...t),$T=(...t)=>ht("lineY",...t),DT=(...t)=>ht("barX",...t),PT=(...t)=>ht("barY",...t),FT=(...t)=>ht("cell",...t),qT=(...t)=>ht("cellX",...t),BT=(...t)=>ht("cellY",...t),zT=(...t)=>ht("rect",...t),YT=(...t)=>ht("rectX",...t),UT=(...t)=>ht("rectY",...t),jT=(...t)=>ht("dot",...t),XT=(...t)=>ht("dotX",...t),WT=(...t)=>ht("dotY",...t),VT=(...t)=>ht("circle",...t),GT=(...t)=>ht("hexagon",...t),HT=(...t)=>ht("text",...t),QT=(...t)=>ht("textX",...t),ZT=(...t)=>ht("textY",...t),JT=(...t)=>ht("ruleX",...t),KT=(...t)=>ht("ruleY",...t),tE=(...t)=>ht("tickX",...t),eE=(...t)=>ht("tickY",...t),nE=(...t)=>ht("vector",...t),rE=(...t)=>ht("vectoX",...t),oE=(...t)=>ht("vectorY",...t),iE=(...t)=>ht("spike",...t),sE=(...t)=>ht("image",...t),aE=(...t)=>M2(ju,"areaX",...t),cE=(...t)=>M2(ju,"areaY",...t),fE=(...t)=>Qo(Kh,...t),uE=(...t)=>Qo(Jh,...t),lE=(...t)=>Qo(Hh,...t),pE=(...t)=>Qo(Zh,...t),dE=(...t)=>Qo(ta,...t),hE=(...t)=>Qo(nm,...t),mE=(...t)=>Qo(em,...t),xE=(...t)=>ht("hexgrid",...t),gE=(...t)=>Qo(rm,...t),yE=(...t)=>M2(Wu,"ruleY",...t),bE=(...t)=>Qo(Wu,"ruleX",...t),wE=(...t)=>ht("voronoi",...t),vE=(...t)=>ht("voronoiMesh",...t),_E=(...t)=>ht("delaunayLink",...t),SE=(...t)=>ht("delaunayMesh",...t),ME=(...t)=>ht("hull",...t),AE=(...t)=>ht("arrow",...t),TE=(...t)=>ht("link",...t),EE=(...t)=>ht("frame",...t),IE=(...t)=>ht("axisX",...t),NE=(...t)=>ht("axisY",...t),CE=(...t)=>ht("axisFx",...t),kE=(...t)=>ht("axisFy",...t),LE=(...t)=>ht("gridX",...t),RE=(...t)=>ht("gridY",...t),OE=(...t)=>ht("gridFx",...t),$E=(...t)=>ht("gridFy",...t),DE=(...t)=>Qo(tm,...t),PE=(...t)=>ht("sphere",...t),FE=(...t)=>ht("graticule",...t);var T2={};Pc(T2,{highlight:()=>qE,intervalX:()=>BE,intervalXY:()=>YE,intervalY:()=>zE,nearest:()=>UE,nearestX:()=>jE,nearestY:()=>XE,pan:()=>ZE,panX:()=>JE,panY:()=>KE,panZoom:()=>t7,panZoomX:()=>e7,panZoomY:()=>n7,region:()=>WE,toggle:()=>Cc,toggleColor:()=>QE,toggleX:()=>VE,toggleY:()=>GE,toggleZ:()=>HE});function Zo(t,e){return n=>{let r=n.marks[n.marks.length-1];n.addInteractor(new t(r,e))}}function qE({by:t,...e}){return Zo(om,{selection:t,channels:e})}function BE({as:t,...e}){return Zo(na,{...e,selection:t,channel:"x"})}function zE({as:t,...e}){return Zo(na,{...e,selection:t,channel:"y"})}function YE({as:t,...e}){return Zo(am,{...e,selection:t})}function UE({as:t,...e}){return Zo(Ec,{...e,selection:t,pointer:"xy"})}function jE({as:t,...e}){return Zo(Ec,{...e,selection:t,pointer:"x"})}function XE({as:t,...e}){return Zo(Ec,{...e,selection:t,pointer:"y"})}function WE({as:t,...e}){return Zo(fm,{...e,selection:t})}function Cc({as:t,...e}){return Zo(Nc,{...e,selection:t})}function VE(t){return Cc({...t,channels:["x"]})}function GE(t){return Cc({...t,channels:["y"]})}function HE(t){return Cc({...t,channels:["z"]})}function QE(t){return Cc({...t,channels:["color"]})}function Hu(t){return Zo(cm,t)}function ZE(t={}){return Hu({...t,zoom:!1})}function JE(t={}){return Hu({...t,zoom:!1,pany:!1})}function KE(t={}){return Hu({...t,zoom:!1,panx:!1})}function t7(t={}){return Hu(t)}function e7(t={}){return Hu({...t,pany:!1})}function n7(t={}){return Hu({...t,panx:!1})}var E2={};Pc(E2,{colorLegend:()=>o7,opacityLegend:()=>i7,symbolLegend:()=>s7});function r7(t,e={}){if(e.for){let{for:n,...r}=e,o=new Gu(t,r),i=typeof n,s=a=>a.addLegend(o,!1);return i==="string"?NM(this,n,s):n.value&&s(n.value),o.element}else return n=>n.addLegend(new Gu(t,e))}function o7(t){return r7.call(this,"color",t)}function i7(t){return r7.call(this,"opacity",t)}function s7(t){return r7.call(this,"symbol",t)}function MF(...t){let e=new jh;return t.flat().forEach(n=>n(e)),ym(this,...e.marks),e.update(),e.element}function c7({coordinator:t=Sr(),namedPlots:e=new bm,extensions:n=null,...r}={}){return{...a7,...n,context:{coordinator:t,namedPlots:e,...r}}}var AF="spec",I2="literal",bjt="dataref",TF="options",EF="selection",IF="paramref",NF="columnparamref",CF="param",kF="include",f7="select",N2="value",LF="crossfilter",C2="intersect",RF="union",OF="single",$F="data",DF="expression",kc="sql",wm="input",Qu="hconcat",Zu="vconcat",Ju="hspace",Ku="vspace",k2="mark",u7="from",tl="plot",vm="legend",PF="attribute",l7="transform",FF="interactor",_m="Fixed";var gt=class{constructor(e,n=null){this.type=e,this.children=n}instantiate(e){throw Error("instantiate not implemented")}codegen(e){return Error("codegen not implemented")}toJSON(){return Error("toJSON not implemented")}};var Sm=class extends gt{constructor(e,n,r,o,i,s){super(AF,[e]),this.root=e,this.meta=n,this.config=r,this.data=o,this.params=i,this.plotDefaults=s}toJSON(){let{root:e,meta:n,config:r,plotDefaults:o}=this,i=new Map(Object.entries(this.data)),s=new Map(Object.entries(this.params)),a={};if(n&&(a.meta={...n}),r&&(a.config={...r}),i?.size){let c=a.data={};for(let[f,u]of i)c[f]=u.toJSON()}if(s?.size){let c=a.params={};for(let[f,u]of s)c[f]=u.toJSON()}if(o?.length){let c=a.plotDefaults={};for(let f of o)Object.assign(c,f.toJSON())}return Object.assign(a,e.toJSON())}};function Mm(t){let e=typeof t;return e==="object"?t?.param:e==="string"?IK(t):null}function IK(t){return t?.[0]==="$"?t.slice(1):null}function Am(t){return`$${t}`}function el(t){return[t].flat()}function Fr(t){return Array.isArray(t)}function nl(t){return t!==null&&typeof t=="object"&&!Fr(t)}function ra(t){return typeof t=="string"}function rl(t,e){throw Object.assign(Error(t),{data:e})}var NK=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function qF(t,e){return NK.test(t+="")?new Date(t):e}function Ze(t,e){let n={};for(let r in t)n[r]=e.maybeSelection(t[r]);return new oa(n)}var oa=class t extends gt{constructor(e){super(TF),this.options=e}filter(e){let n=Object.fromEntries(Object.entries(this.options).filter(([r,o])=>e(r,o)));return new t(n)}instantiate(e){let{options:n}=this,r={};for(let o in n)r[o]=n[o].instantiate(e);return r}codegen(e){let{options:n}=this,r=[];for(let o in n)r.push(`${o}: ${n[o].codegen(e)}`);return r.length?`{${e.maybeLineWrap(r)}}`:""}toJSON(){let{options:e}=this,n={};for(let r in e)n[r]=e[r].toJSON();return n}};var YF="table",UF="parquet",jF="csv",p7="json",q2="spatial",BF=new Map([[YF,RK],[UF,OK],[jF,$K],[p7,DK],[q2,PK]]);function XF(t,e,n){let r=CK(e);if(BF.has(r.type))return BF.get(r.type)(t,r,n);n.error("Unrecognized data format type.",e)}function CK(t){return Fr(t)&&(t={type:"json",data:t}),ra(t)&&(t={type:"table",query:t}),{...t,type:kK(t)}}function kK(t){return t.type||LK(t.file)||"table"}function LK(t){let e=t?.lastIndexOf(".");return e>0?t.slice(e+1):null}function RK(t,e,n){let{query:r,type:o,...i}=e;return new R2(t,r,Ze(i,n))}function OK(t,e,n){let{file:r,type:o,...i}=e;return new $2(t,r,Ze(i,n))}function $K(t,e,n){let{file:r,type:o,...i}=e;return new D2(t,r,Ze(i,n))}function DK(t,e,n){let{data:r,file:o,type:i,...s}=e,a=Ze(s,n);return r?new F2(t,r,a):new P2(t,o,a)}function PK(t,e,n){let{file:r,type:o,...i}=e;return new O2(t,r,Ze(i,n))}function zF(t,e){return e?new URL(t,e).toString():t}function FK(t,e){let n=t?.codegen(e);return n?`, ${n}`:""}var L2=class extends gt{constructor(e,n){super($F),this.name=e,this.format=n}},ol=class extends L2{constructor(e,n){super(e,n)}instantiateQuery(e){e.error("instantiateQuery not implemented")}codegenQuery(e){e.error("codegenQuery not implemented")}instantiate(e){let n=this.instantiateQuery(e);if(n)return n}codegen(e){let n=this.codegenQuery(e);if(n)return n}},R2=class extends ol{constructor(e,n,r){super(e,YF),this.query=n?.trim(),this.options=r}instantiateQuery(e){let{name:n,query:r,options:o}=this;if(r)return e.api.createTable(n,r,o.instantiate(e))}codegenQuery(e){let{name:n,query:r,options:o}=this;if(r)return`\`${co(n,r,o.instantiate(e))}\``}toJSON(){let{format:e,query:n,options:r}=this;return{type:e,query:n,...r.toJSON()}}},Lc=class extends ol{constructor(e,n,r,o,i){super(e,n),this.file=o,this.method=r,this.options=i}instantiateQuery(e){let{name:n,method:r,file:o,options:i}=this,s=zF(o,e.baseURL),a=i?.instantiate(e);return e.api[r](n,s,a)}codegenQuery(e){let{name:n,method:r,file:o,options:i}=this,s=zF(o,e.baseURL),a=FK(i,e);return`${e.ns()}${r}("${n}", "${s}"${a})`}toJSON(){let{format:e,file:n,options:r}=this;return{type:e,file:n,...r.toJSON()}}},O2=class extends Lc{constructor(e,n,r){super(e,q2,"loadSpatial",n,r)}},$2=class extends Lc{constructor(e,n,r){super(e,UF,"loadParquet",n,r)}},D2=class extends Lc{constructor(e,n,r){super(e,jF,"loadCSV",n,r)}},P2=class extends Lc{constructor(e,n,r){super(e,p7,"loadJSON",n,r)}},F2=class extends ol{constructor(e,n,r){super(e,p7),this.data=n,this.options=r}instantiateQuery(e){let{name:n,data:r,options:o}=this;return e.api.loadObjects(n,r,o.instantiate(e))}codegenQuery(e){let{name:n,data:r,options:o}=this,i=o?","+o.codegen(e):"",s=`[
70
61
  `+r.map(a=>JSON.stringify(a)).join(`,
71
62
  `)+`
72
- ]`;return`${t.ns()}loadObjects("${n}", ${s}${o})`}toJSON(){let{format:t,data:n,options:r}=this;return{type:t,data:n,...r.toJSON()}}};function $v(e){let t=e.config?.extensions,n=new Set(t?Nv(t):[]);for(let r of Object.values(e.data))r.format===Fv&&n.add("spatial");return n}async function vit(e,t){let{data:n,params:r,plotDefaults:i}=e,o=new Pv({plotDefaults:i,...t}),s=[],a=$v(e);s.push(...Array.from(a).map(c=>dp(c)));for(let c of Object.values(n)){let l=c.instantiate(o);l&&s.push(l)}s.length>0&&await o.coordinator.exec(s);for(let[c,l]of Object.entries(r))if(!o.activeParams.has(c)){let u=l.instantiate(o);o.activeParams.set(c,u)}return{element:e.root.instantiate(o),params:o.activeParams}}var Pv=class{constructor({api:t=mO(),plotDefaults:n=[],params:r=new Map,baseURL:i=null}={}){this.api=t,this.plotDefaults=n,this.activeParams=r,this.baseURL=i,this.coordinator=t.context.coordinator}error(t,n){zh(t,n)}};function Sit(e,t={}){let{root:n,data:r,params:i,plotDefaults:o}=e,{preamble:s,...a}=t,c=new Uv({plotDefaults:o,...a}),l=[];for(let[x,b]of c.imports)l.push(Sc(b)?`import ${b} from "${x}";`:`import { ${b.join(", ")} } from "${x}";`);let u=s?Nv(s).map(x=>`${c.tab()}${x}`):[],f=[];if(c.connector){let x=`${c.ns()}${c.connector}Connector()`;f.push(`${c.tab()}${c.ns()}coordinator().databaseConnector(${x});`)}let h=[];for(let x of $v(e))h.push(`${c.ns()}loadExtension("${x}")`);for(let x of Object.values(r)){let b=x.codegen(c);b&&h.push(b)}let d=[];h.length&&(d.push(`${c.tab()}await ${c.ns()}coordinator().exec([`),c.indent(),d.push(h.map(x=>`${c.tab()}${x}`).join(`,
73
- `)),c.undent(),d.push(`${c.tab()}]);`));let p=[];for(let[x,b]of Object.entries(i))p.push(`const ${kg(x)} = ${b.codegen(c)};`);let m=[],y=o;y.length&&(m=["const defaultAttributes = [",y.map(x=>" "+x.codegen(c)).join(`,
74
- `),"];"]);let g=[`export default ${n.codegen(c)};`];return[...l,...Vh(l),...u,...Vh(u),...f,...Vh(f),...d,...Vh(d),...p,...Vh(p),...m,...Vh(m),...g].join(`
75
- `)}var Uv=class{constructor({plotDefaults:t=void 0,namespace:n="vg",connector:r=void 0,imports:i=new Map([["@uwdata/vgplot","* as vg"]]),baseURL:o=void 0,depth:s=0}={}){this.plotDefaults=t,this.namespace=`${n}.`,this.connector=r,this.imports=i,this.baseURL=o,this.depth=s}addImport(t,n){this.imports.has(t)?this.imports.get(t).push(n):this.imports.set(t,[n])}setImports(t,n){this.imports.set(t,n)}ns(){return this.namespace}indent(){this.depth+=1}undent(){this.depth-=1}tab(){return Array.from({length:this.depth},()=>" ").join("")}stringify(t){if(vi(t)){let n=t.map(r=>this.stringify(r));return`[${this.maybeLineWrap(n)}]`}else if(Uh(t)){let n=Object.entries(t).map(([r,i])=>`${Iit(r)}: ${this.stringify(i)}`);return`{${this.maybeLineWrap(n)}}`}else return JSON.stringify(t)}maybeLineWrap(t){let n=80-2*this.depth;if(2*t.length+t.reduce((i,o)=>i+o.length,0)>n){this.indent();let i=t.map(o=>`
76
- ${this.tab()}${o}`).join(",");return this.undent(),i+`
77
- `+this.tab()}else return t.join(", ")}error(t,n){zh(t,n)}};function Iit(e){return/^[A-Za-z_$]\w*/.test(e)?e:JSON.stringify(e)}function Vh(e){return e?.length?[""]:[]}var ru=class extends Rt{constructor(t){super(Av),this.value=t}instantiate(){return this.value}codegen(t){return t.stringify(this.value)}toJSON(){return this.value}};var iu=class extends Rt{constructor(t=Tv,n,r){super(Ez),this.select=t,this.cross=n,this.empty=r}instantiate(t){let{select:n,cross:r,empty:i}=this;return t.api.Selection[n]({cross:r,empty:i})}codegen(t){let{select:n,cross:r,empty:i}=this,o=[["cross",r],["empty",i]].filter(a=>a[1]!=null).map(a=>`${a[0]}: ${a[1]}`),s=o.length?`{ ${o.join(", ")} }`:"";return`${t.ns()}Selection.${n}(${s})`}toJSON(){let{select:t,cross:n,empty:r}=this;return{select:t,cross:n,empty:r}}};var Ait=new Set([Mv,Lz,Oz,Tv,Bz]);function Xz(e,t){let n=Uh(e)?e:{value:e},{select:r=Mv,cross:i,empty:o,date:s,value:a}=n;return Ait.has(r)||t.error(`Unrecognized param type: ${r}`,n),r!==Mv?new iu(r,i,o):vi(a)?new ou(a.map(c=>t.maybeParam(c))):new ou(a,s)}var ou=class extends Rt{constructor(t,n){super(Dz),this.value=t,this.date=n}instantiate(t){let{date:n,value:r}=this,{Param:i}=t.api;return vi(r)?i.array(r.map(o=>o.instantiate(t))):i.value(Pz(n,r))}codegen(t){let{value:n,date:r}=this,i=`${t.ns()}Param.`;return vi(n)?`${i}array([${n.map(o=>o.codegen(t)).join(", ")}])`:r?`${i}value(new Date(${JSON.stringify(r)}))`:`${i}value(${JSON.stringify(n)})`}toJSON(){let{date:t,value:n}=this;return vi(n)?n.map(r=>r.toJSON()):t?{date:t}:n}};var Rg=class extends Rt{constructor(t){super(Nz),this.name=t}instantiate(t){return t.activeParams?.get(this.name)}codegen(){return kg(this.name)}toJSON(){return kg(this.name)}};function jv(e,t,n){return n.plot?.attributes?.has(e)||n.error(`Unrecognized attribute: ${e}`),new zv(e,t===Lg?new qv:n.maybeParam(t))}var zv=class extends Rt{constructor(t,n){super(Rz),this.name=t,this.value=n}instantiate(t){let{name:n,value:r}=this;return t.api[n](r.instantiate(t))}codegen(t){let{name:n,value:r}=this;return`${t.tab()}${t.ns()}${n}(${r.codegen(t)})`}toJSON(){let{name:t,value:n}=this;return{[t]:n.toJSON()}}},qv=class extends Rt{constructor(){super(Av),this.value=Lg}instantiate(t){return t.api[Lg]}codegen(t){return`${t.ns()}${Lg}`}toJSON(){return this.value}};function Gz(e,t){let n=e[kh].map(r=>t.parseComponent(r));return new Vv(n)}var Vv=class extends Rt{constructor(t){super(kh,t)}instantiate(t){return t.api[kh](this.children.map(n=>n.instantiate(t)))}codegen(t){t.indent();let n=this.children.map(r=>r.codegen(t));return t.undent(),`${t.tab()}${t.ns()}${this.type}(
63
+ ]`;return`${e.ns()}loadObjects("${n}", ${s}${i})`}toJSON(){let{format:e,data:n,options:r}=this;return{type:e,data:n,...r.toJSON()}}};function B2(t){let e=t.config?.extensions,n=new Set(e?el(e):[]);for(let r of Object.values(t.data))r.format===q2&&n.add("spatial");return n}async function qK(t,e){let{data:n,params:r,plotDefaults:o}=t,i=new z2({plotDefaults:o,...e}),s=[],a=B2(t);s.push(...Array.from(a).map(c=>Jl(c)));for(let c of Object.values(n)){let f=c.instantiate(i);f&&s.push(f)}s.length>0&&await i.coordinator.exec(s);for(let[c,f]of Object.entries(r))if(!i.activeParams.has(c)){let u=f.instantiate(i);i.activeParams.set(c,u)}return{element:t.root.instantiate(i),params:i.activeParams}}var z2=class{constructor({api:e=c7(),plotDefaults:n=[],params:r=new Map,baseURL:o=null}={}){this.api=e,this.plotDefaults=n,this.activeParams=r,this.baseURL=o,this.coordinator=e.context.coordinator}error(e,n){rl(e,n)}};function BK(t,e={}){let{root:n,data:r,params:o,plotDefaults:i}=t,{preamble:s,...a}=e,c=new Y2({plotDefaults:i,...a}),f=[];for(let[y,b]of c.imports)f.push(ra(b)?`import ${b} from "${y}";`:`import { ${b.join(", ")} } from "${y}";`);let u=s?el(s).map(y=>`${c.tab()}${y}`):[],p=[];if(c.connector){let y=`${c.ns()}${c.connector}Connector()`;p.push(`${c.tab()}${c.ns()}coordinator().databaseConnector(${y});`)}let l=[];for(let y of B2(t))l.push(`${c.ns()}loadExtension("${y}")`);for(let y of Object.values(r)){let b=y.codegen(c);b&&l.push(b)}let d=[];l.length&&(d.push(`${c.tab()}await ${c.ns()}coordinator().exec([`),c.indent(),d.push(l.map(y=>`${c.tab()}${y}`).join(`,
64
+ `)),c.undent(),d.push(`${c.tab()}]);`));let h=[];for(let[y,b]of Object.entries(o))h.push(`const ${Am(y)} = ${b.codegen(c)};`);let m=[],x=i;x.length&&(m=["const defaultAttributes = [",x.map(y=>" "+y.codegen(c)).join(`,
65
+ `),"];"]);let g=[`export default ${n.codegen(c)};`];return[...f,...il(f),...u,...il(u),...p,...il(p),...d,...il(d),...h,...il(h),...m,...il(m),...g].join(`
66
+ `)}var Y2=class{constructor({plotDefaults:e=void 0,namespace:n="vg",connector:r=void 0,imports:o=new Map([["@uwdata/vgplot","* as vg"]]),baseURL:i=void 0,depth:s=0}={}){this.plotDefaults=e,this.namespace=`${n}.`,this.connector=r,this.imports=o,this.baseURL=i,this.depth=s}addImport(e,n){this.imports.has(e)?this.imports.get(e).push(n):this.imports.set(e,[n])}setImports(e,n){this.imports.set(e,n)}ns(){return this.namespace}indent(){this.depth+=1}undent(){this.depth-=1}tab(){return Array.from({length:this.depth},()=>" ").join("")}stringify(e){if(Fr(e)){let n=e.map(r=>this.stringify(r));return`[${this.maybeLineWrap(n)}]`}else if(nl(e)){let n=Object.entries(e).map(([r,o])=>`${zK(r)}: ${this.stringify(o)}`);return`{${this.maybeLineWrap(n)}}`}else return JSON.stringify(e)}maybeLineWrap(e){let n=80-2*this.depth;if(2*e.length+e.reduce((o,i)=>o+i.length,0)>n){this.indent();let o=e.map(i=>`
67
+ ${this.tab()}${i}`).join(",");return this.undent(),o+`
68
+ `+this.tab()}else return e.join(", ")}error(e,n){rl(e,n)}};function zK(t){return/^[A-Za-z_$]\w*/.test(t)?t:JSON.stringify(t)}function il(t){return t?.length?[""]:[]}var ia=class extends gt{constructor(e){super(I2),this.value=e}instantiate(){return this.value}codegen(e){return e.stringify(this.value)}toJSON(){return this.value}};function WF(t,e){let{select:n,include:r,...o}=t,i=Ze(o,e);return r&&(i.options.include=new d7(el(r).map(s=>e.selectionRef(Mm(s))))),new Rc(n,i)}var Rc=class extends gt{constructor(e=C2,n=new oa({})){super(EF),this.select=e,this.options=n}instantiate(e){let{select:n,options:r}=this;return e.api.Selection[n](r.instantiate(e))}codegen(e){let{select:n,options:r}=this;return`${e.ns()}Selection.${n}(${r.codegen(e)})`}toJSON(){let{select:e,options:n}=this;return{select:e,...n.toJSON()}}},d7=class extends gt{constructor(e){super(kF),this.refs=e}instantiate(e){return this.refs.map(n=>n.instantiate(e))}codegen(e){return`[${this.refs.map(n=>n.codegen(e)).join(", ")}]`}toJSON(){return this.refs.map(e=>e.toJSON())}};var YK=new Set([N2,OF,LF,C2,RF]);function VF(t,e){let n=nl(t)?t:{value:t},{select:r=N2,value:o,date:i}=n;return YK.has(r)||e.error(`Unrecognized param type: ${r}`,n),r!==N2?WF(t,e):Fr(o)?new Oc(o.map(s=>e.maybeParam(s))):new Oc(o,i)}var Oc=class extends gt{constructor(e,n){super(CF),this.value=e,this.date=n}instantiate(e){let{date:n,value:r}=this,{Param:o}=e.api;return Fr(r)?o.array(r.map(i=>i.instantiate(e))):o.value(qF(n,r))}codegen(e){let{value:n,date:r}=this,o=`${e.ns()}Param.`;return Fr(n)?`${o}array([${n.map(i=>i.codegen(e)).join(", ")}])`:r?`${o}value(new Date(${JSON.stringify(r)}))`:`${o}value(${JSON.stringify(n)})`}toJSON(){let{date:e,value:n}=this;return Fr(n)?n.map(r=>r.toJSON()):e?{date:e}:n}};var Tm=class extends gt{constructor(e){super(IF),this.name=e}instantiate(e){return e.activeParams?.get(this.name)}codegen(e){return Am(this.name)}toJSON(){return Am(this.name)}};function X2(t,e,n){return n.plot?.attributes?.has(t)||n.error(`Unrecognized attribute: ${t}`),new U2(t,e===_m?new j2:n.maybeParam(e))}var U2=class extends gt{constructor(e,n){super(PF),this.name=e,this.value=n}instantiate(e){let{name:n,value:r}=this;return e.api[n](r.instantiate(e))}codegen(e){let{name:n,value:r}=this;return`${e.tab()}${e.ns()}${n}(${r.codegen(e)})`}toJSON(){let{name:e,value:n}=this;return{[e]:n.toJSON()}}},j2=class extends gt{constructor(){super(I2),this.value=_m}instantiate(e){return e.api[_m]}codegen(e){return`${e.ns()}${_m}`}toJSON(){return this.value}};function GF(t,e){let n=t[Qu].map(r=>e.parseComponent(r));return new W2(n)}var W2=class extends gt{constructor(e){super(Qu,e)}instantiate(e){return e.api[Qu](this.children.map(n=>n.instantiate(e)))}codegen(e){e.indent();let n=this.children.map(r=>r.codegen(e));return e.undent(),`${e.tab()}${e.ns()}${this.type}(
78
69
  ${n.join(`,
79
70
  `)}
80
- ${t.tab()})`}toJSON(){return{[this.type]:this.children.map(t=>t.toJSON())}}};function Wz(e){return new Yv(e[Fh])}var Yv=class extends Rt{constructor(t){super(Fh),this.value=t}instantiate(t){return t.api[Fh](this.value)}codegen(t){return`${t.tab()}${t.ns()}${this.type}(${t.stringify(this.value)})`}toJSON(){return{[this.type]:this.value}}};function Hz(e,t){let{[Og]:n,...r}=e;return t.inputs?.has(n)||t.error(`Unrecognized input type: ${n}`,e),new Xv(n,Gn(r,t))}var Xv=class extends Rt{constructor(t,n){super(Og),this.name=t,this.options=n}instantiate(t){return t.api[this.name](this.options.instantiate(t))}codegen(t){let n=this.options.codegen(t);return`${t.tab()}${t.ns()}${this.name}(${n})`}toJSON(){let{type:t,name:n,options:r}=this;return{[t]:n,...r.toJSON()}}};function Wv(e,t){let{[Bg]:n,...r}=e,i=`${n}Legend`;return t.plot?.legends?.has(i)||t.error(`Unrecognized legend type: ${n}`,e),new Gv(i,n,Gn(r,t))}var Gv=class extends Rt{constructor(t,n,r){super(Bg),this.key=t,this.name=n,this.options=r}instantiate(t){return t.api[this.key](this.options.instantiate(t))}codegen(t){let n=this.options.codegen(t);return`${t.tab()}${t.ns()}${this.key}(${n})`}toJSON(){let{type:t,name:n,options:r}=this;return{[t]:n,...r.toJSON()}}};function Zz(e,t){let{[yO]:n,...r}=e;return t.plot?.interactors?.has(n)||t.error(`Unrecognized interactor type: ${n}`,e),new Hv(n,Gn(r,t))}var Hv=class extends Rt{constructor(t,n){super(Fz),this.name=t,this.options=n}instantiate(t){return t.api[this.name](this.options.instantiate(t))}codegen(t){let n=this.options.codegen(t);return`${t.tab()}${t.ns()}${this.name}(${n})`}toJSON(){let{name:t,options:n}=this;return{[yO]:t,...n.toJSON()}}};function Jz(e,t){let{label:n}=e,r=e[vc]?vc:e[ha]?ha:t.error("Unrecognized expression type",e),i=e[r],o=i.split(/(\\'|\\"|"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\$\w+)/g),s=[""],a=[];for(let c=0,l=0;c<o.length;++c){let u=o[c];u.startsWith("$")?(a[l]=t.maybeParam(u),s[++l]=""):s[l]+=u}return new Zv(i,s,a,n,r===ha)}var Zv=class extends Rt{constructor(t,n,r,i,o){super(kz),this.value=t,this.spans=n,this.params=r,this.label=i,this.aggregate=o}instantiate(t){let{spans:n,params:r,label:i,aggregate:o}=this,s=t.api[o?ha:vc],a=r.map(c=>c.instantiate(t));return s(n,...a).annotate({label:i})}codegen(t){let{spans:n,params:r,label:i,aggregate:o}=this,s=o?ha:vc,a="",c=r.length;for(let l=0;l<c;++l)a+=n[l]+"${"+r[l].codegen(t)+"}";return a+=n[c],`${t.ns()}${s}\`${a}\``+(i?`.annotate({ label: ${JSON.stringify(i)} })`:"")}toJSON(){return{[this.aggregate?ha:vc]:this.value}}};function Qz(e,t){if(!e)return null;if(vi(e))return new ru(e);let{from:n,...r}=e;return new Jv(n,Gn(r,t))}var Jv=class extends Rt{constructor(t,n){super(gO),this.table=t,this.options=n}instantiate(t){let{table:n,options:r}=this;return t.api[gO](n,r.instantiate(t))}codegen(t){let{type:n,table:r,options:i}=this,o=i.codegen(t);return`${t.ns()}${n}("${r}"${o?", "+o:""})`}toJSON(){let{type:t,table:n,options:r}=this;return{[t]:n,...r.toJSON()}}};function Qv(e){return e==null?[]:[e].flat()}function Kz(e,t){let n;for(let r in e)t.transforms.has(r)&&(n=r);if(n)if(n==="bin"){let{bin:r,...i}=e,[o]=Qv(r);return new _O(n,o,Gn(i,t))}else{let r=n==="count"&&!e[n]?[]:Qv(e[n]),i={distinct:e.distinct,orderby:Qv(e.orderby).map(o=>t.maybeParam(o)),partitionby:Qv(e.partitionby).map(o=>t.maybeParam(o)),rows:e.rows?t.maybeParam(e.rows):null,range:e.range?t.maybeParam(e.range):null};return new Kv(n,r,i)}}var Kv=class extends Rt{constructor(t,n,r){super(xO),this.name=t,this.args=n,this.options=r}instantiate(t){let{name:n,args:r,options:i}=this,{distinct:o,orderby:s,partitionby:a,rows:c,range:l}=i,u=t.api[n](...r);return o&&(u=u.distinct()),s.length&&(u=u.orderby(s.map(f=>f.instantiate(t)))),a.length&&(u=u.partitionby(a.map(f=>f.instantiate(t)))),c!=null?u=u.rows(c.instantiate(t)):l!=null&&(u=u.range(l.instantiate(t))),u}codegen(t){let{name:n,args:r,options:i}=this,{distinct:o,orderby:s,partitionby:a,rows:c,range:l}=i,u=`${t.ns()}${n}(`+r.map(f=>JSON.stringify(f)).join(", ")+")";if(o&&(u+=".distinct()"),s.length){let f=s.map(h=>h.codegen(t));u+=`.orderby(${f.join(", ")})`}if(a.length){let f=a.map(h=>h.codegen(t));u+=`.partitionby(${f.join(", ")})`}return c?u+=`.rows(${c.codegen(t)})`:l&&(u+=`.range(${l.codegen(t)})`),u}toJSON(){let{name:t,args:n,options:r}=this,{distinct:i,orderby:o,partitionby:s,rows:a,range:c}=r,l={[t]:wO(n)};return i&&(l.distinct=!0),o.length&&(l.orderby=wO(o.map(u=>u.toJSON()))),s.length&&(l.partitionby=wO(s.map(u=>u.toJSON()))),a?l.rows=a.toJSON():c&&(l.range=c.toJSON()),l}},_O=class extends Rt{constructor(t,n,r){super(xO),this.name=t,this.arg=n,this.options=r}instantiate(t){let{name:n,arg:r,options:i}=this;return t.api[n](r,i.instantiate(t))}codegen(t){let{name:n,arg:r,options:i}=this,o=i.codegen(t);return`${t.ns()}${n}(`+JSON.stringify(r)+(o?`, ${o}`:"")+")"}toJSON(){let{name:t,arg:n,options:r}=this;return{[t]:n,...r.toJSON()}}};function wO(e){return e.length===0?"":e.length===1?e[0]:e}function Mit(e,t){if(Uh(e))return e[vc]||e[ha]?Jz(e,t):Kz(e,t)}function tq(e,t){let{mark:n,data:r,...i}=e;t.plot?.marks?.has(n)||t.error(`Unrecognized mark type: ${n}`,e);let o=Qz(r,t),s={};for(let a in i){let c=i[a];s[a]=Mit(c,t)||t.maybeParam(c)}return new t2(n,o,new qh(s))}var t2=class extends Rt{constructor(t,n,r){super(Ev),this.name=t,this.data=n,this.options=r}instantiate(t){let{name:n,data:r,options:i}=this,o=i.instantiate(t);return r?t.api[n](r.instantiate(t),o):t.api[n](o)}codegen(t){let{name:n,data:r,options:i}=this,o=r?r.codegen(t):"",s=i.codegen(t),a;if(o&&s){t.indent();let c=i.codegen(t);a=`
81
- ${t.tab()}${o},
82
- ${t.tab()}${c}
83
- `,t.undent(),a+=t.tab()}else a=`${o}${s}`;return`${t.tab()}${t.ns()}${n}(${a})`}toJSON(){let{type:t,name:n,data:r,options:i}=this;return{[t]:n,...r?{data:r.toJSON()}:{},...i.toJSON()}}};function eq(e,t){return vO({plot:[e]},t)}function vO(e,t){let{[Ph]:n,...r}=e,i=Object.entries(r).map(([s,a])=>jv(s,a,t)),o=n.map(s=>Sc(s.mark)?tq(s,t):Sc(s.legend)?Wv(s,t):Sc(s.select)?Zz(s,t):t.error("Invalid plot entry.",s));return new e2(o,i)}var e2=class extends Rt{constructor(t,n){super(Ph,t),this.attributes=n}instantiate(t){let n=[...t.plotDefaults||[],...this.attributes||[]];return t.api[Ph](this.children.map(r=>r.instantiate(t)),n.map(r=>r.instantiate(t)))}codegen(t){let{type:n,children:r,attributes:i}=this;t.indent();let o=[...r.map(s=>s.codegen(t)),...t.plotDefaults?.length?[`${t.tab()}...defaultAttributes`]:[],...i.map(s=>s.codegen(t))].join(`,
84
- `);return t.undent(),`${t.tab()}${t.ns()}${n}(
85
- ${o}
86
- ${t.tab()})`}toJSON(){let{type:t,children:n,attributes:r}=this,i={[t]:n.map(o=>o.toJSON())};for(let o of r)Object.assign(i,o.toJSON());return i}};function nq(e,t){let n=e[Rh].map(r=>t.parseComponent(r));return new n2(n)}var n2=class extends Rt{constructor(t){super(Rh,t)}instantiate(t){return t.api[Rh](this.children.map(n=>n.instantiate(t)))}codegen(t){t.indent();let n=this.children.map(r=>r.codegen(t));return t.undent(),`${t.tab()}${t.ns()}${this.type}(
71
+ ${e.tab()})`}toJSON(){return{[this.type]:this.children.map(e=>e.toJSON())}}};function HF(t){return new V2(t[Ju])}var V2=class extends gt{constructor(e){super(Ju),this.value=e}instantiate(e){return e.api[Ju](this.value)}codegen(e){return`${e.tab()}${e.ns()}${this.type}(${e.stringify(this.value)})`}toJSON(){return{[this.type]:this.value}}};function QF(t,e){let{[wm]:n,...r}=t;return e.inputs?.has(n)||e.error(`Unrecognized input type: ${n}`,t),new G2(n,Ze(r,e))}var G2=class extends gt{constructor(e,n){super(wm),this.name=e,this.options=n}instantiate(e){return e.api[this.name](this.options.instantiate(e))}codegen(e){let n=this.options.codegen(e);return`${e.tab()}${e.ns()}${this.name}(${n})`}toJSON(){let{type:e,name:n,options:r}=this;return{[e]:n,...r.toJSON()}}};function Q2(t,e){let{[vm]:n,...r}=t,o=`${n}Legend`;return e.plot?.legends?.has(o)||e.error(`Unrecognized legend type: ${n}`,t),new H2(o,n,Ze(r,e))}var H2=class extends gt{constructor(e,n,r){super(vm),this.key=e,this.name=n,this.options=r}instantiate(e){return e.api[this.key](this.options.instantiate(e))}codegen(e){let n=this.options.codegen(e);return`${e.tab()}${e.ns()}${this.key}(${n})`}toJSON(){let{type:e,name:n,options:r}=this;return{[e]:n,...r.toJSON()}}};function ZF(t,e){let{[f7]:n,...r}=t;return e.plot?.interactors?.has(n)||e.error(`Unrecognized interactor type: ${n}`,t),new Z2(n,Ze(r,e))}var Z2=class extends gt{constructor(e,n){super(FF),this.name=e,this.options=n}instantiate(e){return e.api[this.name](this.options.instantiate(e))}codegen(e){let n=this.options.codegen(e);return`${e.tab()}${e.ns()}${this.name}(${n})`}toJSON(){let{name:e,options:n}=this;return{[f7]:e,...n.toJSON()}}};var J2=class extends gt{constructor(e){super(NF),this.param=e}instantiate(e){return e.api.column(this.param.instantiate(e))}codegen(e){return`${e.ns()}column(${this.param.codegen(e)})`}toJSON(){return`$${this.param.toJSON}`}};var UK=/(\\'|\\"|"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\${1,2}\w+)/g;function JF(t,e){let n=t[kc],r=n.split(UK),o=[""],i=[];for(let s=0,a=0;s<r.length;++s){let c=r[s];c.startsWith("$")?(i[a]=c.startsWith("$$")?new J2(e.paramRef(c.slice(2))):e.maybeParam(c),o[++a]=""):o[a]+=c}return new K2(n,o,i)}var K2=class extends gt{constructor(e,n,r){super(DF),this.value=e,this.spans=n,this.params=r}instantiate(e){let{spans:n,params:r}=this,o=e.api[kc],i=r.map(s=>s.instantiate(e));return o(n,...i)}codegen(e){let{spans:n,params:r}=this,o="",i=r.length;for(let s=0;s<i;++s)o+=n[s]+"${"+r[s].codegen(e)+"}";return o+=n[i],`${e.ns()}${kc}\`${o}\``}toJSON(){return{[kc]:this.value}}};function KF(t,e){if(!t)return null;if(Fr(t))return new ia(t);let{from:n,...r}=t;return new tw(e.maybeParam(n),Ze(r,e))}var tw=class extends gt{constructor(e,n){super(u7),this.table=e,this.options=n}instantiate(e){let{table:n,options:r}=this;return e.api[u7](n.instantiate(e),r.instantiate(e))}codegen(e){let n=this.table.codegen(e),r=this.options.codegen(e);return`${e.ns()}${this.type}(${n}${r?", "+r:""})`}toJSON(){let{type:e,table:n,options:r}=this;return{[e]:n.toJSON(),...r.toJSON()}}};function ew(t,e){return t==null?[]:[t].flat().map(n=>e.maybeParam(n))}function tq(t,e){let n;for(let r in t)e.transforms.has(r)&&(n=r);if(n)if(n==="bin"){let{bin:r,...o}=t,[i]=ew(r,e);return new m7(n,i,Ze(o,e))}else{let r=n==="count"&&!t[n]?[]:ew(t[n],e),o={distinct:t.distinct,orderby:ew(t.orderby,e),partitionby:ew(t.partitionby,e),rows:t.rows?e.maybeParam(t.rows):null,range:t.range?e.maybeParam(t.range):null};return new nw(n,r,o)}}var nw=class extends gt{constructor(e,n,r){super(l7),this.name=e,this.args=n,this.options=r}instantiate(e){let{name:n,args:r,options:o}=this,{distinct:i,orderby:s,partitionby:a,rows:c,range:f}=o,u=e.api[n](...r.map(p=>p.instantiate(e)));return i&&(u=u.distinct()),s.length&&(u=u.orderby(s.map(p=>p.instantiate(e)))),a.length&&(u=u.partitionby(a.map(p=>p.instantiate(e)))),c!=null?u=u.rows(c.instantiate(e)):f!=null&&(u=u.range(f.instantiate(e))),u}codegen(e){let{name:n,args:r,options:o}=this,{distinct:i,orderby:s,partitionby:a,rows:c,range:f}=o,u=`${e.ns()}${n}(`+r.map(p=>p.codegen(e)).join(", ")+")";if(i&&(u+=".distinct()"),s.length){let p=s.map(l=>l.codegen(e));u+=`.orderby(${p.join(", ")})`}if(a.length){let p=a.map(l=>l.codegen(e));u+=`.partitionby(${p.join(", ")})`}return c?u+=`.rows(${c.codegen(e)})`:f&&(u+=`.range(${f.codegen(e)})`),u}toJSON(){let{name:e,args:n,options:r}=this,{distinct:o,orderby:i,partitionby:s,rows:a,range:c}=r,f={[e]:h7(n.map(u=>u.toJSON()))};return o&&(f.distinct=!0),i.length&&(f.orderby=h7(i.map(u=>u.toJSON()))),s.length&&(f.partitionby=h7(s.map(u=>u.toJSON()))),a?f.rows=a.toJSON():c&&(f.range=c.toJSON()),f}},m7=class extends gt{constructor(e,n,r){super(l7),this.name=e,this.arg=n,this.options=r}instantiate(e){let{name:n,arg:r,options:o}=this;return e.api[n](r.instantiate(e),o.instantiate(e))}codegen(e){let{name:n,arg:r,options:o}=this,i=o.codegen(e);return`${e.ns()}${n}(`+r.codegen(e)+(i?`, ${i}`:"")+")"}toJSON(){let{name:e,arg:n,options:r}=this;return{[e]:n.toJSON(),...r.toJSON()}}};function h7(t){return t.length===0?"":t.length===1?t[0]:t}function jK(t,e){if(nl(t))return t[kc]?JF(t,e):tq(t,e)}function eq(t,e){let{mark:n,data:r,...o}=t;e.plot?.marks?.has(n)||e.error(`Unrecognized mark type: ${n}`,t);let i=KF(r,e),s={};for(let a in o){let c=o[a];s[a]=jK(c,e)||e.maybeParam(c)}return new rw(n,i,new oa(s))}var rw=class extends gt{constructor(e,n,r){super(k2),this.name=e,this.data=n,this.options=r}instantiate(e){let{name:n,data:r,options:o}=this,i=o.instantiate(e);return r?e.api[n](r.instantiate(e),i):e.api[n](i)}codegen(e){let{name:n,data:r,options:o}=this,i=r?r.codegen(e):"",s=o.codegen(e),a;if(i&&s){e.indent();let c=o.codegen(e);a=`
72
+ ${e.tab()}${i},
73
+ ${e.tab()}${c}
74
+ `,e.undent(),a+=e.tab()}else a=`${i}${s}`;return`${e.tab()}${e.ns()}${n}(${a})`}toJSON(){let{type:e,name:n,data:r,options:o}=this;return{[e]:n,...r?{data:r.toJSON()}:{},...o.toJSON()}}};function nq(t,e){return x7({plot:[t]},e)}function x7(t,e){let{[tl]:n,...r}=t,o=Object.entries(r).map(([s,a])=>X2(s,a,e)),i=n.map(s=>ra(s.mark)?eq(s,e):ra(s.legend)?Q2(s,e):ra(s.select)?ZF(s,e):e.error("Invalid plot entry.",s));return new ow(i,o)}var ow=class extends gt{constructor(e,n){super(tl,e),this.attributes=n}instantiate(e){let n=[...e.plotDefaults||[],...this.attributes||[]];return e.api[tl](this.children.map(r=>r.instantiate(e)),n.map(r=>r.instantiate(e)))}codegen(e){let{type:n,children:r,attributes:o}=this;e.indent();let i=[...r.map(s=>s.codegen(e)),...e.plotDefaults?.length?[`${e.tab()}...defaultAttributes`]:[],...o.map(s=>s.codegen(e))].join(`,
75
+ `);return e.undent(),`${e.tab()}${e.ns()}${n}(
76
+ ${i}
77
+ ${e.tab()})`}toJSON(){let{type:e,children:n,attributes:r}=this,o={[e]:n.map(i=>i.toJSON())};for(let i of r)Object.assign(o,i.toJSON());return o}};function rq(t,e){let n=t[Zu].map(r=>e.parseComponent(r));return new iw(n)}var iw=class extends gt{constructor(e){super(Zu,e)}instantiate(e){return e.api[Zu](this.children.map(n=>n.instantiate(e)))}codegen(e){e.indent();let n=this.children.map(r=>r.codegen(e));return e.undent(),`${e.tab()}${e.ns()}${this.type}(
87
78
  ${n.join(`,
88
79
  `)}
89
- ${t.tab()})`}toJSON(){return{[this.type]:this.children.map(t=>t.toJSON())}}};function rq(e){return new r2(e[$h])}var r2=class extends Rt{constructor(t){super($h),this.value=t}instantiate(t){return t.api[$h](this.value)}codegen(t){return`${t.tab()}${t.ns()}${this.type}(${t.stringify(this.value)})`}toJSON(){return{[this.type]:this.value}}};function iq(e=[]){return new Map([[Ph,vO],[Ev,eq],[Bg,Wv],[Og,Hz],[kh,Gz],[Rh,nq],[Fh,Wz],[$h,rq],...e])}function oq(e=[]){return new Set(["menu","search","slider","table",...e])}function sq({attributes:e=Tit(),interactors:t=Eit(),legends:n=Nit(),marks:r=Dit()}={}){return{attributes:e,interactors:t,legends:n,marks:r}}function Tit(e=[]){return new Set([...Object.keys(wv),...e])}function Eit(e=[]){return new Set([...Object.keys(Sv),...e])}function Nit(e=[]){return new Set([...Object.keys(Iv),...e])}function Dit(e=[]){return new Set([...Object.keys(vv),...e])}function aq(e=[]){return new Set(["argmin","argmax","avg","bin","centroid","centroidX","centroidY","count","covariance","covarPop","dateMonth","dateMonthDay","dateDay","first","geojson","last","max","median","min","mode","product","quantile","stddev","stddevPop","sum","variance","varPop","row_number","rank","dense_rank","percent_rank","cume_dist","ntile","lag","lead","first_value","last_value","nth_value",...e])}function Oit(e,t){return new SO(t).parse(e)}var SO=class{constructor({components:t=iq(),transforms:n=aq(),inputs:r=oq(),plot:i=sq(),params:o=[],datasets:s=[]}={}){this.components=t,this.transforms=n,this.inputs=r,this.plot=i,this.params=new Map(o),this.datasets=new Map(s)}parse(t){let{meta:n,config:r,data:i={},params:o,plotDefaults:s={},...a}=t;for(let c in i)this.datasets.set(c,Yz(c,i[c],this));this.plotDefaults=Object.entries(s).map(([c,l])=>jv(c,l,this));for(let c in o)this.params.set(c,Xz(o[c],this));return new Cg(this.parseComponent(a),n?{...n}:void 0,r?{...r}:void 0,Object.fromEntries(this.datasets),Object.fromEntries(this.params),this.plotDefaults)}parseComponent(t){for(let[n,r]of this.components)if(t[n]!=null)return r(t,this);this.error("Invalid specification.",t)}maybeParam(t,n=()=>new ou){let{params:r}=this,i=$z(t);if(i){if(!r.has(i)){let o=n();r.set(i,o)}return new Rg(i)}return new ru(t)}maybeSelection(t){return this.maybeParam(t,()=>new iu)}error(t,n){zh(t,n)}};export{ha as AGG,Rt as ASTNode,Rz as ATTRIBUTE,Oz as CROSSFILTER,Cv as CSVDataNode,Uv as CodegenContext,Cz as DATA,XXt as DATAREF,Dv as DataNode,kz as EXPRESSION,Zv as ExpressionNode,Lg as FIXED,gO as FROM,nu as FileDataNode,kh as HCONCAT,Vv as HConcatNode,Fh as HSPACE,Yv as HSpaceNode,Og as INPUT,Fz as INTERACTOR,Tv as INTERSECT,Xv as InputNode,Pv as InstantiateContext,kv as JSONDataNode,Bg as LEGEND,Av as LITERAL,Rv as LiteralJSONDataNode,ru as LiteralNode,Ev as MARK,Tz as OPTIONS,qh as OptionsNode,Dz as PARAM,Nz as PARAMREF,Ph as PLOT,ou as ParamNode,Rg as ParamRefNode,Lv as ParquetDataNode,zv as PlotAttributeNode,qv as PlotFixedNode,Jv as PlotFromNode,Hv as PlotInteractorNode,Gv as PlotLegendNode,t2 as PlotMarkNode,e2 as PlotNode,jh as QueryDataNode,yO as SELECT,Ez as SELECTION,Lz as SINGLE,Mz as SPEC,vc as SQL,iu as SelectionNode,Bv as SpatialDataNode,Cg as SpecNode,xO as TRANSFORM,Ov as TableDataNode,Kv as TransformNode,Bz as UNION,Mv as VALUE,Rh as VCONCAT,n2 as VConcatNode,$h as VSPACE,r2 as VSpaceNode,vit as astToDOM,Sit as astToESM,Oit as parseSpec};
80
+ ${e.tab()})`}toJSON(){return{[this.type]:this.children.map(e=>e.toJSON())}}};function oq(t){return new sw(t[Ku])}var sw=class extends gt{constructor(e){super(Ku),this.value=e}instantiate(e){return e.api[Ku](this.value)}codegen(e){return`${e.tab()}${e.ns()}${this.type}(${e.stringify(this.value)})`}toJSON(){return{[this.type]:this.value}}};function iq(t=[]){return new Map([[tl,x7],[k2,nq],[vm,Q2],[wm,QF],[Qu,GF],[Zu,rq],[Ju,HF],[Ku,oq],...t])}function sq(t=[]){return new Set(["menu","search","slider","table",...t])}function aq({attributes:t=XK(),interactors:e=WK(),legends:n=VK(),marks:r=GK()}={}){return{attributes:t,interactors:e,legends:n,marks:r}}function XK(t=[]){return new Set([...Object.keys(S2),...t])}function WK(t=[]){return new Set([...Object.keys(T2),...t])}function VK(t=[]){return new Set([...Object.keys(E2),...t])}function GK(t=[]){return new Set([...Object.keys(A2),...t])}function cq(t=[]){return new Set(["argmin","argmax","avg","bin","centroid","centroidX","centroidY","column","count","covariance","covarPop","dateMonth","dateMonthDay","dateDay","first","geojson","last","max","median","min","mode","product","quantile","stddev","stddevPop","sum","variance","varPop","row_number","rank","dense_rank","percent_rank","cume_dist","ntile","lag","lead","first_value","last_value","nth_value",...t])}function HK(t,e){return new g7(e).parse(t)}var g7=class{constructor({components:e=iq(),transforms:n=cq(),inputs:r=sq(),plot:o=aq(),params:i=[],datasets:s=[]}={}){this.components=e,this.transforms=n,this.inputs=r,this.plot=o,this.params=new Map(i),this.datasets=new Map(s)}parse(e){let{meta:n,config:r,data:o={},params:i,plotDefaults:s={},...a}=e;for(let c in o)this.datasets.set(c,XF(c,o[c],this));this.plotDefaults=Object.entries(s).map(([c,f])=>X2(c,f,this));for(let c in i)this.params.set(c,VF(i[c],this));return new Sm(this.parseComponent(a),n?{...n}:void 0,r?{...r}:void 0,Object.fromEntries(this.datasets),Object.fromEntries(this.params),this.plotDefaults)}parseComponent(e){for(let[n,r]of this.components)if(e[n]!=null)return r(e,this);this.error("Invalid specification.",e)}maybeParam(e){let n=Mm(e);return n?this.paramRef(n):new ia(e)}maybeSelection(e){let n=Mm(e);return n?this.selectionRef(n):new ia(e)}paramRef(e,n=()=>new Oc){let{params:r}=this;if(!e)return null;let o=r.get(e);return o||(o=n(),r.set(e,o)),new Tm(e)}selectionRef(e,n=!1){let r=this.params.get(e);return n&&r&&!(r instanceof Rc)?null:this.paramRef(e,()=>new Rc)}error(e,n){rl(e,n)}};export{gt as ASTNode,PF as ATTRIBUTE,NF as COLUMPARAMREF,LF as CROSSFILTER,D2 as CSVDataNode,Y2 as CodegenContext,$F as DATA,bjt as DATAREF,L2 as DataNode,DF as EXPRESSION,K2 as ExpressionNode,_m as FIXED,u7 as FROM,Lc as FileDataNode,Qu as HCONCAT,W2 as HConcatNode,Ju as HSPACE,V2 as HSpaceNode,kF as INCLUDE,wm as INPUT,FF as INTERACTOR,C2 as INTERSECT,G2 as InputNode,z2 as InstantiateContext,P2 as JSONDataNode,vm as LEGEND,I2 as LITERAL,F2 as LiteralJSONDataNode,ia as LiteralNode,k2 as MARK,TF as OPTIONS,oa as OptionsNode,CF as PARAM,IF as PARAMREF,tl as PLOT,Oc as ParamNode,Tm as ParamRefNode,$2 as ParquetDataNode,U2 as PlotAttributeNode,j2 as PlotFixedNode,tw as PlotFromNode,Z2 as PlotInteractorNode,H2 as PlotLegendNode,rw as PlotMarkNode,ow as PlotNode,ol as QueryDataNode,f7 as SELECT,EF as SELECTION,OF as SINGLE,AF as SPEC,kc as SQL,Rc as SelectionNode,O2 as SpatialDataNode,Sm as SpecNode,l7 as TRANSFORM,R2 as TableDataNode,nw as TransformNode,RF as UNION,N2 as VALUE,Zu as VCONCAT,iw as VConcatNode,Ku as VSPACE,sw as VSpaceNode,qK as astToDOM,BK as astToESM,HK as parseSpec};